zmp-sdk 2.26.0-rc.0 → 2.26.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.
@@ -1 +1 @@
1
- import o from'./../../../external/@swc/helpers/src/_async_to_generator.mjs.js';import s from"../../call/index.js";import{__generator as n}from'./../../../external/tslib/tslib.es6.js';var t=o((function(){return n(this,(function(o){return[2,new Promise((function(o,n){s("PROMPT_AUTHENTICATION_CHECK_STATE",{},{success:function(s){o(null==s?void 0:s.bio_state)},fail:function(o){n(o)}},{})}))]}))}));export{t as default};
1
+ import t from'./../../../external/@swc/helpers/src/_async_to_generator.mjs.js';import o from"../../call/index.js";import{__generator as n}from'./../../../external/tslib/tslib.es6.js';var e=t((function(){return n(this,(function(t){return[2,new Promise((function(t,n){o("PROMPT_AUTHENTICATION_CHECK_STATE",{},{success:function(o){t(null==o?void 0:o.bio_state)},fail:function(t){n(t)}},{actionName:"action.prompt.authentication.check_state"})}))]}))}));export{e as default};
@@ -1 +1 @@
1
- import e from'./../../external/@swc/helpers/src/_async_to_generator.mjs.js';import{APIS as t,RESPONSE_CODE as o,MESSAGES as a}from"../../constants.js";import r from"../../utils/lodash.js";import{MPEEmitter as n,onActionMessage as i,fireActionMessage as s}from"../eventEmitter.js";import{parseJSON as l,checkIOSSupportAction as c,serialize as u}from"../../utils/common.js";import m from"../token.js";import d from"../../utils/request.js";import p from"../../appEnv/getEnv.js";import{__generator as f}from'./../../external/tslib/tslib.es6.js';import{Events as v}from"../../types/enum.js";var _,g,I,T,h,b,w,M=(I=function(e){try{var o=e.map((function(e){return{action:e.action,error:e.error,message:e.message,data:e.data}}));d.execute(t.SEND_ACTION_LOG,"post",{appId:window.APP_ID,data:JSON.stringify(o)},(function(e){})),window.zmpSentry&&window.zmpSentry.captureMessage("Result from native",{extra:{data:e}})}catch(e){}},T=p(),h={},b=n.getInstance(),w=[],!1||(i((function(e){var t=e.serialId,o=l(e.result);if(t&&h[t]){var a=h[t],n=a.callback,i=a.timeout,s=a.isMultiCallback,c=a.options;!function(e,t){var o=t||{},a=o.success,n=o.fail;0===e.error_code?r.isFunction(a)&&a(e):r.isFunction(n)&&n(e)}(o,n),!s&&delete h[t],i&&clearTimeout(i);var u={action:null==o?void 0:o.action,error:null==o?void 0:o.error_code,message:null==o?void 0:o.error_message,data:{}};try{if("action.open.inapp"===o.action||"action.open.outapp"===o.action){var m=new URL(null==c?void 0:c.url),d="".concat(m.protocol,"//").concat(m.host).concat(m.pathname);u.data={url:d}}}catch(e){}w.push(u)}})),b.on(v.AppPaused,(function(){if(w.length>0){var e=w;w=[],I(e)}})),_?clearInterval(_):_=setInterval((function(){if(w.length>0){var e=w;w=[],I(e)}}),5e3),!0),g=e((function(e,t,n,i){var l,d,p,v,_,g,I,b,w,M,j,k,O,S,C,N,y;return f(this,(function(f){switch(f.label){case 0:return d=Math.floor(1e6*Math.random()),p="".concat(e,"_").concat(d),v="action.".concat(e.replace(/\_/g,".").toLowerCase()),_=(null==i?void 0:i.isMultiCallback)||!1,g=!1!==(null==i?void 0:i.timeout)&&((null==i?void 0:i.timeout)||!0),I=(null==i?void 0:i.haveActionCallback)||!1,b=(null==i?void 0:i.skipJump)||!1,w=(null==i?void 0:i.requireAccessToken)||!1,t&&n&&(h[p]={options:t,callback:n,isMultiCallback:_},g&&I&&(h[p].timeout=setTimeout((function(){var t={serialId:p,result:{error_code:o.TIME_OUT,error_message:a.TIME_OUT,data:{timeout:g},action:e}};s(t)}),!0===g?8e3:1e3*g))),!(null==T||null===(l=T.platform)||void 0===l?void 0:l.isMobile)||!e||r.isUndefined(ZaloJavaScriptInterface)||T.platform.isIOS&&!c(e)?(j={serialId:p,result:{error_code:o.CLIENT_NOT_SUPPORT,error_message:a.CLIENT_NOT_SUPPORT,data:{isMobile:null==T||null===(M=T.platform)||void 0===M?void 0:M.isMobile},action:e}},s(j),[2]):(k=u(t),b?[3,2]:[4,m.getJSAccessToken()]);case 1:return S=f.sent(),[3,3];case 2:S="",f.label=3;case 3:return O=S,b||!w?[3,5]:[4,m.getAccessToken()];case 4:return N=f.sent(),[3,6];case 5:N="",f.label=6;case 6:return C=N,y=T.platform.isIOS?window.onNativeMessage(p):"window.onNativeMessage('".concat(p,"')"),[2,ZaloJavaScriptInterface.jsCall(O,v,C,k,y)]}}))})),function(e,t,o,a){return g.apply(this,arguments)});export{M as default};
1
+ import o from'./../../external/@swc/helpers/src/_async_to_generator.mjs.js';import{RESPONSE_CODE as e,MESSAGES as t}from"../../constants.js";import a from"../../utils/lodash.js";import{MPEEmitter as n,onActionMessage as i,fireActionMessage as r}from"../eventEmitter.js";import{parseJSON as l,checkIOSSupportAction as s,serialize as c}from"../../utils/common.js";import u from"../token.js";import{sendLogData as m}from"../utils.js";import d from"../../appEnv/getEnv.js";import{__generator as p}from'./../../external/tslib/tslib.es6.js';import{Events as v}from"../../types/enum.js";var f,_,g,h,T,b,I=(g=d(),h={},T=n.getInstance(),b=[],!1||(i((function(o){var e=o.serialId,t=l(o.result);if(e&&h[e]){var n=h[e],i=n.callback,r=n.timeout,s=n.isMultiCallback,c=n.options;!function(o,e){var t=e||{},n=t.success,i=t.fail;0===o.error_code?a.isFunction(n)&&n(o):a.isFunction(i)&&i(o)}(t,i),!s&&delete h[e],r&&clearTimeout(r);var u={action:null==t?void 0:t.action,error:null==t?void 0:t.error_code,message:null==t?void 0:t.error_message,data:{}};try{if("action.open.inapp"===t.action||"action.open.outapp"===t.action){var m=new URL(null==c?void 0:c.url),d="".concat(m.protocol,"//").concat(m.host).concat(m.pathname);u.data={url:d}}}catch(o){}b.push(u)}})),T.on(v.AppPaused,(function(){if(b.length>0){var o=b;b=[],m(o)}})),f?clearInterval(f):f=setInterval((function(){if(b.length>0){var o=b;b=[],m(o)}}),5e3),!0),_=o((function(o,n,i,l){var m,d,v,f,_,T,b,I,j,M,k,N,w,C,O,E,S;return p(this,(function(p){switch(p.label){case 0:return d=Math.floor(1e6*Math.random()),v="".concat(o,"_").concat(d),f="action.".concat(o.replace(/\_/g,".").toLowerCase()),(null==l?void 0:l.actionName)&&l.actionName.length>0&&(f=null==l?void 0:l.actionName),_=(null==l?void 0:l.isMultiCallback)||!1,T=!1!==(null==l?void 0:l.timeout)&&((null==l?void 0:l.timeout)||!0),b=(null==l?void 0:l.haveActionCallback)||!1,I=(null==l?void 0:l.skipJump)||!1,j=(null==l?void 0:l.requireAccessToken)||!1,n&&i&&(h[v]={options:n,callback:i,isMultiCallback:_},T&&b&&(h[v].timeout=setTimeout((function(){var a={serialId:v,result:{error_code:e.TIME_OUT,error_message:t.TIME_OUT,data:{timeout:T},action:o}};r(a)}),!0===T?8e3:1e3*T))),!(null==g||null===(m=g.platform)||void 0===m?void 0:m.isMobile)||!o||a.isUndefined(ZaloJavaScriptInterface)||g.platform.isIOS&&!s(o)?(k={serialId:v,result:{error_code:e.CLIENT_NOT_SUPPORT,error_message:t.CLIENT_NOT_SUPPORT,data:{isMobile:null==g||null===(M=g.platform)||void 0===M?void 0:M.isMobile},action:o}},r(k),[2]):(N=c(n),I?[3,2]:[4,u.getJSAccessToken()]);case 1:return C=p.sent(),[3,3];case 2:C="",p.label=3;case 3:return w=C,I||!j?[3,5]:[4,u.getAccessToken()];case 4:return E=p.sent(),[3,6];case 5:E="",p.label=6;case 6:return O=E,S=g.platform.isIOS?window.onNativeMessage(v):"window.onNativeMessage('".concat(v,"')"),[2,ZaloJavaScriptInterface.jsCall(w,f,O,N,S)]}}))})),function(o,e,t,a){return _.apply(this,arguments)});export{I as default};
@@ -1 +1 @@
1
- import e from'./../external/@swc/helpers/src/_async_to_generator.mjs.js';import n from'./../external/@swc/helpers/src/_class_call_check.mjs.js';import s from'./../external/@swc/helpers/src/_create_class.mjs.js';import t from'./../external/@swc/helpers/src/_object_spread.mjs.js';import o from"../utils/lodash.js";import{COOKIE_NAME as r,APIS as c,APP_ID as i,ZAPP_ID as a,ApiCallStage as u,MINI_APP_INTERNAL_LINK as l}from"../constants.js";import{logger as p}from"./logger.js";import f from"./call/zaloNative.js";import{apiResponse as h}from"../utils/response.js";import{__generator as m}from'./../external/tslib/tslib.es6.js';import{JumpStatus as d}from"../types/enum.js";var _=function(){function _(){n(this,_),this._jumpStatus=void 0,this.WAITING_QUEUE=[],this.getAccessTokenCount=0,this._accessToken="",this._jsAccessToken="",this.refreshToken="",this._cookies=[],this.accessTokenExpiresIn=0,this.prevGetAccessTokenTimestamp=(new Date).getTime(),this.manualSetAccessToken=!1}var T=_.prototype;return T.jump=function(){var n=this;return e((function(){return m(this,(function(e){return[2,new Promise((function(e,s){n._jumpStatus?n._jumpStatus===d.DONE?e(d.DONE):e(d.DOING):(n._jumpStatus=d.DOING,p({stage:u.REQUEST,type:"log",name:"jump"}),f("JUMP_LOGIN",{},{success:function(s){var t=s.data,o=(null==t?void 0:t.cookiesOAuthLogins)||[],c=o.find((function(e){return e.name===r.JS_TOKEN}));c&&(n._jsAccessToken=c.value,window.ZJSBridge.setJSToken&&window.ZJSBridge.setJSToken(c.value)),n._cookies=o,e(d.DONE)},fail:function(e){s(e)}},{skipJump:!0}))}))]}))}))()},T.loginZaloV3=function(n,s,t){var o=this;return e((function(){var r;return m(this,(function(i){switch(i.label){case 0:return r="".concat(c.GET_ACCESS_TOKEN_V3,"?app_id=").concat(s,"&redirect_uri=").concat(l,"/").concat(n,"/&code=").concat(t,"&isSDK=true"),[4,fetch(r).then((a=e((function(e){var n,s,t;return m(this,(function(r){switch(r.label){case 0:return[4,e.json()];case 1:return n=r.sent(),s=null==n?void 0:n.access_token,o._accessToken=s,t=1e3*parseInt(n.expires_in),o.accessTokenExpiresIn=t,o.prevGetAccessTokenTimestamp=(new Date).getTime(),window.ZJSBridge.setZAccSession&&window.ZJSBridge.setZAccSession(o._accessToken||""),[2,s]}}))})),function(e){return a.apply(this,arguments)}))];case 1:return[2,i.sent()]}var a}))}))()},T.loginZaloV4=function(n){var s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",i=this;return e((function(){var a,u;return m(this,(function(l){switch(l.label){case 0:return(a=new URLSearchParams).append("app_id",n),a.append("code",s),a.append("code_verifier",r),o.isNull(i.refreshToken)||0===i.refreshToken.length?a.append("grant_type","authorization_code"):(a.append("grant_type","refresh_token"),a.append("refresh_token",i.refreshToken||"")),u={headers:{"Content-Type":"application/x-www-form-urlencoded"}},[4,fetch(c.GET_ACCESS_TOKEN,t({method:"POST",body:a},u)).then((p=e((function(e){var n,s,t,o;return m(this,(function(r){switch(r.label){case 0:return[4,e.json()];case 1:return n=r.sent(),s=(null==n?void 0:n.access_token)||"",t=(null==n?void 0:n.refresh_token)||"",i.refreshToken=t,i._accessToken=s,o=1e3*parseInt(null==n?void 0:n.expires_in),i.accessTokenExpiresIn=o,i.prevGetAccessTokenTimestamp=(new Date).getTime(),window.ZJSBridge.setZAccSession&&window.ZJSBridge.setZAccSession(s),[2,s]}}))})),function(e){return p.apply(this,arguments)}))];case 1:return[2,l.sent()]}var p}))}))()},T.getAccessToken=function(){var n=this;return e((function(){var s,t,o,c,u;function l(){return p.apply(this,arguments)}function p(){return(p=e((function(){return m(this,(function(e){switch(e.label){case 0:return[4,new Promise((function(e){var n=setInterval((function(){(t.getAccessTokenCount<=1||t._accessToken)&&(e("done"),clearInterval(n))}),200)}))];case 1:return[2,e.sent()]}}))}))).apply(this,arguments)}return m(this,(function(e){switch(e.label){case 0:return s=(new Date).getTime()-n.prevGetAccessTokenTimestamp,(t=n).getAccessTokenCount++,n.getAccessTokenCount>1?[4,l()]:[3,2];case 1:e.sent(),e.label=2;case 2:return n.manualSetAccessToken||n._accessToken.length>0&&s<n.accessTokenExpiresIn?(t.getAccessTokenCount--,[2,Promise.resolve(n._accessToken)]):(n.accessToken="",[4,n.get(r.ZOAUTH)]);case 3:return o=e.sent(),[4,n.get(r.ZOAUTH_VRF)];case 4:if(c=e.sent(),!o)return[3,12];e.label=5;case 5:return e.trys.push([5,10,,11]),c?[4,n.loginZaloV4(i,o,c)]:[3,7];case 6:return e.sent(),[3,9];case 7:return[4,n.loginZaloV3(i,a,o)];case 8:e.sent(),e.label=9;case 9:return[3,11];case 10:return u=e.sent(),console.log("Can not get access token",u),[3,11];case 11:return t.getAccessTokenCount--,[2,Promise.resolve(n._accessToken)];case 12:throw t.getAccessTokenCount--,h.error.loginFailed("Zalo app has not been activated")}}))}))()},T.setAccessToken=function(e){this.manualSetAccessToken=!0,this._accessToken=e,window.ZJSBridge.setZAccSession&&window.ZJSBridge.setZAccSession(e)},T.getJSAccessToken=function(){var n=this;return e((function(){var e;return m(this,(function(s){switch(s.label){case 0:return n._jsAccessToken.length>0?[2,Promise.resolve(n._jsAccessToken)]:[4,n.get(r.JS_TOKEN)];case 1:return e=s.sent(),[2,Promise.resolve(e)]}}))}))()},T.getSync=function(e){var n;return null===(n=this._cookies.find((function(n){return n.name===e})))||void 0===n?void 0:n.value},T.get=function(n){var s,t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],o=this;return new Promise((s=e((function(e){var s,r,c,i;return m(this,(function(a){switch(a.label){case 0:return!t&&o._cookies.length>0?(s=o._cookies.find((function(e){return e.name===n})),[2,e(null==s?void 0:s.value)]):(t&&o._jumpStatus===d.DONE&&(o._jumpStatus=void 0),r={name:n,cb:function(n){return e(n)}},[4,o.jump()]);case 1:return(c=a.sent())===d.DONE?(o._jumpStatus=c,o.WAITING_QUEUE.length&&(o.WAITING_QUEUE.forEach((function(e){var n=o._cookies.find((function(n){return n.name===e.name}));e.cb(null==n?void 0:n.value)})),o.WAITING_QUEUE=[]),i=o._cookies.find((function(e){return e.name===r.name})),r.cb(null==i?void 0:i.value)):o.WAITING_QUEUE.push(r),[2]}}))})),function(e){return s.apply(this,arguments)}))},_.getInstance=function(){return _.instance||(_.instance=new _),_.instance},s(_,[{key:"jumpStatus",get:function(){return this._jumpStatus}},{key:"accessToken",set:function(e){this._accessToken=e,window.ZJSBridge.setZAccSession&&window.ZJSBridge.setZAccSession(e)}}]),_}(),T=_.getInstance();export{T as default};
1
+ import e from'./../external/@swc/helpers/src/_async_to_generator.mjs.js';import n from'./../external/@swc/helpers/src/_class_call_check.mjs.js';import s from'./../external/@swc/helpers/src/_create_class.mjs.js';import t from'./../external/@swc/helpers/src/_object_spread.mjs.js';import o from"../utils/lodash.js";import{COOKIE_NAME as r,APIS as c,APP_ID as i,ZAPP_ID as a,ApiCallStage as u,MINI_APP_INTERNAL_LINK as l}from"../constants.js";import{logger as m}from"./logger.js";import p from"./call/zaloNative.js";import{apiResponse as f}from"../utils/response.js";import{sendLogData as d}from"./utils.js";import{__generator as h}from'./../external/tslib/tslib.es6.js';import{JumpStatus as T}from"../types/enum.js";var _=function(){function _(){n(this,_),this._jumpStatus=void 0,this.WAITING_QUEUE=[],this.getAccessTokenCount=0,this._accessToken="",this._jsAccessToken="",this.refreshToken="",this._cookies=[],this.accessTokenExpiresIn=0,this.prevGetAccessTokenTimestamp=(new Date).getTime(),this.manualSetAccessToken=!1}var k=_.prototype;return k.jump=function(){var n=this;return e((function(){return h(this,(function(e){return[2,new Promise((function(e,s){n._jumpStatus?n._jumpStatus===T.DONE?e(T.DONE):e(T.DOING):(n._jumpStatus=T.DOING,m({stage:u.REQUEST,type:"log",name:"jump"}),p("JUMP_LOGIN",{},{success:function(s){var t=s.data,o=(null==t?void 0:t.cookiesOAuthLogins)||[],c=o.find((function(e){return e.name===r.JS_TOKEN}));c&&(n._jsAccessToken=c.value,window.ZJSBridge.setJSToken&&window.ZJSBridge.setJSToken(c.value)),n._cookies=o;var i=n._cookies.find((function(e){return e.name===r.ZOAUTH}));(null==i?void 0:i.value)||d([{action:"action.jump.login",error:-102,message:"no zoauth",data:{}}]),e(T.DONE)},fail:function(e){d([{action:"action.jump.login",error:-101,message:e.message||"jump error",data:{}}]),s(e)}},{skipJump:!0}))}))]}))}))()},k.loginZaloV3=function(n,s,t){var o=this;return e((function(){var r;return h(this,(function(i){switch(i.label){case 0:return r="".concat(c.GET_ACCESS_TOKEN_V3,"?app_id=").concat(s,"&redirect_uri=").concat(l,"/").concat(n,"/&code=").concat(t,"&isSDK=true"),[4,fetch(r).then((a=e((function(e){var n,s,t;return h(this,(function(r){switch(r.label){case 0:return[4,e.json()];case 1:return n=r.sent(),s=null==n?void 0:n.access_token,o._accessToken=s,t=1e3*parseInt(n.expires_in),o.accessTokenExpiresIn=t,o.prevGetAccessTokenTimestamp=(new Date).getTime(),window.ZJSBridge.setZAccSession&&window.ZJSBridge.setZAccSession(o._accessToken||""),[2,s]}}))})),function(e){return a.apply(this,arguments)}))];case 1:return[2,i.sent()]}var a}))}))()},k.loginZaloV4=function(n){var s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",i=this;return e((function(){var a,u;return h(this,(function(l){switch(l.label){case 0:return(a=new URLSearchParams).append("app_id",n),a.append("code",s),a.append("code_verifier",r),o.isNull(i.refreshToken)||0===i.refreshToken.length?a.append("grant_type","authorization_code"):(a.append("grant_type","refresh_token"),a.append("refresh_token",i.refreshToken||"")),u={headers:{"Content-Type":"application/x-www-form-urlencoded"}},[4,fetch(c.GET_ACCESS_TOKEN,t({method:"POST",body:a},u)).then((m=e((function(e){var n,s,t,o;return h(this,(function(r){switch(r.label){case 0:return[4,e.json()];case 1:return n=r.sent(),s=(null==n?void 0:n.access_token)||"",t=(null==n?void 0:n.refresh_token)||"",i.refreshToken=t,i._accessToken=s,o=1e3*parseInt(null==n?void 0:n.expires_in),i.accessTokenExpiresIn=o,i.prevGetAccessTokenTimestamp=(new Date).getTime(),window.ZJSBridge.setZAccSession&&window.ZJSBridge.setZAccSession(s),[2,s]}}))})),function(e){return m.apply(this,arguments)}))];case 1:return[2,l.sent()]}var m}))}))()},k.getAccessToken=function(){var n=this;return e((function(){var s,t,o,c,u,l;function m(){return p.apply(this,arguments)}function p(){return(p=e((function(){return h(this,(function(e){switch(e.label){case 0:return[4,new Promise((function(e){var n=setInterval((function(){(t.getAccessTokenCount<=1||t._accessToken)&&(e("done"),clearInterval(n))}),200)}))];case 1:return[2,e.sent()]}}))}))).apply(this,arguments)}return h(this,(function(e){switch(e.label){case 0:return s=(new Date).getTime()-n.prevGetAccessTokenTimestamp,(t=n).getAccessTokenCount++,n.getAccessTokenCount>1?[4,m()]:[3,2];case 1:e.sent(),e.label=2;case 2:return n.manualSetAccessToken||n._accessToken.length>0&&s<n.accessTokenExpiresIn?(t.getAccessTokenCount--,[2,Promise.resolve(n._accessToken)]):(n.accessToken="",[4,n.get(r.ZOAUTH)]);case 3:return o=e.sent(),[4,n.get(r.ZOAUTH_VRF)];case 4:if(c=e.sent(),!o)return[3,12];e.label=5;case 5:return e.trys.push([5,10,,11]),c?[4,n.loginZaloV4(i,o,c)]:[3,7];case 6:return u=e.sent(),[3,9];case 7:return[4,n.loginZaloV3(i,a,o)];case 8:u=e.sent(),e.label=9;case 9:return[3,11];case 10:return l=e.sent(),u="",console.log("Can not get access token",l),d([{action:"getAccessToken",error:-103,message:String(l)||"Can not get access token",data:{}}]),[3,11];case 11:return t.getAccessTokenCount--,u||d([{action:"getAccessToken",error:-101,message:"no accessToken",data:{}}]),[2,Promise.resolve(n._accessToken)];case 12:throw t.getAccessTokenCount--,d([{action:"getAccessToken",error:-102,message:"no oauth",data:{}}]),f.error.loginFailed("Zalo app has not been activated")}}))}))()},k.setAccessToken=function(e){this.manualSetAccessToken=!0,this._accessToken=e,window.ZJSBridge.setZAccSession&&window.ZJSBridge.setZAccSession(e)},k.getJSAccessToken=function(){var n=this;return e((function(){var e;return h(this,(function(s){switch(s.label){case 0:return n._jsAccessToken.length>0?[2,Promise.resolve(n._jsAccessToken)]:[4,n.get(r.JS_TOKEN)];case 1:return e=s.sent(),[2,Promise.resolve(e)]}}))}))()},k.getSync=function(e){var n;return null===(n=this._cookies.find((function(n){return n.name===e})))||void 0===n?void 0:n.value},k.get=function(n){var s,t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],o=this;return new Promise((s=e((function(e){var s,r,c,i;return h(this,(function(a){switch(a.label){case 0:return!t&&o._cookies.length>0?(s=o._cookies.find((function(e){return e.name===n})),[2,e(null==s?void 0:s.value)]):(t&&o._jumpStatus===T.DONE&&(o._jumpStatus=void 0),r={name:n,cb:function(n){return e(n)}},[4,o.jump()]);case 1:return(c=a.sent())===T.DONE?(o._jumpStatus=c,o.WAITING_QUEUE.length&&(o.WAITING_QUEUE.forEach((function(e){var n=o._cookies.find((function(n){return n.name===e.name}));e.cb(null==n?void 0:n.value)})),o.WAITING_QUEUE=[]),i=o._cookies.find((function(e){return e.name===r.name})),r.cb(null==i?void 0:i.value)):o.WAITING_QUEUE.push(r),[2]}}))})),function(e){return s.apply(this,arguments)}))},_.getInstance=function(){return _.instance||(_.instance=new _),_.instance},s(_,[{key:"jumpStatus",get:function(){return this._jumpStatus}},{key:"accessToken",set:function(e){this._accessToken=e,window.ZJSBridge.setZAccSession&&window.ZJSBridge.setZAccSession(e)}}]),_}(),k=_.getInstance();export{k as default};
@@ -1 +1 @@
1
- import r from'./../external/@swc/helpers/src/_async_to_generator.mjs.js';import t from"../utils/query-string.js";import{APIS as e}from"../constants.js";import o from"../utils/lodash.js";import{__generator as s}from'./../external/tslib/tslib.es6.js';var n,a=(n=r((function(r,n,a){var i,d,l,p;return s(this,(function(s){switch(s.label){case 0:return i={appId:r,versionStatus:n},o.isUndefined(a)||(i.currentVersion=a),d=t.appendToUrl(e.GET_APP_INFO,i),[4,fetch(d,{credentials:"include"})];case 1:return(l=s.sent()).ok?[4,l.json()]:[3,3];case 2:if((p=s.sent()).err<0||!p.data)throw new Error(p);return[2,{name:p.data.name,version:p.data.version,description:p.data.description,appUrl:p.data.appUrl,qrCodeUrl:p.data.qrCodeUrl,logoUrl:p.data.logoUrl}];case 3:throw new Error("Can't get app info")}}))})),function(r,t,e){return n.apply(this,arguments)});export{a as getAppInfo};
1
+ import r from'./../external/@swc/helpers/src/_async_to_generator.mjs.js';import t from"../utils/query-string.js";import{APIS as e}from"../constants.js";import a from"../utils/lodash.js";import o from"../utils/request.js";import{__generator as n}from'./../external/tslib/tslib.es6.js';var s,i=(s=r((function(r,o,s){var i,d,p,c;return n(this,(function(n){switch(n.label){case 0:return i={appId:r,versionStatus:o},a.isUndefined(s)||(i.currentVersion=s),d=t.appendToUrl(e.GET_APP_INFO,i),[4,fetch(d,{credentials:"include"})];case 1:return(p=n.sent()).ok?[4,p.json()]:[3,3];case 2:if((c=n.sent()).err<0||!c.data)throw new Error(c);return[2,{name:c.data.name,version:c.data.version,description:c.data.description,appUrl:c.data.appUrl,qrCodeUrl:c.data.qrCodeUrl,logoUrl:c.data.logoUrl}];case 3:throw new Error("Can't get app info")}}))})),function(r,t,e){return s.apply(this,arguments)});function d(r){try{var t=r.map((function(r){return{action:r.action,error:r.error,message:r.message,data:r.data}}));o.execute(e.SEND_ACTION_LOG,"post",{appId:window.APP_ID,data:JSON.stringify(t)},(function(r){})),window.zmpSentry&&window.zmpSentry.captureMessage("Result from native",{extra:{data:r}})}catch(r){}}export{i as getAppInfo,d as sendLogData};
@@ -1 +1 @@
1
- var r="2.26.0-rc.0";export{r as version};
1
+ var r="2.26.0";export{r as version};