native-fn 1.0.61 → 1.0.63
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/native.cjs +20 -7
- package/dist/native.min.cjs +1 -1
- package/dist/native.min.mjs +1 -1
- package/dist/native.mjs +20 -7
- package/dist/native.umd.js +20 -7
- package/dist/native.umd.min.js +1 -1
- package/dist/plugin/app/index.cjs +134 -89
- package/dist/plugin/app/index.d.ts +6 -0
- package/dist/plugin/app/index.min.cjs +1 -1
- package/dist/plugin/app/index.min.mjs +1 -1
- package/dist/plugin/app/index.mjs +134 -89
- package/dist/plugin/app/index.umd.js +134 -89
- package/dist/plugin/app/index.umd.min.js +1 -1
- package/dist/plugin/app/src/constants/platform.d.ts +10 -0
- package/dist/plugin/app/src/plugin/app/utils/try-open-url.d.ts +15 -0
- package/dist/plugin/app/src/types/platform.d.ts +0 -3
- package/dist/plugin/camera/index.cjs +19 -6
- package/dist/plugin/camera/index.min.cjs +1 -1
- package/dist/plugin/camera/index.min.mjs +1 -1
- package/dist/plugin/camera/index.mjs +19 -6
- package/dist/plugin/camera/index.umd.js +19 -6
- package/dist/plugin/camera/index.umd.min.js +1 -1
- package/dist/plugin/camera/src/constants/platform.d.ts +10 -0
- package/dist/plugin/camera/src/plugin/app/utils/try-open-url.d.ts +15 -0
- package/dist/plugin/camera/src/types/platform.d.ts +0 -3
- package/dist/plugin/clipboard/index.cjs +225 -212
- package/dist/plugin/clipboard/index.min.cjs +1 -1
- package/dist/plugin/clipboard/index.min.mjs +1 -1
- package/dist/plugin/clipboard/index.mjs +225 -212
- package/dist/plugin/clipboard/index.umd.js +225 -212
- package/dist/plugin/clipboard/index.umd.min.js +1 -1
- package/dist/plugin/clipboard/src/constants/platform.d.ts +10 -0
- package/dist/plugin/clipboard/src/plugin/app/utils/try-open-url.d.ts +15 -0
- package/dist/plugin/clipboard/src/types/platform.d.ts +0 -3
- package/dist/plugin/fullscreen/index.cjs +26 -13
- package/dist/plugin/fullscreen/index.min.cjs +1 -1
- package/dist/plugin/fullscreen/index.min.mjs +1 -1
- package/dist/plugin/fullscreen/index.mjs +26 -13
- package/dist/plugin/fullscreen/index.umd.js +26 -13
- package/dist/plugin/fullscreen/index.umd.min.js +1 -1
- package/dist/plugin/fullscreen/src/constants/platform.d.ts +10 -0
- package/dist/plugin/fullscreen/src/plugin/app/utils/try-open-url.d.ts +15 -0
- package/dist/plugin/fullscreen/src/types/platform.d.ts +0 -3
- package/dist/plugin/theme/index.cjs +24 -11
- package/dist/plugin/theme/index.min.cjs +1 -1
- package/dist/plugin/theme/index.min.mjs +1 -1
- package/dist/plugin/theme/index.mjs +24 -11
- package/dist/plugin/theme/index.umd.js +24 -11
- package/dist/plugin/theme/index.umd.min.js +1 -1
- package/dist/plugin/theme/src/constants/platform.d.ts +10 -0
- package/dist/plugin/theme/src/plugin/app/utils/try-open-url.d.ts +15 -0
- package/dist/plugin/theme/src/types/platform.d.ts +0 -3
- package/dist/src/constants/platform.d.ts +10 -0
- package/dist/src/plugin/app/utils/try-open-url.d.ts +15 -0
- package/dist/src/types/platform.d.ts +0 -3
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
!function(e,n){"object"==typeof exports&&"undefined"!=typeof module?module.exports=n():"function"==typeof define&&define.amd?define(n):(e="undefined"!=typeof globalThis?globalThis:e||self).Fullscreen=n()}(this,(function(){"use strict";var e,n,r,o;!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"}(n||(n={})),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"}(o||(o={}));var i="undefined"!=typeof navigator&&"string"==typeof navigator.userAgent?navigator.userAgent:"",t={device:n.Unknown,os:e.Unknown,osVersion:"",engine:r.Unknown,engineVersion:"",browser:o.Unknown,browserVersion:"",renderer:function(){if(void 0===globalThis.document)return"";var e=globalThis.document.createElement("canvas");if("function"!=typeof e.getContext)return"";var n=e.getContext("webgl2")||e.getContext("experimental-webgl")||e.getContext("webgl");if(null===n)return"";if(n instanceof WebGLRenderingContext||"getParameter"in n&&"function"==typeof n.getParameter){var r=n.getExtension("WEBGL_debug_renderer_info");return null===r?n.getParameter(n.RENDERER):n.getParameter(r.UNMASKED_RENDERER_WEBGL)}return""}(),userAgent:i,isMobile:!1,isDesktop:!1,isStandalone:!1,isWebview:/; ?wv|applewebkit(?!.*safari)/i.test(i),isNodeJS:void 0!==globalThis.process&&void 0!==globalThis.process.versions&&void 0!==globalThis.process.versions.node,isElectron:void 0!==globalThis.process&&void 0!==globalThis.process.versions&&void 0!==globalThis.process.versions.electron||/ electron\//i.test(i),isReactNative:"undefined"!=typeof navigator&&"ReactNative"===navigator.product},l=[[/windows nt (6\.[23]); arm/i,e.Windows,u],[/windows (?:phone|mobile|iot)(?: os)?[\/ ]?([\d.]*( se)?)/i,e.Windows,u],[/windows[\/ ](1[01]|2000|3\.1|7|8(\.1)?|9[58]|me|server 20\d\d( r2)?|vista|xp)/i,e.Windows,u],[/windows nt ?([\d.)]*)(?!.+xbox)/i,e.Windows,u],[/\bwin(?=3| ?9|n)(?:nt| 9x )?([\d.;]*)/i,e.Windows,u],[/windows ce\/?([\d.]*)/i,e.Windows,u],[/[adehimnop]{4,7}\b(?:.*os (\w+) like mac|; opera)/i,e.iOS,c],[/(?:ios;fbsv|ios(?=.+ip(?:ad|hone))|ip(?:ad|hone)(?: |.+i(?:pad)?)os)[\/ ]([\w.]+)/i,e.iOS,c],[/cfnetwork\/.+darwin/i,e.iOS,c],[/mac os x ?([\w. ]*)/i,e.MacOS,c],[/(?:macintosh|mac_powerpc\b)(?!.+(haiku|morphos))/i,e.MacOS,c],[/droid ([\w.]+)\b.+(android[- ]x86)/i,e.Android],[/android\w*[-\/.; ]?([\d.]*)/i,e.Android]],a=[[/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]],s=[[/\b(?:crmo|crios)\/([\w.]+)/i,o.Chrome],[/webview.+edge\/([\w.]+)/i,o.Edge],[/edg(?:e|ios|a)?\/([\w.]+)/i,o.Edge],[/opera mini\/([-\w.]+)/i,o.Opera],[/opera [mobileta]{3,6}\b.+version\/([-\w.]+)/i,o.Opera],[/opera(?:.+version\/|[\/ ]+)([\w.]+)/i,o.Opera],[/opios[\/ ]+([\w.]+)/i,o.Opera],[/\bop(?:rg)?x\/([\w.]+)/i,o.Opera],[/\bopr\/([\w.]+)/i,o.Opera],[/iemobile(?:browser|boat|jet)[\/ ]?([\d.]*)/i,o.IE],[/(?:ms|\()ie ([\w.]+)/i,o.IE],[/trident.+rv[: ]([\w.]{1,9})\b.+like gecko/i,o.IE],[/\bfocus\/([\w.]+)/i,o.Firefox],[/\bopt\/([\w.]+)/i,o.Opera],[/coast\/([\w.]+)/i,o.Opera],[/fxios\/([\w.-]+)/i,o.Firefox],[/samsungbrowser\/([\w.]+)/i,o.SamsungInternet],[/headlesschrome(?:\/([\w.]+)| )/i,o.Chrome],[/wv\).+chrome\/([\w.]+).+edgw\//i,o.Edge],[/ wv\).+(chrome)\/([\w.]+)/i,o.Chrome],[/chrome\/([\w.]+) mobile/i,o.Chrome],[/chrome\/v?([\w.]+)/i,o.Chrome],[/version\/([\w.,]+) .*mobile(?:\/\w+ | ?)safari/i,o.Safari],[/iphone .*mobile(?:\/\w+ | ?)safari/i,o.Safari],[/version\/([\w.,]+) .*safari/i,o.Safari],[/webkit.+?(?:mobile ?safari|safari)(\/[\w.]+)/i,o.Safari,"1"],[/(?:mobile|tablet);.*firefox\/([\w.-]+)/i,o.Firefox],[/mobile vr; rv:([\w.]+)\).+firefox/i,o.Firefox],[/firefox\/([\w.]+)/i,o.Firefox]];function u(e){if(void 0===e)return"";var n={"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!==n?n:e}function c(e){return void 0===e?"":e.replace(/_/g,".")}function d(e,n){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":n}function m(e,n){return"function"==typeof n?n(e):"string"==typeof n?n:void 0===e?"":e}function f(e){var n=e.split(".");return{major:parseInt(n[0]||"0"),minor:parseInt(n[1]||"0"),build:parseInt(n[2]||"0")}}for(var b=0;b<l.length;b++){var w=(p=l[b])[0],g=p[1],v=p[2];if(null!==(k=t.userAgent.match(w))){t.os=g,t.osVersion=m(k[1],v);break}}t.os===e.iOS&&0===function(e,n){for(var r=e.split("."),o=n.split("."),i=Math.max(r.length,o.length),t=0;t<i;t++){var l=void 0,a=void 0;if((l=t<r.length?parseInt(r[t],10):0)>(a=t<o.length?parseInt(o[t],10):0))return 1;if(l<a)return-1}return 0}(t.osVersion,"18.6")&&(null!==(S=/\) Version\/([\d.]+)/.exec(t.userAgent))&&parseInt(S[1].substring(0,2),10)>=26&&(t.osVersion=S[1]));for(b=0;b<a.length;b++){w=(p=a[b])[0];var h=p[1];v=p[2];if(null!==(k=t.userAgent.match(w))){t.engine=h,t.engineVersion=m(k[1],v);break}}for(b=0;b<s.length;b++){w=(p=s[b])[0];var p,k,E=p[1];v=p[2];if(null!==(k=t.userAgent.match(w))){t.browser=E,t.browserVersion=m(k[1],v);break}}if(t.isReactNative)try{g=(j=require("react-native").Platform).OS;var S=f(T=""+j.Version);switch(g){case"android":t.os=e.Android,t.osVersion=function(e,n){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?"4.4W":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":n}(S,T);break;case"ios":t.os=e.iOS,t.osVersion=T;break;case"windows":t.os=e.Windows,t.osVersion=d(S,T);break;case"macos":t.os=e.MacOS,t.osVersion=T}}catch(e){}if(t.isNodeJS)try{var T,j=(g=require("os")).platform();S=f(T=g.release());switch(j){case"win32":t.os=e.Windows,t.osVersion=d(S,T);break;case"darwin":t.os=e.MacOS,t.osVersion=function(e,n){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:n}(S,T);break;case"android":t.os=e.Android,t.osVersion=T;break;case"linux":/android/i.test(T)&&(t.os=e.Android,t.osVersion=T)}}catch(e){}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(n){for(var r,o=n.fullVersionList||n.brands||[],i=n.platformVersion,l=0;l<o.length;l++){var a=null==(r=o[l])?{brand:"",version:""}:"string"==typeof r?{brand:r,version:""}:{brand:r.brand,version:r.version},s=a.brand,u=a.version;/not.a.brand/i.test(s)||"Chromium"===s&&(t.engineVersion=u)}"string"==typeof i&&(t.os===e.Windows&&parseInt(i.replace(/[^\d.]/g,"").split(".")[0],10)>=13?t.osVersion="11":t.osVersion=i)})),t.device=t.os===e.iOS||t.os===e.Android?n.Mobile:t.os===e.Windows||t.os===e.MacOS?n.Desktop:n.Unknown,t.isMobile=t.device===n.Mobile,t.isDesktop=t.device===n.Desktop,t.isStandalone=function(n){return"matchMedia"in globalThis&&(n===e.iOS?"standalone"in navigator&&!!navigator.standalone:globalThis.matchMedia("(display-mode: standalone)").matches)}(t.os);var F={standard:{enabled:"fullscreenEnabled",element:"fullscreenElement",request:"requestFullscreen",exit:"exitFullscreen",events:{change:"fullscreenchange",error:"fullscreenerror"}},webkit:{enabled:"webkitFullscreenEnabled",element:"webkitFullscreenElement",request:"webkitRequestFullscreen",exit:"webkitExitFullscreen",events:{change:"webkitfullscreenchange",error:"webkitfullscreenerror"}},moz:{enabled:"mozFullScreenEnabled",element:"mozFullScreenElement",request:"mozRequestFullScreen",exit:"mozCancelFullScreen",events:{change:"mozfullscreenchange",error:"mozfullscreenerror"}},ms:{enabled:"msFullscreenEnabled",element:"msFullscreenElement",request:"msRequestFullscreen",exit:"msExitFullscreen",events:{change:"MSFullscreenChange",error:"MSFullscreenError"}}};var x=function(){var n=function(){if(t.isElectron)return null;var e=globalThis.document.documentElement;if("fullscreenEnabled"in globalThis.document||"exitFullscreen"in globalThis.document)return F.standard;for(var n=["webkit","moz","ms"],r=0;r<n.length;r++){var o=n[r];if((i=F[o]).enabled in globalThis.document||i.element in globalThis.document||i.exit in globalThis.document)return"webkit"===o&&"webkitRequestFullScreen"in e&&(i.request="webkitRequestFullScreen"),i}if("webkitCurrentFullScreenElement"in globalThis.document){var i={enabled:"webkitFullscreenEnabled",element:"webkitCurrentFullScreenElement",request:"webkitRequestFullscreen",exit:"webkitExitFullscreen",events:F.webkit.events};return"webkitRequestFullScreen"in e&&(i.request="webkitRequestFullScreen"),i}return null}(),r=null,o=null,i=null,l=!1;function a(){null!==i&&(o.fullScreenable=i.fullScreenable,o.autoHideMenuBar=i.autoHideMenuBar,i=null),o=null}function s(){void 0!==globalThis.document&&globalThis.document.querySelectorAll("video").forEach((function(e){function n(){globalThis.document.dispatchEvent(new Event("fullscreenchange"))}e.__fsBridged__||!("webkitEnterFullscreen"in e)&&!("onwebkitbeginfullscreen"in e)||(e.addEventListener("webkitbeginfullscreen",n,!1),e.addEventListener("webkitendfullscreen",n,!1),e.__fsBridged__=!0)}))}function u(){if(t.isElectron){if(null!==o)return o;try{for(var i=require("electron").BrowserWindow.getAllWindows(),l=0;l<i.length;l++){var a=i[l];if(a.isFullScreen()||t.os===e.MacOS&&"function"==typeof a.isSimpleFullScreen&&a.isSimpleFullScreen())return a}return null}catch(e){return null}}if(null===n)return r&&r.webkitDisplayingFullscreen?r:null;var s=globalThis.document[n.element];return null!=s?s:null}function c(){return null!==u()}function d(l,a){if(void 0===l&&(l=function(){if(t.isElectron){var n=require("electron"),r=n.BrowserWindow.getFocusedWindow();if(null!==r)return r;var o=n.BrowserWindow.getAllWindows();if(0===o.length)throw new Error;return o[0]}if(e.iOS===t.os){var i=globalThis.document.querySelector("video");if(null===i)throw new Error;return i}return globalThis.document.documentElement}()),t.isElectron){var u=l;return new Promise((function(e,n){try{return null===o&&(i={fullScreenable:u.fullScreenable,autoHideMenuBar:u.autoHideMenuBar},u.fullScreenable=!0,u.autoHideMenuBar=!0),u.setFullScreen(!0),o=u,void e()}catch(e){n()}}))}return new Promise((function(o,i){if(null!==n){var u=l[n.request];if("function"==typeof u)try{var c=u.call(l,a);return void 0!==c&&"function"==typeof c.then?void c.then((function(){o()})).catch((function(){e.iOS===t.os?d():i()})):void o()}catch(n){if(e.iOS!==t.os)return void i()}}function d(){if(e.iOS===t.os&&"VIDEO"===l.tagName.toUpperCase()){var n=l;if(n.webkitSupportsFullscreen&&"function"==typeof n.webkitEnterFullscreen)return r=n,s(),n.webkitEnterFullscreen(),void o()}i()}d()}))}function m(){return t.isElectron?new Promise((function(e,n){try{if(null!==o)o.setFullScreen(!1),a();else{var r=u();null!==r&&r.setFullScreen(!1)}e()}catch(e){n()}})):new Promise((function(o,i){if(null!==n){var l=globalThis.document[n.exit];if("function"==typeof l){var a=l.call(globalThis.document);return void 0!==a&&"function"==typeof a.then?void a.then((function(){o()})).catch((function(){i()})):void o()}}if(e.iOS===t.os&&null!==r){if("function"==typeof r.webkitExitFullscreen&&!0===r.webkitDisplayingFullscreen)return r.webkitExitFullscreen(),r=null,void o();for(var s=globalThis.document.querySelectorAll("video"),c=0;c<s.length;c++){var d=s[c];if("function"==typeof d.webkitExitFullscreen&&!0===d.webkitDisplayingFullscreen)return d.webkitExitFullscreen(),void o()}}u()?i():o()}))}return function(){if(!l){l=!0;var n=!1;if(t.isElectron)try{for(var r=require("electron"),i=r.BrowserWindow.getAllWindows(),u=function(e){var n=i[e];n.on("enter-full-screen",(function(){o=n,b()})),n.on("leave-full-screen",(function(){a(),b()}))},c=0;c<i.length;c++)u(c);"function"==typeof r.BrowserWindow.on&&r.BrowserWindow.on("browser-window-created",(function(e,n){n.on("enter-full-screen",(function(){o=n,b()})),n.on("leave-full-screen",(function(){a(),b()}))}))}catch(e){}var d=["webkitfullscreenchange","mozfullscreenchange","MSFullscreenChange"],m=["webkitfullscreenerror","mozfullscreenerror","MSFullscreenError"];for(c=0;c<d.length;c++)void 0!==globalThis.document&&globalThis.document.addEventListener(d[c],b,!1);for(c=0;c<m.length;c++)void 0!==globalThis.document&&globalThis.document.addEventListener(m[c],w,!1);if(e.iOS===t.os)if(s(),void 0!==globalThis.MutationObserver)new MutationObserver((function(){s()})).observe(globalThis.document.documentElement,{childList:!0,subtree:!0})}function f(e){n||(n=!0,void 0!==globalThis.document&&globalThis.document.dispatchEvent(new Event(e,{bubbles:!0,cancelable:!1})),Promise.resolve().then((function(){n=!1})))}function b(){f("fullscreenchange")}function w(){f("fullscreenerror")}}(),{get enabled(){return function(){if(t.isElectron)try{return"function"==typeof require("electron").BrowserWindow.prototype.setFullScreen}catch(e){return!1}if(null===n){if(e.iOS!==t.os)return!1;for(var r=globalThis.document.querySelectorAll("video"),o=0;o<r.length;o++){var i=r[o];if(i.webkitSupportsFullscreen||"webkitEnterFullscreen"in i)return!0}return!1}var l=globalThis.document[n.enabled];return"boolean"==typeof l?l:void 0!==globalThis.document[n.element]}()},get element(){return u()},get isFullscreen(){return c()},request:d,exit:m,toggle:function(e,n){return c()?m():d(e,n)},onChange:function(e){var n=[];return function(r){function o(n){e(n)}void 0!==globalThis.document&&(globalThis.document.addEventListener(r,o,!1),n.push((function(){globalThis.document.removeEventListener(r,o,!1)})))}("fullscreenchange"),function(){n.forEach((function(e){e()}))}},onError:function(e){var n=[];return function(r){function o(n){e(n)}void 0!==globalThis.document&&(globalThis.document.addEventListener(r,o,!1),n.push((function(){globalThis.document.removeEventListener(r,o,!1)})))}("fullscreenerror"),function(){n.forEach((function(e){e()}))}}}}();return{installed:!1,name:"Fullscreen",module:x,Constants:{},Errors:{}}}));
|
|
1
|
+
!function(e,n){"object"==typeof exports&&"undefined"!=typeof module?module.exports=n():"function"==typeof define&&define.amd?define(n):(e="undefined"!=typeof globalThis?globalThis:e||self).Fullscreen=n()}(this,(function(){"use strict";var e,n,r,o;!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"}(n||(n={})),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"}(o||(o={}));var i=void 0!==globalThis.navigator&&"string"==typeof globalThis.navigator.userAgent?globalThis.navigator.userAgent:"",t=void 0!==globalThis.process&&void 0!==globalThis.process.versions&&void 0!==globalThis.process.versions.node,l=void 0!==globalThis.process&&void 0!==globalThis.process.versions&&void 0!==globalThis.process.versions.electron||/ electron\//i.test(i),a=void 0!==globalThis.navigator&&"ReactNative"===globalThis.navigator.product,s={device:n.Unknown,os:e.Unknown,osVersion:"",engine:r.Unknown,engineVersion:"",browser:o.Unknown,browserVersion:"",renderer:function(){if(void 0===globalThis.document)return"";var e=globalThis.document.createElement("canvas");if("function"!=typeof e.getContext)return"";var n=e.getContext("webgl2")||e.getContext("experimental-webgl")||e.getContext("webgl");if(null===n)return"";if(n instanceof WebGLRenderingContext||"getParameter"in n&&"function"==typeof n.getParameter){var r=n.getExtension("WEBGL_debug_renderer_info");return null===r?n.getParameter(n.RENDERER):n.getParameter(r.UNMASKED_RENDERER_WEBGL)}return""}(),userAgent:i,isMobile:!1,isDesktop:!1,isStandalone:!1,isWebview:/; ?wv|applewebkit(?!.*safari)/i.test(i)},u=[[/windows nt (6\.[23]); arm/i,e.Windows,m],[/windows (?:phone|mobile|iot)(?: os)?[\/ ]?([\d.]*( se)?)/i,e.Windows,m],[/windows[\/ ](1[01]|2000|3\.1|7|8(\.1)?|9[58]|me|server 20\d\d( r2)?|vista|xp)/i,e.Windows,m],[/windows nt ?([\d.)]*)(?!.+xbox)/i,e.Windows,m],[/\bwin(?=3| ?9|n)(?:nt| 9x )?([\d.;]*)/i,e.Windows,m],[/windows ce\/?([\d.]*)/i,e.Windows,m],[/[adehimnop]{4,7}\b(?:.*os (\w+) like mac|; opera)/i,e.iOS,f],[/(?:ios;fbsv|ios(?=.+ip(?:ad|hone))|ip(?:ad|hone)(?: |.+i(?:pad)?)os)[\/ ]([\w.]+)/i,e.iOS,f],[/cfnetwork\/.+darwin/i,e.iOS,f],[/mac os x ?([\w. ]*)/i,e.MacOS,f],[/(?:macintosh|mac_powerpc\b)(?!.+(haiku|morphos))/i,e.MacOS,f],[/droid ([\w.]+)\b.+(android[- ]x86)/i,e.Android],[/android\w*[-\/.; ]?([\d.]*)/i,e.Android]],c=[[/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]],d=[[/\b(?:crmo|crios)\/([\w.]+)/i,o.Chrome],[/webview.+edge\/([\w.]+)/i,o.Edge],[/edg(?:e|ios|a)?\/([\w.]+)/i,o.Edge],[/opera mini\/([-\w.]+)/i,o.Opera],[/opera [mobileta]{3,6}\b.+version\/([-\w.]+)/i,o.Opera],[/opera(?:.+version\/|[\/ ]+)([\w.]+)/i,o.Opera],[/opios[\/ ]+([\w.]+)/i,o.Opera],[/\bop(?:rg)?x\/([\w.]+)/i,o.Opera],[/\bopr\/([\w.]+)/i,o.Opera],[/iemobile(?:browser|boat|jet)[\/ ]?([\d.]*)/i,o.IE],[/(?:ms|\()ie ([\w.]+)/i,o.IE],[/trident.+rv[: ]([\w.]{1,9})\b.+like gecko/i,o.IE],[/\bfocus\/([\w.]+)/i,o.Firefox],[/\bopt\/([\w.]+)/i,o.Opera],[/coast\/([\w.]+)/i,o.Opera],[/fxios\/([\w.-]+)/i,o.Firefox],[/samsungbrowser\/([\w.]+)/i,o.SamsungInternet],[/headlesschrome(?:\/([\w.]+)| )/i,o.Chrome],[/wv\).+chrome\/([\w.]+).+edgw\//i,o.Edge],[/ wv\).+(chrome)\/([\w.]+)/i,o.Chrome],[/chrome\/([\w.]+) mobile/i,o.Chrome],[/chrome\/v?([\w.]+)/i,o.Chrome],[/version\/([\w.,]+) .*mobile(?:\/\w+ | ?)safari/i,o.Safari],[/iphone .*mobile(?:\/\w+ | ?)safari/i,o.Safari],[/version\/([\w.,]+) .*safari/i,o.Safari],[/webkit.+?(?:mobile ?safari|safari)(\/[\w.]+)/i,o.Safari,"1"],[/(?:mobile|tablet);.*firefox\/([\w.-]+)/i,o.Firefox],[/mobile vr; rv:([\w.]+)\).+firefox/i,o.Firefox],[/firefox\/([\w.]+)/i,o.Firefox]];function m(e){if(void 0===e)return"";var n={"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!==n?n:e}function f(e){return void 0===e?"":e.replace(/_/g,".")}function b(e,n){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":n}function w(e,n){return"function"==typeof n?n(e):"string"==typeof n?n:void 0===e?"":e}function g(e){var n=e.split(".");return{major:parseInt(n[0]||"0"),minor:parseInt(n[1]||"0"),build:parseInt(n[2]||"0")}}for(var v=0;v<u.length;v++){var h=(E=u[v])[0],p=E[1],k=E[2];if(null!==(S=s.userAgent.match(h))){s.os=p,s.osVersion=w(S[1],k);break}}s.os===e.iOS&&0===function(e,n){for(var r=e.split("."),o=n.split("."),i=Math.max(r.length,o.length),t=0;t<i;t++){var l=void 0,a=void 0;if((l=t<r.length?parseInt(r[t],10):0)>(a=t<o.length?parseInt(o[t],10):0))return 1;if(l<a)return-1}return 0}(s.osVersion,"18.6")&&(null!==(F=/\) Version\/([\d.]+)/.exec(s.userAgent))&&parseInt(F[1].substring(0,2),10)>=26&&(s.osVersion=F[1]));for(v=0;v<c.length;v++){h=(E=c[v])[0];var T=E[1];k=E[2];if(null!==(S=s.userAgent.match(h))){s.engine=T,s.engineVersion=w(S[1],k);break}}for(v=0;v<d.length;v++){h=(E=d[v])[0];var E,S,j=E[1];k=E[2];if(null!==(S=s.userAgent.match(h))){s.browser=j,s.browserVersion=w(S[1],k);break}}if(a)try{p=(y=require("react-native").Platform).OS;var F=g(x=""+y.Version);switch(p){case"android":s.os=e.Android,s.osVersion=function(e,n){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?"4.4W":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":n}(F,x);break;case"ios":s.os=e.iOS,s.osVersion=x;break;case"windows":s.os=e.Windows,s.osVersion=b(F,x);break;case"macos":s.os=e.MacOS,s.osVersion=x}}catch(e){}if(t)try{var x,y=(p=require("os")).platform();F=g(x=p.release());switch(y){case"win32":s.os=e.Windows,s.osVersion=b(F,x);break;case"darwin":s.os=e.MacOS,s.osVersion=function(e,n){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:n}(F,x);break;case"android":s.os=e.Android,s.osVersion=x;break;case"linux":/android/i.test(x)&&(s.os=e.Android,s.osVersion=x)}}catch(e){}document.addEventListener("deviceready",(function(){if(s.os===e.Unknown&&void 0!==globalThis.device){switch(globalThis.device.platform){case"Android":s.os=e.Android;break;case"iOS":s.os=e.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(n){for(var r,o=n.fullVersionList||n.brands||[],i=n.platformVersion,t=0;t<o.length;t++){var l=null==(r=o[t])?{brand:"",version:""}:"string"==typeof r?{brand:r,version:""}:{brand:r.brand,version:r.version},a=l.brand,u=l.version;/not.a.brand/i.test(a)||"Chromium"===a&&(s.engineVersion=u)}"string"==typeof i&&(s.os===e.Windows&&parseInt(i.replace(/[^\d.]/g,"").split(".")[0],10)>=13?s.osVersion="11":s.osVersion=i)})),s.device=s.os===e.iOS||s.os===e.Android?n.Mobile:s.os===e.Windows||s.os===e.MacOS?n.Desktop:n.Unknown,s.isMobile=s.device===n.Mobile,s.isDesktop=s.device===n.Desktop,s.isStandalone=function(n){return"matchMedia"in globalThis&&(n===e.iOS?"standalone"in navigator&&!!navigator.standalone:globalThis.matchMedia("(display-mode: standalone)").matches)}(s.os);var O={standard:{enabled:"fullscreenEnabled",element:"fullscreenElement",request:"requestFullscreen",exit:"exitFullscreen",events:{change:"fullscreenchange",error:"fullscreenerror"}},webkit:{enabled:"webkitFullscreenEnabled",element:"webkitFullscreenElement",request:"webkitRequestFullscreen",exit:"webkitExitFullscreen",events:{change:"webkitfullscreenchange",error:"webkitfullscreenerror"}},moz:{enabled:"mozFullScreenEnabled",element:"mozFullScreenElement",request:"mozRequestFullScreen",exit:"mozCancelFullScreen",events:{change:"mozfullscreenchange",error:"mozfullscreenerror"}},ms:{enabled:"msFullscreenEnabled",element:"msFullscreenElement",request:"msRequestFullscreen",exit:"msExitFullscreen",events:{change:"MSFullscreenChange",error:"MSFullscreenError"}}};var M=function(){var n=function(){if(l)return null;var e=globalThis.document.documentElement;if("fullscreenEnabled"in globalThis.document||"exitFullscreen"in globalThis.document)return O.standard;for(var n=["webkit","moz","ms"],r=0;r<n.length;r++){var o=n[r];if((i=O[o]).enabled in globalThis.document||i.element in globalThis.document||i.exit in globalThis.document)return"webkit"===o&&"webkitRequestFullScreen"in e&&(i.request="webkitRequestFullScreen"),i}if("webkitCurrentFullScreenElement"in globalThis.document){var i={enabled:"webkitFullscreenEnabled",element:"webkitCurrentFullScreenElement",request:"webkitRequestFullscreen",exit:"webkitExitFullscreen",events:O.webkit.events};return"webkitRequestFullScreen"in e&&(i.request="webkitRequestFullScreen"),i}return null}(),r=null,o=null,i=null,t=!1;function a(){null!==i&&(o.fullScreenable=i.fullScreenable,o.autoHideMenuBar=i.autoHideMenuBar,i=null),o=null}function u(){void 0!==globalThis.document&&globalThis.document.querySelectorAll("video").forEach((function(e){function n(){globalThis.document.dispatchEvent(new Event("fullscreenchange"))}e.__fsBridged__||!("webkitEnterFullscreen"in e)&&!("onwebkitbeginfullscreen"in e)||(e.addEventListener("webkitbeginfullscreen",n,!1),e.addEventListener("webkitendfullscreen",n,!1),e.__fsBridged__=!0)}))}function c(){if(l){if(null!==o)return o;try{for(var i=require("electron").BrowserWindow.getAllWindows(),t=0;t<i.length;t++){var a=i[t];if(a.isFullScreen()||s.os===e.MacOS&&"function"==typeof a.isSimpleFullScreen&&a.isSimpleFullScreen())return a}return null}catch(e){return null}}if(null===n)return r&&r.webkitDisplayingFullscreen?r:null;var u=globalThis.document[n.element];return null!=u?u:null}function d(){return null!==c()}function m(t,a){if(void 0===t&&(t=function(){if(l){var n=require("electron"),r=n.BrowserWindow.getFocusedWindow();if(null!==r)return r;var o=n.BrowserWindow.getAllWindows();if(0===o.length)throw new Error;return o[0]}if(e.iOS===s.os){var i=globalThis.document.querySelector("video");if(null===i)throw new Error;return i}return globalThis.document.documentElement}()),l){var c=t;return new Promise((function(e,n){try{return null===o&&(i={fullScreenable:c.fullScreenable,autoHideMenuBar:c.autoHideMenuBar},c.fullScreenable=!0,c.autoHideMenuBar=!0),c.setFullScreen(!0),o=c,void e()}catch(e){n()}}))}return new Promise((function(o,i){if(null!==n){var l=t[n.request];if("function"==typeof l)try{var c=l.call(t,a);return void 0!==c&&"function"==typeof c.then?void c.then((function(){o()})).catch((function(){e.iOS===s.os?d():i()})):void o()}catch(n){if(e.iOS!==s.os)return void i()}}function d(){if(e.iOS===s.os&&"VIDEO"===t.tagName.toUpperCase()){var n=t;if(n.webkitSupportsFullscreen&&"function"==typeof n.webkitEnterFullscreen)return r=n,u(),n.webkitEnterFullscreen(),void o()}i()}d()}))}function f(){return new Promise(l?function(e,n){try{if(null!==o)o.setFullScreen(!1),a();else{var r=c();null!==r&&r.setFullScreen(!1)}e()}catch(e){n()}}:function(o,i){if(null!==n){var t=globalThis.document[n.exit];if("function"==typeof t){var l=t.call(globalThis.document);return void 0!==l&&"function"==typeof l.then?void l.then((function(){o()})).catch((function(){i()})):void o()}}if(e.iOS===s.os&&null!==r){if("function"==typeof r.webkitExitFullscreen&&!0===r.webkitDisplayingFullscreen)return r.webkitExitFullscreen(),r=null,void o();for(var a=globalThis.document.querySelectorAll("video"),u=0;u<a.length;u++){var d=a[u];if("function"==typeof d.webkitExitFullscreen&&!0===d.webkitDisplayingFullscreen)return d.webkitExitFullscreen(),void o()}}c()?i():o()})}return function(){if(!t){t=!0;var n=!1;if(l)try{for(var r=require("electron"),i=r.BrowserWindow.getAllWindows(),c=function(e){var n=i[e];n.on("enter-full-screen",(function(){o=n,w()})),n.on("leave-full-screen",(function(){a(),w()}))},d=0;d<i.length;d++)c(d);"function"==typeof r.BrowserWindow.on&&r.BrowserWindow.on("browser-window-created",(function(e,n){n.on("enter-full-screen",(function(){o=n,w()})),n.on("leave-full-screen",(function(){a(),w()}))}))}catch(e){}var m=["webkitfullscreenchange","mozfullscreenchange","MSFullscreenChange"],f=["webkitfullscreenerror","mozfullscreenerror","MSFullscreenError"];for(d=0;d<m.length;d++)void 0!==globalThis.document&&globalThis.document.addEventListener(m[d],w,!1);for(d=0;d<f.length;d++)void 0!==globalThis.document&&globalThis.document.addEventListener(f[d],g,!1);if(e.iOS===s.os)if(u(),void 0!==globalThis.MutationObserver)new MutationObserver((function(){u()})).observe(globalThis.document.documentElement,{childList:!0,subtree:!0})}function b(e){n||(n=!0,void 0!==globalThis.document&&globalThis.document.dispatchEvent(new Event(e,{bubbles:!0,cancelable:!1})),Promise.resolve().then((function(){n=!1})))}function w(){b("fullscreenchange")}function g(){b("fullscreenerror")}}(),{get enabled(){return function(){if(l)try{return"function"==typeof require("electron").BrowserWindow.prototype.setFullScreen}catch(e){return!1}if(null===n){if(e.iOS!==s.os)return!1;for(var r=globalThis.document.querySelectorAll("video"),o=0;o<r.length;o++){var i=r[o];if(i.webkitSupportsFullscreen||"webkitEnterFullscreen"in i)return!0}return!1}var t=globalThis.document[n.enabled];return"boolean"==typeof t?t:void 0!==globalThis.document[n.element]}()},get element(){return c()},get isFullscreen(){return d()},request:m,exit:f,toggle:function(e,n){return d()?f():m(e,n)},onChange:function(e){var n=[];return function(r){function o(n){e(n)}void 0!==globalThis.document&&(globalThis.document.addEventListener(r,o,!1),n.push((function(){globalThis.document.removeEventListener(r,o,!1)})))}("fullscreenchange"),function(){n.forEach((function(e){e()}))}},onError:function(e){var n=[];return function(r){function o(n){e(n)}void 0!==globalThis.document&&(globalThis.document.addEventListener(r,o,!1),n.push((function(){globalThis.document.removeEventListener(r,o,!1)})))}("fullscreenerror"),function(){n.forEach((function(e){e()}))}}}}();return{installed:!1,name:"Fullscreen",module:M,Constants:{},Errors:{}}}));
|
|
@@ -1,10 +1,16 @@
|
|
|
1
1
|
import { PlatformInstance } from "../types/platform";
|
|
2
2
|
declare global {
|
|
3
|
+
var cordova: string | undefined;
|
|
4
|
+
var device: CordovaDevice | undefined;
|
|
3
5
|
interface Navigator {
|
|
4
6
|
userAgent?: string;
|
|
5
7
|
userAgentData?: UserAgentData;
|
|
6
8
|
}
|
|
7
9
|
}
|
|
10
|
+
interface CordovaDevice {
|
|
11
|
+
platform: string;
|
|
12
|
+
version: string;
|
|
13
|
+
}
|
|
8
14
|
interface ModernUserAgentDataBrand {
|
|
9
15
|
brand: string;
|
|
10
16
|
version: string;
|
|
@@ -53,5 +59,9 @@ export declare enum Browsers {
|
|
|
53
59
|
IE = "IE",
|
|
54
60
|
SamsungInternet = "SamsungInternet"
|
|
55
61
|
}
|
|
62
|
+
export declare const IS_NODE_JS: boolean;
|
|
63
|
+
export declare const IS_ELECTRON: boolean;
|
|
64
|
+
export declare const IS_REACT_NATIVE: boolean;
|
|
65
|
+
export declare let IS_CORDOVA: boolean;
|
|
56
66
|
declare const Platform: PlatformInstance;
|
|
57
67
|
export default Platform;
|
|
@@ -1 +1,16 @@
|
|
|
1
|
+
declare global {
|
|
2
|
+
var electronBridge: ElectronShell;
|
|
3
|
+
interface Document {
|
|
4
|
+
webkitVisibilityState?: 'hidden' | 'visible';
|
|
5
|
+
mozVisibilityState?: 'hidden' | 'visible';
|
|
6
|
+
msVisibilityState?: 'hidden' | 'visible';
|
|
7
|
+
webkitHidden?: boolean;
|
|
8
|
+
mozHidden?: boolean;
|
|
9
|
+
msHidden?: boolean;
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
interface ElectronShell {
|
|
13
|
+
openExternal(url: string): Promise<void>;
|
|
14
|
+
}
|
|
1
15
|
export default function tryOpenURL(url: string, index: number, timeout: number): Promise<void>;
|
|
16
|
+
export {};
|
|
@@ -62,7 +62,10 @@ var Browsers;
|
|
|
62
62
|
Browsers["IE"] = "IE";
|
|
63
63
|
Browsers["SamsungInternet"] = "SamsungInternet";
|
|
64
64
|
})(Browsers || (Browsers = {}));
|
|
65
|
-
var userAgent = typeof navigator !== 'undefined' && typeof navigator.userAgent === 'string' ? navigator.userAgent : '';
|
|
65
|
+
var userAgent = typeof globalThis.navigator !== 'undefined' && typeof globalThis.navigator.userAgent === 'string' ? globalThis.navigator.userAgent : '';
|
|
66
|
+
var IS_NODE_JS = typeof globalThis.process !== 'undefined' && typeof globalThis.process.versions !== 'undefined' && globalThis.process.versions.node !== undefined;
|
|
67
|
+
var IS_ELECTRON = (typeof globalThis.process !== 'undefined' && typeof globalThis.process.versions !== 'undefined' && globalThis.process.versions.electron !== undefined) || (/ electron\//i.test(userAgent));
|
|
68
|
+
var IS_REACT_NATIVE = typeof globalThis.navigator !== 'undefined' && globalThis.navigator.product === 'ReactNative';
|
|
66
69
|
var Platform = {
|
|
67
70
|
device: Devices.Unknown,
|
|
68
71
|
os: OS.Unknown,
|
|
@@ -77,9 +80,6 @@ var Platform = {
|
|
|
77
80
|
isDesktop: false,
|
|
78
81
|
isStandalone: false,
|
|
79
82
|
isWebview: /; ?wv|applewebkit(?!.*safari)/i.test(userAgent),
|
|
80
|
-
isNodeJS: typeof globalThis.process !== 'undefined' && typeof globalThis.process.versions !== 'undefined' && globalThis.process.versions.node !== undefined,
|
|
81
|
-
isElectron: (typeof globalThis.process !== 'undefined' && typeof globalThis.process.versions !== 'undefined' && globalThis.process.versions.electron !== undefined) || (/ electron\//i.test(userAgent)),
|
|
82
|
-
isReactNative: typeof navigator !== 'undefined' && navigator.product === 'ReactNative'
|
|
83
83
|
};
|
|
84
84
|
var OS_RESOLVER_MAP = [
|
|
85
85
|
[/windows nt (6\.[23]); arm/i, OS.Windows, resolveWindowsVersion],
|
|
@@ -389,7 +389,7 @@ for (var i = 0; i < BROWSER_RESOLVER_MAP.length; i++) {
|
|
|
389
389
|
break;
|
|
390
390
|
}
|
|
391
391
|
}
|
|
392
|
-
if (
|
|
392
|
+
if (IS_REACT_NATIVE) {
|
|
393
393
|
try {
|
|
394
394
|
var reactNative = require('react-native');
|
|
395
395
|
var platform = reactNative.Platform;
|
|
@@ -418,7 +418,7 @@ if (Platform.isReactNative) {
|
|
|
418
418
|
catch (_) {
|
|
419
419
|
}
|
|
420
420
|
}
|
|
421
|
-
if (
|
|
421
|
+
if (IS_NODE_JS) {
|
|
422
422
|
try {
|
|
423
423
|
var os = require('os');
|
|
424
424
|
var platform = os.platform();
|
|
@@ -448,6 +448,19 @@ if (Platform.isNodeJS) {
|
|
|
448
448
|
catch (_) {
|
|
449
449
|
}
|
|
450
450
|
}
|
|
451
|
+
document.addEventListener("deviceready", function () {
|
|
452
|
+
if (Platform.os === OS.Unknown && typeof globalThis.device !== 'undefined') {
|
|
453
|
+
switch (globalThis.device.platform) {
|
|
454
|
+
case 'Android':
|
|
455
|
+
Platform.os = OS.Android;
|
|
456
|
+
break;
|
|
457
|
+
case 'iOS':
|
|
458
|
+
Platform.os = OS.iOS;
|
|
459
|
+
break;
|
|
460
|
+
}
|
|
461
|
+
Platform.osVersion = globalThis.device.version;
|
|
462
|
+
}
|
|
463
|
+
}, false);
|
|
451
464
|
if (navigator.userAgentData !== undefined && navigator.userAgentData.getHighEntropyValues !== undefined) {
|
|
452
465
|
navigator
|
|
453
466
|
.userAgentData
|
|
@@ -1305,7 +1318,7 @@ function setThemeColor(color, options) {
|
|
|
1305
1318
|
});
|
|
1306
1319
|
}
|
|
1307
1320
|
function getThemeColor() {
|
|
1308
|
-
if (
|
|
1321
|
+
if (IS_REACT_NATIVE || IS_ELECTRON)
|
|
1309
1322
|
return undefined;
|
|
1310
1323
|
var meta = getCurrentAppliedThemeColorMeta();
|
|
1311
1324
|
if (meta !== null)
|
|
@@ -1320,15 +1333,15 @@ function removeThemeColor(appearance) {
|
|
|
1320
1333
|
themeColorMetaGroup[appearance] = undefined;
|
|
1321
1334
|
}
|
|
1322
1335
|
function setAppearance(appearance) {
|
|
1323
|
-
if (
|
|
1336
|
+
if (IS_REACT_NATIVE)
|
|
1324
1337
|
return setThemeColorReactNative(appearance);
|
|
1325
|
-
else if (
|
|
1338
|
+
else if (IS_ELECTRON)
|
|
1326
1339
|
return setThemeColorElectron(appearance);
|
|
1327
1340
|
}
|
|
1328
1341
|
function getAppearance() {
|
|
1329
|
-
if (
|
|
1342
|
+
if (IS_REACT_NATIVE)
|
|
1330
1343
|
return detectFromReactNative();
|
|
1331
|
-
else if (
|
|
1344
|
+
else if (IS_ELECTRON)
|
|
1332
1345
|
return detectFromElectron();
|
|
1333
1346
|
else if (Platform.browser === Browsers.SamsungInternet)
|
|
1334
1347
|
return detectFromEngine();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";function e(e,r){for(var n=e.split("."),t=r.split("."),o=Math.max(n.length,t.length),i=0;i<o;i++){var a=void 0,s=void 0;if((a=i<n.length?parseInt(n[i],10):0)>(s=i<t.length?parseInt(t[i],10):0))return 1;if(a<s)return-1}return 0}var r,n,t,o;!function(e){e.Unknown="Unknown",e.Android="Android",e.iOS="iOS",e.Windows="Windows",e.MacOS="MacOS"}(r||(r={})),function(e){e.Unknown="Unknown",e.Mobile="Mobile",e.Desktop="Desktop"}(n||(n={})),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"}(t||(t={})),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"}(o||(o={}));var i,a="undefined"!=typeof navigator&&"string"==typeof navigator.userAgent?navigator.userAgent:"",s={device:n.Unknown,os:r.Unknown,osVersion:"",engine:t.Unknown,engineVersion:"",browser:o.Unknown,browserVersion:"",renderer:function(){if(void 0===globalThis.document)return"";var e=globalThis.document.createElement("canvas");if("function"!=typeof e.getContext)return"";var r=e.getContext("webgl2")||e.getContext("experimental-webgl")||e.getContext("webgl");if(null===r)return"";if(r instanceof WebGLRenderingContext||"getParameter"in r&&"function"==typeof r.getParameter){var n=r.getExtension("WEBGL_debug_renderer_info");return null===n?r.getParameter(r.RENDERER):r.getParameter(n.UNMASKED_RENDERER_WEBGL)}return""}(),userAgent:a,isMobile:!1,isDesktop:!1,isStandalone:!1,isWebview:/; ?wv|applewebkit(?!.*safari)/i.test(a),isNodeJS:void 0!==globalThis.process&&void 0!==globalThis.process.versions&&void 0!==globalThis.process.versions.node,isElectron:void 0!==globalThis.process&&void 0!==globalThis.process.versions&&void 0!==globalThis.process.versions.electron||/ electron\//i.test(a),isReactNative:"undefined"!=typeof navigator&&"ReactNative"===navigator.product},l=[[/windows nt (6\.[23]); arm/i,r.Windows,d],[/windows (?:phone|mobile|iot)(?: os)?[\/ ]?([\d.]*( se)?)/i,r.Windows,d],[/windows[\/ ](1[01]|2000|3\.1|7|8(\.1)?|9[58]|me|server 20\d\d( r2)?|vista|xp)/i,r.Windows,d],[/windows nt ?([\d.)]*)(?!.+xbox)/i,r.Windows,d],[/\bwin(?=3| ?9|n)(?:nt| 9x )?([\d.;]*)/i,r.Windows,d],[/windows ce\/?([\d.]*)/i,r.Windows,d],[/[adehimnop]{4,7}\b(?:.*os (\w+) like mac|; opera)/i,r.iOS,m],[/(?:ios;fbsv|ios(?=.+ip(?:ad|hone))|ip(?:ad|hone)(?: |.+i(?:pad)?)os)[\/ ]([\w.]+)/i,r.iOS,m],[/cfnetwork\/.+darwin/i,r.iOS,m],[/mac os x ?([\w. ]*)/i,r.MacOS,m],[/(?:macintosh|mac_powerpc\b)(?!.+(haiku|morphos))/i,r.MacOS,m],[/droid ([\w.]+)\b.+(android[- ]x86)/i,r.Android],[/android\w*[-\/.; ]?([\d.]*)/i,r.Android]],u=[[/windows.+ edge\/([\w.]+)/i,t.EdgeHTML],[/arkweb\/([\w.]+)/i,t.ArkWeb],[/webkit\/537\.36.+chrome\/(?!27)([\w.]+)/i,t.Blink],[/presto\/([\w.]+)/i,t.Presto],[/webkit\/([\w.]+)/i,t.WebKit],[/trident\/([\w.]+)/i,t.Trident],[/netfront\/([\w.]+)/i,t.NetFront],[/khtml[\/ ]\(?([\w.]+)/i,t.KHTML],[/tasman[\/ ]\(?([\w.]+)/i,t.Tasman],[/rv:([\w.]{1,9})\b.+gecko/i,t.Gecko]],c=[[/\b(?:crmo|crios)\/([\w.]+)/i,o.Chrome],[/webview.+edge\/([\w.]+)/i,o.Edge],[/edg(?:e|ios|a)?\/([\w.]+)/i,o.Edge],[/opera mini\/([-\w.]+)/i,o.Opera],[/opera [mobileta]{3,6}\b.+version\/([-\w.]+)/i,o.Opera],[/opera(?:.+version\/|[\/ ]+)([\w.]+)/i,o.Opera],[/opios[\/ ]+([\w.]+)/i,o.Opera],[/\bop(?:rg)?x\/([\w.]+)/i,o.Opera],[/\bopr\/([\w.]+)/i,o.Opera],[/iemobile(?:browser|boat|jet)[\/ ]?([\d.]*)/i,o.IE],[/(?:ms|\()ie ([\w.]+)/i,o.IE],[/trident.+rv[: ]([\w.]{1,9})\b.+like gecko/i,o.IE],[/\bfocus\/([\w.]+)/i,o.Firefox],[/\bopt\/([\w.]+)/i,o.Opera],[/coast\/([\w.]+)/i,o.Opera],[/fxios\/([\w.-]+)/i,o.Firefox],[/samsungbrowser\/([\w.]+)/i,o.SamsungInternet],[/headlesschrome(?:\/([\w.]+)| )/i,o.Chrome],[/wv\).+chrome\/([\w.]+).+edgw\//i,o.Edge],[/ wv\).+(chrome)\/([\w.]+)/i,o.Chrome],[/chrome\/([\w.]+) mobile/i,o.Chrome],[/chrome\/v?([\w.]+)/i,o.Chrome],[/version\/([\w.,]+) .*mobile(?:\/\w+ | ?)safari/i,o.Safari],[/iphone .*mobile(?:\/\w+ | ?)safari/i,o.Safari],[/version\/([\w.,]+) .*safari/i,o.Safari],[/webkit.+?(?:mobile ?safari|safari)(\/[\w.]+)/i,o.Safari,"1"],[/(?:mobile|tablet);.*firefox\/([\w.-]+)/i,o.Firefox],[/mobile vr; rv:([\w.]+)\).+firefox/i,o.Firefox],[/firefox\/([\w.]+)/i,o.Firefox]];function d(e){if(void 0===e)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"}[e];return void 0!==r?r:e}function m(e){return void 0===e?"":e.replace(/_/g,".")}function f(e,r){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":r}function p(e,r){return"function"==typeof r?r(e):"string"==typeof r?r:void 0===e?"":e}function v(e){var r=e.split(".");return{major:parseInt(r[0]||"0"),minor:parseInt(r[1]||"0"),build:parseInt(r[2]||"0")}}for(var h=0;h<l.length;h++){var b=(j=l[h])[0],g=j[1],w=j[2];if(null!==(k=s.userAgent.match(b))){s.os=g,s.osVersion=p(k[1],w);break}}s.os===r.iOS&&0===e(s.osVersion,"18.6")&&(null!==(T=/\) Version\/([\d.]+)/.exec(s.userAgent))&&parseInt(T[1].substring(0,2),10)>=26&&(s.osVersion=T[1]));for(h=0;h<u.length;h++){b=(j=u[h])[0];var y=j[1];w=j[2];if(null!==(k=s.userAgent.match(b))){s.engine=y,s.engineVersion=p(k[1],w);break}}for(h=0;h<c.length;h++){b=(j=c[h])[0];var j,k,S=j[1];w=j[2];if(null!==(k=s.userAgent.match(b))){s.browser=S,s.browserVersion=p(k[1],w);break}}if(s.isReactNative)try{g=(x=require("react-native").Platform).OS;var T=v(E=""+x.Version);switch(g){case"android":s.os=r.Android,s.osVersion=function(e,r){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?"4.4W":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":r}(T,E);break;case"ios":s.os=r.iOS,s.osVersion=E;break;case"windows":s.os=r.Windows,s.osVersion=f(T,E);break;case"macos":s.os=r.MacOS,s.osVersion=E}}catch(e){}if(s.isNodeJS)try{var E,x=(g=require("os")).platform();T=v(E=g.release());switch(x){case"win32":s.os=r.Windows,s.osVersion=f(T,E);break;case"darwin":s.os=r.MacOS,s.osVersion=function(e,r){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:r}(T,E);break;case"android":s.os=r.Android,s.osVersion=E;break;case"linux":/android/i.test(E)&&(s.os=r.Android,s.osVersion=E)}}catch(e){}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(e){for(var n,t=e.fullVersionList||e.brands||[],o=e.platformVersion,i=0;i<t.length;i++){var a=null==(n=t[i])?{brand:"",version:""}:"string"==typeof n?{brand:n,version:""}:{brand:n.brand,version:n.version},l=a.brand,u=a.version;/not.a.brand/i.test(l)||"Chromium"===l&&(s.engineVersion=u)}"string"==typeof o&&(s.os===r.Windows&&parseInt(o.replace(/[^\d.]/g,"").split(".")[0],10)>=13?s.osVersion="11":s.osVersion=o)})),s.device=s.os===r.iOS||s.os===r.Android?n.Mobile:s.os===r.Windows||s.os===r.MacOS?n.Desktop:n.Unknown,s.isMobile=s.device===n.Mobile,s.isDesktop=s.device===n.Desktop,s.isStandalone=function(e){return"matchMedia"in globalThis&&(e===r.iOS?"standalone"in navigator&&!!navigator.standalone:globalThis.matchMedia("(display-mode: standalone)").matches)}(s.os),function(e){e.Unknown="unknown",e.Light="light",e.Dark="dark"}(i||(i={}));var M="matchMedia"in globalThis?globalThis.matchMedia("(prefers-color-scheme: dark)"):{matches:!1,media:"not all",onchange:null,addListener:function(){},removeListener:function(){},addEventListener:function(){},removeEventListener:function(){},dispatchEvent:function(){return!1}},A="not all"!==M.media,C=s.browser!==o.Chrome||s.isMobile&&e(s.browserVersion,"92")>=0,I="document"in globalThis?globalThis.document.createElement("canvas").getContext("2d",{willReadFrequently:!0}):null,N=/iemobile/i.test(s.userAgent),L=/windows phone/i.test(s.userAgent),O=[];function F(e){var r="function"==typeof Symbol&&Symbol.iterator,n=r&&e[r],t=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&t>=e.length&&(e=void 0),{value:e&&e[t++],done:!e}}};throw new TypeError(r?"Object is not iterable.":"Symbol.iterator is not defined.")}function V(e,r){function n(t){if(!(this instanceof n))return new n(t);var o=new r(t||"");if("function"==typeof Object.setPrototypeOf?Object.setPrototypeOf(o,n.prototype):o.__proto__=n.prototype,o.name=e,void 0!==t&&(o.message=t),"undefined"!=typeof Symbol&&Symbol.toStringTag)try{Object.defineProperty(o,Symbol.toStringTag,{value:e,writable:!1,enumerable:!1,configurable:!0})}catch(e){}if("function"==typeof Error.captureStackTrace)Error.captureStackTrace(o,n);else if(r.captureStackTrace&&"function"==typeof r.captureStackTrace)r.captureStackTrace(o,n);else try{var i=new r;i.stack&&(o.stack=i.stack)}catch(e){}return o}void 0===r&&(r=Error),n.prototype=Object.create(r.prototype,{constructor:{value:n,writable:!0,enumerable:!1,configurable:!0}});try{Object.defineProperty(n.prototype,"name",{value:e,writable:!0,enumerable:!1,configurable:!0})}catch(r){try{n.prototype.name=e}catch(e){}}try{Object.defineProperty(n,"name",{value:e,writable:!1,enumerable:!1,configurable:!0})}catch(e){}return n}"function"==typeof SuppressedError&&SuppressedError;var P=V("EasingError"),U=V("CubicBezierSyntaxError",P),W=V("LinearSyntaxError",P),D=V("StepSyntaxError",P),R=V("UnsupportedEasingFunctionError",P),z={linear:"linear(0, 1)",ease:"cubic-bezier(0.25, 0.1, 0.25, 1)","ease-in":"cubic-bezier(0.42, 0, 1, 1)","ease-out":"cubic-bezier(0, 0, 0.58, 1)","ease-in-out":"cubic-bezier(0.42, 0, 0.58, 1)","step-start":"steps(1, jump-start)","step-end":"steps(1, jump-end)"};function q(e,r,n){return e<r?r:e>n?n:e}function H(e){var r=function(e){var r=e.match(/cubic-bezier\((.*)\)/);if(null===r)throw new U("Invalid cubic-bezier syntax");var n=r[1].trim().split(","),t=[];if(4!==n.length)throw new U("Cubic-bezier must have exactly 4 numeric values");for(var o=0;o<4;o++){var i=parseFloat(n[o]);if(isNaN(i))throw new U("Cubic-bezier must have exactly 4 numeric values");if(o%2==0&&(i<0||i>1))throw new U("x1 and x2 must be between 0 and 1");t.push(i)}return{x1:t[0],y1:t[1],x2:t[2],y2:t[3]}}(e),n=r.x1,t=r.x2,o=r.y1,i=r.y2;return function(e){if(0===(e=q(e,0,1))||1===e)return e;var r=function(e,r,o){if(void 0===r&&(r=1e-6),void 0===o&&(o=50),e<=0)return 0;if(e>=1)return 1;for(var i=e,a=0;a<o;a++){var s=3*(1-i)*(1-i)*i*n+3*(1-i)*i*i*t+i*i*i,l=3*(1-i)*(1-i)*n+6*(1-i)*i*(t-n)+3*i*i*(1-t);if(Math.abs(l)<r)break;var u=i-(s-e)/l;if(Math.abs(u-i)<r){i=u;break}i=Math.max(0,Math.min(1,u))}return i}(e);return 3*(1-r)*(1-r)*r*o+3*(1-r)*r*r*i+r*r*r}}function B(e){var r=function(e){var r,n,t=e.match(/linear\((.*)\)/);if(null===t)throw new W("Invalid linear syntax");var o=t[1].trim();if(""===o)throw new W("Linear function must have at least one point");for(var i=o.split(","),a=[],s=0;s<i.length;s++){var l=i[s].trim(),u=l.match(/^([+-]?\d*\.?\d+)((?:\s+[+-]?\d*\.?\d+%){2,})$/);if(null===u){var c=l.match(/^([+-]?\d*\.?\d+)\s+([+-]?\d*\.?\d+)%$/);if(null===c){var d=l.match(/^([+-]?\d*\.?\d+)$/);if(null===d)throw new W('Invalid linear point format: "'+l+'"');a.push({position:1===i.length?0:s/(i.length-1),value:parseFloat(d[1])})}else a.push({position:parseFloat(c[2])/100,value:parseFloat(c[1])})}else{var m=parseFloat(u[1]),f=u[2].trim().split(/\s+/);try{for(var p=(r=void 0,F(f)),v=p.next();!v.done;v=p.next()){var h=v.value;a.push({value:m,position:parseFloat(h)/100})}}catch(e){r={error:e}}finally{try{v&&!v.done&&(n=p.return)&&n.call(p)}finally{if(r)throw r.error}}}}if(0===a.length)throw new W("No valid points found in linear function");return a.sort((function(e,r){return e.position-r.position})),a[0].position>0&&a.unshift({position:0,value:0}),a[a.length-1].position<1&&a.push({position:1,value:1}),a}(e);return function(e){if((e=q(e,0,1))<=r[0].position)return r[0].value;if(e>=r[r.length-1].position)return r[r.length-1].value;for(var n=0;n<r.length-1;n++){var t=r[n],o=r[n+1];if(e>=t.position&&e<=o.position){if(t.position===o.position)return o.value;var i=(e-t.position)/(o.position-t.position);return t.value+(o.value-t.value)*i}}return r[r.length-1].value}}function _(e){if(function(e){return!/(linear|cubic-bezier|steps)\((.*)\)/.test(e)}(e)&&(e=z[e]),function(e){return/cubic-bezier\(/.test(e)}(e))return H(e);if(function(e){return/linear\(/.test(e)}(e))return B(e);if(function(e){return/steps\(\s*(\d+)\s*(?:,\s*(jump-start|jump-end|jump-none|jump-both|start|end)\s*)?\)$/.test(e)}(e))return function(e){var r=e.match(/steps\(\s*(\d+)\s*(?:,\s*(jump-start|jump-end|jump-none|jump-both|start|end)\s*)?\)$/);if(null===r)throw new D("Invalid steps syntax");var n=parseInt(r[1],10),t=r[2];if(n<=0)throw new D("Steps count must be a positive integer");if("jump-none"===t&&n<2)throw new D("jump-none requires at least 2 steps");return function(e){switch(e=q(e,0,1),t){case"start":case"jump-start":return 0===e?1/n:1===e?1:Math.ceil(e*n)/n;case void 0:case"end":case"jump-end":return 1===e?1:Math.floor(e*n)/n;case"jump-both":return 0===e?0:1===e?1:Math.round(e*(n+1))/(n+1);case"jump-none":return 0===e?0:1===e?1:Math.floor(e*(n-1))/(n-1);default:throw new D('Unsupported step position: "'+t+'"')}}}(e);throw new R('Unsupported easing function: "'+e+'"')}var G=V("UnsupportedColorError");function K(e){if("undefined"!=typeof CSS&&CSS.supports&&!CSS.supports("color",e))throw new G('Unsupported color: "'+e+'".');if(null!==I)try{I.clearRect(0,0,1,1),I.fillStyle=e,I.fillRect(0,0,1,1);var r=I.getImageData(0,0,1,1).data;return{red:r[0],green:r[1],blue:r[2],alpha:parseFloat((r[3]/255).toFixed(2))}}catch(e){}var n=function(e,r){if(void 0===r&&(r=!0),void 0!==globalThis.document){var n=globalThis.document.createElement(e);return"width"in n&&(n.width="0"),"height"in n&&(n.height="0"),"border"in n&&(n.border="0"),"frameBorder"in n&&(n.frameBorder="0"),"scrolling"in n&&(n.scrolling="no"),"cellPadding"in n&&(n.cellPadding="0"),"cellSpacing"in n&&(n.cellSpacing="0"),"frame"in n&&(n.frame="void"),"rules"in n&&(n.rules="none"),"noWrap"in n&&(n.noWrap=!0),n.tabIndex=-1,n.setAttribute("role","presentation"),r?(n.style.width="1px",n.style.height="1px"):(n.setAttribute("aria-hidden","true"),n.style.width="0",n.style.height="0",n.style.zIndex="-9999",n.style.display="none",n.style.visibility="hidden",n.style.pointerEvents="none"),n.style.position="absolute",n.style.top="0",n.style.left="0",n.style.padding="0",n.style.margin="0",n.style.border="none",n.style.outline="none",n.style.clip="rect(1px, 1px, 1px, 1px)",n.style.clipPath="inset(50%)",n.style.overflow="hidden",n.style.whiteSpace="nowrap",n}}("div");if(void 0===n)throw new G('Failed to parse color values from: "'+e+'".');n.style.color=e,globalThis.document.body.appendChild(n);try{var t=globalThis.getComputedStyle(n).color,o=t.match(/rgba?\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*([\d.]+))?\s*\)/),i=t.match(/rgba?\(\s*(\d+)\s+(\d+)\s+(\d+)\s*(?:\/\s*([\d.]+%?))?\s*\)/),a=o||i;if(null===a)throw new G('Unsupported color: "'+e+'".');var s=parseInt(a[1],10),l=parseInt(a[2],10),u=parseInt(a[3],10),c=1;if(void 0!==a[4]){var d=a[4];c="%"===d.charAt(d.length-1)?parseFloat((parseFloat(d)/100).toFixed(2)):parseFloat(parseFloat(d).toFixed(2))}if(isNaN(s)||isNaN(l)||isNaN(u)||isNaN(c))throw new G('Failed to parse color values from: "'+e+'".');return{red:s,green:l,blue:u,alpha:c}}finally{globalThis.document.body.removeChild(n)}}var Z={},$=null,X=null,J=null,Q=null,Y={setAppearance:function(e){if(s.isReactNative)return function(e){try{require("react-native").Appearance.setColorScheme(e)}catch(e){}}(e);if(s.isElectron)return function(e){try{require("electron").nativeTheme.themeSource=e||"system"}catch(e){}}(e)},getAppearance:function(){return s.isReactNative?new Promise((function(e){try{e(require("react-native").Appearance.getColorScheme()||i.Unknown)}catch(r){e(i.Unknown)}})):s.isElectron?new Promise((function(e){try{e(require("electron").nativeTheme.shouldUseDarkColors?i.Dark:i.Light)}catch(r){e(i.Unknown)}})):s.browser===o.SamsungInternet?ne():Promise.resolve(te())},removeThemeColor:function(e){void 0===e&&(e="default");var r=Z[e];void 0!==r&&r.remove();Z[e]=void 0},setThemeColor:function(e,r){void 0===r&&(r={duration:0,easingFunction:"linear",appearance:"default"});var n=r.duration,t=_(r.easingFunction),o=r.appearance;null!==$&&(globalThis.cancelAnimationFrame($),$=null,null!==X&&(X(ue()),X=null));var a=ue();void 0===a&&(a=void 0!==r.defaultColor?r.defaultColor:te()===i.Dark?"#181818ff":"#dcdcdcff");var s=K(a),l=K(e);return new Promise((function(e){X=e;var r=null;$=globalThis.requestAnimationFrame((function i(a){null===r&&(r=a);var u,c=a-r;u=0===n?1:Math.min(c/n,1);var d=t(u),m={red:Math.round(s.red+(l.red-s.red)*d),green:Math.round(s.green+(l.green-s.green)*d),blue:Math.round(s.blue+(l.blue-s.blue)*d),alpha:+(s.alpha+(l.alpha-s.alpha)*d).toFixed(2)};(function(e){void 0===e&&(e="default");var r;r=!C||!A||N||L?"default":e;var n=Z[r];if(void 0!==n)return n;n=globalThis.document.createElement("meta"),N?n.setAttribute("name","msapplication-navbutton-color"):L?n.setAttribute("name","msapplication-TileColor"):n.setAttribute("name","theme-color");"default"!==e&&n.setAttribute("media","(prefers-color-scheme: "+r+")");return globalThis.document.head.prepend(n),Z[e]=n})(o).setAttribute("content",re(m)),u<1?$=globalThis.requestAnimationFrame(i):($=null,null!==X&&(e(ue()),$=null))}))}))},getThemeColor:ue,onAppearanceChange:function(e,r){void 0===r&&(r=!1);var n={fn:e,capture:!1,once:!1};"boolean"==typeof r&&(r={capture:r});void 0!==r.capture&&(n.capture=r.capture);void 0!==r.once&&(n.once=r.once);void 0!==r.signal&&(n.signal=r.signal);var t=se(n);-1===t?(O.push(n),1===O.length&&(s.browser===o.SamsungInternet?(ne().then((function(e){J=e})),Q=globalThis.setInterval((function(){ne().then((function(e){e!==J&&(J=e,ie(e))}))}),2e3)):(i=n.capture,J=te(),"function"==typeof M.addEventListener?M.addEventListener("change",oe,i):"function"==typeof M.addListener&&M.addListener(oe))),this.getAppearance().then(ie)):O[t].once&&!n.once&&(O[t].once=!1);var i;void 0!==n.signal&&(n.signal.aborted?ae(n):n.signal.addEventListener("abort",(function e(){void 0!==n.signal&&n.signal.removeEventListener("abort",e),ae(n)})));return function(){ae(n)}}};function ee(e){var r=e.toString(16);switch(r.length){case 0:return"00";case 1:return"0"+r;default:return r}}function re(e){return"#"+ee(e.red)+ee(e.green)+ee(e.blue)+ee(Math.round(255*e.alpha))}function ne(){return new Promise((function(e){var r=new Image;r.onload=function(){if(null===I)return e(i.Light);I.drawImage(r,0,0);var n=I.getImageData(0,0,1,1).data;(n[0]&n[1]&n[2])<255?e(i.Dark):e(i.Light)},r.onerror=function(){e(i.Unknown)},r.src="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjxyZWN0IHdpZHRoPSIxIiBoZWlnaHQ9IjEiIGZpbGw9IndoaXRlIi8+PC9zdmc+"}))}function te(){return A?M.matches?i.Dark:i.Light:i.Unknown}function oe(e){var r;(r=e.matches?i.Dark:i.Light)!==J&&ie(J=r)}function ie(e){for(var r=0;r<O.length;r++){var n=O[r];n.fn(e),n.once&&ae(n)}}function ae(e){var r,n=se(e);-1!==n&&O.splice(n,1),0===O.length&&(s.browser===o.SamsungInternet?(J=null,null!==Q&&(clearInterval(Q),Q=null)):(r=e.capture,J=null,"function"==typeof M.removeEventListener?M.removeEventListener("change",oe,r):"function"==typeof M.removeListener&&M.removeListener(oe)))}function se(e){for(var r=0;r<O.length;r++)if(O[r].fn===e.fn&&O[r].capture===e.capture)return r;return-1}function le(){var e;Z={},e=N?'meta[name="msapplication-navbutton-color"]':L?'meta[name="msapplication-TileColor"]':'meta[name="theme-color"]';var r=globalThis.document.querySelectorAll(e);if(C&&A&&!N&&!L)for(var n=0;n<r.length;n++){var t=r.item(n),o=t.getAttribute("media");if("(prefers-color-scheme: dark)"===o&&void 0===Z.dark?Z.dark=t:"(prefers-color-scheme: light)"===o&&void 0===Z.light?Z.light=t:null===o&&void 0===Z.default&&(Z.default=t),void 0!==Z.dark&&void 0!==Z.light&&void 0!==Z.default)return}else Z.default=r[0]}function ue(){if(!s.isReactNative&&!s.isElectron){var e=function(){if(N)return globalThis.document.querySelector('meta[name="msapplication-navbutton-color"]');if(L)return globalThis.document.querySelector('meta[name="msapplication-TileColor"]');if(!C||!A)return globalThis.document.querySelector('meta[name="theme-color"]');var e,r=globalThis.document.querySelectorAll('meta[name="theme-color"]');e=te()===i.Dark?"(prefers-color-scheme: dark)":"(prefers-color-scheme: light)";for(var n=0;n<r.length;n++){var t=r.item(n);if(t.hasAttribute("content")){var o=t.getAttribute("media");if(null===o||o===e)return t}}return null}();return null!==e?e.getAttribute("content"):s.browser===o.Safari?s.isStandalone?te()===i.Dark?"#ffffffff":"#000000ff":re(K(globalThis.getComputedStyle(globalThis.document.body).backgroundColor)):s.browser===o.Chrome?te()===i.Dark?"#28292cff":"#ffffffff":void 0}}!function(){if(void 0!==globalThis.MutationObserver){var e=new MutationObserver((function(e){for(var r=0;r<e.length;r++){for(var n=e[r],t=n.addedNodes,o=n.removedNodes,i=0;i<t.length;i++)if(t[i]instanceof HTMLMetaElement)return le();for(i=0;i<o.length;i++)if(o[i]instanceof HTMLMetaElement)return le()}}));"function"==typeof M.addEventListener?M.addEventListener("change",le):"function"==typeof M.addListener&&M.addListener(le),e.observe(globalThis.document.head,{childList:!0}),le()}}();var ce={installed:!1,name:"Theme",module:Y,Constants:{Appearances:i},Errors:{EasingError:P,UnsupportedEasingFunctionError:R,StepSyntaxError:D,LinearSyntaxError:W,CubicBezierSyntaxError:U,UnsupportedColorError:G}};module.exports=ce;
|
|
1
|
+
"use strict";function e(e,r){for(var n=e.split("."),o=r.split("."),t=Math.max(n.length,o.length),i=0;i<t;i++){var a=void 0,s=void 0;if((a=i<n.length?parseInt(n[i],10):0)>(s=i<o.length?parseInt(o[i],10):0))return 1;if(a<s)return-1}return 0}var r,n,o,t;!function(e){e.Unknown="Unknown",e.Android="Android",e.iOS="iOS",e.Windows="Windows",e.MacOS="MacOS"}(r||(r={})),function(e){e.Unknown="Unknown",e.Mobile="Mobile",e.Desktop="Desktop"}(n||(n={})),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"}(o||(o={})),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"}(t||(t={}));var i,a=void 0!==globalThis.navigator&&"string"==typeof globalThis.navigator.userAgent?globalThis.navigator.userAgent:"",s=void 0!==globalThis.process&&void 0!==globalThis.process.versions&&void 0!==globalThis.process.versions.node,l=void 0!==globalThis.process&&void 0!==globalThis.process.versions&&void 0!==globalThis.process.versions.electron||/ electron\//i.test(a),u=void 0!==globalThis.navigator&&"ReactNative"===globalThis.navigator.product,c={device:n.Unknown,os:r.Unknown,osVersion:"",engine:o.Unknown,engineVersion:"",browser:t.Unknown,browserVersion:"",renderer:function(){if(void 0===globalThis.document)return"";var e=globalThis.document.createElement("canvas");if("function"!=typeof e.getContext)return"";var r=e.getContext("webgl2")||e.getContext("experimental-webgl")||e.getContext("webgl");if(null===r)return"";if(r instanceof WebGLRenderingContext||"getParameter"in r&&"function"==typeof r.getParameter){var n=r.getExtension("WEBGL_debug_renderer_info");return null===n?r.getParameter(r.RENDERER):r.getParameter(n.UNMASKED_RENDERER_WEBGL)}return""}(),userAgent:a,isMobile:!1,isDesktop:!1,isStandalone:!1,isWebview:/; ?wv|applewebkit(?!.*safari)/i.test(a)},d=[[/windows nt (6\.[23]); arm/i,r.Windows,p],[/windows (?:phone|mobile|iot)(?: os)?[\/ ]?([\d.]*( se)?)/i,r.Windows,p],[/windows[\/ ](1[01]|2000|3\.1|7|8(\.1)?|9[58]|me|server 20\d\d( r2)?|vista|xp)/i,r.Windows,p],[/windows nt ?([\d.)]*)(?!.+xbox)/i,r.Windows,p],[/\bwin(?=3| ?9|n)(?:nt| 9x )?([\d.;]*)/i,r.Windows,p],[/windows ce\/?([\d.]*)/i,r.Windows,p],[/[adehimnop]{4,7}\b(?:.*os (\w+) like mac|; opera)/i,r.iOS,v],[/(?:ios;fbsv|ios(?=.+ip(?:ad|hone))|ip(?:ad|hone)(?: |.+i(?:pad)?)os)[\/ ]([\w.]+)/i,r.iOS,v],[/cfnetwork\/.+darwin/i,r.iOS,v],[/mac os x ?([\w. ]*)/i,r.MacOS,v],[/(?:macintosh|mac_powerpc\b)(?!.+(haiku|morphos))/i,r.MacOS,v],[/droid ([\w.]+)\b.+(android[- ]x86)/i,r.Android],[/android\w*[-\/.; ]?([\d.]*)/i,r.Android]],m=[[/windows.+ edge\/([\w.]+)/i,o.EdgeHTML],[/arkweb\/([\w.]+)/i,o.ArkWeb],[/webkit\/537\.36.+chrome\/(?!27)([\w.]+)/i,o.Blink],[/presto\/([\w.]+)/i,o.Presto],[/webkit\/([\w.]+)/i,o.WebKit],[/trident\/([\w.]+)/i,o.Trident],[/netfront\/([\w.]+)/i,o.NetFront],[/khtml[\/ ]\(?([\w.]+)/i,o.KHTML],[/tasman[\/ ]\(?([\w.]+)/i,o.Tasman],[/rv:([\w.]{1,9})\b.+gecko/i,o.Gecko]],f=[[/\b(?:crmo|crios)\/([\w.]+)/i,t.Chrome],[/webview.+edge\/([\w.]+)/i,t.Edge],[/edg(?:e|ios|a)?\/([\w.]+)/i,t.Edge],[/opera mini\/([-\w.]+)/i,t.Opera],[/opera [mobileta]{3,6}\b.+version\/([-\w.]+)/i,t.Opera],[/opera(?:.+version\/|[\/ ]+)([\w.]+)/i,t.Opera],[/opios[\/ ]+([\w.]+)/i,t.Opera],[/\bop(?:rg)?x\/([\w.]+)/i,t.Opera],[/\bopr\/([\w.]+)/i,t.Opera],[/iemobile(?:browser|boat|jet)[\/ ]?([\d.]*)/i,t.IE],[/(?:ms|\()ie ([\w.]+)/i,t.IE],[/trident.+rv[: ]([\w.]{1,9})\b.+like gecko/i,t.IE],[/\bfocus\/([\w.]+)/i,t.Firefox],[/\bopt\/([\w.]+)/i,t.Opera],[/coast\/([\w.]+)/i,t.Opera],[/fxios\/([\w.-]+)/i,t.Firefox],[/samsungbrowser\/([\w.]+)/i,t.SamsungInternet],[/headlesschrome(?:\/([\w.]+)| )/i,t.Chrome],[/wv\).+chrome\/([\w.]+).+edgw\//i,t.Edge],[/ wv\).+(chrome)\/([\w.]+)/i,t.Chrome],[/chrome\/([\w.]+) mobile/i,t.Chrome],[/chrome\/v?([\w.]+)/i,t.Chrome],[/version\/([\w.,]+) .*mobile(?:\/\w+ | ?)safari/i,t.Safari],[/iphone .*mobile(?:\/\w+ | ?)safari/i,t.Safari],[/version\/([\w.,]+) .*safari/i,t.Safari],[/webkit.+?(?:mobile ?safari|safari)(\/[\w.]+)/i,t.Safari,"1"],[/(?:mobile|tablet);.*firefox\/([\w.-]+)/i,t.Firefox],[/mobile vr; rv:([\w.]+)\).+firefox/i,t.Firefox],[/firefox\/([\w.]+)/i,t.Firefox]];function p(e){if(void 0===e)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"}[e];return void 0!==r?r:e}function v(e){return void 0===e?"":e.replace(/_/g,".")}function h(e,r){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":r}function b(e,r){return"function"==typeof r?r(e):"string"==typeof r?r:void 0===e?"":e}function g(e){var r=e.split(".");return{major:parseInt(r[0]||"0"),minor:parseInt(r[1]||"0"),build:parseInt(r[2]||"0")}}for(var w=0;w<d.length;w++){var y=(S=d[w])[0],j=S[1],T=S[2];if(null!==(E=c.userAgent.match(y))){c.os=j,c.osVersion=b(E[1],T);break}}c.os===r.iOS&&0===e(c.osVersion,"18.6")&&(null!==(A=/\) Version\/([\d.]+)/.exec(c.userAgent))&&parseInt(A[1].substring(0,2),10)>=26&&(c.osVersion=A[1]));for(w=0;w<m.length;w++){y=(S=m[w])[0];var k=S[1];T=S[2];if(null!==(E=c.userAgent.match(y))){c.engine=k,c.engineVersion=b(E[1],T);break}}for(w=0;w<f.length;w++){y=(S=f[w])[0];var S,E,x=S[1];T=S[2];if(null!==(E=c.userAgent.match(y))){c.browser=x,c.browserVersion=b(E[1],T);break}}if(u)try{j=(C=require("react-native").Platform).OS;var A=g(M=""+C.Version);switch(j){case"android":c.os=r.Android,c.osVersion=function(e,r){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?"4.4W":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":r}(A,M);break;case"ios":c.os=r.iOS,c.osVersion=M;break;case"windows":c.os=r.Windows,c.osVersion=h(A,M);break;case"macos":c.os=r.MacOS,c.osVersion=M}}catch(e){}if(s)try{var M,C=(j=require("os")).platform();A=g(M=j.release());switch(C){case"win32":c.os=r.Windows,c.osVersion=h(A,M);break;case"darwin":c.os=r.MacOS,c.osVersion=function(e,r){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:r}(A,M);break;case"android":c.os=r.Android,c.osVersion=M;break;case"linux":/android/i.test(M)&&(c.os=r.Android,c.osVersion=M)}}catch(e){}document.addEventListener("deviceready",(function(){if(c.os===r.Unknown&&void 0!==globalThis.device){switch(globalThis.device.platform){case"Android":c.os=r.Android;break;case"iOS":c.os=r.iOS}c.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(e){for(var n,o=e.fullVersionList||e.brands||[],t=e.platformVersion,i=0;i<o.length;i++){var a=null==(n=o[i])?{brand:"",version:""}:"string"==typeof n?{brand:n,version:""}:{brand:n.brand,version:n.version},s=a.brand,l=a.version;/not.a.brand/i.test(s)||"Chromium"===s&&(c.engineVersion=l)}"string"==typeof t&&(c.os===r.Windows&&parseInt(t.replace(/[^\d.]/g,"").split(".")[0],10)>=13?c.osVersion="11":c.osVersion=t)})),c.device=c.os===r.iOS||c.os===r.Android?n.Mobile:c.os===r.Windows||c.os===r.MacOS?n.Desktop:n.Unknown,c.isMobile=c.device===n.Mobile,c.isDesktop=c.device===n.Desktop,c.isStandalone=function(e){return"matchMedia"in globalThis&&(e===r.iOS?"standalone"in navigator&&!!navigator.standalone:globalThis.matchMedia("(display-mode: standalone)").matches)}(c.os),function(e){e.Unknown="unknown",e.Light="light",e.Dark="dark"}(i||(i={}));var I="matchMedia"in globalThis?globalThis.matchMedia("(prefers-color-scheme: dark)"):{matches:!1,media:"not all",onchange:null,addListener:function(){},removeListener:function(){},addEventListener:function(){},removeEventListener:function(){},dispatchEvent:function(){return!1}},L="not all"!==I.media,O=c.browser!==t.Chrome||c.isMobile&&e(c.browserVersion,"92")>=0,F="document"in globalThis?globalThis.document.createElement("canvas").getContext("2d",{willReadFrequently:!0}):null,N=/iemobile/i.test(c.userAgent),V=/windows phone/i.test(c.userAgent),U=[];function P(e){var r="function"==typeof Symbol&&Symbol.iterator,n=r&&e[r],o=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&o>=e.length&&(e=void 0),{value:e&&e[o++],done:!e}}};throw new TypeError(r?"Object is not iterable.":"Symbol.iterator is not defined.")}function W(e,r){function n(o){if(!(this instanceof n))return new n(o);var t=new r(o||"");if("function"==typeof Object.setPrototypeOf?Object.setPrototypeOf(t,n.prototype):t.__proto__=n.prototype,t.name=e,void 0!==o&&(t.message=o),"undefined"!=typeof Symbol&&Symbol.toStringTag)try{Object.defineProperty(t,Symbol.toStringTag,{value:e,writable:!1,enumerable:!1,configurable:!0})}catch(e){}if("function"==typeof Error.captureStackTrace)Error.captureStackTrace(t,n);else if(r.captureStackTrace&&"function"==typeof r.captureStackTrace)r.captureStackTrace(t,n);else try{var i=new r;i.stack&&(t.stack=i.stack)}catch(e){}return t}void 0===r&&(r=Error),n.prototype=Object.create(r.prototype,{constructor:{value:n,writable:!0,enumerable:!1,configurable:!0}});try{Object.defineProperty(n.prototype,"name",{value:e,writable:!0,enumerable:!1,configurable:!0})}catch(r){try{n.prototype.name=e}catch(e){}}try{Object.defineProperty(n,"name",{value:e,writable:!1,enumerable:!1,configurable:!0})}catch(e){}return n}"function"==typeof SuppressedError&&SuppressedError;var D=W("EasingError"),R=W("CubicBezierSyntaxError",D),z=W("LinearSyntaxError",D),q=W("StepSyntaxError",D),H=W("UnsupportedEasingFunctionError",D),B={linear:"linear(0, 1)",ease:"cubic-bezier(0.25, 0.1, 0.25, 1)","ease-in":"cubic-bezier(0.42, 0, 1, 1)","ease-out":"cubic-bezier(0, 0, 0.58, 1)","ease-in-out":"cubic-bezier(0.42, 0, 0.58, 1)","step-start":"steps(1, jump-start)","step-end":"steps(1, jump-end)"};function _(e,r,n){return e<r?r:e>n?n:e}function G(e){var r=function(e){var r=e.match(/cubic-bezier\((.*)\)/);if(null===r)throw new R("Invalid cubic-bezier syntax");var n=r[1].trim().split(","),o=[];if(4!==n.length)throw new R("Cubic-bezier must have exactly 4 numeric values");for(var t=0;t<4;t++){var i=parseFloat(n[t]);if(isNaN(i))throw new R("Cubic-bezier must have exactly 4 numeric values");if(t%2==0&&(i<0||i>1))throw new R("x1 and x2 must be between 0 and 1");o.push(i)}return{x1:o[0],y1:o[1],x2:o[2],y2:o[3]}}(e),n=r.x1,o=r.x2,t=r.y1,i=r.y2;return function(e){if(0===(e=_(e,0,1))||1===e)return e;var r=function(e,r,t){if(void 0===r&&(r=1e-6),void 0===t&&(t=50),e<=0)return 0;if(e>=1)return 1;for(var i=e,a=0;a<t;a++){var s=3*(1-i)*(1-i)*i*n+3*(1-i)*i*i*o+i*i*i,l=3*(1-i)*(1-i)*n+6*(1-i)*i*(o-n)+3*i*i*(1-o);if(Math.abs(l)<r)break;var u=i-(s-e)/l;if(Math.abs(u-i)<r){i=u;break}i=Math.max(0,Math.min(1,u))}return i}(e);return 3*(1-r)*(1-r)*r*t+3*(1-r)*r*r*i+r*r*r}}function K(e){var r=function(e){var r,n,o=e.match(/linear\((.*)\)/);if(null===o)throw new z("Invalid linear syntax");var t=o[1].trim();if(""===t)throw new z("Linear function must have at least one point");for(var i=t.split(","),a=[],s=0;s<i.length;s++){var l=i[s].trim(),u=l.match(/^([+-]?\d*\.?\d+)((?:\s+[+-]?\d*\.?\d+%){2,})$/);if(null===u){var c=l.match(/^([+-]?\d*\.?\d+)\s+([+-]?\d*\.?\d+)%$/);if(null===c){var d=l.match(/^([+-]?\d*\.?\d+)$/);if(null===d)throw new z('Invalid linear point format: "'+l+'"');a.push({position:1===i.length?0:s/(i.length-1),value:parseFloat(d[1])})}else a.push({position:parseFloat(c[2])/100,value:parseFloat(c[1])})}else{var m=parseFloat(u[1]),f=u[2].trim().split(/\s+/);try{for(var p=(r=void 0,P(f)),v=p.next();!v.done;v=p.next()){var h=v.value;a.push({value:m,position:parseFloat(h)/100})}}catch(e){r={error:e}}finally{try{v&&!v.done&&(n=p.return)&&n.call(p)}finally{if(r)throw r.error}}}}if(0===a.length)throw new z("No valid points found in linear function");return a.sort((function(e,r){return e.position-r.position})),a[0].position>0&&a.unshift({position:0,value:0}),a[a.length-1].position<1&&a.push({position:1,value:1}),a}(e);return function(e){if((e=_(e,0,1))<=r[0].position)return r[0].value;if(e>=r[r.length-1].position)return r[r.length-1].value;for(var n=0;n<r.length-1;n++){var o=r[n],t=r[n+1];if(e>=o.position&&e<=t.position){if(o.position===t.position)return t.value;var i=(e-o.position)/(t.position-o.position);return o.value+(t.value-o.value)*i}}return r[r.length-1].value}}function Z(e){if(function(e){return!/(linear|cubic-bezier|steps)\((.*)\)/.test(e)}(e)&&(e=B[e]),function(e){return/cubic-bezier\(/.test(e)}(e))return G(e);if(function(e){return/linear\(/.test(e)}(e))return K(e);if(function(e){return/steps\(\s*(\d+)\s*(?:,\s*(jump-start|jump-end|jump-none|jump-both|start|end)\s*)?\)$/.test(e)}(e))return function(e){var r=e.match(/steps\(\s*(\d+)\s*(?:,\s*(jump-start|jump-end|jump-none|jump-both|start|end)\s*)?\)$/);if(null===r)throw new q("Invalid steps syntax");var n=parseInt(r[1],10),o=r[2];if(n<=0)throw new q("Steps count must be a positive integer");if("jump-none"===o&&n<2)throw new q("jump-none requires at least 2 steps");return function(e){switch(e=_(e,0,1),o){case"start":case"jump-start":return 0===e?1/n:1===e?1:Math.ceil(e*n)/n;case void 0:case"end":case"jump-end":return 1===e?1:Math.floor(e*n)/n;case"jump-both":return 0===e?0:1===e?1:Math.round(e*(n+1))/(n+1);case"jump-none":return 0===e?0:1===e?1:Math.floor(e*(n-1))/(n-1);default:throw new q('Unsupported step position: "'+o+'"')}}}(e);throw new H('Unsupported easing function: "'+e+'"')}var $=W("UnsupportedColorError");function X(e){if("undefined"!=typeof CSS&&CSS.supports&&!CSS.supports("color",e))throw new $('Unsupported color: "'+e+'".');if(null!==F)try{F.clearRect(0,0,1,1),F.fillStyle=e,F.fillRect(0,0,1,1);var r=F.getImageData(0,0,1,1).data;return{red:r[0],green:r[1],blue:r[2],alpha:parseFloat((r[3]/255).toFixed(2))}}catch(e){}var n=function(e,r){if(void 0===r&&(r=!0),void 0!==globalThis.document){var n=globalThis.document.createElement(e);return"width"in n&&(n.width="0"),"height"in n&&(n.height="0"),"border"in n&&(n.border="0"),"frameBorder"in n&&(n.frameBorder="0"),"scrolling"in n&&(n.scrolling="no"),"cellPadding"in n&&(n.cellPadding="0"),"cellSpacing"in n&&(n.cellSpacing="0"),"frame"in n&&(n.frame="void"),"rules"in n&&(n.rules="none"),"noWrap"in n&&(n.noWrap=!0),n.tabIndex=-1,n.setAttribute("role","presentation"),r?(n.style.width="1px",n.style.height="1px"):(n.setAttribute("aria-hidden","true"),n.style.width="0",n.style.height="0",n.style.zIndex="-9999",n.style.display="none",n.style.visibility="hidden",n.style.pointerEvents="none"),n.style.position="absolute",n.style.top="0",n.style.left="0",n.style.padding="0",n.style.margin="0",n.style.border="none",n.style.outline="none",n.style.clip="rect(1px, 1px, 1px, 1px)",n.style.clipPath="inset(50%)",n.style.overflow="hidden",n.style.whiteSpace="nowrap",n}}("div");if(void 0===n)throw new $('Failed to parse color values from: "'+e+'".');n.style.color=e,globalThis.document.body.appendChild(n);try{var o=globalThis.getComputedStyle(n).color,t=o.match(/rgba?\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*([\d.]+))?\s*\)/),i=o.match(/rgba?\(\s*(\d+)\s+(\d+)\s+(\d+)\s*(?:\/\s*([\d.]+%?))?\s*\)/),a=t||i;if(null===a)throw new $('Unsupported color: "'+e+'".');var s=parseInt(a[1],10),l=parseInt(a[2],10),u=parseInt(a[3],10),c=1;if(void 0!==a[4]){var d=a[4];c="%"===d.charAt(d.length-1)?parseFloat((parseFloat(d)/100).toFixed(2)):parseFloat(parseFloat(d).toFixed(2))}if(isNaN(s)||isNaN(l)||isNaN(u)||isNaN(c))throw new $('Failed to parse color values from: "'+e+'".');return{red:s,green:l,blue:u,alpha:c}}finally{globalThis.document.body.removeChild(n)}}var Q={},J=null,Y=null,ee=null,re=null,ne={setAppearance:function(e){if(u)return function(e){try{require("react-native").Appearance.setColorScheme(e)}catch(e){}}(e);if(l)return function(e){try{require("electron").nativeTheme.themeSource=e||"system"}catch(e){}}(e)},getAppearance:function(){return u?new Promise((function(e){try{e(require("react-native").Appearance.getColorScheme()||i.Unknown)}catch(r){e(i.Unknown)}})):l?new Promise((function(e){try{e(require("electron").nativeTheme.shouldUseDarkColors?i.Dark:i.Light)}catch(r){e(i.Unknown)}})):c.browser===t.SamsungInternet?ie():Promise.resolve(ae())},removeThemeColor:function(e){void 0===e&&(e="default");var r=Q[e];void 0!==r&&r.remove();Q[e]=void 0},setThemeColor:function(e,r){void 0===r&&(r={duration:0,easingFunction:"linear",appearance:"default"});var n=r.duration,o=Z(r.easingFunction),t=r.appearance;null!==J&&(globalThis.cancelAnimationFrame(J),J=null,null!==Y&&(Y(me()),Y=null));var a=me();void 0===a&&(a=void 0!==r.defaultColor?r.defaultColor:ae()===i.Dark?"#181818ff":"#dcdcdcff");var s=X(a),l=X(e);return new Promise((function(e){Y=e;var r=null;J=globalThis.requestAnimationFrame((function i(a){null===r&&(r=a);var u,c=a-r;u=0===n?1:Math.min(c/n,1);var d=o(u),m={red:Math.round(s.red+(l.red-s.red)*d),green:Math.round(s.green+(l.green-s.green)*d),blue:Math.round(s.blue+(l.blue-s.blue)*d),alpha:+(s.alpha+(l.alpha-s.alpha)*d).toFixed(2)};(function(e){void 0===e&&(e="default");var r;r=!O||!L||N||V?"default":e;var n=Q[r];if(void 0!==n)return n;n=globalThis.document.createElement("meta"),N?n.setAttribute("name","msapplication-navbutton-color"):V?n.setAttribute("name","msapplication-TileColor"):n.setAttribute("name","theme-color");"default"!==e&&n.setAttribute("media","(prefers-color-scheme: "+r+")");return globalThis.document.head.prepend(n),Q[e]=n})(t).setAttribute("content",te(m)),u<1?J=globalThis.requestAnimationFrame(i):(J=null,null!==Y&&(e(me()),J=null))}))}))},getThemeColor:me,onAppearanceChange:function(e,r){void 0===r&&(r=!1);var n={fn:e,capture:!1,once:!1};"boolean"==typeof r&&(r={capture:r});void 0!==r.capture&&(n.capture=r.capture);void 0!==r.once&&(n.once=r.once);void 0!==r.signal&&(n.signal=r.signal);var o=ce(n);-1===o?(U.push(n),1===U.length&&(c.browser===t.SamsungInternet?(ie().then((function(e){ee=e})),re=globalThis.setInterval((function(){ie().then((function(e){e!==ee&&(ee=e,le(e))}))}),2e3)):(i=n.capture,ee=ae(),"function"==typeof I.addEventListener?I.addEventListener("change",se,i):"function"==typeof I.addListener&&I.addListener(se))),this.getAppearance().then(le)):U[o].once&&!n.once&&(U[o].once=!1);var i;void 0!==n.signal&&(n.signal.aborted?ue(n):n.signal.addEventListener("abort",(function e(){void 0!==n.signal&&n.signal.removeEventListener("abort",e),ue(n)})));return function(){ue(n)}}};function oe(e){var r=e.toString(16);switch(r.length){case 0:return"00";case 1:return"0"+r;default:return r}}function te(e){return"#"+oe(e.red)+oe(e.green)+oe(e.blue)+oe(Math.round(255*e.alpha))}function ie(){return new Promise((function(e){var r=new Image;r.onload=function(){if(null===F)return e(i.Light);F.drawImage(r,0,0);var n=F.getImageData(0,0,1,1).data;(n[0]&n[1]&n[2])<255?e(i.Dark):e(i.Light)},r.onerror=function(){e(i.Unknown)},r.src="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjxyZWN0IHdpZHRoPSIxIiBoZWlnaHQ9IjEiIGZpbGw9IndoaXRlIi8+PC9zdmc+"}))}function ae(){return L?I.matches?i.Dark:i.Light:i.Unknown}function se(e){var r;(r=e.matches?i.Dark:i.Light)!==ee&&le(ee=r)}function le(e){for(var r=0;r<U.length;r++){var n=U[r];n.fn(e),n.once&&ue(n)}}function ue(e){var r,n=ce(e);-1!==n&&U.splice(n,1),0===U.length&&(c.browser===t.SamsungInternet?(ee=null,null!==re&&(clearInterval(re),re=null)):(r=e.capture,ee=null,"function"==typeof I.removeEventListener?I.removeEventListener("change",se,r):"function"==typeof I.removeListener&&I.removeListener(se)))}function ce(e){for(var r=0;r<U.length;r++)if(U[r].fn===e.fn&&U[r].capture===e.capture)return r;return-1}function de(){var e;Q={},e=N?'meta[name="msapplication-navbutton-color"]':V?'meta[name="msapplication-TileColor"]':'meta[name="theme-color"]';var r=globalThis.document.querySelectorAll(e);if(O&&L&&!N&&!V)for(var n=0;n<r.length;n++){var o=r.item(n),t=o.getAttribute("media");if("(prefers-color-scheme: dark)"===t&&void 0===Q.dark?Q.dark=o:"(prefers-color-scheme: light)"===t&&void 0===Q.light?Q.light=o:null===t&&void 0===Q.default&&(Q.default=o),void 0!==Q.dark&&void 0!==Q.light&&void 0!==Q.default)return}else Q.default=r[0]}function me(){if(!u&&!l){var e=function(){if(N)return globalThis.document.querySelector('meta[name="msapplication-navbutton-color"]');if(V)return globalThis.document.querySelector('meta[name="msapplication-TileColor"]');if(!O||!L)return globalThis.document.querySelector('meta[name="theme-color"]');var e,r=globalThis.document.querySelectorAll('meta[name="theme-color"]');e=ae()===i.Dark?"(prefers-color-scheme: dark)":"(prefers-color-scheme: light)";for(var n=0;n<r.length;n++){var o=r.item(n);if(o.hasAttribute("content")){var t=o.getAttribute("media");if(null===t||t===e)return o}}return null}();return null!==e?e.getAttribute("content"):c.browser===t.Safari?c.isStandalone?ae()===i.Dark?"#ffffffff":"#000000ff":te(X(globalThis.getComputedStyle(globalThis.document.body).backgroundColor)):c.browser===t.Chrome?ae()===i.Dark?"#28292cff":"#ffffffff":void 0}}!function(){if(void 0!==globalThis.MutationObserver){var e=new MutationObserver((function(e){for(var r=0;r<e.length;r++){for(var n=e[r],o=n.addedNodes,t=n.removedNodes,i=0;i<o.length;i++)if(o[i]instanceof HTMLMetaElement)return de();for(i=0;i<t.length;i++)if(t[i]instanceof HTMLMetaElement)return de()}}));"function"==typeof I.addEventListener?I.addEventListener("change",de):"function"==typeof I.addListener&&I.addListener(de),e.observe(globalThis.document.head,{childList:!0}),de()}}();var fe={installed:!1,name:"Theme",module:ne,Constants:{Appearances:i},Errors:{EasingError:D,UnsupportedEasingFunctionError:H,StepSyntaxError:q,LinearSyntaxError:z,CubicBezierSyntaxError:R,UnsupportedColorError:$}};module.exports=fe;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function e(e,r){for(var n=e.split("."),t=r.split("."),o=Math.max(n.length,t.length),i=0;i<o;i++){var a=void 0,s=void 0;if((a=i<n.length?parseInt(n[i],10):0)>(s=i<t.length?parseInt(t[i],10):0))return 1;if(a<s)return-1}return 0}var r,n,t,o;!function(e){e.Unknown="Unknown",e.Android="Android",e.iOS="iOS",e.Windows="Windows",e.MacOS="MacOS"}(r||(r={})),function(e){e.Unknown="Unknown",e.Mobile="Mobile",e.Desktop="Desktop"}(n||(n={})),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"}(t||(t={})),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"}(o||(o={}));var i,a="undefined"!=typeof navigator&&"string"==typeof navigator.userAgent?navigator.userAgent:"",s={device:n.Unknown,os:r.Unknown,osVersion:"",engine:t.Unknown,engineVersion:"",browser:o.Unknown,browserVersion:"",renderer:function(){if(void 0===globalThis.document)return"";var e=globalThis.document.createElement("canvas");if("function"!=typeof e.getContext)return"";var r=e.getContext("webgl2")||e.getContext("experimental-webgl")||e.getContext("webgl");if(null===r)return"";if(r instanceof WebGLRenderingContext||"getParameter"in r&&"function"==typeof r.getParameter){var n=r.getExtension("WEBGL_debug_renderer_info");return null===n?r.getParameter(r.RENDERER):r.getParameter(n.UNMASKED_RENDERER_WEBGL)}return""}(),userAgent:a,isMobile:!1,isDesktop:!1,isStandalone:!1,isWebview:/; ?wv|applewebkit(?!.*safari)/i.test(a),isNodeJS:void 0!==globalThis.process&&void 0!==globalThis.process.versions&&void 0!==globalThis.process.versions.node,isElectron:void 0!==globalThis.process&&void 0!==globalThis.process.versions&&void 0!==globalThis.process.versions.electron||/ electron\//i.test(a),isReactNative:"undefined"!=typeof navigator&&"ReactNative"===navigator.product},l=[[/windows nt (6\.[23]); arm/i,r.Windows,d],[/windows (?:phone|mobile|iot)(?: os)?[\/ ]?([\d.]*( se)?)/i,r.Windows,d],[/windows[\/ ](1[01]|2000|3\.1|7|8(\.1)?|9[58]|me|server 20\d\d( r2)?|vista|xp)/i,r.Windows,d],[/windows nt ?([\d.)]*)(?!.+xbox)/i,r.Windows,d],[/\bwin(?=3| ?9|n)(?:nt| 9x )?([\d.;]*)/i,r.Windows,d],[/windows ce\/?([\d.]*)/i,r.Windows,d],[/[adehimnop]{4,7}\b(?:.*os (\w+) like mac|; opera)/i,r.iOS,m],[/(?:ios;fbsv|ios(?=.+ip(?:ad|hone))|ip(?:ad|hone)(?: |.+i(?:pad)?)os)[\/ ]([\w.]+)/i,r.iOS,m],[/cfnetwork\/.+darwin/i,r.iOS,m],[/mac os x ?([\w. ]*)/i,r.MacOS,m],[/(?:macintosh|mac_powerpc\b)(?!.+(haiku|morphos))/i,r.MacOS,m],[/droid ([\w.]+)\b.+(android[- ]x86)/i,r.Android],[/android\w*[-\/.; ]?([\d.]*)/i,r.Android]],u=[[/windows.+ edge\/([\w.]+)/i,t.EdgeHTML],[/arkweb\/([\w.]+)/i,t.ArkWeb],[/webkit\/537\.36.+chrome\/(?!27)([\w.]+)/i,t.Blink],[/presto\/([\w.]+)/i,t.Presto],[/webkit\/([\w.]+)/i,t.WebKit],[/trident\/([\w.]+)/i,t.Trident],[/netfront\/([\w.]+)/i,t.NetFront],[/khtml[\/ ]\(?([\w.]+)/i,t.KHTML],[/tasman[\/ ]\(?([\w.]+)/i,t.Tasman],[/rv:([\w.]{1,9})\b.+gecko/i,t.Gecko]],c=[[/\b(?:crmo|crios)\/([\w.]+)/i,o.Chrome],[/webview.+edge\/([\w.]+)/i,o.Edge],[/edg(?:e|ios|a)?\/([\w.]+)/i,o.Edge],[/opera mini\/([-\w.]+)/i,o.Opera],[/opera [mobileta]{3,6}\b.+version\/([-\w.]+)/i,o.Opera],[/opera(?:.+version\/|[\/ ]+)([\w.]+)/i,o.Opera],[/opios[\/ ]+([\w.]+)/i,o.Opera],[/\bop(?:rg)?x\/([\w.]+)/i,o.Opera],[/\bopr\/([\w.]+)/i,o.Opera],[/iemobile(?:browser|boat|jet)[\/ ]?([\d.]*)/i,o.IE],[/(?:ms|\()ie ([\w.]+)/i,o.IE],[/trident.+rv[: ]([\w.]{1,9})\b.+like gecko/i,o.IE],[/\bfocus\/([\w.]+)/i,o.Firefox],[/\bopt\/([\w.]+)/i,o.Opera],[/coast\/([\w.]+)/i,o.Opera],[/fxios\/([\w.-]+)/i,o.Firefox],[/samsungbrowser\/([\w.]+)/i,o.SamsungInternet],[/headlesschrome(?:\/([\w.]+)| )/i,o.Chrome],[/wv\).+chrome\/([\w.]+).+edgw\//i,o.Edge],[/ wv\).+(chrome)\/([\w.]+)/i,o.Chrome],[/chrome\/([\w.]+) mobile/i,o.Chrome],[/chrome\/v?([\w.]+)/i,o.Chrome],[/version\/([\w.,]+) .*mobile(?:\/\w+ | ?)safari/i,o.Safari],[/iphone .*mobile(?:\/\w+ | ?)safari/i,o.Safari],[/version\/([\w.,]+) .*safari/i,o.Safari],[/webkit.+?(?:mobile ?safari|safari)(\/[\w.]+)/i,o.Safari,"1"],[/(?:mobile|tablet);.*firefox\/([\w.-]+)/i,o.Firefox],[/mobile vr; rv:([\w.]+)\).+firefox/i,o.Firefox],[/firefox\/([\w.]+)/i,o.Firefox]];function d(e){if(void 0===e)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"}[e];return void 0!==r?r:e}function m(e){return void 0===e?"":e.replace(/_/g,".")}function f(e,r){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":r}function p(e,r){return"function"==typeof r?r(e):"string"==typeof r?r:void 0===e?"":e}function v(e){var r=e.split(".");return{major:parseInt(r[0]||"0"),minor:parseInt(r[1]||"0"),build:parseInt(r[2]||"0")}}for(var h=0;h<l.length;h++){var b=(j=l[h])[0],g=j[1],w=j[2];if(null!==(k=s.userAgent.match(b))){s.os=g,s.osVersion=p(k[1],w);break}}s.os===r.iOS&&0===e(s.osVersion,"18.6")&&(null!==(T=/\) Version\/([\d.]+)/.exec(s.userAgent))&&parseInt(T[1].substring(0,2),10)>=26&&(s.osVersion=T[1]));for(h=0;h<u.length;h++){b=(j=u[h])[0];var y=j[1];w=j[2];if(null!==(k=s.userAgent.match(b))){s.engine=y,s.engineVersion=p(k[1],w);break}}for(h=0;h<c.length;h++){b=(j=c[h])[0];var j,k,S=j[1];w=j[2];if(null!==(k=s.userAgent.match(b))){s.browser=S,s.browserVersion=p(k[1],w);break}}if(s.isReactNative)try{g=(x=require("react-native").Platform).OS;var T=v(E=""+x.Version);switch(g){case"android":s.os=r.Android,s.osVersion=function(e,r){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?"4.4W":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":r}(T,E);break;case"ios":s.os=r.iOS,s.osVersion=E;break;case"windows":s.os=r.Windows,s.osVersion=f(T,E);break;case"macos":s.os=r.MacOS,s.osVersion=E}}catch(e){}if(s.isNodeJS)try{var E,x=(g=require("os")).platform();T=v(E=g.release());switch(x){case"win32":s.os=r.Windows,s.osVersion=f(T,E);break;case"darwin":s.os=r.MacOS,s.osVersion=function(e,r){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:r}(T,E);break;case"android":s.os=r.Android,s.osVersion=E;break;case"linux":/android/i.test(E)&&(s.os=r.Android,s.osVersion=E)}}catch(e){}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(e){for(var n,t=e.fullVersionList||e.brands||[],o=e.platformVersion,i=0;i<t.length;i++){var a=null==(n=t[i])?{brand:"",version:""}:"string"==typeof n?{brand:n,version:""}:{brand:n.brand,version:n.version},l=a.brand,u=a.version;/not.a.brand/i.test(l)||"Chromium"===l&&(s.engineVersion=u)}"string"==typeof o&&(s.os===r.Windows&&parseInt(o.replace(/[^\d.]/g,"").split(".")[0],10)>=13?s.osVersion="11":s.osVersion=o)})),s.device=s.os===r.iOS||s.os===r.Android?n.Mobile:s.os===r.Windows||s.os===r.MacOS?n.Desktop:n.Unknown,s.isMobile=s.device===n.Mobile,s.isDesktop=s.device===n.Desktop,s.isStandalone=function(e){return"matchMedia"in globalThis&&(e===r.iOS?"standalone"in navigator&&!!navigator.standalone:globalThis.matchMedia("(display-mode: standalone)").matches)}(s.os),function(e){e.Unknown="unknown",e.Light="light",e.Dark="dark"}(i||(i={}));var M="matchMedia"in globalThis?globalThis.matchMedia("(prefers-color-scheme: dark)"):{matches:!1,media:"not all",onchange:null,addListener:function(){},removeListener:function(){},addEventListener:function(){},removeEventListener:function(){},dispatchEvent:function(){return!1}},A="not all"!==M.media,C=s.browser!==o.Chrome||s.isMobile&&e(s.browserVersion,"92")>=0,I="document"in globalThis?globalThis.document.createElement("canvas").getContext("2d",{willReadFrequently:!0}):null,N=/iemobile/i.test(s.userAgent),L=/windows phone/i.test(s.userAgent),O=[];function F(e){var r="function"==typeof Symbol&&Symbol.iterator,n=r&&e[r],t=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&t>=e.length&&(e=void 0),{value:e&&e[t++],done:!e}}};throw new TypeError(r?"Object is not iterable.":"Symbol.iterator is not defined.")}function V(e,r){function n(t){if(!(this instanceof n))return new n(t);var o=new r(t||"");if("function"==typeof Object.setPrototypeOf?Object.setPrototypeOf(o,n.prototype):o.__proto__=n.prototype,o.name=e,void 0!==t&&(o.message=t),"undefined"!=typeof Symbol&&Symbol.toStringTag)try{Object.defineProperty(o,Symbol.toStringTag,{value:e,writable:!1,enumerable:!1,configurable:!0})}catch(e){}if("function"==typeof Error.captureStackTrace)Error.captureStackTrace(o,n);else if(r.captureStackTrace&&"function"==typeof r.captureStackTrace)r.captureStackTrace(o,n);else try{var i=new r;i.stack&&(o.stack=i.stack)}catch(e){}return o}void 0===r&&(r=Error),n.prototype=Object.create(r.prototype,{constructor:{value:n,writable:!0,enumerable:!1,configurable:!0}});try{Object.defineProperty(n.prototype,"name",{value:e,writable:!0,enumerable:!1,configurable:!0})}catch(r){try{n.prototype.name=e}catch(e){}}try{Object.defineProperty(n,"name",{value:e,writable:!1,enumerable:!1,configurable:!0})}catch(e){}return n}"function"==typeof SuppressedError&&SuppressedError;var P=V("EasingError"),U=V("CubicBezierSyntaxError",P),W=V("LinearSyntaxError",P),D=V("StepSyntaxError",P),R=V("UnsupportedEasingFunctionError",P),z={linear:"linear(0, 1)",ease:"cubic-bezier(0.25, 0.1, 0.25, 1)","ease-in":"cubic-bezier(0.42, 0, 1, 1)","ease-out":"cubic-bezier(0, 0, 0.58, 1)","ease-in-out":"cubic-bezier(0.42, 0, 0.58, 1)","step-start":"steps(1, jump-start)","step-end":"steps(1, jump-end)"};function q(e,r,n){return e<r?r:e>n?n:e}function H(e){var r=function(e){var r=e.match(/cubic-bezier\((.*)\)/);if(null===r)throw new U("Invalid cubic-bezier syntax");var n=r[1].trim().split(","),t=[];if(4!==n.length)throw new U("Cubic-bezier must have exactly 4 numeric values");for(var o=0;o<4;o++){var i=parseFloat(n[o]);if(isNaN(i))throw new U("Cubic-bezier must have exactly 4 numeric values");if(o%2==0&&(i<0||i>1))throw new U("x1 and x2 must be between 0 and 1");t.push(i)}return{x1:t[0],y1:t[1],x2:t[2],y2:t[3]}}(e),n=r.x1,t=r.x2,o=r.y1,i=r.y2;return function(e){if(0===(e=q(e,0,1))||1===e)return e;var r=function(e,r,o){if(void 0===r&&(r=1e-6),void 0===o&&(o=50),e<=0)return 0;if(e>=1)return 1;for(var i=e,a=0;a<o;a++){var s=3*(1-i)*(1-i)*i*n+3*(1-i)*i*i*t+i*i*i,l=3*(1-i)*(1-i)*n+6*(1-i)*i*(t-n)+3*i*i*(1-t);if(Math.abs(l)<r)break;var u=i-(s-e)/l;if(Math.abs(u-i)<r){i=u;break}i=Math.max(0,Math.min(1,u))}return i}(e);return 3*(1-r)*(1-r)*r*o+3*(1-r)*r*r*i+r*r*r}}function B(e){var r=function(e){var r,n,t=e.match(/linear\((.*)\)/);if(null===t)throw new W("Invalid linear syntax");var o=t[1].trim();if(""===o)throw new W("Linear function must have at least one point");for(var i=o.split(","),a=[],s=0;s<i.length;s++){var l=i[s].trim(),u=l.match(/^([+-]?\d*\.?\d+)((?:\s+[+-]?\d*\.?\d+%){2,})$/);if(null===u){var c=l.match(/^([+-]?\d*\.?\d+)\s+([+-]?\d*\.?\d+)%$/);if(null===c){var d=l.match(/^([+-]?\d*\.?\d+)$/);if(null===d)throw new W('Invalid linear point format: "'+l+'"');a.push({position:1===i.length?0:s/(i.length-1),value:parseFloat(d[1])})}else a.push({position:parseFloat(c[2])/100,value:parseFloat(c[1])})}else{var m=parseFloat(u[1]),f=u[2].trim().split(/\s+/);try{for(var p=(r=void 0,F(f)),v=p.next();!v.done;v=p.next()){var h=v.value;a.push({value:m,position:parseFloat(h)/100})}}catch(e){r={error:e}}finally{try{v&&!v.done&&(n=p.return)&&n.call(p)}finally{if(r)throw r.error}}}}if(0===a.length)throw new W("No valid points found in linear function");return a.sort((function(e,r){return e.position-r.position})),a[0].position>0&&a.unshift({position:0,value:0}),a[a.length-1].position<1&&a.push({position:1,value:1}),a}(e);return function(e){if((e=q(e,0,1))<=r[0].position)return r[0].value;if(e>=r[r.length-1].position)return r[r.length-1].value;for(var n=0;n<r.length-1;n++){var t=r[n],o=r[n+1];if(e>=t.position&&e<=o.position){if(t.position===o.position)return o.value;var i=(e-t.position)/(o.position-t.position);return t.value+(o.value-t.value)*i}}return r[r.length-1].value}}function _(e){if(function(e){return!/(linear|cubic-bezier|steps)\((.*)\)/.test(e)}(e)&&(e=z[e]),function(e){return/cubic-bezier\(/.test(e)}(e))return H(e);if(function(e){return/linear\(/.test(e)}(e))return B(e);if(function(e){return/steps\(\s*(\d+)\s*(?:,\s*(jump-start|jump-end|jump-none|jump-both|start|end)\s*)?\)$/.test(e)}(e))return function(e){var r=e.match(/steps\(\s*(\d+)\s*(?:,\s*(jump-start|jump-end|jump-none|jump-both|start|end)\s*)?\)$/);if(null===r)throw new D("Invalid steps syntax");var n=parseInt(r[1],10),t=r[2];if(n<=0)throw new D("Steps count must be a positive integer");if("jump-none"===t&&n<2)throw new D("jump-none requires at least 2 steps");return function(e){switch(e=q(e,0,1),t){case"start":case"jump-start":return 0===e?1/n:1===e?1:Math.ceil(e*n)/n;case void 0:case"end":case"jump-end":return 1===e?1:Math.floor(e*n)/n;case"jump-both":return 0===e?0:1===e?1:Math.round(e*(n+1))/(n+1);case"jump-none":return 0===e?0:1===e?1:Math.floor(e*(n-1))/(n-1);default:throw new D('Unsupported step position: "'+t+'"')}}}(e);throw new R('Unsupported easing function: "'+e+'"')}var G=V("UnsupportedColorError");function K(e){if("undefined"!=typeof CSS&&CSS.supports&&!CSS.supports("color",e))throw new G('Unsupported color: "'+e+'".');if(null!==I)try{I.clearRect(0,0,1,1),I.fillStyle=e,I.fillRect(0,0,1,1);var r=I.getImageData(0,0,1,1).data;return{red:r[0],green:r[1],blue:r[2],alpha:parseFloat((r[3]/255).toFixed(2))}}catch(e){}var n=function(e,r){if(void 0===r&&(r=!0),void 0!==globalThis.document){var n=globalThis.document.createElement(e);return"width"in n&&(n.width="0"),"height"in n&&(n.height="0"),"border"in n&&(n.border="0"),"frameBorder"in n&&(n.frameBorder="0"),"scrolling"in n&&(n.scrolling="no"),"cellPadding"in n&&(n.cellPadding="0"),"cellSpacing"in n&&(n.cellSpacing="0"),"frame"in n&&(n.frame="void"),"rules"in n&&(n.rules="none"),"noWrap"in n&&(n.noWrap=!0),n.tabIndex=-1,n.setAttribute("role","presentation"),r?(n.style.width="1px",n.style.height="1px"):(n.setAttribute("aria-hidden","true"),n.style.width="0",n.style.height="0",n.style.zIndex="-9999",n.style.display="none",n.style.visibility="hidden",n.style.pointerEvents="none"),n.style.position="absolute",n.style.top="0",n.style.left="0",n.style.padding="0",n.style.margin="0",n.style.border="none",n.style.outline="none",n.style.clip="rect(1px, 1px, 1px, 1px)",n.style.clipPath="inset(50%)",n.style.overflow="hidden",n.style.whiteSpace="nowrap",n}}("div");if(void 0===n)throw new G('Failed to parse color values from: "'+e+'".');n.style.color=e,globalThis.document.body.appendChild(n);try{var t=globalThis.getComputedStyle(n).color,o=t.match(/rgba?\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*([\d.]+))?\s*\)/),i=t.match(/rgba?\(\s*(\d+)\s+(\d+)\s+(\d+)\s*(?:\/\s*([\d.]+%?))?\s*\)/),a=o||i;if(null===a)throw new G('Unsupported color: "'+e+'".');var s=parseInt(a[1],10),l=parseInt(a[2],10),u=parseInt(a[3],10),c=1;if(void 0!==a[4]){var d=a[4];c="%"===d.charAt(d.length-1)?parseFloat((parseFloat(d)/100).toFixed(2)):parseFloat(parseFloat(d).toFixed(2))}if(isNaN(s)||isNaN(l)||isNaN(u)||isNaN(c))throw new G('Failed to parse color values from: "'+e+'".');return{red:s,green:l,blue:u,alpha:c}}finally{globalThis.document.body.removeChild(n)}}var Z={},$=null,X=null,J=null,Q=null,Y={setAppearance:function(e){if(s.isReactNative)return function(e){try{require("react-native").Appearance.setColorScheme(e)}catch(e){}}(e);if(s.isElectron)return function(e){try{require("electron").nativeTheme.themeSource=e||"system"}catch(e){}}(e)},getAppearance:function(){return s.isReactNative?new Promise((function(e){try{e(require("react-native").Appearance.getColorScheme()||i.Unknown)}catch(r){e(i.Unknown)}})):s.isElectron?new Promise((function(e){try{e(require("electron").nativeTheme.shouldUseDarkColors?i.Dark:i.Light)}catch(r){e(i.Unknown)}})):s.browser===o.SamsungInternet?ne():Promise.resolve(te())},removeThemeColor:function(e){void 0===e&&(e="default");var r=Z[e];void 0!==r&&r.remove();Z[e]=void 0},setThemeColor:function(e,r){void 0===r&&(r={duration:0,easingFunction:"linear",appearance:"default"});var n=r.duration,t=_(r.easingFunction),o=r.appearance;null!==$&&(globalThis.cancelAnimationFrame($),$=null,null!==X&&(X(ue()),X=null));var a=ue();void 0===a&&(a=void 0!==r.defaultColor?r.defaultColor:te()===i.Dark?"#181818ff":"#dcdcdcff");var s=K(a),l=K(e);return new Promise((function(e){X=e;var r=null;$=globalThis.requestAnimationFrame((function i(a){null===r&&(r=a);var u,c=a-r;u=0===n?1:Math.min(c/n,1);var d=t(u),m={red:Math.round(s.red+(l.red-s.red)*d),green:Math.round(s.green+(l.green-s.green)*d),blue:Math.round(s.blue+(l.blue-s.blue)*d),alpha:+(s.alpha+(l.alpha-s.alpha)*d).toFixed(2)};(function(e){void 0===e&&(e="default");var r;r=!C||!A||N||L?"default":e;var n=Z[r];if(void 0!==n)return n;n=globalThis.document.createElement("meta"),N?n.setAttribute("name","msapplication-navbutton-color"):L?n.setAttribute("name","msapplication-TileColor"):n.setAttribute("name","theme-color");"default"!==e&&n.setAttribute("media","(prefers-color-scheme: "+r+")");return globalThis.document.head.prepend(n),Z[e]=n})(o).setAttribute("content",re(m)),u<1?$=globalThis.requestAnimationFrame(i):($=null,null!==X&&(e(ue()),$=null))}))}))},getThemeColor:ue,onAppearanceChange:function(e,r){void 0===r&&(r=!1);var n={fn:e,capture:!1,once:!1};"boolean"==typeof r&&(r={capture:r});void 0!==r.capture&&(n.capture=r.capture);void 0!==r.once&&(n.once=r.once);void 0!==r.signal&&(n.signal=r.signal);var t=se(n);-1===t?(O.push(n),1===O.length&&(s.browser===o.SamsungInternet?(ne().then((function(e){J=e})),Q=globalThis.setInterval((function(){ne().then((function(e){e!==J&&(J=e,ie(e))}))}),2e3)):(i=n.capture,J=te(),"function"==typeof M.addEventListener?M.addEventListener("change",oe,i):"function"==typeof M.addListener&&M.addListener(oe))),this.getAppearance().then(ie)):O[t].once&&!n.once&&(O[t].once=!1);var i;void 0!==n.signal&&(n.signal.aborted?ae(n):n.signal.addEventListener("abort",(function e(){void 0!==n.signal&&n.signal.removeEventListener("abort",e),ae(n)})));return function(){ae(n)}}};function ee(e){var r=e.toString(16);switch(r.length){case 0:return"00";case 1:return"0"+r;default:return r}}function re(e){return"#"+ee(e.red)+ee(e.green)+ee(e.blue)+ee(Math.round(255*e.alpha))}function ne(){return new Promise((function(e){var r=new Image;r.onload=function(){if(null===I)return e(i.Light);I.drawImage(r,0,0);var n=I.getImageData(0,0,1,1).data;(n[0]&n[1]&n[2])<255?e(i.Dark):e(i.Light)},r.onerror=function(){e(i.Unknown)},r.src="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjxyZWN0IHdpZHRoPSIxIiBoZWlnaHQ9IjEiIGZpbGw9IndoaXRlIi8+PC9zdmc+"}))}function te(){return A?M.matches?i.Dark:i.Light:i.Unknown}function oe(e){var r;(r=e.matches?i.Dark:i.Light)!==J&&ie(J=r)}function ie(e){for(var r=0;r<O.length;r++){var n=O[r];n.fn(e),n.once&&ae(n)}}function ae(e){var r,n=se(e);-1!==n&&O.splice(n,1),0===O.length&&(s.browser===o.SamsungInternet?(J=null,null!==Q&&(clearInterval(Q),Q=null)):(r=e.capture,J=null,"function"==typeof M.removeEventListener?M.removeEventListener("change",oe,r):"function"==typeof M.removeListener&&M.removeListener(oe)))}function se(e){for(var r=0;r<O.length;r++)if(O[r].fn===e.fn&&O[r].capture===e.capture)return r;return-1}function le(){var e;Z={},e=N?'meta[name="msapplication-navbutton-color"]':L?'meta[name="msapplication-TileColor"]':'meta[name="theme-color"]';var r=globalThis.document.querySelectorAll(e);if(C&&A&&!N&&!L)for(var n=0;n<r.length;n++){var t=r.item(n),o=t.getAttribute("media");if("(prefers-color-scheme: dark)"===o&&void 0===Z.dark?Z.dark=t:"(prefers-color-scheme: light)"===o&&void 0===Z.light?Z.light=t:null===o&&void 0===Z.default&&(Z.default=t),void 0!==Z.dark&&void 0!==Z.light&&void 0!==Z.default)return}else Z.default=r[0]}function ue(){if(!s.isReactNative&&!s.isElectron){var e=function(){if(N)return globalThis.document.querySelector('meta[name="msapplication-navbutton-color"]');if(L)return globalThis.document.querySelector('meta[name="msapplication-TileColor"]');if(!C||!A)return globalThis.document.querySelector('meta[name="theme-color"]');var e,r=globalThis.document.querySelectorAll('meta[name="theme-color"]');e=te()===i.Dark?"(prefers-color-scheme: dark)":"(prefers-color-scheme: light)";for(var n=0;n<r.length;n++){var t=r.item(n);if(t.hasAttribute("content")){var o=t.getAttribute("media");if(null===o||o===e)return t}}return null}();return null!==e?e.getAttribute("content"):s.browser===o.Safari?s.isStandalone?te()===i.Dark?"#ffffffff":"#000000ff":re(K(globalThis.getComputedStyle(globalThis.document.body).backgroundColor)):s.browser===o.Chrome?te()===i.Dark?"#28292cff":"#ffffffff":void 0}}!function(){if(void 0!==globalThis.MutationObserver){var e=new MutationObserver((function(e){for(var r=0;r<e.length;r++){for(var n=e[r],t=n.addedNodes,o=n.removedNodes,i=0;i<t.length;i++)if(t[i]instanceof HTMLMetaElement)return le();for(i=0;i<o.length;i++)if(o[i]instanceof HTMLMetaElement)return le()}}));"function"==typeof M.addEventListener?M.addEventListener("change",le):"function"==typeof M.addListener&&M.addListener(le),e.observe(globalThis.document.head,{childList:!0}),le()}}();var ce={installed:!1,name:"Theme",module:Y,Constants:{Appearances:i},Errors:{EasingError:P,UnsupportedEasingFunctionError:R,StepSyntaxError:D,LinearSyntaxError:W,CubicBezierSyntaxError:U,UnsupportedColorError:G}};export{ce as default};
|
|
1
|
+
function e(e,r){for(var n=e.split("."),o=r.split("."),t=Math.max(n.length,o.length),i=0;i<t;i++){var a=void 0,s=void 0;if((a=i<n.length?parseInt(n[i],10):0)>(s=i<o.length?parseInt(o[i],10):0))return 1;if(a<s)return-1}return 0}var r,n,o,t;!function(e){e.Unknown="Unknown",e.Android="Android",e.iOS="iOS",e.Windows="Windows",e.MacOS="MacOS"}(r||(r={})),function(e){e.Unknown="Unknown",e.Mobile="Mobile",e.Desktop="Desktop"}(n||(n={})),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"}(o||(o={})),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"}(t||(t={}));var i,a=void 0!==globalThis.navigator&&"string"==typeof globalThis.navigator.userAgent?globalThis.navigator.userAgent:"",s=void 0!==globalThis.process&&void 0!==globalThis.process.versions&&void 0!==globalThis.process.versions.node,l=void 0!==globalThis.process&&void 0!==globalThis.process.versions&&void 0!==globalThis.process.versions.electron||/ electron\//i.test(a),u=void 0!==globalThis.navigator&&"ReactNative"===globalThis.navigator.product,c={device:n.Unknown,os:r.Unknown,osVersion:"",engine:o.Unknown,engineVersion:"",browser:t.Unknown,browserVersion:"",renderer:function(){if(void 0===globalThis.document)return"";var e=globalThis.document.createElement("canvas");if("function"!=typeof e.getContext)return"";var r=e.getContext("webgl2")||e.getContext("experimental-webgl")||e.getContext("webgl");if(null===r)return"";if(r instanceof WebGLRenderingContext||"getParameter"in r&&"function"==typeof r.getParameter){var n=r.getExtension("WEBGL_debug_renderer_info");return null===n?r.getParameter(r.RENDERER):r.getParameter(n.UNMASKED_RENDERER_WEBGL)}return""}(),userAgent:a,isMobile:!1,isDesktop:!1,isStandalone:!1,isWebview:/; ?wv|applewebkit(?!.*safari)/i.test(a)},d=[[/windows nt (6\.[23]); arm/i,r.Windows,p],[/windows (?:phone|mobile|iot)(?: os)?[\/ ]?([\d.]*( se)?)/i,r.Windows,p],[/windows[\/ ](1[01]|2000|3\.1|7|8(\.1)?|9[58]|me|server 20\d\d( r2)?|vista|xp)/i,r.Windows,p],[/windows nt ?([\d.)]*)(?!.+xbox)/i,r.Windows,p],[/\bwin(?=3| ?9|n)(?:nt| 9x )?([\d.;]*)/i,r.Windows,p],[/windows ce\/?([\d.]*)/i,r.Windows,p],[/[adehimnop]{4,7}\b(?:.*os (\w+) like mac|; opera)/i,r.iOS,v],[/(?:ios;fbsv|ios(?=.+ip(?:ad|hone))|ip(?:ad|hone)(?: |.+i(?:pad)?)os)[\/ ]([\w.]+)/i,r.iOS,v],[/cfnetwork\/.+darwin/i,r.iOS,v],[/mac os x ?([\w. ]*)/i,r.MacOS,v],[/(?:macintosh|mac_powerpc\b)(?!.+(haiku|morphos))/i,r.MacOS,v],[/droid ([\w.]+)\b.+(android[- ]x86)/i,r.Android],[/android\w*[-\/.; ]?([\d.]*)/i,r.Android]],m=[[/windows.+ edge\/([\w.]+)/i,o.EdgeHTML],[/arkweb\/([\w.]+)/i,o.ArkWeb],[/webkit\/537\.36.+chrome\/(?!27)([\w.]+)/i,o.Blink],[/presto\/([\w.]+)/i,o.Presto],[/webkit\/([\w.]+)/i,o.WebKit],[/trident\/([\w.]+)/i,o.Trident],[/netfront\/([\w.]+)/i,o.NetFront],[/khtml[\/ ]\(?([\w.]+)/i,o.KHTML],[/tasman[\/ ]\(?([\w.]+)/i,o.Tasman],[/rv:([\w.]{1,9})\b.+gecko/i,o.Gecko]],f=[[/\b(?:crmo|crios)\/([\w.]+)/i,t.Chrome],[/webview.+edge\/([\w.]+)/i,t.Edge],[/edg(?:e|ios|a)?\/([\w.]+)/i,t.Edge],[/opera mini\/([-\w.]+)/i,t.Opera],[/opera [mobileta]{3,6}\b.+version\/([-\w.]+)/i,t.Opera],[/opera(?:.+version\/|[\/ ]+)([\w.]+)/i,t.Opera],[/opios[\/ ]+([\w.]+)/i,t.Opera],[/\bop(?:rg)?x\/([\w.]+)/i,t.Opera],[/\bopr\/([\w.]+)/i,t.Opera],[/iemobile(?:browser|boat|jet)[\/ ]?([\d.]*)/i,t.IE],[/(?:ms|\()ie ([\w.]+)/i,t.IE],[/trident.+rv[: ]([\w.]{1,9})\b.+like gecko/i,t.IE],[/\bfocus\/([\w.]+)/i,t.Firefox],[/\bopt\/([\w.]+)/i,t.Opera],[/coast\/([\w.]+)/i,t.Opera],[/fxios\/([\w.-]+)/i,t.Firefox],[/samsungbrowser\/([\w.]+)/i,t.SamsungInternet],[/headlesschrome(?:\/([\w.]+)| )/i,t.Chrome],[/wv\).+chrome\/([\w.]+).+edgw\//i,t.Edge],[/ wv\).+(chrome)\/([\w.]+)/i,t.Chrome],[/chrome\/([\w.]+) mobile/i,t.Chrome],[/chrome\/v?([\w.]+)/i,t.Chrome],[/version\/([\w.,]+) .*mobile(?:\/\w+ | ?)safari/i,t.Safari],[/iphone .*mobile(?:\/\w+ | ?)safari/i,t.Safari],[/version\/([\w.,]+) .*safari/i,t.Safari],[/webkit.+?(?:mobile ?safari|safari)(\/[\w.]+)/i,t.Safari,"1"],[/(?:mobile|tablet);.*firefox\/([\w.-]+)/i,t.Firefox],[/mobile vr; rv:([\w.]+)\).+firefox/i,t.Firefox],[/firefox\/([\w.]+)/i,t.Firefox]];function p(e){if(void 0===e)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"}[e];return void 0!==r?r:e}function v(e){return void 0===e?"":e.replace(/_/g,".")}function h(e,r){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":r}function b(e,r){return"function"==typeof r?r(e):"string"==typeof r?r:void 0===e?"":e}function g(e){var r=e.split(".");return{major:parseInt(r[0]||"0"),minor:parseInt(r[1]||"0"),build:parseInt(r[2]||"0")}}for(var w=0;w<d.length;w++){var y=(S=d[w])[0],j=S[1],T=S[2];if(null!==(E=c.userAgent.match(y))){c.os=j,c.osVersion=b(E[1],T);break}}c.os===r.iOS&&0===e(c.osVersion,"18.6")&&(null!==(A=/\) Version\/([\d.]+)/.exec(c.userAgent))&&parseInt(A[1].substring(0,2),10)>=26&&(c.osVersion=A[1]));for(w=0;w<m.length;w++){y=(S=m[w])[0];var k=S[1];T=S[2];if(null!==(E=c.userAgent.match(y))){c.engine=k,c.engineVersion=b(E[1],T);break}}for(w=0;w<f.length;w++){y=(S=f[w])[0];var S,E,x=S[1];T=S[2];if(null!==(E=c.userAgent.match(y))){c.browser=x,c.browserVersion=b(E[1],T);break}}if(u)try{j=(C=require("react-native").Platform).OS;var A=g(M=""+C.Version);switch(j){case"android":c.os=r.Android,c.osVersion=function(e,r){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?"4.4W":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":r}(A,M);break;case"ios":c.os=r.iOS,c.osVersion=M;break;case"windows":c.os=r.Windows,c.osVersion=h(A,M);break;case"macos":c.os=r.MacOS,c.osVersion=M}}catch(e){}if(s)try{var M,C=(j=require("os")).platform();A=g(M=j.release());switch(C){case"win32":c.os=r.Windows,c.osVersion=h(A,M);break;case"darwin":c.os=r.MacOS,c.osVersion=function(e,r){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:r}(A,M);break;case"android":c.os=r.Android,c.osVersion=M;break;case"linux":/android/i.test(M)&&(c.os=r.Android,c.osVersion=M)}}catch(e){}document.addEventListener("deviceready",(function(){if(c.os===r.Unknown&&void 0!==globalThis.device){switch(globalThis.device.platform){case"Android":c.os=r.Android;break;case"iOS":c.os=r.iOS}c.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(e){for(var n,o=e.fullVersionList||e.brands||[],t=e.platformVersion,i=0;i<o.length;i++){var a=null==(n=o[i])?{brand:"",version:""}:"string"==typeof n?{brand:n,version:""}:{brand:n.brand,version:n.version},s=a.brand,l=a.version;/not.a.brand/i.test(s)||"Chromium"===s&&(c.engineVersion=l)}"string"==typeof t&&(c.os===r.Windows&&parseInt(t.replace(/[^\d.]/g,"").split(".")[0],10)>=13?c.osVersion="11":c.osVersion=t)})),c.device=c.os===r.iOS||c.os===r.Android?n.Mobile:c.os===r.Windows||c.os===r.MacOS?n.Desktop:n.Unknown,c.isMobile=c.device===n.Mobile,c.isDesktop=c.device===n.Desktop,c.isStandalone=function(e){return"matchMedia"in globalThis&&(e===r.iOS?"standalone"in navigator&&!!navigator.standalone:globalThis.matchMedia("(display-mode: standalone)").matches)}(c.os),function(e){e.Unknown="unknown",e.Light="light",e.Dark="dark"}(i||(i={}));var I="matchMedia"in globalThis?globalThis.matchMedia("(prefers-color-scheme: dark)"):{matches:!1,media:"not all",onchange:null,addListener:function(){},removeListener:function(){},addEventListener:function(){},removeEventListener:function(){},dispatchEvent:function(){return!1}},L="not all"!==I.media,O=c.browser!==t.Chrome||c.isMobile&&e(c.browserVersion,"92")>=0,F="document"in globalThis?globalThis.document.createElement("canvas").getContext("2d",{willReadFrequently:!0}):null,N=/iemobile/i.test(c.userAgent),V=/windows phone/i.test(c.userAgent),U=[];function P(e){var r="function"==typeof Symbol&&Symbol.iterator,n=r&&e[r],o=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&o>=e.length&&(e=void 0),{value:e&&e[o++],done:!e}}};throw new TypeError(r?"Object is not iterable.":"Symbol.iterator is not defined.")}function W(e,r){function n(o){if(!(this instanceof n))return new n(o);var t=new r(o||"");if("function"==typeof Object.setPrototypeOf?Object.setPrototypeOf(t,n.prototype):t.__proto__=n.prototype,t.name=e,void 0!==o&&(t.message=o),"undefined"!=typeof Symbol&&Symbol.toStringTag)try{Object.defineProperty(t,Symbol.toStringTag,{value:e,writable:!1,enumerable:!1,configurable:!0})}catch(e){}if("function"==typeof Error.captureStackTrace)Error.captureStackTrace(t,n);else if(r.captureStackTrace&&"function"==typeof r.captureStackTrace)r.captureStackTrace(t,n);else try{var i=new r;i.stack&&(t.stack=i.stack)}catch(e){}return t}void 0===r&&(r=Error),n.prototype=Object.create(r.prototype,{constructor:{value:n,writable:!0,enumerable:!1,configurable:!0}});try{Object.defineProperty(n.prototype,"name",{value:e,writable:!0,enumerable:!1,configurable:!0})}catch(r){try{n.prototype.name=e}catch(e){}}try{Object.defineProperty(n,"name",{value:e,writable:!1,enumerable:!1,configurable:!0})}catch(e){}return n}"function"==typeof SuppressedError&&SuppressedError;var D=W("EasingError"),R=W("CubicBezierSyntaxError",D),z=W("LinearSyntaxError",D),q=W("StepSyntaxError",D),H=W("UnsupportedEasingFunctionError",D),B={linear:"linear(0, 1)",ease:"cubic-bezier(0.25, 0.1, 0.25, 1)","ease-in":"cubic-bezier(0.42, 0, 1, 1)","ease-out":"cubic-bezier(0, 0, 0.58, 1)","ease-in-out":"cubic-bezier(0.42, 0, 0.58, 1)","step-start":"steps(1, jump-start)","step-end":"steps(1, jump-end)"};function _(e,r,n){return e<r?r:e>n?n:e}function G(e){var r=function(e){var r=e.match(/cubic-bezier\((.*)\)/);if(null===r)throw new R("Invalid cubic-bezier syntax");var n=r[1].trim().split(","),o=[];if(4!==n.length)throw new R("Cubic-bezier must have exactly 4 numeric values");for(var t=0;t<4;t++){var i=parseFloat(n[t]);if(isNaN(i))throw new R("Cubic-bezier must have exactly 4 numeric values");if(t%2==0&&(i<0||i>1))throw new R("x1 and x2 must be between 0 and 1");o.push(i)}return{x1:o[0],y1:o[1],x2:o[2],y2:o[3]}}(e),n=r.x1,o=r.x2,t=r.y1,i=r.y2;return function(e){if(0===(e=_(e,0,1))||1===e)return e;var r=function(e,r,t){if(void 0===r&&(r=1e-6),void 0===t&&(t=50),e<=0)return 0;if(e>=1)return 1;for(var i=e,a=0;a<t;a++){var s=3*(1-i)*(1-i)*i*n+3*(1-i)*i*i*o+i*i*i,l=3*(1-i)*(1-i)*n+6*(1-i)*i*(o-n)+3*i*i*(1-o);if(Math.abs(l)<r)break;var u=i-(s-e)/l;if(Math.abs(u-i)<r){i=u;break}i=Math.max(0,Math.min(1,u))}return i}(e);return 3*(1-r)*(1-r)*r*t+3*(1-r)*r*r*i+r*r*r}}function K(e){var r=function(e){var r,n,o=e.match(/linear\((.*)\)/);if(null===o)throw new z("Invalid linear syntax");var t=o[1].trim();if(""===t)throw new z("Linear function must have at least one point");for(var i=t.split(","),a=[],s=0;s<i.length;s++){var l=i[s].trim(),u=l.match(/^([+-]?\d*\.?\d+)((?:\s+[+-]?\d*\.?\d+%){2,})$/);if(null===u){var c=l.match(/^([+-]?\d*\.?\d+)\s+([+-]?\d*\.?\d+)%$/);if(null===c){var d=l.match(/^([+-]?\d*\.?\d+)$/);if(null===d)throw new z('Invalid linear point format: "'+l+'"');a.push({position:1===i.length?0:s/(i.length-1),value:parseFloat(d[1])})}else a.push({position:parseFloat(c[2])/100,value:parseFloat(c[1])})}else{var m=parseFloat(u[1]),f=u[2].trim().split(/\s+/);try{for(var p=(r=void 0,P(f)),v=p.next();!v.done;v=p.next()){var h=v.value;a.push({value:m,position:parseFloat(h)/100})}}catch(e){r={error:e}}finally{try{v&&!v.done&&(n=p.return)&&n.call(p)}finally{if(r)throw r.error}}}}if(0===a.length)throw new z("No valid points found in linear function");return a.sort((function(e,r){return e.position-r.position})),a[0].position>0&&a.unshift({position:0,value:0}),a[a.length-1].position<1&&a.push({position:1,value:1}),a}(e);return function(e){if((e=_(e,0,1))<=r[0].position)return r[0].value;if(e>=r[r.length-1].position)return r[r.length-1].value;for(var n=0;n<r.length-1;n++){var o=r[n],t=r[n+1];if(e>=o.position&&e<=t.position){if(o.position===t.position)return t.value;var i=(e-o.position)/(t.position-o.position);return o.value+(t.value-o.value)*i}}return r[r.length-1].value}}function Z(e){if(function(e){return!/(linear|cubic-bezier|steps)\((.*)\)/.test(e)}(e)&&(e=B[e]),function(e){return/cubic-bezier\(/.test(e)}(e))return G(e);if(function(e){return/linear\(/.test(e)}(e))return K(e);if(function(e){return/steps\(\s*(\d+)\s*(?:,\s*(jump-start|jump-end|jump-none|jump-both|start|end)\s*)?\)$/.test(e)}(e))return function(e){var r=e.match(/steps\(\s*(\d+)\s*(?:,\s*(jump-start|jump-end|jump-none|jump-both|start|end)\s*)?\)$/);if(null===r)throw new q("Invalid steps syntax");var n=parseInt(r[1],10),o=r[2];if(n<=0)throw new q("Steps count must be a positive integer");if("jump-none"===o&&n<2)throw new q("jump-none requires at least 2 steps");return function(e){switch(e=_(e,0,1),o){case"start":case"jump-start":return 0===e?1/n:1===e?1:Math.ceil(e*n)/n;case void 0:case"end":case"jump-end":return 1===e?1:Math.floor(e*n)/n;case"jump-both":return 0===e?0:1===e?1:Math.round(e*(n+1))/(n+1);case"jump-none":return 0===e?0:1===e?1:Math.floor(e*(n-1))/(n-1);default:throw new q('Unsupported step position: "'+o+'"')}}}(e);throw new H('Unsupported easing function: "'+e+'"')}var $=W("UnsupportedColorError");function X(e){if("undefined"!=typeof CSS&&CSS.supports&&!CSS.supports("color",e))throw new $('Unsupported color: "'+e+'".');if(null!==F)try{F.clearRect(0,0,1,1),F.fillStyle=e,F.fillRect(0,0,1,1);var r=F.getImageData(0,0,1,1).data;return{red:r[0],green:r[1],blue:r[2],alpha:parseFloat((r[3]/255).toFixed(2))}}catch(e){}var n=function(e,r){if(void 0===r&&(r=!0),void 0!==globalThis.document){var n=globalThis.document.createElement(e);return"width"in n&&(n.width="0"),"height"in n&&(n.height="0"),"border"in n&&(n.border="0"),"frameBorder"in n&&(n.frameBorder="0"),"scrolling"in n&&(n.scrolling="no"),"cellPadding"in n&&(n.cellPadding="0"),"cellSpacing"in n&&(n.cellSpacing="0"),"frame"in n&&(n.frame="void"),"rules"in n&&(n.rules="none"),"noWrap"in n&&(n.noWrap=!0),n.tabIndex=-1,n.setAttribute("role","presentation"),r?(n.style.width="1px",n.style.height="1px"):(n.setAttribute("aria-hidden","true"),n.style.width="0",n.style.height="0",n.style.zIndex="-9999",n.style.display="none",n.style.visibility="hidden",n.style.pointerEvents="none"),n.style.position="absolute",n.style.top="0",n.style.left="0",n.style.padding="0",n.style.margin="0",n.style.border="none",n.style.outline="none",n.style.clip="rect(1px, 1px, 1px, 1px)",n.style.clipPath="inset(50%)",n.style.overflow="hidden",n.style.whiteSpace="nowrap",n}}("div");if(void 0===n)throw new $('Failed to parse color values from: "'+e+'".');n.style.color=e,globalThis.document.body.appendChild(n);try{var o=globalThis.getComputedStyle(n).color,t=o.match(/rgba?\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*([\d.]+))?\s*\)/),i=o.match(/rgba?\(\s*(\d+)\s+(\d+)\s+(\d+)\s*(?:\/\s*([\d.]+%?))?\s*\)/),a=t||i;if(null===a)throw new $('Unsupported color: "'+e+'".');var s=parseInt(a[1],10),l=parseInt(a[2],10),u=parseInt(a[3],10),c=1;if(void 0!==a[4]){var d=a[4];c="%"===d.charAt(d.length-1)?parseFloat((parseFloat(d)/100).toFixed(2)):parseFloat(parseFloat(d).toFixed(2))}if(isNaN(s)||isNaN(l)||isNaN(u)||isNaN(c))throw new $('Failed to parse color values from: "'+e+'".');return{red:s,green:l,blue:u,alpha:c}}finally{globalThis.document.body.removeChild(n)}}var Q={},J=null,Y=null,ee=null,re=null,ne={setAppearance:function(e){if(u)return function(e){try{require("react-native").Appearance.setColorScheme(e)}catch(e){}}(e);if(l)return function(e){try{require("electron").nativeTheme.themeSource=e||"system"}catch(e){}}(e)},getAppearance:function(){return u?new Promise((function(e){try{e(require("react-native").Appearance.getColorScheme()||i.Unknown)}catch(r){e(i.Unknown)}})):l?new Promise((function(e){try{e(require("electron").nativeTheme.shouldUseDarkColors?i.Dark:i.Light)}catch(r){e(i.Unknown)}})):c.browser===t.SamsungInternet?ie():Promise.resolve(ae())},removeThemeColor:function(e){void 0===e&&(e="default");var r=Q[e];void 0!==r&&r.remove();Q[e]=void 0},setThemeColor:function(e,r){void 0===r&&(r={duration:0,easingFunction:"linear",appearance:"default"});var n=r.duration,o=Z(r.easingFunction),t=r.appearance;null!==J&&(globalThis.cancelAnimationFrame(J),J=null,null!==Y&&(Y(me()),Y=null));var a=me();void 0===a&&(a=void 0!==r.defaultColor?r.defaultColor:ae()===i.Dark?"#181818ff":"#dcdcdcff");var s=X(a),l=X(e);return new Promise((function(e){Y=e;var r=null;J=globalThis.requestAnimationFrame((function i(a){null===r&&(r=a);var u,c=a-r;u=0===n?1:Math.min(c/n,1);var d=o(u),m={red:Math.round(s.red+(l.red-s.red)*d),green:Math.round(s.green+(l.green-s.green)*d),blue:Math.round(s.blue+(l.blue-s.blue)*d),alpha:+(s.alpha+(l.alpha-s.alpha)*d).toFixed(2)};(function(e){void 0===e&&(e="default");var r;r=!O||!L||N||V?"default":e;var n=Q[r];if(void 0!==n)return n;n=globalThis.document.createElement("meta"),N?n.setAttribute("name","msapplication-navbutton-color"):V?n.setAttribute("name","msapplication-TileColor"):n.setAttribute("name","theme-color");"default"!==e&&n.setAttribute("media","(prefers-color-scheme: "+r+")");return globalThis.document.head.prepend(n),Q[e]=n})(t).setAttribute("content",te(m)),u<1?J=globalThis.requestAnimationFrame(i):(J=null,null!==Y&&(e(me()),J=null))}))}))},getThemeColor:me,onAppearanceChange:function(e,r){void 0===r&&(r=!1);var n={fn:e,capture:!1,once:!1};"boolean"==typeof r&&(r={capture:r});void 0!==r.capture&&(n.capture=r.capture);void 0!==r.once&&(n.once=r.once);void 0!==r.signal&&(n.signal=r.signal);var o=ce(n);-1===o?(U.push(n),1===U.length&&(c.browser===t.SamsungInternet?(ie().then((function(e){ee=e})),re=globalThis.setInterval((function(){ie().then((function(e){e!==ee&&(ee=e,le(e))}))}),2e3)):(i=n.capture,ee=ae(),"function"==typeof I.addEventListener?I.addEventListener("change",se,i):"function"==typeof I.addListener&&I.addListener(se))),this.getAppearance().then(le)):U[o].once&&!n.once&&(U[o].once=!1);var i;void 0!==n.signal&&(n.signal.aborted?ue(n):n.signal.addEventListener("abort",(function e(){void 0!==n.signal&&n.signal.removeEventListener("abort",e),ue(n)})));return function(){ue(n)}}};function oe(e){var r=e.toString(16);switch(r.length){case 0:return"00";case 1:return"0"+r;default:return r}}function te(e){return"#"+oe(e.red)+oe(e.green)+oe(e.blue)+oe(Math.round(255*e.alpha))}function ie(){return new Promise((function(e){var r=new Image;r.onload=function(){if(null===F)return e(i.Light);F.drawImage(r,0,0);var n=F.getImageData(0,0,1,1).data;(n[0]&n[1]&n[2])<255?e(i.Dark):e(i.Light)},r.onerror=function(){e(i.Unknown)},r.src="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjxyZWN0IHdpZHRoPSIxIiBoZWlnaHQ9IjEiIGZpbGw9IndoaXRlIi8+PC9zdmc+"}))}function ae(){return L?I.matches?i.Dark:i.Light:i.Unknown}function se(e){var r;(r=e.matches?i.Dark:i.Light)!==ee&&le(ee=r)}function le(e){for(var r=0;r<U.length;r++){var n=U[r];n.fn(e),n.once&&ue(n)}}function ue(e){var r,n=ce(e);-1!==n&&U.splice(n,1),0===U.length&&(c.browser===t.SamsungInternet?(ee=null,null!==re&&(clearInterval(re),re=null)):(r=e.capture,ee=null,"function"==typeof I.removeEventListener?I.removeEventListener("change",se,r):"function"==typeof I.removeListener&&I.removeListener(se)))}function ce(e){for(var r=0;r<U.length;r++)if(U[r].fn===e.fn&&U[r].capture===e.capture)return r;return-1}function de(){var e;Q={},e=N?'meta[name="msapplication-navbutton-color"]':V?'meta[name="msapplication-TileColor"]':'meta[name="theme-color"]';var r=globalThis.document.querySelectorAll(e);if(O&&L&&!N&&!V)for(var n=0;n<r.length;n++){var o=r.item(n),t=o.getAttribute("media");if("(prefers-color-scheme: dark)"===t&&void 0===Q.dark?Q.dark=o:"(prefers-color-scheme: light)"===t&&void 0===Q.light?Q.light=o:null===t&&void 0===Q.default&&(Q.default=o),void 0!==Q.dark&&void 0!==Q.light&&void 0!==Q.default)return}else Q.default=r[0]}function me(){if(!u&&!l){var e=function(){if(N)return globalThis.document.querySelector('meta[name="msapplication-navbutton-color"]');if(V)return globalThis.document.querySelector('meta[name="msapplication-TileColor"]');if(!O||!L)return globalThis.document.querySelector('meta[name="theme-color"]');var e,r=globalThis.document.querySelectorAll('meta[name="theme-color"]');e=ae()===i.Dark?"(prefers-color-scheme: dark)":"(prefers-color-scheme: light)";for(var n=0;n<r.length;n++){var o=r.item(n);if(o.hasAttribute("content")){var t=o.getAttribute("media");if(null===t||t===e)return o}}return null}();return null!==e?e.getAttribute("content"):c.browser===t.Safari?c.isStandalone?ae()===i.Dark?"#ffffffff":"#000000ff":te(X(globalThis.getComputedStyle(globalThis.document.body).backgroundColor)):c.browser===t.Chrome?ae()===i.Dark?"#28292cff":"#ffffffff":void 0}}!function(){if(void 0!==globalThis.MutationObserver){var e=new MutationObserver((function(e){for(var r=0;r<e.length;r++){for(var n=e[r],o=n.addedNodes,t=n.removedNodes,i=0;i<o.length;i++)if(o[i]instanceof HTMLMetaElement)return de();for(i=0;i<t.length;i++)if(t[i]instanceof HTMLMetaElement)return de()}}));"function"==typeof I.addEventListener?I.addEventListener("change",de):"function"==typeof I.addListener&&I.addListener(de),e.observe(globalThis.document.head,{childList:!0}),de()}}();var fe={installed:!1,name:"Theme",module:ne,Constants:{Appearances:i},Errors:{EasingError:D,UnsupportedEasingFunctionError:H,StepSyntaxError:q,LinearSyntaxError:z,CubicBezierSyntaxError:R,UnsupportedColorError:$}};export{fe as default};
|
|
@@ -60,7 +60,10 @@ var Browsers;
|
|
|
60
60
|
Browsers["IE"] = "IE";
|
|
61
61
|
Browsers["SamsungInternet"] = "SamsungInternet";
|
|
62
62
|
})(Browsers || (Browsers = {}));
|
|
63
|
-
var userAgent = typeof navigator !== 'undefined' && typeof navigator.userAgent === 'string' ? navigator.userAgent : '';
|
|
63
|
+
var userAgent = typeof globalThis.navigator !== 'undefined' && typeof globalThis.navigator.userAgent === 'string' ? globalThis.navigator.userAgent : '';
|
|
64
|
+
var IS_NODE_JS = typeof globalThis.process !== 'undefined' && typeof globalThis.process.versions !== 'undefined' && globalThis.process.versions.node !== undefined;
|
|
65
|
+
var IS_ELECTRON = (typeof globalThis.process !== 'undefined' && typeof globalThis.process.versions !== 'undefined' && globalThis.process.versions.electron !== undefined) || (/ electron\//i.test(userAgent));
|
|
66
|
+
var IS_REACT_NATIVE = typeof globalThis.navigator !== 'undefined' && globalThis.navigator.product === 'ReactNative';
|
|
64
67
|
var Platform = {
|
|
65
68
|
device: Devices.Unknown,
|
|
66
69
|
os: OS.Unknown,
|
|
@@ -75,9 +78,6 @@ var Platform = {
|
|
|
75
78
|
isDesktop: false,
|
|
76
79
|
isStandalone: false,
|
|
77
80
|
isWebview: /; ?wv|applewebkit(?!.*safari)/i.test(userAgent),
|
|
78
|
-
isNodeJS: typeof globalThis.process !== 'undefined' && typeof globalThis.process.versions !== 'undefined' && globalThis.process.versions.node !== undefined,
|
|
79
|
-
isElectron: (typeof globalThis.process !== 'undefined' && typeof globalThis.process.versions !== 'undefined' && globalThis.process.versions.electron !== undefined) || (/ electron\//i.test(userAgent)),
|
|
80
|
-
isReactNative: typeof navigator !== 'undefined' && navigator.product === 'ReactNative'
|
|
81
81
|
};
|
|
82
82
|
var OS_RESOLVER_MAP = [
|
|
83
83
|
[/windows nt (6\.[23]); arm/i, OS.Windows, resolveWindowsVersion],
|
|
@@ -387,7 +387,7 @@ for (var i = 0; i < BROWSER_RESOLVER_MAP.length; i++) {
|
|
|
387
387
|
break;
|
|
388
388
|
}
|
|
389
389
|
}
|
|
390
|
-
if (
|
|
390
|
+
if (IS_REACT_NATIVE) {
|
|
391
391
|
try {
|
|
392
392
|
var reactNative = require('react-native');
|
|
393
393
|
var platform = reactNative.Platform;
|
|
@@ -416,7 +416,7 @@ if (Platform.isReactNative) {
|
|
|
416
416
|
catch (_) {
|
|
417
417
|
}
|
|
418
418
|
}
|
|
419
|
-
if (
|
|
419
|
+
if (IS_NODE_JS) {
|
|
420
420
|
try {
|
|
421
421
|
var os = require('os');
|
|
422
422
|
var platform = os.platform();
|
|
@@ -446,6 +446,19 @@ if (Platform.isNodeJS) {
|
|
|
446
446
|
catch (_) {
|
|
447
447
|
}
|
|
448
448
|
}
|
|
449
|
+
document.addEventListener("deviceready", function () {
|
|
450
|
+
if (Platform.os === OS.Unknown && typeof globalThis.device !== 'undefined') {
|
|
451
|
+
switch (globalThis.device.platform) {
|
|
452
|
+
case 'Android':
|
|
453
|
+
Platform.os = OS.Android;
|
|
454
|
+
break;
|
|
455
|
+
case 'iOS':
|
|
456
|
+
Platform.os = OS.iOS;
|
|
457
|
+
break;
|
|
458
|
+
}
|
|
459
|
+
Platform.osVersion = globalThis.device.version;
|
|
460
|
+
}
|
|
461
|
+
}, false);
|
|
449
462
|
if (navigator.userAgentData !== undefined && navigator.userAgentData.getHighEntropyValues !== undefined) {
|
|
450
463
|
navigator
|
|
451
464
|
.userAgentData
|
|
@@ -1303,7 +1316,7 @@ function setThemeColor(color, options) {
|
|
|
1303
1316
|
});
|
|
1304
1317
|
}
|
|
1305
1318
|
function getThemeColor() {
|
|
1306
|
-
if (
|
|
1319
|
+
if (IS_REACT_NATIVE || IS_ELECTRON)
|
|
1307
1320
|
return undefined;
|
|
1308
1321
|
var meta = getCurrentAppliedThemeColorMeta();
|
|
1309
1322
|
if (meta !== null)
|
|
@@ -1318,15 +1331,15 @@ function removeThemeColor(appearance) {
|
|
|
1318
1331
|
themeColorMetaGroup[appearance] = undefined;
|
|
1319
1332
|
}
|
|
1320
1333
|
function setAppearance(appearance) {
|
|
1321
|
-
if (
|
|
1334
|
+
if (IS_REACT_NATIVE)
|
|
1322
1335
|
return setThemeColorReactNative(appearance);
|
|
1323
|
-
else if (
|
|
1336
|
+
else if (IS_ELECTRON)
|
|
1324
1337
|
return setThemeColorElectron(appearance);
|
|
1325
1338
|
}
|
|
1326
1339
|
function getAppearance() {
|
|
1327
|
-
if (
|
|
1340
|
+
if (IS_REACT_NATIVE)
|
|
1328
1341
|
return detectFromReactNative();
|
|
1329
|
-
else if (
|
|
1342
|
+
else if (IS_ELECTRON)
|
|
1330
1343
|
return detectFromElectron();
|
|
1331
1344
|
else if (Platform.browser === Browsers.SamsungInternet)
|
|
1332
1345
|
return detectFromEngine();
|