zmp-sdk 2.40.0 → 2.41.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index.umd.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @timeBuild 20-09-2024 10:41:52
2
+ * @timeBuild 24-09-2024 11:08:44
3
3
  * @license zmp-sdk
4
4
  *
5
5
  * Copyright @ 2024. Zalo Group.
@@ -7,7 +7,7 @@
7
7
  * This source code is licensed under the MIT license found in the LICENSE file in the root directory of this source tree.
8
8
  */
9
9
 
10
- !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self)["zmp-sdk"]={})}(this,(function(e){"use strict";function t(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 n,r=1048576,i=window.zAppID,o=window.APP_ID,a="https://zalo.me/s",s="https://h5.zdn.vn/zapps",u="h5.zdn.vn",c="/zapps",l={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"},d={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"}(n||(n={}));var p,f,h,m,v,y,g,_,w,b,T,E,P,S,A,O,I,k,C,N,M,R,x=0,U=-2e3,D=-1400,j=-1500,L=-1401,B=-1404,Z=-1408,z=-1409,W=-2004,F=-2005,G="Success",H="Unknown error. Please try again later.",V="Request limit exceeded. Please try again later.",K="Request timeout. Please try again later.",J="Please login (https://miniapp.zalo.me/docs/api/login) before to call this api",q="Login failed",Q="This API is not supported in this version of Zalo",$="User Authentication Required. Please grant User Authentication permission before requesting User Permission",Y="Unable to pick media",X="Unable to save image",ee={SUCCESS:{code:x,message:G},UNKNOWN_ERROR:{code:U,message:H},UNAUTHORIZED:{code:L,message:J},FORBIDDEN:{code:-1403,message:"You don't have permission to call this api"},CLIENT_NOT_SUPPORT:{code:B,message:Q},DECODE_FAILED:{code:-2001,message:"Can not decode id. Please check your params again."},TIME_OUT:{code:Z,message:K},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."}},te={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:{}},ne={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:ee.DUPLICATE_REQUEST}},iOS:{"-400":{mapTo:ee.DUPLICATE_REQUEST}}}},UNFOLLOW_OA:{haveCallback:!0,requireAccessToken:!0,errorList:{android:{"-400":{mapTo:ee.DUPLICATE_REQUEST}},iOS:{"-400":{mapTo:ee.DUPLICATE_REQUEST}}}},OPEN_GAMEDETAIL:{},OPEN_SHARESHEET:{haveCallback:!0,requireAccessToken:!0,errorList:{android:{"-101":{mapTo:ee.CLIENT_NOT_SUPPORT}},iOS:{"-101":{mapTo:ee.CLIENT_NOT_SUPPORT}}}},REQUEST_PERMISSION_CAMERA:{errorList:{android:{"-2":{mapTo:ee.USER_DENIED}},iOS:{"-2":{mapTo:ee.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:ee.USER_DENIED},"-400":{mapTo:ee.DUPLICATE_REQUEST}},iOS:{"-1":{mapTo:ee.USER_DENIED},"-400":{mapTo:ee.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:{},INTERACTIVE_VIBRATION:{},SAVE_IMAGE_GALLERY:{versionLive:{iOS:408},errorList:{android:{"-101":{mapTo:{code:F,message:X},needMoreDetail:!0},"-102":{mapTo:{code:F,message:X},needMoreDetail:!0}},iOS:{"-10":{mapTo:{code:F,message:X},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}},WEBVIEW_SET_RESULT:{versionLive:{iOS:416}},MP_GET_NUMBER:{versionLive:{iOS:416},errorList:{android:{"-1":{mapTo:ee.USER_DENIED},"-101":{mapTo:ee.USER_DENIED},"-400":{mapTo:ee.DUPLICATE_REQUEST}},iOS:{"-1":{mapTo:ee.USER_DENIED},"-10":{mapTo:ee.USER_DENIED},"-400":{mapTo:ee.DUPLICATE_REQUEST}}}},MP_OPEN_PROFILE_PICKER:{requireAccessToken:!0,versionLive:{iOS:432},errorList:{android:{"-101":{mapTo:ee.USER_CANCEL}},iOS:{"-101":{mapTo:ee.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:ee.USER_CANCEL},999:{mapTo:{code:W,message:Y},needMoreDetail:!0}},iOS:{"-10":{mapTo:{code:W,message:Y}}}}},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:ee.USER_DENIED},"-400":{mapTo:ee.DUPLICATE_REQUEST}},iOS:{"-1":{mapTo:ee.USER_DENIED},"-400":{mapTo:ee.DUPLICATE_REQUEST}}}},MP_ADD_RATING:{skipJump:!1},MP_ADD_MYFAVORITES:{skipJump:!1},MP_INTERACT_OA:{skipJump:!1,errorList:{android:{"-400":{mapTo:ee.DUPLICATE_REQUEST}},iOS:{"-400":{mapTo:ee.DUPLICATE_REQUEST}}}},MP_USER_AUTHORIZE:{skipJump:!1,errorList:{android:{"-400":{mapTo:ee.DUPLICATE_REQUEST}},iOS:{"-400":{mapTo:ee.DUPLICATE_REQUEST}}}},MP_SELECT_PAYMENT_METHOD:{skipJump:!1},MP_CONFIRM_REQUEST_PAYMENT:{skipJump:!1}},re={android:{"-4":ee.DECODE_FAILED,"-5":ee.CLIENT_NOT_SUPPORT,"-14":ee.TIME_OUT},iOS:{"-9":ee.DECODE_FAILED,"-5":ee.CLIENT_NOT_SUPPORT,"-14":ee.TIME_OUT}},ie={android:12100615,iOS:460,wp:0,unknown:0},oe=5*r,ae="https://payment-mini.zalo.me/api/order/create",se="https://payment-mini.zalo.me/api/order/iap-create",ue="https://payment-mini.zalo.me/api/transaction",ce="https://payment-mini.zalo.me/api/order/purchase",le="DEFERRED",de="IMMEDIATE_AND_CHARGE_FULL_PRICE",pe={SHOW_BACK:0,HIDE_BACK:3,SHOW_HOME:1,HIDE_HOME:0},fe=5,he=6,me="#1843EF",ve=0,ye={"-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 ge(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 _e(e){return function(){var t=this,n=arguments;return new Promise((function(r,i){var o=e.apply(t,n);function a(e){ge(o,r,i,a,s,"next",e)}function s(e){ge(o,r,i,a,s,"throw",e)}a(void 0)}))}}function we(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 be(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function Te(e,t){if(e){if("string"==typeof e)return we(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)?we(e,t):void 0}}function Ee(e){return function(e){if(Array.isArray(e))return we(e)}(e)||be(e)||Te(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 Pe(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 Se(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,Ee(n))}catch(e){return"undefined"!=typeof console&&console.error&&console.error(e),null}}}function Ae(e){var t=new URL(window.location.href).searchParams.get("env");return{isMp:window.location.hostname.includes(u)&&("TESTING_LOCAL"==t||window.location.pathname.startsWith(c)),isMpWeb:window.location.hostname.includes("localhost")}}Se.async=function(e){return _e((function(){var t,n,r,i,o=arguments;return Pe(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,Ee(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]}}))}))},e.NetworkType=void 0,(p=e.NetworkType||(e.NetworkType={})).none="none",p.wifi="wifi",p.cellular="cellular",p.unknown="unknown",e.PlatformType=void 0,(f=e.PlatformType||(e.PlatformType={})).wp="wp",f.android="android",f.iOS="iOS",f.unknown="unknown",e.Events=void 0,(h=e.Events||(e.Events={})).AppPaused="h5.event.paused",h.AppResumed="h5.event.resumed",h.NetworkChanged="h5.event.connection.changed",h.OnDataCallback="h5.event.webview.result",h.WebviewClosed="h5.event.webview.close",h.OpenApp="h5.event.open.mp",h.AppClose="h5.event.action.close",h.PaymentCallback="payment.callback",h.PaymentResult="action.payment.result",h.PaymentClose="action.payment.close",e.JumpStatus=void 0,(m=e.JumpStatus||(e.JumpStatus={})).DOING="doing",m.DONE="done",e.ProfileType=void 0,(v=e.ProfileType||(e.ProfileType={}))[v.user=1]="user",v[v.oa=0]="oa",v[v.aliasOA=2]="aliasOA",e.ChatType=void 0,(y=e.ChatType||(e.ChatType={}))[y.user=1]="user",y[y.oa=0]="oa",e.PostFeedType=void 0,(g=e.PostFeedType||(e.PostFeedType={}))[g.image=1]="image",g[g.link=4]="link",g[g.profile=5]="profile",e.ShareSheetType=void 0,(_=e.ShareSheetType||(e.ShareSheetType={}))[_.image=1]="image",_[_.gif=11]="gif",_[_.video=12]="video",_[_.link=4]="link",_[_.oa=5]="oa",_[_.zmp=20]="zmp",_[_.multi_image=21]="multi_image",_[_.zmp_deep_link=4]="zmp_deep_link",_[_.text=22]="text",e.OrientationType=void 0,(w=e.OrientationType||(e.OrientationType={}))[w.auto=1]="auto",w[w.portrait=2]="portrait",w[w.landscape=3]="landscape",e.VibrateType=void 0,(b=e.VibrateType||(e.VibrateType={}))[b.oneShot=0]="oneShot",e.MediaPickerType=void 0,(T=e.MediaPickerType||(e.MediaPickerType={}))[T.zcamera=3]="zcamera",T[T.zcamera_photo=1]="zcamera_photo",T[T.zcamera_video=2]="zcamera_video",T[T.zcamera_scan=7]="zcamera_scan",T[T.photo=4]="photo",T[T.video=5]="video",T[T.file=6]="file",e.IAPPayType=void 0,(E=e.IAPPayType||(e.IAPPayType={})).SUBSCRIPTION="SUBSCRIPTION",E.ONETIME="ONETIME",e.ProrationMode=void 0,(P=e.ProrationMode||(e.ProrationMode={}))[P.UNKNOW=0]="UNKNOW",P[P.DEFERRED=1]="DEFERRED",P[P.IMMEDIATE_AND_CHARGE_FULL_PRICE=2]="IMMEDIATE_AND_CHARGE_FULL_PRICE",e.StatusBarType=void 0,(S=e.StatusBarType||(e.StatusBarType={}))[S.normal=1]="normal",S[S.hidden=0]="hidden",S[S.transparent=2]="transparent",e.AndroidBottomNavigationBarType=void 0,(A=e.AndroidBottomNavigationBarType||(e.AndroidBottomNavigationBarType={}))[A.show=1]="show",A[A.hide=0]="hide",e.IOSSafeAreaBottomType=void 0,(O=e.IOSSafeAreaBottomType||(e.IOSSafeAreaBottomType={}))[O.show=1]="show",O[O.hide=0]="hide",e.TextAlignType=void 0,(I=e.TextAlignType||(e.TextAlignType={}))[I.left=0]="left",I[I.center=1]="center",e.CameraEvents=void 0,(k=e.CameraEvents||(e.CameraEvents={})).OnFrameCallback="h5.event.camera.frame",k.OnStartCallback="h5.event.camera.start",k.OnStopCallback="h5.event.camera.stop",e.FacingMode=void 0,(C=e.FacingMode||(e.FacingMode={})).FRONT="user",C.BACK="environment",e.PhotoFormat=void 0,(N=e.PhotoFormat||(e.PhotoFormat={})).WEBP="image/webp",N.PNG="image/png",N.JPEG="image/jpeg",e.PhotoQuality=void 0,(M=e.PhotoQuality||(e.PhotoQuality={})).HIGH="high",M.NORMAL="normal",M.LOW="low",e.StreamType=void 0,(R=e.StreamType||(e.StreamType={})).VIDEO="video",R.AUDIO="audio";var Oe,Ie=function(t){return t.isAndroid?e.PlatformType.android:t.isIOS?e.PlatformType.iOS:e.PlatformType.unknown};function ke(e){var t=e.split("zalo")[1];return t&&t.replace(" ","").split("/")[1]||""}function Ce(){var e=function(){var e=Se((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:Ae(),platform:t,platformName:Ie(t),zaloVersion:ke(e).trim()}}}();if(e)return e}var Ne=(null===(Oe=Ce())||void 0===Oe?void 0:Oe.appEnv)||{};function Me(e){Me.on&&Me.engine(e)}Me.on=!1,Me.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 Re=function(e,t){var r,i={error:-1404,errorMessage:"".concat(e," is not found")};null==t||null===(r=t.fail)||void 0===r||r.call(t,i),Me({stage:n.NOT_FOUND,type:"error",name:e,request:t,state:"fail",response:i})};function xe(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Ue(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){xe(e,t,n[t])}))}return e}function De(e,t){return function(e){if(Array.isArray(e))return e}(e)||be(e)||Te(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 je="undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{};function Le(){throw new Error("setTimeout has not been defined")}function Be(){throw new Error("clearTimeout has not been defined")}var Ze=Le,ze=Be;function We(e){if(Ze===setTimeout)return setTimeout(e,0);if((Ze===Le||!Ze)&&setTimeout)return Ze=setTimeout,setTimeout(e,0);try{return Ze(e,0)}catch(t){try{return Ze.call(null,e,0)}catch(t){return Ze.call(this,e,0)}}}"function"==typeof je.setTimeout&&(Ze=setTimeout),"function"==typeof je.clearTimeout&&(ze=clearTimeout);var Fe,Ge=[],He=!1,Ve=-1;function Ke(){He&&Fe&&(He=!1,Fe.length?Ge=Fe.concat(Ge):Ve=-1,Ge.length&&Je())}function Je(){if(!He){var e=We(Ke);He=!0;for(var t=Ge.length;t;){for(Fe=Ge,Ge=[];++Ve<t;)Fe&&Fe[Ve].run();Ve=-1,t=Ge.length}Fe=null,He=!1,function(e){if(ze===clearTimeout)return clearTimeout(e);if((ze===Be||!ze)&&clearTimeout)return ze=clearTimeout,clearTimeout(e);try{ze(e)}catch(t){try{return ze.call(null,e)}catch(t){return ze.call(this,e)}}}(e)}}function qe(e,t){this.fun=e,this.array=t}qe.prototype.run=function(){this.fun.apply(null,this.array)};function Qe(){}var $e=Qe,Ye=Qe,Xe=Qe,et=Qe,tt=Qe,nt=Qe,rt=Qe;var it=je.performance||{},ot=it.now||it.mozNow||it.msNow||it.oNow||it.webkitNow||function(){return(new Date).getTime()};var at=new Date;var st,ut={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];Ge.push(new qe(e,t)),1!==Ge.length||He||We(Je)},title:"browser",browser:!0,env:{},argv:[],version:"",versions:{},on:$e,addListener:Ye,once:Xe,off:et,removeListener:tt,removeAllListeners:nt,emit:rt,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*ot.call(it),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-at)/1e3}},ct=ut,lt="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function dt(e){return e&&e.constructor===Symbol?"symbol":typeof e}function pt(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 lt?lt:"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 ct&&ct.env&&"true"===ct.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(U(n)){if(!G(e))throw new TypeError;if(!V(t))throw new TypeError;return P(e,t)}if(!G(e))throw new TypeError;if(!L(t))throw new TypeError;if(!L(r)&&!U(r)&&!D(r))throw new TypeError;return D(r)&&(r=void 0),S(e,t,n=F(n),r)}function m(e,t){function n(n,r){if(!L(n))throw new TypeError;if(!U(r)&&!K(r))throw new TypeError;N(e,t,n,r)}return n}function v(e,t,n,r){if(!L(n))throw new TypeError;return U(r)||(r=F(r)),N(e,t,n,r)}function y(e,t,n){if(!L(t))throw new TypeError;return U(n)||(n=F(n)),O(e,t,n)}function g(e,t,n){if(!L(t))throw new TypeError;return U(n)||(n=F(n)),I(e,t,n)}function _(e,t,n){if(!L(t))throw new TypeError;return U(n)||(n=F(n)),k(e,t,n)}function w(e,t,n){if(!L(t))throw new TypeError;return U(n)||(n=F(n)),C(e,t,n)}function b(e,t){if(!L(e))throw new TypeError;return U(t)||(t=F(t)),M(e,t)}function T(e,t){if(!L(e))throw new TypeError;return U(t)||(t=F(t)),R(e,t)}function E(e,t,n){if(!L(t))throw new TypeError;U(n)||(n=F(n));var r=A(t,n,!1);if(U(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 P(e,t){for(var n=e.length-1;n>=0;--n){var r=(0,e[n])(t);if(!U(r)&&!D(r)){if(!V(r))throw new TypeError;t=r}}return t}function S(e,t,n,r){for(var i=e.length-1;i>=0;--i){var o=(0,e[i])(t,n,r);if(!U(o)&&!D(o)){if(!L(o))throw new TypeError;r=o}}return r}function A(e,t,n){var r=f.get(e);if(U(r)){if(!n)return;r=new d,f.set(e,r)}var i=r.get(t);if(U(i)){if(!n)return;i=new d,r.set(t,i)}return i}function O(e,t,n){if(I(e,t,n))return!0;var r=X(t);return!D(r)&&O(e,r,n)}function I(e,t,n){var r=A(t,n,!1);return!U(r)&&z(r.has(e))}function k(e,t,n){if(I(e,t,n))return C(e,t,n);var r=X(t);return D(r)?void 0:k(e,r,n)}function C(e,t,n){var r=A(t,n,!1);if(!U(r))return r.get(e)}function N(e,t,n,r){A(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=A(e,t,!1);if(U(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 U(e){return void 0===e}function D(e){return null===e}function j(e){return"symbol"==typeof e}function L(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(L(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(H(n))if(!L(i=n.call(e)))return i;if(H(r=e.valueOf))if(!L(i=r.call(e)))return i}else{var r;if(H(r=e.valueOf))if(!L(i=r.call(e)))return i;var i,o=e.toString;if(H(o))if(!L(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 j(t)?t:W(t)}function G(e){return Array.isArray?Array.isArray(e):e instanceof Object?e instanceof Array:"[object Array]"===Object.prototype.toString.call(e)}function H(e){return"function"==typeof e}function V(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(!H(n))throw new TypeError;return n}}function q(e){var t=J(e,i);if(!H(t))throw new TypeError;var n=t.call(e);if(!L(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)}()}(st||(st={}));var ft=Object.prototype.toString;var ht="[object Null]",mt="[object Undefined]";function vt(e){return null==e?void 0===e?mt:ht:function(e){return ft.call(e)}(e)}function yt(e){return null!=e&&"object"==typeof e}var gt={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||yt(e)&&"[object Number]"==vt(e)},isArray:function(e){return Array.isArray(e)},isRegExp:function(e){return yt(e)&&"[object RegExp]"==vt(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 _t(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function wt(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 bt(e){return bt=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},bt(e)}function Tt(e){return bt(e)}function Et(e,t,n){return Et="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=Tt(e)););return e}(e,t);if(r){var i=Object.getOwnPropertyDescriptor(r,t);return i.get?i.get.call(n||e):i.value}},Et(e,t,n)}function Pt(e,t,n){return Et(e,t,n)}function St(e,t){return St=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},St(e,t)}function At(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&&St(e,t)}function Ot(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function It(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=Tt(e);if(t){var i=Tt(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return function(e,t){return!t||"object"!==dt(t)&&"function"!=typeof t?Ot(e):t}(this,n)}}var kt=function(e,t){return e(t={exports:{}},t.exports),t.exports
10
+ !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self)["zmp-sdk"]={})}(this,(function(e){"use strict";function t(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 n,r=1048576,i=window.zAppID,o=window.APP_ID,a="https://zalo.me/s",s="https://h5.zdn.vn/zapps",u="h5.zdn.vn",c="/zapps",l={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"},d={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"}(n||(n={}));var p,f,h,m,v,y,g,_,w,T,b,E,S,P,A,O,I,k,C,N,M,R,x,U=0,D=-2e3,j=-1400,L=-1500,B=-1401,Z=-1404,z=-1408,W=-1409,F=-2004,G=-2005,H="Success",V="Unknown error. Please try again later.",K="Request limit exceeded. Please try again later.",J="Request timeout. Please try again later.",q="Please login (https://miniapp.zalo.me/docs/api/login) before to call this api",Q="Login failed",$="This API is not supported in this version of Zalo",Y="User Authentication Required. Please grant User Authentication permission before requesting User Permission",X="Unable to pick media",ee="Unable to save image",te={SUCCESS:{code:U,message:H},UNKNOWN_ERROR:{code:D,message:V},UNAUTHORIZED:{code:B,message:q},FORBIDDEN:{code:-1403,message:"You don't have permission to call this api"},CLIENT_NOT_SUPPORT:{code:Z,message:$},DECODE_FAILED:{code:-2001,message:"Can not decode id. Please check your params again."},TIME_OUT:{code:z,message:J},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."}},ne={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:{}},re={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:te.DUPLICATE_REQUEST}},iOS:{"-400":{mapTo:te.DUPLICATE_REQUEST}}}},UNFOLLOW_OA:{haveCallback:!0,requireAccessToken:!0,errorList:{android:{"-400":{mapTo:te.DUPLICATE_REQUEST}},iOS:{"-400":{mapTo:te.DUPLICATE_REQUEST}}}},OPEN_GAMEDETAIL:{},OPEN_SHARESHEET:{haveCallback:!0,requireAccessToken:!0,errorList:{android:{"-101":{mapTo:te.CLIENT_NOT_SUPPORT}},iOS:{"-101":{mapTo:te.CLIENT_NOT_SUPPORT}}}},REQUEST_PERMISSION_CAMERA:{errorList:{android:{"-2":{mapTo:te.USER_DENIED}},iOS:{"-2":{mapTo:te.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:te.USER_DENIED},"-400":{mapTo:te.DUPLICATE_REQUEST}},iOS:{"-1":{mapTo:te.USER_DENIED},"-400":{mapTo:te.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:{},INTERACTIVE_VIBRATION:{},SAVE_IMAGE_GALLERY:{versionLive:{iOS:408},errorList:{android:{"-101":{mapTo:{code:G,message:ee},needMoreDetail:!0},"-102":{mapTo:{code:G,message:ee},needMoreDetail:!0}},iOS:{"-10":{mapTo:{code:G,message:ee},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}},WEBVIEW_SET_RESULT:{versionLive:{iOS:416}},MP_GET_NUMBER:{versionLive:{iOS:416},errorList:{android:{"-1":{mapTo:te.USER_DENIED},"-101":{mapTo:te.USER_DENIED},"-400":{mapTo:te.DUPLICATE_REQUEST}},iOS:{"-1":{mapTo:te.USER_DENIED},"-10":{mapTo:te.USER_DENIED},"-400":{mapTo:te.DUPLICATE_REQUEST}}}},MP_OPEN_PROFILE_PICKER:{requireAccessToken:!0,versionLive:{iOS:432},errorList:{android:{"-101":{mapTo:te.USER_CANCEL}},iOS:{"-101":{mapTo:te.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:te.USER_CANCEL},999:{mapTo:{code:F,message:X},needMoreDetail:!0}},iOS:{"-10":{mapTo:{code:F,message:X}}}}},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:te.USER_DENIED},"-400":{mapTo:te.DUPLICATE_REQUEST}},iOS:{"-1":{mapTo:te.USER_DENIED},"-400":{mapTo:te.DUPLICATE_REQUEST}}}},MP_ADD_RATING:{skipJump:!1},MP_ADD_MYFAVORITES:{skipJump:!1},MP_INTERACT_OA:{skipJump:!1,errorList:{android:{"-400":{mapTo:te.DUPLICATE_REQUEST}},iOS:{"-400":{mapTo:te.DUPLICATE_REQUEST}}}},MP_USER_AUTHORIZE:{skipJump:!1,errorList:{android:{"-400":{mapTo:te.DUPLICATE_REQUEST}},iOS:{"-400":{mapTo:te.DUPLICATE_REQUEST}}}},MP_SELECT_PAYMENT_METHOD:{skipJump:!1},SCAN_NFC:{skipJump:!1,haveCallback:!0,timeout:65,errorList:{all:{"-1":{mapTo:te.UNKNOWN_ERROR},"-600":{mapTo:te.DEVICE_NOT_SUPPORT},"-601":{mapTo:te.SCAN_TIMEOUT},"-602":{mapTo:te.SERVICE_NOT_READY},"-603":{mapTo:te.UNREADABLE},"-604":{mapTo:te.INVALID_MRZ},"-605":{mapTo:te.PROCESSING},"-606":{mapTo:te.CANCEL}}}},MP_CONFIRM_REQUEST_PAYMENT:{skipJump:!1}},ie={android:{"-4":te.DECODE_FAILED,"-5":te.CLIENT_NOT_SUPPORT,"-14":te.TIME_OUT},iOS:{"-9":te.DECODE_FAILED,"-5":te.CLIENT_NOT_SUPPORT,"-14":te.TIME_OUT}},oe={android:12100615,iOS:460,wp:0,unknown:0},ae=5*r,se="https://payment-mini.zalo.me/api/order/create",ue="https://payment-mini.zalo.me/api/order/iap-create",ce="https://payment-mini.zalo.me/api/transaction",le="https://payment-mini.zalo.me/api/order/purchase",de="DEFERRED",pe="IMMEDIATE_AND_CHARGE_FULL_PRICE",fe={SHOW_BACK:0,HIDE_BACK:3,SHOW_HOME:1,HIDE_HOME:0},he=5,me=6,ve="#1843EF",ye=0,ge={"-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 _e(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 we(e){return function(){var t=this,n=arguments;return new Promise((function(r,i){var o=e.apply(t,n);function a(e){_e(o,r,i,a,s,"next",e)}function s(e){_e(o,r,i,a,s,"throw",e)}a(void 0)}))}}function Te(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 be(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function Ee(e,t){if(e){if("string"==typeof e)return Te(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)?Te(e,t):void 0}}function Se(e){return function(e){if(Array.isArray(e))return Te(e)}(e)||be(e)||Ee(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 Pe(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 Ae(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,Se(n))}catch(e){return"undefined"!=typeof console&&console.error&&console.error(e),null}}}function Oe(e){var t=new URL(window.location.href).searchParams.get("env");return{isMp:window.location.hostname.includes(u)&&("TESTING_LOCAL"==t||window.location.pathname.startsWith(c)),isMpWeb:window.location.hostname.includes("localhost")}}Ae.async=function(e){return we((function(){var t,n,r,i,o=arguments;return Pe(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,Se(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]}}))}))},e.NetworkType=void 0,(p=e.NetworkType||(e.NetworkType={})).none="none",p.wifi="wifi",p.cellular="cellular",p.unknown="unknown",e.PlatformType=void 0,(f=e.PlatformType||(e.PlatformType={})).wp="wp",f.android="android",f.iOS="iOS",f.unknown="unknown",e.Events=void 0,(h=e.Events||(e.Events={})).AppPaused="h5.event.paused",h.AppResumed="h5.event.resumed",h.NetworkChanged="h5.event.connection.changed",h.OnDataCallback="h5.event.webview.result",h.WebviewClosed="h5.event.webview.close",h.OpenApp="h5.event.open.mp",h.AppClose="h5.event.action.close",h.PaymentCallback="payment.callback",h.PaymentResult="action.payment.result",h.PaymentClose="action.payment.close",e.JumpStatus=void 0,(m=e.JumpStatus||(e.JumpStatus={})).DOING="doing",m.DONE="done",e.ProfileType=void 0,(v=e.ProfileType||(e.ProfileType={}))[v.user=1]="user",v[v.oa=0]="oa",v[v.aliasOA=2]="aliasOA",e.ChatType=void 0,(y=e.ChatType||(e.ChatType={}))[y.user=1]="user",y[y.oa=0]="oa",e.PostFeedType=void 0,(g=e.PostFeedType||(e.PostFeedType={}))[g.image=1]="image",g[g.link=4]="link",g[g.profile=5]="profile",e.ScanNFCType=void 0,(_=e.ScanNFCType||(e.ScanNFCType={}))[_.cccd=1]="cccd",e.ShareSheetType=void 0,(w=e.ShareSheetType||(e.ShareSheetType={}))[w.image=1]="image",w[w.gif=11]="gif",w[w.video=12]="video",w[w.link=4]="link",w[w.oa=5]="oa",w[w.zmp=20]="zmp",w[w.multi_image=21]="multi_image",w[w.zmp_deep_link=4]="zmp_deep_link",w[w.text=22]="text",e.OrientationType=void 0,(T=e.OrientationType||(e.OrientationType={}))[T.auto=1]="auto",T[T.portrait=2]="portrait",T[T.landscape=3]="landscape",e.VibrateType=void 0,(b=e.VibrateType||(e.VibrateType={}))[b.oneShot=0]="oneShot",e.MediaPickerType=void 0,(E=e.MediaPickerType||(e.MediaPickerType={}))[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",e.IAPPayType=void 0,(S=e.IAPPayType||(e.IAPPayType={})).SUBSCRIPTION="SUBSCRIPTION",S.ONETIME="ONETIME",e.ProrationMode=void 0,(P=e.ProrationMode||(e.ProrationMode={}))[P.UNKNOW=0]="UNKNOW",P[P.DEFERRED=1]="DEFERRED",P[P.IMMEDIATE_AND_CHARGE_FULL_PRICE=2]="IMMEDIATE_AND_CHARGE_FULL_PRICE",e.StatusBarType=void 0,(A=e.StatusBarType||(e.StatusBarType={}))[A.normal=1]="normal",A[A.hidden=0]="hidden",A[A.transparent=2]="transparent",e.AndroidBottomNavigationBarType=void 0,(O=e.AndroidBottomNavigationBarType||(e.AndroidBottomNavigationBarType={}))[O.show=1]="show",O[O.hide=0]="hide",e.IOSSafeAreaBottomType=void 0,(I=e.IOSSafeAreaBottomType||(e.IOSSafeAreaBottomType={}))[I.show=1]="show",I[I.hide=0]="hide",e.TextAlignType=void 0,(k=e.TextAlignType||(e.TextAlignType={}))[k.left=0]="left",k[k.center=1]="center",e.CameraEvents=void 0,(C=e.CameraEvents||(e.CameraEvents={})).OnFrameCallback="h5.event.camera.frame",C.OnStartCallback="h5.event.camera.start",C.OnStopCallback="h5.event.camera.stop",e.FacingMode=void 0,(N=e.FacingMode||(e.FacingMode={})).FRONT="user",N.BACK="environment",e.PhotoFormat=void 0,(M=e.PhotoFormat||(e.PhotoFormat={})).WEBP="image/webp",M.PNG="image/png",M.JPEG="image/jpeg",e.PhotoQuality=void 0,(R=e.PhotoQuality||(e.PhotoQuality={})).HIGH="high",R.NORMAL="normal",R.LOW="low",e.StreamType=void 0,(x=e.StreamType||(e.StreamType={})).VIDEO="video",x.AUDIO="audio";var Ie,ke=function(t){return t.isAndroid?e.PlatformType.android:t.isIOS?e.PlatformType.iOS:e.PlatformType.unknown};function Ce(e){var t=e.split("zalo")[1];return t&&t.replace(" ","").split("/")[1]||""}function Ne(){var e=function(){var e=Ae((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:Oe(),platform:t,platformName:ke(t),zaloVersion:Ce(e).trim()}}}();if(e)return e}var Me=(null===(Ie=Ne())||void 0===Ie?void 0:Ie.appEnv)||{};function Re(e){Re.on&&Re.engine(e)}Re.on=!1,Re.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 xe=function(e,t){var r,i={error:-1404,errorMessage:"".concat(e," is not found")};null==t||null===(r=t.fail)||void 0===r||r.call(t,i),Re({stage:n.NOT_FOUND,type:"error",name:e,request:t,state:"fail",response:i})};function Ue(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function De(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){Ue(e,t,n[t])}))}return e}function je(e,t){return function(e){if(Array.isArray(e))return e}(e)||be(e)||Ee(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 Le="undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{};function Be(){throw new Error("setTimeout has not been defined")}function Ze(){throw new Error("clearTimeout has not been defined")}var ze=Be,We=Ze;function Fe(e){if(ze===setTimeout)return setTimeout(e,0);if((ze===Be||!ze)&&setTimeout)return ze=setTimeout,setTimeout(e,0);try{return ze(e,0)}catch(t){try{return ze.call(null,e,0)}catch(t){return ze.call(this,e,0)}}}"function"==typeof Le.setTimeout&&(ze=setTimeout),"function"==typeof Le.clearTimeout&&(We=clearTimeout);var Ge,He=[],Ve=!1,Ke=-1;function Je(){Ve&&Ge&&(Ve=!1,Ge.length?He=Ge.concat(He):Ke=-1,He.length&&qe())}function qe(){if(!Ve){var e=Fe(Je);Ve=!0;for(var t=He.length;t;){for(Ge=He,He=[];++Ke<t;)Ge&&Ge[Ke].run();Ke=-1,t=He.length}Ge=null,Ve=!1,function(e){if(We===clearTimeout)return clearTimeout(e);if((We===Ze||!We)&&clearTimeout)return We=clearTimeout,clearTimeout(e);try{We(e)}catch(t){try{return We.call(null,e)}catch(t){return We.call(this,e)}}}(e)}}function Qe(e,t){this.fun=e,this.array=t}Qe.prototype.run=function(){this.fun.apply(null,this.array)};function $e(){}var Ye=$e,Xe=$e,et=$e,tt=$e,nt=$e,rt=$e,it=$e;var ot=Le.performance||{},at=ot.now||ot.mozNow||ot.msNow||ot.oNow||ot.webkitNow||function(){return(new Date).getTime()};var st=new Date;var ut,ct={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];He.push(new Qe(e,t)),1!==He.length||Ve||Fe(qe)},title:"browser",browser:!0,env:{},argv:[],version:"",versions:{},on:Ye,addListener:Xe,once:et,off:tt,removeListener:nt,removeAllListeners:rt,emit:it,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*at.call(ot),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-st)/1e3}},lt=ct,dt="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function pt(e){return e&&e.constructor===Symbol?"symbol":typeof e}function ft(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 dt?dt:"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 lt&&lt.env&&"true"===lt.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(U(n)){if(!G(e))throw new TypeError;if(!V(t))throw new TypeError;return S(e,t)}if(!G(e))throw new TypeError;if(!L(t))throw new TypeError;if(!L(r)&&!U(r)&&!D(r))throw new TypeError;return D(r)&&(r=void 0),P(e,t,n=F(n),r)}function m(e,t){function n(n,r){if(!L(n))throw new TypeError;if(!U(r)&&!K(r))throw new TypeError;N(e,t,n,r)}return n}function v(e,t,n,r){if(!L(n))throw new TypeError;return U(r)||(r=F(r)),N(e,t,n,r)}function y(e,t,n){if(!L(t))throw new TypeError;return U(n)||(n=F(n)),O(e,t,n)}function g(e,t,n){if(!L(t))throw new TypeError;return U(n)||(n=F(n)),I(e,t,n)}function _(e,t,n){if(!L(t))throw new TypeError;return U(n)||(n=F(n)),k(e,t,n)}function w(e,t,n){if(!L(t))throw new TypeError;return U(n)||(n=F(n)),C(e,t,n)}function T(e,t){if(!L(e))throw new TypeError;return U(t)||(t=F(t)),M(e,t)}function b(e,t){if(!L(e))throw new TypeError;return U(t)||(t=F(t)),R(e,t)}function E(e,t,n){if(!L(t))throw new TypeError;U(n)||(n=F(n));var r=A(t,n,!1);if(U(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(!U(r)&&!D(r)){if(!V(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(!U(o)&&!D(o)){if(!L(o))throw new TypeError;r=o}}return r}function A(e,t,n){var r=f.get(e);if(U(r)){if(!n)return;r=new d,f.set(e,r)}var i=r.get(t);if(U(i)){if(!n)return;i=new d,r.set(t,i)}return i}function O(e,t,n){if(I(e,t,n))return!0;var r=X(t);return!D(r)&&O(e,r,n)}function I(e,t,n){var r=A(t,n,!1);return!U(r)&&z(r.has(e))}function k(e,t,n){if(I(e,t,n))return C(e,t,n);var r=X(t);return D(r)?void 0:k(e,r,n)}function C(e,t,n){var r=A(t,n,!1);if(!U(r))return r.get(e)}function N(e,t,n,r){A(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=A(e,t,!1);if(U(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 U(e){return void 0===e}function D(e){return null===e}function j(e){return"symbol"==typeof e}function L(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(L(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(H(n))if(!L(i=n.call(e)))return i;if(H(r=e.valueOf))if(!L(i=r.call(e)))return i}else{var r;if(H(r=e.valueOf))if(!L(i=r.call(e)))return i;var i,o=e.toString;if(H(o))if(!L(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 j(t)?t:W(t)}function G(e){return Array.isArray?Array.isArray(e):e instanceof Object?e instanceof Array:"[object Array]"===Object.prototype.toString.call(e)}function H(e){return"function"==typeof e}function V(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(!H(n))throw new TypeError;return n}}function q(e){var t=J(e,i);if(!H(t))throw new TypeError;var n=t.call(e);if(!L(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",T),e("getOwnMetadataKeys",b),e("deleteMetadata",E)}(r)}()}(ut||(ut={}));var ht=Object.prototype.toString;var mt="[object Null]",vt="[object Undefined]";function yt(e){return null==e?void 0===e?vt:mt:function(e){return ht.call(e)}(e)}function gt(e){return null!=e&&"object"==typeof e}var _t={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||gt(e)&&"[object Number]"==yt(e)},isArray:function(e){return Array.isArray(e)},isRegExp:function(e){return gt(e)&&"[object RegExp]"==yt(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 wt(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Tt(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 bt(e){return bt=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},bt(e)}function Et(e){return bt(e)}function St(e,t,n){return St="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=Et(e)););return e}(e,t);if(r){var i=Object.getOwnPropertyDescriptor(r,t);return i.get?i.get.call(n||e):i.value}},St(e,t,n)}function Pt(e,t,n){return St(e,t,n)}function At(e,t){return At=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},At(e,t)}function Ot(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&&At(e,t)}function It(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function kt(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=Et(e);if(t){var i=Et(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return function(e,t){return!t||"object"!==pt(t)&&"function"!=typeof t?It(e):t}(this,n)}}var Ct=function(e,t){return e(t={exports:{}},t.exports),t.exports
11
11
  /*! *****************************************************************************
12
12
  Copyright (C) Microsoft. All rights reserved.
13
13
  Licensed under the Apache License, Version 2.0 (the "License"); you may not use
@@ -21,4 +21,4 @@
21
21
 
22
22
  See the Apache Version 2.0 License for specific language governing permissions
23
23
  and limitations under the License.
24
- ***************************************************************************** */}((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})),Ct="ACTION_CALLBACK";var Nt=function(t){At(r,t);var n=It(r);function r(){var e;return _t(this,r),(e=n.apply(this,arguments)).debug=pt("zmp:event-emitter"),e}var i=r.prototype;return i.h5ConfirmHandleEvent=function(e,t,n){ZaloJavaScriptInterface.jsH5EventCallback(e,t,n||"")},i.on=function(t,n,i){var o=this;if(t===Ct||t===e.Events.PaymentCallback)return Pt(Tt(r.prototype),"on",this).call(this,t,n,i);this.debug("register ".concat(String(t),": ").concat(i));return Pt(Tt(r.prototype),"on",this).call(this,t,(function(e,r){o.h5ConfirmHandleEvent(e,t,i),n(r)}),i)},i.once=function(e,t,n){var i=this;if(e===Ct)return Pt(Tt(r.prototype),"once",this).call(this,e,t,n);this.debug("register once ".concat(String(e),": ").concat(n));return Pt(Tt(r.prototype),"once",this).call(this,e,(function(r,o){i.h5ConfirmHandleEvent(r,e,n),t(o)}),n)},r.getInstance=function(){return r.instance||(r.instance=new r),r.instance},r}(kt);function Mt(e){Nt.getInstance().emit(Ct,e)}function Rt(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){Mt({serialId:e,actionName:t,result:n})}},window.zaloJSV2={zalo_h5_event_handler:function(t,n,r){var i=pt("zmp:zalo_h5_event_handler");i("eventId: ".concat(t,", eventName: ").concat(n,", eventData: ").concat(r));var a=cn(r);i("stringToData",a);var s=function(t,n){try{if(t===e.Events.OpenApp){var r=n.url,i=new URL(r),a=i.pathname.split("/zapps/".concat(o))[1];return{path:"".concat(a||"/").concat(i.search)}}return n}catch(e){return n}}(n,a);Nt.getInstance().emit(n,t,s)}},window.zaloNative2JS={nativeCall:function(t,n,r){Nt.getInstance().emit(e.Events.PaymentCallback,t,n,r)}};var xt={encode:Rt,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:Rt(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":dt(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":dt(r))?JSON.stringify(r):encodeURIComponent(r)].join("=");n.push(i)})),n.join("&")}},Ut={},Dt=function(e,t,n){var r=t||"default";return function(){return(r in Ut?Ut[r](e,n):e).apply(this,arguments)}};Dt.setWrapper=function(e){Ut[arguments.length<=1||void 0===arguments[1]?"default":arguments[1]]=e};var jt={error:{code:1,error_subcode:1357046,message:"Received Invalid JSON reply.",type:"http"}};function Lt(e){try{return null===e?jt:JSON.parse(e)}catch(e){return jt}}var Bt,Zt={execute:function(e,t,n,r){n.suppress_http_code=1;var i=xt.encode(n);"post"!=t&&(e=xt.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=Dt((function(){o=r,"onload"in i&&i.onload(n)}),"entry","XMLHttpRequest:load"),a=Dt((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(Lt(e.responseText))},o.onerror=function(e){e.responseText?r(Lt(e.responseText)):r({error:{code:1,error_subcode:1357045,message:"unknown error (empty response)",status:e.status,type:"http"}})},o.send(i),!0)}},zt=Zt,Wt=(Bt=_e((function(e,t,n){var r,i,o,a;return Pe(this,(function(s){switch(s.label){case 0:return r={appId:e,versionStatus:t},gt.isUndefined(n)||(r.currentVersion=n),i=xt.appendToUrl(d.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 Bt.apply(this,arguments)});function Ft(e){try{var t=e.map((function(e){return{action:e.action,error:e.error,message:e.message,data:e.data}}));zt.execute(d.SEND_ACTION_LOG,"post",{appId:window.APP_ID,data:JSON.stringify(t)},(function(){})),window.zmpSentry&&window.zmpSentry.captureMessage("Result from native",{extra:{data:e}})}catch(e){}}var Gt=function(e){return e.replace(/[A-Z]/g,(function(e){return"_".concat(e.toLowerCase())}))},Ht=function(){var e,t,n=Number((null===(e=Ce())||void 0===e?void 0:e.zaloVersion)||""),r=((null===(t=Ce())||void 0===t?void 0:t.platformName)||"").toLowerCase();return"android"===r?n%1e4:n};function Vt(e,t){return null!=t&&"undefined"!=typeof Symbol&&t[Symbol.hasInstance]?!!t[Symbol.hasInstance](e):e instanceof t}var Kt,Jt,qt=function(){function e(t,n,r,i){_t(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}(),Qt=function(e,t){return Vt(e,qt)?function(e,t){return e.api=t,e.toJSON()}(e,t):function(e,t){return Vt(e,Error)?new qt(U,e.message,t).toJSON():gt.isEmpty(null==e?void 0:e.message)||gt.isEmpty(null==e?void 0:e.code)?new qt(U,H,t,e).toJSON():new qt(e.code,e.message,t,e.detail).toJSON()}(e,t)},$t=(Kt=_e((function(e){var t;return Pe(this,(function(n){switch(n.label){case 0:return t={headers:{"Content-Type":"application/x-www-form-urlencoded",authorization:"Bearer ".concat(e)}},[4,fetch(d.GET_AUTH_SETTING,Ue({method:"GET"},t))];case 1:return[4,n.sent().json()];case 2:return[2,n.sent()]}}))})),function(e){return Kt.apply(this,arguments)}),Yt=_e((function(){return Pe(this,(function(e){return[2,new Promise(function(){var e=_e((function(e,t){var n,r,i,o;return Pe(this,(function(a){switch(a.label){case 0:return a.trys.push([0,3,,4]),[4,on.jumpAndGetToken()];case 1:return a.sent(),(r=null===(n=on.miniProgramConfig)||void 0===n?void 0:n.jwt)||t(new qt(L,J,"getSetting")),[4,$t(r)];case 2:return(i=a.sent())&&0===i.err?e({authSetting:i.data}):t(new qt(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)}}())]}))})),Xt=function(){var t,n,r,i=Ce(),o={},a=Nt.getInstance(),s=[],u=!1;return u||(n=function(e){var t=e.serialId,n=ln(e.result),r=hn(null==n?void 0:n.action),i=gt.isEmpty(null==n?void 0:n.error_code)?0:null==n?void 0:n.error_code,a=null==n?void 0:n.error_message,u=(null==n?void 0:n.data)||n;if(r&&0===i){var c=JSON.parse(null==n?void 0:n.data);i=gt.isEmpty(null==c?void 0:c.error_code)?0:null==c?void 0:c.error_code,a=null==c?void 0:c.error_message,u=(null==c?void 0:c.data)||c}var l={error_code:i,error_message:a,data:u,action:(null==n?void 0:n.action)||e.actionName};if(t&&o[t]){var d=o[t],p=d.callback,f=d.timeout,h=d.isMultiCallback,m=d.options;!function(e,t){var n=t||{},r=n.success,i=n.fail;0===e.error_code?gt.isFunction(r)&&r(e):gt.isFunction(i)&&i(e)}(l,p),!h&&delete o[t],f&&clearTimeout(f);var v={action:null==l?void 0:l.action,error:null==l?void 0:l.error_code,message:null==l?void 0:l.error_message,data:{}};try{if("action.open.inapp"===l.action||"action.open.outapp"===l.action){var y=new URL(null==m?void 0:m.url),g="".concat(y.protocol,"//").concat(y.host).concat(y.pathname);v.data={url:g}}if("action.follow.oa"===l.action||"action.unfollow.oa"===l.action){var _=null==m?void 0:m.uid;v.data={uid:_}}if("action.open.chat"===l.action){var w=null==m?void 0:m.uId,b=null==m?void 0:m.type;v.data={uid:w,openChatType:b}}}catch(e){}s.push(v)}},Nt.getInstance().on(Ct,n),a.on(e.Events.AppPaused,(function(){if(s.length>0){var e=s;s=[],Ft(e)}})),t?clearInterval(t):t=setInterval((function(){if(s.length>0){var e=s;s=[],Ft(e)}}),5e3),u=!0),r=_e((function(e,t,n,r){var a,s,u,c,l,d,p,f,h,m,v,y,g,_,w,b,T,E,P,S,A,O;return Pe(this,(function(I){switch(I.label){case 0:return s=Math.floor(1e6*Math.random()),u="".concat(e,"_").concat(s),c=gn(e),(null==r?void 0:r.actionName)&&r.actionName.length>0&&(c=null==r?void 0:r.actionName),l=(null==r?void 0:r.isMultiCallback)||!1,d=!1!==(null==r?void 0:r.timeout)&&((null==r?void 0:r.timeout)||!0),p=(null==r?void 0:r.haveCallback)||!1,f=(null==r?void 0:r.skipJump)||!1,h=(null==r?void 0:r.requireAccessToken)||!1,m=mn(c),t&&n&&(o[u]={options:t,callback:n,isMultiCallback:l},d&&p&&(o[u].timeout=setTimeout((function(){return Mt({serialId:u,result:{error_code:Z,error_message:K,data:{timeout:d},action:e}}),null}),!0===d?8e3:1e3*d))),m?[4,Yt()]:[3,2];case 1:if(!1===(null==(y=I.sent())||null===(v=y.authSetting)||void 0===v?void 0:v["scope.userInfo"]))return Mt({serialId:u,result:{error_code:L,error_message:$,data:{isMobile:null==i||null===(g=i.platform)||void 0===g?void 0:g.isMobile},action:e}}),[2];I.label=2;case 2:return _=hn(c),!(null==i||null===(a=i.platform)||void 0===a?void 0:a.isMobile)||!e||gt.isUndefined(ZaloJavaScriptInterface)||i.platform.isIOS&&!un(e)||_&&!1===_.isSupported?(Mt({serialId:u,result:{error_code:B,error_message:Q,data:{isMobile:null==i||null===(w=i.platform)||void 0===w?void 0:w.isMobile},action:e}}),[2]):(b=sn(t),f?[3,4]:[4,on.getJSAccessToken()]);case 3:return E=I.sent(),[3,5];case 4:E="",I.label=5;case 5:T=E,I.label=6;case 6:return I.trys.push([6,10,,11]),f||!h?[3,8]:[4,on.getAccessToken()];case 7:return S=I.sent(),[3,9];case 8:S="",I.label=9;case 9:return P=S,[3,11];case 10:return A=I.sent(),Mt({serialId:u,result:{error_code:null==A?void 0:A.code,error_message:null==A?void 0:A.message,action:e}}),[2];case 11:return O=i.platform.isIOS?window.onNativeMessage(u,c):'window.onNativeMessage("'.concat(u,'", "').concat(c,'")'),[2,ZaloJavaScriptInterface.jsCall(T,c,P,b,O)]}}))})),function(e,t,n,i){return r.apply(this,arguments)}}(),en={success:function(e,t){return{code:x,message:t||G,data:e||{}}},error:{failLimit:function(){return new qt(z,V)},badRequest:function(e){return new qt(D,e)},loginFailed:function(e){return new qt(L,"".concat(q,": ").concat(e))},loginRequired:function(){return new qt(L,J)},cannotGetShareInfo:function(){return new qt(j,"Can not get app info to share")},createIAPOrderFailed:function(e){var t=Object.keys(ye).find((function(t){return t===e.toString()}));return new qt(e,t||H)},clientNotSupport:function(){return new qt(B,Q)}}},tn=(Jt=function(t){var n,r,i,o=null===(n=Ce())||void 0===n?void 0:n.platformName,a=yn(t.action),s=ne[a],u=(null==s?void 0:s.skipJump)||!1,c=(null==s?void 0:s.errorList)||{};if("JUMP_LOGIN"===a)return new qt(U,"Can not get auth code: ".concat(t.error_message));if(on.jumpStatus!==e.JumpStatus.DONE&&!u)return new qt(ee.UNAUTHORIZED.code,ee.UNAUTHORIZED.message);if("permission required!"===String(t.error_message).toLowerCase()||"no permission!"===String(t.error_message).toLowerCase())return new qt(ee.FORBIDDEN.code,ee.FORBIDDEN.message);if(o&&(null===(r=re[o])||void 0===r?void 0:r[t.error_code]))return new qt(re[o][t.error_code].code,re[o][t.error_code].message);var l=null==c||null===(i=c[o])||void 0===i?void 0:i[String(t.error_code)];if(l){var d,p,f,h=null===(d=l.mapTo)||void 0===d?void 0:d.message;return(null==l?void 0:l.needMoreDetail)&&(h="".concat(null==l||null===(f=l.mapTo)||void 0===f?void 0:f.message,": ").concat(t.error_message)),new qt(null===(p=l.mapTo)||void 0===p?void 0:p.code,h)}return new qt(t.error_code,t.error_message)},function(e,t,r,i){var o=function(e,t){function r(r){return function(i){var o=gt.isEmpty(t)?void 0:t[r];if(o)return Me({stage:n.RESPONSE,type:"log",state:r,name:e,response:i}),o("fail"===r?Jt(i):null==i?void 0:i.data)}}return gt.isUndefined(e)&&(e=""),Object.assign({},{success:r("success"),fail:r("fail")})}(e,r),a=ne[e],s=(null==i?void 0:i.delay)||0;setTimeout((function(){Xt(e,t,o,Ue({},i,a))}),s)}),nn=function(){var e=_e((function(e){return Pe(this,(function(t){return[2,new Promise((function(t,n){tn("MP_USER_AUTHORIZE",{scopes:e,forceUpdate:!0},{success:function(e){gt.isEmpty(e)||t(e)},fail:function(e){n(e)}},{isMultiCallback:!1,timeout:!1})}))]}))}));return function(t){return e.apply(this,arguments)}}(),rn=function(){function t(){_t(this,t),this._jumpStatus=void 0,this.WAITING_QUEUE=[],this.getAccessTokenCount=0,this._accessToken="",this._jsAccessToken="",this.refreshToken="",this._cookies=[],this.accessTokenExpiresIn=0,this.prevGetAccessTokenTimestamp=(new Date).getTime(),this.manualSetAccessToken=!1,this._miniProgramConfig={},this.retryLimitMap={}}var r,a,u,c=t.prototype;return c.initRetryLimit=function(e){var t=te[e],n={lastCall:(new Date).getTime(),limit:t&&t.limit?t.limit:3,retry:0};return this.retryLimitMap[e]=n,n},c.resetRetryLimit=function(e){this.retryLimitMap[e].lastCall=(new Date).getTime(),this.retryLimitMap[e].retry=0},c.getRetryLimit=function(e){var t=this.retryLimitMap[e];return t&&t.lastCall&&t.retry||(t=this.initRetryLimit(e)),t},c.increaseRetryLimit=function(e){this.retryLimitMap[e].retry++},c.jump=function(){var t=this;return _e((function(){return Pe(this,(function(r){return[2,new Promise((function(r,i){t._jumpStatus?t._jumpStatus===e.JumpStatus.DONE?r(e.JumpStatus.DONE):r(e.JumpStatus.DOING):(t._jumpStatus=e.JumpStatus.DOING,Me({stage:n.REQUEST,type:"log",name:"jump"}),Xt("JUMP_LOGIN",{},{success:function(n){var i=n.data;t._miniProgramConfig=(null==i?void 0:i.miniProgramConfig)||{};var o=(null==i?void 0:i.cookiesOAuthLogins)||[],a=o.find((function(e){return e.name===l.JS_TOKEN}));a&&(t._jsAccessToken=a.value,window.ZJSBridge.setJSToken&&window.ZJSBridge.setJSToken(a.value)),t._cookies=o;var s=t._cookies.find((function(e){return e.name===l.ZOAUTH}));(null==s?void 0:s.value)||Ft([{action:"action.jump.login",error:-102,message:"no zoauth",data:{}}]),r(e.JumpStatus.DONE)},fail:function(e){Ft([{action:"action.jump.login",error:-101,message:e.message||"jump error",data:{}}]),i(e)}},{skipJump:!0}))}))]}))}))()},c.loginZaloV3=function(e,t,n){var r=this;return _e((function(){var i;return Pe(this,(function(o){switch(o.label){case 0:return i="".concat(d.GET_ACCESS_TOKEN_V3,"?app_id=").concat(t,"&redirect_uri=").concat(s,"/").concat(e,"/&code=").concat(n,"&isSDK=true"),[4,fetch(i).then(function(){var e=_e((function(e){var t,n,i;return Pe(this,(function(o){switch(o.label){case 0:return[4,e.json()];case 1:return t=o.sent(),n=null==t?void 0:t.access_token,r._accessToken=n,i=1e3*parseInt(t.expires_in),r.accessTokenExpiresIn=i,r.prevGetAccessTokenTimestamp=(new Date).getTime(),window.ZJSBridge.setZAccSession&&window.ZJSBridge.setZAccSession(r._accessToken||""),[2,n]}}))}));return function(t){return e.apply(this,arguments)}}())];case 1:return[2,o.sent()]}}))}))()},c.loginZaloV4=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",r=this;return _e((function(){var i,o;return Pe(this,(function(a){switch(a.label){case 0:return(i=new URLSearchParams).append("app_id",e),i.append("code",t),i.append("code_verifier",n),gt.isNull(r.refreshToken)||0===r.refreshToken.length?i.append("grant_type","authorization_code"):(i.append("grant_type","refresh_token"),i.append("refresh_token",r.refreshToken||"")),o={headers:{"Content-Type":"application/x-www-form-urlencoded"}},[4,fetch(d.GET_ACCESS_TOKEN,Ue({method:"POST",body:i},o)).then(function(){var e=_e((function(e){var t,n,i,o;return Pe(this,(function(a){switch(a.label){case 0:return[4,e.json()];case 1:return t=a.sent(),n=(null==t?void 0:t.access_token)||"",i=(null==t?void 0:t.refresh_token)||"",r.refreshToken=i,r._accessToken=n,o=1e3*parseInt(null==t?void 0:t.expires_in),r.accessTokenExpiresIn=o,r.prevGetAccessTokenTimestamp=(new Date).getTime(),window.ZJSBridge.setZAccSession&&window.ZJSBridge.setZAccSession(n),[2,n]}}))}));return function(t){return e.apply(this,arguments)}}())];case 1:return[2,a.sent()]}}))}))()},c.getAccessToken=function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=this;return _e((function(){var n,r,a,s,u,c,d,p,f;function h(){return m.apply(this,arguments)}function m(){return(m=_e((function(){return Pe(this,(function(e){switch(e.label){case 0:return[4,new Promise((function(e){var t=setInterval((function(){(r.getAccessTokenCount<=1||r._accessToken)&&(e("done"),clearInterval(t))}),200)}))];case 1:return[2,e.sent()]}}))}))).apply(this,arguments)}return Pe(this,(function(m){switch(m.label){case 0:return n=(new Date).getTime()-t.prevGetAccessTokenTimestamp,(r=t).getAccessTokenCount++,t.getAccessTokenCount>1?[4,h()]:[3,2];case 1:m.sent(),m.label=2;case 2:return t.manualSetAccessToken?(r.getAccessTokenCount--,[2,Promise.resolve(t._accessToken)]):e?[4,t.verifyUserAuthorized()]:[3,4];case 3:return s=m.sent(),[3,5];case 4:s=!0,m.label=5;case 5:return a=s,t._accessToken.length>0&&n<t.accessTokenExpiresIn&&a?(r.getAccessTokenCount--,[2,Promise.resolve(t._accessToken)]):(t.accessToken="",[4,t.jumpAndGetToken(l.ZOAUTH)]);case 6:return u=m.sent(),[4,t.jumpAndGetToken(l.ZOAUTH_VRF)];case 7:if(c=m.sent(),d="zmp.getaccesstoken.fail",!a)throw r.getAccessTokenCount--,Ft([{action:d,error:-104,message:"no user auth",data:{}}]),en.error.loginFailed("User Authentication Required");if(!u)return[3,15];m.label=8;case 8:return m.trys.push([8,13,,14]),c?[4,t.loginZaloV4(o,u,c)]:[3,10];case 9:return p=m.sent(),[3,12];case 10:return[4,t.loginZaloV3(o,i,u)];case 11:p=m.sent(),m.label=12;case 12:return[3,14];case 13:return f=m.sent(),p="",console.log("Can not get access token",f),Ft([{action:d,error:-103,message:String(f)||"Can not get access token",data:{}}]),[3,14];case 14:return r.getAccessTokenCount--,p?[2,Promise.resolve(t._accessToken)]:(Ft([{action:d,error:-101,message:"no accessToken",data:{}}]),[2,Promise.reject(en.error.loginFailed("Can't get accessToken. Please try again later."))]);case 15:throw r.getAccessTokenCount--,Ft([{action:d,error:-102,message:"no oauth",data:{}}]),en.error.loginFailed("Zalo app has not been activated")}}))}))()},c.verifyUserAuthorized=function(){var e=this;return _e((function(){var t,n,r,i,o,a;return Pe(this,(function(s){switch(s.label){case 0:if(n=!0,!1!==(null===(t=e._miniProgramConfig)||void 0===t?void 0:t.userAuthorized))return[3,6];s.label=1;case 1:return s.trys.push([1,5,,6]),(r=hn("action.mp.user.authorize"))&&r.isSupported?[4,Yt()]:[3,4];case 2:return!1!==(null==(o=s.sent())||null===(i=o.authSetting)||void 0===i?void 0:i["scope.userInfo"])?[3,4]:[4,nn()];case 3:a=s.sent(),n=(null==a?void 0:a["scope.userInfo"])||!1,s.label=4;case 4:return[3,6];case 5:return s.sent(),n=!1,[3,6];case 6:return[2,n]}}))}))()},c.setAccessToken=function(e){this.manualSetAccessToken=!0,this._accessToken=e,window.ZJSBridge.setZAccSession&&window.ZJSBridge.setZAccSession(e)},c.getJSAccessToken=function(){var e=this;return _e((function(){var t;return Pe(this,(function(n){switch(n.label){case 0:return e._jsAccessToken.length>0?[2,Promise.resolve(e._jsAccessToken)]:[4,e.jumpAndGetToken(l.JS_TOKEN)];case 1:return t=n.sent(),[2,Promise.resolve(t)]}}))}))()},c.getSync=function(e){var t;return null===(t=this._cookies.find((function(t){return t.name===e})))||void 0===t?void 0:t.value},c.jumpAndGetToken=function(t){var n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=this;return new Promise(function(){var i=_e((function(i){var o,a,s,u;return Pe(this,(function(c){switch(c.label){case 0:return!n&&r._cookies.length>0?gt.isString(t)?(o=r._cookies.find((function(e){return e.name===t})),[2,i(null==o?void 0:o.value)]):[2,i("")]:(n&&r._jumpStatus===e.JumpStatus.DONE&&(r._jumpStatus=void 0),a={name:t,cb:function(e){return i(e)}},[4,r.jump()]);case 1:return(s=c.sent())===e.JumpStatus.DONE?(r._jumpStatus=s,r.WAITING_QUEUE.length&&(r.WAITING_QUEUE.forEach((function(e){var t=r._cookies.find((function(t){return t.name===e.name}));e.cb(null==t?void 0:t.value)})),r.WAITING_QUEUE=[]),u=r._cookies.find((function(e){return e.name===a.name})),a.cb(null==u?void 0:u.value)):r.WAITING_QUEUE.push(a),[2]}}))}));return function(e){return i.apply(this,arguments)}}())},t.getInstance=function(){return t.instance||(t.instance=new t),t.instance},r=t,(a=[{key:"jumpStatus",get:function(){return this._jumpStatus}},{key:"accessToken",set:function(e){this._accessToken=e,window.ZJSBridge.setZAccSession&&window.ZJSBridge.setZAccSession(e)}},{key:"miniProgramConfig",get:function(){return this._miniProgramConfig}}])&&wt(r.prototype,a),u&&wt(r,u),t}(),on=rn.getInstance(),an=pt("zmp:utils:common"),sn=function(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=[];for(var n=e.length,r=0;r<n;r++)t.push(sn(e[r]));return"["+t.join(",")+"]"}if("object"==typeof e){for(var i in t=[],e)t.push('"'+i+'":'+sn(e[i]));return"{"+t.join(",")+"}"}return e.toString()},un=function(e){var t,n,r=ne[e],i=(null===(t=Ce())||void 0===t?void 0:t.zaloVersion)||0,o="versionLive"in r&&(null==r||null===(n=r.versionLive)||void 0===n?void 0:n.iOS)||0;return!!(Array.isArray(window.ignoreCheckSupport)&&window.ignoreCheckSupport.length>0&&window.ignoreCheckSupport.includes(e))||Number(i)>=o},cn=function(e){try{if(e){an(e);var t=e.replace(/\\/g,"").replace(/&#39;/g,"'");try{t=decodeURIComponent(atob(e))}catch(e){}return an("formattedValue",t,JSON.parse(t),dt(JSON.parse(t))),JSON.parse(t)}return null}catch(t){return an("parse json error:",t),e}},ln=function(e){if(gt.isObject(JSON)&&JSON.parse&&gt.isString(e)){var t=e.replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/\t/g,"\\t").replace(/\x00/g,"");return JSON.parse(t,(function(e,t){return t}))}return gt.isObject(e)?e:new Function("return "+e)()},dn=function(e){for(var t=document.getElementsByTagName("meta"),n=0;n<t.length;n++)if(t[n].getAttribute("name")===e||t[n].getAttribute("property")===e)return t[n].getAttribute("content");return""},pn=function(e){return btoa(encodeURIComponent(JSON.stringify(e)))};var fn=function(t){return"hidden"===t?e.StatusBarType.hidden:"transparent"===t?e.StatusBarType.transparent:e.StatusBarType.normal},hn=function(e){if(void 0!==e){var t=on.miniProgramConfig;return((null==t?void 0:t.dynamicApis)||[]).find((function(t){return t.action===e&&!1===t.clientHandle}))}},mn=function(e){if(void 0===e)return!1;var t=on.miniProgramConfig;return((null==t?void 0:t.requiredAuthenList)||[]).indexOf(e)>=0},vn=function(){var e=_e((function(){return Pe(this,(function(e){return[2,new Promise(function(){var e=_e((function(e,t){var n;return Pe(this,(function(t){switch(t.label){case 0:return t.trys.push([0,2,,3]),[4,on.jumpAndGetToken()];case 1:return t.sent(),n=on.miniProgramConfig,e(!0===(null==n?void 0:n.canUseAccessTokenByDefault)),[3,3];case 2:return t.sent(),e(!1),[3,3];case 3:return[2]}}))}));return function(t,n){return e.apply(this,arguments)}}())]}))}));return function(){return e.apply(this,arguments)}}(),yn=function(e){return e.replace("action.","").replace(/\./g,"_").toUpperCase()},gn=function(e){return"action.".concat(e.replace(/\_/g,".").toLowerCase())};function _n(e,t,n,r){var i,o;!function(e,t){if(te[e]){var n=on.getRetryLimit(e);n.lastCall&&(new Date).getTime()-n.lastCall>1e3&&on.resetRetryLimit(e);var r=n.limit||3;if(n.retry&&n.retry>=r)throw Qt(en.error.failLimit(),e);on.increaseRetryLimit(e)}}(e);var a=Array.isArray(n)&&n.length>0&&(null===(i=n[0])||void 0===i?void 0:i.success),s=Array.isArray(n)&&n.length>0&&(null===(o=n[0])||void 0===o?void 0:o.fail);try{var u=n;t.length>0&&t.forEach((function(t,r){var i=t.safeParse(n[r]);if(!i.success){var o,a=null===(o=i.error)||void 0===o?void 0:o.issues,s=a.map((function(e,t){var n=e.path.length>0?e.path.map((function(e,t){return t>0?"[".concat(e,"]"):e})).join(""):"arg";return"Error ".concat(t+1,": Code: ").concat(e.code," ~ Path: ").concat(n," ~ Message: ").concat(e.message)})).join(" | "),c=en.error.badRequest(s);throw c.detail=a,Qt(c,e)}u.push(i.data)}));var c=r.apply(void 0,Ee(u));return gt.isPromise(c)?new Promise((function(t,n){c.then((function(e){if(!gt.isNull(a)&&gt.isFunction(a))return a(e);t(c)})).catch((function(t){var r=Qt(t,e);if(!gt.isNull(s)&&gt.isFunction(s))return s(r);n(r)}))})):c}catch(t){if(!gt.isNull(s)&&gt.isFunction(s))return s(t);throw Qt(t,e)}}function wn(e){return bn.apply(this,arguments)}function bn(){return(bn=_e((function(e){return Pe(this,(function(t){return[2,_n("login",[],[e],_e((function(){return Pe(this,(function(e){switch(e.label){case 0:return Ne.isMp?[4,on.jumpAndGetToken(l.ZOAUTH)]:[3,2];case 1:return e.sent(),[2,"Success"];case 2:return Ne.isMpWeb?[2,Promise.resolve("")]:[2,Promise.reject(Re("login",{}))]}}))})))]}))}))).apply(this,arguments)}function Tn(e){return En.apply(this,arguments)}function En(){return(En=_e((function(e){return Pe(this,(function(t){return[2,_n("getAccessToken",[],[e],_e((function(){var e;return Pe(this,(function(t){switch(t.label){case 0:return Ne.isMp?[4,vn()]:[3,3];case 1:return e=!t.sent(),[4,on.getAccessToken(e)];case 2:return[2,t.sent()||""];case 3:return Ne.isMpWeb?[2,Promise.resolve("")]:[2,Promise.reject(Re("getAccessToken",{}))]}}))})))]}))}))).apply(this,arguments)}var Pn,Sn="2.40.0";function An(){return _n("getVersion",[],[],(function(){return Sn}))}function On(){var e,t;return{version:dn("version-id")||"",apiVersion:Sn,zaloVersion:(null===(e=Ce())||void 0===e?void 0:e.zaloVersion)||"",platform:(null===(t=Ce())||void 0===t?void 0:t.platformName)||"",language:navigator.language,zaloLanguage:window.zLanguage||"vi",zaloTheme:window.zTheme||"light"}}function In(){return _n("getSystemInfo",[],[],(function(){return On()}))}!function(e){e.assertEqual=e=>e,e.assertIs=function(e){},e.assertNever=function(e){throw new Error},e.arrayToEnum=e=>{const t={};for(const n of e)t[n]=n;return t},e.getValidEnumValues=t=>{const n=e.objectKeys(t).filter((e=>"number"!=typeof t[t[e]])),r={};for(const e of n)r[e]=t[e];return e.objectValues(r)},e.objectValues=t=>e.objectKeys(t).map((function(e){return t[e]})),e.objectKeys="function"==typeof Object.keys?e=>Object.keys(e):e=>{const t=[];for(const n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.push(n);return t},e.find=(e,t)=>{for(const n of e)if(t(n))return n},e.isInteger="function"==typeof Number.isInteger?e=>Number.isInteger(e):e=>"number"==typeof e&&isFinite(e)&&Math.floor(e)===e,e.joinValues=function(e,t=" | "){return e.map((e=>"string"==typeof e?`'${e}'`:e)).join(t)},e.jsonStringifyReplacer=(e,t)=>"bigint"==typeof t?t.toString():t}(Pn||(Pn={}));const kn=Pn.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Cn=e=>{switch(typeof e){case"undefined":return kn.undefined;case"string":return kn.string;case"number":return isNaN(e)?kn.nan:kn.number;case"boolean":return kn.boolean;case"function":return kn.function;case"bigint":return kn.bigint;case"symbol":return kn.symbol;case"object":return Array.isArray(e)?kn.array:null===e?kn.null:e.then&&"function"==typeof e.then&&e.catch&&"function"==typeof e.catch?kn.promise:"undefined"!=typeof Map&&e instanceof Map?kn.map:"undefined"!=typeof Set&&e instanceof Set?kn.set:"undefined"!=typeof Date&&e instanceof Date?kn.date:kn.object;default:return kn.unknown}},Nn=Pn.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]);class Mn extends Error{constructor(e){super(),this.issues=[],this.addIssue=e=>{this.issues=[...this.issues,e]},this.addIssues=(e=[])=>{this.issues=[...this.issues,...e]};const t=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,t):this.__proto__=t,this.name="ZodError",this.issues=e}get errors(){return this.issues}format(e){const t=e||function(e){return e.message},n={_errors:[]},r=e=>{for(const i of e.issues)if("invalid_union"===i.code)i.unionErrors.map(r);else if("invalid_return_type"===i.code)r(i.returnTypeError);else if("invalid_arguments"===i.code)r(i.argumentsError);else if(0===i.path.length)n._errors.push(t(i));else{let e=n,r=0;for(;r<i.path.length;){const n=i.path[r];r===i.path.length-1?(e[n]=e[n]||{_errors:[]},e[n]._errors.push(t(i))):e[n]=e[n]||{_errors:[]},e=e[n],r++}}};return r(this),n}toString(){return this.message}get message(){return JSON.stringify(this.issues,Pn.jsonStringifyReplacer,2)}get isEmpty(){return 0===this.issues.length}flatten(e=(e=>e.message)){const t={},n=[];for(const r of this.issues)r.path.length>0?(t[r.path[0]]=t[r.path[0]]||[],t[r.path[0]].push(e(r))):n.push(e(r));return{formErrors:n,fieldErrors:t}}get formErrors(){return this.flatten()}}Mn.create=e=>new Mn(e);const Rn=(e,t)=>{let n;switch(e.code){case Nn.invalid_type:n=e.received===kn.undefined?"Required":`Expected ${e.expected}, received ${e.received}`;break;case Nn.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(e.expected,Pn.jsonStringifyReplacer)}`;break;case Nn.unrecognized_keys:n=`Unrecognized key(s) in object: ${Pn.joinValues(e.keys,", ")}`;break;case Nn.invalid_union:n="Invalid input";break;case Nn.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${Pn.joinValues(e.options)}`;break;case Nn.invalid_enum_value:n=`Invalid enum value. Expected ${Pn.joinValues(e.options)}, received '${e.received}'`;break;case Nn.invalid_arguments:n="Invalid function arguments";break;case Nn.invalid_return_type:n="Invalid function return type";break;case Nn.invalid_date:n="Invalid date";break;case Nn.invalid_string:"object"==typeof e.validation?"startsWith"in e.validation?n=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?n=`Invalid input: must end with "${e.validation.endsWith}"`:Pn.assertNever(e.validation):n="regex"!==e.validation?`Invalid ${e.validation}`:"Invalid";break;case Nn.too_small:n="array"===e.type?`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:"string"===e.type?`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:"number"===e.type?`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:"date"===e.type?`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(e.minimum)}`:"Invalid input";break;case Nn.too_big:n="array"===e.type?`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:"string"===e.type?`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:"number"===e.type?`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:"date"===e.type?`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(e.maximum)}`:"Invalid input";break;case Nn.custom:n="Invalid input";break;case Nn.invalid_intersection_types:n="Intersection results could not be merged";break;case Nn.not_multiple_of:n=`Number must be a multiple of ${e.multipleOf}`;break;case Nn.not_finite:n="Number must be finite";break;default:n=t.defaultError,Pn.assertNever(e)}return{message:n}};let xn=Rn;function Un(){return xn}const Dn=e=>{const{data:t,path:n,errorMaps:r,issueData:i}=e,o=[...n,...i.path||[]],a={...i,path:o};let s="";const u=r.filter((e=>!!e)).slice().reverse();for(const e of u)s=e(a,{data:t,defaultError:s}).message;return{...i,path:o,message:i.message||s}};function jn(e,t){const n=Dn({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,Un(),Rn].filter((e=>!!e))});e.common.issues.push(n)}class Ln{constructor(){this.value="valid"}dirty(){"valid"===this.value&&(this.value="dirty")}abort(){"aborted"!==this.value&&(this.value="aborted")}static mergeArray(e,t){const n=[];for(const r of t){if("aborted"===r.status)return Bn;"dirty"===r.status&&e.dirty(),n.push(r.value)}return{status:e.value,value:n}}static async mergeObjectAsync(e,t){const n=[];for(const e of t)n.push({key:await e.key,value:await e.value});return Ln.mergeObjectSync(e,n)}static mergeObjectSync(e,t){const n={};for(const r of t){const{key:t,value:i}=r;if("aborted"===t.status)return Bn;if("aborted"===i.status)return Bn;"dirty"===t.status&&e.dirty(),"dirty"===i.status&&e.dirty(),(void 0!==i.value||r.alwaysSet)&&(n[t.value]=i.value)}return{status:e.value,value:n}}}const Bn=Object.freeze({status:"aborted"}),Zn=e=>({status:"dirty",value:e}),zn=e=>({status:"valid",value:e}),Wn=e=>"aborted"===e.status,Fn=e=>"dirty"===e.status,Gn=e=>"valid"===e.status,Hn=e=>"undefined"!=typeof Promise&&e instanceof Promise;var Vn;!function(e){e.errToObj=e=>"string"==typeof e?{message:e}:e||{},e.toString=e=>"string"==typeof e?e:null==e?void 0:e.message}(Vn||(Vn={}));class Kn{constructor(e,t,n,r){this.parent=e,this.data=t,this._path=n,this._key=r}get path(){return this._path.concat(this._key)}}const Jn=(e,t)=>{if(Gn(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,error:new Mn(e.common.issues)}};function qn(e){if(!e)return{};const{errorMap:t,invalid_type_error:n,required_error:r,description:i}=e;if(t&&(n||r))throw new Error('Can\'t use "invalid_type_error" or "required_error" in conjunction with custom error map.');if(t)return{errorMap:t,description:i};return{errorMap:(e,t)=>"invalid_type"!==e.code?{message:t.defaultError}:void 0===t.data?{message:null!=r?r:t.defaultError}:{message:null!=n?n:t.defaultError},description:i}}class Qn{constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this)}get description(){return this._def.description}_getType(e){return Cn(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:Cn(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new Ln,ctx:{common:e.parent.common,data:e.data,parsedType:Cn(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const t=this._parse(e);if(Hn(t))throw new Error("Synchronous parse encountered promise.");return t}_parseAsync(e){const t=this._parse(e);return Promise.resolve(t)}parse(e,t){const n=this.safeParse(e,t);if(n.success)return n.data;throw n.error}safeParse(e,t){var n;const r={common:{issues:[],async:null!==(n=null==t?void 0:t.async)&&void 0!==n&&n,contextualErrorMap:null==t?void 0:t.errorMap},path:(null==t?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Cn(e)},i=this._parseSync({data:e,path:r.path,parent:r});return Jn(r,i)}async parseAsync(e,t){const n=await this.safeParseAsync(e,t);if(n.success)return n.data;throw n.error}async safeParseAsync(e,t){const n={common:{issues:[],contextualErrorMap:null==t?void 0:t.errorMap,async:!0},path:(null==t?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Cn(e)},r=this._parse({data:e,path:n.path,parent:n}),i=await(Hn(r)?r:Promise.resolve(r));return Jn(n,i)}refine(e,t){const n=e=>"string"==typeof t||void 0===t?{message:t}:"function"==typeof t?t(e):t;return this._refinement(((t,r)=>{const i=e(t),o=()=>r.addIssue({code:Nn.custom,...n(t)});return"undefined"!=typeof Promise&&i instanceof Promise?i.then((e=>!!e||(o(),!1))):!!i||(o(),!1)}))}refinement(e,t){return this._refinement(((n,r)=>!!e(n)||(r.addIssue("function"==typeof t?t(n,r):t),!1)))}_refinement(e){return new xr({schema:this,typeName:Hr.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}optional(){return Ur.create(this,this._def)}nullable(){return Dr.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return hr.create(this,this._def)}promise(){return Rr.create(this,this._def)}or(e){return gr.create([this,e],this._def)}and(e){return Tr.create(this,e,this._def)}transform(e){return new xr({...qn(this._def),schema:this,typeName:Hr.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const t="function"==typeof e?e:()=>e;return new jr({...qn(this._def),innerType:this,defaultValue:t,typeName:Hr.ZodDefault})}brand(){return new zr({typeName:Hr.ZodBranded,type:this,...qn(this._def)})}catch(e){const t="function"==typeof e?e:()=>e;return new Lr({...qn(this._def),innerType:this,catchValue:t,typeName:Hr.ZodCatch})}describe(e){return new(0,this.constructor)({...this._def,description:e})}pipe(e){return Wr.create(this,e)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const $n=/^c[^\s-]{8,}$/i,Yn=/^[a-z][a-z0-9]*$/,Xn=/^([a-f0-9]{8}-[a-f0-9]{4}-[1-5][a-f0-9]{3}-[a-f0-9]{4}-[a-f0-9]{12}|00000000-0000-0000-0000-000000000000)$/i,er=/^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|([^-]([a-zA-Z0-9-]*\.)+[a-zA-Z]{2,}))$/;class tr extends Qn{constructor(){super(...arguments),this._regex=(e,t,n)=>this.refinement((t=>e.test(t)),{validation:t,code:Nn.invalid_string,...Vn.errToObj(n)}),this.nonempty=e=>this.min(1,Vn.errToObj(e)),this.trim=()=>new tr({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}_parse(e){this._def.coerce&&(e.data=String(e.data));if(this._getType(e)!==kn.string){const t=this._getOrReturnCtx(e);return jn(t,{code:Nn.invalid_type,expected:kn.string,received:t.parsedType}),Bn}const t=new Ln;let n;for(const i of this._def.checks)if("min"===i.kind)e.data.length<i.value&&(n=this._getOrReturnCtx(e,n),jn(n,{code:Nn.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!1,message:i.message}),t.dirty());else if("max"===i.kind)e.data.length>i.value&&(n=this._getOrReturnCtx(e,n),jn(n,{code:Nn.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!1,message:i.message}),t.dirty());else if("length"===i.kind){const r=e.data.length>i.value,o=e.data.length<i.value;(r||o)&&(n=this._getOrReturnCtx(e,n),r?jn(n,{code:Nn.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}):o&&jn(n,{code:Nn.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}),t.dirty())}else if("email"===i.kind)er.test(e.data)||(n=this._getOrReturnCtx(e,n),jn(n,{validation:"email",code:Nn.invalid_string,message:i.message}),t.dirty());else if("uuid"===i.kind)Xn.test(e.data)||(n=this._getOrReturnCtx(e,n),jn(n,{validation:"uuid",code:Nn.invalid_string,message:i.message}),t.dirty());else if("cuid"===i.kind)$n.test(e.data)||(n=this._getOrReturnCtx(e,n),jn(n,{validation:"cuid",code:Nn.invalid_string,message:i.message}),t.dirty());else if("cuid2"===i.kind)Yn.test(e.data)||(n=this._getOrReturnCtx(e,n),jn(n,{validation:"cuid2",code:Nn.invalid_string,message:i.message}),t.dirty());else if("url"===i.kind)try{new URL(e.data)}catch(r){n=this._getOrReturnCtx(e,n),jn(n,{validation:"url",code:Nn.invalid_string,message:i.message}),t.dirty()}else if("regex"===i.kind){i.regex.lastIndex=0;i.regex.test(e.data)||(n=this._getOrReturnCtx(e,n),jn(n,{validation:"regex",code:Nn.invalid_string,message:i.message}),t.dirty())}else if("trim"===i.kind)e.data=e.data.trim();else if("startsWith"===i.kind)e.data.startsWith(i.value)||(n=this._getOrReturnCtx(e,n),jn(n,{code:Nn.invalid_string,validation:{startsWith:i.value},message:i.message}),t.dirty());else if("endsWith"===i.kind)e.data.endsWith(i.value)||(n=this._getOrReturnCtx(e,n),jn(n,{code:Nn.invalid_string,validation:{endsWith:i.value},message:i.message}),t.dirty());else if("datetime"===i.kind){((r=i).precision?r.offset?new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${r.precision}}(([+-]\\d{2}(:?\\d{2})?)|Z)$`):new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${r.precision}}Z$`):0===r.precision?r.offset?new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(([+-]\\d{2}(:?\\d{2})?)|Z)$"):new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}Z$"):r.offset?new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?(([+-]\\d{2}(:?\\d{2})?)|Z)$"):new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?Z$")).test(e.data)||(n=this._getOrReturnCtx(e,n),jn(n,{code:Nn.invalid_string,validation:"datetime",message:i.message}),t.dirty())}else Pn.assertNever(i);var r;return{status:t.value,value:e.data}}_addCheck(e){return new tr({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...Vn.errToObj(e)})}url(e){return this._addCheck({kind:"url",...Vn.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...Vn.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...Vn.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...Vn.errToObj(e)})}datetime(e){var t;return"string"==typeof e?this._addCheck({kind:"datetime",precision:null,offset:!1,message:e}):this._addCheck({kind:"datetime",precision:void 0===(null==e?void 0:e.precision)?null:null==e?void 0:e.precision,offset:null!==(t=null==e?void 0:e.offset)&&void 0!==t&&t,...Vn.errToObj(null==e?void 0:e.message)})}regex(e,t){return this._addCheck({kind:"regex",regex:e,...Vn.errToObj(t)})}startsWith(e,t){return this._addCheck({kind:"startsWith",value:e,...Vn.errToObj(t)})}endsWith(e,t){return this._addCheck({kind:"endsWith",value:e,...Vn.errToObj(t)})}min(e,t){return this._addCheck({kind:"min",value:e,...Vn.errToObj(t)})}max(e,t){return this._addCheck({kind:"max",value:e,...Vn.errToObj(t)})}length(e,t){return this._addCheck({kind:"length",value:e,...Vn.errToObj(t)})}get isDatetime(){return!!this._def.checks.find((e=>"datetime"===e.kind))}get isEmail(){return!!this._def.checks.find((e=>"email"===e.kind))}get isURL(){return!!this._def.checks.find((e=>"url"===e.kind))}get isUUID(){return!!this._def.checks.find((e=>"uuid"===e.kind))}get isCUID(){return!!this._def.checks.find((e=>"cuid"===e.kind))}get isCUID2(){return!!this._def.checks.find((e=>"cuid2"===e.kind))}get minLength(){let e=null;for(const t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return e}get maxLength(){let e=null;for(const t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return e}}function nr(e,t){const n=(e.toString().split(".")[1]||"").length,r=(t.toString().split(".")[1]||"").length,i=n>r?n:r;return parseInt(e.toFixed(i).replace(".",""))%parseInt(t.toFixed(i).replace(".",""))/Math.pow(10,i)}tr.create=e=>{var t;return new tr({checks:[],typeName:Hr.ZodString,coerce:null!==(t=null==e?void 0:e.coerce)&&void 0!==t&&t,...qn(e)})};class rr extends Qn{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){this._def.coerce&&(e.data=Number(e.data));if(this._getType(e)!==kn.number){const t=this._getOrReturnCtx(e);return jn(t,{code:Nn.invalid_type,expected:kn.number,received:t.parsedType}),Bn}let t;const n=new Ln;for(const r of this._def.checks)if("int"===r.kind)Pn.isInteger(e.data)||(t=this._getOrReturnCtx(e,t),jn(t,{code:Nn.invalid_type,expected:"integer",received:"float",message:r.message}),n.dirty());else if("min"===r.kind){(r.inclusive?e.data<r.value:e.data<=r.value)&&(t=this._getOrReturnCtx(e,t),jn(t,{code:Nn.too_small,minimum:r.value,type:"number",inclusive:r.inclusive,exact:!1,message:r.message}),n.dirty())}else if("max"===r.kind){(r.inclusive?e.data>r.value:e.data>=r.value)&&(t=this._getOrReturnCtx(e,t),jn(t,{code:Nn.too_big,maximum:r.value,type:"number",inclusive:r.inclusive,exact:!1,message:r.message}),n.dirty())}else"multipleOf"===r.kind?0!==nr(e.data,r.value)&&(t=this._getOrReturnCtx(e,t),jn(t,{code:Nn.not_multiple_of,multipleOf:r.value,message:r.message}),n.dirty()):"finite"===r.kind?Number.isFinite(e.data)||(t=this._getOrReturnCtx(e,t),jn(t,{code:Nn.not_finite,message:r.message}),n.dirty()):Pn.assertNever(r);return{status:n.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,Vn.toString(t))}gt(e,t){return this.setLimit("min",e,!1,Vn.toString(t))}lte(e,t){return this.setLimit("max",e,!0,Vn.toString(t))}lt(e,t){return this.setLimit("max",e,!1,Vn.toString(t))}setLimit(e,t,n,r){return new rr({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:n,message:Vn.toString(r)}]})}_addCheck(e){return new rr({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:Vn.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:Vn.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:Vn.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:Vn.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:Vn.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:Vn.toString(t)})}finite(e){return this._addCheck({kind:"finite",message:Vn.toString(e)})}get minValue(){let e=null;for(const t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(const t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return e}get isInt(){return!!this._def.checks.find((e=>"int"===e.kind||"multipleOf"===e.kind&&Pn.isInteger(e.value)))}get isFinite(){let e=null,t=null;for(const n of this._def.checks){if("finite"===n.kind||"int"===n.kind||"multipleOf"===n.kind)return!0;"min"===n.kind?(null===t||n.value>t)&&(t=n.value):"max"===n.kind&&(null===e||n.value<e)&&(e=n.value)}return Number.isFinite(t)&&Number.isFinite(e)}}rr.create=e=>new rr({checks:[],typeName:Hr.ZodNumber,coerce:(null==e?void 0:e.coerce)||!1,...qn(e)});class ir extends Qn{_parse(e){this._def.coerce&&(e.data=BigInt(e.data));if(this._getType(e)!==kn.bigint){const t=this._getOrReturnCtx(e);return jn(t,{code:Nn.invalid_type,expected:kn.bigint,received:t.parsedType}),Bn}return zn(e.data)}}ir.create=e=>{var t;return new ir({typeName:Hr.ZodBigInt,coerce:null!==(t=null==e?void 0:e.coerce)&&void 0!==t&&t,...qn(e)})};class or extends Qn{_parse(e){this._def.coerce&&(e.data=Boolean(e.data));if(this._getType(e)!==kn.boolean){const t=this._getOrReturnCtx(e);return jn(t,{code:Nn.invalid_type,expected:kn.boolean,received:t.parsedType}),Bn}return zn(e.data)}}or.create=e=>new or({typeName:Hr.ZodBoolean,coerce:(null==e?void 0:e.coerce)||!1,...qn(e)});class ar extends Qn{_parse(e){this._def.coerce&&(e.data=new Date(e.data));if(this._getType(e)!==kn.date){const t=this._getOrReturnCtx(e);return jn(t,{code:Nn.invalid_type,expected:kn.date,received:t.parsedType}),Bn}if(isNaN(e.data.getTime())){return jn(this._getOrReturnCtx(e),{code:Nn.invalid_date}),Bn}const t=new Ln;let n;for(const r of this._def.checks)"min"===r.kind?e.data.getTime()<r.value&&(n=this._getOrReturnCtx(e,n),jn(n,{code:Nn.too_small,message:r.message,inclusive:!0,exact:!1,minimum:r.value,type:"date"}),t.dirty()):"max"===r.kind?e.data.getTime()>r.value&&(n=this._getOrReturnCtx(e,n),jn(n,{code:Nn.too_big,message:r.message,inclusive:!0,exact:!1,maximum:r.value,type:"date"}),t.dirty()):Pn.assertNever(r);return{status:t.value,value:new Date(e.data.getTime())}}_addCheck(e){return new ar({...this._def,checks:[...this._def.checks,e]})}min(e,t){return this._addCheck({kind:"min",value:e.getTime(),message:Vn.toString(t)})}max(e,t){return this._addCheck({kind:"max",value:e.getTime(),message:Vn.toString(t)})}get minDate(){let e=null;for(const t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return null!=e?new Date(e):null}get maxDate(){let e=null;for(const t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return null!=e?new Date(e):null}}ar.create=e=>new ar({checks:[],coerce:(null==e?void 0:e.coerce)||!1,typeName:Hr.ZodDate,...qn(e)});class sr extends Qn{_parse(e){if(this._getType(e)!==kn.symbol){const t=this._getOrReturnCtx(e);return jn(t,{code:Nn.invalid_type,expected:kn.symbol,received:t.parsedType}),Bn}return zn(e.data)}}sr.create=e=>new sr({typeName:Hr.ZodSymbol,...qn(e)});class ur extends Qn{_parse(e){if(this._getType(e)!==kn.undefined){const t=this._getOrReturnCtx(e);return jn(t,{code:Nn.invalid_type,expected:kn.undefined,received:t.parsedType}),Bn}return zn(e.data)}}ur.create=e=>new ur({typeName:Hr.ZodUndefined,...qn(e)});class cr extends Qn{_parse(e){if(this._getType(e)!==kn.null){const t=this._getOrReturnCtx(e);return jn(t,{code:Nn.invalid_type,expected:kn.null,received:t.parsedType}),Bn}return zn(e.data)}}cr.create=e=>new cr({typeName:Hr.ZodNull,...qn(e)});class lr extends Qn{constructor(){super(...arguments),this._any=!0}_parse(e){return zn(e.data)}}lr.create=e=>new lr({typeName:Hr.ZodAny,...qn(e)});class dr extends Qn{constructor(){super(...arguments),this._unknown=!0}_parse(e){return zn(e.data)}}dr.create=e=>new dr({typeName:Hr.ZodUnknown,...qn(e)});class pr extends Qn{_parse(e){const t=this._getOrReturnCtx(e);return jn(t,{code:Nn.invalid_type,expected:kn.never,received:t.parsedType}),Bn}}pr.create=e=>new pr({typeName:Hr.ZodNever,...qn(e)});class fr extends Qn{_parse(e){if(this._getType(e)!==kn.undefined){const t=this._getOrReturnCtx(e);return jn(t,{code:Nn.invalid_type,expected:kn.void,received:t.parsedType}),Bn}return zn(e.data)}}fr.create=e=>new fr({typeName:Hr.ZodVoid,...qn(e)});class hr extends Qn{_parse(e){const{ctx:t,status:n}=this._processInputParams(e),r=this._def;if(t.parsedType!==kn.array)return jn(t,{code:Nn.invalid_type,expected:kn.array,received:t.parsedType}),Bn;if(null!==r.exactLength){const e=t.data.length>r.exactLength.value,i=t.data.length<r.exactLength.value;(e||i)&&(jn(t,{code:e?Nn.too_big:Nn.too_small,minimum:i?r.exactLength.value:void 0,maximum:e?r.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:r.exactLength.message}),n.dirty())}if(null!==r.minLength&&t.data.length<r.minLength.value&&(jn(t,{code:Nn.too_small,minimum:r.minLength.value,type:"array",inclusive:!0,exact:!1,message:r.minLength.message}),n.dirty()),null!==r.maxLength&&t.data.length>r.maxLength.value&&(jn(t,{code:Nn.too_big,maximum:r.maxLength.value,type:"array",inclusive:!0,exact:!1,message:r.maxLength.message}),n.dirty()),t.common.async)return Promise.all([...t.data].map(((e,n)=>r.type._parseAsync(new Kn(t,e,t.path,n))))).then((e=>Ln.mergeArray(n,e)));const i=[...t.data].map(((e,n)=>r.type._parseSync(new Kn(t,e,t.path,n))));return Ln.mergeArray(n,i)}get element(){return this._def.type}min(e,t){return new hr({...this._def,minLength:{value:e,message:Vn.toString(t)}})}max(e,t){return new hr({...this._def,maxLength:{value:e,message:Vn.toString(t)}})}length(e,t){return new hr({...this._def,exactLength:{value:e,message:Vn.toString(t)}})}nonempty(e){return this.min(1,e)}}var mr;function vr(e){if(e instanceof yr){const t={};for(const n in e.shape){const r=e.shape[n];t[n]=Ur.create(vr(r))}return new yr({...e._def,shape:()=>t})}return e instanceof hr?hr.create(vr(e.element)):e instanceof Ur?Ur.create(vr(e.unwrap())):e instanceof Dr?Dr.create(vr(e.unwrap())):e instanceof Er?Er.create(e.items.map((e=>vr(e)))):e}hr.create=(e,t)=>new hr({type:e,minLength:null,maxLength:null,exactLength:null,typeName:Hr.ZodArray,...qn(t)}),function(e){e.mergeShapes=(e,t)=>({...e,...t})}(mr||(mr={}));class yr extends Qn{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(null!==this._cached)return this._cached;const e=this._def.shape(),t=Pn.objectKeys(e);return this._cached={shape:e,keys:t}}_parse(e){if(this._getType(e)!==kn.object){const t=this._getOrReturnCtx(e);return jn(t,{code:Nn.invalid_type,expected:kn.object,received:t.parsedType}),Bn}const{status:t,ctx:n}=this._processInputParams(e),{shape:r,keys:i}=this._getCached(),o=[];if(!(this._def.catchall instanceof pr&&"strip"===this._def.unknownKeys))for(const e in n.data)i.includes(e)||o.push(e);const a=[];for(const e of i){const t=r[e],i=n.data[e];a.push({key:{status:"valid",value:e},value:t._parse(new Kn(n,i,n.path,e)),alwaysSet:e in n.data})}if(this._def.catchall instanceof pr){const e=this._def.unknownKeys;if("passthrough"===e)for(const e of o)a.push({key:{status:"valid",value:e},value:{status:"valid",value:n.data[e]}});else if("strict"===e)o.length>0&&(jn(n,{code:Nn.unrecognized_keys,keys:o}),t.dirty());else if("strip"!==e)throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const e=this._def.catchall;for(const t of o){const r=n.data[t];a.push({key:{status:"valid",value:t},value:e._parse(new Kn(n,r,n.path,t)),alwaysSet:t in n.data})}}return n.common.async?Promise.resolve().then((async()=>{const e=[];for(const t of a){const n=await t.key;e.push({key:n,value:await t.value,alwaysSet:t.alwaysSet})}return e})).then((e=>Ln.mergeObjectSync(t,e))):Ln.mergeObjectSync(t,a)}get shape(){return this._def.shape()}strict(e){return Vn.errToObj,new yr({...this._def,unknownKeys:"strict",...void 0!==e?{errorMap:(t,n)=>{var r,i,o,a;const s=null!==(o=null===(i=(r=this._def).errorMap)||void 0===i?void 0:i.call(r,t,n).message)&&void 0!==o?o:n.defaultError;return"unrecognized_keys"===t.code?{message:null!==(a=Vn.errToObj(e).message)&&void 0!==a?a:s}:{message:s}}}:{}})}strip(){return new yr({...this._def,unknownKeys:"strip"})}passthrough(){return new yr({...this._def,unknownKeys:"passthrough"})}extend(e){return new yr({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new yr({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>mr.mergeShapes(this._def.shape(),e._def.shape()),typeName:Hr.ZodObject})}setKey(e,t){return this.augment({[e]:t})}catchall(e){return new yr({...this._def,catchall:e})}pick(e){const t={};return Pn.objectKeys(e).forEach((n=>{e[n]&&this.shape[n]&&(t[n]=this.shape[n])})),new yr({...this._def,shape:()=>t})}omit(e){const t={};return Pn.objectKeys(this.shape).forEach((n=>{e[n]||(t[n]=this.shape[n])})),new yr({...this._def,shape:()=>t})}deepPartial(){return vr(this)}partial(e){const t={};return Pn.objectKeys(this.shape).forEach((n=>{const r=this.shape[n];e&&!e[n]?t[n]=r:t[n]=r.optional()})),new yr({...this._def,shape:()=>t})}required(e){const t={};return Pn.objectKeys(this.shape).forEach((n=>{if(e&&!e[n])t[n]=this.shape[n];else{let e=this.shape[n];for(;e instanceof Ur;)e=e._def.innerType;t[n]=e}})),new yr({...this._def,shape:()=>t})}keyof(){return Cr(Pn.objectKeys(this.shape))}}yr.create=(e,t)=>new yr({shape:()=>e,unknownKeys:"strip",catchall:pr.create(),typeName:Hr.ZodObject,...qn(t)}),yr.strictCreate=(e,t)=>new yr({shape:()=>e,unknownKeys:"strict",catchall:pr.create(),typeName:Hr.ZodObject,...qn(t)}),yr.lazycreate=(e,t)=>new yr({shape:e,unknownKeys:"strip",catchall:pr.create(),typeName:Hr.ZodObject,...qn(t)});class gr extends Qn{_parse(e){const{ctx:t}=this._processInputParams(e),n=this._def.options;if(t.common.async)return Promise.all(n.map((async e=>{const n={...t,common:{...t.common,issues:[]},parent:null};return{result:await e._parseAsync({data:t.data,path:t.path,parent:n}),ctx:n}}))).then((function(e){for(const t of e)if("valid"===t.result.status)return t.result;for(const n of e)if("dirty"===n.result.status)return t.common.issues.push(...n.ctx.common.issues),n.result;const n=e.map((e=>new Mn(e.ctx.common.issues)));return jn(t,{code:Nn.invalid_union,unionErrors:n}),Bn}));{let e;const r=[];for(const i of n){const n={...t,common:{...t.common,issues:[]},parent:null},o=i._parseSync({data:t.data,path:t.path,parent:n});if("valid"===o.status)return o;"dirty"!==o.status||e||(e={result:o,ctx:n}),n.common.issues.length&&r.push(n.common.issues)}if(e)return t.common.issues.push(...e.ctx.common.issues),e.result;const i=r.map((e=>new Mn(e)));return jn(t,{code:Nn.invalid_union,unionErrors:i}),Bn}}get options(){return this._def.options}}gr.create=(e,t)=>new gr({options:e,typeName:Hr.ZodUnion,...qn(t)});const _r=e=>e instanceof Ir?_r(e.schema):e instanceof xr?_r(e.innerType()):e instanceof kr?[e.value]:e instanceof Nr?e.options:e instanceof Mr?Object.keys(e.enum):e instanceof jr?_r(e._def.innerType):e instanceof ur?[void 0]:e instanceof cr?[null]:null;class wr extends Qn{_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==kn.object)return jn(t,{code:Nn.invalid_type,expected:kn.object,received:t.parsedType}),Bn;const n=this.discriminator,r=t.data[n],i=this.optionsMap.get(r);return i?t.common.async?i._parseAsync({data:t.data,path:t.path,parent:t}):i._parseSync({data:t.data,path:t.path,parent:t}):(jn(t,{code:Nn.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[n]}),Bn)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,t,n){const r=new Map;for(const n of t){const t=_r(n.shape[e]);if(!t)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(const i of t){if(r.has(i))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(i)}`);r.set(i,n)}}return new wr({typeName:Hr.ZodDiscriminatedUnion,discriminator:e,options:t,optionsMap:r,...qn(n)})}}function br(e,t){const n=Cn(e),r=Cn(t);if(e===t)return{valid:!0,data:e};if(n===kn.object&&r===kn.object){const n=Pn.objectKeys(t),r=Pn.objectKeys(e).filter((e=>-1!==n.indexOf(e))),i={...e,...t};for(const n of r){const r=br(e[n],t[n]);if(!r.valid)return{valid:!1};i[n]=r.data}return{valid:!0,data:i}}if(n===kn.array&&r===kn.array){if(e.length!==t.length)return{valid:!1};const n=[];for(let r=0;r<e.length;r++){const i=br(e[r],t[r]);if(!i.valid)return{valid:!1};n.push(i.data)}return{valid:!0,data:n}}return n===kn.date&&r===kn.date&&+e==+t?{valid:!0,data:e}:{valid:!1}}class Tr extends Qn{_parse(e){const{status:t,ctx:n}=this._processInputParams(e),r=(e,r)=>{if(Wn(e)||Wn(r))return Bn;const i=br(e.value,r.value);return i.valid?((Fn(e)||Fn(r))&&t.dirty(),{status:t.value,value:i.data}):(jn(n,{code:Nn.invalid_intersection_types}),Bn)};return n.common.async?Promise.all([this._def.left._parseAsync({data:n.data,path:n.path,parent:n}),this._def.right._parseAsync({data:n.data,path:n.path,parent:n})]).then((([e,t])=>r(e,t))):r(this._def.left._parseSync({data:n.data,path:n.path,parent:n}),this._def.right._parseSync({data:n.data,path:n.path,parent:n}))}}Tr.create=(e,t,n)=>new Tr({left:e,right:t,typeName:Hr.ZodIntersection,...qn(n)});class Er extends Qn{_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==kn.array)return jn(n,{code:Nn.invalid_type,expected:kn.array,received:n.parsedType}),Bn;if(n.data.length<this._def.items.length)return jn(n,{code:Nn.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),Bn;!this._def.rest&&n.data.length>this._def.items.length&&(jn(n,{code:Nn.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),t.dirty());const r=[...n.data].map(((e,t)=>{const r=this._def.items[t]||this._def.rest;return r?r._parse(new Kn(n,e,n.path,t)):null})).filter((e=>!!e));return n.common.async?Promise.all(r).then((e=>Ln.mergeArray(t,e))):Ln.mergeArray(t,r)}get items(){return this._def.items}rest(e){return new Er({...this._def,rest:e})}}Er.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Er({items:e,typeName:Hr.ZodTuple,rest:null,...qn(t)})};class Pr extends Qn{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==kn.object)return jn(n,{code:Nn.invalid_type,expected:kn.object,received:n.parsedType}),Bn;const r=[],i=this._def.keyType,o=this._def.valueType;for(const e in n.data)r.push({key:i._parse(new Kn(n,e,n.path,e)),value:o._parse(new Kn(n,n.data[e],n.path,e))});return n.common.async?Ln.mergeObjectAsync(t,r):Ln.mergeObjectSync(t,r)}get element(){return this._def.valueType}static create(e,t,n){return new Pr(t instanceof Qn?{keyType:e,valueType:t,typeName:Hr.ZodRecord,...qn(n)}:{keyType:tr.create(),valueType:e,typeName:Hr.ZodRecord,...qn(t)})}}class Sr extends Qn{_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==kn.map)return jn(n,{code:Nn.invalid_type,expected:kn.map,received:n.parsedType}),Bn;const r=this._def.keyType,i=this._def.valueType,o=[...n.data.entries()].map((([e,t],o)=>({key:r._parse(new Kn(n,e,n.path,[o,"key"])),value:i._parse(new Kn(n,t,n.path,[o,"value"]))})));if(n.common.async){const e=new Map;return Promise.resolve().then((async()=>{for(const n of o){const r=await n.key,i=await n.value;if("aborted"===r.status||"aborted"===i.status)return Bn;"dirty"!==r.status&&"dirty"!==i.status||t.dirty(),e.set(r.value,i.value)}return{status:t.value,value:e}}))}{const e=new Map;for(const n of o){const r=n.key,i=n.value;if("aborted"===r.status||"aborted"===i.status)return Bn;"dirty"!==r.status&&"dirty"!==i.status||t.dirty(),e.set(r.value,i.value)}return{status:t.value,value:e}}}}Sr.create=(e,t,n)=>new Sr({valueType:t,keyType:e,typeName:Hr.ZodMap,...qn(n)});class Ar extends Qn{_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==kn.set)return jn(n,{code:Nn.invalid_type,expected:kn.set,received:n.parsedType}),Bn;const r=this._def;null!==r.minSize&&n.data.size<r.minSize.value&&(jn(n,{code:Nn.too_small,minimum:r.minSize.value,type:"set",inclusive:!0,exact:!1,message:r.minSize.message}),t.dirty()),null!==r.maxSize&&n.data.size>r.maxSize.value&&(jn(n,{code:Nn.too_big,maximum:r.maxSize.value,type:"set",inclusive:!0,exact:!1,message:r.maxSize.message}),t.dirty());const i=this._def.valueType;function o(e){const n=new Set;for(const r of e){if("aborted"===r.status)return Bn;"dirty"===r.status&&t.dirty(),n.add(r.value)}return{status:t.value,value:n}}const a=[...n.data.values()].map(((e,t)=>i._parse(new Kn(n,e,n.path,t))));return n.common.async?Promise.all(a).then((e=>o(e))):o(a)}min(e,t){return new Ar({...this._def,minSize:{value:e,message:Vn.toString(t)}})}max(e,t){return new Ar({...this._def,maxSize:{value:e,message:Vn.toString(t)}})}size(e,t){return this.min(e,t).max(e,t)}nonempty(e){return this.min(1,e)}}Ar.create=(e,t)=>new Ar({valueType:e,minSize:null,maxSize:null,typeName:Hr.ZodSet,...qn(t)});class Or extends Qn{constructor(){super(...arguments),this.validate=this.implement}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==kn.function)return jn(t,{code:Nn.invalid_type,expected:kn.function,received:t.parsedType}),Bn;function n(e,n){return Dn({data:e,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,Un(),Rn].filter((e=>!!e)),issueData:{code:Nn.invalid_arguments,argumentsError:n}})}function r(e,n){return Dn({data:e,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,Un(),Rn].filter((e=>!!e)),issueData:{code:Nn.invalid_return_type,returnTypeError:n}})}const i={errorMap:t.common.contextualErrorMap},o=t.data;return this._def.returns instanceof Rr?zn((async(...e)=>{const t=new Mn([]),a=await this._def.args.parseAsync(e,i).catch((r=>{throw t.addIssue(n(e,r)),t})),s=await o(...a);return await this._def.returns._def.type.parseAsync(s,i).catch((e=>{throw t.addIssue(r(s,e)),t}))})):zn(((...e)=>{const t=this._def.args.safeParse(e,i);if(!t.success)throw new Mn([n(e,t.error)]);const a=o(...t.data),s=this._def.returns.safeParse(a,i);if(!s.success)throw new Mn([r(a,s.error)]);return s.data}))}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new Or({...this._def,args:Er.create(e).rest(dr.create())})}returns(e){return new Or({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,t,n){return new Or({args:e||Er.create([]).rest(dr.create()),returns:t||dr.create(),typeName:Hr.ZodFunction,...qn(n)})}}class Ir extends Qn{get schema(){return this._def.getter()}_parse(e){const{ctx:t}=this._processInputParams(e);return this._def.getter()._parse({data:t.data,path:t.path,parent:t})}}Ir.create=(e,t)=>new Ir({getter:e,typeName:Hr.ZodLazy,...qn(t)});class kr extends Qn{_parse(e){if(e.data!==this._def.value){const t=this._getOrReturnCtx(e);return jn(t,{received:t.data,code:Nn.invalid_literal,expected:this._def.value}),Bn}return{status:"valid",value:e.data}}get value(){return this._def.value}}function Cr(e,t){return new Nr({values:e,typeName:Hr.ZodEnum,...qn(t)})}kr.create=(e,t)=>new kr({value:e,typeName:Hr.ZodLiteral,...qn(t)});class Nr extends Qn{_parse(e){if("string"!=typeof e.data){const t=this._getOrReturnCtx(e),n=this._def.values;return jn(t,{expected:Pn.joinValues(n),received:t.parsedType,code:Nn.invalid_type}),Bn}if(-1===this._def.values.indexOf(e.data)){const t=this._getOrReturnCtx(e),n=this._def.values;return jn(t,{received:t.data,code:Nn.invalid_enum_value,options:n}),Bn}return zn(e.data)}get options(){return this._def.values}get enum(){const e={};for(const t of this._def.values)e[t]=t;return e}get Values(){const e={};for(const t of this._def.values)e[t]=t;return e}get Enum(){const e={};for(const t of this._def.values)e[t]=t;return e}extract(e){return Nr.create(e)}exclude(e){return Nr.create(this.options.filter((t=>!e.includes(t))))}}Nr.create=Cr;class Mr extends Qn{_parse(e){const t=Pn.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(e);if(n.parsedType!==kn.string&&n.parsedType!==kn.number){const e=Pn.objectValues(t);return jn(n,{expected:Pn.joinValues(e),received:n.parsedType,code:Nn.invalid_type}),Bn}if(-1===t.indexOf(e.data)){const e=Pn.objectValues(t);return jn(n,{received:n.data,code:Nn.invalid_enum_value,options:e}),Bn}return zn(e.data)}get enum(){return this._def.values}}Mr.create=(e,t)=>new Mr({values:e,typeName:Hr.ZodNativeEnum,...qn(t)});class Rr extends Qn{unwrap(){return this._def.type}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==kn.promise&&!1===t.common.async)return jn(t,{code:Nn.invalid_type,expected:kn.promise,received:t.parsedType}),Bn;const n=t.parsedType===kn.promise?t.data:Promise.resolve(t.data);return zn(n.then((e=>this._def.type.parseAsync(e,{path:t.path,errorMap:t.common.contextualErrorMap}))))}}Rr.create=(e,t)=>new Rr({type:e,typeName:Hr.ZodPromise,...qn(t)});class xr extends Qn{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===Hr.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){const{status:t,ctx:n}=this._processInputParams(e),r=this._def.effect||null;if("preprocess"===r.type){const e=r.transform(n.data);return n.common.async?Promise.resolve(e).then((e=>this._def.schema._parseAsync({data:e,path:n.path,parent:n}))):this._def.schema._parseSync({data:e,path:n.path,parent:n})}const i={addIssue:e=>{jn(n,e),e.fatal?t.abort():t.dirty()},get path(){return n.path}};if(i.addIssue=i.addIssue.bind(i),"refinement"===r.type){const e=e=>{const t=r.refinement(e,i);if(n.common.async)return Promise.resolve(t);if(t instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return e};if(!1===n.common.async){const r=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});return"aborted"===r.status?Bn:("dirty"===r.status&&t.dirty(),e(r.value),{status:t.value,value:r.value})}return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then((n=>"aborted"===n.status?Bn:("dirty"===n.status&&t.dirty(),e(n.value).then((()=>({status:t.value,value:n.value}))))))}if("transform"===r.type){if(!1===n.common.async){const e=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(!Gn(e))return e;const o=r.transform(e.value,i);if(o instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:t.value,value:o}}return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then((e=>Gn(e)?Promise.resolve(r.transform(e.value,i)).then((e=>({status:t.value,value:e}))):e))}Pn.assertNever(r)}}xr.create=(e,t,n)=>new xr({schema:e,typeName:Hr.ZodEffects,effect:t,...qn(n)}),xr.createWithPreprocess=(e,t,n)=>new xr({schema:t,effect:{type:"preprocess",transform:e},typeName:Hr.ZodEffects,...qn(n)});class Ur extends Qn{_parse(e){return this._getType(e)===kn.undefined?zn(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}Ur.create=(e,t)=>new Ur({innerType:e,typeName:Hr.ZodOptional,...qn(t)});class Dr extends Qn{_parse(e){return this._getType(e)===kn.null?zn(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}Dr.create=(e,t)=>new Dr({innerType:e,typeName:Hr.ZodNullable,...qn(t)});class jr extends Qn{_parse(e){const{ctx:t}=this._processInputParams(e);let n=t.data;return t.parsedType===kn.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:t.path,parent:t})}removeDefault(){return this._def.innerType}}jr.create=(e,t)=>new jr({innerType:e,typeName:Hr.ZodDefault,defaultValue:"function"==typeof t.default?t.default:()=>t.default,...qn(t)});class Lr extends Qn{_parse(e){const{ctx:t}=this._processInputParams(e),n=this._def.innerType._parse({data:t.data,path:t.path,parent:{...t,common:{...t.common,issues:[]}}});return Hn(n)?n.then((e=>({status:"valid",value:"valid"===e.status?e.value:this._def.catchValue()}))):{status:"valid",value:"valid"===n.status?n.value:this._def.catchValue()}}removeCatch(){return this._def.innerType}}Lr.create=(e,t)=>new Lr({innerType:e,typeName:Hr.ZodCatch,catchValue:"function"==typeof t.catch?t.catch:()=>t.catch,...qn(t)});class Br extends Qn{_parse(e){if(this._getType(e)!==kn.nan){const t=this._getOrReturnCtx(e);return jn(t,{code:Nn.invalid_type,expected:kn.nan,received:t.parsedType}),Bn}return{status:"valid",value:e.data}}}Br.create=e=>new Br({typeName:Hr.ZodNaN,...qn(e)});const Zr=Symbol("zod_brand");class zr extends Qn{_parse(e){const{ctx:t}=this._processInputParams(e),n=t.data;return this._def.type._parse({data:n,path:t.path,parent:t})}unwrap(){return this._def.type}}class Wr extends Qn{_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.common.async){return(async()=>{const e=await this._def.in._parseAsync({data:n.data,path:n.path,parent:n});return"aborted"===e.status?Bn:"dirty"===e.status?(t.dirty(),Zn(e.value)):this._def.out._parseAsync({data:e.value,path:n.path,parent:n})})()}{const e=this._def.in._parseSync({data:n.data,path:n.path,parent:n});return"aborted"===e.status?Bn:"dirty"===e.status?(t.dirty(),{status:"dirty",value:e.value}):this._def.out._parseSync({data:e.value,path:n.path,parent:n})}}static create(e,t){return new Wr({in:e,out:t,typeName:Hr.ZodPipeline})}}const Fr=(e,t={},n)=>e?lr.create().superRefine(((r,i)=>{if(!e(r)){const e="function"==typeof t?t(r):t,o="string"==typeof e?{message:e}:e;i.addIssue({code:"custom",...o,fatal:n})}})):lr.create(),Gr={object:yr.lazycreate};var Hr;!function(e){e.ZodString="ZodString",e.ZodNumber="ZodNumber",e.ZodNaN="ZodNaN",e.ZodBigInt="ZodBigInt",e.ZodBoolean="ZodBoolean",e.ZodDate="ZodDate",e.ZodSymbol="ZodSymbol",e.ZodUndefined="ZodUndefined",e.ZodNull="ZodNull",e.ZodAny="ZodAny",e.ZodUnknown="ZodUnknown",e.ZodNever="ZodNever",e.ZodVoid="ZodVoid",e.ZodArray="ZodArray",e.ZodObject="ZodObject",e.ZodUnion="ZodUnion",e.ZodDiscriminatedUnion="ZodDiscriminatedUnion",e.ZodIntersection="ZodIntersection",e.ZodTuple="ZodTuple",e.ZodRecord="ZodRecord",e.ZodMap="ZodMap",e.ZodSet="ZodSet",e.ZodFunction="ZodFunction",e.ZodLazy="ZodLazy",e.ZodLiteral="ZodLiteral",e.ZodEnum="ZodEnum",e.ZodEffects="ZodEffects",e.ZodNativeEnum="ZodNativeEnum",e.ZodOptional="ZodOptional",e.ZodNullable="ZodNullable",e.ZodDefault="ZodDefault",e.ZodCatch="ZodCatch",e.ZodPromise="ZodPromise",e.ZodBranded="ZodBranded",e.ZodPipeline="ZodPipeline"}(Hr||(Hr={}));const Vr=tr.create,Kr=rr.create,Jr=Br.create,qr=ir.create,Qr=or.create,$r=ar.create,Yr=sr.create,Xr=ur.create,ei=cr.create,ti=lr.create,ni=dr.create,ri=pr.create,ii=fr.create,oi=hr.create,ai=yr.create,si=yr.strictCreate,ui=gr.create,ci=wr.create,li=Tr.create,di=Er.create,pi=Pr.create,fi=Sr.create,hi=Ar.create,mi=Or.create,vi=Ir.create,yi=kr.create,gi=Nr.create,_i=Mr.create,wi=Rr.create,bi=xr.create,Ti=Ur.create,Ei=Dr.create,Pi=xr.createWithPreprocess,Si=Wr.create,Ai={string:e=>tr.create({...e,coerce:!0}),number:e=>rr.create({...e,coerce:!0}),boolean:e=>or.create({...e,coerce:!0}),bigint:e=>ir.create({...e,coerce:!0}),date:e=>ar.create({...e,coerce:!0})},Oi=Bn;var Ii=Object.freeze({__proto__:null,defaultErrorMap:Rn,setErrorMap:function(e){xn=e},getErrorMap:Un,makeIssue:Dn,EMPTY_PATH:[],addIssueToContext:jn,ParseStatus:Ln,INVALID:Bn,DIRTY:Zn,OK:zn,isAborted:Wn,isDirty:Fn,isValid:Gn,isAsync:Hn,get util(){return Pn},ZodParsedType:kn,getParsedType:Cn,ZodType:Qn,ZodString:tr,ZodNumber:rr,ZodBigInt:ir,ZodBoolean:or,ZodDate:ar,ZodSymbol:sr,ZodUndefined:ur,ZodNull:cr,ZodAny:lr,ZodUnknown:dr,ZodNever:pr,ZodVoid:fr,ZodArray:hr,get objectUtil(){return mr},ZodObject:yr,ZodUnion:gr,ZodDiscriminatedUnion:wr,ZodIntersection:Tr,ZodTuple:Er,ZodRecord:Pr,ZodMap:Sr,ZodSet:Ar,ZodFunction:Or,ZodLazy:Ir,ZodLiteral:kr,ZodEnum:Nr,ZodNativeEnum:Mr,ZodPromise:Rr,ZodEffects:xr,ZodTransformer:xr,ZodOptional:Ur,ZodNullable:Dr,ZodDefault:jr,ZodCatch:Lr,ZodNaN:Br,BRAND:Zr,ZodBranded:zr,ZodPipeline:Wr,custom:Fr,Schema:Qn,ZodSchema:Qn,late:Gr,get ZodFirstPartyTypeKind(){return Hr},coerce:Ai,any:ti,array:oi,bigint:qr,boolean:Qr,date:$r,discriminatedUnion:ci,effect:bi,enum:gi,function:mi,instanceof:(e,t={message:`Input not instance of ${e.name}`})=>Fr((t=>t instanceof e),t,!0),intersection:li,lazy:vi,literal:yi,map:fi,nan:Jr,nativeEnum:_i,never:ri,null:ei,nullable:Ei,number:Kr,object:ai,oboolean:()=>Qr().optional(),onumber:()=>Kr().optional(),optional:Ti,ostring:()=>Vr().optional(),pipeline:Si,preprocess:Pi,promise:wi,record:pi,set:hi,strictObject:si,string:Vr,symbol:Yr,transformer:bi,tuple:di,undefined:Xr,union:ui,unknown:ni,void:ii,NEVER:Oi,ZodIssueCode:Nn,quotelessJson:e=>JSON.stringify(e,null,2).replace(/"([^"]+)":/g,"$1:"),ZodError:Mn}),ki=function(){function t(){var e,n,r,i,a,u,c,l,d,p,f,h,m,v,y,g,_,w,b,T,E,P,S,A,O,I,k;_t(this,t),this.initConfig=window.APP_CONFIG;var C=gt.isString(null===(e=this.initConfig)||void 0===e||null===(n=e.app)||void 0===n?void 0:n.headerColor)&&(null===(r=this.initConfig)||void 0===r||null===(i=r.app)||void 0===i||null===(a=i.headerColor)||void 0===a?void 0:a.length)>0?fe:he;this.hideIOSSafeAreaBottom=!!(null===(u=this.initConfig)||void 0===u||null===(c=u.app)||void 0===c?void 0:c.hideIOSSafeAreaBottom),this.hideAndroidBottomNavigationBar=!!(null===(l=this.initConfig)||void 0===l||null===(d=l.app)||void 0===d?void 0:d.hideAndroidBottomNavigationBar);var N,M,R="none"===(null===(p=this.initConfig)||void 0===p||null===(f=p.app)||void 0===f?void 0:f.leftButton)||"home"===(null===(h=this.initConfig)||void 0===h||null===(m=h.app)||void 0===m?void 0:m.leftButton)?pe.HIDE_BACK:pe.SHOW_BACK,x="home"===(null===(v=this.initConfig)||void 0===v||null===(y=v.app)||void 0===y?void 0:y.leftButton)||"both"===(null===(g=this.initConfig)||void 0===g||null===(_=g.app)||void 0===_?void 0:_.leftButton)?pe.SHOW_HOME:pe.HIDE_HOME,U=new URL(location.href),D=fn(null===(w=this.initConfig)||void 0===w||null===(b=w.app)||void 0===b?void 0:b.statusBar);"boolean"==typeof(null===(T=this.initConfig)||void 0===T||null===(E=T.app)||void 0===E?void 0:E.actionBarHidden)&&(C=(null===(N=this.initConfig)||void 0===N||null===(M=N.app)||void 0===M?void 0:M.actionBarHidden)?he:fe);this.config={actionbarType:C,buttonType:R,statusbarType:D,dataConfig:{backgroundColor:(null===(P=this.initConfig)||void 0===P||null===(S=P.app)||void 0===S?void 0:S.headerColor)||me,textColor:(null===(A=this.initConfig)||void 0===A||null===(O=A.app)||void 0===O?void 0:O.textColor)||"",textAlign:(null===(I=this.initConfig)||void 0===I||null===(k=I.app)||void 0===k?void 0:k.textAlign)||ve,viewInLeftType:R,confirmToExit:1},homeConfig:{enable:x,url:"".concat(s,"/").concat(o,"/").concat(U.search)}}}var n=t.prototype;return n.setNavigationBarTitle=function(e){return _e((function(){return Pe(this,(function(t){return[2,new Promise((function(t,n){tn("CHANGE_TITLE_HEADER",{title:e},{success:function(){t(),document.title=e},fail:function(e){n(e)}},{timeout:!1})}))]}))}))()},n.setNavigationBarLeftButton=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.config.dataConfig.confirmToExit,n=this;return _e((function(){var r,i;return Pe(this,(function(o){return void 0===(void 0===e?"undefined":dt(e))&&null===(void 0===e?"undefined":dt(e))||(r="none"===e||"home"===e?pe.HIDE_BACK:pe.SHOW_BACK,i="home"===e||"both"===e?pe.SHOW_HOME:pe.HIDE_HOME,n.config.buttonType=r,n.config.dataConfig.viewInLeftType=r,n.config.homeConfig.enable=i),n.config.dataConfig.confirmToExit=t,[2,new Promise((function(e,t){tn("CHANGE_ACTIONBAR_LEFTBUTTON_TYPE",Ue({},n.config),{success:function(){e()},fail:function(e){t(e)}},{timeout:!1})}))]}))}))()},n.setAndroidBottomNavigationBar=function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],n=this;return _e((function(){var r,i,o;return Pe(this,(function(a){return i=t?e.AndroidBottomNavigationBarType.hide:e.AndroidBottomNavigationBarType.show,o=null===(r=Ce())||void 0===r?void 0:r.platform,[2,new Promise((function(e,r){if(!(null==o?void 0:o.isAndroid))return e();tn("CHANGE_BOTTOMBAR",{bottombarType:i},{success:function(){n.hideAndroidBottomNavigationBar=!!t,window.ANDROID_BOTTOM_NAVIGATION_BAR_HIDDEN=!!t,e()},fail:function(e){r(e)}},{timeout:!1})}))]}))}))()},n.setIOSBottomSafeArea=function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],n=this;return _e((function(){var r,i,o;return Pe(this,(function(a){return i=t?e.IOSSafeAreaBottomType.hide:e.IOSSafeAreaBottomType.show,o=null===(r=Ce())||void 0===r?void 0:r.platform,[2,new Promise((function(e,r){if(!(null==o?void 0:o.isIOS))return e();tn("CHANGE_BOTTOMBAR",{bottombarType:i},{success:function(){n.hideIOSSafeAreaBottom=!!t,window.IOS_BOTTOM_SAFE_AREA_HIDDEN=!!t,e()},fail:function(e){r(e)}},{timeout:!1,delay:200})}))]}))}))()},n.configHeader=function(t){var n=this;return _e((function(){var r;return Pe(this,(function(i){return r=n.config,gt.isString(t.headerColor)&&(r.dataConfig.backgroundColor=t.headerColor),gt.isString(t.headerTextColor)&&(r.dataConfig.textColor=t.headerTextColor),gt.isString(t.textAlign)&&("left"===t.textAlign?r.dataConfig.textAlign=e.TextAlignType.left:"center"===t.textAlign&&(r.dataConfig.textAlign=e.TextAlignType.center)),!0===t.hideActionBar?r.actionbarType=he:!1===t.hideActionBar&&(r.actionbarType=fe),"normal"===t.statusBarType?r.statusbarType=e.StatusBarType.normal:"hidden"===t.statusBarType?r.statusbarType=e.StatusBarType.hidden:"transparent"===t.statusBarType&&(r.statusbarType=e.StatusBarType.transparent),[2,new Promise((function(i,o){tn("CHANGE_ACTIONBAR",Ue({},r),{success:function(){var o;n.config=Ue({},r);var a,s=null===(o=Ce())||void 0===o?void 0:o.platform;window.STATUS_BAR_TYPE=(a=n.config.statusbarType)===e.StatusBarType.hidden?"hidden":a===e.StatusBarType.transparent?"transparent":"normal",window.ACTION_BAR_HIDDEN=n.config.actionbarType===he;var u=null===document||void 0===document?void 0:document.querySelector(":root");if(null==s?void 0:s.isAndroid){var c=0;if(("hidden"===t.statusBarType||"transparent"===t.statusBarType)&&t.hideActionBar){var l=window.ANDROID_STATUS_BAR_HEIGHT;isNaN(l)&&(l=Math.round(ZaloJavaScriptInterface.getStatusBarHeight()/window.devicePixelRatio)),c=l}c?null==u||u.style.setProperty("--zaui-safe-area-inset-top","".concat(c,"px")):null==u||u.style.setProperty("--zaui-safe-area-inset-top","env(safe-area-inset-top, 0px)")}i()},fail:function(e){o(e)}},{timeout:!1})}))]}))}))()},t.getInstance=function(){return t.instance||(t.instance=new t),t.instance},t}(),Ci=ki.getInstance(),Ni=[ai({title:Vr()}).optional()];function Mi(e){return Ri.apply(this,arguments)}function Ri(){return Ri=_e((function(e){return Pe(this,(function(t){return[2,_n("setNavigationBarTitle",Ni,[e],function(){var e=_e((function(e){return Pe(this,(function(t){switch(t.label){case 0:return Ne.isMp?[4,Ci.setNavigationBarTitle(e.title)]:[3,2];case 1:return[2,t.sent()];case 2:return Ne.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Re("setNavigationBarTitle",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Ri.apply(this,arguments)}var xi=[ai({color:Vr(),textColor:Ii.enum(["black","white"]).optional(),statusBarColor:Vr().optional()}).optional()];function Ui(e){return Di.apply(this,arguments)}function Di(){return Di=_e((function(e){return Pe(this,(function(t){return[2,_n("setNavigationBarColor",xi,[e],function(){var e=_e((function(e){return Pe(this,(function(t){switch(t.label){case 0:return Ne.isMp?[4,Ci.configHeader({hideActionBar:!(e.color.length>0),headerTextColor:e.textColor,headerColor:e.color.length>0?e.color:e.statusBarColor})]:[3,2];case 1:return[2,t.sent()];case 2:return Ne.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Re("setNavigationBarColor",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Di.apply(this,arguments)}var ji=[ai({type:Ii.enum(["none","back","home","both"])}).optional()];function Li(e){return Bi.apply(this,arguments)}function Bi(){return Bi=_e((function(e){return Pe(this,(function(t){return[2,_n("setNavigationBarLeftButton",ji,[e],function(){var e=_e((function(e){return Pe(this,(function(t){switch(t.label){case 0:return Ne.isMp?[4,Ci.setNavigationBarLeftButton(e.type)]:[3,2];case 1:return[2,t.sent()];case 2:return Ne.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Re("setNavigationBarLeftButton",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Bi.apply(this,arguments)}function Zi(e,t,n){if(!t.has(e))throw new TypeError("attempted to "+n+" private field on non-instance");return t.get(e)}function zi(e,t){return function(e,t){return t.get?t.get.call(e):t.value}(e,Zi(e,t,"get"))}function Wi(e,t,n){!function(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}(e,t),t.set(e,n)}function Fi(e,t,n){return function(e,t,n){if(t.set)t.set.call(e,n);else{if(!t.writable)throw new TypeError("attempted to set read only private field");t.value=n}}(e,Zi(e,t,"set"),n),n}var Gi,Hi,Vi,Ki=new WeakMap,Ji=new WeakMap,qi=new WeakMap,Qi=function(){function e(t){_t(this,e),Wi(this,Ki,{writable:!0,value:localStorage}),Wi(this,Ji,{writable:!0,value:void 0}),Wi(this,qi,{writable:!0,value:void 0}),Fi(this,qi,{keys:new Set,currentSize:0,limitSize:oe}),Fi(this,Ji,t),this.findAllCurrentDataByApp(t)}var t=e.prototype;return t.findAllCurrentDataByApp=function(e){try{var t;for(t in zi(this,Ki)){if(e)if(t.split("_")[0]!==e)continue;zi(this,qi).keys.add(t)}}catch(e){}},t.get=function(e){var t=this,n=new Map;return e.forEach((function(e){n.set(e,t.getSync(e))})),Promise.resolve(n)},t.getSync=function(e){return zi(this,Ji)&&(e="".concat(zi(this,Ji),"_").concat(e)),zi(this,qi).keys.has(e)?zi(this,Ki).getItem(e):null},t.set=function(e){var t=this;return _e((function(){return Pe(this,(function(n){return Object.entries(e).forEach((function(e){var n=De(e,2),r=n[0],i=n[1];t.setSync(r,i.replace(/\\"/g,'"'))})),[2,Promise.resolve({errorKeys:[]})]}))}))()},t.setSync=function(e,t){zi(this,Ji)&&(e="".concat(zi(this,Ji),"_").concat(e)),zi(this,Ki).setItem(e,t),zi(this,qi).keys.add(e)},t.getInfo=function(){var e=this;return _e((function(){return Pe(this,(function(t){return[2,Promise.resolve(e.getInfoSync())]}))}))()},t.getInfoSync=function(){var e=function(e,t){var n,r=0;for(n in e){var i=n.split("_")[0];e.hasOwnProperty(n)&&(t&&i!==t||(r+=2*(e[n].length+n.length)))}return r}(zi(this,Ki),zi(this,Ji));return{currentSize:gt.isNumber(e)?Number((e/1024).toFixed(2)):0,limitSize:Number((oe/1024).toFixed(2))}},t.remove=function(e){var t=this;return _e((function(){return Pe(this,(function(n){return e.forEach((function(e){t.removeSync(e)})),[2,Promise.resolve({errorKeys:[]})]}))}))()},t.removeSync=function(e){zi(this,Ji)&&(e="".concat(zi(this,Ji),"_").concat(e)),zi(this,qi).keys.has(e)&&(zi(this,Ki).removeItem(e),zi(this,qi).keys.delete(e))},t.clear=function(){var e=this;return _e((function(){return Pe(this,(function(t){return[2,Promise.resolve(e.clearSync())]}))}))()},t.clearSync=function(){var e=this;zi(this,qi).keys.forEach((function(t){zi(e,Ji)&&t.indexOf(zi(e,Ji))<0||(zi(e,Ki).removeItem(t),zi(e,qi).keys.delete(t))}))},e}(),$i=new WeakMap,Yi=new WeakMap,Xi=function(){function e(t){_t(this,e),Wi(this,$i,{writable:!0,value:void 0}),Wi(this,Yi,{writable:!0,value:void 0}),Fi(this,Yi,{keys:new Set,currentSize:0,limitSize:oe}),Fi(this,$i,t)}var t=e.prototype;return t.get=function(e){var t=this;return _e((function(){return Pe(this,(function(n){return[2,new Promise((function(n,r){tn("ZBROWSER_MPDS",{mpds_action:"mpds.get",mpds_data:{keys:e},appId:zi(t,$i)},{success:function(e){var t=new Map;e&&e.mpds_data&&e.mpds_data.map&&(t=new Map(Object.entries(e.mpds_data.map))),n(t)},fail:function(e){r(e)}},{isMultiCallback:!1})}))]}))}))()},t.set=function(e){var t=this;return _e((function(){return Pe(this,(function(n){return[2,new Promise((function(n,r){tn("ZBROWSER_MPDS",{mpds_action:"mpds.set",mpds_data:{map:e},appId:zi(t,$i)},{success:function(e){var t=[];e&&e.mpds_data&&e.mpds_data.error_keys&&(t=e.mpds_data.error_keys),n({errorKeys:t})},fail:function(e){r(e)}},{isMultiCallback:!1})}))]}))}))()},t.getInfo=function(){var e=this;return _e((function(){return Pe(this,(function(t){return[2,new Promise((function(t,n){tn("ZBROWSER_MPDS",{mpds_action:"mpds.get.size",mpds_data:{},appId:zi(e,$i)},{success:function(e){var n=0;e&&e.mpds_data&&e.mpds_data.size&&(n=e.mpds_data.size),t({currentSize:gt.isNumber(n)?Number(Number(n)/1024):0,limitSize:Number(oe/1024)})},fail:function(e){n(e)}},{isMultiCallback:!1})}))]}))}))()},t.remove=function(e){var t=this;return _e((function(){return Pe(this,(function(n){return[2,new Promise((function(n,r){tn("ZBROWSER_MPDS",{mpds_action:"mpds.remove.key",mpds_data:{keys:e},appId:zi(t,$i)},{success:function(e){var t=[];e&&e.mpds_data&&e.mpds_data.error_keys&&(t=e.mpds_data.error_keys),n({errorKeys:t})},fail:function(e){r(e)}},{isMultiCallback:!1})}))]}))}))()},t.clear=function(){var e=this;return _e((function(){return Pe(this,(function(t){return[2,new Promise((function(t,n){tn("ZBROWSER_MPDS",{mpds_action:"mpds.clear.appData",mpds_data:{},appId:zi(e,$i)},{success:function(){t()},fail:function(e){n(e)}},{isMultiCallback:!1})}))]}))}))()},e}(),eo=function(){function e(){_t(this,e)}var t=e.prototype;return t.getDataFromStorage=function(e){var t=this;return _e((function(){var n,r;return Pe(this,(function(i){switch(i.label){case 0:return[4,t.getInstance().get(e)];case 1:return n=i.sent(),r={},n.forEach((function(e,t){r[t]=cn(e)})),[2,r]}}))}))()},t.putDataToStorage=function(e){var t=this;return _e((function(){var n,r;return Pe(this,(function(i){switch(i.label){case 0:return n=t.getInstance(),r={},Object.entries(e).forEach((function(e){var t=De(e,2),n=t[0],i=t[1];gt.isUndefined(i)||gt.isNull(i)||(r[n]=pn(i))})),[4,n.set(r)];case 1:return[2,i.sent()]}}))}))()},t.removeDataFromStorage=function(e){var t=this;return _e((function(){return Pe(this,(function(n){switch(n.label){case 0:return[4,t.getInstance().remove(e)];case 1:return[2,n.sent()]}}))}))()},t.clearStorage=function(){var e=this;return _e((function(){return Pe(this,(function(t){switch(t.label){case 0:return[4,e.getInstance().clear()];case 1:return t.sent(),[2]}}))}))()},t.getStorageInfo=function(){var e=this;return _e((function(){return Pe(this,(function(t){switch(t.label){case 0:return[4,e.getInstance().getInfo()];case 1:return[2,t.sent()]}}))}))()},e}(),to=new WeakMap,no=function(e){At(n,e);var t=It(n);function n(e){var r;return _t(this,n),Wi(Ot(r=t.call(this)),to,{writable:!0,value:void 0}),Fi(Ot(r),to,e),r}return n.prototype.getInstance=function(){return new Qi(zi(this,to))},n}(eo),ro=new WeakMap,io=function(e){At(n,e);var t=It(n);function n(e){var r;return _t(this,n),Wi(Ot(r=t.call(this)),ro,{writable:!0,value:void 0}),Fi(Ot(r),ro,e),r}return n.prototype.getInstance=function(){return new Xi(zi(this,ro))},n}(eo),oo=new no(o),ao=(null===(Gi=Ce())||void 0===Gi?void 0:Gi.zaloVersion)||"",so=(null===(Hi=Ce())||void 0===Hi?void 0:Hi.platformName)||"unknown";!!gt.isString(ao)&&parseInt(ao,10)>={android:12100571,iOS:400,wp:0,unknown:0}[so]&&(null===(Vi=Ce())||void 0===Vi?void 0:Vi.appEnv.isMp)&&(oo=new io(o));var uo=oo,co=[ai({data:Ii.record(Vr(),Ii.any())}).optional()];function lo(e){return po.apply(this,arguments)}function po(){return po=_e((function(e){return Pe(this,(function(t){return[2,_n("setStorage",co,[e],function(){var e=_e((function(e){return Pe(this,(function(t){switch(t.label){case 0:return Ne.isMp||Ne.isMpWeb?[4,uo.putDataToStorage(e.data)]:[3,2];case 1:return[2,t.sent()];case 2:return[2,Promise.reject(Re("setStorage",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),po.apply(this,arguments)}var fo=[ai({keys:Ii.array(Vr())}).optional()];function ho(e){return mo.apply(this,arguments)}function mo(){return mo=_e((function(e){return Pe(this,(function(t){return[2,_n("getStorage",fo,[e],function(){var e=_e((function(e){return Pe(this,(function(t){switch(t.label){case 0:return Ne.isMp||Ne.isMpWeb?[4,uo.getDataFromStorage(e.keys)]:[3,2];case 1:return[2,t.sent()];case 2:return[2,Promise.reject(Re("getStorage",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),mo.apply(this,arguments)}function vo(e){return yo.apply(this,arguments)}function yo(){return(yo=_e((function(e){return Pe(this,(function(t){return[2,_n("getStorageInfo",[],[e],_e((function(){return Pe(this,(function(e){switch(e.label){case 0:return Ne.isMp||Ne.isMpWeb?[4,uo.getStorageInfo()]:[3,2];case 1:return[2,e.sent()];case 2:return[2,Promise.reject(Re("getStorageInfo",{}))]}}))})))]}))}))).apply(this,arguments)}var go=[ai({keys:Ii.array(Vr())}).optional()];function _o(e){return wo.apply(this,arguments)}function wo(){return wo=_e((function(e){return Pe(this,(function(t){return[2,_n("removeStorage",go,[e],function(){var e=_e((function(e){return Pe(this,(function(t){switch(t.label){case 0:return Ne.isMp||Ne.isMpWeb?[4,uo.removeDataFromStorage(e.keys)]:[3,2];case 1:return[2,t.sent()];case 2:return[2,Promise.reject(Re("removeStorage",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),wo.apply(this,arguments)}var bo=[ai({prefix:Vr().optional()}).optional()];function To(e){return Eo.apply(this,arguments)}function Eo(){return(Eo=_e((function(e){return Pe(this,(function(t){return[2,_n("clearStorage",bo,[e],_e((function(){return Pe(this,(function(e){switch(e.label){case 0:return Ne.isMp||Ne.isMpWeb?[4,uo.clearStorage()]:[3,2];case 1:return[2,e.sent()];case 2:return[2,Promise.reject(Re("clearStorage",{}))]}}))})))]}))}))).apply(this,arguments)}var Po=function(){var e=_e((function(e,t){var n,r,i,a;return Pe(this,(function(s){switch(s.label){case 0:return(r=t)?[3,2]:[4,vn()];case 1:r=!s.sent(),s.label=2;case 2:return n=r,[4,on.getAccessToken(n)];case 3:return i=s.sent(),a="id,name,user_id_by_oa,is_sensitive",a=e?"".concat(a,",picture.type(").concat(e,")"):"".concat(a,",picture"),[4,fetch("".concat(d.GET_USER_INFO,"?fields=").concat(a,"&miniapp_id=").concat(o),{headers:{access_token:i||""}}).then(function(){var e=_e((function(e){var t,n,r,i;return Pe(this,(function(o){switch(o.label){case 0:return[4,e.json()];case 1:return r=o.sent(),i=null==r?void 0:r.user_id_by_oa,[2,{id:null==r?void 0:r.id,name:(null==r?void 0:r.name)||"",avatar:(null==r||null===(t=r.picture)||void 0===t||null===(n=t.data)||void 0===n?void 0:n.url)||"",idByOA:i,followedOA:!!(null==r?void 0:r.is_follower),isSensitive:null==r?void 0:r.is_sensitive}]}}))}));return function(t){return e.apply(this,arguments)}}())];case 4:return[2,s.sent()]}}))}));return function(t,n){return e.apply(this,arguments)}}(),So=[ai({avatarType:Ii.enum(["small","normal","large"]).optional(),autoRequestPermission:Ii.boolean().default(!1).optional()}).optional()];function Ao(e){return Oo.apply(this,arguments)}function Oo(){return Oo=_e((function(e){return Pe(this,(function(t){return[2,_n("getUserInfo",So,[e],function(){var e=_e((function(e){var t,n;return Pe(this,(function(r){switch(r.label){case 0:return Ne.isMp?(t=null==e?void 0:e.avatarType,n=null==e?void 0:e.autoRequestPermission,[4,Po(t,n)]):[3,2];case 1:return[2,{userInfo:r.sent()}];case 2:return Ne.isMpWeb?[2,Promise.resolve({userInfo:{id:"3368637342326461234",name:"User Name",avatar:"https://h5.zdn.vn/static/images/avatar.png"}})]:[2,Promise.reject(Re("getUserInfo",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Oo.apply(this,arguments)}var Io=function(e){return{NONE:e?-2:0,WIFI:e?0:1,"2G":2,"3G":e?15:2,"4G":e?13:2}},ko=_e((function(){return Pe(this,(function(t){return[2,new Promise((function(t,n){tn("WEBVIEW_NETWORKTYPE",{url:window.location.href,featureId:""},{success:function(n){var r,i,o,a=n.network,s=(null===(r=Ce())||void 0===r||null===(i=r.platform)||void 0===i?void 0:i.isAndroid)||!1;switch(a){case Io(s).NONE:o=e.NetworkType.none;break;case Io(s).WIFI:o=e.NetworkType.wifi;break;case Io(s)["2G"]:case Io(s)["3G"]:case Io(s)["4G"]:o=e.NetworkType.cellular;break;default:o=e.NetworkType.unknown}t(o)},fail:function(e){n(e)}},{})}))]}))}));function Co(e){return No.apply(this,arguments)}function No(){return(No=_e((function(t){return Pe(this,(function(n){return[2,_n("getNetworkType",[],[t],_e((function(){var t,n;return Pe(this,(function(r){switch(r.label){case 0:return Ne.isMp?[4,ko()]:[3,2];case 1:return[2,{networkType:r.sent()}];case 2:if(Ne.isMpWeb){switch(t=navigator.connection||navigator.mozConnection||navigator.webkitConnection,t.effectiveType){case"none":n=e.NetworkType.none;break;case"4g":n=e.NetworkType.wifi;break;case"3g":case"2g":n=e.NetworkType.cellular;break;default:n=e.NetworkType.unknown}return[2,Promise.resolve({networkType:n})]}return[2,Promise.reject(Re("getNetworkType",{}))]}}))})))]}))}))).apply(this,arguments)}var Mo=[Ii.function().args(ai({isConnected:Ii.boolean(),networkType:Ii.enum(["none","wifi","cellular","unknown"])})).returns(Ii.void())];function Ro(t){return _n("onNetworkStatusChange",Mo,[t],(function(t){var n=t;if(Ne.isMp)!function(t){Nt.getInstance().on(e.Events.NetworkChanged,(function(e){var n=null==e?void 0:e.state;ko().then((function(e){t({isConnected:"CONNECTED"===n,networkType:e})}))}))}(n);else if(Ne.isMpWeb){var r=navigator.connection||navigator.mozConnection||navigator.webkitConnection,i=r.effectiveType;r.addEventListener("change",(function(){var t;switch(i){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}n({isConnected:!0,networkType:t})}))}}))}var xo=function(){var e=_e((function(e){var t,n,r,i,o,a;return Pe(this,(function(s){return a={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==e||null===(t=e.scanConfig)||void 0===t?void 0:t.scanTime)?e.scanConfig.scanTime:15e3,time_between_scan:gt.isNumber(null==e||null===(n=e.scanConfig)||void 0===n?void 0:n.timeBetweenScan)?e.scanConfig.timeBetweenScan:1e4,beacon_timeout:gt.isNumber(null==e||null===(r=e.scanConfig)||void 0===r?void 0:r.beaconTimeout)?e.scanConfig.beaconTimeout:3e4,delayCheckConnectedTimeout:gt.isNumber(null==e||null===(i=e.scanConfig)||void 0===i?void 0:i.delayCheckConnectedTimeout)?e.scanConfig.delayCheckConnectedTimeout:5e3,beaconConnectedTimeout:gt.isNumber(null==e||null===(o=e.scanConfig)||void 0===o?void 0:o.beaconConnectedTimeout)?e.scanConfig.beaconConnectedTimeout:6e5},items:Array.isArray(null==e?void 0:e.items)?null==e?void 0:e.items:[]}},[2,new Promise((function(e,t){tn("SCAN_IBEACON",Ue({},a),{success:function(){e(!0)},fail:function(e){t(e)}},{})}))]}))}));return function(t){return e.apply(this,arguments)}}(),Uo=[ai({scanningType:Ii.number().refine((function(e){return[0,1].includes(e)}),{message:"The type must be either 0 or 1"}).default(0).optional(),expire:Ii.number().optional(),monitorInterval:Ii.number().optional(),domain:Ii.string().optional(),scanConfig:ai({scanTime:Ii.number().optional(),timeBetweenScan:Ii.number().optional(),beaconTimeout:Ii.number().optional(),delayCheckConnectedTimeout:Ii.number().optional(),beaconConnectedTimeout:Ii.number().optional()}).optional(),items:Ii.array(ai({id:Ii.string().optional(),distance:Ii.number().optional(),monitor:ai({enable:Ii.boolean().optional(),movingRange:Ii.number().optional()}).optional()})).optional(),scanFromSource:Ii.string().optional()}).optional()];function Do(e){return jo.apply(this,arguments)}function jo(){return(jo=_e((function(e){return Pe(this,(function(t){return[2,_n("startBeaconDiscovery",Uo,[e],_e((function(){return Pe(this,(function(t){switch(t.label){case 0:return Ne.isMp?[4,xo(e)]:[3,2];case 1:return[2,t.sent()];case 2:return Ne.isMpWeb?[2,Promise.resolve(!0)]:[2,Promise.reject(Re("startBeaconDiscovery",{}))]}}))})))]}))}))).apply(this,arguments)}var Lo=_e((function(){return Pe(this,(function(e){return[2,new Promise((function(e,t){tn("SCAN_IBEACON",{subaction:2},{success:function(){e(!0)},fail:function(e){t(e)}},{})}))]}))}));function Bo(e){return Zo.apply(this,arguments)}function Zo(){return(Zo=_e((function(e){return Pe(this,(function(t){return[2,_n("stopBeaconDiscovery",[],[e],_e((function(){return Pe(this,(function(e){switch(e.label){case 0:return Ne.isMp?[4,Lo()]:[3,2];case 1:return[2,e.sent()];case 2:return Ne.isMpWeb?[2,Promise.resolve(!0)]:[2,Promise.reject(Re("stopBeaconDiscovery",{}))]}}))})))]}))}))).apply(this,arguments)}var zo=_e((function(){return Pe(this,(function(e){return[2,new Promise((function(e,t){tn("SCAN_IBEACON",{subaction:1},{success:function(t){var n={beacons:[]};Array.isArray(t)&&t.forEach((function(e){var t={uuid:e.uuid,major:e.major,minor:e.minor,distance:e.distance,rssi:e.rssi};n.beacons.push(t)})),e(n)},fail:function(e){t(e)}},{isMultiCallback:!0})}))]}))}));function Wo(e){return Fo.apply(this,arguments)}function Fo(){return(Fo=_e((function(e){return Pe(this,(function(t){return[2,_n("getBeacons",[],[e],_e((function(){return Pe(this,(function(e){switch(e.label){case 0:return Ne.isMp?[4,zo()]:[3,2];case 1:return[2,e.sent()];case 2:return Ne.isMpWeb?[2,Promise.resolve({beacons:[]})]:[2,Promise.reject(Re("getBeacons",{}))]}}))})))]}))}))).apply(this,arguments)}var Go=_e((function(){return Pe(this,(function(e){return[2,new Promise((function(e,t){tn("WINDOW_CLOSE",{},{success:function(t){e(t)},fail:function(e){t(e)}},{})}))]}))}));function Ho(e){return Vo.apply(this,arguments)}function Vo(){return(Vo=_e((function(e){return Pe(this,(function(t){return[2,_n("closeApp",[],[e],_e((function(){return Pe(this,(function(e){switch(e.label){case 0:return Ne.isMp?[4,Go()]:[3,2];case 1:return[2,e.sent()];case 2:return Ne.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Re("closeApp",{}))]}}))})))]}))}))).apply(this,arguments)}var Ko=_e((function(){return Pe(this,(function(e){return[2,new Promise((function(e,t){tn("OPEN_QR",{skipOpenLink:!0},{success:function(t){e(t)},fail:function(e){t(e)}},{})}))]}))}));function Jo(e){return qo.apply(this,arguments)}function qo(){return(qo=_e((function(e){return Pe(this,(function(t){return[2,_n("scanQRCode",[],[e],_e((function(){return Pe(this,(function(e){switch(e.label){case 0:return Ne.isMp?[4,Ko()]:[3,2];case 1:return[2,e.sent()];case 2:return Ne.isMpWeb?[2,Promise.resolve({content:""})]:[2,Promise.reject(Re("scanQRCode",{}))]}}))})))]}))}))).apply(this,arguments)}var Qo=function(){var t=_e((function(t,n,r,o){return Pe(this,(function(a){return[2,new Promise((function(a,s){tn("OPEN_PROFILE",{uId:t,type:e.ProfileType[n],zapp:i,sourceId:r,sourceIndex:o},{success:function(){a()},fail:function(e){s(e)}},{})}))]}))}));return function(e,n,r,i){return t.apply(this,arguments)}}(),$o=[ai({id:Vr(),type:Ii.enum(["user","oa","aliasOA"]),sourceId:Ii.any().optional(),sourceIndex:Ii.any().optional()}).optional()];function Yo(e){return Xo.apply(this,arguments)}function Xo(){return Xo=_e((function(e){return Pe(this,(function(t){return[2,_n("openProfile",$o,[e],function(){var e=_e((function(e){var t,n,r,i;return Pe(this,(function(o){switch(o.label){case 0:return Ne.isMp?(t=e.id,n=e.type,r=e.sourceId,i=e.sourceIndex,[4,Qo(t,n,r,i)]):[3,2];case 1:return[2,o.sent()];case 2:return Ne.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Re("openProfile",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Xo.apply(this,arguments)}var ea=function(){var t=_e((function(t,n){var r,o,a,s=arguments;return Pe(this,(function(u){return r=s.length>2&&void 0!==s[2]?s[2]:"",o=s.length>3?s[3]:void 0,a=s.length>4?s[4]:void 0,[2,new Promise((function(s,u){tn("OPEN_CHAT",{uId:t,type:e.ChatType[n],msg:r,zapp:i,sourceId:o,sourceIndex:a},{success:function(){s()},fail:function(e){u(e)}},{})}))]}))}));return function(e,n){return t.apply(this,arguments)}}(),ta=[ai({id:Vr(),type:Ii.enum(["user","oa"]),sourceId:Ii.any().optional(),sourceIndex:Ii.any().optional(),message:Vr().optional()}).optional()];function na(e){return ra.apply(this,arguments)}function ra(){return ra=_e((function(e){return Pe(this,(function(t){return[2,_n("openChat",ta,[e],function(){var e=_e((function(e){var t,n,r,i,o;return Pe(this,(function(a){switch(a.label){case 0:return Ne.isMp?(t=e.id,n=e.type,r=e.message,i=e.sourceId,o=e.sourceIndex,[4,ea(t,n,r,i,o)]):[3,2];case 1:return[2,a.sent()];case 2:return Ne.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Re("openChat",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),ra.apply(this,arguments)}function ia(e,t){return t=null!=t?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))})),e}var oa=function(){var t=_e((function(t,n){var r;return Pe(this,(function(o){switch(r={},t){case"image":r={photoUrl:null==n?void 0:n.imageUrl};break;case"link":r={link:null==n?void 0:n.link,title:null==n?void 0:n.title,thumb:null==n?void 0:n.thumb,description:null==n?void 0:n.description};break;case"profile":r={avt:null==n?void 0:n.avatar,uid:null==n?void 0:n.id,dpn:null==n?void 0:n.displayName}}return[2,new Promise((function(n,o){tn("OPEN_POSTFEED",ia(Ue({type:e.PostFeedType[t]},r),{zapp:i}),{success:function(e){n({status:null==e?void 0:e.status,shareType:null==e?void 0:e.share_type,numberOfUser:null==e?void 0:e.uid_to_size})},fail:function(e){o(e)}},{})}))]}))}));return function(e,n){return t.apply(this,arguments)}}(),aa=[Ii.union([ai({type:Ii.enum(["image"]),data:ai({imageUrl:Vr().url().optional()})}),ai({type:Ii.enum(["link"]),data:ai({link:Vr().url(),title:Vr().max(100).optional(),thumb:Vr().url().optional(),description:Vr().max(400).default("").optional()})}),ai({type:Ii.enum(["profile"]),data:ai({id:Vr().optional()})})])];function sa(e){return ua.apply(this,arguments)}function ua(){return ua=_e((function(e){return Pe(this,(function(t){return[2,_n("openPostFeed",aa,[e],function(){var e=_e((function(e){var t,n;return Pe(this,(function(r){switch(r.label){case 0:return Ne.isMp?(t=e.type,n=e.data,[4,oa(t,n)]):[3,2];case 1:return[2,r.sent()];case 2:return Ne.isMpWeb?[2,Promise.resolve({status:1,shareType:0,numberOfUser:0})]:[2,Promise.reject(Re("openPostFeed",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),ua.apply(this,arguments)}var ca=function(){var e=_e((function(e){return Pe(this,(function(t){return[2,new Promise((function(t,n){tn("FOLLOW_OA",{uid:e,showDialogConfirm:!0,forceUpdate:!0,zapp:i},{success:function(e){t(e)},fail:function(e){n(e)}},{timeout:!1})}))]}))}));return function(t){return e.apply(this,arguments)}}(),la=[ai({id:Vr(),showDialogConfirm:Ii.boolean().optional()}).optional()];function da(e){return pa.apply(this,arguments)}function pa(){return pa=_e((function(e){return Pe(this,(function(t){return[2,_n("followOA",la,[e],function(){var e=_e((function(e){var t;return Pe(this,(function(n){switch(n.label){case 0:return Ne.isMp?(t=e.id,[4,ca(t)]):[3,2];case 1:return[2,n.sent()];case 2:return Ne.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Re("followOA",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),pa.apply(this,arguments)}var fa=function(){var e=_e((function(e){return Pe(this,(function(t){return[2,new Promise((function(t,n){tn("UNFOLLOW_OA",{uid:e,forceUpdate:!0,zapp:i},{success:function(){t()},fail:function(e){n(e)}},{})}))]}))}));return function(t){return e.apply(this,arguments)}}(),ha=[ai({id:Vr()}).optional()];function ma(e){return va.apply(this,arguments)}function va(){return va=_e((function(e){return Pe(this,(function(t){return[2,_n("unfollowOA",ha,[e],function(){var e=_e((function(e){var t;return Pe(this,(function(n){switch(n.label){case 0:return Ne.isMp?(t=e.id,[4,fa(t)]):[3,2];case 1:return[2,n.sent()];case 2:return Ne.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Re("unfollowOA",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),va.apply(this,arguments)}var ya=function(){var e=_e((function(e,t,n,r,i,o){var s,u,l,p,f,h,m,v;return Pe(this,(function(y){switch(y.label){case 0:return l=new URL(location.href),p=new URLSearchParams,f="".concat(l.pathname.replace(c,"")).concat(l.search),o&&(f="/".concat(e).concat("/"===o[0]?"":"/").concat(o)),!(h=new URL("".concat(a).concat(f))).searchParams.has("env")&&(null===(s=window.APP_ENV)||void 0===s?void 0:s.length)>0&&h.searchParams.set("env",window.APP_ENV),!h.searchParams.has("version")&&(null===(u=window.APP_VERSION)||void 0===u?void 0:u.length)>0&&h.searchParams.set("version",window.APP_VERSION),p.append("title",n),p.append("description",r||""),p.append("thumbnail",i||""),p.append("url",h.href),p.append("accessToken",t||""),m={headers:{"Content-Type":"application/x-www-form-urlencoded"}},[4,fetch(d.CREATE_SHARE_LINK,Ue({method:"POST",body:p},m))];case 1:return[4,y.sent().json()];case 2:if(!(v=y.sent())||0!==v.err)throw en.error.cannotGetShareInfo();return h.search="".concat(h.search,"&zshareId=").concat(v.data.shareId),[2,ia(Ue({},v.data),{shareableLink:h.href})]}}))}));return function(t,n,r,i,o,a){return e.apply(this,arguments)}}(),ga=function(){var t=_e((function(t,n){var r,a,s,u,c,l,d,p,f,h,m,v;return Pe(this,(function(y){switch(y.label){case 0:switch(r={},a=t,t){case"text":return[3,1];case"image":return[3,2];case"gif":return[3,3];case"video":return[3,4];case"link":return[3,5];case"oa":return[3,6];case"zmp":return[3,7];case"zmp_deep_link":return[3,10]}return[3,13];case 1:return r={text:null==n?void 0:n.text,desc:(null==n?void 0:n.desc)||(null==n?void 0:n.description),autoParseLink:(null==n?void 0:n.autoParseLink)?1:0},[3,14];case 2:return l=[],d=(null===(u=Ce())||void 0===u?void 0:u.zaloVersion)||0,p=(null===(c=Ce())||void 0===c?void 0:c.platformName)||"unknown",Number(d)>=ie[p]&&(a="multi_image"),Array.isArray(null==n?void 0:n.imageUrls)&&(null==n?void 0:n.imageUrls.length)>0?l=null==n?void 0:n.imageUrls:l.push(null==n?void 0:n.imageUrl),r={photoUrls:l,photoUrl:null==n?void 0:n.imageUrl,caption:null==n?void 0:n.caption},[3,14];case 3:return r={photoUrl:null==n?void 0:n.imageUrl,gifUrl:null==n?void 0:n.gifUrl,width:null==n?void 0:n.width,height:null==n?void 0:n.height},[3,14];case 4:return r={videoThumb:null==n?void 0:n.videoThumb,videoUrl:null==n?void 0:n.videoUrl,width:null==n?void 0:n.width,height:null==n?void 0:n.height},[3,14];case 5:return r={link:null==n?void 0:n.link,chatOnly:(null==n?void 0:n.chatOnly)?1:0},[3,14];case 6:return r={uid:null==n?void 0:n.id},[3,14];case 7:case 10:return[4,on.getAccessToken()];case 8:case 11:return s=y.sent(),[4,ya(o,s||"",(null==n?void 0:n.title)||"",(null==n?void 0:n.description)||"",(null==n?void 0:n.thumbnail)||"",null==n?void 0:n.path)];case 9:return f=y.sent(),r={data:{ZInstantAPIInfo:{url:"".concat(f.zinstantApi),zinstantdata_id:"templateId=".concat(f.ztemplateId,"&appId=").concat(o,"&shareId=").concat(f.shareId)},previewMsgText:{msg:{en:"Zalo Mini Program",vi:"Chương trình nhỏ"}},enableReactions:1}},[3,14];case 12:return h=y.sent().shareableLink,m=new URL(h),v=m.searchParams.getAll("zshareId"),m.searchParams.delete("zshareId"),v.length>0&&m.searchParams.append("zshareId",v[0]),r={link:m.href,chatOnly:0},[3,14];case 13:return[3,14];case 14:return[2,new Promise((function(t,n){tn("OPEN_SHARESHEET",ia(Ue({type:e.ShareSheetType[a]},r),{zapp:i}),{success:function(e){t({status:null==e?void 0:e.status,shareType:null==e?void 0:e.share_type,numberOfUser:null==e?void 0:e.uid_to_size})},fail:function(e){n(e)}},{timeout:!1})}))]}}))}));return function(e,n){return t.apply(this,arguments)}}(),_a=[Ii.union([ai({type:Ii.enum(["text"]),data:ai({text:Vr(),description:Vr().default("").optional(),autoParseLink:Ii.boolean().default(!1).optional()})}),ai({type:Ii.enum(["image"]),data:ai({imageUrl:Vr().url(),imageUrls:Ii.array(Vr().url()).max(10).optional()})}),ai({type:Ii.enum(["link"]),data:ai({link:Vr().url(),chatOnly:Ii.boolean().optional()})}),ai({type:Ii.enum(["oa"]),data:ai({id:Vr()})}),ai({type:Ii.enum(["gif"]),data:ai({gifUrl:Vr().url(),imageUrl:Vr().url().optional(),width:Kr().min(0).optional(),height:Kr().min(0).optional()})}),ai({type:Ii.enum(["video"]),data:ai({videoThumb:Vr().url(),videoUrl:Vr().url(),width:Kr().min(0).optional(),height:Kr().min(0).optional()})}),ai({type:Ii.enum(["zmp","zmp_deep_link"]),data:ai({title:Vr().max(100),thumbnail:Vr().url(),path:Vr().optional(),description:Vr().max(400).default("").optional()})})])];function wa(e){return ba.apply(this,arguments)}function ba(){return ba=_e((function(e){return Pe(this,(function(t){return[2,_n("openShareSheet",_a,[e],function(){var e=_e((function(e){var t,n;return Pe(this,(function(r){switch(r.label){case 0:return Ne.isMp?(t=e.type,n=e.data,[4,ga(t,n)]):[3,2];case 1:return[2,r.sent()];case 2:return Ne.isMpWeb?[2,Promise.resolve({status:2,shareType:0,numberOfUser:0})]:[2,Promise.reject(Re("openShareSheet",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),ba.apply(this,arguments)}var Ta=_e((function(){return Pe(this,(function(e){return[2,new Promise((function(e,t){tn("REQUEST_PERMISSION_CAMERA",{},{success:function(t){var n,r;(null===(n=Ce())||void 0===n||null===(r=n.platform)||void 0===r?void 0:r.isAndroid)?e({userAllow:void 0===t.error_code||(null==t?void 0:t.error_code)>=0,message:void 0===t.error_code?"User allowed":null==t?void 0:t.error_message}):e({userAllow:(null==t?void 0:t.error_code)>=0,message:null==t?void 0:t.error_message})},fail:function(n){var r,i;(null===(r=Ce())||void 0===r||null===(i=r.platform)||void 0===i?void 0:i.isAndroid)&&"number"==typeof(null==n?void 0:n.code)?e({userAllow:(null==n?void 0:n.code)>=0,message:null==n?void 0:n.message}):t(n)}},{isMultiCallback:!0})}))]}))}));function Ea(e){return Pa.apply(this,arguments)}function Pa(){return(Pa=_e((function(e){return Pe(this,(function(t){return[2,_n("requestCameraPermission",[],[e],_e((function(){return Pe(this,(function(e){switch(e.label){case 0:return[4,Ta()];case 1:return[2,e.sent()]}}))})))]}))}))).apply(this,arguments)}var Sa=function(){var e=_e((function(e,t,n){return Pe(this,(function(r){return[2,new Promise((function(r,i){tn("CREATE_SHORTCUT",{url:e,title:t,iconUrl:n},{success:function(e){r(e)},fail:function(e){i(e)}},{})}))]}))}));return function(t,n,r){return e.apply(this,arguments)}}(),Aa=_e((function(){var e,t,n,r=arguments;return Pe(this,(function(i){switch(i.label){case 0:return e=r.length>0&&void 0!==r[0]?r[0]:o,t=r.length>1&&void 0!==r[1]?r[1]:0,n=On(),[4,Wt(e,t,n.version)];case 1:return[2,i.sent()]}}))})),Oa=function(){var e=_e((function(e){return Pe(this,(function(t){return[2,new Promise((function(t,n){tn("OPEN_OUTAPP",{url:e},{success:function(){t()},fail:function(e){n(e)}},{})}))]}))}));return function(t){return e.apply(this,arguments)}}(),Ia=[ai({params:Ii.record(Vr(),Vr()).optional()}).optional()];function ka(e){return Ca.apply(this,arguments)}function Ca(){return Ca=_e((function(e){return Pe(this,(function(t){return[2,_n("createShortcut",Ia,[e],function(){var e=_e((function(e){var t,n,r,i,s,u,c,l;return Pe(this,(function(d){switch(d.label){case 0:return Ne.isMp?[4,Aa(o,0)]:[3,6];case 1:return r=d.sent(),i=null===(t=Ce())||void 0===t||null===(n=t.platform)||void 0===n?void 0:n.isIOS,s=r.logoUrl||dn("og:image:url")||"",u=r.name||document.title,(c=(null==e?void 0:e.params)?new URLSearchParams(null==e?void 0:e.params):new URLSearchParams).append("utm_source","zalo-shortcut"),c.append("utm_medium","default"),c.append("utm_campaign","default"),i?(c.append("appId",o),c.append("appName",u),c.append("appIcon",s),l="https://mini.zalo.me/shortcut.html?".concat(c.toString()),[4,Oa(encodeURI(l))]):[3,3];case 2:return d.sent(),[3,5];case 3:return[4,Sa("".concat(a,"/").concat(o,"/?").concat(c.toString()),u,s)];case 4:d.sent(),d.label=5;case 5:return[2,en.success()];case 6:return Ne.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Re("createShortcut",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Ca.apply(this,arguments)}var Na=function(){var e=_e((function(e,t,n){return Pe(this,(function(r){return[2,new Promise((function(r,o){tn("PROMPT_AUTHENTICATION",{secret_data:e,app_id:i,ui:{title:null==t?void 0:t.title,sub_title:null==t?void 0:t.subTitle,negative_text:null==t?void 0:t.negativeButtonText},require_fingerprint:n?1:0},{success:function(e){var t,n,i,o;r({code:null==e?void 0:e.error_code,message:null==e?void 0:e.error_message,data:{domain:null==e||null===(t=e.data)||void 0===t?void 0:t.domain,code:null==e||null===(n=e.data)||void 0===n?void 0:n.error_code,message:null==e||null===(i=e.data)||void 0===i?void 0:i.error_message,payToken:null==e||null===(o=e.data)||void 0===o?void 0:o.pay_token}})},fail:function(e){o(e)}},{})}))]}))}));return function(t,n,r){return e.apply(this,arguments)}}(),Ma=[ai({secretData:Vr(),ui:ai({title:Vr().default("Xác thực").optional(),subTitle:Vr().default("Sử dụng sinh trắc học của bạn để xác thực").optional(),negativeButtonText:Vr().default("Đóng").optional()}).optional(),requireFingerprint:Qr().default(!0).optional()}).optional()];function Ra(e){return xa.apply(this,arguments)}function xa(){return xa=_e((function(e){return Pe(this,(function(t){return[2,_n("openBioAuthentication",Ma,[e],function(){var e=_e((function(e){var t,n,r;return Pe(this,(function(i){switch(i.label){case 0:return Ne.isMp?(t=e.secretData,n=e.ui,r=e.requireFingerprint,[4,Na(t,n,r)]):[3,2];case 1:return[2,i.sent()];case 2:return Ne.isMpWeb?[2,Promise.resolve({code:0,message:"OK",data:{domain:"",code:0,message:"",payToken:""}})]:[2,Promise.reject(Re("openBioAuthentication",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),xa.apply(this,arguments)}var Ua=_e((function(){return Pe(this,(function(e){return[2,new Promise((function(e,t){tn("PROMPT_AUTHENTICATION_CHECK_STATE",{},{success:function(t){e(null==t?void 0:t.bio_state)},fail:function(e){t(e)}},{actionName:"action.prompt.authentication.check_state"})}))]}))}));function Da(e){return ja.apply(this,arguments)}function ja(){return(ja=_e((function(e){return Pe(this,(function(t){return[2,_n("checkStateBioAuthentication",[],[e],_e((function(){return Pe(this,(function(e){switch(e.label){case 0:return Ne.isMp?[4,Ua()]:[3,2];case 1:return[2,{bioState:e.sent()}];case 2:return Ne.isMpWeb?[2,Promise.resolve({bioState:""})]:[2,Promise.reject(Re("checkStateBioAuthentication",{}))]}}))})))]}))}))).apply(this,arguments)}var La=function(){var e=_e((function(e){return Pe(this,(function(t){return[2,new Promise((function(t,n){tn("SHOW_TOAST",{toast:e},{success:function(){t()},fail:function(e){n(e)}},{})}))]}))}));return function(t){return e.apply(this,arguments)}}(),Ba=[ai({message:Vr()}).optional()];function Za(e){return za.apply(this,arguments)}function za(){return za=_e((function(e){return Pe(this,(function(t){return[2,_n("showToast",Ba,[e],function(){var e=_e((function(e){return Pe(this,(function(t){switch(t.label){case 0:return Ne.isMp?[4,La(e.message)]:[3,2];case 1:return[2,t.sent()];case 2:return Ne.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Re("showToast",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),za.apply(this,arguments)}var Wa=_e((function(){return Pe(this,(function(e){return[2,new Promise((function(e,t){tn("HIDE_KEYBOARD",{},{success:function(){e()},fail:function(e){t(e)}},{})}))]}))}));function Fa(e){return Ga.apply(this,arguments)}function Ga(){return(Ga=_e((function(e){return Pe(this,(function(t){return[2,_n("hideKeyboard",[],[e],_e((function(){return Pe(this,(function(e){switch(e.label){case 0:return Ne.isMp?[4,Wa()]:[3,2];case 1:return[2,e.sent()];case 2:return Ne.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Re("hideKeyboard",{}))]}}))})))]}))}))).apply(this,arguments)}var Ha=function(){var e=_e((function(e){return Pe(this,(function(t){return[2,new Promise((function(t,n){tn("OPEN_PHONE",{phoneNum:e,phoneCode:e},{success:function(){t()},fail:function(e){n(e)}},{})}))]}))}));return function(t){return e.apply(this,arguments)}}(),Va=[ai({phoneNumber:Vr()})];function Ka(e){return Ja.apply(this,arguments)}function Ja(){return Ja=_e((function(e){return Pe(this,(function(t){return[2,_n("openPhone",Va,[e],function(){var e=_e((function(e){return Pe(this,(function(t){switch(t.label){case 0:return Ne.isMp?[4,Ha(e.phoneNumber)]:[3,2];case 1:return[2,t.sent()];case 2:return Ne.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Re("openPhone",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Ja.apply(this,arguments)}var qa=function(){var e=_e((function(e,t){return Pe(this,(function(n){return[2,new Promise((function(n,r){tn("OPEN_SMS",{content:t,phoneCode:e},{success:function(){n()},fail:function(e){r(e)}},{})}))]}))}));return function(t,n){return e.apply(this,arguments)}}(),Qa=[ai({content:Vr(),phoneNumber:Vr()})];function $a(e){return Ya.apply(this,arguments)}function Ya(){return Ya=_e((function(e){return Pe(this,(function(t){return[2,_n("openSMS",Qa,[e],function(){var e=_e((function(e){return Pe(this,(function(t){switch(t.label){case 0:return Ne.isMp?[4,qa(e.phoneNumber,e.content)]:[3,2];case 1:return[2,t.sent()];case 2:return Ne.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Re("openSMS",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Ya.apply(this,arguments)}var Xa=function(){var e=_e((function(e){var t,n=arguments;return Pe(this,(function(r){return t=n.length>1&&void 0!==n[1]?n[1]:"",[2,new Promise((function(n,r){tn("VIEW_MYQR",{dpn:t,uid:e,zapp:i},{success:function(){n()},fail:function(e){r(e)}},{timeout:!1})}))]}))}));return function(t){return e.apply(this,arguments)}}(),es=[ai({id:Vr(),displayName:Vr().default("").optional()})];function ts(e){return ns.apply(this,arguments)}function ns(){return ns=_e((function(e){return Pe(this,(function(t){return[2,_n("viewOAQr",es,[e],function(){var e=_e((function(e){return Pe(this,(function(t){switch(t.label){case 0:return Ne.isMp?[4,Xa(e.id,e.displayName)]:[3,2];case 1:return[2,t.sent()];case 2:return Ne.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Re("viewOAQr",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),ns.apply(this,arguments)}var rs=function(){var e=_e((function(e){return Pe(this,(function(t){return[2,new Promise((function(t,n){tn("KEEP_SCREEN",{data:{keep_screen_on:e?1:0}},{success:function(){t()},fail:function(e){n(e)}},{})}))]}))}));return function(t){return e.apply(this,arguments)}}(),is=[ai({keepScreenOn:Qr()})];function os(e){return as.apply(this,arguments)}function as(){return as=_e((function(e){return Pe(this,(function(t){return[2,_n("keepScreen",is,[e],function(){var e=_e((function(e){return Pe(this,(function(t){switch(t.label){case 0:return Ne.isMp?[4,rs(e.keepScreenOn)]:[3,2];case 1:return[2,t.sent()];case 2:return Ne.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Re("keepScreen",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),as.apply(this,arguments)}function ss(e){return us.apply(this,arguments)}function us(){return(us=_e((function(e){return Pe(this,(function(t){return[2,_n("onKeepScreen",[],[e],_e((function(){return Pe(this,(function(e){switch(e.label){case 0:return Ne.isMp?[4,rs(!0)]:[3,2];case 1:return[2,e.sent()];case 2:return Ne.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Re("onKeepScreen",{}))]}}))})))]}))}))).apply(this,arguments)}function cs(e){return ls.apply(this,arguments)}function ls(){return(ls=_e((function(e){return Pe(this,(function(t){return[2,_n("offKeepScreen",[],[e],_e((function(){return Pe(this,(function(e){switch(e.label){case 0:return Ne.isMp?[4,rs(!1)]:[3,2];case 1:return[2,e.sent()];case 2:return Ne.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Re("offKeepScreen",{}))]}}))})))]}))}))).apply(this,arguments)}var ds=function(){var e=_e((function(e,t){var n;return Pe(this,(function(r){return n={},e?n={imageBase64Data:e}:t&&(n={imageUrl:t}),[2,new Promise((function(e,t){tn("SAVE_IMAGE_GALLERY",Ue({},n),{success:function(){e()},fail:function(e){t(e)}},{})}))]}))}));return function(t,n){return e.apply(this,arguments)}}(),ps=[ai({imageBase64Data:Vr().optional(),imageUrl:Vr().url().optional()}).optional()];function fs(e){return hs.apply(this,arguments)}function hs(){return hs=_e((function(e){return Pe(this,(function(t){return[2,_n("saveImageToGallery",ps,[e],function(){var e=_e((function(e){return Pe(this,(function(t){switch(t.label){case 0:return Ne.isMp?[4,ds(e.imageBase64Data,e.imageUrl)]:[3,2];case 1:return[2,t.sent()];case 2:return Ne.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Re("saveImageToGallery",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),hs.apply(this,arguments)}var ms=function(){var e=_e((function(e){var t,n,r,i,o,a,u=arguments;return Pe(this,(function(c){switch(c.label){case 0:t=u.length>1&&void 0!==u[1]?u[1]:"/",n=u.length>2&&void 0!==u[2]?u[2]:{},c.label=1;case 1:return c.trys.push([1,3,,4]),[4,Aa(e,0)];case 2:return r=c.sent(),[3,4];case 3:return c.sent(),[3,4];case 4:i={appId:e},r&&(i.appName=r.name,i.appAvtUrl=r.logoUrl),o="".concat(s,"/").concat(e).concat(t);try{a=new URL(o),Object.entries(n).forEach((function(e){var t=De(e,2),n=t[0],r=t[1];a.searchParams.append(n,String(r))})),o=a.href}catch(e){}return[2,new Promise((function(e,t){tn("OPEN_MP",{mpUrl:o,mpInfo:i},{success:function(){e()},fail:function(e){t(e)}},{})}))]}}))}));return function(t){return e.apply(this,arguments)}}(),vs=[ai({appId:Vr(),path:Vr().optional(),params:Ii.record(Vr(),Vr()).optional()})];function ys(e){return gs.apply(this,arguments)}function gs(){return gs=_e((function(e){return Pe(this,(function(t){return[2,_n("openMiniApp",vs,[e],function(){var e=_e((function(e){return Pe(this,(function(t){switch(t.label){case 0:return Ne.isMp?[4,ms(e.appId,e.path,e.params)]:[3,2];case 1:return[2,t.sent()];case 2:return Ne.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Re("openMiniApp",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),gs.apply(this,arguments)}var _s=_e((function(){var t,n,r=arguments;return Pe(this,(function(i){return t=r.length>0&&void 0!==r[0]?r[0]:"oneShot",n=r.length>1?r[1]:void 0,[2,new Promise((function(r,i){tn("INTERACTIVE_VIBRATION",{type:e.VibrateType[t],vibrate_time:n},{success:function(){r()},fail:function(e){i(e)}},{})}))]}))})),ws=[ai({type:Ii.enum(["oneShot"]).default("oneShot"),milliseconds:Kr().optional()})];function bs(e){return Ts.apply(this,arguments)}function Ts(){return Ts=_e((function(e){return Pe(this,(function(t){return[2,_n("vibrate",ws,[e],function(){var e=_e((function(e){return Pe(this,(function(t){switch(t.label){case 0:return Ne.isMp?[4,_s(null==e?void 0:e.type,null==e?void 0:e.milliseconds)]:[3,2];case 1:return[2,t.sent()];case 2:return Ne.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Re("vibrate",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Ts.apply(this,arguments)}var Es=function(){var e=_e((function(e,t){var n,r,i,o;return Pe(this,(function(a){return n=new URL(e),r=n.href.includes("vnpay"),i=n.searchParams.get("typeInapp"),o=gt.isEmpty(t)?void 0:{modal_style:(null==t?void 0:t.style)?Gt(null==t?void 0:t.style):"bottom_sheet",left_button:(null==t?void 0:t.leftButton)?Gt(null==t?void 0:t.leftButton):"back"},!r&&gt.isEmpty(i)&&n.searchParams.set("typeInapp","1"),[2,new Promise((function(e,t){tn("OPEN_INAPP",{url:n.href,style:o},{success:function(){e()},fail:function(e){t(e)}},{})}))]}))}));return function(t,n){return e.apply(this,arguments)}}(),Ps=[ai({url:Vr(),config:ai({style:Ii.enum(["bottomSheet","normal"]).default("bottomSheet").optional(),leftButton:Ii.enum(["back","none"]).default("back").optional()}).optional()})];function Ss(e){return As.apply(this,arguments)}function As(){return As=_e((function(e){return Pe(this,(function(t){return[2,_n("openWebview",Ps,[e],function(){var e=_e((function(e){return Pe(this,(function(t){switch(t.label){case 0:return Ne.isMp?[4,Es(e.url,e.config)]:[3,2];case 1:return[2,t.sent()];case 2:return Ne.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Re("openWebview",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),As.apply(this,arguments)}function Os(){var e={},t=window.location.href;try{var n=new URL(t).searchParams.toString();n&&(e=xt.getParamsAsObject(n))}catch(e){throw new Error("Invalid URL")}return e}function Is(){return _n("getRouteParams",[],[],(function(){return Os()}))}function ks(e){return Cs.apply(this,arguments)}function Cs(){return(Cs=_e((function(e){return Pe(this,(function(t){return[2,_n("getAppInfo",[],[e],_e((function(){return Pe(this,(function(e){switch(e.label){case 0:return Ne.isMp?[4,Aa()]:[3,2];case 1:return[2,e.sent()];case 2:return Ne.isMpWeb?[2,Promise.resolve({description:"",name:"",version:"",appUrl:"",qrCodeUrl:""})]:[2,Promise.reject(Re("getAppInfo",{}))]}}))})))]}))}))).apply(this,arguments)}var Ns=function(){var e=_e((function(e){return Pe(this,(function(t){return[2,new Promise((function(t,n){tn("WEBVIEW_SET_RESULT",{result:pn(e)},{success:function(){t()},fail:function(e){n(e)}},{})}))]}))}));return function(t){return e.apply(this,arguments)}}(),Ms=[ai({data:Ii.any()})];function Rs(e){return xs.apply(this,arguments)}function xs(){return xs=_e((function(e){return Pe(this,(function(t){return[2,_n("sendDataToPreviousMiniApp",Ms,[e],function(){var e=_e((function(e){return Pe(this,(function(t){switch(t.label){case 0:return Ne.isMp?[4,Ns(e.data)]:[3,2];case 1:return[2,t.sent()];case 2:return Ne.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Re("sendDataToPreviousMiniApp",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),xs.apply(this,arguments)}var Us=_e((function(){return Pe(this,(function(e){return[2,new Promise((function(e,t){var n,r;tn("MP_GET_NUMBER",{forceUpdate:!0},{success:function(n){var r={};if(null==n?void 0:n.token)return r.token=null==n?void 0:n.token,e(r);t(en.error.clientNotSupport())},fail:function(e){t(e)}},{delay:(null===(n=Ce())||void 0===n||null===(r=n.platform)||void 0===r?void 0:r.isIOS)?400:0})}))]}))}));function Ds(e){return js.apply(this,arguments)}function js(){return(js=_e((function(e){return Pe(this,(function(t){return[2,_n("getPhoneNumber",[],[e],_e((function(){return Pe(this,(function(e){switch(e.label){case 0:return Ne.isMp?[4,Us()]:[3,2];case 1:return[2,e.sent()];case 2:return Ne.isMpWeb?[2,Promise.resolve({number:""})]:[2,Promise.reject(Re("getPhoneNumber",{}))]}}))})))]}))}))).apply(this,arguments)}var Ls=_e((function(){var e,t=arguments;return Pe(this,(function(n){return e=t.length>0&&void 0!==t[0]?t[0]:1,[2,new Promise((function(t,n){tn("MP_OPEN_PROFILE_PICKER",{maxProfile:e},{success:function(e){Array.isArray(e)?t(e.map((function(e){return e.id}))):t([])},fail:function(e){n(e)}},{isMultiCallback:!0})}))]}))})),Bs=[ai({maxProfile:Kr().min(1).max(10).optional().default(1)})];function Zs(e){return zs.apply(this,arguments)}function zs(){return zs=_e((function(e){return Pe(this,(function(t){return[2,_n("openProfilePicker",Bs,[e],function(){var e=_e((function(e){var t,n,r,i,o;return Pe(this,(function(a){switch(a.label){case 0:return Ne.isMp?[4,Ls(null==e?void 0:e.maxProfile)]:[3,8];case 1:if(!((t=a.sent()).length>0))return[3,7];a.label=2;case 2:return a.trys.push([2,6,,7]),[4,on.getAccessToken()];case 3:return r=a.sent(),[4,fetch(d.GET_LIST_USER_INFO,{method:"POST",headers:{"Content-Type":"application/json",access_token:r||""},body:JSON.stringify({fields:"id,name,picture",user_ids:t})})];case 4:return[4,a.sent().json()];case 5:if(0!==(i=a.sent()).error||!i.data)throw new Error(i.message);return n=t.map((function(e){var t,n,r,o,a,s,u,c,l,d,p;return{id:(null===(t=i.data[e])||void 0===t||null===(n=t.user_info)||void 0===n?void 0:n.user_id_by_app)||"",profile:{name:null===(r=i.data[e])||void 0===r||null===(o=r.user_info)||void 0===o?void 0:o.name,avatar:null===(a=i.data[e])||void 0===a||null===(s=a.user_info)||void 0===s||null===(u=s.picture)||void 0===u||null===(c=u.data)||void 0===c?void 0:c.url},code:0!==(null===(l=i.data[e])||void 0===l?void 0:l.error)?-1:0,message:"Get profile: ".concat(gt.isUndefined(null===(d=i.data[e])||void 0===d?void 0:d.message)?"Unknown error":null===(p=i.data[e])||void 0===p?void 0:p.message)}})),[3,7];case 6:return o=a.sent(),n=t.map((function(e){return{id:e,profile:{name:"",avatar:""},code:-1,message:"Can't get profile: ".concat(o.message)}})),[3,7];case 7:return[2,{users:n||[]}];case 8:return Ne.isMpWeb?[2,Promise.resolve({users:[]})]:[2,Promise.reject(Re("openProfilePicker",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),zs.apply(this,arguments)}var Ws=function(){var e=_e((function(e,t,n){var r;return Pe(this,(function(i){return r=t&&gt.isString(t)&&t.length>0?"wpa_wpa2":"open",[2,new Promise((function(i,o){tn("MP_JOIN_WIFI",{ssid:e,securityType:r,password:t,hiddenSsid:n},{success:function(e){i(e)},fail:function(e){o(e)}},{})}))]}))}));return function(t,n,r){return e.apply(this,arguments)}}(),Fs=[ai({SSID:Vr(),password:Vr().optional(),hiddenSSID:Qr().optional()})];function Gs(e){return Hs.apply(this,arguments)}function Hs(){return Hs=_e((function(e){return Pe(this,(function(t){return[2,_n("connectWifi",Fs,[e],function(){var e=_e((function(e){return Pe(this,(function(t){switch(t.label){case 0:return Ne.isMp?[4,Ws(e.SSID,e.password,e.hiddenSSID)]:[3,2];case 1:return[2,t.sent()];case 2:return Ne.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Re("connectWifi",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Hs.apply(this,arguments)}var Vs=function(){var t=_e((function(t,n,r,i,o,a){var s,u;return Pe(this,(function(c){return s={type:0,url:n,max_size:r||1048576},u={enable:1,aspect_ratio:"1:1"},[2,new Promise((function(n,r){tn("PICK_MEDIA",{media_type:e.MediaPickerType[t],edit_view:Ue({},u,i),silent_request:o,upload:s,max_select_items:a},{success:function(e){n(null==e?void 0:e.result_content)},fail:function(e){r(e)}},{isMultiCallback:!0})}))]}))}));return function(e,n,r,i,o,a){return t.apply(this,arguments)}}(),Ks=[ai({type:Ii.enum(["video","photo","file","zcamera","zcamera_photo","zcamera_video","zcamera_scan"]),serverUploadUrl:Vr().url(),maxItemSize:Kr().min(0).optional(),editView:ai({enable:Qr().optional(),aspectRatio:Vr().regex(/^d+:d+$/).optional()}).optional(),silentRequest:Qr().optional(),maxSelectItem:Kr().min(1).optional()})];function Js(e){return qs.apply(this,arguments)}function qs(){return qs=_e((function(e){return Pe(this,(function(t){return[2,_n("openMediaPicker",Ks,[e],function(){var e=_e((function(e){var t,n,r,i,o,a;return Pe(this,(function(s){switch(s.label){case 0:return Ne.isMp?(i={},gt.isUndefined(null===(t=e.editView)||void 0===t?void 0:t.enable)||(null===(n=e.editView)||void 0===n?void 0:n.enable)?i.enable=1:i.enable=0,i.aspect_ratio=null===(r=e.editView)||void 0===r?void 0:r.aspectRatio,o=!0===e.silentRequest?1:0,a=e.maxSelectItem,[4,Vs(e.type,e.serverUploadUrl,e.maxItemSize,i,o,a)]):[3,2];case 1:return[2,{data:s.sent()}];case 2:return Ne.isMpWeb?[2,Promise.resolve({data:""})]:[2,Promise.reject(Re("openMediaPicker",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),qs.apply(this,arguments)}var Qs=[ai({title:Vr().max(100),description:Vr().max(400).default(""),thumbnail:Vr().url().optional(),path:Vr().optional()})];function $s(e){return Ys.apply(this,arguments)}function Ys(){return Ys=_e((function(e){return Pe(this,(function(t){return[2,_n("getShareableLink",Qs,[e],function(){var e=_e((function(e){var t;return Pe(this,(function(n){switch(n.label){case 0:return[4,on.getAccessToken()];case 1:return t=n.sent(),[4,ya(window.APP_ID,t||"",e.title,e.description,e.thumbnail,e.path)];case 2:return[2,n.sent().shareableLink]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Ys.apply(this,arguments)}var Xs=function(){var e=_e((function(e){return Pe(this,(function(t){return[2,new Promise((function(t,n){tn("MP_CLOSE_LOADINGVIEW",{at:(new Date).getTime(),when:e,url:location.href},{success:function(e){t(e)},fail:function(e){n(e)}},{})}))]}))}));return function(t){return e.apply(this,arguments)}}();function eu(e){return tu.apply(this,arguments)}function tu(){return(tu=_e((function(e){return Pe(this,(function(t){return[2,_n("closeLoading",[],[e],_e((function(){return Pe(this,(function(e){switch(e.label){case 0:return Ne.isMp?[4,Xs("user action")]:[3,2];case 1:return[2,e.sent()];case 2:return Ne.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Re("closeLoading",{}))]}}))})))]}))}))).apply(this,arguments)}function nu(e){return ru.apply(this,arguments)}function ru(){return ru=_e((function(e){return Pe(this,(function(t){return[2,_n("requestUpdateZalo",[],[e],_e((function(){var e,t,n;return Pe(this,(function(r){switch(r.label){case 0:return Ne.isMp?(n=(null===(e=Ce())||void 0===e||null===(t=e.platform)||void 0===t?void 0:t.isIOS)?"https://apps.apple.com/vn/app/zalo/id579523206":"https://play.google.com/store/apps/details?id=com.zing.zalo",[4,Oa(n)]):[3,2];case 1:return[2,r.sent()];case 2:return Ne.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Re("requestUpdateZalo",{}))]}}))})))]}))})),ru.apply(this,arguments)}var iu=Nt.getInstance();iu.addListener=function(t,n,r){var i=t;return iu.addListener(e.Events[i],n,r)};var ou=[Ii.function()];function au(t){return _n("onConfirmToExit",ou,[t],(function(t){var n=t;Ne.isMp&&(iu.on(e.Events.AppClose,n,'{"handle_h5": 1}'),Ci.setNavigationBarLeftButton(void 0,2))}))}function su(){return _n("offConfirmToExit",[],[],(function(){Ne.isMp&&(iu.off(e.Events.AppClose),Ci.setNavigationBarLeftButton(void 0,0))}))}function uu(){return _n("getDeviceId",[],[],(function(){return Ne.isMp&&on.getSync(l.DEVICE_ID)||""}))}function cu(e){return lu.apply(this,arguments)}function lu(){return(lu=_e((function(e){return Pe(this,(function(t){return[2,_n("getDeviceIdAsync",[],[e],_e((function(){return Pe(this,(function(e){switch(e.label){case 0:return Ne.isMp?[4,on.jumpAndGetToken(l.DEVICE_ID)]:[3,2];case 1:return[2,e.sent()||""];case 2:return[2,Promise.resolve("")]}}))})))]}))}))).apply(this,arguments)}function du(){return _n("getContext",[],[],(function(){if(Ne.isMp){var e=on.getSync(l.CONTEXT_ID)||"";return{type:on.getSync(l.CONTEXT_TYPE)||"",id:e}}return{type:"",id:""}}))}function pu(e){return fu.apply(this,arguments)}function fu(){return(fu=_e((function(e){return Pe(this,(function(t){return[2,_n("getContextAsync",[],[e],_e((function(){var e;return Pe(this,(function(t){switch(t.label){case 0:return Ne.isMp?[4,on.jumpAndGetToken(l.CONTEXT_ID)]:[3,3];case 1:return e=t.sent()||"",[4,on.jumpAndGetToken(l.CONTEXT_TYPE)];case 2:return[2,{type:t.sent()||"",id:e}];case 3:return[2,Promise.resolve({type:"",id:""})]}}))})))]}))}))).apply(this,arguments)}function hu(e){return mu.apply(this,arguments)}function mu(){return(mu=_e((function(e){return Pe(this,(function(t){return[2,_n("getAuthCode",[],[e],_e((function(){var e,t;return Pe(this,(function(n){switch(n.label){case 0:return Ne.isMp?[4,on.jumpAndGetToken(l.ZOAUTH,!0)]:[3,4];case 1:return e=n.sent()||"",[4,on.jumpAndGetToken(l.ZOAUTH_VRF)];case 2:return t=n.sent()||"",[4,on.verifyUserAuthorized()];case 3:if(n.sent())return[2,{authCode:e,authCodeVerify:t}];throw Ft([{action:"getAuthCode",error:-104,message:"no user auth",data:{}}]),en.error.loginFailed("User Authentication Required");case 4:return[2,Promise.resolve({authCode:"",authCodeVerify:""})]}}))})))]}))}))).apply(this,arguments)}function vu(e){return yu.apply(this,arguments)}function yu(){return(yu=_e((function(e){return Pe(this,(function(t){return[2,_n("getZPIToken",[],[e],_e((function(){var e,t,n,r;return Pe(this,(function(i){switch(i.label){case 0:return Ne.isMp?[4,on.jumpAndGetToken(l.UTOKEN_ZPI)]:[3,5];case 1:return e=i.sent()||"",[4,on.jumpAndGetToken(l.GTOKEN_ZPI)];case 2:return t=i.sent()||"",[4,on.jumpAndGetToken(l.ZPP_ZPI)];case 3:return n=i.sent()||"",[4,on.jumpAndGetToken(l.ZPT_ZPI)];case 4:return r=i.sent()||"",[2,{utoken:e,gtoken:t,zpp:n,zpt:r}];case 5:return[2,Promise.resolve({utoken:"",gtoken:"",zpp:"",zpt:""})]}}))})))]}))}))).apply(this,arguments)}var gu=[Vr()];function _u(e){return _n("setAccessToken",gu,[e],(function(e){var t=e;on.setAccessToken(t)}))}var wu=[ai({url:Vr().url()})];function bu(e){return Tu.apply(this,arguments)}function Tu(){return Tu=_e((function(e){return Pe(this,(function(t){return[2,_n("openOutApp",wu,[e],function(){var e=_e((function(e){return Pe(this,(function(t){switch(t.label){case 0:return Ne.isMp?[4,Oa(e.url)]:[3,2];case 1:return[2,t.sent()];case 2:return Ne.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Re("openOutApp",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Tu.apply(this,arguments)}var Eu=[ai({count:Kr().min(1).optional().default(1),sourceType:Ii.array(Ii.enum(["album","camera"])).max(2).default(["album","camera"]).optional(),cameraType:Ii.enum(["back","front"]).default("front").optional()})];function Pu(e){return Su.apply(this,arguments)}function Su(){return Su=_e((function(e){return Pe(this,(function(t){return[2,_n("chooseImage",Eu,[e],function(){var e=_e((function(e){var t,n,r,i;return Pe(this,(function(o){return t=e.sourceType||["album","camera"],n=e.cameraType||"front",r=e.count||1,(i=document.createElement("input")).type="file",i.multiple=r>1,i.accept="image/*",i.style.display="none",1===t.length&&t.includes("camera")&&(i.accept="front"===n?"zcamera/photo-frontfacing":"zcamera/photo-backfacing",i.capture="front"===n?"user":"environment"),[2,new Promise((function(e,t){i.addEventListener("change",(function(n){var i,o=(null==n||null===(i=n.target)||void 0===i?void 0:i.files)||[];if(o.length>r)t(new Error("You are only allowed to choose a maximum of ".concat(r," images at a time")));else{var a={filePaths:[],tempFiles:[]};Array.from(o).forEach((function(e){a.filePaths.push(URL.createObjectURL(e)),a.tempFiles.push({path:URL.createObjectURL(e),size:e.size})})),e(a)}})),document.body.appendChild(i),i.click()}))]}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Su.apply(this,arguments)}var Au=_e((function(){var e,t,n=arguments;return Pe(this,(function(r){return e=n.length>0&&void 0!==n[0]&&n[0],t=n.length>1&&void 0!==n[1]?n[1]:"Cho phép Zalo truy cập vào vị trí của thiết bị này?",[2,new Promise((function(n,r){tn("GET_LOCATION",{silent_request:e,permission_description:t,forceUpdate:!0},{success:function(e){var t={};if(null==e?void 0:e.token)return t.token=null==e?void 0:e.token,n(t);r(en.error.clientNotSupport())},fail:function(e){r(e)}},{isMultiCallback:!0,timeout:!1})}))]}))}));function Ou(e){return Iu.apply(this,arguments)}function Iu(){return(Iu=_e((function(e){return Pe(this,(function(t){return[2,_n("getLocation",[],[e],_e((function(){return Pe(this,(function(e){switch(e.label){case 0:return Ne.isMp?[4,Au()]:[3,2];case 1:return[2,e.sent()];case 2:return Ne.isMpWeb?[2,Promise.resolve({longitude:"105.788026",latitude:"21.0258773",timestamp:(new Date).getTime().toString(),provider:"fused"})]:[2,Promise.reject(Re("getLocation",{}))]}}))})))]}))}))).apply(this,arguments)}var ku=[Ii.function().args(ai({data:Ii.any()})).returns(Ii.void())];function Cu(t){return _n("onCallbackData",ku,[t],(function(){!function(t){Nt.getInstance().on(e.Events.OnDataCallback,(function(e){t({data:e})}))}(t)}))}var Nu=function(){var e=_e((function(e){var t,n,r,i,a,s,u,c,l,d,p;return Pe(this,(function(f){switch(f.label){case 0:return n="",e||(e=Os()),"object"==typeof e&&((n=e.zmpOrderId||"")||(t=e.appTransID||e.orderId||e.apptransid)),"string"==typeof e&&(r=xt.getParameterByName("orderId",e),i=xt.getParameterByName("appTransID",e)||xt.getParameterByName("apptransid",e),t=r||i),a={headers:{authorization:"Bearer "}},[4,on.getAccessToken().catch((function(){throw en.error.loginRequired}))];case 1:return s=f.sent(),a.headers.authorization="Bearer ".concat(s),u=new URL(ue),c={orderId:n,transId:t||"",appId:o},u.search=new URLSearchParams(c).toString(),[4,fetch(u.toString(),a)];case 2:return[4,f.sent().json()];case 3:if(!(l=f.sent()).data)throw en.error.badRequest(l.msg);return d=l.data||{},p={err:l.err},0!==Object.keys(d).length&&d.constructor===Object&&Object.assign(p,Ue({msg:d.resultMessage},d)),[2,p]}}))}));return function(t){return e.apply(this,arguments)}}(),Mu=function(){var t=_e((function(t,n,r,i,a,s,u){var c,l,d,p,f,h,m,v,y,g,_,w,b,T,E,P,S,A,O,I,k;return Pe(this,(function(C){switch(C.label){case 0:c=o,(l=new URLSearchParams).append("amount",t.toString()),l.append("item",encodeURIComponent(JSON.stringify(n))),l.append("appId",c),r&&l.append("desc",encodeURIComponent(r)),i&&(d=i,"object"==typeof i&&(d=JSON.stringify(i)),l.append("extradata",encodeURIComponent(d))),a&&(p=a,"object"==typeof a&&(p=JSON.stringify(a)),l.append("payload",encodeURIComponent(p))),s&&("string"==typeof s?(l.append("method",s),l.append("isCustom","false")):"object"==typeof s&&(l.append("method",s.id),l.append("isCustom",JSON.stringify(s.isCustom)))),u&&l.append("mac",u),f={headers:{"Content-Type":"application/x-www-form-urlencoded",authorization:"Bearer "}},C.label=1;case 1:return C.trys.push([1,6,,7]),[4,on.getAccessToken().catch((function(){throw en.error.loginRequired}))];case 2:return m=C.sent(),f.headers.authorization="Bearer ".concat(m),[4,fetch(ae,ia(Ue({method:"POST"},f),{body:l}))];case 3:return[4,C.sent().json()];case 4:if(!(v=C.sent()).data||0!==v.err)throw en.error.badRequest(v.msg);return y=v.data.id,g=v.data.jwt,_=v.data.messageToken||"",w=window.APP_VERSION,b=window.APP_ENV,T={miniAppId:c,orderId:y},E=v.data.method,P=v.data.isCustom,g&&(T.token=g),w&&(T.version=w),b&&(T.env=b),E&&(T.method=E),P&&(T.isCustom=P),S=xt.encode(T),A=new URL("?".concat(S),"https://payment-mini.zalo.me").toString(),O=Ht(),I=((null===(h=Ce())||void 0===h?void 0:h.platformName)||"").toLowerCase(),[4,Es(A,{style:"android"===I&&O<742?"normal":"bottomSheet"}).then((function(){var t=!1;Nt.getInstance().once(e.Events.WebviewClosed,(function(){setTimeout(_e((function(){var n;return Pe(this,(function(r){switch(r.label){case 0:return t?[3,2]:[4,Nu({zmpOrderId:y})];case 1:(n=r.sent()).err>=0&&!n.isCustom&&Nt.getInstance().emit(e.Events.PaymentClose,n.err,ia(Ue({},n),{zmpOrderId:y})),r.label=2;case 2:return[2]}}))})),500)})),Nt.getInstance().once(e.Events.OpenApp,(function(){t=!0}))}))];case 5:return C.sent(),[2,{orderId:y,messageToken:_}];case 6:throw k=C.sent(),console.log("Internal error"),k;case 7:return[2]}}))}));return function(e,n,r,i,o,a,s){return t.apply(this,arguments)}}(),Ru=[ai({amount:Ii.union([Vr(),Kr()]),item:Ii.array(Ii.record(Vr(),Ii.any())),desc:Vr(),extradata:Ii.any().optional(),payload:Ii.any().optional(),method:Ii.union([Ii.string(),Ii.object({id:Ii.string(),isCustom:Ii.boolean()})]).optional(),mac:Ii.string().optional()})];function xu(e){return Uu.apply(this,arguments)}function Uu(){return Uu=_e((function(e){return Pe(this,(function(t){return[2,_n("createOrder",Ru,[e],function(){var e=_e((function(e){return Pe(this,(function(t){switch(t.label){case 0:return Ne.isMp?[4,Mu(e.amount,e.item,e.desc,e.extradata,e.payload,e.method,e.mac)]:[3,2];case 1:return[2,t.sent()];case 2:return Ne.isMpWeb?[2,Promise.resolve({orderId:"",messageToken:""})]:[2,Promise.reject(Re("createOrder",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Uu.apply(this,arguments)}var Du=_e((function(){return Pe(this,(function(e){return[2,new Promise((function(e,t){tn("MP_CONFIRM_REQUEST_PAYMENT",{},{success:function(){e()},fail:function(e){t(e)}},{})}))]}))})),ju=function(){var e=_e((function(e,t,n,r,i){var a,s,u,c,l,d,p,f,h,m,v,y;return Pe(this,(function(g){switch(g.label){case 0:a=o,(s=new URLSearchParams).append("amount",e.toString()),s.append("appId",a),t&&s.append("desc",encodeURIComponent(t)),n&&s.append("method",n),r&&s.append("transId",r),i&&s.append("mac",i),u={headers:{"Content-Type":"application/x-www-form-urlencoded",authorization:"Bearer "}},g.label=1;case 1:return g.trys.push([1,10,,11]),[4,on.getAccessToken().catch((function(){throw en.error.loginRequired}))];case 2:return l=g.sent(),u.headers.authorization="Bearer ".concat(l),console.log("_purchase"),[4,on.jumpAndGetToken()];case 3:if(g.sent(),d=null===(c=on.miniProgramConfig)||void 0===c?void 0:c.showConfirmToPayment,console.log("showConfirmToPayment",d),!d)return[3,7];g.label=4;case 4:return g.trys.push([4,6,,7]),[4,Du()];case 5:return g.sent(),[3,7];case 6:throw p=g.sent(),console.error("Failed:",p),p;case 7:return[4,fetch(ce,ia(Ue({method:"POST"},u),{body:s}))];case 8:return[4,g.sent().json()];case 9:if(!(f=g.sent()).data||0!==f.err)throw en.error.badRequest(f.msg);return h=f.data.id,m=f.data.messageToken||"",v=f.data.transId||"",[2,{orderId:h,messageToken:m,transId:v}];case 10:throw y=g.sent(),console.log("Internal error"),y;case 11:return[2]}}))}));return function(t,n,r,i,o){return e.apply(this,arguments)}}(),Lu=[ai({amount:Ii.union([Ii.string(),Ii.number()]),desc:Ii.string(),method:Ii.string(),transId:Ii.string().optional(),mac:Ii.string().optional()})];function Bu(e){return Zu.apply(this,arguments)}function Zu(){return Zu=_e((function(e){return Pe(this,(function(t){return[2,_n("purchase",Lu,[e],function(){var e=_e((function(e){return Pe(this,(function(t){switch(t.label){case 0:return Ne.isMp?[4,ju(e.amount,e.desc,e.method,null==e?void 0:e.transId,null==e?void 0:e.mac)]:[3,2];case 1:return[2,t.sent()];case 2:return Ne.isMpWeb?[2,Promise.resolve({orderId:"",messageToken:"",transId:""})]:[2,Promise.reject(Re("purchase",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Zu.apply(this,arguments)}var zu=function(){var e=_e((function(e,t){return Pe(this,(function(n){return[2,new Promise((function(n,r){var i=e&&(null==e?void 0:e.length)>0;tn("MP_SELECT_PAYMENT_METHOD",{isBinding:i,channels:e,selectedMethod:t,forceUpdate:!0},{success:function(e){console.log(e),n(e)},fail:function(e){r(e)}},{})}))]}))}));return function(t,n){return e.apply(this,arguments)}}(),Wu=[ai({channels:oi(ai({method:Vr(),subMethod:Vr().optional(),subInfo:Vr().optional()})).optional(),selectedMethod:ai({method:Vr(),subMethod:Vr().optional()}).optional()}).optional()];function Fu(e){return Gu.apply(this,arguments)}function Gu(){return Gu=_e((function(e){return Pe(this,(function(t){return[2,_n("selectPaymentMethod",Wu,[e],function(){var e=_e((function(e){var t,n;return Pe(this,(function(r){switch(r.label){case 0:return Ne.isMp?(t=e.channels,n=e.selectedMethod,[4,zu(t,n)]):[3,2];case 1:return[2,r.sent()];case 2:return Ne.isMpWeb?[2,Promise.resolve({method:""})]:[2,Promise.reject(Re("selectPaymentMethod",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Gu.apply(this,arguments)}var Hu=[ai({data:Ii.union([Vr(),Ii.record(Vr(),Vr())])})];function Vu(e){return Ku.apply(this,arguments)}function Ku(){return Ku=_e((function(e){return Pe(this,(function(t){return[2,_n("checkTransaction",Hu,[e],function(){var e=_e((function(e){return Pe(this,(function(t){switch(t.label){case 0:return Ne.isMp?[4,Nu(e.data)]:[3,2];case 1:return[2,t.sent()];case 2:return Ne.isMpWeb?[2,Promise.resolve({msg:"Success",orderId:"",resultCode:1,transTime:(new Date).getTime().toString(),createdAt:(new Date).getTime().toString(),transId:""})]:[2,Promise.reject(Re("checkTransaction",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Ku.apply(this,arguments)}var Ju=[ai({hide:Qr().default(!1).optional()}).optional()];function qu(e){return Qu.apply(this,arguments)}function Qu(){return Qu=_e((function(e){return Pe(this,(function(t){return[2,_n("setAndroidBottomNavigationBar",Ju,[e],function(){var e=_e((function(e){return Pe(this,(function(t){switch(t.label){case 0:return Ne.isMp?[4,Ci.setAndroidBottomNavigationBar(e.hide)]:[3,2];case 1:return[2,t.sent()];case 2:return Ne.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Re("setAndroidBottomNavigationBar",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Qu.apply(this,arguments)}var $u=[ai({hide:Qr().default(!1).optional()}).optional()];function Yu(e){return Xu.apply(this,arguments)}function Xu(){return Xu=_e((function(e){return Pe(this,(function(t){return[2,_n("setIOSBottomSafeArea",$u,[e],function(){var e=_e((function(e){return Pe(this,(function(t){switch(t.label){case 0:return Ne.isMp?[4,Ci.setIOSBottomSafeArea(e.hide)]:[3,2];case 1:return[2,t.sent()];case 2:return Ne.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Re("setIOSBottomSafeArea",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Xu.apply(this,arguments)}var ec=[ai({type:Ii.enum(["normal","hidden","transparent"]).default("normal").optional(),color:Ii.string().optional()}).optional()];function tc(e){return nc.apply(this,arguments)}function nc(){return nc=_e((function(e){return Pe(this,(function(t){return[2,_n("setStatusBar",ec,[e],function(){var e=_e((function(e){return Pe(this,(function(t){switch(t.label){case 0:return Ne.isMp?[4,Ci.configHeader({statusBarType:e.type,headerColor:e.color})]:[3,2];case 1:return[2,t.sent()];case 2:return Ne.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Re("setStatusBar",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),nc.apply(this,arguments)}var rc=[ai({headerTextColor:Ii.enum(["black","white"]).optional(),headerColor:Ii.string().optional(),actionBar:ai({hide:Ii.boolean().optional(),title:Ii.string().optional(),leftButton:Ii.enum(["back","none"]).optional(),textAlign:Ii.enum(["left","center"]).default("left").optional()}).optional(),statusBarType:Ii.enum(["normal","hidden","transparent"]).optional(),hideAndroidBottomNavigationBar:Ii.boolean().optional(),hideIOSSafeAreaBottom:Ii.boolean().optional()})];function ic(e){return oc.apply(this,arguments)}function oc(){return oc=_e((function(e){return Pe(this,(function(t){return[2,_n("configAppView",rc,[e],function(){var e=_e((function(e){var t,n,r,i,o,a,s;return Pe(this,(function(u){switch(u.label){case 0:return Ne.isMp?gt.isUndefined(null===(t=e.actionBar)||void 0===t?void 0:t.leftButton)?[3,2]:[4,Ci.setNavigationBarLeftButton(null===(a=e.actionBar)||void 0===a?void 0:a.leftButton)]:[3,13];case 1:u.sent(),u.label=2;case 2:return gt.isUndefined(null===(n=e.actionBar)||void 0===n?void 0:n.title)||!(null===(r=e.actionBar)||void 0===r?void 0:r.title)?[3,4]:[4,Ci.setNavigationBarTitle(null===(s=e.actionBar)||void 0===s?void 0:s.title)];case 3:u.sent(),u.label=4;case 4:return[4,Ci.configHeader({hideActionBar:null===(i=e.actionBar)||void 0===i?void 0:i.hide,statusBarType:e.statusBarType,headerTextColor:e.headerTextColor,headerColor:e.headerColor,textAlign:null===(o=e.actionBar)||void 0===o?void 0:o.textAlign})];case 5:u.sent(),u.label=6;case 6:return u.trys.push([6,11,,12]),"boolean"!=typeof e.hideAndroidBottomNavigationBar?[3,8]:[4,Ci.setAndroidBottomNavigationBar(e.hideAndroidBottomNavigationBar)];case 7:u.sent(),u.label=8;case 8:return"boolean"!=typeof e.hideIOSSafeAreaBottom?[3,10]:[4,Ci.setIOSBottomSafeArea(e.hideIOSSafeAreaBottom)];case 9:u.sent(),u.label=10;case 10:return[3,12];case 11:return u.sent(),[3,12];case 12:return[2];case 13:return Ne.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Re("configAppView",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),oc.apply(this,arguments)}var ac=function(){var t=_e((function(t,n,r,i,a,s){var u,c,l,d,p,f,h,m,v,y,g,_,w,b;return Pe(this,(function(T){switch(T.label){case 0:p=o,(f=new URLSearchParams).append("payType",n||e.IAPPayType.SUBSCRIPTION),h=e.ProrationMode.UNKNOW,r===de&&(h=e.ProrationMode.IMMEDIATE_AND_CHARGE_FULL_PRICE),r===le&&(h=e.ProrationMode.DEFERRED),f.append("utm",a||"default"),f.append("merchantTransId",s||""),f.append("prorationMode",h.toString()),f.append("appId",p),i&&f.append("method",i),m="",(null===(u=Ce())||void 0===u||null===(c=u.platform)||void 0===c?void 0:c.isIOS)?m="ios":(null===(l=Ce())||void 0===l||null===(d=l.platform)||void 0===d?void 0:d.isAndroid)&&(m="android"),f.append("os",m),f.append("productId",t),v={headers:{"Content-Type":"application/x-www-form-urlencoded",authorization:"Bearer "}},T.label=1;case 1:return T.trys.push([1,5,,6]),[4,on.getAccessToken().catch((function(){throw en.error.loginRequired}))];case 2:return y=T.sent(),v.headers.authorization="Bearer ".concat(y),[4,fetch(se,ia(Ue({method:"POST"},v),{body:f}))];case 3:return[4,T.sent().json()];case 4:if(!(g=T.sent()).data||!g.data.store||0!==g.err)throw en.error.createIAPOrderFailed(g.err);return _=g.data.store,w=g.data.orderId,[2,new Promise((function(e,t){tn("IAP_REQUESTPAYMENT",Ue({},_),{success:function(){e({orderId:w})},fail:function(e){t(e)}})}))];case 5:throw b=T.sent(),console.log("Internal error"),b;case 6:return[2]}}))}));return function(e,n,r,i,o,a){return t.apply(this,arguments)}}(),sc=[ai({productId:Vr(),payType:Ii.enum(["ONETIME","SUBSCRIPTION"]).optional(),prorationMode:Ii.enum(["DEFERRED","IMMEDIATE_AND_CHARGE_FULL_PRICE"]).default("DEFERRED").optional(),utm:Vr().optional(),method:Ii.enum(["IAP","IAP_SANDBOX"]).optional(),merchantTransId:Vr().optional()})];function uc(e){return cc.apply(this,arguments)}function cc(){return cc=_e((function(e){return Pe(this,(function(t){return[2,_n("createOrderIAP",sc,[e],function(){var e=_e((function(e){return Pe(this,(function(t){switch(t.label){case 0:return Ne.isMp?[4,ac(e.productId,e.payType,e.prorationMode,e.method,e.utm,e.merchantTransId)]:[3,2];case 1:return[2,t.sent()];case 2:return Ne.isMpWeb?[2,Promise.resolve({orderId:""})]:[2,Promise.reject(Re("createOrderIAP",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),cc.apply(this,arguments)}var lc=_e((function(){return Pe(this,(function(e){return[2,new Promise((function(e,t){tn("MA_MENU_MINIMIZE",{},{success:function(t){e(t)},fail:function(e){t(e)}},{})}))]}))}));function dc(e){return pc.apply(this,arguments)}function pc(){return(pc=_e((function(e){return Pe(this,(function(t){return[2,_n("minimizeApp",[],[e],_e((function(){return Pe(this,(function(e){switch(e.label){case 0:return Ne.isMp?[4,lc()]:[3,2];case 1:return[2,e.sent()];case 2:return Ne.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Re("minimizeApp",{}))]}}))})))]}))}))).apply(this,arguments)}var fc=_e((function(){return Pe(this,(function(e){return[2,new Promise((function(e,t){tn("MA_MENU_PERMISSION",{},{success:function(t){e(t)},fail:function(e){t(e)}},{}),e()}))]}))}));function hc(e){return mc.apply(this,arguments)}function mc(){return(mc=_e((function(e){return Pe(this,(function(t){return[2,_n("openPermissionSetting",[],[e],_e((function(){return Pe(this,(function(e){switch(e.label){case 0:return Ne.isMp?[4,fc()]:[3,2];case 1:return[2,e.sent()];case 2:return Ne.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Re("openPermissionSetting",{}))]}}))})))]}))}))).apply(this,arguments)}var vc=_e((function(){return Pe(this,(function(e){return[2,new Promise((function(e,t){tn("MP_ADD_MYFAVORITES",{timestamp:(new Date).getTime()},{success:function(t){e(t)},fail:function(e){t(e)}},{})}))]}))}));function yc(e){return gc.apply(this,arguments)}function gc(){return(gc=_e((function(e){return Pe(this,(function(t){return[2,_n("favoriteApp",[],[e],_e((function(){return Pe(this,(function(e){switch(e.label){case 0:return Ne.isMp?[4,vc()]:[3,2];case 1:return[2,e.sent()];case 2:return Ne.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Re("favoriteApp",{}))]}}))})))]}))}))).apply(this,arguments)}var _c=_e((function(){return Pe(this,(function(e){return[2,new Promise((function(e,t){tn("OPEN_GROUPLIST",{},{success:function(t){e(t)},fail:function(e){t(e)}},{})}))]}))}));function wc(e){return bc.apply(this,arguments)}function bc(){return(bc=_e((function(e){return Pe(this,(function(t){return[2,_n("openGroupList",[],[e],_e((function(){return Pe(this,(function(e){switch(e.label){case 0:return Ne.isMp?[4,_c()]:[3,2];case 1:return[2,e.sent()];case 2:return Ne.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Re("openGroupList",{}))]}}))})))]}))}))).apply(this,arguments)}var Tc=_e((function(){var e;return Pe(this,(function(t){switch(t.label){case 0:return[4,on.getAccessToken()];case 1:return e=t.sent(),[2,new Promise((function(t,n){tn("MP_SEND_NOTIFICATION",{accessToken:e},{success:function(e){t(e)},fail:function(e){n(e)}},{delay:500})}))]}}))}));function Ec(e){return Pc.apply(this,arguments)}function Pc(){return(Pc=_e((function(e){return Pe(this,(function(t){return[2,_n("requestSendNotification",[],[e],_e((function(){return Pe(this,(function(e){switch(e.label){case 0:return Ne.isMp?[4,Tc()]:[3,2];case 1:return[2,e.sent()];case 2:return Ne.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Re("requestSendNotification",{}))]}}))})))]}))}))).apply(this,arguments)}var Sc=_e((function(){return Pe(this,(function(e){return[2,new Promise((function(e,t){tn("MP_ADD_RATING",{},{success:function(t){e(t)},fail:function(e){t(e)}},{})}))]}))}));function Ac(e){return Oc.apply(this,arguments)}function Oc(){return(Oc=_e((function(e){return Pe(this,(function(t){return[2,_n("addRating",[],[e],_e((function(){return Pe(this,(function(e){switch(e.label){case 0:return Ne.isMp?[4,Sc()]:[3,2];case 1:return[2,e.sent()];case 2:return Ne.isMpWeb?[2,Promise.resolve({})]:[2,Promise.reject(Re("addRating",{}))]}}))})))]}))}))).apply(this,arguments)}var Ic,kc=(Ic=_e((function(e,t,n){var r,i;return Pe(this,(function(o){switch(o.label){case 0:return(r=new URLSearchParams).append("appId",t),r.append("accessToken",n),r.append("oaId",e),i={headers:{"Content-Type":"application/x-www-form-urlencoded"}},[4,fetch(d.CHECK_INTERACT_OA,Ue({method:"POST",body:r},i))];case 1:return[4,o.sent().json()];case 2:return[2,o.sent()]}}))})),function(e,t,n){return Ic.apply(this,arguments)}),Cc=function(){var e=_e((function(e){return Pe(this,(function(t){return[2,new Promise((function(t,n){tn("MP_INTERACT_OA",{oaId:e,forceUpdate:!0},{success:function(e){t(e)},fail:function(e){n(e)}},{})}))]}))}));return function(t){return e.apply(this,arguments)}}(),Nc=[ai({oaId:Vr()})];function Mc(e){return Rc.apply(this,arguments)}function Rc(){return Rc=_e((function(e){return Pe(this,(function(t){return[2,_n("interactOA",Nc,[e],function(){var e=_e((function(e){var t,n,r;return Pe(this,(function(i){switch(i.label){case 0:return Ne.isMp?(t=e.oaId,[4,on.getAccessToken()]):[3,5];case 1:return!(n=i.sent())||gt.isEmpty(n)?[3,3]:[4,kc(t,o,n)];case 2:if(0===(null==(r=i.sent())?void 0:r.err))return[2,Promise.resolve({})];i.label=3;case 3:return[4,Cc(t)];case 4:return[2,i.sent()];case 5:return Ne.isMpWeb?[2,Promise.resolve({})]:[2,Promise.reject(Re("interactOA",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Rc.apply(this,arguments)}var xc=[ai({oaId:Vr()})];function Uc(e){return Dc.apply(this,arguments)}function Dc(){return Dc=_e((function(e){return Pe(this,(function(t){return[2,_n("isAllowedInteractWithOA",xc,[e],function(){var e=_e((function(e){var t,n,r;return Pe(this,(function(i){switch(i.label){case 0:return Ne.isMp?(t=e.oaId,[4,on.getAccessToken()]):[3,4];case 1:return!(n=i.sent())||gt.isEmpty(n)?[3,3]:[4,kc(t,o,n)];case 2:return r=i.sent(),[2,Promise.resolve({status:0===(null==r?void 0:r.err)})];case 3:return[2,Promise.resolve({status:!1})];case 4:return Ne.isMpWeb?[2,Promise.resolve({status:!1})]:[2,Promise.reject(Re("IsAllowedInteractWithOA",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Dc.apply(this,arguments)}function jc(e){return Lc.apply(this,arguments)}function Lc(){return(Lc=_e((function(e){return Pe(this,(function(t){return[2,_n("getSetting",[],[e],_e((function(){return Pe(this,(function(e){switch(e.label){case 0:return Ne.isMp?[4,Yt()]:[3,2];case 1:return[2,e.sent()];case 2:return Ne.isMpWeb?[2,Promise.resolve({authSetting:{}})]:[2,Promise.reject(Re("getSetting",{}))]}}))})))]}))}))).apply(this,arguments)}var Bc=Ii.enum(["scope.userInfo","scope.userLocation","scope.userPhonenumber"]),Zc=[ai({scopes:Ii.array(Bc).max(2).optional()}).optional()];function zc(e){return Wc.apply(this,arguments)}function Wc(){return Wc=_e((function(e){return Pe(this,(function(t){return[2,_n("authorize",Zc,[e],function(){var e=_e((function(e){var t,n,r,i;return Pe(this,(function(o){switch(o.label){case 0:return Ne.isMp?(n=null==e?void 0:e.scopes,r=Ht(),("android"===(i=((null===(t=Ce())||void 0===t?void 0:t.platformName)||"").toLowerCase())&&r<724||"ios"===i&&r<573)&&n&&n.length>0?[2,Promise.reject(en.error.clientNotSupport())]:[4,nn(null!=n?n:void 0)]):[3,2];case 1:return[2,o.sent()];case 2:return Ne.isMpWeb?[2,Promise.resolve({})]:[2,Promise.reject(Re("authorize",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Wc.apply(this,arguments)}var Fc=_e((function(){return Pe(this,(function(e){return[2,new Promise(function(){var e=_e((function(e,t){var n;return Pe(this,(function(r){switch(r.label){case 0:return gt.isUndefined(ZaloJavaScriptInterface)||"function"!=typeof ZaloJavaScriptInterface.checkCameraPermission?[3,2]:[4,ZaloJavaScriptInterface.checkCameraPermission()];case 1:return n=r.sent(),[2,e({userAllow:"grant"===n})];case 2:return t(en.error.clientNotSupport()),[2]}}))}));return function(t,n){return e.apply(this,arguments)}}())]}))}));function Gc(e){return _n("checkZaloCameraPermission",[],[e],_e((function(){return Pe(this,(function(e){switch(e.label){case 0:return[4,Fc()];case 1:return[2,e.sent()]}}))})))}var Hc=_e((function(){return Pe(this,(function(e){return[2,new Promise(function(){var e=_e((function(e,t){var n,r,i;return Pe(this,(function(o){switch(o.label){case 0:return o.trys.push([0,2,,3]),[4,on.jumpAndGetToken()];case 1:return o.sent(),r=null===(n=on.miniProgramConfig)||void 0===n?void 0:n.userId,e(r),[3,3];case 2:return i=o.sent(),t(i),[3,3];case 3:return[2]}}))}));return function(t,n){return e.apply(this,arguments)}}())]}))}));function Vc(e){return Kc.apply(this,arguments)}function Kc(){return(Kc=_e((function(e){return Pe(this,(function(t){return[2,_n("getUserID",[],[e],_e((function(){return Pe(this,(function(e){switch(e.label){case 0:return Ne.isMp?[4,Hc()]:[3,2];case 1:return[2,e.sent()];case 2:return Ne.isMpWeb?[2,Promise.resolve(void 0)]:[2,Promise.reject(Re("getUserID",{}))]}}))})))]}))}))).apply(this,arguments)}var Jc=_e((function(){return Pe(this,(function(e){return[2,new Promise(function(){var e=_e((function(e,t){var n,r,i;return Pe(this,(function(o){switch(o.label){case 0:return o.trys.push([0,2,,3]),[4,on.jumpAndGetToken()];case 1:return o.sent(),r=null===(n=on.miniProgramConfig)||void 0===n?void 0:n.idToken,e(r),[3,3];case 2:return i=o.sent(),t(i),[3,3];case 3:return[2]}}))}));return function(t,n){return e.apply(this,arguments)}}())]}))}));function qc(e){return Qc.apply(this,arguments)}function Qc(){return(Qc=_e((function(e){return Pe(this,(function(t){return[2,_n("getIDToken",[],[e],_e((function(){return Pe(this,(function(e){switch(e.label){case 0:return Ne.isMp?[4,Jc()]:[3,2];case 1:return[2,e.sent()];case 2:return Ne.isMpWeb?[2,Promise.resolve(void 0)]:[2,Promise.reject(Re("getIDToken",{}))]}}))})))]}))}))).apply(this,arguments)}var $c={format:e.PhotoFormat.JPEG,quality:e.PhotoQuality.NORMAL,mirrored:!1,useVideoSourceSize:!1},Yc={width:1024,height:768,facingMode:e.FacingMode.FRONT,mirrored:!1,audio:!1,video:!0},Xc=function(){function t(n){var r,i,o,a,s,u=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,c=this;_t(this,t),this._videoEnabled=!0,this._audioEnabled=null,this.tick=function(){if(c.haveVideoStream()&&c._userRequestFrameCallback){var t=c.getCanvas();if(c.drawFrame(),t){var n={data:t.toDataURL(e.PhotoFormat.PNG),width:t.width,height:t.height};Nt.getInstance().emit(e.CameraEvents.OnFrameCallback,0,n),requestAnimationFrame(c.tick)}}},this._videoElement=n,this._mediaConstraints=null!=u?u:null,this._facingMode=null!==(r=null==u?void 0:u.facingMode)&&void 0!==r?r:Yc.facingMode,this._cameraList=[],this._stream=null,this._selectedDeviceId=null!==(i=null==u?void 0:u.deviceId)&&void 0!==i?i:"",this._canvasElement=null,this._ctx=null,this._hasUserMedia=!1,this._mirror=null!==(o=null==u?void 0:u.mirrored)&&void 0!==o?o:Yc.mirrored,this._userRequestFrameCallback=!1,this._audioEnabled=null!==(a=null==u?void 0:u.audio)&&void 0!==a?a:Yc.audio,this._videoEnabled=null!==(s=null==u?void 0:u.video)&&void 0!==s?s:Yc.video}var n=t.prototype;return n.on=function(t,n){Nt.getInstance().on(t,(function(e){n(e)})),t===e.CameraEvents.OnFrameCallback&&(this._userRequestFrameCallback=!0,this.tick())},n.off=function(t){Nt.getInstance().off(t),t===e.CameraEvents.OnFrameCallback&&(this._userRequestFrameCallback=!1)},n.getQualityNumber=function(e){switch(e){case"high":return.9;case"normal":default:return.6;case"low":return.2}},n.getFacingMode=function(){return this._facingMode},n.getCameraList=function(){return this._cameraList},n.getCameraCount=function(){return this._cameraList.length},n.getSelectedDeviceId=function(){return this._selectedDeviceId},n.setDeviceId=function(e){var t=this;return _e((function(){return Pe(this,(function(n){switch(n.label){case 0:return t._selectedDeviceId=e,t._hasUserMedia?[4,t.stream()]:[3,2];case 1:n.sent(),n.label=2;case 2:return[2]}}))}))()},n.getVideoInputs=function(e){var t=this;return this._cameraList=[],e.forEach((function(e){"videoinput"===e.kind&&t._cameraList.push(e)})),this._cameraList},n.updateMediaConstraints=function(e){var t=this;return _e((function(){var n,r,i,o,a,s;return Pe(this,(function(u){switch(u.label){case 0:return gt.isEmpty(e)?[2]:JSON.stringify(e)!==JSON.stringify(t._mediaConstraints)?(t._mediaConstraints=e,t._facingMode=null!==(n=null==e?void 0:e.facingMode)&&void 0!==n?n:t._facingMode,t._selectedDeviceId=null!==(r=null==e?void 0:e.deviceId)&&void 0!==r?r:t._selectedDeviceId,t._mirror=null!==(i=null==e?void 0:e.mirrored)&&void 0!==i?i:t._mirror,t._audioEnabled=null!==(o=null==e?void 0:e.audio)&&void 0!==o?o:t._audioEnabled,t._videoEnabled=null!==(a=null==e?void 0:e.video)&&void 0!==a?a:t._videoEnabled,t._selectedDeviceId=null!==(s=null==e?void 0:e.deviceId)&&void 0!==s?s:t._selectedDeviceId,t._hasUserMedia?[4,t.stream()]:[3,2]):[2];case 1:u.sent(),u.label=2;case 2:return[2]}}))}))()},n.getCurrentMediaConstraints=function(){var e=this._mediaConstraints,t={};this._videoElement.width=(null==e?void 0:e.width)||this._videoElement.width||Yc.width,this._videoElement.height=(null==e?void 0:e.height)||this._videoElement.height||Yc.height;var n=!1!==this._videoEnabled,r=!1!==this._audioEnabled;return n&&(""==this._selectedDeviceId&&null!==this._facingMode?t.facingMode=this._facingMode:t.deviceId={exact:this._selectedDeviceId},t.width={exact:this._videoElement.width},t.height={exact:this._videoElement.height}),{video:!!n&&t,audio:r}},n.selectCamera=function(){var t=!0,n=!1,r=void 0;try{for(var i,o=this._cameraList[Symbol.iterator]();!(t=(i=o.next()).done);t=!0){var a=i.value;if(this._facingMode==e.FacingMode.FRONT&&a.label.toLowerCase().includes("front")||this._facingMode==e.FacingMode.BACK&&a.label.toLowerCase().includes("back")){this._selectedDeviceId=a.deviceId;break}}}catch(e){n=!0,r=e}finally{try{t||null==o.return||o.return()}finally{if(n)throw r}}},n.flip=function(){var t=this;return _e((function(){return Pe(this,(function(n){switch(n.label){case 0:return t._facingMode=t._facingMode==e.FacingMode.FRONT?e.FacingMode.BACK:e.FacingMode.FRONT,t._videoElement.style.transform="",t.selectCamera(),t._hasUserMedia?[4,t.stream()]:[3,2];case 1:n.sent(),n.label=2;case 2:return[2]}}))}))()},n.start=function(){var t=this;return _e((function(){var n,r;return Pe(this,(function(i){return n=Nt.getInstance(),r=function(e){try{t._hasUserMedia&&t.stop()}catch(e){}},n.off(e.Events.AppPaused,r),n.on(e.Events.AppPaused,r),[2,new Promise(function(){var n=_e((function(n,r){var i;return Pe(this,(function(o){switch(o.label){case 0:return o.trys.push([0,2,,3]),[4,t.stream()];case 1:return o.sent(),Nt.getInstance().emit(e.CameraEvents.OnStartCallback,0),n(t._selectedDeviceId),[3,3];case 2:return i=o.sent(),r(i),[3,3];case 3:return[2]}}))}));return function(e,t){return n.apply(this,arguments)}}())]}))}))()},n.info=function(){var e=this;return _e((function(){return Pe(this,(function(t){return[2,new Promise((function(t,n){navigator.mediaDevices.enumerateDevices().then((function(n){e.getVideoInputs(n),t(e._cameraList)})).catch((function(e){n(e)}))}))]}))}))()},n.stream=function(){var e=this;return _e((function(){return Pe(this,(function(t){return[2,new Promise((function(t,n){try{e._stop();var r=e.getCurrentMediaConstraints();if(!1===r.video&&!r.audio)return void t(e._facingMode);navigator.mediaDevices.getUserMedia(r).then(function(){var n=_e((function(n){return Pe(this,(function(r){switch(r.label){case 0:return[4,e.info()];case 1:return r.sent(),e.selectCamera(),e.handleUserMedia(null,n),t(e._facingMode),[2]}}))}));return function(e){return n.apply(this,arguments)}}()).catch((function(t){e.handleUserMedia(t),n(t)}))}catch(e){n(e)}}))]}))}))()},n.handleUserMedia=function(t,n){var r=this;if(!t&&n){this._stream=n;try{this._videoElement&&(this._videoElement.srcObject=n,(this._facingMode==e.FacingMode.FRONT||this._mirror)&&(this._videoElement.style.transform="scale(-1,1)"),this._videoElement.onloadedmetadata=function(){r._userRequestFrameCallback&&r.tick()},this._videoElement.play().then((function(){r._hasUserMedia=!0})).catch((function(e){r._hasUserMedia=!1})))}catch(e){this._hasUserMedia=!1}}else this._hasUserMedia=!1},n.updateTrackEnable=function(t,n){var r=this;return _e((function(){return Pe(this,(function(i){switch(i.label){case 0:if(t===e.StreamType.VIDEO){if(r._videoEnabled===n)return[2];r._videoEnabled=n}else{if(r._audioEnabled===n)return[2];r._audioEnabled=n}return[4,r.stream()];case 1:return i.sent(),[2]}}))}))()},n.pause=function(e){var t=this;return _e((function(){return Pe(this,(function(n){switch(n.label){case 0:return[4,t.updateTrackEnable(e,!1)];case 1:return n.sent(),[2]}}))}))()},n.resume=function(e){var t=this;return _e((function(){return Pe(this,(function(n){switch(n.label){case 0:return[4,t.updateTrackEnable(e,!0)];case 1:return n.sent(),[2]}}))}))()},n.isUsing=function(){return this._hasUserMedia},n.stop=function(){this._stop(),Nt.getInstance().emit(e.CameraEvents.OnStopCallback,0)},n._stop=function(){t.stopMediaStream(this._stream),this._hasUserMedia=!1},n.setFacingMode=function(e){this._facingMode=e},n.setMirror=function(e){this._mirror=e,this._videoElement&&(this._videoElement.style.transform=e?"scale(-1,1)":"")},n.takePhoto=function(e){if(!this._hasUserMedia)return null;var t=e||{},n=this.getCanvas(t);if(this.drawFrame(t),n){var r=t.format||$c.format;return{data:n.toDataURL(r,this.getQualityNumber(t.quality)),width:n.width,height:n.height}}return null},n.haveVideoStream=function(){var e=this._videoElement;return e&&e.videoHeight>0&&this._hasUserMedia},n.getCanvas=function(e){var t=this._videoElement,n=e||{};if(!this.haveVideoStream())return null;if(!this._ctx){var r=t.videoWidth,i=t.videoHeight;if(!n.useVideoSourceSize){var o=r/i;i=(r=n.minScreenshotWidth||t.clientWidth)/o,n.minScreenshotHeight&&i<n.minScreenshotHeight&&(r=(i=n.minScreenshotHeight)*o)}this._canvasElement=document.createElement("canvas"),this._canvasElement.width=(null==n?void 0:n.width)||r,this._canvasElement.height=(null==n?void 0:n.height)||i,this._ctx=this._canvasElement.getContext("2d")}return this._canvasElement},n.drawFrame=function(t){var n=this._videoElement,r=t||{};if(n&&this._ctx&&this._canvasElement){var i=this._canvasElement,o=this._ctx;i.width=(null==r?void 0:r.width)||i.width,i.height=(null==r?void 0:r.height)||i.height,((null==r?void 0:r.mirrored)||this._mirror||this._facingMode===e.FacingMode.FRONT)&&(o.translate(i.width,0),o.scale(-1,1)),o.drawImage(n,0,0,i.width,i.height),((null==r?void 0:r.mirrored)||this._mirror||this._facingMode===e.FacingMode.FRONT)&&(o.scale(-1,1),o.translate(-i.width,0))}},t.stopMediaStream=function(e){e&&(e.getVideoTracks&&e.getAudioTracks?(e.getVideoTracks().map((function(t){e.removeTrack(t),t.stop()})),e.getAudioTracks().map((function(t){e.removeTrack(t),t.stop()}))):e.stop())},t}(),el=ai({play:Ii.function(),pause:Ii.function()}).refine((function(e){return"play"in e&&"pause"in e}),{message:"Invalid HTMLVideoElement"}),tl=[ai({videoElement:el,mediaConstraints:Ii.object({width:Ii.number().min(100).optional(),height:Ii.number().min(100).optional(),facingMode:Ii.string().optional(),audio:Ii.boolean().optional(),video:Ii.boolean().optional(),deviceId:Ii.string().optional(),mirrored:Ii.boolean().optional()}).nullish()}).optional()];function nl(e){return _n("createCameraContext",tl,[e],(function(e){return console.log("createCameraContext",e),new Xc(e.videoElement,e.mediaConstraints)}))}var rl=function(){function e(){var t,n;_t(this,e),this.sdkLoaded=!1,this.queue=[];var r=window.AdtimaZMA={config:{cateId:null===(t=window.zmpGlobal)||void 0===t||null===(n=t.appInfo)||void 0===n?void 0:n.cateType,appId:window.APP_ID},queue:[],load:function(e,t){r.queue=Ee(r.queue).concat([[e,t]])}}}var t=e.prototype;return t.loadSDK=function(){var e=this,t=document.createElement("script");t.src="https://adtima-static.zascdn.me/resource/js/zma/sdk.js?q=".concat(Math.floor((new Date).getTime()/864e5)),t.onload=function(){e.sdkLoaded=!0,e.processQueue()},t.onerror=function(){e.sdkLoaded=!0},document.body.appendChild(t)},t.load=function(e,t){var n;gt.isFunction(null===(n=window.AdtimaZMA)||void 0===n?void 0:n.load)&&window.AdtimaZMA.load(e,t)},t.display=function(e){var t;this.sdkLoaded?gt.isFunction(null===(t=window.AdtimaZMA)||void 0===t?void 0:t.display)&&window.AdtimaZMA.display(e):this.queue.push(this.display.bind(this,e))},t.refresh=function(e){var t;this.sdkLoaded?gt.isFunction(null===(t=window.AdtimaZMA)||void 0===t?void 0:t.refresh)&&window.AdtimaZMA.refresh(e):this.queue.push(this.refresh.bind(this,e))},t.processQueue=function(){for(;this.queue.length>0;){var e=this.queue.shift();e&&e()}},e.getInstance=function(){return e.instance||(e.instance=new e),e.instance},e}();function il(e){return ol.apply(this,arguments)}function ol(){return(ol=_e((function(e){return Pe(this,(function(t){return[2,_n("setupAd",[],[e],(function(){return rl.getInstance().loadSDK()}))]}))}))).apply(this,arguments)}var al=[ai({ids:Ii.union([Ii.string(),Ii.array(Ii.string())]),config:ai({display:Ii.boolean().optional(),onClose:Ii.function().optional()}).optional()})];function sl(e){return ul.apply(this,arguments)}function ul(){return ul=_e((function(e){return Pe(this,(function(t){return[2,_n("loadAd",al,[e],function(){var e=_e((function(e){return Pe(this,(function(t){return rl.getInstance().load(e.ids,e.config),[2]}))}));return function(t){return e.apply(this,arguments)}}())]}))})),ul.apply(this,arguments)}var cl=[ai({id:Ii.string()})];function ll(e){return dl.apply(this,arguments)}function dl(){return dl=_e((function(e){return Pe(this,(function(t){return[2,_n("displayAd",cl,[e],function(){var e=_e((function(e){return Pe(this,(function(t){return rl.getInstance().display(e.id),[2]}))}));return function(t){return e.apply(this,arguments)}}())]}))})),dl.apply(this,arguments)}var pl=[ai({id:Ii.string().optional()}).optional()];function fl(e){return hl.apply(this,arguments)}function hl(){return hl=_e((function(e){return Pe(this,(function(t){return[2,_n("refreshAd",pl,[e],function(){var e=_e((function(e){return Pe(this,(function(t){return rl.getInstance().refresh(e.id),[2]}))}));return function(t){return e.apply(this,arguments)}}())]}))})),hl.apply(this,arguments)}var ml=[ai({id:Vr(),guidingText:Vr().optional(),color:Vr().optional(),onStatusChange:Ii.function().optional()})];function vl(e){return yl.apply(this,arguments)}function yl(){return yl=_e((function(e){return Pe(this,(function(n){return[2,_n("showOAWidget",ml,[e],function(){var e=_e((function(e){var n,r,i,o,a,s,u,c;return Pe(this,(function(l){if(Ne.isMp){try{n=document.getElementById(e.id),r=e.onStatusChange,i=e.guidingText,o=e.color,a=t(e,["onStatusChange","guidingText","color"]),n&&(s=document.createElement("iframe"),u="iframeOAWidget_".concat(Date.now()),(c=new URL("https://h5.zalo.me/widgets/oa_widget.html")).searchParams.set("id",u),i&&c.searchParams.set("guidingText",i),o&&c.searchParams.set("color",o),Object.entries(a).forEach((function(e){var t=De(e,2),n=t[0],r=t[1];r&&c.searchParams.set("data-".concat(n),String(r))})),s.id=u,s.src=c.href,s.style.width="100%",s.style.height="100%",s.style.border="none",n.innerHTML=s.outerHTML,window.addEventListener("message",function(){var e=_e((function(e){var t,n,i,o,a,s,l,d;return Pe(this,(function(p){switch(p.label){case 0:return t=e.data,e.origin.startsWith("https://h5.zalo.me")?(n=document.getElementById(u),i=t.type,(o=new URL(t.href)).origin!==c.origin||o.pathname!==c.pathname||t.id!==u?[3,3]:"followOA"!==i&&"getOAInfo"!==i?[3,2]:[4,on.jumpAndGetToken()]):[3,3];case 1:return p.sent(),l=null===(a=on.miniProgramConfig)||void 0===a?void 0:a.jwt,null==n||null===(s=n.contentWindow)||void 0===s||s.postMessage({type:i,payload:{jwt:l}},"*"),[3,3];case 2:"oaInfo"===i?null==r||r(null===(d=t.payload)||void 0===d?void 0:d.followed):"openOA"===i?Qo(t.payload.id,"oa"):"heightChange"===i&&(n.style.height="".concat(t.payload,"px")),p.label=3;case 3:return[2]}}))}));return function(t){return e.apply(this,arguments)}}(),!1))}catch(e){console.log(e)}return[2,Promise.resolve()]}return Ne.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Re("openMiniApp",{}))]}))}));return function(t){return e.apply(this,arguments)}}())]}))})),yl.apply(this,arguments)}var gl=[ai({id:Vr(),type:Vr(),text:Vr(),color:Vr().optional(),disabled:Ii.boolean().optional(),onDataReceived:Ii.function().optional(),onError:Ii.function().optional()})];function _l(e){return wl.apply(this,arguments)}function wl(){return wl=_e((function(e){return Pe(this,(function(n){return[2,_n("showFunctionButtonWidget",gl,[e],function(){var e=_e((function(e){var n,r,i,o,a,s,u;return Pe(this,(function(c){if(Ne.isMp){try{n=document.getElementById(e.id),r=e.onDataReceived,i=e.onError,o=t(e,["onDataReceived","onError"]),n&&(a=document.createElement("iframe"),s="iframeFunctionButtonWidget".concat(Date.now()),(u=new URL("https://h5.zalo.me/widgets/function_button_widget.html")).searchParams.set("id",s),Object.entries(o).forEach((function(e){var t=De(e,2),n=t[0],r=t[1];r&&u.searchParams.set("data-".concat(n),String(r))})),a.id=s,a.src=u.href,a.style.width="100%",a.style.height="100%",a.style.border="none",Object.entries(o).forEach((function(e){var t=De(e,2),n=t[0],r=t[1];r&&a.setAttribute("data-".concat(n),String(r))})),n.innerHTML=a.outerHTML,window.addEventListener("message",function(){var e=_e((function(e){var t,n,a,c,l,d,p,f,h,m,v,y;return Pe(this,(function(g){switch(g.label){case 0:return t=e.data,e.origin.startsWith("https://h5.zalo.me")?(n=document.getElementById(s),a=t.type,(c=new URL(t.href)).origin!==u.origin||c.pathname!==u.pathname||t.id!==s?[3,4]:"buttonClicked"!==a?[3,3]:[4,on.jumpAndGetToken()]):[3,4];case 1:return g.sent(),f=null===(l=on.miniProgramConfig)||void 0===l?void 0:l.jwt,h=null===(d=on.miniProgramConfig)||void 0===d?void 0:d.encryptKey,[4,Tn()];case 2:return m=g.sent(),null==n||null===(p=n.contentWindow)||void 0===p||p.postMessage({type:a,payload:{jwt:f,encryptKey:h,accessToken:m}},"*"),[3,4];case 3:"onSuccess"===a?(null==(v=t.payload)?void 0:v.type)===o.type&&(null==r||r(null==v?void 0:v.data)):"onError"===a&&(null==(y=t.payload)?void 0:y.type)===o.type&&(null==i||i(null==y?void 0:y.data)),g.label=4;case 4:return[2]}}))}));return function(t){return e.apply(this,arguments)}}(),!1))}catch(e){console.log(e)}return[2,Promise.resolve()]}return Ne.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Re("openMiniApp",{}))]}))}));return function(t){return e.apply(this,arguments)}}())]}))})),wl.apply(this,arguments)}window.ZaloMiniAppSDK={getVersion:An},wn();var bl=Object.freeze({__proto__:null,get Events(){return e.Events},get EventName(){return e.Events},get CameraEvents(){return e.CameraEvents},login:wn,getAccessToken:Tn,getVersion:An,getSystemInfo:In,setNavigationBarTitle:Mi,setNavigationBarColor:Ui,setNavigationBarLeftButton:Li,setStorage:lo,getStorage:ho,getStorageInfo:vo,removeStorage:_o,clearStorage:To,getUserInfo:Ao,getNetworkType:Co,onNetworkStatusChange:Ro,startBeaconDiscovery:Do,stopBeaconDiscovery:Bo,getBeacons:Wo,closeApp:Ho,scanQRCode:Jo,openProfile:Yo,openChat:na,openPostFeed:sa,followOA:da,unfollowOA:ma,openShareSheet:wa,requestCameraPermission:Ea,createShortcut:ka,openBioAuthentication:Ra,checkStateBioAuthentication:Da,showToast:Za,hideKeyboard:Fa,openPhone:Ka,openSMS:$a,viewOAQr:ts,keepScreen:os,onKeepScreen:ss,offKeepScreen:cs,saveImageToGallery:fs,openMiniApp:ys,vibrate:bs,openWebview:Ss,getRouteParams:Is,getAppInfo:ks,sendDataToPreviousMiniApp:Rs,getPhoneNumber:Ds,openProfilePicker:Zs,connectWifi:Gs,openMediaPicker:Js,getShareableLink:$s,closeLoading:eu,requestUpdateZalo:nu,onConfirmToExit:au,offConfirmToExit:su,getDeviceId:uu,getDeviceIdAsync:cu,getContext:du,getContextAsync:pu,getAuthCode:hu,getZPIToken:vu,setAccessToken:_u,openOutApp:bu,chooseImage:Pu,getLocation:Ou,onCallbackData:Cu,createOrder:xu,purchase:Bu,selectPaymentMethod:Fu,checkTransaction:Vu,events:iu,setAndroidBottomNavigationBar:qu,setIOSBottomSafeArea:Yu,setStatusBar:tc,configAppView:ic,createOrderIAP:uc,minimizeApp:dc,openPermissionSetting:hc,favoriteApp:yc,openGroupList:wc,requestSendNotification:Ec,addRating:Ac,interactOA:Mc,interactOa:Mc,isAllowedInteractWithOA:Uc,getSetting:jc,authorize:zc,checkZaloCameraPermission:Gc,getUserID:Vc,getIDToken:qc,createCameraContext:nl,setupAd:il,loadAd:sl,displayAd:ll,refreshAd:fl,showOAWidget:vl,showFunctionButtonWidget:_l,get FacingMode(){return e.FacingMode},get PhotoFormat(){return e.PhotoFormat},get PhotoQuality(){return e.PhotoQuality},get StreamType(){return e.StreamType},ZMACameraImp:Xc}),Tl=xu,El=Vu,Pl=uc,Sl=Fu,Al=Bu,Ol=t(bl,["createOrder","checkTransaction","createOrderIAP","selectPaymentMethod","purchase"]),Il={createOrder:Tl,checkTransaction:El,createOrderIAP:Pl,selectPaymentMethod:Sl},kl={selectPaymentMethod:Sl,purchase:Al};!function(){var e,t=null===(e=Ce())||void 0===e?void 0:e.appEnv;(null==t?void 0:t.isMp)&&(window.ZaloMiniAppSDK={},Object.assign(window.ZaloMiniAppSDK,bl))}(),e.CheckoutSDK=kl,e.EventName=e.Events,e.Payment=Il,e.ZMACameraImp=Xc,e.addRating=Ac,e.authorize=zc,e.checkStateBioAuthentication=Da,e.checkTransaction=Vu,e.checkZaloCameraPermission=Gc,e.chooseImage=Pu,e.clearStorage=To,e.closeApp=Ho,e.closeLoading=eu,e.configAppView=ic,e.connectWifi=Gs,e.createCameraContext=nl,e.createOrder=xu,e.createOrderIAP=uc,e.createShortcut=ka,e.default=Ol,e.displayAd=ll,e.events=iu,e.favoriteApp=yc,e.followOA=da,e.getAccessToken=Tn,e.getAppInfo=ks,e.getAuthCode=hu,e.getBeacons=Wo,e.getContext=du,e.getContextAsync=pu,e.getDeviceId=uu,e.getDeviceIdAsync=cu,e.getIDToken=qc,e.getLocation=Ou,e.getNetworkType=Co,e.getPhoneNumber=Ds,e.getRouteParams=Is,e.getSetting=jc,e.getShareableLink=$s,e.getStorage=ho,e.getStorageInfo=vo,e.getSystemInfo=In,e.getUserID=Vc,e.getUserInfo=Ao,e.getVersion=An,e.getZPIToken=vu,e.hideKeyboard=Fa,e.interactOA=Mc,e.interactOa=Mc,e.isAllowedInteractWithOA=Uc,e.keepScreen=os,e.loadAd=sl,e.login=wn,e.minimizeApp=dc,e.offConfirmToExit=su,e.offKeepScreen=cs,e.onCallbackData=Cu,e.onConfirmToExit=au,e.onKeepScreen=ss,e.onNetworkStatusChange=Ro,e.openBioAuthentication=Ra,e.openChat=na,e.openGroupList=wc,e.openMediaPicker=Js,e.openMiniApp=ys,e.openOutApp=bu,e.openPermissionSetting=hc,e.openPhone=Ka,e.openPostFeed=sa,e.openProfile=Yo,e.openProfilePicker=Zs,e.openSMS=$a,e.openShareSheet=wa,e.openWebview=Ss,e.purchase=Bu,e.refreshAd=fl,e.removeStorage=_o,e.requestCameraPermission=Ea,e.requestSendNotification=Ec,e.requestUpdateZalo=nu,e.saveImageToGallery=fs,e.scanQRCode=Jo,e.selectPaymentMethod=Fu,e.sendDataToPreviousMiniApp=Rs,e.setAccessToken=_u,e.setAndroidBottomNavigationBar=qu,e.setIOSBottomSafeArea=Yu,e.setNavigationBarColor=Ui,e.setNavigationBarLeftButton=Li,e.setNavigationBarTitle=Mi,e.setStatusBar=tc,e.setStorage=lo,e.setupAd=il,e.showFunctionButtonWidget=_l,e.showOAWidget=vl,e.showToast=Za,e.startBeaconDiscovery=Do,e.stopBeaconDiscovery=Bo,e.unfollowOA=ma,e.vibrate=bs,e.viewOAQr=ts,Object.defineProperty(e,"__esModule",{value:!0})}));
24
+ ***************************************************************************** */}((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})),Nt="ACTION_CALLBACK";var Mt=function(t){Ot(r,t);var n=kt(r);function r(){var e;return wt(this,r),(e=n.apply(this,arguments)).debug=ft("zmp:event-emitter"),e}var i=r.prototype;return i.h5ConfirmHandleEvent=function(e,t,n){ZaloJavaScriptInterface.jsH5EventCallback(e,t,n||"")},i.on=function(t,n,i){var o=this;if(t===Nt||t===e.Events.PaymentCallback)return Pt(Et(r.prototype),"on",this).call(this,t,n,i);this.debug("register ".concat(String(t),": ").concat(i));return Pt(Et(r.prototype),"on",this).call(this,t,(function(e,r){o.h5ConfirmHandleEvent(e,t,i),n(r)}),i)},i.once=function(e,t,n){var i=this;if(e===Nt)return Pt(Et(r.prototype),"once",this).call(this,e,t,n);this.debug("register once ".concat(String(e),": ").concat(n));return Pt(Et(r.prototype),"once",this).call(this,e,(function(r,o){i.h5ConfirmHandleEvent(r,e,n),t(o)}),n)},r.getInstance=function(){return r.instance||(r.instance=new r),r.instance},r}(Ct);function Rt(e){Mt.getInstance().emit(Nt,e)}function xt(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){Rt({serialId:e,actionName:t,result:n})}},window.zaloJSV2={zalo_h5_event_handler:function(t,n,r){var i=ft("zmp:zalo_h5_event_handler");i("eventId: ".concat(t,", eventName: ").concat(n,", eventData: ").concat(r));var a=ln(r);i("stringToData",a);var s=function(t,n){try{if(t===e.Events.OpenApp){var r=n.url,i=new URL(r),a=i.pathname.split("/zapps/".concat(o))[1];return{path:"".concat(a||"/").concat(i.search)}}return n}catch(e){return n}}(n,a);Mt.getInstance().emit(n,t,s)}},window.zaloNative2JS={nativeCall:function(t,n,r){Mt.getInstance().emit(e.Events.PaymentCallback,t,n,r)}};var Ut={encode:xt,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:xt(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":pt(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":pt(r))?JSON.stringify(r):encodeURIComponent(r)].join("=");n.push(i)})),n.join("&")}},Dt={},jt=function(e,t,n){var r=t||"default";return function(){return(r in Dt?Dt[r](e,n):e).apply(this,arguments)}};jt.setWrapper=function(e){Dt[arguments.length<=1||void 0===arguments[1]?"default":arguments[1]]=e};var Lt={error:{code:1,error_subcode:1357046,message:"Received Invalid JSON reply.",type:"http"}};function Bt(e){try{return null===e?Lt:JSON.parse(e)}catch(e){return Lt}}var Zt,zt={execute:function(e,t,n,r){n.suppress_http_code=1;var i=Ut.encode(n);"post"!=t&&(e=Ut.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=jt((function(){o=r,"onload"in i&&i.onload(n)}),"entry","XMLHttpRequest:load"),a=jt((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(Bt(e.responseText))},o.onerror=function(e){e.responseText?r(Bt(e.responseText)):r({error:{code:1,error_subcode:1357045,message:"unknown error (empty response)",status:e.status,type:"http"}})},o.send(i),!0)}},Wt=zt,Ft=(Zt=we((function(e,t,n){var r,i,o,a;return Pe(this,(function(s){switch(s.label){case 0:return r={appId:e,versionStatus:t},_t.isUndefined(n)||(r.currentVersion=n),i=Ut.appendToUrl(d.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 Zt.apply(this,arguments)});function Gt(e){try{var t=e.map((function(e){return{action:e.action,error:e.error,message:e.message,data:e.data}}));Wt.execute(d.SEND_ACTION_LOG,"post",{appId:window.APP_ID,data:JSON.stringify(t)},(function(){})),window.zmpSentry&&window.zmpSentry.captureMessage("Result from native",{extra:{data:e}})}catch(e){}}var Ht=function(e){return e.replace(/[A-Z]/g,(function(e){return"_".concat(e.toLowerCase())}))},Vt=function(){var e,t,n=Number((null===(e=Ne())||void 0===e?void 0:e.zaloVersion)||""),r=((null===(t=Ne())||void 0===t?void 0:t.platformName)||"").toLowerCase();return"android"===r?n%1e4:n};function Kt(e,t){return null!=t&&"undefined"!=typeof Symbol&&t[Symbol.hasInstance]?!!t[Symbol.hasInstance](e):e instanceof t}var Jt,qt,Qt=function(){function e(t,n,r,i){wt(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}(),$t=function(e,t){return Kt(e,Qt)?function(e,t){return e.api=t,e.toJSON()}(e,t):function(e,t){return Kt(e,Error)?new Qt(D,e.message,t).toJSON():_t.isEmpty(null==e?void 0:e.message)||_t.isEmpty(null==e?void 0:e.code)?new Qt(D,V,t,e).toJSON():new Qt(e.code,e.message,t,e.detail).toJSON()}(e,t)},Yt=(Jt=we((function(e){var t;return Pe(this,(function(n){switch(n.label){case 0:return t={headers:{"Content-Type":"application/x-www-form-urlencoded",authorization:"Bearer ".concat(e)}},[4,fetch(d.GET_AUTH_SETTING,De({method:"GET"},t))];case 1:return[4,n.sent().json()];case 2:return[2,n.sent()]}}))})),function(e){return Jt.apply(this,arguments)}),Xt=we((function(){return Pe(this,(function(e){return[2,new Promise(function(){var e=we((function(e,t){var n,r,i,o;return Pe(this,(function(a){switch(a.label){case 0:return a.trys.push([0,3,,4]),[4,an.jumpAndGetToken()];case 1:return a.sent(),(r=null===(n=an.miniProgramConfig)||void 0===n?void 0:n.jwt)||t(new Qt(B,q,"getSetting")),[4,Yt(r)];case 2:return(i=a.sent())&&0===i.err?e({authSetting:i.data}):t(new Qt(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)}}())]}))})),en=function(){var t,n,r,i=Ne(),o={},a=Mt.getInstance(),s=[],u=!1;return u||(n=function(e){var t=e.serialId,n=dn(e.result),r=mn(null==n?void 0:n.action),i=_t.isEmpty(null==n?void 0:n.error_code)?0:null==n?void 0:n.error_code,a=null==n?void 0:n.error_message,u=(null==n?void 0:n.data)||n;if(r&&0===i){var c=JSON.parse(null==n?void 0:n.data);i=_t.isEmpty(null==c?void 0:c.error_code)?0:null==c?void 0:c.error_code,a=null==c?void 0:c.error_message,u=(null==c?void 0:c.data)||c}var l={error_code:i,error_message:a,data:u,action:(null==n?void 0:n.action)||e.actionName};if(t&&o[t]){var d=o[t],p=d.callback,f=d.timeout,h=d.isMultiCallback,m=d.options;!function(e,t){var n=t||{},r=n.success,i=n.fail;0===e.error_code?_t.isFunction(r)&&r(e):_t.isFunction(i)&&i(e)}(l,p),!h&&delete o[t],f&&clearTimeout(f);var v={action:null==l?void 0:l.action,error:null==l?void 0:l.error_code,message:null==l?void 0:l.error_message,data:{}};try{if("action.open.inapp"===l.action||"action.open.outapp"===l.action){var y=new URL(null==m?void 0:m.url),g="".concat(y.protocol,"//").concat(y.host).concat(y.pathname);v.data={url:g}}if("action.follow.oa"===l.action||"action.unfollow.oa"===l.action){var _=null==m?void 0:m.uid;v.data={uid:_}}if("action.open.chat"===l.action){var w=null==m?void 0:m.uId,T=null==m?void 0:m.type;v.data={uid:w,openChatType:T}}}catch(e){}s.push(v)}},Mt.getInstance().on(Nt,n),a.on(e.Events.AppPaused,(function(){if(s.length>0){var e=s;s=[],Gt(e)}})),t?clearInterval(t):t=setInterval((function(){if(s.length>0){var e=s;s=[],Gt(e)}}),5e3),u=!0),r=we((function(e,t,n,r){var a,s,u,c,l,d,p,f,h,m,v,y,g,_,w,T,b,E,S,P,A,O;return Pe(this,(function(I){switch(I.label){case 0:return s=Math.floor(1e6*Math.random()),u="".concat(e,"_").concat(s),c=_n(e),(null==r?void 0:r.actionName)&&r.actionName.length>0&&(c=null==r?void 0:r.actionName),l=(null==r?void 0:r.isMultiCallback)||!1,d=!1!==(null==r?void 0:r.timeout)&&((null==r?void 0:r.timeout)||!0),p=(null==r?void 0:r.haveCallback)||!1,f=(null==r?void 0:r.skipJump)||!1,h=(null==r?void 0:r.requireAccessToken)||!1,m=vn(c),t&&n&&(o[u]={options:t,callback:n,isMultiCallback:l},d&&p&&(o[u].timeout=setTimeout((function(){return Rt({serialId:u,result:{error_code:z,error_message:J,data:{timeout:d},action:e}}),null}),!0===d?8e3:1e3*d))),m?[4,Xt()]:[3,2];case 1:if(!1===(null==(y=I.sent())||null===(v=y.authSetting)||void 0===v?void 0:v["scope.userInfo"]))return Rt({serialId:u,result:{error_code:B,error_message:Y,data:{isMobile:null==i||null===(g=i.platform)||void 0===g?void 0:g.isMobile},action:e}}),[2];I.label=2;case 2:return _=mn(c),!(null==i||null===(a=i.platform)||void 0===a?void 0:a.isMobile)||!e||_t.isUndefined(ZaloJavaScriptInterface)||i.platform.isIOS&&!cn(e)||_&&!1===_.isSupported?(Rt({serialId:u,result:{error_code:Z,error_message:$,data:{isMobile:null==i||null===(w=i.platform)||void 0===w?void 0:w.isMobile},action:e}}),[2]):(T=un(t),f?[3,4]:[4,an.getJSAccessToken()]);case 3:return E=I.sent(),[3,5];case 4:E="",I.label=5;case 5:b=E,I.label=6;case 6:return I.trys.push([6,10,,11]),f||!h?[3,8]:[4,an.getAccessToken()];case 7:return P=I.sent(),[3,9];case 8:P="",I.label=9;case 9:return S=P,[3,11];case 10:return A=I.sent(),Rt({serialId:u,result:{error_code:null==A?void 0:A.code,error_message:null==A?void 0:A.message,action:e}}),[2];case 11:return O=i.platform.isIOS?window.onNativeMessage(u,c):'window.onNativeMessage("'.concat(u,'", "').concat(c,'")'),[2,ZaloJavaScriptInterface.jsCall(b,c,S,T,O)]}}))})),function(e,t,n,i){return r.apply(this,arguments)}}(),tn={success:function(e,t){return{code:U,message:t||H,data:e||{}}},error:{failLimit:function(){return new Qt(W,K)},badRequest:function(e){return new Qt(j,e)},loginFailed:function(e){return new Qt(B,"".concat(Q,": ").concat(e))},loginRequired:function(){return new Qt(B,q)},cannotGetShareInfo:function(){return new Qt(L,"Can not get app info to share")},createIAPOrderFailed:function(e){var t=Object.keys(ge).find((function(t){return t===e.toString()}));return new Qt(e,t||V)},clientNotSupport:function(){return new Qt(Z,$)}}},nn=(qt=function(t){var n,r,i,o,a,s=null===(n=Ne())||void 0===n?void 0:n.platformName,u=gn(t.action),c=re[u],l=(null==c?void 0:c.skipJump)||!1,d=(null==c?void 0:c.errorList)||{};if("JUMP_LOGIN"===u)return new Qt(D,"Can not get auth code: ".concat(t.error_message));if(an.jumpStatus!==e.JumpStatus.DONE&&!l)return new Qt(te.UNAUTHORIZED.code,te.UNAUTHORIZED.message);if("permission required!"===String(t.error_message).toLowerCase()||"no permission!"===String(t.error_message).toLowerCase())return new Qt(te.FORBIDDEN.code,te.FORBIDDEN.message);if(s&&(null===(r=ie[s])||void 0===r?void 0:r[t.error_code]))return new Qt(ie[s][t.error_code].code,ie[s][t.error_code].message);var p=null!==(a=null==d||null===(i=d[s])||void 0===i?void 0:i[String(t.error_code)])&&void 0!==a?a:null==d||null===(o=d.all)||void 0===o?void 0:o[t.error_code];if(p){var f,h,m,v=null===(f=p.mapTo)||void 0===f?void 0:f.message;return(null==p?void 0:p.needMoreDetail)&&(v="".concat(null==p||null===(m=p.mapTo)||void 0===m?void 0:m.message,": ").concat(t.error_message)),new Qt(null===(h=p.mapTo)||void 0===h?void 0:h.code,v)}return new Qt(t.error_code,t.error_message)},function(e,t,r,i){var o=function(e,t){function r(r){return function(i){var o=_t.isEmpty(t)?void 0:t[r];if(o)return Re({stage:n.RESPONSE,type:"log",state:r,name:e,response:i}),o("fail"===r?qt(i):null==i?void 0:i.data)}}return _t.isUndefined(e)&&(e=""),Object.assign({},{success:r("success"),fail:r("fail")})}(e,r),a=re[e],s=(null==i?void 0:i.delay)||0;setTimeout((function(){en(e,t,o,De({},i,a))}),s)}),rn=function(){var e=we((function(e){return Pe(this,(function(t){return[2,new Promise((function(t,n){nn("MP_USER_AUTHORIZE",{scopes:e,forceUpdate:!0},{success:function(e){_t.isEmpty(e)||t(e)},fail:function(e){n(e)}},{isMultiCallback:!1,timeout:!1})}))]}))}));return function(t){return e.apply(this,arguments)}}(),on=function(){function t(){wt(this,t),this._jumpStatus=void 0,this.WAITING_QUEUE=[],this.getAccessTokenCount=0,this._accessToken="",this._jsAccessToken="",this.refreshToken="",this._cookies=[],this.accessTokenExpiresIn=0,this.prevGetAccessTokenTimestamp=(new Date).getTime(),this.manualSetAccessToken=!1,this._miniProgramConfig={},this.retryLimitMap={}}var r,a,u,c=t.prototype;return c.initRetryLimit=function(e){var t=ne[e],n={lastCall:(new Date).getTime(),limit:t&&t.limit?t.limit:3,retry:0};return this.retryLimitMap[e]=n,n},c.resetRetryLimit=function(e){this.retryLimitMap[e].lastCall=(new Date).getTime(),this.retryLimitMap[e].retry=0},c.getRetryLimit=function(e){var t=this.retryLimitMap[e];return t&&t.lastCall&&t.retry||(t=this.initRetryLimit(e)),t},c.increaseRetryLimit=function(e){this.retryLimitMap[e].retry++},c.jump=function(){var t=this;return we((function(){return Pe(this,(function(r){return[2,new Promise((function(r,i){t._jumpStatus?t._jumpStatus===e.JumpStatus.DONE?r(e.JumpStatus.DONE):r(e.JumpStatus.DOING):(t._jumpStatus=e.JumpStatus.DOING,Re({stage:n.REQUEST,type:"log",name:"jump"}),en("JUMP_LOGIN",{},{success:function(n){var i=n.data;t._miniProgramConfig=(null==i?void 0:i.miniProgramConfig)||{};var o=(null==i?void 0:i.cookiesOAuthLogins)||[],a=o.find((function(e){return e.name===l.JS_TOKEN}));a&&(t._jsAccessToken=a.value,window.ZJSBridge.setJSToken&&window.ZJSBridge.setJSToken(a.value)),t._cookies=o;var s=t._cookies.find((function(e){return e.name===l.ZOAUTH}));(null==s?void 0:s.value)||Gt([{action:"action.jump.login",error:-102,message:"no zoauth",data:{}}]),r(e.JumpStatus.DONE)},fail:function(e){Gt([{action:"action.jump.login",error:-101,message:e.message||"jump error",data:{}}]),i(e)}},{skipJump:!0}))}))]}))}))()},c.loginZaloV3=function(e,t,n){var r=this;return we((function(){var i;return Pe(this,(function(o){switch(o.label){case 0:return i="".concat(d.GET_ACCESS_TOKEN_V3,"?app_id=").concat(t,"&redirect_uri=").concat(s,"/").concat(e,"/&code=").concat(n,"&isSDK=true"),[4,fetch(i).then(function(){var e=we((function(e){var t,n,i;return Pe(this,(function(o){switch(o.label){case 0:return[4,e.json()];case 1:return t=o.sent(),n=null==t?void 0:t.access_token,r._accessToken=n,i=1e3*parseInt(t.expires_in),r.accessTokenExpiresIn=i,r.prevGetAccessTokenTimestamp=(new Date).getTime(),window.ZJSBridge.setZAccSession&&window.ZJSBridge.setZAccSession(r._accessToken||""),[2,n]}}))}));return function(t){return e.apply(this,arguments)}}())];case 1:return[2,o.sent()]}}))}))()},c.loginZaloV4=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",r=this;return we((function(){var i,o;return Pe(this,(function(a){switch(a.label){case 0:return(i=new URLSearchParams).append("app_id",e),i.append("code",t),i.append("code_verifier",n),_t.isNull(r.refreshToken)||0===r.refreshToken.length?i.append("grant_type","authorization_code"):(i.append("grant_type","refresh_token"),i.append("refresh_token",r.refreshToken||"")),o={headers:{"Content-Type":"application/x-www-form-urlencoded"}},[4,fetch(d.GET_ACCESS_TOKEN,De({method:"POST",body:i},o)).then(function(){var e=we((function(e){var t,n,i,o;return Pe(this,(function(a){switch(a.label){case 0:return[4,e.json()];case 1:return t=a.sent(),n=(null==t?void 0:t.access_token)||"",i=(null==t?void 0:t.refresh_token)||"",r.refreshToken=i,r._accessToken=n,o=1e3*parseInt(null==t?void 0:t.expires_in),r.accessTokenExpiresIn=o,r.prevGetAccessTokenTimestamp=(new Date).getTime(),window.ZJSBridge.setZAccSession&&window.ZJSBridge.setZAccSession(n),[2,n]}}))}));return function(t){return e.apply(this,arguments)}}())];case 1:return[2,a.sent()]}}))}))()},c.getAccessToken=function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=this;return we((function(){var n,r,a,s,u,c,d,p,f;function h(){return m.apply(this,arguments)}function m(){return(m=we((function(){return Pe(this,(function(e){switch(e.label){case 0:return[4,new Promise((function(e){var t=setInterval((function(){(r.getAccessTokenCount<=1||r._accessToken)&&(e("done"),clearInterval(t))}),200)}))];case 1:return[2,e.sent()]}}))}))).apply(this,arguments)}return Pe(this,(function(m){switch(m.label){case 0:return n=(new Date).getTime()-t.prevGetAccessTokenTimestamp,(r=t).getAccessTokenCount++,t.getAccessTokenCount>1?[4,h()]:[3,2];case 1:m.sent(),m.label=2;case 2:return t.manualSetAccessToken?(r.getAccessTokenCount--,[2,Promise.resolve(t._accessToken)]):e?[4,t.verifyUserAuthorized()]:[3,4];case 3:return s=m.sent(),[3,5];case 4:s=!0,m.label=5;case 5:return a=s,t._accessToken.length>0&&n<t.accessTokenExpiresIn&&a?(r.getAccessTokenCount--,[2,Promise.resolve(t._accessToken)]):(t.accessToken="",[4,t.jumpAndGetToken(l.ZOAUTH)]);case 6:return u=m.sent(),[4,t.jumpAndGetToken(l.ZOAUTH_VRF)];case 7:if(c=m.sent(),d="zmp.getaccesstoken.fail",!a)throw r.getAccessTokenCount--,Gt([{action:d,error:-104,message:"no user auth",data:{}}]),tn.error.loginFailed("User Authentication Required");if(!u)return[3,15];m.label=8;case 8:return m.trys.push([8,13,,14]),c?[4,t.loginZaloV4(o,u,c)]:[3,10];case 9:return p=m.sent(),[3,12];case 10:return[4,t.loginZaloV3(o,i,u)];case 11:p=m.sent(),m.label=12;case 12:return[3,14];case 13:return f=m.sent(),p="",console.log("Can not get access token",f),Gt([{action:d,error:-103,message:String(f)||"Can not get access token",data:{}}]),[3,14];case 14:return r.getAccessTokenCount--,p?[2,Promise.resolve(t._accessToken)]:(Gt([{action:d,error:-101,message:"no accessToken",data:{}}]),[2,Promise.reject(tn.error.loginFailed("Can't get accessToken. Please try again later."))]);case 15:throw r.getAccessTokenCount--,Gt([{action:d,error:-102,message:"no oauth",data:{}}]),tn.error.loginFailed("Zalo app has not been activated")}}))}))()},c.verifyUserAuthorized=function(){var e=this;return we((function(){var t,n,r,i,o,a;return Pe(this,(function(s){switch(s.label){case 0:if(n=!0,!1!==(null===(t=e._miniProgramConfig)||void 0===t?void 0:t.userAuthorized))return[3,6];s.label=1;case 1:return s.trys.push([1,5,,6]),(r=mn("action.mp.user.authorize"))&&r.isSupported?[4,Xt()]:[3,4];case 2:return!1!==(null==(o=s.sent())||null===(i=o.authSetting)||void 0===i?void 0:i["scope.userInfo"])?[3,4]:[4,rn()];case 3:a=s.sent(),n=(null==a?void 0:a["scope.userInfo"])||!1,s.label=4;case 4:return[3,6];case 5:return s.sent(),n=!1,[3,6];case 6:return[2,n]}}))}))()},c.setAccessToken=function(e){this.manualSetAccessToken=!0,this._accessToken=e,window.ZJSBridge.setZAccSession&&window.ZJSBridge.setZAccSession(e)},c.getJSAccessToken=function(){var e=this;return we((function(){var t;return Pe(this,(function(n){switch(n.label){case 0:return e._jsAccessToken.length>0?[2,Promise.resolve(e._jsAccessToken)]:[4,e.jumpAndGetToken(l.JS_TOKEN)];case 1:return t=n.sent(),[2,Promise.resolve(t)]}}))}))()},c.getSync=function(e){var t;return null===(t=this._cookies.find((function(t){return t.name===e})))||void 0===t?void 0:t.value},c.jumpAndGetToken=function(t){var n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=this;return new Promise(function(){var i=we((function(i){var o,a,s,u;return Pe(this,(function(c){switch(c.label){case 0:return!n&&r._cookies.length>0?_t.isString(t)?(o=r._cookies.find((function(e){return e.name===t})),[2,i(null==o?void 0:o.value)]):[2,i("")]:(n&&r._jumpStatus===e.JumpStatus.DONE&&(r._jumpStatus=void 0),a={name:t,cb:function(e){return i(e)}},[4,r.jump()]);case 1:return(s=c.sent())===e.JumpStatus.DONE?(r._jumpStatus=s,r.WAITING_QUEUE.length&&(r.WAITING_QUEUE.forEach((function(e){var t=r._cookies.find((function(t){return t.name===e.name}));e.cb(null==t?void 0:t.value)})),r.WAITING_QUEUE=[]),u=r._cookies.find((function(e){return e.name===a.name})),a.cb(null==u?void 0:u.value)):r.WAITING_QUEUE.push(a),[2]}}))}));return function(e){return i.apply(this,arguments)}}())},t.getInstance=function(){return t.instance||(t.instance=new t),t.instance},r=t,(a=[{key:"jumpStatus",get:function(){return this._jumpStatus}},{key:"accessToken",set:function(e){this._accessToken=e,window.ZJSBridge.setZAccSession&&window.ZJSBridge.setZAccSession(e)}},{key:"miniProgramConfig",get:function(){return this._miniProgramConfig}}])&&Tt(r.prototype,a),u&&Tt(r,u),t}(),an=on.getInstance(),sn=ft("zmp:utils:common"),un=function(e){if(_t.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=[];for(var n=e.length,r=0;r<n;r++)t.push(un(e[r]));return"["+t.join(",")+"]"}if("object"==typeof e){for(var i in t=[],e)t.push('"'+i+'":'+un(e[i]));return"{"+t.join(",")+"}"}return e.toString()},cn=function(e){var t,n,r=re[e],i=(null===(t=Ne())||void 0===t?void 0:t.zaloVersion)||0,o="versionLive"in r&&(null==r||null===(n=r.versionLive)||void 0===n?void 0:n.iOS)||0;return!!(Array.isArray(window.ignoreCheckSupport)&&window.ignoreCheckSupport.length>0&&window.ignoreCheckSupport.includes(e))||Number(i)>=o},ln=function(e){try{if(e){sn(e);var t=e.replace(/\\/g,"").replace(/&#39;/g,"'");try{t=decodeURIComponent(atob(e))}catch(e){}return sn("formattedValue",t,JSON.parse(t),pt(JSON.parse(t))),JSON.parse(t)}return null}catch(t){return sn("parse json error:",t),e}},dn=function(e){if(_t.isObject(JSON)&&JSON.parse&&_t.isString(e)){var t=e.replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/\t/g,"\\t").replace(/\x00/g,"");return JSON.parse(t,(function(e,t){return t}))}return _t.isObject(e)?e:new Function("return "+e)()},pn=function(e){for(var t=document.getElementsByTagName("meta"),n=0;n<t.length;n++)if(t[n].getAttribute("name")===e||t[n].getAttribute("property")===e)return t[n].getAttribute("content");return""},fn=function(e){return btoa(encodeURIComponent(JSON.stringify(e)))};var hn=function(t){return"hidden"===t?e.StatusBarType.hidden:"transparent"===t?e.StatusBarType.transparent:e.StatusBarType.normal},mn=function(e){if(void 0!==e){var t=an.miniProgramConfig;return((null==t?void 0:t.dynamicApis)||[]).find((function(t){return t.action===e&&!1===t.clientHandle}))}},vn=function(e){if(void 0===e)return!1;var t=an.miniProgramConfig;return((null==t?void 0:t.requiredAuthenList)||[]).indexOf(e)>=0},yn=function(){var e=we((function(){return Pe(this,(function(e){return[2,new Promise(function(){var e=we((function(e,t){var n;return Pe(this,(function(t){switch(t.label){case 0:return t.trys.push([0,2,,3]),[4,an.jumpAndGetToken()];case 1:return t.sent(),n=an.miniProgramConfig,e(!0===(null==n?void 0:n.canUseAccessTokenByDefault)),[3,3];case 2:return t.sent(),e(!1),[3,3];case 3:return[2]}}))}));return function(t,n){return e.apply(this,arguments)}}())]}))}));return function(){return e.apply(this,arguments)}}(),gn=function(e){return e.replace("action.","").replace(/\./g,"_").toUpperCase()},_n=function(e){return"action.".concat(e.replace(/\_/g,".").toLowerCase())};function wn(e,t,n,r){var i,o;!function(e,t){if(ne[e]){var n=an.getRetryLimit(e);n.lastCall&&(new Date).getTime()-n.lastCall>1e3&&an.resetRetryLimit(e);var r=n.limit||3;if(n.retry&&n.retry>=r)throw $t(tn.error.failLimit(),e);an.increaseRetryLimit(e)}}(e);var a=Array.isArray(n)&&n.length>0&&(null===(i=n[0])||void 0===i?void 0:i.success),s=Array.isArray(n)&&n.length>0&&(null===(o=n[0])||void 0===o?void 0:o.fail);try{var u=n;t.length>0&&t.forEach((function(t,r){var i=t.safeParse(n[r]);if(!i.success){var o,a=null===(o=i.error)||void 0===o?void 0:o.issues,s=a.map((function(e,t){var n=e.path.length>0?e.path.map((function(e,t){return t>0?"[".concat(e,"]"):e})).join(""):"arg";return"Error ".concat(t+1,": Code: ").concat(e.code," ~ Path: ").concat(n," ~ Message: ").concat(e.message)})).join(" | "),c=tn.error.badRequest(s);throw c.detail=a,$t(c,e)}u.push(i.data)}));var c=r.apply(void 0,Se(u));return _t.isPromise(c)?new Promise((function(t,n){c.then((function(e){if(!_t.isNull(a)&&_t.isFunction(a))return a(e);t(c)})).catch((function(t){var r=$t(t,e);if(!_t.isNull(s)&&_t.isFunction(s))return s(r);n(r)}))})):c}catch(t){if(!_t.isNull(s)&&_t.isFunction(s))return s(t);throw $t(t,e)}}function Tn(e){return bn.apply(this,arguments)}function bn(){return(bn=we((function(e){return Pe(this,(function(t){return[2,wn("login",[],[e],we((function(){return Pe(this,(function(e){switch(e.label){case 0:return Me.isMp?[4,an.jumpAndGetToken(l.ZOAUTH)]:[3,2];case 1:return e.sent(),[2,"Success"];case 2:return Me.isMpWeb?[2,Promise.resolve("")]:[2,Promise.reject(xe("login",{}))]}}))})))]}))}))).apply(this,arguments)}function En(e){return Sn.apply(this,arguments)}function Sn(){return(Sn=we((function(e){return Pe(this,(function(t){return[2,wn("getAccessToken",[],[e],we((function(){var e;return Pe(this,(function(t){switch(t.label){case 0:return Me.isMp?[4,yn()]:[3,3];case 1:return e=!t.sent(),[4,an.getAccessToken(e)];case 2:return[2,t.sent()||""];case 3:return Me.isMpWeb?[2,Promise.resolve("")]:[2,Promise.reject(xe("getAccessToken",{}))]}}))})))]}))}))).apply(this,arguments)}var Pn,An="2.41.0";function On(){return wn("getVersion",[],[],(function(){return An}))}function In(){var e,t;return{version:pn("version-id")||"",apiVersion:An,zaloVersion:(null===(e=Ne())||void 0===e?void 0:e.zaloVersion)||"",platform:(null===(t=Ne())||void 0===t?void 0:t.platformName)||"",language:navigator.language,zaloLanguage:window.zLanguage||"vi",zaloTheme:window.zTheme||"light"}}function kn(){return wn("getSystemInfo",[],[],(function(){return In()}))}!function(e){e.assertEqual=e=>e,e.assertIs=function(e){},e.assertNever=function(e){throw new Error},e.arrayToEnum=e=>{const t={};for(const n of e)t[n]=n;return t},e.getValidEnumValues=t=>{const n=e.objectKeys(t).filter((e=>"number"!=typeof t[t[e]])),r={};for(const e of n)r[e]=t[e];return e.objectValues(r)},e.objectValues=t=>e.objectKeys(t).map((function(e){return t[e]})),e.objectKeys="function"==typeof Object.keys?e=>Object.keys(e):e=>{const t=[];for(const n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.push(n);return t},e.find=(e,t)=>{for(const n of e)if(t(n))return n},e.isInteger="function"==typeof Number.isInteger?e=>Number.isInteger(e):e=>"number"==typeof e&&isFinite(e)&&Math.floor(e)===e,e.joinValues=function(e,t=" | "){return e.map((e=>"string"==typeof e?`'${e}'`:e)).join(t)},e.jsonStringifyReplacer=(e,t)=>"bigint"==typeof t?t.toString():t}(Pn||(Pn={}));const Cn=Pn.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Nn=e=>{switch(typeof e){case"undefined":return Cn.undefined;case"string":return Cn.string;case"number":return isNaN(e)?Cn.nan:Cn.number;case"boolean":return Cn.boolean;case"function":return Cn.function;case"bigint":return Cn.bigint;case"symbol":return Cn.symbol;case"object":return Array.isArray(e)?Cn.array:null===e?Cn.null:e.then&&"function"==typeof e.then&&e.catch&&"function"==typeof e.catch?Cn.promise:"undefined"!=typeof Map&&e instanceof Map?Cn.map:"undefined"!=typeof Set&&e instanceof Set?Cn.set:"undefined"!=typeof Date&&e instanceof Date?Cn.date:Cn.object;default:return Cn.unknown}},Mn=Pn.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]);class Rn extends Error{constructor(e){super(),this.issues=[],this.addIssue=e=>{this.issues=[...this.issues,e]},this.addIssues=(e=[])=>{this.issues=[...this.issues,...e]};const t=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,t):this.__proto__=t,this.name="ZodError",this.issues=e}get errors(){return this.issues}format(e){const t=e||function(e){return e.message},n={_errors:[]},r=e=>{for(const i of e.issues)if("invalid_union"===i.code)i.unionErrors.map(r);else if("invalid_return_type"===i.code)r(i.returnTypeError);else if("invalid_arguments"===i.code)r(i.argumentsError);else if(0===i.path.length)n._errors.push(t(i));else{let e=n,r=0;for(;r<i.path.length;){const n=i.path[r];r===i.path.length-1?(e[n]=e[n]||{_errors:[]},e[n]._errors.push(t(i))):e[n]=e[n]||{_errors:[]},e=e[n],r++}}};return r(this),n}toString(){return this.message}get message(){return JSON.stringify(this.issues,Pn.jsonStringifyReplacer,2)}get isEmpty(){return 0===this.issues.length}flatten(e=(e=>e.message)){const t={},n=[];for(const r of this.issues)r.path.length>0?(t[r.path[0]]=t[r.path[0]]||[],t[r.path[0]].push(e(r))):n.push(e(r));return{formErrors:n,fieldErrors:t}}get formErrors(){return this.flatten()}}Rn.create=e=>new Rn(e);const xn=(e,t)=>{let n;switch(e.code){case Mn.invalid_type:n=e.received===Cn.undefined?"Required":`Expected ${e.expected}, received ${e.received}`;break;case Mn.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(e.expected,Pn.jsonStringifyReplacer)}`;break;case Mn.unrecognized_keys:n=`Unrecognized key(s) in object: ${Pn.joinValues(e.keys,", ")}`;break;case Mn.invalid_union:n="Invalid input";break;case Mn.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${Pn.joinValues(e.options)}`;break;case Mn.invalid_enum_value:n=`Invalid enum value. Expected ${Pn.joinValues(e.options)}, received '${e.received}'`;break;case Mn.invalid_arguments:n="Invalid function arguments";break;case Mn.invalid_return_type:n="Invalid function return type";break;case Mn.invalid_date:n="Invalid date";break;case Mn.invalid_string:"object"==typeof e.validation?"startsWith"in e.validation?n=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?n=`Invalid input: must end with "${e.validation.endsWith}"`:Pn.assertNever(e.validation):n="regex"!==e.validation?`Invalid ${e.validation}`:"Invalid";break;case Mn.too_small:n="array"===e.type?`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:"string"===e.type?`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:"number"===e.type?`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:"date"===e.type?`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(e.minimum)}`:"Invalid input";break;case Mn.too_big:n="array"===e.type?`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:"string"===e.type?`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:"number"===e.type?`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:"date"===e.type?`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(e.maximum)}`:"Invalid input";break;case Mn.custom:n="Invalid input";break;case Mn.invalid_intersection_types:n="Intersection results could not be merged";break;case Mn.not_multiple_of:n=`Number must be a multiple of ${e.multipleOf}`;break;case Mn.not_finite:n="Number must be finite";break;default:n=t.defaultError,Pn.assertNever(e)}return{message:n}};let Un=xn;function Dn(){return Un}const jn=e=>{const{data:t,path:n,errorMaps:r,issueData:i}=e,o=[...n,...i.path||[]],a={...i,path:o};let s="";const u=r.filter((e=>!!e)).slice().reverse();for(const e of u)s=e(a,{data:t,defaultError:s}).message;return{...i,path:o,message:i.message||s}};function Ln(e,t){const n=jn({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,Dn(),xn].filter((e=>!!e))});e.common.issues.push(n)}class Bn{constructor(){this.value="valid"}dirty(){"valid"===this.value&&(this.value="dirty")}abort(){"aborted"!==this.value&&(this.value="aborted")}static mergeArray(e,t){const n=[];for(const r of t){if("aborted"===r.status)return Zn;"dirty"===r.status&&e.dirty(),n.push(r.value)}return{status:e.value,value:n}}static async mergeObjectAsync(e,t){const n=[];for(const e of t)n.push({key:await e.key,value:await e.value});return Bn.mergeObjectSync(e,n)}static mergeObjectSync(e,t){const n={};for(const r of t){const{key:t,value:i}=r;if("aborted"===t.status)return Zn;if("aborted"===i.status)return Zn;"dirty"===t.status&&e.dirty(),"dirty"===i.status&&e.dirty(),(void 0!==i.value||r.alwaysSet)&&(n[t.value]=i.value)}return{status:e.value,value:n}}}const Zn=Object.freeze({status:"aborted"}),zn=e=>({status:"dirty",value:e}),Wn=e=>({status:"valid",value:e}),Fn=e=>"aborted"===e.status,Gn=e=>"dirty"===e.status,Hn=e=>"valid"===e.status,Vn=e=>"undefined"!=typeof Promise&&e instanceof Promise;var Kn;!function(e){e.errToObj=e=>"string"==typeof e?{message:e}:e||{},e.toString=e=>"string"==typeof e?e:null==e?void 0:e.message}(Kn||(Kn={}));class Jn{constructor(e,t,n,r){this.parent=e,this.data=t,this._path=n,this._key=r}get path(){return this._path.concat(this._key)}}const qn=(e,t)=>{if(Hn(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,error:new Rn(e.common.issues)}};function Qn(e){if(!e)return{};const{errorMap:t,invalid_type_error:n,required_error:r,description:i}=e;if(t&&(n||r))throw new Error('Can\'t use "invalid_type_error" or "required_error" in conjunction with custom error map.');if(t)return{errorMap:t,description:i};return{errorMap:(e,t)=>"invalid_type"!==e.code?{message:t.defaultError}:void 0===t.data?{message:null!=r?r:t.defaultError}:{message:null!=n?n:t.defaultError},description:i}}class $n{constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this)}get description(){return this._def.description}_getType(e){return Nn(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:Nn(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new Bn,ctx:{common:e.parent.common,data:e.data,parsedType:Nn(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const t=this._parse(e);if(Vn(t))throw new Error("Synchronous parse encountered promise.");return t}_parseAsync(e){const t=this._parse(e);return Promise.resolve(t)}parse(e,t){const n=this.safeParse(e,t);if(n.success)return n.data;throw n.error}safeParse(e,t){var n;const r={common:{issues:[],async:null!==(n=null==t?void 0:t.async)&&void 0!==n&&n,contextualErrorMap:null==t?void 0:t.errorMap},path:(null==t?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Nn(e)},i=this._parseSync({data:e,path:r.path,parent:r});return qn(r,i)}async parseAsync(e,t){const n=await this.safeParseAsync(e,t);if(n.success)return n.data;throw n.error}async safeParseAsync(e,t){const n={common:{issues:[],contextualErrorMap:null==t?void 0:t.errorMap,async:!0},path:(null==t?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Nn(e)},r=this._parse({data:e,path:n.path,parent:n}),i=await(Vn(r)?r:Promise.resolve(r));return qn(n,i)}refine(e,t){const n=e=>"string"==typeof t||void 0===t?{message:t}:"function"==typeof t?t(e):t;return this._refinement(((t,r)=>{const i=e(t),o=()=>r.addIssue({code:Mn.custom,...n(t)});return"undefined"!=typeof Promise&&i instanceof Promise?i.then((e=>!!e||(o(),!1))):!!i||(o(),!1)}))}refinement(e,t){return this._refinement(((n,r)=>!!e(n)||(r.addIssue("function"==typeof t?t(n,r):t),!1)))}_refinement(e){return new Ur({schema:this,typeName:Vr.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}optional(){return Dr.create(this,this._def)}nullable(){return jr.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return mr.create(this,this._def)}promise(){return xr.create(this,this._def)}or(e){return _r.create([this,e],this._def)}and(e){return Er.create(this,e,this._def)}transform(e){return new Ur({...Qn(this._def),schema:this,typeName:Vr.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const t="function"==typeof e?e:()=>e;return new Lr({...Qn(this._def),innerType:this,defaultValue:t,typeName:Vr.ZodDefault})}brand(){return new Wr({typeName:Vr.ZodBranded,type:this,...Qn(this._def)})}catch(e){const t="function"==typeof e?e:()=>e;return new Br({...Qn(this._def),innerType:this,catchValue:t,typeName:Vr.ZodCatch})}describe(e){return new(0,this.constructor)({...this._def,description:e})}pipe(e){return Fr.create(this,e)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const Yn=/^c[^\s-]{8,}$/i,Xn=/^[a-z][a-z0-9]*$/,er=/^([a-f0-9]{8}-[a-f0-9]{4}-[1-5][a-f0-9]{3}-[a-f0-9]{4}-[a-f0-9]{12}|00000000-0000-0000-0000-000000000000)$/i,tr=/^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|([^-]([a-zA-Z0-9-]*\.)+[a-zA-Z]{2,}))$/;class nr extends $n{constructor(){super(...arguments),this._regex=(e,t,n)=>this.refinement((t=>e.test(t)),{validation:t,code:Mn.invalid_string,...Kn.errToObj(n)}),this.nonempty=e=>this.min(1,Kn.errToObj(e)),this.trim=()=>new nr({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}_parse(e){this._def.coerce&&(e.data=String(e.data));if(this._getType(e)!==Cn.string){const t=this._getOrReturnCtx(e);return Ln(t,{code:Mn.invalid_type,expected:Cn.string,received:t.parsedType}),Zn}const t=new Bn;let n;for(const i of this._def.checks)if("min"===i.kind)e.data.length<i.value&&(n=this._getOrReturnCtx(e,n),Ln(n,{code:Mn.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!1,message:i.message}),t.dirty());else if("max"===i.kind)e.data.length>i.value&&(n=this._getOrReturnCtx(e,n),Ln(n,{code:Mn.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!1,message:i.message}),t.dirty());else if("length"===i.kind){const r=e.data.length>i.value,o=e.data.length<i.value;(r||o)&&(n=this._getOrReturnCtx(e,n),r?Ln(n,{code:Mn.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}):o&&Ln(n,{code:Mn.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}),t.dirty())}else if("email"===i.kind)tr.test(e.data)||(n=this._getOrReturnCtx(e,n),Ln(n,{validation:"email",code:Mn.invalid_string,message:i.message}),t.dirty());else if("uuid"===i.kind)er.test(e.data)||(n=this._getOrReturnCtx(e,n),Ln(n,{validation:"uuid",code:Mn.invalid_string,message:i.message}),t.dirty());else if("cuid"===i.kind)Yn.test(e.data)||(n=this._getOrReturnCtx(e,n),Ln(n,{validation:"cuid",code:Mn.invalid_string,message:i.message}),t.dirty());else if("cuid2"===i.kind)Xn.test(e.data)||(n=this._getOrReturnCtx(e,n),Ln(n,{validation:"cuid2",code:Mn.invalid_string,message:i.message}),t.dirty());else if("url"===i.kind)try{new URL(e.data)}catch(r){n=this._getOrReturnCtx(e,n),Ln(n,{validation:"url",code:Mn.invalid_string,message:i.message}),t.dirty()}else if("regex"===i.kind){i.regex.lastIndex=0;i.regex.test(e.data)||(n=this._getOrReturnCtx(e,n),Ln(n,{validation:"regex",code:Mn.invalid_string,message:i.message}),t.dirty())}else if("trim"===i.kind)e.data=e.data.trim();else if("startsWith"===i.kind)e.data.startsWith(i.value)||(n=this._getOrReturnCtx(e,n),Ln(n,{code:Mn.invalid_string,validation:{startsWith:i.value},message:i.message}),t.dirty());else if("endsWith"===i.kind)e.data.endsWith(i.value)||(n=this._getOrReturnCtx(e,n),Ln(n,{code:Mn.invalid_string,validation:{endsWith:i.value},message:i.message}),t.dirty());else if("datetime"===i.kind){((r=i).precision?r.offset?new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${r.precision}}(([+-]\\d{2}(:?\\d{2})?)|Z)$`):new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${r.precision}}Z$`):0===r.precision?r.offset?new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(([+-]\\d{2}(:?\\d{2})?)|Z)$"):new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}Z$"):r.offset?new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?(([+-]\\d{2}(:?\\d{2})?)|Z)$"):new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?Z$")).test(e.data)||(n=this._getOrReturnCtx(e,n),Ln(n,{code:Mn.invalid_string,validation:"datetime",message:i.message}),t.dirty())}else Pn.assertNever(i);var r;return{status:t.value,value:e.data}}_addCheck(e){return new nr({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...Kn.errToObj(e)})}url(e){return this._addCheck({kind:"url",...Kn.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...Kn.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...Kn.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...Kn.errToObj(e)})}datetime(e){var t;return"string"==typeof e?this._addCheck({kind:"datetime",precision:null,offset:!1,message:e}):this._addCheck({kind:"datetime",precision:void 0===(null==e?void 0:e.precision)?null:null==e?void 0:e.precision,offset:null!==(t=null==e?void 0:e.offset)&&void 0!==t&&t,...Kn.errToObj(null==e?void 0:e.message)})}regex(e,t){return this._addCheck({kind:"regex",regex:e,...Kn.errToObj(t)})}startsWith(e,t){return this._addCheck({kind:"startsWith",value:e,...Kn.errToObj(t)})}endsWith(e,t){return this._addCheck({kind:"endsWith",value:e,...Kn.errToObj(t)})}min(e,t){return this._addCheck({kind:"min",value:e,...Kn.errToObj(t)})}max(e,t){return this._addCheck({kind:"max",value:e,...Kn.errToObj(t)})}length(e,t){return this._addCheck({kind:"length",value:e,...Kn.errToObj(t)})}get isDatetime(){return!!this._def.checks.find((e=>"datetime"===e.kind))}get isEmail(){return!!this._def.checks.find((e=>"email"===e.kind))}get isURL(){return!!this._def.checks.find((e=>"url"===e.kind))}get isUUID(){return!!this._def.checks.find((e=>"uuid"===e.kind))}get isCUID(){return!!this._def.checks.find((e=>"cuid"===e.kind))}get isCUID2(){return!!this._def.checks.find((e=>"cuid2"===e.kind))}get minLength(){let e=null;for(const t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return e}get maxLength(){let e=null;for(const t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return e}}function rr(e,t){const n=(e.toString().split(".")[1]||"").length,r=(t.toString().split(".")[1]||"").length,i=n>r?n:r;return parseInt(e.toFixed(i).replace(".",""))%parseInt(t.toFixed(i).replace(".",""))/Math.pow(10,i)}nr.create=e=>{var t;return new nr({checks:[],typeName:Vr.ZodString,coerce:null!==(t=null==e?void 0:e.coerce)&&void 0!==t&&t,...Qn(e)})};class ir extends $n{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){this._def.coerce&&(e.data=Number(e.data));if(this._getType(e)!==Cn.number){const t=this._getOrReturnCtx(e);return Ln(t,{code:Mn.invalid_type,expected:Cn.number,received:t.parsedType}),Zn}let t;const n=new Bn;for(const r of this._def.checks)if("int"===r.kind)Pn.isInteger(e.data)||(t=this._getOrReturnCtx(e,t),Ln(t,{code:Mn.invalid_type,expected:"integer",received:"float",message:r.message}),n.dirty());else if("min"===r.kind){(r.inclusive?e.data<r.value:e.data<=r.value)&&(t=this._getOrReturnCtx(e,t),Ln(t,{code:Mn.too_small,minimum:r.value,type:"number",inclusive:r.inclusive,exact:!1,message:r.message}),n.dirty())}else if("max"===r.kind){(r.inclusive?e.data>r.value:e.data>=r.value)&&(t=this._getOrReturnCtx(e,t),Ln(t,{code:Mn.too_big,maximum:r.value,type:"number",inclusive:r.inclusive,exact:!1,message:r.message}),n.dirty())}else"multipleOf"===r.kind?0!==rr(e.data,r.value)&&(t=this._getOrReturnCtx(e,t),Ln(t,{code:Mn.not_multiple_of,multipleOf:r.value,message:r.message}),n.dirty()):"finite"===r.kind?Number.isFinite(e.data)||(t=this._getOrReturnCtx(e,t),Ln(t,{code:Mn.not_finite,message:r.message}),n.dirty()):Pn.assertNever(r);return{status:n.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,Kn.toString(t))}gt(e,t){return this.setLimit("min",e,!1,Kn.toString(t))}lte(e,t){return this.setLimit("max",e,!0,Kn.toString(t))}lt(e,t){return this.setLimit("max",e,!1,Kn.toString(t))}setLimit(e,t,n,r){return new ir({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:n,message:Kn.toString(r)}]})}_addCheck(e){return new ir({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:Kn.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:Kn.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:Kn.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:Kn.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:Kn.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:Kn.toString(t)})}finite(e){return this._addCheck({kind:"finite",message:Kn.toString(e)})}get minValue(){let e=null;for(const t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(const t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return e}get isInt(){return!!this._def.checks.find((e=>"int"===e.kind||"multipleOf"===e.kind&&Pn.isInteger(e.value)))}get isFinite(){let e=null,t=null;for(const n of this._def.checks){if("finite"===n.kind||"int"===n.kind||"multipleOf"===n.kind)return!0;"min"===n.kind?(null===t||n.value>t)&&(t=n.value):"max"===n.kind&&(null===e||n.value<e)&&(e=n.value)}return Number.isFinite(t)&&Number.isFinite(e)}}ir.create=e=>new ir({checks:[],typeName:Vr.ZodNumber,coerce:(null==e?void 0:e.coerce)||!1,...Qn(e)});class or extends $n{_parse(e){this._def.coerce&&(e.data=BigInt(e.data));if(this._getType(e)!==Cn.bigint){const t=this._getOrReturnCtx(e);return Ln(t,{code:Mn.invalid_type,expected:Cn.bigint,received:t.parsedType}),Zn}return Wn(e.data)}}or.create=e=>{var t;return new or({typeName:Vr.ZodBigInt,coerce:null!==(t=null==e?void 0:e.coerce)&&void 0!==t&&t,...Qn(e)})};class ar extends $n{_parse(e){this._def.coerce&&(e.data=Boolean(e.data));if(this._getType(e)!==Cn.boolean){const t=this._getOrReturnCtx(e);return Ln(t,{code:Mn.invalid_type,expected:Cn.boolean,received:t.parsedType}),Zn}return Wn(e.data)}}ar.create=e=>new ar({typeName:Vr.ZodBoolean,coerce:(null==e?void 0:e.coerce)||!1,...Qn(e)});class sr extends $n{_parse(e){this._def.coerce&&(e.data=new Date(e.data));if(this._getType(e)!==Cn.date){const t=this._getOrReturnCtx(e);return Ln(t,{code:Mn.invalid_type,expected:Cn.date,received:t.parsedType}),Zn}if(isNaN(e.data.getTime())){return Ln(this._getOrReturnCtx(e),{code:Mn.invalid_date}),Zn}const t=new Bn;let n;for(const r of this._def.checks)"min"===r.kind?e.data.getTime()<r.value&&(n=this._getOrReturnCtx(e,n),Ln(n,{code:Mn.too_small,message:r.message,inclusive:!0,exact:!1,minimum:r.value,type:"date"}),t.dirty()):"max"===r.kind?e.data.getTime()>r.value&&(n=this._getOrReturnCtx(e,n),Ln(n,{code:Mn.too_big,message:r.message,inclusive:!0,exact:!1,maximum:r.value,type:"date"}),t.dirty()):Pn.assertNever(r);return{status:t.value,value:new Date(e.data.getTime())}}_addCheck(e){return new sr({...this._def,checks:[...this._def.checks,e]})}min(e,t){return this._addCheck({kind:"min",value:e.getTime(),message:Kn.toString(t)})}max(e,t){return this._addCheck({kind:"max",value:e.getTime(),message:Kn.toString(t)})}get minDate(){let e=null;for(const t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return null!=e?new Date(e):null}get maxDate(){let e=null;for(const t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return null!=e?new Date(e):null}}sr.create=e=>new sr({checks:[],coerce:(null==e?void 0:e.coerce)||!1,typeName:Vr.ZodDate,...Qn(e)});class ur extends $n{_parse(e){if(this._getType(e)!==Cn.symbol){const t=this._getOrReturnCtx(e);return Ln(t,{code:Mn.invalid_type,expected:Cn.symbol,received:t.parsedType}),Zn}return Wn(e.data)}}ur.create=e=>new ur({typeName:Vr.ZodSymbol,...Qn(e)});class cr extends $n{_parse(e){if(this._getType(e)!==Cn.undefined){const t=this._getOrReturnCtx(e);return Ln(t,{code:Mn.invalid_type,expected:Cn.undefined,received:t.parsedType}),Zn}return Wn(e.data)}}cr.create=e=>new cr({typeName:Vr.ZodUndefined,...Qn(e)});class lr extends $n{_parse(e){if(this._getType(e)!==Cn.null){const t=this._getOrReturnCtx(e);return Ln(t,{code:Mn.invalid_type,expected:Cn.null,received:t.parsedType}),Zn}return Wn(e.data)}}lr.create=e=>new lr({typeName:Vr.ZodNull,...Qn(e)});class dr extends $n{constructor(){super(...arguments),this._any=!0}_parse(e){return Wn(e.data)}}dr.create=e=>new dr({typeName:Vr.ZodAny,...Qn(e)});class pr extends $n{constructor(){super(...arguments),this._unknown=!0}_parse(e){return Wn(e.data)}}pr.create=e=>new pr({typeName:Vr.ZodUnknown,...Qn(e)});class fr extends $n{_parse(e){const t=this._getOrReturnCtx(e);return Ln(t,{code:Mn.invalid_type,expected:Cn.never,received:t.parsedType}),Zn}}fr.create=e=>new fr({typeName:Vr.ZodNever,...Qn(e)});class hr extends $n{_parse(e){if(this._getType(e)!==Cn.undefined){const t=this._getOrReturnCtx(e);return Ln(t,{code:Mn.invalid_type,expected:Cn.void,received:t.parsedType}),Zn}return Wn(e.data)}}hr.create=e=>new hr({typeName:Vr.ZodVoid,...Qn(e)});class mr extends $n{_parse(e){const{ctx:t,status:n}=this._processInputParams(e),r=this._def;if(t.parsedType!==Cn.array)return Ln(t,{code:Mn.invalid_type,expected:Cn.array,received:t.parsedType}),Zn;if(null!==r.exactLength){const e=t.data.length>r.exactLength.value,i=t.data.length<r.exactLength.value;(e||i)&&(Ln(t,{code:e?Mn.too_big:Mn.too_small,minimum:i?r.exactLength.value:void 0,maximum:e?r.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:r.exactLength.message}),n.dirty())}if(null!==r.minLength&&t.data.length<r.minLength.value&&(Ln(t,{code:Mn.too_small,minimum:r.minLength.value,type:"array",inclusive:!0,exact:!1,message:r.minLength.message}),n.dirty()),null!==r.maxLength&&t.data.length>r.maxLength.value&&(Ln(t,{code:Mn.too_big,maximum:r.maxLength.value,type:"array",inclusive:!0,exact:!1,message:r.maxLength.message}),n.dirty()),t.common.async)return Promise.all([...t.data].map(((e,n)=>r.type._parseAsync(new Jn(t,e,t.path,n))))).then((e=>Bn.mergeArray(n,e)));const i=[...t.data].map(((e,n)=>r.type._parseSync(new Jn(t,e,t.path,n))));return Bn.mergeArray(n,i)}get element(){return this._def.type}min(e,t){return new mr({...this._def,minLength:{value:e,message:Kn.toString(t)}})}max(e,t){return new mr({...this._def,maxLength:{value:e,message:Kn.toString(t)}})}length(e,t){return new mr({...this._def,exactLength:{value:e,message:Kn.toString(t)}})}nonempty(e){return this.min(1,e)}}var vr;function yr(e){if(e instanceof gr){const t={};for(const n in e.shape){const r=e.shape[n];t[n]=Dr.create(yr(r))}return new gr({...e._def,shape:()=>t})}return e instanceof mr?mr.create(yr(e.element)):e instanceof Dr?Dr.create(yr(e.unwrap())):e instanceof jr?jr.create(yr(e.unwrap())):e instanceof Sr?Sr.create(e.items.map((e=>yr(e)))):e}mr.create=(e,t)=>new mr({type:e,minLength:null,maxLength:null,exactLength:null,typeName:Vr.ZodArray,...Qn(t)}),function(e){e.mergeShapes=(e,t)=>({...e,...t})}(vr||(vr={}));class gr extends $n{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(null!==this._cached)return this._cached;const e=this._def.shape(),t=Pn.objectKeys(e);return this._cached={shape:e,keys:t}}_parse(e){if(this._getType(e)!==Cn.object){const t=this._getOrReturnCtx(e);return Ln(t,{code:Mn.invalid_type,expected:Cn.object,received:t.parsedType}),Zn}const{status:t,ctx:n}=this._processInputParams(e),{shape:r,keys:i}=this._getCached(),o=[];if(!(this._def.catchall instanceof fr&&"strip"===this._def.unknownKeys))for(const e in n.data)i.includes(e)||o.push(e);const a=[];for(const e of i){const t=r[e],i=n.data[e];a.push({key:{status:"valid",value:e},value:t._parse(new Jn(n,i,n.path,e)),alwaysSet:e in n.data})}if(this._def.catchall instanceof fr){const e=this._def.unknownKeys;if("passthrough"===e)for(const e of o)a.push({key:{status:"valid",value:e},value:{status:"valid",value:n.data[e]}});else if("strict"===e)o.length>0&&(Ln(n,{code:Mn.unrecognized_keys,keys:o}),t.dirty());else if("strip"!==e)throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const e=this._def.catchall;for(const t of o){const r=n.data[t];a.push({key:{status:"valid",value:t},value:e._parse(new Jn(n,r,n.path,t)),alwaysSet:t in n.data})}}return n.common.async?Promise.resolve().then((async()=>{const e=[];for(const t of a){const n=await t.key;e.push({key:n,value:await t.value,alwaysSet:t.alwaysSet})}return e})).then((e=>Bn.mergeObjectSync(t,e))):Bn.mergeObjectSync(t,a)}get shape(){return this._def.shape()}strict(e){return Kn.errToObj,new gr({...this._def,unknownKeys:"strict",...void 0!==e?{errorMap:(t,n)=>{var r,i,o,a;const s=null!==(o=null===(i=(r=this._def).errorMap)||void 0===i?void 0:i.call(r,t,n).message)&&void 0!==o?o:n.defaultError;return"unrecognized_keys"===t.code?{message:null!==(a=Kn.errToObj(e).message)&&void 0!==a?a:s}:{message:s}}}:{}})}strip(){return new gr({...this._def,unknownKeys:"strip"})}passthrough(){return new gr({...this._def,unknownKeys:"passthrough"})}extend(e){return new gr({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new gr({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>vr.mergeShapes(this._def.shape(),e._def.shape()),typeName:Vr.ZodObject})}setKey(e,t){return this.augment({[e]:t})}catchall(e){return new gr({...this._def,catchall:e})}pick(e){const t={};return Pn.objectKeys(e).forEach((n=>{e[n]&&this.shape[n]&&(t[n]=this.shape[n])})),new gr({...this._def,shape:()=>t})}omit(e){const t={};return Pn.objectKeys(this.shape).forEach((n=>{e[n]||(t[n]=this.shape[n])})),new gr({...this._def,shape:()=>t})}deepPartial(){return yr(this)}partial(e){const t={};return Pn.objectKeys(this.shape).forEach((n=>{const r=this.shape[n];e&&!e[n]?t[n]=r:t[n]=r.optional()})),new gr({...this._def,shape:()=>t})}required(e){const t={};return Pn.objectKeys(this.shape).forEach((n=>{if(e&&!e[n])t[n]=this.shape[n];else{let e=this.shape[n];for(;e instanceof Dr;)e=e._def.innerType;t[n]=e}})),new gr({...this._def,shape:()=>t})}keyof(){return Nr(Pn.objectKeys(this.shape))}}gr.create=(e,t)=>new gr({shape:()=>e,unknownKeys:"strip",catchall:fr.create(),typeName:Vr.ZodObject,...Qn(t)}),gr.strictCreate=(e,t)=>new gr({shape:()=>e,unknownKeys:"strict",catchall:fr.create(),typeName:Vr.ZodObject,...Qn(t)}),gr.lazycreate=(e,t)=>new gr({shape:e,unknownKeys:"strip",catchall:fr.create(),typeName:Vr.ZodObject,...Qn(t)});class _r extends $n{_parse(e){const{ctx:t}=this._processInputParams(e),n=this._def.options;if(t.common.async)return Promise.all(n.map((async e=>{const n={...t,common:{...t.common,issues:[]},parent:null};return{result:await e._parseAsync({data:t.data,path:t.path,parent:n}),ctx:n}}))).then((function(e){for(const t of e)if("valid"===t.result.status)return t.result;for(const n of e)if("dirty"===n.result.status)return t.common.issues.push(...n.ctx.common.issues),n.result;const n=e.map((e=>new Rn(e.ctx.common.issues)));return Ln(t,{code:Mn.invalid_union,unionErrors:n}),Zn}));{let e;const r=[];for(const i of n){const n={...t,common:{...t.common,issues:[]},parent:null},o=i._parseSync({data:t.data,path:t.path,parent:n});if("valid"===o.status)return o;"dirty"!==o.status||e||(e={result:o,ctx:n}),n.common.issues.length&&r.push(n.common.issues)}if(e)return t.common.issues.push(...e.ctx.common.issues),e.result;const i=r.map((e=>new Rn(e)));return Ln(t,{code:Mn.invalid_union,unionErrors:i}),Zn}}get options(){return this._def.options}}_r.create=(e,t)=>new _r({options:e,typeName:Vr.ZodUnion,...Qn(t)});const wr=e=>e instanceof kr?wr(e.schema):e instanceof Ur?wr(e.innerType()):e instanceof Cr?[e.value]:e instanceof Mr?e.options:e instanceof Rr?Object.keys(e.enum):e instanceof Lr?wr(e._def.innerType):e instanceof cr?[void 0]:e instanceof lr?[null]:null;class Tr extends $n{_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==Cn.object)return Ln(t,{code:Mn.invalid_type,expected:Cn.object,received:t.parsedType}),Zn;const n=this.discriminator,r=t.data[n],i=this.optionsMap.get(r);return i?t.common.async?i._parseAsync({data:t.data,path:t.path,parent:t}):i._parseSync({data:t.data,path:t.path,parent:t}):(Ln(t,{code:Mn.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[n]}),Zn)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,t,n){const r=new Map;for(const n of t){const t=wr(n.shape[e]);if(!t)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(const i of t){if(r.has(i))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(i)}`);r.set(i,n)}}return new Tr({typeName:Vr.ZodDiscriminatedUnion,discriminator:e,options:t,optionsMap:r,...Qn(n)})}}function br(e,t){const n=Nn(e),r=Nn(t);if(e===t)return{valid:!0,data:e};if(n===Cn.object&&r===Cn.object){const n=Pn.objectKeys(t),r=Pn.objectKeys(e).filter((e=>-1!==n.indexOf(e))),i={...e,...t};for(const n of r){const r=br(e[n],t[n]);if(!r.valid)return{valid:!1};i[n]=r.data}return{valid:!0,data:i}}if(n===Cn.array&&r===Cn.array){if(e.length!==t.length)return{valid:!1};const n=[];for(let r=0;r<e.length;r++){const i=br(e[r],t[r]);if(!i.valid)return{valid:!1};n.push(i.data)}return{valid:!0,data:n}}return n===Cn.date&&r===Cn.date&&+e==+t?{valid:!0,data:e}:{valid:!1}}class Er extends $n{_parse(e){const{status:t,ctx:n}=this._processInputParams(e),r=(e,r)=>{if(Fn(e)||Fn(r))return Zn;const i=br(e.value,r.value);return i.valid?((Gn(e)||Gn(r))&&t.dirty(),{status:t.value,value:i.data}):(Ln(n,{code:Mn.invalid_intersection_types}),Zn)};return n.common.async?Promise.all([this._def.left._parseAsync({data:n.data,path:n.path,parent:n}),this._def.right._parseAsync({data:n.data,path:n.path,parent:n})]).then((([e,t])=>r(e,t))):r(this._def.left._parseSync({data:n.data,path:n.path,parent:n}),this._def.right._parseSync({data:n.data,path:n.path,parent:n}))}}Er.create=(e,t,n)=>new Er({left:e,right:t,typeName:Vr.ZodIntersection,...Qn(n)});class Sr extends $n{_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==Cn.array)return Ln(n,{code:Mn.invalid_type,expected:Cn.array,received:n.parsedType}),Zn;if(n.data.length<this._def.items.length)return Ln(n,{code:Mn.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),Zn;!this._def.rest&&n.data.length>this._def.items.length&&(Ln(n,{code:Mn.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),t.dirty());const r=[...n.data].map(((e,t)=>{const r=this._def.items[t]||this._def.rest;return r?r._parse(new Jn(n,e,n.path,t)):null})).filter((e=>!!e));return n.common.async?Promise.all(r).then((e=>Bn.mergeArray(t,e))):Bn.mergeArray(t,r)}get items(){return this._def.items}rest(e){return new Sr({...this._def,rest:e})}}Sr.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Sr({items:e,typeName:Vr.ZodTuple,rest:null,...Qn(t)})};class Pr extends $n{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==Cn.object)return Ln(n,{code:Mn.invalid_type,expected:Cn.object,received:n.parsedType}),Zn;const r=[],i=this._def.keyType,o=this._def.valueType;for(const e in n.data)r.push({key:i._parse(new Jn(n,e,n.path,e)),value:o._parse(new Jn(n,n.data[e],n.path,e))});return n.common.async?Bn.mergeObjectAsync(t,r):Bn.mergeObjectSync(t,r)}get element(){return this._def.valueType}static create(e,t,n){return new Pr(t instanceof $n?{keyType:e,valueType:t,typeName:Vr.ZodRecord,...Qn(n)}:{keyType:nr.create(),valueType:e,typeName:Vr.ZodRecord,...Qn(t)})}}class Ar extends $n{_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==Cn.map)return Ln(n,{code:Mn.invalid_type,expected:Cn.map,received:n.parsedType}),Zn;const r=this._def.keyType,i=this._def.valueType,o=[...n.data.entries()].map((([e,t],o)=>({key:r._parse(new Jn(n,e,n.path,[o,"key"])),value:i._parse(new Jn(n,t,n.path,[o,"value"]))})));if(n.common.async){const e=new Map;return Promise.resolve().then((async()=>{for(const n of o){const r=await n.key,i=await n.value;if("aborted"===r.status||"aborted"===i.status)return Zn;"dirty"!==r.status&&"dirty"!==i.status||t.dirty(),e.set(r.value,i.value)}return{status:t.value,value:e}}))}{const e=new Map;for(const n of o){const r=n.key,i=n.value;if("aborted"===r.status||"aborted"===i.status)return Zn;"dirty"!==r.status&&"dirty"!==i.status||t.dirty(),e.set(r.value,i.value)}return{status:t.value,value:e}}}}Ar.create=(e,t,n)=>new Ar({valueType:t,keyType:e,typeName:Vr.ZodMap,...Qn(n)});class Or extends $n{_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==Cn.set)return Ln(n,{code:Mn.invalid_type,expected:Cn.set,received:n.parsedType}),Zn;const r=this._def;null!==r.minSize&&n.data.size<r.minSize.value&&(Ln(n,{code:Mn.too_small,minimum:r.minSize.value,type:"set",inclusive:!0,exact:!1,message:r.minSize.message}),t.dirty()),null!==r.maxSize&&n.data.size>r.maxSize.value&&(Ln(n,{code:Mn.too_big,maximum:r.maxSize.value,type:"set",inclusive:!0,exact:!1,message:r.maxSize.message}),t.dirty());const i=this._def.valueType;function o(e){const n=new Set;for(const r of e){if("aborted"===r.status)return Zn;"dirty"===r.status&&t.dirty(),n.add(r.value)}return{status:t.value,value:n}}const a=[...n.data.values()].map(((e,t)=>i._parse(new Jn(n,e,n.path,t))));return n.common.async?Promise.all(a).then((e=>o(e))):o(a)}min(e,t){return new Or({...this._def,minSize:{value:e,message:Kn.toString(t)}})}max(e,t){return new Or({...this._def,maxSize:{value:e,message:Kn.toString(t)}})}size(e,t){return this.min(e,t).max(e,t)}nonempty(e){return this.min(1,e)}}Or.create=(e,t)=>new Or({valueType:e,minSize:null,maxSize:null,typeName:Vr.ZodSet,...Qn(t)});class Ir extends $n{constructor(){super(...arguments),this.validate=this.implement}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==Cn.function)return Ln(t,{code:Mn.invalid_type,expected:Cn.function,received:t.parsedType}),Zn;function n(e,n){return jn({data:e,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,Dn(),xn].filter((e=>!!e)),issueData:{code:Mn.invalid_arguments,argumentsError:n}})}function r(e,n){return jn({data:e,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,Dn(),xn].filter((e=>!!e)),issueData:{code:Mn.invalid_return_type,returnTypeError:n}})}const i={errorMap:t.common.contextualErrorMap},o=t.data;return this._def.returns instanceof xr?Wn((async(...e)=>{const t=new Rn([]),a=await this._def.args.parseAsync(e,i).catch((r=>{throw t.addIssue(n(e,r)),t})),s=await o(...a);return await this._def.returns._def.type.parseAsync(s,i).catch((e=>{throw t.addIssue(r(s,e)),t}))})):Wn(((...e)=>{const t=this._def.args.safeParse(e,i);if(!t.success)throw new Rn([n(e,t.error)]);const a=o(...t.data),s=this._def.returns.safeParse(a,i);if(!s.success)throw new Rn([r(a,s.error)]);return s.data}))}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new Ir({...this._def,args:Sr.create(e).rest(pr.create())})}returns(e){return new Ir({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,t,n){return new Ir({args:e||Sr.create([]).rest(pr.create()),returns:t||pr.create(),typeName:Vr.ZodFunction,...Qn(n)})}}class kr extends $n{get schema(){return this._def.getter()}_parse(e){const{ctx:t}=this._processInputParams(e);return this._def.getter()._parse({data:t.data,path:t.path,parent:t})}}kr.create=(e,t)=>new kr({getter:e,typeName:Vr.ZodLazy,...Qn(t)});class Cr extends $n{_parse(e){if(e.data!==this._def.value){const t=this._getOrReturnCtx(e);return Ln(t,{received:t.data,code:Mn.invalid_literal,expected:this._def.value}),Zn}return{status:"valid",value:e.data}}get value(){return this._def.value}}function Nr(e,t){return new Mr({values:e,typeName:Vr.ZodEnum,...Qn(t)})}Cr.create=(e,t)=>new Cr({value:e,typeName:Vr.ZodLiteral,...Qn(t)});class Mr extends $n{_parse(e){if("string"!=typeof e.data){const t=this._getOrReturnCtx(e),n=this._def.values;return Ln(t,{expected:Pn.joinValues(n),received:t.parsedType,code:Mn.invalid_type}),Zn}if(-1===this._def.values.indexOf(e.data)){const t=this._getOrReturnCtx(e),n=this._def.values;return Ln(t,{received:t.data,code:Mn.invalid_enum_value,options:n}),Zn}return Wn(e.data)}get options(){return this._def.values}get enum(){const e={};for(const t of this._def.values)e[t]=t;return e}get Values(){const e={};for(const t of this._def.values)e[t]=t;return e}get Enum(){const e={};for(const t of this._def.values)e[t]=t;return e}extract(e){return Mr.create(e)}exclude(e){return Mr.create(this.options.filter((t=>!e.includes(t))))}}Mr.create=Nr;class Rr extends $n{_parse(e){const t=Pn.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(e);if(n.parsedType!==Cn.string&&n.parsedType!==Cn.number){const e=Pn.objectValues(t);return Ln(n,{expected:Pn.joinValues(e),received:n.parsedType,code:Mn.invalid_type}),Zn}if(-1===t.indexOf(e.data)){const e=Pn.objectValues(t);return Ln(n,{received:n.data,code:Mn.invalid_enum_value,options:e}),Zn}return Wn(e.data)}get enum(){return this._def.values}}Rr.create=(e,t)=>new Rr({values:e,typeName:Vr.ZodNativeEnum,...Qn(t)});class xr extends $n{unwrap(){return this._def.type}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==Cn.promise&&!1===t.common.async)return Ln(t,{code:Mn.invalid_type,expected:Cn.promise,received:t.parsedType}),Zn;const n=t.parsedType===Cn.promise?t.data:Promise.resolve(t.data);return Wn(n.then((e=>this._def.type.parseAsync(e,{path:t.path,errorMap:t.common.contextualErrorMap}))))}}xr.create=(e,t)=>new xr({type:e,typeName:Vr.ZodPromise,...Qn(t)});class Ur extends $n{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===Vr.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){const{status:t,ctx:n}=this._processInputParams(e),r=this._def.effect||null;if("preprocess"===r.type){const e=r.transform(n.data);return n.common.async?Promise.resolve(e).then((e=>this._def.schema._parseAsync({data:e,path:n.path,parent:n}))):this._def.schema._parseSync({data:e,path:n.path,parent:n})}const i={addIssue:e=>{Ln(n,e),e.fatal?t.abort():t.dirty()},get path(){return n.path}};if(i.addIssue=i.addIssue.bind(i),"refinement"===r.type){const e=e=>{const t=r.refinement(e,i);if(n.common.async)return Promise.resolve(t);if(t instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return e};if(!1===n.common.async){const r=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});return"aborted"===r.status?Zn:("dirty"===r.status&&t.dirty(),e(r.value),{status:t.value,value:r.value})}return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then((n=>"aborted"===n.status?Zn:("dirty"===n.status&&t.dirty(),e(n.value).then((()=>({status:t.value,value:n.value}))))))}if("transform"===r.type){if(!1===n.common.async){const e=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(!Hn(e))return e;const o=r.transform(e.value,i);if(o instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:t.value,value:o}}return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then((e=>Hn(e)?Promise.resolve(r.transform(e.value,i)).then((e=>({status:t.value,value:e}))):e))}Pn.assertNever(r)}}Ur.create=(e,t,n)=>new Ur({schema:e,typeName:Vr.ZodEffects,effect:t,...Qn(n)}),Ur.createWithPreprocess=(e,t,n)=>new Ur({schema:t,effect:{type:"preprocess",transform:e},typeName:Vr.ZodEffects,...Qn(n)});class Dr extends $n{_parse(e){return this._getType(e)===Cn.undefined?Wn(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}Dr.create=(e,t)=>new Dr({innerType:e,typeName:Vr.ZodOptional,...Qn(t)});class jr extends $n{_parse(e){return this._getType(e)===Cn.null?Wn(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}jr.create=(e,t)=>new jr({innerType:e,typeName:Vr.ZodNullable,...Qn(t)});class Lr extends $n{_parse(e){const{ctx:t}=this._processInputParams(e);let n=t.data;return t.parsedType===Cn.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:t.path,parent:t})}removeDefault(){return this._def.innerType}}Lr.create=(e,t)=>new Lr({innerType:e,typeName:Vr.ZodDefault,defaultValue:"function"==typeof t.default?t.default:()=>t.default,...Qn(t)});class Br extends $n{_parse(e){const{ctx:t}=this._processInputParams(e),n=this._def.innerType._parse({data:t.data,path:t.path,parent:{...t,common:{...t.common,issues:[]}}});return Vn(n)?n.then((e=>({status:"valid",value:"valid"===e.status?e.value:this._def.catchValue()}))):{status:"valid",value:"valid"===n.status?n.value:this._def.catchValue()}}removeCatch(){return this._def.innerType}}Br.create=(e,t)=>new Br({innerType:e,typeName:Vr.ZodCatch,catchValue:"function"==typeof t.catch?t.catch:()=>t.catch,...Qn(t)});class Zr extends $n{_parse(e){if(this._getType(e)!==Cn.nan){const t=this._getOrReturnCtx(e);return Ln(t,{code:Mn.invalid_type,expected:Cn.nan,received:t.parsedType}),Zn}return{status:"valid",value:e.data}}}Zr.create=e=>new Zr({typeName:Vr.ZodNaN,...Qn(e)});const zr=Symbol("zod_brand");class Wr extends $n{_parse(e){const{ctx:t}=this._processInputParams(e),n=t.data;return this._def.type._parse({data:n,path:t.path,parent:t})}unwrap(){return this._def.type}}class Fr extends $n{_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.common.async){return(async()=>{const e=await this._def.in._parseAsync({data:n.data,path:n.path,parent:n});return"aborted"===e.status?Zn:"dirty"===e.status?(t.dirty(),zn(e.value)):this._def.out._parseAsync({data:e.value,path:n.path,parent:n})})()}{const e=this._def.in._parseSync({data:n.data,path:n.path,parent:n});return"aborted"===e.status?Zn:"dirty"===e.status?(t.dirty(),{status:"dirty",value:e.value}):this._def.out._parseSync({data:e.value,path:n.path,parent:n})}}static create(e,t){return new Fr({in:e,out:t,typeName:Vr.ZodPipeline})}}const Gr=(e,t={},n)=>e?dr.create().superRefine(((r,i)=>{if(!e(r)){const e="function"==typeof t?t(r):t,o="string"==typeof e?{message:e}:e;i.addIssue({code:"custom",...o,fatal:n})}})):dr.create(),Hr={object:gr.lazycreate};var Vr;!function(e){e.ZodString="ZodString",e.ZodNumber="ZodNumber",e.ZodNaN="ZodNaN",e.ZodBigInt="ZodBigInt",e.ZodBoolean="ZodBoolean",e.ZodDate="ZodDate",e.ZodSymbol="ZodSymbol",e.ZodUndefined="ZodUndefined",e.ZodNull="ZodNull",e.ZodAny="ZodAny",e.ZodUnknown="ZodUnknown",e.ZodNever="ZodNever",e.ZodVoid="ZodVoid",e.ZodArray="ZodArray",e.ZodObject="ZodObject",e.ZodUnion="ZodUnion",e.ZodDiscriminatedUnion="ZodDiscriminatedUnion",e.ZodIntersection="ZodIntersection",e.ZodTuple="ZodTuple",e.ZodRecord="ZodRecord",e.ZodMap="ZodMap",e.ZodSet="ZodSet",e.ZodFunction="ZodFunction",e.ZodLazy="ZodLazy",e.ZodLiteral="ZodLiteral",e.ZodEnum="ZodEnum",e.ZodEffects="ZodEffects",e.ZodNativeEnum="ZodNativeEnum",e.ZodOptional="ZodOptional",e.ZodNullable="ZodNullable",e.ZodDefault="ZodDefault",e.ZodCatch="ZodCatch",e.ZodPromise="ZodPromise",e.ZodBranded="ZodBranded",e.ZodPipeline="ZodPipeline"}(Vr||(Vr={}));const Kr=nr.create,Jr=ir.create,qr=Zr.create,Qr=or.create,$r=ar.create,Yr=sr.create,Xr=ur.create,ei=cr.create,ti=lr.create,ni=dr.create,ri=pr.create,ii=fr.create,oi=hr.create,ai=mr.create,si=gr.create,ui=gr.strictCreate,ci=_r.create,li=Tr.create,di=Er.create,pi=Sr.create,fi=Pr.create,hi=Ar.create,mi=Or.create,vi=Ir.create,yi=kr.create,gi=Cr.create,_i=Mr.create,wi=Rr.create,Ti=xr.create,bi=Ur.create,Ei=Dr.create,Si=jr.create,Pi=Ur.createWithPreprocess,Ai=Fr.create,Oi={string:e=>nr.create({...e,coerce:!0}),number:e=>ir.create({...e,coerce:!0}),boolean:e=>ar.create({...e,coerce:!0}),bigint:e=>or.create({...e,coerce:!0}),date:e=>sr.create({...e,coerce:!0})},Ii=Zn;var ki=Object.freeze({__proto__:null,defaultErrorMap:xn,setErrorMap:function(e){Un=e},getErrorMap:Dn,makeIssue:jn,EMPTY_PATH:[],addIssueToContext:Ln,ParseStatus:Bn,INVALID:Zn,DIRTY:zn,OK:Wn,isAborted:Fn,isDirty:Gn,isValid:Hn,isAsync:Vn,get util(){return Pn},ZodParsedType:Cn,getParsedType:Nn,ZodType:$n,ZodString:nr,ZodNumber:ir,ZodBigInt:or,ZodBoolean:ar,ZodDate:sr,ZodSymbol:ur,ZodUndefined:cr,ZodNull:lr,ZodAny:dr,ZodUnknown:pr,ZodNever:fr,ZodVoid:hr,ZodArray:mr,get objectUtil(){return vr},ZodObject:gr,ZodUnion:_r,ZodDiscriminatedUnion:Tr,ZodIntersection:Er,ZodTuple:Sr,ZodRecord:Pr,ZodMap:Ar,ZodSet:Or,ZodFunction:Ir,ZodLazy:kr,ZodLiteral:Cr,ZodEnum:Mr,ZodNativeEnum:Rr,ZodPromise:xr,ZodEffects:Ur,ZodTransformer:Ur,ZodOptional:Dr,ZodNullable:jr,ZodDefault:Lr,ZodCatch:Br,ZodNaN:Zr,BRAND:zr,ZodBranded:Wr,ZodPipeline:Fr,custom:Gr,Schema:$n,ZodSchema:$n,late:Hr,get ZodFirstPartyTypeKind(){return Vr},coerce:Oi,any:ni,array:ai,bigint:Qr,boolean:$r,date:Yr,discriminatedUnion:li,effect:bi,enum:_i,function:vi,instanceof:(e,t={message:`Input not instance of ${e.name}`})=>Gr((t=>t instanceof e),t,!0),intersection:di,lazy:yi,literal:gi,map:hi,nan:qr,nativeEnum:wi,never:ii,null:ti,nullable:Si,number:Jr,object:si,oboolean:()=>$r().optional(),onumber:()=>Jr().optional(),optional:Ei,ostring:()=>Kr().optional(),pipeline:Ai,preprocess:Pi,promise:Ti,record:fi,set:mi,strictObject:ui,string:Kr,symbol:Xr,transformer:bi,tuple:pi,undefined:ei,union:ci,unknown:ri,void:oi,NEVER:Ii,ZodIssueCode:Mn,quotelessJson:e=>JSON.stringify(e,null,2).replace(/"([^"]+)":/g,"$1:"),ZodError:Rn}),Ci=function(){function t(){var e,n,r,i,a,u,c,l,d,p,f,h,m,v,y,g,_,w,T,b,E,S,P,A,O,I,k;wt(this,t),this.initConfig=window.APP_CONFIG;var C=_t.isString(null===(e=this.initConfig)||void 0===e||null===(n=e.app)||void 0===n?void 0:n.headerColor)&&(null===(r=this.initConfig)||void 0===r||null===(i=r.app)||void 0===i||null===(a=i.headerColor)||void 0===a?void 0:a.length)>0?he:me;this.hideIOSSafeAreaBottom=!!(null===(u=this.initConfig)||void 0===u||null===(c=u.app)||void 0===c?void 0:c.hideIOSSafeAreaBottom),this.hideAndroidBottomNavigationBar=!!(null===(l=this.initConfig)||void 0===l||null===(d=l.app)||void 0===d?void 0:d.hideAndroidBottomNavigationBar);var N,M,R="none"===(null===(p=this.initConfig)||void 0===p||null===(f=p.app)||void 0===f?void 0:f.leftButton)||"home"===(null===(h=this.initConfig)||void 0===h||null===(m=h.app)||void 0===m?void 0:m.leftButton)?fe.HIDE_BACK:fe.SHOW_BACK,x="home"===(null===(v=this.initConfig)||void 0===v||null===(y=v.app)||void 0===y?void 0:y.leftButton)||"both"===(null===(g=this.initConfig)||void 0===g||null===(_=g.app)||void 0===_?void 0:_.leftButton)?fe.SHOW_HOME:fe.HIDE_HOME,U=new URL(location.href),D=hn(null===(w=this.initConfig)||void 0===w||null===(T=w.app)||void 0===T?void 0:T.statusBar);"boolean"==typeof(null===(b=this.initConfig)||void 0===b||null===(E=b.app)||void 0===E?void 0:E.actionBarHidden)&&(C=(null===(N=this.initConfig)||void 0===N||null===(M=N.app)||void 0===M?void 0:M.actionBarHidden)?me:he);this.config={actionbarType:C,buttonType:R,statusbarType:D,dataConfig:{backgroundColor:(null===(S=this.initConfig)||void 0===S||null===(P=S.app)||void 0===P?void 0:P.headerColor)||ve,textColor:(null===(A=this.initConfig)||void 0===A||null===(O=A.app)||void 0===O?void 0:O.textColor)||"",textAlign:(null===(I=this.initConfig)||void 0===I||null===(k=I.app)||void 0===k?void 0:k.textAlign)||ye,viewInLeftType:R,confirmToExit:1},homeConfig:{enable:x,url:"".concat(s,"/").concat(o,"/").concat(U.search)}}}var n=t.prototype;return n.setNavigationBarTitle=function(e){return we((function(){return Pe(this,(function(t){return[2,new Promise((function(t,n){nn("CHANGE_TITLE_HEADER",{title:e},{success:function(){t(),document.title=e},fail:function(e){n(e)}},{timeout:!1})}))]}))}))()},n.setNavigationBarLeftButton=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.config.dataConfig.confirmToExit,n=this;return we((function(){var r,i;return Pe(this,(function(o){return void 0===(void 0===e?"undefined":pt(e))&&null===(void 0===e?"undefined":pt(e))||(r="none"===e||"home"===e?fe.HIDE_BACK:fe.SHOW_BACK,i="home"===e||"both"===e?fe.SHOW_HOME:fe.HIDE_HOME,n.config.buttonType=r,n.config.dataConfig.viewInLeftType=r,n.config.homeConfig.enable=i),n.config.dataConfig.confirmToExit=t,[2,new Promise((function(e,t){nn("CHANGE_ACTIONBAR_LEFTBUTTON_TYPE",De({},n.config),{success:function(){e()},fail:function(e){t(e)}},{timeout:!1})}))]}))}))()},n.setAndroidBottomNavigationBar=function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],n=this;return we((function(){var r,i,o;return Pe(this,(function(a){return i=t?e.AndroidBottomNavigationBarType.hide:e.AndroidBottomNavigationBarType.show,o=null===(r=Ne())||void 0===r?void 0:r.platform,[2,new Promise((function(e,r){if(!(null==o?void 0:o.isAndroid))return e();nn("CHANGE_BOTTOMBAR",{bottombarType:i},{success:function(){n.hideAndroidBottomNavigationBar=!!t,window.ANDROID_BOTTOM_NAVIGATION_BAR_HIDDEN=!!t,e()},fail:function(e){r(e)}},{timeout:!1})}))]}))}))()},n.setIOSBottomSafeArea=function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],n=this;return we((function(){var r,i,o;return Pe(this,(function(a){return i=t?e.IOSSafeAreaBottomType.hide:e.IOSSafeAreaBottomType.show,o=null===(r=Ne())||void 0===r?void 0:r.platform,[2,new Promise((function(e,r){if(!(null==o?void 0:o.isIOS))return e();nn("CHANGE_BOTTOMBAR",{bottombarType:i},{success:function(){n.hideIOSSafeAreaBottom=!!t,window.IOS_BOTTOM_SAFE_AREA_HIDDEN=!!t,e()},fail:function(e){r(e)}},{timeout:!1,delay:200})}))]}))}))()},n.configHeader=function(t){var n=this;return we((function(){var r;return Pe(this,(function(i){return r=n.config,_t.isString(t.headerColor)&&(r.dataConfig.backgroundColor=t.headerColor),_t.isString(t.headerTextColor)&&(r.dataConfig.textColor=t.headerTextColor),_t.isString(t.textAlign)&&("left"===t.textAlign?r.dataConfig.textAlign=e.TextAlignType.left:"center"===t.textAlign&&(r.dataConfig.textAlign=e.TextAlignType.center)),!0===t.hideActionBar?r.actionbarType=me:!1===t.hideActionBar&&(r.actionbarType=he),"normal"===t.statusBarType?r.statusbarType=e.StatusBarType.normal:"hidden"===t.statusBarType?r.statusbarType=e.StatusBarType.hidden:"transparent"===t.statusBarType&&(r.statusbarType=e.StatusBarType.transparent),[2,new Promise((function(i,o){nn("CHANGE_ACTIONBAR",De({},r),{success:function(){var o;n.config=De({},r);var a,s=null===(o=Ne())||void 0===o?void 0:o.platform;window.STATUS_BAR_TYPE=(a=n.config.statusbarType)===e.StatusBarType.hidden?"hidden":a===e.StatusBarType.transparent?"transparent":"normal",window.ACTION_BAR_HIDDEN=n.config.actionbarType===me;var u=null===document||void 0===document?void 0:document.querySelector(":root");if(null==s?void 0:s.isAndroid){var c=0;if(("hidden"===t.statusBarType||"transparent"===t.statusBarType)&&t.hideActionBar){var l=window.ANDROID_STATUS_BAR_HEIGHT;isNaN(l)&&(l=Math.round(ZaloJavaScriptInterface.getStatusBarHeight()/window.devicePixelRatio)),c=l}c?null==u||u.style.setProperty("--zaui-safe-area-inset-top","".concat(c,"px")):null==u||u.style.setProperty("--zaui-safe-area-inset-top","env(safe-area-inset-top, 0px)")}i()},fail:function(e){o(e)}},{timeout:!1})}))]}))}))()},t.getInstance=function(){return t.instance||(t.instance=new t),t.instance},t}(),Ni=Ci.getInstance(),Mi=[si({title:Kr()}).optional()];function Ri(e){return xi.apply(this,arguments)}function xi(){return xi=we((function(e){return Pe(this,(function(t){return[2,wn("setNavigationBarTitle",Mi,[e],function(){var e=we((function(e){return Pe(this,(function(t){switch(t.label){case 0:return Me.isMp?[4,Ni.setNavigationBarTitle(e.title)]:[3,2];case 1:return[2,t.sent()];case 2:return Me.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(xe("setNavigationBarTitle",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),xi.apply(this,arguments)}var Ui=[si({color:Kr(),textColor:ki.enum(["black","white"]).optional(),statusBarColor:Kr().optional()}).optional()];function Di(e){return ji.apply(this,arguments)}function ji(){return ji=we((function(e){return Pe(this,(function(t){return[2,wn("setNavigationBarColor",Ui,[e],function(){var e=we((function(e){return Pe(this,(function(t){switch(t.label){case 0:return Me.isMp?[4,Ni.configHeader({hideActionBar:!(e.color.length>0),headerTextColor:e.textColor,headerColor:e.color.length>0?e.color:e.statusBarColor})]:[3,2];case 1:return[2,t.sent()];case 2:return Me.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(xe("setNavigationBarColor",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),ji.apply(this,arguments)}var Li=[si({type:ki.enum(["none","back","home","both"])}).optional()];function Bi(e){return Zi.apply(this,arguments)}function Zi(){return Zi=we((function(e){return Pe(this,(function(t){return[2,wn("setNavigationBarLeftButton",Li,[e],function(){var e=we((function(e){return Pe(this,(function(t){switch(t.label){case 0:return Me.isMp?[4,Ni.setNavigationBarLeftButton(e.type)]:[3,2];case 1:return[2,t.sent()];case 2:return Me.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(xe("setNavigationBarLeftButton",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Zi.apply(this,arguments)}function zi(e,t,n){if(!t.has(e))throw new TypeError("attempted to "+n+" private field on non-instance");return t.get(e)}function Wi(e,t){return function(e,t){return t.get?t.get.call(e):t.value}(e,zi(e,t,"get"))}function Fi(e,t,n){!function(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}(e,t),t.set(e,n)}function Gi(e,t,n){return function(e,t,n){if(t.set)t.set.call(e,n);else{if(!t.writable)throw new TypeError("attempted to set read only private field");t.value=n}}(e,zi(e,t,"set"),n),n}var Hi,Vi,Ki,Ji=new WeakMap,qi=new WeakMap,Qi=new WeakMap,$i=function(){function e(t){wt(this,e),Fi(this,Ji,{writable:!0,value:localStorage}),Fi(this,qi,{writable:!0,value:void 0}),Fi(this,Qi,{writable:!0,value:void 0}),Gi(this,Qi,{keys:new Set,currentSize:0,limitSize:ae}),Gi(this,qi,t),this.findAllCurrentDataByApp(t)}var t=e.prototype;return t.findAllCurrentDataByApp=function(e){try{var t;for(t in Wi(this,Ji)){if(e)if(t.split("_")[0]!==e)continue;Wi(this,Qi).keys.add(t)}}catch(e){}},t.get=function(e){var t=this,n=new Map;return e.forEach((function(e){n.set(e,t.getSync(e))})),Promise.resolve(n)},t.getSync=function(e){return Wi(this,qi)&&(e="".concat(Wi(this,qi),"_").concat(e)),Wi(this,Qi).keys.has(e)?Wi(this,Ji).getItem(e):null},t.set=function(e){var t=this;return we((function(){return Pe(this,(function(n){return Object.entries(e).forEach((function(e){var n=je(e,2),r=n[0],i=n[1];t.setSync(r,i.replace(/\\"/g,'"'))})),[2,Promise.resolve({errorKeys:[]})]}))}))()},t.setSync=function(e,t){Wi(this,qi)&&(e="".concat(Wi(this,qi),"_").concat(e)),Wi(this,Ji).setItem(e,t),Wi(this,Qi).keys.add(e)},t.getInfo=function(){var e=this;return we((function(){return Pe(this,(function(t){return[2,Promise.resolve(e.getInfoSync())]}))}))()},t.getInfoSync=function(){var e=function(e,t){var n,r=0;for(n in e){var i=n.split("_")[0];e.hasOwnProperty(n)&&(t&&i!==t||(r+=2*(e[n].length+n.length)))}return r}(Wi(this,Ji),Wi(this,qi));return{currentSize:_t.isNumber(e)?Number((e/1024).toFixed(2)):0,limitSize:Number((ae/1024).toFixed(2))}},t.remove=function(e){var t=this;return we((function(){return Pe(this,(function(n){return e.forEach((function(e){t.removeSync(e)})),[2,Promise.resolve({errorKeys:[]})]}))}))()},t.removeSync=function(e){Wi(this,qi)&&(e="".concat(Wi(this,qi),"_").concat(e)),Wi(this,Qi).keys.has(e)&&(Wi(this,Ji).removeItem(e),Wi(this,Qi).keys.delete(e))},t.clear=function(){var e=this;return we((function(){return Pe(this,(function(t){return[2,Promise.resolve(e.clearSync())]}))}))()},t.clearSync=function(){var e=this;Wi(this,Qi).keys.forEach((function(t){Wi(e,qi)&&t.indexOf(Wi(e,qi))<0||(Wi(e,Ji).removeItem(t),Wi(e,Qi).keys.delete(t))}))},e}(),Yi=new WeakMap,Xi=new WeakMap,eo=function(){function e(t){wt(this,e),Fi(this,Yi,{writable:!0,value:void 0}),Fi(this,Xi,{writable:!0,value:void 0}),Gi(this,Xi,{keys:new Set,currentSize:0,limitSize:ae}),Gi(this,Yi,t)}var t=e.prototype;return t.get=function(e){var t=this;return we((function(){return Pe(this,(function(n){return[2,new Promise((function(n,r){nn("ZBROWSER_MPDS",{mpds_action:"mpds.get",mpds_data:{keys:e},appId:Wi(t,Yi)},{success:function(e){var t=new Map;e&&e.mpds_data&&e.mpds_data.map&&(t=new Map(Object.entries(e.mpds_data.map))),n(t)},fail:function(e){r(e)}},{isMultiCallback:!1})}))]}))}))()},t.set=function(e){var t=this;return we((function(){return Pe(this,(function(n){return[2,new Promise((function(n,r){nn("ZBROWSER_MPDS",{mpds_action:"mpds.set",mpds_data:{map:e},appId:Wi(t,Yi)},{success:function(e){var t=[];e&&e.mpds_data&&e.mpds_data.error_keys&&(t=e.mpds_data.error_keys),n({errorKeys:t})},fail:function(e){r(e)}},{isMultiCallback:!1})}))]}))}))()},t.getInfo=function(){var e=this;return we((function(){return Pe(this,(function(t){return[2,new Promise((function(t,n){nn("ZBROWSER_MPDS",{mpds_action:"mpds.get.size",mpds_data:{},appId:Wi(e,Yi)},{success:function(e){var n=0;e&&e.mpds_data&&e.mpds_data.size&&(n=e.mpds_data.size),t({currentSize:_t.isNumber(n)?Number(Number(n)/1024):0,limitSize:Number(ae/1024)})},fail:function(e){n(e)}},{isMultiCallback:!1})}))]}))}))()},t.remove=function(e){var t=this;return we((function(){return Pe(this,(function(n){return[2,new Promise((function(n,r){nn("ZBROWSER_MPDS",{mpds_action:"mpds.remove.key",mpds_data:{keys:e},appId:Wi(t,Yi)},{success:function(e){var t=[];e&&e.mpds_data&&e.mpds_data.error_keys&&(t=e.mpds_data.error_keys),n({errorKeys:t})},fail:function(e){r(e)}},{isMultiCallback:!1})}))]}))}))()},t.clear=function(){var e=this;return we((function(){return Pe(this,(function(t){return[2,new Promise((function(t,n){nn("ZBROWSER_MPDS",{mpds_action:"mpds.clear.appData",mpds_data:{},appId:Wi(e,Yi)},{success:function(){t()},fail:function(e){n(e)}},{isMultiCallback:!1})}))]}))}))()},e}(),to=function(){function e(){wt(this,e)}var t=e.prototype;return t.getDataFromStorage=function(e){var t=this;return we((function(){var n,r;return Pe(this,(function(i){switch(i.label){case 0:return[4,t.getInstance().get(e)];case 1:return n=i.sent(),r={},n.forEach((function(e,t){r[t]=ln(e)})),[2,r]}}))}))()},t.putDataToStorage=function(e){var t=this;return we((function(){var n,r;return Pe(this,(function(i){switch(i.label){case 0:return n=t.getInstance(),r={},Object.entries(e).forEach((function(e){var t=je(e,2),n=t[0],i=t[1];_t.isUndefined(i)||_t.isNull(i)||(r[n]=fn(i))})),[4,n.set(r)];case 1:return[2,i.sent()]}}))}))()},t.removeDataFromStorage=function(e){var t=this;return we((function(){return Pe(this,(function(n){switch(n.label){case 0:return[4,t.getInstance().remove(e)];case 1:return[2,n.sent()]}}))}))()},t.clearStorage=function(){var e=this;return we((function(){return Pe(this,(function(t){switch(t.label){case 0:return[4,e.getInstance().clear()];case 1:return t.sent(),[2]}}))}))()},t.getStorageInfo=function(){var e=this;return we((function(){return Pe(this,(function(t){switch(t.label){case 0:return[4,e.getInstance().getInfo()];case 1:return[2,t.sent()]}}))}))()},e}(),no=new WeakMap,ro=function(e){Ot(n,e);var t=kt(n);function n(e){var r;return wt(this,n),Fi(It(r=t.call(this)),no,{writable:!0,value:void 0}),Gi(It(r),no,e),r}return n.prototype.getInstance=function(){return new $i(Wi(this,no))},n}(to),io=new WeakMap,oo=function(e){Ot(n,e);var t=kt(n);function n(e){var r;return wt(this,n),Fi(It(r=t.call(this)),io,{writable:!0,value:void 0}),Gi(It(r),io,e),r}return n.prototype.getInstance=function(){return new eo(Wi(this,io))},n}(to),ao=new ro(o),so=(null===(Hi=Ne())||void 0===Hi?void 0:Hi.zaloVersion)||"",uo=(null===(Vi=Ne())||void 0===Vi?void 0:Vi.platformName)||"unknown";!!_t.isString(so)&&parseInt(so,10)>={android:12100571,iOS:400,wp:0,unknown:0}[uo]&&(null===(Ki=Ne())||void 0===Ki?void 0:Ki.appEnv.isMp)&&(ao=new oo(o));var co=ao,lo=[si({data:ki.record(Kr(),ki.any())}).optional()];function po(e){return fo.apply(this,arguments)}function fo(){return fo=we((function(e){return Pe(this,(function(t){return[2,wn("setStorage",lo,[e],function(){var e=we((function(e){return Pe(this,(function(t){switch(t.label){case 0:return Me.isMp||Me.isMpWeb?[4,co.putDataToStorage(e.data)]:[3,2];case 1:return[2,t.sent()];case 2:return[2,Promise.reject(xe("setStorage",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),fo.apply(this,arguments)}var ho=[si({keys:ki.array(Kr())}).optional()];function mo(e){return vo.apply(this,arguments)}function vo(){return vo=we((function(e){return Pe(this,(function(t){return[2,wn("getStorage",ho,[e],function(){var e=we((function(e){return Pe(this,(function(t){switch(t.label){case 0:return Me.isMp||Me.isMpWeb?[4,co.getDataFromStorage(e.keys)]:[3,2];case 1:return[2,t.sent()];case 2:return[2,Promise.reject(xe("getStorage",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),vo.apply(this,arguments)}function yo(e){return go.apply(this,arguments)}function go(){return(go=we((function(e){return Pe(this,(function(t){return[2,wn("getStorageInfo",[],[e],we((function(){return Pe(this,(function(e){switch(e.label){case 0:return Me.isMp||Me.isMpWeb?[4,co.getStorageInfo()]:[3,2];case 1:return[2,e.sent()];case 2:return[2,Promise.reject(xe("getStorageInfo",{}))]}}))})))]}))}))).apply(this,arguments)}var _o=[si({keys:ki.array(Kr())}).optional()];function wo(e){return To.apply(this,arguments)}function To(){return To=we((function(e){return Pe(this,(function(t){return[2,wn("removeStorage",_o,[e],function(){var e=we((function(e){return Pe(this,(function(t){switch(t.label){case 0:return Me.isMp||Me.isMpWeb?[4,co.removeDataFromStorage(e.keys)]:[3,2];case 1:return[2,t.sent()];case 2:return[2,Promise.reject(xe("removeStorage",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),To.apply(this,arguments)}var bo=[si({prefix:Kr().optional()}).optional()];function Eo(e){return So.apply(this,arguments)}function So(){return(So=we((function(e){return Pe(this,(function(t){return[2,wn("clearStorage",bo,[e],we((function(){return Pe(this,(function(e){switch(e.label){case 0:return Me.isMp||Me.isMpWeb?[4,co.clearStorage()]:[3,2];case 1:return[2,e.sent()];case 2:return[2,Promise.reject(xe("clearStorage",{}))]}}))})))]}))}))).apply(this,arguments)}var Po=function(){var e=we((function(e,t){var n,r,i,a;return Pe(this,(function(s){switch(s.label){case 0:return(r=t)?[3,2]:[4,yn()];case 1:r=!s.sent(),s.label=2;case 2:return n=r,[4,an.getAccessToken(n)];case 3:return i=s.sent(),a="id,name,user_id_by_oa,is_sensitive",a=e?"".concat(a,",picture.type(").concat(e,")"):"".concat(a,",picture"),[4,fetch("".concat(d.GET_USER_INFO,"?fields=").concat(a,"&miniapp_id=").concat(o),{headers:{access_token:i||""}}).then(function(){var e=we((function(e){var t,n,r,i;return Pe(this,(function(o){switch(o.label){case 0:return[4,e.json()];case 1:return r=o.sent(),i=null==r?void 0:r.user_id_by_oa,[2,{id:null==r?void 0:r.id,name:(null==r?void 0:r.name)||"",avatar:(null==r||null===(t=r.picture)||void 0===t||null===(n=t.data)||void 0===n?void 0:n.url)||"",idByOA:i,followedOA:!!(null==r?void 0:r.is_follower),isSensitive:null==r?void 0:r.is_sensitive}]}}))}));return function(t){return e.apply(this,arguments)}}())];case 4:return[2,s.sent()]}}))}));return function(t,n){return e.apply(this,arguments)}}(),Ao=[si({avatarType:ki.enum(["small","normal","large"]).optional(),autoRequestPermission:ki.boolean().default(!1).optional()}).optional()];function Oo(e){return Io.apply(this,arguments)}function Io(){return Io=we((function(e){return Pe(this,(function(t){return[2,wn("getUserInfo",Ao,[e],function(){var e=we((function(e){var t,n;return Pe(this,(function(r){switch(r.label){case 0:return Me.isMp?(t=null==e?void 0:e.avatarType,n=null==e?void 0:e.autoRequestPermission,[4,Po(t,n)]):[3,2];case 1:return[2,{userInfo:r.sent()}];case 2:return Me.isMpWeb?[2,Promise.resolve({userInfo:{id:"3368637342326461234",name:"User Name",avatar:"https://h5.zdn.vn/static/images/avatar.png"}})]:[2,Promise.reject(xe("getUserInfo",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Io.apply(this,arguments)}var ko=function(e){return{NONE:e?-2:0,WIFI:e?0:1,"2G":2,"3G":e?15:2,"4G":e?13:2}},Co=we((function(){return Pe(this,(function(t){return[2,new Promise((function(t,n){nn("WEBVIEW_NETWORKTYPE",{url:window.location.href,featureId:""},{success:function(n){var r,i,o,a=n.network,s=(null===(r=Ne())||void 0===r||null===(i=r.platform)||void 0===i?void 0:i.isAndroid)||!1;switch(a){case ko(s).NONE:o=e.NetworkType.none;break;case ko(s).WIFI:o=e.NetworkType.wifi;break;case ko(s)["2G"]:case ko(s)["3G"]:case ko(s)["4G"]:o=e.NetworkType.cellular;break;default:o=e.NetworkType.unknown}t(o)},fail:function(e){n(e)}},{})}))]}))}));function No(e){return Mo.apply(this,arguments)}function Mo(){return(Mo=we((function(t){return Pe(this,(function(n){return[2,wn("getNetworkType",[],[t],we((function(){var t,n;return Pe(this,(function(r){switch(r.label){case 0:return Me.isMp?[4,Co()]:[3,2];case 1:return[2,{networkType:r.sent()}];case 2:if(Me.isMpWeb){switch(t=navigator.connection||navigator.mozConnection||navigator.webkitConnection,t.effectiveType){case"none":n=e.NetworkType.none;break;case"4g":n=e.NetworkType.wifi;break;case"3g":case"2g":n=e.NetworkType.cellular;break;default:n=e.NetworkType.unknown}return[2,Promise.resolve({networkType:n})]}return[2,Promise.reject(xe("getNetworkType",{}))]}}))})))]}))}))).apply(this,arguments)}var Ro=[ki.function().args(si({isConnected:ki.boolean(),networkType:ki.enum(["none","wifi","cellular","unknown"])})).returns(ki.void())];function xo(t){return wn("onNetworkStatusChange",Ro,[t],(function(t){var n=t;if(Me.isMp)!function(t){Mt.getInstance().on(e.Events.NetworkChanged,(function(e){var n=null==e?void 0:e.state;Co().then((function(e){t({isConnected:"CONNECTED"===n,networkType:e})}))}))}(n);else if(Me.isMpWeb){var r=navigator.connection||navigator.mozConnection||navigator.webkitConnection,i=r.effectiveType;r.addEventListener("change",(function(){var t;switch(i){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}n({isConnected:!0,networkType:t})}))}}))}var Uo=function(){var e=we((function(e){var t,n,r,i,o,a;return Pe(this,(function(s){return a={subaction:0,scanning_type:_t.isNumber(null==e?void 0:e.scanningType)?e.scanningType:0,data:{scan_from_source:_t.isString(null==e?void 0:e.scanFromSource)?e.scanFromSource:"",expire:_t.isNumber(null==e?void 0:e.expire)?e.expire:3e3,monitor_interval:_t.isNumber(null==e?void 0:e.monitorInterval)?e.monitorInterval:60,domain:_t.isString(null==e?void 0:e.domain)?e.domain:"",scan_config:{scan_time:_t.isNumber(null==e||null===(t=e.scanConfig)||void 0===t?void 0:t.scanTime)?e.scanConfig.scanTime:15e3,time_between_scan:_t.isNumber(null==e||null===(n=e.scanConfig)||void 0===n?void 0:n.timeBetweenScan)?e.scanConfig.timeBetweenScan:1e4,beacon_timeout:_t.isNumber(null==e||null===(r=e.scanConfig)||void 0===r?void 0:r.beaconTimeout)?e.scanConfig.beaconTimeout:3e4,delayCheckConnectedTimeout:_t.isNumber(null==e||null===(i=e.scanConfig)||void 0===i?void 0:i.delayCheckConnectedTimeout)?e.scanConfig.delayCheckConnectedTimeout:5e3,beaconConnectedTimeout:_t.isNumber(null==e||null===(o=e.scanConfig)||void 0===o?void 0:o.beaconConnectedTimeout)?e.scanConfig.beaconConnectedTimeout:6e5},items:Array.isArray(null==e?void 0:e.items)?null==e?void 0:e.items:[]}},[2,new Promise((function(e,t){nn("SCAN_IBEACON",De({},a),{success:function(){e(!0)},fail:function(e){t(e)}},{})}))]}))}));return function(t){return e.apply(this,arguments)}}(),Do=[si({scanningType:ki.number().refine((function(e){return[0,1].includes(e)}),{message:"The type must be either 0 or 1"}).default(0).optional(),expire:ki.number().optional(),monitorInterval:ki.number().optional(),domain:ki.string().optional(),scanConfig:si({scanTime:ki.number().optional(),timeBetweenScan:ki.number().optional(),beaconTimeout:ki.number().optional(),delayCheckConnectedTimeout:ki.number().optional(),beaconConnectedTimeout:ki.number().optional()}).optional(),items:ki.array(si({id:ki.string().optional(),distance:ki.number().optional(),monitor:si({enable:ki.boolean().optional(),movingRange:ki.number().optional()}).optional()})).optional(),scanFromSource:ki.string().optional()}).optional()];function jo(e){return Lo.apply(this,arguments)}function Lo(){return(Lo=we((function(e){return Pe(this,(function(t){return[2,wn("startBeaconDiscovery",Do,[e],we((function(){return Pe(this,(function(t){switch(t.label){case 0:return Me.isMp?[4,Uo(e)]:[3,2];case 1:return[2,t.sent()];case 2:return Me.isMpWeb?[2,Promise.resolve(!0)]:[2,Promise.reject(xe("startBeaconDiscovery",{}))]}}))})))]}))}))).apply(this,arguments)}var Bo=we((function(){return Pe(this,(function(e){return[2,new Promise((function(e,t){nn("SCAN_IBEACON",{subaction:2},{success:function(){e(!0)},fail:function(e){t(e)}},{})}))]}))}));function Zo(e){return zo.apply(this,arguments)}function zo(){return(zo=we((function(e){return Pe(this,(function(t){return[2,wn("stopBeaconDiscovery",[],[e],we((function(){return Pe(this,(function(e){switch(e.label){case 0:return Me.isMp?[4,Bo()]:[3,2];case 1:return[2,e.sent()];case 2:return Me.isMpWeb?[2,Promise.resolve(!0)]:[2,Promise.reject(xe("stopBeaconDiscovery",{}))]}}))})))]}))}))).apply(this,arguments)}var Wo=we((function(){return Pe(this,(function(e){return[2,new Promise((function(e,t){nn("SCAN_IBEACON",{subaction:1},{success:function(t){var n={beacons:[]};Array.isArray(t)&&t.forEach((function(e){var t={uuid:e.uuid,major:e.major,minor:e.minor,distance:e.distance,rssi:e.rssi};n.beacons.push(t)})),e(n)},fail:function(e){t(e)}},{isMultiCallback:!0})}))]}))}));function Fo(e){return Go.apply(this,arguments)}function Go(){return(Go=we((function(e){return Pe(this,(function(t){return[2,wn("getBeacons",[],[e],we((function(){return Pe(this,(function(e){switch(e.label){case 0:return Me.isMp?[4,Wo()]:[3,2];case 1:return[2,e.sent()];case 2:return Me.isMpWeb?[2,Promise.resolve({beacons:[]})]:[2,Promise.reject(xe("getBeacons",{}))]}}))})))]}))}))).apply(this,arguments)}var Ho=we((function(){return Pe(this,(function(e){return[2,new Promise((function(e,t){nn("WINDOW_CLOSE",{},{success:function(t){e(t)},fail:function(e){t(e)}},{})}))]}))}));function Vo(e){return Ko.apply(this,arguments)}function Ko(){return(Ko=we((function(e){return Pe(this,(function(t){return[2,wn("closeApp",[],[e],we((function(){return Pe(this,(function(e){switch(e.label){case 0:return Me.isMp?[4,Ho()]:[3,2];case 1:return[2,e.sent()];case 2:return Me.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(xe("closeApp",{}))]}}))})))]}))}))).apply(this,arguments)}var Jo=we((function(){return Pe(this,(function(e){return[2,new Promise((function(e,t){nn("OPEN_QR",{skipOpenLink:!0},{success:function(t){e(t)},fail:function(e){t(e)}},{})}))]}))}));function qo(e){return Qo.apply(this,arguments)}function Qo(){return(Qo=we((function(e){return Pe(this,(function(t){return[2,wn("scanQRCode",[],[e],we((function(){return Pe(this,(function(e){switch(e.label){case 0:return Me.isMp?[4,Jo()]:[3,2];case 1:return[2,e.sent()];case 2:return Me.isMpWeb?[2,Promise.resolve({content:""})]:[2,Promise.reject(xe("scanQRCode",{}))]}}))})))]}))}))).apply(this,arguments)}var $o=function(){var t=we((function(t,n,r,o){return Pe(this,(function(a){return[2,new Promise((function(a,s){nn("OPEN_PROFILE",{uId:t,type:e.ProfileType[n],zapp:i,sourceId:r,sourceIndex:o},{success:function(){a()},fail:function(e){s(e)}},{})}))]}))}));return function(e,n,r,i){return t.apply(this,arguments)}}(),Yo=[si({id:Kr(),type:ki.enum(["user","oa","aliasOA"]),sourceId:ki.any().optional(),sourceIndex:ki.any().optional()}).optional()];function Xo(e){return ea.apply(this,arguments)}function ea(){return ea=we((function(e){return Pe(this,(function(t){return[2,wn("openProfile",Yo,[e],function(){var e=we((function(e){var t,n,r,i;return Pe(this,(function(o){switch(o.label){case 0:return Me.isMp?(t=e.id,n=e.type,r=e.sourceId,i=e.sourceIndex,[4,$o(t,n,r,i)]):[3,2];case 1:return[2,o.sent()];case 2:return Me.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(xe("openProfile",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),ea.apply(this,arguments)}var ta=function(){var t=we((function(t,n){var r,o,a,s=arguments;return Pe(this,(function(u){return r=s.length>2&&void 0!==s[2]?s[2]:"",o=s.length>3?s[3]:void 0,a=s.length>4?s[4]:void 0,[2,new Promise((function(s,u){nn("OPEN_CHAT",{uId:t,type:e.ChatType[n],msg:r,zapp:i,sourceId:o,sourceIndex:a},{success:function(){s()},fail:function(e){u(e)}},{})}))]}))}));return function(e,n){return t.apply(this,arguments)}}(),na=[si({id:Kr(),type:ki.enum(["user","oa"]),sourceId:ki.any().optional(),sourceIndex:ki.any().optional(),message:Kr().optional()}).optional()];function ra(e){return ia.apply(this,arguments)}function ia(){return ia=we((function(e){return Pe(this,(function(t){return[2,wn("openChat",na,[e],function(){var e=we((function(e){var t,n,r,i,o;return Pe(this,(function(a){switch(a.label){case 0:return Me.isMp?(t=e.id,n=e.type,r=e.message,i=e.sourceId,o=e.sourceIndex,[4,ta(t,n,r,i,o)]):[3,2];case 1:return[2,a.sent()];case 2:return Me.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(xe("openChat",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),ia.apply(this,arguments)}function oa(e,t){return t=null!=t?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))})),e}var aa=function(){var t=we((function(t,n){var r;return Pe(this,(function(o){switch(r={},t){case"image":r={photoUrl:null==n?void 0:n.imageUrl};break;case"link":r={link:null==n?void 0:n.link,title:null==n?void 0:n.title,thumb:null==n?void 0:n.thumb,description:null==n?void 0:n.description};break;case"profile":r={avt:null==n?void 0:n.avatar,uid:null==n?void 0:n.id,dpn:null==n?void 0:n.displayName}}return[2,new Promise((function(n,o){nn("OPEN_POSTFEED",oa(De({type:e.PostFeedType[t]},r),{zapp:i}),{success:function(e){n({status:null==e?void 0:e.status,shareType:null==e?void 0:e.share_type,numberOfUser:null==e?void 0:e.uid_to_size})},fail:function(e){o(e)}},{})}))]}))}));return function(e,n){return t.apply(this,arguments)}}(),sa=[ki.union([si({type:ki.enum(["image"]),data:si({imageUrl:Kr().url().optional()})}),si({type:ki.enum(["link"]),data:si({link:Kr().url(),title:Kr().max(100).optional(),thumb:Kr().url().optional(),description:Kr().max(400).default("").optional()})}),si({type:ki.enum(["profile"]),data:si({id:Kr().optional()})})])];function ua(e){return ca.apply(this,arguments)}function ca(){return ca=we((function(e){return Pe(this,(function(t){return[2,wn("openPostFeed",sa,[e],function(){var e=we((function(e){var t,n;return Pe(this,(function(r){switch(r.label){case 0:return Me.isMp?(t=e.type,n=e.data,[4,aa(t,n)]):[3,2];case 1:return[2,r.sent()];case 2:return Me.isMpWeb?[2,Promise.resolve({status:1,shareType:0,numberOfUser:0})]:[2,Promise.reject(xe("openPostFeed",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),ca.apply(this,arguments)}var la=function(){var e=we((function(e){return Pe(this,(function(t){return[2,new Promise((function(t,n){nn("FOLLOW_OA",{uid:e,showDialogConfirm:!0,forceUpdate:!0,zapp:i},{success:function(e){t(e)},fail:function(e){n(e)}},{timeout:!1})}))]}))}));return function(t){return e.apply(this,arguments)}}(),da=[si({id:Kr(),showDialogConfirm:ki.boolean().optional()}).optional()];function pa(e){return fa.apply(this,arguments)}function fa(){return fa=we((function(e){return Pe(this,(function(t){return[2,wn("followOA",da,[e],function(){var e=we((function(e){var t;return Pe(this,(function(n){switch(n.label){case 0:return Me.isMp?(t=e.id,[4,la(t)]):[3,2];case 1:return[2,n.sent()];case 2:return Me.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(xe("followOA",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),fa.apply(this,arguments)}var ha=function(){var e=we((function(e){return Pe(this,(function(t){return[2,new Promise((function(t,n){nn("UNFOLLOW_OA",{uid:e,forceUpdate:!0,zapp:i},{success:function(){t()},fail:function(e){n(e)}},{})}))]}))}));return function(t){return e.apply(this,arguments)}}(),ma=[si({id:Kr()}).optional()];function va(e){return ya.apply(this,arguments)}function ya(){return ya=we((function(e){return Pe(this,(function(t){return[2,wn("unfollowOA",ma,[e],function(){var e=we((function(e){var t;return Pe(this,(function(n){switch(n.label){case 0:return Me.isMp?(t=e.id,[4,ha(t)]):[3,2];case 1:return[2,n.sent()];case 2:return Me.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(xe("unfollowOA",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),ya.apply(this,arguments)}var ga=function(){var e=we((function(e,t,n,r,i,o){var s,u,l,p,f,h,m,v;return Pe(this,(function(y){switch(y.label){case 0:return l=new URL(location.href),p=new URLSearchParams,f="".concat(l.pathname.replace(c,"")).concat(l.search),o&&(f="/".concat(e).concat("/"===o[0]?"":"/").concat(o)),!(h=new URL("".concat(a).concat(f))).searchParams.has("env")&&(null===(s=window.APP_ENV)||void 0===s?void 0:s.length)>0&&h.searchParams.set("env",window.APP_ENV),!h.searchParams.has("version")&&(null===(u=window.APP_VERSION)||void 0===u?void 0:u.length)>0&&h.searchParams.set("version",window.APP_VERSION),p.append("title",n),p.append("description",r||""),p.append("thumbnail",i||""),p.append("url",h.href),p.append("accessToken",t||""),m={headers:{"Content-Type":"application/x-www-form-urlencoded"}},[4,fetch(d.CREATE_SHARE_LINK,De({method:"POST",body:p},m))];case 1:return[4,y.sent().json()];case 2:if(!(v=y.sent())||0!==v.err)throw tn.error.cannotGetShareInfo();return h.search="".concat(h.search,"&zshareId=").concat(v.data.shareId),[2,oa(De({},v.data),{shareableLink:h.href})]}}))}));return function(t,n,r,i,o,a){return e.apply(this,arguments)}}(),_a=function(){var t=we((function(t,n){var r,a,s,u,c,l,d,p,f,h,m,v;return Pe(this,(function(y){switch(y.label){case 0:switch(r={},a=t,t){case"text":return[3,1];case"image":return[3,2];case"gif":return[3,3];case"video":return[3,4];case"link":return[3,5];case"oa":return[3,6];case"zmp":return[3,7];case"zmp_deep_link":return[3,10]}return[3,13];case 1:return r={text:null==n?void 0:n.text,desc:(null==n?void 0:n.desc)||(null==n?void 0:n.description),autoParseLink:(null==n?void 0:n.autoParseLink)?1:0},[3,14];case 2:return l=[],d=(null===(u=Ne())||void 0===u?void 0:u.zaloVersion)||0,p=(null===(c=Ne())||void 0===c?void 0:c.platformName)||"unknown",Number(d)>=oe[p]&&(a="multi_image"),Array.isArray(null==n?void 0:n.imageUrls)&&(null==n?void 0:n.imageUrls.length)>0?l=null==n?void 0:n.imageUrls:l.push(null==n?void 0:n.imageUrl),r={photoUrls:l,photoUrl:null==n?void 0:n.imageUrl,caption:null==n?void 0:n.caption},[3,14];case 3:return r={photoUrl:null==n?void 0:n.imageUrl,gifUrl:null==n?void 0:n.gifUrl,width:null==n?void 0:n.width,height:null==n?void 0:n.height},[3,14];case 4:return r={videoThumb:null==n?void 0:n.videoThumb,videoUrl:null==n?void 0:n.videoUrl,width:null==n?void 0:n.width,height:null==n?void 0:n.height},[3,14];case 5:return r={link:null==n?void 0:n.link,chatOnly:(null==n?void 0:n.chatOnly)?1:0},[3,14];case 6:return r={uid:null==n?void 0:n.id},[3,14];case 7:case 10:return[4,an.getAccessToken()];case 8:case 11:return s=y.sent(),[4,ga(o,s||"",(null==n?void 0:n.title)||"",(null==n?void 0:n.description)||"",(null==n?void 0:n.thumbnail)||"",null==n?void 0:n.path)];case 9:return f=y.sent(),r={data:{ZInstantAPIInfo:{url:"".concat(f.zinstantApi),zinstantdata_id:"templateId=".concat(f.ztemplateId,"&appId=").concat(o,"&shareId=").concat(f.shareId)},previewMsgText:{msg:{en:"Zalo Mini Program",vi:"Chương trình nhỏ"}},enableReactions:1}},[3,14];case 12:return h=y.sent().shareableLink,m=new URL(h),v=m.searchParams.getAll("zshareId"),m.searchParams.delete("zshareId"),v.length>0&&m.searchParams.append("zshareId",v[0]),r={link:m.href,chatOnly:0},[3,14];case 13:return[3,14];case 14:return[2,new Promise((function(t,n){nn("OPEN_SHARESHEET",oa(De({type:e.ShareSheetType[a]},r),{zapp:i}),{success:function(e){t({status:null==e?void 0:e.status,shareType:null==e?void 0:e.share_type,numberOfUser:null==e?void 0:e.uid_to_size})},fail:function(e){n(e)}},{timeout:!1})}))]}}))}));return function(e,n){return t.apply(this,arguments)}}(),wa=[ki.union([si({type:ki.enum(["text"]),data:si({text:Kr(),description:Kr().default("").optional(),autoParseLink:ki.boolean().default(!1).optional()})}),si({type:ki.enum(["image"]),data:si({imageUrl:Kr().url(),imageUrls:ki.array(Kr().url()).max(10).optional()})}),si({type:ki.enum(["link"]),data:si({link:Kr().url(),chatOnly:ki.boolean().optional()})}),si({type:ki.enum(["oa"]),data:si({id:Kr()})}),si({type:ki.enum(["gif"]),data:si({gifUrl:Kr().url(),imageUrl:Kr().url().optional(),width:Jr().min(0).optional(),height:Jr().min(0).optional()})}),si({type:ki.enum(["video"]),data:si({videoThumb:Kr().url(),videoUrl:Kr().url(),width:Jr().min(0).optional(),height:Jr().min(0).optional()})}),si({type:ki.enum(["zmp","zmp_deep_link"]),data:si({title:Kr().max(100),thumbnail:Kr().url(),path:Kr().optional(),description:Kr().max(400).default("").optional()})})])];function Ta(e){return ba.apply(this,arguments)}function ba(){return ba=we((function(e){return Pe(this,(function(t){return[2,wn("openShareSheet",wa,[e],function(){var e=we((function(e){var t,n;return Pe(this,(function(r){switch(r.label){case 0:return Me.isMp?(t=e.type,n=e.data,[4,_a(t,n)]):[3,2];case 1:return[2,r.sent()];case 2:return Me.isMpWeb?[2,Promise.resolve({status:2,shareType:0,numberOfUser:0})]:[2,Promise.reject(xe("openShareSheet",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),ba.apply(this,arguments)}var Ea=we((function(){return Pe(this,(function(e){return[2,new Promise((function(e,t){nn("REQUEST_PERMISSION_CAMERA",{},{success:function(t){var n,r;(null===(n=Ne())||void 0===n||null===(r=n.platform)||void 0===r?void 0:r.isAndroid)?e({userAllow:void 0===t.error_code||(null==t?void 0:t.error_code)>=0,message:void 0===t.error_code?"User allowed":null==t?void 0:t.error_message}):e({userAllow:(null==t?void 0:t.error_code)>=0,message:null==t?void 0:t.error_message})},fail:function(n){var r,i;(null===(r=Ne())||void 0===r||null===(i=r.platform)||void 0===i?void 0:i.isAndroid)&&"number"==typeof(null==n?void 0:n.code)?e({userAllow:(null==n?void 0:n.code)>=0,message:null==n?void 0:n.message}):t(n)}},{isMultiCallback:!0})}))]}))}));function Sa(e){return Pa.apply(this,arguments)}function Pa(){return(Pa=we((function(e){return Pe(this,(function(t){return[2,wn("requestCameraPermission",[],[e],we((function(){return Pe(this,(function(e){switch(e.label){case 0:return[4,Ea()];case 1:return[2,e.sent()]}}))})))]}))}))).apply(this,arguments)}var Aa=function(){var e=we((function(e,t,n){return Pe(this,(function(r){return[2,new Promise((function(r,i){nn("CREATE_SHORTCUT",{url:e,title:t,iconUrl:n},{success:function(e){r(e)},fail:function(e){i(e)}},{})}))]}))}));return function(t,n,r){return e.apply(this,arguments)}}(),Oa=we((function(){var e,t,n,r=arguments;return Pe(this,(function(i){switch(i.label){case 0:return e=r.length>0&&void 0!==r[0]?r[0]:o,t=r.length>1&&void 0!==r[1]?r[1]:0,n=In(),[4,Ft(e,t,n.version)];case 1:return[2,i.sent()]}}))})),Ia=function(){var e=we((function(e){return Pe(this,(function(t){return[2,new Promise((function(t,n){nn("OPEN_OUTAPP",{url:e},{success:function(){t()},fail:function(e){n(e)}},{})}))]}))}));return function(t){return e.apply(this,arguments)}}(),ka=[si({params:ki.record(Kr(),Kr()).optional()}).optional()];function Ca(e){return Na.apply(this,arguments)}function Na(){return Na=we((function(e){return Pe(this,(function(t){return[2,wn("createShortcut",ka,[e],function(){var e=we((function(e){var t,n,r,i,s,u,c,l;return Pe(this,(function(d){switch(d.label){case 0:return Me.isMp?[4,Oa(o,0)]:[3,6];case 1:return r=d.sent(),i=null===(t=Ne())||void 0===t||null===(n=t.platform)||void 0===n?void 0:n.isIOS,s=r.logoUrl||pn("og:image:url")||"",u=r.name||document.title,(c=(null==e?void 0:e.params)?new URLSearchParams(null==e?void 0:e.params):new URLSearchParams).append("utm_source","zalo-shortcut"),c.append("utm_medium","default"),c.append("utm_campaign","default"),i?(c.append("appId",o),c.append("appName",u),c.append("appIcon",s),l="https://mini.zalo.me/shortcut.html?".concat(c.toString()),[4,Ia(encodeURI(l))]):[3,3];case 2:return d.sent(),[3,5];case 3:return[4,Aa("".concat(a,"/").concat(o,"/?").concat(c.toString()),u,s)];case 4:d.sent(),d.label=5;case 5:return[2,tn.success()];case 6:return Me.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(xe("createShortcut",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Na.apply(this,arguments)}var Ma=function(){var e=we((function(e,t,n){return Pe(this,(function(r){return[2,new Promise((function(r,o){nn("PROMPT_AUTHENTICATION",{secret_data:e,app_id:i,ui:{title:null==t?void 0:t.title,sub_title:null==t?void 0:t.subTitle,negative_text:null==t?void 0:t.negativeButtonText},require_fingerprint:n?1:0},{success:function(e){var t,n,i,o;r({code:null==e?void 0:e.error_code,message:null==e?void 0:e.error_message,data:{domain:null==e||null===(t=e.data)||void 0===t?void 0:t.domain,code:null==e||null===(n=e.data)||void 0===n?void 0:n.error_code,message:null==e||null===(i=e.data)||void 0===i?void 0:i.error_message,payToken:null==e||null===(o=e.data)||void 0===o?void 0:o.pay_token}})},fail:function(e){o(e)}},{})}))]}))}));return function(t,n,r){return e.apply(this,arguments)}}(),Ra=[si({secretData:Kr(),ui:si({title:Kr().default("Xác thực").optional(),subTitle:Kr().default("Sử dụng sinh trắc học của bạn để xác thực").optional(),negativeButtonText:Kr().default("Đóng").optional()}).optional(),requireFingerprint:$r().default(!0).optional()}).optional()];function xa(e){return Ua.apply(this,arguments)}function Ua(){return Ua=we((function(e){return Pe(this,(function(t){return[2,wn("openBioAuthentication",Ra,[e],function(){var e=we((function(e){var t,n,r;return Pe(this,(function(i){switch(i.label){case 0:return Me.isMp?(t=e.secretData,n=e.ui,r=e.requireFingerprint,[4,Ma(t,n,r)]):[3,2];case 1:return[2,i.sent()];case 2:return Me.isMpWeb?[2,Promise.resolve({code:0,message:"OK",data:{domain:"",code:0,message:"",payToken:""}})]:[2,Promise.reject(xe("openBioAuthentication",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Ua.apply(this,arguments)}var Da=we((function(){return Pe(this,(function(e){return[2,new Promise((function(e,t){nn("PROMPT_AUTHENTICATION_CHECK_STATE",{},{success:function(t){e(null==t?void 0:t.bio_state)},fail:function(e){t(e)}},{actionName:"action.prompt.authentication.check_state"})}))]}))}));function ja(e){return La.apply(this,arguments)}function La(){return(La=we((function(e){return Pe(this,(function(t){return[2,wn("checkStateBioAuthentication",[],[e],we((function(){return Pe(this,(function(e){switch(e.label){case 0:return Me.isMp?[4,Da()]:[3,2];case 1:return[2,{bioState:e.sent()}];case 2:return Me.isMpWeb?[2,Promise.resolve({bioState:""})]:[2,Promise.reject(xe("checkStateBioAuthentication",{}))]}}))})))]}))}))).apply(this,arguments)}var Ba=function(){var e=we((function(e){return Pe(this,(function(t){return[2,new Promise((function(t,n){nn("SHOW_TOAST",{toast:e},{success:function(){t()},fail:function(e){n(e)}},{})}))]}))}));return function(t){return e.apply(this,arguments)}}(),Za=[si({message:Kr()}).optional()];function za(e){return Wa.apply(this,arguments)}function Wa(){return Wa=we((function(e){return Pe(this,(function(t){return[2,wn("showToast",Za,[e],function(){var e=we((function(e){return Pe(this,(function(t){switch(t.label){case 0:return Me.isMp?[4,Ba(e.message)]:[3,2];case 1:return[2,t.sent()];case 2:return Me.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(xe("showToast",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Wa.apply(this,arguments)}var Fa=we((function(){return Pe(this,(function(e){return[2,new Promise((function(e,t){nn("HIDE_KEYBOARD",{},{success:function(){e()},fail:function(e){t(e)}},{})}))]}))}));function Ga(e){return Ha.apply(this,arguments)}function Ha(){return(Ha=we((function(e){return Pe(this,(function(t){return[2,wn("hideKeyboard",[],[e],we((function(){return Pe(this,(function(e){switch(e.label){case 0:return Me.isMp?[4,Fa()]:[3,2];case 1:return[2,e.sent()];case 2:return Me.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(xe("hideKeyboard",{}))]}}))})))]}))}))).apply(this,arguments)}var Va=function(){var e=we((function(e){return Pe(this,(function(t){return[2,new Promise((function(t,n){nn("OPEN_PHONE",{phoneNum:e,phoneCode:e},{success:function(){t()},fail:function(e){n(e)}},{})}))]}))}));return function(t){return e.apply(this,arguments)}}(),Ka=[si({phoneNumber:Kr()})];function Ja(e){return qa.apply(this,arguments)}function qa(){return qa=we((function(e){return Pe(this,(function(t){return[2,wn("openPhone",Ka,[e],function(){var e=we((function(e){return Pe(this,(function(t){switch(t.label){case 0:return Me.isMp?[4,Va(e.phoneNumber)]:[3,2];case 1:return[2,t.sent()];case 2:return Me.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(xe("openPhone",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),qa.apply(this,arguments)}var Qa=function(){var e=we((function(e,t){return Pe(this,(function(n){return[2,new Promise((function(n,r){nn("OPEN_SMS",{content:t,phoneCode:e},{success:function(){n()},fail:function(e){r(e)}},{})}))]}))}));return function(t,n){return e.apply(this,arguments)}}(),$a=[si({content:Kr(),phoneNumber:Kr()})];function Ya(e){return Xa.apply(this,arguments)}function Xa(){return Xa=we((function(e){return Pe(this,(function(t){return[2,wn("openSMS",$a,[e],function(){var e=we((function(e){return Pe(this,(function(t){switch(t.label){case 0:return Me.isMp?[4,Qa(e.phoneNumber,e.content)]:[3,2];case 1:return[2,t.sent()];case 2:return Me.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(xe("openSMS",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Xa.apply(this,arguments)}var es=function(){var e=we((function(e){var t,n=arguments;return Pe(this,(function(r){return t=n.length>1&&void 0!==n[1]?n[1]:"",[2,new Promise((function(n,r){nn("VIEW_MYQR",{dpn:t,uid:e,zapp:i},{success:function(){n()},fail:function(e){r(e)}},{timeout:!1})}))]}))}));return function(t){return e.apply(this,arguments)}}(),ts=[si({id:Kr(),displayName:Kr().default("").optional()})];function ns(e){return rs.apply(this,arguments)}function rs(){return rs=we((function(e){return Pe(this,(function(t){return[2,wn("viewOAQr",ts,[e],function(){var e=we((function(e){return Pe(this,(function(t){switch(t.label){case 0:return Me.isMp?[4,es(e.id,e.displayName)]:[3,2];case 1:return[2,t.sent()];case 2:return Me.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(xe("viewOAQr",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),rs.apply(this,arguments)}var is=function(){var e=we((function(e){return Pe(this,(function(t){return[2,new Promise((function(t,n){nn("KEEP_SCREEN",{data:{keep_screen_on:e?1:0}},{success:function(){t()},fail:function(e){n(e)}},{})}))]}))}));return function(t){return e.apply(this,arguments)}}(),os=[si({keepScreenOn:$r()})];function as(e){return ss.apply(this,arguments)}function ss(){return ss=we((function(e){return Pe(this,(function(t){return[2,wn("keepScreen",os,[e],function(){var e=we((function(e){return Pe(this,(function(t){switch(t.label){case 0:return Me.isMp?[4,is(e.keepScreenOn)]:[3,2];case 1:return[2,t.sent()];case 2:return Me.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(xe("keepScreen",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),ss.apply(this,arguments)}function us(e){return cs.apply(this,arguments)}function cs(){return(cs=we((function(e){return Pe(this,(function(t){return[2,wn("onKeepScreen",[],[e],we((function(){return Pe(this,(function(e){switch(e.label){case 0:return Me.isMp?[4,is(!0)]:[3,2];case 1:return[2,e.sent()];case 2:return Me.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(xe("onKeepScreen",{}))]}}))})))]}))}))).apply(this,arguments)}function ls(e){return ds.apply(this,arguments)}function ds(){return(ds=we((function(e){return Pe(this,(function(t){return[2,wn("offKeepScreen",[],[e],we((function(){return Pe(this,(function(e){switch(e.label){case 0:return Me.isMp?[4,is(!1)]:[3,2];case 1:return[2,e.sent()];case 2:return Me.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(xe("offKeepScreen",{}))]}}))})))]}))}))).apply(this,arguments)}var ps=function(){var e=we((function(e,t){var n;return Pe(this,(function(r){return n={},e?n={imageBase64Data:e}:t&&(n={imageUrl:t}),[2,new Promise((function(e,t){nn("SAVE_IMAGE_GALLERY",De({},n),{success:function(){e()},fail:function(e){t(e)}},{})}))]}))}));return function(t,n){return e.apply(this,arguments)}}(),fs=[si({imageBase64Data:Kr().optional(),imageUrl:Kr().url().optional()}).optional()];function hs(e){return ms.apply(this,arguments)}function ms(){return ms=we((function(e){return Pe(this,(function(t){return[2,wn("saveImageToGallery",fs,[e],function(){var e=we((function(e){return Pe(this,(function(t){switch(t.label){case 0:return Me.isMp?[4,ps(e.imageBase64Data,e.imageUrl)]:[3,2];case 1:return[2,t.sent()];case 2:return Me.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(xe("saveImageToGallery",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),ms.apply(this,arguments)}var vs=function(){var e=we((function(e){var t,n,r,i,o,a,u=arguments;return Pe(this,(function(c){switch(c.label){case 0:t=u.length>1&&void 0!==u[1]?u[1]:"/",n=u.length>2&&void 0!==u[2]?u[2]:{},c.label=1;case 1:return c.trys.push([1,3,,4]),[4,Oa(e,0)];case 2:return r=c.sent(),[3,4];case 3:return c.sent(),[3,4];case 4:i={appId:e},r&&(i.appName=r.name,i.appAvtUrl=r.logoUrl),o="".concat(s,"/").concat(e).concat(t);try{a=new URL(o),Object.entries(n).forEach((function(e){var t=je(e,2),n=t[0],r=t[1];a.searchParams.append(n,String(r))})),o=a.href}catch(e){}return[2,new Promise((function(e,t){nn("OPEN_MP",{mpUrl:o,mpInfo:i},{success:function(){e()},fail:function(e){t(e)}},{})}))]}}))}));return function(t){return e.apply(this,arguments)}}(),ys=[si({appId:Kr(),path:Kr().optional(),params:ki.record(Kr(),Kr()).optional()})];function gs(e){return _s.apply(this,arguments)}function _s(){return _s=we((function(e){return Pe(this,(function(t){return[2,wn("openMiniApp",ys,[e],function(){var e=we((function(e){return Pe(this,(function(t){switch(t.label){case 0:return Me.isMp?[4,vs(e.appId,e.path,e.params)]:[3,2];case 1:return[2,t.sent()];case 2:return Me.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(xe("openMiniApp",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),_s.apply(this,arguments)}var ws=we((function(){var t,n,r=arguments;return Pe(this,(function(i){return t=r.length>0&&void 0!==r[0]?r[0]:"oneShot",n=r.length>1?r[1]:void 0,[2,new Promise((function(r,i){nn("INTERACTIVE_VIBRATION",{type:e.VibrateType[t],vibrate_time:n},{success:function(){r()},fail:function(e){i(e)}},{})}))]}))})),Ts=[si({type:ki.enum(["oneShot"]).default("oneShot"),milliseconds:Jr().optional()})];function bs(e){return Es.apply(this,arguments)}function Es(){return Es=we((function(e){return Pe(this,(function(t){return[2,wn("vibrate",Ts,[e],function(){var e=we((function(e){return Pe(this,(function(t){switch(t.label){case 0:return Me.isMp?[4,ws(null==e?void 0:e.type,null==e?void 0:e.milliseconds)]:[3,2];case 1:return[2,t.sent()];case 2:return Me.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(xe("vibrate",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Es.apply(this,arguments)}var Ss=function(){var e=we((function(e,t){var n,r,i,o;return Pe(this,(function(a){return n=new URL(e),r=n.href.includes("vnpay"),i=n.searchParams.get("typeInapp"),o=_t.isEmpty(t)?void 0:{modal_style:(null==t?void 0:t.style)?Ht(null==t?void 0:t.style):"bottom_sheet",left_button:(null==t?void 0:t.leftButton)?Ht(null==t?void 0:t.leftButton):"back"},!r&&_t.isEmpty(i)&&n.searchParams.set("typeInapp","1"),[2,new Promise((function(e,t){nn("OPEN_INAPP",{url:n.href,style:o},{success:function(){e()},fail:function(e){t(e)}},{})}))]}))}));return function(t,n){return e.apply(this,arguments)}}(),Ps=[si({url:Kr(),config:si({style:ki.enum(["bottomSheet","normal"]).default("bottomSheet").optional(),leftButton:ki.enum(["back","none"]).default("back").optional()}).optional()})];function As(e){return Os.apply(this,arguments)}function Os(){return Os=we((function(e){return Pe(this,(function(t){return[2,wn("openWebview",Ps,[e],function(){var e=we((function(e){return Pe(this,(function(t){switch(t.label){case 0:return Me.isMp?[4,Ss(e.url,e.config)]:[3,2];case 1:return[2,t.sent()];case 2:return Me.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(xe("openWebview",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Os.apply(this,arguments)}function Is(){var e={},t=window.location.href;try{var n=new URL(t).searchParams.toString();n&&(e=Ut.getParamsAsObject(n))}catch(e){throw new Error("Invalid URL")}return e}function ks(){return wn("getRouteParams",[],[],(function(){return Is()}))}function Cs(e){return Ns.apply(this,arguments)}function Ns(){return(Ns=we((function(e){return Pe(this,(function(t){return[2,wn("getAppInfo",[],[e],we((function(){return Pe(this,(function(e){switch(e.label){case 0:return Me.isMp?[4,Oa()]:[3,2];case 1:return[2,e.sent()];case 2:return Me.isMpWeb?[2,Promise.resolve({description:"",name:"",version:"",appUrl:"",qrCodeUrl:""})]:[2,Promise.reject(xe("getAppInfo",{}))]}}))})))]}))}))).apply(this,arguments)}var Ms=function(){var e=we((function(e){return Pe(this,(function(t){return[2,new Promise((function(t,n){nn("WEBVIEW_SET_RESULT",{result:fn(e)},{success:function(){t()},fail:function(e){n(e)}},{})}))]}))}));return function(t){return e.apply(this,arguments)}}(),Rs=[si({data:ki.any()})];function xs(e){return Us.apply(this,arguments)}function Us(){return Us=we((function(e){return Pe(this,(function(t){return[2,wn("sendDataToPreviousMiniApp",Rs,[e],function(){var e=we((function(e){return Pe(this,(function(t){switch(t.label){case 0:return Me.isMp?[4,Ms(e.data)]:[3,2];case 1:return[2,t.sent()];case 2:return Me.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(xe("sendDataToPreviousMiniApp",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Us.apply(this,arguments)}var Ds=we((function(){return Pe(this,(function(e){return[2,new Promise((function(e,t){var n,r;nn("MP_GET_NUMBER",{forceUpdate:!0},{success:function(n){var r={};if(null==n?void 0:n.token)return r.token=null==n?void 0:n.token,e(r);t(tn.error.clientNotSupport())},fail:function(e){t(e)}},{delay:(null===(n=Ne())||void 0===n||null===(r=n.platform)||void 0===r?void 0:r.isIOS)?400:0})}))]}))}));function js(e){return Ls.apply(this,arguments)}function Ls(){return(Ls=we((function(e){return Pe(this,(function(t){return[2,wn("getPhoneNumber",[],[e],we((function(){return Pe(this,(function(e){switch(e.label){case 0:return Me.isMp?[4,Ds()]:[3,2];case 1:return[2,e.sent()];case 2:return Me.isMpWeb?[2,Promise.resolve({number:""})]:[2,Promise.reject(xe("getPhoneNumber",{}))]}}))})))]}))}))).apply(this,arguments)}var Bs=we((function(){var e,t=arguments;return Pe(this,(function(n){return e=t.length>0&&void 0!==t[0]?t[0]:1,[2,new Promise((function(t,n){nn("MP_OPEN_PROFILE_PICKER",{maxProfile:e},{success:function(e){Array.isArray(e)?t(e.map((function(e){return e.id}))):t([])},fail:function(e){n(e)}},{isMultiCallback:!0})}))]}))})),Zs=[si({maxProfile:Jr().min(1).max(10).optional().default(1)})];function zs(e){return Ws.apply(this,arguments)}function Ws(){return Ws=we((function(e){return Pe(this,(function(t){return[2,wn("openProfilePicker",Zs,[e],function(){var e=we((function(e){var t,n,r,i,o;return Pe(this,(function(a){switch(a.label){case 0:return Me.isMp?[4,Bs(null==e?void 0:e.maxProfile)]:[3,8];case 1:if(!((t=a.sent()).length>0))return[3,7];a.label=2;case 2:return a.trys.push([2,6,,7]),[4,an.getAccessToken()];case 3:return r=a.sent(),[4,fetch(d.GET_LIST_USER_INFO,{method:"POST",headers:{"Content-Type":"application/json",access_token:r||""},body:JSON.stringify({fields:"id,name,picture",user_ids:t})})];case 4:return[4,a.sent().json()];case 5:if(0!==(i=a.sent()).error||!i.data)throw new Error(i.message);return n=t.map((function(e){var t,n,r,o,a,s,u,c,l,d,p;return{id:(null===(t=i.data[e])||void 0===t||null===(n=t.user_info)||void 0===n?void 0:n.user_id_by_app)||"",profile:{name:null===(r=i.data[e])||void 0===r||null===(o=r.user_info)||void 0===o?void 0:o.name,avatar:null===(a=i.data[e])||void 0===a||null===(s=a.user_info)||void 0===s||null===(u=s.picture)||void 0===u||null===(c=u.data)||void 0===c?void 0:c.url},code:0!==(null===(l=i.data[e])||void 0===l?void 0:l.error)?-1:0,message:"Get profile: ".concat(_t.isUndefined(null===(d=i.data[e])||void 0===d?void 0:d.message)?"Unknown error":null===(p=i.data[e])||void 0===p?void 0:p.message)}})),[3,7];case 6:return o=a.sent(),n=t.map((function(e){return{id:e,profile:{name:"",avatar:""},code:-1,message:"Can't get profile: ".concat(o.message)}})),[3,7];case 7:return[2,{users:n||[]}];case 8:return Me.isMpWeb?[2,Promise.resolve({users:[]})]:[2,Promise.reject(xe("openProfilePicker",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Ws.apply(this,arguments)}var Fs=function(){var e=we((function(e,t,n){var r;return Pe(this,(function(i){return r=t&&_t.isString(t)&&t.length>0?"wpa_wpa2":"open",[2,new Promise((function(i,o){nn("MP_JOIN_WIFI",{ssid:e,securityType:r,password:t,hiddenSsid:n},{success:function(e){i(e)},fail:function(e){o(e)}},{})}))]}))}));return function(t,n,r){return e.apply(this,arguments)}}(),Gs=[si({SSID:Kr(),password:Kr().optional(),hiddenSSID:$r().optional()})];function Hs(e){return Vs.apply(this,arguments)}function Vs(){return Vs=we((function(e){return Pe(this,(function(t){return[2,wn("connectWifi",Gs,[e],function(){var e=we((function(e){return Pe(this,(function(t){switch(t.label){case 0:return Me.isMp?[4,Fs(e.SSID,e.password,e.hiddenSSID)]:[3,2];case 1:return[2,t.sent()];case 2:return Me.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(xe("connectWifi",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Vs.apply(this,arguments)}var Ks=function(){var t=we((function(t,n,r,i,o,a){var s,u;return Pe(this,(function(c){return s={type:0,url:n,max_size:r||1048576},u={enable:1,aspect_ratio:"1:1"},[2,new Promise((function(n,r){nn("PICK_MEDIA",{media_type:e.MediaPickerType[t],edit_view:De({},u,i),silent_request:o,upload:s,max_select_items:a},{success:function(e){n(null==e?void 0:e.result_content)},fail:function(e){r(e)}},{isMultiCallback:!0})}))]}))}));return function(e,n,r,i,o,a){return t.apply(this,arguments)}}(),Js=[si({type:ki.enum(["video","photo","file","zcamera","zcamera_photo","zcamera_video","zcamera_scan"]),serverUploadUrl:Kr().url(),maxItemSize:Jr().min(0).optional(),editView:si({enable:$r().optional(),aspectRatio:Kr().regex(/^d+:d+$/).optional()}).optional(),silentRequest:$r().optional(),maxSelectItem:Jr().min(1).optional()})];function qs(e){return Qs.apply(this,arguments)}function Qs(){return Qs=we((function(e){return Pe(this,(function(t){return[2,wn("openMediaPicker",Js,[e],function(){var e=we((function(e){var t,n,r,i,o,a;return Pe(this,(function(s){switch(s.label){case 0:return Me.isMp?(i={},_t.isUndefined(null===(t=e.editView)||void 0===t?void 0:t.enable)||(null===(n=e.editView)||void 0===n?void 0:n.enable)?i.enable=1:i.enable=0,i.aspect_ratio=null===(r=e.editView)||void 0===r?void 0:r.aspectRatio,o=!0===e.silentRequest?1:0,a=e.maxSelectItem,[4,Ks(e.type,e.serverUploadUrl,e.maxItemSize,i,o,a)]):[3,2];case 1:return[2,{data:s.sent()}];case 2:return Me.isMpWeb?[2,Promise.resolve({data:""})]:[2,Promise.reject(xe("openMediaPicker",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Qs.apply(this,arguments)}var $s=[si({title:Kr().max(100),description:Kr().max(400).default(""),thumbnail:Kr().url().optional(),path:Kr().optional()})];function Ys(e){return Xs.apply(this,arguments)}function Xs(){return Xs=we((function(e){return Pe(this,(function(t){return[2,wn("getShareableLink",$s,[e],function(){var e=we((function(e){var t;return Pe(this,(function(n){switch(n.label){case 0:return[4,an.getAccessToken()];case 1:return t=n.sent(),[4,ga(window.APP_ID,t||"",e.title,e.description,e.thumbnail,e.path)];case 2:return[2,n.sent().shareableLink]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Xs.apply(this,arguments)}var eu=function(){var e=we((function(e){return Pe(this,(function(t){return[2,new Promise((function(t,n){nn("MP_CLOSE_LOADINGVIEW",{at:(new Date).getTime(),when:e,url:location.href},{success:function(e){t(e)},fail:function(e){n(e)}},{})}))]}))}));return function(t){return e.apply(this,arguments)}}();function tu(e){return nu.apply(this,arguments)}function nu(){return(nu=we((function(e){return Pe(this,(function(t){return[2,wn("closeLoading",[],[e],we((function(){return Pe(this,(function(e){switch(e.label){case 0:return Me.isMp?[4,eu("user action")]:[3,2];case 1:return[2,e.sent()];case 2:return Me.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(xe("closeLoading",{}))]}}))})))]}))}))).apply(this,arguments)}function ru(e){return iu.apply(this,arguments)}function iu(){return iu=we((function(e){return Pe(this,(function(t){return[2,wn("requestUpdateZalo",[],[e],we((function(){var e,t,n;return Pe(this,(function(r){switch(r.label){case 0:return Me.isMp?(n=(null===(e=Ne())||void 0===e||null===(t=e.platform)||void 0===t?void 0:t.isIOS)?"https://apps.apple.com/vn/app/zalo/id579523206":"https://play.google.com/store/apps/details?id=com.zing.zalo",[4,Ia(n)]):[3,2];case 1:return[2,r.sent()];case 2:return Me.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(xe("requestUpdateZalo",{}))]}}))})))]}))})),iu.apply(this,arguments)}var ou=Mt.getInstance();ou.addListener=function(t,n,r){var i=t;return ou.addListener(e.Events[i],n,r)};var au=[ki.function()];function su(t){return wn("onConfirmToExit",au,[t],(function(t){var n=t;Me.isMp&&(ou.on(e.Events.AppClose,n,'{"handle_h5": 1}'),Ni.setNavigationBarLeftButton(void 0,2))}))}function uu(){return wn("offConfirmToExit",[],[],(function(){Me.isMp&&(ou.off(e.Events.AppClose),Ni.setNavigationBarLeftButton(void 0,0))}))}function cu(){return wn("getDeviceId",[],[],(function(){return Me.isMp&&an.getSync(l.DEVICE_ID)||""}))}function lu(e){return du.apply(this,arguments)}function du(){return(du=we((function(e){return Pe(this,(function(t){return[2,wn("getDeviceIdAsync",[],[e],we((function(){return Pe(this,(function(e){switch(e.label){case 0:return Me.isMp?[4,an.jumpAndGetToken(l.DEVICE_ID)]:[3,2];case 1:return[2,e.sent()||""];case 2:return[2,Promise.resolve("")]}}))})))]}))}))).apply(this,arguments)}function pu(){return wn("getContext",[],[],(function(){if(Me.isMp){var e=an.getSync(l.CONTEXT_ID)||"";return{type:an.getSync(l.CONTEXT_TYPE)||"",id:e}}return{type:"",id:""}}))}function fu(e){return hu.apply(this,arguments)}function hu(){return(hu=we((function(e){return Pe(this,(function(t){return[2,wn("getContextAsync",[],[e],we((function(){var e;return Pe(this,(function(t){switch(t.label){case 0:return Me.isMp?[4,an.jumpAndGetToken(l.CONTEXT_ID)]:[3,3];case 1:return e=t.sent()||"",[4,an.jumpAndGetToken(l.CONTEXT_TYPE)];case 2:return[2,{type:t.sent()||"",id:e}];case 3:return[2,Promise.resolve({type:"",id:""})]}}))})))]}))}))).apply(this,arguments)}function mu(e){return vu.apply(this,arguments)}function vu(){return(vu=we((function(e){return Pe(this,(function(t){return[2,wn("getAuthCode",[],[e],we((function(){var e,t;return Pe(this,(function(n){switch(n.label){case 0:return Me.isMp?[4,an.jumpAndGetToken(l.ZOAUTH,!0)]:[3,4];case 1:return e=n.sent()||"",[4,an.jumpAndGetToken(l.ZOAUTH_VRF)];case 2:return t=n.sent()||"",[4,an.verifyUserAuthorized()];case 3:if(n.sent())return[2,{authCode:e,authCodeVerify:t}];throw Gt([{action:"getAuthCode",error:-104,message:"no user auth",data:{}}]),tn.error.loginFailed("User Authentication Required");case 4:return[2,Promise.resolve({authCode:"",authCodeVerify:""})]}}))})))]}))}))).apply(this,arguments)}function yu(e){return gu.apply(this,arguments)}function gu(){return(gu=we((function(e){return Pe(this,(function(t){return[2,wn("getZPIToken",[],[e],we((function(){var e,t,n,r;return Pe(this,(function(i){switch(i.label){case 0:return Me.isMp?[4,an.jumpAndGetToken(l.UTOKEN_ZPI)]:[3,5];case 1:return e=i.sent()||"",[4,an.jumpAndGetToken(l.GTOKEN_ZPI)];case 2:return t=i.sent()||"",[4,an.jumpAndGetToken(l.ZPP_ZPI)];case 3:return n=i.sent()||"",[4,an.jumpAndGetToken(l.ZPT_ZPI)];case 4:return r=i.sent()||"",[2,{utoken:e,gtoken:t,zpp:n,zpt:r}];case 5:return[2,Promise.resolve({utoken:"",gtoken:"",zpp:"",zpt:""})]}}))})))]}))}))).apply(this,arguments)}var _u=[Kr()];function wu(e){return wn("setAccessToken",_u,[e],(function(e){var t=e;an.setAccessToken(t)}))}var Tu=[si({url:Kr().url()})];function bu(e){return Eu.apply(this,arguments)}function Eu(){return Eu=we((function(e){return Pe(this,(function(t){return[2,wn("openOutApp",Tu,[e],function(){var e=we((function(e){return Pe(this,(function(t){switch(t.label){case 0:return Me.isMp?[4,Ia(e.url)]:[3,2];case 1:return[2,t.sent()];case 2:return Me.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(xe("openOutApp",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Eu.apply(this,arguments)}var Su=[si({count:Jr().min(1).optional().default(1),sourceType:ki.array(ki.enum(["album","camera"])).max(2).default(["album","camera"]).optional(),cameraType:ki.enum(["back","front"]).default("front").optional()})];function Pu(e){return Au.apply(this,arguments)}function Au(){return Au=we((function(e){return Pe(this,(function(t){return[2,wn("chooseImage",Su,[e],function(){var e=we((function(e){var t,n,r,i;return Pe(this,(function(o){return t=e.sourceType||["album","camera"],n=e.cameraType||"front",r=e.count||1,(i=document.createElement("input")).type="file",i.multiple=r>1,i.accept="image/*",i.style.display="none",1===t.length&&t.includes("camera")&&(i.accept="front"===n?"zcamera/photo-frontfacing":"zcamera/photo-backfacing",i.capture="front"===n?"user":"environment"),[2,new Promise((function(e,t){i.addEventListener("change",(function(n){var i,o=(null==n||null===(i=n.target)||void 0===i?void 0:i.files)||[];if(o.length>r)t(new Error("You are only allowed to choose a maximum of ".concat(r," images at a time")));else{var a={filePaths:[],tempFiles:[]};Array.from(o).forEach((function(e){a.filePaths.push(URL.createObjectURL(e)),a.tempFiles.push({path:URL.createObjectURL(e),size:e.size})})),e(a)}})),document.body.appendChild(i),i.click()}))]}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Au.apply(this,arguments)}var Ou=we((function(){var e,t,n=arguments;return Pe(this,(function(r){return e=n.length>0&&void 0!==n[0]&&n[0],t=n.length>1&&void 0!==n[1]?n[1]:"Cho phép Zalo truy cập vào vị trí của thiết bị này?",[2,new Promise((function(n,r){nn("GET_LOCATION",{silent_request:e,permission_description:t,forceUpdate:!0},{success:function(e){var t={};if(null==e?void 0:e.token)return t.token=null==e?void 0:e.token,n(t);r(tn.error.clientNotSupport())},fail:function(e){r(e)}},{isMultiCallback:!0,timeout:!1})}))]}))}));function Iu(e){return ku.apply(this,arguments)}function ku(){return(ku=we((function(e){return Pe(this,(function(t){return[2,wn("getLocation",[],[e],we((function(){return Pe(this,(function(e){switch(e.label){case 0:return Me.isMp?[4,Ou()]:[3,2];case 1:return[2,e.sent()];case 2:return Me.isMpWeb?[2,Promise.resolve({longitude:"105.788026",latitude:"21.0258773",timestamp:(new Date).getTime().toString(),provider:"fused"})]:[2,Promise.reject(xe("getLocation",{}))]}}))})))]}))}))).apply(this,arguments)}var Cu=[ki.function().args(si({data:ki.any()})).returns(ki.void())];function Nu(t){return wn("onCallbackData",Cu,[t],(function(){!function(t){Mt.getInstance().on(e.Events.OnDataCallback,(function(e){t({data:e})}))}(t)}))}var Mu=function(){var e=we((function(e){var t,n,r,i,a,s,u,c,l,d,p;return Pe(this,(function(f){switch(f.label){case 0:return n="",e||(e=Is()),"object"==typeof e&&((n=e.zmpOrderId||"")||(t=e.appTransID||e.orderId||e.apptransid)),"string"==typeof e&&(r=Ut.getParameterByName("orderId",e),i=Ut.getParameterByName("appTransID",e)||Ut.getParameterByName("apptransid",e),t=r||i),a={headers:{authorization:"Bearer "}},[4,an.getAccessToken().catch((function(){throw tn.error.loginRequired}))];case 1:return s=f.sent(),a.headers.authorization="Bearer ".concat(s),u=new URL(ce),c={orderId:n,transId:t||"",appId:o},u.search=new URLSearchParams(c).toString(),[4,fetch(u.toString(),a)];case 2:return[4,f.sent().json()];case 3:if(!(l=f.sent()).data)throw tn.error.badRequest(l.msg);return d=l.data||{},p={err:l.err},0!==Object.keys(d).length&&d.constructor===Object&&Object.assign(p,De({msg:d.resultMessage},d)),[2,p]}}))}));return function(t){return e.apply(this,arguments)}}(),Ru=function(){var t=we((function(t,n,r,i,a,s,u){var c,l,d,p,f,h,m,v,y,g,_,w,T,b,E,S,P,A,O,I,k;return Pe(this,(function(C){switch(C.label){case 0:c=o,(l=new URLSearchParams).append("amount",t.toString()),l.append("item",encodeURIComponent(JSON.stringify(n))),l.append("appId",c),r&&l.append("desc",encodeURIComponent(r)),i&&(d=i,"object"==typeof i&&(d=JSON.stringify(i)),l.append("extradata",encodeURIComponent(d))),a&&(p=a,"object"==typeof a&&(p=JSON.stringify(a)),l.append("payload",encodeURIComponent(p))),s&&("string"==typeof s?(l.append("method",s),l.append("isCustom","false")):"object"==typeof s&&(l.append("method",s.id),l.append("isCustom",JSON.stringify(s.isCustom)))),u&&l.append("mac",u),f={headers:{"Content-Type":"application/x-www-form-urlencoded",authorization:"Bearer "}},C.label=1;case 1:return C.trys.push([1,6,,7]),[4,an.getAccessToken().catch((function(){throw tn.error.loginRequired}))];case 2:return m=C.sent(),f.headers.authorization="Bearer ".concat(m),[4,fetch(se,oa(De({method:"POST"},f),{body:l}))];case 3:return[4,C.sent().json()];case 4:if(!(v=C.sent()).data||0!==v.err)throw tn.error.badRequest(v.msg);return y=v.data.id,g=v.data.jwt,_=v.data.messageToken||"",w=window.APP_VERSION,T=window.APP_ENV,b={miniAppId:c,orderId:y},E=v.data.method,S=v.data.isCustom,g&&(b.token=g),w&&(b.version=w),T&&(b.env=T),E&&(b.method=E),S&&(b.isCustom=S),P=Ut.encode(b),A=new URL("?".concat(P),"https://payment-mini.zalo.me").toString(),O=Vt(),I=((null===(h=Ne())||void 0===h?void 0:h.platformName)||"").toLowerCase(),[4,Ss(A,{style:"android"===I&&O<742?"normal":"bottomSheet"}).then((function(){var t=!1;Mt.getInstance().once(e.Events.WebviewClosed,(function(){setTimeout(we((function(){var n;return Pe(this,(function(r){switch(r.label){case 0:return t?[3,2]:[4,Mu({zmpOrderId:y})];case 1:(n=r.sent()).err>=0&&!n.isCustom&&Mt.getInstance().emit(e.Events.PaymentClose,n.err,oa(De({},n),{zmpOrderId:y})),r.label=2;case 2:return[2]}}))})),500)})),Mt.getInstance().once(e.Events.OpenApp,(function(){t=!0}))}))];case 5:return C.sent(),[2,{orderId:y,messageToken:_}];case 6:throw k=C.sent(),console.log("Internal error"),k;case 7:return[2]}}))}));return function(e,n,r,i,o,a,s){return t.apply(this,arguments)}}(),xu=[si({amount:ki.union([Kr(),Jr()]),item:ki.array(ki.record(Kr(),ki.any())),desc:Kr(),extradata:ki.any().optional(),payload:ki.any().optional(),method:ki.union([ki.string(),ki.object({id:ki.string(),isCustom:ki.boolean()})]).optional(),mac:ki.string().optional()})];function Uu(e){return Du.apply(this,arguments)}function Du(){return Du=we((function(e){return Pe(this,(function(t){return[2,wn("createOrder",xu,[e],function(){var e=we((function(e){return Pe(this,(function(t){switch(t.label){case 0:return Me.isMp?[4,Ru(e.amount,e.item,e.desc,e.extradata,e.payload,e.method,e.mac)]:[3,2];case 1:return[2,t.sent()];case 2:return Me.isMpWeb?[2,Promise.resolve({orderId:"",messageToken:""})]:[2,Promise.reject(xe("createOrder",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Du.apply(this,arguments)}var ju=we((function(){return Pe(this,(function(e){return[2,new Promise((function(e,t){nn("MP_CONFIRM_REQUEST_PAYMENT",{},{success:function(){e()},fail:function(e){t(e)}},{})}))]}))})),Lu=function(){var e=we((function(e,t,n,r,i){var a,s,u,c,l,d,p,f,h,m,v,y;return Pe(this,(function(g){switch(g.label){case 0:a=o,(s=new URLSearchParams).append("amount",e.toString()),s.append("appId",a),t&&s.append("desc",encodeURIComponent(t)),n&&s.append("method",n),r&&s.append("transId",r),i&&s.append("mac",i),u={headers:{"Content-Type":"application/x-www-form-urlencoded",authorization:"Bearer "}},g.label=1;case 1:return g.trys.push([1,10,,11]),[4,an.getAccessToken().catch((function(){throw tn.error.loginRequired}))];case 2:return l=g.sent(),u.headers.authorization="Bearer ".concat(l),console.log("_purchase"),[4,an.jumpAndGetToken()];case 3:if(g.sent(),d=null===(c=an.miniProgramConfig)||void 0===c?void 0:c.showConfirmToPayment,console.log("showConfirmToPayment",d),!d)return[3,7];g.label=4;case 4:return g.trys.push([4,6,,7]),[4,ju()];case 5:return g.sent(),[3,7];case 6:throw p=g.sent(),console.error("Failed:",p),p;case 7:return[4,fetch(le,oa(De({method:"POST"},u),{body:s}))];case 8:return[4,g.sent().json()];case 9:if(!(f=g.sent()).data||0!==f.err)throw tn.error.badRequest(f.msg);return h=f.data.id,m=f.data.messageToken||"",v=f.data.transId||"",[2,{orderId:h,messageToken:m,transId:v}];case 10:throw y=g.sent(),console.log("Internal error"),y;case 11:return[2]}}))}));return function(t,n,r,i,o){return e.apply(this,arguments)}}(),Bu=[si({amount:ki.union([ki.string(),ki.number()]),desc:ki.string(),method:ki.string(),transId:ki.string().optional(),mac:ki.string().optional()})];function Zu(e){return zu.apply(this,arguments)}function zu(){return zu=we((function(e){return Pe(this,(function(t){return[2,wn("purchase",Bu,[e],function(){var e=we((function(e){return Pe(this,(function(t){switch(t.label){case 0:return Me.isMp?[4,Lu(e.amount,e.desc,e.method,null==e?void 0:e.transId,null==e?void 0:e.mac)]:[3,2];case 1:return[2,t.sent()];case 2:return Me.isMpWeb?[2,Promise.resolve({orderId:"",messageToken:"",transId:""})]:[2,Promise.reject(xe("purchase",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),zu.apply(this,arguments)}var Wu=function(){var e=we((function(e,t){return Pe(this,(function(n){return[2,new Promise((function(n,r){var i=e&&(null==e?void 0:e.length)>0;nn("MP_SELECT_PAYMENT_METHOD",{isBinding:i,channels:e,selectedMethod:t,forceUpdate:!0},{success:function(e){console.log(e),n(e)},fail:function(e){r(e)}},{})}))]}))}));return function(t,n){return e.apply(this,arguments)}}(),Fu=[si({channels:ai(si({method:Kr(),subMethod:Kr().optional(),subInfo:Kr().optional()})).optional(),selectedMethod:si({method:Kr(),subMethod:Kr().optional()}).optional()}).optional()];function Gu(e){return Hu.apply(this,arguments)}function Hu(){return Hu=we((function(e){return Pe(this,(function(t){return[2,wn("selectPaymentMethod",Fu,[e],function(){var e=we((function(e){var t,n;return Pe(this,(function(r){switch(r.label){case 0:return Me.isMp?(t=e.channels,n=e.selectedMethod,[4,Wu(t,n)]):[3,2];case 1:return[2,r.sent()];case 2:return Me.isMpWeb?[2,Promise.resolve({method:""})]:[2,Promise.reject(xe("selectPaymentMethod",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Hu.apply(this,arguments)}var Vu=[si({data:ki.union([Kr(),ki.record(Kr(),Kr())])})];function Ku(e){return Ju.apply(this,arguments)}function Ju(){return Ju=we((function(e){return Pe(this,(function(t){return[2,wn("checkTransaction",Vu,[e],function(){var e=we((function(e){return Pe(this,(function(t){switch(t.label){case 0:return Me.isMp?[4,Mu(e.data)]:[3,2];case 1:return[2,t.sent()];case 2:return Me.isMpWeb?[2,Promise.resolve({msg:"Success",orderId:"",resultCode:1,transTime:(new Date).getTime().toString(),createdAt:(new Date).getTime().toString(),transId:""})]:[2,Promise.reject(xe("checkTransaction",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Ju.apply(this,arguments)}var qu=[si({hide:$r().default(!1).optional()}).optional()];function Qu(e){return $u.apply(this,arguments)}function $u(){return $u=we((function(e){return Pe(this,(function(t){return[2,wn("setAndroidBottomNavigationBar",qu,[e],function(){var e=we((function(e){return Pe(this,(function(t){switch(t.label){case 0:return Me.isMp?[4,Ni.setAndroidBottomNavigationBar(e.hide)]:[3,2];case 1:return[2,t.sent()];case 2:return Me.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(xe("setAndroidBottomNavigationBar",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),$u.apply(this,arguments)}var Yu=[si({hide:$r().default(!1).optional()}).optional()];function Xu(e){return ec.apply(this,arguments)}function ec(){return ec=we((function(e){return Pe(this,(function(t){return[2,wn("setIOSBottomSafeArea",Yu,[e],function(){var e=we((function(e){return Pe(this,(function(t){switch(t.label){case 0:return Me.isMp?[4,Ni.setIOSBottomSafeArea(e.hide)]:[3,2];case 1:return[2,t.sent()];case 2:return Me.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(xe("setIOSBottomSafeArea",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),ec.apply(this,arguments)}var tc=[si({type:ki.enum(["normal","hidden","transparent"]).default("normal").optional(),color:ki.string().optional()}).optional()];function nc(e){return rc.apply(this,arguments)}function rc(){return rc=we((function(e){return Pe(this,(function(t){return[2,wn("setStatusBar",tc,[e],function(){var e=we((function(e){return Pe(this,(function(t){switch(t.label){case 0:return Me.isMp?[4,Ni.configHeader({statusBarType:e.type,headerColor:e.color})]:[3,2];case 1:return[2,t.sent()];case 2:return Me.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(xe("setStatusBar",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),rc.apply(this,arguments)}var ic=[si({headerTextColor:ki.enum(["black","white"]).optional(),headerColor:ki.string().optional(),actionBar:si({hide:ki.boolean().optional(),title:ki.string().optional(),leftButton:ki.enum(["back","none"]).optional(),textAlign:ki.enum(["left","center"]).default("left").optional()}).optional(),statusBarType:ki.enum(["normal","hidden","transparent"]).optional(),hideAndroidBottomNavigationBar:ki.boolean().optional(),hideIOSSafeAreaBottom:ki.boolean().optional()})];function oc(e){return ac.apply(this,arguments)}function ac(){return ac=we((function(e){return Pe(this,(function(t){return[2,wn("configAppView",ic,[e],function(){var e=we((function(e){var t,n,r,i,o,a,s;return Pe(this,(function(u){switch(u.label){case 0:return Me.isMp?_t.isUndefined(null===(t=e.actionBar)||void 0===t?void 0:t.leftButton)?[3,2]:[4,Ni.setNavigationBarLeftButton(null===(a=e.actionBar)||void 0===a?void 0:a.leftButton)]:[3,13];case 1:u.sent(),u.label=2;case 2:return _t.isUndefined(null===(n=e.actionBar)||void 0===n?void 0:n.title)||!(null===(r=e.actionBar)||void 0===r?void 0:r.title)?[3,4]:[4,Ni.setNavigationBarTitle(null===(s=e.actionBar)||void 0===s?void 0:s.title)];case 3:u.sent(),u.label=4;case 4:return[4,Ni.configHeader({hideActionBar:null===(i=e.actionBar)||void 0===i?void 0:i.hide,statusBarType:e.statusBarType,headerTextColor:e.headerTextColor,headerColor:e.headerColor,textAlign:null===(o=e.actionBar)||void 0===o?void 0:o.textAlign})];case 5:u.sent(),u.label=6;case 6:return u.trys.push([6,11,,12]),"boolean"!=typeof e.hideAndroidBottomNavigationBar?[3,8]:[4,Ni.setAndroidBottomNavigationBar(e.hideAndroidBottomNavigationBar)];case 7:u.sent(),u.label=8;case 8:return"boolean"!=typeof e.hideIOSSafeAreaBottom?[3,10]:[4,Ni.setIOSBottomSafeArea(e.hideIOSSafeAreaBottom)];case 9:u.sent(),u.label=10;case 10:return[3,12];case 11:return u.sent(),[3,12];case 12:return[2];case 13:return Me.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(xe("configAppView",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),ac.apply(this,arguments)}var sc=function(){var t=we((function(t,n,r,i,a,s){var u,c,l,d,p,f,h,m,v,y,g,_,w,T;return Pe(this,(function(b){switch(b.label){case 0:p=o,(f=new URLSearchParams).append("payType",n||e.IAPPayType.SUBSCRIPTION),h=e.ProrationMode.UNKNOW,r===pe&&(h=e.ProrationMode.IMMEDIATE_AND_CHARGE_FULL_PRICE),r===de&&(h=e.ProrationMode.DEFERRED),f.append("utm",a||"default"),f.append("merchantTransId",s||""),f.append("prorationMode",h.toString()),f.append("appId",p),i&&f.append("method",i),m="",(null===(u=Ne())||void 0===u||null===(c=u.platform)||void 0===c?void 0:c.isIOS)?m="ios":(null===(l=Ne())||void 0===l||null===(d=l.platform)||void 0===d?void 0:d.isAndroid)&&(m="android"),f.append("os",m),f.append("productId",t),v={headers:{"Content-Type":"application/x-www-form-urlencoded",authorization:"Bearer "}},b.label=1;case 1:return b.trys.push([1,5,,6]),[4,an.getAccessToken().catch((function(){throw tn.error.loginRequired}))];case 2:return y=b.sent(),v.headers.authorization="Bearer ".concat(y),[4,fetch(ue,oa(De({method:"POST"},v),{body:f}))];case 3:return[4,b.sent().json()];case 4:if(!(g=b.sent()).data||!g.data.store||0!==g.err)throw tn.error.createIAPOrderFailed(g.err);return _=g.data.store,w=g.data.orderId,[2,new Promise((function(e,t){nn("IAP_REQUESTPAYMENT",De({},_),{success:function(){e({orderId:w})},fail:function(e){t(e)}})}))];case 5:throw T=b.sent(),console.log("Internal error"),T;case 6:return[2]}}))}));return function(e,n,r,i,o,a){return t.apply(this,arguments)}}(),uc=[si({productId:Kr(),payType:ki.enum(["ONETIME","SUBSCRIPTION"]).optional(),prorationMode:ki.enum(["DEFERRED","IMMEDIATE_AND_CHARGE_FULL_PRICE"]).default("DEFERRED").optional(),utm:Kr().optional(),method:ki.enum(["IAP","IAP_SANDBOX"]).optional(),merchantTransId:Kr().optional()})];function cc(e){return lc.apply(this,arguments)}function lc(){return lc=we((function(e){return Pe(this,(function(t){return[2,wn("createOrderIAP",uc,[e],function(){var e=we((function(e){return Pe(this,(function(t){switch(t.label){case 0:return Me.isMp?[4,sc(e.productId,e.payType,e.prorationMode,e.method,e.utm,e.merchantTransId)]:[3,2];case 1:return[2,t.sent()];case 2:return Me.isMpWeb?[2,Promise.resolve({orderId:""})]:[2,Promise.reject(xe("createOrderIAP",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),lc.apply(this,arguments)}var dc=we((function(){return Pe(this,(function(e){return[2,new Promise((function(e,t){nn("MA_MENU_MINIMIZE",{},{success:function(t){e(t)},fail:function(e){t(e)}},{})}))]}))}));function pc(e){return fc.apply(this,arguments)}function fc(){return(fc=we((function(e){return Pe(this,(function(t){return[2,wn("minimizeApp",[],[e],we((function(){return Pe(this,(function(e){switch(e.label){case 0:return Me.isMp?[4,dc()]:[3,2];case 1:return[2,e.sent()];case 2:return Me.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(xe("minimizeApp",{}))]}}))})))]}))}))).apply(this,arguments)}var hc=we((function(){return Pe(this,(function(e){return[2,new Promise((function(e,t){nn("MA_MENU_PERMISSION",{},{success:function(t){e(t)},fail:function(e){t(e)}},{}),e()}))]}))}));function mc(e){return vc.apply(this,arguments)}function vc(){return(vc=we((function(e){return Pe(this,(function(t){return[2,wn("openPermissionSetting",[],[e],we((function(){return Pe(this,(function(e){switch(e.label){case 0:return Me.isMp?[4,hc()]:[3,2];case 1:return[2,e.sent()];case 2:return Me.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(xe("openPermissionSetting",{}))]}}))})))]}))}))).apply(this,arguments)}var yc=we((function(){return Pe(this,(function(e){return[2,new Promise((function(e,t){nn("MP_ADD_MYFAVORITES",{timestamp:(new Date).getTime()},{success:function(t){e(t)},fail:function(e){t(e)}},{})}))]}))}));function gc(e){return _c.apply(this,arguments)}function _c(){return(_c=we((function(e){return Pe(this,(function(t){return[2,wn("favoriteApp",[],[e],we((function(){return Pe(this,(function(e){switch(e.label){case 0:return Me.isMp?[4,yc()]:[3,2];case 1:return[2,e.sent()];case 2:return Me.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(xe("favoriteApp",{}))]}}))})))]}))}))).apply(this,arguments)}var wc=we((function(){return Pe(this,(function(e){return[2,new Promise((function(e,t){nn("OPEN_GROUPLIST",{},{success:function(t){e(t)},fail:function(e){t(e)}},{})}))]}))}));function Tc(e){return bc.apply(this,arguments)}function bc(){return(bc=we((function(e){return Pe(this,(function(t){return[2,wn("openGroupList",[],[e],we((function(){return Pe(this,(function(e){switch(e.label){case 0:return Me.isMp?[4,wc()]:[3,2];case 1:return[2,e.sent()];case 2:return Me.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(xe("openGroupList",{}))]}}))})))]}))}))).apply(this,arguments)}var Ec=we((function(){var e;return Pe(this,(function(t){switch(t.label){case 0:return[4,an.getAccessToken()];case 1:return e=t.sent(),[2,new Promise((function(t,n){nn("MP_SEND_NOTIFICATION",{accessToken:e},{success:function(e){t(e)},fail:function(e){n(e)}},{delay:500})}))]}}))}));function Sc(e){return Pc.apply(this,arguments)}function Pc(){return(Pc=we((function(e){return Pe(this,(function(t){return[2,wn("requestSendNotification",[],[e],we((function(){return Pe(this,(function(e){switch(e.label){case 0:return Me.isMp?[4,Ec()]:[3,2];case 1:return[2,e.sent()];case 2:return Me.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(xe("requestSendNotification",{}))]}}))})))]}))}))).apply(this,arguments)}var Ac=we((function(){return Pe(this,(function(e){return[2,new Promise((function(e,t){nn("MP_ADD_RATING",{},{success:function(t){e(t)},fail:function(e){t(e)}},{})}))]}))}));function Oc(e){return Ic.apply(this,arguments)}function Ic(){return(Ic=we((function(e){return Pe(this,(function(t){return[2,wn("addRating",[],[e],we((function(){return Pe(this,(function(e){switch(e.label){case 0:return Me.isMp?[4,Ac()]:[3,2];case 1:return[2,e.sent()];case 2:return Me.isMpWeb?[2,Promise.resolve({})]:[2,Promise.reject(xe("addRating",{}))]}}))})))]}))}))).apply(this,arguments)}var kc,Cc=(kc=we((function(e,t,n){var r,i;return Pe(this,(function(o){switch(o.label){case 0:return(r=new URLSearchParams).append("appId",t),r.append("accessToken",n),r.append("oaId",e),i={headers:{"Content-Type":"application/x-www-form-urlencoded"}},[4,fetch(d.CHECK_INTERACT_OA,De({method:"POST",body:r},i))];case 1:return[4,o.sent().json()];case 2:return[2,o.sent()]}}))})),function(e,t,n){return kc.apply(this,arguments)}),Nc=function(){var e=we((function(e){return Pe(this,(function(t){return[2,new Promise((function(t,n){nn("MP_INTERACT_OA",{oaId:e,forceUpdate:!0},{success:function(e){t(e)},fail:function(e){n(e)}},{})}))]}))}));return function(t){return e.apply(this,arguments)}}(),Mc=[si({oaId:Kr()})];function Rc(e){return xc.apply(this,arguments)}function xc(){return xc=we((function(e){return Pe(this,(function(t){return[2,wn("interactOA",Mc,[e],function(){var e=we((function(e){var t,n,r;return Pe(this,(function(i){switch(i.label){case 0:return Me.isMp?(t=e.oaId,[4,an.getAccessToken()]):[3,5];case 1:return!(n=i.sent())||_t.isEmpty(n)?[3,3]:[4,Cc(t,o,n)];case 2:if(0===(null==(r=i.sent())?void 0:r.err))return[2,Promise.resolve({})];i.label=3;case 3:return[4,Nc(t)];case 4:return[2,i.sent()];case 5:return Me.isMpWeb?[2,Promise.resolve({})]:[2,Promise.reject(xe("interactOA",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),xc.apply(this,arguments)}var Uc=[si({oaId:Kr()})];function Dc(e){return jc.apply(this,arguments)}function jc(){return jc=we((function(e){return Pe(this,(function(t){return[2,wn("isAllowedInteractWithOA",Uc,[e],function(){var e=we((function(e){var t,n,r;return Pe(this,(function(i){switch(i.label){case 0:return Me.isMp?(t=e.oaId,[4,an.getAccessToken()]):[3,4];case 1:return!(n=i.sent())||_t.isEmpty(n)?[3,3]:[4,Cc(t,o,n)];case 2:return r=i.sent(),[2,Promise.resolve({status:0===(null==r?void 0:r.err)})];case 3:return[2,Promise.resolve({status:!1})];case 4:return Me.isMpWeb?[2,Promise.resolve({status:!1})]:[2,Promise.reject(xe("IsAllowedInteractWithOA",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),jc.apply(this,arguments)}function Lc(e){return Bc.apply(this,arguments)}function Bc(){return(Bc=we((function(e){return Pe(this,(function(t){return[2,wn("getSetting",[],[e],we((function(){return Pe(this,(function(e){switch(e.label){case 0:return Me.isMp?[4,Xt()]:[3,2];case 1:return[2,e.sent()];case 2:return Me.isMpWeb?[2,Promise.resolve({authSetting:{}})]:[2,Promise.reject(xe("getSetting",{}))]}}))})))]}))}))).apply(this,arguments)}var Zc=ki.enum(["scope.userInfo","scope.userLocation","scope.userPhonenumber"]),zc=[si({scopes:ki.array(Zc).max(2).optional()}).optional()];function Wc(e){return Fc.apply(this,arguments)}function Fc(){return Fc=we((function(e){return Pe(this,(function(t){return[2,wn("authorize",zc,[e],function(){var e=we((function(e){var t,n,r,i;return Pe(this,(function(o){switch(o.label){case 0:return Me.isMp?(n=null==e?void 0:e.scopes,r=Vt(),("android"===(i=((null===(t=Ne())||void 0===t?void 0:t.platformName)||"").toLowerCase())&&r<724||"ios"===i&&r<573)&&n&&n.length>0?[2,Promise.reject(tn.error.clientNotSupport())]:[4,rn(null!=n?n:void 0)]):[3,2];case 1:return[2,o.sent()];case 2:return Me.isMpWeb?[2,Promise.resolve({})]:[2,Promise.reject(xe("authorize",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Fc.apply(this,arguments)}var Gc=we((function(){return Pe(this,(function(e){return[2,new Promise(function(){var e=we((function(e,t){var n;return Pe(this,(function(r){switch(r.label){case 0:return _t.isUndefined(ZaloJavaScriptInterface)||"function"!=typeof ZaloJavaScriptInterface.checkCameraPermission?[3,2]:[4,ZaloJavaScriptInterface.checkCameraPermission()];case 1:return n=r.sent(),[2,e({userAllow:"grant"===n})];case 2:return t(tn.error.clientNotSupport()),[2]}}))}));return function(t,n){return e.apply(this,arguments)}}())]}))}));function Hc(e){return wn("checkZaloCameraPermission",[],[e],we((function(){return Pe(this,(function(e){switch(e.label){case 0:return[4,Gc()];case 1:return[2,e.sent()]}}))})))}var Vc=we((function(){return Pe(this,(function(e){return[2,new Promise(function(){var e=we((function(e,t){var n,r,i;return Pe(this,(function(o){switch(o.label){case 0:return o.trys.push([0,2,,3]),[4,an.jumpAndGetToken()];case 1:return o.sent(),r=null===(n=an.miniProgramConfig)||void 0===n?void 0:n.userId,e(r),[3,3];case 2:return i=o.sent(),t(i),[3,3];case 3:return[2]}}))}));return function(t,n){return e.apply(this,arguments)}}())]}))}));function Kc(e){return Jc.apply(this,arguments)}function Jc(){return(Jc=we((function(e){return Pe(this,(function(t){return[2,wn("getUserID",[],[e],we((function(){return Pe(this,(function(e){switch(e.label){case 0:return Me.isMp?[4,Vc()]:[3,2];case 1:return[2,e.sent()];case 2:return Me.isMpWeb?[2,Promise.resolve(void 0)]:[2,Promise.reject(xe("getUserID",{}))]}}))})))]}))}))).apply(this,arguments)}var qc=we((function(){return Pe(this,(function(e){return[2,new Promise(function(){var e=we((function(e,t){var n,r,i;return Pe(this,(function(o){switch(o.label){case 0:return o.trys.push([0,2,,3]),[4,an.jumpAndGetToken()];case 1:return o.sent(),r=null===(n=an.miniProgramConfig)||void 0===n?void 0:n.idToken,e(r),[3,3];case 2:return i=o.sent(),t(i),[3,3];case 3:return[2]}}))}));return function(t,n){return e.apply(this,arguments)}}())]}))}));function Qc(e){return $c.apply(this,arguments)}function $c(){return($c=we((function(e){return Pe(this,(function(t){return[2,wn("getIDToken",[],[e],we((function(){return Pe(this,(function(e){switch(e.label){case 0:return Me.isMp?[4,qc()]:[3,2];case 1:return[2,e.sent()];case 2:return Me.isMpWeb?[2,Promise.resolve(void 0)]:[2,Promise.reject(xe("getIDToken",{}))]}}))})))]}))}))).apply(this,arguments)}var Yc={format:e.PhotoFormat.JPEG,quality:e.PhotoQuality.NORMAL,mirrored:!1,useVideoSourceSize:!1},Xc={width:1024,height:768,facingMode:e.FacingMode.FRONT,mirrored:!1,audio:!1,video:!0},el=function(){function t(n){var r,i,o,a,s,u=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,c=this;wt(this,t),this._videoEnabled=!0,this._audioEnabled=null,this.tick=function(){if(c.haveVideoStream()&&c._userRequestFrameCallback){var t=c.getCanvas();if(c.drawFrame(),t){var n={data:t.toDataURL(e.PhotoFormat.PNG),width:t.width,height:t.height};Mt.getInstance().emit(e.CameraEvents.OnFrameCallback,0,n),requestAnimationFrame(c.tick)}}},this._videoElement=n,this._mediaConstraints=null!=u?u:null,this._facingMode=null!==(r=null==u?void 0:u.facingMode)&&void 0!==r?r:Xc.facingMode,this._cameraList=[],this._stream=null,this._selectedDeviceId=null!==(i=null==u?void 0:u.deviceId)&&void 0!==i?i:"",this._canvasElement=null,this._ctx=null,this._hasUserMedia=!1,this._mirror=null!==(o=null==u?void 0:u.mirrored)&&void 0!==o?o:Xc.mirrored,this._userRequestFrameCallback=!1,this._audioEnabled=null!==(a=null==u?void 0:u.audio)&&void 0!==a?a:Xc.audio,this._videoEnabled=null!==(s=null==u?void 0:u.video)&&void 0!==s?s:Xc.video}var n=t.prototype;return n.on=function(t,n){Mt.getInstance().on(t,(function(e){n(e)})),t===e.CameraEvents.OnFrameCallback&&(this._userRequestFrameCallback=!0,this.tick())},n.off=function(t){Mt.getInstance().off(t),t===e.CameraEvents.OnFrameCallback&&(this._userRequestFrameCallback=!1)},n.getQualityNumber=function(e){switch(e){case"high":return.9;case"normal":default:return.6;case"low":return.2}},n.getFacingMode=function(){return this._facingMode},n.getCameraList=function(){return this._cameraList},n.getCameraCount=function(){return this._cameraList.length},n.getSelectedDeviceId=function(){return this._selectedDeviceId},n.setDeviceId=function(e){var t=this;return we((function(){return Pe(this,(function(n){switch(n.label){case 0:return t._selectedDeviceId=e,t._hasUserMedia?[4,t.stream()]:[3,2];case 1:n.sent(),n.label=2;case 2:return[2]}}))}))()},n.getVideoInputs=function(e){var t=this;return this._cameraList=[],e.forEach((function(e){"videoinput"===e.kind&&t._cameraList.push(e)})),this._cameraList},n.updateMediaConstraints=function(e){var t=this;return we((function(){var n,r,i,o,a,s;return Pe(this,(function(u){switch(u.label){case 0:return _t.isEmpty(e)?[2]:JSON.stringify(e)!==JSON.stringify(t._mediaConstraints)?(t._mediaConstraints=e,t._facingMode=null!==(n=null==e?void 0:e.facingMode)&&void 0!==n?n:t._facingMode,t._selectedDeviceId=null!==(r=null==e?void 0:e.deviceId)&&void 0!==r?r:t._selectedDeviceId,t._mirror=null!==(i=null==e?void 0:e.mirrored)&&void 0!==i?i:t._mirror,t._audioEnabled=null!==(o=null==e?void 0:e.audio)&&void 0!==o?o:t._audioEnabled,t._videoEnabled=null!==(a=null==e?void 0:e.video)&&void 0!==a?a:t._videoEnabled,t._selectedDeviceId=null!==(s=null==e?void 0:e.deviceId)&&void 0!==s?s:t._selectedDeviceId,t._hasUserMedia?[4,t.stream()]:[3,2]):[2];case 1:u.sent(),u.label=2;case 2:return[2]}}))}))()},n.getCurrentMediaConstraints=function(){var e=this._mediaConstraints,t={};this._videoElement.width=(null==e?void 0:e.width)||this._videoElement.width||Xc.width,this._videoElement.height=(null==e?void 0:e.height)||this._videoElement.height||Xc.height;var n=!1!==this._videoEnabled,r=!1!==this._audioEnabled;return n&&(""==this._selectedDeviceId&&null!==this._facingMode?t.facingMode=this._facingMode:t.deviceId={exact:this._selectedDeviceId},t.width={exact:this._videoElement.width},t.height={exact:this._videoElement.height}),{video:!!n&&t,audio:r}},n.selectCamera=function(){var t=!0,n=!1,r=void 0;try{for(var i,o=this._cameraList[Symbol.iterator]();!(t=(i=o.next()).done);t=!0){var a=i.value;if(this._facingMode==e.FacingMode.FRONT&&a.label.toLowerCase().includes("front")||this._facingMode==e.FacingMode.BACK&&a.label.toLowerCase().includes("back")){this._selectedDeviceId=a.deviceId;break}}}catch(e){n=!0,r=e}finally{try{t||null==o.return||o.return()}finally{if(n)throw r}}},n.flip=function(){var t=this;return we((function(){return Pe(this,(function(n){switch(n.label){case 0:return t._facingMode=t._facingMode==e.FacingMode.FRONT?e.FacingMode.BACK:e.FacingMode.FRONT,t._videoElement.style.transform="",t.selectCamera(),t._hasUserMedia?[4,t.stream()]:[3,2];case 1:n.sent(),n.label=2;case 2:return[2]}}))}))()},n.start=function(){var t=this;return we((function(){var n,r;return Pe(this,(function(i){return n=Mt.getInstance(),r=function(e){try{t._hasUserMedia&&t.stop()}catch(e){}},n.off(e.Events.AppPaused,r),n.on(e.Events.AppPaused,r),[2,new Promise(function(){var n=we((function(n,r){var i;return Pe(this,(function(o){switch(o.label){case 0:return o.trys.push([0,2,,3]),[4,t.stream()];case 1:return o.sent(),Mt.getInstance().emit(e.CameraEvents.OnStartCallback,0),n(t._selectedDeviceId),[3,3];case 2:return i=o.sent(),r(i),[3,3];case 3:return[2]}}))}));return function(e,t){return n.apply(this,arguments)}}())]}))}))()},n.info=function(){var e=this;return we((function(){return Pe(this,(function(t){return[2,new Promise((function(t,n){navigator.mediaDevices.enumerateDevices().then((function(n){e.getVideoInputs(n),t(e._cameraList)})).catch((function(e){n(e)}))}))]}))}))()},n.stream=function(){var e=this;return we((function(){return Pe(this,(function(t){return[2,new Promise((function(t,n){try{e._stop();var r=e.getCurrentMediaConstraints();if(!1===r.video&&!r.audio)return void t(e._facingMode);navigator.mediaDevices.getUserMedia(r).then(function(){var n=we((function(n){return Pe(this,(function(r){switch(r.label){case 0:return[4,e.info()];case 1:return r.sent(),e.selectCamera(),e.handleUserMedia(null,n),t(e._facingMode),[2]}}))}));return function(e){return n.apply(this,arguments)}}()).catch((function(t){e.handleUserMedia(t),n(t)}))}catch(e){n(e)}}))]}))}))()},n.handleUserMedia=function(t,n){var r=this;if(!t&&n){this._stream=n;try{this._videoElement&&(this._videoElement.srcObject=n,(this._facingMode==e.FacingMode.FRONT||this._mirror)&&(this._videoElement.style.transform="scale(-1,1)"),this._videoElement.onloadedmetadata=function(){r._userRequestFrameCallback&&r.tick()},this._videoElement.play().then((function(){r._hasUserMedia=!0})).catch((function(e){r._hasUserMedia=!1})))}catch(e){this._hasUserMedia=!1}}else this._hasUserMedia=!1},n.updateTrackEnable=function(t,n){var r=this;return we((function(){return Pe(this,(function(i){switch(i.label){case 0:if(t===e.StreamType.VIDEO){if(r._videoEnabled===n)return[2];r._videoEnabled=n}else{if(r._audioEnabled===n)return[2];r._audioEnabled=n}return[4,r.stream()];case 1:return i.sent(),[2]}}))}))()},n.pause=function(e){var t=this;return we((function(){return Pe(this,(function(n){switch(n.label){case 0:return[4,t.updateTrackEnable(e,!1)];case 1:return n.sent(),[2]}}))}))()},n.resume=function(e){var t=this;return we((function(){return Pe(this,(function(n){switch(n.label){case 0:return[4,t.updateTrackEnable(e,!0)];case 1:return n.sent(),[2]}}))}))()},n.isUsing=function(){return this._hasUserMedia},n.stop=function(){this._stop(),Mt.getInstance().emit(e.CameraEvents.OnStopCallback,0)},n._stop=function(){t.stopMediaStream(this._stream),this._hasUserMedia=!1},n.setFacingMode=function(e){this._facingMode=e},n.setMirror=function(e){this._mirror=e,this._videoElement&&(this._videoElement.style.transform=e?"scale(-1,1)":"")},n.takePhoto=function(e){if(!this._hasUserMedia)return null;var t=e||{},n=this.getCanvas(t);if(this.drawFrame(t),n){var r=t.format||Yc.format;return{data:n.toDataURL(r,this.getQualityNumber(t.quality)),width:n.width,height:n.height}}return null},n.haveVideoStream=function(){var e=this._videoElement;return e&&e.videoHeight>0&&this._hasUserMedia},n.getCanvas=function(e){var t=this._videoElement,n=e||{};if(!this.haveVideoStream())return null;if(!this._ctx){var r=t.videoWidth,i=t.videoHeight;if(!n.useVideoSourceSize){var o=r/i;i=(r=n.minScreenshotWidth||t.clientWidth)/o,n.minScreenshotHeight&&i<n.minScreenshotHeight&&(r=(i=n.minScreenshotHeight)*o)}this._canvasElement=document.createElement("canvas"),this._canvasElement.width=(null==n?void 0:n.width)||r,this._canvasElement.height=(null==n?void 0:n.height)||i,this._ctx=this._canvasElement.getContext("2d")}return this._canvasElement},n.drawFrame=function(t){var n=this._videoElement,r=t||{};if(n&&this._ctx&&this._canvasElement){var i=this._canvasElement,o=this._ctx;i.width=(null==r?void 0:r.width)||i.width,i.height=(null==r?void 0:r.height)||i.height,((null==r?void 0:r.mirrored)||this._mirror||this._facingMode===e.FacingMode.FRONT)&&(o.translate(i.width,0),o.scale(-1,1)),o.drawImage(n,0,0,i.width,i.height),((null==r?void 0:r.mirrored)||this._mirror||this._facingMode===e.FacingMode.FRONT)&&(o.scale(-1,1),o.translate(-i.width,0))}},t.stopMediaStream=function(e){e&&(e.getVideoTracks&&e.getAudioTracks?(e.getVideoTracks().map((function(t){e.removeTrack(t),t.stop()})),e.getAudioTracks().map((function(t){e.removeTrack(t),t.stop()}))):e.stop())},t}(),tl=si({play:ki.function(),pause:ki.function()}).refine((function(e){return"play"in e&&"pause"in e}),{message:"Invalid HTMLVideoElement"}),nl=[si({videoElement:tl,mediaConstraints:ki.object({width:ki.number().min(100).optional(),height:ki.number().min(100).optional(),facingMode:ki.string().optional(),audio:ki.boolean().optional(),video:ki.boolean().optional(),deviceId:ki.string().optional(),mirrored:ki.boolean().optional()}).nullish()}).optional()];function rl(e){return wn("createCameraContext",nl,[e],(function(e){return new el(e.videoElement,e.mediaConstraints)}))}var il=function(){function e(){var t,n;wt(this,e),this.sdkLoaded=!1,this.queue=[];var r=window.AdtimaZMA={config:{cateId:null===(t=window.zmpGlobal)||void 0===t||null===(n=t.appInfo)||void 0===n?void 0:n.cateType,appId:window.APP_ID},queue:[],load:function(e,t){r.queue=Se(r.queue).concat([[e,t]])}}}var t=e.prototype;return t.loadSDK=function(){var e=this,t=document.createElement("script");t.src="https://adtima-static.zascdn.me/resource/js/zma/sdk.js?q=".concat(Math.floor((new Date).getTime()/864e5)),t.onload=function(){e.sdkLoaded=!0,e.processQueue()},t.onerror=function(){e.sdkLoaded=!0},document.body.appendChild(t)},t.load=function(e,t){var n;_t.isFunction(null===(n=window.AdtimaZMA)||void 0===n?void 0:n.load)&&window.AdtimaZMA.load(e,t)},t.display=function(e){var t;this.sdkLoaded?_t.isFunction(null===(t=window.AdtimaZMA)||void 0===t?void 0:t.display)&&window.AdtimaZMA.display(e):this.queue.push(this.display.bind(this,e))},t.refresh=function(e){var t;this.sdkLoaded?_t.isFunction(null===(t=window.AdtimaZMA)||void 0===t?void 0:t.refresh)&&window.AdtimaZMA.refresh(e):this.queue.push(this.refresh.bind(this,e))},t.processQueue=function(){for(;this.queue.length>0;){var e=this.queue.shift();e&&e()}},e.getInstance=function(){return e.instance||(e.instance=new e),e.instance},e}();function ol(e){return al.apply(this,arguments)}function al(){return(al=we((function(e){return Pe(this,(function(t){return[2,wn("setupAd",[],[e],(function(){return il.getInstance().loadSDK()}))]}))}))).apply(this,arguments)}var sl=[si({ids:ki.union([ki.string(),ki.array(ki.string())]),config:si({display:ki.boolean().optional(),onClose:ki.function().optional()}).optional()})];function ul(e){return cl.apply(this,arguments)}function cl(){return cl=we((function(e){return Pe(this,(function(t){return[2,wn("loadAd",sl,[e],function(){var e=we((function(e){return Pe(this,(function(t){return il.getInstance().load(e.ids,e.config),[2]}))}));return function(t){return e.apply(this,arguments)}}())]}))})),cl.apply(this,arguments)}var ll=[si({id:ki.string()})];function dl(e){return pl.apply(this,arguments)}function pl(){return pl=we((function(e){return Pe(this,(function(t){return[2,wn("displayAd",ll,[e],function(){var e=we((function(e){return Pe(this,(function(t){return il.getInstance().display(e.id),[2]}))}));return function(t){return e.apply(this,arguments)}}())]}))})),pl.apply(this,arguments)}var fl=[si({id:ki.string().optional()}).optional()];function hl(e){return ml.apply(this,arguments)}function ml(){return ml=we((function(e){return Pe(this,(function(t){return[2,wn("refreshAd",fl,[e],function(){var e=we((function(e){return Pe(this,(function(t){return il.getInstance().refresh(e.id),[2]}))}));return function(t){return e.apply(this,arguments)}}())]}))})),ml.apply(this,arguments)}var vl=[si({id:Kr(),guidingText:Kr().optional(),color:Kr().optional(),onStatusChange:ki.function().optional()})];function yl(e){return gl.apply(this,arguments)}function gl(){return gl=we((function(e){return Pe(this,(function(n){return[2,wn("showOAWidget",vl,[e],function(){var e=we((function(e){var n,r,i,o,a,s,u,c;return Pe(this,(function(l){if(Me.isMp){try{n=document.getElementById(e.id),r=e.onStatusChange,i=e.guidingText,o=e.color,a=t(e,["onStatusChange","guidingText","color"]),n&&(s=document.createElement("iframe"),u="iframeOAWidget_".concat(Date.now()),(c=new URL("https://h5.zalo.me/widgets/oa_widget.html")).searchParams.set("id",u),i&&c.searchParams.set("guidingText",i),o&&c.searchParams.set("color",o),Object.entries(a).forEach((function(e){var t=je(e,2),n=t[0],r=t[1];r&&c.searchParams.set("data-".concat(n),String(r))})),s.id=u,s.src=c.href,s.style.width="100%",s.style.height="100%",s.style.border="none",n.innerHTML=s.outerHTML,window.addEventListener("message",function(){var e=we((function(e){var t,n,i,o,a,s,l,d;return Pe(this,(function(p){switch(p.label){case 0:return t=e.data,e.origin.startsWith("https://h5.zalo.me")?(n=document.getElementById(u),i=t.type,(o=new URL(t.href)).origin!==c.origin||o.pathname!==c.pathname||t.id!==u?[3,3]:"followOA"!==i&&"getOAInfo"!==i?[3,2]:[4,an.jumpAndGetToken()]):[3,3];case 1:return p.sent(),l=null===(a=an.miniProgramConfig)||void 0===a?void 0:a.jwt,null==n||null===(s=n.contentWindow)||void 0===s||s.postMessage({type:i,payload:{jwt:l}},"*"),[3,3];case 2:"oaInfo"===i?null==r||r(null===(d=t.payload)||void 0===d?void 0:d.followed):"openOA"===i?$o(t.payload.id,"oa"):"heightChange"===i&&(n.style.height="".concat(t.payload,"px")),p.label=3;case 3:return[2]}}))}));return function(t){return e.apply(this,arguments)}}(),!1))}catch(e){console.log(e)}return[2,Promise.resolve()]}return Me.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(xe("openMiniApp",{}))]}))}));return function(t){return e.apply(this,arguments)}}())]}))})),gl.apply(this,arguments)}var _l=[si({id:Kr(),type:Kr(),text:Kr(),color:Kr().optional(),disabled:ki.boolean().optional(),onDataReceived:ki.function().optional(),onError:ki.function().optional()})];function wl(e){return Tl.apply(this,arguments)}function Tl(){return Tl=we((function(e){return Pe(this,(function(n){return[2,wn("showFunctionButtonWidget",_l,[e],function(){var e=we((function(e){var n,r,i,o,a,s,u;return Pe(this,(function(c){if(Me.isMp){try{n=document.getElementById(e.id),r=e.onDataReceived,i=e.onError,o=t(e,["onDataReceived","onError"]),n&&(a=document.createElement("iframe"),s="iframeFunctionButtonWidget".concat(Date.now()),(u=new URL("https://h5.zalo.me/widgets/function_button_widget.html")).searchParams.set("id",s),Object.entries(o).forEach((function(e){var t=je(e,2),n=t[0],r=t[1];r&&u.searchParams.set("data-".concat(n),String(r))})),a.id=s,a.src=u.href,a.style.width="100%",a.style.height="100%",a.style.border="none",Object.entries(o).forEach((function(e){var t=je(e,2),n=t[0],r=t[1];r&&a.setAttribute("data-".concat(n),String(r))})),n.innerHTML=a.outerHTML,window.addEventListener("message",function(){var e=we((function(e){var t,n,a,c,l,d,p,f,h,m,v,y;return Pe(this,(function(g){switch(g.label){case 0:return t=e.data,e.origin.startsWith("https://h5.zalo.me")?(n=document.getElementById(s),a=t.type,(c=new URL(t.href)).origin!==u.origin||c.pathname!==u.pathname||t.id!==s?[3,4]:"buttonClicked"!==a?[3,3]:[4,an.jumpAndGetToken()]):[3,4];case 1:return g.sent(),f=null===(l=an.miniProgramConfig)||void 0===l?void 0:l.jwt,h=null===(d=an.miniProgramConfig)||void 0===d?void 0:d.encryptKey,[4,En()];case 2:return m=g.sent(),null==n||null===(p=n.contentWindow)||void 0===p||p.postMessage({type:a,payload:{jwt:f,encryptKey:h,accessToken:m}},"*"),[3,4];case 3:"onSuccess"===a?(null==(v=t.payload)?void 0:v.type)===o.type&&(null==r||r(null==v?void 0:v.data)):"onError"===a&&(null==(y=t.payload)?void 0:y.type)===o.type&&(null==i||i(null==y?void 0:y.data)),g.label=4;case 4:return[2]}}))}));return function(t){return e.apply(this,arguments)}}(),!1))}catch(e){console.log(e)}return[2,Promise.resolve()]}return Me.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(xe("openMiniApp",{}))]}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Tl.apply(this,arguments)}var bl=function(){var t=we((function(t,n){var r;return Pe(this,(function(i){return r={},"cccd"===t&&(r={mrz:null==n?void 0:n.mrz}),[2,new Promise((function(n,i){nn("SCAN_NFC",{type:e.ScanNFCType[t],data:r},{success:function(e){if("cccd"===t){var r,i,o,a,s,u,c,l,d,p,f,h,m,v,y,g,_,w,T,b,E={dg1:null!==(r=e.dg1)&&void 0!==r?r:"",dg2:null!==(i=e.dg2)&&void 0!==i?i:"",dg3:null!==(o=e.dg3)&&void 0!==o?o:"",dg4:null!==(a=e.dg4)&&void 0!==a?a:"",dg5:null!==(s=e.dg5)&&void 0!==s?s:"",dg6:null!==(u=e.dg6)&&void 0!==u?u:"",dg7:null!==(c=e.dg7)&&void 0!==c?c:"",dg8:null!==(l=e.dg8)&&void 0!==l?l:"",dg9:null!==(d=e.dg9)&&void 0!==d?d:"",dg10:null!==(p=e.dg10)&&void 0!==p?p:"",dg11:null!==(f=e.dg11)&&void 0!==f?f:"",dg12:null!==(h=e.dg12)&&void 0!==h?h:"",dg13:null!==(m=e.dg13)&&void 0!==m?m:"",dg14:null!==(v=e.dg14)&&void 0!==v?v:"",dg15:null!==(y=e.dg15)&&void 0!==y?y:"",dg16:null!==(g=e.dg16)&&void 0!==g?g:"",sod:null!==(_=e.sod)&&void 0!==_?_:"",challenge:null!==(w=e.challenge)&&void 0!==w?w:"",aAResult:null!==(T=e.aAResult)&&void 0!==T?T:"",eACCAResult:null!==(b=e.eACCAResult)&&void 0!==b?b:""};n(E)}else n({})},fail:function(e){i(e)}},{timeout:!1})}))]}))}));return function(e,n){return t.apply(this,arguments)}}(),El=[si({type:ki.enum(["cccd"]),data:si({mrz:Kr().max(90)})})];function Sl(e){return Pl.apply(this,arguments)}function Pl(){return Pl=we((function(e){return Pe(this,(function(t){return[2,wn("scanNFC",El,[e],function(){var e=we((function(e){var t,n,r,i,o;return Pe(this,(function(a){switch(a.label){case 0:return Me.isMp?(n=Vt(),"android"===(r=((null===(t=Ne())||void 0===t?void 0:t.platformName)||"").toLowerCase())&&n<754||"ios"===r&&n<620?[2,Promise.reject(tn.error.clientNotSupport())]:(i=e.type,o=e.data,[4,bl(i,o)])):[3,2];case 1:return[2,a.sent()];case 2:return Me.isMpWeb?[2,Promise.resolve({})]:[2,Promise.reject(xe("scanNFC",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Pl.apply(this,arguments)}window.ZaloMiniAppSDK={getVersion:On},Tn();var Al=Object.freeze({__proto__:null,get Events(){return e.Events},get EventName(){return e.Events},get CameraEvents(){return e.CameraEvents},login:Tn,getAccessToken:En,getVersion:On,getSystemInfo:kn,setNavigationBarTitle:Ri,setNavigationBarColor:Di,setNavigationBarLeftButton:Bi,setStorage:po,getStorage:mo,getStorageInfo:yo,removeStorage:wo,clearStorage:Eo,getUserInfo:Oo,getNetworkType:No,onNetworkStatusChange:xo,startBeaconDiscovery:jo,stopBeaconDiscovery:Zo,getBeacons:Fo,closeApp:Vo,scanQRCode:qo,openProfile:Xo,openChat:ra,openPostFeed:ua,followOA:pa,unfollowOA:va,openShareSheet:Ta,requestCameraPermission:Sa,createShortcut:Ca,openBioAuthentication:xa,checkStateBioAuthentication:ja,showToast:za,hideKeyboard:Ga,openPhone:Ja,openSMS:Ya,viewOAQr:ns,keepScreen:as,onKeepScreen:us,offKeepScreen:ls,saveImageToGallery:hs,openMiniApp:gs,vibrate:bs,openWebview:As,getRouteParams:ks,getAppInfo:Cs,sendDataToPreviousMiniApp:xs,getPhoneNumber:js,openProfilePicker:zs,connectWifi:Hs,openMediaPicker:qs,getShareableLink:Ys,closeLoading:tu,requestUpdateZalo:ru,onConfirmToExit:su,offConfirmToExit:uu,getDeviceId:cu,getDeviceIdAsync:lu,getContext:pu,getContextAsync:fu,getAuthCode:mu,getZPIToken:yu,setAccessToken:wu,openOutApp:bu,chooseImage:Pu,getLocation:Iu,onCallbackData:Nu,createOrder:Uu,purchase:Zu,selectPaymentMethod:Gu,checkTransaction:Ku,events:ou,setAndroidBottomNavigationBar:Qu,setIOSBottomSafeArea:Xu,setStatusBar:nc,configAppView:oc,createOrderIAP:cc,minimizeApp:pc,openPermissionSetting:mc,favoriteApp:gc,openGroupList:Tc,requestSendNotification:Sc,addRating:Oc,interactOA:Rc,interactOa:Rc,isAllowedInteractWithOA:Dc,getSetting:Lc,authorize:Wc,checkZaloCameraPermission:Hc,getUserID:Kc,getIDToken:Qc,createCameraContext:rl,setupAd:ol,loadAd:ul,displayAd:dl,refreshAd:hl,showOAWidget:yl,showFunctionButtonWidget:wl,scanNFC:Sl,get FacingMode(){return e.FacingMode},get PhotoFormat(){return e.PhotoFormat},get PhotoQuality(){return e.PhotoQuality},get StreamType(){return e.StreamType},ZMACameraImp:el}),Ol=Uu,Il=Ku,kl=cc,Cl=Gu,Nl=Zu,Ml=t(Al,["createOrder","checkTransaction","createOrderIAP","selectPaymentMethod","purchase"]),Rl={createOrder:Ol,checkTransaction:Il,createOrderIAP:kl,selectPaymentMethod:Cl},xl={selectPaymentMethod:Cl,purchase:Nl};!function(){var e,t=null===(e=Ne())||void 0===e?void 0:e.appEnv;(null==t?void 0:t.isMp)&&(window.ZaloMiniAppSDK={},Object.assign(window.ZaloMiniAppSDK,Al))}(),e.CheckoutSDK=xl,e.EventName=e.Events,e.Payment=Rl,e.ZMACameraImp=el,e.addRating=Oc,e.authorize=Wc,e.checkStateBioAuthentication=ja,e.checkTransaction=Ku,e.checkZaloCameraPermission=Hc,e.chooseImage=Pu,e.clearStorage=Eo,e.closeApp=Vo,e.closeLoading=tu,e.configAppView=oc,e.connectWifi=Hs,e.createCameraContext=rl,e.createOrder=Uu,e.createOrderIAP=cc,e.createShortcut=Ca,e.default=Ml,e.displayAd=dl,e.events=ou,e.favoriteApp=gc,e.followOA=pa,e.getAccessToken=En,e.getAppInfo=Cs,e.getAuthCode=mu,e.getBeacons=Fo,e.getContext=pu,e.getContextAsync=fu,e.getDeviceId=cu,e.getDeviceIdAsync=lu,e.getIDToken=Qc,e.getLocation=Iu,e.getNetworkType=No,e.getPhoneNumber=js,e.getRouteParams=ks,e.getSetting=Lc,e.getShareableLink=Ys,e.getStorage=mo,e.getStorageInfo=yo,e.getSystemInfo=kn,e.getUserID=Kc,e.getUserInfo=Oo,e.getVersion=On,e.getZPIToken=yu,e.hideKeyboard=Ga,e.interactOA=Rc,e.interactOa=Rc,e.isAllowedInteractWithOA=Dc,e.keepScreen=as,e.loadAd=ul,e.login=Tn,e.minimizeApp=pc,e.offConfirmToExit=uu,e.offKeepScreen=ls,e.onCallbackData=Nu,e.onConfirmToExit=su,e.onKeepScreen=us,e.onNetworkStatusChange=xo,e.openBioAuthentication=xa,e.openChat=ra,e.openGroupList=Tc,e.openMediaPicker=qs,e.openMiniApp=gs,e.openOutApp=bu,e.openPermissionSetting=mc,e.openPhone=Ja,e.openPostFeed=ua,e.openProfile=Xo,e.openProfilePicker=zs,e.openSMS=Ya,e.openShareSheet=Ta,e.openWebview=As,e.purchase=Zu,e.refreshAd=hl,e.removeStorage=wo,e.requestCameraPermission=Sa,e.requestSendNotification=Sc,e.requestUpdateZalo=ru,e.saveImageToGallery=hs,e.scanNFC=Sl,e.scanQRCode=qo,e.selectPaymentMethod=Gu,e.sendDataToPreviousMiniApp=xs,e.setAccessToken=wu,e.setAndroidBottomNavigationBar=Qu,e.setIOSBottomSafeArea=Xu,e.setNavigationBarColor=Di,e.setNavigationBarLeftButton=Bi,e.setNavigationBarTitle=Ri,e.setStatusBar=nc,e.setStorage=po,e.setupAd=ol,e.showFunctionButtonWidget=wl,e.showOAWidget=yl,e.showToast=za,e.startBeaconDiscovery=jo,e.stopBeaconDiscovery=Zo,e.unfollowOA=va,e.vibrate=bs,e.viewOAQr=ns,Object.defineProperty(e,"__esModule",{value:!0})}));