native-fn 1.0.74 → 1.0.76
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +5 -5
- package/dist/native.cjs +1 -1
- package/dist/native.min.cjs +1 -1
- package/dist/native.min.mjs +1 -1
- package/dist/native.mjs +1 -1
- package/dist/native.umd.js +1 -1
- package/dist/native.umd.min.js +1 -1
- package/dist/plugin/app/index.cjs +355 -176
- package/dist/plugin/app/index.min.cjs +1 -1
- package/dist/plugin/app/index.min.mjs +1 -1
- package/dist/plugin/app/index.mjs +355 -176
- package/dist/plugin/app/index.umd.js +355 -176
- package/dist/plugin/app/index.umd.min.js +1 -1
- package/dist/plugin/app/src/plugin/platform/cores/index.d.ts +12 -0
- package/dist/plugin/app/src/plugin/platform/types/platform.d.ts +16 -6
- package/dist/plugin/app/src/types/native.d.ts +5 -5
- package/dist/plugin/appearance/index.cjs +344 -165
- package/dist/plugin/appearance/index.min.cjs +1 -1
- package/dist/plugin/appearance/index.min.mjs +1 -1
- package/dist/plugin/appearance/index.mjs +344 -165
- package/dist/plugin/appearance/index.umd.js +344 -165
- package/dist/plugin/appearance/index.umd.min.js +1 -1
- package/dist/plugin/appearance/src/plugin/platform/cores/index.d.ts +12 -0
- package/dist/plugin/appearance/src/plugin/platform/types/platform.d.ts +16 -6
- package/dist/plugin/appearance/src/types/native.d.ts +5 -5
- package/dist/plugin/clipboard/index.cjs +339 -160
- package/dist/plugin/clipboard/index.min.cjs +1 -1
- package/dist/plugin/clipboard/index.min.mjs +1 -1
- package/dist/plugin/clipboard/index.mjs +339 -160
- package/dist/plugin/clipboard/index.umd.js +339 -160
- package/dist/plugin/clipboard/index.umd.min.js +1 -1
- package/dist/plugin/clipboard/src/plugin/platform/cores/index.d.ts +12 -0
- package/dist/plugin/clipboard/src/plugin/platform/types/platform.d.ts +16 -6
- package/dist/plugin/clipboard/src/types/native.d.ts +5 -5
- package/dist/plugin/fullscreen/index.cjs +348 -169
- package/dist/plugin/fullscreen/index.min.cjs +1 -1
- package/dist/plugin/fullscreen/index.min.mjs +1 -1
- package/dist/plugin/fullscreen/index.mjs +348 -169
- package/dist/plugin/fullscreen/index.umd.js +348 -169
- package/dist/plugin/fullscreen/index.umd.min.js +1 -1
- package/dist/plugin/fullscreen/src/plugin/platform/cores/index.d.ts +12 -0
- package/dist/plugin/fullscreen/src/plugin/platform/types/platform.d.ts +16 -6
- package/dist/plugin/fullscreen/src/types/native.d.ts +5 -5
- package/dist/plugin/platform/index.cjs +339 -160
- package/dist/plugin/platform/index.d.ts +17 -7
- package/dist/plugin/platform/index.min.cjs +1 -1
- package/dist/plugin/platform/index.min.mjs +1 -1
- package/dist/plugin/platform/index.mjs +339 -160
- package/dist/plugin/platform/index.umd.js +339 -160
- package/dist/plugin/platform/index.umd.min.js +1 -1
- package/dist/plugin/platform/src/plugin/platform/cores/index.d.ts +12 -0
- package/dist/plugin/platform/src/plugin/platform/types/platform.d.ts +16 -6
- package/dist/plugin/platform/src/types/native.d.ts +5 -5
- package/dist/plugin/theme/index.cjs +339 -160
- package/dist/plugin/theme/index.min.cjs +1 -1
- package/dist/plugin/theme/index.min.mjs +1 -1
- package/dist/plugin/theme/index.mjs +339 -160
- package/dist/plugin/theme/index.umd.js +339 -160
- package/dist/plugin/theme/index.umd.min.js +1 -1
- package/dist/plugin/theme/src/plugin/platform/cores/index.d.ts +12 -0
- package/dist/plugin/theme/src/plugin/platform/types/platform.d.ts +16 -6
- package/dist/plugin/theme/src/types/native.d.ts +5 -5
- package/dist/src/plugin/platform/cores/index.d.ts +12 -0
- package/dist/src/plugin/platform/types/platform.d.ts +16 -6
- package/dist/src/types/native.d.ts +5 -5
- package/package.json +8 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
var o,r,e,i,n;!function(o){o.Unknown="Unknown",o.Android="Android",o.iOS="iOS",o.Windows="Windows",o.MacOS="MacOS"}(o||(o={})),function(o){o.Unknown="Unknown",o.Mobile="Mobile",o.Desktop="Desktop"}(r||(r={})),function(o){o.Unknown="Unknown",o.EdgeHTML="EdgeHTML",o.ArkWeb="ArkWeb",o.Blink="Blink",o.Presto="Presto",o.WebKit="WebKit",o.Trident="Trident",o.NetFront="NetFront",o.KHTML="KHTML",o.Tasman="Tasman",o.Gecko="Gecko"}(e||(e={})),function(o){o.Unknown="Unknown",o.Chrome="Chrome",o.Safari="Safari",o.Edge="Edge",o.Firefox="Firefox",o.Opera="Opera",o.IE="IE",o.SamsungInternet="SamsungInternet"}(i||(i={})),function(o){o.Unknown="Unknown",o.ReactNative="ReactNative",o.Electron="Electron",o.Cordova="Cordova"}(n||(n={}));var a=void 0!==globalThis.navigator&&"string"==typeof globalThis.navigator.userAgent?globalThis.navigator.userAgent:"";var s={device:r.Unknown,os:o.Unknown,engine:e.Unknown,browser:i.Unknown,crossPlatformFramework:n.Unknown,osVersion:"",engineVersion:"",browserVersion:"",renderer:function(){if(void 0===globalThis.document)return"";var o=globalThis.document.createElement("canvas");if("function"!=typeof o.getContext)return"";var r=o.getContext("webgl2")||o.getContext("experimental-webgl")||o.getContext("webgl");if(null===r)return"";if(r instanceof WebGLRenderingContext||"getParameter"in r&&"function"==typeof r.getParameter){var e=r.getExtension("WEBGL_debug_renderer_info");return null===e?r.getParameter(r.RENDERER):r.getParameter(e.UNMASKED_RENDERER_WEBGL)}return""}(),userAgent:a,isNode:void 0!==globalThis.process&&void 0!==globalThis.process.versions&&void 0!==globalThis.process.versions.node,isMobile:!1,isDesktop:!1,isStandalone:!1,isWebview:/; ?wv|applewebkit(?!.*safari)/i.test(a)},t=[[/windows nt (6\.[23]); arm/i,o.Windows,l],[/windows (?:phone|mobile|iot)(?: os)?[\/ ]?([\d.]*( se)?)/i,o.Windows,l],[/windows[\/ ](1[01]|2000|3\.1|7|8(\.1)?|9[58]|me|server 20\d\d( r2)?|vista|xp)/i,o.Windows,l],[/windows nt ?([\d.)]*)(?!.+xbox)/i,o.Windows,l],[/\bwin(?=3| ?9|n)(?:nt| 9x )?([\d.;]*)/i,o.Windows,l],[/windows ce\/?([\d.]*)/i,o.Windows,l],[/[adehimnop]{4,7}\b(?:.*os (\w+) like mac|; opera)/i,o.iOS,w],[/(?:ios;fbsv|ios(?=.+ip(?:ad|hone))|ip(?:ad|hone)(?: |.+i(?:pad)?)os)[\/ ]([\w.]+)/i,o.iOS,w],[/cfnetwork\/.+darwin/i,o.iOS,w],[/mac os x ?([\w. ]*)/i,o.MacOS,w],[/(?:macintosh|mac_powerpc\b)(?!.+(haiku|morphos))/i,o.MacOS,w],[/droid ([\w.]+)\b.+(android[- ]x86)/i,o.Android],[/android\w*[-\/.; ]?([\d.]*)/i,o.Android]],m=[[/windows.+ edge\/([\w.]+)/i,e.EdgeHTML],[/arkweb\/([\w.]+)/i,e.ArkWeb],[/webkit\/537\.36.+chrome\/(?!27)([\w.]+)/i,e.Blink],[/presto\/([\w.]+)/i,e.Presto],[/webkit\/([\w.]+)/i,e.WebKit],[/trident\/([\w.]+)/i,e.Trident],[/netfront\/([\w.]+)/i,e.NetFront],[/khtml[\/ ]\(?([\w.]+)/i,e.KHTML],[/tasman[\/ ]\(?([\w.]+)/i,e.Tasman],[/rv:([\w.]{1,9})\b.+gecko/i,e.Gecko]],d=[[/\b(?:crmo|crios)\/([\w.]+)/i,i.Chrome],[/webview.+edge\/([\w.]+)/i,i.Edge],[/edg(?:e|ios|a)?\/([\w.]+)/i,i.Edge],[/opera mini\/([-\w.]+)/i,i.Opera],[/opera [mobileta]{3,6}\b.+version\/([-\w.]+)/i,i.Opera],[/opera(?:.+version\/|[\/ ]+)([\w.]+)/i,i.Opera],[/opios[\/ ]+([\w.]+)/i,i.Opera],[/\bop(?:rg)?x\/([\w.]+)/i,i.Opera],[/\bopr\/([\w.]+)/i,i.Opera],[/iemobile(?:browser|boat|jet)[\/ ]?([\d.]*)/i,i.IE],[/(?:ms|\()ie ([\w.]+)/i,i.IE],[/trident.+rv[: ]([\w.]{1,9})\b.+like gecko/i,i.IE],[/\bfocus\/([\w.]+)/i,i.Firefox],[/\bopt\/([\w.]+)/i,i.Opera],[/coast\/([\w.]+)/i,i.Opera],[/fxios\/([\w.-]+)/i,i.Firefox],[/samsungbrowser\/([\w.]+)/i,i.SamsungInternet],[/headlesschrome(?:\/([\w.]+)| )/i,i.Chrome],[/wv\).+chrome\/([\w.]+).+edgw\//i,i.Edge],[/ wv\).+(chrome)\/([\w.]+)/i,i.Chrome],[/chrome\/([\w.]+) mobile/i,i.Chrome],[/chrome\/v?([\w.]+)/i,i.Chrome],[/version\/([\w.,]+) .*mobile(?:\/\w+ | ?)safari/i,i.Safari],[/iphone .*mobile(?:\/\w+ | ?)safari/i,i.Safari],[/version\/([\w.,]+) .*safari/i,i.Safari],[/webkit.+?(?:mobile ?safari|safari)(\/[\w.]+)/i,i.Safari,"1"],[/(?:mobile|tablet);.*firefox\/([\w.-]+)/i,i.Firefox],[/mobile vr; rv:([\w.]+)\).+firefox/i,i.Firefox],[/firefox\/([\w.]+)/i,i.Firefox]];function l(o){if(void 0===o)return"";var r={"4.90":"ME","NT3.51":"NT 3.11","NT4.0":"NT 4.0","NT 5.0":"2000","NT 5.1":"XP","NT 5.2":"XP","NT 6.0":"Vista","NT 6.1":"7","NT 6.2":"8","NT 6.3":"8.1","NT 6.4":"10","NT 10.0":"10",ARM:"RT"}[o];return void 0!==r?r:o}function w(o){return void 0===o?"":o.replace(/_/g,".")}function c(o,r){return 10===o.major&&0===o.minor&&o.build>=22e3?"11":10===o.major&&0===o.minor&&o.build<22e3?"10":6===o.major&&3===o.minor?"8.1":6===o.major&&2===o.minor?"8":6===o.major&&1===o.minor?"7":6===o.major&&0===o.minor?"Vista":5===o.major&&1===o.minor||5===o.major&&2===o.minor?"XP":5===o.major&&0===o.minor?"2000":4===o.major&&90===o.minor?"ME":4===o.major&&0===o.minor?"NT 4.0":3===o.major&&51===o.minor?"NT 3.11":r}function b(o,r){return"function"==typeof r?r(o):"string"==typeof r?r:void 0===o?"":o}function g(o){var r=o.split(".");return{major:parseInt(r[0]||"0"),minor:parseInt(r[1]||"0"),build:parseInt(r[2]||"0")}}(void 0!==globalThis.process&&void 0!==globalThis.process.versions&&void 0!==globalThis.process.versions.electron||/ electron\//i.test(a))&&(s.crossPlatformFramework=n.Electron),void 0!==globalThis.navigator&&"ReactNative"===globalThis.navigator.product&&(s.crossPlatformFramework=n.ReactNative);for(var v=0;v<t.length;v++){var f=(j=t[v])[0],u=j[1],p=j[2];if(null!==(k=s.userAgent.match(f))){s.os=u,s.osVersion=b(k[1],p);break}}s.os===o.iOS&&0===function(o,r){for(var e=o.split("."),i=r.split("."),n=Math.max(e.length,i.length),a=0;a<n;a++){var s=void 0,t=void 0;if((s=a<e.length?parseInt(e[a],10):0)>(t=a<i.length?parseInt(i[a],10):0))return 1;if(s<t)return-1}return 0}(s.osVersion,"18.6")&&(null!==(E=/\) Version\/([\d.]+)/.exec(s.userAgent))&&parseInt(E[1].substring(0,2),10)>=26&&(s.osVersion=E[1]));for(v=0;v<m.length;v++){f=(j=m[v])[0];var h=j[1];p=j[2];if(null!==(k=s.userAgent.match(f))){s.engine=h,s.engineVersion=b(k[1],p);break}}for(v=0;v<d.length;v++){f=(j=d[v])[0];var j,k,T=j[1];p=j[2];if(null!==(k=s.userAgent.match(f))){s.browser=T,s.browserVersion=b(k[1],p);break}}if(s.crossPlatformFramework===n.ReactNative)try{u=(V=require("react-native").Platform).OS;var E=g(S=""+V.Version);switch(u){case"android":s.os=o.Android,s.osVersion=function(o,r){return o.major>=36?"16":35===o.major?"15":34===o.major?"14":33===o.major?"13":32===o.major?"12.1":31===o.major?"12":30===o.major?"11":29===o.major?"10":28===o.major?"9":27===o.major?"8.1":26===o.major?"8.0":25===o.major?"7.1":24===o.major?"7.0":23===o.major?"6.0":22===o.major?"5.1":21===o.major?"5.0":20===o.major||19===o.major?"4.4":18===o.major?"4.3":17===o.major?"4.2":16===o.major?"4.1":15===o.major?"4.0.3":14===o.major?"4.0":13===o.major?"3.2":12===o.major?"3.1":11===o.major?"3.0":10===o.major?"2.3.3":9===o.major?"2.3":8===o.major?"2.2":7===o.major?"2.1":6===o.major?"2.0.1":5===o.major?"2.0":4===o.major?"1.6":3===o.major?"1.5":2===o.major?"1.1":1===o.major?"1.0":r}(E,S);break;case"ios":s.os=o.iOS,s.osVersion=S;break;case"windows":s.os=o.Windows,s.osVersion=c(E,S);break;case"macos":s.os=o.MacOS,s.osVersion=S}}catch(o){}if(s.isNode)try{var S,V=(u=require("os")).platform();E=g(S=u.release());switch(V){case"win32":s.os=o.Windows,s.osVersion=c(E,S);break;case"darwin":s.os=o.MacOS,s.osVersion=function(o,r){return o.major>=24?o.major-9+"."+o.minor+"."+o.build:23===o.major?"14."+o.minor+"."+o.build:22===o.major?"13."+o.minor+"."+o.build:21===o.major?"12."+o.minor+"."+o.build:20===o.major?"11."+o.minor+"."+o.build:19===o.major?"10.15."+o.minor:18===o.major?"10.14."+o.minor:17===o.major?"10.13."+o.minor:16===o.major?"10.12."+o.minor:15===o.major?"10.11."+o.minor:14===o.major?"10.10."+o.minor:13===o.major?"10.9."+o.minor:o.major>=5&&o.major<=12?"10."+(o.major-4)+"."+o.minor:r}(E,S);break;case"android":s.os=o.Android,s.osVersion=S;break;case"linux":/android/i.test(S)&&(s.os=o.Android,s.osVersion=S)}}catch(o){}void 0!==globalThis.document&&globalThis.document.addEventListener("deviceready",(function(){if(s.crossPlatformFramework=n.Cordova,s.os===o.Unknown&&void 0!==globalThis.device){switch(globalThis.device.platform){case"Android":s.os=o.Android;break;case"iOS":s.os=o.iOS}s.osVersion=globalThis.device.version}}),!1),void 0!==navigator.userAgentData&&void 0!==navigator.userAgentData.getHighEntropyValues&&navigator.userAgentData.getHighEntropyValues(["brands","fullVersionList","mobile","model","platform","platformVersion","architecture","formFactors","bitness","uaFullVersion","wow64"]).then((function(r){for(var e,i=r.fullVersionList||r.brands||[],n=r.platformVersion,a=0;a<i.length;a++){var t=null==(e=i[a])?{brand:"",version:""}:"string"==typeof e?{brand:e,version:""}:{brand:e.brand,version:e.version},m=t.brand,d=t.version;/not.a.brand/i.test(m)||"Chromium"===m&&(s.engineVersion=d)}"string"==typeof n&&(s.os===o.Windows&&parseInt(n.replace(/[^\d.]/g,"").split(".")[0],10)>=13?s.osVersion="11":s.osVersion=n)})),s.device=s.os===o.iOS||s.os===o.Android?r.Mobile:s.os===o.Windows||s.os===o.MacOS?r.Desktop:r.Unknown,s.isMobile=s.device===r.Mobile,s.isDesktop=s.device===r.Desktop,s.isStandalone=function(r){return"matchMedia"in globalThis&&(r===o.iOS?"standalone"in navigator&&!!navigator.standalone:globalThis.matchMedia("(display-mode: standalone)").matches)}(s.os);var O={installed:!1,name:"Platform",module:s,Constants:{OS:o,Devices:r,Engines:e,Browsers:i,CrossPlatformFramework:n},Errors:{}};export{O as default};
|
|
1
|
+
var e,o,r,i,n;!function(e){e.Unknown="Unknown",e.Android="Android",e.iOS="iOS",e.Windows="Windows",e.MacOS="MacOS"}(e||(e={})),function(e){e.Unknown="Unknown",e.Mobile="Mobile",e.Desktop="Desktop"}(o||(o={})),function(e){e.Unknown="Unknown",e.EdgeHTML="EdgeHTML",e.ArkWeb="ArkWeb",e.Blink="Blink",e.Presto="Presto",e.WebKit="WebKit",e.Trident="Trident",e.NetFront="NetFront",e.KHTML="KHTML",e.Tasman="Tasman",e.Gecko="Gecko"}(r||(r={})),function(e){e.Unknown="Unknown",e.Chrome="Chrome",e.Safari="Safari",e.Edge="Edge",e.Firefox="Firefox",e.Opera="Opera",e.IE="IE",e.SamsungInternet="SamsungInternet"}(i||(i={})),function(e){e.Unknown="Unknown",e.ReactNative="ReactNative",e.Electron="Electron",e.Cordova="Cordova"}(n||(n={}));var a=void 0!==globalThis.navigator&&"string"==typeof globalThis.navigator.userAgent?globalThis.navigator.userAgent:"";var t={os:{name:e.Unknown,version:""},engine:{name:r.Unknown,version:""},browser:{name:i.Unknown,version:""},crossPlatformFramework:n.Unknown,userAgent:a,get network(){return function(){var o={isOnline:null,effectiveType:null,type:null,downlink:null,rtt:null,saveData:null};if(void 0!==globalThis.navigator){void 0!==globalThis.navigator.onLine&&(o.isOnline=globalThis.navigator.onLine);var r=globalThis.navigator.connection||globalThis.navigator.mozConnection||globalThis.navigator.webkitConnection;void 0!==r&&(void 0!==r.effectiveType&&(o.effectiveType=r.effectiveType),void 0!==r.type&&(o.type=r.type),void 0!==r.downlink&&(o.downlink=r.downlink),void 0!==r.rtt&&(o.rtt=r.rtt),void 0!==r.saveData&&(o.saveData=r.saveData))}if(t.isNode){try{for(var i=require("os").networkInterfaces(),n=Object.keys(i),a=0;a<n.length;a++){for(var s=i[n[a]],m=0;m<s.length;m++){var l=s[m];l.internal||"IPv4"!==l.family||(o.isOnline=!0)}if(o.isOnline)break}}catch(e){}try{var d=require("child_process");if(t.os.name===e.Windows){try{(c=d.execSync("netsh wlan show interfaces",{encoding:"utf8",timeout:5e3})).includes("State")&&c.includes("connected")&&(o.type="wifi")}catch(e){}if(null===o.type)try{(c=d.execSync("ipconfig",{encoding:"utf8",timeout:5e3})).includes("Ethernet adapter")&&(o.type="ethernet")}catch(e){}null===o.type&&(o.type="other")}else if(t.os.name===e.MacOS)try{var c=d.execSync("networksetup -listallhardwareports",{encoding:"utf8",timeout:5e3}),v=d.execSync("route -n get default | grep interface",{encoding:"utf8",timeout:5e3});v.includes("en0")&&c.includes("Wi-Fi")?o.type="wifi":v.includes("en")||c.includes("Ethernet")?o.type="ethernet":o.type="other"}catch(e){o.type="other"}}catch(e){}}return o}()},get device(){return this.os.name===e.iOS||this.os.name===e.Android?o.Mobile:this.os.name===e.Windows||this.os.name===e.MacOS?o.Desktop:o.Unknown},get renderer(){return function(){if(void 0===globalThis.document)return"";var e=globalThis.document.createElement("canvas");if("function"!=typeof e.getContext)return"";var o=e.getContext("webgl2")||e.getContext("experimental-webgl")||e.getContext("webgl");if(null===o)return"";if(o instanceof WebGLRenderingContext||"getParameter"in o&&"function"==typeof o.getParameter){var r=o.getExtension("WEBGL_debug_renderer_info");return null===r?o.getParameter(o.RENDERER):o.getParameter(r.UNMASKED_RENDERER_WEBGL)}return""}()},get isMobile(){return this.device===o.Mobile},get isDesktop(){return this.device===o.Desktop},get isWebview(){return/; ?wv|applewebkit(?!.*safari)/i.test(this.userAgent)},get isNode(){return void 0!==globalThis.process&&void 0!==globalThis.process.versions&&void 0!==globalThis.process.versions.node},get isStandalone(){return this.os.name===e.iOS?"standalone"in globalThis.navigator&&!!globalThis.navigator.standalone:"matchMedia"in globalThis&&globalThis.matchMedia("(display-mode: standalone)").matches}},s=[[/windows nt (6\.[23]); arm/i,e.Windows,c],[/windows (?:phone|mobile|iot)(?: os)?[\/ ]?([\d.]*( se)?)/i,e.Windows,c],[/windows[\/ ](1[01]|2000|3\.1|7|8(\.1)?|9[58]|me|server 20\d\d( r2)?|vista|xp)/i,e.Windows,c],[/windows nt ?([\d.)]*)(?!.+xbox)/i,e.Windows,c],[/\bwin(?=3| ?9|n)(?:nt| 9x )?([\d.;]*)/i,e.Windows,c],[/windows ce\/?([\d.]*)/i,e.Windows,c],[/[adehimnop]{4,7}\b(?:.*os (\w+) like mac|; opera)/i,e.iOS,v],[/(?:ios;fbsv|ios(?=.+ip(?:ad|hone))|ip(?:ad|hone)(?: |.+i(?:pad)?)os)[\/ ]([\w.]+)/i,e.iOS,v],[/cfnetwork\/.+darwin/i,e.iOS,v],[/mac os x ?([\w. ]*)/i,e.MacOS,v],[/(?:macintosh|mac_powerpc\b)(?!.+(haiku|morphos))/i,e.MacOS,v],[/droid ([\w.]+)\b.+(android[- ]x86)/i,e.Android],[/android\w*[-\/.; ]?([\d.]*)/i,e.Android]],m=[[/windows.+ edge\/([\w.]+)/i,r.EdgeHTML],[/arkweb\/([\w.]+)/i,r.ArkWeb],[/webkit\/537\.36.+chrome\/(?!27)([\w.]+)/i,r.Blink],[/presto\/([\w.]+)/i,r.Presto],[/webkit\/([\w.]+)/i,r.WebKit],[/trident\/([\w.]+)/i,r.Trident],[/netfront\/([\w.]+)/i,r.NetFront],[/khtml[\/ ]\(?([\w.]+)/i,r.KHTML],[/tasman[\/ ]\(?([\w.]+)/i,r.Tasman],[/rv:([\w.]{1,9})\b.+gecko/i,r.Gecko]],l=[[/\b(?:crmo|crios)\/([\w.]+)/i,i.Chrome],[/webview.+edge\/([\w.]+)/i,i.Edge],[/edg(?:e|ios|a)?\/([\w.]+)/i,i.Edge],[/opera mini\/([-\w.]+)/i,i.Opera],[/opera [mobileta]{3,6}\b.+version\/([-\w.]+)/i,i.Opera],[/opera(?:.+version\/|[\/ ]+)([\w.]+)/i,i.Opera],[/opios[\/ ]+([\w.]+)/i,i.Opera],[/\bop(?:rg)?x\/([\w.]+)/i,i.Opera],[/\bopr\/([\w.]+)/i,i.Opera],[/iemobile(?:browser|boat|jet)[\/ ]?([\d.]*)/i,i.IE],[/(?:ms|\()ie ([\w.]+)/i,i.IE],[/trident.+rv[: ]([\w.]{1,9})\b.+like gecko/i,i.IE],[/\bfocus\/([\w.]+)/i,i.Firefox],[/\bopt\/([\w.]+)/i,i.Opera],[/coast\/([\w.]+)/i,i.Opera],[/fxios\/([\w.-]+)/i,i.Firefox],[/samsungbrowser\/([\w.]+)/i,i.SamsungInternet],[/headlesschrome(?:\/([\w.]+)| )/i,i.Chrome],[/wv\).+chrome\/([\w.]+).+edgw\//i,i.Edge],[/ wv\).+(chrome)\/([\w.]+)/i,i.Chrome],[/chrome\/([\w.]+) mobile/i,i.Chrome],[/chrome\/v?([\w.]+)/i,i.Chrome],[/version\/([\w.,]+) .*mobile(?:\/\w+ | ?)safari/i,i.Safari],[/iphone .*mobile(?:\/\w+ | ?)safari/i,i.Safari],[/version\/([\w.,]+) .*safari/i,i.Safari],[/webkit.+?(?:mobile ?safari|safari)(\/[\w.]+)/i,i.Safari,"1"],[/(?:mobile|tablet);.*firefox\/([\w.-]+)/i,i.Firefox],[/mobile vr; rv:([\w.]+)\).+firefox/i,i.Firefox],[/firefox\/([\w.]+)/i,i.Firefox]],d={"Google Chrome":"Chrome","Microsoft Edge":"Edge","Microsoft Edge WebView2":"Edge WebView2","Android WebView":"Chrome WebView",HeadlessChrome:"Chrome Headless",OperaMobile:"Opera Mobi"};function c(e){if(void 0===e)return"";var o={"4.90":"ME","NT3.51":"NT 3.11","NT4.0":"NT 4.0","NT 5.0":"2000","NT 5.1":"XP","NT 5.2":"XP","NT 6.0":"Vista","NT 6.1":"7","NT 6.2":"8","NT 6.3":"8.1","NT 6.4":"10","NT 10.0":"10",ARM:"RT"}[e];return void 0!==o?o:e}function v(e){return void 0===e?"":e.replace(/_/g,".")}function w(e,o){return 10===e.major&&0===e.minor&&e.build>=22e3?"11":10===e.major&&0===e.minor&&e.build<22e3?"10":6===e.major&&3===e.minor?"8.1":6===e.major&&2===e.minor?"8":6===e.major&&1===e.minor?"7":6===e.major&&0===e.minor?"Vista":5===e.major&&1===e.minor||5===e.major&&2===e.minor?"XP":5===e.major&&0===e.minor?"2000":4===e.major&&90===e.minor?"ME":4===e.major&&0===e.minor?"NT 4.0":3===e.major&&51===e.minor?"NT 3.11":o}function g(e,o){return e.major>=24?e.major-9+"."+e.minor+"."+e.build:23===e.major?"14."+e.minor+"."+e.build:22===e.major?"13."+e.minor+"."+e.build:21===e.major?"12."+e.minor+"."+e.build:20===e.major?"11."+e.minor+"."+e.build:19===e.major?"10.15."+e.minor:18===e.major?"10.14."+e.minor:17===e.major?"10.13."+e.minor:16===e.major?"10.12."+e.minor:15===e.major?"10.11."+e.minor:14===e.major?"10.10."+e.minor:13===e.major?"10.9."+e.minor:e.major>=5&&e.major<=12?"10."+(e.major-4)+"."+e.minor:o}function b(e,o){return e.major>=36?"16":35===e.major?"15":34===e.major?"14":33===e.major?"13":32===e.major?"12.1":31===e.major?"12":30===e.major?"11":29===e.major?"10":28===e.major?"9":27===e.major?"8.1":26===e.major?"8.0":25===e.major?"7.1":24===e.major?"7.0":23===e.major?"6.0":22===e.major?"5.1":21===e.major?"5.0":20===e.major||19===e.major?"4.4":18===e.major?"4.3":17===e.major?"4.2":16===e.major?"4.1":15===e.major?"4.0.3":14===e.major?"4.0":13===e.major?"3.2":12===e.major?"3.1":11===e.major?"3.0":10===e.major?"2.3.3":9===e.major?"2.3":8===e.major?"2.2":7===e.major?"2.1":6===e.major?"2.0.1":5===e.major?"2.0":4===e.major?"1.6":3===e.major?"1.5":2===e.major?"1.1":1===e.major?"1.0":o}function u(e,o){return"function"==typeof o?o(e):"string"==typeof o?o:void 0===e?"":e}function f(e){var o=e.split(".");return{major:parseInt(o[0]||"0"),minor:parseInt(o[1]||"0"),build:parseInt(o[2]||"0")}}function h(){if(t.crossPlatformFramework=n.Cordova,void 0!==globalThis.device)switch(globalThis.device.platform){case"Android":t.os={name:e.Android,version:globalThis.device.version};break;case"iOS":t.os={name:e.iOS,version:globalThis.device.version}}}!function(){(void 0!==globalThis.process&&void 0!==globalThis.process.versions&&void 0!==globalThis.process.versions.electron||/ electron\//i.test(a))&&(t.crossPlatformFramework=n.Electron),void 0!==globalThis.navigator&&"ReactNative"===globalThis.navigator.product&&(t.crossPlatformFramework=n.ReactNative);for(var r=0;r<s.length;r++){var c=(T=s[r])[0],v=T[1],p=T[2];if(null!==(E=t.userAgent.match(c))){t.os={name:v,version:u(E[1],p)};break}}var j;for(t.os.name===e.iOS&&0===function(e,o){for(var r=e.split("."),i=o.split("."),n=Math.max(r.length,i.length),a=0;a<n;a++){var t=void 0,s=void 0;if((t=a<r.length?parseInt(r[a],10):0)>(s=a<i.length?parseInt(i[a],10):0))return 1;if(t<s)return-1}return 0}(t.os.version,"18.6")&&null!==(O=/\) Version\/([\d.]+)/.exec(t.userAgent))&&parseInt(O[1].substring(0,2),10)>=26&&(t.os.version=O[1]),r=0;r<m.length;r++){c=(T=m[r])[0];var k=T[1];p=T[2];if(null!==(E=t.userAgent.match(c))){t.engine={name:k,version:u(E[1],p)};break}}for(r=0;r<l.length;r++){c=(T=l[r])[0];var T,E,y=T[1];p=T[2];if(null!==(E=t.userAgent.match(c))){t.browser={name:y,version:u(E[1],p)};break}}if(t.crossPlatformFramework===n.ReactNative)try{v=(x=require("react-native").Platform).OS;var O=f(S=""+x.Version);switch(v){case"android":t.os={name:e.Android,version:b(O,S)};break;case"ios":t.os={name:e.iOS,version:S};break;case"windows":t.os={name:e.Windows,version:w(O,S)};break;case"macos":t.os={name:e.MacOS,version:S}}}catch(e){}if(t.isNode)try{var S,x=(v=require("os")).platform();O=f(S=v.release());switch(x){case"win32":t.os={name:e.Windows,version:w(O,S)};break;case"darwin":t.os={name:e.MacOS,version:g(O,S)};break;case"android":t.os={name:e.Android,version:S};break;case"linux":/android/i.test(S)&&(t.os={name:e.Android,version:S})}}catch(e){}void 0!==globalThis.document&&(void 0!==globalThis.device?h():globalThis.document.addEventListener("deviceready",h,!1)),j=globalThis.navigator,void 0!==globalThis.navigator&&void 0!==j.userAgentData&&void 0!==j.userAgentData.getHighEntropyValues&&globalThis.navigator.userAgentData.getHighEntropyValues(["brands","fullVersionList","mobile","model","platform","platformVersion","architecture","formFactors","bitness","uaFullVersion","wow64"]).then((function(r){for(var n,a=r.fullVersionList||r.brands||[],s=r.platformVersion,m=r.platform,l=t.browser.name,c=null,v=0;v<a.length;v++){var w=null==(n=a[v])?{brand:"",version:""}:"string"==typeof n?{brand:n,version:""}:{brand:n.brand,version:n.version},g=w.version,b=w.brand;/not.a.brand/i.test(b)||((null===c||/Chrom/.test(c)&&"Chromium"!==b||"Edge"===c&&/WebView2/.test(b))&&(b=d[b]||b,null!==(c=l)&&!/Chrom/.test(c)&&/Chrom/.test(b)||("Chrome"===(l=b)||"Chrome WebView"===l||"Chrome Headless"===l?t.browser.name=i.Chrome:"Edge"===l||"Edge WebView2"===l?t.browser.name=i.Edge:"Opera Mobi"===l&&(t.browser.name=i.Opera),t.browser.version=g),c=b),"Chromium"===b&&(t.engine.version=g))}"string"==typeof s&&(t.os.name===e.Windows?t.os.version=parseInt(s.split(".")[0],10)>=13?"11":"10":t.os.version=s),"string"==typeof m&&(/android/i.test(m)?t.os.name=e.Android:/ios|iphone|ipad/i.test(m)?t.os.name=e.iOS:/windows|win32/i.test(m)?t.os.name=e.Windows:/macos|macintel/i.test(m)&&(t.os.name=e.MacOS)),!0===r.mobile&&(t.device=o.Mobile)}))}();var p={installed:!1,name:"Platform",module:t,Constants:{OS:e,Devices:o,Engines:r,Browsers:i,CrossPlatformFramework:n},Errors:{}};export{p as default};
|
|
@@ -70,21 +70,43 @@ function compareVersion(lhs, rhs) {
|
|
|
70
70
|
}
|
|
71
71
|
|
|
72
72
|
var Platform = {
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
browser: Browsers.Unknown,
|
|
73
|
+
os: { name: OS.Unknown, version: '' },
|
|
74
|
+
engine: { name: Engines.Unknown, version: '' },
|
|
75
|
+
browser: { name: Browsers.Unknown, version: '' },
|
|
77
76
|
crossPlatformFramework: CrossPlatformFramework.Unknown,
|
|
78
|
-
osVersion: '',
|
|
79
|
-
engineVersion: '',
|
|
80
|
-
browserVersion: '',
|
|
81
|
-
renderer: getRenderer(),
|
|
82
77
|
userAgent: USER_AGENT,
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
78
|
+
get network() {
|
|
79
|
+
return getNetwork();
|
|
80
|
+
},
|
|
81
|
+
get device() {
|
|
82
|
+
if (this.os.name === OS.iOS || this.os.name === OS.Android)
|
|
83
|
+
return Devices.Mobile;
|
|
84
|
+
if (this.os.name === OS.Windows || this.os.name === OS.MacOS)
|
|
85
|
+
return Devices.Desktop;
|
|
86
|
+
return Devices.Unknown;
|
|
87
|
+
},
|
|
88
|
+
get renderer() {
|
|
89
|
+
return getRenderer();
|
|
90
|
+
},
|
|
91
|
+
get isMobile() {
|
|
92
|
+
return this.device === Devices.Mobile;
|
|
93
|
+
},
|
|
94
|
+
get isDesktop() {
|
|
95
|
+
return this.device === Devices.Desktop;
|
|
96
|
+
},
|
|
97
|
+
get isWebview() {
|
|
98
|
+
return /; ?wv|applewebkit(?!.*safari)/i.test(this.userAgent);
|
|
99
|
+
},
|
|
100
|
+
get isNode() {
|
|
101
|
+
return typeof globalThis.process !== 'undefined' && typeof globalThis.process.versions !== 'undefined' && globalThis.process.versions.node !== undefined;
|
|
102
|
+
},
|
|
103
|
+
get isStandalone() {
|
|
104
|
+
if (this.os.name === OS.iOS)
|
|
105
|
+
return 'standalone' in globalThis.navigator && !!globalThis.navigator.standalone;
|
|
106
|
+
if (!('matchMedia' in globalThis))
|
|
107
|
+
return false;
|
|
108
|
+
return globalThis.matchMedia('(display-mode: standalone)').matches;
|
|
109
|
+
},
|
|
88
110
|
};
|
|
89
111
|
var OS_RESOLVER_MAP = [
|
|
90
112
|
[/windows nt (6\.[23]); arm/i, OS.Windows, resolveWindowsVersion],
|
|
@@ -144,6 +166,14 @@ var BROWSER_RESOLVER_MAP = [
|
|
|
144
166
|
[/mobile vr; rv:([\w.]+)\).+firefox/i, Browsers.Firefox],
|
|
145
167
|
[/firefox\/([\w.]+)/i, Browsers.Firefox],
|
|
146
168
|
];
|
|
169
|
+
var HIGH_ENTROPY_BRAND_NAME_MAP = {
|
|
170
|
+
'Google Chrome': 'Chrome',
|
|
171
|
+
'Microsoft Edge': 'Edge',
|
|
172
|
+
'Microsoft Edge WebView2': 'Edge WebView2',
|
|
173
|
+
'Android WebView': 'Chrome WebView',
|
|
174
|
+
'HeadlessChrome': 'Chrome Headless',
|
|
175
|
+
'OperaMobile': 'Opera Mobi',
|
|
176
|
+
};
|
|
147
177
|
function resolveWindowsVersion(string) {
|
|
148
178
|
if (string === undefined)
|
|
149
179
|
return '';
|
|
@@ -318,6 +348,33 @@ function normalizeBrand(entry) {
|
|
|
318
348
|
return { brand: entry, version: '' };
|
|
319
349
|
return { brand: entry.brand, version: entry.version };
|
|
320
350
|
}
|
|
351
|
+
function getSemanticVersion(string) {
|
|
352
|
+
var parts = string.split('.');
|
|
353
|
+
return {
|
|
354
|
+
major: parseInt(parts[0] || '0'),
|
|
355
|
+
minor: parseInt(parts[1] || '0'),
|
|
356
|
+
build: parseInt(parts[2] || '0')
|
|
357
|
+
};
|
|
358
|
+
}
|
|
359
|
+
function parseOSFromCordova() {
|
|
360
|
+
Platform.crossPlatformFramework = CrossPlatformFramework.Cordova;
|
|
361
|
+
if (typeof globalThis.device !== 'undefined') {
|
|
362
|
+
switch (globalThis.device.platform) {
|
|
363
|
+
case 'Android':
|
|
364
|
+
Platform.os = {
|
|
365
|
+
name: OS.Android,
|
|
366
|
+
version: globalThis.device.version,
|
|
367
|
+
};
|
|
368
|
+
break;
|
|
369
|
+
case 'iOS':
|
|
370
|
+
Platform.os = {
|
|
371
|
+
name: OS.iOS,
|
|
372
|
+
version: globalThis.device.version,
|
|
373
|
+
};
|
|
374
|
+
break;
|
|
375
|
+
}
|
|
376
|
+
}
|
|
377
|
+
}
|
|
321
378
|
function getRenderer() {
|
|
322
379
|
if (typeof globalThis.document === 'undefined')
|
|
323
380
|
return '';
|
|
@@ -338,171 +395,293 @@ function getRenderer() {
|
|
|
338
395
|
return '';
|
|
339
396
|
}
|
|
340
397
|
}
|
|
341
|
-
function
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
var parts = string.split('.');
|
|
350
|
-
return {
|
|
351
|
-
major: parseInt(parts[0] || '0'),
|
|
352
|
-
minor: parseInt(parts[1] || '0'),
|
|
353
|
-
build: parseInt(parts[2] || '0')
|
|
398
|
+
function getNetwork() {
|
|
399
|
+
var network = {
|
|
400
|
+
isOnline: null,
|
|
401
|
+
effectiveType: null,
|
|
402
|
+
type: null,
|
|
403
|
+
downlink: null,
|
|
404
|
+
rtt: null,
|
|
405
|
+
saveData: null,
|
|
354
406
|
};
|
|
355
|
-
|
|
356
|
-
if (
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
if (typeof
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
break;
|
|
407
|
+
if (typeof globalThis.navigator !== 'undefined') {
|
|
408
|
+
if (typeof globalThis.navigator.onLine !== 'undefined')
|
|
409
|
+
network.isOnline = globalThis.navigator.onLine;
|
|
410
|
+
var connection = globalThis.navigator.connection || globalThis.navigator.mozConnection || globalThis.navigator.webkitConnection;
|
|
411
|
+
if (typeof connection !== 'undefined') {
|
|
412
|
+
if (typeof connection.effectiveType !== 'undefined')
|
|
413
|
+
network.effectiveType = connection.effectiveType;
|
|
414
|
+
if (typeof connection.type !== 'undefined')
|
|
415
|
+
network.type = connection.type;
|
|
416
|
+
if (typeof connection.downlink !== 'undefined')
|
|
417
|
+
network.downlink = connection.downlink;
|
|
418
|
+
if (typeof connection.rtt !== 'undefined')
|
|
419
|
+
network.rtt = connection.rtt;
|
|
420
|
+
if (typeof connection.saveData !== 'undefined')
|
|
421
|
+
network.saveData = connection.saveData;
|
|
422
|
+
}
|
|
372
423
|
}
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
424
|
+
if (Platform.isNode) {
|
|
425
|
+
try {
|
|
426
|
+
var os = require('os');
|
|
427
|
+
var networkInterfaces = os.networkInterfaces();
|
|
428
|
+
var networkInterfaceNames = Object.keys(networkInterfaces);
|
|
429
|
+
for (var i = 0; i < networkInterfaceNames.length; i++) {
|
|
430
|
+
var name_1 = networkInterfaceNames[i];
|
|
431
|
+
var networkInterface = networkInterfaces[name_1];
|
|
432
|
+
for (var j = 0; j < networkInterface.length; j++) {
|
|
433
|
+
var address = networkInterface[j];
|
|
434
|
+
if (!address.internal && address.family === 'IPv4')
|
|
435
|
+
network.isOnline = true;
|
|
436
|
+
}
|
|
437
|
+
if (network.isOnline)
|
|
438
|
+
break;
|
|
439
|
+
}
|
|
440
|
+
}
|
|
441
|
+
catch (_) {
|
|
442
|
+
}
|
|
443
|
+
try {
|
|
444
|
+
var childProcess = require('child_process');
|
|
445
|
+
if (Platform.os.name === OS.Windows) {
|
|
446
|
+
try {
|
|
447
|
+
var output = childProcess.execSync('netsh wlan show interfaces', { encoding: 'utf8', timeout: 5000 });
|
|
448
|
+
if (output.includes('State') && output.includes('connected'))
|
|
449
|
+
network.type = 'wifi';
|
|
450
|
+
}
|
|
451
|
+
catch (_) {
|
|
452
|
+
}
|
|
453
|
+
if (network.type === null) {
|
|
454
|
+
try {
|
|
455
|
+
var output = childProcess.execSync('ipconfig', { encoding: 'utf8', timeout: 5000 });
|
|
456
|
+
if (output.includes('Ethernet adapter'))
|
|
457
|
+
network.type = 'ethernet';
|
|
458
|
+
}
|
|
459
|
+
catch (_) {
|
|
460
|
+
}
|
|
461
|
+
}
|
|
462
|
+
if (network.type === null)
|
|
463
|
+
network.type = 'other';
|
|
464
|
+
}
|
|
465
|
+
else if (Platform.os.name === OS.MacOS) {
|
|
466
|
+
try {
|
|
467
|
+
var output = childProcess.execSync('networksetup -listallhardwareports', { encoding: 'utf8', timeout: 5000 });
|
|
468
|
+
var activeInterface = childProcess.execSync('route -n get default | grep interface', { encoding: 'utf8', timeout: 5000 });
|
|
469
|
+
if (activeInterface.includes('en0') && output.includes('Wi-Fi'))
|
|
470
|
+
network.type = 'wifi';
|
|
471
|
+
else if (activeInterface.includes('en') || output.includes('Ethernet'))
|
|
472
|
+
network.type = 'ethernet';
|
|
473
|
+
else
|
|
474
|
+
network.type = 'other';
|
|
475
|
+
}
|
|
476
|
+
catch (_) {
|
|
477
|
+
network.type = 'other';
|
|
478
|
+
}
|
|
479
|
+
}
|
|
480
|
+
}
|
|
481
|
+
catch (_) {
|
|
482
|
+
}
|
|
389
483
|
}
|
|
484
|
+
return network;
|
|
390
485
|
}
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
var regexp = map[0];
|
|
394
|
-
var browser = map[1];
|
|
395
|
-
var resolver = map[2];
|
|
396
|
-
var matched = Platform.userAgent.match(regexp);
|
|
397
|
-
if (matched !== null) {
|
|
398
|
-
Platform.browser = browser;
|
|
399
|
-
Platform.browserVersion = resolveVersion(matched[1], resolver);
|
|
400
|
-
break;
|
|
401
|
-
}
|
|
486
|
+
function canUseHighEntropyValues(navigator) {
|
|
487
|
+
return typeof globalThis.navigator !== 'undefined' && typeof navigator.userAgentData !== 'undefined' && typeof navigator.userAgentData.getHighEntropyValues !== 'undefined';
|
|
402
488
|
}
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
var
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
Platform.os = OS.Windows;
|
|
421
|
-
Platform.osVersion = resolveSemanticWindowsVersion(version, release);
|
|
422
|
-
break;
|
|
423
|
-
case 'macos':
|
|
424
|
-
Platform.os = OS.MacOS;
|
|
425
|
-
Platform.osVersion = release;
|
|
426
|
-
break;
|
|
489
|
+
function init() {
|
|
490
|
+
if ((typeof globalThis.process !== 'undefined' && typeof globalThis.process.versions !== 'undefined' && globalThis.process.versions.electron !== undefined) || (/ electron\//i.test(USER_AGENT)))
|
|
491
|
+
Platform.crossPlatformFramework = CrossPlatformFramework.Electron;
|
|
492
|
+
if (typeof globalThis.navigator !== 'undefined' && globalThis.navigator.product === 'ReactNative')
|
|
493
|
+
Platform.crossPlatformFramework = CrossPlatformFramework.ReactNative;
|
|
494
|
+
for (var i = 0; i < OS_RESOLVER_MAP.length; i++) {
|
|
495
|
+
var map = OS_RESOLVER_MAP[i];
|
|
496
|
+
var regexp = map[0];
|
|
497
|
+
var os = map[1];
|
|
498
|
+
var resolver = map[2];
|
|
499
|
+
var matched = Platform.userAgent.match(regexp);
|
|
500
|
+
if (matched !== null) {
|
|
501
|
+
Platform.os = {
|
|
502
|
+
name: os,
|
|
503
|
+
version: resolveVersion(matched[1], resolver),
|
|
504
|
+
};
|
|
505
|
+
break;
|
|
427
506
|
}
|
|
428
507
|
}
|
|
429
|
-
|
|
508
|
+
if (Platform.os.name === OS.iOS && compareVersion(Platform.os.version, '18.6') === 0) {
|
|
509
|
+
var version = /\) Version\/([\d.]+)/.exec(Platform.userAgent);
|
|
510
|
+
if (version !== null && parseInt(version[1].substring(0, 2), 10) >= 26)
|
|
511
|
+
Platform.os.version = version[1];
|
|
430
512
|
}
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
var
|
|
435
|
-
var
|
|
436
|
-
var
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
case 'darwin':
|
|
444
|
-
Platform.os = OS.MacOS;
|
|
445
|
-
Platform.osVersion = resolveSemanticDarwinVersion(version, release);
|
|
446
|
-
break;
|
|
447
|
-
case 'android':
|
|
448
|
-
Platform.os = OS.Android;
|
|
449
|
-
Platform.osVersion = release;
|
|
450
|
-
break;
|
|
451
|
-
case 'linux':
|
|
452
|
-
if (/android/i.test(release)) {
|
|
453
|
-
Platform.os = OS.Android;
|
|
454
|
-
Platform.osVersion = release;
|
|
455
|
-
}
|
|
456
|
-
break;
|
|
513
|
+
for (var i = 0; i < ENGINE_RESOLVER_MAP.length; i++) {
|
|
514
|
+
var map = ENGINE_RESOLVER_MAP[i];
|
|
515
|
+
var regexp = map[0];
|
|
516
|
+
var engine = map[1];
|
|
517
|
+
var resolver = map[2];
|
|
518
|
+
var matched = Platform.userAgent.match(regexp);
|
|
519
|
+
if (matched !== null) {
|
|
520
|
+
Platform.engine = {
|
|
521
|
+
name: engine,
|
|
522
|
+
version: resolveVersion(matched[1], resolver),
|
|
523
|
+
};
|
|
524
|
+
break;
|
|
457
525
|
}
|
|
458
526
|
}
|
|
459
|
-
|
|
527
|
+
for (var i = 0; i < BROWSER_RESOLVER_MAP.length; i++) {
|
|
528
|
+
var map = BROWSER_RESOLVER_MAP[i];
|
|
529
|
+
var regexp = map[0];
|
|
530
|
+
var browser = map[1];
|
|
531
|
+
var resolver = map[2];
|
|
532
|
+
var matched = Platform.userAgent.match(regexp);
|
|
533
|
+
if (matched !== null) {
|
|
534
|
+
Platform.browser = {
|
|
535
|
+
name: browser,
|
|
536
|
+
version: resolveVersion(matched[1], resolver),
|
|
537
|
+
};
|
|
538
|
+
break;
|
|
539
|
+
}
|
|
460
540
|
}
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
541
|
+
if (Platform.crossPlatformFramework === CrossPlatformFramework.ReactNative) {
|
|
542
|
+
try {
|
|
543
|
+
var reactNative = require('react-native');
|
|
544
|
+
var platform = reactNative.Platform;
|
|
545
|
+
var os = platform.OS;
|
|
546
|
+
var release = '' + platform.Version;
|
|
547
|
+
var version = getSemanticVersion(release);
|
|
548
|
+
switch (os) {
|
|
549
|
+
case 'android':
|
|
550
|
+
Platform.os = {
|
|
551
|
+
name: OS.Android,
|
|
552
|
+
version: resolveSemanticAndroidVersion(version, release),
|
|
553
|
+
};
|
|
554
|
+
break;
|
|
555
|
+
case 'ios':
|
|
556
|
+
Platform.os = {
|
|
557
|
+
name: OS.iOS,
|
|
558
|
+
version: release,
|
|
559
|
+
};
|
|
469
560
|
break;
|
|
470
|
-
case '
|
|
471
|
-
Platform.os =
|
|
561
|
+
case 'windows':
|
|
562
|
+
Platform.os = {
|
|
563
|
+
name: OS.Windows,
|
|
564
|
+
version: resolveSemanticWindowsVersion(version, release),
|
|
565
|
+
};
|
|
566
|
+
break;
|
|
567
|
+
case 'macos':
|
|
568
|
+
Platform.os = {
|
|
569
|
+
name: OS.MacOS,
|
|
570
|
+
version: release,
|
|
571
|
+
};
|
|
472
572
|
break;
|
|
473
573
|
}
|
|
474
|
-
Platform.osVersion = globalThis.device.version;
|
|
475
574
|
}
|
|
476
|
-
|
|
477
|
-
}
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
var
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
575
|
+
catch (_) {
|
|
576
|
+
}
|
|
577
|
+
finally {
|
|
578
|
+
}
|
|
579
|
+
}
|
|
580
|
+
if (Platform.isNode) {
|
|
581
|
+
try {
|
|
582
|
+
var os = require('os');
|
|
583
|
+
var platform = os.platform();
|
|
584
|
+
var release = os.release();
|
|
585
|
+
var version = getSemanticVersion(release);
|
|
586
|
+
switch (platform) {
|
|
587
|
+
case 'win32':
|
|
588
|
+
Platform.os = {
|
|
589
|
+
name: OS.Windows,
|
|
590
|
+
version: resolveSemanticWindowsVersion(version, release),
|
|
591
|
+
};
|
|
592
|
+
break;
|
|
593
|
+
case 'darwin':
|
|
594
|
+
Platform.os = {
|
|
595
|
+
name: OS.MacOS,
|
|
596
|
+
version: resolveSemanticDarwinVersion(version, release),
|
|
597
|
+
};
|
|
598
|
+
break;
|
|
599
|
+
case 'android':
|
|
600
|
+
Platform.os = {
|
|
601
|
+
name: OS.Android,
|
|
602
|
+
version: release,
|
|
603
|
+
};
|
|
604
|
+
break;
|
|
605
|
+
case 'linux':
|
|
606
|
+
if (/android/i.test(release)) {
|
|
607
|
+
Platform.os = {
|
|
608
|
+
name: OS.Android,
|
|
609
|
+
version: release,
|
|
610
|
+
};
|
|
611
|
+
}
|
|
612
|
+
break;
|
|
613
|
+
}
|
|
493
614
|
}
|
|
494
|
-
|
|
495
|
-
if (Platform.os === OS.Windows && parseInt(platformVersion.replace(/[^\d.]/g, '').split('.')[0], 10) >= 13)
|
|
496
|
-
Platform.osVersion = '11';
|
|
497
|
-
else
|
|
498
|
-
Platform.osVersion = platformVersion;
|
|
615
|
+
catch (_) {
|
|
499
616
|
}
|
|
500
|
-
|
|
617
|
+
finally {
|
|
618
|
+
}
|
|
619
|
+
}
|
|
620
|
+
if (typeof globalThis.document !== 'undefined') {
|
|
621
|
+
if (typeof globalThis.device !== 'undefined') {
|
|
622
|
+
parseOSFromCordova();
|
|
623
|
+
}
|
|
624
|
+
else {
|
|
625
|
+
globalThis.document.addEventListener("deviceready", parseOSFromCordova, false);
|
|
626
|
+
}
|
|
627
|
+
}
|
|
628
|
+
if (canUseHighEntropyValues(globalThis.navigator)) {
|
|
629
|
+
globalThis
|
|
630
|
+
.navigator
|
|
631
|
+
.userAgentData
|
|
632
|
+
.getHighEntropyValues(['brands', 'fullVersionList', 'mobile', 'model', 'platform', 'platformVersion', 'architecture', 'formFactors', 'bitness', 'uaFullVersion', 'wow64'])
|
|
633
|
+
.then(function (result) {
|
|
634
|
+
var brands = result.fullVersionList || result.brands || [];
|
|
635
|
+
var platformVersion = result.platformVersion;
|
|
636
|
+
var platform = result.platform;
|
|
637
|
+
var browserName = Platform.browser.name;
|
|
638
|
+
var prevBrandName = null;
|
|
639
|
+
for (var i = 0; i < brands.length; i++) {
|
|
640
|
+
var brand = normalizeBrand(brands[i]);
|
|
641
|
+
var brandVersion = brand.version;
|
|
642
|
+
var brandName = brand.brand;
|
|
643
|
+
if (/not.a.brand/i.test(brandName))
|
|
644
|
+
continue;
|
|
645
|
+
if (prevBrandName === null || (/Chrom/.test(prevBrandName) && brandName !== 'Chromium') || (prevBrandName === 'Edge' && /WebView2/.test(brandName))) {
|
|
646
|
+
brandName = HIGH_ENTROPY_BRAND_NAME_MAP[brandName] || brandName;
|
|
647
|
+
prevBrandName = browserName;
|
|
648
|
+
if (prevBrandName === null || /Chrom/.test(prevBrandName) || !/Chrom/.test(brandName)) {
|
|
649
|
+
browserName = brandName;
|
|
650
|
+
if (browserName === 'Chrome' || browserName === 'Chrome WebView' || browserName === 'Chrome Headless')
|
|
651
|
+
Platform.browser.name = Browsers.Chrome;
|
|
652
|
+
else if (browserName === 'Edge' || browserName === 'Edge WebView2')
|
|
653
|
+
Platform.browser.name = Browsers.Edge;
|
|
654
|
+
else if (browserName === 'Opera Mobi')
|
|
655
|
+
Platform.browser.name = Browsers.Opera;
|
|
656
|
+
Platform.browser.version = brandVersion;
|
|
657
|
+
}
|
|
658
|
+
prevBrandName = brandName;
|
|
659
|
+
}
|
|
660
|
+
if (brandName === 'Chromium')
|
|
661
|
+
Platform.engine.version = brandVersion;
|
|
662
|
+
}
|
|
663
|
+
if (typeof platformVersion === 'string') {
|
|
664
|
+
if (Platform.os.name === OS.Windows)
|
|
665
|
+
Platform.os.version = parseInt(platformVersion.split('.')[0], 10) >= 13 ? '11' : '10';
|
|
666
|
+
else
|
|
667
|
+
Platform.os.version = platformVersion;
|
|
668
|
+
}
|
|
669
|
+
if (typeof platform === 'string') {
|
|
670
|
+
if (/android/i.test(platform))
|
|
671
|
+
Platform.os.name = OS.Android;
|
|
672
|
+
else if (/ios|iphone|ipad/i.test(platform))
|
|
673
|
+
Platform.os.name = OS.iOS;
|
|
674
|
+
else if (/windows|win32/i.test(platform))
|
|
675
|
+
Platform.os.name = OS.Windows;
|
|
676
|
+
else if (/macos|macintel/i.test(platform))
|
|
677
|
+
Platform.os.name = OS.MacOS;
|
|
678
|
+
}
|
|
679
|
+
if (result.mobile === true)
|
|
680
|
+
Platform.device = Devices.Mobile;
|
|
681
|
+
});
|
|
682
|
+
}
|
|
501
683
|
}
|
|
502
|
-
|
|
503
|
-
Platform.isMobile = Platform.device === Devices.Mobile;
|
|
504
|
-
Platform.isDesktop = Platform.device === Devices.Desktop;
|
|
505
|
-
Platform.isStandalone = getIsStandalone(Platform.os);
|
|
684
|
+
init();
|
|
506
685
|
|
|
507
686
|
var NativePlatformPlugin = {
|
|
508
687
|
installed: false,
|