zmp-sdk 2.23.3 → 2.23.4-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/index.umd.js CHANGED
@@ -12,4 +12,4 @@
12
12
  LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
13
13
  OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
14
14
  PERFORMANCE OF THIS SOFTWARE.
15
- ***************************************************************************** */function t(e,t,i,n){var o,r=arguments.length,a=r<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,n);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(r<3?o(a):r>3?o(t,i,a):o(t,i))||a);return r>3&&a&&Object.defineProperty(t,i,a),a}function i(e,t){return function(i,n){t(i,n,e)}}function n(e,t,i,n){return new(i||(i=Promise))((function(o,r){function a(e){try{c(n.next(e))}catch(e){r(e)}}function s(e){try{c(n.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(a,s)}c((n=n.apply(e,t||[])).next())}))}function o(e,t,i,n){if("a"===i&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===i?n:"a"===i?n.call(e):n?n.value:t.get(e)}function r(e,t,i,n,o){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!o)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!o:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?o.call(e,i):o?o.value=i:t.set(e,i),i}var a=Object.prototype;var s=function(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||a)};var c=function(e,t){return function(i){return e(t(i))}}(Object.keys,Object),l=Object.prototype.hasOwnProperty;var d=function(e){if(!s(e))return c(e);var t=[];for(var i in Object(e))l.call(e,i)&&"constructor"!=i&&t.push(i);return t},u="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function h(e,t){return e(t={exports:{}},t.exports),t.exports}var p="object"==typeof u&&u&&u.Object===Object&&u,v="object"==typeof self&&self&&self.Object===Object&&self,f=p||v||Function("return this")(),g=f.Symbol,m=Object.prototype,y=m.hasOwnProperty,_=m.toString,S=g?g.toStringTag:void 0;var E=function(e){var t=y.call(e,S),i=e[S];try{e[S]=void 0;var n=!0}catch(e){}var o=_.call(e);return n&&(t?e[S]=i:delete e[S]),o},O=Object.prototype.toString;var A=function(e){return O.call(e)},T=g?g.toStringTag:void 0;var b=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":T&&T in Object(e)?E(e):A(e)};var C=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)};var w,N=function(e){if(!C(e))return!1;var t=b(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t},I=f["__core-js_shared__"],P=(w=/[^.]+$/.exec(I&&I.keys&&I.keys.IE_PROTO||""))?"Symbol(src)_1."+w:"";var k=function(e){return!!P&&P in e},D=Function.prototype.toString;var R=function(e){if(null!=e){try{return D.call(e)}catch(e){}try{return e+""}catch(e){}}return""},B=/^\[object .+?Constructor\]$/,j=Function.prototype,U=Object.prototype,M=j.toString,L=U.hasOwnProperty,x=RegExp("^"+M.call(L).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");var W=function(e){return!(!C(e)||k(e))&&(N(e)?x:B).test(R(e))};var z=function(e,t){return null==e?void 0:e[t]};var J=function(e,t){var i=z(e,t);return W(i)?i:void 0},F=J(f,"DataView"),K=J(f,"Map"),H=J(f,"Promise"),G=J(f,"Set"),$=J(f,"WeakMap"),V="[object Map]",Z="[object Promise]",q="[object Set]",Y="[object WeakMap]",Q="[object DataView]",X=R(F),ee=R(K),te=R(H),ie=R(G),ne=R($),oe=b;(F&&oe(new F(new ArrayBuffer(1)))!=Q||K&&oe(new K)!=V||H&&oe(H.resolve())!=Z||G&&oe(new G)!=q||$&&oe(new $)!=Y)&&(oe=function(e){var t=b(e),i="[object Object]"==t?e.constructor:void 0,n=i?R(i):"";if(n)switch(n){case X:return Q;case ee:return V;case te:return Z;case ie:return q;case ne:return Y}return t});var re=oe;var ae=function(e){return null!=e&&"object"==typeof e};var se=function(e){return ae(e)&&"[object Arguments]"==b(e)},ce=Object.prototype,le=ce.hasOwnProperty,de=ce.propertyIsEnumerable,ue=se(function(){return arguments}())?se:function(e){return ae(e)&&le.call(e,"callee")&&!de.call(e,"callee")},he=Array.isArray;var pe=function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991};var ve=function(e){return null!=e&&pe(e.length)&&!N(e)};var fe=function(){return!1},ge=h((function(e,t){var i=t&&!t.nodeType&&t,n=i&&e&&!e.nodeType&&e,o=n&&n.exports===i?f.Buffer:void 0,r=(o?o.isBuffer:void 0)||fe;e.exports=r})),me={};me["[object Float32Array]"]=me["[object Float64Array]"]=me["[object Int8Array]"]=me["[object Int16Array]"]=me["[object Int32Array]"]=me["[object Uint8Array]"]=me["[object Uint8ClampedArray]"]=me["[object Uint16Array]"]=me["[object Uint32Array]"]=!0,me["[object Arguments]"]=me["[object Array]"]=me["[object ArrayBuffer]"]=me["[object Boolean]"]=me["[object DataView]"]=me["[object Date]"]=me["[object Error]"]=me["[object Function]"]=me["[object Map]"]=me["[object Number]"]=me["[object Object]"]=me["[object RegExp]"]=me["[object Set]"]=me["[object String]"]=me["[object WeakMap]"]=!1;var ye=function(e){return ae(e)&&pe(e.length)&&!!me[b(e)]};var _e=function(e){return function(t){return e(t)}},Se=h((function(e,t){var i=t&&!t.nodeType&&t,n=i&&e&&!e.nodeType&&e,o=n&&n.exports===i&&p.process,r=function(){try{var e=n&&n.require&&n.require("util").types;return e||o&&o.binding&&o.binding("util")}catch(e){}}();e.exports=r})),Ee=Se&&Se.isTypedArray,Oe=Ee?_e(Ee):ye,Ae=Object.prototype.hasOwnProperty;var Te=function(e){if(null==e)return!0;if(ve(e)&&(he(e)||"string"==typeof e||"function"==typeof e.splice||ge(e)||Oe(e)||ue(e)))return!e.length;var t=re(e);if("[object Map]"==t||"[object Set]"==t)return!e.size;if(s(e))return!d(e).length;for(var i in e)if(Ae.call(e,i))return!1;return!0};var be=function(e){return void 0===e};var Ce=function(e){return null===e};var we=function(e){return"string"==typeof e||!he(e)&&ae(e)&&"[object String]"==b(e)};var Ne=function(e){return"number"==typeof e||ae(e)&&"[object Number]"==b(e)};var Ie=function(e){return ae(e)&&"[object RegExp]"==b(e)},Pe=Se&&Se.isRegExp,ke=Pe?_e(Pe):Ie;var De=function(e){return"symbol"==typeof e||ae(e)&&"[object Symbol]"==b(e)},Re=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Be=/^\w*$/;var je=function(e,t){if(he(e))return!1;var i=typeof e;return!("number"!=i&&"symbol"!=i&&"boolean"!=i&&null!=e&&!De(e))||(Be.test(e)||!Re.test(e)||null!=t&&e in Object(t))},Ue=J(Object,"create");var Me=function(){this.__data__=Ue?Ue(null):{},this.size=0};var Le=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},xe=Object.prototype.hasOwnProperty;var We=function(e){var t=this.__data__;if(Ue){var i=t[e];return"__lodash_hash_undefined__"===i?void 0:i}return xe.call(t,e)?t[e]:void 0},ze=Object.prototype.hasOwnProperty;var Je=function(e){var t=this.__data__;return Ue?void 0!==t[e]:ze.call(t,e)};var Fe=function(e,t){var i=this.__data__;return this.size+=this.has(e)?0:1,i[e]=Ue&&void 0===t?"__lodash_hash_undefined__":t,this};function Ke(e){var t=-1,i=null==e?0:e.length;for(this.clear();++t<i;){var n=e[t];this.set(n[0],n[1])}}Ke.prototype.clear=Me,Ke.prototype.delete=Le,Ke.prototype.get=We,Ke.prototype.has=Je,Ke.prototype.set=Fe;var He=Ke;var Ge=function(){this.__data__=[],this.size=0};var $e=function(e,t){return e===t||e!=e&&t!=t};var Ve=function(e,t){for(var i=e.length;i--;)if($e(e[i][0],t))return i;return-1},Ze=Array.prototype.splice;var qe=function(e){var t=this.__data__,i=Ve(t,e);return!(i<0)&&(i==t.length-1?t.pop():Ze.call(t,i,1),--this.size,!0)};var Ye=function(e){var t=this.__data__,i=Ve(t,e);return i<0?void 0:t[i][1]};var Qe=function(e){return Ve(this.__data__,e)>-1};var Xe=function(e,t){var i=this.__data__,n=Ve(i,e);return n<0?(++this.size,i.push([e,t])):i[n][1]=t,this};function et(e){var t=-1,i=null==e?0:e.length;for(this.clear();++t<i;){var n=e[t];this.set(n[0],n[1])}}et.prototype.clear=Ge,et.prototype.delete=qe,et.prototype.get=Ye,et.prototype.has=Qe,et.prototype.set=Xe;var tt=et;var it=function(){this.size=0,this.__data__={hash:new He,map:new(K||tt),string:new He}};var nt=function(e){var t=typeof e;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e};var ot=function(e,t){var i=e.__data__;return nt(t)?i["string"==typeof t?"string":"hash"]:i.map};var rt=function(e){var t=ot(this,e).delete(e);return this.size-=t?1:0,t};var at=function(e){return ot(this,e).get(e)};var st=function(e){return ot(this,e).has(e)};var ct=function(e,t){var i=ot(this,e),n=i.size;return i.set(e,t),this.size+=i.size==n?0:1,this};function lt(e){var t=-1,i=null==e?0:e.length;for(this.clear();++t<i;){var n=e[t];this.set(n[0],n[1])}}lt.prototype.clear=it,lt.prototype.delete=rt,lt.prototype.get=at,lt.prototype.has=st,lt.prototype.set=ct;var dt=lt;function ut(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new TypeError("Expected a function");var i=function(){var n=arguments,o=t?t.apply(this,n):n[0],r=i.cache;if(r.has(o))return r.get(o);var a=e.apply(this,n);return i.cache=r.set(o,a)||r,a};return i.cache=new(ut.Cache||dt),i}ut.Cache=dt;var ht=ut;var pt=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,vt=/\\(\\)?/g,ft=function(e){var t=ht(e,(function(e){return 500===i.size&&i.clear(),e})),i=t.cache;return t}((function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(pt,(function(e,i,n,o){t.push(n?o.replace(vt,"$1"):i||e)})),t}));var gt=function(e,t){for(var i=-1,n=null==e?0:e.length,o=Array(n);++i<n;)o[i]=t(e[i],i,e);return o},mt=g?g.prototype:void 0,yt=mt?mt.toString:void 0;var _t=function e(t){if("string"==typeof t)return t;if(he(t))return gt(t,e)+"";if(De(t))return yt?yt.call(t):"";var i=t+"";return"0"==i&&1/t==-Infinity?"-0":i};var St=function(e){return null==e?"":_t(e)};var Et=function(e,t){return he(e)?e:je(e,t)?[e]:ft(St(e))};var Ot=function(e){if("string"==typeof e||De(e))return e;var t=e+"";return"0"==t&&1/e==-Infinity?"-0":t};var At=function(e,t){for(var i=0,n=(t=Et(t,e)).length;null!=e&&i<n;)e=e[Ot(t[i++])];return i&&i==n?e:void 0};var Tt=function(e,t,i){var n=null==e?void 0:At(e,t);return void 0===n?i:n},bt=function(){try{var e=J(Object,"defineProperty");return e({},"",{}),e}catch(e){}}();var Ct=function(e,t,i){"__proto__"==t&&bt?bt(e,t,{configurable:!0,enumerable:!0,value:i,writable:!0}):e[t]=i},wt=Object.prototype.hasOwnProperty;var Nt=function(e,t,i){var n=e[t];wt.call(e,t)&&$e(n,i)&&(void 0!==i||t in e)||Ct(e,t,i)},It=/^(?:0|[1-9]\d*)$/;var Pt=function(e,t){var i=typeof e;return!!(t=null==t?9007199254740991:t)&&("number"==i||"symbol"!=i&&It.test(e))&&e>-1&&e%1==0&&e<t};var kt=function(e,t,i,n){if(!C(e))return e;for(var o=-1,r=(t=Et(t,e)).length,a=r-1,s=e;null!=s&&++o<r;){var c=Ot(t[o]),l=i;if("__proto__"===c||"constructor"===c||"prototype"===c)return e;if(o!=a){var d=s[c];void 0===(l=n?n(d,c,s):void 0)&&(l=C(d)?d:Pt(t[o+1])?[]:{})}Nt(s,c,l),s=s[c]}return e};var Dt,Rt,Bt,jt,Ut,Mt,Lt,xt,Wt,zt,Jt={isEmpty:Te,isNull:Ce,isUndefined:be,isFunction:N,isObject:C,isString:we,isNumber:Ne,isArray:he,isRegExp:ke,get:Tt,set:function(e,t,i){return null==e?e:kt(e,t,i)},isPromise:e=>!!e&&("object"==typeof e||"function"==typeof e)&&"function"==typeof e.then};function Ft(e){return"function"==typeof window.Debug?window.Debug(e):function(...e){process.env.NODE_ENV}}e.NetworkType=void 0,(Dt=e.NetworkType||(e.NetworkType={})).none="none",Dt.wifi="wifi",Dt.cellular="cellular",Dt.unknown="unknown",e.PlatformType=void 0,(Rt=e.PlatformType||(e.PlatformType={})).wp="wp",Rt.android="android",Rt.iOS="iOS",Rt.unknown="unknown",e.ProfileType=void 0,(Bt=e.ProfileType||(e.ProfileType={}))[Bt.user=1]="user",Bt[Bt.oa=0]="oa",Bt[Bt.aliasOA=2]="aliasOA",e.ChatType=void 0,(jt=e.ChatType||(e.ChatType={}))[jt.user=1]="user",jt[jt.oa=0]="oa",e.PostFeedType=void 0,(Ut=e.PostFeedType||(e.PostFeedType={}))[Ut.image=1]="image",Ut[Ut.link=4]="link",Ut[Ut.profile=5]="profile",e.ShareSheetType=void 0,(Mt=e.ShareSheetType||(e.ShareSheetType={}))[Mt.image=1]="image",Mt[Mt.gif=11]="gif",Mt[Mt.video=12]="video",Mt[Mt.link=4]="link",Mt[Mt.oa=5]="oa",Mt[Mt.zmp=20]="zmp",Mt[Mt.multi_image=21]="multi_image",e.OrientationType=void 0,(Lt=e.OrientationType||(e.OrientationType={}))[Lt.auto=1]="auto",Lt[Lt.portrait=2]="portrait",Lt[Lt.landscape=3]="landscape",e.VibrateType=void 0,(xt=e.VibrateType||(e.VibrateType={}))[xt.oneShot=0]="oneShot",e.Events=void 0,(Wt=e.Events||(e.Events={})).AppPaused="h5.event.paused",Wt.AppResumed="h5.event.resumed",Wt.NetworkChanged="h5.event.connection.changed",Wt.OnDataCallback="h5.event.webview.result",Wt.OpenApp="h5.event.open.mp",Wt.AppClose="h5.event.action.close",e.MediaPickerType=void 0,(zt=e.MediaPickerType||(e.MediaPickerType={}))[zt.zcamera=3]="zcamera",zt[zt.zcamera_photo=1]="zcamera_photo",zt[zt.zcamera_video=2]="zcamera_video",zt[zt.zcamera_scan=7]="zcamera_scan",zt[zt.photo=4]="photo",zt[zt.video=5]="video",zt[zt.file=6]="file";const Kt=e=>{const t=document.cookie;if(t){const o=t.split("; ");if(o&&o.length>0)for(var i=e.length+1,n=o.length-1;n>=0;n--){let t=o[n];if(t&&0===t.indexOf(e)&&(t=t.substring(i,t.length),t))return t=t.replace(/["']/g,""),t}}return null},Ht=e=>Kt(`${window.location.host}_`+e),Gt=e=>Kt((()=>{const e=window.location.host;if(e){if(e.indexOf("zalo.me")>=0)return"zalo.me_";if(e.indexOf("baomoi.com")>=0)return"baomoi.com_";if(e.indexOf("mp3.zing.vn")>=0)return"mp3.zing.vn_";if(e.indexOf("zaloapp.com")>=0)return"zaloapp.com_"}return""})()+e),$t=1048576,Vt=window.zAppID,Zt=window.APP_ID,qt=window.APP_CONFIG||{},Yt={ZOAUTH:"h5.zdn.vn_zoauth",ZACC_SESSiON:"h5.zdn.vn_zacc_session",JS_TOKEN:"h5.zdn.vn_zlink3rd",ZOAUTH_VRF:"h5.zdn.vn_zoauth_vrf",DEVICE_ID:"h5.zdn.vn_deviceID",CONTEXT_ID:"h5.zdn.vn_contextID",CONTEXT_TYPE:"h5.zdn.vn_contextType"},Qt="https://graph.zalo.me/v2.0/me",Xt="https://h5.zalo.me/openapi/access_token",ei="https://oauth.zaloapp.com/v3/access_token",ti="https://graph.zalo.me/v2.0/me/friends/list",ii="https://h5.zalo.me/apps/get-info",ni="https://h5.zalo.me/log/async",oi=5*$t,ri=e=>({NONE:e?-2:0,WIFI:e?0:1,"2G":2,"3G":e?15:2,"4G":e?13:2}),ai=0,si=-2e3,ci=-1400,li=-1500,di=-1401,ui=-2004,hi=-2005,pi={SUCCESS:"Success",UNKNOWN_ERROR:"Unknown error. Please try again later.",TIME_OUT:"Request timeout. Please try again later.",LOGIN_REQUIRED:"Please login (https://miniapp.zalo.me/docs/api/login) before to call this api",LOGIN_FAILED:"Login failed",NOT_PERMISSION:"You don't have permission to call this api",CLIENT_NOT_SUPPORT:"This API is not supported in this Zalo version",DECODE_FAILED:"Can not decode id. Please check your params again.",INVALID_PARAM:"Invalid parameter",USER_DENIED:"User denied",USER_CANCEL:"User cancel",MEDIA_PICKER_FAIL:"Unable to pick media",SAVE_IMAGE_FAIL:"Unable to save image"},vi={SUCCESS:{code:ai,message:pi.SUCCESS},UNKNOWN_ERROR:{code:si,message:pi.UNKNOWN_ERROR},UNAUTHORIZED:{code:di,message:pi.LOGIN_REQUIRED},FORBIDDEN:{code:-1403,message:pi.NOT_PERMISSION},CLIENT_NOT_SUPPORT:{code:-1404,message:pi.CLIENT_NOT_SUPPORT},DECODE_FAILED:{code:-2001,message:pi.DECODE_FAILED},TIME_OUT:{code:-1408,message:pi.TIME_OUT},USER_DENIED:{code:-2002,message:pi.USER_DENIED},USER_CANCEL:{code:-2003,message:pi.USER_CANCEL}},fi={GET_DOWNLOADED_STICKER:{name:"action.get.downloaded.sticker",have_callback:!0},OPEN_SHARE_STICKER:{name:"action.open.share.sticker"},OPEN_PROFILE:{name:"action.open.profile"},OPEN_FEED_DETAIL:{name:"action.open.feeddetail"},OPEN_FRIEND_RADA:{name:"action.open.friendrada"},OPEN_INAPP:{name:"action.open.inapp"},OPEN_OUTAPP:{name:"action.open.outapp"},OPEN_PAGE:{name:"action.open.page"},OPEN_PHOTODETAIL:{name:"action.open.photodetail"},OPEN_GALARY:{name:"action.open.galary"},OPEN_GAMECENTER:{name:"action.open.gamecenter"},OPEN_GAMENEWS:{name:"action.open.gamenews"},OPEN_TAB_CONTACT:{name:"action.open.tab.contact"},OPEN_TAB_SOCIAL:{name:"action.open.tab.social"},OPEN_FRIENDSUGGEST:{name:"action.open.friendsuggest"},OPEN_GROUPLIST:{name:"action.open.grouplist"},OPEN_NEARBY:{name:"action.open.nearby"},OPEN_ROOM:{name:"action.open.room"},OPEN_STICKERSTORE:{name:"action.open.stickerstore"},OPEN_CREATECHAT:{name:"action.open.createchat"},COPY_LINK_CATESTICKER:{name:"action.copy.link.catesticker"},REQUEST_BUY_STICKER:{name:"action.request.buy.sticker"},OPEN_CHAT:{name:"action.open.chat"},OPEN_TAB_CHAT:{name:"action.open.tab.chat"},OPEN_CHATGROUP:{name:"action.open.chatgroup"},OPEN_ADDFRIEND:{name:"action.open.addfriend"},OPEN_TAB_MORE:{name:"action.open.tab.more"},OPEN_POSTFEED:{name:"action.open.postfeed"},OPEN_LOGINDEVICES:{name:"action.open.logindevices"},OPEN_SENDSTICKER:{name:"action.open.sendsticker"},REPORT_ABUSE:{name:"action.report.abuse",have_callback:!0},FOLLOW_OA:{name:"action.follow.oa",have_callback:!0},UNFOLLOW_OA:{name:"action.unfollow.oa",have_callback:!0},OPEN_GAMEDETAIL:{name:"action.open.gamedetail"},OPEN_SHARESHEET:{name:"action.open.sharesheet",have_callback:!0},REQUEST_PERMISSION_CAMERA:{name:"action.request.permission.camera",error_list:{android:{"-2":{map_to:vi.USER_DENIED}},iOS:{"-2":{map_to:vi.USER_DENIED}}}},CHANGE_TITLE_HEADER:{name:"action.change.title.header",skip_jump:!0},WEBVIEW_CLEARCACHE:{name:"action.webview.clearcache"},WEBVIEW_CONFIRMCACHE:{name:"action.webview.confirmcache"},WEBVIEW_ISVISIBLE:{name:"action.webview.isvisible"},WEBVIEW_NETWORKTYPE:{name:"action.webview.networktype",skip_jump:!0},CHANGE_BUTTON_HEADER:{name:"action.change.button.header"},CREATE_OPTIONS_MENU:{name:"action.create.options.menu",skip_jump:!0,have_callback:!0},CREATE_SHORTCUT:{name:"action.create.shortcut"},CHANGE_ACTIONBAR_LEFTBUTTON_TYPE:{name:"action.change.actionbar.leftbutton.type",skip_jump:!0,have_callback:!0},WINDOW_CLOSE:{name:"action.window.close",skip_jump:!0,have_callback:!0},WEBVIEW_CHECKRESERROR:{name:"action.webview.checkResError"},IAP_REQUESTPAYMENT:{name:"action.iap.requestpayment"},ZBROWSER_GETSTATS:{name:"action.zbrowser.getstats"},ZBROWSER_JSBRIDGE:{name:"action.zbrowser.jsbridge",skip_jump:!0,have_callback:!0},PROMPT_AUTHENTICATION:{name:"action.prompt.authentication"},CHANGE_ACTIONBAR_COLOR:{name:"action.change.actionbar.color",skip_jump:!0},PROMPT_AUTHENTICATION_CHECK_STATE:{name:"action.prompt.authentication.check_state"},OPEN_APPSTORE:{name:"action.open.appstore"},GET_LOCATION:{name:"action.get.location",have_callback:!0,error_list:{android:{"-1":{map_to:vi.USER_DENIED}},iOS:{"-1":{map_to:vi.USER_DENIED}}}},QUERY_LOCATION_HIDE:{name:"action.query.location.hide",have_callback:!0},SHOW_TOAST:{name:"action.show.toast",have_callback:!0},OPEN_APP:{name:"action.open.app"},HIDE_KEYBOARD:{name:"action.hide.keyboard"},OPEN_PHONE:{name:"action.open.phone"},OPEN_QR:{name:"action.open.qr"},OPEN_SMS:{name:"action.open.sms"},VIEW_MYQR:{name:"action.view.myqr",have_callback:!0},KEEP_SCREEN:{name:"action.keep.screen",have_callback:!0},CHANGE_AUTOROTATE:{name:"action.change.autorotate",skip_jump:!0},CHECK_APP_INSTALLED:{name:"action.check.app.installed"},QUERY_SHOW:{name:"action.query.show"},QUERY_HIDE:{name:"action.query.hide"},OPEN_INAPPRW:{name:"action.open.inapprw"},ZALORUN_GETTRACKINGSTATUS:{name:"action.zalorun.getTrackingStatus",have_callback:!0},ZALORUN_SETTRACKINGSTATUS:{name:"action.zalorun.setTrackingStatus",have_callback:!0},ZALORUN_GETDAYSTEP:{name:"action.zalorun.getDayStep",have_callback:!0},ZALORUN_FORCESUBMITDATA:{name:"action.zalorun.forceSubmitData",have_callback:!0},ZALORUN_SETWEIGHT:{name:"action.zalorun.setWeight",have_callback:!0},OPEN_PROFILE_EXT:{name:"action.open.profile.ext"},DOWNLOAD_CATE:{name:"action.download.cate",have_callback:!0},JUMP_LOGIN:{name:"action.jump.login",skip_jump:!0,white_list:!0},OPEN_ADTIMA_ADS_INTERSTITIAL:{name:"action.open.adtima.ads.interstitial"},OPEN_ADTIMA_ADS:{name:"action.open.adtima.ads"},GET_ADIDCLIENT:{name:"action.get.adidclient"},SCAN_IBEACON:{name:"action.scan.ibeacon"},INTERACTIVE_VIBRATION:{name:"action.interactive.vibration"},SAVE_IMAGE_GALLERY:{name:"action.save.image.gallery",version_live:{iOS:408},error_list:{android:{"-101":{map_to:{code:hi,message:pi.SAVE_IMAGE_FAIL},need_more_detail:!0},"-102":{map_to:{code:hi,message:pi.SAVE_IMAGE_FAIL},need_more_detail:!0}},iOS:{"-10":{map_to:{code:hi,message:pi.SAVE_IMAGE_FAIL},need_more_detail:!0}}}},OPEN_MP:{name:"action.open.mp",version_live:{iOS:402}},CHANGE_ACTIONBAR:{name:"action.change.actionbar",version_live:{iOS:402},skip_jump:!0},ZBROWSER_MPDS:{name:"action.zbrowser.mpds",version_live:{iOS:402}},WEBVIEW_SET_RESULT:{name:"action.webview.set.result",version_live:{iOS:416}},MP_GET_NUMBER:{name:"action.mp.get.number",version_live:{iOS:416},error_list:{android:{"-1":{map_to:vi.USER_DENIED},"-101":{map_to:vi.USER_DENIED}},iOS:{"-1":{map_to:vi.USER_DENIED},"-10":{map_to:vi.USER_DENIED}}}},MP_OPEN_PROFILE_PICKER:{name:"action.mp.open.profile.picker",version_live:{iOS:432},error_list:{android:{"-101":{map_to:vi.USER_CANCEL}},iOS:{"-101":{map_to:vi.USER_CANCEL}}}},GET_SUPPORTED_ACTIONS:{name:"action.get.supported.actions",white_list:!0},MP_JOIN_WIFI:{name:"action.mp.join.wifi",version_live:{android:0,iOS:999},have_permission:!1,white_list:!1},PICK_MEDIA:{name:"action.pick.media",version_live:{iOS:440},error_list:{android:{"-101":{map_to:vi.USER_CANCEL},999:{map_to:{code:ui,message:pi.MEDIA_PICKER_FAIL},need_more_detail:!0}},iOS:{"-10":{map_to:{code:ui,message:pi.MEDIA_PICKER_FAIL}}}}},MP_CLOSE_LOADINGVIEW:{name:"action.mp.close.loadingview"}},gi={android:{"-4":vi.DECODE_FAILED,"-5":vi.CLIENT_NOT_SUPPORT,"-14":vi.TIME_OUT},iOS:{"-9":vi.DECODE_FAILED,"-5":vi.CLIENT_NOT_SUPPORT,"-14":vi.TIME_OUT}},mi={android:12100571,iOS:400,wp:0,unknown:0},yi={android:12100615,iOS:460,wp:0,unknown:0},_i=[fi.GET_DOWNLOADED_STICKER.name,fi.OPEN_SHARE_STICKER.name,fi.OPEN_PROFILE.name,fi.OPEN_FEED_DETAIL.name,fi.OPEN_FRIEND_RADA.name,fi.OPEN_INAPP.name,fi.OPEN_OUTAPP.name,fi.OPEN_PAGE.name,fi.OPEN_PHOTODETAIL.name,fi.OPEN_GALARY.name,fi.OPEN_GAMECENTER.name,fi.OPEN_GAMENEWS.name,fi.OPEN_TAB_CONTACT.name,fi.OPEN_TAB_SOCIAL.name,fi.OPEN_FRIENDSUGGEST.name,fi.OPEN_GROUPLIST.name,fi.OPEN_NEARBY.name,fi.OPEN_ROOM.name,fi.OPEN_STICKERSTORE.name,fi.OPEN_CREATECHAT.name,fi.COPY_LINK_CATESTICKER.name,fi.REQUEST_BUY_STICKER.name,fi.OPEN_CHAT.name,fi.OPEN_TAB_CHAT.name,fi.OPEN_CHATGROUP.name,fi.OPEN_ADDFRIEND.name,fi.OPEN_TAB_MORE.name,fi.OPEN_POSTFEED.name,fi.OPEN_LOGINDEVICES.name,fi.OPEN_SENDSTICKER.name,fi.REPORT_ABUSE.name,fi.FOLLOW_OA.name,fi.UNFOLLOW_OA.name,fi.OPEN_GAMEDETAIL.name,fi.OPEN_SHARESHEET.name,fi.REQUEST_PERMISSION_CAMERA.name,fi.CHANGE_TITLE_HEADER.name,fi.WEBVIEW_CLEARCACHE.name,fi.WEBVIEW_CONFIRMCACHE.name,fi.WEBVIEW_ISVISIBLE.name,fi.WEBVIEW_NETWORKTYPE.name,fi.CHANGE_BUTTON_HEADER.name,fi.CREATE_OPTIONS_MENU.name,fi.CREATE_SHORTCUT.name,fi.CHANGE_ACTIONBAR_LEFTBUTTON_TYPE.name,fi.WINDOW_CLOSE.name,fi.WEBVIEW_CHECKRESERROR.name,fi.IAP_REQUESTPAYMENT.name,fi.ZBROWSER_GETSTATS.name,fi.ZBROWSER_JSBRIDGE.name,fi.PROMPT_AUTHENTICATION.name,fi.CHANGE_ACTIONBAR_COLOR.name,fi.PROMPT_AUTHENTICATION_CHECK_STATE.name,fi.OPEN_APPSTORE.name,fi.GET_LOCATION.name,fi.QUERY_LOCATION_HIDE.name,fi.SHOW_TOAST.name,fi.OPEN_APP.name,fi.HIDE_KEYBOARD.name,fi.OPEN_PHONE.name,fi.OPEN_QR.name,fi.OPEN_SMS.name,fi.VIEW_MYQR.name,fi.KEEP_SCREEN.name,fi.CHANGE_AUTOROTATE.name,fi.CHECK_APP_INSTALLED.name,fi.QUERY_SHOW.name,fi.QUERY_HIDE.name,fi.OPEN_INAPPRW.name,fi.ZALORUN_GETTRACKINGSTATUS.name,fi.ZALORUN_SETTRACKINGSTATUS.name,fi.ZALORUN_GETDAYSTEP.name,fi.ZALORUN_FORCESUBMITDATA.name,fi.ZALORUN_SETWEIGHT.name,fi.OPEN_PROFILE_EXT.name,fi.DOWNLOAD_CATE.name,fi.JUMP_LOGIN.name,fi.OPEN_ADTIMA_ADS_INTERSTITIAL.name,fi.OPEN_ADTIMA_ADS.name,fi.GET_ADIDCLIENT.name,fi.SCAN_IBEACON.name,fi.SAVE_IMAGE_GALLERY.name,fi.OPEN_MP.name,fi.CHANGE_ACTIONBAR.name,fi.INTERACTIVE_VIBRATION.name,fi.ZBROWSER_MPDS.name],Si=0,Ei=3,Oi=1,Ai=0,Ti="https://payment-mini.zalo.me/api/order/create",bi="https://payment-mini.zalo.me/api/transaction";class Ci{constructor(e,t,i){this.code=e,this.message=t,this.api=i}toString(){return`api: ${String(this.api)}; code: ${this.code}; message: ${this.message}`}toJSON(){return{code:this.code,message:this.message,api:this.api}}}const wi=(e,t)=>e instanceof Ci?((e,t)=>(e.api=t,e.toJSON()))(e,t):((e,t)=>e instanceof Error?new Ci(si,e.message,t).toJSON():new Ci(si,pi.UNKNOWN_ERROR,t).toJSON())(e,t),Ni=(e,t)=>({code:ai,message:t||pi.SUCCESS,data:e||{}}),Ii={badRequest:e=>new Ci(ci,e),loginFailed:e=>new Ci(di,`${pi.LOGIN_FAILED}: ${e}`),loginRequired:()=>new Ci(di,pi.LOGIN_REQUIRED),missingParam:e=>new Ci(ci,`Missing required argument: ${e}`),wrongTypeParam:(e,t,i)=>new Ci(ci,`Wrong type of parameter '${e}'. Expected ${t}, but got ${i}`),cannotGetShareInfo:()=>new Ci(li,"Can not get app info to share"),lengthInvalid:e=>new Ci(ci,`${e} length is invalid.`)};const Pi={encode:function(e){var t=[];for(var i in e)if(e.hasOwnProperty(i)){var n=e[i];if(void 0===n)return;if(null===n)return void t.push(i);t.push(encodeURIComponent(i)+"="+encodeURIComponent(n))}return t.join("&")},decode:function(e,t){var i={};if(""===e)return i;for(var n=e.split("&"),o=0;o<n.length;o++){var r=n[o].split("=",2),a=decodeURIComponent(r[0]);if(t&&Object.prototype.hasOwnProperty.call(i,a))throw new URIError("Duplicate key: "+a);i[a]=2===r.length?decodeURIComponent(r[1]):null}return i},appendToUrl:function(e,t){return e+(-1!==e.indexOf("?")?"&":"?")+("string"==typeof t?t:Pi.encode(t))},getParameterByName:function(e,t){t||(t=window.location.href),e=e.replace(/[\[\]]/g,"\\$&");var i=new RegExp("[?&]"+e+"(=([^&#]*)|&|#|$)").exec(t);return i?i[2]?decodeURIComponent(i[2].replace(/\+/g," ")):"":null},getParamsAsObject:function(e){var t={};return e?(e.split("&").map((function(e){var i=e.split("=");i&&2==i.length&&(t[i[0]]=decodeURIComponent(i[1].replace(/\+/g," ")))})),t):t},toQueryString:function(e){if(!e)return"";if("object"!=(void 0===e?"undefined":typeof e))return e;var t=Object.keys(e),i=[];return t.map((function(t){var n=e[t],o=[t,n="object"==(void 0===n?"undefined":typeof n)?JSON.stringify(n):encodeURIComponent(n)].join("=");i.push(o)})),i.join("&")}},ki=new RegExp("[\\u0300-\\u036f]","g"),Di=new RegExp("[đ|Đ]","g"),Ri=new RegExp("\\s","g"),Bi=Ft("zmp:utils:common"),ji=e=>{try{new URL(e)}catch(e){return!1}return!0},Ui=()=>navigator.userAgent||navigator.vendor||window.opera,Mi=()=>{const e=Ui().toLowerCase();return{isWP:/iemobile/.test(e),isAndroid:/android/i.test(e)&&!/iemobile/.test(e),isIOS:/iphone|ios|ipad|ipod/.test(e)&&!/iemobile/.test(e),isMobile:/android|iphone|ios|ipad|ipod|iemobile/.test(e),isZalo:/zalo/.test(e)}},Li=e=>{const t=document.getElementsByTagName("meta");for(let i=0;i<t.length;i++)if(t[i].getAttribute("name")===e||t[i].getAttribute("property")===e)return t[i].getAttribute("content");return""},xi=()=>{const e=Ui().toLowerCase().split("zalo")[1];if(e){return e.replace(" ","").split("/")[1]||""}return""},Wi=()=>{let t=Mi();return t.isWP?e.PlatformType.wp:t.isAndroid?e.PlatformType.android:t.isIOS?e.PlatformType.iOS:e.PlatformType.unknown},zi=(e,t)=>{const i=t.toLowerCase(),n=i.split(/[<>]/i),o="array"===n[0];return!!("url"===i&&ji(e)||o&&("array"===i&&Array.isArray(e)||((e,t)=>Array.isArray(t)&&!t.some((t=>"url"===e?!ji(t):typeof t!==e)))(n[1],e))||!Array.isArray(e)&&typeof e===t)},Ji=e=>(e=>{let t=Ht(e);return t||(t=Gt(e),t)?t:Kt(e)})(e),Fi=e=>{if(Jt.isObject(JSON)&&JSON.parse&&Jt.isString(e)){const t=e.replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/\t/g,"\\t").replace(/\x00/g,"");return JSON.parse(t,((e,t)=>t))}return Jt.isObject(e)?e:new Function("return "+e)()},Ki=e=>{if(Jt.isObject(JSON)&&JSON.stringify)return JSON.stringify(e);if(void 0===e)return"undefined";if(null===e)return"null";try{if("string"==typeof e||null!==e.constructor.toString().match(/string/i))return'"'+e.replace(/"/g,'\\"')+'"'}catch(e){console.log(e)}var t;if(null!==Object.prototype.toString.call(e).match(/array/i)){t=new Array;for(var i=e.length,n=0;n<i;n++)t.push(Ki(e[n]));return"["+t.join(",")+"]"}if("object"==typeof e){for(var o in t=new Array,e)t.push('"'+o+'":'+Ki(e[o]));return"{"+t.join(",")+"}"}return e.toString()},Hi=()=>{try{const e=Number(xi()),t=Wi();return e>=mi[t]}catch(e){return!0}},Gi=e=>JSON.stringify(e).replace(/"/g,'\\"').replace(/'/g,"&#39;"),$i=e=>{try{if(e){Bi(e);const t=e.replace(/\\/g,"").replace(/&#39;/g,"'");return Bi("formattedValue",t,JSON.parse(t),typeof JSON.parse(t)),JSON.parse(t)}return null}catch(t){return Bi("parse json error:",t),e}},Vi=(e,t,i,o,r,a)=>n(void 0,void 0,void 0,(function*(){const n=new URL(location.href),s=new URLSearchParams;let c=`${n.pathname}${n.search}`;a&&(c=`/zapps/${e}${"/"===a[0]?"":"/"}${a}`);const l=new URL(`https://zalo.me/app/link${c}`);s.append("title",i),s.append("description",o||""),s.append("thumbnail",r),s.append("url",l.href),s.append("accessToken",t||"");const d=yield fetch("https://h5.zalo.me/openapi/create-sharelink",Object.assign({method:"POST",body:s},{headers:{"Content-Type":"application/x-www-form-urlencoded"}})),u=yield d.json();if(!u||0!==u.err)throw Ii.cannotGetShareInfo();return l.search=`${l.search}&zshareId=${u.data.shareId}`,Object.assign(Object.assign({},u.data),{shareableLink:l.href})})),Zi=(e,t)=>i=>{if(!(Array.isArray(e)?e.some((e=>zi(i,e))):zi(i,e)))return{error:!0,errorMessage:e};if(t){if(Array.isArray(null==t?void 0:t.values))return{error:!(null==t?void 0:t.values.includes(i)),errorMessage:null==t?void 0:t.values.toString()};if(Jt.isNumber(null==t?void 0:t.maxLength))return{error:Jt.isString(i)&&i.length>(null==t?void 0:t.maxLength),errorMessage:`data length must <= ${null==t?void 0:t.maxLength}`};if(Jt.isNumber(null==t?void 0:t.min)&&Jt.isNumber(null==t?void 0:t.max))return{error:i<(null==t?void 0:t.min)||i>(null==t?void 0:t.max),errorMessage:`data must be in between ${null==t?void 0:t.min} and ${null==t?void 0:t.max}`};if(Jt.isNumber(null==t?void 0:t.min))return{error:i<(null==t?void 0:t.min),errorMessage:`data must >= ${null==t?void 0:t.min}`};if(Jt.isNumber(null==t?void 0:t.max))return{error:i>(null==t?void 0:t.max),errorMessage:`data must <= ${null==t?void 0:t.max}`};if(Jt.isRegExp(null==t?void 0:t.regex))return{error:!t.regex.test(i),errorMessage:"data must valid"}}return{error:!1}},qi=(e,t,i)=>n(void 0,void 0,void 0,(function*(){const n={appId:e,versionStatus:t};Jt.isUndefined(i)||(n.currentVersion=i);const o=Pi.appendToUrl(ii,n),r=yield fetch(o,{credentials:"include"});if(r.ok){const e=yield r.json();if(e.err<0||!e.data)throw new Error(e);return{name:e.data.name,version:e.data.version,description:e.data.description,appUrl:e.data.appUrl,qrCodeUrl:e.data.qrCodeUrl,logoUrl:e.data.logoUrl}}throw new Error("Can't get app info")}));var Yi=h((function(e){var t=Object.prototype.hasOwnProperty,i="~";function n(){}function o(e,t,i){this.fn=e,this.context=t,this.once=i||!1}function r(e,t,n,r,a){if("function"!=typeof n)throw new TypeError("The listener must be a function");var s=new o(n,r||e,a),c=i?i+t:t;return e._events[c]?e._events[c].fn?e._events[c]=[e._events[c],s]:e._events[c].push(s):(e._events[c]=s,e._eventsCount++),e}function a(e,t){0==--e._eventsCount?e._events=new n:delete e._events[t]}function s(){this._events=new n,this._eventsCount=0}Object.create&&(n.prototype=Object.create(null),(new n).__proto__||(i=!1)),s.prototype.eventNames=function(){var e,n,o=[];if(0===this._eventsCount)return o;for(n in e=this._events)t.call(e,n)&&o.push(i?n.slice(1):n);return Object.getOwnPropertySymbols?o.concat(Object.getOwnPropertySymbols(e)):o},s.prototype.listeners=function(e){var t=i?i+e:e,n=this._events[t];if(!n)return[];if(n.fn)return[n.fn];for(var o=0,r=n.length,a=new Array(r);o<r;o++)a[o]=n[o].fn;return a},s.prototype.listenerCount=function(e){var t=i?i+e:e,n=this._events[t];return n?n.fn?1:n.length:0},s.prototype.emit=function(e,t,n,o,r,a){var s=i?i+e:e;if(!this._events[s])return!1;var c,l,d=this._events[s],u=arguments.length;if(d.fn){switch(d.once&&this.removeListener(e,d.fn,void 0,!0),u){case 1:return d.fn.call(d.context),!0;case 2:return d.fn.call(d.context,t),!0;case 3:return d.fn.call(d.context,t,n),!0;case 4:return d.fn.call(d.context,t,n,o),!0;case 5:return d.fn.call(d.context,t,n,o,r),!0;case 6:return d.fn.call(d.context,t,n,o,r,a),!0}for(l=1,c=new Array(u-1);l<u;l++)c[l-1]=arguments[l];d.fn.apply(d.context,c)}else{var h,p=d.length;for(l=0;l<p;l++)switch(d[l].once&&this.removeListener(e,d[l].fn,void 0,!0),u){case 1:d[l].fn.call(d[l].context);break;case 2:d[l].fn.call(d[l].context,t);break;case 3:d[l].fn.call(d[l].context,t,n);break;case 4:d[l].fn.call(d[l].context,t,n,o);break;default:if(!c)for(h=1,c=new Array(u-1);h<u;h++)c[h-1]=arguments[h];d[l].fn.apply(d[l].context,c)}}return!0},s.prototype.on=function(e,t,i){return r(this,e,t,i,!1)},s.prototype.once=function(e,t,i){return r(this,e,t,i,!0)},s.prototype.removeListener=function(e,t,n,o){var r=i?i+e:e;if(!this._events[r])return this;if(!t)return a(this,r),this;var s=this._events[r];if(s.fn)s.fn!==t||o&&!s.once||n&&s.context!==n||a(this,r);else{for(var c=0,l=[],d=s.length;c<d;c++)(s[c].fn!==t||o&&!s[c].once||n&&s[c].context!==n)&&l.push(s[c]);l.length?this._events[r]=1===l.length?l[0]:l:a(this,r)}return this},s.prototype.removeAllListeners=function(e){var t;return e?(t=i?i+e:e,this._events[t]&&a(this,t)):(this._events=new n,this._eventsCount=0),this},s.prototype.off=s.prototype.removeListener,s.prototype.addListener=s.prototype.on,s.prefixed=i,s.EventEmitter=s,e.exports=s}));class Qi extends Yi{constructor(){super(),this.debug=Ft("zmp:event-emitter")}static getInstance(){return Qi.instance||(Qi.instance=new Qi),Qi.instance}h5ConfirmHandleEvent(e,t,i){ZaloJavaScriptInterface.jsH5EventCallback(e,t,i||"")}on(e,t,i){this.debug(`register ${e}: ${i}`);return super.on(e,((n,o)=>{this.h5ConfirmHandleEvent(n,e,i),t(o)}),i)}once(e,t,i){this.debug(`register once ${e}: ${i}`);return super.once(e,((n,o)=>{this.h5ConfirmHandleEvent(n,e,i),t(o)}),i)}}var Xi,en,tn,nn,on,rn="2.23.3";class an{static getVersion(){return rn}static getSystemInfo(){return{version:Li("version-id")||"",apiVersion:rn,zaloVersion:xi(),platform:Wi(),language:navigator.language,zaloLanguage:window.zLanguage||"vi",zaloTheme:window.zTheme||"light"}}static getAppInfo(){return n(this,void 0,void 0,(function*(){const e=this.getAppId(),t=this.getSystemInfo();return yield qi(e,0,t.version)}))}}class sn{static setNavigationBarTitle(e){return n(this,void 0,void 0,(function*(){yield this.getJSBridge().callNative(fi.CHANGE_TITLE_HEADER,{title:e.title},{haveTimeout:!1})}))}static setNavigationBarColor(e){return n(this,void 0,void 0,(function*(){const t={};let i;Jt.isEmpty(e.textColor)||(t.textColor=e.textColor),Jt.isString(e.color)&&e.color.length>0?(Jt.isEmpty(e.color)||(t.backgroundColor=e.color),i=5):(Jt.isEmpty(e.statusBarColor)||(t.backgroundColor=e.statusBarColor),i=6),this.setActionBarConfig((e=>Object.assign(Object.assign({},e),{actionbarType:i,dataConfig:Object.assign(Object.assign({},e.dataConfig),t)}))),yield this.getJSBridge().callNative(fi.CHANGE_ACTIONBAR,Object.assign({},this.getActionBarConfig()),{haveTimeout:!1})}))}static setNavigationBarLeftButton(e,t){return n(this,void 0,void 0,(function*(){let i,n;Jt.isString(e)&&(i="none"===e||"home"===e?Ei:Si,n="home"===e||"both"===e?Oi:Ai),this.setActionBarConfig((e=>Object.assign(Object.assign({},e),{buttonType:Jt.isNumber(i)?i:e.buttonType,dataConfig:Object.assign(Object.assign({},e.dataConfig),{confirmToExit:Jt.isNumber(t)?t:e.dataConfig.confirmToExit,viewInLeftType:Jt.isNumber(i)?i:e.dataConfig.viewInLeftType}),homeConfig:Object.assign(Object.assign({},e.homeConfig),{enable:Jt.isNumber(n)?n:e.homeConfig.enable})}))),yield this.getJSBridge().callNative(fi.CHANGE_ACTIONBAR_LEFTBUTTON_TYPE,Object.assign({},this.getActionBarConfig()),{haveTimeout:!1})}))}static setNavigationBar(e){return n(this,void 0,void 0,(function*(){yield this.getJSBridge().callNative(fi.CHANGE_ACTIONBAR,{data:e},{haveTimeout:!1})}))}}class cn{static setBackgroundColor(e){return n(this,void 0,void 0,(function*(){Jt.isString(e.backgroundColor)&&e.backgroundColor.length>0&&(yield this.getJSBridge().callNative(fi.CHANGE_ACTIONBAR,{actionbarType:this.isShowNavBar?5:6,dataConfig:{backgroundColor:e.backgroundColor,textColor:e.textColor}}))}))}}class ln{constructor(e,t,i,n){this.title=n,this.severity=t;const o=new Date;if(this.time=o.toLocaleTimeString(),this.content=e,i>0){const e=(new Error).stack;this.stack=e?e.replace("Error\n",""):""}}toString(){return(this.content.stack?[this.title,this.severity.toUpperCase(),this.time,this.content,this.content.stack.replace("Error:","")]:[this.title,this.severity.toUpperCase(),this.time,JSON.stringify(this.content),this.stack]).join(" ")}}Xi=new WeakMap,en=new WeakMap,tn=new WeakMap,nn=new WeakMap,on=new WeakMap;const dn=new class{constructor(){Xi.set(this,3),en.set(this,["none","error","warn","info"]),tn.set(this,"[zmp] > "),nn.set(this,{error:0,warn:0,info:0,firstError:null,lastError:null}),on.set(this,((e,t,i)=>{o(this,nn,"f")[o(this,en,"f")[e]]++;const n=o(this,en,"f")[e];if(r(this,tn,o(this,tn,"f")+("string"!=typeof t?new ln(t,n,e,i).toString():t),"f"),!(e>o(this,Xi,"f")))switch(e){case 1:console.error(o(this,tn,"f"));break;case 2:console.warn(o(this,tn,"f"));break;case 3:console.info(o(this,tn,"f"));break;default:throw new Error("internal")}}))}setLogLevel(e){r(this,Xi,e,"f")}info(e){o(this,on,"f").call(this,3,e)}warn(e,t){o(this,on,"f").call(this,2,e,t)}error(e,t){o(this,on,"f").call(this,1,e,t)}getMetrics(){return o(this,nn,"f")}};class un{static setDeviceOrientation(t){return n(this,void 0,void 0,(function*(){yield this.getJSBridge().callNative(fi.CHANGE_AUTOROTATE,{autoRotate:e.OrientationType[t.rotate]})}))}static getNetworkType(t){return n(this,void 0,void 0,(function*(){return yield this.getJSBridge().callNative(fi.WEBVIEW_NETWORKTYPE,{url:window.location.href,featureId:""}).then((t=>{const i=t.network;let n;const o=Mi().isAndroid;switch(i){case ri(o).NONE:n=e.NetworkType.none;break;case ri(o).WIFI:n=e.NetworkType.wifi;break;case ri(o)["2G"]:case ri(o)["3G"]:case ri(o)["4G"]:n=e.NetworkType.cellular;break;default:n=e.NetworkType.unknown}return{networkType:n}}))}))}static onNetworkStatusChange(t){return n(this,void 0,void 0,(function*(){yield this.events.on(e.Events.NetworkChanged,(e=>{const i=e&&e.state;this.getNetworkType().then((e=>{const n={isConnected:"CONNECTED"===i,networkType:e&&e.networkType};t(n)})).catch((e=>{dn.error(e,"onNetworkStatusChange")}))}))}))}static startBeaconDiscovery(e){var t,i,o,r,a;return n(this,void 0,void 0,(function*(){const n={subaction:0,scanning_type:Jt.isNumber(null==e?void 0:e.scanningType)?e.scanningType:0,data:{scan_from_source:Jt.isString(null==e?void 0:e.scanFromSource)?e.scanFromSource:"",expire:Jt.isNumber(null==e?void 0:e.expire)?e.expire:3e3,monitor_interval:Jt.isNumber(null==e?void 0:e.monitorInterval)?e.monitorInterval:60,domain:Jt.isString(null==e?void 0:e.domain)?e.domain:"",scan_config:{scan_time:Jt.isNumber(null===(t=null==e?void 0:e.scanConfig)||void 0===t?void 0:t.scanTime)?e.scanConfig.scanTime:15e3,time_between_scan:Jt.isNumber(null===(i=null==e?void 0:e.scanConfig)||void 0===i?void 0:i.timeBetweenScan)?e.scanConfig.timeBetweenScan:1e4,beacon_timeout:Jt.isNumber(null===(o=null==e?void 0:e.scanConfig)||void 0===o?void 0:o.beaconTimeout)?e.scanConfig.beaconTimeout:3e4,delayCheckConnectedTimeout:Jt.isNumber(null===(r=null==e?void 0:e.scanConfig)||void 0===r?void 0:r.delayCheckConnectedTimeout)?e.scanConfig.delayCheckConnectedTimeout:5e3,beaconConnectedTimeout:Jt.isNumber(null===(a=null==e?void 0:e.scanConfig)||void 0===a?void 0:a.beaconConnectedTimeout)?e.scanConfig.beaconConnectedTimeout:6e5},items:Array.isArray(null==e?void 0:e.items)?null==e?void 0:e.items:[]}};return yield this.getJSBridge().callNative(fi.SCAN_IBEACON,Object.assign({},n)),!0}))}static stopBeaconDiscovery(e){return n(this,void 0,void 0,(function*(){return yield this.getJSBridge().callNative(fi.SCAN_IBEACON,Object.assign({},{subaction:2})),!0}))}static getBeacons(e){return n(this,void 0,void 0,(function*(){return yield this.getJSBridge().callNative(fi.SCAN_IBEACON,Object.assign({},{subaction:1}),{isMultiCallback:!0}).then((e=>{const t={beacons:[]};return Array.isArray(e)&&e.forEach((e=>{const i={uuid:e.uuid,major:e.major,minor:e.minor,distance:e.distance,rssi:e.rssi};t.beacons.push(i)})),t}))}))}static stopBluetoothDevicesDiscovery(){return n(this,void 0,void 0,(function*(){return this.getJSBridge().callNative({name:""},{})}))}static startBluetoothDevicesDiscovery(e){return n(this,void 0,void 0,(function*(){return this.getJSBridge().callNative({name:""},Object.assign({},e))}))}static openBluetoothAdapter(){return n(this,void 0,void 0,(function*(){return this.getJSBridge().callNative({name:""},{})}))}static onBluetoothDeviceFound(){return n(this,void 0,void 0,(function*(){return this.getJSBridge().callNative({name:""},{})}))}static onBluetoothAdapterStateChange(){return n(this,void 0,void 0,(function*(){return Promise.resolve()}))}static getConnectedBluetoothDevices(e){return n(this,void 0,void 0,(function*(){const t={services:e.services||[]};return this.getJSBridge().callNative({name:""},t)}))}static getBluetoothDevices(){return n(this,void 0,void 0,(function*(){return this.getJSBridge().callNative({name:""},{})}))}static getBluetoothAdapterState(){return n(this,void 0,void 0,(function*(){return this.getJSBridge().callNative({name:""},{})}))}static closeBluetoothAdapter(){return n(this,void 0,void 0,(function*(){return this.getJSBridge().callNative({name:""},{})}))}static scanQRCode(e){return n(this,void 0,void 0,(function*(){return yield this.getJSBridge().callNative(fi.OPEN_QR,{skipOpenLink:!0})}))}static showToast(e){return n(this,void 0,void 0,(function*(){yield this.getJSBridge().callNative(fi.SHOW_TOAST,{toast:e.message})}))}static hideKeyboard(e){return n(this,void 0,void 0,(function*(){yield this.getJSBridge().callNative(fi.HIDE_KEYBOARD,{})}))}static openPhone(e){return n(this,void 0,void 0,(function*(){yield this.getJSBridge().callNative(fi.OPEN_PHONE,{phoneNum:e.phoneNumber,phoneCode:e.phoneNumber})}))}static openSMS(e){return n(this,void 0,void 0,(function*(){yield this.getJSBridge().callNative(fi.OPEN_SMS,{content:e.content,phoneCode:e.phoneNumber})}))}static keepScreen(e){return n(this,void 0,void 0,(function*(){return yield this.getJSBridge().callNative(fi.KEEP_SCREEN,{data:{keep_screen_on:e.keepScreenOn?1:0}})}))}static openBioAuthentication(e){return n(this,void 0,void 0,(function*(){return yield this.getJSBridge().callNative(fi.PROMPT_AUTHENTICATION,{secret_data:e.secretData,app_id:this.getZAppId(),ui:{title:e.ui.title,sub_title:e.ui.subTitle,negative_text:e.ui.negativeButtonText},require_fingerprint:e.requireFingerprint?1:0}).then((e=>{var t,i,n,o;return{code:null==e?void 0:e.error_code,message:null==e?void 0:e.error_message,data:{domain:null===(t=null==e?void 0:e.data)||void 0===t?void 0:t.domain,code:null===(i=null==e?void 0:e.data)||void 0===i?void 0:i.error_code,message:null===(n=null==e?void 0:e.data)||void 0===n?void 0:n.error_message,payToken:null===(o=null==e?void 0:e.data)||void 0===o?void 0:o.pay_token}}}))}))}static checkStateBioAuthentication(e){return n(this,void 0,void 0,(function*(){return yield this.getJSBridge().callNative(fi.PROMPT_AUTHENTICATION_CHECK_STATE,{}).then((e=>({bioState:null==e?void 0:e.bio_state})))}))}static vibrate(t){return n(this,void 0,void 0,(function*(){return yield this.getJSBridge().callNative(fi.INTERACTIVE_VIBRATION,{type:e.VibrateType[t.type],vibrate_time:t.milliseconds})}))}static connectWifi(e){return n(this,void 0,void 0,(function*(){let t="open";return Jt.isString(e.password)&&e.password.length>0&&(t="wpa_wpa2"),yield this.getJSBridge().callNative(fi.MP_JOIN_WIFI,{ssid:e.SSID,securityType:t,password:e.password,hiddenSsid:e.hiddenSSID})}))}static openAppStore(e){return n(this,void 0,void 0,(function*(){return yield this.getJSBridge().callNative(fi.OPEN_APPSTORE,e)}))}}var hn,pn,vn;class fn{constructor(e){hn.set(this,localStorage),pn.set(this,void 0),vn.set(this,void 0),Mi(),r(this,vn,{keys:new Set,currentSize:0,limitSize:oi},"f"),r(this,pn,e,"f"),this.findAllCurrentDataByApp(e)}findAllCurrentDataByApp(e){try{let t;for(t in o(this,hn,"f")){if(e){if(t.split("_")[0]!==e)continue}o(this,vn,"f").keys.add(t)}}catch(e){dn.error(e,"LocalResourceStorage > findAllCurrentDataByApp")}}get(e){let t=new Map;return e.forEach((e=>{t.set(e,this.getSync(e))})),Promise.resolve(t)}getSync(e){return o(this,pn,"f")&&(e=`${o(this,pn,"f")}_${e}`),o(this,vn,"f").keys.has(e)?o(this,hn,"f").getItem(e):null}set(e){return n(this,void 0,void 0,(function*(){return Object.entries(e).forEach((([e,t])=>{this.setSync(e,t.replace(/\\"/g,'"'))})),Promise.resolve({errorKeys:[]})}))}setSync(e,t){o(this,pn,"f")&&(e=`${o(this,pn,"f")}_${e}`),o(this,hn,"f").setItem(e,t),o(this,vn,"f").keys.add(e)}getInfo(){return n(this,void 0,void 0,(function*(){return Promise.resolve(this.getInfoSync())}))}getInfoSync(){const e=((e,t)=>{let i,n,o=0;for(n in e){const r=n.split("_")[0];e.hasOwnProperty(n)&&(t&&r!==t||(i=2*(e[n].length+n.length),o+=i))}return o})(o(this,hn,"f"),o(this,pn,"f"));return{currentSize:Jt.isNumber(e)?Number((e/1024).toFixed(2)):0,limitSize:Number(5120..toFixed(2))}}remove(e){return n(this,void 0,void 0,(function*(){return e.forEach((e=>{this.removeSync(e)})),Promise.resolve({errorKeys:[]})}))}removeSync(e){o(this,pn,"f")&&(e=`${o(this,pn,"f")}_${e}`),o(this,vn,"f").keys.has(e)&&(o(this,hn,"f").removeItem(e),o(this,vn,"f").keys.delete(e))}clear(){return n(this,void 0,void 0,(function*(){return Promise.resolve(this.clearSync())}))}clearSync(){o(this,vn,"f").keys.forEach((e=>{o(this,pn,"f")&&e.indexOf(o(this,pn,"f"))<0||(o(this,hn,"f").removeItem(e),o(this,vn,"f").keys.delete(e))}))}}hn=new WeakMap,pn=new WeakMap,vn=new WeakMap;var gn={},mn=function(e,t,i){var n=t||"default";return function(){var t=n in gn?gn[n](e,i):e;return t.apply(this,arguments)}};mn.setWrapper=function(e){var t=arguments.length<=1||void 0===arguments[1]?"default":arguments[1];gn[t]=e};var yn={error:{code:1,error_subcode:1357046,message:"Received Invalid JSON reply.",type:"http"}};function _n(e){try{return null===e?yn:JSON.parse(e)}catch(e){return yn}}var Sn,En,On,An,Tn,bn,Cn,wn,Nn,In,Pn,kn,Dn,Rn,Bn,jn,Un,Mn,Ln,xn,Wn,zn,Jn,Fn,Kn,Hn,Gn,$n,Vn,Zn,qn,Yn,Qn,Xn={execute:function(e,t,i,n){i.suppress_http_code=1;var o=Pi.encode(i);"post"!=t&&(e=Pi.appendToUrl(e,o),o="");var r=function(e,t){if(!self.XMLHttpRequest)return null;var i=new XMLHttpRequest,n=function(){};if(!("withCredentials"in i))return null;i.open(e,t,!0),i.setRequestHeader("Content-type","application/x-www-form-urlencoded");var o={send:function(e){i.send(e)}},r=mn((function(){r=n,"onload"in o&&o.onload(i)}),"entry","XMLHttpRequest:load"),a=mn((function(){a=n,"onerror"in o&&o.onerror(i)}),"entry","XMLHttpRequest:error");return i.onload=function(){r()},i.onerror=function(){a()},i.onreadystatechange=function(){4==i.readyState&&(200==i.status?r():a())},o}(t,e);return!!r&&(r.onload=function(e){n(_n(e.responseText))},r.onerror=function(e){e.responseText?n(_n(e.responseText)):n({error:{code:1,error_subcode:1357045,message:"unknown error (empty response)",status:e.status,type:"http"}})},r.send(o),!0)}};class eo extends Yi{constructor(){super(),Sn.add(this),this.debug=Ft("zmp:ZaloJSBridge"),this.events=Qi.getInstance(),this._accessTk=Ji("zacc_session")||"DEFAULT_ACCESS_TOKEN",this._jsAccessTk=Ji("zlink3rd")||"DEFAULT_JS_TOKEN",this.results=[],this._userAgent=Ui(),this._device=Mi(),this.isJumped=!1,En.set(this,void 0),On.set(this,[]),An.set(this,void 0),this.getCookie=e=>n(this,void 0,void 0,(function*(){var t;yield this.jump();return null===(t=o(this,On,"f"))||void 0===t?void 0:t.find((t=>t.name===e))})),this.getCookieSync=e=>{var t;return null===(t=o(this,On,"f"))||void 0===t?void 0:t.find((t=>t.name===e))},this._jsCallFuncCallbacks={},r(this,An,{},"f"),this.events.on(e.Events.AppPaused,(()=>{if(this.results.length>0){let e=this.results;this.results=[];try{this.sendLogData(e)}catch(e){}}})),this.sendLogTimer?clearInterval(this.sendLogTimer):this.sendLogTimer=setInterval((()=>{if(this.results.length>0){let e=this.results;this.results=[];try{this.sendLogData(e)}catch(e){}}}),5e3),r(this,En,0,"f")}static getInstance(){return eo.instance||(eo.instance=new eo),eo.instance}set accessTk(e){this._accessTk=e}set jsAccessTk(e){this._jsAccessTk=e}jump(){return n(this,void 0,void 0,(function*(){const e=this;return r(this,En,+o(this,En,"f")+1,"f"),o(this,En,"f")>1&&(yield function(){return n(this,void 0,void 0,(function*(){return yield new Promise((t=>{const i=setInterval((()=>{(o(e,En,"f")<=1||e.isJumped)&&(t("done"),clearInterval(i))}),200)}))}))}()),new Promise(((e,t)=>{this.isJumped?(e(o(this,On,"f")),r(this,En,+o(this,En,"f")-1,"f")):(this.debug("******** call jump ********"),this.callNative(fi.JUMP_LOGIN,{}).then((t=>{const i=t&&t.cookiesOAuthLogins||[],n=t&&t.actionPermission||[];Object.entries(n).forEach((e=>{const t=e[0],i=e[1]||{perm:0,decode:0};o(this,An,"f")[t]||(o(this,An,"f")[t]={permission:!1,support:!1}),o(this,An,"f")[t].permission=1===i.perm}));const a=i.find((e=>e.name===Yt.JS_TOKEN));a&&(this.jsAccessTk=a.value,window.ZJSBridge.setJSToken&&window.ZJSBridge.setJSToken(a.value)),r(this,On,i,"f"),this.isJumped=!0,e(i)})).catch((e=>{this.isJumped=!1,t(e)})).finally((()=>{r(this,En,+o(this,En,"f")-1,"f")})))}))}))}sendLogData(e){try{const t=e.map((e=>({action:e.action,error:e.error,message:e.message,data:e.data})));Xn.execute(ni,"post",{appId:window.APP_ID,data:JSON.stringify(t)},(e=>{})),window.zmpSentry&&window.zmpSentry.captureMessage("Result from native",{extra:{data:e}})}catch(e){}}onJSCall(e,t){try{this.debug("onJSCall",e,t);const i=Fi(t);let n;if(this._jsCallFuncCallbacks[e]){n=this._jsCallFuncCallbacks[e].inputData;const t=this._jsCallFuncCallbacks[e].callback,o=this._jsCallFuncCallbacks[e].timeout;if(t){try{t.call(this,i)}catch(e){console.error("Call callback error",e)}o&&clearTimeout(o),this._jsCallFuncCallbacks[e]=null,delete this._jsCallFuncCallbacks[e]}}const o={action:i.action,error:i.error_code,message:i.error_message,data:{}};try{if(i.action===fi.OPEN_INAPP.name||i.action===fi.OPEN_OUTAPP.name){const e=new URL(n.url),t=`${e.protocol}//${e.host}${e.pathname}`;o.data={url:t}}}catch(e){}this.results.push(o)}catch(e){console.log("onJSCall","error",e)}}onMultiJSCall(e,t){try{this.debug("onMultiJSCall",e,t);const i=Fi(t);let n;if(this._jsCallFuncCallbacks[e]){n=this._jsCallFuncCallbacks[e].inputData;const t=this._jsCallFuncCallbacks[e].callback,o=this._jsCallFuncCallbacks[e].timeout;if(t){try{t.call(this,i)}catch(e){console.error("Call callback error",e)}o&&clearTimeout(o)}}const o={action:i.action,error:i.error_code,message:i.error_message,data:{}};try{if(i.action===fi.OPEN_INAPP.name||i.action===fi.OPEN_OUTAPP.name){const e=new URL(n.url),t=`${e.protocol}//${e.host}${e.pathname}`;o.data={url:t}}}catch(e){}this.results.push(o)}catch(e){console.log("onMultiJSCall","error",e)}}nativeEventHandler(e,t,i){this.debug(`eventId: ${e}, eventName: ${t}, eventData: ${i}`);const n=$i(i);this.debug(n);const o=this.handleEventData(t,n);this.events.emit(t,e,o)}handleEventData(t,i){try{switch(t){case e.Events.OpenApp:const{url:t}=i,n=new URL(t),o=n.pathname.split(`/zapps/${Zt}`)[1];return{path:`${o||"/"}${n.search}`};default:return i}}catch(e){return i}}defaultCallback(e){null!=e&&(e=Fi(e))}callNative(e,t,i){return this.debug(e.name,t),new Promise(((r,a)=>n(this,void 0,void 0,(function*(){const s=t=>n(this,void 0,void 0,(function*(){var n,o,s,c,l,d,u,h;try{if(Jt.isUndefined(t)||Jt.isNull(t))return a(new Error("Native callback is null"));if(0!==t.error_code){let i=new Ci(t.error_code,t.error_message);const r=Wi();if(e===fi.JUMP_LOGIN)i=new Ci(si,`Can not get auth code: ${t.error_message}`);else if(this.isJumped||e.skip_jump){if("permission required!"===String(i.message).toLowerCase()||"no permission!"===String(i.message).toLowerCase())i=new Ci(vi.FORBIDDEN.code,vi.FORBIDDEN.message);else if(gi[r][t.error_code])i=new Ci(gi[r][t.error_code].code,gi[r][t.error_code].message);else if(null===(o=null===(n=e.error_list)||void 0===n?void 0:n[r])||void 0===o?void 0:o[String(t.error_code)]){let n=e.error_list[r][String(t.error_code)].map_to.message;(null===(l=null===(c=null===(s=e.error_list)||void 0===s?void 0:s[r])||void 0===c?void 0:c[String(t.error_code)])||void 0===l?void 0:l.need_more_detail)&&(n=`${null===(h=null===(u=null===(d=e.error_list)||void 0===d?void 0:d[r])||void 0===u?void 0:u[String(t.error_code)])||void 0===h?void 0:h.map_to.message}: ${t.error_message}`),i=new Ci(e.error_list[r][String(t.error_code)].map_to.code,n)}}else i=new Ci(vi.UNAUTHORIZED.code,vi.UNAUTHORIZED.message);return a(i)}if(null==i?void 0:i.successCallback){const e=yield i.successCallback(t.data);return r(e)}r(t.data||{})}catch(e){return a(e)}}));e.skip_jump||(yield this.jump());const c=Mi().isIOS,l=(e=>{var t;const i=xi(),n=(null===(t=null==e?void 0:e.version_live)||void 0===t?void 0:t.iOS)||0;return!!(Array.isArray(window.ignoreCheckSupport)&&window.ignoreCheckSupport.length>0&&window.ignoreCheckSupport.includes(e.name))||i>=n})(e);if(c&&!l){const e=new Ci(-5,"Client isn't support this action");return a(e)}(null==i?void 0:i.delay)?setTimeout((()=>{o(this,Sn,"m",Tn).call(this,e,t,s,null==i?void 0:i.isMultiCallback,null==i?void 0:i.nRetry,null==i?void 0:i.haveTimeout)}),i.delay):o(this,Sn,"m",Tn).call(this,e,t,s,null==i?void 0:i.isMultiCallback,null==i?void 0:i.nRetry,null==i?void 0:i.haveTimeout)}))))}}En=new WeakMap,On=new WeakMap,An=new WeakMap,Sn=new WeakSet,Tn=function e(t,i,n,r=!1,a=3,s=!0){try{const c=t.name,l=((e="")=>`${e.normalize("NFD").replace(ki,"").replace(Di,"d").replace(Ri,"").toLowerCase()}_${Math.random().toString(36).substr(2,4)}`)(c);if(!this._device.isMobile||Jt.isEmpty(c))return this.onJSCall(l,{error_code:-13,error_message:"params invalid!",data:{device:this._device.isMobile,jsToken:this._jsAccessTk,access_token:this._accessTk},action:c}),!1;null==i&&(i={}),n||(n=this.defaultCallback);const d={error_code:-14,error_message:"Request Timeout!",data:{},action:c};this._jsCallFuncCallbacks[l]={inputData:i,timeout:s&&t.have_callback&&setTimeout((()=>{this.onJSCall(l,d)}),8e3),callback:n};try{return i=Ki(i),r?this._device.isIOS?ZaloJavaScriptInterface.jsCall(this._jsAccessTk,c,this._accessTk,i,window.onMultiJSCall(l)):ZaloJavaScriptInterface.jsCall(this._jsAccessTk,c,this._accessTk,i,`window.onMultiJSCall('${l}')`):this._device.isIOS?ZaloJavaScriptInterface.jsCall(this._jsAccessTk,c,this._accessTk,i,window.onJSCall(l)):ZaloJavaScriptInterface.jsCall(this._jsAccessTk,c,this._accessTk,i,`window.onJSCall('${l}')`)}catch(s){if(!(a-- >0)){const e={error_code:-5,error_message:"Not ready!",data:{userAgent:this._userAgent,options:i,jsToken:this._jsAccessTk,access_token:this._accessTk},action:c,js_error:s};return this.onJSCall(l,e),!1}setTimeout((()=>{o(this,Sn,"m",e).call(this,t,i,n,r,a)}),500)}}catch(e){console.log("jsCall","error",e)}return!1};class to{constructor(e){bn.set(this,void 0),Cn.set(this,void 0),wn.set(this,void 0),r(this,Cn,{keys:new Set,currentSize:0,limitSize:oi},"f"),r(this,bn,e,"f"),r(this,wn,eo.getInstance(),"f")}get(e){return n(this,void 0,void 0,(function*(){return yield o(this,wn,"f").callNative(fi.ZBROWSER_MPDS,{mpds_action:"mpds.get",mpds_data:{keys:e},appId:o(this,bn,"f")},{isMultiCallback:!1}).then((e=>{let t=new Map;return e&&e.mpds_data&&e.mpds_data.map&&(t=new Map(Object.entries(e.mpds_data.map))),t}))}))}set(e){return n(this,void 0,void 0,(function*(){return{errorKeys:yield o(this,wn,"f").callNative(fi.ZBROWSER_MPDS,{mpds_action:"mpds.set",mpds_data:{map:e},appId:o(this,bn,"f")},{isMultiCallback:!1}).then((e=>{let t=[];return e&&e.mpds_data&&e.mpds_data.error_keys&&(t=e.mpds_data.error_keys),t}))}}))}getInfo(){return n(this,void 0,void 0,(function*(){const e=yield o(this,wn,"f").callNative(fi.ZBROWSER_MPDS,{mpds_action:"mpds.get.size",mpds_data:{},appId:o(this,bn,"f")},{isMultiCallback:!1}).then((e=>{let t=0;return e&&e.mpds_data&&e.mpds_data.size&&(t=e.mpds_data.size),t}));return{currentSize:Jt.isNumber(e)?Number(e/1024):0,limitSize:Number(5120)}}))}remove(e){return n(this,void 0,void 0,(function*(){return{errorKeys:yield o(this,wn,"f").callNative(fi.ZBROWSER_MPDS,{mpds_action:"mpds.remove.key",mpds_data:{keys:e},appId:o(this,bn,"f")},{isMultiCallback:!1}).then((e=>{let t=[];return e&&e.mpds_data&&e.mpds_data.error_keys&&(t=e.mpds_data.error_keys),t}))}}))}clear(){return n(this,void 0,void 0,(function*(){yield o(this,wn,"f").callNative(fi.ZBROWSER_MPDS,{mpds_action:"mpds.clear.appData",mpds_data:{},appId:o(this,bn,"f")})}))}}bn=new WeakMap,Cn=new WeakMap,wn=new WeakMap;class io{getDataFromStorage(e){return n(this,void 0,void 0,(function*(){const t=this.getInstance(),i=yield t.get(e),n={};return i.forEach(((e,t)=>{n[t]=$i(e)})),n}))}putDataToStorage(e){return n(this,void 0,void 0,(function*(){const t=this.getInstance(),i={};return Object.entries(e).forEach((([e,t])=>{Jt.isUndefined(t)||Jt.isNull(t)||(i[e]=Gi(t))})),yield t.set(i)}))}removeDataFromStorage(e){return n(this,void 0,void 0,(function*(){const t=this.getInstance();return yield t.remove(e)}))}clearStorage(){return n(this,void 0,void 0,(function*(){const e=this.getInstance();yield e.clear()}))}getStorageInfo(){return n(this,void 0,void 0,(function*(){const e=this.getInstance();return yield e.getInfo()}))}}class no extends io{constructor(e){super(),Nn.set(this,void 0),r(this,Nn,e,"f")}getInstance(){return new fn(o(this,Nn,"f"))}}Nn=new WeakMap;class oo extends io{constructor(e){super(),In.set(this,void 0),r(this,In,e,"f")}getInstance(){return new to(o(this,In,"f"))}}In=new WeakMap;class ro{static setStorage(e){return n(this,void 0,void 0,(function*(){let t=new no(this.getAppId());return Hi()&&(t=new oo(this.getAppId())),yield t.putDataToStorage(e.data)}))}static getStorage(e){return n(this,void 0,void 0,(function*(){let t=new no(this.getAppId());Hi()&&(t=new oo(this.getAppId()));return yield t.getDataFromStorage(e.keys)}))}static getStorageInfo(e){return n(this,void 0,void 0,(function*(){let e=new no(this.getAppId());return Hi()&&(e=new oo(this.getAppId())),yield e.getStorageInfo()}))}static removeStorage(e){return n(this,void 0,void 0,(function*(){let t=new no(this.getAppId());return Hi()&&(t=new oo(this.getAppId())),yield t.removeDataFromStorage(e.keys)}))}static clearStorage(e={}){return n(this,void 0,void 0,(function*(){let e=new no(this.getAppId());Hi()&&(e=new oo(this.getAppId())),yield e.clearStorage()}))}}class ao{static getUserInfo(e){return n(this,void 0,void 0,(function*(){const t=yield this.getAccessToken();let i="id,name,user_id_by_oa,picture";(null==e?void 0:e.avatarType)&&(i=`${i}.type(${null==e?void 0:e.avatarType})`);return{userInfo:yield fetch(`${Qt}?fields=${i}`,{headers:{access_token:t||""}}).then((e=>n(this,void 0,void 0,(function*(){const t=yield e.json(),i={id:t.id,name:t.name,avatar:t.picture&&t.picture.data&&t.picture.data.url,idByOA:t.user_id_by_oa};return console.warn("'birthday' and 'gender' are deprecated"),i}))))}}))}static getPhoneNumber(e){return n(this,void 0,void 0,(function*(){return yield this.getJSBridge().callNative(fi.MP_GET_NUMBER,{},{isMultiCallback:!0,successCallback:e=>{const t={number:e};return Promise.resolve(t)},delay:this.isIOS?400:0})}))}}class so{static closeApp(e){return n(this,void 0,void 0,(function*(){yield this.getJSBridge().callNative(fi.WINDOW_CLOSE,{})}))}static openMiniApp(e){return n(this,void 0,void 0,(function*(){const t=null==e?void 0:e.appId,i=(null==e?void 0:e.params)||{},n=Object.entries(i).map((function([e,t]){return[e,t].join("=")})).join("&");let o;try{o=yield qi(t,0)}catch(e){}const r={appId:t};o&&(r.appName=o.name,r.appAvtUrl=o.logoUrl),yield this.getJSBridge().callNative(fi.OPEN_MP,{mpUrl:`https://h5.zdn.vn/zapps/${t}/${n.length>0?"?"+n:""}`,mpInfo:r})}))}static openWebview(e){return n(this,void 0,void 0,(function*(){yield this.getJSBridge().callNative(fi.OPEN_INAPP,{url:e})}))}static closeLoading(e){return n(this,void 0,void 0,(function*(){yield this.getJSBridge().callNative(fi.MP_CLOSE_LOADINGVIEW,{at:(new Date).getTime(),when:e,url:location.href})}))}}class co{static getLocation(e){return n(this,void 0,void 0,(function*(){return yield this.getJSBridge().callNative(fi.GET_LOCATION,{silent_request:!1,permission_description:"Cho phép Zalo truy cập vào vị trí của thiết bị này?"},{isMultiCallback:!0,haveTimeout:!1,successCallback:e=>{const t={latitude:e.latitude,longitude:e.longitude,timestamp:e.timestamp,provider:e.provider};return Promise.resolve(t)},delay:this.isIOS?400:0})}))}static sendLocation(e){return n(this,void 0,void 0,(function*(){yield this.getJSBridge().callNative(fi.QUERY_LOCATION_HIDE,{title:e.title,touserid:e.toUserId,zapp:this.getZAppId()})}))}}class lo{static requestCameraPermission(e){return n(this,void 0,void 0,(function*(){return yield this.getJSBridge().callNative(fi.REQUEST_PERMISSION_CAMERA,{},{successCallback:e=>Promise.resolve({userAllow:(null==e?void 0:e.error_code)>=0,message:null==e?void 0:e.error_message})})}))}static saveImageToPhotosAlbum(e){return n(this,void 0,void 0,(function*(){let t={};return Jt.isEmpty(e.imageBase64Data)?Jt.isEmpty(e.imageUrl)||(t={imageUrl:e.imageUrl}):t={imageBase64Data:e.imageBase64Data},yield this.getJSBridge().callNative(fi.SAVE_IMAGE_GALLERY,Object.assign({},t))}))}}class uo{static viewOAQr(e){return n(this,void 0,void 0,(function*(){yield this.getJSBridge().callNative(fi.VIEW_MYQR,{dpn:e.displayName,uid:e.id,zapp:this.getZAppId()},{haveTimeout:!1})}))}static openProfile(t){return n(this,void 0,void 0,(function*(){return yield this.getJSBridge().callNative(fi.OPEN_PROFILE,{uId:t.id,type:e.ProfileType[t.type],zapp:this.getZAppId(),sourceId:t.sourceId,sourceIndex:t.sourceIndex})}))}static openChat(t){return n(this,void 0,void 0,(function*(){return yield this.getJSBridge().callNative(fi.OPEN_CHAT,{uId:t.id,type:e.ChatType[t.type],msg:t.message||"",zapp:this.getZAppId(),sourceId:t.sourceId,sourceIndex:t.sourceIndex})}))}static openPostFeed(t){return n(this,void 0,void 0,(function*(){let i={};switch(t.type){case"image":i={photoUrl:t.data.imageUrl};break;case"link":i={link:t.data.link,title:t.data.title,thumb:t.data.thumb,description:t.data.description};break;case"profile":i={avt:t.data.avatar,uid:t.data.id,dpn:t.data.displayName}}return yield this.getJSBridge().callNative(fi.OPEN_POSTFEED,Object.assign(Object.assign({type:e.PostFeedType[t.type]},i),{zapp:this.getZAppId()})).then((e=>({status:e.status,shareType:e.share_type,numberOfUser:e.uid_to_size})))}))}static followOA(e){return n(this,void 0,void 0,(function*(){yield this.getJSBridge().callNative(fi.FOLLOW_OA,{uid:e.id,showDialogConfirm:!0,zapp:this.getZAppId()},{haveTimeout:!1})}))}static unfollowOA(e){return n(this,void 0,void 0,(function*(){yield this.getJSBridge().callNative(fi.UNFOLLOW_OA,{uid:e.id,zapp:this.getZAppId()},{haveTimeout:!1})}))}static openShareSheet(t){return n(this,void 0,void 0,(function*(){let i={},n=t.type;switch(t.type){case"image":let e=[];const o=xi(),r=Wi();o>=yi[r]&&(n="multi_image"),Array.isArray(t.data.imageUrls)&&t.data.imageUrls.length>0?e=t.data.imageUrls:e.push(t.data.imageUrl),i={photoUrls:e,photoUrl:t.data.imageUrl,caption:t.data.caption};break;case"gif":i={photoUrl:t.data.imageUrl,gifUrl:t.data.gifUrl,width:t.data.width,height:t.data.height};break;case"video":i={videoThumb:t.data.videoThumb,videoUrl:t.data.videoUrl,width:t.data.width,height:t.data.height};break;case"link":i={link:t.data.link,chatOnly:t.data.chatOnly?1:0};break;case"oa":i={uid:t.data.id};break;case"zmp":const a=yield this.getAccessToken(),s=yield Vi(this.getAppId(),a||"",t.data.title||"",t.data.description||"",t.data.thumbnail||"",t.data.path);i={data:{ZInstantAPIInfo:{url:`${s.zinstantApi}`,zinstantdata_id:`templateId=${s.ztemplateId}&appId=${this.getAppId()}&shareId=${s.shareId}`},previewMsgText:{msg:{en:"Zalo Mini Program",vi:"Chương trình nhỏ"}},enableReactions:1}}}return yield this.getJSBridge().callNative(fi.OPEN_SHARESHEET,Object.assign(Object.assign({type:e.ShareSheetType[n]},i),{zapp:this.getZAppId()}),{haveTimeout:!1}).then((e=>({status:e.status,shareType:e.share_type,numberOfUser:e.uid_to_size})))}))}static createShortcut(e,t,i){return n(this,void 0,void 0,(function*(){return yield this.getJSBridge().callNative(fi.CREATE_SHORTCUT,{url:e,title:t,iconUrl:i})}))}static openProfilePicker(e){return n(this,void 0,void 0,(function*(){return yield this.getJSBridge().callNative(fi.MP_OPEN_PROFILE_PICKER,{maxProfile:e},{isMultiCallback:!0,successCallback:e=>{if(Array.isArray(e))return Promise.resolve(e.map((e=>e.id)))}})}))}static getActionsSupported(t){return n(this,void 0,void 0,(function*(){return yield this.getJSBridge().callNative(fi.GET_SUPPORTED_ACTIONS,{},{isMultiCallback:!1,successCallback:t=>{const i=Wi();if(Array.isArray(t.actions)&&t.actions.length>0){const e=Object.keys(fi).filter((e=>fi[e].skip_jump)),i={actions:[...t.actions,...e]};return Promise.resolve(i)}if(i===e.PlatformType.iOS){const e={actions:_i};return Promise.resolve(e)}}})}))}static openMediaPicker(t,i,o,r,a,s){return n(this,void 0,void 0,(function*(){const n={type:0,url:i,maxSize:o||1048576};return yield this.getJSBridge().callNative(fi.PICK_MEDIA,{media_type:e.MediaPickerType[t],edit_view:Object.assign(Object.assign({},{enable:1,aspect_ratio:"1:1"}),r),silent_request:a,upload:n,max_select_items:s},{isMultiCallback:!0,successCallback:e=>{const t={data:null==e?void 0:e.result_content};return Promise.resolve(t)}})}))}static openOutApp(e){return n(this,void 0,void 0,(function*(){return yield this.getJSBridge().callNative(fi.OPEN_OUTAPP,{url:e})}))}}class ho{static getRouteParams(){let e={};const t=window.location.href;try{let i=new URL(t).searchParams.toString();i&&(e=Pi.getParamsAsObject(i))}catch(e){throw new Error("Url không hợp lệ")}return e}static sendDataToPreviousMiniApp(e){return n(this,void 0,void 0,(function*(){return yield this.getJSBridge().callNative(fi.WEBVIEW_SET_RESULT,{result:Gi(e.data)})}))}static onCallbackData(t){return n(this,void 0,void 0,(function*(){yield this.events.on(e.Events.OnDataCallback,(e=>{t({data:e})}))}))}}class po{constructor(){var e,t,i,a,s,c,l,d,u,h,p,v,f,g,m,y,_;Pn.set(this,Vt),kn.set(this,Zt),Dn.set(this,qt),Rn.set(this,void 0),Bn.set(this,void 0),jn.set(this,void 0),Un.set(this,null),Mn.set(this,{timer:{getToken:0}}),Ln.set(this,void 0),xn.set(this,void 0),Wn.set(this,void 0),zn.set(this,void 0),Jn.set(this,void 0),this.events=Qi.getInstance(),this.isIOS=Mi().isIOS,Fn.set(this,void 0),Kn.set(this,void 0),Hn.set(this,void 0),this.getActionBarConfig=()=>o(this,Fn,"f"),this.setActionBarConfig=e=>{r(this,Fn,e(o(this,Fn,"f")),"f")},this.getAuthCode=()=>n(this,void 0,void 0,(function*(){var e,t;return{authCode:null===(e=yield o(this,Ln,"f").getCookie(Yt.ZOAUTH))||void 0===e?void 0:e.value,authCodeVerify:null===(t=yield o(this,Ln,"f").getCookie(Yt.ZOAUTH_VRF))||void 0===t?void 0:t.value}})),this.setAccessToken=e=>{r(this,Hn,!1,"f"),r(this,jn,e,"f"),o(this,Ln,"f").accessTk=e,window.ZJSBridge.setZAccSession&&window.ZJSBridge.setZAccSession(e)},this.getVersion=an.getVersion,this.getSystemInfo=an.getSystemInfo,this.setNavigationBarTitle=sn.setNavigationBarTitle,this.setNavigationBarColor=sn.setNavigationBarColor,this.setNavigationBarLeftButton=sn.setNavigationBarLeftButton,this.setBackgroundColor=cn.setBackgroundColor,this.setDeviceOrientation=un.setDeviceOrientation,this.setStorage=ro.setStorage,this.getStorage=ro.getStorage,this.getStorageInfo=ro.getStorageInfo,this.removeStorage=ro.removeStorage,this.clearStorage=ro.clearStorage,this.getUserInfo=ao.getUserInfo,this.getNetworkType=un.getNetworkType,this.onNetworkStatusChange=un.onNetworkStatusChange,this.startBeaconDiscovery=un.startBeaconDiscovery,this.stopBeaconDiscovery=un.stopBeaconDiscovery,this.getBeacons=un.getBeacons,this.closeApp=so.closeApp,this.getLocation=co.getLocation,this.stopBluetoothDevicesDiscovery=un.stopBluetoothDevicesDiscovery,this.startBluetoothDevicesDiscovery=un.stopBluetoothDevicesDiscovery,this.openBluetoothAdapter=un.openBluetoothAdapter,this.onBluetoothDeviceFound=un.onBluetoothDeviceFound,this.onBluetoothAdapterStateChange=un.onBluetoothAdapterStateChange,this.getConnectedBluetoothDevices=un.getConnectedBluetoothDevices,this.getBluetoothDevices=un.getBluetoothDevices,this.getBluetoothAdapterState=un.getBluetoothAdapterState,this.closeBluetoothAdapter=un.closeBluetoothAdapter,this.scanQRCode=un.scanQRCode,this.openProfile=uo.openProfile,this.openChat=uo.openChat,this.openPostFeed=uo.openPostFeed,this.followOA=uo.followOA,this.unFollowOA=uo.unfollowOA,this.openShareSheet=uo.openShareSheet,this.requestCameraPermission=lo.requestCameraPermission,this.createShortcut=uo.createShortcut,this.openBioAuthentication=un.openBioAuthentication,this.checkStateBioAuthentication=un.checkStateBioAuthentication,this.sendLocation=co.sendLocation,this.showToast=un.showToast,this.hideKeyboard=un.hideKeyboard,this.openPhone=un.openPhone,this.openSMS=un.openSMS,this.viewOAQr=uo.viewOAQr,this.keepScreen=un.keepScreen,this.saveImageToPhotosAlbum=lo.saveImageToPhotosAlbum,this.openMiniApp=so.openMiniApp,this.vibrate=un.vibrate,this.openWebview=so.openWebview,this.getRouteParams=ho.getRouteParams,this.getAppInfo=an.getAppInfo,this.sendDataToPreviousMiniApp=ho.sendDataToPreviousMiniApp,this.onCallbackData=ho.onCallbackData,this.getPhoneNumber=ao.getPhoneNumber,this.openProfilePicker=uo.openProfilePicker,Gn.set(this,uo.getActionsSupported),this.connectWifi=un.connectWifi,this.openMediaPicker=uo.openMediaPicker,this.openOutApp=uo.openOutApp,this.closeLoading=so.closeLoading,this.openAppStore=un.openAppStore,r(this,Rn,null,"f"),r(this,Bn,null,"f"),r(this,jn,null,"f"),this.isShowNavBar=!0,r(this,xn,(new Date).getTime(),"f"),r(this,Wn,0,"f"),r(this,zn,"","f"),r(this,Jn,null,"f"),r(this,Ln,eo.getInstance(),"f"),r(this,Kn,0,"f"),r(this,Hn,!1,"f");const S="home"===(null===(t=null===(e=o(this,Dn,"f"))||void 0===e?void 0:e.app)||void 0===t?void 0:t.leftButton)||"both"===(null===(a=null===(i=o(this,Dn,"f"))||void 0===i?void 0:i.app)||void 0===a?void 0:a.leftButton)?Oi:Ai,E=new URL(location.href),O=Jt.isString(null===(c=null===(s=o(this,Dn,"f"))||void 0===s?void 0:s.app)||void 0===c?void 0:c.headerColor)&&(null===(u=null===(d=null===(l=o(this,Dn,"f"))||void 0===l?void 0:l.app)||void 0===d?void 0:d.headerColor)||void 0===u?void 0:u.length)>0?5:6,A="none"===(null===(p=null===(h=o(this,Dn,"f"))||void 0===h?void 0:h.app)||void 0===p?void 0:p.leftButton)||"home"===(null===(f=null===(v=o(this,Dn,"f"))||void 0===v?void 0:v.app)||void 0===f?void 0:f.leftButton)?Ei:Si;r(this,Fn,{actionbarType:O,buttonType:A,dataConfig:{backgroundColor:(null===(m=null===(g=o(this,Dn,"f"))||void 0===g?void 0:g.app)||void 0===m?void 0:m.headerColor)||"",textColor:(null===(_=null===(y=o(this,Dn,"f"))||void 0===y?void 0:y.app)||void 0===_?void 0:_.textColor)||"",viewInLeftType:A,confirmToExit:1},homeConfig:{enable:S,url:`https://h5.zdn.vn/zapps/${this.getAppId()}/${E.search}`}},"f")}static getInstance(){return po.instance||(po.instance=new po),po.instance}getLoginStatus(){return Jt.isString(o(this,jn,"f"))&&o(this,jn,"f").length>0}getAppId(){return o(this,kn,"f")}getZAppId(){return o(this,Pn,"f")}getDeviceId(){var e;return n(this,void 0,void 0,(function*(){return null===(e=yield o(this,Ln,"f").getCookie(Yt.DEVICE_ID))||void 0===e?void 0:e.value}))}getDeviceIdSync(){var e;return null===(e=o(this,Ln,"f").getCookieSync(Yt.DEVICE_ID))||void 0===e?void 0:e.value}getContext(){var e,t;return n(this,void 0,void 0,(function*(){const i=null===(e=yield o(this,Ln,"f").getCookie(Yt.CONTEXT_ID))||void 0===e?void 0:e.value;return{type:null===(t=yield o(this,Ln,"f").getCookie(Yt.CONTEXT_TYPE))||void 0===t?void 0:t.value,id:i}}))}getContextSync(){var e,t;const i=null===(e=o(this,Ln,"f").getCookieSync(Yt.CONTEXT_ID))||void 0===e?void 0:e.value;return{type:null===(t=o(this,Ln,"f").getCookieSync(Yt.CONTEXT_TYPE))||void 0===t?void 0:t.value,id:i}}getJSBridge(){return o(this,Ln,"f")}login(e){return n(this,void 0,void 0,(function*(){r(this,Hn,!0,"f");let e=(new Date).getTime()-o(this,xn,"f");const t=this;if(r(this,Kn,+o(this,Kn,"f")+1,"f"),o(this,Kn,"f")>1&&(yield function(){return n(this,void 0,void 0,(function*(){return yield new Promise((e=>{const i=setInterval((()=>{(o(t,Kn,"f")<=1||o(t,jn,"f"))&&(e("done"),clearInterval(i))}),200)}))}))}()),e=(new Date).getTime()-o(this,xn,"f"),o(this,jn,"f")&&e<o(this,Wn,"f"))return r(this,Kn,+o(this,Kn,"f")-1,"f"),o(this,jn,"f");const i=yield(yield this.getAuthCode()).authCode,a=yield(yield this.getAuthCode()).authCodeVerify;if(i){if(r(this,Rn,i,"f"),a?(r(this,Bn,a,"f"),yield this.loginZaloV4()):yield this.loginZaloV3(),r(this,Kn,+o(this,Kn,"f")-1,"f"),!o(this,jn,"f"))throw Ii.loginFailed("Invalid authorization code");return o(this,jn,"f")}throw r(this,Kn,+o(this,Kn,"f")-1,"f"),Ii.loginFailed("Zalo app has not been activated")}))}loginZaloV3(){return n(this,void 0,void 0,(function*(){return yield fetch(`${ei}?app_id=${o(this,Pn,"f")}&redirect_uri=https://h5.zdn.vn/zapps/${o(this,kn,"f")}/&code=${o(this,Rn,"f")}&isSDK=true`).then((e=>n(this,void 0,void 0,(function*(){let t=yield e.json();if(t.access_token){r(this,jn,t.access_token,"f");const e=1e3*parseInt(t.expires_in);return r(this,Wn,e,"f"),r(this,xn,(new Date).getTime(),"f"),o(this,Ln,"f").accessTk=o(this,jn,"f")||"",window.ZJSBridge.setZAccSession&&window.ZJSBridge.setZAccSession(o(this,jn,"f")||""),o(this,jn,"f")}return null}))))}))}loginZaloV4(){return n(this,void 0,void 0,(function*(){const e=new URLSearchParams;e.append("app_id",o(this,kn,"f")),e.append("code",o(this,Rn,"f")||""),e.append("code_verifier",o(this,Bn,"f")||""),Jt.isNull(o(this,Un,"f"))?e.append("grant_type","authorization_code"):(e.append("grant_type","refresh_token"),e.append("refresh_token",o(this,Un,"f")||""));return yield fetch(Xt,Object.assign({method:"POST",body:e},{headers:{"Content-Type":"application/x-www-form-urlencoded"}})).then((e=>n(this,void 0,void 0,(function*(){const t=yield e.json();if(t.refresh_token&&r(this,Un,t.refresh_token,"f"),t.access_token){r(this,jn,t.access_token,"f");const e=1e3*parseInt(t.expires_in);return r(this,Wn,e,"f"),r(this,xn,(new Date).getTime(),"f"),o(this,Ln,"f").accessTk=o(this,jn,"f")||"",window.ZJSBridge.setZAccSession&&window.ZJSBridge.setZAccSession(o(this,jn,"f")||""),o(this,jn,"f")}return null}))))}))}getAccessToken(e){return n(this,void 0,void 0,(function*(){const e=(new Date).getTime()-o(this,xn,"f");if(o(this,Hn,"f"))return o(this,jn,"f")&&e<o(this,Wn,"f")?o(this,jn,"f"):(r(this,jn,"","f"),yield this.login());if(!o(this,jn,"f"))throw Ii.loginRequired();return o(this,jn,"f")}))}}Pn=new WeakMap,kn=new WeakMap,Dn=new WeakMap,Rn=new WeakMap,Bn=new WeakMap,jn=new WeakMap,Un=new WeakMap,Mn=new WeakMap,Ln=new WeakMap,xn=new WeakMap,Wn=new WeakMap,zn=new WeakMap,Jn=new WeakMap,Fn=new WeakMap,Kn=new WeakMap,Hn=new WeakMap,Gn=new WeakMap;class vo{constructor(){$n.set(this,Vt),Vn.set(this,qt),Zn.set(this,"DEFAULT ZOAUTH"),qn.set(this,"DEFAULT ACCESS TOKEN"),Yn.set(this,{timer:{getToken:0}}),Qn.set(this,!1),this.getLoginStatus=()=>o(this,Qn,"f"),this.getAppId=()=>o(this,$n,"f"),this.getDeviceId=()=>n(this,void 0,void 0,(function*(){return Promise.resolve("")})),this.getDeviceIdSync=()=>"",this.login=()=>(r(this,Qn,!0,"f"),Promise.resolve(o(this,Zn,"f"))),this.getAccessToken=()=>Promise.resolve(o(this,qn,"f")),this.getVersion=an.getVersion,this.getSystemInfo=an.getSystemInfo,this.setNavigationBarTitle=()=>Promise.resolve(),this.setNavigationBarColor=()=>Promise.resolve(),this.setBackgroundColor=()=>Promise.resolve(),this.setNavigationBarLeftButton=()=>Promise.resolve(),this.setDeviceOrientation=()=>Promise.resolve(),this.setStorage=e=>n(this,void 0,void 0,(function*(){const t=new no(this.getAppId());return yield t.putDataToStorage(e.data),{errorKeys:[]}})),this.getStorage=e=>n(this,void 0,void 0,(function*(){const t=new no(this.getAppId());return yield t.getDataFromStorage(e.keys)})),this.getStorageInfo=e=>n(this,void 0,void 0,(function*(){const e=new no(this.getAppId());return yield e.getStorageInfo()})),this.removeStorage=e=>n(this,void 0,void 0,(function*(){const t=new no(this.getAppId());return yield t.removeDataFromStorage(e.keys)})),this.clearStorage=e=>n(this,void 0,void 0,(function*(){const e=new no(this.getAppId());return yield e.clearStorage()})),this.getUserInfo=()=>(console.warn("birthday and gender are deprecated"),Promise.resolve({userInfo:{id:"3368637342326461234",name:"User Name",avatar:"https://h5.zdn.vn/static/images/avatar.png"}})),this.getNetworkType=()=>{let t;switch((navigator.connection||navigator.mozConnection||navigator.webkitConnection).effectiveType){case"none":t=e.NetworkType.none;break;case"4g":t=e.NetworkType.wifi;break;case"3g":case"2g":t=e.NetworkType.cellular;break;default:t=e.NetworkType.unknown}const i={networkType:t};return Promise.resolve(i)},this.onNetworkStatusChange=t=>{const i=navigator.connection||navigator.mozConnection||navigator.webkitConnection,n=i.effectiveType;return i.addEventListener("change",(function(){let i;switch(n){case"none":i=e.NetworkType.none;break;case"4g":i=e.NetworkType.wifi;break;case"3g":case"2g":i=e.NetworkType.cellular;break;default:i=e.NetworkType.unknown}t({isConnected:!0,networkType:i})})),Promise.resolve()},this.startBeaconDiscovery=e=>Promise.resolve(!0),this.stopBeaconDiscovery=e=>Promise.resolve(!0),this.getBeacons=e=>Promise.resolve({beacons:[]}),this.closeApp=()=>Promise.resolve(),this.getLocation=()=>Promise.resolve({longitude:"105.788026",latitude:"21.0258773",timestamp:(new Date).getTime().toString(),provider:"fused"}),this.onBackButtonClick=()=>Promise.resolve(),this.stopBluetoothDevicesDiscovery=()=>Promise.resolve(),this.startBluetoothDevicesDiscovery=()=>Promise.resolve(),this.openBluetoothAdapter=()=>Promise.resolve(),this.onBluetoothDeviceFound=()=>Promise.resolve(),this.onBluetoothAdapterStateChange=()=>Promise.resolve(),this.getConnectedBluetoothDevices=()=>Promise.resolve(),this.getBluetoothDevices=()=>Promise.resolve(),this.getBluetoothAdapterState=()=>Promise.resolve(),this.closeBluetoothAdapter=()=>Promise.resolve(),this.scanQRCode=()=>Promise.resolve({content:"132"}),this.openProfile=()=>Promise.resolve(),this.openChat=()=>Promise.resolve(),this.openPostFeed=()=>Promise.resolve({status:1,shareType:0,numberOfUser:0}),this.followOA=()=>Promise.resolve(),this.unFollowOA=()=>Promise.resolve(),this.openShareSheet=()=>Promise.resolve({status:2,shareType:0,numberOfUser:0}),this.requestCameraPermission=()=>Promise.resolve({userAllow:!0,message:"Success"}),this.createShortcut=()=>Promise.resolve(),this.openBioAuthentication=()=>Promise.resolve({code:0,message:"OK",data:{domain:"",code:0,message:"",payToken:""}}),this.checkStateBioAuthentication=()=>Promise.resolve({bioState:""}),this.sendLocation=()=>Promise.resolve(),this.showToast=()=>Promise.resolve(),this.hideKeyboard=()=>Promise.resolve(),this.openPhone=()=>Promise.resolve(),this.openSMS=()=>Promise.resolve(),this.viewOAQr=()=>Promise.resolve(),this.keepScreen=()=>Promise.resolve(),this.saveImageToPhotosAlbum=()=>Promise.resolve(),this.openMiniApp=e=>Promise.resolve(),this.vibrate=()=>Promise.resolve(),this.openWebview=e=>(location.replace(e),Promise.resolve()),this.getRouteParams=ho.getRouteParams,this.getAppInfo=()=>Promise.resolve({description:"",name:"",version:"",appUrl:"",qrCodeUrl:""}),this.sendDataToPreviousMiniApp=e=>Promise.resolve(),this.onCallbackData=e=>(e({data:""}),Promise.resolve()),this.getPhoneNumber=()=>(console.warn("This api only works on zalo app"),Promise.resolve({number:""})),this.openProfilePicker=()=>(console.warn("This api only works on zalo app"),Promise.resolve([])),this.connectWifi=()=>(console.warn("This api only works on zalo app"),Promise.resolve()),this.openOutApp=e=>(location.href=e,Promise.resolve()),this.closeLoading=e=>Promise.resolve(),this.openAppStore=e=>Promise.resolve(),this.getAuthCode=()=>Promise.resolve({authCode:"",authCodeVerify:""})}getContext(){return n(this,void 0,void 0,(function*(){return Promise.resolve(null)}))}getContextSync(){return null}on(e,t,i){throw new Error("Method not implemented.")}once(e,t,i){throw new Error("Method not implemented.")}off(e,t,i,n){throw new Error("Method not implemented.")}removeAllListeners(e){throw new Error("Method not implemented.")}openMediaPicker(e,t,i,n,o,r){return console.warn("This api only works on zalo app"),Promise.resolve({data:""})}setAccessToken(e){}}$n=new WeakMap,Vn=new WeakMap,Zn=new WeakMap,qn=new WeakMap,Yn=new WeakMap,Qn=new WeakMap;const fo=Symbol("required"),go=Symbol("checkType"),mo=(e,t)=>(i,n,o)=>{let r=Reflect.getOwnMetadata(fo,i,n)||[];r.push({parameterIndex:o,fields:e,option:t}),Reflect.defineMetadata(fo,r,i,n)},yo=(e,t,i)=>(n,o,r)=>{let a=Reflect.getOwnMetadata(go,n,o)||[];a.push({parameterIndex:r,type:e,properties:t,defaultValue:i}),Reflect.defineMetadata(go,a,n,o)};function _o(e,t){Reflect.getMetadataKeys(e).map((i=>{const n=Reflect.getMetadata(i,e);Reflect.defineMetadata(i,n,t)}))}const So=(e,t={})=>i=>{var n;let o=Object.getOwnPropertyDescriptors(i.prototype);if(t.deep){let e=Object.getPrototypeOf(i);for(;e.prototype;){const t=Object.getOwnPropertyDescriptors(e.prototype);o=Object.assign(Object.assign({},t),o),e=Object.getPrototypeOf(e)}}for(const[r,a]of Object.entries(o)){const o="function"==typeof a.value&&"constructor"!=r;if(null===(n=t.exclude)||void 0===n?void 0:n.includes(r))continue;if(t.excludePrefix&&r.startsWith(t.excludePrefix))continue;if(!o)continue;const s=a.value;e(i,r,a),s!=a.value&&_o(s,a.value),Object.defineProperty(i.prototype,r,a)}},Eo=(e,t,i)=>{const n=i.value,o=function(e){return e.toString().match(/\(.*?\)/)[0].replace(/[()]/gi,"").replace(/\s/gi,"").split(",")}(n);return i.value=function(...i){try{const r=Reflect.getOwnMetadata(fo,e.prototype,t),a=Reflect.getOwnMetadata(go,e.prototype,t);a&&a.forEach((e=>{const{parameterIndex:t,type:n,properties:r,defaultValue:a}=e;let s=i[t],c=o[t];const l=typeof s;if(!Jt.isUndefined(s)){if(!zi(s,n))throw Ii.wrongTypeParam(c,n,Array.isArray(s)?"array":null===s?"null":l);"object"===n&&Object.entries(r).forEach((([e,n])=>{const o=e.split("?")[0],r=Jt.get(s,o);if(Jt.isUndefined(r)||Jt.isNull(r)){if(!e.includes("?"))throw Ii.missingParam(e);Jt.get(s,o.split(".")[0])||!a||Jt.isUndefined(Jt.get(a,o))||Jt.set(i[t],o,Jt.get(a,o))}else if(Jt.isFunction(n)){const e=n(r);if(e&&e.error)throw Ii.wrongTypeParam(`${c}.${o}`,e.errorMessage,typeof r)}}))}})),r&&r.forEach((e=>{const{parameterIndex:t,option:n,fields:o}=e,r=i[t],a=null==n?void 0:n.if,s=null==n?void 0:n.defaultValue;let c=!0;a&&(c=Object.keys(a).every((e=>Jt.get(r,e)===a[e]))),c&&o.forEach((e=>{const n=e=>{let n=!1;return Jt.isEmpty(Jt.get(r,e))&&(Jt.isUndefined(Jt.get(s,e))||Jt.set(i[t],e,Jt.get(s,e)),n=!0),n};if(Array.isArray(e)&&e.length>0&&e.every(n))throw Ii.missingParam(e.join(" or "));if(Jt.isString(e)&&n(e))throw Ii.missingParam(e)}))}));const s=n.call(this,...i);if(Jt.isPromise(s)){const{success:e,fail:n}=Array.isArray(i)&&i.length>0&&i[0];return new Promise(((i,o)=>{s.then((t=>{!Jt.isNull(e)&&Jt.isFunction(e)?e.call(null,t,this):i(s)})).catch((e=>{const i=wi(e,t);!Jt.isNull(n)&&Jt.isFunction(n)?n.call(null,i,this):o(i)}))}))}return s}catch(e){throw wi(e,t)}},i};var Oo,Ao,To,bo,Co;e.SDKCreator=class{constructor(){this.events=Qi.getInstance(),Oo.set(this,void 0),r(this,Oo,this.getServiceInstance(),"f"),this.events.addListener=(t,i,n)=>{const o=t;return this.events.addListener(e.Events[o],i,n)}}login(e){return n(this,void 0,void 0,(function*(){return yield o(this,Oo,"f").login(e)}))}getLoginStatus(){return o(this,Oo,"f").getLoginStatus()}getAccessToken(e){return n(this,void 0,void 0,(function*(){return yield o(this,Oo,"f").getAccessToken(e)}))}getVersion(){return o(this,Oo,"f").getVersion()}getSystemInfo(){return o(this,Oo,"f").getSystemInfo()}setNavigationBarTitle(e){return n(this,void 0,void 0,(function*(){return yield o(this,Oo,"f").setNavigationBarTitle(e)}))}setNavigationBarColor(e){return n(this,void 0,void 0,(function*(){return yield o(this,Oo,"f").setNavigationBarColor(e)}))}setBackgroundColor(e){return n(this,void 0,void 0,(function*(){return yield o(this,Oo,"f").setBackgroundColor(e)}))}setNavigationBarLeftButton(e){return n(this,void 0,void 0,(function*(){return yield o(this,Oo,"f").setNavigationBarLeftButton(e.type)}))}setDeviceOrientation(e){return n(this,void 0,void 0,(function*(){return yield o(this,Oo,"f").setDeviceOrientation(e)}))}setStorage(e){return n(this,void 0,void 0,(function*(){return yield o(this,Oo,"f").setStorage(e)}))}getStorage(e){return n(this,void 0,void 0,(function*(){return yield o(this,Oo,"f").getStorage(e)}))}getStorageInfo(e){return n(this,void 0,void 0,(function*(){return yield o(this,Oo,"f").getStorageInfo(e)}))}removeStorage(e){return n(this,void 0,void 0,(function*(){return yield o(this,Oo,"f").removeStorage(e)}))}clearStorage(e){return n(this,void 0,void 0,(function*(){return yield o(this,Oo,"f").clearStorage(e)}))}getUserInfo(e){return n(this,void 0,void 0,(function*(){return yield o(this,Oo,"f").getUserInfo(e)}))}getNetworkType(e){return n(this,void 0,void 0,(function*(){return yield o(this,Oo,"f").getNetworkType(e)}))}onNetworkStatusChange(e){return n(this,void 0,void 0,(function*(){return yield o(this,Oo,"f").onNetworkStatusChange(e)}))}startBeaconDiscovery(e){return n(this,void 0,void 0,(function*(){return yield o(this,Oo,"f").startBeaconDiscovery(e)}))}stopBeaconDiscovery(e){return n(this,void 0,void 0,(function*(){return yield o(this,Oo,"f").stopBeaconDiscovery(e)}))}getBeacons(e){return n(this,void 0,void 0,(function*(){return yield o(this,Oo,"f").getBeacons(e)}))}closeApp(e){return n(this,void 0,void 0,(function*(){return yield o(this,Oo,"f").closeApp(e)}))}getLocation(e){return n(this,void 0,void 0,(function*(){return yield o(this,Oo,"f").getLocation(e)}))}stopBluetoothDevicesDiscovery(){return n(this,void 0,void 0,(function*(){return yield o(this,Oo,"f").stopBluetoothDevicesDiscovery()}))}startBluetoothDevicesDiscovery(e){return n(this,void 0,void 0,(function*(){return yield o(this,Oo,"f").startBluetoothDevicesDiscovery(e)}))}openBluetoothAdapter(){return n(this,void 0,void 0,(function*(){return yield o(this,Oo,"f").openBluetoothAdapter()}))}onBluetoothDeviceFound(){return n(this,void 0,void 0,(function*(){return yield o(this,Oo,"f").onBluetoothDeviceFound()}))}onBluetoothAdapterStateChange(){return n(this,void 0,void 0,(function*(){return yield o(this,Oo,"f").onBluetoothAdapterStateChange()}))}getConnectedBluetoothDevices(e){return n(this,void 0,void 0,(function*(){return yield o(this,Oo,"f").getConnectedBluetoothDevices(e)}))}getBluetoothDevices(){return n(this,void 0,void 0,(function*(){return yield o(this,Oo,"f").getBluetoothDevices()}))}getBluetoothAdapterState(){return n(this,void 0,void 0,(function*(){return yield o(this,Oo,"f").getBluetoothAdapterState()}))}closeBluetoothAdapter(){return n(this,void 0,void 0,(function*(){return yield o(this,Oo,"f").closeBluetoothAdapter()}))}scanQRCode(e){return n(this,void 0,void 0,(function*(){return yield o(this,Oo,"f").scanQRCode(e)}))}openProfile(e){return n(this,void 0,void 0,(function*(){yield o(this,Oo,"f").openProfile(e)}))}openChat(e){return n(this,void 0,void 0,(function*(){yield o(this,Oo,"f").openChat(e)}))}openPostFeed(e){return n(this,void 0,void 0,(function*(){return yield o(this,Oo,"f").openPostFeed(e)}))}followOA(e){return n(this,void 0,void 0,(function*(){return yield o(this,Oo,"f").followOA(e)}))}unfollowOA(e){return n(this,void 0,void 0,(function*(){return yield o(this,Oo,"f").unFollowOA(e)}))}openShareSheet(e){return n(this,void 0,void 0,(function*(){return yield o(this,Oo,"f").openShareSheet(e)}))}requestCameraPermission(e){return n(this,void 0,void 0,(function*(){return yield o(this,Oo,"f").requestCameraPermission(e)}))}createShortcut(e){return n(this,void 0,void 0,(function*(){const t=yield qi(Zt,0),i=Mi().isIOS,n=t.logoUrl||Li("og:image:url")||"",r=t.name||document.title,a=e.params?new URLSearchParams(e.params):new URLSearchParams;if(a.append("utm_source","zalo-shortcut"),a.append("utm_medium","default"),a.append("utm_campaign","default"),i){a.append("appId",Zt),a.append("appName",r),a.append("appIcon",n);const e=`https://mini.zalo.me/shortcut.html?${a.toString()}`;yield o(this,Oo,"f").openOutApp(encodeURI(e))}else yield o(this,Oo,"f").createShortcut(`https://zalo.me/app/link/zapps/${Zt}/?${a.toString()}`,r,n);return Ni()}))}openBioAuthentication(e){return n(this,void 0,void 0,(function*(){return yield o(this,Oo,"f").openBioAuthentication(e)}))}checkStateBioAuthentication(e){return n(this,void 0,void 0,(function*(){return yield o(this,Oo,"f").checkStateBioAuthentication(e)}))}sendLocation(e){return n(this,void 0,void 0,(function*(){yield o(this,Oo,"f").sendLocation(e)}))}showToast(e){return n(this,void 0,void 0,(function*(){yield o(this,Oo,"f").showToast(e)}))}hideKeyboard(e){return n(this,void 0,void 0,(function*(){yield o(this,Oo,"f").hideKeyboard(e)}))}openPhone(e){return n(this,void 0,void 0,(function*(){return yield o(this,Oo,"f").openPhone(e)}))}openSMS(e){return n(this,void 0,void 0,(function*(){yield o(this,Oo,"f").openSMS(e)}))}viewOAQr(e){return n(this,void 0,void 0,(function*(){yield o(this,Oo,"f").viewOAQr(e)}))}keepScreen(e){return n(this,void 0,void 0,(function*(){return yield o(this,Oo,"f").keepScreen(e)}))}saveImageToGallery(e){return n(this,void 0,void 0,(function*(){return yield o(this,Oo,"f").saveImageToPhotosAlbum(e)}))}saveImageToPhotosAlbum(e){return n(this,void 0,void 0,(function*(){return yield o(this,Oo,"f").saveImageToPhotosAlbum(e)}))}openMiniApp(e){return n(this,void 0,void 0,(function*(){if(!Jt.isEmpty(e.params)){const t=e.params||{};Object.keys(t).forEach((e=>{"object"==typeof t[e]&&(t[e]=JSON.stringify(t[e])),t[e]=""+encodeURIComponent(t[e])})),e.params=t}yield o(this,Oo,"f").openMiniApp(e)}))}vibrate(e){return n(this,void 0,void 0,(function*(){yield o(this,Oo,"f").vibrate(e)}))}openWebview(e){return n(this,void 0,void 0,(function*(){const t=new URL(e.url),i=t.href.includes("vnpay"),n=t.searchParams.get("typeInapp");!i&&Jt.isEmpty(n)&&t.searchParams.set("typeInapp","1"),yield o(this,Oo,"f").openWebview(t.href)}))}getRouteParams(){return o(this,Oo,"f").getRouteParams()}getAppInfo(e){return o(this,Oo,"f").getAppInfo()}sendDataToPreviousMiniApp(e){return o(this,Oo,"f").sendDataToPreviousMiniApp(e)}onCallbackData(e){return n(this,void 0,void 0,(function*(){return yield o(this,Oo,"f").onCallbackData(e)}))}getPhoneNumber(e){return n(this,void 0,void 0,(function*(){return yield o(this,Oo,"f").getPhoneNumber()}))}openProfilePicker(e){return n(this,void 0,void 0,(function*(){const t=yield o(this,Oo,"f").openProfilePicker(e.maxProfile);let i;if(t.length>0)try{const e=yield this.getAccessToken(),n=yield fetch(ti,{method:"POST",headers:{"Content-Type":"application/json",access_token:e||""},body:JSON.stringify({fields:"id,name,picture",user_ids:t})}),o=yield n.json();if(0!==o.error||!o.data)throw new Error(o.message);i=t.map((e=>{var t,i,n,r,a,s,c,l,d,u,h;return{id:(null===(i=null===(t=o.data[e])||void 0===t?void 0:t.user_info)||void 0===i?void 0:i.user_id_by_app)||"",profile:{name:null===(r=null===(n=o.data[e])||void 0===n?void 0:n.user_info)||void 0===r?void 0:r.name,avatar:null===(l=null===(c=null===(s=null===(a=o.data[e])||void 0===a?void 0:a.user_info)||void 0===s?void 0:s.picture)||void 0===c?void 0:c.data)||void 0===l?void 0:l.url},code:0!==(null===(d=o.data[e])||void 0===d?void 0:d.error)?-1:0,message:`Get profile: ${Jt.isUndefined(null===(u=o.data[e])||void 0===u?void 0:u.message)?"Unknown error":null===(h=o.data[e])||void 0===h?void 0:h.message}`}}))}catch(e){i=t.map((t=>({id:t,profile:{name:"",avatar:""},code:-1,message:`Can't get profile: ${e.message}`})))}return{users:i||[]}}))}connectWifi(e){return n(this,void 0,void 0,(function*(){return yield o(this,Oo,"f").connectWifi(e)}))}openMediaPicker(e){var t,i,r;return n(this,void 0,void 0,(function*(){const n={};Jt.isUndefined(null===(t=e.editView)||void 0===t?void 0:t.enable)||(null===(i=e.editView)||void 0===i?void 0:i.enable)?n.enable=1:n.enable=0,n.aspect_ratio=null===(r=e.editView)||void 0===r?void 0:r.aspectRatio;const a=!0===e.silentRequest?1:0,s=e.maxSelectItem;return yield o(this,Oo,"f").openMediaPicker(e.type,e.serverUploadUrl,e.maxItemSize,n,a,s)}))}getShareableLink(e){return n(this,void 0,void 0,(function*(){const t=yield this.getAccessToken();return(yield Vi(window.APP_ID,t||"",e.title,e.description,e.thumbnail,e.path)).shareableLink}))}closeLoading(e){return n(this,void 0,void 0,(function*(){return yield o(this,Oo,"f").closeLoading("user action")}))}requestUpdateZalo(e){return n(this,void 0,void 0,(function*(){const e=Mi().isIOS?"https://apps.apple.com/vn/app/zalo/id579523206":"https://play.google.com/store/apps/details?id=com.zing.zalo";return yield o(this,Oo,"f").openOutApp(e)}))}onConfirmToExit(t){this.events.on(e.Events.AppClose,t,'{"handle_h5": 1}'),o(this,Oo,"f").setNavigationBarLeftButton(void 0,2)}offConfirmToExit(){this.events.off(e.Events.AppClose),o(this,Oo,"f").setNavigationBarLeftButton(void 0,0)}getDeviceId(){return o(this,Oo,"f").getDeviceIdSync()}getDeviceIdAsync(e){return n(this,void 0,void 0,(function*(){return yield o(this,Oo,"f").getDeviceId()}))}getContext(){return o(this,Oo,"f").getContextSync()}getContextAsync(e){return n(this,void 0,void 0,(function*(){return yield o(this,Oo,"f").getContext()}))}getAuthCode(e){return n(this,void 0,void 0,(function*(){return yield o(this,Oo,"f").getAuthCode()}))}setAccessToken(e){return o(this,Oo,"f").setAccessToken(e)}openOutApp(e){return n(this,void 0,void 0,(function*(){return yield o(this,Oo,"f").openOutApp(encodeURI(e.url))}))}},Oo=new WeakMap,t([i(0,yo("object",{title:Zi("string")}))],e.SDKCreator.prototype,"setNavigationBarTitle",null),t([i(0,yo("object",{color:Zi("string"),"textColor?":Zi("string",{values:["white","black"]}),"statusBarColor?":Zi("string")}))],e.SDKCreator.prototype,"setNavigationBarColor",null),t([i(0,yo("object",{backgroundColor:Zi("string"),"textColor?":Zi("string",{values:["white","black"]})}))],e.SDKCreator.prototype,"setBackgroundColor",null),t([i(0,yo("object",{type:Zi("string",{values:["none","back","home","both"]})}))],e.SDKCreator.prototype,"setNavigationBarLeftButton",null),t([i(0,yo("object",{rotate:Zi("string",{values:["auto","portrait","landscape"]})}))],e.SDKCreator.prototype,"setDeviceOrientation",null),t([i(0,yo("object",{data:Zi("object")}))],e.SDKCreator.prototype,"setStorage",null),t([i(0,yo("object",{keys:Zi("array<string>")}))],e.SDKCreator.prototype,"getStorage",null),t([i(0,yo("object",{keys:Zi("array<string>")}))],e.SDKCreator.prototype,"removeStorage",null),t([i(0,yo("object",{"avatarType?":Zi("string",{values:["small","normal","large"]})}))],e.SDKCreator.prototype,"getUserInfo",null),t([i(0,yo("object",{type:Zi("string",{values:["user","oa","aliasOA"]}),id:Zi("string")}))],e.SDKCreator.prototype,"openProfile",null),t([i(0,yo("object",{type:Zi("string",{values:["user","oa"]}),id:Zi("string"),"message?":Zi("string")}))],e.SDKCreator.prototype,"openChat",null),t([i(0,mo(["data.imageUrl"],{if:{type:"image"}})),i(0,mo(["data.link"],{if:{type:"link"}})),i(0,mo(["data.id"],{if:{type:"profile"}})),i(0,yo("object",{type:Zi("string",{values:["image","link","profile"]}),data:Zi("object"),"data.imageUrl?":Zi("url"),"data.link?":Zi("url"),"data.title?":Zi("string"),"data.thumb?":Zi("url"),"data.description?":Zi("string"),"data.avatar?":Zi("url"),"data.id?":Zi("string"),"data.displayName?":Zi("string")}))],e.SDKCreator.prototype,"openPostFeed",null),t([i(0,yo("object",{id:Zi("string"),"showDialogConfirm?":Zi("boolean")}))],e.SDKCreator.prototype,"followOA",null),t([i(0,yo("object",{id:Zi("string")}))],e.SDKCreator.prototype,"unfollowOA",null),t([i(0,mo([["data.imageUrl","data.imageUrls"]],{if:{type:"image"}})),i(0,mo(["data.link"],{if:{type:"link"}})),i(0,mo(["data.id"],{if:{type:"oa"}})),i(0,mo(["data.gifUrl"],{if:{type:"gif"}})),i(0,mo(["data.videoThumb","data.videoUrl"],{if:{type:"video"}})),i(0,mo(["data.thumbnail","data.title","data.description"],{if:{type:"zmp"},defaultValue:{data:{description:""}}})),i(0,yo("object",{type:Zi("string",{values:["image","gif","video","link","oa","zmp"]}),data:Zi("object"),"data.imageUrl?":Zi("url"),"data.imageUrls?":Zi("array<url>",{maxLength:10}),"data.caption?":Zi("string"),"data.gifUrl?":Zi("url"),"data.width?":Zi("number"),"data.height?":Zi("number"),"data.videoThumb?":Zi("url"),"data.videoUrl?":Zi("url"),"data.link?":Zi("url"),"data.chatOnly?":Zi("boolean"),"data.id?":Zi("string"),"data.thumbnail?":Zi("url"),"data.path?":Zi("string"),"data.title?":Zi("string",{maxLength:100}),"data.description?":Zi(["string"],{maxLength:400})}))],e.SDKCreator.prototype,"openShareSheet",null),t([i(0,yo("object",{secretData:Zi("string"),"ui?":Zi("object"),"ui.title?":Zi("string"),"ui.subTitle?":Zi("string"),"ui.negativeButtonText?":Zi("string"),"requireFingerprint?":Zi("boolean")},{requireFingerprint:!0,ui:{title:"Xác thực",subTitle:"Sử dụng sinh trắc học của bạn để xác thực",negativeButtonText:"Đóng"}}))],e.SDKCreator.prototype,"openBioAuthentication",null),t([i(0,yo("object",{toUserId:Zi("string"),"title?":Zi("string")}))],e.SDKCreator.prototype,"sendLocation",null),t([i(0,yo("object",{message:Zi("string")}))],e.SDKCreator.prototype,"showToast",null),t([i(0,yo("object",{phoneNumber:Zi("string")}))],e.SDKCreator.prototype,"openPhone",null),t([i(0,yo("object",{content:Zi("string"),phoneNumber:Zi("string",{regex:/^\+?\d+$/})}))],e.SDKCreator.prototype,"openSMS",null),t([i(0,yo("object",{id:Zi("string"),"displayName?":Zi("string")},{displayName:""}))],e.SDKCreator.prototype,"viewOAQr",null),t([i(0,yo("object",{"imageBase64Data?":Zi("string"),"imageUrl?":Zi("url")}))],e.SDKCreator.prototype,"saveImageToGallery",null),t([i(0,yo("object",{"imageBase64Data?":Zi("string"),"imageUrl?":Zi("url")}))],e.SDKCreator.prototype,"saveImageToPhotosAlbum",null),t([i(0,yo("object",{appId:Zi("string"),"params?":Zi("object")}))],e.SDKCreator.prototype,"openMiniApp",null),t([i(0,yo("object",{"type?":Zi("string",{values:["oneShot"]}),"milliseconds?":Zi("number")},{type:"oneShot",milliseconds:500}))],e.SDKCreator.prototype,"vibrate",null),t([i(0,yo("object",{url:Zi("url")}))],e.SDKCreator.prototype,"openWebview",null),t([i(0,yo("object",{"maxProfile?":Zi("number",{min:1,max:10})},{maxProfile:1}))],e.SDKCreator.prototype,"openProfilePicker",null),t([i(0,mo(["SSID"])),i(0,yo("object",{SSID:Zi("string"),"password?":Zi("string"),"hiddenSSID?":Zi("boolean")}))],e.SDKCreator.prototype,"connectWifi",null),t([i(0,yo("object",{type:Zi("string",{values:["photo","video","file","zcamera","zcamera_photo","zcamera_video","zcamera_scan"]}),serverUploadUrl:Zi("url"),"maxItemSize?":Zi("number",{min:0}),"editView?":Zi("object"),"editView.enable?":Zi("boolean"),"editView.aspectRatio?":Zi("string",{regex:/^\d+:\d+$/}),"silentRequest?":Zi("boolean"),"maxSelectItem?":Zi("number",{min:1})}))],e.SDKCreator.prototype,"openMediaPicker",null),t([i(0,yo("object",{title:Zi("string",{maxLength:100}),"thumbnail?":Zi("url"),"path?":Zi("string"),description:Zi(["string"],{maxLength:400})},{description:""}))],e.SDKCreator.prototype,"getShareableLink",null),t([i(0,mo(["url"])),i(0,yo("object",{url:Zi("url")}))],e.SDKCreator.prototype,"openOutApp",null),e.SDKCreator=t([So(Eo)],e.SDKCreator);class wo extends e.SDKCreator{getServiceInstance(){return po.getInstance()}}class No extends e.SDKCreator{getServiceInstance(){return new vo}}class Io{constructor(){Ao.set(this,Zt)}static getInstance(){return Io.instance||(Io.instance=new Io),Io.instance}createOrder(e,t){return n(this,void 0,void 0,(function*(){const i=o(this,Ao,"f"),n=new URLSearchParams;n.append("amount",t.amount.toString()),n.append("item",encodeURIComponent(JSON.stringify(t.item))),n.append("appId",i),t.desc&&n.append("desc",encodeURIComponent(t.desc)),t.extradata&&n.append("extradata",encodeURIComponent(JSON.stringify(t.extradata))),t.method&&n.append("method",t.method);const r={headers:{"Content-Type":"application/x-www-form-urlencoded",authorization:"Bearer "}};try{const o=yield e.getAccessToken({fail:e=>{throw Ii.loginRequired}});r.headers.authorization=`Bearer ${o}`;const a=yield fetch(Ti,Object.assign(Object.assign({method:"POST"},r),{body:n})),s=yield a.json();if(!s.data||0!==s.err)throw Ii.badRequest(s.msg);const c=s.data.id,l=s.data.jwt,d=window.APP_VERSION,u=window.APP_ENV,h={miniAppId:i,orderId:c};l&&(h.token=l),d&&(h.version=d),u&&(h.env=u),t.method&&(h.method=t.method);const p=Pi.encode(h),v=new URL(`?${p}`,"https://payment-mini.zalo.me").toString();return yield e.openWebview({url:v,fail:e=>{throw e}}),{orderId:c}}catch(e){throw e}}))}checkTransaction(e,t){return n(this,void 0,void 0,(function*(){try{let i,{data:n}=t;if(n||(n=e.getRouteParams()),"object"==typeof n&&(i=n.appTransID||n.orderId||n.apptransid),"string"==typeof n){const e=Pi.getParameterByName("orderId",n),t=Pi.getParameterByName("appTransID",n)||Pi.getParameterByName("apptransid",n);i=e||t}const r={headers:{authorization:"Bearer "}},a=yield e.getAccessToken({fail:e=>{throw Ii.loginRequired}});r.headers.authorization=`Bearer ${a}`;const s=new URL(bi),c={transId:i||"",appId:o(this,Ao,"f")};s.search=new URLSearchParams(c).toString();const l=yield fetch(s.toString(),r),d=yield l.json();if(!d.data||0!==d.err)throw Ii.badRequest(d.msg);const u=d.data||{};return{msg:u.resultMessage,orderId:u.orderId,resultCode:u.resultCode,transTime:u.transTime,createdAt:u.createAt,transId:u.transId}}catch(e){throw e}}))}}Ao=new WeakMap;class Po{constructor(){To.set(this,Vt)}static getInstance(){return Po.instance||(Po.instance=new Po),Po.instance}createOrder(e,t){return Promise.resolve({orderId:""})}checkTransaction(e,t){const i={msg:"Success",orderId:"",resultCode:1,transTime:(new Date).getTime().toString(),createdAt:(new Date).getTime().toString(),transId:""};return Promise.resolve(i)}}To=new WeakMap;let ko=class{constructor(e){bo.set(this,void 0),Co.set(this,void 0),r(this,bo,this.getInstance(),"f"),r(this,Co,e,"f")}createOrder(e){return o(this,bo,"f").createOrder(o(this,Co,"f"),e)}checkTransaction(e){return o(this,bo,"f").checkTransaction(o(this,Co,"f"),e)}};bo=new WeakMap,Co=new WeakMap,t([i(0,yo("object",{amount:Zi(["string","number"]),desc:Zi("string"),"method?":Zi("string",{values:["MOMO","ZALOPAY","MOMO_SANDBOX","ZALOPAY_SANDBOX","CC","CC_SANDBOX","ATM","ATM_SANDBOX"]})}))],ko.prototype,"createOrder",null),ko=t([So(Eo)],ko);class Do extends ko{getInstance(){return Io.getInstance()}}class Ro extends ko{getInstance(){return Po.getInstance()}}const Bo=Mi();e.default=void 0,window.onJSCall=e=>function(t){eo.getInstance().onJSCall(e,t)},window.onMultiJSCall=e=>function(t){eo.getInstance().onMultiJSCall(e,t)},window.zaloJSV2={zalo_h5_event_handler:function(e,t,i){eo.getInstance().nativeEventHandler(e,t,i)}},e.Payment=void 0,Bo.isZalo?(e.default=new wo,e.Payment=new Do(e.default)):(e.default=new No,e.Payment=new Ro(e.default)),window.ZaloMiniAppSDK=e.default,e.default=e.default,Object.defineProperty(e,"__esModule",{value:!0})}));
15
+ ***************************************************************************** */function t(e,t,i,n){var o,r=arguments.length,a=r<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,n);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(r<3?o(a):r>3?o(t,i,a):o(t,i))||a);return r>3&&a&&Object.defineProperty(t,i,a),a}function i(e,t){return function(i,n){t(i,n,e)}}function n(e,t,i,n){return new(i||(i=Promise))((function(o,r){function a(e){try{c(n.next(e))}catch(e){r(e)}}function s(e){try{c(n.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(a,s)}c((n=n.apply(e,t||[])).next())}))}function o(e,t,i,n){if("a"===i&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===i?n:"a"===i?n.call(e):n?n.value:t.get(e)}function r(e,t,i,n,o){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!o)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!o:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?o.call(e,i):o?o.value=i:t.set(e,i),i}var a=Object.prototype;var s=function(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||a)};var c=function(e,t){return function(i){return e(t(i))}}(Object.keys,Object),l=Object.prototype.hasOwnProperty;var d=function(e){if(!s(e))return c(e);var t=[];for(var i in Object(e))l.call(e,i)&&"constructor"!=i&&t.push(i);return t},u="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function h(e,t){return e(t={exports:{}},t.exports),t.exports}var p="object"==typeof u&&u&&u.Object===Object&&u,v="object"==typeof self&&self&&self.Object===Object&&self,f=p||v||Function("return this")(),g=f.Symbol,m=Object.prototype,_=m.hasOwnProperty,y=m.toString,S=g?g.toStringTag:void 0;var E=function(e){var t=_.call(e,S),i=e[S];try{e[S]=void 0;var n=!0}catch(e){}var o=y.call(e);return n&&(t?e[S]=i:delete e[S]),o},O=Object.prototype.toString;var A=function(e){return O.call(e)},T=g?g.toStringTag:void 0;var C=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":T&&T in Object(e)?E(e):A(e)};var b=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)};var N,w=function(e){if(!b(e))return!1;var t=C(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t},I=f["__core-js_shared__"],P=(N=/[^.]+$/.exec(I&&I.keys&&I.keys.IE_PROTO||""))?"Symbol(src)_1."+N:"";var k=function(e){return!!P&&P in e},D=Function.prototype.toString;var R=function(e){if(null!=e){try{return D.call(e)}catch(e){}try{return e+""}catch(e){}}return""},B=/^\[object .+?Constructor\]$/,j=Function.prototype,U=Object.prototype,M=j.toString,L=U.hasOwnProperty,x=RegExp("^"+M.call(L).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");var z=function(e){return!(!b(e)||k(e))&&(w(e)?x:B).test(R(e))};var W=function(e,t){return null==e?void 0:e[t]};var J=function(e,t){var i=W(e,t);return z(i)?i:void 0},F=J(f,"DataView"),K=J(f,"Map"),G=J(f,"Promise"),H=J(f,"Set"),$=J(f,"WeakMap"),Z="[object Map]",V="[object Promise]",q="[object Set]",Y="[object WeakMap]",Q="[object DataView]",X=R(F),ee=R(K),te=R(G),ie=R(H),ne=R($),oe=C;(F&&oe(new F(new ArrayBuffer(1)))!=Q||K&&oe(new K)!=Z||G&&oe(G.resolve())!=V||H&&oe(new H)!=q||$&&oe(new $)!=Y)&&(oe=function(e){var t=C(e),i="[object Object]"==t?e.constructor:void 0,n=i?R(i):"";if(n)switch(n){case X:return Q;case ee:return Z;case te:return V;case ie:return q;case ne:return Y}return t});var re=oe;var ae=function(e){return null!=e&&"object"==typeof e};var se=function(e){return ae(e)&&"[object Arguments]"==C(e)},ce=Object.prototype,le=ce.hasOwnProperty,de=ce.propertyIsEnumerable,ue=se(function(){return arguments}())?se:function(e){return ae(e)&&le.call(e,"callee")&&!de.call(e,"callee")},he=Array.isArray;var pe=function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991};var ve=function(e){return null!=e&&pe(e.length)&&!w(e)};var fe=function(){return!1},ge=h((function(e,t){var i=t&&!t.nodeType&&t,n=i&&e&&!e.nodeType&&e,o=n&&n.exports===i?f.Buffer:void 0,r=(o?o.isBuffer:void 0)||fe;e.exports=r})),me={};me["[object Float32Array]"]=me["[object Float64Array]"]=me["[object Int8Array]"]=me["[object Int16Array]"]=me["[object Int32Array]"]=me["[object Uint8Array]"]=me["[object Uint8ClampedArray]"]=me["[object Uint16Array]"]=me["[object Uint32Array]"]=!0,me["[object Arguments]"]=me["[object Array]"]=me["[object ArrayBuffer]"]=me["[object Boolean]"]=me["[object DataView]"]=me["[object Date]"]=me["[object Error]"]=me["[object Function]"]=me["[object Map]"]=me["[object Number]"]=me["[object Object]"]=me["[object RegExp]"]=me["[object Set]"]=me["[object String]"]=me["[object WeakMap]"]=!1;var _e=function(e){return ae(e)&&pe(e.length)&&!!me[C(e)]};var ye=function(e){return function(t){return e(t)}},Se=h((function(e,t){var i=t&&!t.nodeType&&t,n=i&&e&&!e.nodeType&&e,o=n&&n.exports===i&&p.process,r=function(){try{var e=n&&n.require&&n.require("util").types;return e||o&&o.binding&&o.binding("util")}catch(e){}}();e.exports=r})),Ee=Se&&Se.isTypedArray,Oe=Ee?ye(Ee):_e,Ae=Object.prototype.hasOwnProperty;var Te=function(e){if(null==e)return!0;if(ve(e)&&(he(e)||"string"==typeof e||"function"==typeof e.splice||ge(e)||Oe(e)||ue(e)))return!e.length;var t=re(e);if("[object Map]"==t||"[object Set]"==t)return!e.size;if(s(e))return!d(e).length;for(var i in e)if(Ae.call(e,i))return!1;return!0};var Ce=function(e){return void 0===e};var be=function(e){return null===e};var Ne=function(e){return"string"==typeof e||!he(e)&&ae(e)&&"[object String]"==C(e)};var we=function(e){return"number"==typeof e||ae(e)&&"[object Number]"==C(e)};var Ie=function(e){return ae(e)&&"[object RegExp]"==C(e)},Pe=Se&&Se.isRegExp,ke=Pe?ye(Pe):Ie;var De=function(e){return"symbol"==typeof e||ae(e)&&"[object Symbol]"==C(e)},Re=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Be=/^\w*$/;var je=function(e,t){if(he(e))return!1;var i=typeof e;return!("number"!=i&&"symbol"!=i&&"boolean"!=i&&null!=e&&!De(e))||(Be.test(e)||!Re.test(e)||null!=t&&e in Object(t))},Ue=J(Object,"create");var Me=function(){this.__data__=Ue?Ue(null):{},this.size=0};var Le=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},xe=Object.prototype.hasOwnProperty;var ze=function(e){var t=this.__data__;if(Ue){var i=t[e];return"__lodash_hash_undefined__"===i?void 0:i}return xe.call(t,e)?t[e]:void 0},We=Object.prototype.hasOwnProperty;var Je=function(e){var t=this.__data__;return Ue?void 0!==t[e]:We.call(t,e)};var Fe=function(e,t){var i=this.__data__;return this.size+=this.has(e)?0:1,i[e]=Ue&&void 0===t?"__lodash_hash_undefined__":t,this};function Ke(e){var t=-1,i=null==e?0:e.length;for(this.clear();++t<i;){var n=e[t];this.set(n[0],n[1])}}Ke.prototype.clear=Me,Ke.prototype.delete=Le,Ke.prototype.get=ze,Ke.prototype.has=Je,Ke.prototype.set=Fe;var Ge=Ke;var He=function(){this.__data__=[],this.size=0};var $e=function(e,t){return e===t||e!=e&&t!=t};var Ze=function(e,t){for(var i=e.length;i--;)if($e(e[i][0],t))return i;return-1},Ve=Array.prototype.splice;var qe=function(e){var t=this.__data__,i=Ze(t,e);return!(i<0)&&(i==t.length-1?t.pop():Ve.call(t,i,1),--this.size,!0)};var Ye=function(e){var t=this.__data__,i=Ze(t,e);return i<0?void 0:t[i][1]};var Qe=function(e){return Ze(this.__data__,e)>-1};var Xe=function(e,t){var i=this.__data__,n=Ze(i,e);return n<0?(++this.size,i.push([e,t])):i[n][1]=t,this};function et(e){var t=-1,i=null==e?0:e.length;for(this.clear();++t<i;){var n=e[t];this.set(n[0],n[1])}}et.prototype.clear=He,et.prototype.delete=qe,et.prototype.get=Ye,et.prototype.has=Qe,et.prototype.set=Xe;var tt=et;var it=function(){this.size=0,this.__data__={hash:new Ge,map:new(K||tt),string:new Ge}};var nt=function(e){var t=typeof e;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e};var ot=function(e,t){var i=e.__data__;return nt(t)?i["string"==typeof t?"string":"hash"]:i.map};var rt=function(e){var t=ot(this,e).delete(e);return this.size-=t?1:0,t};var at=function(e){return ot(this,e).get(e)};var st=function(e){return ot(this,e).has(e)};var ct=function(e,t){var i=ot(this,e),n=i.size;return i.set(e,t),this.size+=i.size==n?0:1,this};function lt(e){var t=-1,i=null==e?0:e.length;for(this.clear();++t<i;){var n=e[t];this.set(n[0],n[1])}}lt.prototype.clear=it,lt.prototype.delete=rt,lt.prototype.get=at,lt.prototype.has=st,lt.prototype.set=ct;var dt=lt;function ut(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new TypeError("Expected a function");var i=function(){var n=arguments,o=t?t.apply(this,n):n[0],r=i.cache;if(r.has(o))return r.get(o);var a=e.apply(this,n);return i.cache=r.set(o,a)||r,a};return i.cache=new(ut.Cache||dt),i}ut.Cache=dt;var ht=ut;var pt=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,vt=/\\(\\)?/g,ft=function(e){var t=ht(e,(function(e){return 500===i.size&&i.clear(),e})),i=t.cache;return t}((function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(pt,(function(e,i,n,o){t.push(n?o.replace(vt,"$1"):i||e)})),t}));var gt=function(e,t){for(var i=-1,n=null==e?0:e.length,o=Array(n);++i<n;)o[i]=t(e[i],i,e);return o},mt=g?g.prototype:void 0,_t=mt?mt.toString:void 0;var yt=function e(t){if("string"==typeof t)return t;if(he(t))return gt(t,e)+"";if(De(t))return _t?_t.call(t):"";var i=t+"";return"0"==i&&1/t==-Infinity?"-0":i};var St=function(e){return null==e?"":yt(e)};var Et=function(e,t){return he(e)?e:je(e,t)?[e]:ft(St(e))};var Ot=function(e){if("string"==typeof e||De(e))return e;var t=e+"";return"0"==t&&1/e==-Infinity?"-0":t};var At=function(e,t){for(var i=0,n=(t=Et(t,e)).length;null!=e&&i<n;)e=e[Ot(t[i++])];return i&&i==n?e:void 0};var Tt=function(e,t,i){var n=null==e?void 0:At(e,t);return void 0===n?i:n},Ct=function(){try{var e=J(Object,"defineProperty");return e({},"",{}),e}catch(e){}}();var bt=function(e,t,i){"__proto__"==t&&Ct?Ct(e,t,{configurable:!0,enumerable:!0,value:i,writable:!0}):e[t]=i},Nt=Object.prototype.hasOwnProperty;var wt=function(e,t,i){var n=e[t];Nt.call(e,t)&&$e(n,i)&&(void 0!==i||t in e)||bt(e,t,i)},It=/^(?:0|[1-9]\d*)$/;var Pt=function(e,t){var i=typeof e;return!!(t=null==t?9007199254740991:t)&&("number"==i||"symbol"!=i&&It.test(e))&&e>-1&&e%1==0&&e<t};var kt=function(e,t,i,n){if(!b(e))return e;for(var o=-1,r=(t=Et(t,e)).length,a=r-1,s=e;null!=s&&++o<r;){var c=Ot(t[o]),l=i;if("__proto__"===c||"constructor"===c||"prototype"===c)return e;if(o!=a){var d=s[c];void 0===(l=n?n(d,c,s):void 0)&&(l=b(d)?d:Pt(t[o+1])?[]:{})}wt(s,c,l),s=s[c]}return e};var Dt,Rt,Bt,jt,Ut,Mt,Lt,xt,zt,Wt,Jt={isEmpty:Te,isNull:be,isUndefined:Ce,isFunction:w,isObject:b,isString:Ne,isNumber:we,isArray:he,isRegExp:ke,get:Tt,set:function(e,t,i){return null==e?e:kt(e,t,i)},isPromise:e=>!!e&&("object"==typeof e||"function"==typeof e)&&"function"==typeof e.then};function Ft(e){return"function"==typeof window.Debug?window.Debug(e):function(...e){process.env.NODE_ENV}}e.NetworkType=void 0,(Dt=e.NetworkType||(e.NetworkType={})).none="none",Dt.wifi="wifi",Dt.cellular="cellular",Dt.unknown="unknown",e.PlatformType=void 0,(Rt=e.PlatformType||(e.PlatformType={})).wp="wp",Rt.android="android",Rt.iOS="iOS",Rt.unknown="unknown",e.ProfileType=void 0,(Bt=e.ProfileType||(e.ProfileType={}))[Bt.user=1]="user",Bt[Bt.oa=0]="oa",Bt[Bt.aliasOA=2]="aliasOA",e.ChatType=void 0,(jt=e.ChatType||(e.ChatType={}))[jt.user=1]="user",jt[jt.oa=0]="oa",e.PostFeedType=void 0,(Ut=e.PostFeedType||(e.PostFeedType={}))[Ut.image=1]="image",Ut[Ut.link=4]="link",Ut[Ut.profile=5]="profile",e.ShareSheetType=void 0,(Mt=e.ShareSheetType||(e.ShareSheetType={}))[Mt.image=1]="image",Mt[Mt.gif=11]="gif",Mt[Mt.video=12]="video",Mt[Mt.link=4]="link",Mt[Mt.oa=5]="oa",Mt[Mt.zmp=20]="zmp",Mt[Mt.multi_image=21]="multi_image",e.OrientationType=void 0,(Lt=e.OrientationType||(e.OrientationType={}))[Lt.auto=1]="auto",Lt[Lt.portrait=2]="portrait",Lt[Lt.landscape=3]="landscape",e.VibrateType=void 0,(xt=e.VibrateType||(e.VibrateType={}))[xt.oneShot=0]="oneShot",e.Events=void 0,(zt=e.Events||(e.Events={})).AppPaused="h5.event.paused",zt.AppResumed="h5.event.resumed",zt.NetworkChanged="h5.event.connection.changed",zt.OnDataCallback="h5.event.webview.result",zt.OpenApp="h5.event.open.mp",zt.AppClose="h5.event.action.close",e.MediaPickerType=void 0,(Wt=e.MediaPickerType||(e.MediaPickerType={}))[Wt.zcamera=3]="zcamera",Wt[Wt.zcamera_photo=1]="zcamera_photo",Wt[Wt.zcamera_video=2]="zcamera_video",Wt[Wt.zcamera_scan=7]="zcamera_scan",Wt[Wt.photo=4]="photo",Wt[Wt.video=5]="video",Wt[Wt.file=6]="file";const Kt=e=>{const t=document.cookie;if(t){const o=t.split("; ");if(o&&o.length>0)for(var i=e.length+1,n=o.length-1;n>=0;n--){let t=o[n];if(t&&0===t.indexOf(e)&&(t=t.substring(i,t.length),t))return t=t.replace(/["']/g,""),t}}return null},Gt=e=>Kt(`${window.location.host}_`+e),Ht=e=>Kt((()=>{const e=window.location.host;if(e){if(e.indexOf("zalo.me")>=0)return"zalo.me_";if(e.indexOf("baomoi.com")>=0)return"baomoi.com_";if(e.indexOf("mp3.zing.vn")>=0)return"mp3.zing.vn_";if(e.indexOf("zaloapp.com")>=0)return"zaloapp.com_"}return""})()+e),$t=1048576,Zt=window.zAppID,Vt=window.APP_ID,qt=window.APP_CONFIG||{},Yt={ZOAUTH:"h5.zdn.vn_zoauth",ZACC_SESSiON:"h5.zdn.vn_zacc_session",JS_TOKEN:"h5.zdn.vn_zlink3rd",ZOAUTH_VRF:"h5.zdn.vn_zoauth_vrf",DEVICE_ID:"h5.zdn.vn_deviceID",CONTEXT_ID:"h5.zdn.vn_contextID",CONTEXT_TYPE:"h5.zdn.vn_contextType",UTOKEN_ZPI:"h5.zdn.vn_utoken_zpi",GTOKEN_ZPI:"h5.zdn.vn_gtoken_zpi",ZPP_ZPI:"h5.zdn.vn_zpp_zpi"},Qt="https://graph.zalo.me/v2.0/me",Xt="https://h5.zalo.me/openapi/access_token",ei="https://oauth.zaloapp.com/v3/access_token",ti="https://graph.zalo.me/v2.0/me/friends/list",ii="https://h5.zalo.me/apps/get-info",ni="https://h5.zalo.me/log/async",oi=5*$t,ri=e=>({NONE:e?-2:0,WIFI:e?0:1,"2G":2,"3G":e?15:2,"4G":e?13:2}),ai=0,si=-2e3,ci=-1400,li=-1500,di=-1401,ui=-2004,hi=-2005,pi={SUCCESS:"Success",UNKNOWN_ERROR:"Unknown error. Please try again later.",TIME_OUT:"Request timeout. Please try again later.",LOGIN_REQUIRED:"Please login (https://miniapp.zalo.me/docs/api/login) before to call this api",LOGIN_FAILED:"Login failed",NOT_PERMISSION:"You don't have permission to call this api",CLIENT_NOT_SUPPORT:"This API is not supported in this Zalo version",DECODE_FAILED:"Can not decode id. Please check your params again.",INVALID_PARAM:"Invalid parameter",USER_DENIED:"User denied",USER_CANCEL:"User cancel",MEDIA_PICKER_FAIL:"Unable to pick media",SAVE_IMAGE_FAIL:"Unable to save image"},vi={SUCCESS:{code:ai,message:pi.SUCCESS},UNKNOWN_ERROR:{code:si,message:pi.UNKNOWN_ERROR},UNAUTHORIZED:{code:di,message:pi.LOGIN_REQUIRED},FORBIDDEN:{code:-1403,message:pi.NOT_PERMISSION},CLIENT_NOT_SUPPORT:{code:-1404,message:pi.CLIENT_NOT_SUPPORT},DECODE_FAILED:{code:-2001,message:pi.DECODE_FAILED},TIME_OUT:{code:-1408,message:pi.TIME_OUT},USER_DENIED:{code:-2002,message:pi.USER_DENIED},USER_CANCEL:{code:-2003,message:pi.USER_CANCEL}},fi={GET_DOWNLOADED_STICKER:{name:"action.get.downloaded.sticker",have_callback:!0},OPEN_SHARE_STICKER:{name:"action.open.share.sticker"},OPEN_PROFILE:{name:"action.open.profile"},OPEN_FEED_DETAIL:{name:"action.open.feeddetail"},OPEN_FRIEND_RADA:{name:"action.open.friendrada"},OPEN_INAPP:{name:"action.open.inapp"},OPEN_OUTAPP:{name:"action.open.outapp"},OPEN_PAGE:{name:"action.open.page"},OPEN_PHOTODETAIL:{name:"action.open.photodetail"},OPEN_GALARY:{name:"action.open.galary"},OPEN_GAMECENTER:{name:"action.open.gamecenter"},OPEN_GAMENEWS:{name:"action.open.gamenews"},OPEN_TAB_CONTACT:{name:"action.open.tab.contact"},OPEN_TAB_SOCIAL:{name:"action.open.tab.social"},OPEN_FRIENDSUGGEST:{name:"action.open.friendsuggest"},OPEN_GROUPLIST:{name:"action.open.grouplist"},OPEN_NEARBY:{name:"action.open.nearby"},OPEN_ROOM:{name:"action.open.room"},OPEN_STICKERSTORE:{name:"action.open.stickerstore"},OPEN_CREATECHAT:{name:"action.open.createchat"},COPY_LINK_CATESTICKER:{name:"action.copy.link.catesticker"},REQUEST_BUY_STICKER:{name:"action.request.buy.sticker"},OPEN_CHAT:{name:"action.open.chat"},OPEN_TAB_CHAT:{name:"action.open.tab.chat"},OPEN_CHATGROUP:{name:"action.open.chatgroup"},OPEN_ADDFRIEND:{name:"action.open.addfriend"},OPEN_TAB_MORE:{name:"action.open.tab.more"},OPEN_POSTFEED:{name:"action.open.postfeed"},OPEN_LOGINDEVICES:{name:"action.open.logindevices"},OPEN_SENDSTICKER:{name:"action.open.sendsticker"},REPORT_ABUSE:{name:"action.report.abuse",have_callback:!0},FOLLOW_OA:{name:"action.follow.oa",have_callback:!0},UNFOLLOW_OA:{name:"action.unfollow.oa",have_callback:!0},OPEN_GAMEDETAIL:{name:"action.open.gamedetail"},OPEN_SHARESHEET:{name:"action.open.sharesheet",have_callback:!0},REQUEST_PERMISSION_CAMERA:{name:"action.request.permission.camera",error_list:{android:{"-2":{map_to:vi.USER_DENIED}},iOS:{"-2":{map_to:vi.USER_DENIED}}}},CHANGE_TITLE_HEADER:{name:"action.change.title.header",skip_jump:!0},WEBVIEW_CLEARCACHE:{name:"action.webview.clearcache"},WEBVIEW_CONFIRMCACHE:{name:"action.webview.confirmcache"},WEBVIEW_ISVISIBLE:{name:"action.webview.isvisible"},WEBVIEW_NETWORKTYPE:{name:"action.webview.networktype",skip_jump:!0},CHANGE_BUTTON_HEADER:{name:"action.change.button.header"},CREATE_OPTIONS_MENU:{name:"action.create.options.menu",skip_jump:!0,have_callback:!0},CREATE_SHORTCUT:{name:"action.create.shortcut"},CHANGE_ACTIONBAR_LEFTBUTTON_TYPE:{name:"action.change.actionbar.leftbutton.type",skip_jump:!0,have_callback:!0},WINDOW_CLOSE:{name:"action.window.close",skip_jump:!0,have_callback:!0},WEBVIEW_CHECKRESERROR:{name:"action.webview.checkResError"},IAP_REQUESTPAYMENT:{name:"action.iap.requestpayment"},ZBROWSER_GETSTATS:{name:"action.zbrowser.getstats"},ZBROWSER_JSBRIDGE:{name:"action.zbrowser.jsbridge",skip_jump:!0,have_callback:!0},PROMPT_AUTHENTICATION:{name:"action.prompt.authentication"},CHANGE_ACTIONBAR_COLOR:{name:"action.change.actionbar.color",skip_jump:!0},PROMPT_AUTHENTICATION_CHECK_STATE:{name:"action.prompt.authentication.check_state"},OPEN_APPSTORE:{name:"action.open.appstore"},GET_LOCATION:{name:"action.get.location",have_callback:!0,error_list:{android:{"-1":{map_to:vi.USER_DENIED}},iOS:{"-1":{map_to:vi.USER_DENIED}}}},QUERY_LOCATION_HIDE:{name:"action.query.location.hide",have_callback:!0},SHOW_TOAST:{name:"action.show.toast",have_callback:!0},OPEN_APP:{name:"action.open.app"},HIDE_KEYBOARD:{name:"action.hide.keyboard"},OPEN_PHONE:{name:"action.open.phone"},OPEN_QR:{name:"action.open.qr"},OPEN_SMS:{name:"action.open.sms"},VIEW_MYQR:{name:"action.view.myqr",have_callback:!0},KEEP_SCREEN:{name:"action.keep.screen",have_callback:!0},CHANGE_AUTOROTATE:{name:"action.change.autorotate",skip_jump:!0},CHECK_APP_INSTALLED:{name:"action.check.app.installed"},QUERY_SHOW:{name:"action.query.show"},QUERY_HIDE:{name:"action.query.hide"},OPEN_INAPPRW:{name:"action.open.inapprw"},ZALORUN_GETTRACKINGSTATUS:{name:"action.zalorun.getTrackingStatus",have_callback:!0},ZALORUN_SETTRACKINGSTATUS:{name:"action.zalorun.setTrackingStatus",have_callback:!0},ZALORUN_GETDAYSTEP:{name:"action.zalorun.getDayStep",have_callback:!0},ZALORUN_FORCESUBMITDATA:{name:"action.zalorun.forceSubmitData",have_callback:!0},ZALORUN_SETWEIGHT:{name:"action.zalorun.setWeight",have_callback:!0},OPEN_PROFILE_EXT:{name:"action.open.profile.ext"},DOWNLOAD_CATE:{name:"action.download.cate",have_callback:!0},JUMP_LOGIN:{name:"action.jump.login",skip_jump:!0,white_list:!0},OPEN_ADTIMA_ADS_INTERSTITIAL:{name:"action.open.adtima.ads.interstitial"},OPEN_ADTIMA_ADS:{name:"action.open.adtima.ads"},GET_ADIDCLIENT:{name:"action.get.adidclient"},SCAN_IBEACON:{name:"action.scan.ibeacon"},INTERACTIVE_VIBRATION:{name:"action.interactive.vibration"},SAVE_IMAGE_GALLERY:{name:"action.save.image.gallery",version_live:{iOS:408},error_list:{android:{"-101":{map_to:{code:hi,message:pi.SAVE_IMAGE_FAIL},need_more_detail:!0},"-102":{map_to:{code:hi,message:pi.SAVE_IMAGE_FAIL},need_more_detail:!0}},iOS:{"-10":{map_to:{code:hi,message:pi.SAVE_IMAGE_FAIL},need_more_detail:!0}}}},OPEN_MP:{name:"action.open.mp",version_live:{iOS:402}},CHANGE_ACTIONBAR:{name:"action.change.actionbar",version_live:{iOS:402},skip_jump:!0},ZBROWSER_MPDS:{name:"action.zbrowser.mpds",version_live:{iOS:402}},WEBVIEW_SET_RESULT:{name:"action.webview.set.result",version_live:{iOS:416}},MP_GET_NUMBER:{name:"action.mp.get.number",version_live:{iOS:416},error_list:{android:{"-1":{map_to:vi.USER_DENIED},"-101":{map_to:vi.USER_DENIED}},iOS:{"-1":{map_to:vi.USER_DENIED},"-10":{map_to:vi.USER_DENIED}}}},MP_OPEN_PROFILE_PICKER:{name:"action.mp.open.profile.picker",version_live:{iOS:432},error_list:{android:{"-101":{map_to:vi.USER_CANCEL}},iOS:{"-101":{map_to:vi.USER_CANCEL}}}},GET_SUPPORTED_ACTIONS:{name:"action.get.supported.actions",white_list:!0},MP_JOIN_WIFI:{name:"action.mp.join.wifi",version_live:{android:0,iOS:999},have_permission:!1,white_list:!1},PICK_MEDIA:{name:"action.pick.media",version_live:{iOS:440},error_list:{android:{"-101":{map_to:vi.USER_CANCEL},999:{map_to:{code:ui,message:pi.MEDIA_PICKER_FAIL},need_more_detail:!0}},iOS:{"-10":{map_to:{code:ui,message:pi.MEDIA_PICKER_FAIL}}}}},MP_CLOSE_LOADINGVIEW:{name:"action.mp.close.loadingview"}},gi={android:{"-4":vi.DECODE_FAILED,"-5":vi.CLIENT_NOT_SUPPORT,"-14":vi.TIME_OUT},iOS:{"-9":vi.DECODE_FAILED,"-5":vi.CLIENT_NOT_SUPPORT,"-14":vi.TIME_OUT}},mi={android:12100571,iOS:400,wp:0,unknown:0},_i={android:12100615,iOS:460,wp:0,unknown:0},yi=[fi.GET_DOWNLOADED_STICKER.name,fi.OPEN_SHARE_STICKER.name,fi.OPEN_PROFILE.name,fi.OPEN_FEED_DETAIL.name,fi.OPEN_FRIEND_RADA.name,fi.OPEN_INAPP.name,fi.OPEN_OUTAPP.name,fi.OPEN_PAGE.name,fi.OPEN_PHOTODETAIL.name,fi.OPEN_GALARY.name,fi.OPEN_GAMECENTER.name,fi.OPEN_GAMENEWS.name,fi.OPEN_TAB_CONTACT.name,fi.OPEN_TAB_SOCIAL.name,fi.OPEN_FRIENDSUGGEST.name,fi.OPEN_GROUPLIST.name,fi.OPEN_NEARBY.name,fi.OPEN_ROOM.name,fi.OPEN_STICKERSTORE.name,fi.OPEN_CREATECHAT.name,fi.COPY_LINK_CATESTICKER.name,fi.REQUEST_BUY_STICKER.name,fi.OPEN_CHAT.name,fi.OPEN_TAB_CHAT.name,fi.OPEN_CHATGROUP.name,fi.OPEN_ADDFRIEND.name,fi.OPEN_TAB_MORE.name,fi.OPEN_POSTFEED.name,fi.OPEN_LOGINDEVICES.name,fi.OPEN_SENDSTICKER.name,fi.REPORT_ABUSE.name,fi.FOLLOW_OA.name,fi.UNFOLLOW_OA.name,fi.OPEN_GAMEDETAIL.name,fi.OPEN_SHARESHEET.name,fi.REQUEST_PERMISSION_CAMERA.name,fi.CHANGE_TITLE_HEADER.name,fi.WEBVIEW_CLEARCACHE.name,fi.WEBVIEW_CONFIRMCACHE.name,fi.WEBVIEW_ISVISIBLE.name,fi.WEBVIEW_NETWORKTYPE.name,fi.CHANGE_BUTTON_HEADER.name,fi.CREATE_OPTIONS_MENU.name,fi.CREATE_SHORTCUT.name,fi.CHANGE_ACTIONBAR_LEFTBUTTON_TYPE.name,fi.WINDOW_CLOSE.name,fi.WEBVIEW_CHECKRESERROR.name,fi.IAP_REQUESTPAYMENT.name,fi.ZBROWSER_GETSTATS.name,fi.ZBROWSER_JSBRIDGE.name,fi.PROMPT_AUTHENTICATION.name,fi.CHANGE_ACTIONBAR_COLOR.name,fi.PROMPT_AUTHENTICATION_CHECK_STATE.name,fi.OPEN_APPSTORE.name,fi.GET_LOCATION.name,fi.QUERY_LOCATION_HIDE.name,fi.SHOW_TOAST.name,fi.OPEN_APP.name,fi.HIDE_KEYBOARD.name,fi.OPEN_PHONE.name,fi.OPEN_QR.name,fi.OPEN_SMS.name,fi.VIEW_MYQR.name,fi.KEEP_SCREEN.name,fi.CHANGE_AUTOROTATE.name,fi.CHECK_APP_INSTALLED.name,fi.QUERY_SHOW.name,fi.QUERY_HIDE.name,fi.OPEN_INAPPRW.name,fi.ZALORUN_GETTRACKINGSTATUS.name,fi.ZALORUN_SETTRACKINGSTATUS.name,fi.ZALORUN_GETDAYSTEP.name,fi.ZALORUN_FORCESUBMITDATA.name,fi.ZALORUN_SETWEIGHT.name,fi.OPEN_PROFILE_EXT.name,fi.DOWNLOAD_CATE.name,fi.JUMP_LOGIN.name,fi.OPEN_ADTIMA_ADS_INTERSTITIAL.name,fi.OPEN_ADTIMA_ADS.name,fi.GET_ADIDCLIENT.name,fi.SCAN_IBEACON.name,fi.SAVE_IMAGE_GALLERY.name,fi.OPEN_MP.name,fi.CHANGE_ACTIONBAR.name,fi.INTERACTIVE_VIBRATION.name,fi.ZBROWSER_MPDS.name],Si=0,Ei=3,Oi=1,Ai=0,Ti="https://stgpayment-mini.zalo.me/api/order/create",Ci="https://stgpayment-mini.zalo.me/api/transaction";class bi{constructor(e,t,i){this.code=e,this.message=t,this.api=i}toString(){return`api: ${String(this.api)}; code: ${this.code}; message: ${this.message}`}toJSON(){return{code:this.code,message:this.message,api:this.api}}}const Ni=(e,t)=>e instanceof bi?((e,t)=>(e.api=t,e.toJSON()))(e,t):((e,t)=>e instanceof Error?new bi(si,e.message,t).toJSON():new bi(si,pi.UNKNOWN_ERROR,t).toJSON())(e,t),wi=(e,t)=>({code:ai,message:t||pi.SUCCESS,data:e||{}}),Ii={badRequest:e=>new bi(ci,e),loginFailed:e=>new bi(di,`${pi.LOGIN_FAILED}: ${e}`),loginRequired:()=>new bi(di,pi.LOGIN_REQUIRED),missingParam:e=>new bi(ci,`Missing required argument: ${e}`),wrongTypeParam:(e,t,i)=>new bi(ci,`Wrong type of parameter '${e}'. Expected ${t}, but got ${i}`),cannotGetShareInfo:()=>new bi(li,"Can not get app info to share"),lengthInvalid:e=>new bi(ci,`${e} length is invalid.`)};const Pi={encode:function(e){var t=[];for(var i in e)if(e.hasOwnProperty(i)){var n=e[i];if(void 0===n)return;if(null===n)return void t.push(i);t.push(encodeURIComponent(i)+"="+encodeURIComponent(n))}return t.join("&")},decode:function(e,t){var i={};if(""===e)return i;for(var n=e.split("&"),o=0;o<n.length;o++){var r=n[o].split("=",2),a=decodeURIComponent(r[0]);if(t&&Object.prototype.hasOwnProperty.call(i,a))throw new URIError("Duplicate key: "+a);i[a]=2===r.length?decodeURIComponent(r[1]):null}return i},appendToUrl:function(e,t){return e+(-1!==e.indexOf("?")?"&":"?")+("string"==typeof t?t:Pi.encode(t))},getParameterByName:function(e,t){t||(t=window.location.href),e=e.replace(/[\[\]]/g,"\\$&");var i=new RegExp("[?&]"+e+"(=([^&#]*)|&|#|$)").exec(t);return i?i[2]?decodeURIComponent(i[2].replace(/\+/g," ")):"":null},getParamsAsObject:function(e){var t={};return e?(e.split("&").map((function(e){var i=e.split("=");i&&2==i.length&&(t[i[0]]=decodeURIComponent(i[1].replace(/\+/g," ")))})),t):t},toQueryString:function(e){if(!e)return"";if("object"!=(void 0===e?"undefined":typeof e))return e;var t=Object.keys(e),i=[];return t.map((function(t){var n=e[t],o=[t,n="object"==(void 0===n?"undefined":typeof n)?JSON.stringify(n):encodeURIComponent(n)].join("=");i.push(o)})),i.join("&")}},ki=new RegExp("[\\u0300-\\u036f]","g"),Di=new RegExp("[đ|Đ]","g"),Ri=new RegExp("\\s","g"),Bi=Ft("zmp:utils:common"),ji=e=>{try{new URL(e)}catch(e){return!1}return!0},Ui=()=>navigator.userAgent||navigator.vendor||window.opera,Mi=()=>{const e=Ui().toLowerCase();return{isWP:/iemobile/.test(e),isAndroid:/android/i.test(e)&&!/iemobile/.test(e),isIOS:/iphone|ios|ipad|ipod/.test(e)&&!/iemobile/.test(e),isMobile:/android|iphone|ios|ipad|ipod|iemobile/.test(e),isZalo:/zalo/.test(e)}},Li=e=>{const t=document.getElementsByTagName("meta");for(let i=0;i<t.length;i++)if(t[i].getAttribute("name")===e||t[i].getAttribute("property")===e)return t[i].getAttribute("content");return""},xi=()=>{const e=Ui().toLowerCase().split("zalo")[1];if(e){return e.replace(" ","").split("/")[1]||""}return""},zi=()=>{let t=Mi();return t.isWP?e.PlatformType.wp:t.isAndroid?e.PlatformType.android:t.isIOS?e.PlatformType.iOS:e.PlatformType.unknown},Wi=(e,t)=>{const i=t.toLowerCase(),n=i.split(/[<>]/i),o="array"===n[0];return!!("url"===i&&ji(e)||o&&("array"===i&&Array.isArray(e)||((e,t)=>Array.isArray(t)&&!t.some((t=>"url"===e?!ji(t):typeof t!==e)))(n[1],e))||!Array.isArray(e)&&typeof e===t)},Ji=e=>(e=>{let t=Gt(e);return t||(t=Ht(e),t)?t:Kt(e)})(e),Fi=e=>{if(Jt.isObject(JSON)&&JSON.parse&&Jt.isString(e)){const t=e.replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/\t/g,"\\t").replace(/\x00/g,"");return JSON.parse(t,((e,t)=>t))}return Jt.isObject(e)?e:new Function("return "+e)()},Ki=e=>{if(Jt.isObject(JSON)&&JSON.stringify)return JSON.stringify(e);if(void 0===e)return"undefined";if(null===e)return"null";try{if("string"==typeof e||null!==e.constructor.toString().match(/string/i))return'"'+e.replace(/"/g,'\\"')+'"'}catch(e){console.log(e)}var t;if(null!==Object.prototype.toString.call(e).match(/array/i)){t=new Array;for(var i=e.length,n=0;n<i;n++)t.push(Ki(e[n]));return"["+t.join(",")+"]"}if("object"==typeof e){for(var o in t=new Array,e)t.push('"'+o+'":'+Ki(e[o]));return"{"+t.join(",")+"}"}return e.toString()},Gi=()=>{try{const e=Number(xi()),t=zi();return e>=mi[t]}catch(e){return!0}},Hi=e=>JSON.stringify(e).replace(/"/g,'\\"').replace(/'/g,"&#39;"),$i=e=>{try{if(e){Bi(e);const t=e.replace(/\\/g,"").replace(/&#39;/g,"'");return Bi("formattedValue",t,JSON.parse(t),typeof JSON.parse(t)),JSON.parse(t)}return null}catch(t){return Bi("parse json error:",t),e}},Zi=(e,t,i,o,r,a)=>n(void 0,void 0,void 0,(function*(){const n=new URL(location.href),s=new URLSearchParams;let c=`${n.pathname}${n.search}`;a&&(c=`/zapps/${e}${"/"===a[0]?"":"/"}${a}`);const l=new URL(`https://zalo.me/app/link${c}`);s.append("title",i),s.append("description",o||""),s.append("thumbnail",r),s.append("url",l.href),s.append("accessToken",t||"");const d=yield fetch("https://h5.zalo.me/openapi/create-sharelink",Object.assign({method:"POST",body:s},{headers:{"Content-Type":"application/x-www-form-urlencoded"}})),u=yield d.json();if(!u||0!==u.err)throw Ii.cannotGetShareInfo();return l.search=`${l.search}&zshareId=${u.data.shareId}`,Object.assign(Object.assign({},u.data),{shareableLink:l.href})})),Vi=(e,t)=>i=>{if(!(Array.isArray(e)?e.some((e=>Wi(i,e))):Wi(i,e)))return{error:!0,errorMessage:e};if(t){if(Array.isArray(null==t?void 0:t.values))return{error:!(null==t?void 0:t.values.includes(i)),errorMessage:null==t?void 0:t.values.toString()};if(Jt.isNumber(null==t?void 0:t.maxLength))return{error:Jt.isString(i)&&i.length>(null==t?void 0:t.maxLength),errorMessage:`data length must <= ${null==t?void 0:t.maxLength}`};if(Jt.isNumber(null==t?void 0:t.min)&&Jt.isNumber(null==t?void 0:t.max))return{error:i<(null==t?void 0:t.min)||i>(null==t?void 0:t.max),errorMessage:`data must be in between ${null==t?void 0:t.min} and ${null==t?void 0:t.max}`};if(Jt.isNumber(null==t?void 0:t.min))return{error:i<(null==t?void 0:t.min),errorMessage:`data must >= ${null==t?void 0:t.min}`};if(Jt.isNumber(null==t?void 0:t.max))return{error:i>(null==t?void 0:t.max),errorMessage:`data must <= ${null==t?void 0:t.max}`};if(Jt.isRegExp(null==t?void 0:t.regex))return{error:!t.regex.test(i),errorMessage:"data must valid"}}return{error:!1}},qi=(e,t,i)=>n(void 0,void 0,void 0,(function*(){const n={appId:e,versionStatus:t};Jt.isUndefined(i)||(n.currentVersion=i);const o=Pi.appendToUrl(ii,n),r=yield fetch(o,{credentials:"include"});if(r.ok){const e=yield r.json();if(e.err<0||!e.data)throw new Error(e);return{name:e.data.name,version:e.data.version,description:e.data.description,appUrl:e.data.appUrl,qrCodeUrl:e.data.qrCodeUrl,logoUrl:e.data.logoUrl}}throw new Error("Can't get app info")}));var Yi=h((function(e){var t=Object.prototype.hasOwnProperty,i="~";function n(){}function o(e,t,i){this.fn=e,this.context=t,this.once=i||!1}function r(e,t,n,r,a){if("function"!=typeof n)throw new TypeError("The listener must be a function");var s=new o(n,r||e,a),c=i?i+t:t;return e._events[c]?e._events[c].fn?e._events[c]=[e._events[c],s]:e._events[c].push(s):(e._events[c]=s,e._eventsCount++),e}function a(e,t){0==--e._eventsCount?e._events=new n:delete e._events[t]}function s(){this._events=new n,this._eventsCount=0}Object.create&&(n.prototype=Object.create(null),(new n).__proto__||(i=!1)),s.prototype.eventNames=function(){var e,n,o=[];if(0===this._eventsCount)return o;for(n in e=this._events)t.call(e,n)&&o.push(i?n.slice(1):n);return Object.getOwnPropertySymbols?o.concat(Object.getOwnPropertySymbols(e)):o},s.prototype.listeners=function(e){var t=i?i+e:e,n=this._events[t];if(!n)return[];if(n.fn)return[n.fn];for(var o=0,r=n.length,a=new Array(r);o<r;o++)a[o]=n[o].fn;return a},s.prototype.listenerCount=function(e){var t=i?i+e:e,n=this._events[t];return n?n.fn?1:n.length:0},s.prototype.emit=function(e,t,n,o,r,a){var s=i?i+e:e;if(!this._events[s])return!1;var c,l,d=this._events[s],u=arguments.length;if(d.fn){switch(d.once&&this.removeListener(e,d.fn,void 0,!0),u){case 1:return d.fn.call(d.context),!0;case 2:return d.fn.call(d.context,t),!0;case 3:return d.fn.call(d.context,t,n),!0;case 4:return d.fn.call(d.context,t,n,o),!0;case 5:return d.fn.call(d.context,t,n,o,r),!0;case 6:return d.fn.call(d.context,t,n,o,r,a),!0}for(l=1,c=new Array(u-1);l<u;l++)c[l-1]=arguments[l];d.fn.apply(d.context,c)}else{var h,p=d.length;for(l=0;l<p;l++)switch(d[l].once&&this.removeListener(e,d[l].fn,void 0,!0),u){case 1:d[l].fn.call(d[l].context);break;case 2:d[l].fn.call(d[l].context,t);break;case 3:d[l].fn.call(d[l].context,t,n);break;case 4:d[l].fn.call(d[l].context,t,n,o);break;default:if(!c)for(h=1,c=new Array(u-1);h<u;h++)c[h-1]=arguments[h];d[l].fn.apply(d[l].context,c)}}return!0},s.prototype.on=function(e,t,i){return r(this,e,t,i,!1)},s.prototype.once=function(e,t,i){return r(this,e,t,i,!0)},s.prototype.removeListener=function(e,t,n,o){var r=i?i+e:e;if(!this._events[r])return this;if(!t)return a(this,r),this;var s=this._events[r];if(s.fn)s.fn!==t||o&&!s.once||n&&s.context!==n||a(this,r);else{for(var c=0,l=[],d=s.length;c<d;c++)(s[c].fn!==t||o&&!s[c].once||n&&s[c].context!==n)&&l.push(s[c]);l.length?this._events[r]=1===l.length?l[0]:l:a(this,r)}return this},s.prototype.removeAllListeners=function(e){var t;return e?(t=i?i+e:e,this._events[t]&&a(this,t)):(this._events=new n,this._eventsCount=0),this},s.prototype.off=s.prototype.removeListener,s.prototype.addListener=s.prototype.on,s.prefixed=i,s.EventEmitter=s,e.exports=s}));class Qi extends Yi{constructor(){super(),this.debug=Ft("zmp:event-emitter")}static getInstance(){return Qi.instance||(Qi.instance=new Qi),Qi.instance}h5ConfirmHandleEvent(e,t,i){ZaloJavaScriptInterface.jsH5EventCallback(e,t,i||"")}on(e,t,i){this.debug(`register ${e}: ${i}`);return super.on(e,((n,o)=>{this.h5ConfirmHandleEvent(n,e,i),t(o)}),i)}once(e,t,i){this.debug(`register once ${e}: ${i}`);return super.once(e,((n,o)=>{this.h5ConfirmHandleEvent(n,e,i),t(o)}),i)}}var Xi,en,tn,nn,on,rn="2.23.4-0";class an{static getVersion(){return rn}static getSystemInfo(){return{version:Li("version-id")||"",apiVersion:rn,zaloVersion:xi(),platform:zi(),language:navigator.language,zaloLanguage:window.zLanguage||"vi",zaloTheme:window.zTheme||"light"}}static getAppInfo(){return n(this,void 0,void 0,(function*(){const e=this.getAppId(),t=this.getSystemInfo();return yield qi(e,0,t.version)}))}}class sn{static setNavigationBarTitle(e){return n(this,void 0,void 0,(function*(){yield this.getJSBridge().callNative(fi.CHANGE_TITLE_HEADER,{title:e.title},{haveTimeout:!1})}))}static setNavigationBarColor(e){return n(this,void 0,void 0,(function*(){const t={};let i;Jt.isEmpty(e.textColor)||(t.textColor=e.textColor),Jt.isString(e.color)&&e.color.length>0?(Jt.isEmpty(e.color)||(t.backgroundColor=e.color),i=5):(Jt.isEmpty(e.statusBarColor)||(t.backgroundColor=e.statusBarColor),i=6),this.setActionBarConfig((e=>Object.assign(Object.assign({},e),{actionbarType:i,dataConfig:Object.assign(Object.assign({},e.dataConfig),t)}))),yield this.getJSBridge().callNative(fi.CHANGE_ACTIONBAR,Object.assign({},this.getActionBarConfig()),{haveTimeout:!1})}))}static setNavigationBarLeftButton(e,t){return n(this,void 0,void 0,(function*(){let i,n;Jt.isString(e)&&(i="none"===e||"home"===e?Ei:Si,n="home"===e||"both"===e?Oi:Ai),this.setActionBarConfig((e=>Object.assign(Object.assign({},e),{buttonType:Jt.isNumber(i)?i:e.buttonType,dataConfig:Object.assign(Object.assign({},e.dataConfig),{confirmToExit:Jt.isNumber(t)?t:e.dataConfig.confirmToExit,viewInLeftType:Jt.isNumber(i)?i:e.dataConfig.viewInLeftType}),homeConfig:Object.assign(Object.assign({},e.homeConfig),{enable:Jt.isNumber(n)?n:e.homeConfig.enable})}))),yield this.getJSBridge().callNative(fi.CHANGE_ACTIONBAR_LEFTBUTTON_TYPE,Object.assign({},this.getActionBarConfig()),{haveTimeout:!1})}))}static setNavigationBar(e){return n(this,void 0,void 0,(function*(){yield this.getJSBridge().callNative(fi.CHANGE_ACTIONBAR,{data:e},{haveTimeout:!1})}))}}class cn{static setBackgroundColor(e){return n(this,void 0,void 0,(function*(){Jt.isString(e.backgroundColor)&&e.backgroundColor.length>0&&(yield this.getJSBridge().callNative(fi.CHANGE_ACTIONBAR,{actionbarType:this.isShowNavBar?5:6,dataConfig:{backgroundColor:e.backgroundColor,textColor:e.textColor}}))}))}}class ln{constructor(e,t,i,n){this.title=n,this.severity=t;const o=new Date;if(this.time=o.toLocaleTimeString(),this.content=e,i>0){const e=(new Error).stack;this.stack=e?e.replace("Error\n",""):""}}toString(){return(this.content.stack?[this.title,this.severity.toUpperCase(),this.time,this.content,this.content.stack.replace("Error:","")]:[this.title,this.severity.toUpperCase(),this.time,JSON.stringify(this.content),this.stack]).join(" ")}}Xi=new WeakMap,en=new WeakMap,tn=new WeakMap,nn=new WeakMap,on=new WeakMap;const dn=new class{constructor(){Xi.set(this,3),en.set(this,["none","error","warn","info"]),tn.set(this,"[zmp] > "),nn.set(this,{error:0,warn:0,info:0,firstError:null,lastError:null}),on.set(this,((e,t,i)=>{o(this,nn,"f")[o(this,en,"f")[e]]++;const n=o(this,en,"f")[e];if(r(this,tn,o(this,tn,"f")+("string"!=typeof t?new ln(t,n,e,i).toString():t),"f"),!(e>o(this,Xi,"f")))switch(e){case 1:console.error(o(this,tn,"f"));break;case 2:console.warn(o(this,tn,"f"));break;case 3:console.info(o(this,tn,"f"));break;default:throw new Error("internal")}}))}setLogLevel(e){r(this,Xi,e,"f")}info(e){o(this,on,"f").call(this,3,e)}warn(e,t){o(this,on,"f").call(this,2,e,t)}error(e,t){o(this,on,"f").call(this,1,e,t)}getMetrics(){return o(this,nn,"f")}};class un{static setDeviceOrientation(t){return n(this,void 0,void 0,(function*(){yield this.getJSBridge().callNative(fi.CHANGE_AUTOROTATE,{autoRotate:e.OrientationType[t.rotate]})}))}static getNetworkType(t){return n(this,void 0,void 0,(function*(){return yield this.getJSBridge().callNative(fi.WEBVIEW_NETWORKTYPE,{url:window.location.href,featureId:""}).then((t=>{const i=t.network;let n;const o=Mi().isAndroid;switch(i){case ri(o).NONE:n=e.NetworkType.none;break;case ri(o).WIFI:n=e.NetworkType.wifi;break;case ri(o)["2G"]:case ri(o)["3G"]:case ri(o)["4G"]:n=e.NetworkType.cellular;break;default:n=e.NetworkType.unknown}return{networkType:n}}))}))}static onNetworkStatusChange(t){return n(this,void 0,void 0,(function*(){yield this.events.on(e.Events.NetworkChanged,(e=>{const i=e&&e.state;this.getNetworkType().then((e=>{const n={isConnected:"CONNECTED"===i,networkType:e&&e.networkType};t(n)})).catch((e=>{dn.error(e,"onNetworkStatusChange")}))}))}))}static startBeaconDiscovery(e){var t,i,o,r,a;return n(this,void 0,void 0,(function*(){const n={subaction:0,scanning_type:Jt.isNumber(null==e?void 0:e.scanningType)?e.scanningType:0,data:{scan_from_source:Jt.isString(null==e?void 0:e.scanFromSource)?e.scanFromSource:"",expire:Jt.isNumber(null==e?void 0:e.expire)?e.expire:3e3,monitor_interval:Jt.isNumber(null==e?void 0:e.monitorInterval)?e.monitorInterval:60,domain:Jt.isString(null==e?void 0:e.domain)?e.domain:"",scan_config:{scan_time:Jt.isNumber(null===(t=null==e?void 0:e.scanConfig)||void 0===t?void 0:t.scanTime)?e.scanConfig.scanTime:15e3,time_between_scan:Jt.isNumber(null===(i=null==e?void 0:e.scanConfig)||void 0===i?void 0:i.timeBetweenScan)?e.scanConfig.timeBetweenScan:1e4,beacon_timeout:Jt.isNumber(null===(o=null==e?void 0:e.scanConfig)||void 0===o?void 0:o.beaconTimeout)?e.scanConfig.beaconTimeout:3e4,delayCheckConnectedTimeout:Jt.isNumber(null===(r=null==e?void 0:e.scanConfig)||void 0===r?void 0:r.delayCheckConnectedTimeout)?e.scanConfig.delayCheckConnectedTimeout:5e3,beaconConnectedTimeout:Jt.isNumber(null===(a=null==e?void 0:e.scanConfig)||void 0===a?void 0:a.beaconConnectedTimeout)?e.scanConfig.beaconConnectedTimeout:6e5},items:Array.isArray(null==e?void 0:e.items)?null==e?void 0:e.items:[]}};return yield this.getJSBridge().callNative(fi.SCAN_IBEACON,Object.assign({},n)),!0}))}static stopBeaconDiscovery(e){return n(this,void 0,void 0,(function*(){return yield this.getJSBridge().callNative(fi.SCAN_IBEACON,Object.assign({},{subaction:2})),!0}))}static getBeacons(e){return n(this,void 0,void 0,(function*(){return yield this.getJSBridge().callNative(fi.SCAN_IBEACON,Object.assign({},{subaction:1}),{isMultiCallback:!0}).then((e=>{const t={beacons:[]};return Array.isArray(e)&&e.forEach((e=>{const i={uuid:e.uuid,major:e.major,minor:e.minor,distance:e.distance,rssi:e.rssi};t.beacons.push(i)})),t}))}))}static stopBluetoothDevicesDiscovery(){return n(this,void 0,void 0,(function*(){return this.getJSBridge().callNative({name:""},{})}))}static startBluetoothDevicesDiscovery(e){return n(this,void 0,void 0,(function*(){return this.getJSBridge().callNative({name:""},Object.assign({},e))}))}static openBluetoothAdapter(){return n(this,void 0,void 0,(function*(){return this.getJSBridge().callNative({name:""},{})}))}static onBluetoothDeviceFound(){return n(this,void 0,void 0,(function*(){return this.getJSBridge().callNative({name:""},{})}))}static onBluetoothAdapterStateChange(){return n(this,void 0,void 0,(function*(){return Promise.resolve()}))}static getConnectedBluetoothDevices(e){return n(this,void 0,void 0,(function*(){const t={services:e.services||[]};return this.getJSBridge().callNative({name:""},t)}))}static getBluetoothDevices(){return n(this,void 0,void 0,(function*(){return this.getJSBridge().callNative({name:""},{})}))}static getBluetoothAdapterState(){return n(this,void 0,void 0,(function*(){return this.getJSBridge().callNative({name:""},{})}))}static closeBluetoothAdapter(){return n(this,void 0,void 0,(function*(){return this.getJSBridge().callNative({name:""},{})}))}static scanQRCode(e){return n(this,void 0,void 0,(function*(){return yield this.getJSBridge().callNative(fi.OPEN_QR,{skipOpenLink:!0})}))}static showToast(e){return n(this,void 0,void 0,(function*(){yield this.getJSBridge().callNative(fi.SHOW_TOAST,{toast:e.message})}))}static hideKeyboard(e){return n(this,void 0,void 0,(function*(){yield this.getJSBridge().callNative(fi.HIDE_KEYBOARD,{})}))}static openPhone(e){return n(this,void 0,void 0,(function*(){yield this.getJSBridge().callNative(fi.OPEN_PHONE,{phoneNum:e.phoneNumber,phoneCode:e.phoneNumber})}))}static openSMS(e){return n(this,void 0,void 0,(function*(){yield this.getJSBridge().callNative(fi.OPEN_SMS,{content:e.content,phoneCode:e.phoneNumber})}))}static keepScreen(e){return n(this,void 0,void 0,(function*(){return yield this.getJSBridge().callNative(fi.KEEP_SCREEN,{data:{keep_screen_on:e.keepScreenOn?1:0}})}))}static openBioAuthentication(e){return n(this,void 0,void 0,(function*(){return yield this.getJSBridge().callNative(fi.PROMPT_AUTHENTICATION,{secret_data:e.secretData,app_id:this.getZAppId(),ui:{title:e.ui.title,sub_title:e.ui.subTitle,negative_text:e.ui.negativeButtonText},require_fingerprint:e.requireFingerprint?1:0}).then((e=>{var t,i,n,o;return{code:null==e?void 0:e.error_code,message:null==e?void 0:e.error_message,data:{domain:null===(t=null==e?void 0:e.data)||void 0===t?void 0:t.domain,code:null===(i=null==e?void 0:e.data)||void 0===i?void 0:i.error_code,message:null===(n=null==e?void 0:e.data)||void 0===n?void 0:n.error_message,payToken:null===(o=null==e?void 0:e.data)||void 0===o?void 0:o.pay_token}}}))}))}static checkStateBioAuthentication(e){return n(this,void 0,void 0,(function*(){return yield this.getJSBridge().callNative(fi.PROMPT_AUTHENTICATION_CHECK_STATE,{}).then((e=>({bioState:null==e?void 0:e.bio_state})))}))}static vibrate(t){return n(this,void 0,void 0,(function*(){return yield this.getJSBridge().callNative(fi.INTERACTIVE_VIBRATION,{type:e.VibrateType[t.type],vibrate_time:t.milliseconds})}))}static connectWifi(e){return n(this,void 0,void 0,(function*(){let t="open";return Jt.isString(e.password)&&e.password.length>0&&(t="wpa_wpa2"),yield this.getJSBridge().callNative(fi.MP_JOIN_WIFI,{ssid:e.SSID,securityType:t,password:e.password,hiddenSsid:e.hiddenSSID})}))}static openAppStore(e){return n(this,void 0,void 0,(function*(){return yield this.getJSBridge().callNative(fi.OPEN_APPSTORE,e)}))}}var hn,pn,vn;class fn{constructor(e){hn.set(this,localStorage),pn.set(this,void 0),vn.set(this,void 0),Mi(),r(this,vn,{keys:new Set,currentSize:0,limitSize:oi},"f"),r(this,pn,e,"f"),this.findAllCurrentDataByApp(e)}findAllCurrentDataByApp(e){try{let t;for(t in o(this,hn,"f")){if(e){if(t.split("_")[0]!==e)continue}o(this,vn,"f").keys.add(t)}}catch(e){dn.error(e,"LocalResourceStorage > findAllCurrentDataByApp")}}get(e){let t=new Map;return e.forEach((e=>{t.set(e,this.getSync(e))})),Promise.resolve(t)}getSync(e){return o(this,pn,"f")&&(e=`${o(this,pn,"f")}_${e}`),o(this,vn,"f").keys.has(e)?o(this,hn,"f").getItem(e):null}set(e){return n(this,void 0,void 0,(function*(){return Object.entries(e).forEach((([e,t])=>{this.setSync(e,t.replace(/\\"/g,'"'))})),Promise.resolve({errorKeys:[]})}))}setSync(e,t){o(this,pn,"f")&&(e=`${o(this,pn,"f")}_${e}`),o(this,hn,"f").setItem(e,t),o(this,vn,"f").keys.add(e)}getInfo(){return n(this,void 0,void 0,(function*(){return Promise.resolve(this.getInfoSync())}))}getInfoSync(){const e=((e,t)=>{let i,n,o=0;for(n in e){const r=n.split("_")[0];e.hasOwnProperty(n)&&(t&&r!==t||(i=2*(e[n].length+n.length),o+=i))}return o})(o(this,hn,"f"),o(this,pn,"f"));return{currentSize:Jt.isNumber(e)?Number((e/1024).toFixed(2)):0,limitSize:Number(5120..toFixed(2))}}remove(e){return n(this,void 0,void 0,(function*(){return e.forEach((e=>{this.removeSync(e)})),Promise.resolve({errorKeys:[]})}))}removeSync(e){o(this,pn,"f")&&(e=`${o(this,pn,"f")}_${e}`),o(this,vn,"f").keys.has(e)&&(o(this,hn,"f").removeItem(e),o(this,vn,"f").keys.delete(e))}clear(){return n(this,void 0,void 0,(function*(){return Promise.resolve(this.clearSync())}))}clearSync(){o(this,vn,"f").keys.forEach((e=>{o(this,pn,"f")&&e.indexOf(o(this,pn,"f"))<0||(o(this,hn,"f").removeItem(e),o(this,vn,"f").keys.delete(e))}))}}hn=new WeakMap,pn=new WeakMap,vn=new WeakMap;var gn={},mn=function(e,t,i){var n=t||"default";return function(){var t=n in gn?gn[n](e,i):e;return t.apply(this,arguments)}};mn.setWrapper=function(e){var t=arguments.length<=1||void 0===arguments[1]?"default":arguments[1];gn[t]=e};var _n={error:{code:1,error_subcode:1357046,message:"Received Invalid JSON reply.",type:"http"}};function yn(e){try{return null===e?_n:JSON.parse(e)}catch(e){return _n}}var Sn,En,On,An,Tn,Cn,bn,Nn,wn,In,Pn,kn,Dn,Rn,Bn,jn,Un,Mn,Ln,xn,zn,Wn,Jn,Fn,Kn,Gn,Hn,$n,Zn,Vn,qn,Yn,Qn,Xn={execute:function(e,t,i,n){i.suppress_http_code=1;var o=Pi.encode(i);"post"!=t&&(e=Pi.appendToUrl(e,o),o="");var r=function(e,t){if(!self.XMLHttpRequest)return null;var i=new XMLHttpRequest,n=function(){};if(!("withCredentials"in i))return null;i.open(e,t,!0),i.setRequestHeader("Content-type","application/x-www-form-urlencoded");var o={send:function(e){i.send(e)}},r=mn((function(){r=n,"onload"in o&&o.onload(i)}),"entry","XMLHttpRequest:load"),a=mn((function(){a=n,"onerror"in o&&o.onerror(i)}),"entry","XMLHttpRequest:error");return i.onload=function(){r()},i.onerror=function(){a()},i.onreadystatechange=function(){4==i.readyState&&(200==i.status?r():a())},o}(t,e);return!!r&&(r.onload=function(e){n(yn(e.responseText))},r.onerror=function(e){e.responseText?n(yn(e.responseText)):n({error:{code:1,error_subcode:1357045,message:"unknown error (empty response)",status:e.status,type:"http"}})},r.send(o),!0)}};class eo extends Yi{constructor(){super(),Sn.add(this),this.debug=Ft("zmp:ZaloJSBridge"),this.events=Qi.getInstance(),this._accessTk=Ji("zacc_session")||"DEFAULT_ACCESS_TOKEN",this._jsAccessTk=Ji("zlink3rd")||"DEFAULT_JS_TOKEN",this.results=[],this._userAgent=Ui(),this._device=Mi(),this.isJumped=!1,En.set(this,void 0),On.set(this,[]),An.set(this,void 0),this.getCookie=e=>n(this,void 0,void 0,(function*(){var t;yield this.jump();return null===(t=o(this,On,"f"))||void 0===t?void 0:t.find((t=>t.name===e))})),this.getCookieSync=e=>{var t;return null===(t=o(this,On,"f"))||void 0===t?void 0:t.find((t=>t.name===e))},this._jsCallFuncCallbacks={},r(this,An,{},"f"),this.events.on(e.Events.AppPaused,(()=>{if(this.results.length>0){let e=this.results;this.results=[];try{this.sendLogData(e)}catch(e){}}})),this.sendLogTimer?clearInterval(this.sendLogTimer):this.sendLogTimer=setInterval((()=>{if(this.results.length>0){let e=this.results;this.results=[];try{this.sendLogData(e)}catch(e){}}}),5e3),r(this,En,0,"f")}static getInstance(){return eo.instance||(eo.instance=new eo),eo.instance}set accessTk(e){this._accessTk=e}set jsAccessTk(e){this._jsAccessTk=e}jump(){return n(this,void 0,void 0,(function*(){const e=this;return r(this,En,+o(this,En,"f")+1,"f"),o(this,En,"f")>1&&(yield function(){return n(this,void 0,void 0,(function*(){return yield new Promise((t=>{const i=setInterval((()=>{(o(e,En,"f")<=1||e.isJumped)&&(t("done"),clearInterval(i))}),200)}))}))}()),new Promise(((e,t)=>{this.isJumped?(e(o(this,On,"f")),r(this,En,+o(this,En,"f")-1,"f")):(this.debug("******** call jump ********"),this.callNative(fi.JUMP_LOGIN,{}).then((t=>{const i=t&&t.cookiesOAuthLogins||[],n=t&&t.actionPermission||[];Object.entries(n).forEach((e=>{const t=e[0],i=e[1]||{perm:0,decode:0};o(this,An,"f")[t]||(o(this,An,"f")[t]={permission:!1,support:!1}),o(this,An,"f")[t].permission=1===i.perm}));const a=i.find((e=>e.name===Yt.JS_TOKEN));a&&(this.jsAccessTk=a.value,window.ZJSBridge.setJSToken&&window.ZJSBridge.setJSToken(a.value)),r(this,On,i,"f"),this.isJumped=!0,e(i)})).catch((e=>{this.isJumped=!1,t(e)})).finally((()=>{r(this,En,+o(this,En,"f")-1,"f")})))}))}))}sendLogData(e){try{const t=e.map((e=>({action:e.action,error:e.error,message:e.message,data:e.data})));Xn.execute(ni,"post",{appId:window.APP_ID,data:JSON.stringify(t)},(e=>{})),window.zmpSentry&&window.zmpSentry.captureMessage("Result from native",{extra:{data:e}})}catch(e){}}onJSCall(e,t){try{this.debug("onJSCall",e,t);const i=Fi(t);let n;if(this._jsCallFuncCallbacks[e]){n=this._jsCallFuncCallbacks[e].inputData;const t=this._jsCallFuncCallbacks[e].callback,o=this._jsCallFuncCallbacks[e].timeout;if(t){try{t.call(this,i)}catch(e){console.error("Call callback error",e)}o&&clearTimeout(o),this._jsCallFuncCallbacks[e]=null,delete this._jsCallFuncCallbacks[e]}}const o={action:i.action,error:i.error_code,message:i.error_message,data:{}};try{if(i.action===fi.OPEN_INAPP.name||i.action===fi.OPEN_OUTAPP.name){const e=new URL(n.url),t=`${e.protocol}//${e.host}${e.pathname}`;o.data={url:t}}}catch(e){}this.results.push(o)}catch(e){console.log("onJSCall","error",e)}}onMultiJSCall(e,t){try{this.debug("onMultiJSCall",e,t);const i=Fi(t);let n;if(this._jsCallFuncCallbacks[e]){n=this._jsCallFuncCallbacks[e].inputData;const t=this._jsCallFuncCallbacks[e].callback,o=this._jsCallFuncCallbacks[e].timeout;if(t){try{t.call(this,i)}catch(e){console.error("Call callback error",e)}o&&clearTimeout(o)}}const o={action:i.action,error:i.error_code,message:i.error_message,data:{}};try{if(i.action===fi.OPEN_INAPP.name||i.action===fi.OPEN_OUTAPP.name){const e=new URL(n.url),t=`${e.protocol}//${e.host}${e.pathname}`;o.data={url:t}}}catch(e){}this.results.push(o)}catch(e){console.log("onMultiJSCall","error",e)}}nativeEventHandler(e,t,i){this.debug(`eventId: ${e}, eventName: ${t}, eventData: ${i}`);const n=$i(i);this.debug(n);const o=this.handleEventData(t,n);this.events.emit(t,e,o)}handleEventData(t,i){try{switch(t){case e.Events.OpenApp:const{url:t}=i,n=new URL(t),o=n.pathname.split(`/zapps/${Vt}`)[1];return{path:`${o||"/"}${n.search}`};default:return i}}catch(e){return i}}defaultCallback(e){null!=e&&(e=Fi(e))}callNative(e,t,i){return this.debug(e.name,t),new Promise(((r,a)=>n(this,void 0,void 0,(function*(){const s=t=>n(this,void 0,void 0,(function*(){var n,o,s,c,l,d,u,h;try{if(Jt.isUndefined(t)||Jt.isNull(t))return a(new Error("Native callback is null"));if(0!==t.error_code){let i=new bi(t.error_code,t.error_message);const r=zi();if(e===fi.JUMP_LOGIN)i=new bi(si,`Can not get auth code: ${t.error_message}`);else if(this.isJumped||e.skip_jump){if("permission required!"===String(i.message).toLowerCase()||"no permission!"===String(i.message).toLowerCase())i=new bi(vi.FORBIDDEN.code,vi.FORBIDDEN.message);else if(gi[r][t.error_code])i=new bi(gi[r][t.error_code].code,gi[r][t.error_code].message);else if(null===(o=null===(n=e.error_list)||void 0===n?void 0:n[r])||void 0===o?void 0:o[String(t.error_code)]){let n=e.error_list[r][String(t.error_code)].map_to.message;(null===(l=null===(c=null===(s=e.error_list)||void 0===s?void 0:s[r])||void 0===c?void 0:c[String(t.error_code)])||void 0===l?void 0:l.need_more_detail)&&(n=`${null===(h=null===(u=null===(d=e.error_list)||void 0===d?void 0:d[r])||void 0===u?void 0:u[String(t.error_code)])||void 0===h?void 0:h.map_to.message}: ${t.error_message}`),i=new bi(e.error_list[r][String(t.error_code)].map_to.code,n)}}else i=new bi(vi.UNAUTHORIZED.code,vi.UNAUTHORIZED.message);return a(i)}if(null==i?void 0:i.successCallback){const e=yield i.successCallback(t.data);return r(e)}r(t.data||{})}catch(e){return a(e)}}));e.skip_jump||(yield this.jump());const c=Mi().isIOS,l=(e=>{var t;const i=xi(),n=(null===(t=null==e?void 0:e.version_live)||void 0===t?void 0:t.iOS)||0;return!!(Array.isArray(window.ignoreCheckSupport)&&window.ignoreCheckSupport.length>0&&window.ignoreCheckSupport.includes(e.name))||i>=n})(e);if(c&&!l){const e=new bi(-5,"Client isn't support this action");return a(e)}(null==i?void 0:i.delay)?setTimeout((()=>{o(this,Sn,"m",Tn).call(this,e,t,s,null==i?void 0:i.isMultiCallback,null==i?void 0:i.nRetry,null==i?void 0:i.haveTimeout)}),i.delay):o(this,Sn,"m",Tn).call(this,e,t,s,null==i?void 0:i.isMultiCallback,null==i?void 0:i.nRetry,null==i?void 0:i.haveTimeout)}))))}}En=new WeakMap,On=new WeakMap,An=new WeakMap,Sn=new WeakSet,Tn=function e(t,i,n,r=!1,a=3,s=!0){try{const c=t.name,l=((e="")=>`${e.normalize("NFD").replace(ki,"").replace(Di,"d").replace(Ri,"").toLowerCase()}_${Math.random().toString(36).substr(2,4)}`)(c);if(!this._device.isMobile||Jt.isEmpty(c))return this.onJSCall(l,{error_code:-13,error_message:"params invalid!",data:{device:this._device.isMobile,jsToken:this._jsAccessTk,access_token:this._accessTk},action:c}),!1;null==i&&(i={}),n||(n=this.defaultCallback);const d={error_code:-14,error_message:"Request Timeout!",data:{},action:c};this._jsCallFuncCallbacks[l]={inputData:i,timeout:s&&t.have_callback&&setTimeout((()=>{this.onJSCall(l,d)}),8e3),callback:n};try{return i=Ki(i),r?this._device.isIOS?ZaloJavaScriptInterface.jsCall(this._jsAccessTk,c,this._accessTk,i,window.onMultiJSCall(l)):ZaloJavaScriptInterface.jsCall(this._jsAccessTk,c,this._accessTk,i,`window.onMultiJSCall('${l}')`):this._device.isIOS?ZaloJavaScriptInterface.jsCall(this._jsAccessTk,c,this._accessTk,i,window.onJSCall(l)):ZaloJavaScriptInterface.jsCall(this._jsAccessTk,c,this._accessTk,i,`window.onJSCall('${l}')`)}catch(s){if(!(a-- >0)){const e={error_code:-5,error_message:"Not ready!",data:{userAgent:this._userAgent,options:i,jsToken:this._jsAccessTk,access_token:this._accessTk},action:c,js_error:s};return this.onJSCall(l,e),!1}setTimeout((()=>{o(this,Sn,"m",e).call(this,t,i,n,r,a)}),500)}}catch(e){console.log("jsCall","error",e)}return!1};class to{constructor(e){Cn.set(this,void 0),bn.set(this,void 0),Nn.set(this,void 0),r(this,bn,{keys:new Set,currentSize:0,limitSize:oi},"f"),r(this,Cn,e,"f"),r(this,Nn,eo.getInstance(),"f")}get(e){return n(this,void 0,void 0,(function*(){return yield o(this,Nn,"f").callNative(fi.ZBROWSER_MPDS,{mpds_action:"mpds.get",mpds_data:{keys:e},appId:o(this,Cn,"f")},{isMultiCallback:!1}).then((e=>{let t=new Map;return e&&e.mpds_data&&e.mpds_data.map&&(t=new Map(Object.entries(e.mpds_data.map))),t}))}))}set(e){return n(this,void 0,void 0,(function*(){return{errorKeys:yield o(this,Nn,"f").callNative(fi.ZBROWSER_MPDS,{mpds_action:"mpds.set",mpds_data:{map:e},appId:o(this,Cn,"f")},{isMultiCallback:!1}).then((e=>{let t=[];return e&&e.mpds_data&&e.mpds_data.error_keys&&(t=e.mpds_data.error_keys),t}))}}))}getInfo(){return n(this,void 0,void 0,(function*(){const e=yield o(this,Nn,"f").callNative(fi.ZBROWSER_MPDS,{mpds_action:"mpds.get.size",mpds_data:{},appId:o(this,Cn,"f")},{isMultiCallback:!1}).then((e=>{let t=0;return e&&e.mpds_data&&e.mpds_data.size&&(t=e.mpds_data.size),t}));return{currentSize:Jt.isNumber(e)?Number(e/1024):0,limitSize:Number(5120)}}))}remove(e){return n(this,void 0,void 0,(function*(){return{errorKeys:yield o(this,Nn,"f").callNative(fi.ZBROWSER_MPDS,{mpds_action:"mpds.remove.key",mpds_data:{keys:e},appId:o(this,Cn,"f")},{isMultiCallback:!1}).then((e=>{let t=[];return e&&e.mpds_data&&e.mpds_data.error_keys&&(t=e.mpds_data.error_keys),t}))}}))}clear(){return n(this,void 0,void 0,(function*(){yield o(this,Nn,"f").callNative(fi.ZBROWSER_MPDS,{mpds_action:"mpds.clear.appData",mpds_data:{},appId:o(this,Cn,"f")})}))}}Cn=new WeakMap,bn=new WeakMap,Nn=new WeakMap;class io{getDataFromStorage(e){return n(this,void 0,void 0,(function*(){const t=this.getInstance(),i=yield t.get(e),n={};return i.forEach(((e,t)=>{n[t]=$i(e)})),n}))}putDataToStorage(e){return n(this,void 0,void 0,(function*(){const t=this.getInstance(),i={};return Object.entries(e).forEach((([e,t])=>{Jt.isUndefined(t)||Jt.isNull(t)||(i[e]=Hi(t))})),yield t.set(i)}))}removeDataFromStorage(e){return n(this,void 0,void 0,(function*(){const t=this.getInstance();return yield t.remove(e)}))}clearStorage(){return n(this,void 0,void 0,(function*(){const e=this.getInstance();yield e.clear()}))}getStorageInfo(){return n(this,void 0,void 0,(function*(){const e=this.getInstance();return yield e.getInfo()}))}}class no extends io{constructor(e){super(),wn.set(this,void 0),r(this,wn,e,"f")}getInstance(){return new fn(o(this,wn,"f"))}}wn=new WeakMap;class oo extends io{constructor(e){super(),In.set(this,void 0),r(this,In,e,"f")}getInstance(){return new to(o(this,In,"f"))}}In=new WeakMap;class ro{static setStorage(e){return n(this,void 0,void 0,(function*(){let t=new no(this.getAppId());return Gi()&&(t=new oo(this.getAppId())),yield t.putDataToStorage(e.data)}))}static getStorage(e){return n(this,void 0,void 0,(function*(){let t=new no(this.getAppId());Gi()&&(t=new oo(this.getAppId()));return yield t.getDataFromStorage(e.keys)}))}static getStorageInfo(e){return n(this,void 0,void 0,(function*(){let e=new no(this.getAppId());return Gi()&&(e=new oo(this.getAppId())),yield e.getStorageInfo()}))}static removeStorage(e){return n(this,void 0,void 0,(function*(){let t=new no(this.getAppId());return Gi()&&(t=new oo(this.getAppId())),yield t.removeDataFromStorage(e.keys)}))}static clearStorage(e={}){return n(this,void 0,void 0,(function*(){let e=new no(this.getAppId());Gi()&&(e=new oo(this.getAppId())),yield e.clearStorage()}))}}class ao{static getUserInfo(e){return n(this,void 0,void 0,(function*(){const t=yield this.getAccessToken();let i="id,name,user_id_by_oa,picture";(null==e?void 0:e.avatarType)&&(i=`${i}.type(${null==e?void 0:e.avatarType})`);return{userInfo:yield fetch(`${Qt}?fields=${i}`,{headers:{access_token:t||""}}).then((e=>n(this,void 0,void 0,(function*(){const t=yield e.json(),i={id:t.id,name:t.name,avatar:t.picture&&t.picture.data&&t.picture.data.url,idByOA:t.user_id_by_oa};return console.warn("'birthday' and 'gender' are deprecated"),i}))))}}))}static getPhoneNumber(e){return n(this,void 0,void 0,(function*(){return yield this.getJSBridge().callNative(fi.MP_GET_NUMBER,{},{isMultiCallback:!0,successCallback:e=>{const t={number:e};return Promise.resolve(t)},delay:this.isIOS?400:0})}))}}class so{static closeApp(e){return n(this,void 0,void 0,(function*(){yield this.getJSBridge().callNative(fi.WINDOW_CLOSE,{})}))}static openMiniApp(e){return n(this,void 0,void 0,(function*(){const t=null==e?void 0:e.appId,i=(null==e?void 0:e.params)||{},n=Object.entries(i).map((function([e,t]){return[e,t].join("=")})).join("&");let o;try{o=yield qi(t,0)}catch(e){}const r={appId:t};o&&(r.appName=o.name,r.appAvtUrl=o.logoUrl),yield this.getJSBridge().callNative(fi.OPEN_MP,{mpUrl:`https://h5.zdn.vn/zapps/${t}/${n.length>0?"?"+n:""}`,mpInfo:r})}))}static openWebview(e){return n(this,void 0,void 0,(function*(){yield this.getJSBridge().callNative(fi.OPEN_INAPP,{url:e})}))}static closeLoading(e){return n(this,void 0,void 0,(function*(){yield this.getJSBridge().callNative(fi.MP_CLOSE_LOADINGVIEW,{at:(new Date).getTime(),when:e,url:location.href})}))}}class co{static getLocation(e){return n(this,void 0,void 0,(function*(){return yield this.getJSBridge().callNative(fi.GET_LOCATION,{silent_request:!1,permission_description:"Cho phép Zalo truy cập vào vị trí của thiết bị này?"},{isMultiCallback:!0,haveTimeout:!1,successCallback:e=>{const t={latitude:e.latitude,longitude:e.longitude,timestamp:e.timestamp,provider:e.provider};return Promise.resolve(t)},delay:this.isIOS?400:0})}))}static sendLocation(e){return n(this,void 0,void 0,(function*(){yield this.getJSBridge().callNative(fi.QUERY_LOCATION_HIDE,{title:e.title,touserid:e.toUserId,zapp:this.getZAppId()})}))}}class lo{static requestCameraPermission(e){return n(this,void 0,void 0,(function*(){return yield this.getJSBridge().callNative(fi.REQUEST_PERMISSION_CAMERA,{},{successCallback:e=>Promise.resolve({userAllow:(null==e?void 0:e.error_code)>=0,message:null==e?void 0:e.error_message})})}))}static saveImageToPhotosAlbum(e){return n(this,void 0,void 0,(function*(){let t={};return Jt.isEmpty(e.imageBase64Data)?Jt.isEmpty(e.imageUrl)||(t={imageUrl:e.imageUrl}):t={imageBase64Data:e.imageBase64Data},yield this.getJSBridge().callNative(fi.SAVE_IMAGE_GALLERY,Object.assign({},t))}))}}class uo{static viewOAQr(e){return n(this,void 0,void 0,(function*(){yield this.getJSBridge().callNative(fi.VIEW_MYQR,{dpn:e.displayName,uid:e.id,zapp:this.getZAppId()},{haveTimeout:!1})}))}static openProfile(t){return n(this,void 0,void 0,(function*(){return yield this.getJSBridge().callNative(fi.OPEN_PROFILE,{uId:t.id,type:e.ProfileType[t.type],zapp:this.getZAppId(),sourceId:t.sourceId,sourceIndex:t.sourceIndex})}))}static openChat(t){return n(this,void 0,void 0,(function*(){return yield this.getJSBridge().callNative(fi.OPEN_CHAT,{uId:t.id,type:e.ChatType[t.type],msg:t.message||"",zapp:this.getZAppId(),sourceId:t.sourceId,sourceIndex:t.sourceIndex})}))}static openPostFeed(t){return n(this,void 0,void 0,(function*(){let i={};switch(t.type){case"image":i={photoUrl:t.data.imageUrl};break;case"link":i={link:t.data.link,title:t.data.title,thumb:t.data.thumb,description:t.data.description};break;case"profile":i={avt:t.data.avatar,uid:t.data.id,dpn:t.data.displayName}}return yield this.getJSBridge().callNative(fi.OPEN_POSTFEED,Object.assign(Object.assign({type:e.PostFeedType[t.type]},i),{zapp:this.getZAppId()})).then((e=>({status:e.status,shareType:e.share_type,numberOfUser:e.uid_to_size})))}))}static followOA(e){return n(this,void 0,void 0,(function*(){yield this.getJSBridge().callNative(fi.FOLLOW_OA,{uid:e.id,showDialogConfirm:!0,zapp:this.getZAppId()},{haveTimeout:!1})}))}static unfollowOA(e){return n(this,void 0,void 0,(function*(){yield this.getJSBridge().callNative(fi.UNFOLLOW_OA,{uid:e.id,zapp:this.getZAppId()},{haveTimeout:!1})}))}static openShareSheet(t){return n(this,void 0,void 0,(function*(){let i={},n=t.type;switch(t.type){case"image":let e=[];const o=xi(),r=zi();o>=_i[r]&&(n="multi_image"),Array.isArray(t.data.imageUrls)&&t.data.imageUrls.length>0?e=t.data.imageUrls:e.push(t.data.imageUrl),i={photoUrls:e,photoUrl:t.data.imageUrl,caption:t.data.caption};break;case"gif":i={photoUrl:t.data.imageUrl,gifUrl:t.data.gifUrl,width:t.data.width,height:t.data.height};break;case"video":i={videoThumb:t.data.videoThumb,videoUrl:t.data.videoUrl,width:t.data.width,height:t.data.height};break;case"link":i={link:t.data.link,chatOnly:t.data.chatOnly?1:0};break;case"oa":i={uid:t.data.id};break;case"zmp":const a=yield this.getAccessToken(),s=yield Zi(this.getAppId(),a||"",t.data.title||"",t.data.description||"",t.data.thumbnail||"",t.data.path);i={data:{ZInstantAPIInfo:{url:`${s.zinstantApi}`,zinstantdata_id:`templateId=${s.ztemplateId}&appId=${this.getAppId()}&shareId=${s.shareId}`},previewMsgText:{msg:{en:"Zalo Mini Program",vi:"Chương trình nhỏ"}},enableReactions:1}}}return yield this.getJSBridge().callNative(fi.OPEN_SHARESHEET,Object.assign(Object.assign({type:e.ShareSheetType[n]},i),{zapp:this.getZAppId()}),{haveTimeout:!1}).then((e=>({status:e.status,shareType:e.share_type,numberOfUser:e.uid_to_size})))}))}static createShortcut(e,t,i){return n(this,void 0,void 0,(function*(){return yield this.getJSBridge().callNative(fi.CREATE_SHORTCUT,{url:e,title:t,iconUrl:i})}))}static openProfilePicker(e){return n(this,void 0,void 0,(function*(){return yield this.getJSBridge().callNative(fi.MP_OPEN_PROFILE_PICKER,{maxProfile:e},{isMultiCallback:!0,successCallback:e=>{if(Array.isArray(e))return Promise.resolve(e.map((e=>e.id)))}})}))}static getActionsSupported(t){return n(this,void 0,void 0,(function*(){return yield this.getJSBridge().callNative(fi.GET_SUPPORTED_ACTIONS,{},{isMultiCallback:!1,successCallback:t=>{const i=zi();if(Array.isArray(t.actions)&&t.actions.length>0){const e=Object.keys(fi).filter((e=>fi[e].skip_jump)),i={actions:[...t.actions,...e]};return Promise.resolve(i)}if(i===e.PlatformType.iOS){const e={actions:yi};return Promise.resolve(e)}}})}))}static openMediaPicker(t,i,o,r,a,s){return n(this,void 0,void 0,(function*(){const n={type:0,url:i,maxSize:o||1048576};return yield this.getJSBridge().callNative(fi.PICK_MEDIA,{media_type:e.MediaPickerType[t],edit_view:Object.assign(Object.assign({},{enable:1,aspect_ratio:"1:1"}),r),silent_request:a,upload:n,max_select_items:s},{isMultiCallback:!0,successCallback:e=>{const t={data:null==e?void 0:e.result_content};return Promise.resolve(t)}})}))}static openOutApp(e){return n(this,void 0,void 0,(function*(){return yield this.getJSBridge().callNative(fi.OPEN_OUTAPP,{url:e})}))}}class ho{static getRouteParams(){let e={};const t=window.location.href;try{let i=new URL(t).searchParams.toString();i&&(e=Pi.getParamsAsObject(i))}catch(e){throw new Error("Url không hợp lệ")}return e}static sendDataToPreviousMiniApp(e){return n(this,void 0,void 0,(function*(){return yield this.getJSBridge().callNative(fi.WEBVIEW_SET_RESULT,{result:Hi(e.data)})}))}static onCallbackData(t){return n(this,void 0,void 0,(function*(){yield this.events.on(e.Events.OnDataCallback,(e=>{t({data:e})}))}))}}class po{constructor(){var e,t,i,a,s,c,l,d,u,h,p,v,f,g,m,_,y;Pn.set(this,Zt),kn.set(this,Vt),Dn.set(this,qt),Rn.set(this,void 0),Bn.set(this,void 0),jn.set(this,void 0),Un.set(this,null),Mn.set(this,{timer:{getToken:0}}),Ln.set(this,void 0),xn.set(this,void 0),zn.set(this,void 0),Wn.set(this,void 0),Jn.set(this,void 0),this.events=Qi.getInstance(),this.isIOS=Mi().isIOS,Fn.set(this,void 0),Kn.set(this,void 0),Gn.set(this,void 0),this.getActionBarConfig=()=>o(this,Fn,"f"),this.setActionBarConfig=e=>{r(this,Fn,e(o(this,Fn,"f")),"f")},this.getAuthCode=()=>n(this,void 0,void 0,(function*(){var e,t;return{authCode:null===(e=yield o(this,Ln,"f").getCookie(Yt.ZOAUTH))||void 0===e?void 0:e.value,authCodeVerify:null===(t=yield o(this,Ln,"f").getCookie(Yt.ZOAUTH_VRF))||void 0===t?void 0:t.value}})),this.getZPIToken=()=>n(this,void 0,void 0,(function*(){var e,t,i;return{utoken:null===(e=yield o(this,Ln,"f").getCookie(Yt.UTOKEN_ZPI))||void 0===e?void 0:e.value,gtoken:null===(t=yield o(this,Ln,"f").getCookie(Yt.GTOKEN_ZPI))||void 0===t?void 0:t.value,zpp:null===(i=yield o(this,Ln,"f").getCookie(Yt.ZPP_ZPI))||void 0===i?void 0:i.value}})),this.setAccessToken=e=>{r(this,Gn,!1,"f"),r(this,jn,e,"f"),o(this,Ln,"f").accessTk=e,window.ZJSBridge.setZAccSession&&window.ZJSBridge.setZAccSession(e)},this.getVersion=an.getVersion,this.getSystemInfo=an.getSystemInfo,this.setNavigationBarTitle=sn.setNavigationBarTitle,this.setNavigationBarColor=sn.setNavigationBarColor,this.setNavigationBarLeftButton=sn.setNavigationBarLeftButton,this.setBackgroundColor=cn.setBackgroundColor,this.setDeviceOrientation=un.setDeviceOrientation,this.setStorage=ro.setStorage,this.getStorage=ro.getStorage,this.getStorageInfo=ro.getStorageInfo,this.removeStorage=ro.removeStorage,this.clearStorage=ro.clearStorage,this.getUserInfo=ao.getUserInfo,this.getNetworkType=un.getNetworkType,this.onNetworkStatusChange=un.onNetworkStatusChange,this.startBeaconDiscovery=un.startBeaconDiscovery,this.stopBeaconDiscovery=un.stopBeaconDiscovery,this.getBeacons=un.getBeacons,this.closeApp=so.closeApp,this.getLocation=co.getLocation,this.stopBluetoothDevicesDiscovery=un.stopBluetoothDevicesDiscovery,this.startBluetoothDevicesDiscovery=un.stopBluetoothDevicesDiscovery,this.openBluetoothAdapter=un.openBluetoothAdapter,this.onBluetoothDeviceFound=un.onBluetoothDeviceFound,this.onBluetoothAdapterStateChange=un.onBluetoothAdapterStateChange,this.getConnectedBluetoothDevices=un.getConnectedBluetoothDevices,this.getBluetoothDevices=un.getBluetoothDevices,this.getBluetoothAdapterState=un.getBluetoothAdapterState,this.closeBluetoothAdapter=un.closeBluetoothAdapter,this.scanQRCode=un.scanQRCode,this.openProfile=uo.openProfile,this.openChat=uo.openChat,this.openPostFeed=uo.openPostFeed,this.followOA=uo.followOA,this.unFollowOA=uo.unfollowOA,this.openShareSheet=uo.openShareSheet,this.requestCameraPermission=lo.requestCameraPermission,this.createShortcut=uo.createShortcut,this.openBioAuthentication=un.openBioAuthentication,this.checkStateBioAuthentication=un.checkStateBioAuthentication,this.sendLocation=co.sendLocation,this.showToast=un.showToast,this.hideKeyboard=un.hideKeyboard,this.openPhone=un.openPhone,this.openSMS=un.openSMS,this.viewOAQr=uo.viewOAQr,this.keepScreen=un.keepScreen,this.saveImageToPhotosAlbum=lo.saveImageToPhotosAlbum,this.openMiniApp=so.openMiniApp,this.vibrate=un.vibrate,this.openWebview=so.openWebview,this.getRouteParams=ho.getRouteParams,this.getAppInfo=an.getAppInfo,this.sendDataToPreviousMiniApp=ho.sendDataToPreviousMiniApp,this.onCallbackData=ho.onCallbackData,this.getPhoneNumber=ao.getPhoneNumber,this.openProfilePicker=uo.openProfilePicker,Hn.set(this,uo.getActionsSupported),this.connectWifi=un.connectWifi,this.openMediaPicker=uo.openMediaPicker,this.openOutApp=uo.openOutApp,this.closeLoading=so.closeLoading,this.openAppStore=un.openAppStore,r(this,Rn,null,"f"),r(this,Bn,null,"f"),r(this,jn,null,"f"),this.isShowNavBar=!0,r(this,xn,(new Date).getTime(),"f"),r(this,zn,0,"f"),r(this,Wn,"","f"),r(this,Jn,null,"f"),r(this,Ln,eo.getInstance(),"f"),r(this,Kn,0,"f"),r(this,Gn,!1,"f");const S="home"===(null===(t=null===(e=o(this,Dn,"f"))||void 0===e?void 0:e.app)||void 0===t?void 0:t.leftButton)||"both"===(null===(a=null===(i=o(this,Dn,"f"))||void 0===i?void 0:i.app)||void 0===a?void 0:a.leftButton)?Oi:Ai,E=new URL(location.href),O=Jt.isString(null===(c=null===(s=o(this,Dn,"f"))||void 0===s?void 0:s.app)||void 0===c?void 0:c.headerColor)&&(null===(u=null===(d=null===(l=o(this,Dn,"f"))||void 0===l?void 0:l.app)||void 0===d?void 0:d.headerColor)||void 0===u?void 0:u.length)>0?5:6,A="none"===(null===(p=null===(h=o(this,Dn,"f"))||void 0===h?void 0:h.app)||void 0===p?void 0:p.leftButton)||"home"===(null===(f=null===(v=o(this,Dn,"f"))||void 0===v?void 0:v.app)||void 0===f?void 0:f.leftButton)?Ei:Si;r(this,Fn,{actionbarType:O,buttonType:A,dataConfig:{backgroundColor:(null===(m=null===(g=o(this,Dn,"f"))||void 0===g?void 0:g.app)||void 0===m?void 0:m.headerColor)||"",textColor:(null===(y=null===(_=o(this,Dn,"f"))||void 0===_?void 0:_.app)||void 0===y?void 0:y.textColor)||"",viewInLeftType:A,confirmToExit:1},homeConfig:{enable:S,url:`https://h5.zdn.vn/zapps/${this.getAppId()}/${E.search}`}},"f")}static getInstance(){return po.instance||(po.instance=new po),po.instance}getLoginStatus(){return Jt.isString(o(this,jn,"f"))&&o(this,jn,"f").length>0}getAppId(){return o(this,kn,"f")}getZAppId(){return o(this,Pn,"f")}getDeviceId(){var e;return n(this,void 0,void 0,(function*(){return null===(e=yield o(this,Ln,"f").getCookie(Yt.DEVICE_ID))||void 0===e?void 0:e.value}))}getDeviceIdSync(){var e;return null===(e=o(this,Ln,"f").getCookieSync(Yt.DEVICE_ID))||void 0===e?void 0:e.value}getContext(){var e,t;return n(this,void 0,void 0,(function*(){const i=null===(e=yield o(this,Ln,"f").getCookie(Yt.CONTEXT_ID))||void 0===e?void 0:e.value;return{type:null===(t=yield o(this,Ln,"f").getCookie(Yt.CONTEXT_TYPE))||void 0===t?void 0:t.value,id:i}}))}getContextSync(){var e,t;const i=null===(e=o(this,Ln,"f").getCookieSync(Yt.CONTEXT_ID))||void 0===e?void 0:e.value;return{type:null===(t=o(this,Ln,"f").getCookieSync(Yt.CONTEXT_TYPE))||void 0===t?void 0:t.value,id:i}}getJSBridge(){return o(this,Ln,"f")}login(e){return n(this,void 0,void 0,(function*(){r(this,Gn,!0,"f");let e=(new Date).getTime()-o(this,xn,"f");const t=this;if(r(this,Kn,+o(this,Kn,"f")+1,"f"),o(this,Kn,"f")>1&&(yield function(){return n(this,void 0,void 0,(function*(){return yield new Promise((e=>{const i=setInterval((()=>{(o(t,Kn,"f")<=1||o(t,jn,"f"))&&(e("done"),clearInterval(i))}),200)}))}))}()),e=(new Date).getTime()-o(this,xn,"f"),o(this,jn,"f")&&e<o(this,zn,"f"))return r(this,Kn,+o(this,Kn,"f")-1,"f"),o(this,jn,"f");const i=yield(yield this.getAuthCode()).authCode,a=yield(yield this.getAuthCode()).authCodeVerify;if(i){if(r(this,Rn,i,"f"),a?(r(this,Bn,a,"f"),yield this.loginZaloV4()):yield this.loginZaloV3(),r(this,Kn,+o(this,Kn,"f")-1,"f"),!o(this,jn,"f"))throw Ii.loginFailed("Invalid authorization code");return o(this,jn,"f")}throw r(this,Kn,+o(this,Kn,"f")-1,"f"),Ii.loginFailed("Zalo app has not been activated")}))}loginZaloV3(){return n(this,void 0,void 0,(function*(){return yield fetch(`${ei}?app_id=${o(this,Pn,"f")}&redirect_uri=https://h5.zdn.vn/zapps/${o(this,kn,"f")}/&code=${o(this,Rn,"f")}&isSDK=true`).then((e=>n(this,void 0,void 0,(function*(){let t=yield e.json();if(t.access_token){r(this,jn,t.access_token,"f");const e=1e3*parseInt(t.expires_in);return r(this,zn,e,"f"),r(this,xn,(new Date).getTime(),"f"),o(this,Ln,"f").accessTk=o(this,jn,"f")||"",window.ZJSBridge.setZAccSession&&window.ZJSBridge.setZAccSession(o(this,jn,"f")||""),o(this,jn,"f")}return null}))))}))}loginZaloV4(){return n(this,void 0,void 0,(function*(){const e=new URLSearchParams;e.append("app_id",o(this,kn,"f")),e.append("code",o(this,Rn,"f")||""),e.append("code_verifier",o(this,Bn,"f")||""),Jt.isNull(o(this,Un,"f"))?e.append("grant_type","authorization_code"):(e.append("grant_type","refresh_token"),e.append("refresh_token",o(this,Un,"f")||""));return yield fetch(Xt,Object.assign({method:"POST",body:e},{headers:{"Content-Type":"application/x-www-form-urlencoded"}})).then((e=>n(this,void 0,void 0,(function*(){const t=yield e.json();if(t.refresh_token&&r(this,Un,t.refresh_token,"f"),t.access_token){r(this,jn,t.access_token,"f");const e=1e3*parseInt(t.expires_in);return r(this,zn,e,"f"),r(this,xn,(new Date).getTime(),"f"),o(this,Ln,"f").accessTk=o(this,jn,"f")||"",window.ZJSBridge.setZAccSession&&window.ZJSBridge.setZAccSession(o(this,jn,"f")||""),o(this,jn,"f")}return null}))))}))}getAccessToken(e){return n(this,void 0,void 0,(function*(){const e=(new Date).getTime()-o(this,xn,"f");if(o(this,Gn,"f"))return o(this,jn,"f")&&e<o(this,zn,"f")?o(this,jn,"f"):(r(this,jn,"","f"),yield this.login());if(!o(this,jn,"f"))throw Ii.loginRequired();return o(this,jn,"f")}))}}Pn=new WeakMap,kn=new WeakMap,Dn=new WeakMap,Rn=new WeakMap,Bn=new WeakMap,jn=new WeakMap,Un=new WeakMap,Mn=new WeakMap,Ln=new WeakMap,xn=new WeakMap,zn=new WeakMap,Wn=new WeakMap,Jn=new WeakMap,Fn=new WeakMap,Kn=new WeakMap,Gn=new WeakMap,Hn=new WeakMap;class vo{constructor(){$n.set(this,Zt),Zn.set(this,qt),Vn.set(this,"DEFAULT ZOAUTH"),qn.set(this,"DEFAULT ACCESS TOKEN"),Yn.set(this,{timer:{getToken:0}}),Qn.set(this,!1),this.getLoginStatus=()=>o(this,Qn,"f"),this.getAppId=()=>o(this,$n,"f"),this.getDeviceId=()=>n(this,void 0,void 0,(function*(){return Promise.resolve("")})),this.getDeviceIdSync=()=>"",this.login=()=>(r(this,Qn,!0,"f"),Promise.resolve(o(this,Vn,"f"))),this.getAccessToken=()=>Promise.resolve(o(this,qn,"f")),this.getVersion=an.getVersion,this.getSystemInfo=an.getSystemInfo,this.setNavigationBarTitle=()=>Promise.resolve(),this.setNavigationBarColor=()=>Promise.resolve(),this.setBackgroundColor=()=>Promise.resolve(),this.setNavigationBarLeftButton=()=>Promise.resolve(),this.setDeviceOrientation=()=>Promise.resolve(),this.setStorage=e=>n(this,void 0,void 0,(function*(){const t=new no(this.getAppId());return yield t.putDataToStorage(e.data),{errorKeys:[]}})),this.getStorage=e=>n(this,void 0,void 0,(function*(){const t=new no(this.getAppId());return yield t.getDataFromStorage(e.keys)})),this.getStorageInfo=e=>n(this,void 0,void 0,(function*(){const e=new no(this.getAppId());return yield e.getStorageInfo()})),this.removeStorage=e=>n(this,void 0,void 0,(function*(){const t=new no(this.getAppId());return yield t.removeDataFromStorage(e.keys)})),this.clearStorage=e=>n(this,void 0,void 0,(function*(){const e=new no(this.getAppId());return yield e.clearStorage()})),this.getUserInfo=()=>(console.warn("birthday and gender are deprecated"),Promise.resolve({userInfo:{id:"3368637342326461234",name:"User Name",avatar:"https://h5.zdn.vn/static/images/avatar.png"}})),this.getNetworkType=()=>{let t;switch((navigator.connection||navigator.mozConnection||navigator.webkitConnection).effectiveType){case"none":t=e.NetworkType.none;break;case"4g":t=e.NetworkType.wifi;break;case"3g":case"2g":t=e.NetworkType.cellular;break;default:t=e.NetworkType.unknown}const i={networkType:t};return Promise.resolve(i)},this.onNetworkStatusChange=t=>{const i=navigator.connection||navigator.mozConnection||navigator.webkitConnection,n=i.effectiveType;return i.addEventListener("change",(function(){let i;switch(n){case"none":i=e.NetworkType.none;break;case"4g":i=e.NetworkType.wifi;break;case"3g":case"2g":i=e.NetworkType.cellular;break;default:i=e.NetworkType.unknown}t({isConnected:!0,networkType:i})})),Promise.resolve()},this.startBeaconDiscovery=e=>Promise.resolve(!0),this.stopBeaconDiscovery=e=>Promise.resolve(!0),this.getBeacons=e=>Promise.resolve({beacons:[]}),this.closeApp=()=>Promise.resolve(),this.getLocation=()=>Promise.resolve({longitude:"105.788026",latitude:"21.0258773",timestamp:(new Date).getTime().toString(),provider:"fused"}),this.onBackButtonClick=()=>Promise.resolve(),this.stopBluetoothDevicesDiscovery=()=>Promise.resolve(),this.startBluetoothDevicesDiscovery=()=>Promise.resolve(),this.openBluetoothAdapter=()=>Promise.resolve(),this.onBluetoothDeviceFound=()=>Promise.resolve(),this.onBluetoothAdapterStateChange=()=>Promise.resolve(),this.getConnectedBluetoothDevices=()=>Promise.resolve(),this.getBluetoothDevices=()=>Promise.resolve(),this.getBluetoothAdapterState=()=>Promise.resolve(),this.closeBluetoothAdapter=()=>Promise.resolve(),this.scanQRCode=()=>Promise.resolve({content:"132"}),this.openProfile=()=>Promise.resolve(),this.openChat=()=>Promise.resolve(),this.openPostFeed=()=>Promise.resolve({status:1,shareType:0,numberOfUser:0}),this.followOA=()=>Promise.resolve(),this.unFollowOA=()=>Promise.resolve(),this.openShareSheet=()=>Promise.resolve({status:2,shareType:0,numberOfUser:0}),this.requestCameraPermission=()=>Promise.resolve({userAllow:!0,message:"Success"}),this.createShortcut=()=>Promise.resolve(),this.openBioAuthentication=()=>Promise.resolve({code:0,message:"OK",data:{domain:"",code:0,message:"",payToken:""}}),this.checkStateBioAuthentication=()=>Promise.resolve({bioState:""}),this.sendLocation=()=>Promise.resolve(),this.showToast=()=>Promise.resolve(),this.hideKeyboard=()=>Promise.resolve(),this.openPhone=()=>Promise.resolve(),this.openSMS=()=>Promise.resolve(),this.viewOAQr=()=>Promise.resolve(),this.keepScreen=()=>Promise.resolve(),this.saveImageToPhotosAlbum=()=>Promise.resolve(),this.openMiniApp=e=>Promise.resolve(),this.vibrate=()=>Promise.resolve(),this.openWebview=e=>(location.replace(e),Promise.resolve()),this.getRouteParams=ho.getRouteParams,this.getAppInfo=()=>Promise.resolve({description:"",name:"",version:"",appUrl:"",qrCodeUrl:""}),this.sendDataToPreviousMiniApp=e=>Promise.resolve(),this.onCallbackData=e=>(e({data:""}),Promise.resolve()),this.getPhoneNumber=()=>(console.warn("This api only works on zalo app"),Promise.resolve({number:""})),this.openProfilePicker=()=>(console.warn("This api only works on zalo app"),Promise.resolve([])),this.connectWifi=()=>(console.warn("This api only works on zalo app"),Promise.resolve()),this.openOutApp=e=>(location.href=e,Promise.resolve()),this.closeLoading=e=>Promise.resolve(),this.openAppStore=e=>Promise.resolve(),this.getAuthCode=()=>Promise.resolve({authCode:"",authCodeVerify:""}),this.getZPIToken=()=>Promise.resolve({utoken:"",gtoken:"",zpp:""})}getContext(){return n(this,void 0,void 0,(function*(){return Promise.resolve(null)}))}getContextSync(){return null}on(e,t,i){throw new Error("Method not implemented.")}once(e,t,i){throw new Error("Method not implemented.")}off(e,t,i,n){throw new Error("Method not implemented.")}removeAllListeners(e){throw new Error("Method not implemented.")}openMediaPicker(e,t,i,n,o,r){return console.warn("This api only works on zalo app"),Promise.resolve({data:""})}setAccessToken(e){}}$n=new WeakMap,Zn=new WeakMap,Vn=new WeakMap,qn=new WeakMap,Yn=new WeakMap,Qn=new WeakMap;const fo=Symbol("required"),go=Symbol("checkType"),mo=(e,t)=>(i,n,o)=>{let r=Reflect.getOwnMetadata(fo,i,n)||[];r.push({parameterIndex:o,fields:e,option:t}),Reflect.defineMetadata(fo,r,i,n)},_o=(e,t,i)=>(n,o,r)=>{let a=Reflect.getOwnMetadata(go,n,o)||[];a.push({parameterIndex:r,type:e,properties:t,defaultValue:i}),Reflect.defineMetadata(go,a,n,o)};function yo(e,t){Reflect.getMetadataKeys(e).map((i=>{const n=Reflect.getMetadata(i,e);Reflect.defineMetadata(i,n,t)}))}const So=(e,t={})=>i=>{var n;let o=Object.getOwnPropertyDescriptors(i.prototype);if(t.deep){let e=Object.getPrototypeOf(i);for(;e.prototype;){const t=Object.getOwnPropertyDescriptors(e.prototype);o=Object.assign(Object.assign({},t),o),e=Object.getPrototypeOf(e)}}for(const[r,a]of Object.entries(o)){const o="function"==typeof a.value&&"constructor"!=r;if(null===(n=t.exclude)||void 0===n?void 0:n.includes(r))continue;if(t.excludePrefix&&r.startsWith(t.excludePrefix))continue;if(!o)continue;const s=a.value;e(i,r,a),s!=a.value&&yo(s,a.value),Object.defineProperty(i.prototype,r,a)}},Eo=(e,t,i)=>{const n=i.value,o=function(e){return e.toString().match(/\(.*?\)/)[0].replace(/[()]/gi,"").replace(/\s/gi,"").split(",")}(n);return i.value=function(...i){try{const r=Reflect.getOwnMetadata(fo,e.prototype,t),a=Reflect.getOwnMetadata(go,e.prototype,t);a&&a.forEach((e=>{const{parameterIndex:t,type:n,properties:r,defaultValue:a}=e;let s=i[t],c=o[t];const l=typeof s;if(!Jt.isUndefined(s)){if(!Wi(s,n))throw Ii.wrongTypeParam(c,n,Array.isArray(s)?"array":null===s?"null":l);"object"===n&&Object.entries(r).forEach((([e,n])=>{const o=e.split("?")[0],r=Jt.get(s,o);if(Jt.isUndefined(r)||Jt.isNull(r)){if(!e.includes("?"))throw Ii.missingParam(e);Jt.get(s,o.split(".")[0])||!a||Jt.isUndefined(Jt.get(a,o))||Jt.set(i[t],o,Jt.get(a,o))}else if(Jt.isFunction(n)){const e=n(r);if(e&&e.error)throw Ii.wrongTypeParam(`${c}.${o}`,e.errorMessage,typeof r)}}))}})),r&&r.forEach((e=>{const{parameterIndex:t,option:n,fields:o}=e,r=i[t],a=null==n?void 0:n.if,s=null==n?void 0:n.defaultValue;let c=!0;a&&(c=Object.keys(a).every((e=>Jt.get(r,e)===a[e]))),c&&o.forEach((e=>{const n=e=>{let n=!1;return Jt.isEmpty(Jt.get(r,e))&&(Jt.isUndefined(Jt.get(s,e))||Jt.set(i[t],e,Jt.get(s,e)),n=!0),n};if(Array.isArray(e)&&e.length>0&&e.every(n))throw Ii.missingParam(e.join(" or "));if(Jt.isString(e)&&n(e))throw Ii.missingParam(e)}))}));const s=n.call(this,...i);if(Jt.isPromise(s)){const{success:e,fail:n}=Array.isArray(i)&&i.length>0&&i[0];return new Promise(((i,o)=>{s.then((t=>{!Jt.isNull(e)&&Jt.isFunction(e)?e.call(null,t,this):i(s)})).catch((e=>{const i=Ni(e,t);!Jt.isNull(n)&&Jt.isFunction(n)?n.call(null,i,this):o(i)}))}))}return s}catch(e){throw Ni(e,t)}},i};var Oo,Ao,To,Co,bo;e.SDKCreator=class{constructor(){this.events=Qi.getInstance(),Oo.set(this,void 0),r(this,Oo,this.getServiceInstance(),"f"),this.events.addListener=(t,i,n)=>{const o=t;return this.events.addListener(e.Events[o],i,n)}}login(e){return n(this,void 0,void 0,(function*(){return yield o(this,Oo,"f").login(e)}))}getLoginStatus(){return o(this,Oo,"f").getLoginStatus()}getAccessToken(e){return n(this,void 0,void 0,(function*(){return yield o(this,Oo,"f").getAccessToken(e)}))}getVersion(){return o(this,Oo,"f").getVersion()}getSystemInfo(){return o(this,Oo,"f").getSystemInfo()}setNavigationBarTitle(e){return n(this,void 0,void 0,(function*(){return yield o(this,Oo,"f").setNavigationBarTitle(e)}))}setNavigationBarColor(e){return n(this,void 0,void 0,(function*(){return yield o(this,Oo,"f").setNavigationBarColor(e)}))}setBackgroundColor(e){return n(this,void 0,void 0,(function*(){return yield o(this,Oo,"f").setBackgroundColor(e)}))}setNavigationBarLeftButton(e){return n(this,void 0,void 0,(function*(){return yield o(this,Oo,"f").setNavigationBarLeftButton(e.type)}))}setDeviceOrientation(e){return n(this,void 0,void 0,(function*(){return yield o(this,Oo,"f").setDeviceOrientation(e)}))}setStorage(e){return n(this,void 0,void 0,(function*(){return yield o(this,Oo,"f").setStorage(e)}))}getStorage(e){return n(this,void 0,void 0,(function*(){return yield o(this,Oo,"f").getStorage(e)}))}getStorageInfo(e){return n(this,void 0,void 0,(function*(){return yield o(this,Oo,"f").getStorageInfo(e)}))}removeStorage(e){return n(this,void 0,void 0,(function*(){return yield o(this,Oo,"f").removeStorage(e)}))}clearStorage(e){return n(this,void 0,void 0,(function*(){return yield o(this,Oo,"f").clearStorage(e)}))}getUserInfo(e){return n(this,void 0,void 0,(function*(){return yield o(this,Oo,"f").getUserInfo(e)}))}getNetworkType(e){return n(this,void 0,void 0,(function*(){return yield o(this,Oo,"f").getNetworkType(e)}))}onNetworkStatusChange(e){return n(this,void 0,void 0,(function*(){return yield o(this,Oo,"f").onNetworkStatusChange(e)}))}startBeaconDiscovery(e){return n(this,void 0,void 0,(function*(){return yield o(this,Oo,"f").startBeaconDiscovery(e)}))}stopBeaconDiscovery(e){return n(this,void 0,void 0,(function*(){return yield o(this,Oo,"f").stopBeaconDiscovery(e)}))}getBeacons(e){return n(this,void 0,void 0,(function*(){return yield o(this,Oo,"f").getBeacons(e)}))}closeApp(e){return n(this,void 0,void 0,(function*(){return yield o(this,Oo,"f").closeApp(e)}))}getLocation(e){return n(this,void 0,void 0,(function*(){return yield o(this,Oo,"f").getLocation(e)}))}stopBluetoothDevicesDiscovery(){return n(this,void 0,void 0,(function*(){return yield o(this,Oo,"f").stopBluetoothDevicesDiscovery()}))}startBluetoothDevicesDiscovery(e){return n(this,void 0,void 0,(function*(){return yield o(this,Oo,"f").startBluetoothDevicesDiscovery(e)}))}openBluetoothAdapter(){return n(this,void 0,void 0,(function*(){return yield o(this,Oo,"f").openBluetoothAdapter()}))}onBluetoothDeviceFound(){return n(this,void 0,void 0,(function*(){return yield o(this,Oo,"f").onBluetoothDeviceFound()}))}onBluetoothAdapterStateChange(){return n(this,void 0,void 0,(function*(){return yield o(this,Oo,"f").onBluetoothAdapterStateChange()}))}getConnectedBluetoothDevices(e){return n(this,void 0,void 0,(function*(){return yield o(this,Oo,"f").getConnectedBluetoothDevices(e)}))}getBluetoothDevices(){return n(this,void 0,void 0,(function*(){return yield o(this,Oo,"f").getBluetoothDevices()}))}getBluetoothAdapterState(){return n(this,void 0,void 0,(function*(){return yield o(this,Oo,"f").getBluetoothAdapterState()}))}closeBluetoothAdapter(){return n(this,void 0,void 0,(function*(){return yield o(this,Oo,"f").closeBluetoothAdapter()}))}scanQRCode(e){return n(this,void 0,void 0,(function*(){return yield o(this,Oo,"f").scanQRCode(e)}))}openProfile(e){return n(this,void 0,void 0,(function*(){yield o(this,Oo,"f").openProfile(e)}))}openChat(e){return n(this,void 0,void 0,(function*(){yield o(this,Oo,"f").openChat(e)}))}openPostFeed(e){return n(this,void 0,void 0,(function*(){return yield o(this,Oo,"f").openPostFeed(e)}))}followOA(e){return n(this,void 0,void 0,(function*(){return yield o(this,Oo,"f").followOA(e)}))}unfollowOA(e){return n(this,void 0,void 0,(function*(){return yield o(this,Oo,"f").unFollowOA(e)}))}openShareSheet(e){return n(this,void 0,void 0,(function*(){return yield o(this,Oo,"f").openShareSheet(e)}))}requestCameraPermission(e){return n(this,void 0,void 0,(function*(){return yield o(this,Oo,"f").requestCameraPermission(e)}))}createShortcut(e){return n(this,void 0,void 0,(function*(){const t=yield qi(Vt,0),i=Mi().isIOS,n=t.logoUrl||Li("og:image:url")||"",r=t.name||document.title,a=e.params?new URLSearchParams(e.params):new URLSearchParams;if(a.append("utm_source","zalo-shortcut"),a.append("utm_medium","default"),a.append("utm_campaign","default"),i){a.append("appId",Vt),a.append("appName",r),a.append("appIcon",n);const e=`https://mini.zalo.me/shortcut.html?${a.toString()}`;yield o(this,Oo,"f").openOutApp(encodeURI(e))}else yield o(this,Oo,"f").createShortcut(`https://zalo.me/app/link/zapps/${Vt}/?${a.toString()}`,r,n);return wi()}))}openBioAuthentication(e){return n(this,void 0,void 0,(function*(){return yield o(this,Oo,"f").openBioAuthentication(e)}))}checkStateBioAuthentication(e){return n(this,void 0,void 0,(function*(){return yield o(this,Oo,"f").checkStateBioAuthentication(e)}))}sendLocation(e){return n(this,void 0,void 0,(function*(){yield o(this,Oo,"f").sendLocation(e)}))}showToast(e){return n(this,void 0,void 0,(function*(){yield o(this,Oo,"f").showToast(e)}))}hideKeyboard(e){return n(this,void 0,void 0,(function*(){yield o(this,Oo,"f").hideKeyboard(e)}))}openPhone(e){return n(this,void 0,void 0,(function*(){return yield o(this,Oo,"f").openPhone(e)}))}openSMS(e){return n(this,void 0,void 0,(function*(){yield o(this,Oo,"f").openSMS(e)}))}viewOAQr(e){return n(this,void 0,void 0,(function*(){yield o(this,Oo,"f").viewOAQr(e)}))}keepScreen(e){return n(this,void 0,void 0,(function*(){return yield o(this,Oo,"f").keepScreen(e)}))}saveImageToGallery(e){return n(this,void 0,void 0,(function*(){return yield o(this,Oo,"f").saveImageToPhotosAlbum(e)}))}saveImageToPhotosAlbum(e){return n(this,void 0,void 0,(function*(){return yield o(this,Oo,"f").saveImageToPhotosAlbum(e)}))}openMiniApp(e){return n(this,void 0,void 0,(function*(){if(!Jt.isEmpty(e.params)){const t=e.params||{};Object.keys(t).forEach((e=>{"object"==typeof t[e]&&(t[e]=JSON.stringify(t[e])),t[e]=""+encodeURIComponent(t[e])})),e.params=t}yield o(this,Oo,"f").openMiniApp(e)}))}vibrate(e){return n(this,void 0,void 0,(function*(){yield o(this,Oo,"f").vibrate(e)}))}openWebview(e){return n(this,void 0,void 0,(function*(){const t=new URL(e.url),i=t.href.includes("vnpay"),n=t.searchParams.get("typeInapp");!i&&Jt.isEmpty(n)&&t.searchParams.set("typeInapp","1"),yield o(this,Oo,"f").openWebview(t.href)}))}getRouteParams(){return o(this,Oo,"f").getRouteParams()}getAppInfo(e){return o(this,Oo,"f").getAppInfo()}sendDataToPreviousMiniApp(e){return o(this,Oo,"f").sendDataToPreviousMiniApp(e)}onCallbackData(e){return n(this,void 0,void 0,(function*(){return yield o(this,Oo,"f").onCallbackData(e)}))}getPhoneNumber(e){return n(this,void 0,void 0,(function*(){return yield o(this,Oo,"f").getPhoneNumber()}))}openProfilePicker(e){return n(this,void 0,void 0,(function*(){const t=yield o(this,Oo,"f").openProfilePicker(e.maxProfile);let i;if(t.length>0)try{const e=yield this.getAccessToken(),n=yield fetch(ti,{method:"POST",headers:{"Content-Type":"application/json",access_token:e||""},body:JSON.stringify({fields:"id,name,picture",user_ids:t})}),o=yield n.json();if(0!==o.error||!o.data)throw new Error(o.message);i=t.map((e=>{var t,i,n,r,a,s,c,l,d,u,h;return{id:(null===(i=null===(t=o.data[e])||void 0===t?void 0:t.user_info)||void 0===i?void 0:i.user_id_by_app)||"",profile:{name:null===(r=null===(n=o.data[e])||void 0===n?void 0:n.user_info)||void 0===r?void 0:r.name,avatar:null===(l=null===(c=null===(s=null===(a=o.data[e])||void 0===a?void 0:a.user_info)||void 0===s?void 0:s.picture)||void 0===c?void 0:c.data)||void 0===l?void 0:l.url},code:0!==(null===(d=o.data[e])||void 0===d?void 0:d.error)?-1:0,message:`Get profile: ${Jt.isUndefined(null===(u=o.data[e])||void 0===u?void 0:u.message)?"Unknown error":null===(h=o.data[e])||void 0===h?void 0:h.message}`}}))}catch(e){i=t.map((t=>({id:t,profile:{name:"",avatar:""},code:-1,message:`Can't get profile: ${e.message}`})))}return{users:i||[]}}))}connectWifi(e){return n(this,void 0,void 0,(function*(){return yield o(this,Oo,"f").connectWifi(e)}))}openMediaPicker(e){var t,i,r;return n(this,void 0,void 0,(function*(){const n={};Jt.isUndefined(null===(t=e.editView)||void 0===t?void 0:t.enable)||(null===(i=e.editView)||void 0===i?void 0:i.enable)?n.enable=1:n.enable=0,n.aspect_ratio=null===(r=e.editView)||void 0===r?void 0:r.aspectRatio;const a=!0===e.silentRequest?1:0,s=e.maxSelectItem;return yield o(this,Oo,"f").openMediaPicker(e.type,e.serverUploadUrl,e.maxItemSize,n,a,s)}))}getShareableLink(e){return n(this,void 0,void 0,(function*(){const t=yield this.getAccessToken();return(yield Zi(window.APP_ID,t||"",e.title,e.description,e.thumbnail,e.path)).shareableLink}))}closeLoading(e){return n(this,void 0,void 0,(function*(){return yield o(this,Oo,"f").closeLoading("user action")}))}requestUpdateZalo(e){return n(this,void 0,void 0,(function*(){const e=Mi().isIOS?"https://apps.apple.com/vn/app/zalo/id579523206":"https://play.google.com/store/apps/details?id=com.zing.zalo";return yield o(this,Oo,"f").openOutApp(e)}))}onConfirmToExit(t){this.events.on(e.Events.AppClose,t,'{"handle_h5": 1}'),o(this,Oo,"f").setNavigationBarLeftButton(void 0,2)}offConfirmToExit(){this.events.off(e.Events.AppClose),o(this,Oo,"f").setNavigationBarLeftButton(void 0,0)}getDeviceId(){return o(this,Oo,"f").getDeviceIdSync()}getDeviceIdAsync(e){return n(this,void 0,void 0,(function*(){return yield o(this,Oo,"f").getDeviceId()}))}getContext(){return o(this,Oo,"f").getContextSync()}getContextAsync(e){return n(this,void 0,void 0,(function*(){return yield o(this,Oo,"f").getContext()}))}getAuthCode(e){return n(this,void 0,void 0,(function*(){return yield o(this,Oo,"f").getAuthCode()}))}getZPIToken(e){return n(this,void 0,void 0,(function*(){return yield o(this,Oo,"f").getZPIToken()}))}setAccessToken(e){return o(this,Oo,"f").setAccessToken(e)}openOutApp(e){return n(this,void 0,void 0,(function*(){return yield o(this,Oo,"f").openOutApp(encodeURI(e.url))}))}},Oo=new WeakMap,t([i(0,_o("object",{title:Vi("string")}))],e.SDKCreator.prototype,"setNavigationBarTitle",null),t([i(0,_o("object",{color:Vi("string"),"textColor?":Vi("string",{values:["white","black"]}),"statusBarColor?":Vi("string")}))],e.SDKCreator.prototype,"setNavigationBarColor",null),t([i(0,_o("object",{backgroundColor:Vi("string"),"textColor?":Vi("string",{values:["white","black"]})}))],e.SDKCreator.prototype,"setBackgroundColor",null),t([i(0,_o("object",{type:Vi("string",{values:["none","back","home","both"]})}))],e.SDKCreator.prototype,"setNavigationBarLeftButton",null),t([i(0,_o("object",{rotate:Vi("string",{values:["auto","portrait","landscape"]})}))],e.SDKCreator.prototype,"setDeviceOrientation",null),t([i(0,_o("object",{data:Vi("object")}))],e.SDKCreator.prototype,"setStorage",null),t([i(0,_o("object",{keys:Vi("array<string>")}))],e.SDKCreator.prototype,"getStorage",null),t([i(0,_o("object",{keys:Vi("array<string>")}))],e.SDKCreator.prototype,"removeStorage",null),t([i(0,_o("object",{"avatarType?":Vi("string",{values:["small","normal","large"]})}))],e.SDKCreator.prototype,"getUserInfo",null),t([i(0,_o("object",{type:Vi("string",{values:["user","oa","aliasOA"]}),id:Vi("string")}))],e.SDKCreator.prototype,"openProfile",null),t([i(0,_o("object",{type:Vi("string",{values:["user","oa"]}),id:Vi("string"),"message?":Vi("string")}))],e.SDKCreator.prototype,"openChat",null),t([i(0,mo(["data.imageUrl"],{if:{type:"image"}})),i(0,mo(["data.link"],{if:{type:"link"}})),i(0,mo(["data.id"],{if:{type:"profile"}})),i(0,_o("object",{type:Vi("string",{values:["image","link","profile"]}),data:Vi("object"),"data.imageUrl?":Vi("url"),"data.link?":Vi("url"),"data.title?":Vi("string"),"data.thumb?":Vi("url"),"data.description?":Vi("string"),"data.avatar?":Vi("url"),"data.id?":Vi("string"),"data.displayName?":Vi("string")}))],e.SDKCreator.prototype,"openPostFeed",null),t([i(0,_o("object",{id:Vi("string"),"showDialogConfirm?":Vi("boolean")}))],e.SDKCreator.prototype,"followOA",null),t([i(0,_o("object",{id:Vi("string")}))],e.SDKCreator.prototype,"unfollowOA",null),t([i(0,mo([["data.imageUrl","data.imageUrls"]],{if:{type:"image"}})),i(0,mo(["data.link"],{if:{type:"link"}})),i(0,mo(["data.id"],{if:{type:"oa"}})),i(0,mo(["data.gifUrl"],{if:{type:"gif"}})),i(0,mo(["data.videoThumb","data.videoUrl"],{if:{type:"video"}})),i(0,mo(["data.thumbnail","data.title","data.description"],{if:{type:"zmp"},defaultValue:{data:{description:""}}})),i(0,_o("object",{type:Vi("string",{values:["image","gif","video","link","oa","zmp"]}),data:Vi("object"),"data.imageUrl?":Vi("url"),"data.imageUrls?":Vi("array<url>",{maxLength:10}),"data.caption?":Vi("string"),"data.gifUrl?":Vi("url"),"data.width?":Vi("number"),"data.height?":Vi("number"),"data.videoThumb?":Vi("url"),"data.videoUrl?":Vi("url"),"data.link?":Vi("url"),"data.chatOnly?":Vi("boolean"),"data.id?":Vi("string"),"data.thumbnail?":Vi("url"),"data.path?":Vi("string"),"data.title?":Vi("string",{maxLength:100}),"data.description?":Vi(["string"],{maxLength:400})}))],e.SDKCreator.prototype,"openShareSheet",null),t([i(0,_o("object",{secretData:Vi("string"),"ui?":Vi("object"),"ui.title?":Vi("string"),"ui.subTitle?":Vi("string"),"ui.negativeButtonText?":Vi("string"),"requireFingerprint?":Vi("boolean")},{requireFingerprint:!0,ui:{title:"Xác thực",subTitle:"Sử dụng sinh trắc học của bạn để xác thực",negativeButtonText:"Đóng"}}))],e.SDKCreator.prototype,"openBioAuthentication",null),t([i(0,_o("object",{toUserId:Vi("string"),"title?":Vi("string")}))],e.SDKCreator.prototype,"sendLocation",null),t([i(0,_o("object",{message:Vi("string")}))],e.SDKCreator.prototype,"showToast",null),t([i(0,_o("object",{phoneNumber:Vi("string")}))],e.SDKCreator.prototype,"openPhone",null),t([i(0,_o("object",{content:Vi("string"),phoneNumber:Vi("string",{regex:/^\+?\d+$/})}))],e.SDKCreator.prototype,"openSMS",null),t([i(0,_o("object",{id:Vi("string"),"displayName?":Vi("string")},{displayName:""}))],e.SDKCreator.prototype,"viewOAQr",null),t([i(0,_o("object",{"imageBase64Data?":Vi("string"),"imageUrl?":Vi("url")}))],e.SDKCreator.prototype,"saveImageToGallery",null),t([i(0,_o("object",{"imageBase64Data?":Vi("string"),"imageUrl?":Vi("url")}))],e.SDKCreator.prototype,"saveImageToPhotosAlbum",null),t([i(0,_o("object",{appId:Vi("string"),"params?":Vi("object")}))],e.SDKCreator.prototype,"openMiniApp",null),t([i(0,_o("object",{"type?":Vi("string",{values:["oneShot"]}),"milliseconds?":Vi("number")},{type:"oneShot",milliseconds:500}))],e.SDKCreator.prototype,"vibrate",null),t([i(0,_o("object",{url:Vi("url")}))],e.SDKCreator.prototype,"openWebview",null),t([i(0,_o("object",{"maxProfile?":Vi("number",{min:1,max:10})},{maxProfile:1}))],e.SDKCreator.prototype,"openProfilePicker",null),t([i(0,mo(["SSID"])),i(0,_o("object",{SSID:Vi("string"),"password?":Vi("string"),"hiddenSSID?":Vi("boolean")}))],e.SDKCreator.prototype,"connectWifi",null),t([i(0,_o("object",{type:Vi("string",{values:["photo","video","file","zcamera","zcamera_photo","zcamera_video","zcamera_scan"]}),serverUploadUrl:Vi("url"),"maxItemSize?":Vi("number",{min:0}),"editView?":Vi("object"),"editView.enable?":Vi("boolean"),"editView.aspectRatio?":Vi("string",{regex:/^\d+:\d+$/}),"silentRequest?":Vi("boolean"),"maxSelectItem?":Vi("number",{min:1})}))],e.SDKCreator.prototype,"openMediaPicker",null),t([i(0,_o("object",{title:Vi("string",{maxLength:100}),"thumbnail?":Vi("url"),"path?":Vi("string"),description:Vi(["string"],{maxLength:400})},{description:""}))],e.SDKCreator.prototype,"getShareableLink",null),t([i(0,mo(["url"])),i(0,_o("object",{url:Vi("url")}))],e.SDKCreator.prototype,"openOutApp",null),e.SDKCreator=t([So(Eo)],e.SDKCreator);class No extends e.SDKCreator{getServiceInstance(){return po.getInstance()}}class wo extends e.SDKCreator{getServiceInstance(){return new vo}}class Io{constructor(){Ao.set(this,Vt)}static getInstance(){return Io.instance||(Io.instance=new Io),Io.instance}createOrder(e,t){return n(this,void 0,void 0,(function*(){const i=o(this,Ao,"f"),n=new URLSearchParams;n.append("amount",t.amount.toString()),n.append("item",encodeURIComponent(JSON.stringify(t.item))),n.append("appId",i),t.desc&&n.append("desc",encodeURIComponent(t.desc)),t.extradata&&n.append("extradata",encodeURIComponent(JSON.stringify(t.extradata))),t.method&&n.append("method",t.method);const r={headers:{"Content-Type":"application/x-www-form-urlencoded",authorization:"Bearer "}};try{const o=yield e.getAccessToken({fail:e=>{throw Ii.loginRequired}});r.headers.authorization=`Bearer ${o}`;const a=yield fetch(Ti,Object.assign(Object.assign({method:"POST"},r),{body:n})),s=yield a.json();if(!s.data||0!==s.err)throw Ii.badRequest(s.msg);const c=s.data.id,l=s.data.jwt,d=window.APP_VERSION,u=window.APP_ENV,h={miniAppId:i,orderId:c};l&&(h.token=l),d&&(h.version=d),u&&(h.env=u),t.method&&(h.method=t.method);const p=Pi.encode(h),v=new URL(`?${p}`,"https://stgpayment-mini.zalo.me").toString();return yield e.openWebview({url:v,fail:e=>{throw e}}),{orderId:c}}catch(e){throw e}}))}checkTransaction(e,t){return n(this,void 0,void 0,(function*(){try{let i,{data:n}=t;if(n||(n=e.getRouteParams()),"object"==typeof n&&(i=n.appTransID||n.orderId||n.apptransid),"string"==typeof n){const e=Pi.getParameterByName("orderId",n),t=Pi.getParameterByName("appTransID",n)||Pi.getParameterByName("apptransid",n);i=e||t}const r={headers:{authorization:"Bearer "}},a=yield e.getAccessToken({fail:e=>{throw Ii.loginRequired}});r.headers.authorization=`Bearer ${a}`;const s=new URL(Ci),c={transId:i||"",appId:o(this,Ao,"f")};s.search=new URLSearchParams(c).toString();const l=yield fetch(s.toString(),r),d=yield l.json();if(!d.data||0!==d.err)throw Ii.badRequest(d.msg);const u=d.data||{};return{msg:u.resultMessage,orderId:u.orderId,resultCode:u.resultCode,transTime:u.transTime,createdAt:u.createAt,transId:u.transId}}catch(e){throw e}}))}}Ao=new WeakMap;class Po{constructor(){To.set(this,Zt)}static getInstance(){return Po.instance||(Po.instance=new Po),Po.instance}createOrder(e,t){return Promise.resolve({orderId:""})}checkTransaction(e,t){const i={msg:"Success",orderId:"",resultCode:1,transTime:(new Date).getTime().toString(),createdAt:(new Date).getTime().toString(),transId:""};return Promise.resolve(i)}}To=new WeakMap;let ko=class{constructor(e){Co.set(this,void 0),bo.set(this,void 0),r(this,Co,this.getInstance(),"f"),r(this,bo,e,"f")}createOrder(e){return o(this,Co,"f").createOrder(o(this,bo,"f"),e)}checkTransaction(e){return o(this,Co,"f").checkTransaction(o(this,bo,"f"),e)}};Co=new WeakMap,bo=new WeakMap,t([i(0,_o("object",{amount:Vi(["string","number"]),desc:Vi("string"),"method?":Vi("string",{values:["MOMO","ZALOPAY","MOMO_SANDBOX","ZALOPAY_SANDBOX","CC","CC_SANDBOX","ATM","ATM_SANDBOX"]})}))],ko.prototype,"createOrder",null),ko=t([So(Eo)],ko);class Do extends ko{getInstance(){return Io.getInstance()}}class Ro extends ko{getInstance(){return Po.getInstance()}}const Bo=Mi();e.default=void 0,window.onJSCall=e=>function(t){eo.getInstance().onJSCall(e,t)},window.onMultiJSCall=e=>function(t){eo.getInstance().onMultiJSCall(e,t)},window.zaloJSV2={zalo_h5_event_handler:function(e,t,i){eo.getInstance().nativeEventHandler(e,t,i)}},e.Payment=void 0,Bo.isZalo?(e.default=new No,e.Payment=new Do(e.default)):(e.default=new wo,e.Payment=new Ro(e.default)),window.ZaloMiniAppSDK=e.default,e.default=e.default,Object.defineProperty(e,"__esModule",{value:!0})}));
@@ -123,6 +123,7 @@ export declare abstract class SDKCreator {
123
123
  getContext(): contextInfo | null;
124
124
  getContextAsync(object?: InputDataType.CallbackType<contextInfo | null>): Promise<contextInfo | null>;
125
125
  getAuthCode(object?: InputDataType.CallbackType<CallbackDataType.GetAuthCodeSuccessCallback>): Promise<CallbackDataType.GetAuthCodeSuccessCallback>;
126
+ getZPIToken(object?: InputDataType.CallbackType<CallbackDataType.GetZPITokenSuccessCallback>): Promise<CallbackDataType.GetZPITokenSuccessCallback>;
126
127
  setAccessToken(accessToken: string): void;
127
128
  openOutApp(object: InputDataType.OpenOutApp): Promise<void>;
128
129
  }
@@ -12,6 +12,9 @@ export declare const COOKIE_NAME: {
12
12
  DEVICE_ID: string;
13
13
  CONTEXT_ID: string;
14
14
  CONTEXT_TYPE: string;
15
+ UTOKEN_ZPI: string;
16
+ GTOKEN_ZPI: string;
17
+ ZPP_ZPI: string;
15
18
  };
16
19
  export declare const APIS: {
17
20
  GET_USER_INFO: string;
@@ -161,4 +164,4 @@ export declare const PAYMENT_APIS: {
161
164
  GET_TRANSACTION: string;
162
165
  GET_ORDER_STATUS: string;
163
166
  };
164
- export declare const PAYMENT_H5_URL = "https://payment-mini.zalo.me";
167
+ export declare const PAYMENT_H5_URL = "https://stgpayment-mini.zalo.me";
@@ -91,4 +91,5 @@ export default class MockSDKService implements SDKServiceInterface {
91
91
  openAppStore: (data: InputDataType.AppStoreInfo) => Promise<void>;
92
92
  getAuthCode: () => Promise<CallbackDataType.GetAuthCodeSuccessCallback>;
93
93
  setAccessToken(accessToken: string): void;
94
+ getZPIToken: () => Promise<CallbackDataType.GetZPITokenSuccessCallback>;
94
95
  }