zmp-sdk
Version:
Zalo Mini App SDK
10 lines (9 loc) • 233 kB
JavaScript
/**
* @timeBuild 18-02-2025 10:49:14
* @license zmp-sdk
*
* Copyright @ 2025. Zalo Group.
*
* This source code is licensed under the MIT license found in the LICENSE file in the root directory of this source tree.
*/
!function(){"use strict";function e(e,t){if(null==e)return{};var n,r,i=function(e,t){if(null==e)return{};var n,r,i={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}var t,n=1048576,r=window.zAppID,i=window.APP_ID,o="https://zalo.me/s",a="https://h5.zdn.vn/zapps",s="h5.zdn.vn",u="/zapps",c={ZOAUTH:"h5.zdn.vn_zoauth",ZACC_SESSION:"h5.zdn.vn_zacc_session",JS_TOKEN:"h5.zdn.vn_zlink3rd",ZOAUTH_VRF:"h5.zdn.vn_zoauth_vrf",DEVICE_ID:"h5.zdn.vn_deviceID",CONTEXT_ID:"h5.zdn.vn_contextID",CONTEXT_TYPE:"h5.zdn.vn_contextType",UTOKEN_ZPI:"h5.zdn.vn_utoken_zpi",GTOKEN_ZPI:"h5.zdn.vn_gtoken_zpi",ZPP_ZPI:"h5.zdn.vn_zpp_zpi",ZPT_ZPI:"h5.zdn.vn_zpt_zpi"},l={GET_USER_INFO:"https://graph.zalo.me/v2.0/me",GET_ACCESS_TOKEN:"https://h5.zalo.me/openapi/access_token",GET_ACCESS_TOKEN_V3:"https://oauth.zaloapp.com/v3/access_token",GET_LIST_USER_INFO:"https://graph.zalo.me/v2.0/me/friends/list",CREATE_ORDER:"https://payment-mini.zalo.me/api/order/create",GET_APP_INFO:"https://h5.zalo.me/apps/get-info",SEND_ACTION_LOG:"https://h5.zalo.me/log/async",CREATE_SHARE_LINK:"https://h5.zalo.me/openapi/create-sharelink",CHECK_INTERACT_OA:"https://h5.zalo.me/openapi/check-interact-oa",GET_AUTH_SETTING:"https://h5.zalo.me/apis/users/auth-settings"};!function(e){e.REQUEST="REQUEST",e.MODIFIED_REQUEST="MODIFIED_REQUEST",e.RESPONSE="RESPONSE",e.MODIFIED_RESPONSE="MODIFIED_RESPONSE",e.NOT_FOUND="NOT_FOUND"}(t||(t={}));var d,p,f,h,m,v,y,g,_,w,b,T,E,S,P,I,A,O,k,C,N,M,R,x=0,D=-2e3,U=-1400,L=-1500,j=-1401,B=-1404,Z=-1408,z=-1409,W=-2004,F=-2005,V=-2006,G=-2007,H="Success",K="Unknown error. Please try again later.",J="Request limit exceeded. Please try again later.",q="Request timeout. Please try again later.",Q="Please login (https://miniapp.zalo.me/docs/api/login) before to call this api",$="Login failed",Y="This API is not supported in this version of Zalo",X="User Authentication Required. Please grant User Authentication permission before requesting User Permission",ee="Unable to pick media",te="Unable to save image",ne="Unable to save video",re="Unable to save file",ie={SUCCESS:{code:x,message:H},UNKNOWN_ERROR:{code:D,message:K},UNAUTHORIZED:{code:j,message:Q},FORBIDDEN:{code:-1403,message:"You don't have permission to call this api"},CLIENT_NOT_SUPPORT:{code:B,message:Y},DECODE_FAILED:{code:-2001,message:"Can not decode id. Please check your params again."},TIME_OUT:{code:Z,message:q},USER_DENIED:{code:-2002,message:"User denied"},USER_CANCEL:{code:-2003,message:"User cancel"},DUPLICATE_REQUEST:{code:-1410,message:"Duplicate request. Please try again later."},DEVICE_NOT_SUPPORT:{code:-600,message:"This device does not support NFC"},SERVICE_NOT_READY:{code:-602,message:"NFC service is not ready. Please check in your setting"},UNREADABLE:{code:-603,message:"NFC tag is unreadable"},INVALID_MRZ:{code:-604,message:"Invalid MRZ data. Please try again later."},PROCESSING:{code:-605,message:"Processing NFC tag. Please wait a moment."},CANCEL:{code:-606,message:"User cancel"},SCAN_TIMEOUT:{code:-601,message:"NFC scan timeout. Please try again later."},MPDS_ACTION_INVALID:{code:-3e3,message:"Action name from input data does not match declared API actions"},MPDS_SOURCE_INVALID:{code:-3005,message:"This API not called from Mini App"},MPDS_APPID_INVALID:{code:-3006,message:"AppId from input data does not match the currently opened AppId"}},oe={addRating:{limit:1},authorize:{},isAllowedInteractWithOA:{},favoriteApp:{},followOA:{},getLocation:{},getPhoneNumber:{},getShareableLink:{},getSetting:{},getAppInfo:{},getUserInfo:{},interactOA:{},openProfilePicker:{},openShareSheet:{},unfollowOA:{},checkTransaction:{limit:5},createOrder:{limit:5},createOrderIAP:{limit:5},selectPaymentMethod:{},requestSendNotification:{}},ae={GET_DOWNLOADED_STICKER:{haveCallback:!0},OPEN_SHARE_STICKER:{},OPEN_PROFILE:{requireAccessToken:!0},OPEN_FEED_DETAIL:{},OPEN_FRIEND_RADA:{},OPEN_INAPP:{},OPEN_OUTAPP:{requireAccessToken:!0},OPEN_PAGE:{},OPEN_PHOTODETAIL:{},OPEN_GALARY:{},OPEN_GAMECENTER:{},OPEN_GAMENEWS:{},OPEN_TAB_CONTACT:{},OPEN_TAB_SOCIAL:{},OPEN_FRIENDSUGGEST:{},OPEN_GROUPLIST:{},OPEN_NEARBY:{},OPEN_ROOM:{},OPEN_STICKERSTORE:{},OPEN_CREATECHAT:{},COPY_LINK_CATESTICKER:{},REQUEST_BUY_STICKER:{},OPEN_CHAT:{requireAccessToken:!0},OPEN_TAB_CHAT:{},OPEN_CHATGROUP:{},OPEN_ADDFRIEND:{},OPEN_TAB_MORE:{},OPEN_POSTFEED:{requireAccessToken:!0},OPEN_LOGINDEVICES:{},OPEN_SENDSTICKER:{},REPORT_ABUSE:{haveCallback:!0},FOLLOW_OA:{haveCallback:!0,requireAccessToken:!0,errorList:{android:{"-400":{mapTo:ie.DUPLICATE_REQUEST}},iOS:{"-400":{mapTo:ie.DUPLICATE_REQUEST}}}},UNFOLLOW_OA:{haveCallback:!0,requireAccessToken:!0,errorList:{android:{"-400":{mapTo:ie.DUPLICATE_REQUEST}},iOS:{"-400":{mapTo:ie.DUPLICATE_REQUEST}}}},OPEN_GAMEDETAIL:{},OPEN_SHARESHEET:{haveCallback:!0,requireAccessToken:!0,errorList:{android:{"-101":{mapTo:ie.CLIENT_NOT_SUPPORT}},iOS:{"-101":{mapTo:ie.CLIENT_NOT_SUPPORT}}}},REQUEST_PERMISSION_CAMERA:{errorList:{android:{"-2":{mapTo:ie.USER_DENIED}},iOS:{"-2":{mapTo:ie.USER_DENIED}}}},CHANGE_TITLE_HEADER:{skipJump:!0},WEBVIEW_CLEARCACHE:{},WEBVIEW_CONFIRMCACHE:{},WEBVIEW_ISVISIBLE:{},WEBVIEW_NETWORKTYPE:{skipJump:!0},CHANGE_BUTTON_HEADER:{},CREATE_OPTIONS_MENU:{skipJump:!0,haveCallback:!0},CREATE_SHORTCUT:{requireAccessToken:!0},CHANGE_ACTIONBAR_LEFTBUTTON_TYPE:{skipJump:!0,haveCallback:!0},WINDOW_CLOSE:{skipJump:!0,haveCallback:!0},WEBVIEW_CHECKRESERROR:{},IAP_REQUESTPAYMENT:{haveCallback:!0},ZBROWSER_GETSTATS:{},ZBROWSER_JSBRIDGE:{skipJump:!0,haveCallback:!0},PROMPT_AUTHENTICATION:{},CHANGE_ACTIONBAR_COLOR:{skipJump:!0},PROMPT_AUTHENTICATION_CHECK_STATE:{},OPEN_APPSTORE:{},GET_LOCATION:{haveCallback:!0,errorList:{android:{"-1":{mapTo:ie.USER_DENIED},"-400":{mapTo:ie.DUPLICATE_REQUEST}},iOS:{"-1":{mapTo:ie.USER_DENIED},"-400":{mapTo:ie.DUPLICATE_REQUEST}}}},QUERY_LOCATION_HIDE:{haveCallback:!0},SHOW_TOAST:{haveCallback:!0,timeout:2},OPEN_APP:{},HIDE_KEYBOARD:{},OPEN_PHONE:{},OPEN_QR:{},OPEN_SMS:{},VIEW_MYQR:{haveCallback:!0,timeout:!0,requireAccessToken:!0},KEEP_SCREEN:{haveCallback:!0,timeout:2},CHANGE_AUTOROTATE:{skipJump:!0},CHECK_APP_INSTALLED:{},QUERY_SHOW:{},QUERY_HIDE:{},OPEN_INAPPRW:{},ZALORUN_GETTRACKINGSTATUS:{haveCallback:!0},ZALORUN_SETTRACKINGSTATUS:{haveCallback:!0},ZALORUN_GETDAYSTEP:{haveCallback:!0},ZALORUN_FORCESUBMITDATA:{haveCallback:!0},ZALORUN_SETWEIGHT:{haveCallback:!0},OPEN_PROFILE_EXT:{},DOWNLOAD_CATE:{haveCallback:!0},JUMP_LOGIN:{skipJump:!0,whiteList:!0},OPEN_ADTIMA_ADS_INTERSTITIAL:{},OPEN_ADTIMA_ADS:{},GET_ADIDCLIENT:{},SCAN_IBEACON:{},SAVE_VIDEO_GALLERY:{versionLive:{iOS:628},errorList:{android:{"-101":{mapTo:{code:V,message:ne},needMoreDetail:!0},"-102":{mapTo:{code:V,message:ne},needMoreDetail:!0}},iOS:{"-10":{mapTo:{code:V,message:ne},needMoreDetail:!0}}}},INTERACTIVE_VIBRATION:{},SAVE_IMAGE_GALLERY:{versionLive:{iOS:408},errorList:{android:{"-101":{mapTo:{code:F,message:te},needMoreDetail:!0},"-102":{mapTo:{code:F,message:te},needMoreDetail:!0}},iOS:{"-10":{mapTo:{code:F,message:te},needMoreDetail:!0}}}},OPEN_MP:{versionLive:{iOS:402}},CHANGE_ACTIONBAR:{haveCallback:!0,timeout:2,versionLive:{iOS:402},skipJump:!0},ZBROWSER_MPDS:{haveCallback:!0,timeout:2,versionLive:{iOS:402},errorList:{android:{"-100":{mapTo:ie.MPDS_ACTION_INVALID},"-101":{mapTo:ie.UNKNOWN_ERROR},"-105":{mapTo:ie.MPDS_SOURCE_INVALID},"-106":{mapTo:ie.MPDS_APPID_INVALID}},iOS:{"-10":{mapTo:ie.MPDS_ACTION_INVALID},"-101":{mapTo:ie.MPDS_APPID_INVALID},"-102":{mapTo:ie.UNKNOWN_ERROR}}}},ZBROWSER_MPDS_SYNC:{versionLive:{iOS:402},errorList:{android:{"-100":{mapTo:ie.MPDS_ACTION_INVALID},"-101":{mapTo:ie.UNKNOWN_ERROR},"-105":{mapTo:ie.MPDS_SOURCE_INVALID},"-106":{mapTo:ie.MPDS_APPID_INVALID}},iOS:{"-10":{mapTo:ie.MPDS_ACTION_INVALID},"-101":{mapTo:ie.MPDS_APPID_INVALID},"-102":{mapTo:ie.UNKNOWN_ERROR}}}},WEBVIEW_SET_RESULT:{versionLive:{iOS:416}},MP_GET_NUMBER:{versionLive:{iOS:416},errorList:{android:{"-1":{mapTo:ie.USER_DENIED},"-101":{mapTo:ie.USER_DENIED},"-400":{mapTo:ie.DUPLICATE_REQUEST}},iOS:{"-1":{mapTo:ie.USER_DENIED},"-10":{mapTo:ie.USER_DENIED},"-400":{mapTo:ie.DUPLICATE_REQUEST}}}},MP_OPEN_PROFILE_PICKER:{requireAccessToken:!0,versionLive:{iOS:432},errorList:{android:{"-101":{mapTo:ie.USER_CANCEL}},iOS:{"-101":{mapTo:ie.USER_CANCEL}}}},GET_SUPPORTED_ACTIONS:{whiteList:!0},MP_JOIN_WIFI:{haveCallback:!0,timeout:!0,versionLive:{android:0,iOS:0},havePermission:!1,whiteList:!1},PICK_MEDIA:{requireAccessToken:!0,versionLive:{iOS:440},errorList:{android:{"-101":{mapTo:ie.USER_CANCEL},999:{mapTo:{code:W,message:ee},needMoreDetail:!0}},iOS:{"-10":{mapTo:{code:W,message:ee}}}}},MP_CLOSE_LOADINGVIEW:{skipJump:!0},CHANGE_BOTTOMBAR:{haveCallback:!0,timeout:2,skipJump:!0},MA_MENU_MINIMIZE:{skipJump:!1,versionLive:{iOS:520}},MA_MENU_PERMISSION:{skipJump:!1,versionLive:{iOS:520}},MA_MENU_FAVORITES:{skipJump:!1,versionLive:{iOS:520}},MP_SEND_NOTIFICATION:{skipJump:!1,versionLive:{iOS:530},errorList:{android:{"-1":{mapTo:ie.USER_DENIED},"-400":{mapTo:ie.DUPLICATE_REQUEST}},iOS:{"-1":{mapTo:ie.USER_DENIED},"-400":{mapTo:ie.DUPLICATE_REQUEST}}}},MP_ADD_RATING:{skipJump:!1},MP_ADD_MYFAVORITES:{skipJump:!1},MP_INTERACT_OA:{skipJump:!1,errorList:{android:{"-400":{mapTo:ie.DUPLICATE_REQUEST}},iOS:{"-400":{mapTo:ie.DUPLICATE_REQUEST}}}},MP_USER_AUTHORIZE:{skipJump:!1,errorList:{android:{"-400":{mapTo:ie.DUPLICATE_REQUEST}},iOS:{"-400":{mapTo:ie.DUPLICATE_REQUEST}}}},MP_SELECT_PAYMENT_METHOD:{skipJump:!1},CHECK_NFC:{skipJump:!1,versionLive:{iOS:626},errorList:{all:{"-1":{mapTo:ie.UNKNOWN_ERROR},"-600":{mapTo:ie.DEVICE_NOT_SUPPORT},"-602":{mapTo:ie.SERVICE_NOT_READY}}}},SCAN_NFC:{skipJump:!1,haveCallback:!0,timeout:65,errorList:{all:{"-1":{mapTo:ie.UNKNOWN_ERROR},"-600":{mapTo:ie.DEVICE_NOT_SUPPORT},"-601":{mapTo:ie.SCAN_TIMEOUT},"-602":{mapTo:ie.SERVICE_NOT_READY},"-603":{mapTo:ie.UNREADABLE},"-604":{mapTo:ie.INVALID_MRZ},"-605":{mapTo:ie.PROCESSING},"-606":{mapTo:ie.CANCEL}}}},MP_CONFIRM_REQUEST_PAYMENT:{skipJump:!1},SAVE_FILE:{versionLive:{iOS:628},skipJump:!1,errorList:{android:{"-101":{mapTo:{code:G,message:re},needMoreDetail:!0},"-102":{mapTo:{code:G,message:re},needMoreDetail:!0}},iOS:{"-10":{mapTo:{code:G,message:re},needMoreDetail:!0}}}},MP_APP_LIFECYCLE_TRACKING:{skipJump:!1}},se={android:{"-4":ie.DECODE_FAILED,"-5":ie.CLIENT_NOT_SUPPORT,"-14":ie.TIME_OUT},iOS:{"-9":ie.DECODE_FAILED,"-5":ie.CLIENT_NOT_SUPPORT,"-14":ie.TIME_OUT}},ue={android:12100615,iOS:460,wp:0,unknown:0},ce=5*n,le="https://payment-mini.zalo.me/api/order/create",de="https://payment-mini.zalo.me/api/order/iap-create",pe="https://payment-mini.zalo.me/api/transaction",fe="https://payment-mini.zalo.me/api/order/purchase",he="DEFERRED",me="IMMEDIATE_AND_CHARGE_FULL_PRICE",ve={SHOW_BACK:0,HIDE_BACK:3,SHOW_HOME:1,HIDE_HOME:0},ye=5,ge=6,_e="#1843EF",we=0,be={"-12101":"Invalid params","-12102":"Session expire","-12103":"Not permission","-12104":"Not Authorize","-12105":"Unknown exception","-12106":"Cannot create order","-12107":"Transaction not found","-12108":"Cannot update order","-12109":"Cannot decode param","-12110":"Version not support","-12111":"Receipt expire","-12112":"Product not found","-12113":"Subscription other GW","-12114":"Product already subcription","-12115":"Not exist","-12116":"Already exist","-12117":"Not allow","-12118":"Not permit","-12119":"Internal error","-2":"Unable to pay","-6":"Unable to register","-7":"Registered account","-832":"Purchased by another account","-833":"Register for another account","-834":"Unable to register","-2010":"System is maintaining","-3999":"Not in Vietnam","-12129":"Purchased by another account",123:"An error has occurred"};function Te(e,t,n,r,i,o,a){try{var s=e[o](a),u=s.value}catch(e){return void n(e)}s.done?t(u):Promise.resolve(u).then(r,i)}function Ee(e){return function(){var t=this,n=arguments;return new Promise((function(r,i){var o=e.apply(t,n);function a(e){Te(o,r,i,a,s,"next",e)}function s(e){Te(o,r,i,a,s,"throw",e)}a(void 0)}))}}function Se(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Pe(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function Ie(e,t){if(e){if("string"==typeof e)return Se(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(n):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Se(e,t):void 0}}function Ae(e){return function(e){if(Array.isArray(e))return Se(e)}(e)||Pe(e)||Ie(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Oe(e,t){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(s){return function(u){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;o&&(o=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!(i=a.trys,(i=i.length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){a.label=s[1];break}if(6===s[0]&&a.label<i[1]){a.label=i[1],i=s;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(s);break}i[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],r=0}finally{n=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,u])}}}function ke(e){return function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];try{return e.apply(void 0,Ae(n))}catch(e){return"undefined"!=typeof console&&console.error&&console.error(e),null}}}function Ce(e){var t=new URL(window.location.href).searchParams.get("env");return{isMp:window.location.hostname.includes(s)&&("TESTING_LOCAL"==t||window.location.pathname.startsWith(u)),isMpWeb:window.location.hostname.includes("localhost")}}ke.async=function(e){return Ee((function(){var t,n,r,i,o=arguments;return Oe(this,(function(a){switch(a.label){case 0:for(t=o.length,n=new Array(t),r=0;r<t;r++)n[r]=o[r];a.label=1;case 1:return a.trys.push([1,3,,4]),[4,e.apply(void 0,Ae(n))];case 2:return[2,a.sent()];case 3:return i=a.sent(),"undefined"!=typeof console&&console.error&&console.error(i),[2,null];case 4:return[2]}}))}))},function(e){e.none="none",e.wifi="wifi",e.cellular="cellular",e.unknown="unknown"}(d||(d={})),function(e){e.wp="wp",e.android="android",e.iOS="iOS",e.unknown="unknown"}(p||(p={})),function(e){e.AppPaused="h5.event.paused",e.AppResumed="h5.event.resumed",e.NetworkChanged="h5.event.connection.changed",e.OnDataCallback="h5.event.webview.result",e.WebviewClosed="h5.event.webview.close",e.OpenApp="h5.event.open.mp",e.AppClose="h5.event.action.close",e.PaymentCallback="payment.callback",e.PaymentResult="action.payment.result",e.PaymentClose="action.payment.close",e.DownloadProgress="h5.event.webview.download.progress"}(f||(f={})),function(e){e.DOING="doing",e.DONE="done"}(h||(h={})),function(e){e[e.user=1]="user",e[e.oa=0]="oa",e[e.aliasOA=2]="aliasOA"}(m||(m={})),function(e){e[e.user=1]="user",e[e.oa=0]="oa"}(v||(v={})),function(e){e[e.image=1]="image",e[e.multi_image=2]="multi_image",e[e.link=4]="link",e[e.profile=5]="profile"}(y||(y={})),function(e){e[e.cccd=1]="cccd"}(g||(g={})),function(e){e[e.image=1]="image",e[e.gif=11]="gif",e[e.video=12]="video",e[e.link=4]="link",e[e.oa=5]="oa",e[e.zmp=20]="zmp",e[e.multi_image=21]="multi_image",e[e.zmp_deep_link=4]="zmp_deep_link",e[e.text=22]="text"}(_||(_={})),function(e){e[e.auto=1]="auto",e[e.portrait=2]="portrait",e[e.landscape=3]="landscape"}(w||(w={})),function(e){e[e.oneShot=0]="oneShot"}(b||(b={})),function(e){e[e.zcamera=3]="zcamera",e[e.zcamera_photo=1]="zcamera_photo",e[e.zcamera_video=2]="zcamera_video",e[e.zcamera_scan=7]="zcamera_scan",e[e.photo=4]="photo",e[e.video=5]="video",e[e.file=6]="file"}(T||(T={})),function(e){e.SUBSCRIPTION="SUBSCRIPTION",e.ONETIME="ONETIME"}(E||(E={})),function(e){e[e.UNKNOW=0]="UNKNOW",e[e.DEFERRED=1]="DEFERRED",e[e.IMMEDIATE_AND_CHARGE_FULL_PRICE=2]="IMMEDIATE_AND_CHARGE_FULL_PRICE"}(S||(S={})),function(e){e[e.normal=1]="normal",e[e.hidden=0]="hidden",e[e.transparent=2]="transparent"}(P||(P={})),function(e){e[e.show=1]="show",e[e.hide=0]="hide"}(I||(I={})),function(e){e[e.show=1]="show",e[e.hide=0]="hide"}(A||(A={})),function(e){e[e.left=0]="left",e[e.center=1]="center"}(O||(O={})),function(e){e.OnFrameCallback="h5.event.camera.frame",e.OnStartCallback="h5.event.camera.start",e.OnStopCallback="h5.event.camera.stop"}(k||(k={})),function(e){e.FRONT="user",e.BACK="environment"}(C||(C={})),function(e){e.WEBP="image/webp",e.PNG="image/png",e.JPEG="image/jpeg"}(N||(N={})),function(e){e.HIGH="high",e.NORMAL="normal",e.LOW="low"}(M||(M={})),function(e){e.VIDEO="video",e.AUDIO="audio"}(R||(R={}));var Ne,Me=function(e){return e.isAndroid?p.android:e.isIOS?p.iOS:p.unknown};function Re(e){var t=e.split("zalo")[1];return t&&t.replace(" ","").split("/")[1]||""}function xe(){var e=function(){var e=ke((function(){return window.navigator.userAgent.toLowerCase()}))();if(e){var t=function(e){return{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)}}(e);return{appEnv:Ce(),platform:t,platformName:Me(t),zaloVersion:Re(e).trim()}}}();if(e)return e}var De=(null===(Ne=xe())||void 0===Ne?void 0:Ne.appEnv)||{};function Ue(e){Ue.on&&Ue.engine(e)}Ue.on=!1,Ue.engine=function(e){var t=e.name,n=e.type,r=e.state,i=e.request,o=e.response,a=e.stage;console[n]([t,a,r,i,o].filter(Boolean).map((function(e){return"object"==typeof e?JSON.stringify(e):e})).join("; "))};var Le=function(e,n){var r,i={error:-1404,errorMessage:"".concat(e," is not found")};null==n||null===(r=n.fail)||void 0===r||r.call(n,i),Ue({stage:t.NOT_FOUND,type:"error",name:e,request:n,state:"fail",response:i})};function je(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Be(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){je(e,t,n[t])}))}return e}function Ze(e,t){return function(e){if(Array.isArray(e))return e}(e)||Pe(e)||Ie(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var ze="undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{};function We(){throw new Error("setTimeout has not been defined")}function Fe(){throw new Error("clearTimeout has not been defined")}var Ve=We,Ge=Fe;function He(e){if(Ve===setTimeout)return setTimeout(e,0);if((Ve===We||!Ve)&&setTimeout)return Ve=setTimeout,setTimeout(e,0);try{return Ve(e,0)}catch(t){try{return Ve.call(null,e,0)}catch(t){return Ve.call(this,e,0)}}}"function"==typeof ze.setTimeout&&(Ve=setTimeout),"function"==typeof ze.clearTimeout&&(Ge=clearTimeout);var Ke,Je=[],qe=!1,Qe=-1;function $e(){qe&&Ke&&(qe=!1,Ke.length?Je=Ke.concat(Je):Qe=-1,Je.length&&Ye())}function Ye(){if(!qe){var e=He($e);qe=!0;for(var t=Je.length;t;){for(Ke=Je,Je=[];++Qe<t;)Ke&&Ke[Qe].run();Qe=-1,t=Je.length}Ke=null,qe=!1,function(e){if(Ge===clearTimeout)return clearTimeout(e);if((Ge===Fe||!Ge)&&clearTimeout)return Ge=clearTimeout,clearTimeout(e);try{Ge(e)}catch(t){try{return Ge.call(null,e)}catch(t){return Ge.call(this,e)}}}(e)}}function Xe(e,t){this.fun=e,this.array=t}Xe.prototype.run=function(){this.fun.apply(null,this.array)};function et(){}var tt=et,nt=et,rt=et,it=et,ot=et,at=et,st=et;var ut=ze.performance||{},ct=ut.now||ut.mozNow||ut.msNow||ut.oNow||ut.webkitNow||function(){return(new Date).getTime()};var lt=new Date;var dt,pt={nextTick:function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)t[n-1]=arguments[n];Je.push(new Xe(e,t)),1!==Je.length||qe||He(Ye)},title:"browser",browser:!0,env:{},argv:[],version:"",versions:{},on:tt,addListener:nt,once:rt,off:it,removeListener:ot,removeAllListeners:at,emit:st,binding:function(e){throw new Error("process.binding is not supported")},cwd:function(){return"/"},chdir:function(e){throw new Error("process.chdir is not supported")},umask:function(){return 0},hrtime:function(e){var t=.001*ct.call(ut),n=Math.floor(t),r=Math.floor(t%1*1e9);return e&&(n-=e[0],(r-=e[1])<0&&(n--,r+=1e9)),[n,r]},platform:"browser",release:{},config:{},uptime:function(){return(new Date-lt)/1e3}},ft=pt,ht="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function mt(e){return e&&e.constructor===Symbol?"symbol":typeof e}function vt(e){return"function"==typeof window.Debug?window.Debug(e):function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n]}}!function(e){!function(t){var n="object"==typeof ht?ht:"object"==typeof self?self:"object"==typeof this?this:Function("return this;")(),r=i(e);function i(e,t){return function(n,r){"function"!=typeof e[n]&&Object.defineProperty(e,n,{configurable:!0,writable:!0,value:r}),t&&t(n,r)}}void 0===n.Reflect?n.Reflect=e:r=i(n.Reflect,r),function(e){var t=Object.prototype.hasOwnProperty,n="function"==typeof Symbol,r=n&&void 0!==Symbol.toPrimitive?Symbol.toPrimitive:"@@toPrimitive",i=n&&void 0!==Symbol.iterator?Symbol.iterator:"@@iterator",o="function"==typeof Object.create,a={__proto__:[]}instanceof Array,s=!o&&!a,u={create:o?function(){return re(Object.create(null))}:a?function(){return re({__proto__:null})}:function(){return re({})},has:s?function(e,n){return t.call(e,n)}:function(e,t){return t in e},get:s?function(e,n){return t.call(e,n)?e[n]:void 0}:function(e,t){return e[t]}},c=Object.getPrototypeOf(Function),l="object"==typeof ft&&ft.env&&"true"===ft.env.REFLECT_METADATA_USE_MAP_POLYFILL,d=l||"function"!=typeof Map||"function"!=typeof Map.prototype.entries?ee():Map,p=l||"function"!=typeof Set||"function"!=typeof Set.prototype.entries?te():Set,f=new(l||"function"!=typeof WeakMap?ne():WeakMap);function h(e,t,n,r){if(D(n)){if(!V(e))throw new TypeError;if(!H(t))throw new TypeError;return S(e,t)}if(!V(e))throw new TypeError;if(!j(t))throw new TypeError;if(!j(r)&&!D(r)&&!U(r))throw new TypeError;return U(r)&&(r=void 0),P(e,t,n=F(n),r)}function m(e,t){function n(n,r){if(!j(n))throw new TypeError;if(!D(r)&&!K(r))throw new TypeError;N(e,t,n,r)}return n}function v(e,t,n,r){if(!j(n))throw new TypeError;return D(r)||(r=F(r)),N(e,t,n,r)}function y(e,t,n){if(!j(t))throw new TypeError;return D(n)||(n=F(n)),A(e,t,n)}function g(e,t,n){if(!j(t))throw new TypeError;return D(n)||(n=F(n)),O(e,t,n)}function _(e,t,n){if(!j(t))throw new TypeError;return D(n)||(n=F(n)),k(e,t,n)}function w(e,t,n){if(!j(t))throw new TypeError;return D(n)||(n=F(n)),C(e,t,n)}function b(e,t){if(!j(e))throw new TypeError;return D(t)||(t=F(t)),M(e,t)}function T(e,t){if(!j(e))throw new TypeError;return D(t)||(t=F(t)),R(e,t)}function E(e,t,n){if(!j(t))throw new TypeError;D(n)||(n=F(n));var r=I(t,n,!1);if(D(r))return!1;if(!r.delete(e))return!1;if(r.size>0)return!0;var i=f.get(t);return i.delete(n),i.size>0||f.delete(t),!0}function S(e,t){for(var n=e.length-1;n>=0;--n){var r=(0,e[n])(t);if(!D(r)&&!U(r)){if(!H(r))throw new TypeError;t=r}}return t}function P(e,t,n,r){for(var i=e.length-1;i>=0;--i){var o=(0,e[i])(t,n,r);if(!D(o)&&!U(o)){if(!j(o))throw new TypeError;r=o}}return r}function I(e,t,n){var r=f.get(e);if(D(r)){if(!n)return;r=new d,f.set(e,r)}var i=r.get(t);if(D(i)){if(!n)return;i=new d,r.set(t,i)}return i}function A(e,t,n){if(O(e,t,n))return!0;var r=X(t);return!U(r)&&A(e,r,n)}function O(e,t,n){var r=I(t,n,!1);return!D(r)&&z(r.has(e))}function k(e,t,n){if(O(e,t,n))return C(e,t,n);var r=X(t);return U(r)?void 0:k(e,r,n)}function C(e,t,n){var r=I(t,n,!1);if(!D(r))return r.get(e)}function N(e,t,n,r){I(n,r,!0).set(e,t)}function M(e,t){var n=R(e,t),r=X(e);if(null===r)return n;var i=M(r,t);if(i.length<=0)return n;if(n.length<=0)return i;for(var o=new p,a=[],s=0,u=n;s<u.length;s++){var c=u[s];o.has(c)||(o.add(c),a.push(c))}for(var l=0,d=i;l<d.length;l++){c=d[l];o.has(c)||(o.add(c),a.push(c))}return a}function R(e,t){var n=[],r=I(e,t,!1);if(D(r))return n;for(var i=q(r.keys()),o=0;;){var a=$(i);if(!a)return n.length=o,n;var s=Q(a);try{n[o]=s}catch(e){try{Y(i)}finally{throw e}}o++}}function x(e){if(null===e)return 1;switch(typeof e){case"undefined":return 0;case"boolean":return 2;case"string":return 3;case"symbol":return 4;case"number":return 5;case"object":return null===e?1:6;default:return 6}}function D(e){return void 0===e}function U(e){return null===e}function L(e){return"symbol"==typeof e}function j(e){return"object"==typeof e?null!==e:"function"==typeof e}function B(e,t){switch(x(e)){case 0:case 1:case 2:case 3:case 4:case 5:return e}var n=3===t?"string":5===t?"number":"default",i=J(e,r);if(void 0!==i){var o=i.call(e,n);if(j(o))throw new TypeError;return o}return Z(e,"default"===n?"number":n)}function Z(e,t){if("string"===t){var n=e.toString;if(G(n))if(!j(i=n.call(e)))return i;if(G(r=e.valueOf))if(!j(i=r.call(e)))return i}else{var r;if(G(r=e.valueOf))if(!j(i=r.call(e)))return i;var i,o=e.toString;if(G(o))if(!j(i=o.call(e)))return i}throw new TypeError}function z(e){return!!e}function W(e){return""+e}function F(e){var t=B(e,3);return L(t)?t:W(t)}function V(e){return Array.isArray?Array.isArray(e):e instanceof Object?e instanceof Array:"[object Array]"===Object.prototype.toString.call(e)}function G(e){return"function"==typeof e}function H(e){return"function"==typeof e}function K(e){switch(x(e)){case 3:case 4:return!0;default:return!1}}function J(e,t){var n=e[t];if(null!=n){if(!G(n))throw new TypeError;return n}}function q(e){var t=J(e,i);if(!G(t))throw new TypeError;var n=t.call(e);if(!j(n))throw new TypeError;return n}function Q(e){return e.value}function $(e){var t=e.next();return!t.done&&t}function Y(e){var t=e.return;t&&t.call(e)}function X(e){var t=Object.getPrototypeOf(e);if("function"!=typeof e||e===c)return t;if(t!==c)return t;var n=e.prototype,r=n&&Object.getPrototypeOf(n);if(null==r||r===Object.prototype)return t;var i=r.constructor;return"function"!=typeof i||i===e?t:i}function ee(){var e={},t=[],n=function(){function e(e,t,n){this._index=0,this._keys=e,this._values=t,this._selector=n}return e.prototype["@@iterator"]=function(){return this},e.prototype[i]=function(){return this},e.prototype.next=function(){var e=this._index;if(e>=0&&e<this._keys.length){var n=this._selector(this._keys[e],this._values[e]);return e+1>=this._keys.length?(this._index=-1,this._keys=t,this._values=t):this._index++,{value:n,done:!1}}return{value:void 0,done:!0}},e.prototype.throw=function(e){throw this._index>=0&&(this._index=-1,this._keys=t,this._values=t),e},e.prototype.return=function(e){return this._index>=0&&(this._index=-1,this._keys=t,this._values=t),{value:e,done:!0}},e}();return function(){function t(){this._keys=[],this._values=[],this._cacheKey=e,this._cacheIndex=-2}return Object.defineProperty(t.prototype,"size",{get:function(){return this._keys.length},enumerable:!0,configurable:!0}),t.prototype.has=function(e){return this._find(e,!1)>=0},t.prototype.get=function(e){var t=this._find(e,!1);return t>=0?this._values[t]:void 0},t.prototype.set=function(e,t){var n=this._find(e,!0);return this._values[n]=t,this},t.prototype.delete=function(t){var n=this._find(t,!1);if(n>=0){for(var r=this._keys.length,i=n+1;i<r;i++)this._keys[i-1]=this._keys[i],this._values[i-1]=this._values[i];return this._keys.length--,this._values.length--,t===this._cacheKey&&(this._cacheKey=e,this._cacheIndex=-2),!0}return!1},t.prototype.clear=function(){this._keys.length=0,this._values.length=0,this._cacheKey=e,this._cacheIndex=-2},t.prototype.keys=function(){return new n(this._keys,this._values,r)},t.prototype.values=function(){return new n(this._keys,this._values,o)},t.prototype.entries=function(){return new n(this._keys,this._values,a)},t.prototype["@@iterator"]=function(){return this.entries()},t.prototype[i]=function(){return this.entries()},t.prototype._find=function(e,t){return this._cacheKey!==e&&(this._cacheIndex=this._keys.indexOf(this._cacheKey=e)),this._cacheIndex<0&&t&&(this._cacheIndex=this._keys.length,this._keys.push(e),this._values.push(void 0)),this._cacheIndex},t}();function r(e,t){return e}function o(e,t){return t}function a(e,t){return[e,t]}}function te(){return function(){function e(){this._map=new d}return Object.defineProperty(e.prototype,"size",{get:function(){return this._map.size},enumerable:!0,configurable:!0}),e.prototype.has=function(e){return this._map.has(e)},e.prototype.add=function(e){return this._map.set(e,e),this},e.prototype.delete=function(e){return this._map.delete(e)},e.prototype.clear=function(){this._map.clear()},e.prototype.keys=function(){return this._map.keys()},e.prototype.values=function(){return this._map.values()},e.prototype.entries=function(){return this._map.entries()},e.prototype["@@iterator"]=function(){return this.keys()},e.prototype[i]=function(){return this.keys()},e}()}function ne(){var e=16,n=u.create(),r=i();return function(){function e(){this._key=i()}return e.prototype.has=function(e){var t=o(e,!1);return void 0!==t&&u.has(t,this._key)},e.prototype.get=function(e){var t=o(e,!1);return void 0!==t?u.get(t,this._key):void 0},e.prototype.set=function(e,t){return o(e,!0)[this._key]=t,this},e.prototype.delete=function(e){var t=o(e,!1);return void 0!==t&&delete t[this._key]},e.prototype.clear=function(){this._key=i()},e}();function i(){var e;do{e="@@WeakMap@@"+c()}while(u.has(n,e));return n[e]=!0,e}function o(e,n){if(!t.call(e,r)){if(!n)return;Object.defineProperty(e,r,{value:u.create()})}return e[r]}function a(e,t){for(var n=0;n<t;++n)e[n]=255*Math.random()|0;return e}function s(e){return"function"==typeof Uint8Array?"undefined"!=typeof crypto?crypto.getRandomValues(new Uint8Array(e)):"undefined"!=typeof msCrypto?msCrypto.getRandomValues(new Uint8Array(e)):a(new Uint8Array(e),e):a(new Array(e),e)}function c(){var t=s(e);t[6]=79&t[6]|64,t[8]=191&t[8]|128;for(var n="",r=0;r<e;++r){var i=t[r];4!==r&&6!==r&&8!==r||(n+="-"),i<16&&(n+="0"),n+=i.toString(16).toLowerCase()}return n}}function re(e){return e.__=void 0,delete e.__,e}e("decorate",h),e("metadata",m),e("defineMetadata",v),e("hasMetadata",y),e("hasOwnMetadata",g),e("getMetadata",_),e("getOwnMetadata",w),e("getMetadataKeys",b),e("getOwnMetadataKeys",T),e("deleteMetadata",E)}(r)}()}(dt||(dt={}));var yt=Object.prototype.toString;var gt="[object Null]",_t="[object Undefined]";function wt(e){return null==e?void 0===e?_t:gt:function(e){return yt.call(e)}(e)}function bt(e){return null!=e&&"object"==typeof e}var Tt={isEmpty:function(e){return null==e||"object"==typeof e&&0===Object.keys(e).length||"string"==typeof e&&0===e.trim().length},isNull:function(e){return null===e},isUndefined:function(e){return void 0===e},isFunction:function(e){return"function"==typeof e},isObject:function(e){return null!==e&&("function"==typeof e||"object"==typeof e)},isString:function(e){return null!=e&&"string"==typeof e.valueOf()},isNumber:function(e){return"number"==typeof e||bt(e)&&"[object Number]"==wt(e)},isArray:function(e){return Array.isArray(e)},isRegExp:function(e){return bt(e)&&"[object RegExp]"==wt(e)},get:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0,r=function(n){return String.prototype.split.call(t,n).filter(Boolean).reduce((function(e,t){return null!=e?e[t]:e}),e)},i=r(/[,[\]]+?/)||r(/[,[\].]+?/);return void 0===i||i===e?n:i},isPromise:function(e){return!!e&&("object"==typeof e||"function"==typeof e)&&"function"==typeof e.then}};function Et(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function St(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Pt(e){return Pt=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},Pt(e)}function It(e){return Pt(e)}function At(e,t,n){return At="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,n){var r=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=It(e)););return e}(e,t);if(r){var i=Object.getOwnPropertyDescriptor(r,t);return i.get?i.get.call(n||e):i.value}},At(e,t,n)}function Ot(e,t,n){return At(e,t,n)}function kt(e,t){return kt=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},kt(e,t)}function Ct(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&kt(e,t)}function Nt(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Mt(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=It(e);if(t){var i=It(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return function(e,t){return!t||"object"!==mt(t)&&"function"!=typeof t?Nt(e):t}(this,n)}}var Rt,xt,Dt=(Rt=function(e){var t=Object.prototype.hasOwnProperty,n="~";function r(){}function i(e,t,n){this.fn=e,this.context=t,this.once=n||!1}function o(e,t,r,o,a){if("function"!=typeof r)throw new TypeError("The listener must be a function");var s=new i(r,o||e,a),u=n?n+t:t;return e._events[u]?e._events[u].fn?e._events[u]=[e._events[u],s]:e._events[u].push(s):(e._events[u]=s,e._eventsCount++),e}function a(e,t){0==--e._eventsCount?e._events=new r:delete e._events[t]}function s(){this._events=new r,this._eventsCount=0}Object.create&&(r.prototype=Object.create(null),(new r).__proto__||(n=!1)),s.prototype.eventNames=function(){var e,r,i=[];if(0===this._eventsCount)return i;for(r in e=this._events)t.call(e,r)&&i.push(n?r.slice(1):r);return Object.getOwnPropertySymbols?i.concat(Object.getOwnPropertySymbols(e)):i},s.prototype.listeners=function(e){var t=n?n+e:e,r=this._events[t];if(!r)return[];if(r.fn)return[r.fn];for(var i=0,o=r.length,a=new Array(o);i<o;i++)a[i]=r[i].fn;return a},s.prototype.listenerCount=function(e){var t=n?n+e:e,r=this._events[t];return r?r.fn?1:r.length:0},s.prototype.emit=function(e,t,r,i,o,a){var s=n?n+e:e;if(!this._events[s])return!1;var u,c,l=this._events[s],d=arguments.length;if(l.fn){switch(l.once&&this.removeListener(e,l.fn,void 0,!0),d){case 1:return l.fn.call(l.context),!0;case 2:return l.fn.call(l.context,t),!0;case 3:return l.fn.call(l.context,t,r),!0;case 4:return l.fn.call(l.context,t,r,i),!0;case 5:return l.fn.call(l.context,t,r,i,o),!0;case 6:return l.fn.call(l.context,t,r,i,o,a),!0}for(c=1,u=new Array(d-1);c<d;c++)u[c-1]=arguments[c];l.fn.apply(l.context,u)}else{var p,f=l.length;for(c=0;c<f;c++)switch(l[c].once&&this.removeListener(e,l[c].fn,void 0,!0),d){case 1:l[c].fn.call(l[c].context);break;case 2:l[c].fn.call(l[c].context,t);break;case 3:l[c].fn.call(l[c].context,t,r);break;case 4:l[c].fn.call(l[c].context,t,r,i);break;default:if(!u)for(p=1,u=new Array(d-1);p<d;p++)u[p-1]=arguments[p];l[c].fn.apply(l[c].context,u)}}return!0},s.prototype.on=function(e,t,n){return o(this,e,t,n,!1)},s.prototype.once=function(e,t,n){return o(this,e,t,n,!0)},s.prototype.removeListener=function(e,t,r,i){var o=n?n+e:e;if(!this._events[o])return this;if(!t)return a(this,o),this;var s=this._events[o];if(s.fn)s.fn!==t||i&&!s.once||r&&s.context!==r||a(this,o);else{for(var u=0,c=[],l=s.length;u<l;u++)(s[u].fn!==t||i&&!s[u].once||r&&s[u].context!==r)&&c.push(s[u]);c.length?this._events[o]=1===c.length?c[0]:c:a(this,o)}return this},s.prototype.removeAllListeners=function(e){var t;return e?(t=n?n+e:e,this._events[t]&&a(this,t)):(this._events=new r,this._eventsCount=0),this},s.prototype.off=s.prototype.removeListener,s.prototype.addListener=s.prototype.on,s.prefixed=n,s.EventEmitter=s,e.exports=s},Rt(xt={exports:{}},xt.exports),xt.exports),Ut="ACTION_CALLBACK";var Lt=function(e){Ct(n,e);var t=Mt(n);function n(){var e;return Et(this,n),(e=t.apply(this,arguments)).debug=vt("zmp:event-emitter"),e}var r=n.prototype;return r.h5ConfirmHandleEvent=function(e,t,n){ZaloJavaScriptInterface.jsH5EventCallback(e,t,n||"")},r.on=function(e,t,r){var i=this;if(e===Ut||e===f.PaymentCallback)return Ot(It(n.prototype),"on",this).call(this,e,t,r);this.debug("register ".concat(String(e),": ").concat(r));return Ot(It(n.prototype),"on",this).call(this,e,(function(n,o){i.h5ConfirmHandleEvent(n,e,r),t(o)}),r)},r.once=function(e,t,r){var i=this;if(e===Ut)return Ot(It(n.prototype),"once",this).call(this,e,t,r);this.debug("register once ".concat(String(e),": ").concat(r));return Ot(It(n.prototype),"once",this).call(this,e,(function(n,o){i.h5ConfirmHandleEvent(n,e,r),t(o)}),r)},n.getInstance=function(){return n.instance||(n.instance=new n),n.instance},n}(Dt);function jt(e){Lt.getInstance().emit(Ut,e)}function Bt(e){var t=[];for(var n in e)if(e.hasOwnProperty(n)){var r=e[n];if(void 0===r)return;if(null===r)return void t.push(n);t.push(encodeURIComponent(n)+"="+encodeURIComponent(r))}return t.join("&")}window.onNativeMessage=function(e,t){return function(n){jt({serialId:e,actionName:t,result:n})}},window.zaloJSV2={zalo_h5_event_handler:function(e,t,n){var r=vt("zmp:zalo_h5_event_handler");r("eventId: ".concat(e,", eventName: ").concat(t,", eventData: ").concat(n));var o=yn(n);r("stringToData",o);var a=function(e,t){try{if(e===f.OpenApp){var n=t.url,r=new URL(n),o=r.pathname.split("/zapps/".concat(i))[1];return{path:"".concat(o||"/").concat(r.search)}}return t}catch(e){return t}}(t,o);Lt.getInstance().emit(t,e,a)}},window.zaloNative2JS={nativeCall:function(e,t,n){Lt.getInstance().emit(f.PaymentCallback,e,t,n)}};var Zt={encode:Bt,decode:function(e,t){var n={};if(""===e)return n;for(var r=e.split("&"),i=0;i<r.length;i++){var o=r[i].split("=",2),a=decodeURIComponent(o[0]);if(t&&Object.prototype.hasOwnProperty.call(n,a))throw new URIError("Duplicate key: "+a);n[a]=2===o.length?decodeURIComponent(o[1]):null}return n},appendToUrl:function(e,t){return e+(-1!==e.indexOf("?")?"&":"?")+("string"==typeof t?t:Bt(t))},getParameterByName:function(e,t){t||(t=window.location.href),e=e.replace(/[\[\]]/g,"\\$&");var n=new RegExp("[?&]"+e+"(=([^&#]*)|&|#|$)").exec(t);return n?n[2]?decodeURIComponent(n[2].replace(/\+/g," ")):"":null},getParamsAsObject:function(e){var t={};return e?(e.split("&").map((function(e){var n=e.split("=");n&&2==n.length&&(t[n[0]]=decodeURIComponent(n[1].replace(/\+/g," ")))})),t):t},toQueryString:function(e){if(!e)return"";if("object"!=(void 0===e||void 0===e?"undefined":mt(e)))return e;var t=Object.keys(e),n=[];return t.map((function(t){var r=e[t],i=[t,r="object"==(void 0===r||void 0===r?"undefined":mt(r))?JSON.stringify(r):encodeURIComponent(r)].join("=");n.push(i)})),n.join("&")}},zt={},Wt=function(e,t,n){var r=t||"default";return function(){return(r in zt?zt[r](e,n):e).apply(this,arguments)}};Wt.setWrapper=function(e){zt[arguments.length<=1||void 0===arguments[1]?"default":arguments[1]]=e};var Ft={error:{code:1,error_subcode:1357046,message:"Received Invalid JSON reply.",type:"http"}};function Vt(e){try{return null===e?Ft:JSON.parse(e)}catch(e){return Ft}}var Gt,Ht={execute:function(e,t,n,r){n.suppress_http_code=1;var i=Zt.encode(n);"post"!=t&&(e=Zt.appendToUrl(e,i),i="");var o=function(e,t){if(!self.XMLHttpRequest)return null;var n=new XMLHttpRequest,r=function(){};if(!("withCredentials"in n))return null;n.open(e,t,!0),n.setRequestHeader("Content-type","application/x-www-form-urlencoded");var i={send:function(e){n.send(e)}},o=Wt((function(){o=r,"onload"in i&&i.onload(n)}),"entry","XMLHttpRequest:load"),a=Wt((function(){a=r,"onerror"in i&&i.onerror(n)}),"entry","XMLHttpRequest:error");return n.onload=function(){o()},n.onerror=function(){a()},n.onreadystatechange=function(){4==n.readyState&&(200==n.status?o():a())},i}(t,e);return!!o&&(o.onload=function(e){r(Vt(e.responseText))},o.onerror=function(e){e.responseText?r(Vt(e.responseText)):r({error:{code:1,error_subcode:1357045,message:"unknown error (empty response)",status:e.status,type:"http"}})},o.send(i),!0)}},Kt=Ht,Jt=(Gt=Ee((function(e,t,n){var r,i,o,a;return Oe(this,(function(s){switch(s.label){case 0:return r={appId:e,versionStatus:t},Tt.isUndefined(n)||(r.currentVersion=n),i=Zt.appendToUrl(l.GET_APP_INFO,r),[4,fetch(i,{credentials:"include"})];case 1:return(o=s.sent()).ok?[4,o.json()]:[3,3];case 2:if((a=s.sent()).err<0||!a.data)throw new Error(a);return[2,{name:a.data.name,version:a.data.version,description:a.data.description,appUrl:a.data.appUrl,qrCodeUrl:a.data.qrCodeUrl,logoUrl:a.data.logoUrl,cateID:a.data.cateType}];case 3:throw new Error("Can't get app info")}}))})),function(e,t,n){return Gt.apply(this,arguments)});function qt(e){try{var t=e.map((function(e){return{action:e.action,error:e.error,message:e.message,data:e.data}}));Kt.execute(l.SEND_ACTION_LOG,"post",{appId:window.APP_ID,data:JSON.stringify(t)},(function(){}))}catch(e){}}var Qt=function(e){return e.replace(/[A-Z]/g,(function(e){return"_".concat(e.toLowerCase())}))},$t=function(){var e;return"android"===((null===(e=xe())||void 0===e?void 0:e.platformName)||"").toLowerCase()},Yt=function(){var e=0;if(window.zaloVersionCode)e=window.zaloVersionCode;else{var t,n=Number((null===(t=xe())||void 0===t?void 0:t.zaloVersion)||"");if(n>=24112e3)e=n;else{var r,i=((null===(r=xe())||void 0===r?void 0:r.platformName)||"").toLowerCase();"android"===i?e=n%1e4:"ios"===i&&(e=n)}}return e},Xt=function(e,t){var n=Yt();return $t()&&n<e||function(){var e;return"ios"===((null===(e=xe())||void 0===e?void 0:e.platformName)||"").toLowerCase()}()&&n<t};function en(e,t){return null!=t&&"undefined"!=typeof Symbol&&t[Symbol.hasInstance]?!!t[Symbol.hasInstance](e):e instanceof t}var tn,nn=function(){function e(t,n,r,i){Et(this,e),this.code=t,this.message=n,this.api=r,this.detail=i}var t=e.prototype;return t.toString=function(){return"api: ".concat(String(this.api),"; code: ").concat(this.code,"; message: ").concat(JSON.stringify(this.message))},t.toJSON=function(){return{code:this.code,message:this.message,api:this.api,detail:this.detail}},e}(),rn=function(e,t){return en(e,nn)?function(e,t){return e.api=t,e.toJSON()}(e,t):function(e,t){return en(e,Error)?new nn(D,e.message,t).toJSON():Tt.isEmpty(null==e?void 0:e.message)||Tt.isEmpty(null==e?void 0:e.code)?new nn(D,K,t,e).toJSON():new nn(e.code,e.message,t,e.detail).toJSON()}(e,t)},on=(tn=Ee((function(e){var t;return Oe(this,(function(n){switch(n.label){case 0:return t={headers:{"Content-Type":"application/x-www-form-urlencoded",authorization:"Bearer ".concat(e)}},[4,fetch(l.GET_AUTH_SETTING,Be({method:"GET"},t))];case 1:return[4,n.sent().json()];case 2:return[2,n.sent()]}}))})),function(e){return tn.apply(this,arguments)}),an=Ee((function(){return Oe(this,(function(e){return[2,new Promise(function(){var e=Ee((function(e,t){var n,r,i,o;return Oe(this,(function(a){switch(a.label){case 0:return a.trys.push([0,3,,4]),[4,fn.jumpAndGetToken()];case 1:return a.sent(),(r=null===(n=fn.miniProgramConfig)||void 0===n?void 0:n.jwt)||t(new nn(j,Q,"getSetting")),[4,on(r)];case 2:return(i=a.sent())&&0===i.err?e({authSetting:i.data}):t(new nn(i.err,i.msg,"getSetting")),[3,4];case 3:return o=a.sent(),t(o),[3,4];case 4:return[2]}}))}));return function(t,n){return e.apply(this,arguments)}}())]}))})),sn=function(){var e,t,n,r=xe(),i={},o=Lt.getInstance(),a=[],s=!1;return s||(t=function(e){var t=e.serialId,n=gn(e.result),r=Tn(null==n?void 0:n.action),s=Tt.isEmpty(null==n?void 0:n.error_code)?0:null==n?void 0:n.error_code,u=null==n?void 0:n.error_message,c=(null==n?void 0:n.data)||n;if(r&&0===s){var l=JSON.parse(null==n?void 0:n.data);s=Tt.isEmpty(null==l?void 0:l.error_code)?0:null==l?void 0:l.error_code,u=null==l?void 0:l.error_message,c=(null==l?void 0:l.data)||l}var d={error_code:s,error_message:u,data:c,action:(null==n?void 0:n.action)||e.actionName};if(t&&i[t]){var p=i[t],h=p.callback,m=p.timeout,v=p.isMultiCallback,y=p.options,g=p.downloadListener;!function(e,t){var n=t||{},r=n.success,i=n.fail;0===e.error_code?Tt.isFunction(r)&&r(e):Tt.isFunction(i)&&i(e)}(d,h),!v&&delete i[t],m&&clearTimeout(m);var _={action:null==d?void 0:d.action,error:null==d?void 0:d.error_code,message:null==d?void 0:d.error_message,data:{}};try{if("action.open.inapp"===d.action||"action.open.outapp"===d.action){var w=new URL(null==y?void 0:y.url),b="".concat(w.protocol,"//").concat(w.host).concat(w.pathname);_.data={url:b}}if("action.follow.oa"===d.action||"action.unfollow.oa"===d.action){var T=null==y?void 0:y.uid;_.data={uid:T}}if("action.open.chat"===d.action){var E=null==y?void 0:y.uId,S=null==y?void 0:y.type;_.data={uid:E,openChatType:S}}(null==y?void 0:y.onProgress)&&g&&o.off(f.DownloadProgress,g)}catch(e){}a.push(_)}},Lt.getInstance().on(Ut,t),o.on(f.AppPaused,(function(){if(a.length>0){var e=a;a=[],qt(e)}})),e?clearInterval(e):e=setInterval((function(){if(a.length>0){var e=a;a=[],qt(e)}}),5e3),s=!0),n=Ee((function(e,t,n,a){var s,u,c,l,d,p,h,m,v,y,g,_,w,b,T,E,S,P,I,A,O,k,C;return Oe(this,(function(N){switch(N.label){case 0:return u=Math.floor(1e6*Math.random()),c="".concat(e,"_").concat(u),l=In(e),(null==a?void 0:a.actionName)&&a.actionName.length>0&&(l=null==a?void 0:a.actionName),d=(null==a?void 0:a.isMultiCallback)||!1,p=!1!==(null==a?void 0:a.timeout)&&((null==a?void 0:a.timeout)||!0),h=(null==a?void 0:a.haveCallback)||!1,m=(null==a?void 0:a.skipJump)||!1,v=(null==a?void 0:a.requireAccessToken)||!1,y=En(l),t&&n&&(i[c]={options:t,callback:n,isMultiCallback:d},p&&h&&(i[c].timeout=setTimeout((function(){return jt({serialId:c,result:{error_code:Z,error_message:q,data:{timeout:p},action:e}}),null}),!0===p?8e3:1e3*p))),y?[4,an()]:[3,2];case 1:if(!1===(null==(_=N.sent())||null===(g=_.authSetting)||void 0===g?void 0:g["scope.userInfo"]))return jt({serialId:c,result:{error_code:j,error_message:X,data:{isMobile:null==r||null===(w=r.platform)||void 0===w?void 0:w.isMobile},action:e}}),[2];N.label=2;case 2:return b=Tn(l),!(null==r||null===(s=r.platform)||void 0===s?void 0:s.isMobile)||!e||Tt.isUndefined(ZaloJavaScriptInterface)||r.platform.isIOS&&!vn(e)||b&&!1===b.isSupported?(jt({serialId:c,result:{error_code:B,error_message:Y,data:{isMobile:null==r||null===(T=r.platform)||void 0===T?void 0:T.isMobile},action:e}}),[2]):(E=mn(t),m?[3,4]:[4,fn.getJSAccessToken()]);case 3:return P=N.sent(),[3,5];case 4:P="",N.label=5;case 5:S=P,N.label=6;case 6:return N.trys.push([6,10,,11]),m||!v?[3,8]:[4,fn.getAccessToken()];case 7:return A=N.sent(),[3,9];case 8:A="",N.label=9;case 9:return I=A,[3,11];case 10:return O=N.sent(),jt({serialId:c,result:{error_code:null==O?void 0:O.code,error_message:null==O?void 0:O.message,action:e}}),[2];case 11:try{t&&(null==t?void 0:t.onProgress)&&(k=function(e){!function(e,t){e.url;var n=e.progress;t&&t(n)}(e,null==t?void 0:t.onProgress)},i[c].downloadListener=k,o.on(f.DownloadProgress,k))}catch(e){}return C=r.platform.isIOS?window.onNativeMessage(c,l):'window.onNativeMessage("'.concat(c,'", "').concat(l,'")'),[2,ZaloJavaScriptInterface.jsCall(S,l,I,E,C)]}}))})),function(e,t,r,i){return n.apply(this,arguments)}}(),un={success:function(e,t){return{code:x,message:t||H,data:e||{}}},error:{failLimit:function(){return new nn(z,J)},badRequest:function(e){return new nn(U,e)},loginFailed:function(e){return new nn(j,"".concat($,": ").concat(e))},loginRequired:function(){return new nn(j,Q)},cannotGetShareInfo:function(){return new nn(L,"Can not get app info to share")},createIAPOrderFailed:function(e){var t=Object.keys(be).find((function(t){return t===e.toString()}));return new nn(e,t||K)},clientNotSupport:function(){return new nn(B,Y)}}},cn=function(e){var t,n,r,i=null===(t=xe())||void 0===t?void 0:t.platformName,o=Pn(e.action),a=ae[o],s=(null==a?void 0:a.skipJump)||!1,u=(null==a?void 0:a.errorList)||{};if("JUMP_LOGIN"===o)return new nn(D,"Can not get auth code: ".concat(e.error_message));if(fn.jumpStatus!==h.DONE&&!s)return new nn(ie.UNAUTHORIZED.code,ie.UNAUTHORIZED.message);if("permission required!"===String(e.error_message).toLowerCase()||"no permission!"===String(e.error_message).toLowerCase())return new nn(ie.FORBIDDEN.code,ie.FORBIDDEN.message);if(i&&(null===(n=se[i])||void 0===n?void 0:n[e.error_code]))return new nn(se[i][e.error_code].code,se[i][e.error_code].message);var c=null==u||null===(r=u[i])||void 0===r?void 0:r[String(e.error_code)];if(c){var l,d,p,f=null===(l=c.mapTo)||void 0===l?void 0:l.message;if(null==c?void 0:c.needMoreDetail)f="".concat(null==c||null===(p=c.mapTo)||void 0===p?void 0:p.message,": ").concat(e.error_message);return new nn(null===(d=c.mapTo)||void 0===d?void 0:d.code,f)}return new nn(e.error_code,e.error_message)},ln=function(e,n,r,i){var o=function(e,n){function r(r){return function(i){var o=Tt.isEmpty(n)?void 0:n[r];if(o)return Ue({stage:t.RES