You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

87 lines
182 KiB

2 years ago
/*! For license information please see gtpush-min.js.LICENSE.txt */
(function t(e,r){if("object"===typeof exports&&"object"===typeof module)module.exports=r();else if("function"===typeof define&&define.amd)define([],r);else if("object"===typeof exports)exports["GtPush"]=r();else e["GtPush"]=r()})(self,(()=>(()=>{var t={4736:(t,e,r)=>{t=r.nmd(t);var i;var n=function(t){"use strict";var e=1e7,r=7,i=9007199254740992,s=d(i),a="0123456789abcdefghijklmnopqrstuvwxyz";var o="function"===typeof BigInt;function u(t,e,r,i){if("undefined"===typeof t)return u[0];if("undefined"!==typeof e)return 10===+e&&!r?st(t):X(t,e,r,i);return st(t)}function c(t,e){this.value=t;this.sign=e;this.isSmall=false}c.prototype=Object.create(u.prototype);function l(t){this.value=t;this.sign=t<0;this.isSmall=true}l.prototype=Object.create(u.prototype);function f(t){this.value=t}f.prototype=Object.create(u.prototype);function h(t){return-i<t&&t<i}function d(t){if(t<1e7)return[t];if(t<1e14)return[t%1e7,Math.floor(t/1e7)];return[t%1e7,Math.floor(t/1e7)%1e7,Math.floor(t/1e14)]}function p(t){v(t);var r=t.length;if(r<4&&N(t,s)<0)switch(r){case 0:return 0;case 1:return t[0];case 2:return t[0]+t[1]*e;default:return t[0]+(t[1]+t[2]*e)*e}return t}function v(t){var e=t.length;while(0===t[--e]);t.length=e+1}function g(t){var e=new Array(t);var r=-1;while(++r<t)e[r]=0;return e}function y(t){if(t>0)return Math.floor(t);return Math.ceil(t)}function m(t,r){var i=t.length,n=r.length,s=new Array(i),a=0,o=e,u,c;for(c=0;c<n;c++){u=t[c]+r[c]+a;a=u>=o?1:0;s[c]=u-a*o}while(c<i){u=t[c]+a;a=u===o?1:0;s[c++]=u-a*o}if(a>0)s.push(a);return s}function w(t,e){if(t.length>=e.length)return m(t,e);return m(e,t)}function S(t,r){var i=t.length,n=new Array(i),s=e,a,o;for(o=0;o<i;o++){a=t[o]-s+r;r=Math.floor(a/s);n[o]=a-r*s;r+=1}while(r>0){n[o++]=r%s;r=Math.floor(r/s)}return n}c.prototype.add=function(t){var e=st(t);if(this.sign!==e.sign)return this.subtract(e.negate());var r=this.value,i=e.value;if(e.isSmall)return new c(S(r,Math.abs(i)),this.sign);return new c(w(r,i),this.sign)};c.prototype.plus=c.prototype.add;l.prototype.add=function(t){var e=st(t);var r=this.value;if(r<0!==e.sign)return this.subtract(e.negate());var i=e.value;if(e.isSmall){if(h(r+i))return new l(r+i);i=d(Math.abs(i))}return new c(S(i,Math.abs(r)),r<0)};l.prototype.plus=l.prototype.add;f.prototype.add=function(t){return new f(this.value+st(t).value)};f.prototype.plus=f.prototype.add;function _(t,r){var i=t.length,n=r.length,s=new Array(i),a=0,o=e,u,c;for(u=0;u<n;u++){c=t[u]-a-r[u];if(c<0){c+=o;a=1}else a=0;s[u]=c}for(u=n;u<i;u++){c=t[u]-a;if(c<0)c+=o;else{s[u++]=c;break}s[u]=c}for(;u<i;u++)s[u]=t[u];v(s);return s}function b(t,e,r){var i;if(N(t,e)>=0)i=_(t,e);else{i=_(e,t);r=!r}i=p(i);if("number"===typeof i){if(r)i=-i;return new l(i)}return new c(i,r)}function E(t,r,i){var n=t.length,s=new Array(n),a=-r,o=e,u,f;for(u=0;u<n;u++){f=t[u]+a;a=Math.floor(f/o);f%=o;s[u]=f<0?f+o:f}s=p(s);if("number"===typeof s){if(i)s=-s;return new l(s)}return new c(s,i)}c.prototype.subtract=function(t){var e=st(t);if(this.sign!==e.sign)return this.add(e.negate());var r=this.value,i=e.value;if(e.isSmall)return E(r,Math.abs(i),this.sign);return b(r,i,this.sign)};c.prototype.minus=c.prototype.subtract;l.prototype.subtract=function(t){var e=st(t);var r=this.value;if(r<0!==e.sign)return this.add(e.negate());var i=e.value;if(e.isSmall)return new l(r-i);return E(i,Math.abs(r),r>=0)};l.prototype.minus=l.prototype.subtract;f.prototype.subtract=function(t){return new f(this.value-st(t).value)};f.prototype.minus=f.prototype.subtract;c.prototype.negate=function(){return new c(this.value,!this.sign)};l.prototype.negate=function(){var t=this.sign;var e=new l(-this.value);e.sign=!t;return e};f.prototype.negate=function(){return new f(-this.value)};c.prototype.abs=function(){return new c(this.value,false)};l.prototype.abs=function(){return new l(Math.abs(this.value))};f.prototype.abs=function(){return new f(this.value>=0?this.value:-this.value)};function D(t,r){var i=t.length,n=r.length,s=i+n,a=g(s),o=e,u,c,l,f,h;for(l=0;l<i;++l){f=t[l];for(var d=0;d<n;++d){h=r[d];u=f*h+a[l+d];c=Math.floor(u/o);a[l+d]=u-c*o;a[l+d+1]+=c}}v(a);r
// #ifdef APP-PLUS
t="APP-PLUS";
// #endif
// #ifdef APP-PLUS-NVUE
t="APP-PLUS-NVUE";
// #endif
// #ifdef APP-NVUE
t="APP-NVUE";
// #endif
// #ifdef H5
t="H5";
// #endif
// #ifdef MP-WEIXIN
t="MP-WEIXIN";
// #endif
// #ifdef MP-ALIPAY
t="MP-ALIPAY";
// #endif
// #ifdef MP-BAIDU
t="MP-BAIDU";
// #endif
// #ifdef MP-TOUTIAO
t="MP-TOUTIAO";
// #endif
// #ifdef MP-LARK
t="MP-LARK";
// #endif
// #ifdef MP-QQ
t="MP-QQ";
// #endif
// #ifdef MP-KUAISHOU
t="MP-KUAISHOU";
// #endif
// #ifdef MP-360
t="MP-360";
// #endif
// #ifdef QUICKAPP-WEBVIEW
t="QUICKAPP-WEBVIEW";
// #endif
// #ifdef QUICKAPP-WEBVIEW-UNION
t="QUICKAPP-WEBVIEW-UNION";
// #endif
return t}platformVersion(){return this.systemInfo?this.systemInfo.version:""}platformId(){return this.accountInfo?this.accountInfo.miniProgram.appId:""}language(){return this.systemInfo?.language?this.systemInfo.language:""}userAgent(){return window?window.navigator.userAgent:""}getNetworkType(t){uni.getNetworkType(t)}onNetworkStatusChange(t){uni.onNetworkStatusChange(t)}}e["default"]=r},3072:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:true});class r{set(t){uni.setStorage(t)}setSync(t,e){uni.setStorageSync(t,e)}get(t){uni.getStorage(t)}getSync(t){return uni.getStorageSync(t)}}e["default"]=r},1996:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:true});class r{connect(t){let e=uni.connectSocket(t);return{send:t=>{
// #ifdef MP-ALIPAY
uni.sendSocketMessage(t);
// #endif
// #ifndef MP-ALIPAY
e?.send(t);
// #endif
},close:t=>{
// #ifdef MP-ALIPAY
uni.closeSocket(t);
// #endif
// #ifndef MP-ALIPAY
e?.close(t);
// #endif
},onOpen:t=>{
// #ifdef MP-ALIPAY
uni.onSocketOpen(t);
// #endif
// #ifndef MP-ALIPAY
e?.onOpen(t);
// #endif
},onError:t=>{
// #ifdef MP-ALIPAY
uni.onSocketError(t);
// #endif
// #ifndef MP-ALIPAY
e?.onError(t);
// #endif
},onMessage:t=>{
// #ifdef MP-ALIPAY
uni.onSocketMessage(t);
// #endif
// #ifndef MP-ALIPAY
e?.onMessage(t);
// #endif
},onClose:t=>{
// #ifdef MP-ALIPAY
uni.onSocketClose(t);
// #endif
// #ifndef MP-ALIPAY
e?.onClose(t);
// #endif
}}}}e["default"]=r},9342:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:true});class r{constructor(){this.systemInfo=wx.getSystemInfoSync()}os(){return this.systemInfo.platform}osVersion(){return this.systemInfo.system}model(){return this.systemInfo.model}brand(){return this.systemInfo.brand}platform(){return"MP-WEIXIN"}platformVersion(){return this.systemInfo.version}language(){return this.systemInfo.language}platformId(){if(wx.canIUse("getAccountInfoSync"))return wx.getAccountInfoSync().miniProgram.appId;return""}getNetworkType(t){wx.getNetworkType({success:e=>{t.success?.call(t.success,{networkType:e.networkType})},fail:t.fail})}onNetworkStatusChange(t){wx.onNetworkStatusChange(t)}}e["default"]=r},155:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:true});class r{set(t){wx.setStorage(t)}setSync(t,e){wx.setStorageSync(t,e)}get(t){wx.getStorage(t)}getSync(t){return wx.getStorageSync(t)}}e["default"]=r},3751:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:true});class r{connect(t){let e=wx.connectSocket({url:t.url,header:t.header,protocols:t.protocols,success:t.success,fail:t.fail,complete:t.complete});return{onOpen:e.onOpen,send:e.send,onMessage:e.onMessage,onError:e.onError,onClose:e.onClose,close:e.close}}}e["default"]=r},127:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:true});var r;(function(t){t.SDK_VERSION="GTMP-2.0.1.dcloud";t.DEFAULT_SOCKET_URL="wss://wshz.getui.net:5223/nws";t.SOCKET_PROTOCOL_VERSION="1.0";t.SERVER_PUBLIC_KEY="MHwwDQYJKoZIhvcNAQEBBQADawAwaAJhAJp1rROuvBF7sBSnvLaesj2iFhMcY8aXyLvpnNLKs2wjL3JmEnyr++SlVa35liUlzi83tnAFkn3A9GB7pHBNzawyUkBh8WUhq5bnFIkk2RaDa6+5MpG84DEv52p7RR+aWwIDAQAB";t.SERVER_PUBLIC_KEY_ID="69d747c4b9f641baf4004be4297e9f3b"})(r||(r={}));e["default"]=r},1901:function(t,e,r){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:true});const n=i(r(7071));const s=i(r(1237));const a=i(r(1754));class o{static init(t){if(this.inited)return;try{this.checkAppid(t.appid);this.inited=true;s.default.info(`init: appid=${t.appid}`);a.default.init(t);n.default.connect()}catch(e){this.inited=false;t.onError?.call(t.onError,{error:e});throw e}}static enableSocket(t){this.checkInit();n.default.allowReconnect=t;if(t)n.default.reconnect(0);else n.default.close(`enableSocket ${t}`)}static checkInit(){if(!this.inited)throw new Error(`not init, please invoke init method firstly`)}static checkAppid(t){if(null==t||void 0==t||""==t.trim())throw new Error(`invalid appid ${t}`)}}o.inited=false;e["default"]=o},1754:function(t,e,r){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:true});const n=i(r(323));const s=i(r(9934));const a=i(r(127));const o=i(r(7071));const u=i(r(1237));const c=i(r(5574));const l=i(r(7406));class f{static init(t){this.appid=c.default.to_getui(t.appid);u.default.info(`getui appid: ${this.appid}`);this.onError=t.onError;this.onClientId=t.onClientId;this.onlineState=t.onlineState;this.onPushMsg=t.onPushMsg;if(this.appid!=s.default.getSync(s.default.KEY_APPID,this.appid)){u.default.info("appid changed, clear session and cid");s.default.setSync(s.default.KEY_CID,"");s.default.setSync(s.default.KEY_SESSION,"")}s.default.setSync(s.default.KEY_APPID,this.appid);this.cid=s.default.getSync(s.default.KEY_CID,this.cid);if(this.cid)this.onClientId?.call(this.onClientId,{cid:f.cid});this.session=s.default.getSync(s.default.KEY_SESSION,this.session);this.deviceId=s.default.getSync(s.default.KEY_DEVICE_ID,this.deviceId);this.regId=s.default.getSync(s.default.KEY_REGID,this.regId);if(!this.regId){this.regId=this.createRegId();s.default.set({key:s.default.KEY_REGID,data:this.regId})}this.socketUrl=s.default.getSync(s.default.KEY_SOCKET_URL,this.socketUrl);let e=this;l.default.getNetworkType({success:t=>{e.networkType=t.networkType;e.networkConnected="none"!=e.networkType&&""!=e.networkType}});l.default.onNetworkStatusChange((t=>{e.networkConnected=t.isConnected