zhaoxiaoqiang
2021-05-17 b02540aef65fa1bc2af72cff2d7f444108a5865e
.tea/entryFiles-production/index$.worker.js
@@ -1,7 +1,31 @@
/**! __BUGME_START__ */ !function(){"use strict";var ERuntimeRemoteObjectType,ERuntimeRemoteObjectSubType;!function(e){e.Object="object",e.Function="function",e.Undefined="undefined",e.String="string",e.Number="number",e.Boolean="boolean",e.Symbol="Symbol",e.Bigint="bigint",e.Wasm="wasm"}(ERuntimeRemoteObjectType||(ERuntimeRemoteObjectType={})),function(e){e.Error="error",e.Array="array",e.Null="null"}(ERuntimeRemoteObjectSubType||(ERuntimeRemoteObjectSubType={}));var appxStackLine=/https:\/\/appx\/af-appx\.worker\.min\.js:\d+:\d+/,nativeScriptLine=/https:\/\/www\.alipay\.com\/?:\d+:\d+|\[native code\]/,pluginWorkerStackLine=/https:\/\/\d+\.hybrid\.\S+\.com\/__plugins__\/(\d+)\/index\.worker\.js:\d+:\d+/,appWorkerStackLine=/https:\/\/\d+\.hybrid\.\S+\.com\/index\.worker\.js:\d+:\d+/;function transformSourceUrl(e){try{return pluginWorkerStackLine.test(e)?e.replace(pluginWorkerStackLine,"Plugin-$1"):e.replace(appWorkerStackLine,"App")}catch(t){return e}}function formatStack(e){var t=e.split("\n"),n=t[0],s=t.slice(1).filter((function(e){return!appxStackLine.test(e)&&!nativeScriptLine.test(e)})).map(transformSourceUrl).map((function(e){return" "===e[0]?e:"    "+e}));return s.unshift(n),s.join("\n")}function error2RemoteObject(e){var t=e.name,n=e.message,s=e.stack;"string"!=typeof s&&(s=e.toString()),-1===s.indexOf(t)&&(s=e.toString()+"\n"+s);try{s=formatStack(s)}catch(e){}return{className:t,description:s,preview:{description:s,overflow:!1,properties:[{name:"stack",type:ERuntimeRemoteObjectType.String,value:s},{name:"message",type:ERuntimeRemoteObjectType.String,value:n}],subtype:ERuntimeRemoteObjectSubType.Error,type:ERuntimeRemoteObjectType.Object},subtype:ERuntimeRemoteObjectSubType.Error,type:ERuntimeRemoteObjectType.Object}}function isError(e){try{return"[object Error]"===Object.prototype.toString.call(e)}catch(e){return!1}}function getStartupParams(){if("undefined"!=typeof __appxStartupParams&&__appxStartupParams&&__appxStartupParams.appId)return __appxStartupParams;if("undefined"!=typeof my)try{return my.callSync("getStartupParams")||{}}catch(e){}return{}}var serverConfig={default:{domain:"hpmweb.alipay.com"},1:{domain:"hpmweb.alipay.com"}},ResponseEvent,RequestMethod,BreakStepType,FingerType;function getServerConfig(){var e=getStartupParams().remoteCh;return e&&serverConfig[e]?serverConfig[e]:serverConfig.default}!function(e){e.ById="Tyro.byId",e.Sticky="Tyro.sticky",e.StickyNotSendPaused="Tyro.stickyNotSendPaused",e.StickyAsync="Tyro.stickyAsync",e.ScriptSource="Tyro.scriptSource",e.Resumed="Debugger.resumed",e.ConsoleAPICalled="Runtime.consoleAPICalled"}(ResponseEvent||(ResponseEvent={})),function(e){e.DiscardConsoleEntries="Tyro.discardConsoleEntries",e.Evaluate="Tyro.evaluate",e.EvaluateOnCallFrame="Tyro.evaluateOnCallFrame",e.CallFunctionOn="Tyro.callFunctionOn",e.CompileScript="Tyro.compileScript",e.SetBreakpointsActive="Tyro.setBreakpointsActive",e.SetSkipAllPauses="Tyro.setSkipAllPauses",e.Resume="Tyro.resume",e.StepInto="Tyro.stepInto",e.StepOver="Tyro.stepOver",e.StepOut="Tyro.stepOut",e.Pause="Tyro.pause",e.GetPossibleBreakpoints="Tyro.getPossibleBreakpoints",e.SetBreakpointByUrl="Tyro.setBreakpointByUrl",e.SetBreakpoint="Tyro.setBreakpoint",e.RemoveBreakpoint="Tyro.removeBreakpoint",e.REPL="Tyro.repl",e.GetVariableValue="Tyro.getVariableValue",e.SetPauseOnExceptions="Tyro.setPauseOnExceptions",e.SetAsyncCallStackDepth="Tyro.setAsyncCallStackDepth",e.GetProperties="Tyro.getProperties"}(RequestMethod||(RequestMethod={})),function(e){e[e.Non=0]="Non",e[e.NextSticky=1]="NextSticky",e[e.StepOver=2]="StepOver",e[e.StepOut=3]="StepOut"}(BreakStepType||(BreakStepType={})),function(e){e[e.Entry=0]="Entry",e[e.Exit=1]="Exit"}(FingerType||(FingerType={}));var TyroUtil=function(){function e(){}return e.throwsMessage=function(e){return"[Throws: "+(e?e.message:"?")+"]"},e.safeGetValueFromPropertyOnObject=function(t,n){if(Object.prototype.hasOwnProperty.call(t,n))try{return t[n]}catch(t){return e.throwsMessage(t)}return t[n]},e.ensureProperties=function(t){var n=[];return function t(s){if(null===s||"object"!=typeof s)return s;if(-1!==n.indexOf(s))return"[Circular]";if(n.push(s),"function"==typeof s.toJSON)try{var r=t(s.toJSON());return n.pop(),r}catch(t){return e.throwsMessage(t)}if(Array.isArray(s)){var i=s.map(t);return n.pop(),i}var o=Object.keys(s).reduce((function(n,r){return n[r]=t(e.safeGetValueFromPropertyOnObject(s,r)),n}),{});return n.pop(),o}(t)},e.safeJSONStringify=function(t,n,s){return JSON.stringify(e.ensureProperties(t),n,s)},e.isWebIDE=function(){return!("undefined"==typeof navigator||!navigator)&&(navigator.swuserAgent||navigator.userAgent||"").indexOf("AlipayIDE")>-1},e}(),StickyFinger=function(){function StickyFinger(e,t,n,s){var r=this;this.isWebIDE=!1,this.asyncRequestMethod="tyroRequest",this.host=t,this.contextMap={},this.contextUrlMap={},this.breakpointMap={},this.breakpointIdMap={},this.debuggerMap={},this.objectMap={},this.originConsoleAPI={},this.requestTaskId=0,this.stickyMsgQueue=[],this.wsMsgQueue=[],this.wsIsOpen=!1,this.instrumentId=n,this.stickyFlag=s.stickyFlag,this.fingerFlag=s.fingerFlag,this.hookConsole(),this.stickyFlag&&(setTimeout((function(){r.socketTask=my.connectSocket({url:"wss://"+getServerConfig().domain+"/tyro/agent/"+r.instrumentId,multiple:!0});var e=function(){if(!r.wsIsOpen){r.originConsoleAPI.log("[tyro-agent] WebSocket 连接成功"),r.wsIsOpen=!0;for(var e=0,t=r.wsMsgQueue;e<t.length;e++){var n=t[e];r.socketTask.send({data:n})}r.wsMsgQueue=[]}};r.socketTask.onOpen((function(){e()})),r.socketTask.onClose((function(){r.originConsoleAPI.log("[tyro-agent] WebSocket 连接已关闭")})),r.socketTask.onMessage((function(t){r.wsIsOpen||e(),r.handleStickyAsync(JSON.parse(t.data.data))}))}),2e3),this.breakpointsActive=!0,this.skipAllPauses=!1,this.breakStepType=BreakStepType.Non,this.stackDepth=0,this.pauseOnExceptions="none",this.asyncCallStackDepth=0,this.lastStickyAsyncError=0,this.generateObjectId=0,this.globalExecutionContext=e,this.evaluateOnCallFrameExpression="",this.stickyNotSendPaused=!1,this.sendStickyParams=!1),this.fingerFlag&&(this.fingerId=0,this.fingerCache=[],this.fingerSendInterval=1e3,this.jsapiCallId=0,setInterval((function(){0!==r.fingerCache.length&&(r.sendPerf("Perf.trace",r.fingerCache),r.fingerCache=[])}),this.fingerSendInterval)),this.isWebIDE=TyroUtil.isWebIDE(),this.isWebIDE&&(this.asyncRequestMethod="tyroRequestAsync")}return StickyFinger.rewritePath=function(e){var t=e;return"."===t[0]&&(t=t.replace(".","")),t="app://"+(t=t.replace("tmp/data/build/",""))},StickyFinger.processRawContext=function(e){var t={path:this.rewritePath(e.path),contextId:String(e.contextId),scope:{0:[]},function:{},debuggerLine:e.debuggerLine,stickyLine:e.stickyLine};return e.scope&&Object.keys(e.scope).map((function(n){var s=e.scope[n],r=s.shift(),i=t.scope[r];t.scope[n]=i?i.concat(s.filter((function(e){return i.indexOf(e)<0}))):s})),e.function&&Object.keys(e.function).map((function(n){var s=e.function[n];t.function[n]={name:s[0],line:s[1]}})),t},StickyFinger.prototype.register=function(e,t){var n=String(e.contextId),s=StickyFinger.rewritePath(e.path);this.originConsoleAPI.log("[tyro-agent] register contextId "+n+" path "+s),this.contextMap[n]||this.breakpointMap[n]?this.originConsoleAPI.warn("[tyro-agent] duplicate context register "+n+" "+s):(this.contextMap[n]=StickyFinger.processRawContext(e),this.contextUrlMap[s]=n,this.breakpointMap[n]={},this.debuggerMap[n]=this.contextMap[n].debuggerLine.reduce((function(e,t){return e[t-1]=!0,e}),{}),this.stickyFlag&&this.xhrSend(ResponseEvent.ScriptSource,{scriptSource:t,scriptId:String(n),executionContextId:0,url:s}))},StickyFinger.prototype.sticky=function(e,t,n){if(!this.skipAllPauses&&this.breakpointsActive&&((this.debuggerMap[e]||{})[t]||(this.breakpointMap[e]||{})[t]||this.breakStepType===BreakStepType.NextSticky||this.breakStepType===BreakStepType.StepOver&&(new Error).stack.split("\n").length<=this.stackDepth||this.breakStepType===BreakStepType.StepOut&&(new Error).stack.split("\n").length<this.stackDepth||!0===this.sendStickyParams)){this.originConsoleAPI.log("[tyro-agent] sticky "+e+" "+t),this.breakStepType=BreakStepType.Non;var s={};if(this.stickyNotSendPaused)this.originConsoleAPI.log("[tyro-agent] stickyNotSendPaused");else{if(!this.sendStickyParams){this.originConsoleAPI.log("[tyro-agent] sticky sendStickyParams step 1"),s={callFrames:null,reason:"other",hitBreakpoints:[]};var r=this.breakpointMap[e][t];r&&s.hitBreakpoints.push(r);var i=(new Error).stack.split("\n");return this.stackDepth=i.length,Agent.isPhone?s.callFrames=this.processCallFramesPhone(String(e),t,n,i):s.callFrames=this.processCallFrames(String(e),t,n,i),this.stickyParams=s,this.sendStickyParams=!0,"(() => {\n          const localObject = {};\n          for (const key of Agent.getScopeVariables()) {\n            localObject[key] = (() => {try{return eval(key)}catch(e){return undefined}})();\n          }\n          Agent.inflateStickyParamsObject(localObject);\n          return true;\n        })()"}this.originConsoleAPI.log("[tyro-agent] sticky sendStickyParams step 2"),s=this.stickyParams,this.sendStickyParams=!1}this.originConsoleAPI.log("[tyro-agent] sticky params "+TyroUtil.safeJSONStringify(s));var o=JSON.parse(this.xhrSend(ResponseEvent.Sticky,s));return this.handleSticky(o)}},StickyFinger.prototype.fingerEntry=function(e,t){var n=this.contextMap[e].path,s=this.contextMap[e].function[t],r=this.generateFingerId(),i={time:Date.now(),file:n,line:s.line,name:s.name,id:r,type:FingerType.Entry};return this.fingerCache.push(i),r},StickyFinger.prototype.fingerExit=function(e,t,n){var s=this.contextMap[e].path,r=this.contextMap[e].function[t],i={time:Date.now(),file:s,line:r.line,name:r.name,id:n,type:FingerType.Exit};this.fingerCache.push(i)},StickyFinger.prototype.sendPerf=function(e,t){self.bugmeAPI?self.bugmeAPI.send({method:e,params:t}):self.document?self.document.addEventListener("bugmeInjected",(function(){self.bugmeAPI.send({method:e,params:t})})):self.addEventListener&&self.addEventListener("bugmeInjected",(function(){self.bugmeAPI.send({method:e,params:t})}))},StickyFinger.prototype.hookConsole=function(){var e=this;this.originConsoleAPI.log=console.log.bind(console),this.originConsoleAPI.debug=console.debug.bind(console),this.originConsoleAPI.info=console.info.bind(console),this.originConsoleAPI.error=console.error.bind(console),this.originConsoleAPI.warn=console.warn.bind(console),console.log=function(){for(var t,n=[],s=0;s<arguments.length;s++)n[s]=arguments[s];if((t=e.originConsoleAPI).log.apply(t,n),!(n.length>0&&"string"==typeof n[0]&&(n[0].indexOf("[framework]")>=0||n[0].indexOf("dispatchEvent")>=0||n[0].indexOf("onMessage push")>=0))){var r={type:"log",args:n.map((function(t){return e.objectToRemoteObject(t,null,"object"==typeof t)})),executionContextId:0,timestamp:(new Date).getTime()};e.xhrSend(ResponseEvent.ConsoleAPICalled,r,null,!1)}},console.debug=function(){for(var t,n=[],s=0;s<arguments.length;s++)n[s]=arguments[s];if((t=e.originConsoleAPI).debug.apply(t,n),!(n.length>0&&"string"==typeof n[0]&&(n[0].indexOf("[framework]")>=0||n[0].indexOf("dispatchEvent")>=0||n[0].indexOf("onMessage push")>=0))){var r={type:"debug",args:n.map((function(t){return e.objectToRemoteObject(t,null,"object"==typeof t)})),executionContextId:0,timestamp:(new Date).getTime()};e.xhrSend(ResponseEvent.ConsoleAPICalled,r,null,!1)}},console.info=function(){for(var t,n=[],s=0;s<arguments.length;s++)n[s]=arguments[s];if((t=e.originConsoleAPI).info.apply(t,n),!(n.length>0&&"string"==typeof n[0]&&(n[0].indexOf("[framework]")>=0||n[0].indexOf("dispatchEvent")>=0||n[0].indexOf("onMessage push")>=0))){var r={type:"info",args:n.map((function(t){return e.objectToRemoteObject(t,null,"object"==typeof t)})),executionContextId:0,timestamp:(new Date).getTime()};e.xhrSend(ResponseEvent.ConsoleAPICalled,r,null,!1)}},console.error=function(){for(var t,n=[],s=0;s<arguments.length;s++)n[s]=arguments[s];if((t=e.originConsoleAPI).error.apply(t,n),!(n.length>0&&"string"==typeof n[0]&&(n[0].indexOf("[framework]")>=0||n[0].indexOf("dispatchEvent")>=0||n[0].indexOf("onMessage push")>=0))){var r={type:"error",args:n.map((function(t){return e.objectToRemoteObject(t,null,"object"==typeof t)})),executionContextId:0,timestamp:(new Date).getTime()};e.xhrSend(ResponseEvent.ConsoleAPICalled,r,null,!1)}},console.warn=function(){for(var t,n=[],s=0;s<arguments.length;s++)n[s]=arguments[s];if((t=e.originConsoleAPI).warn.apply(t,n),!(n.length>0&&"string"==typeof n[0]&&(n[0].indexOf("[framework]")>=0||n[0].indexOf("dispatchEvent")>=0||n[0].indexOf("onMessage push")>=0))){var r={type:"warning",args:n.map((function(t){return e.objectToRemoteObject(t,null,"object"==typeof t)})),executionContextId:0,timestamp:(new Date).getTime()};e.xhrSend(ResponseEvent.ConsoleAPICalled,r,null,!1)}}},StickyFinger.prototype.inflateStickyParamsObject=function(e){if(0!==this.stickyParams.callFrames.length){this.generateObjectId+=1;var t=String(this.generateObjectId);this.objectMap[t]=e,this.stickyParams.callFrames[0].scopeChain.push({type:"local",name:this.stickyParams.callFrames[0].functionName,object:{className:"Object",description:"Object",objectId:t,type:"object"}})}},StickyFinger.prototype.processCallFrames=function(e,t,n,s){var r=this,i=[],o=s.slice(3,s.length).map((function(e){return e.substr(0,e.lastIndexOf(":")).replace("    at ","").replace(" (",":")})),a=0,c=!0;return o.map((function(t){var s=t.split(":"),o=s[0],p=r.contextMap[e].path,u=Number(s[s.length-1]),l=r.contextUrlMap[p]||"none",y=a+":"+u+":"+p;c&&(r.scopeVariables=void 0!==r.contextMap[e]?r.contextMap[e].scope[n]:[],c=!1);var h={callFrameId:y,functionName:o,location:{scriptId:l,lineNumber:u,columnNumber:0},url:p,scopeChain:[],this:{}};i.push(h),a+=1})),i},StickyFinger.prototype.processCallFramesPhone=function(e,t,n,s){var r=this,i=[],o=s.slice(2,s.length).map((function(e){return e.substr(0,e.lastIndexOf(":")).replace("    at ","").replace(" (",":").replace("@",":")})),a=0,c=!0;return o.map((function(s){var o=s.split(":"),p=o[0],u=r.contextMap[e].path,l=Number(o[o.length-1]),y=r.contextUrlMap[u]||"none",h=a+":"+l+":"+u;c&&(r.scopeVariables=void 0!==r.contextMap[e]?r.contextMap[e].scope[n]:[],r.originConsoleAPI.log("scopeVariables "+TyroUtil.safeJSONStringify(r.scopeVariables)),r.originConsoleAPI.log("scopeVariables "+TyroUtil.safeJSONStringify(r.contextMap[e])+" "+r.contextMap[e].scope+" "+n),c=!1);var d={callFrameId:h,functionName:p,location:{scriptId:y,lineNumber:t,columnNumber:0},url:u,scopeChain:[],this:{}};i.push(d),a+=1})),i},StickyFinger.prototype.stickyAsyncLoop=function(){this.xhrSend(ResponseEvent.StickyAsync,{})},StickyFinger.prototype.xhrSendJSAPI=function(e,t,n,s){var r,i=this;if(e===ResponseEvent.Sticky){var o;this.stickyMsgQueue.length>0?(this.stickyMsgQueue.push({method:this.stickyNotSendPaused?ResponseEvent.StickyNotSendPaused:ResponseEvent.Sticky,params:t}),o=TyroUtil.safeJSONStringify(this.stickyMsgQueue),this.stickyMsgQueue=[]):o=TyroUtil.safeJSONStringify({method:this.stickyNotSendPaused?ResponseEvent.StickyNotSendPaused:ResponseEvent.Sticky,params:t}),my.call("showRemoteDebugMask",{text:" ",buttonTitle:"断点命中",hide:!1}),this.stickyNotSendPaused=!1;var a=Date.now(),c=my.callSync("tyroRequest",{url:this.host+"/tyro/agent",method:"POST",headers:{"Content-Type":"application/json;charset=UTF-8","instrument-id":this.instrumentId},data:o,timeout:6e5,blockTimeout:6e5,dataType:"json",requestTaskId:this.requestTaskId++});return my.call("showRemoteDebugMask",{hide:!0}),c.error||null===c?(null===c?this.originConsoleAPI.error("[tyro-agent] xhrSend error result is "+c):this.originConsoleAPI.error("[tyro-agent] xhrSend error "+c.error+" "+c.errorMessage),Date.now()-a>=5e3?this.xhrSendJSAPI(e,t,n,s):TyroUtil.safeJSONStringify({method:"default"})):200!==c.status?(this.originConsoleAPI.error("[tyro-agent] xhrSend status fail "+e+" "+c.status),TyroUtil.safeJSONStringify({method:"default"})):c.data}if(e===ResponseEvent.StickyAsync){var p=TyroUtil.safeJSONStringify({method:ResponseEvent.StickyAsync,params:t});this.originConsoleAPI.info("[tyro-agent] xhrSend async send "+p),my.call(this.asyncRequestMethod,{url:this.host+"/tyro/agent",method:"POST",headers:{"Content-Type":"application/json;charset=UTF-8","instrument-id":this.instrumentId},data:p,timeout:6e5,dataType:"json",requestTaskId:this.requestTaskId++,success:function(e){i.lastStickyAsyncError=0,i.stickyAsyncLoop(),200===e.status?(i.originConsoleAPI.info("[tyro-agent] xhrSend async success "+e.status+" "+e.data),i.handleStickyAsync(JSON.parse(e.data))):i.originConsoleAPI.error("[tyro-agent] xhrSend async fail "+e.status+" "+e.data)},fail:function(e){i.lastStickyAsyncError>=3?setTimeout((function(){i.stickyAsyncLoop()}),3e3):(i.lastStickyAsyncError+=1,i.stickyAsyncLoop()),i.originConsoleAPI.error("[tyro-agent] xhrSend async error "+TyroUtil.safeJSONStringify(e))}})}switch(e){case ResponseEvent.ById:r={id:n,result:t};break;case ResponseEvent.ScriptSource:r={method:ResponseEvent.ScriptSource,params:t};break;case ResponseEvent.Resumed:r={method:ResponseEvent.Resumed,params:t};break;case ResponseEvent.ConsoleAPICalled:r={method:ResponseEvent.ConsoleAPICalled,params:t};break;default:return}s?this.stickyMsgQueue.push(r):this.wsIsOpen?this.socketTask.send({data:TyroUtil.safeJSONStringify(r)}):this.wsMsgQueue.push(TyroUtil.safeJSONStringify(r))},StickyFinger.prototype.xhrSend=function(e,t,n,s){var r=this;if(Agent.isPhone)return this.xhrSendJSAPI(e,t,n,s);var i,o=new XMLHttpRequest;if(e===ResponseEvent.Sticky){var a;if(o.open("POST",this.host+"/tyro/agent",!1),o.setRequestHeader("Content-Type","application/json;charset=UTF-8"),o.setRequestHeader("instrument-id",this.instrumentId),this.stickyMsgQueue.length>0){this.stickyMsgQueue.push({method:this.stickyNotSendPaused?ResponseEvent.StickyNotSendPaused:ResponseEvent.Sticky,params:t});try{a=TyroUtil.safeJSONStringify(this.stickyMsgQueue)}catch(e){this.originConsoleAPI.error(e),a=TyroUtil.safeJSONStringify({method:this.stickyNotSendPaused?ResponseEvent.StickyNotSendPaused:ResponseEvent.Sticky,params:t})}finally{this.stickyMsgQueue=[]}}else a=TyroUtil.safeJSONStringify({method:this.stickyNotSendPaused?ResponseEvent.StickyNotSendPaused:ResponseEvent.Sticky,params:t});if(this.stickyNotSendPaused=!1,o.send(a),200===o.status)return o.responseText;throw new Error("[sticky-finger] xhrSend error "+e+" "+o.status)}if(e===ResponseEvent.StickyAsync)return o.open("POST",this.host+"/tyro/agent",!0),o.setRequestHeader("Content-Type","application/json;charset=UTF-8"),o.setRequestHeader("instrument-id",this.instrumentId),o.onload=function(){if(r.lastStickyAsyncError=0,r.stickyAsyncLoop(),4!==o.readyState||200!==o.status)throw new Error("[tyro-agent] xhrSend async fail "+e+" "+o.readyState+" "+o.status);r.handleStickyAsync(JSON.parse(o.responseText))},o.onerror=function(){throw r.lastStickyAsyncError>=3?setTimeout((function(){r.stickyAsyncLoop()}),3e3):(r.lastStickyAsyncError+=1,r.stickyAsyncLoop()),new Error("[tyro-agent] xhrSend async error "+e+" "+o.readyState+" "+o.status)},void o.send(TyroUtil.safeJSONStringify({method:ResponseEvent.StickyAsync,params:t}));switch(o.open("POST",this.host+"/tyro/agent",!0),o.setRequestHeader("Content-Type","application/json;charset=UTF-8"),o.setRequestHeader("instrument-id",this.instrumentId),o.onload=function(){if(4!==o.readyState||200!==o.status)throw new Error("[tyro-agent] xhrSend async fail "+e+" "+o.readyState+" "+o.status)},o.onerror=function(){throw new Error("[tyro-agent] xhrSend async error "+e+" "+o.readyState+" "+o.status)},e){case ResponseEvent.ById:i={id:n,result:t};break;case ResponseEvent.ScriptSource:i={method:ResponseEvent.ScriptSource,params:t};break;case ResponseEvent.Resumed:i={method:ResponseEvent.Resumed,params:t};break;case ResponseEvent.ConsoleAPICalled:i={method:ResponseEvent.ConsoleAPICalled,params:t};break;default:return}s?this.stickyMsgQueue.push(i):o.send(TyroUtil.safeJSONStringify(i))},StickyFinger.prototype.handleSticky=function(e){var t=e.id,n=e.method,s=e.params;switch(n){case RequestMethod.DiscardConsoleEntries:return this.stickyNotSendPaused=!0,this.originConsoleAPI.log("[tyro-agent] DiscardConsoleEntries success"),"(()=>{return true})()";case RequestMethod.CallFunctionOn:return this.stickyNotSendPaused=!0,this.originConsoleAPI.log("[tyro-agent] CallFunctionOn TODO sticky"),"(()=>{return true})()";case RequestMethod.CompileScript:return this.stickyNotSendPaused=!0,this.originConsoleAPI.log("[tyro-agent] CompileScript success, "+TyroUtil.safeJSONStringify(s)),"(()=>{return true})()";case RequestMethod.SetBreakpointsActive:return this.stickyNotSendPaused=!0,this.breakpointsActive=s.active,this.originConsoleAPI.log("[tyro-agent] SetBreakpointsActive success, breakpointsActive "+this.breakpointsActive),this.breakStepType=BreakStepType.NextSticky,"(()=>{return true})()";case RequestMethod.SetSkipAllPauses:return this.stickyNotSendPaused=!0,this.skipAllPauses=s.skip,this.originConsoleAPI.log("[tyro-agent] SetSkipAllPauses success, skipAllPauses "+this.skipAllPauses),this.breakStepType=BreakStepType.NextSticky,"(()=>{return true})()";case RequestMethod.Resume:return this.xhrSend(ResponseEvent.Resumed,{}),this.originConsoleAPI.log("[tyro-agent] Resume success"),"(()=>{return false})()";case RequestMethod.StepInto:return this.xhrSend(ResponseEvent.Resumed,{}),this.breakStepType=BreakStepType.NextSticky,this.originConsoleAPI.log("[tyro-agent] StepInto success"),"(()=>{return false})()";case RequestMethod.StepOver:return this.xhrSend(ResponseEvent.Resumed,{}),this.breakStepType=BreakStepType.StepOver,this.originConsoleAPI.log("[tyro-agent] StepOver success"),"(()=>{return false})()";case RequestMethod.StepOut:return this.xhrSend(ResponseEvent.Resumed,{}),this.breakStepType=BreakStepType.StepOut,this.originConsoleAPI.log("[tyro-agent] StepOut success"),"(()=>{return false})()";case RequestMethod.GetPossibleBreakpoints:return this.stickyNotSendPaused=!0,this.getPossibleBreakpoints(t,s,!0),this.breakStepType=BreakStepType.NextSticky,"(()=>{return true})()";case RequestMethod.SetBreakpointByUrl:return this.stickyNotSendPaused=!0,this.setBreakpointByUrl(t,s,!0),this.breakStepType=BreakStepType.NextSticky,"(()=>{return true})()";case RequestMethod.SetBreakpoint:return this.stickyNotSendPaused=!0,this.setBreakpoint(t,s,!0),this.breakStepType=BreakStepType.NextSticky,"(()=>{return true})()";case RequestMethod.RemoveBreakpoint:return this.stickyNotSendPaused=!0,this.removeBreakpoint(t,s),this.breakStepType=BreakStepType.NextSticky,"(()=>{return true})()";case RequestMethod.REPL:return this.stickyNotSendPaused=!0,this.breakStepType=BreakStepType.NextSticky,"(()=>{(()=>{"+s.statement+"})();return true})()";case RequestMethod.GetVariableValue:this.stickyNotSendPaused=!0;var r=e.params;return this.breakStepType=BreakStepType.NextSticky,"(()=>{(()=>{\n          Agent.variableValue({"+r.map((function(e){return e+": (() => {try{return "+e+"}catch(e){return undefined}})()"})).join(",")+"})\n        })();return true})()";case RequestMethod.SetPauseOnExceptions:return this.stickyNotSendPaused=!0,this.setPauseOnExceptions(t,s),this.breakStepType=BreakStepType.NextSticky,"(()=>{return true})()";case RequestMethod.SetAsyncCallStackDepth:return this.stickyNotSendPaused=!0,this.setAsyncCallStackDepth(t,s),this.breakStepType=BreakStepType.NextSticky,"(()=>{return true})()";case RequestMethod.EvaluateOnCallFrame:return this.stickyNotSendPaused=!0,this.evaluateOnCallFrameExpression=s.expression,this.breakStepType=BreakStepType.NextSticky,"(()=>{\n          let tyroRet,tyroErr;\n          try{tyroRet=eval(Agent.getEvaluateOnCallFrameExpression())}\n          catch(e){tyroErr=e}\n          Agent.evaluateOnCallFrame("+t+",tyroRet,tyroErr,"+s.generatePreview+");\n          return true;\n        })()";case RequestMethod.GetProperties:return this.stickyNotSendPaused=!0,this.getProperties(t,s,!0),this.breakStepType=BreakStepType.NextSticky,"(()=>{return true})()";default:return this.breakStepType=BreakStepType.NextSticky,"(()=>{return true})()"}},StickyFinger.prototype.handleStickyAsync=function(e){var t=e.id,n=e.method,s=e.params;switch(this.originConsoleAPI.log("[tyro-agent] handleStickyAsync "+t+", "+n+", "+s),n){case RequestMethod.DiscardConsoleEntries:this.originConsoleAPI.log("[tyro-agent] DiscardConsoleEntries success");break;case RequestMethod.Evaluate:this.originConsoleAPI.log("[tyro-agent] Evaluate start, expression "+s.expression);var r=this.evaluate(this.globalExecutionContext,t,s);this.originConsoleAPI.log("[tyro-agent] Evaluate success, expression "+s.expression+", result "+TyroUtil.safeJSONStringify(r));break;case RequestMethod.CallFunctionOn:this.originConsoleAPI.log("[tyro-agent] CallFunctionOn TODO stickyAsync");break;case RequestMethod.CompileScript:this.originConsoleAPI.log("[tyro-agent] CompileScript success, params "+TyroUtil.safeJSONStringify(s));break;case RequestMethod.SetBreakpointsActive:this.breakpointsActive=s.active,this.originConsoleAPI.log("[tyro-agent] SetBreakpointsActive success, breakpointsActive "+this.breakpointsActive);break;case RequestMethod.SetSkipAllPauses:this.skipAllPauses=s.skip,this.originConsoleAPI.log("[tyro-agent] SetSkipAllPauses success, skipAllPauses "+this.skipAllPauses);break;case RequestMethod.Pause:this.breakStepType=BreakStepType.NextSticky,this.originConsoleAPI.log("[tyro-agent] Pause success");break;case RequestMethod.GetPossibleBreakpoints:this.getPossibleBreakpoints(t,s);break;case RequestMethod.SetBreakpointByUrl:this.setBreakpointByUrl(t,s);break;case RequestMethod.SetBreakpoint:this.setBreakpoint(t,s);break;case RequestMethod.RemoveBreakpoint:this.removeBreakpoint(t,s);break;case RequestMethod.SetPauseOnExceptions:this.setPauseOnExceptions(t,s);break;case RequestMethod.SetAsyncCallStackDepth:this.setAsyncCallStackDepth(t,s);break;case RequestMethod.GetProperties:this.getProperties(t,s)}},StickyFinger.prototype.objectToRemoteObject=function(e,t,n){var s={};if(isError(e)&&(t=e),t)return error2RemoteObject(t);switch(s.type=typeof e,s.type){case"undefined":break;case"object":if(null===e){s.subtype="null",s.value=null;break}if(void 0!==e.constructor&&(s.className=e.constructor.name),void 0!==e.toString)try{s.description=e.toString()}catch(e){s.description="[object Object]"}else s.description="[object Object]";if(this.generateObjectId+=1,s.objectId=String(this.generateObjectId),this.objectMap[String(this.generateObjectId)]=e,n)for(var r in s.preview={type:"object",description:"Object",overflow:!1,properties:[]},e){var i=typeof e[r];s.preview.properties.push({name:r,type:i,value:"object"===i?"Object":"function"===i?"":e[r]})}break;case"function":s.description=e.toString(),s.className="Function";break;default:s.value=e,s.description=e.toString()}return s},StickyFinger.prototype.evaluateOnCallFrame=function(e,t,n,s){var r=this.objectToRemoteObject(t,n,s);return this.xhrSend(ResponseEvent.ById,{result:r},e,!0),r},StickyFinger.prototype.evaluate=function(executionContext,id,params){var returnValue,error;try{returnValue=function(expression){return"function"==typeof eval?eval(expression):Agent.evalReference(expression)}.call(executionContext,params.expression)}catch(e){error=e}var result=this.objectToRemoteObject(returnValue,error,params.generatePreview);return this.xhrSend(ResponseEvent.ById,{result:result},id),result},StickyFinger.prototype.getPossibleBreakpoints=function(e,t,n){var s=t.scriptId,r=t.startLine,i=t.endLine===t.startLine?t.endLine+1:t.endLine,o={locations:[]};if(this.contextMap[s])for(var a=this.contextMap[s].stickyLine,c=r;c<i;c++)a.includes(c)&&o.locations.push({scriptId:s,lineNumber:c,columnNumber:0});else this.originConsoleAPI.warn("[tyro-agent] getPossibleBreakpoints no scriptId "+s+" in contextMap");this.originConsoleAPI.log("[tyro-agent] getPossibleBreakpoints success, result: "+TyroUtil.safeJSONStringify(o)),this.xhrSend(ResponseEvent.ById,o,e,n)},StickyFinger.prototype.setBreakpointByUrl=function(e,t,n){var s=t.scriptId,r=t.url,i=t.lineNumber;if(this.contextMap[s])if(this.contextMap[s].stickyLine.includes(i)){var o=s+":"+i+":0:"+r,a={breakpointId:o,locations:[{scriptId:s,lineNumber:i,columnNumber:0}]};this.breakpointMap[s][i]=o,this.breakpointIdMap[o]={contextId:s,line:i},this.originConsoleAPI.log("[tyro-agent] setBreakpointByUrl success, scriptId: "+s+", url: "+r+", lineNumber: "+i),this.xhrSend(ResponseEvent.ById,a,e,n)}else this.originConsoleAPI.warn("[tyro-agent] setBreakpointByUrl not sticky line, scriptId: "+s+", url: "+r+", lineNumber: "+i);else this.originConsoleAPI.warn("[tyro-agent] setBreakpointByUrl no contextMap, scriptId: "+s)},StickyFinger.prototype.setBreakpoint=function(e,t,n){var s=t.scriptId,r=t.lineNumber;if(this.contextMap[s])if(this.contextMap[s].stickyLine.includes(r)){var i=s+":"+r+":0",o={breakpointId:i,actualLocation:{scriptId:s,lineNumber:r,columnNumber:0}};this.breakpointMap[s][r]=i,this.breakpointIdMap[i]={contextId:s,line:r},this.originConsoleAPI.log("[tyro-agent] setBreakpoint success, scriptId: "+s+", lineNumber: "+r),this.xhrSend(ResponseEvent.ById,o,e,n)}else this.originConsoleAPI.warn("[tyro-agent] setBreakpoint not sticky line, scriptId: "+s+", lineNumber: "+r);else this.originConsoleAPI.warn("[tyro-agent] setBreakpoint no contextMap, scriptId: "+s)},StickyFinger.prototype.removeBreakpoint=function(e,t){var n=t.breakpointId,s=this.breakpointIdMap[n];s||this.originConsoleAPI.warn("[tyro-agent] removeBreakpoint no breakpointId "+n);var r=s.contextId,i=s.line;delete this.breakpointMap[r][i],this.originConsoleAPI.log("[tyro-agent] removeBreakpoint success, breakpointId: "+n+", scriptId: "+r+", line: "+i)},StickyFinger.prototype.setPauseOnExceptions=function(e,t){t&&["none","uncaught","all"].includes(t.state)?(this.pauseOnExceptions=t.state,this.originConsoleAPI.log("[tyro-agent] setPauseOnExceptions success, pauseOnExceptions state "+this.pauseOnExceptions)):this.originConsoleAPI.warn("[tyro-agent] setPauseOnExceptions state invalid: "+TyroUtil.safeJSONStringify(t))},StickyFinger.prototype.setAsyncCallStackDepth=function(e,t){!t||"number"!=typeof t.maxDepth||t.maxDepth<0?this.originConsoleAPI.warn("[tyro-agent] setAsyncCallStackDepth maxDepth invalid: "+TyroUtil.safeJSONStringify(t)):(this.asyncCallStackDepth=t.maxDepth,this.originConsoleAPI.log("[tyro-agent] setAsyncCallStackDepth success, maxDepth "+this.asyncCallStackDepth))},StickyFinger.prototype.getProperties=function(e,t,n){var s=t.objectId,r=this.objectMap[s],i=[];for(var o in r)i.push({name:o,value:this.objectToRemoteObject(r[o])});this.xhrSend(ResponseEvent.ById,{result:i},e,n)},StickyFinger.prototype.generateFingerId=function(){return this.fingerId+=1,this.fingerId},StickyFinger}(),Agent=function(){function e(t,n){if(e.singleton)return e.singleton;this.host="https://"+getServerConfig().domain,this.stickyFinger=new StickyFinger("undefined"!=typeof window?window:self,this.host,t,n)}return e.getShadowMethod=function(){this.globalReference=self,"function"==typeof eval?this.evalReference=eval:"function"==typeof __eval&&(this.evalReference=__eval)},e.setShadowMethod=function(){this.globalReference.eval=this.evalReference},e.setInstrumentId=function(e){this.instrumentId=e},e.register=function(t,n){if(!e.singleton){if(!this.instrumentId&&"undefined"!=typeof my)try{this.instrumentId=getStartupParams().tyroId}catch(e){}e.instance(this.instrumentId,t)}e.singleton.stickyFinger.register(t,n)},e.sticky=function(t,n,s){return e.singleton.stickyFinger.sticky(t,n,s)},e.getEvaluateOnCallFrameExpression=function(){return e.singleton.stickyFinger.evaluateOnCallFrameExpression},e.evaluateOnCallFrame=function(t,n,s,r){return e.singleton.stickyFinger.evaluateOnCallFrame(t,n,s,r)},e.getScopeVariables=function(){return e.singleton.stickyFinger.scopeVariables},e.inflateStickyParamsObject=function(t){return e.singleton.stickyFinger.inflateStickyParamsObject(t)},e.entry=function(t,n){return e.singleton.stickyFinger.fingerEntry(t,n)},e.exit=function(t,n,s){e.singleton.stickyFinger.fingerExit(t,n,s)},e.instance=function(t,n){e.singleton=new e(t,n)},e.isPhone=!0,e.instrumentId=null,e}();Agent.getShadowMethod();var globalReference="undefined"!=typeof window?window:self;globalReference.Agent||(globalReference.StickyFinger=StickyFinger,globalReference.Agent=Agent)}();
/*BUGME_START*/
const __BUGME_START__ = 1;
!function(e){var t={};function n(o){if(t[o])return t[o].exports;var r=t[o]={i:o,l:!1,exports:{}};return e[o].call(r.exports,r,r.exports,n),r.l=!0,r.exports}n.m=e,n.c=t,n.d=function(e,t,o){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:o})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var o=Object.create(null);if(n.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)n.d(o,r,function(t){return e[t]}.bind(null,r));return o},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=43)}({0:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e.Connect="RemoteX.connect",e.Disconnect="RemoteX.disconnect",e.PageChanged="RemoteX.pageChanged",e.DataChanged="RemoteX.dataChanged",e.EvaluteScript="RemoteX.evaluteScript",e.RegisterChannel="RemoteX.registerChannel",e.PassByWorker="RemoteX.PassByWorker",e.syncStorage="RemoteX.syncStorage",e.setStorage="RemoteX.setStorage",e.removeStorage="RemoteX.removeStoarge",e.requestWillBeSent="RemoteX.requestWillBeSent",e.requestFinished="RemoteX.requestFinished",e.ExitApp="RemoteX.exitApp",e.Ping="RemoteX.ping",e.Pong="RemoteX.pong",e.PerfTrace="Perf.trace",e.NativeTrace="Perf.native",e.NetworkTrace="Perf.network",e.JsapiTrace="Perf.jsapi"}(t.RemoteXMethods||(t.RemoteXMethods={}))},1:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getUserAgent=function(){return navigator.swuserAgent||navigator.userAgent||""},t.checkIOS=function(){return/\(i[^;]+;( U;)? CPU.+Mac OS X/.test(t.getUserAgent())};var o=self.AlipayJSBridge&&self.AlipayJSBridge.call,r=self.fetch;t.callInternalAPI=function(e,t){var n={data:{method:e,param:t},action:"internalAPI"},s=encodeURIComponent(JSON.stringify(n));r?r("https://alipay.kylinBridge/?data="+s,{mode:"no-cors"}).then((function(){})).catch((function(){})):o&&o("internalAPI",{method:e,param:t})},t.getStartupParams=function(){return self.__appxStartupParams||{}},t.getBridge=function(){return self.AFAppX.bridge},t.debug=console.log,t.waitForAppx=function(e){self.AFAppX?e():setTimeout((function(){t.waitForAppx(e)}),50)};var s=Function;t.executeScript=function(e){return new s("var res = "+e+"; return res;")()}},11:function(e,t){
/*!
Copyright (C) 2013-2017 by Andrea Giammarchi - @WebReflection
!function(e){var t={};function n(o){if(t[o])return t[o].exports;var r=t[o]={i:o,l:!1,exports:{}};return e[o].call(r.exports,r,r.exports,n),r.l=!0,r.exports}n.m=e,n.c=t,n.d=function(e,t,o){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:o})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var o=Object.create(null);if(n.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)n.d(o,r,function(t){return e[t]}.bind(null,r));return o},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=43)}({0:function(module,exports,__webpack_require__){"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var originalBridgeCall=self.AlipayJSBridge&&self.AlipayJSBridge.call,originalFetch=self.fetch,originImportScripts=self.importScripts,originEval="function"==typeof self.__eval?self.__eval:self.eval;exports.getUserAgent=function(){return navigator.swuserAgent||navigator.userAgent||""},exports.debug=console.log.bind(console),exports.checkIOS=function(){return/\(i[^;]+;( U;)? CPU.+Mac OS X/.test(exports.getUserAgent())},exports.isLyra=function(){return Boolean(self.__LyraWSWorkerOrigin)},exports.callInternalAPI=function(e,t){var n={data:{method:e,param:t},action:"internalAPI"},o=encodeURIComponent(JSON.stringify(n));originalFetch?originalFetch("https://alipay.kylinBridge/?data="+o,{mode:"no-cors"}).then((function(){})).catch((function(){})):originalBridgeCall&&originalBridgeCall("internalAPI",{method:e,param:t})},exports.getStartupParams=function(){return self.__appxStartupParams&&self.__appxStartupParams.appId?self.__appxStartupParams:self.AFAppX&&self.AFAppX.bridge&&self.AFAppX.bridge.callSync&&self.AFAppX.bridge.callSync("getStartupParams")||{}},exports.getBridge=function(){return self.AFAppX.bridge};var appxImported=!1,appxImportListener=[];exports.runAfterAppx=function(e){if(self.AFAppX)return appxImported=!0,void e();self.importScripts=function(e){originImportScripts(e),!appxImported&&/af-appx\.worker\.min\.js$/.test(e)&&(appxImported=!0,appxImportListener.forEach((function(e){return e()})),appxImportListener=[])},appxImportListener.push(e)},exports.evaluateScript=function(expression){return"function"==typeof eval?eval(expression):"function"==typeof originEval?(self.eval=originEval,eval(expression)):void 0}},11:function(e,t){var n="\\x"+("0"+"~".charCodeAt(0).toString(16)).slice(-2),o="\\"+n,r=new RegExp(n,"g"),s=new RegExp(o,"g"),a=new RegExp("(?:^|([^\\\\]))"+o),i=[].indexOf||function(e){for(var t=this.length;t--&&this[t]!==e;);return t},c=String;function u(e,t,n){return t instanceof Array?function(e,t,n){for(var o=0,r=t.length;o<r;o++)t[o]=u(e,t[o],n);return t}(e,t,n):t instanceof c?t.length?n.hasOwnProperty(t)?n[t]:n[t]=function(e,t){for(var n=0,o=t.length;n<o;e=e[t[n++].replace(s,"~")]);return e}(e,t.split("~")):e:t instanceof Object?function(e,t,n){for(var o in t)t.hasOwnProperty(o)&&(t[o]=u(e,t[o],n));return t}(e,t,n):t}var l={stringify:function(e,t,s,a){return l.parser.stringify(e,function(e,t,s){var a,c,u=!1,l=!!t,p=[],f=[e],d=[e],g=[s?"~":"[Circular]"],m=e,h=1;return l&&(c="object"==typeof t?function(e,n){return""!==e&&t.indexOf(e)<0?void 0:n}:t),function(e,t){return l&&(t=c.call(this,e,t)),u?(m!==this&&(a=h-i.call(f,this)-1,h-=a,f.splice(h,f.length),p.splice(h-1,p.length),m=this),"object"==typeof t&&t?(i.call(f,t)<0&&f.push(m=t),h=f.length,(a=i.call(d,t))<0?(a=d.push(t)-1,s?(p.push((""+e).replace(r,n)),g[a]="~"+p.join("~")):g[a]=g[0]):t=g[a]):"string"==typeof t&&s&&(t=t.replace(n,o).replace("~",n))):u=!0,t}}(e,t,!a),s)},parse:function(e,t){return l.parser.parse(e,function(e){return function(t,r){var s="string"==typeof r;return s&&"~"===r.charAt(0)?new c(r.slice(1)):(""===t&&(r=u(r,r,{})),s&&(r=r.replace(a,"$1~").replace(o,n)),e?e.call(this,t,r):r)}}(t))},parser:JSON};e.exports=l},2:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e.Connect="RemoteX.connect",e.Disconnect="RemoteX.disconnect",e.PageChanged="RemoteX.pageChanged",e.DataChanged="RemoteX.dataChanged",e.EvaluteScript="RemoteX.evaluteScript",e.syncStorage="RemoteX.syncStorage",e.requestWillBeSent="RemoteX.requestWillBeSent",e.requestFinished="RemoteX.requestFinished",e.Ping="RemoteX.ping",e.Pong="RemoteX.pong"}(t.RemoteXMethods||(t.RemoteXMethods={}))},43:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o=n(44),r=n(47),s=n(48),a=n(0);a.runAfterAppx((function(){setTimeout((function(){a.debug("[bugme] run after appx"),a.getStartupParams().isRemoteX||a.isLyra()?(a.debug("[bugme] remotex mode"),o.registerRemoteX()):(a.debug("[bugme] preview mode"),s.registerPreview())}),1e3)}));try{r.initAppXHook()}catch(e){console.error(e)}},44:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o=n(6),r=n(0),s=n(45);t.registerRemoteX=function(){if(self.navigator){r.debug("[bugme] start to register remotex"),s.listenEvents(),o.SocketConn.open(),self.bugmeAPI={send:function(e){o.SocketConn.send(e)}};if(self.document&&self.document.dispatchEvent)try{self.document.dispatchEvent("bugmeInjected")}catch(e){self.document.dispatchEvent(new CustomEvent("bugmeInjected"))}else self.dispatchEvent&&self.dispatchEvent(new CustomEvent("bugmeInjected"))}}},45:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o=n(2),r=n(0),s=n(6),a=n(46);function i(e){if(!e||"object"!=typeof e)return{};var t={};return Object.keys(e).forEach((function(n){t[n]=""+e[n]})),t}var c=/^https?:\/\/hpmweb\.alipay\.com/,u=function(e){c.test(e.url)||s.SocketConn.send({method:o.RemoteXMethods.requestWillBeSent,params:{reqId:e.requestId,url:e.url,method:(e.method||"GET").toUpperCase(),body:e.postBody,headers:i(e.headers)}})},l=function(e){c.test(e.url)||s.SocketConn.send({method:o.RemoteXMethods.requestFinished,params:{reqId:e.requestId,url:e.url,status:e.status,body:e.body,headers:i(e.headers)}})},p=function(e){c.test(e.url)||s.SocketConn.send({method:o.RemoteXMethods.requestFinished,params:{reqId:e.requestId,url:e.url,status:null}})},f=function(e){var t={};Object.keys(e.data).forEach((function(n){try{t[n]=JSON.parse(e.data[n]).APDataStorage}catch(e){}})),s.SocketConn.send({method:o.RemoteXMethods.syncStorage,params:{data:t}})};t.listenEvents=function(){var e=r.getBridge();e.on(a.ERiverWorkerEvent.PageResume,(function(){s.SocketConn.send({method:o.RemoteXMethods.PageChanged})})),e.on(a.ERiverWorkerEvent.DebugPanelClick,(function(){s.SocketConn.close()})),r.checkIOS()&&!r.isLyra()?(e.on(a.ERiverDebugEvent.networkRequest,(function(e){var t=e.data;u(t)})),e.on(a.ERiverDebugEvent.networkResponse,(function(e){var t=e.data;l(t)})),e.on(a.ERiverDebugEvent.networkError,(function(e){var t=e.data;p(t)})),e.on(a.ERiverDebugEvent.storageChanged,(function(e){var t=e.data;f(t)}))):e.on(a.ERiverDebugEvent.debugConsole,(function(e){var t,n=e.data,o=n.type,r=n.content;try{t=JSON.parse(r)}catch(e){return}switch(o){case a.ERiverDebugEvent.networkRequest:u(t);break;case a.ERiverDebugEvent.networkResponse:l(t);break;case a.ERiverDebugEvent.networkError:p(t);break;case a.ERiverDebugEvent.storageChanged:f(t)}}))}},46:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e.networkRequest="tinyAppRemoteDebug_network_request",e.networkResponse="tinyAppRemoteDebug_network_response",e.networkError="tinyAppRemoteDebug_network_error",e.storageChanged="tinyAppRemoteDebug_storage",e.debugConsole="onTinyDebugConsole",e.vconsoleMessage="onMessageFromVConsole"}(t.ERiverDebugEvent||(t.ERiverDebugEvent={})),function(e){e.PageResume="pageResume",e.DebugPanelClick="tinyRemoteDebugPanelButtonClick"}(t.ERiverWorkerEvent||(t.ERiverWorkerEvent={}))},47:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o=n(6),r=null;t.initAppXHook=function(){var e=self.__APPX_DEVTOOLS_GLOBAL_HOOK__,t={};e&&Object.assign(t,e),t.onSetData=function(t){if(e&&e.onSetData)try{e.onSetData(t)}catch(e){console.error(e)}o.SocketConn.socketTask&&(clearTimeout(r),r=setTimeout((function(){o.SocketConn.send({method:"RemoteX.dataChanged"})}),300))},t.onSetDataCallback=function(t){e&&e.onSetDataCallback&&e.onSetDataCallback(t)},self.__APPX_DEVTOOLS_GLOBAL_HOOK__=t}},48:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o=n(11),r=n(0),s=function(e,t){return void 0===t?"©undefined":null===t?"©null":t===-1/0?"©- Infinity":t===1/0?"©Infinity":"number"==typeof t&&isNaN(t)?"©NaN":"function"==typeof t?"©function":t},a=Function,i=function(e){try{if(e.fromVConsoleToWorker){var t=e.requestId;if("exec"===e.method){try{new a("requestId","sendBack","var res = "+e.script+";console.log(res);")(t,(function(e){return r.callInternalAPI("tinyDebugConsole",{type:"msgFromWorkerToVConsole",content:o.stringify({requestId:t,returnValue:e},s)})}))}catch(e){console.error(e.name+":"+e.message)}}}}catch(e){}};t.registerPreview=function(){setTimeout((function(){self.document?self.document.addEventListener("push",(function(e){try{var t=e.data.param;i(JSON.parse(t.content||t.data.content))}catch(e){}})):self.addEventListener&&self.addEventListener("push",(function(e){try{var t=JSON.parse(JSON.parse(e.data.text()).param.data.content);i(t)}catch(e){}}))}),10),["log","info","error","debug","warn"].forEach((function(e){var t="o"+e;console[t]||(console[t]=console[e],console[e]=function(){for(var n,a=[],i=0;i<arguments.length;i++)a[i]=arguments[i];console[t].apply(console,a);try{n=o.stringify(a.map((function(e){return e instanceof Error?e.name+": "+e.message:e})),s)}catch(e){return void console.error(e.name+": "+e.message)}r.callInternalAPI("tinyDebugConsole",{content:n,type:"console_"+e})})}))}},5:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.wssConfig={default:{openchannel:"openchannel.alipay.com",hpmweb:"hpmweb.alipay.com"},1:{openchannel:"miniprogram.alipay.com",hpmweb:"hpmweb.alipay.com"}}},6:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o=n(11),r=n(0),s=n(2),a=n(5),i=function(){r.getBridge().call("showRemoteDebugPanel",{status:"connecting",text:"远程调试准备中",buttonTitle:"退出"})},c=function(){r.getBridge().call("showRemoteDebugPanel",{status:"connected",text:"远程调试已连接",buttonTitle:"退出"})},u=function(){r.getBridge().call("showRemoteDebugPanel",{status:"disconnected",text:"远程调试已断开",buttonTitle:"退出"})};t.SocketConn={messageQueue:[],socketTask:null,send:function(e){var t=this,n="string"==typeof e?e:JSON.stringify(e);n.length>5242880?r.debug("[bugme] socket send failed, size: ",n.length):this.socketTask?(this.messageQueue.length&&(this.messageQueue.forEach((function(e){t.socketTask.send({data:e})})),this.messageQueue=[]),this.socketTask.send({data:n})):this.messageQueue.push(n)},close:function(){this.socketTask?this.socketTask.close():r.getBridge().showToast({content:"请点击右上角关闭按钮退出",duration:1e3})},connect:function(e){var t=this,n=r.getBridge(),o=n.connectSocket({url:e,multiple:!0}),s=function(){t.socketTask||(t.socketTask=o,t.onopen(),r.debug("[bugme] websocket connected"))};o.onOpen((function(){s()})),o.onMessage((function(e){t.socketTask||s(),t.onmessage(e)})),o.onClose((function(){t.onclose()})),o.onError((function(){t.socketTask||(u(),n.showToast({content:"本次真机调试已结束,请重新生成调试版本",duration:2e3}))}))},open:function(){var e=this,t=r.getStartupParams(),n=t.channelId,o=t.channelAuthPair,s=t.remoteCh,c=self.__LyraWSWorkerOrigin;if(n||c){i();var u=a.wssConfig.default.openchannel;s&&a.wssConfig[s]&&a.wssConfig[s].openchannel&&(u=a.wssConfig[s].openchannel);var l=r.getBridge(),p=c?c+"/worker":"wss://"+u+"/group/connect/"+n+"?scene=tinyAppDebug&roleType=TINYAPP&roleId=0";if(o&&(p+="?"+o.key+"="+o.value),r.checkIOS()&&!r.isLyra()){this.connect(p);var f=l.connectSocket;l.connectSocket=function(e){if(e&&e.multiple)return f(e);l.showToast({content:"iOS 真机调试暂不支持 connectSocket JSAPI",duration:1e3})},l.onSocketOpen=l.offSocketOpen=l.onSocketMessage=l.offSocketMessage=l.closeSocket=function(){}}else setTimeout((function(){e.connect(p)}),1200)}else r.debug("[bugme] missing channelId in startup params")},onopen:function(){var e=r.getBridge(),t=e.getSystemInfoSync();this.send({method:s.RemoteXMethods.Connect,params:{userAgent:r.getUserAgent(),sdkVersion:e.SDKVersion,alipayVersion:t.version,model:t.model,system:t.system}}),c()},onmessage:function(e){try{var t=JSON.parse(e.data.data),n=t.method,a=t.id,i=t.params;if(n===s.RemoteXMethods.Disconnect)this.close();else if(n===s.RemoteXMethods.EvaluteScript){if(i&&i.code)try{var c=r.evaluateScript(i.code);this.send({returnId:a,payload:o.stringify(c)})}catch(e){r.debug("[remoteX worker evaluateScript] ",e)}}else n===s.RemoteXMethods.Ping&&this.send({method:s.RemoteXMethods.Pong,params:{returnId:a}})}catch(t){r.debug("RemoteX onSocketMessage error",t,e)}},onclose:function(){this.socketTask=null,this.messageQueue=[],u(),[1,2].forEach((function(e){r.getBridge().call("closeSocket",{socketTaskId:e})}))}}}}); /**! __BUGME_END__ */
if(!self.__appxInited) {
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
*/
var n="\\x"+("0"+"~".charCodeAt(0).toString(16)).slice(-2),o="\\"+n,r=new RegExp(n,"g"),s=new RegExp(o,"g"),a=new RegExp("(?:^|([^\\\\]))"+o),i=[].indexOf||function(e){for(var t=this.length;t--&&this[t]!==e;);return t},c=String;function u(e,t,n){return t instanceof Array?function(e,t,n){for(var o=0,r=t.length;o<r;o++)t[o]=u(e,t[o],n);return t}(e,t,n):t instanceof c?t.length?n.hasOwnProperty(t)?n[t]:n[t]=function(e,t){for(var n=0,o=t.length;n<o;e=e[t[n++].replace(s,"~")]);return e}(e,t.split("~")):e:t instanceof Object?function(e,t,n){for(var o in t)t.hasOwnProperty(o)&&(t[o]=u(e,t[o],n));return t}(e,t,n):t}var l={stringify:function(e,t,s,a){return l.parser.stringify(e,function(e,t,s){var a,c,u=!1,l=!!t,d=[],f=[e],g=[e],h=[s?"~":"[Circular]"],p=e,m=1;return l&&(c="object"==typeof t?function(e,n){return""!==e&&t.indexOf(e)<0?void 0:n}:t),function(e,t){return l&&(t=c.call(this,e,t)),u?(p!==this&&(a=m-i.call(f,this)-1,m-=a,f.splice(m,f.length),d.splice(m-1,d.length),p=this),"object"==typeof t&&t?(i.call(f,t)<0&&f.push(p=t),m=f.length,(a=i.call(g,t))<0?(a=g.push(t)-1,s?(d.push((""+e).replace(r,n)),h[a]="~"+d.join("~")):h[a]=h[0]):t=h[a]):"string"==typeof t&&s&&(t=t.replace(n,o).replace("~",n))):u=!0,t}}(e,t,!a),s)},parse:function(e,t){return l.parser.parse(e,function(e){return function(t,r){var s="string"==typeof r;return s&&"~"===r.charAt(0)?new c(r.slice(1)):(""===t&&(r=u(r,r,{})),s&&(r=r.replace(a,"$1~").replace(o,n)),e?e.call(this,t,r):r)}}(t))},parser:JSON};e.exports=l},4:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o=n(5),r=n(0),s=n(1);t.ChannelPot={_activeViewId:null,_map:{},get:function(e){return this._map[e]||null},set:function(e,t){this._map[e]=t},remove:function(e){delete this._map[e]},setActiveId:function(e){this._activeViewId=e},sendToMainChannel:function(e){o.SocketConn.send(e)},sendToActiveChannel:function(e){this.get(this._activeViewId)?this.get(this._activeViewId).postMessage(e):s.debug("[bugme] missing active channel",e,this._activeViewId)}};var a=function(){function e(e){var t=this;this._port=e,this._port.onmessage=this.onMessage,Object.defineProperty(e,"onmessage",{get:function(){return t.onMessage},set:function(){}})}return e.prototype.onMessage=function(e){if(e.data){var n=e.data,o=n.method,s=n.params;o===r.RemoteXMethods.PassByWorker&&t.ChannelPot.sendToMainChannel(s)}},e.prototype.postMessage=function(e){this._port.postMessage(e)},e}();t.ChannelHandler=a},43:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o=n(44),r=n(47),s=n(1);s.getStartupParams().isRemoteX?s.waitForAppx(o.registerRemoteX):r.registerPreview()},44:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o=n(4),r=n(5),s=n(1),a=n(0),i=n(45);t.registerRemoteX=function(){if(self.addEventListener&&self.navigator){s.debug("[bugme] start to register remotex"),i.listenEvents(),r.SocketConn.open(),self.addEventListener("message",(function(e){if(e&&e.data){var t=e.data;if(t.method===a.RemoteXMethods.RegisterChannel){var n=e.ports[0],r=String(t.params.viewId);o.ChannelPot.set(r,new o.ChannelHandler(n)),o.ChannelPot.setActiveId(r),o.ChannelPot.sendToMainChannel({method:a.RemoteXMethods.PageChanged})}}})),self.bugmeAPI={send:function(e){r.SocketConn.send(e)}};self.document&&self.document.dispatchEvent?self.document.dispatchEvent("bugmeInjected"):self.dispatchEvent&&self.dispatchEvent(new CustomEvent("bugmeInjected"))}}},45:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o=n(4),r=n(0),s=n(1),a=n(5),i=n(46);function c(e){if(!e||"object"!=typeof e)return{};var t={};return Object.keys(e).forEach((function(n){t[n]=""+e[n]})),t}var u=/^https?:\/\/hpmweb\.alipay\.com/,l=function(e){u.test(e.url)||o.ChannelPot.sendToMainChannel({method:r.RemoteXMethods.requestWillBeSent,params:{reqId:e.requestId,url:e.url,method:(e.method||"GET").toUpperCase(),body:e.postBody,headers:c(e.headers)}})},d=function(e){u.test(e.url)||o.ChannelPot.sendToMainChannel({method:r.RemoteXMethods.requestFinished,params:{reqId:e.requestId,url:e.url,status:e.status,body:e.body,headers:c(e.headers)}})},f=function(e){u.test(e.url)||o.ChannelPot.sendToMainChannel({method:r.RemoteXMethods.requestFinished,params:{reqId:e.requestId,url:e.url,status:null}})},g=function(e){var t={};Object.keys(e.data).forEach((function(n){try{t[n]=JSON.parse(e.data[n]).APDataStorage}catch(e){}})),o.ChannelPot.sendToMainChannel({method:r.RemoteXMethods.syncStorage,params:{data:t}})};t.listenEvents=function(){var e=s.getBridge();e.on("pageResume",(function(){var e=self.getCurrentPages().filter((function(e){return e})),t=e[e.length-1].$viewId;o.ChannelPot.setActiveId(String(t)),o.ChannelPot.sendToMainChannel({method:r.RemoteXMethods.PageChanged})})),e.on("tinyRemoteDebugPanelButtonClick",(function(){a.SocketConn.close()})),s.checkIOS()?(e.on(i.ERiverDebugEvent.networkRequest,(function(e){var t=e.data;l(t)})),e.on(i.ERiverDebugEvent.networkResponse,(function(e){var t=e.data;d(t)})),e.on(i.ERiverDebugEvent.networkError,(function(e){var t=e.data;f(t)})),e.on(i.ERiverDebugEvent.storageChanged,(function(e){var t=e.data;g(t)}))):e.on(i.ERiverDebugEvent.debugConsole,(function(e){var t,n=e.data,o=n.type,r=n.content;try{t=JSON.parse(r)}catch(e){return}switch(o){case i.ERiverDebugEvent.networkRequest:l(t);break;case i.ERiverDebugEvent.networkResponse:d(t);break;case i.ERiverDebugEvent.networkError:f(t);break;case i.ERiverDebugEvent.storageChanged:g(t)}}))}},46:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e.networkRequest="tinyAppRemoteDebug_network_request",e.networkResponse="tinyAppRemoteDebug_network_response",e.networkError="tinyAppRemoteDebug_network_error",e.storageChanged="tinyAppRemoteDebug_storage",e.debugConsole="onTinyDebugConsole"}(t.ERiverDebugEvent||(t.ERiverDebugEvent={}))},47:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o=n(11),r=n(1),s=function(e,t){return void 0===t?"©undefined":null===t?"©null":t===-1/0?"©- Infinity":t===1/0?"©Infinity":"number"==typeof t&&isNaN(t)?"©NaN":"function"==typeof t?"©function":t},a=Function,i=function(e){try{if(e.fromVConsoleToWorker){var t=e.requestId;if("exec"===e.method){try{new a("requestId","sendBack","var res = "+e.script+";console.log(res);")(t,(function(e){return r.callInternalAPI("tinyDebugConsole",{type:"msgFromWorkerToVConsole",content:o.stringify({requestId:t,returnValue:e},s)})}))}catch(e){console.error(e.name+":"+e.message)}}}}catch(e){}};t.registerPreview=function(){setTimeout((function(){self.document?self.document.addEventListener("push",(function(e){try{var t=e.data.param;i(JSON.parse(t.content||t.data.content))}catch(e){}})):self.addEventListener&&self.addEventListener("push",(function(e){try{var t=JSON.parse(JSON.parse(e.data.text()).param.data.content);i(t)}catch(e){}}))}),10),["log","info","error","debug","warn"].forEach((function(e){var t="o"+e;console[t]||(console[t]=console[e],console[e]=function(){for(var n,a=[],i=0;i<arguments.length;i++)a[i]=arguments[i];console[t].apply(console,a);try{n=o.stringify(a.map((function(e){return e instanceof Error?e.name+": "+e.message:e})),s)}catch(e){return void console.error(e.name+": "+e.message)}r.callInternalAPI("tinyDebugConsole",{content:n,type:"console_"+e})})}))}},5:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o=n(11),r=n(4),s=n(1),a=n(0),i=function(){s.getBridge().call("showRemoteDebugPanel",{status:"connecting",text:"远程调试准备中",buttonTitle:"退出"})},c=function(){s.getBridge().call("showRemoteDebugPanel",{status:"connected",text:"远程调试已连接",buttonTitle:"退出"})},u=function(){s.getBridge().call("showRemoteDebugPanel",{status:"disconnected",text:"远程调试已断开",buttonTitle:"退出"})},l=function(){r.ChannelPot.sendToActiveChannel({method:a.RemoteXMethods.ExitApp})};t.SocketConn={messageQueue:[],socketTask:null,send:function(e){var t=this,n="string"==typeof e?e:JSON.stringify(e);n.length>5242880?s.debug("[bugme] socket send failed, size: ",n.length):this.socketTask?(this.messageQueue.length&&(this.messageQueue.forEach((function(e){t.socketTask.send({data:e})})),this.messageQueue=[]),this.socketTask.send({data:n})):this.messageQueue.push(n)},close:function(){this.socketTask?this.socketTask.close():l()},connect:function(e){var t=this,n=s.getBridge(),o=n.connectSocket({url:e,multiple:!0});o.onOpen((function(){t.socketTask=o,t.onopen()})),o.onMessage((function(e){t.onmessage(e)})),o.onClose((function(){t.onclose()})),o.onError((function(){t.socketTask||(u(),n.showToast({content:"本次真机调试已结束,请重新生成调试版本",duration:2e3,success:function(){l()}}))}))},open:function(){var e=this,t=s.getStartupParams().channelId;if(t){i();var n=s.getBridge(),o="wss://openchannel.alipay.com/host/"+t;if(s.checkIOS()){this.connect(o);var r=n.connectSocket;n.connectSocket=function(e){if(e&&e.multiple)return r(e);n.showToast({content:"iOS 真机调试暂不支持 connectSocket JSAPI",duration:1e3})},n.onSocketOpen=n.offSocketOpen=n.onSocketMessage=n.offSocketMessage=function(){}}else setTimeout((function(){e.connect(o)}),1200)}else s.debug("[bugme] missing channelId in startup params")},onopen:function(){var e=s.getBridge(),t=e.getSystemInfoSync();this.send({method:a.RemoteXMethods.Connect,params:{userAgent:s.getUserAgent(),sdkVersion:e.SDKVersion,alipayVersion:t.version,model:t.model,system:t.system}}),c()},onmessage:function(e){try{var t=JSON.parse(e.data.data),n=t.method,i=t.id,c=t.params;if(n===a.RemoteXMethods.Disconnect)this.close();else if(n===a.RemoteXMethods.EvaluteScript){if(c&&c.code)try{var u=s.executeScript(c.code);this.send({returnId:i,payload:o.stringify(u)})}catch(e){s.debug("[remoteX worker evaluteScript] ",e)}}else n===a.RemoteXMethods.Ping?this.send({method:a.RemoteXMethods.Pong,params:{returnId:i}}):r.ChannelPot.sendToActiveChannel(t)}catch(t){s.debug("RemoteX onSocketMessage error",t,e)}},onclose:function(){this.socketTask=null,this.messageQueue=[],u(),s.getBridge().call("alert",{title:"调试中断",button:"退出"},(function(){l()}))}}}});
const __BUGME_END__ = 1;
/*BUGME_END*/if(!self.__appxInited) {
self.__appxInited = 1;
require('@alipay/appx-compiler/lib/sjsEnvInit');