@xyz-fe/log 5.3.0 → 6.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/mp.min.js CHANGED
@@ -1,6 +1,6 @@
1
1
  /*!
2
- * @xyz-fe/log v5.3.0
2
+ * @xyz-fe/log v6.0.0
3
3
  * (c) lizhigao <lizhigao@021.com>
4
4
  * Released under the MIT License.
5
5
  */
6
- !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).mp={})}(this,(function(t){"use strict";var e=function(){return e=Object.assign||function(t){for(var e,o=1,n=arguments.length;o<n;o++)for(var i in e=arguments[o])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t},e.apply(this,arguments)};function o(t,e,o,n){return new(o||(o=Promise))((function(i,s){function r(t){try{c(n.next(t))}catch(t){s(t)}}function a(t){try{c(n.throw(t))}catch(t){s(t)}}function c(t){var e;t.done?i(t.value):(e=t.value,e instanceof o?e:new o((function(t){t(e)}))).then(r,a)}c((n=n.apply(t,e||[])).next())}))}function n(t,e){var o,n,i,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]},r=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return r.next=a(0),r.throw=a(1),r.return=a(2),"function"==typeof Symbol&&(r[Symbol.iterator]=function(){return this}),r;function a(a){return function(c){return function(a){if(o)throw new TypeError("Generator is already executing.");for(;r&&(r=0,a[0]&&(s=0)),s;)try{if(o=1,n&&(i=2&a[0]?n.return:a[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,a[1])).done)return i;switch(n=0,i&&(a=[2&a[0],i.value]),a[0]){case 0:case 1:i=a;break;case 4:return s.label++,{value:a[1],done:!1};case 5:s.label++,n=a[1],a=[0];continue;case 7:a=s.ops.pop(),s.trys.pop();continue;default:if(!(i=s.trys,(i=i.length>0&&i[i.length-1])||6!==a[0]&&2!==a[0])){s=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]<i[3])){s.label=a[1];break}if(6===a[0]&&s.label<i[1]){s.label=i[1],i=a;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(a);break}i[2]&&s.ops.pop(),s.trys.pop();continue}a=e.call(t,s)}catch(t){a=[6,t],n=0}finally{o=i=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,c])}}}function i(){var t=new Date,e=t.getFullYear().toString(),o=(t.getMonth()+1).toString(),n=t.getDate().toString();return(e=e.toString().substr(-2))+(o=Number(o)<10?"0"+o:o)+(n=Number(n)<10?"0"+n:n)}"function"==typeof SuppressedError&&SuppressedError;var s,r,a="5.3.0",c="organic";t.EGender=void 0,(s=t.EGender||(t.EGender={}))[s.Unknown=0]="Unknown",s[s.Male=1]="Male",s[s.Female=2]="Female",function(t){t.BATCH_ID="BATCH_ID",t.COMMON_PARAMS="COMMON_PARAMS",t.ONLINE_BATCH_DATA="ONLINE_BATCH_DATA",t.ACCUMULATED_TIME="ACCUMULATED_TIME"}(r||(r={}));var p=function(){function t(t){var e,o,n=t.domain,i=t.commonParams,s=t.isPro,c=void 0===s||s,p=t.sendOpenLog,l=void 0===p||p,u=t.consoleLog,d=void 0===u||u,h=t.useIAA,m=void 0!==h&&h,_=t.periodicReportInterval,f=void 0===_?0:_;if(this.version=a,this.buildDate="4/17/2026, 4:35:54 PM",this._openUrl="",this._eventUrl="",this._actUrl="",this._adUrl="",this._onlineUrl="",this._businessDomain="",this._startTime=Date.now(),this._commonParams={},this._periodicReportInterval=0,this._accumulatedTime=0,this._periodicTimer=null,this._isPro=!0,this._sendOpenLog=!0,this._isColdStartUp=!0,this._systemInfo={},this._mp={},this._consoleLog=!0,this._useIAA=!1,this._sessionInfo={},this._isPro=c,this._sendOpenLog=l,this._consoleLog=d,this._useIAA=m,f>0){var y=f>0?f:10;this._periodicReportInterval=Math.max(1e3*y,5e3)}else this._periodicReportInterval=0;var v=this._getApis(n),g=v.openUrl,I=v.eventUrl,O=v.actUrl,L=v.adUrl,A=v.onlineUrl;this._openUrl=g,this._eventUrl=I,this._actUrl=O,this._adUrl=L,this._onlineUrl=A,this._businessDomain=this._isPro?"https://applet-xx.mop.com":"https://test-applet-xx.mop.com";var w,P=this._getMp(),b=P.mp,S=P.platform;this._mp=b,this._platform=S,!b||(w=b)&&0===Object.keys(w).length&&w.constructor===Object?console.error("[XLOG] 日志SDK初始化失败,当前环境为非小程序环境!"):this._consoleLog&&console.log("[XLOG] 小程序对象:",b,"平台类型:",S);try{this._systemInfo=(null===(o=null===(e=this._mp)||void 0===e?void 0:e.getSystemInfoSync)||void 0===o?void 0:o.call(e))||{},this._consoleLog&&console.log("[XLOG] 系统信息:",this._systemInfo)}catch(t){console.error("[XLOG] getSystemInfoSync error",t)}if(this._extraInfo={language:this._systemInfo.language,wxVersion:this._systemInfo.version,SDKVersion:this._systemInfo.SDKVersion,benchmarkLevel:this._systemInfo.benchmarkLevel||-1,theme:this._systemInfo.theme,pixelRatio:this._systemInfo.pixelRatio},this._periodicReportInterval>0){var G=this._getStorage(r.ACCUMULATED_TIME);this._accumulatedTime=G?Number(G):0,this._consoleLog&&console.log("[XLOG] 加载缓存的累计时长:",this._accumulatedTime,"ms")}this._init(i)}return Object.defineProperty(t.prototype,"commonParams",{get:function(){return this._commonParams},enumerable:!1,configurable:!0}),t.prototype._safeJsonParse=function(t,e){try{return t?JSON.parse(t):e}catch(o){return console.error("[XLOG] JSON解析错误:",o,"原始数据:",t),e}},t.prototype._getLaunchOptions=function(){var t,e,o,n,i,s,r,a,c,p,l,u;try{return 2===this._platform?(null===(e=null===(t=this._mp)||void 0===t?void 0:t.getLaunchOptionsSync)||void 0===e?void 0:e.call(t))||null:3===this._platform?(null===(n=null===(o=this._mp)||void 0===o?void 0:o.getLaunchOptionsSync)||void 0===n?void 0:n.call(o))||null:1===this._platform?(null===(s=null===(i=this._mp)||void 0===i?void 0:i.getEnterOptionsSync)||void 0===s?void 0:s.call(i))||(null===(a=null===(r=this._mp)||void 0===r?void 0:r.getLaunchOptionsSync)||void 0===a?void 0:a.call(r))||null:(null===(p=null===(c=this._mp)||void 0===c?void 0:c.getLaunchOptionsSync)||void 0===p?void 0:p.call(c))||(null===(u=null===(l=this._mp)||void 0===l?void 0:l.getEnterOptionsSync)||void 0===u?void 0:u.call(l))||null}catch(t){return console.error("[XLOG] 获取启动参数失败",t),null}},t.prototype._updateQuerystring=function(t,o){void 0===t&&(t=null),void 0===o&&(o={});var n=(null==t?void 0:t.query)?e(e({},t.query),o):o;this._updateCommonParams({srcqid:n.channel||"",userinfo:JSON.stringify({querystring:n})})},t.prototype._init=function(t){var e=this;this._initCommonParams(this._filterParams(t));var o=this._getLaunchOptions();this._updateQuerystring(o),this._coldStartUp(),this._useIAA&&this._initIAAPlugin(),this._visibilityChange((function(){e._isColdStartUp||e._getNetworkType().then((function(t){e._updateCommonParams({network:t}),e._open({openway:1})})),e._startTime=Date.now(),e._periodicReportInterval>0&&e._startPeriodicTimer();var t=e._getOnlineBatchData();t&&t.length>0&&e._online(t)}),(function(){if(e._isColdStartUp=!1,e._open({openway:5}),e._periodicReportInterval>0){e._stopPeriodicTimer();var t=Date.now()-e._startTime;e._accumulatedTime+=t,e._setStorage(r.ACCUMULATED_TIME,e._accumulatedTime.toString()),e._consoleLog&&console.log("[XLOG] 切后台,累计时长:",e._accumulatedTime,"ms")}else e._sendOnline()}))},t.prototype._startPeriodicTimer=function(){var t=this;this._periodicTimer&&clearInterval(this._periodicTimer),this._periodicTimer=setInterval((function(){t._checkPeriodicReport()}),1e3),this._consoleLog&&console.log("[XLOG] 启动定期上报定时器,间隔(ms):",this._periodicReportInterval)},t.prototype._stopPeriodicTimer=function(){this._periodicTimer&&(clearInterval(this._periodicTimer),this._periodicTimer=null,this._consoleLog&&console.log("[XLOG] 停止定期上报定时器"))},t.prototype._checkPeriodicReport=function(){var t=Date.now()-this._startTime,e=this._accumulatedTime+t;if(e>=this._periodicReportInterval){var o=Math.floor(e/this._periodicReportInterval),n=o*this._periodicReportInterval;this._sendPeriodicOnline(n,o),this._accumulatedTime=e-n,this._startTime=Date.now(),this._setStorage(r.ACCUMULATED_TIME,this._accumulatedTime.toString()),this._consoleLog&&console.log("[XLOG] 定期上报 ".concat(o," 次,总计 ").concat(n,"ms,剩余 ").concat(this._accumulatedTime,"ms"))}},t.prototype._sendPeriodicOnline=function(t,o){for(var n=Date.now()-t,i=[],s=0;s<o;s++){var r=n+s*this._periodicReportInterval,a=r+this._periodicReportInterval;i.push(e(e({},this._commonParams),{appqid:this._getAppqid(),onlinetime:this._periodicReportInterval.toString(),endtime:a.toString(),starttime:r.toString()}))}this._online(i)},t.prototype._getMp=function(){var t={mp:null,platform:7};return"undefined"!=typeof tt&&tt.getSystemInfo?(t.mp=tt,t.platform=2):"undefined"!=typeof ks&&ks.getSystemInfo?(t.mp=ks,t.platform=3):"undefined"!=typeof swan&&swan.getSystemInfo?(t.mp=swan,t.platform=4):"undefined"!=typeof qq&&qq.getSystemInfo?(t.mp=qq,t.platform=5):"undefined"!=typeof wx&&wx.getSystemInfo?(t.mp=wx,t.platform=1):"undefined"!=typeof my&&my.getSystemInfo?t.mp=my:"undefined"!=typeof jd&&jd.getSystemInfo&&(t.mp=jd),t},t.prototype._visibilityChange=function(t,e){var o,n,i,s,r=this;void 0===t&&(t=function(){}),void 0===e&&(e=function(){});try{var a=(null===(o=this._mp)||void 0===o?void 0:o.onAppShow)||(null===(n=this._mp)||void 0===n?void 0:n.onShow),c=(null===(i=this._mp)||void 0===i?void 0:i.onAppHide)||(null===(s=this._mp)||void 0===s?void 0:s.onHide);a&&a((function(){r._consoleLog&&console.log("[XLOG] onAppShow"),t()})),c&&c((function(){r._consoleLog&&console.log("[XLOG] onAppHide"),e()}))}catch(t){console.error("[XLOG] onAppShow or onAppHide error",t)}},t.prototype._getStorage=function(t){var e;try{var o=null===(e=this._mp)||void 0===e?void 0:e.getStorageSync("XYZ_LOG_".concat(t));return null==o?"":o}catch(t){return console.error("[XLOG] getStorageSync error",t),""}},t.prototype._setStorage=function(t,e){var o;try{null===(o=this._mp)||void 0===o||o.setStorageSync("XYZ_LOG_".concat(t),e)}catch(t){console.error("[XLOG] setStorageSync error",t)}},t.prototype._getBatchId=function(){var t=this._getStorage(r.BATCH_ID);return t||(t=function(t,e){void 0===t&&(t=18),void 0===e&&(e=0);for(var o="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz".split(""),n=[],i=Math.random,s=t,r=e||o.length,a=0;a<s;a++)n[a]=o[0|i()*r];return n.join("")}(),this._setStorage(r.BATCH_ID,t)),t},t.prototype._coldStartUp=function(){var t=this;this._getNetworkType().then((function(e){t._updateCommonParams({network:e}),t._open({openway:0}),t._periodicReportInterval>0&&t._startPeriodicTimer()}))},t.prototype._getApis=function(t){var o=this._isPro?{open:"webopen-inside.tt.cn",event:"webevent-inside.tt.cn",act:"webact-inside.tt.cn",ad:"webadv-inside.tt.cn",online:"webact-inside.tt.cn"}:{open:"test-webopen-inside.tt.cn",event:"test-webevent-inside.tt.cn",act:"test-webact-inside.tt.cn",ad:"test-webadv-inside.tt.cn",online:"test-webact-inside.tt.cn"},n=e(e({},o),t);return{openUrl:"https://".concat(n.open,"/gamefunction_logs/applet/open"),eventUrl:"https://".concat(n.event,"/gamefunction_logs/applet/event"),actUrl:"https://".concat(n.act,"/gamefunction_logs/applet/activity"),adUrl:"https://".concat(n.ad,"/gamefunction_logs/applet/adv"),onlineUrl:"https://".concat(n.online,"/gamefunction_logs/applet/onlineTime")}},t.prototype._cacheCommonParams=function(t){this._setStorage(r.COMMON_PARAMS,JSON.stringify(t))},t.prototype._getInitParams=function(){var t,e=(null===(t=this._systemInfo.system)||void 0===t?void 0:t.includes(" "))?this._systemInfo.system.split(" ")[1]:this._systemInfo.system;return{platform:this._platform,appcqid:c,appqid:c+i(),os:this._systemInfo.platform,osversion:e,device:this._systemInfo.model,devicebrand:this._systemInfo.brand,pixel:this._systemInfo.screenWidth+"*"+this._systemInfo.screenHeight,userinfo:this._getUserInfo()}},t.prototype._initCommonParams=function(t){var o=this._getInitParams(),n=this._getStorage(r.COMMON_PARAMS);n&&(o=e(e({},o),this._safeJsonParse(n,{}))),t&&(o=e(e({},o),t)),this._updateCommonParams(e(e({},o),{obatchid:this._getBatchId()}))},t.prototype._getNetworkType=function(){var t=this;return new Promise((function(e){var o;try{null===(o=t._mp)||void 0===o||o.getNetworkType({success:function(t){var o=((null==t?void 0:t.networkType)||"").toLowerCase();e({wifi:"wifi","2g":"2g","3g":"3g","4g":"4g","5g":"5g",none:"none",unknown:"unknown",ethernet:"wifi",cellular:"4g"}[o]||"unknown")},fail:function(){return e("none")}})}catch(t){console.error("[XLOG] getNetworkType error",t),e("none")}}))},t.prototype._getUserInfo=function(t){var o={};t&&(o=this._safeJsonParse(t,{}));var n={};return this.commonParams.userinfo&&(n=this._safeJsonParse(this.commonParams.userinfo,{})),JSON.stringify(e(e(e({},this._extraInfo),n),o))},t.prototype._filterParams=function(t){var e={};if(t){var o=["openid","unionid","accid","apptypeid","appsubid","appcqid","srcqid","appver","userinfo"];for(var n in t){var i=t[n];o.includes(n)&&i&&(e[n]=i)}}return e},t.prototype.setParams=function(t){if(t){this._consoleLog&&console.log("[XLOG] setParams",t);var e=this._commonParams.openid,o=this._commonParams.unionid;t=this._filterParams(t),this._updateCommonParams(t),(t.openid&&t.openid!==e||t.unionid&&t.unionid!==o)&&this._open({isreturn:t.openid?1:2,openway:0})}},t.prototype._updateCommonParams=function(t){if(this._consoleLog&&console.log("[XLOG] _updateCommonParams",t),t.userinfo){var o=t.appsubid||this._commonParams.appsubid;o&&(t.userinfo=JSON.stringify(e(e({},this._safeJsonParse(t.userinfo,{})),{appsubid:o}))),t.userinfo=this._getUserInfo(t.userinfo)}t.appcqid&&(t.appqid=t.appcqid+i()),t.appver&&(t.appverint=function(t){try{return t&&"string"==typeof t?t.split(".").map((function(t){return 1===t.length?"0"+t:t})).join(""):""}catch(e){return console.error('[transferVersion] ver("'.concat(t,'")格式异常:'),e),""}}(t.appver)),this._commonParams=e(e({},this._commonParams),t),this._cacheCommonParams(this._commonParams)},t.prototype._getAppqid=function(){return this._commonParams.appcqid+i()},t.prototype._getApptypeid=function(t){var e=t||this._commonParams.apptypeid||"";return e||console.warn("[XLOG] apptypeid未配置,请在初始化时传入或调用方法时传入"),e},t.prototype._request=function(t,e,o){var n=this;return void 0===o&&(o="application/x-www-form-urlencoded"),new Promise((function(i,s){var r;try{null===(r=n._mp)||void 0===r||r.request({url:t,data:e,method:"POST",header:{"content-type":o},success:function(o){n._consoleLog&&console.log("[XLOG] SUCCESS: ".concat(t),e,o),i(o)},fail:function(o){n._consoleLog&&console.error("[XLOG] FAIL: ".concat(t),e,o),s(o)}})}catch(t){console.error("[XLOG] request error",t),s(t)}}))},t.prototype.open=function(t){this._open({querystring:t.querystring,isreturn:3,openway:0,manual:!0})},t.prototype._open=function(t){if(this._sendOpenLog||t.manual){var o=this._getLaunchOptions();this._updateQuerystring(o,t.querystring);var n=e(e({},this._commonParams),{appqid:this._getAppqid(),wakeway:t.wakeway||(null==o?void 0:o.scene)||"",openway:t.openway,isreturn:t.isreturn||0,xmlog:a});this._consoleLog&&console.log("[XLOG] PARAMS(OPEN)",n),this._request(this._openUrl,n)}},t.prototype.event=function(t){var o=e(e({},this._commonParams),{appqid:this._getAppqid(),event1:t.event1||"",event2:t.event2||"",event3:t.event3||"",event4:t.event4||"",value1:t.value1||"",value2:t.value2||"",value3:t.value3||"",value4:t.value4||""});this._consoleLog&&console.log("[XLOG] PARAMS(EVENT)",o),this._request(this._eventUrl,o)},t.prototype.act=function(t){var o=e(e({},this._commonParams),{appqid:this._getAppqid(),actentryid:t.actentryid||"",subactid:t.subactid||"",type:t.type||"",custom:t.custom||"",batchid:t.batchid||""});this._consoleLog&&console.log("[XLOG] PARAMS(ACT)",o),this._request(this._actUrl,o)},t.prototype.ad=function(t){var o=e(e({},this._commonParams),{appqid:this._getAppqid(),type:t.type||"",code:t.code||"",codeinfo:t.codeinfo||"",pagetype:t.pagetype||"",gametype:t.gametype||"",adslot:t.adslot||"",adunitid:t.adunitid||"",adbatchid:t.adbatchid||"",ecpm:t.ecpm||""});this._consoleLog&&console.log("[XLOG] PARAMS(AD)",o),this._request(this._adUrl,o,"application/json")},t.prototype._getPlatformPath=function(){var t="";return 1===this._platform?t="wx/":3===this._platform&&(t="ks/"),t},t.prototype._getPlatformStr=function(){var t="DY";return 1===this._platform?t="WX":3===this._platform&&(t="KS"),t},t.prototype.code2session=function(t){var e;return o(this,void 0,void 0,(function(){var o,i,s,r,a;return n(this,(function(n){switch(n.label){case 0:return o=this._getApptypeid(t.apptypeid),i=this._getPlatformPath(),s="".concat(this._businessDomain,"/AppletUtils/").concat(i,"code2session"),[4,this._request(s,{appTypeId:o,code:t.code,testNet:t.testNet},"application/json")];case 1:return r=n.sent(),a=null===(e=r.data)||void 0===e?void 0:e.data,this._sessionInfo=null!=a?a:{},this.setParams({openid:this._sessionInfo.openid,unionid:this._sessionInfo.unionid}),[2,r.data]}}))}))},t.prototype.msgSecCheck=function(t){return o(this,void 0,void 0,(function(){var e,o,i,s,r,a;return n(this,(function(n){switch(n.label){case 0:return 1!==this._platform?(console.warn("[XLOG] msgSecCheck 仅支持微信小程序/小游戏平台"),[2]):(e=(t.content||"").trim())?(o=this._getApptypeid(t.apptypeid),(i=t.openid||this._sessionInfo.openid||this._commonParams.openid)?((s="number"==typeof t.scene?t.scene:4)!==(r=s>=1&&s<=5?s:4)&&console.warn("[XLOG] msgSecCheck scene超出范围,已回退为4"),a="".concat(this._businessDomain,"/AppletUtils/wx/msgCheck"),this._consoleLog&&console.log("[XLOG] PARAMS(MSG_SEC_CHECK)",{appTypeId:o,openid:i,scene:r,content:e}),[4,this._request(a,{appTypeId:o,openid:i,scene:r,content:e},"application/json")]):(console.warn("[XLOG] msgSecCheck openid不存在,请先登录(调用方法code2session)或手动传入openid",this._sessionInfo),[2])):(console.warn("[XLOG] msgSecCheck content不能为空"),[2]);case 1:return[2,n.sent().data]}}))}))},t.prototype.isLogin=function(){return!!this._sessionInfo.openid||(console.warn("[XLOG] checkLogin","openid不存在,请检查是否已经调用过登录(code2session)。"),!1)},t.prototype.getSubsidy=function(t){return void 0===t&&(t={}),o(this,void 0,void 0,(function(){var e,o;return n(this,(function(n){switch(n.label){case 0:return this.isLogin()?(e=this._getApptypeid(t.apptypeid),o=this._sessionInfo.openid,[4,this._request("".concat(this._businessDomain,"/AppletUtils/pay/ks/subsidy"),{apptypeid:e,os:this._systemInfo.platform,openId:o},"application/json")]):(console.warn("[XLOG] getSubsidy 请先登录(调用方法code2session)",this._sessionInfo),[2]);case 1:return[2,n.sent().data]}}))}))},t.prototype.getUserProps=function(t){return void 0===t&&(t={}),o(this,void 0,void 0,(function(){var e,o;return n(this,(function(n){switch(n.label){case 0:return this.isLogin()?(e=this._getApptypeid(t.apptypeid),o=this._sessionInfo.openid,[4,this._request("".concat(this._businessDomain,"/AppletUtils/pay/ks/userProps"),{appTypeId:e,openId:o},"application/json")]):(console.warn("[XLOG] getUserProps 请先登录(调用方法code2session)",this._sessionInfo),[2]);case 1:return[2,n.sent().data]}}))}))},t.prototype._sleep=function(t){return void 0===t&&(t=1e3),o(this,void 0,void 0,(function(){return n(this,(function(e){return[2,new Promise((function(e,o){setTimeout(e,t)}))]}))}))},t.prototype._checkOrderAfterPayment=function(t,i){var s;return o(this,void 0,void 0,(function(){var o,r;return n(this,(function(n){switch(n.label){case 0:return n.trys.push([0,3,,4]),[4,this._sleep()];case 1:return n.sent(),[4,this.checkOrder({orderId:t})];case 2:return o=n.sent(),[2,{payResult:1===Number(null===(s=null==o?void 0:o.data)||void 0===s?void 0:s.payResult)?1:0}];case 3:return r=n.sent(),console.error("[XLOG] 订单校验 err: ",r,e({orderId:t},i)),[2,{payResult:0}];case 4:return[2]}}))}))},t.prototype._payWx=function(t,i){var s;return o(this,void 0,void 0,(function(){var o,r,a,c,p,l,u,d,h,m,_,f,y,v,g,I=this;return n(this,(function(n){switch(n.label){case 0:if(this._consoleLog&&console.log('[XLOG] 当前平台: "'.concat(this._systemInfo.platform,'"')),o="ios"===(this._systemInfo.platform||"").toLowerCase(),r=i.orderId,a=i.payContent,p=(c=a||{}).offerId,l=c.zone_id,u=c.env,d=c.buy_quantity,h=c.kfMessageTitle,m=c.kfMessageImg,!o)return[3,4];_={sessionFrom:t.sessionFrom,showMessageCard:null===(s=t.showMessageCard)||void 0===s||s,sendMessageTitle:t.sendMessageTitle||h,sendMessagePath:t.sendMessagePath,sendMessageImg:t.sendMessageImg||m},n.label=1;case 1:return n.trys.push([1,3,,4]),[4,new Promise((function(t,o){I._mp.openCustomerServiceConversation(e(e({},_),{success:t,fail:o}))}))];case 2:return v=n.sent(),this._consoleLog&&console.log("[XLOG] 进入客服会话",v),[2,{payResult:-1}];case 3:return f=n.sent(),console.error("[XLOG] 取消进入客服会话",f,_),[2,{payResult:0}];case 4:y={mode:"game",env:1===Number(u)?1:0,offerId:p,currencyType:"CNY",platform:"android",buyQuantity:Number(d||t.buyQuantity),zoneId:l,outTradeNo:r},n.label=5;case 5:return n.trys.push([5,7,,8]),[4,new Promise((function(t,o){I._mp.requestMidasPayment(e(e({},y),{success:t,fail:o}))}))];case 6:return v=n.sent(),this._consoleLog&&console.log("[XLOG] 微信虚拟支付",v),[3,8];case 7:return g=n.sent(),console.error("[XLOG] 微信虚拟支付 err: ",g,y),[2,{payResult:0}];case 8:return[2,this._checkOrderAfterPayment(r,y)]}}))}))},t.prototype._payDy=function(t,i){var s;return o(this,void 0,void 0,(function(){var o,r,a,c,p,l,u,d,h,m,_,f,y,v,g=this;return n(this,(function(n){switch(n.label){case 0:if(o=i.orderId,r=i.payContent,c=(a=r||{}).zone_id,p=a.env,l=a.buy_quantity,u=a.extraInfo,d="ios"===(this._systemInfo.platform||"").toLowerCase(),h="windows"===(this._systemInfo.platform||"").toLowerCase(),!d)return[3,5];if(!(null===(s=this._mp)||void 0===s?void 0:s.openAwemeCustomerService))return console.error("[XLOG] 当前抖音基础库不支持 openAwemeCustomerService"),[2,{payResult:0}];m={currencyType:"DIAMOND",buyQuantity:Number(l||t.buyQuantity),zoneId:c||"1",customId:o,extraInfo:t.extInfo||u},n.label=1;case 1:return n.trys.push([1,3,,4]),[4,new Promise((function(t,o){g._mp.openAwemeCustomerService(e(e({},m),{success:t,fail:o}))}))];case 2:return y=n.sent(),this._consoleLog&&console.log("[XLOG] 抖音 iOS 客服支付",y),[3,4];case 3:return _=n.sent(),console.error("[XLOG] 抖音 iOS 客服支付 err: ",_,m),[2,{payResult:0}];case 4:return[2,this._checkOrderAfterPayment(o,m)];case 5:f={mode:"game",env:1===Number(p)?1:0,currencyType:"CNY",platform:h?"windows":"android",buyQuantity:Number(l||t.buyQuantity),zoneId:c||"1",customId:o,extraInfo:t.extInfo||u},n.label=6;case 6:return n.trys.push([6,8,,9]),[4,new Promise((function(t,o){g._mp.requestGamePayment(e(e({},f),{success:t,fail:o}))}))];case 7:return y=n.sent(),this._consoleLog&&console.log("[XLOG] 抖音支付",y),[3,9];case 8:return v=n.sent(),console.error("[XLOG] 抖音支付 err: ",v,f),[2,{payResult:0}];case 9:return[2,this._checkOrderAfterPayment(o,f)]}}))}))},t.prototype.pay=function(t){return o(this,void 0,void 0,(function(){var e,o;return n(this,(function(n){switch(n.label){case 0:return this._consoleLog&&console.log("[XLOG] pay params: ",t),"WX"!==(e=this._getPlatformStr())&&"DY"!==e?(console.error("[XLOG] 支付目前只支持微信/抖音平台,当前平台: ".concat(e||"UNKNOWN")),[2,{payResult:0}]):[4,this.createOrder(t)];case 1:return(null==(o=n.sent())?void 0:o.data)?"WX"===e?[2,this._payWx(t,o.data)]:[2,this._payDy(t,o.data)]:(console.error("[XLOG] 未获取到订单信息"),[2,{payResult:0}])}}))}))},t.prototype.checkOrder=function(t){return o(this,void 0,void 0,(function(){var e,o,i,s,r;return n(this,(function(n){switch(n.label){case 0:return this.isLogin()?(e=this._getApptypeid(t.apptypeid),o=this._getPlatformPath(),i=this._sessionInfo,s=i.openid,r=i.session_key,[4,this._request("".concat(this._businessDomain,"/AppletUtils/pay/").concat(o,"chkOrder"),{appTypeId:e,orderId:t.orderId,os:this._systemInfo.platform,openId:s,sessionKey:r},"application/json")]):(console.warn("[XLOG] checkOrder 请先登录(调用方法code2session)",this._sessionInfo),[2]);case 1:return[2,n.sent().data]}}))}))},t.prototype.createOrder=function(t){return o(this,void 0,void 0,(function(){var e,o,i;return n(this,(function(n){switch(n.label){case 0:return this.isLogin()?(e=this._getApptypeid(t.apptypeid),o=this._sessionInfo.openid,i=this._getPlatformStr(),[4,this._request("".concat(this._businessDomain,"/AppletUtils/pay/ks/crtOrder"),{appTypeId:e,productId:t.productId,extInfo:t.extInfo,os:this._systemInfo.platform,payPlatform:i,openId:o},"application/json")]):(console.warn("[XLOG] createOrder 请先登录(调用方法code2session)",this._sessionInfo),[2]);case 1:return[2,n.sent().data]}}))}))},t.prototype._sendOnline=function(){var t=Date.now(),o=Math.max(0,t-this._startTime),n=e(e({},this._commonParams),{appqid:this._getAppqid(),onlinetime:"".concat(o),endtime:t.toString(),starttime:this._startTime.toString()});this._online([n])},t.prototype._setOnlineBatchData=function(t){this._setStorage(r.ONLINE_BATCH_DATA,t)},t.prototype._getOnlineBatchData=function(){try{var t=this._getStorage(r.ONLINE_BATCH_DATA);if(Array.isArray(t))return t;if("string"==typeof t&&t){var e=this._safeJsonParse(t,[]);return Array.isArray(e)?e:[]}return[]}catch(t){return console.error("[XLOG] get online batch data error",t),[]}},t.prototype._clearOnlineBatchData=function(){this._setStorage(r.ONLINE_BATCH_DATA,"")},t.prototype._online=function(t){var e=this;t&&0!==t.length&&(this._consoleLog&&console.log("[XLOG] PARAMS(ONLINE)",t),this._clearOnlineBatchData(),this._request(this._onlineUrl,{batch:JSON.stringify(t)}).catch((function(o){console.error("[XLOG] Online log report failed, caching batch data",o),e._setOnlineBatchData(t)})))},t.prototype._initIAAPlugin=function(){var t;if(1===this._platform)try{if("undefined"==typeof requirePlugin)return void console.error("[XLOG:IAA] 环境不支持requirePlugin");var e=null===(t=requirePlugin("MiniGameCommon",{enableRequireHostModule:!0,customEnv:{wx:"undefined"!=typeof wx?wx:null}}))||void 0===t?void 0:t.default;if("function"!=typeof e)return void console.error("[XLOG:IAA] 插件加载失败,无法获取createMiniGameCommon");this._miniGameCommon=e(),this._miniGameCommon&&this._miniGameCommon.canIUse?("undefined"!=typeof GameGlobal&&(GameGlobal.miniGameCommon=this._miniGameCommon),this._consoleLog&&console.log("[XLOG:IAA] 插件初始化成功")):console.error("[XLOG:IAA] 插件初始化失败")}catch(t){console.error("[XLOG:IAA] 插件初始化异常",t)}else console.warn("[XLOG:IAA] 仅微信小程序支持IAA插件")},t.prototype.iaa=function(t){return o(this,void 0,void 0,(function(){var e=this;return n(this,(function(i){return this._miniGameCommon?[2,new Promise((function(i,s){setTimeout((function(){return o(e,void 0,void 0,(function(){var e,o,r,a;return n(this,(function(n){switch(n.label){case 0:e=null,o=t.sessionKey,r=t.reportData,n.label=1;case 1:return n.trys.push([1,3,,4]),[4,this._miniGameCommon.getUserLabel({reportData:JSON.stringify(r),labelId:"iaa_feature"})];case 2:return e=n.sent(),[3,4];case 3:return a=n.sent(),console.error("[XLOG:IAA] getUserLabel 调用失败:",a),s(a),[2];case 4:return e?(this._consoleLog&&console.log("[XLOG:IAA] 平台返回:",e),this._sendIAAData({session_key:o,requestReportData:JSON.stringify(r),iv:e.iv,encryptedData:e.encryptedData}),i(e),[2]):(s(new Error("Platform response is null")),[2])}}))}))}),3e4)}))]:(console.error("[XLOG:IAA] 插件未初始化"),[2])}))}))},t.prototype._sendIAAData=function(t){this._request("".concat(this._businessDomain,"/AppletUtils/util/wx/uploadReportData"),t,"application/json")},t}();t.XLog=p,Object.defineProperty(t,"__esModule",{value:!0})}));
6
+ !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).mp={})}(this,(function(t){"use strict";var e=function(){return e=Object.assign||function(t){for(var e,o=1,n=arguments.length;o<n;o++)for(var i in e=arguments[o])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t},e.apply(this,arguments)};function o(t,e,o,n){return new(o||(o=Promise))((function(i,s){function r(t){try{c(n.next(t))}catch(t){s(t)}}function a(t){try{c(n.throw(t))}catch(t){s(t)}}function c(t){var e;t.done?i(t.value):(e=t.value,e instanceof o?e:new o((function(t){t(e)}))).then(r,a)}c((n=n.apply(t,e||[])).next())}))}function n(t,e){var o,n,i,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]},r=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return r.next=a(0),r.throw=a(1),r.return=a(2),"function"==typeof Symbol&&(r[Symbol.iterator]=function(){return this}),r;function a(a){return function(c){return function(a){if(o)throw new TypeError("Generator is already executing.");for(;r&&(r=0,a[0]&&(s=0)),s;)try{if(o=1,n&&(i=2&a[0]?n.return:a[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,a[1])).done)return i;switch(n=0,i&&(a=[2&a[0],i.value]),a[0]){case 0:case 1:i=a;break;case 4:return s.label++,{value:a[1],done:!1};case 5:s.label++,n=a[1],a=[0];continue;case 7:a=s.ops.pop(),s.trys.pop();continue;default:if(!(i=s.trys,(i=i.length>0&&i[i.length-1])||6!==a[0]&&2!==a[0])){s=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]<i[3])){s.label=a[1];break}if(6===a[0]&&s.label<i[1]){s.label=i[1],i=a;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(a);break}i[2]&&s.ops.pop(),s.trys.pop();continue}a=e.call(t,s)}catch(t){a=[6,t],n=0}finally{o=i=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,c])}}}function i(){var t=new Date,e=t.getFullYear().toString(),o=(t.getMonth()+1).toString(),n=t.getDate().toString();return(e=e.toString().substr(-2))+(o=Number(o)<10?"0"+o:o)+(n=Number(n)<10?"0"+n:n)}"function"==typeof SuppressedError&&SuppressedError;var s,r,a,c="6.0.0",p="organic";t.EGender=void 0,(s=t.EGender||(t.EGender={}))[s.Unknown=0]="Unknown",s[s.Male=1]="Male",s[s.Female=2]="Female",function(t){t[t.WECHAT=1]="WECHAT",t[t.DOUYIN=2]="DOUYIN",t[t.TIKTOK=200]="TIKTOK",t[t.KUAISHOU=3]="KUAISHOU",t[t.BAIDU=4]="BAIDU",t[t.QQ=5]="QQ",t[t.WEB=7]="WEB"}(r||(r={})),function(t){t.BATCH_ID="BATCH_ID",t.COMMON_PARAMS="COMMON_PARAMS",t.ONLINE_BATCH_DATA="ONLINE_BATCH_DATA",t.ACCUMULATED_TIME="ACCUMULATED_TIME"}(a||(a={}));var l=function(){function t(t){var e,o,n=t.domain,i=t.commonParams,s=t.isPro,r=void 0===s||s,p=t.sendOpenLog,l=void 0===p||p,u=t.consoleLog,d=void 0===u||u,h=t.useIAA,m=void 0!==h&&h,_=t.periodicReportInterval,f=void 0===_?0:_;if(this.version=c,this.buildDate="5/8/2026, 5:19:34 PM",this._openUrl="",this._eventUrl="",this._actUrl="",this._adUrl="",this._onlineUrl="",this._businessDomain="",this._startTime=Date.now(),this._commonParams={},this._periodicReportInterval=0,this._accumulatedTime=0,this._periodicTimer=null,this._isPro=!0,this._sendOpenLog=!0,this._isColdStartUp=!0,this._systemInfo={},this._mp={},this._consoleLog=!0,this._useIAA=!1,this._sessionInfo={},this._isPro=r,this._sendOpenLog=l,this._consoleLog=d,this._useIAA=m,f>0){var y=f>0?f:10;this._periodicReportInterval=Math.max(1e3*y,5e3)}else this._periodicReportInterval=0;var v=this._getApis(n),g=v.openUrl,I=v.eventUrl,O=v.actUrl,A=v.adUrl,L=v.onlineUrl;this._openUrl=g,this._eventUrl=I,this._actUrl=O,this._adUrl=A,this._onlineUrl=L,this._businessDomain=this._isPro?"https://applet-xx.mop.com":"https://test-applet-xx.mop.com";var w,P=this._getMp(),b=P.mp,S=P.platform;this._mp=b,this._platform=S,!b||(w=b)&&0===Object.keys(w).length&&w.constructor===Object?console.error("[XLOG] 日志SDK初始化失败,当前环境为非小程序环境!"):this._consoleLog&&console.log("[XLOG] 小程序对象:",b,"平台类型:",S);try{this._systemInfo=(null===(o=null===(e=this._mp)||void 0===e?void 0:e.getSystemInfoSync)||void 0===o?void 0:o.call(e))||{},this._consoleLog&&console.log("[XLOG] 系统信息:",this._systemInfo)}catch(t){console.error("[XLOG] getSystemInfoSync error",t)}if(this._extraInfo={language:this._systemInfo.language,wxVersion:this._systemInfo.version,SDKVersion:this._systemInfo.SDKVersion,benchmarkLevel:this._systemInfo.benchmarkLevel||-1,theme:this._systemInfo.theme,pixelRatio:this._systemInfo.pixelRatio},this._periodicReportInterval>0){var T=this._getStorage(a.ACCUMULATED_TIME);this._accumulatedTime=T?Number(T):0,this._consoleLog&&console.log("[XLOG] 加载缓存的累计时长:",this._accumulatedTime,"ms")}this._init(i)}return Object.defineProperty(t.prototype,"commonParams",{get:function(){return this._commonParams},enumerable:!1,configurable:!0}),t.prototype._safeJsonParse=function(t,e){try{return t?JSON.parse(t):e}catch(o){return console.error("[XLOG] JSON解析错误:",o,"原始数据:",t),e}},t.prototype._getLaunchOptions=function(){var t,e,o,n,i,s,r,a,c,p,l,u;try{return 2===this._platform?(null===(e=null===(t=this._mp)||void 0===t?void 0:t.getLaunchOptionsSync)||void 0===e?void 0:e.call(t))||null:3===this._platform?(null===(n=null===(o=this._mp)||void 0===o?void 0:o.getLaunchOptionsSync)||void 0===n?void 0:n.call(o))||null:1===this._platform?(null===(s=null===(i=this._mp)||void 0===i?void 0:i.getEnterOptionsSync)||void 0===s?void 0:s.call(i))||(null===(a=null===(r=this._mp)||void 0===r?void 0:r.getLaunchOptionsSync)||void 0===a?void 0:a.call(r))||null:(null===(p=null===(c=this._mp)||void 0===c?void 0:c.getLaunchOptionsSync)||void 0===p?void 0:p.call(c))||(null===(u=null===(l=this._mp)||void 0===l?void 0:l.getEnterOptionsSync)||void 0===u?void 0:u.call(l))||null}catch(t){return console.error("[XLOG] 获取启动参数失败",t),null}},t.prototype._updateQuerystring=function(t,o){void 0===t&&(t=null),void 0===o&&(o={});var n=(null==t?void 0:t.query)?e(e({},t.query),o):o;this._updateCommonParams({srcqid:n.channel||"",userinfo:JSON.stringify({querystring:n})})},t.prototype._init=function(t){var e=this;this._initCommonParams(this._filterParams(t));var o=this._getLaunchOptions();this._updateQuerystring(o),this._coldStartUp(),this._useIAA&&this._initIAAPlugin(),this._visibilityChange((function(){e._isColdStartUp||e._getNetworkType().then((function(t){e._updateCommonParams({network:t}),e._open({openway:1})})),e._startTime=Date.now(),e._periodicReportInterval>0&&e._startPeriodicTimer();var t=e._getOnlineBatchData();t&&t.length>0&&e._online(t)}),(function(){if(e._isColdStartUp=!1,e._open({openway:5}),e._periodicReportInterval>0){e._stopPeriodicTimer();var t=Date.now()-e._startTime;e._accumulatedTime+=t,e._setStorage(a.ACCUMULATED_TIME,e._accumulatedTime.toString()),e._consoleLog&&console.log("[XLOG] 切后台,累计时长:",e._accumulatedTime,"ms")}else e._sendOnline()}))},t.prototype._startPeriodicTimer=function(){var t=this;this._periodicTimer&&clearInterval(this._periodicTimer),this._periodicTimer=setInterval((function(){t._checkPeriodicReport()}),1e3),this._consoleLog&&console.log("[XLOG] 启动定期上报定时器,间隔(ms):",this._periodicReportInterval)},t.prototype._stopPeriodicTimer=function(){this._periodicTimer&&(clearInterval(this._periodicTimer),this._periodicTimer=null,this._consoleLog&&console.log("[XLOG] 停止定期上报定时器"))},t.prototype._checkPeriodicReport=function(){var t=Date.now()-this._startTime,e=this._accumulatedTime+t;if(e>=this._periodicReportInterval){var o=Math.floor(e/this._periodicReportInterval),n=o*this._periodicReportInterval;this._sendPeriodicOnline(n,o),this._accumulatedTime=e-n,this._startTime=Date.now(),this._setStorage(a.ACCUMULATED_TIME,this._accumulatedTime.toString()),this._consoleLog&&console.log("[XLOG] 定期上报 ".concat(o," 次,总计 ").concat(n,"ms,剩余 ").concat(this._accumulatedTime,"ms"))}},t.prototype._sendPeriodicOnline=function(t,o){for(var n=Date.now()-t,i=[],s=0;s<o;s++){var r=n+s*this._periodicReportInterval,a=r+this._periodicReportInterval;i.push(e(e({},this._commonParams),{appqid:this._getAppqid(),onlinetime:this._periodicReportInterval.toString(),endtime:a.toString(),starttime:r.toString()}))}this._online(i)},t.prototype._getMp=function(){var t={mp:null,platform:r.WEB};try{if("undefined"!=typeof TTMinis&&TTMinis.game)return t.mp=TTMinis.game,t.platform=r.TIKTOK,t;if("undefined"!=typeof tt&&tt.getSystemInfoSync){var e=tt.getSystemInfoSync();return t.mp=tt,"TikTok"===e.appName?t.platform=r.TIKTOK:t.platform=r.DOUYIN,t}"undefined"!=typeof ks&&ks.getSystemInfo?(t.mp=ks,t.platform=r.KUAISHOU):"undefined"!=typeof swan&&swan.getSystemInfo?(t.mp=swan,t.platform=r.BAIDU):"undefined"!=typeof qq&&qq.getSystemInfo?(t.mp=qq,t.platform=r.QQ):"undefined"!=typeof wx&&wx.getSystemInfo&&(t.mp=wx,t.platform=r.WECHAT)}catch(t){console.error("[XLOG] Platform detection failed:",t)}return t},t.prototype._visibilityChange=function(t,e){var o,n,i,s,r=this;void 0===t&&(t=function(){}),void 0===e&&(e=function(){});try{var a=(null===(o=this._mp)||void 0===o?void 0:o.onAppShow)||(null===(n=this._mp)||void 0===n?void 0:n.onShow),c=(null===(i=this._mp)||void 0===i?void 0:i.onAppHide)||(null===(s=this._mp)||void 0===s?void 0:s.onHide);a&&a((function(){r._consoleLog&&console.log("[XLOG] onAppShow"),t()})),c&&c((function(){r._consoleLog&&console.log("[XLOG] onAppHide"),e()}))}catch(t){console.error("[XLOG] onAppShow or onAppHide error",t)}},t.prototype._getStorage=function(t){var e;try{var o=null===(e=this._mp)||void 0===e?void 0:e.getStorageSync("XYZ_LOG_".concat(t));return null==o?"":o}catch(t){return console.error("[XLOG] getStorageSync error",t),""}},t.prototype._setStorage=function(t,e){var o;try{null===(o=this._mp)||void 0===o||o.setStorageSync("XYZ_LOG_".concat(t),e)}catch(t){console.error("[XLOG] setStorageSync error",t)}},t.prototype._getBatchId=function(){var t=this._getStorage(a.BATCH_ID);return t||(t=function(t,e){void 0===t&&(t=18),void 0===e&&(e=0);for(var o="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz".split(""),n=[],i=Math.random,s=t,r=e||o.length,a=0;a<s;a++)n[a]=o[0|i()*r];return n.join("")}(),this._setStorage(a.BATCH_ID,t)),t},t.prototype._coldStartUp=function(){var t=this;this._getNetworkType().then((function(e){t._updateCommonParams({network:e}),t._open({openway:0}),t._periodicReportInterval>0&&t._startPeriodicTimer()}))},t.prototype._getApis=function(t){var o=this._isPro?{open:"webopen-inside.tt.cn",event:"webevent-inside.tt.cn",act:"webact-inside.tt.cn",ad:"webadv-inside.tt.cn",online:"webact-inside.tt.cn"}:{open:"test-webopen-inside.tt.cn",event:"test-webevent-inside.tt.cn",act:"test-webact-inside.tt.cn",ad:"test-webadv-inside.tt.cn",online:"test-webact-inside.tt.cn"},n=e(e({},o),t);return{openUrl:"https://".concat(n.open,"/gamefunction_logs/applet/open"),eventUrl:"https://".concat(n.event,"/gamefunction_logs/applet/event"),actUrl:"https://".concat(n.act,"/gamefunction_logs/applet/activity"),adUrl:"https://".concat(n.ad,"/gamefunction_logs/applet/adv"),onlineUrl:"https://".concat(n.online,"/gamefunction_logs/applet/onlineTime")}},t.prototype._cacheCommonParams=function(t){this._setStorage(a.COMMON_PARAMS,JSON.stringify(t))},t.prototype._getInitParams=function(){var t,e=(null===(t=this._systemInfo.system)||void 0===t?void 0:t.includes(" "))?this._systemInfo.system.split(" ")[1]:this._systemInfo.system;return{platform:this._platform,appcqid:p,appqid:p+i(),os:this._systemInfo.platform,osversion:e,device:this._systemInfo.model,devicebrand:this._systemInfo.brand,pixel:this._systemInfo.screenWidth+"*"+this._systemInfo.screenHeight,userinfo:this._getUserInfo()}},t.prototype._initCommonParams=function(t){var o=this._getInitParams(),n=this._getStorage(a.COMMON_PARAMS);n&&(o=e(e({},o),this._safeJsonParse(n,{}))),t&&(o=e(e({},o),t)),this._updateCommonParams(e(e({},o),{obatchid:this._getBatchId()}))},t.prototype._getNetworkType=function(){var t=this;return new Promise((function(e){var o;try{null===(o=t._mp)||void 0===o||o.getNetworkType({success:function(t){var o=((null==t?void 0:t.networkType)||"").toLowerCase();e({wifi:"wifi","2g":"2g","3g":"3g","4g":"4g","5g":"5g",none:"none",unknown:"unknown",ethernet:"wifi",cellular:"4g"}[o]||"unknown")},fail:function(){return e("none")}})}catch(t){console.error("[XLOG] getNetworkType error",t),e("none")}}))},t.prototype._getUserInfo=function(t){var o={};t&&(o=this._safeJsonParse(t,{}));var n={};return this.commonParams.userinfo&&(n=this._safeJsonParse(this.commonParams.userinfo,{})),JSON.stringify(e(e(e({},this._extraInfo),n),o))},t.prototype._filterParams=function(t){var e={};if(t){var o=["openid","unionid","accid","apptypeid","appsubid","appcqid","srcqid","appver","userinfo"];for(var n in t){var i=t[n];o.includes(n)&&i&&(e[n]=i)}}return e},t.prototype.setParams=function(t){if(t){this._consoleLog&&console.log("[XLOG] setParams",t);var e=this._commonParams.openid,o=this._commonParams.unionid;t=this._filterParams(t),this._updateCommonParams(t),(t.openid&&t.openid!==e||t.unionid&&t.unionid!==o)&&this._open({isreturn:t.openid?1:2,openway:0})}},t.prototype._updateCommonParams=function(t){if(this._consoleLog&&console.log("[XLOG] _updateCommonParams",t),t.userinfo){var o=t.appsubid||this._commonParams.appsubid;o&&(t.userinfo=JSON.stringify(e(e({},this._safeJsonParse(t.userinfo,{})),{appsubid:o}))),t.userinfo=this._getUserInfo(t.userinfo)}t.appcqid&&(t.appqid=t.appcqid+i()),t.appver&&(t.appverint=function(t){try{return t&&"string"==typeof t?t.split(".").map((function(t){return 1===t.length?"0"+t:t})).join(""):""}catch(e){return console.error('[transferVersion] ver("'.concat(t,'")格式异常:'),e),""}}(t.appver)),this._commonParams=e(e({},this._commonParams),t),this._cacheCommonParams(this._commonParams)},t.prototype._getAppqid=function(){return this._commonParams.appcqid+i()},t.prototype._getApptypeid=function(t){var e=t||this._commonParams.apptypeid||"";return e||console.warn("[XLOG] apptypeid未配置,请在初始化时传入或调用方法时传入"),e},t.prototype._request=function(t,e,o){var n=this;return void 0===o&&(o="application/x-www-form-urlencoded"),new Promise((function(i,s){var r;try{null===(r=n._mp)||void 0===r||r.request({url:t,data:e,method:"POST",header:{"content-type":o},success:function(o){n._consoleLog&&console.log("[XLOG] SUCCESS: ".concat(t),e,o),i(o)},fail:function(o){n._consoleLog&&console.error("[XLOG] FAIL: ".concat(t),e,o),s(o)}})}catch(t){console.error("[XLOG] request error",t),s(t)}}))},t.prototype.open=function(t){this._open({querystring:t.querystring,isreturn:3,openway:0,manual:!0})},t.prototype._open=function(t){if(this._sendOpenLog||t.manual){var o=this._getLaunchOptions();this._updateQuerystring(o,t.querystring);var n=e(e({},this._commonParams),{appqid:this._getAppqid(),wakeway:t.wakeway||(null==o?void 0:o.scene)||"",openway:t.openway,isreturn:t.isreturn||0,xmlog:c});this._consoleLog&&console.log("[XLOG] PARAMS(OPEN)",n),this._request(this._openUrl,n)}},t.prototype.event=function(t){var o=e(e({},this._commonParams),{appqid:this._getAppqid(),event1:t.event1||"",event2:t.event2||"",event3:t.event3||"",event4:t.event4||"",value1:t.value1||"",value2:t.value2||"",value3:t.value3||"",value4:t.value4||""});this._consoleLog&&console.log("[XLOG] PARAMS(EVENT)",o),this._request(this._eventUrl,o)},t.prototype.act=function(t){var o=e(e({},this._commonParams),{appqid:this._getAppqid(),actentryid:t.actentryid||"",subactid:t.subactid||"",type:t.type||"",custom:t.custom||"",batchid:t.batchid||""});this._consoleLog&&console.log("[XLOG] PARAMS(ACT)",o),this._request(this._actUrl,o)},t.prototype.ad=function(t){var o=e(e({},this._commonParams),{appqid:this._getAppqid(),type:t.type||"",code:t.code||"",codeinfo:t.codeinfo||"",pagetype:t.pagetype||"",gametype:t.gametype||"",adslot:t.adslot||"",adunitid:t.adunitid||"",adbatchid:t.adbatchid||"",ecpm:t.ecpm||""});this._consoleLog&&console.log("[XLOG] PARAMS(AD)",o),this._request(this._adUrl,o,"application/json")},t.prototype._getPlatformPath=function(){var t="";return 1===this._platform?t="wx/":3===this._platform&&(t="ks/"),t},t.prototype._getPlatformStr=function(){var t="DY";return 1===this._platform?t="WX":3===this._platform&&(t="KS"),t},t.prototype.code2session=function(t){var e;return o(this,void 0,void 0,(function(){var o,i,s,r,a;return n(this,(function(n){switch(n.label){case 0:return o=this._getApptypeid(t.apptypeid),i=this._getPlatformPath(),s="".concat(this._businessDomain,"/AppletUtils/").concat(i,"code2session"),[4,this._request(s,{appTypeId:o,code:t.code,testNet:t.testNet},"application/json")];case 1:return r=n.sent(),a=null===(e=r.data)||void 0===e?void 0:e.data,this._sessionInfo=null!=a?a:{},this.setParams({openid:this._sessionInfo.openid,unionid:this._sessionInfo.unionid}),[2,r.data]}}))}))},t.prototype.msgSecCheck=function(t){return o(this,void 0,void 0,(function(){var e,o,i,s,r,a;return n(this,(function(n){switch(n.label){case 0:return 1!==this._platform?(console.warn("[XLOG] msgSecCheck 仅支持微信小程序/小游戏平台"),[2]):(e=(t.content||"").trim())?(o=this._getApptypeid(t.apptypeid),(i=t.openid||this._sessionInfo.openid||this._commonParams.openid)?((s="number"==typeof t.scene?t.scene:4)!==(r=s>=1&&s<=5?s:4)&&console.warn("[XLOG] msgSecCheck scene超出范围,已回退为4"),a="".concat(this._businessDomain,"/AppletUtils/wx/msgCheck"),this._consoleLog&&console.log("[XLOG] PARAMS(MSG_SEC_CHECK)",{appTypeId:o,openid:i,scene:r,content:e}),[4,this._request(a,{appTypeId:o,openid:i,scene:r,content:e},"application/json")]):(console.warn("[XLOG] msgSecCheck openid不存在,请先登录(调用方法code2session)或手动传入openid",this._sessionInfo),[2])):(console.warn("[XLOG] msgSecCheck content不能为空"),[2]);case 1:return[2,n.sent().data]}}))}))},t.prototype.isLogin=function(){return!!this._sessionInfo.openid||(console.warn("[XLOG] checkLogin","openid不存在,请检查是否已经调用过登录(code2session)。"),!1)},t.prototype.getSubsidy=function(t){return void 0===t&&(t={}),o(this,void 0,void 0,(function(){var e,o;return n(this,(function(n){switch(n.label){case 0:return this.isLogin()?(e=this._getApptypeid(t.apptypeid),o=this._sessionInfo.openid,[4,this._request("".concat(this._businessDomain,"/AppletUtils/pay/ks/subsidy"),{apptypeid:e,os:this._systemInfo.platform,openId:o},"application/json")]):(console.warn("[XLOG] getSubsidy 请先登录(调用方法code2session)",this._sessionInfo),[2]);case 1:return[2,n.sent().data]}}))}))},t.prototype.getUserProps=function(t){return void 0===t&&(t={}),o(this,void 0,void 0,(function(){var e,o;return n(this,(function(n){switch(n.label){case 0:return this.isLogin()?(e=this._getApptypeid(t.apptypeid),o=this._sessionInfo.openid,[4,this._request("".concat(this._businessDomain,"/AppletUtils/pay/ks/userProps"),{appTypeId:e,openId:o},"application/json")]):(console.warn("[XLOG] getUserProps 请先登录(调用方法code2session)",this._sessionInfo),[2]);case 1:return[2,n.sent().data]}}))}))},t.prototype._sleep=function(t){return void 0===t&&(t=1e3),o(this,void 0,void 0,(function(){return n(this,(function(e){return[2,new Promise((function(e,o){setTimeout(e,t)}))]}))}))},t.prototype._checkOrderAfterPayment=function(t,i){var s;return o(this,void 0,void 0,(function(){var o,r;return n(this,(function(n){switch(n.label){case 0:return n.trys.push([0,3,,4]),[4,this._sleep()];case 1:return n.sent(),[4,this.checkOrder({orderId:t})];case 2:return o=n.sent(),[2,{payResult:1===Number(null===(s=null==o?void 0:o.data)||void 0===s?void 0:s.payResult)?1:0}];case 3:return r=n.sent(),console.error("[XLOG] 订单校验 err: ",r,e({orderId:t},i)),[2,{payResult:0}];case 4:return[2]}}))}))},t.prototype._payWx=function(t,i){var s;return o(this,void 0,void 0,(function(){var o,r,a,c,p,l,u,d,h,m,_,f,y,v,g,I=this;return n(this,(function(n){switch(n.label){case 0:if(this._consoleLog&&console.log('[XLOG] 当前平台: "'.concat(this._systemInfo.platform,'"')),o="ios"===(this._systemInfo.platform||"").toLowerCase(),r=i.orderId,a=i.payContent,p=(c=a||{}).offerId,l=c.zone_id,u=c.env,d=c.buy_quantity,h=c.kfMessageTitle,m=c.kfMessageImg,!o)return[3,4];_={sessionFrom:t.sessionFrom,showMessageCard:null===(s=t.showMessageCard)||void 0===s||s,sendMessageTitle:t.sendMessageTitle||h,sendMessagePath:t.sendMessagePath,sendMessageImg:t.sendMessageImg||m},n.label=1;case 1:return n.trys.push([1,3,,4]),[4,new Promise((function(t,o){var n;null===(n=I._mp)||void 0===n||n.openCustomerServiceConversation(e(e({},_),{success:t,fail:o}))}))];case 2:return v=n.sent(),this._consoleLog&&console.log("[XLOG] 进入客服会话",v),[2,{payResult:-1}];case 3:return f=n.sent(),console.error("[XLOG] 取消进入客服会话",f,_),[2,{payResult:0}];case 4:y={mode:"game",env:1===Number(u)?1:0,offerId:p,currencyType:"CNY",platform:"android",buyQuantity:Number(d||t.buyQuantity),zoneId:l,outTradeNo:r},n.label=5;case 5:return n.trys.push([5,7,,8]),[4,new Promise((function(t,o){var n;null===(n=I._mp)||void 0===n||n.requestMidasPayment(e(e({},y),{success:t,fail:o}))}))];case 6:return v=n.sent(),this._consoleLog&&console.log("[XLOG] 微信虚拟支付",v),[3,8];case 7:return g=n.sent(),console.error("[XLOG] 微信虚拟支付 err: ",g,y),[2,{payResult:0}];case 8:return[2,this._checkOrderAfterPayment(r,y)]}}))}))},t.prototype._payDy=function(t,i){var s;return o(this,void 0,void 0,(function(){var o,r,a,c,p,l,u,d,h,m,_,f,y,v,g=this;return n(this,(function(n){switch(n.label){case 0:if(o=i.orderId,r=i.payContent,c=(a=r||{}).zone_id,p=a.env,l=a.buy_quantity,u=a.extraInfo,d="ios"===(this._systemInfo.platform||"").toLowerCase(),h="windows"===(this._systemInfo.platform||"").toLowerCase(),!d)return[3,5];if(!(null===(s=this._mp)||void 0===s?void 0:s.openAwemeCustomerService))return console.error("[XLOG] 当前抖音基础库不支持 openAwemeCustomerService"),[2,{payResult:0}];m={currencyType:"DIAMOND",buyQuantity:Number(l||t.buyQuantity),zoneId:c||"1",customId:o,extraInfo:u},n.label=1;case 1:return n.trys.push([1,3,,4]),[4,new Promise((function(t,o){var n;null===(n=g._mp)||void 0===n||n.openAwemeCustomerService(e(e({},m),{success:t,fail:o}))}))];case 2:return y=n.sent(),this._consoleLog&&console.log("[XLOG] 抖音 iOS 客服支付",y),[3,4];case 3:return _=n.sent(),console.error("[XLOG] 抖音 iOS 客服支付 err: ",_,m),[2,{payResult:0}];case 4:return[2,this._checkOrderAfterPayment(o,m)];case 5:f={mode:"game",env:1===Number(p)?1:0,currencyType:"CNY",platform:h?"windows":"android",buyQuantity:Number(l||t.buyQuantity),zoneId:c||"1",customId:o,extraInfo:u},n.label=6;case 6:return n.trys.push([6,8,,9]),[4,new Promise((function(t,o){var n;null===(n=g._mp)||void 0===n||n.requestGamePayment(e(e({},f),{success:t,fail:o}))}))];case 7:return y=n.sent(),this._consoleLog&&console.log("[XLOG] 抖音支付",y),[3,9];case 8:return v=n.sent(),console.error("[XLOG] 抖音支付 err: ",v,f),[2,{payResult:0}];case 9:return[2,this._checkOrderAfterPayment(o,f)]}}))}))},t.prototype.pay=function(t){return o(this,void 0,void 0,(function(){var e,o;return n(this,(function(n){switch(n.label){case 0:return this._consoleLog&&console.log("[XLOG] pay params: ",t),"WX"!==(e=this._getPlatformStr())&&"DY"!==e?(console.error("[XLOG] 支付目前只支持微信/抖音平台,当前平台: ".concat(e||"UNKNOWN")),[2,{payResult:0}]):[4,this.createOrder(t)];case 1:return(null==(o=n.sent())?void 0:o.data)?"WX"===e?[2,this._payWx(t,o.data)]:[2,this._payDy(t,o.data)]:(console.error("[XLOG] 未获取到订单信息"),[2,{payResult:0}])}}))}))},t.prototype.checkOrder=function(t){return o(this,void 0,void 0,(function(){var e,o,i,s,r;return n(this,(function(n){switch(n.label){case 0:return this.isLogin()?(e=this._getApptypeid(t.apptypeid),o=this._getPlatformPath(),i=this._sessionInfo,s=i.openid,r=i.session_key,[4,this._request("".concat(this._businessDomain,"/AppletUtils/pay/").concat(o,"chkOrder"),{appTypeId:e,orderId:t.orderId,os:this._systemInfo.platform,openId:s,sessionKey:r},"application/json")]):(console.warn("[XLOG] checkOrder 请先登录(调用方法code2session)",this._sessionInfo),[2]);case 1:return[2,n.sent().data]}}))}))},t.prototype.createOrder=function(t){return o(this,void 0,void 0,(function(){var e,o,i;return n(this,(function(n){switch(n.label){case 0:return this.isLogin()?(e=this._getApptypeid(t.apptypeid),o=this._sessionInfo.openid,i=this._getPlatformStr(),[4,this._request("".concat(this._businessDomain,"/AppletUtils/pay/ks/crtOrder"),{appTypeId:e,productId:t.productId,extInfo:t.extInfo,os:this._systemInfo.platform,payPlatform:i,openId:o},"application/json")]):(console.warn("[XLOG] createOrder 请先登录(调用方法code2session)",this._sessionInfo),[2]);case 1:return[2,n.sent().data]}}))}))},t.prototype._sendOnline=function(){var t=Date.now(),o=Math.max(0,t-this._startTime),n=e(e({},this._commonParams),{appqid:this._getAppqid(),onlinetime:"".concat(o),endtime:t.toString(),starttime:this._startTime.toString()});this._online([n])},t.prototype._setOnlineBatchData=function(t){this._setStorage(a.ONLINE_BATCH_DATA,t)},t.prototype._getOnlineBatchData=function(){try{var t=this._getStorage(a.ONLINE_BATCH_DATA);if(Array.isArray(t))return t;if("string"==typeof t&&t){var e=this._safeJsonParse(t,[]);return Array.isArray(e)?e:[]}return[]}catch(t){return console.error("[XLOG] get online batch data error",t),[]}},t.prototype._clearOnlineBatchData=function(){this._setStorage(a.ONLINE_BATCH_DATA,"")},t.prototype._online=function(t){var e=this;t&&0!==t.length&&(this._consoleLog&&console.log("[XLOG] PARAMS(ONLINE)",t),this._clearOnlineBatchData(),this._request(this._onlineUrl,{batch:JSON.stringify(t)}).catch((function(o){console.error("[XLOG] Online log report failed, caching batch data",o),e._setOnlineBatchData(t)})))},t.prototype._initIAAPlugin=function(){var t;if(1===this._platform)try{if("undefined"==typeof requirePlugin)return void console.error("[XLOG:IAA] 环境不支持requirePlugin");var e=null===(t=requirePlugin("MiniGameCommon",{enableRequireHostModule:!0,customEnv:{wx:"undefined"!=typeof wx?wx:null}}))||void 0===t?void 0:t.default;if("function"!=typeof e)return void console.error("[XLOG:IAA] 插件加载失败,无法获取createMiniGameCommon");this._miniGameCommon=e(),this._miniGameCommon&&this._miniGameCommon.canIUse?("undefined"!=typeof GameGlobal&&(GameGlobal.miniGameCommon=this._miniGameCommon),this._consoleLog&&console.log("[XLOG:IAA] 插件初始化成功")):console.error("[XLOG:IAA] 插件初始化失败")}catch(t){console.error("[XLOG:IAA] 插件初始化异常",t)}else console.warn("[XLOG:IAA] 仅微信小程序支持IAA插件")},t.prototype.iaa=function(t){return o(this,void 0,void 0,(function(){var e=this;return n(this,(function(i){return this._miniGameCommon?[2,new Promise((function(i,s){setTimeout((function(){return o(e,void 0,void 0,(function(){var e,o,r,a;return n(this,(function(n){switch(n.label){case 0:e=null,o=t.sessionKey,r=t.reportData,n.label=1;case 1:return n.trys.push([1,3,,4]),[4,this._miniGameCommon.getUserLabel({reportData:JSON.stringify(r),labelId:"iaa_feature"})];case 2:return e=n.sent(),[3,4];case 3:return a=n.sent(),console.error("[XLOG:IAA] getUserLabel 调用失败:",a),s(a),[2];case 4:return e?(this._consoleLog&&console.log("[XLOG:IAA] 平台返回:",e),this._sendIAAData({session_key:o,requestReportData:JSON.stringify(r),iv:e.iv,encryptedData:e.encryptedData}),i(e),[2]):(s(new Error("Platform response is null")),[2])}}))}))}),3e4)}))]:(console.error("[XLOG:IAA] 插件未初始化"),[2])}))}))},t.prototype._sendIAAData=function(t){this._request("".concat(this._businessDomain,"/AppletUtils/util/wx/uploadReportData"),t,"application/json")},t}();t.XLog=l,Object.defineProperty(t,"__esModule",{value:!0})}));
package/dist/mp.mjs CHANGED
@@ -1,6 +1,6 @@
1
1
  /*!
2
- * @xyz-fe/log v5.3.0
2
+ * @xyz-fe/log v6.0.0
3
3
  * (c) lizhigao <lizhigao@021.com>
4
4
  * Released under the MIT License.
5
5
  */
6
- var t=function(){return t=Object.assign||function(t){for(var e,o=1,n=arguments.length;o<n;o++)for(var i in e=arguments[o])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t},t.apply(this,arguments)};function e(t,e,o,n){return new(o||(o=Promise))((function(i,s){function r(t){try{c(n.next(t))}catch(t){s(t)}}function a(t){try{c(n.throw(t))}catch(t){s(t)}}function c(t){var e;t.done?i(t.value):(e=t.value,e instanceof o?e:new o((function(t){t(e)}))).then(r,a)}c((n=n.apply(t,e||[])).next())}))}function o(t,e){var o,n,i,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]},r=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return r.next=a(0),r.throw=a(1),r.return=a(2),"function"==typeof Symbol&&(r[Symbol.iterator]=function(){return this}),r;function a(a){return function(c){return function(a){if(o)throw new TypeError("Generator is already executing.");for(;r&&(r=0,a[0]&&(s=0)),s;)try{if(o=1,n&&(i=2&a[0]?n.return:a[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,a[1])).done)return i;switch(n=0,i&&(a=[2&a[0],i.value]),a[0]){case 0:case 1:i=a;break;case 4:return s.label++,{value:a[1],done:!1};case 5:s.label++,n=a[1],a=[0];continue;case 7:a=s.ops.pop(),s.trys.pop();continue;default:if(!(i=s.trys,(i=i.length>0&&i[i.length-1])||6!==a[0]&&2!==a[0])){s=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]<i[3])){s.label=a[1];break}if(6===a[0]&&s.label<i[1]){s.label=i[1],i=a;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(a);break}i[2]&&s.ops.pop(),s.trys.pop();continue}a=e.call(t,s)}catch(t){a=[6,t],n=0}finally{o=i=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,c])}}}function n(){var t=new Date,e=t.getFullYear().toString(),o=(t.getMonth()+1).toString(),n=t.getDate().toString();return(e=e.toString().substr(-2))+(o=Number(o)<10?"0"+o:o)+(n=Number(n)<10?"0"+n:n)}"function"==typeof SuppressedError&&SuppressedError;var i,s,r="5.3.0",a="organic";!function(t){t[t.Unknown=0]="Unknown",t[t.Male=1]="Male",t[t.Female=2]="Female"}(i||(i={})),function(t){t.BATCH_ID="BATCH_ID",t.COMMON_PARAMS="COMMON_PARAMS",t.ONLINE_BATCH_DATA="ONLINE_BATCH_DATA",t.ACCUMULATED_TIME="ACCUMULATED_TIME"}(s||(s={}));var c=function(){function i(t){var e,o,n=t.domain,i=t.commonParams,a=t.isPro,c=void 0===a||a,p=t.sendOpenLog,l=void 0===p||p,u=t.consoleLog,h=void 0===u||u,d=t.useIAA,m=void 0!==d&&d,_=t.periodicReportInterval,f=void 0===_?0:_;if(this.version=r,this.buildDate="4/17/2026, 4:35:54 PM",this._openUrl="",this._eventUrl="",this._actUrl="",this._adUrl="",this._onlineUrl="",this._businessDomain="",this._startTime=Date.now(),this._commonParams={},this._periodicReportInterval=0,this._accumulatedTime=0,this._periodicTimer=null,this._isPro=!0,this._sendOpenLog=!0,this._isColdStartUp=!0,this._systemInfo={},this._mp={},this._consoleLog=!0,this._useIAA=!1,this._sessionInfo={},this._isPro=c,this._sendOpenLog=l,this._consoleLog=h,this._useIAA=m,f>0){var y=f>0?f:10;this._periodicReportInterval=Math.max(1e3*y,5e3)}else this._periodicReportInterval=0;var v=this._getApis(n),g=v.openUrl,I=v.eventUrl,O=v.actUrl,L=v.adUrl,A=v.onlineUrl;this._openUrl=g,this._eventUrl=I,this._actUrl=O,this._adUrl=L,this._onlineUrl=A,this._businessDomain=this._isPro?"https://applet-xx.mop.com":"https://test-applet-xx.mop.com";var w,P=this._getMp(),b=P.mp,S=P.platform;this._mp=b,this._platform=S,!b||(w=b)&&0===Object.keys(w).length&&w.constructor===Object?console.error("[XLOG] 日志SDK初始化失败,当前环境为非小程序环境!"):this._consoleLog&&console.log("[XLOG] 小程序对象:",b,"平台类型:",S);try{this._systemInfo=(null===(o=null===(e=this._mp)||void 0===e?void 0:e.getSystemInfoSync)||void 0===o?void 0:o.call(e))||{},this._consoleLog&&console.log("[XLOG] 系统信息:",this._systemInfo)}catch(t){console.error("[XLOG] getSystemInfoSync error",t)}if(this._extraInfo={language:this._systemInfo.language,wxVersion:this._systemInfo.version,SDKVersion:this._systemInfo.SDKVersion,benchmarkLevel:this._systemInfo.benchmarkLevel||-1,theme:this._systemInfo.theme,pixelRatio:this._systemInfo.pixelRatio},this._periodicReportInterval>0){var G=this._getStorage(s.ACCUMULATED_TIME);this._accumulatedTime=G?Number(G):0,this._consoleLog&&console.log("[XLOG] 加载缓存的累计时长:",this._accumulatedTime,"ms")}this._init(i)}return Object.defineProperty(i.prototype,"commonParams",{get:function(){return this._commonParams},enumerable:!1,configurable:!0}),i.prototype._safeJsonParse=function(t,e){try{return t?JSON.parse(t):e}catch(o){return console.error("[XLOG] JSON解析错误:",o,"原始数据:",t),e}},i.prototype._getLaunchOptions=function(){var t,e,o,n,i,s,r,a,c,p,l,u;try{return 2===this._platform?(null===(e=null===(t=this._mp)||void 0===t?void 0:t.getLaunchOptionsSync)||void 0===e?void 0:e.call(t))||null:3===this._platform?(null===(n=null===(o=this._mp)||void 0===o?void 0:o.getLaunchOptionsSync)||void 0===n?void 0:n.call(o))||null:1===this._platform?(null===(s=null===(i=this._mp)||void 0===i?void 0:i.getEnterOptionsSync)||void 0===s?void 0:s.call(i))||(null===(a=null===(r=this._mp)||void 0===r?void 0:r.getLaunchOptionsSync)||void 0===a?void 0:a.call(r))||null:(null===(p=null===(c=this._mp)||void 0===c?void 0:c.getLaunchOptionsSync)||void 0===p?void 0:p.call(c))||(null===(u=null===(l=this._mp)||void 0===l?void 0:l.getEnterOptionsSync)||void 0===u?void 0:u.call(l))||null}catch(t){return console.error("[XLOG] 获取启动参数失败",t),null}},i.prototype._updateQuerystring=function(e,o){void 0===e&&(e=null),void 0===o&&(o={});var n=(null==e?void 0:e.query)?t(t({},e.query),o):o;this._updateCommonParams({srcqid:n.channel||"",userinfo:JSON.stringify({querystring:n})})},i.prototype._init=function(t){var e=this;this._initCommonParams(this._filterParams(t));var o=this._getLaunchOptions();this._updateQuerystring(o),this._coldStartUp(),this._useIAA&&this._initIAAPlugin(),this._visibilityChange((function(){e._isColdStartUp||e._getNetworkType().then((function(t){e._updateCommonParams({network:t}),e._open({openway:1})})),e._startTime=Date.now(),e._periodicReportInterval>0&&e._startPeriodicTimer();var t=e._getOnlineBatchData();t&&t.length>0&&e._online(t)}),(function(){if(e._isColdStartUp=!1,e._open({openway:5}),e._periodicReportInterval>0){e._stopPeriodicTimer();var t=Date.now()-e._startTime;e._accumulatedTime+=t,e._setStorage(s.ACCUMULATED_TIME,e._accumulatedTime.toString()),e._consoleLog&&console.log("[XLOG] 切后台,累计时长:",e._accumulatedTime,"ms")}else e._sendOnline()}))},i.prototype._startPeriodicTimer=function(){var t=this;this._periodicTimer&&clearInterval(this._periodicTimer),this._periodicTimer=setInterval((function(){t._checkPeriodicReport()}),1e3),this._consoleLog&&console.log("[XLOG] 启动定期上报定时器,间隔(ms):",this._periodicReportInterval)},i.prototype._stopPeriodicTimer=function(){this._periodicTimer&&(clearInterval(this._periodicTimer),this._periodicTimer=null,this._consoleLog&&console.log("[XLOG] 停止定期上报定时器"))},i.prototype._checkPeriodicReport=function(){var t=Date.now()-this._startTime,e=this._accumulatedTime+t;if(e>=this._periodicReportInterval){var o=Math.floor(e/this._periodicReportInterval),n=o*this._periodicReportInterval;this._sendPeriodicOnline(n,o),this._accumulatedTime=e-n,this._startTime=Date.now(),this._setStorage(s.ACCUMULATED_TIME,this._accumulatedTime.toString()),this._consoleLog&&console.log("[XLOG] 定期上报 ".concat(o," 次,总计 ").concat(n,"ms,剩余 ").concat(this._accumulatedTime,"ms"))}},i.prototype._sendPeriodicOnline=function(e,o){for(var n=Date.now()-e,i=[],s=0;s<o;s++){var r=n+s*this._periodicReportInterval,a=r+this._periodicReportInterval;i.push(t(t({},this._commonParams),{appqid:this._getAppqid(),onlinetime:this._periodicReportInterval.toString(),endtime:a.toString(),starttime:r.toString()}))}this._online(i)},i.prototype._getMp=function(){var t={mp:null,platform:7};return"undefined"!=typeof tt&&tt.getSystemInfo?(t.mp=tt,t.platform=2):"undefined"!=typeof ks&&ks.getSystemInfo?(t.mp=ks,t.platform=3):"undefined"!=typeof swan&&swan.getSystemInfo?(t.mp=swan,t.platform=4):"undefined"!=typeof qq&&qq.getSystemInfo?(t.mp=qq,t.platform=5):"undefined"!=typeof wx&&wx.getSystemInfo?(t.mp=wx,t.platform=1):"undefined"!=typeof my&&my.getSystemInfo?t.mp=my:"undefined"!=typeof jd&&jd.getSystemInfo&&(t.mp=jd),t},i.prototype._visibilityChange=function(t,e){var o,n,i,s,r=this;void 0===t&&(t=function(){}),void 0===e&&(e=function(){});try{var a=(null===(o=this._mp)||void 0===o?void 0:o.onAppShow)||(null===(n=this._mp)||void 0===n?void 0:n.onShow),c=(null===(i=this._mp)||void 0===i?void 0:i.onAppHide)||(null===(s=this._mp)||void 0===s?void 0:s.onHide);a&&a((function(){r._consoleLog&&console.log("[XLOG] onAppShow"),t()})),c&&c((function(){r._consoleLog&&console.log("[XLOG] onAppHide"),e()}))}catch(t){console.error("[XLOG] onAppShow or onAppHide error",t)}},i.prototype._getStorage=function(t){var e;try{var o=null===(e=this._mp)||void 0===e?void 0:e.getStorageSync("XYZ_LOG_".concat(t));return null==o?"":o}catch(t){return console.error("[XLOG] getStorageSync error",t),""}},i.prototype._setStorage=function(t,e){var o;try{null===(o=this._mp)||void 0===o||o.setStorageSync("XYZ_LOG_".concat(t),e)}catch(t){console.error("[XLOG] setStorageSync error",t)}},i.prototype._getBatchId=function(){var t=this._getStorage(s.BATCH_ID);return t||(t=function(t,e){void 0===t&&(t=18),void 0===e&&(e=0);for(var o="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz".split(""),n=[],i=Math.random,s=t,r=e||o.length,a=0;a<s;a++)n[a]=o[0|i()*r];return n.join("")}(),this._setStorage(s.BATCH_ID,t)),t},i.prototype._coldStartUp=function(){var t=this;this._getNetworkType().then((function(e){t._updateCommonParams({network:e}),t._open({openway:0}),t._periodicReportInterval>0&&t._startPeriodicTimer()}))},i.prototype._getApis=function(e){var o=this._isPro?{open:"webopen-inside.tt.cn",event:"webevent-inside.tt.cn",act:"webact-inside.tt.cn",ad:"webadv-inside.tt.cn",online:"webact-inside.tt.cn"}:{open:"test-webopen-inside.tt.cn",event:"test-webevent-inside.tt.cn",act:"test-webact-inside.tt.cn",ad:"test-webadv-inside.tt.cn",online:"test-webact-inside.tt.cn"},n=t(t({},o),e);return{openUrl:"https://".concat(n.open,"/gamefunction_logs/applet/open"),eventUrl:"https://".concat(n.event,"/gamefunction_logs/applet/event"),actUrl:"https://".concat(n.act,"/gamefunction_logs/applet/activity"),adUrl:"https://".concat(n.ad,"/gamefunction_logs/applet/adv"),onlineUrl:"https://".concat(n.online,"/gamefunction_logs/applet/onlineTime")}},i.prototype._cacheCommonParams=function(t){this._setStorage(s.COMMON_PARAMS,JSON.stringify(t))},i.prototype._getInitParams=function(){var t,e=(null===(t=this._systemInfo.system)||void 0===t?void 0:t.includes(" "))?this._systemInfo.system.split(" ")[1]:this._systemInfo.system;return{platform:this._platform,appcqid:a,appqid:a+n(),os:this._systemInfo.platform,osversion:e,device:this._systemInfo.model,devicebrand:this._systemInfo.brand,pixel:this._systemInfo.screenWidth+"*"+this._systemInfo.screenHeight,userinfo:this._getUserInfo()}},i.prototype._initCommonParams=function(e){var o=this._getInitParams(),n=this._getStorage(s.COMMON_PARAMS);n&&(o=t(t({},o),this._safeJsonParse(n,{}))),e&&(o=t(t({},o),e)),this._updateCommonParams(t(t({},o),{obatchid:this._getBatchId()}))},i.prototype._getNetworkType=function(){var t=this;return new Promise((function(e){var o;try{null===(o=t._mp)||void 0===o||o.getNetworkType({success:function(t){var o=((null==t?void 0:t.networkType)||"").toLowerCase();e({wifi:"wifi","2g":"2g","3g":"3g","4g":"4g","5g":"5g",none:"none",unknown:"unknown",ethernet:"wifi",cellular:"4g"}[o]||"unknown")},fail:function(){return e("none")}})}catch(t){console.error("[XLOG] getNetworkType error",t),e("none")}}))},i.prototype._getUserInfo=function(e){var o={};e&&(o=this._safeJsonParse(e,{}));var n={};return this.commonParams.userinfo&&(n=this._safeJsonParse(this.commonParams.userinfo,{})),JSON.stringify(t(t(t({},this._extraInfo),n),o))},i.prototype._filterParams=function(t){var e={};if(t){var o=["openid","unionid","accid","apptypeid","appsubid","appcqid","srcqid","appver","userinfo"];for(var n in t){var i=t[n];o.includes(n)&&i&&(e[n]=i)}}return e},i.prototype.setParams=function(t){if(t){this._consoleLog&&console.log("[XLOG] setParams",t);var e=this._commonParams.openid,o=this._commonParams.unionid;t=this._filterParams(t),this._updateCommonParams(t),(t.openid&&t.openid!==e||t.unionid&&t.unionid!==o)&&this._open({isreturn:t.openid?1:2,openway:0})}},i.prototype._updateCommonParams=function(e){if(this._consoleLog&&console.log("[XLOG] _updateCommonParams",e),e.userinfo){var o=e.appsubid||this._commonParams.appsubid;o&&(e.userinfo=JSON.stringify(t(t({},this._safeJsonParse(e.userinfo,{})),{appsubid:o}))),e.userinfo=this._getUserInfo(e.userinfo)}e.appcqid&&(e.appqid=e.appcqid+n()),e.appver&&(e.appverint=function(t){try{return t&&"string"==typeof t?t.split(".").map((function(t){return 1===t.length?"0"+t:t})).join(""):""}catch(e){return console.error('[transferVersion] ver("'.concat(t,'")格式异常:'),e),""}}(e.appver)),this._commonParams=t(t({},this._commonParams),e),this._cacheCommonParams(this._commonParams)},i.prototype._getAppqid=function(){return this._commonParams.appcqid+n()},i.prototype._getApptypeid=function(t){var e=t||this._commonParams.apptypeid||"";return e||console.warn("[XLOG] apptypeid未配置,请在初始化时传入或调用方法时传入"),e},i.prototype._request=function(t,e,o){var n=this;return void 0===o&&(o="application/x-www-form-urlencoded"),new Promise((function(i,s){var r;try{null===(r=n._mp)||void 0===r||r.request({url:t,data:e,method:"POST",header:{"content-type":o},success:function(o){n._consoleLog&&console.log("[XLOG] SUCCESS: ".concat(t),e,o),i(o)},fail:function(o){n._consoleLog&&console.error("[XLOG] FAIL: ".concat(t),e,o),s(o)}})}catch(t){console.error("[XLOG] request error",t),s(t)}}))},i.prototype.open=function(t){this._open({querystring:t.querystring,isreturn:3,openway:0,manual:!0})},i.prototype._open=function(e){if(this._sendOpenLog||e.manual){var o=this._getLaunchOptions();this._updateQuerystring(o,e.querystring);var n=t(t({},this._commonParams),{appqid:this._getAppqid(),wakeway:e.wakeway||(null==o?void 0:o.scene)||"",openway:e.openway,isreturn:e.isreturn||0,xmlog:r});this._consoleLog&&console.log("[XLOG] PARAMS(OPEN)",n),this._request(this._openUrl,n)}},i.prototype.event=function(e){var o=t(t({},this._commonParams),{appqid:this._getAppqid(),event1:e.event1||"",event2:e.event2||"",event3:e.event3||"",event4:e.event4||"",value1:e.value1||"",value2:e.value2||"",value3:e.value3||"",value4:e.value4||""});this._consoleLog&&console.log("[XLOG] PARAMS(EVENT)",o),this._request(this._eventUrl,o)},i.prototype.act=function(e){var o=t(t({},this._commonParams),{appqid:this._getAppqid(),actentryid:e.actentryid||"",subactid:e.subactid||"",type:e.type||"",custom:e.custom||"",batchid:e.batchid||""});this._consoleLog&&console.log("[XLOG] PARAMS(ACT)",o),this._request(this._actUrl,o)},i.prototype.ad=function(e){var o=t(t({},this._commonParams),{appqid:this._getAppqid(),type:e.type||"",code:e.code||"",codeinfo:e.codeinfo||"",pagetype:e.pagetype||"",gametype:e.gametype||"",adslot:e.adslot||"",adunitid:e.adunitid||"",adbatchid:e.adbatchid||"",ecpm:e.ecpm||""});this._consoleLog&&console.log("[XLOG] PARAMS(AD)",o),this._request(this._adUrl,o,"application/json")},i.prototype._getPlatformPath=function(){var t="";return 1===this._platform?t="wx/":3===this._platform&&(t="ks/"),t},i.prototype._getPlatformStr=function(){var t="DY";return 1===this._platform?t="WX":3===this._platform&&(t="KS"),t},i.prototype.code2session=function(t){var n;return e(this,void 0,void 0,(function(){var e,i,s,r,a;return o(this,(function(o){switch(o.label){case 0:return e=this._getApptypeid(t.apptypeid),i=this._getPlatformPath(),s="".concat(this._businessDomain,"/AppletUtils/").concat(i,"code2session"),[4,this._request(s,{appTypeId:e,code:t.code,testNet:t.testNet},"application/json")];case 1:return r=o.sent(),a=null===(n=r.data)||void 0===n?void 0:n.data,this._sessionInfo=null!=a?a:{},this.setParams({openid:this._sessionInfo.openid,unionid:this._sessionInfo.unionid}),[2,r.data]}}))}))},i.prototype.msgSecCheck=function(t){return e(this,void 0,void 0,(function(){var e,n,i,s,r,a;return o(this,(function(o){switch(o.label){case 0:return 1!==this._platform?(console.warn("[XLOG] msgSecCheck 仅支持微信小程序/小游戏平台"),[2]):(e=(t.content||"").trim())?(n=this._getApptypeid(t.apptypeid),(i=t.openid||this._sessionInfo.openid||this._commonParams.openid)?((s="number"==typeof t.scene?t.scene:4)!==(r=s>=1&&s<=5?s:4)&&console.warn("[XLOG] msgSecCheck scene超出范围,已回退为4"),a="".concat(this._businessDomain,"/AppletUtils/wx/msgCheck"),this._consoleLog&&console.log("[XLOG] PARAMS(MSG_SEC_CHECK)",{appTypeId:n,openid:i,scene:r,content:e}),[4,this._request(a,{appTypeId:n,openid:i,scene:r,content:e},"application/json")]):(console.warn("[XLOG] msgSecCheck openid不存在,请先登录(调用方法code2session)或手动传入openid",this._sessionInfo),[2])):(console.warn("[XLOG] msgSecCheck content不能为空"),[2]);case 1:return[2,o.sent().data]}}))}))},i.prototype.isLogin=function(){return!!this._sessionInfo.openid||(console.warn("[XLOG] checkLogin","openid不存在,请检查是否已经调用过登录(code2session)。"),!1)},i.prototype.getSubsidy=function(t){return void 0===t&&(t={}),e(this,void 0,void 0,(function(){var e,n;return o(this,(function(o){switch(o.label){case 0:return this.isLogin()?(e=this._getApptypeid(t.apptypeid),n=this._sessionInfo.openid,[4,this._request("".concat(this._businessDomain,"/AppletUtils/pay/ks/subsidy"),{apptypeid:e,os:this._systemInfo.platform,openId:n},"application/json")]):(console.warn("[XLOG] getSubsidy 请先登录(调用方法code2session)",this._sessionInfo),[2]);case 1:return[2,o.sent().data]}}))}))},i.prototype.getUserProps=function(t){return void 0===t&&(t={}),e(this,void 0,void 0,(function(){var e,n;return o(this,(function(o){switch(o.label){case 0:return this.isLogin()?(e=this._getApptypeid(t.apptypeid),n=this._sessionInfo.openid,[4,this._request("".concat(this._businessDomain,"/AppletUtils/pay/ks/userProps"),{appTypeId:e,openId:n},"application/json")]):(console.warn("[XLOG] getUserProps 请先登录(调用方法code2session)",this._sessionInfo),[2]);case 1:return[2,o.sent().data]}}))}))},i.prototype._sleep=function(t){return void 0===t&&(t=1e3),e(this,void 0,void 0,(function(){return o(this,(function(e){return[2,new Promise((function(e,o){setTimeout(e,t)}))]}))}))},i.prototype._checkOrderAfterPayment=function(n,i){var s;return e(this,void 0,void 0,(function(){var e,r;return o(this,(function(o){switch(o.label){case 0:return o.trys.push([0,3,,4]),[4,this._sleep()];case 1:return o.sent(),[4,this.checkOrder({orderId:n})];case 2:return e=o.sent(),[2,{payResult:1===Number(null===(s=null==e?void 0:e.data)||void 0===s?void 0:s.payResult)?1:0}];case 3:return r=o.sent(),console.error("[XLOG] 订单校验 err: ",r,t({orderId:n},i)),[2,{payResult:0}];case 4:return[2]}}))}))},i.prototype._payWx=function(n,i){var s;return e(this,void 0,void 0,(function(){var e,r,a,c,p,l,u,h,d,m,_,f,y,v,g,I=this;return o(this,(function(o){switch(o.label){case 0:if(this._consoleLog&&console.log('[XLOG] 当前平台: "'.concat(this._systemInfo.platform,'"')),e="ios"===(this._systemInfo.platform||"").toLowerCase(),r=i.orderId,a=i.payContent,p=(c=a||{}).offerId,l=c.zone_id,u=c.env,h=c.buy_quantity,d=c.kfMessageTitle,m=c.kfMessageImg,!e)return[3,4];_={sessionFrom:n.sessionFrom,showMessageCard:null===(s=n.showMessageCard)||void 0===s||s,sendMessageTitle:n.sendMessageTitle||d,sendMessagePath:n.sendMessagePath,sendMessageImg:n.sendMessageImg||m},o.label=1;case 1:return o.trys.push([1,3,,4]),[4,new Promise((function(e,o){I._mp.openCustomerServiceConversation(t(t({},_),{success:e,fail:o}))}))];case 2:return v=o.sent(),this._consoleLog&&console.log("[XLOG] 进入客服会话",v),[2,{payResult:-1}];case 3:return f=o.sent(),console.error("[XLOG] 取消进入客服会话",f,_),[2,{payResult:0}];case 4:y={mode:"game",env:1===Number(u)?1:0,offerId:p,currencyType:"CNY",platform:"android",buyQuantity:Number(h||n.buyQuantity),zoneId:l,outTradeNo:r},o.label=5;case 5:return o.trys.push([5,7,,8]),[4,new Promise((function(e,o){I._mp.requestMidasPayment(t(t({},y),{success:e,fail:o}))}))];case 6:return v=o.sent(),this._consoleLog&&console.log("[XLOG] 微信虚拟支付",v),[3,8];case 7:return g=o.sent(),console.error("[XLOG] 微信虚拟支付 err: ",g,y),[2,{payResult:0}];case 8:return[2,this._checkOrderAfterPayment(r,y)]}}))}))},i.prototype._payDy=function(n,i){var s;return e(this,void 0,void 0,(function(){var e,r,a,c,p,l,u,h,d,m,_,f,y,v,g=this;return o(this,(function(o){switch(o.label){case 0:if(e=i.orderId,r=i.payContent,c=(a=r||{}).zone_id,p=a.env,l=a.buy_quantity,u=a.extraInfo,h="ios"===(this._systemInfo.platform||"").toLowerCase(),d="windows"===(this._systemInfo.platform||"").toLowerCase(),!h)return[3,5];if(!(null===(s=this._mp)||void 0===s?void 0:s.openAwemeCustomerService))return console.error("[XLOG] 当前抖音基础库不支持 openAwemeCustomerService"),[2,{payResult:0}];m={currencyType:"DIAMOND",buyQuantity:Number(l||n.buyQuantity),zoneId:c||"1",customId:e,extraInfo:n.extInfo||u},o.label=1;case 1:return o.trys.push([1,3,,4]),[4,new Promise((function(e,o){g._mp.openAwemeCustomerService(t(t({},m),{success:e,fail:o}))}))];case 2:return y=o.sent(),this._consoleLog&&console.log("[XLOG] 抖音 iOS 客服支付",y),[3,4];case 3:return _=o.sent(),console.error("[XLOG] 抖音 iOS 客服支付 err: ",_,m),[2,{payResult:0}];case 4:return[2,this._checkOrderAfterPayment(e,m)];case 5:f={mode:"game",env:1===Number(p)?1:0,currencyType:"CNY",platform:d?"windows":"android",buyQuantity:Number(l||n.buyQuantity),zoneId:c||"1",customId:e,extraInfo:n.extInfo||u},o.label=6;case 6:return o.trys.push([6,8,,9]),[4,new Promise((function(e,o){g._mp.requestGamePayment(t(t({},f),{success:e,fail:o}))}))];case 7:return y=o.sent(),this._consoleLog&&console.log("[XLOG] 抖音支付",y),[3,9];case 8:return v=o.sent(),console.error("[XLOG] 抖音支付 err: ",v,f),[2,{payResult:0}];case 9:return[2,this._checkOrderAfterPayment(e,f)]}}))}))},i.prototype.pay=function(t){return e(this,void 0,void 0,(function(){var e,n;return o(this,(function(o){switch(o.label){case 0:return this._consoleLog&&console.log("[XLOG] pay params: ",t),"WX"!==(e=this._getPlatformStr())&&"DY"!==e?(console.error("[XLOG] 支付目前只支持微信/抖音平台,当前平台: ".concat(e||"UNKNOWN")),[2,{payResult:0}]):[4,this.createOrder(t)];case 1:return(null==(n=o.sent())?void 0:n.data)?"WX"===e?[2,this._payWx(t,n.data)]:[2,this._payDy(t,n.data)]:(console.error("[XLOG] 未获取到订单信息"),[2,{payResult:0}])}}))}))},i.prototype.checkOrder=function(t){return e(this,void 0,void 0,(function(){var e,n,i,s,r;return o(this,(function(o){switch(o.label){case 0:return this.isLogin()?(e=this._getApptypeid(t.apptypeid),n=this._getPlatformPath(),i=this._sessionInfo,s=i.openid,r=i.session_key,[4,this._request("".concat(this._businessDomain,"/AppletUtils/pay/").concat(n,"chkOrder"),{appTypeId:e,orderId:t.orderId,os:this._systemInfo.platform,openId:s,sessionKey:r},"application/json")]):(console.warn("[XLOG] checkOrder 请先登录(调用方法code2session)",this._sessionInfo),[2]);case 1:return[2,o.sent().data]}}))}))},i.prototype.createOrder=function(t){return e(this,void 0,void 0,(function(){var e,n,i;return o(this,(function(o){switch(o.label){case 0:return this.isLogin()?(e=this._getApptypeid(t.apptypeid),n=this._sessionInfo.openid,i=this._getPlatformStr(),[4,this._request("".concat(this._businessDomain,"/AppletUtils/pay/ks/crtOrder"),{appTypeId:e,productId:t.productId,extInfo:t.extInfo,os:this._systemInfo.platform,payPlatform:i,openId:n},"application/json")]):(console.warn("[XLOG] createOrder 请先登录(调用方法code2session)",this._sessionInfo),[2]);case 1:return[2,o.sent().data]}}))}))},i.prototype._sendOnline=function(){var e=Date.now(),o=Math.max(0,e-this._startTime),n=t(t({},this._commonParams),{appqid:this._getAppqid(),onlinetime:"".concat(o),endtime:e.toString(),starttime:this._startTime.toString()});this._online([n])},i.prototype._setOnlineBatchData=function(t){this._setStorage(s.ONLINE_BATCH_DATA,t)},i.prototype._getOnlineBatchData=function(){try{var t=this._getStorage(s.ONLINE_BATCH_DATA);if(Array.isArray(t))return t;if("string"==typeof t&&t){var e=this._safeJsonParse(t,[]);return Array.isArray(e)?e:[]}return[]}catch(t){return console.error("[XLOG] get online batch data error",t),[]}},i.prototype._clearOnlineBatchData=function(){this._setStorage(s.ONLINE_BATCH_DATA,"")},i.prototype._online=function(t){var e=this;t&&0!==t.length&&(this._consoleLog&&console.log("[XLOG] PARAMS(ONLINE)",t),this._clearOnlineBatchData(),this._request(this._onlineUrl,{batch:JSON.stringify(t)}).catch((function(o){console.error("[XLOG] Online log report failed, caching batch data",o),e._setOnlineBatchData(t)})))},i.prototype._initIAAPlugin=function(){var t;if(1===this._platform)try{if("undefined"==typeof requirePlugin)return void console.error("[XLOG:IAA] 环境不支持requirePlugin");var e=null===(t=requirePlugin("MiniGameCommon",{enableRequireHostModule:!0,customEnv:{wx:"undefined"!=typeof wx?wx:null}}))||void 0===t?void 0:t.default;if("function"!=typeof e)return void console.error("[XLOG:IAA] 插件加载失败,无法获取createMiniGameCommon");this._miniGameCommon=e(),this._miniGameCommon&&this._miniGameCommon.canIUse?("undefined"!=typeof GameGlobal&&(GameGlobal.miniGameCommon=this._miniGameCommon),this._consoleLog&&console.log("[XLOG:IAA] 插件初始化成功")):console.error("[XLOG:IAA] 插件初始化失败")}catch(t){console.error("[XLOG:IAA] 插件初始化异常",t)}else console.warn("[XLOG:IAA] 仅微信小程序支持IAA插件")},i.prototype.iaa=function(t){return e(this,void 0,void 0,(function(){var n=this;return o(this,(function(i){return this._miniGameCommon?[2,new Promise((function(i,s){setTimeout((function(){return e(n,void 0,void 0,(function(){var e,n,r,a;return o(this,(function(o){switch(o.label){case 0:e=null,n=t.sessionKey,r=t.reportData,o.label=1;case 1:return o.trys.push([1,3,,4]),[4,this._miniGameCommon.getUserLabel({reportData:JSON.stringify(r),labelId:"iaa_feature"})];case 2:return e=o.sent(),[3,4];case 3:return a=o.sent(),console.error("[XLOG:IAA] getUserLabel 调用失败:",a),s(a),[2];case 4:return e?(this._consoleLog&&console.log("[XLOG:IAA] 平台返回:",e),this._sendIAAData({session_key:n,requestReportData:JSON.stringify(r),iv:e.iv,encryptedData:e.encryptedData}),i(e),[2]):(s(new Error("Platform response is null")),[2])}}))}))}),3e4)}))]:(console.error("[XLOG:IAA] 插件未初始化"),[2])}))}))},i.prototype._sendIAAData=function(t){this._request("".concat(this._businessDomain,"/AppletUtils/util/wx/uploadReportData"),t,"application/json")},i}();export{i as EGender,c as XLog};
6
+ var t=function(){return t=Object.assign||function(t){for(var e,o=1,n=arguments.length;o<n;o++)for(var i in e=arguments[o])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t},t.apply(this,arguments)};function e(t,e,o,n){return new(o||(o=Promise))((function(i,s){function r(t){try{c(n.next(t))}catch(t){s(t)}}function a(t){try{c(n.throw(t))}catch(t){s(t)}}function c(t){var e;t.done?i(t.value):(e=t.value,e instanceof o?e:new o((function(t){t(e)}))).then(r,a)}c((n=n.apply(t,e||[])).next())}))}function o(t,e){var o,n,i,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]},r=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return r.next=a(0),r.throw=a(1),r.return=a(2),"function"==typeof Symbol&&(r[Symbol.iterator]=function(){return this}),r;function a(a){return function(c){return function(a){if(o)throw new TypeError("Generator is already executing.");for(;r&&(r=0,a[0]&&(s=0)),s;)try{if(o=1,n&&(i=2&a[0]?n.return:a[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,a[1])).done)return i;switch(n=0,i&&(a=[2&a[0],i.value]),a[0]){case 0:case 1:i=a;break;case 4:return s.label++,{value:a[1],done:!1};case 5:s.label++,n=a[1],a=[0];continue;case 7:a=s.ops.pop(),s.trys.pop();continue;default:if(!(i=s.trys,(i=i.length>0&&i[i.length-1])||6!==a[0]&&2!==a[0])){s=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]<i[3])){s.label=a[1];break}if(6===a[0]&&s.label<i[1]){s.label=i[1],i=a;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(a);break}i[2]&&s.ops.pop(),s.trys.pop();continue}a=e.call(t,s)}catch(t){a=[6,t],n=0}finally{o=i=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,c])}}}function n(){var t=new Date,e=t.getFullYear().toString(),o=(t.getMonth()+1).toString(),n=t.getDate().toString();return(e=e.toString().substr(-2))+(o=Number(o)<10?"0"+o:o)+(n=Number(n)<10?"0"+n:n)}"function"==typeof SuppressedError&&SuppressedError;var i,s,r,a="6.0.0",c="organic";!function(t){t[t.Unknown=0]="Unknown",t[t.Male=1]="Male",t[t.Female=2]="Female"}(i||(i={})),function(t){t[t.WECHAT=1]="WECHAT",t[t.DOUYIN=2]="DOUYIN",t[t.TIKTOK=200]="TIKTOK",t[t.KUAISHOU=3]="KUAISHOU",t[t.BAIDU=4]="BAIDU",t[t.QQ=5]="QQ",t[t.WEB=7]="WEB"}(s||(s={})),function(t){t.BATCH_ID="BATCH_ID",t.COMMON_PARAMS="COMMON_PARAMS",t.ONLINE_BATCH_DATA="ONLINE_BATCH_DATA",t.ACCUMULATED_TIME="ACCUMULATED_TIME"}(r||(r={}));var p=function(){function i(t){var e,o,n=t.domain,i=t.commonParams,s=t.isPro,c=void 0===s||s,p=t.sendOpenLog,l=void 0===p||p,u=t.consoleLog,h=void 0===u||u,d=t.useIAA,m=void 0!==d&&d,_=t.periodicReportInterval,f=void 0===_?0:_;if(this.version=a,this.buildDate="5/8/2026, 5:19:34 PM",this._openUrl="",this._eventUrl="",this._actUrl="",this._adUrl="",this._onlineUrl="",this._businessDomain="",this._startTime=Date.now(),this._commonParams={},this._periodicReportInterval=0,this._accumulatedTime=0,this._periodicTimer=null,this._isPro=!0,this._sendOpenLog=!0,this._isColdStartUp=!0,this._systemInfo={},this._mp={},this._consoleLog=!0,this._useIAA=!1,this._sessionInfo={},this._isPro=c,this._sendOpenLog=l,this._consoleLog=h,this._useIAA=m,f>0){var y=f>0?f:10;this._periodicReportInterval=Math.max(1e3*y,5e3)}else this._periodicReportInterval=0;var v=this._getApis(n),g=v.openUrl,I=v.eventUrl,O=v.actUrl,A=v.adUrl,L=v.onlineUrl;this._openUrl=g,this._eventUrl=I,this._actUrl=O,this._adUrl=A,this._onlineUrl=L,this._businessDomain=this._isPro?"https://applet-xx.mop.com":"https://test-applet-xx.mop.com";var w,P=this._getMp(),S=P.mp,b=P.platform;this._mp=S,this._platform=b,!S||(w=S)&&0===Object.keys(w).length&&w.constructor===Object?console.error("[XLOG] 日志SDK初始化失败,当前环境为非小程序环境!"):this._consoleLog&&console.log("[XLOG] 小程序对象:",S,"平台类型:",b);try{this._systemInfo=(null===(o=null===(e=this._mp)||void 0===e?void 0:e.getSystemInfoSync)||void 0===o?void 0:o.call(e))||{},this._consoleLog&&console.log("[XLOG] 系统信息:",this._systemInfo)}catch(t){console.error("[XLOG] getSystemInfoSync error",t)}if(this._extraInfo={language:this._systemInfo.language,wxVersion:this._systemInfo.version,SDKVersion:this._systemInfo.SDKVersion,benchmarkLevel:this._systemInfo.benchmarkLevel||-1,theme:this._systemInfo.theme,pixelRatio:this._systemInfo.pixelRatio},this._periodicReportInterval>0){var T=this._getStorage(r.ACCUMULATED_TIME);this._accumulatedTime=T?Number(T):0,this._consoleLog&&console.log("[XLOG] 加载缓存的累计时长:",this._accumulatedTime,"ms")}this._init(i)}return Object.defineProperty(i.prototype,"commonParams",{get:function(){return this._commonParams},enumerable:!1,configurable:!0}),i.prototype._safeJsonParse=function(t,e){try{return t?JSON.parse(t):e}catch(o){return console.error("[XLOG] JSON解析错误:",o,"原始数据:",t),e}},i.prototype._getLaunchOptions=function(){var t,e,o,n,i,s,r,a,c,p,l,u;try{return 2===this._platform?(null===(e=null===(t=this._mp)||void 0===t?void 0:t.getLaunchOptionsSync)||void 0===e?void 0:e.call(t))||null:3===this._platform?(null===(n=null===(o=this._mp)||void 0===o?void 0:o.getLaunchOptionsSync)||void 0===n?void 0:n.call(o))||null:1===this._platform?(null===(s=null===(i=this._mp)||void 0===i?void 0:i.getEnterOptionsSync)||void 0===s?void 0:s.call(i))||(null===(a=null===(r=this._mp)||void 0===r?void 0:r.getLaunchOptionsSync)||void 0===a?void 0:a.call(r))||null:(null===(p=null===(c=this._mp)||void 0===c?void 0:c.getLaunchOptionsSync)||void 0===p?void 0:p.call(c))||(null===(u=null===(l=this._mp)||void 0===l?void 0:l.getEnterOptionsSync)||void 0===u?void 0:u.call(l))||null}catch(t){return console.error("[XLOG] 获取启动参数失败",t),null}},i.prototype._updateQuerystring=function(e,o){void 0===e&&(e=null),void 0===o&&(o={});var n=(null==e?void 0:e.query)?t(t({},e.query),o):o;this._updateCommonParams({srcqid:n.channel||"",userinfo:JSON.stringify({querystring:n})})},i.prototype._init=function(t){var e=this;this._initCommonParams(this._filterParams(t));var o=this._getLaunchOptions();this._updateQuerystring(o),this._coldStartUp(),this._useIAA&&this._initIAAPlugin(),this._visibilityChange((function(){e._isColdStartUp||e._getNetworkType().then((function(t){e._updateCommonParams({network:t}),e._open({openway:1})})),e._startTime=Date.now(),e._periodicReportInterval>0&&e._startPeriodicTimer();var t=e._getOnlineBatchData();t&&t.length>0&&e._online(t)}),(function(){if(e._isColdStartUp=!1,e._open({openway:5}),e._periodicReportInterval>0){e._stopPeriodicTimer();var t=Date.now()-e._startTime;e._accumulatedTime+=t,e._setStorage(r.ACCUMULATED_TIME,e._accumulatedTime.toString()),e._consoleLog&&console.log("[XLOG] 切后台,累计时长:",e._accumulatedTime,"ms")}else e._sendOnline()}))},i.prototype._startPeriodicTimer=function(){var t=this;this._periodicTimer&&clearInterval(this._periodicTimer),this._periodicTimer=setInterval((function(){t._checkPeriodicReport()}),1e3),this._consoleLog&&console.log("[XLOG] 启动定期上报定时器,间隔(ms):",this._periodicReportInterval)},i.prototype._stopPeriodicTimer=function(){this._periodicTimer&&(clearInterval(this._periodicTimer),this._periodicTimer=null,this._consoleLog&&console.log("[XLOG] 停止定期上报定时器"))},i.prototype._checkPeriodicReport=function(){var t=Date.now()-this._startTime,e=this._accumulatedTime+t;if(e>=this._periodicReportInterval){var o=Math.floor(e/this._periodicReportInterval),n=o*this._periodicReportInterval;this._sendPeriodicOnline(n,o),this._accumulatedTime=e-n,this._startTime=Date.now(),this._setStorage(r.ACCUMULATED_TIME,this._accumulatedTime.toString()),this._consoleLog&&console.log("[XLOG] 定期上报 ".concat(o," 次,总计 ").concat(n,"ms,剩余 ").concat(this._accumulatedTime,"ms"))}},i.prototype._sendPeriodicOnline=function(e,o){for(var n=Date.now()-e,i=[],s=0;s<o;s++){var r=n+s*this._periodicReportInterval,a=r+this._periodicReportInterval;i.push(t(t({},this._commonParams),{appqid:this._getAppqid(),onlinetime:this._periodicReportInterval.toString(),endtime:a.toString(),starttime:r.toString()}))}this._online(i)},i.prototype._getMp=function(){var t={mp:null,platform:s.WEB};try{if("undefined"!=typeof TTMinis&&TTMinis.game)return t.mp=TTMinis.game,t.platform=s.TIKTOK,t;if("undefined"!=typeof tt&&tt.getSystemInfoSync){var e=tt.getSystemInfoSync();return t.mp=tt,"TikTok"===e.appName?t.platform=s.TIKTOK:t.platform=s.DOUYIN,t}"undefined"!=typeof ks&&ks.getSystemInfo?(t.mp=ks,t.platform=s.KUAISHOU):"undefined"!=typeof swan&&swan.getSystemInfo?(t.mp=swan,t.platform=s.BAIDU):"undefined"!=typeof qq&&qq.getSystemInfo?(t.mp=qq,t.platform=s.QQ):"undefined"!=typeof wx&&wx.getSystemInfo&&(t.mp=wx,t.platform=s.WECHAT)}catch(t){console.error("[XLOG] Platform detection failed:",t)}return t},i.prototype._visibilityChange=function(t,e){var o,n,i,s,r=this;void 0===t&&(t=function(){}),void 0===e&&(e=function(){});try{var a=(null===(o=this._mp)||void 0===o?void 0:o.onAppShow)||(null===(n=this._mp)||void 0===n?void 0:n.onShow),c=(null===(i=this._mp)||void 0===i?void 0:i.onAppHide)||(null===(s=this._mp)||void 0===s?void 0:s.onHide);a&&a((function(){r._consoleLog&&console.log("[XLOG] onAppShow"),t()})),c&&c((function(){r._consoleLog&&console.log("[XLOG] onAppHide"),e()}))}catch(t){console.error("[XLOG] onAppShow or onAppHide error",t)}},i.prototype._getStorage=function(t){var e;try{var o=null===(e=this._mp)||void 0===e?void 0:e.getStorageSync("XYZ_LOG_".concat(t));return null==o?"":o}catch(t){return console.error("[XLOG] getStorageSync error",t),""}},i.prototype._setStorage=function(t,e){var o;try{null===(o=this._mp)||void 0===o||o.setStorageSync("XYZ_LOG_".concat(t),e)}catch(t){console.error("[XLOG] setStorageSync error",t)}},i.prototype._getBatchId=function(){var t=this._getStorage(r.BATCH_ID);return t||(t=function(t,e){void 0===t&&(t=18),void 0===e&&(e=0);for(var o="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz".split(""),n=[],i=Math.random,s=t,r=e||o.length,a=0;a<s;a++)n[a]=o[0|i()*r];return n.join("")}(),this._setStorage(r.BATCH_ID,t)),t},i.prototype._coldStartUp=function(){var t=this;this._getNetworkType().then((function(e){t._updateCommonParams({network:e}),t._open({openway:0}),t._periodicReportInterval>0&&t._startPeriodicTimer()}))},i.prototype._getApis=function(e){var o=this._isPro?{open:"webopen-inside.tt.cn",event:"webevent-inside.tt.cn",act:"webact-inside.tt.cn",ad:"webadv-inside.tt.cn",online:"webact-inside.tt.cn"}:{open:"test-webopen-inside.tt.cn",event:"test-webevent-inside.tt.cn",act:"test-webact-inside.tt.cn",ad:"test-webadv-inside.tt.cn",online:"test-webact-inside.tt.cn"},n=t(t({},o),e);return{openUrl:"https://".concat(n.open,"/gamefunction_logs/applet/open"),eventUrl:"https://".concat(n.event,"/gamefunction_logs/applet/event"),actUrl:"https://".concat(n.act,"/gamefunction_logs/applet/activity"),adUrl:"https://".concat(n.ad,"/gamefunction_logs/applet/adv"),onlineUrl:"https://".concat(n.online,"/gamefunction_logs/applet/onlineTime")}},i.prototype._cacheCommonParams=function(t){this._setStorage(r.COMMON_PARAMS,JSON.stringify(t))},i.prototype._getInitParams=function(){var t,e=(null===(t=this._systemInfo.system)||void 0===t?void 0:t.includes(" "))?this._systemInfo.system.split(" ")[1]:this._systemInfo.system;return{platform:this._platform,appcqid:c,appqid:c+n(),os:this._systemInfo.platform,osversion:e,device:this._systemInfo.model,devicebrand:this._systemInfo.brand,pixel:this._systemInfo.screenWidth+"*"+this._systemInfo.screenHeight,userinfo:this._getUserInfo()}},i.prototype._initCommonParams=function(e){var o=this._getInitParams(),n=this._getStorage(r.COMMON_PARAMS);n&&(o=t(t({},o),this._safeJsonParse(n,{}))),e&&(o=t(t({},o),e)),this._updateCommonParams(t(t({},o),{obatchid:this._getBatchId()}))},i.prototype._getNetworkType=function(){var t=this;return new Promise((function(e){var o;try{null===(o=t._mp)||void 0===o||o.getNetworkType({success:function(t){var o=((null==t?void 0:t.networkType)||"").toLowerCase();e({wifi:"wifi","2g":"2g","3g":"3g","4g":"4g","5g":"5g",none:"none",unknown:"unknown",ethernet:"wifi",cellular:"4g"}[o]||"unknown")},fail:function(){return e("none")}})}catch(t){console.error("[XLOG] getNetworkType error",t),e("none")}}))},i.prototype._getUserInfo=function(e){var o={};e&&(o=this._safeJsonParse(e,{}));var n={};return this.commonParams.userinfo&&(n=this._safeJsonParse(this.commonParams.userinfo,{})),JSON.stringify(t(t(t({},this._extraInfo),n),o))},i.prototype._filterParams=function(t){var e={};if(t){var o=["openid","unionid","accid","apptypeid","appsubid","appcqid","srcqid","appver","userinfo"];for(var n in t){var i=t[n];o.includes(n)&&i&&(e[n]=i)}}return e},i.prototype.setParams=function(t){if(t){this._consoleLog&&console.log("[XLOG] setParams",t);var e=this._commonParams.openid,o=this._commonParams.unionid;t=this._filterParams(t),this._updateCommonParams(t),(t.openid&&t.openid!==e||t.unionid&&t.unionid!==o)&&this._open({isreturn:t.openid?1:2,openway:0})}},i.prototype._updateCommonParams=function(e){if(this._consoleLog&&console.log("[XLOG] _updateCommonParams",e),e.userinfo){var o=e.appsubid||this._commonParams.appsubid;o&&(e.userinfo=JSON.stringify(t(t({},this._safeJsonParse(e.userinfo,{})),{appsubid:o}))),e.userinfo=this._getUserInfo(e.userinfo)}e.appcqid&&(e.appqid=e.appcqid+n()),e.appver&&(e.appverint=function(t){try{return t&&"string"==typeof t?t.split(".").map((function(t){return 1===t.length?"0"+t:t})).join(""):""}catch(e){return console.error('[transferVersion] ver("'.concat(t,'")格式异常:'),e),""}}(e.appver)),this._commonParams=t(t({},this._commonParams),e),this._cacheCommonParams(this._commonParams)},i.prototype._getAppqid=function(){return this._commonParams.appcqid+n()},i.prototype._getApptypeid=function(t){var e=t||this._commonParams.apptypeid||"";return e||console.warn("[XLOG] apptypeid未配置,请在初始化时传入或调用方法时传入"),e},i.prototype._request=function(t,e,o){var n=this;return void 0===o&&(o="application/x-www-form-urlencoded"),new Promise((function(i,s){var r;try{null===(r=n._mp)||void 0===r||r.request({url:t,data:e,method:"POST",header:{"content-type":o},success:function(o){n._consoleLog&&console.log("[XLOG] SUCCESS: ".concat(t),e,o),i(o)},fail:function(o){n._consoleLog&&console.error("[XLOG] FAIL: ".concat(t),e,o),s(o)}})}catch(t){console.error("[XLOG] request error",t),s(t)}}))},i.prototype.open=function(t){this._open({querystring:t.querystring,isreturn:3,openway:0,manual:!0})},i.prototype._open=function(e){if(this._sendOpenLog||e.manual){var o=this._getLaunchOptions();this._updateQuerystring(o,e.querystring);var n=t(t({},this._commonParams),{appqid:this._getAppqid(),wakeway:e.wakeway||(null==o?void 0:o.scene)||"",openway:e.openway,isreturn:e.isreturn||0,xmlog:a});this._consoleLog&&console.log("[XLOG] PARAMS(OPEN)",n),this._request(this._openUrl,n)}},i.prototype.event=function(e){var o=t(t({},this._commonParams),{appqid:this._getAppqid(),event1:e.event1||"",event2:e.event2||"",event3:e.event3||"",event4:e.event4||"",value1:e.value1||"",value2:e.value2||"",value3:e.value3||"",value4:e.value4||""});this._consoleLog&&console.log("[XLOG] PARAMS(EVENT)",o),this._request(this._eventUrl,o)},i.prototype.act=function(e){var o=t(t({},this._commonParams),{appqid:this._getAppqid(),actentryid:e.actentryid||"",subactid:e.subactid||"",type:e.type||"",custom:e.custom||"",batchid:e.batchid||""});this._consoleLog&&console.log("[XLOG] PARAMS(ACT)",o),this._request(this._actUrl,o)},i.prototype.ad=function(e){var o=t(t({},this._commonParams),{appqid:this._getAppqid(),type:e.type||"",code:e.code||"",codeinfo:e.codeinfo||"",pagetype:e.pagetype||"",gametype:e.gametype||"",adslot:e.adslot||"",adunitid:e.adunitid||"",adbatchid:e.adbatchid||"",ecpm:e.ecpm||""});this._consoleLog&&console.log("[XLOG] PARAMS(AD)",o),this._request(this._adUrl,o,"application/json")},i.prototype._getPlatformPath=function(){var t="";return 1===this._platform?t="wx/":3===this._platform&&(t="ks/"),t},i.prototype._getPlatformStr=function(){var t="DY";return 1===this._platform?t="WX":3===this._platform&&(t="KS"),t},i.prototype.code2session=function(t){var n;return e(this,void 0,void 0,(function(){var e,i,s,r,a;return o(this,(function(o){switch(o.label){case 0:return e=this._getApptypeid(t.apptypeid),i=this._getPlatformPath(),s="".concat(this._businessDomain,"/AppletUtils/").concat(i,"code2session"),[4,this._request(s,{appTypeId:e,code:t.code,testNet:t.testNet},"application/json")];case 1:return r=o.sent(),a=null===(n=r.data)||void 0===n?void 0:n.data,this._sessionInfo=null!=a?a:{},this.setParams({openid:this._sessionInfo.openid,unionid:this._sessionInfo.unionid}),[2,r.data]}}))}))},i.prototype.msgSecCheck=function(t){return e(this,void 0,void 0,(function(){var e,n,i,s,r,a;return o(this,(function(o){switch(o.label){case 0:return 1!==this._platform?(console.warn("[XLOG] msgSecCheck 仅支持微信小程序/小游戏平台"),[2]):(e=(t.content||"").trim())?(n=this._getApptypeid(t.apptypeid),(i=t.openid||this._sessionInfo.openid||this._commonParams.openid)?((s="number"==typeof t.scene?t.scene:4)!==(r=s>=1&&s<=5?s:4)&&console.warn("[XLOG] msgSecCheck scene超出范围,已回退为4"),a="".concat(this._businessDomain,"/AppletUtils/wx/msgCheck"),this._consoleLog&&console.log("[XLOG] PARAMS(MSG_SEC_CHECK)",{appTypeId:n,openid:i,scene:r,content:e}),[4,this._request(a,{appTypeId:n,openid:i,scene:r,content:e},"application/json")]):(console.warn("[XLOG] msgSecCheck openid不存在,请先登录(调用方法code2session)或手动传入openid",this._sessionInfo),[2])):(console.warn("[XLOG] msgSecCheck content不能为空"),[2]);case 1:return[2,o.sent().data]}}))}))},i.prototype.isLogin=function(){return!!this._sessionInfo.openid||(console.warn("[XLOG] checkLogin","openid不存在,请检查是否已经调用过登录(code2session)。"),!1)},i.prototype.getSubsidy=function(t){return void 0===t&&(t={}),e(this,void 0,void 0,(function(){var e,n;return o(this,(function(o){switch(o.label){case 0:return this.isLogin()?(e=this._getApptypeid(t.apptypeid),n=this._sessionInfo.openid,[4,this._request("".concat(this._businessDomain,"/AppletUtils/pay/ks/subsidy"),{apptypeid:e,os:this._systemInfo.platform,openId:n},"application/json")]):(console.warn("[XLOG] getSubsidy 请先登录(调用方法code2session)",this._sessionInfo),[2]);case 1:return[2,o.sent().data]}}))}))},i.prototype.getUserProps=function(t){return void 0===t&&(t={}),e(this,void 0,void 0,(function(){var e,n;return o(this,(function(o){switch(o.label){case 0:return this.isLogin()?(e=this._getApptypeid(t.apptypeid),n=this._sessionInfo.openid,[4,this._request("".concat(this._businessDomain,"/AppletUtils/pay/ks/userProps"),{appTypeId:e,openId:n},"application/json")]):(console.warn("[XLOG] getUserProps 请先登录(调用方法code2session)",this._sessionInfo),[2]);case 1:return[2,o.sent().data]}}))}))},i.prototype._sleep=function(t){return void 0===t&&(t=1e3),e(this,void 0,void 0,(function(){return o(this,(function(e){return[2,new Promise((function(e,o){setTimeout(e,t)}))]}))}))},i.prototype._checkOrderAfterPayment=function(n,i){var s;return e(this,void 0,void 0,(function(){var e,r;return o(this,(function(o){switch(o.label){case 0:return o.trys.push([0,3,,4]),[4,this._sleep()];case 1:return o.sent(),[4,this.checkOrder({orderId:n})];case 2:return e=o.sent(),[2,{payResult:1===Number(null===(s=null==e?void 0:e.data)||void 0===s?void 0:s.payResult)?1:0}];case 3:return r=o.sent(),console.error("[XLOG] 订单校验 err: ",r,t({orderId:n},i)),[2,{payResult:0}];case 4:return[2]}}))}))},i.prototype._payWx=function(n,i){var s;return e(this,void 0,void 0,(function(){var e,r,a,c,p,l,u,h,d,m,_,f,y,v,g,I=this;return o(this,(function(o){switch(o.label){case 0:if(this._consoleLog&&console.log('[XLOG] 当前平台: "'.concat(this._systemInfo.platform,'"')),e="ios"===(this._systemInfo.platform||"").toLowerCase(),r=i.orderId,a=i.payContent,p=(c=a||{}).offerId,l=c.zone_id,u=c.env,h=c.buy_quantity,d=c.kfMessageTitle,m=c.kfMessageImg,!e)return[3,4];_={sessionFrom:n.sessionFrom,showMessageCard:null===(s=n.showMessageCard)||void 0===s||s,sendMessageTitle:n.sendMessageTitle||d,sendMessagePath:n.sendMessagePath,sendMessageImg:n.sendMessageImg||m},o.label=1;case 1:return o.trys.push([1,3,,4]),[4,new Promise((function(e,o){var n;null===(n=I._mp)||void 0===n||n.openCustomerServiceConversation(t(t({},_),{success:e,fail:o}))}))];case 2:return v=o.sent(),this._consoleLog&&console.log("[XLOG] 进入客服会话",v),[2,{payResult:-1}];case 3:return f=o.sent(),console.error("[XLOG] 取消进入客服会话",f,_),[2,{payResult:0}];case 4:y={mode:"game",env:1===Number(u)?1:0,offerId:p,currencyType:"CNY",platform:"android",buyQuantity:Number(h||n.buyQuantity),zoneId:l,outTradeNo:r},o.label=5;case 5:return o.trys.push([5,7,,8]),[4,new Promise((function(e,o){var n;null===(n=I._mp)||void 0===n||n.requestMidasPayment(t(t({},y),{success:e,fail:o}))}))];case 6:return v=o.sent(),this._consoleLog&&console.log("[XLOG] 微信虚拟支付",v),[3,8];case 7:return g=o.sent(),console.error("[XLOG] 微信虚拟支付 err: ",g,y),[2,{payResult:0}];case 8:return[2,this._checkOrderAfterPayment(r,y)]}}))}))},i.prototype._payDy=function(n,i){var s;return e(this,void 0,void 0,(function(){var e,r,a,c,p,l,u,h,d,m,_,f,y,v,g=this;return o(this,(function(o){switch(o.label){case 0:if(e=i.orderId,r=i.payContent,c=(a=r||{}).zone_id,p=a.env,l=a.buy_quantity,u=a.extraInfo,h="ios"===(this._systemInfo.platform||"").toLowerCase(),d="windows"===(this._systemInfo.platform||"").toLowerCase(),!h)return[3,5];if(!(null===(s=this._mp)||void 0===s?void 0:s.openAwemeCustomerService))return console.error("[XLOG] 当前抖音基础库不支持 openAwemeCustomerService"),[2,{payResult:0}];m={currencyType:"DIAMOND",buyQuantity:Number(l||n.buyQuantity),zoneId:c||"1",customId:e,extraInfo:u},o.label=1;case 1:return o.trys.push([1,3,,4]),[4,new Promise((function(e,o){var n;null===(n=g._mp)||void 0===n||n.openAwemeCustomerService(t(t({},m),{success:e,fail:o}))}))];case 2:return y=o.sent(),this._consoleLog&&console.log("[XLOG] 抖音 iOS 客服支付",y),[3,4];case 3:return _=o.sent(),console.error("[XLOG] 抖音 iOS 客服支付 err: ",_,m),[2,{payResult:0}];case 4:return[2,this._checkOrderAfterPayment(e,m)];case 5:f={mode:"game",env:1===Number(p)?1:0,currencyType:"CNY",platform:d?"windows":"android",buyQuantity:Number(l||n.buyQuantity),zoneId:c||"1",customId:e,extraInfo:u},o.label=6;case 6:return o.trys.push([6,8,,9]),[4,new Promise((function(e,o){var n;null===(n=g._mp)||void 0===n||n.requestGamePayment(t(t({},f),{success:e,fail:o}))}))];case 7:return y=o.sent(),this._consoleLog&&console.log("[XLOG] 抖音支付",y),[3,9];case 8:return v=o.sent(),console.error("[XLOG] 抖音支付 err: ",v,f),[2,{payResult:0}];case 9:return[2,this._checkOrderAfterPayment(e,f)]}}))}))},i.prototype.pay=function(t){return e(this,void 0,void 0,(function(){var e,n;return o(this,(function(o){switch(o.label){case 0:return this._consoleLog&&console.log("[XLOG] pay params: ",t),"WX"!==(e=this._getPlatformStr())&&"DY"!==e?(console.error("[XLOG] 支付目前只支持微信/抖音平台,当前平台: ".concat(e||"UNKNOWN")),[2,{payResult:0}]):[4,this.createOrder(t)];case 1:return(null==(n=o.sent())?void 0:n.data)?"WX"===e?[2,this._payWx(t,n.data)]:[2,this._payDy(t,n.data)]:(console.error("[XLOG] 未获取到订单信息"),[2,{payResult:0}])}}))}))},i.prototype.checkOrder=function(t){return e(this,void 0,void 0,(function(){var e,n,i,s,r;return o(this,(function(o){switch(o.label){case 0:return this.isLogin()?(e=this._getApptypeid(t.apptypeid),n=this._getPlatformPath(),i=this._sessionInfo,s=i.openid,r=i.session_key,[4,this._request("".concat(this._businessDomain,"/AppletUtils/pay/").concat(n,"chkOrder"),{appTypeId:e,orderId:t.orderId,os:this._systemInfo.platform,openId:s,sessionKey:r},"application/json")]):(console.warn("[XLOG] checkOrder 请先登录(调用方法code2session)",this._sessionInfo),[2]);case 1:return[2,o.sent().data]}}))}))},i.prototype.createOrder=function(t){return e(this,void 0,void 0,(function(){var e,n,i;return o(this,(function(o){switch(o.label){case 0:return this.isLogin()?(e=this._getApptypeid(t.apptypeid),n=this._sessionInfo.openid,i=this._getPlatformStr(),[4,this._request("".concat(this._businessDomain,"/AppletUtils/pay/ks/crtOrder"),{appTypeId:e,productId:t.productId,extInfo:t.extInfo,os:this._systemInfo.platform,payPlatform:i,openId:n},"application/json")]):(console.warn("[XLOG] createOrder 请先登录(调用方法code2session)",this._sessionInfo),[2]);case 1:return[2,o.sent().data]}}))}))},i.prototype._sendOnline=function(){var e=Date.now(),o=Math.max(0,e-this._startTime),n=t(t({},this._commonParams),{appqid:this._getAppqid(),onlinetime:"".concat(o),endtime:e.toString(),starttime:this._startTime.toString()});this._online([n])},i.prototype._setOnlineBatchData=function(t){this._setStorage(r.ONLINE_BATCH_DATA,t)},i.prototype._getOnlineBatchData=function(){try{var t=this._getStorage(r.ONLINE_BATCH_DATA);if(Array.isArray(t))return t;if("string"==typeof t&&t){var e=this._safeJsonParse(t,[]);return Array.isArray(e)?e:[]}return[]}catch(t){return console.error("[XLOG] get online batch data error",t),[]}},i.prototype._clearOnlineBatchData=function(){this._setStorage(r.ONLINE_BATCH_DATA,"")},i.prototype._online=function(t){var e=this;t&&0!==t.length&&(this._consoleLog&&console.log("[XLOG] PARAMS(ONLINE)",t),this._clearOnlineBatchData(),this._request(this._onlineUrl,{batch:JSON.stringify(t)}).catch((function(o){console.error("[XLOG] Online log report failed, caching batch data",o),e._setOnlineBatchData(t)})))},i.prototype._initIAAPlugin=function(){var t;if(1===this._platform)try{if("undefined"==typeof requirePlugin)return void console.error("[XLOG:IAA] 环境不支持requirePlugin");var e=null===(t=requirePlugin("MiniGameCommon",{enableRequireHostModule:!0,customEnv:{wx:"undefined"!=typeof wx?wx:null}}))||void 0===t?void 0:t.default;if("function"!=typeof e)return void console.error("[XLOG:IAA] 插件加载失败,无法获取createMiniGameCommon");this._miniGameCommon=e(),this._miniGameCommon&&this._miniGameCommon.canIUse?("undefined"!=typeof GameGlobal&&(GameGlobal.miniGameCommon=this._miniGameCommon),this._consoleLog&&console.log("[XLOG:IAA] 插件初始化成功")):console.error("[XLOG:IAA] 插件初始化失败")}catch(t){console.error("[XLOG:IAA] 插件初始化异常",t)}else console.warn("[XLOG:IAA] 仅微信小程序支持IAA插件")},i.prototype.iaa=function(t){return e(this,void 0,void 0,(function(){var n=this;return o(this,(function(i){return this._miniGameCommon?[2,new Promise((function(i,s){setTimeout((function(){return e(n,void 0,void 0,(function(){var e,n,r,a;return o(this,(function(o){switch(o.label){case 0:e=null,n=t.sessionKey,r=t.reportData,o.label=1;case 1:return o.trys.push([1,3,,4]),[4,this._miniGameCommon.getUserLabel({reportData:JSON.stringify(r),labelId:"iaa_feature"})];case 2:return e=o.sent(),[3,4];case 3:return a=o.sent(),console.error("[XLOG:IAA] getUserLabel 调用失败:",a),s(a),[2];case 4:return e?(this._consoleLog&&console.log("[XLOG:IAA] 平台返回:",e),this._sendIAAData({session_key:n,requestReportData:JSON.stringify(r),iv:e.iv,encryptedData:e.encryptedData}),i(e),[2]):(s(new Error("Platform response is null")),[2])}}))}))}),3e4)}))]:(console.error("[XLOG:IAA] 插件未初始化"),[2])}))}))},i.prototype._sendIAAData=function(t){this._request("".concat(this._businessDomain,"/AppletUtils/util/wx/uploadReportData"),t,"application/json")},i}();export{i as EGender,p as XLog};
package/dist/web-hw.js CHANGED
@@ -1,8 +1,8 @@
1
1
  /*!
2
- * @xyz-fe/log v5.3.0
2
+ * @xyz-fe/log v6.0.0
3
3
  * (c) lizhigao <lizhigao@021.com>
4
4
  * Released under the MIT License.
5
5
  */
6
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=function(){return e=Object.assign||function(e){for(var i,o=1,n=arguments.length;o<n;o++)for(var t in i=arguments[o])Object.prototype.hasOwnProperty.call(i,t)&&(e[t]=i[t]);return e},e.apply(this,arguments)};function i(e,i){var o={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&i.indexOf(n)<0&&(o[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var t=0;for(n=Object.getOwnPropertySymbols(e);t<n.length;t++)i.indexOf(n[t])<0&&Object.prototype.propertyIsEnumerable.call(e,n[t])&&(o[n[t]]=e[n[t]])}return o}"function"==typeof SuppressedError&&SuppressedError;var o="XYZ_LOG_";function n(e){return void 0!==typeof localStorage?localStorage.getItem(o+e):null}function t(e,i){void 0!==typeof localStorage&&localStorage.setItem(o+e,i)}function r(e,i){void 0===e&&(e=18),void 0===i&&(i=0);for(var o="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz".split(""),n=[],t=Math.random,r=e,a=i||o.length,s=0;s<r;s++)n[s]=o[0|t()*a];return n.join("")}function a(e){void 0===e&&(e="UID");var i=n(e);return i||t(e,i=r()),i}function s(e,i){void 0===e&&(e=[]),void 0===i&&(i=location.href);var o=new URL(i).search.substring(1),n={};return o&&o.split("&").forEach((function(e){n[e.split("=")[0]]=e.split("=")[1]})),Object.keys(n).forEach((function(i){e.includes(i)&&delete n[i]})),n}function c(i,o){var n=e({},i),t=e({},o);return Object.keys(n).forEach((function(e){t[e]||delete t[e]})),e(e({},n),t)}function l(e){for(var i,o,n=[],t=1;t<arguments.length;t++)n[t-1]=arguments[t];if(!n.length)return e;var r=n.shift();if(r&&"object"==typeof r)for(var a in r)r[a]&&"object"==typeof r[a]?(e[a]||Object.assign(e,((i={})[a]={},i)),l(e[a],r[a])):Object.assign(e,((o={})[a]=r[a],o));return l.apply(void 0,function(e,i,o){if(o||2===arguments.length)for(var n,t=0,r=i.length;t<r;t++)!n&&t in i||(n||(n=Array.prototype.slice.call(i,0,t)),n[t]=i[t]);return e.concat(n||Array.prototype.slice.call(i))}([e],n,!1))}var u=function(){return"standalone"==(navigator.standalone||window.matchMedia("(display-mode: standalone)").matches?"standalone":"browser")?"pwa":(e=navigator.userAgent,["Android","webOS","iPhone","iPad","iPod","BlackBerry","Windows Phone"].some((function(i){return e.includes(i)}))?"h5":"pc");var e};var d="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},p={exports:{}};!function(e,i){!function(o,n){var t="function",r="undefined",a="object",s="string",c="major",l="model",u="name",d="type",p="vendor",m="version",f="architecture",b="console",w="mobile",h="tablet",g="smarttv",v="wearable",y="embedded",_="Amazon",x="Apple",k="ASUS",O="BlackBerry",P="Browser",S="Chrome",U="Firefox",C="Google",A="Huawei",N="LG",T="Microsoft",E="Motorola",I="Opera",L="Samsung",j="Sharp",R="Sony",q="Xiaomi",M="Zebra",z="Facebook",B="Chromium OS",D="Mac OS",G=" Browser",X=function(e){for(var i={},o=0;o<e.length;o++)i[e[o].toUpperCase()]=e[o];return i},J=function(e,i){return typeof e===s&&-1!==F(i).indexOf(F(e))},F=function(e){return e.toLowerCase()},H=function(e,i){if(typeof e===s)return e=e.replace(/^\s\s*/,""),typeof i===r?e:e.substring(0,500)},V=function(e,i){for(var o,r,s,c,l,u,d=0;d<i.length&&!l;){var p=i[d],m=i[d+1];for(o=r=0;o<p.length&&!l&&p[o];)if(l=p[o++].exec(e))for(s=0;s<m.length;s++)u=l[++r],typeof(c=m[s])===a&&c.length>0?2===c.length?typeof c[1]==t?this[c[0]]=c[1].call(this,u):this[c[0]]=c[1]:3===c.length?typeof c[1]!==t||c[1].exec&&c[1].test?this[c[0]]=u?u.replace(c[1],c[2]):n:this[c[0]]=u?c[1].call(this,u,c[2]):n:4===c.length&&(this[c[0]]=u?c[3].call(this,u.replace(c[1],c[2])):n):this[c]=u||n;d+=2}},W=function(e,i){for(var o in i)if(typeof i[o]===a&&i[o].length>0){for(var t=0;t<i[o].length;t++)if(J(i[o][t],e))return"?"===o?n:o}else if(J(i[o],e))return"?"===o?n:o;return i.hasOwnProperty("*")?i["*"]:e},Z={ME:"4.90","NT 3.11":"NT3.51","NT 4.0":"NT4.0",2e3:"NT 5.0",XP:["NT 5.1","NT 5.2"],Vista:"NT 6.0",7:"NT 6.1",8:"NT 6.2",8.1:"NT 6.3",10:["NT 6.4","NT 10.0"],RT:"ARM"},$={browser:[[/\b(?:crmo|crios)\/([\w\.]+)/i],[m,[u,"Chrome"]],[/edg(?:e|ios|a)?\/([\w\.]+)/i],[m,[u,"Edge"]],[/(opera mini)\/([-\w\.]+)/i,/(opera [mobiletab]{3,6})\b.+version\/([-\w\.]+)/i,/(opera)(?:.+version\/|[\/ ]+)([\w\.]+)/i],[u,m],[/opios[\/ ]+([\w\.]+)/i],[m,[u,I+" Mini"]],[/\bop(?:rg)?x\/([\w\.]+)/i],[m,[u,I+" GX"]],[/\bopr\/([\w\.]+)/i],[m,[u,I]],[/\bb[ai]*d(?:uhd|[ub]*[aekoprswx]{5,6})[\/ ]?([\w\.]+)/i],[m,[u,"Baidu"]],[/\b(?:mxbrowser|mxios|myie2)\/?([-\w\.]*)\b/i],[m,[u,"Maxthon"]],[/(kindle)\/([\w\.]+)/i,/(lunascape|maxthon|netfront|jasmine|blazer|sleipnir)[\/ ]?([\w\.]*)/i,/(avant|iemobile|slim(?:browser|boat|jet))[\/ ]?([\d\.]*)/i,/(?:ms|\()(ie) ([\w\.]+)/i,/(flock|rockmelt|midori|epiphany|silk|skyfire|ovibrowser|bolt|iron|vivaldi|iridium|phantomjs|bowser|qupzilla|falkon|rekonq|puffin|brave|whale(?!.+naver)|qqbrowserlite|duckduckgo|klar|helio|(?=comodo_)?dragon)\/([-\w\.]+)/i,/(heytap|ovi|115)browser\/([\d\.]+)/i,/(weibo)__([\d\.]+)/i],[u,m],[/quark(?:pc)?\/([-\w\.]+)/i],[m,[u,"Quark"]],[/\bddg\/([\w\.]+)/i],[m,[u,"DuckDuckGo"]],[/(?:\buc? ?browser|(?:juc.+)ucweb)[\/ ]?([\w\.]+)/i],[m,[u,"UC"+P]],[/microm.+\bqbcore\/([\w\.]+)/i,/\bqbcore\/([\w\.]+).+microm/i,/micromessenger\/([\w\.]+)/i],[m,[u,"WeChat"]],[/konqueror\/([\w\.]+)/i],[m,[u,"Konqueror"]],[/trident.+rv[: ]([\w\.]{1,9})\b.+like gecko/i],[m,[u,"IE"]],[/ya(?:search)?browser\/([\w\.]+)/i],[m,[u,"Yandex"]],[/slbrowser\/([\w\.]+)/i],[m,[u,"Smart Lenovo "+P]],[/(avast|avg)\/([\w\.]+)/i],[[u,/(.+)/,"$1 Secure "+P],m],[/\bfocus\/([\w\.]+)/i],[m,[u,U+" Focus"]],[/\bopt\/([\w\.]+)/i],[m,[u,I+" Touch"]],[/coc_coc\w+\/([\w\.]+)/i],[m,[u,"Coc Coc"]],[/dolfin\/([\w\.]+)/i],[m,[u,"Dolphin"]],[/coast\/([\w\.]+)/i],[m,[u,I+" Coast"]],[/miuibrowser\/([\w\.]+)/i],[m,[u,"MIUI"+G]],[/fxios\/([\w\.-]+)/i],[m,[u,U]],[/\bqihoobrowser\/?([\w\.]*)/i],[m,[u,"360"]],[/\b(qq)\/([\w\.]+)/i],[[u,/(.+)/,"$1Browser"],m],[/(oculus|sailfish|huawei|vivo|pico)browser\/([\w\.]+)/i],[[u,/(.+)/,"$1"+G],m],[/samsungbrowser\/([\w\.]+)/i],[m,[u,L+" Internet"]],[/metasr[\/ ]?([\d\.]+)/i],[m,[u,"Sogou Explorer"]],[/(sogou)mo\w+\/([\d\.]+)/i],[[u,"Sogou Mobile"],m],[/(electron)\/([\w\.]+) safari/i,/(tesla)(?: qtcarbrowser|\/(20\d\d\.[-\w\.]+))/i,/m?(qqbrowser|2345(?=browser|chrome|explorer))\w*[\/ ]?v?([\w\.]+)/i],[u,m],[/(lbbrowser|rekonq)/i,/\[(linkedin)app\]/i],[u],[/ome\/([\w\.]+) \w* ?(iron) saf/i,/ome\/([\w\.]+).+qihu (360)[es]e/i],[m,u],[/((?:fban\/fbios|fb_iab\/fb4a)(?!.+fbav)|;fbav\/([\w\.]+);)/i],[[u,z],m],[/(Klarna)\/([\w\.]+)/i,/(kakao(?:talk|story))[\/ ]([\w\.]+)/i,/(naver)\(.*?(\d+\.[\w\.]+).*\)/i,/safari (line)\/([\w\.]+)/i,/\b(line)\/([\w\.]+)\/iab/i,/(alipay)client\/([\w\.]+)/i,/(twitter)(?:and| f.+e\/([\w\.]+))/i,/(chromium|instagram|snapchat)[\/ ]([-\w\.]+)/i],[u,m],[/\bgsa\/([\w\.]+) .*safari\//i],[m,[u,"GSA"]],[/musical_ly(?:.+app_?version\/|_)([\w\.]+)/i],[m,[u,"TikTok"]],[/headlesschrome(?:\/([\w\.]+)| )/i],[m,[u,S+" Headless"]],[/ wv\).+(chrome)\/([\w\.]+)/i],[[u,S+" WebView"],m],[/droid.+ version\/([\w\.]+)\b.+(?:mobile safari|safari)/i],[m,[u,"Android "+P]],[/(chrome|omniweb|arora|[tizenoka]{5} ?browser)\/v?([\w\.]+)/i],[u,m],[/version\/([\w\.\,]+) .*mobile\/\w+ (safari)/i],[m,[u,"Mobile Safari"]],[/version\/([\w(\.|\,)]+) .*(mobile ?safari|safari)/i],[m,u],[/webkit.+?(mobile ?safari|safari)(\/[\w\.]+)/i],[u,[m,W,{"1.0":"/8",1.2:"/1",1.3:"/3","2.0":"/412","2.0.2":"/416","2.0.3":"/417","2.0.4":"/419","?":"/"}]],[/(webkit|khtml)\/([\w\.]+)/i],[u,m],[/(navigator|netscape\d?)\/([-\w\.]+)/i],[[u,"Netscape"],m],[/(wolvic|librewolf)\/([\w\.]+)/i],[u,m],[/mobile vr; rv:([\w\.]+)\).+firefox/i],[m,[u,U+" Reality"]],[/ekiohf.+(flow)\/([\w\.]+)/i,/(swiftfox)/i,/(icedragon|iceweasel|camino|chimera|fennec|maemo browser|minimo|conkeror)[\/ ]?([\w\.\+]+)/i,/(seamonkey|k-meleon|icecat|iceape|firebird|phoenix|palemoon|basilisk|waterfox)\/([-\w\.]+)$/i,/(firefox)\/([\w\.]+)/i,/(mozilla)\/([\w\.]+) .+rv\:.+gecko\/\d+/i,/(polaris|lynx|dillo|icab|doris|amaya|w3m|netsurf|obigo|mosaic|(?:go|ice|up)[\. ]?browser)[-\/ ]?v?([\w\.]+)/i,/(links) \(([\w\.]+)/i],[u,[m,/_/g,"."]],[/(cobalt)\/([\w\.]+)/i],[u,[m,/master.|lts./,""]]],cpu:[[/(?:(amd|x(?:(?:86|64)[-_])?|wow|win)64)[;\)]/i],[[f,"amd64"]],[/(ia32(?=;))/i],[[f,F]],[/((?:i[346]|x)86)[;\)]/i],[[f,"ia32"]],[/\b(aarch64|arm(v?8e?l?|_?64))\b/i],[[f,"arm64"]],[/\b(arm(?:v[67])?ht?n?[fl]p?)\b/i],[[f,"armhf"]],[/windows (ce|mobile); ppc;/i],[[f,"arm"]],[/((?:ppc|powerpc)(?:64)?)(?: mac|;|\))/i],[[f,/ower/,"",F]],[/(sun4\w)[;\)]/i],[[f,"sparc"]],[/((?:avr32|ia64(?=;))|68k(?=\))|\barm(?=v(?:[1-7]|[5-7]1)l?|;|eabi)|(?=atmel )avr|(?:irix|mips|sparc)(?:64)?\b|pa-risc)/i],[[f,F]]],device:[[/\b(sch-i[89]0\d|shw-m380s|sm-[ptx]\w{2,4}|gt-[pn]\d{2,4}|sgh-t8[56]9|nexus 10)/i],[l,[p,L],[d,h]],[/\b((?:s[cgp]h|gt|sm)-(?![lr])\w+|sc[g-]?[\d]+a?|galaxy nexus)/i,/samsung[- ]((?!sm-[lr])[-\w]+)/i,/sec-(sgh\w+)/i],[l,[p,L],[d,w]],[/(?:\/|\()(ip(?:hone|od)[\w, ]*)(?:\/|;)/i],[l,[p,x],[d,w]],[/\((ipad);[-\w\),; ]+apple/i,/applecoremedia\/[\w\.]+ \((ipad)/i,/\b(ipad)\d\d?,\d\d?[;\]].+ios/i],[l,[p,x],[d,h]],[/(macintosh);/i],[l,[p,x]],[/\b(sh-?[altvz]?\d\d[a-ekm]?)/i],[l,[p,j],[d,w]],[/(?:honor)([-\w ]+)[;\)]/i],[l,[p,"Honor"],[d,w]],[/\b((?:ag[rs][23]?|bah2?|sht?|btv)-a?[lw]\d{2})\b(?!.+d\/s)/i],[l,[p,A],[d,h]],[/(?:huawei)([-\w ]+)[;\)]/i,/\b(nexus 6p|\w{2,4}e?-[atu]?[ln][\dx][012359c][adn]?)\b(?!.+d\/s)/i],[l,[p,A],[d,w]],[/\b(poco[\w ]+|m2\d{3}j\d\d[a-z]{2})(?: bui|\))/i,/\b; (\w+) build\/hm\1/i,/\b(hm[-_ ]?note?[_ ]?(?:\d\w)?) bui/i,/\b(redmi[\-_ ]?(?:note|k)?[\w_ ]+)(?: bui|\))/i,/oid[^\)]+; (m?[12][0-389][01]\w{3,6}[c-y])( bui|; wv|\))/i,/\b(mi[-_ ]?(?:a\d|one|one[_ ]plus|note lte|max|cc)?[_ ]?(?:\d?\w?)[_ ]?(?:plus|se|lite|pro)?)(?: bui|\))/i],[[l,/_/g," "],[p,q],[d,w]],[/oid[^\)]+; (2\d{4}(283|rpbf)[cgl])( bui|\))/i,/\b(mi[-_ ]?(?:pad)(?:[\w_ ]+))(?: bui|\))/i],[[l,/_/g," "],[p,q],[d,h]],[/; (\w+) bui.+ oppo/i,/\b(cph[12]\d{3}|p(?:af|c[al]|d\w|e[ar])[mt]\d0|x9007|a101op)\b/i],[l,[p,"OPPO"],[d,w]],[/\b(opd2\d{3}a?) bui/i],[l,[p,"OPPO"],[d,h]],[/vivo (\w+)(?: bui|\))/i,/\b(v[12]\d{3}\w?[at])(?: bui|;)/i],[l,[p,"Vivo"],[d,w]],[/\b(rmx[1-3]\d{3})(?: bui|;|\))/i],[l,[p,"Realme"],[d,w]],[/\b(milestone|droid(?:[2-4x]| (?:bionic|x2|pro|razr))?:?( 4g)?)\b[\w ]+build\//i,/\bmot(?:orola)?[- ](\w*)/i,/((?:moto[\w\(\) ]+|xt\d{3,4}|nexus 6)(?= bui|\)))/i],[l,[p,E],[d,w]],[/\b(mz60\d|xoom[2 ]{0,2}) build\//i],[l,[p,E],[d,h]],[/((?=lg)?[vl]k\-?\d{3}) bui| 3\.[-\w; ]{10}lg?-([06cv9]{3,4})/i],[l,[p,N],[d,h]],[/(lm(?:-?f100[nv]?|-[\w\.]+)(?= bui|\))|nexus [45])/i,/\blg[-e;\/ ]+((?!browser|netcast|android tv)\w+)/i,/\blg-?([\d\w]+) bui/i],[l,[p,N],[d,w]],[/(ideatab[-\w ]+)/i,/lenovo ?(s[56]000[-\w]+|tab(?:[\w ]+)|yt[-\d\w]{6}|tb[-\d\w]{6})/i],[l,[p,"Lenovo"],[d,h]],[/(?:maemo|nokia).*(n900|lumia \d+)/i,/nokia[-_ ]?([-\w\.]*)/i],[[l,/_/g," "],[p,"Nokia"],[d,w]],[/(pixel c)\b/i],[l,[p,C],[d,h]],[/droid.+; (pixel[\daxl ]{0,6})(?: bui|\))/i],[l,[p,C],[d,w]],[/droid.+; (a?\d[0-2]{2}so|[c-g]\d{4}|so[-gl]\w+|xq-a\w[4-7][12])(?= bui|\).+chrome\/(?![1-6]{0,1}\d\.))/i],[l,[p,R],[d,w]],[/sony tablet [ps]/i,/\b(?:sony)?sgp\w+(?: bui|\))/i],[[l,"Xperia Tablet"],[p,R],[d,h]],[/ (kb2005|in20[12]5|be20[12][59])\b/i,/(?:one)?(?:plus)? (a\d0\d\d)(?: b|\))/i],[l,[p,"OnePlus"],[d,w]],[/(alexa)webm/i,/(kf[a-z]{2}wi|aeo(?!bc)\w\w)( bui|\))/i,/(kf[a-z]+)( bui|\)).+silk\//i],[l,[p,_],[d,h]],[/((?:sd|kf)[0349hijorstuw]+)( bui|\)).+silk\//i],[[l,/(.+)/g,"Fire Phone $1"],[p,_],[d,w]],[/(playbook);[-\w\),; ]+(rim)/i],[l,p,[d,h]],[/\b((?:bb[a-f]|st[hv])100-\d)/i,/\(bb10; (\w+)/i],[l,[p,O],[d,w]],[/(?:\b|asus_)(transfo[prime ]{4,10} \w+|eeepc|slider \w+|nexus 7|padfone|p00[cj])/i],[l,[p,k],[d,h]],[/ (z[bes]6[027][012][km][ls]|zenfone \d\w?)\b/i],[l,[p,k],[d,w]],[/(nexus 9)/i],[l,[p,"HTC"],[d,h]],[/(htc)[-;_ ]{1,2}([\w ]+(?=\)| bui)|\w+)/i,/(zte)[- ]([\w ]+?)(?: bui|\/|\))/i,/(alcatel|geeksphone|nexian|panasonic(?!(?:;|\.))|sony(?!-bra))[-_ ]?([-\w]*)/i],[p,[l,/_/g," "],[d,w]],[/droid [\w\.]+; ((?:8[14]9[16]|9(?:0(?:48|60|8[01])|1(?:3[27]|66)|2(?:6[69]|9[56])|466))[gqswx])\w*(\)| bui)/i],[l,[p,"TCL"],[d,h]],[/(itel) ((\w+))/i],[[p,F],l,[d,W,{tablet:["p10001l","w7001"],"*":"mobile"}]],[/droid.+; ([ab][1-7]-?[0178a]\d\d?)/i],[l,[p,"Acer"],[d,h]],[/droid.+; (m[1-5] note) bui/i,/\bmz-([-\w]{2,})/i],[l,[p,"Meizu"],[d,w]],[/; ((?:power )?armor(?:[\w ]{0,8}))(?: bui|\))/i],[l,[p,"Ulefone"],[d,w]],[/; (energy ?\w+)(?: bui|\))/i,/; energizer ([\w ]+)(?: bui|\))/i],[l,[p,"Energizer"],[d,w]],[/; cat (b35);/i,/; (b15q?|s22 flip|s48c|s62 pro)(?: bui|\))/i],[l,[p,"Cat"],[d,w]],[/((?:new )?andromax[\w- ]+)(?: bui|\))/i],[l,[p,"Smartfren"],[d,w]],[/droid.+; (a(?:015|06[35]|142p?))/i],[l,[p,"Nothing"],[d,w]],[/(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus|dell|meizu|motorola|polytron|infinix|tecno|micromax|advan)[-_ ]?([-\w]*)/i,/; (imo) ((?!tab)[\w ]+?)(?: bui|\))/i,/(hp) ([\w ]+\w)/i,/(asus)-?(\w+)/i,/(microsoft); (lumia[\w ]+)/i,/(lenovo)[-_ ]?([-\w]+)/i,/(jolla)/i,/(oppo) ?([\w ]+) bui/i],[p,l,[d,w]],[/(imo) (tab \w+)/i,/(kobo)\s(ereader|touch)/i,/(archos) (gamepad2?)/i,/(hp).+(touchpad(?!.+tablet)|tablet)/i,/(kindle)\/([\w\.]+)/i,/(nook)[\w ]+build\/(\w+)/i,/(dell) (strea[kpr\d ]*[\dko])/i,/(le[- ]+pan)[- ]+(\w{1,9}) bui/i,/(trinity)[- ]*(t\d{3}) bui/i,/(gigaset)[- ]+(q\w{1,9}) bui/i,/(vodafone) ([\w ]+)(?:\)| bui)/i],[p,l,[d,h]],[/(surface duo)/i],[l,[p,T],[d,h]],[/droid [\d\.]+; (fp\du?)(?: b|\))/i],[l,[p,"Fairphone"],[d,w]],[/(u304aa)/i],[l,[p,"AT&T"],[d,w]],[/\bsie-(\w*)/i],[l,[p,"Siemens"],[d,w]],[/\b(rct\w+) b/i],[l,[p,"RCA"],[d,h]],[/\b(venue[\d ]{2,7}) b/i],[l,[p,"Dell"],[d,h]],[/\b(q(?:mv|ta)\w+) b/i],[l,[p,"Verizon"],[d,h]],[/\b(?:barnes[& ]+noble |bn[rt])([\w\+ ]*) b/i],[l,[p,"Barnes & Noble"],[d,h]],[/\b(tm\d{3}\w+) b/i],[l,[p,"NuVision"],[d,h]],[/\b(k88) b/i],[l,[p,"ZTE"],[d,h]],[/\b(nx\d{3}j) b/i],[l,[p,"ZTE"],[d,w]],[/\b(gen\d{3}) b.+49h/i],[l,[p,"Swiss"],[d,w]],[/\b(zur\d{3}) b/i],[l,[p,"Swiss"],[d,h]],[/\b((zeki)?tb.*\b) b/i],[l,[p,"Zeki"],[d,h]],[/\b([yr]\d{2}) b/i,/\b(dragon[- ]+touch |dt)(\w{5}) b/i],[[p,"Dragon Touch"],l,[d,h]],[/\b(ns-?\w{0,9}) b/i],[l,[p,"Insignia"],[d,h]],[/\b((nxa|next)-?\w{0,9}) b/i],[l,[p,"NextBook"],[d,h]],[/\b(xtreme\_)?(v(1[045]|2[015]|[3469]0|7[05])) b/i],[[p,"Voice"],l,[d,w]],[/\b(lvtel\-)?(v1[12]) b/i],[[p,"LvTel"],l,[d,w]],[/\b(ph-1) /i],[l,[p,"Essential"],[d,w]],[/\b(v(100md|700na|7011|917g).*\b) b/i],[l,[p,"Envizen"],[d,h]],[/\b(trio[-\w\. ]+) b/i],[l,[p,"MachSpeed"],[d,h]],[/\btu_(1491) b/i],[l,[p,"Rotor"],[d,h]],[/(shield[\w ]+) b/i],[l,[p,"Nvidia"],[d,h]],[/(sprint) (\w+)/i],[p,l,[d,w]],[/(kin\.[onetw]{3})/i],[[l,/\./g," "],[p,T],[d,w]],[/droid.+; (cc6666?|et5[16]|mc[239][23]x?|vc8[03]x?)\)/i],[l,[p,M],[d,h]],[/droid.+; (ec30|ps20|tc[2-8]\d[kx])\)/i],[l,[p,M],[d,w]],[/smart-tv.+(samsung)/i],[p,[d,g]],[/hbbtv.+maple;(\d+)/i],[[l,/^/,"SmartTV"],[p,L],[d,g]],[/(nux; netcast.+smarttv|lg (netcast\.tv-201\d|android tv))/i],[[p,N],[d,g]],[/(apple) ?tv/i],[p,[l,x+" TV"],[d,g]],[/crkey/i],[[l,S+"cast"],[p,C],[d,g]],[/droid.+aft(\w+)( bui|\))/i],[l,[p,_],[d,g]],[/\(dtv[\);].+(aquos)/i,/(aquos-tv[\w ]+)\)/i],[l,[p,j],[d,g]],[/(bravia[\w ]+)( bui|\))/i],[l,[p,R],[d,g]],[/(mitv-\w{5}) bui/i],[l,[p,q],[d,g]],[/Hbbtv.*(technisat) (.*);/i],[p,l,[d,g]],[/\b(roku)[\dx]*[\)\/]((?:dvp-)?[\d\.]*)/i,/hbbtv\/\d+\.\d+\.\d+ +\([\w\+ ]*; *([\w\d][^;]*);([^;]*)/i],[[p,H],[l,H],[d,g]],[/\b(android tv|smart[- ]?tv|opera tv|tv; rv:)\b/i],[[d,g]],[/(ouya)/i,/(nintendo) ([wids3utch]+)/i],[p,l,[d,b]],[/droid.+; (shield) bui/i],[l,[p,"Nvidia"],[d,b]],[/(playstation [345portablevi]+)/i],[l,[p,R],[d,b]],[/\b(xbox(?: one)?(?!; xbox))[\); ]/i],[l,[p,T],[d,b]],[/\b(sm-[lr]\d\d[05][fnuw]?s?)\b/i],[l,[p,L],[d,v]],[/((pebble))app/i],[p,l,[d,v]],[/(watch)(?: ?os[,\/]|\d,\d\/)[\d\.]+/i],[l,[p,x],[d,v]],[/droid.+; (glass) \d/i],[l,[p,C],[d,v]],[/droid.+; (wt63?0{2,3})\)/i],[l,[p,M],[d,v]],[/droid.+; (glass) \d/i],[l,[p,C],[d,v]],[/(pico) (4|neo3(?: link|pro)?)/i],[p,l,[d,v]],[/; (quest( \d| pro)?)/i],[l,[p,z],[d,v]],[/(tesla)(?: qtcarbrowser|\/[-\w\.]+)/i],[p,[d,y]],[/(aeobc)\b/i],[l,[p,_],[d,y]],[/droid .+?; ([^;]+?)(?: bui|; wv\)|\) applew).+? mobile safari/i],[l,[d,w]],[/droid .+?; ([^;]+?)(?: bui|\) applew).+?(?! mobile) safari/i],[l,[d,h]],[/\b((tablet|tab)[;\/]|focus\/\d(?!.+mobile))/i],[[d,h]],[/(phone|mobile(?:[;\/]| [ \w\/\.]*safari)|pda(?=.+windows ce))/i],[[d,w]],[/(android[-\w\. ]{0,9});.+buil/i],[l,[p,"Generic"]]],engine:[[/windows.+ edge\/([\w\.]+)/i],[m,[u,"EdgeHTML"]],[/(arkweb)\/([\w\.]+)/i],[u,m],[/webkit\/537\.36.+chrome\/(?!27)([\w\.]+)/i],[m,[u,"Blink"]],[/(presto)\/([\w\.]+)/i,/(webkit|trident|netfront|netsurf|amaya|lynx|w3m|goanna|servo)\/([\w\.]+)/i,/ekioh(flow)\/([\w\.]+)/i,/(khtml|tasman|links)[\/ ]\(?([\w\.]+)/i,/(icab)[\/ ]([23]\.[\d\.]+)/i,/\b(libweb)/i],[u,m],[/rv\:([\w\.]{1,9})\b.+(gecko)/i],[m,u]],os:[[/microsoft (windows) (vista|xp)/i],[u,m],[/(windows (?:phone(?: os)?|mobile))[\/ ]?([\d\.\w ]*)/i],[u,[m,W,Z]],[/windows nt 6\.2; (arm)/i,/windows[\/ ]?([ntce\d\. ]+\w)(?!.+xbox)/i,/(?:win(?=3|9|n)|win 9x )([nt\d\.]+)/i],[[m,W,Z],[u,"Windows"]],[/ip[honead]{2,4}\b(?:.*os ([\w]+) like mac|; opera)/i,/(?:ios;fbsv\/|iphone.+ios[\/ ])([\d\.]+)/i,/cfnetwork\/.+darwin/i],[[m,/_/g,"."],[u,"iOS"]],[/(mac os x) ?([\w\. ]*)/i,/(macintosh|mac_powerpc\b)(?!.+haiku)/i],[[u,D],[m,/_/g,"."]],[/droid ([\w\.]+)\b.+(android[- ]x86|harmonyos)/i],[m,u],[/(android|webos|qnx|bada|rim tablet os|maemo|meego|sailfish|openharmony)[-\/ ]?([\w\.]*)/i,/(blackberry)\w*\/([\w\.]*)/i,/(tizen|kaios)[\/ ]([\w\.]+)/i,/\((series40);/i],[u,m],[/\(bb(10);/i],[m,[u,O]],[/(?:symbian ?os|symbos|s60(?=;)|series60)[-\/ ]?([\w\.]*)/i],[m,[u,"Symbian"]],[/mozilla\/[\d\.]+ \((?:mobile|tablet|tv|mobile; [\w ]+); rv:.+ gecko\/([\w\.]+)/i],[m,[u,U+" OS"]],[/web0s;.+rt(tv)/i,/\b(?:hp)?wos(?:browser)?\/([\w\.]+)/i],[m,[u,"webOS"]],[/watch(?: ?os[,\/]|\d,\d\/)([\d\.]+)/i],[m,[u,"watchOS"]],[/crkey\/([\d\.]+)/i],[m,[u,S+"cast"]],[/(cros) [\w]+(?:\)| ([\w\.]+)\b)/i],[[u,B],m],[/panasonic;(viera)/i,/(netrange)mmh/i,/(nettv)\/(\d+\.[\w\.]+)/i,/(nintendo|playstation) ([wids345portablevuch]+)/i,/(xbox); +xbox ([^\);]+)/i,/\b(joli|palm)\b ?(?:os)?\/?([\w\.]*)/i,/(mint)[\/\(\) ]?(\w*)/i,/(mageia|vectorlinux)[; ]/i,/([kxln]?ubuntu|debian|suse|opensuse|gentoo|arch(?= linux)|slackware|fedora|mandriva|centos|pclinuxos|red ?hat|zenwalk|linpus|raspbian|plan 9|minix|risc os|contiki|deepin|manjaro|elementary os|sabayon|linspire)(?: gnu\/linux)?(?: enterprise)?(?:[- ]linux)?(?:-gnu)?[-\/ ]?(?!chrom|package)([-\w\.]*)/i,/(hurd|linux) ?([\w\.]*)/i,/(gnu) ?([\w\.]*)/i,/\b([-frentopcghs]{0,5}bsd|dragonfly)[\/ ]?(?!amd|[ix346]{1,2}86)([\w\.]*)/i,/(haiku) (\w+)/i],[u,m],[/(sunos) ?([\w\.\d]*)/i],[[u,"Solaris"],m],[/((?:open)?solaris)[-\/ ]?([\w\.]*)/i,/(aix) ((\d)(?=\.|\)| )[\w\.])*/i,/\b(beos|os\/2|amigaos|morphos|openvms|fuchsia|hp-ux|serenityos)/i,/(unix) ?([\w\.]*)/i],[u,m]]},Y=function(e,i){if(typeof e===a&&(i=e,e=n),!(this instanceof Y))return new Y(e,i).getResult();var b=typeof o!==r&&o.navigator?o.navigator:n,g=e||(b&&b.userAgent?b.userAgent:""),v=b&&b.userAgentData?b.userAgentData:n,y=i?function(e,i){var o={};for(var n in e)i[n]&&i[n].length%2==0?o[n]=i[n].concat(e[n]):o[n]=e[n];return o}($,i):$,_=b&&b.userAgent==g;return this.getBrowser=function(){var e,i={};return i[u]=n,i[m]=n,V.call(i,g,y.browser),i[c]=typeof(e=i[m])===s?e.replace(/[^\d\.]/g,"").split(".")[0]:n,_&&b&&b.brave&&typeof b.brave.isBrave==t&&(i[u]="Brave"),i},this.getCPU=function(){var e={};return e[f]=n,V.call(e,g,y.cpu),e},this.getDevice=function(){var e={};return e[p]=n,e[l]=n,e[d]=n,V.call(e,g,y.device),_&&!e[d]&&v&&v.mobile&&(e[d]=w),_&&"Macintosh"==e[l]&&b&&typeof b.standalone!==r&&b.maxTouchPoints&&b.maxTouchPoints>2&&(e[l]="iPad",e[d]=h),e},this.getEngine=function(){var e={};return e[u]=n,e[m]=n,V.call(e,g,y.engine),e},this.getOS=function(){var e={};return e[u]=n,e[m]=n,V.call(e,g,y.os),_&&!e[u]&&v&&v.platform&&"Unknown"!=v.platform&&(e[u]=v.platform.replace(/chrome os/i,B).replace(/macos/i,D)),e},this.getResult=function(){return{ua:this.getUA(),browser:this.getBrowser(),engine:this.getEngine(),os:this.getOS(),device:this.getDevice(),cpu:this.getCPU()}},this.getUA=function(){return g},this.setUA=function(e){return g=typeof e===s&&e.length>500?H(e,500):e,this},this.setUA(g),this};Y.VERSION="1.0.40",Y.BROWSER=X([u,m,c]),Y.CPU=X([f]),Y.DEVICE=X([l,p,d,b,w,g,h,v,y]),Y.ENGINE=Y.OS=X([u,m]),e.exports&&(i=e.exports=Y),i.UAParser=Y;var K=typeof o!==r&&(o.jQuery||o.Zepto);if(K&&!K.ua){var Q=new Y;K.ua=Q.getResult(),K.ua.get=function(){return Q.getUA()},K.ua.set=function(e){Q.setUA(e);var i=Q.getResult();for(var o in i)K.ua[o]=i[o]}}}("object"==typeof window?window:d)}(p,p.exports);var m=new p.exports.UAParser,f=m.getBrowser(),b=f.name,w=f.version,h=m.getEngine(),g=h.name,v=h.version,y=function(){var e=(0,m.getOS)();return{os:e.name,osversion:e.version}}(),_=y.os,x=y.osversion,k=function(){var e=(0,m.getDevice)();return{device:e.model,devicebrand:e.vendor}}(),O=k.device,P=k.devicebrand;_=_||"",x=x||"",O=O||"",P=P||"";var S={exports:{}},U={exports:{}},C=1e3,A=60*C,N=60*A,T=24*N,E=365.25*T,I=function(e,i){i=i||{};var o=typeof e;if("string"===o&&e.length>0)return function(e){if((e=String(e)).length>100)return;var i=/^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(e);if(!i)return;var o=parseFloat(i[1]);switch((i[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return o*E;case"days":case"day":case"d":return o*T;case"hours":case"hour":case"hrs":case"hr":case"h":return o*N;case"minutes":case"minute":case"mins":case"min":case"m":return o*A;case"seconds":case"second":case"secs":case"sec":case"s":return o*C;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return o;default:return}}(e);if("number"===o&&!1===isNaN(e))return i.long?function(e){return L(e,T,"day")||L(e,N,"hour")||L(e,A,"minute")||L(e,C,"second")||e+" ms"}(e):function(e){if(e>=T)return Math.round(e/T)+"d";if(e>=N)return Math.round(e/N)+"h";if(e>=A)return Math.round(e/A)+"m";if(e>=C)return Math.round(e/C)+"s";return e+"ms"}(e);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))};function L(e,i,o){if(!(e<i))return e<1.5*i?Math.floor(e/i)+" "+o:Math.ceil(e/i)+" "+o+"s"}!function(e,i){var o;function n(e){function n(){if(n.enabled){var e=n,t=+new Date,r=t-(o||t);e.diff=r,e.prev=o,e.curr=t,o=t;for(var a=new Array(arguments.length),s=0;s<a.length;s++)a[s]=arguments[s];a[0]=i.coerce(a[0]),"string"!=typeof a[0]&&a.unshift("%O");var c=0;a[0]=a[0].replace(/%([a-zA-Z%])/g,(function(o,n){if("%%"===o)return o;c++;var t=i.formatters[n];if("function"==typeof t){var r=a[c];o=t.call(e,r),a.splice(c,1),c--}return o})),i.formatArgs.call(e,a),(n.log||i.log||console.log.bind(console)).apply(e,a)}}return n.namespace=e,n.enabled=i.enabled(e),n.useColors=i.useColors(),n.color=function(e){var o,n=0;for(o in e)n=(n<<5)-n+e.charCodeAt(o),n|=0;return i.colors[Math.abs(n)%i.colors.length]}(e),"function"==typeof i.init&&i.init(n),n}(i=U.exports=n.debug=n.default=n).coerce=function(e){return e instanceof Error?e.stack||e.message:e},i.disable=function(){i.enable("")},i.enable=function(e){i.save(e),i.names=[],i.skips=[];for(var o=("string"==typeof e?e:"").split(/[\s,]+/),n=o.length,t=0;t<n;t++)o[t]&&("-"===(e=o[t].replace(/\*/g,".*?"))[0]?i.skips.push(new RegExp("^"+e.substr(1)+"$")):i.names.push(new RegExp("^"+e+"$")))},i.enabled=function(e){var o,n;for(o=0,n=i.skips.length;o<n;o++)if(i.skips[o].test(e))return!1;for(o=0,n=i.names.length;o<n;o++)if(i.names[o].test(e))return!0;return!1},i.humanize=I,i.names=[],i.skips=[],i.formatters={}}(0,U.exports),function(e,i){function o(){var e;try{e=i.storage.debug}catch(e){}return!e&&"undefined"!=typeof process&&"env"in process&&(e=process.env.DEBUG),e}(i=e.exports=U.exports).log=function(){return"object"==typeof console&&console.log&&Function.prototype.apply.call(console.log,console,arguments)},i.formatArgs=function(e){var o=this.useColors;if(e[0]=(o?"%c":"")+this.namespace+(o?" %c":" ")+e[0]+(o?"%c ":" ")+"+"+i.humanize(this.diff),!o)return;var n="color: "+this.color;e.splice(1,0,n,"color: inherit");var t=0,r=0;e[0].replace(/%[a-zA-Z%]/g,(function(e){"%%"!==e&&(t++,"%c"===e&&(r=t))})),e.splice(r,0,n)},i.save=function(e){try{null==e?i.storage.removeItem("debug"):i.storage.debug=e}catch(e){}},i.load=o,i.useColors=function(){if("undefined"!=typeof window&&window.process&&"renderer"===window.process.type)return!0;return"undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)},i.storage="undefined"!=typeof chrome&&void 0!==chrome.storage?chrome.storage.local:function(){try{return window.localStorage}catch(e){}}(),i.colors=["lightseagreen","forestgreen","goldenrod","dodgerblue","darkorchid","crimson"],i.formatters.j=function(e){try{return JSON.stringify(e)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}},i.enable(o())}(S,S.exports);var j=S.exports("jsonp"),R=function(e,i,o){"function"==typeof i&&(o=i,i={});i||(i={});var n,t,r=i.prefix||"__jp",a=i.name||r+q++,s=i.param||"callback",c=null!=i.timeout?i.timeout:6e4,l=encodeURIComponent,u=document.getElementsByTagName("script")[0]||document.head;c&&(t=setTimeout((function(){d(),o&&o(new Error("Timeout"))}),c));function d(){n.parentNode&&n.parentNode.removeChild(n),window[a]=M,t&&clearTimeout(t)}return window[a]=function(e){j("jsonp got",e),d(),o&&o(null,e)},e=(e+=(~e.indexOf("?")?"&":"?")+s+"="+l(a)).replace("?&","?"),j('jsonp req "%s"',e),(n=document.createElement("script")).src=e,u.parentNode.insertBefore(n,u),function(){window[a]&&d()}},q=0;function M(){}function z(e,i){return void 0===i&&(i={}),new Promise((function(o,n){var t;R("".concat(e,"?").concat((t=i,Object.keys(t).map((function(e){return encodeURIComponent(e)+"="+encodeURIComponent(t[e])})).join("&"))),{param:"jsonp",name:"__jsonp_cb_".concat(Date.now(),"__"),timeout:0},(function(e,i){e?n(e):o(i)}))}))}var B="5.3.0";
6
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=function(){return e=Object.assign||function(e){for(var i,o=1,n=arguments.length;o<n;o++)for(var t in i=arguments[o])Object.prototype.hasOwnProperty.call(i,t)&&(e[t]=i[t]);return e},e.apply(this,arguments)};function i(e,i){var o={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&i.indexOf(n)<0&&(o[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var t=0;for(n=Object.getOwnPropertySymbols(e);t<n.length;t++)i.indexOf(n[t])<0&&Object.prototype.propertyIsEnumerable.call(e,n[t])&&(o[n[t]]=e[n[t]])}return o}"function"==typeof SuppressedError&&SuppressedError;var o="XYZ_LOG_";function n(e){return void 0!==typeof localStorage?localStorage.getItem(o+e):null}function t(e,i){void 0!==typeof localStorage&&localStorage.setItem(o+e,i)}function r(e,i){void 0===e&&(e=18),void 0===i&&(i=0);for(var o="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz".split(""),n=[],t=Math.random,r=e,a=i||o.length,s=0;s<r;s++)n[s]=o[0|t()*a];return n.join("")}function a(e){void 0===e&&(e="UID");var i=n(e);return i||t(e,i=r()),i}function s(e,i){void 0===e&&(e=[]),void 0===i&&(i=location.href);var o=new URL(i).search.substring(1),n={};return o&&o.split("&").forEach((function(e){n[e.split("=")[0]]=e.split("=")[1]})),Object.keys(n).forEach((function(i){e.includes(i)&&delete n[i]})),n}function c(i,o){var n=e({},i),t=e({},o);return Object.keys(n).forEach((function(e){t[e]||delete t[e]})),e(e({},n),t)}function l(e){for(var i,o,n=[],t=1;t<arguments.length;t++)n[t-1]=arguments[t];if(!n.length)return e;var r=n.shift();if(r&&"object"==typeof r)for(var a in r)r[a]&&"object"==typeof r[a]?(e[a]||Object.assign(e,((i={})[a]={},i)),l(e[a],r[a])):Object.assign(e,((o={})[a]=r[a],o));return l.apply(void 0,function(e,i,o){if(o||2===arguments.length)for(var n,t=0,r=i.length;t<r;t++)!n&&t in i||(n||(n=Array.prototype.slice.call(i,0,t)),n[t]=i[t]);return e.concat(n||Array.prototype.slice.call(i))}([e],n,!1))}var u=function(){return"standalone"==(navigator.standalone||window.matchMedia("(display-mode: standalone)").matches?"standalone":"browser")?"pwa":(e=navigator.userAgent,["Android","webOS","iPhone","iPad","iPod","BlackBerry","Windows Phone"].some((function(i){return e.includes(i)}))?"h5":"pc");var e};var d="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},p={exports:{}};!function(e,i){!function(o,n){var t="function",r="undefined",a="object",s="string",c="major",l="model",u="name",d="type",p="vendor",m="version",f="architecture",b="console",w="mobile",h="tablet",g="smarttv",v="wearable",y="embedded",_="Amazon",x="Apple",k="ASUS",O="BlackBerry",P="Browser",S="Chrome",U="Firefox",C="Google",A="Huawei",N="LG",T="Microsoft",E="Motorola",I="Opera",L="Samsung",j="Sharp",R="Sony",q="Xiaomi",M="Zebra",z="Facebook",B="Chromium OS",D="Mac OS",G=" Browser",X=function(e){for(var i={},o=0;o<e.length;o++)i[e[o].toUpperCase()]=e[o];return i},J=function(e,i){return typeof e===s&&-1!==F(i).indexOf(F(e))},F=function(e){return e.toLowerCase()},H=function(e,i){if(typeof e===s)return e=e.replace(/^\s\s*/,""),typeof i===r?e:e.substring(0,500)},V=function(e,i){for(var o,r,s,c,l,u,d=0;d<i.length&&!l;){var p=i[d],m=i[d+1];for(o=r=0;o<p.length&&!l&&p[o];)if(l=p[o++].exec(e))for(s=0;s<m.length;s++)u=l[++r],typeof(c=m[s])===a&&c.length>0?2===c.length?typeof c[1]==t?this[c[0]]=c[1].call(this,u):this[c[0]]=c[1]:3===c.length?typeof c[1]!==t||c[1].exec&&c[1].test?this[c[0]]=u?u.replace(c[1],c[2]):n:this[c[0]]=u?c[1].call(this,u,c[2]):n:4===c.length&&(this[c[0]]=u?c[3].call(this,u.replace(c[1],c[2])):n):this[c]=u||n;d+=2}},W=function(e,i){for(var o in i)if(typeof i[o]===a&&i[o].length>0){for(var t=0;t<i[o].length;t++)if(J(i[o][t],e))return"?"===o?n:o}else if(J(i[o],e))return"?"===o?n:o;return i.hasOwnProperty("*")?i["*"]:e},Z={ME:"4.90","NT 3.11":"NT3.51","NT 4.0":"NT4.0",2e3:"NT 5.0",XP:["NT 5.1","NT 5.2"],Vista:"NT 6.0",7:"NT 6.1",8:"NT 6.2",8.1:"NT 6.3",10:["NT 6.4","NT 10.0"],RT:"ARM"},$={browser:[[/\b(?:crmo|crios)\/([\w\.]+)/i],[m,[u,"Chrome"]],[/edg(?:e|ios|a)?\/([\w\.]+)/i],[m,[u,"Edge"]],[/(opera mini)\/([-\w\.]+)/i,/(opera [mobiletab]{3,6})\b.+version\/([-\w\.]+)/i,/(opera)(?:.+version\/|[\/ ]+)([\w\.]+)/i],[u,m],[/opios[\/ ]+([\w\.]+)/i],[m,[u,I+" Mini"]],[/\bop(?:rg)?x\/([\w\.]+)/i],[m,[u,I+" GX"]],[/\bopr\/([\w\.]+)/i],[m,[u,I]],[/\bb[ai]*d(?:uhd|[ub]*[aekoprswx]{5,6})[\/ ]?([\w\.]+)/i],[m,[u,"Baidu"]],[/\b(?:mxbrowser|mxios|myie2)\/?([-\w\.]*)\b/i],[m,[u,"Maxthon"]],[/(kindle)\/([\w\.]+)/i,/(lunascape|maxthon|netfront|jasmine|blazer|sleipnir)[\/ ]?([\w\.]*)/i,/(avant|iemobile|slim(?:browser|boat|jet))[\/ ]?([\d\.]*)/i,/(?:ms|\()(ie) ([\w\.]+)/i,/(flock|rockmelt|midori|epiphany|silk|skyfire|ovibrowser|bolt|iron|vivaldi|iridium|phantomjs|bowser|qupzilla|falkon|rekonq|puffin|brave|whale(?!.+naver)|qqbrowserlite|duckduckgo|klar|helio|(?=comodo_)?dragon)\/([-\w\.]+)/i,/(heytap|ovi|115)browser\/([\d\.]+)/i,/(weibo)__([\d\.]+)/i],[u,m],[/quark(?:pc)?\/([-\w\.]+)/i],[m,[u,"Quark"]],[/\bddg\/([\w\.]+)/i],[m,[u,"DuckDuckGo"]],[/(?:\buc? ?browser|(?:juc.+)ucweb)[\/ ]?([\w\.]+)/i],[m,[u,"UC"+P]],[/microm.+\bqbcore\/([\w\.]+)/i,/\bqbcore\/([\w\.]+).+microm/i,/micromessenger\/([\w\.]+)/i],[m,[u,"WeChat"]],[/konqueror\/([\w\.]+)/i],[m,[u,"Konqueror"]],[/trident.+rv[: ]([\w\.]{1,9})\b.+like gecko/i],[m,[u,"IE"]],[/ya(?:search)?browser\/([\w\.]+)/i],[m,[u,"Yandex"]],[/slbrowser\/([\w\.]+)/i],[m,[u,"Smart Lenovo "+P]],[/(avast|avg)\/([\w\.]+)/i],[[u,/(.+)/,"$1 Secure "+P],m],[/\bfocus\/([\w\.]+)/i],[m,[u,U+" Focus"]],[/\bopt\/([\w\.]+)/i],[m,[u,I+" Touch"]],[/coc_coc\w+\/([\w\.]+)/i],[m,[u,"Coc Coc"]],[/dolfin\/([\w\.]+)/i],[m,[u,"Dolphin"]],[/coast\/([\w\.]+)/i],[m,[u,I+" Coast"]],[/miuibrowser\/([\w\.]+)/i],[m,[u,"MIUI"+G]],[/fxios\/([\w\.-]+)/i],[m,[u,U]],[/\bqihoobrowser\/?([\w\.]*)/i],[m,[u,"360"]],[/\b(qq)\/([\w\.]+)/i],[[u,/(.+)/,"$1Browser"],m],[/(oculus|sailfish|huawei|vivo|pico)browser\/([\w\.]+)/i],[[u,/(.+)/,"$1"+G],m],[/samsungbrowser\/([\w\.]+)/i],[m,[u,L+" Internet"]],[/metasr[\/ ]?([\d\.]+)/i],[m,[u,"Sogou Explorer"]],[/(sogou)mo\w+\/([\d\.]+)/i],[[u,"Sogou Mobile"],m],[/(electron)\/([\w\.]+) safari/i,/(tesla)(?: qtcarbrowser|\/(20\d\d\.[-\w\.]+))/i,/m?(qqbrowser|2345(?=browser|chrome|explorer))\w*[\/ ]?v?([\w\.]+)/i],[u,m],[/(lbbrowser|rekonq)/i,/\[(linkedin)app\]/i],[u],[/ome\/([\w\.]+) \w* ?(iron) saf/i,/ome\/([\w\.]+).+qihu (360)[es]e/i],[m,u],[/((?:fban\/fbios|fb_iab\/fb4a)(?!.+fbav)|;fbav\/([\w\.]+);)/i],[[u,z],m],[/(Klarna)\/([\w\.]+)/i,/(kakao(?:talk|story))[\/ ]([\w\.]+)/i,/(naver)\(.*?(\d+\.[\w\.]+).*\)/i,/safari (line)\/([\w\.]+)/i,/\b(line)\/([\w\.]+)\/iab/i,/(alipay)client\/([\w\.]+)/i,/(twitter)(?:and| f.+e\/([\w\.]+))/i,/(chromium|instagram|snapchat)[\/ ]([-\w\.]+)/i],[u,m],[/\bgsa\/([\w\.]+) .*safari\//i],[m,[u,"GSA"]],[/musical_ly(?:.+app_?version\/|_)([\w\.]+)/i],[m,[u,"TikTok"]],[/headlesschrome(?:\/([\w\.]+)| )/i],[m,[u,S+" Headless"]],[/ wv\).+(chrome)\/([\w\.]+)/i],[[u,S+" WebView"],m],[/droid.+ version\/([\w\.]+)\b.+(?:mobile safari|safari)/i],[m,[u,"Android "+P]],[/(chrome|omniweb|arora|[tizenoka]{5} ?browser)\/v?([\w\.]+)/i],[u,m],[/version\/([\w\.\,]+) .*mobile\/\w+ (safari)/i],[m,[u,"Mobile Safari"]],[/version\/([\w(\.|\,)]+) .*(mobile ?safari|safari)/i],[m,u],[/webkit.+?(mobile ?safari|safari)(\/[\w\.]+)/i],[u,[m,W,{"1.0":"/8",1.2:"/1",1.3:"/3","2.0":"/412","2.0.2":"/416","2.0.3":"/417","2.0.4":"/419","?":"/"}]],[/(webkit|khtml)\/([\w\.]+)/i],[u,m],[/(navigator|netscape\d?)\/([-\w\.]+)/i],[[u,"Netscape"],m],[/(wolvic|librewolf)\/([\w\.]+)/i],[u,m],[/mobile vr; rv:([\w\.]+)\).+firefox/i],[m,[u,U+" Reality"]],[/ekiohf.+(flow)\/([\w\.]+)/i,/(swiftfox)/i,/(icedragon|iceweasel|camino|chimera|fennec|maemo browser|minimo|conkeror)[\/ ]?([\w\.\+]+)/i,/(seamonkey|k-meleon|icecat|iceape|firebird|phoenix|palemoon|basilisk|waterfox)\/([-\w\.]+)$/i,/(firefox)\/([\w\.]+)/i,/(mozilla)\/([\w\.]+) .+rv\:.+gecko\/\d+/i,/(polaris|lynx|dillo|icab|doris|amaya|w3m|netsurf|obigo|mosaic|(?:go|ice|up)[\. ]?browser)[-\/ ]?v?([\w\.]+)/i,/(links) \(([\w\.]+)/i],[u,[m,/_/g,"."]],[/(cobalt)\/([\w\.]+)/i],[u,[m,/master.|lts./,""]]],cpu:[[/(?:(amd|x(?:(?:86|64)[-_])?|wow|win)64)[;\)]/i],[[f,"amd64"]],[/(ia32(?=;))/i],[[f,F]],[/((?:i[346]|x)86)[;\)]/i],[[f,"ia32"]],[/\b(aarch64|arm(v?8e?l?|_?64))\b/i],[[f,"arm64"]],[/\b(arm(?:v[67])?ht?n?[fl]p?)\b/i],[[f,"armhf"]],[/windows (ce|mobile); ppc;/i],[[f,"arm"]],[/((?:ppc|powerpc)(?:64)?)(?: mac|;|\))/i],[[f,/ower/,"",F]],[/(sun4\w)[;\)]/i],[[f,"sparc"]],[/((?:avr32|ia64(?=;))|68k(?=\))|\barm(?=v(?:[1-7]|[5-7]1)l?|;|eabi)|(?=atmel )avr|(?:irix|mips|sparc)(?:64)?\b|pa-risc)/i],[[f,F]]],device:[[/\b(sch-i[89]0\d|shw-m380s|sm-[ptx]\w{2,4}|gt-[pn]\d{2,4}|sgh-t8[56]9|nexus 10)/i],[l,[p,L],[d,h]],[/\b((?:s[cgp]h|gt|sm)-(?![lr])\w+|sc[g-]?[\d]+a?|galaxy nexus)/i,/samsung[- ]((?!sm-[lr])[-\w]+)/i,/sec-(sgh\w+)/i],[l,[p,L],[d,w]],[/(?:\/|\()(ip(?:hone|od)[\w, ]*)(?:\/|;)/i],[l,[p,x],[d,w]],[/\((ipad);[-\w\),; ]+apple/i,/applecoremedia\/[\w\.]+ \((ipad)/i,/\b(ipad)\d\d?,\d\d?[;\]].+ios/i],[l,[p,x],[d,h]],[/(macintosh);/i],[l,[p,x]],[/\b(sh-?[altvz]?\d\d[a-ekm]?)/i],[l,[p,j],[d,w]],[/(?:honor)([-\w ]+)[;\)]/i],[l,[p,"Honor"],[d,w]],[/\b((?:ag[rs][23]?|bah2?|sht?|btv)-a?[lw]\d{2})\b(?!.+d\/s)/i],[l,[p,A],[d,h]],[/(?:huawei)([-\w ]+)[;\)]/i,/\b(nexus 6p|\w{2,4}e?-[atu]?[ln][\dx][012359c][adn]?)\b(?!.+d\/s)/i],[l,[p,A],[d,w]],[/\b(poco[\w ]+|m2\d{3}j\d\d[a-z]{2})(?: bui|\))/i,/\b; (\w+) build\/hm\1/i,/\b(hm[-_ ]?note?[_ ]?(?:\d\w)?) bui/i,/\b(redmi[\-_ ]?(?:note|k)?[\w_ ]+)(?: bui|\))/i,/oid[^\)]+; (m?[12][0-389][01]\w{3,6}[c-y])( bui|; wv|\))/i,/\b(mi[-_ ]?(?:a\d|one|one[_ ]plus|note lte|max|cc)?[_ ]?(?:\d?\w?)[_ ]?(?:plus|se|lite|pro)?)(?: bui|\))/i],[[l,/_/g," "],[p,q],[d,w]],[/oid[^\)]+; (2\d{4}(283|rpbf)[cgl])( bui|\))/i,/\b(mi[-_ ]?(?:pad)(?:[\w_ ]+))(?: bui|\))/i],[[l,/_/g," "],[p,q],[d,h]],[/; (\w+) bui.+ oppo/i,/\b(cph[12]\d{3}|p(?:af|c[al]|d\w|e[ar])[mt]\d0|x9007|a101op)\b/i],[l,[p,"OPPO"],[d,w]],[/\b(opd2\d{3}a?) bui/i],[l,[p,"OPPO"],[d,h]],[/vivo (\w+)(?: bui|\))/i,/\b(v[12]\d{3}\w?[at])(?: bui|;)/i],[l,[p,"Vivo"],[d,w]],[/\b(rmx[1-3]\d{3})(?: bui|;|\))/i],[l,[p,"Realme"],[d,w]],[/\b(milestone|droid(?:[2-4x]| (?:bionic|x2|pro|razr))?:?( 4g)?)\b[\w ]+build\//i,/\bmot(?:orola)?[- ](\w*)/i,/((?:moto[\w\(\) ]+|xt\d{3,4}|nexus 6)(?= bui|\)))/i],[l,[p,E],[d,w]],[/\b(mz60\d|xoom[2 ]{0,2}) build\//i],[l,[p,E],[d,h]],[/((?=lg)?[vl]k\-?\d{3}) bui| 3\.[-\w; ]{10}lg?-([06cv9]{3,4})/i],[l,[p,N],[d,h]],[/(lm(?:-?f100[nv]?|-[\w\.]+)(?= bui|\))|nexus [45])/i,/\blg[-e;\/ ]+((?!browser|netcast|android tv)\w+)/i,/\blg-?([\d\w]+) bui/i],[l,[p,N],[d,w]],[/(ideatab[-\w ]+)/i,/lenovo ?(s[56]000[-\w]+|tab(?:[\w ]+)|yt[-\d\w]{6}|tb[-\d\w]{6})/i],[l,[p,"Lenovo"],[d,h]],[/(?:maemo|nokia).*(n900|lumia \d+)/i,/nokia[-_ ]?([-\w\.]*)/i],[[l,/_/g," "],[p,"Nokia"],[d,w]],[/(pixel c)\b/i],[l,[p,C],[d,h]],[/droid.+; (pixel[\daxl ]{0,6})(?: bui|\))/i],[l,[p,C],[d,w]],[/droid.+; (a?\d[0-2]{2}so|[c-g]\d{4}|so[-gl]\w+|xq-a\w[4-7][12])(?= bui|\).+chrome\/(?![1-6]{0,1}\d\.))/i],[l,[p,R],[d,w]],[/sony tablet [ps]/i,/\b(?:sony)?sgp\w+(?: bui|\))/i],[[l,"Xperia Tablet"],[p,R],[d,h]],[/ (kb2005|in20[12]5|be20[12][59])\b/i,/(?:one)?(?:plus)? (a\d0\d\d)(?: b|\))/i],[l,[p,"OnePlus"],[d,w]],[/(alexa)webm/i,/(kf[a-z]{2}wi|aeo(?!bc)\w\w)( bui|\))/i,/(kf[a-z]+)( bui|\)).+silk\//i],[l,[p,_],[d,h]],[/((?:sd|kf)[0349hijorstuw]+)( bui|\)).+silk\//i],[[l,/(.+)/g,"Fire Phone $1"],[p,_],[d,w]],[/(playbook);[-\w\),; ]+(rim)/i],[l,p,[d,h]],[/\b((?:bb[a-f]|st[hv])100-\d)/i,/\(bb10; (\w+)/i],[l,[p,O],[d,w]],[/(?:\b|asus_)(transfo[prime ]{4,10} \w+|eeepc|slider \w+|nexus 7|padfone|p00[cj])/i],[l,[p,k],[d,h]],[/ (z[bes]6[027][012][km][ls]|zenfone \d\w?)\b/i],[l,[p,k],[d,w]],[/(nexus 9)/i],[l,[p,"HTC"],[d,h]],[/(htc)[-;_ ]{1,2}([\w ]+(?=\)| bui)|\w+)/i,/(zte)[- ]([\w ]+?)(?: bui|\/|\))/i,/(alcatel|geeksphone|nexian|panasonic(?!(?:;|\.))|sony(?!-bra))[-_ ]?([-\w]*)/i],[p,[l,/_/g," "],[d,w]],[/droid [\w\.]+; ((?:8[14]9[16]|9(?:0(?:48|60|8[01])|1(?:3[27]|66)|2(?:6[69]|9[56])|466))[gqswx])\w*(\)| bui)/i],[l,[p,"TCL"],[d,h]],[/(itel) ((\w+))/i],[[p,F],l,[d,W,{tablet:["p10001l","w7001"],"*":"mobile"}]],[/droid.+; ([ab][1-7]-?[0178a]\d\d?)/i],[l,[p,"Acer"],[d,h]],[/droid.+; (m[1-5] note) bui/i,/\bmz-([-\w]{2,})/i],[l,[p,"Meizu"],[d,w]],[/; ((?:power )?armor(?:[\w ]{0,8}))(?: bui|\))/i],[l,[p,"Ulefone"],[d,w]],[/; (energy ?\w+)(?: bui|\))/i,/; energizer ([\w ]+)(?: bui|\))/i],[l,[p,"Energizer"],[d,w]],[/; cat (b35);/i,/; (b15q?|s22 flip|s48c|s62 pro)(?: bui|\))/i],[l,[p,"Cat"],[d,w]],[/((?:new )?andromax[\w- ]+)(?: bui|\))/i],[l,[p,"Smartfren"],[d,w]],[/droid.+; (a(?:015|06[35]|142p?))/i],[l,[p,"Nothing"],[d,w]],[/(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus|dell|meizu|motorola|polytron|infinix|tecno|micromax|advan)[-_ ]?([-\w]*)/i,/; (imo) ((?!tab)[\w ]+?)(?: bui|\))/i,/(hp) ([\w ]+\w)/i,/(asus)-?(\w+)/i,/(microsoft); (lumia[\w ]+)/i,/(lenovo)[-_ ]?([-\w]+)/i,/(jolla)/i,/(oppo) ?([\w ]+) bui/i],[p,l,[d,w]],[/(imo) (tab \w+)/i,/(kobo)\s(ereader|touch)/i,/(archos) (gamepad2?)/i,/(hp).+(touchpad(?!.+tablet)|tablet)/i,/(kindle)\/([\w\.]+)/i,/(nook)[\w ]+build\/(\w+)/i,/(dell) (strea[kpr\d ]*[\dko])/i,/(le[- ]+pan)[- ]+(\w{1,9}) bui/i,/(trinity)[- ]*(t\d{3}) bui/i,/(gigaset)[- ]+(q\w{1,9}) bui/i,/(vodafone) ([\w ]+)(?:\)| bui)/i],[p,l,[d,h]],[/(surface duo)/i],[l,[p,T],[d,h]],[/droid [\d\.]+; (fp\du?)(?: b|\))/i],[l,[p,"Fairphone"],[d,w]],[/(u304aa)/i],[l,[p,"AT&T"],[d,w]],[/\bsie-(\w*)/i],[l,[p,"Siemens"],[d,w]],[/\b(rct\w+) b/i],[l,[p,"RCA"],[d,h]],[/\b(venue[\d ]{2,7}) b/i],[l,[p,"Dell"],[d,h]],[/\b(q(?:mv|ta)\w+) b/i],[l,[p,"Verizon"],[d,h]],[/\b(?:barnes[& ]+noble |bn[rt])([\w\+ ]*) b/i],[l,[p,"Barnes & Noble"],[d,h]],[/\b(tm\d{3}\w+) b/i],[l,[p,"NuVision"],[d,h]],[/\b(k88) b/i],[l,[p,"ZTE"],[d,h]],[/\b(nx\d{3}j) b/i],[l,[p,"ZTE"],[d,w]],[/\b(gen\d{3}) b.+49h/i],[l,[p,"Swiss"],[d,w]],[/\b(zur\d{3}) b/i],[l,[p,"Swiss"],[d,h]],[/\b((zeki)?tb.*\b) b/i],[l,[p,"Zeki"],[d,h]],[/\b([yr]\d{2}) b/i,/\b(dragon[- ]+touch |dt)(\w{5}) b/i],[[p,"Dragon Touch"],l,[d,h]],[/\b(ns-?\w{0,9}) b/i],[l,[p,"Insignia"],[d,h]],[/\b((nxa|next)-?\w{0,9}) b/i],[l,[p,"NextBook"],[d,h]],[/\b(xtreme\_)?(v(1[045]|2[015]|[3469]0|7[05])) b/i],[[p,"Voice"],l,[d,w]],[/\b(lvtel\-)?(v1[12]) b/i],[[p,"LvTel"],l,[d,w]],[/\b(ph-1) /i],[l,[p,"Essential"],[d,w]],[/\b(v(100md|700na|7011|917g).*\b) b/i],[l,[p,"Envizen"],[d,h]],[/\b(trio[-\w\. ]+) b/i],[l,[p,"MachSpeed"],[d,h]],[/\btu_(1491) b/i],[l,[p,"Rotor"],[d,h]],[/(shield[\w ]+) b/i],[l,[p,"Nvidia"],[d,h]],[/(sprint) (\w+)/i],[p,l,[d,w]],[/(kin\.[onetw]{3})/i],[[l,/\./g," "],[p,T],[d,w]],[/droid.+; (cc6666?|et5[16]|mc[239][23]x?|vc8[03]x?)\)/i],[l,[p,M],[d,h]],[/droid.+; (ec30|ps20|tc[2-8]\d[kx])\)/i],[l,[p,M],[d,w]],[/smart-tv.+(samsung)/i],[p,[d,g]],[/hbbtv.+maple;(\d+)/i],[[l,/^/,"SmartTV"],[p,L],[d,g]],[/(nux; netcast.+smarttv|lg (netcast\.tv-201\d|android tv))/i],[[p,N],[d,g]],[/(apple) ?tv/i],[p,[l,x+" TV"],[d,g]],[/crkey/i],[[l,S+"cast"],[p,C],[d,g]],[/droid.+aft(\w+)( bui|\))/i],[l,[p,_],[d,g]],[/\(dtv[\);].+(aquos)/i,/(aquos-tv[\w ]+)\)/i],[l,[p,j],[d,g]],[/(bravia[\w ]+)( bui|\))/i],[l,[p,R],[d,g]],[/(mitv-\w{5}) bui/i],[l,[p,q],[d,g]],[/Hbbtv.*(technisat) (.*);/i],[p,l,[d,g]],[/\b(roku)[\dx]*[\)\/]((?:dvp-)?[\d\.]*)/i,/hbbtv\/\d+\.\d+\.\d+ +\([\w\+ ]*; *([\w\d][^;]*);([^;]*)/i],[[p,H],[l,H],[d,g]],[/\b(android tv|smart[- ]?tv|opera tv|tv; rv:)\b/i],[[d,g]],[/(ouya)/i,/(nintendo) ([wids3utch]+)/i],[p,l,[d,b]],[/droid.+; (shield) bui/i],[l,[p,"Nvidia"],[d,b]],[/(playstation [345portablevi]+)/i],[l,[p,R],[d,b]],[/\b(xbox(?: one)?(?!; xbox))[\); ]/i],[l,[p,T],[d,b]],[/\b(sm-[lr]\d\d[05][fnuw]?s?)\b/i],[l,[p,L],[d,v]],[/((pebble))app/i],[p,l,[d,v]],[/(watch)(?: ?os[,\/]|\d,\d\/)[\d\.]+/i],[l,[p,x],[d,v]],[/droid.+; (glass) \d/i],[l,[p,C],[d,v]],[/droid.+; (wt63?0{2,3})\)/i],[l,[p,M],[d,v]],[/droid.+; (glass) \d/i],[l,[p,C],[d,v]],[/(pico) (4|neo3(?: link|pro)?)/i],[p,l,[d,v]],[/; (quest( \d| pro)?)/i],[l,[p,z],[d,v]],[/(tesla)(?: qtcarbrowser|\/[-\w\.]+)/i],[p,[d,y]],[/(aeobc)\b/i],[l,[p,_],[d,y]],[/droid .+?; ([^;]+?)(?: bui|; wv\)|\) applew).+? mobile safari/i],[l,[d,w]],[/droid .+?; ([^;]+?)(?: bui|\) applew).+?(?! mobile) safari/i],[l,[d,h]],[/\b((tablet|tab)[;\/]|focus\/\d(?!.+mobile))/i],[[d,h]],[/(phone|mobile(?:[;\/]| [ \w\/\.]*safari)|pda(?=.+windows ce))/i],[[d,w]],[/(android[-\w\. ]{0,9});.+buil/i],[l,[p,"Generic"]]],engine:[[/windows.+ edge\/([\w\.]+)/i],[m,[u,"EdgeHTML"]],[/(arkweb)\/([\w\.]+)/i],[u,m],[/webkit\/537\.36.+chrome\/(?!27)([\w\.]+)/i],[m,[u,"Blink"]],[/(presto)\/([\w\.]+)/i,/(webkit|trident|netfront|netsurf|amaya|lynx|w3m|goanna|servo)\/([\w\.]+)/i,/ekioh(flow)\/([\w\.]+)/i,/(khtml|tasman|links)[\/ ]\(?([\w\.]+)/i,/(icab)[\/ ]([23]\.[\d\.]+)/i,/\b(libweb)/i],[u,m],[/rv\:([\w\.]{1,9})\b.+(gecko)/i],[m,u]],os:[[/microsoft (windows) (vista|xp)/i],[u,m],[/(windows (?:phone(?: os)?|mobile))[\/ ]?([\d\.\w ]*)/i],[u,[m,W,Z]],[/windows nt 6\.2; (arm)/i,/windows[\/ ]?([ntce\d\. ]+\w)(?!.+xbox)/i,/(?:win(?=3|9|n)|win 9x )([nt\d\.]+)/i],[[m,W,Z],[u,"Windows"]],[/ip[honead]{2,4}\b(?:.*os ([\w]+) like mac|; opera)/i,/(?:ios;fbsv\/|iphone.+ios[\/ ])([\d\.]+)/i,/cfnetwork\/.+darwin/i],[[m,/_/g,"."],[u,"iOS"]],[/(mac os x) ?([\w\. ]*)/i,/(macintosh|mac_powerpc\b)(?!.+haiku)/i],[[u,D],[m,/_/g,"."]],[/droid ([\w\.]+)\b.+(android[- ]x86|harmonyos)/i],[m,u],[/(android|webos|qnx|bada|rim tablet os|maemo|meego|sailfish|openharmony)[-\/ ]?([\w\.]*)/i,/(blackberry)\w*\/([\w\.]*)/i,/(tizen|kaios)[\/ ]([\w\.]+)/i,/\((series40);/i],[u,m],[/\(bb(10);/i],[m,[u,O]],[/(?:symbian ?os|symbos|s60(?=;)|series60)[-\/ ]?([\w\.]*)/i],[m,[u,"Symbian"]],[/mozilla\/[\d\.]+ \((?:mobile|tablet|tv|mobile; [\w ]+); rv:.+ gecko\/([\w\.]+)/i],[m,[u,U+" OS"]],[/web0s;.+rt(tv)/i,/\b(?:hp)?wos(?:browser)?\/([\w\.]+)/i],[m,[u,"webOS"]],[/watch(?: ?os[,\/]|\d,\d\/)([\d\.]+)/i],[m,[u,"watchOS"]],[/crkey\/([\d\.]+)/i],[m,[u,S+"cast"]],[/(cros) [\w]+(?:\)| ([\w\.]+)\b)/i],[[u,B],m],[/panasonic;(viera)/i,/(netrange)mmh/i,/(nettv)\/(\d+\.[\w\.]+)/i,/(nintendo|playstation) ([wids345portablevuch]+)/i,/(xbox); +xbox ([^\);]+)/i,/\b(joli|palm)\b ?(?:os)?\/?([\w\.]*)/i,/(mint)[\/\(\) ]?(\w*)/i,/(mageia|vectorlinux)[; ]/i,/([kxln]?ubuntu|debian|suse|opensuse|gentoo|arch(?= linux)|slackware|fedora|mandriva|centos|pclinuxos|red ?hat|zenwalk|linpus|raspbian|plan 9|minix|risc os|contiki|deepin|manjaro|elementary os|sabayon|linspire)(?: gnu\/linux)?(?: enterprise)?(?:[- ]linux)?(?:-gnu)?[-\/ ]?(?!chrom|package)([-\w\.]*)/i,/(hurd|linux) ?([\w\.]*)/i,/(gnu) ?([\w\.]*)/i,/\b([-frentopcghs]{0,5}bsd|dragonfly)[\/ ]?(?!amd|[ix346]{1,2}86)([\w\.]*)/i,/(haiku) (\w+)/i],[u,m],[/(sunos) ?([\w\.\d]*)/i],[[u,"Solaris"],m],[/((?:open)?solaris)[-\/ ]?([\w\.]*)/i,/(aix) ((\d)(?=\.|\)| )[\w\.])*/i,/\b(beos|os\/2|amigaos|morphos|openvms|fuchsia|hp-ux|serenityos)/i,/(unix) ?([\w\.]*)/i],[u,m]]},Y=function(e,i){if(typeof e===a&&(i=e,e=n),!(this instanceof Y))return new Y(e,i).getResult();var b=typeof o!==r&&o.navigator?o.navigator:n,g=e||(b&&b.userAgent?b.userAgent:""),v=b&&b.userAgentData?b.userAgentData:n,y=i?function(e,i){var o={};for(var n in e)i[n]&&i[n].length%2==0?o[n]=i[n].concat(e[n]):o[n]=e[n];return o}($,i):$,_=b&&b.userAgent==g;return this.getBrowser=function(){var e,i={};return i[u]=n,i[m]=n,V.call(i,g,y.browser),i[c]=typeof(e=i[m])===s?e.replace(/[^\d\.]/g,"").split(".")[0]:n,_&&b&&b.brave&&typeof b.brave.isBrave==t&&(i[u]="Brave"),i},this.getCPU=function(){var e={};return e[f]=n,V.call(e,g,y.cpu),e},this.getDevice=function(){var e={};return e[p]=n,e[l]=n,e[d]=n,V.call(e,g,y.device),_&&!e[d]&&v&&v.mobile&&(e[d]=w),_&&"Macintosh"==e[l]&&b&&typeof b.standalone!==r&&b.maxTouchPoints&&b.maxTouchPoints>2&&(e[l]="iPad",e[d]=h),e},this.getEngine=function(){var e={};return e[u]=n,e[m]=n,V.call(e,g,y.engine),e},this.getOS=function(){var e={};return e[u]=n,e[m]=n,V.call(e,g,y.os),_&&!e[u]&&v&&v.platform&&"Unknown"!=v.platform&&(e[u]=v.platform.replace(/chrome os/i,B).replace(/macos/i,D)),e},this.getResult=function(){return{ua:this.getUA(),browser:this.getBrowser(),engine:this.getEngine(),os:this.getOS(),device:this.getDevice(),cpu:this.getCPU()}},this.getUA=function(){return g},this.setUA=function(e){return g=typeof e===s&&e.length>500?H(e,500):e,this},this.setUA(g),this};Y.VERSION="1.0.40",Y.BROWSER=X([u,m,c]),Y.CPU=X([f]),Y.DEVICE=X([l,p,d,b,w,g,h,v,y]),Y.ENGINE=Y.OS=X([u,m]),e.exports&&(i=e.exports=Y),i.UAParser=Y;var K=typeof o!==r&&(o.jQuery||o.Zepto);if(K&&!K.ua){var Q=new Y;K.ua=Q.getResult(),K.ua.get=function(){return Q.getUA()},K.ua.set=function(e){Q.setUA(e);var i=Q.getResult();for(var o in i)K.ua[o]=i[o]}}}("object"==typeof window?window:d)}(p,p.exports);var m=new p.exports.UAParser,f=m.getBrowser(),b=f.name,w=f.version,h=m.getEngine(),g=h.name,v=h.version,y=function(){var e=(0,m.getOS)();return{os:e.name,osversion:e.version}}(),_=y.os,x=y.osversion,k=function(){var e=(0,m.getDevice)();return{device:e.model,devicebrand:e.vendor}}(),O=k.device,P=k.devicebrand;_=_||"",x=x||"",O=O||"",P=P||"";var S={exports:{}},U={exports:{}},C=1e3,A=60*C,N=60*A,T=24*N,E=365.25*T,I=function(e,i){i=i||{};var o=typeof e;if("string"===o&&e.length>0)return function(e){if((e=String(e)).length>100)return;var i=/^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(e);if(!i)return;var o=parseFloat(i[1]);switch((i[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return o*E;case"days":case"day":case"d":return o*T;case"hours":case"hour":case"hrs":case"hr":case"h":return o*N;case"minutes":case"minute":case"mins":case"min":case"m":return o*A;case"seconds":case"second":case"secs":case"sec":case"s":return o*C;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return o;default:return}}(e);if("number"===o&&!1===isNaN(e))return i.long?function(e){return L(e,T,"day")||L(e,N,"hour")||L(e,A,"minute")||L(e,C,"second")||e+" ms"}(e):function(e){if(e>=T)return Math.round(e/T)+"d";if(e>=N)return Math.round(e/N)+"h";if(e>=A)return Math.round(e/A)+"m";if(e>=C)return Math.round(e/C)+"s";return e+"ms"}(e);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))};function L(e,i,o){if(!(e<i))return e<1.5*i?Math.floor(e/i)+" "+o:Math.ceil(e/i)+" "+o+"s"}!function(e,i){var o;function n(e){function n(){if(n.enabled){var e=n,t=+new Date,r=t-(o||t);e.diff=r,e.prev=o,e.curr=t,o=t;for(var a=new Array(arguments.length),s=0;s<a.length;s++)a[s]=arguments[s];a[0]=i.coerce(a[0]),"string"!=typeof a[0]&&a.unshift("%O");var c=0;a[0]=a[0].replace(/%([a-zA-Z%])/g,(function(o,n){if("%%"===o)return o;c++;var t=i.formatters[n];if("function"==typeof t){var r=a[c];o=t.call(e,r),a.splice(c,1),c--}return o})),i.formatArgs.call(e,a),(n.log||i.log||console.log.bind(console)).apply(e,a)}}return n.namespace=e,n.enabled=i.enabled(e),n.useColors=i.useColors(),n.color=function(e){var o,n=0;for(o in e)n=(n<<5)-n+e.charCodeAt(o),n|=0;return i.colors[Math.abs(n)%i.colors.length]}(e),"function"==typeof i.init&&i.init(n),n}(i=U.exports=n.debug=n.default=n).coerce=function(e){return e instanceof Error?e.stack||e.message:e},i.disable=function(){i.enable("")},i.enable=function(e){i.save(e),i.names=[],i.skips=[];for(var o=("string"==typeof e?e:"").split(/[\s,]+/),n=o.length,t=0;t<n;t++)o[t]&&("-"===(e=o[t].replace(/\*/g,".*?"))[0]?i.skips.push(new RegExp("^"+e.substr(1)+"$")):i.names.push(new RegExp("^"+e+"$")))},i.enabled=function(e){var o,n;for(o=0,n=i.skips.length;o<n;o++)if(i.skips[o].test(e))return!1;for(o=0,n=i.names.length;o<n;o++)if(i.names[o].test(e))return!0;return!1},i.humanize=I,i.names=[],i.skips=[],i.formatters={}}(0,U.exports),function(e,i){function o(){var e;try{e=i.storage.debug}catch(e){}return!e&&"undefined"!=typeof process&&"env"in process&&(e=process.env.DEBUG),e}(i=e.exports=U.exports).log=function(){return"object"==typeof console&&console.log&&Function.prototype.apply.call(console.log,console,arguments)},i.formatArgs=function(e){var o=this.useColors;if(e[0]=(o?"%c":"")+this.namespace+(o?" %c":" ")+e[0]+(o?"%c ":" ")+"+"+i.humanize(this.diff),!o)return;var n="color: "+this.color;e.splice(1,0,n,"color: inherit");var t=0,r=0;e[0].replace(/%[a-zA-Z%]/g,(function(e){"%%"!==e&&(t++,"%c"===e&&(r=t))})),e.splice(r,0,n)},i.save=function(e){try{null==e?i.storage.removeItem("debug"):i.storage.debug=e}catch(e){}},i.load=o,i.useColors=function(){if("undefined"!=typeof window&&window.process&&"renderer"===window.process.type)return!0;return"undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)},i.storage="undefined"!=typeof chrome&&void 0!==chrome.storage?chrome.storage.local:function(){try{return window.localStorage}catch(e){}}(),i.colors=["lightseagreen","forestgreen","goldenrod","dodgerblue","darkorchid","crimson"],i.formatters.j=function(e){try{return JSON.stringify(e)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}},i.enable(o())}(S,S.exports);var j=S.exports("jsonp"),R=function(e,i,o){"function"==typeof i&&(o=i,i={});i||(i={});var n,t,r=i.prefix||"__jp",a=i.name||r+q++,s=i.param||"callback",c=null!=i.timeout?i.timeout:6e4,l=encodeURIComponent,u=document.getElementsByTagName("script")[0]||document.head;c&&(t=setTimeout((function(){d(),o&&o(new Error("Timeout"))}),c));function d(){n.parentNode&&n.parentNode.removeChild(n),window[a]=M,t&&clearTimeout(t)}return window[a]=function(e){j("jsonp got",e),d(),o&&o(null,e)},e=(e+=(~e.indexOf("?")?"&":"?")+s+"="+l(a)).replace("?&","?"),j('jsonp req "%s"',e),(n=document.createElement("script")).src=e,u.parentNode.insertBefore(n,u),function(){window[a]&&d()}},q=0;function M(){}function z(e,i){return void 0===i&&(i={}),new Promise((function(o,n){var t;R("".concat(e,"?").concat((t=i,Object.keys(t).map((function(e){return encodeURIComponent(e)+"="+encodeURIComponent(t[e])})).join("&"))),{param:"jsonp",name:"__jsonp_cb_".concat(Date.now(),"__"),timeout:0},(function(e,i){e?n(e):o(i)}))}))}var B="6.0.0";
7
7
  /*! js-cookie v3.0.5 | MIT */
8
- function D(e){for(var i=1;i<arguments.length;i++){var o=arguments[i];for(var n in o)e[n]=o[n]}return e}var G,X=function e(i,o){function n(e,n,t){if("undefined"!=typeof document){"number"==typeof(t=D({},o,t)).expires&&(t.expires=new Date(Date.now()+864e5*t.expires)),t.expires&&(t.expires=t.expires.toUTCString()),e=encodeURIComponent(e).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape);var r="";for(var a in t)t[a]&&(r+="; "+a,!0!==t[a]&&(r+="="+t[a].split(";")[0]));return document.cookie=e+"="+i.write(n,e)+r}}return Object.create({set:n,get:function(e){if("undefined"!=typeof document&&(!arguments.length||e)){for(var o=document.cookie?document.cookie.split("; "):[],n={},t=0;t<o.length;t++){var r=o[t].split("="),a=r.slice(1).join("=");try{var s=decodeURIComponent(r[0]);if(n[s]=i.read(a,s),e===s)break}catch(e){}}return e?n[e]:n}},remove:function(e,i){n(e,"",D({},i,{expires:-1}))},withAttributes:function(i){return e(this.converter,D({},this.attributes,i))},withConverter:function(i){return e(D({},this.converter,i),this.attributes)}},{attributes:{value:Object.freeze(o)},converter:{value:Object.freeze(i)}})}({read:function(e){return'"'===e[0]&&(e=e.slice(1,-1)),e.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent)},write:function(e){return encodeURIComponent(e).replace(/%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g,decodeURIComponent)}},{path:"/"});exports.EGender=void 0,(G=exports.EGender||(exports.EGender={}))[G.Unknown=0]="Unknown",G[G.Male=1]="Male",G[G.Female=2]="Female";var J="XYZ_LOG_HW_",F="".concat(J,"COMMON_PARAMS"),H="".concat(J,"ONLINE_BACH_DATA"),V=function(){function d(e){var i=e.domain,o=e.commonParams,n=e.isPro,t=void 0===n||n,r=e.sendOpenLog,a=void 0===r||r,s=e.consoleLog,c=void 0===s||s,l=e.ignoreUrlParams,u=void 0===l?[]:l;this.version=B,this.buildDate="4/17/2026, 4:35:54 PM",this._startTime=Date.now(),this._commonParams={},this._isPro=!0,this._sendOpenLog=!0,this._consoleLog=!0,this._ignoreUrlParams=[],this._isPro=t,this._ignoreUrlParams=u,this._sendOpenLog=a,this._consoleLog=c;var d=this._getApis(i),p=d.openUrl,m=d.actUrl,f=d.adUrl,b=d.online;this._openUrl=p,this._actUrl=m,this._adUrl=f,this._onlineUrl=b,this._init(o)}return Object.defineProperty(d.prototype,"commonParams",{get:function(){return this._commonParams},enumerable:!1,configurable:!0}),d.prototype._init=function(i){var o=this;this._updateCommonParams(e(e({},this._filterParams(i)),{obatchid:this._getBatchId()})),this._coldStartUp(),this._visibilityChange((function(){o._updateCommonParams({}),o._open(1),o._startTime=Date.now();var e=o._getOnlineBatchData();e&&o._online(e)}),(function(){o._open(5),o._sendOnline()}))},d.prototype._visibilityChange=function(e,i){void 0===e&&(e=function(){}),void 0===i&&(i=function(){});document.addEventListener("visibilitychange",(function(){"visible"===(null===document||void 0===document?void 0:document.visibilityState)?e():i()}),!1)},d.prototype._getScreen=function(){var e=window.screen,i=e.width,o=e.height;return"".concat(i,"*").concat(o)},d.prototype._getNetWorkType=function(){var e=window.navigator,i=(null==e?void 0:e.connection)||(null==e?void 0:e.mozConnection)||(null==e?void 0:e.webkitConnection);return(null==i?void 0:i.type)||(null==i?void 0:i.effectiveType)||"other"},d.prototype._getBatchId=function(){var e,i=(e="BATCH_ID",void 0!==typeof sessionStorage?sessionStorage.getItem(o+e):null);return i||function(e,i){void 0!==typeof sessionStorage&&sessionStorage.setItem(o+e,i)}("BATCH_ID",i=r()),i},d.prototype._coldStartUp=function(){var e=0;""==window.name?(e=0,window.name="isReload"):"isReload"==window.name&&(e=1),this._open(e)},d.prototype._getApis=function(i){var o=this._isPro?{open:"https://wappubog.snake.cc",act:"https://wappubog.snake.cc",ad:"https://wappubog.snake.cc",online:"https://wappubog.snake.cc"}:{open:"https://test-wappubog.snake.cc",act:"https://test-wappubog.snake.cc",ad:"https://test-wappubog.snake.cc",online:"https://test-wappubog.snake.cc"},n=e(e({},o),i);return{openUrl:"".concat(n.open,"/out-comm-logs/client/h5/open"),actUrl:"".concat(n.act,"/out-comm-logs/client/h5/activity"),adUrl:"".concat(n.ad,"/out-comm-logs/server/h5/advlog"),online:"".concat(n.online,"/out-comm-logs/server/h5/onlineTime")}},d.prototype._cacheCommonParams=function(o){var r=n(F),a=this._getInitParams(),s=a.userinfo,l=i(a,["userinfo"]),u=JSON.parse(r||"{}"),d=u.userinfo,p=i(u,["userinfo"]),m=o.userinfo,f=i(o,["userinfo"]),b=e(e(e({},JSON.parse(s||"{}")),JSON.parse(d||"{}")),JSON.parse(m||"{}")),w=c(c(l,p),f);this._commonParams=e(e({},w),{userinfo:JSON.stringify(b)}),this._consoleLog&&console.log("[XLOG] _cacheCommonParams",this._commonParams),t(F,JSON.stringify(this._commonParams))},d.prototype._getInitParams=function(){return{osversion:x,device:O,devicebrand:P,os:_,platform:u(),uid:a(),appcqid:"organic",pixel:this._getScreen(),userinfo:this._getUserInfo(),ua:encodeURI(navigator.userAgent),timezone:(e=(new Date).getTimezoneOffset(),i=Math.abs(Math.floor(e/60)),"".concat(e>0?"-":"+").concat(i)),url:encodeURI(location.href)};var e,i},d.prototype._getUserInfo=function(e){var i={};if(e)try{i=JSON.parse(e)}catch(e){console.error('[XLOG] The parameter "userinfo" is not in JSON string format!')}var o={};if(this._commonParams.userinfo)try{o=JSON.parse(this._commonParams.userinfo)}catch(e){console.error("[XLOG] parse error",e)}return JSON.stringify(l({lang:navigator.language,browser:b,browserversion:w,engine:g,engineversion:v,platform:u(),querystring:s(this._ignoreUrlParams),fbc:X.get("_fbc"),fbp:X.get("_fbp"),ttp:X.get("_ttp")},o,i))},d.prototype._filterParams=function(e){var i={};if(e){var o=["openid","accid","apptypeid","appcqid","appver","srcqid","userinfo","srcinfo","region","province","uid","platform"];for(var n in e){var t=n,r=e[t];o.includes(t)&&r&&(i[t]=r)}}return i},d.prototype.setParams=function(e){if(e){this._consoleLog&&console.log("[XLOG] setParams",e);var i=this._commonParams.region,o=this._commonParams.province;e=this._filterParams(e),this._updateCommonParams(e),(e.region&&e.region!==i||e.province&&e.province!==o)&&this._open(6)}},d.prototype.replaceParams=function(e){if(e){this._consoleLog&&console.log("[XLOG] replaceParams",e);var i=this._commonParams.region,o=this._commonParams.province;this._updateCommonParams(e),(e.region&&e.region!==i||e.province&&e.province!==o)&&this._open(6)}},d.prototype._updateCommonParams=function(i){var o;this._consoleLog&&console.log("[XLOG] _updateCommonParams",i),i.userinfo?i.userinfo=this._getUserInfo(i.userinfo):i.userinfo=this._getUserInfo();try{o=JSON.parse(i.userinfo)}catch(e){console.error('[XLOG] userinfo "'.concat(i.userinfo,'" parse error'),e)}i.platform&&(i.userinfo=this._getUserInfo(JSON.stringify(e(e({},o),{platform:i.platform})))),this._cacheCommonParams(e(e({},i),{url:encodeURI(location.href),network:this._getNetWorkType()}))},d.prototype._request=function(e,i){var o=this;return function(e,i){return z(e,i)}(e,i).then((function(n){return o._consoleLog&&console.log("[XLOG] SUCCESS: ".concat(e),i,n),n})).catch((function(o){return console.error("[XLOG] ERROR: ".concat(e),i,o),Promise.reject(o)}))},d.prototype._open=function(i){if(this._sendOpenLog){var o=e(e({},this._commonParams),{userinfo:encodeURI(this._commonParams.userinfo||""),url:encodeURI(location.href),xmlog:B,url_from:document.referrer,openway:i});this._consoleLog&&console.log("[XLOG] PARAMS(OPEN)",o),this._request(this._openUrl,o)}},d.prototype.act=function(i){var o=e(e({},this._commonParams),{userinfo:encodeURI(this._commonParams.userinfo||""),url:encodeURI(location.href),actentryid:i.actentryid||"",subactid:i.subactid||"",type:i.type||""});this._consoleLog&&console.log("[XLOG] PARAMS(ACT)",o),this._request(this._actUrl,o)},d.prototype.ad=function(i){var o=e(e({},this._commonParams),{userinfo:encodeURI(this._commonParams.userinfo||""),url:encodeURI(location.href),type:i.type||"",code:i.code||"",codeinfo:i.codeinfo||"",pagetype:i.pagetype||"",gametype:i.gametype||"",adslot:i.adslot||"",adunitid:i.adunitid||"",adbatchid:i.adbatchid||"",ecpm:i.ecpm||"",adfrom:i.adfrom||""});this._consoleLog&&console.log("[XLOG] PARAMS(AD)",o),this._request(this._adUrl,o)},d.prototype._sendOnline=function(){var i=Date.now(),o=e(e({},this._commonParams),{onlinetime:"".concat(i-this._startTime),endtime:i.toString(),starttime:this._startTime.toString()});this._online([o])},d.prototype._setOnlineBatchData=function(e){t(H,JSON.stringify(e))},d.prototype._getOnlineBatchData=function(){var e=n(H);return e?JSON.parse(e):""},d.prototype._clearOnlineBatchData=function(){t(H,"")},d.prototype._online=function(e){var i=this;this._consoleLog&&console.log("[XLOG] PARAMS(ONLINE)",e),this._clearOnlineBatchData(),this._request(this._onlineUrl,{batch:JSON.stringify(e)}).catch((function(o){console.error(o),i._setOnlineBatchData(e)}))},d}();exports.XLog=V;
8
+ function D(e){for(var i=1;i<arguments.length;i++){var o=arguments[i];for(var n in o)e[n]=o[n]}return e}var G,X=function e(i,o){function n(e,n,t){if("undefined"!=typeof document){"number"==typeof(t=D({},o,t)).expires&&(t.expires=new Date(Date.now()+864e5*t.expires)),t.expires&&(t.expires=t.expires.toUTCString()),e=encodeURIComponent(e).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape);var r="";for(var a in t)t[a]&&(r+="; "+a,!0!==t[a]&&(r+="="+t[a].split(";")[0]));return document.cookie=e+"="+i.write(n,e)+r}}return Object.create({set:n,get:function(e){if("undefined"!=typeof document&&(!arguments.length||e)){for(var o=document.cookie?document.cookie.split("; "):[],n={},t=0;t<o.length;t++){var r=o[t].split("="),a=r.slice(1).join("=");try{var s=decodeURIComponent(r[0]);if(n[s]=i.read(a,s),e===s)break}catch(e){}}return e?n[e]:n}},remove:function(e,i){n(e,"",D({},i,{expires:-1}))},withAttributes:function(i){return e(this.converter,D({},this.attributes,i))},withConverter:function(i){return e(D({},this.converter,i),this.attributes)}},{attributes:{value:Object.freeze(o)},converter:{value:Object.freeze(i)}})}({read:function(e){return'"'===e[0]&&(e=e.slice(1,-1)),e.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent)},write:function(e){return encodeURIComponent(e).replace(/%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g,decodeURIComponent)}},{path:"/"});exports.EGender=void 0,(G=exports.EGender||(exports.EGender={}))[G.Unknown=0]="Unknown",G[G.Male=1]="Male",G[G.Female=2]="Female";var J="XYZ_LOG_HW_",F="".concat(J,"COMMON_PARAMS"),H="".concat(J,"ONLINE_BACH_DATA"),V=function(){function d(e){var i=e.domain,o=e.commonParams,n=e.isPro,t=void 0===n||n,r=e.sendOpenLog,a=void 0===r||r,s=e.consoleLog,c=void 0===s||s,l=e.ignoreUrlParams,u=void 0===l?[]:l;this.version=B,this.buildDate="5/8/2026, 5:19:34 PM",this._startTime=Date.now(),this._commonParams={},this._isPro=!0,this._sendOpenLog=!0,this._consoleLog=!0,this._ignoreUrlParams=[],this._isPro=t,this._ignoreUrlParams=u,this._sendOpenLog=a,this._consoleLog=c;var d=this._getApis(i),p=d.openUrl,m=d.actUrl,f=d.adUrl,b=d.online;this._openUrl=p,this._actUrl=m,this._adUrl=f,this._onlineUrl=b,this._init(o)}return Object.defineProperty(d.prototype,"commonParams",{get:function(){return this._commonParams},enumerable:!1,configurable:!0}),d.prototype._init=function(i){var o=this;this._updateCommonParams(e(e({},this._filterParams(i)),{obatchid:this._getBatchId()})),this._coldStartUp(),this._visibilityChange((function(){o._updateCommonParams({}),o._open(1),o._startTime=Date.now();var e=o._getOnlineBatchData();e&&o._online(e)}),(function(){o._open(5),o._sendOnline()}))},d.prototype._visibilityChange=function(e,i){void 0===e&&(e=function(){}),void 0===i&&(i=function(){});document.addEventListener("visibilitychange",(function(){"visible"===(null===document||void 0===document?void 0:document.visibilityState)?e():i()}),!1)},d.prototype._getScreen=function(){var e=window.screen,i=e.width,o=e.height;return"".concat(i,"*").concat(o)},d.prototype._getNetWorkType=function(){var e=window.navigator,i=(null==e?void 0:e.connection)||(null==e?void 0:e.mozConnection)||(null==e?void 0:e.webkitConnection);return(null==i?void 0:i.type)||(null==i?void 0:i.effectiveType)||"other"},d.prototype._getBatchId=function(){var e,i=(e="BATCH_ID",void 0!==typeof sessionStorage?sessionStorage.getItem(o+e):null);return i||function(e,i){void 0!==typeof sessionStorage&&sessionStorage.setItem(o+e,i)}("BATCH_ID",i=r()),i},d.prototype._coldStartUp=function(){var e=0;""==window.name?(e=0,window.name="isReload"):"isReload"==window.name&&(e=1),this._open(e)},d.prototype._getApis=function(i){var o=this._isPro?{open:"https://wappubog.snake.cc",act:"https://wappubog.snake.cc",ad:"https://wappubog.snake.cc",online:"https://wappubog.snake.cc"}:{open:"https://test-wappubog.snake.cc",act:"https://test-wappubog.snake.cc",ad:"https://test-wappubog.snake.cc",online:"https://test-wappubog.snake.cc"},n=e(e({},o),i);return{openUrl:"".concat(n.open,"/out-comm-logs/client/h5/open"),actUrl:"".concat(n.act,"/out-comm-logs/client/h5/activity"),adUrl:"".concat(n.ad,"/out-comm-logs/server/h5/advlog"),online:"".concat(n.online,"/out-comm-logs/server/h5/onlineTime")}},d.prototype._cacheCommonParams=function(o){var r=n(F),a=this._getInitParams(),s=a.userinfo,l=i(a,["userinfo"]),u=JSON.parse(r||"{}"),d=u.userinfo,p=i(u,["userinfo"]),m=o.userinfo,f=i(o,["userinfo"]),b=e(e(e({},JSON.parse(s||"{}")),JSON.parse(d||"{}")),JSON.parse(m||"{}")),w=c(c(l,p),f);this._commonParams=e(e({},w),{userinfo:JSON.stringify(b)}),this._consoleLog&&console.log("[XLOG] _cacheCommonParams",this._commonParams),t(F,JSON.stringify(this._commonParams))},d.prototype._getInitParams=function(){return{osversion:x,device:O,devicebrand:P,os:_,platform:u(),uid:a(),appcqid:"organic",pixel:this._getScreen(),userinfo:this._getUserInfo(),ua:encodeURI(navigator.userAgent),timezone:(e=(new Date).getTimezoneOffset(),i=Math.abs(Math.floor(e/60)),"".concat(e>0?"-":"+").concat(i)),url:encodeURI(location.href)};var e,i},d.prototype._getUserInfo=function(e){var i={};if(e)try{i=JSON.parse(e)}catch(e){console.error('[XLOG] The parameter "userinfo" is not in JSON string format!')}var o={};if(this._commonParams.userinfo)try{o=JSON.parse(this._commonParams.userinfo)}catch(e){console.error("[XLOG] parse error",e)}return JSON.stringify(l({lang:navigator.language,browser:b,browserversion:w,engine:g,engineversion:v,platform:u(),querystring:s(this._ignoreUrlParams),fbc:X.get("_fbc"),fbp:X.get("_fbp"),ttp:X.get("_ttp")},o,i))},d.prototype._filterParams=function(e){var i={};if(e){var o=["openid","accid","apptypeid","appcqid","appver","srcqid","userinfo","srcinfo","region","province","uid","platform"];for(var n in e){var t=n,r=e[t];o.includes(t)&&r&&(i[t]=r)}}return i},d.prototype.setParams=function(e){if(e){this._consoleLog&&console.log("[XLOG] setParams",e);var i=this._commonParams.region,o=this._commonParams.province;e=this._filterParams(e),this._updateCommonParams(e),(e.region&&e.region!==i||e.province&&e.province!==o)&&this._open(6)}},d.prototype.replaceParams=function(e){if(e){this._consoleLog&&console.log("[XLOG] replaceParams",e);var i=this._commonParams.region,o=this._commonParams.province;this._updateCommonParams(e),(e.region&&e.region!==i||e.province&&e.province!==o)&&this._open(6)}},d.prototype._updateCommonParams=function(i){var o;this._consoleLog&&console.log("[XLOG] _updateCommonParams",i),i.userinfo?i.userinfo=this._getUserInfo(i.userinfo):i.userinfo=this._getUserInfo();try{o=JSON.parse(i.userinfo)}catch(e){console.error('[XLOG] userinfo "'.concat(i.userinfo,'" parse error'),e)}i.platform&&(i.userinfo=this._getUserInfo(JSON.stringify(e(e({},o),{platform:i.platform})))),this._cacheCommonParams(e(e({},i),{url:encodeURI(location.href),network:this._getNetWorkType()}))},d.prototype._request=function(e,i){var o=this;return function(e,i){return z(e,i)}(e,i).then((function(n){return o._consoleLog&&console.log("[XLOG] SUCCESS: ".concat(e),i,n),n})).catch((function(o){return console.error("[XLOG] ERROR: ".concat(e),i,o),Promise.reject(o)}))},d.prototype._open=function(i){if(this._sendOpenLog){var o=e(e({},this._commonParams),{userinfo:encodeURI(this._commonParams.userinfo||""),url:encodeURI(location.href),xmlog:B,url_from:document.referrer,openway:i});this._consoleLog&&console.log("[XLOG] PARAMS(OPEN)",o),this._request(this._openUrl,o)}},d.prototype.act=function(i){var o=e(e({},this._commonParams),{userinfo:encodeURI(this._commonParams.userinfo||""),url:encodeURI(location.href),actentryid:i.actentryid||"",subactid:i.subactid||"",type:i.type||""});this._consoleLog&&console.log("[XLOG] PARAMS(ACT)",o),this._request(this._actUrl,o)},d.prototype.ad=function(i){var o=e(e({},this._commonParams),{userinfo:encodeURI(this._commonParams.userinfo||""),url:encodeURI(location.href),type:i.type||"",code:i.code||"",codeinfo:i.codeinfo||"",pagetype:i.pagetype||"",gametype:i.gametype||"",adslot:i.adslot||"",adunitid:i.adunitid||"",adbatchid:i.adbatchid||"",ecpm:i.ecpm||"",adfrom:i.adfrom||""});this._consoleLog&&console.log("[XLOG] PARAMS(AD)",o),this._request(this._adUrl,o)},d.prototype._sendOnline=function(){var i=Date.now(),o=e(e({},this._commonParams),{onlinetime:"".concat(i-this._startTime),endtime:i.toString(),starttime:this._startTime.toString()});this._online([o])},d.prototype._setOnlineBatchData=function(e){t(H,JSON.stringify(e))},d.prototype._getOnlineBatchData=function(){var e=n(H);return e?JSON.parse(e):""},d.prototype._clearOnlineBatchData=function(){t(H,"")},d.prototype._online=function(e){var i=this;this._consoleLog&&console.log("[XLOG] PARAMS(ONLINE)",e),this._clearOnlineBatchData(),this._request(this._onlineUrl,{batch:JSON.stringify(e)}).catch((function(o){console.error(o),i._setOnlineBatchData(e)}))},d}();exports.XLog=V;