@galacean/effects-plugin-downgrade 2.7.0-alpha.1 → 2.7.0-beta.0
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/alipay.js +1 -1
- package/dist/alipay.js.map +1 -1
- package/dist/alipay.mjs +1 -1
- package/dist/alipay.mjs.map +1 -1
- package/dist/douyin.js +1 -1
- package/dist/douyin.js.map +1 -1
- package/dist/douyin.mjs +1 -1
- package/dist/douyin.mjs.map +1 -1
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/dist/index.min.js +2 -2
- package/dist/index.min.js.map +1 -1
- package/dist/index.mjs +2 -2
- package/dist/index.mjs.map +1 -1
- package/dist/weapp.js +1 -1
- package/dist/weapp.js.map +1 -1
- package/dist/weapp.mjs +1 -1
- package/dist/weapp.mjs.map +1 -1
- package/package.json +2 -2
package/dist/alipay.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("@galacean/effects/alipay"),i=require("@galacean/appx-adapter/alipay");function n(e){if(e&&e.__esModule)return e;var i=Object.create(null);return e&&Object.keys(e).forEach((function(n){if("default"!==n){var t=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(i,n,t.get?t:{enumerable:!0,get:function(){return e[n]}})}})),i.default=e,Object.freeze(i)}var t=n(e);function o(e,i,n,t,o,r,h){try{var s=e[r](h),d=s.value}catch(e){return void n(e)}s.done?i(d):Promise.resolve(d).then(t,o)}function r(e,i){return r=Object.setPrototypeOf||function(e,i){return e.__proto__=i,e},r(e,i)}function h(e,i){var n,t,o,r={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},h=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return h.next=s(0),h.throw=s(1),h.return=s(2),"function"==typeof Symbol&&(h[Symbol.iterator]=function(){return this}),h;function s(s){return function(d){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;h&&(h=0,s[0]&&(r=0)),r;)try{if(n=1,t&&(o=2&s[0]?t.return:s[0]?t.throw||((o=t.return)&&o.call(t),0):t.next)&&!(o=o.call(t,s[1])).done)return o;switch(t=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return r.label++,{value:s[1],done:!1};case 5:r.label++,t=s[1],s=[0];continue;case 7:s=r.ops.pop(),r.trys.pop();continue;default:if(!(o=r.trys,(o=o.length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){r=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){r.label=s[1];break}if(6===s[0]&&r.label<o[1]){r.label=o[1],o=s;break}if(o&&r.label<o[2]){r.label=o[2],r.ops.push(s);break}o[2]&&r.ops.pop(),r.trys.pop();continue}s=i.call(e,r)}catch(e){s=[6,e],t=0}finally{n=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,d])}}}function s(e,i){(null==i||i>e.length)&&(i=e.length);for(var n=0,t=new Array(i);n<i;n++)t[n]=e[n];return t}function d(e,i){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=function(e,i){if(e){if("string"==typeof e)return s(e,i);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(n):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?s(e,i):void 0}}(e))||i&&e&&"number"==typeof e.length){n&&(e=n);var t=0;return function(){return t>=e.length?{done:!0}:{done:!1,value:e[t++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}"function"==typeof SuppressedError&&SuppressedError;var a,l={vender:["SAMSUNG"],iPhone:[{name:"iPhone 15 Pro Max",model:"iPhone16,2",width:1290,height:2796},{name:"iPhone 15 Pro",model:"iPhone16,1",width:1179,height:2556},{name:"iPhone 15 Plus",model:"iPhone15,5",width:1290,height:2796},{name:"iPhone 15",model:"iPhone15,4",width:1179,height:2556},{name:"iPhone 14 Pro Max",model:"iPhone15,3",width:1290,height:2796},{name:"iPhone 14 Pro",model:"iPhone15,2",width:1179,height:2556},{name:"iPhone 14 Plus",model:"iPhone14,8",width:1284,height:2778},{name:"iPhone 14",model:"iPhone14,7",width:1170,height:2532},{name:"iPhone 13 Pro Max",model:"iPhone14,3",width:1284,height:2778},{name:"iPhone 13 Pro",model:"iPhone14,2",width:1170,height:2532},{name:"iPhone 13",model:"iPhone14,5",width:1170,height:2532},{name:"iPhone 13 mini",model:"iPhone14,4",width:1080,height:2340},{name:"iPhone SE (3rd gen)",model:"iPhone14,6",width:750,height:1334},{name:"iPhone 12 Pro Max",model:"iPhone13,4",width:1284,height:2778},{name:"iPhone 12 Pro",model:"iPhone13,3",width:1170,height:2532},{name:"iPhone 12",model:"iPhone13,2",width:1170,height:2532},{name:"iPhone 12 mini",model:"iPhone13,1",width:1080,height:2340},{name:"iPhone 11 Pro Max",model:"iPhone12,5",width:1242,height:2688},{name:"iPhone 11 Pro",model:"iPhone12,3",width:1125,height:2436},{name:"iPhone 11",model:"iPhone12,1",width:828,height:1792},{name:"iPhone SE (2nd gen)",model:"iPhone12,8",width:750,height:1334},{name:"iPhone XR",model:"iPhone11,8",width:828,height:1792},{name:"iPhone XS Max",model:"iPhone11,6",width:1242,height:2688},{name:"iPhone XS",model:"iPhone11,2",width:1125,height:2436},{name:"iPhone X",model:"iPhone10,3",width:1125,height:2436},{name:"iPhone 8 Plus",model:"iPhone10,2",width:1080,height:1920},{name:"iPhone 8",model:"iPhone10,1",width:750,height:1334},{name:"iPhone 7 Plus",model:"iPhone9,2",width:1080,height:1920},{name:"iPhone 7",model:"iPhone9,1",width:750,height:1334},{name:"iPhone 6s Plus",model:"iPhone8,2",width:1080,height:1920},{name:"iPhone 6s",model:"iPhone8,1",width:750,height:1334},{name:"iPhone SE (1st gen)",model:"iPhone8,4",width:640,height:1136},{name:"iPhone 6 Plus",model:"iPhone7,1",width:1080,height:1920},{name:"iPhone 6",model:"iPhone7,2",width:750,height:1334},{name:"iPhone 5C",model:"iPhone5,3",width:640,height:1136},{name:"iPhone 5S",model:"iPhone6,1",width:640,height:1136},{name:"iPhone 5",model:"iPhone5,1",width:640,height:1136},{name:"iPhone 4S",model:"iPhone4,1",width:640,height:960},{name:"iPhone 4",model:"iPhone3,1",width:640,height:960},{name:"iPhone 3GS",model:"iPhone2,1",width:320,height:480},{name:"iPhone 3G",model:"iPhone1,2",width:320,height:480},{name:"iPhone 1st gen",model:"iPhone1,1",width:320,height:480}]},c={android:["OPPO R9s Plus","GM1910","V1824A","V1916A","SM-G9650","V1936A","MI9 PRO 5G","REDMI K20","V1914A","GM1900","RMX1971","SM-A6060","SM-G9600","V1922A","PBAM00","PCAM10","PACT00","PBBM00","PCEM00","V1818A","vivo X6A","vivo X6Plus A"],iPhone:["iPhone8,4","iPhone8,2","iPhone8,1","iPhone7,2","iPhone7,1","iPhone6,2","iPhone6,1","iPhone5,4","iPhone5,3","iPhone5,2","iPhone5,1","iPhone4,3","iPhone4,2","iPhone4,1","iPhone3,3","iPhone3,2","iPhone3,1","iPhone2,1","iPhone1,2","iPhone1,1"]},u={android:[],iOS:["16.7","16.7.1","16.7.2","16.7.3","16.7.4","16.7.5","16.7.6"]},v={wechat:{"iPhone 6/7/8":"iPhone 8","iPhone 6/7/8 Plus":"iPhone 8 Plus","iPhone 12/13 mini":"iPhone 13 mini","iPhone 12/13 (Pro)":"iPhone 13 Pro","iPhone 12/13 Pro Max":"iPhone 13 Pro Max"}};exports.DeviceLevel=void 0,(a=exports.DeviceLevel||(exports.DeviceLevel={})).High="high",a.Medium="medium",a.Low="low",a.Unknown="unknown";var m=function(){function e(e){this.device={},this.parse(null!=e?e:navigator.userAgent)}var n=e.prototype;return n.getDeviceInfo=function(){return this.device},n.isIOS=function(){return"iOS"===this.device.platform},n.isAndroid=function(){return"Android"===this.device.platform},n.isHarmony=function(){return"Harmony"===this.device.platform},n.isWindows=function(){return"Windows"===this.device.platform},n.isMacintosh=function(){return"Macintosh"===this.device.platform},n.isMobile=function(){return this.isIOS()||this.isAndroid()||this.isHarmony()},n.parse=function(e){for(var i,n=/(\w+\/[\w.]+)(\s+\([^)]+\))?/g,t=[];null!==(i=n.exec(e));){var o,r=i[1],h=null==(o=i[2])?void 0:o.trim();t.push({name:r,comment:h})}for(var s,a=d(t);!(s=a()).done;){var l=s.value,c=l.name,u=l.comment;if(null==c?void 0:c.startsWith("Mozilla/")){u&&this.parseData(u);break}}this.device.level=this.estimateDeviceLevel(),this.device.sourceData=e},n.parseData=function(e){e.length&&"("===e[0]&&(e=e.substring(1)),e.length&&")"==e[e.length-1]&&(e=e.substring(0,e.length-1)),this.testIPhone(e)?(this.device.platform="iOS",this.device.osVersion=this.parseIOSVersion(e),this.device.model=this.getIPhoneModel()):this.testIPad(e)?(this.device.platform="iOS",this.device.osVersion=this.parseIOSVersion(e),this.device.model="iPad"):this.testMacintosh(e)?(this.device.platform="Mac OS",this.device.osVersion=this.parseMacOSVersion(e)):this.testAndroid(e)?(this.device.platform="Android",this.device.osVersion=this.parseAndroidVersion(e),this.device.model=this.parseAndroidModel(e)):this.testWindows(e)?(this.device.platform="Windows",this.device.osVersion=this.parseWindowsVersion(e)):console.error("Unknown info: "+e+".")},n.estimateDeviceLevel=function(){if(this.isIOS()){if(this.device.osVersion){var e=parseInt(this.device.osVersion.split(".")[0]);return e<12?exports.DeviceLevel.Low:e<16?exports.DeviceLevel.Medium:exports.DeviceLevel.High}return exports.DeviceLevel.Low}if(this.isAndroid()){if(this.device.osVersion){var i=parseInt(this.device.osVersion.split(".")[0]);return i<10?exports.DeviceLevel.Low:i<12?exports.DeviceLevel.Medium:exports.DeviceLevel.High}return exports.DeviceLevel.Low}return exports.DeviceLevel.High},n.parseIOSVersion=function(e){var i=e.match(/OS (\d+)(?:_(\d+))?_(\d+)/);if(i){for(var n=[],t=1;t<=3;t++)i[t]&&n.push(i[t]);return n.join(".")}},n.getIPhoneModel=function(){var e,n=i.window.screen.width*i.window.devicePixelRatio,t=i.window.screen.height*i.window.devicePixelRatio,o=l.iPhone.find((function(e){return e.width===n&&e.height===t}));return null!=(e=null==o?void 0:o.model)?e:"iPhone"},n.parseAndroidVersion=function(e){var i=e.match(/Android ([\d.]+);/);if(i&&i.length>=2)return i[1]},n.parseAndroidModel=function(e){for(var i,n,t=e.split(";"),o=d(t);!(n=o()).done;){var r=n.value,h=r.match(/(.+?) Build/);if(h&&h.length>=2)return h[1].trim();if(r.includes("HMSCore")&&i)return i.trim();i=r}if(t.length>0)for(var s,a=t[t.length-1].trim(),c=d(l.vender);!(s=c()).done;){var u=s.value;if(a.startsWith(u))return a.substring(u.length).trim()}if(3==t.length)return t[t.length-1].trim();if(4===t.length){var v=t.length;if("wv"===t[v-1].trim())return t[v-2].trim()}},n.parseWindowsVersion=function(e){var i=e.match(/Windows NT ([\d.]+);/);if(i&&i.length>=2)return i[1]},n.parseMacOSVersion=function(e){var i=e.match(/OS X (\d+)(?:_(\d+))?_(\d+)/);if(i){for(var n=[],t=1;t<=3;t++)i[t]&&n.push(i[t]);return n.join(".")}},n.testIPhone=function(e){return e.includes("iPhone")},n.testIPad=function(e){return e.includes("iPad")},n.testAndroid=function(e){return e.includes("Android")},n.testMacintosh=function(e){return e.includes("Macintosh")},n.testWindows=function(e){return e.includes("Windows")},e}(),f=function(){function e(e){this.device={},this.parse(e)}var i=e.prototype;return i.getDeviceInfo=function(){return this.device},i.parse=function(e){this.device.platform=e.platform,this.device.osVersion=e.system,this.device.originalModel=e.model,this.device.model=this.getDeviceModel(e.model),this.device.level=this.getDeviceLevel(e.performance),this.device.sourceData=e},i.getDeviceModel=function(e){if(e){var i=["Huawei","Xiaomi","samsung","vivo","OPPO"].find((function(i){return(null!=e?e:"").toLowerCase().startsWith(i.toLowerCase())}));if(i)return null==e?void 0:e.substring(i.length).trim()}return e},i.getDeviceLevel=function(e){return void 0===e&&(e=""),{high:exports.DeviceLevel.High,medium:exports.DeviceLevel.Medium,middle:exports.DeviceLevel.Medium,low:exports.DeviceLevel.Low}[e]||exports.DeviceLevel.Unknown},e}(),P=function(){function e(e){this.device={},this.parse(e)}var i=e.prototype;return i.getDeviceInfo=function(){return this.device},i.parse=function(e){var i=e.system.match(/\w+/);i&&(this.device.platform=i[0].trim());var n=e.system.match(/[\d.]+/);if(n&&(this.device.osVersion=n[0].trim()),"devtools"===e.platform)for(var t,o,r=null!=(t=v.wechat[e.model])?t:e.model,h=d(l.iPhone);!(o=h()).done;){var s=o.value;if(s.name===r){e.model=s.model;break}}if("iOS"===this.device.platform){var a=e.model.match(/^(.*?)<(.*?)>$/);a?(this.device.model=a[2].trim(),this.device.originalModel=e.model):this.device.model=e.model}else this.device.model=e.model;e.benchmarkLevel<=0?this.device.level=exports.DeviceLevel.Unknown:e.benchmarkLevel<=10?this.device.level=exports.DeviceLevel.Low:e.benchmarkLevel<=20?this.device.level=exports.DeviceLevel.Medium:this.device.level=exports.DeviceLevel.High,this.device.memoryMB=e.memorySize,this.device.sourceData=e},e}(),p=function(){function i(e,i){this.options=e,this.device=i,this.isIOS=!1}var n=i.prototype;return n.getDowngradeResult=function(){var e=this,i=this.options.downgradeCallback;if(i){var n=i(this.device);if(n)return n.reason||(n.reason="downgradeCallback"),n}if(this.isIOS="iOS"===this.device.platform,this.level=this.getRenderLevel(),this.device.model){var t=this.device.model.toLowerCase();if(void 0!==(this.isIOS?c.iPhone:c.android).find((function(i){var n=i.toLowerCase();return e.isIOS?n===t:n.includes(t)||t.includes(n)})))return{downgrade:!0,level:this.level,reason:"Downgrade by model list",deviceInfo:this.device}}return void 0!==(this.isIOS?u.iOS:u.android).find((function(i){return i===e.device.osVersion}))?{downgrade:!0,level:this.level,reason:"Downgrade by OS version list",deviceInfo:this.device}:{downgrade:!1,level:this.level,reason:"",deviceInfo:this.device}},n.getRenderLevel=function(){if(this.options.level)return this.options.level;if(this.device.level){if(this.device.level===exports.DeviceLevel.High)return e.spec.RenderLevel.S;if(this.device.level===exports.DeviceLevel.Medium)return e.spec.RenderLevel.A;if(this.device.level===exports.DeviceLevel.Low)return e.spec.RenderLevel.B}if(this.isIOS&&this.device.model&&/iPhone(\d+),/.test(this.device.model)){var i=+RegExp.$1;return i<=9?e.spec.RenderLevel.B:i<10?e.spec.RenderLevel.A:e.spec.RenderLevel.S}return this.device.memoryMB?this.device.memoryMB<4e3?e.spec.RenderLevel.B:this.device.memoryMB<6e3?e.spec.RenderLevel.A:e.spec.RenderLevel.S:this.isIOS?e.spec.RenderLevel.S:e.spec.RenderLevel.B},i}(),g=Symbol("@@_inter_pause"),w=!1;function y(){return e.isIOS()?e.spec.RenderLevel.S:e.spec.RenderLevel.B}function L(i){i.target===document&&(e.logger.info("Auto pause all players with data offloaded."),e.getActivePlayers().forEach((function(e){e.paused||(e.pause({offloadTexture:!0}),e[g]=!0)})))}function S(i){i.target===document&&(e.logger.info("Auto resume all players."),e.getActivePlayers().forEach((function(e){e[g]&&(e.resume(),e[g]=!1)})))}var M=function(i){function n(){return i.apply(this,arguments)}return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(i&&i.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),i&&r(e,i)}(n,i),n.processRawJSON=function(i,n){return void 0===n&&(n={}),(t=function(){var i,t,o;return h(this,(function(r){if(t=null==(i=n.pluginData)?void 0:i.downgrade){if(t.downgrade)throw new Error("Downgraded, reason: "+t.reason)}else e.logger.warn("No downgrade result in pluginData of SceneLoadOptions.");return n.renderLevel||(n.renderLevel=null!=(o=null==t?void 0:t.level)?o:y()),[2]}))},function(){var e=this,i=arguments;return new Promise((function(n,r){var h=t.apply(e,i);function s(e){o(h,n,r,s,d,"next",e)}function d(e){o(h,n,r,s,d,"throw",e)}s(void 0)}))})();var t},n}(e.AbstractPlugin),D="2.7.0-alpha.1";e.registerPlugin("downgrade",M,e.VFXItem),e.logger.info("Plugin downgrade version: "+D+"."),D!==t.version&&console.error("注意:请统一 Downgrade 插件与 Player 版本,不统一的版本混用会有不可预知的后果!","\nAttention: Please ensure the Downgrade plugin is synchronized with the Player version. Mixing and matching incompatible versions may result in unpredictable consequences!"),exports.AlipayMiniprogramParser=f,exports.UADecoder=m,exports.WechatMiniprogramParser=P,exports.getDefaultRenderLevel=y,exports.getDowngradeResult=function(n){void 0===n&&(n={}),w||(!function(n){var t=n.autoPause;i.window.addEventListener("unload",(function(){e.getActivePlayers().forEach((function(e){return e.dispose()}))})),t&&(document.addEventListener("pause",L),document.addEventListener("resume",S))}(n),w=!0);var t,o=n.mockDowngrade;if(void 0!==o)return{downgrade:o,level:null!=(t=n.level)?t:e.spec.RenderLevel.S,reason:"mock"};var r=function(i){var n=i.queryDeviceInMiniApp,t=i.deviceInfo;if(t)return t;if(n){if(e.isAlipayMiniApp()){if(my.canIUse("getSystemInfo")){var o=my.getSystemInfo();return new f(o).getDeviceInfo()}e.logger.error("Can't use getSystemInfo in Alipay MiniProgram.")}if(e.isWechatMiniApp()){if(wx.canIUse("getDeviceInfo")){var r=wx.getDeviceInfo();return new P(r).getDeviceInfo()}e.logger.error("Can't use getDeviceInfo in WeChat MiniProgram.")}else e.logger.error("Non-mini program environment and try to get device info from user agent.")}return(new m).getDeviceInfo()}(n);return new p(n,r).getDowngradeResult()},exports.version=D;
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("@galacean/effects/alipay"),i=require("@galacean/appx-adapter/alipay");function n(e){if(e&&e.__esModule)return e;var i=Object.create(null);return e&&Object.keys(e).forEach((function(n){if("default"!==n){var t=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(i,n,t.get?t:{enumerable:!0,get:function(){return e[n]}})}})),i.default=e,Object.freeze(i)}var t=n(e);function o(e,i,n,t,o,r,h){try{var s=e[r](h),d=s.value}catch(e){return void n(e)}s.done?i(d):Promise.resolve(d).then(t,o)}function r(e,i){return r=Object.setPrototypeOf||function(e,i){return e.__proto__=i,e},r(e,i)}function h(e,i){var n,t,o,r={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},h=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return h.next=s(0),h.throw=s(1),h.return=s(2),"function"==typeof Symbol&&(h[Symbol.iterator]=function(){return this}),h;function s(s){return function(d){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;h&&(h=0,s[0]&&(r=0)),r;)try{if(n=1,t&&(o=2&s[0]?t.return:s[0]?t.throw||((o=t.return)&&o.call(t),0):t.next)&&!(o=o.call(t,s[1])).done)return o;switch(t=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return r.label++,{value:s[1],done:!1};case 5:r.label++,t=s[1],s=[0];continue;case 7:s=r.ops.pop(),r.trys.pop();continue;default:if(!(o=r.trys,(o=o.length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){r=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){r.label=s[1];break}if(6===s[0]&&r.label<o[1]){r.label=o[1],o=s;break}if(o&&r.label<o[2]){r.label=o[2],r.ops.push(s);break}o[2]&&r.ops.pop(),r.trys.pop();continue}s=i.call(e,r)}catch(e){s=[6,e],t=0}finally{n=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,d])}}}function s(e,i){(null==i||i>e.length)&&(i=e.length);for(var n=0,t=new Array(i);n<i;n++)t[n]=e[n];return t}function d(e,i){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=function(e,i){if(e){if("string"==typeof e)return s(e,i);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(n):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?s(e,i):void 0}}(e))||i&&e&&"number"==typeof e.length){n&&(e=n);var t=0;return function(){return t>=e.length?{done:!0}:{done:!1,value:e[t++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}"function"==typeof SuppressedError&&SuppressedError;var a,l={vender:["SAMSUNG"],iPhone:[{name:"iPhone 15 Pro Max",model:"iPhone16,2",width:1290,height:2796},{name:"iPhone 15 Pro",model:"iPhone16,1",width:1179,height:2556},{name:"iPhone 15 Plus",model:"iPhone15,5",width:1290,height:2796},{name:"iPhone 15",model:"iPhone15,4",width:1179,height:2556},{name:"iPhone 14 Pro Max",model:"iPhone15,3",width:1290,height:2796},{name:"iPhone 14 Pro",model:"iPhone15,2",width:1179,height:2556},{name:"iPhone 14 Plus",model:"iPhone14,8",width:1284,height:2778},{name:"iPhone 14",model:"iPhone14,7",width:1170,height:2532},{name:"iPhone 13 Pro Max",model:"iPhone14,3",width:1284,height:2778},{name:"iPhone 13 Pro",model:"iPhone14,2",width:1170,height:2532},{name:"iPhone 13",model:"iPhone14,5",width:1170,height:2532},{name:"iPhone 13 mini",model:"iPhone14,4",width:1080,height:2340},{name:"iPhone SE (3rd gen)",model:"iPhone14,6",width:750,height:1334},{name:"iPhone 12 Pro Max",model:"iPhone13,4",width:1284,height:2778},{name:"iPhone 12 Pro",model:"iPhone13,3",width:1170,height:2532},{name:"iPhone 12",model:"iPhone13,2",width:1170,height:2532},{name:"iPhone 12 mini",model:"iPhone13,1",width:1080,height:2340},{name:"iPhone 11 Pro Max",model:"iPhone12,5",width:1242,height:2688},{name:"iPhone 11 Pro",model:"iPhone12,3",width:1125,height:2436},{name:"iPhone 11",model:"iPhone12,1",width:828,height:1792},{name:"iPhone SE (2nd gen)",model:"iPhone12,8",width:750,height:1334},{name:"iPhone XR",model:"iPhone11,8",width:828,height:1792},{name:"iPhone XS Max",model:"iPhone11,6",width:1242,height:2688},{name:"iPhone XS",model:"iPhone11,2",width:1125,height:2436},{name:"iPhone X",model:"iPhone10,3",width:1125,height:2436},{name:"iPhone 8 Plus",model:"iPhone10,2",width:1080,height:1920},{name:"iPhone 8",model:"iPhone10,1",width:750,height:1334},{name:"iPhone 7 Plus",model:"iPhone9,2",width:1080,height:1920},{name:"iPhone 7",model:"iPhone9,1",width:750,height:1334},{name:"iPhone 6s Plus",model:"iPhone8,2",width:1080,height:1920},{name:"iPhone 6s",model:"iPhone8,1",width:750,height:1334},{name:"iPhone SE (1st gen)",model:"iPhone8,4",width:640,height:1136},{name:"iPhone 6 Plus",model:"iPhone7,1",width:1080,height:1920},{name:"iPhone 6",model:"iPhone7,2",width:750,height:1334},{name:"iPhone 5C",model:"iPhone5,3",width:640,height:1136},{name:"iPhone 5S",model:"iPhone6,1",width:640,height:1136},{name:"iPhone 5",model:"iPhone5,1",width:640,height:1136},{name:"iPhone 4S",model:"iPhone4,1",width:640,height:960},{name:"iPhone 4",model:"iPhone3,1",width:640,height:960},{name:"iPhone 3GS",model:"iPhone2,1",width:320,height:480},{name:"iPhone 3G",model:"iPhone1,2",width:320,height:480},{name:"iPhone 1st gen",model:"iPhone1,1",width:320,height:480}]},c={android:["OPPO R9s Plus","GM1910","V1824A","V1916A","SM-G9650","V1936A","MI9 PRO 5G","REDMI K20","V1914A","GM1900","RMX1971","SM-A6060","SM-G9600","V1922A","PBAM00","PCAM10","PACT00","PBBM00","PCEM00","V1818A","vivo X6A","vivo X6Plus A"],iPhone:["iPhone8,4","iPhone8,2","iPhone8,1","iPhone7,2","iPhone7,1","iPhone6,2","iPhone6,1","iPhone5,4","iPhone5,3","iPhone5,2","iPhone5,1","iPhone4,3","iPhone4,2","iPhone4,1","iPhone3,3","iPhone3,2","iPhone3,1","iPhone2,1","iPhone1,2","iPhone1,1"]},u={android:[],iOS:["16.7","16.7.1","16.7.2","16.7.3","16.7.4","16.7.5","16.7.6"]},v={wechat:{"iPhone 6/7/8":"iPhone 8","iPhone 6/7/8 Plus":"iPhone 8 Plus","iPhone 12/13 mini":"iPhone 13 mini","iPhone 12/13 (Pro)":"iPhone 13 Pro","iPhone 12/13 Pro Max":"iPhone 13 Pro Max"}};exports.DeviceLevel=void 0,(a=exports.DeviceLevel||(exports.DeviceLevel={})).High="high",a.Medium="medium",a.Low="low",a.Unknown="unknown";var m=function(){function e(e){this.device={},this.parse(null!=e?e:navigator.userAgent)}var n=e.prototype;return n.getDeviceInfo=function(){return this.device},n.isIOS=function(){return"iOS"===this.device.platform},n.isAndroid=function(){return"Android"===this.device.platform},n.isHarmony=function(){return"Harmony"===this.device.platform},n.isWindows=function(){return"Windows"===this.device.platform},n.isMacintosh=function(){return"Macintosh"===this.device.platform},n.isMobile=function(){return this.isIOS()||this.isAndroid()||this.isHarmony()},n.parse=function(e){for(var i,n=/(\w+\/[\w.]+)(\s+\([^)]+\))?/g,t=[];null!==(i=n.exec(e));){var o,r=i[1],h=null==(o=i[2])?void 0:o.trim();t.push({name:r,comment:h})}for(var s,a=d(t);!(s=a()).done;){var l=s.value,c=l.name,u=l.comment;if(null==c?void 0:c.startsWith("Mozilla/")){u&&this.parseData(u);break}}this.device.level=this.estimateDeviceLevel(),this.device.sourceData=e},n.parseData=function(e){e.length&&"("===e[0]&&(e=e.substring(1)),e.length&&")"==e[e.length-1]&&(e=e.substring(0,e.length-1)),this.testIPhone(e)?(this.device.platform="iOS",this.device.osVersion=this.parseIOSVersion(e),this.device.model=this.getIPhoneModel()):this.testIPad(e)?(this.device.platform="iOS",this.device.osVersion=this.parseIOSVersion(e),this.device.model="iPad"):this.testMacintosh(e)?(this.device.platform="Mac OS",this.device.osVersion=this.parseMacOSVersion(e)):this.testAndroid(e)?(this.device.platform="Android",this.device.osVersion=this.parseAndroidVersion(e),this.device.model=this.parseAndroidModel(e)):this.testWindows(e)?(this.device.platform="Windows",this.device.osVersion=this.parseWindowsVersion(e)):console.error("Unknown info: "+e+".")},n.estimateDeviceLevel=function(){if(this.isIOS()){if(this.device.osVersion){var e=parseInt(this.device.osVersion.split(".")[0]);return e<12?exports.DeviceLevel.Low:e<16?exports.DeviceLevel.Medium:exports.DeviceLevel.High}return exports.DeviceLevel.Low}if(this.isAndroid()){if(this.device.osVersion){var i=parseInt(this.device.osVersion.split(".")[0]);return i<10?exports.DeviceLevel.Low:i<12?exports.DeviceLevel.Medium:exports.DeviceLevel.High}return exports.DeviceLevel.Low}return exports.DeviceLevel.High},n.parseIOSVersion=function(e){var i=e.match(/OS (\d+)(?:_(\d+))?_(\d+)/);if(i){for(var n=[],t=1;t<=3;t++)i[t]&&n.push(i[t]);return n.join(".")}},n.getIPhoneModel=function(){var e,n=i.window.screen.width*i.window.devicePixelRatio,t=i.window.screen.height*i.window.devicePixelRatio,o=l.iPhone.find((function(e){return e.width===n&&e.height===t}));return null!=(e=null==o?void 0:o.model)?e:"iPhone"},n.parseAndroidVersion=function(e){var i=e.match(/Android ([\d.]+);/);if(i&&i.length>=2)return i[1]},n.parseAndroidModel=function(e){for(var i,n,t=e.split(";"),o=d(t);!(n=o()).done;){var r=n.value,h=r.match(/(.+?) Build/);if(h&&h.length>=2)return h[1].trim();if(r.includes("HMSCore")&&i)return i.trim();i=r}if(t.length>0)for(var s,a=t[t.length-1].trim(),c=d(l.vender);!(s=c()).done;){var u=s.value;if(a.startsWith(u))return a.substring(u.length).trim()}if(3==t.length)return t[t.length-1].trim();if(4===t.length){var v=t.length;if("wv"===t[v-1].trim())return t[v-2].trim()}},n.parseWindowsVersion=function(e){var i=e.match(/Windows NT ([\d.]+);/);if(i&&i.length>=2)return i[1]},n.parseMacOSVersion=function(e){var i=e.match(/OS X (\d+)(?:_(\d+))?_(\d+)/);if(i){for(var n=[],t=1;t<=3;t++)i[t]&&n.push(i[t]);return n.join(".")}},n.testIPhone=function(e){return e.includes("iPhone")},n.testIPad=function(e){return e.includes("iPad")},n.testAndroid=function(e){return e.includes("Android")},n.testMacintosh=function(e){return e.includes("Macintosh")},n.testWindows=function(e){return e.includes("Windows")},e}(),f=function(){function e(e){this.device={},this.parse(e)}var i=e.prototype;return i.getDeviceInfo=function(){return this.device},i.parse=function(e){this.device.platform=e.platform,this.device.osVersion=e.system,this.device.originalModel=e.model,this.device.model=this.getDeviceModel(e.model),this.device.level=this.getDeviceLevel(e.performance),this.device.sourceData=e},i.getDeviceModel=function(e){if(e){var i=["Huawei","Xiaomi","samsung","vivo","OPPO"].find((function(i){return(null!=e?e:"").toLowerCase().startsWith(i.toLowerCase())}));if(i)return null==e?void 0:e.substring(i.length).trim()}return e},i.getDeviceLevel=function(e){return void 0===e&&(e=""),{high:exports.DeviceLevel.High,medium:exports.DeviceLevel.Medium,middle:exports.DeviceLevel.Medium,low:exports.DeviceLevel.Low}[e]||exports.DeviceLevel.Unknown},e}(),P=function(){function e(e){this.device={},this.parse(e)}var i=e.prototype;return i.getDeviceInfo=function(){return this.device},i.parse=function(e){var i=e.system.match(/\w+/);i&&(this.device.platform=i[0].trim());var n=e.system.match(/[\d.]+/);if(n&&(this.device.osVersion=n[0].trim()),"devtools"===e.platform)for(var t,o,r=null!=(t=v.wechat[e.model])?t:e.model,h=d(l.iPhone);!(o=h()).done;){var s=o.value;if(s.name===r){e.model=s.model;break}}if("iOS"===this.device.platform){var a=e.model.match(/^(.*?)<(.*?)>$/);a?(this.device.model=a[2].trim(),this.device.originalModel=e.model):this.device.model=e.model}else this.device.model=e.model;e.benchmarkLevel<=0?this.device.level=exports.DeviceLevel.Unknown:e.benchmarkLevel<=10?this.device.level=exports.DeviceLevel.Low:e.benchmarkLevel<=20?this.device.level=exports.DeviceLevel.Medium:this.device.level=exports.DeviceLevel.High,this.device.memoryMB=e.memorySize,this.device.sourceData=e},e}(),p=function(){function i(e,i){this.options=e,this.device=i,this.isIOS=!1}var n=i.prototype;return n.getDowngradeResult=function(){var e=this,i=this.options.downgradeCallback;if(i){var n=i(this.device);if(n)return n.reason||(n.reason="downgradeCallback"),n}if(this.isIOS="iOS"===this.device.platform,this.level=this.getRenderLevel(),this.device.model){var t=this.device.model.toLowerCase();if(void 0!==(this.isIOS?c.iPhone:c.android).find((function(i){var n=i.toLowerCase();return e.isIOS?n===t:n.includes(t)||t.includes(n)})))return{downgrade:!0,level:this.level,reason:"Downgrade by model list",deviceInfo:this.device}}return void 0!==(this.isIOS?u.iOS:u.android).find((function(i){return i===e.device.osVersion}))?{downgrade:!0,level:this.level,reason:"Downgrade by OS version list",deviceInfo:this.device}:{downgrade:!1,level:this.level,reason:"",deviceInfo:this.device}},n.getRenderLevel=function(){if(this.options.level)return this.options.level;if(this.device.level){if(this.device.level===exports.DeviceLevel.High)return e.spec.RenderLevel.S;if(this.device.level===exports.DeviceLevel.Medium)return e.spec.RenderLevel.A;if(this.device.level===exports.DeviceLevel.Low)return e.spec.RenderLevel.B}if(this.isIOS&&this.device.model&&/iPhone(\d+),/.test(this.device.model)){var i=+RegExp.$1;return i<=9?e.spec.RenderLevel.B:i<10?e.spec.RenderLevel.A:e.spec.RenderLevel.S}return this.device.memoryMB?this.device.memoryMB<4e3?e.spec.RenderLevel.B:this.device.memoryMB<6e3?e.spec.RenderLevel.A:e.spec.RenderLevel.S:this.isIOS?e.spec.RenderLevel.S:e.spec.RenderLevel.B},i}(),g=Symbol("@@_inter_pause"),w=!1;function y(){return e.isIOS()?e.spec.RenderLevel.S:e.spec.RenderLevel.B}function L(i){i.target===document&&(e.logger.info("Auto pause all players with data offloaded."),e.getActivePlayers().forEach((function(e){e.paused||(e.pause({offloadTexture:!0}),e[g]=!0)})))}function S(i){i.target===document&&(e.logger.info("Auto resume all players."),e.getActivePlayers().forEach((function(e){e[g]&&(e.resume(),e[g]=!1)})))}var M=function(i){function n(){return i.apply(this,arguments)}return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(i&&i.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),i&&r(e,i)}(n,i),n.processRawJSON=function(i,n){return void 0===n&&(n={}),(t=function(){var i,t,o;return h(this,(function(r){if(t=null==(i=n.pluginData)?void 0:i.downgrade){if(t.downgrade)throw new Error("Downgraded, reason: "+t.reason)}else e.logger.warn("No downgrade result in pluginData of SceneLoadOptions.");return n.renderLevel||(n.renderLevel=null!=(o=null==t?void 0:t.level)?o:y()),[2]}))},function(){var e=this,i=arguments;return new Promise((function(n,r){var h=t.apply(e,i);function s(e){o(h,n,r,s,d,"next",e)}function d(e){o(h,n,r,s,d,"throw",e)}s(void 0)}))})();var t},n}(e.AbstractPlugin),D="2.7.0-beta.0";e.registerPlugin("downgrade",M,e.VFXItem),e.logger.info("Plugin downgrade version: "+D+"."),D!==t.version&&console.error("注意:请统一 Downgrade 插件与 Player 版本,不统一的版本混用会有不可预知的后果!","\nAttention: Please ensure the Downgrade plugin is synchronized with the Player version. Mixing and matching incompatible versions may result in unpredictable consequences!"),exports.AlipayMiniprogramParser=f,exports.UADecoder=m,exports.WechatMiniprogramParser=P,exports.getDefaultRenderLevel=y,exports.getDowngradeResult=function(n){void 0===n&&(n={}),w||(!function(n){var t=n.autoPause;i.window.addEventListener("unload",(function(){e.getActivePlayers().forEach((function(e){return e.dispose()}))})),t&&(document.addEventListener("pause",L),document.addEventListener("resume",S))}(n),w=!0);var t,o=n.mockDowngrade;if(void 0!==o)return{downgrade:o,level:null!=(t=n.level)?t:e.spec.RenderLevel.S,reason:"mock"};var r=function(i){var n=i.queryDeviceInMiniApp,t=i.deviceInfo;if(t)return t;if(n){if(e.isAlipayMiniApp()){if(my.canIUse("getSystemInfo")){var o=my.getSystemInfo();return new f(o).getDeviceInfo()}e.logger.error("Can't use getSystemInfo in Alipay MiniProgram.")}if(e.isWechatMiniApp()){if(wx.canIUse("getDeviceInfo")){var r=wx.getDeviceInfo();return new P(r).getDeviceInfo()}e.logger.error("Can't use getDeviceInfo in WeChat MiniProgram.")}else e.logger.error("Non-mini program environment and try to get device info from user agent.")}return(new m).getDeviceInfo()}(n);return new p(n,r).getDowngradeResult()},exports.version=D;
|
|
2
2
|
//# sourceMappingURL=alipay.js.map
|
package/dist/alipay.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"alipay.js","sources":["../../../node_modules/.pnpm/@swc+helpers@0.5.15/node_modules/@swc/helpers/esm/_async_to_generator.js","../../../node_modules/.pnpm/@swc+helpers@0.5.15/node_modules/@swc/helpers/esm/_set_prototype_of.js","../../../node_modules/.pnpm/tslib@2.8.1/node_modules/tslib/tslib.es6.mjs","../../../node_modules/.pnpm/@swc+helpers@0.5.15/node_modules/@swc/helpers/esm/_array_like_to_array.js","../../../node_modules/.pnpm/@swc+helpers@0.5.15/node_modules/@swc/helpers/esm/_create_for_of_iterator_helper_loose.js","../../../node_modules/.pnpm/@swc+helpers@0.5.15/node_modules/@swc/helpers/esm/_unsupported_iterable_to_array.js","../src/constants.ts","../src/types.ts","../src/ua-decoder.ts","../src/parser/alipay-miniprogram-parser.ts","../src/parser/wechat-miniprogram-parser.ts","../src/downgrade-judge.ts","../src/utils.ts","../src/downgrade-plugin.ts","../../../node_modules/.pnpm/@swc+helpers@0.5.15/node_modules/@swc/helpers/esm/_inherits.js","../src/index.ts"],"sourcesContent":["function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {\n try {\n var info = gen[key](arg);\n var value = info.value;\n } catch (error) {\n reject(error);\n return;\n }\n if (info.done) resolve(value);\n else Promise.resolve(value).then(_next, _throw);\n}\nfunction _async_to_generator(fn) {\n return function() {\n var self = this, args = arguments;\n\n return new Promise(function(resolve, reject) {\n var gen = fn.apply(self, args);\n\n function _next(value) {\n asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"next\", value);\n }\n\n function _throw(err) {\n asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"throw\", err);\n }\n\n _next(undefined);\n });\n };\n}\nexport { _async_to_generator as _ };\n","function _set_prototype_of(o, p) {\n _set_prototype_of = Object.setPrototypeOf || function setPrototypeOf(o, p) {\n o.__proto__ = p;\n\n return o;\n };\n\n return _set_prototype_of(o, p);\n}\nexport { _set_prototype_of as _ };\n","/******************************************************************************\nCopyright (c) Microsoft Corporation.\n\nPermission to use, copy, modify, and/or distribute this software for any\npurpose with or without fee is hereby granted.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\nPERFORMANCE OF THIS SOFTWARE.\n***************************************************************************** */\n/* global Reflect, Promise, SuppressedError, Symbol, Iterator */\n\nvar extendStatics = function(d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n};\n\nexport function __extends(d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n}\n\nexport var __assign = function() {\n __assign = Object.assign || function __assign(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\n }\n return t;\n }\n return __assign.apply(this, arguments);\n}\n\nexport function __rest(s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n t[p[i]] = s[p[i]];\n }\n return t;\n}\n\nexport function __decorate(decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n}\n\nexport function __param(paramIndex, decorator) {\n return function (target, key) { decorator(target, key, paramIndex); }\n}\n\nexport function __esDecorate(ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {\n function accept(f) { if (f !== void 0 && typeof f !== \"function\") throw new TypeError(\"Function expected\"); return f; }\n var kind = contextIn.kind, key = kind === \"getter\" ? \"get\" : kind === \"setter\" ? \"set\" : \"value\";\n var target = !descriptorIn && ctor ? contextIn[\"static\"] ? ctor : ctor.prototype : null;\n var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});\n var _, done = false;\n for (var i = decorators.length - 1; i >= 0; i--) {\n var context = {};\n for (var p in contextIn) context[p] = p === \"access\" ? {} : contextIn[p];\n for (var p in contextIn.access) context.access[p] = contextIn.access[p];\n context.addInitializer = function (f) { if (done) throw new TypeError(\"Cannot add initializers after decoration has completed\"); extraInitializers.push(accept(f || null)); };\n var result = (0, decorators[i])(kind === \"accessor\" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);\n if (kind === \"accessor\") {\n if (result === void 0) continue;\n if (result === null || typeof result !== \"object\") throw new TypeError(\"Object expected\");\n if (_ = accept(result.get)) descriptor.get = _;\n if (_ = accept(result.set)) descriptor.set = _;\n if (_ = accept(result.init)) initializers.unshift(_);\n }\n else if (_ = accept(result)) {\n if (kind === \"field\") initializers.unshift(_);\n else descriptor[key] = _;\n }\n }\n if (target) Object.defineProperty(target, contextIn.name, descriptor);\n done = true;\n};\n\nexport function __runInitializers(thisArg, initializers, value) {\n var useValue = arguments.length > 2;\n for (var i = 0; i < initializers.length; i++) {\n value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);\n }\n return useValue ? value : void 0;\n};\n\nexport function __propKey(x) {\n return typeof x === \"symbol\" ? x : \"\".concat(x);\n};\n\nexport function __setFunctionName(f, name, prefix) {\n if (typeof name === \"symbol\") name = name.description ? \"[\".concat(name.description, \"]\") : \"\";\n return Object.defineProperty(f, \"name\", { configurable: true, value: prefix ? \"\".concat(prefix, \" \", name) : name });\n};\n\nexport function __metadata(metadataKey, metadataValue) {\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\n}\n\nexport function __awaiter(thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n}\n\nexport function __generator(thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === \"function\" ? Iterator : Object).prototype);\n return g.next = verb(0), g[\"throw\"] = verb(1), g[\"return\"] = verb(2), typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (g && (g = 0, op[0] && (_ = 0)), _) try {\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n}\n\nexport var __createBinding = Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n});\n\nexport function __exportStar(m, o) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p);\n}\n\nexport function __values(o) {\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\n if (m) return m.call(o);\n if (o && typeof o.length === \"number\") return {\n next: function () {\n if (o && i >= o.length) o = void 0;\n return { value: o && o[i++], done: !o };\n }\n };\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\n}\n\nexport function __read(o, n) {\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\n if (!m) return o;\n var i = m.call(o), r, ar = [], e;\n try {\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\n }\n catch (error) { e = { error: error }; }\n finally {\n try {\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\n }\n finally { if (e) throw e.error; }\n }\n return ar;\n}\n\n/** @deprecated */\nexport function __spread() {\n for (var ar = [], i = 0; i < arguments.length; i++)\n ar = ar.concat(__read(arguments[i]));\n return ar;\n}\n\n/** @deprecated */\nexport function __spreadArrays() {\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\n r[k] = a[j];\n return r;\n}\n\nexport function __spreadArray(to, from, pack) {\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\n if (ar || !(i in from)) {\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\n ar[i] = from[i];\n }\n }\n return to.concat(ar || Array.prototype.slice.call(from));\n}\n\nexport function __await(v) {\n return this instanceof __await ? (this.v = v, this) : new __await(v);\n}\n\nexport function __asyncGenerator(thisArg, _arguments, generator) {\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\n return i = Object.create((typeof AsyncIterator === \"function\" ? AsyncIterator : Object).prototype), verb(\"next\"), verb(\"throw\"), verb(\"return\", awaitReturn), i[Symbol.asyncIterator] = function () { return this; }, i;\n function awaitReturn(f) { return function (v) { return Promise.resolve(v).then(f, reject); }; }\n function verb(n, f) { if (g[n]) { i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; if (f) i[n] = f(i[n]); } }\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\n function fulfill(value) { resume(\"next\", value); }\n function reject(value) { resume(\"throw\", value); }\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\n}\n\nexport function __asyncDelegator(o) {\n var i, p;\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: false } : f ? f(v) : v; } : f; }\n}\n\nexport function __asyncValues(o) {\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\n var m = o[Symbol.asyncIterator], i;\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\n}\n\nexport function __makeTemplateObject(cooked, raw) {\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\n return cooked;\n};\n\nvar __setModuleDefault = Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n};\n\nvar ownKeys = function(o) {\n ownKeys = Object.getOwnPropertyNames || function (o) {\n var ar = [];\n for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;\n return ar;\n };\n return ownKeys(o);\n};\n\nexport function __importStar(mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== \"default\") __createBinding(result, mod, k[i]);\n __setModuleDefault(result, mod);\n return result;\n}\n\nexport function __importDefault(mod) {\n return (mod && mod.__esModule) ? mod : { default: mod };\n}\n\nexport function __classPrivateFieldGet(receiver, state, kind, f) {\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a getter\");\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot read private member from an object whose class did not declare it\");\n return kind === \"m\" ? f : kind === \"a\" ? f.call(receiver) : f ? f.value : state.get(receiver);\n}\n\nexport function __classPrivateFieldSet(receiver, state, value, kind, f) {\n if (kind === \"m\") throw new TypeError(\"Private method is not writable\");\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a setter\");\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot write private member to an object whose class did not declare it\");\n return (kind === \"a\" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;\n}\n\nexport function __classPrivateFieldIn(state, receiver) {\n if (receiver === null || (typeof receiver !== \"object\" && typeof receiver !== \"function\")) throw new TypeError(\"Cannot use 'in' operator on non-object\");\n return typeof state === \"function\" ? receiver === state : state.has(receiver);\n}\n\nexport function __addDisposableResource(env, value, async) {\n if (value !== null && value !== void 0) {\n if (typeof value !== \"object\" && typeof value !== \"function\") throw new TypeError(\"Object expected.\");\n var dispose, inner;\n if (async) {\n if (!Symbol.asyncDispose) throw new TypeError(\"Symbol.asyncDispose is not defined.\");\n dispose = value[Symbol.asyncDispose];\n }\n if (dispose === void 0) {\n if (!Symbol.dispose) throw new TypeError(\"Symbol.dispose is not defined.\");\n dispose = value[Symbol.dispose];\n if (async) inner = dispose;\n }\n if (typeof dispose !== \"function\") throw new TypeError(\"Object not disposable.\");\n if (inner) dispose = function() { try { inner.call(this); } catch (e) { return Promise.reject(e); } };\n env.stack.push({ value: value, dispose: dispose, async: async });\n }\n else if (async) {\n env.stack.push({ async: true });\n }\n return value;\n}\n\nvar _SuppressedError = typeof SuppressedError === \"function\" ? SuppressedError : function (error, suppressed, message) {\n var e = new Error(message);\n return e.name = \"SuppressedError\", e.error = error, e.suppressed = suppressed, e;\n};\n\nexport function __disposeResources(env) {\n function fail(e) {\n env.error = env.hasError ? new _SuppressedError(e, env.error, \"An error was suppressed during disposal.\") : e;\n env.hasError = true;\n }\n var r, s = 0;\n function next() {\n while (r = env.stack.pop()) {\n try {\n if (!r.async && s === 1) return s = 0, env.stack.push(r), Promise.resolve().then(next);\n if (r.dispose) {\n var result = r.dispose.call(r.value);\n if (r.async) return s |= 2, Promise.resolve(result).then(next, function(e) { fail(e); return next(); });\n }\n else s |= 1;\n }\n catch (e) {\n fail(e);\n }\n }\n if (s === 1) return env.hasError ? Promise.reject(env.error) : Promise.resolve();\n if (env.hasError) throw env.error;\n }\n return next();\n}\n\nexport function __rewriteRelativeImportExtension(path, preserveJsx) {\n if (typeof path === \"string\" && /^\\.\\.?\\//.test(path)) {\n return path.replace(/\\.(tsx)$|((?:\\.d)?)((?:\\.[^./]+?)?)\\.([cm]?)ts$/i, function (m, tsx, d, ext, cm) {\n return tsx ? preserveJsx ? \".jsx\" : \".js\" : d && (!ext || !cm) ? m : (d + ext + \".\" + cm.toLowerCase() + \"js\");\n });\n }\n return path;\n}\n\nexport default {\n __extends,\n __assign,\n __rest,\n __decorate,\n __param,\n __esDecorate,\n __runInitializers,\n __propKey,\n __setFunctionName,\n __metadata,\n __awaiter,\n __generator,\n __createBinding,\n __exportStar,\n __values,\n __read,\n __spread,\n __spreadArrays,\n __spreadArray,\n __await,\n __asyncGenerator,\n __asyncDelegator,\n __asyncValues,\n __makeTemplateObject,\n __importStar,\n __importDefault,\n __classPrivateFieldGet,\n __classPrivateFieldSet,\n __classPrivateFieldIn,\n __addDisposableResource,\n __disposeResources,\n __rewriteRelativeImportExtension,\n};\n","function _array_like_to_array(arr, len) {\n if (len == null || len > arr.length) len = arr.length;\n\n for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];\n\n return arr2;\n}\nexport { _array_like_to_array as _ };\n","import { _ as _unsupported_iterable_to_array } from \"./_unsupported_iterable_to_array.js\";\n\nfunction _create_for_of_iterator_helper_loose(o, allowArrayLike) {\n var it = typeof Symbol !== \"undefined\" && o[Symbol.iterator] || o[\"@@iterator\"];\n\n if (it) return (it = it.call(o)).next.bind(it);\n // Fallback for engines without symbol support\n if (Array.isArray(o) || (it = _unsupported_iterable_to_array(o)) || allowArrayLike && o && typeof o.length === \"number\") {\n if (it) o = it;\n\n var i = 0;\n\n return function() {\n if (i >= o.length) return { done: true };\n\n return { done: false, value: o[i++] };\n };\n }\n\n throw new TypeError(\"Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\");\n}\nexport { _create_for_of_iterator_helper_loose as _ };\n","import { _ as _array_like_to_array } from \"./_array_like_to_array.js\";\n\nfunction _unsupported_iterable_to_array(o, minLen) {\n if (!o) return;\n if (typeof o === \"string\") return _array_like_to_array(o, minLen);\n\n var n = Object.prototype.toString.call(o).slice(8, -1);\n\n if (n === \"Object\" && o.constructor) n = o.constructor.name;\n if (n === \"Map\" || n === \"Set\") return Array.from(n);\n if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array(o, minLen);\n}\nexport { _unsupported_iterable_to_array as _ };\n","/**\n * 部分手机厂商和 iPhone 机型列表\n */\nexport const infoList = {\n vender: [\n 'SAMSUNG',\n ],\n iPhone: [\n { name: 'iPhone 15 Pro Max', model: 'iPhone16,2', width: 1290, height: 2796 },\n { name: 'iPhone 15 Pro', model: 'iPhone16,1', width: 1179, height: 2556 },\n { name: 'iPhone 15 Plus', model: 'iPhone15,5', width: 1290, height: 2796 },\n { name: 'iPhone 15', model: 'iPhone15,4', width: 1179, height: 2556 },\n { name: 'iPhone 14 Pro Max', model: 'iPhone15,3', width: 1290, height: 2796 },\n { name: 'iPhone 14 Pro', model: 'iPhone15,2', width: 1179, height: 2556 },\n { name: 'iPhone 14 Plus', model: 'iPhone14,8', width: 1284, height: 2778 },\n { name: 'iPhone 14', model: 'iPhone14,7', width: 1170, height: 2532 },\n { name: 'iPhone 13 Pro Max', model: 'iPhone14,3', width: 1284, height: 2778 },\n { name: 'iPhone 13 Pro', model: 'iPhone14,2', width: 1170, height: 2532 },\n { name: 'iPhone 13', model: 'iPhone14,5', width: 1170, height: 2532 },\n { name: 'iPhone 13 mini', model: 'iPhone14,4', width: 1080, height: 2340 },\n { name: 'iPhone SE (3rd gen)', model: 'iPhone14,6', width: 750, height: 1334 },\n { name: 'iPhone 12 Pro Max', model: 'iPhone13,4', width: 1284, height: 2778 },\n { name: 'iPhone 12 Pro', model: 'iPhone13,3', width: 1170, height: 2532 },\n { name: 'iPhone 12', model: 'iPhone13,2', width: 1170, height: 2532 },\n { name: 'iPhone 12 mini', model: 'iPhone13,1', width: 1080, height: 2340 },\n { name: 'iPhone 11 Pro Max', model: 'iPhone12,5', width: 1242, height: 2688 },\n { name: 'iPhone 11 Pro', model: 'iPhone12,3', width: 1125, height: 2436 },\n { name: 'iPhone 11', model: 'iPhone12,1', width: 828, height: 1792 },\n { name: 'iPhone SE (2nd gen)', model: 'iPhone12,8', width: 750, height: 1334 },\n { name: 'iPhone XR', model: 'iPhone11,8', width: 828, height: 1792 },\n { name: 'iPhone XS Max', model: 'iPhone11,6', width: 1242, height: 2688 },\n { name: 'iPhone XS', model: 'iPhone11,2', width: 1125, height: 2436 },\n { name: 'iPhone X', model: 'iPhone10,3', width: 1125, height: 2436 },\n { name: 'iPhone 8 Plus', model: 'iPhone10,2', width: 1080, height: 1920 },\n { name: 'iPhone 8', model: 'iPhone10,1', width: 750, height: 1334 },\n { name: 'iPhone 7 Plus', model: 'iPhone9,2', width: 1080, height: 1920 },\n { name: 'iPhone 7', model: 'iPhone9,1', width: 750, height: 1334 },\n { name: 'iPhone 6s Plus', model: 'iPhone8,2', width: 1080, height: 1920 },\n { name: 'iPhone 6s', model: 'iPhone8,1', width: 750, height: 1334 },\n { name: 'iPhone SE (1st gen)', model: 'iPhone8,4', width: 640, height: 1136 },\n { name: 'iPhone 6 Plus', model: 'iPhone7,1', width: 1080, height: 1920 },\n { name: 'iPhone 6', model: 'iPhone7,2', width: 750, height: 1334 },\n { name: 'iPhone 5C', model: 'iPhone5,3', width: 640, height: 1136 },\n { name: 'iPhone 5S', model: 'iPhone6,1', width: 640, height: 1136 },\n { name: 'iPhone 5', model: 'iPhone5,1', width: 640, height: 1136 },\n { name: 'iPhone 4S', model: 'iPhone4,1', width: 640, height: 960 },\n { name: 'iPhone 4', model: 'iPhone3,1', width: 640, height: 960 },\n { name: 'iPhone 3GS', model: 'iPhone2,1', width: 320, height: 480 },\n { name: 'iPhone 3G', model: 'iPhone1,2', width: 320, height: 480 },\n { name: 'iPhone 1st gen', model: 'iPhone1,1', width: 320, height: 480 },\n ],\n};\n\n/**\n * 被降级的硬件机型列表\n */\nexport const downgradeModels = {\n android: [\n 'OPPO R9s Plus',\n 'GM1910',\n 'V1824A',\n 'V1916A', // checked\n 'SM-G9650', // checked\n 'V1936A',\n 'MI9 PRO 5G', // checked\n 'REDMI K20',\n 'V1914A',\n 'GM1900',\n 'RMX1971',\n 'SM-A6060',\n 'SM-G9600', // checked\n 'V1922A',\n 'PBAM00', // checked\n 'PCAM10', // checked\n 'PACT00', // checked\n 'PBBM00',\n 'PCEM00',\n 'V1818A', // checked\n 'vivo X6A',\n 'vivo X6Plus A',\n ],\n iPhone: [\n 'iPhone8,4',\n 'iPhone8,2',\n 'iPhone8,1',\n 'iPhone7,2',\n 'iPhone7,1',\n 'iPhone6,2',\n 'iPhone6,1',\n 'iPhone5,4',\n 'iPhone5,3',\n 'iPhone5,2',\n 'iPhone5,1',\n 'iPhone4,3',\n 'iPhone4,2',\n 'iPhone4,1',\n 'iPhone3,3',\n 'iPhone3,2',\n 'iPhone3,1',\n 'iPhone2,1',\n 'iPhone1,2',\n 'iPhone1,1',\n ],\n};\n\n/**\n * 被降级的系统版本列表\n */\nexport const downgradeVersions = {\n android: [],\n iOS: [\n '16.7',\n '16.7.1',\n '16.7.2',\n '16.7.3',\n '16.7.4',\n '16.7.5',\n '16.7.6',\n ],\n};\n\n/**\n * 微信开发环境机型名称替换表\n */\nexport const devtoolNameMap: Record<string, Record<string, string>> = {\n wechat: {\n 'iPhone 6/7/8': 'iPhone 8',\n 'iPhone 6/7/8 Plus': 'iPhone 8 Plus',\n 'iPhone 12/13 mini': 'iPhone 13 mini',\n 'iPhone 12/13 (Pro)': 'iPhone 13 Pro',\n 'iPhone 12/13 Pro Max': 'iPhone 13 Pro Max',\n },\n};\n","import type { SceneRenderLevel } from '@galacean/effects';\n\n/**\n * 降级接口入参\n */\nexport interface DowngradeOptions {\n /**\n * 指定设备渲染等级,如果没有设置,会根据设备信息自动计算\n */\n level?: SceneRenderLevel,\n /**\n * 禁用压后台的时候自动暂停播放器\n * @default false - 不自动暂停\n */\n autoPause?: boolean,\n /**\n * 在小程序环境下,是否自动通过原生API查询设备信息\n * @default false - 不自动查询\n */\n queryDeviceInMiniApp?: boolean,\n /**\n * 设备信息,可以外部传入\n */\n deviceInfo?: DeviceInfo,\n /**\n * 是否 mock 降级\n * - true:mock 降级\n * - false: mock 不降级\n * - undefined: 不进行 mock, 用设备信息判断降级\n */\n mockDowngrade?: boolean,\n /**\n * 自定义降级回调,可针对特定机型配置特定的降级规则\n */\n downgradeCallback?: DowngradeCallback,\n}\n\n/**\n * 降级结果\n */\nexport interface DowngradeResult {\n /**\n * 是否降级\n */\n downgrade: boolean,\n /**\n * 渲染等级\n */\n level: SceneRenderLevel,\n /**\n * 降级原因\n */\n reason: string,\n /**\n * 设备信息\n */\n deviceInfo?: DeviceInfo,\n}\n\n/**\n * 设备信息\n */\nexport interface DeviceInfo {\n /**\n * 平台信息\n */\n platform?: string,\n /**\n * 系统版本\n */\n osVersion?: string,\n /**\n * 硬件机型(处理过)\n */\n model?: string,\n /**\n * 原始硬件机型\n */\n originalModel?: string,\n /**\n * 设备等级\n */\n level?: DeviceLevel,\n /**\n * 内存大小\n */\n memoryMB?: number,\n /**\n * 数据来源\n */\n sourceData?: any,\n}\n\n/**\n * 降级回调接口,可以自定义降级结果\n */\nexport type DowngradeCallback = (device: DeviceInfo) => DowngradeResult | undefined;\n\n/**\n * 微信设备信息,来自微信 JSAPI 返回的结果\n */\nexport interface WechatDeviceInfo {\n /**\n * 设备性能等级(仅 Android 支持)。\n * 取值为:\n * -2 或 0(该设备无法运行小游戏)\n * -1(性能未知)\n * >=1(设备性能值,该值越高,设备性能越好,目前最高不到50)\n */\n benchmarkLevel: number,\n /**\n * 设备品牌\n */\n brand: string,\n /**\n * 设备型号。新机型刚推出一段时间会显示unknown,微信会尽快进行适配。\n */\n model: string,\n /**\n * 操作系统及版本\n */\n system: string,\n /**\n * 客户端平台\n */\n platform: string,\n /**\n * 设备 CPU 型号(仅 Android 支持)\n */\n cpuType?: string,\n /**\n * 设备内存大小,单位为 MB\n */\n memorySize: number,\n}\n\n/**\n * 支付宝系统信息,来自支付宝 JSAPI 返回的结果\n */\nexport interface AlipaySystemInfo {\n /**\n * high: 高性能。Android 设备运行内存大于等于 4GB\n * middle: 性能中等。Android 设备运行内存大于等于 3GB 且 CPU 核心数大于 4\n * low: 性能较弱\n * unknown: 无法识别\n */\n performance?: string,\n /**\n * 手机品牌\n */\n brand?: string,\n /**\n * 手机型号。具体可参考 https://opendocs.alipay.com/mini/072v9s\n */\n model?: string,\n /**\n * 系统版本\n */\n system?: string,\n /**\n * 客户端平台:Android,iOS / iPhone OS,Harmony\n */\n platform?: string,\n}\n\n/**\n * UserAgent 的产品信息\n */\nexport interface ProductInfo {\n name: string,\n comment?: string,\n}\n\n/**\n * iPhone 机型信息\n */\nexport interface IPhoneInfo {\n name: string,\n model: string,\n width: number,\n height: number,\n}\n\n/**\n * 设备等级\n */\nexport enum DeviceLevel {\n High = 'high',\n Medium = 'medium',\n Low = 'low',\n Unknown = 'unknown',\n}\n","import { infoList } from './constants';\nimport type { DeviceInfo, ProductInfo } from './types';\nimport { DeviceLevel } from './types';\n\n/**\n * UserAgent 解析类\n *\n * 从 UserAgent 中解析出设备相关的信息,但是能获取的信息有限。\n */\nexport class UADecoder {\n device: DeviceInfo = {};\n\n constructor (userAgent?: string) {\n this.parse(userAgent ?? navigator.userAgent);\n }\n\n getDeviceInfo () {\n return this.device;\n }\n\n isIOS () {\n return this.device.platform === 'iOS';\n }\n\n isAndroid () {\n return this.device.platform === 'Android';\n }\n\n isHarmony () {\n return this.device.platform === 'Harmony';\n }\n\n isWindows () {\n return this.device.platform === 'Windows';\n }\n\n isMacintosh () {\n return this.device.platform === 'Macintosh';\n }\n\n isMobile () {\n return this.isIOS() || this.isAndroid() || this.isHarmony();\n }\n\n private parse (ua: string) {\n const pattern = /(\\w+\\/[\\w.]+)(\\s+\\([^)]+\\))?/g;\n const productInfos: ProductInfo[] = [];\n let match;\n\n while ((match = pattern.exec(ua)) !== null) {\n const name = match[1];\n const comment = match[2]?.trim();\n\n productInfos.push({ name, comment });\n }\n\n for (const productInfo of productInfos) {\n const { name, comment } = productInfo;\n\n if (name?.startsWith('Mozilla/')) {\n if (comment) {\n this.parseData(comment);\n }\n\n break;\n }\n }\n\n this.device.level = this.estimateDeviceLevel();\n this.device.sourceData = ua;\n }\n\n private parseData (data: string) {\n if (data.length && data[0] === '(') {\n data = data.substring(1);\n }\n\n if (data.length && data[data.length - 1] == ')') {\n data = data.substring(0, data.length - 1);\n }\n if (this.testIPhone(data)) {\n this.device.platform = 'iOS';\n this.device.osVersion = this.parseIOSVersion(data);\n this.device.model = this.getIPhoneModel();\n } else if (this.testIPad(data)) {\n this.device.platform = 'iOS';\n this.device.osVersion = this.parseIOSVersion(data);\n this.device.model = 'iPad';\n } else if (this.testMacintosh(data)) {\n this.device.platform = 'Mac OS';\n this.device.osVersion = this.parseMacOSVersion(data);\n } else if (this.testAndroid(data)) {\n this.device.platform = 'Android';\n this.device.osVersion = this.parseAndroidVersion(data);\n this.device.model = this.parseAndroidModel(data);\n } else if (this.testWindows(data)) {\n this.device.platform = 'Windows';\n this.device.osVersion = this.parseWindowsVersion(data);\n } else {\n console.error(`Unknown info: ${data}.`);\n }\n }\n\n private estimateDeviceLevel () {\n if (this.isIOS()) {\n if (this.device.osVersion) {\n const osVersion = parseInt(this.device.osVersion.split('.')[0]);\n\n if (osVersion < 12) {\n return DeviceLevel.Low;\n } else if (osVersion < 16) {\n return DeviceLevel.Medium;\n } else {\n return DeviceLevel.High;\n }\n } else {\n return DeviceLevel.Low;\n }\n }\n if (this.isAndroid()) {\n if (this.device.osVersion) {\n const osVersion = parseInt(this.device.osVersion.split('.')[0]);\n\n if (osVersion < 10) {\n return DeviceLevel.Low;\n } else if (osVersion < 12) {\n return DeviceLevel.Medium;\n } else {\n return DeviceLevel.High;\n }\n } else {\n return DeviceLevel.Low;\n }\n }\n\n return DeviceLevel.High;\n }\n\n private parseIOSVersion (data: string) {\n const pattern = /OS (\\d+)(?:_(\\d+))?_(\\d+)/;\n const match = data.match(pattern);\n\n if (match) {\n const versionList: string[] = [];\n\n for (let i = 1; i <= 3; i++) {\n if (match[i]) {\n versionList.push(match[i]);\n }\n }\n\n return versionList.join('.');\n }\n }\n\n private getIPhoneModel () {\n const screenWidth = window.screen.width * window.devicePixelRatio;\n const screenHeight = window.screen.height * window.devicePixelRatio;\n const match = infoList.iPhone.find(m => m.width === screenWidth && m.height === screenHeight);\n\n return match?.model ?? 'iPhone';\n }\n\n private parseAndroidVersion (data: string) {\n const pattern = /Android ([\\d.]+);/;\n const match = data.match(pattern);\n\n if (match && match.length >= 2) {\n return match[1];\n }\n }\n\n private parseAndroidModel (data: string) {\n const itemList = data.split(';');\n let lastItem;\n\n for (const item of itemList) {\n const modelPattern = /(.+?) Build/;\n const modelMatch = item.match(modelPattern);\n\n if (modelMatch && modelMatch.length >= 2) {\n return modelMatch[1].trim();\n }\n\n if (item.includes('HMSCore') && lastItem) {\n return lastItem.trim();\n }\n\n lastItem = item;\n }\n\n if (itemList.length > 0) {\n const lastItem = itemList[itemList.length - 1].trim();\n\n for (const vender of infoList.vender) {\n if (lastItem.startsWith(vender)) {\n return lastItem.substring(vender.length).trim();\n }\n }\n }\n\n if (itemList.length == 3) {\n return itemList[itemList.length - 1].trim();\n } else if (itemList.length === 4) {\n const len = itemList.length;\n\n if (itemList[len - 1].trim() === 'wv') {\n return itemList[len - 2].trim();\n }\n }\n }\n\n private parseWindowsVersion (data: string) {\n const pattern = /Windows NT ([\\d.]+);/;\n const match = data.match(pattern);\n\n if (match && match.length >= 2) {\n return match[1];\n }\n }\n\n private parseMacOSVersion (data: string) {\n const pattern = /OS X (\\d+)(?:_(\\d+))?_(\\d+)/;\n const match = data.match(pattern);\n\n if (match) {\n const versionList: string[] = [];\n\n for (let i = 1; i <= 3; i++) {\n if (match[i]) {\n versionList.push(match[i]);\n }\n }\n\n return versionList.join('.');\n }\n }\n\n private testIPhone (data: string) {\n return data.includes('iPhone');\n }\n\n private testIPad (data: string) {\n return data.includes('iPad');\n }\n\n private testAndroid (data: string) {\n return data.includes('Android');\n }\n\n private testMacintosh (data: string) {\n return data.includes('Macintosh');\n }\n\n private testWindows (data: string) {\n return data.includes('Windows');\n }\n}\n","import type { AlipaySystemInfo, DeviceInfo } from '../types';\nimport { DeviceLevel } from '../types';\n\n/**\n * 支付宝小程序系统信息解析类\n *\n * 负责解析支付宝小程序 JSAPI 返回的系统信息\n */\nexport class AlipayMiniprogramParser {\n device: DeviceInfo = {};\n\n constructor (info: AlipaySystemInfo) {\n this.parse(info);\n }\n\n getDeviceInfo () {\n return this.device;\n }\n\n private parse (info: AlipaySystemInfo) {\n this.device.platform = info.platform;\n this.device.osVersion = info.system;\n this.device.originalModel = info.model;\n this.device.model = this.getDeviceModel(info.model);\n this.device.level = this.getDeviceLevel(info.performance);\n this.device.sourceData = info;\n }\n\n private getDeviceModel (model?: string) {\n if (model) {\n const brandList = ['Huawei', 'Xiaomi', 'samsung', 'vivo', 'OPPO'];\n const brand = brandList.find(b => (model ?? '').toLowerCase().startsWith(b.toLowerCase()));\n\n if (brand) {\n return model?.substring(brand.length).trim();\n }\n }\n\n return model;\n }\n\n private getDeviceLevel (level = ''): DeviceLevel {\n const levelMap: Record<string, DeviceLevel> = {\n 'high': DeviceLevel.High,\n 'medium': DeviceLevel.Medium,\n 'middle': DeviceLevel.Medium,\n 'low': DeviceLevel.Low,\n };\n\n return levelMap[level] || DeviceLevel.Unknown;\n }\n}\n","import { infoList, devtoolNameMap } from '../constants';\nimport type { DeviceInfo, WechatDeviceInfo } from '../types';\nimport { DeviceLevel } from '../types';\n\n/**\n * 微信小程序设备信息解析类\n *\n * 负责解析微信小程序 JSAPI 返回的设备信息\n */\nexport class WechatMiniprogramParser {\n device: DeviceInfo = {};\n\n constructor (info: WechatDeviceInfo) {\n this.parse(info);\n }\n\n getDeviceInfo () {\n return this.device;\n }\n\n private parse (info: WechatDeviceInfo) {\n const osNameMatch = info.system.match(/\\w+/);\n\n if (osNameMatch) {\n this.device.platform = osNameMatch[0].trim();\n }\n\n const osVersionMatch = info.system.match(/[\\d.]+/);\n\n if (osVersionMatch) {\n this.device.osVersion = osVersionMatch[0].trim();\n }\n\n if (info.platform === 'devtools') {\n const phoneName = devtoolNameMap.wechat[info.model] ?? info.model;\n\n for (const data of infoList.iPhone) {\n if (data.name === phoneName) {\n info.model = data.model;\n\n break;\n }\n }\n }\n\n if (this.device.platform === 'iOS') {\n const modelMatch = info.model.match(/^(.*?)<(.*?)>$/);\n\n if (modelMatch) {\n this.device.model = modelMatch[2].trim();\n this.device.originalModel = info.model;\n } else {\n this.device.model = info.model;\n }\n } else {\n this.device.model = info.model;\n }\n\n if (info.benchmarkLevel <= 0) {\n this.device.level = DeviceLevel.Unknown;\n } else if (info.benchmarkLevel <= 10) {\n this.device.level = DeviceLevel.Low;\n } else if (info.benchmarkLevel <= 20) {\n this.device.level = DeviceLevel.Medium;\n } else {\n this.device.level = DeviceLevel.High;\n }\n\n this.device.memoryMB = info.memorySize;\n this.device.sourceData = info;\n }\n}\n","import { spec, type SceneRenderLevel } from '@galacean/effects';\nimport { DeviceLevel, type DeviceInfo, type DowngradeOptions, type DowngradeResult } from './types';\nimport { downgradeModels, downgradeVersions } from './constants';\n\n/**\n * 降级判断类\n *\n * 通过设备信息和降级选项判断设备是否需要降级\n */\nexport class DowngradeJudge {\n isIOS = false;\n level: SceneRenderLevel;\n\n constructor (\n public options: DowngradeOptions,\n public device: DeviceInfo,\n ) { }\n\n /**\n * 根据输入的设备信息和降级选项,以及内置的硬件机型和系统版本降级列表\n * 返回当前设备降级相关的结果\n *\n * @returns 降级结果\n */\n getDowngradeResult (): DowngradeResult {\n const { downgradeCallback } = this.options;\n\n if (downgradeCallback) {\n const result = downgradeCallback(this.device);\n\n if (result) {\n if (!result.reason) {\n result.reason = 'downgradeCallback';\n }\n\n return result;\n }\n }\n\n this.isIOS = this.device.platform === 'iOS';\n this.level = this.getRenderLevel();\n\n if (this.device.model) {\n const deviceModel = this.device.model.toLowerCase();\n const modelList = this.isIOS ? downgradeModels.iPhone : downgradeModels.android;\n const findModel = modelList.find(m => {\n const testModel = m.toLowerCase();\n\n if (this.isIOS) {\n return testModel === deviceModel;\n } else {\n return testModel.includes(deviceModel) || deviceModel.includes(testModel);\n }\n });\n\n if (findModel !== undefined) {\n return {\n downgrade: true,\n level: this.level,\n reason: 'Downgrade by model list',\n deviceInfo: this.device,\n };\n }\n }\n\n const osVersionList = this.isIOS ? downgradeVersions.iOS : downgradeVersions.android;\n const findOS = osVersionList.find(v => v === this.device.osVersion);\n\n if (findOS !== undefined) {\n return {\n downgrade: true,\n level: this.level,\n reason: 'Downgrade by OS version list',\n deviceInfo: this.device,\n };\n }\n\n return {\n downgrade: false,\n level: this.level,\n reason: '',\n deviceInfo: this.device,\n };\n }\n\n private getRenderLevel (): SceneRenderLevel {\n if (this.options.level) {\n return this.options.level;\n }\n\n if (this.device.level) {\n if (this.device.level === DeviceLevel.High) {\n return spec.RenderLevel.S;\n } else if (this.device.level === DeviceLevel.Medium) {\n return spec.RenderLevel.A;\n } else if (this.device.level === DeviceLevel.Low) {\n return spec.RenderLevel.B;\n }\n }\n\n if (this.isIOS && this.device.model) {\n if (/iPhone(\\d+),/.test(this.device.model)) {\n const gen = +RegExp.$1;\n\n if (gen <= 9) {\n return spec.RenderLevel.B;\n } else if (gen < 10) {\n return spec.RenderLevel.A;\n } else {\n return spec.RenderLevel.S;\n }\n }\n }\n\n if (this.device.memoryMB) {\n if (this.device.memoryMB < 4000) {\n return spec.RenderLevel.B;\n } else if (this.device.memoryMB < 6000) {\n return spec.RenderLevel.A;\n } else {\n return spec.RenderLevel.S;\n }\n }\n\n return this.isIOS ? spec.RenderLevel.S : spec.RenderLevel.B;\n }\n}\n","import { isIOS, isWechatMiniApp } from '@galacean/effects';\nimport { spec, getActivePlayers, logger, isAlipayMiniApp } from '@galacean/effects';\nimport type { AlipaySystemInfo, DowngradeOptions, DowngradeResult } from './types';\nimport { UADecoder } from './ua-decoder';\nimport { AlipayMiniprogramParser, WechatMiniprogramParser } from './parser';\nimport { DowngradeJudge } from './downgrade-judge';\n\nconst internalPaused = Symbol('@@_inter_pause');\nlet hasRegisterEvent = false;\n\n/**\n * 获取 GE 降级结果,不需要创建 Canvas 和 WebGL 环境。\n * 如果是小程序环境下,要确保 JSAPI 可调用\n *\n * @param options - 降级选项\n * @returns 降级结果\n */\nexport function getDowngradeResult (options: DowngradeOptions = {}): DowngradeResult {\n if (!hasRegisterEvent) {\n registerEvent(options);\n hasRegisterEvent = true;\n }\n\n const { mockDowngrade } = options;\n\n if (mockDowngrade !== undefined) {\n return {\n downgrade: mockDowngrade,\n level: options.level ?? spec.RenderLevel.S,\n reason: 'mock',\n };\n }\n\n const device = getDeviceInfo(options);\n const judge = new DowngradeJudge(options, device);\n\n return judge.getDowngradeResult();\n}\n\nfunction registerEvent (options: DowngradeOptions) {\n const { autoPause } = options;\n\n window.addEventListener('unload', () => {\n getActivePlayers().forEach(player => player.dispose());\n });\n\n if (autoPause) {\n document.addEventListener('pause', pauseAllActivePlayers);\n document.addEventListener('resume', resumePausedPlayers);\n }\n}\n\nfunction getDeviceInfo (options: DowngradeOptions) {\n const { queryDeviceInMiniApp, deviceInfo } = options;\n\n if (deviceInfo) {\n return deviceInfo;\n }\n\n if (queryDeviceInMiniApp) {\n if (isAlipayMiniApp()) {\n // 支付宝小程序\n if (my.canIUse('getSystemInfo')) {\n // https://opendocs.alipay.com/mini/api/system-info\n const info = my.getSystemInfo() as AlipaySystemInfo;\n const parser = new AlipayMiniprogramParser(info);\n\n return parser.getDeviceInfo();\n } else {\n logger.error('Can\\'t use getSystemInfo in Alipay MiniProgram.');\n }\n }\n if (isWechatMiniApp()) {\n // 微信小程序\n // @ts-expect-error\n if (wx.canIUse('getDeviceInfo')) {\n // https://developers.weixin.qq.com/miniprogram/dev/api/base/system/wx.getDeviceInfo.html\n // @ts-expect-error\n const info = wx.getDeviceInfo() as WechatDeviceInfo;\n const parser = new WechatMiniprogramParser(info);\n\n return parser.getDeviceInfo();\n } else {\n logger.error('Can\\'t use getDeviceInfo in WeChat MiniProgram.');\n }\n } else {\n logger.error('Non-mini program environment and try to get device info from user agent.');\n }\n }\n\n return new UADecoder().getDeviceInfo();\n}\n\n/**\n * 获取默认渲染等级\n *\n * @returns 渲染等级\n */\nexport function getDefaultRenderLevel () {\n return isIOS() ? spec.RenderLevel.S : spec.RenderLevel.B;\n}\n\nfunction pauseAllActivePlayers (e: Event) {\n if (e.target === document) {\n logger.info('Auto pause all players with data offloaded.');\n const players = getActivePlayers();\n\n players.forEach(player => {\n if (!player.paused) {\n player.pause({ offloadTexture: true });\n // @ts-expect-error\n player[internalPaused] = true;\n }\n });\n }\n}\n\nfunction resumePausedPlayers (e: Event) {\n if (e.target === document) {\n logger.info('Auto resume all players.');\n const players = getActivePlayers();\n\n players.forEach(player => {\n // @ts-expect-error\n if (player[internalPaused]) {\n void player.resume();\n // @ts-expect-error\n player[internalPaused] = false;\n }\n });\n }\n}\n","import type { SceneLoadOptions, spec } from '@galacean/effects';\nimport { AbstractPlugin, logger } from '@galacean/effects';\nimport { getDefaultRenderLevel } from './utils';\n\n/**\n * 降级插件类\n *\n * 根据 SceneLoadOptions 中传入的 downgrade 数据,判断是否降级。\n * 如果设备被降级,会在 processRawJSON 时抛出降级相关的异常和原因。\n *\n * 如果 SceneLoadOptions 中 renderLevel 没有设置,那么会根据 downgrade 数据\n * 和默认的渲染等级规则设置其中的 renderLevel 。\n */\nexport class DowngradePlugin extends AbstractPlugin {\n static override async processRawJSON (json: spec.JSONScene, options: SceneLoadOptions = {}) {\n const downgradeResult = options.pluginData?.['downgrade'];\n\n if (downgradeResult) {\n if (downgradeResult.downgrade) {\n throw new Error(`Downgraded, reason: ${downgradeResult.reason}`);\n }\n } else {\n logger.warn('No downgrade result in pluginData of SceneLoadOptions.');\n }\n\n if (!options.renderLevel) {\n options.renderLevel = downgradeResult?.level ?? getDefaultRenderLevel();\n }\n }\n}\n","import { _ as _set_prototype_of } from \"./_set_prototype_of.js\";\n\nfunction _inherits(subClass, superClass) {\n if (typeof superClass !== \"function\" && superClass !== null) {\n throw new TypeError(\"Super expression must either be null or a function\");\n }\n\n subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } });\n\n if (superClass) _set_prototype_of(subClass, superClass);\n}\nexport { _inherits as _ };\n","import * as EFFECTS from '@galacean/effects';\nimport { VFXItem, logger, registerPlugin } from '@galacean/effects';\nimport { DowngradePlugin } from './downgrade-plugin';\n\nexport * from './utils';\nexport * from './parser';\nexport * from './ua-decoder';\nexport * from './types';\n\n/**\n * 插件版本号\n */\nexport const version = __VERSION__;\n\nregisterPlugin('downgrade', DowngradePlugin, VFXItem);\n\nlogger.info(`Plugin downgrade version: ${version}.`);\n\nif (version !== EFFECTS.version) {\n console.error(\n '注意:请统一 Downgrade 插件与 Player 版本,不统一的版本混用会有不可预知的后果!',\n '\\nAttention: Please ensure the Downgrade plugin is synchronized with the Player version. Mixing and matching incompatible versions may result in unpredictable consequences!'\n );\n}\n"],"names":["asyncGeneratorStep","gen","resolve","reject","_next","_throw","key","arg","info","value","error","done","Promise","then","_set_prototype_of","o","p","Object","setPrototypeOf","__proto__","__generator","thisArg","body","f","y","t","_","label","sent","trys","ops","g","create","Iterator","prototype","next","verb","Symbol","iterator","this","n","v","op","TypeError","call","pop","length","push","e","step","_array_like_to_array","arr","len","i","arr2","Array","_create_for_of_iterator_helper_loose","allowArrayLike","it","bind","isArray","minLen","toString","slice","constructor","name","from","test","_unsupported_iterable_to_array","SuppressedError","DeviceLevel","infoList","vender","iPhone","model","width","height","downgradeModels","android","downgradeVersions","iOS","devtoolNameMap","wechat","UADecoder","userAgent","device","parse","navigator","getDeviceInfo","isIOS","platform","isAndroid","isHarmony","isWindows","isMacintosh","isMobile","_proto","ua","match","pattern","productInfos","exec","comment","trim","_step","_iterator","productInfo","startsWith","parseData","level","estimateDeviceLevel","sourceData","data","substring","testIPhone","osVersion","parseIOSVersion","getIPhoneModel","testIPad","testMacintosh","parseMacOSVersion","testAndroid","parseAndroidVersion","parseAndroidModel","testWindows","parseWindowsVersion","console","parseInt","split","Low","Medium","High","versionList","join","screenWidth","window","screen","devicePixelRatio","screenHeight","find","m","lastItem","itemList","item","modelMatch","includes","_step1","_iterator1","AlipayMiniprogramParser","system","originalModel","getDeviceModel","getDeviceLevel","performance","brand","b","toLowerCase","high","medium","middle","low","Unknown","WechatMiniprogramParser","osNameMatch","osVersionMatch","phoneName","benchmarkLevel","memoryMB","memorySize","DowngradeJudge","options","getDowngradeResult","downgradeCallback","result","reason","getRenderLevel","deviceModel","undefined","testModel","_this","downgrade","deviceInfo","spec","RenderLevel","S","A","B","RegExp","$1","internalPaused","hasRegisterEvent","getDefaultRenderLevel","pauseAllActivePlayers","target","document","logger","getActivePlayers","forEach","player","paused","pause","offloadTexture","resumePausedPlayers","resume","DowngradePlugin","AbstractPlugin","subClass","superClass","writable","configurable","processRawJSON","json","fn","downgradeResult","pluginData","Error","warn","renderLevel","self","args","arguments","apply","err","version","registerPlugin","VFXItem","EFFECTS","autoPause","addEventListener","dispose","registerEvent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EAAfW,WAE9B,GAAIA,EACF,OAAOA,EAGT,GAAImD,EAAsB,CACxB,GAAIC,EAAmBA,kBAAA,CAErB,GAAIC,GAAGC,QAAQ,iBAAkB,CAE/B,IAAMnO,EAAOkO,GAAGE,gBAGhB,OAFe,IAAIxF,EAAwB5I,GAE7BgF,gBAEd2G,SAAOzL,MAAM,iDAEjB,CACA,GAAImO,EAAmBA,kBAAA,CAGrB,GAAIC,GAAGH,QAAQ,iBAAkB,CAG/B,IAAMnO,EAAOsO,GAAGtJ,gBAGhB,OAFe,IAAI0E,EAAwB1J,GAE7BgF,gBAEd2G,SAAOzL,MAAM,uDAGfyL,SAAOzL,MAAM,2EAEjB,CAEA,OAAO,IAAIyE,GAAYK,eACzB,CA1DiBA,CAAckF,GAG7B,OAFc,IAAID,EAAeC,EAASrF,GAE7BsF,oBACf"}
|
|
1
|
+
{"version":3,"file":"alipay.js","sources":["../../../node_modules/.pnpm/@swc+helpers@0.5.15/node_modules/@swc/helpers/esm/_async_to_generator.js","../../../node_modules/.pnpm/@swc+helpers@0.5.15/node_modules/@swc/helpers/esm/_set_prototype_of.js","../../../node_modules/.pnpm/tslib@2.8.1/node_modules/tslib/tslib.es6.mjs","../../../node_modules/.pnpm/@swc+helpers@0.5.15/node_modules/@swc/helpers/esm/_array_like_to_array.js","../../../node_modules/.pnpm/@swc+helpers@0.5.15/node_modules/@swc/helpers/esm/_create_for_of_iterator_helper_loose.js","../../../node_modules/.pnpm/@swc+helpers@0.5.15/node_modules/@swc/helpers/esm/_unsupported_iterable_to_array.js","../src/constants.ts","../src/types.ts","../src/ua-decoder.ts","../src/parser/alipay-miniprogram-parser.ts","../src/parser/wechat-miniprogram-parser.ts","../src/downgrade-judge.ts","../src/utils.ts","../src/downgrade-plugin.ts","../../../node_modules/.pnpm/@swc+helpers@0.5.15/node_modules/@swc/helpers/esm/_inherits.js","../src/index.ts"],"sourcesContent":["function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {\n try {\n var info = gen[key](arg);\n var value = info.value;\n } catch (error) {\n reject(error);\n return;\n }\n if (info.done) resolve(value);\n else Promise.resolve(value).then(_next, _throw);\n}\nfunction _async_to_generator(fn) {\n return function() {\n var self = this, args = arguments;\n\n return new Promise(function(resolve, reject) {\n var gen = fn.apply(self, args);\n\n function _next(value) {\n asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"next\", value);\n }\n\n function _throw(err) {\n asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"throw\", err);\n }\n\n _next(undefined);\n });\n };\n}\nexport { _async_to_generator as _ };\n","function _set_prototype_of(o, p) {\n _set_prototype_of = Object.setPrototypeOf || function setPrototypeOf(o, p) {\n o.__proto__ = p;\n\n return o;\n };\n\n return _set_prototype_of(o, p);\n}\nexport { _set_prototype_of as _ };\n","/******************************************************************************\nCopyright (c) Microsoft Corporation.\n\nPermission to use, copy, modify, and/or distribute this software for any\npurpose with or without fee is hereby granted.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\nPERFORMANCE OF THIS SOFTWARE.\n***************************************************************************** */\n/* global Reflect, Promise, SuppressedError, Symbol, Iterator */\n\nvar extendStatics = function(d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n};\n\nexport function __extends(d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n}\n\nexport var __assign = function() {\n __assign = Object.assign || function __assign(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\n }\n return t;\n }\n return __assign.apply(this, arguments);\n}\n\nexport function __rest(s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n t[p[i]] = s[p[i]];\n }\n return t;\n}\n\nexport function __decorate(decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n}\n\nexport function __param(paramIndex, decorator) {\n return function (target, key) { decorator(target, key, paramIndex); }\n}\n\nexport function __esDecorate(ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {\n function accept(f) { if (f !== void 0 && typeof f !== \"function\") throw new TypeError(\"Function expected\"); return f; }\n var kind = contextIn.kind, key = kind === \"getter\" ? \"get\" : kind === \"setter\" ? \"set\" : \"value\";\n var target = !descriptorIn && ctor ? contextIn[\"static\"] ? ctor : ctor.prototype : null;\n var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});\n var _, done = false;\n for (var i = decorators.length - 1; i >= 0; i--) {\n var context = {};\n for (var p in contextIn) context[p] = p === \"access\" ? {} : contextIn[p];\n for (var p in contextIn.access) context.access[p] = contextIn.access[p];\n context.addInitializer = function (f) { if (done) throw new TypeError(\"Cannot add initializers after decoration has completed\"); extraInitializers.push(accept(f || null)); };\n var result = (0, decorators[i])(kind === \"accessor\" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);\n if (kind === \"accessor\") {\n if (result === void 0) continue;\n if (result === null || typeof result !== \"object\") throw new TypeError(\"Object expected\");\n if (_ = accept(result.get)) descriptor.get = _;\n if (_ = accept(result.set)) descriptor.set = _;\n if (_ = accept(result.init)) initializers.unshift(_);\n }\n else if (_ = accept(result)) {\n if (kind === \"field\") initializers.unshift(_);\n else descriptor[key] = _;\n }\n }\n if (target) Object.defineProperty(target, contextIn.name, descriptor);\n done = true;\n};\n\nexport function __runInitializers(thisArg, initializers, value) {\n var useValue = arguments.length > 2;\n for (var i = 0; i < initializers.length; i++) {\n value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);\n }\n return useValue ? value : void 0;\n};\n\nexport function __propKey(x) {\n return typeof x === \"symbol\" ? x : \"\".concat(x);\n};\n\nexport function __setFunctionName(f, name, prefix) {\n if (typeof name === \"symbol\") name = name.description ? \"[\".concat(name.description, \"]\") : \"\";\n return Object.defineProperty(f, \"name\", { configurable: true, value: prefix ? \"\".concat(prefix, \" \", name) : name });\n};\n\nexport function __metadata(metadataKey, metadataValue) {\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\n}\n\nexport function __awaiter(thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n}\n\nexport function __generator(thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === \"function\" ? Iterator : Object).prototype);\n return g.next = verb(0), g[\"throw\"] = verb(1), g[\"return\"] = verb(2), typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (g && (g = 0, op[0] && (_ = 0)), _) try {\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n}\n\nexport var __createBinding = Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n});\n\nexport function __exportStar(m, o) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p);\n}\n\nexport function __values(o) {\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\n if (m) return m.call(o);\n if (o && typeof o.length === \"number\") return {\n next: function () {\n if (o && i >= o.length) o = void 0;\n return { value: o && o[i++], done: !o };\n }\n };\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\n}\n\nexport function __read(o, n) {\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\n if (!m) return o;\n var i = m.call(o), r, ar = [], e;\n try {\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\n }\n catch (error) { e = { error: error }; }\n finally {\n try {\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\n }\n finally { if (e) throw e.error; }\n }\n return ar;\n}\n\n/** @deprecated */\nexport function __spread() {\n for (var ar = [], i = 0; i < arguments.length; i++)\n ar = ar.concat(__read(arguments[i]));\n return ar;\n}\n\n/** @deprecated */\nexport function __spreadArrays() {\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\n r[k] = a[j];\n return r;\n}\n\nexport function __spreadArray(to, from, pack) {\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\n if (ar || !(i in from)) {\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\n ar[i] = from[i];\n }\n }\n return to.concat(ar || Array.prototype.slice.call(from));\n}\n\nexport function __await(v) {\n return this instanceof __await ? (this.v = v, this) : new __await(v);\n}\n\nexport function __asyncGenerator(thisArg, _arguments, generator) {\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\n return i = Object.create((typeof AsyncIterator === \"function\" ? AsyncIterator : Object).prototype), verb(\"next\"), verb(\"throw\"), verb(\"return\", awaitReturn), i[Symbol.asyncIterator] = function () { return this; }, i;\n function awaitReturn(f) { return function (v) { return Promise.resolve(v).then(f, reject); }; }\n function verb(n, f) { if (g[n]) { i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; if (f) i[n] = f(i[n]); } }\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\n function fulfill(value) { resume(\"next\", value); }\n function reject(value) { resume(\"throw\", value); }\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\n}\n\nexport function __asyncDelegator(o) {\n var i, p;\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: false } : f ? f(v) : v; } : f; }\n}\n\nexport function __asyncValues(o) {\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\n var m = o[Symbol.asyncIterator], i;\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\n}\n\nexport function __makeTemplateObject(cooked, raw) {\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\n return cooked;\n};\n\nvar __setModuleDefault = Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n};\n\nvar ownKeys = function(o) {\n ownKeys = Object.getOwnPropertyNames || function (o) {\n var ar = [];\n for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;\n return ar;\n };\n return ownKeys(o);\n};\n\nexport function __importStar(mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== \"default\") __createBinding(result, mod, k[i]);\n __setModuleDefault(result, mod);\n return result;\n}\n\nexport function __importDefault(mod) {\n return (mod && mod.__esModule) ? mod : { default: mod };\n}\n\nexport function __classPrivateFieldGet(receiver, state, kind, f) {\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a getter\");\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot read private member from an object whose class did not declare it\");\n return kind === \"m\" ? f : kind === \"a\" ? f.call(receiver) : f ? f.value : state.get(receiver);\n}\n\nexport function __classPrivateFieldSet(receiver, state, value, kind, f) {\n if (kind === \"m\") throw new TypeError(\"Private method is not writable\");\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a setter\");\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot write private member to an object whose class did not declare it\");\n return (kind === \"a\" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;\n}\n\nexport function __classPrivateFieldIn(state, receiver) {\n if (receiver === null || (typeof receiver !== \"object\" && typeof receiver !== \"function\")) throw new TypeError(\"Cannot use 'in' operator on non-object\");\n return typeof state === \"function\" ? receiver === state : state.has(receiver);\n}\n\nexport function __addDisposableResource(env, value, async) {\n if (value !== null && value !== void 0) {\n if (typeof value !== \"object\" && typeof value !== \"function\") throw new TypeError(\"Object expected.\");\n var dispose, inner;\n if (async) {\n if (!Symbol.asyncDispose) throw new TypeError(\"Symbol.asyncDispose is not defined.\");\n dispose = value[Symbol.asyncDispose];\n }\n if (dispose === void 0) {\n if (!Symbol.dispose) throw new TypeError(\"Symbol.dispose is not defined.\");\n dispose = value[Symbol.dispose];\n if (async) inner = dispose;\n }\n if (typeof dispose !== \"function\") throw new TypeError(\"Object not disposable.\");\n if (inner) dispose = function() { try { inner.call(this); } catch (e) { return Promise.reject(e); } };\n env.stack.push({ value: value, dispose: dispose, async: async });\n }\n else if (async) {\n env.stack.push({ async: true });\n }\n return value;\n}\n\nvar _SuppressedError = typeof SuppressedError === \"function\" ? SuppressedError : function (error, suppressed, message) {\n var e = new Error(message);\n return e.name = \"SuppressedError\", e.error = error, e.suppressed = suppressed, e;\n};\n\nexport function __disposeResources(env) {\n function fail(e) {\n env.error = env.hasError ? new _SuppressedError(e, env.error, \"An error was suppressed during disposal.\") : e;\n env.hasError = true;\n }\n var r, s = 0;\n function next() {\n while (r = env.stack.pop()) {\n try {\n if (!r.async && s === 1) return s = 0, env.stack.push(r), Promise.resolve().then(next);\n if (r.dispose) {\n var result = r.dispose.call(r.value);\n if (r.async) return s |= 2, Promise.resolve(result).then(next, function(e) { fail(e); return next(); });\n }\n else s |= 1;\n }\n catch (e) {\n fail(e);\n }\n }\n if (s === 1) return env.hasError ? Promise.reject(env.error) : Promise.resolve();\n if (env.hasError) throw env.error;\n }\n return next();\n}\n\nexport function __rewriteRelativeImportExtension(path, preserveJsx) {\n if (typeof path === \"string\" && /^\\.\\.?\\//.test(path)) {\n return path.replace(/\\.(tsx)$|((?:\\.d)?)((?:\\.[^./]+?)?)\\.([cm]?)ts$/i, function (m, tsx, d, ext, cm) {\n return tsx ? preserveJsx ? \".jsx\" : \".js\" : d && (!ext || !cm) ? m : (d + ext + \".\" + cm.toLowerCase() + \"js\");\n });\n }\n return path;\n}\n\nexport default {\n __extends,\n __assign,\n __rest,\n __decorate,\n __param,\n __esDecorate,\n __runInitializers,\n __propKey,\n __setFunctionName,\n __metadata,\n __awaiter,\n __generator,\n __createBinding,\n __exportStar,\n __values,\n __read,\n __spread,\n __spreadArrays,\n __spreadArray,\n __await,\n __asyncGenerator,\n __asyncDelegator,\n __asyncValues,\n __makeTemplateObject,\n __importStar,\n __importDefault,\n __classPrivateFieldGet,\n __classPrivateFieldSet,\n __classPrivateFieldIn,\n __addDisposableResource,\n __disposeResources,\n __rewriteRelativeImportExtension,\n};\n","function _array_like_to_array(arr, len) {\n if (len == null || len > arr.length) len = arr.length;\n\n for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];\n\n return arr2;\n}\nexport { _array_like_to_array as _ };\n","import { _ as _unsupported_iterable_to_array } from \"./_unsupported_iterable_to_array.js\";\n\nfunction _create_for_of_iterator_helper_loose(o, allowArrayLike) {\n var it = typeof Symbol !== \"undefined\" && o[Symbol.iterator] || o[\"@@iterator\"];\n\n if (it) return (it = it.call(o)).next.bind(it);\n // Fallback for engines without symbol support\n if (Array.isArray(o) || (it = _unsupported_iterable_to_array(o)) || allowArrayLike && o && typeof o.length === \"number\") {\n if (it) o = it;\n\n var i = 0;\n\n return function() {\n if (i >= o.length) return { done: true };\n\n return { done: false, value: o[i++] };\n };\n }\n\n throw new TypeError(\"Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\");\n}\nexport { _create_for_of_iterator_helper_loose as _ };\n","import { _ as _array_like_to_array } from \"./_array_like_to_array.js\";\n\nfunction _unsupported_iterable_to_array(o, minLen) {\n if (!o) return;\n if (typeof o === \"string\") return _array_like_to_array(o, minLen);\n\n var n = Object.prototype.toString.call(o).slice(8, -1);\n\n if (n === \"Object\" && o.constructor) n = o.constructor.name;\n if (n === \"Map\" || n === \"Set\") return Array.from(n);\n if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array(o, minLen);\n}\nexport { _unsupported_iterable_to_array as _ };\n","/**\n * 部分手机厂商和 iPhone 机型列表\n */\nexport const infoList = {\n vender: [\n 'SAMSUNG',\n ],\n iPhone: [\n { name: 'iPhone 15 Pro Max', model: 'iPhone16,2', width: 1290, height: 2796 },\n { name: 'iPhone 15 Pro', model: 'iPhone16,1', width: 1179, height: 2556 },\n { name: 'iPhone 15 Plus', model: 'iPhone15,5', width: 1290, height: 2796 },\n { name: 'iPhone 15', model: 'iPhone15,4', width: 1179, height: 2556 },\n { name: 'iPhone 14 Pro Max', model: 'iPhone15,3', width: 1290, height: 2796 },\n { name: 'iPhone 14 Pro', model: 'iPhone15,2', width: 1179, height: 2556 },\n { name: 'iPhone 14 Plus', model: 'iPhone14,8', width: 1284, height: 2778 },\n { name: 'iPhone 14', model: 'iPhone14,7', width: 1170, height: 2532 },\n { name: 'iPhone 13 Pro Max', model: 'iPhone14,3', width: 1284, height: 2778 },\n { name: 'iPhone 13 Pro', model: 'iPhone14,2', width: 1170, height: 2532 },\n { name: 'iPhone 13', model: 'iPhone14,5', width: 1170, height: 2532 },\n { name: 'iPhone 13 mini', model: 'iPhone14,4', width: 1080, height: 2340 },\n { name: 'iPhone SE (3rd gen)', model: 'iPhone14,6', width: 750, height: 1334 },\n { name: 'iPhone 12 Pro Max', model: 'iPhone13,4', width: 1284, height: 2778 },\n { name: 'iPhone 12 Pro', model: 'iPhone13,3', width: 1170, height: 2532 },\n { name: 'iPhone 12', model: 'iPhone13,2', width: 1170, height: 2532 },\n { name: 'iPhone 12 mini', model: 'iPhone13,1', width: 1080, height: 2340 },\n { name: 'iPhone 11 Pro Max', model: 'iPhone12,5', width: 1242, height: 2688 },\n { name: 'iPhone 11 Pro', model: 'iPhone12,3', width: 1125, height: 2436 },\n { name: 'iPhone 11', model: 'iPhone12,1', width: 828, height: 1792 },\n { name: 'iPhone SE (2nd gen)', model: 'iPhone12,8', width: 750, height: 1334 },\n { name: 'iPhone XR', model: 'iPhone11,8', width: 828, height: 1792 },\n { name: 'iPhone XS Max', model: 'iPhone11,6', width: 1242, height: 2688 },\n { name: 'iPhone XS', model: 'iPhone11,2', width: 1125, height: 2436 },\n { name: 'iPhone X', model: 'iPhone10,3', width: 1125, height: 2436 },\n { name: 'iPhone 8 Plus', model: 'iPhone10,2', width: 1080, height: 1920 },\n { name: 'iPhone 8', model: 'iPhone10,1', width: 750, height: 1334 },\n { name: 'iPhone 7 Plus', model: 'iPhone9,2', width: 1080, height: 1920 },\n { name: 'iPhone 7', model: 'iPhone9,1', width: 750, height: 1334 },\n { name: 'iPhone 6s Plus', model: 'iPhone8,2', width: 1080, height: 1920 },\n { name: 'iPhone 6s', model: 'iPhone8,1', width: 750, height: 1334 },\n { name: 'iPhone SE (1st gen)', model: 'iPhone8,4', width: 640, height: 1136 },\n { name: 'iPhone 6 Plus', model: 'iPhone7,1', width: 1080, height: 1920 },\n { name: 'iPhone 6', model: 'iPhone7,2', width: 750, height: 1334 },\n { name: 'iPhone 5C', model: 'iPhone5,3', width: 640, height: 1136 },\n { name: 'iPhone 5S', model: 'iPhone6,1', width: 640, height: 1136 },\n { name: 'iPhone 5', model: 'iPhone5,1', width: 640, height: 1136 },\n { name: 'iPhone 4S', model: 'iPhone4,1', width: 640, height: 960 },\n { name: 'iPhone 4', model: 'iPhone3,1', width: 640, height: 960 },\n { name: 'iPhone 3GS', model: 'iPhone2,1', width: 320, height: 480 },\n { name: 'iPhone 3G', model: 'iPhone1,2', width: 320, height: 480 },\n { name: 'iPhone 1st gen', model: 'iPhone1,1', width: 320, height: 480 },\n ],\n};\n\n/**\n * 被降级的硬件机型列表\n */\nexport const downgradeModels = {\n android: [\n 'OPPO R9s Plus',\n 'GM1910',\n 'V1824A',\n 'V1916A', // checked\n 'SM-G9650', // checked\n 'V1936A',\n 'MI9 PRO 5G', // checked\n 'REDMI K20',\n 'V1914A',\n 'GM1900',\n 'RMX1971',\n 'SM-A6060',\n 'SM-G9600', // checked\n 'V1922A',\n 'PBAM00', // checked\n 'PCAM10', // checked\n 'PACT00', // checked\n 'PBBM00',\n 'PCEM00',\n 'V1818A', // checked\n 'vivo X6A',\n 'vivo X6Plus A',\n ],\n iPhone: [\n 'iPhone8,4',\n 'iPhone8,2',\n 'iPhone8,1',\n 'iPhone7,2',\n 'iPhone7,1',\n 'iPhone6,2',\n 'iPhone6,1',\n 'iPhone5,4',\n 'iPhone5,3',\n 'iPhone5,2',\n 'iPhone5,1',\n 'iPhone4,3',\n 'iPhone4,2',\n 'iPhone4,1',\n 'iPhone3,3',\n 'iPhone3,2',\n 'iPhone3,1',\n 'iPhone2,1',\n 'iPhone1,2',\n 'iPhone1,1',\n ],\n};\n\n/**\n * 被降级的系统版本列表\n */\nexport const downgradeVersions = {\n android: [],\n iOS: [\n '16.7',\n '16.7.1',\n '16.7.2',\n '16.7.3',\n '16.7.4',\n '16.7.5',\n '16.7.6',\n ],\n};\n\n/**\n * 微信开发环境机型名称替换表\n */\nexport const devtoolNameMap: Record<string, Record<string, string>> = {\n wechat: {\n 'iPhone 6/7/8': 'iPhone 8',\n 'iPhone 6/7/8 Plus': 'iPhone 8 Plus',\n 'iPhone 12/13 mini': 'iPhone 13 mini',\n 'iPhone 12/13 (Pro)': 'iPhone 13 Pro',\n 'iPhone 12/13 Pro Max': 'iPhone 13 Pro Max',\n },\n};\n","import type { SceneRenderLevel } from '@galacean/effects';\n\n/**\n * 降级接口入参\n */\nexport interface DowngradeOptions {\n /**\n * 指定设备渲染等级,如果没有设置,会根据设备信息自动计算\n */\n level?: SceneRenderLevel,\n /**\n * 禁用压后台的时候自动暂停播放器\n * @default false - 不自动暂停\n */\n autoPause?: boolean,\n /**\n * 在小程序环境下,是否自动通过原生API查询设备信息\n * @default false - 不自动查询\n */\n queryDeviceInMiniApp?: boolean,\n /**\n * 设备信息,可以外部传入\n */\n deviceInfo?: DeviceInfo,\n /**\n * 是否 mock 降级\n * - true:mock 降级\n * - false: mock 不降级\n * - undefined: 不进行 mock, 用设备信息判断降级\n */\n mockDowngrade?: boolean,\n /**\n * 自定义降级回调,可针对特定机型配置特定的降级规则\n */\n downgradeCallback?: DowngradeCallback,\n}\n\n/**\n * 降级结果\n */\nexport interface DowngradeResult {\n /**\n * 是否降级\n */\n downgrade: boolean,\n /**\n * 渲染等级\n */\n level: SceneRenderLevel,\n /**\n * 降级原因\n */\n reason: string,\n /**\n * 设备信息\n */\n deviceInfo?: DeviceInfo,\n}\n\n/**\n * 设备信息\n */\nexport interface DeviceInfo {\n /**\n * 平台信息\n */\n platform?: string,\n /**\n * 系统版本\n */\n osVersion?: string,\n /**\n * 硬件机型(处理过)\n */\n model?: string,\n /**\n * 原始硬件机型\n */\n originalModel?: string,\n /**\n * 设备等级\n */\n level?: DeviceLevel,\n /**\n * 内存大小\n */\n memoryMB?: number,\n /**\n * 数据来源\n */\n sourceData?: any,\n}\n\n/**\n * 降级回调接口,可以自定义降级结果\n */\nexport type DowngradeCallback = (device: DeviceInfo) => DowngradeResult | undefined;\n\n/**\n * 微信设备信息,来自微信 JSAPI 返回的结果\n */\nexport interface WechatDeviceInfo {\n /**\n * 设备性能等级(仅 Android 支持)。\n * 取值为:\n * -2 或 0(该设备无法运行小游戏)\n * -1(性能未知)\n * >=1(设备性能值,该值越高,设备性能越好,目前最高不到50)\n */\n benchmarkLevel: number,\n /**\n * 设备品牌\n */\n brand: string,\n /**\n * 设备型号。新机型刚推出一段时间会显示unknown,微信会尽快进行适配。\n */\n model: string,\n /**\n * 操作系统及版本\n */\n system: string,\n /**\n * 客户端平台\n */\n platform: string,\n /**\n * 设备 CPU 型号(仅 Android 支持)\n */\n cpuType?: string,\n /**\n * 设备内存大小,单位为 MB\n */\n memorySize: number,\n}\n\n/**\n * 支付宝系统信息,来自支付宝 JSAPI 返回的结果\n */\nexport interface AlipaySystemInfo {\n /**\n * high: 高性能。Android 设备运行内存大于等于 4GB\n * middle: 性能中等。Android 设备运行内存大于等于 3GB 且 CPU 核心数大于 4\n * low: 性能较弱\n * unknown: 无法识别\n */\n performance?: string,\n /**\n * 手机品牌\n */\n brand?: string,\n /**\n * 手机型号。具体可参考 https://opendocs.alipay.com/mini/072v9s\n */\n model?: string,\n /**\n * 系统版本\n */\n system?: string,\n /**\n * 客户端平台:Android,iOS / iPhone OS,Harmony\n */\n platform?: string,\n}\n\n/**\n * UserAgent 的产品信息\n */\nexport interface ProductInfo {\n name: string,\n comment?: string,\n}\n\n/**\n * iPhone 机型信息\n */\nexport interface IPhoneInfo {\n name: string,\n model: string,\n width: number,\n height: number,\n}\n\n/**\n * 设备等级\n */\nexport enum DeviceLevel {\n High = 'high',\n Medium = 'medium',\n Low = 'low',\n Unknown = 'unknown',\n}\n","import { infoList } from './constants';\nimport type { DeviceInfo, ProductInfo } from './types';\nimport { DeviceLevel } from './types';\n\n/**\n * UserAgent 解析类\n *\n * 从 UserAgent 中解析出设备相关的信息,但是能获取的信息有限。\n */\nexport class UADecoder {\n device: DeviceInfo = {};\n\n constructor (userAgent?: string) {\n this.parse(userAgent ?? navigator.userAgent);\n }\n\n getDeviceInfo () {\n return this.device;\n }\n\n isIOS () {\n return this.device.platform === 'iOS';\n }\n\n isAndroid () {\n return this.device.platform === 'Android';\n }\n\n isHarmony () {\n return this.device.platform === 'Harmony';\n }\n\n isWindows () {\n return this.device.platform === 'Windows';\n }\n\n isMacintosh () {\n return this.device.platform === 'Macintosh';\n }\n\n isMobile () {\n return this.isIOS() || this.isAndroid() || this.isHarmony();\n }\n\n private parse (ua: string) {\n const pattern = /(\\w+\\/[\\w.]+)(\\s+\\([^)]+\\))?/g;\n const productInfos: ProductInfo[] = [];\n let match;\n\n while ((match = pattern.exec(ua)) !== null) {\n const name = match[1];\n const comment = match[2]?.trim();\n\n productInfos.push({ name, comment });\n }\n\n for (const productInfo of productInfos) {\n const { name, comment } = productInfo;\n\n if (name?.startsWith('Mozilla/')) {\n if (comment) {\n this.parseData(comment);\n }\n\n break;\n }\n }\n\n this.device.level = this.estimateDeviceLevel();\n this.device.sourceData = ua;\n }\n\n private parseData (data: string) {\n if (data.length && data[0] === '(') {\n data = data.substring(1);\n }\n\n if (data.length && data[data.length - 1] == ')') {\n data = data.substring(0, data.length - 1);\n }\n if (this.testIPhone(data)) {\n this.device.platform = 'iOS';\n this.device.osVersion = this.parseIOSVersion(data);\n this.device.model = this.getIPhoneModel();\n } else if (this.testIPad(data)) {\n this.device.platform = 'iOS';\n this.device.osVersion = this.parseIOSVersion(data);\n this.device.model = 'iPad';\n } else if (this.testMacintosh(data)) {\n this.device.platform = 'Mac OS';\n this.device.osVersion = this.parseMacOSVersion(data);\n } else if (this.testAndroid(data)) {\n this.device.platform = 'Android';\n this.device.osVersion = this.parseAndroidVersion(data);\n this.device.model = this.parseAndroidModel(data);\n } else if (this.testWindows(data)) {\n this.device.platform = 'Windows';\n this.device.osVersion = this.parseWindowsVersion(data);\n } else {\n console.error(`Unknown info: ${data}.`);\n }\n }\n\n private estimateDeviceLevel () {\n if (this.isIOS()) {\n if (this.device.osVersion) {\n const osVersion = parseInt(this.device.osVersion.split('.')[0]);\n\n if (osVersion < 12) {\n return DeviceLevel.Low;\n } else if (osVersion < 16) {\n return DeviceLevel.Medium;\n } else {\n return DeviceLevel.High;\n }\n } else {\n return DeviceLevel.Low;\n }\n }\n if (this.isAndroid()) {\n if (this.device.osVersion) {\n const osVersion = parseInt(this.device.osVersion.split('.')[0]);\n\n if (osVersion < 10) {\n return DeviceLevel.Low;\n } else if (osVersion < 12) {\n return DeviceLevel.Medium;\n } else {\n return DeviceLevel.High;\n }\n } else {\n return DeviceLevel.Low;\n }\n }\n\n return DeviceLevel.High;\n }\n\n private parseIOSVersion (data: string) {\n const pattern = /OS (\\d+)(?:_(\\d+))?_(\\d+)/;\n const match = data.match(pattern);\n\n if (match) {\n const versionList: string[] = [];\n\n for (let i = 1; i <= 3; i++) {\n if (match[i]) {\n versionList.push(match[i]);\n }\n }\n\n return versionList.join('.');\n }\n }\n\n private getIPhoneModel () {\n const screenWidth = window.screen.width * window.devicePixelRatio;\n const screenHeight = window.screen.height * window.devicePixelRatio;\n const match = infoList.iPhone.find(m => m.width === screenWidth && m.height === screenHeight);\n\n return match?.model ?? 'iPhone';\n }\n\n private parseAndroidVersion (data: string) {\n const pattern = /Android ([\\d.]+);/;\n const match = data.match(pattern);\n\n if (match && match.length >= 2) {\n return match[1];\n }\n }\n\n private parseAndroidModel (data: string) {\n const itemList = data.split(';');\n let lastItem;\n\n for (const item of itemList) {\n const modelPattern = /(.+?) Build/;\n const modelMatch = item.match(modelPattern);\n\n if (modelMatch && modelMatch.length >= 2) {\n return modelMatch[1].trim();\n }\n\n if (item.includes('HMSCore') && lastItem) {\n return lastItem.trim();\n }\n\n lastItem = item;\n }\n\n if (itemList.length > 0) {\n const lastItem = itemList[itemList.length - 1].trim();\n\n for (const vender of infoList.vender) {\n if (lastItem.startsWith(vender)) {\n return lastItem.substring(vender.length).trim();\n }\n }\n }\n\n if (itemList.length == 3) {\n return itemList[itemList.length - 1].trim();\n } else if (itemList.length === 4) {\n const len = itemList.length;\n\n if (itemList[len - 1].trim() === 'wv') {\n return itemList[len - 2].trim();\n }\n }\n }\n\n private parseWindowsVersion (data: string) {\n const pattern = /Windows NT ([\\d.]+);/;\n const match = data.match(pattern);\n\n if (match && match.length >= 2) {\n return match[1];\n }\n }\n\n private parseMacOSVersion (data: string) {\n const pattern = /OS X (\\d+)(?:_(\\d+))?_(\\d+)/;\n const match = data.match(pattern);\n\n if (match) {\n const versionList: string[] = [];\n\n for (let i = 1; i <= 3; i++) {\n if (match[i]) {\n versionList.push(match[i]);\n }\n }\n\n return versionList.join('.');\n }\n }\n\n private testIPhone (data: string) {\n return data.includes('iPhone');\n }\n\n private testIPad (data: string) {\n return data.includes('iPad');\n }\n\n private testAndroid (data: string) {\n return data.includes('Android');\n }\n\n private testMacintosh (data: string) {\n return data.includes('Macintosh');\n }\n\n private testWindows (data: string) {\n return data.includes('Windows');\n }\n}\n","import type { AlipaySystemInfo, DeviceInfo } from '../types';\nimport { DeviceLevel } from '../types';\n\n/**\n * 支付宝小程序系统信息解析类\n *\n * 负责解析支付宝小程序 JSAPI 返回的系统信息\n */\nexport class AlipayMiniprogramParser {\n device: DeviceInfo = {};\n\n constructor (info: AlipaySystemInfo) {\n this.parse(info);\n }\n\n getDeviceInfo () {\n return this.device;\n }\n\n private parse (info: AlipaySystemInfo) {\n this.device.platform = info.platform;\n this.device.osVersion = info.system;\n this.device.originalModel = info.model;\n this.device.model = this.getDeviceModel(info.model);\n this.device.level = this.getDeviceLevel(info.performance);\n this.device.sourceData = info;\n }\n\n private getDeviceModel (model?: string) {\n if (model) {\n const brandList = ['Huawei', 'Xiaomi', 'samsung', 'vivo', 'OPPO'];\n const brand = brandList.find(b => (model ?? '').toLowerCase().startsWith(b.toLowerCase()));\n\n if (brand) {\n return model?.substring(brand.length).trim();\n }\n }\n\n return model;\n }\n\n private getDeviceLevel (level = ''): DeviceLevel {\n const levelMap: Record<string, DeviceLevel> = {\n 'high': DeviceLevel.High,\n 'medium': DeviceLevel.Medium,\n 'middle': DeviceLevel.Medium,\n 'low': DeviceLevel.Low,\n };\n\n return levelMap[level] || DeviceLevel.Unknown;\n }\n}\n","import { infoList, devtoolNameMap } from '../constants';\nimport type { DeviceInfo, WechatDeviceInfo } from '../types';\nimport { DeviceLevel } from '../types';\n\n/**\n * 微信小程序设备信息解析类\n *\n * 负责解析微信小程序 JSAPI 返回的设备信息\n */\nexport class WechatMiniprogramParser {\n device: DeviceInfo = {};\n\n constructor (info: WechatDeviceInfo) {\n this.parse(info);\n }\n\n getDeviceInfo () {\n return this.device;\n }\n\n private parse (info: WechatDeviceInfo) {\n const osNameMatch = info.system.match(/\\w+/);\n\n if (osNameMatch) {\n this.device.platform = osNameMatch[0].trim();\n }\n\n const osVersionMatch = info.system.match(/[\\d.]+/);\n\n if (osVersionMatch) {\n this.device.osVersion = osVersionMatch[0].trim();\n }\n\n if (info.platform === 'devtools') {\n const phoneName = devtoolNameMap.wechat[info.model] ?? info.model;\n\n for (const data of infoList.iPhone) {\n if (data.name === phoneName) {\n info.model = data.model;\n\n break;\n }\n }\n }\n\n if (this.device.platform === 'iOS') {\n const modelMatch = info.model.match(/^(.*?)<(.*?)>$/);\n\n if (modelMatch) {\n this.device.model = modelMatch[2].trim();\n this.device.originalModel = info.model;\n } else {\n this.device.model = info.model;\n }\n } else {\n this.device.model = info.model;\n }\n\n if (info.benchmarkLevel <= 0) {\n this.device.level = DeviceLevel.Unknown;\n } else if (info.benchmarkLevel <= 10) {\n this.device.level = DeviceLevel.Low;\n } else if (info.benchmarkLevel <= 20) {\n this.device.level = DeviceLevel.Medium;\n } else {\n this.device.level = DeviceLevel.High;\n }\n\n this.device.memoryMB = info.memorySize;\n this.device.sourceData = info;\n }\n}\n","import { spec, type SceneRenderLevel } from '@galacean/effects';\nimport { DeviceLevel, type DeviceInfo, type DowngradeOptions, type DowngradeResult } from './types';\nimport { downgradeModels, downgradeVersions } from './constants';\n\n/**\n * 降级判断类\n *\n * 通过设备信息和降级选项判断设备是否需要降级\n */\nexport class DowngradeJudge {\n isIOS = false;\n level: SceneRenderLevel;\n\n constructor (\n public options: DowngradeOptions,\n public device: DeviceInfo,\n ) { }\n\n /**\n * 根据输入的设备信息和降级选项,以及内置的硬件机型和系统版本降级列表\n * 返回当前设备降级相关的结果\n *\n * @returns 降级结果\n */\n getDowngradeResult (): DowngradeResult {\n const { downgradeCallback } = this.options;\n\n if (downgradeCallback) {\n const result = downgradeCallback(this.device);\n\n if (result) {\n if (!result.reason) {\n result.reason = 'downgradeCallback';\n }\n\n return result;\n }\n }\n\n this.isIOS = this.device.platform === 'iOS';\n this.level = this.getRenderLevel();\n\n if (this.device.model) {\n const deviceModel = this.device.model.toLowerCase();\n const modelList = this.isIOS ? downgradeModels.iPhone : downgradeModels.android;\n const findModel = modelList.find(m => {\n const testModel = m.toLowerCase();\n\n if (this.isIOS) {\n return testModel === deviceModel;\n } else {\n return testModel.includes(deviceModel) || deviceModel.includes(testModel);\n }\n });\n\n if (findModel !== undefined) {\n return {\n downgrade: true,\n level: this.level,\n reason: 'Downgrade by model list',\n deviceInfo: this.device,\n };\n }\n }\n\n const osVersionList = this.isIOS ? downgradeVersions.iOS : downgradeVersions.android;\n const findOS = osVersionList.find(v => v === this.device.osVersion);\n\n if (findOS !== undefined) {\n return {\n downgrade: true,\n level: this.level,\n reason: 'Downgrade by OS version list',\n deviceInfo: this.device,\n };\n }\n\n return {\n downgrade: false,\n level: this.level,\n reason: '',\n deviceInfo: this.device,\n };\n }\n\n private getRenderLevel (): SceneRenderLevel {\n if (this.options.level) {\n return this.options.level;\n }\n\n if (this.device.level) {\n if (this.device.level === DeviceLevel.High) {\n return spec.RenderLevel.S;\n } else if (this.device.level === DeviceLevel.Medium) {\n return spec.RenderLevel.A;\n } else if (this.device.level === DeviceLevel.Low) {\n return spec.RenderLevel.B;\n }\n }\n\n if (this.isIOS && this.device.model) {\n if (/iPhone(\\d+),/.test(this.device.model)) {\n const gen = +RegExp.$1;\n\n if (gen <= 9) {\n return spec.RenderLevel.B;\n } else if (gen < 10) {\n return spec.RenderLevel.A;\n } else {\n return spec.RenderLevel.S;\n }\n }\n }\n\n if (this.device.memoryMB) {\n if (this.device.memoryMB < 4000) {\n return spec.RenderLevel.B;\n } else if (this.device.memoryMB < 6000) {\n return spec.RenderLevel.A;\n } else {\n return spec.RenderLevel.S;\n }\n }\n\n return this.isIOS ? spec.RenderLevel.S : spec.RenderLevel.B;\n }\n}\n","import { isIOS, isWechatMiniApp } from '@galacean/effects';\nimport { spec, getActivePlayers, logger, isAlipayMiniApp } from '@galacean/effects';\nimport type { AlipaySystemInfo, DowngradeOptions, DowngradeResult } from './types';\nimport { UADecoder } from './ua-decoder';\nimport { AlipayMiniprogramParser, WechatMiniprogramParser } from './parser';\nimport { DowngradeJudge } from './downgrade-judge';\n\nconst internalPaused = Symbol('@@_inter_pause');\nlet hasRegisterEvent = false;\n\n/**\n * 获取 GE 降级结果,不需要创建 Canvas 和 WebGL 环境。\n * 如果是小程序环境下,要确保 JSAPI 可调用\n *\n * @param options - 降级选项\n * @returns 降级结果\n */\nexport function getDowngradeResult (options: DowngradeOptions = {}): DowngradeResult {\n if (!hasRegisterEvent) {\n registerEvent(options);\n hasRegisterEvent = true;\n }\n\n const { mockDowngrade } = options;\n\n if (mockDowngrade !== undefined) {\n return {\n downgrade: mockDowngrade,\n level: options.level ?? spec.RenderLevel.S,\n reason: 'mock',\n };\n }\n\n const device = getDeviceInfo(options);\n const judge = new DowngradeJudge(options, device);\n\n return judge.getDowngradeResult();\n}\n\nfunction registerEvent (options: DowngradeOptions) {\n const { autoPause } = options;\n\n window.addEventListener('unload', () => {\n getActivePlayers().forEach(player => player.dispose());\n });\n\n if (autoPause) {\n document.addEventListener('pause', pauseAllActivePlayers);\n document.addEventListener('resume', resumePausedPlayers);\n }\n}\n\nfunction getDeviceInfo (options: DowngradeOptions) {\n const { queryDeviceInMiniApp, deviceInfo } = options;\n\n if (deviceInfo) {\n return deviceInfo;\n }\n\n if (queryDeviceInMiniApp) {\n if (isAlipayMiniApp()) {\n // 支付宝小程序\n if (my.canIUse('getSystemInfo')) {\n // https://opendocs.alipay.com/mini/api/system-info\n const info = my.getSystemInfo() as AlipaySystemInfo;\n const parser = new AlipayMiniprogramParser(info);\n\n return parser.getDeviceInfo();\n } else {\n logger.error('Can\\'t use getSystemInfo in Alipay MiniProgram.');\n }\n }\n if (isWechatMiniApp()) {\n // 微信小程序\n // @ts-expect-error\n if (wx.canIUse('getDeviceInfo')) {\n // https://developers.weixin.qq.com/miniprogram/dev/api/base/system/wx.getDeviceInfo.html\n // @ts-expect-error\n const info = wx.getDeviceInfo() as WechatDeviceInfo;\n const parser = new WechatMiniprogramParser(info);\n\n return parser.getDeviceInfo();\n } else {\n logger.error('Can\\'t use getDeviceInfo in WeChat MiniProgram.');\n }\n } else {\n logger.error('Non-mini program environment and try to get device info from user agent.');\n }\n }\n\n return new UADecoder().getDeviceInfo();\n}\n\n/**\n * 获取默认渲染等级\n *\n * @returns 渲染等级\n */\nexport function getDefaultRenderLevel () {\n return isIOS() ? spec.RenderLevel.S : spec.RenderLevel.B;\n}\n\nfunction pauseAllActivePlayers (e: Event) {\n if (e.target === document) {\n logger.info('Auto pause all players with data offloaded.');\n const players = getActivePlayers();\n\n players.forEach(player => {\n if (!player.paused) {\n player.pause({ offloadTexture: true });\n // @ts-expect-error\n player[internalPaused] = true;\n }\n });\n }\n}\n\nfunction resumePausedPlayers (e: Event) {\n if (e.target === document) {\n logger.info('Auto resume all players.');\n const players = getActivePlayers();\n\n players.forEach(player => {\n // @ts-expect-error\n if (player[internalPaused]) {\n void player.resume();\n // @ts-expect-error\n player[internalPaused] = false;\n }\n });\n }\n}\n","import type { SceneLoadOptions, spec } from '@galacean/effects';\nimport { AbstractPlugin, logger } from '@galacean/effects';\nimport { getDefaultRenderLevel } from './utils';\n\n/**\n * 降级插件类\n *\n * 根据 SceneLoadOptions 中传入的 downgrade 数据,判断是否降级。\n * 如果设备被降级,会在 processRawJSON 时抛出降级相关的异常和原因。\n *\n * 如果 SceneLoadOptions 中 renderLevel 没有设置,那么会根据 downgrade 数据\n * 和默认的渲染等级规则设置其中的 renderLevel 。\n */\nexport class DowngradePlugin extends AbstractPlugin {\n static override async processRawJSON (json: spec.JSONScene, options: SceneLoadOptions = {}) {\n const downgradeResult = options.pluginData?.['downgrade'];\n\n if (downgradeResult) {\n if (downgradeResult.downgrade) {\n throw new Error(`Downgraded, reason: ${downgradeResult.reason}`);\n }\n } else {\n logger.warn('No downgrade result in pluginData of SceneLoadOptions.');\n }\n\n if (!options.renderLevel) {\n options.renderLevel = downgradeResult?.level ?? getDefaultRenderLevel();\n }\n }\n}\n","import { _ as _set_prototype_of } from \"./_set_prototype_of.js\";\n\nfunction _inherits(subClass, superClass) {\n if (typeof superClass !== \"function\" && superClass !== null) {\n throw new TypeError(\"Super expression must either be null or a function\");\n }\n\n subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } });\n\n if (superClass) _set_prototype_of(subClass, superClass);\n}\nexport { _inherits as _ };\n","import * as EFFECTS from '@galacean/effects';\nimport { VFXItem, logger, registerPlugin } from '@galacean/effects';\nimport { DowngradePlugin } from './downgrade-plugin';\n\nexport * from './utils';\nexport * from './parser';\nexport * from './ua-decoder';\nexport * from './types';\n\n/**\n * 插件版本号\n */\nexport const version = __VERSION__;\n\nregisterPlugin('downgrade', DowngradePlugin, VFXItem);\n\nlogger.info(`Plugin downgrade version: ${version}.`);\n\nif (version !== EFFECTS.version) {\n console.error(\n '注意:请统一 Downgrade 插件与 Player 版本,不统一的版本混用会有不可预知的后果!',\n '\\nAttention: Please ensure the Downgrade plugin is synchronized with the Player version. Mixing and matching incompatible versions may result in unpredictable consequences!'\n );\n}\n"],"names":["asyncGeneratorStep","gen","resolve","reject","_next","_throw","key","arg","info","value","error","done","Promise","then","_set_prototype_of","o","p","Object","setPrototypeOf","__proto__","__generator","thisArg","body","f","y","t","_","label","sent","trys","ops","g","create","Iterator","prototype","next","verb","Symbol","iterator","this","n","v","op","TypeError","call","pop","length","push","e","step","_array_like_to_array","arr","len","i","arr2","Array","_create_for_of_iterator_helper_loose","allowArrayLike","it","bind","isArray","minLen","toString","slice","constructor","name","from","test","_unsupported_iterable_to_array","SuppressedError","DeviceLevel","infoList","vender","iPhone","model","width","height","downgradeModels","android","downgradeVersions","iOS","devtoolNameMap","wechat","UADecoder","userAgent","device","parse","navigator","getDeviceInfo","isIOS","platform","isAndroid","isHarmony","isWindows","isMacintosh","isMobile","_proto","ua","match","pattern","productInfos","exec","comment","trim","_step","_iterator","productInfo","startsWith","parseData","level","estimateDeviceLevel","sourceData","data","substring","testIPhone","osVersion","parseIOSVersion","getIPhoneModel","testIPad","testMacintosh","parseMacOSVersion","testAndroid","parseAndroidVersion","parseAndroidModel","testWindows","parseWindowsVersion","console","parseInt","split","Low","Medium","High","versionList","join","screenWidth","window","screen","devicePixelRatio","screenHeight","find","m","lastItem","itemList","item","modelMatch","includes","_step1","_iterator1","AlipayMiniprogramParser","system","originalModel","getDeviceModel","getDeviceLevel","performance","brand","b","toLowerCase","high","medium","middle","low","Unknown","WechatMiniprogramParser","osNameMatch","osVersionMatch","phoneName","benchmarkLevel","memoryMB","memorySize","DowngradeJudge","options","getDowngradeResult","downgradeCallback","result","reason","getRenderLevel","deviceModel","undefined","testModel","_this","downgrade","deviceInfo","spec","RenderLevel","S","A","B","RegExp","$1","internalPaused","hasRegisterEvent","getDefaultRenderLevel","pauseAllActivePlayers","target","document","logger","getActivePlayers","forEach","player","paused","pause","offloadTexture","resumePausedPlayers","resume","DowngradePlugin","AbstractPlugin","subClass","superClass","writable","configurable","processRawJSON","json","fn","downgradeResult","pluginData","Error","warn","renderLevel","self","args","arguments","apply","err","version","registerPlugin","VFXItem","EFFECTS","autoPause","addEventListener","dispose","registerEvent","mockDowngrade","queryDeviceInMiniApp","isAlipayMiniApp","my","canIUse","getSystemInfo","isWechatMiniApp","wx"],"mappings":"mcAAA,SAASA,EAAmBC,EAAKC,EAASC,EAAQC,EAAOC,EAAQC,EAAKC,GAClE,IACI,IAAIC,EAAOP,EAAIK,GAAKC,GAChBE,EAAQD,EAAKC,KACrB,CAAE,MAAOC,GAEL,YADAP,EAAOO,EAEX,CACIF,EAAKG,KAAMT,EAAQO,GAClBG,QAAQV,QAAQO,GAAOI,KAAKT,EAAOC,EAC5C,CCVA,SAASS,EAAkBC,EAAGC,GAO1B,OANAF,EAAoBG,OAAOC,gBAAkB,SAAwBH,EAAGC,GAGpE,OAFAD,EAAEI,UAAYH,EAEPD,CACX,EAEOD,EAAkBC,EAAGC,EAChC,CCoHO,SAASI,EAAYC,EAASC,GACnC,IAAsGC,EAAGC,EAAGC,EAAxGC,EAAI,CAAEC,MAAO,EAAGC,KAAM,WAAa,GAAW,EAAPH,EAAE,GAAQ,MAAMA,EAAE,GAAI,OAAOA,EAAE,EAAI,EAAGI,KAAM,GAAIC,IAAK,IAAeC,EAAId,OAAOe,QAA4B,mBAAbC,SAA0BA,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AA,GACzDoB,KAqBP,SAAwBpB,GACtB,IAAQyD,EAAczD,EAAdyD,UAER5F,SAAO6F,iBAAiB,UAAU,WAChChC,qBAAmBC,SAAQC,SAAAA,GAAUA,OAAAA,EAAO+B,YAC9C,IAEIF,IACFjC,SAASkC,iBAAiB,QAASpC,GACnCE,SAASkC,iBAAiB,SAAU1B,GAExC,CA/BI4B,CAAc5D,GACdoB,GAAmB,GAGrB,IAKWpB,EALH6D,EAAkB7D,EAAlB6D,cAER,QAAsBtD,IAAlBsD,EACF,MAAO,CACLnD,UAAWmD,EACX1H,aAAO6D,EAAAA,EAAQ7D,OAAR6D,EAAiBY,OAAKC,YAAYC,EACzCV,OAAQ,QAIZ,IAAMzF,EAmBR,SAAwBqF,GACtB,IAAQ8D,EAAqC9D,EAArC8D,qBAAsBnD,EAAeX,EAAfW,WAE9B,GAAIA,EACF,OAAOA,EAGT,GAAImD,EAAsB,CACxB,GAAIC,EAAmBA,kBAAA,CAErB,GAAIC,GAAGC,QAAQ,iBAAkB,CAE/B,IAAMnO,EAAOkO,GAAGE,gBAGhB,OAFe,IAAIxF,EAAwB5I,GAE7BgF,gBAEd2G,SAAOzL,MAAM,iDAEjB,CACA,GAAImO,EAAmBA,kBAAA,CAGrB,GAAIC,GAAGH,QAAQ,iBAAkB,CAG/B,IAAMnO,EAAOsO,GAAGtJ,gBAGhB,OAFe,IAAI0E,EAAwB1J,GAE7BgF,gBAEd2G,SAAOzL,MAAM,uDAGfyL,SAAOzL,MAAM,2EAEjB,CAEA,OAAO,IAAIyE,GAAYK,eACzB,CA1DiBA,CAAckF,GAG7B,OAFc,IAAID,EAAeC,EAASrF,GAE7BsF,oBACf"}
|
package/dist/alipay.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import*as e from"@galacean/effects/alipay";import{spec as i,getActivePlayers as n,isAlipayMiniApp as t,logger as o,isWechatMiniApp as r,isIOS as h,AbstractPlugin as d,registerPlugin as a,VFXItem as s}from"@galacean/effects/alipay";import{window as l}from"@galacean/appx-adapter/alipay";function u(e,i,n,t,o,r,h){try{var d=e[r](h),a=d.value}catch(e){return void n(e)}d.done?i(a):Promise.resolve(a).then(t,o)}function c(e,i){return c=Object.setPrototypeOf||function(e,i){return e.__proto__=i,e},c(e,i)}function v(e,i){var n,t,o,r={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},h=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return h.next=d(0),h.throw=d(1),h.return=d(2),"function"==typeof Symbol&&(h[Symbol.iterator]=function(){return this}),h;function d(d){return function(a){return function(d){if(n)throw new TypeError("Generator is already executing.");for(;h&&(h=0,d[0]&&(r=0)),r;)try{if(n=1,t&&(o=2&d[0]?t.return:d[0]?t.throw||((o=t.return)&&o.call(t),0):t.next)&&!(o=o.call(t,d[1])).done)return o;switch(t=0,o&&(d=[2&d[0],o.value]),d[0]){case 0:case 1:o=d;break;case 4:return r.label++,{value:d[1],done:!1};case 5:r.label++,t=d[1],d=[0];continue;case 7:d=r.ops.pop(),r.trys.pop();continue;default:if(!(o=r.trys,(o=o.length>0&&o[o.length-1])||6!==d[0]&&2!==d[0])){r=0;continue}if(3===d[0]&&(!o||d[1]>o[0]&&d[1]<o[3])){r.label=d[1];break}if(6===d[0]&&r.label<o[1]){r.label=o[1],o=d;break}if(o&&r.label<o[2]){r.label=o[2],r.ops.push(d);break}o[2]&&r.ops.pop(),r.trys.pop();continue}d=i.call(e,r)}catch(e){d=[6,e],t=0}finally{n=o=0}if(5&d[0])throw d[1];return{value:d[0]?d[1]:void 0,done:!0}}([d,a])}}}function m(e,i){(null==i||i>e.length)&&(i=e.length);for(var n=0,t=new Array(i);n<i;n++)t[n]=e[n];return t}function f(e,i){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=function(e,i){if(e){if("string"==typeof e)return m(e,i);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(n):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?m(e,i):void 0}}(e))||i&&e&&"number"==typeof e.length){n&&(e=n);var t=0;return function(){return t>=e.length?{done:!0}:{done:!1,value:e[t++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}"function"==typeof SuppressedError&&SuppressedError;var P,g={vender:["SAMSUNG"],iPhone:[{name:"iPhone 15 Pro Max",model:"iPhone16,2",width:1290,height:2796},{name:"iPhone 15 Pro",model:"iPhone16,1",width:1179,height:2556},{name:"iPhone 15 Plus",model:"iPhone15,5",width:1290,height:2796},{name:"iPhone 15",model:"iPhone15,4",width:1179,height:2556},{name:"iPhone 14 Pro Max",model:"iPhone15,3",width:1290,height:2796},{name:"iPhone 14 Pro",model:"iPhone15,2",width:1179,height:2556},{name:"iPhone 14 Plus",model:"iPhone14,8",width:1284,height:2778},{name:"iPhone 14",model:"iPhone14,7",width:1170,height:2532},{name:"iPhone 13 Pro Max",model:"iPhone14,3",width:1284,height:2778},{name:"iPhone 13 Pro",model:"iPhone14,2",width:1170,height:2532},{name:"iPhone 13",model:"iPhone14,5",width:1170,height:2532},{name:"iPhone 13 mini",model:"iPhone14,4",width:1080,height:2340},{name:"iPhone SE (3rd gen)",model:"iPhone14,6",width:750,height:1334},{name:"iPhone 12 Pro Max",model:"iPhone13,4",width:1284,height:2778},{name:"iPhone 12 Pro",model:"iPhone13,3",width:1170,height:2532},{name:"iPhone 12",model:"iPhone13,2",width:1170,height:2532},{name:"iPhone 12 mini",model:"iPhone13,1",width:1080,height:2340},{name:"iPhone 11 Pro Max",model:"iPhone12,5",width:1242,height:2688},{name:"iPhone 11 Pro",model:"iPhone12,3",width:1125,height:2436},{name:"iPhone 11",model:"iPhone12,1",width:828,height:1792},{name:"iPhone SE (2nd gen)",model:"iPhone12,8",width:750,height:1334},{name:"iPhone XR",model:"iPhone11,8",width:828,height:1792},{name:"iPhone XS Max",model:"iPhone11,6",width:1242,height:2688},{name:"iPhone XS",model:"iPhone11,2",width:1125,height:2436},{name:"iPhone X",model:"iPhone10,3",width:1125,height:2436},{name:"iPhone 8 Plus",model:"iPhone10,2",width:1080,height:1920},{name:"iPhone 8",model:"iPhone10,1",width:750,height:1334},{name:"iPhone 7 Plus",model:"iPhone9,2",width:1080,height:1920},{name:"iPhone 7",model:"iPhone9,1",width:750,height:1334},{name:"iPhone 6s Plus",model:"iPhone8,2",width:1080,height:1920},{name:"iPhone 6s",model:"iPhone8,1",width:750,height:1334},{name:"iPhone SE (1st gen)",model:"iPhone8,4",width:640,height:1136},{name:"iPhone 6 Plus",model:"iPhone7,1",width:1080,height:1920},{name:"iPhone 6",model:"iPhone7,2",width:750,height:1334},{name:"iPhone 5C",model:"iPhone5,3",width:640,height:1136},{name:"iPhone 5S",model:"iPhone6,1",width:640,height:1136},{name:"iPhone 5",model:"iPhone5,1",width:640,height:1136},{name:"iPhone 4S",model:"iPhone4,1",width:640,height:960},{name:"iPhone 4",model:"iPhone3,1",width:640,height:960},{name:"iPhone 3GS",model:"iPhone2,1",width:320,height:480},{name:"iPhone 3G",model:"iPhone1,2",width:320,height:480},{name:"iPhone 1st gen",model:"iPhone1,1",width:320,height:480}]},p={android:["OPPO R9s Plus","GM1910","V1824A","V1916A","SM-G9650","V1936A","MI9 PRO 5G","REDMI K20","V1914A","GM1900","RMX1971","SM-A6060","SM-G9600","V1922A","PBAM00","PCAM10","PACT00","PBBM00","PCEM00","V1818A","vivo X6A","vivo X6Plus A"],iPhone:["iPhone8,4","iPhone8,2","iPhone8,1","iPhone7,2","iPhone7,1","iPhone6,2","iPhone6,1","iPhone5,4","iPhone5,3","iPhone5,2","iPhone5,1","iPhone4,3","iPhone4,2","iPhone4,1","iPhone3,3","iPhone3,2","iPhone3,1","iPhone2,1","iPhone1,2","iPhone1,1"]},w={android:[],iOS:["16.7","16.7.1","16.7.2","16.7.3","16.7.4","16.7.5","16.7.6"]},y={wechat:{"iPhone 6/7/8":"iPhone 8","iPhone 6/7/8 Plus":"iPhone 8 Plus","iPhone 12/13 mini":"iPhone 13 mini","iPhone 12/13 (Pro)":"iPhone 13 Pro","iPhone 12/13 Pro Max":"iPhone 13 Pro Max"}};!function(e){e.High="high",e.Medium="medium",e.Low="low",e.Unknown="unknown"}(P||(P={}));var S=function(){function e(e){this.device={},this.parse(null!=e?e:navigator.userAgent)}var i=e.prototype;return i.getDeviceInfo=function(){return this.device},i.isIOS=function(){return"iOS"===this.device.platform},i.isAndroid=function(){return"Android"===this.device.platform},i.isHarmony=function(){return"Harmony"===this.device.platform},i.isWindows=function(){return"Windows"===this.device.platform},i.isMacintosh=function(){return"Macintosh"===this.device.platform},i.isMobile=function(){return this.isIOS()||this.isAndroid()||this.isHarmony()},i.parse=function(e){for(var i,n=/(\w+\/[\w.]+)(\s+\([^)]+\))?/g,t=[];null!==(i=n.exec(e));){var o,r=i[1],h=null==(o=i[2])?void 0:o.trim();t.push({name:r,comment:h})}for(var d,a=f(t);!(d=a()).done;){var s=d.value,l=s.name,u=s.comment;if(null==l?void 0:l.startsWith("Mozilla/")){u&&this.parseData(u);break}}this.device.level=this.estimateDeviceLevel(),this.device.sourceData=e},i.parseData=function(e){e.length&&"("===e[0]&&(e=e.substring(1)),e.length&&")"==e[e.length-1]&&(e=e.substring(0,e.length-1)),this.testIPhone(e)?(this.device.platform="iOS",this.device.osVersion=this.parseIOSVersion(e),this.device.model=this.getIPhoneModel()):this.testIPad(e)?(this.device.platform="iOS",this.device.osVersion=this.parseIOSVersion(e),this.device.model="iPad"):this.testMacintosh(e)?(this.device.platform="Mac OS",this.device.osVersion=this.parseMacOSVersion(e)):this.testAndroid(e)?(this.device.platform="Android",this.device.osVersion=this.parseAndroidVersion(e),this.device.model=this.parseAndroidModel(e)):this.testWindows(e)?(this.device.platform="Windows",this.device.osVersion=this.parseWindowsVersion(e)):console.error("Unknown info: "+e+".")},i.estimateDeviceLevel=function(){if(this.isIOS()){if(this.device.osVersion){var e=parseInt(this.device.osVersion.split(".")[0]);return e<12?P.Low:e<16?P.Medium:P.High}return P.Low}if(this.isAndroid()){if(this.device.osVersion){var i=parseInt(this.device.osVersion.split(".")[0]);return i<10?P.Low:i<12?P.Medium:P.High}return P.Low}return P.High},i.parseIOSVersion=function(e){var i=e.match(/OS (\d+)(?:_(\d+))?_(\d+)/);if(i){for(var n=[],t=1;t<=3;t++)i[t]&&n.push(i[t]);return n.join(".")}},i.getIPhoneModel=function(){var e,i=l.screen.width*l.devicePixelRatio,n=l.screen.height*l.devicePixelRatio,t=g.iPhone.find((function(e){return e.width===i&&e.height===n}));return null!=(e=null==t?void 0:t.model)?e:"iPhone"},i.parseAndroidVersion=function(e){var i=e.match(/Android ([\d.]+);/);if(i&&i.length>=2)return i[1]},i.parseAndroidModel=function(e){for(var i,n,t=e.split(";"),o=f(t);!(n=o()).done;){var r=n.value,h=r.match(/(.+?) Build/);if(h&&h.length>=2)return h[1].trim();if(r.includes("HMSCore")&&i)return i.trim();i=r}if(t.length>0)for(var d,a=t[t.length-1].trim(),s=f(g.vender);!(d=s()).done;){var l=d.value;if(a.startsWith(l))return a.substring(l.length).trim()}if(3==t.length)return t[t.length-1].trim();if(4===t.length){var u=t.length;if("wv"===t[u-1].trim())return t[u-2].trim()}},i.parseWindowsVersion=function(e){var i=e.match(/Windows NT ([\d.]+);/);if(i&&i.length>=2)return i[1]},i.parseMacOSVersion=function(e){var i=e.match(/OS X (\d+)(?:_(\d+))?_(\d+)/);if(i){for(var n=[],t=1;t<=3;t++)i[t]&&n.push(i[t]);return n.join(".")}},i.testIPhone=function(e){return e.includes("iPhone")},i.testIPad=function(e){return e.includes("iPad")},i.testAndroid=function(e){return e.includes("Android")},i.testMacintosh=function(e){return e.includes("Macintosh")},i.testWindows=function(e){return e.includes("Windows")},e}(),M=function(){function e(e){this.device={},this.parse(e)}var i=e.prototype;return i.getDeviceInfo=function(){return this.device},i.parse=function(e){this.device.platform=e.platform,this.device.osVersion=e.system,this.device.originalModel=e.model,this.device.model=this.getDeviceModel(e.model),this.device.level=this.getDeviceLevel(e.performance),this.device.sourceData=e},i.getDeviceModel=function(e){if(e){var i=["Huawei","Xiaomi","samsung","vivo","OPPO"].find((function(i){return(null!=e?e:"").toLowerCase().startsWith(i.toLowerCase())}));if(i)return null==e?void 0:e.substring(i.length).trim()}return e},i.getDeviceLevel=function(e){return void 0===e&&(e=""),{high:P.High,medium:P.Medium,middle:P.Medium,low:P.Low}[e]||P.Unknown},e}(),b=function(){function e(e){this.device={},this.parse(e)}var i=e.prototype;return i.getDeviceInfo=function(){return this.device},i.parse=function(e){var i=e.system.match(/\w+/);i&&(this.device.platform=i[0].trim());var n=e.system.match(/[\d.]+/);if(n&&(this.device.osVersion=n[0].trim()),"devtools"===e.platform)for(var t,o,r=null!=(t=y.wechat[e.model])?t:e.model,h=f(g.iPhone);!(o=h()).done;){var d=o.value;if(d.name===r){e.model=d.model;break}}if("iOS"===this.device.platform){var a=e.model.match(/^(.*?)<(.*?)>$/);a?(this.device.model=a[2].trim(),this.device.originalModel=e.model):this.device.model=e.model}else this.device.model=e.model;e.benchmarkLevel<=0?this.device.level=P.Unknown:e.benchmarkLevel<=10?this.device.level=P.Low:e.benchmarkLevel<=20?this.device.level=P.Medium:this.device.level=P.High,this.device.memoryMB=e.memorySize,this.device.sourceData=e},e}(),I=function(){function e(e,i){this.options=e,this.device=i,this.isIOS=!1}var n=e.prototype;return n.getDowngradeResult=function(){var e=this,i=this.options.downgradeCallback;if(i){var n=i(this.device);if(n)return n.reason||(n.reason="downgradeCallback"),n}if(this.isIOS="iOS"===this.device.platform,this.level=this.getRenderLevel(),this.device.model){var t=this.device.model.toLowerCase();if(void 0!==(this.isIOS?p.iPhone:p.android).find((function(i){var n=i.toLowerCase();return e.isIOS?n===t:n.includes(t)||t.includes(n)})))return{downgrade:!0,level:this.level,reason:"Downgrade by model list",deviceInfo:this.device}}return void 0!==(this.isIOS?w.iOS:w.android).find((function(i){return i===e.device.osVersion}))?{downgrade:!0,level:this.level,reason:"Downgrade by OS version list",deviceInfo:this.device}:{downgrade:!1,level:this.level,reason:"",deviceInfo:this.device}},n.getRenderLevel=function(){if(this.options.level)return this.options.level;if(this.device.level){if(this.device.level===P.High)return i.RenderLevel.S;if(this.device.level===P.Medium)return i.RenderLevel.A;if(this.device.level===P.Low)return i.RenderLevel.B}if(this.isIOS&&this.device.model&&/iPhone(\d+),/.test(this.device.model)){var e=+RegExp.$1;return e<=9?i.RenderLevel.B:e<10?i.RenderLevel.A:i.RenderLevel.S}return this.device.memoryMB?this.device.memoryMB<4e3?i.RenderLevel.B:this.device.memoryMB<6e3?i.RenderLevel.A:i.RenderLevel.S:this.isIOS?i.RenderLevel.S:i.RenderLevel.B},e}(),A=Symbol("@@_inter_pause"),L=!1;function O(e){void 0===e&&(e={}),L||(!function(e){var i=e.autoPause;l.addEventListener("unload",(function(){n().forEach((function(e){return e.dispose()}))})),i&&(document.addEventListener("pause",R),document.addEventListener("resume",V))}(e),L=!0);var h,d=e.mockDowngrade;if(void 0!==d)return{downgrade:d,level:null!=(h=e.level)?h:i.RenderLevel.S,reason:"mock"};var a=function(e){var i=e.queryDeviceInMiniApp,n=e.deviceInfo;if(n)return n;if(i){if(t()){if(my.canIUse("getSystemInfo")){var h=my.getSystemInfo();return new M(h).getDeviceInfo()}o.error("Can't use getSystemInfo in Alipay MiniProgram.")}if(r()){if(wx.canIUse("getDeviceInfo")){var d=wx.getDeviceInfo();return new b(d).getDeviceInfo()}o.error("Can't use getDeviceInfo in WeChat MiniProgram.")}else o.error("Non-mini program environment and try to get device info from user agent.")}return(new S).getDeviceInfo()}(e);return new I(e,a).getDowngradeResult()}function D(){return h()?i.RenderLevel.S:i.RenderLevel.B}function R(e){e.target===document&&(o.info("Auto pause all players with data offloaded."),n().forEach((function(e){e.paused||(e.pause({offloadTexture:!0}),e[A]=!0)})))}function V(e){e.target===document&&(o.info("Auto resume all players."),n().forEach((function(e){e[A]&&(e.resume(),e[A]=!1)})))}var x=function(e){function i(){return e.apply(this,arguments)}return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(i&&i.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),i&&c(e,i)}(i,e),i.processRawJSON=function(e,i){return void 0===i&&(i={}),(n=function(){var e,n,t;return v(this,(function(r){if(n=null==(e=i.pluginData)?void 0:e.downgrade){if(n.downgrade)throw new Error("Downgraded, reason: "+n.reason)}else o.warn("No downgrade result in pluginData of SceneLoadOptions.");return i.renderLevel||(i.renderLevel=null!=(t=null==n?void 0:n.level)?t:D()),[2]}))},function(){var e=this,i=arguments;return new Promise((function(t,o){var r=n.apply(e,i);function h(e){u(r,t,o,h,d,"next",e)}function d(e){u(r,t,o,h,d,"throw",e)}h(void 0)}))})();var n},i}(d),k="2.7.0-alpha.1";a("downgrade",x,s),o.info("Plugin downgrade version: "+k+"."),k!==e.version&&console.error("注意:请统一 Downgrade 插件与 Player 版本,不统一的版本混用会有不可预知的后果!","\nAttention: Please ensure the Downgrade plugin is synchronized with the Player version. Mixing and matching incompatible versions may result in unpredictable consequences!");export{M as AlipayMiniprogramParser,P as DeviceLevel,S as UADecoder,b as WechatMiniprogramParser,D as getDefaultRenderLevel,O as getDowngradeResult,k as version};
|
|
1
|
+
import*as e from"@galacean/effects/alipay";import{spec as i,getActivePlayers as n,isAlipayMiniApp as t,logger as o,isWechatMiniApp as r,isIOS as h,AbstractPlugin as d,registerPlugin as a,VFXItem as s}from"@galacean/effects/alipay";import{window as l}from"@galacean/appx-adapter/alipay";function u(e,i,n,t,o,r,h){try{var d=e[r](h),a=d.value}catch(e){return void n(e)}d.done?i(a):Promise.resolve(a).then(t,o)}function c(e,i){return c=Object.setPrototypeOf||function(e,i){return e.__proto__=i,e},c(e,i)}function v(e,i){var n,t,o,r={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},h=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return h.next=d(0),h.throw=d(1),h.return=d(2),"function"==typeof Symbol&&(h[Symbol.iterator]=function(){return this}),h;function d(d){return function(a){return function(d){if(n)throw new TypeError("Generator is already executing.");for(;h&&(h=0,d[0]&&(r=0)),r;)try{if(n=1,t&&(o=2&d[0]?t.return:d[0]?t.throw||((o=t.return)&&o.call(t),0):t.next)&&!(o=o.call(t,d[1])).done)return o;switch(t=0,o&&(d=[2&d[0],o.value]),d[0]){case 0:case 1:o=d;break;case 4:return r.label++,{value:d[1],done:!1};case 5:r.label++,t=d[1],d=[0];continue;case 7:d=r.ops.pop(),r.trys.pop();continue;default:if(!(o=r.trys,(o=o.length>0&&o[o.length-1])||6!==d[0]&&2!==d[0])){r=0;continue}if(3===d[0]&&(!o||d[1]>o[0]&&d[1]<o[3])){r.label=d[1];break}if(6===d[0]&&r.label<o[1]){r.label=o[1],o=d;break}if(o&&r.label<o[2]){r.label=o[2],r.ops.push(d);break}o[2]&&r.ops.pop(),r.trys.pop();continue}d=i.call(e,r)}catch(e){d=[6,e],t=0}finally{n=o=0}if(5&d[0])throw d[1];return{value:d[0]?d[1]:void 0,done:!0}}([d,a])}}}function m(e,i){(null==i||i>e.length)&&(i=e.length);for(var n=0,t=new Array(i);n<i;n++)t[n]=e[n];return t}function f(e,i){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=function(e,i){if(e){if("string"==typeof e)return m(e,i);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(n):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?m(e,i):void 0}}(e))||i&&e&&"number"==typeof e.length){n&&(e=n);var t=0;return function(){return t>=e.length?{done:!0}:{done:!1,value:e[t++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}"function"==typeof SuppressedError&&SuppressedError;var P,g={vender:["SAMSUNG"],iPhone:[{name:"iPhone 15 Pro Max",model:"iPhone16,2",width:1290,height:2796},{name:"iPhone 15 Pro",model:"iPhone16,1",width:1179,height:2556},{name:"iPhone 15 Plus",model:"iPhone15,5",width:1290,height:2796},{name:"iPhone 15",model:"iPhone15,4",width:1179,height:2556},{name:"iPhone 14 Pro Max",model:"iPhone15,3",width:1290,height:2796},{name:"iPhone 14 Pro",model:"iPhone15,2",width:1179,height:2556},{name:"iPhone 14 Plus",model:"iPhone14,8",width:1284,height:2778},{name:"iPhone 14",model:"iPhone14,7",width:1170,height:2532},{name:"iPhone 13 Pro Max",model:"iPhone14,3",width:1284,height:2778},{name:"iPhone 13 Pro",model:"iPhone14,2",width:1170,height:2532},{name:"iPhone 13",model:"iPhone14,5",width:1170,height:2532},{name:"iPhone 13 mini",model:"iPhone14,4",width:1080,height:2340},{name:"iPhone SE (3rd gen)",model:"iPhone14,6",width:750,height:1334},{name:"iPhone 12 Pro Max",model:"iPhone13,4",width:1284,height:2778},{name:"iPhone 12 Pro",model:"iPhone13,3",width:1170,height:2532},{name:"iPhone 12",model:"iPhone13,2",width:1170,height:2532},{name:"iPhone 12 mini",model:"iPhone13,1",width:1080,height:2340},{name:"iPhone 11 Pro Max",model:"iPhone12,5",width:1242,height:2688},{name:"iPhone 11 Pro",model:"iPhone12,3",width:1125,height:2436},{name:"iPhone 11",model:"iPhone12,1",width:828,height:1792},{name:"iPhone SE (2nd gen)",model:"iPhone12,8",width:750,height:1334},{name:"iPhone XR",model:"iPhone11,8",width:828,height:1792},{name:"iPhone XS Max",model:"iPhone11,6",width:1242,height:2688},{name:"iPhone XS",model:"iPhone11,2",width:1125,height:2436},{name:"iPhone X",model:"iPhone10,3",width:1125,height:2436},{name:"iPhone 8 Plus",model:"iPhone10,2",width:1080,height:1920},{name:"iPhone 8",model:"iPhone10,1",width:750,height:1334},{name:"iPhone 7 Plus",model:"iPhone9,2",width:1080,height:1920},{name:"iPhone 7",model:"iPhone9,1",width:750,height:1334},{name:"iPhone 6s Plus",model:"iPhone8,2",width:1080,height:1920},{name:"iPhone 6s",model:"iPhone8,1",width:750,height:1334},{name:"iPhone SE (1st gen)",model:"iPhone8,4",width:640,height:1136},{name:"iPhone 6 Plus",model:"iPhone7,1",width:1080,height:1920},{name:"iPhone 6",model:"iPhone7,2",width:750,height:1334},{name:"iPhone 5C",model:"iPhone5,3",width:640,height:1136},{name:"iPhone 5S",model:"iPhone6,1",width:640,height:1136},{name:"iPhone 5",model:"iPhone5,1",width:640,height:1136},{name:"iPhone 4S",model:"iPhone4,1",width:640,height:960},{name:"iPhone 4",model:"iPhone3,1",width:640,height:960},{name:"iPhone 3GS",model:"iPhone2,1",width:320,height:480},{name:"iPhone 3G",model:"iPhone1,2",width:320,height:480},{name:"iPhone 1st gen",model:"iPhone1,1",width:320,height:480}]},p={android:["OPPO R9s Plus","GM1910","V1824A","V1916A","SM-G9650","V1936A","MI9 PRO 5G","REDMI K20","V1914A","GM1900","RMX1971","SM-A6060","SM-G9600","V1922A","PBAM00","PCAM10","PACT00","PBBM00","PCEM00","V1818A","vivo X6A","vivo X6Plus A"],iPhone:["iPhone8,4","iPhone8,2","iPhone8,1","iPhone7,2","iPhone7,1","iPhone6,2","iPhone6,1","iPhone5,4","iPhone5,3","iPhone5,2","iPhone5,1","iPhone4,3","iPhone4,2","iPhone4,1","iPhone3,3","iPhone3,2","iPhone3,1","iPhone2,1","iPhone1,2","iPhone1,1"]},w={android:[],iOS:["16.7","16.7.1","16.7.2","16.7.3","16.7.4","16.7.5","16.7.6"]},y={wechat:{"iPhone 6/7/8":"iPhone 8","iPhone 6/7/8 Plus":"iPhone 8 Plus","iPhone 12/13 mini":"iPhone 13 mini","iPhone 12/13 (Pro)":"iPhone 13 Pro","iPhone 12/13 Pro Max":"iPhone 13 Pro Max"}};!function(e){e.High="high",e.Medium="medium",e.Low="low",e.Unknown="unknown"}(P||(P={}));var S=function(){function e(e){this.device={},this.parse(null!=e?e:navigator.userAgent)}var i=e.prototype;return i.getDeviceInfo=function(){return this.device},i.isIOS=function(){return"iOS"===this.device.platform},i.isAndroid=function(){return"Android"===this.device.platform},i.isHarmony=function(){return"Harmony"===this.device.platform},i.isWindows=function(){return"Windows"===this.device.platform},i.isMacintosh=function(){return"Macintosh"===this.device.platform},i.isMobile=function(){return this.isIOS()||this.isAndroid()||this.isHarmony()},i.parse=function(e){for(var i,n=/(\w+\/[\w.]+)(\s+\([^)]+\))?/g,t=[];null!==(i=n.exec(e));){var o,r=i[1],h=null==(o=i[2])?void 0:o.trim();t.push({name:r,comment:h})}for(var d,a=f(t);!(d=a()).done;){var s=d.value,l=s.name,u=s.comment;if(null==l?void 0:l.startsWith("Mozilla/")){u&&this.parseData(u);break}}this.device.level=this.estimateDeviceLevel(),this.device.sourceData=e},i.parseData=function(e){e.length&&"("===e[0]&&(e=e.substring(1)),e.length&&")"==e[e.length-1]&&(e=e.substring(0,e.length-1)),this.testIPhone(e)?(this.device.platform="iOS",this.device.osVersion=this.parseIOSVersion(e),this.device.model=this.getIPhoneModel()):this.testIPad(e)?(this.device.platform="iOS",this.device.osVersion=this.parseIOSVersion(e),this.device.model="iPad"):this.testMacintosh(e)?(this.device.platform="Mac OS",this.device.osVersion=this.parseMacOSVersion(e)):this.testAndroid(e)?(this.device.platform="Android",this.device.osVersion=this.parseAndroidVersion(e),this.device.model=this.parseAndroidModel(e)):this.testWindows(e)?(this.device.platform="Windows",this.device.osVersion=this.parseWindowsVersion(e)):console.error("Unknown info: "+e+".")},i.estimateDeviceLevel=function(){if(this.isIOS()){if(this.device.osVersion){var e=parseInt(this.device.osVersion.split(".")[0]);return e<12?P.Low:e<16?P.Medium:P.High}return P.Low}if(this.isAndroid()){if(this.device.osVersion){var i=parseInt(this.device.osVersion.split(".")[0]);return i<10?P.Low:i<12?P.Medium:P.High}return P.Low}return P.High},i.parseIOSVersion=function(e){var i=e.match(/OS (\d+)(?:_(\d+))?_(\d+)/);if(i){for(var n=[],t=1;t<=3;t++)i[t]&&n.push(i[t]);return n.join(".")}},i.getIPhoneModel=function(){var e,i=l.screen.width*l.devicePixelRatio,n=l.screen.height*l.devicePixelRatio,t=g.iPhone.find((function(e){return e.width===i&&e.height===n}));return null!=(e=null==t?void 0:t.model)?e:"iPhone"},i.parseAndroidVersion=function(e){var i=e.match(/Android ([\d.]+);/);if(i&&i.length>=2)return i[1]},i.parseAndroidModel=function(e){for(var i,n,t=e.split(";"),o=f(t);!(n=o()).done;){var r=n.value,h=r.match(/(.+?) Build/);if(h&&h.length>=2)return h[1].trim();if(r.includes("HMSCore")&&i)return i.trim();i=r}if(t.length>0)for(var d,a=t[t.length-1].trim(),s=f(g.vender);!(d=s()).done;){var l=d.value;if(a.startsWith(l))return a.substring(l.length).trim()}if(3==t.length)return t[t.length-1].trim();if(4===t.length){var u=t.length;if("wv"===t[u-1].trim())return t[u-2].trim()}},i.parseWindowsVersion=function(e){var i=e.match(/Windows NT ([\d.]+);/);if(i&&i.length>=2)return i[1]},i.parseMacOSVersion=function(e){var i=e.match(/OS X (\d+)(?:_(\d+))?_(\d+)/);if(i){for(var n=[],t=1;t<=3;t++)i[t]&&n.push(i[t]);return n.join(".")}},i.testIPhone=function(e){return e.includes("iPhone")},i.testIPad=function(e){return e.includes("iPad")},i.testAndroid=function(e){return e.includes("Android")},i.testMacintosh=function(e){return e.includes("Macintosh")},i.testWindows=function(e){return e.includes("Windows")},e}(),M=function(){function e(e){this.device={},this.parse(e)}var i=e.prototype;return i.getDeviceInfo=function(){return this.device},i.parse=function(e){this.device.platform=e.platform,this.device.osVersion=e.system,this.device.originalModel=e.model,this.device.model=this.getDeviceModel(e.model),this.device.level=this.getDeviceLevel(e.performance),this.device.sourceData=e},i.getDeviceModel=function(e){if(e){var i=["Huawei","Xiaomi","samsung","vivo","OPPO"].find((function(i){return(null!=e?e:"").toLowerCase().startsWith(i.toLowerCase())}));if(i)return null==e?void 0:e.substring(i.length).trim()}return e},i.getDeviceLevel=function(e){return void 0===e&&(e=""),{high:P.High,medium:P.Medium,middle:P.Medium,low:P.Low}[e]||P.Unknown},e}(),b=function(){function e(e){this.device={},this.parse(e)}var i=e.prototype;return i.getDeviceInfo=function(){return this.device},i.parse=function(e){var i=e.system.match(/\w+/);i&&(this.device.platform=i[0].trim());var n=e.system.match(/[\d.]+/);if(n&&(this.device.osVersion=n[0].trim()),"devtools"===e.platform)for(var t,o,r=null!=(t=y.wechat[e.model])?t:e.model,h=f(g.iPhone);!(o=h()).done;){var d=o.value;if(d.name===r){e.model=d.model;break}}if("iOS"===this.device.platform){var a=e.model.match(/^(.*?)<(.*?)>$/);a?(this.device.model=a[2].trim(),this.device.originalModel=e.model):this.device.model=e.model}else this.device.model=e.model;e.benchmarkLevel<=0?this.device.level=P.Unknown:e.benchmarkLevel<=10?this.device.level=P.Low:e.benchmarkLevel<=20?this.device.level=P.Medium:this.device.level=P.High,this.device.memoryMB=e.memorySize,this.device.sourceData=e},e}(),I=function(){function e(e,i){this.options=e,this.device=i,this.isIOS=!1}var n=e.prototype;return n.getDowngradeResult=function(){var e=this,i=this.options.downgradeCallback;if(i){var n=i(this.device);if(n)return n.reason||(n.reason="downgradeCallback"),n}if(this.isIOS="iOS"===this.device.platform,this.level=this.getRenderLevel(),this.device.model){var t=this.device.model.toLowerCase();if(void 0!==(this.isIOS?p.iPhone:p.android).find((function(i){var n=i.toLowerCase();return e.isIOS?n===t:n.includes(t)||t.includes(n)})))return{downgrade:!0,level:this.level,reason:"Downgrade by model list",deviceInfo:this.device}}return void 0!==(this.isIOS?w.iOS:w.android).find((function(i){return i===e.device.osVersion}))?{downgrade:!0,level:this.level,reason:"Downgrade by OS version list",deviceInfo:this.device}:{downgrade:!1,level:this.level,reason:"",deviceInfo:this.device}},n.getRenderLevel=function(){if(this.options.level)return this.options.level;if(this.device.level){if(this.device.level===P.High)return i.RenderLevel.S;if(this.device.level===P.Medium)return i.RenderLevel.A;if(this.device.level===P.Low)return i.RenderLevel.B}if(this.isIOS&&this.device.model&&/iPhone(\d+),/.test(this.device.model)){var e=+RegExp.$1;return e<=9?i.RenderLevel.B:e<10?i.RenderLevel.A:i.RenderLevel.S}return this.device.memoryMB?this.device.memoryMB<4e3?i.RenderLevel.B:this.device.memoryMB<6e3?i.RenderLevel.A:i.RenderLevel.S:this.isIOS?i.RenderLevel.S:i.RenderLevel.B},e}(),A=Symbol("@@_inter_pause"),L=!1;function O(e){void 0===e&&(e={}),L||(!function(e){var i=e.autoPause;l.addEventListener("unload",(function(){n().forEach((function(e){return e.dispose()}))})),i&&(document.addEventListener("pause",R),document.addEventListener("resume",V))}(e),L=!0);var h,d=e.mockDowngrade;if(void 0!==d)return{downgrade:d,level:null!=(h=e.level)?h:i.RenderLevel.S,reason:"mock"};var a=function(e){var i=e.queryDeviceInMiniApp,n=e.deviceInfo;if(n)return n;if(i){if(t()){if(my.canIUse("getSystemInfo")){var h=my.getSystemInfo();return new M(h).getDeviceInfo()}o.error("Can't use getSystemInfo in Alipay MiniProgram.")}if(r()){if(wx.canIUse("getDeviceInfo")){var d=wx.getDeviceInfo();return new b(d).getDeviceInfo()}o.error("Can't use getDeviceInfo in WeChat MiniProgram.")}else o.error("Non-mini program environment and try to get device info from user agent.")}return(new S).getDeviceInfo()}(e);return new I(e,a).getDowngradeResult()}function D(){return h()?i.RenderLevel.S:i.RenderLevel.B}function R(e){e.target===document&&(o.info("Auto pause all players with data offloaded."),n().forEach((function(e){e.paused||(e.pause({offloadTexture:!0}),e[A]=!0)})))}function V(e){e.target===document&&(o.info("Auto resume all players."),n().forEach((function(e){e[A]&&(e.resume(),e[A]=!1)})))}var x=function(e){function i(){return e.apply(this,arguments)}return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(i&&i.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),i&&c(e,i)}(i,e),i.processRawJSON=function(e,i){return void 0===i&&(i={}),(n=function(){var e,n,t;return v(this,(function(r){if(n=null==(e=i.pluginData)?void 0:e.downgrade){if(n.downgrade)throw new Error("Downgraded, reason: "+n.reason)}else o.warn("No downgrade result in pluginData of SceneLoadOptions.");return i.renderLevel||(i.renderLevel=null!=(t=null==n?void 0:n.level)?t:D()),[2]}))},function(){var e=this,i=arguments;return new Promise((function(t,o){var r=n.apply(e,i);function h(e){u(r,t,o,h,d,"next",e)}function d(e){u(r,t,o,h,d,"throw",e)}h(void 0)}))})();var n},i}(d),k="2.7.0-beta.0";a("downgrade",x,s),o.info("Plugin downgrade version: "+k+"."),k!==e.version&&console.error("注意:请统一 Downgrade 插件与 Player 版本,不统一的版本混用会有不可预知的后果!","\nAttention: Please ensure the Downgrade plugin is synchronized with the Player version. Mixing and matching incompatible versions may result in unpredictable consequences!");export{M as AlipayMiniprogramParser,P as DeviceLevel,S as UADecoder,b as WechatMiniprogramParser,D as getDefaultRenderLevel,O as getDowngradeResult,k as version};
|
|
2
2
|
//# sourceMappingURL=alipay.mjs.map
|