zmp-sdk 2.47.0-beta.8 → 2.47.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index.umd.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @timeBuild 16-07-2025 15:28:29
2
+ * @timeBuild 01-08-2025 09:49:24
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=0,m=-2e3,v=-1400,y=-1500,g=-1401,_=-1404,w=-1408,T=-1409,b=-2004,E=-2005,P=-2006,S=-2007,I="Success",A="Unknown error. Please try again later.",O="Request limit exceeded. Please try again later.",C="Request timeout. Please try again later.",k="Please login (https://miniapp.zalo.me/docs/api/login) before to call this api",N="Login failed",M="This API is not supported in this version of Zalo",R="User Authentication Required. Please grant User Authentication permission before requesting User Permission",x="Unable to pick media",D="Unable to save image",U="Unable to save video",L="Unable to save file",j={SUCCESS:{code:h,message:I},UNKNOWN_ERROR:{code:m,message:A},UNAUTHORIZED:{code:g,message:k},FORBIDDEN:{code:-1403,message:"You don't have permission to call this api"},CLIENT_NOT_SUPPORT:{code:_,message:M},DECODE_FAILED:{code:-2001,message:"Can not decode id. Please check your params again."},TIME_OUT:{code:w,message:C},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"}},B={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:{}},Z={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:j.DUPLICATE_REQUEST}},iOS:{"-400":{mapTo:j.DUPLICATE_REQUEST}}}},UNFOLLOW_OA:{haveCallback:!0,requireAccessToken:!0,errorList:{android:{"-400":{mapTo:j.DUPLICATE_REQUEST}},iOS:{"-400":{mapTo:j.DUPLICATE_REQUEST}}}},OPEN_GAMEDETAIL:{},OPEN_SHARESHEET:{haveCallback:!0,requireAccessToken:!0,errorList:{android:{"-101":{mapTo:j.CLIENT_NOT_SUPPORT}},iOS:{"-101":{mapTo:j.CLIENT_NOT_SUPPORT}}}},REQUEST_PERMISSION_CAMERA:{errorList:{android:{"-2":{mapTo:j.USER_DENIED}},iOS:{"-2":{mapTo:j.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:j.USER_DENIED},"-400":{mapTo:j.DUPLICATE_REQUEST}},iOS:{"-1":{mapTo:j.USER_DENIED},"-400":{mapTo:j.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:j.UNKNOWN_ERROR},"-10":{mapTo:j.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:P,message:U},needMoreDetail:!0},"-102":{mapTo:{code:P,message:U},needMoreDetail:!0}},iOS:{"-10":{mapTo:{code:P,message:U},needMoreDetail:!0}}}},INTERACTIVE_VIBRATION:{},SAVE_IMAGE_GALLERY:{versionLive:{iOS:408},errorList:{android:{"-101":{mapTo:{code:E,message:D},needMoreDetail:!0},"-102":{mapTo:{code:E,message:D},needMoreDetail:!0}},iOS:{"-10":{mapTo:{code:E,message:D},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:j.MPDS_ACTION_INVALID},"-101":{mapTo:j.UNKNOWN_ERROR},"-105":{mapTo:j.MPDS_SOURCE_INVALID},"-106":{mapTo:j.MPDS_APPID_INVALID}},iOS:{"-10":{mapTo:j.MPDS_ACTION_INVALID},"-101":{mapTo:j.MPDS_APPID_INVALID},"-102":{mapTo:j.UNKNOWN_ERROR}}}},ZBROWSER_MPDS_SYNC:{versionLive:{iOS:402},errorList:{android:{"-100":{mapTo:j.MPDS_ACTION_INVALID},"-101":{mapTo:j.UNKNOWN_ERROR},"-105":{mapTo:j.MPDS_SOURCE_INVALID},"-106":{mapTo:j.MPDS_APPID_INVALID}},iOS:{"-10":{mapTo:j.MPDS_ACTION_INVALID},"-101":{mapTo:j.MPDS_APPID_INVALID},"-102":{mapTo:j.UNKNOWN_ERROR}}}},WEBVIEW_SET_RESULT:{versionLive:{iOS:416}},MP_GET_NUMBER:{versionLive:{iOS:416},errorList:{android:{"-1":{mapTo:j.USER_DENIED},"-101":{mapTo:j.USER_DENIED},"-400":{mapTo:j.DUPLICATE_REQUEST}},iOS:{"-1":{mapTo:j.USER_DENIED},"-10":{mapTo:j.USER_DENIED},"-400":{mapTo:j.DUPLICATE_REQUEST}}}},MP_OPEN_PROFILE_PICKER:{requireAccessToken:!0,versionLive:{iOS:432},errorList:{android:{"-101":{mapTo:j.USER_CANCEL}},iOS:{"-101":{mapTo:j.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:j.USER_CANCEL},999:{mapTo:{code:b,message:x},needMoreDetail:!0}},iOS:{"-10":{mapTo:{code:b,message:x}}}}},MP_CLOSE_LOADINGVIEW:{skipJump:!0},CHANGE_BOTTOMBAR:{haveCallback:!0,timeout:2,skipJump:!0},MA_MENU_MINIMIZE:{skipJump:!1,versionLive:{iOS:520}},MA_MENU_PERMISSION:{skipJump:!1,versionLive:{iOS:520}},MA_MENU_FAVORITES:{skipJump:!1,versionLive:{iOS:520}},MP_SEND_NOTIFICATION:{skipJump:!1,versionLive:{iOS:530},errorList:{android:{"-1":{mapTo:j.USER_DENIED},"-400":{mapTo:j.DUPLICATE_REQUEST}},iOS:{"-1":{mapTo:j.USER_DENIED},"-400":{mapTo:j.DUPLICATE_REQUEST}}}},MP_ADD_RATING:{skipJump:!1},MP_ADD_MYFAVORITES:{skipJump:!1},MP_INTERACT_OA:{skipJump:!1,errorList:{android:{"-400":{mapTo:j.DUPLICATE_REQUEST}},iOS:{"-400":{mapTo:j.DUPLICATE_REQUEST}}}},MP_USER_AUTHORIZE:{skipJump:!1,errorList:{android:{"-400":{mapTo:j.DUPLICATE_REQUEST}},iOS:{"-400":{mapTo:j.DUPLICATE_REQUEST}}}},MP_SELECT_PAYMENT_METHOD:{skipJump:!1},CHECK_NFC:{skipJump:!1,versionLive:{iOS:626},errorList:{all:{"-1":{mapTo:j.UNKNOWN_ERROR},"-600":{mapTo:j.DEVICE_NOT_SUPPORT},"-602":{mapTo:j.SERVICE_NOT_READY}}}},SCAN_NFC:{skipJump:!1,haveCallback:!0,timeout:65,errorList:{all:{"-1":{mapTo:j.UNKNOWN_ERROR},"-600":{mapTo:j.DEVICE_NOT_SUPPORT},"-601":{mapTo:j.SCAN_TIMEOUT},"-602":{mapTo:j.SERVICE_NOT_READY},"-603":{mapTo:j.UNREADABLE},"-604":{mapTo:j.INVALID_MRZ},"-605":{mapTo:j.PROCESSING},"-606":{mapTo:j.CANCEL}}}},MP_CONFIRM_REQUEST_PAYMENT:{skipJump:!1},SAVE_FILE:{versionLive:{iOS:628},skipJump:!1,errorList:{android:{"-101":{mapTo:{code:S,message:L},needMoreDetail:!0},"-102":{mapTo:{code:S,message:L},needMoreDetail:!0}},iOS:{"-10":{mapTo:{code:S,message:L},needMoreDetail:!0}}}},MP_APP_LIFECYCLE_TRACKING:{skipJump:!1}},z={android:{"-4":j.DECODE_FAILED,"-5":j.CLIENT_NOT_SUPPORT,"-14":j.TIME_OUT},iOS:{"-9":j.DECODE_FAILED,"-5":j.CLIENT_NOT_SUPPORT,"-14":j.TIME_OUT}},W={android:12100615,iOS:460,wp:0,unknown:0},F=5*r,G="https://payment-mini.zalo.me/api/order/create-v2",V="https://payment-mini.zalo.me/api/order/iap-create",H="https://payment-mini.zalo.me/api/transaction",K="https://payment-mini.zalo.me/api/order/purchase",J="DEFERRED",q="IMMEDIATE_AND_CHARGE_FULL_PRICE",Q={SHOW_BACK:0,HIDE_BACK:3,SHOW_HOME:1,HIDE_HOME:0},Y=5,$=6,X="#1843EF",ee=0,te={"-12101":"Invalid params","-12102":"Session expire","-12103":"Not permission","-12104":"Not Authorize","-12105":"Unknown exception","-12106":"Cannot create order","-12107":"Transaction not found","-12108":"Cannot update order","-12109":"Cannot decode param","-12110":"Version not support","-12111":"Receipt expire","-12112":"Product not found","-12113":"Subscription other GW","-12114":"Product already subcription","-12115":"Not exist","-12116":"Already exist","-12117":"Not allow","-12118":"Not permit","-12119":"Internal error","-2":"Unable to pay","-6":"Unable to register","-7":"Registered account","-832":"Purchased by another account","-833":"Register for another account","-834":"Unable to register","-2010":"System is maintaining","-3999":"Not in Vietnam","-12129":"Purchased by another account",123:"An error has occurred"};!function(e){e.DEV_TRACKING="devTracking"}(p||(p={})),function(e){e[e.APP_INITIALIZING=95]="APP_INITIALIZING",e[e.APP_READY=96]="APP_READY"}(f||(f={}));var ne,re,ie,oe,ae,se,ue,ce,le,de,pe,fe,he,me,ve,ye,ge,_e,we,Te,be,Ee,Pe,Se="checkoutKitWidget-ifCKW",Ie="https://h5.zalo.me",Ae={CHECKOUT_KIT:"https://h5.zalo.me/widgets/checkoutkit_widget.html",FUNCTION_BUTTON:"https://h5.zalo.me/widgets/function_button_widget.html",OA:"https://h5.zalo.me/widgets/oa_widget.html",CUSTOM_OA:"https://h5.zalo.me/widgets/oa_widget_custom.html"};function Oe(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 Ce(e){return function(){var t=this,n=arguments;return new Promise((function(r,i){var o=e.apply(t,n);function a(e){Oe(o,r,i,a,s,"next",e)}function s(e){Oe(o,r,i,a,s,"throw",e)}a(void 0)}))}}function ke(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 Ne(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function Me(e,t){if(e){if("string"==typeof e)return ke(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)?ke(e,t):void 0}}function Re(e){return function(e){if(Array.isArray(e))return ke(e)}(e)||Ne(e)||Me(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 xe(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 De(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,Re(n))}catch(e){return"undefined"!=typeof console&&console.error&&console.error(e),null}}}function Ue(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")}}De.async=function(e){return Ce((function(){var t,n,r,i,o=arguments;return xe(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,Re(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,(ne=e.NetworkType||(e.NetworkType={})).none="none",ne.wifi="wifi",ne.cellular="cellular",ne.unknown="unknown",e.PlatformType=void 0,(re=e.PlatformType||(e.PlatformType={})).wp="wp",re.android="android",re.iOS="iOS",re.unknown="unknown",e.Events=void 0,(ie=e.Events||(e.Events={})).AppPaused="h5.event.paused",ie.AppResumed="h5.event.resumed",ie.NetworkChanged="h5.event.connection.changed",ie.OnDataCallback="h5.event.webview.result",ie.WebviewClosed="h5.event.webview.close",ie.OpenApp="h5.event.open.mp",ie.AppClose="h5.event.action.close",ie.PaymentCallback="payment.callback",ie.PaymentResult="action.payment.result",ie.PaymentDone="action.payment.done",ie.PaymentClose="action.payment.close",ie.DownloadProgress="h5.event.webview.download.progress",e.JumpStatus=void 0,(oe=e.JumpStatus||(e.JumpStatus={})).DOING="doing",oe.DONE="done",e.ProfileType=void 0,(ae=e.ProfileType||(e.ProfileType={}))[ae.user=1]="user",ae[ae.oa=0]="oa",ae[ae.aliasOA=2]="aliasOA",e.ChatType=void 0,(se=e.ChatType||(e.ChatType={}))[se.user=1]="user",se[se.oa=0]="oa",e.PostFeedType=void 0,(ue=e.PostFeedType||(e.PostFeedType={}))[ue.image=1]="image",ue[ue.multi_image=2]="multi_image",ue[ue.link=4]="link",ue[ue.profile=5]="profile",e.ScanNFCType=void 0,(ce=e.ScanNFCType||(e.ScanNFCType={}))[ce.cccd=1]="cccd",e.ShareSheetType=void 0,(le=e.ShareSheetType||(e.ShareSheetType={}))[le.image=1]="image",le[le.gif=11]="gif",le[le.video=12]="video",le[le.link=4]="link",le[le.oa=5]="oa",le[le.zmp=20]="zmp",le[le.multi_image=21]="multi_image",le[le.zmp_deep_link=4]="zmp_deep_link",le[le.text=22]="text",e.OrientationType=void 0,(de=e.OrientationType||(e.OrientationType={}))[de.auto=1]="auto",de[de.portrait=2]="portrait",de[de.landscape=3]="landscape",e.VibrateType=void 0,(pe=e.VibrateType||(e.VibrateType={}))[pe.oneShot=0]="oneShot",e.MediaPickerType=void 0,(fe=e.MediaPickerType||(e.MediaPickerType={}))[fe.zcamera=3]="zcamera",fe[fe.zcamera_photo=1]="zcamera_photo",fe[fe.zcamera_video=2]="zcamera_video",fe[fe.zcamera_scan=7]="zcamera_scan",fe[fe.photo=4]="photo",fe[fe.video=5]="video",fe[fe.file=6]="file",e.IAPPayType=void 0,(he=e.IAPPayType||(e.IAPPayType={})).SUBSCRIPTION="SUBSCRIPTION",he.ONETIME="ONETIME",e.ProrationMode=void 0,(me=e.ProrationMode||(e.ProrationMode={}))[me.UNKNOW=0]="UNKNOW",me[me.DEFERRED=1]="DEFERRED",me[me.IMMEDIATE_AND_CHARGE_FULL_PRICE=2]="IMMEDIATE_AND_CHARGE_FULL_PRICE",e.StatusBarType=void 0,(ve=e.StatusBarType||(e.StatusBarType={}))[ve.normal=1]="normal",ve[ve.hidden=0]="hidden",ve[ve.transparent=2]="transparent",e.AndroidBottomNavigationBarType=void 0,(ye=e.AndroidBottomNavigationBarType||(e.AndroidBottomNavigationBarType={}))[ye.show=1]="show",ye[ye.hide=0]="hide",e.IOSSafeAreaBottomType=void 0,(ge=e.IOSSafeAreaBottomType||(e.IOSSafeAreaBottomType={}))[ge.show=1]="show",ge[ge.hide=0]="hide",e.TextAlignType=void 0,(_e=e.TextAlignType||(e.TextAlignType={}))[_e.left=0]="left",_e[_e.center=1]="center",e.CameraEvents=void 0,(we=e.CameraEvents||(e.CameraEvents={})).OnFrameCallback="h5.event.camera.frame",we.OnStartCallback="h5.event.camera.start",we.OnStopCallback="h5.event.camera.stop",e.FacingMode=void 0,(Te=e.FacingMode||(e.FacingMode={})).FRONT="user",Te.BACK="environment",e.PhotoFormat=void 0,(be=e.PhotoFormat||(e.PhotoFormat={})).WEBP="image/webp",be.PNG="image/png",be.JPEG="image/jpeg",e.PhotoQuality=void 0,(Ee=e.PhotoQuality||(e.PhotoQuality={})).HIGH="high",Ee.NORMAL="normal",Ee.LOW="low",e.StreamType=void 0,(Pe=e.StreamType||(e.StreamType={})).VIDEO="video",Pe.AUDIO="audio";var Le,je=function(t){return t.isAndroid?e.PlatformType.android:t.isIOS?e.PlatformType.iOS:e.PlatformType.unknown};function Be(e){var t=e.split("zalo")[1];return t&&t.replace(" ","").split("/")[1]||""}function Ze(){var e=function(){var e=De((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:Ue(),platform:t,platformName:je(t),zaloVersion:Be(e).trim()}}}();if(e)return e}var ze=(null===(Le=Ze())||void 0===Le?void 0:Le.appEnv)||{};function We(e){We.on&&We.engine(e)}We.on=!1,We.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 Fe=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),We({stage:n.NOT_FOUND,type:"error",name:e,request:t,state:"fail",response:i})};function Ge(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Ve(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){Ge(e,t,n[t])}))}return e}function He(e,t){return function(e){if(Array.isArray(e))return e}(e)||Ne(e)||Me(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 Ke="undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{};function Je(){throw new Error("setTimeout has not been defined")}function qe(){throw new Error("clearTimeout has not been defined")}var Qe=Je,Ye=qe;function $e(e){if(Qe===setTimeout)return setTimeout(e,0);if((Qe===Je||!Qe)&&setTimeout)return Qe=setTimeout,setTimeout(e,0);try{return Qe(e,0)}catch(t){try{return Qe.call(null,e,0)}catch(t){return Qe.call(this,e,0)}}}"function"==typeof Ke.setTimeout&&(Qe=setTimeout),"function"==typeof Ke.clearTimeout&&(Ye=clearTimeout);var Xe,et=[],tt=!1,nt=-1;function rt(){tt&&Xe&&(tt=!1,Xe.length?et=Xe.concat(et):nt=-1,et.length&&it())}function it(){if(!tt){var e=$e(rt);tt=!0;for(var t=et.length;t;){for(Xe=et,et=[];++nt<t;)Xe&&Xe[nt].run();nt=-1,t=et.length}Xe=null,tt=!1,function(e){if(Ye===clearTimeout)return clearTimeout(e);if((Ye===qe||!Ye)&&clearTimeout)return Ye=clearTimeout,clearTimeout(e);try{Ye(e)}catch(t){try{return Ye.call(null,e)}catch(t){return Ye.call(this,e)}}}(e)}}function ot(e,t){this.fun=e,this.array=t}ot.prototype.run=function(){this.fun.apply(null,this.array)};function at(){}var st=at,ut=at,ct=at,lt=at,dt=at,pt=at,ft=at;var ht=Ke.performance||{},mt=ht.now||ht.mozNow||ht.msNow||ht.oNow||ht.webkitNow||function(){return(new Date).getTime()};var vt=new Date;var yt,gt={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];et.push(new ot(e,t)),1!==et.length||tt||$e(it)},title:"browser",browser:!0,env:{},argv:[],version:"",versions:{},on:st,addListener:ut,once:ct,off:lt,removeListener:dt,removeAllListeners:pt,emit:ft,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*mt.call(ht),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-vt)/1e3}},_t=gt,wt="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function Tt(e){return e&&e.constructor===Symbol?"symbol":typeof e}function bt(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 wt?wt:"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 _t&&_t.env&&"true"===_t.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(!G(e))throw new TypeError;if(!H(t))throw new TypeError;return P(e,t)}if(!G(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),S(e,t,n=F(n),r)}function m(e,t){function n(n,r){if(!j(n))throw new TypeError;if(!D(r)&&!K(r))throw new TypeError;N(e,t,n,r)}return n}function v(e,t,n,r){if(!j(n))throw new TypeError;return D(r)||(r=F(r)),N(e,t,n,r)}function y(e,t,n){if(!j(t))throw new TypeError;return D(n)||(n=F(n)),A(e,t,n)}function g(e,t,n){if(!j(t))throw new TypeError;return D(n)||(n=F(n)),O(e,t,n)}function _(e,t,n){if(!j(t))throw new TypeError;return D(n)||(n=F(n)),C(e,t,n)}function w(e,t,n){if(!j(t))throw new TypeError;return D(n)||(n=F(n)),k(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 P(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 S(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 C(e,t,n){if(O(e,t,n))return k(e,t,n);var r=X(t);return U(r)?void 0:C(e,r,n)}function k(e,t,n){var r=I(t,n,!1);if(!D(r))return r.get(e)}function N(e,t,n,r){I(n,r,!0).set(e,t)}function M(e,t){var n=R(e,t),r=X(e);if(null===r)return n;var i=M(r,t);if(i.length<=0)return n;if(n.length<=0)return i;for(var o=new p,a=[],s=0,u=n;s<u.length;s++){var c=u[s];o.has(c)||(o.add(c),a.push(c))}for(var l=0,d=i;l<d.length;l++){c=d[l];o.has(c)||(o.add(c),a.push(c))}return a}function R(e,t){var n=[],r=I(e,t,!1);if(D(r))return n;for(var i=q(r.keys()),o=0;;){var a=Y(i);if(!a)return n.length=o,n;var s=Q(a);try{n[o]=s}catch(e){try{$(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(V(n))if(!j(i=n.call(e)))return i;if(V(r=e.valueOf))if(!j(i=r.call(e)))return i}else{var r;if(V(r=e.valueOf))if(!j(i=r.call(e)))return i;var i,o=e.toString;if(V(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 G(e){return Array.isArray?Array.isArray(e):e instanceof Object?e instanceof Array:"[object Array]"===Object.prototype.toString.call(e)}function V(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(!V(n))throw new TypeError;return n}}function q(e){var t=J(e,i);if(!V(t))throw new TypeError;var n=t.call(e);if(!j(n))throw new TypeError;return n}function Q(e){return e.value}function Y(e){var t=e.next();return!t.done&&t}function $(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)}()}(yt||(yt={}));var Et=Object.prototype.toString;var Pt="[object Null]",St="[object Undefined]";function It(e){return null==e?void 0===e?St:Pt:function(e){return Et.call(e)}(e)}function At(e){return null!=e&&"object"==typeof e}var Ot={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||At(e)&&"[object Number]"==It(e)},isArray:function(e){return Array.isArray(e)},isRegExp:function(e){return At(e)&&"[object RegExp]"==It(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 Ct(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function kt(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 Nt(e){return Nt=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},Nt(e)}function Mt(e){return Nt(e)}function Rt(e,t,n){return Rt="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=Mt(e)););return e}(e,t);if(r){var i=Object.getOwnPropertyDescriptor(r,t);return i.get?i.get.call(n||e):i.value}},Rt(e,t,n)}function xt(e,t,n){return Rt(e,t,n)}function Dt(e,t){return Dt=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},Dt(e,t)}function Ut(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&&Dt(e,t)}function Lt(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function jt(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=Mt(e);if(t){var i=Mt(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return function(e,t){return!t||"object"!==Tt(t)&&"function"!=typeof t?Lt(e):t}(this,n)}}var Bt=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=0,m=-2e3,v=-1400,y=-1500,g=-1401,_=-1404,w=-1408,T=-1409,b=-2004,E=-2005,P=-2006,S=-2007,I="Success",A="Unknown error. Please try again later.",O="Request limit exceeded. Please try again later.",k="Request timeout. Please try again later.",C="Please login (https://miniapp.zalo.me/docs/api/login) before to call this api",N="Login failed",M="This API is not supported in this version of Zalo",R="User Authentication Required. Please grant User Authentication permission before requesting User Permission",x="Unable to pick media",D="Unable to save image",U="Unable to save video",L="Unable to save file",j={SUCCESS:{code:h,message:I},UNKNOWN_ERROR:{code:m,message:A},UNAUTHORIZED:{code:g,message:C},FORBIDDEN:{code:-1403,message:"You don't have permission to call this api"},CLIENT_NOT_SUPPORT:{code:_,message:M},DECODE_FAILED:{code:-2001,message:"Can not decode id. Please check your params again."},TIME_OUT:{code:w,message:k},USER_DENIED:{code:-2002,message:"User denied"},USER_CANCEL:{code:-2003,message:"User cancel"},DUPLICATE_REQUEST:{code:-1410,message:"Duplicate request. Please try again later."},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"}},B={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:{}},Z={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:j.DUPLICATE_REQUEST}},iOS:{"-400":{mapTo:j.DUPLICATE_REQUEST}}}},UNFOLLOW_OA:{haveCallback:!0,requireAccessToken:!0,errorList:{android:{"-400":{mapTo:j.DUPLICATE_REQUEST}},iOS:{"-400":{mapTo:j.DUPLICATE_REQUEST}}}},OPEN_GAMEDETAIL:{},OPEN_SHARESHEET:{haveCallback:!0,requireAccessToken:!0,errorList:{android:{"-101":{mapTo:j.CLIENT_NOT_SUPPORT}},iOS:{"-101":{mapTo:j.CLIENT_NOT_SUPPORT}}}},REQUEST_PERMISSION_CAMERA:{errorList:{android:{"-2":{mapTo:j.USER_DENIED}},iOS:{"-2":{mapTo:j.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:j.USER_DENIED},"-400":{mapTo:j.DUPLICATE_REQUEST}},iOS:{"-1":{mapTo:j.USER_DENIED},"-400":{mapTo:j.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:j.UNKNOWN_ERROR},"-10":{mapTo:j.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:P,message:U},needMoreDetail:!0},"-102":{mapTo:{code:P,message:U},needMoreDetail:!0}},iOS:{"-10":{mapTo:{code:P,message:U},needMoreDetail:!0}}}},INTERACTIVE_VIBRATION:{},SAVE_IMAGE_GALLERY:{versionLive:{iOS:408},errorList:{android:{"-101":{mapTo:{code:E,message:D},needMoreDetail:!0},"-102":{mapTo:{code:E,message:D},needMoreDetail:!0}},iOS:{"-10":{mapTo:{code:E,message:D},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:j.MPDS_ACTION_INVALID},"-101":{mapTo:j.UNKNOWN_ERROR},"-105":{mapTo:j.MPDS_SOURCE_INVALID},"-106":{mapTo:j.MPDS_APPID_INVALID}},iOS:{"-10":{mapTo:j.MPDS_ACTION_INVALID},"-101":{mapTo:j.MPDS_APPID_INVALID},"-102":{mapTo:j.UNKNOWN_ERROR}}}},ZBROWSER_MPDS_SYNC:{versionLive:{iOS:402},errorList:{android:{"-100":{mapTo:j.MPDS_ACTION_INVALID},"-101":{mapTo:j.UNKNOWN_ERROR},"-105":{mapTo:j.MPDS_SOURCE_INVALID},"-106":{mapTo:j.MPDS_APPID_INVALID}},iOS:{"-10":{mapTo:j.MPDS_ACTION_INVALID},"-101":{mapTo:j.MPDS_APPID_INVALID},"-102":{mapTo:j.UNKNOWN_ERROR}}}},WEBVIEW_SET_RESULT:{versionLive:{iOS:416}},MP_GET_NUMBER:{versionLive:{iOS:416},errorList:{android:{"-1":{mapTo:j.USER_DENIED},"-101":{mapTo:j.USER_DENIED},"-400":{mapTo:j.DUPLICATE_REQUEST}},iOS:{"-1":{mapTo:j.USER_DENIED},"-10":{mapTo:j.USER_DENIED},"-400":{mapTo:j.DUPLICATE_REQUEST}}}},MP_OPEN_PROFILE_PICKER:{requireAccessToken:!0,versionLive:{iOS:432},errorList:{android:{"-101":{mapTo:j.USER_CANCEL}},iOS:{"-101":{mapTo:j.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:j.USER_CANCEL},999:{mapTo:{code:b,message:x},needMoreDetail:!0}},iOS:{"-10":{mapTo:{code:b,message:x}}}}},MP_CLOSE_LOADINGVIEW:{skipJump:!0},CHANGE_BOTTOMBAR:{haveCallback:!0,timeout:2,skipJump:!0},MA_MENU_MINIMIZE:{skipJump:!1,versionLive:{iOS:520}},MA_MENU_PERMISSION:{skipJump:!1,versionLive:{iOS:520}},MA_MENU_FAVORITES:{skipJump:!1,versionLive:{iOS:520}},MP_SEND_NOTIFICATION:{skipJump:!1,versionLive:{iOS:530},errorList:{android:{"-1":{mapTo:j.USER_DENIED},"-400":{mapTo:j.DUPLICATE_REQUEST}},iOS:{"-1":{mapTo:j.USER_DENIED},"-400":{mapTo:j.DUPLICATE_REQUEST}}}},MP_ADD_RATING:{skipJump:!1},MP_ADD_MYFAVORITES:{skipJump:!1},MP_INTERACT_OA:{skipJump:!1,errorList:{android:{"-400":{mapTo:j.DUPLICATE_REQUEST}},iOS:{"-400":{mapTo:j.DUPLICATE_REQUEST}}}},MP_USER_AUTHORIZE:{skipJump:!1,errorList:{android:{"-400":{mapTo:j.DUPLICATE_REQUEST}},iOS:{"-400":{mapTo:j.DUPLICATE_REQUEST}}}},MP_SELECT_PAYMENT_METHOD:{skipJump:!1},CHECK_NFC:{skipJump:!1,versionLive:{iOS:626},errorList:{all:{"-1":{mapTo:j.UNKNOWN_ERROR},"-600":{mapTo:j.DEVICE_NOT_SUPPORT},"-602":{mapTo:j.SERVICE_NOT_READY}}}},SCAN_NFC:{skipJump:!1,haveCallback:!0,timeout:65,errorList:{all:{"-1":{mapTo:j.UNKNOWN_ERROR},"-600":{mapTo:j.DEVICE_NOT_SUPPORT},"-601":{mapTo:j.SCAN_TIMEOUT},"-602":{mapTo:j.SERVICE_NOT_READY},"-603":{mapTo:j.UNREADABLE},"-604":{mapTo:j.INVALID_MRZ},"-605":{mapTo:j.PROCESSING},"-606":{mapTo:j.CANCEL}}}},MP_CONFIRM_REQUEST_PAYMENT:{skipJump:!1},SAVE_FILE:{versionLive:{iOS:628},skipJump:!1,errorList:{android:{"-101":{mapTo:{code:S,message:L},needMoreDetail:!0},"-102":{mapTo:{code:S,message:L},needMoreDetail:!0}},iOS:{"-10":{mapTo:{code:S,message:L},needMoreDetail:!0}}}},MP_APP_LIFECYCLE_TRACKING:{skipJump:!1}},z={android:{"-4":j.DECODE_FAILED,"-5":j.CLIENT_NOT_SUPPORT,"-14":j.TIME_OUT},iOS:{"-9":j.DECODE_FAILED,"-5":j.CLIENT_NOT_SUPPORT,"-14":j.TIME_OUT}},W={android:12100615,iOS:460,wp:0,unknown:0},F=5*r,G="https://payment-mini.zalo.me/api/order/create-v2",V="https://payment-mini.zalo.me/api/order/iap-create",H="https://payment-mini.zalo.me/api/transaction",K="https://payment-mini.zalo.me/api/order/purchase",J="DEFERRED",q="IMMEDIATE_AND_CHARGE_FULL_PRICE",Q={SHOW_BACK:0,HIDE_BACK:3,SHOW_HOME:1,HIDE_HOME:0},Y=5,$=6,X="#1843EF",ee=0,te={"-12101":"Invalid params","-12102":"Session expire","-12103":"Not permission","-12104":"Not Authorize","-12105":"Unknown exception","-12106":"Cannot create order","-12107":"Transaction not found","-12108":"Cannot update order","-12109":"Cannot decode param","-12110":"Version not support","-12111":"Receipt expire","-12112":"Product not found","-12113":"Subscription other GW","-12114":"Product already subcription","-12115":"Not exist","-12116":"Already exist","-12117":"Not allow","-12118":"Not permit","-12119":"Internal error","-2":"Unable to pay","-6":"Unable to register","-7":"Registered account","-832":"Purchased by another account","-833":"Register for another account","-834":"Unable to register","-2010":"System is maintaining","-3999":"Not in Vietnam","-12129":"Purchased by another account",123:"An error has occurred"};!function(e){e.DEV_TRACKING="devTracking"}(p||(p={})),function(e){e[e.APP_INITIALIZING=95]="APP_INITIALIZING",e[e.APP_READY=96]="APP_READY"}(f||(f={}));var ne,re,ie,oe,ae,se,ue,ce,le,de,pe,fe,he,me,ve,ye,ge,_e,we,Te,be,Ee,Pe,Se="checkoutKitWidget-ifCKW",Ie="https://h5.zalo.me",Ae={CHECKOUT_KIT:"https://h5.zalo.me/widgets/checkoutkit_widget.html",FUNCTION_BUTTON:"https://h5.zalo.me/widgets/function_button_widget.html",OA:"https://h5.zalo.me/widgets/oa_widget.html",CUSTOM_OA:"https://h5.zalo.me/widgets/oa_widget_custom.html"};function Oe(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 ke(e){return function(){var t=this,n=arguments;return new Promise((function(r,i){var o=e.apply(t,n);function a(e){Oe(o,r,i,a,s,"next",e)}function s(e){Oe(o,r,i,a,s,"throw",e)}a(void 0)}))}}function Ce(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 Ne(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function Me(e,t){if(e){if("string"==typeof e)return Ce(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)?Ce(e,t):void 0}}function Re(e){return function(e){if(Array.isArray(e))return Ce(e)}(e)||Ne(e)||Me(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 xe(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 De(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function Ue(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,Re(n))}catch(e){return"undefined"!=typeof console&&console.error&&console.error(e),null}}}function Le(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")}}Ue.async=function(e){return ke((function(){var t,n,r,i,o=arguments;return xe(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,Re(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,(ne=e.NetworkType||(e.NetworkType={})).none="none",ne.wifi="wifi",ne.cellular="cellular",ne.unknown="unknown",e.PlatformType=void 0,(re=e.PlatformType||(e.PlatformType={})).wp="wp",re.android="android",re.iOS="iOS",re.unknown="unknown",e.Events=void 0,(ie=e.Events||(e.Events={})).AppPaused="h5.event.paused",ie.AppResumed="h5.event.resumed",ie.NetworkChanged="h5.event.connection.changed",ie.OnDataCallback="h5.event.webview.result",ie.WebviewClosed="h5.event.webview.close",ie.OpenApp="h5.event.open.mp",ie.AppClose="h5.event.action.close",ie.PaymentCallback="payment.callback",ie.PaymentResult="action.payment.result",ie.PaymentDone="action.payment.done",ie.PaymentClose="action.payment.close",ie.DownloadProgress="h5.event.webview.download.progress",e.JumpStatus=void 0,(oe=e.JumpStatus||(e.JumpStatus={})).DOING="doing",oe.DONE="done",e.ProfileType=void 0,(ae=e.ProfileType||(e.ProfileType={}))[ae.user=1]="user",ae[ae.oa=0]="oa",ae[ae.aliasOA=2]="aliasOA",e.ChatType=void 0,(se=e.ChatType||(e.ChatType={}))[se.user=1]="user",se[se.oa=0]="oa",e.PostFeedType=void 0,(ue=e.PostFeedType||(e.PostFeedType={}))[ue.image=1]="image",ue[ue.multi_image=2]="multi_image",ue[ue.link=4]="link",ue[ue.profile=5]="profile",e.ScanNFCType=void 0,(ce=e.ScanNFCType||(e.ScanNFCType={}))[ce.cccd=1]="cccd",e.ShareSheetType=void 0,(le=e.ShareSheetType||(e.ShareSheetType={}))[le.image=1]="image",le[le.gif=11]="gif",le[le.video=12]="video",le[le.link=4]="link",le[le.oa=5]="oa",le[le.zmp=20]="zmp",le[le.multi_image=21]="multi_image",le[le.zmp_deep_link=4]="zmp_deep_link",le[le.text=22]="text",e.OrientationType=void 0,(de=e.OrientationType||(e.OrientationType={}))[de.auto=1]="auto",de[de.portrait=2]="portrait",de[de.landscape=3]="landscape",e.VibrateType=void 0,(pe=e.VibrateType||(e.VibrateType={}))[pe.oneShot=0]="oneShot",e.MediaPickerType=void 0,(fe=e.MediaPickerType||(e.MediaPickerType={}))[fe.zcamera=3]="zcamera",fe[fe.zcamera_photo=1]="zcamera_photo",fe[fe.zcamera_video=2]="zcamera_video",fe[fe.zcamera_scan=7]="zcamera_scan",fe[fe.photo=4]="photo",fe[fe.video=5]="video",fe[fe.file=6]="file",e.IAPPayType=void 0,(he=e.IAPPayType||(e.IAPPayType={})).SUBSCRIPTION="SUBSCRIPTION",he.ONETIME="ONETIME",e.ProrationMode=void 0,(me=e.ProrationMode||(e.ProrationMode={}))[me.UNKNOW=0]="UNKNOW",me[me.DEFERRED=1]="DEFERRED",me[me.IMMEDIATE_AND_CHARGE_FULL_PRICE=2]="IMMEDIATE_AND_CHARGE_FULL_PRICE",e.StatusBarType=void 0,(ve=e.StatusBarType||(e.StatusBarType={}))[ve.normal=1]="normal",ve[ve.hidden=0]="hidden",ve[ve.transparent=2]="transparent",e.AndroidBottomNavigationBarType=void 0,(ye=e.AndroidBottomNavigationBarType||(e.AndroidBottomNavigationBarType={}))[ye.show=1]="show",ye[ye.hide=0]="hide",e.IOSSafeAreaBottomType=void 0,(ge=e.IOSSafeAreaBottomType||(e.IOSSafeAreaBottomType={}))[ge.show=1]="show",ge[ge.hide=0]="hide",e.TextAlignType=void 0,(_e=e.TextAlignType||(e.TextAlignType={}))[_e.left=0]="left",_e[_e.center=1]="center",e.OpenProfilePickerType=void 0,(e.OpenProfilePickerType||(e.OpenProfilePickerType={})).TOOL_DEL_FRIEND="tool_del_friend",e.CameraEvents=void 0,(we=e.CameraEvents||(e.CameraEvents={})).OnFrameCallback="h5.event.camera.frame",we.OnStartCallback="h5.event.camera.start",we.OnStopCallback="h5.event.camera.stop",e.FacingMode=void 0,(Te=e.FacingMode||(e.FacingMode={})).FRONT="user",Te.BACK="environment",e.PhotoFormat=void 0,(be=e.PhotoFormat||(e.PhotoFormat={})).WEBP="image/webp",be.PNG="image/png",be.JPEG="image/jpeg",e.PhotoQuality=void 0,(Ee=e.PhotoQuality||(e.PhotoQuality={})).HIGH="high",Ee.NORMAL="normal",Ee.LOW="low",e.StreamType=void 0,(Pe=e.StreamType||(e.StreamType={})).VIDEO="video",Pe.AUDIO="audio";var je,Be=function(t){return t.isAndroid?e.PlatformType.android:t.isIOS?e.PlatformType.iOS:e.PlatformType.unknown};function Ze(e){var t=e.split("zalo")[1];return t&&t.replace(" ","").split("/")[1]||""}function ze(){var e=function(){var e=Ue((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:Le(),platform:t,platformName:Be(t),zaloVersion:Ze(e).trim()}}}();if(e)return e}var We=(null===(je=ze())||void 0===je?void 0:je.appEnv)||{};function Fe(e){Fe.on&&Fe.engine(e)}Fe.on=!1,Fe.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 Ge=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),Fe({stage:n.NOT_FOUND,type:"error",name:e,request:t,state:"fail",response:i})};function Ve(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function He(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){Ve(e,t,n[t])}))}return e}function Ke(e,t){return function(e){if(Array.isArray(e))return e}(e)||Ne(e)||Me(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var Je="undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{};function qe(){throw new Error("setTimeout has not been defined")}function Qe(){throw new Error("clearTimeout has not been defined")}var Ye=qe,$e=Qe;function Xe(e){if(Ye===setTimeout)return setTimeout(e,0);if((Ye===qe||!Ye)&&setTimeout)return Ye=setTimeout,setTimeout(e,0);try{return Ye(e,0)}catch(t){try{return Ye.call(null,e,0)}catch(t){return Ye.call(this,e,0)}}}"function"==typeof Je.setTimeout&&(Ye=setTimeout),"function"==typeof Je.clearTimeout&&($e=clearTimeout);var et,tt=[],nt=!1,rt=-1;function it(){nt&&et&&(nt=!1,et.length?tt=et.concat(tt):rt=-1,tt.length&&ot())}function ot(){if(!nt){var e=Xe(it);nt=!0;for(var t=tt.length;t;){for(et=tt,tt=[];++rt<t;)et&&et[rt].run();rt=-1,t=tt.length}et=null,nt=!1,function(e){if($e===clearTimeout)return clearTimeout(e);if(($e===Qe||!$e)&&clearTimeout)return $e=clearTimeout,clearTimeout(e);try{$e(e)}catch(t){try{return $e.call(null,e)}catch(t){return $e.call(this,e)}}}(e)}}function at(e,t){this.fun=e,this.array=t}at.prototype.run=function(){this.fun.apply(null,this.array)};function st(){}var ut=st,ct=st,lt=st,dt=st,pt=st,ft=st,ht=st;var mt=Je.performance||{},vt=mt.now||mt.mozNow||mt.msNow||mt.oNow||mt.webkitNow||function(){return(new Date).getTime()};var yt=new Date;var gt,_t={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];tt.push(new at(e,t)),1!==tt.length||nt||Xe(ot)},title:"browser",browser:!0,env:{},argv:[],version:"",versions:{},on:ut,addListener:ct,once:lt,off:dt,removeListener:pt,removeAllListeners:ft,emit:ht,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*vt.call(mt),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-yt)/1e3}},wt=_t,Tt="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function bt(e){return e&&e.constructor===Symbol?"symbol":typeof e}function Et(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 Tt?Tt:"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 wt&&wt.env&&"true"===wt.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(!G(e))throw new TypeError;if(!H(t))throw new TypeError;return P(e,t)}if(!G(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),S(e,t,n=F(n),r)}function m(e,t){function n(n,r){if(!j(n))throw new TypeError;if(!D(r)&&!K(r))throw new TypeError;N(e,t,n,r)}return n}function v(e,t,n,r){if(!j(n))throw new TypeError;return D(r)||(r=F(r)),N(e,t,n,r)}function y(e,t,n){if(!j(t))throw new TypeError;return D(n)||(n=F(n)),A(e,t,n)}function g(e,t,n){if(!j(t))throw new TypeError;return D(n)||(n=F(n)),O(e,t,n)}function _(e,t,n){if(!j(t))throw new TypeError;return D(n)||(n=F(n)),k(e,t,n)}function w(e,t,n){if(!j(t))throw new TypeError;return D(n)||(n=F(n)),C(e,t,n)}function 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 P(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 S(e,t,n,r){for(var i=e.length-1;i>=0;--i){var o=(0,e[i])(t,n,r);if(!D(o)&&!U(o)){if(!j(o))throw new TypeError;r=o}}return r}function I(e,t,n){var r=f.get(e);if(D(r)){if(!n)return;r=new d,f.set(e,r)}var i=r.get(t);if(D(i)){if(!n)return;i=new d,r.set(t,i)}return i}function A(e,t,n){if(O(e,t,n))return!0;var r=X(t);return!U(r)&&A(e,r,n)}function O(e,t,n){var r=I(t,n,!1);return!D(r)&&z(r.has(e))}function k(e,t,n){if(O(e,t,n))return C(e,t,n);var r=X(t);return U(r)?void 0:k(e,r,n)}function C(e,t,n){var r=I(t,n,!1);if(!D(r))return r.get(e)}function N(e,t,n,r){I(n,r,!0).set(e,t)}function M(e,t){var n=R(e,t),r=X(e);if(null===r)return n;var i=M(r,t);if(i.length<=0)return n;if(n.length<=0)return i;for(var o=new p,a=[],s=0,u=n;s<u.length;s++){var c=u[s];o.has(c)||(o.add(c),a.push(c))}for(var l=0,d=i;l<d.length;l++){c=d[l];o.has(c)||(o.add(c),a.push(c))}return a}function R(e,t){var n=[],r=I(e,t,!1);if(D(r))return n;for(var i=q(r.keys()),o=0;;){var a=Y(i);if(!a)return n.length=o,n;var s=Q(a);try{n[o]=s}catch(e){try{$(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(V(n))if(!j(i=n.call(e)))return i;if(V(r=e.valueOf))if(!j(i=r.call(e)))return i}else{var r;if(V(r=e.valueOf))if(!j(i=r.call(e)))return i;var i,o=e.toString;if(V(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 G(e){return Array.isArray?Array.isArray(e):e instanceof Object?e instanceof Array:"[object Array]"===Object.prototype.toString.call(e)}function V(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(!V(n))throw new TypeError;return n}}function q(e){var t=J(e,i);if(!V(t))throw new TypeError;var n=t.call(e);if(!j(n))throw new TypeError;return n}function Q(e){return e.value}function Y(e){var t=e.next();return!t.done&&t}function $(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)}()}(gt||(gt={}));var Pt=Object.prototype.toString;var St="[object Null]",It="[object Undefined]";function At(e){return null==e?void 0===e?It:St:function(e){return Pt.call(e)}(e)}function Ot(e){return null!=e&&"object"==typeof e}var kt={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||Ot(e)&&"[object Number]"==At(e)},isArray:function(e){return Array.isArray(e)},isRegExp:function(e){return Ot(e)&&"[object RegExp]"==At(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 Ct(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Nt(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 Mt(e){return Mt=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},Mt(e)}function Rt(e){return Mt(e)}function xt(e,t,n){return xt="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=Rt(e)););return e}(e,t);if(r){var i=Object.getOwnPropertyDescriptor(r,t);return i.get?i.get.call(n||e):i.value}},xt(e,t,n)}function Dt(e,t,n){return xt(e,t,n)}function Ut(e,t){return Ut=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},Ut(e,t)}function Lt(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&&Ut(e,t)}function jt(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Bt(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=Rt(e);if(t){var i=Rt(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return function(e,t){return!t||"object"!==bt(t)&&"function"!=typeof t?jt(e):t}(this,n)}}var Zt=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})),Zt={enablePaymentDone:!1};function zt(e){var t=e.data;return{orderId:t.zmpOrderId||t.orderId,transId:t.appTransID||t.apptransid||t.transId}}var Wt="ACTION_CALLBACK";function Ft(t,n,r,i){switch(!0){case"string"==typeof r||null===r:return[{eventName:t,eventId:n,data:r}];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(null==r?void 0:r.eventType))return[{eventName:e.Events.OnDataCallback,eventId:n,data:r},{eventName:e.Events.PaymentDone,eventId:n,data:zt(r)}];break;default:return[{eventName:t,eventId:n,data:r}]}}var Gt=function(t){Ut(r,t);var n=jt(r);function r(){var e;return Ct(this,r),(e=n.apply(this,arguments)).debug=bt("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===Wt||t===e.Events.PaymentCallback)return xt(Mt(r.prototype),"on",this).call(this,t,n,i);this.debug("register ".concat(String(t),": ").concat(i));return xt(Mt(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===Wt)return xt(Mt(r.prototype),"once",this).call(this,e,t,n);this.debug("register once ".concat(String(e),": ").concat(n));return xt(Mt(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}(Bt);function Vt(e){Gt.getInstance().emit(Wt,e)}function Ht(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){Vt({serialId:e,actionName:t,result:n})}},window.zaloJSV2={zalo_h5_event_handler:function(t,n,r){var i=bt("zmp:zalo_h5_event_handler");i("eventId: ".concat(t,", eventName: ").concat(n,", eventData: ").concat(r));var a=Pn(r);i("stringToData",a);var s=function(t,n){if(!n||"string"==typeof n)return 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),u=Ft(n,t,s,Zt);null==u||u.forEach((function(e){Gt.getInstance().emit(e.eventName,e.eventId,e.data);var t=document.getElementById(Se);t&&Dn(t,"appEvent",{eventName:e.eventName,eventId:e.eventId,data:e.data})}))}},window.zaloNative2JS={nativeCall:function(t,n,r){Gt.getInstance().emit(e.Events.PaymentCallback,t,n,r)}};var Kt={encode:Ht,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:Ht(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":Tt(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":Tt(r))?JSON.stringify(r):encodeURIComponent(r)].join("=");n.push(i)})),n.join("&")}},Jt={},qt=function(e,t,n){var r=t||"default";return function(){return(r in Jt?Jt[r](e,n):e).apply(this,arguments)}};qt.setWrapper=function(e){Jt[arguments.length<=1||void 0===arguments[1]?"default":arguments[1]]=e};var Qt={error:{code:1,error_subcode:1357046,message:"Received Invalid JSON reply.",type:"http"}};function Yt(e){try{return null===e?Qt:JSON.parse(e)}catch(e){return Qt}}var $t,Xt={execute:function(e,t,n,r){n.suppress_http_code=1;var i=Kt.encode(n);"post"!=t&&(e=Kt.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=qt((function(){o=r,"onload"in i&&i.onload(n)}),"entry","XMLHttpRequest:load"),a=qt((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(Yt(e.responseText))},o.onerror=function(e){e.responseText?r(Yt(e.responseText)):r({error:{code:1,error_subcode:1357045,message:"unknown error (empty response)",status:e.status,type:"http"}})},o.send(i),!0)}},en=Xt,tn=($t=Ce((function(e,t,n){var r,i,o,a;return xe(this,(function(s){switch(s.label){case 0:return r={appId:e,versionStatus:t},Ot.isUndefined(n)||(r.currentVersion=n),i=Kt.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 $t.apply(this,arguments)});function nn(e){try{var t=e.map((function(e){return{action:e.action,error:e.error,message:e.message,data:e.data}}));en.execute(d.SEND_ACTION_LOG,"post",{appId:window.APP_ID,data:JSON.stringify(t)},(function(){}))}catch(e){}}var rn=function(e){return e.replace(/[A-Z]/g,(function(e){return"_".concat(e.toLowerCase())}))},on=function(){var e;return"android"===((null===(e=Ze())||void 0===e?void 0:e.platformName)||"").toLowerCase()};var an=function(){var e=0;if(window.zaloVersionCode)e=window.zaloVersionCode;else{var t,n=Number((null===(t=Ze())||void 0===t?void 0:t.zaloVersion)||"0");if(n>=24112e3)e=n;else{var r,i=((null===(r=Ze())||void 0===r?void 0:r.platformName)||"").toLowerCase();"android"===i?e=n%1e4:"ios"===i&&(e=n)}}return function(e){var t=String(e);try{if(/^\d{9}$/.test(t)&&"0"===t[5])return Number(t.slice(0,5)+t.slice(6))}catch(e){}return Number(t)}(e)},sn=function(e,t){var n=an();return on()&&n<e||function(){var e;return"ios"===((null===(e=Ze())||void 0===e?void 0:e.platformName)||"").toLowerCase()}()&&n<t};function un(e,t){return null!=t&&"undefined"!=typeof Symbol&&t[Symbol.hasInstance]?!!t[Symbol.hasInstance](e):e instanceof t}var cn,ln=function(){function e(t,n,r,i){Ct(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}(),dn=function(e,t){return un(e,ln)?function(e,t){return e.api=t,e.toJSON()}(e,t):function(e,t){return un(e,Error)?new ln(m,e.message,t).toJSON():Ot.isEmpty(null==e?void 0:e.message)||Ot.isEmpty(null==e?void 0:e.code)?new ln(m,A,t,e).toJSON():new ln(e.code,e.message,t,e.detail).toJSON()}(e,t)},pn=(cn=Ce((function(e){var t;return xe(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,Ve({method:"GET"},t))];case 1:return[4,n.sent().json()];case 2:return[2,n.sent()]}}))})),function(e){return cn.apply(this,arguments)}),fn=Ce((function(){return xe(this,(function(e){return[2,new Promise(function(){var e=Ce((function(e,t){var n,r,i,o;return xe(this,(function(a){switch(a.label){case 0:return a.trys.push([0,3,,4]),[4,wn.jumpAndGetToken()];case 1:return a.sent(),(r=null===(n=wn.miniProgramConfig)||void 0===n?void 0:n.jwt)||t(new ln(g,k,"getSetting")),[4,pn(r)];case 2:return(i=a.sent())&&0===i.err?e({authSetting:i.data}):t(new ln(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)}}())]}))})),hn=function(){var t,n,r,i=Ze(),o={},a=Gt.getInstance(),s=[],u=!1;return u||(n=function(t){var n=t.serialId,r=Sn(t.result),i=Cn(null==r?void 0:r.action),u=Ot.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=Ot.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?Ot.isFunction(r)&&r(e):Ot.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,P=null==y?void 0:y.type;_.data={uid:E,openChatType:P}}(null==y?void 0:y.onProgress)&&g&&a.off(e.Events.DownloadProgress,g)}catch(e){}s.push(_)}},Gt.getInstance().on(Wt,n),a.on(e.Events.AppPaused,(function(){if(s.length>0){var e=s;s=[],nn(e)}})),t?clearInterval(t):t=setInterval((function(){if(s.length>0){var e=s;s=[],nn(e)}}),5e3),u=!0),r=Ce((function(t,n,r,s){var u,c,l,d,p,f,h,m,v,y,T,b,E,P,S,I,A,O,k,N,x,D,U;return xe(this,(function(L){switch(L.label){case 0:return c=Math.floor(1e6*Math.random()),l="".concat(t,"_").concat(c),d=Rn(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=kn(d),n&&r&&(o[l]={options:n,callback:r,isMultiCallback:p},f&&h&&(o[l].timeout=setTimeout((function(){return Vt({serialId:l,result:{error_code:w,error_message:C,data:{timeout:f},action:t}}),null}),!0===f?8e3:1e3*f))),y?[4,fn()]:[3,2];case 1:if(!1===(null==(b=L.sent())||null===(T=b.authSetting)||void 0===T?void 0:T["scope.userInfo"]))return Vt({serialId:l,result:{error_code:g,error_message:R,data:{isMobile:null==i||null===(E=i.platform)||void 0===E?void 0:E.isMobile},action:t}}),[2];L.label=2;case 2:return P=Cn(d),!(null==i||null===(u=i.platform)||void 0===u?void 0:u.isMobile)||!t||Ot.isUndefined(ZaloJavaScriptInterface)||i.platform.isIOS&&!En(t)||P&&!1===P.isSupported?(Vt({serialId:l,result:{error_code:_,error_message:M,data:{isMobile:null==i||null===(S=i.platform)||void 0===S?void 0:S.isMobile},action:t}}),[2]):(I=bn(n),m?[3,4]:[4,wn.getJSAccessToken()]);case 3:return O=L.sent(),[3,5];case 4:O="",L.label=5;case 5:A=O,L.label=6;case 6:return L.trys.push([6,10,,11]),m||!v?[3,8]:[4,wn.getAccessToken()];case 7:return N=L.sent(),[3,9];case 8:N="",L.label=9;case 9:return k=N,[3,11];case 10:return x=L.sent(),Vt({serialId:l,result:{error_code:null==x?void 0:x.code,error_message:null==x?void 0:x.message,action:t}}),[2];case 11:try{n&&(null==n?void 0:n.onProgress)&&(D=function(e){!function(e,t){e.url;var n=e.progress;t&&t(n)}(e,null==n?void 0:n.onProgress)},o[l].downloadListener=D,a.on(e.Events.DownloadProgress,D))}catch(e){}return U=i.platform.isIOS?window.onNativeMessage(l,d):'window.onNativeMessage("'.concat(l,'", "').concat(d,'")'),[2,ZaloJavaScriptInterface.jsCall(A,d,k,I,U)]}}))})),function(e,t,n,i){return r.apply(this,arguments)}}(),mn={success:function(e,t){return{code:h,message:t||I,data:e||{}}},error:{failLimit:function(){return new ln(T,O)},badRequest:function(e){return new ln(v,e)},loginFailed:function(e){return new ln(g,"".concat(N,": ").concat(e))},loginRequired:function(){return new ln(g,k)},cannotGetShareInfo:function(){return new ln(y,"Can not get app info to share")},createIAPOrderFailed:function(e){var t=Object.keys(te).find((function(t){return t===e.toString()}));return new ln(e,t||A)},clientNotSupport:function(){return new ln(_,M)}}},vn=function(t){var n,r,i,o=null===(n=Ze())||void 0===n?void 0:n.platformName,a=Mn(t.action),s=Z[a],u=(null==s?void 0:s.skipJump)||!1,c=(null==s?void 0:s.errorList)||{};if("JUMP_LOGIN"===a)return new ln(m,"Can not get auth code: ".concat(t.error_message));if(wn.jumpStatus!==e.JumpStatus.DONE&&!u)return new ln(j.UNAUTHORIZED.code,j.UNAUTHORIZED.message);if("permission required!"===String(t.error_message).toLowerCase()||"no permission!"===String(t.error_message).toLowerCase())return new ln(j.FORBIDDEN.code,j.FORBIDDEN.message);if(o&&(null===(r=z[o])||void 0===r?void 0:r[t.error_code]))return new ln(z[o][t.error_code].code,z[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 ln(null===(p=l.mapTo)||void 0===p?void 0:p.code,h)}return new ln(t.error_code,t.error_message)},yn=function(e,t,r,i){var o=function(e,t){function r(r){return function(i){var o=Ot.isEmpty(t)?void 0:t[r];if(o)return We({stage:n.RESPONSE,type:"log",state:r,name:e,response:i}),o("fail"===r?vn(i):null==i?void 0:i.data)}}return Ot.isUndefined(e)&&(e=""),Object.assign({},{success:r("success"),fail:r("fail")})}(e,r),a=Z[e],s=(null==i?void 0:i.delay)||0;setTimeout((function(){hn(e,t,o,Ve({},i,a))}),s)},gn=function(){var e=Ce((function(e){return xe(this,(function(t){return[2,new Promise((function(t,n){yn("MP_USER_AUTHORIZE",{scopes:e,forceUpdate:!0},{success:function(e){Ot.isEmpty(e)||t(e)},fail:function(e){n(e)}},{isMultiCallback:!1,timeout:!1})}))]}))}));return function(t){return e.apply(this,arguments)}}(),_n=function(){function t(){Ct(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=B[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 Ce((function(){return xe(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,We({stage:n.REQUEST,type:"log",name:"jump"}),hn("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)||nn([{action:"action.jump.login",error:-102,message:"no zoauth",data:{}}]),r(e.JumpStatus.DONE)},fail:function(e){nn([{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 Ce((function(){var i;return xe(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=Ce((function(e){var t,n,i;return xe(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 Ce((function(){var i,o;return xe(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),Ot.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,Ve({method:"POST",body:i},o)).then(function(){var e=Ce((function(e){var t,n,i,o;return xe(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 Ce((function(){var n,r,a,s,u,c,d,p,f;function h(){return m.apply(this,arguments)}function m(){return(m=Ce((function(){return xe(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 xe(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--,nn([{action:d,error:-104,message:"no user auth",data:{}}]),mn.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),nn([{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)]:(nn([{action:d,error:-101,message:"no accessToken",data:{}}]),[2,Promise.reject(mn.error.loginFailed("Can't get accessToken. Please try again later."))]);case 15:throw r.getAccessTokenCount--,nn([{action:d,error:-102,message:"no oauth",data:{}}]),mn.error.loginFailed("Zalo app has not been activated")}}))}))()},c.verifyUserAuthorized=function(){var e=this;return Ce((function(){var t,n,r,i,o,a;return xe(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=Cn("action.mp.user.authorize"))&&r.isSupported?[4,fn()]:[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,gn()];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 Ce((function(){var t;return xe(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=Ce((function(i){var o,a,s,u;return xe(this,(function(c){switch(c.label){case 0:return!n&&r._cookies.length>0?Ot.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}}])&&kt(r.prototype,a),u&&kt(r,u),t}(),wn=_n.getInstance(),Tn=bt("zmp:utils:common"),bn=function(e){if(Ot.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(bn(e[r]));return"["+t.join(",")+"]"}if("object"==typeof e){for(var i in t=[],e)t.push('"'+i+'":'+bn(e[i]));return"{"+t.join(",")+"}"}return e.toString()},En=function(e){var t=Z[e],n=an(),r=t&&"object"==typeof t&&"versionLive"in t&&t.versionLive&&"iOS"in t.versionLive?t.versionLive.iOS:0;return!!(Array.isArray(window.ignoreCheckSupport)&&window.ignoreCheckSupport.length>0&&window.ignoreCheckSupport.includes(e))||n>=r},Pn=function(e){try{if(e){Tn(e);var t=e.replace(/\\/g,"").replace(/&#39;/g,"'");try{t=decodeURIComponent(atob(e))}catch(e){}var n=JSON.parse(t);return Tn("formattedValue",t,n,void 0===n?"undefined":Tt(n)),n}return null}catch(t){return Tn("parse json error:",t),e}},Sn=function(e){if(Ot.isObject(JSON)&&JSON.parse&&Ot.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 Ot.isObject(e)?e:new Function("return "+e)()},In=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""},An=function(e){return btoa(encodeURIComponent(JSON.stringify(e)))};var On=function(t){return"hidden"===t?e.StatusBarType.hidden:"transparent"===t?e.StatusBarType.transparent:e.StatusBarType.normal},Cn=function(e){if(void 0!==e){var t=wn.miniProgramConfig;return((null==t?void 0:t.dynamicApis)||[]).find((function(t){return t.action===e&&!1===t.clientHandle}))}},kn=function(e){if(void 0===e)return!1;var t=wn.miniProgramConfig;return((null==t?void 0:t.requiredAuthenList)||[]).indexOf(e)>=0},Nn=function(){var e=Ce((function(){return xe(this,(function(e){return[2,new Promise(function(){var e=Ce((function(e,t){var n;return xe(this,(function(t){switch(t.label){case 0:return t.trys.push([0,2,,3]),[4,wn.jumpAndGetToken()];case 1:return t.sent(),n=wn.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)}}(),Mn=function(e){return e.replace("action.","").replace(/\./g,"_").toUpperCase()},Rn=function(e){return e.startsWith("action.")?e:"action.".concat(e.replace(/\_/g,".").toLowerCase())},xn=function(e,t,n){"string"==typeof n&&n.length>0?e.set(t,n):"object"!=typeof n||Array.isArray(n)||Object.entries(n).forEach((function(n){var r=He(n,2),i=r[0],o=r[1];null!=o&&""!==o&&e.set("".concat(t).concat(i),String(o))}))},Dn=function(e,t,n){var r;null===(r=e.contentWindow)||void 0===r||r.postMessage({type:t,payload:n},Ie)};function Un(e,t,n,r){var i,o;!function(e,t){if(B[e]){var n=wn.getRetryLimit(e);n.lastCall&&(new Date).getTime()-n.lastCall>1e3&&wn.resetRetryLimit(e);var r=n.limit||3;if(n.retry&&n.retry>=r)throw dn(mn.error.failLimit(),e);wn.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=mn.error.badRequest(s);throw c.detail=a,dn(c,e)}u.push(i.data)}));var c=r.apply(void 0,Re(u));return Ot.isPromise(c)?new Promise((function(t,n){c.then((function(e){if(!Ot.isNull(a)&&Ot.isFunction(a))return a(e);t(c)})).catch((function(t){var r=dn(t,e);if(!Ot.isNull(s)&&Ot.isFunction(s))return s(r);n(r)}))})):c}catch(t){if(!Ot.isNull(s)&&Ot.isFunction(s))return s(t);throw dn(t,e)}}function Ln(e){return jn.apply(this,arguments)}function jn(){return(jn=Ce((function(e){return xe(this,(function(t){return[2,Un("login",[],[e],Ce((function(){return xe(this,(function(e){switch(e.label){case 0:return ze.isMp?[4,wn.jumpAndGetToken(l.ZOAUTH)]:[3,2];case 1:return e.sent(),[2,"Success"];case 2:return ze.isMpWeb?[2,Promise.resolve("")]:[2,Promise.reject(Fe("login",{}))]}}))})))]}))}))).apply(this,arguments)}function Bn(e){return Zn.apply(this,arguments)}function Zn(){return(Zn=Ce((function(e){return xe(this,(function(t){return[2,Un("getAccessToken",[],[e],Ce((function(){var e;return xe(this,(function(t){switch(t.label){case 0:return ze.isMp?[4,Nn()]:[3,3];case 1:return e=!t.sent(),[4,wn.getAccessToken(e)];case 2:return[2,t.sent()||""];case 3:return ze.isMpWeb?[2,Promise.resolve("")]:[2,Promise.reject(Fe("getAccessToken",{}))]}}))})))]}))}))).apply(this,arguments)}var zn,Wn="2.47.0-beta.8";function Fn(){return Un("getVersion",[],[],(function(){return Wn}))}function Gn(){var e;return{version:In("version-id")||"",apiVersion:Wn,zaloVersion:String(an()),platform:(null===(e=Ze())||void 0===e?void 0:e.platformName)||"",language:navigator.language,zaloLanguage:window.zLanguage||"vi",zaloTheme:window.zTheme||"light"}}function Vn(){return Un("getSystemInfo",[],[],(function(){return Gn()}))}!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}(zn||(zn={}));const Hn=zn.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Kn=e=>{switch(typeof e){case"undefined":return Hn.undefined;case"string":return Hn.string;case"number":return isNaN(e)?Hn.nan:Hn.number;case"boolean":return Hn.boolean;case"function":return Hn.function;case"bigint":return Hn.bigint;case"symbol":return Hn.symbol;case"object":return Array.isArray(e)?Hn.array:null===e?Hn.null:e.then&&"function"==typeof e.then&&e.catch&&"function"==typeof e.catch?Hn.promise:"undefined"!=typeof Map&&e instanceof Map?Hn.map:"undefined"!=typeof Set&&e instanceof Set?Hn.set:"undefined"!=typeof Date&&e instanceof Date?Hn.date:Hn.object;default:return Hn.unknown}},Jn=zn.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 qn 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,zn.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()}}qn.create=e=>new qn(e);const Qn=(e,t)=>{let n;switch(e.code){case Jn.invalid_type:n=e.received===Hn.undefined?"Required":`Expected ${e.expected}, received ${e.received}`;break;case Jn.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(e.expected,zn.jsonStringifyReplacer)}`;break;case Jn.unrecognized_keys:n=`Unrecognized key(s) in object: ${zn.joinValues(e.keys,", ")}`;break;case Jn.invalid_union:n="Invalid input";break;case Jn.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${zn.joinValues(e.options)}`;break;case Jn.invalid_enum_value:n=`Invalid enum value. Expected ${zn.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}"`:zn.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,zn.assertNever(e)}return{message:n}};let Yn=Qn;function $n(){return Yn}const Xn=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 er(e,t){const n=Xn({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,$n(),Qn].filter((e=>!!e))});e.common.issues.push(n)}class tr{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 nr;"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 tr.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 nr;if("aborted"===i.status)return nr;"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 nr=Object.freeze({status:"aborted"}),rr=e=>({status:"dirty",value:e}),ir=e=>({status:"valid",value:e}),or=e=>"aborted"===e.status,ar=e=>"dirty"===e.status,sr=e=>"valid"===e.status,ur=e=>"undefined"!=typeof Promise&&e instanceof Promise;var cr;!function(e){e.errToObj=e=>"string"==typeof e?{message:e}:e||{},e.toString=e=>"string"==typeof e?e:null==e?void 0:e.message}(cr||(cr={}));class lr{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 dr=(e,t)=>{if(sr(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 qn(e.common.issues)}};function pr(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 fr{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 Kn(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:Kn(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new tr,ctx:{common:e.parent.common,data:e.data,parsedType:Kn(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const t=this._parse(e);if(ur(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:Kn(e)},i=this._parseSync({data:e,path:r.path,parent:r});return dr(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:Kn(e)},r=this._parse({data:e,path:n.path,parent:n}),i=await(ur(r)?r:Promise.resolve(r));return dr(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 Yr({schema:this,typeName:ui.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}optional(){return $r.create(this,this._def)}nullable(){return Xr.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Nr.create(this,this._def)}promise(){return Qr.create(this,this._def)}or(e){return Dr.create([this,e],this._def)}and(e){return Br.create(this,e,this._def)}transform(e){return new Yr({...pr(this._def),schema:this,typeName:ui.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const t="function"==typeof e?e:()=>e;return new ei({...pr(this._def),innerType:this,defaultValue:t,typeName:ui.ZodDefault})}brand(){return new ii({typeName:ui.ZodBranded,type:this,...pr(this._def)})}catch(e){const t="function"==typeof e?e:()=>e;return new ti({...pr(this._def),innerType:this,catchValue:t,typeName:ui.ZodCatch})}describe(e){return new(0,this.constructor)({...this._def,description:e})}pipe(e){return oi.create(this,e)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const hr=/^c[^\s-]{8,}$/i,mr=/^[a-z][a-z0-9]*$/,vr=/^([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,yr=/^(([^<>()[\]\\.,;:\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 gr extends fr{constructor(){super(...arguments),this._regex=(e,t,n)=>this.refinement((t=>e.test(t)),{validation:t,code:Jn.invalid_string,...cr.errToObj(n)}),this.nonempty=e=>this.min(1,cr.errToObj(e)),this.trim=()=>new gr({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}_parse(e){this._def.coerce&&(e.data=String(e.data));if(this._getType(e)!==Hn.string){const t=this._getOrReturnCtx(e);return er(t,{code:Jn.invalid_type,expected:Hn.string,received:t.parsedType}),nr}const t=new tr;let n;for(const i of this._def.checks)if("min"===i.kind)e.data.length<i.value&&(n=this._getOrReturnCtx(e,n),er(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),er(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?er(n,{code:Jn.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}):o&&er(n,{code:Jn.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}),t.dirty())}else if("email"===i.kind)yr.test(e.data)||(n=this._getOrReturnCtx(e,n),er(n,{validation:"email",code:Jn.invalid_string,message:i.message}),t.dirty());else if("uuid"===i.kind)vr.test(e.data)||(n=this._getOrReturnCtx(e,n),er(n,{validation:"uuid",code:Jn.invalid_string,message:i.message}),t.dirty());else if("cuid"===i.kind)hr.test(e.data)||(n=this._getOrReturnCtx(e,n),er(n,{validation:"cuid",code:Jn.invalid_string,message:i.message}),t.dirty());else if("cuid2"===i.kind)mr.test(e.data)||(n=this._getOrReturnCtx(e,n),er(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),er(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),er(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),er(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),er(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),er(n,{code:Jn.invalid_string,validation:"datetime",message:i.message}),t.dirty())}else zn.assertNever(i);var r;return{status:t.value,value:e.data}}_addCheck(e){return new gr({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...cr.errToObj(e)})}url(e){return this._addCheck({kind:"url",...cr.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...cr.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...cr.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...cr.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,...cr.errToObj(null==e?void 0:e.message)})}regex(e,t){return this._addCheck({kind:"regex",regex:e,...cr.errToObj(t)})}startsWith(e,t){return this._addCheck({kind:"startsWith",value:e,...cr.errToObj(t)})}endsWith(e,t){return this._addCheck({kind:"endsWith",value:e,...cr.errToObj(t)})}min(e,t){return this._addCheck({kind:"min",value:e,...cr.errToObj(t)})}max(e,t){return this._addCheck({kind:"max",value:e,...cr.errToObj(t)})}length(e,t){return this._addCheck({kind:"length",value:e,...cr.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 _r(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)}gr.create=e=>{var t;return new gr({checks:[],typeName:ui.ZodString,coerce:null!==(t=null==e?void 0:e.coerce)&&void 0!==t&&t,...pr(e)})};class wr extends fr{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)!==Hn.number){const t=this._getOrReturnCtx(e);return er(t,{code:Jn.invalid_type,expected:Hn.number,received:t.parsedType}),nr}let t;const n=new tr;for(const r of this._def.checks)if("int"===r.kind)zn.isInteger(e.data)||(t=this._getOrReturnCtx(e,t),er(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),er(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),er(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!==_r(e.data,r.value)&&(t=this._getOrReturnCtx(e,t),er(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),er(t,{code:Jn.not_finite,message:r.message}),n.dirty()):zn.assertNever(r);return{status:n.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,cr.toString(t))}gt(e,t){return this.setLimit("min",e,!1,cr.toString(t))}lte(e,t){return this.setLimit("max",e,!0,cr.toString(t))}lt(e,t){return this.setLimit("max",e,!1,cr.toString(t))}setLimit(e,t,n,r){return new wr({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:n,message:cr.toString(r)}]})}_addCheck(e){return new wr({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:cr.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:cr.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:cr.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:cr.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:cr.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:cr.toString(t)})}finite(e){return this._addCheck({kind:"finite",message:cr.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&&zn.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)}}wr.create=e=>new wr({checks:[],typeName:ui.ZodNumber,coerce:(null==e?void 0:e.coerce)||!1,...pr(e)});class Tr extends fr{_parse(e){this._def.coerce&&(e.data=BigInt(e.data));if(this._getType(e)!==Hn.bigint){const t=this._getOrReturnCtx(e);return er(t,{code:Jn.invalid_type,expected:Hn.bigint,received:t.parsedType}),nr}return ir(e.data)}}Tr.create=e=>{var t;return new Tr({typeName:ui.ZodBigInt,coerce:null!==(t=null==e?void 0:e.coerce)&&void 0!==t&&t,...pr(e)})};class br extends fr{_parse(e){this._def.coerce&&(e.data=Boolean(e.data));if(this._getType(e)!==Hn.boolean){const t=this._getOrReturnCtx(e);return er(t,{code:Jn.invalid_type,expected:Hn.boolean,received:t.parsedType}),nr}return ir(e.data)}}br.create=e=>new br({typeName:ui.ZodBoolean,coerce:(null==e?void 0:e.coerce)||!1,...pr(e)});class Er extends fr{_parse(e){this._def.coerce&&(e.data=new Date(e.data));if(this._getType(e)!==Hn.date){const t=this._getOrReturnCtx(e);return er(t,{code:Jn.invalid_type,expected:Hn.date,received:t.parsedType}),nr}if(isNaN(e.data.getTime())){return er(this._getOrReturnCtx(e),{code:Jn.invalid_date}),nr}const t=new tr;let n;for(const r of this._def.checks)"min"===r.kind?e.data.getTime()<r.value&&(n=this._getOrReturnCtx(e,n),er(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),er(n,{code:Jn.too_big,message:r.message,inclusive:!0,exact:!1,maximum:r.value,type:"date"}),t.dirty()):zn.assertNever(r);return{status:t.value,value:new Date(e.data.getTime())}}_addCheck(e){return new Er({...this._def,checks:[...this._def.checks,e]})}min(e,t){return this._addCheck({kind:"min",value:e.getTime(),message:cr.toString(t)})}max(e,t){return this._addCheck({kind:"max",value:e.getTime(),message:cr.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}}Er.create=e=>new Er({checks:[],coerce:(null==e?void 0:e.coerce)||!1,typeName:ui.ZodDate,...pr(e)});class Pr extends fr{_parse(e){if(this._getType(e)!==Hn.symbol){const t=this._getOrReturnCtx(e);return er(t,{code:Jn.invalid_type,expected:Hn.symbol,received:t.parsedType}),nr}return ir(e.data)}}Pr.create=e=>new Pr({typeName:ui.ZodSymbol,...pr(e)});class Sr extends fr{_parse(e){if(this._getType(e)!==Hn.undefined){const t=this._getOrReturnCtx(e);return er(t,{code:Jn.invalid_type,expected:Hn.undefined,received:t.parsedType}),nr}return ir(e.data)}}Sr.create=e=>new Sr({typeName:ui.ZodUndefined,...pr(e)});class Ir extends fr{_parse(e){if(this._getType(e)!==Hn.null){const t=this._getOrReturnCtx(e);return er(t,{code:Jn.invalid_type,expected:Hn.null,received:t.parsedType}),nr}return ir(e.data)}}Ir.create=e=>new Ir({typeName:ui.ZodNull,...pr(e)});class Ar extends fr{constructor(){super(...arguments),this._any=!0}_parse(e){return ir(e.data)}}Ar.create=e=>new Ar({typeName:ui.ZodAny,...pr(e)});class Or extends fr{constructor(){super(...arguments),this._unknown=!0}_parse(e){return ir(e.data)}}Or.create=e=>new Or({typeName:ui.ZodUnknown,...pr(e)});class Cr extends fr{_parse(e){const t=this._getOrReturnCtx(e);return er(t,{code:Jn.invalid_type,expected:Hn.never,received:t.parsedType}),nr}}Cr.create=e=>new Cr({typeName:ui.ZodNever,...pr(e)});class kr extends fr{_parse(e){if(this._getType(e)!==Hn.undefined){const t=this._getOrReturnCtx(e);return er(t,{code:Jn.invalid_type,expected:Hn.void,received:t.parsedType}),nr}return ir(e.data)}}kr.create=e=>new kr({typeName:ui.ZodVoid,...pr(e)});class Nr extends fr{_parse(e){const{ctx:t,status:n}=this._processInputParams(e),r=this._def;if(t.parsedType!==Hn.array)return er(t,{code:Jn.invalid_type,expected:Hn.array,received:t.parsedType}),nr;if(null!==r.exactLength){const e=t.data.length>r.exactLength.value,i=t.data.length<r.exactLength.value;(e||i)&&(er(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&&(er(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&&(er(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 lr(t,e,t.path,n))))).then((e=>tr.mergeArray(n,e)));const i=[...t.data].map(((e,n)=>r.type._parseSync(new lr(t,e,t.path,n))));return tr.mergeArray(n,i)}get element(){return this._def.type}min(e,t){return new Nr({...this._def,minLength:{value:e,message:cr.toString(t)}})}max(e,t){return new Nr({...this._def,maxLength:{value:e,message:cr.toString(t)}})}length(e,t){return new Nr({...this._def,exactLength:{value:e,message:cr.toString(t)}})}nonempty(e){return this.min(1,e)}}var Mr;function Rr(e){if(e instanceof xr){const t={};for(const n in e.shape){const r=e.shape[n];t[n]=$r.create(Rr(r))}return new xr({...e._def,shape:()=>t})}return e instanceof Nr?Nr.create(Rr(e.element)):e instanceof $r?$r.create(Rr(e.unwrap())):e instanceof Xr?Xr.create(Rr(e.unwrap())):e instanceof Zr?Zr.create(e.items.map((e=>Rr(e)))):e}Nr.create=(e,t)=>new Nr({type:e,minLength:null,maxLength:null,exactLength:null,typeName:ui.ZodArray,...pr(t)}),function(e){e.mergeShapes=(e,t)=>({...e,...t})}(Mr||(Mr={}));class xr extends fr{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=zn.objectKeys(e);return this._cached={shape:e,keys:t}}_parse(e){if(this._getType(e)!==Hn.object){const t=this._getOrReturnCtx(e);return er(t,{code:Jn.invalid_type,expected:Hn.object,received:t.parsedType}),nr}const{status:t,ctx:n}=this._processInputParams(e),{shape:r,keys:i}=this._getCached(),o=[];if(!(this._def.catchall instanceof Cr&&"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 lr(n,i,n.path,e)),alwaysSet:e in n.data})}if(this._def.catchall instanceof Cr){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&&(er(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 lr(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=>tr.mergeObjectSync(t,e))):tr.mergeObjectSync(t,a)}get shape(){return this._def.shape()}strict(e){return cr.errToObj,new xr({...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=cr.errToObj(e).message)&&void 0!==a?a:s}:{message:s}}}:{}})}strip(){return new xr({...this._def,unknownKeys:"strip"})}passthrough(){return new xr({...this._def,unknownKeys:"passthrough"})}extend(e){return new xr({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new xr({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>Mr.mergeShapes(this._def.shape(),e._def.shape()),typeName:ui.ZodObject})}setKey(e,t){return this.augment({[e]:t})}catchall(e){return new xr({...this._def,catchall:e})}pick(e){const t={};return zn.objectKeys(e).forEach((n=>{e[n]&&this.shape[n]&&(t[n]=this.shape[n])})),new xr({...this._def,shape:()=>t})}omit(e){const t={};return zn.objectKeys(this.shape).forEach((n=>{e[n]||(t[n]=this.shape[n])})),new xr({...this._def,shape:()=>t})}deepPartial(){return Rr(this)}partial(e){const t={};return zn.objectKeys(this.shape).forEach((n=>{const r=this.shape[n];e&&!e[n]?t[n]=r:t[n]=r.optional()})),new xr({...this._def,shape:()=>t})}required(e){const t={};return zn.objectKeys(this.shape).forEach((n=>{if(e&&!e[n])t[n]=this.shape[n];else{let e=this.shape[n];for(;e instanceof $r;)e=e._def.innerType;t[n]=e}})),new xr({...this._def,shape:()=>t})}keyof(){return Kr(zn.objectKeys(this.shape))}}xr.create=(e,t)=>new xr({shape:()=>e,unknownKeys:"strip",catchall:Cr.create(),typeName:ui.ZodObject,...pr(t)}),xr.strictCreate=(e,t)=>new xr({shape:()=>e,unknownKeys:"strict",catchall:Cr.create(),typeName:ui.ZodObject,...pr(t)}),xr.lazycreate=(e,t)=>new xr({shape:e,unknownKeys:"strip",catchall:Cr.create(),typeName:ui.ZodObject,...pr(t)});class Dr extends fr{_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 qn(e.ctx.common.issues)));return er(t,{code:Jn.invalid_union,unionErrors:n}),nr}));{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 qn(e)));return er(t,{code:Jn.invalid_union,unionErrors:i}),nr}}get options(){return this._def.options}}Dr.create=(e,t)=>new Dr({options:e,typeName:ui.ZodUnion,...pr(t)});const Ur=e=>e instanceof Vr?Ur(e.schema):e instanceof Yr?Ur(e.innerType()):e instanceof Hr?[e.value]:e instanceof Jr?e.options:e instanceof qr?Object.keys(e.enum):e instanceof ei?Ur(e._def.innerType):e instanceof Sr?[void 0]:e instanceof Ir?[null]:null;class Lr extends fr{_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==Hn.object)return er(t,{code:Jn.invalid_type,expected:Hn.object,received:t.parsedType}),nr;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}):(er(t,{code:Jn.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[n]}),nr)}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=Ur(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 Lr({typeName:ui.ZodDiscriminatedUnion,discriminator:e,options:t,optionsMap:r,...pr(n)})}}function jr(e,t){const n=Kn(e),r=Kn(t);if(e===t)return{valid:!0,data:e};if(n===Hn.object&&r===Hn.object){const n=zn.objectKeys(t),r=zn.objectKeys(e).filter((e=>-1!==n.indexOf(e))),i={...e,...t};for(const n of r){const r=jr(e[n],t[n]);if(!r.valid)return{valid:!1};i[n]=r.data}return{valid:!0,data:i}}if(n===Hn.array&&r===Hn.array){if(e.length!==t.length)return{valid:!1};const n=[];for(let r=0;r<e.length;r++){const i=jr(e[r],t[r]);if(!i.valid)return{valid:!1};n.push(i.data)}return{valid:!0,data:n}}return n===Hn.date&&r===Hn.date&&+e==+t?{valid:!0,data:e}:{valid:!1}}class Br extends fr{_parse(e){const{status:t,ctx:n}=this._processInputParams(e),r=(e,r)=>{if(or(e)||or(r))return nr;const i=jr(e.value,r.value);return i.valid?((ar(e)||ar(r))&&t.dirty(),{status:t.value,value:i.data}):(er(n,{code:Jn.invalid_intersection_types}),nr)};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}))}}Br.create=(e,t,n)=>new Br({left:e,right:t,typeName:ui.ZodIntersection,...pr(n)});class Zr extends fr{_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==Hn.array)return er(n,{code:Jn.invalid_type,expected:Hn.array,received:n.parsedType}),nr;if(n.data.length<this._def.items.length)return er(n,{code:Jn.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),nr;!this._def.rest&&n.data.length>this._def.items.length&&(er(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 lr(n,e,n.path,t)):null})).filter((e=>!!e));return n.common.async?Promise.all(r).then((e=>tr.mergeArray(t,e))):tr.mergeArray(t,r)}get items(){return this._def.items}rest(e){return new Zr({...this._def,rest:e})}}Zr.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Zr({items:e,typeName:ui.ZodTuple,rest:null,...pr(t)})};class zr extends fr{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!==Hn.object)return er(n,{code:Jn.invalid_type,expected:Hn.object,received:n.parsedType}),nr;const r=[],i=this._def.keyType,o=this._def.valueType;for(const e in n.data)r.push({key:i._parse(new lr(n,e,n.path,e)),value:o._parse(new lr(n,n.data[e],n.path,e))});return n.common.async?tr.mergeObjectAsync(t,r):tr.mergeObjectSync(t,r)}get element(){return this._def.valueType}static create(e,t,n){return new zr(t instanceof fr?{keyType:e,valueType:t,typeName:ui.ZodRecord,...pr(n)}:{keyType:gr.create(),valueType:e,typeName:ui.ZodRecord,...pr(t)})}}class Wr extends fr{_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==Hn.map)return er(n,{code:Jn.invalid_type,expected:Hn.map,received:n.parsedType}),nr;const r=this._def.keyType,i=this._def.valueType,o=[...n.data.entries()].map((([e,t],o)=>({key:r._parse(new lr(n,e,n.path,[o,"key"])),value:i._parse(new lr(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 nr;"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 nr;"dirty"!==r.status&&"dirty"!==i.status||t.dirty(),e.set(r.value,i.value)}return{status:t.value,value:e}}}}Wr.create=(e,t,n)=>new Wr({valueType:t,keyType:e,typeName:ui.ZodMap,...pr(n)});class Fr extends fr{_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==Hn.set)return er(n,{code:Jn.invalid_type,expected:Hn.set,received:n.parsedType}),nr;const r=this._def;null!==r.minSize&&n.data.size<r.minSize.value&&(er(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&&(er(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 nr;"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 lr(n,e,n.path,t))));return n.common.async?Promise.all(a).then((e=>o(e))):o(a)}min(e,t){return new Fr({...this._def,minSize:{value:e,message:cr.toString(t)}})}max(e,t){return new Fr({...this._def,maxSize:{value:e,message:cr.toString(t)}})}size(e,t){return this.min(e,t).max(e,t)}nonempty(e){return this.min(1,e)}}Fr.create=(e,t)=>new Fr({valueType:e,minSize:null,maxSize:null,typeName:ui.ZodSet,...pr(t)});class Gr extends fr{constructor(){super(...arguments),this.validate=this.implement}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==Hn.function)return er(t,{code:Jn.invalid_type,expected:Hn.function,received:t.parsedType}),nr;function n(e,n){return Xn({data:e,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,$n(),Qn].filter((e=>!!e)),issueData:{code:Jn.invalid_arguments,argumentsError:n}})}function r(e,n){return Xn({data:e,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,$n(),Qn].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 Qr?ir((async(...e)=>{const t=new qn([]),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}))})):ir(((...e)=>{const t=this._def.args.safeParse(e,i);if(!t.success)throw new qn([n(e,t.error)]);const a=o(...t.data),s=this._def.returns.safeParse(a,i);if(!s.success)throw new qn([r(a,s.error)]);return s.data}))}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new Gr({...this._def,args:Zr.create(e).rest(Or.create())})}returns(e){return new Gr({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,t,n){return new Gr({args:e||Zr.create([]).rest(Or.create()),returns:t||Or.create(),typeName:ui.ZodFunction,...pr(n)})}}class Vr extends fr{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})}}Vr.create=(e,t)=>new Vr({getter:e,typeName:ui.ZodLazy,...pr(t)});class Hr extends fr{_parse(e){if(e.data!==this._def.value){const t=this._getOrReturnCtx(e);return er(t,{received:t.data,code:Jn.invalid_literal,expected:this._def.value}),nr}return{status:"valid",value:e.data}}get value(){return this._def.value}}function Kr(e,t){return new Jr({values:e,typeName:ui.ZodEnum,...pr(t)})}Hr.create=(e,t)=>new Hr({value:e,typeName:ui.ZodLiteral,...pr(t)});class Jr extends fr{_parse(e){if("string"!=typeof e.data){const t=this._getOrReturnCtx(e),n=this._def.values;return er(t,{expected:zn.joinValues(n),received:t.parsedType,code:Jn.invalid_type}),nr}if(-1===this._def.values.indexOf(e.data)){const t=this._getOrReturnCtx(e),n=this._def.values;return er(t,{received:t.data,code:Jn.invalid_enum_value,options:n}),nr}return ir(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=Kr;class qr extends fr{_parse(e){const t=zn.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(e);if(n.parsedType!==Hn.string&&n.parsedType!==Hn.number){const e=zn.objectValues(t);return er(n,{expected:zn.joinValues(e),received:n.parsedType,code:Jn.invalid_type}),nr}if(-1===t.indexOf(e.data)){const e=zn.objectValues(t);return er(n,{received:n.data,code:Jn.invalid_enum_value,options:e}),nr}return ir(e.data)}get enum(){return this._def.values}}qr.create=(e,t)=>new qr({values:e,typeName:ui.ZodNativeEnum,...pr(t)});class Qr extends fr{unwrap(){return this._def.type}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==Hn.promise&&!1===t.common.async)return er(t,{code:Jn.invalid_type,expected:Hn.promise,received:t.parsedType}),nr;const n=t.parsedType===Hn.promise?t.data:Promise.resolve(t.data);return ir(n.then((e=>this._def.type.parseAsync(e,{path:t.path,errorMap:t.common.contextualErrorMap}))))}}Qr.create=(e,t)=>new Qr({type:e,typeName:ui.ZodPromise,...pr(t)});class Yr extends fr{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===ui.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=>{er(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?nr:("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?nr:("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(!sr(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=>sr(e)?Promise.resolve(r.transform(e.value,i)).then((e=>({status:t.value,value:e}))):e))}zn.assertNever(r)}}Yr.create=(e,t,n)=>new Yr({schema:e,typeName:ui.ZodEffects,effect:t,...pr(n)}),Yr.createWithPreprocess=(e,t,n)=>new Yr({schema:t,effect:{type:"preprocess",transform:e},typeName:ui.ZodEffects,...pr(n)});class $r extends fr{_parse(e){return this._getType(e)===Hn.undefined?ir(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}$r.create=(e,t)=>new $r({innerType:e,typeName:ui.ZodOptional,...pr(t)});class Xr extends fr{_parse(e){return this._getType(e)===Hn.null?ir(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}Xr.create=(e,t)=>new Xr({innerType:e,typeName:ui.ZodNullable,...pr(t)});class ei extends fr{_parse(e){const{ctx:t}=this._processInputParams(e);let n=t.data;return t.parsedType===Hn.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:t.path,parent:t})}removeDefault(){return this._def.innerType}}ei.create=(e,t)=>new ei({innerType:e,typeName:ui.ZodDefault,defaultValue:"function"==typeof t.default?t.default:()=>t.default,...pr(t)});class ti extends fr{_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 ur(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}}ti.create=(e,t)=>new ti({innerType:e,typeName:ui.ZodCatch,catchValue:"function"==typeof t.catch?t.catch:()=>t.catch,...pr(t)});class ni extends fr{_parse(e){if(this._getType(e)!==Hn.nan){const t=this._getOrReturnCtx(e);return er(t,{code:Jn.invalid_type,expected:Hn.nan,received:t.parsedType}),nr}return{status:"valid",value:e.data}}}ni.create=e=>new ni({typeName:ui.ZodNaN,...pr(e)});const ri=Symbol("zod_brand");class ii extends fr{_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 oi extends fr{_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?nr:"dirty"===e.status?(t.dirty(),rr(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?nr:"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 oi({in:e,out:t,typeName:ui.ZodPipeline})}}const ai=(e,t={},n)=>e?Ar.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})}})):Ar.create(),si={object:xr.lazycreate};var ui;!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"}(ui||(ui={}));const ci=gr.create,li=wr.create,di=ni.create,pi=Tr.create,fi=br.create,hi=Er.create,mi=Pr.create,vi=Sr.create,yi=Ir.create,gi=Ar.create,_i=Or.create,wi=Cr.create,Ti=kr.create,bi=Nr.create,Ei=xr.create,Pi=xr.strictCreate,Si=Dr.create,Ii=Lr.create,Ai=Br.create,Oi=Zr.create,Ci=zr.create,ki=Wr.create,Ni=Fr.create,Mi=Gr.create,Ri=Vr.create,xi=Hr.create,Di=Jr.create,Ui=qr.create,Li=Qr.create,ji=Yr.create,Bi=$r.create,Zi=Xr.create,zi=Yr.createWithPreprocess,Wi=oi.create,Fi={string:e=>gr.create({...e,coerce:!0}),number:e=>wr.create({...e,coerce:!0}),boolean:e=>br.create({...e,coerce:!0}),bigint:e=>Tr.create({...e,coerce:!0}),date:e=>Er.create({...e,coerce:!0})},Gi=nr;var Vi=Object.freeze({__proto__:null,defaultErrorMap:Qn,setErrorMap:function(e){Yn=e},getErrorMap:$n,makeIssue:Xn,EMPTY_PATH:[],addIssueToContext:er,ParseStatus:tr,INVALID:nr,DIRTY:rr,OK:ir,isAborted:or,isDirty:ar,isValid:sr,isAsync:ur,get util(){return zn},ZodParsedType:Hn,getParsedType:Kn,ZodType:fr,ZodString:gr,ZodNumber:wr,ZodBigInt:Tr,ZodBoolean:br,ZodDate:Er,ZodSymbol:Pr,ZodUndefined:Sr,ZodNull:Ir,ZodAny:Ar,ZodUnknown:Or,ZodNever:Cr,ZodVoid:kr,ZodArray:Nr,get objectUtil(){return Mr},ZodObject:xr,ZodUnion:Dr,ZodDiscriminatedUnion:Lr,ZodIntersection:Br,ZodTuple:Zr,ZodRecord:zr,ZodMap:Wr,ZodSet:Fr,ZodFunction:Gr,ZodLazy:Vr,ZodLiteral:Hr,ZodEnum:Jr,ZodNativeEnum:qr,ZodPromise:Qr,ZodEffects:Yr,ZodTransformer:Yr,ZodOptional:$r,ZodNullable:Xr,ZodDefault:ei,ZodCatch:ti,ZodNaN:ni,BRAND:ri,ZodBranded:ii,ZodPipeline:oi,custom:ai,Schema:fr,ZodSchema:fr,late:si,get ZodFirstPartyTypeKind(){return ui},coerce:Fi,any:gi,array:bi,bigint:pi,boolean:fi,date:hi,discriminatedUnion:Ii,effect:ji,enum:Di,function:Mi,instanceof:(e,t={message:`Input not instance of ${e.name}`})=>ai((t=>t instanceof e),t,!0),intersection:Ai,lazy:Ri,literal:xi,map:ki,nan:di,nativeEnum:Ui,never:wi,null:yi,nullable:Zi,number:li,object:Ei,oboolean:()=>fi().optional(),onumber:()=>li().optional(),optional:Bi,ostring:()=>ci().optional(),pipeline:Wi,preprocess:zi,promise:Li,record:Ci,set:Ni,strictObject:Pi,string:ci,symbol:mi,transformer:ji,tuple:Oi,undefined:vi,union:Si,unknown:_i,void:Ti,NEVER:Gi,ZodIssueCode:Jn,quotelessJson:e=>JSON.stringify(e,null,2).replace(/"([^"]+)":/g,"$1:"),ZodError:qn}),Hi=function(){function t(){var e,n,r,i,a,u,c,l,d,p,f,h,m,v,y,g,_,w,T,b,E,P,S,I,A,O,C;Ct(this,t),this.initConfig=window.APP_CONFIG;var k=Ot.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?Y:$;this.hideIOSSafeAreaBottom=!!(null===(u=this.initConfig)||void 0===u||null===(c=u.app)||void 0===c?void 0:c.hideIOSSafeAreaBottom),this.hideAndroidBottomNavigationBar=!!(null===(l=this.initConfig)||void 0===l||null===(d=l.app)||void 0===d?void 0:d.hideAndroidBottomNavigationBar);var N,M,R="none"===(null===(p=this.initConfig)||void 0===p||null===(f=p.app)||void 0===f?void 0:f.leftButton)||"home"===(null===(h=this.initConfig)||void 0===h||null===(m=h.app)||void 0===m?void 0:m.leftButton)?Q.HIDE_BACK:Q.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)?Q.SHOW_HOME:Q.HIDE_HOME,D=new URL(location.href),U=On(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)&&(k=(null===(N=this.initConfig)||void 0===N||null===(M=N.app)||void 0===M?void 0:M.actionBarHidden)?$:Y);this.config={actionbarType:k,buttonType:R,statusbarType:U,dataConfig:{backgroundColor:(null===(P=this.initConfig)||void 0===P||null===(S=P.app)||void 0===S?void 0:S.headerColor)||X,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===(C=O.app)||void 0===C?void 0:C.textAlign)||ee,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 Ce((function(){return xe(this,(function(t){return[2,new Promise((function(t,n){yn("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 Ce((function(){var r,i;return xe(this,(function(o){return void 0===(void 0===e?"undefined":Tt(e))&&null===(void 0===e?"undefined":Tt(e))||(r="none"===e||"home"===e?Q.HIDE_BACK:Q.SHOW_BACK,i="home"===e||"both"===e?Q.SHOW_HOME:Q.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){yn("CHANGE_ACTIONBAR_LEFTBUTTON_TYPE",Ve({},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 Ce((function(){var r,i,o;return xe(this,(function(a){return i=t?e.AndroidBottomNavigationBarType.hide:e.AndroidBottomNavigationBarType.show,o=null===(r=Ze())||void 0===r?void 0:r.platform,[2,new Promise((function(e,r){if(!(null==o?void 0:o.isAndroid))return e();yn("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 Ce((function(){var r,i,o;return xe(this,(function(a){return i=t?e.IOSSafeAreaBottomType.hide:e.IOSSafeAreaBottomType.show,o=null===(r=Ze())||void 0===r?void 0:r.platform,[2,new Promise((function(e,r){if(!(null==o?void 0:o.isIOS))return e();yn("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 Ce((function(){var r;return xe(this,(function(i){return r=n.config,Ot.isString(t.headerColor)&&(r.dataConfig.backgroundColor=t.headerColor),Ot.isString(t.headerTextColor)&&(r.dataConfig.textColor=t.headerTextColor),Ot.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=$:!1===t.hideActionBar&&(r.actionbarType=Y),"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){yn("CHANGE_ACTIONBAR",Ve({},r),{success:function(){var o;n.config=Ve({},r);var a,s=null===(o=Ze())||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===$;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}(),Ki=Hi.getInstance(),Ji=[Ei({title:ci()}).optional()];function qi(e){return Qi.apply(this,arguments)}function Qi(){return Qi=Ce((function(e){return xe(this,(function(t){return[2,Un("setNavigationBarTitle",Ji,[e],function(){var e=Ce((function(e){return xe(this,(function(t){switch(t.label){case 0:return ze.isMp?[4,Ki.setNavigationBarTitle(e.title)]:[3,2];case 1:return[2,t.sent()];case 2:return ze.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Fe("setNavigationBarTitle",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Qi.apply(this,arguments)}var Yi=[Ei({color:ci(),textColor:Vi.enum(["black","white"]).optional(),statusBarColor:ci().optional()}).optional()];function $i(e){return Xi.apply(this,arguments)}function Xi(){return Xi=Ce((function(e){return xe(this,(function(t){return[2,Un("setNavigationBarColor",Yi,[e],function(){var e=Ce((function(e){return xe(this,(function(t){switch(t.label){case 0:return ze.isMp?[4,Ki.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 ze.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Fe("setNavigationBarColor",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Xi.apply(this,arguments)}var eo=[Ei({type:Vi.enum(["none","back","home","both"])}).optional()];function to(e){return no.apply(this,arguments)}function no(){return no=Ce((function(e){return xe(this,(function(t){return[2,Un("setNavigationBarLeftButton",eo,[e],function(){var e=Ce((function(e){return xe(this,(function(t){switch(t.label){case 0:return ze.isMp?[4,Ki.setNavigationBarLeftButton(e.type)]:[3,2];case 1:return[2,t.sent()];case 2:return ze.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Fe("setNavigationBarLeftButton",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),no.apply(this,arguments)}function ro(e,t,n){if(!t.has(e))throw new TypeError("attempted to "+n+" private field on non-instance");return t.get(e)}function io(e,t){return function(e,t){return t.get?t.get.call(e):t.value}(e,ro(e,t,"get"))}function oo(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 ao(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,ro(e,t,"set"),n),n}var so,uo,co=function(){function e(){Ct(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(Ge({},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}(),lo=new WeakMap,po=new WeakMap,fo=new WeakMap,ho=function(e){Ut(n,e);var t=jt(n);function n(e){var r;return Ct(this,n),oo(Lt(r=t.call(this)),lo,{writable:!0,value:localStorage}),oo(Lt(r),po,{writable:!0,value:void 0}),oo(Lt(r),fo,{writable:!0,value:void 0}),ao(Lt(r),fo,{keys:new Set,currentSize:0,limitSize:F}),ao(Lt(r),po,e),r.findAllCurrentDataByApp(e),r}var r=n.prototype;return r.findAllCurrentDataByApp=function(e){try{var t;for(t in io(this,lo)){if(e)if(t.split("_")[0]!==e)continue;io(this,fo).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 io(this,po)&&(e="".concat(io(this,po),"_").concat(e)),io(this,fo).keys.has(e)?io(this,lo).getItem(e):null},r.set=function(e){var t=this;return Ce((function(){return xe(this,(function(n){return Object.entries(e).forEach((function(e){var n=He(e,2),r=n[0],i=n[1];t.setSync(r,i.replace(/\\"/g,'"'))})),[2,Promise.resolve({errorKeys:[]})]}))}))()},r.setSync=function(e,t){io(this,po)&&(e="".concat(io(this,po),"_").concat(e)),io(this,lo).setItem(e,t),io(this,fo).keys.add(e)},r.getInfo=function(){var e=this;return Ce((function(){return xe(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}(io(this,lo),io(this,po));return{currentSize:Ot.isNumber(e)?Number((e/1024).toFixed(2)):0,limitSize:Number((F/1024).toFixed(2))}},r.remove=function(e){var t=this;return Ce((function(){return xe(this,(function(n){return e.forEach((function(e){t.removeSync(e)})),[2,Promise.resolve({errorKeys:[]})]}))}))()},r.removeSync=function(e){io(this,po)&&(e="".concat(io(this,po),"_").concat(e)),io(this,fo).keys.has(e)&&(io(this,lo).removeItem(e),io(this,fo).keys.delete(e))},r.clearAsync=function(){var e=this;return Ce((function(){return xe(this,(function(t){return[2,Promise.resolve(e.clearSync())]}))}))()},r.clearSync=function(){var e=this;io(this,fo).keys.forEach((function(t){io(e,po)&&t.indexOf(io(e,po))<0||(io(e,lo).removeItem(t),io(e,fo).keys.delete(t))}))},r.setSynchronize=function(e){var t=this;return Object.entries(e).forEach((function(e){var n=He(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}(co),mo=new WeakMap,vo=new WeakMap,yo=function(e){Ut(n,e);var t=jt(n);function n(e){var r;return Ct(this,n),oo(Lt(r=t.call(this)),mo,{writable:!0,value:void 0}),oo(Lt(r),vo,{writable:!0,value:void 0}),ao(Lt(r),vo,{keys:new Set,currentSize:0,limitSize:F}),ao(Lt(r),mo,e),r}var r=n.prototype;return r.get=function(e){var t=this;return Ce((function(){return xe(this,(function(n){return[2,new Promise((function(n,r){yn("ZBROWSER_MPDS",{mpds_action:"mpds.get",mpds_data:{keys:e},appId:io(t,mo)},{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:io(this,mo)},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 Ce((function(){return xe(this,(function(n){return[2,new Promise((function(n,r){yn("ZBROWSER_MPDS",{mpds_action:"mpds.set",mpds_data:{map:e},appId:io(t,mo)},{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:io(this,mo)},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 Ce((function(){return xe(this,(function(t){return[2,new Promise((function(t,n){yn("ZBROWSER_MPDS",{mpds_action:"mpds.get.size",mpds_data:{},appId:io(e,mo)},{success:function(e){var n=0;e&&e.mpds_data&&e.mpds_data.size&&(n=e.mpds_data.size),t({currentSize:Ot.isNumber(n)?Number(Number(n)/1024):0,limitSize:Number(F/1024)})},fail:function(e){n(e)}},{isMultiCallback:!1})}))]}))}))()},r.getInfoSynchronize=function(){var e={mpds_action:"mpds.get.size",mpds_data:{},appId:io(this,mo)},t=0,n=this.handleResult(e);return n&&n.mpds_data&&n.mpds_data.size&&(t=n.mpds_data.size),{currentSize:Ot.isNumber(t)?Number(Number(t)/1024):0,limitSize:Number(F/1024)}},r.remove=function(e){var t=this;return Ce((function(){return xe(this,(function(n){return[2,new Promise((function(n,r){yn("ZBROWSER_MPDS",{mpds_action:"mpds.remove.key",mpds_data:{keys:e},appId:io(t,mo)},{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:io(this,mo)},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 Ce((function(){return xe(this,(function(t){return[2,new Promise((function(t,n){yn("ZBROWSER_MPDS",{mpds_action:"mpds.clear.appData",mpds_data:{},appId:io(e,mo)},{success:function(){t()},fail:function(e){n(e)}},{isMultiCallback:!1})}))]}))}))()},r.clearSynchronize=function(){var e={mpds_action:"mpds.clear.appData",mpds_data:{},appId:io(this,mo)};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=vn(n).toJSON()}}catch(e){t=e}finally{if(null!==t)throw t}return{}},n}(co),go=function(){function e(){Ct(this,e)}var t=e.prototype;return t.getDataFromStorage=function(e){var t=this;return Ce((function(){var n,r;return xe(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]=Pn(e)})),[2,r]}}))}))()},t.getItem=function(e){return this.getInstance().getItem(e)},t.putDataToStorage=function(e){var t=this;return Ce((function(){var n,r;return xe(this,(function(i){switch(i.label){case 0:return n=t.getInstance(),r={},Object.entries(e).forEach((function(e){var t=He(e,2),n=t[0],i=t[1];Ot.isUndefined(i)||Ot.isNull(i)||(r[n]=An(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 Ce((function(){return xe(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 Ce((function(){return xe(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 Ce((function(){return xe(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}(),_o=new WeakMap,wo=function(e){Ut(n,e);var t=jt(n);function n(e){var r;return Ct(this,n),oo(Lt(r=t.call(this)),_o,{writable:!0,value:void 0}),ao(Lt(r),_o,e),r}return n.prototype.getInstance=function(){return new ho(io(this,_o))},n}(go),To=new WeakMap,bo=function(e){Ut(n,e);var t=jt(n);function n(e){var r;return Ct(this,n),oo(Lt(r=t.call(this)),To,{writable:!0,value:void 0}),ao(Lt(r),To,e),r}return n.prototype.getInstance=function(){return new yo(io(this,To))},n}(go),Eo=new wo(o),Po=an(),So=(null===(so=Ze())||void 0===so?void 0:so.platformName)||"unknown";Po>0&&Po>={android:12100571,iOS:400,wp:0,unknown:0}[So]&&(null===(uo=Ze())||void 0===uo?void 0:uo.appEnv.isMp)&&(Eo=new bo(o));var Io=Eo,Ao=[Ei({data:Vi.record(ci(),Vi.any())}).optional()];function Oo(e){return Co.apply(this,arguments)}function Co(){return Co=Ce((function(e){return xe(this,(function(t){return[2,Un("setStorage",Ao,[e],function(){var e=Ce((function(e){return xe(this,(function(t){switch(t.label){case 0:return ze.isMp||ze.isMpWeb?[4,Io.putDataToStorage(e.data)]:[3,2];case 1:return[2,t.sent()];case 2:return[2,Promise.reject(Fe("setStorage",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Co.apply(this,arguments)}var ko=[Ei({keys:Vi.array(ci())}).optional()];function No(e){return Mo.apply(this,arguments)}function Mo(){return Mo=Ce((function(e){return xe(this,(function(t){return[2,Un("getStorage",ko,[e],function(){var e=Ce((function(e){return xe(this,(function(t){switch(t.label){case 0:return ze.isMp||ze.isMpWeb?[4,Io.getDataFromStorage(e.keys)]:[3,2];case 1:return[2,t.sent()];case 2:return[2,Promise.reject(Fe("getStorage",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Mo.apply(this,arguments)}function Ro(e){return xo.apply(this,arguments)}function xo(){return(xo=Ce((function(e){return xe(this,(function(t){return[2,Un("getStorageInfo",[],[e],Ce((function(){return xe(this,(function(e){switch(e.label){case 0:return ze.isMp||ze.isMpWeb?[4,Io.getStorageInfo()]:[3,2];case 1:return[2,e.sent()];case 2:return[2,Promise.reject(Fe("getStorageInfo",{}))]}}))})))]}))}))).apply(this,arguments)}var Do=[Ei({keys:Vi.array(ci())}).optional()];function Uo(e){return Lo.apply(this,arguments)}function Lo(){return Lo=Ce((function(e){return xe(this,(function(t){return[2,Un("removeStorage",Do,[e],function(){var e=Ce((function(e){return xe(this,(function(t){switch(t.label){case 0:return ze.isMp||ze.isMpWeb?[4,Io.removeDataFromStorage(e.keys)]:[3,2];case 1:return[2,t.sent()];case 2:return[2,Promise.reject(Fe("removeStorage",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Lo.apply(this,arguments)}var jo=[Ei({prefix:ci().optional()}).optional()];function Bo(e){return Zo.apply(this,arguments)}function Zo(){return(Zo=Ce((function(e){return xe(this,(function(t){return[2,Un("clearStorage",jo,[e],Ce((function(){return xe(this,(function(e){switch(e.label){case 0:return ze.isMp||ze.isMpWeb?[4,Io.clearStorage()]:[3,2];case 1:return[2,e.sent()];case 2:return[2,Promise.reject(Fe("clearStorage",{}))]}}))})))]}))}))).apply(this,arguments)}var zo=function(){var e=Ce((function(e,t){var n,r,i,a;return xe(this,(function(s){switch(s.label){case 0:return(r=t)?[3,2]:[4,Nn()];case 1:r=!s.sent(),s.label=2;case 2:return n=r,[4,wn.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=Ce((function(e){var t,n,r,i,o,a;return xe(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)||A,new ln(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)}}(),Wo=[Ei({avatarType:Vi.enum(["small","normal","large"]).optional(),autoRequestPermission:Vi.boolean().default(!1).optional()}).optional()];function Fo(e){return Go.apply(this,arguments)}function Go(){return Go=Ce((function(e){return xe(this,(function(t){return[2,Un("getUserInfo",Wo,[e],function(){var e=Ce((function(e){var t,n,r;return xe(this,(function(i){switch(i.label){case 0:if(!ze.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,zo(t,n)];case 2:return[2,{userInfo:i.sent()}];case 3:return r=i.sent(),[2,Promise.reject(r)];case 4:return ze.isMpWeb?[2,Promise.resolve({userInfo:{id:"3368637342326461234",name:"User Name",avatar:"https://h5.zdn.vn/static/images/avatar.png"}})]:[2,Promise.reject(Fe("getUserInfo",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Go.apply(this,arguments)}var Vo=function(e){return{NONE:e?-2:0,WIFI:e?0:1,"2G":2,"3G":e?15:2,"4G":e?13:2}},Ho=Ce((function(){return xe(this,(function(t){return[2,new Promise((function(t,n){yn("WEBVIEW_NETWORKTYPE",{url:window.location.href,featureId:""},{success:function(n){var r,i,o,a=n.network,s=(null===(r=Ze())||void 0===r||null===(i=r.platform)||void 0===i?void 0:i.isAndroid)||!1;switch(a){case Vo(s).NONE:o=e.NetworkType.none;break;case Vo(s).WIFI:o=e.NetworkType.wifi;break;case Vo(s)["2G"]:case Vo(s)["3G"]:case Vo(s)["4G"]:o=e.NetworkType.cellular;break;default:o=e.NetworkType.unknown}t(o)},fail:function(e){n(e)}},{})}))]}))}));function Ko(e){return Jo.apply(this,arguments)}function Jo(){return(Jo=Ce((function(t){return xe(this,(function(n){return[2,Un("getNetworkType",[],[t],Ce((function(){var t,n;return xe(this,(function(r){switch(r.label){case 0:return ze.isMp?[4,Ho()]:[3,2];case 1:return[2,{networkType:r.sent()}];case 2:if(ze.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(Fe("getNetworkType",{}))]}}))})))]}))}))).apply(this,arguments)}var qo=[Vi.function().args(Ei({isConnected:Vi.boolean(),networkType:Vi.enum(["none","wifi","cellular","unknown"])})).returns(Vi.void())];function Qo(t){return Un("onNetworkStatusChange",qo,[t],(function(t){var n=t;if(ze.isMp)!function(t){Gt.getInstance().on(e.Events.NetworkChanged,(function(e){var n=null==e?void 0:e.state;Ho().then((function(e){t({isConnected:"CONNECTED"===n,networkType:e})}))}))}(n);else if(ze.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 Yo=function(){var e=Ce((function(e){var t,n,r,i,o,a;return xe(this,(function(s){return a={subaction:0,scanning_type:Ot.isNumber(null==e?void 0:e.scanningType)?e.scanningType:0,data:{scan_from_source:Ot.isString(null==e?void 0:e.scanFromSource)?e.scanFromSource:"",expire:Ot.isNumber(null==e?void 0:e.expire)?e.expire:3e3,monitor_interval:Ot.isNumber(null==e?void 0:e.monitorInterval)?e.monitorInterval:60,domain:Ot.isString(null==e?void 0:e.domain)?e.domain:"",scan_config:{scan_time:Ot.isNumber(null==e||null===(t=e.scanConfig)||void 0===t?void 0:t.scanTime)?e.scanConfig.scanTime:15e3,time_between_scan:Ot.isNumber(null==e||null===(n=e.scanConfig)||void 0===n?void 0:n.timeBetweenScan)?e.scanConfig.timeBetweenScan:1e4,beacon_timeout:Ot.isNumber(null==e||null===(r=e.scanConfig)||void 0===r?void 0:r.beaconTimeout)?e.scanConfig.beaconTimeout:3e4,delayCheckConnectedTimeout:Ot.isNumber(null==e||null===(i=e.scanConfig)||void 0===i?void 0:i.delayCheckConnectedTimeout)?e.scanConfig.delayCheckConnectedTimeout:5e3,beaconConnectedTimeout:Ot.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){yn("SCAN_IBEACON",Ve({},a),{success:function(){e(!0)},fail:function(e){t(e)}},{})}))]}))}));return function(t){return e.apply(this,arguments)}}(),$o=[Ei({scanningType:Vi.number().refine((function(e){return[0,1].includes(e)}),{message:"The type must be either 0 or 1"}).default(0).optional(),expire:Vi.number().optional(),monitorInterval:Vi.number().optional(),domain:Vi.string().optional(),scanConfig:Ei({scanTime:Vi.number().optional(),timeBetweenScan:Vi.number().optional(),beaconTimeout:Vi.number().optional(),delayCheckConnectedTimeout:Vi.number().optional(),beaconConnectedTimeout:Vi.number().optional()}).optional(),items:Vi.array(Ei({id:Vi.string().optional(),distance:Vi.number().optional(),monitor:Ei({enable:Vi.boolean().optional(),movingRange:Vi.number().optional()}).optional()})).optional(),scanFromSource:Vi.string().optional()}).optional()];function Xo(e){return ea.apply(this,arguments)}function ea(){return(ea=Ce((function(e){return xe(this,(function(t){return[2,Un("startBeaconDiscovery",$o,[e],Ce((function(){return xe(this,(function(t){switch(t.label){case 0:return ze.isMp?[4,Yo(e)]:[3,2];case 1:return[2,t.sent()];case 2:return ze.isMpWeb?[2,Promise.resolve(!0)]:[2,Promise.reject(Fe("startBeaconDiscovery",{}))]}}))})))]}))}))).apply(this,arguments)}var ta=Ce((function(){return xe(this,(function(e){return[2,new Promise((function(e,t){yn("SCAN_IBEACON",{subaction:2},{success:function(){e(!0)},fail:function(e){t(e)}},{})}))]}))}));function na(e){return ra.apply(this,arguments)}function ra(){return(ra=Ce((function(e){return xe(this,(function(t){return[2,Un("stopBeaconDiscovery",[],[e],Ce((function(){return xe(this,(function(e){switch(e.label){case 0:return ze.isMp?[4,ta()]:[3,2];case 1:return[2,e.sent()];case 2:return ze.isMpWeb?[2,Promise.resolve(!0)]:[2,Promise.reject(Fe("stopBeaconDiscovery",{}))]}}))})))]}))}))).apply(this,arguments)}var ia=Ce((function(){return xe(this,(function(e){return[2,new Promise((function(e,t){yn("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 oa(e){return aa.apply(this,arguments)}function aa(){return(aa=Ce((function(e){return xe(this,(function(t){return[2,Un("getBeacons",[],[e],Ce((function(){return xe(this,(function(e){switch(e.label){case 0:return ze.isMp?[4,ia()]:[3,2];case 1:return[2,e.sent()];case 2:return ze.isMpWeb?[2,Promise.resolve({beacons:[]})]:[2,Promise.reject(Fe("getBeacons",{}))]}}))})))]}))}))).apply(this,arguments)}var sa=Ce((function(){return xe(this,(function(e){return[2,new Promise((function(e,t){yn("WINDOW_CLOSE",{},{success:function(t){e(t)},fail:function(e){t(e)}},{})}))]}))}));function ua(e){return ca.apply(this,arguments)}function ca(){return(ca=Ce((function(e){return xe(this,(function(t){return[2,Un("closeApp",[],[e],Ce((function(){return xe(this,(function(e){switch(e.label){case 0:return ze.isMp?[4,sa()]:[3,2];case 1:return[2,e.sent()];case 2:return ze.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Fe("closeApp",{}))]}}))})))]}))}))).apply(this,arguments)}var la=Ce((function(){return xe(this,(function(e){return[2,new Promise((function(e,t){yn("OPEN_QR",{skipOpenLink:!0},{success:function(t){e(t)},fail:function(e){t(e)}},{})}))]}))}));function da(e){return pa.apply(this,arguments)}function pa(){return(pa=Ce((function(e){return xe(this,(function(t){return[2,Un("scanQRCode",[],[e],Ce((function(){return xe(this,(function(e){switch(e.label){case 0:return ze.isMp?[4,la()]:[3,2];case 1:return[2,e.sent()];case 2:return ze.isMpWeb?[2,Promise.resolve({content:""})]:[2,Promise.reject(Fe("scanQRCode",{}))]}}))})))]}))}))).apply(this,arguments)}var fa=function(){var t=Ce((function(t,n,r,o){return xe(this,(function(a){return[2,new Promise((function(a,s){yn("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)}}(),ha=[Ei({id:ci(),type:Vi.enum(["user","oa","aliasOA"]),sourceId:Vi.any().optional(),sourceIndex:Vi.any().optional()}).optional()];function ma(e){return va.apply(this,arguments)}function va(){return va=Ce((function(e){return xe(this,(function(t){return[2,Un("openProfile",ha,[e],function(){var e=Ce((function(e){var t,n,r,i;return xe(this,(function(o){switch(o.label){case 0:return ze.isMp?(t=e.id,n=e.type,r=e.sourceId,i=e.sourceIndex,[4,fa(t,n,r,i)]):[3,2];case 1:return[2,o.sent()];case 2:return ze.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Fe("openProfile",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),va.apply(this,arguments)}var ya=function(){var t=Ce((function(t,n){var r,o,a,s=arguments;return xe(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){yn("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)}}(),ga=[Ei({id:ci(),type:Vi.enum(["user","oa"]),sourceId:Vi.any().optional(),sourceIndex:Vi.any().optional(),message:ci().optional()}).optional()];function _a(e){return wa.apply(this,arguments)}function wa(){return wa=Ce((function(e){return xe(this,(function(t){return[2,Un("openChat",ga,[e],function(){var e=Ce((function(e){var t,n,r,i,o;return xe(this,(function(a){switch(a.label){case 0:return ze.isMp?(t=e.id,n=e.type,r=e.message,i=e.sourceId,o=e.sourceIndex,[4,ya(t,n,r,i,o)]):[3,2];case 1:return[2,a.sent()];case 2:return ze.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Fe("openChat",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),wa.apply(this,arguments)}function Ta(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 ba=function(){var t=Ce((function(t,n){var r,o;return xe(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){yn("OPEN_POSTFEED",Ta(Ve({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)}}(),Ea=[Vi.union([Ei({type:Vi.enum(["image"]),data:Ei({imageUrl:ci().url().optional(),imageUrls:Vi.array(ci().url()).optional()})}),Ei({type:Vi.enum(["link"]),data:Ei({link:ci().url(),title:ci().max(100).optional(),thumb:ci().url().optional(),description:ci().max(400).default("").optional()})}),Ei({type:Vi.enum(["profile"]),data:Ei({id:ci().optional()})})])];function Pa(e){return Sa.apply(this,arguments)}function Sa(){return Sa=Ce((function(e){return xe(this,(function(t){return[2,Un("openPostFeed",Ea,[e],function(){var e=Ce((function(e){var t,n;return xe(this,(function(r){switch(r.label){case 0:return ze.isMp?(t=e.type,n=e.data,[4,ba(t,n)]):[3,2];case 1:return[2,r.sent()];case 2:return ze.isMpWeb?[2,Promise.resolve({status:1,shareType:0,numberOfUser:0})]:[2,Promise.reject(Fe("openPostFeed",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Sa.apply(this,arguments)}var Ia=function(){var e=Ce((function(e){return xe(this,(function(t){return[2,new Promise((function(t,n){yn("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)}}(),Aa=[Ei({id:ci(),showDialogConfirm:Vi.boolean().optional()}).optional()];function Oa(e){return Ca.apply(this,arguments)}function Ca(){return Ca=Ce((function(e){return xe(this,(function(t){return[2,Un("followOA",Aa,[e],function(){var e=Ce((function(e){var t;return xe(this,(function(n){switch(n.label){case 0:return ze.isMp?(t=e.id,[4,Ia(t)]):[3,2];case 1:return[2,n.sent()];case 2:return ze.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Fe("followOA",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Ca.apply(this,arguments)}var ka=function(){var e=Ce((function(e){return xe(this,(function(t){return[2,new Promise((function(t,n){yn("UNFOLLOW_OA",{uid:e,forceUpdate:!0,zapp:i},{success:function(){t()},fail:function(e){n(e)}},{})}))]}))}));return function(t){return e.apply(this,arguments)}}(),Na=[Ei({id:ci()}).optional()];function Ma(e){return Ra.apply(this,arguments)}function Ra(){return Ra=Ce((function(e){return xe(this,(function(t){return[2,Un("unfollowOA",Na,[e],function(){var e=Ce((function(e){var t;return xe(this,(function(n){switch(n.label){case 0:return ze.isMp?(t=e.id,[4,ka(t)]):[3,2];case 1:return[2,n.sent()];case 2:return ze.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Fe("unfollowOA",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Ra.apply(this,arguments)}var xa=function(){var e=Ce((function(e,t,n,r,i,o){var s,u,l,p,f,h,m,v;return xe(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,Ve({method:"POST",body:p},m))];case 1:return[4,y.sent().json()];case 2:if(!(v=y.sent())||0!==v.err)throw mn.error.cannotGetShareInfo();return h.search="".concat(h.search,"&zshareId=").concat(v.data.shareId),[2,Ta(Ve({},v.data),{shareableLink:h.href})]}}))}));return function(t,n,r,i,o,a){return e.apply(this,arguments)}}(),Da=function(){var t=Ce((function(t,n){var r,a,s,u,c,l,d,p,f,h,m;return xe(this,(function(v){switch(v.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 c=[],l=an(),d=(null===(u=Ze())||void 0===u?void 0:u.platformName)||"unknown",Number(l)>=W[d]&&(a="multi_image"),Array.isArray(null==n?void 0:n.imageUrls)&&(null==n?void 0:n.imageUrls.length)>0?c=null==n?void 0:n.imageUrls:c.push(null==n?void 0:n.imageUrl),r={photoUrls:c,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,wn.getAccessToken()];case 8:case 11:return s=v.sent(),[4,xa(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 p=v.sent(),r={data:{ZInstantAPIInfo:{url:"".concat(p.zinstantApi),zinstantdata_id:"templateId=".concat(p.ztemplateId,"&appId=").concat(o,"&shareId=").concat(p.shareId)},previewMsgText:{msg:{en:"Zalo Mini Program",vi:"Chương trình nhỏ"}},enableReactions:1}},[3,14];case 12:return f=v.sent().shareableLink,h=new URL(f),m=h.searchParams.getAll("zshareId"),h.searchParams.delete("zshareId"),m.length>0&&h.searchParams.append("zshareId",m[0]),r={link:h.href,chatOnly:0},[3,14];case 13:return[3,14];case 14:return[2,new Promise((function(t,n){yn("OPEN_SHARESHEET",Ta(Ve({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)}}(),Ua=[Vi.union([Ei({type:Vi.enum(["text"]),data:Ei({text:ci(),description:ci().default("").optional(),autoParseLink:Vi.boolean().default(!1).optional()})}),Ei({type:Vi.enum(["image"]),data:Ei({imageUrl:ci().url().optional(),imageUrls:Vi.array(ci().url()).max(10).optional()})}),Ei({type:Vi.enum(["link"]),data:Ei({link:ci().url(),chatOnly:Vi.boolean().optional()})}),Ei({type:Vi.enum(["oa"]),data:Ei({id:ci()})}),Ei({type:Vi.enum(["gif"]),data:Ei({gifUrl:ci().url(),imageUrl:ci().url().optional(),width:li().min(0).optional(),height:li().min(0).optional()})}),Ei({type:Vi.enum(["video"]),data:Ei({videoThumb:ci().url(),videoUrl:ci().url(),width:li().min(0).optional(),height:li().min(0).optional()})}),Ei({type:Vi.enum(["zmp","zmp_deep_link"]),data:Ei({title:ci().max(100),thumbnail:ci().url(),path:ci().optional(),description:ci().max(400).default("").optional()})})])];function La(e){return ja.apply(this,arguments)}function ja(){return ja=Ce((function(e){return xe(this,(function(t){return[2,Un("openShareSheet",Ua,[e],function(){var e=Ce((function(e){var t,n;return xe(this,(function(r){switch(r.label){case 0:return ze.isMp?(t=e.type,n=e.data,[4,Da(t,n)]):[3,2];case 1:return[2,r.sent()];case 2:return ze.isMpWeb?[2,Promise.resolve({status:2,shareType:0,numberOfUser:0})]:[2,Promise.reject(Fe("openShareSheet",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),ja.apply(this,arguments)}var Ba=Ce((function(){return xe(this,(function(e){return[2,new Promise((function(e,t){yn("REQUEST_PERMISSION_CAMERA",{},{success:function(t){var n,r;(null===(n=Ze())||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=Ze())||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 Za(e){return za.apply(this,arguments)}function za(){return(za=Ce((function(e){return xe(this,(function(t){return[2,Un("requestCameraPermission",[],[e],Ce((function(){return xe(this,(function(e){switch(e.label){case 0:return[4,Ba()];case 1:return[2,e.sent()]}}))})))]}))}))).apply(this,arguments)}var Wa=function(){var e=Ce((function(e,t,n){return xe(this,(function(r){return[2,new Promise((function(r,i){yn("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)}}(),Fa=Ce((function(){var e,t,n,r=arguments;return xe(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=Gn(),[4,tn(e,t,n.version)];case 1:return[2,i.sent()]}}))})),Ga=function(){var e=Ce((function(e){return xe(this,(function(t){return[2,new Promise((function(t,n){yn("OPEN_OUTAPP",{url:e},{success:function(){t()},fail:function(e){n(e)}},{})}))]}))}));return function(t){return e.apply(this,arguments)}}(),Va=[Ei({params:Vi.record(ci(),ci()).optional()}).optional()];function Ha(e){return Ka.apply(this,arguments)}function Ka(){return Ka=Ce((function(e){return xe(this,(function(t){return[2,Un("createShortcut",Va,[e],function(){var e=Ce((function(e){var t,n,r,i,s,u,c,l;return xe(this,(function(d){switch(d.label){case 0:return ze.isMp?[4,Fa(o,0)]:[3,6];case 1:return r=d.sent(),i=null===(t=Ze())||void 0===t||null===(n=t.platform)||void 0===n?void 0:n.isIOS,s=r.logoUrl||In("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,Ga(encodeURI(l))]):[3,3];case 2:return d.sent(),[3,5];case 3:return[4,Wa("".concat(a,"/").concat(o,"/?").concat(c.toString()),u,s)];case 4:d.sent(),d.label=5;case 5:return[2,mn.success()];case 6:return ze.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Fe("createShortcut",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Ka.apply(this,arguments)}var Ja=function(){var e=Ce((function(e,t,n){return xe(this,(function(r){return[2,new Promise((function(r,o){yn("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)}}(),qa=[Ei({secretData:ci(),ui:Ei({title:ci().default("Xác thực").optional(),subTitle:ci().default("Sử dụng sinh trắc học của bạn để xác thực").optional(),negativeButtonText:ci().default("Đóng").optional()}).optional(),requireFingerprint:fi().default(!0).optional()}).optional()];function Qa(e){return Ya.apply(this,arguments)}function Ya(){return Ya=Ce((function(e){return xe(this,(function(t){return[2,Un("openBioAuthentication",qa,[e],function(){var e=Ce((function(e){var t,n,r;return xe(this,(function(i){switch(i.label){case 0:return ze.isMp?(t=e.secretData,n=e.ui,r=e.requireFingerprint,[4,Ja(t,n,r)]):[3,2];case 1:return[2,i.sent()];case 2:return ze.isMpWeb?[2,Promise.resolve({code:0,message:"OK",data:{domain:"",code:0,message:"",payToken:""}})]:[2,Promise.reject(Fe("openBioAuthentication",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Ya.apply(this,arguments)}var $a=Ce((function(){return xe(this,(function(e){return[2,new Promise((function(e,t){yn("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 Xa(e){return es.apply(this,arguments)}function es(){return(es=Ce((function(e){return xe(this,(function(t){return[2,Un("checkStateBioAuthentication",[],[e],Ce((function(){return xe(this,(function(e){switch(e.label){case 0:return ze.isMp?[4,$a()]:[3,2];case 1:return[2,{bioState:e.sent()}];case 2:return ze.isMpWeb?[2,Promise.resolve({bioState:""})]:[2,Promise.reject(Fe("checkStateBioAuthentication",{}))]}}))})))]}))}))).apply(this,arguments)}var ts=function(){var e=Ce((function(e){return xe(this,(function(t){return[2,new Promise((function(t,n){yn("SHOW_TOAST",{toast:e},{success:function(){t()},fail:function(e){n(e)}},{})}))]}))}));return function(t){return e.apply(this,arguments)}}(),ns=[Ei({message:ci()}).optional()];function rs(e){return is.apply(this,arguments)}function is(){return is=Ce((function(e){return xe(this,(function(t){return[2,Un("showToast",ns,[e],function(){var e=Ce((function(e){return xe(this,(function(t){switch(t.label){case 0:return ze.isMp?[4,ts(e.message)]:[3,2];case 1:return[2,t.sent()];case 2:return ze.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Fe("showToast",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),is.apply(this,arguments)}var os=Ce((function(){return xe(this,(function(e){return[2,new Promise((function(e,t){yn("HIDE_KEYBOARD",{},{success:function(){e()},fail:function(e){t(e)}},{})}))]}))}));function as(e){return ss.apply(this,arguments)}function ss(){return(ss=Ce((function(e){return xe(this,(function(t){return[2,Un("hideKeyboard",[],[e],Ce((function(){return xe(this,(function(e){switch(e.label){case 0:return ze.isMp?[4,os()]:[3,2];case 1:return[2,e.sent()];case 2:return ze.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Fe("hideKeyboard",{}))]}}))})))]}))}))).apply(this,arguments)}var us=function(){var e=Ce((function(e){return xe(this,(function(t){return[2,new Promise((function(t,n){yn("OPEN_PHONE",{phoneNum:e,phoneCode:e},{success:function(){t()},fail:function(e){n(e)}},{})}))]}))}));return function(t){return e.apply(this,arguments)}}(),cs=[Ei({phoneNumber:ci()})];function ls(e){return ds.apply(this,arguments)}function ds(){return ds=Ce((function(e){return xe(this,(function(t){return[2,Un("openPhone",cs,[e],function(){var e=Ce((function(e){return xe(this,(function(t){switch(t.label){case 0:return ze.isMp?[4,us(e.phoneNumber)]:[3,2];case 1:return[2,t.sent()];case 2:return ze.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Fe("openPhone",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),ds.apply(this,arguments)}var ps=function(){var e=Ce((function(e,t){return xe(this,(function(n){return[2,new Promise((function(n,r){yn("OPEN_SMS",{content:t,phoneCode:e},{success:function(){n()},fail:function(e){r(e)}},{})}))]}))}));return function(t,n){return e.apply(this,arguments)}}(),fs=[Ei({content:ci(),phoneNumber:ci()})];function hs(e){return ms.apply(this,arguments)}function ms(){return ms=Ce((function(e){return xe(this,(function(t){return[2,Un("openSMS",fs,[e],function(){var e=Ce((function(e){return xe(this,(function(t){switch(t.label){case 0:return ze.isMp?[4,ps(e.phoneNumber,e.content)]:[3,2];case 1:return[2,t.sent()];case 2:return ze.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Fe("openSMS",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),ms.apply(this,arguments)}var vs=function(){var e=Ce((function(e){var t,n=arguments;return xe(this,(function(r){return t=n.length>1&&void 0!==n[1]?n[1]:"",[2,new Promise((function(n,r){yn("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)}}(),ys=[Ei({id:ci(),displayName:ci().default("").optional()})];function gs(e){return _s.apply(this,arguments)}function _s(){return _s=Ce((function(e){return xe(this,(function(t){return[2,Un("viewOAQr",ys,[e],function(){var e=Ce((function(e){return xe(this,(function(t){switch(t.label){case 0:return ze.isMp?[4,vs(e.id,e.displayName)]:[3,2];case 1:return[2,t.sent()];case 2:return ze.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Fe("viewOAQr",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),_s.apply(this,arguments)}var ws=function(){var e=Ce((function(e){return xe(this,(function(t){return[2,new Promise((function(t,n){yn("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)}}(),Ts=[Ei({keepScreenOn:fi()})];function bs(e){return Es.apply(this,arguments)}function Es(){return Es=Ce((function(e){return xe(this,(function(t){return[2,Un("keepScreen",Ts,[e],function(){var e=Ce((function(e){return xe(this,(function(t){switch(t.label){case 0:return ze.isMp?[4,ws(e.keepScreenOn)]:[3,2];case 1:return[2,t.sent()];case 2:return ze.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Fe("keepScreen",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Es.apply(this,arguments)}function Ps(e){return Ss.apply(this,arguments)}function Ss(){return(Ss=Ce((function(e){return xe(this,(function(t){return[2,Un("onKeepScreen",[],[e],Ce((function(){return xe(this,(function(e){switch(e.label){case 0:return ze.isMp?[4,ws(!0)]:[3,2];case 1:return[2,e.sent()];case 2:return ze.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Fe("onKeepScreen",{}))]}}))})))]}))}))).apply(this,arguments)}function Is(e){return As.apply(this,arguments)}function As(){return(As=Ce((function(e){return xe(this,(function(t){return[2,Un("offKeepScreen",[],[e],Ce((function(){return xe(this,(function(e){switch(e.label){case 0:return ze.isMp?[4,ws(!1)]:[3,2];case 1:return[2,e.sent()];case 2:return ze.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Fe("offKeepScreen",{}))]}}))})))]}))}))).apply(this,arguments)}var Os=function(){var e=Ce((function(e,t,n){var r;return xe(this,(function(i){return r={},e?r={imageBase64Data:e}:t&&(r={imageUrl:t}),[2,new Promise((function(e,t){yn("SAVE_IMAGE_GALLERY",Ta(Ve({},r),{onProgress:n}),{success:function(){e()},fail:function(e){t(e)}},{})}))]}))}));return function(t,n,r){return e.apply(this,arguments)}}(),Cs=[Ei({imageBase64Data:ci().optional(),imageUrl:ci().url().optional()}).optional()];function ks(e){return Ns.apply(this,arguments)}function Ns(){return Ns=Ce((function(e){return xe(this,(function(t){return[2,Un("saveImageToGallery",Cs,[e],function(){var e=Ce((function(e){return xe(this,(function(t){switch(t.label){case 0:return ze.isMp?[4,Os(e.imageBase64Data,e.imageUrl,e.onProgress)]:[3,2];case 1:return[2,t.sent()];case 2:return ze.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Fe("saveImageToGallery",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Ns.apply(this,arguments)}var Ms=function(){var e=Ce((function(e,t){var n;return xe(this,(function(r){return{},n={videoUrl:e,onProgress:t},[2,new Promise((function(e,t){yn("SAVE_VIDEO_GALLERY",Ve({},n),{success:function(){e()},fail:function(e){t(e)}},{})}))]}))}));return function(t,n){return e.apply(this,arguments)}}(),Rs=[Ei({videoUrl:ci().url()}).optional()];function xs(e){return Ds.apply(this,arguments)}function Ds(){return Ds=Ce((function(e){return xe(this,(function(t){return[2,Un("saveVideoToGallery",Rs,[e],function(){var e=Ce((function(e){return xe(this,(function(t){switch(t.label){case 0:return ze.isMp?[4,Ms(e.videoUrl,e.onProgress)]:[3,2];case 1:return[2,t.sent()];case 2:return ze.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Fe("saveVideoToGallery",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Ds.apply(this,arguments)}var Us=function(){var e=Ce((function(e){var t,n,r,i,o,a,u=arguments;return xe(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,Fa(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=He(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){yn("OPEN_MP",{mpUrl:o,mpInfo:i},{success:function(){e()},fail:function(e){t(e)}},{})}))]}}))}));return function(t){return e.apply(this,arguments)}}(),Ls=[Ei({appId:ci(),path:ci().optional(),params:Vi.record(ci(),ci()).optional()})];function js(e){return Bs.apply(this,arguments)}function Bs(){return Bs=Ce((function(e){return xe(this,(function(t){return[2,Un("openMiniApp",Ls,[e],function(){var e=Ce((function(e){return xe(this,(function(t){switch(t.label){case 0:return ze.isMp?[4,Us(e.appId,e.path,e.params)]:[3,2];case 1:return[2,t.sent()];case 2:return ze.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Fe("openMiniApp",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Bs.apply(this,arguments)}var Zs=Ce((function(){var t,n,r=arguments;return xe(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){yn("INTERACTIVE_VIBRATION",{type:e.VibrateType[t],vibrate_time:n},{success:function(){r()},fail:function(e){i(e)}},{})}))]}))})),zs=[Ei({type:Vi.enum(["oneShot"]).default("oneShot").optional(),milliseconds:li().optional()})];function Ws(e){return Fs.apply(this,arguments)}function Fs(){return Fs=Ce((function(e){return xe(this,(function(t){return[2,Un("vibrate",zs,[e],function(){var e=Ce((function(e){return xe(this,(function(t){switch(t.label){case 0:return ze.isMp?[4,Zs(null==e?void 0:e.type,null==e?void 0:e.milliseconds)]:[3,2];case 1:return[2,t.sent()];case 2:return ze.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Fe("vibrate",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Fs.apply(this,arguments)}var Gs=function(){var e=Ce((function(e,t){var n,r,i,o;return xe(this,(function(a){return n=new URL(e),r=n.href.includes("vnpay"),i=n.searchParams.get("typeInapp"),o=Ot.isEmpty(t)?void 0:{modal_style:(null==t?void 0:t.style)?rn(null==t?void 0:t.style):"bottom_sheet",left_button:(null==t?void 0:t.leftButton)?rn(null==t?void 0:t.leftButton):"back"},!r&&Ot.isEmpty(i)&&n.searchParams.set("typeInapp","1"),[2,new Promise((function(e,t){yn("OPEN_INAPP",{url:n.href,style:o},{success:function(){e()},fail:function(e){t(e)}},{})}))]}))}));return function(t,n){return e.apply(this,arguments)}}(),Vs=[Ei({url:ci(),config:Ei({style:Vi.enum(["bottomSheet","normal"]).default("bottomSheet").optional(),leftButton:Vi.enum(["back","none"]).default("back").optional()}).optional()})];function Hs(e){return Ks.apply(this,arguments)}function Ks(){return Ks=Ce((function(e){return xe(this,(function(t){return[2,Un("openWebview",Vs,[e],function(){var e=Ce((function(e){return xe(this,(function(t){switch(t.label){case 0:return ze.isMp?[4,Gs(e.url,e.config)]:[3,2];case 1:return[2,t.sent()];case 2:return ze.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Fe("openWebview",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Ks.apply(this,arguments)}function Js(){var e={},t=window.location.href;try{var n=new URL(t).searchParams.toString();n&&(e=Kt.getParamsAsObject(n))}catch(e){throw new Error("Invalid URL")}return e}function qs(){return Un("getRouteParams",[],[],(function(){return Js()}))}function Qs(e){return Ys.apply(this,arguments)}function Ys(){return(Ys=Ce((function(e){return xe(this,(function(t){return[2,Un("getAppInfo",[],[e],Ce((function(){return xe(this,(function(e){switch(e.label){case 0:return ze.isMp?[4,Fa()]:[3,2];case 1:return[2,e.sent()];case 2:return ze.isMpWeb?[2,Promise.resolve({description:"",name:"",version:"",appUrl:"",qrCodeUrl:""})]:[2,Promise.reject(Fe("getAppInfo",{}))]}}))})))]}))}))).apply(this,arguments)}var $s=function(){var e=Ce((function(e){return xe(this,(function(t){return[2,new Promise((function(t,n){yn("WEBVIEW_SET_RESULT",{result:An(e)},{success:function(){t()},fail:function(e){n(e)}},{})}))]}))}));return function(t){return e.apply(this,arguments)}}(),Xs=[Ei({data:Vi.any()})];function eu(e){return tu.apply(this,arguments)}function tu(){return tu=Ce((function(e){return xe(this,(function(t){return[2,Un("sendDataToPreviousMiniApp",Xs,[e],function(){var e=Ce((function(e){return xe(this,(function(t){switch(t.label){case 0:return ze.isMp?[4,$s(e.data)]:[3,2];case 1:return[2,t.sent()];case 2:return ze.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Fe("sendDataToPreviousMiniApp",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),tu.apply(this,arguments)}var nu=Ce((function(){return xe(this,(function(e){return[2,new Promise((function(e,t){var n,r;yn("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(mn.error.clientNotSupport())},fail:function(e){t(e)}},{delay:(null===(n=Ze())||void 0===n||null===(r=n.platform)||void 0===r?void 0:r.isIOS)?400:0})}))]}))}));function ru(e){return iu.apply(this,arguments)}function iu(){return(iu=Ce((function(e){return xe(this,(function(t){return[2,Un("getPhoneNumber",[],[e],Ce((function(){return xe(this,(function(e){switch(e.label){case 0:return ze.isMp?[4,nu()]:[3,2];case 1:return[2,e.sent()];case 2:return ze.isMpWeb?[2,Promise.resolve({number:""})]:[2,Promise.reject(Fe("getPhoneNumber",{}))]}}))})))]}))}))).apply(this,arguments)}var ou=Ce((function(){var e,t=arguments;return xe(this,(function(n){return e=t.length>0&&void 0!==t[0]?t[0]:1,[2,new Promise((function(t,n){yn("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})}))]}))})),au=[Ei({maxProfile:li().min(1).max(10).optional().default(1)})];function su(e){return uu.apply(this,arguments)}function uu(){return uu=Ce((function(e){return xe(this,(function(t){return[2,Un("openProfilePicker",au,[e],function(){var e=Ce((function(e){var t,n,r,i,o;return xe(this,(function(a){switch(a.label){case 0:return ze.isMp?[4,ou(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,wn.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(Ot.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 ze.isMpWeb?[2,Promise.resolve({users:[]})]:[2,Promise.reject(Fe("openProfilePicker",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),uu.apply(this,arguments)}var cu=function(){var e=Ce((function(e,t,n){var r;return xe(this,(function(i){return r=t&&Ot.isString(t)&&t.length>0?"wpa_wpa2":"open",[2,new Promise((function(i,o){yn("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)}}(),lu=[Ei({SSID:ci(),password:ci().optional(),hiddenSSID:fi().optional()})];function du(e){return pu.apply(this,arguments)}function pu(){return pu=Ce((function(e){return xe(this,(function(t){return[2,Un("connectWifi",lu,[e],function(){var e=Ce((function(e){return xe(this,(function(t){switch(t.label){case 0:return ze.isMp?[4,cu(e.SSID,e.password,e.hiddenSSID)]:[3,2];case 1:return[2,t.sent()];case 2:return ze.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Fe("connectWifi",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),pu.apply(this,arguments)}var fu=function(){var t=Ce((function(t,n,r,i,o,a){var s,u;return xe(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){yn("PICK_MEDIA",{media_type:e.MediaPickerType[t],edit_view:Ve({},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)}}(),hu=[Ei({type:Vi.enum(["video","photo","file","zcamera","zcamera_photo","zcamera_video","zcamera_scan"]),serverUploadUrl:ci().url(),maxItemSize:li().min(0).optional(),editView:Ei({enable:fi().optional(),aspectRatio:ci().regex(/^d+:d+$/).optional()}).optional(),silentRequest:fi().optional(),maxSelectItem:li().min(1).optional()})];function mu(e){return vu.apply(this,arguments)}function vu(){return vu=Ce((function(e){return xe(this,(function(t){return[2,Un("openMediaPicker",hu,[e],function(){var e=Ce((function(e){var t,n,r,i,o,a;return xe(this,(function(s){switch(s.label){case 0:return ze.isMp?(i={},Ot.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,fu(e.type,e.serverUploadUrl,e.maxItemSize,i,o,a)]):[3,2];case 1:return[2,{data:s.sent()}];case 2:return ze.isMpWeb?[2,Promise.resolve({data:""})]:[2,Promise.reject(Fe("openMediaPicker",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),vu.apply(this,arguments)}var yu=[Ei({title:ci().max(100),description:ci().max(400).default(""),thumbnail:ci().url().optional(),path:ci().optional()})];function gu(e){return _u.apply(this,arguments)}function _u(){return _u=Ce((function(e){return xe(this,(function(t){return[2,Un("getShareableLink",yu,[e],function(){var e=Ce((function(e){var t;return xe(this,(function(n){switch(n.label){case 0:return[4,wn.getAccessToken()];case 1:return t=n.sent(),[4,xa(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)}}())]}))})),_u.apply(this,arguments)}var wu=function(){var e=Ce((function(e){return xe(this,(function(t){return[2,new Promise((function(t,n){yn("MP_CLOSE_LOADINGVIEW",{at:(new Date).getTime(),when:e,url:location.href},{success:function(e){t(e)},fail:function(e){n(e)}},{})}))]}))}));return function(t){return e.apply(this,arguments)}}();function Tu(e){return bu.apply(this,arguments)}function bu(){return(bu=Ce((function(e){return xe(this,(function(t){return[2,Un("closeLoading",[],[e],Ce((function(){return xe(this,(function(e){switch(e.label){case 0:return ze.isMp?[4,wu("user action")]:[3,2];case 1:return[2,e.sent()];case 2:return ze.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Fe("closeLoading",{}))]}}))})))]}))}))).apply(this,arguments)}function Eu(e){return Pu.apply(this,arguments)}function Pu(){return Pu=Ce((function(e){return xe(this,(function(t){return[2,Un("requestUpdateZalo",[],[e],Ce((function(){var e,t,n;return xe(this,(function(r){switch(r.label){case 0:return ze.isMp?(n=(null===(e=Ze())||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,Ga(n)]):[3,2];case 1:return[2,r.sent()];case 2:return ze.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Fe("requestUpdateZalo",{}))]}}))})))]}))})),Pu.apply(this,arguments)}var Su=Gt.getInstance();Su.addListener=function(t,n,r){var i=t;return Su.addListener(e.Events[i],n,r)};var Iu=[Vi.function()];function Au(t){return Un("onConfirmToExit",Iu,[t],(function(t){var n=t;ze.isMp&&(Su.on(e.Events.AppClose,n,'{"handle_h5": 1}'),Ki.setNavigationBarLeftButton(void 0,2))}))}function Ou(){return Un("offConfirmToExit",[],[],(function(){ze.isMp&&(Su.off(e.Events.AppClose),Ki.setNavigationBarLeftButton(void 0,0))}))}function Cu(){return Un("getDeviceId",[],[],(function(){return ze.isMp&&wn.getSync(l.DEVICE_ID)||""}))}function ku(e){return Nu.apply(this,arguments)}function Nu(){return(Nu=Ce((function(e){return xe(this,(function(t){return[2,Un("getDeviceIdAsync",[],[e],Ce((function(){return xe(this,(function(e){switch(e.label){case 0:return ze.isMp?[4,wn.jumpAndGetToken(l.DEVICE_ID)]:[3,2];case 1:return[2,e.sent()||""];case 2:return[2,Promise.resolve("")]}}))})))]}))}))).apply(this,arguments)}function Mu(){return Un("getContext",[],[],(function(){if(ze.isMp){var e=wn.getSync(l.CONTEXT_ID)||"";return{type:wn.getSync(l.CONTEXT_TYPE)||"",id:e}}return{type:"",id:""}}))}function Ru(e){return xu.apply(this,arguments)}function xu(){return(xu=Ce((function(e){return xe(this,(function(t){return[2,Un("getContextAsync",[],[e],Ce((function(){var e;return xe(this,(function(t){switch(t.label){case 0:return ze.isMp?[4,wn.jumpAndGetToken(l.CONTEXT_ID)]:[3,3];case 1:return e=t.sent()||"",[4,wn.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 Du(e){return Uu.apply(this,arguments)}function Uu(){return(Uu=Ce((function(e){return xe(this,(function(t){return[2,Un("getAuthCode",[],[e],Ce((function(){var e,t;return xe(this,(function(n){switch(n.label){case 0:return ze.isMp?[4,wn.jumpAndGetToken(l.ZOAUTH,!0)]:[3,4];case 1:return e=n.sent()||"",[4,wn.jumpAndGetToken(l.ZOAUTH_VRF)];case 2:return t=n.sent()||"",[4,wn.verifyUserAuthorized()];case 3:if(n.sent())return[2,{authCode:e,authCodeVerify:t}];throw nn([{action:"getAuthCode",error:-104,message:"no user auth",data:{}}]),mn.error.loginFailed("User Authentication Required");case 4:return[2,Promise.resolve({authCode:"",authCodeVerify:""})]}}))})))]}))}))).apply(this,arguments)}function Lu(e){return ju.apply(this,arguments)}function ju(){return(ju=Ce((function(e){return xe(this,(function(t){return[2,Un("getZPIToken",[],[e],Ce((function(){var e,t,n,r;return xe(this,(function(i){switch(i.label){case 0:return ze.isMp?[4,wn.jumpAndGetToken(l.UTOKEN_ZPI)]:[3,5];case 1:return e=i.sent()||"",[4,wn.jumpAndGetToken(l.GTOKEN_ZPI)];case 2:return t=i.sent()||"",[4,wn.jumpAndGetToken(l.ZPP_ZPI)];case 3:return n=i.sent()||"",[4,wn.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 Bu=[ci()];function Zu(e){return Un("setAccessToken",Bu,[e],(function(e){var t=e;wn.setAccessToken(t)}))}var zu=[Ei({url:ci().url()})];function Wu(e){return Fu.apply(this,arguments)}function Fu(){return Fu=Ce((function(e){return xe(this,(function(t){return[2,Un("openOutApp",zu,[e],function(){var e=Ce((function(e){return xe(this,(function(t){switch(t.label){case 0:return ze.isMp?[4,Ga(e.url)]:[3,2];case 1:return[2,t.sent()];case 2:return ze.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Fe("openOutApp",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Fu.apply(this,arguments)}var Gu=[Ei({count:li().min(1).optional().default(1),sourceType:Vi.array(Vi.enum(["album","camera"])).max(2).default(["album","camera"]).optional(),cameraType:Vi.enum(["back","front"]).default("front").optional()})];function Vu(e){return Hu.apply(this,arguments)}function Hu(){return Hu=Ce((function(e){return xe(this,(function(t){return[2,Un("chooseImage",Gu,[e],function(){var e=Ce((function(e){var t,n,r,i;return xe(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)}}())]}))})),Hu.apply(this,arguments)}var Ku=Ce((function(){var e,t,n=arguments;return xe(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){yn("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(mn.error.clientNotSupport())},fail:function(e){r(e)}},{isMultiCallback:!0,timeout:!1})}))]}))}));function Ju(e){return qu.apply(this,arguments)}function qu(){return(qu=Ce((function(e){return xe(this,(function(t){return[2,Un("getLocation",[],[e],Ce((function(){return xe(this,(function(e){switch(e.label){case 0:return ze.isMp?[4,Ku()]:[3,2];case 1:return[2,e.sent()];case 2:return ze.isMpWeb?[2,Promise.resolve({token:""})]:[2,Promise.reject(Fe("getLocation",{}))]}}))})))]}))}))).apply(this,arguments)}var Qu=[Vi.function().args(Ei({data:Vi.any()})).returns(Vi.void())];function Yu(t){return Un("onCallbackData",Qu,[t],(function(){!function(t){Gt.getInstance().on(e.Events.OnDataCallback,(function(e){t({data:e})}))}(t)}))}var $u=function(){var e=Ce((function(e){var t,n,r,i,a,s,u,c,l,d,p;return xe(this,(function(f){switch(f.label){case 0:return e||(e=Js()),"object"==typeof e&&((n=e.zmpOrderId||e.orderId)||(t=e.appTransID||e.apptransid||e.transId)),"string"==typeof e&&(r=Kt.getParameterByName("orderId",e),i=Kt.getParameterByName("appTransID",e)||Kt.getParameterByName("apptransid",e),t=r||i),a={headers:{authorization:"Bearer "}},[4,wn.getAccessToken().catch((function(){throw mn.error.loginRequired}))];case 1:return s=f.sent(),a.headers.authorization="Bearer ".concat(s),u=new URL(H),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 mn.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,Ve({msg:d.resultMessage},d)),[2,p]}}))}));return function(t){return e.apply(this,arguments)}}(),Xu=function(){var t=Ce((function(t,n,r,i,a,s,u){var c,l,d,p,f,h,m,v,y,g,_,w,T,b,E,P,S,I,A,O;return xe(this,(function(C){switch(C.label){case 0:c=o,(l=new URLSearchParams).append("amount",t.toString()),l.append("item",encodeURIComponent(JSON.stringify(n))),l.append("appId",c),l.append("mac",i),r&&l.append("desc",encodeURIComponent(r)),a&&(d=a,"object"==typeof a&&(d=JSON.stringify(a)),l.append("extradata",encodeURIComponent(d))),s&&(p=s,"object"==typeof s&&(p=JSON.stringify(s)),l.append("payload",encodeURIComponent(p))),u&&("string"==typeof u?(l.append("method",u),l.append("isCustom","false")):"object"==typeof u&&(l.append("method",u.id),l.append("isCustom",JSON.stringify(u.isCustom)))),f={headers:{"Content-Type":"application/x-www-form-urlencoded",authorization:"Bearer "}},C.label=1;case 1:return C.trys.push([1,6,,7]),[4,wn.getAccessToken().catch((function(){throw mn.error.loginRequired}))];case 2:return h=C.sent(),f.headers.authorization="Bearer ".concat(h),[4,fetch(G,Ta(Ve({method:"POST"},f),{body:l}))];case 3:return[4,C.sent().json()];case 4:if(!(m=C.sent()).data||0!==m.err)throw mn.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),P=Kt.encode(T),S=new URL("?".concat(P),"https://payment-mini.zalo.me").toString(),I=an(),A=on()&&I<742?"normal":"bottomSheet",Zt.enablePaymentDone=Gt.getInstance().eventNames().includes(e.Events.PaymentDone),[4,Gs(S,{style:A}).then((function(){var t=!1;Gt.getInstance().once(e.Events.WebviewClosed,(function(){setTimeout(Ce((function(){var n;return xe(this,(function(r){switch(r.label){case 0:return t?[3,2]:(Gt.getInstance().emit(e.Events.PaymentDone,v,{orderId:v}),[4,$u({zmpOrderId:v})]);case 1:(n=r.sent()).err>=0&&!n.isCustom&&Gt.getInstance().emit(e.Events.PaymentClose,n.err,Ta(Ve({},n),{zmpOrderId:v})),r.label=2;case 2:return[2]}}))})),500)})),Gt.getInstance().once(e.Events.OpenApp,(function(){t=!0})),Gt.getInstance().once(e.Events.PaymentDone,(function(){t=!0,Zt.enablePaymentDone=!1}))}))];case 5:return C.sent(),[2,{orderId:v,messageToken:g}];case 6:throw O=C.sent(),console.log("Internal error"),O;case 7:return[2]}}))}));return function(e,n,r,i,o,a,s){return t.apply(this,arguments)}}(),ec=[Ei({amount:Vi.union([ci(),li()]),item:Vi.array(Vi.record(ci(),Vi.any())),desc:Vi.string(),mac:Vi.string(),extradata:Vi.any().optional(),payload:Vi.any().optional(),method:Vi.union([Vi.string(),Vi.object({id:Vi.string(),isCustom:Vi.boolean()})]).optional()})];function tc(e){return nc.apply(this,arguments)}function nc(){return nc=Ce((function(e){return xe(this,(function(t){return[2,Un("createOrder",ec,[e],function(){var e=Ce((function(e){return xe(this,(function(t){switch(t.label){case 0:return ze.isMp?[4,Xu(e.amount,e.item,e.desc,e.mac,e.extradata,e.payload,e.method)]:[3,2];case 1:return[2,t.sent()];case 2:return ze.isMpWeb?[2,Promise.resolve({orderId:"",messageToken:""})]:[2,Promise.reject(Fe("createOrder",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),nc.apply(this,arguments)}var rc=Ce((function(){return xe(this,(function(e){return[2,new Promise((function(e,t){yn("MP_CONFIRM_REQUEST_PAYMENT",{},{success:function(){e()},fail:function(e){t(e)}},{})}))]}))})),ic=function(){var e=Ce((function(e,t,n,r,i){var a,s,u,c,l,d,p,f,h,m,v,y;return xe(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,wn.getAccessToken().catch((function(){throw mn.error.loginRequired}))];case 2:return l=g.sent(),u.headers.authorization="Bearer ".concat(l),console.log("_purchase"),[4,wn.jumpAndGetToken()];case 3:if(g.sent(),d=null===(c=wn.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,rc()];case 5:return g.sent(),[3,7];case 6:throw p=g.sent(),console.error("Failed:",p),p;case 7:return[4,fetch(K,Ta(Ve({method:"POST"},u),{body:s}))];case 8:return[4,g.sent().json()];case 9:if(!(f=g.sent()).data||0!==f.err)throw mn.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)}}(),oc=[Ei({amount:Vi.union([Vi.string(),Vi.number()]),desc:Vi.string(),method:Vi.string(),transId:Vi.string().optional(),mac:Vi.string().optional()})];function ac(e){return sc.apply(this,arguments)}function sc(){return sc=Ce((function(e){return xe(this,(function(t){return[2,Un("purchase",oc,[e],function(){var e=Ce((function(e){return xe(this,(function(t){switch(t.label){case 0:return ze.isMp?[4,ic(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 ze.isMpWeb?[2,Promise.resolve({orderId:"",messageToken:"",transId:""})]:[2,Promise.reject(Fe("purchase",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),sc.apply(this,arguments)}var uc=function(){var e=Ce((function(e,t){return xe(this,(function(n){return[2,new Promise((function(n,r){var i=e&&(null==e?void 0:e.length)>0;yn("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)}}(),cc=[Ei({channels:bi(Ei({method:ci(),subMethod:ci().optional(),subInfo:ci().optional()})).optional(),selectedMethod:Ei({method:ci(),subMethod:ci().optional()}).optional()}).optional()];function lc(e){return dc.apply(this,arguments)}function dc(){return dc=Ce((function(e){return xe(this,(function(t){return[2,Un("selectPaymentMethod",cc,[e],function(){var e=Ce((function(e){var t,n;return xe(this,(function(r){switch(r.label){case 0:return ze.isMp?(t=e.channels,n=e.selectedMethod,[4,uc(t,n)]):[3,2];case 1:return[2,r.sent()];case 2:return ze.isMpWeb?[2,Promise.resolve({method:""})]:[2,Promise.reject(Fe("selectPaymentMethod",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),dc.apply(this,arguments)}var pc=[Ei({data:Vi.union([ci(),Vi.record(ci(),ci().nullish())])})];function fc(e){return hc.apply(this,arguments)}function hc(){return hc=Ce((function(e){return xe(this,(function(t){return[2,Un("checkTransaction",pc,[e],function(){var e=Ce((function(e){return xe(this,(function(t){switch(t.label){case 0:return ze.isMp?[4,$u(e.data)]:[3,2];case 1:return[2,t.sent()];case 2:return ze.isMpWeb?[2,Promise.resolve({msg:"Success",orderId:"",resultCode:1,transTime:(new Date).getTime().toString(),createdAt:(new Date).getTime().toString(),transId:""})]:[2,Promise.reject(Fe("checkTransaction",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),hc.apply(this,arguments)}var mc=function(){var t=Ce((function(t,n,r,i,a,s){var u,c,l,d,p,f,h,m,v,y,g,_,w,T;return xe(this,(function(b){switch(b.label){case 0:p=o,(f=new URLSearchParams).append("payType",n||e.IAPPayType.SUBSCRIPTION),h=e.ProrationMode.UNKNOW,r===q&&(h=e.ProrationMode.IMMEDIATE_AND_CHARGE_FULL_PRICE),r===J&&(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=Ze())||void 0===u||null===(c=u.platform)||void 0===c?void 0:c.isIOS)?m="ios":(null===(l=Ze())||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,wn.getAccessToken().catch((function(){throw mn.error.loginRequired}))];case 2:return y=b.sent(),v.headers.authorization="Bearer ".concat(y),[4,fetch(V,Ta(Ve({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 mn.error.createIAPOrderFailed(g.err);return _=g.data.store,w=g.data.orderId,[2,new Promise((function(e,t){yn("IAP_REQUESTPAYMENT",Ve({},_),{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)}}(),vc=[Ei({productId:ci(),payType:Vi.enum(["ONETIME","SUBSCRIPTION"]).optional(),prorationMode:Vi.enum(["DEFERRED","IMMEDIATE_AND_CHARGE_FULL_PRICE"]).default("DEFERRED").optional(),utm:ci().optional(),method:Vi.enum(["IAP","IAP_SANDBOX"]).optional(),merchantTransId:ci().optional()})];function yc(e){return gc.apply(this,arguments)}function gc(){return gc=Ce((function(e){return xe(this,(function(t){return[2,Un("createOrderIAP",vc,[e],function(){var e=Ce((function(e){return xe(this,(function(t){switch(t.label){case 0:return ze.isMp?[4,mc(e.productId,e.payType,e.prorationMode,e.method,e.utm,e.merchantTransId)]:[3,2];case 1:return[2,t.sent()];case 2:return ze.isMpWeb?[2,Promise.resolve({orderId:""})]:[2,Promise.reject(Fe("createOrderIAP",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),gc.apply(this,arguments)}var _c=[Ei({hide:fi().default(!1).optional()}).optional()];function wc(e){return Tc.apply(this,arguments)}function Tc(){return Tc=Ce((function(e){return xe(this,(function(t){return[2,Un("setAndroidBottomNavigationBar",_c,[e],function(){var e=Ce((function(e){return xe(this,(function(t){switch(t.label){case 0:return ze.isMp?[4,Ki.setAndroidBottomNavigationBar(e.hide)]:[3,2];case 1:return[2,t.sent()];case 2:return ze.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Fe("setAndroidBottomNavigationBar",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Tc.apply(this,arguments)}var bc=[Ei({hide:fi().default(!1).optional()}).optional()];function Ec(e){return Pc.apply(this,arguments)}function Pc(){return Pc=Ce((function(e){return xe(this,(function(t){return[2,Un("setIOSBottomSafeArea",bc,[e],function(){var e=Ce((function(e){return xe(this,(function(t){switch(t.label){case 0:return ze.isMp?[4,Ki.setIOSBottomSafeArea(e.hide)]:[3,2];case 1:return[2,t.sent()];case 2:return ze.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Fe("setIOSBottomSafeArea",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Pc.apply(this,arguments)}var Sc=[Ei({type:Vi.enum(["normal","hidden","transparent"]).default("normal").optional(),color:Vi.string().optional()}).optional()];function Ic(e){return Ac.apply(this,arguments)}function Ac(){return Ac=Ce((function(e){return xe(this,(function(t){return[2,Un("setStatusBar",Sc,[e],function(){var e=Ce((function(e){return xe(this,(function(t){switch(t.label){case 0:return ze.isMp?[4,Ki.configHeader({statusBarType:e.type,headerColor:e.color})]:[3,2];case 1:return[2,t.sent()];case 2:return ze.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Fe("setStatusBar",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Ac.apply(this,arguments)}var Oc=[Ei({headerTextColor:Vi.enum(["black","white"]).optional(),headerColor:Vi.string().optional(),actionBar:Ei({hide:Vi.boolean().optional(),title:Vi.string().optional(),leftButton:Vi.enum(["back","none"]).optional(),textAlign:Vi.enum(["left","center"]).default("left").optional()}).optional(),statusBarType:Vi.enum(["normal","hidden","transparent"]).optional(),hideAndroidBottomNavigationBar:Vi.boolean().optional(),hideIOSSafeAreaBottom:Vi.boolean().optional()})];function Cc(e){return kc.apply(this,arguments)}function kc(){return kc=Ce((function(e){return xe(this,(function(t){return[2,Un("configAppView",Oc,[e],function(){var e=Ce((function(e){var t,n,r,i,o,a,s;return xe(this,(function(u){switch(u.label){case 0:return ze.isMp?Ot.isUndefined(null===(t=e.actionBar)||void 0===t?void 0:t.leftButton)?[3,2]:[4,Ki.setNavigationBarLeftButton(null===(a=e.actionBar)||void 0===a?void 0:a.leftButton)]:[3,13];case 1:u.sent(),u.label=2;case 2:return Ot.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,Ki.setNavigationBarTitle(null===(s=e.actionBar)||void 0===s?void 0:s.title)];case 3:u.sent(),u.label=4;case 4:return[4,Ki.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,Ki.setAndroidBottomNavigationBar(e.hideAndroidBottomNavigationBar)];case 7:u.sent(),u.label=8;case 8:return"boolean"!=typeof e.hideIOSSafeAreaBottom?[3,10]:[4,Ki.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 ze.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Fe("configAppView",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),kc.apply(this,arguments)}var Nc=Ce((function(){return xe(this,(function(e){return[2,new Promise((function(e,t){yn("MA_MENU_MINIMIZE",{},{success:function(t){e(t)},fail:function(e){t(e)}},{})}))]}))}));function Mc(e){return Rc.apply(this,arguments)}function Rc(){return(Rc=Ce((function(e){return xe(this,(function(t){return[2,Un("minimizeApp",[],[e],Ce((function(){return xe(this,(function(e){switch(e.label){case 0:return ze.isMp?[4,Nc()]:[3,2];case 1:return[2,e.sent()];case 2:return ze.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Fe("minimizeApp",{}))]}}))})))]}))}))).apply(this,arguments)}var xc=Ce((function(){return xe(this,(function(e){return[2,new Promise((function(e,t){yn("MA_MENU_PERMISSION",{},{success:function(t){e(t)},fail:function(e){t(e)}},{}),e()}))]}))}));function Dc(e){return Uc.apply(this,arguments)}function Uc(){return(Uc=Ce((function(e){return xe(this,(function(t){return[2,Un("openPermissionSetting",[],[e],Ce((function(){return xe(this,(function(e){switch(e.label){case 0:return ze.isMp?[4,xc()]:[3,2];case 1:return[2,e.sent()];case 2:return ze.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Fe("openPermissionSetting",{}))]}}))})))]}))}))).apply(this,arguments)}var Lc=Ce((function(){return xe(this,(function(e){return[2,new Promise((function(e,t){yn("MP_ADD_MYFAVORITES",{timestamp:(new Date).getTime()},{success:function(t){e(t)},fail:function(e){t(e)}},{})}))]}))}));function jc(e){return Bc.apply(this,arguments)}function Bc(){return(Bc=Ce((function(e){return xe(this,(function(t){return[2,Un("favoriteApp",[],[e],Ce((function(){return xe(this,(function(e){switch(e.label){case 0:return ze.isMp?[4,Lc()]:[3,2];case 1:return[2,e.sent()];case 2:return ze.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Fe("favoriteApp",{}))]}}))})))]}))}))).apply(this,arguments)}var Zc=Ce((function(){return xe(this,(function(e){return[2,new Promise((function(e,t){yn("OPEN_GROUPLIST",{},{success:function(t){e(t)},fail:function(e){t(e)}},{})}))]}))}));function zc(e){return Wc.apply(this,arguments)}function Wc(){return(Wc=Ce((function(e){return xe(this,(function(t){return[2,Un("openGroupList",[],[e],Ce((function(){return xe(this,(function(e){switch(e.label){case 0:return ze.isMp?[4,Zc()]:[3,2];case 1:return[2,e.sent()];case 2:return ze.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Fe("openGroupList",{}))]}}))})))]}))}))).apply(this,arguments)}var Fc=Ce((function(){var e;return xe(this,(function(t){switch(t.label){case 0:return[4,wn.getAccessToken()];case 1:return e=t.sent(),[2,new Promise((function(t,n){yn("MP_SEND_NOTIFICATION",{accessToken:e},{success:function(e){t(e)},fail:function(e){n(e)}},{delay:500})}))]}}))}));function Gc(e){return Vc.apply(this,arguments)}function Vc(){return(Vc=Ce((function(e){return xe(this,(function(t){return[2,Un("requestSendNotification",[],[e],Ce((function(){return xe(this,(function(e){switch(e.label){case 0:return ze.isMp?[4,Fc()]:[3,2];case 1:return[2,e.sent()];case 2:return ze.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Fe("requestSendNotification",{}))]}}))})))]}))}))).apply(this,arguments)}var Hc=Ce((function(){return xe(this,(function(e){return[2,new Promise((function(e,t){yn("MP_ADD_RATING",{},{success:function(t){e(t)},fail:function(e){t(e)}},{})}))]}))}));function Kc(e){return Jc.apply(this,arguments)}function Jc(){return(Jc=Ce((function(e){return xe(this,(function(t){return[2,Un("addRating",[],[e],Ce((function(){return xe(this,(function(e){switch(e.label){case 0:return ze.isMp?[4,Hc()]:[3,2];case 1:return[2,e.sent()];case 2:return ze.isMpWeb?[2,Promise.resolve({})]:[2,Promise.reject(Fe("addRating",{}))]}}))})))]}))}))).apply(this,arguments)}var qc,Qc=(qc=Ce((function(e,t,n){var r,i;return xe(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,Ve({method:"POST",body:r},i))];case 1:return[4,o.sent().json()];case 2:return[2,o.sent()]}}))})),function(e,t,n){return qc.apply(this,arguments)}),Yc=function(){var e=Ce((function(e){return xe(this,(function(t){return[2,new Promise((function(t,n){yn("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)}}(),$c=[Ei({oaId:ci()})];function Xc(e){return el.apply(this,arguments)}function el(){return el=Ce((function(e){return xe(this,(function(t){return[2,Un("interactOA",$c,[e],function(){var e=Ce((function(e){var t,n,r;return xe(this,(function(i){switch(i.label){case 0:return ze.isMp?(t=e.oaId,[4,wn.getAccessToken()]):[3,5];case 1:return!(n=i.sent())||Ot.isEmpty(n)?[3,3]:[4,Qc(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,Yc(t)];case 4:return[2,i.sent()];case 5:return ze.isMpWeb?[2,Promise.resolve({})]:[2,Promise.reject(Fe("interactOA",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),el.apply(this,arguments)}var tl=[Ei({oaId:ci()})];function nl(e){return rl.apply(this,arguments)}function rl(){return rl=Ce((function(e){return xe(this,(function(t){return[2,Un("isAllowedInteractWithOA",tl,[e],function(){var e=Ce((function(e){var t,n,r;return xe(this,(function(i){switch(i.label){case 0:return ze.isMp?(t=e.oaId,[4,wn.getAccessToken()]):[3,4];case 1:return!(n=i.sent())||Ot.isEmpty(n)?[3,3]:[4,Qc(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 ze.isMpWeb?[2,Promise.resolve({status:!1})]:[2,Promise.reject(Fe("IsAllowedInteractWithOA",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),rl.apply(this,arguments)}function il(e){return ol.apply(this,arguments)}function ol(){return(ol=Ce((function(e){return xe(this,(function(t){return[2,Un("getSetting",[],[e],Ce((function(){return xe(this,(function(e){switch(e.label){case 0:return ze.isMp?[4,fn()]:[3,2];case 1:return[2,e.sent()];case 2:return ze.isMpWeb?[2,Promise.resolve({authSetting:{}})]:[2,Promise.reject(Fe("getSetting",{}))]}}))})))]}))}))).apply(this,arguments)}var al=Vi.enum(["scope.userInfo","scope.userLocation","scope.userPhonenumber"]),sl=[Ei({scopes:Vi.array(al).max(2).optional()}).optional()];function ul(e){return cl.apply(this,arguments)}function cl(){return cl=Ce((function(e){return xe(this,(function(t){return[2,Un("authorize",sl,[e],function(){var e=Ce((function(e){var t;return xe(this,(function(n){switch(n.label){case 0:return ze.isMp?(t=null==e?void 0:e.scopes,sn(724,573)?[2,Promise.reject(mn.error.clientNotSupport())]:[4,gn(null!=t?t:void 0)]):[3,2];case 1:return[2,n.sent()];case 2:return ze.isMpWeb?[2,Promise.resolve({})]:[2,Promise.reject(Fe("authorize",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),cl.apply(this,arguments)}var ll=Ce((function(){return xe(this,(function(e){return[2,new Promise(function(){var e=Ce((function(e,t){var n;return xe(this,(function(r){switch(r.label){case 0:return Ot.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(mn.error.clientNotSupport()),[2]}}))}));return function(t,n){return e.apply(this,arguments)}}())]}))}));function dl(e){return Un("checkZaloCameraPermission",[],[e],Ce((function(){return xe(this,(function(e){switch(e.label){case 0:return[4,ll()];case 1:return[2,e.sent()]}}))})))}var pl=Ce((function(){return xe(this,(function(e){return[2,new Promise(function(){var e=Ce((function(e,t){var n,r,i;return xe(this,(function(o){switch(o.label){case 0:return o.trys.push([0,2,,3]),[4,wn.jumpAndGetToken()];case 1:return o.sent(),r=null===(n=wn.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 fl(e){return hl.apply(this,arguments)}function hl(){return(hl=Ce((function(e){return xe(this,(function(t){return[2,Un("getUserID",[],[e],Ce((function(){return xe(this,(function(e){switch(e.label){case 0:return ze.isMp?[4,pl()]:[3,2];case 1:return[2,e.sent()];case 2:return ze.isMpWeb?[2,Promise.resolve(void 0)]:[2,Promise.reject(Fe("getUserID",{}))]}}))})))]}))}))).apply(this,arguments)}var ml=Ce((function(){return xe(this,(function(e){return[2,new Promise(function(){var e=Ce((function(e,t){var n,r,i;return xe(this,(function(o){switch(o.label){case 0:return o.trys.push([0,2,,3]),[4,wn.jumpAndGetToken()];case 1:return o.sent(),r=null===(n=wn.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 vl(e){return yl.apply(this,arguments)}function yl(){return(yl=Ce((function(e){return xe(this,(function(t){return[2,Un("getIDToken",[],[e],Ce((function(){return xe(this,(function(e){switch(e.label){case 0:return ze.isMp?[4,ml()]:[3,2];case 1:return[2,e.sent()];case 2:return ze.isMpWeb?[2,Promise.resolve(void 0)]:[2,Promise.reject(Fe("getIDToken",{}))]}}))})))]}))}))).apply(this,arguments)}var gl={format:e.PhotoFormat.JPEG,quality:e.PhotoQuality.NORMAL,mirrored:!1,useVideoSourceSize:!1},_l={width:1024,height:768,facingMode:e.FacingMode.FRONT,mirrored:!1,audio:!1,video:!0},wl=function(){function t(n){var r,i,o,a,s,u=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,c=this;Ct(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};Gt.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:_l.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:_l.mirrored,this._userRequestFrameCallback=!1,this._audioEnabled=null!==(a=null==u?void 0:u.audio)&&void 0!==a?a:_l.audio,this._videoEnabled=null!==(s=null==u?void 0:u.video)&&void 0!==s?s:_l.video}var n=t.prototype;return n.on=function(t,n){Gt.getInstance().on(t,(function(e){n(e)})),t===e.CameraEvents.OnFrameCallback&&(this._userRequestFrameCallback=!0,this.tick())},n.off=function(t){Gt.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 Ce((function(){return xe(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 Ce((function(){var n,r,i,o,a,s;return xe(this,(function(u){switch(u.label){case 0:return Ot.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||_l.width,this._videoElement.height=(null==e?void 0:e.height)||this._videoElement.height||_l.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 Ce((function(){return xe(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 Ce((function(){var n,r;return xe(this,(function(i){return n=Gt.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=Ce((function(n,r){var i;return xe(this,(function(o){switch(o.label){case 0:return o.trys.push([0,2,,3]),[4,t.stream()];case 1:return o.sent(),Gt.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 Ce((function(){return xe(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 Ce((function(){return xe(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=Ce((function(n){return xe(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 Ce((function(){return xe(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 Ce((function(){return xe(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 Ce((function(){return xe(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(),Gt.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||gl.format;return{data:n.toDataURL(r,this.getQualityNumber(t.quality)),width:n.width,height:n.height}}return null},n.haveVideoStream=function(){var e=this._videoElement;return e&&e.videoHeight>0&&this._hasUserMedia},n.getCanvas=function(e){var t=this._videoElement,n=e||{};if(!this.haveVideoStream())return null;if(!this._ctx){var r=t.videoWidth,i=t.videoHeight;if(!n.useVideoSourceSize){var o=r/i;i=(r=n.minScreenshotWidth||t.clientWidth)/o,n.minScreenshotHeight&&i<n.minScreenshotHeight&&(r=(i=n.minScreenshotHeight)*o)}this._canvasElement=document.createElement("canvas"),this._canvasElement.width=(null==n?void 0:n.width)||r,this._canvasElement.height=(null==n?void 0:n.height)||i,this._ctx=this._canvasElement.getContext("2d")}return this._canvasElement},n.drawFrame=function(t){var n=this._videoElement,r=t||{};if(n&&this._ctx&&this._canvasElement){var i=this._canvasElement,o=this._ctx;i.width=(null==r?void 0:r.width)||i.width,i.height=(null==r?void 0:r.height)||i.height,((null==r?void 0:r.mirrored)||this._mirror||this._facingMode===e.FacingMode.FRONT)&&(o.translate(i.width,0),o.scale(-1,1)),o.drawImage(n,0,0,i.width,i.height),((null==r?void 0:r.mirrored)||this._mirror||this._facingMode===e.FacingMode.FRONT)&&(o.scale(-1,1),o.translate(-i.width,0))}},t.stopMediaStream=function(e){e&&(e.getVideoTracks&&e.getAudioTracks?(e.getVideoTracks().map((function(t){e.removeTrack(t),t.stop()})),e.getAudioTracks().map((function(t){e.removeTrack(t),t.stop()}))):e.stop())},t}(),Tl=Ei({play:Vi.function(),pause:Vi.function()}).refine((function(e){return"play"in e&&"pause"in e}),{message:"Invalid HTMLVideoElement"}),bl=[Ei({videoElement:Tl,mediaConstraints:Vi.object({width:Vi.number().min(100).optional(),height:Vi.number().min(100).optional(),facingMode:Vi.string().optional(),audio:Vi.boolean().optional(),video:Vi.boolean().optional(),deviceId:Vi.string().optional(),mirrored:Vi.boolean().optional()}).nullish()}).optional()];function El(e){return Un("createCameraContext",bl,[e],(function(e){return new wl(e.videoElement,e.mediaConstraints)}))}var Pl=function(){function e(){var t,n;Ct(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=Re(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;Ot.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?Ot.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?Ot.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 Sl(e){return Il.apply(this,arguments)}function Il(){return(Il=Ce((function(e){return xe(this,(function(t){return[2,Un("setupAd",[],[e],(function(){return Pl.getInstance().loadSDK()}))]}))}))).apply(this,arguments)}var Al=[Ei({ids:Vi.union([Vi.string(),Vi.array(Vi.string())]),config:Ei({display:Vi.boolean().optional(),onClose:Vi.function().optional()}).optional()})];function Ol(e){return Cl.apply(this,arguments)}function Cl(){return Cl=Ce((function(e){return xe(this,(function(t){return[2,Un("loadAd",Al,[e],function(){var e=Ce((function(e){return xe(this,(function(t){return Pl.getInstance().load(e.ids,e.config),[2]}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Cl.apply(this,arguments)}var kl=[Ei({id:Vi.string()})];function Nl(e){return Ml.apply(this,arguments)}function Ml(){return Ml=Ce((function(e){return xe(this,(function(t){return[2,Un("displayAd",kl,[e],function(){var e=Ce((function(e){return xe(this,(function(t){return Pl.getInstance().display(e.id),[2]}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Ml.apply(this,arguments)}var Rl=[Ei({id:Vi.string().optional()}).optional()];function xl(e){return Dl.apply(this,arguments)}function Dl(){return Dl=Ce((function(e){return xe(this,(function(t){return[2,Un("refreshAd",Rl,[e],function(){var e=Ce((function(e){return xe(this,(function(t){return Pl.getInstance().refresh(e.id),[2]}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Dl.apply(this,arguments)}var Ul,Ll=[Ei({id:ci(),guidingText:ci().optional(),color:ci().optional(),onStatusChange:Vi.function().optional(),onError:Vi.function().optional()}).catchall(Vi.any())];function jl(e){return Bl.apply(this,arguments)}function Bl(){return Bl=Ce((function(e){return xe(this,(function(n){return[2,Un("showOAWidget",Ll,[e],function(){var e=Ce((function(e){var n,r,i,o,a,s,u,c;return xe(this,(function(l){if(ze.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="ifOAW-".concat(e.id,"-").concat(Date.now()),(c=new URL(Ae.OA)).searchParams.set("id",u),c.searchParams.set("appId",window.APP_ID),i&&c.searchParams.set("guidingText",i),o&&c.searchParams.set("color",o),Object.entries(a).forEach((function(e){var t=He(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.removeEventListener("message",Ul,!1),Ul=function(){var e=Ce((function(e){var t,n,i,o,a,s,l,d;return xe(this,(function(p){switch(p.label){case 0:return t=e.data,e.origin.startsWith(Ie)?(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,wn.jumpAndGetToken()]):[3,3];case 1:return p.sent(),l=null===(a=wn.miniProgramConfig)||void 0===a?void 0:a.jwt,null==n||null===(s=n.contentWindow)||void 0===s||s.postMessage({type:i,payload:{jwt:l}},Ie),[3,3];case 2:"oaInfo"===i?null==r||r(null===(d=t.payload)||void 0===d?void 0:d.followed):"openOA"===i?fa(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)}}(),window.addEventListener("message",Ul,!1))}catch(e){console.log(e)}return[2,Promise.resolve()]}return ze.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Fe("showOAWidget",{}))]}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Bl.apply(this,arguments)}var Zl,zl=[Vi.object({id:Vi.string(),type:Vi.string(),text:Vi.string(),color:Vi.string().optional(),disabled:Vi.boolean().optional(),onDataReceived:Vi.function().optional(),onError:Vi.function().optional()}).catchall(Vi.any())];function Wl(e){return Fl.apply(this,arguments)}function Fl(){return Fl=Ce((function(e){return xe(this,(function(n){return[2,Un("showFunctionButtonWidget",zl,[e],function(){var e=Ce((function(e){var n,r,i,o,a,s,u;return xe(this,(function(c){if(ze.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(Ae.FUNCTION_BUTTON)).searchParams.set("id",s),u.searchParams.set("appId",window.APP_ID),Object.entries(o).forEach((function(e){var t=He(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=He(e,2),n=t[0],r=t[1];r&&a.setAttribute("data-".concat(n),String(r))})),n.innerHTML=a.outerHTML,window.removeEventListener("message",Zl,!1),Zl=function(){var e=Ce((function(e){var t,n,a,c,l,d,p,f,h,m,v,y,g;return xe(this,(function(_){switch(_.label){case 0:return t=e.data,e.origin.startsWith(Ie)?(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,wn.jumpAndGetToken()]):[3,4];case 1:return _.sent(),f=null===(l=wn.miniProgramConfig)||void 0===l?void 0:l.jwt,h=null===(d=wn.miniProgramConfig)||void 0===d?void 0:d.encryptKey,[4,Bn()];case 2:return m=_.sent(),null==n||null===(p=n.contentWindow)||void 0===p||p.postMessage({type:a,payload:{jwt:f,encryptKey:h,accessToken:m}},Ie),[3,4];case 3:"onSuccess"===a?(null==(v=t.payload)?void 0:v.type)===o.type&&(y={callAction:function(e,t){var r;null==n||null===(r=n.contentWindow)||void 0===r||r.postMessage({type:"context.callAction",payload:{actionName:e,actionData:t}},Ie)}},null==r||r.apply(void 0,Re(Object.values(v)).concat([y]))):"onError"===a&&(null==(g=t.payload)?void 0:g.type)===o.type&&(null==i||i(null==g?void 0:g.data)),_.label=4;case 4:return[2]}}))}));return function(t){return e.apply(this,arguments)}}(),window.addEventListener("message",Zl,!1))}catch(e){console.log(e)}return[2,Promise.resolve()]}return ze.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Fe("showFunctionButtonWidget",{}))]}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Fl.apply(this,arguments)}var Gl=function(){var t=Ce((function(t,n){var r;return xe(this,(function(i){return r={},"cccd"===t&&(r={mrz:null==n?void 0:n.mrz}),[2,new Promise((function(n,i){yn("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,P={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:"",com:null!==(_=e.com)&&void 0!==_?_:"",sod:null!==(w=e.sod)&&void 0!==w?w:"",challenge:null!==(T=e.challenge)&&void 0!==T?T:"",aAResult:null!==(b=e.aAResult)&&void 0!==b?b:"",eACCAResult:null!==(E=e.eACCAResult)&&void 0!==E?E:""};n(P)}else n({})},fail:function(e){i(e)}},{timeout:!1})}))]}))}));return function(e,n){return t.apply(this,arguments)}}(),Vl=[Ei({type:Vi.enum(["cccd"]),data:Ei({mrz:ci().max(90)})})];function Hl(e){return Kl.apply(this,arguments)}function Kl(){return Kl=Ce((function(e){return xe(this,(function(t){return[2,Un("scanNFC",Vl,[e],function(){var e=Ce((function(e){var t,n;return xe(this,(function(r){switch(r.label){case 0:return ze.isMp?sn(754,620)?[2,Promise.reject(mn.error.clientNotSupport())]:(t=e.type,n=e.data,[4,Gl(t,n)]):[3,2];case 1:return[2,r.sent()];case 2:return ze.isMpWeb?[2,Promise.resolve({})]:[2,Promise.reject(Fe("scanNFC",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Kl.apply(this,arguments)}var Jl=Ce((function(){return xe(this,(function(e){return[2,new Promise((function(e,t){yn("CHECK_NFC",{},{success:function(t){e(t)},fail:function(e){t(e)}},{timeout:!1})}))]}))}));function ql(e){return Ql.apply(this,arguments)}function Ql(){return(Ql=Ce((function(e){return xe(this,(function(t){return[2,Un("checkNFC",[],[e],Ce((function(){return xe(this,(function(e){switch(e.label){case 0:return ze.isMp?[4,Jl()]:[3,2];case 1:return[2,e.sent()];case 2:return ze.isMpWeb?[2,Promise.resolve({})]:[2,Promise.reject(Fe("checkNFC",{}))]}}))})))]}))}))).apply(this,arguments)}var Yl=[Vi.string().trim().min(1)];var $l=[Vi.string().trim().min(1),Vi.string().trim()];var Xl=[Vi.string().trim().min(1)];var ed={getItem:function(e){return Un("getItem",Yl,[e],(function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];if(ze.isMp||ze.isMpWeb){if(sn(757,625))throw mn.error.clientNotSupport();return Io.getItem(t[0])}throw Fe("getItem",{})}))},setItem:function(e,t){return Un("setItem",$l,[e,t],(function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];if(ze.isMp||ze.isMpWeb){if(sn(757,625))throw mn.error.clientNotSupport();return Io.setItem(t[0],t[1])}throw Fe("setItem",{})}))},clear:function(){return Un("clear",[],[],(function(){if(ze.isMp||ze.isMpWeb){if(sn(757,625))throw mn.error.clientNotSupport();return Io.clearStorageSync()}throw Fe("clear",{})}))},removeItem:function(e){return Un("removeItem",Xl,[e],(function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];if(ze.isMp||ze.isMpWeb){if(sn(757,625))throw mn.error.clientNotSupport();return Io.removeItem(t[0])}throw Fe("removeItem",{})}))},getStorageInfo:function(){return Un("getStorageInfoSync",[],[],(function(){if(ze.isMp||ze.isMpWeb){if(sn(757,625))throw mn.error.clientNotSupport();return Io.getStorageInfoSync()}throw Fe("getStorageInfoSync",{})}))}},td={purchase:ac,createOrder:tc,checkTransaction:fc,createOrderIAP:yc,selectPaymentMethod:lc},nd=td,rd=function(){var e=Ce((function(e,t){return xe(this,(function(n){return[2,new Promise((function(n,r){yn("SAVE_FILE",{fileUrl:e,onProgress:t},{success:function(e){n()},fail:function(e){r(e)}},{})}))]}))}));return function(t,n){return e.apply(this,arguments)}}(),id=[Ei({url:Vi.string().url()}).optional()];function od(e){return ad.apply(this,arguments)}function ad(){return ad=Ce((function(e){return xe(this,(function(t){return[2,Un("downloadFile",id,[e],function(){var e=Ce((function(e){var t;return xe(this,(function(n){switch(n.label){case 0:return ze.isMp?(t=e.url,[4,rd(t,e.onProgress)]):[3,2];case 1:return[2,n.sent()];case 2:return ze.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Fe("downloadFile",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),ad.apply(this,arguments)}var sd=Vi.enum(["APP_INITIALIZING","APP_READY"]),ud=Vi.any();var cd,ld={logEvent:function(e,t){return Un("logEvent",[sd,ud],[e,t],(function(e,t){if(ze.isMp||ze.isMpWeb){var n,r,i,o=Ta(Ve({},"object"==typeof t&&null!==t?t:{}),{duration:Math.round(performance.now()),timestamp:Date.now()});return null===window||void 0===window||null===(n=window.zmpGlobal)||void 0===n||null===(r=n.eventManager)||void 0===r||null===(i=r.logEventForClient)||void 0===i||i.call(r,{type:p.DEV_TRACKING,eventCode:"APP_INITIALIZING"===e?f.APP_INITIALIZING:f.APP_READY}),nn([{action:"zmp.app.lifecycle.tracking",error:0,message:"",data:Ve({eventType:e},o)}])}throw Fe("logEvent",{})}))}},dd=[Ei({id:ci(),textColor:Vi.string().optional(),fontSize:Vi.string().optional(),buttonHeight:Vi.string().optional(),buttonColor:Vi.string().optional(),buttonTextColor:Vi.string().optional(),buttonRadius:Vi.string().optional(),buttonText:Vi.string().optional(),checkboxBGColor:Vi.string().optional(),checkboxCheckmarkColor:Vi.string().optional(),onClick:Vi.function().optional(),onStatusChange:Vi.function().optional(),onError:Vi.function().optional()}).catchall(Vi.any())];function pd(e){return fd.apply(this,arguments)}function fd(){return fd=Ce((function(e){return xe(this,(function(n){return[2,Un("showCustomOAWidget",dd,[e],function(){var e=Ce((function(e){var n,r,i,o,a,s,u,c,l,d,p,f,h,m,v,y,g,_,w,T,b;return xe(this,(function(E){if(ze.isMp){try{n=document.getElementById(e.id),r=e.textColor,i=e.fontSize,o=e.buttonHeight,a=e.buttonColor,s=e.buttonTextColor,u=e.buttonRadius,c=e.buttonText,l=e.checkboxBGColor,d=e.checkboxCheckmarkColor,p=e.onStatusChange,f=e.onClick,h=e.onError,m=t(e,["textColor","fontSize","buttonHeight","buttonColor","buttonTextColor","buttonRadius","buttonText","checkboxBGColor","checkboxCheckmarkColor","onStatusChange","onClick","onError"]),n&&(v=document.createElement("iframe"),y="ifCOAW-".concat(e.id,"-").concat(Date.now()),g=new URL(Ae.CUSTOM_OA),_={id:y,appId:window.APP_ID,textColor:r,fontSize:i,buttonHeight:o,buttonColor:a,buttonTextColor:s,buttonRadius:u,buttonText:c,checkboxBGColor:l,checkboxCheckmarkColor:d},Object.entries(m).forEach((function(e){var t=He(e,2),n=t[0],r=t[1];r&&(_["data-".concat(n)]=String(r))})),w=JSON.stringify(_),P=w,S=(new TextEncoder).encode(P),I=Array.from(S).map((function(e){return String.fromCharCode(e)})).join(""),T=btoa(I),b=encodeURIComponent(T),xn(g.searchParams,"data",b),v.id=y,v.src=g.href,v.style.width="100%",v.style.height="100%",v.style.border="none",n.innerHTML=v.outerHTML,window.removeEventListener("message",cd,!1),cd=function(){var e=Ce((function(e){var t,n,r,i,o,a,s,u,c;return xe(this,(function(l){switch(l.label){case 0:return t=e.data,e.origin.startsWith(Ie)?(n=document.getElementById(y),r=t.type,(i=new URL(t.href)).origin!==g.origin||i.pathname!==g.pathname||t.id!==y?[3,3]:"followOA"!==r&&"getOAInfo"!==r?[3,2]:[4,wn.jumpAndGetToken()]):[3,3];case 1:return l.sent(),s=null===(o=wn.miniProgramConfig)||void 0===o?void 0:o.jwt,null==n||null===(a=n.contentWindow)||void 0===a||a.postMessage({type:r,payload:{jwt:s}},Ie),[3,3];case 2:"oaInfo"===r?null==p||p(null===(u=t.payload)||void 0===u?void 0:u.followed):"openOA"===r?fa(t.payload.id,"oa"):"heightChange"===r?n.style.height="".concat(t.payload,"px"):"onClick"===r?null==f||f(null===(c=t.payload)||void 0===c?void 0:c.status):"onError"===r&&(null==h||h(t.payload)),l.label=3;case 3:return[2]}}))}));return function(t){return e.apply(this,arguments)}}(),window.addEventListener("message",cd,!1))}catch(e){console.log(e)}return[2,Promise.resolve()]}var P,S,I;return ze.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Fe("showCustomOAWidget",{}))]}))}));return function(t){return e.apply(this,arguments)}}())]}))})),fd.apply(this,arguments)}var hd,md=[Ei({id:ci(),onMethodChange:Vi.function().optional()}).catchall(Vi.any())];function vd(){return vd=Ce((function(e){return xe(this,(function(n){return[2,Un("showWidget",md,[e],function(){var e=Ce((function(e){var n,r,i,o,a,s,u,c,l,d,p;return xe(this,(function(f){if(ze.isMp){try{n=document.getElementById(e.id),r=e.onMethodChange,i=e.fail,o=t(e,["onMethodChange","fail"]),n&&((a=document.getElementById(Se))&&(document.body.removeChild(a),a=null),a=document.createElement("iframe"),s=Se,u=new URL(Ae.CHECKOUT_KIT),c={id:s,appId:window.APP_ID},Object.entries(o).forEach((function(e){var t=He(e,2),n=t[0],r=t[1];r&&(c["data-".concat(n)]=r)})),l=JSON.stringify(c),d=btoa(l),p=encodeURIComponent(d),xn(u.searchParams,"data",p),a.id=s,a.src=u.href,a.style.width="100%",a.style.height="100%",a.style.border="none",n.innerHTML=a.outerHTML,window.removeEventListener("message",hd,!1),hd=function(){var e=Ce((function(e){var t,n,o,a,c,l,d,p,f,h;return xe(this,(function(m){switch(m.label){case 0:if(t=e.data,!e.origin.startsWith(Ie))return[3,9];if(n=t.type,o=document.getElementById(s),(a=new URL(t.href)).origin!==u.origin||a.pathname!==u.pathname||t.id!==s)return[3,9];switch(n){case"getInfo":return[3,1];case"getToken":return[3,2];case"heightChange":return[3,4];case"callAction":return[3,5];case"onMethodChange":return[3,6];case"onError":return[3,7]}return[3,8];case 1:return Dn(o,n,{appId:window.APP_ID,zaloVersion:an(),appPlatform:null===(c=Ze())||void 0===c?void 0:c.platformName}),[3,9];case 2:return[4,wn.jumpAndGetToken()];case 3:return m.sent(),d=null===(l=wn.miniProgramConfig)||void 0===l?void 0:l.jwt,Dn(o,n,{jwt:d}),[3,9];case 4:return o.style.height="".concat(t.payload,"px"),[3,9];case 5:return p=t.payload,f=p.actionName,h=p.actionData,String(f).length>0&&yn(f,h,{success:function(e){Dn(o,n,{status:0,actionName:f,data:e})},fail:function(e){Dn(o,n,{status:-1,actionName:f,data:e})}},{}),[3,9];case 6:return null==r||r.apply(void 0,Re(Object.values(t.payload))),[3,9];case 7:null==i||i(t.payload),m.label=8;case 8:return[3,9];case 9:return[2]}}))}));return function(t){return e.apply(this,arguments)}}(),window.addEventListener("message",hd,!1))}catch(e){console.log(e)}return[2,Promise.resolve()]}return ze.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Fe("showWidget",{}))]}))}));return function(t){return e.apply(this,arguments)}}())]}))})),vd.apply(this,arguments)}var yd,gd=[Ei({amount:Vi.union([Vi.string(),Vi.number()]),desc:Vi.string(),payload:Vi.object({}).catchall(Vi.any()).optional()}).catchall(Vi.any())];function _d(){return _d=Ce((function(e){return xe(this,(function(n){return[2,Un("purchase",gd,[e],function(){var e=Ce((function(e){return xe(this,(function(n){return ze.isMp?[2,new Promise((function(n,r){var i=document.getElementById(Se),o=new URL(Ae.CHECKOUT_KIT);if(!(i&&un(i,HTMLIFrameElement)&&i.src.startsWith(o.origin)&&i.src.includes(o.pathname)))return r(Fe("purchase",{message:"Widget not found or not initialized."}));e.amount,e.desc,e.payload;var a=t(e,["amount","desc","payload"]),s="purchase";Dn(i,s,Ve({amount:String(e.amount),desc:e.desc,payload:e.payload||{}},a)),window.removeEventListener("message",yd,!1),yd=function(){var e=Ce((function(e){var t,i,a;return xe(this,(function(u){if(t=e.data,e.origin.startsWith(Ie)&&(i=t.type,(a=new URL(t.href)).origin===o.origin&&a.pathname===o.pathname&&t.id===Se)){if(i===s)return[2,n(t.payload)];if("onError"===i)return[2,r(t.payload)]}return[2]}))}));return function(t){return e.apply(this,arguments)}}(),window.addEventListener("message",yd,!1)}))]:ze.isMpWeb?[2,Promise.resolve({orderId:"",messageToken:"",transId:""})]:[2,Promise.reject(Fe("purchase",{}))]}))}));return function(t){return e.apply(this,arguments)}}())]}))})),_d.apply(this,arguments)}var wd={showWidget:function(e){return vd.apply(this,arguments)},purchase:function(e){return _d.apply(this,arguments)}};window.ZaloMiniAppSDK={getVersion:Fn},Ln();var Td=Object.freeze({__proto__:null,get Events(){return e.Events},get EventName(){return e.Events},get CameraEvents(){return e.CameraEvents},AppError:ln,login:Ln,getAccessToken:Bn,getVersion:Fn,getSystemInfo:Vn,setNavigationBarTitle:qi,setNavigationBarColor:$i,setNavigationBarLeftButton:to,setStorage:Oo,getStorage:No,getStorageInfo:Ro,removeStorage:Uo,clearStorage:Bo,getUserInfo:Fo,getNetworkType:Ko,onNetworkStatusChange:Qo,startBeaconDiscovery:Xo,stopBeaconDiscovery:na,getBeacons:oa,closeApp:ua,scanQRCode:da,openProfile:ma,openChat:_a,openPostFeed:Pa,followOA:Oa,unfollowOA:Ma,openShareSheet:La,requestCameraPermission:Za,createShortcut:Ha,openBioAuthentication:Qa,checkStateBioAuthentication:Xa,showToast:rs,hideKeyboard:as,openPhone:ls,openSMS:hs,viewOAQr:gs,keepScreen:bs,onKeepScreen:Ps,offKeepScreen:Is,saveImageToGallery:ks,saveVideoToGallery:xs,openMiniApp:js,vibrate:Ws,openWebview:Hs,getRouteParams:qs,getAppInfo:Qs,sendDataToPreviousMiniApp:eu,getPhoneNumber:ru,openProfilePicker:su,connectWifi:du,openMediaPicker:mu,getShareableLink:gu,closeLoading:Tu,requestUpdateZalo:Eu,onConfirmToExit:Au,offConfirmToExit:Ou,getDeviceId:Cu,getDeviceIdAsync:ku,getContext:Mu,getContextAsync:Ru,getAuthCode:Du,getZPIToken:Lu,setAccessToken:Zu,openOutApp:Wu,chooseImage:Vu,getLocation:Ju,onCallbackData:Yu,createOrder:tc,purchase:ac,selectPaymentMethod:lc,checkTransaction:fc,createOrderIAP:yc,events:Su,setAndroidBottomNavigationBar:wc,setIOSBottomSafeArea:Ec,setStatusBar:Ic,configAppView:Cc,minimizeApp:Mc,openPermissionSetting:Dc,favoriteApp:jc,openGroupList:zc,requestSendNotification:Gc,addRating:Kc,interactOA:Xc,interactOa:Xc,isAllowedInteractWithOA:nl,getSetting:il,authorize:ul,checkZaloCameraPermission:dl,getUserID:fl,getIDToken:vl,createCameraContext:El,setupAd:Sl,loadAd:Ol,displayAd:Nl,refreshAd:xl,showOAWidget:jl,showFunctionButtonWidget:Wl,scanNFC:Hl,checkNFC:ql,nativeStorage:ed,Payment:td,CheckoutSDK:nd,downloadFile:od,trackingManager:ld,showCustomOAWidget:pd,CheckoutKit:wd,get FacingMode(){return e.FacingMode},get PhotoFormat(){return e.PhotoFormat},get PhotoQuality(){return e.PhotoQuality},get StreamType(){return e.StreamType},ZMACameraImp:wl}),bd=t(Td,["createOrder","checkTransaction","createOrderIAP","selectPaymentMethod","purchase"]);!function(){var e,t=null===(e=Ze())||void 0===e?void 0:e.appEnv;(null==t?void 0:t.isMp)&&(window.ZaloMiniAppSDK={},Object.assign(window.ZaloMiniAppSDK,Td))}(),e.AppError=ln,e.CheckoutKit=wd,e.CheckoutSDK=nd,e.EventName=e.Events,e.Payment=td,e.ZMACameraImp=wl,e.addRating=Kc,e.authorize=ul,e.checkNFC=ql,e.checkStateBioAuthentication=Xa,e.checkTransaction=fc,e.checkZaloCameraPermission=dl,e.chooseImage=Vu,e.clearStorage=Bo,e.closeApp=ua,e.closeLoading=Tu,e.configAppView=Cc,e.connectWifi=du,e.createCameraContext=El,e.createOrder=tc,e.createOrderIAP=yc,e.createShortcut=Ha,e.default=bd,e.displayAd=Nl,e.downloadFile=od,e.events=Su,e.favoriteApp=jc,e.followOA=Oa,e.getAccessToken=Bn,e.getAppInfo=Qs,e.getAuthCode=Du,e.getBeacons=oa,e.getContext=Mu,e.getContextAsync=Ru,e.getDeviceId=Cu,e.getDeviceIdAsync=ku,e.getIDToken=vl,e.getLocation=Ju,e.getNetworkType=Ko,e.getPhoneNumber=ru,e.getRouteParams=qs,e.getSetting=il,e.getShareableLink=gu,e.getStorage=No,e.getStorageInfo=Ro,e.getSystemInfo=Vn,e.getUserID=fl,e.getUserInfo=Fo,e.getVersion=Fn,e.getZPIToken=Lu,e.hideKeyboard=as,e.interactOA=Xc,e.interactOa=Xc,e.isAllowedInteractWithOA=nl,e.keepScreen=bs,e.loadAd=Ol,e.login=Ln,e.minimizeApp=Mc,e.nativeStorage=ed,e.offConfirmToExit=Ou,e.offKeepScreen=Is,e.onCallbackData=Yu,e.onConfirmToExit=Au,e.onKeepScreen=Ps,e.onNetworkStatusChange=Qo,e.openBioAuthentication=Qa,e.openChat=_a,e.openGroupList=zc,e.openMediaPicker=mu,e.openMiniApp=js,e.openOutApp=Wu,e.openPermissionSetting=Dc,e.openPhone=ls,e.openPostFeed=Pa,e.openProfile=ma,e.openProfilePicker=su,e.openSMS=hs,e.openShareSheet=La,e.openWebview=Hs,e.purchase=ac,e.refreshAd=xl,e.removeStorage=Uo,e.requestCameraPermission=Za,e.requestSendNotification=Gc,e.requestUpdateZalo=Eu,e.saveImageToGallery=ks,e.saveVideoToGallery=xs,e.scanNFC=Hl,e.scanQRCode=da,e.selectPaymentMethod=lc,e.sendDataToPreviousMiniApp=eu,e.setAccessToken=Zu,e.setAndroidBottomNavigationBar=wc,e.setIOSBottomSafeArea=Ec,e.setNavigationBarColor=$i,e.setNavigationBarLeftButton=to,e.setNavigationBarTitle=qi,e.setStatusBar=Ic,e.setStorage=Oo,e.setupAd=Sl,e.showCustomOAWidget=pd,e.showFunctionButtonWidget=Wl,e.showOAWidget=jl,e.showToast=rs,e.startBeaconDiscovery=Xo,e.stopBeaconDiscovery=na,e.trackingManager=ld,e.unfollowOA=Ma,e.vibrate=Ws,e.viewOAQr=gs,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})),zt={enablePaymentDone:!1};function Wt(e){var t=e.data;return{orderId:t.zmpOrderId||t.orderId,transId:t.appTransID||t.apptransid||t.transId}}var Ft="ACTION_CALLBACK";function Gt(t,n,r,i){switch(!0){case"string"==typeof r||null===r:return[{eventName:t,eventId:n,data:r}];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(null==r?void 0:r.eventType))return[{eventName:e.Events.OnDataCallback,eventId:n,data:r},{eventName:e.Events.PaymentDone,eventId:n,data:Wt(r)}];break;default:return[{eventName:t,eventId:n,data:r}]}}var Vt=function(t){Lt(r,t);var n=Bt(r);function r(){var e;return Ct(this,r),(e=n.apply(this,arguments)).debug=Et("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===Ft||t===e.Events.PaymentCallback)return Dt(Rt(r.prototype),"on",this).call(this,t,n,i);this.debug("register ".concat(String(t),": ").concat(i));return Dt(Rt(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===Ft)return Dt(Rt(r.prototype),"once",this).call(this,e,t,n);this.debug("register once ".concat(String(e),": ").concat(n));return Dt(Rt(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}(Zt);function Ht(e){Vt.getInstance().emit(Ft,e)}function Kt(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){Ht({serialId:e,actionName:t,result:n})}},window.zaloJSV2={zalo_h5_event_handler:function(t,n,r){var i=Et("zmp:zalo_h5_event_handler");i("eventId: ".concat(t,", eventName: ").concat(n,", eventData: ").concat(r));var a=Sn(r);i("stringToData",a);var s=function(t,n){if(!n||"string"==typeof n)return 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),u=Gt(n,t,s,zt);null==u||u.forEach((function(e){Vt.getInstance().emit(e.eventName,e.eventId,e.data);var t=document.getElementById(Se);t&&Un(t,"appEvent",{eventName:e.eventName,eventId:e.eventId,data:e.data})}))}},window.zaloNative2JS={nativeCall:function(t,n,r){Vt.getInstance().emit(e.Events.PaymentCallback,t,n,r)}};var Jt={encode:Kt,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:Kt(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":bt(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":bt(r))?JSON.stringify(r):encodeURIComponent(r)].join("=");n.push(i)})),n.join("&")}},qt={},Qt=function(e,t,n){var r=t||"default";return function(){return(r in qt?qt[r](e,n):e).apply(this,arguments)}};Qt.setWrapper=function(e){qt[arguments.length<=1||void 0===arguments[1]?"default":arguments[1]]=e};var Yt={error:{code:1,error_subcode:1357046,message:"Received Invalid JSON reply.",type:"http"}};function $t(e){try{return null===e?Yt:JSON.parse(e)}catch(e){return Yt}}var Xt,en={execute:function(e,t,n,r){n.suppress_http_code=1;var i=Jt.encode(n);"post"!=t&&(e=Jt.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=Qt((function(){o=r,"onload"in i&&i.onload(n)}),"entry","XMLHttpRequest:load"),a=Qt((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($t(e.responseText))},o.onerror=function(e){e.responseText?r($t(e.responseText)):r({error:{code:1,error_subcode:1357045,message:"unknown error (empty response)",status:e.status,type:"http"}})},o.send(i),!0)}},tn=en,nn=(Xt=ke((function(e,t,n){var r,i,o,a;return xe(this,(function(s){switch(s.label){case 0:return r={appId:e,versionStatus:t},kt.isUndefined(n)||(r.currentVersion=n),i=Jt.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 Xt.apply(this,arguments)});function rn(e){try{var t=e.map((function(e){return{action:e.action,error:e.error,message:e.message,data:e.data}}));tn.execute(d.SEND_ACTION_LOG,"post",{appId:window.APP_ID,data:JSON.stringify(t)},(function(){}))}catch(e){}}var on=function(e){return e.replace(/[A-Z]/g,(function(e){return"_".concat(e.toLowerCase())}))},an=function(){var e;return"android"===((null===(e=ze())||void 0===e?void 0:e.platformName)||"").toLowerCase()};var sn=function(){var e=0;if(window.zaloVersionCode)e=window.zaloVersionCode;else{var t,n=Number((null===(t=ze())||void 0===t?void 0:t.zaloVersion)||"0");if(n>=24112e3)e=n;else{var r,i=((null===(r=ze())||void 0===r?void 0:r.platformName)||"").toLowerCase();"android"===i?e=n%1e4:"ios"===i&&(e=n)}}return function(e){var t=String(e);try{if(/^\d{9}$/.test(t)&&"0"===t[5])return Number(t.slice(0,5)+t.slice(6))}catch(e){}return Number(t)}(e)},un=function(e,t){var n=sn();return an()&&n<e||function(){var e;return"ios"===((null===(e=ze())||void 0===e?void 0:e.platformName)||"").toLowerCase()}()&&n<t};function cn(e,t){return null!=t&&"undefined"!=typeof Symbol&&t[Symbol.hasInstance]?!!t[Symbol.hasInstance](e):e instanceof t}var ln,dn=function(){function e(t,n,r,i){Ct(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}(),pn=function(e,t){return cn(e,dn)?function(e,t){return e.api=t,e.toJSON()}(e,t):function(e,t){return cn(e,Error)?new dn(m,e.message,t).toJSON():kt.isEmpty(null==e?void 0:e.message)||kt.isEmpty(null==e?void 0:e.code)?new dn(m,A,t,e).toJSON():new dn(e.code,e.message,t,e.detail).toJSON()}(e,t)},fn=(ln=ke((function(e){var t;return xe(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,He({method:"GET"},t))];case 1:return[4,n.sent().json()];case 2:return[2,n.sent()]}}))})),function(e){return ln.apply(this,arguments)}),hn=ke((function(){return xe(this,(function(e){return[2,new Promise(function(){var e=ke((function(e,t){var n,r,i,o;return xe(this,(function(a){switch(a.label){case 0:return a.trys.push([0,3,,4]),[4,Tn.jumpAndGetToken()];case 1:return a.sent(),(r=null===(n=Tn.miniProgramConfig)||void 0===n?void 0:n.jwt)||t(new dn(g,C,"getSetting")),[4,fn(r)];case 2:return(i=a.sent())&&0===i.err?e({authSetting:i.data}):t(new dn(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)}}())]}))})),mn=function(){var t,n,r,i=ze(),o={},a=Vt.getInstance(),s=[],u=!1;return u||(n=function(t){var n=t.serialId,r=In(t.result),i=Cn(null==r?void 0:r.action),u=kt.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=kt.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?kt.isFunction(r)&&r(e):kt.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,P=null==y?void 0:y.type;_.data={uid:E,openChatType:P}}(null==y?void 0:y.onProgress)&&g&&a.off(e.Events.DownloadProgress,g)}catch(e){}s.push(_)}},Vt.getInstance().on(Ft,n),a.on(e.Events.AppPaused,(function(){if(s.length>0){var e=s;s=[],rn(e)}})),t?clearInterval(t):t=setInterval((function(){if(s.length>0){var e=s;s=[],rn(e)}}),5e3),u=!0),r=ke((function(t,n,r,s){var u,c,l,d,p,f,h,m,v,y,T,b,E,P,S,I,A,O,C,N,x,D,U;return xe(this,(function(L){switch(L.label){case 0:return c=Math.floor(1e6*Math.random()),l="".concat(t,"_").concat(c),d=xn(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=Nn(d),n&&r&&(o[l]={options:n,callback:r,isMultiCallback:p},f&&h&&(o[l].timeout=setTimeout((function(){return Ht({serialId:l,result:{error_code:w,error_message:k,data:{timeout:f},action:t}}),null}),!0===f?8e3:1e3*f))),y?[4,hn()]:[3,2];case 1:if(!1===(null==(b=L.sent())||null===(T=b.authSetting)||void 0===T?void 0:T["scope.userInfo"]))return Ht({serialId:l,result:{error_code:g,error_message:R,data:{isMobile:null==i||null===(E=i.platform)||void 0===E?void 0:E.isMobile},action:t}}),[2];L.label=2;case 2:return P=Cn(d),!(null==i||null===(u=i.platform)||void 0===u?void 0:u.isMobile)||!t||kt.isUndefined(ZaloJavaScriptInterface)||i.platform.isIOS&&!Pn(t)||P&&!1===P.isSupported?(Ht({serialId:l,result:{error_code:_,error_message:M,data:{isMobile:null==i||null===(S=i.platform)||void 0===S?void 0:S.isMobile},action:t}}),[2]):(I=En(n),m?[3,4]:[4,Tn.getJSAccessToken()]);case 3:return O=L.sent(),[3,5];case 4:O="",L.label=5;case 5:A=O,L.label=6;case 6:return L.trys.push([6,10,,11]),m||!v?[3,8]:[4,Tn.getAccessToken()];case 7:return N=L.sent(),[3,9];case 8:N="",L.label=9;case 9:return C=N,[3,11];case 10:return x=L.sent(),Ht({serialId:l,result:{error_code:null==x?void 0:x.code,error_message:null==x?void 0:x.message,action:t}}),[2];case 11:try{n&&(null==n?void 0:n.onProgress)&&(D=function(e){!function(e,t){e.url;var n=e.progress;t&&t(n)}(e,null==n?void 0:n.onProgress)},o[l].downloadListener=D,a.on(e.Events.DownloadProgress,D))}catch(e){}return U=i.platform.isIOS?window.onNativeMessage(l,d):'window.onNativeMessage("'.concat(l,'", "').concat(d,'")'),[2,ZaloJavaScriptInterface.jsCall(A,d,C,I,U)]}}))})),function(e,t,n,i){return r.apply(this,arguments)}}(),vn={success:function(e,t){return{code:h,message:t||I,data:e||{}}},error:{failLimit:function(){return new dn(T,O)},badRequest:function(e){return new dn(v,e)},loginFailed:function(e){return new dn(g,"".concat(N,": ").concat(e))},loginRequired:function(){return new dn(g,C)},cannotGetShareInfo:function(){return new dn(y,"Can not get app info to share")},createIAPOrderFailed:function(e){var t=Object.keys(te).find((function(t){return t===e.toString()}));return new dn(e,t||A)},clientNotSupport:function(){return new dn(_,M)}}},yn=function(t){var n,r,i,o=null===(n=ze())||void 0===n?void 0:n.platformName,a=Rn(t.action),s=Z[a],u=(null==s?void 0:s.skipJump)||!1,c=(null==s?void 0:s.errorList)||{};if("JUMP_LOGIN"===a)return new dn(m,"Can not get auth code: ".concat(t.error_message));if(Tn.jumpStatus!==e.JumpStatus.DONE&&!u)return new dn(j.UNAUTHORIZED.code,j.UNAUTHORIZED.message);if("permission required!"===String(t.error_message).toLowerCase()||"no permission!"===String(t.error_message).toLowerCase())return new dn(j.FORBIDDEN.code,j.FORBIDDEN.message);if(o&&(null===(r=z[o])||void 0===r?void 0:r[t.error_code]))return new dn(z[o][t.error_code].code,z[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 dn(null===(p=l.mapTo)||void 0===p?void 0:p.code,h)}return new dn(t.error_code,t.error_message)},gn=function(e,t,r,i){var o=function(e,t){function r(r){return function(i){var o=kt.isEmpty(t)?void 0:t[r];if(o)return Fe({stage:n.RESPONSE,type:"log",state:r,name:e,response:i}),o("fail"===r?yn(i):null==i?void 0:i.data)}}return kt.isUndefined(e)&&(e=""),Object.assign({},{success:r("success"),fail:r("fail")})}(e,r),a=Z[e],s=(null==i?void 0:i.delay)||0;setTimeout((function(){mn(e,t,o,He({},i,a))}),s)},_n=function(){var e=ke((function(e){return xe(this,(function(t){return[2,new Promise((function(t,n){gn("MP_USER_AUTHORIZE",{scopes:e,forceUpdate:!0},{success:function(e){kt.isEmpty(e)||t(e)},fail:function(e){n(e)}},{isMultiCallback:!1,timeout:!1})}))]}))}));return function(t){return e.apply(this,arguments)}}(),wn=function(){function t(){Ct(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=B[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 ke((function(){return xe(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,Fe({stage:n.REQUEST,type:"log",name:"jump"}),mn("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)||rn([{action:"action.jump.login",error:-102,message:"no zoauth",data:{}}]),r(e.JumpStatus.DONE)},fail:function(e){rn([{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 ke((function(){var i;return xe(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=ke((function(e){var t,n,i;return xe(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 ke((function(){var i,o;return xe(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),kt.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,He({method:"POST",body:i},o)).then(function(){var e=ke((function(e){var t,n,i,o;return xe(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 ke((function(){var n,r,a,s,u,c,d,p,f;function h(){return m.apply(this,arguments)}function m(){return(m=ke((function(){return xe(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 xe(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--,rn([{action:d,error:-104,message:"no user auth",data:{}}]),vn.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),rn([{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)]:(rn([{action:d,error:-101,message:"no accessToken",data:{}}]),[2,Promise.reject(vn.error.loginFailed("Can't get accessToken. Please try again later."))]);case 15:throw r.getAccessTokenCount--,rn([{action:d,error:-102,message:"no oauth",data:{}}]),vn.error.loginFailed("Zalo app has not been activated")}}))}))()},c.verifyUserAuthorized=function(){var e=this;return ke((function(){var t,n,r,i,o,a;return xe(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=Cn("action.mp.user.authorize"))&&r.isSupported?[4,hn()]:[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,_n()];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 ke((function(){var t;return xe(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=ke((function(i){var o,a,s,u;return xe(this,(function(c){switch(c.label){case 0:return!n&&r._cookies.length>0?kt.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}}])&&Nt(r.prototype,a),u&&Nt(r,u),t}(),Tn=wn.getInstance(),bn=Et("zmp:utils:common"),En=function(e){if(kt.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(En(e[r]));return"["+t.join(",")+"]"}if("object"==typeof e){for(var i in t=[],e)t.push('"'+i+'":'+En(e[i]));return"{"+t.join(",")+"}"}return e.toString()},Pn=function(e){var t=Z[e],n=sn(),r=t&&"object"==typeof t&&"versionLive"in t&&t.versionLive&&"iOS"in t.versionLive?t.versionLive.iOS:0;return!!(Array.isArray(window.ignoreCheckSupport)&&window.ignoreCheckSupport.length>0&&window.ignoreCheckSupport.includes(e))||n>=r},Sn=function(e){try{if(e){bn(e);var t=e.replace(/\\/g,"").replace(/&#39;/g,"'");try{t=decodeURIComponent(atob(e))}catch(e){}var n=JSON.parse(t);return bn("formattedValue",t,n,void 0===n?"undefined":bt(n)),n}return null}catch(t){return bn("parse json error:",t),e}},In=function(e){if(kt.isObject(JSON)&&JSON.parse&&kt.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 kt.isObject(e)?e:new Function("return "+e)()},An=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""},On=function(e){return btoa(encodeURIComponent(JSON.stringify(e)))};var kn=function(t){return"hidden"===t?e.StatusBarType.hidden:"transparent"===t?e.StatusBarType.transparent:e.StatusBarType.normal},Cn=function(e){if(void 0!==e){var t=Tn.miniProgramConfig;return((null==t?void 0:t.dynamicApis)||[]).find((function(t){return t.action===e&&!1===t.clientHandle}))}},Nn=function(e){if(void 0===e)return!1;var t=Tn.miniProgramConfig;return((null==t?void 0:t.requiredAuthenList)||[]).indexOf(e)>=0},Mn=function(){var e=ke((function(){return xe(this,(function(e){return[2,new Promise(function(){var e=ke((function(e,t){var n;return xe(this,(function(t){switch(t.label){case 0:return t.trys.push([0,2,,3]),[4,Tn.jumpAndGetToken()];case 1:return t.sent(),n=Tn.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)}}(),Rn=function(e){return e.replace("action.","").replace(/\./g,"_").toUpperCase()},xn=function(e){return e.startsWith("action.")?e:"action.".concat(e.replace(/\_/g,".").toLowerCase())},Dn=function(e,t,n){"string"==typeof n&&n.length>0?e.set(t,n):"object"!=typeof n||Array.isArray(n)||Object.entries(n).forEach((function(n){var r=Ke(n,2),i=r[0],o=r[1];null!=o&&""!==o&&e.set("".concat(t).concat(i),String(o))}))},Un=function(e,t,n){var r;null===(r=e.contentWindow)||void 0===r||r.postMessage({type:t,payload:n},Ie)};function Ln(e,t,n,r){var i,o;!function(e,t){if(B[e]){var n=Tn.getRetryLimit(e);n.lastCall&&(new Date).getTime()-n.lastCall>1e3&&Tn.resetRetryLimit(e);var r=n.limit||3;if(n.retry&&n.retry>=r)throw pn(vn.error.failLimit(),e);Tn.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=vn.error.badRequest(s);throw c.detail=a,pn(c,e)}u.push(i.data)}));var c=r.apply(void 0,Re(u));return kt.isPromise(c)?new Promise((function(t,n){c.then((function(e){if(!kt.isNull(a)&&kt.isFunction(a))return a(e);t(c)})).catch((function(t){var r=pn(t,e);if(!kt.isNull(s)&&kt.isFunction(s))return s(r);n(r)}))})):c}catch(t){if(!kt.isNull(s)&&kt.isFunction(s))return s(t);throw pn(t,e)}}function jn(e){return Bn.apply(this,arguments)}function Bn(){return(Bn=ke((function(e){return xe(this,(function(t){return[2,Ln("login",[],[e],ke((function(){return xe(this,(function(e){switch(e.label){case 0:return We.isMp?[4,Tn.jumpAndGetToken(l.ZOAUTH)]:[3,2];case 1:return e.sent(),[2,"Success"];case 2:return We.isMpWeb?[2,Promise.resolve("")]:[2,Promise.reject(Ge("login",{}))]}}))})))]}))}))).apply(this,arguments)}function Zn(e){return zn.apply(this,arguments)}function zn(){return(zn=ke((function(e){return xe(this,(function(t){return[2,Ln("getAccessToken",[],[e],ke((function(){var e;return xe(this,(function(t){switch(t.label){case 0:return We.isMp?[4,Mn()]:[3,3];case 1:return e=!t.sent(),[4,Tn.getAccessToken(e)];case 2:return[2,t.sent()||""];case 3:return We.isMpWeb?[2,Promise.resolve("")]:[2,Promise.reject(Ge("getAccessToken",{}))]}}))})))]}))}))).apply(this,arguments)}var Wn,Fn="2.47.1";function Gn(){return Ln("getVersion",[],[],(function(){return Fn}))}function Vn(){var e;return{version:An("version-id")||"",apiVersion:Fn,zaloVersion:String(sn()),platform:(null===(e=ze())||void 0===e?void 0:e.platformName)||"",language:navigator.language,zaloLanguage:window.zLanguage||"vi",zaloTheme:window.zTheme||"light"}}function Hn(){return Ln("getSystemInfo",[],[],(function(){return Vn()}))}!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}(Wn||(Wn={}));const Kn=Wn.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Jn=e=>{switch(typeof e){case"undefined":return Kn.undefined;case"string":return Kn.string;case"number":return isNaN(e)?Kn.nan:Kn.number;case"boolean":return Kn.boolean;case"function":return Kn.function;case"bigint":return Kn.bigint;case"symbol":return Kn.symbol;case"object":return Array.isArray(e)?Kn.array:null===e?Kn.null:e.then&&"function"==typeof e.then&&e.catch&&"function"==typeof e.catch?Kn.promise:"undefined"!=typeof Map&&e instanceof Map?Kn.map:"undefined"!=typeof Set&&e instanceof Set?Kn.set:"undefined"!=typeof Date&&e instanceof Date?Kn.date:Kn.object;default:return Kn.unknown}},qn=Wn.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 Qn 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,Wn.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()}}Qn.create=e=>new Qn(e);const Yn=(e,t)=>{let n;switch(e.code){case qn.invalid_type:n=e.received===Kn.undefined?"Required":`Expected ${e.expected}, received ${e.received}`;break;case qn.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(e.expected,Wn.jsonStringifyReplacer)}`;break;case qn.unrecognized_keys:n=`Unrecognized key(s) in object: ${Wn.joinValues(e.keys,", ")}`;break;case qn.invalid_union:n="Invalid input";break;case qn.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${Wn.joinValues(e.options)}`;break;case qn.invalid_enum_value:n=`Invalid enum value. Expected ${Wn.joinValues(e.options)}, received '${e.received}'`;break;case qn.invalid_arguments:n="Invalid function arguments";break;case qn.invalid_return_type:n="Invalid function return type";break;case qn.invalid_date:n="Invalid date";break;case qn.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}"`:Wn.assertNever(e.validation):n="regex"!==e.validation?`Invalid ${e.validation}`:"Invalid";break;case qn.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 qn.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 qn.custom:n="Invalid input";break;case qn.invalid_intersection_types:n="Intersection results could not be merged";break;case qn.not_multiple_of:n=`Number must be a multiple of ${e.multipleOf}`;break;case qn.not_finite:n="Number must be finite";break;default:n=t.defaultError,Wn.assertNever(e)}return{message:n}};let $n=Yn;function Xn(){return $n}const er=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 tr(e,t){const n=er({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,Xn(),Yn].filter((e=>!!e))});e.common.issues.push(n)}class nr{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 rr;"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 nr.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 rr;if("aborted"===i.status)return rr;"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 rr=Object.freeze({status:"aborted"}),ir=e=>({status:"dirty",value:e}),or=e=>({status:"valid",value:e}),ar=e=>"aborted"===e.status,sr=e=>"dirty"===e.status,ur=e=>"valid"===e.status,cr=e=>"undefined"!=typeof Promise&&e instanceof Promise;var lr;!function(e){e.errToObj=e=>"string"==typeof e?{message:e}:e||{},e.toString=e=>"string"==typeof e?e:null==e?void 0:e.message}(lr||(lr={}));class dr{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 pr=(e,t)=>{if(ur(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 Qn(e.common.issues)}};function fr(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 hr{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 Jn(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:Jn(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new nr,ctx:{common:e.parent.common,data:e.data,parsedType:Jn(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const t=this._parse(e);if(cr(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:Jn(e)},i=this._parseSync({data:e,path:r.path,parent:r});return pr(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:Jn(e)},r=this._parse({data:e,path:n.path,parent:n}),i=await(cr(r)?r:Promise.resolve(r));return pr(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:qn.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 $r({schema:this,typeName:ci.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}optional(){return Xr.create(this,this._def)}nullable(){return ei.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Mr.create(this,this._def)}promise(){return Yr.create(this,this._def)}or(e){return Ur.create([this,e],this._def)}and(e){return Zr.create(this,e,this._def)}transform(e){return new $r({...fr(this._def),schema:this,typeName:ci.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const t="function"==typeof e?e:()=>e;return new ti({...fr(this._def),innerType:this,defaultValue:t,typeName:ci.ZodDefault})}brand(){return new oi({typeName:ci.ZodBranded,type:this,...fr(this._def)})}catch(e){const t="function"==typeof e?e:()=>e;return new ni({...fr(this._def),innerType:this,catchValue:t,typeName:ci.ZodCatch})}describe(e){return new(0,this.constructor)({...this._def,description:e})}pipe(e){return ai.create(this,e)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const mr=/^c[^\s-]{8,}$/i,vr=/^[a-z][a-z0-9]*$/,yr=/^([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,gr=/^(([^<>()[\]\\.,;:\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 _r extends hr{constructor(){super(...arguments),this._regex=(e,t,n)=>this.refinement((t=>e.test(t)),{validation:t,code:qn.invalid_string,...lr.errToObj(n)}),this.nonempty=e=>this.min(1,lr.errToObj(e)),this.trim=()=>new _r({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}_parse(e){this._def.coerce&&(e.data=String(e.data));if(this._getType(e)!==Kn.string){const t=this._getOrReturnCtx(e);return tr(t,{code:qn.invalid_type,expected:Kn.string,received:t.parsedType}),rr}const t=new nr;let n;for(const i of this._def.checks)if("min"===i.kind)e.data.length<i.value&&(n=this._getOrReturnCtx(e,n),tr(n,{code:qn.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),tr(n,{code:qn.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?tr(n,{code:qn.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}):o&&tr(n,{code:qn.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}),t.dirty())}else if("email"===i.kind)gr.test(e.data)||(n=this._getOrReturnCtx(e,n),tr(n,{validation:"email",code:qn.invalid_string,message:i.message}),t.dirty());else if("uuid"===i.kind)yr.test(e.data)||(n=this._getOrReturnCtx(e,n),tr(n,{validation:"uuid",code:qn.invalid_string,message:i.message}),t.dirty());else if("cuid"===i.kind)mr.test(e.data)||(n=this._getOrReturnCtx(e,n),tr(n,{validation:"cuid",code:qn.invalid_string,message:i.message}),t.dirty());else if("cuid2"===i.kind)vr.test(e.data)||(n=this._getOrReturnCtx(e,n),tr(n,{validation:"cuid2",code:qn.invalid_string,message:i.message}),t.dirty());else if("url"===i.kind)try{new URL(e.data)}catch(r){n=this._getOrReturnCtx(e,n),tr(n,{validation:"url",code:qn.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),tr(n,{validation:"regex",code:qn.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),tr(n,{code:qn.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),tr(n,{code:qn.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),tr(n,{code:qn.invalid_string,validation:"datetime",message:i.message}),t.dirty())}else Wn.assertNever(i);var r;return{status:t.value,value:e.data}}_addCheck(e){return new _r({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...lr.errToObj(e)})}url(e){return this._addCheck({kind:"url",...lr.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...lr.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...lr.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...lr.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,...lr.errToObj(null==e?void 0:e.message)})}regex(e,t){return this._addCheck({kind:"regex",regex:e,...lr.errToObj(t)})}startsWith(e,t){return this._addCheck({kind:"startsWith",value:e,...lr.errToObj(t)})}endsWith(e,t){return this._addCheck({kind:"endsWith",value:e,...lr.errToObj(t)})}min(e,t){return this._addCheck({kind:"min",value:e,...lr.errToObj(t)})}max(e,t){return this._addCheck({kind:"max",value:e,...lr.errToObj(t)})}length(e,t){return this._addCheck({kind:"length",value:e,...lr.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 wr(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)}_r.create=e=>{var t;return new _r({checks:[],typeName:ci.ZodString,coerce:null!==(t=null==e?void 0:e.coerce)&&void 0!==t&&t,...fr(e)})};class Tr extends hr{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){this._def.coerce&&(e.data=Number(e.data));if(this._getType(e)!==Kn.number){const t=this._getOrReturnCtx(e);return tr(t,{code:qn.invalid_type,expected:Kn.number,received:t.parsedType}),rr}let t;const n=new nr;for(const r of this._def.checks)if("int"===r.kind)Wn.isInteger(e.data)||(t=this._getOrReturnCtx(e,t),tr(t,{code:qn.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),tr(t,{code:qn.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),tr(t,{code:qn.too_big,maximum:r.value,type:"number",inclusive:r.inclusive,exact:!1,message:r.message}),n.dirty())}else"multipleOf"===r.kind?0!==wr(e.data,r.value)&&(t=this._getOrReturnCtx(e,t),tr(t,{code:qn.not_multiple_of,multipleOf:r.value,message:r.message}),n.dirty()):"finite"===r.kind?Number.isFinite(e.data)||(t=this._getOrReturnCtx(e,t),tr(t,{code:qn.not_finite,message:r.message}),n.dirty()):Wn.assertNever(r);return{status:n.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,lr.toString(t))}gt(e,t){return this.setLimit("min",e,!1,lr.toString(t))}lte(e,t){return this.setLimit("max",e,!0,lr.toString(t))}lt(e,t){return this.setLimit("max",e,!1,lr.toString(t))}setLimit(e,t,n,r){return new Tr({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:n,message:lr.toString(r)}]})}_addCheck(e){return new Tr({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:lr.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:lr.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:lr.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:lr.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:lr.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:lr.toString(t)})}finite(e){return this._addCheck({kind:"finite",message:lr.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&&Wn.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)}}Tr.create=e=>new Tr({checks:[],typeName:ci.ZodNumber,coerce:(null==e?void 0:e.coerce)||!1,...fr(e)});class br extends hr{_parse(e){this._def.coerce&&(e.data=BigInt(e.data));if(this._getType(e)!==Kn.bigint){const t=this._getOrReturnCtx(e);return tr(t,{code:qn.invalid_type,expected:Kn.bigint,received:t.parsedType}),rr}return or(e.data)}}br.create=e=>{var t;return new br({typeName:ci.ZodBigInt,coerce:null!==(t=null==e?void 0:e.coerce)&&void 0!==t&&t,...fr(e)})};class Er extends hr{_parse(e){this._def.coerce&&(e.data=Boolean(e.data));if(this._getType(e)!==Kn.boolean){const t=this._getOrReturnCtx(e);return tr(t,{code:qn.invalid_type,expected:Kn.boolean,received:t.parsedType}),rr}return or(e.data)}}Er.create=e=>new Er({typeName:ci.ZodBoolean,coerce:(null==e?void 0:e.coerce)||!1,...fr(e)});class Pr extends hr{_parse(e){this._def.coerce&&(e.data=new Date(e.data));if(this._getType(e)!==Kn.date){const t=this._getOrReturnCtx(e);return tr(t,{code:qn.invalid_type,expected:Kn.date,received:t.parsedType}),rr}if(isNaN(e.data.getTime())){return tr(this._getOrReturnCtx(e),{code:qn.invalid_date}),rr}const t=new nr;let n;for(const r of this._def.checks)"min"===r.kind?e.data.getTime()<r.value&&(n=this._getOrReturnCtx(e,n),tr(n,{code:qn.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),tr(n,{code:qn.too_big,message:r.message,inclusive:!0,exact:!1,maximum:r.value,type:"date"}),t.dirty()):Wn.assertNever(r);return{status:t.value,value:new Date(e.data.getTime())}}_addCheck(e){return new Pr({...this._def,checks:[...this._def.checks,e]})}min(e,t){return this._addCheck({kind:"min",value:e.getTime(),message:lr.toString(t)})}max(e,t){return this._addCheck({kind:"max",value:e.getTime(),message:lr.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}}Pr.create=e=>new Pr({checks:[],coerce:(null==e?void 0:e.coerce)||!1,typeName:ci.ZodDate,...fr(e)});class Sr extends hr{_parse(e){if(this._getType(e)!==Kn.symbol){const t=this._getOrReturnCtx(e);return tr(t,{code:qn.invalid_type,expected:Kn.symbol,received:t.parsedType}),rr}return or(e.data)}}Sr.create=e=>new Sr({typeName:ci.ZodSymbol,...fr(e)});class Ir extends hr{_parse(e){if(this._getType(e)!==Kn.undefined){const t=this._getOrReturnCtx(e);return tr(t,{code:qn.invalid_type,expected:Kn.undefined,received:t.parsedType}),rr}return or(e.data)}}Ir.create=e=>new Ir({typeName:ci.ZodUndefined,...fr(e)});class Ar extends hr{_parse(e){if(this._getType(e)!==Kn.null){const t=this._getOrReturnCtx(e);return tr(t,{code:qn.invalid_type,expected:Kn.null,received:t.parsedType}),rr}return or(e.data)}}Ar.create=e=>new Ar({typeName:ci.ZodNull,...fr(e)});class Or extends hr{constructor(){super(...arguments),this._any=!0}_parse(e){return or(e.data)}}Or.create=e=>new Or({typeName:ci.ZodAny,...fr(e)});class kr extends hr{constructor(){super(...arguments),this._unknown=!0}_parse(e){return or(e.data)}}kr.create=e=>new kr({typeName:ci.ZodUnknown,...fr(e)});class Cr extends hr{_parse(e){const t=this._getOrReturnCtx(e);return tr(t,{code:qn.invalid_type,expected:Kn.never,received:t.parsedType}),rr}}Cr.create=e=>new Cr({typeName:ci.ZodNever,...fr(e)});class Nr extends hr{_parse(e){if(this._getType(e)!==Kn.undefined){const t=this._getOrReturnCtx(e);return tr(t,{code:qn.invalid_type,expected:Kn.void,received:t.parsedType}),rr}return or(e.data)}}Nr.create=e=>new Nr({typeName:ci.ZodVoid,...fr(e)});class Mr extends hr{_parse(e){const{ctx:t,status:n}=this._processInputParams(e),r=this._def;if(t.parsedType!==Kn.array)return tr(t,{code:qn.invalid_type,expected:Kn.array,received:t.parsedType}),rr;if(null!==r.exactLength){const e=t.data.length>r.exactLength.value,i=t.data.length<r.exactLength.value;(e||i)&&(tr(t,{code:e?qn.too_big:qn.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&&(tr(t,{code:qn.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&&(tr(t,{code:qn.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 dr(t,e,t.path,n))))).then((e=>nr.mergeArray(n,e)));const i=[...t.data].map(((e,n)=>r.type._parseSync(new dr(t,e,t.path,n))));return nr.mergeArray(n,i)}get element(){return this._def.type}min(e,t){return new Mr({...this._def,minLength:{value:e,message:lr.toString(t)}})}max(e,t){return new Mr({...this._def,maxLength:{value:e,message:lr.toString(t)}})}length(e,t){return new Mr({...this._def,exactLength:{value:e,message:lr.toString(t)}})}nonempty(e){return this.min(1,e)}}var Rr;function xr(e){if(e instanceof Dr){const t={};for(const n in e.shape){const r=e.shape[n];t[n]=Xr.create(xr(r))}return new Dr({...e._def,shape:()=>t})}return e instanceof Mr?Mr.create(xr(e.element)):e instanceof Xr?Xr.create(xr(e.unwrap())):e instanceof ei?ei.create(xr(e.unwrap())):e instanceof zr?zr.create(e.items.map((e=>xr(e)))):e}Mr.create=(e,t)=>new Mr({type:e,minLength:null,maxLength:null,exactLength:null,typeName:ci.ZodArray,...fr(t)}),function(e){e.mergeShapes=(e,t)=>({...e,...t})}(Rr||(Rr={}));class Dr extends hr{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=Wn.objectKeys(e);return this._cached={shape:e,keys:t}}_parse(e){if(this._getType(e)!==Kn.object){const t=this._getOrReturnCtx(e);return tr(t,{code:qn.invalid_type,expected:Kn.object,received:t.parsedType}),rr}const{status:t,ctx:n}=this._processInputParams(e),{shape:r,keys:i}=this._getCached(),o=[];if(!(this._def.catchall instanceof Cr&&"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 dr(n,i,n.path,e)),alwaysSet:e in n.data})}if(this._def.catchall instanceof Cr){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&&(tr(n,{code:qn.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 dr(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=>nr.mergeObjectSync(t,e))):nr.mergeObjectSync(t,a)}get shape(){return this._def.shape()}strict(e){return lr.errToObj,new Dr({...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=lr.errToObj(e).message)&&void 0!==a?a:s}:{message:s}}}:{}})}strip(){return new Dr({...this._def,unknownKeys:"strip"})}passthrough(){return new Dr({...this._def,unknownKeys:"passthrough"})}extend(e){return new Dr({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new Dr({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>Rr.mergeShapes(this._def.shape(),e._def.shape()),typeName:ci.ZodObject})}setKey(e,t){return this.augment({[e]:t})}catchall(e){return new Dr({...this._def,catchall:e})}pick(e){const t={};return Wn.objectKeys(e).forEach((n=>{e[n]&&this.shape[n]&&(t[n]=this.shape[n])})),new Dr({...this._def,shape:()=>t})}omit(e){const t={};return Wn.objectKeys(this.shape).forEach((n=>{e[n]||(t[n]=this.shape[n])})),new Dr({...this._def,shape:()=>t})}deepPartial(){return xr(this)}partial(e){const t={};return Wn.objectKeys(this.shape).forEach((n=>{const r=this.shape[n];e&&!e[n]?t[n]=r:t[n]=r.optional()})),new Dr({...this._def,shape:()=>t})}required(e){const t={};return Wn.objectKeys(this.shape).forEach((n=>{if(e&&!e[n])t[n]=this.shape[n];else{let e=this.shape[n];for(;e instanceof Xr;)e=e._def.innerType;t[n]=e}})),new Dr({...this._def,shape:()=>t})}keyof(){return Jr(Wn.objectKeys(this.shape))}}Dr.create=(e,t)=>new Dr({shape:()=>e,unknownKeys:"strip",catchall:Cr.create(),typeName:ci.ZodObject,...fr(t)}),Dr.strictCreate=(e,t)=>new Dr({shape:()=>e,unknownKeys:"strict",catchall:Cr.create(),typeName:ci.ZodObject,...fr(t)}),Dr.lazycreate=(e,t)=>new Dr({shape:e,unknownKeys:"strip",catchall:Cr.create(),typeName:ci.ZodObject,...fr(t)});class Ur extends hr{_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 Qn(e.ctx.common.issues)));return tr(t,{code:qn.invalid_union,unionErrors:n}),rr}));{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 Qn(e)));return tr(t,{code:qn.invalid_union,unionErrors:i}),rr}}get options(){return this._def.options}}Ur.create=(e,t)=>new Ur({options:e,typeName:ci.ZodUnion,...fr(t)});const Lr=e=>e instanceof Hr?Lr(e.schema):e instanceof $r?Lr(e.innerType()):e instanceof Kr?[e.value]:e instanceof qr?e.options:e instanceof Qr?Object.keys(e.enum):e instanceof ti?Lr(e._def.innerType):e instanceof Ir?[void 0]:e instanceof Ar?[null]:null;class jr extends hr{_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==Kn.object)return tr(t,{code:qn.invalid_type,expected:Kn.object,received:t.parsedType}),rr;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}):(tr(t,{code:qn.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[n]}),rr)}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=Lr(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 jr({typeName:ci.ZodDiscriminatedUnion,discriminator:e,options:t,optionsMap:r,...fr(n)})}}function Br(e,t){const n=Jn(e),r=Jn(t);if(e===t)return{valid:!0,data:e};if(n===Kn.object&&r===Kn.object){const n=Wn.objectKeys(t),r=Wn.objectKeys(e).filter((e=>-1!==n.indexOf(e))),i={...e,...t};for(const n of r){const r=Br(e[n],t[n]);if(!r.valid)return{valid:!1};i[n]=r.data}return{valid:!0,data:i}}if(n===Kn.array&&r===Kn.array){if(e.length!==t.length)return{valid:!1};const n=[];for(let r=0;r<e.length;r++){const i=Br(e[r],t[r]);if(!i.valid)return{valid:!1};n.push(i.data)}return{valid:!0,data:n}}return n===Kn.date&&r===Kn.date&&+e==+t?{valid:!0,data:e}:{valid:!1}}class Zr extends hr{_parse(e){const{status:t,ctx:n}=this._processInputParams(e),r=(e,r)=>{if(ar(e)||ar(r))return rr;const i=Br(e.value,r.value);return i.valid?((sr(e)||sr(r))&&t.dirty(),{status:t.value,value:i.data}):(tr(n,{code:qn.invalid_intersection_types}),rr)};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}))}}Zr.create=(e,t,n)=>new Zr({left:e,right:t,typeName:ci.ZodIntersection,...fr(n)});class zr extends hr{_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==Kn.array)return tr(n,{code:qn.invalid_type,expected:Kn.array,received:n.parsedType}),rr;if(n.data.length<this._def.items.length)return tr(n,{code:qn.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),rr;!this._def.rest&&n.data.length>this._def.items.length&&(tr(n,{code:qn.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 dr(n,e,n.path,t)):null})).filter((e=>!!e));return n.common.async?Promise.all(r).then((e=>nr.mergeArray(t,e))):nr.mergeArray(t,r)}get items(){return this._def.items}rest(e){return new zr({...this._def,rest:e})}}zr.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new zr({items:e,typeName:ci.ZodTuple,rest:null,...fr(t)})};class Wr extends hr{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==Kn.object)return tr(n,{code:qn.invalid_type,expected:Kn.object,received:n.parsedType}),rr;const r=[],i=this._def.keyType,o=this._def.valueType;for(const e in n.data)r.push({key:i._parse(new dr(n,e,n.path,e)),value:o._parse(new dr(n,n.data[e],n.path,e))});return n.common.async?nr.mergeObjectAsync(t,r):nr.mergeObjectSync(t,r)}get element(){return this._def.valueType}static create(e,t,n){return new Wr(t instanceof hr?{keyType:e,valueType:t,typeName:ci.ZodRecord,...fr(n)}:{keyType:_r.create(),valueType:e,typeName:ci.ZodRecord,...fr(t)})}}class Fr extends hr{_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==Kn.map)return tr(n,{code:qn.invalid_type,expected:Kn.map,received:n.parsedType}),rr;const r=this._def.keyType,i=this._def.valueType,o=[...n.data.entries()].map((([e,t],o)=>({key:r._parse(new dr(n,e,n.path,[o,"key"])),value:i._parse(new dr(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 rr;"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 rr;"dirty"!==r.status&&"dirty"!==i.status||t.dirty(),e.set(r.value,i.value)}return{status:t.value,value:e}}}}Fr.create=(e,t,n)=>new Fr({valueType:t,keyType:e,typeName:ci.ZodMap,...fr(n)});class Gr extends hr{_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==Kn.set)return tr(n,{code:qn.invalid_type,expected:Kn.set,received:n.parsedType}),rr;const r=this._def;null!==r.minSize&&n.data.size<r.minSize.value&&(tr(n,{code:qn.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&&(tr(n,{code:qn.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 rr;"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 dr(n,e,n.path,t))));return n.common.async?Promise.all(a).then((e=>o(e))):o(a)}min(e,t){return new Gr({...this._def,minSize:{value:e,message:lr.toString(t)}})}max(e,t){return new Gr({...this._def,maxSize:{value:e,message:lr.toString(t)}})}size(e,t){return this.min(e,t).max(e,t)}nonempty(e){return this.min(1,e)}}Gr.create=(e,t)=>new Gr({valueType:e,minSize:null,maxSize:null,typeName:ci.ZodSet,...fr(t)});class Vr extends hr{constructor(){super(...arguments),this.validate=this.implement}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==Kn.function)return tr(t,{code:qn.invalid_type,expected:Kn.function,received:t.parsedType}),rr;function n(e,n){return er({data:e,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,Xn(),Yn].filter((e=>!!e)),issueData:{code:qn.invalid_arguments,argumentsError:n}})}function r(e,n){return er({data:e,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,Xn(),Yn].filter((e=>!!e)),issueData:{code:qn.invalid_return_type,returnTypeError:n}})}const i={errorMap:t.common.contextualErrorMap},o=t.data;return this._def.returns instanceof Yr?or((async(...e)=>{const t=new Qn([]),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}))})):or(((...e)=>{const t=this._def.args.safeParse(e,i);if(!t.success)throw new Qn([n(e,t.error)]);const a=o(...t.data),s=this._def.returns.safeParse(a,i);if(!s.success)throw new Qn([r(a,s.error)]);return s.data}))}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new Vr({...this._def,args:zr.create(e).rest(kr.create())})}returns(e){return new Vr({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,t,n){return new Vr({args:e||zr.create([]).rest(kr.create()),returns:t||kr.create(),typeName:ci.ZodFunction,...fr(n)})}}class Hr extends hr{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})}}Hr.create=(e,t)=>new Hr({getter:e,typeName:ci.ZodLazy,...fr(t)});class Kr extends hr{_parse(e){if(e.data!==this._def.value){const t=this._getOrReturnCtx(e);return tr(t,{received:t.data,code:qn.invalid_literal,expected:this._def.value}),rr}return{status:"valid",value:e.data}}get value(){return this._def.value}}function Jr(e,t){return new qr({values:e,typeName:ci.ZodEnum,...fr(t)})}Kr.create=(e,t)=>new Kr({value:e,typeName:ci.ZodLiteral,...fr(t)});class qr extends hr{_parse(e){if("string"!=typeof e.data){const t=this._getOrReturnCtx(e),n=this._def.values;return tr(t,{expected:Wn.joinValues(n),received:t.parsedType,code:qn.invalid_type}),rr}if(-1===this._def.values.indexOf(e.data)){const t=this._getOrReturnCtx(e),n=this._def.values;return tr(t,{received:t.data,code:qn.invalid_enum_value,options:n}),rr}return or(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 qr.create(e)}exclude(e){return qr.create(this.options.filter((t=>!e.includes(t))))}}qr.create=Jr;class Qr extends hr{_parse(e){const t=Wn.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(e);if(n.parsedType!==Kn.string&&n.parsedType!==Kn.number){const e=Wn.objectValues(t);return tr(n,{expected:Wn.joinValues(e),received:n.parsedType,code:qn.invalid_type}),rr}if(-1===t.indexOf(e.data)){const e=Wn.objectValues(t);return tr(n,{received:n.data,code:qn.invalid_enum_value,options:e}),rr}return or(e.data)}get enum(){return this._def.values}}Qr.create=(e,t)=>new Qr({values:e,typeName:ci.ZodNativeEnum,...fr(t)});class Yr extends hr{unwrap(){return this._def.type}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==Kn.promise&&!1===t.common.async)return tr(t,{code:qn.invalid_type,expected:Kn.promise,received:t.parsedType}),rr;const n=t.parsedType===Kn.promise?t.data:Promise.resolve(t.data);return or(n.then((e=>this._def.type.parseAsync(e,{path:t.path,errorMap:t.common.contextualErrorMap}))))}}Yr.create=(e,t)=>new Yr({type:e,typeName:ci.ZodPromise,...fr(t)});class $r extends hr{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===ci.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=>{tr(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?rr:("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?rr:("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(!ur(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=>ur(e)?Promise.resolve(r.transform(e.value,i)).then((e=>({status:t.value,value:e}))):e))}Wn.assertNever(r)}}$r.create=(e,t,n)=>new $r({schema:e,typeName:ci.ZodEffects,effect:t,...fr(n)}),$r.createWithPreprocess=(e,t,n)=>new $r({schema:t,effect:{type:"preprocess",transform:e},typeName:ci.ZodEffects,...fr(n)});class Xr extends hr{_parse(e){return this._getType(e)===Kn.undefined?or(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}Xr.create=(e,t)=>new Xr({innerType:e,typeName:ci.ZodOptional,...fr(t)});class ei extends hr{_parse(e){return this._getType(e)===Kn.null?or(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}ei.create=(e,t)=>new ei({innerType:e,typeName:ci.ZodNullable,...fr(t)});class ti extends hr{_parse(e){const{ctx:t}=this._processInputParams(e);let n=t.data;return t.parsedType===Kn.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:t.path,parent:t})}removeDefault(){return this._def.innerType}}ti.create=(e,t)=>new ti({innerType:e,typeName:ci.ZodDefault,defaultValue:"function"==typeof t.default?t.default:()=>t.default,...fr(t)});class ni extends hr{_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 cr(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}}ni.create=(e,t)=>new ni({innerType:e,typeName:ci.ZodCatch,catchValue:"function"==typeof t.catch?t.catch:()=>t.catch,...fr(t)});class ri extends hr{_parse(e){if(this._getType(e)!==Kn.nan){const t=this._getOrReturnCtx(e);return tr(t,{code:qn.invalid_type,expected:Kn.nan,received:t.parsedType}),rr}return{status:"valid",value:e.data}}}ri.create=e=>new ri({typeName:ci.ZodNaN,...fr(e)});const ii=Symbol("zod_brand");class oi extends hr{_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 ai extends hr{_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?rr:"dirty"===e.status?(t.dirty(),ir(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?rr:"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 ai({in:e,out:t,typeName:ci.ZodPipeline})}}const si=(e,t={},n)=>e?Or.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})}})):Or.create(),ui={object:Dr.lazycreate};var ci;!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"}(ci||(ci={}));const li=_r.create,di=Tr.create,pi=ri.create,fi=br.create,hi=Er.create,mi=Pr.create,vi=Sr.create,yi=Ir.create,gi=Ar.create,_i=Or.create,wi=kr.create,Ti=Cr.create,bi=Nr.create,Ei=Mr.create,Pi=Dr.create,Si=Dr.strictCreate,Ii=Ur.create,Ai=jr.create,Oi=Zr.create,ki=zr.create,Ci=Wr.create,Ni=Fr.create,Mi=Gr.create,Ri=Vr.create,xi=Hr.create,Di=Kr.create,Ui=qr.create,Li=Qr.create,ji=Yr.create,Bi=$r.create,Zi=Xr.create,zi=ei.create,Wi=$r.createWithPreprocess,Fi=ai.create,Gi={string:e=>_r.create({...e,coerce:!0}),number:e=>Tr.create({...e,coerce:!0}),boolean:e=>Er.create({...e,coerce:!0}),bigint:e=>br.create({...e,coerce:!0}),date:e=>Pr.create({...e,coerce:!0})},Vi=rr;var Hi=Object.freeze({__proto__:null,defaultErrorMap:Yn,setErrorMap:function(e){$n=e},getErrorMap:Xn,makeIssue:er,EMPTY_PATH:[],addIssueToContext:tr,ParseStatus:nr,INVALID:rr,DIRTY:ir,OK:or,isAborted:ar,isDirty:sr,isValid:ur,isAsync:cr,get util(){return Wn},ZodParsedType:Kn,getParsedType:Jn,ZodType:hr,ZodString:_r,ZodNumber:Tr,ZodBigInt:br,ZodBoolean:Er,ZodDate:Pr,ZodSymbol:Sr,ZodUndefined:Ir,ZodNull:Ar,ZodAny:Or,ZodUnknown:kr,ZodNever:Cr,ZodVoid:Nr,ZodArray:Mr,get objectUtil(){return Rr},ZodObject:Dr,ZodUnion:Ur,ZodDiscriminatedUnion:jr,ZodIntersection:Zr,ZodTuple:zr,ZodRecord:Wr,ZodMap:Fr,ZodSet:Gr,ZodFunction:Vr,ZodLazy:Hr,ZodLiteral:Kr,ZodEnum:qr,ZodNativeEnum:Qr,ZodPromise:Yr,ZodEffects:$r,ZodTransformer:$r,ZodOptional:Xr,ZodNullable:ei,ZodDefault:ti,ZodCatch:ni,ZodNaN:ri,BRAND:ii,ZodBranded:oi,ZodPipeline:ai,custom:si,Schema:hr,ZodSchema:hr,late:ui,get ZodFirstPartyTypeKind(){return ci},coerce:Gi,any:_i,array:Ei,bigint:fi,boolean:hi,date:mi,discriminatedUnion:Ai,effect:Bi,enum:Ui,function:Ri,instanceof:(e,t={message:`Input not instance of ${e.name}`})=>si((t=>t instanceof e),t,!0),intersection:Oi,lazy:xi,literal:Di,map:Ni,nan:pi,nativeEnum:Li,never:Ti,null:gi,nullable:zi,number:di,object:Pi,oboolean:()=>hi().optional(),onumber:()=>di().optional(),optional:Zi,ostring:()=>li().optional(),pipeline:Fi,preprocess:Wi,promise:ji,record:Ci,set:Mi,strictObject:Si,string:li,symbol:vi,transformer:Bi,tuple:ki,undefined:yi,union:Ii,unknown:wi,void:bi,NEVER:Vi,ZodIssueCode:qn,quotelessJson:e=>JSON.stringify(e,null,2).replace(/"([^"]+)":/g,"$1:"),ZodError:Qn}),Ki=function(){function t(){var e,n,r,i,a,u,c,l,d,p,f,h,m,v,y,g,_,w,T,b,E,P,S,I,A,O,k;Ct(this,t),this.initConfig=window.APP_CONFIG;var C=kt.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?Y:$;this.hideIOSSafeAreaBottom=!!(null===(u=this.initConfig)||void 0===u||null===(c=u.app)||void 0===c?void 0:c.hideIOSSafeAreaBottom),this.hideAndroidBottomNavigationBar=!!(null===(l=this.initConfig)||void 0===l||null===(d=l.app)||void 0===d?void 0:d.hideAndroidBottomNavigationBar);var N,M,R="none"===(null===(p=this.initConfig)||void 0===p||null===(f=p.app)||void 0===f?void 0:f.leftButton)||"home"===(null===(h=this.initConfig)||void 0===h||null===(m=h.app)||void 0===m?void 0:m.leftButton)?Q.HIDE_BACK:Q.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)?Q.SHOW_HOME:Q.HIDE_HOME,D=new URL(location.href),U=kn(null===(w=this.initConfig)||void 0===w||null===(T=w.app)||void 0===T?void 0:T.statusBar);"boolean"==typeof(null===(b=this.initConfig)||void 0===b||null===(E=b.app)||void 0===E?void 0:E.actionBarHidden)&&(C=(null===(N=this.initConfig)||void 0===N||null===(M=N.app)||void 0===M?void 0:M.actionBarHidden)?$:Y);this.config={actionbarType:C,buttonType:R,statusbarType:U,dataConfig:{backgroundColor:(null===(P=this.initConfig)||void 0===P||null===(S=P.app)||void 0===S?void 0:S.headerColor)||X,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)||ee,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 ke((function(){return xe(this,(function(t){return[2,new Promise((function(t,n){gn("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 ke((function(){var r,i;return xe(this,(function(o){return void 0===(void 0===e?"undefined":bt(e))&&null===(void 0===e?"undefined":bt(e))||(r="none"===e||"home"===e?Q.HIDE_BACK:Q.SHOW_BACK,i="home"===e||"both"===e?Q.SHOW_HOME:Q.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){gn("CHANGE_ACTIONBAR_LEFTBUTTON_TYPE",He({},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 ke((function(){var r,i,o;return xe(this,(function(a){return i=t?e.AndroidBottomNavigationBarType.hide:e.AndroidBottomNavigationBarType.show,o=null===(r=ze())||void 0===r?void 0:r.platform,[2,new Promise((function(e,r){if(!(null==o?void 0:o.isAndroid))return e();gn("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 ke((function(){var r,i,o;return xe(this,(function(a){return i=t?e.IOSSafeAreaBottomType.hide:e.IOSSafeAreaBottomType.show,o=null===(r=ze())||void 0===r?void 0:r.platform,[2,new Promise((function(e,r){if(!(null==o?void 0:o.isIOS))return e();gn("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 ke((function(){var r;return xe(this,(function(i){return r=n.config,kt.isString(t.headerColor)&&(r.dataConfig.backgroundColor=t.headerColor),kt.isString(t.headerTextColor)&&(r.dataConfig.textColor=t.headerTextColor),kt.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=$:!1===t.hideActionBar&&(r.actionbarType=Y),"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){gn("CHANGE_ACTIONBAR",He({},r),{success:function(){var o;n.config=He({},r);var a,s=null===(o=ze())||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===$;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}(),Ji=Ki.getInstance(),qi=[Pi({title:li()}).optional()];function Qi(e){return Yi.apply(this,arguments)}function Yi(){return Yi=ke((function(e){return xe(this,(function(t){return[2,Ln("setNavigationBarTitle",qi,[e],function(){var e=ke((function(e){return xe(this,(function(t){switch(t.label){case 0:return We.isMp?[4,Ji.setNavigationBarTitle(e.title)]:[3,2];case 1:return[2,t.sent()];case 2:return We.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Ge("setNavigationBarTitle",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Yi.apply(this,arguments)}var $i=[Pi({color:li(),textColor:Hi.enum(["black","white"]).optional(),statusBarColor:li().optional()}).optional()];function Xi(e){return eo.apply(this,arguments)}function eo(){return eo=ke((function(e){return xe(this,(function(t){return[2,Ln("setNavigationBarColor",$i,[e],function(){var e=ke((function(e){return xe(this,(function(t){switch(t.label){case 0:return We.isMp?[4,Ji.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 We.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Ge("setNavigationBarColor",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),eo.apply(this,arguments)}var to=[Pi({type:Hi.enum(["none","back","home","both"])}).optional()];function no(e){return ro.apply(this,arguments)}function ro(){return ro=ke((function(e){return xe(this,(function(t){return[2,Ln("setNavigationBarLeftButton",to,[e],function(){var e=ke((function(e){return xe(this,(function(t){switch(t.label){case 0:return We.isMp?[4,Ji.setNavigationBarLeftButton(e.type)]:[3,2];case 1:return[2,t.sent()];case 2:return We.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Ge("setNavigationBarLeftButton",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),ro.apply(this,arguments)}function io(e,t,n){if(!t.has(e))throw new TypeError("attempted to "+n+" private field on non-instance");return t.get(e)}function oo(e,t){return function(e,t){return t.get?t.get.call(e):t.value}(e,io(e,t,"get"))}function ao(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 so(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,io(e,t,"set"),n),n}var uo,co,lo=function(){function e(){Ct(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(Ve({},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}(),po=new WeakMap,fo=new WeakMap,ho=new WeakMap,mo=function(e){Lt(n,e);var t=Bt(n);function n(e){var r;return Ct(this,n),ao(jt(r=t.call(this)),po,{writable:!0,value:localStorage}),ao(jt(r),fo,{writable:!0,value:void 0}),ao(jt(r),ho,{writable:!0,value:void 0}),so(jt(r),ho,{keys:new Set,currentSize:0,limitSize:F}),so(jt(r),fo,e),r.findAllCurrentDataByApp(e),r}var r=n.prototype;return r.findAllCurrentDataByApp=function(e){try{var t;for(t in oo(this,po)){if(e)if(t.split("_")[0]!==e)continue;oo(this,ho).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 oo(this,fo)&&(e="".concat(oo(this,fo),"_").concat(e)),oo(this,ho).keys.has(e)?oo(this,po).getItem(e):null},r.set=function(e){var t=this;return ke((function(){return xe(this,(function(n){return Object.entries(e).forEach((function(e){var n=Ke(e,2),r=n[0],i=n[1];t.setSync(r,i.replace(/\\"/g,'"'))})),[2,Promise.resolve({errorKeys:[]})]}))}))()},r.setSync=function(e,t){oo(this,fo)&&(e="".concat(oo(this,fo),"_").concat(e)),oo(this,po).setItem(e,t),oo(this,ho).keys.add(e)},r.getInfo=function(){var e=this;return ke((function(){return xe(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}(oo(this,po),oo(this,fo));return{currentSize:kt.isNumber(e)?Number((e/1024).toFixed(2)):0,limitSize:Number((F/1024).toFixed(2))}},r.remove=function(e){var t=this;return ke((function(){return xe(this,(function(n){return e.forEach((function(e){t.removeSync(e)})),[2,Promise.resolve({errorKeys:[]})]}))}))()},r.removeSync=function(e){oo(this,fo)&&(e="".concat(oo(this,fo),"_").concat(e)),oo(this,ho).keys.has(e)&&(oo(this,po).removeItem(e),oo(this,ho).keys.delete(e))},r.clearAsync=function(){var e=this;return ke((function(){return xe(this,(function(t){return[2,Promise.resolve(e.clearSync())]}))}))()},r.clearSync=function(){var e=this;oo(this,ho).keys.forEach((function(t){oo(e,fo)&&t.indexOf(oo(e,fo))<0||(oo(e,po).removeItem(t),oo(e,ho).keys.delete(t))}))},r.setSynchronize=function(e){var t=this;return Object.entries(e).forEach((function(e){var n=Ke(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}(lo),vo=new WeakMap,yo=new WeakMap,go=function(e){Lt(n,e);var t=Bt(n);function n(e){var r;return Ct(this,n),ao(jt(r=t.call(this)),vo,{writable:!0,value:void 0}),ao(jt(r),yo,{writable:!0,value:void 0}),so(jt(r),yo,{keys:new Set,currentSize:0,limitSize:F}),so(jt(r),vo,e),r}var r=n.prototype;return r.get=function(e){var t=this;return ke((function(){return xe(this,(function(n){return[2,new Promise((function(n,r){gn("ZBROWSER_MPDS",{mpds_action:"mpds.get",mpds_data:{keys:e},appId:oo(t,vo)},{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:oo(this,vo)},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 ke((function(){return xe(this,(function(n){return[2,new Promise((function(n,r){gn("ZBROWSER_MPDS",{mpds_action:"mpds.set",mpds_data:{map:e},appId:oo(t,vo)},{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:oo(this,vo)},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 ke((function(){return xe(this,(function(t){return[2,new Promise((function(t,n){gn("ZBROWSER_MPDS",{mpds_action:"mpds.get.size",mpds_data:{},appId:oo(e,vo)},{success:function(e){var n=0;e&&e.mpds_data&&e.mpds_data.size&&(n=e.mpds_data.size),t({currentSize:kt.isNumber(n)?Number(Number(n)/1024):0,limitSize:Number(F/1024)})},fail:function(e){n(e)}},{isMultiCallback:!1})}))]}))}))()},r.getInfoSynchronize=function(){var e={mpds_action:"mpds.get.size",mpds_data:{},appId:oo(this,vo)},t=0,n=this.handleResult(e);return n&&n.mpds_data&&n.mpds_data.size&&(t=n.mpds_data.size),{currentSize:kt.isNumber(t)?Number(Number(t)/1024):0,limitSize:Number(F/1024)}},r.remove=function(e){var t=this;return ke((function(){return xe(this,(function(n){return[2,new Promise((function(n,r){gn("ZBROWSER_MPDS",{mpds_action:"mpds.remove.key",mpds_data:{keys:e},appId:oo(t,vo)},{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:oo(this,vo)},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 ke((function(){return xe(this,(function(t){return[2,new Promise((function(t,n){gn("ZBROWSER_MPDS",{mpds_action:"mpds.clear.appData",mpds_data:{},appId:oo(e,vo)},{success:function(){t()},fail:function(e){n(e)}},{isMultiCallback:!1})}))]}))}))()},r.clearSynchronize=function(){var e={mpds_action:"mpds.clear.appData",mpds_data:{},appId:oo(this,vo)};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=yn(n).toJSON()}}catch(e){t=e}finally{if(null!==t)throw t}return{}},n}(lo),_o=function(){function e(){Ct(this,e)}var t=e.prototype;return t.getDataFromStorage=function(e){var t=this;return ke((function(){var n,r;return xe(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]=Sn(e)})),[2,r]}}))}))()},t.getItem=function(e){return this.getInstance().getItem(e)},t.putDataToStorage=function(e){var t=this;return ke((function(){var n,r;return xe(this,(function(i){switch(i.label){case 0:return n=t.getInstance(),r={},Object.entries(e).forEach((function(e){var t=Ke(e,2),n=t[0],i=t[1];kt.isUndefined(i)||kt.isNull(i)||(r[n]=On(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 ke((function(){return xe(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 ke((function(){return xe(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 ke((function(){return xe(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}(),wo=new WeakMap,To=function(e){Lt(n,e);var t=Bt(n);function n(e){var r;return Ct(this,n),ao(jt(r=t.call(this)),wo,{writable:!0,value:void 0}),so(jt(r),wo,e),r}return n.prototype.getInstance=function(){return new mo(oo(this,wo))},n}(_o),bo=new WeakMap,Eo=function(e){Lt(n,e);var t=Bt(n);function n(e){var r;return Ct(this,n),ao(jt(r=t.call(this)),bo,{writable:!0,value:void 0}),so(jt(r),bo,e),r}return n.prototype.getInstance=function(){return new go(oo(this,bo))},n}(_o),Po=new To(o),So=sn(),Io=(null===(uo=ze())||void 0===uo?void 0:uo.platformName)||"unknown";So>0&&So>={android:12100571,iOS:400,wp:0,unknown:0}[Io]&&(null===(co=ze())||void 0===co?void 0:co.appEnv.isMp)&&(Po=new Eo(o));var Ao=Po,Oo=[Pi({data:Hi.record(li(),Hi.any())}).optional()];function ko(e){return Co.apply(this,arguments)}function Co(){return Co=ke((function(e){return xe(this,(function(t){return[2,Ln("setStorage",Oo,[e],function(){var e=ke((function(e){return xe(this,(function(t){switch(t.label){case 0:return We.isMp||We.isMpWeb?[4,Ao.putDataToStorage(e.data)]:[3,2];case 1:return[2,t.sent()];case 2:return[2,Promise.reject(Ge("setStorage",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Co.apply(this,arguments)}var No=[Pi({keys:Hi.array(li())}).optional()];function Mo(e){return Ro.apply(this,arguments)}function Ro(){return Ro=ke((function(e){return xe(this,(function(t){return[2,Ln("getStorage",No,[e],function(){var e=ke((function(e){return xe(this,(function(t){switch(t.label){case 0:return We.isMp||We.isMpWeb?[4,Ao.getDataFromStorage(e.keys)]:[3,2];case 1:return[2,t.sent()];case 2:return[2,Promise.reject(Ge("getStorage",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Ro.apply(this,arguments)}function xo(e){return Do.apply(this,arguments)}function Do(){return(Do=ke((function(e){return xe(this,(function(t){return[2,Ln("getStorageInfo",[],[e],ke((function(){return xe(this,(function(e){switch(e.label){case 0:return We.isMp||We.isMpWeb?[4,Ao.getStorageInfo()]:[3,2];case 1:return[2,e.sent()];case 2:return[2,Promise.reject(Ge("getStorageInfo",{}))]}}))})))]}))}))).apply(this,arguments)}var Uo=[Pi({keys:Hi.array(li())}).optional()];function Lo(e){return jo.apply(this,arguments)}function jo(){return jo=ke((function(e){return xe(this,(function(t){return[2,Ln("removeStorage",Uo,[e],function(){var e=ke((function(e){return xe(this,(function(t){switch(t.label){case 0:return We.isMp||We.isMpWeb?[4,Ao.removeDataFromStorage(e.keys)]:[3,2];case 1:return[2,t.sent()];case 2:return[2,Promise.reject(Ge("removeStorage",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),jo.apply(this,arguments)}var Bo=[Pi({prefix:li().optional()}).optional()];function Zo(e){return zo.apply(this,arguments)}function zo(){return(zo=ke((function(e){return xe(this,(function(t){return[2,Ln("clearStorage",Bo,[e],ke((function(){return xe(this,(function(e){switch(e.label){case 0:return We.isMp||We.isMpWeb?[4,Ao.clearStorage()]:[3,2];case 1:return[2,e.sent()];case 2:return[2,Promise.reject(Ge("clearStorage",{}))]}}))})))]}))}))).apply(this,arguments)}var Wo=function(){var e=ke((function(e,t){var n,r,i,a;return xe(this,(function(s){switch(s.label){case 0:return(r=t)?[3,2]:[4,Mn()];case 1:r=!s.sent(),s.label=2;case 2:return n=r,[4,Tn.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=ke((function(e){var t,n,r,i,o,a;return xe(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)||A,new dn(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)}}(),Fo=[Pi({avatarType:Hi.enum(["small","normal","large"]).optional(),autoRequestPermission:Hi.boolean().default(!1).optional()}).optional()];function Go(e){return Vo.apply(this,arguments)}function Vo(){return Vo=ke((function(e){return xe(this,(function(t){return[2,Ln("getUserInfo",Fo,[e],function(){var e=ke((function(e){var t,n,r;return xe(this,(function(i){switch(i.label){case 0:if(!We.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,Wo(t,n)];case 2:return[2,{userInfo:i.sent()}];case 3:return r=i.sent(),[2,Promise.reject(r)];case 4:return We.isMpWeb?[2,Promise.resolve({userInfo:{id:"3368637342326461234",name:"User Name",avatar:"https://h5.zdn.vn/static/images/avatar.png"}})]:[2,Promise.reject(Ge("getUserInfo",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Vo.apply(this,arguments)}var Ho=function(e){return{NONE:e?-2:0,WIFI:e?0:1,"2G":2,"3G":e?15:2,"4G":e?13:2}},Ko=ke((function(){return xe(this,(function(t){return[2,new Promise((function(t,n){gn("WEBVIEW_NETWORKTYPE",{url:window.location.href,featureId:""},{success:function(n){var r,i,o,a=n.network,s=(null===(r=ze())||void 0===r||null===(i=r.platform)||void 0===i?void 0:i.isAndroid)||!1;switch(a){case Ho(s).NONE:o=e.NetworkType.none;break;case Ho(s).WIFI:o=e.NetworkType.wifi;break;case Ho(s)["2G"]:case Ho(s)["3G"]:case Ho(s)["4G"]:o=e.NetworkType.cellular;break;default:o=e.NetworkType.unknown}t(o)},fail:function(e){n(e)}},{})}))]}))}));function Jo(e){return qo.apply(this,arguments)}function qo(){return(qo=ke((function(t){return xe(this,(function(n){return[2,Ln("getNetworkType",[],[t],ke((function(){var t,n;return xe(this,(function(r){switch(r.label){case 0:return We.isMp?[4,Ko()]:[3,2];case 1:return[2,{networkType:r.sent()}];case 2:if(We.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(Ge("getNetworkType",{}))]}}))})))]}))}))).apply(this,arguments)}var Qo=[Hi.function().args(Pi({isConnected:Hi.boolean(),networkType:Hi.enum(["none","wifi","cellular","unknown"])})).returns(Hi.void())];function Yo(t){return Ln("onNetworkStatusChange",Qo,[t],(function(t){var n=t;if(We.isMp)!function(t){Vt.getInstance().on(e.Events.NetworkChanged,(function(e){var n=null==e?void 0:e.state;Ko().then((function(e){t({isConnected:"CONNECTED"===n,networkType:e})}))}))}(n);else if(We.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 $o=function(){var e=ke((function(e){var t,n,r,i,o,a;return xe(this,(function(s){return a={subaction:0,scanning_type:kt.isNumber(null==e?void 0:e.scanningType)?e.scanningType:0,data:{scan_from_source:kt.isString(null==e?void 0:e.scanFromSource)?e.scanFromSource:"",expire:kt.isNumber(null==e?void 0:e.expire)?e.expire:3e3,monitor_interval:kt.isNumber(null==e?void 0:e.monitorInterval)?e.monitorInterval:60,domain:kt.isString(null==e?void 0:e.domain)?e.domain:"",scan_config:{scan_time:kt.isNumber(null==e||null===(t=e.scanConfig)||void 0===t?void 0:t.scanTime)?e.scanConfig.scanTime:15e3,time_between_scan:kt.isNumber(null==e||null===(n=e.scanConfig)||void 0===n?void 0:n.timeBetweenScan)?e.scanConfig.timeBetweenScan:1e4,beacon_timeout:kt.isNumber(null==e||null===(r=e.scanConfig)||void 0===r?void 0:r.beaconTimeout)?e.scanConfig.beaconTimeout:3e4,delayCheckConnectedTimeout:kt.isNumber(null==e||null===(i=e.scanConfig)||void 0===i?void 0:i.delayCheckConnectedTimeout)?e.scanConfig.delayCheckConnectedTimeout:5e3,beaconConnectedTimeout:kt.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){gn("SCAN_IBEACON",He({},a),{success:function(){e(!0)},fail:function(e){t(e)}},{})}))]}))}));return function(t){return e.apply(this,arguments)}}(),Xo=[Pi({scanningType:Hi.number().refine((function(e){return[0,1].includes(e)}),{message:"The type must be either 0 or 1"}).default(0).optional(),expire:Hi.number().optional(),monitorInterval:Hi.number().optional(),domain:Hi.string().optional(),scanConfig:Pi({scanTime:Hi.number().optional(),timeBetweenScan:Hi.number().optional(),beaconTimeout:Hi.number().optional(),delayCheckConnectedTimeout:Hi.number().optional(),beaconConnectedTimeout:Hi.number().optional()}).optional(),items:Hi.array(Pi({id:Hi.string().optional(),distance:Hi.number().optional(),monitor:Pi({enable:Hi.boolean().optional(),movingRange:Hi.number().optional()}).optional()})).optional(),scanFromSource:Hi.string().optional()}).optional()];function ea(e){return ta.apply(this,arguments)}function ta(){return(ta=ke((function(e){return xe(this,(function(t){return[2,Ln("startBeaconDiscovery",Xo,[e],ke((function(){return xe(this,(function(t){switch(t.label){case 0:return We.isMp?[4,$o(e)]:[3,2];case 1:return[2,t.sent()];case 2:return We.isMpWeb?[2,Promise.resolve(!0)]:[2,Promise.reject(Ge("startBeaconDiscovery",{}))]}}))})))]}))}))).apply(this,arguments)}var na=ke((function(){return xe(this,(function(e){return[2,new Promise((function(e,t){gn("SCAN_IBEACON",{subaction:2},{success:function(){e(!0)},fail:function(e){t(e)}},{})}))]}))}));function ra(e){return ia.apply(this,arguments)}function ia(){return(ia=ke((function(e){return xe(this,(function(t){return[2,Ln("stopBeaconDiscovery",[],[e],ke((function(){return xe(this,(function(e){switch(e.label){case 0:return We.isMp?[4,na()]:[3,2];case 1:return[2,e.sent()];case 2:return We.isMpWeb?[2,Promise.resolve(!0)]:[2,Promise.reject(Ge("stopBeaconDiscovery",{}))]}}))})))]}))}))).apply(this,arguments)}var oa=ke((function(){return xe(this,(function(e){return[2,new Promise((function(e,t){gn("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 aa(e){return sa.apply(this,arguments)}function sa(){return(sa=ke((function(e){return xe(this,(function(t){return[2,Ln("getBeacons",[],[e],ke((function(){return xe(this,(function(e){switch(e.label){case 0:return We.isMp?[4,oa()]:[3,2];case 1:return[2,e.sent()];case 2:return We.isMpWeb?[2,Promise.resolve({beacons:[]})]:[2,Promise.reject(Ge("getBeacons",{}))]}}))})))]}))}))).apply(this,arguments)}var ua=ke((function(){return xe(this,(function(e){return[2,new Promise((function(e,t){gn("WINDOW_CLOSE",{},{success:function(t){e(t)},fail:function(e){t(e)}},{})}))]}))}));function ca(e){return la.apply(this,arguments)}function la(){return(la=ke((function(e){return xe(this,(function(t){return[2,Ln("closeApp",[],[e],ke((function(){return xe(this,(function(e){switch(e.label){case 0:return We.isMp?[4,ua()]:[3,2];case 1:return[2,e.sent()];case 2:return We.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Ge("closeApp",{}))]}}))})))]}))}))).apply(this,arguments)}var da=ke((function(){return xe(this,(function(e){return[2,new Promise((function(e,t){gn("OPEN_QR",{skipOpenLink:!0},{success:function(t){e(t)},fail:function(e){t(e)}},{})}))]}))}));function pa(e){return fa.apply(this,arguments)}function fa(){return(fa=ke((function(e){return xe(this,(function(t){return[2,Ln("scanQRCode",[],[e],ke((function(){return xe(this,(function(e){switch(e.label){case 0:return We.isMp?[4,da()]:[3,2];case 1:return[2,e.sent()];case 2:return We.isMpWeb?[2,Promise.resolve({content:""})]:[2,Promise.reject(Ge("scanQRCode",{}))]}}))})))]}))}))).apply(this,arguments)}var ha=function(){var t=ke((function(t,n,r,o){return xe(this,(function(a){return[2,new Promise((function(a,s){gn("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)}}(),ma=[Pi({id:li(),type:Hi.enum(["user","oa","aliasOA"]),sourceId:Hi.any().optional(),sourceIndex:Hi.any().optional()}).optional()];function va(e){return ya.apply(this,arguments)}function ya(){return ya=ke((function(e){return xe(this,(function(t){return[2,Ln("openProfile",ma,[e],function(){var e=ke((function(e){var t,n,r,i;return xe(this,(function(o){switch(o.label){case 0:return We.isMp?(t=e.id,n=e.type,r=e.sourceId,i=e.sourceIndex,[4,ha(t,n,r,i)]):[3,2];case 1:return[2,o.sent()];case 2:return We.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Ge("openProfile",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),ya.apply(this,arguments)}var ga=function(){var t=ke((function(t,n){var r,o,a,s=arguments;return xe(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){gn("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)}}(),_a=[Pi({id:li(),type:Hi.enum(["user","oa"]),sourceId:Hi.any().optional(),sourceIndex:Hi.any().optional(),message:li().optional()}).optional()];function wa(e){return Ta.apply(this,arguments)}function Ta(){return Ta=ke((function(e){return xe(this,(function(t){return[2,Ln("openChat",_a,[e],function(){var e=ke((function(e){var t,n,r,i,o;return xe(this,(function(a){switch(a.label){case 0:return We.isMp?(t=e.id,n=e.type,r=e.message,i=e.sourceId,o=e.sourceIndex,[4,ga(t,n,r,i,o)]):[3,2];case 1:return[2,a.sent()];case 2:return We.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Ge("openChat",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Ta.apply(this,arguments)}function ba(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 Ea=function(){var t=ke((function(t,n){var r,o;return xe(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){gn("OPEN_POSTFEED",ba(He({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)}}(),Pa=[Hi.union([Pi({type:Hi.enum(["image"]),data:Pi({imageUrl:li().url().optional(),imageUrls:Hi.array(li().url()).optional()})}),Pi({type:Hi.enum(["link"]),data:Pi({link:li().url(),title:li().max(100).optional(),thumb:li().url().optional(),description:li().max(400).default("").optional()})}),Pi({type:Hi.enum(["profile"]),data:Pi({id:li().optional()})})])];function Sa(e){return Ia.apply(this,arguments)}function Ia(){return Ia=ke((function(e){return xe(this,(function(t){return[2,Ln("openPostFeed",Pa,[e],function(){var e=ke((function(e){var t,n;return xe(this,(function(r){switch(r.label){case 0:return We.isMp?(t=e.type,n=e.data,[4,Ea(t,n)]):[3,2];case 1:return[2,r.sent()];case 2:return We.isMpWeb?[2,Promise.resolve({status:1,shareType:0,numberOfUser:0})]:[2,Promise.reject(Ge("openPostFeed",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Ia.apply(this,arguments)}var Aa=function(){var e=ke((function(e){return xe(this,(function(t){return[2,new Promise((function(t,n){gn("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)}}(),Oa=[Pi({id:li(),showDialogConfirm:Hi.boolean().optional()}).optional()];function ka(e){return Ca.apply(this,arguments)}function Ca(){return Ca=ke((function(e){return xe(this,(function(t){return[2,Ln("followOA",Oa,[e],function(){var e=ke((function(e){var t;return xe(this,(function(n){switch(n.label){case 0:return We.isMp?(t=e.id,[4,Aa(t)]):[3,2];case 1:return[2,n.sent()];case 2:return We.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Ge("followOA",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Ca.apply(this,arguments)}var Na=function(){var e=ke((function(e){return xe(this,(function(t){return[2,new Promise((function(t,n){gn("UNFOLLOW_OA",{uid:e,forceUpdate:!0,zapp:i},{success:function(){t()},fail:function(e){n(e)}},{})}))]}))}));return function(t){return e.apply(this,arguments)}}(),Ma=[Pi({id:li()}).optional()];function Ra(e){return xa.apply(this,arguments)}function xa(){return xa=ke((function(e){return xe(this,(function(t){return[2,Ln("unfollowOA",Ma,[e],function(){var e=ke((function(e){var t;return xe(this,(function(n){switch(n.label){case 0:return We.isMp?(t=e.id,[4,Na(t)]):[3,2];case 1:return[2,n.sent()];case 2:return We.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Ge("unfollowOA",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),xa.apply(this,arguments)}var Da=function(){var e=ke((function(e,t,n,r,i,o){var s,u,l,p,f,h,m,v;return xe(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,He({method:"POST",body:p},m))];case 1:return[4,y.sent().json()];case 2:if(!(v=y.sent())||0!==v.err)throw vn.error.cannotGetShareInfo();return h.search="".concat(h.search,"&zshareId=").concat(v.data.shareId),[2,ba(He({},v.data),{shareableLink:h.href})]}}))}));return function(t,n,r,i,o,a){return e.apply(this,arguments)}}(),Ua=function(){var t=ke((function(t,n){var r,a,s,u,c,l,d,p,f,h,m;return xe(this,(function(v){switch(v.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 c=[],l=sn(),d=(null===(u=ze())||void 0===u?void 0:u.platformName)||"unknown",Number(l)>=W[d]&&(a="multi_image"),Array.isArray(null==n?void 0:n.imageUrls)&&(null==n?void 0:n.imageUrls.length)>0?c=null==n?void 0:n.imageUrls:c.push(null==n?void 0:n.imageUrl),r={photoUrls:c,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,Tn.getAccessToken()];case 8:case 11:return s=v.sent(),[4,Da(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 p=v.sent(),r={data:{ZInstantAPIInfo:{url:"".concat(p.zinstantApi),zinstantdata_id:"templateId=".concat(p.ztemplateId,"&appId=").concat(o,"&shareId=").concat(p.shareId)},previewMsgText:{msg:{en:"Zalo Mini Program",vi:"Chương trình nhỏ"}},enableReactions:1}},[3,14];case 12:return f=v.sent().shareableLink,h=new URL(f),m=h.searchParams.getAll("zshareId"),h.searchParams.delete("zshareId"),m.length>0&&h.searchParams.append("zshareId",m[0]),r={link:h.href,chatOnly:0},[3,14];case 13:return[3,14];case 14:return[2,new Promise((function(t,n){gn("OPEN_SHARESHEET",ba(He({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)}}(),La=[Hi.union([Pi({type:Hi.enum(["text"]),data:Pi({text:li(),description:li().default("").optional(),autoParseLink:Hi.boolean().default(!1).optional()})}),Pi({type:Hi.enum(["image"]),data:Pi({imageUrl:li().url().optional(),imageUrls:Hi.array(li().url()).max(10).optional()})}),Pi({type:Hi.enum(["link"]),data:Pi({link:li().url(),chatOnly:Hi.boolean().optional()})}),Pi({type:Hi.enum(["oa"]),data:Pi({id:li()})}),Pi({type:Hi.enum(["gif"]),data:Pi({gifUrl:li().url(),imageUrl:li().url().optional(),width:di().min(0).optional(),height:di().min(0).optional()})}),Pi({type:Hi.enum(["video"]),data:Pi({videoThumb:li().url(),videoUrl:li().url(),width:di().min(0).optional(),height:di().min(0).optional()})}),Pi({type:Hi.enum(["zmp","zmp_deep_link"]),data:Pi({title:li().max(100),thumbnail:li().url(),path:li().optional(),description:li().max(400).default("").optional()})})])];function ja(e){return Ba.apply(this,arguments)}function Ba(){return Ba=ke((function(e){return xe(this,(function(t){return[2,Ln("openShareSheet",La,[e],function(){var e=ke((function(e){var t,n;return xe(this,(function(r){switch(r.label){case 0:return We.isMp?(t=e.type,n=e.data,[4,Ua(t,n)]):[3,2];case 1:return[2,r.sent()];case 2:return We.isMpWeb?[2,Promise.resolve({status:2,shareType:0,numberOfUser:0})]:[2,Promise.reject(Ge("openShareSheet",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Ba.apply(this,arguments)}var Za=ke((function(){return xe(this,(function(e){return[2,new Promise((function(e,t){gn("REQUEST_PERMISSION_CAMERA",{},{success:function(t){var n,r;(null===(n=ze())||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=ze())||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 za(e){return Wa.apply(this,arguments)}function Wa(){return(Wa=ke((function(e){return xe(this,(function(t){return[2,Ln("requestCameraPermission",[],[e],ke((function(){return xe(this,(function(e){switch(e.label){case 0:return[4,Za()];case 1:return[2,e.sent()]}}))})))]}))}))).apply(this,arguments)}var Fa=function(){var e=ke((function(e,t,n){return xe(this,(function(r){return[2,new Promise((function(r,i){gn("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)}}(),Ga=ke((function(){var e,t,n,r=arguments;return xe(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=Vn(),[4,nn(e,t,n.version)];case 1:return[2,i.sent()]}}))})),Va=function(){var e=ke((function(e){return xe(this,(function(t){return[2,new Promise((function(t,n){gn("OPEN_OUTAPP",{url:e},{success:function(){t()},fail:function(e){n(e)}},{})}))]}))}));return function(t){return e.apply(this,arguments)}}(),Ha=[Pi({params:Hi.record(li(),li()).optional()}).optional()];function Ka(e){return Ja.apply(this,arguments)}function Ja(){return Ja=ke((function(e){return xe(this,(function(t){return[2,Ln("createShortcut",Ha,[e],function(){var e=ke((function(e){var t,n,r,i,s,u,c,l;return xe(this,(function(d){switch(d.label){case 0:return We.isMp?[4,Ga(o,0)]:[3,6];case 1:return r=d.sent(),i=null===(t=ze())||void 0===t||null===(n=t.platform)||void 0===n?void 0:n.isIOS,s=r.logoUrl||An("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,Va(encodeURI(l))]):[3,3];case 2:return d.sent(),[3,5];case 3:return[4,Fa("".concat(a,"/").concat(o,"/?").concat(c.toString()),u,s)];case 4:d.sent(),d.label=5;case 5:return[2,vn.success()];case 6:return We.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Ge("createShortcut",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Ja.apply(this,arguments)}var qa=function(){var e=ke((function(e,t,n){return xe(this,(function(r){return[2,new Promise((function(r,o){gn("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)}}(),Qa=[Pi({secretData:li(),ui:Pi({title:li().default("Xác thực").optional(),subTitle:li().default("Sử dụng sinh trắc học của bạn để xác thực").optional(),negativeButtonText:li().default("Đóng").optional()}).optional(),requireFingerprint:hi().default(!0).optional()}).optional()];function Ya(e){return $a.apply(this,arguments)}function $a(){return $a=ke((function(e){return xe(this,(function(t){return[2,Ln("openBioAuthentication",Qa,[e],function(){var e=ke((function(e){var t,n,r;return xe(this,(function(i){switch(i.label){case 0:return We.isMp?(t=e.secretData,n=e.ui,r=e.requireFingerprint,[4,qa(t,n,r)]):[3,2];case 1:return[2,i.sent()];case 2:return We.isMpWeb?[2,Promise.resolve({code:0,message:"OK",data:{domain:"",code:0,message:"",payToken:""}})]:[2,Promise.reject(Ge("openBioAuthentication",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),$a.apply(this,arguments)}var Xa=ke((function(){return xe(this,(function(e){return[2,new Promise((function(e,t){gn("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 es(e){return ts.apply(this,arguments)}function ts(){return(ts=ke((function(e){return xe(this,(function(t){return[2,Ln("checkStateBioAuthentication",[],[e],ke((function(){return xe(this,(function(e){switch(e.label){case 0:return We.isMp?[4,Xa()]:[3,2];case 1:return[2,{bioState:e.sent()}];case 2:return We.isMpWeb?[2,Promise.resolve({bioState:""})]:[2,Promise.reject(Ge("checkStateBioAuthentication",{}))]}}))})))]}))}))).apply(this,arguments)}var ns=function(){var e=ke((function(e){return xe(this,(function(t){return[2,new Promise((function(t,n){gn("SHOW_TOAST",{toast:e},{success:function(){t()},fail:function(e){n(e)}},{})}))]}))}));return function(t){return e.apply(this,arguments)}}(),rs=[Pi({message:li()}).optional()];function is(e){return os.apply(this,arguments)}function os(){return os=ke((function(e){return xe(this,(function(t){return[2,Ln("showToast",rs,[e],function(){var e=ke((function(e){return xe(this,(function(t){switch(t.label){case 0:return We.isMp?[4,ns(e.message)]:[3,2];case 1:return[2,t.sent()];case 2:return We.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Ge("showToast",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),os.apply(this,arguments)}var as=ke((function(){return xe(this,(function(e){return[2,new Promise((function(e,t){gn("HIDE_KEYBOARD",{},{success:function(){e()},fail:function(e){t(e)}},{})}))]}))}));function ss(e){return us.apply(this,arguments)}function us(){return(us=ke((function(e){return xe(this,(function(t){return[2,Ln("hideKeyboard",[],[e],ke((function(){return xe(this,(function(e){switch(e.label){case 0:return We.isMp?[4,as()]:[3,2];case 1:return[2,e.sent()];case 2:return We.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Ge("hideKeyboard",{}))]}}))})))]}))}))).apply(this,arguments)}var cs=function(){var e=ke((function(e){return xe(this,(function(t){return[2,new Promise((function(t,n){gn("OPEN_PHONE",{phoneNum:e,phoneCode:e},{success:function(){t()},fail:function(e){n(e)}},{})}))]}))}));return function(t){return e.apply(this,arguments)}}(),ls=[Pi({phoneNumber:li()})];function ds(e){return ps.apply(this,arguments)}function ps(){return ps=ke((function(e){return xe(this,(function(t){return[2,Ln("openPhone",ls,[e],function(){var e=ke((function(e){return xe(this,(function(t){switch(t.label){case 0:return We.isMp?[4,cs(e.phoneNumber)]:[3,2];case 1:return[2,t.sent()];case 2:return We.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Ge("openPhone",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),ps.apply(this,arguments)}var fs=function(){var e=ke((function(e,t){return xe(this,(function(n){return[2,new Promise((function(n,r){gn("OPEN_SMS",{content:t,phoneCode:e},{success:function(){n()},fail:function(e){r(e)}},{})}))]}))}));return function(t,n){return e.apply(this,arguments)}}(),hs=[Pi({content:li(),phoneNumber:li()})];function ms(e){return vs.apply(this,arguments)}function vs(){return vs=ke((function(e){return xe(this,(function(t){return[2,Ln("openSMS",hs,[e],function(){var e=ke((function(e){return xe(this,(function(t){switch(t.label){case 0:return We.isMp?[4,fs(e.phoneNumber,e.content)]:[3,2];case 1:return[2,t.sent()];case 2:return We.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Ge("openSMS",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),vs.apply(this,arguments)}var ys=function(){var e=ke((function(e){var t,n=arguments;return xe(this,(function(r){return t=n.length>1&&void 0!==n[1]?n[1]:"",[2,new Promise((function(n,r){gn("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)}}(),gs=[Pi({id:li(),displayName:li().default("").optional()})];function _s(e){return ws.apply(this,arguments)}function ws(){return ws=ke((function(e){return xe(this,(function(t){return[2,Ln("viewOAQr",gs,[e],function(){var e=ke((function(e){return xe(this,(function(t){switch(t.label){case 0:return We.isMp?[4,ys(e.id,e.displayName)]:[3,2];case 1:return[2,t.sent()];case 2:return We.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Ge("viewOAQr",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),ws.apply(this,arguments)}var Ts=function(){var e=ke((function(e){return xe(this,(function(t){return[2,new Promise((function(t,n){gn("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)}}(),bs=[Pi({keepScreenOn:hi()})];function Es(e){return Ps.apply(this,arguments)}function Ps(){return Ps=ke((function(e){return xe(this,(function(t){return[2,Ln("keepScreen",bs,[e],function(){var e=ke((function(e){return xe(this,(function(t){switch(t.label){case 0:return We.isMp?[4,Ts(e.keepScreenOn)]:[3,2];case 1:return[2,t.sent()];case 2:return We.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Ge("keepScreen",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Ps.apply(this,arguments)}function Ss(e){return Is.apply(this,arguments)}function Is(){return(Is=ke((function(e){return xe(this,(function(t){return[2,Ln("onKeepScreen",[],[e],ke((function(){return xe(this,(function(e){switch(e.label){case 0:return We.isMp?[4,Ts(!0)]:[3,2];case 1:return[2,e.sent()];case 2:return We.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Ge("onKeepScreen",{}))]}}))})))]}))}))).apply(this,arguments)}function As(e){return Os.apply(this,arguments)}function Os(){return(Os=ke((function(e){return xe(this,(function(t){return[2,Ln("offKeepScreen",[],[e],ke((function(){return xe(this,(function(e){switch(e.label){case 0:return We.isMp?[4,Ts(!1)]:[3,2];case 1:return[2,e.sent()];case 2:return We.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Ge("offKeepScreen",{}))]}}))})))]}))}))).apply(this,arguments)}var ks=function(){var e=ke((function(e,t,n){var r;return xe(this,(function(i){return r={},e?r={imageBase64Data:e}:t&&(r={imageUrl:t}),[2,new Promise((function(e,t){gn("SAVE_IMAGE_GALLERY",ba(He({},r),{onProgress:n}),{success:function(){e()},fail:function(e){t(e)}},{})}))]}))}));return function(t,n,r){return e.apply(this,arguments)}}(),Cs=[Pi({imageBase64Data:li().optional(),imageUrl:li().url().optional()}).optional()];function Ns(e){return Ms.apply(this,arguments)}function Ms(){return Ms=ke((function(e){return xe(this,(function(t){return[2,Ln("saveImageToGallery",Cs,[e],function(){var e=ke((function(e){return xe(this,(function(t){switch(t.label){case 0:return We.isMp?[4,ks(e.imageBase64Data,e.imageUrl,e.onProgress)]:[3,2];case 1:return[2,t.sent()];case 2:return We.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Ge("saveImageToGallery",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Ms.apply(this,arguments)}var Rs=function(){var e=ke((function(e,t){var n;return xe(this,(function(r){return{},n={videoUrl:e,onProgress:t},[2,new Promise((function(e,t){gn("SAVE_VIDEO_GALLERY",He({},n),{success:function(){e()},fail:function(e){t(e)}},{})}))]}))}));return function(t,n){return e.apply(this,arguments)}}(),xs=[Pi({videoUrl:li().url()}).optional()];function Ds(e){return Us.apply(this,arguments)}function Us(){return Us=ke((function(e){return xe(this,(function(t){return[2,Ln("saveVideoToGallery",xs,[e],function(){var e=ke((function(e){return xe(this,(function(t){switch(t.label){case 0:return We.isMp?[4,Rs(e.videoUrl,e.onProgress)]:[3,2];case 1:return[2,t.sent()];case 2:return We.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Ge("saveVideoToGallery",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Us.apply(this,arguments)}var Ls=function(){var e=ke((function(e){var t,n,r,i,o,a,u=arguments;return xe(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,Ga(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=Ke(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){gn("OPEN_MP",{mpUrl:o,mpInfo:i},{success:function(){e()},fail:function(e){t(e)}},{})}))]}}))}));return function(t){return e.apply(this,arguments)}}(),js=[Pi({appId:li(),path:li().optional(),params:Hi.record(li(),li()).optional()})];function Bs(e){return Zs.apply(this,arguments)}function Zs(){return Zs=ke((function(e){return xe(this,(function(t){return[2,Ln("openMiniApp",js,[e],function(){var e=ke((function(e){return xe(this,(function(t){switch(t.label){case 0:return We.isMp?[4,Ls(e.appId,e.path,e.params)]:[3,2];case 1:return[2,t.sent()];case 2:return We.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Ge("openMiniApp",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Zs.apply(this,arguments)}var zs=ke((function(){var t,n,r=arguments;return xe(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){gn("INTERACTIVE_VIBRATION",{type:e.VibrateType[t],vibrate_time:n},{success:function(){r()},fail:function(e){i(e)}},{})}))]}))})),Ws=[Pi({type:Hi.enum(["oneShot"]).default("oneShot").optional(),milliseconds:di().optional()})];function Fs(e){return Gs.apply(this,arguments)}function Gs(){return Gs=ke((function(e){return xe(this,(function(t){return[2,Ln("vibrate",Ws,[e],function(){var e=ke((function(e){return xe(this,(function(t){switch(t.label){case 0:return We.isMp?[4,zs(null==e?void 0:e.type,null==e?void 0:e.milliseconds)]:[3,2];case 1:return[2,t.sent()];case 2:return We.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Ge("vibrate",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Gs.apply(this,arguments)}var Vs=function(){var e=ke((function(e,t){var n,r,i,o;return xe(this,(function(a){return n=new URL(e),r=n.href.includes("vnpay"),i=n.searchParams.get("typeInapp"),o=kt.isEmpty(t)?void 0:{modal_style:(null==t?void 0:t.style)?on(null==t?void 0:t.style):"bottom_sheet",left_button:(null==t?void 0:t.leftButton)?on(null==t?void 0:t.leftButton):"back"},!r&&kt.isEmpty(i)&&n.searchParams.set("typeInapp","1"),[2,new Promise((function(e,t){gn("OPEN_INAPP",{url:n.href,style:o},{success:function(){e()},fail:function(e){t(e)}},{})}))]}))}));return function(t,n){return e.apply(this,arguments)}}(),Hs=[Pi({url:li(),config:Pi({style:Hi.enum(["bottomSheet","normal"]).default("bottomSheet").optional(),leftButton:Hi.enum(["back","none"]).default("back").optional()}).optional()})];function Ks(e){return Js.apply(this,arguments)}function Js(){return Js=ke((function(e){return xe(this,(function(t){return[2,Ln("openWebview",Hs,[e],function(){var e=ke((function(e){return xe(this,(function(t){switch(t.label){case 0:return We.isMp?[4,Vs(e.url,e.config)]:[3,2];case 1:return[2,t.sent()];case 2:return We.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Ge("openWebview",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Js.apply(this,arguments)}function qs(){var e={},t=window.location.href;try{var n=new URL(t).searchParams.toString();n&&(e=Jt.getParamsAsObject(n))}catch(e){throw new Error("Invalid URL")}return e}function Qs(){return Ln("getRouteParams",[],[],(function(){return qs()}))}function Ys(e){return $s.apply(this,arguments)}function $s(){return($s=ke((function(e){return xe(this,(function(t){return[2,Ln("getAppInfo",[],[e],ke((function(){return xe(this,(function(e){switch(e.label){case 0:return We.isMp?[4,Ga()]:[3,2];case 1:return[2,e.sent()];case 2:return We.isMpWeb?[2,Promise.resolve({description:"",name:"",version:"",appUrl:"",qrCodeUrl:""})]:[2,Promise.reject(Ge("getAppInfo",{}))]}}))})))]}))}))).apply(this,arguments)}var Xs=function(){var e=ke((function(e){return xe(this,(function(t){return[2,new Promise((function(t,n){gn("WEBVIEW_SET_RESULT",{result:On(e)},{success:function(){t()},fail:function(e){n(e)}},{})}))]}))}));return function(t){return e.apply(this,arguments)}}(),eu=[Pi({data:Hi.any()})];function tu(e){return nu.apply(this,arguments)}function nu(){return nu=ke((function(e){return xe(this,(function(t){return[2,Ln("sendDataToPreviousMiniApp",eu,[e],function(){var e=ke((function(e){return xe(this,(function(t){switch(t.label){case 0:return We.isMp?[4,Xs(e.data)]:[3,2];case 1:return[2,t.sent()];case 2:return We.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Ge("sendDataToPreviousMiniApp",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),nu.apply(this,arguments)}var ru=ke((function(){return xe(this,(function(e){return[2,new Promise((function(e,t){var n,r;gn("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(vn.error.clientNotSupport())},fail:function(e){t(e)}},{delay:(null===(n=ze())||void 0===n||null===(r=n.platform)||void 0===r?void 0:r.isIOS)?400:0})}))]}))}));function iu(e){return ou.apply(this,arguments)}function ou(){return(ou=ke((function(e){return xe(this,(function(t){return[2,Ln("getPhoneNumber",[],[e],ke((function(){return xe(this,(function(e){switch(e.label){case 0:return We.isMp?[4,ru()]:[3,2];case 1:return[2,e.sent()];case 2:return We.isMpWeb?[2,Promise.resolve({number:""})]:[2,Promise.reject(Ge("getPhoneNumber",{}))]}}))})))]}))}))).apply(this,arguments)}var au=ke((function(){var t,n,r,a=arguments;return xe(this,(function(s){return t=a.length>0&&void 0!==a[0]?a[0]:1,n=a.length>1?a[1]:void 0,r=a.length>2?a[2]:void 0,[2,new Promise((function(a,s){gn("MP_OPEN_PROFILE_PICKER",He({},n===e.OpenProfilePickerType.TOOL_DEL_FRIEND?{maxProfile:t,src:n,uids:r,zapp:i,appId:o}:{maxProfile:t}),{success:function(e){Array.isArray(e)?a(e.map((function(e){return e.id}))):a([])},fail:function(e){s(e)}},{isMultiCallback:!0})}))]}))})),su=[Pi({maxProfile:di().optional().default(1),src:Hi.enum([e.OpenProfilePickerType.TOOL_DEL_FRIEND]).optional(),uids:Ei(li()).optional()}).superRefine((function(t,n){var r=t.src,i=t.maxProfile;r===e.OpenProfilePickerType.TOOL_DEL_FRIEND?i<1&&n.addIssue({code:"custom",path:["maxProfile"],message:"maxProfile must be at least 1 when src is 'tool_del_friend'"}):(i<1||i>10)&&n.addIssue({code:"custom",path:["maxProfile"],message:"maxProfile must be between 1 and 10"})}))];function uu(e){return cu.apply(this,arguments)}function cu(){return cu=ke((function(e){return xe(this,(function(t){return[2,Ln("openProfilePicker",su,[e],function(){var e=ke((function(e){var t,n,r,i,o,a,s,u,c,l,p,f;return xe(this,(function(h){switch(h.label){case 0:return We.isMp?[4,au(null==e?void 0:e.maxProfile,null==e?void 0:e.src,null==e?void 0:e.uids)]:[3,12];case 1:return t=h.sent(),n=function(e,t){return Array.from({length:Math.ceil(e.length/t)},(function(n,r){return e.slice(r*t,r*t+t)}))},t.length>0?[4,Tn.getAccessToken()]:[3,11];case 2:r=h.sent(),i=n(t,20),o=[],a=!0,s=!1,u=void 0,h.label=3;case 3:h.trys.push([3,8,9,10]),c=function(){var e,t,n,i,a,s,u;return xe(this,(function(c){switch(c.label){case 0:e=p.value,c.label=1;case 1:return c.trys.push([1,4,,5]),[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:e})})];case 2:return[4,c.sent().json()];case 3:if(0!==(t=c.sent()).error||!t.data)throw new Error(t.message);return i=e.map((function(e){var n,r,i,o,a,s,u,c,l,d,p;return{id:(null===(n=t.data[e])||void 0===n||null===(r=n.user_info)||void 0===r?void 0:r.user_id_by_app)||"",profile:{name:null===(i=t.data[e])||void 0===i||null===(o=i.user_info)||void 0===o?void 0:o.name,avatar:null===(a=t.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=t.data[e])||void 0===l?void 0:l.error)?-1:0,message:"Get profile: ".concat(kt.isUndefined(null===(d=t.data[e])||void 0===d?void 0:d.message)?"Unknown error":null===(p=t.data[e])||void 0===p?void 0:p.message)}})),(n=o).push.apply(n,Re(i)),[3,5];case 4:return a=c.sent(),u=e.map((function(e){return{id:e,profile:{name:"",avatar:""},code:-1,message:"Can't get profile: ".concat(a.message)}})),(s=o).push.apply(s,Re(u)),[3,5];case 5:return[2]}}))},l=i[Symbol.iterator](),h.label=4;case 4:return(a=(p=l.next()).done)?[3,7]:[5,De(c())];case 5:h.sent(),h.label=6;case 6:return a=!0,[3,4];case 7:return[3,10];case 8:return f=h.sent(),s=!0,u=f,[3,10];case 9:try{a||null==l.return||l.return()}finally{if(s)throw u}return[7];case 10:return[2,{users:o}];case 11:return[2,{users:[]}];case 12:return We.isMpWeb?[2,Promise.resolve({users:[]})]:[2,Promise.reject(Ge("openProfilePicker",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),cu.apply(this,arguments)}var lu=function(){var e=ke((function(e,t,n){var r;return xe(this,(function(i){return r=t&&kt.isString(t)&&t.length>0?"wpa_wpa2":"open",[2,new Promise((function(i,o){gn("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)}}(),du=[Pi({SSID:li(),password:li().optional(),hiddenSSID:hi().optional()})];function pu(e){return fu.apply(this,arguments)}function fu(){return fu=ke((function(e){return xe(this,(function(t){return[2,Ln("connectWifi",du,[e],function(){var e=ke((function(e){return xe(this,(function(t){switch(t.label){case 0:return We.isMp?[4,lu(e.SSID,e.password,e.hiddenSSID)]:[3,2];case 1:return[2,t.sent()];case 2:return We.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Ge("connectWifi",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),fu.apply(this,arguments)}var hu=function(){var t=ke((function(t,n,r,i,o,a){var s,u;return xe(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){gn("PICK_MEDIA",{media_type:e.MediaPickerType[t],edit_view:He({},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)}}(),mu=[Pi({type:Hi.enum(["video","photo","file","zcamera","zcamera_photo","zcamera_video","zcamera_scan"]),serverUploadUrl:li().url(),maxItemSize:di().min(0).optional(),editView:Pi({enable:hi().optional(),aspectRatio:li().regex(/^d+:d+$/).optional()}).optional(),silentRequest:hi().optional(),maxSelectItem:di().min(1).optional()})];function vu(e){return yu.apply(this,arguments)}function yu(){return yu=ke((function(e){return xe(this,(function(t){return[2,Ln("openMediaPicker",mu,[e],function(){var e=ke((function(e){var t,n,r,i,o,a;return xe(this,(function(s){switch(s.label){case 0:return We.isMp?(i={},kt.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,hu(e.type,e.serverUploadUrl,e.maxItemSize,i,o,a)]):[3,2];case 1:return[2,{data:s.sent()}];case 2:return We.isMpWeb?[2,Promise.resolve({data:""})]:[2,Promise.reject(Ge("openMediaPicker",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),yu.apply(this,arguments)}var gu=[Pi({title:li().max(100),description:li().max(400).default(""),thumbnail:li().url().optional(),path:li().optional()})];function _u(e){return wu.apply(this,arguments)}function wu(){return wu=ke((function(e){return xe(this,(function(t){return[2,Ln("getShareableLink",gu,[e],function(){var e=ke((function(e){var t;return xe(this,(function(n){switch(n.label){case 0:return[4,Tn.getAccessToken()];case 1:return t=n.sent(),[4,Da(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)}}())]}))})),wu.apply(this,arguments)}var Tu=function(){var e=ke((function(e){return xe(this,(function(t){return[2,new Promise((function(t,n){gn("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 bu(e){return Eu.apply(this,arguments)}function Eu(){return(Eu=ke((function(e){return xe(this,(function(t){return[2,Ln("closeLoading",[],[e],ke((function(){return xe(this,(function(e){switch(e.label){case 0:return We.isMp?[4,Tu("user action")]:[3,2];case 1:return[2,e.sent()];case 2:return We.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Ge("closeLoading",{}))]}}))})))]}))}))).apply(this,arguments)}function Pu(e){return Su.apply(this,arguments)}function Su(){return Su=ke((function(e){return xe(this,(function(t){return[2,Ln("requestUpdateZalo",[],[e],ke((function(){var e,t,n;return xe(this,(function(r){switch(r.label){case 0:return We.isMp?(n=(null===(e=ze())||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,Va(n)]):[3,2];case 1:return[2,r.sent()];case 2:return We.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Ge("requestUpdateZalo",{}))]}}))})))]}))})),Su.apply(this,arguments)}var Iu=Vt.getInstance();Iu.addListener=function(t,n,r){var i=t;return Iu.addListener(e.Events[i],n,r)};var Au=[Hi.function()];function Ou(t){return Ln("onConfirmToExit",Au,[t],(function(t){var n=t;We.isMp&&(Iu.on(e.Events.AppClose,n,'{"handle_h5": 1}'),Ji.setNavigationBarLeftButton(void 0,2))}))}function ku(){return Ln("offConfirmToExit",[],[],(function(){We.isMp&&(Iu.off(e.Events.AppClose),Ji.setNavigationBarLeftButton(void 0,0))}))}function Cu(){return Ln("getDeviceId",[],[],(function(){return We.isMp&&Tn.getSync(l.DEVICE_ID)||""}))}function Nu(e){return Mu.apply(this,arguments)}function Mu(){return(Mu=ke((function(e){return xe(this,(function(t){return[2,Ln("getDeviceIdAsync",[],[e],ke((function(){return xe(this,(function(e){switch(e.label){case 0:return We.isMp?[4,Tn.jumpAndGetToken(l.DEVICE_ID)]:[3,2];case 1:return[2,e.sent()||""];case 2:return[2,Promise.resolve("")]}}))})))]}))}))).apply(this,arguments)}function Ru(){return Ln("getContext",[],[],(function(){if(We.isMp){var e=Tn.getSync(l.CONTEXT_ID)||"";return{type:Tn.getSync(l.CONTEXT_TYPE)||"",id:e}}return{type:"",id:""}}))}function xu(e){return Du.apply(this,arguments)}function Du(){return(Du=ke((function(e){return xe(this,(function(t){return[2,Ln("getContextAsync",[],[e],ke((function(){var e;return xe(this,(function(t){switch(t.label){case 0:return We.isMp?[4,Tn.jumpAndGetToken(l.CONTEXT_ID)]:[3,3];case 1:return e=t.sent()||"",[4,Tn.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 Uu(e){return Lu.apply(this,arguments)}function Lu(){return(Lu=ke((function(e){return xe(this,(function(t){return[2,Ln("getAuthCode",[],[e],ke((function(){var e,t;return xe(this,(function(n){switch(n.label){case 0:return We.isMp?[4,Tn.jumpAndGetToken(l.ZOAUTH,!0)]:[3,4];case 1:return e=n.sent()||"",[4,Tn.jumpAndGetToken(l.ZOAUTH_VRF)];case 2:return t=n.sent()||"",[4,Tn.verifyUserAuthorized()];case 3:if(n.sent())return[2,{authCode:e,authCodeVerify:t}];throw rn([{action:"getAuthCode",error:-104,message:"no user auth",data:{}}]),vn.error.loginFailed("User Authentication Required");case 4:return[2,Promise.resolve({authCode:"",authCodeVerify:""})]}}))})))]}))}))).apply(this,arguments)}function ju(e){return Bu.apply(this,arguments)}function Bu(){return(Bu=ke((function(e){return xe(this,(function(t){return[2,Ln("getZPIToken",[],[e],ke((function(){var e,t,n,r;return xe(this,(function(i){switch(i.label){case 0:return We.isMp?[4,Tn.jumpAndGetToken(l.UTOKEN_ZPI)]:[3,5];case 1:return e=i.sent()||"",[4,Tn.jumpAndGetToken(l.GTOKEN_ZPI)];case 2:return t=i.sent()||"",[4,Tn.jumpAndGetToken(l.ZPP_ZPI)];case 3:return n=i.sent()||"",[4,Tn.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 Zu=[li()];function zu(e){return Ln("setAccessToken",Zu,[e],(function(e){var t=e;Tn.setAccessToken(t)}))}var Wu=[Pi({url:li().url()})];function Fu(e){return Gu.apply(this,arguments)}function Gu(){return Gu=ke((function(e){return xe(this,(function(t){return[2,Ln("openOutApp",Wu,[e],function(){var e=ke((function(e){return xe(this,(function(t){switch(t.label){case 0:return We.isMp?[4,Va(e.url)]:[3,2];case 1:return[2,t.sent()];case 2:return We.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Ge("openOutApp",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Gu.apply(this,arguments)}var Vu=[Pi({count:di().min(1).optional().default(1),sourceType:Hi.array(Hi.enum(["album","camera"])).max(2).default(["album","camera"]).optional(),cameraType:Hi.enum(["back","front"]).default("front").optional()})];function Hu(e){return Ku.apply(this,arguments)}function Ku(){return Ku=ke((function(e){return xe(this,(function(t){return[2,Ln("chooseImage",Vu,[e],function(){var e=ke((function(e){var t,n,r,i;return xe(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)}}())]}))})),Ku.apply(this,arguments)}var Ju=ke((function(){var e,t,n=arguments;return xe(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){gn("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(vn.error.clientNotSupport())},fail:function(e){r(e)}},{isMultiCallback:!0,timeout:!1})}))]}))}));function qu(e){return Qu.apply(this,arguments)}function Qu(){return(Qu=ke((function(e){return xe(this,(function(t){return[2,Ln("getLocation",[],[e],ke((function(){return xe(this,(function(e){switch(e.label){case 0:return We.isMp?[4,Ju()]:[3,2];case 1:return[2,e.sent()];case 2:return We.isMpWeb?[2,Promise.resolve({token:""})]:[2,Promise.reject(Ge("getLocation",{}))]}}))})))]}))}))).apply(this,arguments)}var Yu=[Hi.function().args(Pi({data:Hi.any()})).returns(Hi.void())];function $u(t){return Ln("onCallbackData",Yu,[t],(function(){!function(t){Vt.getInstance().on(e.Events.OnDataCallback,(function(e){t({data:e})}))}(t)}))}var Xu=function(){var e=ke((function(e){var t,n,r,i,a,s,u,c,l,d,p;return xe(this,(function(f){switch(f.label){case 0:return e||(e=qs()),"object"==typeof e&&((n=e.zmpOrderId||e.orderId)||(t=e.appTransID||e.apptransid||e.transId)),"string"==typeof e&&(r=Jt.getParameterByName("orderId",e),i=Jt.getParameterByName("appTransID",e)||Jt.getParameterByName("apptransid",e),t=r||i),a={headers:{authorization:"Bearer "}},[4,Tn.getAccessToken().catch((function(){throw vn.error.loginRequired}))];case 1:return s=f.sent(),a.headers.authorization="Bearer ".concat(s),u=new URL(H),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 vn.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,He({msg:d.resultMessage},d)),[2,p]}}))}));return function(t){return e.apply(this,arguments)}}(),ec=function(){var t=ke((function(t,n,r,i,a,s,u){var c,l,d,p,f,h,m,v,y,g,_,w,T,b,E,P,S,I,A,O;return xe(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),l.append("mac",i),r&&l.append("desc",encodeURIComponent(r)),a&&(d=a,"object"==typeof a&&(d=JSON.stringify(a)),l.append("extradata",encodeURIComponent(d))),s&&(p=s,"object"==typeof s&&(p=JSON.stringify(s)),l.append("payload",encodeURIComponent(p))),u&&("string"==typeof u?(l.append("method",u),l.append("isCustom","false")):"object"==typeof u&&(l.append("method",u.id),l.append("isCustom",JSON.stringify(u.isCustom)))),f={headers:{"Content-Type":"application/x-www-form-urlencoded",authorization:"Bearer "}},k.label=1;case 1:return k.trys.push([1,6,,7]),[4,Tn.getAccessToken().catch((function(){throw vn.error.loginRequired}))];case 2:return h=k.sent(),f.headers.authorization="Bearer ".concat(h),[4,fetch(G,ba(He({method:"POST"},f),{body:l}))];case 3:return[4,k.sent().json()];case 4:if(!(m=k.sent()).data||0!==m.err)throw vn.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),P=Jt.encode(T),S=new URL("?".concat(P),"https://payment-mini.zalo.me").toString(),I=sn(),A=an()&&I<742?"normal":"bottomSheet",zt.enablePaymentDone=Vt.getInstance().eventNames().includes(e.Events.PaymentDone),[4,Vs(S,{style:A}).then((function(){var t=!1;Vt.getInstance().once(e.Events.WebviewClosed,(function(){setTimeout(ke((function(){var n;return xe(this,(function(r){switch(r.label){case 0:return t?[3,2]:(Vt.getInstance().emit(e.Events.PaymentDone,v,{orderId:v}),[4,Xu({zmpOrderId:v})]);case 1:(n=r.sent()).err>=0&&!n.isCustom&&Vt.getInstance().emit(e.Events.PaymentClose,n.err,ba(He({},n),{zmpOrderId:v})),r.label=2;case 2:return[2]}}))})),500)})),Vt.getInstance().once(e.Events.OpenApp,(function(){t=!0})),Vt.getInstance().once(e.Events.PaymentDone,(function(){t=!0,zt.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)}}(),tc=[Pi({amount:Hi.union([li(),di()]),item:Hi.array(Hi.record(li(),Hi.any())),desc:Hi.string(),mac:Hi.string(),extradata:Hi.any().optional(),payload:Hi.any().optional(),method:Hi.union([Hi.string(),Hi.object({id:Hi.string(),isCustom:Hi.boolean()})]).optional()})];function nc(e){return rc.apply(this,arguments)}function rc(){return rc=ke((function(e){return xe(this,(function(t){return[2,Ln("createOrder",tc,[e],function(){var e=ke((function(e){return xe(this,(function(t){switch(t.label){case 0:return We.isMp?[4,ec(e.amount,e.item,e.desc,e.mac,e.extradata,e.payload,e.method)]:[3,2];case 1:return[2,t.sent()];case 2:return We.isMpWeb?[2,Promise.resolve({orderId:"",messageToken:""})]:[2,Promise.reject(Ge("createOrder",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),rc.apply(this,arguments)}var ic=ke((function(){return xe(this,(function(e){return[2,new Promise((function(e,t){gn("MP_CONFIRM_REQUEST_PAYMENT",{},{success:function(){e()},fail:function(e){t(e)}},{})}))]}))})),oc=function(){var e=ke((function(e,t,n,r,i){var a,s,u,c,l,d,p,f,h,m,v,y;return xe(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,Tn.getAccessToken().catch((function(){throw vn.error.loginRequired}))];case 2:return l=g.sent(),u.headers.authorization="Bearer ".concat(l),console.log("_purchase"),[4,Tn.jumpAndGetToken()];case 3:if(g.sent(),d=null===(c=Tn.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,ic()];case 5:return g.sent(),[3,7];case 6:throw p=g.sent(),console.error("Failed:",p),p;case 7:return[4,fetch(K,ba(He({method:"POST"},u),{body:s}))];case 8:return[4,g.sent().json()];case 9:if(!(f=g.sent()).data||0!==f.err)throw vn.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)}}(),ac=[Pi({amount:Hi.union([Hi.string(),Hi.number()]),desc:Hi.string(),method:Hi.string(),transId:Hi.string().optional(),mac:Hi.string().optional()})];function sc(e){return uc.apply(this,arguments)}function uc(){return uc=ke((function(e){return xe(this,(function(t){return[2,Ln("purchase",ac,[e],function(){var e=ke((function(e){return xe(this,(function(t){switch(t.label){case 0:return We.isMp?[4,oc(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 We.isMpWeb?[2,Promise.resolve({orderId:"",messageToken:"",transId:""})]:[2,Promise.reject(Ge("purchase",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),uc.apply(this,arguments)}var cc=function(){var e=ke((function(e,t){return xe(this,(function(n){return[2,new Promise((function(n,r){var i=e&&(null==e?void 0:e.length)>0;gn("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)}}(),lc=[Pi({channels:Ei(Pi({method:li(),subMethod:li().optional(),subInfo:li().optional()})).optional(),selectedMethod:Pi({method:li(),subMethod:li().optional()}).optional()}).optional()];function dc(e){return pc.apply(this,arguments)}function pc(){return pc=ke((function(e){return xe(this,(function(t){return[2,Ln("selectPaymentMethod",lc,[e],function(){var e=ke((function(e){var t,n;return xe(this,(function(r){switch(r.label){case 0:return We.isMp?(t=e.channels,n=e.selectedMethod,[4,cc(t,n)]):[3,2];case 1:return[2,r.sent()];case 2:return We.isMpWeb?[2,Promise.resolve({method:""})]:[2,Promise.reject(Ge("selectPaymentMethod",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),pc.apply(this,arguments)}var fc=[Pi({data:Hi.union([li(),Hi.record(li(),li().nullish())])})];function hc(e){return mc.apply(this,arguments)}function mc(){return mc=ke((function(e){return xe(this,(function(t){return[2,Ln("checkTransaction",fc,[e],function(){var e=ke((function(e){return xe(this,(function(t){switch(t.label){case 0:return We.isMp?[4,Xu(e.data)]:[3,2];case 1:return[2,t.sent()];case 2:return We.isMpWeb?[2,Promise.resolve({msg:"Success",orderId:"",resultCode:1,transTime:(new Date).getTime().toString(),createdAt:(new Date).getTime().toString(),transId:""})]:[2,Promise.reject(Ge("checkTransaction",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),mc.apply(this,arguments)}var vc=function(){var t=ke((function(t,n,r,i,a,s){var u,c,l,d,p,f,h,m,v,y,g,_,w,T;return xe(this,(function(b){switch(b.label){case 0:p=o,(f=new URLSearchParams).append("payType",n||e.IAPPayType.SUBSCRIPTION),h=e.ProrationMode.UNKNOW,r===q&&(h=e.ProrationMode.IMMEDIATE_AND_CHARGE_FULL_PRICE),r===J&&(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=ze())||void 0===u||null===(c=u.platform)||void 0===c?void 0:c.isIOS)?m="ios":(null===(l=ze())||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,Tn.getAccessToken().catch((function(){throw vn.error.loginRequired}))];case 2:return y=b.sent(),v.headers.authorization="Bearer ".concat(y),[4,fetch(V,ba(He({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 vn.error.createIAPOrderFailed(g.err);return _=g.data.store,w=g.data.orderId,[2,new Promise((function(e,t){gn("IAP_REQUESTPAYMENT",He({},_),{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)}}(),yc=[Pi({productId:li(),payType:Hi.enum(["ONETIME","SUBSCRIPTION"]).optional(),prorationMode:Hi.enum(["DEFERRED","IMMEDIATE_AND_CHARGE_FULL_PRICE"]).default("DEFERRED").optional(),utm:li().optional(),method:Hi.enum(["IAP","IAP_SANDBOX"]).optional(),merchantTransId:li().optional()})];function gc(e){return _c.apply(this,arguments)}function _c(){return _c=ke((function(e){return xe(this,(function(t){return[2,Ln("createOrderIAP",yc,[e],function(){var e=ke((function(e){return xe(this,(function(t){switch(t.label){case 0:return We.isMp?[4,vc(e.productId,e.payType,e.prorationMode,e.method,e.utm,e.merchantTransId)]:[3,2];case 1:return[2,t.sent()];case 2:return We.isMpWeb?[2,Promise.resolve({orderId:""})]:[2,Promise.reject(Ge("createOrderIAP",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),_c.apply(this,arguments)}var wc=[Pi({hide:hi().default(!1).optional()}).optional()];function Tc(e){return bc.apply(this,arguments)}function bc(){return bc=ke((function(e){return xe(this,(function(t){return[2,Ln("setAndroidBottomNavigationBar",wc,[e],function(){var e=ke((function(e){return xe(this,(function(t){switch(t.label){case 0:return We.isMp?[4,Ji.setAndroidBottomNavigationBar(e.hide)]:[3,2];case 1:return[2,t.sent()];case 2:return We.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Ge("setAndroidBottomNavigationBar",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),bc.apply(this,arguments)}var Ec=[Pi({hide:hi().default(!1).optional()}).optional()];function Pc(e){return Sc.apply(this,arguments)}function Sc(){return Sc=ke((function(e){return xe(this,(function(t){return[2,Ln("setIOSBottomSafeArea",Ec,[e],function(){var e=ke((function(e){return xe(this,(function(t){switch(t.label){case 0:return We.isMp?[4,Ji.setIOSBottomSafeArea(e.hide)]:[3,2];case 1:return[2,t.sent()];case 2:return We.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Ge("setIOSBottomSafeArea",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Sc.apply(this,arguments)}var Ic=[Pi({type:Hi.enum(["normal","hidden","transparent"]).default("normal").optional(),color:Hi.string().optional()}).optional()];function Ac(e){return Oc.apply(this,arguments)}function Oc(){return Oc=ke((function(e){return xe(this,(function(t){return[2,Ln("setStatusBar",Ic,[e],function(){var e=ke((function(e){return xe(this,(function(t){switch(t.label){case 0:return We.isMp?[4,Ji.configHeader({statusBarType:e.type,headerColor:e.color})]:[3,2];case 1:return[2,t.sent()];case 2:return We.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Ge("setStatusBar",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Oc.apply(this,arguments)}var kc=[Pi({headerTextColor:Hi.enum(["black","white"]).optional(),headerColor:Hi.string().optional(),actionBar:Pi({hide:Hi.boolean().optional(),title:Hi.string().optional(),leftButton:Hi.enum(["back","none"]).optional(),textAlign:Hi.enum(["left","center"]).default("left").optional()}).optional(),statusBarType:Hi.enum(["normal","hidden","transparent"]).optional(),hideAndroidBottomNavigationBar:Hi.boolean().optional(),hideIOSSafeAreaBottom:Hi.boolean().optional()})];function Cc(e){return Nc.apply(this,arguments)}function Nc(){return Nc=ke((function(e){return xe(this,(function(t){return[2,Ln("configAppView",kc,[e],function(){var e=ke((function(e){var t,n,r,i,o,a,s;return xe(this,(function(u){switch(u.label){case 0:return We.isMp?kt.isUndefined(null===(t=e.actionBar)||void 0===t?void 0:t.leftButton)?[3,2]:[4,Ji.setNavigationBarLeftButton(null===(a=e.actionBar)||void 0===a?void 0:a.leftButton)]:[3,13];case 1:u.sent(),u.label=2;case 2:return kt.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,Ji.setNavigationBarTitle(null===(s=e.actionBar)||void 0===s?void 0:s.title)];case 3:u.sent(),u.label=4;case 4:return[4,Ji.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,Ji.setAndroidBottomNavigationBar(e.hideAndroidBottomNavigationBar)];case 7:u.sent(),u.label=8;case 8:return"boolean"!=typeof e.hideIOSSafeAreaBottom?[3,10]:[4,Ji.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 We.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Ge("configAppView",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Nc.apply(this,arguments)}var Mc=ke((function(){return xe(this,(function(e){return[2,new Promise((function(e,t){gn("MA_MENU_MINIMIZE",{},{success:function(t){e(t)},fail:function(e){t(e)}},{})}))]}))}));function Rc(e){return xc.apply(this,arguments)}function xc(){return(xc=ke((function(e){return xe(this,(function(t){return[2,Ln("minimizeApp",[],[e],ke((function(){return xe(this,(function(e){switch(e.label){case 0:return We.isMp?[4,Mc()]:[3,2];case 1:return[2,e.sent()];case 2:return We.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Ge("minimizeApp",{}))]}}))})))]}))}))).apply(this,arguments)}var Dc=ke((function(){return xe(this,(function(e){return[2,new Promise((function(e,t){gn("MA_MENU_PERMISSION",{},{success:function(t){e(t)},fail:function(e){t(e)}},{}),e()}))]}))}));function Uc(e){return Lc.apply(this,arguments)}function Lc(){return(Lc=ke((function(e){return xe(this,(function(t){return[2,Ln("openPermissionSetting",[],[e],ke((function(){return xe(this,(function(e){switch(e.label){case 0:return We.isMp?[4,Dc()]:[3,2];case 1:return[2,e.sent()];case 2:return We.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Ge("openPermissionSetting",{}))]}}))})))]}))}))).apply(this,arguments)}var jc=ke((function(){return xe(this,(function(e){return[2,new Promise((function(e,t){gn("MP_ADD_MYFAVORITES",{timestamp:(new Date).getTime()},{success:function(t){e(t)},fail:function(e){t(e)}},{})}))]}))}));function Bc(e){return Zc.apply(this,arguments)}function Zc(){return(Zc=ke((function(e){return xe(this,(function(t){return[2,Ln("favoriteApp",[],[e],ke((function(){return xe(this,(function(e){switch(e.label){case 0:return We.isMp?[4,jc()]:[3,2];case 1:return[2,e.sent()];case 2:return We.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Ge("favoriteApp",{}))]}}))})))]}))}))).apply(this,arguments)}var zc=ke((function(){return xe(this,(function(e){return[2,new Promise((function(e,t){gn("OPEN_GROUPLIST",{},{success:function(t){e(t)},fail:function(e){t(e)}},{})}))]}))}));function Wc(e){return Fc.apply(this,arguments)}function Fc(){return(Fc=ke((function(e){return xe(this,(function(t){return[2,Ln("openGroupList",[],[e],ke((function(){return xe(this,(function(e){switch(e.label){case 0:return We.isMp?[4,zc()]:[3,2];case 1:return[2,e.sent()];case 2:return We.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Ge("openGroupList",{}))]}}))})))]}))}))).apply(this,arguments)}var Gc=ke((function(){var e;return xe(this,(function(t){switch(t.label){case 0:return[4,Tn.getAccessToken()];case 1:return e=t.sent(),[2,new Promise((function(t,n){gn("MP_SEND_NOTIFICATION",{accessToken:e},{success:function(e){t(e)},fail:function(e){n(e)}},{delay:500})}))]}}))}));function Vc(e){return Hc.apply(this,arguments)}function Hc(){return(Hc=ke((function(e){return xe(this,(function(t){return[2,Ln("requestSendNotification",[],[e],ke((function(){return xe(this,(function(e){switch(e.label){case 0:return We.isMp?[4,Gc()]:[3,2];case 1:return[2,e.sent()];case 2:return We.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Ge("requestSendNotification",{}))]}}))})))]}))}))).apply(this,arguments)}var Kc=ke((function(){return xe(this,(function(e){return[2,new Promise((function(e,t){gn("MP_ADD_RATING",{},{success:function(t){e(t)},fail:function(e){t(e)}},{})}))]}))}));function Jc(e){return qc.apply(this,arguments)}function qc(){return(qc=ke((function(e){return xe(this,(function(t){return[2,Ln("addRating",[],[e],ke((function(){return xe(this,(function(e){switch(e.label){case 0:return We.isMp?[4,Kc()]:[3,2];case 1:return[2,e.sent()];case 2:return We.isMpWeb?[2,Promise.resolve({})]:[2,Promise.reject(Ge("addRating",{}))]}}))})))]}))}))).apply(this,arguments)}var Qc,Yc=(Qc=ke((function(e,t,n){var r,i;return xe(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,He({method:"POST",body:r},i))];case 1:return[4,o.sent().json()];case 2:return[2,o.sent()]}}))})),function(e,t,n){return Qc.apply(this,arguments)}),$c=function(){var e=ke((function(e){return xe(this,(function(t){return[2,new Promise((function(t,n){gn("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)}}(),Xc=[Pi({oaId:li()})];function el(e){return tl.apply(this,arguments)}function tl(){return tl=ke((function(e){return xe(this,(function(t){return[2,Ln("interactOA",Xc,[e],function(){var e=ke((function(e){var t,n,r;return xe(this,(function(i){switch(i.label){case 0:return We.isMp?(t=e.oaId,[4,Tn.getAccessToken()]):[3,5];case 1:return!(n=i.sent())||kt.isEmpty(n)?[3,3]:[4,Yc(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,$c(t)];case 4:return[2,i.sent()];case 5:return We.isMpWeb?[2,Promise.resolve({})]:[2,Promise.reject(Ge("interactOA",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),tl.apply(this,arguments)}var nl=[Pi({oaId:li()})];function rl(e){return il.apply(this,arguments)}function il(){return il=ke((function(e){return xe(this,(function(t){return[2,Ln("isAllowedInteractWithOA",nl,[e],function(){var e=ke((function(e){var t,n,r;return xe(this,(function(i){switch(i.label){case 0:return We.isMp?(t=e.oaId,[4,Tn.getAccessToken()]):[3,4];case 1:return!(n=i.sent())||kt.isEmpty(n)?[3,3]:[4,Yc(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 We.isMpWeb?[2,Promise.resolve({status:!1})]:[2,Promise.reject(Ge("IsAllowedInteractWithOA",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),il.apply(this,arguments)}function ol(e){return al.apply(this,arguments)}function al(){return(al=ke((function(e){return xe(this,(function(t){return[2,Ln("getSetting",[],[e],ke((function(){return xe(this,(function(e){switch(e.label){case 0:return We.isMp?[4,hn()]:[3,2];case 1:return[2,e.sent()];case 2:return We.isMpWeb?[2,Promise.resolve({authSetting:{}})]:[2,Promise.reject(Ge("getSetting",{}))]}}))})))]}))}))).apply(this,arguments)}var sl=Hi.enum(["scope.userInfo","scope.userLocation","scope.userPhonenumber"]),ul=[Pi({scopes:Hi.array(sl).max(2).optional()}).optional()];function cl(e){return ll.apply(this,arguments)}function ll(){return ll=ke((function(e){return xe(this,(function(t){return[2,Ln("authorize",ul,[e],function(){var e=ke((function(e){var t;return xe(this,(function(n){switch(n.label){case 0:return We.isMp?(t=null==e?void 0:e.scopes,un(724,573)?[2,Promise.reject(vn.error.clientNotSupport())]:[4,_n(null!=t?t:void 0)]):[3,2];case 1:return[2,n.sent()];case 2:return We.isMpWeb?[2,Promise.resolve({})]:[2,Promise.reject(Ge("authorize",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),ll.apply(this,arguments)}var dl=ke((function(){return xe(this,(function(e){return[2,new Promise(function(){var e=ke((function(e,t){var n;return xe(this,(function(r){switch(r.label){case 0:return kt.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(vn.error.clientNotSupport()),[2]}}))}));return function(t,n){return e.apply(this,arguments)}}())]}))}));function pl(e){return Ln("checkZaloCameraPermission",[],[e],ke((function(){return xe(this,(function(e){switch(e.label){case 0:return[4,dl()];case 1:return[2,e.sent()]}}))})))}var fl=ke((function(){return xe(this,(function(e){return[2,new Promise(function(){var e=ke((function(e,t){var n,r,i;return xe(this,(function(o){switch(o.label){case 0:return o.trys.push([0,2,,3]),[4,Tn.jumpAndGetToken()];case 1:return o.sent(),r=null===(n=Tn.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 hl(e){return ml.apply(this,arguments)}function ml(){return(ml=ke((function(e){return xe(this,(function(t){return[2,Ln("getUserID",[],[e],ke((function(){return xe(this,(function(e){switch(e.label){case 0:return We.isMp?[4,fl()]:[3,2];case 1:return[2,e.sent()];case 2:return We.isMpWeb?[2,Promise.resolve(void 0)]:[2,Promise.reject(Ge("getUserID",{}))]}}))})))]}))}))).apply(this,arguments)}var vl=ke((function(){return xe(this,(function(e){return[2,new Promise(function(){var e=ke((function(e,t){var n,r,i;return xe(this,(function(o){switch(o.label){case 0:return o.trys.push([0,2,,3]),[4,Tn.jumpAndGetToken()];case 1:return o.sent(),r=null===(n=Tn.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 yl(e){return gl.apply(this,arguments)}function gl(){return(gl=ke((function(e){return xe(this,(function(t){return[2,Ln("getIDToken",[],[e],ke((function(){return xe(this,(function(e){switch(e.label){case 0:return We.isMp?[4,vl()]:[3,2];case 1:return[2,e.sent()];case 2:return We.isMpWeb?[2,Promise.resolve(void 0)]:[2,Promise.reject(Ge("getIDToken",{}))]}}))})))]}))}))).apply(this,arguments)}var _l={format:e.PhotoFormat.JPEG,quality:e.PhotoQuality.NORMAL,mirrored:!1,useVideoSourceSize:!1},wl={width:1024,height:768,facingMode:e.FacingMode.FRONT,mirrored:!1,audio:!1,video:!0},Tl=function(){function t(n){var r,i,o,a,s,u=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,c=this;Ct(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};Vt.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:wl.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:wl.mirrored,this._userRequestFrameCallback=!1,this._audioEnabled=null!==(a=null==u?void 0:u.audio)&&void 0!==a?a:wl.audio,this._videoEnabled=null!==(s=null==u?void 0:u.video)&&void 0!==s?s:wl.video}var n=t.prototype;return n.on=function(t,n){Vt.getInstance().on(t,(function(e){n(e)})),t===e.CameraEvents.OnFrameCallback&&(this._userRequestFrameCallback=!0,this.tick())},n.off=function(t){Vt.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 ke((function(){return xe(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 ke((function(){var n,r,i,o,a,s;return xe(this,(function(u){switch(u.label){case 0:return kt.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||wl.width,this._videoElement.height=(null==e?void 0:e.height)||this._videoElement.height||wl.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 ke((function(){return xe(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 ke((function(){var n,r;return xe(this,(function(i){return n=Vt.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=ke((function(n,r){var i;return xe(this,(function(o){switch(o.label){case 0:return o.trys.push([0,2,,3]),[4,t.stream()];case 1:return o.sent(),Vt.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 ke((function(){return xe(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 ke((function(){return xe(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=ke((function(n){return xe(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 ke((function(){return xe(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 ke((function(){return xe(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 ke((function(){return xe(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(),Vt.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||_l.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}(),bl=Pi({play:Hi.function(),pause:Hi.function()}).refine((function(e){return"play"in e&&"pause"in e}),{message:"Invalid HTMLVideoElement"}),El=[Pi({videoElement:bl,mediaConstraints:Hi.object({width:Hi.number().min(100).optional(),height:Hi.number().min(100).optional(),facingMode:Hi.string().optional(),audio:Hi.boolean().optional(),video:Hi.boolean().optional(),deviceId:Hi.string().optional(),mirrored:Hi.boolean().optional()}).nullish()}).optional()];function Pl(e){return Ln("createCameraContext",El,[e],(function(e){return new Tl(e.videoElement,e.mediaConstraints)}))}var Sl=function(){function e(){var t,n;Ct(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=Re(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;kt.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?kt.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?kt.isFunction(null===(t=window.AdtimaZMA)||void 0===t?void 0:t.refresh)&&window.AdtimaZMA.refresh(e):this.queue.push(this.refresh.bind(this,e))},t.processQueue=function(){for(;this.queue.length>0;){var e=this.queue.shift();e&&e()}},e.getInstance=function(){return e.instance||(e.instance=new e),e.instance},e}();function Il(e){return Al.apply(this,arguments)}function Al(){return(Al=ke((function(e){return xe(this,(function(t){return[2,Ln("setupAd",[],[e],(function(){return Sl.getInstance().loadSDK()}))]}))}))).apply(this,arguments)}var Ol=[Pi({ids:Hi.union([Hi.string(),Hi.array(Hi.string())]),config:Pi({display:Hi.boolean().optional(),onClose:Hi.function().optional()}).optional()})];function kl(e){return Cl.apply(this,arguments)}function Cl(){return Cl=ke((function(e){return xe(this,(function(t){return[2,Ln("loadAd",Ol,[e],function(){var e=ke((function(e){return xe(this,(function(t){return Sl.getInstance().load(e.ids,e.config),[2]}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Cl.apply(this,arguments)}var Nl=[Pi({id:Hi.string()})];function Ml(e){return Rl.apply(this,arguments)}function Rl(){return Rl=ke((function(e){return xe(this,(function(t){return[2,Ln("displayAd",Nl,[e],function(){var e=ke((function(e){return xe(this,(function(t){return Sl.getInstance().display(e.id),[2]}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Rl.apply(this,arguments)}var xl=[Pi({id:Hi.string().optional()}).optional()];function Dl(e){return Ul.apply(this,arguments)}function Ul(){return Ul=ke((function(e){return xe(this,(function(t){return[2,Ln("refreshAd",xl,[e],function(){var e=ke((function(e){return xe(this,(function(t){return Sl.getInstance().refresh(e.id),[2]}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Ul.apply(this,arguments)}var Ll,jl=[Pi({id:li(),guidingText:li().optional(),color:li().optional(),onStatusChange:Hi.function().optional(),onError:Hi.function().optional()}).catchall(Hi.any())];function Bl(e){return Zl.apply(this,arguments)}function Zl(){return Zl=ke((function(e){return xe(this,(function(n){return[2,Ln("showOAWidget",jl,[e],function(){var e=ke((function(e){var n,r,i,o,a,s,u,c;return xe(this,(function(l){if(We.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="ifOAW-".concat(e.id,"-").concat(Date.now()),(c=new URL(Ae.OA)).searchParams.set("id",u),c.searchParams.set("appId",window.APP_ID),i&&c.searchParams.set("guidingText",i),o&&c.searchParams.set("color",o),Object.entries(a).forEach((function(e){var t=Ke(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.removeEventListener("message",Ll,!1),Ll=function(){var e=ke((function(e){var t,n,i,o,a,s,l,d;return xe(this,(function(p){switch(p.label){case 0:return t=e.data,e.origin.startsWith(Ie)?(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,Tn.jumpAndGetToken()]):[3,3];case 1:return p.sent(),l=null===(a=Tn.miniProgramConfig)||void 0===a?void 0:a.jwt,null==n||null===(s=n.contentWindow)||void 0===s||s.postMessage({type:i,payload:{jwt:l}},Ie),[3,3];case 2:"oaInfo"===i?null==r||r(null===(d=t.payload)||void 0===d?void 0:d.followed):"openOA"===i?ha(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)}}(),window.addEventListener("message",Ll,!1))}catch(e){console.log(e)}return[2,Promise.resolve()]}return We.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Ge("showOAWidget",{}))]}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Zl.apply(this,arguments)}var zl,Wl=[Hi.object({id:Hi.string(),type:Hi.string(),text:Hi.string(),color:Hi.string().optional(),disabled:Hi.boolean().optional(),onDataReceived:Hi.function().optional(),onError:Hi.function().optional()}).catchall(Hi.any())];function Fl(e){return Gl.apply(this,arguments)}function Gl(){return Gl=ke((function(e){return xe(this,(function(n){return[2,Ln("showFunctionButtonWidget",Wl,[e],function(){var e=ke((function(e){var n,r,i,o,a,s,u;return xe(this,(function(c){if(We.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(Ae.FUNCTION_BUTTON)).searchParams.set("id",s),u.searchParams.set("appId",window.APP_ID),Object.entries(o).forEach((function(e){var t=Ke(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=Ke(e,2),n=t[0],r=t[1];r&&a.setAttribute("data-".concat(n),String(r))})),n.innerHTML=a.outerHTML,window.removeEventListener("message",zl,!1),zl=function(){var e=ke((function(e){var t,n,a,c,l,d,p,f,h,m,v,y,g;return xe(this,(function(_){switch(_.label){case 0:return t=e.data,e.origin.startsWith(Ie)?(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,Tn.jumpAndGetToken()]):[3,4];case 1:return _.sent(),f=null===(l=Tn.miniProgramConfig)||void 0===l?void 0:l.jwt,h=null===(d=Tn.miniProgramConfig)||void 0===d?void 0:d.encryptKey,[4,Zn()];case 2:return m=_.sent(),null==n||null===(p=n.contentWindow)||void 0===p||p.postMessage({type:a,payload:{jwt:f,encryptKey:h,accessToken:m}},Ie),[3,4];case 3:"onSuccess"===a?(null==(v=t.payload)?void 0:v.type)===o.type&&(y={callAction:function(e,t){var r;null==n||null===(r=n.contentWindow)||void 0===r||r.postMessage({type:"context.callAction",payload:{actionName:e,actionData:t}},Ie)}},null==r||r.apply(void 0,Re(Object.values(v)).concat([y]))):"onError"===a&&(null==(g=t.payload)?void 0:g.type)===o.type&&(null==i||i(null==g?void 0:g.data)),_.label=4;case 4:return[2]}}))}));return function(t){return e.apply(this,arguments)}}(),window.addEventListener("message",zl,!1))}catch(e){console.log(e)}return[2,Promise.resolve()]}return We.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Ge("showFunctionButtonWidget",{}))]}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Gl.apply(this,arguments)}var Vl=function(){var t=ke((function(t,n){var r;return xe(this,(function(i){return r={},"cccd"===t&&(r={mrz:null==n?void 0:n.mrz}),[2,new Promise((function(n,i){gn("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,P={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:"",com:null!==(_=e.com)&&void 0!==_?_:"",sod:null!==(w=e.sod)&&void 0!==w?w:"",challenge:null!==(T=e.challenge)&&void 0!==T?T:"",aAResult:null!==(b=e.aAResult)&&void 0!==b?b:"",eACCAResult:null!==(E=e.eACCAResult)&&void 0!==E?E:""};n(P)}else n({})},fail:function(e){i(e)}},{timeout:!1})}))]}))}));return function(e,n){return t.apply(this,arguments)}}(),Hl=[Pi({type:Hi.enum(["cccd"]),data:Pi({mrz:li().max(90)})})];function Kl(e){return Jl.apply(this,arguments)}function Jl(){return Jl=ke((function(e){return xe(this,(function(t){return[2,Ln("scanNFC",Hl,[e],function(){var e=ke((function(e){var t,n;return xe(this,(function(r){switch(r.label){case 0:return We.isMp?un(754,620)?[2,Promise.reject(vn.error.clientNotSupport())]:(t=e.type,n=e.data,[4,Vl(t,n)]):[3,2];case 1:return[2,r.sent()];case 2:return We.isMpWeb?[2,Promise.resolve({})]:[2,Promise.reject(Ge("scanNFC",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Jl.apply(this,arguments)}var ql=ke((function(){return xe(this,(function(e){return[2,new Promise((function(e,t){gn("CHECK_NFC",{},{success:function(t){e(t)},fail:function(e){t(e)}},{timeout:!1})}))]}))}));function Ql(e){return Yl.apply(this,arguments)}function Yl(){return(Yl=ke((function(e){return xe(this,(function(t){return[2,Ln("checkNFC",[],[e],ke((function(){return xe(this,(function(e){switch(e.label){case 0:return We.isMp?[4,ql()]:[3,2];case 1:return[2,e.sent()];case 2:return We.isMpWeb?[2,Promise.resolve({})]:[2,Promise.reject(Ge("checkNFC",{}))]}}))})))]}))}))).apply(this,arguments)}var $l=[Hi.string().trim().min(1)];var Xl=[Hi.string().trim().min(1),Hi.string().trim()];var ed=[Hi.string().trim().min(1)];var td={getItem:function(e){return Ln("getItem",$l,[e],(function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];if(We.isMp||We.isMpWeb){if(un(757,625))throw vn.error.clientNotSupport();return Ao.getItem(t[0])}throw Ge("getItem",{})}))},setItem:function(e,t){return Ln("setItem",Xl,[e,t],(function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];if(We.isMp||We.isMpWeb){if(un(757,625))throw vn.error.clientNotSupport();return Ao.setItem(t[0],t[1])}throw Ge("setItem",{})}))},clear:function(){return Ln("clear",[],[],(function(){if(We.isMp||We.isMpWeb){if(un(757,625))throw vn.error.clientNotSupport();return Ao.clearStorageSync()}throw Ge("clear",{})}))},removeItem:function(e){return Ln("removeItem",ed,[e],(function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];if(We.isMp||We.isMpWeb){if(un(757,625))throw vn.error.clientNotSupport();return Ao.removeItem(t[0])}throw Ge("removeItem",{})}))},getStorageInfo:function(){return Ln("getStorageInfoSync",[],[],(function(){if(We.isMp||We.isMpWeb){if(un(757,625))throw vn.error.clientNotSupport();return Ao.getStorageInfoSync()}throw Ge("getStorageInfoSync",{})}))}},nd={purchase:sc,createOrder:nc,checkTransaction:hc,createOrderIAP:gc,selectPaymentMethod:dc},rd=nd,id=function(){var e=ke((function(e,t){return xe(this,(function(n){return[2,new Promise((function(n,r){gn("SAVE_FILE",{fileUrl:e,onProgress:t},{success:function(e){n()},fail:function(e){r(e)}},{})}))]}))}));return function(t,n){return e.apply(this,arguments)}}(),od=[Pi({url:Hi.string().url()}).optional()];function ad(e){return sd.apply(this,arguments)}function sd(){return sd=ke((function(e){return xe(this,(function(t){return[2,Ln("downloadFile",od,[e],function(){var e=ke((function(e){var t;return xe(this,(function(n){switch(n.label){case 0:return We.isMp?(t=e.url,[4,id(t,e.onProgress)]):[3,2];case 1:return[2,n.sent()];case 2:return We.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Ge("downloadFile",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),sd.apply(this,arguments)}var ud=Hi.enum(["APP_INITIALIZING","APP_READY"]),cd=Hi.any();var ld,dd={logEvent:function(e,t){return Ln("logEvent",[ud,cd],[e,t],(function(e,t){if(We.isMp||We.isMpWeb){var n,r,i,o=ba(He({},"object"==typeof t&&null!==t?t:{}),{duration:Math.round(performance.now()),timestamp:Date.now()});return null===window||void 0===window||null===(n=window.zmpGlobal)||void 0===n||null===(r=n.eventManager)||void 0===r||null===(i=r.logEventForClient)||void 0===i||i.call(r,{type:p.DEV_TRACKING,eventCode:"APP_INITIALIZING"===e?f.APP_INITIALIZING:f.APP_READY}),rn([{action:"zmp.app.lifecycle.tracking",error:0,message:"",data:He({eventType:e},o)}])}throw Ge("logEvent",{})}))}},pd=[Pi({id:li(),textColor:Hi.string().optional(),fontSize:Hi.string().optional(),buttonHeight:Hi.string().optional(),buttonColor:Hi.string().optional(),buttonTextColor:Hi.string().optional(),buttonRadius:Hi.string().optional(),buttonText:Hi.string().optional(),checkboxBGColor:Hi.string().optional(),checkboxCheckmarkColor:Hi.string().optional(),onClick:Hi.function().optional(),onStatusChange:Hi.function().optional(),onError:Hi.function().optional()}).catchall(Hi.any())];function fd(e){return hd.apply(this,arguments)}function hd(){return hd=ke((function(e){return xe(this,(function(n){return[2,Ln("showCustomOAWidget",pd,[e],function(){var e=ke((function(e){var n,r,i,o,a,s,u,c,l,d,p,f,h,m,v,y,g,_,w,T,b;return xe(this,(function(E){if(We.isMp){try{n=document.getElementById(e.id),r=e.textColor,i=e.fontSize,o=e.buttonHeight,a=e.buttonColor,s=e.buttonTextColor,u=e.buttonRadius,c=e.buttonText,l=e.checkboxBGColor,d=e.checkboxCheckmarkColor,p=e.onStatusChange,f=e.onClick,h=e.onError,m=t(e,["textColor","fontSize","buttonHeight","buttonColor","buttonTextColor","buttonRadius","buttonText","checkboxBGColor","checkboxCheckmarkColor","onStatusChange","onClick","onError"]),n&&(v=document.createElement("iframe"),y="ifCOAW-".concat(e.id,"-").concat(Date.now()),g=new URL(Ae.CUSTOM_OA),_={id:y,appId:window.APP_ID,textColor:r,fontSize:i,buttonHeight:o,buttonColor:a,buttonTextColor:s,buttonRadius:u,buttonText:c,checkboxBGColor:l,checkboxCheckmarkColor:d},Object.entries(m).forEach((function(e){var t=Ke(e,2),n=t[0],r=t[1];r&&(_["data-".concat(n)]=String(r))})),w=JSON.stringify(_),P=w,S=(new TextEncoder).encode(P),I=Array.from(S).map((function(e){return String.fromCharCode(e)})).join(""),T=btoa(I),b=encodeURIComponent(T),Dn(g.searchParams,"data",b),v.id=y,v.src=g.href,v.style.width="100%",v.style.height="100%",v.style.border="none",n.innerHTML=v.outerHTML,window.removeEventListener("message",ld,!1),ld=function(){var e=ke((function(e){var t,n,r,i,o,a,s,u,c;return xe(this,(function(l){switch(l.label){case 0:return t=e.data,e.origin.startsWith(Ie)?(n=document.getElementById(y),r=t.type,(i=new URL(t.href)).origin!==g.origin||i.pathname!==g.pathname||t.id!==y?[3,3]:"followOA"!==r&&"getOAInfo"!==r?[3,2]:[4,Tn.jumpAndGetToken()]):[3,3];case 1:return l.sent(),s=null===(o=Tn.miniProgramConfig)||void 0===o?void 0:o.jwt,null==n||null===(a=n.contentWindow)||void 0===a||a.postMessage({type:r,payload:{jwt:s}},Ie),[3,3];case 2:"oaInfo"===r?null==p||p(null===(u=t.payload)||void 0===u?void 0:u.followed):"openOA"===r?ha(t.payload.id,"oa"):"heightChange"===r?n.style.height="".concat(t.payload,"px"):"onClick"===r?null==f||f(null===(c=t.payload)||void 0===c?void 0:c.status):"onError"===r&&(null==h||h(t.payload)),l.label=3;case 3:return[2]}}))}));return function(t){return e.apply(this,arguments)}}(),window.addEventListener("message",ld,!1))}catch(e){console.log(e)}return[2,Promise.resolve()]}var P,S,I;return We.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Ge("showCustomOAWidget",{}))]}))}));return function(t){return e.apply(this,arguments)}}())]}))})),hd.apply(this,arguments)}var md,vd=[Pi({id:li(),onMethodChange:Hi.function().optional()}).catchall(Hi.any())];function yd(){return yd=ke((function(e){return xe(this,(function(n){return[2,Ln("showWidget",vd,[e],function(){var e=ke((function(e){var n,r,i,o,a,s,u,c,l,d,p;return xe(this,(function(f){if(We.isMp){try{n=document.getElementById(e.id),r=e.onMethodChange,i=e.fail,o=t(e,["onMethodChange","fail"]),n&&((a=document.getElementById(Se))&&(document.body.removeChild(a),a=null),a=document.createElement("iframe"),s=Se,u=new URL(Ae.CHECKOUT_KIT),c={id:s,appId:window.APP_ID},Object.entries(o).forEach((function(e){var t=Ke(e,2),n=t[0],r=t[1];r&&(c["data-".concat(n)]=r)})),l=JSON.stringify(c),d=btoa(l),p=encodeURIComponent(d),Dn(u.searchParams,"data",p),a.id=s,a.src=u.href,a.style.width="100%",a.style.height="100%",a.style.border="none",n.innerHTML=a.outerHTML,window.removeEventListener("message",md,!1),md=function(){var e=ke((function(e){var t,n,o,a,c,l,d,p,f,h;return xe(this,(function(m){switch(m.label){case 0:if(t=e.data,!e.origin.startsWith(Ie))return[3,9];if(n=t.type,o=document.getElementById(s),(a=new URL(t.href)).origin!==u.origin||a.pathname!==u.pathname||t.id!==s)return[3,9];switch(n){case"getInfo":return[3,1];case"getToken":return[3,2];case"heightChange":return[3,4];case"callAction":return[3,5];case"onMethodChange":return[3,6];case"onError":return[3,7]}return[3,8];case 1:return Un(o,n,{appId:window.APP_ID,zaloVersion:sn(),appPlatform:null===(c=ze())||void 0===c?void 0:c.platformName}),[3,9];case 2:return[4,Tn.jumpAndGetToken()];case 3:return m.sent(),d=null===(l=Tn.miniProgramConfig)||void 0===l?void 0:l.jwt,Un(o,n,{jwt:d}),[3,9];case 4:return o.style.height="".concat(t.payload,"px"),[3,9];case 5:return p=t.payload,f=p.actionName,h=p.actionData,String(f).length>0&&gn(f,h,{success:function(e){Un(o,n,{status:0,actionName:f,data:e})},fail:function(e){Un(o,n,{status:-1,actionName:f,data:e})}},{}),[3,9];case 6:return null==r||r.apply(void 0,Re(Object.values(t.payload))),[3,9];case 7:null==i||i(t.payload),m.label=8;case 8:return[3,9];case 9:return[2]}}))}));return function(t){return e.apply(this,arguments)}}(),window.addEventListener("message",md,!1))}catch(e){console.log(e)}return[2,Promise.resolve()]}return We.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Ge("showWidget",{}))]}))}));return function(t){return e.apply(this,arguments)}}())]}))})),yd.apply(this,arguments)}var gd,_d=[Pi({amount:Hi.union([Hi.string(),Hi.number()]),desc:Hi.string(),payload:Hi.object({}).catchall(Hi.any()).optional()}).catchall(Hi.any())];function wd(){return wd=ke((function(e){return xe(this,(function(n){return[2,Ln("purchase",_d,[e],function(){var e=ke((function(e){return xe(this,(function(n){return We.isMp?[2,new Promise((function(n,r){var i=document.getElementById(Se),o=new URL(Ae.CHECKOUT_KIT);if(!(i&&cn(i,HTMLIFrameElement)&&i.src.startsWith(o.origin)&&i.src.includes(o.pathname)))return r(Ge("purchase",{message:"Widget not found or not initialized."}));e.amount,e.desc,e.payload;var a=t(e,["amount","desc","payload"]),s="purchase";Un(i,s,He({amount:String(e.amount),desc:e.desc,payload:e.payload||{}},a)),window.removeEventListener("message",gd,!1),gd=function(){var e=ke((function(e){var t,i,a;return xe(this,(function(u){if(t=e.data,e.origin.startsWith(Ie)&&(i=t.type,(a=new URL(t.href)).origin===o.origin&&a.pathname===o.pathname&&t.id===Se)){if(i===s)return[2,n(t.payload)];if("onError"===i)return[2,r(t.payload)]}return[2]}))}));return function(t){return e.apply(this,arguments)}}(),window.addEventListener("message",gd,!1)}))]:We.isMpWeb?[2,Promise.resolve({orderId:"",messageToken:"",transId:""})]:[2,Promise.reject(Ge("purchase",{}))]}))}));return function(t){return e.apply(this,arguments)}}())]}))})),wd.apply(this,arguments)}var Td={showWidget:function(e){return yd.apply(this,arguments)},purchase:function(e){return wd.apply(this,arguments)}};window.ZaloMiniAppSDK={getVersion:Gn},jn();var bd=Object.freeze({__proto__:null,get Events(){return e.Events},get EventName(){return e.Events},get CameraEvents(){return e.CameraEvents},AppError:dn,login:jn,getAccessToken:Zn,getVersion:Gn,getSystemInfo:Hn,setNavigationBarTitle:Qi,setNavigationBarColor:Xi,setNavigationBarLeftButton:no,setStorage:ko,getStorage:Mo,getStorageInfo:xo,removeStorage:Lo,clearStorage:Zo,getUserInfo:Go,getNetworkType:Jo,onNetworkStatusChange:Yo,startBeaconDiscovery:ea,stopBeaconDiscovery:ra,getBeacons:aa,closeApp:ca,scanQRCode:pa,openProfile:va,openChat:wa,openPostFeed:Sa,followOA:ka,unfollowOA:Ra,openShareSheet:ja,requestCameraPermission:za,createShortcut:Ka,openBioAuthentication:Ya,checkStateBioAuthentication:es,showToast:is,hideKeyboard:ss,openPhone:ds,openSMS:ms,viewOAQr:_s,keepScreen:Es,onKeepScreen:Ss,offKeepScreen:As,saveImageToGallery:Ns,saveVideoToGallery:Ds,openMiniApp:Bs,vibrate:Fs,openWebview:Ks,getRouteParams:Qs,getAppInfo:Ys,sendDataToPreviousMiniApp:tu,getPhoneNumber:iu,openProfilePicker:uu,connectWifi:pu,openMediaPicker:vu,getShareableLink:_u,closeLoading:bu,requestUpdateZalo:Pu,onConfirmToExit:Ou,offConfirmToExit:ku,getDeviceId:Cu,getDeviceIdAsync:Nu,getContext:Ru,getContextAsync:xu,getAuthCode:Uu,getZPIToken:ju,setAccessToken:zu,openOutApp:Fu,chooseImage:Hu,getLocation:qu,onCallbackData:$u,createOrder:nc,purchase:sc,selectPaymentMethod:dc,checkTransaction:hc,createOrderIAP:gc,events:Iu,setAndroidBottomNavigationBar:Tc,setIOSBottomSafeArea:Pc,setStatusBar:Ac,configAppView:Cc,minimizeApp:Rc,openPermissionSetting:Uc,favoriteApp:Bc,openGroupList:Wc,requestSendNotification:Vc,addRating:Jc,interactOA:el,interactOa:el,isAllowedInteractWithOA:rl,getSetting:ol,authorize:cl,checkZaloCameraPermission:pl,getUserID:hl,getIDToken:yl,createCameraContext:Pl,setupAd:Il,loadAd:kl,displayAd:Ml,refreshAd:Dl,showOAWidget:Bl,showFunctionButtonWidget:Fl,scanNFC:Kl,checkNFC:Ql,nativeStorage:td,Payment:nd,CheckoutSDK:rd,downloadFile:ad,trackingManager:dd,showCustomOAWidget:fd,CheckoutKit:Td,get FacingMode(){return e.FacingMode},get PhotoFormat(){return e.PhotoFormat},get PhotoQuality(){return e.PhotoQuality},get StreamType(){return e.StreamType},ZMACameraImp:Tl}),Ed=t(bd,["createOrder","checkTransaction","createOrderIAP","selectPaymentMethod","purchase"]);!function(){var e,t=null===(e=ze())||void 0===e?void 0:e.appEnv;(null==t?void 0:t.isMp)&&(window.ZaloMiniAppSDK={},Object.assign(window.ZaloMiniAppSDK,bd))}(),e.AppError=dn,e.CheckoutKit=Td,e.CheckoutSDK=rd,e.EventName=e.Events,e.Payment=nd,e.ZMACameraImp=Tl,e.addRating=Jc,e.authorize=cl,e.checkNFC=Ql,e.checkStateBioAuthentication=es,e.checkTransaction=hc,e.checkZaloCameraPermission=pl,e.chooseImage=Hu,e.clearStorage=Zo,e.closeApp=ca,e.closeLoading=bu,e.configAppView=Cc,e.connectWifi=pu,e.createCameraContext=Pl,e.createOrder=nc,e.createOrderIAP=gc,e.createShortcut=Ka,e.default=Ed,e.displayAd=Ml,e.downloadFile=ad,e.events=Iu,e.favoriteApp=Bc,e.followOA=ka,e.getAccessToken=Zn,e.getAppInfo=Ys,e.getAuthCode=Uu,e.getBeacons=aa,e.getContext=Ru,e.getContextAsync=xu,e.getDeviceId=Cu,e.getDeviceIdAsync=Nu,e.getIDToken=yl,e.getLocation=qu,e.getNetworkType=Jo,e.getPhoneNumber=iu,e.getRouteParams=Qs,e.getSetting=ol,e.getShareableLink=_u,e.getStorage=Mo,e.getStorageInfo=xo,e.getSystemInfo=Hn,e.getUserID=hl,e.getUserInfo=Go,e.getVersion=Gn,e.getZPIToken=ju,e.hideKeyboard=ss,e.interactOA=el,e.interactOa=el,e.isAllowedInteractWithOA=rl,e.keepScreen=Es,e.loadAd=kl,e.login=jn,e.minimizeApp=Rc,e.nativeStorage=td,e.offConfirmToExit=ku,e.offKeepScreen=As,e.onCallbackData=$u,e.onConfirmToExit=Ou,e.onKeepScreen=Ss,e.onNetworkStatusChange=Yo,e.openBioAuthentication=Ya,e.openChat=wa,e.openGroupList=Wc,e.openMediaPicker=vu,e.openMiniApp=Bs,e.openOutApp=Fu,e.openPermissionSetting=Uc,e.openPhone=ds,e.openPostFeed=Sa,e.openProfile=va,e.openProfilePicker=uu,e.openSMS=ms,e.openShareSheet=ja,e.openWebview=Ks,e.purchase=sc,e.refreshAd=Dl,e.removeStorage=Lo,e.requestCameraPermission=za,e.requestSendNotification=Vc,e.requestUpdateZalo=Pu,e.saveImageToGallery=Ns,e.saveVideoToGallery=Ds,e.scanNFC=Kl,e.scanQRCode=pa,e.selectPaymentMethod=dc,e.sendDataToPreviousMiniApp=tu,e.setAccessToken=zu,e.setAndroidBottomNavigationBar=Tc,e.setIOSBottomSafeArea=Pc,e.setNavigationBarColor=Xi,e.setNavigationBarLeftButton=no,e.setNavigationBarTitle=Qi,e.setStatusBar=Ac,e.setStorage=ko,e.setupAd=Il,e.showCustomOAWidget=fd,e.showFunctionButtonWidget=Fl,e.showOAWidget=Bl,e.showToast=is,e.startBeaconDiscovery=ea,e.stopBeaconDiscovery=ra,e.trackingManager=dd,e.unfollowOA=Ra,e.vibrate=Fs,e.viewOAQr=_s,Object.defineProperty(e,"__esModule",{value:!0})}));