-
Notifications
You must be signed in to change notification settings - Fork 31
/
uma.min.js
1 lines (1 loc) · 38.3 KB
/
uma.min.js
1
"use strict";var e,t,n="[UMENG] -- ",a=(t=!1,function(){return e=null===e?new i:e});function i(){this.setDebug=function(e){t=e};this.d=function(){if(t)try{"string"==typeof arguments[0]&&(arguments[0]=n+arguments[0]);console.debug.apply(console,arguments)}catch(e){}};this.i=function(){try{if(t)try{"string"==typeof arguments[0]&&(arguments[0]=n+arguments[0]);console.info.apply(console,arguments)}catch(e){}}catch(e){}};this.e=function(){if(t)try{"string"==typeof arguments[0]&&(arguments[0]=n+arguments[0]);console.error.apply(console,arguments)}catch(e){}};this.w=function(){if(t)try{"string"==typeof arguments[0]&&(arguments[0]=n+arguments[0]);console.warn.apply(console,arguments)}catch(e){}};this.v=function(){if(t)try{"string"==typeof arguments[0]&&(arguments[0]=n+arguments[0]);console.log.apply(console,arguments)}catch(e){}};this.t=function(){if(t)try{console.table.apply(console,arguments)}catch(e){}};this.tip=function(){try{"string"==typeof arguments[0]&&(arguments[0]=n+arguments[0]);console.log.apply(console,arguments)}catch(e){}};this.tip_w=function(e){try{console.log("%c "+n+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]=n+arguments[0]);console.error.apply(console,arguments)}catch(e){}};this.repeat=function(e){for(var t=e;t.length<86;)t+=e;return t}}var r,s=(r=e=null,function(){return r=r||new o});function o(){var n={};this.useOpenid=function(){return!!n.useOpenid};this.useSwanid=function(){return!!n.useSwanid};this.autoGetOpenid=function(){return!!n.autoGetOpenid};this.appKey=function(){return n.appKey};this.uploadUserInfo=function(){return n.uploadUserInfo};this.enableVerify=function(){return n.enableVerify};this.set=function(e){n=e};this.get=function(){return n};this.setItem=function(e,t){n[e]=t};this.getItem=function(e){return n[e]}}function u(){}u.prototype={on:function(e,t,n){var i=this.e||(this.e={});(i[e]||(i[e]=[])).push({fn:t,ctx:n});return this},once:function(e,t,n){var i=this;function r(){i.off(e,r);t.apply(n,arguments)}r._=t;return this.on(e,r,n)},emit:function(e){for(var t=[].slice.call(arguments,1),n=((this.e||(this.e={}))[e]||[]).slice(),i=0,r=n.length;i<r;i++)n[i].fn.apply(n[i].ctx,t);return this},off:function(e,t){var n=this.e||(this.e={}),i=n[e],r=[];if(i&&t)for(var o=0,s=i.length;o<s;o++)i[o].fn!==t&&i[o].fn._!==t&&r.push(i[o]);r.length?n[e]=r:delete n[e];return this}};var c=new u;c.messageType={CONFIG_LOADED:0,UMA_LIB_INITED:1};var f=ks,p=new(function(){function e(){}e.prototype.setStorage=function(e,t,n){f.setStorage({key:e,data:t,success:function(){"function"==typeof n&&n(!0)},fail:function(){"function"==typeof n&&n(!1)}})};e.prototype.getStorage=function(t,n){f.getStorage({key:t,success:function(e){"function"==typeof n&&n(e.data)},fail:function(e){a().w(t+": "+e.errMsg);"function"==typeof n&&n()}})};e.prototype.removeStorage=function(e,t){f.removeStorage({key:e,success:function(){"function"==typeof t&&t(!0)},fail:function(){"function"==typeof t&&t(!1)}})};e.prototype.getSystemInfo=function(i){f.getSystemInfo({success:function(e){e.safeArea=e.safeArea||{};var t={model:e.model,brand:e.brand,pixelRatio:e.pixelRatio,screenWidth:e.screenWidth,screenHeight:e.screenHeight,fontSizeSetting:e.fontSizeSetting,platform:e.platform,platformVersion:e.version,platformSDKVersion:e.SDKVersion,language:e.language,deviceName:e.model,OSVersion:e.system,resolution:"",safeArea:{width:e.safeArea.width,height:e.safeArea.height,top:e.safeArea.top,left:e.safeArea.left,bottom:e.safeArea.bottom,right:e.safeArea.right},statusBarHeight:e.statusBarHeight,host:e.host},n=e.system.split(" ");Array.isArray(n)&&(t.OS=n[0]);n=Math.round(e.screenWidth*e.pixelRatio),e=Math.round(e.screenHeight*e.pixelRatio);t.resolution=e<n?n+"*"+e:e+"*"+n;"function"==typeof i&&i(t)},fail:function(){"function"==typeof i&&i()}})};e.prototype.getDeviceInfo=function(e){"function"==typeof e&&e("")};e.prototype.checkNetworkAvailable=function(t){f.getNetworkType({success:function(e){"function"==typeof t&&t(e&&"none"!==e.networkType)},fail:function(){"function"==typeof t&&t(!1)}})};e.prototype.getNetworkInfo=function(t){f.getNetworkType({success:function(e){"function"==typeof t&&t({networkAvailable:"none"!==e.networkType,networkType:e.networkType})},fail:function(){"function"==typeof t&&t()}})};e.prototype.getDeviceId=function(e){e("")};e.prototype.getAdvertisingId=function(e){"function"==typeof e&&e("")};e.prototype.onNetworkStatusChange=function(t){f.onNetworkStatusChange(function(e){"function"==typeof t&&t(e.isConnected)})};e.prototype.request=function(e){var t=e.success,n=e.fail,i=!1,r=null;e.success=function(e){if(!i){r&&clearTimeout(r);"function"==typeof t&&t(e)}};e.fail=function(){if(!i){r&&clearTimeout(r);"function"==typeof n&&n(!1)}};f.request(e);r=setTimeout(function(){r&&clearTimeout(r);i=!0;"function"==typeof n&&n(i)},e.timeout||5e3)};e.prototype.getSdkType=function(){return"ksmp"};e.prototype.getPlatform=function(){return"ks"};e.prototype.getUserInfo=function(t){var n={fail:function(){t&&t()},success:function(e){if(e&&e.userInfo){e=e.userInfo;t&&t({avatar:e.avatarUrl,nickName:e.nickName,gender:e.gender,country:e.country,province:e.province,city:e.city,language:e.language})}}};try{f.getSetting({success:function(e){e.authSetting["scope.userInfo"]&&f.getUserInfo(n)},fail:function(){t()}})}catch(e){a.e("getUserInfo error",e)}};e.prototype.getAppInfoSync=function(){if(f.getAccountInfoSync){var e=f.getAccountInfoSync(),e=e&&e.miniProgram?e.miniProgram:{};return{appId:e.appId,appEnv:e.envVersion,appVersion:e.version}}return{}};e.prototype.onShareAppMessage=function(e){f.onShareAppMessage(e)};e.prototype.shareAppMessage=function(e){f.shareAppMessage(e)};return e}()),d=function(e,t){return(d=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 h(e,t){d(e,t);function n(){this.constructor=e}e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var l={SESSION_INTERVAL:3e4,LOG_URL:"/kuaishoum_logs",GET_OPENID_URL:"/uminiprogram_logs/ks/getuut",USERINFO_URL:"/uminiprogram_logs/comm/uif",ENDPOINT:"https://umini.shujupie.com",ENDPOINTB:"https://ulogs.umeng.com",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.6.3-beta.15459557",ALIPAY_AVAILABLE_VERSION:"10.1.52",SHARE_PATH:"um_share_path",SHARES:"shares",REQUESTS:"requests",UUID:"um_uuid",UUID_SUFFIX:"ud",OPENID:"um_od",UNIONID:"um_unid",ALIPAYID:"um_alipayid",USERID:"um_userid",PROVIDER:"um_provider",SWANID:"um_swanid",ANONYMOUSID:"um_anonymousid",LAUNCH_OPTIONS:"LAUNCH_OPTIONS",UM_SSRC:"_um_ssrc",USER_INFO:"user_info",IS_ALIYUN:!1};var g,_,v={isNumber:function(e){return!Number.isNaN(parseInt(e,10))},compareVersion:function(e,t){for(var n=String(e).split("."),i=String(t).split("."),r=0;r<Math.max(n.length,i.length);r++){var o=parseInt(n[r]||0,10),s=parseInt(i[r]||0,10);if(s<o)return 1;if(o<s)return-1}return 0},getRandomStr:function(e){for(var t="",n=["0","1","2","3","4","5","6","7","8","9","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"],i=0;i<Number(e);i++)t+=n[Math.round(Math.random()*(n.length-1))];return t},clone:function(e){return JSON.parse(JSON.stringify(e))},startsWith:function(e,t){return!(!e||!t||0===t.length||t.length>e.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;n<arguments.length;n++){var i=arguments[n];if(i)for(var r in i)Object.prototype.hasOwnProperty.call(i,r)&&(t[r]=i[r])}return t},deepEqual:function e(t,n){if(t===n)return!0;if(t&&"object"==typeof t&&n&&"object"==typeof n){if(Object.keys(t).length!==Object.keys(n).length)return!1;for(var i in t){if(Object.prototype.hasOwnProperty.call(n,i))return!1;if(!e(t[i],n[i]))return!1}return!0}return!1},trimStart:function(e,t){if(!e)return"";if("string"==typeof t&&t.length){t=new RegExp("^"+t+"*");e=e.replace(t,"")}else e=e.replace(/^s*/,"");return e},trimEnd:function(e,t){if(!e)return"";var n,i;if("string"==typeof t&&t.length){n=new RegExp(t);i=e.length;for(;n.test(e.charAt(i));)--i;return e.slice(0,i+1)}n=/s/;i=e.length-1;for(;n.test(e.charAt(i));)--i;return e.slice(0,i+1)},isFunction:function(e){return"function"==typeof e}},y=function(t){h(e,t);function e(){var e=null!==t&&t.apply(this,arguments)||this;e._openid="";e._unionid="";e._useOpenid=!1;return e}e.prototype.initID=function(t){var n=this;n._idType=n._useOpenid?"openid":"uuid";a().v("id type: ",n._idType);p.getStorage(l.UNIONID,function(e){n._unionid=e});this._useOpenid?p.getStorage(l.OPENID,function(e){n._openid=e;t&&t()}):t&&t()};e.prototype.setUseOpenid=function(e){this._useOpenid=e};e.prototype.setOpenid=function(e){if(!this._openid&&e){this._openid=e;p.setStorage(l.OPENID,e)}};e.prototype.setUnionid=function(e){if(!this._unionid&&e){this._unionid=e;p.setStorage(l.UNIONID,e)}};e.prototype.getIdTracking=function(){var e=t.prototype.getIdTracking.call(this);this._openid&&(e.openid=this._openid);this._unionid&&(e.unionid=this._unionid);this._userid&&(e.userid=this._userid);return e};e.prototype.getId=function(){return this._useOpenid?this._openid:this._uuid};return e}(function(){function e(){this._uuid="";this._userid="";this._provider="";this._idType=""}e.prototype.createUUID=function(){return v.getRandomStr(10)+Date.now()+v.getRandomStr(7)+l.UUID_SUFFIX};e.prototype.initUUID=function(t){var n=this;p.getStorage(l.UUID,function(e){if(e)n._uuid=e;else{n._uuid=n.createUUID();p.setStorage(l.UUID,n._uuid)}t&&t(e)})};e.prototype.initUserid=function(){var t=this;p.getStorage(l.USERID,function(e){if(!t._userid&&e){t._userid=e;a().v("userId is ",e)}});p.getStorage(l.PROVIDER,function(e){if(!t._provider&&e){t._provider=e;a().v("provider is ",e)}})};e.prototype.init=function(e){var t=this;t.initUUID(function(){t.initUserid();t.initID(e)})};e.prototype.setUserid=function(e,t){if(!this._userid&&e){this._userid=e;this._provider=t;p.setStorage(l.USERID,e);p.setStorage(l.PROVIDER,t)}};e.prototype.getUserId=function(){return this._userid};e.prototype.getProvider=function(){return this._provider};e.prototype.getIdType=function(){return this._idType};e.prototype.getIdTracking=function(){var e={};this._uuid&&(e.uuid=this._uuid);this._userid&&(e.userid=this._userid);return e};return e}()),m=ks,S=function(e){h(t,e);function t(){return null!==e&&e.apply(this,arguments)||this}t.prototype.getOpenIdAsync=function(t,n){var i=this;m.login({success:function(e){e.code?p.request({url:l.ENDPOINT+l.GET_OPENID_URL,method:"GET",data:{key:t,code:e.code},success:function(e){if(e&&200===e.statusCode&&e.data&&e.data.data){e=e.data.data;i.setOpenid(e.oid);i.setUnionid(e.uid);return n&&n(!0)}n&&n()},fail:function(e){a().v("wx request failed...",e);n&&n()}}):n&&n()},fail:function(){n&&n()}})};return t}(y),I=function(){return g=g||new S},E=function(){return _=_||new O};function O(){var t=!1,n=null,i=[];this.addPageStart=function(e){if(e&&!t){n={ts:Date.now(),path:e,page_name:e};t=!0}};this.addPageEnd=function(e){if(t&&e&&n&&e===n.page_name){e=Date.now()-n.ts;n.duration=Math.abs(e);i.push(n);n=null;t=!1}};this.get=function(){return i};this.getCurrentPage=function(){return n};this.clear=function(){i.length=0}}var A={};function N(){return function(e){var t,n=[];for(t in e)"_um_ssrc"!==t&&"_um_sts"!==t&&n.push(t+"="+e[t]);return n.join("&")}(A)}var T,k,w,b=function(){return T=T||new R};function R(){return{add:function(e,t){a().v("share origin: %o",e);var n={title:e&&e.title,path:e&&e.path&&e.path.split("?")[0],_um_sts:Date.now()};n.path&&1<n.path.length&&v.startsWith(n.path,"/")&&(n.path=v.trimStart(n.path,"/"));var i=e.path||"",r=I().getId();if(r){var o=w.split(","),s=(o=o.filter(function(e){return 0<e.length})).indexOf(r);(o=0<=s?o.slice(0,s):o).length<3&&o.push(r);r=o.join(",");-1!==i.indexOf("?")?i+="&_um_ssrc="+r:i+="?_um_ssrc="+r;o=Date.now();i+="&_um_sts="+o;if(t){t=N();e.query=e.query?e.query+"&_um_ssrc="+r+"&_um_sts="+o:t?t+"&_um_ssrc="+r+"&_um_sts="+o:"_um_ssrc="+r+"&_um_sts="+o}else e.path=i;n._um_ssrc=r;n._um_sts=o}k.push(n);a().v("share: %o",e);return e},setShareSource:function(e){w=e},clear:function(){k.length=0},get:function(){return k}}}var D,P,U,L,C={stringify:function(e){if(e)try{return JSON.stringify(e)}catch(e){}return""},parse:function(e){if(e)try{return JSON.parse(e)}catch(e){}return null},parseToArray:function(e){if(e)try{return JSON.parse(e)}catch(e){}return[]}},M=(L=!(k=[]),function(){return D=D||new V});function V(){this.load=function(t){if(U){p.removeStorage(P);t()}else{P="um_cache_"+s().appKey();p.getStorage(P,function(e){U=C.parse(e)||{};L=!0;p.removeStorage(P);t()})}};this.save=function(){U&&p.setStorage(P,C.stringify(U))};this.set=function(e,t){U&&(U[e]=t)};this.get=function(e){return(U||{})[e]};this.remove=function(e){U&&U[e]&&delete U[e]};this.getAll=function(){return U};this.clear=function(){U=null};this.has=function(e){return!!this.get(e)};this.isLoaded=function(){return L}}var j,K,G,F,x="ekvs",H=1e4,q=(G=[],F=[],function(){return j=j||{addEvent:function(e){if(K){G.unshift(e);if(1<G.length){B();G.length=0}}else{a().w("session id is null: ",K);F.unshift(e)}},setSessionId:function(e){K=e;a().v("setSessionId: ",K);if(Array.isArray(F)&&F.length&&K){for(var t=0;t<F.length;t++)this.addEvent(F[t]);F.length=0}},getEkvs:function(){var e=M().get(x);return e=G&&G.length?Y(e,G):e},clear:function(){M().remove(x);G.length=0}}});function B(){if(G.length){var e=M().get(x);if(function(e){var t,n=0;for(t in e)Array.isArray(e[t])&&(n+=e[t].length);return n}(e)+G.length<=H){e=Y(e,G);M().set(x,e)}}}function Y(e,t){var n=(e=e||{})[K];Array.isArray(n)&&n.length?e[K]=n.concat(t):e[K]=[].concat(t);return e}var W,J="2g",X="3g",z="4g",Q={HALF_SESSION:"half_session",CLOSE_SESSION:"close_session",EKV:"ekv",ENTER_PAGE:"enter_page",LEAVE_PAGE:"leave_page"},Z=["access","access_subtype"],$={instance:function(){return W=W||ee()}};function ee(){var e=!1,i={};function t(n){var e=M().get(l.IMPRINT);e&&(i.imprint=e);i.device_type="Phone";i.sdk_version=l.IMPL_VERSION;i.appkey=s().appKey();p.getDeviceInfo(function(e){i.device_info=e||""});e=p.getAppInfoSync();i.appid=e.appId;i.app_env=e.appEnv;i.app_version=e.appVersion;p.getSystemInfo(function(t){p.getNetworkInfo(function(e){e=function(e,t){var n={};(e=e||{}).safeArea=e.safeArea||{};var i=(t=t||{}).networkType;"none"===i&&(i="unknown");var r=e.model||"",o=e.platform||"",s=e.brand||"",t=s.toLowerCase();n.sdk_type=p.getSdkType();n.platform=p.getPlatform();n.platform_sdk_version=e.platformSDKVersion;n.platform_version=e.platformVersion;n.resolution=e.resolution;n.pixel_ratio=e.pixelRatio;n.os=o;n.font_size_setting=e.fontSizeSetting;n.device_model=r;n.device_brand=s;n.device_manufacturer=t;n.device_manuid=r;n.device_name=r;n.os_version=e.OSVersion;n.language=e.language;n.theme=e.theme;n.benchmark_level=e.benchmarkLevel;n.status_bar_height=e.statusBarHeight;n.safe_area_top=e.safeArea.top;n.safe_area_left=e.safeArea.left;n.safe_area_right=e.safeArea.right;n.safe_area_bottom=e.safeArea.bottom;n.safe_area_height=e.safeArea.height;n.safe_area_width=e.safeArea.width;n.storage=e.storage;n.screen_width=e.screenWidth;n.screen_height=e.screenHeight;n.host=e.host;switch(i=i?i.toLowerCase():""){case z:n.access_subtype="LTE";n.access="4G";break;case X:n.access_subtype="CDMA";n.access="3G";break;case J:n.access_subtype="GRPS";n.access="2G";break;default:n.access=i;delete n.access_subtype}return n}(t,e);v.assign(i,e);n&&n()})})}return{init:function(){t(function(){e=!0})},isLoaded:function(){return e},get:function(){return i},getRealtimeFields:function(){var t={};Z.forEach(function(e){t[e]=i[e]});return t},setIdTracking:function(e){this.setItem("id_tracking",e)},setIdType:function(e){this.setItem("id_type",e)},setAppVersion:function(e){this.setItem("app_version",e)},setSuperProperty:function(e){i.sp||(i.sp={});i.sp.isv=e},getSuperProperty:function(){return i&&i.sp?i.sp.isv:""},setItem:function(e,t){i[e]=t},getItem:function(e){return i[e]}}}var te,ne,ie,re=(ie=ne=te=W=U=D=T=_=g=null,function(){return te=te||oe()});function oe(){return{resume:function(e){var t=!1;ie=ie||M().get(l.CURRENT_SESSION);var n=new Date;ne=n.getTime();if(!ie||!ie.end_time||ne-ie.end_time>l.SESSION_INTERVAL){t=!0;!function(e){try{var t=(ie||{}).options||{},n=v.assign({},function(e){var t,n={};for(t in e)0===t.indexOf("_um_")&&(n[t]=e[t]);a().v("query: ",e);a().v("_um_params: ",n);return n}(e.query));n.path=e.path||t.path;n.scene=e.scene?p.getPlatform()+"_"+e.scene:t.scene;var i=e.referrerInfo;i&&(n.referrerAppId=i.appId);a().v("session options: ",n);var r=n[l.UM_SSRC];r&&b().setShareSource(r);var o=Date.now();ie={id:v.getRandomStr(10)+o,start_time:o,options:n}}catch(e){a().e("生成新session失败: ",e)}}(e);a().v("开始新的session(%s): ",ie.id,ie)}else a().v("延续上一次session(%s): %s ",ie.id,n.toLocaleTimeString(),ie);return t},pause:function(){!function(){if(ie){var e=new Date;ie.end_time=e.getTime();"number"!=typeof ie.duration&&(ie.duration=0);ie.duration=ie.end_time-ne;M().set(l.CURRENT_SESSION,ie);a().v("退出会话(%s): %s ",ie.id,e.toLocaleTimeString(),ie)}}()},getCurrentSessionId:function(){return(ie||{}).id},getCurrentSession:function(){return ie},cloneCurrentSession:function(){return v.clone(ie)}}}function se(e){var t=null;switch(e){case Q.HALF_SESSION:t=function(){var e=null,t=re().cloneCurrentSession();t&&(e={header:{st:"1"},analytics:{sessions:[t]}});return e}();break;case Q.CLOSE_SESSION:t=function(){var e=null,t={},n=re().cloneCurrentSession();if(n){var i=E().get(),r=b().get();Array.isArray(i)&&i.length&&(n.pages=v.clone(i));Array.isArray(r)&&r.length&&(n.shares=v.clone(r));E().clear();b().clear();t.sessions=[n]}n=q().getEkvs();if(n){t.ekvs=v.clone(n);q().clear()}(t.sessions||t.ekvs)&&(e={analytics:t});return e}();break;case Q.EKV:t=function(){var e=null,t=q().getEkvs();if(t){e={analytics:{ekvs:v.clone(t)}};q().clear()}return e}()}return t}var ae={sessions:"sn",ekvs:"e",active_user:"active_user"},ue={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"},ce={uuid:"ud",unionid:"und",openid:"od",anonymousid:"nd",alipay_id:"ad",device_id:"dd",userid:"puid"};function fe(e){return{h:function(e,t){var n=pe(e,t);e&&e.id_tracking&&(n[t.id_tracking||"id_tracking"]=pe(e.id_tracking,ce));return n}(e.header,ue),a:function(e,t){var n={};if(e)for(var i in e)e[i]&&(n[t[i]]=e[i]);return n}(e.analytics,ae)}}function pe(e,t){var n,i={};for(n in e)t[n]?i[t[n]]=e[n]:i[n]=e[n];return i}var de=P=w="";function he(e){if(e.length<2)return(t=e.charCodeAt(0))<128?e:t<2048?Ie(192|t>>>6)+Ie(128|63&t):Ie(224|t>>>12&15)+Ie(128|t>>>6&63)+Ie(128|63&t);var t=65536+1024*(e.charCodeAt(0)-55296)+(e.charCodeAt(1)-56320);return Ie(240|t>>>18&7)+Ie(128|t>>>12&63)+Ie(128|t>>>6&63)+Ie(128|63&t)}function le(e){var t=[0,2,1][e.length%3],e=e.charCodeAt(0)<<16|(1<e.length?e.charCodeAt(1):0)<<8|(2<e.length?e.charCodeAt(2):0);return[me.charAt(e>>>18),me.charAt(e>>>12&63),2<=t?"=":me.charAt(e>>>6&63),1<=t?"=":me.charAt(63&e)].join("")}function ge(e){return e.replace(Ee,he).replace(/[\s\S]{1,3}/g,le)}function _e(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 Ie(55296+(t>>>10))+Ie(56320+(1023&t));case 3:return Ie((15&e.charCodeAt(0))<<12|(63&e.charCodeAt(1))<<6|63&e.charCodeAt(2));default:return Ie((31&e.charCodeAt(0))<<6|63&e.charCodeAt(1))}}function ve(e){var t=e.length,n=t%4,e=(0<t?Se[e.charAt(0)]<<18:0)|(1<t?Se[e.charAt(1)]<<12:0)|(2<t?Se[e.charAt(2)]<<6:0)|(3<t?Se[e.charAt(3)]:0);(e=[Ie(e>>>16),Ie(e>>>8&255),Ie(255&e)]).length-=[0,0,2,1][n];return e.join("")}function ye(e){return e.replace(/[\s\S]{1,4}/g,ve).replace(Oe,_e)}var me="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Se=function(e){for(var t={},n=0,i=e.length;n<i;n++)t[e.charAt(n)]=n;return t}(me),Ie=String.fromCharCode,Ee=/[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g,Oe=new RegExp(["[À-ß][-¿]","[à-ï][-¿]{2}","[ð-÷][-¿]{3}"].join("|"),"g"),Ae={encode:function(e,t){return t?ge(String(e)).replace(/[+\/]/g,function(e){return"+"==e?"-":"_"}).replace(/=/g,""):ge(String(e))},decode:function(e){return ye(String(e).replace(/[-_]/g,function(e){return"-"==e?"+":"/"}).replace(/[^A-Za-z0-9\+\/]/g,""))}};var Ne=new function(){var t="",n=this;this.set=function(e){t=e};this.get=function(){return t};this.getImpObj=function(){return C.parse(Ae.decode(t))};this.getItem=function(e){var t=n.getImpObj();return t&&t[e]||""};this.load=function(){t=M().get(l.IMPRINT)};this.save=function(){t&&M().set(l.IMPRINT,t)}};function Te(n,i,r,e){$.instance().setIdType(I().getIdType());$.instance().setIdTracking(I().getIdTracking());var t=I().getUserId();t&&n.analytics&&(n.analytics.active_user={puid:t,provider:I().getProvider()});t=v.clone($.instance().get());n.header=v.assign(t,n.header,{ts:Date.now(),testToken:de,traceId:v.getRandomStr(10)+Date.now()+v.getRandomStr(9)});var t=fe(n),o=C.stringify(t),t={url:l.ENDPOINT+l.LOG_URL,method:"POST",data:Ae.encode(o),success:function(e){var t=e.code||e.status||e.statusCode;if(200===t||413===t){a().i("数据发送成功: ",n,o);!function(e){if(e){$.instance().setItem(l.IMPRINT,e);Ne.set(e);Ne.save();a().v("imprint: ",Ne.getImpObj());Ne.getItem("ttn_invalid")&&(de="")}}((e.data||{}).imprint);"function"==typeof i&&i(e)}else{a().w("数据发送失败: ",o);"function"==typeof r&&r()}},fail:function(e){a().w("超时: ",o);"function"==typeof r&&r()},complete:function(){"function"==typeof e&&e()}};p.request(v.assign(t,{header:{"Content-Type":t=p.getSdkType()+"/json","Msg-Type":t}}))}function ke(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 we,be,Re,De,Pe=(we=null,be=!1,Re=[],De=new ke(50),function(){return we=we||new Ce});function Ue(t){var e=De.front();if(e)Te(e,function(){De.dequeue();Ue(t)},function(){var e=De.dequeue();e&&!e.noCache&&Re.push(e);Ue(t)});else{!function(){Re.forEach(function(e){De.enqueue(e)});Re.length=0}();t()}}function Le(e){if(I().getId())if(be)a().i("队列正在发送中");else{be=!0;Ue(function(){be=!1;"function"==typeof e&&e()})}else{a().i("获取id标识失败,暂缓发送");"function"==typeof e&&e()}}function Ce(){this.send=function(e,t,n){e?this.add(e,t,function(){Le(n)}):Le(n)};this.add=function(e,t,n){!function e(t,n,i){if($.instance().isLoaded()){n=n||{};var r=se(t);if(r){var o=$.instance().getRealtimeFields();r.header=v.assign({},r.header,o);r.noCache=n.noCache;De.enqueue(r)}"function"==typeof i&&i()}else setTimeout(function(){e(t,n,i)},100)}(e,t,n)};this.load=function(){var e=M().get(l.REQUESTS);e&&e.length&&e.forEach(function(e){De.enqueue(e)});M().remove(l.REQUESTS)};this.save=function(){M().set(l.REQUESTS,v.clone(De.items()));De.clear()}}var Me,Ve=(Me=null,function(){return Me=Me||new je});function je(){this.update=function(){p.getUserInfo(function(t){if(t){var e=M().get(l.USER_INFO);e&&v.deepEqual(t,e)||function(t,n){var e=s().appKey(),i=p.getSdkType(),r=I().getId(),o=I().getIdType();if(e&&i&&r&&o){o={ak:s().appKey(),sdt:p.getSdkType(),uin:t.nickName,uia:t.avatar,uig:t.gender,uit:t.country,uip:t.province,uic:t.city,uil:t.language,id:I().getId(),it:I().getIdType()},o=JSON.stringify(o);o=Ae.encode(o);p.request({url:l.ENDPOINT+l.USERINFO_URL,method:"POST",header:{"content-type":"application/x-www-form-urlencoded"},data:"ui="+o,success:function(e){a().v("用户信息上传成功: ",t);n&&n(e&&e.data&&200===e.data.code)},fail:function(){a().e("用户信息上传失败: ",t);n&&n(!1)}})}}(t,function(e){e&&M().set(l.USER_INFO,t)})}})}}function Ke(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 i in t)!{}.hasOwnProperty.call(t,i)||(this[i]=t[i])}function Ge(){var r=!1,n=!1,o=0;this.init=function(e){a().v("sdk version: "+l.IMPL_VERSION);r?a().v("Lib重复实例化"):M().load(function(){a().v("cache初始化成功: ",M().getAll());!function(){I().setUseOpenid&&I().setUseOpenid(s().useOpenid());I().init(function(){$.instance().init();a().v("Header初始化成功")})}();r=!0;"function"==typeof e&&e();a().tip("SDK集成成功")})};this.resume=function(e){if(r&&!n){a().v("showOptions: ",e);var t;n=!0;s().enableVerify()&&e&&e.query&&(t=e.query._ttn,de=t||de);this._resume(e)}};this._resume=function(e){Pe().load();var t=re().resume(e),e=re().getCurrentSessionId();q().setSessionId(e);t&&Pe().add(Q.HALF_SESSION,{},function(){I().setUseOpenid&&I().setUseOpenid(s().useOpenid());if(s().useOpenid()&&s().autoGetOpenid()&&!I().getId()){a().v("get id async");!function t(n,i){if(I().getId()||n<=0)return;I().getOpenIdAsync(s().appKey(),function(e){if(e){a().v("获取id成功");Pe().send()}else{a().v("获取openid失败,启动重试,剩余可用次数",n-1);setTimeout(function(){t(n-1,i)},i)}})}(10,3e3)}else{a().v("session auto send");Pe().send()}})};this.pause=function(e){if(r){n=!1;o=0;re().pause();s().uploadUserInfo()&&Ve().update();Pe().send(Q.CLOSE_SESSION,{},function(){Pe().save();M().save();a().v("cache save success");"function"==typeof e&&e()})}};this.setOpenid=function(e){a().v("setOpenId: %s",e);I().setOpenid(e);Pe().send()};this.setUnionid=function(e){a().v("setUnionid: %s",e);I().setUnionid(e)};this.setUserid=function(e,t){a().v("setUserid: %s",e,t);I().setUserid(e,t)};this.setAnonymousid=function(e){a().v("setAnonymousId: %s",e);I().setAnonymousid(e);Pe().send()};this.setAppVersion=function(e){e&&"string"!=typeof e?a().w("setAppVersion方法只接受字符串类型参数"):$.instance().setAppVersion(e)};this.setAlipayUserid=function(e){if(e&&"string"!=typeof e)a().w("setAlipayUserid方法只接受字符串类型参数");else{a().v("setAlipayUserid: %s",e);I().setAlipayUserid(e)}};this.setDeviceId=function(e){if("string"==typeof e){I().setDeviceId(e);return e}};this.setSuperProperty=function(e){if(e&&"string"!=typeof e)a().w("超级属性只支持字符串类型");else{var t=this;if($.instance().getSuperProperty()!==e){$.instance().setSuperProperty(e);t.pause(function(){t.resume()})}}};this.trackEvent=function(e,t){if(r){a().v("event: ",e,t);if(function(e,t){if(e&&"string"==typeof e){var n=["id","ts","du"],i={};n.forEach(function(e){i[e]=1});if(i[e])a().e("eventId不能与以下保留字冲突: "+n.join(","));else if(e.length>l.MAX_EVENTID_LENGTH)a().e("The maximum length of event id shall not exceed "+l.MAX_EVENTID_LENGTH);else{if(!t||"object"==typeof t&&!Array.isArray(t)||"string"==typeof t){if("object"==typeof t){var r,o=0;for(r in t)if({}.hasOwnProperty.call(t,r)){if(r.length>l.MAX_PROPERTY_KEY_LENGTH){a().e("The maximum length of property key shall not exceed "+l.MAX_PROPERTY_KEY_LENGTH);return}if(o>=l.MAX_PROPERTY_KEYS_COUNT){a().e("The maximum count of properties shall not exceed "+l.MAX_PROPERTY_KEYS_COUNT);return}if(i[r]){a().e("属性中的key不能与以下保留字冲突: "+n.join(","));return}o+=1}}return 1}a().e("please check trackEvent properties. properties should be string or object(not include Array)")}}else a().e('please check trackEvent id. id should be "string" and not null')}(e,t)){var n=new Ke(e,t);q().addEvent(n);var i=!!de,e=i?0:l.EVENT_SEND_DEFAULT_INTERVAL,t=Date.now();if(n=t,e=e,"number"!=typeof o||"number"!=typeof e||(o<=0||e<n-o)){o=t;Pe().send(Q.EKV,{noCache:i},function(){})}}}};this.trackShare=function(e){if(r){try{if(-1<p.getSdkType().indexOf("game")){e=b().add(e,!0);a().v("shareQuery: ",e)}else{e=b().add(e,!1);a().v("sharePath: ",e.path)}}catch(e){a().v("shareAppMessage: ",e)}return e}};this.trackPageStart=function(e){r&&E().addPageStart(e)};this.trackPageEnd=function(e){r&&E().addPageEnd(e)};this.onShareAppMessage=function(e){var t=this;p.onShareAppMessage(function(){return t.trackShare(e())})};this.shareAppMessage=function(e){this.trackShare(e);p.shareAppMessage(e)}}var Fe=[];function xe(){}xe.prototype={createMethod:function(e,t,n){try{e[t]=n&&n[t]?function(){return n[t].apply(n,arguments)}:function(){Fe.push([t,[].slice.call(arguments)])}}catch(e){a().v("create method errror: ",e)}},installApi:function(e,t){try{for(var n="resume,pause,trackEvent,trackPageStart,trackPageEnd,trackShare,setUserid,setOpenid,setUnionid".split(","),i=0,r=n.length;i<r;i++)this.createMethod(e,n[i],t);if(t)for(i=0,r=Fe.length;i<r;i++){var o=Fe[i];try{t[o[0]].apply(t,o[1])}catch(e){a().v("impl[v[0]].apply error: ",o[0],e)}}}catch(e){a().v("install api errror: ",e)}}};var He=[l.ENDPOINT,l.ENDPOINTB];function qe(t,e){var n,i;0===t||1===t&&e?n=l.ENDPOINT:2===t&&e?n=l.ENDPOINTB:e&&(n=He[t]);if(t>=He.length||e){e&&(i=n,l.ENDPOINT=i);e&&a().v("命中可用服务",n);e||a().tip_w("未命中可用服务")}else p.request({url:l.ENDPOINT+"/uminiprogram_logs/ckdh",success:function(e){200===(e.code||e.status||e.statusCode)&&e.data&&200===e.data.code?qe(t+1,!0):qe(t+1,!1)},fail:function(){qe(t+1,!1)}})}({init:function(e){l.ENDPOINTB&&setTimeout(function(){qe(0,!1)},e)}}).init(3e3);var Be=new xe,Ye={_inited:!1,_log:a(),preinit:function(e){if(e&&"object"==typeof e)for(var t in e)l[t]=e[t];return l},use:function(e,t){e&&v.isFunction(e.install)?e.install(Ye,t):v.isFunction(e)&&e(Ye,t);return Ye},messager:c,init:function(e){if(this._inited)a().v("已经实例过,请避免重复初始化");else if(e)if(e.appKey){"boolean"!=typeof e.useOpenid&&(e.useOpenid=!0);s().set(e);a().setDebug(e.debug);this._inited=!0;var t=this;c.emit(c.messageType.CONFIG_LOADED,e);try{var n=new Ge;a().v("成功创建Lib对象");n.init(function(){a().v("Lib对象初始化成功");Be.installApi(t,n);a().v("安装Lib接口成功");c.emit(c.messageType.UMA_LIB_INITED,e)})}catch(e){a().w("创建Lib对象异常: "+e)}}else a().err("请确保传入正确的appkey");else a().err("请正确设置相关信息!")}};try{Be.installApi(Ye,null)}catch(e){a().w("uma赋值异常: ",e)}var We={FETCH_URL:"https://ucc.umeng.com/v1/mini/fetch",ABLOG_URL:"https://pslog.umeng.com/mini_ablog",SDK_VERSION:"2.6.3-beta.15459557",MOBILE_NETWORK_NONE:"none",MOBILE_NETWORK_2G:"2g",MOBILE_NETWORK_3G:"3g",MOBILE_NETWORK_4G:"4g",MOBILE_NETWORK_5G:"5g",MOBILE_NETWORK_WIFI:"wifi",IMPRINT:"imprint"},Je={},y=Array.isArray;Je.isArray=y||function(e){return"[object Array]"===toString.call(e)};Je.isObject=function(e){return e===Object(e)&&!Je.isArray(e)};Je.isEmptyObject=function(e){if(Je.isObject(e)){for(var t in e)if(hasOwnProperty.call(e,t))return!1;return!0}return!1};Je.isUndefined=function(e){return void 0===e};Je.isString=function(e){return"[object String]"===toString.call(e)};Je.isDate=function(e){return"[object Date]"===toString.call(e)};Je.isNumber=function(e){return"[object Number]"===toString.call(e)};Je.each=function(e,t,n){if(null!=e){var i={},r=Array.prototype.forEach;if(r&&e.forEach===r)e.forEach(t,n);else if(e.length===+e.length){for(var o=0,s=e.length;o<s;o++)if(o in e&&t.call(n,e[o],o,e)===i)return}else for(var a in e)if(hasOwnProperty.call(e,a)&&t.call(n,e[a],a,e)===i)return}};Je.buildQuery=function(e,t){var n,i,r=[];void 0===t&&(t="&");Je.each(e,function(e,t){n=encodeURIComponent(e.toString());i=encodeURIComponent(t);r[r.length]=i+"="+n});return r.join(t)};Je.JSONDecode=function(e){if(e){try{return JSON.parse(e)}catch(e){console.error("JSONDecode error",e)}return null}};Je.JSONEncode=function(e){try{return JSON.stringify(e)}catch(e){console.error("JSONEncode error",e)}};var Xe=Object.create(null);function ze(n){a().v("开始构建 fetch body");p.getSystemInfo(function(t){p.getNetworkInfo(function(e){e=(e=(e=e||{}).networkType)===We.MOBILE_NETWORK_NONE?"unknown":e.toUpperCase();Xe.access=e;!function(e,t){var n=e.brand||"";Xe.deviceType="Phone";Xe.sdkVersion=We.SDK_VERSION;Xe.appkey=s().appKey();Xe.sdkType=p.getSdkType();Xe.umid=I().getId();if(e){Xe.language=e.language||"";Xe.os=e.OS;Xe.osVersion=e.OSVersion;Xe.deviceName=e.deviceName;Xe.platformVersion=e.platformVersion;Xe.platformSdkVersion=e.platformSDKVersion;Xe.deviceBrand=n;e=e.resolution.split("*");if(Je.isArray(e)){Xe.resolutionHeight=Number(e[0]);Xe.resolutionWidth=Number(e[1])}}!function(e){if(e){Xe.installTime=e.install_datetime&&Date.parse(e.install_datetime);Xe.scene=e.install_scene;Xe.channel=e.install_channel;Xe.campaign=e.install_campaign}}(Ne.getImpObj());t&&t(Xe)}(t,n)})})}var Qe=Object.create(null),Ze=null,$e=!1,et={minFetchIntervalSeconds:43200};function tt(e){e&&Je.each(e,function(e){Qe[e.k]=e})}function nt(){var t=this;this.STORAGE_NAME=null;c.once(c.messageType.CONFIG_LOADED,function(e){a().v("云配初始化开始...");t.init(e)})}nt.prototype={setDefaultValues:function(e){$e&&Je.isObject(e)&&Je.each(e,function(e,t){Qe[t]&&Qe[t].v||(Qe[t]={v:e})})},getValue:function(t){a().v("从配置项中读取 value, 当前配置为: ",Qe);a().v("待读取的 key : ",t);try{if(!$e)return;var e=Qe[t]||{};a().v("读取相应配置ing..., 结果为: ",e);if(Je.isNumber(e.e)&&Je.isNumber(e.g)){a().v("读取到相应配置, 开始数据上报...");!function(e){var t={appkey:s().appKey(),sdkType:p.getSdkType(),expId:e&&e.e,groupId:e&&e.g,clientTs:Date.now(),key:e&&e.k,value:e&&e.v,umid:I().getId()};try{p.request({url:We.ABLOG_URL,method:"POST",data:[t],success:function(e){e&&200===e.statusCode?a().v("上传数据成功",t):a().w("ablog 请求成功, 返回结果异常 ",e)},fail:function(e){a().w("ablog 请求数据错误 ",t,e)}})}catch(e){a().w("urequest 调用错误",e)}}(e)}return e.v}catch(e){a().w("getValue error, key: ",t)}},active:function(e){try{if(!$e)return;var t,n;e&&e.params&&(t=e.params);e&&e.callback&&(n=e.callback);a().v("激活配置项: ",t);if(t){a().v("本地已缓存的配置项: ",Qe);tt(t);a().v("合并后的配置项: ",Qe);n&&n(Qe);a().v("active 结束")}else{a().v("配置项为空!! 读取本地配置...");p.getStorage(this.STORAGE_NAME,function(e){if(e){tt((e=Je.JSONDecode(e)||{}).params);a().v("当前本地配置项为: ",Qe);n&&n(Qe);a().v("active 结束")}else a().v("当前本地配置项为空, 退出激活")})}}catch(e){a().w("SDK active 错误",e)}},init:function(e){if(e.appKey){Ze=e.appKey;this.STORAGE_NAME="um_remote_config_{{"+Ze+"}}"}if(Ze)if($e)a().w("SDK 已经初始化, 请避免重复初始化");else{$e=!0;this.setOptions(e);this.active()}else a().err("请检查您的小程序 appKey, appKey 不能为空")},setOptions:function(e){if(Je.isObject(e)){e=e.minFetchIntervalSeconds;Je.isNumber(e)&&(et.minFetchIntervalSeconds=Math.max(e,5))}},fetch:function(e){if($e&&this.STORAGE_NAME){var i,r;e&&e.active&&(i=e.active);e&&e.callback&&(r=e.callback);var o=this;p.getStorage(this.STORAGE_NAME,function(e){a().v("开始读缓存 data is ",e);if((e=Je.JSONDecode(e)||{}).params&&e.ts&&Date.now()-e.ts<1e3*et.minFetchIntervalSeconds){a().v("缓存数据存在, 并且本次触发时间距离上次fetch触发时间未超过 fetch 时间间隔, 无需 fetch");r&&r(e.params)}else ze(function(t){a().v("缓存数据不存在, 构建 fetch body :",t);try{p.request({url:We.FETCH_URL,method:"POST",data:t,success:function(e){if(e&&200===e.statusCode&&e.data&&e.data.cc){a().v("fetch 请求成功, 响应数据: ",e.data);var t=Object.create(null);Je.each(e.data.cc,function(e){t[e.k]=e});var n={ts:Date.now(),params:t};a().v("开始缓存 fetch 请求的云配置结果...");p.setStorage(o.STORAGE_NAME,Je.JSONEncode(n),function(e){a().v("缓存云配置成功, 缓存数据为: ",n);a().v("缓存云配置成功, 成功消息为: ",e);a().v("云配拉取数据是否自动激活: ",i);if(e&&i){a().v("激活云配置...");o.active({params:t,callback:r})}})}else{a().w("fetch 请求成功,返回结果异常 ",e.data);r&&r()}},fail:function(e){a().w("fetch请求数据错误 ",t,e);r&&r()}})}catch(e){a().w("urequest调用错误",e)}})})}}};var y={install:function(e,t){e.rc||(e.rc=new nt);e.messager.once(e.messager.messageType.CONFIG_LOADED,function(){e._log.v("plugin rc installed")});return e.rc}},it="",rt={};function ot(e){e&&(it=e)}function st(){return function(e,t){if(!e)return"";var n,i=[];for(n in t)"_um_ssrc"!==n&&"_um_sts"!==n&&i.push(n+"="+t[n]);var r=i.join("&");return r?e+"?"+r:e}(it,rt[it])}function at(e,n){if(e.onShareAppMessage){var i=e.onShareAppMessage;e.onShareAppMessage=function(e){var t=i.call(this,e)||{},e=st();!t.path&&e&&(t.path=e);return n.trackShare.call(this,t)}}}function ut(e,t,n){var i=e[t];e[t]=function(e){n.call(this,e);i&&i.call(this,e)}}function ct(e){try{Ye.resume(e,!0)}catch(e){a().v("onAppShow: ",e)}}function ft(){try{Ye.pause()}catch(e){a().v("onAppHide: ",e)}}function pt(){try{ot(this.route);Ye.trackPageStart(this.route)}catch(e){a().v("onPageShow: ",e)}}function dt(e){try{ot(this.route);e&&(t=this.route,n=e,t&&(rt[t]=n));a().v("Page onLoad: ",this.route,e)}catch(e){a().v("onPageLoad: ",e)}var t,n}function ht(){try{Ye.trackPageEnd(this.route)}catch(e){a().v("onPageHide: ",e)}}try{var lt=App;App=function(e){ut(e,"onLaunch",function(){!function(e){try{Ye.init(e)}catch(e){a().v("onAppLaunch: ",e)}}(e.umengConfig)});ut(e,"onShow",ct);ut(e,"onHide",ft);lt(e)}}catch(e){a().w("App重写异常")}try{var gt=Page;Page=function(e){ut(e,"onShow",pt);ut(e,"onHide",ht);ut(e,"onUnload",ht);ut(e,"onLoad",dt);at(e,Ye);gt(e)}}catch(e){a().w("Page重写异常")}try{var _t=Component;Component=function(t){try{t.methods=t.methods||{};var e=t.methods;ut(e,"onShow",pt);ut(e,"onHide",ht);ut(e,"onUnload",ht);ut(e,"onLoad",dt);at(e,Ye);_t(t)}catch(e){_t(t)}}}catch(e){a().w("Component重写异常")}var vt=Ye.init;Ye.init=function(e){if(e&&e.useOpenid){a().tip_w(a().repeat("!"));a().tip_w("openid已开启,请确保使用setOpenid设置openid或通过设置autoGetOpenid为true,并在友盟后台设置secret由友盟帮您获取");a().tip_w(a().repeat("!"))}vt.call(Ye,e)};Ye.use(y);ks.uma=Ye;module.exports=Ye;