zmp-sdk 2.18.6 → 2.19.0-rc.2
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/browser.min.js +218 -4
- package/dist/index.es.js +219 -5
- package/dist/index.js +1 -1
- package/dist/index.umd.js +1 -1
- package/dist/types/src/apis/index.d.ts +2 -0
- package/dist/types/src/apis/payment.d.ts +30 -0
- package/dist/types/src/constants.d.ts +6 -0
- package/dist/types/src/index.d.ts +3 -0
- package/dist/types/src/services/mock-mp-service.d.ts +2 -0
- package/dist/types/src/services/payment.d.ts +27 -0
- package/dist/types/src/types/callbackData.d.ts +20 -0
- package/dist/types/src/types/inputData.d.ts +17 -0
- package/dist/types/src/types/interface.d.ts +5 -0
- package/package.json +1 -1
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{l(n.next(e))}catch(e){r(e)}}function s(e){try{l(n.throw(e))}catch(e){r(e)}}function l(e){var t;e.done?o(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(a,s)}l((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 l=function(e,t){return function(i){return e(t(i))}}(Object.keys,Object),c=Object.prototype.hasOwnProperty;var u=function(e){if(!s(e))return l(e);var t=[];for(var i in Object(e))c.call(e,i)&&"constructor"!=i&&t.push(i);return t},d="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function p(e,t){return e(t={exports:{}},t.exports),t.exports}var h="object"==typeof d&&d&&d.Object===Object&&d,v="object"==typeof self&&self&&self.Object===Object&&self,f=h||v||Function("return this")(),m=f.Symbol,g=Object.prototype,y=g.hasOwnProperty,_=g.toString,E=m?m.toStringTag:void 0;var S=function(e){var t=y.call(e,E),i=e[E];try{e[E]=void 0;var n=!0}catch(e){}var o=_.call(e);return n&&(t?e[E]=i:delete e[E]),o},A=Object.prototype.toString;var T=function(e){return A.call(e)},O=m?m.toStringTag:void 0;var b=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":O&&O in Object(e)?S(e):T(e)};var w=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)};var N,P=function(e){if(!w(e))return!1;var t=b(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t},C=f["__core-js_shared__"],I=(N=/[^.]+$/.exec(C&&C.keys&&C.keys.IE_PROTO||""))?"Symbol(src)_1."+N:"";var k=function(e){return!!I&&I in e},R=Function.prototype.toString;var B=function(e){if(null!=e){try{return R.call(e)}catch(e){}try{return e+""}catch(e){}}return""},D=/^\[object .+?Constructor\]$/,j=Function.prototype,L=Object.prototype,M=j.toString,U=L.hasOwnProperty,W=RegExp("^"+M.call(U).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");var x=function(e){return!(!w(e)||k(e))&&(P(e)?W:D).test(B(e))};var z=function(e,t){return null==e?void 0:e[t]};var F=function(e,t){var i=z(e,t);return x(i)?i:void 0},G=F(f,"DataView"),H=F(f,"Map"),$=F(f,"Promise"),V=F(f,"Set"),Z=F(f,"WeakMap"),J="[object Map]",K="[object Promise]",Q="[object Set]",q="[object WeakMap]",Y="[object DataView]",X=B(G),ee=B(H),te=B($),ie=B(V),ne=B(Z),oe=b;(G&&oe(new G(new ArrayBuffer(1)))!=Y||H&&oe(new H)!=J||$&&oe($.resolve())!=K||V&&oe(new V)!=Q||Z&&oe(new Z)!=q)&&(oe=function(e){var t=b(e),i="[object Object]"==t?e.constructor:void 0,n=i?B(i):"";if(n)switch(n){case X:return Y;case ee:return J;case te:return K;case ie:return Q;case ne:return q}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)},le=Object.prototype,ce=le.hasOwnProperty,ue=le.propertyIsEnumerable,de=se(function(){return arguments}())?se:function(e){return ae(e)&&ce.call(e,"callee")&&!ue.call(e,"callee")},pe=Array.isArray;var he=function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991};var ve=function(e){return null!=e&&he(e.length)&&!P(e)};var fe=function(){return!1},me=p((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})),ge={};ge["[object Float32Array]"]=ge["[object Float64Array]"]=ge["[object Int8Array]"]=ge["[object Int16Array]"]=ge["[object Int32Array]"]=ge["[object Uint8Array]"]=ge["[object Uint8ClampedArray]"]=ge["[object Uint16Array]"]=ge["[object Uint32Array]"]=!0,ge["[object Arguments]"]=ge["[object Array]"]=ge["[object ArrayBuffer]"]=ge["[object Boolean]"]=ge["[object DataView]"]=ge["[object Date]"]=ge["[object Error]"]=ge["[object Function]"]=ge["[object Map]"]=ge["[object Number]"]=ge["[object Object]"]=ge["[object RegExp]"]=ge["[object Set]"]=ge["[object String]"]=ge["[object WeakMap]"]=!1;var ye=function(e){return ae(e)&&he(e.length)&&!!ge[b(e)]};var _e=function(e){return function(t){return e(t)}},Ee=p((function(e,t){var i=t&&!t.nodeType&&t,n=i&&e&&!e.nodeType&&e,o=n&&n.exports===i&&h.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})),Se=Ee&&Ee.isTypedArray,Ae=Se?_e(Se):ye,Te=Object.prototype.hasOwnProperty;var Oe=function(e){if(null==e)return!0;if(ve(e)&&(pe(e)||"string"==typeof e||"function"==typeof e.splice||me(e)||Ae(e)||de(e)))return!e.length;var t=re(e);if("[object Map]"==t||"[object Set]"==t)return!e.size;if(s(e))return!u(e).length;for(var i in e)if(Te.call(e,i))return!1;return!0};var be=function(e){return void 0===e};var we=function(e){return null===e};var Ne=function(e){return"string"==typeof e||!pe(e)&&ae(e)&&"[object String]"==b(e)};var Pe=function(e){return"number"==typeof e||ae(e)&&"[object Number]"==b(e)};var Ce=function(e){return ae(e)&&"[object RegExp]"==b(e)},Ie=Ee&&Ee.isRegExp,ke=Ie?_e(Ie):Ce;var Re=function(e){return"symbol"==typeof e||ae(e)&&"[object Symbol]"==b(e)},Be=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,De=/^\w*$/;var je=function(e,t){if(pe(e))return!1;var i=typeof e;return!("number"!=i&&"symbol"!=i&&"boolean"!=i&&null!=e&&!Re(e))||(De.test(e)||!Be.test(e)||null!=t&&e in Object(t))},Le=F(Object,"create");var Me=function(){this.__data__=Le?Le(null):{},this.size=0};var Ue=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},We=Object.prototype.hasOwnProperty;var xe=function(e){var t=this.__data__;if(Le){var i=t[e];return"__lodash_hash_undefined__"===i?void 0:i}return We.call(t,e)?t[e]:void 0},ze=Object.prototype.hasOwnProperty;var Fe=function(e){var t=this.__data__;return Le?void 0!==t[e]:ze.call(t,e)};var Ge=function(e,t){var i=this.__data__;return this.size+=this.has(e)?0:1,i[e]=Le&&void 0===t?"__lodash_hash_undefined__":t,this};function He(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])}}He.prototype.clear=Me,He.prototype.delete=Ue,He.prototype.get=xe,He.prototype.has=Fe,He.prototype.set=Ge;var $e=He;var Ve=function(){this.__data__=[],this.size=0};var Ze=function(e,t){return e===t||e!=e&&t!=t};var Je=function(e,t){for(var i=e.length;i--;)if(Ze(e[i][0],t))return i;return-1},Ke=Array.prototype.splice;var Qe=function(e){var t=this.__data__,i=Je(t,e);return!(i<0)&&(i==t.length-1?t.pop():Ke.call(t,i,1),--this.size,!0)};var qe=function(e){var t=this.__data__,i=Je(t,e);return i<0?void 0:t[i][1]};var Ye=function(e){return Je(this.__data__,e)>-1};var Xe=function(e,t){var i=this.__data__,n=Je(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=Ve,et.prototype.delete=Qe,et.prototype.get=qe,et.prototype.has=Ye,et.prototype.set=Xe;var tt=et;var it=function(){this.size=0,this.__data__={hash:new $e,map:new(H||tt),string:new $e}};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 lt=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 ct(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])}}ct.prototype.clear=it,ct.prototype.delete=rt,ct.prototype.get=at,ct.prototype.has=st,ct.prototype.set=lt;var ut=ct;function dt(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(dt.Cache||ut),i}dt.Cache=ut;var pt=dt;var ht=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,vt=/\\(\\)?/g,ft=function(e){var t=pt(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(ht,(function(e,i,n,o){t.push(n?o.replace(vt,"$1"):i||e)})),t}));var mt=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},gt=m?m.prototype:void 0,yt=gt?gt.toString:void 0;var _t=function e(t){if("string"==typeof t)return t;if(pe(t))return mt(t,e)+"";if(Re(t))return yt?yt.call(t):"";var i=t+"";return"0"==i&&1/t==-Infinity?"-0":i};var Et=function(e){return null==e?"":_t(e)};var St=function(e,t){return pe(e)?e:je(e,t)?[e]:ft(Et(e))};var At=function(e){if("string"==typeof e||Re(e))return e;var t=e+"";return"0"==t&&1/e==-Infinity?"-0":t};var Tt=function(e,t){for(var i=0,n=(t=St(t,e)).length;null!=e&&i<n;)e=e[At(t[i++])];return i&&i==n?e:void 0};var Ot=function(e,t,i){var n=null==e?void 0:Tt(e,t);return void 0===n?i:n},bt=function(){try{var e=F(Object,"defineProperty");return e({},"",{}),e}catch(e){}}();var wt=function(e,t,i){"__proto__"==t&&bt?bt(e,t,{configurable:!0,enumerable:!0,value:i,writable:!0}):e[t]=i},Nt=Object.prototype.hasOwnProperty;var Pt=function(e,t,i){var n=e[t];Nt.call(e,t)&&Ze(n,i)&&(void 0!==i||t in e)||wt(e,t,i)},Ct=/^(?:0|[1-9]\d*)$/;var It=function(e,t){var i=typeof e;return!!(t=null==t?9007199254740991:t)&&("number"==i||"symbol"!=i&&Ct.test(e))&&e>-1&&e%1==0&&e<t};var kt=function(e,t,i,n){if(!w(e))return e;for(var o=-1,r=(t=St(t,e)).length,a=r-1,s=e;null!=s&&++o<r;){var l=At(t[o]),c=i;if("__proto__"===l||"constructor"===l||"prototype"===l)return e;if(o!=a){var u=s[l];void 0===(c=n?n(u,l,s):void 0)&&(c=w(u)?u:It(t[o+1])?[]:{})}Pt(s,l,c),s=s[l]}return e};var Rt,Bt,Dt,jt,Lt,Mt,Ut,Wt,xt,zt,Ft,Gt={isEmpty:Oe,isNull:we,isUndefined:be,isFunction:P,isObject:w,isString:Ne,isNumber:Pe,isArray:pe,isRegExp:ke,get:Ot,set:function(e,t,i){return null==e?e:kt(e,t,i)}};function Ht(e){return"function"==typeof window.Debug?window.Debug(e):function(...t){"development"===process.env.NODE_ENV&&console.log(e,...t)}}e.NetworkType=void 0,(Rt=e.NetworkType||(e.NetworkType={})).none="none",Rt.wifi="wifi",Rt.cellular="cellular",Rt.unknown="unknown",e.PlatformType=void 0,(Bt=e.PlatformType||(e.PlatformType={})).wp="wp",Bt.android="android",Bt.iOS="iOS",Bt.unknown="unknown",e.ProfileType=void 0,(Dt=e.ProfileType||(e.ProfileType={}))[Dt.user=1]="user",Dt[Dt.oa=0]="oa",Dt[Dt.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,(Lt=e.PostFeedType||(e.PostFeedType={}))[Lt.image=1]="image",Lt[Lt.link=4]="link",Lt[Lt.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",e.OrientationType=void 0,(Ut=e.OrientationType||(e.OrientationType={}))[Ut.auto=1]="auto",Ut[Ut.portrait=2]="portrait",Ut[Ut.landscape=3]="landscape",e.VibrateType=void 0,(Wt=e.VibrateType||(e.VibrateType={}))[Wt.oneShot=0]="oneShot",e.NativeCode=void 0,(xt=e.NativeCode||(e.NativeCode={}))[xt.token_invalid=-2]="token_invalid",xt[xt.not_permission=-1]="not_permission",xt[xt.client_not_support=-5]="client_not_support",xt[xt.decode_failed=-4]="decode_failed",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",e.MediaPickerType=void 0,(Ft=e.MediaPickerType||(e.MediaPickerType={}))[Ft.photo=4]="photo",Ft[Ft.video=5]="video",Ft[Ft.file=6]="file",Ft[Ft.multi_photo=7]="multi_photo",Ft[Ft.multi_video=8]="multi_video";const $t=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},Vt=e=>$t(`${window.location.host}_`+e),Zt=e=>$t((()=>{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),Jt=1048576,Kt=window.zAppID,Qt=window.APP_ID,qt=window.APP_CONFIG||{},Yt="h5.zdn.vn_zoauth",Xt="h5.zdn.vn_zlink3rd",ei="h5.zdn.vn_zoauth_vrf",ti="https://graph.zalo.me/v2.0/me",ii="https://h5.zalo.me/openapi/access_token",ni="https://oauth.zaloapp.com/v3/access_token",oi="https://graph.zalo.me/v2.0/me/friends/list",ri=5*Jt,ai=e=>({NONE:e?-2:0,WIFI:e?0:1,"2G":2,"3G":e?15:2,"4G":e?13:2}),si={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"},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},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}},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}},MP_OPEN_PROFILE_PICKER:{name:"action.mp.open.profile.picker",version_live:{iOS:432}},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:999}},MP_CLOSE_LOADINGVIEW:{name:"action.mp.close.loadingview"}},li=0,ci=-1400,ui=-1500,di=-1401,pi=-1403,hi=-1404,vi={SUCCESS:"Success",READ_MORE:"Read more at: https://miniapp.zalo.me/docs/api",LOGIN_REQUIRED:"Please login before to call this api. Read more at: https://miniapp.zalo.me/docs/api/login",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 your data. Read more at: https://miniapp.zalo.me/docs/api/error"},fi="apps/get-info",mi={android:12100571,iOS:400,wp:0,unknown:0},gi=[si.GET_DOWNLOADED_STICKER.name,si.OPEN_SHARE_STICKER.name,si.OPEN_PROFILE.name,si.OPEN_FEED_DETAIL.name,si.OPEN_FRIEND_RADA.name,si.OPEN_INAPP.name,si.OPEN_OUTAPP.name,si.OPEN_PAGE.name,si.OPEN_PHOTODETAIL.name,si.OPEN_GALARY.name,si.OPEN_GAMECENTER.name,si.OPEN_GAMENEWS.name,si.OPEN_TAB_CONTACT.name,si.OPEN_TAB_SOCIAL.name,si.OPEN_FRIENDSUGGEST.name,si.OPEN_GROUPLIST.name,si.OPEN_NEARBY.name,si.OPEN_ROOM.name,si.OPEN_STICKERSTORE.name,si.OPEN_CREATECHAT.name,si.COPY_LINK_CATESTICKER.name,si.REQUEST_BUY_STICKER.name,si.OPEN_CHAT.name,si.OPEN_TAB_CHAT.name,si.OPEN_CHATGROUP.name,si.OPEN_ADDFRIEND.name,si.OPEN_TAB_MORE.name,si.OPEN_POSTFEED.name,si.OPEN_LOGINDEVICES.name,si.OPEN_SENDSTICKER.name,si.REPORT_ABUSE.name,si.FOLLOW_OA.name,si.UNFOLLOW_OA.name,si.OPEN_GAMEDETAIL.name,si.OPEN_SHARESHEET.name,si.REQUEST_PERMISSION_CAMERA.name,si.CHANGE_TITLE_HEADER.name,si.WEBVIEW_CLEARCACHE.name,si.WEBVIEW_CONFIRMCACHE.name,si.WEBVIEW_ISVISIBLE.name,si.WEBVIEW_NETWORKTYPE.name,si.CHANGE_BUTTON_HEADER.name,si.CREATE_OPTIONS_MENU.name,si.CREATE_SHORTCUT.name,si.CHANGE_ACTIONBAR_LEFTBUTTON_TYPE.name,si.WINDOW_CLOSE.name,si.WEBVIEW_CHECKRESERROR.name,si.IAP_REQUESTPAYMENT.name,si.ZBROWSER_GETSTATS.name,si.ZBROWSER_JSBRIDGE.name,si.PROMPT_AUTHENTICATION.name,si.CHANGE_ACTIONBAR_COLOR.name,si.PROMPT_AUTHENTICATION_CHECK_STATE.name,si.OPEN_APPSTORE.name,si.GET_LOCATION.name,si.QUERY_LOCATION_HIDE.name,si.SHOW_TOAST.name,si.OPEN_APP.name,si.HIDE_KEYBOARD.name,si.OPEN_PHONE.name,si.OPEN_QR.name,si.OPEN_SMS.name,si.VIEW_MYQR.name,si.KEEP_SCREEN.name,si.CHANGE_AUTOROTATE.name,si.CHECK_APP_INSTALLED.name,si.QUERY_SHOW.name,si.QUERY_HIDE.name,si.OPEN_INAPPRW.name,si.ZALORUN_GETTRACKINGSTATUS.name,si.ZALORUN_SETTRACKINGSTATUS.name,si.ZALORUN_GETDAYSTEP.name,si.ZALORUN_FORCESUBMITDATA.name,si.ZALORUN_SETWEIGHT.name,si.OPEN_PROFILE_EXT.name,si.DOWNLOAD_CATE.name,si.JUMP_LOGIN.name,si.OPEN_ADTIMA_ADS_INTERSTITIAL.name,si.OPEN_ADTIMA_ADS.name,si.GET_ADIDCLIENT.name,si.SCAN_IBEACON.name,si.SAVE_IMAGE_GALLERY.name,si.OPEN_MP.name,si.CHANGE_ACTIONBAR.name,si.INTERACTIVE_VIBRATION.name,si.ZBROWSER_MPDS.name],yi=0,_i=3,Ei=1,Si=0;class Ai{constructor(e,t,i){this.code=e,this.message=t,this.api=i}toString(){return`api: ${this.api}; code: ${this.code}; message: ${this.message}`}}class Ti extends Ai{constructor(e,t){super(e,t),this.message=`${t}. ${vi.READ_MORE}`,this.handler()}handler(){switch(this.code){case e.NativeCode.token_invalid:this.code=di,this.message=vi.LOGIN_REQUIRED;break;case e.NativeCode.not_permission:this.code=pi,this.message=vi.NOT_PERMISSION;break;case e.NativeCode.client_not_support:this.code=hi,this.message=vi.CLIENT_NOT_SUPPORT;break;case e.NativeCode.decode_failed:this.message=vi.DECODE_FAILED}}}const Oi={handler:null,setHandler(e){this.handler=e}};Oi.setHandler(((e,t)=>t instanceof Ai?(t.api=e,t):new Ai(-2001,Gt.isNull(t.message)?"Unknown Error":t.message,e)));const bi=(e,t,i)=>{const o=i.value;return i.value=function(...e){return n(this,void 0,void 0,(function*(){const{success:i,fail:r}=Array.isArray(e)&&e.length>0&&e[0];return new Promise(((a,s)=>n(this,void 0,void 0,(function*(){try{const t=yield o.apply(this,e);!Gt.isNull(i)&&Gt.isFunction(i)?i.call(null,t,this):a(t)}catch(e){if("login"!==(null==e?void 0:e.api)&&((null==e?void 0:e.code)===di||(null==e?void 0:e.code)===pi)){let t=!1;this instanceof vo&&(t=this.getLoginStatus()),t||(e=new Ai(di,vi.LOGIN_REQUIRED))}const{handler:i}=Oi,n=i.call(null,t,e,this);window.zmpSentry&&window.zmpSentry.throwError(n.toString()),!Gt.isNull(r)&&Gt.isFunction(r)?r.call(null,n,this):console.error("Error:",n)}}))))}))},i},wi=(e,t,i)=>{const n=i.value;return i.value=function(...e){try{return n.apply(this,e)}catch(e){if("login"!==(null==e?void 0:e.api)&&((null==e?void 0:e.code)===di||(null==e?void 0:e.code)===pi)){let t=!1;this instanceof vo&&(t=this.getLoginStatus()),t||(e=new Ai(di,vi.LOGIN_REQUIRED))}const{handler:i}=Oi;!Gt.isNull(i)&&Gt.isFunction(i)?i.call(null,t,e,this):console.warn(e.message)}},i},Ni=(e,t)=>({code:li,message:t||vi.SUCCESS,data:e||{}}),Pi={badRequest:e=>new Ai(ci,e),loginFailed:()=>new Ai(ci,vi.LOGIN_FAILED),loginRequired:()=>new Ai(di,vi.LOGIN_REQUIRED),missingParam:e=>new Ai(ci,`Missing required argument: ${e}`),wrongTypeParam:(e,t,i)=>new Ai(ci,`Wrong type of parameter '${e}'. Expected ${t}, but got ${i}`),cannotGetShareInfo:()=>new Ai(ui,"Can not get app info to share"),lengthInvalid:e=>new Ai(ci,`${e} length is invalid.`)};const Ci={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:Ci.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("&")}},Ii=new RegExp("[\\u0300-\\u036f]","g"),ki=new RegExp("[đ|Đ]","g"),Ri=new RegExp("\\s","g"),Bi=Ht("zmp:utils:common"),Di=e=>{try{new URL(e)}catch(e){return!1}return!0},ji=()=>navigator.userAgent||navigator.vendor||window.opera,Li=()=>{const e=ji().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)}},Mi=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""},Ui=()=>{const e=ji().toLowerCase().split("zalo")[1];if(e){return e.replace(" ","").split("/")[1]||""}return""},Wi=()=>{let t=Li();return t.isWP?e.PlatformType.wp:t.isAndroid?e.PlatformType.android:t.isIOS?e.PlatformType.iOS:e.PlatformType.unknown},xi=(e,t)=>{const i=t.toLowerCase(),n=i.split(/[<>]/i),o="array"===n[0];return!!("url"===i&&Di(e)||o&&("array"===i&&Array.isArray(e)||((e,t)=>Array.isArray(t)&&!t.some((t=>"url"===e?!Di(t):typeof t!==e)))(n[1],e))||!Array.isArray(e)&&typeof e===t)},zi=e=>(e=>{let t=Vt(e);return t||(t=Zt(e),t)?t:$t(e)})(e),Fi=e=>{if(Gt.isObject(JSON)&&JSON.parse&&Gt.isString(e)){const t=e.replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/\t/g,"\\t");return JSON.parse(t,((e,t)=>t))}return Gt.isObject(e)?e:new Function("return "+e)()},Gi=e=>{if(Gt.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(Gi(e[n]));return"["+t.join(",")+"]"}if("object"==typeof e){for(var o in t=new Array,e)t.push('"'+o+'":'+Gi(e[o]));return"{"+t.join(",")+"}"}return e.toString()},Hi=()=>{try{const e=Number(Ui()),t=Wi();return e>=mi[t]}catch(e){return!0}},$i=e=>JSON.stringify(e).replace(/"/g,'\\"').replace(/'/g,"'"),Vi=e=>{try{if(e){Bi(e);const t=e.replace(/\\/g,"").replace(/'/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 l=`${n.pathname}${n.search}`;a&&(l=`/zapps/${e}${"/"===a[0]?"":"/"}${a}`);const c=new URL(`https://zalo.me/app/link${l}`);s.append("title",i),s.append("description",o||""),s.append("thumbnail",r),s.append("url",c.href),s.append("accessToken",t||"");const u=yield fetch("https://h5.zalo.me/openapi/create-sharelink",Object.assign({method:"POST",body:s},{headers:{"Content-Type":"application/x-www-form-urlencoded"}})),d=yield u.json();if(!d||0!==d.err)throw Pi.cannotGetShareInfo();return c.search=`${c.search}&zshareId=${d.data.shareId}`,Object.assign(Object.assign({},d.data),{shareableLink:c.href})})),Ji=(e,t)=>i=>{if(!(Array.isArray(e)?e.some((e=>xi(i,e))):xi(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(Gt.isNumber(null==t?void 0:t.maxLength))return{error:(Gt.isString(i)||Gt.isArray(i))&&i.length>(null==t?void 0:t.maxLength),errorMessage:`data length must <= ${null==t?void 0:t.maxLength}`};if(Gt.isNumber(null==t?void 0:t.min)&&Gt.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(Gt.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(Gt.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(Gt.isRegExp(null==t?void 0:t.regex))return{error:!t.regex.test(i),errorMessage:"data must valid"}}return{error:!1}},Ki=(e,t,i)=>n(void 0,void 0,void 0,(function*(){const n={appId:e,versionStatus:t};Gt.isUndefined(i)||(n.currentVersion=i);const o=Ci.appendToUrl(`https://h5.zalo.me/${fi}`,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 Qi=p((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),l=i?i+t:t;return e._events[l]?e._events[l].fn?e._events[l]=[e._events[l],s]:e._events[l].push(s):(e._events[l]=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 l,c,u=this._events[s],d=arguments.length;if(u.fn){switch(u.once&&this.removeListener(e,u.fn,void 0,!0),d){case 1:return u.fn.call(u.context),!0;case 2:return u.fn.call(u.context,t),!0;case 3:return u.fn.call(u.context,t,n),!0;case 4:return u.fn.call(u.context,t,n,o),!0;case 5:return u.fn.call(u.context,t,n,o,r),!0;case 6:return u.fn.call(u.context,t,n,o,r,a),!0}for(c=1,l=new Array(d-1);c<d;c++)l[c-1]=arguments[c];u.fn.apply(u.context,l)}else{var p,h=u.length;for(c=0;c<h;c++)switch(u[c].once&&this.removeListener(e,u[c].fn,void 0,!0),d){case 1:u[c].fn.call(u[c].context);break;case 2:u[c].fn.call(u[c].context,t);break;case 3:u[c].fn.call(u[c].context,t,n);break;case 4:u[c].fn.call(u[c].context,t,n,o);break;default:if(!l)for(p=1,l=new Array(d-1);p<d;p++)l[p-1]=arguments[p];u[c].fn.apply(u[c].context,l)}}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 l=0,c=[],u=s.length;l<u;l++)(s[l].fn!==t||o&&!s[l].once||n&&s[l].context!==n)&&c.push(s[l]);c.length?this._events[r]=1===c.length?c[0]:c: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 Qi{constructor(){super(),this.debug=Ht("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 Yi={},Xi=function(e,t,i){var n=t||"default";return function(){var t=n in Yi?Yi[n](e,i):e;return t.apply(this,arguments)}};Xi.setWrapper=function(e){var t=arguments.length<=1||void 0===arguments[1]?"default":arguments[1];Yi[t]=e};var en={error:{code:1,error_subcode:1357046,message:"Received Invalid JSON reply.",type:"http"}};function tn(e){try{return null===e?en:JSON.parse(e)}catch(e){return en}}var nn,on={execute:function(e,t,i,n){i.suppress_http_code=1;var o=Ci.encode(i);"post"!=t&&(e=Ci.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=Xi((function(){r=n,"onload"in o&&o.onload(i)}),"entry","XMLHttpRequest:load"),a=Xi((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(tn(e.responseText))},r.onerror=function(e){e.responseText?n(tn(e.responseText)):n({error:{code:1,error_subcode:1357045,message:"unknown error (empty response)",status:e.status,type:"http"}})},r.send(o),!0)}};class rn extends Qi{constructor(){super(),this.debug=Ht("zmp:ZaloJSBridge"),this.events=qi.getInstance(),this._accessTk=zi("zacc_session")||"DEFAULT_ACCESS_TOKEN",this._jsAccessTk=zi("zlink3rd")||"DEFAULT_JS_TOKEN",this.results=[],this._userAgent=ji(),this._device=Li(),this._jsCallFuncCallbacks={},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)}static getInstance(){return rn.instance||(rn.instance=new rn),rn.instance}set accessTk(e){this._accessTk=e}set jsAccessTk(e){this._jsAccessTk=e}sendLogData(e){try{on.execute("https://h5.zalo.me/log/async","post",{appId:window.APP_ID,data:JSON.stringify(e)},(e=>{}))}catch(e){}}onJSCall(e,t){try{this.debug("onJSCall",e,t);const i=Fi(t);if(this._jsCallFuncCallbacks[e]){const t=this._jsCallFuncCallbacks[e].callback,n=this._jsCallFuncCallbacks[e].timeout;if(t){try{t.call(this,i)}catch(e){console.error("Call callback error",e)}n&&clearTimeout(n),this._jsCallFuncCallbacks[e]=null,delete this._jsCallFuncCallbacks[e]}}this.results.push({action:i.action,error:i.error_code})}catch(e){console.log("onJSCall","error",e)}}onMultiJSCall(e,t){try{this.debug("onMultiJSCall",e,t);const i=Fi(t);if(this._jsCallFuncCallbacks[e]){const t=this._jsCallFuncCallbacks[e].callback,n=this._jsCallFuncCallbacks[e].timeout;if(t){try{t.call(this,i)}catch(e){console.error("Call callback error",e)}n&&clearTimeout(n)}}this.results.push({action:i.action,error:i.error_code})}catch(e){console.log("onMultiJSCall","error",e)}}nativeEventHandler(e,t,i){this.debug(`eventId: ${e}, eventName: ${t}, eventData: ${i}`);const n=Vi(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/${Qt}`)[1];return{path:`${o||"/"}${n.search}`};default:return i}}catch(e){return i}}defaultCallback(e){null!=e&&(e=Fi(e))}jsCall(e,t,i,n=!1,o=3,r=!0){try{const a=e.name,s=((e="")=>`${e.normalize("NFD").replace(Ii,"").replace(ki,"d").replace(Ri,"").toLowerCase()}_${Math.random().toString(36).substr(2,4)}`)(a);if(!this._device.isMobile||Gt.isEmpty(a))return this.onJSCall(s,{error_code:-13,error_message:"params invalid!",data:{device:this._device.isMobile,jsToken:this._jsAccessTk,access_token:this._accessTk},action:a}),!1;null==t&&(t={}),i||(i=this.defaultCallback);const l={error_code:-14,error_message:"Request Timeout!",data:{},action:a};this._jsCallFuncCallbacks[s]={timeout:r&&e.have_callback&&setTimeout((()=>{this.onJSCall(s,l)}),8e3),callback:i};try{return t=Gi(t),n?this._device.isIOS?ZaloJavaScriptInterface.jsCall(this._jsAccessTk,a,this._accessTk,t,window.onMultiJSCall(s)):ZaloJavaScriptInterface.jsCall(this._jsAccessTk,a,this._accessTk,t,`window.onMultiJSCall('${s}')`):this._device.isIOS?ZaloJavaScriptInterface.jsCall(this._jsAccessTk,a,this._accessTk,t,window.onJSCall(s)):ZaloJavaScriptInterface.jsCall(this._jsAccessTk,a,this._accessTk,t,`window.onJSCall('${s}')`)}catch(r){if(!(o-- >0)){const e={error_code:-5,error_message:"Not ready!",data:{userAgent:this._userAgent,options:t,jsToken:this._jsAccessTk,access_token:this._accessTk},action:a,js_error:r};return this.onJSCall(s,e),!1}setTimeout((()=>{this.jsCall(e,t,i,n,o)}),500)}}catch(e){console.log("jsCall","error",e)}return!1}}class an{constructor(){this.debug=Ht("zmp:ZJSBridgeProvider"),nn.set(this,void 0),r(this,nn,rn.getInstance(),"f")}setZAccSession(e){o(this,nn,"f").accessTk=e}setJSToken(e){o(this,nn,"f").jsAccessTk=e}callNative(e,t,i){return this.debug(e.name,t),new Promise(((r,a)=>{const s=o=>n(this,void 0,void 0,(function*(){try{const n=new Ti(o.error_code,`${o.action}: ${o.error_message}`);if(null==i?void 0:i.callback){const e=yield i.callback(o,n);return r(e)}if(o&&o.error_code>=0)r(o.data||{});else if(o&&o.error_code<0){try{window.zmpSentry&&window.zmpSentry.captureMessage(`${e.name}: call native fail`,{extra:{data:t,rs:o}})}catch(e){}return a(n)}}catch(e){return a(e)}})),l=Li().isIOS,c=(e=>{var t;const i=Ui(),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(l&&!c){const t=new Ti(-5,`${e}: Client isn't support this action`);return a(t)}(null==i?void 0:i.delay)?setTimeout((()=>{o(this,nn,"f").jsCall(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,nn,"f").jsCall(e,t,s,null==i?void 0:i.isMultiCallback,null==i?void 0:i.nRetry,null==i?void 0:i.haveTimeout)}))}}nn=new WeakMap;var sn,ln,cn,un,dn,pn="2.18.6";class hn{static getVersion(){return pn}static getSystemInfo(){return{version:Mi("version-id")||"",apiVersion:pn,zaloVersion:Ui(),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 Ki(e,0,t.version)}))}}class vn{static setNavigationBarTitle(e){return n(this,void 0,void 0,(function*(){yield this.callNative(si.CHANGE_TITLE_HEADER,{title:e.title},{haveTimeout:!1})}))}static setNavigationBarColor(e){return n(this,void 0,void 0,(function*(){const t={};let i;Gt.isEmpty(e.textColor)||(t.textColor=e.textColor),Gt.isString(e.color)&&e.color.length>0?(Gt.isEmpty(e.color)||(t.backgroundColor=e.color),i=5):(Gt.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.callNative(si.CHANGE_ACTIONBAR,Object.assign({},this.getActionBarConfig()),{haveTimeout:!1})}))}static setNavigationBarLeftButton(e){return n(this,void 0,void 0,(function*(){const t="none"===e.type||"home"===e.type?_i:yi,i="home"===e.type||"both"===e.type?Ei:Si;this.setActionBarConfig((e=>Object.assign(Object.assign({},e),{buttonType:t,dataConfig:Object.assign(Object.assign({},e.dataConfig),{viewInLeftType:t}),homeConfig:Object.assign(Object.assign({},e.homeConfig),{enable:i})}))),yield this.callNative(si.CHANGE_ACTIONBAR_LEFTBUTTON_TYPE,Object.assign({},this.getActionBarConfig()),{haveTimeout:!1})}))}static setNavigationBarRightButton(e){return n(this,void 0,void 0,(function*(){yield this.callNative(si.CREATE_OPTIONS_MENU,{supportToolBar:e.supportToolBar,reset:e.reset,menuListItems:e.menuListItems,zapp:this.getAppId()})}))}}class fn{static setBackgroundColor(e){return n(this,void 0,void 0,(function*(){Gt.isString(e.backgroundColor)&&e.backgroundColor.length>0&&(yield this.callNative(si.CHANGE_ACTIONBAR,{actionbarType:this.isShowNavBar?5:6,dataConfig:{backgroundColor:e.backgroundColor,textColor:e.textColor}}))}))}}class mn{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(" ")}}sn=new WeakMap,ln=new WeakMap,cn=new WeakMap,un=new WeakMap,dn=new WeakMap;const gn=new class{constructor(){sn.set(this,3),ln.set(this,["none","error","warn","info"]),cn.set(this,"[zmp] > "),un.set(this,{error:0,warn:0,info:0,firstError:null,lastError:null}),dn.set(this,((e,t,i)=>{o(this,un,"f")[o(this,ln,"f")[e]]++;const n=o(this,ln,"f")[e];if(r(this,cn,o(this,cn,"f")+("string"!=typeof t?new mn(t,n,e,i).toString():t),"f"),!(e>o(this,sn,"f")))switch(e){case 1:console.error(o(this,cn,"f"));break;case 2:console.warn(o(this,cn,"f"));break;case 3:console.info(o(this,cn,"f"));break;default:throw new Error("internal")}}))}setLogLevel(e){r(this,sn,e,"f")}info(e){o(this,dn,"f").call(this,3,e)}warn(e,t){o(this,dn,"f").call(this,2,e,t)}error(e,t){o(this,dn,"f").call(this,1,e,t)}getMetrics(){return o(this,un,"f")}};class yn{static setDeviceOrientation(t){return n(this,void 0,void 0,(function*(){yield this.callNative(si.CHANGE_AUTOROTATE,{autoRotate:e.OrientationType[t.rotate]})}))}static getNetworkType(t){return n(this,void 0,void 0,(function*(){return yield this.callNative(si.WEBVIEW_NETWORKTYPE,{url:window.location.href,featureId:""}).then((t=>{const i=t.network;let n;const o=Li().isAndroid;switch(i){case ai(o).NONE:n=e.NetworkType.none;break;case ai(o).WIFI:n=e.NetworkType.wifi;break;case ai(o)["2G"]:case ai(o)["3G"]:case ai(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=>{gn.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:Gt.isNumber(null==e?void 0:e.scanningType)?e.scanningType:0,data:{scan_from_source:Gt.isString(null==e?void 0:e.scanFromSource)?e.scanFromSource:"",expire:Gt.isNumber(null==e?void 0:e.expire)?e.expire:3e3,monitor_interval:Gt.isNumber(null==e?void 0:e.monitorInterval)?e.monitorInterval:60,domain:Gt.isString(null==e?void 0:e.domain)?e.domain:"",scan_config:{scan_time:Gt.isNumber(null===(t=null==e?void 0:e.scanConfig)||void 0===t?void 0:t.scanTime)?e.scanConfig.scanTime:15e3,time_between_scan:Gt.isNumber(null===(i=null==e?void 0:e.scanConfig)||void 0===i?void 0:i.timeBetweenScan)?e.scanConfig.timeBetweenScan:1e4,beacon_timeout:Gt.isNumber(null===(o=null==e?void 0:e.scanConfig)||void 0===o?void 0:o.beaconTimeout)?e.scanConfig.beaconTimeout:3e4,delayCheckConnectedTimeout:Gt.isNumber(null===(r=null==e?void 0:e.scanConfig)||void 0===r?void 0:r.delayCheckConnectedTimeout)?e.scanConfig.delayCheckConnectedTimeout:5e3,beaconConnectedTimeout:Gt.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.callNative(si.SCAN_IBEACON,Object.assign({},n)),!0}))}static stopBeaconDiscovery(e){return n(this,void 0,void 0,(function*(){return yield this.callNative(si.SCAN_IBEACON,Object.assign({},{subaction:2})),!0}))}static getBeacons(e){return n(this,void 0,void 0,(function*(){return yield this.callNative(si.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.callNative({name:""},{})}))}static startBluetoothDevicesDiscovery(e){return n(this,void 0,void 0,(function*(){return this.callNative({name:""},Object.assign({},e))}))}static openBluetoothAdapter(){return n(this,void 0,void 0,(function*(){return this.callNative({name:""},{})}))}static onBluetoothDeviceFound(){return n(this,void 0,void 0,(function*(){return this.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.callNative({name:""},t)}))}static getBluetoothDevices(){return n(this,void 0,void 0,(function*(){return this.callNative({name:""},{})}))}static getBluetoothAdapterState(){return n(this,void 0,void 0,(function*(){return this.callNative({name:""},{})}))}static closeBluetoothAdapter(){return n(this,void 0,void 0,(function*(){return this.callNative({name:""},{})}))}static scanQRCode(e){return n(this,void 0,void 0,(function*(){return yield this.callNative(si.OPEN_QR,{skipOpenLink:!0})}))}static showToast(e){return n(this,void 0,void 0,(function*(){yield this.callNative(si.SHOW_TOAST,{toast:e.message})}))}static hideKeyboard(e){return n(this,void 0,void 0,(function*(){yield this.callNative(si.HIDE_KEYBOARD,{})}))}static openPhone(e){return n(this,void 0,void 0,(function*(){yield this.callNative(si.OPEN_PHONE,{phoneNum:e.phoneNumber,phoneCode:e.phoneNumber})}))}static openSMS(e){return n(this,void 0,void 0,(function*(){yield this.callNative(si.OPEN_SMS,{content:e.content,phoneCode:e.phoneNumber})}))}static keepScreen(e){return n(this,void 0,void 0,(function*(){return yield this.callNative(si.KEEP_SCREEN,{data:{keep_screen_on:e.keepScreenOn?1:0}})}))}static openBioAuthentication(e){return n(this,void 0,void 0,(function*(){return yield this.callNative(si.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.callNative(si.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.callNative(si.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 Gt.isString(e.password)&&e.password.length>0&&(t="wpa_wpa2"),yield this.callNative(si.MP_JOIN_WIFI,{ssid:e.SSID,securityType:t,password:e.password,hiddenSsid:e.hiddenSSID})}))}}var _n,En,Sn,An,Tn,On,bn,wn,Nn,Pn,Cn,In,kn,Rn,Bn,Dn,jn,Ln,Mn,Un,Wn,xn,zn,Fn,Gn,Hn,$n,Vn;class Zn{constructor(e){_n.set(this,localStorage),En.set(this,void 0),Sn.set(this,void 0),Li(),r(this,Sn,{keys:new Set,currentSize:0,limitSize:ri},"f"),r(this,En,e,"f"),this.findAllCurrentDataByApp(e)}findAllCurrentDataByApp(e){try{let t;for(t in o(this,_n,"f")){if(e){if(t.split("_")[0]!==e)continue}o(this,Sn,"f").keys.add(t)}}catch(e){gn.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,En,"f")&&(e=`${o(this,En,"f")}_${e}`),o(this,Sn,"f").keys.has(e)?o(this,_n,"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,En,"f")&&(e=`${o(this,En,"f")}_${e}`),o(this,_n,"f").setItem(e,t),o(this,Sn,"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,_n,"f"),o(this,En,"f"));return{currentSize:Gt.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,En,"f")&&(e=`${o(this,En,"f")}_${e}`),o(this,Sn,"f").keys.has(e)&&(o(this,_n,"f").removeItem(e),o(this,Sn,"f").keys.delete(e))}clear(){return n(this,void 0,void 0,(function*(){return Promise.resolve(this.clearSync())}))}clearSync(){o(this,Sn,"f").keys.forEach((e=>{o(this,En,"f")&&e.indexOf(o(this,En,"f"))<0||(o(this,_n,"f").removeItem(e),o(this,Sn,"f").keys.delete(e))}))}}_n=new WeakMap,En=new WeakMap,Sn=new WeakMap;class Jn extends an{constructor(e){super(),An.set(this,void 0),Tn.set(this,void 0),r(this,Tn,{keys:new Set,currentSize:0,limitSize:ri},"f"),r(this,An,e,"f")}get(e){return n(this,void 0,void 0,(function*(){return yield this.callNative(si.ZBROWSER_MPDS,{mpds_action:"mpds.get",mpds_data:{keys:e},appId:o(this,An,"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 this.callNative(si.ZBROWSER_MPDS,{mpds_action:"mpds.set",mpds_data:{map:e},appId:o(this,An,"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 this.callNative(si.ZBROWSER_MPDS,{mpds_action:"mpds.get.size",mpds_data:{},appId:o(this,An,"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:Gt.isNumber(e)?Number(e/1024):0,limitSize:Number(5120)}}))}remove(e){return n(this,void 0,void 0,(function*(){return{errorKeys:yield this.callNative(si.ZBROWSER_MPDS,{mpds_action:"mpds.remove.key",mpds_data:{keys:e},appId:o(this,An,"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 this.callNative(si.ZBROWSER_MPDS,{mpds_action:"mpds.clear.appData",mpds_data:{},appId:o(this,An,"f")})}))}}An=new WeakMap,Tn=new WeakMap;class Kn{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]=Vi(e)})),n}))}putDataToStorage(e){return n(this,void 0,void 0,(function*(){const t=this.getInstance(),i={};return Object.entries(e).forEach((([e,t])=>{Gt.isUndefined(t)||Gt.isNull(t)||(i[e]=$i(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 Qn extends Kn{constructor(e){super(),On.set(this,void 0),r(this,On,e,"f")}getInstance(){return new Zn(o(this,On,"f"))}}On=new WeakMap;class qn extends Kn{constructor(e){super(),bn.set(this,void 0),r(this,bn,e,"f")}getInstance(){return new Jn(o(this,bn,"f"))}}bn=new WeakMap;class Yn{static setStorage(e){return n(this,void 0,void 0,(function*(){let t=new Qn(this.getAppId());return Hi()&&(t=new qn(this.getAppId())),yield t.putDataToStorage(e.data)}))}static getStorage(e){return n(this,void 0,void 0,(function*(){let t=new Qn(this.getAppId());Hi()&&(t=new qn(this.getAppId()));return yield t.getDataFromStorage(e.keys)}))}static getStorageInfo(e){return n(this,void 0,void 0,(function*(){let e=new Qn(this.getAppId());return Hi()&&(e=new qn(this.getAppId())),yield e.getStorageInfo()}))}static removeStorage(e){return n(this,void 0,void 0,(function*(){let t=new Qn(this.getAppId());return Hi()&&(t=new qn(this.getAppId())),yield t.removeDataFromStorage(e.keys)}))}static clearStorage(e={}){return n(this,void 0,void 0,(function*(){let e=new Qn(this.getAppId());Hi()&&(e=new qn(this.getAppId())),yield e.clearStorage()}))}}class Xn{static getUserInfo(e){return n(this,void 0,void 0,(function*(){const t=yield this.getAccessToken();let i="id,name,picture";(null==e?void 0:e.avatarType)&&(i=`${i}.type(${null==e?void 0:e.avatarType})`);return{userInfo:yield fetch(`${ti}?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,birthday:"",gender:"",avatar:t.picture&&t.picture.data&&t.picture.data.url};return console.warn("'birthday' and 'gender' are deprecated"),i}))))}}))}static getPhoneNumber(e){return n(this,void 0,void 0,(function*(){return yield this.callNative(si.MP_GET_NUMBER,{},{isMultiCallback:!0,callback:(e,t)=>{if(0===e.error_code){const t={number:e.data};return Promise.resolve(t)}return Promise.reject(t)},delay:this.isIOS?400:0})}))}}class eo{static closeApp(e){return n(this,void 0,void 0,(function*(){yield this.callNative(si.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("&"),o=yield Ki(t,0);yield this.callNative(si.OPEN_MP,{mpUrl:`https://h5.zdn.vn/zapps/${t}/${n.length>0?"?"+n:""}`,mpInfo:{appId:t,appAvtUrl:o.logoUrl||"",appName:o.name||""}})}))}static openWebview(e){return n(this,void 0,void 0,(function*(){yield this.callNative(si.OPEN_INAPP,{url:e.url})}))}static closeLoading(e){return n(this,void 0,void 0,(function*(){yield this.callNative(si.MP_CLOSE_LOADINGVIEW,{at:(new Date).getTime(),when:e,url:location.href})}))}}class to{static getLocation(e){return n(this,void 0,void 0,(function*(){return yield this.callNative(si.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,callback:(e,t)=>{if(0===e.error_code){const t=e.data,i={latitude:t.latitude,longitude:t.longitude,timestamp:t.timestamp,provider:t.provider};return Promise.resolve(i)}return Promise.reject(t)},delay:this.isIOS?400:0})}))}static sendLocation(e){return n(this,void 0,void 0,(function*(){yield this.callNative(si.QUERY_LOCATION_HIDE,{title:e.title,touserid:e.toUserId,zapp:this.getZAppId()})}))}}class io{static requestCameraPermission(e){return n(this,void 0,void 0,(function*(){return yield this.callNative(si.REQUEST_PERMISSION_CAMERA,{},{callback:(e,t)=>-2===e.error_code||e.error_code>=0?Promise.resolve({userAllow:-2!==e.error_code,message:e.error_message}):Promise.reject(t)})}))}static saveImageToPhotosAlbum(e){return n(this,void 0,void 0,(function*(){let t={};return Gt.isEmpty(e.imageBase64Data)?Gt.isEmpty(e.imageUrl)||(t={imageUrl:e.imageUrl}):t={imageBase64Data:e.imageBase64Data},yield this.callNative(si.SAVE_IMAGE_GALLERY,Object.assign({},t))}))}}class no{static viewOAQr(e){return n(this,void 0,void 0,(function*(){yield this.callNative(si.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.callNative(si.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.callNative(si.OPEN_CHAT,{uId:t.id,type:e.ChatType[t.type],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.callNative(si.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.callNative(si.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.callNative(si.UNFOLLOW_OA,{uid:e.id,zapp:this.getZAppId()},{haveTimeout:!1})}))}static openShareSheet(t){return n(this,void 0,void 0,(function*(){let i={};switch(t.type){case"image":let e=[];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 n=yield this.getAccessToken(),o=yield Zi(this.getAppId(),n||"",t.data.title||"",t.data.description||"",t.data.thumbnail||"",t.data.path);window.forceShareZMP?i={data:{ZInstantAPIInfo:{url:`${o.zinstantApi}`,zinstantdata_id:`templateId=11412&appId=${this.getAppId()}&shareId=${o.shareId}`},previewMsgText:{msg:{en:"Mini App",vi:"Chương trình nhỏ"}},enableReactions:1}}:(i={link:o.shareableLink,chatOnly:t.data.chatOnly?1:0},t.type="link")}return yield this.callNative(si.OPEN_SHARESHEET,Object.assign(Object.assign({type:e.ShareSheetType[t.type]},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.callNative(si.CREATE_SHORTCUT,{url:e,title:t,iconUrl:i})}))}static openProfilePicker(e){return n(this,void 0,void 0,(function*(){return yield this.callNative(si.MP_OPEN_PROFILE_PICKER,{maxProfile:e},{isMultiCallback:!0,callback:(e,t)=>0===e.error_code&&Array.isArray(e.data)?Promise.resolve(e.data.map((e=>e.id))):Promise.reject(t)})}))}static getActionsSupported(t){return n(this,void 0,void 0,(function*(){return yield this.callNative(si.GET_SUPPORTED_ACTIONS,{},{isMultiCallback:!1,callback:(t,i)=>{const n=Wi();if(Array.isArray(t.actions)&&t.actions.length>0){const e=Object.keys(si).filter((e=>si[e].skip_jump)),i={actions:[...t.actions,...e]};return Promise.resolve(i)}if(n===e.PlatformType.iOS){const e={actions:gi};return Promise.resolve(e)}return Promise.reject(i)}})}))}static openMediaPicker(t,i,o,r){return n(this,void 0,void 0,(function*(){const n={type:0,url:"https://zapi-server.tungnt.xyz/upload/photos",maxSize:1048576};return yield this.callNative(si.PICK_MEDIA,{media_type:e.MediaPickerType[t],edit_view:Object.assign(Object.assign({},{enable:1,aspect_ratio:"1:1"}),i),silent_request:o,upload:n,max_select_item:r},{isMultiCallback:!0,callback:(e,t)=>{var i,n;if(0===e.error_code){const t=Vi(null===(i=e.data)||void 0===i?void 0:i.result_content),o={urls:null===(n=null==t?void 0:t.data)||void 0===n?void 0:n.urls};return Promise.resolve(o)}return Promise.reject(t)}})}))}static openOutApp(e){return n(this,void 0,void 0,(function*(){return yield this.callNative(si.OPEN_OUTAPP,{url:e})}))}}class oo{static getRouteParams(){let e={};const t=window.location.href;try{let i=new URL(t).searchParams.toString();i&&(e=Ci.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.callNative(si.WEBVIEW_SET_RESULT,{result:$i(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 ro extends an{constructor(){var e,t,i,n,a,s,l,c,u,d,p,h,v,f,m,g,y;super(),wn.set(this,Kt),Nn.set(this,Qt),Pn.set(this,qt),Cn.set(this,void 0),In.set(this,void 0),kn.set(this,void 0),Rn.set(this,null),Bn.set(this,{timer:{getToken:0}}),Dn.set(this,void 0),jn.set(this,void 0),Ln.set(this,null),this.events=qi.getInstance(),this.isIOS=Li().isIOS,Mn.set(this,void 0),this.getActionBarConfig=()=>o(this,Mn,"f"),this.setActionBarConfig=e=>{r(this,Mn,e(o(this,Mn,"f")),"f")},Un.set(this,(()=>new Promise(((e,t)=>{Gt.isUndefined(o(this,Ln,"f"))||Gt.isNull(o(this,Ln,"f"))?this.callNative(si.JUMP_LOGIN,{}).then((t=>{const i=t&&t.cookiesOAuthLogins||[],n=i.find((e=>e.name===Xt));n&&(this.setJSToken(n.value),window.ZJSBridge.setJSToken&&window.ZJSBridge.setJSToken(n.value)),r(this,Ln,i,"f"),e(i)})).catch((e=>{t(e)})):e(o(this,Ln,"f"))})))),Wn.set(this,vn.setNavigationBarRightButton),this.getVersion=hn.getVersion,this.getSystemInfo=hn.getSystemInfo,this.setNavigationBarTitle=vn.setNavigationBarTitle,this.setNavigationBarColor=vn.setNavigationBarColor,this.setNavigationBarLeftButton=vn.setNavigationBarLeftButton,this.setBackgroundColor=fn.setBackgroundColor,this.setDeviceOrientation=yn.setDeviceOrientation,this.setStorage=Yn.setStorage,this.getStorage=Yn.getStorage,this.getStorageInfo=Yn.getStorageInfo,this.removeStorage=Yn.removeStorage,this.clearStorage=Yn.clearStorage,this.getUserInfo=Xn.getUserInfo,this.getNetworkType=yn.getNetworkType,this.onNetworkStatusChange=yn.onNetworkStatusChange,this.startBeaconDiscovery=yn.startBeaconDiscovery,this.stopBeaconDiscovery=yn.stopBeaconDiscovery,this.getBeacons=yn.getBeacons,this.closeApp=eo.closeApp,this.getLocation=to.getLocation,this.stopBluetoothDevicesDiscovery=yn.stopBluetoothDevicesDiscovery,this.startBluetoothDevicesDiscovery=yn.stopBluetoothDevicesDiscovery,this.openBluetoothAdapter=yn.openBluetoothAdapter,this.onBluetoothDeviceFound=yn.onBluetoothDeviceFound,this.onBluetoothAdapterStateChange=yn.onBluetoothAdapterStateChange,this.getConnectedBluetoothDevices=yn.getConnectedBluetoothDevices,this.getBluetoothDevices=yn.getBluetoothDevices,this.getBluetoothAdapterState=yn.getBluetoothAdapterState,this.closeBluetoothAdapter=yn.closeBluetoothAdapter,this.scanQRCode=yn.scanQRCode,this.openProfile=no.openProfile,this.openChat=no.openChat,this.openPostFeed=no.openPostFeed,this.followOA=no.followOA,this.unFollowOA=no.unfollowOA,this.openShareSheet=no.openShareSheet,this.requestCameraPermission=io.requestCameraPermission,this.createShortcut=no.createShortcut,this.openBioAuthentication=yn.openBioAuthentication,this.checkStateBioAuthentication=yn.checkStateBioAuthentication,this.sendLocation=to.sendLocation,this.showToast=yn.showToast,this.hideKeyboard=yn.hideKeyboard,this.openPhone=yn.openPhone,this.openSMS=yn.openSMS,this.viewOAQr=no.viewOAQr,this.keepScreen=yn.keepScreen,this.saveImageToPhotosAlbum=io.saveImageToPhotosAlbum,this.openMiniApp=eo.openMiniApp,this.vibrate=yn.vibrate,this.openWebview=eo.openWebview,this.getRouteParams=oo.getRouteParams,this.getAppInfo=hn.getAppInfo,this.sendDataToPreviousMiniApp=oo.sendDataToPreviousMiniApp,this.onCallbackData=oo.onCallbackData,this.getPhoneNumber=Xn.getPhoneNumber,this.openProfilePicker=no.openProfilePicker,xn.set(this,no.getActionsSupported),this.connectWifi=yn.connectWifi,this.openMediaPicker=no.openMediaPicker,this.openOutApp=no.openOutApp,this.closeLoading=eo.closeLoading,r(this,Cn,null,"f"),r(this,In,null,"f"),r(this,kn,null,"f"),this.isShowNavBar=!0,r(this,Dn,0,"f"),r(this,jn,0,"f");const _="home"===(null===(t=null===(e=o(this,Pn,"f"))||void 0===e?void 0:e.app)||void 0===t?void 0:t.leftButton)||"both"===(null===(n=null===(i=o(this,Pn,"f"))||void 0===i?void 0:i.app)||void 0===n?void 0:n.leftButton)?Ei:Si,E=new URL(location.href),S=Gt.isString(null===(s=null===(a=o(this,Pn,"f"))||void 0===a?void 0:a.app)||void 0===s?void 0:s.headerColor)&&(null===(u=null===(c=null===(l=o(this,Pn,"f"))||void 0===l?void 0:l.app)||void 0===c?void 0:c.headerColor)||void 0===u?void 0:u.length)>0?5:6,A="none"===(null===(p=null===(d=o(this,Pn,"f"))||void 0===d?void 0:d.app)||void 0===p?void 0:p.leftButton)||"home"===(null===(v=null===(h=o(this,Pn,"f"))||void 0===h?void 0:h.app)||void 0===v?void 0:v.leftButton)?_i:yi;r(this,Mn,{actionbarType:S,buttonType:A,dataConfig:{backgroundColor:(null===(m=null===(f=o(this,Pn,"f"))||void 0===f?void 0:f.app)||void 0===m?void 0:m.headerColor)||"",textColor:(null===(y=null===(g=o(this,Pn,"f"))||void 0===g?void 0:g.app)||void 0===y?void 0:y.textColor)||"",viewInLeftType:A,confirmToExit:1},homeConfig:{enable:_,url:`https://h5.zdn.vn/zapps/${this.getAppId()}/${E.search}`}},"f")}static getInstance(){return ro.instance||(ro.instance=new ro),ro.instance}getLoginStatus(){return Gt.isString(o(this,kn,"f"))&&o(this,kn,"f").length>0}getAppId(){return o(this,Nn,"f")}getZAppId(){return o(this,wn,"f")}login(e){return n(this,void 0,void 0,(function*(){const e=yield o(this,Un,"f").call(this),t=e.find((e=>e.name===Yt)),i=e.find((e=>e.name===ei));if(!Gt.isUndefined(t)&&!Gt.isNull(t)&&Gt.isString(t.value)){if(r(this,Cn,t.value,"f"),Gt.isUndefined(i)||Gt.isNull(i)||!Gt.isString(i.value)?yield this.loginZaloV3():(r(this,In,i.value,"f"),yield this.loginZaloV4()),!o(this,kn,"f"))throw Pi.loginFailed();return o(this,kn,"f")}throw Pi.loginFailed()}))}loginZaloV3(){return n(this,void 0,void 0,(function*(){return yield fetch(`${ni}?app_id=${o(this,wn,"f")}&redirect_uri=https://h5.zdn.vn/zapps/${o(this,Nn,"f")}/&code=${o(this,Cn,"f")}&isSDK=true123`).then((e=>n(this,void 0,void 0,(function*(){let t=yield e.json();if(t.access_token){r(this,kn,t.access_token,"f");const e=1e3*parseInt(t.expires_in);return r(this,jn,e,"f"),r(this,Dn,(new Date).getTime(),"f"),this.setZAccSession(o(this,kn,"f")||""),window.ZJSBridge.setZAccSession&&window.ZJSBridge.setZAccSession(o(this,kn,"f")||""),o(this,kn,"f")}return null}))))}))}loginZaloV4(){return n(this,void 0,void 0,(function*(){const e=new URLSearchParams;e.append("app_id",o(this,Nn,"f")),e.append("code",o(this,Cn,"f")||""),e.append("code_verifier",o(this,In,"f")||""),Gt.isNull(o(this,Rn,"f"))?e.append("grant_type","authorization_code"):(e.append("grant_type","refresh_token"),e.append("refresh_token",o(this,Rn,"f")||""));return yield fetch(ii,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,Rn,t.refresh_token,"f"),t.access_token){r(this,kn,t.access_token,"f");const e=1e3*parseInt(t.expires_in);return r(this,jn,e,"f"),r(this,Dn,(new Date).getTime(),"f"),this.setZAccSession(o(this,kn,"f")||""),window.ZJSBridge.setZAccSession&&window.ZJSBridge.setZAccSession(o(this,kn,"f")||""),o(this,kn,"f")}return null}))))}))}getAccessToken(e){return n(this,void 0,void 0,(function*(){const e=(new Date).getTime()-o(this,Dn,"f");if(!o(this,kn,"f"))throw Pi.loginRequired();return e<o(this,jn,"f")?o(this,kn,"f"):yield this.login()}))}}wn=new WeakMap,Nn=new WeakMap,Pn=new WeakMap,Cn=new WeakMap,In=new WeakMap,kn=new WeakMap,Rn=new WeakMap,Bn=new WeakMap,Dn=new WeakMap,jn=new WeakMap,Ln=new WeakMap,Mn=new WeakMap,Un=new WeakMap,Wn=new WeakMap,xn=new WeakMap;class ao{constructor(){zn.set(this,Kt),Fn.set(this,qt),Gn.set(this,"DEFAULT ZOAUTH"),Hn.set(this,"DEFAULT ACCESS TOKEN"),$n.set(this,{timer:{getToken:0}}),Vn.set(this,!1),this.getLoginStatus=()=>o(this,Vn,"f"),this.getAppId=()=>o(this,zn,"f"),this.login=()=>(r(this,Vn,!0,"f"),Promise.resolve(o(this,Gn,"f"))),this.getAccessToken=()=>Promise.resolve(o(this,Hn,"f")),this.getVersion=hn.getVersion,this.getSystemInfo=hn.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 Qn(this.getAppId());return yield t.putDataToStorage(e.data),{errorKeys:[]}})),this.getStorage=e=>n(this,void 0,void 0,(function*(){const t=new Qn(this.getAppId());return yield t.getDataFromStorage(e.keys)})),this.getStorageInfo=e=>n(this,void 0,void 0,(function*(){const e=new Qn(this.getAppId());return yield e.getStorageInfo()})),this.removeStorage=e=>n(this,void 0,void 0,(function*(){const t=new Qn(this.getAppId());return yield t.removeDataFromStorage(e.keys)})),this.clearStorage=e=>n(this,void 0,void 0,(function*(){const e=new Qn(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.url),Promise.resolve()),this.getRouteParams=oo.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()}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){return console.warn("This api only works on zalo app"),Promise.resolve({urls:[]})}}zn=new WeakMap,Fn=new WeakMap,Gn=new WeakMap,Hn=new WeakMap,$n=new WeakMap,Vn=new WeakMap;const so=Symbol("required"),lo=Symbol("checkType"),co=(e,t)=>(i,n,o)=>{let r=Reflect.getOwnMetadata(so,i,n)||[];r.push({parameterIndex:o,fields:e,option:t}),Reflect.defineMetadata(so,r,i,n)},uo=(e,t,i)=>(n,o,r)=>{let a=Reflect.getOwnMetadata(lo,n,o)||[];a.push({parameterIndex:r,type:e,properties:t,defaultValue:i}),Reflect.defineMetadata(lo,a,n,o)};const po=(e,t,i)=>{const n=i.value,o=n.toString().match(/\(.*?\)/)[0].replace(/[()]/gi,"").replace(/\s/gi,"").split(",");return i.value=function(){const i=Reflect.getOwnMetadata(so,e,t),r=Reflect.getOwnMetadata(lo,e,t);return r&&r.forEach((e=>{const{parameterIndex:t,type:i,properties:n,defaultValue:r}=e;let a=arguments[t],s=o[t];const l=typeof a;if(!Gt.isUndefined(a)){if(!xi(a,i))throw Pi.wrongTypeParam(s,i,Array.isArray(a)?"array":null===a?"null":l);"object"===i&&Object.entries(n).forEach((([e,i])=>{const n=e.split("?")[0],o=Gt.get(a,n);if(Gt.isUndefined(o)||Gt.isNull(o)){if(!e.includes("?"))throw Pi.missingParam(e);Gt.isObject(Gt.get(a,n.split(".")[0]))&&r&&!Gt.isUndefined(Gt.get(r,n))&&Gt.set(arguments[t],n,Gt.get(r,n))}else if(Gt.isFunction(i)){const e=i(o);if(e&&e.error)throw Pi.wrongTypeParam(`${s}.${n}`,e.errorMessage,typeof o)}}))}})),i&&i.forEach((e=>{const{parameterIndex:t,option:i,fields:n}=e,o=arguments[t],r=null==i?void 0:i.if,a=null==i?void 0:i.defaultValue;let s=!0;r&&(s=Object.keys(r).every((e=>Gt.get(o,e)===r[e]))),s&&n.forEach((e=>{const i=e=>{let i=!1;return Gt.isEmpty(Gt.get(o,e))&&(Gt.isUndefined(Gt.get(a,e))||Gt.set(arguments[t],e,Gt.get(a,e)),i=!0),i};if(Array.isArray(e)&&e.length>0&&e.every(i))throw Pi.missingParam(e.join(" or "));if(Gt.isString(e)&&i(e))throw Pi.missingParam(e)}))})),n.apply(this,arguments)},i};var ho;class vo{constructor(){this.events=qi.getInstance(),ho.set(this,void 0),r(this,ho,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,ho,"f").login(e)}))}getLoginStatus(){return o(this,ho,"f").getLoginStatus()}getAccessToken(e){return n(this,void 0,void 0,(function*(){return yield o(this,ho,"f").getAccessToken(e)}))}getVersion(){return o(this,ho,"f").getVersion()}getSystemInfo(){return o(this,ho,"f").getSystemInfo()}setNavigationBarTitle(e){return n(this,void 0,void 0,(function*(){return o(this,ho,"f").setNavigationBarTitle(e)}))}setNavigationBarColor(e){return n(this,void 0,void 0,(function*(){return yield o(this,ho,"f").setNavigationBarColor(e)}))}setBackgroundColor(e){return n(this,void 0,void 0,(function*(){return yield o(this,ho,"f").setBackgroundColor(e)}))}setNavigationBarLeftButton(e){return n(this,void 0,void 0,(function*(){return yield o(this,ho,"f").setNavigationBarLeftButton(e)}))}setDeviceOrientation(e){return n(this,void 0,void 0,(function*(){return yield o(this,ho,"f").setDeviceOrientation(e)}))}setStorage(e){return n(this,void 0,void 0,(function*(){return yield o(this,ho,"f").setStorage(e)}))}getStorage(e){return n(this,void 0,void 0,(function*(){return yield o(this,ho,"f").getStorage(e)}))}getStorageInfo(e){return n(this,void 0,void 0,(function*(){return yield o(this,ho,"f").getStorageInfo(e)}))}removeStorage(e){return n(this,void 0,void 0,(function*(){return yield o(this,ho,"f").removeStorage(e)}))}clearStorage(e){return n(this,void 0,void 0,(function*(){return yield o(this,ho,"f").clearStorage(e)}))}getUserInfo(e){return n(this,void 0,void 0,(function*(){return yield o(this,ho,"f").getUserInfo(e)}))}getNetworkType(e){return n(this,void 0,void 0,(function*(){return yield o(this,ho,"f").getNetworkType(e)}))}onNetworkStatusChange(e){return n(this,void 0,void 0,(function*(){return yield o(this,ho,"f").onNetworkStatusChange(e)}))}startBeaconDiscovery(e){return n(this,void 0,void 0,(function*(){return yield o(this,ho,"f").startBeaconDiscovery(e)}))}stopBeaconDiscovery(e){return n(this,void 0,void 0,(function*(){return yield o(this,ho,"f").stopBeaconDiscovery(e)}))}getBeacons(e){return n(this,void 0,void 0,(function*(){return yield o(this,ho,"f").getBeacons(e)}))}closeApp(e){return n(this,void 0,void 0,(function*(){return yield o(this,ho,"f").closeApp(e)}))}getLocation(e){return n(this,void 0,void 0,(function*(){return yield o(this,ho,"f").getLocation(e)}))}stopBluetoothDevicesDiscovery(){return n(this,void 0,void 0,(function*(){return yield o(this,ho,"f").stopBluetoothDevicesDiscovery()}))}startBluetoothDevicesDiscovery(e){return n(this,void 0,void 0,(function*(){return yield o(this,ho,"f").startBluetoothDevicesDiscovery(e)}))}openBluetoothAdapter(){return n(this,void 0,void 0,(function*(){return yield o(this,ho,"f").openBluetoothAdapter()}))}onBluetoothDeviceFound(){return n(this,void 0,void 0,(function*(){return yield o(this,ho,"f").onBluetoothDeviceFound()}))}onBluetoothAdapterStateChange(){return n(this,void 0,void 0,(function*(){return yield o(this,ho,"f").onBluetoothAdapterStateChange()}))}getConnectedBluetoothDevices(e){return n(this,void 0,void 0,(function*(){return yield o(this,ho,"f").getConnectedBluetoothDevices(e)}))}getBluetoothDevices(){return n(this,void 0,void 0,(function*(){return yield o(this,ho,"f").getBluetoothDevices()}))}getBluetoothAdapterState(){return n(this,void 0,void 0,(function*(){return yield o(this,ho,"f").getBluetoothAdapterState()}))}closeBluetoothAdapter(){return n(this,void 0,void 0,(function*(){return yield o(this,ho,"f").closeBluetoothAdapter()}))}scanQRCode(e){return n(this,void 0,void 0,(function*(){return yield o(this,ho,"f").scanQRCode(e)}))}openProfile(e){return n(this,void 0,void 0,(function*(){yield o(this,ho,"f").openProfile(e)}))}openChat(e){return n(this,void 0,void 0,(function*(){yield o(this,ho,"f").openChat(e)}))}openPostFeed(e){return n(this,void 0,void 0,(function*(){return yield o(this,ho,"f").openPostFeed(e)}))}followOA(e){return n(this,void 0,void 0,(function*(){return yield o(this,ho,"f").followOA(e)}))}unfollowOA(e){return n(this,void 0,void 0,(function*(){return yield o(this,ho,"f").unFollowOA(e)}))}openShareSheet(e){return n(this,void 0,void 0,(function*(){return yield o(this,ho,"f").openShareSheet(e)}))}requestCameraPermission(e){return n(this,void 0,void 0,(function*(){return yield o(this,ho,"f").requestCameraPermission(e)}))}createShortcut(e){return n(this,void 0,void 0,(function*(){const t=yield Ki(Qt,0),i=Li().isIOS,n=t.logoUrl||Mi("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",Qt),a.append("appName",r),a.append("appIcon",n);const e=`https://mini.zalo.me/shortcut.html?${a.toString()}`;yield o(this,ho,"f").openOutApp(encodeURI(e))}else yield o(this,ho,"f").createShortcut(`https://zalo.me/app/link/zapps/${Qt}/?${a.toString()}`,r,n);return Ni()}))}openBioAuthentication(e){return n(this,void 0,void 0,(function*(){return yield o(this,ho,"f").openBioAuthentication(e)}))}checkStateBioAuthentication(e){return n(this,void 0,void 0,(function*(){return yield o(this,ho,"f").checkStateBioAuthentication(e)}))}sendLocation(e){return n(this,void 0,void 0,(function*(){yield o(this,ho,"f").sendLocation(e)}))}showToast(e){return n(this,void 0,void 0,(function*(){yield o(this,ho,"f").showToast(e)}))}hideKeyboard(e){return n(this,void 0,void 0,(function*(){yield o(this,ho,"f").hideKeyboard(e)}))}openPhone(e){return n(this,void 0,void 0,(function*(){return yield o(this,ho,"f").openPhone(e)}))}openSMS(e){return n(this,void 0,void 0,(function*(){yield o(this,ho,"f").openSMS(e)}))}viewOAQr(e){return n(this,void 0,void 0,(function*(){yield o(this,ho,"f").viewOAQr(e)}))}keepScreen(e){return n(this,void 0,void 0,(function*(){return yield o(this,ho,"f").keepScreen(e)}))}saveImageToGallery(e){return n(this,void 0,void 0,(function*(){return yield o(this,ho,"f").saveImageToPhotosAlbum(e)}))}saveImageToPhotosAlbum(e){return n(this,void 0,void 0,(function*(){return yield o(this,ho,"f").saveImageToPhotosAlbum(e)}))}openMiniApp(e){return n(this,void 0,void 0,(function*(){if(!Gt.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,ho,"f").openMiniApp(e)}))}vibrate(e){return n(this,void 0,void 0,(function*(){yield o(this,ho,"f").vibrate(e)}))}openWebview(e){return n(this,void 0,void 0,(function*(){yield o(this,ho,"f").openWebview(e)}))}getRouteParams(){return o(this,ho,"f").getRouteParams()}getAppInfo(e){return o(this,ho,"f").getAppInfo()}sendDataToPreviousMiniApp(e){return o(this,ho,"f").sendDataToPreviousMiniApp(e)}onCallbackData(e){return n(this,void 0,void 0,(function*(){return yield o(this,ho,"f").onCallbackData(e)}))}getPhoneNumber(e){return n(this,void 0,void 0,(function*(){return yield o(this,ho,"f").getPhoneNumber()}))}openProfilePicker(e){return n(this,void 0,void 0,(function*(){const t=yield o(this,ho,"f").openProfilePicker(e.maxProfile);let i;if(t.length>0)try{const e=yield this.getAccessToken(),n=yield fetch(oi,{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,l,c,u,d,p;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===(c=null===(l=null===(s=null===(a=o.data[e])||void 0===a?void 0:a.user_info)||void 0===s?void 0:s.picture)||void 0===l?void 0:l.data)||void 0===c?void 0:c.url},code:0!==(null===(u=o.data[e])||void 0===u?void 0:u.error)?-1:0,message:`Get profile: ${Gt.isUndefined(null===(d=o.data[e])||void 0===d?void 0:d.message)?"Unknown error":null===(p=o.data[e])||void 0===p?void 0:p.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,ho,"f").connectWifi(e)}))}openMediaPicker(e){var t,i,r;return n(this,void 0,void 0,(function*(){const n={};Gt.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,ho,"f").openMediaPicker(e.type,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,ho,"f").closeLoading("user action")}))}}ho=new WeakMap,t([bi],vo.prototype,"login",null),t([wi],vo.prototype,"getLoginStatus",null),t([bi],vo.prototype,"getAccessToken",null),t([wi],vo.prototype,"getVersion",null),t([wi],vo.prototype,"getSystemInfo",null),t([bi,po,i(0,uo("object",{title:Ji("string")}))],vo.prototype,"setNavigationBarTitle",null),t([bi,po,i(0,uo("object",{color:Ji("string"),"textColor?":Ji("string",{values:["white","black"]}),"statusBarColor?":Ji("string")}))],vo.prototype,"setNavigationBarColor",null),t([bi,po,i(0,uo("object",{backgroundColor:Ji("string"),"textColor?":Ji("string",{values:["white","black"]})}))],vo.prototype,"setBackgroundColor",null),t([bi,po,i(0,uo("object",{type:Ji("string",{values:["none","back","home","both"]})}))],vo.prototype,"setNavigationBarLeftButton",null),t([bi,po,i(0,uo("object",{rotate:Ji("string",{values:["auto","portrait","landscape"]})}))],vo.prototype,"setDeviceOrientation",null),t([bi,po,i(0,uo("object",{data:Ji("object")}))],vo.prototype,"setStorage",null),t([bi,po,i(0,uo("object",{keys:Ji("array<string>")}))],vo.prototype,"getStorage",null),t([bi],vo.prototype,"getStorageInfo",null),t([bi,po,i(0,uo("object",{keys:Ji("array<string>")}))],vo.prototype,"removeStorage",null),t([bi],vo.prototype,"clearStorage",null),t([bi,po,i(0,uo("object",{"avatarType?":Ji("string",{values:["small","normal","large"]})}))],vo.prototype,"getUserInfo",null),t([bi],vo.prototype,"getNetworkType",null),t([bi],vo.prototype,"onNetworkStatusChange",null),t([bi],vo.prototype,"startBeaconDiscovery",null),t([bi],vo.prototype,"stopBeaconDiscovery",null),t([bi],vo.prototype,"getBeacons",null),t([bi],vo.prototype,"closeApp",null),t([bi],vo.prototype,"getLocation",null),t([bi],vo.prototype,"stopBluetoothDevicesDiscovery",null),t([bi],vo.prototype,"startBluetoothDevicesDiscovery",null),t([bi],vo.prototype,"openBluetoothAdapter",null),t([bi],vo.prototype,"onBluetoothDeviceFound",null),t([bi],vo.prototype,"onBluetoothAdapterStateChange",null),t([bi],vo.prototype,"getConnectedBluetoothDevices",null),t([bi],vo.prototype,"getBluetoothDevices",null),t([bi],vo.prototype,"getBluetoothAdapterState",null),t([bi],vo.prototype,"closeBluetoothAdapter",null),t([bi],vo.prototype,"scanQRCode",null),t([bi,po,i(0,uo("object",{type:Ji("string",{values:["user","oa","aliasOA"]}),id:Ji("string")}))],vo.prototype,"openProfile",null),t([bi,po,i(0,uo("object",{type:Ji("string",{values:["user","oa"]}),id:Ji("string")}))],vo.prototype,"openChat",null),t([bi,po,i(0,co(["data.imageUrl"],{if:{type:"image"}})),i(0,co(["data.link"],{if:{type:"link"}})),i(0,co(["data.id"],{if:{type:"profile"}})),i(0,uo("object",{type:Ji("string",{values:["image","link","profile"]}),data:Ji("object"),"data.imageUrl?":Ji("url"),"data.link?":Ji("url"),"data.title?":Ji("string"),"data.thumb?":Ji("url"),"data.description?":Ji("string"),"data.avatar?":Ji("url"),"data.id?":Ji("string"),"data.displayName?":Ji("string")}))],vo.prototype,"openPostFeed",null),t([bi,po,i(0,uo("object",{id:Ji("string"),"showDialogConfirm?":Ji("boolean")}))],vo.prototype,"followOA",null),t([bi,po,i(0,uo("object",{id:Ji("string")}))],vo.prototype,"unfollowOA",null),t([bi,po,i(0,co([["data.imageUrl","data.imageUrls"]],{if:{type:"image"}})),i(0,co(["data.link"],{if:{type:"link"}})),i(0,co(["data.id"],{if:{type:"oa"}})),i(0,co(["data.gifUrl"],{if:{type:"gif"}})),i(0,co(["data.videoThumb","data.videoUrl"],{if:{type:"video"}})),i(0,co(["data.thumbnail","data.title","data.description"],{if:{type:"zmp"},defaultValue:{data:{description:""}}})),i(0,uo("object",{type:Ji("string",{values:["image","gif","video","link","oa","zmp"]}),data:Ji("object"),"data.imageUrl?":Ji("url"),"data.imageUrls?":Ji("array<url>",{maxLength:10}),"data.caption?":Ji("string"),"data.gifUrl?":Ji("url"),"data.width?":Ji("number"),"data.height?":Ji("number"),"data.videoThumb?":Ji("url"),"data.videoUrl?":Ji("url"),"data.link?":Ji("url"),"data.chatOnly?":Ji("boolean"),"data.id?":Ji("string"),"data.thumbnail?":Ji("url"),"data.path?":Ji("string"),"data.title?":Ji("string",{maxLength:100}),"data.description?":Ji(["string"],{maxLength:400})}))],vo.prototype,"openShareSheet",null),t([bi],vo.prototype,"requestCameraPermission",null),t([bi],vo.prototype,"createShortcut",null),t([bi,po,i(0,uo("object",{secretData:Ji("string"),"ui?":Ji("object"),"ui.title?":Ji("string"),"ui.subTitle?":Ji("string"),"ui.negativeButtonText?":Ji("string"),"requireFingerprint?":Ji("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"}}))],vo.prototype,"openBioAuthentication",null),t([bi],vo.prototype,"checkStateBioAuthentication",null),t([bi,po,i(0,uo("object",{toUserId:Ji("string"),"title?":Ji("string")}))],vo.prototype,"sendLocation",null),t([bi,po,i(0,uo("object",{message:Ji("string")}))],vo.prototype,"showToast",null),t([bi],vo.prototype,"hideKeyboard",null),t([bi,po,i(0,uo("object",{phoneNumber:Ji("string")}))],vo.prototype,"openPhone",null),t([bi,po,i(0,uo("object",{content:Ji("string"),phoneNumber:Ji("string",{regex:/^\+?\d+$/})}))],vo.prototype,"openSMS",null),t([bi,po,i(0,uo("object",{id:Ji("string"),"displayName?":Ji("string")},{displayName:""}))],vo.prototype,"viewOAQr",null),t([bi],vo.prototype,"keepScreen",null),t([bi,po,i(0,uo("object",{"imageBase64Data?":Ji("string"),"imageUrl?":Ji("url")}))],vo.prototype,"saveImageToGallery",null),t([bi,po,i(0,uo("object",{"imageBase64Data?":Ji("string"),"imageUrl?":Ji("url")}))],vo.prototype,"saveImageToPhotosAlbum",null),t([bi,po,i(0,uo("object",{appId:Ji("string"),"params?":Ji("object")}))],vo.prototype,"openMiniApp",null),t([bi,po,i(0,uo("object",{"type?":Ji("string",{values:["oneShot"]}),"milliseconds?":Ji("number")},{type:"oneShot",milliseconds:500}))],vo.prototype,"vibrate",null),t([bi,po,i(0,uo("object",{url:Ji("string")}))],vo.prototype,"openWebview",null),t([wi],vo.prototype,"getRouteParams",null),t([bi],vo.prototype,"getAppInfo",null),t([bi],vo.prototype,"sendDataToPreviousMiniApp",null),t([bi],vo.prototype,"onCallbackData",null),t([bi],vo.prototype,"getPhoneNumber",null),t([bi,po,i(0,uo("object",{"maxProfile?":Ji("number",{min:1,max:10})},{maxProfile:1}))],vo.prototype,"openProfilePicker",null),t([bi,po,i(0,co(["SSID"])),i(0,uo("object",{SSID:Ji("string"),"password?":Ji("string"),"hiddenSSID?":Ji("boolean")}))],vo.prototype,"connectWifi",null),t([bi,po,i(0,uo("object",{type:Ji("string",{values:["photo","video","file","multi_photo","multi_video"]}),"editView?":Ji("object"),"editView.enable?":Ji("boolean"),"editView.aspectRatio?":Ji("string",{regex:/^\d+:\d+$/}),"silentRequest?":Ji("boolean"),"maxSelectItem?":Ji("number",{min:1})}))],vo.prototype,"openMediaPicker",null),t([bi,po,i(0,uo("object",{title:Ji("string",{maxLength:100}),"thumbnail?":Ji("url"),"path?":Ji("string"),description:Ji(["string"],{maxLength:400})},{description:""}))],vo.prototype,"getShareableLink",null),t([bi,po],vo.prototype,"closeLoading",null);class fo extends vo{getServiceInstance(){return ro.getInstance()}}class mo extends vo{getServiceInstance(){return new ao}}const go=Li();e.default=void 0,window.onJSCall=e=>function(t){rn.getInstance().onJSCall(e,t)},window.onMultiJSCall=e=>function(t){rn.getInstance().onMultiJSCall(e,t)},window.zaloJSV2={zalo_h5_event_handler:function(e,t,i){rn.getInstance().nativeEventHandler(e,t,i)}},go.isZalo?e.default=new fo:e.default=new mo,window.ZaloMiniAppSDK=e.default,e.SDKCreator=vo,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{l(n.next(e))}catch(e){r(e)}}function s(e){try{l(n.throw(e))}catch(e){r(e)}}function l(e){var t;e.done?o(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(a,s)}l((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 l=function(e,t){return function(i){return e(t(i))}}(Object.keys,Object),c=Object.prototype.hasOwnProperty;var u=function(e){if(!s(e))return l(e);var t=[];for(var i in Object(e))c.call(e,i)&&"constructor"!=i&&t.push(i);return t},d="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function p(e,t){return e(t={exports:{}},t.exports),t.exports}var h="object"==typeof d&&d&&d.Object===Object&&d,v="object"==typeof self&&self&&self.Object===Object&&self,f=h||v||Function("return this")(),m=f.Symbol,g=Object.prototype,y=g.hasOwnProperty,_=g.toString,E=m?m.toStringTag:void 0;var A=function(e){var t=y.call(e,E),i=e[E];try{e[E]=void 0;var n=!0}catch(e){}var o=_.call(e);return n&&(t?e[E]=i:delete e[E]),o},S=Object.prototype.toString;var O=function(e){return S.call(e)},T=m?m.toStringTag:void 0;var b=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":T&&T in Object(e)?A(e):O(e)};var w=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)};var N,P=function(e){if(!w(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__"],C=(N=/[^.]+$/.exec(I&&I.keys&&I.keys.IE_PROTO||""))?"Symbol(src)_1."+N:"";var k=function(e){return!!C&&C in e},R=Function.prototype.toString;var B=function(e){if(null!=e){try{return R.call(e)}catch(e){}try{return e+""}catch(e){}}return""},D=/^\[object .+?Constructor\]$/,j=Function.prototype,M=Object.prototype,L=j.toString,U=M.hasOwnProperty,W=RegExp("^"+L.call(U).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");var x=function(e){return!(!w(e)||k(e))&&(P(e)?W:D).test(B(e))};var z=function(e,t){return null==e?void 0:e[t]};var F=function(e,t){var i=z(e,t);return x(i)?i:void 0},G=F(f,"DataView"),H=F(f,"Map"),$=F(f,"Promise"),V=F(f,"Set"),Z=F(f,"WeakMap"),J="[object Map]",K="[object Promise]",q="[object Set]",Q="[object WeakMap]",Y="[object DataView]",X=B(G),ee=B(H),te=B($),ie=B(V),ne=B(Z),oe=b;(G&&oe(new G(new ArrayBuffer(1)))!=Y||H&&oe(new H)!=J||$&&oe($.resolve())!=K||V&&oe(new V)!=q||Z&&oe(new Z)!=Q)&&(oe=function(e){var t=b(e),i="[object Object]"==t?e.constructor:void 0,n=i?B(i):"";if(n)switch(n){case X:return Y;case ee:return J;case te:return K;case ie:return q;case ne:return Q}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)},le=Object.prototype,ce=le.hasOwnProperty,ue=le.propertyIsEnumerable,de=se(function(){return arguments}())?se:function(e){return ae(e)&&ce.call(e,"callee")&&!ue.call(e,"callee")},pe=Array.isArray;var he=function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991};var ve=function(e){return null!=e&&he(e.length)&&!P(e)};var fe=function(){return!1},me=p((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})),ge={};ge["[object Float32Array]"]=ge["[object Float64Array]"]=ge["[object Int8Array]"]=ge["[object Int16Array]"]=ge["[object Int32Array]"]=ge["[object Uint8Array]"]=ge["[object Uint8ClampedArray]"]=ge["[object Uint16Array]"]=ge["[object Uint32Array]"]=!0,ge["[object Arguments]"]=ge["[object Array]"]=ge["[object ArrayBuffer]"]=ge["[object Boolean]"]=ge["[object DataView]"]=ge["[object Date]"]=ge["[object Error]"]=ge["[object Function]"]=ge["[object Map]"]=ge["[object Number]"]=ge["[object Object]"]=ge["[object RegExp]"]=ge["[object Set]"]=ge["[object String]"]=ge["[object WeakMap]"]=!1;var ye=function(e){return ae(e)&&he(e.length)&&!!ge[b(e)]};var _e=function(e){return function(t){return e(t)}},Ee=p((function(e,t){var i=t&&!t.nodeType&&t,n=i&&e&&!e.nodeType&&e,o=n&&n.exports===i&&h.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})),Ae=Ee&&Ee.isTypedArray,Se=Ae?_e(Ae):ye,Oe=Object.prototype.hasOwnProperty;var Te=function(e){if(null==e)return!0;if(ve(e)&&(pe(e)||"string"==typeof e||"function"==typeof e.splice||me(e)||Se(e)||de(e)))return!e.length;var t=re(e);if("[object Map]"==t||"[object Set]"==t)return!e.size;if(s(e))return!u(e).length;for(var i in e)if(Oe.call(e,i))return!1;return!0};var be=function(e){return void 0===e};var we=function(e){return null===e};var Ne=function(e){return"string"==typeof e||!pe(e)&&ae(e)&&"[object String]"==b(e)};var Pe=function(e){return"number"==typeof e||ae(e)&&"[object Number]"==b(e)};var Ie=function(e){return ae(e)&&"[object RegExp]"==b(e)},Ce=Ee&&Ee.isRegExp,ke=Ce?_e(Ce):Ie;var Re=function(e){return"symbol"==typeof e||ae(e)&&"[object Symbol]"==b(e)},Be=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,De=/^\w*$/;var je=function(e,t){if(pe(e))return!1;var i=typeof e;return!("number"!=i&&"symbol"!=i&&"boolean"!=i&&null!=e&&!Re(e))||(De.test(e)||!Be.test(e)||null!=t&&e in Object(t))},Me=F(Object,"create");var Le=function(){this.__data__=Me?Me(null):{},this.size=0};var Ue=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},We=Object.prototype.hasOwnProperty;var xe=function(e){var t=this.__data__;if(Me){var i=t[e];return"__lodash_hash_undefined__"===i?void 0:i}return We.call(t,e)?t[e]:void 0},ze=Object.prototype.hasOwnProperty;var Fe=function(e){var t=this.__data__;return Me?void 0!==t[e]:ze.call(t,e)};var Ge=function(e,t){var i=this.__data__;return this.size+=this.has(e)?0:1,i[e]=Me&&void 0===t?"__lodash_hash_undefined__":t,this};function He(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])}}He.prototype.clear=Le,He.prototype.delete=Ue,He.prototype.get=xe,He.prototype.has=Fe,He.prototype.set=Ge;var $e=He;var Ve=function(){this.__data__=[],this.size=0};var Ze=function(e,t){return e===t||e!=e&&t!=t};var Je=function(e,t){for(var i=e.length;i--;)if(Ze(e[i][0],t))return i;return-1},Ke=Array.prototype.splice;var qe=function(e){var t=this.__data__,i=Je(t,e);return!(i<0)&&(i==t.length-1?t.pop():Ke.call(t,i,1),--this.size,!0)};var Qe=function(e){var t=this.__data__,i=Je(t,e);return i<0?void 0:t[i][1]};var Ye=function(e){return Je(this.__data__,e)>-1};var Xe=function(e,t){var i=this.__data__,n=Je(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=Ve,et.prototype.delete=qe,et.prototype.get=Qe,et.prototype.has=Ye,et.prototype.set=Xe;var tt=et;var it=function(){this.size=0,this.__data__={hash:new $e,map:new(H||tt),string:new $e}};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 lt=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 ct(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])}}ct.prototype.clear=it,ct.prototype.delete=rt,ct.prototype.get=at,ct.prototype.has=st,ct.prototype.set=lt;var ut=ct;function dt(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(dt.Cache||ut),i}dt.Cache=ut;var pt=dt;var ht=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,vt=/\\(\\)?/g,ft=function(e){var t=pt(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(ht,(function(e,i,n,o){t.push(n?o.replace(vt,"$1"):i||e)})),t}));var mt=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},gt=m?m.prototype:void 0,yt=gt?gt.toString:void 0;var _t=function e(t){if("string"==typeof t)return t;if(pe(t))return mt(t,e)+"";if(Re(t))return yt?yt.call(t):"";var i=t+"";return"0"==i&&1/t==-Infinity?"-0":i};var Et=function(e){return null==e?"":_t(e)};var At=function(e,t){return pe(e)?e:je(e,t)?[e]:ft(Et(e))};var St=function(e){if("string"==typeof e||Re(e))return e;var t=e+"";return"0"==t&&1/e==-Infinity?"-0":t};var Ot=function(e,t){for(var i=0,n=(t=At(t,e)).length;null!=e&&i<n;)e=e[St(t[i++])];return i&&i==n?e:void 0};var Tt=function(e,t,i){var n=null==e?void 0:Ot(e,t);return void 0===n?i:n},bt=function(){try{var e=F(Object,"defineProperty");return e({},"",{}),e}catch(e){}}();var wt=function(e,t,i){"__proto__"==t&&bt?bt(e,t,{configurable:!0,enumerable:!0,value:i,writable:!0}):e[t]=i},Nt=Object.prototype.hasOwnProperty;var Pt=function(e,t,i){var n=e[t];Nt.call(e,t)&&Ze(n,i)&&(void 0!==i||t in e)||wt(e,t,i)},It=/^(?:0|[1-9]\d*)$/;var Ct=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(!w(e))return e;for(var o=-1,r=(t=At(t,e)).length,a=r-1,s=e;null!=s&&++o<r;){var l=St(t[o]),c=i;if("__proto__"===l||"constructor"===l||"prototype"===l)return e;if(o!=a){var u=s[l];void 0===(c=n?n(u,l,s):void 0)&&(c=w(u)?u:Ct(t[o+1])?[]:{})}Pt(s,l,c),s=s[l]}return e};var Rt,Bt,Dt,jt,Mt,Lt,Ut,Wt,xt,zt,Ft,Gt={isEmpty:Te,isNull:we,isUndefined:be,isFunction:P,isObject:w,isString:Ne,isNumber:Pe,isArray:pe,isRegExp:ke,get:Tt,set:function(e,t,i){return null==e?e:kt(e,t,i)}};function Ht(e){return"function"==typeof window.Debug?window.Debug(e):function(...t){"development"===process.env.NODE_ENV&&console.log(e,...t)}}e.NetworkType=void 0,(Rt=e.NetworkType||(e.NetworkType={})).none="none",Rt.wifi="wifi",Rt.cellular="cellular",Rt.unknown="unknown",e.PlatformType=void 0,(Bt=e.PlatformType||(e.PlatformType={})).wp="wp",Bt.android="android",Bt.iOS="iOS",Bt.unknown="unknown",e.ProfileType=void 0,(Dt=e.ProfileType||(e.ProfileType={}))[Dt.user=1]="user",Dt[Dt.oa=0]="oa",Dt[Dt.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,(Mt=e.PostFeedType||(e.PostFeedType={}))[Mt.image=1]="image",Mt[Mt.link=4]="link",Mt[Mt.profile=5]="profile",e.ShareSheetType=void 0,(Lt=e.ShareSheetType||(e.ShareSheetType={}))[Lt.image=1]="image",Lt[Lt.gif=11]="gif",Lt[Lt.video=12]="video",Lt[Lt.link=4]="link",Lt[Lt.oa=5]="oa",Lt[Lt.zmp=20]="zmp",e.OrientationType=void 0,(Ut=e.OrientationType||(e.OrientationType={}))[Ut.auto=1]="auto",Ut[Ut.portrait=2]="portrait",Ut[Ut.landscape=3]="landscape",e.VibrateType=void 0,(Wt=e.VibrateType||(e.VibrateType={}))[Wt.oneShot=0]="oneShot",e.NativeCode=void 0,(xt=e.NativeCode||(e.NativeCode={}))[xt.token_invalid=-2]="token_invalid",xt[xt.not_permission=-1]="not_permission",xt[xt.client_not_support=-5]="client_not_support",xt[xt.decode_failed=-4]="decode_failed",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",e.MediaPickerType=void 0,(Ft=e.MediaPickerType||(e.MediaPickerType={}))[Ft.photo=4]="photo",Ft[Ft.video=5]="video",Ft[Ft.file=6]="file",Ft[Ft.multi_photo=7]="multi_photo",Ft[Ft.multi_video=8]="multi_video";const $t=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},Vt=e=>$t(`${window.location.host}_`+e),Zt=e=>$t((()=>{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),Jt=1048576,Kt=window.zAppID,qt=window.APP_ID,Qt=window.APP_CONFIG||{},Yt="h5.zdn.vn_zoauth",Xt="h5.zdn.vn_zlink3rd",ei="h5.zdn.vn_zoauth_vrf",ti="https://graph.zalo.me/v2.0/me",ii="https://h5.zalo.me/openapi/access_token",ni="https://oauth.zaloapp.com/v3/access_token",oi="https://graph.zalo.me/v2.0/me/friends/list",ri=5*Jt,ai=e=>({NONE:e?-2:0,WIFI:e?0:1,"2G":2,"3G":e?15:2,"4G":e?13:2}),si={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"},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},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}},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}},MP_OPEN_PROFILE_PICKER:{name:"action.mp.open.profile.picker",version_live:{iOS:432}},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:999}},MP_CLOSE_LOADINGVIEW:{name:"action.mp.close.loadingview"}},li=0,ci=-1400,ui=-1500,di=-1401,pi=-1403,hi=-1404,vi={SUCCESS:"Success",READ_MORE:"Read more at: https://miniapp.zalo.me/docs/api",LOGIN_REQUIRED:"Please login before to call this api. Read more at: https://miniapp.zalo.me/docs/api/login",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 your data. Read more at: https://miniapp.zalo.me/docs/api/error"},fi="apps/get-info",mi={android:12100571,iOS:400,wp:0,unknown:0},gi=[si.GET_DOWNLOADED_STICKER.name,si.OPEN_SHARE_STICKER.name,si.OPEN_PROFILE.name,si.OPEN_FEED_DETAIL.name,si.OPEN_FRIEND_RADA.name,si.OPEN_INAPP.name,si.OPEN_OUTAPP.name,si.OPEN_PAGE.name,si.OPEN_PHOTODETAIL.name,si.OPEN_GALARY.name,si.OPEN_GAMECENTER.name,si.OPEN_GAMENEWS.name,si.OPEN_TAB_CONTACT.name,si.OPEN_TAB_SOCIAL.name,si.OPEN_FRIENDSUGGEST.name,si.OPEN_GROUPLIST.name,si.OPEN_NEARBY.name,si.OPEN_ROOM.name,si.OPEN_STICKERSTORE.name,si.OPEN_CREATECHAT.name,si.COPY_LINK_CATESTICKER.name,si.REQUEST_BUY_STICKER.name,si.OPEN_CHAT.name,si.OPEN_TAB_CHAT.name,si.OPEN_CHATGROUP.name,si.OPEN_ADDFRIEND.name,si.OPEN_TAB_MORE.name,si.OPEN_POSTFEED.name,si.OPEN_LOGINDEVICES.name,si.OPEN_SENDSTICKER.name,si.REPORT_ABUSE.name,si.FOLLOW_OA.name,si.UNFOLLOW_OA.name,si.OPEN_GAMEDETAIL.name,si.OPEN_SHARESHEET.name,si.REQUEST_PERMISSION_CAMERA.name,si.CHANGE_TITLE_HEADER.name,si.WEBVIEW_CLEARCACHE.name,si.WEBVIEW_CONFIRMCACHE.name,si.WEBVIEW_ISVISIBLE.name,si.WEBVIEW_NETWORKTYPE.name,si.CHANGE_BUTTON_HEADER.name,si.CREATE_OPTIONS_MENU.name,si.CREATE_SHORTCUT.name,si.CHANGE_ACTIONBAR_LEFTBUTTON_TYPE.name,si.WINDOW_CLOSE.name,si.WEBVIEW_CHECKRESERROR.name,si.IAP_REQUESTPAYMENT.name,si.ZBROWSER_GETSTATS.name,si.ZBROWSER_JSBRIDGE.name,si.PROMPT_AUTHENTICATION.name,si.CHANGE_ACTIONBAR_COLOR.name,si.PROMPT_AUTHENTICATION_CHECK_STATE.name,si.OPEN_APPSTORE.name,si.GET_LOCATION.name,si.QUERY_LOCATION_HIDE.name,si.SHOW_TOAST.name,si.OPEN_APP.name,si.HIDE_KEYBOARD.name,si.OPEN_PHONE.name,si.OPEN_QR.name,si.OPEN_SMS.name,si.VIEW_MYQR.name,si.KEEP_SCREEN.name,si.CHANGE_AUTOROTATE.name,si.CHECK_APP_INSTALLED.name,si.QUERY_SHOW.name,si.QUERY_HIDE.name,si.OPEN_INAPPRW.name,si.ZALORUN_GETTRACKINGSTATUS.name,si.ZALORUN_SETTRACKINGSTATUS.name,si.ZALORUN_GETDAYSTEP.name,si.ZALORUN_FORCESUBMITDATA.name,si.ZALORUN_SETWEIGHT.name,si.OPEN_PROFILE_EXT.name,si.DOWNLOAD_CATE.name,si.JUMP_LOGIN.name,si.OPEN_ADTIMA_ADS_INTERSTITIAL.name,si.OPEN_ADTIMA_ADS.name,si.GET_ADIDCLIENT.name,si.SCAN_IBEACON.name,si.SAVE_IMAGE_GALLERY.name,si.OPEN_MP.name,si.CHANGE_ACTIONBAR.name,si.INTERACTIVE_VIBRATION.name,si.ZBROWSER_MPDS.name],yi=0,_i=3,Ei=1,Ai=0,Si="https://payment-mini.zalo.me/api/order/create",Oi="https://payment-mini.zalo.me/api/transaction";class Ti{constructor(e,t,i){this.code=e,this.message=t,this.api=i}toString(){return`api: ${this.api}; code: ${this.code}; message: ${this.message}`}}class bi extends Ti{constructor(e,t){super(e,t),this.message=`${t}. ${vi.READ_MORE}`,this.handler()}handler(){switch(this.code){case e.NativeCode.token_invalid:this.code=di,this.message=vi.LOGIN_REQUIRED;break;case e.NativeCode.not_permission:this.code=pi,this.message=vi.NOT_PERMISSION;break;case e.NativeCode.client_not_support:this.code=hi,this.message=vi.CLIENT_NOT_SUPPORT;break;case e.NativeCode.decode_failed:this.message=vi.DECODE_FAILED}}}const wi={handler:null,setHandler(e){this.handler=e}};wi.setHandler(((e,t)=>t instanceof Ti?(t.api=e,t):new Ti(-2001,Gt.isNull(t.message)?"Unknown Error":t.message,e)));const Ni=(e,t,i)=>{const o=i.value;return i.value=function(...e){return n(this,void 0,void 0,(function*(){const{success:i,fail:r}=Array.isArray(e)&&e.length>0&&e[0];return new Promise(((a,s)=>n(this,void 0,void 0,(function*(){try{const t=yield o.apply(this,e);!Gt.isNull(i)&&Gt.isFunction(i)?i.call(null,t,this):a(t)}catch(e){if("login"!==(null==e?void 0:e.api)&&((null==e?void 0:e.code)===di||(null==e?void 0:e.code)===pi)){let t=!1;this instanceof So&&(t=this.getLoginStatus()),t||(e=new Ti(di,vi.LOGIN_REQUIRED))}const{handler:i}=wi,n=i.call(null,t,e,this);window.zmpSentry&&window.zmpSentry.throwError(n.toString()),!Gt.isNull(r)&&Gt.isFunction(r)?r.call(null,n,this):console.error("Error:",n)}}))))}))},i},Pi=(e,t,i)=>{const n=i.value;return i.value=function(...e){try{return n.apply(this,e)}catch(e){if("login"!==(null==e?void 0:e.api)&&((null==e?void 0:e.code)===di||(null==e?void 0:e.code)===pi)){let t=!1;this instanceof So&&(t=this.getLoginStatus()),t||(e=new Ti(di,vi.LOGIN_REQUIRED))}const{handler:i}=wi;!Gt.isNull(i)&&Gt.isFunction(i)?i.call(null,t,e,this):console.warn(e.message)}},i},Ii=(e,t)=>({code:li,message:t||vi.SUCCESS,data:e||{}}),Ci={badRequest:e=>new Ti(ci,e),loginFailed:()=>new Ti(ci,vi.LOGIN_FAILED),loginRequired:()=>new Ti(di,vi.LOGIN_REQUIRED),missingParam:e=>new Ti(ci,`Missing required argument: ${e}`),wrongTypeParam:(e,t,i)=>new Ti(ci,`Wrong type of parameter '${e}'. Expected ${t}, but got ${i}`),cannotGetShareInfo:()=>new Ti(ui,"Can not get app info to share"),lengthInvalid:e=>new Ti(ci,`${e} length is invalid.`)};const ki={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:ki.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("&")}},Ri=new RegExp("[\\u0300-\\u036f]","g"),Bi=new RegExp("[đ|Đ]","g"),Di=new RegExp("\\s","g"),ji=Ht("zmp:utils:common"),Mi=e=>{try{new URL(e)}catch(e){return!1}return!0},Li=()=>navigator.userAgent||navigator.vendor||window.opera,Ui=()=>{const e=Li().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)}},Wi=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=Li().toLowerCase().split("zalo")[1];if(e){return e.replace(" ","").split("/")[1]||""}return""},zi=()=>{let t=Ui();return t.isWP?e.PlatformType.wp:t.isAndroid?e.PlatformType.android:t.isIOS?e.PlatformType.iOS:e.PlatformType.unknown},Fi=(e,t)=>{const i=t.toLowerCase(),n=i.split(/[<>]/i),o="array"===n[0];return!!("url"===i&&Mi(e)||o&&("array"===i&&Array.isArray(e)||((e,t)=>Array.isArray(t)&&!t.some((t=>"url"===e?!Mi(t):typeof t!==e)))(n[1],e))||!Array.isArray(e)&&typeof e===t)},Gi=e=>(e=>{let t=Vt(e);return t||(t=Zt(e),t)?t:$t(e)})(e),Hi=e=>{if(Gt.isObject(JSON)&&JSON.parse&&Gt.isString(e)){const t=e.replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/\t/g,"\\t");return JSON.parse(t,((e,t)=>t))}return Gt.isObject(e)?e:new Function("return "+e)()},$i=e=>{if(Gt.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($i(e[n]));return"["+t.join(",")+"]"}if("object"==typeof e){for(var o in t=new Array,e)t.push('"'+o+'":'+$i(e[o]));return"{"+t.join(",")+"}"}return e.toString()},Vi=()=>{try{const e=Number(xi()),t=zi();return e>=mi[t]}catch(e){return!0}},Zi=e=>JSON.stringify(e).replace(/"/g,'\\"').replace(/'/g,"'"),Ji=e=>{try{if(e){ji(e);const t=e.replace(/\\/g,"").replace(/'/g,"'");return ji("formattedValue",t,JSON.parse(t),typeof JSON.parse(t)),JSON.parse(t)}return null}catch(t){return ji("parse json error:",t),e}},Ki=(e,t,i,o,r,a)=>n(void 0,void 0,void 0,(function*(){const n=new URL(location.href),s=new URLSearchParams;let l=`${n.pathname}${n.search}`;a&&(l=`/zapps/${e}${"/"===a[0]?"":"/"}${a}`);const c=new URL(`https://zalo.me/app/link${l}`);s.append("title",i),s.append("description",o||""),s.append("thumbnail",r),s.append("url",c.href),s.append("accessToken",t||"");const u=yield fetch("https://h5.zalo.me/openapi/create-sharelink",Object.assign({method:"POST",body:s},{headers:{"Content-Type":"application/x-www-form-urlencoded"}})),d=yield u.json();if(!d||0!==d.err)throw Ci.cannotGetShareInfo();return c.search=`${c.search}&zshareId=${d.data.shareId}`,Object.assign(Object.assign({},d.data),{shareableLink:c.href})})),qi=(e,t)=>i=>{if(!(Array.isArray(e)?e.some((e=>Fi(i,e))):Fi(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(Gt.isNumber(null==t?void 0:t.maxLength))return{error:Gt.isString(i)&&i.length>(null==t?void 0:t.maxLength),errorMessage:`data length must <= ${null==t?void 0:t.maxLength}`};if(Gt.isNumber(null==t?void 0:t.min)&&Gt.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(Gt.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(Gt.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(Gt.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};Gt.isUndefined(i)||(n.currentVersion=i);const o=ki.appendToUrl(`https://h5.zalo.me/${fi}`,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=p((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),l=i?i+t:t;return e._events[l]?e._events[l].fn?e._events[l]=[e._events[l],s]:e._events[l].push(s):(e._events[l]=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 l,c,u=this._events[s],d=arguments.length;if(u.fn){switch(u.once&&this.removeListener(e,u.fn,void 0,!0),d){case 1:return u.fn.call(u.context),!0;case 2:return u.fn.call(u.context,t),!0;case 3:return u.fn.call(u.context,t,n),!0;case 4:return u.fn.call(u.context,t,n,o),!0;case 5:return u.fn.call(u.context,t,n,o,r),!0;case 6:return u.fn.call(u.context,t,n,o,r,a),!0}for(c=1,l=new Array(d-1);c<d;c++)l[c-1]=arguments[c];u.fn.apply(u.context,l)}else{var p,h=u.length;for(c=0;c<h;c++)switch(u[c].once&&this.removeListener(e,u[c].fn,void 0,!0),d){case 1:u[c].fn.call(u[c].context);break;case 2:u[c].fn.call(u[c].context,t);break;case 3:u[c].fn.call(u[c].context,t,n);break;case 4:u[c].fn.call(u[c].context,t,n,o);break;default:if(!l)for(p=1,l=new Array(d-1);p<d;p++)l[p-1]=arguments[p];u[c].fn.apply(u[c].context,l)}}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 l=0,c=[],u=s.length;l<u;l++)(s[l].fn!==t||o&&!s[l].once||n&&s[l].context!==n)&&c.push(s[l]);c.length?this._events[r]=1===c.length?c[0]:c: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 Xi extends Yi{constructor(){super(),this.debug=Ht("zmp:event-emitter")}static getInstance(){return Xi.instance||(Xi.instance=new Xi),Xi.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 en={},tn=function(e,t,i){var n=t||"default";return function(){var t=n in en?en[n](e,i):e;return t.apply(this,arguments)}};tn.setWrapper=function(e){var t=arguments.length<=1||void 0===arguments[1]?"default":arguments[1];en[t]=e};var nn={error:{code:1,error_subcode:1357046,message:"Received Invalid JSON reply.",type:"http"}};function on(e){try{return null===e?nn:JSON.parse(e)}catch(e){return nn}}var rn,an={execute:function(e,t,i,n){i.suppress_http_code=1;var o=ki.encode(i);"post"!=t&&(e=ki.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=tn((function(){r=n,"onload"in o&&o.onload(i)}),"entry","XMLHttpRequest:load"),a=tn((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(on(e.responseText))},r.onerror=function(e){e.responseText?n(on(e.responseText)):n({error:{code:1,error_subcode:1357045,message:"unknown error (empty response)",status:e.status,type:"http"}})},r.send(o),!0)}};class sn extends Yi{constructor(){super(),this.debug=Ht("zmp:ZaloJSBridge"),this.events=Xi.getInstance(),this._accessTk=Gi("zacc_session")||"DEFAULT_ACCESS_TOKEN",this._jsAccessTk=Gi("zlink3rd")||"DEFAULT_JS_TOKEN",this.results=[],this._userAgent=Li(),this._device=Ui(),this._jsCallFuncCallbacks={},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)}static getInstance(){return sn.instance||(sn.instance=new sn),sn.instance}set accessTk(e){this._accessTk=e}set jsAccessTk(e){this._jsAccessTk=e}sendLogData(e){try{an.execute("https://h5.zalo.me/log/async","post",{appId:window.APP_ID,data:JSON.stringify(e)},(e=>{}))}catch(e){}}onJSCall(e,t){try{this.debug("onJSCall",e,t);const i=Hi(t);if(this._jsCallFuncCallbacks[e]){const t=this._jsCallFuncCallbacks[e].callback,n=this._jsCallFuncCallbacks[e].timeout;if(t){try{t.call(this,i)}catch(e){console.error("Call callback error",e)}n&&clearTimeout(n),this._jsCallFuncCallbacks[e]=null,delete this._jsCallFuncCallbacks[e]}}this.results.push({action:i.action,error:i.error_code})}catch(e){console.log("onJSCall","error",e)}}onMultiJSCall(e,t){try{this.debug("onMultiJSCall",e,t);const i=Hi(t);if(this._jsCallFuncCallbacks[e]){const t=this._jsCallFuncCallbacks[e].callback,n=this._jsCallFuncCallbacks[e].timeout;if(t){try{t.call(this,i)}catch(e){console.error("Call callback error",e)}n&&clearTimeout(n)}}this.results.push({action:i.action,error:i.error_code})}catch(e){console.log("onMultiJSCall","error",e)}}nativeEventHandler(e,t,i){this.debug(`eventId: ${e}, eventName: ${t}, eventData: ${i}`);const n=Ji(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/${qt}`)[1];return{path:`${o||"/"}${n.search}`};default:return i}}catch(e){return i}}defaultCallback(e){null!=e&&(e=Hi(e))}jsCall(e,t,i,n=!1,o=3,r=!0){try{const a=e.name,s=((e="")=>`${e.normalize("NFD").replace(Ri,"").replace(Bi,"d").replace(Di,"").toLowerCase()}_${Math.random().toString(36).substr(2,4)}`)(a);if(!this._device.isMobile||Gt.isEmpty(a))return this.onJSCall(s,{error_code:-13,error_message:"params invalid!",data:{device:this._device.isMobile,jsToken:this._jsAccessTk,access_token:this._accessTk},action:a}),!1;null==t&&(t={}),i||(i=this.defaultCallback);const l={error_code:-14,error_message:"Request Timeout!",data:{},action:a};this._jsCallFuncCallbacks[s]={timeout:r&&e.have_callback&&setTimeout((()=>{this.onJSCall(s,l)}),8e3),callback:i};try{return t=$i(t),n?this._device.isIOS?ZaloJavaScriptInterface.jsCall(this._jsAccessTk,a,this._accessTk,t,window.onMultiJSCall(s)):ZaloJavaScriptInterface.jsCall(this._jsAccessTk,a,this._accessTk,t,`window.onMultiJSCall('${s}')`):this._device.isIOS?ZaloJavaScriptInterface.jsCall(this._jsAccessTk,a,this._accessTk,t,window.onJSCall(s)):ZaloJavaScriptInterface.jsCall(this._jsAccessTk,a,this._accessTk,t,`window.onJSCall('${s}')`)}catch(r){if(!(o-- >0)){const e={error_code:-5,error_message:"Not ready!",data:{userAgent:this._userAgent,options:t,jsToken:this._jsAccessTk,access_token:this._accessTk},action:a,js_error:r};return this.onJSCall(s,e),!1}setTimeout((()=>{this.jsCall(e,t,i,n,o)}),500)}}catch(e){console.log("jsCall","error",e)}return!1}}class ln{constructor(){this.debug=Ht("zmp:ZJSBridgeProvider"),rn.set(this,void 0),r(this,rn,sn.getInstance(),"f")}setZAccSession(e){o(this,rn,"f").accessTk=e}setJSToken(e){o(this,rn,"f").jsAccessTk=e}callNative(e,t,i){return this.debug(e.name,t),new Promise(((r,a)=>{const s=o=>n(this,void 0,void 0,(function*(){try{const n=new bi(o.error_code,`${o.action}: ${o.error_message}`);if(null==i?void 0:i.callback){const e=yield i.callback(o,n);return r(e)}if(o&&o.error_code>=0)r(o.data||{});else if(o&&o.error_code<0){try{window.zmpSentry&&window.zmpSentry.captureMessage(`${e.name}: call native fail`,{extra:{data:t,rs:o}})}catch(e){}return a(n)}}catch(e){return a(e)}})),l=Ui().isIOS,c=(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(l&&!c){const t=new bi(-5,`${e}: Client isn't support this action`);return a(t)}(null==i?void 0:i.delay)?setTimeout((()=>{o(this,rn,"f").jsCall(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,rn,"f").jsCall(e,t,s,null==i?void 0:i.isMultiCallback,null==i?void 0:i.nRetry,null==i?void 0:i.haveTimeout)}))}}rn=new WeakMap;var cn,un,dn,pn,hn,vn="2.19.0-rc.2";class fn{static getVersion(){return vn}static getSystemInfo(){return{version:Wi("version-id")||"",apiVersion:vn,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 mn{static setNavigationBarTitle(e){return n(this,void 0,void 0,(function*(){yield this.callNative(si.CHANGE_TITLE_HEADER,{title:e.title},{haveTimeout:!1})}))}static setNavigationBarColor(e){return n(this,void 0,void 0,(function*(){const t={};let i;Gt.isEmpty(e.textColor)||(t.textColor=e.textColor),Gt.isString(e.color)&&e.color.length>0?(Gt.isEmpty(e.color)||(t.backgroundColor=e.color),i=5):(Gt.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.callNative(si.CHANGE_ACTIONBAR,Object.assign({},this.getActionBarConfig()),{haveTimeout:!1})}))}static setNavigationBarLeftButton(e){return n(this,void 0,void 0,(function*(){const t="none"===e.type||"home"===e.type?_i:yi,i="home"===e.type||"both"===e.type?Ei:Ai;this.setActionBarConfig((e=>Object.assign(Object.assign({},e),{buttonType:t,dataConfig:Object.assign(Object.assign({},e.dataConfig),{viewInLeftType:t}),homeConfig:Object.assign(Object.assign({},e.homeConfig),{enable:i})}))),yield this.callNative(si.CHANGE_ACTIONBAR_LEFTBUTTON_TYPE,Object.assign({},this.getActionBarConfig()),{haveTimeout:!1})}))}static setNavigationBarRightButton(e){return n(this,void 0,void 0,(function*(){yield this.callNative(si.CREATE_OPTIONS_MENU,{supportToolBar:e.supportToolBar,reset:e.reset,menuListItems:e.menuListItems,zapp:this.getAppId()})}))}}class gn{static setBackgroundColor(e){return n(this,void 0,void 0,(function*(){Gt.isString(e.backgroundColor)&&e.backgroundColor.length>0&&(yield this.callNative(si.CHANGE_ACTIONBAR,{actionbarType:this.isShowNavBar?5:6,dataConfig:{backgroundColor:e.backgroundColor,textColor:e.textColor}}))}))}}class yn{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(" ")}}cn=new WeakMap,un=new WeakMap,dn=new WeakMap,pn=new WeakMap,hn=new WeakMap;const _n=new class{constructor(){cn.set(this,3),un.set(this,["none","error","warn","info"]),dn.set(this,"[zmp] > "),pn.set(this,{error:0,warn:0,info:0,firstError:null,lastError:null}),hn.set(this,((e,t,i)=>{o(this,pn,"f")[o(this,un,"f")[e]]++;const n=o(this,un,"f")[e];if(r(this,dn,o(this,dn,"f")+("string"!=typeof t?new yn(t,n,e,i).toString():t),"f"),!(e>o(this,cn,"f")))switch(e){case 1:console.error(o(this,dn,"f"));break;case 2:console.warn(o(this,dn,"f"));break;case 3:console.info(o(this,dn,"f"));break;default:throw new Error("internal")}}))}setLogLevel(e){r(this,cn,e,"f")}info(e){o(this,hn,"f").call(this,3,e)}warn(e,t){o(this,hn,"f").call(this,2,e,t)}error(e,t){o(this,hn,"f").call(this,1,e,t)}getMetrics(){return o(this,pn,"f")}};class En{static setDeviceOrientation(t){return n(this,void 0,void 0,(function*(){yield this.callNative(si.CHANGE_AUTOROTATE,{autoRotate:e.OrientationType[t.rotate]})}))}static getNetworkType(t){return n(this,void 0,void 0,(function*(){return yield this.callNative(si.WEBVIEW_NETWORKTYPE,{url:window.location.href,featureId:""}).then((t=>{const i=t.network;let n;const o=Ui().isAndroid;switch(i){case ai(o).NONE:n=e.NetworkType.none;break;case ai(o).WIFI:n=e.NetworkType.wifi;break;case ai(o)["2G"]:case ai(o)["3G"]:case ai(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=>{_n.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:Gt.isNumber(null==e?void 0:e.scanningType)?e.scanningType:0,data:{scan_from_source:Gt.isString(null==e?void 0:e.scanFromSource)?e.scanFromSource:"",expire:Gt.isNumber(null==e?void 0:e.expire)?e.expire:3e3,monitor_interval:Gt.isNumber(null==e?void 0:e.monitorInterval)?e.monitorInterval:60,domain:Gt.isString(null==e?void 0:e.domain)?e.domain:"",scan_config:{scan_time:Gt.isNumber(null===(t=null==e?void 0:e.scanConfig)||void 0===t?void 0:t.scanTime)?e.scanConfig.scanTime:15e3,time_between_scan:Gt.isNumber(null===(i=null==e?void 0:e.scanConfig)||void 0===i?void 0:i.timeBetweenScan)?e.scanConfig.timeBetweenScan:1e4,beacon_timeout:Gt.isNumber(null===(o=null==e?void 0:e.scanConfig)||void 0===o?void 0:o.beaconTimeout)?e.scanConfig.beaconTimeout:3e4,delayCheckConnectedTimeout:Gt.isNumber(null===(r=null==e?void 0:e.scanConfig)||void 0===r?void 0:r.delayCheckConnectedTimeout)?e.scanConfig.delayCheckConnectedTimeout:5e3,beaconConnectedTimeout:Gt.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.callNative(si.SCAN_IBEACON,Object.assign({},n)),!0}))}static stopBeaconDiscovery(e){return n(this,void 0,void 0,(function*(){return yield this.callNative(si.SCAN_IBEACON,Object.assign({},{subaction:2})),!0}))}static getBeacons(e){return n(this,void 0,void 0,(function*(){return yield this.callNative(si.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.callNative({name:""},{})}))}static startBluetoothDevicesDiscovery(e){return n(this,void 0,void 0,(function*(){return this.callNative({name:""},Object.assign({},e))}))}static openBluetoothAdapter(){return n(this,void 0,void 0,(function*(){return this.callNative({name:""},{})}))}static onBluetoothDeviceFound(){return n(this,void 0,void 0,(function*(){return this.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.callNative({name:""},t)}))}static getBluetoothDevices(){return n(this,void 0,void 0,(function*(){return this.callNative({name:""},{})}))}static getBluetoothAdapterState(){return n(this,void 0,void 0,(function*(){return this.callNative({name:""},{})}))}static closeBluetoothAdapter(){return n(this,void 0,void 0,(function*(){return this.callNative({name:""},{})}))}static scanQRCode(e){return n(this,void 0,void 0,(function*(){return yield this.callNative(si.OPEN_QR,{skipOpenLink:!0})}))}static showToast(e){return n(this,void 0,void 0,(function*(){yield this.callNative(si.SHOW_TOAST,{toast:e.message})}))}static hideKeyboard(e){return n(this,void 0,void 0,(function*(){yield this.callNative(si.HIDE_KEYBOARD,{})}))}static openPhone(e){return n(this,void 0,void 0,(function*(){yield this.callNative(si.OPEN_PHONE,{phoneNum:e.phoneNumber,phoneCode:e.phoneNumber})}))}static openSMS(e){return n(this,void 0,void 0,(function*(){yield this.callNative(si.OPEN_SMS,{content:e.content,phoneCode:e.phoneNumber})}))}static keepScreen(e){return n(this,void 0,void 0,(function*(){return yield this.callNative(si.KEEP_SCREEN,{data:{keep_screen_on:e.keepScreenOn?1:0}})}))}static openBioAuthentication(e){return n(this,void 0,void 0,(function*(){return yield this.callNative(si.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.callNative(si.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.callNative(si.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 Gt.isString(e.password)&&e.password.length>0&&(t="wpa_wpa2"),yield this.callNative(si.MP_JOIN_WIFI,{ssid:e.SSID,securityType:t,password:e.password,hiddenSsid:e.hiddenSSID})}))}}var An,Sn,On,Tn,bn,wn,Nn,Pn,In,Cn,kn,Rn,Bn,Dn,jn,Mn,Ln,Un,Wn,xn,zn,Fn,Gn,Hn,$n,Vn,Zn,Jn;class Kn{constructor(e){An.set(this,localStorage),Sn.set(this,void 0),On.set(this,void 0),Ui(),r(this,On,{keys:new Set,currentSize:0,limitSize:ri},"f"),r(this,Sn,e,"f"),this.findAllCurrentDataByApp(e)}findAllCurrentDataByApp(e){try{let t;for(t in o(this,An,"f")){if(e){if(t.split("_")[0]!==e)continue}o(this,On,"f").keys.add(t)}}catch(e){_n.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,Sn,"f")&&(e=`${o(this,Sn,"f")}_${e}`),o(this,On,"f").keys.has(e)?o(this,An,"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,Sn,"f")&&(e=`${o(this,Sn,"f")}_${e}`),o(this,An,"f").setItem(e,t),o(this,On,"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,An,"f"),o(this,Sn,"f"));return{currentSize:Gt.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,Sn,"f")&&(e=`${o(this,Sn,"f")}_${e}`),o(this,On,"f").keys.has(e)&&(o(this,An,"f").removeItem(e),o(this,On,"f").keys.delete(e))}clear(){return n(this,void 0,void 0,(function*(){return Promise.resolve(this.clearSync())}))}clearSync(){o(this,On,"f").keys.forEach((e=>{o(this,Sn,"f")&&e.indexOf(o(this,Sn,"f"))<0||(o(this,An,"f").removeItem(e),o(this,On,"f").keys.delete(e))}))}}An=new WeakMap,Sn=new WeakMap,On=new WeakMap;class qn extends ln{constructor(e){super(),Tn.set(this,void 0),bn.set(this,void 0),r(this,bn,{keys:new Set,currentSize:0,limitSize:ri},"f"),r(this,Tn,e,"f")}get(e){return n(this,void 0,void 0,(function*(){return yield this.callNative(si.ZBROWSER_MPDS,{mpds_action:"mpds.get",mpds_data:{keys:e},appId:o(this,Tn,"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 this.callNative(si.ZBROWSER_MPDS,{mpds_action:"mpds.set",mpds_data:{map:e},appId:o(this,Tn,"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 this.callNative(si.ZBROWSER_MPDS,{mpds_action:"mpds.get.size",mpds_data:{},appId:o(this,Tn,"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:Gt.isNumber(e)?Number(e/1024):0,limitSize:Number(5120)}}))}remove(e){return n(this,void 0,void 0,(function*(){return{errorKeys:yield this.callNative(si.ZBROWSER_MPDS,{mpds_action:"mpds.remove.key",mpds_data:{keys:e},appId:o(this,Tn,"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 this.callNative(si.ZBROWSER_MPDS,{mpds_action:"mpds.clear.appData",mpds_data:{},appId:o(this,Tn,"f")})}))}}Tn=new WeakMap,bn=new WeakMap;class Qn{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]=Ji(e)})),n}))}putDataToStorage(e){return n(this,void 0,void 0,(function*(){const t=this.getInstance(),i={};return Object.entries(e).forEach((([e,t])=>{Gt.isUndefined(t)||Gt.isNull(t)||(i[e]=Zi(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 Yn extends Qn{constructor(e){super(),wn.set(this,void 0),r(this,wn,e,"f")}getInstance(){return new Kn(o(this,wn,"f"))}}wn=new WeakMap;class Xn extends Qn{constructor(e){super(),Nn.set(this,void 0),r(this,Nn,e,"f")}getInstance(){return new qn(o(this,Nn,"f"))}}Nn=new WeakMap;class eo{static setStorage(e){return n(this,void 0,void 0,(function*(){let t=new Yn(this.getAppId());return Vi()&&(t=new Xn(this.getAppId())),yield t.putDataToStorage(e.data)}))}static getStorage(e){return n(this,void 0,void 0,(function*(){let t=new Yn(this.getAppId());Vi()&&(t=new Xn(this.getAppId()));return yield t.getDataFromStorage(e.keys)}))}static getStorageInfo(e){return n(this,void 0,void 0,(function*(){let e=new Yn(this.getAppId());return Vi()&&(e=new Xn(this.getAppId())),yield e.getStorageInfo()}))}static removeStorage(e){return n(this,void 0,void 0,(function*(){let t=new Yn(this.getAppId());return Vi()&&(t=new Xn(this.getAppId())),yield t.removeDataFromStorage(e.keys)}))}static clearStorage(e={}){return n(this,void 0,void 0,(function*(){let e=new Yn(this.getAppId());Vi()&&(e=new Xn(this.getAppId())),yield e.clearStorage()}))}}class to{static getUserInfo(e){return n(this,void 0,void 0,(function*(){const t=yield this.getAccessToken();let i="id,name,picture";(null==e?void 0:e.avatarType)&&(i=`${i}.type(${null==e?void 0:e.avatarType})`);return{userInfo:yield fetch(`${ti}?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,birthday:"",gender:"",avatar:t.picture&&t.picture.data&&t.picture.data.url};return console.warn("'birthday' and 'gender' are deprecated"),i}))))}}))}static getPhoneNumber(e){return n(this,void 0,void 0,(function*(){return yield this.callNative(si.MP_GET_NUMBER,{},{isMultiCallback:!0,callback:(e,t)=>{if(0===e.error_code){const t={number:e.data};return Promise.resolve(t)}return Promise.reject(t)},delay:this.isIOS?400:0})}))}}class io{static closeApp(e){return n(this,void 0,void 0,(function*(){yield this.callNative(si.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("&"),o=yield Qi(t,0);yield this.callNative(si.OPEN_MP,{mpUrl:`https://h5.zdn.vn/zapps/${t}/${n.length>0?"?"+n:""}`,mpInfo:{appId:t,appAvtUrl:o.logoUrl||"",appName:o.name||""}})}))}static openWebview(e){return n(this,void 0,void 0,(function*(){yield this.callNative(si.OPEN_INAPP,{url:e.url})}))}static closeLoading(e){return n(this,void 0,void 0,(function*(){yield this.callNative(si.MP_CLOSE_LOADINGVIEW,{at:(new Date).getTime(),when:e,url:location.href})}))}}class no{static getLocation(e){return n(this,void 0,void 0,(function*(){return yield this.callNative(si.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,callback:(e,t)=>{if(0===e.error_code){const t=e.data,i={latitude:t.latitude,longitude:t.longitude,timestamp:t.timestamp,provider:t.provider};return Promise.resolve(i)}return Promise.reject(t)},delay:this.isIOS?400:0})}))}static sendLocation(e){return n(this,void 0,void 0,(function*(){yield this.callNative(si.QUERY_LOCATION_HIDE,{title:e.title,touserid:e.toUserId,zapp:this.getZAppId()})}))}}class oo{static requestCameraPermission(e){return n(this,void 0,void 0,(function*(){return yield this.callNative(si.REQUEST_PERMISSION_CAMERA,{},{callback:(e,t)=>-2===e.error_code||e.error_code>=0?Promise.resolve({userAllow:-2!==e.error_code,message:e.error_message}):Promise.reject(t)})}))}static saveImageToPhotosAlbum(e){return n(this,void 0,void 0,(function*(){let t={};return Gt.isEmpty(e.imageBase64Data)?Gt.isEmpty(e.imageUrl)||(t={imageUrl:e.imageUrl}):t={imageBase64Data:e.imageBase64Data},yield this.callNative(si.SAVE_IMAGE_GALLERY,Object.assign({},t))}))}}class ro{static viewOAQr(e){return n(this,void 0,void 0,(function*(){yield this.callNative(si.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.callNative(si.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.callNative(si.OPEN_CHAT,{uId:t.id,type:e.ChatType[t.type],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.callNative(si.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.callNative(si.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.callNative(si.UNFOLLOW_OA,{uid:e.id,zapp:this.getZAppId()},{haveTimeout:!1})}))}static openShareSheet(t){return n(this,void 0,void 0,(function*(){let i={};switch(t.type){case"image":let e=[];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 n=yield this.getAccessToken(),o=yield Ki(this.getAppId(),n||"",t.data.title||"",t.data.description||"",t.data.thumbnail||"",t.data.path);window.forceShareZMP?i={data:{ZInstantAPIInfo:{url:`${o.zinstantApi}`,zinstantdata_id:`templateId=11412&appId=${this.getAppId()}&shareId=${o.shareId}`},previewMsgText:{msg:{en:"Mini App",vi:"Chương trình nhỏ"}},enableReactions:1}}:(i={link:o.shareableLink,chatOnly:t.data.chatOnly?1:0},t.type="link")}return yield this.callNative(si.OPEN_SHARESHEET,Object.assign(Object.assign({type:e.ShareSheetType[t.type]},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.callNative(si.CREATE_SHORTCUT,{url:e,title:t,iconUrl:i})}))}static openProfilePicker(e){return n(this,void 0,void 0,(function*(){return yield this.callNative(si.MP_OPEN_PROFILE_PICKER,{maxProfile:e},{isMultiCallback:!0,callback:(e,t)=>0===e.error_code&&Array.isArray(e.data)?Promise.resolve(e.data.map((e=>e.id))):Promise.reject(t)})}))}static getActionsSupported(t){return n(this,void 0,void 0,(function*(){return yield this.callNative(si.GET_SUPPORTED_ACTIONS,{},{isMultiCallback:!1,callback:(t,i)=>{const n=zi();if(Array.isArray(t.actions)&&t.actions.length>0){const e=Object.keys(si).filter((e=>si[e].skip_jump)),i={actions:[...t.actions,...e]};return Promise.resolve(i)}if(n===e.PlatformType.iOS){const e={actions:gi};return Promise.resolve(e)}return Promise.reject(i)}})}))}static openMediaPicker(t,i,o,r){return n(this,void 0,void 0,(function*(){const n={type:0,url:"https://zapi-server.tungnt.xyz/upload/photos",maxSize:1048576};return yield this.callNative(si.PICK_MEDIA,{media_type:e.MediaPickerType[t],edit_view:Object.assign(Object.assign({},{enable:1,aspect_ratio:"1:1"}),i),silent_request:o,upload:n,max_select_item:r},{isMultiCallback:!0,callback:(e,t)=>{var i,n;if(0===e.error_code){const t=Ji(null===(i=e.data)||void 0===i?void 0:i.result_content),o={urls:null===(n=null==t?void 0:t.data)||void 0===n?void 0:n.urls};return Promise.resolve(o)}return Promise.reject(t)}})}))}static openOutApp(e){return n(this,void 0,void 0,(function*(){return yield this.callNative(si.OPEN_OUTAPP,{url:e})}))}}class ao{static getRouteParams(){let e={};const t=window.location.href;try{let i=new URL(t).searchParams.toString();i&&(e=ki.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.callNative(si.WEBVIEW_SET_RESULT,{result:Zi(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 so extends ln{constructor(){var e,t,i,n,a,s,l,c,u,d,p,h,v,f,m,g,y;super(),Pn.set(this,Kt),In.set(this,qt),Cn.set(this,Qt),kn.set(this,void 0),Rn.set(this,void 0),Bn.set(this,void 0),Dn.set(this,null),jn.set(this,{timer:{getToken:0}}),Mn.set(this,void 0),Ln.set(this,void 0),Un.set(this,null),this.events=Xi.getInstance(),this.isIOS=Ui().isIOS,Wn.set(this,void 0),this.getActionBarConfig=()=>o(this,Wn,"f"),this.setActionBarConfig=e=>{r(this,Wn,e(o(this,Wn,"f")),"f")},xn.set(this,(()=>new Promise(((e,t)=>{Gt.isUndefined(o(this,Un,"f"))||Gt.isNull(o(this,Un,"f"))?this.callNative(si.JUMP_LOGIN,{}).then((t=>{const i=t&&t.cookiesOAuthLogins||[],n=i.find((e=>e.name===Xt));n&&(this.setJSToken(n.value),window.ZJSBridge.setJSToken&&window.ZJSBridge.setJSToken(n.value)),r(this,Un,i,"f"),e(i)})).catch((e=>{t(e)})):e(o(this,Un,"f"))})))),zn.set(this,mn.setNavigationBarRightButton),this.getVersion=fn.getVersion,this.getSystemInfo=fn.getSystemInfo,this.setNavigationBarTitle=mn.setNavigationBarTitle,this.setNavigationBarColor=mn.setNavigationBarColor,this.setNavigationBarLeftButton=mn.setNavigationBarLeftButton,this.setBackgroundColor=gn.setBackgroundColor,this.setDeviceOrientation=En.setDeviceOrientation,this.setStorage=eo.setStorage,this.getStorage=eo.getStorage,this.getStorageInfo=eo.getStorageInfo,this.removeStorage=eo.removeStorage,this.clearStorage=eo.clearStorage,this.getUserInfo=to.getUserInfo,this.getNetworkType=En.getNetworkType,this.onNetworkStatusChange=En.onNetworkStatusChange,this.startBeaconDiscovery=En.startBeaconDiscovery,this.stopBeaconDiscovery=En.stopBeaconDiscovery,this.getBeacons=En.getBeacons,this.closeApp=io.closeApp,this.getLocation=no.getLocation,this.stopBluetoothDevicesDiscovery=En.stopBluetoothDevicesDiscovery,this.startBluetoothDevicesDiscovery=En.stopBluetoothDevicesDiscovery,this.openBluetoothAdapter=En.openBluetoothAdapter,this.onBluetoothDeviceFound=En.onBluetoothDeviceFound,this.onBluetoothAdapterStateChange=En.onBluetoothAdapterStateChange,this.getConnectedBluetoothDevices=En.getConnectedBluetoothDevices,this.getBluetoothDevices=En.getBluetoothDevices,this.getBluetoothAdapterState=En.getBluetoothAdapterState,this.closeBluetoothAdapter=En.closeBluetoothAdapter,this.scanQRCode=En.scanQRCode,this.openProfile=ro.openProfile,this.openChat=ro.openChat,this.openPostFeed=ro.openPostFeed,this.followOA=ro.followOA,this.unFollowOA=ro.unfollowOA,this.openShareSheet=ro.openShareSheet,this.requestCameraPermission=oo.requestCameraPermission,this.createShortcut=ro.createShortcut,this.openBioAuthentication=En.openBioAuthentication,this.checkStateBioAuthentication=En.checkStateBioAuthentication,this.sendLocation=no.sendLocation,this.showToast=En.showToast,this.hideKeyboard=En.hideKeyboard,this.openPhone=En.openPhone,this.openSMS=En.openSMS,this.viewOAQr=ro.viewOAQr,this.keepScreen=En.keepScreen,this.saveImageToPhotosAlbum=oo.saveImageToPhotosAlbum,this.openMiniApp=io.openMiniApp,this.vibrate=En.vibrate,this.openWebview=io.openWebview,this.getRouteParams=ao.getRouteParams,this.getAppInfo=fn.getAppInfo,this.sendDataToPreviousMiniApp=ao.sendDataToPreviousMiniApp,this.onCallbackData=ao.onCallbackData,this.getPhoneNumber=to.getPhoneNumber,this.openProfilePicker=ro.openProfilePicker,Fn.set(this,ro.getActionsSupported),this.connectWifi=En.connectWifi,this.openMediaPicker=ro.openMediaPicker,this.openOutApp=ro.openOutApp,this.closeLoading=io.closeLoading,r(this,kn,null,"f"),r(this,Rn,null,"f"),r(this,Bn,null,"f"),this.isShowNavBar=!0,r(this,Mn,0,"f"),r(this,Ln,0,"f");const _="home"===(null===(t=null===(e=o(this,Cn,"f"))||void 0===e?void 0:e.app)||void 0===t?void 0:t.leftButton)||"both"===(null===(n=null===(i=o(this,Cn,"f"))||void 0===i?void 0:i.app)||void 0===n?void 0:n.leftButton)?Ei:Ai,E=new URL(location.href),A=Gt.isString(null===(s=null===(a=o(this,Cn,"f"))||void 0===a?void 0:a.app)||void 0===s?void 0:s.headerColor)&&(null===(u=null===(c=null===(l=o(this,Cn,"f"))||void 0===l?void 0:l.app)||void 0===c?void 0:c.headerColor)||void 0===u?void 0:u.length)>0?5:6,S="none"===(null===(p=null===(d=o(this,Cn,"f"))||void 0===d?void 0:d.app)||void 0===p?void 0:p.leftButton)||"home"===(null===(v=null===(h=o(this,Cn,"f"))||void 0===h?void 0:h.app)||void 0===v?void 0:v.leftButton)?_i:yi;r(this,Wn,{actionbarType:A,buttonType:S,dataConfig:{backgroundColor:(null===(m=null===(f=o(this,Cn,"f"))||void 0===f?void 0:f.app)||void 0===m?void 0:m.headerColor)||"",textColor:(null===(y=null===(g=o(this,Cn,"f"))||void 0===g?void 0:g.app)||void 0===y?void 0:y.textColor)||"",viewInLeftType:S,confirmToExit:1},homeConfig:{enable:_,url:`https://h5.zdn.vn/zapps/${this.getAppId()}/${E.search}`}},"f")}static getInstance(){return so.instance||(so.instance=new so),so.instance}getLoginStatus(){return Gt.isString(o(this,Bn,"f"))&&o(this,Bn,"f").length>0}getAppId(){return o(this,In,"f")}getZAppId(){return o(this,Pn,"f")}login(e){return n(this,void 0,void 0,(function*(){const e=yield o(this,xn,"f").call(this),t=e.find((e=>e.name===Yt)),i=e.find((e=>e.name===ei));if(!Gt.isUndefined(t)&&!Gt.isNull(t)&&Gt.isString(t.value)){if(r(this,kn,t.value,"f"),Gt.isUndefined(i)||Gt.isNull(i)||!Gt.isString(i.value)?yield this.loginZaloV3():(r(this,Rn,i.value,"f"),yield this.loginZaloV4()),!o(this,Bn,"f"))throw Ci.loginFailed();return o(this,Bn,"f")}throw Ci.loginFailed()}))}loginZaloV3(){return n(this,void 0,void 0,(function*(){return yield fetch(`${ni}?app_id=${o(this,Pn,"f")}&redirect_uri=https://h5.zdn.vn/zapps/${o(this,In,"f")}/&code=${o(this,kn,"f")}&isSDK=true123`).then((e=>n(this,void 0,void 0,(function*(){let t=yield e.json();if(t.access_token){r(this,Bn,t.access_token,"f");const e=1e3*parseInt(t.expires_in);return r(this,Ln,e,"f"),r(this,Mn,(new Date).getTime(),"f"),this.setZAccSession(o(this,Bn,"f")||""),window.ZJSBridge.setZAccSession&&window.ZJSBridge.setZAccSession(o(this,Bn,"f")||""),o(this,Bn,"f")}return null}))))}))}loginZaloV4(){return n(this,void 0,void 0,(function*(){const e=new URLSearchParams;e.append("app_id",o(this,In,"f")),e.append("code",o(this,kn,"f")||""),e.append("code_verifier",o(this,Rn,"f")||""),Gt.isNull(o(this,Dn,"f"))?e.append("grant_type","authorization_code"):(e.append("grant_type","refresh_token"),e.append("refresh_token",o(this,Dn,"f")||""));return yield fetch(ii,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,Dn,t.refresh_token,"f"),t.access_token){r(this,Bn,t.access_token,"f");const e=1e3*parseInt(t.expires_in);return r(this,Ln,e,"f"),r(this,Mn,(new Date).getTime(),"f"),this.setZAccSession(o(this,Bn,"f")||""),window.ZJSBridge.setZAccSession&&window.ZJSBridge.setZAccSession(o(this,Bn,"f")||""),o(this,Bn,"f")}return null}))))}))}getAccessToken(e){return n(this,void 0,void 0,(function*(){const e=(new Date).getTime()-o(this,Mn,"f");if(!o(this,Bn,"f"))throw Ci.loginRequired();return e<o(this,Ln,"f")?o(this,Bn,"f"):yield this.login()}))}}Pn=new WeakMap,In=new WeakMap,Cn=new WeakMap,kn=new WeakMap,Rn=new WeakMap,Bn=new WeakMap,Dn=new WeakMap,jn=new WeakMap,Mn=new WeakMap,Ln=new WeakMap,Un=new WeakMap,Wn=new WeakMap,xn=new WeakMap,zn=new WeakMap,Fn=new WeakMap;class lo{constructor(){Gn.set(this,Kt),Hn.set(this,Qt),$n.set(this,"DEFAULT ZOAUTH"),Vn.set(this,"DEFAULT ACCESS TOKEN"),Zn.set(this,{timer:{getToken:0}}),Jn.set(this,!1),this.getLoginStatus=()=>o(this,Jn,"f"),this.getAppId=()=>o(this,Gn,"f"),this.login=()=>(r(this,Jn,!0,"f"),Promise.resolve(o(this,$n,"f"))),this.getAccessToken=()=>Promise.resolve(o(this,Vn,"f")),this.getVersion=fn.getVersion,this.getSystemInfo=fn.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 Yn(this.getAppId());return yield t.putDataToStorage(e.data),{errorKeys:[]}})),this.getStorage=e=>n(this,void 0,void 0,(function*(){const t=new Yn(this.getAppId());return yield t.getDataFromStorage(e.keys)})),this.getStorageInfo=e=>n(this,void 0,void 0,(function*(){const e=new Yn(this.getAppId());return yield e.getStorageInfo()})),this.removeStorage=e=>n(this,void 0,void 0,(function*(){const t=new Yn(this.getAppId());return yield t.removeDataFromStorage(e.keys)})),this.clearStorage=e=>n(this,void 0,void 0,(function*(){const e=new Yn(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.url),Promise.resolve()),this.getRouteParams=ao.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()}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){return console.warn("This api only works on zalo app"),Promise.resolve({urls:[]})}createOrder(e){return Promise.resolve({orderId:""})}checkTransaction(e){return Promise.resolve({msg:"",appId:"",orderId:"",resultCode:0,transTime:0,createdAt:""})}}Gn=new WeakMap,Hn=new WeakMap,$n=new WeakMap,Vn=new WeakMap,Zn=new WeakMap,Jn=new WeakMap;const co=Symbol("required"),uo=Symbol("checkType"),po=(e,t)=>(i,n,o)=>{let r=Reflect.getOwnMetadata(co,i,n)||[];r.push({parameterIndex:o,fields:e,option:t}),Reflect.defineMetadata(co,r,i,n)},ho=(e,t,i)=>(n,o,r)=>{let a=Reflect.getOwnMetadata(uo,n,o)||[];a.push({parameterIndex:r,type:e,properties:t,defaultValue:i}),Reflect.defineMetadata(uo,a,n,o)};const vo=(e,t,i)=>{const n=i.value,o=n.toString().match(/\(.*?\)/)[0].replace(/[()]/gi,"").replace(/\s/gi,"").split(",");return i.value=function(){const i=Reflect.getOwnMetadata(co,e,t),r=Reflect.getOwnMetadata(uo,e,t);return r&&r.forEach((e=>{const{parameterIndex:t,type:i,properties:n,defaultValue:r}=e;let a=arguments[t],s=o[t];const l=typeof a;if(!Gt.isUndefined(a)){if(!Fi(a,i))throw Ci.wrongTypeParam(s,i,Array.isArray(a)?"array":null===a?"null":l);"object"===i&&Object.entries(n).forEach((([e,i])=>{const n=e.split("?")[0],o=Gt.get(a,n);if(Gt.isUndefined(o)||Gt.isNull(o)){if(!e.includes("?"))throw Ci.missingParam(e);Gt.isObject(Gt.get(a,n.split(".")[0]))&&r&&!Gt.isUndefined(Gt.get(r,n))&&Gt.set(arguments[t],n,Gt.get(r,n))}else if(Gt.isFunction(i)){const e=i(o);if(e&&e.error)throw Ci.wrongTypeParam(`${s}.${n}`,e.errorMessage,typeof o)}}))}})),i&&i.forEach((e=>{const{parameterIndex:t,option:i,fields:n}=e,o=arguments[t],r=null==i?void 0:i.if,a=null==i?void 0:i.defaultValue;let s=!0;r&&(s=Object.keys(r).every((e=>Gt.get(o,e)===r[e]))),s&&n.forEach((e=>{const i=e=>{let i=!1;return Gt.isEmpty(Gt.get(o,e))&&(Gt.isUndefined(Gt.get(a,e))||Gt.set(arguments[t],e,Gt.get(a,e)),i=!0),i};if(Array.isArray(e)&&e.length>0&&e.every(i))throw Ci.missingParam(e.join(" or "));if(Gt.isString(e)&&i(e))throw Ci.missingParam(e)}))})),n.apply(this,arguments)},i};var fo,mo,go,yo;class _o{constructor(){fo.set(this,qt)}static getInstance(){return _o.instance||(_o.instance=new _o),_o.instance}createOrder(e,t){return n(this,void 0,void 0,(function*(){const i=o(this,fo,"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 Ci.loginRequired}});r.headers.authorization=`Bearer ${o}`;const a=yield fetch(Si,Object.assign(Object.assign({method:"POST"},r),{body:n})),s=yield a.json();if(!s.data||0!==s.err)throw new Error(s.msg);const l=s.data.id,c=window.APP_VERSION,u=window.APP_ENV,d={miniAppId:i,accessToken:o||"",orderId:l};c&&(d.version=c),u&&(d.env=u),t.method&&(d.method=t.method);const p=ki.encode(d),h=new URL(`?${p}`,"https://payment-mini.zalo.me").toString();return yield e.openWebview({url:h,fail:e=>{throw e}}),{orderId:l}}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=ki.getParameterByName("orderId",n),t=ki.getParameterByName("appTransID",n)||ki.getParameterByName("apptransid",n);i=e||t}const r=new URL(Oi),a={transId:i||"",appId:o(this,fo,"f")};r.search=new URLSearchParams(a).toString();const s=yield fetch(r.toString()),l=yield s.json();if(!l.data||0!==l.err)throw new Error(l.msg);const c=l.data||{};return{msg:c.resultMessage,appId:c.appId,orderId:c.orderId,resultCode:c.resultCode,transTime:c.transTime,createdAt:c.createAt}}catch(e){throw e}}))}}fo=new WeakMap;class Eo{constructor(e){mo.set(this,void 0),go.set(this,void 0),r(this,mo,this.getInstance(),"f"),r(this,go,e,"f")}createOrder(e){return o(this,mo,"f").createOrder(o(this,go,"f"),e)}checkTransaction(e){return o(this,mo,"f").checkTransaction(o(this,go,"f"),e)}}mo=new WeakMap,go=new WeakMap,t([Ni,vo,i(0,ho("object",{amount:qi(["string","number"]),desc:qi("string"),"method?":qi("string",{values:["MOMO","ZALOPAY","MOMO_SANDBOX","ZALOPAY_SANDBOX","CC","CC_SANDBOX","ATM","ATM_SANDBOX"]})}))],Eo.prototype,"createOrder",null),t([Ni,vo],Eo.prototype,"checkTransaction",null);class Ao extends Eo{getInstance(){return _o.getInstance()}}class So{constructor(){this.events=Xi.getInstance(),yo.set(this,void 0),r(this,yo,this.getServiceInstance(),"f"),this.events.addListener=(t,i,n)=>{const o=t;return this.events.addListener(e.Events[o],i,n)},this.payment=new Ao(this)}login(e){return n(this,void 0,void 0,(function*(){return yield o(this,yo,"f").login(e)}))}getLoginStatus(){return o(this,yo,"f").getLoginStatus()}getAccessToken(e){return n(this,void 0,void 0,(function*(){return yield o(this,yo,"f").getAccessToken(e)}))}getVersion(){return o(this,yo,"f").getVersion()}getSystemInfo(){return o(this,yo,"f").getSystemInfo()}setNavigationBarTitle(e){return n(this,void 0,void 0,(function*(){return o(this,yo,"f").setNavigationBarTitle(e)}))}setNavigationBarColor(e){return n(this,void 0,void 0,(function*(){return yield o(this,yo,"f").setNavigationBarColor(e)}))}setBackgroundColor(e){return n(this,void 0,void 0,(function*(){return yield o(this,yo,"f").setBackgroundColor(e)}))}setNavigationBarLeftButton(e){return n(this,void 0,void 0,(function*(){return yield o(this,yo,"f").setNavigationBarLeftButton(e)}))}setDeviceOrientation(e){return n(this,void 0,void 0,(function*(){return yield o(this,yo,"f").setDeviceOrientation(e)}))}setStorage(e){return n(this,void 0,void 0,(function*(){return yield o(this,yo,"f").setStorage(e)}))}getStorage(e){return n(this,void 0,void 0,(function*(){return yield o(this,yo,"f").getStorage(e)}))}getStorageInfo(e){return n(this,void 0,void 0,(function*(){return yield o(this,yo,"f").getStorageInfo(e)}))}removeStorage(e){return n(this,void 0,void 0,(function*(){return yield o(this,yo,"f").removeStorage(e)}))}clearStorage(e){return n(this,void 0,void 0,(function*(){return yield o(this,yo,"f").clearStorage(e)}))}getUserInfo(e){return n(this,void 0,void 0,(function*(){return yield o(this,yo,"f").getUserInfo(e)}))}getNetworkType(e){return n(this,void 0,void 0,(function*(){return yield o(this,yo,"f").getNetworkType(e)}))}onNetworkStatusChange(e){return n(this,void 0,void 0,(function*(){return yield o(this,yo,"f").onNetworkStatusChange(e)}))}startBeaconDiscovery(e){return n(this,void 0,void 0,(function*(){return yield o(this,yo,"f").startBeaconDiscovery(e)}))}stopBeaconDiscovery(e){return n(this,void 0,void 0,(function*(){return yield o(this,yo,"f").stopBeaconDiscovery(e)}))}getBeacons(e){return n(this,void 0,void 0,(function*(){return yield o(this,yo,"f").getBeacons(e)}))}closeApp(e){return n(this,void 0,void 0,(function*(){return yield o(this,yo,"f").closeApp(e)}))}getLocation(e){return n(this,void 0,void 0,(function*(){return yield o(this,yo,"f").getLocation(e)}))}stopBluetoothDevicesDiscovery(){return n(this,void 0,void 0,(function*(){return yield o(this,yo,"f").stopBluetoothDevicesDiscovery()}))}startBluetoothDevicesDiscovery(e){return n(this,void 0,void 0,(function*(){return yield o(this,yo,"f").startBluetoothDevicesDiscovery(e)}))}openBluetoothAdapter(){return n(this,void 0,void 0,(function*(){return yield o(this,yo,"f").openBluetoothAdapter()}))}onBluetoothDeviceFound(){return n(this,void 0,void 0,(function*(){return yield o(this,yo,"f").onBluetoothDeviceFound()}))}onBluetoothAdapterStateChange(){return n(this,void 0,void 0,(function*(){return yield o(this,yo,"f").onBluetoothAdapterStateChange()}))}getConnectedBluetoothDevices(e){return n(this,void 0,void 0,(function*(){return yield o(this,yo,"f").getConnectedBluetoothDevices(e)}))}getBluetoothDevices(){return n(this,void 0,void 0,(function*(){return yield o(this,yo,"f").getBluetoothDevices()}))}getBluetoothAdapterState(){return n(this,void 0,void 0,(function*(){return yield o(this,yo,"f").getBluetoothAdapterState()}))}closeBluetoothAdapter(){return n(this,void 0,void 0,(function*(){return yield o(this,yo,"f").closeBluetoothAdapter()}))}scanQRCode(e){return n(this,void 0,void 0,(function*(){return yield o(this,yo,"f").scanQRCode(e)}))}openProfile(e){return n(this,void 0,void 0,(function*(){yield o(this,yo,"f").openProfile(e)}))}openChat(e){return n(this,void 0,void 0,(function*(){yield o(this,yo,"f").openChat(e)}))}openPostFeed(e){return n(this,void 0,void 0,(function*(){return yield o(this,yo,"f").openPostFeed(e)}))}followOA(e){return n(this,void 0,void 0,(function*(){return yield o(this,yo,"f").followOA(e)}))}unfollowOA(e){return n(this,void 0,void 0,(function*(){return yield o(this,yo,"f").unFollowOA(e)}))}openShareSheet(e){return n(this,void 0,void 0,(function*(){return yield o(this,yo,"f").openShareSheet(e)}))}requestCameraPermission(e){return n(this,void 0,void 0,(function*(){return yield o(this,yo,"f").requestCameraPermission(e)}))}createShortcut(e){return n(this,void 0,void 0,(function*(){const t=yield Qi(qt,0),i=Ui().isIOS,n=t.logoUrl||Wi("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",qt),a.append("appName",r),a.append("appIcon",n);const e=`https://mini.zalo.me/shortcut.html?${a.toString()}`;yield o(this,yo,"f").openOutApp(encodeURI(e))}else yield o(this,yo,"f").createShortcut(`https://zalo.me/app/link/zapps/${qt}/?${a.toString()}`,r,n);return Ii()}))}openBioAuthentication(e){return n(this,void 0,void 0,(function*(){return yield o(this,yo,"f").openBioAuthentication(e)}))}checkStateBioAuthentication(e){return n(this,void 0,void 0,(function*(){return yield o(this,yo,"f").checkStateBioAuthentication(e)}))}sendLocation(e){return n(this,void 0,void 0,(function*(){yield o(this,yo,"f").sendLocation(e)}))}showToast(e){return n(this,void 0,void 0,(function*(){yield o(this,yo,"f").showToast(e)}))}hideKeyboard(e){return n(this,void 0,void 0,(function*(){yield o(this,yo,"f").hideKeyboard(e)}))}openPhone(e){return n(this,void 0,void 0,(function*(){return yield o(this,yo,"f").openPhone(e)}))}openSMS(e){return n(this,void 0,void 0,(function*(){yield o(this,yo,"f").openSMS(e)}))}viewOAQr(e){return n(this,void 0,void 0,(function*(){yield o(this,yo,"f").viewOAQr(e)}))}keepScreen(e){return n(this,void 0,void 0,(function*(){return yield o(this,yo,"f").keepScreen(e)}))}saveImageToGallery(e){return n(this,void 0,void 0,(function*(){return yield o(this,yo,"f").saveImageToPhotosAlbum(e)}))}saveImageToPhotosAlbum(e){return n(this,void 0,void 0,(function*(){return yield o(this,yo,"f").saveImageToPhotosAlbum(e)}))}openMiniApp(e){return n(this,void 0,void 0,(function*(){if(!Gt.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,yo,"f").openMiniApp(e)}))}vibrate(e){return n(this,void 0,void 0,(function*(){yield o(this,yo,"f").vibrate(e)}))}openWebview(e){return n(this,void 0,void 0,(function*(){yield o(this,yo,"f").openWebview(e)}))}getRouteParams(){return o(this,yo,"f").getRouteParams()}getAppInfo(e){return o(this,yo,"f").getAppInfo()}sendDataToPreviousMiniApp(e){return o(this,yo,"f").sendDataToPreviousMiniApp(e)}onCallbackData(e){return n(this,void 0,void 0,(function*(){return yield o(this,yo,"f").onCallbackData(e)}))}getPhoneNumber(e){return n(this,void 0,void 0,(function*(){return yield o(this,yo,"f").getPhoneNumber()}))}openProfilePicker(e){return n(this,void 0,void 0,(function*(){const t=yield o(this,yo,"f").openProfilePicker(e.maxProfile);let i;if(t.length>0)try{const e=yield this.getAccessToken(),n=yield fetch(oi,{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,l,c,u,d,p;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===(c=null===(l=null===(s=null===(a=o.data[e])||void 0===a?void 0:a.user_info)||void 0===s?void 0:s.picture)||void 0===l?void 0:l.data)||void 0===c?void 0:c.url},code:0!==(null===(u=o.data[e])||void 0===u?void 0:u.error)?-1:0,message:`Get profile: ${Gt.isUndefined(null===(d=o.data[e])||void 0===d?void 0:d.message)?"Unknown error":null===(p=o.data[e])||void 0===p?void 0:p.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,yo,"f").connectWifi(e)}))}openMediaPicker(e){var t,i,r;return n(this,void 0,void 0,(function*(){const n={};Gt.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,yo,"f").openMediaPicker(e.type,n,a,s)}))}getShareableLink(e){return n(this,void 0,void 0,(function*(){const t=yield this.getAccessToken();return(yield Ki(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,yo,"f").closeLoading("user action")}))}}yo=new WeakMap,t([Ni],So.prototype,"login",null),t([Pi],So.prototype,"getLoginStatus",null),t([Ni],So.prototype,"getAccessToken",null),t([Pi],So.prototype,"getVersion",null),t([Pi],So.prototype,"getSystemInfo",null),t([Ni,vo,i(0,ho("object",{title:qi("string")}))],So.prototype,"setNavigationBarTitle",null),t([Ni,vo,i(0,ho("object",{color:qi("string"),"textColor?":qi("string",{values:["white","black"]}),"statusBarColor?":qi("string")}))],So.prototype,"setNavigationBarColor",null),t([Ni,vo,i(0,ho("object",{backgroundColor:qi("string"),"textColor?":qi("string",{values:["white","black"]})}))],So.prototype,"setBackgroundColor",null),t([Ni,vo,i(0,ho("object",{type:qi("string",{values:["none","back","home","both"]})}))],So.prototype,"setNavigationBarLeftButton",null),t([Ni,vo,i(0,ho("object",{rotate:qi("string",{values:["auto","portrait","landscape"]})}))],So.prototype,"setDeviceOrientation",null),t([Ni,vo,i(0,ho("object",{data:qi("object")}))],So.prototype,"setStorage",null),t([Ni,vo,i(0,ho("object",{keys:qi("array<string>")}))],So.prototype,"getStorage",null),t([Ni],So.prototype,"getStorageInfo",null),t([Ni,vo,i(0,ho("object",{keys:qi("array<string>")}))],So.prototype,"removeStorage",null),t([Ni],So.prototype,"clearStorage",null),t([Ni,vo,i(0,ho("object",{"avatarType?":qi("string",{values:["small","normal","large"]})}))],So.prototype,"getUserInfo",null),t([Ni],So.prototype,"getNetworkType",null),t([Ni],So.prototype,"onNetworkStatusChange",null),t([Ni],So.prototype,"startBeaconDiscovery",null),t([Ni],So.prototype,"stopBeaconDiscovery",null),t([Ni],So.prototype,"getBeacons",null),t([Ni],So.prototype,"closeApp",null),t([Ni],So.prototype,"getLocation",null),t([Ni],So.prototype,"stopBluetoothDevicesDiscovery",null),t([Ni],So.prototype,"startBluetoothDevicesDiscovery",null),t([Ni],So.prototype,"openBluetoothAdapter",null),t([Ni],So.prototype,"onBluetoothDeviceFound",null),t([Ni],So.prototype,"onBluetoothAdapterStateChange",null),t([Ni],So.prototype,"getConnectedBluetoothDevices",null),t([Ni],So.prototype,"getBluetoothDevices",null),t([Ni],So.prototype,"getBluetoothAdapterState",null),t([Ni],So.prototype,"closeBluetoothAdapter",null),t([Ni],So.prototype,"scanQRCode",null),t([Ni,vo,i(0,ho("object",{type:qi("string",{values:["user","oa","aliasOA"]}),id:qi("string")}))],So.prototype,"openProfile",null),t([Ni,vo,i(0,ho("object",{type:qi("string",{values:["user","oa"]}),id:qi("string")}))],So.prototype,"openChat",null),t([Ni,vo,i(0,po(["data.imageUrl"],{if:{type:"image"}})),i(0,po(["data.link"],{if:{type:"link"}})),i(0,po(["data.id"],{if:{type:"profile"}})),i(0,ho("object",{type:qi("string",{values:["image","link","profile"]}),data:qi("object"),"data.imageUrl?":qi("url"),"data.link?":qi("url"),"data.title?":qi("string"),"data.thumb?":qi("url"),"data.description?":qi("string"),"data.avatar?":qi("url"),"data.id?":qi("string"),"data.displayName?":qi("string")}))],So.prototype,"openPostFeed",null),t([Ni,vo,i(0,ho("object",{id:qi("string"),"showDialogConfirm?":qi("boolean")}))],So.prototype,"followOA",null),t([Ni,vo,i(0,ho("object",{id:qi("string")}))],So.prototype,"unfollowOA",null),t([Ni,vo,i(0,po([["data.imageUrl","data.imageUrls"]],{if:{type:"image"}})),i(0,po(["data.link"],{if:{type:"link"}})),i(0,po(["data.id"],{if:{type:"oa"}})),i(0,po(["data.gifUrl"],{if:{type:"gif"}})),i(0,po(["data.videoThumb","data.videoUrl"],{if:{type:"video"}})),i(0,po(["data.thumbnail","data.title","data.description"],{if:{type:"zmp"},defaultValue:{data:{description:""}}})),i(0,ho("object",{type:qi("string",{values:["image","gif","video","link","oa","zmp"]}),data:qi("object"),"data.imageUrl?":qi("url"),"data.imageUrls?":qi("array<url>",{maxLength:10}),"data.caption?":qi("string"),"data.gifUrl?":qi("url"),"data.width?":qi("number"),"data.height?":qi("number"),"data.videoThumb?":qi("url"),"data.videoUrl?":qi("url"),"data.link?":qi("url"),"data.chatOnly?":qi("boolean"),"data.id?":qi("string"),"data.thumbnail?":qi("url"),"data.path?":qi("string"),"data.title?":qi("string",{maxLength:100}),"data.description?":qi(["string"],{maxLength:400})}))],So.prototype,"openShareSheet",null),t([Ni],So.prototype,"requestCameraPermission",null),t([Ni],So.prototype,"createShortcut",null),t([Ni,vo,i(0,ho("object",{secretData:qi("string"),"ui?":qi("object"),"ui.title?":qi("string"),"ui.subTitle?":qi("string"),"ui.negativeButtonText?":qi("string"),"requireFingerprint?":qi("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"}}))],So.prototype,"openBioAuthentication",null),t([Ni],So.prototype,"checkStateBioAuthentication",null),t([Ni,vo,i(0,ho("object",{toUserId:qi("string"),"title?":qi("string")}))],So.prototype,"sendLocation",null),t([Ni,vo,i(0,ho("object",{message:qi("string")}))],So.prototype,"showToast",null),t([Ni],So.prototype,"hideKeyboard",null),t([Ni,vo,i(0,ho("object",{phoneNumber:qi("string")}))],So.prototype,"openPhone",null),t([Ni,vo,i(0,ho("object",{content:qi("string"),phoneNumber:qi("string",{regex:/^\+?\d+$/})}))],So.prototype,"openSMS",null),t([Ni,vo,i(0,ho("object",{id:qi("string"),"displayName?":qi("string")},{displayName:""}))],So.prototype,"viewOAQr",null),t([Ni],So.prototype,"keepScreen",null),t([Ni,vo,i(0,ho("object",{"imageBase64Data?":qi("string"),"imageUrl?":qi("url")}))],So.prototype,"saveImageToGallery",null),t([Ni,vo,i(0,ho("object",{"imageBase64Data?":qi("string"),"imageUrl?":qi("url")}))],So.prototype,"saveImageToPhotosAlbum",null),t([Ni,vo,i(0,ho("object",{appId:qi("string"),"params?":qi("object")}))],So.prototype,"openMiniApp",null),t([Ni,vo,i(0,ho("object",{"type?":qi("string",{values:["oneShot"]}),"milliseconds?":qi("number")},{type:"oneShot",milliseconds:500}))],So.prototype,"vibrate",null),t([Ni,vo,i(0,ho("object",{url:qi("string")}))],So.prototype,"openWebview",null),t([Pi],So.prototype,"getRouteParams",null),t([Ni],So.prototype,"getAppInfo",null),t([Ni],So.prototype,"sendDataToPreviousMiniApp",null),t([Ni],So.prototype,"onCallbackData",null),t([Ni],So.prototype,"getPhoneNumber",null),t([Ni,vo,i(0,ho("object",{"maxProfile?":qi("number",{min:1,max:10})},{maxProfile:1}))],So.prototype,"openProfilePicker",null),t([Ni,vo,i(0,po(["SSID"])),i(0,ho("object",{SSID:qi("string"),"password?":qi("string"),"hiddenSSID?":qi("boolean")}))],So.prototype,"connectWifi",null),t([Ni,vo,i(0,ho("object",{type:qi("string",{values:["photo","video","file","multi_photo","multi_video"]}),"editView?":qi("object"),"editView.enable?":qi("boolean"),"editView.aspectRatio?":qi("string",{regex:/^\d+:\d+$/}),"silentRequest?":qi("boolean"),"maxSelectItem?":qi("number",{min:1})}))],So.prototype,"openMediaPicker",null),t([Ni,vo,i(0,ho("object",{title:qi("string",{maxLength:100}),"thumbnail?":qi("url"),"path?":qi("string"),description:qi(["string"],{maxLength:400})},{description:""}))],So.prototype,"getShareableLink",null),t([Ni,vo],So.prototype,"closeLoading",null);class Oo extends So{getServiceInstance(){return so.getInstance()}}class To extends So{getServiceInstance(){return new lo}}const bo=Ui();e.default=void 0,window.onJSCall=e=>function(t){sn.getInstance().onJSCall(e,t)},window.onMultiJSCall=e=>function(t){sn.getInstance().onMultiJSCall(e,t)},window.zaloJSV2={zalo_h5_event_handler:function(e,t,i){sn.getInstance().nativeEventHandler(e,t,i)}},bo.isZalo?e.default=new Oo:e.default=new To;const wo=e.default.payment;window.ZaloMiniAppSDK=e.default,e.Payment=wo,e.SDKCreator=So,e.default=e.default,Object.defineProperty(e,"__esModule",{value:!0})}));
|
|
@@ -2,9 +2,11 @@ import { SDKServiceInterface } from '../types/interface';
|
|
|
2
2
|
import { ZMPEEmitter } from '../event-emitter';
|
|
3
3
|
import * as InputDataType from '../types/inputData';
|
|
4
4
|
import * as CallbackDataType from '../types/callbackData';
|
|
5
|
+
import { ZaloMiniAppPaymentCreator } from './payment';
|
|
5
6
|
export declare abstract class SDKCreator {
|
|
6
7
|
#private;
|
|
7
8
|
events: ZMPEEmitter;
|
|
9
|
+
payment: ZaloMiniAppPaymentCreator;
|
|
8
10
|
constructor();
|
|
9
11
|
protected abstract getServiceInstance(): SDKServiceInterface;
|
|
10
12
|
/**
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import * as InputDataType from '../types/inputData';
|
|
2
|
+
import * as CallbackDataType from '../types/callbackData';
|
|
3
|
+
import { PaymentServiceInterface } from '../types/interface';
|
|
4
|
+
import { SDKCreator } from '.';
|
|
5
|
+
export declare abstract class PaymentCreator {
|
|
6
|
+
#private;
|
|
7
|
+
constructor(sdk: SDKCreator);
|
|
8
|
+
protected abstract getInstance(): PaymentServiceInterface;
|
|
9
|
+
/**
|
|
10
|
+
* Tạo đơn hàng
|
|
11
|
+
*
|
|
12
|
+
* @async
|
|
13
|
+
* @function createOrder
|
|
14
|
+
* @category Payment
|
|
15
|
+
* @returns {Promise<CallbackDataType.CreateOrderCallBack>}
|
|
16
|
+
*/
|
|
17
|
+
createOrder(object: InputDataType.CreateOrder): Promise<CallbackDataType.CreateOrderCallBack>;
|
|
18
|
+
/**
|
|
19
|
+
* Lấy thông tin transaction
|
|
20
|
+
*
|
|
21
|
+
* @async
|
|
22
|
+
* @function checkTransaction
|
|
23
|
+
* @category Payment
|
|
24
|
+
* @returns {Promise<CallbackDataType.CheckTransactionSuccessCallBack>}
|
|
25
|
+
*/
|
|
26
|
+
checkTransaction(object: InputDataType.CheckTransaction): Promise<CallbackDataType.CheckTransactionSuccessCallBack>;
|
|
27
|
+
}
|
|
28
|
+
export declare class ZaloMiniAppPaymentCreator extends PaymentCreator {
|
|
29
|
+
protected getInstance(): PaymentServiceInterface;
|
|
30
|
+
}
|
|
@@ -14,6 +14,7 @@ export declare const APIS: {
|
|
|
14
14
|
GET_ACCESS_TOKEN: string;
|
|
15
15
|
GET_ACCESS_TOKEN_V3: string;
|
|
16
16
|
GET_LIST_USER_INFO: string;
|
|
17
|
+
CREATE_ORDER: string;
|
|
17
18
|
};
|
|
18
19
|
export declare const STORAGE_DATA_LIMIT: number;
|
|
19
20
|
export declare const STORAGE_LIMIT: number;
|
|
@@ -77,3 +78,8 @@ export declare const ACTION_LEFT_BUTTON_TYPE: {
|
|
|
77
78
|
};
|
|
78
79
|
export declare const SHOW_ACTION_BAR = 5;
|
|
79
80
|
export declare const HIDE_ACTION_BAR = 6;
|
|
81
|
+
export declare const PAYMENT_APIS: {
|
|
82
|
+
CREATE_ORDER: string;
|
|
83
|
+
GET_TRANSACTION: string;
|
|
84
|
+
};
|
|
85
|
+
export declare const PAYMENT_H5_URL = "https://payment-mini.zalo.me";
|
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
import { SDKCreator } from './apis';
|
|
2
|
+
import { ZaloMiniAppPaymentCreator } from './apis/payment';
|
|
2
3
|
declare let app: SDKCreator;
|
|
4
|
+
declare const payment: ZaloMiniAppPaymentCreator;
|
|
3
5
|
export * from './types/inputData';
|
|
4
6
|
export * from './types/callbackData';
|
|
5
7
|
export * from './types/entity';
|
|
6
8
|
export * from './types/enum';
|
|
7
9
|
export { SDKCreator };
|
|
8
10
|
export { app as default };
|
|
11
|
+
export { payment as Payment };
|
|
@@ -83,4 +83,6 @@ export default class MockSDKService implements SDKServiceInterface {
|
|
|
83
83
|
}, silentRequest?: 0 | 1, maxSelectItem?: number): Promise<CallbackDataType.OpenMediaPickerSuccessCallBack>;
|
|
84
84
|
openOutApp: (url: string) => Promise<void>;
|
|
85
85
|
closeLoading: (when: string) => Promise<void>;
|
|
86
|
+
createOrder(object: InputDataType.CreateOrder): Promise<CallbackDataType.CreateOrderCallBack>;
|
|
87
|
+
checkTransaction(object: InputDataType.CheckTransaction): Promise<CallbackDataType.CheckTransactionSuccessCallBack>;
|
|
86
88
|
}
|