zmp-sdk 2.44.3 → 2.45.0-beta.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/apis/apis/payment/checkTransaction.js +1 -1
- package/apis/apis/payment/index.js +1 -1
- package/apis/common/apis/general/payment/checkTransaction.js +1 -1
- package/apis/common/apis/general/payment/createOrder.js +1 -1
- package/apis/common/apis/general/payment/utils.js +1 -0
- package/apis/common/eventEmitter.js +1 -1
- package/apis/constants.js +1 -1
- package/apis/index.d.ts +63 -4
- package/apis/package.json.js +1 -1
- package/apis/types/enum.js +1 -1
- package/browser.min.js +2 -2
- package/index.d.ts +67 -4
- package/index.es.js +2 -2
- package/index.js +2 -2
- package/index.umd.js +3 -3
- package/package.json +1 -1
package/index.umd.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @timeBuild
|
|
2
|
+
* @timeBuild 31-03-2025 11:04:47
|
|
3
3
|
* @license zmp-sdk
|
|
4
4
|
*
|
|
5
5
|
* Copyright @ 2025. 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,T,b,E,S,P,I,A,O,k,N,C,M,R,x,D=0,U=-2e3,L=-1400,j=-1500,B=-1401,Z=-1404,z=-1408,W=-1409,F=-2004,V=-2005,G=-2006,H=-2007,K="Success",J="Unknown error. Please try again later.",q="Request limit exceeded. Please try again later.",Q="Request timeout. Please try again later.",$="Please login (https://miniapp.zalo.me/docs/api/login) before to call this api",Y="Login failed",X="This API is not supported in this version of Zalo",ee="User Authentication Required. Please grant User Authentication permission before requesting User Permission",te="Unable to pick media",ne="Unable to save image",re="Unable to save video",ie="Unable to save file",oe={SUCCESS:{code:D,message:K},UNKNOWN_ERROR:{code:U,message:J},UNAUTHORIZED:{code:B,message:$},FORBIDDEN:{code:-1403,message:"You don't have permission to call this api"},CLIENT_NOT_SUPPORT:{code:Z,message:X},DECODE_FAILED:{code:-2001,message:"Can not decode id. Please check your params again."},TIME_OUT:{code:z,message:Q},USER_DENIED:{code:-2002,message:"User denied"},USER_CANCEL:{code:-2003,message:"User cancel"},DUPLICATE_REQUEST:{code:-1410,message:"Duplicate request. Please try again later."},DEVICE_NOT_SUPPORT:{code:-600,message:"This device does not support NFC"},SERVICE_NOT_READY:{code:-602,message:"NFC service is not ready. Please check in your setting"},UNREADABLE:{code:-603,message:"NFC tag is unreadable"},INVALID_MRZ:{code:-604,message:"Invalid MRZ data. Please try again later."},PROCESSING:{code:-605,message:"Processing NFC tag. Please wait a moment."},CANCEL:{code:-606,message:"User cancel"},SCAN_TIMEOUT:{code:-601,message:"NFC scan timeout. Please try again later."},MPDS_ACTION_INVALID:{code:-3e3,message:"Action name from input data does not match declared API actions"},MPDS_SOURCE_INVALID:{code:-3005,message:"This API not called from Mini App"},MPDS_APPID_INVALID:{code:-3006,message:"AppId from input data does not match the currently opened AppId"}},ae={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:{}},se={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:oe.DUPLICATE_REQUEST}},iOS:{"-400":{mapTo:oe.DUPLICATE_REQUEST}}}},UNFOLLOW_OA:{haveCallback:!0,requireAccessToken:!0,errorList:{android:{"-400":{mapTo:oe.DUPLICATE_REQUEST}},iOS:{"-400":{mapTo:oe.DUPLICATE_REQUEST}}}},OPEN_GAMEDETAIL:{},OPEN_SHARESHEET:{haveCallback:!0,requireAccessToken:!0,errorList:{android:{"-101":{mapTo:oe.CLIENT_NOT_SUPPORT}},iOS:{"-101":{mapTo:oe.CLIENT_NOT_SUPPORT}}}},REQUEST_PERMISSION_CAMERA:{errorList:{android:{"-2":{mapTo:oe.USER_DENIED}},iOS:{"-2":{mapTo:oe.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:oe.USER_DENIED},"-400":{mapTo:oe.DUPLICATE_REQUEST}},iOS:{"-1":{mapTo:oe.USER_DENIED},"-400":{mapTo:oe.DUPLICATE_REQUEST}}}},QUERY_LOCATION_HIDE:{haveCallback:!0},SHOW_TOAST:{haveCallback:!0,timeout:2},OPEN_APP:{},HIDE_KEYBOARD:{},OPEN_PHONE:{},OPEN_QR:{},OPEN_SMS:{},VIEW_MYQR:{haveCallback:!0,timeout:!0,requireAccessToken:!0},KEEP_SCREEN:{haveCallback:!0,timeout:2},CHANGE_AUTOROTATE:{skipJump:!0},CHECK_APP_INSTALLED:{},QUERY_SHOW:{},QUERY_HIDE:{},OPEN_INAPPRW:{},ZALORUN_GETTRACKINGSTATUS:{haveCallback:!0},ZALORUN_SETTRACKINGSTATUS:{haveCallback:!0},ZALORUN_GETDAYSTEP:{haveCallback:!0},ZALORUN_FORCESUBMITDATA:{haveCallback:!0},ZALORUN_SETWEIGHT:{haveCallback:!0},OPEN_PROFILE_EXT:{},DOWNLOAD_CATE:{haveCallback:!0},JUMP_LOGIN:{skipJump:!0,whiteList:!0},OPEN_ADTIMA_ADS_INTERSTITIAL:{},OPEN_ADTIMA_ADS:{},GET_ADIDCLIENT:{},SCAN_IBEACON:{},SAVE_VIDEO_GALLERY:{versionLive:{iOS:628},errorList:{android:{"-101":{mapTo:{code:G,message:re},needMoreDetail:!0},"-102":{mapTo:{code:G,message:re},needMoreDetail:!0}},iOS:{"-10":{mapTo:{code:G,message:re},needMoreDetail:!0}}}},INTERACTIVE_VIBRATION:{},SAVE_IMAGE_GALLERY:{versionLive:{iOS:408},errorList:{android:{"-101":{mapTo:{code:V,message:ne},needMoreDetail:!0},"-102":{mapTo:{code:V,message:ne},needMoreDetail:!0}},iOS:{"-10":{mapTo:{code:V,message:ne},needMoreDetail:!0}}}},OPEN_MP:{versionLive:{iOS:402}},CHANGE_ACTIONBAR:{haveCallback:!0,timeout:2,versionLive:{iOS:402},skipJump:!0},ZBROWSER_MPDS:{haveCallback:!0,timeout:2,versionLive:{iOS:402},errorList:{android:{"-100":{mapTo:oe.MPDS_ACTION_INVALID},"-101":{mapTo:oe.UNKNOWN_ERROR},"-105":{mapTo:oe.MPDS_SOURCE_INVALID},"-106":{mapTo:oe.MPDS_APPID_INVALID}},iOS:{"-10":{mapTo:oe.MPDS_ACTION_INVALID},"-101":{mapTo:oe.MPDS_APPID_INVALID},"-102":{mapTo:oe.UNKNOWN_ERROR}}}},ZBROWSER_MPDS_SYNC:{versionLive:{iOS:402},errorList:{android:{"-100":{mapTo:oe.MPDS_ACTION_INVALID},"-101":{mapTo:oe.UNKNOWN_ERROR},"-105":{mapTo:oe.MPDS_SOURCE_INVALID},"-106":{mapTo:oe.MPDS_APPID_INVALID}},iOS:{"-10":{mapTo:oe.MPDS_ACTION_INVALID},"-101":{mapTo:oe.MPDS_APPID_INVALID},"-102":{mapTo:oe.UNKNOWN_ERROR}}}},WEBVIEW_SET_RESULT:{versionLive:{iOS:416}},MP_GET_NUMBER:{versionLive:{iOS:416},errorList:{android:{"-1":{mapTo:oe.USER_DENIED},"-101":{mapTo:oe.USER_DENIED},"-400":{mapTo:oe.DUPLICATE_REQUEST}},iOS:{"-1":{mapTo:oe.USER_DENIED},"-10":{mapTo:oe.USER_DENIED},"-400":{mapTo:oe.DUPLICATE_REQUEST}}}},MP_OPEN_PROFILE_PICKER:{requireAccessToken:!0,versionLive:{iOS:432},errorList:{android:{"-101":{mapTo:oe.USER_CANCEL}},iOS:{"-101":{mapTo:oe.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:oe.USER_CANCEL},999:{mapTo:{code:F,message:te},needMoreDetail:!0}},iOS:{"-10":{mapTo:{code:F,message:te}}}}},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:oe.USER_DENIED},"-400":{mapTo:oe.DUPLICATE_REQUEST}},iOS:{"-1":{mapTo:oe.USER_DENIED},"-400":{mapTo:oe.DUPLICATE_REQUEST}}}},MP_ADD_RATING:{skipJump:!1},MP_ADD_MYFAVORITES:{skipJump:!1},MP_INTERACT_OA:{skipJump:!1,errorList:{android:{"-400":{mapTo:oe.DUPLICATE_REQUEST}},iOS:{"-400":{mapTo:oe.DUPLICATE_REQUEST}}}},MP_USER_AUTHORIZE:{skipJump:!1,errorList:{android:{"-400":{mapTo:oe.DUPLICATE_REQUEST}},iOS:{"-400":{mapTo:oe.DUPLICATE_REQUEST}}}},MP_SELECT_PAYMENT_METHOD:{skipJump:!1},CHECK_NFC:{skipJump:!1,versionLive:{iOS:626},errorList:{all:{"-1":{mapTo:oe.UNKNOWN_ERROR},"-600":{mapTo:oe.DEVICE_NOT_SUPPORT},"-602":{mapTo:oe.SERVICE_NOT_READY}}}},SCAN_NFC:{skipJump:!1,haveCallback:!0,timeout:65,errorList:{all:{"-1":{mapTo:oe.UNKNOWN_ERROR},"-600":{mapTo:oe.DEVICE_NOT_SUPPORT},"-601":{mapTo:oe.SCAN_TIMEOUT},"-602":{mapTo:oe.SERVICE_NOT_READY},"-603":{mapTo:oe.UNREADABLE},"-604":{mapTo:oe.INVALID_MRZ},"-605":{mapTo:oe.PROCESSING},"-606":{mapTo:oe.CANCEL}}}},MP_CONFIRM_REQUEST_PAYMENT:{skipJump:!1},SAVE_FILE:{versionLive:{iOS:628},skipJump:!1,errorList:{android:{"-101":{mapTo:{code:H,message:ie},needMoreDetail:!0},"-102":{mapTo:{code:H,message:ie},needMoreDetail:!0}},iOS:{"-10":{mapTo:{code:H,message:ie},needMoreDetail:!0}}}},MP_APP_LIFECYCLE_TRACKING:{skipJump:!1}},ue={android:{"-4":oe.DECODE_FAILED,"-5":oe.CLIENT_NOT_SUPPORT,"-14":oe.TIME_OUT},iOS:{"-9":oe.DECODE_FAILED,"-5":oe.CLIENT_NOT_SUPPORT,"-14":oe.TIME_OUT}},ce={android:12100615,iOS:460,wp:0,unknown:0},le=5*r,de="https://payment-mini.zalo.me/api/order/create",pe="https://payment-mini.zalo.me/api/order/iap-create",fe="https://payment-mini.zalo.me/api/transaction",he="https://payment-mini.zalo.me/api/order/purchase",me="DEFERRED",ve="IMMEDIATE_AND_CHARGE_FULL_PRICE",ye={SHOW_BACK:0,HIDE_BACK:3,SHOW_HOME:1,HIDE_HOME:0},ge=5,_e=6,we="#1843EF",Te=0,be={"-12101":"Invalid params","-12102":"Session expire","-12103":"Not permission","-12104":"Not Authorize","-12105":"Unknown exception","-12106":"Cannot create order","-12107":"Transaction not found","-12108":"Cannot update order","-12109":"Cannot decode param","-12110":"Version not support","-12111":"Receipt expire","-12112":"Product not found","-12113":"Subscription other GW","-12114":"Product already subcription","-12115":"Not exist","-12116":"Already exist","-12117":"Not allow","-12118":"Not permit","-12119":"Internal error","-2":"Unable to pay","-6":"Unable to register","-7":"Registered account","-832":"Purchased by another account","-833":"Register for another account","-834":"Unable to register","-2010":"System is maintaining","-3999":"Not in Vietnam","-12129":"Purchased by another account",123:"An error has occurred"};function Ee(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 Se(e){return function(){var t=this,n=arguments;return new Promise((function(r,i){var o=e.apply(t,n);function a(e){Ee(o,r,i,a,s,"next",e)}function s(e){Ee(o,r,i,a,s,"throw",e)}a(void 0)}))}}function Pe(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 Ie(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function Ae(e,t){if(e){if("string"==typeof e)return Pe(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)?Pe(e,t):void 0}}function Oe(e){return function(e){if(Array.isArray(e))return Pe(e)}(e)||Ie(e)||Ae(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 ke(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 Ne(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,Oe(n))}catch(e){return"undefined"!=typeof console&&console.error&&console.error(e),null}}}function Ce(e){var t=new URL(window.location.href).searchParams.get("env");return{isMp:window.location.hostname.includes(u)&&("TESTING_LOCAL"==t||window.location.pathname.startsWith(c)),isMpWeb:window.location.hostname.includes("localhost")}}Ne.async=function(e){return Se((function(){var t,n,r,i,o=arguments;return ke(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,Oe(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",h.DownloadProgress="h5.event.webview.download.progress",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.multi_image=2]="multi_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,(I=e.StatusBarType||(e.StatusBarType={}))[I.normal=1]="normal",I[I.hidden=0]="hidden",I[I.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,(k=e.TextAlignType||(e.TextAlignType={}))[k.left=0]="left",k[k.center=1]="center",e.CameraEvents=void 0,(N=e.CameraEvents||(e.CameraEvents={})).OnFrameCallback="h5.event.camera.frame",N.OnStartCallback="h5.event.camera.start",N.OnStopCallback="h5.event.camera.stop",e.FacingMode=void 0,(C=e.FacingMode||(e.FacingMode={})).FRONT="user",C.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 Me,Re=function(t){return t.isAndroid?e.PlatformType.android:t.isIOS?e.PlatformType.iOS:e.PlatformType.unknown};function xe(e){var t=e.split("zalo")[1];return t&&t.replace(" ","").split("/")[1]||""}function De(){var e=function(){var e=Ne((function(){return window.navigator.userAgent.toLowerCase()}))();if(e){var t=function(e){return{isAndroid:/android/i.test(e)&&!/iemobile/.test(e),isIOS:/iphone|ios|ipad|ipod/.test(e)&&!/iemobile/.test(e),isMobile:/android|iphone|ios|ipad|ipod|iemobile/.test(e),isZalo:/zalo/.test(e)}}(e);return{appEnv:Ce(),platform:t,platformName:Re(t),zaloVersion:xe(e).trim()}}}();if(e)return e}var Ue=(null===(Me=De())||void 0===Me?void 0:Me.appEnv)||{};function Le(e){Le.on&&Le.engine(e)}Le.on=!1,Le.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 je=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),Le({stage:n.NOT_FOUND,type:"error",name:e,request:t,state:"fail",response:i})};function Be(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Ze(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){Be(e,t,n[t])}))}return e}function ze(e,t){return function(e){if(Array.isArray(e))return e}(e)||Ie(e)||Ae(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 We="undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{};function Fe(){throw new Error("setTimeout has not been defined")}function Ve(){throw new Error("clearTimeout has not been defined")}var Ge=Fe,He=Ve;function Ke(e){if(Ge===setTimeout)return setTimeout(e,0);if((Ge===Fe||!Ge)&&setTimeout)return Ge=setTimeout,setTimeout(e,0);try{return Ge(e,0)}catch(t){try{return Ge.call(null,e,0)}catch(t){return Ge.call(this,e,0)}}}"function"==typeof We.setTimeout&&(Ge=setTimeout),"function"==typeof We.clearTimeout&&(He=clearTimeout);var Je,qe=[],Qe=!1,$e=-1;function Ye(){Qe&&Je&&(Qe=!1,Je.length?qe=Je.concat(qe):$e=-1,qe.length&&Xe())}function Xe(){if(!Qe){var e=Ke(Ye);Qe=!0;for(var t=qe.length;t;){for(Je=qe,qe=[];++$e<t;)Je&&Je[$e].run();$e=-1,t=qe.length}Je=null,Qe=!1,function(e){if(He===clearTimeout)return clearTimeout(e);if((He===Ve||!He)&&clearTimeout)return He=clearTimeout,clearTimeout(e);try{He(e)}catch(t){try{return He.call(null,e)}catch(t){return He.call(this,e)}}}(e)}}function et(e,t){this.fun=e,this.array=t}et.prototype.run=function(){this.fun.apply(null,this.array)};function tt(){}var nt=tt,rt=tt,it=tt,ot=tt,at=tt,st=tt,ut=tt;var ct=We.performance||{},lt=ct.now||ct.mozNow||ct.msNow||ct.oNow||ct.webkitNow||function(){return(new Date).getTime()};var dt=new Date;var pt,ft={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];qe.push(new et(e,t)),1!==qe.length||Qe||Ke(Xe)},title:"browser",browser:!0,env:{},argv:[],version:"",versions:{},on:nt,addListener:rt,once:it,off:ot,removeListener:at,removeAllListeners:st,emit:ut,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*lt.call(ct),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-dt)/1e3}},ht=ft,mt="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function vt(e){return e&&e.constructor===Symbol?"symbol":typeof e}function yt(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 mt?mt:"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 ht&&ht.env&&"true"===ht.env.REFLECT_METADATA_USE_MAP_POLYFILL,d=l||"function"!=typeof Map||"function"!=typeof Map.prototype.entries?ee():Map,p=l||"function"!=typeof Set||"function"!=typeof Set.prototype.entries?te():Set,f=new(l||"function"!=typeof WeakMap?ne():WeakMap);function h(e,t,n,r){if(D(n)){if(!V(e))throw new TypeError;if(!H(t))throw new TypeError;return S(e,t)}if(!V(e))throw new TypeError;if(!j(t))throw new TypeError;if(!j(r)&&!D(r)&&!U(r))throw new TypeError;return U(r)&&(r=void 0),P(e,t,n=F(n),r)}function m(e,t){function n(n,r){if(!j(n))throw new TypeError;if(!D(r)&&!K(r))throw new TypeError;C(e,t,n,r)}return n}function v(e,t,n,r){if(!j(n))throw new TypeError;return D(r)||(r=F(r)),C(e,t,n,r)}function y(e,t,n){if(!j(t))throw new TypeError;return D(n)||(n=F(n)),A(e,t,n)}function g(e,t,n){if(!j(t))throw new TypeError;return D(n)||(n=F(n)),O(e,t,n)}function _(e,t,n){if(!j(t))throw new TypeError;return D(n)||(n=F(n)),k(e,t,n)}function w(e,t,n){if(!j(t))throw new TypeError;return D(n)||(n=F(n)),N(e,t,n)}function T(e,t){if(!j(e))throw new TypeError;return D(t)||(t=F(t)),M(e,t)}function b(e,t){if(!j(e))throw new TypeError;return D(t)||(t=F(t)),R(e,t)}function E(e,t,n){if(!j(t))throw new TypeError;D(n)||(n=F(n));var r=I(t,n,!1);if(D(r))return!1;if(!r.delete(e))return!1;if(r.size>0)return!0;var i=f.get(t);return i.delete(n),i.size>0||f.delete(t),!0}function S(e,t){for(var n=e.length-1;n>=0;--n){var r=(0,e[n])(t);if(!D(r)&&!U(r)){if(!H(r))throw new TypeError;t=r}}return t}function P(e,t,n,r){for(var i=e.length-1;i>=0;--i){var o=(0,e[i])(t,n,r);if(!D(o)&&!U(o)){if(!j(o))throw new TypeError;r=o}}return r}function I(e,t,n){var r=f.get(e);if(D(r)){if(!n)return;r=new d,f.set(e,r)}var i=r.get(t);if(D(i)){if(!n)return;i=new d,r.set(t,i)}return i}function A(e,t,n){if(O(e,t,n))return!0;var r=X(t);return!U(r)&&A(e,r,n)}function O(e,t,n){var r=I(t,n,!1);return!D(r)&&z(r.has(e))}function k(e,t,n){if(O(e,t,n))return N(e,t,n);var r=X(t);return U(r)?void 0:k(e,r,n)}function N(e,t,n){var r=I(t,n,!1);if(!D(r))return r.get(e)}function C(e,t,n,r){I(n,r,!0).set(e,t)}function M(e,t){var n=R(e,t),r=X(e);if(null===r)return n;var i=M(r,t);if(i.length<=0)return n;if(n.length<=0)return i;for(var o=new p,a=[],s=0,u=n;s<u.length;s++){var c=u[s];o.has(c)||(o.add(c),a.push(c))}for(var l=0,d=i;l<d.length;l++){c=d[l];o.has(c)||(o.add(c),a.push(c))}return a}function R(e,t){var n=[],r=I(e,t,!1);if(D(r))return n;for(var i=q(r.keys()),o=0;;){var a=$(i);if(!a)return n.length=o,n;var s=Q(a);try{n[o]=s}catch(e){try{Y(i)}finally{throw e}}o++}}function x(e){if(null===e)return 1;switch(typeof e){case"undefined":return 0;case"boolean":return 2;case"string":return 3;case"symbol":return 4;case"number":return 5;case"object":return null===e?1:6;default:return 6}}function D(e){return void 0===e}function U(e){return null===e}function L(e){return"symbol"==typeof e}function j(e){return"object"==typeof e?null!==e:"function"==typeof e}function B(e,t){switch(x(e)){case 0:case 1:case 2:case 3:case 4:case 5:return e}var n=3===t?"string":5===t?"number":"default",i=J(e,r);if(void 0!==i){var o=i.call(e,n);if(j(o))throw new TypeError;return o}return Z(e,"default"===n?"number":n)}function Z(e,t){if("string"===t){var n=e.toString;if(G(n))if(!j(i=n.call(e)))return i;if(G(r=e.valueOf))if(!j(i=r.call(e)))return i}else{var r;if(G(r=e.valueOf))if(!j(i=r.call(e)))return i;var i,o=e.toString;if(G(o))if(!j(i=o.call(e)))return i}throw new TypeError}function z(e){return!!e}function W(e){return""+e}function F(e){var t=B(e,3);return L(t)?t:W(t)}function V(e){return Array.isArray?Array.isArray(e):e instanceof Object?e instanceof Array:"[object Array]"===Object.prototype.toString.call(e)}function G(e){return"function"==typeof e}function H(e){return"function"==typeof e}function K(e){switch(x(e)){case 3:case 4:return!0;default:return!1}}function J(e,t){var n=e[t];if(null!=n){if(!G(n))throw new TypeError;return n}}function q(e){var t=J(e,i);if(!G(t))throw new TypeError;var n=t.call(e);if(!j(n))throw new TypeError;return n}function Q(e){return e.value}function $(e){var t=e.next();return!t.done&&t}function Y(e){var t=e.return;t&&t.call(e)}function X(e){var t=Object.getPrototypeOf(e);if("function"!=typeof e||e===c)return t;if(t!==c)return t;var n=e.prototype,r=n&&Object.getPrototypeOf(n);if(null==r||r===Object.prototype)return t;var i=r.constructor;return"function"!=typeof i||i===e?t:i}function ee(){var e={},t=[],n=function(){function e(e,t,n){this._index=0,this._keys=e,this._values=t,this._selector=n}return e.prototype["@@iterator"]=function(){return this},e.prototype[i]=function(){return this},e.prototype.next=function(){var e=this._index;if(e>=0&&e<this._keys.length){var n=this._selector(this._keys[e],this._values[e]);return e+1>=this._keys.length?(this._index=-1,this._keys=t,this._values=t):this._index++,{value:n,done:!1}}return{value:void 0,done:!0}},e.prototype.throw=function(e){throw this._index>=0&&(this._index=-1,this._keys=t,this._values=t),e},e.prototype.return=function(e){return this._index>=0&&(this._index=-1,this._keys=t,this._values=t),{value:e,done:!0}},e}();return function(){function t(){this._keys=[],this._values=[],this._cacheKey=e,this._cacheIndex=-2}return Object.defineProperty(t.prototype,"size",{get:function(){return this._keys.length},enumerable:!0,configurable:!0}),t.prototype.has=function(e){return this._find(e,!1)>=0},t.prototype.get=function(e){var t=this._find(e,!1);return t>=0?this._values[t]:void 0},t.prototype.set=function(e,t){var n=this._find(e,!0);return this._values[n]=t,this},t.prototype.delete=function(t){var n=this._find(t,!1);if(n>=0){for(var r=this._keys.length,i=n+1;i<r;i++)this._keys[i-1]=this._keys[i],this._values[i-1]=this._values[i];return this._keys.length--,this._values.length--,t===this._cacheKey&&(this._cacheKey=e,this._cacheIndex=-2),!0}return!1},t.prototype.clear=function(){this._keys.length=0,this._values.length=0,this._cacheKey=e,this._cacheIndex=-2},t.prototype.keys=function(){return new n(this._keys,this._values,r)},t.prototype.values=function(){return new n(this._keys,this._values,o)},t.prototype.entries=function(){return new n(this._keys,this._values,a)},t.prototype["@@iterator"]=function(){return this.entries()},t.prototype[i]=function(){return this.entries()},t.prototype._find=function(e,t){return this._cacheKey!==e&&(this._cacheIndex=this._keys.indexOf(this._cacheKey=e)),this._cacheIndex<0&&t&&(this._cacheIndex=this._keys.length,this._keys.push(e),this._values.push(void 0)),this._cacheIndex},t}();function r(e,t){return e}function o(e,t){return t}function a(e,t){return[e,t]}}function te(){return function(){function e(){this._map=new d}return Object.defineProperty(e.prototype,"size",{get:function(){return this._map.size},enumerable:!0,configurable:!0}),e.prototype.has=function(e){return this._map.has(e)},e.prototype.add=function(e){return this._map.set(e,e),this},e.prototype.delete=function(e){return this._map.delete(e)},e.prototype.clear=function(){this._map.clear()},e.prototype.keys=function(){return this._map.keys()},e.prototype.values=function(){return this._map.values()},e.prototype.entries=function(){return this._map.entries()},e.prototype["@@iterator"]=function(){return this.keys()},e.prototype[i]=function(){return this.keys()},e}()}function ne(){var e=16,n=u.create(),r=i();return function(){function e(){this._key=i()}return e.prototype.has=function(e){var t=o(e,!1);return void 0!==t&&u.has(t,this._key)},e.prototype.get=function(e){var t=o(e,!1);return void 0!==t?u.get(t,this._key):void 0},e.prototype.set=function(e,t){return o(e,!0)[this._key]=t,this},e.prototype.delete=function(e){var t=o(e,!1);return void 0!==t&&delete t[this._key]},e.prototype.clear=function(){this._key=i()},e}();function i(){var e;do{e="@@WeakMap@@"+c()}while(u.has(n,e));return n[e]=!0,e}function o(e,n){if(!t.call(e,r)){if(!n)return;Object.defineProperty(e,r,{value:u.create()})}return e[r]}function a(e,t){for(var n=0;n<t;++n)e[n]=255*Math.random()|0;return e}function s(e){return"function"==typeof Uint8Array?"undefined"!=typeof crypto?crypto.getRandomValues(new Uint8Array(e)):"undefined"!=typeof msCrypto?msCrypto.getRandomValues(new Uint8Array(e)):a(new Uint8Array(e),e):a(new Array(e),e)}function c(){var t=s(e);t[6]=79&t[6]|64,t[8]=191&t[8]|128;for(var n="",r=0;r<e;++r){var i=t[r];4!==r&&6!==r&&8!==r||(n+="-"),i<16&&(n+="0"),n+=i.toString(16).toLowerCase()}return n}}function re(e){return e.__=void 0,delete e.__,e}e("decorate",h),e("metadata",m),e("defineMetadata",v),e("hasMetadata",y),e("hasOwnMetadata",g),e("getMetadata",_),e("getOwnMetadata",w),e("getMetadataKeys",T),e("getOwnMetadataKeys",b),e("deleteMetadata",E)}(r)}()}(pt||(pt={}));var gt=Object.prototype.toString;var _t="[object Null]",wt="[object Undefined]";function Tt(e){return null==e?void 0===e?wt:_t:function(e){return gt.call(e)}(e)}function bt(e){return null!=e&&"object"==typeof e}var Et={isEmpty:function(e){return null==e||"object"==typeof e&&0===Object.keys(e).length||"string"==typeof e&&0===e.trim().length},isNull:function(e){return null===e},isUndefined:function(e){return void 0===e},isFunction:function(e){return"function"==typeof e},isObject:function(e){return null!==e&&("function"==typeof e||"object"==typeof e)},isString:function(e){return null!=e&&"string"==typeof e.valueOf()},isNumber:function(e){return"number"==typeof e||bt(e)&&"[object Number]"==Tt(e)},isArray:function(e){return Array.isArray(e)},isRegExp:function(e){return bt(e)&&"[object RegExp]"==Tt(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 St(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Pt(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 It(e){return It=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},It(e)}function At(e){return It(e)}function Ot(e,t,n){return Ot="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=At(e)););return e}(e,t);if(r){var i=Object.getOwnPropertyDescriptor(r,t);return i.get?i.get.call(n||e):i.value}},Ot(e,t,n)}function kt(e,t,n){return Ot(e,t,n)}function Nt(e,t){return Nt=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},Nt(e,t)}function Ct(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Nt(e,t)}function Mt(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Rt(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=At(e);if(t){var i=At(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return function(e,t){return!t||"object"!==vt(t)&&"function"!=typeof t?Mt(e):t}(this,n)}}var xt=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,I,A,O,k,N,C,M,R,x,D=0,U=-2e3,L=-1400,j=-1500,B=-1401,Z=-1404,z=-1408,W=-1409,F=-2004,V=-2005,G=-2006,H=-2007,K="Success",J="Unknown error. Please try again later.",q="Request limit exceeded. Please try again later.",Q="Request timeout. Please try again later.",$="Please login (https://miniapp.zalo.me/docs/api/login) before to call this api",Y="Login failed",X="This API is not supported in this version of Zalo",ee="User Authentication Required. Please grant User Authentication permission before requesting User Permission",te="Unable to pick media",ne="Unable to save image",re="Unable to save video",ie="Unable to save file",oe={SUCCESS:{code:D,message:K},UNKNOWN_ERROR:{code:U,message:J},UNAUTHORIZED:{code:B,message:$},FORBIDDEN:{code:-1403,message:"You don't have permission to call this api"},CLIENT_NOT_SUPPORT:{code:Z,message:X},DECODE_FAILED:{code:-2001,message:"Can not decode id. Please check your params again."},TIME_OUT:{code:z,message:Q},USER_DENIED:{code:-2002,message:"User denied"},USER_CANCEL:{code:-2003,message:"User cancel"},DUPLICATE_REQUEST:{code:-1410,message:"Duplicate request. Please try again later."},DEVICE_NOT_SUPPORT:{code:-600,message:"This device does not support NFC"},SERVICE_NOT_READY:{code:-602,message:"NFC service is not ready. Please check in your setting"},UNREADABLE:{code:-603,message:"NFC tag is unreadable"},INVALID_MRZ:{code:-604,message:"Invalid MRZ data. Please try again later."},PROCESSING:{code:-605,message:"Processing NFC tag. Please wait a moment."},CANCEL:{code:-606,message:"User cancel"},SCAN_TIMEOUT:{code:-601,message:"NFC scan timeout. Please try again later."},MPDS_ACTION_INVALID:{code:-3e3,message:"Action name from input data does not match declared API actions"},MPDS_SOURCE_INVALID:{code:-3005,message:"This API not called from Mini App"},MPDS_APPID_INVALID:{code:-3006,message:"AppId from input data does not match the currently opened AppId"}},ae={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:{}},se={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:oe.DUPLICATE_REQUEST}},iOS:{"-400":{mapTo:oe.DUPLICATE_REQUEST}}}},UNFOLLOW_OA:{haveCallback:!0,requireAccessToken:!0,errorList:{android:{"-400":{mapTo:oe.DUPLICATE_REQUEST}},iOS:{"-400":{mapTo:oe.DUPLICATE_REQUEST}}}},OPEN_GAMEDETAIL:{},OPEN_SHARESHEET:{haveCallback:!0,requireAccessToken:!0,errorList:{android:{"-101":{mapTo:oe.CLIENT_NOT_SUPPORT}},iOS:{"-101":{mapTo:oe.CLIENT_NOT_SUPPORT}}}},REQUEST_PERMISSION_CAMERA:{errorList:{android:{"-2":{mapTo:oe.USER_DENIED}},iOS:{"-2":{mapTo:oe.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:oe.USER_DENIED},"-400":{mapTo:oe.DUPLICATE_REQUEST}},iOS:{"-1":{mapTo:oe.USER_DENIED},"-400":{mapTo:oe.DUPLICATE_REQUEST}}}},QUERY_LOCATION_HIDE:{haveCallback:!0},SHOW_TOAST:{haveCallback:!0,timeout:2},OPEN_APP:{},HIDE_KEYBOARD:{},OPEN_PHONE:{},OPEN_QR:{},OPEN_SMS:{errorList:{iOS:{"-9":{mapTo:oe.UNKNOWN_ERROR},"-10":{mapTo:oe.USER_CANCEL}}}},VIEW_MYQR:{haveCallback:!0,timeout:!0,requireAccessToken:!0},KEEP_SCREEN:{haveCallback:!0,timeout:2},CHANGE_AUTOROTATE:{skipJump:!0},CHECK_APP_INSTALLED:{},QUERY_SHOW:{},QUERY_HIDE:{},OPEN_INAPPRW:{},ZALORUN_GETTRACKINGSTATUS:{haveCallback:!0},ZALORUN_SETTRACKINGSTATUS:{haveCallback:!0},ZALORUN_GETDAYSTEP:{haveCallback:!0},ZALORUN_FORCESUBMITDATA:{haveCallback:!0},ZALORUN_SETWEIGHT:{haveCallback:!0},OPEN_PROFILE_EXT:{},DOWNLOAD_CATE:{haveCallback:!0},JUMP_LOGIN:{skipJump:!0,whiteList:!0},OPEN_ADTIMA_ADS_INTERSTITIAL:{},OPEN_ADTIMA_ADS:{},GET_ADIDCLIENT:{},SCAN_IBEACON:{},SAVE_VIDEO_GALLERY:{versionLive:{iOS:628},errorList:{android:{"-101":{mapTo:{code:G,message:re},needMoreDetail:!0},"-102":{mapTo:{code:G,message:re},needMoreDetail:!0}},iOS:{"-10":{mapTo:{code:G,message:re},needMoreDetail:!0}}}},INTERACTIVE_VIBRATION:{},SAVE_IMAGE_GALLERY:{versionLive:{iOS:408},errorList:{android:{"-101":{mapTo:{code:V,message:ne},needMoreDetail:!0},"-102":{mapTo:{code:V,message:ne},needMoreDetail:!0}},iOS:{"-10":{mapTo:{code:V,message:ne},needMoreDetail:!0}}}},OPEN_MP:{versionLive:{iOS:402}},CHANGE_ACTIONBAR:{haveCallback:!0,timeout:2,versionLive:{iOS:402},skipJump:!0},ZBROWSER_MPDS:{haveCallback:!0,timeout:2,versionLive:{iOS:402},errorList:{android:{"-100":{mapTo:oe.MPDS_ACTION_INVALID},"-101":{mapTo:oe.UNKNOWN_ERROR},"-105":{mapTo:oe.MPDS_SOURCE_INVALID},"-106":{mapTo:oe.MPDS_APPID_INVALID}},iOS:{"-10":{mapTo:oe.MPDS_ACTION_INVALID},"-101":{mapTo:oe.MPDS_APPID_INVALID},"-102":{mapTo:oe.UNKNOWN_ERROR}}}},ZBROWSER_MPDS_SYNC:{versionLive:{iOS:402},errorList:{android:{"-100":{mapTo:oe.MPDS_ACTION_INVALID},"-101":{mapTo:oe.UNKNOWN_ERROR},"-105":{mapTo:oe.MPDS_SOURCE_INVALID},"-106":{mapTo:oe.MPDS_APPID_INVALID}},iOS:{"-10":{mapTo:oe.MPDS_ACTION_INVALID},"-101":{mapTo:oe.MPDS_APPID_INVALID},"-102":{mapTo:oe.UNKNOWN_ERROR}}}},WEBVIEW_SET_RESULT:{versionLive:{iOS:416}},MP_GET_NUMBER:{versionLive:{iOS:416},errorList:{android:{"-1":{mapTo:oe.USER_DENIED},"-101":{mapTo:oe.USER_DENIED},"-400":{mapTo:oe.DUPLICATE_REQUEST}},iOS:{"-1":{mapTo:oe.USER_DENIED},"-10":{mapTo:oe.USER_DENIED},"-400":{mapTo:oe.DUPLICATE_REQUEST}}}},MP_OPEN_PROFILE_PICKER:{requireAccessToken:!0,versionLive:{iOS:432},errorList:{android:{"-101":{mapTo:oe.USER_CANCEL}},iOS:{"-101":{mapTo:oe.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:oe.USER_CANCEL},999:{mapTo:{code:F,message:te},needMoreDetail:!0}},iOS:{"-10":{mapTo:{code:F,message:te}}}}},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:oe.USER_DENIED},"-400":{mapTo:oe.DUPLICATE_REQUEST}},iOS:{"-1":{mapTo:oe.USER_DENIED},"-400":{mapTo:oe.DUPLICATE_REQUEST}}}},MP_ADD_RATING:{skipJump:!1},MP_ADD_MYFAVORITES:{skipJump:!1},MP_INTERACT_OA:{skipJump:!1,errorList:{android:{"-400":{mapTo:oe.DUPLICATE_REQUEST}},iOS:{"-400":{mapTo:oe.DUPLICATE_REQUEST}}}},MP_USER_AUTHORIZE:{skipJump:!1,errorList:{android:{"-400":{mapTo:oe.DUPLICATE_REQUEST}},iOS:{"-400":{mapTo:oe.DUPLICATE_REQUEST}}}},MP_SELECT_PAYMENT_METHOD:{skipJump:!1},CHECK_NFC:{skipJump:!1,versionLive:{iOS:626},errorList:{all:{"-1":{mapTo:oe.UNKNOWN_ERROR},"-600":{mapTo:oe.DEVICE_NOT_SUPPORT},"-602":{mapTo:oe.SERVICE_NOT_READY}}}},SCAN_NFC:{skipJump:!1,haveCallback:!0,timeout:65,errorList:{all:{"-1":{mapTo:oe.UNKNOWN_ERROR},"-600":{mapTo:oe.DEVICE_NOT_SUPPORT},"-601":{mapTo:oe.SCAN_TIMEOUT},"-602":{mapTo:oe.SERVICE_NOT_READY},"-603":{mapTo:oe.UNREADABLE},"-604":{mapTo:oe.INVALID_MRZ},"-605":{mapTo:oe.PROCESSING},"-606":{mapTo:oe.CANCEL}}}},MP_CONFIRM_REQUEST_PAYMENT:{skipJump:!1},SAVE_FILE:{versionLive:{iOS:628},skipJump:!1,errorList:{android:{"-101":{mapTo:{code:H,message:ie},needMoreDetail:!0},"-102":{mapTo:{code:H,message:ie},needMoreDetail:!0}},iOS:{"-10":{mapTo:{code:H,message:ie},needMoreDetail:!0}}}},MP_APP_LIFECYCLE_TRACKING:{skipJump:!1}},ue={android:{"-4":oe.DECODE_FAILED,"-5":oe.CLIENT_NOT_SUPPORT,"-14":oe.TIME_OUT},iOS:{"-9":oe.DECODE_FAILED,"-5":oe.CLIENT_NOT_SUPPORT,"-14":oe.TIME_OUT}},ce={android:12100615,iOS:460,wp:0,unknown:0},le=5*r,de="https://payment-mini.zalo.me/api/order/create",pe="https://payment-mini.zalo.me/api/order/iap-create",fe="https://payment-mini.zalo.me/api/transaction",he="https://payment-mini.zalo.me/api/order/purchase",me="DEFERRED",ve="IMMEDIATE_AND_CHARGE_FULL_PRICE",ye={SHOW_BACK:0,HIDE_BACK:3,SHOW_HOME:1,HIDE_HOME:0},ge=5,_e=6,we="#1843EF",Te=0,be={"-12101":"Invalid params","-12102":"Session expire","-12103":"Not permission","-12104":"Not Authorize","-12105":"Unknown exception","-12106":"Cannot create order","-12107":"Transaction not found","-12108":"Cannot update order","-12109":"Cannot decode param","-12110":"Version not support","-12111":"Receipt expire","-12112":"Product not found","-12113":"Subscription other GW","-12114":"Product already subcription","-12115":"Not exist","-12116":"Already exist","-12117":"Not allow","-12118":"Not permit","-12119":"Internal error","-2":"Unable to pay","-6":"Unable to register","-7":"Registered account","-832":"Purchased by another account","-833":"Register for another account","-834":"Unable to register","-2010":"System is maintaining","-3999":"Not in Vietnam","-12129":"Purchased by another account",123:"An error has occurred"};function Ee(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 Se(e){return function(){var t=this,n=arguments;return new Promise((function(r,i){var o=e.apply(t,n);function a(e){Ee(o,r,i,a,s,"next",e)}function s(e){Ee(o,r,i,a,s,"throw",e)}a(void 0)}))}}function Pe(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 Ie(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function Ae(e,t){if(e){if("string"==typeof e)return Pe(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)?Pe(e,t):void 0}}function Oe(e){return function(e){if(Array.isArray(e))return Pe(e)}(e)||Ie(e)||Ae(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 ke(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 Ne(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,Oe(n))}catch(e){return"undefined"!=typeof console&&console.error&&console.error(e),null}}}function Ce(e){var t=new URL(window.location.href).searchParams.get("env");return{isMp:window.location.hostname.includes(u)&&("TESTING_LOCAL"==t||window.location.pathname.startsWith(c)),isMpWeb:window.location.hostname.includes("localhost")}}Ne.async=function(e){return Se((function(){var t,n,r,i,o=arguments;return ke(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,Oe(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.PaymentDone="action.payment.done",h.PaymentClose="action.payment.close",h.DownloadProgress="h5.event.webview.download.progress",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.multi_image=2]="multi_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,(I=e.StatusBarType||(e.StatusBarType={}))[I.normal=1]="normal",I[I.hidden=0]="hidden",I[I.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,(k=e.TextAlignType||(e.TextAlignType={}))[k.left=0]="left",k[k.center=1]="center",e.CameraEvents=void 0,(N=e.CameraEvents||(e.CameraEvents={})).OnFrameCallback="h5.event.camera.frame",N.OnStartCallback="h5.event.camera.start",N.OnStopCallback="h5.event.camera.stop",e.FacingMode=void 0,(C=e.FacingMode||(e.FacingMode={})).FRONT="user",C.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 Me,Re=function(t){return t.isAndroid?e.PlatformType.android:t.isIOS?e.PlatformType.iOS:e.PlatformType.unknown};function xe(e){var t=e.split("zalo")[1];return t&&t.replace(" ","").split("/")[1]||""}function De(){var e=function(){var e=Ne((function(){return window.navigator.userAgent.toLowerCase()}))();if(e){var t=function(e){return{isAndroid:/android/i.test(e)&&!/iemobile/.test(e),isIOS:/iphone|ios|ipad|ipod/.test(e)&&!/iemobile/.test(e),isMobile:/android|iphone|ios|ipad|ipod|iemobile/.test(e),isZalo:/zalo/.test(e)}}(e);return{appEnv:Ce(),platform:t,platformName:Re(t),zaloVersion:xe(e).trim()}}}();if(e)return e}var Ue=(null===(Me=De())||void 0===Me?void 0:Me.appEnv)||{};function Le(e){Le.on&&Le.engine(e)}Le.on=!1,Le.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 je=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),Le({stage:n.NOT_FOUND,type:"error",name:e,request:t,state:"fail",response:i})};function Be(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Ze(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){Be(e,t,n[t])}))}return e}function ze(e,t){return function(e){if(Array.isArray(e))return e}(e)||Ie(e)||Ae(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 We="undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{};function Fe(){throw new Error("setTimeout has not been defined")}function Ve(){throw new Error("clearTimeout has not been defined")}var Ge=Fe,He=Ve;function Ke(e){if(Ge===setTimeout)return setTimeout(e,0);if((Ge===Fe||!Ge)&&setTimeout)return Ge=setTimeout,setTimeout(e,0);try{return Ge(e,0)}catch(t){try{return Ge.call(null,e,0)}catch(t){return Ge.call(this,e,0)}}}"function"==typeof We.setTimeout&&(Ge=setTimeout),"function"==typeof We.clearTimeout&&(He=clearTimeout);var Je,qe=[],Qe=!1,$e=-1;function Ye(){Qe&&Je&&(Qe=!1,Je.length?qe=Je.concat(qe):$e=-1,qe.length&&Xe())}function Xe(){if(!Qe){var e=Ke(Ye);Qe=!0;for(var t=qe.length;t;){for(Je=qe,qe=[];++$e<t;)Je&&Je[$e].run();$e=-1,t=qe.length}Je=null,Qe=!1,function(e){if(He===clearTimeout)return clearTimeout(e);if((He===Ve||!He)&&clearTimeout)return He=clearTimeout,clearTimeout(e);try{He(e)}catch(t){try{return He.call(null,e)}catch(t){return He.call(this,e)}}}(e)}}function et(e,t){this.fun=e,this.array=t}et.prototype.run=function(){this.fun.apply(null,this.array)};function tt(){}var nt=tt,rt=tt,it=tt,ot=tt,at=tt,st=tt,ut=tt;var ct=We.performance||{},lt=ct.now||ct.mozNow||ct.msNow||ct.oNow||ct.webkitNow||function(){return(new Date).getTime()};var dt=new Date;var pt,ft={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];qe.push(new et(e,t)),1!==qe.length||Qe||Ke(Xe)},title:"browser",browser:!0,env:{},argv:[],version:"",versions:{},on:nt,addListener:rt,once:it,off:ot,removeListener:at,removeAllListeners:st,emit:ut,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*lt.call(ct),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-dt)/1e3}},ht=ft,mt="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function vt(e){return e&&e.constructor===Symbol?"symbol":typeof e}function yt(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 mt?mt:"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 ht&&ht.env&&"true"===ht.env.REFLECT_METADATA_USE_MAP_POLYFILL,d=l||"function"!=typeof Map||"function"!=typeof Map.prototype.entries?ee():Map,p=l||"function"!=typeof Set||"function"!=typeof Set.prototype.entries?te():Set,f=new(l||"function"!=typeof WeakMap?ne():WeakMap);function h(e,t,n,r){if(D(n)){if(!V(e))throw new TypeError;if(!H(t))throw new TypeError;return S(e,t)}if(!V(e))throw new TypeError;if(!j(t))throw new TypeError;if(!j(r)&&!D(r)&&!U(r))throw new TypeError;return U(r)&&(r=void 0),P(e,t,n=F(n),r)}function m(e,t){function n(n,r){if(!j(n))throw new TypeError;if(!D(r)&&!K(r))throw new TypeError;C(e,t,n,r)}return n}function v(e,t,n,r){if(!j(n))throw new TypeError;return D(r)||(r=F(r)),C(e,t,n,r)}function y(e,t,n){if(!j(t))throw new TypeError;return D(n)||(n=F(n)),A(e,t,n)}function g(e,t,n){if(!j(t))throw new TypeError;return D(n)||(n=F(n)),O(e,t,n)}function _(e,t,n){if(!j(t))throw new TypeError;return D(n)||(n=F(n)),k(e,t,n)}function w(e,t,n){if(!j(t))throw new TypeError;return D(n)||(n=F(n)),N(e,t,n)}function T(e,t){if(!j(e))throw new TypeError;return D(t)||(t=F(t)),M(e,t)}function b(e,t){if(!j(e))throw new TypeError;return D(t)||(t=F(t)),R(e,t)}function E(e,t,n){if(!j(t))throw new TypeError;D(n)||(n=F(n));var r=I(t,n,!1);if(D(r))return!1;if(!r.delete(e))return!1;if(r.size>0)return!0;var i=f.get(t);return i.delete(n),i.size>0||f.delete(t),!0}function S(e,t){for(var n=e.length-1;n>=0;--n){var r=(0,e[n])(t);if(!D(r)&&!U(r)){if(!H(r))throw new TypeError;t=r}}return t}function P(e,t,n,r){for(var i=e.length-1;i>=0;--i){var o=(0,e[i])(t,n,r);if(!D(o)&&!U(o)){if(!j(o))throw new TypeError;r=o}}return r}function I(e,t,n){var r=f.get(e);if(D(r)){if(!n)return;r=new d,f.set(e,r)}var i=r.get(t);if(D(i)){if(!n)return;i=new d,r.set(t,i)}return i}function A(e,t,n){if(O(e,t,n))return!0;var r=X(t);return!U(r)&&A(e,r,n)}function O(e,t,n){var r=I(t,n,!1);return!D(r)&&z(r.has(e))}function k(e,t,n){if(O(e,t,n))return N(e,t,n);var r=X(t);return U(r)?void 0:k(e,r,n)}function N(e,t,n){var r=I(t,n,!1);if(!D(r))return r.get(e)}function C(e,t,n,r){I(n,r,!0).set(e,t)}function M(e,t){var n=R(e,t),r=X(e);if(null===r)return n;var i=M(r,t);if(i.length<=0)return n;if(n.length<=0)return i;for(var o=new p,a=[],s=0,u=n;s<u.length;s++){var c=u[s];o.has(c)||(o.add(c),a.push(c))}for(var l=0,d=i;l<d.length;l++){c=d[l];o.has(c)||(o.add(c),a.push(c))}return a}function R(e,t){var n=[],r=I(e,t,!1);if(D(r))return n;for(var i=q(r.keys()),o=0;;){var a=$(i);if(!a)return n.length=o,n;var s=Q(a);try{n[o]=s}catch(e){try{Y(i)}finally{throw e}}o++}}function x(e){if(null===e)return 1;switch(typeof e){case"undefined":return 0;case"boolean":return 2;case"string":return 3;case"symbol":return 4;case"number":return 5;case"object":return null===e?1:6;default:return 6}}function D(e){return void 0===e}function U(e){return null===e}function L(e){return"symbol"==typeof e}function j(e){return"object"==typeof e?null!==e:"function"==typeof e}function B(e,t){switch(x(e)){case 0:case 1:case 2:case 3:case 4:case 5:return e}var n=3===t?"string":5===t?"number":"default",i=J(e,r);if(void 0!==i){var o=i.call(e,n);if(j(o))throw new TypeError;return o}return Z(e,"default"===n?"number":n)}function Z(e,t){if("string"===t){var n=e.toString;if(G(n))if(!j(i=n.call(e)))return i;if(G(r=e.valueOf))if(!j(i=r.call(e)))return i}else{var r;if(G(r=e.valueOf))if(!j(i=r.call(e)))return i;var i,o=e.toString;if(G(o))if(!j(i=o.call(e)))return i}throw new TypeError}function z(e){return!!e}function W(e){return""+e}function F(e){var t=B(e,3);return L(t)?t:W(t)}function V(e){return Array.isArray?Array.isArray(e):e instanceof Object?e instanceof Array:"[object Array]"===Object.prototype.toString.call(e)}function G(e){return"function"==typeof e}function H(e){return"function"==typeof e}function K(e){switch(x(e)){case 3:case 4:return!0;default:return!1}}function J(e,t){var n=e[t];if(null!=n){if(!G(n))throw new TypeError;return n}}function q(e){var t=J(e,i);if(!G(t))throw new TypeError;var n=t.call(e);if(!j(n))throw new TypeError;return n}function Q(e){return e.value}function $(e){var t=e.next();return!t.done&&t}function Y(e){var t=e.return;t&&t.call(e)}function X(e){var t=Object.getPrototypeOf(e);if("function"!=typeof e||e===c)return t;if(t!==c)return t;var n=e.prototype,r=n&&Object.getPrototypeOf(n);if(null==r||r===Object.prototype)return t;var i=r.constructor;return"function"!=typeof i||i===e?t:i}function ee(){var e={},t=[],n=function(){function e(e,t,n){this._index=0,this._keys=e,this._values=t,this._selector=n}return e.prototype["@@iterator"]=function(){return this},e.prototype[i]=function(){return this},e.prototype.next=function(){var e=this._index;if(e>=0&&e<this._keys.length){var n=this._selector(this._keys[e],this._values[e]);return e+1>=this._keys.length?(this._index=-1,this._keys=t,this._values=t):this._index++,{value:n,done:!1}}return{value:void 0,done:!0}},e.prototype.throw=function(e){throw this._index>=0&&(this._index=-1,this._keys=t,this._values=t),e},e.prototype.return=function(e){return this._index>=0&&(this._index=-1,this._keys=t,this._values=t),{value:e,done:!0}},e}();return function(){function t(){this._keys=[],this._values=[],this._cacheKey=e,this._cacheIndex=-2}return Object.defineProperty(t.prototype,"size",{get:function(){return this._keys.length},enumerable:!0,configurable:!0}),t.prototype.has=function(e){return this._find(e,!1)>=0},t.prototype.get=function(e){var t=this._find(e,!1);return t>=0?this._values[t]:void 0},t.prototype.set=function(e,t){var n=this._find(e,!0);return this._values[n]=t,this},t.prototype.delete=function(t){var n=this._find(t,!1);if(n>=0){for(var r=this._keys.length,i=n+1;i<r;i++)this._keys[i-1]=this._keys[i],this._values[i-1]=this._values[i];return this._keys.length--,this._values.length--,t===this._cacheKey&&(this._cacheKey=e,this._cacheIndex=-2),!0}return!1},t.prototype.clear=function(){this._keys.length=0,this._values.length=0,this._cacheKey=e,this._cacheIndex=-2},t.prototype.keys=function(){return new n(this._keys,this._values,r)},t.prototype.values=function(){return new n(this._keys,this._values,o)},t.prototype.entries=function(){return new n(this._keys,this._values,a)},t.prototype["@@iterator"]=function(){return this.entries()},t.prototype[i]=function(){return this.entries()},t.prototype._find=function(e,t){return this._cacheKey!==e&&(this._cacheIndex=this._keys.indexOf(this._cacheKey=e)),this._cacheIndex<0&&t&&(this._cacheIndex=this._keys.length,this._keys.push(e),this._values.push(void 0)),this._cacheIndex},t}();function r(e,t){return e}function o(e,t){return t}function a(e,t){return[e,t]}}function te(){return function(){function e(){this._map=new d}return Object.defineProperty(e.prototype,"size",{get:function(){return this._map.size},enumerable:!0,configurable:!0}),e.prototype.has=function(e){return this._map.has(e)},e.prototype.add=function(e){return this._map.set(e,e),this},e.prototype.delete=function(e){return this._map.delete(e)},e.prototype.clear=function(){this._map.clear()},e.prototype.keys=function(){return this._map.keys()},e.prototype.values=function(){return this._map.values()},e.prototype.entries=function(){return this._map.entries()},e.prototype["@@iterator"]=function(){return this.keys()},e.prototype[i]=function(){return this.keys()},e}()}function ne(){var e=16,n=u.create(),r=i();return function(){function e(){this._key=i()}return e.prototype.has=function(e){var t=o(e,!1);return void 0!==t&&u.has(t,this._key)},e.prototype.get=function(e){var t=o(e,!1);return void 0!==t?u.get(t,this._key):void 0},e.prototype.set=function(e,t){return o(e,!0)[this._key]=t,this},e.prototype.delete=function(e){var t=o(e,!1);return void 0!==t&&delete t[this._key]},e.prototype.clear=function(){this._key=i()},e}();function i(){var e;do{e="@@WeakMap@@"+c()}while(u.has(n,e));return n[e]=!0,e}function o(e,n){if(!t.call(e,r)){if(!n)return;Object.defineProperty(e,r,{value:u.create()})}return e[r]}function a(e,t){for(var n=0;n<t;++n)e[n]=255*Math.random()|0;return e}function s(e){return"function"==typeof Uint8Array?"undefined"!=typeof crypto?crypto.getRandomValues(new Uint8Array(e)):"undefined"!=typeof msCrypto?msCrypto.getRandomValues(new Uint8Array(e)):a(new Uint8Array(e),e):a(new Array(e),e)}function c(){var t=s(e);t[6]=79&t[6]|64,t[8]=191&t[8]|128;for(var n="",r=0;r<e;++r){var i=t[r];4!==r&&6!==r&&8!==r||(n+="-"),i<16&&(n+="0"),n+=i.toString(16).toLowerCase()}return n}}function re(e){return e.__=void 0,delete e.__,e}e("decorate",h),e("metadata",m),e("defineMetadata",v),e("hasMetadata",y),e("hasOwnMetadata",g),e("getMetadata",_),e("getOwnMetadata",w),e("getMetadataKeys",T),e("getOwnMetadataKeys",b),e("deleteMetadata",E)}(r)}()}(pt||(pt={}));var gt=Object.prototype.toString;var _t="[object Null]",wt="[object Undefined]";function Tt(e){return null==e?void 0===e?wt:_t:function(e){return gt.call(e)}(e)}function bt(e){return null!=e&&"object"==typeof e}var Et={isEmpty:function(e){return null==e||"object"==typeof e&&0===Object.keys(e).length||"string"==typeof e&&0===e.trim().length},isNull:function(e){return null===e},isUndefined:function(e){return void 0===e},isFunction:function(e){return"function"==typeof e},isObject:function(e){return null!==e&&("function"==typeof e||"object"==typeof e)},isString:function(e){return null!=e&&"string"==typeof e.valueOf()},isNumber:function(e){return"number"==typeof e||bt(e)&&"[object Number]"==Tt(e)},isArray:function(e){return Array.isArray(e)},isRegExp:function(e){return bt(e)&&"[object RegExp]"==Tt(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 St(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Pt(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 It(e){return It=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},It(e)}function At(e){return It(e)}function Ot(e,t,n){return Ot="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=At(e)););return e}(e,t);if(r){var i=Object.getOwnPropertyDescriptor(r,t);return i.get?i.get.call(n||e):i.value}},Ot(e,t,n)}function kt(e,t,n){return Ot(e,t,n)}function Nt(e,t){return Nt=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},Nt(e,t)}function Ct(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Nt(e,t)}function Mt(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Rt(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=At(e);if(t){var i=At(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return function(e,t){return!t||"object"!==vt(t)&&"function"!=typeof t?Mt(e):t}(this,n)}}var xt=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})),Dt="ACTION_CALLBACK";var Ut=function(t){Ct(r,t);var n=Rt(r);function r(){var e;return St(this,r),(e=n.apply(this,arguments)).debug=yt("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===Dt||t===e.Events.PaymentCallback)return kt(At(r.prototype),"on",this).call(this,t,n,i);this.debug("register ".concat(String(t),": ").concat(i));return kt(At(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===Dt)return kt(At(r.prototype),"once",this).call(this,e,t,n);this.debug("register once ".concat(String(e),": ").concat(n));return kt(At(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}(xt);function Lt(e){Ut.getInstance().emit(Dt,e)}function jt(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){Lt({serialId:e,actionName:t,result:n})}},window.zaloJSV2={zalo_h5_event_handler:function(t,n,r){var i=yt("zmp:zalo_h5_event_handler");i("eventId: ".concat(t,", eventName: ").concat(n,", eventData: ").concat(r));var a=vn(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);Ut.getInstance().emit(n,t,s)}},window.zaloNative2JS={nativeCall:function(t,n,r){Ut.getInstance().emit(e.Events.PaymentCallback,t,n,r)}};var Bt={encode:jt,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:jt(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":vt(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":vt(r))?JSON.stringify(r):encodeURIComponent(r)].join("=");n.push(i)})),n.join("&")}},Zt={},zt=function(e,t,n){var r=t||"default";return function(){return(r in Zt?Zt[r](e,n):e).apply(this,arguments)}};zt.setWrapper=function(e){Zt[arguments.length<=1||void 0===arguments[1]?"default":arguments[1]]=e};var Wt={error:{code:1,error_subcode:1357046,message:"Received Invalid JSON reply.",type:"http"}};function Ft(e){try{return null===e?Wt:JSON.parse(e)}catch(e){return Wt}}var Vt,Gt={execute:function(e,t,n,r){n.suppress_http_code=1;var i=Bt.encode(n);"post"!=t&&(e=Bt.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=zt((function(){o=r,"onload"in i&&i.onload(n)}),"entry","XMLHttpRequest:load"),a=zt((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(Ft(e.responseText))},o.onerror=function(e){e.responseText?r(Ft(e.responseText)):r({error:{code:1,error_subcode:1357045,message:"unknown error (empty response)",status:e.status,type:"http"}})},o.send(i),!0)}},Ht=Gt,Kt=(Vt=Se((function(e,t,n){var r,i,o,a;return ke(this,(function(s){switch(s.label){case 0:return r={appId:e,versionStatus:t},Et.isUndefined(n)||(r.currentVersion=n),i=Bt.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 Vt.apply(this,arguments)});function Jt(e){try{var t=e.map((function(e){return{action:e.action,error:e.error,message:e.message,data:e.data}}));Ht.execute(d.SEND_ACTION_LOG,"post",{appId:window.APP_ID,data:JSON.stringify(t)},(function(){}))}catch(e){}}var qt=function(e){return e.replace(/[A-Z]/g,(function(e){return"_".concat(e.toLowerCase())}))},Qt=function(){var e;return"android"===((null===(e=De())||void 0===e?void 0:e.platformName)||"").toLowerCase()},$t=function(){var e=0;if(window.zaloVersionCode)e=window.zaloVersionCode;else{var t,n=Number((null===(t=De())||void 0===t?void 0:t.zaloVersion)||"");if(n>=24112e3)e=n;else{var r,i=((null===(r=De())||void 0===r?void 0:r.platformName)||"").toLowerCase();"android"===i?e=n%1e4:"ios"===i&&(e=n)}}return e},Yt=function(e,t){var n=$t();return Qt()&&n<e||function(){var e;return"ios"===((null===(e=De())||void 0===e?void 0:e.platformName)||"").toLowerCase()}()&&n<t};function Xt(e,t){return null!=t&&"undefined"!=typeof Symbol&&t[Symbol.hasInstance]?!!t[Symbol.hasInstance](e):e instanceof t}var en,tn=function(){function e(t,n,r,i){St(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}(),nn=function(e,t){return Xt(e,tn)?function(e,t){return e.api=t,e.toJSON()}(e,t):function(e,t){return Xt(e,Error)?new tn(U,e.message,t).toJSON():Et.isEmpty(null==e?void 0:e.message)||Et.isEmpty(null==e?void 0:e.code)?new tn(U,J,t,e).toJSON():new tn(e.code,e.message,t,e.detail).toJSON()}(e,t)},rn=(en=Se((function(e){var t;return ke(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,Ze({method:"GET"},t))];case 1:return[4,n.sent().json()];case 2:return[2,n.sent()]}}))})),function(e){return en.apply(this,arguments)}),on=Se((function(){return ke(this,(function(e){return[2,new Promise(function(){var e=Se((function(e,t){var n,r,i,o;return ke(this,(function(a){switch(a.label){case 0:return a.trys.push([0,3,,4]),[4,pn.jumpAndGetToken()];case 1:return a.sent(),(r=null===(n=pn.miniProgramConfig)||void 0===n?void 0:n.jwt)||t(new tn(B,$,"getSetting")),[4,rn(r)];case 2:return(i=a.sent())&&0===i.err?e({authSetting:i.data}):t(new tn(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)}}())]}))})),an=function(){var t,n,r,i=De(),o={},a=Ut.getInstance(),s=[],u=!1;return u||(n=function(t){var n=t.serialId,r=yn(t.result),i=Tn(null==r?void 0:r.action),u=Et.isEmpty(null==r?void 0:r.error_code)?0:null==r?void 0:r.error_code,c=null==r?void 0:r.error_message,l=(null==r?void 0:r.data)||r;if(i&&0===u){var d=JSON.parse(null==r?void 0:r.data);u=Et.isEmpty(null==d?void 0:d.error_code)?0:null==d?void 0:d.error_code,c=null==d?void 0:d.error_message,l=(null==d?void 0:d.data)||d}var p={error_code:u,error_message:c,data:l,action:(null==r?void 0:r.action)||t.actionName};if(n&&o[n]){var f=o[n],h=f.callback,m=f.timeout,v=f.isMultiCallback,y=f.options,g=f.downloadListener;!function(e,t){var n=t||{},r=n.success,i=n.fail;0===e.error_code?Et.isFunction(r)&&r(e):Et.isFunction(i)&&i(e)}(p,h),!v&&delete o[n],m&&clearTimeout(m);var _={action:null==p?void 0:p.action,error:null==p?void 0:p.error_code,message:null==p?void 0:p.error_message,data:{}};try{if("action.open.inapp"===p.action||"action.open.outapp"===p.action){var w=new URL(null==y?void 0:y.url),T="".concat(w.protocol,"//").concat(w.host).concat(w.pathname);_.data={url:T}}if("action.follow.oa"===p.action||"action.unfollow.oa"===p.action){var b=null==y?void 0:y.uid;_.data={uid:b}}if("action.open.chat"===p.action){var E=null==y?void 0:y.uId,S=null==y?void 0:y.type;_.data={uid:E,openChatType:S}}(null==y?void 0:y.onProgress)&&g&&a.off(e.Events.DownloadProgress,g)}catch(e){}s.push(_)}},Ut.getInstance().on(Dt,n),a.on(e.Events.AppPaused,(function(){if(s.length>0){var e=s;s=[],Jt(e)}})),t?clearInterval(t):t=setInterval((function(){if(s.length>0){var e=s;s=[],Jt(e)}}),5e3),u=!0),r=Se((function(t,n,r,s){var u,c,l,d,p,f,h,m,v,y,g,_,w,T,b,E,S,P,I,A,O,k,N;return ke(this,(function(C){switch(C.label){case 0:return c=Math.floor(1e6*Math.random()),l="".concat(t,"_").concat(c),d=Pn(t),(null==s?void 0:s.actionName)&&s.actionName.length>0&&(d=null==s?void 0:s.actionName),p=(null==s?void 0:s.isMultiCallback)||!1,f=!1!==(null==s?void 0:s.timeout)&&((null==s?void 0:s.timeout)||!0),h=(null==s?void 0:s.haveCallback)||!1,m=(null==s?void 0:s.skipJump)||!1,v=(null==s?void 0:s.requireAccessToken)||!1,y=bn(d),n&&r&&(o[l]={options:n,callback:r,isMultiCallback:p},f&&h&&(o[l].timeout=setTimeout((function(){return Lt({serialId:l,result:{error_code:z,error_message:Q,data:{timeout:f},action:t}}),null}),!0===f?8e3:1e3*f))),y?[4,on()]:[3,2];case 1:if(!1===(null==(_=C.sent())||null===(g=_.authSetting)||void 0===g?void 0:g["scope.userInfo"]))return Lt({serialId:l,result:{error_code:B,error_message:ee,data:{isMobile:null==i||null===(w=i.platform)||void 0===w?void 0:w.isMobile},action:t}}),[2];C.label=2;case 2:return T=Tn(d),!(null==i||null===(u=i.platform)||void 0===u?void 0:u.isMobile)||!t||Et.isUndefined(ZaloJavaScriptInterface)||i.platform.isIOS&&!mn(t)||T&&!1===T.isSupported?(Lt({serialId:l,result:{error_code:Z,error_message:X,data:{isMobile:null==i||null===(b=i.platform)||void 0===b?void 0:b.isMobile},action:t}}),[2]):(E=hn(n),m?[3,4]:[4,pn.getJSAccessToken()]);case 3:return P=C.sent(),[3,5];case 4:P="",C.label=5;case 5:S=P,C.label=6;case 6:return C.trys.push([6,10,,11]),m||!v?[3,8]:[4,pn.getAccessToken()];case 7:return A=C.sent(),[3,9];case 8:A="",C.label=9;case 9:return I=A,[3,11];case 10:return O=C.sent(),Lt({serialId:l,result:{error_code:null==O?void 0:O.code,error_message:null==O?void 0:O.message,action:t}}),[2];case 11:try{n&&(null==n?void 0:n.onProgress)&&(k=function(e){!function(e,t){e.url;var n=e.progress;t&&t(n)}(e,null==n?void 0:n.onProgress)},o[l].downloadListener=k,a.on(e.Events.DownloadProgress,k))}catch(e){}return N=i.platform.isIOS?window.onNativeMessage(l,d):'window.onNativeMessage("'.concat(l,'", "').concat(d,'")'),[2,ZaloJavaScriptInterface.jsCall(S,d,I,E,N)]}}))})),function(e,t,n,i){return r.apply(this,arguments)}}(),sn={success:function(e,t){return{code:D,message:t||K,data:e||{}}},error:{failLimit:function(){return new tn(W,q)},badRequest:function(e){return new tn(L,e)},loginFailed:function(e){return new tn(B,"".concat(Y,": ").concat(e))},loginRequired:function(){return new tn(B,$)},cannotGetShareInfo:function(){return new tn(j,"Can not get app info to share")},createIAPOrderFailed:function(e){var t=Object.keys(be).find((function(t){return t===e.toString()}));return new tn(e,t||J)},clientNotSupport:function(){return new tn(Z,X)}}},un=function(t){var n,r,i,o=null===(n=De())||void 0===n?void 0:n.platformName,a=Sn(t.action),s=se[a],u=(null==s?void 0:s.skipJump)||!1,c=(null==s?void 0:s.errorList)||{};if("JUMP_LOGIN"===a)return new tn(U,"Can not get auth code: ".concat(t.error_message));if(pn.jumpStatus!==e.JumpStatus.DONE&&!u)return new tn(oe.UNAUTHORIZED.code,oe.UNAUTHORIZED.message);if("permission required!"===String(t.error_message).toLowerCase()||"no permission!"===String(t.error_message).toLowerCase())return new tn(oe.FORBIDDEN.code,oe.FORBIDDEN.message);if(o&&(null===(r=ue[o])||void 0===r?void 0:r[t.error_code]))return new tn(ue[o][t.error_code].code,ue[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;if(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);return new tn(null===(p=l.mapTo)||void 0===p?void 0:p.code,h)}return new tn(t.error_code,t.error_message)},cn=function(e,t,r,i){var o=function(e,t){function r(r){return function(i){var o=Et.isEmpty(t)?void 0:t[r];if(o)return Le({stage:n.RESPONSE,type:"log",state:r,name:e,response:i}),o("fail"===r?un(i):null==i?void 0:i.data)}}return Et.isUndefined(e)&&(e=""),Object.assign({},{success:r("success"),fail:r("fail")})}(e,r),a=se[e],s=(null==i?void 0:i.delay)||0;setTimeout((function(){an(e,t,o,Ze({},i,a))}),s)},ln=function(){var e=Se((function(e){return ke(this,(function(t){return[2,new Promise((function(t,n){cn("MP_USER_AUTHORIZE",{scopes:e,forceUpdate:!0},{success:function(e){Et.isEmpty(e)||t(e)},fail:function(e){n(e)}},{isMultiCallback:!1,timeout:!1})}))]}))}));return function(t){return e.apply(this,arguments)}}(),dn=function(){function t(){St(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=ae[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 Se((function(){return ke(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,Le({stage:n.REQUEST,type:"log",name:"jump"}),an("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)||Jt([{action:"action.jump.login",error:-102,message:"no zoauth",data:{}}]),r(e.JumpStatus.DONE)},fail:function(e){Jt([{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 Se((function(){var i;return ke(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=Se((function(e){var t,n,i;return ke(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 Se((function(){var i,o;return ke(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),Et.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,Ze({method:"POST",body:i},o)).then(function(){var e=Se((function(e){var t,n,i,o;return ke(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 Se((function(){var n,r,a,s,u,c,d,p,f;function h(){return m.apply(this,arguments)}function m(){return(m=Se((function(){return ke(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 ke(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--,Jt([{action:d,error:-104,message:"no user auth",data:{}}]),sn.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),Jt([{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)]:(Jt([{action:d,error:-101,message:"no accessToken",data:{}}]),[2,Promise.reject(sn.error.loginFailed("Can't get accessToken. Please try again later."))]);case 15:throw r.getAccessTokenCount--,Jt([{action:d,error:-102,message:"no oauth",data:{}}]),sn.error.loginFailed("Zalo app has not been activated")}}))}))()},c.verifyUserAuthorized=function(){var e=this;return Se((function(){var t,n,r,i,o,a;return ke(this,(function(s){switch(s.label){case 0:return n=!0,[4,e.jumpAndGetToken()];case 1:if(s.sent(),!1!==(null===(t=e._miniProgramConfig)||void 0===t?void 0:t.userAuthorized))return[3,7];s.label=2;case 2:return s.trys.push([2,6,,7]),(r=Tn("action.mp.user.authorize"))&&r.isSupported?[4,on()]:[3,5];case 3:return!1!==(null==(o=s.sent())||null===(i=o.authSetting)||void 0===i?void 0:i["scope.userInfo"])?[3,5]:[4,ln()];case 4:a=s.sent(),n=(null==a?void 0:a["scope.userInfo"])||!1,s.label=5;case 5:return[3,7];case 6:return s.sent(),n=!1,[3,7];case 7: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 Se((function(){var t;return ke(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=Se((function(i){var o,a,s,u;return ke(this,(function(c){switch(c.label){case 0:return!n&&r._cookies.length>0?Et.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}}])&&Pt(r.prototype,a),u&&Pt(r,u),t}(),pn=dn.getInstance(),fn=yt("zmp:utils:common"),hn=function(e){if(Et.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(hn(e[r]));return"["+t.join(",")+"]"}if("object"==typeof e){for(var i in t=[],e)t.push('"'+i+'":'+hn(e[i]));return"{"+t.join(",")+"}"}return e.toString()},mn=function(e){var t,n,r=se[e],i=(null===(t=De())||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},vn=function(e){try{if(e){fn(e);var t=e.replace(/\\/g,"").replace(/'/g,"'");try{t=decodeURIComponent(atob(e))}catch(e){}var n=JSON.parse(t);return fn("formattedValue",t,n,void 0===n?"undefined":vt(n)),n}return null}catch(t){return fn("parse json error:",t),e}},yn=function(e){if(Et.isObject(JSON)&&JSON.parse&&Et.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 Et.isObject(e)?e:new Function("return "+e)()},gn=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""},_n=function(e){return btoa(encodeURIComponent(JSON.stringify(e)))};var wn=function(t){return"hidden"===t?e.StatusBarType.hidden:"transparent"===t?e.StatusBarType.transparent:e.StatusBarType.normal},Tn=function(e){if(void 0!==e){var t=pn.miniProgramConfig;return((null==t?void 0:t.dynamicApis)||[]).find((function(t){return t.action===e&&!1===t.clientHandle}))}},bn=function(e){if(void 0===e)return!1;var t=pn.miniProgramConfig;return((null==t?void 0:t.requiredAuthenList)||[]).indexOf(e)>=0},En=function(){var e=Se((function(){return ke(this,(function(e){return[2,new Promise(function(){var e=Se((function(e,t){var n;return ke(this,(function(t){switch(t.label){case 0:return t.trys.push([0,2,,3]),[4,pn.jumpAndGetToken()];case 1:return t.sent(),n=pn.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)}}(),Sn=function(e){return e.replace("action.","").replace(/\./g,"_").toUpperCase()},Pn=function(e){return"action.".concat(e.replace(/\_/g,".").toLowerCase())};function In(e,t,n,r){var i,o;!function(e,t){if(ae[e]){var n=pn.getRetryLimit(e);n.lastCall&&(new Date).getTime()-n.lastCall>1e3&&pn.resetRetryLimit(e);var r=n.limit||3;if(n.retry&&n.retry>=r)throw nn(sn.error.failLimit(),e);pn.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=sn.error.badRequest(s);throw c.detail=a,nn(c,e)}u.push(i.data)}));var c=r.apply(void 0,Oe(u));return Et.isPromise(c)?new Promise((function(t,n){c.then((function(e){if(!Et.isNull(a)&&Et.isFunction(a))return a(e);t(c)})).catch((function(t){var r=nn(t,e);if(!Et.isNull(s)&&Et.isFunction(s))return s(r);n(r)}))})):c}catch(t){if(!Et.isNull(s)&&Et.isFunction(s))return s(t);throw nn(t,e)}}function An(e){return On.apply(this,arguments)}function On(){return(On=Se((function(e){return ke(this,(function(t){return[2,In("login",[],[e],Se((function(){return ke(this,(function(e){switch(e.label){case 0:return Ue.isMp?[4,pn.jumpAndGetToken(l.ZOAUTH)]:[3,2];case 1:return e.sent(),[2,"Success"];case 2:return Ue.isMpWeb?[2,Promise.resolve("")]:[2,Promise.reject(je("login",{}))]}}))})))]}))}))).apply(this,arguments)}function kn(e){return Nn.apply(this,arguments)}function Nn(){return(Nn=Se((function(e){return ke(this,(function(t){return[2,In("getAccessToken",[],[e],Se((function(){var e;return ke(this,(function(t){switch(t.label){case 0:return Ue.isMp?[4,En()]:[3,3];case 1:return e=!t.sent(),[4,pn.getAccessToken(e)];case 2:return[2,t.sent()||""];case 3:return Ue.isMpWeb?[2,Promise.resolve("")]:[2,Promise.reject(je("getAccessToken",{}))]}}))})))]}))}))).apply(this,arguments)}var Cn,Mn="2.44.3";function Rn(){return In("getVersion",[],[],(function(){return Mn}))}function xn(){var e,t;return{version:gn("version-id")||"",apiVersion:Mn,zaloVersion:(null===(e=De())||void 0===e?void 0:e.zaloVersion)||"",platform:(null===(t=De())||void 0===t?void 0:t.platformName)||"",language:navigator.language,zaloLanguage:window.zLanguage||"vi",zaloTheme:window.zTheme||"light"}}function Dn(){return In("getSystemInfo",[],[],(function(){return xn()}))}!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}(Cn||(Cn={}));const Un=Cn.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Ln=e=>{switch(typeof e){case"undefined":return Un.undefined;case"string":return Un.string;case"number":return isNaN(e)?Un.nan:Un.number;case"boolean":return Un.boolean;case"function":return Un.function;case"bigint":return Un.bigint;case"symbol":return Un.symbol;case"object":return Array.isArray(e)?Un.array:null===e?Un.null:e.then&&"function"==typeof e.then&&e.catch&&"function"==typeof e.catch?Un.promise:"undefined"!=typeof Map&&e instanceof Map?Un.map:"undefined"!=typeof Set&&e instanceof Set?Un.set:"undefined"!=typeof Date&&e instanceof Date?Un.date:Un.object;default:return Un.unknown}},jn=Cn.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 Bn 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,Cn.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()}}Bn.create=e=>new Bn(e);const Zn=(e,t)=>{let n;switch(e.code){case jn.invalid_type:n=e.received===Un.undefined?"Required":`Expected ${e.expected}, received ${e.received}`;break;case jn.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(e.expected,Cn.jsonStringifyReplacer)}`;break;case jn.unrecognized_keys:n=`Unrecognized key(s) in object: ${Cn.joinValues(e.keys,", ")}`;break;case jn.invalid_union:n="Invalid input";break;case jn.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${Cn.joinValues(e.options)}`;break;case jn.invalid_enum_value:n=`Invalid enum value. Expected ${Cn.joinValues(e.options)}, received '${e.received}'`;break;case jn.invalid_arguments:n="Invalid function arguments";break;case jn.invalid_return_type:n="Invalid function return type";break;case jn.invalid_date:n="Invalid date";break;case jn.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}"`:Cn.assertNever(e.validation):n="regex"!==e.validation?`Invalid ${e.validation}`:"Invalid";break;case jn.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 jn.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 jn.custom:n="Invalid input";break;case jn.invalid_intersection_types:n="Intersection results could not be merged";break;case jn.not_multiple_of:n=`Number must be a multiple of ${e.multipleOf}`;break;case jn.not_finite:n="Number must be finite";break;default:n=t.defaultError,Cn.assertNever(e)}return{message:n}};let zn=Zn;function Wn(){return zn}const Fn=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 Vn(e,t){const n=Fn({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,Wn(),Zn].filter((e=>!!e))});e.common.issues.push(n)}class Gn{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 Hn;"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 Gn.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 Hn;if("aborted"===i.status)return Hn;"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 Hn=Object.freeze({status:"aborted"}),Kn=e=>({status:"dirty",value:e}),Jn=e=>({status:"valid",value:e}),qn=e=>"aborted"===e.status,Qn=e=>"dirty"===e.status,$n=e=>"valid"===e.status,Yn=e=>"undefined"!=typeof Promise&&e instanceof Promise;var Xn;!function(e){e.errToObj=e=>"string"==typeof e?{message:e}:e||{},e.toString=e=>"string"==typeof e?e:null==e?void 0:e.message}(Xn||(Xn={}));class er{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 tr=(e,t)=>{if($n(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 Bn(e.common.issues)}};function nr(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 rr{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 Ln(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:Ln(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new Gn,ctx:{common:e.parent.common,data:e.data,parsedType:Ln(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const t=this._parse(e);if(Yn(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:Ln(e)},i=this._parseSync({data:e,path:r.path,parent:r});return tr(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:Ln(e)},r=this._parse({data:e,path:n.path,parent:n}),i=await(Yn(r)?r:Promise.resolve(r));return tr(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:jn.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 zr({schema:this,typeName:Yr.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}optional(){return Wr.create(this,this._def)}nullable(){return Fr.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Tr.create(this,this._def)}promise(){return Zr.create(this,this._def)}or(e){return Pr.create([this,e],this._def)}and(e){return kr.create(this,e,this._def)}transform(e){return new zr({...nr(this._def),schema:this,typeName:Yr.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const t="function"==typeof e?e:()=>e;return new Vr({...nr(this._def),innerType:this,defaultValue:t,typeName:Yr.ZodDefault})}brand(){return new Jr({typeName:Yr.ZodBranded,type:this,...nr(this._def)})}catch(e){const t="function"==typeof e?e:()=>e;return new Gr({...nr(this._def),innerType:this,catchValue:t,typeName:Yr.ZodCatch})}describe(e){return new(0,this.constructor)({...this._def,description:e})}pipe(e){return qr.create(this,e)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const ir=/^c[^\s-]{8,}$/i,or=/^[a-z][a-z0-9]*$/,ar=/^([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,sr=/^(([^<>()[\]\\.,;:\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 ur extends rr{constructor(){super(...arguments),this._regex=(e,t,n)=>this.refinement((t=>e.test(t)),{validation:t,code:jn.invalid_string,...Xn.errToObj(n)}),this.nonempty=e=>this.min(1,Xn.errToObj(e)),this.trim=()=>new ur({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}_parse(e){this._def.coerce&&(e.data=String(e.data));if(this._getType(e)!==Un.string){const t=this._getOrReturnCtx(e);return Vn(t,{code:jn.invalid_type,expected:Un.string,received:t.parsedType}),Hn}const t=new Gn;let n;for(const i of this._def.checks)if("min"===i.kind)e.data.length<i.value&&(n=this._getOrReturnCtx(e,n),Vn(n,{code:jn.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),Vn(n,{code:jn.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?Vn(n,{code:jn.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}):o&&Vn(n,{code:jn.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}),t.dirty())}else if("email"===i.kind)sr.test(e.data)||(n=this._getOrReturnCtx(e,n),Vn(n,{validation:"email",code:jn.invalid_string,message:i.message}),t.dirty());else if("uuid"===i.kind)ar.test(e.data)||(n=this._getOrReturnCtx(e,n),Vn(n,{validation:"uuid",code:jn.invalid_string,message:i.message}),t.dirty());else if("cuid"===i.kind)ir.test(e.data)||(n=this._getOrReturnCtx(e,n),Vn(n,{validation:"cuid",code:jn.invalid_string,message:i.message}),t.dirty());else if("cuid2"===i.kind)or.test(e.data)||(n=this._getOrReturnCtx(e,n),Vn(n,{validation:"cuid2",code:jn.invalid_string,message:i.message}),t.dirty());else if("url"===i.kind)try{new URL(e.data)}catch(r){n=this._getOrReturnCtx(e,n),Vn(n,{validation:"url",code:jn.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),Vn(n,{validation:"regex",code:jn.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),Vn(n,{code:jn.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),Vn(n,{code:jn.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),Vn(n,{code:jn.invalid_string,validation:"datetime",message:i.message}),t.dirty())}else Cn.assertNever(i);var r;return{status:t.value,value:e.data}}_addCheck(e){return new ur({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...Xn.errToObj(e)})}url(e){return this._addCheck({kind:"url",...Xn.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...Xn.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...Xn.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...Xn.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,...Xn.errToObj(null==e?void 0:e.message)})}regex(e,t){return this._addCheck({kind:"regex",regex:e,...Xn.errToObj(t)})}startsWith(e,t){return this._addCheck({kind:"startsWith",value:e,...Xn.errToObj(t)})}endsWith(e,t){return this._addCheck({kind:"endsWith",value:e,...Xn.errToObj(t)})}min(e,t){return this._addCheck({kind:"min",value:e,...Xn.errToObj(t)})}max(e,t){return this._addCheck({kind:"max",value:e,...Xn.errToObj(t)})}length(e,t){return this._addCheck({kind:"length",value:e,...Xn.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 cr(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)}ur.create=e=>{var t;return new ur({checks:[],typeName:Yr.ZodString,coerce:null!==(t=null==e?void 0:e.coerce)&&void 0!==t&&t,...nr(e)})};class lr extends rr{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)!==Un.number){const t=this._getOrReturnCtx(e);return Vn(t,{code:jn.invalid_type,expected:Un.number,received:t.parsedType}),Hn}let t;const n=new Gn;for(const r of this._def.checks)if("int"===r.kind)Cn.isInteger(e.data)||(t=this._getOrReturnCtx(e,t),Vn(t,{code:jn.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),Vn(t,{code:jn.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),Vn(t,{code:jn.too_big,maximum:r.value,type:"number",inclusive:r.inclusive,exact:!1,message:r.message}),n.dirty())}else"multipleOf"===r.kind?0!==cr(e.data,r.value)&&(t=this._getOrReturnCtx(e,t),Vn(t,{code:jn.not_multiple_of,multipleOf:r.value,message:r.message}),n.dirty()):"finite"===r.kind?Number.isFinite(e.data)||(t=this._getOrReturnCtx(e,t),Vn(t,{code:jn.not_finite,message:r.message}),n.dirty()):Cn.assertNever(r);return{status:n.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,Xn.toString(t))}gt(e,t){return this.setLimit("min",e,!1,Xn.toString(t))}lte(e,t){return this.setLimit("max",e,!0,Xn.toString(t))}lt(e,t){return this.setLimit("max",e,!1,Xn.toString(t))}setLimit(e,t,n,r){return new lr({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:n,message:Xn.toString(r)}]})}_addCheck(e){return new lr({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:Xn.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:Xn.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:Xn.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:Xn.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:Xn.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:Xn.toString(t)})}finite(e){return this._addCheck({kind:"finite",message:Xn.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&&Cn.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)}}lr.create=e=>new lr({checks:[],typeName:Yr.ZodNumber,coerce:(null==e?void 0:e.coerce)||!1,...nr(e)});class dr extends rr{_parse(e){this._def.coerce&&(e.data=BigInt(e.data));if(this._getType(e)!==Un.bigint){const t=this._getOrReturnCtx(e);return Vn(t,{code:jn.invalid_type,expected:Un.bigint,received:t.parsedType}),Hn}return Jn(e.data)}}dr.create=e=>{var t;return new dr({typeName:Yr.ZodBigInt,coerce:null!==(t=null==e?void 0:e.coerce)&&void 0!==t&&t,...nr(e)})};class pr extends rr{_parse(e){this._def.coerce&&(e.data=Boolean(e.data));if(this._getType(e)!==Un.boolean){const t=this._getOrReturnCtx(e);return Vn(t,{code:jn.invalid_type,expected:Un.boolean,received:t.parsedType}),Hn}return Jn(e.data)}}pr.create=e=>new pr({typeName:Yr.ZodBoolean,coerce:(null==e?void 0:e.coerce)||!1,...nr(e)});class fr extends rr{_parse(e){this._def.coerce&&(e.data=new Date(e.data));if(this._getType(e)!==Un.date){const t=this._getOrReturnCtx(e);return Vn(t,{code:jn.invalid_type,expected:Un.date,received:t.parsedType}),Hn}if(isNaN(e.data.getTime())){return Vn(this._getOrReturnCtx(e),{code:jn.invalid_date}),Hn}const t=new Gn;let n;for(const r of this._def.checks)"min"===r.kind?e.data.getTime()<r.value&&(n=this._getOrReturnCtx(e,n),Vn(n,{code:jn.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),Vn(n,{code:jn.too_big,message:r.message,inclusive:!0,exact:!1,maximum:r.value,type:"date"}),t.dirty()):Cn.assertNever(r);return{status:t.value,value:new Date(e.data.getTime())}}_addCheck(e){return new fr({...this._def,checks:[...this._def.checks,e]})}min(e,t){return this._addCheck({kind:"min",value:e.getTime(),message:Xn.toString(t)})}max(e,t){return this._addCheck({kind:"max",value:e.getTime(),message:Xn.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}}fr.create=e=>new fr({checks:[],coerce:(null==e?void 0:e.coerce)||!1,typeName:Yr.ZodDate,...nr(e)});class hr extends rr{_parse(e){if(this._getType(e)!==Un.symbol){const t=this._getOrReturnCtx(e);return Vn(t,{code:jn.invalid_type,expected:Un.symbol,received:t.parsedType}),Hn}return Jn(e.data)}}hr.create=e=>new hr({typeName:Yr.ZodSymbol,...nr(e)});class mr extends rr{_parse(e){if(this._getType(e)!==Un.undefined){const t=this._getOrReturnCtx(e);return Vn(t,{code:jn.invalid_type,expected:Un.undefined,received:t.parsedType}),Hn}return Jn(e.data)}}mr.create=e=>new mr({typeName:Yr.ZodUndefined,...nr(e)});class vr extends rr{_parse(e){if(this._getType(e)!==Un.null){const t=this._getOrReturnCtx(e);return Vn(t,{code:jn.invalid_type,expected:Un.null,received:t.parsedType}),Hn}return Jn(e.data)}}vr.create=e=>new vr({typeName:Yr.ZodNull,...nr(e)});class yr extends rr{constructor(){super(...arguments),this._any=!0}_parse(e){return Jn(e.data)}}yr.create=e=>new yr({typeName:Yr.ZodAny,...nr(e)});class gr extends rr{constructor(){super(...arguments),this._unknown=!0}_parse(e){return Jn(e.data)}}gr.create=e=>new gr({typeName:Yr.ZodUnknown,...nr(e)});class _r extends rr{_parse(e){const t=this._getOrReturnCtx(e);return Vn(t,{code:jn.invalid_type,expected:Un.never,received:t.parsedType}),Hn}}_r.create=e=>new _r({typeName:Yr.ZodNever,...nr(e)});class wr extends rr{_parse(e){if(this._getType(e)!==Un.undefined){const t=this._getOrReturnCtx(e);return Vn(t,{code:jn.invalid_type,expected:Un.void,received:t.parsedType}),Hn}return Jn(e.data)}}wr.create=e=>new wr({typeName:Yr.ZodVoid,...nr(e)});class Tr extends rr{_parse(e){const{ctx:t,status:n}=this._processInputParams(e),r=this._def;if(t.parsedType!==Un.array)return Vn(t,{code:jn.invalid_type,expected:Un.array,received:t.parsedType}),Hn;if(null!==r.exactLength){const e=t.data.length>r.exactLength.value,i=t.data.length<r.exactLength.value;(e||i)&&(Vn(t,{code:e?jn.too_big:jn.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&&(Vn(t,{code:jn.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&&(Vn(t,{code:jn.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 er(t,e,t.path,n))))).then((e=>Gn.mergeArray(n,e)));const i=[...t.data].map(((e,n)=>r.type._parseSync(new er(t,e,t.path,n))));return Gn.mergeArray(n,i)}get element(){return this._def.type}min(e,t){return new Tr({...this._def,minLength:{value:e,message:Xn.toString(t)}})}max(e,t){return new Tr({...this._def,maxLength:{value:e,message:Xn.toString(t)}})}length(e,t){return new Tr({...this._def,exactLength:{value:e,message:Xn.toString(t)}})}nonempty(e){return this.min(1,e)}}var br;function Er(e){if(e instanceof Sr){const t={};for(const n in e.shape){const r=e.shape[n];t[n]=Wr.create(Er(r))}return new Sr({...e._def,shape:()=>t})}return e instanceof Tr?Tr.create(Er(e.element)):e instanceof Wr?Wr.create(Er(e.unwrap())):e instanceof Fr?Fr.create(Er(e.unwrap())):e instanceof Nr?Nr.create(e.items.map((e=>Er(e)))):e}Tr.create=(e,t)=>new Tr({type:e,minLength:null,maxLength:null,exactLength:null,typeName:Yr.ZodArray,...nr(t)}),function(e){e.mergeShapes=(e,t)=>({...e,...t})}(br||(br={}));class Sr extends rr{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=Cn.objectKeys(e);return this._cached={shape:e,keys:t}}_parse(e){if(this._getType(e)!==Un.object){const t=this._getOrReturnCtx(e);return Vn(t,{code:jn.invalid_type,expected:Un.object,received:t.parsedType}),Hn}const{status:t,ctx:n}=this._processInputParams(e),{shape:r,keys:i}=this._getCached(),o=[];if(!(this._def.catchall instanceof _r&&"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 er(n,i,n.path,e)),alwaysSet:e in n.data})}if(this._def.catchall instanceof _r){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&&(Vn(n,{code:jn.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 er(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=>Gn.mergeObjectSync(t,e))):Gn.mergeObjectSync(t,a)}get shape(){return this._def.shape()}strict(e){return Xn.errToObj,new Sr({...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=Xn.errToObj(e).message)&&void 0!==a?a:s}:{message:s}}}:{}})}strip(){return new Sr({...this._def,unknownKeys:"strip"})}passthrough(){return new Sr({...this._def,unknownKeys:"passthrough"})}extend(e){return new Sr({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new Sr({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>br.mergeShapes(this._def.shape(),e._def.shape()),typeName:Yr.ZodObject})}setKey(e,t){return this.augment({[e]:t})}catchall(e){return new Sr({...this._def,catchall:e})}pick(e){const t={};return Cn.objectKeys(e).forEach((n=>{e[n]&&this.shape[n]&&(t[n]=this.shape[n])})),new Sr({...this._def,shape:()=>t})}omit(e){const t={};return Cn.objectKeys(this.shape).forEach((n=>{e[n]||(t[n]=this.shape[n])})),new Sr({...this._def,shape:()=>t})}deepPartial(){return Er(this)}partial(e){const t={};return Cn.objectKeys(this.shape).forEach((n=>{const r=this.shape[n];e&&!e[n]?t[n]=r:t[n]=r.optional()})),new Sr({...this._def,shape:()=>t})}required(e){const t={};return Cn.objectKeys(this.shape).forEach((n=>{if(e&&!e[n])t[n]=this.shape[n];else{let e=this.shape[n];for(;e instanceof Wr;)e=e._def.innerType;t[n]=e}})),new Sr({...this._def,shape:()=>t})}keyof(){return Lr(Cn.objectKeys(this.shape))}}Sr.create=(e,t)=>new Sr({shape:()=>e,unknownKeys:"strip",catchall:_r.create(),typeName:Yr.ZodObject,...nr(t)}),Sr.strictCreate=(e,t)=>new Sr({shape:()=>e,unknownKeys:"strict",catchall:_r.create(),typeName:Yr.ZodObject,...nr(t)}),Sr.lazycreate=(e,t)=>new Sr({shape:e,unknownKeys:"strip",catchall:_r.create(),typeName:Yr.ZodObject,...nr(t)});class Pr extends rr{_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 Bn(e.ctx.common.issues)));return Vn(t,{code:jn.invalid_union,unionErrors:n}),Hn}));{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 Bn(e)));return Vn(t,{code:jn.invalid_union,unionErrors:i}),Hn}}get options(){return this._def.options}}Pr.create=(e,t)=>new Pr({options:e,typeName:Yr.ZodUnion,...nr(t)});const Ir=e=>e instanceof Dr?Ir(e.schema):e instanceof zr?Ir(e.innerType()):e instanceof Ur?[e.value]:e instanceof jr?e.options:e instanceof Br?Object.keys(e.enum):e instanceof Vr?Ir(e._def.innerType):e instanceof mr?[void 0]:e instanceof vr?[null]:null;class Ar extends rr{_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==Un.object)return Vn(t,{code:jn.invalid_type,expected:Un.object,received:t.parsedType}),Hn;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}):(Vn(t,{code:jn.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[n]}),Hn)}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=Ir(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 Ar({typeName:Yr.ZodDiscriminatedUnion,discriminator:e,options:t,optionsMap:r,...nr(n)})}}function Or(e,t){const n=Ln(e),r=Ln(t);if(e===t)return{valid:!0,data:e};if(n===Un.object&&r===Un.object){const n=Cn.objectKeys(t),r=Cn.objectKeys(e).filter((e=>-1!==n.indexOf(e))),i={...e,...t};for(const n of r){const r=Or(e[n],t[n]);if(!r.valid)return{valid:!1};i[n]=r.data}return{valid:!0,data:i}}if(n===Un.array&&r===Un.array){if(e.length!==t.length)return{valid:!1};const n=[];for(let r=0;r<e.length;r++){const i=Or(e[r],t[r]);if(!i.valid)return{valid:!1};n.push(i.data)}return{valid:!0,data:n}}return n===Un.date&&r===Un.date&&+e==+t?{valid:!0,data:e}:{valid:!1}}class kr extends rr{_parse(e){const{status:t,ctx:n}=this._processInputParams(e),r=(e,r)=>{if(qn(e)||qn(r))return Hn;const i=Or(e.value,r.value);return i.valid?((Qn(e)||Qn(r))&&t.dirty(),{status:t.value,value:i.data}):(Vn(n,{code:jn.invalid_intersection_types}),Hn)};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}))}}kr.create=(e,t,n)=>new kr({left:e,right:t,typeName:Yr.ZodIntersection,...nr(n)});class Nr extends rr{_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==Un.array)return Vn(n,{code:jn.invalid_type,expected:Un.array,received:n.parsedType}),Hn;if(n.data.length<this._def.items.length)return Vn(n,{code:jn.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),Hn;!this._def.rest&&n.data.length>this._def.items.length&&(Vn(n,{code:jn.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 er(n,e,n.path,t)):null})).filter((e=>!!e));return n.common.async?Promise.all(r).then((e=>Gn.mergeArray(t,e))):Gn.mergeArray(t,r)}get items(){return this._def.items}rest(e){return new Nr({...this._def,rest:e})}}Nr.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Nr({items:e,typeName:Yr.ZodTuple,rest:null,...nr(t)})};class Cr extends rr{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!==Un.object)return Vn(n,{code:jn.invalid_type,expected:Un.object,received:n.parsedType}),Hn;const r=[],i=this._def.keyType,o=this._def.valueType;for(const e in n.data)r.push({key:i._parse(new er(n,e,n.path,e)),value:o._parse(new er(n,n.data[e],n.path,e))});return n.common.async?Gn.mergeObjectAsync(t,r):Gn.mergeObjectSync(t,r)}get element(){return this._def.valueType}static create(e,t,n){return new Cr(t instanceof rr?{keyType:e,valueType:t,typeName:Yr.ZodRecord,...nr(n)}:{keyType:ur.create(),valueType:e,typeName:Yr.ZodRecord,...nr(t)})}}class Mr extends rr{_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==Un.map)return Vn(n,{code:jn.invalid_type,expected:Un.map,received:n.parsedType}),Hn;const r=this._def.keyType,i=this._def.valueType,o=[...n.data.entries()].map((([e,t],o)=>({key:r._parse(new er(n,e,n.path,[o,"key"])),value:i._parse(new er(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 Hn;"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 Hn;"dirty"!==r.status&&"dirty"!==i.status||t.dirty(),e.set(r.value,i.value)}return{status:t.value,value:e}}}}Mr.create=(e,t,n)=>new Mr({valueType:t,keyType:e,typeName:Yr.ZodMap,...nr(n)});class Rr extends rr{_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==Un.set)return Vn(n,{code:jn.invalid_type,expected:Un.set,received:n.parsedType}),Hn;const r=this._def;null!==r.minSize&&n.data.size<r.minSize.value&&(Vn(n,{code:jn.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&&(Vn(n,{code:jn.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 Hn;"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 er(n,e,n.path,t))));return n.common.async?Promise.all(a).then((e=>o(e))):o(a)}min(e,t){return new Rr({...this._def,minSize:{value:e,message:Xn.toString(t)}})}max(e,t){return new Rr({...this._def,maxSize:{value:e,message:Xn.toString(t)}})}size(e,t){return this.min(e,t).max(e,t)}nonempty(e){return this.min(1,e)}}Rr.create=(e,t)=>new Rr({valueType:e,minSize:null,maxSize:null,typeName:Yr.ZodSet,...nr(t)});class xr extends rr{constructor(){super(...arguments),this.validate=this.implement}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==Un.function)return Vn(t,{code:jn.invalid_type,expected:Un.function,received:t.parsedType}),Hn;function n(e,n){return Fn({data:e,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,Wn(),Zn].filter((e=>!!e)),issueData:{code:jn.invalid_arguments,argumentsError:n}})}function r(e,n){return Fn({data:e,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,Wn(),Zn].filter((e=>!!e)),issueData:{code:jn.invalid_return_type,returnTypeError:n}})}const i={errorMap:t.common.contextualErrorMap},o=t.data;return this._def.returns instanceof Zr?Jn((async(...e)=>{const t=new Bn([]),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}))})):Jn(((...e)=>{const t=this._def.args.safeParse(e,i);if(!t.success)throw new Bn([n(e,t.error)]);const a=o(...t.data),s=this._def.returns.safeParse(a,i);if(!s.success)throw new Bn([r(a,s.error)]);return s.data}))}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new xr({...this._def,args:Nr.create(e).rest(gr.create())})}returns(e){return new xr({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,t,n){return new xr({args:e||Nr.create([]).rest(gr.create()),returns:t||gr.create(),typeName:Yr.ZodFunction,...nr(n)})}}class Dr extends rr{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})}}Dr.create=(e,t)=>new Dr({getter:e,typeName:Yr.ZodLazy,...nr(t)});class Ur extends rr{_parse(e){if(e.data!==this._def.value){const t=this._getOrReturnCtx(e);return Vn(t,{received:t.data,code:jn.invalid_literal,expected:this._def.value}),Hn}return{status:"valid",value:e.data}}get value(){return this._def.value}}function Lr(e,t){return new jr({values:e,typeName:Yr.ZodEnum,...nr(t)})}Ur.create=(e,t)=>new Ur({value:e,typeName:Yr.ZodLiteral,...nr(t)});class jr extends rr{_parse(e){if("string"!=typeof e.data){const t=this._getOrReturnCtx(e),n=this._def.values;return Vn(t,{expected:Cn.joinValues(n),received:t.parsedType,code:jn.invalid_type}),Hn}if(-1===this._def.values.indexOf(e.data)){const t=this._getOrReturnCtx(e),n=this._def.values;return Vn(t,{received:t.data,code:jn.invalid_enum_value,options:n}),Hn}return Jn(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 jr.create(e)}exclude(e){return jr.create(this.options.filter((t=>!e.includes(t))))}}jr.create=Lr;class Br extends rr{_parse(e){const t=Cn.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(e);if(n.parsedType!==Un.string&&n.parsedType!==Un.number){const e=Cn.objectValues(t);return Vn(n,{expected:Cn.joinValues(e),received:n.parsedType,code:jn.invalid_type}),Hn}if(-1===t.indexOf(e.data)){const e=Cn.objectValues(t);return Vn(n,{received:n.data,code:jn.invalid_enum_value,options:e}),Hn}return Jn(e.data)}get enum(){return this._def.values}}Br.create=(e,t)=>new Br({values:e,typeName:Yr.ZodNativeEnum,...nr(t)});class Zr extends rr{unwrap(){return this._def.type}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==Un.promise&&!1===t.common.async)return Vn(t,{code:jn.invalid_type,expected:Un.promise,received:t.parsedType}),Hn;const n=t.parsedType===Un.promise?t.data:Promise.resolve(t.data);return Jn(n.then((e=>this._def.type.parseAsync(e,{path:t.path,errorMap:t.common.contextualErrorMap}))))}}Zr.create=(e,t)=>new Zr({type:e,typeName:Yr.ZodPromise,...nr(t)});class zr extends rr{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===Yr.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=>{Vn(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?Hn:("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?Hn:("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(!$n(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=>$n(e)?Promise.resolve(r.transform(e.value,i)).then((e=>({status:t.value,value:e}))):e))}Cn.assertNever(r)}}zr.create=(e,t,n)=>new zr({schema:e,typeName:Yr.ZodEffects,effect:t,...nr(n)}),zr.createWithPreprocess=(e,t,n)=>new zr({schema:t,effect:{type:"preprocess",transform:e},typeName:Yr.ZodEffects,...nr(n)});class Wr extends rr{_parse(e){return this._getType(e)===Un.undefined?Jn(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}Wr.create=(e,t)=>new Wr({innerType:e,typeName:Yr.ZodOptional,...nr(t)});class Fr extends rr{_parse(e){return this._getType(e)===Un.null?Jn(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}Fr.create=(e,t)=>new Fr({innerType:e,typeName:Yr.ZodNullable,...nr(t)});class Vr extends rr{_parse(e){const{ctx:t}=this._processInputParams(e);let n=t.data;return t.parsedType===Un.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:t.path,parent:t})}removeDefault(){return this._def.innerType}}Vr.create=(e,t)=>new Vr({innerType:e,typeName:Yr.ZodDefault,defaultValue:"function"==typeof t.default?t.default:()=>t.default,...nr(t)});class Gr extends rr{_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 Yn(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}}Gr.create=(e,t)=>new Gr({innerType:e,typeName:Yr.ZodCatch,catchValue:"function"==typeof t.catch?t.catch:()=>t.catch,...nr(t)});class Hr extends rr{_parse(e){if(this._getType(e)!==Un.nan){const t=this._getOrReturnCtx(e);return Vn(t,{code:jn.invalid_type,expected:Un.nan,received:t.parsedType}),Hn}return{status:"valid",value:e.data}}}Hr.create=e=>new Hr({typeName:Yr.ZodNaN,...nr(e)});const Kr=Symbol("zod_brand");class Jr extends rr{_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 qr extends rr{_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?Hn:"dirty"===e.status?(t.dirty(),Kn(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?Hn:"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 qr({in:e,out:t,typeName:Yr.ZodPipeline})}}const Qr=(e,t={},n)=>e?yr.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})}})):yr.create(),$r={object:Sr.lazycreate};var Yr;!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"}(Yr||(Yr={}));const Xr=ur.create,ei=lr.create,ti=Hr.create,ni=dr.create,ri=pr.create,ii=fr.create,oi=hr.create,ai=mr.create,si=vr.create,ui=yr.create,ci=gr.create,li=_r.create,di=wr.create,pi=Tr.create,fi=Sr.create,hi=Sr.strictCreate,mi=Pr.create,vi=Ar.create,yi=kr.create,gi=Nr.create,_i=Cr.create,wi=Mr.create,Ti=Rr.create,bi=xr.create,Ei=Dr.create,Si=Ur.create,Pi=jr.create,Ii=Br.create,Ai=Zr.create,Oi=zr.create,ki=Wr.create,Ni=Fr.create,Ci=zr.createWithPreprocess,Mi=qr.create,Ri={string:e=>ur.create({...e,coerce:!0}),number:e=>lr.create({...e,coerce:!0}),boolean:e=>pr.create({...e,coerce:!0}),bigint:e=>dr.create({...e,coerce:!0}),date:e=>fr.create({...e,coerce:!0})},xi=Hn;var Di=Object.freeze({__proto__:null,defaultErrorMap:Zn,setErrorMap:function(e){zn=e},getErrorMap:Wn,makeIssue:Fn,EMPTY_PATH:[],addIssueToContext:Vn,ParseStatus:Gn,INVALID:Hn,DIRTY:Kn,OK:Jn,isAborted:qn,isDirty:Qn,isValid:$n,isAsync:Yn,get util(){return Cn},ZodParsedType:Un,getParsedType:Ln,ZodType:rr,ZodString:ur,ZodNumber:lr,ZodBigInt:dr,ZodBoolean:pr,ZodDate:fr,ZodSymbol:hr,ZodUndefined:mr,ZodNull:vr,ZodAny:yr,ZodUnknown:gr,ZodNever:_r,ZodVoid:wr,ZodArray:Tr,get objectUtil(){return br},ZodObject:Sr,ZodUnion:Pr,ZodDiscriminatedUnion:Ar,ZodIntersection:kr,ZodTuple:Nr,ZodRecord:Cr,ZodMap:Mr,ZodSet:Rr,ZodFunction:xr,ZodLazy:Dr,ZodLiteral:Ur,ZodEnum:jr,ZodNativeEnum:Br,ZodPromise:Zr,ZodEffects:zr,ZodTransformer:zr,ZodOptional:Wr,ZodNullable:Fr,ZodDefault:Vr,ZodCatch:Gr,ZodNaN:Hr,BRAND:Kr,ZodBranded:Jr,ZodPipeline:qr,custom:Qr,Schema:rr,ZodSchema:rr,late:$r,get ZodFirstPartyTypeKind(){return Yr},coerce:Ri,any:ui,array:pi,bigint:ni,boolean:ri,date:ii,discriminatedUnion:vi,effect:Oi,enum:Pi,function:bi,instanceof:(e,t={message:`Input not instance of ${e.name}`})=>Qr((t=>t instanceof e),t,!0),intersection:yi,lazy:Ei,literal:Si,map:wi,nan:ti,nativeEnum:Ii,never:li,null:si,nullable:Ni,number:ei,object:fi,oboolean:()=>ri().optional(),onumber:()=>ei().optional(),optional:ki,ostring:()=>Xr().optional(),pipeline:Mi,preprocess:Ci,promise:Ai,record:_i,set:Ti,strictObject:hi,string:Xr,symbol:oi,transformer:Oi,tuple:gi,undefined:ai,union:mi,unknown:ci,void:di,NEVER:xi,ZodIssueCode:jn,quotelessJson:e=>JSON.stringify(e,null,2).replace(/"([^"]+)":/g,"$1:"),ZodError:Bn}),Ui=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,I,A,O,k;St(this,t),this.initConfig=window.APP_CONFIG;var N=Et.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?ge:_e;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 C,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)?ye.HIDE_BACK:ye.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)?ye.SHOW_HOME:ye.HIDE_HOME,D=new URL(location.href),U=wn(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)&&(N=(null===(C=this.initConfig)||void 0===C||null===(M=C.app)||void 0===M?void 0:M.actionBarHidden)?_e:ge);this.config={actionbarType:N,buttonType:R,statusbarType:U,dataConfig:{backgroundColor:(null===(S=this.initConfig)||void 0===S||null===(P=S.app)||void 0===P?void 0:P.headerColor)||we,textColor:(null===(I=this.initConfig)||void 0===I||null===(A=I.app)||void 0===A?void 0:A.textColor)||"",textAlign:(null===(O=this.initConfig)||void 0===O||null===(k=O.app)||void 0===k?void 0:k.textAlign)||Te,viewInLeftType:R,confirmToExit:1},homeConfig:{enable:x,url:"".concat(s,"/").concat(o,"/").concat(D.search)}}}var n=t.prototype;return n.setNavigationBarTitle=function(e){return Se((function(){return ke(this,(function(t){return[2,new Promise((function(t,n){cn("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 Se((function(){var r,i;return ke(this,(function(o){return void 0===(void 0===e?"undefined":vt(e))&&null===(void 0===e?"undefined":vt(e))||(r="none"===e||"home"===e?ye.HIDE_BACK:ye.SHOW_BACK,i="home"===e||"both"===e?ye.SHOW_HOME:ye.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){cn("CHANGE_ACTIONBAR_LEFTBUTTON_TYPE",Ze({},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 Se((function(){var r,i,o;return ke(this,(function(a){return i=t?e.AndroidBottomNavigationBarType.hide:e.AndroidBottomNavigationBarType.show,o=null===(r=De())||void 0===r?void 0:r.platform,[2,new Promise((function(e,r){if(!(null==o?void 0:o.isAndroid))return e();cn("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 Se((function(){var r,i,o;return ke(this,(function(a){return i=t?e.IOSSafeAreaBottomType.hide:e.IOSSafeAreaBottomType.show,o=null===(r=De())||void 0===r?void 0:r.platform,[2,new Promise((function(e,r){if(!(null==o?void 0:o.isIOS))return e();cn("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 Se((function(){var r;return ke(this,(function(i){return r=n.config,Et.isString(t.headerColor)&&(r.dataConfig.backgroundColor=t.headerColor),Et.isString(t.headerTextColor)&&(r.dataConfig.textColor=t.headerTextColor),Et.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=_e:!1===t.hideActionBar&&(r.actionbarType=ge),"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){cn("CHANGE_ACTIONBAR",Ze({},r),{success:function(){var o;n.config=Ze({},r);var a,s=null===(o=De())||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===_e;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}(),Li=Ui.getInstance(),ji=[fi({title:Xr()}).optional()];function Bi(e){return Zi.apply(this,arguments)}function Zi(){return Zi=Se((function(e){return ke(this,(function(t){return[2,In("setNavigationBarTitle",ji,[e],function(){var e=Se((function(e){return ke(this,(function(t){switch(t.label){case 0:return Ue.isMp?[4,Li.setNavigationBarTitle(e.title)]:[3,2];case 1:return[2,t.sent()];case 2:return Ue.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(je("setNavigationBarTitle",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Zi.apply(this,arguments)}var zi=[fi({color:Xr(),textColor:Di.enum(["black","white"]).optional(),statusBarColor:Xr().optional()}).optional()];function Wi(e){return Fi.apply(this,arguments)}function Fi(){return Fi=Se((function(e){return ke(this,(function(t){return[2,In("setNavigationBarColor",zi,[e],function(){var e=Se((function(e){return ke(this,(function(t){switch(t.label){case 0:return Ue.isMp?[4,Li.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 Ue.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(je("setNavigationBarColor",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Fi.apply(this,arguments)}var Vi=[fi({type:Di.enum(["none","back","home","both"])}).optional()];function Gi(e){return Hi.apply(this,arguments)}function Hi(){return Hi=Se((function(e){return ke(this,(function(t){return[2,In("setNavigationBarLeftButton",Vi,[e],function(){var e=Se((function(e){return ke(this,(function(t){switch(t.label){case 0:return Ue.isMp?[4,Li.setNavigationBarLeftButton(e.type)]:[3,2];case 1:return[2,t.sent()];case 2:return Ue.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(je("setNavigationBarLeftButton",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Hi.apply(this,arguments)}function Ki(e,t,n){if(!t.has(e))throw new TypeError("attempted to "+n+" private field on non-instance");return t.get(e)}function Ji(e,t){return function(e,t){return t.get?t.get.call(e):t.value}(e,Ki(e,t,"get"))}function qi(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 Qi(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,Ki(e,t,"set"),n),n}var $i,Yi,Xi,eo=function(){function e(){St(this,e)}var t=e.prototype;return t.getSynchronize=function(e){return new Map},t.setSynchronize=function(e){return{errorKeys:[]}},t.getInfoSynchronize=function(){return{currentSize:0,limitSize:0}},t.removeSynchronize=function(e){return{errorKeys:[]}},t.clearSynchronize=function(){},t.getItem=function(e){return this.getSynchronize([e]).get(e)||null},t.setItem=function(e,t){if(this.setSynchronize(Be({},e,t)).errorKeys.length>0)throw new Error("Failed to set item: ".concat(e))},t.removeItem=function(e){this.removeSynchronize([e])},t.clear=function(){this.clearSynchronize()},t.getStorageInfo=function(){return this.getInfoSynchronize()},e}(),to=new WeakMap,no=new WeakMap,ro=new WeakMap,io=function(e){Ct(n,e);var t=Rt(n);function n(e){var r;return St(this,n),qi(Mt(r=t.call(this)),to,{writable:!0,value:localStorage}),qi(Mt(r),no,{writable:!0,value:void 0}),qi(Mt(r),ro,{writable:!0,value:void 0}),Qi(Mt(r),ro,{keys:new Set,currentSize:0,limitSize:le}),Qi(Mt(r),no,e),r.findAllCurrentDataByApp(e),r}var r=n.prototype;return r.findAllCurrentDataByApp=function(e){try{var t;for(t in Ji(this,to)){if(e)if(t.split("_")[0]!==e)continue;Ji(this,ro).keys.add(t)}}catch(e){}},r.get=function(e){var t=this,n=new Map;return e.forEach((function(e){n.set(e,t.getSync(e))})),Promise.resolve(n)},r.getSync=function(e){return Ji(this,no)&&(e="".concat(Ji(this,no),"_").concat(e)),Ji(this,ro).keys.has(e)?Ji(this,to).getItem(e):null},r.set=function(e){var t=this;return Se((function(){return ke(this,(function(n){return Object.entries(e).forEach((function(e){var n=ze(e,2),r=n[0],i=n[1];t.setSync(r,i.replace(/\\"/g,'"'))})),[2,Promise.resolve({errorKeys:[]})]}))}))()},r.setSync=function(e,t){Ji(this,no)&&(e="".concat(Ji(this,no),"_").concat(e)),Ji(this,to).setItem(e,t),Ji(this,ro).keys.add(e)},r.getInfo=function(){var e=this;return Se((function(){return ke(this,(function(t){return[2,Promise.resolve(e.getInfoSync())]}))}))()},r.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}(Ji(this,to),Ji(this,no));return{currentSize:Et.isNumber(e)?Number((e/1024).toFixed(2)):0,limitSize:Number((le/1024).toFixed(2))}},r.remove=function(e){var t=this;return Se((function(){return ke(this,(function(n){return e.forEach((function(e){t.removeSync(e)})),[2,Promise.resolve({errorKeys:[]})]}))}))()},r.removeSync=function(e){Ji(this,no)&&(e="".concat(Ji(this,no),"_").concat(e)),Ji(this,ro).keys.has(e)&&(Ji(this,to).removeItem(e),Ji(this,ro).keys.delete(e))},r.clearAsync=function(){var e=this;return Se((function(){return ke(this,(function(t){return[2,Promise.resolve(e.clearSync())]}))}))()},r.clearSync=function(){var e=this;Ji(this,ro).keys.forEach((function(t){Ji(e,no)&&t.indexOf(Ji(e,no))<0||(Ji(e,to).removeItem(t),Ji(e,ro).keys.delete(t))}))},r.setSynchronize=function(e){var t=this;return Object.entries(e).forEach((function(e){var n=ze(e,2),r=n[0],i=n[1];t.setSync(r,i)})),{errorKeys:[]}},r.getSynchronize=function(e){var t=this,n=new Map;return e.forEach((function(e){n.set(e,t.getSync(e))})),n},r.getInfoSynchronize=function(){return this.getInfoSync()},r.clearSynchronize=function(){this.clearSync()},n}(eo),oo=new WeakMap,ao=new WeakMap,so=function(e){Ct(n,e);var t=Rt(n);function n(e){var r;return St(this,n),qi(Mt(r=t.call(this)),oo,{writable:!0,value:void 0}),qi(Mt(r),ao,{writable:!0,value:void 0}),Qi(Mt(r),ao,{keys:new Set,currentSize:0,limitSize:le}),Qi(Mt(r),oo,e),r}var r=n.prototype;return r.get=function(e){var t=this;return Se((function(){return ke(this,(function(n){return[2,new Promise((function(n,r){cn("ZBROWSER_MPDS",{mpds_action:"mpds.get",mpds_data:{keys:e},appId:Ji(t,oo)},{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})}))]}))}))()},r.getSynchronize=function(e){var t={mpds_action:"mpds.get",mpds_data:{keys:e},appId:Ji(this,oo)},n=new Map,r=this.handleResult(t);return r&&r.mpds_data&&r.mpds_data.map&&(n=new Map(Object.entries(r.mpds_data.map))),n},r.set=function(e){var t=this;return Se((function(){return ke(this,(function(n){return[2,new Promise((function(n,r){cn("ZBROWSER_MPDS",{mpds_action:"mpds.set",mpds_data:{map:e},appId:Ji(t,oo)},{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})}))]}))}))()},r.setSynchronize=function(e){var t={mpds_action:"mpds.set",mpds_data:{map:e},appId:Ji(this,oo)},n=[],r=this.handleResult(t);return r&&r.mpds_data&&r.mpds_data.error_keys&&(n=r.mpds_data.error_keys),{errorKeys:n}},r.getInfo=function(){var e=this;return Se((function(){return ke(this,(function(t){return[2,new Promise((function(t,n){cn("ZBROWSER_MPDS",{mpds_action:"mpds.get.size",mpds_data:{},appId:Ji(e,oo)},{success:function(e){var n=0;e&&e.mpds_data&&e.mpds_data.size&&(n=e.mpds_data.size),t({currentSize:Et.isNumber(n)?Number(Number(n)/1024):0,limitSize:Number(le/1024)})},fail:function(e){n(e)}},{isMultiCallback:!1})}))]}))}))()},r.getInfoSynchronize=function(){var e={mpds_action:"mpds.get.size",mpds_data:{},appId:Ji(this,oo)},t=0,n=this.handleResult(e);return n&&n.mpds_data&&n.mpds_data.size&&(t=n.mpds_data.size),{currentSize:Et.isNumber(t)?Number(Number(t)/1024):0,limitSize:Number(le/1024)}},r.remove=function(e){var t=this;return Se((function(){return ke(this,(function(n){return[2,new Promise((function(n,r){cn("ZBROWSER_MPDS",{mpds_action:"mpds.remove.key",mpds_data:{keys:e},appId:Ji(t,oo)},{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})}))]}))}))()},r.removeSynchronize=function(e){var t={mpds_action:"mpds.remove.key",mpds_data:{keys:e},appId:Ji(this,oo)},n=[],r=this.handleResult(t);return r&&r.mpds_data&&r.mpds_data.error_keys&&(n=r.mpds_data.error_keys),{errorKeys:n}},r.clearAsync=function(){var e=this;return Se((function(){return ke(this,(function(t){return[2,new Promise((function(t,n){cn("ZBROWSER_MPDS",{mpds_action:"mpds.clear.appData",mpds_data:{},appId:Ji(e,oo)},{success:function(){t()},fail:function(e){n(e)}},{isMultiCallback:!1})}))]}))}))()},r.clearSynchronize=function(){var e={mpds_action:"mpds.clear.appData",mpds_data:{},appId:Ji(this,oo)};this.handleResult(e)},r.handleResult=function(e){var t=null;try{var n=ZaloJavaScriptInterface.processActionMPDS(JSON.stringify(e));if(n=JSON.parse(n)){if(0===n.error_code)return n.data;t=un(n).toJSON()}}catch(e){t=e}finally{if(null!==t)throw t}return{}},n}(eo),uo=function(){function e(){St(this,e)}var t=e.prototype;return t.getDataFromStorage=function(e){var t=this;return Se((function(){var n,r;return ke(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]=vn(e)})),[2,r]}}))}))()},t.getItem=function(e){return this.getInstance().getItem(e)},t.putDataToStorage=function(e){var t=this;return Se((function(){var n,r;return ke(this,(function(i){switch(i.label){case 0:return n=t.getInstance(),r={},Object.entries(e).forEach((function(e){var t=ze(e,2),n=t[0],i=t[1];Et.isUndefined(i)||Et.isNull(i)||(r[n]=_n(i))})),[4,n.set(r)];case 1:return[2,i.sent()]}}))}))()},t.setItem=function(e,t){return this.getInstance().setItem(e,t)},t.removeDataFromStorage=function(e){var t=this;return Se((function(){return ke(this,(function(n){switch(n.label){case 0:return[4,t.getInstance().remove(e)];case 1:return[2,n.sent()]}}))}))()},t.removeItem=function(e){this.getInstance().removeItem(e)},t.clearStorage=function(){var e=this;return Se((function(){return ke(this,(function(t){switch(t.label){case 0:return[4,e.getInstance().clearAsync()];case 1:return t.sent(),[2]}}))}))()},t.clearStorageSync=function(){this.getInstance().clear()},t.getStorageInfo=function(){var e=this;return Se((function(){return ke(this,(function(t){switch(t.label){case 0:return[4,e.getInstance().getInfo()];case 1:return[2,t.sent()]}}))}))()},t.getStorageInfoSync=function(){return this.getInstance().getStorageInfo()},e}(),co=new WeakMap,lo=function(e){Ct(n,e);var t=Rt(n);function n(e){var r;return St(this,n),qi(Mt(r=t.call(this)),co,{writable:!0,value:void 0}),Qi(Mt(r),co,e),r}return n.prototype.getInstance=function(){return new io(Ji(this,co))},n}(uo),po=new WeakMap,fo=function(e){Ct(n,e);var t=Rt(n);function n(e){var r;return St(this,n),qi(Mt(r=t.call(this)),po,{writable:!0,value:void 0}),Qi(Mt(r),po,e),r}return n.prototype.getInstance=function(){return new so(Ji(this,po))},n}(uo),ho=new lo(o),mo=(null===($i=De())||void 0===$i?void 0:$i.zaloVersion)||"",vo=(null===(Yi=De())||void 0===Yi?void 0:Yi.platformName)||"unknown";!!Et.isString(mo)&&parseInt(mo,10)>={android:12100571,iOS:400,wp:0,unknown:0}[vo]&&(null===(Xi=De())||void 0===Xi?void 0:Xi.appEnv.isMp)&&(ho=new fo(o));var yo=ho,go=[fi({data:Di.record(Xr(),Di.any())}).optional()];function _o(e){return wo.apply(this,arguments)}function wo(){return wo=Se((function(e){return ke(this,(function(t){return[2,In("setStorage",go,[e],function(){var e=Se((function(e){return ke(this,(function(t){switch(t.label){case 0:return Ue.isMp||Ue.isMpWeb?[4,yo.putDataToStorage(e.data)]:[3,2];case 1:return[2,t.sent()];case 2:return[2,Promise.reject(je("setStorage",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),wo.apply(this,arguments)}var To=[fi({keys:Di.array(Xr())}).optional()];function bo(e){return Eo.apply(this,arguments)}function Eo(){return Eo=Se((function(e){return ke(this,(function(t){return[2,In("getStorage",To,[e],function(){var e=Se((function(e){return ke(this,(function(t){switch(t.label){case 0:return Ue.isMp||Ue.isMpWeb?[4,yo.getDataFromStorage(e.keys)]:[3,2];case 1:return[2,t.sent()];case 2:return[2,Promise.reject(je("getStorage",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Eo.apply(this,arguments)}function So(e){return Po.apply(this,arguments)}function Po(){return(Po=Se((function(e){return ke(this,(function(t){return[2,In("getStorageInfo",[],[e],Se((function(){return ke(this,(function(e){switch(e.label){case 0:return Ue.isMp||Ue.isMpWeb?[4,yo.getStorageInfo()]:[3,2];case 1:return[2,e.sent()];case 2:return[2,Promise.reject(je("getStorageInfo",{}))]}}))})))]}))}))).apply(this,arguments)}var Io=[fi({keys:Di.array(Xr())}).optional()];function Ao(e){return Oo.apply(this,arguments)}function Oo(){return Oo=Se((function(e){return ke(this,(function(t){return[2,In("removeStorage",Io,[e],function(){var e=Se((function(e){return ke(this,(function(t){switch(t.label){case 0:return Ue.isMp||Ue.isMpWeb?[4,yo.removeDataFromStorage(e.keys)]:[3,2];case 1:return[2,t.sent()];case 2:return[2,Promise.reject(je("removeStorage",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Oo.apply(this,arguments)}var ko=[fi({prefix:Xr().optional()}).optional()];function No(e){return Co.apply(this,arguments)}function Co(){return(Co=Se((function(e){return ke(this,(function(t){return[2,In("clearStorage",ko,[e],Se((function(){return ke(this,(function(e){switch(e.label){case 0:return Ue.isMp||Ue.isMpWeb?[4,yo.clearStorage()]:[3,2];case 1:return[2,e.sent()];case 2:return[2,Promise.reject(je("clearStorage",{}))]}}))})))]}))}))).apply(this,arguments)}var Mo=function(){var e=Se((function(e,t){var n,r,i,a;return ke(this,(function(s){switch(s.label){case 0:return(r=t)?[3,2]:[4,En()];case 1:r=!s.sent(),s.label=2;case 2:return n=r,[4,pn.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=Se((function(e){var t,n,r,i,o,a;return ke(this,(function(s){switch(s.label){case 0:return[4,e.json()];case 1:if(r=s.sent(),void 0!==(i=null==r?void 0:r.error)&&i<0)throw o=(null==r?void 0:r.message)||J,new tn(i,o);return a=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:a,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)}}(),Ro=[fi({avatarType:Di.enum(["small","normal","large"]).optional(),autoRequestPermission:Di.boolean().default(!1).optional()}).optional()];function xo(e){return Do.apply(this,arguments)}function Do(){return Do=Se((function(e){return ke(this,(function(t){return[2,In("getUserInfo",Ro,[e],function(){var e=Se((function(e){var t,n,r;return ke(this,(function(i){switch(i.label){case 0:if(!Ue.isMp)return[3,4];t=null==e?void 0:e.avatarType,n=null==e?void 0:e.autoRequestPermission,i.label=1;case 1:return i.trys.push([1,3,,4]),[4,Mo(t,n)];case 2:return[2,{userInfo:i.sent()}];case 3:return r=i.sent(),[2,Promise.reject(r)];case 4:return Ue.isMpWeb?[2,Promise.resolve({userInfo:{id:"3368637342326461234",name:"User Name",avatar:"https://h5.zdn.vn/static/images/avatar.png"}})]:[2,Promise.reject(je("getUserInfo",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Do.apply(this,arguments)}var Uo=function(e){return{NONE:e?-2:0,WIFI:e?0:1,"2G":2,"3G":e?15:2,"4G":e?13:2}},Lo=Se((function(){return ke(this,(function(t){return[2,new Promise((function(t,n){cn("WEBVIEW_NETWORKTYPE",{url:window.location.href,featureId:""},{success:function(n){var r,i,o,a=n.network,s=(null===(r=De())||void 0===r||null===(i=r.platform)||void 0===i?void 0:i.isAndroid)||!1;switch(a){case Uo(s).NONE:o=e.NetworkType.none;break;case Uo(s).WIFI:o=e.NetworkType.wifi;break;case Uo(s)["2G"]:case Uo(s)["3G"]:case Uo(s)["4G"]:o=e.NetworkType.cellular;break;default:o=e.NetworkType.unknown}t(o)},fail:function(e){n(e)}},{})}))]}))}));function jo(e){return Bo.apply(this,arguments)}function Bo(){return(Bo=Se((function(t){return ke(this,(function(n){return[2,In("getNetworkType",[],[t],Se((function(){var t,n;return ke(this,(function(r){switch(r.label){case 0:return Ue.isMp?[4,Lo()]:[3,2];case 1:return[2,{networkType:r.sent()}];case 2:if(Ue.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(je("getNetworkType",{}))]}}))})))]}))}))).apply(this,arguments)}var Zo=[Di.function().args(fi({isConnected:Di.boolean(),networkType:Di.enum(["none","wifi","cellular","unknown"])})).returns(Di.void())];function zo(t){return In("onNetworkStatusChange",Zo,[t],(function(t){var n=t;if(Ue.isMp)!function(t){Ut.getInstance().on(e.Events.NetworkChanged,(function(e){var n=null==e?void 0:e.state;Lo().then((function(e){t({isConnected:"CONNECTED"===n,networkType:e})}))}))}(n);else if(Ue.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 Wo=function(){var e=Se((function(e){var t,n,r,i,o,a;return ke(this,(function(s){return a={subaction:0,scanning_type:Et.isNumber(null==e?void 0:e.scanningType)?e.scanningType:0,data:{scan_from_source:Et.isString(null==e?void 0:e.scanFromSource)?e.scanFromSource:"",expire:Et.isNumber(null==e?void 0:e.expire)?e.expire:3e3,monitor_interval:Et.isNumber(null==e?void 0:e.monitorInterval)?e.monitorInterval:60,domain:Et.isString(null==e?void 0:e.domain)?e.domain:"",scan_config:{scan_time:Et.isNumber(null==e||null===(t=e.scanConfig)||void 0===t?void 0:t.scanTime)?e.scanConfig.scanTime:15e3,time_between_scan:Et.isNumber(null==e||null===(n=e.scanConfig)||void 0===n?void 0:n.timeBetweenScan)?e.scanConfig.timeBetweenScan:1e4,beacon_timeout:Et.isNumber(null==e||null===(r=e.scanConfig)||void 0===r?void 0:r.beaconTimeout)?e.scanConfig.beaconTimeout:3e4,delayCheckConnectedTimeout:Et.isNumber(null==e||null===(i=e.scanConfig)||void 0===i?void 0:i.delayCheckConnectedTimeout)?e.scanConfig.delayCheckConnectedTimeout:5e3,beaconConnectedTimeout:Et.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){cn("SCAN_IBEACON",Ze({},a),{success:function(){e(!0)},fail:function(e){t(e)}},{})}))]}))}));return function(t){return e.apply(this,arguments)}}(),Fo=[fi({scanningType:Di.number().refine((function(e){return[0,1].includes(e)}),{message:"The type must be either 0 or 1"}).default(0).optional(),expire:Di.number().optional(),monitorInterval:Di.number().optional(),domain:Di.string().optional(),scanConfig:fi({scanTime:Di.number().optional(),timeBetweenScan:Di.number().optional(),beaconTimeout:Di.number().optional(),delayCheckConnectedTimeout:Di.number().optional(),beaconConnectedTimeout:Di.number().optional()}).optional(),items:Di.array(fi({id:Di.string().optional(),distance:Di.number().optional(),monitor:fi({enable:Di.boolean().optional(),movingRange:Di.number().optional()}).optional()})).optional(),scanFromSource:Di.string().optional()}).optional()];function Vo(e){return Go.apply(this,arguments)}function Go(){return(Go=Se((function(e){return ke(this,(function(t){return[2,In("startBeaconDiscovery",Fo,[e],Se((function(){return ke(this,(function(t){switch(t.label){case 0:return Ue.isMp?[4,Wo(e)]:[3,2];case 1:return[2,t.sent()];case 2:return Ue.isMpWeb?[2,Promise.resolve(!0)]:[2,Promise.reject(je("startBeaconDiscovery",{}))]}}))})))]}))}))).apply(this,arguments)}var Ho=Se((function(){return ke(this,(function(e){return[2,new Promise((function(e,t){cn("SCAN_IBEACON",{subaction:2},{success:function(){e(!0)},fail:function(e){t(e)}},{})}))]}))}));function Ko(e){return Jo.apply(this,arguments)}function Jo(){return(Jo=Se((function(e){return ke(this,(function(t){return[2,In("stopBeaconDiscovery",[],[e],Se((function(){return ke(this,(function(e){switch(e.label){case 0:return Ue.isMp?[4,Ho()]:[3,2];case 1:return[2,e.sent()];case 2:return Ue.isMpWeb?[2,Promise.resolve(!0)]:[2,Promise.reject(je("stopBeaconDiscovery",{}))]}}))})))]}))}))).apply(this,arguments)}var qo=Se((function(){return ke(this,(function(e){return[2,new Promise((function(e,t){cn("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 Qo(e){return $o.apply(this,arguments)}function $o(){return($o=Se((function(e){return ke(this,(function(t){return[2,In("getBeacons",[],[e],Se((function(){return ke(this,(function(e){switch(e.label){case 0:return Ue.isMp?[4,qo()]:[3,2];case 1:return[2,e.sent()];case 2:return Ue.isMpWeb?[2,Promise.resolve({beacons:[]})]:[2,Promise.reject(je("getBeacons",{}))]}}))})))]}))}))).apply(this,arguments)}var Yo=Se((function(){return ke(this,(function(e){return[2,new Promise((function(e,t){cn("WINDOW_CLOSE",{},{success:function(t){e(t)},fail:function(e){t(e)}},{})}))]}))}));function Xo(e){return ea.apply(this,arguments)}function ea(){return(ea=Se((function(e){return ke(this,(function(t){return[2,In("closeApp",[],[e],Se((function(){return ke(this,(function(e){switch(e.label){case 0:return Ue.isMp?[4,Yo()]:[3,2];case 1:return[2,e.sent()];case 2:return Ue.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(je("closeApp",{}))]}}))})))]}))}))).apply(this,arguments)}var ta=Se((function(){return ke(this,(function(e){return[2,new Promise((function(e,t){cn("OPEN_QR",{skipOpenLink:!0},{success:function(t){e(t)},fail:function(e){t(e)}},{})}))]}))}));function na(e){return ra.apply(this,arguments)}function ra(){return(ra=Se((function(e){return ke(this,(function(t){return[2,In("scanQRCode",[],[e],Se((function(){return ke(this,(function(e){switch(e.label){case 0:return Ue.isMp?[4,ta()]:[3,2];case 1:return[2,e.sent()];case 2:return Ue.isMpWeb?[2,Promise.resolve({content:""})]:[2,Promise.reject(je("scanQRCode",{}))]}}))})))]}))}))).apply(this,arguments)}var ia=function(){var t=Se((function(t,n,r,o){return ke(this,(function(a){return[2,new Promise((function(a,s){cn("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)}}(),oa=[fi({id:Xr(),type:Di.enum(["user","oa","aliasOA"]),sourceId:Di.any().optional(),sourceIndex:Di.any().optional()}).optional()];function aa(e){return sa.apply(this,arguments)}function sa(){return sa=Se((function(e){return ke(this,(function(t){return[2,In("openProfile",oa,[e],function(){var e=Se((function(e){var t,n,r,i;return ke(this,(function(o){switch(o.label){case 0:return Ue.isMp?(t=e.id,n=e.type,r=e.sourceId,i=e.sourceIndex,[4,ia(t,n,r,i)]):[3,2];case 1:return[2,o.sent()];case 2:return Ue.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(je("openProfile",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),sa.apply(this,arguments)}var ua=function(){var t=Se((function(t,n){var r,o,a,s=arguments;return ke(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){cn("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)}}(),ca=[fi({id:Xr(),type:Di.enum(["user","oa"]),sourceId:Di.any().optional(),sourceIndex:Di.any().optional(),message:Xr().optional()}).optional()];function la(e){return da.apply(this,arguments)}function da(){return da=Se((function(e){return ke(this,(function(t){return[2,In("openChat",ca,[e],function(){var e=Se((function(e){var t,n,r,i,o;return ke(this,(function(a){switch(a.label){case 0:return Ue.isMp?(t=e.id,n=e.type,r=e.message,i=e.sourceId,o=e.sourceIndex,[4,ua(t,n,r,i,o)]):[3,2];case 1:return[2,a.sent()];case 2:return Ue.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(je("openChat",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),da.apply(this,arguments)}function pa(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 fa=function(){var t=Se((function(t,n){var r,o;return ke(this,(function(a){switch(r={},o=t,t){case"image":(null==n?void 0:n.imageUrls)?(o="multi_image",r={photoUrl:null==n?void 0:n.imageUrls}):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(t,n){cn("OPEN_POSTFEED",pa(Ze({type:e.PostFeedType[o]},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)}},{})}))]}))}));return function(e,n){return t.apply(this,arguments)}}(),ha=[Di.union([fi({type:Di.enum(["image"]),data:fi({imageUrl:Xr().url().optional(),imageUrls:Di.array(Xr().url()).optional()})}),fi({type:Di.enum(["link"]),data:fi({link:Xr().url(),title:Xr().max(100).optional(),thumb:Xr().url().optional(),description:Xr().max(400).default("").optional()})}),fi({type:Di.enum(["profile"]),data:fi({id:Xr().optional()})})])];function ma(e){return va.apply(this,arguments)}function va(){return va=Se((function(e){return ke(this,(function(t){return[2,In("openPostFeed",ha,[e],function(){var e=Se((function(e){var t,n;return ke(this,(function(r){switch(r.label){case 0:return Ue.isMp?(t=e.type,n=e.data,[4,fa(t,n)]):[3,2];case 1:return[2,r.sent()];case 2:return Ue.isMpWeb?[2,Promise.resolve({status:1,shareType:0,numberOfUser:0})]:[2,Promise.reject(je("openPostFeed",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),va.apply(this,arguments)}var ya=function(){var e=Se((function(e){return ke(this,(function(t){return[2,new Promise((function(t,n){cn("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)}}(),ga=[fi({id:Xr(),showDialogConfirm:Di.boolean().optional()}).optional()];function _a(e){return wa.apply(this,arguments)}function wa(){return wa=Se((function(e){return ke(this,(function(t){return[2,In("followOA",ga,[e],function(){var e=Se((function(e){var t;return ke(this,(function(n){switch(n.label){case 0:return Ue.isMp?(t=e.id,[4,ya(t)]):[3,2];case 1:return[2,n.sent()];case 2:return Ue.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(je("followOA",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),wa.apply(this,arguments)}var Ta=function(){var e=Se((function(e){return ke(this,(function(t){return[2,new Promise((function(t,n){cn("UNFOLLOW_OA",{uid:e,forceUpdate:!0,zapp:i},{success:function(){t()},fail:function(e){n(e)}},{})}))]}))}));return function(t){return e.apply(this,arguments)}}(),ba=[fi({id:Xr()}).optional()];function Ea(e){return Sa.apply(this,arguments)}function Sa(){return Sa=Se((function(e){return ke(this,(function(t){return[2,In("unfollowOA",ba,[e],function(){var e=Se((function(e){var t;return ke(this,(function(n){switch(n.label){case 0:return Ue.isMp?(t=e.id,[4,Ta(t)]):[3,2];case 1:return[2,n.sent()];case 2:return Ue.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(je("unfollowOA",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Sa.apply(this,arguments)}var Pa=function(){var e=Se((function(e,t,n,r,i,o){var s,u,l,p,f,h,m,v;return ke(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,Ze({method:"POST",body:p},m))];case 1:return[4,y.sent().json()];case 2:if(!(v=y.sent())||0!==v.err)throw sn.error.cannotGetShareInfo();return h.search="".concat(h.search,"&zshareId=").concat(v.data.shareId),[2,pa(Ze({},v.data),{shareableLink:h.href})]}}))}));return function(t,n,r,i,o,a){return e.apply(this,arguments)}}(),Ia=function(){var t=Se((function(t,n){var r,a,s,u,c,l,d,p,f,h,m,v;return ke(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=De())||void 0===u?void 0:u.zaloVersion)||0,p=(null===(c=De())||void 0===c?void 0:c.platformName)||"unknown",Number(d)>=ce[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,pn.getAccessToken()];case 8:case 11:return s=y.sent(),[4,Pa(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){cn("OPEN_SHARESHEET",pa(Ze({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)}}(),Aa=[Di.union([fi({type:Di.enum(["text"]),data:fi({text:Xr(),description:Xr().default("").optional(),autoParseLink:Di.boolean().default(!1).optional()})}),fi({type:Di.enum(["image"]),data:fi({imageUrl:Xr().url().optional(),imageUrls:Di.array(Xr().url()).max(10).optional()})}),fi({type:Di.enum(["link"]),data:fi({link:Xr().url(),chatOnly:Di.boolean().optional()})}),fi({type:Di.enum(["oa"]),data:fi({id:Xr()})}),fi({type:Di.enum(["gif"]),data:fi({gifUrl:Xr().url(),imageUrl:Xr().url().optional(),width:ei().min(0).optional(),height:ei().min(0).optional()})}),fi({type:Di.enum(["video"]),data:fi({videoThumb:Xr().url(),videoUrl:Xr().url(),width:ei().min(0).optional(),height:ei().min(0).optional()})}),fi({type:Di.enum(["zmp","zmp_deep_link"]),data:fi({title:Xr().max(100),thumbnail:Xr().url(),path:Xr().optional(),description:Xr().max(400).default("").optional()})})])];function Oa(e){return ka.apply(this,arguments)}function ka(){return ka=Se((function(e){return ke(this,(function(t){return[2,In("openShareSheet",Aa,[e],function(){var e=Se((function(e){var t,n;return ke(this,(function(r){switch(r.label){case 0:return Ue.isMp?(t=e.type,n=e.data,[4,Ia(t,n)]):[3,2];case 1:return[2,r.sent()];case 2:return Ue.isMpWeb?[2,Promise.resolve({status:2,shareType:0,numberOfUser:0})]:[2,Promise.reject(je("openShareSheet",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),ka.apply(this,arguments)}var Na=Se((function(){return ke(this,(function(e){return[2,new Promise((function(e,t){cn("REQUEST_PERMISSION_CAMERA",{},{success:function(t){var n,r;(null===(n=De())||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=De())||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 Ca(e){return Ma.apply(this,arguments)}function Ma(){return(Ma=Se((function(e){return ke(this,(function(t){return[2,In("requestCameraPermission",[],[e],Se((function(){return ke(this,(function(e){switch(e.label){case 0:return[4,Na()];case 1:return[2,e.sent()]}}))})))]}))}))).apply(this,arguments)}var Ra=function(){var e=Se((function(e,t,n){return ke(this,(function(r){return[2,new Promise((function(r,i){cn("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)}}(),xa=Se((function(){var e,t,n,r=arguments;return ke(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=xn(),[4,Kt(e,t,n.version)];case 1:return[2,i.sent()]}}))})),Da=function(){var e=Se((function(e){return ke(this,(function(t){return[2,new Promise((function(t,n){cn("OPEN_OUTAPP",{url:e},{success:function(){t()},fail:function(e){n(e)}},{})}))]}))}));return function(t){return e.apply(this,arguments)}}(),Ua=[fi({params:Di.record(Xr(),Xr()).optional()}).optional()];function La(e){return ja.apply(this,arguments)}function ja(){return ja=Se((function(e){return ke(this,(function(t){return[2,In("createShortcut",Ua,[e],function(){var e=Se((function(e){var t,n,r,i,s,u,c,l;return ke(this,(function(d){switch(d.label){case 0:return Ue.isMp?[4,xa(o,0)]:[3,6];case 1:return r=d.sent(),i=null===(t=De())||void 0===t||null===(n=t.platform)||void 0===n?void 0:n.isIOS,s=r.logoUrl||gn("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,Da(encodeURI(l))]):[3,3];case 2:return d.sent(),[3,5];case 3:return[4,Ra("".concat(a,"/").concat(o,"/?").concat(c.toString()),u,s)];case 4:d.sent(),d.label=5;case 5:return[2,sn.success()];case 6:return Ue.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(je("createShortcut",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),ja.apply(this,arguments)}var Ba=function(){var e=Se((function(e,t,n){return ke(this,(function(r){return[2,new Promise((function(r,o){cn("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)}}(),Za=[fi({secretData:Xr(),ui:fi({title:Xr().default("Xác thực").optional(),subTitle:Xr().default("Sử dụng sinh trắc học của bạn để xác thực").optional(),negativeButtonText:Xr().default("Đóng").optional()}).optional(),requireFingerprint:ri().default(!0).optional()}).optional()];function za(e){return Wa.apply(this,arguments)}function Wa(){return Wa=Se((function(e){return ke(this,(function(t){return[2,In("openBioAuthentication",Za,[e],function(){var e=Se((function(e){var t,n,r;return ke(this,(function(i){switch(i.label){case 0:return Ue.isMp?(t=e.secretData,n=e.ui,r=e.requireFingerprint,[4,Ba(t,n,r)]):[3,2];case 1:return[2,i.sent()];case 2:return Ue.isMpWeb?[2,Promise.resolve({code:0,message:"OK",data:{domain:"",code:0,message:"",payToken:""}})]:[2,Promise.reject(je("openBioAuthentication",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Wa.apply(this,arguments)}var Fa=Se((function(){return ke(this,(function(e){return[2,new Promise((function(e,t){cn("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 Va(e){return Ga.apply(this,arguments)}function Ga(){return(Ga=Se((function(e){return ke(this,(function(t){return[2,In("checkStateBioAuthentication",[],[e],Se((function(){return ke(this,(function(e){switch(e.label){case 0:return Ue.isMp?[4,Fa()]:[3,2];case 1:return[2,{bioState:e.sent()}];case 2:return Ue.isMpWeb?[2,Promise.resolve({bioState:""})]:[2,Promise.reject(je("checkStateBioAuthentication",{}))]}}))})))]}))}))).apply(this,arguments)}var Ha=function(){var e=Se((function(e){return ke(this,(function(t){return[2,new Promise((function(t,n){cn("SHOW_TOAST",{toast:e},{success:function(){t()},fail:function(e){n(e)}},{})}))]}))}));return function(t){return e.apply(this,arguments)}}(),Ka=[fi({message:Xr()}).optional()];function Ja(e){return qa.apply(this,arguments)}function qa(){return qa=Se((function(e){return ke(this,(function(t){return[2,In("showToast",Ka,[e],function(){var e=Se((function(e){return ke(this,(function(t){switch(t.label){case 0:return Ue.isMp?[4,Ha(e.message)]:[3,2];case 1:return[2,t.sent()];case 2:return Ue.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(je("showToast",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),qa.apply(this,arguments)}var Qa=Se((function(){return ke(this,(function(e){return[2,new Promise((function(e,t){cn("HIDE_KEYBOARD",{},{success:function(){e()},fail:function(e){t(e)}},{})}))]}))}));function $a(e){return Ya.apply(this,arguments)}function Ya(){return(Ya=Se((function(e){return ke(this,(function(t){return[2,In("hideKeyboard",[],[e],Se((function(){return ke(this,(function(e){switch(e.label){case 0:return Ue.isMp?[4,Qa()]:[3,2];case 1:return[2,e.sent()];case 2:return Ue.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(je("hideKeyboard",{}))]}}))})))]}))}))).apply(this,arguments)}var Xa=function(){var e=Se((function(e){return ke(this,(function(t){return[2,new Promise((function(t,n){cn("OPEN_PHONE",{phoneNum:e,phoneCode:e},{success:function(){t()},fail:function(e){n(e)}},{})}))]}))}));return function(t){return e.apply(this,arguments)}}(),es=[fi({phoneNumber:Xr()})];function ts(e){return ns.apply(this,arguments)}function ns(){return ns=Se((function(e){return ke(this,(function(t){return[2,In("openPhone",es,[e],function(){var e=Se((function(e){return ke(this,(function(t){switch(t.label){case 0:return Ue.isMp?[4,Xa(e.phoneNumber)]:[3,2];case 1:return[2,t.sent()];case 2:return Ue.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(je("openPhone",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),ns.apply(this,arguments)}var rs=function(){var e=Se((function(e,t){return ke(this,(function(n){return[2,new Promise((function(n,r){cn("OPEN_SMS",{content:t,phoneCode:e},{success:function(){n()},fail:function(e){r(e)}},{})}))]}))}));return function(t,n){return e.apply(this,arguments)}}(),is=[fi({content:Xr(),phoneNumber:Xr()})];function os(e){return as.apply(this,arguments)}function as(){return as=Se((function(e){return ke(this,(function(t){return[2,In("openSMS",is,[e],function(){var e=Se((function(e){return ke(this,(function(t){switch(t.label){case 0:return Ue.isMp?[4,rs(e.phoneNumber,e.content)]:[3,2];case 1:return[2,t.sent()];case 2:return Ue.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(je("openSMS",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),as.apply(this,arguments)}var ss=function(){var e=Se((function(e){var t,n=arguments;return ke(this,(function(r){return t=n.length>1&&void 0!==n[1]?n[1]:"",[2,new Promise((function(n,r){cn("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)}}(),us=[fi({id:Xr(),displayName:Xr().default("").optional()})];function cs(e){return ls.apply(this,arguments)}function ls(){return ls=Se((function(e){return ke(this,(function(t){return[2,In("viewOAQr",us,[e],function(){var e=Se((function(e){return ke(this,(function(t){switch(t.label){case 0:return Ue.isMp?[4,ss(e.id,e.displayName)]:[3,2];case 1:return[2,t.sent()];case 2:return Ue.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(je("viewOAQr",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),ls.apply(this,arguments)}var ds=function(){var e=Se((function(e){return ke(this,(function(t){return[2,new Promise((function(t,n){cn("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)}}(),ps=[fi({keepScreenOn:ri()})];function fs(e){return hs.apply(this,arguments)}function hs(){return hs=Se((function(e){return ke(this,(function(t){return[2,In("keepScreen",ps,[e],function(){var e=Se((function(e){return ke(this,(function(t){switch(t.label){case 0:return Ue.isMp?[4,ds(e.keepScreenOn)]:[3,2];case 1:return[2,t.sent()];case 2:return Ue.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(je("keepScreen",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),hs.apply(this,arguments)}function ms(e){return vs.apply(this,arguments)}function vs(){return(vs=Se((function(e){return ke(this,(function(t){return[2,In("onKeepScreen",[],[e],Se((function(){return ke(this,(function(e){switch(e.label){case 0:return Ue.isMp?[4,ds(!0)]:[3,2];case 1:return[2,e.sent()];case 2:return Ue.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(je("onKeepScreen",{}))]}}))})))]}))}))).apply(this,arguments)}function ys(e){return gs.apply(this,arguments)}function gs(){return(gs=Se((function(e){return ke(this,(function(t){return[2,In("offKeepScreen",[],[e],Se((function(){return ke(this,(function(e){switch(e.label){case 0:return Ue.isMp?[4,ds(!1)]:[3,2];case 1:return[2,e.sent()];case 2:return Ue.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(je("offKeepScreen",{}))]}}))})))]}))}))).apply(this,arguments)}var _s=function(){var e=Se((function(e,t,n){var r;return ke(this,(function(i){return r={},e?r={imageBase64Data:e}:t&&(r={imageUrl:t}),[2,new Promise((function(e,t){cn("SAVE_IMAGE_GALLERY",pa(Ze({},r),{onProgress:n}),{success:function(){e()},fail:function(e){t(e)}},{})}))]}))}));return function(t,n,r){return e.apply(this,arguments)}}(),ws=[fi({imageBase64Data:Xr().optional(),imageUrl:Xr().url().optional()}).optional()];function Ts(e){return bs.apply(this,arguments)}function bs(){return bs=Se((function(e){return ke(this,(function(t){return[2,In("saveImageToGallery",ws,[e],function(){var e=Se((function(e){return ke(this,(function(t){switch(t.label){case 0:return Ue.isMp?[4,_s(e.imageBase64Data,e.imageUrl,e.onProgress)]:[3,2];case 1:return[2,t.sent()];case 2:return Ue.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(je("saveImageToGallery",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),bs.apply(this,arguments)}var Es=function(){var e=Se((function(e,t){var n;return ke(this,(function(r){return{},n={videoUrl:e,onProgress:t},[2,new Promise((function(e,t){cn("SAVE_VIDEO_GALLERY",Ze({},n),{success:function(){e()},fail:function(e){t(e)}},{})}))]}))}));return function(t,n){return e.apply(this,arguments)}}(),Ss=[fi({videoUrl:Xr().url()}).optional()];function Ps(e){return Is.apply(this,arguments)}function Is(){return Is=Se((function(e){return ke(this,(function(t){return[2,In("saveVideoToGallery",Ss,[e],function(){var e=Se((function(e){return ke(this,(function(t){switch(t.label){case 0:return Ue.isMp?[4,Es(e.videoUrl,e.onProgress)]:[3,2];case 1:return[2,t.sent()];case 2:return Ue.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(je("saveVideoToGallery",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Is.apply(this,arguments)}var As=function(){var e=Se((function(e){var t,n,r,i,o,a,u=arguments;return ke(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,xa(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=ze(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){cn("OPEN_MP",{mpUrl:o,mpInfo:i},{success:function(){e()},fail:function(e){t(e)}},{})}))]}}))}));return function(t){return e.apply(this,arguments)}}(),Os=[fi({appId:Xr(),path:Xr().optional(),params:Di.record(Xr(),Xr()).optional()})];function ks(e){return Ns.apply(this,arguments)}function Ns(){return Ns=Se((function(e){return ke(this,(function(t){return[2,In("openMiniApp",Os,[e],function(){var e=Se((function(e){return ke(this,(function(t){switch(t.label){case 0:return Ue.isMp?[4,As(e.appId,e.path,e.params)]:[3,2];case 1:return[2,t.sent()];case 2:return Ue.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(je("openMiniApp",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Ns.apply(this,arguments)}var Cs=Se((function(){var t,n,r=arguments;return ke(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){cn("INTERACTIVE_VIBRATION",{type:e.VibrateType[t],vibrate_time:n},{success:function(){r()},fail:function(e){i(e)}},{})}))]}))})),Ms=[fi({type:Di.enum(["oneShot"]).default("oneShot"),milliseconds:ei().optional()})];function Rs(e){return xs.apply(this,arguments)}function xs(){return xs=Se((function(e){return ke(this,(function(t){return[2,In("vibrate",Ms,[e],function(){var e=Se((function(e){return ke(this,(function(t){switch(t.label){case 0:return Ue.isMp?[4,Cs(null==e?void 0:e.type,null==e?void 0:e.milliseconds)]:[3,2];case 1:return[2,t.sent()];case 2:return Ue.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(je("vibrate",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),xs.apply(this,arguments)}var Ds=function(){var e=Se((function(e,t){var n,r,i,o;return ke(this,(function(a){return n=new URL(e),r=n.href.includes("vnpay"),i=n.searchParams.get("typeInapp"),o=Et.isEmpty(t)?void 0:{modal_style:(null==t?void 0:t.style)?qt(null==t?void 0:t.style):"bottom_sheet",left_button:(null==t?void 0:t.leftButton)?qt(null==t?void 0:t.leftButton):"back"},!r&&Et.isEmpty(i)&&n.searchParams.set("typeInapp","1"),[2,new Promise((function(e,t){cn("OPEN_INAPP",{url:n.href,style:o},{success:function(){e()},fail:function(e){t(e)}},{})}))]}))}));return function(t,n){return e.apply(this,arguments)}}(),Us=[fi({url:Xr(),config:fi({style:Di.enum(["bottomSheet","normal"]).default("bottomSheet").optional(),leftButton:Di.enum(["back","none"]).default("back").optional()}).optional()})];function Ls(e){return js.apply(this,arguments)}function js(){return js=Se((function(e){return ke(this,(function(t){return[2,In("openWebview",Us,[e],function(){var e=Se((function(e){return ke(this,(function(t){switch(t.label){case 0:return Ue.isMp?[4,Ds(e.url,e.config)]:[3,2];case 1:return[2,t.sent()];case 2:return Ue.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(je("openWebview",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),js.apply(this,arguments)}function Bs(){var e={},t=window.location.href;try{var n=new URL(t).searchParams.toString();n&&(e=Bt.getParamsAsObject(n))}catch(e){throw new Error("Invalid URL")}return e}function Zs(){return In("getRouteParams",[],[],(function(){return Bs()}))}function zs(e){return Ws.apply(this,arguments)}function Ws(){return(Ws=Se((function(e){return ke(this,(function(t){return[2,In("getAppInfo",[],[e],Se((function(){return ke(this,(function(e){switch(e.label){case 0:return Ue.isMp?[4,xa()]:[3,2];case 1:return[2,e.sent()];case 2:return Ue.isMpWeb?[2,Promise.resolve({description:"",name:"",version:"",appUrl:"",qrCodeUrl:""})]:[2,Promise.reject(je("getAppInfo",{}))]}}))})))]}))}))).apply(this,arguments)}var Fs=function(){var e=Se((function(e){return ke(this,(function(t){return[2,new Promise((function(t,n){cn("WEBVIEW_SET_RESULT",{result:_n(e)},{success:function(){t()},fail:function(e){n(e)}},{})}))]}))}));return function(t){return e.apply(this,arguments)}}(),Vs=[fi({data:Di.any()})];function Gs(e){return Hs.apply(this,arguments)}function Hs(){return Hs=Se((function(e){return ke(this,(function(t){return[2,In("sendDataToPreviousMiniApp",Vs,[e],function(){var e=Se((function(e){return ke(this,(function(t){switch(t.label){case 0:return Ue.isMp?[4,Fs(e.data)]:[3,2];case 1:return[2,t.sent()];case 2:return Ue.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(je("sendDataToPreviousMiniApp",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Hs.apply(this,arguments)}var Ks=Se((function(){return ke(this,(function(e){return[2,new Promise((function(e,t){var n,r;cn("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(sn.error.clientNotSupport())},fail:function(e){t(e)}},{delay:(null===(n=De())||void 0===n||null===(r=n.platform)||void 0===r?void 0:r.isIOS)?400:0})}))]}))}));function Js(e){return qs.apply(this,arguments)}function qs(){return(qs=Se((function(e){return ke(this,(function(t){return[2,In("getPhoneNumber",[],[e],Se((function(){return ke(this,(function(e){switch(e.label){case 0:return Ue.isMp?[4,Ks()]:[3,2];case 1:return[2,e.sent()];case 2:return Ue.isMpWeb?[2,Promise.resolve({number:""})]:[2,Promise.reject(je("getPhoneNumber",{}))]}}))})))]}))}))).apply(this,arguments)}var Qs=Se((function(){var e,t=arguments;return ke(this,(function(n){return e=t.length>0&&void 0!==t[0]?t[0]:1,[2,new Promise((function(t,n){cn("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})}))]}))})),$s=[fi({maxProfile:ei().min(1).max(10).optional().default(1)})];function Ys(e){return Xs.apply(this,arguments)}function Xs(){return Xs=Se((function(e){return ke(this,(function(t){return[2,In("openProfilePicker",$s,[e],function(){var e=Se((function(e){var t,n,r,i,o;return ke(this,(function(a){switch(a.label){case 0:return Ue.isMp?[4,Qs(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,pn.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(Et.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 Ue.isMpWeb?[2,Promise.resolve({users:[]})]:[2,Promise.reject(je("openProfilePicker",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Xs.apply(this,arguments)}var eu=function(){var e=Se((function(e,t,n){var r;return ke(this,(function(i){return r=t&&Et.isString(t)&&t.length>0?"wpa_wpa2":"open",[2,new Promise((function(i,o){cn("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)}}(),tu=[fi({SSID:Xr(),password:Xr().optional(),hiddenSSID:ri().optional()})];function nu(e){return ru.apply(this,arguments)}function ru(){return ru=Se((function(e){return ke(this,(function(t){return[2,In("connectWifi",tu,[e],function(){var e=Se((function(e){return ke(this,(function(t){switch(t.label){case 0:return Ue.isMp?[4,eu(e.SSID,e.password,e.hiddenSSID)]:[3,2];case 1:return[2,t.sent()];case 2:return Ue.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(je("connectWifi",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),ru.apply(this,arguments)}var iu=function(){var t=Se((function(t,n,r,i,o,a){var s,u;return ke(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){cn("PICK_MEDIA",{media_type:e.MediaPickerType[t],edit_view:Ze({},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)}}(),ou=[fi({type:Di.enum(["video","photo","file","zcamera","zcamera_photo","zcamera_video","zcamera_scan"]),serverUploadUrl:Xr().url(),maxItemSize:ei().min(0).optional(),editView:fi({enable:ri().optional(),aspectRatio:Xr().regex(/^d+:d+$/).optional()}).optional(),silentRequest:ri().optional(),maxSelectItem:ei().min(1).optional()})];function au(e){return su.apply(this,arguments)}function su(){return su=Se((function(e){return ke(this,(function(t){return[2,In("openMediaPicker",ou,[e],function(){var e=Se((function(e){var t,n,r,i,o,a;return ke(this,(function(s){switch(s.label){case 0:return Ue.isMp?(i={},Et.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,iu(e.type,e.serverUploadUrl,e.maxItemSize,i,o,a)]):[3,2];case 1:return[2,{data:s.sent()}];case 2:return Ue.isMpWeb?[2,Promise.resolve({data:""})]:[2,Promise.reject(je("openMediaPicker",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),su.apply(this,arguments)}var uu=[fi({title:Xr().max(100),description:Xr().max(400).default(""),thumbnail:Xr().url().optional(),path:Xr().optional()})];function cu(e){return lu.apply(this,arguments)}function lu(){return lu=Se((function(e){return ke(this,(function(t){return[2,In("getShareableLink",uu,[e],function(){var e=Se((function(e){var t;return ke(this,(function(n){switch(n.label){case 0:return[4,pn.getAccessToken()];case 1:return t=n.sent(),[4,Pa(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)}}())]}))})),lu.apply(this,arguments)}var du=function(){var e=Se((function(e){return ke(this,(function(t){return[2,new Promise((function(t,n){cn("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 pu(e){return fu.apply(this,arguments)}function fu(){return(fu=Se((function(e){return ke(this,(function(t){return[2,In("closeLoading",[],[e],Se((function(){return ke(this,(function(e){switch(e.label){case 0:return Ue.isMp?[4,du("user action")]:[3,2];case 1:return[2,e.sent()];case 2:return Ue.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(je("closeLoading",{}))]}}))})))]}))}))).apply(this,arguments)}function hu(e){return mu.apply(this,arguments)}function mu(){return mu=Se((function(e){return ke(this,(function(t){return[2,In("requestUpdateZalo",[],[e],Se((function(){var e,t,n;return ke(this,(function(r){switch(r.label){case 0:return Ue.isMp?(n=(null===(e=De())||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,Da(n)]):[3,2];case 1:return[2,r.sent()];case 2:return Ue.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(je("requestUpdateZalo",{}))]}}))})))]}))})),mu.apply(this,arguments)}var vu=Ut.getInstance();vu.addListener=function(t,n,r){var i=t;return vu.addListener(e.Events[i],n,r)};var yu=[Di.function()];function gu(t){return In("onConfirmToExit",yu,[t],(function(t){var n=t;Ue.isMp&&(vu.on(e.Events.AppClose,n,'{"handle_h5": 1}'),Li.setNavigationBarLeftButton(void 0,2))}))}function _u(){return In("offConfirmToExit",[],[],(function(){Ue.isMp&&(vu.off(e.Events.AppClose),Li.setNavigationBarLeftButton(void 0,0))}))}function wu(){return In("getDeviceId",[],[],(function(){return Ue.isMp&&pn.getSync(l.DEVICE_ID)||""}))}function Tu(e){return bu.apply(this,arguments)}function bu(){return(bu=Se((function(e){return ke(this,(function(t){return[2,In("getDeviceIdAsync",[],[e],Se((function(){return ke(this,(function(e){switch(e.label){case 0:return Ue.isMp?[4,pn.jumpAndGetToken(l.DEVICE_ID)]:[3,2];case 1:return[2,e.sent()||""];case 2:return[2,Promise.resolve("")]}}))})))]}))}))).apply(this,arguments)}function Eu(){return In("getContext",[],[],(function(){if(Ue.isMp){var e=pn.getSync(l.CONTEXT_ID)||"";return{type:pn.getSync(l.CONTEXT_TYPE)||"",id:e}}return{type:"",id:""}}))}function Su(e){return Pu.apply(this,arguments)}function Pu(){return(Pu=Se((function(e){return ke(this,(function(t){return[2,In("getContextAsync",[],[e],Se((function(){var e;return ke(this,(function(t){switch(t.label){case 0:return Ue.isMp?[4,pn.jumpAndGetToken(l.CONTEXT_ID)]:[3,3];case 1:return e=t.sent()||"",[4,pn.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 Iu(e){return Au.apply(this,arguments)}function Au(){return(Au=Se((function(e){return ke(this,(function(t){return[2,In("getAuthCode",[],[e],Se((function(){var e,t;return ke(this,(function(n){switch(n.label){case 0:return Ue.isMp?[4,pn.jumpAndGetToken(l.ZOAUTH,!0)]:[3,4];case 1:return e=n.sent()||"",[4,pn.jumpAndGetToken(l.ZOAUTH_VRF)];case 2:return t=n.sent()||"",[4,pn.verifyUserAuthorized()];case 3:if(n.sent())return[2,{authCode:e,authCodeVerify:t}];throw Jt([{action:"getAuthCode",error:-104,message:"no user auth",data:{}}]),sn.error.loginFailed("User Authentication Required");case 4:return[2,Promise.resolve({authCode:"",authCodeVerify:""})]}}))})))]}))}))).apply(this,arguments)}function Ou(e){return ku.apply(this,arguments)}function ku(){return(ku=Se((function(e){return ke(this,(function(t){return[2,In("getZPIToken",[],[e],Se((function(){var e,t,n,r;return ke(this,(function(i){switch(i.label){case 0:return Ue.isMp?[4,pn.jumpAndGetToken(l.UTOKEN_ZPI)]:[3,5];case 1:return e=i.sent()||"",[4,pn.jumpAndGetToken(l.GTOKEN_ZPI)];case 2:return t=i.sent()||"",[4,pn.jumpAndGetToken(l.ZPP_ZPI)];case 3:return n=i.sent()||"",[4,pn.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 Nu=[Xr()];function Cu(e){return In("setAccessToken",Nu,[e],(function(e){var t=e;pn.setAccessToken(t)}))}var Mu=[fi({url:Xr().url()})];function Ru(e){return xu.apply(this,arguments)}function xu(){return xu=Se((function(e){return ke(this,(function(t){return[2,In("openOutApp",Mu,[e],function(){var e=Se((function(e){return ke(this,(function(t){switch(t.label){case 0:return Ue.isMp?[4,Da(e.url)]:[3,2];case 1:return[2,t.sent()];case 2:return Ue.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(je("openOutApp",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),xu.apply(this,arguments)}var Du=[fi({count:ei().min(1).optional().default(1),sourceType:Di.array(Di.enum(["album","camera"])).max(2).default(["album","camera"]).optional(),cameraType:Di.enum(["back","front"]).default("front").optional()})];function Uu(e){return Lu.apply(this,arguments)}function Lu(){return Lu=Se((function(e){return ke(this,(function(t){return[2,In("chooseImage",Du,[e],function(){var e=Se((function(e){var t,n,r,i;return ke(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)}}())]}))})),Lu.apply(this,arguments)}var ju=Se((function(){var e,t,n=arguments;return ke(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){cn("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(sn.error.clientNotSupport())},fail:function(e){r(e)}},{isMultiCallback:!0,timeout:!1})}))]}))}));function Bu(e){return Zu.apply(this,arguments)}function Zu(){return(Zu=Se((function(e){return ke(this,(function(t){return[2,In("getLocation",[],[e],Se((function(){return ke(this,(function(e){switch(e.label){case 0:return Ue.isMp?[4,ju()]:[3,2];case 1:return[2,e.sent()];case 2:return Ue.isMpWeb?[2,Promise.resolve({longitude:"105.788026",latitude:"21.0258773",timestamp:(new Date).getTime().toString(),provider:"fused"})]:[2,Promise.reject(je("getLocation",{}))]}}))})))]}))}))).apply(this,arguments)}var zu=[Di.function().args(fi({data:Di.any()})).returns(Di.void())];function Wu(t){return In("onCallbackData",zu,[t],(function(){!function(t){Ut.getInstance().on(e.Events.OnDataCallback,(function(e){t({data:e})}))}(t)}))}var Fu=function(){var e=Se((function(e){var t,n,r,i,a,s,u,c,l,d,p;return ke(this,(function(f){switch(f.label){case 0:return n="",e||(e=Bs()),"object"==typeof e&&((n=e.zmpOrderId||"")||(t=e.appTransID||e.orderId||e.apptransid)),"string"==typeof e&&(r=Bt.getParameterByName("orderId",e),i=Bt.getParameterByName("appTransID",e)||Bt.getParameterByName("apptransid",e),t=r||i),a={headers:{authorization:"Bearer "}},[4,pn.getAccessToken().catch((function(){throw sn.error.loginRequired}))];case 1:return s=f.sent(),a.headers.authorization="Bearer ".concat(s),u=new URL(fe),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 sn.error.badRequest(l.msg);return d=l.data||{},p={err:l.err},0!==Object.keys(d).length&&d.constructor===Object&&Object.assign(p,Ze({msg:d.resultMessage},d)),[2,p]}}))}));return function(t){return e.apply(this,arguments)}}(),Vu=function(){var t=Se((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,I,A,O;return ke(this,(function(k){switch(k.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 "}},k.label=1;case 1:return k.trys.push([1,6,,7]),[4,pn.getAccessToken().catch((function(){throw sn.error.loginRequired}))];case 2:return h=k.sent(),f.headers.authorization="Bearer ".concat(h),[4,fetch(de,pa(Ze({method:"POST"},f),{body:l}))];case 3:return[4,k.sent().json()];case 4:if(!(m=k.sent()).data||0!==m.err)throw sn.error.badRequest(m.msg);return v=m.data.id,y=m.data.jwt,g=m.data.messageToken||"",_=window.APP_VERSION,w=window.APP_ENV,T={miniAppId:c,orderId:v},b=m.data.method,E=m.data.isCustom,y&&(T.token=y),_&&(T.version=_),w&&(T.env=w),b&&(T.method=b),E&&(T.isCustom=E),S=Bt.encode(T),P=new URL("?".concat(S),"https://payment-mini.zalo.me").toString(),I=$t(),A=Qt()&&I<742?"normal":"bottomSheet",[4,Ds(P,{style:A}).then((function(){var t=!1;Ut.getInstance().once(e.Events.WebviewClosed,(function(){setTimeout(Se((function(){var n;return ke(this,(function(r){switch(r.label){case 0:return t?[3,2]:[4,Fu({zmpOrderId:v})];case 1:(n=r.sent()).err>=0&&!n.isCustom&&Ut.getInstance().emit(e.Events.PaymentClose,n.err,pa(Ze({},n),{zmpOrderId:v})),r.label=2;case 2:return[2]}}))})),500)})),Ut.getInstance().once(e.Events.OpenApp,(function(){t=!0}))}))];case 5:return k.sent(),[2,{orderId:v,messageToken:g}];case 6:throw O=k.sent(),console.log("Internal error"),O;case 7:return[2]}}))}));return function(e,n,r,i,o,a,s){return t.apply(this,arguments)}}(),Gu=[fi({amount:Di.union([Xr(),ei()]),item:Di.array(Di.record(Xr(),Di.any())),desc:Xr(),extradata:Di.any().optional(),payload:Di.any().optional(),method:Di.union([Di.string(),Di.object({id:Di.string(),isCustom:Di.boolean()})]).optional(),mac:Di.string().optional()})];function Hu(e){return Ku.apply(this,arguments)}function Ku(){return Ku=Se((function(e){return ke(this,(function(t){return[2,In("createOrder",Gu,[e],function(){var e=Se((function(e){return ke(this,(function(t){switch(t.label){case 0:return Ue.isMp?[4,Vu(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 Ue.isMpWeb?[2,Promise.resolve({orderId:"",messageToken:""})]:[2,Promise.reject(je("createOrder",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Ku.apply(this,arguments)}var Ju=Se((function(){return ke(this,(function(e){return[2,new Promise((function(e,t){cn("MP_CONFIRM_REQUEST_PAYMENT",{},{success:function(){e()},fail:function(e){t(e)}},{})}))]}))})),qu=function(){var e=Se((function(e,t,n,r,i){var a,s,u,c,l,d,p,f,h,m,v,y;return ke(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,pn.getAccessToken().catch((function(){throw sn.error.loginRequired}))];case 2:return l=g.sent(),u.headers.authorization="Bearer ".concat(l),console.log("_purchase"),[4,pn.jumpAndGetToken()];case 3:if(g.sent(),d=null===(c=pn.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(he,pa(Ze({method:"POST"},u),{body:s}))];case 8:return[4,g.sent().json()];case 9:if(!(f=g.sent()).data||0!==f.err)throw sn.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)}}(),Qu=[fi({amount:Di.union([Di.string(),Di.number()]),desc:Di.string(),method:Di.string(),transId:Di.string().optional(),mac:Di.string().optional()})];function $u(e){return Yu.apply(this,arguments)}function Yu(){return Yu=Se((function(e){return ke(this,(function(t){return[2,In("purchase",Qu,[e],function(){var e=Se((function(e){return ke(this,(function(t){switch(t.label){case 0:return Ue.isMp?[4,qu(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 Ue.isMpWeb?[2,Promise.resolve({orderId:"",messageToken:"",transId:""})]:[2,Promise.reject(je("purchase",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Yu.apply(this,arguments)}var Xu=function(){var e=Se((function(e,t){return ke(this,(function(n){return[2,new Promise((function(n,r){var i=e&&(null==e?void 0:e.length)>0;cn("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)}}(),ec=[fi({channels:pi(fi({method:Xr(),subMethod:Xr().optional(),subInfo:Xr().optional()})).optional(),selectedMethod:fi({method:Xr(),subMethod:Xr().optional()}).optional()}).optional()];function tc(e){return nc.apply(this,arguments)}function nc(){return nc=Se((function(e){return ke(this,(function(t){return[2,In("selectPaymentMethod",ec,[e],function(){var e=Se((function(e){var t,n;return ke(this,(function(r){switch(r.label){case 0:return Ue.isMp?(t=e.channels,n=e.selectedMethod,[4,Xu(t,n)]):[3,2];case 1:return[2,r.sent()];case 2:return Ue.isMpWeb?[2,Promise.resolve({method:""})]:[2,Promise.reject(je("selectPaymentMethod",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),nc.apply(this,arguments)}var rc=[fi({data:Di.union([Xr(),Di.record(Xr(),Xr())])})];function ic(e){return oc.apply(this,arguments)}function oc(){return oc=Se((function(e){return ke(this,(function(t){return[2,In("checkTransaction",rc,[e],function(){var e=Se((function(e){return ke(this,(function(t){switch(t.label){case 0:return Ue.isMp?[4,Fu(e.data)]:[3,2];case 1:return[2,t.sent()];case 2:return Ue.isMpWeb?[2,Promise.resolve({msg:"Success",orderId:"",resultCode:1,transTime:(new Date).getTime().toString(),createdAt:(new Date).getTime().toString(),transId:""})]:[2,Promise.reject(je("checkTransaction",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),oc.apply(this,arguments)}var ac=function(){var t=Se((function(t,n,r,i,a,s){var u,c,l,d,p,f,h,m,v,y,g,_,w,T;return ke(this,(function(b){switch(b.label){case 0:p=o,(f=new URLSearchParams).append("payType",n||e.IAPPayType.SUBSCRIPTION),h=e.ProrationMode.UNKNOW,r===ve&&(h=e.ProrationMode.IMMEDIATE_AND_CHARGE_FULL_PRICE),r===me&&(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=De())||void 0===u||null===(c=u.platform)||void 0===c?void 0:c.isIOS)?m="ios":(null===(l=De())||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,pn.getAccessToken().catch((function(){throw sn.error.loginRequired}))];case 2:return y=b.sent(),v.headers.authorization="Bearer ".concat(y),[4,fetch(pe,pa(Ze({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 sn.error.createIAPOrderFailed(g.err);return _=g.data.store,w=g.data.orderId,[2,new Promise((function(e,t){cn("IAP_REQUESTPAYMENT",Ze({},_),{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)}}(),sc=[fi({productId:Xr(),payType:Di.enum(["ONETIME","SUBSCRIPTION"]).optional(),prorationMode:Di.enum(["DEFERRED","IMMEDIATE_AND_CHARGE_FULL_PRICE"]).default("DEFERRED").optional(),utm:Xr().optional(),method:Di.enum(["IAP","IAP_SANDBOX"]).optional(),merchantTransId:Xr().optional()})];function uc(e){return cc.apply(this,arguments)}function cc(){return cc=Se((function(e){return ke(this,(function(t){return[2,In("createOrderIAP",sc,[e],function(){var e=Se((function(e){return ke(this,(function(t){switch(t.label){case 0:return Ue.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 Ue.isMpWeb?[2,Promise.resolve({orderId:""})]:[2,Promise.reject(je("createOrderIAP",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),cc.apply(this,arguments)}var lc=[fi({hide:ri().default(!1).optional()}).optional()];function dc(e){return pc.apply(this,arguments)}function pc(){return pc=Se((function(e){return ke(this,(function(t){return[2,In("setAndroidBottomNavigationBar",lc,[e],function(){var e=Se((function(e){return ke(this,(function(t){switch(t.label){case 0:return Ue.isMp?[4,Li.setAndroidBottomNavigationBar(e.hide)]:[3,2];case 1:return[2,t.sent()];case 2:return Ue.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(je("setAndroidBottomNavigationBar",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),pc.apply(this,arguments)}var fc=[fi({hide:ri().default(!1).optional()}).optional()];function hc(e){return mc.apply(this,arguments)}function mc(){return mc=Se((function(e){return ke(this,(function(t){return[2,In("setIOSBottomSafeArea",fc,[e],function(){var e=Se((function(e){return ke(this,(function(t){switch(t.label){case 0:return Ue.isMp?[4,Li.setIOSBottomSafeArea(e.hide)]:[3,2];case 1:return[2,t.sent()];case 2:return Ue.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(je("setIOSBottomSafeArea",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),mc.apply(this,arguments)}var vc=[fi({type:Di.enum(["normal","hidden","transparent"]).default("normal").optional(),color:Di.string().optional()}).optional()];function yc(e){return gc.apply(this,arguments)}function gc(){return gc=Se((function(e){return ke(this,(function(t){return[2,In("setStatusBar",vc,[e],function(){var e=Se((function(e){return ke(this,(function(t){switch(t.label){case 0:return Ue.isMp?[4,Li.configHeader({statusBarType:e.type,headerColor:e.color})]:[3,2];case 1:return[2,t.sent()];case 2:return Ue.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(je("setStatusBar",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),gc.apply(this,arguments)}var _c=[fi({headerTextColor:Di.enum(["black","white"]).optional(),headerColor:Di.string().optional(),actionBar:fi({hide:Di.boolean().optional(),title:Di.string().optional(),leftButton:Di.enum(["back","none"]).optional(),textAlign:Di.enum(["left","center"]).default("left").optional()}).optional(),statusBarType:Di.enum(["normal","hidden","transparent"]).optional(),hideAndroidBottomNavigationBar:Di.boolean().optional(),hideIOSSafeAreaBottom:Di.boolean().optional()})];function wc(e){return Tc.apply(this,arguments)}function Tc(){return Tc=Se((function(e){return ke(this,(function(t){return[2,In("configAppView",_c,[e],function(){var e=Se((function(e){var t,n,r,i,o,a,s;return ke(this,(function(u){switch(u.label){case 0:return Ue.isMp?Et.isUndefined(null===(t=e.actionBar)||void 0===t?void 0:t.leftButton)?[3,2]:[4,Li.setNavigationBarLeftButton(null===(a=e.actionBar)||void 0===a?void 0:a.leftButton)]:[3,13];case 1:u.sent(),u.label=2;case 2:return Et.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,Li.setNavigationBarTitle(null===(s=e.actionBar)||void 0===s?void 0:s.title)];case 3:u.sent(),u.label=4;case 4:return[4,Li.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,Li.setAndroidBottomNavigationBar(e.hideAndroidBottomNavigationBar)];case 7:u.sent(),u.label=8;case 8:return"boolean"!=typeof e.hideIOSSafeAreaBottom?[3,10]:[4,Li.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 Ue.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(je("configAppView",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Tc.apply(this,arguments)}var bc=Se((function(){return ke(this,(function(e){return[2,new Promise((function(e,t){cn("MA_MENU_MINIMIZE",{},{success:function(t){e(t)},fail:function(e){t(e)}},{})}))]}))}));function Ec(e){return Sc.apply(this,arguments)}function Sc(){return(Sc=Se((function(e){return ke(this,(function(t){return[2,In("minimizeApp",[],[e],Se((function(){return ke(this,(function(e){switch(e.label){case 0:return Ue.isMp?[4,bc()]:[3,2];case 1:return[2,e.sent()];case 2:return Ue.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(je("minimizeApp",{}))]}}))})))]}))}))).apply(this,arguments)}var Pc=Se((function(){return ke(this,(function(e){return[2,new Promise((function(e,t){cn("MA_MENU_PERMISSION",{},{success:function(t){e(t)},fail:function(e){t(e)}},{}),e()}))]}))}));function Ic(e){return Ac.apply(this,arguments)}function Ac(){return(Ac=Se((function(e){return ke(this,(function(t){return[2,In("openPermissionSetting",[],[e],Se((function(){return ke(this,(function(e){switch(e.label){case 0:return Ue.isMp?[4,Pc()]:[3,2];case 1:return[2,e.sent()];case 2:return Ue.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(je("openPermissionSetting",{}))]}}))})))]}))}))).apply(this,arguments)}var Oc=Se((function(){return ke(this,(function(e){return[2,new Promise((function(e,t){cn("MP_ADD_MYFAVORITES",{timestamp:(new Date).getTime()},{success:function(t){e(t)},fail:function(e){t(e)}},{})}))]}))}));function kc(e){return Nc.apply(this,arguments)}function Nc(){return(Nc=Se((function(e){return ke(this,(function(t){return[2,In("favoriteApp",[],[e],Se((function(){return ke(this,(function(e){switch(e.label){case 0:return Ue.isMp?[4,Oc()]:[3,2];case 1:return[2,e.sent()];case 2:return Ue.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(je("favoriteApp",{}))]}}))})))]}))}))).apply(this,arguments)}var Cc=Se((function(){return ke(this,(function(e){return[2,new Promise((function(e,t){cn("OPEN_GROUPLIST",{},{success:function(t){e(t)},fail:function(e){t(e)}},{})}))]}))}));function Mc(e){return Rc.apply(this,arguments)}function Rc(){return(Rc=Se((function(e){return ke(this,(function(t){return[2,In("openGroupList",[],[e],Se((function(){return ke(this,(function(e){switch(e.label){case 0:return Ue.isMp?[4,Cc()]:[3,2];case 1:return[2,e.sent()];case 2:return Ue.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(je("openGroupList",{}))]}}))})))]}))}))).apply(this,arguments)}var xc=Se((function(){var e;return ke(this,(function(t){switch(t.label){case 0:return[4,pn.getAccessToken()];case 1:return e=t.sent(),[2,new Promise((function(t,n){cn("MP_SEND_NOTIFICATION",{accessToken:e},{success:function(e){t(e)},fail:function(e){n(e)}},{delay:500})}))]}}))}));function Dc(e){return Uc.apply(this,arguments)}function Uc(){return(Uc=Se((function(e){return ke(this,(function(t){return[2,In("requestSendNotification",[],[e],Se((function(){return ke(this,(function(e){switch(e.label){case 0:return Ue.isMp?[4,xc()]:[3,2];case 1:return[2,e.sent()];case 2:return Ue.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(je("requestSendNotification",{}))]}}))})))]}))}))).apply(this,arguments)}var Lc=Se((function(){return ke(this,(function(e){return[2,new Promise((function(e,t){cn("MP_ADD_RATING",{},{success:function(t){e(t)},fail:function(e){t(e)}},{})}))]}))}));function jc(e){return Bc.apply(this,arguments)}function Bc(){return(Bc=Se((function(e){return ke(this,(function(t){return[2,In("addRating",[],[e],Se((function(){return ke(this,(function(e){switch(e.label){case 0:return Ue.isMp?[4,Lc()]:[3,2];case 1:return[2,e.sent()];case 2:return Ue.isMpWeb?[2,Promise.resolve({})]:[2,Promise.reject(je("addRating",{}))]}}))})))]}))}))).apply(this,arguments)}var Zc,zc=(Zc=Se((function(e,t,n){var r,i;return ke(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,Ze({method:"POST",body:r},i))];case 1:return[4,o.sent().json()];case 2:return[2,o.sent()]}}))})),function(e,t,n){return Zc.apply(this,arguments)}),Wc=function(){var e=Se((function(e){return ke(this,(function(t){return[2,new Promise((function(t,n){cn("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)}}(),Fc=[fi({oaId:Xr()})];function Vc(e){return Gc.apply(this,arguments)}function Gc(){return Gc=Se((function(e){return ke(this,(function(t){return[2,In("interactOA",Fc,[e],function(){var e=Se((function(e){var t,n,r;return ke(this,(function(i){switch(i.label){case 0:return Ue.isMp?(t=e.oaId,[4,pn.getAccessToken()]):[3,5];case 1:return!(n=i.sent())||Et.isEmpty(n)?[3,3]:[4,zc(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,Wc(t)];case 4:return[2,i.sent()];case 5:return Ue.isMpWeb?[2,Promise.resolve({})]:[2,Promise.reject(je("interactOA",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Gc.apply(this,arguments)}var Hc=[fi({oaId:Xr()})];function Kc(e){return Jc.apply(this,arguments)}function Jc(){return Jc=Se((function(e){return ke(this,(function(t){return[2,In("isAllowedInteractWithOA",Hc,[e],function(){var e=Se((function(e){var t,n,r;return ke(this,(function(i){switch(i.label){case 0:return Ue.isMp?(t=e.oaId,[4,pn.getAccessToken()]):[3,4];case 1:return!(n=i.sent())||Et.isEmpty(n)?[3,3]:[4,zc(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 Ue.isMpWeb?[2,Promise.resolve({status:!1})]:[2,Promise.reject(je("IsAllowedInteractWithOA",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Jc.apply(this,arguments)}function qc(e){return Qc.apply(this,arguments)}function Qc(){return(Qc=Se((function(e){return ke(this,(function(t){return[2,In("getSetting",[],[e],Se((function(){return ke(this,(function(e){switch(e.label){case 0:return Ue.isMp?[4,on()]:[3,2];case 1:return[2,e.sent()];case 2:return Ue.isMpWeb?[2,Promise.resolve({authSetting:{}})]:[2,Promise.reject(je("getSetting",{}))]}}))})))]}))}))).apply(this,arguments)}var $c=Di.enum(["scope.userInfo","scope.userLocation","scope.userPhonenumber"]),Yc=[fi({scopes:Di.array($c).max(2).optional()}).optional()];function Xc(e){return el.apply(this,arguments)}function el(){return el=Se((function(e){return ke(this,(function(t){return[2,In("authorize",Yc,[e],function(){var e=Se((function(e){var t;return ke(this,(function(n){switch(n.label){case 0:return Ue.isMp?(t=null==e?void 0:e.scopes,Yt(724,573)?[2,Promise.reject(sn.error.clientNotSupport())]:[4,ln(null!=t?t:void 0)]):[3,2];case 1:return[2,n.sent()];case 2:return Ue.isMpWeb?[2,Promise.resolve({})]:[2,Promise.reject(je("authorize",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),el.apply(this,arguments)}var tl=Se((function(){return ke(this,(function(e){return[2,new Promise(function(){var e=Se((function(e,t){var n;return ke(this,(function(r){switch(r.label){case 0:return Et.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(sn.error.clientNotSupport()),[2]}}))}));return function(t,n){return e.apply(this,arguments)}}())]}))}));function nl(e){return In("checkZaloCameraPermission",[],[e],Se((function(){return ke(this,(function(e){switch(e.label){case 0:return[4,tl()];case 1:return[2,e.sent()]}}))})))}var rl=Se((function(){return ke(this,(function(e){return[2,new Promise(function(){var e=Se((function(e,t){var n,r,i;return ke(this,(function(o){switch(o.label){case 0:return o.trys.push([0,2,,3]),[4,pn.jumpAndGetToken()];case 1:return o.sent(),r=null===(n=pn.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 il(e){return ol.apply(this,arguments)}function ol(){return(ol=Se((function(e){return ke(this,(function(t){return[2,In("getUserID",[],[e],Se((function(){return ke(this,(function(e){switch(e.label){case 0:return Ue.isMp?[4,rl()]:[3,2];case 1:return[2,e.sent()];case 2:return Ue.isMpWeb?[2,Promise.resolve(void 0)]:[2,Promise.reject(je("getUserID",{}))]}}))})))]}))}))).apply(this,arguments)}var al=Se((function(){return ke(this,(function(e){return[2,new Promise(function(){var e=Se((function(e,t){var n,r,i;return ke(this,(function(o){switch(o.label){case 0:return o.trys.push([0,2,,3]),[4,pn.jumpAndGetToken()];case 1:return o.sent(),r=null===(n=pn.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 sl(e){return ul.apply(this,arguments)}function ul(){return(ul=Se((function(e){return ke(this,(function(t){return[2,In("getIDToken",[],[e],Se((function(){return ke(this,(function(e){switch(e.label){case 0:return Ue.isMp?[4,al()]:[3,2];case 1:return[2,e.sent()];case 2:return Ue.isMpWeb?[2,Promise.resolve(void 0)]:[2,Promise.reject(je("getIDToken",{}))]}}))})))]}))}))).apply(this,arguments)}var cl={format:e.PhotoFormat.JPEG,quality:e.PhotoQuality.NORMAL,mirrored:!1,useVideoSourceSize:!1},ll={width:1024,height:768,facingMode:e.FacingMode.FRONT,mirrored:!1,audio:!1,video:!0},dl=function(){function t(n){var r,i,o,a,s,u=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,c=this;St(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};Ut.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:ll.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:ll.mirrored,this._userRequestFrameCallback=!1,this._audioEnabled=null!==(a=null==u?void 0:u.audio)&&void 0!==a?a:ll.audio,this._videoEnabled=null!==(s=null==u?void 0:u.video)&&void 0!==s?s:ll.video}var n=t.prototype;return n.on=function(t,n){Ut.getInstance().on(t,(function(e){n(e)})),t===e.CameraEvents.OnFrameCallback&&(this._userRequestFrameCallback=!0,this.tick())},n.off=function(t){Ut.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 Se((function(){return ke(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 Se((function(){var n,r,i,o,a,s;return ke(this,(function(u){switch(u.label){case 0:return Et.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||ll.width,this._videoElement.height=(null==e?void 0:e.height)||this._videoElement.height||ll.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 Se((function(){return ke(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 Se((function(){var n,r;return ke(this,(function(i){return n=Ut.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=Se((function(n,r){var i;return ke(this,(function(o){switch(o.label){case 0:return o.trys.push([0,2,,3]),[4,t.stream()];case 1:return o.sent(),Ut.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 Se((function(){return ke(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 Se((function(){return ke(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=Se((function(n){return ke(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 Se((function(){return ke(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 Se((function(){return ke(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 Se((function(){return ke(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(),Ut.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||cl.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}(),pl=fi({play:Di.function(),pause:Di.function()}).refine((function(e){return"play"in e&&"pause"in e}),{message:"Invalid HTMLVideoElement"}),fl=[fi({videoElement:pl,mediaConstraints:Di.object({width:Di.number().min(100).optional(),height:Di.number().min(100).optional(),facingMode:Di.string().optional(),audio:Di.boolean().optional(),video:Di.boolean().optional(),deviceId:Di.string().optional(),mirrored:Di.boolean().optional()}).nullish()}).optional()];function hl(e){return In("createCameraContext",fl,[e],(function(e){return new dl(e.videoElement,e.mediaConstraints)}))}var ml=function(){function e(){var t,n;St(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=Oe(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;Et.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?Et.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?Et.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 vl(e){return yl.apply(this,arguments)}function yl(){return(yl=Se((function(e){return ke(this,(function(t){return[2,In("setupAd",[],[e],(function(){return ml.getInstance().loadSDK()}))]}))}))).apply(this,arguments)}var gl=[fi({ids:Di.union([Di.string(),Di.array(Di.string())]),config:fi({display:Di.boolean().optional(),onClose:Di.function().optional()}).optional()})];function _l(e){return wl.apply(this,arguments)}function wl(){return wl=Se((function(e){return ke(this,(function(t){return[2,In("loadAd",gl,[e],function(){var e=Se((function(e){return ke(this,(function(t){return ml.getInstance().load(e.ids,e.config),[2]}))}));return function(t){return e.apply(this,arguments)}}())]}))})),wl.apply(this,arguments)}var Tl=[fi({id:Di.string()})];function bl(e){return El.apply(this,arguments)}function El(){return El=Se((function(e){return ke(this,(function(t){return[2,In("displayAd",Tl,[e],function(){var e=Se((function(e){return ke(this,(function(t){return ml.getInstance().display(e.id),[2]}))}));return function(t){return e.apply(this,arguments)}}())]}))})),El.apply(this,arguments)}var Sl=[fi({id:Di.string().optional()}).optional()];function Pl(e){return Il.apply(this,arguments)}function Il(){return Il=Se((function(e){return ke(this,(function(t){return[2,In("refreshAd",Sl,[e],function(){var e=Se((function(e){return ke(this,(function(t){return ml.getInstance().refresh(e.id),[2]}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Il.apply(this,arguments)}var Al=[fi({id:Xr(),guidingText:Xr().optional(),color:Xr().optional(),onStatusChange:Di.function().optional()})];function Ol(e){return kl.apply(this,arguments)}function kl(){return kl=Se((function(e){return ke(this,(function(n){return[2,In("showOAWidget",Al,[e],function(){var e=Se((function(e){var n,r,i,o,a,s,u,c;return ke(this,(function(l){if(Ue.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=ze(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=Se((function(e){var t,n,i,o,a,s,l,d;return ke(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,pn.jumpAndGetToken()]):[3,3];case 1:return p.sent(),l=null===(a=pn.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?ia(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 Ue.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(je("openMiniApp",{}))]}))}));return function(t){return e.apply(this,arguments)}}())]}))})),kl.apply(this,arguments)}var Nl=[fi({id:Xr(),type:Xr(),text:Xr(),color:Xr().optional(),disabled:Di.boolean().optional(),onDataReceived:Di.function().optional(),onError:Di.function().optional()})];function Cl(e){return Ml.apply(this,arguments)}function Ml(){return Ml=Se((function(e){return ke(this,(function(n){return[2,In("showFunctionButtonWidget",Nl,[e],function(){var e=Se((function(e){var n,r,i,o,a,s,u;return ke(this,(function(c){if(Ue.isMp){try{n=document.getElementById(e.id),r=e.onDataReceived,i=e.onError,o=t(e,["onDataReceived","onError"]),n&&(a=document.createElement("iframe"),s="ifFBW-".concat(e.id,"-").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=ze(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=ze(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=Se((function(e){var t,n,a,c,l,d,p,f,h,m,v,y;return ke(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,pn.jumpAndGetToken()]):[3,4];case 1:return g.sent(),f=null===(l=pn.miniProgramConfig)||void 0===l?void 0:l.jwt,h=null===(d=pn.miniProgramConfig)||void 0===d?void 0:d.encryptKey,[4,kn()];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 Ue.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(je("openMiniApp",{}))]}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Ml.apply(this,arguments)}var Rl=function(){var t=Se((function(t,n){var r;return ke(this,(function(i){return r={},"cccd"===t&&(r={mrz:null==n?void 0:n.mrz}),[2,new Promise((function(n,i){cn("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)}}(),xl=[fi({type:Di.enum(["cccd"]),data:fi({mrz:Xr().max(90)})})];function Dl(e){return Ul.apply(this,arguments)}function Ul(){return Ul=Se((function(e){return ke(this,(function(t){return[2,In("scanNFC",xl,[e],function(){var e=Se((function(e){var t,n;return ke(this,(function(r){switch(r.label){case 0:return Ue.isMp?Yt(754,620)?[2,Promise.reject(sn.error.clientNotSupport())]:(t=e.type,n=e.data,[4,Rl(t,n)]):[3,2];case 1:return[2,r.sent()];case 2:return Ue.isMpWeb?[2,Promise.resolve({})]:[2,Promise.reject(je("scanNFC",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Ul.apply(this,arguments)}var Ll=Se((function(){return ke(this,(function(e){return[2,new Promise((function(e,t){cn("CHECK_NFC",{},{success:function(t){e(t)},fail:function(e){t(e)}},{timeout:!1})}))]}))}));function jl(e){return Bl.apply(this,arguments)}function Bl(){return(Bl=Se((function(e){return ke(this,(function(t){return[2,In("checkNFC",[],[e],Se((function(){return ke(this,(function(e){switch(e.label){case 0:return Ue.isMp?[4,Ll()]:[3,2];case 1:return[2,e.sent()];case 2:return Ue.isMpWeb?[2,Promise.resolve({})]:[2,Promise.reject(je("checkNFC",{}))]}}))})))]}))}))).apply(this,arguments)}var Zl=[Di.string().trim().min(1)];var zl=[Di.string().trim().min(1),Di.string().trim()];var Wl=[Di.string().trim().min(1)];var Fl={getItem:function(e){return In("getItem",Zl,[e],(function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];if(Ue.isMp||Ue.isMpWeb){if(Yt(757,625))throw sn.error.clientNotSupport();return yo.getItem(t[0])}throw je("getItem",{})}))},setItem:function(e,t){return In("setItem",zl,[e,t],(function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];if(Ue.isMp||Ue.isMpWeb){if(Yt(757,625))throw sn.error.clientNotSupport();return yo.setItem(t[0],t[1])}throw je("setItem",{})}))},clear:function(){return In("clear",[],[],(function(){if(Ue.isMp||Ue.isMpWeb){if(Yt(757,625))throw sn.error.clientNotSupport();return yo.clearStorageSync()}throw je("clear",{})}))},removeItem:function(e){return In("removeItem",Wl,[e],(function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];if(Ue.isMp||Ue.isMpWeb){if(Yt(757,625))throw sn.error.clientNotSupport();return yo.removeItem(t[0])}throw je("removeItem",{})}))},getStorageInfo:function(){return In("getStorageInfoSync",[],[],(function(){if(Ue.isMp||Ue.isMpWeb){if(Yt(757,625))throw sn.error.clientNotSupport();return yo.getStorageInfoSync()}throw je("getStorageInfoSync",{})}))}},Vl={createOrder:Hu,checkTransaction:ic,createOrderIAP:uc,selectPaymentMethod:tc},Gl={purchase:$u,selectPaymentMethod:tc},Hl=function(){var e=Se((function(e,t){return ke(this,(function(n){return[2,new Promise((function(n,r){cn("SAVE_FILE",{fileUrl:e,onProgress:t},{success:function(e){n()},fail:function(e){r(e)}},{})}))]}))}));return function(t,n){return e.apply(this,arguments)}}(),Kl=[fi({url:Di.string().url()}).optional()];function Jl(e){return ql.apply(this,arguments)}function ql(){return ql=Se((function(e){return ke(this,(function(t){return[2,In("downloadFile",Kl,[e],function(){var e=Se((function(e){var t;return ke(this,(function(n){switch(n.label){case 0:return Ue.isMp?(t=e.url,[4,Hl(t,e.onProgress)]):[3,2];case 1:return[2,n.sent()];case 2:return Ue.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(je("downloadFile",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),ql.apply(this,arguments)}var Ql=Di.enum(["APP_INITIALIZING","APP_READY"]),$l=Di.any();var Yl={logEvent:function(e,t){return In("logEvent",[Ql,$l],[e,t],(function(e,t){if(Ue.isMp||Ue.isMpWeb){var n=pa(Ze({},"object"==typeof t&&null!==t?t:{}),{duration:Math.round(performance.now()),timestamp:Date.now()});return Jt([{action:"zmp.app.lifecycle.tracking",error:0,message:"",data:Ze({eventType:e},n)}])}throw je("logEvent",{})}))}};window.ZaloMiniAppSDK={getVersion:Rn},An();var Xl=Object.freeze({__proto__:null,get Events(){return e.Events},get EventName(){return e.Events},get CameraEvents(){return e.CameraEvents},login:An,getAccessToken:kn,getVersion:Rn,getSystemInfo:Dn,setNavigationBarTitle:Bi,setNavigationBarColor:Wi,setNavigationBarLeftButton:Gi,setStorage:_o,getStorage:bo,getStorageInfo:So,removeStorage:Ao,clearStorage:No,getUserInfo:xo,getNetworkType:jo,onNetworkStatusChange:zo,startBeaconDiscovery:Vo,stopBeaconDiscovery:Ko,getBeacons:Qo,closeApp:Xo,scanQRCode:na,openProfile:aa,openChat:la,openPostFeed:ma,followOA:_a,unfollowOA:Ea,openShareSheet:Oa,requestCameraPermission:Ca,createShortcut:La,openBioAuthentication:za,checkStateBioAuthentication:Va,showToast:Ja,hideKeyboard:$a,openPhone:ts,openSMS:os,viewOAQr:cs,keepScreen:fs,onKeepScreen:ms,offKeepScreen:ys,saveImageToGallery:Ts,saveVideoToGallery:Ps,openMiniApp:ks,vibrate:Rs,openWebview:Ls,getRouteParams:Zs,getAppInfo:zs,sendDataToPreviousMiniApp:Gs,getPhoneNumber:Js,openProfilePicker:Ys,connectWifi:nu,openMediaPicker:au,getShareableLink:cu,closeLoading:pu,requestUpdateZalo:hu,onConfirmToExit:gu,offConfirmToExit:_u,getDeviceId:wu,getDeviceIdAsync:Tu,getContext:Eu,getContextAsync:Su,getAuthCode:Iu,getZPIToken:Ou,setAccessToken:Cu,openOutApp:Ru,chooseImage:Uu,getLocation:Bu,onCallbackData:Wu,createOrder:Hu,purchase:$u,selectPaymentMethod:tc,checkTransaction:ic,createOrderIAP:uc,events:vu,setAndroidBottomNavigationBar:dc,setIOSBottomSafeArea:hc,setStatusBar:yc,configAppView:wc,minimizeApp:Ec,openPermissionSetting:Ic,favoriteApp:kc,openGroupList:Mc,requestSendNotification:Dc,addRating:jc,interactOA:Vc,interactOa:Vc,isAllowedInteractWithOA:Kc,getSetting:qc,authorize:Xc,checkZaloCameraPermission:nl,getUserID:il,getIDToken:sl,createCameraContext:hl,setupAd:vl,loadAd:_l,displayAd:bl,refreshAd:Pl,showOAWidget:Ol,showFunctionButtonWidget:Cl,scanNFC:Dl,checkNFC:jl,nativeStorage:Fl,Payment:Vl,CheckoutSDK:Gl,downloadFile:Jl,trackingManager:Yl,get FacingMode(){return e.FacingMode},get PhotoFormat(){return e.PhotoFormat},get PhotoQuality(){return e.PhotoQuality},get StreamType(){return e.StreamType},ZMACameraImp:dl}),ed=t(Xl,["createOrder","checkTransaction","createOrderIAP","selectPaymentMethod","purchase"]);!function(){var e,t=null===(e=De())||void 0===e?void 0:e.appEnv;(null==t?void 0:t.isMp)&&(window.ZaloMiniAppSDK={},Object.assign(window.ZaloMiniAppSDK,Xl))}(),e.CheckoutSDK=Gl,e.EventName=e.Events,e.Payment=Vl,e.ZMACameraImp=dl,e.addRating=jc,e.authorize=Xc,e.checkNFC=jl,e.checkStateBioAuthentication=Va,e.checkTransaction=ic,e.checkZaloCameraPermission=nl,e.chooseImage=Uu,e.clearStorage=No,e.closeApp=Xo,e.closeLoading=pu,e.configAppView=wc,e.connectWifi=nu,e.createCameraContext=hl,e.createOrder=Hu,e.createOrderIAP=uc,e.createShortcut=La,e.default=ed,e.displayAd=bl,e.downloadFile=Jl,e.events=vu,e.favoriteApp=kc,e.followOA=_a,e.getAccessToken=kn,e.getAppInfo=zs,e.getAuthCode=Iu,e.getBeacons=Qo,e.getContext=Eu,e.getContextAsync=Su,e.getDeviceId=wu,e.getDeviceIdAsync=Tu,e.getIDToken=sl,e.getLocation=Bu,e.getNetworkType=jo,e.getPhoneNumber=Js,e.getRouteParams=Zs,e.getSetting=qc,e.getShareableLink=cu,e.getStorage=bo,e.getStorageInfo=So,e.getSystemInfo=Dn,e.getUserID=il,e.getUserInfo=xo,e.getVersion=Rn,e.getZPIToken=Ou,e.hideKeyboard=$a,e.interactOA=Vc,e.interactOa=Vc,e.isAllowedInteractWithOA=Kc,e.keepScreen=fs,e.loadAd=_l,e.login=An,e.minimizeApp=Ec,e.nativeStorage=Fl,e.offConfirmToExit=_u,e.offKeepScreen=ys,e.onCallbackData=Wu,e.onConfirmToExit=gu,e.onKeepScreen=ms,e.onNetworkStatusChange=zo,e.openBioAuthentication=za,e.openChat=la,e.openGroupList=Mc,e.openMediaPicker=au,e.openMiniApp=ks,e.openOutApp=Ru,e.openPermissionSetting=Ic,e.openPhone=ts,e.openPostFeed=ma,e.openProfile=aa,e.openProfilePicker=Ys,e.openSMS=os,e.openShareSheet=Oa,e.openWebview=Ls,e.purchase=$u,e.refreshAd=Pl,e.removeStorage=Ao,e.requestCameraPermission=Ca,e.requestSendNotification=Dc,e.requestUpdateZalo=hu,e.saveImageToGallery=Ts,e.saveVideoToGallery=Ps,e.scanNFC=Dl,e.scanQRCode=na,e.selectPaymentMethod=tc,e.sendDataToPreviousMiniApp=Gs,e.setAccessToken=Cu,e.setAndroidBottomNavigationBar=dc,e.setIOSBottomSafeArea=hc,e.setNavigationBarColor=Wi,e.setNavigationBarLeftButton=Gi,e.setNavigationBarTitle=Bi,e.setStatusBar=yc,e.setStorage=_o,e.setupAd=vl,e.showFunctionButtonWidget=Cl,e.showOAWidget=Ol,e.showToast=Ja,e.startBeaconDiscovery=Vo,e.stopBeaconDiscovery=Ko,e.trackingManager=Yl,e.unfollowOA=Ea,e.vibrate=Rs,e.viewOAQr=cs,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})),Dt={enablePaymentDone:!1};function Ut(e){var t=e.data;return{orderId:t.zmpOrderId||t.orderId,transId:t.appTransID||t.apptransid||t.transId}}var Lt="ACTION_CALLBACK";function jt(t,n,r,i){switch(!0){case t===e.Events.OpenApp&&(null==i?void 0:i.enablePaymentDone):var o=function(e){var t=new URL(e,window.location.origin),n=t.pathname.split("/")[3].toUpperCase().replace(/-/g,"_"),r={},i=t.searchParams.get("orderId"),o=t.searchParams.get("zmpOrderId"),a=t.searchParams.get("appTransID")||t.searchParams.get("apptransid");switch(n){case"MOMO":case"MOMO_SANDBOX":r.orderId=o,r.transId=i;break;default:r.orderId=o||i,r.transId=a}return r}(r.path);return[{eventName:e.Events.PaymentDone,eventId:n,data:o}];case t===e.Events.OnDataCallback:if(["PAY_BY_BANK","PAY_BY_CUSTOM_METHOD"].includes(r.eventType))return[{eventName:e.Events.OnDataCallback,eventId:n,data:r},{eventName:e.Events.PaymentDone,eventId:n,data:Ut(r)}];default:return[{eventName:t,eventId:n,data:r}]}}var Bt=function(t){Ct(r,t);var n=Rt(r);function r(){var e;return St(this,r),(e=n.apply(this,arguments)).debug=yt("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===Lt||t===e.Events.PaymentCallback)return kt(At(r.prototype),"on",this).call(this,t,n,i);this.debug("register ".concat(String(t),": ").concat(i));return kt(At(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===Lt)return kt(At(r.prototype),"once",this).call(this,e,t,n);this.debug("register once ".concat(String(e),": ").concat(n));return kt(At(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}(xt);function Zt(e){Bt.getInstance().emit(Lt,e)}function zt(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){Zt({serialId:e,actionName:t,result:n})}},window.zaloJSV2={zalo_h5_event_handler:function(t,n,r){var i=yt("zmp:zalo_h5_event_handler");i("eventId: ".concat(t,", eventName: ").concat(n,", eventData: ").concat(r));var a=_n(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);jt(n,t,s,Dt).forEach((function(e){Bt.getInstance().emit(e.eventName,e.eventId,e.data)}))}},window.zaloNative2JS={nativeCall:function(t,n,r){Bt.getInstance().emit(e.Events.PaymentCallback,t,n,r)}};var Wt={encode:zt,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:zt(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":vt(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":vt(r))?JSON.stringify(r):encodeURIComponent(r)].join("=");n.push(i)})),n.join("&")}},Ft={},Vt=function(e,t,n){var r=t||"default";return function(){return(r in Ft?Ft[r](e,n):e).apply(this,arguments)}};Vt.setWrapper=function(e){Ft[arguments.length<=1||void 0===arguments[1]?"default":arguments[1]]=e};var Gt={error:{code:1,error_subcode:1357046,message:"Received Invalid JSON reply.",type:"http"}};function Ht(e){try{return null===e?Gt:JSON.parse(e)}catch(e){return Gt}}var Kt,Jt={execute:function(e,t,n,r){n.suppress_http_code=1;var i=Wt.encode(n);"post"!=t&&(e=Wt.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=Vt((function(){o=r,"onload"in i&&i.onload(n)}),"entry","XMLHttpRequest:load"),a=Vt((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(Ht(e.responseText))},o.onerror=function(e){e.responseText?r(Ht(e.responseText)):r({error:{code:1,error_subcode:1357045,message:"unknown error (empty response)",status:e.status,type:"http"}})},o.send(i),!0)}},qt=Jt,Qt=(Kt=Se((function(e,t,n){var r,i,o,a;return ke(this,(function(s){switch(s.label){case 0:return r={appId:e,versionStatus:t},Et.isUndefined(n)||(r.currentVersion=n),i=Wt.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 Kt.apply(this,arguments)});function $t(e){try{var t=e.map((function(e){return{action:e.action,error:e.error,message:e.message,data:e.data}}));qt.execute(d.SEND_ACTION_LOG,"post",{appId:window.APP_ID,data:JSON.stringify(t)},(function(){}))}catch(e){}}var Yt=function(e){return e.replace(/[A-Z]/g,(function(e){return"_".concat(e.toLowerCase())}))},Xt=function(){var e;return"android"===((null===(e=De())||void 0===e?void 0:e.platformName)||"").toLowerCase()},en=function(){var e=0;if(window.zaloVersionCode)e=window.zaloVersionCode;else{var t,n=Number((null===(t=De())||void 0===t?void 0:t.zaloVersion)||"");if(n>=24112e3)e=n;else{var r,i=((null===(r=De())||void 0===r?void 0:r.platformName)||"").toLowerCase();"android"===i?e=n%1e4:"ios"===i&&(e=n)}}return e},tn=function(e,t){var n=en();return Xt()&&n<e||function(){var e;return"ios"===((null===(e=De())||void 0===e?void 0:e.platformName)||"").toLowerCase()}()&&n<t};function nn(e,t){return null!=t&&"undefined"!=typeof Symbol&&t[Symbol.hasInstance]?!!t[Symbol.hasInstance](e):e instanceof t}var rn,on=function(){function e(t,n,r,i){St(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}(),an=function(e,t){return nn(e,on)?function(e,t){return e.api=t,e.toJSON()}(e,t):function(e,t){return nn(e,Error)?new on(U,e.message,t).toJSON():Et.isEmpty(null==e?void 0:e.message)||Et.isEmpty(null==e?void 0:e.code)?new on(U,J,t,e).toJSON():new on(e.code,e.message,t,e.detail).toJSON()}(e,t)},sn=(rn=Se((function(e){var t;return ke(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,Ze({method:"GET"},t))];case 1:return[4,n.sent().json()];case 2:return[2,n.sent()]}}))})),function(e){return rn.apply(this,arguments)}),un=Se((function(){return ke(this,(function(e){return[2,new Promise(function(){var e=Se((function(e,t){var n,r,i,o;return ke(this,(function(a){switch(a.label){case 0:return a.trys.push([0,3,,4]),[4,mn.jumpAndGetToken()];case 1:return a.sent(),(r=null===(n=mn.miniProgramConfig)||void 0===n?void 0:n.jwt)||t(new on(B,$,"getSetting")),[4,sn(r)];case 2:return(i=a.sent())&&0===i.err?e({authSetting:i.data}):t(new on(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)}}())]}))})),cn=function(){var t,n,r,i=De(),o={},a=Bt.getInstance(),s=[],u=!1;return u||(n=function(t){var n=t.serialId,r=wn(t.result),i=Sn(null==r?void 0:r.action),u=Et.isEmpty(null==r?void 0:r.error_code)?0:null==r?void 0:r.error_code,c=null==r?void 0:r.error_message,l=(null==r?void 0:r.data)||r;if(i&&0===u){var d=JSON.parse(null==r?void 0:r.data);u=Et.isEmpty(null==d?void 0:d.error_code)?0:null==d?void 0:d.error_code,c=null==d?void 0:d.error_message,l=(null==d?void 0:d.data)||d}var p={error_code:u,error_message:c,data:l,action:(null==r?void 0:r.action)||t.actionName};if(n&&o[n]){var f=o[n],h=f.callback,m=f.timeout,v=f.isMultiCallback,y=f.options,g=f.downloadListener;!function(e,t){var n=t||{},r=n.success,i=n.fail;0===e.error_code?Et.isFunction(r)&&r(e):Et.isFunction(i)&&i(e)}(p,h),!v&&delete o[n],m&&clearTimeout(m);var _={action:null==p?void 0:p.action,error:null==p?void 0:p.error_code,message:null==p?void 0:p.error_message,data:{}};try{if("action.open.inapp"===p.action||"action.open.outapp"===p.action){var w=new URL(null==y?void 0:y.url),T="".concat(w.protocol,"//").concat(w.host).concat(w.pathname);_.data={url:T}}if("action.follow.oa"===p.action||"action.unfollow.oa"===p.action){var b=null==y?void 0:y.uid;_.data={uid:b}}if("action.open.chat"===p.action){var E=null==y?void 0:y.uId,S=null==y?void 0:y.type;_.data={uid:E,openChatType:S}}(null==y?void 0:y.onProgress)&&g&&a.off(e.Events.DownloadProgress,g)}catch(e){}s.push(_)}},Bt.getInstance().on(Lt,n),a.on(e.Events.AppPaused,(function(){if(s.length>0){var e=s;s=[],$t(e)}})),t?clearInterval(t):t=setInterval((function(){if(s.length>0){var e=s;s=[],$t(e)}}),5e3),u=!0),r=Se((function(t,n,r,s){var u,c,l,d,p,f,h,m,v,y,g,_,w,T,b,E,S,P,I,A,O,k,N;return ke(this,(function(C){switch(C.label){case 0:return c=Math.floor(1e6*Math.random()),l="".concat(t,"_").concat(c),d=On(t),(null==s?void 0:s.actionName)&&s.actionName.length>0&&(d=null==s?void 0:s.actionName),p=(null==s?void 0:s.isMultiCallback)||!1,f=!1!==(null==s?void 0:s.timeout)&&((null==s?void 0:s.timeout)||!0),h=(null==s?void 0:s.haveCallback)||!1,m=(null==s?void 0:s.skipJump)||!1,v=(null==s?void 0:s.requireAccessToken)||!1,y=Pn(d),n&&r&&(o[l]={options:n,callback:r,isMultiCallback:p},f&&h&&(o[l].timeout=setTimeout((function(){return Zt({serialId:l,result:{error_code:z,error_message:Q,data:{timeout:f},action:t}}),null}),!0===f?8e3:1e3*f))),y?[4,un()]:[3,2];case 1:if(!1===(null==(_=C.sent())||null===(g=_.authSetting)||void 0===g?void 0:g["scope.userInfo"]))return Zt({serialId:l,result:{error_code:B,error_message:ee,data:{isMobile:null==i||null===(w=i.platform)||void 0===w?void 0:w.isMobile},action:t}}),[2];C.label=2;case 2:return T=Sn(d),!(null==i||null===(u=i.platform)||void 0===u?void 0:u.isMobile)||!t||Et.isUndefined(ZaloJavaScriptInterface)||i.platform.isIOS&&!gn(t)||T&&!1===T.isSupported?(Zt({serialId:l,result:{error_code:Z,error_message:X,data:{isMobile:null==i||null===(b=i.platform)||void 0===b?void 0:b.isMobile},action:t}}),[2]):(E=yn(n),m?[3,4]:[4,mn.getJSAccessToken()]);case 3:return P=C.sent(),[3,5];case 4:P="",C.label=5;case 5:S=P,C.label=6;case 6:return C.trys.push([6,10,,11]),m||!v?[3,8]:[4,mn.getAccessToken()];case 7:return A=C.sent(),[3,9];case 8:A="",C.label=9;case 9:return I=A,[3,11];case 10:return O=C.sent(),Zt({serialId:l,result:{error_code:null==O?void 0:O.code,error_message:null==O?void 0:O.message,action:t}}),[2];case 11:try{n&&(null==n?void 0:n.onProgress)&&(k=function(e){!function(e,t){e.url;var n=e.progress;t&&t(n)}(e,null==n?void 0:n.onProgress)},o[l].downloadListener=k,a.on(e.Events.DownloadProgress,k))}catch(e){}return N=i.platform.isIOS?window.onNativeMessage(l,d):'window.onNativeMessage("'.concat(l,'", "').concat(d,'")'),[2,ZaloJavaScriptInterface.jsCall(S,d,I,E,N)]}}))})),function(e,t,n,i){return r.apply(this,arguments)}}(),ln={success:function(e,t){return{code:D,message:t||K,data:e||{}}},error:{failLimit:function(){return new on(W,q)},badRequest:function(e){return new on(L,e)},loginFailed:function(e){return new on(B,"".concat(Y,": ").concat(e))},loginRequired:function(){return new on(B,$)},cannotGetShareInfo:function(){return new on(j,"Can not get app info to share")},createIAPOrderFailed:function(e){var t=Object.keys(be).find((function(t){return t===e.toString()}));return new on(e,t||J)},clientNotSupport:function(){return new on(Z,X)}}},dn=function(t){var n,r,i,o=null===(n=De())||void 0===n?void 0:n.platformName,a=An(t.action),s=se[a],u=(null==s?void 0:s.skipJump)||!1,c=(null==s?void 0:s.errorList)||{};if("JUMP_LOGIN"===a)return new on(U,"Can not get auth code: ".concat(t.error_message));if(mn.jumpStatus!==e.JumpStatus.DONE&&!u)return new on(oe.UNAUTHORIZED.code,oe.UNAUTHORIZED.message);if("permission required!"===String(t.error_message).toLowerCase()||"no permission!"===String(t.error_message).toLowerCase())return new on(oe.FORBIDDEN.code,oe.FORBIDDEN.message);if(o&&(null===(r=ue[o])||void 0===r?void 0:r[t.error_code]))return new on(ue[o][t.error_code].code,ue[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;if(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);return new on(null===(p=l.mapTo)||void 0===p?void 0:p.code,h)}return new on(t.error_code,t.error_message)},pn=function(e,t,r,i){var o=function(e,t){function r(r){return function(i){var o=Et.isEmpty(t)?void 0:t[r];if(o)return Le({stage:n.RESPONSE,type:"log",state:r,name:e,response:i}),o("fail"===r?dn(i):null==i?void 0:i.data)}}return Et.isUndefined(e)&&(e=""),Object.assign({},{success:r("success"),fail:r("fail")})}(e,r),a=se[e],s=(null==i?void 0:i.delay)||0;setTimeout((function(){cn(e,t,o,Ze({},i,a))}),s)},fn=function(){var e=Se((function(e){return ke(this,(function(t){return[2,new Promise((function(t,n){pn("MP_USER_AUTHORIZE",{scopes:e,forceUpdate:!0},{success:function(e){Et.isEmpty(e)||t(e)},fail:function(e){n(e)}},{isMultiCallback:!1,timeout:!1})}))]}))}));return function(t){return e.apply(this,arguments)}}(),hn=function(){function t(){St(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=ae[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 Se((function(){return ke(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,Le({stage:n.REQUEST,type:"log",name:"jump"}),cn("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)||$t([{action:"action.jump.login",error:-102,message:"no zoauth",data:{}}]),r(e.JumpStatus.DONE)},fail:function(e){$t([{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 Se((function(){var i;return ke(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=Se((function(e){var t,n,i;return ke(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 Se((function(){var i,o;return ke(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),Et.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,Ze({method:"POST",body:i},o)).then(function(){var e=Se((function(e){var t,n,i,o;return ke(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 Se((function(){var n,r,a,s,u,c,d,p,f;function h(){return m.apply(this,arguments)}function m(){return(m=Se((function(){return ke(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 ke(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--,$t([{action:d,error:-104,message:"no user auth",data:{}}]),ln.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),$t([{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)]:($t([{action:d,error:-101,message:"no accessToken",data:{}}]),[2,Promise.reject(ln.error.loginFailed("Can't get accessToken. Please try again later."))]);case 15:throw r.getAccessTokenCount--,$t([{action:d,error:-102,message:"no oauth",data:{}}]),ln.error.loginFailed("Zalo app has not been activated")}}))}))()},c.verifyUserAuthorized=function(){var e=this;return Se((function(){var t,n,r,i,o,a;return ke(this,(function(s){switch(s.label){case 0:return n=!0,[4,e.jumpAndGetToken()];case 1:if(s.sent(),!1!==(null===(t=e._miniProgramConfig)||void 0===t?void 0:t.userAuthorized))return[3,7];s.label=2;case 2:return s.trys.push([2,6,,7]),(r=Sn("action.mp.user.authorize"))&&r.isSupported?[4,un()]:[3,5];case 3:return!1!==(null==(o=s.sent())||null===(i=o.authSetting)||void 0===i?void 0:i["scope.userInfo"])?[3,5]:[4,fn()];case 4:a=s.sent(),n=(null==a?void 0:a["scope.userInfo"])||!1,s.label=5;case 5:return[3,7];case 6:return s.sent(),n=!1,[3,7];case 7: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 Se((function(){var t;return ke(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=Se((function(i){var o,a,s,u;return ke(this,(function(c){switch(c.label){case 0:return!n&&r._cookies.length>0?Et.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}}])&&Pt(r.prototype,a),u&&Pt(r,u),t}(),mn=hn.getInstance(),vn=yt("zmp:utils:common"),yn=function(e){if(Et.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(yn(e[r]));return"["+t.join(",")+"]"}if("object"==typeof e){for(var i in t=[],e)t.push('"'+i+'":'+yn(e[i]));return"{"+t.join(",")+"}"}return e.toString()},gn=function(e){var t,n,r=se[e],i=(null===(t=De())||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},_n=function(e){try{if(e){vn(e);var t=e.replace(/\\/g,"").replace(/'/g,"'");try{t=decodeURIComponent(atob(e))}catch(e){}var n=JSON.parse(t);return vn("formattedValue",t,n,void 0===n?"undefined":vt(n)),n}return null}catch(t){return vn("parse json error:",t),e}},wn=function(e){if(Et.isObject(JSON)&&JSON.parse&&Et.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 Et.isObject(e)?e:new Function("return "+e)()},Tn=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""},bn=function(e){return btoa(encodeURIComponent(JSON.stringify(e)))};var En=function(t){return"hidden"===t?e.StatusBarType.hidden:"transparent"===t?e.StatusBarType.transparent:e.StatusBarType.normal},Sn=function(e){if(void 0!==e){var t=mn.miniProgramConfig;return((null==t?void 0:t.dynamicApis)||[]).find((function(t){return t.action===e&&!1===t.clientHandle}))}},Pn=function(e){if(void 0===e)return!1;var t=mn.miniProgramConfig;return((null==t?void 0:t.requiredAuthenList)||[]).indexOf(e)>=0},In=function(){var e=Se((function(){return ke(this,(function(e){return[2,new Promise(function(){var e=Se((function(e,t){var n;return ke(this,(function(t){switch(t.label){case 0:return t.trys.push([0,2,,3]),[4,mn.jumpAndGetToken()];case 1:return t.sent(),n=mn.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)}}(),An=function(e){return e.replace("action.","").replace(/\./g,"_").toUpperCase()},On=function(e){return"action.".concat(e.replace(/\_/g,".").toLowerCase())};function kn(e,t,n,r){var i,o;!function(e,t){if(ae[e]){var n=mn.getRetryLimit(e);n.lastCall&&(new Date).getTime()-n.lastCall>1e3&&mn.resetRetryLimit(e);var r=n.limit||3;if(n.retry&&n.retry>=r)throw an(ln.error.failLimit(),e);mn.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=ln.error.badRequest(s);throw c.detail=a,an(c,e)}u.push(i.data)}));var c=r.apply(void 0,Oe(u));return Et.isPromise(c)?new Promise((function(t,n){c.then((function(e){if(!Et.isNull(a)&&Et.isFunction(a))return a(e);t(c)})).catch((function(t){var r=an(t,e);if(!Et.isNull(s)&&Et.isFunction(s))return s(r);n(r)}))})):c}catch(t){if(!Et.isNull(s)&&Et.isFunction(s))return s(t);throw an(t,e)}}function Nn(e){return Cn.apply(this,arguments)}function Cn(){return(Cn=Se((function(e){return ke(this,(function(t){return[2,kn("login",[],[e],Se((function(){return ke(this,(function(e){switch(e.label){case 0:return Ue.isMp?[4,mn.jumpAndGetToken(l.ZOAUTH)]:[3,2];case 1:return e.sent(),[2,"Success"];case 2:return Ue.isMpWeb?[2,Promise.resolve("")]:[2,Promise.reject(je("login",{}))]}}))})))]}))}))).apply(this,arguments)}function Mn(e){return Rn.apply(this,arguments)}function Rn(){return(Rn=Se((function(e){return ke(this,(function(t){return[2,kn("getAccessToken",[],[e],Se((function(){var e;return ke(this,(function(t){switch(t.label){case 0:return Ue.isMp?[4,In()]:[3,3];case 1:return e=!t.sent(),[4,mn.getAccessToken(e)];case 2:return[2,t.sent()||""];case 3:return Ue.isMpWeb?[2,Promise.resolve("")]:[2,Promise.reject(je("getAccessToken",{}))]}}))})))]}))}))).apply(this,arguments)}var xn,Dn="2.45.0-beta.2";function Un(){return kn("getVersion",[],[],(function(){return Dn}))}function Ln(){var e,t;return{version:Tn("version-id")||"",apiVersion:Dn,zaloVersion:(null===(e=De())||void 0===e?void 0:e.zaloVersion)||"",platform:(null===(t=De())||void 0===t?void 0:t.platformName)||"",language:navigator.language,zaloLanguage:window.zLanguage||"vi",zaloTheme:window.zTheme||"light"}}function jn(){return kn("getSystemInfo",[],[],(function(){return Ln()}))}!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}(xn||(xn={}));const Bn=xn.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Zn=e=>{switch(typeof e){case"undefined":return Bn.undefined;case"string":return Bn.string;case"number":return isNaN(e)?Bn.nan:Bn.number;case"boolean":return Bn.boolean;case"function":return Bn.function;case"bigint":return Bn.bigint;case"symbol":return Bn.symbol;case"object":return Array.isArray(e)?Bn.array:null===e?Bn.null:e.then&&"function"==typeof e.then&&e.catch&&"function"==typeof e.catch?Bn.promise:"undefined"!=typeof Map&&e instanceof Map?Bn.map:"undefined"!=typeof Set&&e instanceof Set?Bn.set:"undefined"!=typeof Date&&e instanceof Date?Bn.date:Bn.object;default:return Bn.unknown}},zn=xn.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 Wn 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,xn.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()}}Wn.create=e=>new Wn(e);const Fn=(e,t)=>{let n;switch(e.code){case zn.invalid_type:n=e.received===Bn.undefined?"Required":`Expected ${e.expected}, received ${e.received}`;break;case zn.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(e.expected,xn.jsonStringifyReplacer)}`;break;case zn.unrecognized_keys:n=`Unrecognized key(s) in object: ${xn.joinValues(e.keys,", ")}`;break;case zn.invalid_union:n="Invalid input";break;case zn.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${xn.joinValues(e.options)}`;break;case zn.invalid_enum_value:n=`Invalid enum value. Expected ${xn.joinValues(e.options)}, received '${e.received}'`;break;case zn.invalid_arguments:n="Invalid function arguments";break;case zn.invalid_return_type:n="Invalid function return type";break;case zn.invalid_date:n="Invalid date";break;case zn.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}"`:xn.assertNever(e.validation):n="regex"!==e.validation?`Invalid ${e.validation}`:"Invalid";break;case zn.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 zn.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 zn.custom:n="Invalid input";break;case zn.invalid_intersection_types:n="Intersection results could not be merged";break;case zn.not_multiple_of:n=`Number must be a multiple of ${e.multipleOf}`;break;case zn.not_finite:n="Number must be finite";break;default:n=t.defaultError,xn.assertNever(e)}return{message:n}};let Vn=Fn;function Gn(){return Vn}const Hn=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 Kn(e,t){const n=Hn({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,Gn(),Fn].filter((e=>!!e))});e.common.issues.push(n)}class Jn{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 qn;"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 Jn.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 qn;if("aborted"===i.status)return qn;"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 qn=Object.freeze({status:"aborted"}),Qn=e=>({status:"dirty",value:e}),$n=e=>({status:"valid",value:e}),Yn=e=>"aborted"===e.status,Xn=e=>"dirty"===e.status,er=e=>"valid"===e.status,tr=e=>"undefined"!=typeof Promise&&e instanceof Promise;var nr;!function(e){e.errToObj=e=>"string"==typeof e?{message:e}:e||{},e.toString=e=>"string"==typeof e?e:null==e?void 0:e.message}(nr||(nr={}));class rr{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 ir=(e,t)=>{if(er(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 Wn(e.common.issues)}};function or(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 ar{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 Zn(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:Zn(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new Jn,ctx:{common:e.parent.common,data:e.data,parsedType:Zn(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const t=this._parse(e);if(tr(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:Zn(e)},i=this._parseSync({data:e,path:r.path,parent:r});return ir(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:Zn(e)},r=this._parse({data:e,path:n.path,parent:n}),i=await(tr(r)?r:Promise.resolve(r));return ir(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:zn.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 Vr({schema:this,typeName:ti.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}optional(){return Gr.create(this,this._def)}nullable(){return Hr.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Sr.create(this,this._def)}promise(){return Fr.create(this,this._def)}or(e){return Or.create([this,e],this._def)}and(e){return Mr.create(this,e,this._def)}transform(e){return new Vr({...or(this._def),schema:this,typeName:ti.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const t="function"==typeof e?e:()=>e;return new Kr({...or(this._def),innerType:this,defaultValue:t,typeName:ti.ZodDefault})}brand(){return new $r({typeName:ti.ZodBranded,type:this,...or(this._def)})}catch(e){const t="function"==typeof e?e:()=>e;return new Jr({...or(this._def),innerType:this,catchValue:t,typeName:ti.ZodCatch})}describe(e){return new(0,this.constructor)({...this._def,description:e})}pipe(e){return Yr.create(this,e)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const sr=/^c[^\s-]{8,}$/i,ur=/^[a-z][a-z0-9]*$/,cr=/^([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,lr=/^(([^<>()[\]\\.,;:\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 dr extends ar{constructor(){super(...arguments),this._regex=(e,t,n)=>this.refinement((t=>e.test(t)),{validation:t,code:zn.invalid_string,...nr.errToObj(n)}),this.nonempty=e=>this.min(1,nr.errToObj(e)),this.trim=()=>new dr({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}_parse(e){this._def.coerce&&(e.data=String(e.data));if(this._getType(e)!==Bn.string){const t=this._getOrReturnCtx(e);return Kn(t,{code:zn.invalid_type,expected:Bn.string,received:t.parsedType}),qn}const t=new Jn;let n;for(const i of this._def.checks)if("min"===i.kind)e.data.length<i.value&&(n=this._getOrReturnCtx(e,n),Kn(n,{code:zn.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),Kn(n,{code:zn.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?Kn(n,{code:zn.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}):o&&Kn(n,{code:zn.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}),t.dirty())}else if("email"===i.kind)lr.test(e.data)||(n=this._getOrReturnCtx(e,n),Kn(n,{validation:"email",code:zn.invalid_string,message:i.message}),t.dirty());else if("uuid"===i.kind)cr.test(e.data)||(n=this._getOrReturnCtx(e,n),Kn(n,{validation:"uuid",code:zn.invalid_string,message:i.message}),t.dirty());else if("cuid"===i.kind)sr.test(e.data)||(n=this._getOrReturnCtx(e,n),Kn(n,{validation:"cuid",code:zn.invalid_string,message:i.message}),t.dirty());else if("cuid2"===i.kind)ur.test(e.data)||(n=this._getOrReturnCtx(e,n),Kn(n,{validation:"cuid2",code:zn.invalid_string,message:i.message}),t.dirty());else if("url"===i.kind)try{new URL(e.data)}catch(r){n=this._getOrReturnCtx(e,n),Kn(n,{validation:"url",code:zn.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),Kn(n,{validation:"regex",code:zn.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),Kn(n,{code:zn.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),Kn(n,{code:zn.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),Kn(n,{code:zn.invalid_string,validation:"datetime",message:i.message}),t.dirty())}else xn.assertNever(i);var r;return{status:t.value,value:e.data}}_addCheck(e){return new dr({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...nr.errToObj(e)})}url(e){return this._addCheck({kind:"url",...nr.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...nr.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...nr.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...nr.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,...nr.errToObj(null==e?void 0:e.message)})}regex(e,t){return this._addCheck({kind:"regex",regex:e,...nr.errToObj(t)})}startsWith(e,t){return this._addCheck({kind:"startsWith",value:e,...nr.errToObj(t)})}endsWith(e,t){return this._addCheck({kind:"endsWith",value:e,...nr.errToObj(t)})}min(e,t){return this._addCheck({kind:"min",value:e,...nr.errToObj(t)})}max(e,t){return this._addCheck({kind:"max",value:e,...nr.errToObj(t)})}length(e,t){return this._addCheck({kind:"length",value:e,...nr.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 pr(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)}dr.create=e=>{var t;return new dr({checks:[],typeName:ti.ZodString,coerce:null!==(t=null==e?void 0:e.coerce)&&void 0!==t&&t,...or(e)})};class fr extends ar{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)!==Bn.number){const t=this._getOrReturnCtx(e);return Kn(t,{code:zn.invalid_type,expected:Bn.number,received:t.parsedType}),qn}let t;const n=new Jn;for(const r of this._def.checks)if("int"===r.kind)xn.isInteger(e.data)||(t=this._getOrReturnCtx(e,t),Kn(t,{code:zn.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),Kn(t,{code:zn.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),Kn(t,{code:zn.too_big,maximum:r.value,type:"number",inclusive:r.inclusive,exact:!1,message:r.message}),n.dirty())}else"multipleOf"===r.kind?0!==pr(e.data,r.value)&&(t=this._getOrReturnCtx(e,t),Kn(t,{code:zn.not_multiple_of,multipleOf:r.value,message:r.message}),n.dirty()):"finite"===r.kind?Number.isFinite(e.data)||(t=this._getOrReturnCtx(e,t),Kn(t,{code:zn.not_finite,message:r.message}),n.dirty()):xn.assertNever(r);return{status:n.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,nr.toString(t))}gt(e,t){return this.setLimit("min",e,!1,nr.toString(t))}lte(e,t){return this.setLimit("max",e,!0,nr.toString(t))}lt(e,t){return this.setLimit("max",e,!1,nr.toString(t))}setLimit(e,t,n,r){return new fr({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:n,message:nr.toString(r)}]})}_addCheck(e){return new fr({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:nr.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:nr.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:nr.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:nr.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:nr.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:nr.toString(t)})}finite(e){return this._addCheck({kind:"finite",message:nr.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&&xn.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)}}fr.create=e=>new fr({checks:[],typeName:ti.ZodNumber,coerce:(null==e?void 0:e.coerce)||!1,...or(e)});class hr extends ar{_parse(e){this._def.coerce&&(e.data=BigInt(e.data));if(this._getType(e)!==Bn.bigint){const t=this._getOrReturnCtx(e);return Kn(t,{code:zn.invalid_type,expected:Bn.bigint,received:t.parsedType}),qn}return $n(e.data)}}hr.create=e=>{var t;return new hr({typeName:ti.ZodBigInt,coerce:null!==(t=null==e?void 0:e.coerce)&&void 0!==t&&t,...or(e)})};class mr extends ar{_parse(e){this._def.coerce&&(e.data=Boolean(e.data));if(this._getType(e)!==Bn.boolean){const t=this._getOrReturnCtx(e);return Kn(t,{code:zn.invalid_type,expected:Bn.boolean,received:t.parsedType}),qn}return $n(e.data)}}mr.create=e=>new mr({typeName:ti.ZodBoolean,coerce:(null==e?void 0:e.coerce)||!1,...or(e)});class vr extends ar{_parse(e){this._def.coerce&&(e.data=new Date(e.data));if(this._getType(e)!==Bn.date){const t=this._getOrReturnCtx(e);return Kn(t,{code:zn.invalid_type,expected:Bn.date,received:t.parsedType}),qn}if(isNaN(e.data.getTime())){return Kn(this._getOrReturnCtx(e),{code:zn.invalid_date}),qn}const t=new Jn;let n;for(const r of this._def.checks)"min"===r.kind?e.data.getTime()<r.value&&(n=this._getOrReturnCtx(e,n),Kn(n,{code:zn.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),Kn(n,{code:zn.too_big,message:r.message,inclusive:!0,exact:!1,maximum:r.value,type:"date"}),t.dirty()):xn.assertNever(r);return{status:t.value,value:new Date(e.data.getTime())}}_addCheck(e){return new vr({...this._def,checks:[...this._def.checks,e]})}min(e,t){return this._addCheck({kind:"min",value:e.getTime(),message:nr.toString(t)})}max(e,t){return this._addCheck({kind:"max",value:e.getTime(),message:nr.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}}vr.create=e=>new vr({checks:[],coerce:(null==e?void 0:e.coerce)||!1,typeName:ti.ZodDate,...or(e)});class yr extends ar{_parse(e){if(this._getType(e)!==Bn.symbol){const t=this._getOrReturnCtx(e);return Kn(t,{code:zn.invalid_type,expected:Bn.symbol,received:t.parsedType}),qn}return $n(e.data)}}yr.create=e=>new yr({typeName:ti.ZodSymbol,...or(e)});class gr extends ar{_parse(e){if(this._getType(e)!==Bn.undefined){const t=this._getOrReturnCtx(e);return Kn(t,{code:zn.invalid_type,expected:Bn.undefined,received:t.parsedType}),qn}return $n(e.data)}}gr.create=e=>new gr({typeName:ti.ZodUndefined,...or(e)});class _r extends ar{_parse(e){if(this._getType(e)!==Bn.null){const t=this._getOrReturnCtx(e);return Kn(t,{code:zn.invalid_type,expected:Bn.null,received:t.parsedType}),qn}return $n(e.data)}}_r.create=e=>new _r({typeName:ti.ZodNull,...or(e)});class wr extends ar{constructor(){super(...arguments),this._any=!0}_parse(e){return $n(e.data)}}wr.create=e=>new wr({typeName:ti.ZodAny,...or(e)});class Tr extends ar{constructor(){super(...arguments),this._unknown=!0}_parse(e){return $n(e.data)}}Tr.create=e=>new Tr({typeName:ti.ZodUnknown,...or(e)});class br extends ar{_parse(e){const t=this._getOrReturnCtx(e);return Kn(t,{code:zn.invalid_type,expected:Bn.never,received:t.parsedType}),qn}}br.create=e=>new br({typeName:ti.ZodNever,...or(e)});class Er extends ar{_parse(e){if(this._getType(e)!==Bn.undefined){const t=this._getOrReturnCtx(e);return Kn(t,{code:zn.invalid_type,expected:Bn.void,received:t.parsedType}),qn}return $n(e.data)}}Er.create=e=>new Er({typeName:ti.ZodVoid,...or(e)});class Sr extends ar{_parse(e){const{ctx:t,status:n}=this._processInputParams(e),r=this._def;if(t.parsedType!==Bn.array)return Kn(t,{code:zn.invalid_type,expected:Bn.array,received:t.parsedType}),qn;if(null!==r.exactLength){const e=t.data.length>r.exactLength.value,i=t.data.length<r.exactLength.value;(e||i)&&(Kn(t,{code:e?zn.too_big:zn.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&&(Kn(t,{code:zn.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&&(Kn(t,{code:zn.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 rr(t,e,t.path,n))))).then((e=>Jn.mergeArray(n,e)));const i=[...t.data].map(((e,n)=>r.type._parseSync(new rr(t,e,t.path,n))));return Jn.mergeArray(n,i)}get element(){return this._def.type}min(e,t){return new Sr({...this._def,minLength:{value:e,message:nr.toString(t)}})}max(e,t){return new Sr({...this._def,maxLength:{value:e,message:nr.toString(t)}})}length(e,t){return new Sr({...this._def,exactLength:{value:e,message:nr.toString(t)}})}nonempty(e){return this.min(1,e)}}var Pr;function Ir(e){if(e instanceof Ar){const t={};for(const n in e.shape){const r=e.shape[n];t[n]=Gr.create(Ir(r))}return new Ar({...e._def,shape:()=>t})}return e instanceof Sr?Sr.create(Ir(e.element)):e instanceof Gr?Gr.create(Ir(e.unwrap())):e instanceof Hr?Hr.create(Ir(e.unwrap())):e instanceof Rr?Rr.create(e.items.map((e=>Ir(e)))):e}Sr.create=(e,t)=>new Sr({type:e,minLength:null,maxLength:null,exactLength:null,typeName:ti.ZodArray,...or(t)}),function(e){e.mergeShapes=(e,t)=>({...e,...t})}(Pr||(Pr={}));class Ar extends ar{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=xn.objectKeys(e);return this._cached={shape:e,keys:t}}_parse(e){if(this._getType(e)!==Bn.object){const t=this._getOrReturnCtx(e);return Kn(t,{code:zn.invalid_type,expected:Bn.object,received:t.parsedType}),qn}const{status:t,ctx:n}=this._processInputParams(e),{shape:r,keys:i}=this._getCached(),o=[];if(!(this._def.catchall instanceof br&&"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 rr(n,i,n.path,e)),alwaysSet:e in n.data})}if(this._def.catchall instanceof br){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&&(Kn(n,{code:zn.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 rr(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=>Jn.mergeObjectSync(t,e))):Jn.mergeObjectSync(t,a)}get shape(){return this._def.shape()}strict(e){return nr.errToObj,new Ar({...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=nr.errToObj(e).message)&&void 0!==a?a:s}:{message:s}}}:{}})}strip(){return new Ar({...this._def,unknownKeys:"strip"})}passthrough(){return new Ar({...this._def,unknownKeys:"passthrough"})}extend(e){return new Ar({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new Ar({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>Pr.mergeShapes(this._def.shape(),e._def.shape()),typeName:ti.ZodObject})}setKey(e,t){return this.augment({[e]:t})}catchall(e){return new Ar({...this._def,catchall:e})}pick(e){const t={};return xn.objectKeys(e).forEach((n=>{e[n]&&this.shape[n]&&(t[n]=this.shape[n])})),new Ar({...this._def,shape:()=>t})}omit(e){const t={};return xn.objectKeys(this.shape).forEach((n=>{e[n]||(t[n]=this.shape[n])})),new Ar({...this._def,shape:()=>t})}deepPartial(){return Ir(this)}partial(e){const t={};return xn.objectKeys(this.shape).forEach((n=>{const r=this.shape[n];e&&!e[n]?t[n]=r:t[n]=r.optional()})),new Ar({...this._def,shape:()=>t})}required(e){const t={};return xn.objectKeys(this.shape).forEach((n=>{if(e&&!e[n])t[n]=this.shape[n];else{let e=this.shape[n];for(;e instanceof Gr;)e=e._def.innerType;t[n]=e}})),new Ar({...this._def,shape:()=>t})}keyof(){return Zr(xn.objectKeys(this.shape))}}Ar.create=(e,t)=>new Ar({shape:()=>e,unknownKeys:"strip",catchall:br.create(),typeName:ti.ZodObject,...or(t)}),Ar.strictCreate=(e,t)=>new Ar({shape:()=>e,unknownKeys:"strict",catchall:br.create(),typeName:ti.ZodObject,...or(t)}),Ar.lazycreate=(e,t)=>new Ar({shape:e,unknownKeys:"strip",catchall:br.create(),typeName:ti.ZodObject,...or(t)});class Or extends ar{_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 Wn(e.ctx.common.issues)));return Kn(t,{code:zn.invalid_union,unionErrors:n}),qn}));{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 Wn(e)));return Kn(t,{code:zn.invalid_union,unionErrors:i}),qn}}get options(){return this._def.options}}Or.create=(e,t)=>new Or({options:e,typeName:ti.ZodUnion,...or(t)});const kr=e=>e instanceof jr?kr(e.schema):e instanceof Vr?kr(e.innerType()):e instanceof Br?[e.value]:e instanceof zr?e.options:e instanceof Wr?Object.keys(e.enum):e instanceof Kr?kr(e._def.innerType):e instanceof gr?[void 0]:e instanceof _r?[null]:null;class Nr extends ar{_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==Bn.object)return Kn(t,{code:zn.invalid_type,expected:Bn.object,received:t.parsedType}),qn;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}):(Kn(t,{code:zn.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[n]}),qn)}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=kr(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 Nr({typeName:ti.ZodDiscriminatedUnion,discriminator:e,options:t,optionsMap:r,...or(n)})}}function Cr(e,t){const n=Zn(e),r=Zn(t);if(e===t)return{valid:!0,data:e};if(n===Bn.object&&r===Bn.object){const n=xn.objectKeys(t),r=xn.objectKeys(e).filter((e=>-1!==n.indexOf(e))),i={...e,...t};for(const n of r){const r=Cr(e[n],t[n]);if(!r.valid)return{valid:!1};i[n]=r.data}return{valid:!0,data:i}}if(n===Bn.array&&r===Bn.array){if(e.length!==t.length)return{valid:!1};const n=[];for(let r=0;r<e.length;r++){const i=Cr(e[r],t[r]);if(!i.valid)return{valid:!1};n.push(i.data)}return{valid:!0,data:n}}return n===Bn.date&&r===Bn.date&&+e==+t?{valid:!0,data:e}:{valid:!1}}class Mr extends ar{_parse(e){const{status:t,ctx:n}=this._processInputParams(e),r=(e,r)=>{if(Yn(e)||Yn(r))return qn;const i=Cr(e.value,r.value);return i.valid?((Xn(e)||Xn(r))&&t.dirty(),{status:t.value,value:i.data}):(Kn(n,{code:zn.invalid_intersection_types}),qn)};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}))}}Mr.create=(e,t,n)=>new Mr({left:e,right:t,typeName:ti.ZodIntersection,...or(n)});class Rr extends ar{_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==Bn.array)return Kn(n,{code:zn.invalid_type,expected:Bn.array,received:n.parsedType}),qn;if(n.data.length<this._def.items.length)return Kn(n,{code:zn.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),qn;!this._def.rest&&n.data.length>this._def.items.length&&(Kn(n,{code:zn.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 rr(n,e,n.path,t)):null})).filter((e=>!!e));return n.common.async?Promise.all(r).then((e=>Jn.mergeArray(t,e))):Jn.mergeArray(t,r)}get items(){return this._def.items}rest(e){return new Rr({...this._def,rest:e})}}Rr.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Rr({items:e,typeName:ti.ZodTuple,rest:null,...or(t)})};class xr extends ar{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!==Bn.object)return Kn(n,{code:zn.invalid_type,expected:Bn.object,received:n.parsedType}),qn;const r=[],i=this._def.keyType,o=this._def.valueType;for(const e in n.data)r.push({key:i._parse(new rr(n,e,n.path,e)),value:o._parse(new rr(n,n.data[e],n.path,e))});return n.common.async?Jn.mergeObjectAsync(t,r):Jn.mergeObjectSync(t,r)}get element(){return this._def.valueType}static create(e,t,n){return new xr(t instanceof ar?{keyType:e,valueType:t,typeName:ti.ZodRecord,...or(n)}:{keyType:dr.create(),valueType:e,typeName:ti.ZodRecord,...or(t)})}}class Dr extends ar{_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==Bn.map)return Kn(n,{code:zn.invalid_type,expected:Bn.map,received:n.parsedType}),qn;const r=this._def.keyType,i=this._def.valueType,o=[...n.data.entries()].map((([e,t],o)=>({key:r._parse(new rr(n,e,n.path,[o,"key"])),value:i._parse(new rr(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 qn;"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 qn;"dirty"!==r.status&&"dirty"!==i.status||t.dirty(),e.set(r.value,i.value)}return{status:t.value,value:e}}}}Dr.create=(e,t,n)=>new Dr({valueType:t,keyType:e,typeName:ti.ZodMap,...or(n)});class Ur extends ar{_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==Bn.set)return Kn(n,{code:zn.invalid_type,expected:Bn.set,received:n.parsedType}),qn;const r=this._def;null!==r.minSize&&n.data.size<r.minSize.value&&(Kn(n,{code:zn.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&&(Kn(n,{code:zn.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 qn;"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 rr(n,e,n.path,t))));return n.common.async?Promise.all(a).then((e=>o(e))):o(a)}min(e,t){return new Ur({...this._def,minSize:{value:e,message:nr.toString(t)}})}max(e,t){return new Ur({...this._def,maxSize:{value:e,message:nr.toString(t)}})}size(e,t){return this.min(e,t).max(e,t)}nonempty(e){return this.min(1,e)}}Ur.create=(e,t)=>new Ur({valueType:e,minSize:null,maxSize:null,typeName:ti.ZodSet,...or(t)});class Lr extends ar{constructor(){super(...arguments),this.validate=this.implement}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==Bn.function)return Kn(t,{code:zn.invalid_type,expected:Bn.function,received:t.parsedType}),qn;function n(e,n){return Hn({data:e,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,Gn(),Fn].filter((e=>!!e)),issueData:{code:zn.invalid_arguments,argumentsError:n}})}function r(e,n){return Hn({data:e,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,Gn(),Fn].filter((e=>!!e)),issueData:{code:zn.invalid_return_type,returnTypeError:n}})}const i={errorMap:t.common.contextualErrorMap},o=t.data;return this._def.returns instanceof Fr?$n((async(...e)=>{const t=new Wn([]),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}))})):$n(((...e)=>{const t=this._def.args.safeParse(e,i);if(!t.success)throw new Wn([n(e,t.error)]);const a=o(...t.data),s=this._def.returns.safeParse(a,i);if(!s.success)throw new Wn([r(a,s.error)]);return s.data}))}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new Lr({...this._def,args:Rr.create(e).rest(Tr.create())})}returns(e){return new Lr({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,t,n){return new Lr({args:e||Rr.create([]).rest(Tr.create()),returns:t||Tr.create(),typeName:ti.ZodFunction,...or(n)})}}class jr extends ar{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})}}jr.create=(e,t)=>new jr({getter:e,typeName:ti.ZodLazy,...or(t)});class Br extends ar{_parse(e){if(e.data!==this._def.value){const t=this._getOrReturnCtx(e);return Kn(t,{received:t.data,code:zn.invalid_literal,expected:this._def.value}),qn}return{status:"valid",value:e.data}}get value(){return this._def.value}}function Zr(e,t){return new zr({values:e,typeName:ti.ZodEnum,...or(t)})}Br.create=(e,t)=>new Br({value:e,typeName:ti.ZodLiteral,...or(t)});class zr extends ar{_parse(e){if("string"!=typeof e.data){const t=this._getOrReturnCtx(e),n=this._def.values;return Kn(t,{expected:xn.joinValues(n),received:t.parsedType,code:zn.invalid_type}),qn}if(-1===this._def.values.indexOf(e.data)){const t=this._getOrReturnCtx(e),n=this._def.values;return Kn(t,{received:t.data,code:zn.invalid_enum_value,options:n}),qn}return $n(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 zr.create(e)}exclude(e){return zr.create(this.options.filter((t=>!e.includes(t))))}}zr.create=Zr;class Wr extends ar{_parse(e){const t=xn.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(e);if(n.parsedType!==Bn.string&&n.parsedType!==Bn.number){const e=xn.objectValues(t);return Kn(n,{expected:xn.joinValues(e),received:n.parsedType,code:zn.invalid_type}),qn}if(-1===t.indexOf(e.data)){const e=xn.objectValues(t);return Kn(n,{received:n.data,code:zn.invalid_enum_value,options:e}),qn}return $n(e.data)}get enum(){return this._def.values}}Wr.create=(e,t)=>new Wr({values:e,typeName:ti.ZodNativeEnum,...or(t)});class Fr extends ar{unwrap(){return this._def.type}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==Bn.promise&&!1===t.common.async)return Kn(t,{code:zn.invalid_type,expected:Bn.promise,received:t.parsedType}),qn;const n=t.parsedType===Bn.promise?t.data:Promise.resolve(t.data);return $n(n.then((e=>this._def.type.parseAsync(e,{path:t.path,errorMap:t.common.contextualErrorMap}))))}}Fr.create=(e,t)=>new Fr({type:e,typeName:ti.ZodPromise,...or(t)});class Vr extends ar{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===ti.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=>{Kn(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?qn:("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?qn:("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(!er(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=>er(e)?Promise.resolve(r.transform(e.value,i)).then((e=>({status:t.value,value:e}))):e))}xn.assertNever(r)}}Vr.create=(e,t,n)=>new Vr({schema:e,typeName:ti.ZodEffects,effect:t,...or(n)}),Vr.createWithPreprocess=(e,t,n)=>new Vr({schema:t,effect:{type:"preprocess",transform:e},typeName:ti.ZodEffects,...or(n)});class Gr extends ar{_parse(e){return this._getType(e)===Bn.undefined?$n(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}Gr.create=(e,t)=>new Gr({innerType:e,typeName:ti.ZodOptional,...or(t)});class Hr extends ar{_parse(e){return this._getType(e)===Bn.null?$n(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}Hr.create=(e,t)=>new Hr({innerType:e,typeName:ti.ZodNullable,...or(t)});class Kr extends ar{_parse(e){const{ctx:t}=this._processInputParams(e);let n=t.data;return t.parsedType===Bn.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:t.path,parent:t})}removeDefault(){return this._def.innerType}}Kr.create=(e,t)=>new Kr({innerType:e,typeName:ti.ZodDefault,defaultValue:"function"==typeof t.default?t.default:()=>t.default,...or(t)});class Jr extends ar{_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 tr(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}}Jr.create=(e,t)=>new Jr({innerType:e,typeName:ti.ZodCatch,catchValue:"function"==typeof t.catch?t.catch:()=>t.catch,...or(t)});class qr extends ar{_parse(e){if(this._getType(e)!==Bn.nan){const t=this._getOrReturnCtx(e);return Kn(t,{code:zn.invalid_type,expected:Bn.nan,received:t.parsedType}),qn}return{status:"valid",value:e.data}}}qr.create=e=>new qr({typeName:ti.ZodNaN,...or(e)});const Qr=Symbol("zod_brand");class $r extends ar{_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 Yr extends ar{_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?qn:"dirty"===e.status?(t.dirty(),Qn(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?qn:"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 Yr({in:e,out:t,typeName:ti.ZodPipeline})}}const Xr=(e,t={},n)=>e?wr.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})}})):wr.create(),ei={object:Ar.lazycreate};var ti;!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"}(ti||(ti={}));const ni=dr.create,ri=fr.create,ii=qr.create,oi=hr.create,ai=mr.create,si=vr.create,ui=yr.create,ci=gr.create,li=_r.create,di=wr.create,pi=Tr.create,fi=br.create,hi=Er.create,mi=Sr.create,vi=Ar.create,yi=Ar.strictCreate,gi=Or.create,_i=Nr.create,wi=Mr.create,Ti=Rr.create,bi=xr.create,Ei=Dr.create,Si=Ur.create,Pi=Lr.create,Ii=jr.create,Ai=Br.create,Oi=zr.create,ki=Wr.create,Ni=Fr.create,Ci=Vr.create,Mi=Gr.create,Ri=Hr.create,xi=Vr.createWithPreprocess,Di=Yr.create,Ui={string:e=>dr.create({...e,coerce:!0}),number:e=>fr.create({...e,coerce:!0}),boolean:e=>mr.create({...e,coerce:!0}),bigint:e=>hr.create({...e,coerce:!0}),date:e=>vr.create({...e,coerce:!0})},Li=qn;var ji=Object.freeze({__proto__:null,defaultErrorMap:Fn,setErrorMap:function(e){Vn=e},getErrorMap:Gn,makeIssue:Hn,EMPTY_PATH:[],addIssueToContext:Kn,ParseStatus:Jn,INVALID:qn,DIRTY:Qn,OK:$n,isAborted:Yn,isDirty:Xn,isValid:er,isAsync:tr,get util(){return xn},ZodParsedType:Bn,getParsedType:Zn,ZodType:ar,ZodString:dr,ZodNumber:fr,ZodBigInt:hr,ZodBoolean:mr,ZodDate:vr,ZodSymbol:yr,ZodUndefined:gr,ZodNull:_r,ZodAny:wr,ZodUnknown:Tr,ZodNever:br,ZodVoid:Er,ZodArray:Sr,get objectUtil(){return Pr},ZodObject:Ar,ZodUnion:Or,ZodDiscriminatedUnion:Nr,ZodIntersection:Mr,ZodTuple:Rr,ZodRecord:xr,ZodMap:Dr,ZodSet:Ur,ZodFunction:Lr,ZodLazy:jr,ZodLiteral:Br,ZodEnum:zr,ZodNativeEnum:Wr,ZodPromise:Fr,ZodEffects:Vr,ZodTransformer:Vr,ZodOptional:Gr,ZodNullable:Hr,ZodDefault:Kr,ZodCatch:Jr,ZodNaN:qr,BRAND:Qr,ZodBranded:$r,ZodPipeline:Yr,custom:Xr,Schema:ar,ZodSchema:ar,late:ei,get ZodFirstPartyTypeKind(){return ti},coerce:Ui,any:di,array:mi,bigint:oi,boolean:ai,date:si,discriminatedUnion:_i,effect:Ci,enum:Oi,function:Pi,instanceof:(e,t={message:`Input not instance of ${e.name}`})=>Xr((t=>t instanceof e),t,!0),intersection:wi,lazy:Ii,literal:Ai,map:Ei,nan:ii,nativeEnum:ki,never:fi,null:li,nullable:Ri,number:ri,object:vi,oboolean:()=>ai().optional(),onumber:()=>ri().optional(),optional:Mi,ostring:()=>ni().optional(),pipeline:Di,preprocess:xi,promise:Ni,record:bi,set:Si,strictObject:yi,string:ni,symbol:ui,transformer:Ci,tuple:Ti,undefined:ci,union:gi,unknown:pi,void:hi,NEVER:Li,ZodIssueCode:zn,quotelessJson:e=>JSON.stringify(e,null,2).replace(/"([^"]+)":/g,"$1:"),ZodError:Wn}),Bi=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,I,A,O,k;St(this,t),this.initConfig=window.APP_CONFIG;var N=Et.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?ge:_e;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 C,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)?ye.HIDE_BACK:ye.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)?ye.SHOW_HOME:ye.HIDE_HOME,D=new URL(location.href),U=En(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)&&(N=(null===(C=this.initConfig)||void 0===C||null===(M=C.app)||void 0===M?void 0:M.actionBarHidden)?_e:ge);this.config={actionbarType:N,buttonType:R,statusbarType:U,dataConfig:{backgroundColor:(null===(S=this.initConfig)||void 0===S||null===(P=S.app)||void 0===P?void 0:P.headerColor)||we,textColor:(null===(I=this.initConfig)||void 0===I||null===(A=I.app)||void 0===A?void 0:A.textColor)||"",textAlign:(null===(O=this.initConfig)||void 0===O||null===(k=O.app)||void 0===k?void 0:k.textAlign)||Te,viewInLeftType:R,confirmToExit:1},homeConfig:{enable:x,url:"".concat(s,"/").concat(o,"/").concat(D.search)}}}var n=t.prototype;return n.setNavigationBarTitle=function(e){return Se((function(){return ke(this,(function(t){return[2,new Promise((function(t,n){pn("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 Se((function(){var r,i;return ke(this,(function(o){return void 0===(void 0===e?"undefined":vt(e))&&null===(void 0===e?"undefined":vt(e))||(r="none"===e||"home"===e?ye.HIDE_BACK:ye.SHOW_BACK,i="home"===e||"both"===e?ye.SHOW_HOME:ye.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){pn("CHANGE_ACTIONBAR_LEFTBUTTON_TYPE",Ze({},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 Se((function(){var r,i,o;return ke(this,(function(a){return i=t?e.AndroidBottomNavigationBarType.hide:e.AndroidBottomNavigationBarType.show,o=null===(r=De())||void 0===r?void 0:r.platform,[2,new Promise((function(e,r){if(!(null==o?void 0:o.isAndroid))return e();pn("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 Se((function(){var r,i,o;return ke(this,(function(a){return i=t?e.IOSSafeAreaBottomType.hide:e.IOSSafeAreaBottomType.show,o=null===(r=De())||void 0===r?void 0:r.platform,[2,new Promise((function(e,r){if(!(null==o?void 0:o.isIOS))return e();pn("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 Se((function(){var r;return ke(this,(function(i){return r=n.config,Et.isString(t.headerColor)&&(r.dataConfig.backgroundColor=t.headerColor),Et.isString(t.headerTextColor)&&(r.dataConfig.textColor=t.headerTextColor),Et.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=_e:!1===t.hideActionBar&&(r.actionbarType=ge),"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){pn("CHANGE_ACTIONBAR",Ze({},r),{success:function(){var o;n.config=Ze({},r);var a,s=null===(o=De())||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===_e;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}(),Zi=Bi.getInstance(),zi=[vi({title:ni()}).optional()];function Wi(e){return Fi.apply(this,arguments)}function Fi(){return Fi=Se((function(e){return ke(this,(function(t){return[2,kn("setNavigationBarTitle",zi,[e],function(){var e=Se((function(e){return ke(this,(function(t){switch(t.label){case 0:return Ue.isMp?[4,Zi.setNavigationBarTitle(e.title)]:[3,2];case 1:return[2,t.sent()];case 2:return Ue.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(je("setNavigationBarTitle",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Fi.apply(this,arguments)}var Vi=[vi({color:ni(),textColor:ji.enum(["black","white"]).optional(),statusBarColor:ni().optional()}).optional()];function Gi(e){return Hi.apply(this,arguments)}function Hi(){return Hi=Se((function(e){return ke(this,(function(t){return[2,kn("setNavigationBarColor",Vi,[e],function(){var e=Se((function(e){return ke(this,(function(t){switch(t.label){case 0:return Ue.isMp?[4,Zi.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 Ue.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(je("setNavigationBarColor",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Hi.apply(this,arguments)}var Ki=[vi({type:ji.enum(["none","back","home","both"])}).optional()];function Ji(e){return qi.apply(this,arguments)}function qi(){return qi=Se((function(e){return ke(this,(function(t){return[2,kn("setNavigationBarLeftButton",Ki,[e],function(){var e=Se((function(e){return ke(this,(function(t){switch(t.label){case 0:return Ue.isMp?[4,Zi.setNavigationBarLeftButton(e.type)]:[3,2];case 1:return[2,t.sent()];case 2:return Ue.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(je("setNavigationBarLeftButton",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),qi.apply(this,arguments)}function Qi(e,t,n){if(!t.has(e))throw new TypeError("attempted to "+n+" private field on non-instance");return t.get(e)}function $i(e,t){return function(e,t){return t.get?t.get.call(e):t.value}(e,Qi(e,t,"get"))}function Yi(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 Xi(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,Qi(e,t,"set"),n),n}var eo,to,no,ro=function(){function e(){St(this,e)}var t=e.prototype;return t.getSynchronize=function(e){return new Map},t.setSynchronize=function(e){return{errorKeys:[]}},t.getInfoSynchronize=function(){return{currentSize:0,limitSize:0}},t.removeSynchronize=function(e){return{errorKeys:[]}},t.clearSynchronize=function(){},t.getItem=function(e){return this.getSynchronize([e]).get(e)||null},t.setItem=function(e,t){if(this.setSynchronize(Be({},e,t)).errorKeys.length>0)throw new Error("Failed to set item: ".concat(e))},t.removeItem=function(e){this.removeSynchronize([e])},t.clear=function(){this.clearSynchronize()},t.getStorageInfo=function(){return this.getInfoSynchronize()},e}(),io=new WeakMap,oo=new WeakMap,ao=new WeakMap,so=function(e){Ct(n,e);var t=Rt(n);function n(e){var r;return St(this,n),Yi(Mt(r=t.call(this)),io,{writable:!0,value:localStorage}),Yi(Mt(r),oo,{writable:!0,value:void 0}),Yi(Mt(r),ao,{writable:!0,value:void 0}),Xi(Mt(r),ao,{keys:new Set,currentSize:0,limitSize:le}),Xi(Mt(r),oo,e),r.findAllCurrentDataByApp(e),r}var r=n.prototype;return r.findAllCurrentDataByApp=function(e){try{var t;for(t in $i(this,io)){if(e)if(t.split("_")[0]!==e)continue;$i(this,ao).keys.add(t)}}catch(e){}},r.get=function(e){var t=this,n=new Map;return e.forEach((function(e){n.set(e,t.getSync(e))})),Promise.resolve(n)},r.getSync=function(e){return $i(this,oo)&&(e="".concat($i(this,oo),"_").concat(e)),$i(this,ao).keys.has(e)?$i(this,io).getItem(e):null},r.set=function(e){var t=this;return Se((function(){return ke(this,(function(n){return Object.entries(e).forEach((function(e){var n=ze(e,2),r=n[0],i=n[1];t.setSync(r,i.replace(/\\"/g,'"'))})),[2,Promise.resolve({errorKeys:[]})]}))}))()},r.setSync=function(e,t){$i(this,oo)&&(e="".concat($i(this,oo),"_").concat(e)),$i(this,io).setItem(e,t),$i(this,ao).keys.add(e)},r.getInfo=function(){var e=this;return Se((function(){return ke(this,(function(t){return[2,Promise.resolve(e.getInfoSync())]}))}))()},r.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}($i(this,io),$i(this,oo));return{currentSize:Et.isNumber(e)?Number((e/1024).toFixed(2)):0,limitSize:Number((le/1024).toFixed(2))}},r.remove=function(e){var t=this;return Se((function(){return ke(this,(function(n){return e.forEach((function(e){t.removeSync(e)})),[2,Promise.resolve({errorKeys:[]})]}))}))()},r.removeSync=function(e){$i(this,oo)&&(e="".concat($i(this,oo),"_").concat(e)),$i(this,ao).keys.has(e)&&($i(this,io).removeItem(e),$i(this,ao).keys.delete(e))},r.clearAsync=function(){var e=this;return Se((function(){return ke(this,(function(t){return[2,Promise.resolve(e.clearSync())]}))}))()},r.clearSync=function(){var e=this;$i(this,ao).keys.forEach((function(t){$i(e,oo)&&t.indexOf($i(e,oo))<0||($i(e,io).removeItem(t),$i(e,ao).keys.delete(t))}))},r.setSynchronize=function(e){var t=this;return Object.entries(e).forEach((function(e){var n=ze(e,2),r=n[0],i=n[1];t.setSync(r,i)})),{errorKeys:[]}},r.getSynchronize=function(e){var t=this,n=new Map;return e.forEach((function(e){n.set(e,t.getSync(e))})),n},r.getInfoSynchronize=function(){return this.getInfoSync()},r.clearSynchronize=function(){this.clearSync()},n}(ro),uo=new WeakMap,co=new WeakMap,lo=function(e){Ct(n,e);var t=Rt(n);function n(e){var r;return St(this,n),Yi(Mt(r=t.call(this)),uo,{writable:!0,value:void 0}),Yi(Mt(r),co,{writable:!0,value:void 0}),Xi(Mt(r),co,{keys:new Set,currentSize:0,limitSize:le}),Xi(Mt(r),uo,e),r}var r=n.prototype;return r.get=function(e){var t=this;return Se((function(){return ke(this,(function(n){return[2,new Promise((function(n,r){pn("ZBROWSER_MPDS",{mpds_action:"mpds.get",mpds_data:{keys:e},appId:$i(t,uo)},{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})}))]}))}))()},r.getSynchronize=function(e){var t={mpds_action:"mpds.get",mpds_data:{keys:e},appId:$i(this,uo)},n=new Map,r=this.handleResult(t);return r&&r.mpds_data&&r.mpds_data.map&&(n=new Map(Object.entries(r.mpds_data.map))),n},r.set=function(e){var t=this;return Se((function(){return ke(this,(function(n){return[2,new Promise((function(n,r){pn("ZBROWSER_MPDS",{mpds_action:"mpds.set",mpds_data:{map:e},appId:$i(t,uo)},{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})}))]}))}))()},r.setSynchronize=function(e){var t={mpds_action:"mpds.set",mpds_data:{map:e},appId:$i(this,uo)},n=[],r=this.handleResult(t);return r&&r.mpds_data&&r.mpds_data.error_keys&&(n=r.mpds_data.error_keys),{errorKeys:n}},r.getInfo=function(){var e=this;return Se((function(){return ke(this,(function(t){return[2,new Promise((function(t,n){pn("ZBROWSER_MPDS",{mpds_action:"mpds.get.size",mpds_data:{},appId:$i(e,uo)},{success:function(e){var n=0;e&&e.mpds_data&&e.mpds_data.size&&(n=e.mpds_data.size),t({currentSize:Et.isNumber(n)?Number(Number(n)/1024):0,limitSize:Number(le/1024)})},fail:function(e){n(e)}},{isMultiCallback:!1})}))]}))}))()},r.getInfoSynchronize=function(){var e={mpds_action:"mpds.get.size",mpds_data:{},appId:$i(this,uo)},t=0,n=this.handleResult(e);return n&&n.mpds_data&&n.mpds_data.size&&(t=n.mpds_data.size),{currentSize:Et.isNumber(t)?Number(Number(t)/1024):0,limitSize:Number(le/1024)}},r.remove=function(e){var t=this;return Se((function(){return ke(this,(function(n){return[2,new Promise((function(n,r){pn("ZBROWSER_MPDS",{mpds_action:"mpds.remove.key",mpds_data:{keys:e},appId:$i(t,uo)},{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})}))]}))}))()},r.removeSynchronize=function(e){var t={mpds_action:"mpds.remove.key",mpds_data:{keys:e},appId:$i(this,uo)},n=[],r=this.handleResult(t);return r&&r.mpds_data&&r.mpds_data.error_keys&&(n=r.mpds_data.error_keys),{errorKeys:n}},r.clearAsync=function(){var e=this;return Se((function(){return ke(this,(function(t){return[2,new Promise((function(t,n){pn("ZBROWSER_MPDS",{mpds_action:"mpds.clear.appData",mpds_data:{},appId:$i(e,uo)},{success:function(){t()},fail:function(e){n(e)}},{isMultiCallback:!1})}))]}))}))()},r.clearSynchronize=function(){var e={mpds_action:"mpds.clear.appData",mpds_data:{},appId:$i(this,uo)};this.handleResult(e)},r.handleResult=function(e){var t=null;try{var n=ZaloJavaScriptInterface.processActionMPDS(JSON.stringify(e));if(n=JSON.parse(n)){if(0===n.error_code)return n.data;t=dn(n).toJSON()}}catch(e){t=e}finally{if(null!==t)throw t}return{}},n}(ro),po=function(){function e(){St(this,e)}var t=e.prototype;return t.getDataFromStorage=function(e){var t=this;return Se((function(){var n,r;return ke(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]=_n(e)})),[2,r]}}))}))()},t.getItem=function(e){return this.getInstance().getItem(e)},t.putDataToStorage=function(e){var t=this;return Se((function(){var n,r;return ke(this,(function(i){switch(i.label){case 0:return n=t.getInstance(),r={},Object.entries(e).forEach((function(e){var t=ze(e,2),n=t[0],i=t[1];Et.isUndefined(i)||Et.isNull(i)||(r[n]=bn(i))})),[4,n.set(r)];case 1:return[2,i.sent()]}}))}))()},t.setItem=function(e,t){return this.getInstance().setItem(e,t)},t.removeDataFromStorage=function(e){var t=this;return Se((function(){return ke(this,(function(n){switch(n.label){case 0:return[4,t.getInstance().remove(e)];case 1:return[2,n.sent()]}}))}))()},t.removeItem=function(e){this.getInstance().removeItem(e)},t.clearStorage=function(){var e=this;return Se((function(){return ke(this,(function(t){switch(t.label){case 0:return[4,e.getInstance().clearAsync()];case 1:return t.sent(),[2]}}))}))()},t.clearStorageSync=function(){this.getInstance().clear()},t.getStorageInfo=function(){var e=this;return Se((function(){return ke(this,(function(t){switch(t.label){case 0:return[4,e.getInstance().getInfo()];case 1:return[2,t.sent()]}}))}))()},t.getStorageInfoSync=function(){return this.getInstance().getStorageInfo()},e}(),fo=new WeakMap,ho=function(e){Ct(n,e);var t=Rt(n);function n(e){var r;return St(this,n),Yi(Mt(r=t.call(this)),fo,{writable:!0,value:void 0}),Xi(Mt(r),fo,e),r}return n.prototype.getInstance=function(){return new so($i(this,fo))},n}(po),mo=new WeakMap,vo=function(e){Ct(n,e);var t=Rt(n);function n(e){var r;return St(this,n),Yi(Mt(r=t.call(this)),mo,{writable:!0,value:void 0}),Xi(Mt(r),mo,e),r}return n.prototype.getInstance=function(){return new lo($i(this,mo))},n}(po),yo=new ho(o),go=(null===(eo=De())||void 0===eo?void 0:eo.zaloVersion)||"",_o=(null===(to=De())||void 0===to?void 0:to.platformName)||"unknown";!!Et.isString(go)&&parseInt(go,10)>={android:12100571,iOS:400,wp:0,unknown:0}[_o]&&(null===(no=De())||void 0===no?void 0:no.appEnv.isMp)&&(yo=new vo(o));var wo=yo,To=[vi({data:ji.record(ni(),ji.any())}).optional()];function bo(e){return Eo.apply(this,arguments)}function Eo(){return Eo=Se((function(e){return ke(this,(function(t){return[2,kn("setStorage",To,[e],function(){var e=Se((function(e){return ke(this,(function(t){switch(t.label){case 0:return Ue.isMp||Ue.isMpWeb?[4,wo.putDataToStorage(e.data)]:[3,2];case 1:return[2,t.sent()];case 2:return[2,Promise.reject(je("setStorage",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Eo.apply(this,arguments)}var So=[vi({keys:ji.array(ni())}).optional()];function Po(e){return Io.apply(this,arguments)}function Io(){return Io=Se((function(e){return ke(this,(function(t){return[2,kn("getStorage",So,[e],function(){var e=Se((function(e){return ke(this,(function(t){switch(t.label){case 0:return Ue.isMp||Ue.isMpWeb?[4,wo.getDataFromStorage(e.keys)]:[3,2];case 1:return[2,t.sent()];case 2:return[2,Promise.reject(je("getStorage",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Io.apply(this,arguments)}function Ao(e){return Oo.apply(this,arguments)}function Oo(){return(Oo=Se((function(e){return ke(this,(function(t){return[2,kn("getStorageInfo",[],[e],Se((function(){return ke(this,(function(e){switch(e.label){case 0:return Ue.isMp||Ue.isMpWeb?[4,wo.getStorageInfo()]:[3,2];case 1:return[2,e.sent()];case 2:return[2,Promise.reject(je("getStorageInfo",{}))]}}))})))]}))}))).apply(this,arguments)}var ko=[vi({keys:ji.array(ni())}).optional()];function No(e){return Co.apply(this,arguments)}function Co(){return Co=Se((function(e){return ke(this,(function(t){return[2,kn("removeStorage",ko,[e],function(){var e=Se((function(e){return ke(this,(function(t){switch(t.label){case 0:return Ue.isMp||Ue.isMpWeb?[4,wo.removeDataFromStorage(e.keys)]:[3,2];case 1:return[2,t.sent()];case 2:return[2,Promise.reject(je("removeStorage",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Co.apply(this,arguments)}var Mo=[vi({prefix:ni().optional()}).optional()];function Ro(e){return xo.apply(this,arguments)}function xo(){return(xo=Se((function(e){return ke(this,(function(t){return[2,kn("clearStorage",Mo,[e],Se((function(){return ke(this,(function(e){switch(e.label){case 0:return Ue.isMp||Ue.isMpWeb?[4,wo.clearStorage()]:[3,2];case 1:return[2,e.sent()];case 2:return[2,Promise.reject(je("clearStorage",{}))]}}))})))]}))}))).apply(this,arguments)}var Do=function(){var e=Se((function(e,t){var n,r,i,a;return ke(this,(function(s){switch(s.label){case 0:return(r=t)?[3,2]:[4,In()];case 1:r=!s.sent(),s.label=2;case 2:return n=r,[4,mn.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=Se((function(e){var t,n,r,i,o,a;return ke(this,(function(s){switch(s.label){case 0:return[4,e.json()];case 1:if(r=s.sent(),void 0!==(i=null==r?void 0:r.error)&&i<0)throw o=(null==r?void 0:r.message)||J,new on(i,o);return a=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:a,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)}}(),Uo=[vi({avatarType:ji.enum(["small","normal","large"]).optional(),autoRequestPermission:ji.boolean().default(!1).optional()}).optional()];function Lo(e){return jo.apply(this,arguments)}function jo(){return jo=Se((function(e){return ke(this,(function(t){return[2,kn("getUserInfo",Uo,[e],function(){var e=Se((function(e){var t,n,r;return ke(this,(function(i){switch(i.label){case 0:if(!Ue.isMp)return[3,4];t=null==e?void 0:e.avatarType,n=null==e?void 0:e.autoRequestPermission,i.label=1;case 1:return i.trys.push([1,3,,4]),[4,Do(t,n)];case 2:return[2,{userInfo:i.sent()}];case 3:return r=i.sent(),[2,Promise.reject(r)];case 4:return Ue.isMpWeb?[2,Promise.resolve({userInfo:{id:"3368637342326461234",name:"User Name",avatar:"https://h5.zdn.vn/static/images/avatar.png"}})]:[2,Promise.reject(je("getUserInfo",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),jo.apply(this,arguments)}var Bo=function(e){return{NONE:e?-2:0,WIFI:e?0:1,"2G":2,"3G":e?15:2,"4G":e?13:2}},Zo=Se((function(){return ke(this,(function(t){return[2,new Promise((function(t,n){pn("WEBVIEW_NETWORKTYPE",{url:window.location.href,featureId:""},{success:function(n){var r,i,o,a=n.network,s=(null===(r=De())||void 0===r||null===(i=r.platform)||void 0===i?void 0:i.isAndroid)||!1;switch(a){case Bo(s).NONE:o=e.NetworkType.none;break;case Bo(s).WIFI:o=e.NetworkType.wifi;break;case Bo(s)["2G"]:case Bo(s)["3G"]:case Bo(s)["4G"]:o=e.NetworkType.cellular;break;default:o=e.NetworkType.unknown}t(o)},fail:function(e){n(e)}},{})}))]}))}));function zo(e){return Wo.apply(this,arguments)}function Wo(){return(Wo=Se((function(t){return ke(this,(function(n){return[2,kn("getNetworkType",[],[t],Se((function(){var t,n;return ke(this,(function(r){switch(r.label){case 0:return Ue.isMp?[4,Zo()]:[3,2];case 1:return[2,{networkType:r.sent()}];case 2:if(Ue.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(je("getNetworkType",{}))]}}))})))]}))}))).apply(this,arguments)}var Fo=[ji.function().args(vi({isConnected:ji.boolean(),networkType:ji.enum(["none","wifi","cellular","unknown"])})).returns(ji.void())];function Vo(t){return kn("onNetworkStatusChange",Fo,[t],(function(t){var n=t;if(Ue.isMp)!function(t){Bt.getInstance().on(e.Events.NetworkChanged,(function(e){var n=null==e?void 0:e.state;Zo().then((function(e){t({isConnected:"CONNECTED"===n,networkType:e})}))}))}(n);else if(Ue.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 Go=function(){var e=Se((function(e){var t,n,r,i,o,a;return ke(this,(function(s){return a={subaction:0,scanning_type:Et.isNumber(null==e?void 0:e.scanningType)?e.scanningType:0,data:{scan_from_source:Et.isString(null==e?void 0:e.scanFromSource)?e.scanFromSource:"",expire:Et.isNumber(null==e?void 0:e.expire)?e.expire:3e3,monitor_interval:Et.isNumber(null==e?void 0:e.monitorInterval)?e.monitorInterval:60,domain:Et.isString(null==e?void 0:e.domain)?e.domain:"",scan_config:{scan_time:Et.isNumber(null==e||null===(t=e.scanConfig)||void 0===t?void 0:t.scanTime)?e.scanConfig.scanTime:15e3,time_between_scan:Et.isNumber(null==e||null===(n=e.scanConfig)||void 0===n?void 0:n.timeBetweenScan)?e.scanConfig.timeBetweenScan:1e4,beacon_timeout:Et.isNumber(null==e||null===(r=e.scanConfig)||void 0===r?void 0:r.beaconTimeout)?e.scanConfig.beaconTimeout:3e4,delayCheckConnectedTimeout:Et.isNumber(null==e||null===(i=e.scanConfig)||void 0===i?void 0:i.delayCheckConnectedTimeout)?e.scanConfig.delayCheckConnectedTimeout:5e3,beaconConnectedTimeout:Et.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){pn("SCAN_IBEACON",Ze({},a),{success:function(){e(!0)},fail:function(e){t(e)}},{})}))]}))}));return function(t){return e.apply(this,arguments)}}(),Ho=[vi({scanningType:ji.number().refine((function(e){return[0,1].includes(e)}),{message:"The type must be either 0 or 1"}).default(0).optional(),expire:ji.number().optional(),monitorInterval:ji.number().optional(),domain:ji.string().optional(),scanConfig:vi({scanTime:ji.number().optional(),timeBetweenScan:ji.number().optional(),beaconTimeout:ji.number().optional(),delayCheckConnectedTimeout:ji.number().optional(),beaconConnectedTimeout:ji.number().optional()}).optional(),items:ji.array(vi({id:ji.string().optional(),distance:ji.number().optional(),monitor:vi({enable:ji.boolean().optional(),movingRange:ji.number().optional()}).optional()})).optional(),scanFromSource:ji.string().optional()}).optional()];function Ko(e){return Jo.apply(this,arguments)}function Jo(){return(Jo=Se((function(e){return ke(this,(function(t){return[2,kn("startBeaconDiscovery",Ho,[e],Se((function(){return ke(this,(function(t){switch(t.label){case 0:return Ue.isMp?[4,Go(e)]:[3,2];case 1:return[2,t.sent()];case 2:return Ue.isMpWeb?[2,Promise.resolve(!0)]:[2,Promise.reject(je("startBeaconDiscovery",{}))]}}))})))]}))}))).apply(this,arguments)}var qo=Se((function(){return ke(this,(function(e){return[2,new Promise((function(e,t){pn("SCAN_IBEACON",{subaction:2},{success:function(){e(!0)},fail:function(e){t(e)}},{})}))]}))}));function Qo(e){return $o.apply(this,arguments)}function $o(){return($o=Se((function(e){return ke(this,(function(t){return[2,kn("stopBeaconDiscovery",[],[e],Se((function(){return ke(this,(function(e){switch(e.label){case 0:return Ue.isMp?[4,qo()]:[3,2];case 1:return[2,e.sent()];case 2:return Ue.isMpWeb?[2,Promise.resolve(!0)]:[2,Promise.reject(je("stopBeaconDiscovery",{}))]}}))})))]}))}))).apply(this,arguments)}var Yo=Se((function(){return ke(this,(function(e){return[2,new Promise((function(e,t){pn("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 Xo(e){return ea.apply(this,arguments)}function ea(){return(ea=Se((function(e){return ke(this,(function(t){return[2,kn("getBeacons",[],[e],Se((function(){return ke(this,(function(e){switch(e.label){case 0:return Ue.isMp?[4,Yo()]:[3,2];case 1:return[2,e.sent()];case 2:return Ue.isMpWeb?[2,Promise.resolve({beacons:[]})]:[2,Promise.reject(je("getBeacons",{}))]}}))})))]}))}))).apply(this,arguments)}var ta=Se((function(){return ke(this,(function(e){return[2,new Promise((function(e,t){pn("WINDOW_CLOSE",{},{success:function(t){e(t)},fail:function(e){t(e)}},{})}))]}))}));function na(e){return ra.apply(this,arguments)}function ra(){return(ra=Se((function(e){return ke(this,(function(t){return[2,kn("closeApp",[],[e],Se((function(){return ke(this,(function(e){switch(e.label){case 0:return Ue.isMp?[4,ta()]:[3,2];case 1:return[2,e.sent()];case 2:return Ue.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(je("closeApp",{}))]}}))})))]}))}))).apply(this,arguments)}var ia=Se((function(){return ke(this,(function(e){return[2,new Promise((function(e,t){pn("OPEN_QR",{skipOpenLink:!0},{success:function(t){e(t)},fail:function(e){t(e)}},{})}))]}))}));function oa(e){return aa.apply(this,arguments)}function aa(){return(aa=Se((function(e){return ke(this,(function(t){return[2,kn("scanQRCode",[],[e],Se((function(){return ke(this,(function(e){switch(e.label){case 0:return Ue.isMp?[4,ia()]:[3,2];case 1:return[2,e.sent()];case 2:return Ue.isMpWeb?[2,Promise.resolve({content:""})]:[2,Promise.reject(je("scanQRCode",{}))]}}))})))]}))}))).apply(this,arguments)}var sa=function(){var t=Se((function(t,n,r,o){return ke(this,(function(a){return[2,new Promise((function(a,s){pn("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)}}(),ua=[vi({id:ni(),type:ji.enum(["user","oa","aliasOA"]),sourceId:ji.any().optional(),sourceIndex:ji.any().optional()}).optional()];function ca(e){return la.apply(this,arguments)}function la(){return la=Se((function(e){return ke(this,(function(t){return[2,kn("openProfile",ua,[e],function(){var e=Se((function(e){var t,n,r,i;return ke(this,(function(o){switch(o.label){case 0:return Ue.isMp?(t=e.id,n=e.type,r=e.sourceId,i=e.sourceIndex,[4,sa(t,n,r,i)]):[3,2];case 1:return[2,o.sent()];case 2:return Ue.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(je("openProfile",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),la.apply(this,arguments)}var da=function(){var t=Se((function(t,n){var r,o,a,s=arguments;return ke(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){pn("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)}}(),pa=[vi({id:ni(),type:ji.enum(["user","oa"]),sourceId:ji.any().optional(),sourceIndex:ji.any().optional(),message:ni().optional()}).optional()];function fa(e){return ha.apply(this,arguments)}function ha(){return ha=Se((function(e){return ke(this,(function(t){return[2,kn("openChat",pa,[e],function(){var e=Se((function(e){var t,n,r,i,o;return ke(this,(function(a){switch(a.label){case 0:return Ue.isMp?(t=e.id,n=e.type,r=e.message,i=e.sourceId,o=e.sourceIndex,[4,da(t,n,r,i,o)]):[3,2];case 1:return[2,a.sent()];case 2:return Ue.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(je("openChat",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),ha.apply(this,arguments)}function ma(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 va=function(){var t=Se((function(t,n){var r,o;return ke(this,(function(a){switch(r={},o=t,t){case"image":(null==n?void 0:n.imageUrls)?(o="multi_image",r={photoUrl:null==n?void 0:n.imageUrls}):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(t,n){pn("OPEN_POSTFEED",ma(Ze({type:e.PostFeedType[o]},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)}},{})}))]}))}));return function(e,n){return t.apply(this,arguments)}}(),ya=[ji.union([vi({type:ji.enum(["image"]),data:vi({imageUrl:ni().url().optional(),imageUrls:ji.array(ni().url()).optional()})}),vi({type:ji.enum(["link"]),data:vi({link:ni().url(),title:ni().max(100).optional(),thumb:ni().url().optional(),description:ni().max(400).default("").optional()})}),vi({type:ji.enum(["profile"]),data:vi({id:ni().optional()})})])];function ga(e){return _a.apply(this,arguments)}function _a(){return _a=Se((function(e){return ke(this,(function(t){return[2,kn("openPostFeed",ya,[e],function(){var e=Se((function(e){var t,n;return ke(this,(function(r){switch(r.label){case 0:return Ue.isMp?(t=e.type,n=e.data,[4,va(t,n)]):[3,2];case 1:return[2,r.sent()];case 2:return Ue.isMpWeb?[2,Promise.resolve({status:1,shareType:0,numberOfUser:0})]:[2,Promise.reject(je("openPostFeed",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),_a.apply(this,arguments)}var wa=function(){var e=Se((function(e){return ke(this,(function(t){return[2,new Promise((function(t,n){pn("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)}}(),Ta=[vi({id:ni(),showDialogConfirm:ji.boolean().optional()}).optional()];function ba(e){return Ea.apply(this,arguments)}function Ea(){return Ea=Se((function(e){return ke(this,(function(t){return[2,kn("followOA",Ta,[e],function(){var e=Se((function(e){var t;return ke(this,(function(n){switch(n.label){case 0:return Ue.isMp?(t=e.id,[4,wa(t)]):[3,2];case 1:return[2,n.sent()];case 2:return Ue.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(je("followOA",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Ea.apply(this,arguments)}var Sa=function(){var e=Se((function(e){return ke(this,(function(t){return[2,new Promise((function(t,n){pn("UNFOLLOW_OA",{uid:e,forceUpdate:!0,zapp:i},{success:function(){t()},fail:function(e){n(e)}},{})}))]}))}));return function(t){return e.apply(this,arguments)}}(),Pa=[vi({id:ni()}).optional()];function Ia(e){return Aa.apply(this,arguments)}function Aa(){return Aa=Se((function(e){return ke(this,(function(t){return[2,kn("unfollowOA",Pa,[e],function(){var e=Se((function(e){var t;return ke(this,(function(n){switch(n.label){case 0:return Ue.isMp?(t=e.id,[4,Sa(t)]):[3,2];case 1:return[2,n.sent()];case 2:return Ue.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(je("unfollowOA",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Aa.apply(this,arguments)}var Oa=function(){var e=Se((function(e,t,n,r,i,o){var s,u,l,p,f,h,m,v;return ke(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,Ze({method:"POST",body:p},m))];case 1:return[4,y.sent().json()];case 2:if(!(v=y.sent())||0!==v.err)throw ln.error.cannotGetShareInfo();return h.search="".concat(h.search,"&zshareId=").concat(v.data.shareId),[2,ma(Ze({},v.data),{shareableLink:h.href})]}}))}));return function(t,n,r,i,o,a){return e.apply(this,arguments)}}(),ka=function(){var t=Se((function(t,n){var r,a,s,u,c,l,d,p,f,h,m,v;return ke(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=De())||void 0===u?void 0:u.zaloVersion)||0,p=(null===(c=De())||void 0===c?void 0:c.platformName)||"unknown",Number(d)>=ce[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,mn.getAccessToken()];case 8:case 11:return s=y.sent(),[4,Oa(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){pn("OPEN_SHARESHEET",ma(Ze({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)}}(),Na=[ji.union([vi({type:ji.enum(["text"]),data:vi({text:ni(),description:ni().default("").optional(),autoParseLink:ji.boolean().default(!1).optional()})}),vi({type:ji.enum(["image"]),data:vi({imageUrl:ni().url().optional(),imageUrls:ji.array(ni().url()).max(10).optional()})}),vi({type:ji.enum(["link"]),data:vi({link:ni().url(),chatOnly:ji.boolean().optional()})}),vi({type:ji.enum(["oa"]),data:vi({id:ni()})}),vi({type:ji.enum(["gif"]),data:vi({gifUrl:ni().url(),imageUrl:ni().url().optional(),width:ri().min(0).optional(),height:ri().min(0).optional()})}),vi({type:ji.enum(["video"]),data:vi({videoThumb:ni().url(),videoUrl:ni().url(),width:ri().min(0).optional(),height:ri().min(0).optional()})}),vi({type:ji.enum(["zmp","zmp_deep_link"]),data:vi({title:ni().max(100),thumbnail:ni().url(),path:ni().optional(),description:ni().max(400).default("").optional()})})])];function Ca(e){return Ma.apply(this,arguments)}function Ma(){return Ma=Se((function(e){return ke(this,(function(t){return[2,kn("openShareSheet",Na,[e],function(){var e=Se((function(e){var t,n;return ke(this,(function(r){switch(r.label){case 0:return Ue.isMp?(t=e.type,n=e.data,[4,ka(t,n)]):[3,2];case 1:return[2,r.sent()];case 2:return Ue.isMpWeb?[2,Promise.resolve({status:2,shareType:0,numberOfUser:0})]:[2,Promise.reject(je("openShareSheet",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Ma.apply(this,arguments)}var Ra=Se((function(){return ke(this,(function(e){return[2,new Promise((function(e,t){pn("REQUEST_PERMISSION_CAMERA",{},{success:function(t){var n,r;(null===(n=De())||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=De())||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 xa(e){return Da.apply(this,arguments)}function Da(){return(Da=Se((function(e){return ke(this,(function(t){return[2,kn("requestCameraPermission",[],[e],Se((function(){return ke(this,(function(e){switch(e.label){case 0:return[4,Ra()];case 1:return[2,e.sent()]}}))})))]}))}))).apply(this,arguments)}var Ua=function(){var e=Se((function(e,t,n){return ke(this,(function(r){return[2,new Promise((function(r,i){pn("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)}}(),La=Se((function(){var e,t,n,r=arguments;return ke(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=Ln(),[4,Qt(e,t,n.version)];case 1:return[2,i.sent()]}}))})),ja=function(){var e=Se((function(e){return ke(this,(function(t){return[2,new Promise((function(t,n){pn("OPEN_OUTAPP",{url:e},{success:function(){t()},fail:function(e){n(e)}},{})}))]}))}));return function(t){return e.apply(this,arguments)}}(),Ba=[vi({params:ji.record(ni(),ni()).optional()}).optional()];function Za(e){return za.apply(this,arguments)}function za(){return za=Se((function(e){return ke(this,(function(t){return[2,kn("createShortcut",Ba,[e],function(){var e=Se((function(e){var t,n,r,i,s,u,c,l;return ke(this,(function(d){switch(d.label){case 0:return Ue.isMp?[4,La(o,0)]:[3,6];case 1:return r=d.sent(),i=null===(t=De())||void 0===t||null===(n=t.platform)||void 0===n?void 0:n.isIOS,s=r.logoUrl||Tn("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,ja(encodeURI(l))]):[3,3];case 2:return d.sent(),[3,5];case 3:return[4,Ua("".concat(a,"/").concat(o,"/?").concat(c.toString()),u,s)];case 4:d.sent(),d.label=5;case 5:return[2,ln.success()];case 6:return Ue.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(je("createShortcut",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),za.apply(this,arguments)}var Wa=function(){var e=Se((function(e,t,n){return ke(this,(function(r){return[2,new Promise((function(r,o){pn("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)}}(),Fa=[vi({secretData:ni(),ui:vi({title:ni().default("Xác thực").optional(),subTitle:ni().default("Sử dụng sinh trắc học của bạn để xác thực").optional(),negativeButtonText:ni().default("Đóng").optional()}).optional(),requireFingerprint:ai().default(!0).optional()}).optional()];function Va(e){return Ga.apply(this,arguments)}function Ga(){return Ga=Se((function(e){return ke(this,(function(t){return[2,kn("openBioAuthentication",Fa,[e],function(){var e=Se((function(e){var t,n,r;return ke(this,(function(i){switch(i.label){case 0:return Ue.isMp?(t=e.secretData,n=e.ui,r=e.requireFingerprint,[4,Wa(t,n,r)]):[3,2];case 1:return[2,i.sent()];case 2:return Ue.isMpWeb?[2,Promise.resolve({code:0,message:"OK",data:{domain:"",code:0,message:"",payToken:""}})]:[2,Promise.reject(je("openBioAuthentication",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Ga.apply(this,arguments)}var Ha=Se((function(){return ke(this,(function(e){return[2,new Promise((function(e,t){pn("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 Ka(e){return Ja.apply(this,arguments)}function Ja(){return(Ja=Se((function(e){return ke(this,(function(t){return[2,kn("checkStateBioAuthentication",[],[e],Se((function(){return ke(this,(function(e){switch(e.label){case 0:return Ue.isMp?[4,Ha()]:[3,2];case 1:return[2,{bioState:e.sent()}];case 2:return Ue.isMpWeb?[2,Promise.resolve({bioState:""})]:[2,Promise.reject(je("checkStateBioAuthentication",{}))]}}))})))]}))}))).apply(this,arguments)}var qa=function(){var e=Se((function(e){return ke(this,(function(t){return[2,new Promise((function(t,n){pn("SHOW_TOAST",{toast:e},{success:function(){t()},fail:function(e){n(e)}},{})}))]}))}));return function(t){return e.apply(this,arguments)}}(),Qa=[vi({message:ni()}).optional()];function $a(e){return Ya.apply(this,arguments)}function Ya(){return Ya=Se((function(e){return ke(this,(function(t){return[2,kn("showToast",Qa,[e],function(){var e=Se((function(e){return ke(this,(function(t){switch(t.label){case 0:return Ue.isMp?[4,qa(e.message)]:[3,2];case 1:return[2,t.sent()];case 2:return Ue.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(je("showToast",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Ya.apply(this,arguments)}var Xa=Se((function(){return ke(this,(function(e){return[2,new Promise((function(e,t){pn("HIDE_KEYBOARD",{},{success:function(){e()},fail:function(e){t(e)}},{})}))]}))}));function es(e){return ts.apply(this,arguments)}function ts(){return(ts=Se((function(e){return ke(this,(function(t){return[2,kn("hideKeyboard",[],[e],Se((function(){return ke(this,(function(e){switch(e.label){case 0:return Ue.isMp?[4,Xa()]:[3,2];case 1:return[2,e.sent()];case 2:return Ue.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(je("hideKeyboard",{}))]}}))})))]}))}))).apply(this,arguments)}var ns=function(){var e=Se((function(e){return ke(this,(function(t){return[2,new Promise((function(t,n){pn("OPEN_PHONE",{phoneNum:e,phoneCode:e},{success:function(){t()},fail:function(e){n(e)}},{})}))]}))}));return function(t){return e.apply(this,arguments)}}(),rs=[vi({phoneNumber:ni()})];function is(e){return os.apply(this,arguments)}function os(){return os=Se((function(e){return ke(this,(function(t){return[2,kn("openPhone",rs,[e],function(){var e=Se((function(e){return ke(this,(function(t){switch(t.label){case 0:return Ue.isMp?[4,ns(e.phoneNumber)]:[3,2];case 1:return[2,t.sent()];case 2:return Ue.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(je("openPhone",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),os.apply(this,arguments)}var as=function(){var e=Se((function(e,t){return ke(this,(function(n){return[2,new Promise((function(n,r){pn("OPEN_SMS",{content:t,phoneCode:e},{success:function(){n()},fail:function(e){r(e)}},{})}))]}))}));return function(t,n){return e.apply(this,arguments)}}(),ss=[vi({content:ni(),phoneNumber:ni()})];function us(e){return cs.apply(this,arguments)}function cs(){return cs=Se((function(e){return ke(this,(function(t){return[2,kn("openSMS",ss,[e],function(){var e=Se((function(e){return ke(this,(function(t){switch(t.label){case 0:return Ue.isMp?[4,as(e.phoneNumber,e.content)]:[3,2];case 1:return[2,t.sent()];case 2:return Ue.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(je("openSMS",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),cs.apply(this,arguments)}var ls=function(){var e=Se((function(e){var t,n=arguments;return ke(this,(function(r){return t=n.length>1&&void 0!==n[1]?n[1]:"",[2,new Promise((function(n,r){pn("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)}}(),ds=[vi({id:ni(),displayName:ni().default("").optional()})];function ps(e){return fs.apply(this,arguments)}function fs(){return fs=Se((function(e){return ke(this,(function(t){return[2,kn("viewOAQr",ds,[e],function(){var e=Se((function(e){return ke(this,(function(t){switch(t.label){case 0:return Ue.isMp?[4,ls(e.id,e.displayName)]:[3,2];case 1:return[2,t.sent()];case 2:return Ue.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(je("viewOAQr",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),fs.apply(this,arguments)}var hs=function(){var e=Se((function(e){return ke(this,(function(t){return[2,new Promise((function(t,n){pn("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)}}(),ms=[vi({keepScreenOn:ai()})];function vs(e){return ys.apply(this,arguments)}function ys(){return ys=Se((function(e){return ke(this,(function(t){return[2,kn("keepScreen",ms,[e],function(){var e=Se((function(e){return ke(this,(function(t){switch(t.label){case 0:return Ue.isMp?[4,hs(e.keepScreenOn)]:[3,2];case 1:return[2,t.sent()];case 2:return Ue.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(je("keepScreen",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),ys.apply(this,arguments)}function gs(e){return _s.apply(this,arguments)}function _s(){return(_s=Se((function(e){return ke(this,(function(t){return[2,kn("onKeepScreen",[],[e],Se((function(){return ke(this,(function(e){switch(e.label){case 0:return Ue.isMp?[4,hs(!0)]:[3,2];case 1:return[2,e.sent()];case 2:return Ue.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(je("onKeepScreen",{}))]}}))})))]}))}))).apply(this,arguments)}function ws(e){return Ts.apply(this,arguments)}function Ts(){return(Ts=Se((function(e){return ke(this,(function(t){return[2,kn("offKeepScreen",[],[e],Se((function(){return ke(this,(function(e){switch(e.label){case 0:return Ue.isMp?[4,hs(!1)]:[3,2];case 1:return[2,e.sent()];case 2:return Ue.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(je("offKeepScreen",{}))]}}))})))]}))}))).apply(this,arguments)}var bs=function(){var e=Se((function(e,t,n){var r;return ke(this,(function(i){return r={},e?r={imageBase64Data:e}:t&&(r={imageUrl:t}),[2,new Promise((function(e,t){pn("SAVE_IMAGE_GALLERY",ma(Ze({},r),{onProgress:n}),{success:function(){e()},fail:function(e){t(e)}},{})}))]}))}));return function(t,n,r){return e.apply(this,arguments)}}(),Es=[vi({imageBase64Data:ni().optional(),imageUrl:ni().url().optional()}).optional()];function Ss(e){return Ps.apply(this,arguments)}function Ps(){return Ps=Se((function(e){return ke(this,(function(t){return[2,kn("saveImageToGallery",Es,[e],function(){var e=Se((function(e){return ke(this,(function(t){switch(t.label){case 0:return Ue.isMp?[4,bs(e.imageBase64Data,e.imageUrl,e.onProgress)]:[3,2];case 1:return[2,t.sent()];case 2:return Ue.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(je("saveImageToGallery",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Ps.apply(this,arguments)}var Is=function(){var e=Se((function(e,t){var n;return ke(this,(function(r){return{},n={videoUrl:e,onProgress:t},[2,new Promise((function(e,t){pn("SAVE_VIDEO_GALLERY",Ze({},n),{success:function(){e()},fail:function(e){t(e)}},{})}))]}))}));return function(t,n){return e.apply(this,arguments)}}(),As=[vi({videoUrl:ni().url()}).optional()];function Os(e){return ks.apply(this,arguments)}function ks(){return ks=Se((function(e){return ke(this,(function(t){return[2,kn("saveVideoToGallery",As,[e],function(){var e=Se((function(e){return ke(this,(function(t){switch(t.label){case 0:return Ue.isMp?[4,Is(e.videoUrl,e.onProgress)]:[3,2];case 1:return[2,t.sent()];case 2:return Ue.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(je("saveVideoToGallery",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),ks.apply(this,arguments)}var Ns=function(){var e=Se((function(e){var t,n,r,i,o,a,u=arguments;return ke(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,La(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=ze(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){pn("OPEN_MP",{mpUrl:o,mpInfo:i},{success:function(){e()},fail:function(e){t(e)}},{})}))]}}))}));return function(t){return e.apply(this,arguments)}}(),Cs=[vi({appId:ni(),path:ni().optional(),params:ji.record(ni(),ni()).optional()})];function Ms(e){return Rs.apply(this,arguments)}function Rs(){return Rs=Se((function(e){return ke(this,(function(t){return[2,kn("openMiniApp",Cs,[e],function(){var e=Se((function(e){return ke(this,(function(t){switch(t.label){case 0:return Ue.isMp?[4,Ns(e.appId,e.path,e.params)]:[3,2];case 1:return[2,t.sent()];case 2:return Ue.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(je("openMiniApp",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Rs.apply(this,arguments)}var xs=Se((function(){var t,n,r=arguments;return ke(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){pn("INTERACTIVE_VIBRATION",{type:e.VibrateType[t],vibrate_time:n},{success:function(){r()},fail:function(e){i(e)}},{})}))]}))})),Ds=[vi({type:ji.enum(["oneShot"]).default("oneShot"),milliseconds:ri().optional()})];function Us(e){return Ls.apply(this,arguments)}function Ls(){return Ls=Se((function(e){return ke(this,(function(t){return[2,kn("vibrate",Ds,[e],function(){var e=Se((function(e){return ke(this,(function(t){switch(t.label){case 0:return Ue.isMp?[4,xs(null==e?void 0:e.type,null==e?void 0:e.milliseconds)]:[3,2];case 1:return[2,t.sent()];case 2:return Ue.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(je("vibrate",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Ls.apply(this,arguments)}var js=function(){var e=Se((function(e,t){var n,r,i,o;return ke(this,(function(a){return n=new URL(e),r=n.href.includes("vnpay"),i=n.searchParams.get("typeInapp"),o=Et.isEmpty(t)?void 0:{modal_style:(null==t?void 0:t.style)?Yt(null==t?void 0:t.style):"bottom_sheet",left_button:(null==t?void 0:t.leftButton)?Yt(null==t?void 0:t.leftButton):"back"},!r&&Et.isEmpty(i)&&n.searchParams.set("typeInapp","1"),[2,new Promise((function(e,t){pn("OPEN_INAPP",{url:n.href,style:o},{success:function(){e()},fail:function(e){t(e)}},{})}))]}))}));return function(t,n){return e.apply(this,arguments)}}(),Bs=[vi({url:ni(),config:vi({style:ji.enum(["bottomSheet","normal"]).default("bottomSheet").optional(),leftButton:ji.enum(["back","none"]).default("back").optional()}).optional()})];function Zs(e){return zs.apply(this,arguments)}function zs(){return zs=Se((function(e){return ke(this,(function(t){return[2,kn("openWebview",Bs,[e],function(){var e=Se((function(e){return ke(this,(function(t){switch(t.label){case 0:return Ue.isMp?[4,js(e.url,e.config)]:[3,2];case 1:return[2,t.sent()];case 2:return Ue.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(je("openWebview",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),zs.apply(this,arguments)}function Ws(){var e={},t=window.location.href;try{var n=new URL(t).searchParams.toString();n&&(e=Wt.getParamsAsObject(n))}catch(e){throw new Error("Invalid URL")}return e}function Fs(){return kn("getRouteParams",[],[],(function(){return Ws()}))}function Vs(e){return Gs.apply(this,arguments)}function Gs(){return(Gs=Se((function(e){return ke(this,(function(t){return[2,kn("getAppInfo",[],[e],Se((function(){return ke(this,(function(e){switch(e.label){case 0:return Ue.isMp?[4,La()]:[3,2];case 1:return[2,e.sent()];case 2:return Ue.isMpWeb?[2,Promise.resolve({description:"",name:"",version:"",appUrl:"",qrCodeUrl:""})]:[2,Promise.reject(je("getAppInfo",{}))]}}))})))]}))}))).apply(this,arguments)}var Hs=function(){var e=Se((function(e){return ke(this,(function(t){return[2,new Promise((function(t,n){pn("WEBVIEW_SET_RESULT",{result:bn(e)},{success:function(){t()},fail:function(e){n(e)}},{})}))]}))}));return function(t){return e.apply(this,arguments)}}(),Ks=[vi({data:ji.any()})];function Js(e){return qs.apply(this,arguments)}function qs(){return qs=Se((function(e){return ke(this,(function(t){return[2,kn("sendDataToPreviousMiniApp",Ks,[e],function(){var e=Se((function(e){return ke(this,(function(t){switch(t.label){case 0:return Ue.isMp?[4,Hs(e.data)]:[3,2];case 1:return[2,t.sent()];case 2:return Ue.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(je("sendDataToPreviousMiniApp",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),qs.apply(this,arguments)}var Qs=Se((function(){return ke(this,(function(e){return[2,new Promise((function(e,t){var n,r;pn("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(ln.error.clientNotSupport())},fail:function(e){t(e)}},{delay:(null===(n=De())||void 0===n||null===(r=n.platform)||void 0===r?void 0:r.isIOS)?400:0})}))]}))}));function $s(e){return Ys.apply(this,arguments)}function Ys(){return(Ys=Se((function(e){return ke(this,(function(t){return[2,kn("getPhoneNumber",[],[e],Se((function(){return ke(this,(function(e){switch(e.label){case 0:return Ue.isMp?[4,Qs()]:[3,2];case 1:return[2,e.sent()];case 2:return Ue.isMpWeb?[2,Promise.resolve({number:""})]:[2,Promise.reject(je("getPhoneNumber",{}))]}}))})))]}))}))).apply(this,arguments)}var Xs=Se((function(){var e,t=arguments;return ke(this,(function(n){return e=t.length>0&&void 0!==t[0]?t[0]:1,[2,new Promise((function(t,n){pn("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})}))]}))})),eu=[vi({maxProfile:ri().min(1).max(10).optional().default(1)})];function tu(e){return nu.apply(this,arguments)}function nu(){return nu=Se((function(e){return ke(this,(function(t){return[2,kn("openProfilePicker",eu,[e],function(){var e=Se((function(e){var t,n,r,i,o;return ke(this,(function(a){switch(a.label){case 0:return Ue.isMp?[4,Xs(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,mn.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(Et.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 Ue.isMpWeb?[2,Promise.resolve({users:[]})]:[2,Promise.reject(je("openProfilePicker",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),nu.apply(this,arguments)}var ru=function(){var e=Se((function(e,t,n){var r;return ke(this,(function(i){return r=t&&Et.isString(t)&&t.length>0?"wpa_wpa2":"open",[2,new Promise((function(i,o){pn("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)}}(),iu=[vi({SSID:ni(),password:ni().optional(),hiddenSSID:ai().optional()})];function ou(e){return au.apply(this,arguments)}function au(){return au=Se((function(e){return ke(this,(function(t){return[2,kn("connectWifi",iu,[e],function(){var e=Se((function(e){return ke(this,(function(t){switch(t.label){case 0:return Ue.isMp?[4,ru(e.SSID,e.password,e.hiddenSSID)]:[3,2];case 1:return[2,t.sent()];case 2:return Ue.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(je("connectWifi",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),au.apply(this,arguments)}var su=function(){var t=Se((function(t,n,r,i,o,a){var s,u;return ke(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){pn("PICK_MEDIA",{media_type:e.MediaPickerType[t],edit_view:Ze({},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)}}(),uu=[vi({type:ji.enum(["video","photo","file","zcamera","zcamera_photo","zcamera_video","zcamera_scan"]),serverUploadUrl:ni().url(),maxItemSize:ri().min(0).optional(),editView:vi({enable:ai().optional(),aspectRatio:ni().regex(/^d+:d+$/).optional()}).optional(),silentRequest:ai().optional(),maxSelectItem:ri().min(1).optional()})];function cu(e){return lu.apply(this,arguments)}function lu(){return lu=Se((function(e){return ke(this,(function(t){return[2,kn("openMediaPicker",uu,[e],function(){var e=Se((function(e){var t,n,r,i,o,a;return ke(this,(function(s){switch(s.label){case 0:return Ue.isMp?(i={},Et.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,su(e.type,e.serverUploadUrl,e.maxItemSize,i,o,a)]):[3,2];case 1:return[2,{data:s.sent()}];case 2:return Ue.isMpWeb?[2,Promise.resolve({data:""})]:[2,Promise.reject(je("openMediaPicker",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),lu.apply(this,arguments)}var du=[vi({title:ni().max(100),description:ni().max(400).default(""),thumbnail:ni().url().optional(),path:ni().optional()})];function pu(e){return fu.apply(this,arguments)}function fu(){return fu=Se((function(e){return ke(this,(function(t){return[2,kn("getShareableLink",du,[e],function(){var e=Se((function(e){var t;return ke(this,(function(n){switch(n.label){case 0:return[4,mn.getAccessToken()];case 1:return t=n.sent(),[4,Oa(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)}}())]}))})),fu.apply(this,arguments)}var hu=function(){var e=Se((function(e){return ke(this,(function(t){return[2,new Promise((function(t,n){pn("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 mu(e){return vu.apply(this,arguments)}function vu(){return(vu=Se((function(e){return ke(this,(function(t){return[2,kn("closeLoading",[],[e],Se((function(){return ke(this,(function(e){switch(e.label){case 0:return Ue.isMp?[4,hu("user action")]:[3,2];case 1:return[2,e.sent()];case 2:return Ue.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(je("closeLoading",{}))]}}))})))]}))}))).apply(this,arguments)}function yu(e){return gu.apply(this,arguments)}function gu(){return gu=Se((function(e){return ke(this,(function(t){return[2,kn("requestUpdateZalo",[],[e],Se((function(){var e,t,n;return ke(this,(function(r){switch(r.label){case 0:return Ue.isMp?(n=(null===(e=De())||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,ja(n)]):[3,2];case 1:return[2,r.sent()];case 2:return Ue.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(je("requestUpdateZalo",{}))]}}))})))]}))})),gu.apply(this,arguments)}var _u=Bt.getInstance();_u.addListener=function(t,n,r){var i=t;return _u.addListener(e.Events[i],n,r)};var wu=[ji.function()];function Tu(t){return kn("onConfirmToExit",wu,[t],(function(t){var n=t;Ue.isMp&&(_u.on(e.Events.AppClose,n,'{"handle_h5": 1}'),Zi.setNavigationBarLeftButton(void 0,2))}))}function bu(){return kn("offConfirmToExit",[],[],(function(){Ue.isMp&&(_u.off(e.Events.AppClose),Zi.setNavigationBarLeftButton(void 0,0))}))}function Eu(){return kn("getDeviceId",[],[],(function(){return Ue.isMp&&mn.getSync(l.DEVICE_ID)||""}))}function Su(e){return Pu.apply(this,arguments)}function Pu(){return(Pu=Se((function(e){return ke(this,(function(t){return[2,kn("getDeviceIdAsync",[],[e],Se((function(){return ke(this,(function(e){switch(e.label){case 0:return Ue.isMp?[4,mn.jumpAndGetToken(l.DEVICE_ID)]:[3,2];case 1:return[2,e.sent()||""];case 2:return[2,Promise.resolve("")]}}))})))]}))}))).apply(this,arguments)}function Iu(){return kn("getContext",[],[],(function(){if(Ue.isMp){var e=mn.getSync(l.CONTEXT_ID)||"";return{type:mn.getSync(l.CONTEXT_TYPE)||"",id:e}}return{type:"",id:""}}))}function Au(e){return Ou.apply(this,arguments)}function Ou(){return(Ou=Se((function(e){return ke(this,(function(t){return[2,kn("getContextAsync",[],[e],Se((function(){var e;return ke(this,(function(t){switch(t.label){case 0:return Ue.isMp?[4,mn.jumpAndGetToken(l.CONTEXT_ID)]:[3,3];case 1:return e=t.sent()||"",[4,mn.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 ku(e){return Nu.apply(this,arguments)}function Nu(){return(Nu=Se((function(e){return ke(this,(function(t){return[2,kn("getAuthCode",[],[e],Se((function(){var e,t;return ke(this,(function(n){switch(n.label){case 0:return Ue.isMp?[4,mn.jumpAndGetToken(l.ZOAUTH,!0)]:[3,4];case 1:return e=n.sent()||"",[4,mn.jumpAndGetToken(l.ZOAUTH_VRF)];case 2:return t=n.sent()||"",[4,mn.verifyUserAuthorized()];case 3:if(n.sent())return[2,{authCode:e,authCodeVerify:t}];throw $t([{action:"getAuthCode",error:-104,message:"no user auth",data:{}}]),ln.error.loginFailed("User Authentication Required");case 4:return[2,Promise.resolve({authCode:"",authCodeVerify:""})]}}))})))]}))}))).apply(this,arguments)}function Cu(e){return Mu.apply(this,arguments)}function Mu(){return(Mu=Se((function(e){return ke(this,(function(t){return[2,kn("getZPIToken",[],[e],Se((function(){var e,t,n,r;return ke(this,(function(i){switch(i.label){case 0:return Ue.isMp?[4,mn.jumpAndGetToken(l.UTOKEN_ZPI)]:[3,5];case 1:return e=i.sent()||"",[4,mn.jumpAndGetToken(l.GTOKEN_ZPI)];case 2:return t=i.sent()||"",[4,mn.jumpAndGetToken(l.ZPP_ZPI)];case 3:return n=i.sent()||"",[4,mn.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 Ru=[ni()];function xu(e){return kn("setAccessToken",Ru,[e],(function(e){var t=e;mn.setAccessToken(t)}))}var Du=[vi({url:ni().url()})];function Uu(e){return Lu.apply(this,arguments)}function Lu(){return Lu=Se((function(e){return ke(this,(function(t){return[2,kn("openOutApp",Du,[e],function(){var e=Se((function(e){return ke(this,(function(t){switch(t.label){case 0:return Ue.isMp?[4,ja(e.url)]:[3,2];case 1:return[2,t.sent()];case 2:return Ue.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(je("openOutApp",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Lu.apply(this,arguments)}var ju=[vi({count:ri().min(1).optional().default(1),sourceType:ji.array(ji.enum(["album","camera"])).max(2).default(["album","camera"]).optional(),cameraType:ji.enum(["back","front"]).default("front").optional()})];function Bu(e){return Zu.apply(this,arguments)}function Zu(){return Zu=Se((function(e){return ke(this,(function(t){return[2,kn("chooseImage",ju,[e],function(){var e=Se((function(e){var t,n,r,i;return ke(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)}}())]}))})),Zu.apply(this,arguments)}var zu=Se((function(){var e,t,n=arguments;return ke(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){pn("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(ln.error.clientNotSupport())},fail:function(e){r(e)}},{isMultiCallback:!0,timeout:!1})}))]}))}));function Wu(e){return Fu.apply(this,arguments)}function Fu(){return(Fu=Se((function(e){return ke(this,(function(t){return[2,kn("getLocation",[],[e],Se((function(){return ke(this,(function(e){switch(e.label){case 0:return Ue.isMp?[4,zu()]:[3,2];case 1:return[2,e.sent()];case 2:return Ue.isMpWeb?[2,Promise.resolve({longitude:"105.788026",latitude:"21.0258773",timestamp:(new Date).getTime().toString(),provider:"fused"})]:[2,Promise.reject(je("getLocation",{}))]}}))})))]}))}))).apply(this,arguments)}var Vu=[ji.function().args(vi({data:ji.any()})).returns(ji.void())];function Gu(t){return kn("onCallbackData",Vu,[t],(function(){!function(t){Bt.getInstance().on(e.Events.OnDataCallback,(function(e){t({data:e})}))}(t)}))}var Hu=function(){var e=Se((function(e){var t,n,r,i,a,s,u,c,l,d,p;return ke(this,(function(f){switch(f.label){case 0:return e||(e=Ws()),"object"==typeof e&&((n=e.zmpOrderId||e.orderId)||(t=e.appTransID||e.apptransid||e.transId)),"string"==typeof e&&(r=Wt.getParameterByName("orderId",e),i=Wt.getParameterByName("appTransID",e)||Wt.getParameterByName("apptransid",e),t=r||i),a={headers:{authorization:"Bearer "}},[4,mn.getAccessToken().catch((function(){throw ln.error.loginRequired}))];case 1:return s=f.sent(),a.headers.authorization="Bearer ".concat(s),u=new URL(fe),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 ln.error.badRequest(l.msg);return d=l.data||{},p={err:l.err,msg:l.msg},0!==Object.keys(d).length&&d.constructor===Object&&Object.assign(p,Ze({msg:d.resultMessage},d)),[2,p]}}))}));return function(t){return e.apply(this,arguments)}}(),Ku=function(){var t=Se((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,I,A,O;return ke(this,(function(k){switch(k.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 "}},k.label=1;case 1:return k.trys.push([1,6,,7]),[4,mn.getAccessToken().catch((function(){throw ln.error.loginRequired}))];case 2:return h=k.sent(),f.headers.authorization="Bearer ".concat(h),[4,fetch(de,ma(Ze({method:"POST"},f),{body:l}))];case 3:return[4,k.sent().json()];case 4:if(!(m=k.sent()).data||0!==m.err)throw ln.error.badRequest(m.msg);return v=m.data.id,y=m.data.jwt,g=m.data.messageToken||"",_=window.APP_VERSION,w=window.APP_ENV,T={miniAppId:c,orderId:v},b=m.data.method,E=m.data.isCustom,y&&(T.token=y),_&&(T.version=_),w&&(T.env=w),b&&(T.method=b),E&&(T.isCustom=E),S=Wt.encode(T),P=new URL("?".concat(S),"https://payment-mini.zalo.me").toString(),I=en(),A=Xt()&&I<742?"normal":"bottomSheet",Dt.enablePaymentDone=Bt.getInstance().eventNames().includes(e.Events.PaymentDone),[4,js(P,{style:A}).then((function(){var t=!1;Bt.getInstance().once(e.Events.WebviewClosed,(function(){setTimeout(Se((function(){var n;return ke(this,(function(r){switch(r.label){case 0:return t?[3,2]:(Bt.getInstance().emit(e.Events.PaymentDone,v,{orderId:v}),[4,Hu({zmpOrderId:v})]);case 1:(n=r.sent()).err>=0&&!n.isCustom&&Bt.getInstance().emit(e.Events.PaymentClose,n.err,ma(Ze({},n),{zmpOrderId:v})),r.label=2;case 2:return[2]}}))})),500)})),Bt.getInstance().once(e.Events.OpenApp,(function(){t=!0})),Bt.getInstance().once(e.Events.PaymentDone,(function(){t=!0,Dt.enablePaymentDone=!1}))}))];case 5:return k.sent(),[2,{orderId:v,messageToken:g}];case 6:throw O=k.sent(),console.log("Internal error"),O;case 7:return[2]}}))}));return function(e,n,r,i,o,a,s){return t.apply(this,arguments)}}(),Ju=[vi({amount:ji.union([ni(),ri()]),item:ji.array(ji.record(ni(),ji.any())),desc:ni(),extradata:ji.any().optional(),payload:ji.any().optional(),method:ji.union([ji.string(),ji.object({id:ji.string(),isCustom:ji.boolean()})]).optional(),mac:ji.string().optional()})];function qu(e){return Qu.apply(this,arguments)}function Qu(){return Qu=Se((function(e){return ke(this,(function(t){return[2,kn("createOrder",Ju,[e],function(){var e=Se((function(e){return ke(this,(function(t){switch(t.label){case 0:return Ue.isMp?[4,Ku(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 Ue.isMpWeb?[2,Promise.resolve({orderId:"",messageToken:""})]:[2,Promise.reject(je("createOrder",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Qu.apply(this,arguments)}var $u=Se((function(){return ke(this,(function(e){return[2,new Promise((function(e,t){pn("MP_CONFIRM_REQUEST_PAYMENT",{},{success:function(){e()},fail:function(e){t(e)}},{})}))]}))})),Yu=function(){var e=Se((function(e,t,n,r,i){var a,s,u,c,l,d,p,f,h,m,v,y;return ke(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,mn.getAccessToken().catch((function(){throw ln.error.loginRequired}))];case 2:return l=g.sent(),u.headers.authorization="Bearer ".concat(l),console.log("_purchase"),[4,mn.jumpAndGetToken()];case 3:if(g.sent(),d=null===(c=mn.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,$u()];case 5:return g.sent(),[3,7];case 6:throw p=g.sent(),console.error("Failed:",p),p;case 7:return[4,fetch(he,ma(Ze({method:"POST"},u),{body:s}))];case 8:return[4,g.sent().json()];case 9:if(!(f=g.sent()).data||0!==f.err)throw ln.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)}}(),Xu=[vi({amount:ji.union([ji.string(),ji.number()]),desc:ji.string(),method:ji.string(),transId:ji.string().optional(),mac:ji.string().optional()})];function ec(e){return tc.apply(this,arguments)}function tc(){return tc=Se((function(e){return ke(this,(function(t){return[2,kn("purchase",Xu,[e],function(){var e=Se((function(e){return ke(this,(function(t){switch(t.label){case 0:return Ue.isMp?[4,Yu(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 Ue.isMpWeb?[2,Promise.resolve({orderId:"",messageToken:"",transId:""})]:[2,Promise.reject(je("purchase",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),tc.apply(this,arguments)}var nc=function(){var e=Se((function(e,t){return ke(this,(function(n){return[2,new Promise((function(n,r){var i=e&&(null==e?void 0:e.length)>0;pn("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)}}(),rc=[vi({channels:mi(vi({method:ni(),subMethod:ni().optional(),subInfo:ni().optional()})).optional(),selectedMethod:vi({method:ni(),subMethod:ni().optional()}).optional()}).optional()];function ic(e){return oc.apply(this,arguments)}function oc(){return oc=Se((function(e){return ke(this,(function(t){return[2,kn("selectPaymentMethod",rc,[e],function(){var e=Se((function(e){var t,n;return ke(this,(function(r){switch(r.label){case 0:return Ue.isMp?(t=e.channels,n=e.selectedMethod,[4,nc(t,n)]):[3,2];case 1:return[2,r.sent()];case 2:return Ue.isMpWeb?[2,Promise.resolve({method:""})]:[2,Promise.reject(je("selectPaymentMethod",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),oc.apply(this,arguments)}var ac=[vi({data:ji.union([ni(),ji.record(ni(),ni().nullish())])})];function sc(e){return uc.apply(this,arguments)}function uc(){return uc=Se((function(e){return ke(this,(function(t){return[2,kn("checkTransaction",ac,[e],function(){var e=Se((function(e){return ke(this,(function(t){switch(t.label){case 0:return Ue.isMp?[4,Hu(e.data)]:[3,2];case 1:return[2,t.sent()];case 2:return Ue.isMpWeb?[2,Promise.resolve({msg:"Success",orderId:"",resultCode:1,transTime:(new Date).getTime().toString(),createdAt:(new Date).getTime().toString(),transId:""})]:[2,Promise.reject(je("checkTransaction",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),uc.apply(this,arguments)}var cc=function(){var t=Se((function(t,n,r,i,a,s){var u,c,l,d,p,f,h,m,v,y,g,_,w,T;return ke(this,(function(b){switch(b.label){case 0:p=o,(f=new URLSearchParams).append("payType",n||e.IAPPayType.SUBSCRIPTION),h=e.ProrationMode.UNKNOW,r===ve&&(h=e.ProrationMode.IMMEDIATE_AND_CHARGE_FULL_PRICE),r===me&&(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=De())||void 0===u||null===(c=u.platform)||void 0===c?void 0:c.isIOS)?m="ios":(null===(l=De())||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,mn.getAccessToken().catch((function(){throw ln.error.loginRequired}))];case 2:return y=b.sent(),v.headers.authorization="Bearer ".concat(y),[4,fetch(pe,ma(Ze({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 ln.error.createIAPOrderFailed(g.err);return _=g.data.store,w=g.data.orderId,[2,new Promise((function(e,t){pn("IAP_REQUESTPAYMENT",Ze({},_),{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)}}(),lc=[vi({productId:ni(),payType:ji.enum(["ONETIME","SUBSCRIPTION"]).optional(),prorationMode:ji.enum(["DEFERRED","IMMEDIATE_AND_CHARGE_FULL_PRICE"]).default("DEFERRED").optional(),utm:ni().optional(),method:ji.enum(["IAP","IAP_SANDBOX"]).optional(),merchantTransId:ni().optional()})];function dc(e){return pc.apply(this,arguments)}function pc(){return pc=Se((function(e){return ke(this,(function(t){return[2,kn("createOrderIAP",lc,[e],function(){var e=Se((function(e){return ke(this,(function(t){switch(t.label){case 0:return Ue.isMp?[4,cc(e.productId,e.payType,e.prorationMode,e.method,e.utm,e.merchantTransId)]:[3,2];case 1:return[2,t.sent()];case 2:return Ue.isMpWeb?[2,Promise.resolve({orderId:""})]:[2,Promise.reject(je("createOrderIAP",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),pc.apply(this,arguments)}var fc=[vi({hide:ai().default(!1).optional()}).optional()];function hc(e){return mc.apply(this,arguments)}function mc(){return mc=Se((function(e){return ke(this,(function(t){return[2,kn("setAndroidBottomNavigationBar",fc,[e],function(){var e=Se((function(e){return ke(this,(function(t){switch(t.label){case 0:return Ue.isMp?[4,Zi.setAndroidBottomNavigationBar(e.hide)]:[3,2];case 1:return[2,t.sent()];case 2:return Ue.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(je("setAndroidBottomNavigationBar",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),mc.apply(this,arguments)}var vc=[vi({hide:ai().default(!1).optional()}).optional()];function yc(e){return gc.apply(this,arguments)}function gc(){return gc=Se((function(e){return ke(this,(function(t){return[2,kn("setIOSBottomSafeArea",vc,[e],function(){var e=Se((function(e){return ke(this,(function(t){switch(t.label){case 0:return Ue.isMp?[4,Zi.setIOSBottomSafeArea(e.hide)]:[3,2];case 1:return[2,t.sent()];case 2:return Ue.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(je("setIOSBottomSafeArea",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),gc.apply(this,arguments)}var _c=[vi({type:ji.enum(["normal","hidden","transparent"]).default("normal").optional(),color:ji.string().optional()}).optional()];function wc(e){return Tc.apply(this,arguments)}function Tc(){return Tc=Se((function(e){return ke(this,(function(t){return[2,kn("setStatusBar",_c,[e],function(){var e=Se((function(e){return ke(this,(function(t){switch(t.label){case 0:return Ue.isMp?[4,Zi.configHeader({statusBarType:e.type,headerColor:e.color})]:[3,2];case 1:return[2,t.sent()];case 2:return Ue.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(je("setStatusBar",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Tc.apply(this,arguments)}var bc=[vi({headerTextColor:ji.enum(["black","white"]).optional(),headerColor:ji.string().optional(),actionBar:vi({hide:ji.boolean().optional(),title:ji.string().optional(),leftButton:ji.enum(["back","none"]).optional(),textAlign:ji.enum(["left","center"]).default("left").optional()}).optional(),statusBarType:ji.enum(["normal","hidden","transparent"]).optional(),hideAndroidBottomNavigationBar:ji.boolean().optional(),hideIOSSafeAreaBottom:ji.boolean().optional()})];function Ec(e){return Sc.apply(this,arguments)}function Sc(){return Sc=Se((function(e){return ke(this,(function(t){return[2,kn("configAppView",bc,[e],function(){var e=Se((function(e){var t,n,r,i,o,a,s;return ke(this,(function(u){switch(u.label){case 0:return Ue.isMp?Et.isUndefined(null===(t=e.actionBar)||void 0===t?void 0:t.leftButton)?[3,2]:[4,Zi.setNavigationBarLeftButton(null===(a=e.actionBar)||void 0===a?void 0:a.leftButton)]:[3,13];case 1:u.sent(),u.label=2;case 2:return Et.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,Zi.setNavigationBarTitle(null===(s=e.actionBar)||void 0===s?void 0:s.title)];case 3:u.sent(),u.label=4;case 4:return[4,Zi.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,Zi.setAndroidBottomNavigationBar(e.hideAndroidBottomNavigationBar)];case 7:u.sent(),u.label=8;case 8:return"boolean"!=typeof e.hideIOSSafeAreaBottom?[3,10]:[4,Zi.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 Ue.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(je("configAppView",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Sc.apply(this,arguments)}var Pc=Se((function(){return ke(this,(function(e){return[2,new Promise((function(e,t){pn("MA_MENU_MINIMIZE",{},{success:function(t){e(t)},fail:function(e){t(e)}},{})}))]}))}));function Ic(e){return Ac.apply(this,arguments)}function Ac(){return(Ac=Se((function(e){return ke(this,(function(t){return[2,kn("minimizeApp",[],[e],Se((function(){return ke(this,(function(e){switch(e.label){case 0:return Ue.isMp?[4,Pc()]:[3,2];case 1:return[2,e.sent()];case 2:return Ue.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(je("minimizeApp",{}))]}}))})))]}))}))).apply(this,arguments)}var Oc=Se((function(){return ke(this,(function(e){return[2,new Promise((function(e,t){pn("MA_MENU_PERMISSION",{},{success:function(t){e(t)},fail:function(e){t(e)}},{}),e()}))]}))}));function kc(e){return Nc.apply(this,arguments)}function Nc(){return(Nc=Se((function(e){return ke(this,(function(t){return[2,kn("openPermissionSetting",[],[e],Se((function(){return ke(this,(function(e){switch(e.label){case 0:return Ue.isMp?[4,Oc()]:[3,2];case 1:return[2,e.sent()];case 2:return Ue.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(je("openPermissionSetting",{}))]}}))})))]}))}))).apply(this,arguments)}var Cc=Se((function(){return ke(this,(function(e){return[2,new Promise((function(e,t){pn("MP_ADD_MYFAVORITES",{timestamp:(new Date).getTime()},{success:function(t){e(t)},fail:function(e){t(e)}},{})}))]}))}));function Mc(e){return Rc.apply(this,arguments)}function Rc(){return(Rc=Se((function(e){return ke(this,(function(t){return[2,kn("favoriteApp",[],[e],Se((function(){return ke(this,(function(e){switch(e.label){case 0:return Ue.isMp?[4,Cc()]:[3,2];case 1:return[2,e.sent()];case 2:return Ue.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(je("favoriteApp",{}))]}}))})))]}))}))).apply(this,arguments)}var xc=Se((function(){return ke(this,(function(e){return[2,new Promise((function(e,t){pn("OPEN_GROUPLIST",{},{success:function(t){e(t)},fail:function(e){t(e)}},{})}))]}))}));function Dc(e){return Uc.apply(this,arguments)}function Uc(){return(Uc=Se((function(e){return ke(this,(function(t){return[2,kn("openGroupList",[],[e],Se((function(){return ke(this,(function(e){switch(e.label){case 0:return Ue.isMp?[4,xc()]:[3,2];case 1:return[2,e.sent()];case 2:return Ue.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(je("openGroupList",{}))]}}))})))]}))}))).apply(this,arguments)}var Lc=Se((function(){var e;return ke(this,(function(t){switch(t.label){case 0:return[4,mn.getAccessToken()];case 1:return e=t.sent(),[2,new Promise((function(t,n){pn("MP_SEND_NOTIFICATION",{accessToken:e},{success:function(e){t(e)},fail:function(e){n(e)}},{delay:500})}))]}}))}));function jc(e){return Bc.apply(this,arguments)}function Bc(){return(Bc=Se((function(e){return ke(this,(function(t){return[2,kn("requestSendNotification",[],[e],Se((function(){return ke(this,(function(e){switch(e.label){case 0:return Ue.isMp?[4,Lc()]:[3,2];case 1:return[2,e.sent()];case 2:return Ue.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(je("requestSendNotification",{}))]}}))})))]}))}))).apply(this,arguments)}var Zc=Se((function(){return ke(this,(function(e){return[2,new Promise((function(e,t){pn("MP_ADD_RATING",{},{success:function(t){e(t)},fail:function(e){t(e)}},{})}))]}))}));function zc(e){return Wc.apply(this,arguments)}function Wc(){return(Wc=Se((function(e){return ke(this,(function(t){return[2,kn("addRating",[],[e],Se((function(){return ke(this,(function(e){switch(e.label){case 0:return Ue.isMp?[4,Zc()]:[3,2];case 1:return[2,e.sent()];case 2:return Ue.isMpWeb?[2,Promise.resolve({})]:[2,Promise.reject(je("addRating",{}))]}}))})))]}))}))).apply(this,arguments)}var Fc,Vc=(Fc=Se((function(e,t,n){var r,i;return ke(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,Ze({method:"POST",body:r},i))];case 1:return[4,o.sent().json()];case 2:return[2,o.sent()]}}))})),function(e,t,n){return Fc.apply(this,arguments)}),Gc=function(){var e=Se((function(e){return ke(this,(function(t){return[2,new Promise((function(t,n){pn("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)}}(),Hc=[vi({oaId:ni()})];function Kc(e){return Jc.apply(this,arguments)}function Jc(){return Jc=Se((function(e){return ke(this,(function(t){return[2,kn("interactOA",Hc,[e],function(){var e=Se((function(e){var t,n,r;return ke(this,(function(i){switch(i.label){case 0:return Ue.isMp?(t=e.oaId,[4,mn.getAccessToken()]):[3,5];case 1:return!(n=i.sent())||Et.isEmpty(n)?[3,3]:[4,Vc(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,Gc(t)];case 4:return[2,i.sent()];case 5:return Ue.isMpWeb?[2,Promise.resolve({})]:[2,Promise.reject(je("interactOA",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Jc.apply(this,arguments)}var qc=[vi({oaId:ni()})];function Qc(e){return $c.apply(this,arguments)}function $c(){return $c=Se((function(e){return ke(this,(function(t){return[2,kn("isAllowedInteractWithOA",qc,[e],function(){var e=Se((function(e){var t,n,r;return ke(this,(function(i){switch(i.label){case 0:return Ue.isMp?(t=e.oaId,[4,mn.getAccessToken()]):[3,4];case 1:return!(n=i.sent())||Et.isEmpty(n)?[3,3]:[4,Vc(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 Ue.isMpWeb?[2,Promise.resolve({status:!1})]:[2,Promise.reject(je("IsAllowedInteractWithOA",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),$c.apply(this,arguments)}function Yc(e){return Xc.apply(this,arguments)}function Xc(){return(Xc=Se((function(e){return ke(this,(function(t){return[2,kn("getSetting",[],[e],Se((function(){return ke(this,(function(e){switch(e.label){case 0:return Ue.isMp?[4,un()]:[3,2];case 1:return[2,e.sent()];case 2:return Ue.isMpWeb?[2,Promise.resolve({authSetting:{}})]:[2,Promise.reject(je("getSetting",{}))]}}))})))]}))}))).apply(this,arguments)}var el=ji.enum(["scope.userInfo","scope.userLocation","scope.userPhonenumber"]),tl=[vi({scopes:ji.array(el).max(2).optional()}).optional()];function nl(e){return rl.apply(this,arguments)}function rl(){return rl=Se((function(e){return ke(this,(function(t){return[2,kn("authorize",tl,[e],function(){var e=Se((function(e){var t;return ke(this,(function(n){switch(n.label){case 0:return Ue.isMp?(t=null==e?void 0:e.scopes,tn(724,573)?[2,Promise.reject(ln.error.clientNotSupport())]:[4,fn(null!=t?t:void 0)]):[3,2];case 1:return[2,n.sent()];case 2:return Ue.isMpWeb?[2,Promise.resolve({})]:[2,Promise.reject(je("authorize",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),rl.apply(this,arguments)}var il=Se((function(){return ke(this,(function(e){return[2,new Promise(function(){var e=Se((function(e,t){var n;return ke(this,(function(r){switch(r.label){case 0:return Et.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(ln.error.clientNotSupport()),[2]}}))}));return function(t,n){return e.apply(this,arguments)}}())]}))}));function ol(e){return kn("checkZaloCameraPermission",[],[e],Se((function(){return ke(this,(function(e){switch(e.label){case 0:return[4,il()];case 1:return[2,e.sent()]}}))})))}var al=Se((function(){return ke(this,(function(e){return[2,new Promise(function(){var e=Se((function(e,t){var n,r,i;return ke(this,(function(o){switch(o.label){case 0:return o.trys.push([0,2,,3]),[4,mn.jumpAndGetToken()];case 1:return o.sent(),r=null===(n=mn.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 sl(e){return ul.apply(this,arguments)}function ul(){return(ul=Se((function(e){return ke(this,(function(t){return[2,kn("getUserID",[],[e],Se((function(){return ke(this,(function(e){switch(e.label){case 0:return Ue.isMp?[4,al()]:[3,2];case 1:return[2,e.sent()];case 2:return Ue.isMpWeb?[2,Promise.resolve(void 0)]:[2,Promise.reject(je("getUserID",{}))]}}))})))]}))}))).apply(this,arguments)}var cl=Se((function(){return ke(this,(function(e){return[2,new Promise(function(){var e=Se((function(e,t){var n,r,i;return ke(this,(function(o){switch(o.label){case 0:return o.trys.push([0,2,,3]),[4,mn.jumpAndGetToken()];case 1:return o.sent(),r=null===(n=mn.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 ll(e){return dl.apply(this,arguments)}function dl(){return(dl=Se((function(e){return ke(this,(function(t){return[2,kn("getIDToken",[],[e],Se((function(){return ke(this,(function(e){switch(e.label){case 0:return Ue.isMp?[4,cl()]:[3,2];case 1:return[2,e.sent()];case 2:return Ue.isMpWeb?[2,Promise.resolve(void 0)]:[2,Promise.reject(je("getIDToken",{}))]}}))})))]}))}))).apply(this,arguments)}var pl={format:e.PhotoFormat.JPEG,quality:e.PhotoQuality.NORMAL,mirrored:!1,useVideoSourceSize:!1},fl={width:1024,height:768,facingMode:e.FacingMode.FRONT,mirrored:!1,audio:!1,video:!0},hl=function(){function t(n){var r,i,o,a,s,u=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,c=this;St(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};Bt.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:fl.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:fl.mirrored,this._userRequestFrameCallback=!1,this._audioEnabled=null!==(a=null==u?void 0:u.audio)&&void 0!==a?a:fl.audio,this._videoEnabled=null!==(s=null==u?void 0:u.video)&&void 0!==s?s:fl.video}var n=t.prototype;return n.on=function(t,n){Bt.getInstance().on(t,(function(e){n(e)})),t===e.CameraEvents.OnFrameCallback&&(this._userRequestFrameCallback=!0,this.tick())},n.off=function(t){Bt.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 Se((function(){return ke(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 Se((function(){var n,r,i,o,a,s;return ke(this,(function(u){switch(u.label){case 0:return Et.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||fl.width,this._videoElement.height=(null==e?void 0:e.height)||this._videoElement.height||fl.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 Se((function(){return ke(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 Se((function(){var n,r;return ke(this,(function(i){return n=Bt.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=Se((function(n,r){var i;return ke(this,(function(o){switch(o.label){case 0:return o.trys.push([0,2,,3]),[4,t.stream()];case 1:return o.sent(),Bt.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 Se((function(){return ke(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 Se((function(){return ke(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=Se((function(n){return ke(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 Se((function(){return ke(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 Se((function(){return ke(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 Se((function(){return ke(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(),Bt.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||pl.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}(),ml=vi({play:ji.function(),pause:ji.function()}).refine((function(e){return"play"in e&&"pause"in e}),{message:"Invalid HTMLVideoElement"}),vl=[vi({videoElement:ml,mediaConstraints:ji.object({width:ji.number().min(100).optional(),height:ji.number().min(100).optional(),facingMode:ji.string().optional(),audio:ji.boolean().optional(),video:ji.boolean().optional(),deviceId:ji.string().optional(),mirrored:ji.boolean().optional()}).nullish()}).optional()];function yl(e){return kn("createCameraContext",vl,[e],(function(e){return new hl(e.videoElement,e.mediaConstraints)}))}var gl=function(){function e(){var t,n;St(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=Oe(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;Et.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?Et.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?Et.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 _l(e){return wl.apply(this,arguments)}function wl(){return(wl=Se((function(e){return ke(this,(function(t){return[2,kn("setupAd",[],[e],(function(){return gl.getInstance().loadSDK()}))]}))}))).apply(this,arguments)}var Tl=[vi({ids:ji.union([ji.string(),ji.array(ji.string())]),config:vi({display:ji.boolean().optional(),onClose:ji.function().optional()}).optional()})];function bl(e){return El.apply(this,arguments)}function El(){return El=Se((function(e){return ke(this,(function(t){return[2,kn("loadAd",Tl,[e],function(){var e=Se((function(e){return ke(this,(function(t){return gl.getInstance().load(e.ids,e.config),[2]}))}));return function(t){return e.apply(this,arguments)}}())]}))})),El.apply(this,arguments)}var Sl=[vi({id:ji.string()})];function Pl(e){return Il.apply(this,arguments)}function Il(){return Il=Se((function(e){return ke(this,(function(t){return[2,kn("displayAd",Sl,[e],function(){var e=Se((function(e){return ke(this,(function(t){return gl.getInstance().display(e.id),[2]}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Il.apply(this,arguments)}var Al=[vi({id:ji.string().optional()}).optional()];function Ol(e){return kl.apply(this,arguments)}function kl(){return kl=Se((function(e){return ke(this,(function(t){return[2,kn("refreshAd",Al,[e],function(){var e=Se((function(e){return ke(this,(function(t){return gl.getInstance().refresh(e.id),[2]}))}));return function(t){return e.apply(this,arguments)}}())]}))})),kl.apply(this,arguments)}var Nl=[vi({id:ni(),guidingText:ni().optional(),color:ni().optional(),onStatusChange:ji.function().optional()})];function Cl(e){return Ml.apply(this,arguments)}function Ml(){return Ml=Se((function(e){return ke(this,(function(n){return[2,kn("showOAWidget",Nl,[e],function(){var e=Se((function(e){var n,r,i,o,a,s,u,c;return ke(this,(function(l){if(Ue.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=ze(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=Se((function(e){var t,n,i,o,a,s,l,d;return ke(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,mn.jumpAndGetToken()]):[3,3];case 1:return p.sent(),l=null===(a=mn.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?sa(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 Ue.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(je("openMiniApp",{}))]}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Ml.apply(this,arguments)}var Rl=[vi({id:ni(),type:ni(),text:ni(),color:ni().optional(),disabled:ji.boolean().optional(),onDataReceived:ji.function().optional(),onError:ji.function().optional()})];function xl(e){return Dl.apply(this,arguments)}function Dl(){return Dl=Se((function(e){return ke(this,(function(n){return[2,kn("showFunctionButtonWidget",Rl,[e],function(){var e=Se((function(e){var n,r,i,o,a,s,u;return ke(this,(function(c){if(Ue.isMp){try{n=document.getElementById(e.id),r=e.onDataReceived,i=e.onError,o=t(e,["onDataReceived","onError"]),n&&(a=document.createElement("iframe"),s="ifFBW-".concat(e.id,"-").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=ze(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=ze(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=Se((function(e){var t,n,a,c,l,d,p,f,h,m,v,y;return ke(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,mn.jumpAndGetToken()]):[3,4];case 1:return g.sent(),f=null===(l=mn.miniProgramConfig)||void 0===l?void 0:l.jwt,h=null===(d=mn.miniProgramConfig)||void 0===d?void 0:d.encryptKey,[4,Mn()];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 Ue.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(je("openMiniApp",{}))]}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Dl.apply(this,arguments)}var Ul=function(){var t=Se((function(t,n){var r;return ke(this,(function(i){return r={},"cccd"===t&&(r={mrz:null==n?void 0:n.mrz}),[2,new Promise((function(n,i){pn("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)}}(),Ll=[vi({type:ji.enum(["cccd"]),data:vi({mrz:ni().max(90)})})];function jl(e){return Bl.apply(this,arguments)}function Bl(){return Bl=Se((function(e){return ke(this,(function(t){return[2,kn("scanNFC",Ll,[e],function(){var e=Se((function(e){var t,n;return ke(this,(function(r){switch(r.label){case 0:return Ue.isMp?tn(754,620)?[2,Promise.reject(ln.error.clientNotSupport())]:(t=e.type,n=e.data,[4,Ul(t,n)]):[3,2];case 1:return[2,r.sent()];case 2:return Ue.isMpWeb?[2,Promise.resolve({})]:[2,Promise.reject(je("scanNFC",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Bl.apply(this,arguments)}var Zl=Se((function(){return ke(this,(function(e){return[2,new Promise((function(e,t){pn("CHECK_NFC",{},{success:function(t){e(t)},fail:function(e){t(e)}},{timeout:!1})}))]}))}));function zl(e){return Wl.apply(this,arguments)}function Wl(){return(Wl=Se((function(e){return ke(this,(function(t){return[2,kn("checkNFC",[],[e],Se((function(){return ke(this,(function(e){switch(e.label){case 0:return Ue.isMp?[4,Zl()]:[3,2];case 1:return[2,e.sent()];case 2:return Ue.isMpWeb?[2,Promise.resolve({})]:[2,Promise.reject(je("checkNFC",{}))]}}))})))]}))}))).apply(this,arguments)}var Fl=[ji.string().trim().min(1)];var Vl=[ji.string().trim().min(1),ji.string().trim()];var Gl=[ji.string().trim().min(1)];var Hl={getItem:function(e){return kn("getItem",Fl,[e],(function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];if(Ue.isMp||Ue.isMpWeb){if(tn(757,625))throw ln.error.clientNotSupport();return wo.getItem(t[0])}throw je("getItem",{})}))},setItem:function(e,t){return kn("setItem",Vl,[e,t],(function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];if(Ue.isMp||Ue.isMpWeb){if(tn(757,625))throw ln.error.clientNotSupport();return wo.setItem(t[0],t[1])}throw je("setItem",{})}))},clear:function(){return kn("clear",[],[],(function(){if(Ue.isMp||Ue.isMpWeb){if(tn(757,625))throw ln.error.clientNotSupport();return wo.clearStorageSync()}throw je("clear",{})}))},removeItem:function(e){return kn("removeItem",Gl,[e],(function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];if(Ue.isMp||Ue.isMpWeb){if(tn(757,625))throw ln.error.clientNotSupport();return wo.removeItem(t[0])}throw je("removeItem",{})}))},getStorageInfo:function(){return kn("getStorageInfoSync",[],[],(function(){if(Ue.isMp||Ue.isMpWeb){if(tn(757,625))throw ln.error.clientNotSupport();return wo.getStorageInfoSync()}throw je("getStorageInfoSync",{})}))}},Kl={purchase:ec,createOrder:qu,checkTransaction:sc,createOrderIAP:dc,selectPaymentMethod:ic},Jl=Kl,ql=function(){var e=Se((function(e,t){return ke(this,(function(n){return[2,new Promise((function(n,r){pn("SAVE_FILE",{fileUrl:e,onProgress:t},{success:function(e){n()},fail:function(e){r(e)}},{})}))]}))}));return function(t,n){return e.apply(this,arguments)}}(),Ql=[vi({url:ji.string().url()}).optional()];function $l(e){return Yl.apply(this,arguments)}function Yl(){return Yl=Se((function(e){return ke(this,(function(t){return[2,kn("downloadFile",Ql,[e],function(){var e=Se((function(e){var t;return ke(this,(function(n){switch(n.label){case 0:return Ue.isMp?(t=e.url,[4,ql(t,e.onProgress)]):[3,2];case 1:return[2,n.sent()];case 2:return Ue.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(je("downloadFile",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Yl.apply(this,arguments)}var Xl=ji.enum(["APP_INITIALIZING","APP_READY"]),ed=ji.any();var td={logEvent:function(e,t){return kn("logEvent",[Xl,ed],[e,t],(function(e,t){if(Ue.isMp||Ue.isMpWeb){var n=ma(Ze({},"object"==typeof t&&null!==t?t:{}),{duration:Math.round(performance.now()),timestamp:Date.now()});return $t([{action:"zmp.app.lifecycle.tracking",error:0,message:"",data:Ze({eventType:e},n)}])}throw je("logEvent",{})}))}};window.ZaloMiniAppSDK={getVersion:Un},Nn();var nd=Object.freeze({__proto__:null,get Events(){return e.Events},get EventName(){return e.Events},get CameraEvents(){return e.CameraEvents},login:Nn,getAccessToken:Mn,getVersion:Un,getSystemInfo:jn,setNavigationBarTitle:Wi,setNavigationBarColor:Gi,setNavigationBarLeftButton:Ji,setStorage:bo,getStorage:Po,getStorageInfo:Ao,removeStorage:No,clearStorage:Ro,getUserInfo:Lo,getNetworkType:zo,onNetworkStatusChange:Vo,startBeaconDiscovery:Ko,stopBeaconDiscovery:Qo,getBeacons:Xo,closeApp:na,scanQRCode:oa,openProfile:ca,openChat:fa,openPostFeed:ga,followOA:ba,unfollowOA:Ia,openShareSheet:Ca,requestCameraPermission:xa,createShortcut:Za,openBioAuthentication:Va,checkStateBioAuthentication:Ka,showToast:$a,hideKeyboard:es,openPhone:is,openSMS:us,viewOAQr:ps,keepScreen:vs,onKeepScreen:gs,offKeepScreen:ws,saveImageToGallery:Ss,saveVideoToGallery:Os,openMiniApp:Ms,vibrate:Us,openWebview:Zs,getRouteParams:Fs,getAppInfo:Vs,sendDataToPreviousMiniApp:Js,getPhoneNumber:$s,openProfilePicker:tu,connectWifi:ou,openMediaPicker:cu,getShareableLink:pu,closeLoading:mu,requestUpdateZalo:yu,onConfirmToExit:Tu,offConfirmToExit:bu,getDeviceId:Eu,getDeviceIdAsync:Su,getContext:Iu,getContextAsync:Au,getAuthCode:ku,getZPIToken:Cu,setAccessToken:xu,openOutApp:Uu,chooseImage:Bu,getLocation:Wu,onCallbackData:Gu,createOrder:qu,purchase:ec,selectPaymentMethod:ic,checkTransaction:sc,createOrderIAP:dc,events:_u,setAndroidBottomNavigationBar:hc,setIOSBottomSafeArea:yc,setStatusBar:wc,configAppView:Ec,minimizeApp:Ic,openPermissionSetting:kc,favoriteApp:Mc,openGroupList:Dc,requestSendNotification:jc,addRating:zc,interactOA:Kc,interactOa:Kc,isAllowedInteractWithOA:Qc,getSetting:Yc,authorize:nl,checkZaloCameraPermission:ol,getUserID:sl,getIDToken:ll,createCameraContext:yl,setupAd:_l,loadAd:bl,displayAd:Pl,refreshAd:Ol,showOAWidget:Cl,showFunctionButtonWidget:xl,scanNFC:jl,checkNFC:zl,nativeStorage:Hl,Payment:Kl,CheckoutSDK:Jl,downloadFile:$l,trackingManager:td,get FacingMode(){return e.FacingMode},get PhotoFormat(){return e.PhotoFormat},get PhotoQuality(){return e.PhotoQuality},get StreamType(){return e.StreamType},ZMACameraImp:hl}),rd=t(nd,["createOrder","checkTransaction","createOrderIAP","selectPaymentMethod","purchase"]);!function(){var e,t=null===(e=De())||void 0===e?void 0:e.appEnv;(null==t?void 0:t.isMp)&&(window.ZaloMiniAppSDK={},Object.assign(window.ZaloMiniAppSDK,nd))}(),e.CheckoutSDK=Jl,e.EventName=e.Events,e.Payment=Kl,e.ZMACameraImp=hl,e.addRating=zc,e.authorize=nl,e.checkNFC=zl,e.checkStateBioAuthentication=Ka,e.checkTransaction=sc,e.checkZaloCameraPermission=ol,e.chooseImage=Bu,e.clearStorage=Ro,e.closeApp=na,e.closeLoading=mu,e.configAppView=Ec,e.connectWifi=ou,e.createCameraContext=yl,e.createOrder=qu,e.createOrderIAP=dc,e.createShortcut=Za,e.default=rd,e.displayAd=Pl,e.downloadFile=$l,e.events=_u,e.favoriteApp=Mc,e.followOA=ba,e.getAccessToken=Mn,e.getAppInfo=Vs,e.getAuthCode=ku,e.getBeacons=Xo,e.getContext=Iu,e.getContextAsync=Au,e.getDeviceId=Eu,e.getDeviceIdAsync=Su,e.getIDToken=ll,e.getLocation=Wu,e.getNetworkType=zo,e.getPhoneNumber=$s,e.getRouteParams=Fs,e.getSetting=Yc,e.getShareableLink=pu,e.getStorage=Po,e.getStorageInfo=Ao,e.getSystemInfo=jn,e.getUserID=sl,e.getUserInfo=Lo,e.getVersion=Un,e.getZPIToken=Cu,e.hideKeyboard=es,e.interactOA=Kc,e.interactOa=Kc,e.isAllowedInteractWithOA=Qc,e.keepScreen=vs,e.loadAd=bl,e.login=Nn,e.minimizeApp=Ic,e.nativeStorage=Hl,e.offConfirmToExit=bu,e.offKeepScreen=ws,e.onCallbackData=Gu,e.onConfirmToExit=Tu,e.onKeepScreen=gs,e.onNetworkStatusChange=Vo,e.openBioAuthentication=Va,e.openChat=fa,e.openGroupList=Dc,e.openMediaPicker=cu,e.openMiniApp=Ms,e.openOutApp=Uu,e.openPermissionSetting=kc,e.openPhone=is,e.openPostFeed=ga,e.openProfile=ca,e.openProfilePicker=tu,e.openSMS=us,e.openShareSheet=Ca,e.openWebview=Zs,e.purchase=ec,e.refreshAd=Ol,e.removeStorage=No,e.requestCameraPermission=xa,e.requestSendNotification=jc,e.requestUpdateZalo=yu,e.saveImageToGallery=Ss,e.saveVideoToGallery=Os,e.scanNFC=jl,e.scanQRCode=oa,e.selectPaymentMethod=ic,e.sendDataToPreviousMiniApp=Js,e.setAccessToken=xu,e.setAndroidBottomNavigationBar=hc,e.setIOSBottomSafeArea=yc,e.setNavigationBarColor=Gi,e.setNavigationBarLeftButton=Ji,e.setNavigationBarTitle=Wi,e.setStatusBar=wc,e.setStorage=bo,e.setupAd=_l,e.showFunctionButtonWidget=xl,e.showOAWidget=Cl,e.showToast=$a,e.startBeaconDiscovery=Ko,e.stopBeaconDiscovery=Qo,e.trackingManager=td,e.unfollowOA=Ia,e.vibrate=Us,e.viewOAQr=ps,Object.defineProperty(e,"__esModule",{value:!0})}));
|