jd-minigame-ci 0.6.2 → 0.6.3

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.
Files changed (2) hide show
  1. package/dist/jgc.js +1 -1
  2. package/package.json +1 -1
package/dist/jgc.js CHANGED
@@ -1,2 +1,2 @@
1
1
  #!/usr/bin/env node
2
- !function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var r=t();for(var n in r)("object"==typeof exports?exports:e)[n]=r[n]}}(global,(()=>(()=>{var e={85:e=>{e.exports={FAIL_CODE:-1,SUCCEED_CODE:0}},538:(e,t,r)=>{function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function o(){"use strict";/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */o=function(){return t};var e,t={},r=Object.prototype,a=r.hasOwnProperty,i=Object.defineProperty||function(e,t,r){e[t]=r.value},c="function"==typeof Symbol?Symbol:{},s=c.iterator||"@@iterator",u=c.asyncIterator||"@@asyncIterator",l=c.toStringTag||"@@toStringTag";function f(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{f({},"")}catch(e){f=function(e,t,r){return e[t]=r}}function p(e,t,r,n){var o=t&&t.prototype instanceof b?t:b,a=Object.create(o.prototype),c=new N(n||[]);return i(a,"_invoke",{value:j(e,r,c)}),a}function h(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}t.wrap=p;var m="suspendedStart",d="suspendedYield",y="executing",v="completed",g={};function b(){}function w(){}function x(){}var k={};f(k,s,(function(){return this}));var S=Object.getPrototypeOf,E=S&&S(S(T([])));E&&E!==r&&a.call(E,s)&&(k=E);var _=x.prototype=b.prototype=Object.create(k);function P(e){["next","throw","return"].forEach((function(t){f(e,t,(function(e){return this._invoke(t,e)}))}))}function G(e,t){function r(o,i,c,s){var u=h(e[o],e,i);if("throw"!==u.type){var l=u.arg,f=l.value;return f&&"object"==n(f)&&a.call(f,"__await")?t.resolve(f.__await).then((function(e){r("next",e,c,s)}),(function(e){r("throw",e,c,s)})):t.resolve(f).then((function(e){l.value=e,c(l)}),(function(e){return r("throw",e,c,s)}))}s(u.arg)}var o;i(this,"_invoke",{value:function(e,n){function a(){return new t((function(t,o){r(e,n,t,o)}))}return o=o?o.then(a,a):a()}})}function j(t,r,n){var o=m;return function(a,i){if(o===y)throw Error("Generator is already running");if(o===v){if("throw"===a)throw i;return{value:e,done:!0}}for(n.method=a,n.arg=i;;){var c=n.delegate;if(c){var s=I(c,n);if(s){if(s===g)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===m)throw o=v,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=y;var u=h(t,r,n);if("normal"===u.type){if(o=n.done?v:d,u.arg===g)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(o=v,n.method="throw",n.arg=u.arg)}}}function I(t,r){var n=r.method,o=t.iterator[n];if(o===e)return r.delegate=null,"throw"===n&&t.iterator.return&&(r.method="return",r.arg=e,I(t,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),g;var a=h(o,t.iterator,r.arg);if("throw"===a.type)return r.method="throw",r.arg=a.arg,r.delegate=null,g;var i=a.arg;return i?i.done?(r[t.resultName]=i.value,r.next=t.nextLoc,"return"!==r.method&&(r.method="next",r.arg=e),r.delegate=null,g):i:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,g)}function L(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function O(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function N(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(L,this),this.reset(!0)}function T(t){if(t||""===t){var r=t[s];if(r)return r.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,i=function r(){for(;++o<t.length;)if(a.call(t,o))return r.value=t[o],r.done=!1,r;return r.value=e,r.done=!0,r};return i.next=i}}throw new TypeError(n(t)+" is not iterable")}return w.prototype=x,i(_,"constructor",{value:x,configurable:!0}),i(x,"constructor",{value:w,configurable:!0}),w.displayName=f(x,l,"GeneratorFunction"),t.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===w||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,x):(e.__proto__=x,f(e,l,"GeneratorFunction")),e.prototype=Object.create(_),e},t.awrap=function(e){return{__await:e}},P(G.prototype),f(G.prototype,u,(function(){return this})),t.AsyncIterator=G,t.async=function(e,r,n,o,a){void 0===a&&(a=Promise);var i=new G(p(e,r,n,o),a);return t.isGeneratorFunction(r)?i:i.next().then((function(e){return e.done?e.value:i.next()}))},P(_),f(_,l,"Generator"),f(_,s,(function(){return this})),f(_,"toString",(function(){return"[object Generator]"})),t.keys=function(e){var t=Object(e),r=[];for(var n in t)r.push(n);return r.reverse(),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},t.values=T,N.prototype={constructor:N,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(O),!t)for(var r in this)"t"===r.charAt(0)&&a.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=e)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var r=this;function n(n,o){return c.type="throw",c.arg=t,r.next=n,o&&(r.method="next",r.arg=e),!!o}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],c=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var s=a.call(i,"catchLoc"),u=a.call(i,"finallyLoc");if(s&&u){if(this.prev<i.catchLoc)return n(i.catchLoc,!0);if(this.prev<i.finallyLoc)return n(i.finallyLoc)}else if(s){if(this.prev<i.catchLoc)return n(i.catchLoc,!0)}else{if(!u)throw Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return n(i.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var n=this.tryEntries[r];if(n.tryLoc<=this.prev&&a.call(n,"finallyLoc")&&this.prev<n.finallyLoc){var o=n;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var i=o?o.completion:{};return i.type=e,i.arg=t,o?(this.method="next",this.next=o.finallyLoc,g):this.complete(i)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),g},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),O(r),g}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var o=n.arg;O(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={iterator:T(t),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=e),g}},t}function a(e,t,r,n,o,a,i){try{var c=e[a](i),s=c.value}catch(e){return void r(e)}c.done?t(s):Promise.resolve(s).then(n,o)}var i=r(652),c=r(928),s=r(172),u=r(410).globSync;function l(e){try{if(i.pathExistsSync(e))return!0;if(l(c.dirname(e)))return i.mkdirsSync(e),!0}catch(e){console.log("make dir error,",e)}}t.writeFile=function(){var e,t=(e=o().mark((function e(t,r){var n,a=arguments;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:n=a.length>2&&void 0!==a[2]?a[2]:"utf8",l(c.posix.parse(t).dir)&&i.writeFileSync(t,r,n);case 4:case"end":return e.stop()}}),e)})),function(){var t=this,r=arguments;return new Promise((function(n,o){var i=e.apply(t,r);function c(e){a(i,n,o,c,s,"next",e)}function s(e){a(i,n,o,c,s,"throw",e)}c(void 0)}))});return function(e,r){return t.apply(this,arguments)}}(),t.verifyGameRequiredFilesExist=function(e,t){return i.pathExistsSync(e)?"game"===t?f(e):"plugin"===t?p(e):{code:0,err_msg:"ok"}:{code:-1,err_msg:"当前入口文件目录不存在!"}};var f=function(e){var t=u("game.json",{cwd:e,ignore:"node_modules/**"}),r=u("game.js",{cwd:e,ignore:"node_modules/**"});return 0===t.length?{code:-1,err_msg:"被打包的游戏的目录下不存在game.json!"}:0===r.length?{code:-1,err_msg:"被打包的游戏的目录下不存在game.js!"}:{code:0,err_msg:"ok"}},p=function(e){return 0===u("plugin.json",{cwd:e,ignore:"node_modules/**"}).length?{code:-1,err_msg:"被打包的插件的目录下不存在plugin.json!"}:{code:0,err_msg:"ok"}};t.hasJgcConfigFile=function(e){try{return i.accessSync(e,i.constants.F_OK),!0}catch(e){return console.log("文件不存在"),!1}},t.compressDirectory=function(e,t){return new Promise((function(r,n){var o=i.createWriteStream(t),a=s("zip",{zlib:{level:9}});o.on("close",(function(){return r(a.pointer())})),a.on("warning",(function(e){return"ENOENT"!==e.code&&n(e)})),a.on("error",n),a.pipe(o),a.glob("**/*",{cwd:e,ignore:["**/.*","**/*.js.map"]}),a.finalize()}))},t.deleteFile=function(e){i.existsSync(e)&&i.unlink(e,(function(e){e&&console.log("删除zip文件失败: ",e)}))}},522:e=>{function t(e){return t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},t(e)}function r(e,t){for(var r=0;r<t.length;r++){var o=t[r];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,n(o.key),o)}}function n(e){var r=function(e,r){if("object"!=t(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var o=n.call(e,r||"default");if("object"!=t(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===r?String:Number)(e)}(e,"string");return"symbol"==t(r)?r:r+""}var o=function(){return e=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.configPrompts=[{name:"type",type:"list",message:"请选择项目类型:",choices:[{name:"游戏",value:"game"},{name:"插件",value:"plugin"}],default:"game"},{name:"appId",type:"input",message:"请输入appId:",validate:function(e){return!!e||"appId不能为空"}},{name:"requestToken",type:"input",message:"请输入代码上传秘钥:",validate:function(e){return!!e||"代码上传秘钥不能为空"}},{name:"entry",type:"input",message:"请输入需要被打包的游戏(或者插件)的路径:",default:"./"},{name:"versionName",type:"input",message:"请输入需要被打包的游戏(或者插件)的版本号:",default:"1.0.0"},{name:"description",type:"input",message:"请输入需要被打包的游戏的备注:",when:function(e){return"game"===e.type},default:""}]},(t=[{key:"getPrompts",value:function(){return this.configPrompts}}])&&r(e.prototype,t),n&&r(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t,n}();e.exports=o},593:e=>{function t(e){return t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},t(e)}function r(e,t){for(var r=0;r<t.length;r++){var o=t[r];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,n(o.key),o)}}function n(e){var r=function(e,r){if("object"!=t(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var o=n.call(e,r||"default");if("object"!=t(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===r?String:Number)(e)}(e,"string");return"symbol"==t(r)?r:r+""}var o=function(){return e=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.configPrompts=[{name:"versionName",type:"input",message:"版本号:",default:"1.0.0"},{name:"versionFeature",type:"input",message:"版本特性(长度为10~30个字符):",default:""},{name:"useGuide",type:"input",message:"使用指南(仅限文字和代码,长度为20~1000个字符):",default:"插件使用指南不建议在这里填写,建议到小游戏插件MP控制台提审时修改,这里是占位文本"}]},(t=[{key:"getPrompts",value:function(){return this.configPrompts}}])&&r(e.prototype,t),n&&r(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t,n}();e.exports=o},890:(e,t,r)=>{var n=r(420),o=r(241),a=r(268);t.showQrCode=function(e){return new Promise((function(t,r){n.read(e).then((function(e){var r=e.bitmap,n=r.width,i=r.height,c=r.data,s=new Uint8ClampedArray(c),u=a(s,n,i);o.generate(u.data,{small:!1}),t(!0)})).catch((function(e){r(!1)}))}))},t.getBase64=function(e){return n.read(e).then((function(e){return e.getBase64Async("image/png")})).catch((function(){throw new Error("获取二维码base64失败")}))}},425:(e,t,r)=>{function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function o(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function a(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?o(Object(r),!0).forEach((function(t){i(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):o(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function i(e,t,r){return(t=f(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function c(){"use strict";/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */c=function(){return t};var e,t={},r=Object.prototype,o=r.hasOwnProperty,a=Object.defineProperty||function(e,t,r){e[t]=r.value},i="function"==typeof Symbol?Symbol:{},s=i.iterator||"@@iterator",u=i.asyncIterator||"@@asyncIterator",l=i.toStringTag||"@@toStringTag";function f(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{f({},"")}catch(e){f=function(e,t,r){return e[t]=r}}function p(e,t,r,n){var o=t&&t.prototype instanceof b?t:b,i=Object.create(o.prototype),c=new N(n||[]);return a(i,"_invoke",{value:j(e,r,c)}),i}function h(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}t.wrap=p;var m="suspendedStart",d="suspendedYield",y="executing",v="completed",g={};function b(){}function w(){}function x(){}var k={};f(k,s,(function(){return this}));var S=Object.getPrototypeOf,E=S&&S(S(T([])));E&&E!==r&&o.call(E,s)&&(k=E);var _=x.prototype=b.prototype=Object.create(k);function P(e){["next","throw","return"].forEach((function(t){f(e,t,(function(e){return this._invoke(t,e)}))}))}function G(e,t){function r(a,i,c,s){var u=h(e[a],e,i);if("throw"!==u.type){var l=u.arg,f=l.value;return f&&"object"==n(f)&&o.call(f,"__await")?t.resolve(f.__await).then((function(e){r("next",e,c,s)}),(function(e){r("throw",e,c,s)})):t.resolve(f).then((function(e){l.value=e,c(l)}),(function(e){return r("throw",e,c,s)}))}s(u.arg)}var i;a(this,"_invoke",{value:function(e,n){function o(){return new t((function(t,o){r(e,n,t,o)}))}return i=i?i.then(o,o):o()}})}function j(t,r,n){var o=m;return function(a,i){if(o===y)throw Error("Generator is already running");if(o===v){if("throw"===a)throw i;return{value:e,done:!0}}for(n.method=a,n.arg=i;;){var c=n.delegate;if(c){var s=I(c,n);if(s){if(s===g)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===m)throw o=v,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=y;var u=h(t,r,n);if("normal"===u.type){if(o=n.done?v:d,u.arg===g)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(o=v,n.method="throw",n.arg=u.arg)}}}function I(t,r){var n=r.method,o=t.iterator[n];if(o===e)return r.delegate=null,"throw"===n&&t.iterator.return&&(r.method="return",r.arg=e,I(t,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),g;var a=h(o,t.iterator,r.arg);if("throw"===a.type)return r.method="throw",r.arg=a.arg,r.delegate=null,g;var i=a.arg;return i?i.done?(r[t.resultName]=i.value,r.next=t.nextLoc,"return"!==r.method&&(r.method="next",r.arg=e),r.delegate=null,g):i:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,g)}function L(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function O(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function N(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(L,this),this.reset(!0)}function T(t){if(t||""===t){var r=t[s];if(r)return r.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var a=-1,i=function r(){for(;++a<t.length;)if(o.call(t,a))return r.value=t[a],r.done=!1,r;return r.value=e,r.done=!0,r};return i.next=i}}throw new TypeError(n(t)+" is not iterable")}return w.prototype=x,a(_,"constructor",{value:x,configurable:!0}),a(x,"constructor",{value:w,configurable:!0}),w.displayName=f(x,l,"GeneratorFunction"),t.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===w||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,x):(e.__proto__=x,f(e,l,"GeneratorFunction")),e.prototype=Object.create(_),e},t.awrap=function(e){return{__await:e}},P(G.prototype),f(G.prototype,u,(function(){return this})),t.AsyncIterator=G,t.async=function(e,r,n,o,a){void 0===a&&(a=Promise);var i=new G(p(e,r,n,o),a);return t.isGeneratorFunction(r)?i:i.next().then((function(e){return e.done?e.value:i.next()}))},P(_),f(_,l,"Generator"),f(_,s,(function(){return this})),f(_,"toString",(function(){return"[object Generator]"})),t.keys=function(e){var t=Object(e),r=[];for(var n in t)r.push(n);return r.reverse(),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},t.values=T,N.prototype={constructor:N,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(O),!t)for(var r in this)"t"===r.charAt(0)&&o.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=e)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var r=this;function n(n,o){return c.type="throw",c.arg=t,r.next=n,o&&(r.method="next",r.arg=e),!!o}for(var a=this.tryEntries.length-1;a>=0;--a){var i=this.tryEntries[a],c=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var s=o.call(i,"catchLoc"),u=o.call(i,"finallyLoc");if(s&&u){if(this.prev<i.catchLoc)return n(i.catchLoc,!0);if(this.prev<i.finallyLoc)return n(i.finallyLoc)}else if(s){if(this.prev<i.catchLoc)return n(i.catchLoc,!0)}else{if(!u)throw Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return n(i.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var n=this.tryEntries[r];if(n.tryLoc<=this.prev&&o.call(n,"finallyLoc")&&this.prev<n.finallyLoc){var a=n;break}}a&&("break"===e||"continue"===e)&&a.tryLoc<=t&&t<=a.finallyLoc&&(a=null);var i=a?a.completion:{};return i.type=e,i.arg=t,a?(this.method="next",this.next=a.finallyLoc,g):this.complete(i)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),g},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),O(r),g}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var o=n.arg;O(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={iterator:T(t),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=e),g}},t}function s(e,t,r,n,o,a,i){try{var c=e[a](i),s=c.value}catch(e){return void r(e)}c.done?t(s):Promise.resolve(s).then(n,o)}function u(e){return function(){var t=this,r=arguments;return new Promise((function(n,o){var a=e.apply(t,r);function i(e){s(a,n,o,i,c,"next",e)}function c(e){s(a,n,o,i,c,"throw",e)}i(void 0)}))}}function l(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,f(n.key),n)}}function f(e){var t=function(e,t){if("object"!=n(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var o=r.call(e,t||"default");if("object"!=n(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==n(t)?t:t+""}var p=r(938),h=r(305),m=r(652),d=r(85),y=d.FAIL_CODE,v=d.SUCCEED_CODE,g=(r(60).checkConfigOptions,{dev:"http://beta-vapp-ide.jd.com",prod:"https://vapp-ide-pack.jd.com",test:"http://test-vapp-ide.jdtest.net"}),b=function(){return e=function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"prod";!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.URL=g[t]},t=[{key:"uploadProject",value:(E=u(c().mark((function e(t){var r,n,o;return c().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,this.pack(t);case 3:if((r=e.sent).code===v){e.next=6;break}return e.abrupt("return",r);case 6:return n=r.data.result,e.next=9,this.loopQuery(t,n);case 9:if((o=e.sent).code===v){e.next=12;break}return e.abrupt("return",o);case 12:return e.abrupt("return",{code:v,packId:o.data});case 15:return e.prev=15,e.t0=e.catch(0),e.abrupt("return",{code:y,err_msg:e.t0 instanceof Error?e.t0.message:"上传失败"});case 18:case"end":return e.stop()}}),e,this,[[0,15]])}))),function(e){return E.apply(this,arguments)})},{key:"sendPostRequest",value:(S=u(c().mark((function e(t,r){var n,o,i,s,u=arguments;return c().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:for(i in n=u.length>2&&void 0!==u[2]?u[2]:"请求失败",o=new h,r)o.append(i,r[i]);return e.prev=3,e.next=6,p.post(t,o,{headers:a({},o.getHeaders())});case 6:if((s=e.sent).data.code!==v){e.next=9;break}return e.abrupt("return",{code:v,data:s.data});case 9:return e.abrupt("return",{code:y,err_msg:"".concat(n,": ").concat(s.data.errorMessage)});case 12:return e.prev=12,e.t0=e.catch(3),e.abrupt("return",{code:y,err_msg:"".concat(n,": ").concat(e.t0)});case 15:case"end":return e.stop()}}),e,null,[[3,12]])}))),function(e,t){return S.apply(this,arguments)})},{key:"pluginPublishRequest",value:(k=u(c().mark((function e(t,r,n,o){var a,i,s,u,l=arguments;return c().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return a=l.length>4&&void 0!==l[4]?l[4]:"请求失败",i=JSON.stringify(r),s={method:"post",maxBodyLength:1/0,url:"".concat(t,"?appId=").concat(n,"&requestToken=").concat(o),headers:{"Content-Type":"application/json"},data:i},e.prev=3,e.next=6,p.request(s);case 6:if((u=e.sent).data.code!==v){e.next=9;break}return e.abrupt("return",{code:v,data:u.data});case 9:return e.abrupt("return",{code:y,err_msg:"".concat(a,": ").concat(u.data.errorMessage)});case 12:return e.prev=12,e.t0=e.catch(3),e.abrupt("return",{code:y,err_msg:"".concat(a,": ").concat(e.t0)});case 15:case"end":return e.stop()}}),e,null,[[3,12]])}))),function(e,t,r,n){return k.apply(this,arguments)})},{key:"pack",value:(x=u(c().mark((function e(t){var r,n,o,a,i;return c().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.sourceFile,n=t.appId,o=t.requestToken,a="".concat(this.URL,"/v1/devops/pack"),i={appId:n,requestToken:o,sourceFile:m.createReadStream(r)},e.abrupt("return",this.sendPostRequest(a,i,"文件上传报错"));case 5:case"end":return e.stop()}}),e,this)}))),function(e){return x.apply(this,arguments)})},{key:"loopQuery",value:(w=u(c().mark((function e(t,r){var n,o,a,i;return c().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:n=Date.now(),o=2e6,a=3e3;case 3:if(!(Date.now()-n<o)){e.next=15;break}return e.next=6,new Promise((function(e){return setTimeout(e,a)}));case 6:return e.next=8,this.queryPkgId(t,r);case 8:if((i=e.sent).code===v){e.next=11;break}return e.abrupt("return",{code:y,err_msg:i.err_msg});case 11:if(!i.data.result){e.next=13;break}return e.abrupt("return",{code:v,data:i.data.result});case 13:e.next=3;break;case 15:return e.abrupt("return",{code:y,err_msg:"查询超时"});case 16:case"end":return e.stop()}}),e,this)}))),function(e,t){return w.apply(this,arguments)})},{key:"queryPkgId",value:(b=u(c().mark((function e(t,r){var n,o,a;return c().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=t.appId,o=t.requestToken,a={appId:n,requestToken:o,uuid:r},e.abrupt("return",this.sendPostRequest("".concat(this.URL,"/v1/ci/queryPackIdByUuid"),a,"获取构建包id失效"));case 3:case"end":return e.stop()}}),e,this)}))),function(e,t){return b.apply(this,arguments)})},{key:"generateQrCode",value:(d=u(c().mark((function e(t){var r,n,o,a,i,s;return c().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.appId,n=t.requestToken,o=t.packId,a={appId:r,requestToken:n,packId:o},e.next=4,this.sendPostRequest("".concat(this.URL,"/v1/ci/queryQrcodeByPackId"),a,"获取二维码失效");case 4:if((i=e.sent).code===v){e.next=7;break}return e.abrupt("return",{code:y,err_msg:i.err_msg});case 7:if(!i.data.result){e.next=13;break}return(s=new Date).setMinutes(s.getMinutes()+25),e.abrupt("return",{code:v,imgUrl:i.data.result,expiredTime:"".concat(this.addZeroForShort(s.getHours()),":").concat(this.addZeroForShort(s.getMinutes()))});case 13:return e.abrupt("return",{code:y,err_msg:"二维码生成完成请求返回为空"});case 14:case"end":return e.stop()}}),e,this)}))),function(e){return d.apply(this,arguments)})},{key:"addZeroForShort",value:function(e){return String(e).length<2?"0".concat(String(e)):String(e)}},{key:"commitDevVersion",value:(f=u(c().mark((function e(t,r){var n,o,a,i,s,u;return c().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=t.appId,o=t.requestToken,a=t.versionName,i=t.description,s={packId:r,appId:n,requestToken:o,versionName:a,description:i},e.next=4,this.sendPostRequest("".concat(this.URL,"/v1/ci/commitDevVersion"),s,"设置为开发版失效");case 4:if((u=e.sent).code===v){e.next=7;break}return e.abrupt("return",u);case 7:return e.abrupt("return",{code:v,devId:u.data.result});case 8:case"end":return e.stop()}}),e,this)}))),function(e,t){return f.apply(this,arguments)})},{key:"setDevExperience",value:(s=u(c().mark((function e(t,r){var n,o,a,i;return c().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=t.appId,o=t.requestToken,a={appId:n,requestToken:o,devId:r},e.next=4,this.sendPostRequest("".concat(this.URL,"/v1/ci/devExperience"),a,"设置为体验版失效");case 4:if((i=e.sent).code===v){e.next=7;break}return e.abrupt("return",i);case 7:return e.abrupt("return",{code:v});case 8:case"end":return e.stop()}}),e,this)}))),function(e,t){return s.apply(this,arguments)})},{key:"queryExperienceQrcodeByPackId",value:(i=u(c().mark((function e(t){var r,n,o,a,i,s;return c().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.appId,n=t.requestToken,o={appId:r,requestToken:n},e.next=4,this.sendPostRequest("".concat(this.URL,"/v1/ci/queryExperienceQrcode"),o,"获取体验二维码失效");case 4:if((a=e.sent).code===v){e.next=7;break}return e.abrupt("return",{code:y,err_msg:a.err_msg});case 7:return i=a.data.result,(s=new Date).setMinutes(s.getMinutes()+25),e.abrupt("return",{code:v,imgUrl:i,expiredTime:"".concat(this.addZeroForShort(s.getHours()),":").concat(this.addZeroForShort(s.getMinutes()))});case 11:case"end":return e.stop()}}),e,this)}))),function(e){return i.apply(this,arguments)})},{key:"uploadPlugin",value:(o=u(c().mark((function e(t){var r,n,o,a,i,s,u;return c().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.sourceFile,n=t.appId,o=t.requestToken,a=t.versionName,i="".concat(this.URL,"/v1/ci/pluginPack"),s={appId:n,requestToken:o,versionName:a,sourceFile:m.createReadStream(r)},e.next=6,this.sendPostRequest(i,s,"插件构建报错");case 6:if((u=e.sent).code===v){e.next=9;break}return e.abrupt("return",{code:y,err_msg:u.err_msg});case 9:return e.abrupt("return",{code:v,result:u.data.result});case 10:case"end":return e.stop()}}),e,this)}))),function(e){return o.apply(this,arguments)})},{key:"publishPlugin",value:(n=u(c().mark((function e(t){var r,n,o,a,i,s,u,l,f;return c().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.versionName,n=t.versionFeature,o=t.useGuide,a=t.packId,i=t.appId,s=t.requestToken,u="".concat(this.URL,"/v1/ci/plugin-dev"),l={versionName:r,versionFeature:n,useGuide:o,packId:a},e.next=6,this.pluginPublishRequest(u,l,i,s,"插件上传报错");case 6:if((f=e.sent).code===v){e.next=9;break}return e.abrupt("return",{code:y,err_msg:f.err_msg});case 9:return e.abrupt("return",{code:v});case 10:case"end":return e.stop()}}),e,this)}))),function(e){return n.apply(this,arguments)})}],t&&l(e.prototype,t),r&&l(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t,r,n,o,i,s,f,d,b,w,x,k,S,E}();e.exports=b},60:(e,t)=>{function r(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,o,a,i,c=[],s=!0,u=!1;try{if(a=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;s=!1}else for(;!(s=(n=a.call(r)).done)&&(c.push(n.value),c.length!==t);s=!0);}catch(e){u=!0,o=e}finally{try{if(!s&&null!=r.return&&(i=r.return(),Object(i)!==i))return}finally{if(u)throw o}}return c}}(e,t)||function(e,t){if(e){if("string"==typeof e)return n(e,t);var r={}.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?n(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function n(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function o(e){return"string"==typeof e&&!!e.trim()}t.checkConfigOptions=function(e,t){var n=e||{},a=n.type,i=n.appId,c=n.requestToken,s=n.entry,u=n.versionName,l=n.description;if("game"!==a)return{code:-1,err_msg:"请选择项目构建类型为小游戏"};for(var f=1===t?{appId:i,requestToken:c,entry:s}:{appId:i,requestToken:c,entry:s,versionName:u,description:l},p=0,h=Object.entries(f);p<h.length;p++){var m=r(h[p],2),d=m[0];if(!o(m[1]))return{code:-1,err_msg:"".concat(d," 不能为空")}}return{code:0,err_msg:"ok"}},t.checkPluginConfig=function(e){var t=e||{},n=t.type,a=t.appId,i=t.requestToken,c=t.entry,s=t.versionName;if("plugin"!==n)return{code:-1,err_msg:"请选择项目构建类型为插件"};for(var u={appId:a,requestToken:i,entry:c,versionName:s},l=0,f=Object.entries(u);l<f.length;l++){var p=r(f[l],2),h=p[0];if(!o(p[1]))return{code:-1,err_msg:"".concat(h," 不能为空")}}return{code:0,err_msg:"ok"}}},664:(e,t,r)=>{function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function o(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,o,a,i,c=[],s=!0,u=!1;try{if(a=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;s=!1}else for(;!(s=(n=a.call(r)).done)&&(c.push(n.value),c.length!==t);s=!0);}catch(e){u=!0,o=e}finally{try{if(!s&&null!=r.return&&(i=r.return(),Object(i)!==i))return}finally{if(u)throw o}}return c}}(e,t)||function(e,t){if(e){if("string"==typeof e)return a(e,t);var r={}.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?a(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function a(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function i(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function c(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?i(Object(r),!0).forEach((function(t){s(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):i(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function s(e,t,r){return(t=h(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function u(){"use strict";/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */u=function(){return t};var e,t={},r=Object.prototype,o=r.hasOwnProperty,a=Object.defineProperty||function(e,t,r){e[t]=r.value},i="function"==typeof Symbol?Symbol:{},c=i.iterator||"@@iterator",s=i.asyncIterator||"@@asyncIterator",l=i.toStringTag||"@@toStringTag";function f(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{f({},"")}catch(e){f=function(e,t,r){return e[t]=r}}function p(e,t,r,n){var o=t&&t.prototype instanceof b?t:b,i=Object.create(o.prototype),c=new N(n||[]);return a(i,"_invoke",{value:j(e,r,c)}),i}function h(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}t.wrap=p;var m="suspendedStart",d="suspendedYield",y="executing",v="completed",g={};function b(){}function w(){}function x(){}var k={};f(k,c,(function(){return this}));var S=Object.getPrototypeOf,E=S&&S(S(T([])));E&&E!==r&&o.call(E,c)&&(k=E);var _=x.prototype=b.prototype=Object.create(k);function P(e){["next","throw","return"].forEach((function(t){f(e,t,(function(e){return this._invoke(t,e)}))}))}function G(e,t){function r(a,i,c,s){var u=h(e[a],e,i);if("throw"!==u.type){var l=u.arg,f=l.value;return f&&"object"==n(f)&&o.call(f,"__await")?t.resolve(f.__await).then((function(e){r("next",e,c,s)}),(function(e){r("throw",e,c,s)})):t.resolve(f).then((function(e){l.value=e,c(l)}),(function(e){return r("throw",e,c,s)}))}s(u.arg)}var i;a(this,"_invoke",{value:function(e,n){function o(){return new t((function(t,o){r(e,n,t,o)}))}return i=i?i.then(o,o):o()}})}function j(t,r,n){var o=m;return function(a,i){if(o===y)throw Error("Generator is already running");if(o===v){if("throw"===a)throw i;return{value:e,done:!0}}for(n.method=a,n.arg=i;;){var c=n.delegate;if(c){var s=I(c,n);if(s){if(s===g)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===m)throw o=v,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=y;var u=h(t,r,n);if("normal"===u.type){if(o=n.done?v:d,u.arg===g)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(o=v,n.method="throw",n.arg=u.arg)}}}function I(t,r){var n=r.method,o=t.iterator[n];if(o===e)return r.delegate=null,"throw"===n&&t.iterator.return&&(r.method="return",r.arg=e,I(t,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),g;var a=h(o,t.iterator,r.arg);if("throw"===a.type)return r.method="throw",r.arg=a.arg,r.delegate=null,g;var i=a.arg;return i?i.done?(r[t.resultName]=i.value,r.next=t.nextLoc,"return"!==r.method&&(r.method="next",r.arg=e),r.delegate=null,g):i:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,g)}function L(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function O(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function N(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(L,this),this.reset(!0)}function T(t){if(t||""===t){var r=t[c];if(r)return r.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var a=-1,i=function r(){for(;++a<t.length;)if(o.call(t,a))return r.value=t[a],r.done=!1,r;return r.value=e,r.done=!0,r};return i.next=i}}throw new TypeError(n(t)+" is not iterable")}return w.prototype=x,a(_,"constructor",{value:x,configurable:!0}),a(x,"constructor",{value:w,configurable:!0}),w.displayName=f(x,l,"GeneratorFunction"),t.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===w||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,x):(e.__proto__=x,f(e,l,"GeneratorFunction")),e.prototype=Object.create(_),e},t.awrap=function(e){return{__await:e}},P(G.prototype),f(G.prototype,s,(function(){return this})),t.AsyncIterator=G,t.async=function(e,r,n,o,a){void 0===a&&(a=Promise);var i=new G(p(e,r,n,o),a);return t.isGeneratorFunction(r)?i:i.next().then((function(e){return e.done?e.value:i.next()}))},P(_),f(_,l,"Generator"),f(_,c,(function(){return this})),f(_,"toString",(function(){return"[object Generator]"})),t.keys=function(e){var t=Object(e),r=[];for(var n in t)r.push(n);return r.reverse(),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},t.values=T,N.prototype={constructor:N,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(O),!t)for(var r in this)"t"===r.charAt(0)&&o.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=e)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var r=this;function n(n,o){return c.type="throw",c.arg=t,r.next=n,o&&(r.method="next",r.arg=e),!!o}for(var a=this.tryEntries.length-1;a>=0;--a){var i=this.tryEntries[a],c=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var s=o.call(i,"catchLoc"),u=o.call(i,"finallyLoc");if(s&&u){if(this.prev<i.catchLoc)return n(i.catchLoc,!0);if(this.prev<i.finallyLoc)return n(i.finallyLoc)}else if(s){if(this.prev<i.catchLoc)return n(i.catchLoc,!0)}else{if(!u)throw Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return n(i.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var n=this.tryEntries[r];if(n.tryLoc<=this.prev&&o.call(n,"finallyLoc")&&this.prev<n.finallyLoc){var a=n;break}}a&&("break"===e||"continue"===e)&&a.tryLoc<=t&&t<=a.finallyLoc&&(a=null);var i=a?a.completion:{};return i.type=e,i.arg=t,a?(this.method="next",this.next=a.finallyLoc,g):this.complete(i)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),g},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),O(r),g}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var o=n.arg;O(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={iterator:T(t),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=e),g}},t}function l(e,t,r,n,o,a,i){try{var c=e[a](i),s=c.value}catch(e){return void r(e)}c.done?t(s):Promise.resolve(s).then(n,o)}function f(e){return function(){var t=this,r=arguments;return new Promise((function(n,o){var a=e.apply(t,r);function i(e){l(a,n,o,i,c,"next",e)}function c(e){l(a,n,o,i,c,"throw",e)}i(void 0)}))}}function p(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,h(n.key),n)}}function h(e){var t=function(e,t){if("object"!=n(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var o=r.call(e,t||"default");if("object"!=n(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==n(t)?t:t+""}var m=r(938),d=r(305),y=r(896),v=r(626),g=r(759),b=r(427).downloadFile,w=function(){return e=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.apiUrls=v.getApiUrls(),this.defaultTimeout=6e4},t=[{key:"setEnv",value:function(e){e?(v.currentEnv="wasmdev",this.apiUrls=v.getApiUrls("wasmdev")):(v.currentEnv="wasmprod",this.apiUrls=v.getApiUrls("wasmprod"))}},{key:"downloadFile",value:(x=f(u().mark((function e(t){var r,n;return u().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.filePath,n=t.url,e.abrupt("return",new Promise((function(e,t){b({filePath:r,url:n,success:e,fail:t})})));case 2:case"end":return e.stop()}}),e)}))),function(e){return x.apply(this,arguments)})},{key:"uploadFile",value:(w=f(u().mark((function e(t){var r,n,o,a,i,s,l,f,p,h;return u().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.appId,n=t.requestToken,o=t.filePath,a=t.category,(i=new d).append("category",a),i.append("appId",r),i.append("requestToken",n),i.append("sourceFile",y.createReadStream(o)),s={method:"post",url:this.apiUrls.UPLOAD_FILE,headers:c(c({},i.getHeaders()),{},{appId:r,requestToken:n}),data:i,maxBodyLength:1/0,maxContentLength:1/0,timeout:6e5},e.prev=7,e.next=10,m(s);case 10:if(l=e.sent,f=l.data,p=f.code,h=f.result,0!==p){e.next=16;break}return e.abrupt("return",h);case 16:g.endLogProcess(null,"Upload failed: ".concat(l.data.msg||"Unknown error"));case 17:e.next=22;break;case 19:e.prev=19,e.t0=e.catch(7),g.endLogProcess(null,"File upload failed: ".concat(e.t0.message));case 22:case"end":return e.stop()}}),e,this,[[7,19]])}))),function(e){return w.apply(this,arguments)})},{key:"addGameVersion",value:(h=f(u().mark((function e(t){var r,n;return u().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=new FormData,Object.entries(t).forEach((function(e){var t=o(e,2),n=t[0],a=t[1];return r.append(n,a)})),e.next=4,m({method:"post",url:this.apiUrls.ADD_GAME_VERSION,data:r});case 4:return 0!==(n=e.sent).data.code&&g.endLogProcess(null,n.data.errorMessage),e.abrupt("return",n.data);case 7:case"end":return e.stop()}}),e,this)}))),function(e){return h.apply(this,arguments)})},{key:"initialize",value:(l=f(u().mark((function e(t){var r,n;return u().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=new FormData,Object.entries(t).forEach((function(e){var t=o(e,2),n=t[0],a=t[1];return r.append(n,a)})),e.next=4,m({method:"post",url:this.apiUrls.INIT,timeout:this.defaultTimeout,data:r});case 4:return 0!==(n=e.sent).data.code&&g.endLogProcess(null,n.data.errorMessage),e.abrupt("return",n.data);case 7:case"end":return e.stop()}}),e,this)}))),function(e){return l.apply(this,arguments)})},{key:"getInitResult",value:(s=f(u().mark((function e(t){var r;return u().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,m({method:"get",url:this.apiUrls.GET_INIT_RES,timeout:this.defaultTimeout,params:t});case 2:return 0!==(r=e.sent).data.code&&g.endLogProcess(null,r.data.errorMessage),e.abrupt("return",r.data);case 5:case"end":return e.stop()}}),e,this)}))),function(e){return s.apply(this,arguments)})},{key:"split",value:(i=f(u().mark((function e(t){var r,n;return u().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=new FormData,Object.entries(t).forEach((function(e){var t=o(e,2),n=t[0],a=t[1];return r.append(n,a)})),e.next=4,m({url:this.apiUrls.SPLIT,method:"post",data:r});case 4:return 0!==(n=e.sent).data.code&&g.endLogProcess(null,n.data.errorMessage),e.abrupt("return",n.data);case 7:case"end":return e.stop()}}),e,this)}))),function(e){return i.apply(this,arguments)})},{key:"getGameSplitInfo",value:(a=f(u().mark((function e(t){var r;return u().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,m({url:this.apiUrls.GET_GAME_SPLIT_INFO,method:"get",params:t});case 2:return 0!==(r=e.sent).data.code&&g.endLogProcess(null,r.data.errorMessage),e.abrupt("return",r.data);case 5:case"end":return e.stop()}}),e,this)}))),function(e){return a.apply(this,arguments)})},{key:"getSymbolSize",value:(n=f(u().mark((function e(t){var r;return u().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,m({method:"get",url:this.apiUrls.GET_SYMBOL_SIZE,params:t});case 2:return 0!==(r=e.sent).data.code&&g.endLogProcess(null,r.data.errorMessage),e.abrupt("return",r.data);case 5:case"end":return e.stop()}}),e,this)}))),function(e){return n.apply(this,arguments)})}],t&&p(e.prototype,t),r&&p(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t,r,n,a,i,s,l,h,w,x}();e.exports=new w},626:(e,t,r)=>{function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function o(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,a(n.key),n)}}function a(e){var t=function(e,t){if("object"!=n(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var o=r.call(e,t||"default");if("object"!=n(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==n(t)?t:t+""}var i=r(928),c=r(896),s=function(){return e=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.environments={wasmdev:"http://beta-vapp-ide.jd.com",wasmprod:"https://vapp-ide-pack.jd.com"},this.currentEnv="wasmdev"},t=[{key:"getBaseUrl",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.currentEnv;return this.environments[e]}},{key:"getApiUrls",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.currentEnv,t=this.getBaseUrl(e);return{UPLOAD_FILE:"".concat(t,"/wasm/upload"),ADD_GAME_VERSION:"".concat(t,"/wasm/packageBind"),INIT:"".concat(t,"/wasm/initialize"),SPLIT:"".concat(t,"/wasm/build"),GET_GAME_SPLIT_INFO:"".concat(t,"/wasm/queryBuildResultBySubVersion"),DOWNLOAD_FILE:"".concat(t,"/wasm/download"),GET_SYMBOL_SIZE:"".concat(t,"/wasm/getSymbolSize"),GET_INIT_RES:"".concat(t,"/wasm/queryInitResult")}}},{key:"loadProjectConfig",value:function(e){var t=i.resolve(e,"./jgc.config.js"),n="function"==typeof require?require:r(220);delete n.cache[n.resolve(t)];var o=n(t),a=o.type,s=void 0===a?"game":a,u=o.entry,l=o.appId,f=o.requestToken,p=i.resolve(e,u),h=i.resolve(p,"./.codesplitcache"),m=i.resolve(h,"./original"),d=i.resolve(m,"./wasmcode/");return c.existsSync(h)||c.mkdirSync(h,{recursive:!0}),c.existsSync(m)||c.mkdirSync(m,{recursive:!0}),c.existsSync(d)||c.mkdirSync(d,{recursive:!0}),{type:s,entry:u,appId:l,requestToken:f,mainWasmCachePath:c.readdirSync(d).filter((function(e){return".br"===i.extname(e)}))[0],originalCacheDir:m,fullEntryPath:p}}}],t&&o(e.prototype,t),n&&o(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t,n}();e.exports=new s},46:e=>{e.exports={createWasmSplitCodeBySimd:function(){return' import {\n tableSize,\n setImportGlobal\n } from "./import-func-index";\n import {\n\n isIOS\n } from "./check-version";\n\n let b = (wx.getAccountInfoSync() || {}).miniProgram;\n let webcookieInfo = {};\n wx.requestWebCookie && wx.requestWebCookie({\n needpin: 1,\n success(e) {\n webcookieInfo = {\n pt_pin: e.pt_pin,\n pt_ket: e.ticket\n }\n },\n });\n const isTrial = b && "release" != b.envVersion;\n let subpackageTask,\n callbackArray = [],\n isLoaded = false;\n\n function loadSubWasmPackage(doneCallback, needBlock) {\n if (isLoaded) {\n doneCallback(needBlock);\n return;\n }\n let loadStart = Date.now();\n GameGlobal.unityNamespace.eventLog("start loadSubPackage wasmcode1");\n callbackArray.push({\n callback: doneCallback,\n needBlock: needBlock,\n });\n if (!subpackageTask) {\n subpackageTask = wx.loadSubpackage({\n name: "wasmcode1",\n success() {\n let a = Date.now() - loadStart;\n GameGlobal.unityNamespace.eventLog("下载代码分包1完毕: ", (a / 1e3).toFixed(2), "s");\n GameGlobal.manager.subWasmDownloaded(a);\n isLoaded = true;\n callbackArray.forEach((a) => a.callback(a.needBlock));\n callbackArray = [];\n },\n fail(a) {\n GameGlobal.manager.Logger.pluginError("load wasmcode1 fail:", a);\n GameGlobal.manager.subWasmDownloadError(a);\n },\n });\n let currentProgress = 0;\n subpackageTask.onProgressUpdate((e) => {\n var t = Math.floor(e.progress / 10);\n if (t != currentProgress) {\n let a = (e.totalBytesWritten / 1048576).toFixed(2),\n t = (e.totalBytesExpectedToWrite / 1048576).toFixed(2);\n console.log("代码分包1下载进度", e.progress, a, "MB;", t, "MB");\n }\n currentProgress = t;\n });\n }\n\n }\n let loadedSub = false,\n isInstanced = false;\n\n function h(needBlock) {\n GameGlobal.unityNamespace.eventLog("start compileSubWasm: needBlock ", needBlock);\n GameGlobal.manager.beforeLoadSubWasm();\n let instanceStart = Date.now();\n const subWasmPath = "wasmcode1/" + GameGlobal.unityNamespace.CODE_FILE_MD5 + "." + GameGlobal.unityNamespace.GAME_NAME + ".wasm.code.unityweb.wasm.br";\n let callback = (a) => {\n let cost = Date.now() - instanceStart;\n GameGlobal.manager.subWasmCompiled(cost);\n GameGlobal.unityNamespace.eventLog("[PLUGIN SUBWASM LOG]subwasm loaded: ", cost);\n setMemory(wasm_split_info.primary.memory);\n isInstanced = true;\n\n };\n WXWebAssembly.instantiate(subWasmPath, wasm_split_info)\n .then(callback)\n .catch((a) => {\n console.error("wasmcode1 catch ", a);\n });\n }\n\n function reTry(a) {\n let e = function () {\n isInstanced ? a() : setTimeout(e, 1);\n };\n setTimeout(e, 1);\n }\n\n function invokeWait(needBlock) {\n if (!isInstanced) {\n if (!loadedSub) {\n loadedSub = true;\n GameGlobal.unityNamespace.eventLog("start instantiateSubWasm: needBlock ", needBlock);\n loadSubWasmPackage(h, needBlock);\n\n }\n\n }\n }\n\n function innerInvokeWasmBuffer(funcName, e) {\n\n\n\n function base64Decode(e, t = 1) {\n const s = e.replace(/[^A-Za-z0-9+/]/g, ""),\n i = s.length,\n n = t ? Math.ceil((3 * i + 1 >>> 2) / t) * t : 3 * i + 1 >>> 2,\n a = new Uint8Array(n);\n let o = 0,\n r = 0;\n for (let e = 0; e < i; e++) {\n const t = 3 & e;\n if (o |= kkk(s.charCodeAt(e)) << 18 - 6 * t, 3 === t || i - e == 1) {\n for (let e = 0; e < 3 && r < n; e++, r++) a[r] = o >>> (16 >>> e & 24) & 255;\n o = 0\n }\n }\n return a\n }\n\n function kkk(e) {\n return e > 64 && e < 91 ? e - 65 : e > 96 && e < 123 ? e - 71 : e > 47 && e < 58 ? e + 4 : 43 === e ? 62 : 47 === e ? 63 : 0\n }\n console.log(\'!!!!!innerInvokeWasmBuffer\')\n GameGlobal.manager.wasmsplit.innerInvokeWasmBuffer1 = ({\n funcName: _funcName,\n importObj: _importObj,\n success: _success,\n fail: _fail\n }) => {\n\n try {\n var aatime = new Date().getTime();\n const n = new GameGlobal.nativeXHR,\n a = {\n appId: GameGlobal.unityNamespace.APPID,\n wasmMd5: GameGlobal.unityNamespace.CODE_FILE_MD5,\n subVersion: GameGlobal.unityNamespace.wasmSubVersion,\n funcIndex: _funcName\n };\n console.log(\'!!!!aaa\', a)\n\n const params = new URLSearchParams({\n\n\n functionId: "jdaGameGetPatchFunc",\n appid: "mp-minigame",\n body: JSON.stringify(a) // 转为 JSON 字符串\n }).toString();\n var baseUrl = GameGlobal.unityNamespace.baseUrl;\n console.log(\'!!!!urlll\', baseUrl+"/?" + params)\n\n // n.open("GET", onEventCallback.GET_WASM_FUNC, false);\n n.open(\'GET\', baseUrl + "/?" + params, false);\n n.withCredentials = true;\n n.setRequestHeader("Cookie", "pt_key=" + webcookieInfo.pt_key + ";pt_pin=" + webcookieInfo.pt_pin);\n try {\n\n n.send()\n if (n.status == 200) {\n var bbtime = new Date().getTime()\n console.log(\'响应:\', bbtime - aatime, n.responseText);\n const e = JSON.parse(n.responseText);\n const a = e.result.codeStr;\n\n const o = base64Decode(a);\n console.log(\'!!!base64Decode\', o, a, _importObj, typeof GameGlobal.nativeWASM.Instance, typeof GameGlobal.nativeWASM.Module)\n const r = new GameGlobal.nativeWASM.Instance(new GameGlobal.nativeWASM.Module(o), _importObj);\n console.log(\'!!!!执行\', new Date().getTime() - bbtime)\n _success(r);\n\n } else {\n console.error(\'请求失败:\', n.statusText);\n }\n\n\n } catch (e) {\n\n }\n } catch (e) {}\n };\n\n\n GameGlobal.manager.wasmsplit.innerInvokeWasmBuffer1({\n //invokeWasmBuffer: invokeWasmBuffer,\n funcName: funcName,\n importObj: window.wasm_split_info,\n fail(t) {\n if (e > 0) {\n GameGlobal.unityNamespace.eventLog("fetch table_id: ", funcName, "; remainRetryTimes: ", e);\n return innerInvokeWasmBuffer(funcName, e - 1);\n }\n GameGlobal.unityNamespace.eventLog(\n "fetch table_id:",\n funcName,\n "; md5: ",\n GameGlobal.unityNamespace.CODE_FILE_MD5,\n "; subversion: ",\n GameGlobal.unityNamespace.WASM_SPLIT_SUB_VERSION,\n "; err: ",\n t\n );\n if ("system error" === t.errmsg || "content is null" === t.errmsg) {\n GameGlobal.onCrash();\n } else {\n wx.showModal({\n title: "网络状态异常",\n content: "请检查网络后重启 小游戏",\n showCancel: false,\n confirmText: wx.restartMiniProgram ? "立即重启" : "确定",\n success() {\n if (wx.restartMiniProgram) {\n wx.restartMiniProgram({});\n }\n },\n });\n }\n },\n });\n }\n window.Math_abs = Math.abs;\n window.Math_cos = Math.cos;\n window.Math_sin = Math.sin;\n window.Math_sqrt = Math.sqrt;\n window.Math_ceil = Math.ceil;\n window.Math_floor = Math.floor;\n window.Math_pow = Math.pow;\n window.Math_min = Math.min;\n window.Math_max = Math.max;\n window.Math_fround = Math.fround;\n window.Math_imul = Math.imul;\n window.Math_clz32 = Math.clz32;\n window.Math_trunc = Math.trunc;\n window.FUNCTION_TABLE = [];\n let calledFunc = new Map(),\n mainCalledFunc = new Set();\n\n function _reportCalledFunc() {\n let logCallBasePtr = GameGlobal.unityNamespace.logCallBasePtr;\n if (logCallBasePtr) {\n for (var memoryBuffer = new Int32Array(window.wasm_split_info.primary.memory.buffer), t = 0; t < GameGlobal.unityNamespace.logCallMemorySize; t++) {\n if (memoryBuffer[logCallBasePtr + t]) {\n calledFunc.set(t, memoryBuffer[logCallBasePtr + t]);\n memoryBuffer[logCallBasePtr + t] = 0;\n }\n }\n }\n if (calledFunc.size > 0) {\n GameGlobal.manager.reportCalledFuncsJD({\n called_func_list: Array.from(calledFunc.keys()),\n func_cnt_list: Array.from(calledFunc.values()),\n sub_version: GameGlobal.unityNamespace.WASM_SPLIT_SUB_VERSION,\n });\n calledFunc.clear();\n }\n if (mainCalledFunc.size > 0) {\n GameGlobal.manager.reportCalledFuncsJD({\n called_func_list: Array.from(mainCalledFunc),\n sub_version: GameGlobal.unityNamespace.WASM_SPLIT_SUB_VERSION,\n func_type: 1,\n });\n mainCalledFunc.clear();\n }\n\n setTimeout(_reportCalledFunc, 5000);\n }\n\n function setMemory(memory) {\n if (GameGlobal.unityNamespace.initedRedirMem) {\n return;\n }\n GameGlobal.unityNamespace.initedRedirMem = true;\n var fileManager = wx.getFileSystemManager();\n try {\n var binData = fileManager.readFileSync("wasmcode/" + GameGlobal.unityNamespace.CODE_FILE_MD5 + "." + GameGlobal.unityNamespace.GAME_NAME + ".redirmem.bin");\n } catch (err) {\n GameGlobal.unityNamespace.eventLog("[PLUGIN LOG] release does not have redirmem.bin");\n return;\n }\n let binArray = new Int32Array(binData);\n\n GameGlobal.unityNamespace.logCallMemorySize = binArray.length;\n\n let addr = memory.buffer.byteLength - binData.byteLength;\n\n GameGlobal.unityNamespace.logCallBaseAddr.value = addr;\n\n addr >>= 2;\n GameGlobal.unityNamespace.logCallBasePtr = addr;\n\n for (var memoryData = new Int32Array(memory.buffer), o = 0; o < binArray.length; o++) {\n memoryData[addr + o] = binArray[o];\n }\n\n let s = Module._malloc(binData.byteLength);\n GameGlobal.unityNamespace.logCallBaseAddr.value = s;\n s >>= 2;\n GameGlobal.unityNamespace.logCallBasePtr = s;\n for (o = 0; o < binArray.length; o++) {\n memoryData[s + o] = memoryData[addr + o];\n }\n\n }\n GameGlobal.unityNamespace.reportCalledFunc = _reportCalledFunc;\n\n if (!GameGlobal.unityNamespace.pluginCalledMainCbs) {\n GameGlobal.unityNamespace.pluginCalledMainCbs = [];\n }\n\n if (!GameGlobal.unityNamespace.pluginCalledMainCb) {\n GameGlobal.unityNamespace.pluginCalledMainCb = function () {\n this.pluginCalledMainCbs.forEach((a) => a());\n };\n }\n\n isTrial && !GameGlobal.canUseH5Renderer && GameGlobal.unityNamespace.pluginCalledMainCbs.push(_reportCalledFunc);\n\n GameGlobal.unityNamespace.instantiateWasm = function (instantiateWasmInfo, receiveInstance) {\n console.log("in wasm-split instantiateWasm");\n const module = GameGlobal.manager.gameInstance.Module,\n asm2wasm = (instantiateWasmInfo.asm2wasm = instantiateWasmInfo.asm2wasm || {});\n asm2wasm["f64-to-int"] =\n asm2wasm["f64-to-int"] ||\n function (a) {\n return 0 | a;\n };\n asm2wasm["f64-rem"] =\n asm2wasm["f64-rem"] ||\n function (a, e) {\n return a % e;\n };\n\n instantiateWasmInfo.env = instantiateWasmInfo.env || {};\n\n instantiateWasmInfo.primary = {\n table: instantiateWasmInfo.env.table ||\n new WebAssembly.Table({\n initial: tableSize,\n maximum: tableSize,\n element: "anyfunc",\n }),\n memory: instantiateWasmInfo.env.memory,\n };\n\n setImportGlobal(instantiateWasmInfo);\n\n instantiateWasmInfo.wasm_split = instantiateWasmInfo.wasm_split || {};\n instantiateWasmInfo.wasm_split.wait = function () {\n let waitTableId = GameGlobal.unityNamespace.waitTableId.value;\n GameGlobal.unityNamespace.eventLog("wait for func: ", waitTableId);\n if (isIOS && canUseH5Renderer) {\n return innerInvokeWasmBuffer(waitTableId.toString(), 3);\n }\n invokeWait(true);\n if (GameGlobal.manager.wasmsplit && GameGlobal.manager.wasmsplit.checkNeedReportMissPatchFunc) {\n GameGlobal.manager.wasmsplit.checkNeedReportMissPatchFunc(waitTableId);\n }\n GameGlobal.manager.reportCalledFuncsJD({\n called_func_list: [waitTableId],\n func_type: 2,\n sub_version: GameGlobal.unityNamespace.WASM_SPLIT_SUB_VERSION,\n });\n };\n\n if (GameGlobal.canUseH5Renderer) {\n instantiateWasmInfo.wasm_split.logCall = function (a, e) {};\n } else {\n instantiateWasmInfo.wasm_split.logCall = function (a, e) {\n if (e) {\n mainCalledFunc.add(a);\n }\n calledFunc.set(a, (calledFunc.get(a) || 0) + 1);\n };\n }\n instantiateWasmInfo.wasm_split.__wasm_split_waitTableId = GameGlobal.unityNamespace.waitTableId = new WebAssembly.Global({\n value: "i32",\n mutable: true,\n });\n instantiateWasmInfo.wasm_split.__wasm_split_logCallBaseAddr = GameGlobal.unityNamespace.logCallBaseAddr = new WebAssembly.Global({\n value: "i32",\n mutable: true,\n });\n\n window.wasm_split_info = instantiateWasmInfo;\n let wasmPath = module.wasmPath;\n WebAssembly.instantiate(wasmPath, instantiateWasmInfo).then((resultObject) => {\n let primaryTable = instantiateWasmInfo.primary.table;\n for (var o = 0; o < primaryTable.length; ++o) {\n window.FUNCTION_TABLE[o] = primaryTable.get(o);\n }\n //instance: 包含所有导出的 WebAssembly 函数的 WebAssembly.Instance 对象。\n Object.entries(resultObject.instance.exports).forEach((instanceFunc) => {\n //["ur", Memory(4096)], ["vr", ƒ]\n if ("object" == typeof instanceFunc[1] && instanceFunc[1] instanceof WebAssembly.Memory) {\n instantiateWasmInfo.primary.memory = instanceFunc[1];\n asm2wasm.__wasm_memory_size = window.__wasm_memory_size = () => (instanceFunc[1].buffer.byteLength / 65536) | 0;\n }\n if (instanceFunc[0].startsWith("wasm_split.")) {\n instantiateWasmInfo.primary[instanceFunc[0]] = instanceFunc[1];\n }\n });\n instantiateWasmInfo.primary["wasm_split.initGlobal"] = resultObject.instance.exports.initGlobal;\n resultObject.instance.exports.initGlobal();\n module.asm = resultObject.instance.exports;\n if (GameGlobal.canUseH5Renderer) {\n setMemory(instantiateWasmInfo.primary.memory);\n let runtimeType = "android&wasm3";\n GameGlobal.canUseH5Renderer && (runtimeType = "iOS_hp");\n var instantiatePatch;\n if (GameGlobal.manager.instantiatePatch) {\n instantiatePatch = GameGlobal.manager\n .instantiatePatch(GameGlobal.unityNamespace.WASM_SPLIT_SUB_VERSION, wasm_split_info, {})\n .then(\n (a) => {\n (a && GameGlobal.unityNamespace.eventLog(_runtimeType + " instantiatePatch success ", GameGlobal.unityNamespace.WASM_SPLIT_SUB_VERSION))\n return a;\n }\n )\n .catch((a) => {\n console.warn("[PLUGIN SUBWASM WARN]", _runtimeType, " instantiatePatch warn", a);\n GameGlobal.unityNamespace.eventLog(_runtimeType, "instantiatePatch warn", a);\n })\n } else {\n instantiatePatch = Promise.resolve();\n }\n instantiatePatch.finally(() => {\n console.log("instantiatePatch finally");\n receiveInstance(resultObject.instance, resultObject.module);\n });\n } else {\n GameGlobal.unityNamespace.eventLog("no signal api, start instantiate sub wasm");\n invokeWait(true);\n reTry(() => receiveInstance(resultObject.instance, resultObject.module));\n }\n });\n return {};\n };\n GameGlobal.unityNamespace.compileSubWasm = function () {\n return new Promise((reslove) => {\n GameGlobal.unityNamespace.eventLog("start asyncCompileSubWasm");\n if (isInstanced) return reslove();\n loadSubWasmPackage(() => {\n GameGlobal.unityNamespace.eventLog("async load subpackage done");\n }, false);\n });\n };'},createImportFuncIndexCodeBySimd:function(e,t,r,n,o){return"export const importSubFuncIndexList = [];\nexport const tableSize = ".concat(e,";\nGameGlobal.unityNamespace.wasmSubVersion =").concat(t,';\nGameGlobal.unityNamespace.baseUrl ="').concat(r?"http://beta-vapp-ide.jd.com":"https://vapp-ide-pack.jd.com",'";\nGameGlobal.canUseH5Renderer = GameGlobal.unityNamespace.isIOS &&').concat(!!o,'\nGameGlobal.unityNamespace.requestToken = "').concat(n,'"\nexport function setImportGlobal(info) {info["primary"] = info["primary"] || {};info["primary"]["__stack_pointer"] = new WebAssembly.Global({\n value: "i32",\n mutable: true\n });info["primary"]["__stack_end"] = new WebAssembly.Global({\n value: "i32",\n mutable: true\n });info["primary"]["__stack_base"] = new WebAssembly.Global({\n value: "i32",\n mutable: true\n });};\n \n export function setStackPointer(info) {\n // if (info["primary"]["__stack_pointer"]) {\n // info["primary"]["__stack_pointer"].value = 0;\n // }\n }\n \n export function setImportFunc(info, jCall) {\n \n }\n \n ')}}},225:(e,t,r)=>{function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function o(){"use strict";/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */o=function(){return t};var e,t={},r=Object.prototype,a=r.hasOwnProperty,i=Object.defineProperty||function(e,t,r){e[t]=r.value},c="function"==typeof Symbol?Symbol:{},s=c.iterator||"@@iterator",u=c.asyncIterator||"@@asyncIterator",l=c.toStringTag||"@@toStringTag";function f(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{f({},"")}catch(e){f=function(e,t,r){return e[t]=r}}function p(e,t,r,n){var o=t&&t.prototype instanceof b?t:b,a=Object.create(o.prototype),c=new N(n||[]);return i(a,"_invoke",{value:j(e,r,c)}),a}function h(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}t.wrap=p;var m="suspendedStart",d="suspendedYield",y="executing",v="completed",g={};function b(){}function w(){}function x(){}var k={};f(k,s,(function(){return this}));var S=Object.getPrototypeOf,E=S&&S(S(T([])));E&&E!==r&&a.call(E,s)&&(k=E);var _=x.prototype=b.prototype=Object.create(k);function P(e){["next","throw","return"].forEach((function(t){f(e,t,(function(e){return this._invoke(t,e)}))}))}function G(e,t){function r(o,i,c,s){var u=h(e[o],e,i);if("throw"!==u.type){var l=u.arg,f=l.value;return f&&"object"==n(f)&&a.call(f,"__await")?t.resolve(f.__await).then((function(e){r("next",e,c,s)}),(function(e){r("throw",e,c,s)})):t.resolve(f).then((function(e){l.value=e,c(l)}),(function(e){return r("throw",e,c,s)}))}s(u.arg)}var o;i(this,"_invoke",{value:function(e,n){function a(){return new t((function(t,o){r(e,n,t,o)}))}return o=o?o.then(a,a):a()}})}function j(t,r,n){var o=m;return function(a,i){if(o===y)throw Error("Generator is already running");if(o===v){if("throw"===a)throw i;return{value:e,done:!0}}for(n.method=a,n.arg=i;;){var c=n.delegate;if(c){var s=I(c,n);if(s){if(s===g)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===m)throw o=v,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=y;var u=h(t,r,n);if("normal"===u.type){if(o=n.done?v:d,u.arg===g)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(o=v,n.method="throw",n.arg=u.arg)}}}function I(t,r){var n=r.method,o=t.iterator[n];if(o===e)return r.delegate=null,"throw"===n&&t.iterator.return&&(r.method="return",r.arg=e,I(t,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),g;var a=h(o,t.iterator,r.arg);if("throw"===a.type)return r.method="throw",r.arg=a.arg,r.delegate=null,g;var i=a.arg;return i?i.done?(r[t.resultName]=i.value,r.next=t.nextLoc,"return"!==r.method&&(r.method="next",r.arg=e),r.delegate=null,g):i:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,g)}function L(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function O(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function N(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(L,this),this.reset(!0)}function T(t){if(t||""===t){var r=t[s];if(r)return r.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,i=function r(){for(;++o<t.length;)if(a.call(t,o))return r.value=t[o],r.done=!1,r;return r.value=e,r.done=!0,r};return i.next=i}}throw new TypeError(n(t)+" is not iterable")}return w.prototype=x,i(_,"constructor",{value:x,configurable:!0}),i(x,"constructor",{value:w,configurable:!0}),w.displayName=f(x,l,"GeneratorFunction"),t.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===w||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,x):(e.__proto__=x,f(e,l,"GeneratorFunction")),e.prototype=Object.create(_),e},t.awrap=function(e){return{__await:e}},P(G.prototype),f(G.prototype,u,(function(){return this})),t.AsyncIterator=G,t.async=function(e,r,n,o,a){void 0===a&&(a=Promise);var i=new G(p(e,r,n,o),a);return t.isGeneratorFunction(r)?i:i.next().then((function(e){return e.done?e.value:i.next()}))},P(_),f(_,l,"Generator"),f(_,s,(function(){return this})),f(_,"toString",(function(){return"[object Generator]"})),t.keys=function(e){var t=Object(e),r=[];for(var n in t)r.push(n);return r.reverse(),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},t.values=T,N.prototype={constructor:N,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(O),!t)for(var r in this)"t"===r.charAt(0)&&a.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=e)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var r=this;function n(n,o){return c.type="throw",c.arg=t,r.next=n,o&&(r.method="next",r.arg=e),!!o}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],c=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var s=a.call(i,"catchLoc"),u=a.call(i,"finallyLoc");if(s&&u){if(this.prev<i.catchLoc)return n(i.catchLoc,!0);if(this.prev<i.finallyLoc)return n(i.finallyLoc)}else if(s){if(this.prev<i.catchLoc)return n(i.catchLoc,!0)}else{if(!u)throw Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return n(i.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var n=this.tryEntries[r];if(n.tryLoc<=this.prev&&a.call(n,"finallyLoc")&&this.prev<n.finallyLoc){var o=n;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var i=o?o.completion:{};return i.type=e,i.arg=t,o?(this.method="next",this.next=o.finallyLoc,g):this.complete(i)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),g},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),O(r),g}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var o=n.arg;O(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={iterator:T(t),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=e),g}},t}function a(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,o,a,i,c=[],s=!0,u=!1;try{if(a=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;s=!1}else for(;!(s=(n=a.call(r)).done)&&(c.push(n.value),c.length!==t);s=!0);}catch(e){u=!0,o=e}finally{try{if(!s&&null!=r.return&&(i=r.return(),Object(i)!==i))return}finally{if(u)throw o}}return c}}(e,t)||function(e,t){if(e){if("string"==typeof e)return i(e,t);var r={}.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?i(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function i(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function c(e,t,r,n,o,a,i){try{var c=e[a](i),s=c.value}catch(e){return void r(e)}c.done?t(s):Promise.resolve(s).then(n,o)}var s=r(896),u=r(23).promisify,l=r(759),f=u(s.readFile),p=u(s.writeFile);function h(){var e;return e=o().mark((function e(t,r){var n,a,i,c,s=arguments;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=!(s.length>2&&void 0!==s[2])||s[2],e.prev=1,e.next=4,f(t,"utf8");case 4:if(a=e.sent,i=JSON.parse(a),c=m(i),!n){e.next=11;break}return e.next=10,p(r,JSON.stringify(c,null,2));case 10:return e.abrupt("return");case 11:return e.abrupt("return",c);case 14:throw e.prev=14,e.t0=e.catch(1),l.logErr("处理文件时发生错误: ".concat(e.t0.message)),e.t0;case 18:case"end":return e.stop()}}),e,null,[[1,14]])})),h=function(){var t=this,r=arguments;return new Promise((function(n,o){var a=e.apply(t,r);function i(e){c(a,n,o,i,s,"next",e)}function s(e){c(a,n,o,i,s,"throw",e)}i(void 0)}))},h.apply(this,arguments)}function m(e){var t={"\\28":"(","\\29":")","\\5b":"[","\\5d":"]","\\2c":",","\\20":" "},r={};return Object.entries(e).forEach((function(e){var n=a(e,2),o=n[0],i=n[1];Object.entries(t).forEach((function(e){var t=a(e,2),r=t[0],n=t[1];i=i.replace(new RegExp(r,"g"),n)})),r[o]=i})),r}e.exports=function(e,t){return h.apply(this,arguments)}},427:(e,t,r)=>{function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function o(){"use strict";/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */o=function(){return t};var e,t={},r=Object.prototype,a=r.hasOwnProperty,i=Object.defineProperty||function(e,t,r){e[t]=r.value},c="function"==typeof Symbol?Symbol:{},s=c.iterator||"@@iterator",u=c.asyncIterator||"@@asyncIterator",l=c.toStringTag||"@@toStringTag";function f(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{f({},"")}catch(e){f=function(e,t,r){return e[t]=r}}function p(e,t,r,n){var o=t&&t.prototype instanceof b?t:b,a=Object.create(o.prototype),c=new N(n||[]);return i(a,"_invoke",{value:j(e,r,c)}),a}function h(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}t.wrap=p;var m="suspendedStart",d="suspendedYield",y="executing",v="completed",g={};function b(){}function w(){}function x(){}var k={};f(k,s,(function(){return this}));var S=Object.getPrototypeOf,E=S&&S(S(T([])));E&&E!==r&&a.call(E,s)&&(k=E);var _=x.prototype=b.prototype=Object.create(k);function P(e){["next","throw","return"].forEach((function(t){f(e,t,(function(e){return this._invoke(t,e)}))}))}function G(e,t){function r(o,i,c,s){var u=h(e[o],e,i);if("throw"!==u.type){var l=u.arg,f=l.value;return f&&"object"==n(f)&&a.call(f,"__await")?t.resolve(f.__await).then((function(e){r("next",e,c,s)}),(function(e){r("throw",e,c,s)})):t.resolve(f).then((function(e){l.value=e,c(l)}),(function(e){return r("throw",e,c,s)}))}s(u.arg)}var o;i(this,"_invoke",{value:function(e,n){function a(){return new t((function(t,o){r(e,n,t,o)}))}return o=o?o.then(a,a):a()}})}function j(t,r,n){var o=m;return function(a,i){if(o===y)throw Error("Generator is already running");if(o===v){if("throw"===a)throw i;return{value:e,done:!0}}for(n.method=a,n.arg=i;;){var c=n.delegate;if(c){var s=I(c,n);if(s){if(s===g)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===m)throw o=v,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=y;var u=h(t,r,n);if("normal"===u.type){if(o=n.done?v:d,u.arg===g)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(o=v,n.method="throw",n.arg=u.arg)}}}function I(t,r){var n=r.method,o=t.iterator[n];if(o===e)return r.delegate=null,"throw"===n&&t.iterator.return&&(r.method="return",r.arg=e,I(t,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),g;var a=h(o,t.iterator,r.arg);if("throw"===a.type)return r.method="throw",r.arg=a.arg,r.delegate=null,g;var i=a.arg;return i?i.done?(r[t.resultName]=i.value,r.next=t.nextLoc,"return"!==r.method&&(r.method="next",r.arg=e),r.delegate=null,g):i:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,g)}function L(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function O(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function N(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(L,this),this.reset(!0)}function T(t){if(t||""===t){var r=t[s];if(r)return r.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,i=function r(){for(;++o<t.length;)if(a.call(t,o))return r.value=t[o],r.done=!1,r;return r.value=e,r.done=!0,r};return i.next=i}}throw new TypeError(n(t)+" is not iterable")}return w.prototype=x,i(_,"constructor",{value:x,configurable:!0}),i(x,"constructor",{value:w,configurable:!0}),w.displayName=f(x,l,"GeneratorFunction"),t.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===w||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,x):(e.__proto__=x,f(e,l,"GeneratorFunction")),e.prototype=Object.create(_),e},t.awrap=function(e){return{__await:e}},P(G.prototype),f(G.prototype,u,(function(){return this})),t.AsyncIterator=G,t.async=function(e,r,n,o,a){void 0===a&&(a=Promise);var i=new G(p(e,r,n,o),a);return t.isGeneratorFunction(r)?i:i.next().then((function(e){return e.done?e.value:i.next()}))},P(_),f(_,l,"Generator"),f(_,s,(function(){return this})),f(_,"toString",(function(){return"[object Generator]"})),t.keys=function(e){var t=Object(e),r=[];for(var n in t)r.push(n);return r.reverse(),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},t.values=T,N.prototype={constructor:N,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(O),!t)for(var r in this)"t"===r.charAt(0)&&a.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=e)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var r=this;function n(n,o){return c.type="throw",c.arg=t,r.next=n,o&&(r.method="next",r.arg=e),!!o}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],c=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var s=a.call(i,"catchLoc"),u=a.call(i,"finallyLoc");if(s&&u){if(this.prev<i.catchLoc)return n(i.catchLoc,!0);if(this.prev<i.finallyLoc)return n(i.finallyLoc)}else if(s){if(this.prev<i.catchLoc)return n(i.catchLoc,!0)}else{if(!u)throw Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return n(i.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var n=this.tryEntries[r];if(n.tryLoc<=this.prev&&a.call(n,"finallyLoc")&&this.prev<n.finallyLoc){var o=n;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var i=o?o.completion:{};return i.type=e,i.arg=t,o?(this.method="next",this.next=o.finallyLoc,g):this.complete(i)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),g},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),O(r),g}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var o=n.arg;O(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={iterator:T(t),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=e),g}},t}function a(e,t,r,n,o,a,i){try{var c=e[a](i),s=c.value}catch(e){return void r(e)}c.done?t(s):Promise.resolve(s).then(n,o)}function i(e){return function(){var t=this,r=arguments;return new Promise((function(n,o){var i=e.apply(t,r);function c(e){a(i,n,o,c,s,"next",e)}function s(e){a(i,n,o,c,s,"throw",e)}c(void 0)}))}}var c,s=r(896),u=s.promises,l=r(928),f=r(938),p=function(e,t){return{filePath:e?t:void 0,tempFilePath:t,statusCode:200}},h=function(){var e=i(o().mark((function e(t){return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,u.access(t);case 3:e.next=9;break;case 5:return e.prev=5,e.t0=e.catch(0),e.next=9,u.mkdir(t,{recursive:!0});case 9:case"end":return e.stop()}}),e,null,[[0,5]])})));return function(t){return e.apply(this,arguments)}}(),m=function(){var e=i(o().mark((function e(t){return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,u.stat(t);case 3:if(!e.sent.isDirectory()){e.next=7;break}return e.next=7,u.rm(t,{recursive:!0});case 7:e.next=11;break;case 9:e.prev=9,e.t0=e.catch(0);case 11:case"end":return e.stop()}}),e,null,[[0,9]])})));return function(t){return e.apply(this,arguments)}}();e.exports={downloadFile:(c=i(o().mark((function e(t){var r,n,a,c,d,y,v,g,b;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.url,n=t.filePath,a=t.success,c=t.fail,d=t.complete,y={success:a,fail:c,complete:d},e.prev=2,e.next=5,h(l.dirname(n));case 5:return e.next=7,m(n);case 7:return e.next=9,f({method:"get",url:r,responseType:"stream"});case 9:return v=e.sent,g=s.createWriteStream(n),v.data.pipe(g),e.abrupt("return",new Promise((function(e,t){var r=0,a=parseInt(v.headers["content-length"]),c=v.headers["transfer-encoding"];g.on("finish",i(o().mark((function i(){var s,l,f;return o().wrap((function(o){for(;;)switch(o.prev=o.next){case 0:if(o.prev=0,"chunked"===c||!a||r===a){o.next=5;break}return o.next=4,u.unlink(n);case 4:throw new Error("Download incomplete: Received ".concat(r," of ").concat(a," bytes"));case 5:null===(s=y.success)||void 0===s||s.call(y,p(!0,n)),e(p(!0,n)),o.next=13;break;case 9:o.prev=9,o.t0=o.catch(0),null===(l=y.fail)||void 0===l||l.call(y,{errMsg:o.t0.message}),t(o.t0);case 13:return o.prev=13,null===(f=y.complete)||void 0===f||f.call(y),o.finish(13);case 16:case"end":return o.stop()}}),i,null,[[0,9,13,16]])})))),g.on("error",function(){var e=i(o().mark((function e(r){var a;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,u.unlink(n).catch((function(){}));case 2:null===(a=y.fail)||void 0===a||a.call(y,{errMsg:"Write failed: ".concat(r.message)}),t(r);case 4:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()),v.data.on("data",(function(e){r+=e.length}))})));case 15:return e.prev=15,e.t0=e.catch(2),e.next=19,u.unlink(n).catch((function(){}));case 19:throw null===(b=y.fail)||void 0===b||b.call(y,{errMsg:"Download failed: ".concat(e.t0.message)}),e.t0;case 21:case"end":return e.stop()}}),e,null,[[2,15]])}))),function(e){return c.apply(this,arguments)})}},322:(e,t,r)=>{function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function o(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,a(n.key),n)}}function a(e){var t=function(e,t){if("object"!=n(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var o=r.call(e,t||"default");if("object"!=n(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==n(t)?t:t+""}var i=r(896),c=r(928),s=r(410),u=r(46),l=u.createWasmSplitCodeBySimd,f=u.createImportFuncIndexCodeBySimd,p=r(377),h=function(){return e=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)},r=[{key:"syncPluginCacheFiles",value:function(e,t){this.ensureDirectoryExists(t),this.copyBrFiles(e,t),this.copyFixedFiles(e,t)}},{key:"ensureDirectoryExists",value:function(e){i.existsSync(e)||i.mkdirSync(e,{recursive:!0})}},{key:"copyBrFiles",value:function(e,t){var r=this,n=c.join(e,"wasmcode","*.br");s.sync(n).forEach((function(n){var o=c.relative(e,n),a=c.join(t,o);if(!i.existsSync(a)){var s=c.dirname(a);r.ensureDirectoryExists(s),i.copyFileSync(n,a)}}))}},{key:"copyFixedFiles",value:function(e,t){["game.js","game.json","webgl.wasm.framework.unityweb.js","weapp-adapter.js"].forEach((function(r){var n=c.join(e,r),o=c.join(t,r);if(!i.existsSync(o)){if(!i.existsSync(n))throw new Error("Source file missing: ".concat(n));i.copyFileSync(n,o)}}))}},{key:"processJavaScriptFiles",value:function(e,t,r){this.config=r,i.copyFileSync(c.resolve(r.originalCacheDir,"./game.json"),c.resolve(t,"game.json"));var n=f(e.tableSize,e.subVersion,r.isPre,r.requestToken,r.isRelease);i.writeFileSync(c.resolve(t,"./import-func-index.js"),n);var o=l("");i.writeFileSync(c.resolve(t,"./wasm-split.js"),o);var a=c.resolve(t,"./wasmcode1/");i.writeFileSync(c.resolve(a,"game.js"),"")}},{key:"updateConfigFiles",value:function(e,t,r){this.config=r,this.updateGameJson(e,t),this.updateFrameworkJs(e,t),this.updateGameJs(e,t),this.updateAdapterJs(e,t)}},{key:"updateGameJson",value:function(e,t){var r=JSON.parse(i.readFileSync(c.resolve(this.config.originalCacheDir,"game.json")));r.subpackages.push({name:"wasmcode1",root:"wasmcode1/"}),i.writeFileSync(c.resolve(t,"game.json"),JSON.stringify(r,null,2))}},{key:"updateFrameworkJs",value:function(e,t){var r=c.resolve(this.config.originalCacheDir,"./webgl.wasm.framework.unityweb.js"),n=c.resolve(t,"./webgl.wasm.framework.unityweb.js"),o=i.readFileSync(r,"utf-8");p.forEach((function(e){o=o.replace(e.reg,e.replaceMethod)})),o+=";\nGameGlobal.unityNamespace.useWasmCodeSplit=true;GameGlobal.unityNamespace.WASM_SPLIT_SUB_VERSION=".concat(e.subVersion,";\n"),i.writeFileSync(n,o)}},{key:"updateGameJs",value:function(e,t){var r=this,n=c.resolve(this.config.originalCacheDir,"./game.js"),o=c.resolve(t,"./game.js"),a=i.readFileSync(n,"utf-8");[{reg:/const\s*_unityNamespace\s*=\s*_interopRequireDefault\(require\('\.\/unity-namespace'\)\)/gi,replaceMethod:function(){return"const _unityNamespace = _interopRequireDefault(require('./unity-namespace')); \n require('./wasm-split.js')"}},{reg:"import unityNamespace from './unity-namespace';",replaceMethod:function(){return"import unityNamespace from './unity-namespace';\n import wasm_split from './wasm-split'"}},{reg:/APPID:\s*['"][^'"]*['"]/gi,replaceMethod:function(){return"APPID:'".concat(r.config.appId,"'")}},{reg:"GameGlobal.manager = gameManager;",replaceMethod:function(){return'GameGlobal.manager = gameManager;\n GameGlobal.manager.reportCalledFuncsJD = function (e) {\n function splitArray(array, size = 500) {\n const result = [];\n \n for (let i = 0; i < array.length; i += size) {\n result.push(array.slice(i, i + size));\n }\n \n return result;\n }\n var list = e.called_func_list;\n splitArray(list).forEach((item)=>{\n request({\n called_func_list:item\n })\n })\n\n function request(e){\n e.called_func_list && wx.request({\n url: GameGlobal.unityNamespace.baseUrl+\'/wasm/reportWasmFunction\',\n method: "POST",\n header: {\n \'content-type\': "application/x-www-form-urlencoded"\n },\n data: {\n "appId": GameGlobal.unityNamespace.APPID,\n "requestToken": GameGlobal.unityNamespace.requestToken,\n "calledFuncList": e.called_func_list,\n "subVersion": GameGlobal.unityNamespace.wasmSubVersion,\n "md5": GameGlobal.unityNamespace.CODE_FILE_MD5\n },\n success(res) {\n console.log("!!!!reportCalledFuncs1 success", res)\n\n }\n })\n console.log("!!!reportCalledFuncs", e)\n }\n } '}}].forEach((function(e){a=a.replace(e.reg,e.replaceMethod)})),i.writeFileSync(o,a)}},{key:"updateAdapterJs",value:function(e,t){var r=c.resolve(this.config.originalCacheDir,"./weapp-adapter.js"),n=c.resolve(t,"./weapp-adapter.js"),o=i.readFileSync(r,"utf-8");o='"function" == typeof XMLHttpRequest&&(GameGlobal.nativeXHR = XMLHttpRequest);\n"object" == typeof WebAssembly&&(GameGlobal.nativeWASM = WebAssembly);'+o,i.writeFileSync(n,o)}}],(t=null)&&o(e.prototype,t),r&&o(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t,r}();e.exports=h},471:(e,t,r)=>{function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function o(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,a(n.key),n)}}function a(e){var t=function(e,t){if("object"!=n(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var o=r.call(e,t||"default");if("object"!=n(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==n(t)?t:t+""}var i,c,s,u=r(896),l=r(928),f=function(){return e=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)},r=[{key:"validateProjectStructure",value:function(e,t,r){var n=l.resolve(r,"./jgc.config.js");if(!this.isReadable(n))return{code:-1,msg:null,errMsg:"请先创建配置文件!"};if(!this.isReadable(t.fullEntryPath))return this.ERROR_MESSAGES[e].ENTRY_NOT_FOUND;var o=l.resolve(t.fullEntryPath,"game.json");try{var a;if(null===(a=JSON.parse(u.readFileSync(o,"utf-8")).plugins)||void 0===a||!a.UnityPlugin)return this.ERROR_MESSAGES[e].NOT_UNITY_GAME}catch(t){return this.ERROR_MESSAGES[e].GAME_JSON_NOT_FOUND}return{valid:!0}}},{key:"isReadable",value:function(e){try{return u.accessSync(e,u.constants.R_OK),!0}catch(e){return!1}}}],(t=null)&&o(e.prototype,t),r&&o(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t,r}();i=f,s={init:{ENTRY_NOT_FOUND:{code:-1,msg:"分包初始化失败",errMsg:"请检查entry是否存在"},NOT_UNITY_GAME:{code:-1,msg:"分包初始化失败",errMsg:"该游戏不是unity游戏"},GAME_JSON_NOT_FOUND:{code:-1,msg:"分包初始化失败",errMsg:"请检查game.json是否存在"}},split:{ENTRY_NOT_FOUND:{code:-1,msg:"WASM分包失败",errMsg:"请检查entry是否存在"},NOT_UNITY_GAME:{code:-1,msg:"WASM分包失败",errMsg:"该游戏不是unity游戏"},GAME_JSON_NOT_FOUND:{code:-1,msg:"WASM分包失败",errMsg:"请检查game.json是否存在"}}},(c=a(c="ERROR_MESSAGES"))in i?Object.defineProperty(i,c,{value:s,enumerable:!0,configurable:!0,writable:!0}):i[c]=s,e.exports=f},377:e=>{e.exports=[{reg:/Module\[('|")HEAP8('|")\]\s*=\s*HEAP8\s*=\s*new\s*Int8Array/gi,replaceMethod:function(){return'Module["HEAP8"] = window.EMSCRIPTEN_HEAP8 = HEAP8 = new Int8Array'}},{reg:/Module\[('|")HEAP16('|")\]\s*=\s*HEAP16\s*=\s*new\s*Int16Array/gi,replaceMethod:function(){return'Module["HEAP16"] = window.EMSCRIPTEN_HEAP16 = HEAP16 = new Int16Array'}},{reg:/Module\[('|")HEAP32('|")\]\s*=\s*HEAP32\s*=\s*new\s*Int32Array/gi,replaceMethod:function(){return'Module["HEAP32"] = window.EMSCRIPTEN_HEAP32 = HEAP32 = new Int32Array'}},{reg:/Module\[('|")HEAPU8('|")\]\s*=\s*HEAPU8\s*=\s*new\s*Uint8Array/gi,replaceMethod:function(){return'Module["HEAPU8"] = window.EMSCRIPTEN_HEAPU8 = HEAPU8 = new Uint8Array'}},{reg:/Module\[('|")HEAPU16('|")\]\s*=\s*HEAPU16\s*=\s*new\s*Uint16Array/gi,replaceMethod:function(){return'Module["HEAPU16"] = window.EMSCRIPTEN_HEAPU16 = HEAPU16 = new Uint16Array'}},{reg:/Module\[('|")HEAPU32('|")\]\s*=\s*HEAPU32\s*=\s*new\s*Uint32Array/gi,replaceMethod:function(){return'Module["HEAPU32"] = window.EMSCRIPTEN_HEAPU32 = HEAPU32 = new Uint32Array'}},{reg:/Module\[('|")HEAPF32('|")\]\s*=\s*HEAPF32\s*=\s*new\s*Float32Array/gi,replaceMethod:function(){return'Module["HEAPF32"] = window.EMSCRIPTEN_HEAPF32 = HEAPF32 = new Float32Array'}},{reg:/Module\[('|")HEAPF64('|")\]\s*=\s*HEAPF64\s*=\s*new\s*Float64Array/gi,replaceMethod:function(){return'Module["HEAPF64"] = window.EMSCRIPTEN_HEAPF64 = HEAPF64 = new Float64Array'}},{reg:"calledMain = true;",replaceMethod:function(){return"if (GameGlobal.unityNamespace.pluginCalledMainCb) {\n GameGlobal.unityNamespace.pluginCalledMainCb()\n }\n calledMain = true;"}}]},175:(e,t,r)=>{function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function o(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,c(n.key),n)}}function a(e,t,r){return t&&o(e.prototype,t),r&&o(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function i(e,t,r){return(t=c(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function c(e){var t=function(e,t){if("object"!=n(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var o=r.call(e,t||"default");if("object"!=n(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==n(t)?t:t+""}var s=r(320),u=new(a((function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),i(this,"wasmInit",(function(e){return s.init(e)})),i(this,"wasmUpdate",(function(e){return s.init(Object.assign(e,{isUpdate:!0}))})),i(this,"wasmSplitDev",(function(e){return s.splitBase(Object.assign(e,{isRelease:!1}))})),i(this,"wasmSplitProd",(function(e){return s.splitBase(Object.assign(e,{isRelease:!0}))})),i(this,"wasmSplitInfo",(function(e){return s.getSplitInfo(e)}))}))),l=u.wasmInit,f=u.wasmUpdate,p=u.wasmSplitDev,h=u.wasmSplitProd,m=u.wasmSplitInfo;e.exports={wasmInit:l,wasmUpdate:f,wasmSplitDev:p,wasmSplitProd:h,wasmSplitInfo:m}},759:(e,t,r)=>{function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function o(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,a(n.key),n)}}function a(e){var t=function(e,t){if("object"!=n(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var o=r.call(e,t||"default");if("object"!=n(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==n(t)?t:t+""}var i,c=r(895),s=r(720);e.exports=function(){return e=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)},r=[{key:"logStep",value:function(e){for(var t,r=arguments.length,n=new Array(r>1?r-1:0),o=1;o<r;o++)n[o-1]=arguments[o];(t=console).log.apply(t,[c.green("> ".concat(e))].concat(n))}},{key:"log",value:function(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];setTimeout((function(){var t;(t=console).log.apply(t,[c.green(e)].concat(r))}),0)}},{key:"logInfo",value:function(e){for(var t,r=arguments.length,n=new Array(r>1?r-1:0),o=1;o<r;o++)n[o-1]=arguments[o];(t=console).log.apply(t,[e].concat(n))}},{key:"logErr",value:function(e){for(var t,r=arguments.length,n=new Array(r>1?r-1:0),o=1;o<r;o++)n[o-1]=arguments[o];(t=console).log.apply(t,[c.red(e)].concat(n))}},{key:"startLogProcess",value:function(e){var t=s(e).start(),r={stop:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:e+" 失败";"fail"==(arguments.length>1?arguments[1]:void 0)?t.fail(e):t.succeed(e)}};return i=r,r}},{key:"endLogProcess",value:function(e,t){e||(e=i),e&&"function"==typeof e.stop?e.stop(t,"fail"):console.error("Invalid process handle provided to endLogProcess")}}],(t=null)&&o(e.prototype,t),r&&o(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t,r}()},320:(e,t,r)=>{function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function o(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,o,a,i,c=[],s=!0,u=!1;try{if(a=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;s=!1}else for(;!(s=(n=a.call(r)).done)&&(c.push(n.value),c.length!==t);s=!0);}catch(e){u=!0,o=e}finally{try{if(!s&&null!=r.return&&(i=r.return(),Object(i)!==i))return}finally{if(u)throw o}}return c}}(e,t)||function(e,t){if(e){if("string"==typeof e)return a(e,t);var r={}.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?a(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function a(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function i(){"use strict";/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */i=function(){return t};var e,t={},r=Object.prototype,o=r.hasOwnProperty,a=Object.defineProperty||function(e,t,r){e[t]=r.value},c="function"==typeof Symbol?Symbol:{},s=c.iterator||"@@iterator",u=c.asyncIterator||"@@asyncIterator",l=c.toStringTag||"@@toStringTag";function f(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{f({},"")}catch(e){f=function(e,t,r){return e[t]=r}}function p(e,t,r,n){var o=t&&t.prototype instanceof b?t:b,i=Object.create(o.prototype),c=new N(n||[]);return a(i,"_invoke",{value:j(e,r,c)}),i}function h(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}t.wrap=p;var m="suspendedStart",d="suspendedYield",y="executing",v="completed",g={};function b(){}function w(){}function x(){}var k={};f(k,s,(function(){return this}));var S=Object.getPrototypeOf,E=S&&S(S(T([])));E&&E!==r&&o.call(E,s)&&(k=E);var _=x.prototype=b.prototype=Object.create(k);function P(e){["next","throw","return"].forEach((function(t){f(e,t,(function(e){return this._invoke(t,e)}))}))}function G(e,t){function r(a,i,c,s){var u=h(e[a],e,i);if("throw"!==u.type){var l=u.arg,f=l.value;return f&&"object"==n(f)&&o.call(f,"__await")?t.resolve(f.__await).then((function(e){r("next",e,c,s)}),(function(e){r("throw",e,c,s)})):t.resolve(f).then((function(e){l.value=e,c(l)}),(function(e){return r("throw",e,c,s)}))}s(u.arg)}var i;a(this,"_invoke",{value:function(e,n){function o(){return new t((function(t,o){r(e,n,t,o)}))}return i=i?i.then(o,o):o()}})}function j(t,r,n){var o=m;return function(a,i){if(o===y)throw Error("Generator is already running");if(o===v){if("throw"===a)throw i;return{value:e,done:!0}}for(n.method=a,n.arg=i;;){var c=n.delegate;if(c){var s=I(c,n);if(s){if(s===g)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===m)throw o=v,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=y;var u=h(t,r,n);if("normal"===u.type){if(o=n.done?v:d,u.arg===g)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(o=v,n.method="throw",n.arg=u.arg)}}}function I(t,r){var n=r.method,o=t.iterator[n];if(o===e)return r.delegate=null,"throw"===n&&t.iterator.return&&(r.method="return",r.arg=e,I(t,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),g;var a=h(o,t.iterator,r.arg);if("throw"===a.type)return r.method="throw",r.arg=a.arg,r.delegate=null,g;var i=a.arg;return i?i.done?(r[t.resultName]=i.value,r.next=t.nextLoc,"return"!==r.method&&(r.method="next",r.arg=e),r.delegate=null,g):i:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,g)}function L(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function O(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function N(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(L,this),this.reset(!0)}function T(t){if(t||""===t){var r=t[s];if(r)return r.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var a=-1,i=function r(){for(;++a<t.length;)if(o.call(t,a))return r.value=t[a],r.done=!1,r;return r.value=e,r.done=!0,r};return i.next=i}}throw new TypeError(n(t)+" is not iterable")}return w.prototype=x,a(_,"constructor",{value:x,configurable:!0}),a(x,"constructor",{value:w,configurable:!0}),w.displayName=f(x,l,"GeneratorFunction"),t.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===w||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,x):(e.__proto__=x,f(e,l,"GeneratorFunction")),e.prototype=Object.create(_),e},t.awrap=function(e){return{__await:e}},P(G.prototype),f(G.prototype,u,(function(){return this})),t.AsyncIterator=G,t.async=function(e,r,n,o,a){void 0===a&&(a=Promise);var i=new G(p(e,r,n,o),a);return t.isGeneratorFunction(r)?i:i.next().then((function(e){return e.done?e.value:i.next()}))},P(_),f(_,l,"Generator"),f(_,s,(function(){return this})),f(_,"toString",(function(){return"[object Generator]"})),t.keys=function(e){var t=Object(e),r=[];for(var n in t)r.push(n);return r.reverse(),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},t.values=T,N.prototype={constructor:N,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(O),!t)for(var r in this)"t"===r.charAt(0)&&o.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=e)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var r=this;function n(n,o){return c.type="throw",c.arg=t,r.next=n,o&&(r.method="next",r.arg=e),!!o}for(var a=this.tryEntries.length-1;a>=0;--a){var i=this.tryEntries[a],c=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var s=o.call(i,"catchLoc"),u=o.call(i,"finallyLoc");if(s&&u){if(this.prev<i.catchLoc)return n(i.catchLoc,!0);if(this.prev<i.finallyLoc)return n(i.finallyLoc)}else if(s){if(this.prev<i.catchLoc)return n(i.catchLoc,!0)}else{if(!u)throw Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return n(i.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var n=this.tryEntries[r];if(n.tryLoc<=this.prev&&o.call(n,"finallyLoc")&&this.prev<n.finallyLoc){var a=n;break}}a&&("break"===e||"continue"===e)&&a.tryLoc<=t&&t<=a.finallyLoc&&(a=null);var i=a?a.completion:{};return i.type=e,i.arg=t,a?(this.method="next",this.next=a.finallyLoc,g):this.complete(i)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),g},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),O(r),g}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var o=n.arg;O(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={iterator:T(t),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=e),g}},t}function c(e,t,r,n,o,a,i){try{var c=e[a](i),s=c.value}catch(e){return void r(e)}c.done?t(s):Promise.resolve(s).then(n,o)}function s(e){return function(){var t=this,r=arguments;return new Promise((function(n,o){var a=e.apply(t,r);function i(e){c(a,n,o,i,s,"next",e)}function s(e){c(a,n,o,i,s,"throw",e)}i(void 0)}))}}function u(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,l(n.key),n)}}function l(e){var t=function(e,t){if("object"!=n(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var o=r.call(e,t||"default");if("object"!=n(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==n(t)?t:t+""}var f=r(928),p=r(896),h=r(626),m=r(471),d=r(664),y=r(322),v=r(759),g=r(225),b=(r(427).downloadFile,function(){return e=function e(){var t,r,n;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),t=this,r="downloadSplitedFiles",n=function(){var e=s(i().mark((function e(t){var r,n,o,a,c,s,u,l;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.appId,n=t.requestToken,o=t.md5,a=t.subVersion,c=t.mainWasmFileUrl,s=t.mainWasmFilePath,u=t.subWasmFileUrl,l=t.subWasmFilePath,e.abrupt("return",Promise.all([d.downloadFile({appId:r,requestToken:n,md5:o,subVersion:a,category:3,filePath:s,url:c}),d.downloadFile({appId:r,requestToken:n,md5:o,subVersion:a,category:4,filePath:l,url:u})]));case 2:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),(r=l(r))in t?Object.defineProperty(t,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[r]=n,this.config=null,this.codeMd5=null,this.uploadedWasmCodeBlobId=null,this.uploadedSymbolBlobId=null,this.importLength=null,this.tableSize=null},t=[{key:"validateProject",value:function(e,t,r,n){d.setEnv(r);try{return this.config=h.loadProjectConfig(t),this.config.isPre=r,n&&(this.config.isRelease=!0),m.validateProjectStructure(e,this.config,t)}catch(e){return{code:-1,msg:null,errMsg:"配置加载失败: ".concat(e.message)}}}},{key:"uploadSplitBaseFiles",value:(L=s(i().mark((function e(t){var r,n,o,a;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.appId,n=t.requestToken,o=t.wasmFilePath,a=t.symbolFilePath,e.abrupt("return",Promise.all([d.uploadFile({appId:r,requestToken:n,filePath:o,category:0}),d.uploadFile({appId:r,requestToken:n,filePath:a,category:1})]));case 2:case"end":return e.stop()}}),e)}))),function(e){return L.apply(this,arguments)})},{key:"addGameVersion",value:(I=s(i().mark((function e(){var t,r;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=v.startLogProcess("添加游戏版本"),r={appId:this.config.appId,md5:this.codeMd5,versionDesc:"test",unityVersion:"1.0.0",unityPluginVersion:"1.0.0",wasmSplitPluginVersion:"1.0.0",wasmFileId:this.uploadedWasmCodeBlobId,symbolFileId:this.uploadedSymbolBlobId,requestToken:this.config.requestToken},e.next=4,d.addGameVersion(r);case 4:0===e.sent.code?t.stop("添加游戏版本成功"):t.stop("游戏版本已经存在");case 6:case"end":return e.stop()}}),e,this)}))),function(){return I.apply(this,arguments)})},{key:"initialize",value:(j=s(i().mark((function e(t){var r,n,o,a,c,s=this;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.isUpdate,n={appId:this.config.appId,md5:this.codeMd5,requestToken:this.config.requestToken,incrementUpdate:!!r},e.next=4,d.initialize(n);case 4:return o=e.sent,a=o.result,c={appId:this.config.appId,md5:this.codeMd5,requestToken:this.config.requestToken,uuid:a},e.abrupt("return",this.pollForResult((function(){return d.getInitResult(c)}),(function(e){if(e.result){var t=e.result,r=t.importSize,n=t.tableSize;return s.importLength=r,s.tableSize=n,v.log("importLength: ",s.importLength),v.log("tableSize: ",s.tableSize),!0}return!1})));case 8:case"end":return e.stop()}}),e,this)}))),function(e){return j.apply(this,arguments)})},{key:"pollForResult",value:(G=s(i().mark((function e(t,r){var n,o=arguments;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=o.length>2&&void 0!==o[2]?o[2]:5e3,e.abrupt("return",new Promise((function(e,o){var a=function(){var c=s(i().mark((function c(){var s;return i().wrap((function(i){for(;;)switch(i.prev=i.next){case 0:return i.prev=0,i.next=3,t();case 3:s=i.sent,r(s)?e(s):setTimeout(a,n),i.next=10;break;case 7:i.prev=7,i.t0=i.catch(0),o(i.t0);case 10:case"end":return i.stop()}}),c,null,[[0,7]])})));return function(){return c.apply(this,arguments)}}();a()})));case 2:case"end":return e.stop()}}),e)}))),function(e,t){return G.apply(this,arguments)})},{key:"init",value:(P=s(i().mark((function e(t){var r,n,o,a,c;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if((r=this.validateProject("init",t.srcPath,t.isPreEnv)).valid){e.next=3;break}return e.abrupt("return",r);case 3:return e.prev=3,n=f.resolve(this.config.entry,"./.codesplitcache"),o=f.resolve(n,"./original"),this.setupCacheDirectories(n,o),a=v.startLogProcess("文件备份开始"),y.syncPluginCacheFiles(this.config.entry,o),a.stop("文件备份完成"),e.next=12,this.processSymbolFiles(n,o,t.isUpdate);case 12:return e.next=14,this.uploadFiles(o,n);case 14:return e.next=16,this.addGameVersion();case 16:return c=v.startLogProcess("初始化启动"),e.next=19,this.initialize({isUpdate:t.isUpdate});case 19:return c.stop("初始化完成"),this.saveSplitConfig(n),e.abrupt("return",{code:0,msg:"WASM分包初始化完成",errMsg:null});case 24:return e.prev=24,e.t0=e.catch(3),e.abrupt("return",{code:-1,msg:"初始化失败",errMsg:e.t0.message});case 27:case"end":return e.stop()}}),e,this,[[3,24]])}))),function(e){return P.apply(this,arguments)})},{key:"setupCacheDirectories",value:function(e,t){var r=f.resolve(t,"./wasmcode/"),n=f.resolve(t,this.config.entry,"./wasmcode1/");[t,r].forEach((function(e){p.existsSync(e)||p.mkdirSync(e,{recursive:!0})})),p.existsSync(n)&&p.rmSync(n,{recursive:!0})}},{key:"processSymbolFiles",value:(_=s(i().mark((function e(t,r,n){var o,a,c,s,u;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return o=f.resolve(t,"./unpack"),a=f.resolve(this.config.entry,"./webgl.wasm.symbols.unityweb"),c=f.resolve(o,"./symbol.json"),n||p.existsSync(o)||p.mkdirSync(o,{recursive:!0}),e.next=6,g(a,c);case 6:return s=f.resolve(r,"./wasmcode/"),u=p.readdirSync(s).find((function(e){return".br"===f.extname(e)})),this.codeMd5=u.split(".")[0],e.abrupt("return",{unpackSymbolsPath:c,mainWasmCachePath:u,mainWasmCacheDir:s});case 10:case"end":return e.stop()}}),e,this)}))),function(e,t,r){return _.apply(this,arguments)})},{key:"uploadFiles",value:(E=s(i().mark((function e(t,r){var n,a,c,s,u,l,p,h;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=v.startLogProcess("开始上传文件"),e.next=3,this.processSymbolFiles(r,t,!1);case 3:return a=e.sent,c=a.unpackSymbolsPath,s=a.mainWasmCachePath,a.mainWasmCacheDir,e.next=9,this.uploadSplitBaseFiles({appId:this.config.appId,requestToken:this.config.requestToken,wasmFilePath:f.join(t,"wasmcode",s),symbolFilePath:c});case 9:u=e.sent,l=o(u,2),p=l[0],h=l[1],this.uploadedWasmCodeBlobId=p,this.uploadedSymbolBlobId=h,n.stop("上传文件成功");case 16:case"end":return e.stop()}}),e,this)}))),function(e,t){return E.apply(this,arguments)})},{key:"saveSplitConfig",value:function(e){var t=f.resolve(e,"./codesplit-config.json"),r={appId:this.config.appId,codeMd5:this.codeMd5,tableSize:this.tableSize,uploadedWasmCodeBlobId:this.uploadedWasmCodeBlobId,uploadedSymbolBlobId:this.uploadedSymbolBlobId,importLength:this.importLength};p.writeFileSync(t,JSON.stringify(r,null,2))}},{key:"getSplitInfo",value:(S=s(i().mark((function e(t){var r,n,o;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if((r=this.validateProject("getSplitInfo",t.srcPath,t.isPreEnv)).valid){e.next=3;break}return e.abrupt("return",r);case 3:return e.prev=3,e.next=6,this.readSplitConfig();case 6:if(n=e.sent,(o={appId:this.config.appId,md5:n.codeMd5,requestToken:this.config.requestToken,subVersion:n.subVersion}).subVersion){e.next=10;break}return e.abrupt("return",{code:-1,msg:"暂无分包信息",errMsg:"暂无分包信息"});case 10:return e.next=12,this.querySplitInfo(o);case 12:return e.abrupt("return",e.sent);case 15:throw e.prev=15,e.t0=e.catch(3),console.error("获取分包信息失败:",e.t0),e.t0;case 19:case"end":return e.stop()}}),e,this,[[3,15]])}))),function(e){return S.apply(this,arguments)})},{key:"readSplitConfig",value:(k=s(i().mark((function e(){var t,r,n;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=f.resolve(this.config.entry,"./.codesplitcache"),r=f.resolve(t,"./codesplit-config.json"),e.prev=2,e.next=5,p.promises.readFile(r,"utf-8");case 5:return n=e.sent,e.abrupt("return",JSON.parse(n));case 9:throw e.prev=9,e.t0=e.catch(2),new Error("读取分包配置文件失败: ".concat(e.t0.message));case 12:case"end":return e.stop()}}),e,this,[[2,9]])}))),function(){return k.apply(this,arguments)})},{key:"querySplitInfo",value:(x=s(i().mark((function e(t){var r,n,o,a,c,s,u;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.appId,n=t.requestToken,o=t.md5,a=t.subVersion,e.prev=1,c={appId:r,md5:o,requestToken:n,subVersion:a},v.log("当前分包版本:"+a),e.next=6,d.getSymbolSize(c);case 6:if(s=e.sent,null!=(u=s.result).mainSymbolSize&&null!=u.patchSymbolSize){e.next=10;break}throw new Error("未查询到分包函数信息");case 10:return e.abrupt("return",{code:0,msg:"查询分包信息成功 \n主包函数数量:".concat(u.mainSymbolSize," \n子包函数数量:").concat(u.patchSymbolSize),errMsg:"查询分包信息成功"});case 13:throw e.prev=13,e.t0=e.catch(1),console.error("查询分包信息失败:",e.t0),e.t0;case 17:case"end":return e.stop()}}),e,null,[[1,13]])}))),function(e){return x.apply(this,arguments)})},{key:"getGameSplitRes",value:(w=s(i().mark((function e(t){var r=this;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,n){var o=function(){var a=s(i().mark((function a(c){var s,u,l;return i().wrap((function(a){for(;;)switch(a.prev=a.next){case 0:return s=null,a.prev=1,u={appId:r.config.appId,md5:r.codeMd5,subVersion:t.subVersion,requestToken:r.config.requestToken},a.next=5,d.getGameSplitInfo(u);case 5:null!==(l=a.sent).result?(s&&clearTimeout(s),e(l.result)):(s&&clearTimeout(s),s=setTimeout((function(){return o()}),5e3)),a.next=13;break;case 9:a.prev=9,a.t0=a.catch(1),s&&clearTimeout(s),n(a.t0);case 13:case"end":return a.stop()}}),a,null,[[1,9]])})));return function(e){return a.apply(this,arguments)}}();o()})));case 1:case"end":return e.stop()}}),e)}))),function(e){return w.apply(this,arguments)})},{key:"splitBase",value:(b=s(i().mark((function e(t){var r,n,o,a,c,s,u,l;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if((r=this.validateProject("split",t.srcPath,t.isPreEnv,t.isRelease)).valid){e.next=3;break}return e.abrupt("return",r);case 3:return e.prev=3,(n=this.initializeSplitConfig()).cacheDir,o=n.codeSplitConfigPath,a=n.splitConfig,this.codeMd5=a.codeMd5,c=v.startLogProcess("发送分包请求"),e.next=9,this.buildSubPackage(t,a,o);case 9:if(s=e.sent,c.stop("当前分包版本:"+s),s){e.next=13;break}return e.abrupt("return",{code:-1,msg:"分包构建失败",errMsg:"服务正忙"});case 13:return c=v.startLogProcess("获取分包结果,请稍等"),e.next=16,this.getGameSplitRes({subVersion:s});case 16:return u=e.sent,c.stop("获取分包结果完成"),c=v.startLogProcess("下载分包代码中"),e.next=21,this.processSplitFiles(u,a);case 21:return c.stop("下载分包代码完成"),e.next=24,this.querySplitInfo({appId:this.config.appId,md5:a.codeMd5,requestToken:this.config.requestToken,subVersion:a.subVersion});case 24:return l=e.sent,e.abrupt("return",{code:0,msg:l.errMsg||"WASM分包成功",errMsg:"WASM分包成功"});case 28:return e.prev=28,e.t0=e.catch(3),e.abrupt("return",{code:-1,msg:"分包构建失败",errMsg:e.t0.message});case 31:case"end":return e.stop()}}),e,this,[[3,28]])}))),function(e){return b.apply(this,arguments)})},{key:"initializeSplitConfig",value:function(){var e=f.resolve(this.config.entry,"./.codesplitcache"),t=f.resolve(e,"./codesplit-config.json");return{cacheDir:e,codeSplitConfigPath:t,splitConfig:JSON.parse(p.readFileSync(t,"utf-8"))}}},{key:"buildSubPackage",value:(c=s(i().mark((function e(t,r,n){var o,a,c;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return o={appId:this.config.appId,md5:this.codeMd5,requestToken:this.config.requestToken,isRelease:!!t.isRelease},e.next=3,d.split(o);case 3:if(0===(a=e.sent).code){e.next=15;break}if(!this.isRetryableError(a.errorMessage)){e.next=12;break}if(c=r.subVersion,v.logInfo("尝试查找历史版本,subVersion:",c),c){e.next=10;break}return e.abrupt("return",!1);case 10:e.next=13;break;case 12:throw new Error(a.errorMessage);case 13:e.next=18;break;case 15:c=a.result,r.subVersion=c,p.writeFileSync(n,JSON.stringify(r,null,2));case 18:return e.abrupt("return",c);case 19:case"end":return e.stop()}}),e,this)}))),function(e,t,r){return c.apply(this,arguments)})},{key:"isRetryableError",value:function(e){return["当前md5有正在执行的构建任务,请稍后重试","资源超负荷运行啦,请稍后再试"].includes(e)}},{key:"processSplitFiles",value:(a=s(i().mark((function e(t,r){var n,o,a,c,s;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=t.mainWasmFilePath,o=t.subWasmFilePath,a=this.config.fullEntryPath,c=this.config.mainWasmCachePath,s=this.createWasmPaths(a,c),e.next=6,this.downloadWasmFiles(n,o,s);case 6:y.processJavaScriptFiles(r,a,this.config),y.updateConfigFiles(r,a,this.config);case 8:case"end":return e.stop()}}),e,this)}))),function(e,t){return a.apply(this,arguments)})},{key:"createWasmPaths",value:function(e,t){var r=f.resolve(e,"./wasmcode/",t),n=f.resolve(e,"./wasmcode1/",t);return p.existsSync(n)||p.mkdirSync(n,{recursive:!0}),{mainWasmPath:r,subWasmPath:n}}},{key:"downloadWasmFiles",value:(n=s(i().mark((function e(t,r,n){return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.downloadSplitedFiles({mainWasmFileUrl:t,mainWasmFilePath:n.mainWasmPath,subWasmFileUrl:r,subWasmFilePath:n.subWasmPath});case 2:case"end":return e.stop()}}),e,this)}))),function(e,t,r){return n.apply(this,arguments)})}],t&&u(e.prototype,t),r&&u(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t,r,n,a,c,b,w,x,k,S,E,_,P,G,j,I,L}());e.exports=new b},220:e=>{function t(e){var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}t.keys=()=>[],t.resolve=t,t.id=220,e.exports=t},589:e=>{function t(e){var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}t.keys=()=>[],t.resolve=t,t.id=589,e.exports=t},172:e=>{"use strict";e.exports=require("archiver")},938:e=>{"use strict";e.exports=require("axios")},895:e=>{"use strict";e.exports=require("chalk")},858:e=>{"use strict";e.exports=require("commander")},305:e=>{"use strict";e.exports=require("form-data")},652:e=>{"use strict";e.exports=require("fs-extra")},410:e=>{"use strict";e.exports=require("glob")},937:e=>{"use strict";e.exports=require("inquirer")},420:e=>{"use strict";e.exports=require("jimp")},268:e=>{"use strict";e.exports=require("jsqr")},720:e=>{"use strict";e.exports=require("ora")},205:e=>{"use strict";e.exports=require("picocolors")},241:e=>{"use strict";e.exports=require("qrcode-terminal")},896:e=>{"use strict";e.exports=require("fs")},857:e=>{"use strict";e.exports=require("os")},928:e=>{"use strict";e.exports=require("path")},23:e=>{"use strict";e.exports=require("util")},330:e=>{"use strict";e.exports=JSON.parse('{"name":"jd-minigame-ci","version":"0.6.2","description":"The jd-minigame-ci is a toolkit provided for developers of JD Mini Games. Developers can complete code upload and preview operations for JD Mini Games without the need to open the developer tools, simply by using this toolkit.","author":"chenlong328","license":"ISC","main":"dist/index.js","bin":{"jgc":"./dist/jgc.js"},"scripts":{"config":"NODE_ENV=development node ./dist/jgc.js config","preview":"NODE_ENV=development node ./dist/jgc.js preview","dev:config":"NODE_ENV=development node ./src/jgc.js config","dev:preview":"NODE_ENV=development node ./src/jgc.js preview","dev:upload":"NODE_ENV=development node ./src/jgc.js upload","dev:publish":"NODE_ENV=development node ./src/jgc.js publish","build":"webpack --mode production --progress --config webpack.config.js && chmod 777 ./dist/index.js && chmod 777 ./dist/jgc.js"},"dependencies":{"@babel/cli":"^7.23.9","@babel/core":"^7.23.9","@babel/preset-env":"^7.23.9","archiver":"^6.0.1","axios":"^1.7.3","commander":"^11.1.0","fs-extra":"^11.2.0","glob":"^10.3.10","inquirer":"8.2.6","jimp":"^0.22.12","jsqr":"1.4.0","minimist":"^1.2.8","ora":"5.4.1","qrcode":"^1.5.3","qrcode-terminal":"^0.12.0","string-width":"4.2.3","strip-ansi":"6.0.1"},"devDependencies":{"babel-loader":"^9.1.3","babel-minify-webpack-plugin":"^0.3.1","clean-webpack-plugin":"^4.0.0","terser-webpack-plugin":"^5.3.10","webpack":"^5.90.3","webpack-cli":"^5.1.4","webpack-node-externals":"^3.0.0"},"files":["dist","package.json","README.md"]}')}},t={};function r(n){var o=t[n];if(void 0!==o)return o.exports;var a=t[n]={exports:{}};return e[n](a,a.exports,r),a.exports}r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function o(){"use strict";/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */o=function(){return t};var e,t={},r=Object.prototype,a=r.hasOwnProperty,i=Object.defineProperty||function(e,t,r){e[t]=r.value},c="function"==typeof Symbol?Symbol:{},s=c.iterator||"@@iterator",u=c.asyncIterator||"@@asyncIterator",l=c.toStringTag||"@@toStringTag";function f(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{f({},"")}catch(e){f=function(e,t,r){return e[t]=r}}function p(e,t,r,n){var o=t&&t.prototype instanceof b?t:b,a=Object.create(o.prototype),c=new N(n||[]);return i(a,"_invoke",{value:j(e,r,c)}),a}function h(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}t.wrap=p;var m="suspendedStart",d="suspendedYield",y="executing",v="completed",g={};function b(){}function w(){}function x(){}var k={};f(k,s,(function(){return this}));var S=Object.getPrototypeOf,E=S&&S(S(T([])));E&&E!==r&&a.call(E,s)&&(k=E);var _=x.prototype=b.prototype=Object.create(k);function P(e){["next","throw","return"].forEach((function(t){f(e,t,(function(e){return this._invoke(t,e)}))}))}function G(e,t){function r(o,i,c,s){var u=h(e[o],e,i);if("throw"!==u.type){var l=u.arg,f=l.value;return f&&"object"==n(f)&&a.call(f,"__await")?t.resolve(f.__await).then((function(e){r("next",e,c,s)}),(function(e){r("throw",e,c,s)})):t.resolve(f).then((function(e){l.value=e,c(l)}),(function(e){return r("throw",e,c,s)}))}s(u.arg)}var o;i(this,"_invoke",{value:function(e,n){function a(){return new t((function(t,o){r(e,n,t,o)}))}return o=o?o.then(a,a):a()}})}function j(t,r,n){var o=m;return function(a,i){if(o===y)throw Error("Generator is already running");if(o===v){if("throw"===a)throw i;return{value:e,done:!0}}for(n.method=a,n.arg=i;;){var c=n.delegate;if(c){var s=I(c,n);if(s){if(s===g)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===m)throw o=v,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=y;var u=h(t,r,n);if("normal"===u.type){if(o=n.done?v:d,u.arg===g)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(o=v,n.method="throw",n.arg=u.arg)}}}function I(t,r){var n=r.method,o=t.iterator[n];if(o===e)return r.delegate=null,"throw"===n&&t.iterator.return&&(r.method="return",r.arg=e,I(t,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),g;var a=h(o,t.iterator,r.arg);if("throw"===a.type)return r.method="throw",r.arg=a.arg,r.delegate=null,g;var i=a.arg;return i?i.done?(r[t.resultName]=i.value,r.next=t.nextLoc,"return"!==r.method&&(r.method="next",r.arg=e),r.delegate=null,g):i:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,g)}function L(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function O(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function N(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(L,this),this.reset(!0)}function T(t){if(t||""===t){var r=t[s];if(r)return r.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,i=function r(){for(;++o<t.length;)if(a.call(t,o))return r.value=t[o],r.done=!1,r;return r.value=e,r.done=!0,r};return i.next=i}}throw new TypeError(n(t)+" is not iterable")}return w.prototype=x,i(_,"constructor",{value:x,configurable:!0}),i(x,"constructor",{value:w,configurable:!0}),w.displayName=f(x,l,"GeneratorFunction"),t.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===w||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,x):(e.__proto__=x,f(e,l,"GeneratorFunction")),e.prototype=Object.create(_),e},t.awrap=function(e){return{__await:e}},P(G.prototype),f(G.prototype,u,(function(){return this})),t.AsyncIterator=G,t.async=function(e,r,n,o,a){void 0===a&&(a=Promise);var i=new G(p(e,r,n,o),a);return t.isGeneratorFunction(r)?i:i.next().then((function(e){return e.done?e.value:i.next()}))},P(_),f(_,l,"Generator"),f(_,s,(function(){return this})),f(_,"toString",(function(){return"[object Generator]"})),t.keys=function(e){var t=Object(e),r=[];for(var n in t)r.push(n);return r.reverse(),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},t.values=T,N.prototype={constructor:N,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(O),!t)for(var r in this)"t"===r.charAt(0)&&a.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=e)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var r=this;function n(n,o){return c.type="throw",c.arg=t,r.next=n,o&&(r.method="next",r.arg=e),!!o}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],c=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var s=a.call(i,"catchLoc"),u=a.call(i,"finallyLoc");if(s&&u){if(this.prev<i.catchLoc)return n(i.catchLoc,!0);if(this.prev<i.finallyLoc)return n(i.finallyLoc)}else if(s){if(this.prev<i.catchLoc)return n(i.catchLoc,!0)}else{if(!u)throw Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return n(i.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var n=this.tryEntries[r];if(n.tryLoc<=this.prev&&a.call(n,"finallyLoc")&&this.prev<n.finallyLoc){var o=n;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var i=o?o.completion:{};return i.type=e,i.arg=t,o?(this.method="next",this.next=o.finallyLoc,g):this.complete(i)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),g},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),O(r),g}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var o=n.arg;O(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={iterator:T(t),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=e),g}},t}function a(e,t,r,n,o,a,i){try{var c=e[a](i),s=c.value}catch(e){return void r(e)}c.done?t(s):Promise.resolve(s).then(n,o)}function i(e){return function(){var t=this,r=arguments;return new Promise((function(n,o){var i=e.apply(t,r);function c(e){a(i,n,o,c,s,"next",e)}function s(e){a(i,n,o,c,s,"throw",e)}c(void 0)}))}}var c=r(928),s=r(857),u=r(720),l=r(205),f=new(0,r(858).Command),p=r(937),h=r(938),m=r(522),d=r(593),y=r(538),v=r(60),g=r(425),b=r(890),w=r(85).SUCCEED_CODE,x=r(330),k=r(175);function S(e){return E.apply(this,arguments)}function E(){return E=i(o().mark((function e(t){var n,a,i,f,p,h,m,d,x,k,S,E,_,P,G,j,I,L,O,N,T,F,M,A,C,D,W,q,U,R,B,H,V=arguments;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=!(V.length>1&&void 0!==V[1])||V[1],a=Date.now(),i=1===t?"preview":"upload",f=c.posix.resolve("","./jgc.config.js"),y.hasJgcConfigFile(f)){e.next=7;break}return e.abrupt("return",console.log("".concat(l.red("请先创建配置文件!"))));case 7:if(p="function"==typeof require?require:r(589),h=p(f),(m=v.checkConfigOptions(h,t)).code===w){e.next=12;break}return e.abrupt("return",console.log(m.err_msg));case 12:if(d=h.appId,x=h.requestToken,k=h.versionName,S=h.entry,E=h.description,(_=y.verifyGameRequiredFilesExist(S)).code===w){e.next=16;break}return e.abrupt("return",console.log(_.err_msg));case 16:return P=s.tmpdir()+c.sep+"jd_game_temp.zip",y.deleteFile(P),G=u("文件压缩").start(),e.prev=19,e.next=22,y.compressDirectory(S,P);case 22:j=e.sent,G.succeed("压缩完成,共"+j/1e3+"KB"),e.next=30;break;case 26:e.prev=26,e.t0=e.catch(19),G.fail("压缩失败:",e.t0),process.exit(1);case 30:return G.start(),G.text="上传中",I=new g(n?"prod":"dev"),e.prev=34,e.next=37,I.uploadProject({sourceFile:P,appId:d,requestToken:x,isProd:n});case 37:if((L=e.sent).code!==w&&(G.fail(L.err_msg),process.exit(1)),O=L.packId,G.succeed("上传完成,packId:".concat(O)),"preview"!==i){e.next=57;break}return e.next=44,I.generateQrCode({packId:O,appId:d,requestToken:x});case 44:return(N=e.sent).code!==w&&(G.fail(N.err_msg),process.exit(1)),T=N.imgUrl,F=N.expiredTime,e.next=49,b.showQrCode(T);case 49:G.succeed("二维码生成完成,将于".concat(F,"过期")),G.info("二维码imgUrl(如二维码不清晰,浏览器打开): ".concat(T)),G.info("二维码仅支持协作成员访问"),M=Date.now(),A=(M-a)/1e3,G.info("本次耗费时长:".concat(A,"s")),e.next=82;break;case 57:if("upload"!==i){e.next=82;break}return G.start(),e.next=61,I.commitDevVersion({appId:d,requestToken:x,versionName:k,description:E},O);case 61:return(C=e.sent).code!==w&&(G.fail(C.err_msg),process.exit(1)),D=C.devId,G.succeed("开发版设置完成, devId:"+D),e.next=67,I.setDevExperience({appId:d,requestToken:x},D);case 67:return(W=e.sent).code!==w&&(G.fail(W.err_msg),process.exit(1)),G.succeed("体验版设置完成"),e.next=72,I.queryExperienceQrcodeByPackId({appId:d,requestToken:x});case 72:return(q=e.sent).code!==w&&(G.fail(q.err_msg),process.exit(1)),U=q.imgUrl,R=q.expiredTime,e.next=77,b.showQrCode(U);case 77:G.info("二维码仅支持协作成员访问"),G.succeed("二维码生成完成,将于".concat(R,"过期")),B=Date.now(),H=(B-a)/1e3,G.info("本次耗费时长:".concat(H,"s"));case 82:e.next=88;break;case 84:e.prev=84,e.t1=e.catch(34),G.fail("CLI执行报错 --\x3e".concat(e.t1)),process.exit(1);case 88:case"end":return e.stop()}}),e,null,[[19,26],[34,84]])}))),E.apply(this,arguments)}function _(e){return P.apply(this,arguments)}function P(){return(P=i(o().mark((function e(t){var n,a,i,f,h,m,b,x,k,S,E,_,P,G,j,I,L,O,N;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=(new d).getPrompts(),e.next=3,p.prompt(n);case 3:if(a=e.sent,i=Date.now(),f=c.posix.resolve("","./jgc.config.js"),y.hasJgcConfigFile(f)){e.next=9;break}return e.abrupt("return",console.log("".concat(l.red("请先创建配置文件!"))));case 9:if(h="function"==typeof require?require:r(589),m=h(f),(b=v.checkPluginConfig(m)).code===w){e.next=14;break}return e.abrupt("return",console.log(b.err_msg));case 14:return x=m.appId,k=m.requestToken,S=m.entry,E=m.versionName,_=s.tmpdir()+c.sep+"jd_game_temp.zip",y.deleteFile(_),P=u("文件压缩").start(),e.prev=18,e.next=21,y.compressDirectory(S,_);case 21:(G=e.sent)>4194304&&(P.fail("压缩包超过4MB,请检查文件大小"),process.exit(1)),P.succeed("压缩完成,共"+G/1e3+"KB"),e.next=30;break;case 26:e.prev=26,e.t0=e.catch(18),P.fail("压缩失败:",e.t0),process.exit(1);case 30:return j=new g(t),e.prev=31,e.next=34,j.uploadPlugin({sourceFile:_,appId:x,requestToken:k,versionName:E});case 34:if((I=e.sent).code===w){e.next=40;break}P.fail(I.err_msg),process.exit(1),e.next=49;break;case 40:return P.succeed("插件构建成功"),e.next=43,j.publishPlugin({versionName:a.versionName,versionFeature:a.versionFeature,useGuide:a.useGuide,packId:I.result.packId,appId:x,requestToken:k});case 43:(L=e.sent).code!==w&&(P.fail(L.err_msg),process.exit(1)),P.succeed("插件发布成功"),O=Date.now(),N=(O-i)/1e3,P.info("本次耗费时长:".concat(N,"s"));case 49:e.next=55;break;case 51:e.prev=51,e.t1=e.catch(31),P.fail("CLI执行报错 --\x3e".concat(e.t1)),process.exit(1);case 55:case"end":return e.stop()}}),e,null,[[18,26],[31,51]])})))).apply(this,arguments)}return f.command("config").description("小游戏配置").action(i(o().mark((function e(){var t,r,n;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=(new m).getPrompts(),e.next=3,p.prompt(t);case 3:if(r=e.sent,(n=y.verifyGameRequiredFilesExist(r.entry,r.type)).code===w){e.next=7;break}return e.abrupt("return",console.log("".concat(l.red(n.err_msg))));case 7:return e.prev=7,y.writeFile("./".concat("jgc.config.js"),"module.exports = ".concat(JSON.stringify(r,null,2)),"utf-8"),e.abrupt("return",console.log("✨ ".concat(l.green("创建小游戏配置文件成功"))));case 13:e.prev=13,e.t0=e.catch(7),console.log("创建小游戏配置文件失败:",e.t0);case 16:case"end":return e.stop()}}),e,null,[[7,13]])})))),f.command("preview").description("小游戏真机预览").option("-D","预发环境").action(function(){var e=i(o().mark((function e(t){return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!t.D){e.next=3;break}return console.log("小游戏真机预览-预发环境"),e.abrupt("return",S(1,!1));case 3:return e.abrupt("return",S(1,!0));case 4:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()),f.command("upload").description("小游戏发布").option("-D","预发环境").action(function(){var e=i(o().mark((function e(t){return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!t.D){e.next=3;break}return console.log("小游戏发布-预发环境"),e.abrupt("return",S(2,!1));case 3:return e.abrupt("return",S(2,!0));case 4:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()),f.command("publish").description("插件发布").option("-D","预发环境").option("-T","测试环境").action(function(){var e=i(o().mark((function e(t){return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!t.D){e.next=5;break}return console.log("插件发布-预发环境"),e.abrupt("return",_("dev"));case 5:if(!t.T){e.next=10;break}return console.log("插件发布-测试环境"),e.abrupt("return",_("test"));case 10:return console.log("插件发布-生产环境"),e.abrupt("return",_("prod"));case 12:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()),f.version(x.version,"-v, -V").description("获取本地京东小游戏CLI工具版本"),f.command("latest").description("获取并对比京东小游戏CLI工具最新版本").action(i(o().mark((function e(){var t,r,n,a;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,t=u("npm最新版本获取中……").start(),e.next=4,h.get("https://registry.npmjs.org/jd-minigame-ci/latest");case 4:r=e.sent,n=r.data.version,a=x.version,t.succeed("最新版本: ".concat(n)),n===a?t.info("当前版本 (".concat(a,") 已是最新版本。")):(t.info("本地版本: ".concat(a)),t.info("请更新到最新版本以获取最新功能和修复。")),e.next=14;break;case 11:e.prev=11,e.t0=e.catch(0),spinner.fail("获取最新版本信息失败: ".concat(e.t0));case 14:case"end":return e.stop()}}),e,null,[[0,11]])})))),f.command("wasm-init").description("WASM分包初始化").option("-D","预发环境").action(function(){var e=i(o().mark((function e(t){return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:k.wasmInit(Object.assign(t,{srcPath:"",isPreEnv:t.D})).then((function(e){var t=e.code,r=e.msg;0===t?console.log(r):console.error("WASM分包初始化失败:",e)})).catch((function(e){console.error("WASM分包初始化异常:",e)}));case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()),f.command("wasm-update").description("WASM分包增量更新").option("-D","预发环境").action(function(){var e=i(o().mark((function e(t){return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:k.wasmUpdate(Object.assign(t,{srcPath:"",isPreEnv:t.D})).then((function(e){var t=e.code,r=e.msg;0===t?console.log(r):console.error("WASM分包增量更新失败:",e)})).catch((function(e){console.error("WASM分包增量更新异常:",e)}));case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()),f.command("wasm-split-dev").description("WASM分包dev").option("-D","预发环境").action(function(){var e=i(o().mark((function e(t){return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:k.wasmSplitDev(Object.assign(t,{srcPath:"",isPreEnv:t.D})).then((function(e){var t=e.code,r=e.msg;0===t?console.log(r):console.error("WASM分包失败:",e)})).catch((function(e){console.error("WASM分包异常:",e)}));case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()),f.command("wasm-split-prod").description("WASM分包prod").option("-D","预发环境").action(function(){var e=i(o().mark((function e(t){return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:k.wasmSplitProd(Object.assign(t,{srcPath:"",isPreEnv:t.D})).then((function(e){var t=e.code,r=e.msg;0===t?console.log(r):console.error("WASM分包失败:",e)})).catch((function(e){console.error("WASM分包异常:",e)}));case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()),f.command("wasm-split-info").description("查询函数符号表").option("-D","预发环境").action(function(){var e=i(o().mark((function e(t){return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:k.wasmSplitInfo(Object.assign(t,{srcPath:"",isPreEnv:t.D})).then((function(e){var t=e.code,r=e.msg;0===t?console.log(r):console.error("查询函数符号表失败:",e)})).catch((function(e){console.error("查询函数符号表异常:",e)}));case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()),f.parse(process.argv),{}})()));
2
+ !function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var r=t();for(var n in r)("object"==typeof exports?exports:e)[n]=r[n]}}(global,(()=>(()=>{var e={85:e=>{e.exports={FAIL_CODE:-1,SUCCEED_CODE:0}},538:(e,t,r)=>{function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function o(){"use strict";/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */o=function(){return t};var e,t={},r=Object.prototype,a=r.hasOwnProperty,i=Object.defineProperty||function(e,t,r){e[t]=r.value},c="function"==typeof Symbol?Symbol:{},s=c.iterator||"@@iterator",u=c.asyncIterator||"@@asyncIterator",l=c.toStringTag||"@@toStringTag";function f(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{f({},"")}catch(e){f=function(e,t,r){return e[t]=r}}function p(e,t,r,n){var o=t&&t.prototype instanceof b?t:b,a=Object.create(o.prototype),c=new N(n||[]);return i(a,"_invoke",{value:G(e,r,c)}),a}function h(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}t.wrap=p;var m="suspendedStart",d="suspendedYield",y="executing",v="completed",g={};function b(){}function w(){}function x(){}var k={};f(k,s,(function(){return this}));var S=Object.getPrototypeOf,E=S&&S(S(T([])));E&&E!==r&&a.call(E,s)&&(k=E);var _=x.prototype=b.prototype=Object.create(k);function P(e){["next","throw","return"].forEach((function(t){f(e,t,(function(e){return this._invoke(t,e)}))}))}function j(e,t){function r(o,i,c,s){var u=h(e[o],e,i);if("throw"!==u.type){var l=u.arg,f=l.value;return f&&"object"==n(f)&&a.call(f,"__await")?t.resolve(f.__await).then((function(e){r("next",e,c,s)}),(function(e){r("throw",e,c,s)})):t.resolve(f).then((function(e){l.value=e,c(l)}),(function(e){return r("throw",e,c,s)}))}s(u.arg)}var o;i(this,"_invoke",{value:function(e,n){function a(){return new t((function(t,o){r(e,n,t,o)}))}return o=o?o.then(a,a):a()}})}function G(t,r,n){var o=m;return function(a,i){if(o===y)throw Error("Generator is already running");if(o===v){if("throw"===a)throw i;return{value:e,done:!0}}for(n.method=a,n.arg=i;;){var c=n.delegate;if(c){var s=I(c,n);if(s){if(s===g)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===m)throw o=v,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=y;var u=h(t,r,n);if("normal"===u.type){if(o=n.done?v:d,u.arg===g)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(o=v,n.method="throw",n.arg=u.arg)}}}function I(t,r){var n=r.method,o=t.iterator[n];if(o===e)return r.delegate=null,"throw"===n&&t.iterator.return&&(r.method="return",r.arg=e,I(t,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),g;var a=h(o,t.iterator,r.arg);if("throw"===a.type)return r.method="throw",r.arg=a.arg,r.delegate=null,g;var i=a.arg;return i?i.done?(r[t.resultName]=i.value,r.next=t.nextLoc,"return"!==r.method&&(r.method="next",r.arg=e),r.delegate=null,g):i:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,g)}function L(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function O(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function N(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(L,this),this.reset(!0)}function T(t){if(t||""===t){var r=t[s];if(r)return r.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,i=function r(){for(;++o<t.length;)if(a.call(t,o))return r.value=t[o],r.done=!1,r;return r.value=e,r.done=!0,r};return i.next=i}}throw new TypeError(n(t)+" is not iterable")}return w.prototype=x,i(_,"constructor",{value:x,configurable:!0}),i(x,"constructor",{value:w,configurable:!0}),w.displayName=f(x,l,"GeneratorFunction"),t.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===w||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,x):(e.__proto__=x,f(e,l,"GeneratorFunction")),e.prototype=Object.create(_),e},t.awrap=function(e){return{__await:e}},P(j.prototype),f(j.prototype,u,(function(){return this})),t.AsyncIterator=j,t.async=function(e,r,n,o,a){void 0===a&&(a=Promise);var i=new j(p(e,r,n,o),a);return t.isGeneratorFunction(r)?i:i.next().then((function(e){return e.done?e.value:i.next()}))},P(_),f(_,l,"Generator"),f(_,s,(function(){return this})),f(_,"toString",(function(){return"[object Generator]"})),t.keys=function(e){var t=Object(e),r=[];for(var n in t)r.push(n);return r.reverse(),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},t.values=T,N.prototype={constructor:N,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(O),!t)for(var r in this)"t"===r.charAt(0)&&a.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=e)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var r=this;function n(n,o){return c.type="throw",c.arg=t,r.next=n,o&&(r.method="next",r.arg=e),!!o}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],c=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var s=a.call(i,"catchLoc"),u=a.call(i,"finallyLoc");if(s&&u){if(this.prev<i.catchLoc)return n(i.catchLoc,!0);if(this.prev<i.finallyLoc)return n(i.finallyLoc)}else if(s){if(this.prev<i.catchLoc)return n(i.catchLoc,!0)}else{if(!u)throw Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return n(i.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var n=this.tryEntries[r];if(n.tryLoc<=this.prev&&a.call(n,"finallyLoc")&&this.prev<n.finallyLoc){var o=n;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var i=o?o.completion:{};return i.type=e,i.arg=t,o?(this.method="next",this.next=o.finallyLoc,g):this.complete(i)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),g},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),O(r),g}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var o=n.arg;O(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={iterator:T(t),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=e),g}},t}function a(e,t,r,n,o,a,i){try{var c=e[a](i),s=c.value}catch(e){return void r(e)}c.done?t(s):Promise.resolve(s).then(n,o)}var i=r(652),c=r(928),s=r(172),u=r(410).globSync;function l(e){try{if(i.pathExistsSync(e))return!0;if(l(c.dirname(e)))return i.mkdirsSync(e),!0}catch(e){console.log("make dir error,",e)}}t.writeFile=function(){var e,t=(e=o().mark((function e(t,r){var n,a=arguments;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:n=a.length>2&&void 0!==a[2]?a[2]:"utf8",l(c.posix.parse(t).dir)&&i.writeFileSync(t,r,n);case 4:case"end":return e.stop()}}),e)})),function(){var t=this,r=arguments;return new Promise((function(n,o){var i=e.apply(t,r);function c(e){a(i,n,o,c,s,"next",e)}function s(e){a(i,n,o,c,s,"throw",e)}c(void 0)}))});return function(e,r){return t.apply(this,arguments)}}(),t.verifyGameRequiredFilesExist=function(e,t){return i.pathExistsSync(e)?"game"===t?f(e):"plugin"===t?p(e):{code:0,err_msg:"ok"}:{code:-1,err_msg:"当前入口文件目录不存在!"}};var f=function(e){var t=u("game.json",{cwd:e,ignore:"node_modules/**"}),r=u("game.js",{cwd:e,ignore:"node_modules/**"});return 0===t.length?{code:-1,err_msg:"被打包的游戏的目录下不存在game.json!"}:0===r.length?{code:-1,err_msg:"被打包的游戏的目录下不存在game.js!"}:{code:0,err_msg:"ok"}},p=function(e){return 0===u("plugin.json",{cwd:e,ignore:"node_modules/**"}).length?{code:-1,err_msg:"被打包的插件的目录下不存在plugin.json!"}:{code:0,err_msg:"ok"}};t.hasJgcConfigFile=function(e){try{return i.accessSync(e,i.constants.F_OK),!0}catch(e){return console.log("文件不存在"),!1}},t.compressDirectory=function(e,t){return new Promise((function(r,n){var o=i.createWriteStream(t),a=s("zip",{zlib:{level:9}});o.on("close",(function(){return r(a.pointer())})),a.on("warning",(function(e){return"ENOENT"!==e.code&&n(e)})),a.on("error",n),a.pipe(o),a.glob("**/*",{cwd:e,ignore:["**/.*","**/*.js.map"]}),a.finalize()}))},t.deleteFile=function(e){i.existsSync(e)&&i.unlink(e,(function(e){e&&console.log("删除zip文件失败: ",e)}))}},522:e=>{function t(e){return t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},t(e)}function r(e,t){for(var r=0;r<t.length;r++){var o=t[r];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,n(o.key),o)}}function n(e){var r=function(e,r){if("object"!=t(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var o=n.call(e,r||"default");if("object"!=t(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===r?String:Number)(e)}(e,"string");return"symbol"==t(r)?r:r+""}var o=function(){return e=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.configPrompts=[{name:"type",type:"list",message:"请选择项目类型:",choices:[{name:"游戏",value:"game"},{name:"插件",value:"plugin"}],default:"game"},{name:"appId",type:"input",message:"请输入appId:",validate:function(e){return!!e||"appId不能为空"}},{name:"requestToken",type:"input",message:"请输入代码上传秘钥:",validate:function(e){return!!e||"代码上传秘钥不能为空"}},{name:"entry",type:"input",message:"请输入需要被打包的游戏(或者插件)的路径:",default:"./"},{name:"versionName",type:"input",message:"请输入需要被打包的游戏(或者插件)的版本号:",default:"1.0.0"},{name:"description",type:"input",message:"请输入需要被打包的游戏的备注:",when:function(e){return"game"===e.type},default:""}]},(t=[{key:"getPrompts",value:function(){return this.configPrompts}}])&&r(e.prototype,t),n&&r(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t,n}();e.exports=o},593:e=>{function t(e){return t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},t(e)}function r(e,t){for(var r=0;r<t.length;r++){var o=t[r];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,n(o.key),o)}}function n(e){var r=function(e,r){if("object"!=t(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var o=n.call(e,r||"default");if("object"!=t(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===r?String:Number)(e)}(e,"string");return"symbol"==t(r)?r:r+""}var o=function(){return e=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.configPrompts=[{name:"versionName",type:"input",message:"版本号:",default:"1.0.0"},{name:"versionFeature",type:"input",message:"版本特性(长度为10~30个字符):",default:""},{name:"useGuide",type:"input",message:"使用指南(仅限文字和代码,长度为20~1000个字符):",default:"插件使用指南不建议在这里填写,建议到小游戏插件MP控制台提审时修改,这里是占位文本"}]},(t=[{key:"getPrompts",value:function(){return this.configPrompts}}])&&r(e.prototype,t),n&&r(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t,n}();e.exports=o},890:(e,t,r)=>{var n=r(420),o=r(241),a=r(268);t.showQrCode=function(e){return new Promise((function(t,r){n.read(e).then((function(e){var r=e.bitmap,n=r.width,i=r.height,c=r.data,s=new Uint8ClampedArray(c),u=a(s,n,i);o.generate(u.data,{small:!1}),t(!0)})).catch((function(e){r(!1)}))}))},t.getBase64=function(e){return n.read(e).then((function(e){return e.getBase64Async("image/png")})).catch((function(){throw new Error("获取二维码base64失败")}))}},425:(e,t,r)=>{function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function o(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function a(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?o(Object(r),!0).forEach((function(t){i(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):o(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function i(e,t,r){return(t=f(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function c(){"use strict";/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */c=function(){return t};var e,t={},r=Object.prototype,o=r.hasOwnProperty,a=Object.defineProperty||function(e,t,r){e[t]=r.value},i="function"==typeof Symbol?Symbol:{},s=i.iterator||"@@iterator",u=i.asyncIterator||"@@asyncIterator",l=i.toStringTag||"@@toStringTag";function f(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{f({},"")}catch(e){f=function(e,t,r){return e[t]=r}}function p(e,t,r,n){var o=t&&t.prototype instanceof b?t:b,i=Object.create(o.prototype),c=new N(n||[]);return a(i,"_invoke",{value:G(e,r,c)}),i}function h(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}t.wrap=p;var m="suspendedStart",d="suspendedYield",y="executing",v="completed",g={};function b(){}function w(){}function x(){}var k={};f(k,s,(function(){return this}));var S=Object.getPrototypeOf,E=S&&S(S(T([])));E&&E!==r&&o.call(E,s)&&(k=E);var _=x.prototype=b.prototype=Object.create(k);function P(e){["next","throw","return"].forEach((function(t){f(e,t,(function(e){return this._invoke(t,e)}))}))}function j(e,t){function r(a,i,c,s){var u=h(e[a],e,i);if("throw"!==u.type){var l=u.arg,f=l.value;return f&&"object"==n(f)&&o.call(f,"__await")?t.resolve(f.__await).then((function(e){r("next",e,c,s)}),(function(e){r("throw",e,c,s)})):t.resolve(f).then((function(e){l.value=e,c(l)}),(function(e){return r("throw",e,c,s)}))}s(u.arg)}var i;a(this,"_invoke",{value:function(e,n){function o(){return new t((function(t,o){r(e,n,t,o)}))}return i=i?i.then(o,o):o()}})}function G(t,r,n){var o=m;return function(a,i){if(o===y)throw Error("Generator is already running");if(o===v){if("throw"===a)throw i;return{value:e,done:!0}}for(n.method=a,n.arg=i;;){var c=n.delegate;if(c){var s=I(c,n);if(s){if(s===g)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===m)throw o=v,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=y;var u=h(t,r,n);if("normal"===u.type){if(o=n.done?v:d,u.arg===g)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(o=v,n.method="throw",n.arg=u.arg)}}}function I(t,r){var n=r.method,o=t.iterator[n];if(o===e)return r.delegate=null,"throw"===n&&t.iterator.return&&(r.method="return",r.arg=e,I(t,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),g;var a=h(o,t.iterator,r.arg);if("throw"===a.type)return r.method="throw",r.arg=a.arg,r.delegate=null,g;var i=a.arg;return i?i.done?(r[t.resultName]=i.value,r.next=t.nextLoc,"return"!==r.method&&(r.method="next",r.arg=e),r.delegate=null,g):i:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,g)}function L(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function O(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function N(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(L,this),this.reset(!0)}function T(t){if(t||""===t){var r=t[s];if(r)return r.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var a=-1,i=function r(){for(;++a<t.length;)if(o.call(t,a))return r.value=t[a],r.done=!1,r;return r.value=e,r.done=!0,r};return i.next=i}}throw new TypeError(n(t)+" is not iterable")}return w.prototype=x,a(_,"constructor",{value:x,configurable:!0}),a(x,"constructor",{value:w,configurable:!0}),w.displayName=f(x,l,"GeneratorFunction"),t.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===w||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,x):(e.__proto__=x,f(e,l,"GeneratorFunction")),e.prototype=Object.create(_),e},t.awrap=function(e){return{__await:e}},P(j.prototype),f(j.prototype,u,(function(){return this})),t.AsyncIterator=j,t.async=function(e,r,n,o,a){void 0===a&&(a=Promise);var i=new j(p(e,r,n,o),a);return t.isGeneratorFunction(r)?i:i.next().then((function(e){return e.done?e.value:i.next()}))},P(_),f(_,l,"Generator"),f(_,s,(function(){return this})),f(_,"toString",(function(){return"[object Generator]"})),t.keys=function(e){var t=Object(e),r=[];for(var n in t)r.push(n);return r.reverse(),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},t.values=T,N.prototype={constructor:N,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(O),!t)for(var r in this)"t"===r.charAt(0)&&o.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=e)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var r=this;function n(n,o){return c.type="throw",c.arg=t,r.next=n,o&&(r.method="next",r.arg=e),!!o}for(var a=this.tryEntries.length-1;a>=0;--a){var i=this.tryEntries[a],c=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var s=o.call(i,"catchLoc"),u=o.call(i,"finallyLoc");if(s&&u){if(this.prev<i.catchLoc)return n(i.catchLoc,!0);if(this.prev<i.finallyLoc)return n(i.finallyLoc)}else if(s){if(this.prev<i.catchLoc)return n(i.catchLoc,!0)}else{if(!u)throw Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return n(i.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var n=this.tryEntries[r];if(n.tryLoc<=this.prev&&o.call(n,"finallyLoc")&&this.prev<n.finallyLoc){var a=n;break}}a&&("break"===e||"continue"===e)&&a.tryLoc<=t&&t<=a.finallyLoc&&(a=null);var i=a?a.completion:{};return i.type=e,i.arg=t,a?(this.method="next",this.next=a.finallyLoc,g):this.complete(i)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),g},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),O(r),g}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var o=n.arg;O(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={iterator:T(t),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=e),g}},t}function s(e,t,r,n,o,a,i){try{var c=e[a](i),s=c.value}catch(e){return void r(e)}c.done?t(s):Promise.resolve(s).then(n,o)}function u(e){return function(){var t=this,r=arguments;return new Promise((function(n,o){var a=e.apply(t,r);function i(e){s(a,n,o,i,c,"next",e)}function c(e){s(a,n,o,i,c,"throw",e)}i(void 0)}))}}function l(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,f(n.key),n)}}function f(e){var t=function(e,t){if("object"!=n(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var o=r.call(e,t||"default");if("object"!=n(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==n(t)?t:t+""}var p=r(938),h=r(305),m=r(652),d=r(85),y=d.FAIL_CODE,v=d.SUCCEED_CODE,g=(r(60).checkConfigOptions,{dev:"http://beta-vapp-ide.jd.com",prod:"https://vapp-ide-pack.jd.com",test:"http://test-vapp-ide.jdtest.net"}),b=function(){return e=function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"prod";!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.URL=g[t]},t=[{key:"uploadProject",value:(E=u(c().mark((function e(t){var r,n,o;return c().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,this.pack(t);case 3:if((r=e.sent).code===v){e.next=6;break}return e.abrupt("return",r);case 6:return n=r.data.result,e.next=9,this.loopQuery(t,n);case 9:if((o=e.sent).code===v){e.next=12;break}return e.abrupt("return",o);case 12:return e.abrupt("return",{code:v,packId:o.data});case 15:return e.prev=15,e.t0=e.catch(0),e.abrupt("return",{code:y,err_msg:e.t0 instanceof Error?e.t0.message:"上传失败"});case 18:case"end":return e.stop()}}),e,this,[[0,15]])}))),function(e){return E.apply(this,arguments)})},{key:"sendPostRequest",value:(S=u(c().mark((function e(t,r){var n,o,i,s,u=arguments;return c().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:for(i in n=u.length>2&&void 0!==u[2]?u[2]:"请求失败",o=new h,r)o.append(i,r[i]);return e.prev=3,e.next=6,p.post(t,o,{headers:a({},o.getHeaders())});case 6:if((s=e.sent).data.code!==v){e.next=9;break}return e.abrupt("return",{code:v,data:s.data});case 9:return e.abrupt("return",{code:y,err_msg:"".concat(n,": ").concat(s.data.errorMessage)});case 12:return e.prev=12,e.t0=e.catch(3),e.abrupt("return",{code:y,err_msg:"".concat(n,": ").concat(e.t0)});case 15:case"end":return e.stop()}}),e,null,[[3,12]])}))),function(e,t){return S.apply(this,arguments)})},{key:"pluginPublishRequest",value:(k=u(c().mark((function e(t,r,n,o){var a,i,s,u,l=arguments;return c().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return a=l.length>4&&void 0!==l[4]?l[4]:"请求失败",i=JSON.stringify(r),s={method:"post",maxBodyLength:1/0,url:"".concat(t,"?appId=").concat(n,"&requestToken=").concat(o),headers:{"Content-Type":"application/json"},data:i},e.prev=3,e.next=6,p.request(s);case 6:if((u=e.sent).data.code!==v){e.next=9;break}return e.abrupt("return",{code:v,data:u.data});case 9:return e.abrupt("return",{code:y,err_msg:"".concat(a,": ").concat(u.data.errorMessage)});case 12:return e.prev=12,e.t0=e.catch(3),e.abrupt("return",{code:y,err_msg:"".concat(a,": ").concat(e.t0)});case 15:case"end":return e.stop()}}),e,null,[[3,12]])}))),function(e,t,r,n){return k.apply(this,arguments)})},{key:"pack",value:(x=u(c().mark((function e(t){var r,n,o,a,i;return c().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.sourceFile,n=t.appId,o=t.requestToken,a="".concat(this.URL,"/v1/devops/pack"),i={appId:n,requestToken:o,sourceFile:m.createReadStream(r)},e.abrupt("return",this.sendPostRequest(a,i,"文件上传报错"));case 5:case"end":return e.stop()}}),e,this)}))),function(e){return x.apply(this,arguments)})},{key:"loopQuery",value:(w=u(c().mark((function e(t,r){var n,o,a,i;return c().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:n=Date.now(),o=2e6,a=3e3;case 3:if(!(Date.now()-n<o)){e.next=15;break}return e.next=6,new Promise((function(e){return setTimeout(e,a)}));case 6:return e.next=8,this.queryPkgId(t,r);case 8:if((i=e.sent).code===v){e.next=11;break}return e.abrupt("return",{code:y,err_msg:i.err_msg});case 11:if(!i.data.result){e.next=13;break}return e.abrupt("return",{code:v,data:i.data.result});case 13:e.next=3;break;case 15:return e.abrupt("return",{code:y,err_msg:"查询超时"});case 16:case"end":return e.stop()}}),e,this)}))),function(e,t){return w.apply(this,arguments)})},{key:"queryPkgId",value:(b=u(c().mark((function e(t,r){var n,o,a;return c().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=t.appId,o=t.requestToken,a={appId:n,requestToken:o,uuid:r},e.abrupt("return",this.sendPostRequest("".concat(this.URL,"/v1/ci/queryPackIdByUuid"),a,"获取构建包id失效"));case 3:case"end":return e.stop()}}),e,this)}))),function(e,t){return b.apply(this,arguments)})},{key:"generateQrCode",value:(d=u(c().mark((function e(t){var r,n,o,a,i,s;return c().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.appId,n=t.requestToken,o=t.packId,a={appId:r,requestToken:n,packId:o},e.next=4,this.sendPostRequest("".concat(this.URL,"/v1/ci/queryQrcodeByPackId"),a,"获取二维码失效");case 4:if((i=e.sent).code===v){e.next=7;break}return e.abrupt("return",{code:y,err_msg:i.err_msg});case 7:if(!i.data.result){e.next=13;break}return(s=new Date).setMinutes(s.getMinutes()+25),e.abrupt("return",{code:v,imgUrl:i.data.result,expiredTime:"".concat(this.addZeroForShort(s.getHours()),":").concat(this.addZeroForShort(s.getMinutes()))});case 13:return e.abrupt("return",{code:y,err_msg:"二维码生成完成请求返回为空"});case 14:case"end":return e.stop()}}),e,this)}))),function(e){return d.apply(this,arguments)})},{key:"addZeroForShort",value:function(e){return String(e).length<2?"0".concat(String(e)):String(e)}},{key:"commitDevVersion",value:(f=u(c().mark((function e(t,r){var n,o,a,i,s,u;return c().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=t.appId,o=t.requestToken,a=t.versionName,i=t.description,s={packId:r,appId:n,requestToken:o,versionName:a,description:i},e.next=4,this.sendPostRequest("".concat(this.URL,"/v1/ci/commitDevVersion"),s,"设置为开发版失效");case 4:if((u=e.sent).code===v){e.next=7;break}return e.abrupt("return",u);case 7:return e.abrupt("return",{code:v,devId:u.data.result});case 8:case"end":return e.stop()}}),e,this)}))),function(e,t){return f.apply(this,arguments)})},{key:"setDevExperience",value:(s=u(c().mark((function e(t,r){var n,o,a,i;return c().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=t.appId,o=t.requestToken,a={appId:n,requestToken:o,devId:r},e.next=4,this.sendPostRequest("".concat(this.URL,"/v1/ci/devExperience"),a,"设置为体验版失效");case 4:if((i=e.sent).code===v){e.next=7;break}return e.abrupt("return",i);case 7:return e.abrupt("return",{code:v});case 8:case"end":return e.stop()}}),e,this)}))),function(e,t){return s.apply(this,arguments)})},{key:"queryExperienceQrcodeByPackId",value:(i=u(c().mark((function e(t){var r,n,o,a,i,s;return c().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.appId,n=t.requestToken,o={appId:r,requestToken:n},e.next=4,this.sendPostRequest("".concat(this.URL,"/v1/ci/queryExperienceQrcode"),o,"获取体验二维码失效");case 4:if((a=e.sent).code===v){e.next=7;break}return e.abrupt("return",{code:y,err_msg:a.err_msg});case 7:return i=a.data.result,(s=new Date).setMinutes(s.getMinutes()+25),e.abrupt("return",{code:v,imgUrl:i,expiredTime:"".concat(this.addZeroForShort(s.getHours()),":").concat(this.addZeroForShort(s.getMinutes()))});case 11:case"end":return e.stop()}}),e,this)}))),function(e){return i.apply(this,arguments)})},{key:"uploadPlugin",value:(o=u(c().mark((function e(t){var r,n,o,a,i,s,u;return c().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.sourceFile,n=t.appId,o=t.requestToken,a=t.versionName,i="".concat(this.URL,"/v1/ci/pluginPack"),s={appId:n,requestToken:o,versionName:a,sourceFile:m.createReadStream(r)},e.next=6,this.sendPostRequest(i,s,"插件构建报错");case 6:if((u=e.sent).code===v){e.next=9;break}return e.abrupt("return",{code:y,err_msg:u.err_msg});case 9:return e.abrupt("return",{code:v,result:u.data.result});case 10:case"end":return e.stop()}}),e,this)}))),function(e){return o.apply(this,arguments)})},{key:"publishPlugin",value:(n=u(c().mark((function e(t){var r,n,o,a,i,s,u,l,f;return c().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.versionName,n=t.versionFeature,o=t.useGuide,a=t.packId,i=t.appId,s=t.requestToken,u="".concat(this.URL,"/v1/ci/plugin-dev"),l={versionName:r,versionFeature:n,useGuide:o,packId:a},e.next=6,this.pluginPublishRequest(u,l,i,s,"插件上传报错");case 6:if((f=e.sent).code===v){e.next=9;break}return e.abrupt("return",{code:y,err_msg:f.err_msg});case 9:return e.abrupt("return",{code:v});case 10:case"end":return e.stop()}}),e,this)}))),function(e){return n.apply(this,arguments)})}],t&&l(e.prototype,t),r&&l(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t,r,n,o,i,s,f,d,b,w,x,k,S,E}();e.exports=b},60:(e,t)=>{function r(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,o,a,i,c=[],s=!0,u=!1;try{if(a=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;s=!1}else for(;!(s=(n=a.call(r)).done)&&(c.push(n.value),c.length!==t);s=!0);}catch(e){u=!0,o=e}finally{try{if(!s&&null!=r.return&&(i=r.return(),Object(i)!==i))return}finally{if(u)throw o}}return c}}(e,t)||function(e,t){if(e){if("string"==typeof e)return n(e,t);var r={}.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?n(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function n(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function o(e){return"string"==typeof e&&!!e.trim()}t.checkConfigOptions=function(e,t){var n=e||{},a=n.type,i=n.appId,c=n.requestToken,s=n.entry,u=n.versionName,l=n.description;if("game"!==a)return{code:-1,err_msg:"请选择项目构建类型为小游戏"};for(var f=1===t?{appId:i,requestToken:c,entry:s}:{appId:i,requestToken:c,entry:s,versionName:u,description:l},p=0,h=Object.entries(f);p<h.length;p++){var m=r(h[p],2),d=m[0];if(!o(m[1]))return{code:-1,err_msg:"".concat(d," 不能为空")}}return{code:0,err_msg:"ok"}},t.checkPluginConfig=function(e){var t=e||{},n=t.type,a=t.appId,i=t.requestToken,c=t.entry,s=t.versionName;if("plugin"!==n)return{code:-1,err_msg:"请选择项目构建类型为插件"};for(var u={appId:a,requestToken:i,entry:c,versionName:s},l=0,f=Object.entries(u);l<f.length;l++){var p=r(f[l],2),h=p[0];if(!o(p[1]))return{code:-1,err_msg:"".concat(h," 不能为空")}}return{code:0,err_msg:"ok"}}},664:(e,t,r)=>{function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function o(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,o,a,i,c=[],s=!0,u=!1;try{if(a=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;s=!1}else for(;!(s=(n=a.call(r)).done)&&(c.push(n.value),c.length!==t);s=!0);}catch(e){u=!0,o=e}finally{try{if(!s&&null!=r.return&&(i=r.return(),Object(i)!==i))return}finally{if(u)throw o}}return c}}(e,t)||function(e,t){if(e){if("string"==typeof e)return a(e,t);var r={}.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?a(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function a(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function i(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function c(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?i(Object(r),!0).forEach((function(t){s(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):i(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function s(e,t,r){return(t=h(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function u(){"use strict";/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */u=function(){return t};var e,t={},r=Object.prototype,o=r.hasOwnProperty,a=Object.defineProperty||function(e,t,r){e[t]=r.value},i="function"==typeof Symbol?Symbol:{},c=i.iterator||"@@iterator",s=i.asyncIterator||"@@asyncIterator",l=i.toStringTag||"@@toStringTag";function f(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{f({},"")}catch(e){f=function(e,t,r){return e[t]=r}}function p(e,t,r,n){var o=t&&t.prototype instanceof b?t:b,i=Object.create(o.prototype),c=new N(n||[]);return a(i,"_invoke",{value:G(e,r,c)}),i}function h(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}t.wrap=p;var m="suspendedStart",d="suspendedYield",y="executing",v="completed",g={};function b(){}function w(){}function x(){}var k={};f(k,c,(function(){return this}));var S=Object.getPrototypeOf,E=S&&S(S(T([])));E&&E!==r&&o.call(E,c)&&(k=E);var _=x.prototype=b.prototype=Object.create(k);function P(e){["next","throw","return"].forEach((function(t){f(e,t,(function(e){return this._invoke(t,e)}))}))}function j(e,t){function r(a,i,c,s){var u=h(e[a],e,i);if("throw"!==u.type){var l=u.arg,f=l.value;return f&&"object"==n(f)&&o.call(f,"__await")?t.resolve(f.__await).then((function(e){r("next",e,c,s)}),(function(e){r("throw",e,c,s)})):t.resolve(f).then((function(e){l.value=e,c(l)}),(function(e){return r("throw",e,c,s)}))}s(u.arg)}var i;a(this,"_invoke",{value:function(e,n){function o(){return new t((function(t,o){r(e,n,t,o)}))}return i=i?i.then(o,o):o()}})}function G(t,r,n){var o=m;return function(a,i){if(o===y)throw Error("Generator is already running");if(o===v){if("throw"===a)throw i;return{value:e,done:!0}}for(n.method=a,n.arg=i;;){var c=n.delegate;if(c){var s=I(c,n);if(s){if(s===g)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===m)throw o=v,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=y;var u=h(t,r,n);if("normal"===u.type){if(o=n.done?v:d,u.arg===g)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(o=v,n.method="throw",n.arg=u.arg)}}}function I(t,r){var n=r.method,o=t.iterator[n];if(o===e)return r.delegate=null,"throw"===n&&t.iterator.return&&(r.method="return",r.arg=e,I(t,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),g;var a=h(o,t.iterator,r.arg);if("throw"===a.type)return r.method="throw",r.arg=a.arg,r.delegate=null,g;var i=a.arg;return i?i.done?(r[t.resultName]=i.value,r.next=t.nextLoc,"return"!==r.method&&(r.method="next",r.arg=e),r.delegate=null,g):i:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,g)}function L(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function O(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function N(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(L,this),this.reset(!0)}function T(t){if(t||""===t){var r=t[c];if(r)return r.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var a=-1,i=function r(){for(;++a<t.length;)if(o.call(t,a))return r.value=t[a],r.done=!1,r;return r.value=e,r.done=!0,r};return i.next=i}}throw new TypeError(n(t)+" is not iterable")}return w.prototype=x,a(_,"constructor",{value:x,configurable:!0}),a(x,"constructor",{value:w,configurable:!0}),w.displayName=f(x,l,"GeneratorFunction"),t.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===w||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,x):(e.__proto__=x,f(e,l,"GeneratorFunction")),e.prototype=Object.create(_),e},t.awrap=function(e){return{__await:e}},P(j.prototype),f(j.prototype,s,(function(){return this})),t.AsyncIterator=j,t.async=function(e,r,n,o,a){void 0===a&&(a=Promise);var i=new j(p(e,r,n,o),a);return t.isGeneratorFunction(r)?i:i.next().then((function(e){return e.done?e.value:i.next()}))},P(_),f(_,l,"Generator"),f(_,c,(function(){return this})),f(_,"toString",(function(){return"[object Generator]"})),t.keys=function(e){var t=Object(e),r=[];for(var n in t)r.push(n);return r.reverse(),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},t.values=T,N.prototype={constructor:N,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(O),!t)for(var r in this)"t"===r.charAt(0)&&o.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=e)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var r=this;function n(n,o){return c.type="throw",c.arg=t,r.next=n,o&&(r.method="next",r.arg=e),!!o}for(var a=this.tryEntries.length-1;a>=0;--a){var i=this.tryEntries[a],c=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var s=o.call(i,"catchLoc"),u=o.call(i,"finallyLoc");if(s&&u){if(this.prev<i.catchLoc)return n(i.catchLoc,!0);if(this.prev<i.finallyLoc)return n(i.finallyLoc)}else if(s){if(this.prev<i.catchLoc)return n(i.catchLoc,!0)}else{if(!u)throw Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return n(i.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var n=this.tryEntries[r];if(n.tryLoc<=this.prev&&o.call(n,"finallyLoc")&&this.prev<n.finallyLoc){var a=n;break}}a&&("break"===e||"continue"===e)&&a.tryLoc<=t&&t<=a.finallyLoc&&(a=null);var i=a?a.completion:{};return i.type=e,i.arg=t,a?(this.method="next",this.next=a.finallyLoc,g):this.complete(i)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),g},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),O(r),g}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var o=n.arg;O(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={iterator:T(t),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=e),g}},t}function l(e,t,r,n,o,a,i){try{var c=e[a](i),s=c.value}catch(e){return void r(e)}c.done?t(s):Promise.resolve(s).then(n,o)}function f(e){return function(){var t=this,r=arguments;return new Promise((function(n,o){var a=e.apply(t,r);function i(e){l(a,n,o,i,c,"next",e)}function c(e){l(a,n,o,i,c,"throw",e)}i(void 0)}))}}function p(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,h(n.key),n)}}function h(e){var t=function(e,t){if("object"!=n(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var o=r.call(e,t||"default");if("object"!=n(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==n(t)?t:t+""}var m=r(938),d=r(305),y=r(896),v=r(626),g=(r(759),r(427).downloadFile),b=function(){return e=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.apiUrls=v.getApiUrls(),this.defaultTimeout=6e4},t=[{key:"setEnv",value:function(e){e?(v.currentEnv="wasmdev",this.apiUrls=v.getApiUrls("wasmdev")):(v.currentEnv="wasmprod",this.apiUrls=v.getApiUrls("wasmprod"))}},{key:"downloadFile",value:(w=f(u().mark((function e(t){var r,n;return u().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.filePath,n=t.url,e.abrupt("return",new Promise((function(e,t){g({filePath:r,url:n,success:e,fail:t})})));case 2:case"end":return e.stop()}}),e)}))),function(e){return w.apply(this,arguments)})},{key:"uploadFile",value:(b=f(u().mark((function e(t){var r,n,o,a,i,s,l,f,p,h;return u().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.appId,n=t.requestToken,o=t.filePath,a=t.category,(i=new d).append("category",a),i.append("appId",r),i.append("requestToken",n),i.append("sourceFile",y.createReadStream(o)),s={method:"post",url:this.apiUrls.UPLOAD_FILE,headers:c(c({},i.getHeaders()),{},{appId:r,requestToken:n}),data:i,maxBodyLength:1/0,maxContentLength:1/0,timeout:6e5},e.prev=7,e.next=10,m(s);case 10:if(l=e.sent,f=l.data,p=f.code,h=f.result,0!==p){e.next=14;break}return e.abrupt("return",h);case 14:e.next=19;break;case 16:throw e.prev=16,e.t0=e.catch(7),new Error("上传文件失败 File upload failed: ".concat(e.t0.message));case 19:case"end":return e.stop()}}),e,this,[[7,16]])}))),function(e){return b.apply(this,arguments)})},{key:"addGameVersion",value:(h=f(u().mark((function e(t){var r,n;return u().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=new FormData,Object.entries(t).forEach((function(e){var t=o(e,2),n=t[0],a=t[1];return r.append(n,a)})),e.next=4,m({method:"post",url:this.apiUrls.ADD_GAME_VERSION,data:r});case 4:if(0===(n=e.sent).data.code){e.next=7;break}throw new Error(n.data.errorMessage);case 7:return e.abrupt("return",n.data);case 8:case"end":return e.stop()}}),e,this)}))),function(e){return h.apply(this,arguments)})},{key:"initialize",value:(l=f(u().mark((function e(t){var r,n;return u().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=new FormData,Object.entries(t).forEach((function(e){var t=o(e,2),n=t[0],a=t[1];return r.append(n,a)})),e.next=4,m({method:"post",url:this.apiUrls.INIT,timeout:this.defaultTimeout,data:r});case 4:if(0===(n=e.sent).data.code){e.next=7;break}throw new Error(n.data.errorMessage);case 7:return e.abrupt("return",n.data);case 8:case"end":return e.stop()}}),e,this)}))),function(e){return l.apply(this,arguments)})},{key:"getInitResult",value:(s=f(u().mark((function e(t){var r;return u().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,m({method:"get",url:this.apiUrls.GET_INIT_RES,timeout:this.defaultTimeout,params:t});case 2:if(0===(r=e.sent).data.code){e.next=5;break}throw new Error(r.data.errorMessage);case 5:return e.abrupt("return",r.data);case 6:case"end":return e.stop()}}),e,this)}))),function(e){return s.apply(this,arguments)})},{key:"split",value:(i=f(u().mark((function e(t){var r,n;return u().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=new FormData,Object.entries(t).forEach((function(e){var t=o(e,2),n=t[0],a=t[1];return r.append(n,a)})),e.next=4,m({url:this.apiUrls.SPLIT,method:"post",data:r});case 4:if(0===(n=e.sent).data.code){e.next=7;break}throw new Error(n.data.errorMessage);case 7:return e.abrupt("return",n.data);case 8:case"end":return e.stop()}}),e,this)}))),function(e){return i.apply(this,arguments)})},{key:"getGameSplitInfo",value:(a=f(u().mark((function e(t){var r;return u().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,m({url:this.apiUrls.GET_GAME_SPLIT_INFO,method:"get",params:t});case 2:if(0===(r=e.sent).data.code){e.next=5;break}throw new Error(r.data.errorMessage);case 5:return e.abrupt("return",r.data);case 6:case"end":return e.stop()}}),e,this)}))),function(e){return a.apply(this,arguments)})},{key:"getSymbolSize",value:(n=f(u().mark((function e(t){var r;return u().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,m({method:"get",url:this.apiUrls.GET_SYMBOL_SIZE,params:t});case 2:if(0===(r=e.sent).data.code){e.next=5;break}throw new Error(r.data.errorMessage);case 5:return e.abrupt("return",r.data);case 6:case"end":return e.stop()}}),e,this)}))),function(e){return n.apply(this,arguments)})}],t&&p(e.prototype,t),r&&p(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t,r,n,a,i,s,l,h,b,w}();e.exports=new b},626:(e,t,r)=>{function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function o(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,a(n.key),n)}}function a(e){var t=function(e,t){if("object"!=n(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var o=r.call(e,t||"default");if("object"!=n(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==n(t)?t:t+""}var i=r(928),c=r(896),s=function(){return e=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.environments={wasmdev:"http://beta-vapp-ide.jd.com",wasmprod:"https://vapp-ide-pack.jd.com"},this.currentEnv="wasmdev"},t=[{key:"getBaseUrl",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.currentEnv;return this.environments[e]}},{key:"getApiUrls",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.currentEnv,t=this.getBaseUrl(e);return{UPLOAD_FILE:"".concat(t,"/wasm/upload"),ADD_GAME_VERSION:"".concat(t,"/wasm/packageBind"),INIT:"".concat(t,"/wasm/initialize"),SPLIT:"".concat(t,"/wasm/build"),GET_GAME_SPLIT_INFO:"".concat(t,"/wasm/queryBuildResultBySubVersion"),DOWNLOAD_FILE:"".concat(t,"/wasm/download"),GET_SYMBOL_SIZE:"".concat(t,"/wasm/getSymbolSize"),GET_INIT_RES:"".concat(t,"/wasm/queryInitResult")}}},{key:"loadProjectConfig",value:function(e){var t=i.resolve(e,"./jgc.config.js"),n="function"==typeof require?require:r(220);delete n.cache[n.resolve(t)];var o=n(t),a=o.type,s=void 0===a?"game":a,u=o.entry,l=o.appId,f=o.requestToken,p=i.resolve(e,u),h=i.resolve(p,"./.codesplitcache"),m=i.resolve(h,"./original"),d=i.resolve(m,"./wasmcode/");return c.existsSync(h)||c.mkdirSync(h,{recursive:!0}),c.existsSync(m)||c.mkdirSync(m,{recursive:!0}),c.existsSync(d)||c.mkdirSync(d,{recursive:!0}),{type:s,entry:u,appId:l,requestToken:f,mainWasmCachePath:c.readdirSync(d).filter((function(e){return".br"===i.extname(e)}))[0],originalCacheDir:m,fullEntryPath:p}}}],t&&o(e.prototype,t),n&&o(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t,n}();e.exports=new s},46:e=>{e.exports={createWasmSplitCodeBySimd:function(){return' import {\n tableSize,\n setImportGlobal\n } from "./import-func-index";\n import {\n\n isIOS\n } from "./check-version";\n\n let b = (wx.getAccountInfoSync() || {}).miniProgram;\n let webcookieInfo = {};\n wx.requestWebCookie && wx.requestWebCookie({\n needpin: 1,\n success(e) {\n webcookieInfo = {\n pt_pin: e.pt_pin,\n pt_ket: e.ticket\n }\n },\n });\n const isTrial = b && "release" != b.envVersion;\n let subpackageTask,\n callbackArray = [],\n isLoaded = false;\n\n function loadSubWasmPackage(doneCallback, needBlock) {\n if (isLoaded) {\n doneCallback(needBlock);\n return;\n }\n let loadStart = Date.now();\n GameGlobal.unityNamespace.eventLog("start loadSubPackage wasmcode1");\n callbackArray.push({\n callback: doneCallback,\n needBlock: needBlock,\n });\n if (!subpackageTask) {\n subpackageTask = wx.loadSubpackage({\n name: "wasmcode1",\n success() {\n let a = Date.now() - loadStart;\n GameGlobal.unityNamespace.eventLog("下载代码分包1完毕: ", (a / 1e3).toFixed(2), "s");\n GameGlobal.manager.subWasmDownloaded(a);\n isLoaded = true;\n callbackArray.forEach((a) => a.callback(a.needBlock));\n callbackArray = [];\n },\n fail(a) {\n GameGlobal.manager.Logger.pluginError("load wasmcode1 fail:", a);\n GameGlobal.manager.subWasmDownloadError(a);\n },\n });\n let currentProgress = 0;\n subpackageTask.onProgressUpdate((e) => {\n var t = Math.floor(e.progress / 10);\n if (t != currentProgress) {\n let a = (e.totalBytesWritten / 1048576).toFixed(2),\n t = (e.totalBytesExpectedToWrite / 1048576).toFixed(2);\n console.log("代码分包1下载进度", e.progress, a, "MB;", t, "MB");\n }\n currentProgress = t;\n });\n }\n\n }\n let loadedSub = false,\n isInstanced = false;\n\n function h(needBlock) {\n GameGlobal.unityNamespace.eventLog("start compileSubWasm: needBlock ", needBlock);\n GameGlobal.manager.beforeLoadSubWasm();\n let instanceStart = Date.now();\n const subWasmPath = "wasmcode1/" + GameGlobal.unityNamespace.CODE_FILE_MD5 + "." + GameGlobal.unityNamespace.GAME_NAME + ".wasm.code.unityweb.wasm.br";\n let callback = (a) => {\n let cost = Date.now() - instanceStart;\n GameGlobal.manager.subWasmCompiled(cost);\n GameGlobal.unityNamespace.eventLog("[PLUGIN SUBWASM LOG]subwasm loaded: ", cost);\n setMemory(wasm_split_info.primary.memory);\n isInstanced = true;\n\n };\n WXWebAssembly.instantiate(subWasmPath, wasm_split_info)\n .then(callback)\n .catch((a) => {\n console.error("wasmcode1 catch ", a);\n });\n }\n\n function reTry(a) {\n let e = function () {\n isInstanced ? a() : setTimeout(e, 1);\n };\n setTimeout(e, 1);\n }\n\n function invokeWait(needBlock) {\n if (!isInstanced) {\n if (!loadedSub) {\n loadedSub = true;\n GameGlobal.unityNamespace.eventLog("start instantiateSubWasm: needBlock ", needBlock);\n loadSubWasmPackage(h, needBlock);\n\n }\n\n }\n }\n\n function innerInvokeWasmBuffer(funcName, e) {\n\n\n\n function base64Decode(e, t = 1) {\n const s = e.replace(/[^A-Za-z0-9+/]/g, ""),\n i = s.length,\n n = t ? Math.ceil((3 * i + 1 >>> 2) / t) * t : 3 * i + 1 >>> 2,\n a = new Uint8Array(n);\n let o = 0,\n r = 0;\n for (let e = 0; e < i; e++) {\n const t = 3 & e;\n if (o |= kkk(s.charCodeAt(e)) << 18 - 6 * t, 3 === t || i - e == 1) {\n for (let e = 0; e < 3 && r < n; e++, r++) a[r] = o >>> (16 >>> e & 24) & 255;\n o = 0\n }\n }\n return a\n }\n\n function kkk(e) {\n return e > 64 && e < 91 ? e - 65 : e > 96 && e < 123 ? e - 71 : e > 47 && e < 58 ? e + 4 : 43 === e ? 62 : 47 === e ? 63 : 0\n }\n console.log(\'!!!!!innerInvokeWasmBuffer\')\n GameGlobal.manager.wasmsplit.innerInvokeWasmBuffer1 = ({\n funcName: _funcName,\n importObj: _importObj,\n success: _success,\n fail: _fail\n }) => {\n\n try {\n var aatime = new Date().getTime();\n const n = new GameGlobal.nativeXHR,\n a = {\n appId: GameGlobal.unityNamespace.APPID,\n wasmMd5: GameGlobal.unityNamespace.CODE_FILE_MD5,\n subVersion: GameGlobal.unityNamespace.wasmSubVersion,\n funcIndex: _funcName\n };\n console.log(\'!!!!aaa\', a)\n\n const params = new URLSearchParams({\n\n\n functionId: "jdaGameGetPatchFunc",\n appid: "mp-minigame",\n body: JSON.stringify(a) // 转为 JSON 字符串\n }).toString();\n var baseUrl = GameGlobal.unityNamespace.baseUrl;\n console.log(\'!!!!urlll\', baseUrl+"/?" + params)\n\n // n.open("GET", onEventCallback.GET_WASM_FUNC, false);\n n.open(\'GET\', baseUrl + "/?" + params, false);\n n.withCredentials = true;\n n.setRequestHeader("Cookie", "pt_key=" + webcookieInfo.pt_key + ";pt_pin=" + webcookieInfo.pt_pin);\n try {\n\n n.send()\n if (n.status == 200) {\n var bbtime = new Date().getTime()\n console.log(\'响应:\', bbtime - aatime, n.responseText);\n const e = JSON.parse(n.responseText);\n const a = e.result.codeStr;\n\n const o = base64Decode(a);\n console.log(\'!!!base64Decode\', o, a, _importObj, typeof GameGlobal.nativeWASM.Instance, typeof GameGlobal.nativeWASM.Module)\n const r = new GameGlobal.nativeWASM.Instance(new GameGlobal.nativeWASM.Module(o), _importObj);\n console.log(\'!!!!执行\', new Date().getTime() - bbtime)\n _success(r);\n\n } else {\n console.error(\'请求失败:\', n.statusText);\n }\n\n\n } catch (e) {\n\n }\n } catch (e) {}\n };\n\n\n GameGlobal.manager.wasmsplit.innerInvokeWasmBuffer1({\n //invokeWasmBuffer: invokeWasmBuffer,\n funcName: funcName,\n importObj: window.wasm_split_info,\n fail(t) {\n if (e > 0) {\n GameGlobal.unityNamespace.eventLog("fetch table_id: ", funcName, "; remainRetryTimes: ", e);\n return innerInvokeWasmBuffer(funcName, e - 1);\n }\n GameGlobal.unityNamespace.eventLog(\n "fetch table_id:",\n funcName,\n "; md5: ",\n GameGlobal.unityNamespace.CODE_FILE_MD5,\n "; subversion: ",\n GameGlobal.unityNamespace.WASM_SPLIT_SUB_VERSION,\n "; err: ",\n t\n );\n if ("system error" === t.errmsg || "content is null" === t.errmsg) {\n GameGlobal.onCrash();\n } else {\n wx.showModal({\n title: "网络状态异常",\n content: "请检查网络后重启 小游戏",\n showCancel: false,\n confirmText: wx.restartMiniProgram ? "立即重启" : "确定",\n success() {\n if (wx.restartMiniProgram) {\n wx.restartMiniProgram({});\n }\n },\n });\n }\n },\n });\n }\n window.Math_abs = Math.abs;\n window.Math_cos = Math.cos;\n window.Math_sin = Math.sin;\n window.Math_sqrt = Math.sqrt;\n window.Math_ceil = Math.ceil;\n window.Math_floor = Math.floor;\n window.Math_pow = Math.pow;\n window.Math_min = Math.min;\n window.Math_max = Math.max;\n window.Math_fround = Math.fround;\n window.Math_imul = Math.imul;\n window.Math_clz32 = Math.clz32;\n window.Math_trunc = Math.trunc;\n window.FUNCTION_TABLE = [];\n let calledFunc = new Map(),\n mainCalledFunc = new Set();\n\n function _reportCalledFunc() {\n let logCallBasePtr = GameGlobal.unityNamespace.logCallBasePtr;\n if (logCallBasePtr) {\n for (var memoryBuffer = new Int32Array(window.wasm_split_info.primary.memory.buffer), t = 0; t < GameGlobal.unityNamespace.logCallMemorySize; t++) {\n if (memoryBuffer[logCallBasePtr + t]) {\n calledFunc.set(t, memoryBuffer[logCallBasePtr + t]);\n memoryBuffer[logCallBasePtr + t] = 0;\n }\n }\n }\n if (calledFunc.size > 0) {\n GameGlobal.manager.reportCalledFuncsJD({\n called_func_list: Array.from(calledFunc.keys()),\n func_cnt_list: Array.from(calledFunc.values()),\n sub_version: GameGlobal.unityNamespace.WASM_SPLIT_SUB_VERSION,\n });\n calledFunc.clear();\n }\n if (mainCalledFunc.size > 0) {\n GameGlobal.manager.reportCalledFuncsJD({\n called_func_list: Array.from(mainCalledFunc),\n sub_version: GameGlobal.unityNamespace.WASM_SPLIT_SUB_VERSION,\n func_type: 1,\n });\n mainCalledFunc.clear();\n }\n\n setTimeout(_reportCalledFunc, 5000);\n }\n\n function setMemory(memory) {\n if (GameGlobal.unityNamespace.initedRedirMem) {\n return;\n }\n GameGlobal.unityNamespace.initedRedirMem = true;\n var fileManager = wx.getFileSystemManager();\n try {\n var binData = fileManager.readFileSync("wasmcode/" + GameGlobal.unityNamespace.CODE_FILE_MD5 + "." + GameGlobal.unityNamespace.GAME_NAME + ".redirmem.bin");\n } catch (err) {\n GameGlobal.unityNamespace.eventLog("[PLUGIN LOG] release does not have redirmem.bin");\n return;\n }\n let binArray = new Int32Array(binData);\n\n GameGlobal.unityNamespace.logCallMemorySize = binArray.length;\n\n let addr = memory.buffer.byteLength - binData.byteLength;\n\n GameGlobal.unityNamespace.logCallBaseAddr.value = addr;\n\n addr >>= 2;\n GameGlobal.unityNamespace.logCallBasePtr = addr;\n\n for (var memoryData = new Int32Array(memory.buffer), o = 0; o < binArray.length; o++) {\n memoryData[addr + o] = binArray[o];\n }\n\n let s = Module._malloc(binData.byteLength);\n GameGlobal.unityNamespace.logCallBaseAddr.value = s;\n s >>= 2;\n GameGlobal.unityNamespace.logCallBasePtr = s;\n for (o = 0; o < binArray.length; o++) {\n memoryData[s + o] = memoryData[addr + o];\n }\n\n }\n GameGlobal.unityNamespace.reportCalledFunc = _reportCalledFunc;\n\n if (!GameGlobal.unityNamespace.pluginCalledMainCbs) {\n GameGlobal.unityNamespace.pluginCalledMainCbs = [];\n }\n\n if (!GameGlobal.unityNamespace.pluginCalledMainCb) {\n GameGlobal.unityNamespace.pluginCalledMainCb = function () {\n this.pluginCalledMainCbs.forEach((a) => a());\n };\n }\n\n isTrial && !GameGlobal.canUseH5Renderer && GameGlobal.unityNamespace.pluginCalledMainCbs.push(_reportCalledFunc);\n\n GameGlobal.unityNamespace.instantiateWasm = function (instantiateWasmInfo, receiveInstance) {\n console.log("in wasm-split instantiateWasm");\n const module = GameGlobal.manager.gameInstance.Module,\n asm2wasm = (instantiateWasmInfo.asm2wasm = instantiateWasmInfo.asm2wasm || {});\n asm2wasm["f64-to-int"] =\n asm2wasm["f64-to-int"] ||\n function (a) {\n return 0 | a;\n };\n asm2wasm["f64-rem"] =\n asm2wasm["f64-rem"] ||\n function (a, e) {\n return a % e;\n };\n\n instantiateWasmInfo.env = instantiateWasmInfo.env || {};\n\n instantiateWasmInfo.primary = {\n table: instantiateWasmInfo.env.table ||\n new WebAssembly.Table({\n initial: tableSize,\n maximum: tableSize,\n element: "anyfunc",\n }),\n memory: instantiateWasmInfo.env.memory,\n };\n\n setImportGlobal(instantiateWasmInfo);\n\n instantiateWasmInfo.wasm_split = instantiateWasmInfo.wasm_split || {};\n instantiateWasmInfo.wasm_split.wait = function () {\n let waitTableId = GameGlobal.unityNamespace.waitTableId.value;\n GameGlobal.unityNamespace.eventLog("wait for func: ", waitTableId);\n if (isIOS && canUseH5Renderer) {\n return innerInvokeWasmBuffer(waitTableId.toString(), 3);\n }\n invokeWait(true);\n if (GameGlobal.manager.wasmsplit && GameGlobal.manager.wasmsplit.checkNeedReportMissPatchFunc) {\n GameGlobal.manager.wasmsplit.checkNeedReportMissPatchFunc(waitTableId);\n }\n GameGlobal.manager.reportCalledFuncsJD({\n called_func_list: [waitTableId],\n func_type: 2,\n sub_version: GameGlobal.unityNamespace.WASM_SPLIT_SUB_VERSION,\n });\n };\n\n if (GameGlobal.canUseH5Renderer) {\n instantiateWasmInfo.wasm_split.logCall = function (a, e) {};\n } else {\n instantiateWasmInfo.wasm_split.logCall = function (a, e) {\n if (e) {\n mainCalledFunc.add(a);\n }\n calledFunc.set(a, (calledFunc.get(a) || 0) + 1);\n };\n }\n instantiateWasmInfo.wasm_split.__wasm_split_waitTableId = GameGlobal.unityNamespace.waitTableId = new WebAssembly.Global({\n value: "i32",\n mutable: true,\n });\n instantiateWasmInfo.wasm_split.__wasm_split_logCallBaseAddr = GameGlobal.unityNamespace.logCallBaseAddr = new WebAssembly.Global({\n value: "i32",\n mutable: true,\n });\n\n window.wasm_split_info = instantiateWasmInfo;\n let wasmPath = module.wasmPath;\n WebAssembly.instantiate(wasmPath, instantiateWasmInfo).then((resultObject) => {\n let primaryTable = instantiateWasmInfo.primary.table;\n for (var o = 0; o < primaryTable.length; ++o) {\n window.FUNCTION_TABLE[o] = primaryTable.get(o);\n }\n //instance: 包含所有导出的 WebAssembly 函数的 WebAssembly.Instance 对象。\n Object.entries(resultObject.instance.exports).forEach((instanceFunc) => {\n //["ur", Memory(4096)], ["vr", ƒ]\n if ("object" == typeof instanceFunc[1] && instanceFunc[1] instanceof WebAssembly.Memory) {\n instantiateWasmInfo.primary.memory = instanceFunc[1];\n asm2wasm.__wasm_memory_size = window.__wasm_memory_size = () => (instanceFunc[1].buffer.byteLength / 65536) | 0;\n }\n if (instanceFunc[0].startsWith("wasm_split.")) {\n instantiateWasmInfo.primary[instanceFunc[0]] = instanceFunc[1];\n }\n });\n instantiateWasmInfo.primary["wasm_split.initGlobal"] = resultObject.instance.exports.initGlobal;\n resultObject.instance.exports.initGlobal();\n module.asm = resultObject.instance.exports;\n if (GameGlobal.canUseH5Renderer) {\n setMemory(instantiateWasmInfo.primary.memory);\n let runtimeType = "android&wasm3";\n GameGlobal.canUseH5Renderer && (runtimeType = "iOS_hp");\n var instantiatePatch;\n if (GameGlobal.manager.instantiatePatch) {\n instantiatePatch = GameGlobal.manager\n .instantiatePatch(GameGlobal.unityNamespace.WASM_SPLIT_SUB_VERSION, wasm_split_info, {})\n .then(\n (a) => {\n (a && GameGlobal.unityNamespace.eventLog(_runtimeType + " instantiatePatch success ", GameGlobal.unityNamespace.WASM_SPLIT_SUB_VERSION))\n return a;\n }\n )\n .catch((a) => {\n console.warn("[PLUGIN SUBWASM WARN]", _runtimeType, " instantiatePatch warn", a);\n GameGlobal.unityNamespace.eventLog(_runtimeType, "instantiatePatch warn", a);\n })\n } else {\n instantiatePatch = Promise.resolve();\n }\n instantiatePatch.finally(() => {\n console.log("instantiatePatch finally");\n receiveInstance(resultObject.instance, resultObject.module);\n });\n } else {\n GameGlobal.unityNamespace.eventLog("no signal api, start instantiate sub wasm");\n invokeWait(true);\n reTry(() => receiveInstance(resultObject.instance, resultObject.module));\n }\n });\n return {};\n };\n GameGlobal.unityNamespace.compileSubWasm = function () {\n return new Promise((reslove) => {\n GameGlobal.unityNamespace.eventLog("start asyncCompileSubWasm");\n if (isInstanced) return reslove();\n loadSubWasmPackage(() => {\n GameGlobal.unityNamespace.eventLog("async load subpackage done");\n }, false);\n });\n };'},createImportFuncIndexCodeBySimd:function(e,t,r,n,o){return"export const importSubFuncIndexList = [];\nexport const tableSize = ".concat(e,";\nGameGlobal.unityNamespace.wasmSubVersion =").concat(t,';\nGameGlobal.unityNamespace.baseUrl ="').concat(r?"http://beta-vapp-ide.jd.com":"https://vapp-ide-pack.jd.com",'";\nGameGlobal.canUseH5Renderer = GameGlobal.unityNamespace.isIOS &&').concat(!!o,'\nGameGlobal.unityNamespace.requestToken = "').concat(n,'"\nexport function setImportGlobal(info) {info["primary"] = info["primary"] || {};info["primary"]["__stack_pointer"] = new WebAssembly.Global({\n value: "i32",\n mutable: true\n });info["primary"]["__stack_end"] = new WebAssembly.Global({\n value: "i32",\n mutable: true\n });info["primary"]["__stack_base"] = new WebAssembly.Global({\n value: "i32",\n mutable: true\n });};\n \n export function setStackPointer(info) {\n // if (info["primary"]["__stack_pointer"]) {\n // info["primary"]["__stack_pointer"].value = 0;\n // }\n }\n \n export function setImportFunc(info, jCall) {\n \n }\n \n ')}}},225:(e,t,r)=>{function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function o(){"use strict";/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */o=function(){return t};var e,t={},r=Object.prototype,a=r.hasOwnProperty,i=Object.defineProperty||function(e,t,r){e[t]=r.value},c="function"==typeof Symbol?Symbol:{},s=c.iterator||"@@iterator",u=c.asyncIterator||"@@asyncIterator",l=c.toStringTag||"@@toStringTag";function f(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{f({},"")}catch(e){f=function(e,t,r){return e[t]=r}}function p(e,t,r,n){var o=t&&t.prototype instanceof b?t:b,a=Object.create(o.prototype),c=new N(n||[]);return i(a,"_invoke",{value:G(e,r,c)}),a}function h(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}t.wrap=p;var m="suspendedStart",d="suspendedYield",y="executing",v="completed",g={};function b(){}function w(){}function x(){}var k={};f(k,s,(function(){return this}));var S=Object.getPrototypeOf,E=S&&S(S(T([])));E&&E!==r&&a.call(E,s)&&(k=E);var _=x.prototype=b.prototype=Object.create(k);function P(e){["next","throw","return"].forEach((function(t){f(e,t,(function(e){return this._invoke(t,e)}))}))}function j(e,t){function r(o,i,c,s){var u=h(e[o],e,i);if("throw"!==u.type){var l=u.arg,f=l.value;return f&&"object"==n(f)&&a.call(f,"__await")?t.resolve(f.__await).then((function(e){r("next",e,c,s)}),(function(e){r("throw",e,c,s)})):t.resolve(f).then((function(e){l.value=e,c(l)}),(function(e){return r("throw",e,c,s)}))}s(u.arg)}var o;i(this,"_invoke",{value:function(e,n){function a(){return new t((function(t,o){r(e,n,t,o)}))}return o=o?o.then(a,a):a()}})}function G(t,r,n){var o=m;return function(a,i){if(o===y)throw Error("Generator is already running");if(o===v){if("throw"===a)throw i;return{value:e,done:!0}}for(n.method=a,n.arg=i;;){var c=n.delegate;if(c){var s=I(c,n);if(s){if(s===g)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===m)throw o=v,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=y;var u=h(t,r,n);if("normal"===u.type){if(o=n.done?v:d,u.arg===g)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(o=v,n.method="throw",n.arg=u.arg)}}}function I(t,r){var n=r.method,o=t.iterator[n];if(o===e)return r.delegate=null,"throw"===n&&t.iterator.return&&(r.method="return",r.arg=e,I(t,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),g;var a=h(o,t.iterator,r.arg);if("throw"===a.type)return r.method="throw",r.arg=a.arg,r.delegate=null,g;var i=a.arg;return i?i.done?(r[t.resultName]=i.value,r.next=t.nextLoc,"return"!==r.method&&(r.method="next",r.arg=e),r.delegate=null,g):i:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,g)}function L(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function O(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function N(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(L,this),this.reset(!0)}function T(t){if(t||""===t){var r=t[s];if(r)return r.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,i=function r(){for(;++o<t.length;)if(a.call(t,o))return r.value=t[o],r.done=!1,r;return r.value=e,r.done=!0,r};return i.next=i}}throw new TypeError(n(t)+" is not iterable")}return w.prototype=x,i(_,"constructor",{value:x,configurable:!0}),i(x,"constructor",{value:w,configurable:!0}),w.displayName=f(x,l,"GeneratorFunction"),t.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===w||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,x):(e.__proto__=x,f(e,l,"GeneratorFunction")),e.prototype=Object.create(_),e},t.awrap=function(e){return{__await:e}},P(j.prototype),f(j.prototype,u,(function(){return this})),t.AsyncIterator=j,t.async=function(e,r,n,o,a){void 0===a&&(a=Promise);var i=new j(p(e,r,n,o),a);return t.isGeneratorFunction(r)?i:i.next().then((function(e){return e.done?e.value:i.next()}))},P(_),f(_,l,"Generator"),f(_,s,(function(){return this})),f(_,"toString",(function(){return"[object Generator]"})),t.keys=function(e){var t=Object(e),r=[];for(var n in t)r.push(n);return r.reverse(),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},t.values=T,N.prototype={constructor:N,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(O),!t)for(var r in this)"t"===r.charAt(0)&&a.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=e)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var r=this;function n(n,o){return c.type="throw",c.arg=t,r.next=n,o&&(r.method="next",r.arg=e),!!o}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],c=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var s=a.call(i,"catchLoc"),u=a.call(i,"finallyLoc");if(s&&u){if(this.prev<i.catchLoc)return n(i.catchLoc,!0);if(this.prev<i.finallyLoc)return n(i.finallyLoc)}else if(s){if(this.prev<i.catchLoc)return n(i.catchLoc,!0)}else{if(!u)throw Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return n(i.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var n=this.tryEntries[r];if(n.tryLoc<=this.prev&&a.call(n,"finallyLoc")&&this.prev<n.finallyLoc){var o=n;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var i=o?o.completion:{};return i.type=e,i.arg=t,o?(this.method="next",this.next=o.finallyLoc,g):this.complete(i)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),g},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),O(r),g}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var o=n.arg;O(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={iterator:T(t),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=e),g}},t}function a(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,o,a,i,c=[],s=!0,u=!1;try{if(a=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;s=!1}else for(;!(s=(n=a.call(r)).done)&&(c.push(n.value),c.length!==t);s=!0);}catch(e){u=!0,o=e}finally{try{if(!s&&null!=r.return&&(i=r.return(),Object(i)!==i))return}finally{if(u)throw o}}return c}}(e,t)||function(e,t){if(e){if("string"==typeof e)return i(e,t);var r={}.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?i(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function i(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function c(e,t,r,n,o,a,i){try{var c=e[a](i),s=c.value}catch(e){return void r(e)}c.done?t(s):Promise.resolve(s).then(n,o)}var s=r(896),u=r(23).promisify,l=r(759),f=u(s.readFile),p=u(s.writeFile);function h(){var e;return e=o().mark((function e(t,r){var n,a,i,c,s=arguments;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=!(s.length>2&&void 0!==s[2])||s[2],e.prev=1,e.next=4,f(t,"utf8");case 4:if(a=e.sent,i=JSON.parse(a),c=m(i),!n){e.next=11;break}return e.next=10,p(r,JSON.stringify(c,null,2));case 10:return e.abrupt("return");case 11:return e.abrupt("return",c);case 14:throw e.prev=14,e.t0=e.catch(1),l.logErr("处理文件时发生错误: ".concat(e.t0.message)),e.t0;case 18:case"end":return e.stop()}}),e,null,[[1,14]])})),h=function(){var t=this,r=arguments;return new Promise((function(n,o){var a=e.apply(t,r);function i(e){c(a,n,o,i,s,"next",e)}function s(e){c(a,n,o,i,s,"throw",e)}i(void 0)}))},h.apply(this,arguments)}function m(e){var t={"\\28":"(","\\29":")","\\5b":"[","\\5d":"]","\\2c":",","\\20":" "},r={};return Object.entries(e).forEach((function(e){var n=a(e,2),o=n[0],i=n[1];Object.entries(t).forEach((function(e){var t=a(e,2),r=t[0],n=t[1];i=i.replace(new RegExp(r,"g"),n)})),r[o]=i})),r}e.exports=function(e,t){return h.apply(this,arguments)}},427:(e,t,r)=>{function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function o(){"use strict";/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */o=function(){return t};var e,t={},r=Object.prototype,a=r.hasOwnProperty,i=Object.defineProperty||function(e,t,r){e[t]=r.value},c="function"==typeof Symbol?Symbol:{},s=c.iterator||"@@iterator",u=c.asyncIterator||"@@asyncIterator",l=c.toStringTag||"@@toStringTag";function f(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{f({},"")}catch(e){f=function(e,t,r){return e[t]=r}}function p(e,t,r,n){var o=t&&t.prototype instanceof b?t:b,a=Object.create(o.prototype),c=new N(n||[]);return i(a,"_invoke",{value:G(e,r,c)}),a}function h(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}t.wrap=p;var m="suspendedStart",d="suspendedYield",y="executing",v="completed",g={};function b(){}function w(){}function x(){}var k={};f(k,s,(function(){return this}));var S=Object.getPrototypeOf,E=S&&S(S(T([])));E&&E!==r&&a.call(E,s)&&(k=E);var _=x.prototype=b.prototype=Object.create(k);function P(e){["next","throw","return"].forEach((function(t){f(e,t,(function(e){return this._invoke(t,e)}))}))}function j(e,t){function r(o,i,c,s){var u=h(e[o],e,i);if("throw"!==u.type){var l=u.arg,f=l.value;return f&&"object"==n(f)&&a.call(f,"__await")?t.resolve(f.__await).then((function(e){r("next",e,c,s)}),(function(e){r("throw",e,c,s)})):t.resolve(f).then((function(e){l.value=e,c(l)}),(function(e){return r("throw",e,c,s)}))}s(u.arg)}var o;i(this,"_invoke",{value:function(e,n){function a(){return new t((function(t,o){r(e,n,t,o)}))}return o=o?o.then(a,a):a()}})}function G(t,r,n){var o=m;return function(a,i){if(o===y)throw Error("Generator is already running");if(o===v){if("throw"===a)throw i;return{value:e,done:!0}}for(n.method=a,n.arg=i;;){var c=n.delegate;if(c){var s=I(c,n);if(s){if(s===g)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===m)throw o=v,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=y;var u=h(t,r,n);if("normal"===u.type){if(o=n.done?v:d,u.arg===g)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(o=v,n.method="throw",n.arg=u.arg)}}}function I(t,r){var n=r.method,o=t.iterator[n];if(o===e)return r.delegate=null,"throw"===n&&t.iterator.return&&(r.method="return",r.arg=e,I(t,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),g;var a=h(o,t.iterator,r.arg);if("throw"===a.type)return r.method="throw",r.arg=a.arg,r.delegate=null,g;var i=a.arg;return i?i.done?(r[t.resultName]=i.value,r.next=t.nextLoc,"return"!==r.method&&(r.method="next",r.arg=e),r.delegate=null,g):i:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,g)}function L(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function O(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function N(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(L,this),this.reset(!0)}function T(t){if(t||""===t){var r=t[s];if(r)return r.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,i=function r(){for(;++o<t.length;)if(a.call(t,o))return r.value=t[o],r.done=!1,r;return r.value=e,r.done=!0,r};return i.next=i}}throw new TypeError(n(t)+" is not iterable")}return w.prototype=x,i(_,"constructor",{value:x,configurable:!0}),i(x,"constructor",{value:w,configurable:!0}),w.displayName=f(x,l,"GeneratorFunction"),t.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===w||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,x):(e.__proto__=x,f(e,l,"GeneratorFunction")),e.prototype=Object.create(_),e},t.awrap=function(e){return{__await:e}},P(j.prototype),f(j.prototype,u,(function(){return this})),t.AsyncIterator=j,t.async=function(e,r,n,o,a){void 0===a&&(a=Promise);var i=new j(p(e,r,n,o),a);return t.isGeneratorFunction(r)?i:i.next().then((function(e){return e.done?e.value:i.next()}))},P(_),f(_,l,"Generator"),f(_,s,(function(){return this})),f(_,"toString",(function(){return"[object Generator]"})),t.keys=function(e){var t=Object(e),r=[];for(var n in t)r.push(n);return r.reverse(),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},t.values=T,N.prototype={constructor:N,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(O),!t)for(var r in this)"t"===r.charAt(0)&&a.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=e)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var r=this;function n(n,o){return c.type="throw",c.arg=t,r.next=n,o&&(r.method="next",r.arg=e),!!o}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],c=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var s=a.call(i,"catchLoc"),u=a.call(i,"finallyLoc");if(s&&u){if(this.prev<i.catchLoc)return n(i.catchLoc,!0);if(this.prev<i.finallyLoc)return n(i.finallyLoc)}else if(s){if(this.prev<i.catchLoc)return n(i.catchLoc,!0)}else{if(!u)throw Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return n(i.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var n=this.tryEntries[r];if(n.tryLoc<=this.prev&&a.call(n,"finallyLoc")&&this.prev<n.finallyLoc){var o=n;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var i=o?o.completion:{};return i.type=e,i.arg=t,o?(this.method="next",this.next=o.finallyLoc,g):this.complete(i)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),g},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),O(r),g}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var o=n.arg;O(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={iterator:T(t),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=e),g}},t}function a(e,t,r,n,o,a,i){try{var c=e[a](i),s=c.value}catch(e){return void r(e)}c.done?t(s):Promise.resolve(s).then(n,o)}function i(e){return function(){var t=this,r=arguments;return new Promise((function(n,o){var i=e.apply(t,r);function c(e){a(i,n,o,c,s,"next",e)}function s(e){a(i,n,o,c,s,"throw",e)}c(void 0)}))}}var c,s=r(896),u=s.promises,l=r(928),f=r(938),p=function(e,t){return{filePath:e?t:void 0,tempFilePath:t,statusCode:200}},h=function(){var e=i(o().mark((function e(t){return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,u.access(t);case 3:e.next=9;break;case 5:return e.prev=5,e.t0=e.catch(0),e.next=9,u.mkdir(t,{recursive:!0});case 9:case"end":return e.stop()}}),e,null,[[0,5]])})));return function(t){return e.apply(this,arguments)}}(),m=function(){var e=i(o().mark((function e(t){return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,u.stat(t);case 3:if(!e.sent.isDirectory()){e.next=7;break}return e.next=7,u.rm(t,{recursive:!0});case 7:e.next=11;break;case 9:e.prev=9,e.t0=e.catch(0);case 11:case"end":return e.stop()}}),e,null,[[0,9]])})));return function(t){return e.apply(this,arguments)}}();e.exports={downloadFile:(c=i(o().mark((function e(t){var r,n,a,c,d,y,v,g,b;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.url,n=t.filePath,a=t.success,c=t.fail,d=t.complete,y={success:a,fail:c,complete:d},e.prev=2,e.next=5,h(l.dirname(n));case 5:return e.next=7,m(n);case 7:return e.next=9,f({method:"get",url:r,responseType:"stream"});case 9:return v=e.sent,g=s.createWriteStream(n),v.data.pipe(g),e.abrupt("return",new Promise((function(e,t){var r=0,a=parseInt(v.headers["content-length"]),c=v.headers["transfer-encoding"];g.on("finish",i(o().mark((function i(){var s,l,f;return o().wrap((function(o){for(;;)switch(o.prev=o.next){case 0:if(o.prev=0,"chunked"===c||!a||r===a){o.next=5;break}return o.next=4,u.unlink(n);case 4:throw new Error("Download incomplete: Received ".concat(r," of ").concat(a," bytes"));case 5:null===(s=y.success)||void 0===s||s.call(y,p(!0,n)),e(p(!0,n)),o.next=13;break;case 9:o.prev=9,o.t0=o.catch(0),null===(l=y.fail)||void 0===l||l.call(y,{errMsg:o.t0.message}),t(o.t0);case 13:return o.prev=13,null===(f=y.complete)||void 0===f||f.call(y),o.finish(13);case 16:case"end":return o.stop()}}),i,null,[[0,9,13,16]])})))),g.on("error",function(){var e=i(o().mark((function e(r){var a;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,u.unlink(n).catch((function(){}));case 2:null===(a=y.fail)||void 0===a||a.call(y,{errMsg:"Write failed: ".concat(r.message)}),t(r);case 4:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()),v.data.on("data",(function(e){r+=e.length}))})));case 15:return e.prev=15,e.t0=e.catch(2),e.next=19,u.unlink(n).catch((function(){}));case 19:throw null===(b=y.fail)||void 0===b||b.call(y,{errMsg:"Download failed: ".concat(e.t0.message)}),e.t0;case 21:case"end":return e.stop()}}),e,null,[[2,15]])}))),function(e){return c.apply(this,arguments)})}},322:(e,t,r)=>{function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function o(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,a(n.key),n)}}function a(e){var t=function(e,t){if("object"!=n(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var o=r.call(e,t||"default");if("object"!=n(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==n(t)?t:t+""}var i=r(896),c=r(928),s=r(410),u=r(46),l=u.createWasmSplitCodeBySimd,f=u.createImportFuncIndexCodeBySimd,p=r(377),h=function(){return e=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)},r=[{key:"syncPluginCacheFiles",value:function(e,t){this.ensureDirectoryExists(t),this.copyBrFiles(e,t),this.copyFixedFiles(e,t)}},{key:"ensureDirectoryExists",value:function(e){i.existsSync(e)||i.mkdirSync(e,{recursive:!0})}},{key:"copyBrFiles",value:function(e,t){var r=this,n=c.join(e,"wasmcode1");if(i.existsSync(n))throw new Error("文件备份错误,检查wasm文件是否是已分包版本");var o=c.join(t,"wasmcode");i.existsSync(o)&&i.rmSync(o,{recursive:!0,force:!0}),i.mkdirSync(o,{recursive:!0});var a=c.join(e,"wasmcode","*.br");s.sync(a).forEach((function(n){var o=c.relative(e,n),a=c.join(t,o),s=c.dirname(a);r.ensureDirectoryExists(s),i.copyFileSync(n,a)}))}},{key:"copyFixedFiles",value:function(e,t){["game.js","game.json","webgl.wasm.framework.unityweb.js","weapp-adapter.js"].forEach((function(r){var n=c.join(e,r),o=c.join(t,r);if(!i.existsSync(o)){if(!i.existsSync(n))throw new Error("Source file missing: ".concat(n));i.copyFileSync(n,o)}}))}},{key:"processJavaScriptFiles",value:function(e,t,r){this.config=r,i.copyFileSync(c.resolve(r.originalCacheDir,"./game.json"),c.resolve(t,"game.json"));var n=f(e.tableSize,e.subVersion,r.isPre,r.requestToken,r.isRelease);i.writeFileSync(c.resolve(t,"./import-func-index.js"),n);var o=l("");i.writeFileSync(c.resolve(t,"./wasm-split.js"),o);var a=c.resolve(t,"./wasmcode1/");i.writeFileSync(c.resolve(a,"game.js"),"")}},{key:"updateConfigFiles",value:function(e,t,r){this.config=r,this.updateGameJson(e,t),this.updateFrameworkJs(e,t),this.updateGameJs(e,t),this.updateAdapterJs(e,t)}},{key:"updateGameJson",value:function(e,t){var r=JSON.parse(i.readFileSync(c.resolve(this.config.originalCacheDir,"game.json")));r.subpackages.push({name:"wasmcode1",root:"wasmcode1/"}),i.writeFileSync(c.resolve(t,"game.json"),JSON.stringify(r,null,2))}},{key:"updateFrameworkJs",value:function(e,t){var r=c.resolve(this.config.originalCacheDir,"./webgl.wasm.framework.unityweb.js"),n=c.resolve(t,"./webgl.wasm.framework.unityweb.js"),o=i.readFileSync(r,"utf-8");p.forEach((function(e){o=o.replace(e.reg,e.replaceMethod)})),o+=";\nGameGlobal.unityNamespace.useWasmCodeSplit=true;GameGlobal.unityNamespace.WASM_SPLIT_SUB_VERSION=".concat(e.subVersion,";\n"),i.writeFileSync(n,o)}},{key:"updateGameJs",value:function(e,t){var r=this,n=c.resolve(this.config.originalCacheDir,"./game.js"),o=c.resolve(t,"./game.js"),a=i.readFileSync(n,"utf-8");[{reg:/const\s*_unityNamespace\s*=\s*_interopRequireDefault\(require\('\.\/unity-namespace'\)\)/gi,replaceMethod:function(){return"const _unityNamespace = _interopRequireDefault(require('./unity-namespace')); \n require('./wasm-split.js')"}},{reg:"import unityNamespace from './unity-namespace';",replaceMethod:function(){return"import unityNamespace from './unity-namespace';\n import wasm_split from './wasm-split'"}},{reg:/APPID:\s*['"][^'"]*['"]/gi,replaceMethod:function(){return"APPID:'".concat(r.config.appId,"'")}},{reg:"GameGlobal.manager = gameManager;",replaceMethod:function(){return'GameGlobal.manager = gameManager;\n GameGlobal.manager.reportCalledFuncsJD = function (e) {\n function splitArray(array, size = 500) {\n const result = [];\n \n for (let i = 0; i < array.length; i += size) {\n result.push(array.slice(i, i + size));\n }\n \n return result;\n }\n var list = e.called_func_list;\n splitArray(list).forEach((item)=>{\n request({\n called_func_list:item\n })\n })\n\n function request(e){\n e.called_func_list && wx.request({\n url: GameGlobal.unityNamespace.baseUrl+\'/wasm/reportWasmFunction\',\n method: "POST",\n header: {\n \'content-type\': "application/x-www-form-urlencoded"\n },\n data: {\n "appId": GameGlobal.unityNamespace.APPID,\n "requestToken": GameGlobal.unityNamespace.requestToken,\n "calledFuncList": e.called_func_list,\n "subVersion": GameGlobal.unityNamespace.wasmSubVersion,\n "md5": GameGlobal.unityNamespace.CODE_FILE_MD5\n },\n success(res) {\n console.log("!!!!reportCalledFuncs1 success", res)\n\n }\n })\n console.log("!!!reportCalledFuncs", e)\n }\n } '}}].forEach((function(e){a=a.replace(e.reg,e.replaceMethod)})),i.writeFileSync(o,a)}},{key:"updateAdapterJs",value:function(e,t){var r=c.resolve(this.config.originalCacheDir,"./weapp-adapter.js"),n=c.resolve(t,"./weapp-adapter.js"),o=i.readFileSync(r,"utf-8");o='"function" == typeof XMLHttpRequest&&(GameGlobal.nativeXHR = XMLHttpRequest);\n"object" == typeof WebAssembly&&(GameGlobal.nativeWASM = WebAssembly);'+o,i.writeFileSync(n,o)}}],(t=null)&&o(e.prototype,t),r&&o(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t,r}();e.exports=h},471:(e,t,r)=>{function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function o(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,a(n.key),n)}}function a(e){var t=function(e,t){if("object"!=n(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var o=r.call(e,t||"default");if("object"!=n(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==n(t)?t:t+""}var i,c,s,u=r(896),l=r(928),f=function(){return e=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)},r=[{key:"validateProjectStructure",value:function(e,t,r){var n=l.resolve(r,"./jgc.config.js");if(!this.isReadable(n))return{code:-1,msg:null,errMsg:"请先创建配置文件!"};if(!this.isReadable(t.fullEntryPath))return this.ERROR_MESSAGES[e].ENTRY_NOT_FOUND;var o=l.resolve(t.fullEntryPath,"game.json");try{var a;if(null===(a=JSON.parse(u.readFileSync(o,"utf-8")).plugins)||void 0===a||!a.UnityPlugin)return this.ERROR_MESSAGES[e].NOT_UNITY_GAME}catch(t){return this.ERROR_MESSAGES[e].GAME_JSON_NOT_FOUND}return{valid:!0}}},{key:"isReadable",value:function(e){try{return u.accessSync(e,u.constants.R_OK),!0}catch(e){return!1}}}],(t=null)&&o(e.prototype,t),r&&o(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t,r}();i=f,s={init:{ENTRY_NOT_FOUND:{code:-1,msg:"分包初始化失败",errMsg:"请检查entry是否存在"},NOT_UNITY_GAME:{code:-1,msg:"分包初始化失败",errMsg:"该游戏不是unity游戏"},GAME_JSON_NOT_FOUND:{code:-1,msg:"分包初始化失败",errMsg:"请检查game.json是否存在"}},split:{ENTRY_NOT_FOUND:{code:-1,msg:"WASM分包失败",errMsg:"请检查entry是否存在"},NOT_UNITY_GAME:{code:-1,msg:"WASM分包失败",errMsg:"该游戏不是unity游戏"},GAME_JSON_NOT_FOUND:{code:-1,msg:"WASM分包失败",errMsg:"请检查game.json是否存在"}}},(c=a(c="ERROR_MESSAGES"))in i?Object.defineProperty(i,c,{value:s,enumerable:!0,configurable:!0,writable:!0}):i[c]=s,e.exports=f},377:e=>{e.exports=[{reg:/Module\[('|")HEAP8('|")\]\s*=\s*HEAP8\s*=\s*new\s*Int8Array/gi,replaceMethod:function(){return'Module["HEAP8"] = window.EMSCRIPTEN_HEAP8 = HEAP8 = new Int8Array'}},{reg:/Module\[('|")HEAP16('|")\]\s*=\s*HEAP16\s*=\s*new\s*Int16Array/gi,replaceMethod:function(){return'Module["HEAP16"] = window.EMSCRIPTEN_HEAP16 = HEAP16 = new Int16Array'}},{reg:/Module\[('|")HEAP32('|")\]\s*=\s*HEAP32\s*=\s*new\s*Int32Array/gi,replaceMethod:function(){return'Module["HEAP32"] = window.EMSCRIPTEN_HEAP32 = HEAP32 = new Int32Array'}},{reg:/Module\[('|")HEAPU8('|")\]\s*=\s*HEAPU8\s*=\s*new\s*Uint8Array/gi,replaceMethod:function(){return'Module["HEAPU8"] = window.EMSCRIPTEN_HEAPU8 = HEAPU8 = new Uint8Array'}},{reg:/Module\[('|")HEAPU16('|")\]\s*=\s*HEAPU16\s*=\s*new\s*Uint16Array/gi,replaceMethod:function(){return'Module["HEAPU16"] = window.EMSCRIPTEN_HEAPU16 = HEAPU16 = new Uint16Array'}},{reg:/Module\[('|")HEAPU32('|")\]\s*=\s*HEAPU32\s*=\s*new\s*Uint32Array/gi,replaceMethod:function(){return'Module["HEAPU32"] = window.EMSCRIPTEN_HEAPU32 = HEAPU32 = new Uint32Array'}},{reg:/Module\[('|")HEAPF32('|")\]\s*=\s*HEAPF32\s*=\s*new\s*Float32Array/gi,replaceMethod:function(){return'Module["HEAPF32"] = window.EMSCRIPTEN_HEAPF32 = HEAPF32 = new Float32Array'}},{reg:/Module\[('|")HEAPF64('|")\]\s*=\s*HEAPF64\s*=\s*new\s*Float64Array/gi,replaceMethod:function(){return'Module["HEAPF64"] = window.EMSCRIPTEN_HEAPF64 = HEAPF64 = new Float64Array'}},{reg:"calledMain = true;",replaceMethod:function(){return"if (GameGlobal.unityNamespace.pluginCalledMainCb) {\n GameGlobal.unityNamespace.pluginCalledMainCb()\n }\n calledMain = true;"}}]},175:(e,t,r)=>{function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function o(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,c(n.key),n)}}function a(e,t,r){return t&&o(e.prototype,t),r&&o(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function i(e,t,r){return(t=c(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function c(e){var t=function(e,t){if("object"!=n(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var o=r.call(e,t||"default");if("object"!=n(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==n(t)?t:t+""}var s=r(320),u=new(a((function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),i(this,"wasmInit",(function(e){return s.init(e)})),i(this,"wasmUpdate",(function(e){return s.init(Object.assign(e,{isUpdate:!0}))})),i(this,"wasmSplitDev",(function(e){return s.splitBase(Object.assign(e,{isRelease:!1}))})),i(this,"wasmSplitProd",(function(e){return s.splitBase(Object.assign(e,{isRelease:!0}))})),i(this,"wasmSplitInfo",(function(e){return s.getSplitInfo(e)}))}))),l=u.wasmInit,f=u.wasmUpdate,p=u.wasmSplitDev,h=u.wasmSplitProd,m=u.wasmSplitInfo;e.exports={wasmInit:l,wasmUpdate:f,wasmSplitDev:p,wasmSplitProd:h,wasmSplitInfo:m}},759:(e,t,r)=>{function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function o(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,a(n.key),n)}}function a(e){var t=function(e,t){if("object"!=n(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var o=r.call(e,t||"default");if("object"!=n(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==n(t)?t:t+""}var i,c=r(895),s=r(720);e.exports=function(){return e=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)},r=[{key:"logStep",value:function(e){for(var t,r=arguments.length,n=new Array(r>1?r-1:0),o=1;o<r;o++)n[o-1]=arguments[o];(t=console).log.apply(t,[c.green("> ".concat(e))].concat(n))}},{key:"log",value:function(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];setTimeout((function(){var t;(t=console).log.apply(t,[c.green(e)].concat(r))}),0)}},{key:"logInfo",value:function(e){for(var t,r=arguments.length,n=new Array(r>1?r-1:0),o=1;o<r;o++)n[o-1]=arguments[o];(t=console).log.apply(t,[e].concat(n))}},{key:"logErr",value:function(e){for(var t,r=arguments.length,n=new Array(r>1?r-1:0),o=1;o<r;o++)n[o-1]=arguments[o];(t=console).log.apply(t,[c.red(e)].concat(n))}},{key:"startLogProcess",value:function(e){var t=s(e).start(),r={stop:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:e+" 失败";"fail"==(arguments.length>1?arguments[1]:void 0)?t.fail(e):t.succeed(e)}};return i=r,r}},{key:"endLogProcess",value:function(e,t){e||(e=i),e&&"function"==typeof e.stop&&e.stop(t,"fail")}}],(t=null)&&o(e.prototype,t),r&&o(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t,r}()},320:(e,t,r)=>{function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function o(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,o,a,i,c=[],s=!0,u=!1;try{if(a=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;s=!1}else for(;!(s=(n=a.call(r)).done)&&(c.push(n.value),c.length!==t);s=!0);}catch(e){u=!0,o=e}finally{try{if(!s&&null!=r.return&&(i=r.return(),Object(i)!==i))return}finally{if(u)throw o}}return c}}(e,t)||function(e,t){if(e){if("string"==typeof e)return a(e,t);var r={}.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?a(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function a(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function i(){"use strict";/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */i=function(){return t};var e,t={},r=Object.prototype,o=r.hasOwnProperty,a=Object.defineProperty||function(e,t,r){e[t]=r.value},c="function"==typeof Symbol?Symbol:{},s=c.iterator||"@@iterator",u=c.asyncIterator||"@@asyncIterator",l=c.toStringTag||"@@toStringTag";function f(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{f({},"")}catch(e){f=function(e,t,r){return e[t]=r}}function p(e,t,r,n){var o=t&&t.prototype instanceof b?t:b,i=Object.create(o.prototype),c=new N(n||[]);return a(i,"_invoke",{value:G(e,r,c)}),i}function h(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}t.wrap=p;var m="suspendedStart",d="suspendedYield",y="executing",v="completed",g={};function b(){}function w(){}function x(){}var k={};f(k,s,(function(){return this}));var S=Object.getPrototypeOf,E=S&&S(S(T([])));E&&E!==r&&o.call(E,s)&&(k=E);var _=x.prototype=b.prototype=Object.create(k);function P(e){["next","throw","return"].forEach((function(t){f(e,t,(function(e){return this._invoke(t,e)}))}))}function j(e,t){function r(a,i,c,s){var u=h(e[a],e,i);if("throw"!==u.type){var l=u.arg,f=l.value;return f&&"object"==n(f)&&o.call(f,"__await")?t.resolve(f.__await).then((function(e){r("next",e,c,s)}),(function(e){r("throw",e,c,s)})):t.resolve(f).then((function(e){l.value=e,c(l)}),(function(e){return r("throw",e,c,s)}))}s(u.arg)}var i;a(this,"_invoke",{value:function(e,n){function o(){return new t((function(t,o){r(e,n,t,o)}))}return i=i?i.then(o,o):o()}})}function G(t,r,n){var o=m;return function(a,i){if(o===y)throw Error("Generator is already running");if(o===v){if("throw"===a)throw i;return{value:e,done:!0}}for(n.method=a,n.arg=i;;){var c=n.delegate;if(c){var s=I(c,n);if(s){if(s===g)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===m)throw o=v,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=y;var u=h(t,r,n);if("normal"===u.type){if(o=n.done?v:d,u.arg===g)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(o=v,n.method="throw",n.arg=u.arg)}}}function I(t,r){var n=r.method,o=t.iterator[n];if(o===e)return r.delegate=null,"throw"===n&&t.iterator.return&&(r.method="return",r.arg=e,I(t,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),g;var a=h(o,t.iterator,r.arg);if("throw"===a.type)return r.method="throw",r.arg=a.arg,r.delegate=null,g;var i=a.arg;return i?i.done?(r[t.resultName]=i.value,r.next=t.nextLoc,"return"!==r.method&&(r.method="next",r.arg=e),r.delegate=null,g):i:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,g)}function L(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function O(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function N(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(L,this),this.reset(!0)}function T(t){if(t||""===t){var r=t[s];if(r)return r.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var a=-1,i=function r(){for(;++a<t.length;)if(o.call(t,a))return r.value=t[a],r.done=!1,r;return r.value=e,r.done=!0,r};return i.next=i}}throw new TypeError(n(t)+" is not iterable")}return w.prototype=x,a(_,"constructor",{value:x,configurable:!0}),a(x,"constructor",{value:w,configurable:!0}),w.displayName=f(x,l,"GeneratorFunction"),t.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===w||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,x):(e.__proto__=x,f(e,l,"GeneratorFunction")),e.prototype=Object.create(_),e},t.awrap=function(e){return{__await:e}},P(j.prototype),f(j.prototype,u,(function(){return this})),t.AsyncIterator=j,t.async=function(e,r,n,o,a){void 0===a&&(a=Promise);var i=new j(p(e,r,n,o),a);return t.isGeneratorFunction(r)?i:i.next().then((function(e){return e.done?e.value:i.next()}))},P(_),f(_,l,"Generator"),f(_,s,(function(){return this})),f(_,"toString",(function(){return"[object Generator]"})),t.keys=function(e){var t=Object(e),r=[];for(var n in t)r.push(n);return r.reverse(),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},t.values=T,N.prototype={constructor:N,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(O),!t)for(var r in this)"t"===r.charAt(0)&&o.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=e)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var r=this;function n(n,o){return c.type="throw",c.arg=t,r.next=n,o&&(r.method="next",r.arg=e),!!o}for(var a=this.tryEntries.length-1;a>=0;--a){var i=this.tryEntries[a],c=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var s=o.call(i,"catchLoc"),u=o.call(i,"finallyLoc");if(s&&u){if(this.prev<i.catchLoc)return n(i.catchLoc,!0);if(this.prev<i.finallyLoc)return n(i.finallyLoc)}else if(s){if(this.prev<i.catchLoc)return n(i.catchLoc,!0)}else{if(!u)throw Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return n(i.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var n=this.tryEntries[r];if(n.tryLoc<=this.prev&&o.call(n,"finallyLoc")&&this.prev<n.finallyLoc){var a=n;break}}a&&("break"===e||"continue"===e)&&a.tryLoc<=t&&t<=a.finallyLoc&&(a=null);var i=a?a.completion:{};return i.type=e,i.arg=t,a?(this.method="next",this.next=a.finallyLoc,g):this.complete(i)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),g},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),O(r),g}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var o=n.arg;O(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={iterator:T(t),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=e),g}},t}function c(e,t,r,n,o,a,i){try{var c=e[a](i),s=c.value}catch(e){return void r(e)}c.done?t(s):Promise.resolve(s).then(n,o)}function s(e){return function(){var t=this,r=arguments;return new Promise((function(n,o){var a=e.apply(t,r);function i(e){c(a,n,o,i,s,"next",e)}function s(e){c(a,n,o,i,s,"throw",e)}i(void 0)}))}}function u(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,l(n.key),n)}}function l(e){var t=function(e,t){if("object"!=n(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var o=r.call(e,t||"default");if("object"!=n(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==n(t)?t:t+""}var f=r(928),p=r(896),h=r(626),m=r(471),d=r(664),y=r(322),v=r(759),g=r(225),b=(r(427).downloadFile,function(){return e=function e(){var t,r,n;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),t=this,r="downloadSplitedFiles",n=function(){var e=s(i().mark((function e(t){var r,n,o,a,c,s,u,l;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.appId,n=t.requestToken,o=t.md5,a=t.subVersion,c=t.mainWasmFileUrl,s=t.mainWasmFilePath,u=t.subWasmFileUrl,l=t.subWasmFilePath,e.abrupt("return",Promise.all([d.downloadFile({appId:r,requestToken:n,md5:o,subVersion:a,category:3,filePath:s,url:c}),d.downloadFile({appId:r,requestToken:n,md5:o,subVersion:a,category:4,filePath:l,url:u})]));case 2:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),(r=l(r))in t?Object.defineProperty(t,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[r]=n,this.config=null,this.codeMd5=null,this.uploadedWasmCodeBlobId=null,this.uploadedSymbolBlobId=null,this.importLength=null,this.tableSize=null},t=[{key:"validateProject",value:function(e,t,r,n){d.setEnv(r);try{return this.config=h.loadProjectConfig(t),this.config.isPre=r,n&&(this.config.isRelease=!0),m.validateProjectStructure(e,this.config,t)}catch(e){return{code:-1,msg:null,errMsg:"配置加载失败: ".concat(e.message)}}}},{key:"uploadSplitBaseFiles",value:(L=s(i().mark((function e(t){var r,n,o,a;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.appId,n=t.requestToken,o=t.wasmFilePath,a=t.symbolFilePath,e.abrupt("return",Promise.all([d.uploadFile({appId:r,requestToken:n,filePath:o,category:0}),d.uploadFile({appId:r,requestToken:n,filePath:a,category:1})]));case 2:case"end":return e.stop()}}),e)}))),function(e){return L.apply(this,arguments)})},{key:"addGameVersion",value:(I=s(i().mark((function e(){var t;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t={appId:this.config.appId,md5:this.codeMd5,versionDesc:"test",unityVersion:"1.0.0",unityPluginVersion:"1.0.0",wasmSplitPluginVersion:"1.0.0",wasmFileId:this.uploadedWasmCodeBlobId,symbolFileId:this.uploadedSymbolBlobId,requestToken:this.config.requestToken},e.next=3,d.addGameVersion(t);case 3:if(0===e.sent.code){e.next=6;break}throw new Error("游戏版本已经存在");case 6:case"end":return e.stop()}}),e,this)}))),function(){return I.apply(this,arguments)})},{key:"initialize",value:(G=s(i().mark((function e(t){var r,n,o,a,c,s=this;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.isUpdate,n={appId:this.config.appId,md5:this.codeMd5,requestToken:this.config.requestToken,incrementUpdate:!!r},e.next=4,d.initialize(n);case 4:return o=e.sent,a=o.result,c={appId:this.config.appId,md5:this.codeMd5,requestToken:this.config.requestToken,uuid:a},e.abrupt("return",this.pollForResult((function(){return d.getInitResult(c)}),(function(e){if(e.result){var t=e.result,r=t.importSize,n=t.tableSize;return s.importLength=r,s.tableSize=n,v.log("importLength: ",s.importLength),v.log("tableSize: ",s.tableSize),!0}return!1})));case 8:case"end":return e.stop()}}),e,this)}))),function(e){return G.apply(this,arguments)})},{key:"pollForResult",value:(j=s(i().mark((function e(t,r){var n,o=arguments;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=o.length>2&&void 0!==o[2]?o[2]:5e3,e.abrupt("return",new Promise((function(e,o){var a=function(){var c=s(i().mark((function c(){var s;return i().wrap((function(i){for(;;)switch(i.prev=i.next){case 0:return i.prev=0,i.next=3,t();case 3:s=i.sent,r(s)?e(s):setTimeout(a,n),i.next=10;break;case 7:i.prev=7,i.t0=i.catch(0),o(i.t0);case 10:case"end":return i.stop()}}),c,null,[[0,7]])})));return function(){return c.apply(this,arguments)}}();a()})));case 2:case"end":return e.stop()}}),e)}))),function(e,t){return j.apply(this,arguments)})},{key:"init",value:(P=s(i().mark((function e(t){var r,n,o,a;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if((r=this.validateProject("init",t.srcPath,t.isPreEnv)).valid){e.next=3;break}return e.abrupt("return",r);case 3:return e.prev=3,n=f.resolve(this.config.entry,"./.codesplitcache"),o=f.resolve(n,"./original"),this.setupCacheDirectories(n,o),a=v.startLogProcess("文件备份开始"),y.syncPluginCacheFiles(this.config.entry,o),a.stop("文件备份完成"),e.next=12,this.processSymbolFiles(n,o,t.isUpdate);case 12:return a=v.startLogProcess("开始上传文件"),e.next=15,this.uploadFiles(o,n);case 15:return a.stop("上传文件成功"),a=v.startLogProcess("添加游戏版本"),e.next=19,this.addGameVersion();case 19:return a.stop("添加游戏版本成功"),a=v.startLogProcess("初始化启动"),e.next=23,this.initialize({isUpdate:t.isUpdate});case 23:return a.stop("初始化完成"),this.saveSplitConfig(n),e.abrupt("return",{code:0,msg:"WASM分包初始化完成",errMsg:null});case 28:return e.prev=28,e.t0=e.catch(3),v.endLogProcess(null,e.t0.message),e.abrupt("return",{code:-1,msg:"初始化失败",errMsg:e.t0.message});case 32:case"end":return e.stop()}}),e,this,[[3,28]])}))),function(e){return P.apply(this,arguments)})},{key:"setupCacheDirectories",value:function(e,t){var r=f.resolve(t,"./wasmcode/"),n=f.resolve(t,this.config.entry,"./wasmcode1/");[t,r].forEach((function(e){p.existsSync(e)||p.mkdirSync(e,{recursive:!0})})),p.existsSync(n)&&p.rmSync(n,{recursive:!0})}},{key:"processSymbolFiles",value:(_=s(i().mark((function e(t,r,n){var o,a,c,s,u;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return o=f.resolve(t,"./unpack"),a=f.resolve(this.config.entry,"./webgl.wasm.symbols.unityweb"),c=f.resolve(o,"./symbol.json"),n||p.existsSync(o)||p.mkdirSync(o,{recursive:!0}),e.next=6,g(a,c);case 6:return s=f.resolve(r,"./wasmcode/"),u=p.readdirSync(s).find((function(e){return".br"===f.extname(e)})),this.codeMd5=u.split(".")[0],e.abrupt("return",{unpackSymbolsPath:c,mainWasmCachePath:u,mainWasmCacheDir:s});case 10:case"end":return e.stop()}}),e,this)}))),function(e,t,r){return _.apply(this,arguments)})},{key:"uploadFiles",value:(E=s(i().mark((function e(t,r){var n,a,c,s,u,l,p;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.processSymbolFiles(r,t,!1);case 2:return n=e.sent,a=n.unpackSymbolsPath,c=n.mainWasmCachePath,n.mainWasmCacheDir,e.next=8,this.uploadSplitBaseFiles({appId:this.config.appId,requestToken:this.config.requestToken,wasmFilePath:f.join(t,"wasmcode",c),symbolFilePath:a});case 8:if(s=e.sent,u=o(s,2),l=u[0],p=u[1],l&&p){e.next=14;break}throw new Error("上传文件失败");case 14:this.uploadedWasmCodeBlobId=l,this.uploadedSymbolBlobId=p;case 16:case"end":return e.stop()}}),e,this)}))),function(e,t){return E.apply(this,arguments)})},{key:"saveSplitConfig",value:function(e){var t=f.resolve(e,"./codesplit-config.json"),r={appId:this.config.appId,codeMd5:this.codeMd5,tableSize:this.tableSize,uploadedWasmCodeBlobId:this.uploadedWasmCodeBlobId,uploadedSymbolBlobId:this.uploadedSymbolBlobId,importLength:this.importLength};p.writeFileSync(t,JSON.stringify(r,null,2))}},{key:"getSplitInfo",value:(S=s(i().mark((function e(t){var r,n,o;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if((r=this.validateProject("getSplitInfo",t.srcPath,t.isPreEnv)).valid){e.next=3;break}return e.abrupt("return",r);case 3:return e.prev=3,e.next=6,this.readSplitConfig();case 6:if(n=e.sent,(o={appId:this.config.appId,md5:n.codeMd5,requestToken:this.config.requestToken,subVersion:n.subVersion}).subVersion){e.next=10;break}throw new Error("暂无分包信息");case 10:return e.next=12,this.querySplitInfo(o);case 12:return e.abrupt("return",e.sent);case 15:return e.prev=15,e.t0=e.catch(3),v.endLogProcess(null,e.t0.message),e.abrupt("return",{code:-1,msg:"获取分包信息失败",errMsg:e.t0.message});case 19:case"end":return e.stop()}}),e,this,[[3,15]])}))),function(e){return S.apply(this,arguments)})},{key:"readSplitConfig",value:(k=s(i().mark((function e(){var t,r,n;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=f.resolve(this.config.entry,"./.codesplitcache"),r=f.resolve(t,"./codesplit-config.json"),e.prev=2,e.next=5,p.promises.readFile(r,"utf-8");case 5:return n=e.sent,e.abrupt("return",JSON.parse(n));case 9:throw e.prev=9,e.t0=e.catch(2),new Error("读取分包配置文件失败: ".concat(e.t0.message));case 12:case"end":return e.stop()}}),e,this,[[2,9]])}))),function(){return k.apply(this,arguments)})},{key:"querySplitInfo",value:(x=s(i().mark((function e(t){var r,n,o,a,c,s,u;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.appId,n=t.requestToken,o=t.md5,a=t.subVersion,e.prev=1,c={appId:r,md5:o,requestToken:n,subVersion:a},e.next=5,d.getSymbolSize(c);case 5:if(s=e.sent,null!=(u=s.result).mainSymbolSize&&null!=u.patchSymbolSize){e.next=9;break}throw new Error("未查询到分包函数信息");case 9:return e.abrupt("return",{code:0,msg:"查询分包信息成功 \n主包函数数量:".concat(u.mainSymbolSize," \n子包函数数量:").concat(u.patchSymbolSize),errMsg:"查询分包信息成功"});case 12:throw e.prev=12,e.t0=e.catch(1),e.t0;case 15:case"end":return e.stop()}}),e,null,[[1,12]])}))),function(e){return x.apply(this,arguments)})},{key:"getGameSplitRes",value:(w=s(i().mark((function e(t){var r=this;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,n){var o=function(){var a=s(i().mark((function a(c){var s,u,l;return i().wrap((function(a){for(;;)switch(a.prev=a.next){case 0:return s=null,a.prev=1,u={appId:r.config.appId,md5:r.codeMd5,subVersion:t.subVersion,requestToken:r.config.requestToken},a.next=5,d.getGameSplitInfo(u);case 5:null!==(l=a.sent).result?(s&&clearTimeout(s),e(l.result)):(s&&clearTimeout(s),s=setTimeout((function(){return o()}),5e3)),a.next=13;break;case 9:a.prev=9,a.t0=a.catch(1),s&&clearTimeout(s),n(a.t0);case 13:case"end":return a.stop()}}),a,null,[[1,9]])})));return function(e){return a.apply(this,arguments)}}();o()})));case 1:case"end":return e.stop()}}),e)}))),function(e){return w.apply(this,arguments)})},{key:"splitBase",value:(b=s(i().mark((function e(t){var r,n,o,a,c,s,u,l;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if((r=this.validateProject("split",t.srcPath,t.isPreEnv,t.isRelease)).valid){e.next=3;break}return e.abrupt("return",r);case 3:return e.prev=3,(n=this.initializeSplitConfig()).cacheDir,o=n.codeSplitConfigPath,a=n.splitConfig,this.codeMd5=a.codeMd5,c=v.startLogProcess("发送分包请求"),e.next=9,this.buildSubPackage(t,a,o);case 9:if(s=e.sent,c.stop("当前分包版本:"+s),s){e.next=13;break}return e.abrupt("return",{code:-1,msg:"分包构建失败",errMsg:"服务正忙"});case 13:return c=v.startLogProcess("获取分包结果,请稍等"),e.next=16,this.getGameSplitRes({subVersion:s});case 16:return u=e.sent,c.stop("获取分包结果完成"),c=v.startLogProcess("下载分包代码中"),e.next=21,this.processSplitFiles(u,a);case 21:return c.stop("下载分包代码完成"),e.next=24,this.querySplitInfo({appId:this.config.appId,md5:a.codeMd5,requestToken:this.config.requestToken,subVersion:a.subVersion});case 24:return l=e.sent,e.abrupt("return",{code:0,msg:l.errMsg||"WASM分包成功",errMsg:"WASM分包成功"});case 28:return e.prev=28,e.t0=e.catch(3),v.endLogProcess(null,e.t0.message),e.abrupt("return",{code:-1,msg:"分包构建失败",errMsg:e.t0.message});case 32:case"end":return e.stop()}}),e,this,[[3,28]])}))),function(e){return b.apply(this,arguments)})},{key:"initializeSplitConfig",value:function(){var e=f.resolve(this.config.entry,"./.codesplitcache"),t=f.resolve(e,"./codesplit-config.json");return{cacheDir:e,codeSplitConfigPath:t,splitConfig:JSON.parse(p.readFileSync(t,"utf-8"))}}},{key:"buildSubPackage",value:(c=s(i().mark((function e(t,r,n){var o,a,c;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return o={appId:this.config.appId,md5:this.codeMd5,requestToken:this.config.requestToken,isRelease:!!t.isRelease},e.next=3,d.split(o);case 3:if(0===(a=e.sent).code){e.next=15;break}if(!this.isRetryableError(a.errorMessage)){e.next=12;break}if(c=r.subVersion,v.logInfo("尝试查找历史版本,subVersion:",c),c){e.next=10;break}return e.abrupt("return",!1);case 10:e.next=13;break;case 12:throw new Error(a.errorMessage);case 13:e.next=18;break;case 15:c=a.result,r.subVersion=c,p.writeFileSync(n,JSON.stringify(r,null,2));case 18:return e.abrupt("return",c);case 19:case"end":return e.stop()}}),e,this)}))),function(e,t,r){return c.apply(this,arguments)})},{key:"isRetryableError",value:function(e){return["当前md5有正在执行的构建任务,请稍后重试","资源超负荷运行啦,请稍后再试"].includes(e)}},{key:"processSplitFiles",value:(a=s(i().mark((function e(t,r){var n,o,a,c,s;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=t.mainWasmFilePath,o=t.subWasmFilePath,a=this.config.fullEntryPath,c=this.config.mainWasmCachePath,s=this.createWasmPaths(a,c),e.next=6,this.downloadWasmFiles(n,o,s);case 6:y.processJavaScriptFiles(r,a,this.config),y.updateConfigFiles(r,a,this.config);case 8:case"end":return e.stop()}}),e,this)}))),function(e,t){return a.apply(this,arguments)})},{key:"createWasmPaths",value:function(e,t){var r=f.resolve(e,"./wasmcode/",t),n=f.resolve(e,"./wasmcode1/",t);return p.existsSync(n)||p.mkdirSync(n,{recursive:!0}),{mainWasmPath:r,subWasmPath:n}}},{key:"downloadWasmFiles",value:(n=s(i().mark((function e(t,r,n){return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.downloadSplitedFiles({mainWasmFileUrl:t,mainWasmFilePath:n.mainWasmPath,subWasmFileUrl:r,subWasmFilePath:n.subWasmPath});case 2:case"end":return e.stop()}}),e,this)}))),function(e,t,r){return n.apply(this,arguments)})}],t&&u(e.prototype,t),r&&u(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t,r,n,a,c,b,w,x,k,S,E,_,P,j,G,I,L}());e.exports=new b},220:e=>{function t(e){var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}t.keys=()=>[],t.resolve=t,t.id=220,e.exports=t},589:e=>{function t(e){var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}t.keys=()=>[],t.resolve=t,t.id=589,e.exports=t},172:e=>{"use strict";e.exports=require("archiver")},938:e=>{"use strict";e.exports=require("axios")},895:e=>{"use strict";e.exports=require("chalk")},858:e=>{"use strict";e.exports=require("commander")},305:e=>{"use strict";e.exports=require("form-data")},652:e=>{"use strict";e.exports=require("fs-extra")},410:e=>{"use strict";e.exports=require("glob")},937:e=>{"use strict";e.exports=require("inquirer")},420:e=>{"use strict";e.exports=require("jimp")},268:e=>{"use strict";e.exports=require("jsqr")},720:e=>{"use strict";e.exports=require("ora")},205:e=>{"use strict";e.exports=require("picocolors")},241:e=>{"use strict";e.exports=require("qrcode-terminal")},896:e=>{"use strict";e.exports=require("fs")},857:e=>{"use strict";e.exports=require("os")},928:e=>{"use strict";e.exports=require("path")},23:e=>{"use strict";e.exports=require("util")},330:e=>{"use strict";e.exports=JSON.parse('{"name":"jd-minigame-ci","version":"0.6.3","description":"The jd-minigame-ci is a toolkit provided for developers of JD Mini Games. Developers can complete code upload and preview operations for JD Mini Games without the need to open the developer tools, simply by using this toolkit.","author":"chenlong328","license":"ISC","main":"dist/index.js","bin":{"jgc":"./dist/jgc.js"},"scripts":{"config":"NODE_ENV=development node ./dist/jgc.js config","preview":"NODE_ENV=development node ./dist/jgc.js preview","dev:config":"NODE_ENV=development node ./src/jgc.js config","dev:preview":"NODE_ENV=development node ./src/jgc.js preview","dev:upload":"NODE_ENV=development node ./src/jgc.js upload","dev:publish":"NODE_ENV=development node ./src/jgc.js publish","build":"webpack --mode production --progress --config webpack.config.js && chmod 777 ./dist/index.js && chmod 777 ./dist/jgc.js"},"dependencies":{"@babel/cli":"^7.23.9","@babel/core":"^7.23.9","@babel/preset-env":"^7.23.9","archiver":"^6.0.1","axios":"^1.7.3","commander":"^11.1.0","fs-extra":"^11.2.0","glob":"^10.3.10","inquirer":"8.2.6","jimp":"^0.22.12","jsqr":"1.4.0","minimist":"^1.2.8","ora":"5.4.1","qrcode":"^1.5.3","qrcode-terminal":"^0.12.0","string-width":"4.2.3","strip-ansi":"6.0.1"},"devDependencies":{"babel-loader":"^9.1.3","babel-minify-webpack-plugin":"^0.3.1","clean-webpack-plugin":"^4.0.0","terser-webpack-plugin":"^5.3.10","webpack":"^5.90.3","webpack-cli":"^5.1.4","webpack-node-externals":"^3.0.0"},"files":["dist","package.json","README.md"]}')}},t={};function r(n){var o=t[n];if(void 0!==o)return o.exports;var a=t[n]={exports:{}};return e[n](a,a.exports,r),a.exports}r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function o(){"use strict";/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */o=function(){return t};var e,t={},r=Object.prototype,a=r.hasOwnProperty,i=Object.defineProperty||function(e,t,r){e[t]=r.value},c="function"==typeof Symbol?Symbol:{},s=c.iterator||"@@iterator",u=c.asyncIterator||"@@asyncIterator",l=c.toStringTag||"@@toStringTag";function f(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{f({},"")}catch(e){f=function(e,t,r){return e[t]=r}}function p(e,t,r,n){var o=t&&t.prototype instanceof b?t:b,a=Object.create(o.prototype),c=new N(n||[]);return i(a,"_invoke",{value:G(e,r,c)}),a}function h(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}t.wrap=p;var m="suspendedStart",d="suspendedYield",y="executing",v="completed",g={};function b(){}function w(){}function x(){}var k={};f(k,s,(function(){return this}));var S=Object.getPrototypeOf,E=S&&S(S(T([])));E&&E!==r&&a.call(E,s)&&(k=E);var _=x.prototype=b.prototype=Object.create(k);function P(e){["next","throw","return"].forEach((function(t){f(e,t,(function(e){return this._invoke(t,e)}))}))}function j(e,t){function r(o,i,c,s){var u=h(e[o],e,i);if("throw"!==u.type){var l=u.arg,f=l.value;return f&&"object"==n(f)&&a.call(f,"__await")?t.resolve(f.__await).then((function(e){r("next",e,c,s)}),(function(e){r("throw",e,c,s)})):t.resolve(f).then((function(e){l.value=e,c(l)}),(function(e){return r("throw",e,c,s)}))}s(u.arg)}var o;i(this,"_invoke",{value:function(e,n){function a(){return new t((function(t,o){r(e,n,t,o)}))}return o=o?o.then(a,a):a()}})}function G(t,r,n){var o=m;return function(a,i){if(o===y)throw Error("Generator is already running");if(o===v){if("throw"===a)throw i;return{value:e,done:!0}}for(n.method=a,n.arg=i;;){var c=n.delegate;if(c){var s=I(c,n);if(s){if(s===g)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===m)throw o=v,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=y;var u=h(t,r,n);if("normal"===u.type){if(o=n.done?v:d,u.arg===g)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(o=v,n.method="throw",n.arg=u.arg)}}}function I(t,r){var n=r.method,o=t.iterator[n];if(o===e)return r.delegate=null,"throw"===n&&t.iterator.return&&(r.method="return",r.arg=e,I(t,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),g;var a=h(o,t.iterator,r.arg);if("throw"===a.type)return r.method="throw",r.arg=a.arg,r.delegate=null,g;var i=a.arg;return i?i.done?(r[t.resultName]=i.value,r.next=t.nextLoc,"return"!==r.method&&(r.method="next",r.arg=e),r.delegate=null,g):i:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,g)}function L(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function O(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function N(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(L,this),this.reset(!0)}function T(t){if(t||""===t){var r=t[s];if(r)return r.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,i=function r(){for(;++o<t.length;)if(a.call(t,o))return r.value=t[o],r.done=!1,r;return r.value=e,r.done=!0,r};return i.next=i}}throw new TypeError(n(t)+" is not iterable")}return w.prototype=x,i(_,"constructor",{value:x,configurable:!0}),i(x,"constructor",{value:w,configurable:!0}),w.displayName=f(x,l,"GeneratorFunction"),t.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===w||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,x):(e.__proto__=x,f(e,l,"GeneratorFunction")),e.prototype=Object.create(_),e},t.awrap=function(e){return{__await:e}},P(j.prototype),f(j.prototype,u,(function(){return this})),t.AsyncIterator=j,t.async=function(e,r,n,o,a){void 0===a&&(a=Promise);var i=new j(p(e,r,n,o),a);return t.isGeneratorFunction(r)?i:i.next().then((function(e){return e.done?e.value:i.next()}))},P(_),f(_,l,"Generator"),f(_,s,(function(){return this})),f(_,"toString",(function(){return"[object Generator]"})),t.keys=function(e){var t=Object(e),r=[];for(var n in t)r.push(n);return r.reverse(),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},t.values=T,N.prototype={constructor:N,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(O),!t)for(var r in this)"t"===r.charAt(0)&&a.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=e)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var r=this;function n(n,o){return c.type="throw",c.arg=t,r.next=n,o&&(r.method="next",r.arg=e),!!o}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],c=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var s=a.call(i,"catchLoc"),u=a.call(i,"finallyLoc");if(s&&u){if(this.prev<i.catchLoc)return n(i.catchLoc,!0);if(this.prev<i.finallyLoc)return n(i.finallyLoc)}else if(s){if(this.prev<i.catchLoc)return n(i.catchLoc,!0)}else{if(!u)throw Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return n(i.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var n=this.tryEntries[r];if(n.tryLoc<=this.prev&&a.call(n,"finallyLoc")&&this.prev<n.finallyLoc){var o=n;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var i=o?o.completion:{};return i.type=e,i.arg=t,o?(this.method="next",this.next=o.finallyLoc,g):this.complete(i)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),g},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),O(r),g}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var o=n.arg;O(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={iterator:T(t),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=e),g}},t}function a(e,t,r,n,o,a,i){try{var c=e[a](i),s=c.value}catch(e){return void r(e)}c.done?t(s):Promise.resolve(s).then(n,o)}function i(e){return function(){var t=this,r=arguments;return new Promise((function(n,o){var i=e.apply(t,r);function c(e){a(i,n,o,c,s,"next",e)}function s(e){a(i,n,o,c,s,"throw",e)}c(void 0)}))}}var c=r(928),s=r(857),u=r(720),l=r(205),f=new(0,r(858).Command),p=r(937),h=r(938),m=r(522),d=r(593),y=r(538),v=r(60),g=r(425),b=r(890),w=r(85).SUCCEED_CODE,x=r(330),k=r(175);function S(e){return E.apply(this,arguments)}function E(){return E=i(o().mark((function e(t){var n,a,i,f,p,h,m,d,x,k,S,E,_,P,j,G,I,L,O,N,T,F,M,A,C,D,W,q,U,R,B,H,V=arguments;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=!(V.length>1&&void 0!==V[1])||V[1],a=Date.now(),i=1===t?"preview":"upload",f=c.posix.resolve("","./jgc.config.js"),y.hasJgcConfigFile(f)){e.next=7;break}return e.abrupt("return",console.log("".concat(l.red("请先创建配置文件!"))));case 7:if(p="function"==typeof require?require:r(589),h=p(f),(m=v.checkConfigOptions(h,t)).code===w){e.next=12;break}return e.abrupt("return",console.log(m.err_msg));case 12:if(d=h.appId,x=h.requestToken,k=h.versionName,S=h.entry,E=h.description,(_=y.verifyGameRequiredFilesExist(S)).code===w){e.next=16;break}return e.abrupt("return",console.log(_.err_msg));case 16:return P=s.tmpdir()+c.sep+"jd_game_temp.zip",y.deleteFile(P),j=u("文件压缩").start(),e.prev=19,e.next=22,y.compressDirectory(S,P);case 22:G=e.sent,j.succeed("压缩完成,共"+G/1e3+"KB"),e.next=30;break;case 26:e.prev=26,e.t0=e.catch(19),j.fail("压缩失败:",e.t0),process.exit(1);case 30:return j.start(),j.text="上传中",I=new g(n?"prod":"dev"),e.prev=34,e.next=37,I.uploadProject({sourceFile:P,appId:d,requestToken:x,isProd:n});case 37:if((L=e.sent).code!==w&&(j.fail(L.err_msg),process.exit(1)),O=L.packId,j.succeed("上传完成,packId:".concat(O)),"preview"!==i){e.next=57;break}return e.next=44,I.generateQrCode({packId:O,appId:d,requestToken:x});case 44:return(N=e.sent).code!==w&&(j.fail(N.err_msg),process.exit(1)),T=N.imgUrl,F=N.expiredTime,e.next=49,b.showQrCode(T);case 49:j.succeed("二维码生成完成,将于".concat(F,"过期")),j.info("二维码imgUrl(如二维码不清晰,浏览器打开): ".concat(T)),j.info("二维码仅支持协作成员访问"),M=Date.now(),A=(M-a)/1e3,j.info("本次耗费时长:".concat(A,"s")),e.next=82;break;case 57:if("upload"!==i){e.next=82;break}return j.start(),e.next=61,I.commitDevVersion({appId:d,requestToken:x,versionName:k,description:E},O);case 61:return(C=e.sent).code!==w&&(j.fail(C.err_msg),process.exit(1)),D=C.devId,j.succeed("开发版设置完成, devId:"+D),e.next=67,I.setDevExperience({appId:d,requestToken:x},D);case 67:return(W=e.sent).code!==w&&(j.fail(W.err_msg),process.exit(1)),j.succeed("体验版设置完成"),e.next=72,I.queryExperienceQrcodeByPackId({appId:d,requestToken:x});case 72:return(q=e.sent).code!==w&&(j.fail(q.err_msg),process.exit(1)),U=q.imgUrl,R=q.expiredTime,e.next=77,b.showQrCode(U);case 77:j.info("二维码仅支持协作成员访问"),j.succeed("二维码生成完成,将于".concat(R,"过期")),B=Date.now(),H=(B-a)/1e3,j.info("本次耗费时长:".concat(H,"s"));case 82:e.next=88;break;case 84:e.prev=84,e.t1=e.catch(34),j.fail("CLI执行报错 --\x3e".concat(e.t1)),process.exit(1);case 88:case"end":return e.stop()}}),e,null,[[19,26],[34,84]])}))),E.apply(this,arguments)}function _(e){return P.apply(this,arguments)}function P(){return(P=i(o().mark((function e(t){var n,a,i,f,h,m,b,x,k,S,E,_,P,j,G,I,L,O,N;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=(new d).getPrompts(),e.next=3,p.prompt(n);case 3:if(a=e.sent,i=Date.now(),f=c.posix.resolve("","./jgc.config.js"),y.hasJgcConfigFile(f)){e.next=9;break}return e.abrupt("return",console.log("".concat(l.red("请先创建配置文件!"))));case 9:if(h="function"==typeof require?require:r(589),m=h(f),(b=v.checkPluginConfig(m)).code===w){e.next=14;break}return e.abrupt("return",console.log(b.err_msg));case 14:return x=m.appId,k=m.requestToken,S=m.entry,E=m.versionName,_=s.tmpdir()+c.sep+"jd_game_temp.zip",y.deleteFile(_),P=u("文件压缩").start(),e.prev=18,e.next=21,y.compressDirectory(S,_);case 21:(j=e.sent)>4194304&&(P.fail("压缩包超过4MB,请检查文件大小"),process.exit(1)),P.succeed("压缩完成,共"+j/1e3+"KB"),e.next=30;break;case 26:e.prev=26,e.t0=e.catch(18),P.fail("压缩失败:",e.t0),process.exit(1);case 30:return G=new g(t),e.prev=31,e.next=34,G.uploadPlugin({sourceFile:_,appId:x,requestToken:k,versionName:E});case 34:if((I=e.sent).code===w){e.next=40;break}P.fail(I.err_msg),process.exit(1),e.next=49;break;case 40:return P.succeed("插件构建成功"),e.next=43,G.publishPlugin({versionName:a.versionName,versionFeature:a.versionFeature,useGuide:a.useGuide,packId:I.result.packId,appId:x,requestToken:k});case 43:(L=e.sent).code!==w&&(P.fail(L.err_msg),process.exit(1)),P.succeed("插件发布成功"),O=Date.now(),N=(O-i)/1e3,P.info("本次耗费时长:".concat(N,"s"));case 49:e.next=55;break;case 51:e.prev=51,e.t1=e.catch(31),P.fail("CLI执行报错 --\x3e".concat(e.t1)),process.exit(1);case 55:case"end":return e.stop()}}),e,null,[[18,26],[31,51]])})))).apply(this,arguments)}return f.command("config").description("小游戏配置").action(i(o().mark((function e(){var t,r,n;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=(new m).getPrompts(),e.next=3,p.prompt(t);case 3:if(r=e.sent,(n=y.verifyGameRequiredFilesExist(r.entry,r.type)).code===w){e.next=7;break}return e.abrupt("return",console.log("".concat(l.red(n.err_msg))));case 7:return e.prev=7,y.writeFile("./".concat("jgc.config.js"),"module.exports = ".concat(JSON.stringify(r,null,2)),"utf-8"),e.abrupt("return",console.log("✨ ".concat(l.green("创建小游戏配置文件成功"))));case 13:e.prev=13,e.t0=e.catch(7),console.log("创建小游戏配置文件失败:",e.t0);case 16:case"end":return e.stop()}}),e,null,[[7,13]])})))),f.command("preview").description("小游戏真机预览").option("-D","预发环境").action(function(){var e=i(o().mark((function e(t){return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!t.D){e.next=3;break}return console.log("小游戏真机预览-预发环境"),e.abrupt("return",S(1,!1));case 3:return e.abrupt("return",S(1,!0));case 4:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()),f.command("upload").description("小游戏发布").option("-D","预发环境").action(function(){var e=i(o().mark((function e(t){return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!t.D){e.next=3;break}return console.log("小游戏发布-预发环境"),e.abrupt("return",S(2,!1));case 3:return e.abrupt("return",S(2,!0));case 4:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()),f.command("publish").description("插件发布").option("-D","预发环境").option("-T","测试环境").action(function(){var e=i(o().mark((function e(t){return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!t.D){e.next=5;break}return console.log("插件发布-预发环境"),e.abrupt("return",_("dev"));case 5:if(!t.T){e.next=10;break}return console.log("插件发布-测试环境"),e.abrupt("return",_("test"));case 10:return console.log("插件发布-生产环境"),e.abrupt("return",_("prod"));case 12:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()),f.version(x.version,"-v, -V").description("获取本地京东小游戏CLI工具版本"),f.command("latest").description("获取并对比京东小游戏CLI工具最新版本").action(i(o().mark((function e(){var t,r,n,a;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,t=u("npm最新版本获取中……").start(),e.next=4,h.get("https://registry.npmjs.org/jd-minigame-ci/latest");case 4:r=e.sent,n=r.data.version,a=x.version,t.succeed("最新版本: ".concat(n)),n===a?t.info("当前版本 (".concat(a,") 已是最新版本。")):(t.info("本地版本: ".concat(a)),t.info("请更新到最新版本以获取最新功能和修复。")),e.next=14;break;case 11:e.prev=11,e.t0=e.catch(0),spinner.fail("获取最新版本信息失败: ".concat(e.t0));case 14:case"end":return e.stop()}}),e,null,[[0,11]])})))),f.command("wasm-init").description("WASM分包初始化").option("-D","预发环境").action(function(){var e=i(o().mark((function e(t){return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:k.wasmInit(Object.assign(t,{srcPath:"",isPreEnv:t.D})).then((function(e){var t=e.code,r=e.msg;0===t?console.log(r):console.error("WASM分包初始化失败:",e)})).catch((function(e){console.error("WASM分包初始化异常:",e)}));case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()),f.command("wasm-update").description("WASM分包增量更新").option("-D","预发环境").action(function(){var e=i(o().mark((function e(t){return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:k.wasmUpdate(Object.assign(t,{srcPath:"",isPreEnv:t.D})).then((function(e){var t=e.code,r=e.msg;0===t?console.log(r):console.error("WASM分包增量更新失败:",e)})).catch((function(e){console.error("WASM分包增量更新异常:",e)}));case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()),f.command("wasm-split-dev").description("WASM分包dev").option("-D","预发环境").action(function(){var e=i(o().mark((function e(t){return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:k.wasmSplitDev(Object.assign(t,{srcPath:"",isPreEnv:t.D})).then((function(e){var t=e.code,r=e.msg;0===t?console.log(r):console.error("WASM分包失败:",e)})).catch((function(e){console.error("WASM分包异常:",e)}));case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()),f.command("wasm-split-prod").description("WASM分包prod").option("-D","预发环境").action(function(){var e=i(o().mark((function e(t){return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:k.wasmSplitProd(Object.assign(t,{srcPath:"",isPreEnv:t.D})).then((function(e){var t=e.code,r=e.msg;0===t?console.log(r):console.error("WASM分包失败:",e)})).catch((function(e){console.error("WASM分包异常:",e)}));case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()),f.command("wasm-split-info").description("查询函数符号表").option("-D","预发环境").action(function(){var e=i(o().mark((function e(t){return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:k.wasmSplitInfo(Object.assign(t,{srcPath:"",isPreEnv:t.D})).then((function(e){var t=e.code,r=e.msg;0===t?console.log(r):console.error("查询函数符号表失败:",e)})).catch((function(e){console.error("查询函数符号表异常:",e)}));case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()),f.parse(process.argv),{}})()));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "jd-minigame-ci",
3
- "version": "0.6.2",
3
+ "version": "0.6.3",
4
4
  "description": "The jd-minigame-ci is a toolkit provided for developers of JD Mini Games. Developers can complete code upload and preview operations for JD Mini Games without the need to open the developer tools, simply by using this toolkit.",
5
5
  "author": "chenlong328",
6
6
  "license": "ISC",