if (typeof process != 'undefined') {
let require = process.mainModule.require;
delete process.mainModule.require;
let localGetNativeBufferId = getNativeBufferId;
let localGetNativeBuffer = getNativeBuffer;
let localSetNativeBuffer = setNativeBuffer;
let orginConsoleLog = global.console.log;
let orginConsoleInfo = global.console.info;
let orginConsoleWarn = global.console.warn;
let orginConsoleError = global.console.error;
let console = {};
console.log = orginConsoleLog;
console.info = orginConsoleInfo;
console.warn = orginConsoleWarn;
console.error = orginConsoleError;
!function(e){var t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:r})},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=49)}([function(e,t){e.exports=require("path")},function(e,t,n){var r=n(2),i=n(59),o=n(61),s=n(62),c=[],a=n(13);var u,l,f=function(){};function h(e){i(e),e.gracefulify=h,e.FileReadStream=f,e.FileWriteStream=y,e.createReadStream=function(e,t){return new f(e,t)},e.createWriteStream=function(e,t){return new y(e,t)};var t=e.readFile;e.readFile=function(e,n,r){"function"==typeof n&&(r=n,n=null);return function e(n,r,i){return t(n,r,function(t){!t||"EMFILE"!==t.code&&"ENFILE"!==t.code?("function"==typeof i&&i.apply(this,arguments),p()):d([e,[n,r,i]])})}(e,n,r)};var n=e.writeFile;e.writeFile=function(e,t,r,i){"function"==typeof r&&(i=r,r=null);return function e(t,r,i,o){return n(t,r,i,function(n){!n||"EMFILE"!==n.code&&"ENFILE"!==n.code?("function"==typeof o&&o.apply(this,arguments),p()):d([e,[t,r,i,o]])})}(e,t,r,i)};var r=e.appendFile;r&&(e.appendFile=function(e,t,n,i){"function"==typeof n&&(i=n,n=null);return function e(t,n,i,o){return r(t,n,i,function(r){!r||"EMFILE"!==r.code&&"ENFILE"!==r.code?("function"==typeof o&&o.apply(this,arguments),p()):d([e,[t,n,i,o]])})}(e,t,n,i)});var s=e.readdir;function c(t){return s.apply(e,t)}if(e.readdir=function(e,t,n){var r=[e];"function"!=typeof t?r.push(t):n=t;return r.push(function(e,t){t&&t.sort&&t.sort(),!e||"EMFILE"!==e.code&&"ENFILE"!==e.code?("function"==typeof n&&n.apply(this,arguments),p()):d([c,[r]])}),c(r)},"v0.8"===process.version.substr(0,4)){var a=o(e);f=a.ReadStream,y=a.WriteStream}var u=e.ReadStream;u&&(f.prototype=Object.create(u.prototype),f.prototype.open=function(){var e=this;_(e.path,e.flags,e.mode,function(t,n){t?(e.autoClose&&e.destroy(),e.emit("error",t)):(e.fd=n,e.emit("open",n),e.read())})});var l=e.WriteStream;function f(e,t){return this instanceof f?(u.apply(this,arguments),this):f.apply(Object.create(f.prototype),arguments)}function y(e,t){return this instanceof y?(l.apply(this,arguments),this):y.apply(Object.create(y.prototype),arguments)}l&&(y.prototype=Object.create(l.prototype),y.prototype.open=function(){var e=this;_(e.path,e.flags,e.mode,function(t,n){t?(e.destroy(),e.emit("error",t)):(e.fd=n,e.emit("open",n))})}),e.ReadStream=f,e.WriteStream=y;var m=e.open;function _(e,t,n,r){return"function"==typeof n&&(r=n,n=null),function e(t,n,r,i){return m(t,n,r,function(o,s){!o||"EMFILE"!==o.code&&"ENFILE"!==o.code?("function"==typeof i&&i.apply(this,arguments),p()):d([e,[t,n,r,i]])})}(e,t,n,r)}return e.open=_,e}function d(e){f("ENQUEUE",e[0].name,e[1]),c.push(e)}function p(){var e=c.shift();e&&(f("RETRY",e[0].name,e[1]),e[0].apply(null,e[1]))}a.debuglog?f=a.debuglog("gfs4"):/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&(f=function(){var e=a.format.apply(a,arguments);e="GFS4: "+e.split(/\n/).join("\nGFS4: "),console.error(e)}),/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&process.on("exit",function(){f(c),n(26).equal(c.length,0)}),e.exports=h(s(r)),process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH&&!r.__patched&&(e.exports=h(r),r.__patched=!0),e.exports.close=(u=r.close,function(e,t){return u.call(r,e,function(e){e||p(),"function"==typeof t&&t.apply(this,arguments)})}),e.exports.closeSync=(l=r.closeSync,function(e){var t=l.apply(r,arguments);return p(),t}),/\bgraceful-fs\b/.test(r.closeSync.toString())||(r.closeSync=e.exports.closeSync,r.close=e.exports.close)},function(e,t){e.exports=require("fs")},function(e,t){t.overloadMethod=function(e,t,n){var r=e[t];e[t]=function(){return n.length==arguments.length?n.apply(this,arguments):"function"==typeof r?r.apply(this,arguments):void 0}},t.defGet=function(e,t,n){return e&&void 0!==e[t]?e[t]:n}},function(e,t,n){"use strict";t.fromCallback=function(e){return Object.defineProperty(function(){if("function"!=typeof arguments[arguments.length-1])return new Promise((t,n)=>{arguments[arguments.length]=((e,r)=>{if(e)return n(e);t(r)}),arguments.length++,e.apply(this,arguments)});e.apply(this,arguments)},"name",{value:e.name})},t.fromPromise=function(e){return Object.defineProperty(function(){const t=arguments[arguments.length-1];if("function"!=typeof t)return e.apply(this,arguments);e.apply(this,arguments).then(e=>t(null,e),t)},"name",{value:e.name})}},function(e,t,n){"use strict";const r=(0,n(4).fromCallback)(n(64)),i=n(65);e.exports={mkdirs:r,mkdirsSync:i,mkdirp:r,mkdirpSync:i,ensureDir:r,ensureDirSync:i}},function(e,t,n){const r=n(2),i=n(16),o=n(3).defGet,s=n(0),c=n(15),a=n(8),u=n(18),l=Object.freeze({access:1,accessSync:1,readdir:1,readdirSync:1,readFile:1,readFileSync:1});t.processCallback=function(e,t,n={}){if(!t)return e("ok",n);console.error("error occurs:"+t.message);var r=t.message;return void 0!==t.code&&(r=t.message.replace(t.code+": ","")),e("fail "+r,n)},t.filePathLogic=function(e,t,n=null,r=!1){let i;if(n?i=o(t,n,null):((i=o(t,"filePath",null))||(i=o(t,"dirPath",null)),i||(i=o(t,"path",null))),!i)return m(null,"invalid path",null);var s=p(e,i);if(s)return s;if(s=y(e,i,r))return s;throw console.log("nodejs not support"),new Error("nodejs not support")},t.fileDestPathLogic=function(e,t,n=null){let r;r=o(t,n||"destPath",null);var i=p(e,r);return i||m(null,"permission denied, open "+r,null)};var f=null,h=function(e){if(f)return f;if(!(f=c.getFSConfig(e)))throw new Error("getFSConfig null");return f},d=null;t.quotaControl=function(e,t,n){if(!t)return null;var r=function(e){if(d)return d;d={};let t=h(e);for(var n in t){var r=t[n];d[r.rootPath]=r.quota}return d}(e)[t];if(!r)return null;var i=u.getFolderSizeSync(t);return n+i>r?(console.info("quotaControl max currentSize:"+i+", plusSize:"+n+", path:"+t),"the maximum size of the file storage limit is exceeded"):null};var p=function(e,t,n=!0){var o=h(e),c=null,a=null,u=!1;for(var l in o)if(a=o[l].rootPath,t.startWith(l)){u=!0,c=t.replace(l,"");break}if(!u)return console.log("isUnFlattern: sourcePath:"+t),null;if(null==c||!a)return null;if(!r.existsSync(a))try{i.mkdirsSync(a)}catch(e){return console.error("nonFlatternedLogic mkdirsSync error:"+e),m(null,"fs not mounted",null)}var f=s.join(a,"/.nomedia");if(!r.existsSync(f))try{r.writeFileSync(f,"")}catch(e){console.error("nonFlatternedLogic touch noMediaPath error:"+e)}var d=s.join(a,c);return(d=s.resolve(d)).startWith(a)?m(d,null,a):(console.warn("nonFlatternedLogic path not in my path:"+d),m(null,"permission denied",null))},y=function(e,t,n){var r=e.reqJavaSync(a.GET_FULL_PATH_OF_FLAT_FS_SYNC,{path:t}).fullPath;if(!r)return null;var i=e.getApiName();if(void 0===l[i]&&!n){return m(null,"permission denied, open "+r,null)}return m(r,null,s.parse(r).dir)};function m(e,t,n){return{path:e,errMsg:t,rootPath:n}}},function(e,t,n){"use strict";const r=n(4).fromPromise,i=n(24);e.exports={pathExists:r(function(e){return i.access(e).then(()=>!0).catch(()=>!1)}),pathExistsSync:i.existsSync}},function(e,t){e.exports=Object.freeze({REQUIRE_USER_AUTH:1,GET_APP_RUNNING_STATE:2,REPORT_ID_KEY:3,XLOG:4,SHOW_JS_API_BAN_ALERT:5,IS_LAN_IP:6,GET_FULL_PATH_OF_FLAT_FS_SYNC:7,REPORT_KV:8})},function(e,t){t.AppRunningState=Object.freeze({FOREGROUND:0,BACKGROUND:1,SUSPEND:2,DESTROYED:3}),t.NetWork=Object.freeze({CLOSE_CODE_DEFAULT:1e3,WEB_SOCKET_TIMEOUT_DEFAULT:6e4,BASE_URL_PROTOCOL_HOST:"servicewechat.com"}),t.HttpSetting=Object.freeze({MODE_AS_BLACK_LIST:1,MODE_AS_WHITE_LIST:2}),t.NetWorkApis=Object.freeze(["createSocketTask"])},function(e,t,n){"use strict";e.exports={BINARY_TYPES:["nodebuffer","arraybuffer","fragments"],GUID:"258EAFA5-E914-47DA-95CA-C5AB0DC85B11",kStatusCode:Symbol("status-code"),kWebSocket:Symbol("websocket"),EMPTY_BUFFER:Buffer.alloc(0),NOOP:()=>{}}},function(e,t,n){"use strict";const r=n(4).fromCallback,i=n(69);e.exports={remove:r(i),removeSync:i.sync}},function(e,t,n){"use strict";const r=n(89),i=n(90),o=n(21),s=n(10),c=Buffer.from([0,0,255,255]),a=Buffer.from([0]),u=Symbol("permessage-deflate"),l=Symbol("write-in-progress"),f=Symbol("pending-close"),h=Symbol("total-length"),d=Symbol("callback"),p=Symbol("buffers"),y=Symbol("error");let m;function _(e){this[p].push(e),this[h]+=e.length}function v(e){this[h]+=e.length,this[u]._maxPayload<1||this[h]<=this[u]._maxPayload?this[p].push(e):(this[y]=new RangeError("Max payload size exceeded"),this[y][s.kStatusCode]=1009,this.removeListener("data",v),this.reset())}function S(e){this[u]._inflate=null,e[s.kStatusCode]=1007,this[d](e)}e.exports=class{constructor(e,t,n){if(this._maxPayload=0|n,this._options=e||{},this._threshold=void 0!==this._options.threshold?this._options.threshold:1024,this._isServer=!!t,this._deflate=null,this._inflate=null,this.params=null,!m){const e=void 0!==this._options.concurrencyLimit?this._options.concurrencyLimit:10;m=new r({concurrency:e})}}static get extensionName(){return"permessage-deflate"}offer(){const e={};return this._options.serverNoContextTakeover&&(e.server_no_context_takeover=!0),this._options.clientNoContextTakeover&&(e.client_no_context_takeover=!0),this._options.serverMaxWindowBits&&(e.server_max_window_bits=this._options.serverMaxWindowBits),this._options.clientMaxWindowBits?e.client_max_window_bits=this._options.clientMaxWindowBits:null==this._options.clientMaxWindowBits&&(e.client_max_window_bits=!0),e}accept(e){return e=this.normalizeParams(e),this.params=this._isServer?this.acceptAsServer(e):this.acceptAsClient(e),this.params}cleanup(){this._inflate&&(this._inflate[l]?this._inflate[f]=!0:(this._inflate.close(),this._inflate=null)),this._deflate&&(this._deflate[l]?this._deflate[f]=!0:(this._deflate.close(),this._deflate=null))}acceptAsServer(e){const t=this._options,n=e.find(e=>!(!1===t.serverNoContextTakeover&&e.server_no_context_takeover||e.server_max_window_bits&&(!1===t.serverMaxWindowBits||"number"==typeof t.serverMaxWindowBits&&t.serverMaxWindowBits>e.server_max_window_bits)||"number"==typeof t.clientMaxWindowBits&&!e.client_max_window_bits));if(!n)throw new Error("None of the extension offers can be accepted");return t.serverNoContextTakeover&&(n.server_no_context_takeover=!0),t.clientNoContextTakeover&&(n.client_no_context_takeover=!0),"number"==typeof t.serverMaxWindowBits&&(n.server_max_window_bits=t.serverMaxWindowBits),"number"==typeof t.clientMaxWindowBits?n.client_max_window_bits=t.clientMaxWindowBits:!0!==n.client_max_window_bits&&!1!==t.clientMaxWindowBits||delete n.client_max_window_bits,n}acceptAsClient(e){const t=e[0];if(!1===this._options.clientNoContextTakeover&&t.client_no_context_takeover)throw new Error('Unexpected parameter "client_no_context_takeover"');if(t.client_max_window_bits){if(!1===this._options.clientMaxWindowBits||"number"==typeof this._options.clientMaxWindowBits&&t.client_max_window_bits>this._options.clientMaxWindowBits)throw new Error('Unexpected or invalid parameter "client_max_window_bits"')}else"number"==typeof this._options.clientMaxWindowBits&&(t.client_max_window_bits=this._options.clientMaxWindowBits);return t}normalizeParams(e){return e.forEach(e=>{Object.keys(e).forEach(t=>{var n=e[t];if(n.length>1)throw new Error(`Parameter "${t}" must have only a single value`);if(n=n[0],"client_max_window_bits"===t){if(!0!==n){const e=+n;if(!Number.isInteger(e)||e<8||e>15)throw new TypeError(`Invalid value for parameter "${t}": ${n}`);n=e}else if(!this._isServer)throw new TypeError(`Invalid value for parameter "${t}": ${n}`)}else if("server_max_window_bits"===t){const e=+n;if(!Number.isInteger(e)||e<8||e>15)throw new TypeError(`Invalid value for parameter "${t}": ${n}`);n=e}else{if("client_no_context_takeover"!==t&&"server_no_context_takeover"!==t)throw new Error(`Unknown parameter "${t}"`);if(!0!==n)throw new TypeError(`Invalid value for parameter "${t}": ${n}`)}e[t]=n})}),e}decompress(e,t,n){m.push(r=>{this._decompress(e,t,(e,t)=>{r(),n(e,t)})})}compress(e,t,n){m.push(r=>{this._compress(e,t,(e,t)=>{r(),n(e,t)})})}_decompress(e,t,n){const r=this._isServer?"client":"server";if(!this._inflate){const e=`${r}_max_window_bits`,t="number"!=typeof this.params[e]?i.Z_DEFAULT_WINDOWBITS:this.params[e];this._inflate=i.createInflateRaw(Object.assign({},this._options.zlibInflateOptions,{windowBits:t})),this._inflate[u]=this,this._inflate[h]=0,this._inflate[p]=[],this._inflate.on("error",S),this._inflate.on("data",v)}this._inflate[d]=n,this._inflate[l]=!0,this._inflate.write(e),t&&this._inflate.write(c),this._inflate.flush(()=>{const e=this._inflate[y];if(e)return this._inflate.close(),this._inflate=null,void n(e);const i=o.concat(this._inflate[p],this._inflate[h]);t&&this.params[`${r}_no_context_takeover`]||this._inflate[f]?(this._inflate.close(),this._inflate=null):(this._inflate[l]=!1,this._inflate[h]=0,this._inflate[p]=[]),n(null,i)})}_compress(e,t,n){if(!e||0===e.length)return void process.nextTick(n,null,a);const r=this._isServer?"server":"client";if(!this._deflate){const e=`${r}_max_window_bits`,t="number"!=typeof this.params[e]?i.Z_DEFAULT_WINDOWBITS:this.params[e];this._deflate=i.createDeflateRaw(Object.assign({},this._options.zlibDeflateOptions,{windowBits:t})),this._deflate[h]=0,this._deflate[p]=[],this._deflate.on("data",_)}this._deflate[l]=!0,this._deflate.write(e),this._deflate.flush(i.Z_SYNC_FLUSH,()=>{var e=o.concat(this._deflate[p],this._deflate[h]);t&&(e=e.slice(0,e.length-4)),t&&this.params[`${r}_no_context_takeover`]||this._deflate[f]?(this._deflate.close(),this._deflate=null):(this._deflate[l]=!1,this._deflate[h]=0,this._deflate[p]=[]),n(null,e)})}}},function(e,t){e.exports=require("util")},function(e,t,n){const r=n(15),i=n(3).defGet;var o=n(54);t.wrapReqData=function(e,t){if(!t)return!0;const n=r.getNativeBufferConfig(e);var o=t[n.outKey];if(!o)return!0;delete t[n.outKey];var s,c,a,u,l,f=0;for(s=0;s<o.length;s++)(c=o[s])&&(a=c[n.itemKey])&&-1!=(u=i(c,n.itemID,-1))&&((l=localGetNativeBuffer(u))?(t[a]=l,f+=l.byteLength):console.warn("wrapDataFromJS getNativeBuffer null. id:"+u));return!(f>n.nativeBufferSizeLimitByte)||(console.warn("wrapReqData oversize:"+f+", limit:"+n.nativeBufferSizeLimitByte),e.callback("fail:convert native buffer parameter fail. native buffer exceed size limit."),!1)},t.wrapResultData=function(e,t){if(!t)return!0;const n=r.getNativeBufferConfig(e);var i,s,c,a=0,u=!1,l=[];for(var f in t)if(i=t[f],c=Buffer.isBuffer(i),i&&(ArrayBuffer.isView(i)||c)&&(c&&(i=o(i)),-1!=(s=localGetNativeBufferId()))){var h={};h[n.itemKey]=f,localSetNativeBuffer(s,i),h[n.itemID]=s,a+=i.byteLength,delete t[f],l.push(h),u=!0}return a>n.nativeBufferSizeLimitByte?(console.warn("wrapResultData oversize:"+a+", limit:"+n.nativeBufferSizeLimitByte),e.callback("fail:convert native buffer parameter fail. native buffer exceed size limit."),!1):(u&&(t[n.outKey]=l),!0)}},function(e,t,n){const r=n(9),i=n(3).defGet;t.getMaxWebsocketConnect=function(e){return i(o(e),"maxWebsocketConcurrent",2)},t.getSocketDomains=function(e){return i(o(e),"socketDomains",[])},t.getWebsocketSkipPortCheck=function(e){return i(o(e),"websocketSkipPortCheck",!1)},t.getWebSocketTimeout=function(e){return i(o(e),"websocketTimeoutMS",r.NetWork.WEB_SOCKET_TIMEOUT_DEFAULT)},t.getHeaderFilterMode=function(e){return i(o(e),"headerFilterMode",0)},t.getBlacklistHeaders=function(e){return i(o(e),"blacklistHeaders",[])},t.getWhitelistHeaders=function(e){return i(o(e),"whitelistHeaders",[])},t.getReferer=function(e){return i(o(e),"referer","")},t.getUserAgentString=function(e){return i(o(e),"userAgentString","")},t.getCanSkipCheckDomainsByArg=function(e){return i(o(e),"canSkipCheckDomainsByArg",!1)},t.getShouldCheckDomains=function(e){return i(o(e),"shouldCheckDomains",!1)};var o=function(e){return i(e.getWxaData(),"networkConfig",null)};t.getNativeBufferConfig=function(e){return i(e.getWxaData(),"nativeBufferConfig",{outKey:"__nativeBuffers__",itemKey:"key",itemID:"id",itemBase64:"base64",nativeBufferSizeLimitByte:2147483647})},t.getFSConfig=function(e){return i(e.getWxaData(),"fsData",null)}},function(e,t,n){"use strict";e.exports=Object.assign({},n(24),n(27),n(31),n(68),n(70),n(76),n(5),n(80),n(81),n(82),n(7),n(11));const r=n(2);Object.getOwnPropertyDescriptor(r,"promises")&&Object.defineProperty(e.exports,"promises",{get:()=>r.promises})},function(e,t,n){"use strict";const r=n(4).fromCallback,i=n(77);e.exports={readJson:r(i.readFile),readJsonSync:i.readFileSync,writeJson:r(i.writeFile),writeJsonSync:i.writeFileSync}},function(e,t,n){const r=n(0),i=n(2);var o=function(e){var t=0;try{var n=i.statSync(e);if(n.isFile())return n.size;for(var s=i.readdirSync(e),c=s.length,a=0;a<c;a++){var u=r.join(e,s[a]);t+=o(u)}return t}catch(e){return console.error("getFolderSizeSync error:"+e.message),t}};t.getFolderSizeSync=o,t.dataByteLength=function(e,t){return Buffer.isBuffer(e)?e.length:Buffer.byteLength(e,t)}},function(e,t){e.exports=require("crypto")},function(e,t){e.exports=require("url")},function(e,t,n){"use strict";function r(e,t){const n=Buffer.allocUnsafe(t);for(var r=0,i=0;i<e.length;i++){const t=e[i];t.copy(n,r),r+=t.length}return n}function i(e,t,n,r,i){for(var o=0;o<i;o++)n[r+o]=e[o]^t[3&o]}function o(e,t){const n=e.length;for(var r=0;r<n;r++)e[r]^=t[3&r]}try{const t=n(!function(){var e=new Error('Cannot find module "bufferutil"');throw e.code="MODULE_NOT_FOUND",e}()),s=t.BufferUtil||t;e.exports={mask(e,t,n,r,o){o<48?i(e,t,n,r,o):s.mask(e,t,n,r,o)},unmask(e,t){e.length<32?o(e,t):s.unmask(e,t)},concat:r}}catch(t){e.exports={concat:r,mask:i,unmask:o}}},function(e,t){e.exports=Object.freeze({ON_SERVICE_INIT_LISTENER:1,ON_RUNNING_STATE_CHANGED_LISTENER:2,ON_PERMISSION_UPDATE_LISTENER:3})},function(e,t,n){const r=n(2),i=n(6);t.access=function(e,t,n){const r=n?e.syncReturn:e.callback;var c=i.filePathLogic(e,t),a=c.path;return a?n?s(a,r):o(a,r):(console.error("access error:"+c.errMsg),r("fail "+c.errMsg))};var o=function(e,t){try{r.access(e,e=>i.processCallback(t,e))}catch(e){i.processCallback(t,e)}return""},s=function(e,t){try{return r.accessSync(e),i.processCallback(t,null)}catch(e){return i.processCallback(t,e)}}},function(e,t,n){"use strict";const r=n(4).fromCallback,i=n(1),o=["access","appendFile","chmod","chown","close","copyFile","fchmod","fchown","fdatasync","fstat","fsync","ftruncate","futimes","lchown","lchmod","link","lstat","mkdir","mkdtemp","open","readFile","readdir","readlink","realpath","rename","rmdir","stat","symlink","truncate","unlink","utimes","writeFile"].filter(e=>"function"==typeof i[e]);Object.keys(i).forEach(e=>{"promises"!==e&&(t[e]=i[e])}),o.forEach(e=>{t[e]=r(i[e])}),t.exists=function(e,t){return"function"==typeof t?i.exists(e,t):new Promise(t=>i.exists(e,t))},t.read=function(e,t,n,r,o,s){return"function"==typeof s?i.read(e,t,n,r,o,s):new Promise((s,c)=>{i.read(e,t,n,r,o,(e,t,n)=>{if(e)return c(e);s({bytesRead:t,buffer:n})})})},t.write=function(e,t,...n){return"function"==typeof n[n.length-1]?i.write(e,t,...n):new Promise((r,o)=>{i.write(e,t,...n,(e,t,n)=>{if(e)return o(e);r({bytesWritten:t,buffer:n})})})}},function(e,t){e.exports=require("stream")},function(e,t){e.exports=require("assert")},function(e,t,n){"use strict";e.exports={copySync:n(63)}},function(e,t,n){"use strict";const r=n(0);function i(e){return(e=r.normalize(r.resolve(e)).split(r.sep)).length>0?e[0]:null}const o=/[<>:"|?*]/;e.exports={getRootPath:i,invalidWin32Path:function(e){const t=i(e);return e=e.replace(t,""),o.test(e)}}},function(e,t,n){"use strict";const r=n(1),i=n(66),o=n(0);e.exports={hasMillisRes:function(e){let t=o.join("millis-test"+Date.now().toString()+Math.random().toString().slice(2));t=o.join(i.tmpdir(),t);const n=new Date(1435410243862);r.writeFile(t,"https://github.com/jprichardson/node-fs-extra/pull/141",i=>{if(i)return e(i);r.open(t,"r+",(i,o)=>{if(i)return e(i);r.futimes(o,n,n,n=>{if(n)return e(n);r.close(o,n=>{if(n)return e(n);r.stat(t,(t,n)=>{if(t)return e(t);e(null,n.mtime>1435410243e3)})})})})})},hasMillisResSync:function(){let e=o.join("millis-test-sync"+Date.now().toString()+Math.random().toString().slice(2));e=o.join(i.tmpdir(),e);const t=new Date(1435410243862);r.writeFileSync(e,"https://github.com/jprichardson/node-fs-extra/pull/141");const n=r.openSync(e,"r+");return r.futimesSync(n,t,t),r.closeSync(n),r.statSync(e).mtime>1435410243e3},timeRemoveMillis:function(e){if("number"==typeof e)return 1e3*Math.floor(e/1e3);if(e instanceof Date)return new Date(1e3*Math.floor(e.getTime()/1e3));throw new Error("fs-extra: timeRemoveMillis() unknown parameter type")},utimesMillis:function(e,t,n,i){r.open(e,"r+",(e,o)=>{if(e)return i(e);r.futimes(o,t,n,e=>{r.close(o,t=>{i&&i(e||t)})})})},utimesMillisSync:function(e,t,n){const i=r.openSync(e,"r+");return r.futimesSync(i,t,n),r.closeSync(i)}}},function(e,t,n){"use strict";e.exports=function(e){if("function"==typeof Buffer.allocUnsafe)try{return Buffer.allocUnsafe(e)}catch(t){return new Buffer(e)}return new Buffer(e)}},function(e,t,n){"use strict";const r=n(4).fromCallback;e.exports={copy:r(n(67))}},function(e,t,n){const r=n(85),i=n(15),o=n(22),s=n(9),c=n(8),a=n(20),u=n(14).wrapResultData,l={name:"onSocketTaskStateChange",ctrlIndex:348};var f=1,h={};t.createClient=function(e,t,n,a,S,g){if(e.reportIDKey(855,0),m(e,S)&&!_(e,t))return console.info("fail:url not in domain list"),e.callback("fail:url not in domain list"),void e.reportIDKey(855,7);const w=e.getAppId();if(!w)return console.error("appid not defined"),void e.callback("fail");h[w]||(h[w]={});const E=i.getMaxWebsocketConnect(e);if(Object.keys(h[w]).length>=E)return console.info("fail:max connected; maxTaskCount:",E),void e.callback("fail:max connected");var x=0;const C=o.ON_RUNNING_STATE_CHANGED_LISTENER,N=f++;g<=0&&(g=i.getWebSocketTimeout(e));const O=y(a);n=v(e,n);const T=k(t),L=i.getUserAgentString(e);console.log("Origin:"+T+", protocolsStr:"+O+", ua:"+L),n["User-Agent"]=L,O&&(n["Sec-WebSocket-Protocol"]=O),T&&(n.Origin=T);const I=new r(t,a,{headers:n,timeout:g,origin:T,perMessageDeflate:!1});I.on("open",function(){e.reportIDKey(855,1),x=e.listenJava(C,function(t){if(t.state&&(t.state==s.AppRunningState.SUSPEND||t.state==s.AppRunningState.DESTROYED)){const t=p(e,N);if(t){const n="interrupted",r=s.NetWork.CLOSE_CODE_DEFAULT;t.close(r,n),e.publishEvent(l,{socketTaskId:N,state:"close",code:r,reason:n})}}}),e.publishEvent(l,{socketTaskId:N,state:"open"})}),I.on("error",function(t){console.error("onError taskId:"+N+", err:"+t),e.reportIDKey(855,2),d(e,N),e.publishEvent(l,{socketTaskId:N,state:"error",errMsg:t}),d(e,N)}),I.on("message",function(t){var n=ArrayBuffer.isView(t),r=Buffer.isBuffer(t),i=n||r,o={socketTaskId:N,state:"message",isBuffer:i,data:t};if(i){if(!u(e,o))return}else o.data=b(t);e.publishEvent(l,o)}),I.on("close",function(t,n){console.info("onClose taskId:"+N+", code:"+t+", resaon:"+n),e.reportIDKey(855,4),e.unListenJava(x);var r=e.reqJavaSync(c.GET_APP_RUNNING_STATE).state;!r||r!=s.AppRunningState.SUSPEND&&r!=s.AppRunningState.DESTROYED||(n="interrupted"),e.publishEvent(l,{socketTaskId:N,state:"close",code:t,reason:n}),d(e,N)}),h[w][N]=I,e.callback("ok",{socketTaskId:N})};var d=function(e,t){const n=e.getAppId();h[n]&&h[n][t]&&(delete h[n][t],console.log("removeClient taskId:"+t+", current size:"+Object.keys(h[n]).length))};t.removeClient=d;var p=function(e,t){const n=e.getAppId();return null==n?null:h[n][t]?h[n][t]:null};t.getClient=p;var y=function(e){var t="";return e&&e.forEach((e,n)=>{n>0&&(t+=","),t+=e}),t},m=function(e,t){const n=i.getCanSkipCheckDomainsByArg(e),r=i.getShouldCheckDomains(e);return(!n||!t)&&r},_=function(e,t){if(!t)return!1;var n,r,o=a.parse(t.toLowerCase());if(!o)return!1;const s=i.getWebsocketSkipPortCheck(e),u=i.getSocketDomains(e);for(r=0;r<u.length;r++)if(console.info("configUrl:"+u[r]),(n=a.parse(u[r].toLowerCase()))&&o.protocol==n.protocol&&o.hostname==n.hostname&&(s||o.port==n.port))return!0;return!!e.reqJavaSync(c.IS_LAN_IP,{url:t}).isLANIp&&(console.log("checkDomains: is LAN ip"),!0)},v=function(e,t){const n=i.getHeaderFilterMode(e);return n==s.HttpSetting.MODE_AS_BLACK_LIST?t=S(e,t):n==s.HttpSetting.MODE_AS_WHITE_LIST&&(t=g(e,t)),t.referer=i.getReferer(e),console.log("referer:"+t.referer),t},S=function(e,t){const n=i.getBlacklistHeaders(e);if(n)return n.forEach((e,n)=>{console.info("blackList :"+e),t[e]&&delete t[e]}),t},g=function(e,t){const n=i.getWhitelistHeaders(e);if(n)return whiteListHeader={},n.forEach((e,n)=>{console.info("whiteList :"+e),t[e]&&(whiteListHeader[e]=t[e])}),whiteListHeader},k=function(e){var t=a.parse(e.toLowerCase());if(!t)return null;var n=t.protocol;if(!n)return null;"wss:"==(n=n.toLowerCase())?n="https":"ws:"==n&&(n="http");var r=n+"://"+t.hostname,i=t.port;return-1==i||!i||80==i&&"http"==n||443==i&&"https"==n||(r=r+":"+i),r},b=function(e){return e?"function"!=typeof e.replace?e:e.replace(/[\u2028\u2029]/g,"\n"):e}},function(e,t,n){"use strict";const r=n(34),i=n(19),o=n(86),s=n(35),c=n(87),a=n(88),u=n(20),l=n(12),f=n(91),h=n(36),d=n(10),p=n(37),y=n(39),m=["CONNECTING","OPEN","CLOSING","CLOSED"],_=d.kWebSocket,v=[8,13],S=3e4;class g extends r{constructor(e,t,n){super(),this.readyState=g.CONNECTING,this.protocol="",this._binaryType=d.BINARY_TYPES[0],this._closeFrameReceived=!1,this._closeFrameSent=!1,this._closeMessage="",this._closeTimer=null,this._closeCode=1006,this._extensions={},this._isServer=!0,this._receiver=null,this._sender=null,this._socket=null,null!==e&&(Array.isArray(t)?t=t.join(", "):"object"==typeof t&&null!==t&&(n=t,t=void 0),function(e,t,n){if(n=Object.assign({protocolVersion:v[1],perMessageDeflate:!0,maxPayload:104857600},n,{createConnection:void 0,socketPath:void 0,hostname:void 0,protocol:void 0,timeout:void 0,method:void 0,auth:void 0,host:void 0,path:void 0,port:void 0}),-1===v.indexOf(n.protocolVersion))throw new RangeError(`Unsupported protocol version: ${n.protocolVersion} `+`(supported versions: ${v.join(", ")})`);var r;this._isServer=!1,"object"==typeof e&&void 0!==e.href?(r=e,this.url=e.href):(r=u.parse(e),this.url=e);const c="ws+unix:"===r.protocol;if(!(r.host||c&&r.pathname))throw new Error(`Invalid URL: ${this.url}`);const a="wss:"===r.protocol||"https:"===r.protocol,f=i.randomBytes(16).toString("base64"),p=a?o:s,y=r.search?`${r.pathname||"/"}${r.search}`:r.pathname||"/";var m;n.createConnection=a?b:k,n.port=r.port||(a?443:80),n.host=r.hostname.startsWith("[")?r.hostname.slice(1,-1):r.hostname,n.headers=Object.assign({"Sec-WebSocket-Version":n.protocolVersion,"Sec-WebSocket-Key":f,Connection:"Upgrade",Upgrade:"websocket"},n.headers),n.path=y,n.perMessageDeflate&&(m=new l(!0!==n.perMessageDeflate?n.perMessageDeflate:{},!1,n.maxPayload),n.headers["Sec-WebSocket-Extensions"]=h.format({[l.extensionName]:m.offer()}));t&&(n.headers["Sec-WebSocket-Protocol"]=t);n.origin&&(n.protocolVersion<13?n.headers["Sec-WebSocket-Origin"]=n.origin:n.headers.Origin=n.origin);r.auth?n.auth=r.auth:(r.username||r.password)&&(n.auth=`${r.username}:${r.password}`);if(c){const e=y.split(":");n.socketPath=e[0],n.path=e[1]}var _=this._req=p.get(n);n.handshakeTimeout&&_.setTimeout(n.handshakeTimeout,()=>w(this,_,"Opening handshake has timed out"));_.on("error",e=>{this._req.aborted||(_=this._req=null,this.readyState=g.CLOSING,this.emit("error",e),this.emitClose())}),_.on("response",e=>{this.emit("unexpected-response",_,e)||w(this,_,`Unexpected server response: ${e.statusCode}`)}),_.on("upgrade",(e,r,o)=>{if(this.emit("upgrade",e),this.readyState!==g.CONNECTING)return;_=this._req=null;const s=i.createHash("sha1").update(f+d.GUID,"binary").digest("base64");if(e.headers["sec-websocket-accept"]!==s)return void w(this,r,"Invalid Sec-WebSocket-Accept header");const c=e.headers["sec-websocket-protocol"],a=(t||"").split(/, */);var u;if(!t&&c?u="Server sent a subprotocol but none was requested":t&&!c?u="Server sent no subprotocol":c&&-1===a.indexOf(c)&&(u="Server sent an invalid subprotocol"),u)w(this,r,u);else{if(c&&(this.protocol=c),m)try{const t=h.parse(e.headers["sec-websocket-extensions"]);t[l.extensionName]&&(m.accept(t[l.extensionName]),this._extensions[l.extensionName]=m)}catch(e){return void w(this,r,"Invalid Sec-WebSocket-Extensions header")}this.setSocket(r,o,n.maxPayload)}})}.call(this,e,t,n))}get CONNECTING(){return g.CONNECTING}get CLOSING(){return g.CLOSING}get CLOSED(){return g.CLOSED}get OPEN(){return g.OPEN}get binaryType(){return this._binaryType}set binaryType(e){d.BINARY_TYPES.indexOf(e)<0||(this._binaryType=e,this._receiver&&(this._receiver._binaryType=e))}get bufferedAmount(){return this._socket?(this._socket.bufferSize||0)+this._sender._bufferedBytes:0}get extensions(){return Object.keys(this._extensions).join()}setSocket(e,t,n){const r=new p(this._binaryType,this._extensions,n);this._sender=new y(e,this._extensions),this._receiver=r,this._socket=e,r[_]=this,e[_]=this,r.on("conclude",E),r.on("drain",x),r.on("error",C),r.on("message",O),r.on("ping",T),r.on("pong",L),e.setTimeout(0),e.setNoDelay(),t.length>0&&e.unshift(t),e.on("close",I),e.on("data",D),e.on("end",F),e.on("error",P),this.readyState=g.OPEN,this.emit("open")}emitClose(){this.readyState=g.CLOSED,this._socket?(this._extensions[l.extensionName]&&this._extensions[l.extensionName].cleanup(),this._receiver.removeAllListeners(),this.emit("close",this._closeCode,this._closeMessage)):this.emit("close",this._closeCode,this._closeMessage)}close(e,t){if(this.readyState!==g.CLOSED){if(this.readyState===g.CONNECTING){const e="WebSocket was closed before the connection was established";return w(this,this._req,e)}this.readyState!==g.CLOSING?(this.readyState=g.CLOSING,this._sender.close(e,t,!this._isServer,e=>{e||(this._closeFrameSent=!0,this._socket.writable&&(this._closeFrameReceived&&this._socket.end(),this._closeTimer=setTimeout(this._socket.destroy.bind(this._socket),S)))})):this._closeFrameSent&&this._closeFrameReceived&&this._socket.end()}}ping(e,t,n){if("function"==typeof e?(n=e,e=t=void 0):"function"==typeof t&&(n=t,t=void 0),this.readyState!==g.OPEN){const e=new Error(`WebSocket is not open: readyState ${this.readyState} `+`(${m[this.readyState]})`);if(n)return n(e);throw e}"number"==typeof e&&(e=e.toString()),void 0===t&&(t=!this._isServer),this._sender.ping(e||d.EMPTY_BUFFER,t,n)}pong(e,t,n){if("function"==typeof e?(n=e,e=t=void 0):"function"==typeof t&&(n=t,t=void 0),this.readyState!==g.OPEN){const e=new Error(`WebSocket is not open: readyState ${this.readyState} `+`(${m[this.readyState]})`);if(n)return n(e);throw e}"number"==typeof e&&(e=e.toString()),void 0===t&&(t=!this._isServer),this._sender.pong(e||d.EMPTY_BUFFER,t,n)}send(e,t,n){if("function"==typeof t&&(n=t,t={}),this.readyState!==g.OPEN){const e=new Error(`WebSocket is not open: readyState ${this.readyState} `+`(${m[this.readyState]})`);if(n)return n(e);throw e}"number"==typeof e&&(e=e.toString());const r=Object.assign({binary:"string"!=typeof e,mask:!this._isServer,compress:!0,fin:!0},t);this._extensions[l.extensionName]||(r.compress=!1),this._sender.send(e||d.EMPTY_BUFFER,r,n)}terminate(){if(this.readyState!==g.CLOSED){if(this.readyState===g.CONNECTING){const e="WebSocket was closed before the connection was established";return w(this,this._req,e)}this._socket&&(this.readyState=g.CLOSING,this._socket.destroy())}}}function k(e){return e.protocolVersion&&(e.path=e.socketPath),c.connect(e)}function b(e){return e.path=void 0,e.servername=e.servername||e.host,a.connect(e)}function w(e,t,n){e.readyState=g.CLOSING;const r=new Error(n);Error.captureStackTrace(r,w),t.setHeader?(t.abort(),t.once("abort",e.emitClose.bind(e)),e.emit("error",r)):(t.destroy(r),t.once("error",e.emit.bind(e,"error")),t.once("close",e.emitClose.bind(e)))}function E(e,t){const n=this[_];n._socket.removeListener("data",D),n._socket.resume(),n._closeFrameReceived=!0,n._closeMessage=t,n._closeCode=e,1005===e?n.close():n.close(e,t)}function x(){this[_]._socket.resume()}function C(e){const t=this[_];t._socket.removeListener("data",D),t.readyState=g.CLOSING,t._closeCode=e[d.kStatusCode],t.emit("error",e),t._socket.destroy()}function N(){this[_].emitClose()}function O(e){this[_].emit("message",e)}function T(e){const t=this[_];t.pong(e,!t._isServer,d.NOOP),t.emit("ping",e)}function L(e){this[_].emit("pong",e)}function I(){const e=this[_];this.removeListener("close",I),this.removeListener("end",F),e.readyState=g.CLOSING,e._socket.read(),e._receiver.end(),this.removeListener("data",D),this[_]=void 0,clearTimeout(e._closeTimer),e._receiver._writableState.finished||e._receiver._writableState.errorEmitted?e.emitClose():(e._receiver.on("error",N),e._receiver.on("finish",N))}function D(e){this[_]._receiver.write(e)||this.pause()}function F(){const e=this[_];e.readyState=g.CLOSING,e._receiver.end(),this.end()}function P(){const e=this[_];this.removeListener("error",P),this.on("error",d.NOOP),e&&(e.readyState=g.CLOSING,this.destroy())}m.forEach((e,t)=>{g[m[t]]=t}),["open","error","close","message"].forEach(e=>{Object.defineProperty(g.prototype,`on${e}`,{get(){const t=this.listeners(e);for(var n=0;n<t.length;n++)if(t[n]._listener)return t[n]._listener},set(t){const n=this.listeners(e);for(var r=0;r<n.length;r++)n[r]._listener&&this.removeListener(e,n[r]);this.addEventListener(e,t)}})}),g.prototype.addEventListener=f.addEventListener,g.prototype.removeEventListener=f.removeEventListener,e.exports=g},function(e,t){e.exports=require("events")},function(e,t){e.exports=require("http")},function(e,t,n){"use strict";const r=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,1,1,1,1,1,0,0,1,1,0,1,1,0,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,0,1,0];function i(e,t,n){Object.prototype.hasOwnProperty.call(e,t)?e[t].push(n):e[t]=[n]}e.exports={format:function(e){return Object.keys(e).map(t=>{var n=e[t];return Array.isArray(n)||(n=[n]),n.map(e=>[t].concat(Object.keys(e).map(t=>{var n=e[t];return Array.isArray(n)||(n=[n]),n.map(e=>!0===e?t:`${t}=${e}`).join("; ")})).join("; ")).join(", ")}).join(", ")},parse:function(e){const t={};if(void 0===e||""===e)return t;for(var n,o,s={},c=!1,a=!1,u=!1,l=-1,f=-1,h=0;h<e.length;h++){const p=e.charCodeAt(h);if(void 0===n)if(-1===f&&1===r[p])-1===l&&(l=h);else if(32===p||9===p)-1===f&&-1!==l&&(f=h);else{if(59!==p&&44!==p)throw new SyntaxError(`Unexpected character at index ${h}`);{if(-1===l)throw new SyntaxError(`Unexpected character at index ${h}`);-1===f&&(f=h);const r=e.slice(l,f);44===p?(i(t,r,s),s={}):n=r,l=f=-1}}else if(void 0===o)if(-1===f&&1===r[p])-1===l&&(l=h);else if(32===p||9===p)-1===f&&-1!==l&&(f=h);else if(59===p||44===p){if(-1===l)throw new SyntaxError(`Unexpected character at index ${h}`);-1===f&&(f=h),i(s,e.slice(l,f),!0),44===p&&(i(t,n,s),s={},n=void 0),l=f=-1}else{if(61!==p||-1===l||-1!==f)throw new SyntaxError(`Unexpected character at index ${h}`);o=e.slice(l,h),l=f=-1}else if(a){if(1!==r[p])throw new SyntaxError(`Unexpected character at index ${h}`);-1===l?l=h:c||(c=!0),a=!1}else if(u)if(1===r[p])-1===l&&(l=h);else if(34===p&&-1!==l)u=!1,f=h;else{if(92!==p)throw new SyntaxError(`Unexpected character at index ${h}`);a=!0}else if(34===p&&61===e.charCodeAt(h-1))u=!0;else if(-1===f&&1===r[p])-1===l&&(l=h);else if(-1===l||32!==p&&9!==p){if(59!==p&&44!==p)throw new SyntaxError(`Unexpected character at index ${h}`);if(-1===l)throw new SyntaxError(`Unexpected character at index ${h}`);-1===f&&(f=h);var d=e.slice(l,f);c&&(d=d.replace(/\\/g,""),c=!1),i(s,o,d),44===p&&(i(t,n,s),s={},n=void 0),o=void 0,l=f=-1}else-1===f&&(f=h)}if(-1===l||u)throw new SyntaxError("Unexpected end of input");-1===f&&(f=h);const p=e.slice(l,f);return void 0===n?i(t,p,{}):(void 0===o?i(s,p,!0):i(s,o,c?p.replace(/\\/g,""):p),i(t,n,s)),t}}},function(e,t,n){"use strict";const r=n(25),i=n(12),o=n(21),s=n(38),c=n(10),a=0,u=1,l=2,f=3,h=4,d=5;function p(e,t,n,r){const i=new e(n?`Invalid WebSocket frame: ${t}`:t);return Error.captureStackTrace(i,p),i[c.kStatusCode]=r,i}function y(e,t){return 1===e.length?e[0]:e.length>1?o.concat(e,t):c.EMPTY_BUFFER}e.exports=class extends r.Writable{constructor(e,t,n){super(),this._binaryType=e||c.BINARY_TYPES[0],this[c.kWebSocket]=void 0,this._extensions=t||{},this._maxPayload=0|n,this._bufferedBytes=0,this._buffers=[],this._compressed=!1,this._payloadLength=0,this._mask=void 0,this._fragmented=0,this._masked=!1,this._fin=!1,this._opcode=0,this._totalPayloadLength=0,this._messageLength=0,this._fragments=[],this._state=a,this._loop=!1}_write(e,t,n){if(8===this._opcode)return n();this._bufferedBytes+=e.length,this._buffers.push(e),this.startLoop(n)}consume(e){if(this._bufferedBytes-=e,e===this._buffers[0].length)return this._buffers.shift();if(e<this._buffers[0].length){const t=this._buffers[0];return this._buffers[0]=t.slice(e),t.slice(0,e)}const t=Buffer.allocUnsafe(e);do{const n=this._buffers[0];e>=n.length?this._buffers.shift().copy(t,t.length-e):(n.copy(t,t.length-e,0,e),this._buffers[0]=n.slice(e)),e-=n.length}while(e>0);return t}startLoop(e){var t;this._loop=!0;do{switch(this._state){case a:t=this.getInfo();break;case u:t=this.getPayloadLength16();break;case l:t=this.getPayloadLength64();break;case f:this.getMask();break;case h:t=this.getData(e);break;default:return void(this._loop=!1)}}while(this._loop);e(t)}getInfo(){if(this._bufferedBytes<2)return void(this._loop=!1);const e=this.consume(2);if(0!=(48&e[0]))return this._loop=!1,p(RangeError,"RSV2 and RSV3 must be clear",!0,1002);const t=64==(64&e[0]);if(t&&!this._extensions[i.extensionName])return this._loop=!1,p(RangeError,"RSV1 must be clear",!0,1002);if(this._fin=128==(128&e[0]),this._opcode=15&e[0],this._payloadLength=127&e[1],0===this._opcode){if(t)return this._loop=!1,p(RangeError,"RSV1 must be clear",!0,1002);if(!this._fragmented)return this._loop=!1,p(RangeError,"invalid opcode 0",!0,1002);this._opcode=this._fragmented}else if(1===this._opcode||2===this._opcode){if(this._fragmented)return this._loop=!1,p(RangeError,`invalid opcode ${this._opcode}`,!0,1002);this._compressed=t}else{if(!(this._opcode>7&&this._opcode<11))return this._loop=!1,p(RangeError,`invalid opcode ${this._opcode}`,!0,1002);if(!this._fin)return this._loop=!1,p(RangeError,"FIN must be set",!0,1002);if(t)return this._loop=!1,p(RangeError,"RSV1 must be clear",!0,1002);if(this._payloadLength>125)return this._loop=!1,p(RangeError,`invalid payload length ${this._payloadLength}`,!0,1002)}if(this._fin||this._fragmented||(this._fragmented=this._opcode),this._masked=128==(128&e[1]),126===this._payloadLength)this._state=u;else{if(127!==this._payloadLength)return this.haveLength();this._state=l}}getPayloadLength16(){if(!(this._bufferedBytes<2))return this._payloadLength=this.consume(2).readUInt16BE(0),this.haveLength();this._loop=!1}getPayloadLength64(){if(this._bufferedBytes<8)return void(this._loop=!1);const e=this.consume(8),t=e.readUInt32BE(0);return t>Math.pow(2,21)-1?(this._loop=!1,p(RangeError,"Unsupported WebSocket frame: payload length > 2^53 - 1",!1,1009)):(this._payloadLength=t*Math.pow(2,32)+e.readUInt32BE(4),this.haveLength())}haveLength(){if(this._payloadLength&&this._opcode<8&&(this._totalPayloadLength+=this._payloadLength,this._totalPayloadLength>this._maxPayload&&this._maxPayload>0))return this._loop=!1,p(RangeError,"Max payload size exceeded",!1,1009);this._masked?this._state=f:this._state=h}getMask(){this._bufferedBytes<4?this._loop=!1:(this._mask=this.consume(4),this._state=h)}getData(e){var t=c.EMPTY_BUFFER;if(this._payloadLength){if(this._bufferedBytes<this._payloadLength)return void(this._loop=!1);t=this.consume(this._payloadLength),this._masked&&o.unmask(t,this._mask)}return this._opcode>7?this.controlMessage(t):this._compressed?(this._state=d,void this.decompress(t,e)):(t.length&&(this._messageLength=this._totalPayloadLength,this._fragments.push(t)),this.dataMessage())}decompress(e,t){this._extensions[i.extensionName].decompress(e,this._fin,(e,n)=>{if(e)return t(e);if(n.length){if(this._messageLength+=n.length,this._messageLength>this._maxPayload&&this._maxPayload>0)return t(p(RangeError,"Max payload size exceeded",!1,1009));this._fragments.push(n)}const r=this.dataMessage();if(r)return t(r);this.startLoop(t)})}dataMessage(){if(this._fin){const n=this._messageLength,r=this._fragments;if(this._totalPayloadLength=0,this._messageLength=0,this._fragmented=0,this._fragments=[],2===this._opcode){var e;e="nodebuffer"===this._binaryType?y(r,n):"arraybuffer"===this._binaryType?0===(t=y(r,n)).byteOffset&&t.byteLength===t.buffer.byteLength?t.buffer:t.buffer.slice(t.byteOffset,t.byteOffset+t.byteLength):r,this.emit("message",e)}else{const e=y(r,n);if(!s.isValidUTF8(e))return this._loop=!1,p(Error,"invalid UTF-8 sequence",!0,1007);this.emit("message",e.toString())}}var t;this._state=a}controlMessage(e){if(8!==this._opcode)9===this._opcode?this.emit("ping",e):this.emit("pong",e),this._state=a;else if(this._loop=!1,0===e.length)this.emit("conclude",1005,""),this.end();else{if(1===e.length)return p(RangeError,"invalid payload length 1",!0,1002);{const t=e.readUInt16BE(0);if(!s.isValidStatusCode(t))return p(RangeError,`invalid status code ${t}`,!0,1002);const n=e.slice(2);if(!s.isValidUTF8(n))return p(Error,"invalid UTF-8 sequence",!0,1007);this.emit("conclude",t,n.toString()),this.end()}}}}},function(e,t,n){"use strict";try{const e=n(!function(){var e=new Error('Cannot find module "utf-8-validate"');throw e.code="MODULE_NOT_FOUND",e}());t.isValidUTF8="object"==typeof e?e.Validation.isValidUTF8:e}catch(e){t.isValidUTF8=(()=>!0)}t.isValidStatusCode=(e=>e>=1e3&&e<=1013&&1004!==e&&1005!==e&&1006!==e||e>=3e3&&e<=4999)},function(e,t,n){"use strict";const r=n(19),i=n(12),o=n(21),s=n(38),c=n(10);class a{constructor(e,t){this._extensions=t||{},this._socket=e,this._firstFragment=!0,this._compress=!1,this._bufferedBytes=0,this._deflating=!1,this._queue=[]}static frame(e,t){const n=e.length<1024||t.mask&&t.readOnly;var i=t.mask?6:2,s=e.length;e.length>=65536?(i+=8,s=127):e.length>125&&(i+=2,s=126);const c=Buffer.allocUnsafe(n?e.length+i:i);if(c[0]=t.fin?128|t.opcode:t.opcode,t.rsv1&&(c[0]|=64),126===s?c.writeUInt16BE(e.length,2):127===s&&(c.writeUInt32BE(0,2),c.writeUInt32BE(e.length,6)),!t.mask)return c[1]=s,n?(e.copy(c,i),[c]):[c,e];const a=r.randomBytes(4);return c[1]=128|s,c[i-4]=a[0],c[i-3]=a[1],c[i-2]=a[2],c[i-1]=a[3],n?(o.mask(e,a,c,i,e.length),[c]):(o.mask(e,a,e,0,e.length),[c,e])}close(e,t,n,r){var i;if(void 0===e)i=c.EMPTY_BUFFER;else{if("number"!=typeof e||!s.isValidStatusCode(e))throw new TypeError("First argument must be a valid error code number");void 0===t||""===t?(i=Buffer.allocUnsafe(2)).writeUInt16BE(e,0):((i=Buffer.allocUnsafe(2+Buffer.byteLength(t))).writeUInt16BE(e,0),i.write(t,2))}this._deflating?this.enqueue([this.doClose,i,n,r]):this.doClose(i,n,r)}doClose(e,t,n){this.sendFrame(a.frame(e,{fin:!0,rsv1:!1,opcode:8,mask:t,readOnly:!1}),n)}ping(e,t,n){var r=!0;Buffer.isBuffer(e)||(e instanceof ArrayBuffer?e=Buffer.from(e):ArrayBuffer.isView(e)?e=u(e):(e=Buffer.from(e),r=!1)),this._deflating?this.enqueue([this.doPing,e,t,r,n]):this.doPing(e,t,r,n)}doPing(e,t,n,r){this.sendFrame(a.frame(e,{fin:!0,rsv1:!1,opcode:9,mask:t,readOnly:n}),r)}pong(e,t,n){var r=!0;Buffer.isBuffer(e)||(e instanceof ArrayBuffer?e=Buffer.from(e):ArrayBuffer.isView(e)?e=u(e):(e=Buffer.from(e),r=!1)),this._deflating?this.enqueue([this.doPong,e,t,r,n]):this.doPong(e,t,r,n)}doPong(e,t,n,r){this.sendFrame(a.frame(e,{fin:!0,rsv1:!1,opcode:10,mask:t,readOnly:n}),r)}send(e,t,n){var r=t.binary?2:1,o=t.compress,s=!0;Buffer.isBuffer(e)||(e instanceof ArrayBuffer?e=Buffer.from(e):ArrayBuffer.isView(e)?e=u(e):(e=Buffer.from(e),s=!1));const c=this._extensions[i.extensionName];if(this._firstFragment?(this._firstFragment=!1,o&&c&&(o=e.length>=c._threshold),this._compress=o):(o=!1,r=0),t.fin&&(this._firstFragment=!0),c){const i={fin:t.fin,rsv1:o,opcode:r,mask:t.mask,readOnly:s};this._deflating?this.enqueue([this.dispatch,e,this._compress,i,n]):this.dispatch(e,this._compress,i,n)}else this.sendFrame(a.frame(e,{fin:t.fin,rsv1:!1,opcode:r,mask:t.mask,readOnly:s}),n)}dispatch(e,t,n,r){if(!t)return void this.sendFrame(a.frame(e,n),r);const o=this._extensions[i.extensionName];this._deflating=!0,o.compress(e,n.fin,(e,t)=>{n.readOnly=!1,this.sendFrame(a.frame(t,n),r),this._deflating=!1,this.dequeue()})}dequeue(){for(;!this._deflating&&this._queue.length;){const e=this._queue.shift();this._bufferedBytes-=e[1].length,e[0].apply(this,e.slice(1))}}enqueue(e){this._bufferedBytes+=e[1].length,this._queue.push(e)}sendFrame(e,t){2===e.length?(this._socket.write(e[0]),this._socket.write(e[1],t)):this._socket.write(e[0],t)}}function u(e){const t=Buffer.from(e.buffer);return e.byteLength!==e.buffer.byteLength?t.slice(e.byteOffset,e.byteOffset+e.byteLength):t}e.exports=a},function(e,t,n){const r=n(2),i=n(6),o=n(3).defGet,s=n(18);t.appendFile=function(e,t,n){const r=n?e.syncReturn:e.callback;var u=i.filePathLogic(e,t),l=u.path;if(!l)return console.error("appendFile error:"+u.errMsg),r("fail "+u.errMsg);var f=o(t,"encoding",""),h=o(t,"data",null);ArrayBuffer.isView(h)||h instanceof ArrayBuffer?h=Buffer.from(h):f||(f="utf8");var d=s.dataByteLength(h,f),p=i.quotaControl(e,u.rootPath,d);return p?r("fail "+p):n?a(l,h,f,r):c(l,h,f,r)};var c=function(e,t,n,o){try{r.appendFile(e,t,{encoding:n},e=>i.processCallback(o,e))}catch(e){i.processCallback(o,e)}return""},a=function(e,t,n,o){try{return r.appendFileSync(e,t,{encoding:n}),i.processCallback(o,null)}catch(e){return i.processCallback(o,e)}}},function(e,t,n){const r=n(2),i=(n(3).defGet,n(6));t.copyFile=function(e,t,n){const c=n?e.syncReturn:e.callback;var a=i.filePathLogic(e,t,"srcPath",!0),u=a.path;if(!u)return console.error("copyFile error:"+a.errMsg),c("fail "+a.errMsg);var l=i.fileDestPathLogic(e,t),f=l.path;if(!f)return c("fail "+l.errMsg);if(a.rootPath!=l.rootPath)try{var h=r.statSync(u).size,d=i.quotaControl(e,l.rootPath,h);if(d)return c("fail "+d)}catch(e){return i.processCallback(c,e)}return n?s(u,f,c):o(u,f,c)};var o=function(e,t,n){try{r.copyFile(e,t,e=>i.processCallback(n,e))}catch(e){i.processCallback(n,e)}return""},s=function(e,t,n){try{return r.copyFileSync(e,t),i.processCallback(n,null)}catch(e){return i.processCallback(n,e)}}},function(e,t,n){const r=n(2),i=(n(3).defGet,n(6));t.rename=function(e,t,n){const c=n?e.syncReturn:e.callback;var a=i.filePathLogic(e,t,"oldPath"),u=a.path;if(!u)return console.error("rename error:"+a.errMsg),c("fail "+a.errMsg);var l=i.fileDestPathLogic(e,t,"newPath"),f=l.path;if(!f)return c("fail "+l.errMsg);if(a.rootPath!=l.rootPath)try{var h=r.statSync(u).size,d=i.quotaControl(e,l.rootPath,h);if(d)return c("fail "+d)}catch(e){return i.processCallback(c,e)}return n?s(u,f,c):o(u,f,c)};var o=function(e,t,n){try{r.rename(e,t,e=>i.processCallback(n,e))}catch(e){i.processCallback(n,e)}return""},s=function(e,t,n){try{return r.renameSync(e,t),i.processCallback(n,null)}catch(e){return i.processCallback(n,e)}}},function(e,t,n){const r=n(2),i=n(16),o=n(3).defGet,s=n(6);t.mkdir=function(e,t,n){const r=n?e.syncReturn:e.callback;var i=s.filePathLogic(e,t),u=i.path;if(!u)return r("fail "+i.errMsg);var l=o(t,"recursive",!1);return n?a(u,l,r):c(u,l,r)};var c=function(e,t,n){var o=e=>s.processCallback(n,e);try{t?i.mkdirs(e,o):r.mkdir(e,o)}catch(e){s.processCallback(n,e)}return""},a=function(e,t,n){try{return t?i.mkdirsSync(e):r.mkdirSync(e),s.processCallback(n,null)}catch(e){return s.processCallback(n,e)}}},function(e,t,n){const r=n(2),i=n(6),o=n(3).defGet,s=n(14).wrapResultData;t.readFile=function(e,t,n){const r=n?e.syncReturn:e.callback;var s=i.filePathLogic(e,t),u=s.path;if(!u)return console.error("readFile error:"+s.errMsg),r("fail "+s.errMsg);var l=o(t,"encoding","");return n?a(e,u,l,r):c(e,u,l,r)};var c=function(e,t,n,o){try{let c=r.createReadStream(t,{encoding:n}),a=[],u="";c.on("error",e=>i.processCallback(o,e)),c.on("data",e=>{n?u+=e:a.push(e)}),c.on("end",()=>{n||(u=Buffer.concat(a));var t={data:u};return Buffer.isBuffer(u)&&!s(e,t)?(console.error("jsapi_readFile wrapResultDataWithNativeBuffer failed"),o("fail:convert native buffer parameter fail. native buffer exceed size limit.")):i.processCallback(o,null,t)})}catch(e){i.processCallback(o,e)}return""},a=function(e,t,n,o){try{var c=r.readFileSync(t,{encoding:n}),a={data:c};return Buffer.isBuffer(c)&&!s(e,a)?(console.error("wrapResultDataWithNativeBuffer failed"),o("fail:convert native buffer parameter fail. native buffer exceed size limit.")):i.processCallback(o,null,a)}catch(e){return i.processCallback(o,e)}}},function(e,t,n){const r=n(2),i=n(6);t.readdir=function(e,t,n){const r=n?e.syncReturn:e.callback;var c=i.filePathLogic(e,t),a=c.path;return a?n?s(a,r):o(a,r):r("fail "+c.errMsg)};var o=function(e,t){try{r.readdir(e,(e,n)=>i.processCallback(t,e,{files:n}))}catch(e){i.processCallback(t,e)}return""},s=function(e,t){try{var n=r.readdirSync(e);return i.processCallback(t,null,{files:n})}catch(e){return i.processCallback(t,e)}}},function(e,t,n){const r=n(2),i=n(16),o=n(3).defGet,s=n(6);t.rmdir=function(e,t,n){const r=n?e.syncReturn:e.callback;var i=s.filePathLogic(e,t),u=i.path;if(!u)return console.error("rmdir error:"+i.errMsg),r("fail "+i.errMsg);if(u==i.rootPath)return console.warn("rmdir isNonFaltternedRootPath :"+u),r("fail permission denied, open "+u);var l=o(t,"recursive",!1);return n?a(u,l,r):c(u,l,r)};var c=function(e,t,n){var o=e=>s.processCallback(n,e);try{if(t){if(r.statSync(e).isFile())return n("fail not a directory, rmdir '"+e+"'");i.remove(e,o)}else r.rmdir(e,o)}catch(e){s.processCallback(n,e)}return""},a=function(e,t,n){try{if(t){if(r.statSync(e).isFile())return n(n,"fail not a directory, rmdir '"+e+"'");i.removeSync(e)}else r.rmdirSync(e);return s.processCallback(n,null)}catch(e){return s.processCallback(n,e)}}},function(e,t,n){const r=n(2),i=(n(3).defGet,n(6));t.unlink=function(e,t,n){const r=n?e.syncReturn:e.callback;var c=i.filePathLogic(e,t),a=c.path;return a?n?s(a,r):o(a,r):(console.error("unlink error:"+c.errMsg),r("fail "+c.errMsg))};var o=function(e,t){try{r.unlink(e,e=>i.processCallback(t,e))}catch(e){i.processCallback(t,e)}return""},s=function(e,t){try{return r.unlinkSync(e),i.processCallback(t,null)}catch(e){return i.processCallback(t,e)}}},function(e,t,n){const r=n(2),i=n(6),o=n(3).defGet,s=n(18);t.writeFile=function(e,t,n){const r=n?e.syncReturn:e.callback;var u=i.filePathLogic(e,t),l=u.path;if(!l)return console.error("writeFile error:"+u.errMsg),r("fail "+u.errMsg);var f=o(t,"encoding",""),h=o(t,"data",null);ArrayBuffer.isView(h)||h instanceof ArrayBuffer?h=Buffer.from(h):f||(f="utf8");var d=s.dataByteLength(h,f),p=i.quotaControl(e,u.rootPath,d);return p?r("fail "+p):n?a(l,h,f,r):c(l,h,f,r)};var c=function(e,t,n,o){try{var s=r.createWriteStream(e,{encoding:n});s.write(t),s.end(),s.on("finish",()=>i.processCallback(o,null)),s.on("error",e=>i.processCallback(o,e))}catch(e){i.processCallback(o,e)}return""},a=function(e,t,n,o){try{return r.writeFileSync(e,t,{encoding:n}),i.processCallback(o,null)}catch(e){return i.processCallback(o,e)}}},function(e,t,n){console.debug=console.log;let r=(i={},"undefined"==typeof WeixinJSCoreAndroid?(console.error("initEnv : WeixinJSCoreAndroid undefined"),null):(i.WeixinJSCoreAndroid=WeixinJSCoreAndroid,"undefined"==typeof WeixinJSCore?(console.error("initEnv : WeixinJSCore undefined"),null):(i.WeixinJSCore=WeixinJSCore,"undefined"==typeof process?(console.error("initEnv : process undefined"),null):(i.process=process,"undefined"==typeof gJavaBroker?(console.error("initEnv : javaBroker undefined"),null):(i.javaBroker=gJavaBroker,i)))));var i;if(null!=r){String.prototype.startWith=function(e){return!(null==e||""==e||0==this.length||e.length>this.length)&&this.substr(0,e.length)==e};const e=n(50);gNodeController=new e,gNodeController.startNode(r)}"undefined"!=typeof gJavaBroker&&delete gJavaBroker},function(e,t,n){const r=n(51),i=n(52),o=(n(3),n(13),n(53)),s=n(8),c=n(22),a=n(9),u=n(3).defGet,l=n(14).wrapReqData;e.exports=function(){var e,t=!0,f={},h={},d=!1;this.startNode=function(s){console.log("startNode"),e=new o(s.javaBroker),s.process.on("uncaughtException",function(e){t=!1,m(854,4),console.error("uncaughtException"),console.error(e.stack),console.error(e)});let _=new i;var v,S,g,k,b,w;!function(){var t,n,r;function i(e){return void 0===e.bg||void 0===e.fg?(console.warn("extractPermission permission bytes null"),null):{fg:e.fg,bg:e.bg}}t=e.listen(c.ON_SERVICE_INIT_LISTENER,function(o){h=o.wxaData,d=u(h,"notSupport",!1),console.log("onServiceInit _isNotSupport:"+d),n=e.listen(c.ON_PERMISSION_UPDATE_LISTENER,function(e){let t=i(e);_.updatePermission(t)}),r=e.listen(c.ON_RUNNING_STATE_CHANGED_LISTENER,function(i){_.updateCurrentRunningState(i.state),i.state==a.AppRunningState.DESTROYED&&(e.unListen(t),e.unListen(n),e.unListen(r))});let s=i(o);_.updatePermission(s),_.updateCurrentRunningState(o.state)})}(),console.log("prepareRuntime ok"),g=n(13),k=n(56),(b=n(57)).keys().forEach(function(e,t,n){v=p(e),console.log("register api:"+v),null!=v&&(S=b(e),g.inherits(S,k),f[v]=new S)}),w=s.WeixinJSCore.invokeHandler,s.WeixinJSCore.invokeHandler=function(n,i,o){if(!t)return console.error("invoke node env not ok; go __invokeHandler__"),w(n,i,o);if(!y(n))return w(n,i,o);let s=f[n].getCtrlIndex(),c={name:n,ctrlIndex:s};var a=Date.now();let u=new r(e,WeixinJSCoreAndroid,o,c,h,_);u.markInvokeTime(a);var d=function(){try{var e=JSON.parse(i);if(e._invoke_time_=a,!l(u,e))return;return f[n].invoke(u,e)}catch(e){return console.error(e+"; go __invokeHandler__"),m(854,3),w(n,i,o)}};return _.check(u,c,d)?d():""},delete s.javaBroker,console.info("startNode suc")},this.javaResp=function(t,n){e.resp(t,n)},this.javaOnTrigger=function(t,n){e.onTrigger(t,n)};var p=function(e){var t=/.*jsapi_(.+)\.js$/.exec(e);return null==t?null:t[1]},y=function(e){if(void 0===f[e])return!1;if(d)return!1;if("createSocketTask"==e||"operateSocketTask"==e){if(void 0===h.switchWebsocket||0==h.switchWebsocket)return console.log("node websocket not open"),!1}else if(void 0===h.switchFs||0==h.switchFs)return console.log("node fs not open"),!1;return"function"==typeof f[e].invoke},m=function(t,n,r=1){e.req(s.REPORT_ID_KEY,{id:t,key:n,val:r},null)}}},function(e,t,n){const r=n(3),i=n(8);e.exports=function e(t,n,o,s,c,a){var u,l=t,f=n,h=o,d=s,p=c,y=a;this.publishEvent=function(e,t={},n=null,r={}){var i=function(){f.subscribeHandler(e.name,t,n,r)};a.check(this,e,i)&&i()},this.callback=function(e,t={}){t.errMsg=d.name+":"+e;var n=Date.now()-u;return k(e,n),f.invokeCallbackHandler(h,t),""},this.syncReturn=function(e,t={}){t.errMsg=d.name+":"+e;var n=Date.now()-u;return k(e,n),JSON.stringify(t)},this.getApiName=function(){return d.name};var m=function(e){l.req(e)},_=function(e,t){"function"==typeof t?l.req(e,null,respCallback):l.req(e,args,null)},v=function(e,t,n){l.req(e,t,n)};r.overloadMethod(e.prototype,"reqJava",m),r.overloadMethod(e.prototype,"reqJava",_),r.overloadMethod(e.prototype,"reqJava",v),this.reqJavaSync=function(e,t=null){return l.reqSync(e,t)},this.listenJava=function(e,t){return l.listen(e,t)},this.unListenJava=function(e){l.unListen(e)},this.getAppId=function(){return p.appId},this.getSysConfig=function(){return p.sysConfig},this.getAppConfig=function(){return p.appConfig},this.getWxaData=function(){return p};var S=function(e,t,n=1){v(i.REPORT_ID_KEY,{id:e,key:t,val:n},null)};this.reportIDKey=S;var g=function(e,t){v(i.REPORT_KV,{id:e,val:t},null)};this.markInvokeTime=function(e){u=e};var k=function(e,t){var n=1;e.startWith("fail")&&(n=2,S(855,8));var r=y.getApiCtrlByte(this,s.ctrlIndex),i="0,,"+p.appId+","+p.appversion+","+p.appstate+",,0,"+d.name+",,"+n+","+r+",0,"+t+",,"+e+",0,0,,0,,";g(13542,i),i="6,1,"+d.name+","+t+","+p.appId+","+encodeURIComponent(e),g(16713,i)}}},function(e,t,n){const r=n(9),i=n(8);e.exports=function(){var e;ApiCtrlType=Object.freeze({OK:1,REFUSE:0,USER_AUTH:4,BANNED:6,OK_WHEN_PLAYING_AUDIO:7,PENDING_FOREGROUND:8}),CheckErrMsg=Object.freeze({RET_DENIED:"fail:access denied"}),AuthResult=Object.freeze({OK:1,DENY:2,CANCEL:3});var t=r.AppRunningState.FOREGROUND,n=[];this.updatePermission=function(t){t&&(console.info("updatePermission:",t),e=t)},this.updateCurrentRunningState=function(e){console.info("updateCurrentRunningState:"+e),(t=e)==r.AppRunningState.DESTROYED?f():t==r.AppRunningState.FOREGROUND&&l()},this.check=function(e,n,r){var i=this.getApiCtrlByte(e,n.ctrlIndex);switch(console.info("checkPermission api="+n.name+" ctrlByte="+i+" _currentRunningState="+t),i){case ApiCtrlType.OK:return o(e,n);case ApiCtrlType.BANNED:return s(e,n);case ApiCtrlType.USER_AUTH:return c(e,n,r);case ApiCtrlType.OK_WHEN_PLAYING_AUDIO:return a();case ApiCtrlType.PENDING_FOREGROUND:return u(e,n,r);case ApiCtrlType.REFUSE:default:return e.callback(CheckErrMsg.RET_DENIED),!1}};var o=function(e,n){if(t==r.AppRunningState.SUSPEND&&r.NetWorkApis.indexOf(n.name)>=0){var i="fail: jsapi has no permission, event="+n.name+", runningState=suspend , permissionMsg=permission ok, detail=network api interrupted in suspend state";return e.callback(i),!1}return!0},s=function(e,t){return e.reqJava(i.SHOW_JS_API_BAN_ALERT,{apiName:t.name}),e.callback(CheckErrMsg.RET_DENIED),!1},c=function(e,t,n){return e.reqJava(i.REQUIRE_USER_AUTH,{apiName:t.name},function(t){let r=t.result;console.log("doUserAuthLogic result:"+r),r==AuthResult.OK?n():r==AuthResult.CANCEL?e.callback("fail:auth canceled"):e.callback("fail:auth denied")}),!1},a=function(e){return!0},u=function(e,t,r){return console.log("doPendingForegroundLogic pending api:"+t.name),n.push(r),!1},l=function(){console.log("firePendingForegroundCallbacks length:"+n.length);for(var e=0;e<n.length;e++)n[e]();f()},f=function(){n=[]};this.getApiCtrlByte=function(e,t){var n=h();if(!n)throw console.error("Permission getApiCtrlByte ctrlBytes null"),e.reportIDKey(854,10),new Error("Permission getApiCtrlByte ctrlBytes null");return n[t]};var h=function(){if(void 0===e)return null;var n;switch(t){case r.AppRunningState.BACKGROUND:case r.AppRunningState.SUSPEND:case r.AppRunningState.DESTROYED:n=e.bg;break;case r.AppRunningState.FOREGROUND:default:n=e.fg}return n}}},function(e,t){e.exports=function(e){var t=e,n={},r=1,i={},o=1;this.req=function(e,i,o){var s="{}",c=-1;i&&(s=JSON.stringify(i)),"function"==typeof o&&(c=r++,n[c]=o),t.req(e,s,c)},this.reqSync=function(e,n){var r="{}";return n&&(r=JSON.stringify(n)),JSON.parse(t.reqSync(e,r))},this.resp=function(e,t){"function"==typeof n[e]&&(n[e](t),delete n[e])},this.listen=function(e,n){const r=o++;return i[r]=n,t.listen(e,r),r},this.unListen=function(e){i[e]&&(delete i[e],t.unListen(e))},this.onTrigger=function(e,t){"function"==typeof i[e]&&i[e](t)}}},function(e,t,n){var r=n(55).Buffer;e.exports=function(e){if(e instanceof Uint8Array){if(0===e.byteOffset&&e.byteLength===e.buffer.byteLength)return e.buffer;if("function"==typeof e.buffer.slice)return e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength)}if(r.isBuffer(e)){for(var t=new Uint8Array(e.length),n=e.length,i=0;i<n;i++)t[i]=e[i];return t.buffer}throw new Error("Argument must be a Buffer")}},function(e,t){e.exports=require("buffer")},function(e,t){function n(){this.ctrlIdx("undefined")}n.prototype.ctrlIdx=function(e){Object.defineProperty(this,"ctrlIndex",{value:e,writable:!1})},n.prototype.getCtrlIndex=function(){if(void 0===this.ctrlIndex)throw"ctrlIndex not definded!";return this.ctrlIndex},e.exports=n},function(e,t,n){var r={"./jsapi_access.js":58,"./jsapi_accessSync.js":83,"./jsapi_createSocketTask.js":84,"./jsapi_fs_appendFile.js":93,"./jsapi_fs_appendFileSync.js":94,"./jsapi_fs_copyFile.js":95,"./jsapi_fs_copyFileSync.js":96,"./jsapi_fs_rename.js":97,"./jsapi_fs_renameSync.js":98,"./jsapi_mkdir.js":99,"./jsapi_mkdirSync.js":100,"./jsapi_operateSocketTask.js":101,"./jsapi_readFile.js":102,"./jsapi_readFileSync.js":103,"./jsapi_readdir.js":104,"./jsapi_readdirSync.js":105,"./jsapi_rmdir.js":106,"./jsapi_rmdirSync.js":107,"./jsapi_unlink.js":108,"./jsapi_unlinkSync.js":109,"./jsapi_writeFile.js":110,"./jsapi_writeFileSync.js":111};function i(e){return n(o(e))}function o(e){var t=r[e];if(!(t+1))throw new Error("Cannot find module '"+e+"'.");return t}i.keys=function(){return Object.keys(r)},i.resolve=o,e.exports=i,i.id=57},function(e,t,n){const r=n(23).access;e.exports=function(){this.ctrlIdx(382),this.invoke=function(e,t){return r(e,t,!1)}}},function(e,t,n){var r=n(60),i=process.cwd,o=null,s=process.env.GRACEFUL_FS_PLATFORM||process.platform;process.cwd=function(){return o||(o=i.call(process)),o};try{process.cwd()}catch(e){}var c=process.chdir;process.chdir=function(e){o=null,c.call(process,e)},e.exports=function(e){r.hasOwnProperty("O_SYMLINK")&&process.version.match(/^v0\.6\.[0-2]|^v0\.5\./)&&function(e){e.lchmod=function(t,n,i){e.open(t,r.O_WRONLY|r.O_SYMLINK,n,function(t,r){t?i&&i(t):e.fchmod(r,n,function(t){e.close(r,function(e){i&&i(t||e)})})})},e.lchmodSync=function(t,n){var i,o=e.openSync(t,r.O_WRONLY|r.O_SYMLINK,n),s=!0;try{i=e.fchmodSync(o,n),s=!1}finally{if(s)try{e.closeSync(o)}catch(e){}else e.closeSync(o)}return i}}(e);e.lutimes||function(e){r.hasOwnProperty("O_SYMLINK")?(e.lutimes=function(t,n,i,o){e.open(t,r.O_SYMLINK,function(t,r){t?o&&o(t):e.futimes(r,n,i,function(t){e.close(r,function(e){o&&o(t||e)})})})},e.lutimesSync=function(t,n,i){var o,s=e.openSync(t,r.O_SYMLINK),c=!0;try{o=e.futimesSync(s,n,i),c=!1}finally{if(c)try{e.closeSync(s)}catch(e){}else e.closeSync(s)}return o}):(e.lutimes=function(e,t,n,r){r&&process.nextTick(r)},e.lutimesSync=function(){})}(e);e.chown=o(e.chown),e.fchown=o(e.fchown),e.lchown=o(e.lchown),e.chmod=n(e.chmod),e.fchmod=n(e.fchmod),e.lchmod=n(e.lchmod),e.chownSync=c(e.chownSync),e.fchownSync=c(e.fchownSync),e.lchownSync=c(e.lchownSync),e.chmodSync=i(e.chmodSync),e.fchmodSync=i(e.fchmodSync),e.lchmodSync=i(e.lchmodSync),e.stat=a(e.stat),e.fstat=a(e.fstat),e.lstat=a(e.lstat),e.statSync=u(e.statSync),e.fstatSync=u(e.fstatSync),e.lstatSync=u(e.lstatSync),e.lchmod||(e.lchmod=function(e,t,n){n&&process.nextTick(n)},e.lchmodSync=function(){});e.lchown||(e.lchown=function(e,t,n,r){r&&process.nextTick(r)},e.lchownSync=function(){});"win32"===s&&(e.rename=(t=e.rename,function(n,r,i){var o=Date.now(),s=0;t(n,r,function c(a){if(a&&("EACCES"===a.code||"EPERM"===a.code)&&Date.now()-o<6e4)return setTimeout(function(){e.stat(r,function(e,o){e&&"ENOENT"===e.code?t(n,r,c):i(a)})},s),void(s<100&&(s+=10));i&&i(a)})}));var t;function n(t){return t?function(n,r,i){return t.call(e,n,r,function(e){l(e)&&(e=null),i&&i.apply(this,arguments)})}:t}function i(t){return t?function(n,r){try{return t.call(e,n,r)}catch(e){if(!l(e))throw e}}:t}function o(t){return t?function(n,r,i,o){return t.call(e,n,r,i,function(e){l(e)&&(e=null),o&&o.apply(this,arguments)})}:t}function c(t){return t?function(n,r,i){try{return t.call(e,n,r,i)}catch(e){if(!l(e))throw e}}:t}function a(t){return t?function(n,r){return t.call(e,n,function(e,t){if(!t)return r.apply(this,arguments);t.uid<0&&(t.uid+=4294967296),t.gid<0&&(t.gid+=4294967296),r&&r.apply(this,arguments)})}:t}function u(t){return t?function(n){var r=t.call(e,n);return r.uid<0&&(r.uid+=4294967296),r.gid<0&&(r.gid+=4294967296),r}:t}function l(e){if(!e)return!0;if("ENOSYS"===e.code)return!0;var t=!process.getuid||0!==process.getuid();return!(!t||"EINVAL"!==e.code&&"EPERM"!==e.code)}e.read=(h=e.read,function(t,n,r,i,o,s){var c;if(s&&"function"==typeof s){var a=0;c=function(u,l,f){if(u&&"EAGAIN"===u.code&&a<10)return a++,h.call(e,t,n,r,i,o,c);s.apply(this,arguments)}}return h.call(e,t,n,r,i,o,c)}),e.readSync=(f=e.readSync,function(t,n,r,i,o){for(var s=0;;)try{return f.call(e,t,n,r,i,o)}catch(e){if("EAGAIN"===e.code&&s<10){s++;continue}throw e}});var f;var h}},function(e,t){e.exports=require("constants")},function(e,t,n){var r=n(25).Stream;e.exports=function(e){return{ReadStream:function t(n,i){if(!(this instanceof t))return new t(n,i);r.call(this);var o=this;this.path=n;this.fd=null;this.readable=!0;this.paused=!1;this.flags="r";this.mode=438;this.bufferSize=65536;i=i||{};var s=Object.keys(i);for(var c=0,a=s.length;c<a;c++){var u=s[c];this[u]=i[u]}this.encoding&&this.setEncoding(this.encoding);if(void 0!==this.start){if("number"!=typeof this.start)throw TypeError("start must be a Number");if(void 0===this.end)this.end=1/0;else if("number"!=typeof this.end)throw TypeError("end must be a Number");if(this.start>this.end)throw new Error("start must be <= end");this.pos=this.start}if(null!==this.fd)return void process.nextTick(function(){o._read()});e.open(this.path,this.flags,this.mode,function(e,t){if(e)return o.emit("error",e),void(o.readable=!1);o.fd=t,o.emit("open",t),o._read()})},WriteStream:function t(n,i){if(!(this instanceof t))return new t(n,i);r.call(this);this.path=n;this.fd=null;this.writable=!0;this.flags="w";this.encoding="binary";this.mode=438;this.bytesWritten=0;i=i||{};var o=Object.keys(i);for(var s=0,c=o.length;s<c;s++){var a=o[s];this[a]=i[a]}if(void 0!==this.start){if("number"!=typeof this.start)throw TypeError("start must be a Number");if(this.start<0)throw new Error("start must be >= zero");this.pos=this.start}this.busy=!1;this._queue=[];null===this.fd&&(this._open=e.open,this._queue.push([this._open,this.path,this.flags,this.mode,void 0]),this.flush())}}}},function(e,t,n){"use strict";e.exports=function(e){if(null===e||"object"!=typeof e)return e;if(e instanceof Object)var t={__proto__:e.__proto__};else var t=Object.create(null);return Object.getOwnPropertyNames(e).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(e,n))}),t}},function(e,t,n){"use strict";const r=n(1),i=n(0),o=n(5).mkdirsSync,s=n(29).utimesMillisSync,c=Symbol("notExist");function a(e,t,n,o){if(!o.filter||o.filter(t,n))return function(e,t,n,o){const s=(o.dereference?r.statSync:r.lstatSync)(t);if(s.isDirectory())return function(e,t,n,i,o){if(t===c)return function(e,t,n,i){return r.mkdirSync(n),l(t,n,i),r.chmodSync(n,e.mode)}(e,n,i,o);if(t&&!t.isDirectory())throw new Error(`Cannot overwrite non-directory '${i}' with directory '${n}'.`);return l(n,i,o)}(s,e,t,n,o);if(s.isFile()||s.isCharacterDevice()||s.isBlockDevice())return function(e,t,n,i,o){return t===c?u(e,n,i,o):function(e,t,n,i){if(i.overwrite)return r.unlinkSync(n),u(e,t,n,i);if(i.errorOnExist)throw new Error(`'${n}' already exists`)}(e,n,i,o)}(s,e,t,n,o);if(s.isSymbolicLink())return function(e,t,n,o){let s=r.readlinkSync(t);o.dereference&&(s=i.resolve(process.cwd(),s));if(e===c)return r.symlinkSync(s,n);{let e;try{e=r.readlinkSync(n)}catch(e){if("EINVAL"===e.code||"UNKNOWN"===e.code)return r.symlinkSync(s,n);throw e}if(o.dereference&&(e=i.resolve(process.cwd(),e)),f(s,e))throw new Error(`Cannot copy '${s}' to a subdirectory of itself, '${e}'.`);if(r.statSync(n).isDirectory()&&f(e,s))throw new Error(`Cannot overwrite '${e}' with '${s}'.`);return function(e,t){return r.unlinkSync(t),r.symlinkSync(e,t)}(s,n)}}(e,t,n,o)}(e,t,n,o)}function u(e,t,i,o){return"function"==typeof r.copyFileSync?(r.copyFileSync(t,i),r.chmodSync(i,e.mode),o.preserveTimestamps?s(i,e.atime,e.mtime):void 0):function(e,t,i,o){const s=n(30)(65536),c=r.openSync(t,"r"),a=r.openSync(i,"w",e.mode);let u=0;for(;u<e.size;){const e=r.readSync(c,s,0,65536,u);r.writeSync(a,s,0,e),u+=e}o.preserveTimestamps&&r.futimesSync(a,e.atime,e.mtime);r.closeSync(c),r.closeSync(a)}(e,t,i,o)}function l(e,t,n){r.readdirSync(e).forEach(r=>(function(e,t,n,r){const o=i.join(t,e),s=i.join(n,e);return a(h(o,s),o,s,r)})(r,e,t,n))}function f(e,t){const n=i.resolve(e).split(i.sep),r=i.resolve(t).split(i.sep);return n.reduce((e,t,n)=>e&&r[n]===t,!0)}function h(e,t){const{srcStat:n,destStat:i}=function(e,t){const n=r.statSync(e);let i;try{i=r.statSync(t)}catch(e){if("ENOENT"===e.code)return{srcStat:n,destStat:c};throw e}return{srcStat:n,destStat:i}}(e,t);if(i.ino&&i.ino===n.ino)throw new Error("Source and destination must not be the same.");if(n.isDirectory()&&f(e,t))throw new Error(`Cannot copy '${e}' to a subdirectory of itself, '${t}'.`);return i}e.exports=function(e,t,n){"function"==typeof n&&(n={filter:n}),(n=n||{}).clobber=!("clobber"in n&&!n.clobber),n.overwrite="overwrite"in n?!!n.overwrite:n.clobber,n.preserveTimestamps&&"ia32"===process.arch&&console.warn("fs-extra: Using the preserveTimestamps option in 32-bit node is not recommended;\n\n    see https://github.com/jprichardson/node-fs-extra/issues/269");const s=h(e,t);if(n.filter&&!n.filter(e,t))return;const c=i.dirname(t);return r.existsSync(c)||o(c),a(s,e,t,n)}},function(e,t,n){"use strict";const r=n(1),i=n(0),o=n(28).invalidWin32Path,s=parseInt("0777",8);e.exports=function e(t,n,c,a){if("function"==typeof n?(c=n,n={}):n&&"object"==typeof n||(n={mode:n}),"win32"===process.platform&&o(t)){const e=new Error(t+" contains invalid WIN32 path characters.");return e.code="EINVAL",c(e)}let u=n.mode;const l=n.fs||r;void 0===u&&(u=s&~process.umask()),a||(a=null),c=c||function(){},t=i.resolve(t),l.mkdir(t,u,r=>{if(!r)return c(null,a=a||t);switch(r.code){case"ENOENT":if(i.dirname(t)===t)return c(r);e(i.dirname(t),n,(r,i)=>{r?c(r,i):e(t,n,c,i)});break;default:l.stat(t,(e,t)=>{e||!t.isDirectory()?c(r,a):c(null,a)})}})}},function(e,t,n){"use strict";const r=n(1),i=n(0),o=n(28).invalidWin32Path,s=parseInt("0777",8);e.exports=function e(t,n,c){n&&"object"==typeof n||(n={mode:n});let a=n.mode;const u=n.fs||r;if("win32"===process.platform&&o(t)){const e=new Error(t+" contains invalid WIN32 path characters.");throw e.code="EINVAL",e}void 0===a&&(a=s&~process.umask()),c||(c=null),t=i.resolve(t);try{u.mkdirSync(t,a),c=c||t}catch(r){if("ENOENT"===r.code){if(i.dirname(t)===t)throw r;e(t,n,c=e(i.dirname(t),n,c))}else{let e;try{e=u.statSync(t)}catch(e){throw r}if(!e.isDirectory())throw r}}return c}},function(e,t){e.exports=require("os")},function(e,t,n){"use strict";const r=n(1),i=n(0),o=n(5).mkdirs,s=n(7).pathExists,c=n(29).utimesMillis,a=Symbol("notExist");function u(e,t,n,r,c){const a=i.dirname(n);s(a,(i,s)=>i?c(i):s?f(e,t,n,r,c):void o(a,i=>i?c(i):f(e,t,n,r,c)))}function l(e,t,n,r,i,o){Promise.resolve(i.filter(n,r)).then(s=>s?t?e(t,n,r,i,o):e(n,r,i,o):o(),e=>o(e))}function f(e,t,n,r,i){return r.filter?l(h,e,t,n,r,i):h(e,t,n,r,i)}function h(e,t,n,o,s){(o.dereference?r.stat:r.lstat)(t,(c,u)=>c?s(c):u.isDirectory()?function(e,t,n,i,o,s){if(t===a)return function(e,t,n,i,o){r.mkdir(n,s=>{if(s)return o(s);y(t,n,i,t=>t?o(t):r.chmod(n,e.mode,o))})}(e,n,i,o,s);if(t&&!t.isDirectory())return s(new Error(`Cannot overwrite non-directory '${i}' with directory '${n}'.`));return y(n,i,o,s)}(u,e,t,n,o,s):u.isFile()||u.isCharacterDevice()||u.isBlockDevice()?function(e,t,n,i,o,s){return t===a?d(e,n,i,o,s):function(e,t,n,i,o){if(!i.overwrite)return i.errorOnExist?o(new Error(`'${n}' already exists`)):o();r.unlink(n,r=>r?o(r):d(e,t,n,i,o))}(e,n,i,o,s)}(u,e,t,n,o,s):u.isSymbolicLink()?function(e,t,n,o,s){r.readlink(t,(t,c)=>t?s(t):(o.dereference&&(c=i.resolve(process.cwd(),c)),e===a?r.symlink(c,n,s):void r.readlink(n,(t,a)=>t?"EINVAL"===t.code||"UNKNOWN"===t.code?r.symlink(c,n,s):s(t):(o.dereference&&(a=i.resolve(process.cwd(),a)),_(c,a)?s(new Error(`Cannot copy '${c}' to a subdirectory of itself, '${a}'.`)):e.isDirectory()&&_(a,c)?s(new Error(`Cannot overwrite '${a}' with '${c}'.`)):function(e,t,n){r.unlink(t,i=>i?n(i):r.symlink(e,t,n))}(c,n,s)))))}(e,t,n,o,s):void 0)}function d(e,t,n,i,o){return"function"==typeof r.copyFile?r.copyFile(t,n,t=>t?o(t):p(e,n,i,o)):function(e,t,n,i,o){const s=r.createReadStream(t);s.on("error",e=>o(e)).once("open",()=>{const t=r.createWriteStream(n,{mode:e.mode});t.on("error",e=>o(e)).on("open",()=>s.pipe(t)).once("close",()=>p(e,n,i,o))})}(e,t,n,i,o)}function p(e,t,n,i){r.chmod(t,e.mode,r=>r?i(r):n.preserveTimestamps?c(t,e.atime,e.mtime,i):i())}function y(e,t,n,i){r.readdir(e,(r,o)=>r?i(r):m(o,e,t,n,i))}function m(e,t,n,r,o){const s=e.pop();return s?function(e,t,n,r,o,s){const c=i.join(n,t),a=i.join(r,t);v(c,a,(t,i)=>{if(t)return s(t);f(i,c,a,o,t=>t?s(t):m(e,n,r,o,s))})}(e,s,t,n,r,o):o()}function _(e,t){const n=i.resolve(e).split(i.sep),r=i.resolve(t).split(i.sep);return n.reduce((e,t,n)=>e&&r[n]===t,!0)}function v(e,t,n){!function(e,t,n){r.stat(e,(e,i)=>{if(e)return n(e);r.stat(t,(e,t)=>e?"ENOENT"===e.code?n(null,{srcStat:i,destStat:a}):n(e):n(null,{srcStat:i,destStat:t}))})}(e,t,(r,i)=>{if(r)return n(r);const{srcStat:o,destStat:s}=i;return s.ino&&s.ino===o.ino?n(new Error("Source and destination must not be the same.")):o.isDirectory()&&_(e,t)?n(new Error(`Cannot copy '${e}' to a subdirectory of itself, '${t}'.`)):n(null,s)})}e.exports=function(e,t,n,r){"function"!=typeof n||r?"function"==typeof n&&(n={filter:n}):(r=n,n={}),r=r||function(){},(n=n||{}).clobber=!("clobber"in n&&!n.clobber),n.overwrite="overwrite"in n?!!n.overwrite:n.clobber,n.preserveTimestamps&&"ia32"===process.arch&&console.warn("fs-extra: Using the preserveTimestamps option in 32-bit node is not recommended;\n\n    see https://github.com/jprichardson/node-fs-extra/issues/269"),v(e,t,(i,o)=>i?r(i):n.filter?l(u,o,e,t,n,r):u(o,e,t,n,r))}},function(e,t,n){"use strict";const r=n(4).fromCallback,i=n(2),o=n(0),s=n(5),c=n(11),a=r(function(e,t){t=t||function(){},i.readdir(e,(n,r)=>{if(n)return s.mkdirs(e,t);r=r.map(t=>o.join(e,t)),function e(){const n=r.pop();if(!n)return t();c.remove(n,n=>{if(n)return t(n);e()})}()})});function u(e){let t;try{t=i.readdirSync(e)}catch(t){return s.mkdirsSync(e)}t.forEach(t=>{t=o.join(e,t),c.removeSync(t)})}e.exports={emptyDirSync:u,emptydirSync:u,emptyDir:a,emptydir:a}},function(e,t,n){"use strict";const r=n(1),i=n(0),o=n(26),s="win32"===process.platform;function c(e){["unlink","chmod","stat","lstat","rmdir","readdir"].forEach(t=>{e[t]=e[t]||r[t],e[t+="Sync"]=e[t]||r[t]}),e.maxBusyTries=e.maxBusyTries||3}function a(e,t,n){let r=0;"function"==typeof t&&(n=t,t={}),o(e,"rimraf: missing path"),o.strictEqual(typeof e,"string","rimraf: path should be a string"),o.strictEqual(typeof n,"function","rimraf: callback function required"),o(t,"rimraf: invalid options argument provided"),o.strictEqual(typeof t,"object","rimraf: options should be object"),c(t),u(e,t,function i(o){if(o){if(("EBUSY"===o.code||"ENOTEMPTY"===o.code||"EPERM"===o.code)&&r<t.maxBusyTries){return r++,setTimeout(()=>u(e,t,i),100*r)}"ENOENT"===o.code&&(o=null)}n(o)})}function u(e,t,n){o(e),o(t),o("function"==typeof n),t.lstat(e,(r,i)=>r&&"ENOENT"===r.code?n(null):r&&"EPERM"===r.code&&s?l(e,t,r,n):i&&i.isDirectory()?h(e,t,r,n):void t.unlink(e,r=>{if(r){if("ENOENT"===r.code)return n(null);if("EPERM"===r.code)return s?l(e,t,r,n):h(e,t,r,n);if("EISDIR"===r.code)return h(e,t,r,n)}return n(r)}))}function l(e,t,n,r){o(e),o(t),o("function"==typeof r),n&&o(n instanceof Error),t.chmod(e,438,i=>{i?r("ENOENT"===i.code?null:n):t.stat(e,(i,o)=>{i?r("ENOENT"===i.code?null:n):o.isDirectory()?h(e,t,n,r):t.unlink(e,r)})})}function f(e,t,n){let r;o(e),o(t),n&&o(n instanceof Error);try{t.chmodSync(e,438)}catch(e){if("ENOENT"===e.code)return;throw n}try{r=t.statSync(e)}catch(e){if("ENOENT"===e.code)return;throw n}r.isDirectory()?p(e,t,n):t.unlinkSync(e)}function h(e,t,n,r){o(e),o(t),n&&o(n instanceof Error),o("function"==typeof r),t.rmdir(e,s=>{!s||"ENOTEMPTY"!==s.code&&"EEXIST"!==s.code&&"EPERM"!==s.code?s&&"ENOTDIR"===s.code?r(n):r(s):function(e,t,n){o(e),o(t),o("function"==typeof n),t.readdir(e,(r,o)=>{if(r)return n(r);let s,c=o.length;if(0===c)return t.rmdir(e,n);o.forEach(r=>{a(i.join(e,r),t,r=>{if(!s)return r?n(s=r):void(0==--c&&t.rmdir(e,n))})})})}(e,t,r)})}function d(e,t){let n;c(t=t||{}),o(e,"rimraf: missing path"),o.strictEqual(typeof e,"string","rimraf: path should be a string"),o(t,"rimraf: missing options"),o.strictEqual(typeof t,"object","rimraf: options should be object");try{n=t.lstatSync(e)}catch(n){if("ENOENT"===n.code)return;"EPERM"===n.code&&s&&f(e,t,n)}try{n&&n.isDirectory()?p(e,t,null):t.unlinkSync(e)}catch(n){if("ENOENT"===n.code)return;if("EPERM"===n.code)return s?f(e,t,n):p(e,t,n);if("EISDIR"!==n.code)throw n;p(e,t,n)}}function p(e,t,n){o(e),o(t),n&&o(n instanceof Error);try{t.rmdirSync(e)}catch(r){if("ENOTDIR"===r.code)throw n;if("ENOTEMPTY"===r.code||"EEXIST"===r.code||"EPERM"===r.code)!function(e,t){if(o(e),o(t),t.readdirSync(e).forEach(n=>d(i.join(e,n),t)),!s){const n=t.rmdirSync(e,t);return n}{const n=Date.now();do{try{const n=t.rmdirSync(e,t);return n}catch(e){}}while(Date.now()-n<500)}}(e,t);else if("ENOENT"!==r.code)throw r}}e.exports=a,a.sync=d},function(e,t,n){"use strict";const r=n(71),i=n(72),o=n(73);e.exports={createFile:r.createFile,createFileSync:r.createFileSync,ensureFile:r.createFile,ensureFileSync:r.createFileSync,createLink:i.createLink,createLinkSync:i.createLinkSync,ensureLink:i.createLink,ensureLinkSync:i.createLinkSync,createSymlink:o.createSymlink,createSymlinkSync:o.createSymlinkSync,ensureSymlink:o.createSymlink,ensureSymlinkSync:o.createSymlinkSync}},function(e,t,n){"use strict";const r=n(4).fromCallback,i=n(0),o=n(1),s=n(5),c=n(7).pathExists;e.exports={createFile:r(function(e,t){function n(){o.writeFile(e,"",e=>{if(e)return t(e);t()})}o.stat(e,(r,o)=>{if(!r&&o.isFile())return t();const a=i.dirname(e);c(a,(e,r)=>e?t(e):r?n():void s.mkdirs(a,e=>{if(e)return t(e);n()}))})}),createFileSync:function(e){let t;try{t=o.statSync(e)}catch(e){}if(t&&t.isFile())return;const n=i.dirname(e);o.existsSync(n)||s.mkdirsSync(n),o.writeFileSync(e,"")}}},function(e,t,n){"use strict";const r=n(4).fromCallback,i=n(0),o=n(1),s=n(5),c=n(7).pathExists;e.exports={createLink:r(function(e,t,n){function r(e,t){o.link(e,t,e=>{if(e)return n(e);n(null)})}c(t,(a,u)=>a?n(a):u?n(null):void o.lstat(e,o=>{if(o)return o.message=o.message.replace("lstat","ensureLink"),n(o);const a=i.dirname(t);c(a,(i,o)=>i?n(i):o?r(e,t):void s.mkdirs(a,i=>{if(i)return n(i);r(e,t)}))}))}),createLinkSync:function(e,t){if(o.existsSync(t))return;try{o.lstatSync(e)}catch(e){throw e.message=e.message.replace("lstat","ensureLink"),e}const n=i.dirname(t);return o.existsSync(n)?o.linkSync(e,t):(s.mkdirsSync(n),o.linkSync(e,t))}}},function(e,t,n){"use strict";const r=n(4).fromCallback,i=n(0),o=n(1),s=n(5),c=s.mkdirs,a=s.mkdirsSync,u=n(74),l=u.symlinkPaths,f=u.symlinkPathsSync,h=n(75),d=h.symlinkType,p=h.symlinkTypeSync,y=n(7).pathExists;e.exports={createSymlink:r(function(e,t,n,r){r="function"==typeof n?n:r,n="function"!=typeof n&&n,y(t,(s,a)=>s?r(s):a?r(null):void l(e,t,(s,a)=>{if(s)return r(s);e=a.toDst,d(a.toCwd,n,(n,s)=>{if(n)return r(n);const a=i.dirname(t);y(a,(n,i)=>n?r(n):i?o.symlink(e,t,s,r):void c(a,n=>{if(n)return r(n);o.symlink(e,t,s,r)}))})}))}),createSymlinkSync:function(e,t,n){if(o.existsSync(t))return;const r=f(e,t);e=r.toDst,n=p(r.toCwd,n);const s=i.dirname(t);return o.existsSync(s)?o.symlinkSync(e,t,n):(a(s),o.symlinkSync(e,t,n))}}},function(e,t,n){"use strict";const r=n(0),i=n(1),o=n(7).pathExists;e.exports={symlinkPaths:function(e,t,n){if(r.isAbsolute(e))return i.lstat(e,t=>t?(t.message=t.message.replace("lstat","ensureSymlink"),n(t)):n(null,{toCwd:e,toDst:e}));{const s=r.dirname(t),c=r.join(s,e);return o(c,(t,o)=>t?n(t):o?n(null,{toCwd:c,toDst:e}):i.lstat(e,t=>t?(t.message=t.message.replace("lstat","ensureSymlink"),n(t)):n(null,{toCwd:e,toDst:r.relative(s,e)})))}},symlinkPathsSync:function(e,t){let n;if(r.isAbsolute(e)){if(!(n=i.existsSync(e)))throw new Error("absolute srcpath does not exist");return{toCwd:e,toDst:e}}{const o=r.dirname(t),s=r.join(o,e);if(n=i.existsSync(s))return{toCwd:s,toDst:e};if(!(n=i.existsSync(e)))throw new Error("relative srcpath does not exist");return{toCwd:e,toDst:r.relative(o,e)}}}}},function(e,t,n){"use strict";const r=n(1);e.exports={symlinkType:function(e,t,n){if(n="function"==typeof t?t:n,t="function"!=typeof t&&t)return n(null,t);r.lstat(e,(e,r)=>{if(e)return n(null,"file");t=r&&r.isDirectory()?"dir":"file",n(null,t)})},symlinkTypeSync:function(e,t){let n;if(t)return t;try{n=r.lstatSync(e)}catch(e){return"file"}return n&&n.isDirectory()?"dir":"file"}}},function(e,t,n){"use strict";const r=n(4).fromCallback,i=n(17);i.outputJson=r(n(78)),i.outputJsonSync=n(79),i.outputJSON=i.outputJson,i.outputJSONSync=i.outputJsonSync,i.writeJSON=i.writeJson,i.writeJSONSync=i.writeJsonSync,i.readJSON=i.readJson,i.readJSONSync=i.readJsonSync,e.exports=i},function(e,t,n){var r;try{r=n(1)}catch(e){r=n(2)}function i(e,t){var n,r="\n";return"object"==typeof t&&null!==t&&(t.spaces&&(n=t.spaces),t.EOL&&(r=t.EOL)),JSON.stringify(e,t?t.replacer:null,n).replace(/\n/g,r)+r}function o(e){return Buffer.isBuffer(e)&&(e=e.toString("utf8")),e=e.replace(/^\uFEFF/,"")}var s={readFile:function(e,t,n){null==n&&(n=t,t={}),"string"==typeof t&&(t={encoding:t});var i=(t=t||{}).fs||r,s=!0;"throws"in t&&(s=t.throws),i.readFile(e,t,function(r,i){if(r)return n(r);var c;i=o(i);try{c=JSON.parse(i,t?t.reviver:null)}catch(t){return s?(t.message=e+": "+t.message,n(t)):n(null,null)}n(null,c)})},readFileSync:function(e,t){"string"==typeof(t=t||{})&&(t={encoding:t});var n=t.fs||r,i=!0;"throws"in t&&(i=t.throws);try{var s=n.readFileSync(e,t);return s=o(s),JSON.parse(s,t.reviver)}catch(t){if(i)throw t.message=e+": "+t.message,t;return null}},writeFile:function(e,t,n,o){null==o&&(o=n,n={});var s=(n=n||{}).fs||r,c="";try{c=i(t,n)}catch(e){return void(o&&o(e,null))}s.writeFile(e,c,n,o)},writeFileSync:function(e,t,n){var o=(n=n||{}).fs||r,s=i(t,n);return o.writeFileSync(e,s,n)}};e.exports=s},function(e,t,n){"use strict";const r=n(0),i=n(5),o=n(7).pathExists,s=n(17);e.exports=function(e,t,n,c){"function"==typeof n&&(c=n,n={});const a=r.dirname(e);o(a,(r,o)=>r?c(r):o?s.writeJson(e,t,n,c):void i.mkdirs(a,r=>{if(r)return c(r);s.writeJson(e,t,n,c)}))}},function(e,t,n){"use strict";const r=n(1),i=n(0),o=n(5),s=n(17);e.exports=function(e,t,n){const c=i.dirname(e);r.existsSync(c)||o.mkdirsSync(c),s.writeJsonSync(e,t,n)}},function(e,t,n){"use strict";const r=n(1),i=n(0),o=n(27).copySync,s=n(11).removeSync,c=n(5).mkdirsSync,a=n(30);function u(e,t,n){return r.statSync(e).isDirectory()?function(e,t,n){const r={overwrite:!1};n?(s(t),i()):i();function i(){return o(e,t,r),s(e)}}(e,t,n):function(e,t,n){const i=a(65536),o=n?"w":"wx",s=r.openSync(e,"r"),c=r.fstatSync(s),u=r.openSync(t,o,c.mode);let l=0;for(;l<c.size;){const e=r.readSync(s,i,0,65536,l);r.writeSync(u,i,0,e),l+=e}return r.closeSync(s),r.closeSync(u),r.unlinkSync(e)}(e,t,n)}e.exports={moveSync:function e(t,n,o){const a=(o=o||{}).overwrite||o.clobber||!1;if(t=i.resolve(t),n=i.resolve(n),t===n)return r.accessSync(t);if(function(e,t){try{return r.statSync(e).isDirectory()&&e!==t&&t.indexOf(e)>-1&&t.split(i.dirname(e)+i.sep)[1].split(i.sep)[0]===i.basename(e)}catch(e){return!1}}(t,n))throw new Error(`Cannot move '${t}' into itself '${n}'.`);c(i.dirname(n)),function(){if(a)try{r.renameSync(t,n)}catch(r){if("ENOTEMPTY"===r.code||"EEXIST"===r.code||"EPERM"===r.code)return s(n),o.overwrite=!1,e(t,n,o);if("EXDEV"!==r.code)throw r;return u(t,n,a)}else try{r.linkSync(t,n),r.unlinkSync(t)}catch(e){if("EXDEV"===e.code||"EISDIR"===e.code||"EPERM"===e.code||"ENOTSUP"===e.code)return u(t,n,a);throw e}}()}}},function(e,t,n){"use strict";const r=n(4).fromCallback,i=n(1),o=n(0),s=n(31).copy,c=n(11).remove,a=n(5).mkdirp,u=n(7).pathExists;function l(e,t,n,r){i.rename(e,t,i=>i?"EXDEV"!==i.code?r(i):function(e,t,n,r){s(e,t,{overwrite:n,errorOnExist:!0},t=>t?r(t):c(e,r))}(e,t,n,r):r())}e.exports={move:r(function(e,t,n,r){"function"==typeof n&&(r=n,n={});const s=n.overwrite||n.clobber||!1;if(e=o.resolve(e),t=o.resolve(t),e===t)return i.access(e,r);i.stat(e,(n,i)=>n?r(n):i.isDirectory()&&function(e,t){const n=e.split(o.sep),r=t.split(o.sep);return n.reduce((e,t,n)=>e&&r[n]===t,!0)}(e,t)?r(new Error(`Cannot move '${e}' to a subdirectory of itself, '${t}'.`)):void a(o.dirname(t),n=>n?r(n):function(e,t,n,r){if(n)return c(t,i=>i?r(i):l(e,t,n,r));u(t,(i,o)=>i?r(i):o?r(new Error("dest already exists.")):l(e,t,n,r))}(e,t,s,r)))})}},function(e,t,n){"use strict";const r=n(4).fromCallback,i=n(1),o=n(0),s=n(5),c=n(7).pathExists;e.exports={outputFile:r(function(e,t,n,r){"function"==typeof n&&(r=n,n="utf8");const a=o.dirname(e);c(a,(o,c)=>o?r(o):c?i.writeFile(e,t,n,r):void s.mkdirs(a,o=>{if(o)return r(o);i.writeFile(e,t,n,r)}))}),outputFileSync:function(e,...t){const n=o.dirname(e);if(i.existsSync(n))return i.writeFileSync(e,...t);s.mkdirsSync(n),i.writeFileSync(e,...t)}}},function(e,t,n){const r=n(23).access;e.exports=function(){this.ctrlIdx(383),this.invoke=function(e,t){return r(e,t,!0)}}},function(e,t,n){const r=n(3).defGet;e.exports=function(){this.ctrlIdx(346),this.invoke=function(e,t){return console.log("node:JsApiCreateSocketTask dataStr:"+t),n(32).createClient(e,t.url,r(t,"header",{}),r(t,"protocols",[]),r(t,"__skipDomainCheck__",!1),r(t,"timeout",-1)),""}}},function(e,t,n){"use strict";const r=n(33);r.Server=n(92),r.Receiver=n(37),r.Sender=n(39),e.exports=r},function(e,t){e.exports=require("https")},function(e,t){e.exports=require("net")},function(e,t){e.exports=require("tls")},function(e,t,n){"use strict";function r(e){if(!(this instanceof r))return new r(e);e=e||{},this.concurrency=e.concurrency||1/0,this.pending=0,this.jobs=[],this.cbs=[],this._done=function(){this.pending--,this._run()}.bind(this)}["push","unshift","splice"].forEach(function(e){r.prototype[e]=function(){var t=Array.prototype[e].apply(this.jobs,arguments);return this._run(),t}}),Object.defineProperty(r.prototype,"length",{get:function(){return this.pending+this.jobs.length}}),r.prototype._run=function(){if(this.pending!==this.concurrency){if(this.jobs.length){var e=this.jobs.shift();this.pending++,e(this._done),this._run()}if(0===this.pending)for(;0!==this.cbs.length;){var t=this.cbs.pop();process.nextTick(t)}}},r.prototype.onDone=function(e){"function"==typeof e&&(this.cbs.push(e),this._run())},e.exports=r},function(e,t){e.exports=require("zlib")},function(e,t,n){"use strict";class r{constructor(e,t){this.target=t,this.type=e}}class i extends r{constructor(e,t){super("message",t),this.data=e}}class o extends r{constructor(e,t,n){super("close",n),this.wasClean=n._closeFrameReceived&&n._closeFrameSent,this.reason=t,this.code=e}}class s extends r{constructor(e){super("open",e)}}class c extends r{constructor(e,t){super("error",t),this.message=e.message,this.error=e}}const a={addEventListener(e,t){function n(e){t.call(this,new i(e,this))}function r(e,n){t.call(this,new o(e,n,this))}function a(e){t.call(this,new c(e,this))}function u(){t.call(this,new s(this))}"function"==typeof t&&("message"===e?(n._listener=t,this.on(e,n)):"close"===e?(r._listener=t,this.on(e,r)):"error"===e?(a._listener=t,this.on(e,a)):"open"===e?(u._listener=t,this.on(e,u)):this.on(e,t))},removeEventListener(e,t){const n=this.listeners(e);for(var r=0;r<n.length;r++)n[r]!==t&&n[r]._listener!==t||this.removeListener(e,n[r])}};e.exports=a},function(e,t,n){"use strict";const r=n(34),i=n(19),o=n(35),s=n(20),c=n(12),a=n(36),u=n(10),l=n(33);function f(){this.destroy()}function h(e,t,n,r){e.writable&&(n=n||o.STATUS_CODES[t],r=Object.assign({Connection:"close","Content-type":"text/html","Content-Length":Buffer.byteLength(n)},r),e.write(`HTTP/1.1 ${t} ${o.STATUS_CODES[t]}\r\n`+Object.keys(r).map(e=>`${e}: ${r[e]}`).join("\r\n")+"\r\n\r\n"+n)),e.removeListener("error",f),e.destroy()}e.exports=class extends r{constructor(e,t){if(super(),null==(e=Object.assign({maxPayload:104857600,perMessageDeflate:!1,handleProtocols:null,clientTracking:!0,verifyClient:null,noServer:!1,backlog:null,server:null,host:null,path:null,port:null},e)).port&&!e.server&&!e.noServer)throw new TypeError('One of the "port", "server", or "noServer" options must be specified');null!=e.port?(this._server=o.createServer((e,t)=>{const n=o.STATUS_CODES[426];t.writeHead(426,{"Content-Length":n.length,"Content-Type":"text/plain"}),t.end(n)}),this._server.listen(e.port,e.host,e.backlog,t)):e.server&&(this._server=e.server),this._server&&(this._removeListeners=function(e,t){for(const n of Object.keys(t))e.on(n,t[n]);return function(){for(const n of Object.keys(t))e.removeListener(n,t[n])}}(this._server,{listening:this.emit.bind(this,"listening"),error:this.emit.bind(this,"error"),upgrade:(e,t,n)=>{this.handleUpgrade(e,t,n,t=>{this.emit("connection",t,e)})}})),!0===e.perMessageDeflate&&(e.perMessageDeflate={}),e.clientTracking&&(this.clients=new Set),this.options=e}address(){if(this.options.noServer)throw new Error('The server is operating in "noServer" mode');return this._server?this._server.address():null}close(e){if(this.clients)for(const e of this.clients)e.terminate();const t=this._server;if(t&&(this._removeListeners(),this._removeListeners=this._server=null,null!=this.options.port))return t.close(e);e&&e()}shouldHandle(e){return!this.options.path||s.parse(e.url).pathname===this.options.path}handleUpgrade(e,t,n,r){t.on("error",f);const i=+e.headers["sec-websocket-version"],o={};if("GET"!==e.method||"websocket"!==e.headers.upgrade.toLowerCase()||!e.headers["sec-websocket-key"]||8!==i&&13!==i||!this.shouldHandle(e))return h(t,400);if(this.options.perMessageDeflate){const n=new c(this.options.perMessageDeflate,!0,this.options.maxPayload);try{const r=a.parse(e.headers["sec-websocket-extensions"]);r[c.extensionName]&&(n.accept(r[c.extensionName]),o[c.extensionName]=n)}catch(e){return h(t,400)}}if(this.options.verifyClient){const s={origin:e.headers[`${8===i?"sec-websocket-origin":"origin"}`],secure:!(!e.connection.authorized&&!e.connection.encrypted),req:e};if(2===this.options.verifyClient.length)return void this.options.verifyClient(s,(i,s,c,a)=>{if(!i)return h(t,s||401,c,a);this.completeUpgrade(o,e,t,n,r)});if(!this.options.verifyClient(s))return h(t,401)}this.completeUpgrade(o,e,t,n,r)}completeUpgrade(e,t,n,r,o){if(!n.readable||!n.writable)return n.destroy();const s=["HTTP/1.1 101 Switching Protocols","Upgrade: websocket","Connection: Upgrade",`Sec-WebSocket-Accept: ${i.createHash("sha1").update(t.headers["sec-websocket-key"]+u.GUID,"binary").digest("base64")}`],h=new l(null);var d=t.headers["sec-websocket-protocol"];if(d&&(d=d.trim().split(/ *, */),(d=this.options.handleProtocols?this.options.handleProtocols(d,t):d[0])&&(s.push(`Sec-WebSocket-Protocol: ${d}`),h.protocol=d)),e[c.extensionName]){const t=e[c.extensionName].params,n=a.format({[c.extensionName]:[t]});s.push(`Sec-WebSocket-Extensions: ${n}`),h._extensions=e}this.emit("headers",s,t),n.write(s.concat("\r\n").join("\r\n")),n.removeListener("error",f),h.setSocket(n,r,this.options.maxPayload),this.clients&&(this.clients.add(h),h.on("close",()=>this.clients.delete(h))),o(h)}}},function(e,t,n){const r=n(40).appendFile;e.exports=function(){this.ctrlIdx(461),this.invoke=function(e,t){return r(e,t,!1)}}},function(e,t,n){const r=n(40).appendFile;e.exports=function(){this.ctrlIdx(462),this.invoke=function(e,t){return r(e,t,!0)}}},function(e,t,n){const r=n(41).copyFile;e.exports=function(){this.ctrlIdx(399),this.invoke=function(e,t){return r(e,t,!1)}}},function(e,t,n){const r=n(41).copyFile;e.exports=function(){this.ctrlIdx(400),this.invoke=function(e,t){return r(e,t,!0)}}},function(e,t,n){const r=n(42).rename;e.exports=function(){this.ctrlIdx(397),this.invoke=function(e,t){return r(e,t,!1)}}},function(e,t,n){const r=n(42).rename;e.exports=function(){this.ctrlIdx(398),this.invoke=function(e,t){return r(e,t,!0)}}},function(e,t,n){const r=n(43).mkdir;e.exports=function(){this.ctrlIdx(374),this.invoke=function(e,t){return r(e,t,!1)}}},function(e,t,n){const r=n(43).mkdir;e.exports=function(){this.ctrlIdx(375),this.invoke=function(e,t){return r(e,t,!0)}}},function(e,t,n){const r=n(9);e.exports=function(){this.ctrlIdx(347),this.invoke=function(e,t){var i=n(32);const o=i.getClient(e,t.socketTaskId);if(null==o)return e.callback("fail:taskID not exist"),"";switch(t.operationType){case"send":if(e.reportIDKey(855,5),1!=o.readyState){console.warn("send readyState:"+o.readyState),e.reportIDKey(855,6),e.callback("fail");break}o.send(t.data),e.callback("ok");break;case"close":var s=t.code||r.NetWork.CLOSE_CODE_DEFAULT;if(1e3!=s&&!(s>=3e3&&s<5e3)){e.callback("fail:The code must be either 1000, or between 3000 and 4999");break}o.close(s,t.reason),i.removeClient(e,t.socketTaskId),e.callback("ok");break;default:e.callback("fail:unknown operationType")}return""}}},function(e,t,n){const r=n(44).readFile;e.exports=function(){this.ctrlIdx(233),this.invoke=function(e,t){return r(e,t,!1)}}},function(e,t,n){const r=n(44).readFile;e.exports=function(){this.ctrlIdx(378),this.invoke=function(e,t){return r(e,t,!0)}}},function(e,t,n){const r=n(45).readdir;e.exports=function(){this.ctrlIdx(376),this.invoke=function(e,t){return r(e,t,!1)}}},function(e,t,n){const r=n(45).readdir;e.exports=function(){this.ctrlIdx(377),this.invoke=function(e,t){return r(e,t,!0)}}},function(e,t,n){const r=n(46).rmdir;e.exports=function(){this.ctrlIdx(380),this.invoke=function(e,t){return r(e,t,!1)}}},function(e,t,n){const r=n(46).rmdir;e.exports=function(){this.ctrlIdx(381),this.invoke=function(e,t){return r(e,t,!0)}}},function(e,t,n){const r=n(47).unlink;e.exports=function(){this.ctrlIdx(384),this.invoke=function(e,t){return r(e,t,!1)}}},function(e,t,n){const r=n(47).unlink;e.exports=function(){this.ctrlIdx(385),this.invoke=function(e,t){return r(e,t,!0)}}},function(e,t,n){const r=n(48).writeFile;e.exports=function(){this.ctrlIdx(234),this.invoke=function(e,t){return r(e,t,!1)}}},function(e,t,n){const r=n(48).writeFile;e.exports=function(){this.ctrlIdx(379),this.invoke=function(e,t){return r(e,t,!0)}}}]);
}
