"use strict";var e="[X-STAT] -- ",t=function(){var t=null,n=!1;return function(){return null===t&&(t=new function(){this.setDebug=function(e){n=e},this.d=function(){if(n)try{"string"==typeof arguments[0]&&(arguments[0]=e+arguments[0]),console.debug.apply(console,arguments)}catch(e){}},this.i=function(){try{if(n)try{"string"==typeof arguments[0]&&(arguments[0]=e+arguments[0]),console.info.apply(console,arguments)}catch(e){}}catch(e){}},this.e=function(){if(n)try{"string"==typeof arguments[0]&&(arguments[0]=e+arguments[0]),console.error.apply(console,arguments)}catch(e){}},this.w=function(){if(n)try{"string"==typeof arguments[0]&&(arguments[0]=e+arguments[0]),console.warn.apply(console,arguments)}catch(e){}},this.v=function(){if(n)try{"string"==typeof arguments[0]&&(arguments[0]=e+arguments[0]),console.log.apply(console,arguments)}catch(e){}},this.t=function(){if(n)try{console.table.apply(console,arguments)}catch(e){}},this.tip=function(){try{"string"==typeof arguments[0]&&(arguments[0]=e+arguments[0]),console.log.apply(console,arguments)}catch(e){}},this.tip_w=function(e){try{console.log("%c [UMENG] -- "+e,"background:red; padding: 4px; padding-right: 8px; border-radius: 4px; color: #fff;")}catch(e){}},this.err=function(){try{"string"==typeof arguments[0]&&(arguments[0]=e+arguments[0]),console.error.apply(console,arguments)}catch(e){}},this.repeat=function(e){for(var t=e;t.length<86;)t+=e;return t}}),t}}(),n=function(){var e=null;return function(){return e||(e=new function(){var e={};this.useOpenid=function(){return!!e.useOpenid},this.useSwanid=function(){return!!e.useSwanid},this.autoGetOpenid=function(){return!!e.autoGetOpenid},this.appKey=function(){return e.appKey},this.url=function(){return e.url},this.uploadUserInfo=function(){return e.uploadUserInfo},this.enableVerify=function(){return e.enableVerify},this.set=function(t){e=t},this.get=function(){return e},this.setItem=function(t,n){e[t]=n},this.getItem=function(t){return e[t]}}),e}}();function i(){}i.prototype={on:function(e,t,n){var r=this.e||(this.e={});return(r[e]||(r[e]=[])).push({fn:t,ctx:n}),this},once:function(e,t,n){var r=this;function i(){r.off(e,i),t.apply(n,arguments)}return i._=t,this.on(e,i,n)},emit:function(e){for(var t=[].slice.call(arguments,1),n=((this.e||(this.e={}))[e]||[]).slice(),r=0,i=n.length;rs?o+"*"+s:s+"*"+o,"function"==typeof e&&e(r)},fail:function(){"function"==typeof e&&e()}})},e.prototype.getDeviceInfo=function(e){"function"==typeof e&&e("")},e.prototype.checkNetworkAvailable=function(e){wx.getNetworkType({success:function(t){"function"==typeof e&&e(t&&"none"!==t.networkType)},fail:function(){"function"==typeof e&&e(!1)}})},e.prototype.getNetworkInfo=function(e){wx.getNetworkType({success:function(t){"function"==typeof e&&e({networkAvailable:"none"!==t.networkType,networkType:t.networkType})},fail:function(){"function"==typeof e&&e()}})},e.prototype.getDeviceId=function(e){e("")},e.prototype.getAdvertisingId=function(e){"function"==typeof e&&e("")},e.prototype.onNetworkStatusChange=function(e){wx.onNetworkStatusChange(function(t){"function"==typeof e&&e(t.isConnected)})},e.prototype.request=function(e){var t=e.success,n=e.fail,r=!1,i=null;e.success=function(e){r||(i&&clearTimeout(i),"function"==typeof t&&t(e))},e.fail=function(){r||(i&&clearTimeout(i),"function"==typeof n&&n(!1))},wx.request(e),i=setTimeout(function(){i&&clearTimeout(i),r=!0,"function"==typeof n&&n(r)},e.timeout||5e3)},e.prototype.getSdkType=function(){return"wxmp"},e.prototype.getPlatform=function(){return"wx"},e.prototype.getUserInfo=function(e){e()},e.prototype.getAppInfoSync=function(){if(wx.getAccountInfoSync){var e=wx.getAccountInfoSync(),t=e&&e.miniProgram?e.miniProgram:{};return{appId:t.appId,appEnv:t.envVersion,appVersion:t.version}}return{}},e.prototype.onShareAppMessage=function(e){wx.onShareAppMessage(e)},e.prototype.shareAppMessage=function(e){wx.shareAppMessage(e)},e.prototype.getLaunchOptionsSync=function(){var e=null;if(e)return e;if(!wx.getLaunchOptionsSync)return{};try{e=wx.getLaunchOptionsSync()}catch(t){e=null}return e||{}},e}()),s=function(e,t){return(s=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)};function a(e,t){function n(){this.constructor=e}s(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}console.log(e);var c,u={SESSION_INTERVAL:3e4,LOG_URL:"https://stat.x-php.com/stat",GET_OPENID_URL:"https://stat.x-php.com/stat/wx/getuut",USERINFO_URL:"https://stat.x-php.com/stat/comm/uif",FETCHURL:"https://stat.x-php.com/stat/fetch",GETVALUEURL:"https://stat.x-php.com/stat/getVlue",DEVICE_INFO_KEY:"device_info",ADVERTISING_ID:"mobile_ad_id",ANDROID_ID:"android_id",CURRENT_SESSION:"current_session",SESSION_PAUSE_TIME:"session_pause_time",EVENT_SEND_DEFAULT_INTERVAL:15e3,EVENT_LAST_SEND_TIME:"last_send_time",MAX_EVENTID_LENGTH:128,MAX_PROPERTY_KEY_LENGTH:256,MAX_PROPERTY_KEYS_COUNT:100,REPORT_POLICY:"report_policy",REPORT_INTERVAL_TIME:"report_interval_time",REPORT_POLICY_START_SEND:"1",REPORT_POLICY_INTERVAL:"6",IMPRINT:"imprint",SEED_VERSION:"1.0.0",IMPL_VERSION:"2.8.0",ALIPAY_AVAILABLE_VERSION:"10.1.52",SHARE_PATH:"xphp_share_path",SHARES:"shares",REQUESTS:"requests",UUID:"xphp_uuid",UUID_SUFFIX:"ud",OPENID:"xphp_od",UNIONID:"xphp_unid",ALIPAYID:"xphp_alipayid",USERID:"xphp_userid",SWANID:"xphp_swanid",ANONYMOUSID:"xphp_anonymousid",LAUNCH_OPTIONS:"LAUNCH_OPTIONS",XPHP_SSRC:"_xphp_ssrc",USER_INFO:"user_info",IS_ALIYUN:!1},f={isNumber:function(e){return!Number.isNaN(parseInt(e,10))},compareVersion:function(e,t){for(var n=String(e).split("."),r=String(t).split("."),i=0;is)return 1;if(oe.length)&&e.substr(0,t.length)===t},endsWith:function(e,t){return!(!t||0===e.length||t.length>e.length)&&e.substring(e.length-t.length)===t},assign:function(e){if(null==e)throw new TypeError("Cannot convert undefined or null to object");for(var t=Object(e),n=1;n1&&f.startsWith(o.path,"/")&&(o.path=f.trimStart(o.path,"/"));var s=e.path||"",a=l().getId();if(a){var u=r.split(","),c=(u=u.filter(function(e){return e.length>0})).indexOf(a);c>=0&&(u=u.slice(0,c)),u.length<3&&u.push(a);var p=u.join(",");-1!==s.indexOf("?")?s+="&_xphp_ssrc="+p:s+="?_xphp_ssrc="+p;var h=Date.now();if(s+="&_xphp_sts="+h,i){var g=function(e){var t=[];for(var n in e)"_xphp_ssrc"!==n&&"_xphp_sts"!==n&&t.push(n+"="+e[n]);return t.join("&")}(d),v=g?g+"&_xphp_ssrc="+p+"&_xphp_sts="+h:"_xphp_ssrc="+p+"&_xphp_sts="+h;e.query=e.query?e.query+"&_xphp_ssrc="+p+"&_xphp_sts="+h:v}else e.path=s;o._xphp_ssrc=p,o._xphp_sts=h}return n.push(o),t().v("share: %o",e),e},setShareSource:function(e){r=e},clear:function(){n.length=0},get:function(){return n}}}),e}}(),v=function(e){if(e)try{return JSON.stringify(e)}catch(e){}return""},_=function(e){if(e)try{return JSON.parse(e)}catch(e){}return null},y=function(){var e=null,t="",r=null,i=!1;return function(){return e||(e=new function(){this.load=function(e){r?(o.removeStorage(t),e()):(t="xphp_cache_"+n().appKey(),o.getStorage(t,function(n){r=_(n)||{},i=!0,o.removeStorage(t),e()}))},this.save=function(){r&&o.setStorage(t,v(r))},this.set=function(e,t){r&&(r[e]=t)},this.get=function(e){return(r||{})[e]},this.remove=function(e){r&&r[e]&&delete r[e]},this.getAll=function(){return r},this.clear=function(){r=null},this.has=function(e){return!!this.get(e)},this.isLoaded=function(){return i}}),e}}(),m=function(){var e,n,r=[],i=[];function o(e,t){var r=(e=e||{})[n];return Array.isArray(r)&&r.length?e[n]=r.concat(t):e[n]=[].concat(t),e}return function(){return e||(e={addEvent:function(e){n?(r.unshift(e),r.length>1&&(!function(){if(r.length){var e=y().get("ekvs");(function(e){var t=0;for(var n in e)Array.isArray(e[n])&&(t+=e[n].length);return t})(e)+r.length<=1e4&&(e=o(e,r),y().set("ekvs",e))}}(),r.length=0)):(t().w("session id is null: ",n),i.unshift(e))},setSessionId:function(e){if(n=e,t().v("setSessionId: ",n),Array.isArray(i)&&i.length&&n){for(var r=0;ru.SESSION_INTERVAL?(i=!0,function(e){try{var n=(r||{}).options||{},i=f.assign({},function(e){var n={};for(var r in e)0===r.indexOf("_xphp_")&&(n[r]=e[r]);return t().v("query: ",e),t().v("_xphp_params: ",n),n}(e.query));i.path=e.path||n.path,"gaode"!==o.getPlatform()&&(i.scene=e.scene?o.getPlatform()+"_"+e.scene:n.scene);var s=e.referrerInfo;s&&(i.referrerAppId=s.appId),t().v("session options: ",i);var a=i[u.XPHP_SSRC];a&&g().setShareSource(a);var c=Date.now();r={id:f.getRandomStr(10)+c,start_time:c,options:i}}catch(e){t().e("生成新session失败: ",e)}}(e),t().v("开始新的session(%s): ",r.id,r)):t().v("延续上一次session(%s): %s ",r.id,s.toLocaleTimeString(),r),i},pause:function(){!function(){if(r){var e=new Date;r.end_time=e.getTime(),"number"!=typeof r.duration&&(r.duration=0),r.duration=r.end_time-n,y().set(u.CURRENT_SESSION,r),t().v("退出会话(%s): %s ",r.id,e.toLocaleTimeString(),r)}}()},getCurrentSessionId:function(){return(r||{}).id},getCurrentSession:function(){return r},cloneCurrentSession:function(){return f.clone(r)}}),e}}();function b(e){var t=null;switch(e){case A:t=function(){var e=null,t=k().cloneCurrentSession();return t&&(e={header:{st:"1"},analytics:{sessions:[t]}}),e}();break;case E:t=function(){var e=null,t={},n=k().cloneCurrentSession();if(n){var r=h().get(),i=g().get();Array.isArray(r)&&r.length&&(n.pages=f.clone(r)),Array.isArray(i)&&i.length&&(n.shares=f.clone(i)),h().clear(),g().clear(),t.sessions=[n]}var o=m().getEkvs();return o&&(t.ekvs=f.clone(o),m().clear()),(t.sessions||t.ekvs)&&(e={analytics:t}),e}();break;case N:t=function(){var e=null,t=m().getEkvs();return t&&(e={analytics:{ekvs:f.clone(t)}},m().clear()),e}()}return t}var D={sessions:"sn",ekvs:"e",active_user:"active_user"},U={sdk_type:"sdt",access:"ac",access_subtype:"acs",device_model:"dm",language:"lang",device_type:"dt",device_manufacturer:"dmf",device_name:"dn",platform_version:"pv",id_type:"it",font_size_setting:"fss",os_version:"ov",device_manuid:"did",platform_sdk_version:"psv",device_brand:"db",appkey:"ak",_id:"id",id_tracking:"itr",imprint:"imp",sdk_version:"sv",resolution:"rl",testToken:"ttn",theme:"t5",benchmark_level:"bml",screen_width:"sw",screen_height:"sh",status_bar_height:"sbh",safe_area_top:"sat",safe_area_left:"sal",safe_area_right:"sar",safe_area_bottom:"sab",safe_area_height:"sah",safe_area_width:"saw",pixel_ratio:"pr",storage:"s7",host:"hs"},P={uuid:"ud",unionid:"und",openid:"od",anonymousid:"nd",alipay_id:"ad",device_id:"dd",userid:"puid"};function R(e,t){var n=L(e,t);return e&&e.id_tracking&&(n[t.id_tracking||"id_tracking"]=L(e.id_tracking,P)),n}function L(e,t){var n={};for(var r in e)t[r]?n[t[r]]=e[r]:n[r]=e[r];return n}function C(e,t){var n={};if(e)for(var r in e)e[r]&&(n[t[r]]=e[r]);return n}var M="";function x(){return M}var V="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",j=function(e){for(var t={},n=0,r=e.length;n>>6)+F(128|63&t):F(224|t>>>12&15)+F(128|t>>>6&63)+F(128|63&t);var t=65536+1024*(e.charCodeAt(0)-55296)+(e.charCodeAt(1)-56320);return F(240|t>>>18&7)+F(128|t>>>12&63)+F(128|t>>>6&63)+F(128|63&t)},q=/[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g,K=function(e){var t=[0,2,1][e.length%3],n=e.charCodeAt(0)<<16|(e.length>1?e.charCodeAt(1):0)<<8|(e.length>2?e.charCodeAt(2):0);return[V.charAt(n>>>18),V.charAt(n>>>12&63),t>=2?"=":V.charAt(n>>>6&63),t>=1?"=":V.charAt(63&n)].join("")},H=function(e){return function(e){return e.replace(q,G)}(e).replace(/[\s\S]{1,3}/g,K)},Y=new RegExp(["[À-ß][€-¿]","[à-ï][€-¿]{2}","[ð-÷][€-¿]{3}"].join("|"),"g"),J=function(e){switch(e.length){case 4:var t=((7&e.charCodeAt(0))<<18|(63&e.charCodeAt(1))<<12|(63&e.charCodeAt(2))<<6|63&e.charCodeAt(3))-65536;return F(55296+(t>>>10))+F(56320+(1023&t));case 3:return F((15&e.charCodeAt(0))<<12|(63&e.charCodeAt(1))<<6|63&e.charCodeAt(2));default:return F((31&e.charCodeAt(0))<<6|63&e.charCodeAt(1))}},B=function(e){var t=e.length,n=t%4,r=(t>0?j[e.charAt(0)]<<18:0)|(t>1?j[e.charAt(1)]<<12:0)|(t>2?j[e.charAt(2)]<<6:0)|(t>3?j[e.charAt(3)]:0),i=[F(r>>>16),F(r>>>8&255),F(255&r)];return i.length-=[0,0,2,1][n],i.join("")},X=function(e){return function(e){return e.replace(/[\s\S]{1,4}/g,B)}(e).replace(Y,J)},W=function(e,t){return t?H(String(e)).replace(/[+\/]/g,function(e){return"+"==e?"-":"_"}).replace(/=/g,""):H(String(e))},z=function(e){return X(String(e).replace(/[-_]/g,function(e){return"-"==e?"+":"/"}).replace(/[^A-Za-z0-9\+\/]/g,""))},Q=new function(){var e="",t=this;this.set=function(t){e=t},this.get=function(){return e},this.getImpObj=function(){return _(z(e))},this.getItem=function(e){var n=t.getImpObj();return n&&n[e]||""},this.load=function(){e=y().get(u.IMPRINT)},this.save=function(){e&&y().set(u.IMPRINT,e)}};function Z(e,n,r,i){w.instance().setIdType(l().getIdType()),w.instance().setIdTracking(l().getIdTracking());var s=l().getUserId();s&&e.analytics&&(e.analytics.active_user={uid:s});var a=f.clone(w.instance().get());e.header=f.assign(a,e.header,{ts:Date.now(),testToken:x(),traceId:f.getRandomStr(10)+Date.now()+f.getRandomStr(9)});var c=function(e){return{h:R(e.header,U),a:C(e.analytics,D)}}(e),p=v(c),h={url:u.LOG_URL,method:"POST",data:c,success:function(i){var o=i.code||i.status||i.statusCode;200===o||413===o?(t().i("数据发送成功: ",e,p),function(e){e&&(w.instance().setItem(u.IMPRINT,e),Q.set(e),Q.save(),t().v("imprint: ",Q.getImpObj()),Q.getItem("ttn_invalid")&&(M=""))}((i.data||{}).imprint),"function"==typeof n&&n(i)):(t().w("数据发送失败: ",p),"function"==typeof r&&r())},fail:function(e){t().w("超时: ",p),"function"==typeof r&&r()},complete:function(){"function"==typeof i&&i()}};o.request(f.assign(h,{header:{"Msg-Type":o.getSdkType()+"/json","disable-base64":"Y"}}))}function $(e){var t=e,n=[];this.enqueue=function(e){"number"==typeof t&&this.size()>=t&&this.dequeue(),n.push(e)},this.dequeue=function(){return n.shift()},this.front=function(){return n[0]},this.isEmpty=function(){return 0===n.length},this.clear=function(){n.length=0},this.size=function(){return n.length},this.items=function(){return n},this.print=function(){console.log(n.toString())}}var ee=function(){var e=null,n=!1,r=[],i=new $(50);function o(e){l().getId()?n?t().i("队列正在发送中"):(n=!0,function e(t){var n=i.front();n?Z(n,function(){i.dequeue(),e(t)},function(){var n=i.dequeue();n&&!n.noCache&&r.push(n),e(t)}):(r.forEach(function(e){i.enqueue(e)}),r.length=0,t())}(function(){n=!1,"function"==typeof e&&e()})):(t().i("获取id标识失败,暂缓发送"),"function"==typeof e&&e())}function s(){this.send=function(e,t,n){e?this.add(e,t,function(){o(n)}):o(n)},this.add=function(e,t,n){!function e(t,n,r){if(w.instance().isLoaded()){n=n||{};var o=b(t);if(o){var s=w.instance().getRealtimeFields();o.header=f.assign({},o.header,s),o.noCache=n.noCache,i.enqueue(o)}"function"==typeof r&&r()}else setTimeout(function(){e(t,n,r)},100)}(e,t,n)},this.load=function(){var e=y().get(u.REQUESTS);e&&e.length&&e.forEach(function(e){i.enqueue(e)}),y().remove(u.REQUESTS)},this.save=function(){y().set(u.REQUESTS,f.clone(i.items())),i.clear()}}return function(){return e||(e=new s),e}}(),te=function(){var e=null,r=null;return function(){return e||(e=new function(){function e(e){if(e&&"object"==typeof e){var r=y().get(u.USER_INFO);return r&&f.deepEqual(e,r)||function(e,r){var i=n().appKey(),s=o.getSdkType(),a=l().getId(),c=l().getIdType();if(i&&s&&a&&c){var f={ak:n().appKey(),sdt:o.getSdkType(),uin:e.nickName,uia:e.avatar||e.avatarUrl,uig:e.gender,uit:e.country,uip:e.province,uic:e.city,uil:e.language,id:l().getId(),it:l().getIdType(),age:e.age,cln:e.constellation},p=JSON.stringify(f);p=W(p),o.request({url:u.USERINFO_URL,method:"POST",header:{"content-type":"application/x-www-form-urlencoded"},data:"ui="+p,success:function(n){t().v("用户信息上传成功: ",e),r&&r(n&&n.data&&200===n.data.code)},fail:function(){t().e("用户信息上传失败: ",e),r&&r(!1)}})}}(e,function(t){t&&y().set(u.USER_INFO,e)}),!0}return!1}this.setUserInfo=function(e){r=e},this.update=function(){e(r)||o.getUserInfo(function(t){e(t)})}}),e}}();function ne(e,t){this.id=e,this.ts=Date.now();var n=typeof t;if("string"===n&&t)this[e]=t;else if("object"===n)for(var r in t)({}).hasOwnProperty.call(t,r)&&(this[r]=t[r])}function ie(){var e=!1,r=!1,i=0;this.init=function(r){t().v("sdk version: "+u.IMPL_VERSION),e?t().v("Lib重复实例化"):y().load(function(){t().v("cache初始化成功: ",y().getAll()),l().setUseOpenid&&l().setUseOpenid(n().useOpenid()),l().init(function(){w.instance().init(),t().v("Header初始化成功")}),e=!0,"function"==typeof r&&r(),t().tip("SDK集成成功")})},this.resume=function(i){var o;e&&!r&&(t().v("showOptions: ",i),r=!0,n().enableVerify()&&i&&i.query&&(o=i.query._ttn,M=o||M),this._resume(i))},this._resume=function(e){ee().load();var r=k().resume(e),i=k().getCurrentSessionId();m().setSessionId(i),r&&ee().add(A,{},function(){l().setUseOpenid&&l().setUseOpenid(n().useOpenid()),n().useOpenid()&&n().autoGetOpenid()&&!l().getId()?(t().v("get id async"),function e(r,i){l().getId()||r<=0||l().getOpenIdAsync(n().appKey(),function(n){n?(t().v("获取id成功"),ee().send()):(t().v("获取openid失败,启动重试,剩余可用次数",r-1),setTimeout(function(){e(r-1,i)},i))})}(10,3e3)):(t().v("session auto send"),ee().send())})},this.pause=function(o){e&&(r=!1,i=0,k().pause(),n().uploadUserInfo()&&te().update(),ee().send(E,{},function(){ee().save(),y().save(),t().v("cache save success"),"function"==typeof o&&o()}))},this.setOpenid=function(e){t().v("setOpenId: %s",e),l().setOpenid(e),ee().send()},this.setUnionid=function(e){t().v("setUnionid: %s",e),l().setUnionid(e)},this.setUserid=function(e,n){t().v("setUserid: %s",e,n),l().setUserid(e,n)},this.removeUserid=function(){t().v("removeUserid"),l().removeUserid()},this.setUserInfo=function(e){t().v("setUserInfo: %s",e),te().setUserInfo(e)},this.setAnonymousid=function(e){t().v("setAnonymousId: %s",e),l().setAnonymousid(e),ee().send()},this.setAppVersion=function(e){e&&"string"!=typeof e?t().w("setAppVersion方法只接受字符串类型参数"):w.instance().setAppVersion(e)},this.setAlipayUserid=function(e){e&&"string"!=typeof e?t().w("setAlipayUserid方法只接受字符串类型参数"):(t().v("setAlipayUserid: %s",e),l().setAlipayUserid(e))},this.setDeviceId=function(e){if("string"==typeof e)return l().setDeviceId(e),e},this.setSuperProperty=function(e){if(e&&"string"!=typeof e)t().w("超级属性只支持字符串类型");else{var n=this;w.instance().getSuperProperty()!==e&&(w.instance().setSuperProperty(e),n.pause(function(){n.resume()}))}},this.trackEvent=function(n,r){if(e&&(t().v("event: ",n,r),function(e,n){if(!e||"string"!=typeof e)return t().e('please check trackEvent id. id should be "string" and not null'),!1;var r=["id","ts","du"],i={};if(r.forEach(function(e){i[e]=1}),i[e])return t().e("eventId不能与以下保留字冲突: "+r.join(",")),!1;if(e.length>u.MAX_EVENTID_LENGTH)return t().e("The maximum length of event id shall not exceed "+u.MAX_EVENTID_LENGTH),!1;if(n&&("object"!=typeof n||Array.isArray(n))&&"string"!=typeof n)return t().e("please check trackEvent properties. properties should be string or object(not include Array)"),!1;if("object"==typeof n){var o=0;for(var s in n)if({}.hasOwnProperty.call(n,s)){if(s.length>u.MAX_PROPERTY_KEY_LENGTH)return t().e("The maximum length of property key shall not exceed "+u.MAX_PROPERTY_KEY_LENGTH),!1;if(o>=u.MAX_PROPERTY_KEYS_COUNT)return t().e("The maximum count of properties shall not exceed "+u.MAX_PROPERTY_KEYS_COUNT),!1;if(i[s])return t().e("属性中的key不能与以下保留字冲突: "+r.join(",")),!1;o+=1}}return!0}(n,r))){var o=new ne(n,r);m().addEvent(o);var s=!!x(),a=s?0:u.EVENT_SEND_DEFAULT_INTERVAL,c=Date.now();("number"!=typeof i||"number"!=typeof a||i<=0||c-i>a)&&(i=c,ee().send(N,{noCache:s},function(){}))}},this.trackShare=function(n){if(e)try{o.getSdkType().indexOf("game")>-1?(n=g().add(n,!0),t().v("shareQuery: ",n)):(n=g().add(n,!1),t().v("sharePath: ",n.path))}catch(e){t().v("shareAppMessage: ",e)}return n},this.trackPageStart=function(t){e&&h().addPageStart(t)},this.trackPageEnd=function(t){e&&h().addPageEnd(t)},this.onShareAppMessage=function(e){var t=this;o.onShareAppMessage(function(){return t.trackShare(e())})},this.shareAppMessage=function(e){this.trackShare(e),o.shareAppMessage(e)}}var re=[];function oe(){}oe.prototype={createMethod:function(e,n,r){try{e[n]=r&&r[n]?function(){return r[n].apply(r,arguments)}:function(){re.push([n,[].slice.call(arguments)])}}catch(e){t().v("create method errror: ",e)}},installApi:function(e,n){try{var r,i,o="resume,pause,trackEvent,trackPageStart,trackPageEnd,trackShare,setUserid,setOpenid,setUnionid,setSuperProperty,setUserInfo".split(",");for(r=0,i=o.length;r