leuok.bi.wx.js 47 KB

1
  1. !function(e){var t={};function n(o){if(t[o])return t[o].exports;var i=t[o]={i:o,l:!1,exports:{}};return e[o].call(i.exports,i,i.exports,n),i.l=!0,i.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 i in e)n.d(o,i,function(t){return e[t]}.bind(null,i));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=12)}([function(e,t){function n(t){return e.exports=n=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},n(t)}e.exports=n},function(e,t){e.exports=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}},function(e,t,n){var o=n(6),i=n(8);e.exports=function(e,t){return!t||"object"!==o(t)&&"function"!=typeof t?i(e):t}},function(e,t,n){var o=n(9);e.exports=function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&o(e,t)}},function(e,t){function n(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}e.exports=function(e,t,o){return t&&n(e.prototype,t),o&&n(e,o),e}},function(e,t,n){n(0);var o=n(11);function i(t,n,s){return"undefined"!=typeof Reflect&&Reflect.get?e.exports=i=Reflect.get:e.exports=i=function(e,t,n){var i=o(e,t);if(i){var s=Object.getOwnPropertyDescriptor(i,t);return s.get?s.get.call(n):s.value}},i(t,n,s||t)}e.exports=i},function(e,t){function n(e){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function o(t){return"function"==typeof Symbol&&"symbol"===n(Symbol.iterator)?e.exports=o=function(e){return n(e)}:e.exports=o=function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":n(e)},o(t)}e.exports=o},function(e,t,n){var o=n(10);e.exports=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},i=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(i=i.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),i.forEach(function(t){o(e,t,n[t])})}return e}},function(e,t){e.exports=function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}},function(e,t){function n(t,o){return e.exports=n=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},n(t,o)}e.exports=n},function(e,t){e.exports=function(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}},function(e,t,n){var o=n(0);e.exports=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=o(e)););return e}},function(n,o,i){"use strict";i.r(o);var s=i(6),r=i.n(s),a="LEUOK_BI_SDK_UUID",u=1000401,l={setEnv:function(e){e.gameId||console.error("LEUOK","---\x3e","配置文件出错","缺少gameId"),!0===e.multiRegion&&console.warn("LEUOK","多区服游戏"),e.env="dev"===e.env?"dev":"prod",console.log("LEUOK","BI环境",e.env),e.log=!0===e.log,e.adURL="https://bi.log.lightlygame.com/adchannellog/",e.url="dev"===e.env?"https://test.gw.leuok.com/bilog/":"https://bi.log.lightlygame.com",e.cdbURL="https://gw.lightlygame.com/gl-ms-single-server",e.adlog=!1!==e.adlog,e.bilog=!1!==e.bilog,e.multiRegion=!0===e.multiRegion},getRandom:function(){return Math.floor(65536*(1+Math.random())).toString(16).substring(1)},getUUID:function(){for(var e="",t=0;t<8;t++)e+=this.getRandom();return e},dateFormat:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"yyyy-MM-dd hh:mm:ss",n={"M+":e.getMonth()+1,"d+":e.getDate(),"h+":e.getHours(),"m+":e.getMinutes(),"s+":e.getSeconds(),"q+":Math.floor((e.getMonth()+3)/3),S:e.getMilliseconds()};for(var o in/(y+)/.test(t)&&(t=t.replace(RegExp.$1,(e.getFullYear()+"").substr(4-RegExp.$1.length))),n)new RegExp("("+o+")").test(t)&&(t=t.replace(RegExp.$1,1===RegExp.$1.length?n[o]:("00"+n[o]).substr((""+n[o]).length)));return t},toLogStr:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return t.join("|")},getPlat:function(){return"object"==("undefined"==typeof qq?"undefined":r()(qq))?(console.info("LEUOK current plat qq"),qq):"object"==("undefined"==typeof qg?"undefined":r()(qg))?(console.info("LEUOK current plat qg"),qg):"object"==("undefined"==typeof wx?"undefined":r()(wx))?(console.info("LEUOK current plat wx"),wx):"object"==("undefined"==typeof BK?"undefined":r()(BK))?(console.info("LEUOK current plat BK"),BK):"object"==("undefined"==typeof tt?"undefined":r()(tt))?(console.info("LEUOK current plat tt"),tt):"object"==("undefined"==typeof window?"undefined":r()(window))?(console.info("LEUOK current plat window"),window):void 0},log:function(){if(this.getPlat().leuok.conf.log){for(var e,t=arguments.length,n=new Array(t),o=0;o<t;o++)n[o]=arguments[o];(e=console).info.apply(e,["LEUOK"].concat(n))}}},c=i(1),h=i.n(c),d=i(4),p=i.n(d),g=i(2),f=i.n(g),y=i(0),v=i.n(y),I=i(3),m=i.n(I),b=function e(t,n){h()(this,e),this.logType=n.logType||"no_type",this.appId=t.appId||0,this.openId=t.userInfo.uuid||t.userInfo.deviceId||0,this.adChannelId=t.userInfo.adChannelId||0,this.adSubChannelId=t.userInfo.adSubChannelId||0,this.dt=l.dateFormat(new Date),this.regDt=l.dateFormat(new Date),this.logTag=1,this.sdkVersion=t.sdkVersion},S=function(e){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return h()(this,t),n.logType="open",f()(this,v()(t).call(this,e,n))}return m()(t,e),t}(b),w=function(e){function t(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return h()(this,t),o.logType="source",(e=f()(this,v()(t).call(this,n,o))).sence=o.sence||0,e.sourceAppId=o.sourceAppId||"",e.adChannelId=o.adChannelId||n.launchOption.query.adChannelId||"",e.adSubChannelId=o.adSubChannelId||n.launchOption.query.adSubChannelId||"",e}return m()(t,e),t}(b),k=function(e){function t(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return h()(this,t),o.logType="jump",(e=f()(this,v()(t).call(this,n,o))).position=o.position||0,e.jumpToAppId=o.jumpToAppId||0,e}return m()(t,e),t}(b),T=function(e){function t(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return h()(this,t),o.logType="event",(e=f()(this,v()(t).call(this,n,o))).orderId=o.orderId||0,e.eventID=o.eventID||0,e.regDt=n.userInfo.regDt||"2006-01-02 15:04:05",e}return m()(t,e),t}(b),O=function(e){function t(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return h()(this,t),o.logType="ad_banner",(e=f()(this,v()(t).call(this,n,o))).position=o.position||0,e.type=1,e}return m()(t,e),t}(b),q=function(e){function t(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return h()(this,t),o.logType="level",(e=f()(this,v()(t).call(this,n,o))).regDt=n.userInfo.regDt||"2006-01-02 15:04:05",e.newLevel=o.newLevel||0,e.oldLevel=o.level||0,e.level=Math.abs(e.newLevel-e.oldLevel),e}return m()(t,e),t}(b),L=function(e){function t(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return h()(this,t),o.logType="login",(e=f()(this,v()(t).call(this,n,o))).regDt=n.userInfo.regDt||"2006-01-02 15:04:05",e.nickname=o.nickName||"",e}return m()(t,e),t}(b),N=function(e){function t(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return h()(this,t),o.logType="pay",(e=f()(this,v()(t).call(this,n,o))).platId=n.platId||0,e.dPrice=o.dPrice||0,e.totalNum=o.totalNum||0,e.payId=o.payId||0,e}return m()(t,e),t}(b),P=function(e){function t(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return h()(this,t),o.logType="reg",(e=f()(this,v()(t).call(this,n,o))).dt=n.userInfo.regDt||e.dt,e}return m()(t,e),t}(b),D=function(e){function t(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return h()(this,t),o.logType="share_out",(e=f()(this,v()(t).call(this,n,o))).position=o.type||0,e}return m()(t,e),t}(b),_=function(e){function t(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return h()(this,t),o.logType="ad_video",(e=f()(this,v()(t).call(this,n,o))).position=o.type||0,e.type=o.subType||0,e}return m()(t,e),t}(b),U=i(7),x=i.n(U),C=i(5),R=i.n(C),E=function(){function e(t,n){h()(this,e),this.uuid=t.userInfo.uuid||"",this.uid=n.uid||t.userInfo.uuid||"",this.platId=t.platId||0,this.regionId=n.regionId||t.regionId||0,this.channelId=t.userInfo.biChannelId||0,this.dt=l.dateFormat(new Date,"yyyy-MM-dd hh:mm:ss"),this.logTag=0,this.gender=t.userProfile.gender||0,this.country=t.userProfile.country||"",this.province=t.userInfo.ext.province||t.userProfile.province||"",this.city=t.userProfile.city||"",this.language=t.userProfile.language||"zh_CN"}return p()(e,[{key:"toString",value:function(){return"".concat(this.uuid,"|").concat(this.uid,"|").concat(this.platId,"|").concat(this.regionId,"|").concat(this.channelId,"|").concat(this.dt)}},{key:"toStringProfile",value:function(){return l.toLogStr(this.gender,this.country,this.province,this.city,this.language)}}]),e}(),j=function(e){function t(e,n){var o;return h()(this,t),(o=f()(this,v()(t).call(this,e,n))).regDt=e.userInfo.regDt||"",o.reged=0,o.level=n.level||0,o.vip=n.vip||0,o.payed=n.payed||0,o}return m()(t,e),p()(t,[{key:"toString",value:function(){return R()(v()(t.prototype),"toString",this).call(this)+"|"+this.regDt+"|"+this.level+"|"+this.reged+"|"+this.vip+"|"+this.payed}}]),t}(E),K=function(){function e(t){h()(this,e),this.deviceId=t.userInfo.deviceId||t.userInfo.uuid||"",this.ip=t.ip||"1.1.1.1",this.clientVersion=t.version||"",this.systemSoftware=t.system||"",this.systemHardware=t.model||"",this.comOperation=t.comOperation||0,this.network=t.network||0,this.cpuHardware=t.cpuHardware||"",this.gpuHardware=t.gpuHardware||"",this.memory=t.memory||0,this.screenWidth=t.screenWidth||0,this.screenHeight=t.screenHeight||0,this.density=t.pixelRatio||0,this.glRender=t.glRender||"",this.glVersion=t.glVersion||"",this.phoneNumber=t.phoneNumber||""}return p()(e,[{key:"toString",value:function(){return this.deviceId+"|"+this.ip+"|"+this.clientVersion+"|"+this.systemSoftware+"|"+this.systemHardware+"|"+this.comOperation+"|"+this.network+"|"+this.cpuHardware+"|"+this.gpuHardware+"|"+this.memory+"|"+this.screenWidth+"|"+this.screenHeight+"|"+this.density+"|"+this.glRender+"|"+this.glVersion+"|"+this.phoneNumber}}]),e}(),M=function(e){function t(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return h()(this,t),(e=f()(this,v()(t).call(this,n,o))).logType="log_reg",e.dt=n.userInfo.regDt||e.dt,e.device=new K(n),e.reged=0,e.level=o.level||0,e.scene=n.launchOption.scene||"",e.source_appid=n.launchOption.referrerInfo&&n.launchOption.referrerInfo.appId||"",e}return m()(t,e),p()(t,[{key:"toString",value:function(){return"".concat(this.logType,"|").concat(R()(v()(t.prototype),"toString",this).call(this),"|").concat(this.level,"|").concat(this.reged,"|").concat(this.device.toString(),"|").concat(this.scene,"|").concat(this.source_appid,"|").concat(R()(v()(t.prototype),"toStringProfile",this).call(this))}}]),t}(E),A=function(e){function t(e,n){var o;return h()(this,t),(o=f()(this,v()(t).call(this,e,n))).gameId=e.gameId,o}return m()(t,e),p()(t,[{key:"toString",value:function(){return this.uuid+"|"+this.uid+"|"+this.gameId+"|"+this.platId+"|"+this.regionId+"|"+this.channelId+"|"+this.dt}},{key:"toStringRegU",value:function(){return l.toLogStr(this.uuid,this.gameId,this.platId,this.channelId,this.dt)}}]),t}(E),X=function(e){function t(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return h()(this,t),(e=f()(this,v()(t).call(this,n,o))).logType="log_reg_u",e.dt=n.userInfo.regDt||e.dt,e.device=new K(n),e.scene=n.launchOption.scene||"",e.source_appid=n.launchOption.referrerInfo&&n.launchOption.referrerInfo.appId||"",e}return m()(t,e),p()(t,[{key:"toString",value:function(){return l.toLogStr(this.logType,R()(v()(t.prototype),"toStringRegU",this).call(this),this.scene,this.source_appid,R()(v()(t.prototype),"toStringProfile",this).call(this))}}]),t}(A),B=function(e){function t(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return h()(this,t),(e=f()(this,v()(t).call(this,n,o))).device=new K(n),e.logType="log_login",e.type=o.type||0,e.friendsNum=o.friendsNum||0,e.online=o.online||0,e.power=o.power||0,e.energy=o.energy||0,e.guildId=o.guildId||0,e.roleName=o.roleName||"",e.scene=n.launchOption.scene||"",e.source_appid=n.launchOption.referrerInfo&&n.launchOption.referrerInfo.appId||"",e}return m()(t,e),p()(t,[{key:"toString",value:function(){return l.toLogStr(this.logType,R()(v()(t.prototype),"toString",this).call(this),this.device.toString(),this.type,this.friendsNum,this.online,this.power,this.energy,this.guildId,this.roleName,this.scene,this.source_appid,R()(v()(t.prototype),"toStringProfile",this).call(this))}}]),t}(j),F=function(e){function t(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return h()(this,t),(e=f()(this,v()(t).call(this,n,o))).logType="log_login_u",e.device=new K(n),e.scene=n.launchOption.scene||"",e.source_appid=n.launchOption.referrerInfo&&n.launchOption.referrerInfo.appId||"",e}return m()(t,e),p()(t,[{key:"toString",value:function(){return l.toLogStr(this.logType,R()(v()(t.prototype),"toStringRegU",this).call(this),this.scene,this.source_appid,R()(v()(t.prototype),"toStringProfile",this).call(this))}}]),t}(A),V=function(e){function t(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return h()(this,t),(e=f()(this,v()(t).call(this,n,o))).logType="log_share_in",e.newPlayer=n.isReg?1:0,e.type=o.type||0,e}return m()(t,e),p()(t,[{key:"toString",value:function(){return"".concat(this.logType,"|").concat(R()(v()(t.prototype),"toString",this).call(this),"|").concat(this.type,"|").concat(this.newPlayer)}}]),t}(j),H=function(e){function t(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return h()(this,t),(e=f()(this,v()(t).call(this,n,o))).logType="log_share_out",e.type=o.type||0,e}return m()(t,e),p()(t,[{key:"toString",value:function(){return"".concat(this.logType,"|").concat(R()(v()(t.prototype),"toString",this).call(this),"|").concat(this.type)}}]),t}(j),J=function(e){function t(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return h()(this,t),(e=f()(this,v()(t).call(this,n,o))).logType="log_ad_video",e.type=o.type||0,e.subType=o.subType||0,e.battle=o.battle||0,e}return m()(t,e),p()(t,[{key:"toString",value:function(){return"".concat(this.logType,"|").concat(R()(v()(t.prototype),"toString",this).call(this),"|").concat(this.type,"|").concat(this.subType,"|").concat(this.battle)}}]),t}(j),Y=function(e){function t(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return h()(this,t),(e=f()(this,v()(t).call(this,n,o))).logType="log_action",e.level=o.level||0,e.reged=0,e.device=new K(n),e.type=o.type||2,e.actionType=o.actionType||0,e.actionNumber=o.actionNumber||0,e.g1=o.g1||0,e.g2=o.g2||0,e.g3=o.g3||0,e.g4=o.g4||0,e.g5=o.g5||0,e.g6=o.g6||0,e.s3=o.s3||"",e.s4=o.s4||"",e.s5=o.s5||"",e.s6=o.s6||"",1===e.actionType&&999999===e.actionNumber?(e.s1=n.launchOption.scene||"",e.s2=n.launchOption.referrerInfo&&n.launchOption.referrerInfo.appId||""):(e.s1=o.s1||"",e.s2=o.s2||""),e}return m()(t,e),p()(t,[{key:"toString",value:function(){return[this.logType,R()(v()(t.prototype),"toString",this).call(this),this.level,this.reged,this.device.toString(),this.type,this.actionType,this.actionNumber,this.g1,this.g2,this.g3,this.g4,this.g5,this.g6,this.s1,this.s2,this.s3,this.s4,this.s5,this.s6,R()(v()(t.prototype),"toStringProfile",this).call(this)].join("|")}}]),t}(A),Z=function(e){function t(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return h()(this,t),(e=f()(this,v()(t).call(this,n,o))).logType="log_app_once",e.device=new K(n),e.level=o.level||0,e.reged=0,e.actionNumber=o.actionNumber||0,e.scene=n.launchOption.scene||"",e.source_appid=n.launchOption.referrerInfo&&n.launchOption.referrerInfo.appId||"",e}return m()(t,e),p()(t,[{key:"toString",value:function(){return this.logType+"|"+R()(v()(t.prototype),"toString",this).call(this)+"|"+this.level+"|"+this.reged+"|"+this.device.toString()+"|"+this.actionNumber+"|"+this.scene+"|"+this.source_appid+"|"+R()(v()(t.prototype),"toStringProfile",this).call(this)}}]),t}(A),W=function(e){function t(e,n){var o;return h()(this,t),(o=f()(this,v()(t).call(this,e,n))).sequenceId=n.sequenceId||0,o.reason=n.reason||0,o.subReason=n.subReason||0,o}return m()(t,e),p()(t,[{key:"toString",value:function(){return R()(v()(t.prototype),"toString",this).call(this)+"|"+this.sequenceId+"|"+this.reason+"|"+this.subReason}}]),t}(j),$=function(e){function t(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return h()(this,t),(e=f()(this,v()(t).call(this,n,o))).logType="log_battle",e.type=o.logType||0,e.battleType=o.battleType||0,e.battleId=o.battleId||0,e.time=o.time||0,e}return m()(t,e),p()(t,[{key:"toString",value:function(){return this.logType+"|"+R()(v()(t.prototype),"toString",this).call(this)+"|"+this.type+"|"+this.battleType+"|"+this.battleId+"|"+this.time}}]),t}(W),z=function(e){function t(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return h()(this,t),(e=f()(this,v()(t).call(this,n,o))).logType="log_energy",e.old=o.old||0,e.new=o.new||0,e.addOrReduce=e.new>e.old?1:0,e.energy=Math.abs(e.new-e.old),e}return m()(t,e),p()(t,[{key:"toString",value:function(){return l.toLogStr(this.logType,R()(v()(t.prototype),"toString",this).call(this),this.addOrReduce,this.old,this.new,this.energy)}}]),t}(W),G=function(e){function t(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return h()(this,t),(e=f()(this,v()(t).call(this,n,o))).logType="log_equip",e.addOrReduce=o.addOrReduce||0,e.equipType=o.equipType||0,e.equipId=o.equipId||0,e.num=o.num||0,e}return m()(t,e),p()(t,[{key:"toString",value:function(){return this.logType+"|"+R()(v()(t.prototype),"toString",this).call(this)+"|"+this.addOrReduce+"|"+this.equipType+"|"+this.equipId+"|"+this.num}}]),t}(W),Q=function(e){function t(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return h()(this,t),(e=f()(this,v()(t).call(this,n,o))).logType="log_equip_degree",e.equipType=o.equipType||0,e.equipId=o.equipId||0,e.equipOldDegree=o.equipOldDegree||0,e.equipNewDegree=o.equipNewDegree||0,e.equipDegree=Math.abs(e.equipOldDegree-e.equipNewDegree),e}return m()(t,e),p()(t,[{key:"toString",value:function(){return this.logType+"|"+R()(v()(t.prototype),"toString",this).call(this)+"|"+this.equipType+"|"+this.equipId+"|"+this.equipOldDegree+"|"+this.equipNewDegree+"|"+this.equipDegree}}]),t}(W),ee=function(e){function t(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return h()(this,t),(e=f()(this,v()(t).call(this,n,o))).logType="log_equip_level",e.equipType=o.equipType||0,e.equipId=o.equipId||0,e.equipOldLevel=o.equipOldLevel||0,e.equipNewLevel=o.equipNewLevel||0,e.equipLevel=Math.abs(e.equipOldLevel-e.equipNewLevel),e}return m()(t,e),p()(t,[{key:"toString",value:function(){return this.logType+"|"+R()(v()(t.prototype),"toString",this).call(this)+"|"+this.equipType+"|"+this.equipId+"|"+this.equipOldLevel+"|"+this.equipNewLevel+"|"+this.equipLevel}}]),t}(W),te=function(e){function t(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return h()(this,t),(e=f()(this,v()(t).call(this,n,o))).logType="log_equip_playway",e.equipType=o.equipType||0,e.equipId=o.equipId||0,e.equipOldLevel=o.equipOldLevel||0,e.equipNewLevel=o.equipNewLevel||0,e.equipLevel=Math.abs(e.equipOldLevel-e.equipNewLevel),e.playType=o.playType||0,e}return m()(t,e),p()(t,[{key:"toString",value:function(){return this.logType+"|"+R()(v()(t.prototype),"toString",this).call(this)+"|"+this.equipType+"|"+this.equipId+"|"+this.equipOldLevel+"|"+this.equipNewLevel+"|"+this.equipLevel+"|"+this.playType}}]),t}(W),ne=function(e){function t(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return h()(this,t),(e=f()(this,v()(t).call(this,n,o))).logType="log_friends",e.old=o.old||0,e.new=o.new||0,e.addOrReduce=e.new>e.old?1:0,e.friends=Math.abs(e.new-e.old),e.type=o.type||0,e}return m()(t,e),p()(t,[{key:"toString",value:function(){return l.toLogStr(this.logType,R()(v()(t.prototype),"toString",this).call(this),this.addOrReduce,this.old,this.new,this.friends,this.type)}}]),t}(j),oe=function(e){function t(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return h()(this,t),(e=f()(this,v()(t).call(this,n,o))).logType="log_item",e.itemType=o.itemType||0,e.itemId=o.itemId||0,e.oldNum=o.oldNum||0,e.newNum=o.newNum||0,e.num=Math.abs(e.oldNum-e.newNum),e.addOrReduce=e.newNum>e.oldNum?1:0,e}return m()(t,e),p()(t,[{key:"toString",value:function(){return this.logType+"|"+R()(v()(t.prototype),"toString",this).call(this)+"|"+this.addOrReduce+"|"+this.itemType+"|"+this.itemId+"|"+this.oldNum+"|"+this.newNum+"|"+this.num}}]),t}(W),ie=function(e){function t(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return h()(this,t),(e=f()(this,v()(t).call(this,n,o))).logType=o.logType||"x_event",e.extends=o.extends||"",e}return m()(t,e),p()(t,[{key:"toString",value:function(){return"".concat(this.logType,"|").concat(R()(v()(t.prototype),"toString",this).call(this),"|").concat(this.extends)}}]),t}(j),se=function(e){function t(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return h()(this,t),(e=f()(this,v()(t).call(this,n,o))).logType="log_level",e.heroId=o.heroId||0,e.newLevel=o.newLevel||0,e.num=Math.abs(e.newLevel-e.level),e}return m()(t,e),p()(t,[{key:"toString",value:function(){return this.logType+"|"+R()(v()(t.prototype),"toString",this).call(this)+"|"+this.heroId+"|"+this.newLevel+"|"+this.num}}]),t}(W),re=function(e){function t(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return h()(this,t),(e=f()(this,v()(t).call(this,n,o))).logType="log_money",e.oldMoney=o.oldMoney||0,e.newMoney=o.newMoney||0,e.money=Math.abs(e.oldMoney-e.newMoney),e.num=o.num||0,e.addOrReduce=e.newMoney>e.oldMoney?1:0,e.moneyType=o.moneyType||0,e.itemIdName=o.itemIdName||"",e.itemType=o.itemType||0,e.itemId=o.itemId||"",e.shop=o.shop||0,e}return m()(t,e),p()(t,[{key:"toString",value:function(){return l.toLogStr(this.logType,R()(v()(t.prototype),"toString",this).call(this),this.oldMoney,this.newMoney,this.money,this.num,this.addOrReduce,this.moneyType,this.itemIdName,this.itemType,this.itemId,this.shop)}}]),t}(W),ae=function(e){function t(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return h()(this,t),(e=f()(this,v()(t).call(this,n,o))).logType="log_new_task",e.taskId=o.taskId||0,e.orderId=o.orderId||0,e}return m()(t,e),p()(t,[{key:"toString",value:function(){return this.logType+"|"+R()(v()(t.prototype),"toString",this).call(this)+"|"+this.taskId+"|"+this.orderId}}]),t}(W),ue=function(e){function t(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return h()(this,t),(e=f()(this,v()(t).call(this,n,o))).logType="log_pay",e.regDt=n.userInfo.regDt||"",e.level=o.level||0,e.reged=0,e.vip=o.vip||0,e.payType=o.payType||0,e.orderNumber=o.orderNumber||"",e.dPrice=o.dPrice||0,e.dStoreNum=o.dStoreNum||0,e.totalNum=o.totalNum||0,e.fPayFlag=o.fPayFlag||0,e.payChannelId=o.payChannelId||0,e.payId=o.payId||0,e.payIdName=o.payIdName||"",e.dNum=o.dNum||0,e.dBeforeStoreNum=o.dBeforeStoreNum||0,e}return m()(t,e),p()(t,[{key:"toString",value:function(){return this.logType+"|"+R()(v()(t.prototype),"toString",this).call(this)+"|"+this.regDt+"|"+this.level+"|"+this.reged+"|"+this.vip+"|"+this.payType+"|"+this.orderNumber+"|"+this.dPrice+"|"+this.dStoreNum+"|"+this.totalNum+"|"+this.fPayFlag+"|"+this.payChannelId+"|"+this.payId+"|"+this.payIdName+"|"+this.dNum+"|"+this.dBeforeStoreNum+"|"+R()(v()(t.prototype),"toStringProfile",this).call(this)}}]),t}(E),le=function(e){function t(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return h()(this,t),(e=f()(this,v()(t).call(this,n,o))).logType="log_power",e.old=o.old||0,e.new=o.new||0,e.addOrReduce=e.new>e.old?1:0,e.power=Math.abs(e.new-e.old),e}return m()(t,e),p()(t,[{key:"toString",value:function(){return l.toLogStr(this.logType,R()(v()(t.prototype),"toString",this).call(this),this.addOrReduce,this.old,this.new,this.power)}}]),t}(W),ce=function(e){function t(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return h()(this,t),(e=f()(this,v()(t).call(this,n,o))).logType="log_task",e.taskType=o.taskType||0,e.taskId=o.taskId||"",e}return m()(t,e),p()(t,[{key:"toString",value:function(){return this.logType+"|"+R()(v()(t.prototype),"toString",this).call(this)+"|"+this.taskType+"|"+this.taskId}}]),t}(W),he=function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};h()(this,e),this.logType="error",this.gameId=t.gameId,this.channelId=t.userInfo.biChannelId||0,this.dt=l.dateFormat(new Date),this.regDt=t.userInfo.regDt||"",this.openId=t.userInfo.uuid||0,this.errorType=n.errorType||"video",this.errCode=n.errCode||0,this.logTag=1,this.sdkVersion=t.sdkVersion},de=function(e){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return h()(this,t),f()(this,v()(t).call(this,e,n))}return m()(t,e),p()(t,[{key:"adSource",value:function(){var e=this.sysInfo.launchOption;if(e.query.adChannelId&&e.query.adSubChannelId){var t=e.referrerInfo&&e.referrerInfo.appId?e.referrerInfo.appId:"";this.sendAd(w,{sence:e.scene,sourceAppId:t,adChannelId:e.query.adChannelId,adSubChannelId:e.query.adSubChannelId})}}},{key:"adOpen",value:function(){this.sendAd(S)}},{key:"adJump",value:function(e){this.checkParam(e,"跳转日志 adJump","position","jumpToAppId")&&this.sendAd(k,e)}},{key:"adEvent",value:function(e){this.sendAd(T,e)}},{key:"adBanner",value:function(e){this.checkParam(e,"Banner日志 adBanner","position")&&this.sendAd(O,e)}},{key:"adLogVideo",value:function(e){this.sendAd(_,e)}},{key:"adLevel",value:function(e){this.sendAd(q,e)}},{key:"adPay",value:function(e){this.sendAd(N,e)}},{key:"adShare",value:function(e){this.sendAd(D,e)}},{key:"adReg",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:3;this.status.reg?console.warn("LEUOK","adReg已发送过不能重复发送"):1===this.sysInfo.cdbStatus&&this.sysInfo.isReg?this.sendAd(P):--t>=0&&setTimeout(function(){e.adReg(t)},2e3)}},{key:"adLogin",value:function(e){this.adReg(),this.status.login?console.warn("LEUOK","adLogin已发送过不能重复发送"):this.sendAd(L,e)}},{key:"appOnce",value:function(e){this.checkParam(e,"AppOnce日志 AppOnce","actionNumber")&&l.dateFormat(new Date,"yyyy-MM-dd")===this.sysInfo.userInfo.regDt.substring(0,10)&&!this.sysInfo.userInfo.actionNumbers.includes(e.actionNumber)&&(this.sysInfo.userInfo.actionNumbers.push(e.actionNumber),this.sendX(Z,e),this.adEvent({eventID:e.actionNumber}),this.adapter.setStorage(a,this.sysInfo.userInfo))}},{key:"adVideo",value:function(e){this.checkParam(e,"视频广告日志 AdVideo","type","subType")&&(this.sendX(J,e),this.adLogVideo(e),this.setYZUserData(3,e))}},{key:"level",value:function(e){this.checkParam(e,"升级日志 Level","level","newLevel")&&(this.sendX(se,e),this.adLevel(e))}},{key:"pay",value:function(e){this.checkParam(e,"充值日志 Pay","payType","orderNumber","dPrice","dStoreNum","totalNum","fPayFlag","dNum","dBeforeStoreNum")&&(this.sendX(ue,e),this.adPay(e))}},{key:"sharedOut",value:function(e){this.checkParam(e,"分享出日志 SharedOut","type")&&(this.sendX(H,e),this.adShare(e),this.setYZUserData(2,e))}},{key:"sendAd",value:function(e,t){var n=this,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:3;if(this.conf.adlog){var i=new e(this.sysInfo,t);if(1!==this.sysInfo.cdbStatus||this.sysInfo.userInfo.isFromAd){if(this.sysInfo.userInfo.isFromAd&&(1===this.sysInfo.cdbStatus||["open","event","source"].includes(i.logType)))return l.log("开始发送adlog",i.logType,"......"),void this.request.post(this.conf.adURL,i,{"Content-Type":"application/json"});if(0===this.sysInfo.cdbStatus)return console.warn("LEUOK","CDB没有登录或登录失败","开始登录"),void this.cdbLogin();o--,2===this.sysInfo.cdbStatus&&o>=0&&(console.warn("LEUOK","CDB正在登录中","推广日志",i.logType,"3秒后重试第",3-o,"次"),setTimeout(function(){n.sendAd(e,t,o)},2e3))}else l.log("非推广用户取消发送",i.logType)}else l.log("客户端设置不通过BIsdk发送adlog")}}]),t}(function(){function e(){var t=this,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};h()(this,e);var i=o.getLaunchOptionsSync();this.sysInfo={isReg:!1,cdbStatus:2,platId:1,userInfo:{deviceId:l.getUUID(),isFromAd:i.query.hasOwnProperty("adChannelId"),regDt:l.dateFormat(new Date),actionNumbers:[],cdbSuccess:!1,biChannelId:1000401,adChannelId:i.query.adChannelId||0,adSubChannelId:i.query.adSubChannelId||0,ext:{}},start:new Date,launchOption:i,sdkVersion:"0.6.8",userProfile:{}},o.getUserInfo&&o.getUserInfo().then(function(e){t.sysInfo.userProfile=e}),this.status={},this.request=n,this.conf={},this.adapter=o,this.cdb={},this.init=function(){}}return p()(e,[{key:"action",value:function(e){console.info("LEUOK 开始发送action日志"),this.checkParam(e,"行为日志 action","actionType","actionNumber")&&this.sendX(Y,e)}},{key:"adVideo",value:function(e){this.checkParam(e,"视频广告日志 AdVideo","type","subType")&&this.sendX(J,e)}},{key:"appOnce",value:function(e){this.checkParam(e,"AppOnce日志 AppOnce","actionNumber")&&l.dateFormat(new Date,"yyyy-MM-dd")===this.sysInfo.userInfo.regDt.substring(0,10)&&!this.sysInfo.userInfo.actionNumbers.includes(e.actionNumber)&&(this.sysInfo.userInfo.actionNumbers.push(e.actionNumber),this.sendX(Z,e),this.adapter.setStorage(a,this.sysInfo.userInfo))}},{key:"battle",value:function(e){this.checkParam(e,"闯关日志 Battle","logType","battleType","battleId")&&this.sendX($,e)}},{key:"equip",value:function(e){this.checkParam(e,"装备日志 Equip","sequenceId","reason","equipType","equipId","num","addOrReduce")&&this.sendX(G,e)}},{key:"equipDegree",value:function(e){this.checkParam(e,"装备升阶日志 EquipDegree","equipType","equipId","equipOldDegree","equipNewDegree")&&this.sendX(Q,e)}},{key:"equipLevel",value:function(e){this.checkParam(e,"装备升级日志 EquipLevel","equipType","equipId","equipOldLevel","equipNewLevel")&&this.sendX(ee,e)}},{key:"equipPlayWay",value:function(e){this.checkParam(e,"装备玩法日志 EquipPlayWay","equipType","equipId","equipOldLevel","equipNewLevel","playType")&&this.sendX(te,e)}},{key:"friends",value:function(e){this.checkParam(e,"好友日志 Friends","old","new","type")&&this.sendX(ne,e)}},{key:"item",value:function(e){this.checkParam(e,"道具日志 Item","reason","itemType","itemId","oldNum","newNum")&&this.sendX(oe,e)}},{key:"level",value:function(e){this.checkParam(e,"升级日志 Level","level","newLevel")&&this.sendX(se,e)}},{key:"login",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(console.info("LEUOK 开始发送login日志"),!0===this.conf.multiRegion){if(!0===e.onShow)return void this.loginU();this.sysInfo.start=new Date,this.sysInfo.regionId=e.regionId||0}e.type=1,this.sysInfo.regionId<1e6?console.error("LEUOK","登陆日志区服ID没有或小于1000000"):this.checkParam(e,"登录日志")&&this.sendX(B,e)}},{key:"loginU",value:function(e){this.checkParam(e,"登录日志")&&this.sendX(F,e)}},{key:"logout",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=new Date;e.type=0,e.online=Math.ceil((t.getTime()-this.sysInfo.start.getTime())/1e3),this.setYZUserData(1,e),this.sendX(B,e)}},{key:"money",value:function(e){if(this.checkParam(e,"money日志 Money","reason","oldMoney","newMoney","moneyType")){if(e.shop&&1===e.shop&&this.checkParam(e,"money日志 Money","itemType","itemId","num"))return void this.sendX(re,e);this.sendX(re,e)}}},{key:"newTask",value:function(e){this.checkParam(e,"强制任务日志 NewTask","taskId","regionId")&&this.sendX(ae,e)}},{key:"pay",value:function(e){this.checkParam(e,"充值日志 Pay","payType","orderNumber","dPrice","dStoreNum","totalNum","fPayFlag","dNum","dBeforeStoreNum","payId")&&this.sendX(ue,e)}},{key:"power",value:function(e){this.checkParam(e,"战力日志 Power","old","new")&&this.sendX(le,e)}},{key:"reg",value:function(e){if(!0===this.conf.multiRegion){if(!0===e.onShow)return void this.regU();this.sysInfo.regionId=e.regionId||0}this.sysInfo.regionId<1e6?console.error("LEUOK","登陆日志区服ID没有或小于1000000"):this.checkParam(e,"注册日志")&&this.sendX(M,e)}},{key:"regU",value:function(e){this.checkParam(e,"注册日志")&&this.sendX(X,e)}},{key:"sharedIn",value:function(e){this.checkParam(e,"分享入日志 SharedIn","type")&&this.sendX(V,e)}},{key:"sharedOut",value:function(e){this.checkParam(e,"分享出日志 SharedOut","type")&&this.sendX(H,e)}},{key:"task",value:function(e){this.checkParam(e,"非强制任务日志 Task","taskType","taskId")&&this.sendX(ce,e)}},{key:"event",value:function(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length,o=new Array(n>2?n-2:0),i=2;i<n;i++)o[i-2]=arguments[i];this.checkParam(o,"自定义日志")&&(new j(this.sysInfo,t),this.sendX(ie,Object.assign(t,{logType:e,extends:o.join("|")})))}},{key:"energy",value:function(e){this.checkParam(e,"体力日志 Energy","old","new")&&this.sendX(z,e)}},{key:"adLogin",value:function(){}},{key:"error",value:function(e){this.checkParam(e,"上传错误日志 error","errorType","errCode")&&this.sendX(he,e)}},{key:"setYZUserData",value:function(e,t){var n=this.adapter.getStorageSync("YZ_USER_DATA");l.log(n),n&&""!==n||(l.log("本地没有YZ用户行为数据..."),n={});var o=1;1===e&&(o=t.online),3!==e||4===t.subType?(n[e]=e in n?n[e]+o:o,l.log("存储用户数据:"+JSON.stringify(n)),this.adapter.setStorage("YZ_USER_DATA",n)):l.log("视频累计不满足条件...")}},{key:"sendX",value:function(e,t){var n=this,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:3;if(this.conf.bilog){var i=new e(this.sysInfo,t);if(["log_app_once","error"].includes(i.logType)||"log_action"===i.logType&&1===t.actionType)return l.log("开始发送bilog",i.logType,"......"),void this.request.post(0===i.logTag?this.conf.url:this.conf.adURL,i,{"Content-Type":"text/plain"});if(1===this.sysInfo.cdbStatus)return l.log("开始发送bilog",i.logType,"......"),void this.request.post(0===i.logTag?this.conf.url:this.conf.adURL,new e(this.sysInfo,t),{"Content-Type":0===i.logTag?"text/plain":"application/json"});if(0===this.sysInfo.cdbStatus)return console.warn("LEUOK","发送BI","bi日志",i.logType,"失败 CDB开始登录重试"),void this.cdbLogin();--o>=0&&(console.warn("LEUOK","CDB正在登录中 --\x3e","bi日志",i.logType,"3秒后重试第",3-o,"次"),setTimeout(function(){n.sendX(e,t,o)},2e3))}else l.log("注意:程序配置不发送BI日志")}},{key:"getLocalData",value:function(e){var t=this.adapter.getStorageSync("LEUOK_BI_SDK_UID");t&&console.info("LEUOK","云存储签名",JSON.stringify(t),t);var n=this.adapter.getStorageSync(a);n&&!0===n.cdbSuccess?(Object.assign(this.sysInfo.userInfo,n),this.sysInfo.cdbStatus=1):(Object.assign(this.sysInfo.userInfo,n||{}),this.cdbLogin(e))}},{key:"getServerTime",value:function(e){return e||(e=this.conf.cdbURL),this.request.cdb(e+"/api/userCloudData/time",{},{method:"get"}).then(function(e){return console.log("get server time success!",e.data),0===e.data.state?e.data.info:Date.now()}).catch(function(){return console.log("get server time failed!"),Date.now()})}},{key:"cdbLogin",value:function(e){var t=this;this.sysInfo.cdbStatus=2,console.info("LEUOK 进入cdbLogin方法"),this.adapter.getAuthCode().then(function(e){return t.cdb.uid&&t.cdb.token?Promise.resolve({data:{state:0,info:t.cdb}}):(console.info("LEUOK CDB 开始登录 res:"+JSON.stringify(Object.assign(e,{gameId:t.sysInfo.gameId,channelId:t.sysInfo.cdbChannelId,platId:t.sysInfo.platId}))+" url:"+t.conf.cdbURL+"/api/user/login"),t.request.cdb(t.conf.cdbURL+"/api/user/login",Object.assign(e,{gameId:t.sysInfo.gameId,channelId:t.sysInfo.cdbChannelId,platId:t.sysInfo.platId}),{method:"post"}))}).then(function(e){if(console.info("LEUOK CDB 登录成功 res:"+JSON.stringify(e)),0===e.data.state){if(t.cdb=e.data.info,t.cdb.userInfo){var n=Object.assign({},t.cdb.userInfo);console.log("oppo用户信息:",n),t.conf.callback&&t.conf.callback(n)}t.getProvince(),t.sysInfo.userInfo.openId=e.data.info.openId||t.sysInfo.userInfo.uuid,t.sysInfo.userInfo.uuid||(t.sysInfo.userInfo.uuid=e.data.info.openId),t.appOnce({actionNumber:999998});var o=x()({},t.cdb,{gameId:t.sysInfo.gameId,channelId:t.sysInfo.cdbChannelId});return console.info("LEUOK","云存储登录成功--签名:",JSON.stringify(o)),t.adapter.setStorage("LEUOK_BI_SDK_UID",o),t.request.cdb(t.conf.cdbURL+"/api/userCloudData/getSelfData",{platId:t.sysInfo.platId,key:999,sdType:0},{header:o})}return Promise.reject("cdb登录失败 ---\x3e "+e.data.msg)}).then(function(n){if(console.info("CDB 登录成功2 res:"+JSON.stringify(n)),0!==n.data.state)return Promise.reject("cdb获取key数据失败"+n.data.msg);if(t.appOnce({actionNumber:999997}),null===n.data.info||"null"===n.data.info){t.sysInfo.isReg=!0,["wx","qzone","oppo","qq"].includes("wx")&&t.sysInfo.launchOption.query.adChannelId&&Object.assign(t.sysInfo.userInfo,{isFromAd:!0,adChannelId:t.sysInfo.launchOption.query.adChannelId,adSubChannelId:t.sysInfo.launchOption.query.adSubChannelId});var o=JSON.parse(JSON.stringify(t.sysInfo.userInfo));delete o.actionNumbers,delete o.cdbSuccess,delete o.ext;var i=function(){return t.request.cdb(t.conf.cdbURL+"/api/userCloudData/setSelfNormalData",{platId:t.sysInfo.platId,key:999,value:JSON.stringify(o)},{header:{gameId:t.sysInfo.gameId,channelId:t.sysInfo.cdbChannelId,uid:t.cdb.uid,token:t.cdb.token}})};i().then(function(e){0!==e.data.state&&console.error("LEUOK","存储数据失败 重试",e.data.msg)}).catch(function(e){console.error("LEUOK","存储数据失败 重试",e),setTimeout(function(){i()},2e3)})}else{var s=JSON.parse(n.data.info);Object.assign(t.sysInfo.userInfo,s),s.biChannelId||(t.sysInfo.userInfo.biChannelId=t.sysInfo.channelId)}t.sysInfo.cdbStatus=1,t.sysInfo.userInfo.cdbSuccess=!0,t.sysInfo.isReg&&(t.reg({onShow:!0}),t.level({level:0,newLevel:0}),t.friends({old:0,new:0,type:0}),t.energy({old:0,new:0}),t.power({old:0,new:0})),t.adapter.setStorage(a,x()({},t.sysInfo.userInfo)),t.login({onShow:!0}),e?(console.info("LEUOK 开始执行init回调"),e()):console.info("LEUOK 不需要执行init回调"),console.info("LEUOK 执行完登录所有流程")}).catch(function(e){t.sysInfo.cdbStatus=0,console.error("LEUOK","CDB登录失败22",JSON.stringify(e))})}},{key:"getProvince",value:function(){var e=this;this.request.cdb(this.conf.cdbURL+"/api/userCloudData/getLocation",{},{header:{gameId:this.sysInfo.gameId,channelId:this.sysInfo.cdbChannelId,uid:this.cdb.uid,token:this.cdb.token}}).then(function(t){t.data.ok&&t.data.info&&(e.sysInfo.userInfo.ext.province=t.data.info.name)})}},{key:"checkParam",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;for(var n in e)"string"==typeof e[n]&&(e[n]=e[n].replace(/\|/g,""));for(var o=arguments.length,i=new Array(o>2?o-2:0),s=2;s<o;s++)i[s-2]=arguments[s];for(var r=0;r<i.length;r++){var a=i[r];if(!e.hasOwnProperty(a))return console.error(t+"缺少必要参数 ----\x3e"+a),!1}return!0}},{key:"clear",value:function(){var e=this;this.adapter.getAuthCode().then(function(t){return e.cdb.uid&&e.cdb.token?Promise.resolve({data:{state:0,info:e.cdb}}):e.request.cdb(e.conf.cdbURL+"/api/user/login",Object.assign(t,{gameId:e.sysInfo.gameId,channelId:e.sysInfo.cdbChannelId,platId:e.sysInfo.platId}))}).then(function(t){0===t.data.state?(e.cdb=t.data.info,e.request.cdb(e.conf.cdbURL+"/api/userCloudData/setSelfNormalData",{platId:e.sysInfo.platId,key:999,value:"null"},{header:{gameId:e.sysInfo.gameId,channelId:e.sysInfo.cdbChannelId,uid:e.cdb.uid,token:e.cdb.token}}),e.adapter.removeStorage("LEUOK_BI_SDK_UID"),e.adapter.removeStorage(a)):console.error("LEUOK","清除失败")})}}]),e}()),pe=function(e){return function(t){for(var n=arguments.length,o=new Array(n>1?n-1:0),i=1;i<n;i++)o[i-1]=arguments[i];return new Promise(function(n,i){e.apply(void 0,[Object.assign({},t,{success:n,fail:i})].concat(o))})}},ge={request:pe(wx.request)},fe=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:3,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:3;h()(this,e),this.retryCount=t,this.delay=n}return p()(e,[{key:"post",value:function(e,t){var n=this,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.retryCount;ge.request({url:e,data:0===t.logTag?t.toString():t,method:"POST"}).then(function(){l.log("成功发送".concat(0===t.logTag?"bilog":"adlog"),t.logType,t),"login"!==t.logType&&"reg"!==t.logType||(wx.leuok.status[t.logType]=!0)}).catch(function(i){o>0&&"request:fail timeout"!==i.errMsg&&(o--,console.warn("LEUOK","发送",t.logType,"日志失败","原因 --\x3e",i,"".concat(n.delay,"秒后重试第"),3-o,"次"),setTimeout(function(){n.post(e,t,o)},1e3*n.delay))})}},{key:"cdb",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return ge.request({url:e,data:t,method:n.method||"POST",header:n.header||{}})}},{key:"getNetwork",value:function(){return pe(wx.getNetworkType)}}]),e}(),ye={getAuthCode:function(){return new Promise(function(e,t){wx.login({success:function(n){n.code?e({code:n.code,data:""}):t("wx.login 获取code失败")},fail:function(){t("wx.login 获取code失败")}})})},getStorageSync:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return wx.getStorageSync(e)},getLaunchOptionsSync:function(){return wx.getLaunchOptionsSync()},setStorage:function(e,t){wx.setStorage({key:e,data:t})},removeStorage:function(e){wx.removeStorage({key:e})},getUserInfo:function(){return new Promise(function(e,t){wx.getSetting({success:function(n){n.authSetting["scope.userInfo"]&&wx.getUserInfo({success:function(t){e(t.userInfo)},fail:function(){t("wx.getUserInfo 获取用户信息失败")}})},fail:function(){t("wx.getSetting 获取授权信心失败")}})})}},ve=function(e){function t(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return h()(this,t),o.logType="logout",(e=f()(this,v()(t).call(this,n,o))).regDt=n.userInfo.regDt||"2006-01-02 15:04:05",e.online=o.online||"",e}return m()(t,e),t}(b);console.log("LEUOK Build version: 0.6.8 - 2020-05-14T08:54:39.056Z - Powered by Gameley.Inc "),wx.leuok=new de(new fe(3,3),ye),wx.leuok.init=function(e){if(e.appId){l.setEnv(e),this.conf=e,this.sysInfo.userInfo.biChannelId=u,Object.assign(this.sysInfo,{appId:e.appId,gameId:e.gameId||0,channelId:u,cdbChannelId:1002,network:0}),this.conf.multiRegion||(this.sysInfo.regionId="".concat(e.gameId,"010001"));try{var t=wx.getSystemInfoSync();Object.assign(this.sysInfo,t),this.sysInfo.platId=t.system.includes("iOS")?1:3,this.sysInfo.channelId=t.system.includes("iOS")?u:2006603,this.sysInfo.userInfo.biChannelId=this.sysInfo.channelId}catch(e){console.warn("LEUOK","获取硬件信息失败")}if(this.sysInfo.launchOption.query.leuokShareIn)this.sysInfo.userInfo.biChannelId=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=parseInt(e);return(NaN===n||n>100)&&(n=100),1===t?134+n+"00401":138+n+"06603"}(this.sysInfo.launchOption.query.leuokShareIn,this.sysInfo.platId);else if(this.sysInfo.launchOption.query.ioChannelId&&this.sysInfo.launchOption.query.anChannelId){var n=1===this.sysInfo.platId?this.sysInfo.launchOption.query.ioChannelId:this.sysInfo.launchOption.query.anChannelId;this.sysInfo.userInfo.biChannelId=n.trim()}this.adapter.getStorageSync(a)||(this.sysInfo.userInfo.isFromAd&&this.adOpen(),this.appOnce({actionNumber:999999}));try{var o=this;wx.getNetworkType({success:function(e){o.sysInfo.network=function(e){console.log("networkType:"+e);var t=0;switch(e){case"wifi":console.log("wifi"),t=1;break;case"4g":console.log("4g"),t=2;break;case"3g":console.log("3g"),t=3;break;case"2g":console.log("2g"),t=4}return t}(e.networkType),o.getLocalData()}})}catch(e){console.warn("LEUOK","获取网络信息失败")}}else console.error("LEUOK","缺少微信appID")},wx.onShow(function(){wx.leuok.action({type:2,actionType:999999,actionNumber:999999}),wx.leuok.adSource();var e=wx.getStorageSync(a);wx.leuok.sysInfo.start=new Date,e&&!0===e.cdbSuccess&&wx.leuok.login({onShow:!0})}),wx.onHide(function(){wx.leuok.logout();var e={},t=new Date;e.online=Math.ceil((t.getTime()-wx.leuok.sysInfo.start.getTime())/1e3),wx.leuok.sendAd(ve,e)})}]);