zmp-sdk 2.39.8 → 2.40.0-beta.3

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/browser.min.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @timeBuild 30-07-2024 10:25:54
2
+ * @timeBuild 06-08-2024 11:36:05
3
3
  * @license zmp-sdk
4
4
  *
5
5
  * Copyright @ 2024. Zalo Group.
@@ -7,4 +7,4 @@
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(){"use strict";function e(e,t){if(null==e)return{};var n,r,i=function(e,t){if(null==e)return{};var n,r,i={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}var t,n=1048576,r=window.zAppID,i=window.APP_ID,o="https://zalo.me/s",a="https://h5.zdn.vn/zapps",s="h5.zdn.vn",u="/zapps",c={ZOAUTH:"h5.zdn.vn_zoauth",ZACC_SESSION:"h5.zdn.vn_zacc_session",JS_TOKEN:"h5.zdn.vn_zlink3rd",ZOAUTH_VRF:"h5.zdn.vn_zoauth_vrf",DEVICE_ID:"h5.zdn.vn_deviceID",CONTEXT_ID:"h5.zdn.vn_contextID",CONTEXT_TYPE:"h5.zdn.vn_contextType",UTOKEN_ZPI:"h5.zdn.vn_utoken_zpi",GTOKEN_ZPI:"h5.zdn.vn_gtoken_zpi",ZPP_ZPI:"h5.zdn.vn_zpp_zpi",ZPT_ZPI:"h5.zdn.vn_zpt_zpi"},l={GET_USER_INFO:"https://graph.zalo.me/v2.0/me",GET_ACCESS_TOKEN:"https://h5.zalo.me/openapi/access_token",GET_ACCESS_TOKEN_V3:"https://oauth.zaloapp.com/v3/access_token",GET_LIST_USER_INFO:"https://graph.zalo.me/v2.0/me/friends/list",CREATE_ORDER:"https://payment-mini.zalo.me/api/order/create",GET_APP_INFO:"https://h5.zalo.me/apps/get-info",SEND_ACTION_LOG:"https://h5.zalo.me/log/async",CREATE_SHARE_LINK:"https://h5.zalo.me/openapi/create-sharelink",CHECK_INTERACT_OA:"https://h5.zalo.me/openapi/check-interact-oa",GET_AUTH_SETTING:"https://h5.zalo.me/apis/users/auth-settings"};!function(e){e.REQUEST="REQUEST",e.MODIFIED_REQUEST="MODIFIED_REQUEST",e.RESPONSE="RESPONSE",e.MODIFIED_RESPONSE="MODIFIED_RESPONSE",e.NOT_FOUND="NOT_FOUND"}(t||(t={}));var d,p,f,h,m,v,y,g,_,w,b,T,E,S,P,O,A,I,k,C,N,M,x=0,R=-2e3,D=-1400,j=-1500,U=-1401,L=-1404,B=-1408,Z=-2004,z=-2005,W="Success",F="Unknown error. Please try again later.",G="Request timeout. Please try again later.",H="Please login (https://miniapp.zalo.me/docs/api/login) before to call this api",V="Login failed",K="This API is not supported in this version of Zalo",J="User Authentication Required. Please grant User Authentication permission before requesting User Permission",q="Unable to pick media",$="Unable to save image",Q={SUCCESS:{code:x,message:W},UNKNOWN_ERROR:{code:R,message:F},UNAUTHORIZED:{code:U,message:H},FORBIDDEN:{code:-1403,message:"You don't have permission to call this api"},CLIENT_NOT_SUPPORT:{code:L,message:K},DECODE_FAILED:{code:-2001,message:"Can not decode id. Please check your params again."},TIME_OUT:{code:B,message:G},USER_DENIED:{code:-2002,message:"User denied"},USER_CANCEL:{code:-2003,message:"User cancel"}},Y={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},UNFOLLOW_OA:{haveCallback:!0,requireAccessToken:!0},OPEN_GAMEDETAIL:{},OPEN_SHARESHEET:{haveCallback:!0,requireAccessToken:!0,errorList:{android:{"-101":{mapTo:Q.CLIENT_NOT_SUPPORT}},iOS:{"-101":{mapTo:Q.CLIENT_NOT_SUPPORT}}}},REQUEST_PERMISSION_CAMERA:{errorList:{android:{"-2":{mapTo:Q.USER_DENIED}},iOS:{"-2":{mapTo:Q.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:Q.USER_DENIED}},iOS:{"-1":{mapTo:Q.USER_DENIED}}}},QUERY_LOCATION_HIDE:{haveCallback:!0},SHOW_TOAST:{haveCallback:!0,timeout:2},OPEN_APP:{},HIDE_KEYBOARD:{},OPEN_PHONE:{},OPEN_QR:{},OPEN_SMS:{},VIEW_MYQR:{haveCallback:!0,timeout:!0,requireAccessToken:!0},KEEP_SCREEN:{haveCallback:!0,timeout:2},CHANGE_AUTOROTATE:{skipJump:!0},CHECK_APP_INSTALLED:{},QUERY_SHOW:{},QUERY_HIDE:{},OPEN_INAPPRW:{},ZALORUN_GETTRACKINGSTATUS:{haveCallback:!0},ZALORUN_SETTRACKINGSTATUS:{haveCallback:!0},ZALORUN_GETDAYSTEP:{haveCallback:!0},ZALORUN_FORCESUBMITDATA:{haveCallback:!0},ZALORUN_SETWEIGHT:{haveCallback:!0},OPEN_PROFILE_EXT:{},DOWNLOAD_CATE:{haveCallback:!0},JUMP_LOGIN:{skipJump:!0,whiteList:!0},OPEN_ADTIMA_ADS_INTERSTITIAL:{},OPEN_ADTIMA_ADS:{},GET_ADIDCLIENT:{},SCAN_IBEACON:{},INTERACTIVE_VIBRATION:{},SAVE_IMAGE_GALLERY:{versionLive:{iOS:408},errorList:{android:{"-101":{mapTo:{code:z,message:$},needMoreDetail:!0},"-102":{mapTo:{code:z,message:$},needMoreDetail:!0}},iOS:{"-10":{mapTo:{code:z,message:$},needMoreDetail:!0}}}},OPEN_MP:{versionLive:{iOS:402}},CHANGE_ACTIONBAR:{haveCallback:!0,timeout:2,versionLive:{iOS:402},skipJump:!0},ZBROWSER_MPDS:{haveCallback:!0,timeout:2,versionLive:{iOS:402}},WEBVIEW_SET_RESULT:{versionLive:{iOS:416}},MP_GET_NUMBER:{versionLive:{iOS:416},errorList:{android:{"-1":{mapTo:Q.USER_DENIED},"-101":{mapTo:Q.USER_DENIED}},iOS:{"-1":{mapTo:Q.USER_DENIED},"-10":{mapTo:Q.USER_DENIED}}}},MP_OPEN_PROFILE_PICKER:{requireAccessToken:!0,versionLive:{iOS:432},errorList:{android:{"-101":{mapTo:Q.USER_CANCEL}},iOS:{"-101":{mapTo:Q.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:Q.USER_CANCEL},999:{mapTo:{code:Z,message:q},needMoreDetail:!0}},iOS:{"-10":{mapTo:{code:Z,message:q}}}}},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:Q.USER_DENIED}},iOS:{"-1":{mapTo:Q.USER_DENIED}}}},MP_ADD_RATING:{skipJump:!1},MP_ADD_MYFAVORITES:{skipJump:!1},MP_INTERACT_OA:{skipJump:!1},MP_USER_AUTHORIZE:{skipJump:!1},MP_SELECT_PAYMENT_METHOD:{skipJump:!1}},X={android:{"-4":Q.DECODE_FAILED,"-5":Q.CLIENT_NOT_SUPPORT,"-14":Q.TIME_OUT},iOS:{"-9":Q.DECODE_FAILED,"-5":Q.CLIENT_NOT_SUPPORT,"-14":Q.TIME_OUT}},ee={android:12100615,iOS:460,wp:0,unknown:0},te=5*n,ne="https://payment-mini.zalo.me/api/order/create",re="https://payment-mini.zalo.me/api/order/iap-create",ie="https://payment-mini.zalo.me/api/transaction",oe="DEFERRED",ae="IMMEDIATE_AND_CHARGE_FULL_PRICE",se={SHOW_BACK:0,HIDE_BACK:3,SHOW_HOME:1,HIDE_HOME:0},ue=5,ce=6,le="#1843EF",de=0,pe={"-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 fe(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 he(e){return function(){var t=this,n=arguments;return new Promise((function(r,i){var o=e.apply(t,n);function a(e){fe(o,r,i,a,s,"next",e)}function s(e){fe(o,r,i,a,s,"throw",e)}a(void 0)}))}}function me(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 ve(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function ye(e,t){if(e){if("string"==typeof e)return me(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)?me(e,t):void 0}}function ge(e){return function(e){if(Array.isArray(e))return me(e)}(e)||ve(e)||ye(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 _e(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 we(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,ge(n))}catch(e){return"undefined"!=typeof console&&console.error&&console.error(e),null}}}function be(e){var t=new URL(window.location.href).searchParams.get("env");return{isMp:window.location.hostname.includes(s)&&("TESTING_LOCAL"==t||window.location.pathname.startsWith(u)),isMpWeb:window.location.hostname.includes("localhost")}}we.async=function(e){return he((function(){var t,n,r,i,o=arguments;return _e(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,ge(n))];case 2:return[2,a.sent()];case 3:return i=a.sent(),"undefined"!=typeof console&&console.error&&console.error(i),[2,null];case 4:return[2]}}))}))},function(e){e.none="none",e.wifi="wifi",e.cellular="cellular",e.unknown="unknown"}(d||(d={})),function(e){e.wp="wp",e.android="android",e.iOS="iOS",e.unknown="unknown"}(p||(p={})),function(e){e.AppPaused="h5.event.paused",e.AppResumed="h5.event.resumed",e.NetworkChanged="h5.event.connection.changed",e.OnDataCallback="h5.event.webview.result",e.WebviewClosed="h5.event.webview.close",e.OpenApp="h5.event.open.mp",e.AppClose="h5.event.action.close",e.PaymentCallback="payment.callback",e.PaymentResult="action.payment.result",e.PaymentClose="action.payment.close"}(f||(f={})),function(e){e.DOING="doing",e.DONE="done"}(h||(h={})),function(e){e[e.user=1]="user",e[e.oa=0]="oa",e[e.aliasOA=2]="aliasOA"}(m||(m={})),function(e){e[e.user=1]="user",e[e.oa=0]="oa"}(v||(v={})),function(e){e[e.image=1]="image",e[e.link=4]="link",e[e.profile=5]="profile"}(y||(y={})),function(e){e[e.image=1]="image",e[e.gif=11]="gif",e[e.video=12]="video",e[e.link=4]="link",e[e.oa=5]="oa",e[e.zmp=20]="zmp",e[e.multi_image=21]="multi_image",e[e.zmp_deep_link=4]="zmp_deep_link",e[e.text=22]="text"}(g||(g={})),function(e){e[e.auto=1]="auto",e[e.portrait=2]="portrait",e[e.landscape=3]="landscape"}(_||(_={})),function(e){e[e.oneShot=0]="oneShot"}(w||(w={})),function(e){e[e.zcamera=3]="zcamera",e[e.zcamera_photo=1]="zcamera_photo",e[e.zcamera_video=2]="zcamera_video",e[e.zcamera_scan=7]="zcamera_scan",e[e.photo=4]="photo",e[e.video=5]="video",e[e.file=6]="file"}(b||(b={})),function(e){e.SUBSCRIPTION="SUBSCRIPTION",e.ONETIME="ONETIME"}(T||(T={})),function(e){e[e.UNKNOW=0]="UNKNOW",e[e.DEFERRED=1]="DEFERRED",e[e.IMMEDIATE_AND_CHARGE_FULL_PRICE=2]="IMMEDIATE_AND_CHARGE_FULL_PRICE"}(E||(E={})),function(e){e[e.normal=1]="normal",e[e.hidden=0]="hidden",e[e.transparent=2]="transparent"}(S||(S={})),function(e){e[e.show=1]="show",e[e.hide=0]="hide"}(P||(P={})),function(e){e[e.show=1]="show",e[e.hide=0]="hide"}(O||(O={})),function(e){e[e.left=0]="left",e[e.center=1]="center"}(A||(A={})),function(e){e.OnFrameCallback="h5.event.camera.frame",e.OnStartCallback="h5.event.camera.start",e.OnStopCallback="h5.event.camera.stop"}(I||(I={})),function(e){e.FRONT="user",e.BACK="environment"}(k||(k={})),function(e){e.WEBP="image/webp",e.PNG="image/png",e.JPEG="image/jpeg"}(C||(C={})),function(e){e.HIGH="high",e.NORMAL="normal",e.LOW="low"}(N||(N={})),function(e){e.VIDEO="video",e.AUDIO="audio"}(M||(M={}));var Te,Ee=function(e){return e.isAndroid?p.android:e.isIOS?p.iOS:p.unknown};function Se(e){var t=e.split("zalo")[1];return t&&t.replace(" ","").split("/")[1]||""}function Pe(){var e=function(){var e=we((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:be(),platform:t,platformName:Ee(t),zaloVersion:Se(e).trim()}}}();if(e)return e}var Oe=(null===(Te=Pe())||void 0===Te?void 0:Te.appEnv)||{};function Ae(e){Ae.on&&Ae.engine(e)}Ae.on=!1,Ae.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 Ie=function(e,n){var r,i={error:-1404,errorMessage:"".concat(e," is not found")};null==n||null===(r=n.fail)||void 0===r||r.call(n,i),Ae({stage:t.NOT_FOUND,type:"error",name:e,request:n,state:"fail",response:i})};function ke(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Ce(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){ke(e,t,n[t])}))}return e}function Ne(e,t){return function(e){if(Array.isArray(e))return e}(e)||ve(e)||ye(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 Me="undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{};function xe(){throw new Error("setTimeout has not been defined")}function Re(){throw new Error("clearTimeout has not been defined")}var De=xe,je=Re;function Ue(e){if(De===setTimeout)return setTimeout(e,0);if((De===xe||!De)&&setTimeout)return De=setTimeout,setTimeout(e,0);try{return De(e,0)}catch(t){try{return De.call(null,e,0)}catch(t){return De.call(this,e,0)}}}"function"==typeof Me.setTimeout&&(De=setTimeout),"function"==typeof Me.clearTimeout&&(je=clearTimeout);var Le,Be=[],Ze=!1,ze=-1;function We(){Ze&&Le&&(Ze=!1,Le.length?Be=Le.concat(Be):ze=-1,Be.length&&Fe())}function Fe(){if(!Ze){var e=Ue(We);Ze=!0;for(var t=Be.length;t;){for(Le=Be,Be=[];++ze<t;)Le&&Le[ze].run();ze=-1,t=Be.length}Le=null,Ze=!1,function(e){if(je===clearTimeout)return clearTimeout(e);if((je===Re||!je)&&clearTimeout)return je=clearTimeout,clearTimeout(e);try{je(e)}catch(t){try{return je.call(null,e)}catch(t){return je.call(this,e)}}}(e)}}function Ge(e,t){this.fun=e,this.array=t}Ge.prototype.run=function(){this.fun.apply(null,this.array)};function He(){}var Ve=He,Ke=He,Je=He,qe=He,$e=He,Qe=He,Ye=He;var Xe=Me.performance||{},et=Xe.now||Xe.mozNow||Xe.msNow||Xe.oNow||Xe.webkitNow||function(){return(new Date).getTime()};var tt=new Date;var nt,rt={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];Be.push(new Ge(e,t)),1!==Be.length||Ze||Ue(Fe)},title:"browser",browser:!0,env:{},argv:[],version:"",versions:{},on:Ve,addListener:Ke,once:Je,off:qe,removeListener:$e,removeAllListeners:Qe,emit:Ye,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*et.call(Xe),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-tt)/1e3}},it=rt,ot="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function at(e){return e&&e.constructor===Symbol?"symbol":typeof e}function st(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 ot?ot:"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 it&&it.env&&"true"===it.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(!V(t))throw new TypeError;return S(e,t)}if(!G(e))throw new TypeError;if(!L(t))throw new TypeError;if(!L(r)&&!D(r)&&!j(r))throw new TypeError;return j(r)&&(r=void 0),P(e,t,n=F(n),r)}function m(e,t){function n(n,r){if(!L(n))throw new TypeError;if(!D(r)&&!K(r))throw new TypeError;N(e,t,n,r)}return n}function v(e,t,n,r){if(!L(n))throw new TypeError;return D(r)||(r=F(r)),N(e,t,n,r)}function y(e,t,n){if(!L(t))throw new TypeError;return D(n)||(n=F(n)),A(e,t,n)}function g(e,t,n){if(!L(t))throw new TypeError;return D(n)||(n=F(n)),I(e,t,n)}function _(e,t,n){if(!L(t))throw new TypeError;return D(n)||(n=F(n)),k(e,t,n)}function w(e,t,n){if(!L(t))throw new TypeError;return D(n)||(n=F(n)),C(e,t,n)}function b(e,t){if(!L(e))throw new TypeError;return D(t)||(t=F(t)),M(e,t)}function T(e,t){if(!L(e))throw new TypeError;return D(t)||(t=F(t)),x(e,t)}function E(e,t,n){if(!L(t))throw new TypeError;D(n)||(n=F(n));var r=O(t,n,!1);if(D(r))return!1;if(!r.delete(e))return!1;if(r.size>0)return!0;var i=f.get(t);return i.delete(n),i.size>0||f.delete(t),!0}function S(e,t){for(var n=e.length-1;n>=0;--n){var r=(0,e[n])(t);if(!D(r)&&!j(r)){if(!V(r))throw new TypeError;t=r}}return t}function P(e,t,n,r){for(var i=e.length-1;i>=0;--i){var o=(0,e[i])(t,n,r);if(!D(o)&&!j(o)){if(!L(o))throw new TypeError;r=o}}return r}function O(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(I(e,t,n))return!0;var r=X(t);return!j(r)&&A(e,r,n)}function I(e,t,n){var r=O(t,n,!1);return!D(r)&&z(r.has(e))}function k(e,t,n){if(I(e,t,n))return C(e,t,n);var r=X(t);return j(r)?void 0:k(e,r,n)}function C(e,t,n){var r=O(t,n,!1);if(!D(r))return r.get(e)}function N(e,t,n,r){O(n,r,!0).set(e,t)}function M(e,t){var n=x(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 x(e,t){var n=[],r=O(e,t,!1);if(D(r))return n;for(var i=q(r.keys()),o=0;;){var a=Q(i);if(!a)return n.length=o,n;var s=$(a);try{n[o]=s}catch(e){try{Y(i)}finally{throw e}}o++}}function R(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 j(e){return null===e}function U(e){return"symbol"==typeof e}function L(e){return"object"==typeof e?null!==e:"function"==typeof e}function B(e,t){switch(R(e)){case 0:case 1:case 2:case 3:case 4:case 5:return e}var n=3===t?"string":5===t?"number":"default",i=J(e,r);if(void 0!==i){var o=i.call(e,n);if(L(o))throw new TypeError;return o}return Z(e,"default"===n?"number":n)}function Z(e,t){if("string"===t){var n=e.toString;if(H(n))if(!L(i=n.call(e)))return i;if(H(r=e.valueOf))if(!L(i=r.call(e)))return i}else{var r;if(H(r=e.valueOf))if(!L(i=r.call(e)))return i;var i,o=e.toString;if(H(o))if(!L(i=o.call(e)))return i}throw new TypeError}function z(e){return!!e}function W(e){return""+e}function F(e){var t=B(e,3);return U(t)?t:W(t)}function G(e){return Array.isArray?Array.isArray(e):e instanceof Object?e instanceof Array:"[object Array]"===Object.prototype.toString.call(e)}function H(e){return"function"==typeof e}function V(e){return"function"==typeof e}function K(e){switch(R(e)){case 3:case 4:return!0;default:return!1}}function J(e,t){var n=e[t];if(null!=n){if(!H(n))throw new TypeError;return n}}function q(e){var t=J(e,i);if(!H(t))throw new TypeError;var n=t.call(e);if(!L(n))throw new TypeError;return n}function $(e){return e.value}function Q(e){var t=e.next();return!t.done&&t}function Y(e){var t=e.return;t&&t.call(e)}function X(e){var t=Object.getPrototypeOf(e);if("function"!=typeof e||e===c)return t;if(t!==c)return t;var n=e.prototype,r=n&&Object.getPrototypeOf(n);if(null==r||r===Object.prototype)return t;var i=r.constructor;return"function"!=typeof i||i===e?t:i}function ee(){var e={},t=[],n=function(){function e(e,t,n){this._index=0,this._keys=e,this._values=t,this._selector=n}return e.prototype["@@iterator"]=function(){return this},e.prototype[i]=function(){return this},e.prototype.next=function(){var e=this._index;if(e>=0&&e<this._keys.length){var n=this._selector(this._keys[e],this._values[e]);return e+1>=this._keys.length?(this._index=-1,this._keys=t,this._values=t):this._index++,{value:n,done:!1}}return{value:void 0,done:!0}},e.prototype.throw=function(e){throw this._index>=0&&(this._index=-1,this._keys=t,this._values=t),e},e.prototype.return=function(e){return this._index>=0&&(this._index=-1,this._keys=t,this._values=t),{value:e,done:!0}},e}();return function(){function t(){this._keys=[],this._values=[],this._cacheKey=e,this._cacheIndex=-2}return Object.defineProperty(t.prototype,"size",{get:function(){return this._keys.length},enumerable:!0,configurable:!0}),t.prototype.has=function(e){return this._find(e,!1)>=0},t.prototype.get=function(e){var t=this._find(e,!1);return t>=0?this._values[t]:void 0},t.prototype.set=function(e,t){var n=this._find(e,!0);return this._values[n]=t,this},t.prototype.delete=function(t){var n=this._find(t,!1);if(n>=0){for(var r=this._keys.length,i=n+1;i<r;i++)this._keys[i-1]=this._keys[i],this._values[i-1]=this._values[i];return this._keys.length--,this._values.length--,t===this._cacheKey&&(this._cacheKey=e,this._cacheIndex=-2),!0}return!1},t.prototype.clear=function(){this._keys.length=0,this._values.length=0,this._cacheKey=e,this._cacheIndex=-2},t.prototype.keys=function(){return new n(this._keys,this._values,r)},t.prototype.values=function(){return new n(this._keys,this._values,o)},t.prototype.entries=function(){return new n(this._keys,this._values,a)},t.prototype["@@iterator"]=function(){return this.entries()},t.prototype[i]=function(){return this.entries()},t.prototype._find=function(e,t){return this._cacheKey!==e&&(this._cacheIndex=this._keys.indexOf(this._cacheKey=e)),this._cacheIndex<0&&t&&(this._cacheIndex=this._keys.length,this._keys.push(e),this._values.push(void 0)),this._cacheIndex},t}();function r(e,t){return e}function o(e,t){return t}function a(e,t){return[e,t]}}function te(){return function(){function e(){this._map=new d}return Object.defineProperty(e.prototype,"size",{get:function(){return this._map.size},enumerable:!0,configurable:!0}),e.prototype.has=function(e){return this._map.has(e)},e.prototype.add=function(e){return this._map.set(e,e),this},e.prototype.delete=function(e){return this._map.delete(e)},e.prototype.clear=function(){this._map.clear()},e.prototype.keys=function(){return this._map.keys()},e.prototype.values=function(){return this._map.values()},e.prototype.entries=function(){return this._map.entries()},e.prototype["@@iterator"]=function(){return this.keys()},e.prototype[i]=function(){return this.keys()},e}()}function ne(){var e=16,n=u.create(),r=i();return function(){function e(){this._key=i()}return e.prototype.has=function(e){var t=o(e,!1);return void 0!==t&&u.has(t,this._key)},e.prototype.get=function(e){var t=o(e,!1);return void 0!==t?u.get(t,this._key):void 0},e.prototype.set=function(e,t){return o(e,!0)[this._key]=t,this},e.prototype.delete=function(e){var t=o(e,!1);return void 0!==t&&delete t[this._key]},e.prototype.clear=function(){this._key=i()},e}();function i(){var e;do{e="@@WeakMap@@"+c()}while(u.has(n,e));return n[e]=!0,e}function o(e,n){if(!t.call(e,r)){if(!n)return;Object.defineProperty(e,r,{value:u.create()})}return e[r]}function a(e,t){for(var n=0;n<t;++n)e[n]=255*Math.random()|0;return e}function s(e){return"function"==typeof Uint8Array?"undefined"!=typeof crypto?crypto.getRandomValues(new Uint8Array(e)):"undefined"!=typeof msCrypto?msCrypto.getRandomValues(new Uint8Array(e)):a(new Uint8Array(e),e):a(new Array(e),e)}function c(){var t=s(e);t[6]=79&t[6]|64,t[8]=191&t[8]|128;for(var n="",r=0;r<e;++r){var i=t[r];4!==r&&6!==r&&8!==r||(n+="-"),i<16&&(n+="0"),n+=i.toString(16).toLowerCase()}return n}}function re(e){return e.__=void 0,delete e.__,e}e("decorate",h),e("metadata",m),e("defineMetadata",v),e("hasMetadata",y),e("hasOwnMetadata",g),e("getMetadata",_),e("getOwnMetadata",w),e("getMetadataKeys",b),e("getOwnMetadataKeys",T),e("deleteMetadata",E)}(r)}()}(nt||(nt={}));var ut=Object.prototype.toString;var ct="[object Null]",lt="[object Undefined]";function dt(e){return null==e?void 0===e?lt:ct:function(e){return ut.call(e)}(e)}function pt(e){return null!=e&&"object"==typeof e}var ft={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||pt(e)&&"[object Number]"==dt(e)},isArray:function(e){return Array.isArray(e)},isRegExp:function(e){return pt(e)&&"[object RegExp]"==dt(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 ht(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function mt(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 vt(e){return vt=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},vt(e)}function yt(e){return vt(e)}function gt(e,t,n){return gt="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=yt(e)););return e}(e,t);if(r){var i=Object.getOwnPropertyDescriptor(r,t);return i.get?i.get.call(n||e):i.value}},gt(e,t,n)}function _t(e,t,n){return gt(e,t,n)}function wt(e,t){return wt=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},wt(e,t)}function bt(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&&wt(e,t)}function Tt(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Et(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=yt(e);if(t){var i=yt(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return function(e,t){return!t||"object"!==at(t)&&"function"!=typeof t?Tt(e):t}(this,n)}}var St,Pt,Ot=(St=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},St(Pt={exports:{}},Pt.exports),Pt.exports),At="ACTION_CALLBACK";var It=function(e){bt(n,e);var t=Et(n);function n(){var e;return ht(this,n),(e=t.apply(this,arguments)).debug=st("zmp:event-emitter"),e}var r=n.prototype;return r.h5ConfirmHandleEvent=function(e,t,n){ZaloJavaScriptInterface.jsH5EventCallback(e,t,n||"")},r.on=function(e,t,r){var i=this;if(e===At||e===f.PaymentCallback)return _t(yt(n.prototype),"on",this).call(this,e,t,r);this.debug("register ".concat(String(e),": ").concat(r));return _t(yt(n.prototype),"on",this).call(this,e,(function(n,o){i.h5ConfirmHandleEvent(n,e,r),t(o)}),r)},r.once=function(e,t,r){var i=this;if(e===At)return _t(yt(n.prototype),"once",this).call(this,e,t,r);this.debug("register once ".concat(String(e),": ").concat(r));return _t(yt(n.prototype),"once",this).call(this,e,(function(n,o){i.h5ConfirmHandleEvent(n,e,r),t(o)}),r)},n.getInstance=function(){return n.instance||(n.instance=new n),n.instance},n}(Ot);function kt(e){It.getInstance().emit(At,e)}function Ct(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){kt({serialId:e,actionName:t,result:n})}},window.zaloJSV2={zalo_h5_event_handler:function(e,t,n){var r=st("zmp:zalo_h5_event_handler");r("eventId: ".concat(e,", eventName: ").concat(t,", eventData: ").concat(n));var o=an(n);r("stringToData",o);var a=function(e,t){try{if(e===f.OpenApp){var n=t.url,r=new URL(n),o=r.pathname.split("/zapps/".concat(i))[1];return{path:"".concat(o||"/").concat(r.search)}}return t}catch(e){return t}}(t,o);It.getInstance().emit(t,e,a)}},window.zaloNative2JS={nativeCall:function(e,t,n){It.getInstance().emit(f.PaymentCallback,e,t,n)}};var Nt={encode:Ct,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:Ct(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":at(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":at(r))?JSON.stringify(r):encodeURIComponent(r)].join("=");n.push(i)})),n.join("&")}},Mt={},xt=function(e,t,n){var r=t||"default";return function(){return(r in Mt?Mt[r](e,n):e).apply(this,arguments)}};xt.setWrapper=function(e){Mt[arguments.length<=1||void 0===arguments[1]?"default":arguments[1]]=e};var Rt={error:{code:1,error_subcode:1357046,message:"Received Invalid JSON reply.",type:"http"}};function Dt(e){try{return null===e?Rt:JSON.parse(e)}catch(e){return Rt}}var jt,Ut={execute:function(e,t,n,r){n.suppress_http_code=1;var i=Nt.encode(n);"post"!=t&&(e=Nt.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=xt((function(){o=r,"onload"in i&&i.onload(n)}),"entry","XMLHttpRequest:load"),a=xt((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(Dt(e.responseText))},o.onerror=function(e){e.responseText?r(Dt(e.responseText)):r({error:{code:1,error_subcode:1357045,message:"unknown error (empty response)",status:e.status,type:"http"}})},o.send(i),!0)}},Lt=Ut,Bt=(jt=he((function(e,t,n){var r,i,o,a;return _e(this,(function(s){switch(s.label){case 0:return r={appId:e,versionStatus:t},ft.isUndefined(n)||(r.currentVersion=n),i=Nt.appendToUrl(l.GET_APP_INFO,r),[4,fetch(i,{credentials:"include"})];case 1:return(o=s.sent()).ok?[4,o.json()]:[3,3];case 2:if((a=s.sent()).err<0||!a.data)throw new Error(a);return[2,{name:a.data.name,version:a.data.version,description:a.data.description,appUrl:a.data.appUrl,qrCodeUrl:a.data.qrCodeUrl,logoUrl:a.data.logoUrl,cateID:a.data.cateType}];case 3:throw new Error("Can't get app info")}}))})),function(e,t,n){return jt.apply(this,arguments)});function Zt(e){try{var t=e.map((function(e){return{action:e.action,error:e.error,message:e.message,data:e.data}}));Lt.execute(l.SEND_ACTION_LOG,"post",{appId:window.APP_ID,data:JSON.stringify(t)},(function(){})),window.zmpSentry&&window.zmpSentry.captureMessage("Result from native",{extra:{data:e}})}catch(e){}}var zt=function(e){return e.replace(/[A-Z]/g,(function(e){return"_".concat(e.toLowerCase())}))},Wt=function(){var e,t,n=Number((null===(e=Pe())||void 0===e?void 0:e.zaloVersion)||""),r=((null===(t=Pe())||void 0===t?void 0:t.platformName)||"").toLowerCase();return"android"===r?n%1e4:n};function Ft(e,t){return null!=t&&"undefined"!=typeof Symbol&&t[Symbol.hasInstance]?!!t[Symbol.hasInstance](e):e instanceof t}var Gt,Ht,Vt=function(){function e(t,n,r,i){ht(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}(),Kt=function(e,t){return Ft(e,Vt)?function(e,t){return e.api=t,e.toJSON()}(e,t):function(e,t){return Ft(e,Error)?new Vt(R,e.message,t).toJSON():ft.isEmpty(null==e?void 0:e.message)||ft.isEmpty(null==e?void 0:e.code)?new Vt(R,F,t,e).toJSON():new Vt(e.code,e.message,t,e.detail).toJSON()}(e,t)},Jt=(Gt=he((function(e){var t;return _e(this,(function(n){switch(n.label){case 0:return t={headers:{"Content-Type":"application/x-www-form-urlencoded",authorization:"Bearer ".concat(e)}},[4,fetch(l.GET_AUTH_SETTING,Ce({method:"GET"},t))];case 1:return[4,n.sent().json()];case 2:return[2,n.sent()]}}))})),function(e){return Gt.apply(this,arguments)}),qt=he((function(){return _e(this,(function(e){return[2,new Promise(function(){var e=he((function(e,t){var n,r,i,o;return _e(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 Vt(U,H,"getSetting")),[4,Jt(r)];case 2:return(i=a.sent())&&0===i.err?e({authSetting:i.data}):t(new Vt(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)}}())]}))})),$t=function(){var e,t,n,r=Pe(),i={},o=It.getInstance(),a=[],s=!1;return s||(t=function(e){var t=e.serialId,n=sn(e.result),r=dn(null==n?void 0:n.action),o=ft.isEmpty(null==n?void 0:n.error_code)?0:null==n?void 0:n.error_code,s=null==n?void 0:n.error_message,u=(null==n?void 0:n.data)||n;if(r&&0===o){var c=JSON.parse(null==n?void 0:n.data);o=ft.isEmpty(null==c?void 0:c.error_code)?0:null==c?void 0:c.error_code,s=null==c?void 0:c.error_message,u=(null==c?void 0:c.data)||c}var l={error_code:o,error_message:s,data:u,action:(null==n?void 0:n.action)||e.actionName};if(t&&i[t]){var d=i[t],p=d.callback,f=d.timeout,h=d.isMultiCallback,m=d.options;!function(e,t){var n=t||{},r=n.success,i=n.fail;0===e.error_code?ft.isFunction(r)&&r(e):ft.isFunction(i)&&i(e)}(l,p),!h&&delete i[t],f&&clearTimeout(f);var v={action:null==l?void 0:l.action,error:null==l?void 0:l.error_code,message:null==l?void 0:l.error_message,data:{}};try{if("action.open.inapp"===l.action||"action.open.outapp"===l.action){var y=new URL(null==m?void 0:m.url),g="".concat(y.protocol,"//").concat(y.host).concat(y.pathname);v.data={url:g}}if("action.follow.oa"===l.action||"action.unfollow.oa"===l.action){var _=null==m?void 0:m.uid;v.data={uid:_}}if("action.open.chat"===l.action){var w=null==m?void 0:m.uId,b=null==m?void 0:m.type;v.data={uid:w,openChatType:b}}}catch(e){}a.push(v)}},It.getInstance().on(At,t),o.on(f.AppPaused,(function(){if(a.length>0){var e=a;a=[],Zt(e)}})),e?clearInterval(e):e=setInterval((function(){if(a.length>0){var e=a;a=[],Zt(e)}}),5e3),s=!0),n=he((function(e,t,n,o){var a,s,u,c,l,d,p,f,h,m,v,y,g,_,w,b,T,E,S,P,O,A;return _e(this,(function(I){switch(I.label){case 0:return s=Math.floor(1e6*Math.random()),u="".concat(e,"_").concat(s),c="action.".concat(e.replace(/\_/g,".").toLowerCase()),(null==o?void 0:o.actionName)&&o.actionName.length>0&&(c=null==o?void 0:o.actionName),l=(null==o?void 0:o.isMultiCallback)||!1,d=!1!==(null==o?void 0:o.timeout)&&((null==o?void 0:o.timeout)||!0),p=(null==o?void 0:o.haveCallback)||!1,f=(null==o?void 0:o.skipJump)||!1,h=(null==o?void 0:o.requireAccessToken)||!1,m=pn(c),t&&n&&(i[u]={options:t,callback:n,isMultiCallback:l},d&&p&&(i[u].timeout=setTimeout((function(){return kt({serialId:u,result:{error_code:B,error_message:G,data:{timeout:d},action:e}}),null}),!0===d?8e3:1e3*d))),m?[4,qt()]:[3,2];case 1:if(!1===(null==(y=I.sent())||null===(v=y.authSetting)||void 0===v?void 0:v["scope.userInfo"]))return kt({serialId:u,result:{error_code:U,error_message:J,data:{isMobile:null==r||null===(g=r.platform)||void 0===g?void 0:g.isMobile},action:e}}),[2];I.label=2;case 2:return _=dn(c),!(null==r||null===(a=r.platform)||void 0===a?void 0:a.isMobile)||!e||ft.isUndefined(ZaloJavaScriptInterface)||r.platform.isIOS&&!on(e)||_&&!1===_.isSupported?(kt({serialId:u,result:{error_code:L,error_message:K,data:{isMobile:null==r||null===(w=r.platform)||void 0===w?void 0:w.isMobile},action:e}}),[2]):(b=rn(t),f?[3,4]:[4,tn.getJSAccessToken()]);case 3:return E=I.sent(),[3,5];case 4:E="",I.label=5;case 5:T=E,I.label=6;case 6:return I.trys.push([6,10,,11]),f||!h?[3,8]:[4,tn.getAccessToken()];case 7:return P=I.sent(),[3,9];case 8:P="",I.label=9;case 9:return S=P,[3,11];case 10:return O=I.sent(),kt({serialId:u,result:{error_code:null==O?void 0:O.code,error_message:null==O?void 0:O.message,action:e}}),[2];case 11:return A=r.platform.isIOS?window.onNativeMessage(u,c):'window.onNativeMessage("'.concat(u,'", "').concat(c,'")'),[2,ZaloJavaScriptInterface.jsCall(T,c,S,b,A)]}}))})),function(e,t,r,i){return n.apply(this,arguments)}}(),Qt={success:function(e,t){return{code:x,message:t||W,data:e||{}}},error:{badRequest:function(e){return new Vt(D,e)},loginFailed:function(e){return new Vt(U,"".concat(V,": ").concat(e))},loginRequired:function(){return new Vt(U,H)},cannotGetShareInfo:function(){return new Vt(j,"Can not get app info to share")},createIAPOrderFailed:function(e){var t=Object.keys(pe).find((function(t){return t===e.toString()}));return new Vt(e,t||F)},clientNotSupport:function(){return new Vt(L,K)}}},Yt=(Ht=function(e){var t,n,r,i=null===(t=Pe())||void 0===t?void 0:t.platformName,o=e.action.replace("action.","").replace(/\./g,"_").toUpperCase(),a=Y[o],s=(null==a?void 0:a.skipJump)||!1,u=(null==a?void 0:a.errorList)||{};if("JUMP_LOGIN"===o)return new Vt(R,"Can not get auth code: ".concat(e.error_message));if(tn.jumpStatus!==h.DONE&&!s)return new Vt(Q.UNAUTHORIZED.code,Q.UNAUTHORIZED.message);if("permission required!"===String(e.error_message).toLowerCase()||"no permission!"===String(e.error_message).toLowerCase())return new Vt(Q.FORBIDDEN.code,Q.FORBIDDEN.message);if(i&&(null===(n=X[i])||void 0===n?void 0:n[e.error_code]))return new Vt(X[i][e.error_code].code,X[i][e.error_code].message);var c=null==u||null===(r=u[i])||void 0===r?void 0:r[String(e.error_code)];if(c){var l,d,p,f=null===(l=c.mapTo)||void 0===l?void 0:l.message;return(null==c?void 0:c.needMoreDetail)&&(f="".concat(null==c||null===(p=c.mapTo)||void 0===p?void 0:p.message,": ").concat(e.error_message)),new Vt(null===(d=c.mapTo)||void 0===d?void 0:d.code,f)}return new Vt(e.error_code,e.error_message)},function(e,n,r,i){var o=function(e,n){function r(r){return function(i){var o=ft.isEmpty(n)?void 0:n[r];if(o)return Ae({stage:t.RESPONSE,type:"log",state:r,name:e,response:i}),o("fail"===r?Ht(i):null==i?void 0:i.data)}}return ft.isUndefined(e)&&(e=""),Object.assign({},{success:r("success"),fail:r("fail")})}(e,r),a=Y[e],s=(null==i?void 0:i.delay)||0;setTimeout((function(){$t(e,n,o,Ce({},i,a))}),s)}),Xt=function(){var e=he((function(e){return _e(this,(function(t){return[2,new Promise((function(t,n){Yt("MP_USER_AUTHORIZE",{scopes:e,forceUpdate:!0},{success:function(e){ft.isEmpty(e)||t(e)},fail:function(e){n(e)}},{isMultiCallback:!1,timeout:!1})}))]}))}));return function(t){return e.apply(this,arguments)}}(),en=function(){function e(){ht(this,e),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={}}var n,o,s,u=e.prototype;return u.jump=function(){var e=this;return he((function(){return _e(this,(function(n){return[2,new Promise((function(n,r){e._jumpStatus?e._jumpStatus===h.DONE?n(h.DONE):n(h.DOING):(e._jumpStatus=h.DOING,Ae({stage:t.REQUEST,type:"log",name:"jump"}),$t("JUMP_LOGIN",{},{success:function(t){var r=t.data;e._miniProgramConfig=(null==r?void 0:r.miniProgramConfig)||{};var i=(null==r?void 0:r.cookiesOAuthLogins)||[],o=i.find((function(e){return e.name===c.JS_TOKEN}));o&&(e._jsAccessToken=o.value,window.ZJSBridge.setJSToken&&window.ZJSBridge.setJSToken(o.value)),e._cookies=i;var a=e._cookies.find((function(e){return e.name===c.ZOAUTH}));(null==a?void 0:a.value)||Zt([{action:"action.jump.login",error:-102,message:"no zoauth",data:{}}]),n(h.DONE)},fail:function(e){Zt([{action:"action.jump.login",error:-101,message:e.message||"jump error",data:{}}]),r(e)}},{skipJump:!0}))}))]}))}))()},u.loginZaloV3=function(e,t,n){var r=this;return he((function(){var i;return _e(this,(function(o){switch(o.label){case 0:return i="".concat(l.GET_ACCESS_TOKEN_V3,"?app_id=").concat(t,"&redirect_uri=").concat(a,"/").concat(e,"/&code=").concat(n,"&isSDK=true"),[4,fetch(i).then(function(){var e=he((function(e){var t,n,i;return _e(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()]}}))}))()},u.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 he((function(){var i,o;return _e(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),ft.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(l.GET_ACCESS_TOKEN,Ce({method:"POST",body:i},o)).then(function(){var e=he((function(e){var t,n,i,o;return _e(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()]}}))}))()},u.getAccessToken=function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=this;return he((function(){var n,o,a,s,u,l,d,p,f;function h(){return m.apply(this,arguments)}function m(){return(m=he((function(){return _e(this,(function(e){switch(e.label){case 0:return[4,new Promise((function(e){var t=setInterval((function(){(o.getAccessTokenCount<=1||o._accessToken)&&(e("done"),clearInterval(t))}),200)}))];case 1:return[2,e.sent()]}}))}))).apply(this,arguments)}return _e(this,(function(m){switch(m.label){case 0:return n=(new Date).getTime()-t.prevGetAccessTokenTimestamp,(o=t).getAccessTokenCount++,t.getAccessTokenCount>1?[4,h()]:[3,2];case 1:m.sent(),m.label=2;case 2:return t.manualSetAccessToken?(o.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?(o.getAccessTokenCount--,[2,Promise.resolve(t._accessToken)]):(t.accessToken="",[4,t.jumpAndGetToken(c.ZOAUTH)]);case 6:return u=m.sent(),[4,t.jumpAndGetToken(c.ZOAUTH_VRF)];case 7:if(l=m.sent(),d="zmp.getaccesstoken.fail",!a)throw o.getAccessTokenCount--,Zt([{action:d,error:-104,message:"no user auth",data:{}}]),Qt.error.loginFailed("User Authentication Required");if(!u)return[3,15];m.label=8;case 8:return m.trys.push([8,13,,14]),l?[4,t.loginZaloV4(i,u,l)]:[3,10];case 9:return p=m.sent(),[3,12];case 10:return[4,t.loginZaloV3(i,r,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),Zt([{action:d,error:-103,message:String(f)||"Can not get access token",data:{}}]),[3,14];case 14:return o.getAccessTokenCount--,p?[2,Promise.resolve(t._accessToken)]:(Zt([{action:d,error:-101,message:"no accessToken",data:{}}]),[2,Promise.reject(Qt.error.loginFailed("Can't get accessToken. Please try again later."))]);case 15:throw o.getAccessTokenCount--,Zt([{action:d,error:-102,message:"no oauth",data:{}}]),Qt.error.loginFailed("Zalo app has not been activated")}}))}))()},u.verifyUserAuthorized=function(){var e=this;return he((function(){var t,n,r,i,o,a;return _e(this,(function(s){switch(s.label){case 0:if(n=!0,!1!==(null===(t=e._miniProgramConfig)||void 0===t?void 0:t.userAuthorized))return[3,6];s.label=1;case 1:return s.trys.push([1,5,,6]),(r=dn("action.mp.user.authorize"))&&r.isSupported?[4,qt()]:[3,4];case 2:return!1!==(null==(o=s.sent())||null===(i=o.authSetting)||void 0===i?void 0:i["scope.userInfo"])?[3,4]:[4,Xt()];case 3:a=s.sent(),n=(null==a?void 0:a["scope.userInfo"])||!1,s.label=4;case 4:return[3,6];case 5:return s.sent(),n=!1,[3,6];case 6:return[2,n]}}))}))()},u.setAccessToken=function(e){this.manualSetAccessToken=!0,this._accessToken=e,window.ZJSBridge.setZAccSession&&window.ZJSBridge.setZAccSession(e)},u.getJSAccessToken=function(){var e=this;return he((function(){var t;return _e(this,(function(n){switch(n.label){case 0:return e._jsAccessToken.length>0?[2,Promise.resolve(e._jsAccessToken)]:[4,e.jumpAndGetToken(c.JS_TOKEN)];case 1:return t=n.sent(),[2,Promise.resolve(t)]}}))}))()},u.getSync=function(e){var t;return null===(t=this._cookies.find((function(t){return t.name===e})))||void 0===t?void 0:t.value},u.jumpAndGetToken=function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=this;return new Promise(function(){var r=he((function(r){var i,o,a,s;return _e(this,(function(u){switch(u.label){case 0:return!t&&n._cookies.length>0?ft.isString(e)?(i=n._cookies.find((function(t){return t.name===e})),[2,r(null==i?void 0:i.value)]):[2,r("")]:(t&&n._jumpStatus===h.DONE&&(n._jumpStatus=void 0),o={name:e,cb:function(e){return r(e)}},[4,n.jump()]);case 1:return(a=u.sent())===h.DONE?(n._jumpStatus=a,n.WAITING_QUEUE.length&&(n.WAITING_QUEUE.forEach((function(e){var t=n._cookies.find((function(t){return t.name===e.name}));e.cb(null==t?void 0:t.value)})),n.WAITING_QUEUE=[]),s=n._cookies.find((function(e){return e.name===o.name})),o.cb(null==s?void 0:s.value)):n.WAITING_QUEUE.push(o),[2]}}))}));return function(e){return r.apply(this,arguments)}}())},e.getInstance=function(){return e.instance||(e.instance=new e),e.instance},n=e,(o=[{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}}])&&mt(n.prototype,o),s&&mt(n,s),e}(),tn=en.getInstance(),nn=st("zmp:utils:common"),rn=function(e){if(ft.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(rn(e[r]));return"["+t.join(",")+"]"}if("object"==typeof e){for(var i in t=[],e)t.push('"'+i+'":'+rn(e[i]));return"{"+t.join(",")+"}"}return e.toString()},on=function(e){var t,n,r=Y[e],i=(null===(t=Pe())||void 0===t?void 0:t.zaloVersion)||0,o="versionLive"in r&&(null==r||null===(n=r.versionLive)||void 0===n?void 0:n.iOS)||0;return!!(Array.isArray(window.ignoreCheckSupport)&&window.ignoreCheckSupport.length>0&&window.ignoreCheckSupport.includes(e))||Number(i)>=o},an=function(e){try{if(e){nn(e);var t=e.replace(/\\/g,"").replace(/&#39;/g,"'");try{t=decodeURIComponent(atob(e))}catch(e){}return nn("formattedValue",t,JSON.parse(t),at(JSON.parse(t))),JSON.parse(t)}return null}catch(t){return nn("parse json error:",t),e}},sn=function(e){if(ft.isObject(JSON)&&JSON.parse&&ft.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 ft.isObject(e)?e:new Function("return "+e)()},un=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""},cn=function(e){return btoa(encodeURIComponent(JSON.stringify(e)))};var ln=function(e){return"hidden"===e?S.hidden:"transparent"===e?S.transparent:S.normal},dn=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}))}},pn=function(e){if(void 0===e)return!1;var t=tn.miniProgramConfig;return((null==t?void 0:t.requiredAuthenList)||[]).indexOf(e)>=0},fn=function(){var e=he((function(){return _e(this,(function(e){return[2,new Promise(function(){var e=he((function(e,t){var n;return _e(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)}}();function hn(e,t,n,r){var i,o,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=Qt.error.badRequest(s);throw c.detail=a,Kt(c,e)}u.push(i.data)}));var c=r.apply(void 0,ge(u));return ft.isPromise(c)?new Promise((function(t,n){c.then((function(e){if(!ft.isNull(a)&&ft.isFunction(a))return a(e);t(c)})).catch((function(t){var r=Kt(t,e);if(!ft.isNull(s)&&ft.isFunction(s))return s(r);n(r)}))})):c}catch(t){if(!ft.isNull(s)&&ft.isFunction(s))return s(t);throw Kt(t,e)}}function mn(e){return vn.apply(this,arguments)}function vn(){return(vn=he((function(e){return _e(this,(function(t){return[2,hn("login",[],[e],he((function(){return _e(this,(function(e){switch(e.label){case 0:return Oe.isMp?[4,tn.jumpAndGetToken(c.ZOAUTH)]:[3,2];case 1:return e.sent(),[2,"Success"];case 2:return Oe.isMpWeb?[2,Promise.resolve("")]:[2,Promise.reject(Ie("login",{}))]}}))})))]}))}))).apply(this,arguments)}function yn(e){return gn.apply(this,arguments)}function gn(){return(gn=he((function(e){return _e(this,(function(t){return[2,hn("getAccessToken",[],[e],he((function(){var e;return _e(this,(function(t){switch(t.label){case 0:return Oe.isMp?[4,fn()]:[3,3];case 1:return e=!t.sent(),[4,tn.getAccessToken(e)];case 2:return[2,t.sent()||""];case 3:return Oe.isMpWeb?[2,Promise.resolve("")]:[2,Promise.reject(Ie("getAccessToken",{}))]}}))})))]}))}))).apply(this,arguments)}var _n,wn="2.39.8";function bn(){return hn("getVersion",[],[],(function(){return wn}))}function Tn(){var e,t;return{version:un("version-id")||"",apiVersion:wn,zaloVersion:(null===(e=Pe())||void 0===e?void 0:e.zaloVersion)||"",platform:(null===(t=Pe())||void 0===t?void 0:t.platformName)||"",language:navigator.language,zaloLanguage:window.zLanguage||"vi",zaloTheme:window.zTheme||"light"}}function En(){return hn("getSystemInfo",[],[],(function(){return Tn()}))}!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}(_n||(_n={}));const Sn=_n.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Pn=e=>{switch(typeof e){case"undefined":return Sn.undefined;case"string":return Sn.string;case"number":return isNaN(e)?Sn.nan:Sn.number;case"boolean":return Sn.boolean;case"function":return Sn.function;case"bigint":return Sn.bigint;case"symbol":return Sn.symbol;case"object":return Array.isArray(e)?Sn.array:null===e?Sn.null:e.then&&"function"==typeof e.then&&e.catch&&"function"==typeof e.catch?Sn.promise:"undefined"!=typeof Map&&e instanceof Map?Sn.map:"undefined"!=typeof Set&&e instanceof Set?Sn.set:"undefined"!=typeof Date&&e instanceof Date?Sn.date:Sn.object;default:return Sn.unknown}},On=_n.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 An 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,_n.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()}}An.create=e=>new An(e);const In=(e,t)=>{let n;switch(e.code){case On.invalid_type:n=e.received===Sn.undefined?"Required":`Expected ${e.expected}, received ${e.received}`;break;case On.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(e.expected,_n.jsonStringifyReplacer)}`;break;case On.unrecognized_keys:n=`Unrecognized key(s) in object: ${_n.joinValues(e.keys,", ")}`;break;case On.invalid_union:n="Invalid input";break;case On.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${_n.joinValues(e.options)}`;break;case On.invalid_enum_value:n=`Invalid enum value. Expected ${_n.joinValues(e.options)}, received '${e.received}'`;break;case On.invalid_arguments:n="Invalid function arguments";break;case On.invalid_return_type:n="Invalid function return type";break;case On.invalid_date:n="Invalid date";break;case On.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}"`:_n.assertNever(e.validation):n="regex"!==e.validation?`Invalid ${e.validation}`:"Invalid";break;case On.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 On.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 On.custom:n="Invalid input";break;case On.invalid_intersection_types:n="Intersection results could not be merged";break;case On.not_multiple_of:n=`Number must be a multiple of ${e.multipleOf}`;break;case On.not_finite:n="Number must be finite";break;default:n=t.defaultError,_n.assertNever(e)}return{message:n}};let kn=In;function Cn(){return kn}const Nn=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 Mn(e,t){const n=Nn({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,Cn(),In].filter((e=>!!e))});e.common.issues.push(n)}class xn{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 Rn;"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 xn.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 Rn;if("aborted"===i.status)return Rn;"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 Rn=Object.freeze({status:"aborted"}),Dn=e=>({status:"dirty",value:e}),jn=e=>({status:"valid",value:e}),Un=e=>"aborted"===e.status,Ln=e=>"dirty"===e.status,Bn=e=>"valid"===e.status,Zn=e=>"undefined"!=typeof Promise&&e instanceof Promise;var zn;!function(e){e.errToObj=e=>"string"==typeof e?{message:e}:e||{},e.toString=e=>"string"==typeof e?e:null==e?void 0:e.message}(zn||(zn={}));class Wn{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 Fn=(e,t)=>{if(Bn(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 An(e.common.issues)}};function Gn(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 Hn{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 Pn(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:Pn(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new xn,ctx:{common:e.parent.common,data:e.data,parsedType:Pn(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const t=this._parse(e);if(Zn(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:Pn(e)},i=this._parseSync({data:e,path:r.path,parent:r});return Fn(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:Pn(e)},r=this._parse({data:e,path:n.path,parent:n}),i=await(Zn(r)?r:Promise.resolve(r));return Fn(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:On.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 kr({schema:this,typeName:Zr.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}optional(){return Cr.create(this,this._def)}nullable(){return Nr.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return cr.create(this,this._def)}promise(){return Ir.create(this,this._def)}or(e){return fr.create([this,e],this._def)}and(e){return yr.create(this,e,this._def)}transform(e){return new kr({...Gn(this._def),schema:this,typeName:Zr.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const t="function"==typeof e?e:()=>e;return new Mr({...Gn(this._def),innerType:this,defaultValue:t,typeName:Zr.ZodDefault})}brand(){return new jr({typeName:Zr.ZodBranded,type:this,...Gn(this._def)})}catch(e){const t="function"==typeof e?e:()=>e;return new xr({...Gn(this._def),innerType:this,catchValue:t,typeName:Zr.ZodCatch})}describe(e){return new(0,this.constructor)({...this._def,description:e})}pipe(e){return Ur.create(this,e)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const Vn=/^c[^\s-]{8,}$/i,Kn=/^[a-z][a-z0-9]*$/,Jn=/^([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,qn=/^(([^<>()[\]\\.,;:\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 $n extends Hn{constructor(){super(...arguments),this._regex=(e,t,n)=>this.refinement((t=>e.test(t)),{validation:t,code:On.invalid_string,...zn.errToObj(n)}),this.nonempty=e=>this.min(1,zn.errToObj(e)),this.trim=()=>new $n({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}_parse(e){this._def.coerce&&(e.data=String(e.data));if(this._getType(e)!==Sn.string){const t=this._getOrReturnCtx(e);return Mn(t,{code:On.invalid_type,expected:Sn.string,received:t.parsedType}),Rn}const t=new xn;let n;for(const i of this._def.checks)if("min"===i.kind)e.data.length<i.value&&(n=this._getOrReturnCtx(e,n),Mn(n,{code:On.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),Mn(n,{code:On.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?Mn(n,{code:On.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}):o&&Mn(n,{code:On.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}),t.dirty())}else if("email"===i.kind)qn.test(e.data)||(n=this._getOrReturnCtx(e,n),Mn(n,{validation:"email",code:On.invalid_string,message:i.message}),t.dirty());else if("uuid"===i.kind)Jn.test(e.data)||(n=this._getOrReturnCtx(e,n),Mn(n,{validation:"uuid",code:On.invalid_string,message:i.message}),t.dirty());else if("cuid"===i.kind)Vn.test(e.data)||(n=this._getOrReturnCtx(e,n),Mn(n,{validation:"cuid",code:On.invalid_string,message:i.message}),t.dirty());else if("cuid2"===i.kind)Kn.test(e.data)||(n=this._getOrReturnCtx(e,n),Mn(n,{validation:"cuid2",code:On.invalid_string,message:i.message}),t.dirty());else if("url"===i.kind)try{new URL(e.data)}catch(r){n=this._getOrReturnCtx(e,n),Mn(n,{validation:"url",code:On.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),Mn(n,{validation:"regex",code:On.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),Mn(n,{code:On.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),Mn(n,{code:On.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),Mn(n,{code:On.invalid_string,validation:"datetime",message:i.message}),t.dirty())}else _n.assertNever(i);var r;return{status:t.value,value:e.data}}_addCheck(e){return new $n({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...zn.errToObj(e)})}url(e){return this._addCheck({kind:"url",...zn.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...zn.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...zn.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...zn.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,...zn.errToObj(null==e?void 0:e.message)})}regex(e,t){return this._addCheck({kind:"regex",regex:e,...zn.errToObj(t)})}startsWith(e,t){return this._addCheck({kind:"startsWith",value:e,...zn.errToObj(t)})}endsWith(e,t){return this._addCheck({kind:"endsWith",value:e,...zn.errToObj(t)})}min(e,t){return this._addCheck({kind:"min",value:e,...zn.errToObj(t)})}max(e,t){return this._addCheck({kind:"max",value:e,...zn.errToObj(t)})}length(e,t){return this._addCheck({kind:"length",value:e,...zn.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 Qn(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)}$n.create=e=>{var t;return new $n({checks:[],typeName:Zr.ZodString,coerce:null!==(t=null==e?void 0:e.coerce)&&void 0!==t&&t,...Gn(e)})};class Yn extends Hn{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)!==Sn.number){const t=this._getOrReturnCtx(e);return Mn(t,{code:On.invalid_type,expected:Sn.number,received:t.parsedType}),Rn}let t;const n=new xn;for(const r of this._def.checks)if("int"===r.kind)_n.isInteger(e.data)||(t=this._getOrReturnCtx(e,t),Mn(t,{code:On.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),Mn(t,{code:On.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),Mn(t,{code:On.too_big,maximum:r.value,type:"number",inclusive:r.inclusive,exact:!1,message:r.message}),n.dirty())}else"multipleOf"===r.kind?0!==Qn(e.data,r.value)&&(t=this._getOrReturnCtx(e,t),Mn(t,{code:On.not_multiple_of,multipleOf:r.value,message:r.message}),n.dirty()):"finite"===r.kind?Number.isFinite(e.data)||(t=this._getOrReturnCtx(e,t),Mn(t,{code:On.not_finite,message:r.message}),n.dirty()):_n.assertNever(r);return{status:n.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,zn.toString(t))}gt(e,t){return this.setLimit("min",e,!1,zn.toString(t))}lte(e,t){return this.setLimit("max",e,!0,zn.toString(t))}lt(e,t){return this.setLimit("max",e,!1,zn.toString(t))}setLimit(e,t,n,r){return new Yn({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:n,message:zn.toString(r)}]})}_addCheck(e){return new Yn({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:zn.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:zn.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:zn.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:zn.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:zn.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:zn.toString(t)})}finite(e){return this._addCheck({kind:"finite",message:zn.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&&_n.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)}}Yn.create=e=>new Yn({checks:[],typeName:Zr.ZodNumber,coerce:(null==e?void 0:e.coerce)||!1,...Gn(e)});class Xn extends Hn{_parse(e){this._def.coerce&&(e.data=BigInt(e.data));if(this._getType(e)!==Sn.bigint){const t=this._getOrReturnCtx(e);return Mn(t,{code:On.invalid_type,expected:Sn.bigint,received:t.parsedType}),Rn}return jn(e.data)}}Xn.create=e=>{var t;return new Xn({typeName:Zr.ZodBigInt,coerce:null!==(t=null==e?void 0:e.coerce)&&void 0!==t&&t,...Gn(e)})};class er extends Hn{_parse(e){this._def.coerce&&(e.data=Boolean(e.data));if(this._getType(e)!==Sn.boolean){const t=this._getOrReturnCtx(e);return Mn(t,{code:On.invalid_type,expected:Sn.boolean,received:t.parsedType}),Rn}return jn(e.data)}}er.create=e=>new er({typeName:Zr.ZodBoolean,coerce:(null==e?void 0:e.coerce)||!1,...Gn(e)});class tr extends Hn{_parse(e){this._def.coerce&&(e.data=new Date(e.data));if(this._getType(e)!==Sn.date){const t=this._getOrReturnCtx(e);return Mn(t,{code:On.invalid_type,expected:Sn.date,received:t.parsedType}),Rn}if(isNaN(e.data.getTime())){return Mn(this._getOrReturnCtx(e),{code:On.invalid_date}),Rn}const t=new xn;let n;for(const r of this._def.checks)"min"===r.kind?e.data.getTime()<r.value&&(n=this._getOrReturnCtx(e,n),Mn(n,{code:On.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),Mn(n,{code:On.too_big,message:r.message,inclusive:!0,exact:!1,maximum:r.value,type:"date"}),t.dirty()):_n.assertNever(r);return{status:t.value,value:new Date(e.data.getTime())}}_addCheck(e){return new tr({...this._def,checks:[...this._def.checks,e]})}min(e,t){return this._addCheck({kind:"min",value:e.getTime(),message:zn.toString(t)})}max(e,t){return this._addCheck({kind:"max",value:e.getTime(),message:zn.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}}tr.create=e=>new tr({checks:[],coerce:(null==e?void 0:e.coerce)||!1,typeName:Zr.ZodDate,...Gn(e)});class nr extends Hn{_parse(e){if(this._getType(e)!==Sn.symbol){const t=this._getOrReturnCtx(e);return Mn(t,{code:On.invalid_type,expected:Sn.symbol,received:t.parsedType}),Rn}return jn(e.data)}}nr.create=e=>new nr({typeName:Zr.ZodSymbol,...Gn(e)});class rr extends Hn{_parse(e){if(this._getType(e)!==Sn.undefined){const t=this._getOrReturnCtx(e);return Mn(t,{code:On.invalid_type,expected:Sn.undefined,received:t.parsedType}),Rn}return jn(e.data)}}rr.create=e=>new rr({typeName:Zr.ZodUndefined,...Gn(e)});class ir extends Hn{_parse(e){if(this._getType(e)!==Sn.null){const t=this._getOrReturnCtx(e);return Mn(t,{code:On.invalid_type,expected:Sn.null,received:t.parsedType}),Rn}return jn(e.data)}}ir.create=e=>new ir({typeName:Zr.ZodNull,...Gn(e)});class or extends Hn{constructor(){super(...arguments),this._any=!0}_parse(e){return jn(e.data)}}or.create=e=>new or({typeName:Zr.ZodAny,...Gn(e)});class ar extends Hn{constructor(){super(...arguments),this._unknown=!0}_parse(e){return jn(e.data)}}ar.create=e=>new ar({typeName:Zr.ZodUnknown,...Gn(e)});class sr extends Hn{_parse(e){const t=this._getOrReturnCtx(e);return Mn(t,{code:On.invalid_type,expected:Sn.never,received:t.parsedType}),Rn}}sr.create=e=>new sr({typeName:Zr.ZodNever,...Gn(e)});class ur extends Hn{_parse(e){if(this._getType(e)!==Sn.undefined){const t=this._getOrReturnCtx(e);return Mn(t,{code:On.invalid_type,expected:Sn.void,received:t.parsedType}),Rn}return jn(e.data)}}ur.create=e=>new ur({typeName:Zr.ZodVoid,...Gn(e)});class cr extends Hn{_parse(e){const{ctx:t,status:n}=this._processInputParams(e),r=this._def;if(t.parsedType!==Sn.array)return Mn(t,{code:On.invalid_type,expected:Sn.array,received:t.parsedType}),Rn;if(null!==r.exactLength){const e=t.data.length>r.exactLength.value,i=t.data.length<r.exactLength.value;(e||i)&&(Mn(t,{code:e?On.too_big:On.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&&(Mn(t,{code:On.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&&(Mn(t,{code:On.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 Wn(t,e,t.path,n))))).then((e=>xn.mergeArray(n,e)));const i=[...t.data].map(((e,n)=>r.type._parseSync(new Wn(t,e,t.path,n))));return xn.mergeArray(n,i)}get element(){return this._def.type}min(e,t){return new cr({...this._def,minLength:{value:e,message:zn.toString(t)}})}max(e,t){return new cr({...this._def,maxLength:{value:e,message:zn.toString(t)}})}length(e,t){return new cr({...this._def,exactLength:{value:e,message:zn.toString(t)}})}nonempty(e){return this.min(1,e)}}var lr;function dr(e){if(e instanceof pr){const t={};for(const n in e.shape){const r=e.shape[n];t[n]=Cr.create(dr(r))}return new pr({...e._def,shape:()=>t})}return e instanceof cr?cr.create(dr(e.element)):e instanceof Cr?Cr.create(dr(e.unwrap())):e instanceof Nr?Nr.create(dr(e.unwrap())):e instanceof gr?gr.create(e.items.map((e=>dr(e)))):e}cr.create=(e,t)=>new cr({type:e,minLength:null,maxLength:null,exactLength:null,typeName:Zr.ZodArray,...Gn(t)}),function(e){e.mergeShapes=(e,t)=>({...e,...t})}(lr||(lr={}));class pr extends Hn{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=_n.objectKeys(e);return this._cached={shape:e,keys:t}}_parse(e){if(this._getType(e)!==Sn.object){const t=this._getOrReturnCtx(e);return Mn(t,{code:On.invalid_type,expected:Sn.object,received:t.parsedType}),Rn}const{status:t,ctx:n}=this._processInputParams(e),{shape:r,keys:i}=this._getCached(),o=[];if(!(this._def.catchall instanceof sr&&"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 Wn(n,i,n.path,e)),alwaysSet:e in n.data})}if(this._def.catchall instanceof sr){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&&(Mn(n,{code:On.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 Wn(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=>xn.mergeObjectSync(t,e))):xn.mergeObjectSync(t,a)}get shape(){return this._def.shape()}strict(e){return zn.errToObj,new pr({...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=zn.errToObj(e).message)&&void 0!==a?a:s}:{message:s}}}:{}})}strip(){return new pr({...this._def,unknownKeys:"strip"})}passthrough(){return new pr({...this._def,unknownKeys:"passthrough"})}extend(e){return new pr({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new pr({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>lr.mergeShapes(this._def.shape(),e._def.shape()),typeName:Zr.ZodObject})}setKey(e,t){return this.augment({[e]:t})}catchall(e){return new pr({...this._def,catchall:e})}pick(e){const t={};return _n.objectKeys(e).forEach((n=>{e[n]&&this.shape[n]&&(t[n]=this.shape[n])})),new pr({...this._def,shape:()=>t})}omit(e){const t={};return _n.objectKeys(this.shape).forEach((n=>{e[n]||(t[n]=this.shape[n])})),new pr({...this._def,shape:()=>t})}deepPartial(){return dr(this)}partial(e){const t={};return _n.objectKeys(this.shape).forEach((n=>{const r=this.shape[n];e&&!e[n]?t[n]=r:t[n]=r.optional()})),new pr({...this._def,shape:()=>t})}required(e){const t={};return _n.objectKeys(this.shape).forEach((n=>{if(e&&!e[n])t[n]=this.shape[n];else{let e=this.shape[n];for(;e instanceof Cr;)e=e._def.innerType;t[n]=e}})),new pr({...this._def,shape:()=>t})}keyof(){return Pr(_n.objectKeys(this.shape))}}pr.create=(e,t)=>new pr({shape:()=>e,unknownKeys:"strip",catchall:sr.create(),typeName:Zr.ZodObject,...Gn(t)}),pr.strictCreate=(e,t)=>new pr({shape:()=>e,unknownKeys:"strict",catchall:sr.create(),typeName:Zr.ZodObject,...Gn(t)}),pr.lazycreate=(e,t)=>new pr({shape:e,unknownKeys:"strip",catchall:sr.create(),typeName:Zr.ZodObject,...Gn(t)});class fr extends Hn{_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 An(e.ctx.common.issues)));return Mn(t,{code:On.invalid_union,unionErrors:n}),Rn}));{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 An(e)));return Mn(t,{code:On.invalid_union,unionErrors:i}),Rn}}get options(){return this._def.options}}fr.create=(e,t)=>new fr({options:e,typeName:Zr.ZodUnion,...Gn(t)});const hr=e=>e instanceof Er?hr(e.schema):e instanceof kr?hr(e.innerType()):e instanceof Sr?[e.value]:e instanceof Or?e.options:e instanceof Ar?Object.keys(e.enum):e instanceof Mr?hr(e._def.innerType):e instanceof rr?[void 0]:e instanceof ir?[null]:null;class mr extends Hn{_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==Sn.object)return Mn(t,{code:On.invalid_type,expected:Sn.object,received:t.parsedType}),Rn;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}):(Mn(t,{code:On.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[n]}),Rn)}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=hr(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 mr({typeName:Zr.ZodDiscriminatedUnion,discriminator:e,options:t,optionsMap:r,...Gn(n)})}}function vr(e,t){const n=Pn(e),r=Pn(t);if(e===t)return{valid:!0,data:e};if(n===Sn.object&&r===Sn.object){const n=_n.objectKeys(t),r=_n.objectKeys(e).filter((e=>-1!==n.indexOf(e))),i={...e,...t};for(const n of r){const r=vr(e[n],t[n]);if(!r.valid)return{valid:!1};i[n]=r.data}return{valid:!0,data:i}}if(n===Sn.array&&r===Sn.array){if(e.length!==t.length)return{valid:!1};const n=[];for(let r=0;r<e.length;r++){const i=vr(e[r],t[r]);if(!i.valid)return{valid:!1};n.push(i.data)}return{valid:!0,data:n}}return n===Sn.date&&r===Sn.date&&+e==+t?{valid:!0,data:e}:{valid:!1}}class yr extends Hn{_parse(e){const{status:t,ctx:n}=this._processInputParams(e),r=(e,r)=>{if(Un(e)||Un(r))return Rn;const i=vr(e.value,r.value);return i.valid?((Ln(e)||Ln(r))&&t.dirty(),{status:t.value,value:i.data}):(Mn(n,{code:On.invalid_intersection_types}),Rn)};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}))}}yr.create=(e,t,n)=>new yr({left:e,right:t,typeName:Zr.ZodIntersection,...Gn(n)});class gr extends Hn{_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==Sn.array)return Mn(n,{code:On.invalid_type,expected:Sn.array,received:n.parsedType}),Rn;if(n.data.length<this._def.items.length)return Mn(n,{code:On.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),Rn;!this._def.rest&&n.data.length>this._def.items.length&&(Mn(n,{code:On.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 Wn(n,e,n.path,t)):null})).filter((e=>!!e));return n.common.async?Promise.all(r).then((e=>xn.mergeArray(t,e))):xn.mergeArray(t,r)}get items(){return this._def.items}rest(e){return new gr({...this._def,rest:e})}}gr.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new gr({items:e,typeName:Zr.ZodTuple,rest:null,...Gn(t)})};class _r extends Hn{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!==Sn.object)return Mn(n,{code:On.invalid_type,expected:Sn.object,received:n.parsedType}),Rn;const r=[],i=this._def.keyType,o=this._def.valueType;for(const e in n.data)r.push({key:i._parse(new Wn(n,e,n.path,e)),value:o._parse(new Wn(n,n.data[e],n.path,e))});return n.common.async?xn.mergeObjectAsync(t,r):xn.mergeObjectSync(t,r)}get element(){return this._def.valueType}static create(e,t,n){return new _r(t instanceof Hn?{keyType:e,valueType:t,typeName:Zr.ZodRecord,...Gn(n)}:{keyType:$n.create(),valueType:e,typeName:Zr.ZodRecord,...Gn(t)})}}class wr extends Hn{_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==Sn.map)return Mn(n,{code:On.invalid_type,expected:Sn.map,received:n.parsedType}),Rn;const r=this._def.keyType,i=this._def.valueType,o=[...n.data.entries()].map((([e,t],o)=>({key:r._parse(new Wn(n,e,n.path,[o,"key"])),value:i._parse(new Wn(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 Rn;"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 Rn;"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:Zr.ZodMap,...Gn(n)});class br extends Hn{_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==Sn.set)return Mn(n,{code:On.invalid_type,expected:Sn.set,received:n.parsedType}),Rn;const r=this._def;null!==r.minSize&&n.data.size<r.minSize.value&&(Mn(n,{code:On.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&&(Mn(n,{code:On.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 Rn;"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 Wn(n,e,n.path,t))));return n.common.async?Promise.all(a).then((e=>o(e))):o(a)}min(e,t){return new br({...this._def,minSize:{value:e,message:zn.toString(t)}})}max(e,t){return new br({...this._def,maxSize:{value:e,message:zn.toString(t)}})}size(e,t){return this.min(e,t).max(e,t)}nonempty(e){return this.min(1,e)}}br.create=(e,t)=>new br({valueType:e,minSize:null,maxSize:null,typeName:Zr.ZodSet,...Gn(t)});class Tr extends Hn{constructor(){super(...arguments),this.validate=this.implement}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==Sn.function)return Mn(t,{code:On.invalid_type,expected:Sn.function,received:t.parsedType}),Rn;function n(e,n){return Nn({data:e,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,Cn(),In].filter((e=>!!e)),issueData:{code:On.invalid_arguments,argumentsError:n}})}function r(e,n){return Nn({data:e,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,Cn(),In].filter((e=>!!e)),issueData:{code:On.invalid_return_type,returnTypeError:n}})}const i={errorMap:t.common.contextualErrorMap},o=t.data;return this._def.returns instanceof Ir?jn((async(...e)=>{const t=new An([]),a=await this._def.args.parseAsync(e,i).catch((r=>{throw t.addIssue(n(e,r)),t})),s=await o(...a);return await this._def.returns._def.type.parseAsync(s,i).catch((e=>{throw t.addIssue(r(s,e)),t}))})):jn(((...e)=>{const t=this._def.args.safeParse(e,i);if(!t.success)throw new An([n(e,t.error)]);const a=o(...t.data),s=this._def.returns.safeParse(a,i);if(!s.success)throw new An([r(a,s.error)]);return s.data}))}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new Tr({...this._def,args:gr.create(e).rest(ar.create())})}returns(e){return new Tr({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,t,n){return new Tr({args:e||gr.create([]).rest(ar.create()),returns:t||ar.create(),typeName:Zr.ZodFunction,...Gn(n)})}}class Er extends Hn{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})}}Er.create=(e,t)=>new Er({getter:e,typeName:Zr.ZodLazy,...Gn(t)});class Sr extends Hn{_parse(e){if(e.data!==this._def.value){const t=this._getOrReturnCtx(e);return Mn(t,{received:t.data,code:On.invalid_literal,expected:this._def.value}),Rn}return{status:"valid",value:e.data}}get value(){return this._def.value}}function Pr(e,t){return new Or({values:e,typeName:Zr.ZodEnum,...Gn(t)})}Sr.create=(e,t)=>new Sr({value:e,typeName:Zr.ZodLiteral,...Gn(t)});class Or extends Hn{_parse(e){if("string"!=typeof e.data){const t=this._getOrReturnCtx(e),n=this._def.values;return Mn(t,{expected:_n.joinValues(n),received:t.parsedType,code:On.invalid_type}),Rn}if(-1===this._def.values.indexOf(e.data)){const t=this._getOrReturnCtx(e),n=this._def.values;return Mn(t,{received:t.data,code:On.invalid_enum_value,options:n}),Rn}return jn(e.data)}get options(){return this._def.values}get enum(){const e={};for(const t of this._def.values)e[t]=t;return e}get Values(){const e={};for(const t of this._def.values)e[t]=t;return e}get Enum(){const e={};for(const t of this._def.values)e[t]=t;return e}extract(e){return Or.create(e)}exclude(e){return Or.create(this.options.filter((t=>!e.includes(t))))}}Or.create=Pr;class Ar extends Hn{_parse(e){const t=_n.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(e);if(n.parsedType!==Sn.string&&n.parsedType!==Sn.number){const e=_n.objectValues(t);return Mn(n,{expected:_n.joinValues(e),received:n.parsedType,code:On.invalid_type}),Rn}if(-1===t.indexOf(e.data)){const e=_n.objectValues(t);return Mn(n,{received:n.data,code:On.invalid_enum_value,options:e}),Rn}return jn(e.data)}get enum(){return this._def.values}}Ar.create=(e,t)=>new Ar({values:e,typeName:Zr.ZodNativeEnum,...Gn(t)});class Ir extends Hn{unwrap(){return this._def.type}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==Sn.promise&&!1===t.common.async)return Mn(t,{code:On.invalid_type,expected:Sn.promise,received:t.parsedType}),Rn;const n=t.parsedType===Sn.promise?t.data:Promise.resolve(t.data);return jn(n.then((e=>this._def.type.parseAsync(e,{path:t.path,errorMap:t.common.contextualErrorMap}))))}}Ir.create=(e,t)=>new Ir({type:e,typeName:Zr.ZodPromise,...Gn(t)});class kr extends Hn{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===Zr.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=>{Mn(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?Rn:("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?Rn:("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(!Bn(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=>Bn(e)?Promise.resolve(r.transform(e.value,i)).then((e=>({status:t.value,value:e}))):e))}_n.assertNever(r)}}kr.create=(e,t,n)=>new kr({schema:e,typeName:Zr.ZodEffects,effect:t,...Gn(n)}),kr.createWithPreprocess=(e,t,n)=>new kr({schema:t,effect:{type:"preprocess",transform:e},typeName:Zr.ZodEffects,...Gn(n)});class Cr extends Hn{_parse(e){return this._getType(e)===Sn.undefined?jn(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}Cr.create=(e,t)=>new Cr({innerType:e,typeName:Zr.ZodOptional,...Gn(t)});class Nr extends Hn{_parse(e){return this._getType(e)===Sn.null?jn(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}Nr.create=(e,t)=>new Nr({innerType:e,typeName:Zr.ZodNullable,...Gn(t)});class Mr extends Hn{_parse(e){const{ctx:t}=this._processInputParams(e);let n=t.data;return t.parsedType===Sn.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:t.path,parent:t})}removeDefault(){return this._def.innerType}}Mr.create=(e,t)=>new Mr({innerType:e,typeName:Zr.ZodDefault,defaultValue:"function"==typeof t.default?t.default:()=>t.default,...Gn(t)});class xr extends Hn{_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 Zn(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}}xr.create=(e,t)=>new xr({innerType:e,typeName:Zr.ZodCatch,catchValue:"function"==typeof t.catch?t.catch:()=>t.catch,...Gn(t)});class Rr extends Hn{_parse(e){if(this._getType(e)!==Sn.nan){const t=this._getOrReturnCtx(e);return Mn(t,{code:On.invalid_type,expected:Sn.nan,received:t.parsedType}),Rn}return{status:"valid",value:e.data}}}Rr.create=e=>new Rr({typeName:Zr.ZodNaN,...Gn(e)});const Dr=Symbol("zod_brand");class jr extends Hn{_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 Ur extends Hn{_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?Rn:"dirty"===e.status?(t.dirty(),Dn(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?Rn:"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 Ur({in:e,out:t,typeName:Zr.ZodPipeline})}}const Lr=(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(),Br={object:pr.lazycreate};var Zr;!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"}(Zr||(Zr={}));const zr=$n.create,Wr=Yn.create,Fr=Rr.create,Gr=Xn.create,Hr=er.create,Vr=tr.create,Kr=nr.create,Jr=rr.create,qr=ir.create,$r=or.create,Qr=ar.create,Yr=sr.create,Xr=ur.create,ei=cr.create,ti=pr.create,ni=pr.strictCreate,ri=fr.create,ii=mr.create,oi=yr.create,ai=gr.create,si=_r.create,ui=wr.create,ci=br.create,li=Tr.create,di=Er.create,pi=Sr.create,fi=Or.create,hi=Ar.create,mi=Ir.create,vi=kr.create,yi=Cr.create,gi=Nr.create,_i=kr.createWithPreprocess,wi=Ur.create,bi={string:e=>$n.create({...e,coerce:!0}),number:e=>Yn.create({...e,coerce:!0}),boolean:e=>er.create({...e,coerce:!0}),bigint:e=>Xn.create({...e,coerce:!0}),date:e=>tr.create({...e,coerce:!0})},Ti=Rn;var Ei=Object.freeze({__proto__:null,defaultErrorMap:In,setErrorMap:function(e){kn=e},getErrorMap:Cn,makeIssue:Nn,EMPTY_PATH:[],addIssueToContext:Mn,ParseStatus:xn,INVALID:Rn,DIRTY:Dn,OK:jn,isAborted:Un,isDirty:Ln,isValid:Bn,isAsync:Zn,get util(){return _n},ZodParsedType:Sn,getParsedType:Pn,ZodType:Hn,ZodString:$n,ZodNumber:Yn,ZodBigInt:Xn,ZodBoolean:er,ZodDate:tr,ZodSymbol:nr,ZodUndefined:rr,ZodNull:ir,ZodAny:or,ZodUnknown:ar,ZodNever:sr,ZodVoid:ur,ZodArray:cr,get objectUtil(){return lr},ZodObject:pr,ZodUnion:fr,ZodDiscriminatedUnion:mr,ZodIntersection:yr,ZodTuple:gr,ZodRecord:_r,ZodMap:wr,ZodSet:br,ZodFunction:Tr,ZodLazy:Er,ZodLiteral:Sr,ZodEnum:Or,ZodNativeEnum:Ar,ZodPromise:Ir,ZodEffects:kr,ZodTransformer:kr,ZodOptional:Cr,ZodNullable:Nr,ZodDefault:Mr,ZodCatch:xr,ZodNaN:Rr,BRAND:Dr,ZodBranded:jr,ZodPipeline:Ur,custom:Lr,Schema:Hn,ZodSchema:Hn,late:Br,get ZodFirstPartyTypeKind(){return Zr},coerce:bi,any:$r,array:ei,bigint:Gr,boolean:Hr,date:Vr,discriminatedUnion:ii,effect:vi,enum:fi,function:li,instanceof:(e,t={message:`Input not instance of ${e.name}`})=>Lr((t=>t instanceof e),t,!0),intersection:oi,lazy:di,literal:pi,map:ui,nan:Fr,nativeEnum:hi,never:Yr,null:qr,nullable:gi,number:Wr,object:ti,oboolean:()=>Hr().optional(),onumber:()=>Wr().optional(),optional:yi,ostring:()=>zr().optional(),pipeline:wi,preprocess:_i,promise:mi,record:si,set:ci,strictObject:ni,string:zr,symbol:Kr,transformer:vi,tuple:ai,undefined:Jr,union:ri,unknown:Qr,void:Xr,NEVER:Ti,ZodIssueCode:On,quotelessJson:e=>JSON.stringify(e,null,2).replace(/"([^"]+)":/g,"$1:"),ZodError:An}),Si=function(){function e(){var t,n,r,o,s,u,c,l,d,p,f,h,m,v,y,g,_,w,b,T,E,S,P,O,A,I,k;ht(this,e),this.initConfig=window.APP_CONFIG;var C=ft.isString(null===(t=this.initConfig)||void 0===t||null===(n=t.app)||void 0===n?void 0:n.headerColor)&&(null===(r=this.initConfig)||void 0===r||null===(o=r.app)||void 0===o||null===(s=o.headerColor)||void 0===s?void 0:s.length)>0?ue:ce;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,x="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)?se.HIDE_BACK:se.SHOW_BACK,R="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)?se.SHOW_HOME:se.HIDE_HOME,D=new URL(location.href),j=ln(null===(w=this.initConfig)||void 0===w||null===(b=w.app)||void 0===b?void 0:b.statusBar);"boolean"==typeof(null===(T=this.initConfig)||void 0===T||null===(E=T.app)||void 0===E?void 0:E.actionBarHidden)&&(C=(null===(N=this.initConfig)||void 0===N||null===(M=N.app)||void 0===M?void 0:M.actionBarHidden)?ce:ue);this.config={actionbarType:C,buttonType:x,statusbarType:j,dataConfig:{backgroundColor:(null===(S=this.initConfig)||void 0===S||null===(P=S.app)||void 0===P?void 0:P.headerColor)||le,textColor:(null===(O=this.initConfig)||void 0===O||null===(A=O.app)||void 0===A?void 0:A.textColor)||"",textAlign:(null===(I=this.initConfig)||void 0===I||null===(k=I.app)||void 0===k?void 0:k.textAlign)||de,viewInLeftType:x,confirmToExit:1},homeConfig:{enable:R,url:"".concat(a,"/").concat(i,"/").concat(D.search)}}}var t=e.prototype;return t.setNavigationBarTitle=function(e){return he((function(){return _e(this,(function(t){return[2,new Promise((function(t,n){Yt("CHANGE_TITLE_HEADER",{title:e},{success:function(){t(),document.title=e},fail:function(e){n(e)}},{timeout:!1})}))]}))}))()},t.setNavigationBarLeftButton=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.config.dataConfig.confirmToExit,n=this;return he((function(){var r,i;return _e(this,(function(o){return void 0===(void 0===e?"undefined":at(e))&&null===(void 0===e?"undefined":at(e))||(r="none"===e||"home"===e?se.HIDE_BACK:se.SHOW_BACK,i="home"===e||"both"===e?se.SHOW_HOME:se.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){Yt("CHANGE_ACTIONBAR_LEFTBUTTON_TYPE",Ce({},n.config),{success:function(){e()},fail:function(e){t(e)}},{timeout:!1})}))]}))}))()},t.setAndroidBottomNavigationBar=function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=this;return he((function(){var n,r,i;return _e(this,(function(o){return r=e?P.hide:P.show,i=null===(n=Pe())||void 0===n?void 0:n.platform,[2,new Promise((function(n,o){if(!(null==i?void 0:i.isAndroid))return n();Yt("CHANGE_BOTTOMBAR",{bottombarType:r},{success:function(){t.hideAndroidBottomNavigationBar=!!e,window.ANDROID_BOTTOM_NAVIGATION_BAR_HIDDEN=!!e,n()},fail:function(e){o(e)}},{timeout:!1})}))]}))}))()},t.setIOSBottomSafeArea=function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=this;return he((function(){var n,r,i;return _e(this,(function(o){return r=e?O.hide:O.show,i=null===(n=Pe())||void 0===n?void 0:n.platform,[2,new Promise((function(n,o){if(!(null==i?void 0:i.isIOS))return n();Yt("CHANGE_BOTTOMBAR",{bottombarType:r},{success:function(){t.hideIOSSafeAreaBottom=!!e,window.IOS_BOTTOM_SAFE_AREA_HIDDEN=!!e,n()},fail:function(e){o(e)}},{timeout:!1,delay:200})}))]}))}))()},t.configHeader=function(e){var t=this;return he((function(){var n;return _e(this,(function(r){return n=t.config,ft.isString(e.headerColor)&&(n.dataConfig.backgroundColor=e.headerColor),ft.isString(e.headerTextColor)&&(n.dataConfig.textColor=e.headerTextColor),ft.isString(e.textAlign)&&("left"===e.textAlign?n.dataConfig.textAlign=A.left:"center"===e.textAlign&&(n.dataConfig.textAlign=A.center)),!0===e.hideActionBar?n.actionbarType=ce:!1===e.hideActionBar&&(n.actionbarType=ue),"normal"===e.statusBarType?n.statusbarType=S.normal:"hidden"===e.statusBarType?n.statusbarType=S.hidden:"transparent"===e.statusBarType&&(n.statusbarType=S.transparent),[2,new Promise((function(r,i){Yt("CHANGE_ACTIONBAR",Ce({},n),{success:function(){var i;t.config=Ce({},n);var o,a=null===(i=Pe())||void 0===i?void 0:i.platform;window.STATUS_BAR_TYPE=(o=t.config.statusbarType)===S.hidden?"hidden":o===S.transparent?"transparent":"normal",window.ACTION_BAR_HIDDEN=t.config.actionbarType===ce;var s=null===document||void 0===document?void 0:document.querySelector(":root");if(null==a?void 0:a.isAndroid){var u=0;if(("hidden"===e.statusBarType||"transparent"===e.statusBarType)&&e.hideActionBar){var c=window.ANDROID_STATUS_BAR_HEIGHT;isNaN(c)&&(c=Math.round(ZaloJavaScriptInterface.getStatusBarHeight()/window.devicePixelRatio)),u=c}u?null==s||s.style.setProperty("--zaui-safe-area-inset-top","".concat(u,"px")):null==s||s.style.setProperty("--zaui-safe-area-inset-top","env(safe-area-inset-top, 0px)")}r()},fail:function(e){i(e)}},{timeout:!1})}))]}))}))()},e.getInstance=function(){return e.instance||(e.instance=new e),e.instance},e}(),Pi=Si.getInstance(),Oi=[ti({title:zr()}).optional()];function Ai(e){return Ii.apply(this,arguments)}function Ii(){return Ii=he((function(e){return _e(this,(function(t){return[2,hn("setNavigationBarTitle",Oi,[e],function(){var e=he((function(e){return _e(this,(function(t){switch(t.label){case 0:return Oe.isMp?[4,Pi.setNavigationBarTitle(e.title)]:[3,2];case 1:return[2,t.sent()];case 2:return Oe.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Ie("setNavigationBarTitle",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Ii.apply(this,arguments)}var ki=[ti({color:zr(),textColor:Ei.enum(["black","white"]).optional(),statusBarColor:zr().optional()}).optional()];function Ci(e){return Ni.apply(this,arguments)}function Ni(){return Ni=he((function(e){return _e(this,(function(t){return[2,hn("setNavigationBarColor",ki,[e],function(){var e=he((function(e){return _e(this,(function(t){switch(t.label){case 0:return Oe.isMp?[4,Pi.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 Oe.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Ie("setNavigationBarColor",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Ni.apply(this,arguments)}var Mi=[ti({type:Ei.enum(["none","back","home","both"])}).optional()];function xi(e){return Ri.apply(this,arguments)}function Ri(){return Ri=he((function(e){return _e(this,(function(t){return[2,hn("setNavigationBarLeftButton",Mi,[e],function(){var e=he((function(e){return _e(this,(function(t){switch(t.label){case 0:return Oe.isMp?[4,Pi.setNavigationBarLeftButton(e.type)]:[3,2];case 1:return[2,t.sent()];case 2:return Oe.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Ie("setNavigationBarLeftButton",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Ri.apply(this,arguments)}function Di(e,t,n){if(!t.has(e))throw new TypeError("attempted to "+n+" private field on non-instance");return t.get(e)}function ji(e,t){return function(e,t){return t.get?t.get.call(e):t.value}(e,Di(e,t,"get"))}function Ui(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 Li(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,Di(e,t,"set"),n),n}var Bi,Zi,zi,Wi=new WeakMap,Fi=new WeakMap,Gi=new WeakMap,Hi=function(){function e(t){ht(this,e),Ui(this,Wi,{writable:!0,value:localStorage}),Ui(this,Fi,{writable:!0,value:void 0}),Ui(this,Gi,{writable:!0,value:void 0}),Li(this,Gi,{keys:new Set,currentSize:0,limitSize:te}),Li(this,Fi,t),this.findAllCurrentDataByApp(t)}var t=e.prototype;return t.findAllCurrentDataByApp=function(e){try{var t;for(t in ji(this,Wi)){if(e)if(t.split("_")[0]!==e)continue;ji(this,Gi).keys.add(t)}}catch(e){}},t.get=function(e){var t=this,n=new Map;return e.forEach((function(e){n.set(e,t.getSync(e))})),Promise.resolve(n)},t.getSync=function(e){return ji(this,Fi)&&(e="".concat(ji(this,Fi),"_").concat(e)),ji(this,Gi).keys.has(e)?ji(this,Wi).getItem(e):null},t.set=function(e){var t=this;return he((function(){return _e(this,(function(n){return Object.entries(e).forEach((function(e){var n=Ne(e,2),r=n[0],i=n[1];t.setSync(r,i.replace(/\\"/g,'"'))})),[2,Promise.resolve({errorKeys:[]})]}))}))()},t.setSync=function(e,t){ji(this,Fi)&&(e="".concat(ji(this,Fi),"_").concat(e)),ji(this,Wi).setItem(e,t),ji(this,Gi).keys.add(e)},t.getInfo=function(){var e=this;return he((function(){return _e(this,(function(t){return[2,Promise.resolve(e.getInfoSync())]}))}))()},t.getInfoSync=function(){var e=function(e,t){var n,r=0;for(n in e){var i=n.split("_")[0];e.hasOwnProperty(n)&&(t&&i!==t||(r+=2*(e[n].length+n.length)))}return r}(ji(this,Wi),ji(this,Fi));return{currentSize:ft.isNumber(e)?Number((e/1024).toFixed(2)):0,limitSize:Number((te/1024).toFixed(2))}},t.remove=function(e){var t=this;return he((function(){return _e(this,(function(n){return e.forEach((function(e){t.removeSync(e)})),[2,Promise.resolve({errorKeys:[]})]}))}))()},t.removeSync=function(e){ji(this,Fi)&&(e="".concat(ji(this,Fi),"_").concat(e)),ji(this,Gi).keys.has(e)&&(ji(this,Wi).removeItem(e),ji(this,Gi).keys.delete(e))},t.clear=function(){var e=this;return he((function(){return _e(this,(function(t){return[2,Promise.resolve(e.clearSync())]}))}))()},t.clearSync=function(){var e=this;ji(this,Gi).keys.forEach((function(t){ji(e,Fi)&&t.indexOf(ji(e,Fi))<0||(ji(e,Wi).removeItem(t),ji(e,Gi).keys.delete(t))}))},e}(),Vi=new WeakMap,Ki=new WeakMap,Ji=function(){function e(t){ht(this,e),Ui(this,Vi,{writable:!0,value:void 0}),Ui(this,Ki,{writable:!0,value:void 0}),Li(this,Ki,{keys:new Set,currentSize:0,limitSize:te}),Li(this,Vi,t)}var t=e.prototype;return t.get=function(e){var t=this;return he((function(){return _e(this,(function(n){return[2,new Promise((function(n,r){Yt("ZBROWSER_MPDS",{mpds_action:"mpds.get",mpds_data:{keys:e},appId:ji(t,Vi)},{success:function(e){var t=new Map;e&&e.mpds_data&&e.mpds_data.map&&(t=new Map(Object.entries(e.mpds_data.map))),n(t)},fail:function(e){r(e)}},{isMultiCallback:!1})}))]}))}))()},t.set=function(e){var t=this;return he((function(){return _e(this,(function(n){return[2,new Promise((function(n,r){Yt("ZBROWSER_MPDS",{mpds_action:"mpds.set",mpds_data:{map:e},appId:ji(t,Vi)},{success:function(e){var t=[];e&&e.mpds_data&&e.mpds_data.error_keys&&(t=e.mpds_data.error_keys),n({errorKeys:t})},fail:function(e){r(e)}},{isMultiCallback:!1})}))]}))}))()},t.getInfo=function(){var e=this;return he((function(){return _e(this,(function(t){return[2,new Promise((function(t,n){Yt("ZBROWSER_MPDS",{mpds_action:"mpds.get.size",mpds_data:{},appId:ji(e,Vi)},{success:function(e){var n=0;e&&e.mpds_data&&e.mpds_data.size&&(n=e.mpds_data.size),t({currentSize:ft.isNumber(n)?Number(Number(n)/1024):0,limitSize:Number(te/1024)})},fail:function(e){n(e)}},{isMultiCallback:!1})}))]}))}))()},t.remove=function(e){var t=this;return he((function(){return _e(this,(function(n){return[2,new Promise((function(n,r){Yt("ZBROWSER_MPDS",{mpds_action:"mpds.remove.key",mpds_data:{keys:e},appId:ji(t,Vi)},{success:function(e){var t=[];e&&e.mpds_data&&e.mpds_data.error_keys&&(t=e.mpds_data.error_keys),n({errorKeys:t})},fail:function(e){r(e)}},{isMultiCallback:!1})}))]}))}))()},t.clear=function(){var e=this;return he((function(){return _e(this,(function(t){return[2,new Promise((function(t,n){Yt("ZBROWSER_MPDS",{mpds_action:"mpds.clear.appData",mpds_data:{},appId:ji(e,Vi)},{success:function(){t()},fail:function(e){n(e)}},{isMultiCallback:!1})}))]}))}))()},e}(),qi=function(){function e(){ht(this,e)}var t=e.prototype;return t.getDataFromStorage=function(e){var t=this;return he((function(){var n,r;return _e(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]=an(e)})),[2,r]}}))}))()},t.putDataToStorage=function(e){var t=this;return he((function(){var n,r;return _e(this,(function(i){switch(i.label){case 0:return n=t.getInstance(),r={},Object.entries(e).forEach((function(e){var t=Ne(e,2),n=t[0],i=t[1];ft.isUndefined(i)||ft.isNull(i)||(r[n]=cn(i))})),[4,n.set(r)];case 1:return[2,i.sent()]}}))}))()},t.removeDataFromStorage=function(e){var t=this;return he((function(){return _e(this,(function(n){switch(n.label){case 0:return[4,t.getInstance().remove(e)];case 1:return[2,n.sent()]}}))}))()},t.clearStorage=function(){var e=this;return he((function(){return _e(this,(function(t){switch(t.label){case 0:return[4,e.getInstance().clear()];case 1:return t.sent(),[2]}}))}))()},t.getStorageInfo=function(){var e=this;return he((function(){return _e(this,(function(t){switch(t.label){case 0:return[4,e.getInstance().getInfo()];case 1:return[2,t.sent()]}}))}))()},e}(),$i=new WeakMap,Qi=function(e){bt(n,e);var t=Et(n);function n(e){var r;return ht(this,n),Ui(Tt(r=t.call(this)),$i,{writable:!0,value:void 0}),Li(Tt(r),$i,e),r}return n.prototype.getInstance=function(){return new Hi(ji(this,$i))},n}(qi),Yi=new WeakMap,Xi=function(e){bt(n,e);var t=Et(n);function n(e){var r;return ht(this,n),Ui(Tt(r=t.call(this)),Yi,{writable:!0,value:void 0}),Li(Tt(r),Yi,e),r}return n.prototype.getInstance=function(){return new Ji(ji(this,Yi))},n}(qi),eo=new Qi(i),to=(null===(Bi=Pe())||void 0===Bi?void 0:Bi.zaloVersion)||"",no=(null===(Zi=Pe())||void 0===Zi?void 0:Zi.platformName)||"unknown";!!ft.isString(to)&&parseInt(to,10)>={android:12100571,iOS:400,wp:0,unknown:0}[no]&&(null===(zi=Pe())||void 0===zi?void 0:zi.appEnv.isMp)&&(eo=new Xi(i));var ro=eo,io=[ti({data:Ei.record(zr(),Ei.any())}).optional()];function oo(e){return ao.apply(this,arguments)}function ao(){return ao=he((function(e){return _e(this,(function(t){return[2,hn("setStorage",io,[e],function(){var e=he((function(e){return _e(this,(function(t){switch(t.label){case 0:return Oe.isMp||Oe.isMpWeb?[4,ro.putDataToStorage(e.data)]:[3,2];case 1:return[2,t.sent()];case 2:return[2,Promise.reject(Ie("setStorage",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),ao.apply(this,arguments)}var so=[ti({keys:Ei.array(zr())}).optional()];function uo(e){return co.apply(this,arguments)}function co(){return co=he((function(e){return _e(this,(function(t){return[2,hn("getStorage",so,[e],function(){var e=he((function(e){return _e(this,(function(t){switch(t.label){case 0:return Oe.isMp||Oe.isMpWeb?[4,ro.getDataFromStorage(e.keys)]:[3,2];case 1:return[2,t.sent()];case 2:return[2,Promise.reject(Ie("getStorage",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),co.apply(this,arguments)}function lo(e){return po.apply(this,arguments)}function po(){return(po=he((function(e){return _e(this,(function(t){return[2,hn("getStorageInfo",[],[e],he((function(){return _e(this,(function(e){switch(e.label){case 0:return Oe.isMp||Oe.isMpWeb?[4,ro.getStorageInfo()]:[3,2];case 1:return[2,e.sent()];case 2:return[2,Promise.reject(Ie("getStorageInfo",{}))]}}))})))]}))}))).apply(this,arguments)}var fo=[ti({keys:Ei.array(zr())}).optional()];function ho(e){return mo.apply(this,arguments)}function mo(){return mo=he((function(e){return _e(this,(function(t){return[2,hn("removeStorage",fo,[e],function(){var e=he((function(e){return _e(this,(function(t){switch(t.label){case 0:return Oe.isMp||Oe.isMpWeb?[4,ro.removeDataFromStorage(e.keys)]:[3,2];case 1:return[2,t.sent()];case 2:return[2,Promise.reject(Ie("removeStorage",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),mo.apply(this,arguments)}var vo=[ti({prefix:zr().optional()}).optional()];function yo(e){return go.apply(this,arguments)}function go(){return(go=he((function(e){return _e(this,(function(t){return[2,hn("clearStorage",vo,[e],he((function(){return _e(this,(function(e){switch(e.label){case 0:return Oe.isMp||Oe.isMpWeb?[4,ro.clearStorage()]:[3,2];case 1:return[2,e.sent()];case 2:return[2,Promise.reject(Ie("clearStorage",{}))]}}))})))]}))}))).apply(this,arguments)}var _o=function(){var e=he((function(e,t){var n,r,o,a;return _e(this,(function(s){switch(s.label){case 0:return(r=t)?[3,2]:[4,fn()];case 1:r=!s.sent(),s.label=2;case 2:return n=r,[4,tn.getAccessToken(n)];case 3:return o=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(l.GET_USER_INFO,"?fields=").concat(a,"&miniapp_id=").concat(i),{headers:{access_token:o||""}}).then(function(){var e=he((function(e){var t,n,r,i;return _e(this,(function(o){switch(o.label){case 0:return[4,e.json()];case 1:return r=o.sent(),i=null==r?void 0:r.user_id_by_oa,[2,{id:null==r?void 0:r.id,name:(null==r?void 0:r.name)||"",avatar:(null==r||null===(t=r.picture)||void 0===t||null===(n=t.data)||void 0===n?void 0:n.url)||"",idByOA:i,followedOA:!!(null==r?void 0:r.is_follower),isSensitive:null==r?void 0:r.is_sensitive}]}}))}));return function(t){return e.apply(this,arguments)}}())];case 4:return[2,s.sent()]}}))}));return function(t,n){return e.apply(this,arguments)}}(),wo=[ti({avatarType:Ei.enum(["small","normal","large"]).optional(),autoRequestPermission:Ei.boolean().default(!1).optional()}).optional()];function bo(e){return To.apply(this,arguments)}function To(){return To=he((function(e){return _e(this,(function(t){return[2,hn("getUserInfo",wo,[e],function(){var e=he((function(e){var t,n;return _e(this,(function(r){switch(r.label){case 0:return Oe.isMp?(t=null==e?void 0:e.avatarType,n=null==e?void 0:e.autoRequestPermission,[4,_o(t,n)]):[3,2];case 1:return[2,{userInfo:r.sent()}];case 2:return Oe.isMpWeb?[2,Promise.resolve({userInfo:{id:"3368637342326461234",name:"User Name",avatar:"https://h5.zdn.vn/static/images/avatar.png"}})]:[2,Promise.reject(Ie("getUserInfo",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),To.apply(this,arguments)}var Eo=function(e){return{NONE:e?-2:0,WIFI:e?0:1,"2G":2,"3G":e?15:2,"4G":e?13:2}},So=he((function(){return _e(this,(function(e){return[2,new Promise((function(e,t){Yt("WEBVIEW_NETWORKTYPE",{url:window.location.href,featureId:""},{success:function(t){var n,r,i,o=t.network,a=(null===(n=Pe())||void 0===n||null===(r=n.platform)||void 0===r?void 0:r.isAndroid)||!1;switch(o){case Eo(a).NONE:i=d.none;break;case Eo(a).WIFI:i=d.wifi;break;case Eo(a)["2G"]:case Eo(a)["3G"]:case Eo(a)["4G"]:i=d.cellular;break;default:i=d.unknown}e(i)},fail:function(e){t(e)}},{})}))]}))}));function Po(e){return Oo.apply(this,arguments)}function Oo(){return(Oo=he((function(e){return _e(this,(function(t){return[2,hn("getNetworkType",[],[e],he((function(){var e,t;return _e(this,(function(n){switch(n.label){case 0:return Oe.isMp?[4,So()]:[3,2];case 1:return[2,{networkType:n.sent()}];case 2:if(Oe.isMpWeb){switch(e=navigator.connection||navigator.mozConnection||navigator.webkitConnection,e.effectiveType){case"none":t=d.none;break;case"4g":t=d.wifi;break;case"3g":case"2g":t=d.cellular;break;default:t=d.unknown}return[2,Promise.resolve({networkType:t})]}return[2,Promise.reject(Ie("getNetworkType",{}))]}}))})))]}))}))).apply(this,arguments)}var Ao=[Ei.function().args(ti({isConnected:Ei.boolean(),networkType:Ei.enum(["none","wifi","cellular","unknown"])})).returns(Ei.void())];function Io(e){return hn("onNetworkStatusChange",Ao,[e],(function(e){var t=e;if(Oe.isMp)!function(e){It.getInstance().on(f.NetworkChanged,(function(t){var n=null==t?void 0:t.state;So().then((function(t){e({isConnected:"CONNECTED"===n,networkType:t})}))}))}(t);else if(Oe.isMpWeb){var n=navigator.connection||navigator.mozConnection||navigator.webkitConnection,r=n.effectiveType;n.addEventListener("change",(function(){var e;switch(r){case"none":e=d.none;break;case"4g":e=d.wifi;break;case"3g":case"2g":e=d.cellular;break;default:e=d.unknown}t({isConnected:!0,networkType:e})}))}}))}var ko=function(){var e=he((function(e){var t,n,r,i,o,a;return _e(this,(function(s){return a={subaction:0,scanning_type:ft.isNumber(null==e?void 0:e.scanningType)?e.scanningType:0,data:{scan_from_source:ft.isString(null==e?void 0:e.scanFromSource)?e.scanFromSource:"",expire:ft.isNumber(null==e?void 0:e.expire)?e.expire:3e3,monitor_interval:ft.isNumber(null==e?void 0:e.monitorInterval)?e.monitorInterval:60,domain:ft.isString(null==e?void 0:e.domain)?e.domain:"",scan_config:{scan_time:ft.isNumber(null==e||null===(t=e.scanConfig)||void 0===t?void 0:t.scanTime)?e.scanConfig.scanTime:15e3,time_between_scan:ft.isNumber(null==e||null===(n=e.scanConfig)||void 0===n?void 0:n.timeBetweenScan)?e.scanConfig.timeBetweenScan:1e4,beacon_timeout:ft.isNumber(null==e||null===(r=e.scanConfig)||void 0===r?void 0:r.beaconTimeout)?e.scanConfig.beaconTimeout:3e4,delayCheckConnectedTimeout:ft.isNumber(null==e||null===(i=e.scanConfig)||void 0===i?void 0:i.delayCheckConnectedTimeout)?e.scanConfig.delayCheckConnectedTimeout:5e3,beaconConnectedTimeout:ft.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){Yt("SCAN_IBEACON",Ce({},a),{success:function(){e(!0)},fail:function(e){t(e)}},{})}))]}))}));return function(t){return e.apply(this,arguments)}}(),Co=[ti({scanningType:Ei.number().refine((function(e){return[0,1].includes(e)}),{message:"The type must be either 0 or 1"}).default(0).optional(),expire:Ei.number().optional(),monitorInterval:Ei.number().optional(),domain:Ei.string().optional(),scanConfig:ti({scanTime:Ei.number().optional(),timeBetweenScan:Ei.number().optional(),beaconTimeout:Ei.number().optional(),delayCheckConnectedTimeout:Ei.number().optional(),beaconConnectedTimeout:Ei.number().optional()}).optional(),items:Ei.array(ti({id:Ei.string().optional(),distance:Ei.number().optional(),monitor:ti({enable:Ei.boolean().optional(),movingRange:Ei.number().optional()}).optional()})).optional(),scanFromSource:Ei.string().optional()}).optional()];function No(e){return Mo.apply(this,arguments)}function Mo(){return(Mo=he((function(e){return _e(this,(function(t){return[2,hn("startBeaconDiscovery",Co,[e],he((function(){return _e(this,(function(t){switch(t.label){case 0:return Oe.isMp?[4,ko(e)]:[3,2];case 1:return[2,t.sent()];case 2:return Oe.isMpWeb?[2,Promise.resolve(!0)]:[2,Promise.reject(Ie("startBeaconDiscovery",{}))]}}))})))]}))}))).apply(this,arguments)}var xo=he((function(){return _e(this,(function(e){return[2,new Promise((function(e,t){Yt("SCAN_IBEACON",{subaction:2},{success:function(){e(!0)},fail:function(e){t(e)}},{})}))]}))}));function Ro(e){return Do.apply(this,arguments)}function Do(){return(Do=he((function(e){return _e(this,(function(t){return[2,hn("stopBeaconDiscovery",[],[e],he((function(){return _e(this,(function(e){switch(e.label){case 0:return Oe.isMp?[4,xo()]:[3,2];case 1:return[2,e.sent()];case 2:return Oe.isMpWeb?[2,Promise.resolve(!0)]:[2,Promise.reject(Ie("stopBeaconDiscovery",{}))]}}))})))]}))}))).apply(this,arguments)}var jo=he((function(){return _e(this,(function(e){return[2,new Promise((function(e,t){Yt("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 Uo(e){return Lo.apply(this,arguments)}function Lo(){return(Lo=he((function(e){return _e(this,(function(t){return[2,hn("getBeacons",[],[e],he((function(){return _e(this,(function(e){switch(e.label){case 0:return Oe.isMp?[4,jo()]:[3,2];case 1:return[2,e.sent()];case 2:return Oe.isMpWeb?[2,Promise.resolve({beacons:[]})]:[2,Promise.reject(Ie("getBeacons",{}))]}}))})))]}))}))).apply(this,arguments)}var Bo=he((function(){return _e(this,(function(e){return[2,new Promise((function(e,t){Yt("WINDOW_CLOSE",{},{success:function(t){e(t)},fail:function(e){t(e)}},{})}))]}))}));function Zo(e){return zo.apply(this,arguments)}function zo(){return(zo=he((function(e){return _e(this,(function(t){return[2,hn("closeApp",[],[e],he((function(){return _e(this,(function(e){switch(e.label){case 0:return Oe.isMp?[4,Bo()]:[3,2];case 1:return[2,e.sent()];case 2:return Oe.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Ie("closeApp",{}))]}}))})))]}))}))).apply(this,arguments)}var Wo=he((function(){return _e(this,(function(e){return[2,new Promise((function(e,t){Yt("OPEN_QR",{skipOpenLink:!0},{success:function(t){e(t)},fail:function(e){t(e)}},{})}))]}))}));function Fo(e){return Go.apply(this,arguments)}function Go(){return(Go=he((function(e){return _e(this,(function(t){return[2,hn("scanQRCode",[],[e],he((function(){return _e(this,(function(e){switch(e.label){case 0:return Oe.isMp?[4,Wo()]:[3,2];case 1:return[2,e.sent()];case 2:return Oe.isMpWeb?[2,Promise.resolve({content:""})]:[2,Promise.reject(Ie("scanQRCode",{}))]}}))})))]}))}))).apply(this,arguments)}var Ho=function(){var e=he((function(e,t,n,i){return _e(this,(function(o){return[2,new Promise((function(o,a){Yt("OPEN_PROFILE",{uId:e,type:m[t],zapp:r,sourceId:n,sourceIndex:i},{success:function(){o()},fail:function(e){a(e)}},{})}))]}))}));return function(t,n,r,i){return e.apply(this,arguments)}}(),Vo=[ti({id:zr(),type:Ei.enum(["user","oa","aliasOA"]),sourceId:Ei.any().optional(),sourceIndex:Ei.any().optional()}).optional()];function Ko(e){return Jo.apply(this,arguments)}function Jo(){return Jo=he((function(e){return _e(this,(function(t){return[2,hn("openProfile",Vo,[e],function(){var e=he((function(e){var t,n,r,i;return _e(this,(function(o){switch(o.label){case 0:return Oe.isMp?(t=e.id,n=e.type,r=e.sourceId,i=e.sourceIndex,[4,Ho(t,n,r,i)]):[3,2];case 1:return[2,o.sent()];case 2:return Oe.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Ie("openProfile",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Jo.apply(this,arguments)}var qo=function(){var e=he((function(e,t){var n,i,o,a=arguments;return _e(this,(function(s){return n=a.length>2&&void 0!==a[2]?a[2]:"",i=a.length>3?a[3]:void 0,o=a.length>4?a[4]:void 0,[2,new Promise((function(a,s){Yt("OPEN_CHAT",{uId:e,type:v[t],msg:n,zapp:r,sourceId:i,sourceIndex:o},{success:function(){a()},fail:function(e){s(e)}},{})}))]}))}));return function(t,n){return e.apply(this,arguments)}}(),$o=[ti({id:zr(),type:Ei.enum(["user","oa"]),sourceId:Ei.any().optional(),sourceIndex:Ei.any().optional(),message:zr().optional()}).optional()];function Qo(e){return Yo.apply(this,arguments)}function Yo(){return Yo=he((function(e){return _e(this,(function(t){return[2,hn("openChat",$o,[e],function(){var e=he((function(e){var t,n,r,i,o;return _e(this,(function(a){switch(a.label){case 0:return Oe.isMp?(t=e.id,n=e.type,r=e.message,i=e.sourceId,o=e.sourceIndex,[4,qo(t,n,r,i,o)]):[3,2];case 1:return[2,a.sent()];case 2:return Oe.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Ie("openChat",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Yo.apply(this,arguments)}function Xo(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 e=he((function(e,t){var n;return _e(this,(function(i){switch(n={},e){case"image":n={photoUrl:null==t?void 0:t.imageUrl};break;case"link":n={link:null==t?void 0:t.link,title:null==t?void 0:t.title,thumb:null==t?void 0:t.thumb,description:null==t?void 0:t.description};break;case"profile":n={avt:null==t?void 0:t.avatar,uid:null==t?void 0:t.id,dpn:null==t?void 0:t.displayName}}return[2,new Promise((function(t,i){Yt("OPEN_POSTFEED",Xo(Ce({type:y[e]},n),{zapp:r}),{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){i(e)}},{})}))]}))}));return function(t,n){return e.apply(this,arguments)}}(),ta=[Ei.union([ti({type:Ei.enum(["image"]),data:ti({imageUrl:zr().url().optional()})}),ti({type:Ei.enum(["link"]),data:ti({link:zr().url(),title:zr().max(100).optional(),thumb:zr().url().optional(),description:zr().max(400).default("").optional()})}),ti({type:Ei.enum(["profile"]),data:ti({id:zr().optional()})})])];function na(e){return ra.apply(this,arguments)}function ra(){return ra=he((function(e){return _e(this,(function(t){return[2,hn("openPostFeed",ta,[e],function(){var e=he((function(e){var t,n;return _e(this,(function(r){switch(r.label){case 0:return Oe.isMp?(t=e.type,n=e.data,[4,ea(t,n)]):[3,2];case 1:return[2,r.sent()];case 2:return Oe.isMpWeb?[2,Promise.resolve({status:1,shareType:0,numberOfUser:0})]:[2,Promise.reject(Ie("openPostFeed",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),ra.apply(this,arguments)}var ia=function(){var e=he((function(e){return _e(this,(function(t){return[2,new Promise((function(t,n){Yt("FOLLOW_OA",{uid:e,showDialogConfirm:!0,forceUpdate:!0,zapp:r},{success:function(e){t(e)},fail:function(e){n(e)}},{timeout:!1})}))]}))}));return function(t){return e.apply(this,arguments)}}(),oa=[ti({id:zr(),showDialogConfirm:Ei.boolean().optional()}).optional()];function aa(e){return sa.apply(this,arguments)}function sa(){return sa=he((function(e){return _e(this,(function(t){return[2,hn("followOA",oa,[e],function(){var e=he((function(e){var t;return _e(this,(function(n){switch(n.label){case 0:return Oe.isMp?(t=e.id,[4,ia(t)]):[3,2];case 1:return[2,n.sent()];case 2:return Oe.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Ie("followOA",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),sa.apply(this,arguments)}var ua=function(){var e=he((function(e){return _e(this,(function(t){return[2,new Promise((function(t,n){Yt("UNFOLLOW_OA",{uid:e,forceUpdate:!0,zapp:r},{success:function(){t()},fail:function(e){n(e)}},{})}))]}))}));return function(t){return e.apply(this,arguments)}}(),ca=[ti({id:zr()}).optional()];function la(e){return da.apply(this,arguments)}function da(){return da=he((function(e){return _e(this,(function(t){return[2,hn("unfollowOA",ca,[e],function(){var e=he((function(e){var t;return _e(this,(function(n){switch(n.label){case 0:return Oe.isMp?(t=e.id,[4,ua(t)]):[3,2];case 1:return[2,n.sent()];case 2:return Oe.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Ie("unfollowOA",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),da.apply(this,arguments)}var pa=function(){var e=he((function(e,t,n,r,i,a){var s,c,d,p,f,h,m,v;return _e(this,(function(y){switch(y.label){case 0:return d=new URL(location.href),p=new URLSearchParams,f="".concat(d.pathname.replace(u,"")).concat(d.search),a&&(f="/".concat(e).concat("/"===a[0]?"":"/").concat(a)),!(h=new URL("".concat(o).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===(c=window.APP_VERSION)||void 0===c?void 0:c.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(l.CREATE_SHARE_LINK,Ce({method:"POST",body:p},m))];case 1:return[4,y.sent().json()];case 2:if(!(v=y.sent())||0!==v.err)throw Qt.error.cannotGetShareInfo();return h.search="".concat(h.search,"&zshareId=").concat(v.data.shareId),[2,Xo(Ce({},v.data),{shareableLink:h.href})]}}))}));return function(t,n,r,i,o,a){return e.apply(this,arguments)}}(),fa=function(){var e=he((function(e,t){var n,o,a,s,u,c,l,d,p,f,h,m;return _e(this,(function(v){switch(v.label){case 0:switch(n={},o=e,e){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 n={text:null==t?void 0:t.text,desc:(null==t?void 0:t.desc)||(null==t?void 0:t.description),autoParseLink:(null==t?void 0:t.autoParseLink)?1:0},[3,14];case 2:return c=[],l=(null===(s=Pe())||void 0===s?void 0:s.zaloVersion)||0,d=(null===(u=Pe())||void 0===u?void 0:u.platformName)||"unknown",Number(l)>=ee[d]&&(o="multi_image"),Array.isArray(null==t?void 0:t.imageUrls)&&(null==t?void 0:t.imageUrls.length)>0?c=null==t?void 0:t.imageUrls:c.push(null==t?void 0:t.imageUrl),n={photoUrls:c,photoUrl:null==t?void 0:t.imageUrl,caption:null==t?void 0:t.caption},[3,14];case 3:return n={photoUrl:null==t?void 0:t.imageUrl,gifUrl:null==t?void 0:t.gifUrl,width:null==t?void 0:t.width,height:null==t?void 0:t.height},[3,14];case 4:return n={videoThumb:null==t?void 0:t.videoThumb,videoUrl:null==t?void 0:t.videoUrl,width:null==t?void 0:t.width,height:null==t?void 0:t.height},[3,14];case 5:return n={link:null==t?void 0:t.link,chatOnly:(null==t?void 0:t.chatOnly)?1:0},[3,14];case 6:return n={uid:null==t?void 0:t.id},[3,14];case 7:case 10:return[4,tn.getAccessToken()];case 8:case 11:return a=v.sent(),[4,pa(i,a||"",(null==t?void 0:t.title)||"",(null==t?void 0:t.description)||"",(null==t?void 0:t.thumbnail)||"",null==t?void 0:t.path)];case 9:return p=v.sent(),n={data:{ZInstantAPIInfo:{url:"".concat(p.zinstantApi),zinstantdata_id:"templateId=".concat(p.ztemplateId,"&appId=").concat(i,"&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]),n={link:h.href,chatOnly:0},[3,14];case 13:return[3,14];case 14:return[2,new Promise((function(e,t){Yt("OPEN_SHARESHEET",Xo(Ce({type:g[o]},n),{zapp:r}),{success:function(t){e({status:null==t?void 0:t.status,shareType:null==t?void 0:t.share_type,numberOfUser:null==t?void 0:t.uid_to_size})},fail:function(e){t(e)}},{timeout:!1})}))]}}))}));return function(t,n){return e.apply(this,arguments)}}(),ha=[Ei.union([ti({type:Ei.enum(["text"]),data:ti({text:zr(),description:zr().default("").optional(),autoParseLink:Ei.boolean().default(!1).optional()})}),ti({type:Ei.enum(["image"]),data:ti({imageUrl:zr().url(),imageUrls:Ei.array(zr().url()).max(10).optional()})}),ti({type:Ei.enum(["link"]),data:ti({link:zr().url(),chatOnly:Ei.boolean().optional()})}),ti({type:Ei.enum(["oa"]),data:ti({id:zr()})}),ti({type:Ei.enum(["gif"]),data:ti({gifUrl:zr().url(),imageUrl:zr().url().optional(),width:Wr().min(0).optional(),height:Wr().min(0).optional()})}),ti({type:Ei.enum(["video"]),data:ti({videoThumb:zr().url(),videoUrl:zr().url(),width:Wr().min(0).optional(),height:Wr().min(0).optional()})}),ti({type:Ei.enum(["zmp","zmp_deep_link"]),data:ti({title:zr().max(100),thumbnail:zr().url(),path:zr().optional(),description:zr().max(400).default("").optional()})})])];function ma(e){return va.apply(this,arguments)}function va(){return va=he((function(e){return _e(this,(function(t){return[2,hn("openShareSheet",ha,[e],function(){var e=he((function(e){var t,n;return _e(this,(function(r){switch(r.label){case 0:return Oe.isMp?(t=e.type,n=e.data,[4,fa(t,n)]):[3,2];case 1:return[2,r.sent()];case 2:return Oe.isMpWeb?[2,Promise.resolve({status:2,shareType:0,numberOfUser:0})]:[2,Promise.reject(Ie("openShareSheet",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),va.apply(this,arguments)}var ya=he((function(){return _e(this,(function(e){return[2,new Promise((function(e,t){Yt("REQUEST_PERMISSION_CAMERA",{},{success:function(t){var n,r;(null===(n=Pe())||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=Pe())||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 ga(e){return _a.apply(this,arguments)}function _a(){return(_a=he((function(e){return _e(this,(function(t){return[2,hn("requestCameraPermission",[],[e],he((function(){return _e(this,(function(e){switch(e.label){case 0:return[4,ya()];case 1:return[2,e.sent()]}}))})))]}))}))).apply(this,arguments)}var wa=function(){var e=he((function(e,t,n){return _e(this,(function(r){return[2,new Promise((function(r,i){Yt("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)}}(),ba=he((function(){var e,t,n,r=arguments;return _e(this,(function(o){switch(o.label){case 0:return e=r.length>0&&void 0!==r[0]?r[0]:i,t=r.length>1&&void 0!==r[1]?r[1]:0,n=Tn(),[4,Bt(e,t,n.version)];case 1:return[2,o.sent()]}}))})),Ta=function(){var e=he((function(e){return _e(this,(function(t){return[2,new Promise((function(t,n){Yt("OPEN_OUTAPP",{url:e},{success:function(){t()},fail:function(e){n(e)}},{})}))]}))}));return function(t){return e.apply(this,arguments)}}(),Ea=[ti({params:Ei.record(zr(),zr()).optional()}).optional()];function Sa(e){return Pa.apply(this,arguments)}function Pa(){return Pa=he((function(e){return _e(this,(function(t){return[2,hn("createShortcut",Ea,[e],function(){var e=he((function(e){var t,n,r,a,s,u,c,l;return _e(this,(function(d){switch(d.label){case 0:return Oe.isMp?[4,ba(i,0)]:[3,6];case 1:return r=d.sent(),a=null===(t=Pe())||void 0===t||null===(n=t.platform)||void 0===n?void 0:n.isIOS,s=r.logoUrl||un("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"),a?(c.append("appId",i),c.append("appName",u),c.append("appIcon",s),l="https://mini.zalo.me/shortcut.html?".concat(c.toString()),[4,Ta(encodeURI(l))]):[3,3];case 2:return d.sent(),[3,5];case 3:return[4,wa("".concat(o,"/").concat(i,"/?").concat(c.toString()),u,s)];case 4:d.sent(),d.label=5;case 5:return[2,Qt.success()];case 6:return Oe.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Ie("createShortcut",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Pa.apply(this,arguments)}var Oa=function(){var e=he((function(e,t,n){return _e(this,(function(i){return[2,new Promise((function(i,o){Yt("PROMPT_AUTHENTICATION",{secret_data:e,app_id:r,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,r,o;i({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===(r=e.data)||void 0===r?void 0:r.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)}}(),Aa=[ti({secretData:zr(),ui:ti({title:zr().default("Xác thực").optional(),subTitle:zr().default("Sử dụng sinh trắc học của bạn để xác thực").optional(),negativeButtonText:zr().default("Đóng").optional()}).optional(),requireFingerprint:Hr().default(!0).optional()}).optional()];function Ia(e){return ka.apply(this,arguments)}function ka(){return ka=he((function(e){return _e(this,(function(t){return[2,hn("openBioAuthentication",Aa,[e],function(){var e=he((function(e){var t,n,r;return _e(this,(function(i){switch(i.label){case 0:return Oe.isMp?(t=e.secretData,n=e.ui,r=e.requireFingerprint,[4,Oa(t,n,r)]):[3,2];case 1:return[2,i.sent()];case 2:return Oe.isMpWeb?[2,Promise.resolve({code:0,message:"OK",data:{domain:"",code:0,message:"",payToken:""}})]:[2,Promise.reject(Ie("openBioAuthentication",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),ka.apply(this,arguments)}var Ca=he((function(){return _e(this,(function(e){return[2,new Promise((function(e,t){Yt("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 Na(e){return Ma.apply(this,arguments)}function Ma(){return(Ma=he((function(e){return _e(this,(function(t){return[2,hn("checkStateBioAuthentication",[],[e],he((function(){return _e(this,(function(e){switch(e.label){case 0:return Oe.isMp?[4,Ca()]:[3,2];case 1:return[2,{bioState:e.sent()}];case 2:return Oe.isMpWeb?[2,Promise.resolve({bioState:""})]:[2,Promise.reject(Ie("checkStateBioAuthentication",{}))]}}))})))]}))}))).apply(this,arguments)}var xa=function(){var e=he((function(e){return _e(this,(function(t){return[2,new Promise((function(t,n){Yt("SHOW_TOAST",{toast:e},{success:function(){t()},fail:function(e){n(e)}},{})}))]}))}));return function(t){return e.apply(this,arguments)}}(),Ra=[ti({message:zr()}).optional()];function Da(e){return ja.apply(this,arguments)}function ja(){return ja=he((function(e){return _e(this,(function(t){return[2,hn("showToast",Ra,[e],function(){var e=he((function(e){return _e(this,(function(t){switch(t.label){case 0:return Oe.isMp?[4,xa(e.message)]:[3,2];case 1:return[2,t.sent()];case 2:return Oe.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Ie("showToast",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),ja.apply(this,arguments)}var Ua=he((function(){return _e(this,(function(e){return[2,new Promise((function(e,t){Yt("HIDE_KEYBOARD",{},{success:function(){e()},fail:function(e){t(e)}},{})}))]}))}));function La(e){return Ba.apply(this,arguments)}function Ba(){return(Ba=he((function(e){return _e(this,(function(t){return[2,hn("hideKeyboard",[],[e],he((function(){return _e(this,(function(e){switch(e.label){case 0:return Oe.isMp?[4,Ua()]:[3,2];case 1:return[2,e.sent()];case 2:return Oe.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Ie("hideKeyboard",{}))]}}))})))]}))}))).apply(this,arguments)}var Za=function(){var e=he((function(e){return _e(this,(function(t){return[2,new Promise((function(t,n){Yt("OPEN_PHONE",{phoneNum:e,phoneCode:e},{success:function(){t()},fail:function(e){n(e)}},{})}))]}))}));return function(t){return e.apply(this,arguments)}}(),za=[ti({phoneNumber:zr()})];function Wa(e){return Fa.apply(this,arguments)}function Fa(){return Fa=he((function(e){return _e(this,(function(t){return[2,hn("openPhone",za,[e],function(){var e=he((function(e){return _e(this,(function(t){switch(t.label){case 0:return Oe.isMp?[4,Za(e.phoneNumber)]:[3,2];case 1:return[2,t.sent()];case 2:return Oe.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Ie("openPhone",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Fa.apply(this,arguments)}var Ga=function(){var e=he((function(e,t){return _e(this,(function(n){return[2,new Promise((function(n,r){Yt("OPEN_SMS",{content:t,phoneCode:e},{success:function(){n()},fail:function(e){r(e)}},{})}))]}))}));return function(t,n){return e.apply(this,arguments)}}(),Ha=[ti({content:zr(),phoneNumber:zr()})];function Va(e){return Ka.apply(this,arguments)}function Ka(){return Ka=he((function(e){return _e(this,(function(t){return[2,hn("openSMS",Ha,[e],function(){var e=he((function(e){return _e(this,(function(t){switch(t.label){case 0:return Oe.isMp?[4,Ga(e.phoneNumber,e.content)]:[3,2];case 1:return[2,t.sent()];case 2:return Oe.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Ie("openSMS",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Ka.apply(this,arguments)}var Ja=function(){var e=he((function(e){var t,n=arguments;return _e(this,(function(i){return t=n.length>1&&void 0!==n[1]?n[1]:"",[2,new Promise((function(n,i){Yt("VIEW_MYQR",{dpn:t,uid:e,zapp:r},{success:function(){n()},fail:function(e){i(e)}},{timeout:!1})}))]}))}));return function(t){return e.apply(this,arguments)}}(),qa=[ti({id:zr(),displayName:zr().default("").optional()})];function $a(e){return Qa.apply(this,arguments)}function Qa(){return Qa=he((function(e){return _e(this,(function(t){return[2,hn("viewOAQr",qa,[e],function(){var e=he((function(e){return _e(this,(function(t){switch(t.label){case 0:return Oe.isMp?[4,Ja(e.id,e.displayName)]:[3,2];case 1:return[2,t.sent()];case 2:return Oe.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Ie("viewOAQr",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Qa.apply(this,arguments)}var Ya=function(){var e=he((function(e){return _e(this,(function(t){return[2,new Promise((function(t,n){Yt("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)}}(),Xa=[ti({keepScreenOn:Hr()})];function es(e){return ts.apply(this,arguments)}function ts(){return ts=he((function(e){return _e(this,(function(t){return[2,hn("keepScreen",Xa,[e],function(){var e=he((function(e){return _e(this,(function(t){switch(t.label){case 0:return Oe.isMp?[4,Ya(e.keepScreenOn)]:[3,2];case 1:return[2,t.sent()];case 2:return Oe.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Ie("keepScreen",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),ts.apply(this,arguments)}function ns(e){return rs.apply(this,arguments)}function rs(){return(rs=he((function(e){return _e(this,(function(t){return[2,hn("onKeepScreen",[],[e],he((function(){return _e(this,(function(e){switch(e.label){case 0:return Oe.isMp?[4,Ya(!0)]:[3,2];case 1:return[2,e.sent()];case 2:return Oe.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Ie("onKeepScreen",{}))]}}))})))]}))}))).apply(this,arguments)}function is(e){return os.apply(this,arguments)}function os(){return(os=he((function(e){return _e(this,(function(t){return[2,hn("offKeepScreen",[],[e],he((function(){return _e(this,(function(e){switch(e.label){case 0:return Oe.isMp?[4,Ya(!1)]:[3,2];case 1:return[2,e.sent()];case 2:return Oe.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Ie("offKeepScreen",{}))]}}))})))]}))}))).apply(this,arguments)}var as=function(){var e=he((function(e,t){var n;return _e(this,(function(r){return n={},e?n={imageBase64Data:e}:t&&(n={imageUrl:t}),[2,new Promise((function(e,t){Yt("SAVE_IMAGE_GALLERY",Ce({},n),{success:function(){e()},fail:function(e){t(e)}},{})}))]}))}));return function(t,n){return e.apply(this,arguments)}}(),ss=[ti({imageBase64Data:zr().optional(),imageUrl:zr().url().optional()}).optional()];function us(e){return cs.apply(this,arguments)}function cs(){return cs=he((function(e){return _e(this,(function(t){return[2,hn("saveImageToGallery",ss,[e],function(){var e=he((function(e){return _e(this,(function(t){switch(t.label){case 0:return Oe.isMp?[4,as(e.imageBase64Data,e.imageUrl)]:[3,2];case 1:return[2,t.sent()];case 2:return Oe.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Ie("saveImageToGallery",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),cs.apply(this,arguments)}var ls=function(){var e=he((function(e){var t,n,r,i,o,s,u=arguments;return _e(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,ba(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(a,"/").concat(e).concat(t);try{s=new URL(o),Object.entries(n).forEach((function(e){var t=Ne(e,2),n=t[0],r=t[1];s.searchParams.append(n,String(r))})),o=s.href}catch(e){}return[2,new Promise((function(e,t){Yt("OPEN_MP",{mpUrl:o,mpInfo:i},{success:function(){e()},fail:function(e){t(e)}},{})}))]}}))}));return function(t){return e.apply(this,arguments)}}(),ds=[ti({appId:zr(),path:zr().optional(),params:Ei.record(zr(),zr()).optional()})];function ps(e){return fs.apply(this,arguments)}function fs(){return fs=he((function(e){return _e(this,(function(t){return[2,hn("openMiniApp",ds,[e],function(){var e=he((function(e){return _e(this,(function(t){switch(t.label){case 0:return Oe.isMp?[4,ls(e.appId,e.path,e.params)]:[3,2];case 1:return[2,t.sent()];case 2:return Oe.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Ie("openMiniApp",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),fs.apply(this,arguments)}var hs=he((function(){var e,t,n=arguments;return _e(this,(function(r){return e=n.length>0&&void 0!==n[0]?n[0]:"oneShot",t=n.length>1?n[1]:void 0,[2,new Promise((function(n,r){Yt("INTERACTIVE_VIBRATION",{type:w[e],vibrate_time:t},{success:function(){n()},fail:function(e){r(e)}},{})}))]}))})),ms=[ti({type:Ei.enum(["oneShot"]).default("oneShot"),milliseconds:Wr().optional()})];function vs(e){return ys.apply(this,arguments)}function ys(){return ys=he((function(e){return _e(this,(function(t){return[2,hn("vibrate",ms,[e],function(){var e=he((function(e){return _e(this,(function(t){switch(t.label){case 0:return Oe.isMp?[4,hs(null==e?void 0:e.type,null==e?void 0:e.milliseconds)]:[3,2];case 1:return[2,t.sent()];case 2:return Oe.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Ie("vibrate",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),ys.apply(this,arguments)}var gs=function(){var e=he((function(e,t){var n,r,i,o;return _e(this,(function(a){return n=new URL(e),r=n.href.includes("vnpay"),i=n.searchParams.get("typeInapp"),o=ft.isEmpty(t)?void 0:{modal_style:(null==t?void 0:t.style)?zt(null==t?void 0:t.style):"bottom_sheet",left_button:(null==t?void 0:t.leftButton)?zt(null==t?void 0:t.leftButton):"back"},!r&&ft.isEmpty(i)&&n.searchParams.set("typeInapp","1"),[2,new Promise((function(e,t){Yt("OPEN_INAPP",{url:n.href,style:o},{success:function(){e()},fail:function(e){t(e)}},{})}))]}))}));return function(t,n){return e.apply(this,arguments)}}(),_s=[ti({url:zr(),config:ti({style:Ei.enum(["bottomSheet","normal"]).default("bottomSheet").optional(),leftButton:Ei.enum(["back","none"]).default("back").optional()}).optional()})];function ws(e){return bs.apply(this,arguments)}function bs(){return bs=he((function(e){return _e(this,(function(t){return[2,hn("openWebview",_s,[e],function(){var e=he((function(e){return _e(this,(function(t){switch(t.label){case 0:return Oe.isMp?[4,gs(e.url,e.config)]:[3,2];case 1:return[2,t.sent()];case 2:return Oe.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Ie("openWebview",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),bs.apply(this,arguments)}function Ts(){var e={},t=window.location.href;try{var n=new URL(t).searchParams.toString();n&&(e=Nt.getParamsAsObject(n))}catch(e){throw new Error("Invalid URL")}return e}function Es(){return hn("getRouteParams",[],[],(function(){return Ts()}))}function Ss(e){return Ps.apply(this,arguments)}function Ps(){return(Ps=he((function(e){return _e(this,(function(t){return[2,hn("getAppInfo",[],[e],he((function(){return _e(this,(function(e){switch(e.label){case 0:return Oe.isMp?[4,ba()]:[3,2];case 1:return[2,e.sent()];case 2:return Oe.isMpWeb?[2,Promise.resolve({description:"",name:"",version:"",appUrl:"",qrCodeUrl:""})]:[2,Promise.reject(Ie("getAppInfo",{}))]}}))})))]}))}))).apply(this,arguments)}var Os=function(){var e=he((function(e){return _e(this,(function(t){return[2,new Promise((function(t,n){Yt("WEBVIEW_SET_RESULT",{result:cn(e)},{success:function(){t()},fail:function(e){n(e)}},{})}))]}))}));return function(t){return e.apply(this,arguments)}}(),As=[ti({data:Ei.any()})];function Is(e){return ks.apply(this,arguments)}function ks(){return ks=he((function(e){return _e(this,(function(t){return[2,hn("sendDataToPreviousMiniApp",As,[e],function(){var e=he((function(e){return _e(this,(function(t){switch(t.label){case 0:return Oe.isMp?[4,Os(e.data)]:[3,2];case 1:return[2,t.sent()];case 2:return Oe.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Ie("sendDataToPreviousMiniApp",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),ks.apply(this,arguments)}var Cs=he((function(){return _e(this,(function(e){return[2,new Promise((function(e,t){var n,r;Yt("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(Qt.error.clientNotSupport())},fail:function(e){t(e)}},{delay:(null===(n=Pe())||void 0===n||null===(r=n.platform)||void 0===r?void 0:r.isIOS)?400:0})}))]}))}));function Ns(e){return Ms.apply(this,arguments)}function Ms(){return(Ms=he((function(e){return _e(this,(function(t){return[2,hn("getPhoneNumber",[],[e],he((function(){return _e(this,(function(e){switch(e.label){case 0:return Oe.isMp?[4,Cs()]:[3,2];case 1:return[2,e.sent()];case 2:return Oe.isMpWeb?[2,Promise.resolve({number:""})]:[2,Promise.reject(Ie("getPhoneNumber",{}))]}}))})))]}))}))).apply(this,arguments)}var xs=he((function(){var e,t=arguments;return _e(this,(function(n){return e=t.length>0&&void 0!==t[0]?t[0]:1,[2,new Promise((function(t,n){Yt("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})}))]}))})),Rs=[ti({maxProfile:Wr().min(1).max(10).optional().default(1)})];function Ds(e){return js.apply(this,arguments)}function js(){return js=he((function(e){return _e(this,(function(t){return[2,hn("openProfilePicker",Rs,[e],function(){var e=he((function(e){var t,n,r,i,o;return _e(this,(function(a){switch(a.label){case 0:return Oe.isMp?[4,xs(null==e?void 0:e.maxProfile)]:[3,8];case 1:if(!((t=a.sent()).length>0))return[3,7];a.label=2;case 2:return a.trys.push([2,6,,7]),[4,tn.getAccessToken()];case 3:return r=a.sent(),[4,fetch(l.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(ft.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 Oe.isMpWeb?[2,Promise.resolve({users:[]})]:[2,Promise.reject(Ie("openProfilePicker",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),js.apply(this,arguments)}var Us=function(){var e=he((function(e,t,n){var r;return _e(this,(function(i){return r=t&&ft.isString(t)&&t.length>0?"wpa_wpa2":"open",[2,new Promise((function(i,o){Yt("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)}}(),Ls=[ti({SSID:zr(),password:zr().optional(),hiddenSSID:Hr().optional()})];function Bs(e){return Zs.apply(this,arguments)}function Zs(){return Zs=he((function(e){return _e(this,(function(t){return[2,hn("connectWifi",Ls,[e],function(){var e=he((function(e){return _e(this,(function(t){switch(t.label){case 0:return Oe.isMp?[4,Us(e.SSID,e.password,e.hiddenSSID)]:[3,2];case 1:return[2,t.sent()];case 2:return Oe.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Ie("connectWifi",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Zs.apply(this,arguments)}var zs=function(){var e=he((function(e,t,n,r,i,o){var a,s;return _e(this,(function(u){return a={type:0,url:t,max_size:n||1048576},s={enable:1,aspect_ratio:"1:1"},[2,new Promise((function(t,n){Yt("PICK_MEDIA",{media_type:b[e],edit_view:Ce({},s,r),silent_request:i,upload:a,max_select_items:o},{success:function(e){t(null==e?void 0:e.result_content)},fail:function(e){n(e)}},{isMultiCallback:!0})}))]}))}));return function(t,n,r,i,o,a){return e.apply(this,arguments)}}(),Ws=[ti({type:Ei.enum(["video","photo","file","zcamera","zcamera_photo","zcamera_video","zcamera_scan"]),serverUploadUrl:zr().url(),maxItemSize:Wr().min(0).optional(),editView:ti({enable:Hr().optional(),aspectRatio:zr().regex(/^d+:d+$/).optional()}).optional(),silentRequest:Hr().optional(),maxSelectItem:Wr().min(1).optional()})];function Fs(e){return Gs.apply(this,arguments)}function Gs(){return Gs=he((function(e){return _e(this,(function(t){return[2,hn("openMediaPicker",Ws,[e],function(){var e=he((function(e){var t,n,r,i,o,a;return _e(this,(function(s){switch(s.label){case 0:return Oe.isMp?(i={},ft.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,zs(e.type,e.serverUploadUrl,e.maxItemSize,i,o,a)]):[3,2];case 1:return[2,{data:s.sent()}];case 2:return Oe.isMpWeb?[2,Promise.resolve({data:""})]:[2,Promise.reject(Ie("openMediaPicker",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Gs.apply(this,arguments)}var Hs=[ti({title:zr().max(100),description:zr().max(400).default(""),thumbnail:zr().url().optional(),path:zr().optional()})];function Vs(e){return Ks.apply(this,arguments)}function Ks(){return Ks=he((function(e){return _e(this,(function(t){return[2,hn("getShareableLink",Hs,[e],function(){var e=he((function(e){var t;return _e(this,(function(n){switch(n.label){case 0:return[4,tn.getAccessToken()];case 1:return t=n.sent(),[4,pa(window.APP_ID,t||"",e.title,e.description,e.thumbnail,e.path)];case 2:return[2,n.sent().shareableLink]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Ks.apply(this,arguments)}var Js=function(){var e=he((function(e){return _e(this,(function(t){return[2,new Promise((function(t,n){Yt("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 qs(e){return $s.apply(this,arguments)}function $s(){return($s=he((function(e){return _e(this,(function(t){return[2,hn("closeLoading",[],[e],he((function(){return _e(this,(function(e){switch(e.label){case 0:return Oe.isMp?[4,Js("user action")]:[3,2];case 1:return[2,e.sent()];case 2:return Oe.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Ie("closeLoading",{}))]}}))})))]}))}))).apply(this,arguments)}function Qs(e){return Ys.apply(this,arguments)}function Ys(){return Ys=he((function(e){return _e(this,(function(t){return[2,hn("requestUpdateZalo",[],[e],he((function(){var e,t,n;return _e(this,(function(r){switch(r.label){case 0:return Oe.isMp?(n=(null===(e=Pe())||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,Ta(n)]):[3,2];case 1:return[2,r.sent()];case 2:return Oe.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Ie("requestUpdateZalo",{}))]}}))})))]}))})),Ys.apply(this,arguments)}var Xs=It.getInstance();Xs.addListener=function(e,t,n){var r=e;return Xs.addListener(f[r],t,n)};var eu=[Ei.function()];function tu(e){return hn("onConfirmToExit",eu,[e],(function(e){var t=e;Oe.isMp&&(Xs.on(f.AppClose,t,'{"handle_h5": 1}'),Pi.setNavigationBarLeftButton(void 0,2))}))}function nu(){return hn("offConfirmToExit",[],[],(function(){Oe.isMp&&(Xs.off(f.AppClose),Pi.setNavigationBarLeftButton(void 0,0))}))}function ru(){return hn("getDeviceId",[],[],(function(){return Oe.isMp&&tn.getSync(c.DEVICE_ID)||""}))}function iu(e){return ou.apply(this,arguments)}function ou(){return(ou=he((function(e){return _e(this,(function(t){return[2,hn("getDeviceIdAsync",[],[e],he((function(){return _e(this,(function(e){switch(e.label){case 0:return Oe.isMp?[4,tn.jumpAndGetToken(c.DEVICE_ID)]:[3,2];case 1:return[2,e.sent()||""];case 2:return[2,Promise.resolve("")]}}))})))]}))}))).apply(this,arguments)}function au(){return hn("getContext",[],[],(function(){if(Oe.isMp){var e=tn.getSync(c.CONTEXT_ID)||"";return{type:tn.getSync(c.CONTEXT_TYPE)||"",id:e}}return{type:"",id:""}}))}function su(e){return uu.apply(this,arguments)}function uu(){return(uu=he((function(e){return _e(this,(function(t){return[2,hn("getContextAsync",[],[e],he((function(){var e;return _e(this,(function(t){switch(t.label){case 0:return Oe.isMp?[4,tn.jumpAndGetToken(c.CONTEXT_ID)]:[3,3];case 1:return e=t.sent()||"",[4,tn.jumpAndGetToken(c.CONTEXT_TYPE)];case 2:return[2,{type:t.sent()||"",id:e}];case 3:return[2,Promise.resolve({type:"",id:""})]}}))})))]}))}))).apply(this,arguments)}function cu(e){return lu.apply(this,arguments)}function lu(){return(lu=he((function(e){return _e(this,(function(t){return[2,hn("getAuthCode",[],[e],he((function(){var e,t;return _e(this,(function(n){switch(n.label){case 0:return Oe.isMp?[4,tn.jumpAndGetToken(c.ZOAUTH,!0)]:[3,4];case 1:return e=n.sent()||"",[4,tn.jumpAndGetToken(c.ZOAUTH_VRF)];case 2:return t=n.sent()||"",[4,tn.verifyUserAuthorized()];case 3:if(n.sent())return[2,{authCode:e,authCodeVerify:t}];throw Zt([{action:"getAuthCode",error:-104,message:"no user auth",data:{}}]),Qt.error.loginFailed("User Authentication Required");case 4:return[2,Promise.resolve({authCode:"",authCodeVerify:""})]}}))})))]}))}))).apply(this,arguments)}function du(e){return pu.apply(this,arguments)}function pu(){return(pu=he((function(e){return _e(this,(function(t){return[2,hn("getZPIToken",[],[e],he((function(){var e,t,n,r;return _e(this,(function(i){switch(i.label){case 0:return Oe.isMp?[4,tn.jumpAndGetToken(c.UTOKEN_ZPI)]:[3,5];case 1:return e=i.sent()||"",[4,tn.jumpAndGetToken(c.GTOKEN_ZPI)];case 2:return t=i.sent()||"",[4,tn.jumpAndGetToken(c.ZPP_ZPI)];case 3:return n=i.sent()||"",[4,tn.jumpAndGetToken(c.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 fu=[zr()];function hu(e){return hn("setAccessToken",fu,[e],(function(e){var t=e;tn.setAccessToken(t)}))}var mu=[ti({url:zr().url()})];function vu(e){return yu.apply(this,arguments)}function yu(){return yu=he((function(e){return _e(this,(function(t){return[2,hn("openOutApp",mu,[e],function(){var e=he((function(e){return _e(this,(function(t){switch(t.label){case 0:return Oe.isMp?[4,Ta(e.url)]:[3,2];case 1:return[2,t.sent()];case 2:return Oe.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Ie("openOutApp",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),yu.apply(this,arguments)}var gu=[ti({count:Wr().min(1).optional().default(1),sourceType:Ei.array(Ei.enum(["album","camera"])).max(2).default(["album","camera"]).optional(),cameraType:Ei.enum(["back","front"]).default("front").optional()})];function _u(e){return wu.apply(this,arguments)}function wu(){return wu=he((function(e){return _e(this,(function(t){return[2,hn("chooseImage",gu,[e],function(){var e=he((function(e){var t,n,r,i;return _e(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)}}())]}))})),wu.apply(this,arguments)}var bu=he((function(){var e,t,n=arguments;return _e(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){Yt("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(Qt.error.clientNotSupport())},fail:function(e){r(e)}},{isMultiCallback:!0,timeout:!1})}))]}))}));function Tu(e){return Eu.apply(this,arguments)}function Eu(){return(Eu=he((function(e){return _e(this,(function(t){return[2,hn("getLocation",[],[e],he((function(){return _e(this,(function(e){switch(e.label){case 0:return Oe.isMp?[4,bu()]:[3,2];case 1:return[2,e.sent()];case 2:return Oe.isMpWeb?[2,Promise.resolve({longitude:"105.788026",latitude:"21.0258773",timestamp:(new Date).getTime().toString(),provider:"fused"})]:[2,Promise.reject(Ie("getLocation",{}))]}}))})))]}))}))).apply(this,arguments)}var Su=[Ei.function().args(ti({data:Ei.any()})).returns(Ei.void())];function Pu(e){return hn("onCallbackData",Su,[e],(function(){!function(e){It.getInstance().on(f.OnDataCallback,(function(t){e({data:t})}))}(e)}))}var Ou=function(){var e=he((function(e){var t,n,r,o,a,s,u,c,l,d,p;return _e(this,(function(f){switch(f.label){case 0:return n="",e||(e=Ts()),"object"==typeof e&&((n=e.zmpOrderId||"")||(t=e.appTransID||e.orderId||e.apptransid)),"string"==typeof e&&(r=Nt.getParameterByName("orderId",e),o=Nt.getParameterByName("appTransID",e)||Nt.getParameterByName("apptransid",e),t=r||o),a={headers:{authorization:"Bearer "}},[4,tn.getAccessToken().catch((function(){throw Qt.error.loginRequired}))];case 1:return s=f.sent(),a.headers.authorization="Bearer ".concat(s),u=new URL(ie),c={orderId:n,transId:t||"",appId:i},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 Qt.error.badRequest(l.msg);return d=l.data||{},p={err:l.err},0!==Object.keys(d).length&&d.constructor===Object&&Object.assign(p,Ce({msg:d.resultMessage},d)),[2,p]}}))}));return function(t){return e.apply(this,arguments)}}(),Au=function(){var e=he((function(e,t,n,r,o,a,s){var u,c,l,d,p,h,m,v,y,g,_,w,b,T,E,S,P,O,A,I,k;return _e(this,(function(C){switch(C.label){case 0:u=i,(c=new URLSearchParams).append("amount",e.toString()),c.append("item",encodeURIComponent(JSON.stringify(t))),c.append("appId",u),n&&c.append("desc",encodeURIComponent(n)),r&&(l=r,"object"==typeof r&&(l=JSON.stringify(r)),c.append("extradata",encodeURIComponent(l))),o&&(d=o,"object"==typeof o&&(d=JSON.stringify(o)),c.append("payload",encodeURIComponent(d))),a&&("string"==typeof a?(c.append("method",a),c.append("isCustom","false")):"object"==typeof a&&(c.append("method",a.id),c.append("isCustom",JSON.stringify(a.isCustom)))),s&&c.append("mac",s),p={headers:{"Content-Type":"application/x-www-form-urlencoded",authorization:"Bearer "}},C.label=1;case 1:return C.trys.push([1,6,,7]),[4,tn.getAccessToken().catch((function(){throw Qt.error.loginRequired}))];case 2:return m=C.sent(),p.headers.authorization="Bearer ".concat(m),[4,fetch(ne,Xo(Ce({method:"POST"},p),{body:c}))];case 3:return[4,C.sent().json()];case 4:if(!(v=C.sent()).data||0!==v.err)throw Qt.error.badRequest(v.msg);return y=v.data.id,g=v.data.jwt,_=v.data.messageToken||"",w=window.APP_VERSION,b=window.APP_ENV,T={miniAppId:u,orderId:y},E=v.data.method,S=v.data.isCustom,g&&(T.token=g),w&&(T.version=w),b&&(T.env=b),E&&(T.method=E),S&&(T.isCustom=S),P=Nt.encode(T),O=new URL("?".concat(P),"https://payment-mini.zalo.me").toString(),A=Wt(),I=((null===(h=Pe())||void 0===h?void 0:h.platformName)||"").toLowerCase(),[4,gs(O,{style:"android"===I&&A<742?"normal":"bottomSheet"}).then((function(){var e=!1;It.getInstance().once(f.WebviewClosed,(function(){setTimeout(he((function(){var t;return _e(this,(function(n){switch(n.label){case 0:return e?[3,2]:[4,Ou({zmpOrderId:y})];case 1:(t=n.sent()).err>=0&&!t.isCustom&&It.getInstance().emit(f.PaymentClose,t.err,Xo(Ce({},t),{zmpOrderId:y})),n.label=2;case 2:return[2]}}))})),500)})),It.getInstance().once(f.OpenApp,(function(){e=!0}))}))];case 5:return C.sent(),[2,{orderId:y,messageToken:_}];case 6:throw k=C.sent(),console.log("Internal error"),k;case 7:return[2]}}))}));return function(t,n,r,i,o,a,s){return e.apply(this,arguments)}}(),Iu=[ti({amount:Ei.union([zr(),Wr()]),item:Ei.array(Ei.record(zr(),Ei.any())),desc:zr(),extradata:Ei.any().optional(),payload:Ei.any().optional(),method:Ei.union([Ei.string(),Ei.object({id:Ei.string(),isCustom:Ei.boolean()})]).optional(),mac:Ei.string().optional()})];function ku(e){return Cu.apply(this,arguments)}function Cu(){return Cu=he((function(e){return _e(this,(function(t){return[2,hn("createOrder",Iu,[e],function(){var e=he((function(e){return _e(this,(function(t){switch(t.label){case 0:return Oe.isMp?[4,Au(e.amount,e.item,e.desc,e.extradata,e.payload,e.method,e.mac)]:[3,2];case 1:return[2,t.sent()];case 2:return Oe.isMpWeb?[2,Promise.resolve({orderId:"",messageToken:""})]:[2,Promise.reject(Ie("createOrder",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Cu.apply(this,arguments)}var Nu=function(){var e=he((function(e){return _e(this,(function(t){return[2,new Promise((function(t,n){Yt("MP_SELECT_PAYMENT_METHOD",{method:e,forceUpdate:!0},{success:function(e){console.log(e),t(e)},fail:function(e){n(e)}},{})}))]}))}));return function(t){return e.apply(this,arguments)}}(),Mu=[ti({method:zr().optional()}).optional()];function xu(e){return Ru.apply(this,arguments)}function Ru(){return Ru=he((function(e){return _e(this,(function(t){return[2,hn("selectPaymentMethod",Mu,[e],function(){var e=he((function(e){var t;return _e(this,(function(n){switch(n.label){case 0:return Oe.isMp?(t=e.method,[4,Nu(t)]):[3,2];case 1:return[2,n.sent()];case 2:return Oe.isMpWeb?[2,Promise.resolve({method:""})]:[2,Promise.reject(Ie("selectPaymentMethod",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Ru.apply(this,arguments)}var Du=[ti({data:Ei.union([zr(),Ei.record(zr(),zr())])})];function ju(e){return Uu.apply(this,arguments)}function Uu(){return Uu=he((function(e){return _e(this,(function(t){return[2,hn("checkTransaction",Du,[e],function(){var e=he((function(e){return _e(this,(function(t){switch(t.label){case 0:return Oe.isMp?[4,Ou(e.data)]:[3,2];case 1:return[2,t.sent()];case 2:return Oe.isMpWeb?[2,Promise.resolve({msg:"Success",orderId:"",resultCode:1,transTime:(new Date).getTime().toString(),createdAt:(new Date).getTime().toString(),transId:""})]:[2,Promise.reject(Ie("checkTransaction",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Uu.apply(this,arguments)}var Lu=[ti({hide:Hr().default(!1).optional()}).optional()];function Bu(e){return Zu.apply(this,arguments)}function Zu(){return Zu=he((function(e){return _e(this,(function(t){return[2,hn("setAndroidBottomNavigationBar",Lu,[e],function(){var e=he((function(e){return _e(this,(function(t){switch(t.label){case 0:return Oe.isMp?[4,Pi.setAndroidBottomNavigationBar(e.hide)]:[3,2];case 1:return[2,t.sent()];case 2:return Oe.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Ie("setAndroidBottomNavigationBar",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Zu.apply(this,arguments)}var zu=[ti({hide:Hr().default(!1).optional()}).optional()];function Wu(e){return Fu.apply(this,arguments)}function Fu(){return Fu=he((function(e){return _e(this,(function(t){return[2,hn("setIOSBottomSafeArea",zu,[e],function(){var e=he((function(e){return _e(this,(function(t){switch(t.label){case 0:return Oe.isMp?[4,Pi.setIOSBottomSafeArea(e.hide)]:[3,2];case 1:return[2,t.sent()];case 2:return Oe.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Ie("setIOSBottomSafeArea",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Fu.apply(this,arguments)}var Gu=[ti({type:Ei.enum(["normal","hidden","transparent"]).default("normal").optional(),color:Ei.string().optional()}).optional()];function Hu(e){return Vu.apply(this,arguments)}function Vu(){return Vu=he((function(e){return _e(this,(function(t){return[2,hn("setStatusBar",Gu,[e],function(){var e=he((function(e){return _e(this,(function(t){switch(t.label){case 0:return Oe.isMp?[4,Pi.configHeader({statusBarType:e.type,headerColor:e.color})]:[3,2];case 1:return[2,t.sent()];case 2:return Oe.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Ie("setStatusBar",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Vu.apply(this,arguments)}var Ku=[ti({headerTextColor:Ei.enum(["black","white"]).optional(),headerColor:Ei.string().optional(),actionBar:ti({hide:Ei.boolean().optional(),title:Ei.string().optional(),leftButton:Ei.enum(["back","none"]).optional(),textAlign:Ei.enum(["left","center"]).default("left").optional()}).optional(),statusBarType:Ei.enum(["normal","hidden","transparent"]).optional(),hideAndroidBottomNavigationBar:Ei.boolean().optional(),hideIOSSafeAreaBottom:Ei.boolean().optional()})];function Ju(e){return qu.apply(this,arguments)}function qu(){return qu=he((function(e){return _e(this,(function(t){return[2,hn("configAppView",Ku,[e],function(){var e=he((function(e){var t,n,r,i,o,a,s;return _e(this,(function(u){switch(u.label){case 0:return Oe.isMp?ft.isUndefined(null===(t=e.actionBar)||void 0===t?void 0:t.leftButton)?[3,2]:[4,Pi.setNavigationBarLeftButton(null===(a=e.actionBar)||void 0===a?void 0:a.leftButton)]:[3,13];case 1:u.sent(),u.label=2;case 2:return ft.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,Pi.setNavigationBarTitle(null===(s=e.actionBar)||void 0===s?void 0:s.title)];case 3:u.sent(),u.label=4;case 4:return[4,Pi.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,Pi.setAndroidBottomNavigationBar(e.hideAndroidBottomNavigationBar)];case 7:u.sent(),u.label=8;case 8:return"boolean"!=typeof e.hideIOSSafeAreaBottom?[3,10]:[4,Pi.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 Oe.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Ie("configAppView",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),qu.apply(this,arguments)}var $u=function(){var e=he((function(e,t,n,r,o,a){var s,u,c,l,d,p,f,h,m,v,y,g,_,w;return _e(this,(function(b){switch(b.label){case 0:d=i,(p=new URLSearchParams).append("payType",t||T.SUBSCRIPTION),f=E.UNKNOW,n===ae&&(f=E.IMMEDIATE_AND_CHARGE_FULL_PRICE),n===oe&&(f=E.DEFERRED),p.append("utm",o||"default"),p.append("merchantTransId",a||""),p.append("prorationMode",f.toString()),p.append("appId",d),r&&p.append("method",r),h="",(null===(s=Pe())||void 0===s||null===(u=s.platform)||void 0===u?void 0:u.isIOS)?h="ios":(null===(c=Pe())||void 0===c||null===(l=c.platform)||void 0===l?void 0:l.isAndroid)&&(h="android"),p.append("os",h),p.append("productId",e),m={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 Qt.error.loginRequired}))];case 2:return v=b.sent(),m.headers.authorization="Bearer ".concat(v),[4,fetch(re,Xo(Ce({method:"POST"},m),{body:p}))];case 3:return[4,b.sent().json()];case 4:if(!(y=b.sent()).data||!y.data.store||0!==y.err)throw Qt.error.createIAPOrderFailed(y.err);return g=y.data.store,_=y.data.orderId,[2,new Promise((function(e,t){Yt("IAP_REQUESTPAYMENT",Ce({},g),{success:function(){e({orderId:_})},fail:function(e){t(e)}})}))];case 5:throw w=b.sent(),console.log("Internal error"),w;case 6:return[2]}}))}));return function(t,n,r,i,o,a){return e.apply(this,arguments)}}(),Qu=[ti({productId:zr(),payType:Ei.enum(["ONETIME","SUBSCRIPTION"]).optional(),prorationMode:Ei.enum(["DEFERRED","IMMEDIATE_AND_CHARGE_FULL_PRICE"]).default("DEFERRED").optional(),utm:zr().optional(),method:Ei.enum(["IAP","IAP_SANDBOX"]).optional(),merchantTransId:zr().optional()})];function Yu(e){return Xu.apply(this,arguments)}function Xu(){return Xu=he((function(e){return _e(this,(function(t){return[2,hn("createOrderIAP",Qu,[e],function(){var e=he((function(e){return _e(this,(function(t){switch(t.label){case 0:return Oe.isMp?[4,$u(e.productId,e.payType,e.prorationMode,e.method,e.utm,e.merchantTransId)]:[3,2];case 1:return[2,t.sent()];case 2:return Oe.isMpWeb?[2,Promise.resolve({orderId:""})]:[2,Promise.reject(Ie("createOrderIAP",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Xu.apply(this,arguments)}var ec=he((function(){return _e(this,(function(e){return[2,new Promise((function(e,t){Yt("MA_MENU_MINIMIZE",{},{success:function(t){e(t)},fail:function(e){t(e)}},{})}))]}))}));function tc(e){return nc.apply(this,arguments)}function nc(){return(nc=he((function(e){return _e(this,(function(t){return[2,hn("minimizeApp",[],[e],he((function(){return _e(this,(function(e){switch(e.label){case 0:return Oe.isMp?[4,ec()]:[3,2];case 1:return[2,e.sent()];case 2:return Oe.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Ie("minimizeApp",{}))]}}))})))]}))}))).apply(this,arguments)}var rc=he((function(){return _e(this,(function(e){return[2,new Promise((function(e,t){Yt("MA_MENU_PERMISSION",{},{success:function(t){e(t)},fail:function(e){t(e)}},{}),e()}))]}))}));function ic(e){return oc.apply(this,arguments)}function oc(){return(oc=he((function(e){return _e(this,(function(t){return[2,hn("openPermissionSetting",[],[e],he((function(){return _e(this,(function(e){switch(e.label){case 0:return Oe.isMp?[4,rc()]:[3,2];case 1:return[2,e.sent()];case 2:return Oe.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Ie("openPermissionSetting",{}))]}}))})))]}))}))).apply(this,arguments)}var ac=he((function(){return _e(this,(function(e){return[2,new Promise((function(e,t){Yt("MP_ADD_MYFAVORITES",{timestamp:(new Date).getTime()},{success:function(t){e(t)},fail:function(e){t(e)}},{})}))]}))}));function sc(e){return uc.apply(this,arguments)}function uc(){return(uc=he((function(e){return _e(this,(function(t){return[2,hn("favoriteApp",[],[e],he((function(){return _e(this,(function(e){switch(e.label){case 0:return Oe.isMp?[4,ac()]:[3,2];case 1:return[2,e.sent()];case 2:return Oe.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Ie("favoriteApp",{}))]}}))})))]}))}))).apply(this,arguments)}var cc=he((function(){return _e(this,(function(e){return[2,new Promise((function(e,t){Yt("OPEN_GROUPLIST",{},{success:function(t){e(t)},fail:function(e){t(e)}},{})}))]}))}));function lc(e){return dc.apply(this,arguments)}function dc(){return(dc=he((function(e){return _e(this,(function(t){return[2,hn("openGroupList",[],[e],he((function(){return _e(this,(function(e){switch(e.label){case 0:return Oe.isMp?[4,cc()]:[3,2];case 1:return[2,e.sent()];case 2:return Oe.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Ie("openGroupList",{}))]}}))})))]}))}))).apply(this,arguments)}var pc=he((function(){var e;return _e(this,(function(t){switch(t.label){case 0:return[4,tn.getAccessToken()];case 1:return e=t.sent(),[2,new Promise((function(t,n){Yt("MP_SEND_NOTIFICATION",{accessToken:e},{success:function(e){t(e)},fail:function(e){n(e)}},{delay:500})}))]}}))}));function fc(e){return hc.apply(this,arguments)}function hc(){return(hc=he((function(e){return _e(this,(function(t){return[2,hn("requestSendNotification",[],[e],he((function(){return _e(this,(function(e){switch(e.label){case 0:return Oe.isMp?[4,pc()]:[3,2];case 1:return[2,e.sent()];case 2:return Oe.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Ie("requestSendNotification",{}))]}}))})))]}))}))).apply(this,arguments)}var mc=he((function(){return _e(this,(function(e){return[2,new Promise((function(e,t){Yt("MP_ADD_RATING",{},{success:function(t){e(t)},fail:function(e){t(e)}},{})}))]}))}));function vc(e){return yc.apply(this,arguments)}function yc(){return(yc=he((function(e){return _e(this,(function(t){return[2,hn("addRating",[],[e],he((function(){return _e(this,(function(e){switch(e.label){case 0:return Oe.isMp?[4,mc()]:[3,2];case 1:return[2,e.sent()];case 2:return Oe.isMpWeb?[2,Promise.resolve({})]:[2,Promise.reject(Ie("addRating",{}))]}}))})))]}))}))).apply(this,arguments)}var gc,_c=(gc=he((function(e,t,n){var r,i;return _e(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(l.CHECK_INTERACT_OA,Ce({method:"POST",body:r},i))];case 1:return[4,o.sent().json()];case 2:return[2,o.sent()]}}))})),function(e,t,n){return gc.apply(this,arguments)}),wc=function(){var e=he((function(e){return _e(this,(function(t){return[2,new Promise((function(t,n){Yt("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)}}(),bc=[ti({oaId:zr()})];function Tc(e){return Ec.apply(this,arguments)}function Ec(){return Ec=he((function(e){return _e(this,(function(t){return[2,hn("interactOA",bc,[e],function(){var e=he((function(e){var t,n,r;return _e(this,(function(o){switch(o.label){case 0:return Oe.isMp?(t=e.oaId,[4,tn.getAccessToken()]):[3,5];case 1:return!(n=o.sent())||ft.isEmpty(n)?[3,3]:[4,_c(t,i,n)];case 2:if(0===(null==(r=o.sent())?void 0:r.err))return[2,Promise.resolve({})];o.label=3;case 3:return[4,wc(t)];case 4:return[2,o.sent()];case 5:return Oe.isMpWeb?[2,Promise.resolve({})]:[2,Promise.reject(Ie("interactOA",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Ec.apply(this,arguments)}var Sc=[ti({oaId:zr()})];function Pc(e){return Oc.apply(this,arguments)}function Oc(){return Oc=he((function(e){return _e(this,(function(t){return[2,hn("isAllowedInteractWithOA",Sc,[e],function(){var e=he((function(e){var t,n,r;return _e(this,(function(o){switch(o.label){case 0:return Oe.isMp?(t=e.oaId,[4,tn.getAccessToken()]):[3,4];case 1:return!(n=o.sent())||ft.isEmpty(n)?[3,3]:[4,_c(t,i,n)];case 2:return r=o.sent(),[2,Promise.resolve({status:0===(null==r?void 0:r.err)})];case 3:return[2,Promise.resolve({status:!1})];case 4:return Oe.isMpWeb?[2,Promise.resolve({status:!1})]:[2,Promise.reject(Ie("IsAllowedInteractWithOA",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Oc.apply(this,arguments)}function Ac(e){return Ic.apply(this,arguments)}function Ic(){return(Ic=he((function(e){return _e(this,(function(t){return[2,hn("getSetting",[],[e],he((function(){return _e(this,(function(e){switch(e.label){case 0:return Oe.isMp?[4,qt()]:[3,2];case 1:return[2,e.sent()];case 2:return Oe.isMpWeb?[2,Promise.resolve({authSetting:{}})]:[2,Promise.reject(Ie("getSetting",{}))]}}))})))]}))}))).apply(this,arguments)}var kc=Ei.enum(["scope.userInfo","scope.userLocation","scope.userPhonenumber"]),Cc=[ti({scopes:Ei.array(kc).max(2).optional()}).optional()];function Nc(e){return Mc.apply(this,arguments)}function Mc(){return Mc=he((function(e){return _e(this,(function(t){return[2,hn("authorize",Cc,[e],function(){var e=he((function(e){var t,n,r,i;return _e(this,(function(o){switch(o.label){case 0:return Oe.isMp?(n=null==e?void 0:e.scopes,r=Wt(),("android"===(i=((null===(t=Pe())||void 0===t?void 0:t.platformName)||"").toLowerCase())&&r<724||"ios"===i&&r<573)&&n&&n.length>0?[2,Promise.reject(Qt.error.clientNotSupport())]:[4,Xt(null!=n?n:void 0)]):[3,2];case 1:return[2,o.sent()];case 2:return Oe.isMpWeb?[2,Promise.resolve({})]:[2,Promise.reject(Ie("authorize",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Mc.apply(this,arguments)}var xc=he((function(){return _e(this,(function(e){return[2,new Promise(function(){var e=he((function(e,t){var n;return _e(this,(function(r){switch(r.label){case 0:return ft.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(Qt.error.clientNotSupport()),[2]}}))}));return function(t,n){return e.apply(this,arguments)}}())]}))}));function Rc(e){return hn("checkZaloCameraPermission",[],[e],he((function(){return _e(this,(function(e){switch(e.label){case 0:return[4,xc()];case 1:return[2,e.sent()]}}))})))}var Dc=he((function(){return _e(this,(function(e){return[2,new Promise(function(){var e=he((function(e,t){var n,r,i;return _e(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 jc(e){return Uc.apply(this,arguments)}function Uc(){return(Uc=he((function(e){return _e(this,(function(t){return[2,hn("getUserID",[],[e],he((function(){return _e(this,(function(e){switch(e.label){case 0:return Oe.isMp?[4,Dc()]:[3,2];case 1:return[2,e.sent()];case 2:return Oe.isMpWeb?[2,Promise.resolve(void 0)]:[2,Promise.reject(Ie("getUserID",{}))]}}))})))]}))}))).apply(this,arguments)}var Lc=he((function(){return _e(this,(function(e){return[2,new Promise(function(){var e=he((function(e,t){var n,r,i;return _e(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 Bc(e){return Zc.apply(this,arguments)}function Zc(){return(Zc=he((function(e){return _e(this,(function(t){return[2,hn("getIDToken",[],[e],he((function(){return _e(this,(function(e){switch(e.label){case 0:return Oe.isMp?[4,Lc()]:[3,2];case 1:return[2,e.sent()];case 2:return Oe.isMpWeb?[2,Promise.resolve(void 0)]:[2,Promise.reject(Ie("getIDToken",{}))]}}))})))]}))}))).apply(this,arguments)}var zc={format:C.JPEG,quality:N.NORMAL,mirrored:!1,useVideoSourceSize:!1},Wc={width:1024,height:768,facingMode:k.FRONT,mirrored:!1,audio:!1,video:!0},Fc=function(){function e(t){var n,r,i,o,a,s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,u=this;ht(this,e),this._videoEnabled=!0,this._audioEnabled=null,this.tick=function(){if(u.haveVideoStream()&&u._userRequestFrameCallback){var e=u.getCanvas();if(u.drawFrame(),e){var t={data:e.toDataURL(C.PNG),width:e.width,height:e.height};It.getInstance().emit(I.OnFrameCallback,0,t),requestAnimationFrame(u.tick)}}},this._videoElement=t,this._mediaConstraints=null!=s?s:null,this._facingMode=null!==(n=null==s?void 0:s.facingMode)&&void 0!==n?n:Wc.facingMode,this._cameraList=[],this._stream=null,this._selectedDeviceId=null!==(r=null==s?void 0:s.deviceId)&&void 0!==r?r:"",this._canvasElement=null,this._ctx=null,this._hasUserMedia=!1,this._mirror=null!==(i=null==s?void 0:s.mirrored)&&void 0!==i?i:Wc.mirrored,this._userRequestFrameCallback=!1,this._audioEnabled=null!==(o=null==s?void 0:s.audio)&&void 0!==o?o:Wc.audio,this._videoEnabled=null!==(a=null==s?void 0:s.video)&&void 0!==a?a:Wc.video}var t=e.prototype;return t.on=function(e,t){It.getInstance().on(e,(function(e){t(e)})),e===I.OnFrameCallback&&(this._userRequestFrameCallback=!0,this.tick())},t.off=function(e){It.getInstance().off(e),e===I.OnFrameCallback&&(this._userRequestFrameCallback=!1)},t.getQualityNumber=function(e){switch(e){case"high":return.9;case"normal":default:return.6;case"low":return.2}},t.getFacingMode=function(){return this._facingMode},t.getCameraList=function(){return this._cameraList},t.getCameraCount=function(){return this._cameraList.length},t.getSelectedDeviceId=function(){return this._selectedDeviceId},t.setDeviceId=function(e){var t=this;return he((function(){return _e(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]}}))}))()},t.getVideoInputs=function(e){var t=this;return this._cameraList=[],e.forEach((function(e){"videoinput"===e.kind&&t._cameraList.push(e)})),this._cameraList},t.updateMediaConstraints=function(e){var t=this;return he((function(){var n,r,i,o,a,s;return _e(this,(function(u){switch(u.label){case 0:return ft.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]}}))}))()},t.getCurrentMediaConstraints=function(){var e=this._mediaConstraints,t={};this._videoElement.width=(null==e?void 0:e.width)||this._videoElement.width||Wc.width,this._videoElement.height=(null==e?void 0:e.height)||this._videoElement.height||Wc.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}},t.selectCamera=function(){var e=!0,t=!1,n=void 0;try{for(var r,i=this._cameraList[Symbol.iterator]();!(e=(r=i.next()).done);e=!0){var o=r.value;if(this._facingMode==k.FRONT&&o.label.toLowerCase().includes("front")||this._facingMode==k.BACK&&o.label.toLowerCase().includes("back")){this._selectedDeviceId=o.deviceId;break}}}catch(e){t=!0,n=e}finally{try{e||null==i.return||i.return()}finally{if(t)throw n}}},t.flip=function(){var e=this;return he((function(){return _e(this,(function(t){switch(t.label){case 0:return e._facingMode=e._facingMode==k.FRONT?k.BACK:k.FRONT,e._videoElement.style.transform="",e.selectCamera(),e._hasUserMedia?[4,e.stream()]:[3,2];case 1:t.sent(),t.label=2;case 2:return[2]}}))}))()},t.start=function(){var e=this;return he((function(){var t,n;return _e(this,(function(r){return t=It.getInstance(),n=function(t){try{e._hasUserMedia&&e.stop()}catch(e){}},t.off(f.AppPaused,n),t.on(f.AppPaused,n),[2,new Promise(function(){var t=he((function(t,n){var r;return _e(this,(function(i){switch(i.label){case 0:return i.trys.push([0,2,,3]),[4,e.stream()];case 1:return i.sent(),It.getInstance().emit(I.OnStartCallback,0),t(e._selectedDeviceId),[3,3];case 2:return r=i.sent(),n(r),[3,3];case 3:return[2]}}))}));return function(e,n){return t.apply(this,arguments)}}())]}))}))()},t.info=function(){var e=this;return he((function(){return _e(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)}))}))]}))}))()},t.stream=function(){var e=this;return he((function(){return _e(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=he((function(n){return _e(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)}}))]}))}))()},t.handleUserMedia=function(e,t){var n=this;if(!e&&t){this._stream=t;try{this._videoElement&&(this._videoElement.srcObject=t,(this._facingMode==k.FRONT||this._mirror)&&(this._videoElement.style.transform="scale(-1,1)"),this._videoElement.onloadedmetadata=function(){n._userRequestFrameCallback&&n.tick()},this._videoElement.play().then((function(){n._hasUserMedia=!0})).catch((function(e){n._hasUserMedia=!1})))}catch(e){this._hasUserMedia=!1}}else this._hasUserMedia=!1},t.updateTrackEnable=function(e,t){var n=this;return he((function(){return _e(this,(function(r){switch(r.label){case 0:if(e===M.VIDEO){if(n._videoEnabled===t)return[2];n._videoEnabled=t}else{if(n._audioEnabled===t)return[2];n._audioEnabled=t}return[4,n.stream()];case 1:return r.sent(),[2]}}))}))()},t.pause=function(e){var t=this;return he((function(){return _e(this,(function(n){switch(n.label){case 0:return[4,t.updateTrackEnable(e,!1)];case 1:return n.sent(),[2]}}))}))()},t.resume=function(e){var t=this;return he((function(){return _e(this,(function(n){switch(n.label){case 0:return[4,t.updateTrackEnable(e,!0)];case 1:return n.sent(),[2]}}))}))()},t.isUsing=function(){return this._hasUserMedia},t.stop=function(){this._stop(),It.getInstance().emit(I.OnStopCallback,0)},t._stop=function(){e.stopMediaStream(this._stream),this._hasUserMedia=!1},t.setFacingMode=function(e){this._facingMode=e},t.setMirror=function(e){this._mirror=e,this._videoElement&&(this._videoElement.style.transform=e?"scale(-1,1)":"")},t.takePhoto=function(e){if(!this._hasUserMedia)return null;var t=e||{},n=this.getCanvas(t);if(this.drawFrame(t),n){var r=t.format||zc.format;return{data:n.toDataURL(r,this.getQualityNumber(t.quality)),width:n.width,height:n.height}}return null},t.haveVideoStream=function(){var e=this._videoElement;return e&&e.videoHeight>0&&this._hasUserMedia},t.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},t.drawFrame=function(e){var t=this._videoElement,n=e||{};if(t&&this._ctx&&this._canvasElement){var r=this._canvasElement,i=this._ctx;r.width=(null==n?void 0:n.width)||r.width,r.height=(null==n?void 0:n.height)||r.height,((null==n?void 0:n.mirrored)||this._mirror||this._facingMode===k.FRONT)&&(i.translate(r.width,0),i.scale(-1,1)),i.drawImage(t,0,0,r.width,r.height),((null==n?void 0:n.mirrored)||this._mirror||this._facingMode===k.FRONT)&&(i.scale(-1,1),i.translate(-r.width,0))}},e.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())},e}(),Gc=ti({play:Ei.function(),pause:Ei.function()}).refine((function(e){return"play"in e&&"pause"in e}),{message:"Invalid HTMLVideoElement"}),Hc=[ti({videoElement:Gc,mediaConstraints:Ei.object({width:Ei.number().min(100).optional(),height:Ei.number().min(100).optional(),facingMode:Ei.string().optional(),audio:Ei.boolean().optional(),video:Ei.boolean().optional(),deviceId:Ei.string().optional(),mirrored:Ei.boolean().optional()}).nullish()}).optional()];function Vc(e){return hn("createCameraContext",Hc,[e],(function(e){return console.log("createCameraContext",e),new Fc(e.videoElement,e.mediaConstraints)}))}var Kc=function(){function e(){var t,n;ht(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=ge(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;ft.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?ft.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?ft.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 Jc(e){return qc.apply(this,arguments)}function qc(){return(qc=he((function(e){return _e(this,(function(t){return[2,hn("setupAd",[],[e],(function(){return Kc.getInstance().loadSDK()}))]}))}))).apply(this,arguments)}var $c=[ti({ids:Ei.union([Ei.string(),Ei.array(Ei.string())]),config:ti({display:Ei.boolean().optional(),onClose:Ei.function().optional()}).optional()})];function Qc(e){return Yc.apply(this,arguments)}function Yc(){return Yc=he((function(e){return _e(this,(function(t){return[2,hn("loadAd",$c,[e],function(){var e=he((function(e){return _e(this,(function(t){return Kc.getInstance().load(e.ids,e.config),[2]}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Yc.apply(this,arguments)}var Xc=[ti({id:Ei.string()})];function el(e){return tl.apply(this,arguments)}function tl(){return tl=he((function(e){return _e(this,(function(t){return[2,hn("displayAd",Xc,[e],function(){var e=he((function(e){return _e(this,(function(t){return Kc.getInstance().display(e.id),[2]}))}));return function(t){return e.apply(this,arguments)}}())]}))})),tl.apply(this,arguments)}var nl=[ti({id:Ei.string().optional()}).optional()];function rl(e){return il.apply(this,arguments)}function il(){return il=he((function(e){return _e(this,(function(t){return[2,hn("refreshAd",nl,[e],function(){var e=he((function(e){return _e(this,(function(t){return Kc.getInstance().refresh(e.id),[2]}))}));return function(t){return e.apply(this,arguments)}}())]}))})),il.apply(this,arguments)}var ol=[ti({id:zr(),guidingText:zr().optional(),color:zr().optional(),onStatusChange:Ei.function().optional()})];function al(e){return sl.apply(this,arguments)}function sl(){return sl=he((function(t){return _e(this,(function(n){return[2,hn("showOAWidget",ol,[t],function(){var t=he((function(t){var n,r,i,o,a,s,u,c;return _e(this,(function(l){if(Oe.isMp){try{n=document.getElementById(t.id),r=t.onStatusChange,i=t.guidingText,o=t.color,a=e(t,["onStatusChange","guidingText","color"]),n&&(s=document.createElement("iframe"),u="iframeOAWidget_".concat(Date.now()),(c=new URL("https://h5.zalo.me/widgets/oa_widget.html")).searchParams.set("id",u),i&&c.searchParams.set("guidingText",i),o&&c.searchParams.set("color",o),Object.entries(a).forEach((function(e){var t=Ne(e,2),n=t[0],r=t[1];r&&c.searchParams.set("data-".concat(n),String(r))})),s.id=u,s.src=c.href,s.style.width="100%",s.style.height="100%",s.style.border="none",n.innerHTML=s.outerHTML,window.addEventListener("message",function(){var e=he((function(e){var t,n,i,o,a,s,l,d;return _e(this,(function(p){switch(p.label){case 0:return t=e.data,e.origin.startsWith("https://h5.zalo.me")?(n=document.getElementById(u),i=t.type,(o=new URL(t.href)).origin!==c.origin||o.pathname!==c.pathname||t.id!==u?[3,3]:"followOA"!==i&&"getOAInfo"!==i?[3,2]:[4,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}},"*"),[3,3];case 2:"oaInfo"===i?null==r||r(null===(d=t.payload)||void 0===d?void 0:d.followed):"openOA"===i?Ho(t.payload.id,"oa"):"heightChange"===i&&(n.style.height="".concat(t.payload,"px")),p.label=3;case 3:return[2]}}))}));return function(t){return e.apply(this,arguments)}}(),!1))}catch(e){console.log(e)}return[2,Promise.resolve()]}return Oe.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Ie("openMiniApp",{}))]}))}));return function(e){return t.apply(this,arguments)}}())]}))})),sl.apply(this,arguments)}var ul=[ti({id:zr(),type:zr(),text:zr(),color:zr().optional(),disabled:Ei.boolean().optional(),onDataReceived:Ei.function().optional(),onError:Ei.function().optional()})];function cl(e){return ll.apply(this,arguments)}function ll(){return ll=he((function(t){return _e(this,(function(n){return[2,hn("showFunctionButtonWidget",ul,[t],function(){var t=he((function(t){var n,r,i,o,a,s,u;return _e(this,(function(c){if(Oe.isMp){try{n=document.getElementById(t.id),r=t.onDataReceived,i=t.onError,o=e(t,["onDataReceived","onError"]),n&&(a=document.createElement("iframe"),s="iframeFunctionButtonWidget".concat(Date.now()),(u=new URL("https://h5.zalo.me/widgets/function_button_widget.html")).searchParams.set("id",s),Object.entries(o).forEach((function(e){var t=Ne(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=Ne(e,2),n=t[0],r=t[1];r&&a.setAttribute("data-".concat(n),String(r))})),n.innerHTML=a.outerHTML,window.addEventListener("message",function(){var e=he((function(e){var t,n,a,c,l,d,p,f,h,m,v,y;return _e(this,(function(g){switch(g.label){case 0:return t=e.data,e.origin.startsWith("https://h5.zalo.me")?(n=document.getElementById(s),a=t.type,(c=new URL(t.href)).origin!==u.origin||c.pathname!==u.pathname||t.id!==s?[3,4]:"buttonClicked"!==a?[3,3]:[4,tn.jumpAndGetToken()]):[3,4];case 1:return g.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,yn()];case 2:return m=g.sent(),null==n||null===(p=n.contentWindow)||void 0===p||p.postMessage({type:a,payload:{jwt:f,encryptKey:h,accessToken:m}},"*"),[3,4];case 3:"onSuccess"===a?(null==(v=t.payload)?void 0:v.type)===o.type&&(null==r||r(null==v?void 0:v.data)):"onError"===a&&(null==(y=t.payload)?void 0:y.type)===o.type&&(null==i||i(null==y?void 0:y.data)),g.label=4;case 4:return[2]}}))}));return function(t){return e.apply(this,arguments)}}(),!1))}catch(e){console.log(e)}return[2,Promise.resolve()]}return Oe.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Ie("openMiniApp",{}))]}))}));return function(e){return t.apply(this,arguments)}}())]}))})),ll.apply(this,arguments)}window.ZaloMiniAppSDK={getVersion:bn},mn();var dl=Object.freeze({__proto__:null,get Events(){return f},get EventName(){return f},get CameraEvents(){return I},login:mn,getAccessToken:yn,getVersion:bn,getSystemInfo:En,setNavigationBarTitle:Ai,setNavigationBarColor:Ci,setNavigationBarLeftButton:xi,setStorage:oo,getStorage:uo,getStorageInfo:lo,removeStorage:ho,clearStorage:yo,getUserInfo:bo,getNetworkType:Po,onNetworkStatusChange:Io,startBeaconDiscovery:No,stopBeaconDiscovery:Ro,getBeacons:Uo,closeApp:Zo,scanQRCode:Fo,openProfile:Ko,openChat:Qo,openPostFeed:na,followOA:aa,unfollowOA:la,openShareSheet:ma,requestCameraPermission:ga,createShortcut:Sa,openBioAuthentication:Ia,checkStateBioAuthentication:Na,showToast:Da,hideKeyboard:La,openPhone:Wa,openSMS:Va,viewOAQr:$a,keepScreen:es,onKeepScreen:ns,offKeepScreen:is,saveImageToGallery:us,openMiniApp:ps,vibrate:vs,openWebview:ws,getRouteParams:Es,getAppInfo:Ss,sendDataToPreviousMiniApp:Is,getPhoneNumber:Ns,openProfilePicker:Ds,connectWifi:Bs,openMediaPicker:Fs,getShareableLink:Vs,closeLoading:qs,requestUpdateZalo:Qs,onConfirmToExit:tu,offConfirmToExit:nu,getDeviceId:ru,getDeviceIdAsync:iu,getContext:au,getContextAsync:su,getAuthCode:cu,getZPIToken:du,setAccessToken:hu,openOutApp:vu,chooseImage:_u,getLocation:Tu,onCallbackData:Pu,createOrder:ku,selectPaymentMethod:xu,checkTransaction:ju,events:Xs,setAndroidBottomNavigationBar:Bu,setIOSBottomSafeArea:Wu,setStatusBar:Hu,configAppView:Ju,createOrderIAP:Yu,minimizeApp:tc,openPermissionSetting:ic,favoriteApp:sc,openGroupList:lc,requestSendNotification:fc,addRating:vc,interactOA:Tc,interactOa:Tc,isAllowedInteractWithOA:Pc,getSetting:Ac,authorize:Nc,checkZaloCameraPermission:Rc,getUserID:jc,getIDToken:Bc,createCameraContext:Vc,setupAd:Jc,loadAd:Qc,displayAd:el,refreshAd:rl,showOAWidget:al,showFunctionButtonWidget:cl,get FacingMode(){return k},get PhotoFormat(){return C},get PhotoQuality(){return N},get StreamType(){return M},ZMACameraImp:Fc}),pl=ku,fl=ju,hl=Yu,ml=xu,vl=e(dl,["createOrder","checkTransaction","createOrderIAP","selectPaymentMethod"]),yl={createOrder:pl,checkTransaction:fl,createOrderIAP:hl,selectPaymentMethod:ml};!function(){var e,t=null===(e=Pe())||void 0===e?void 0:e.appEnv;(null==t?void 0:t.isMp)&&(window.ZaloMiniAppSDK={},Object.assign(window.ZaloMiniAppSDK,dl))}();var gl=Object.freeze({__proto__:null,Payment:yl,default:vl,get Events(){return f},get EventName(){return f},get CameraEvents(){return I},login:mn,getAccessToken:yn,getVersion:bn,getSystemInfo:En,setNavigationBarTitle:Ai,setNavigationBarColor:Ci,setNavigationBarLeftButton:xi,setStorage:oo,getStorage:uo,getStorageInfo:lo,removeStorage:ho,clearStorage:yo,getUserInfo:bo,getNetworkType:Po,onNetworkStatusChange:Io,startBeaconDiscovery:No,stopBeaconDiscovery:Ro,getBeacons:Uo,closeApp:Zo,scanQRCode:Fo,openProfile:Ko,openChat:Qo,openPostFeed:na,followOA:aa,unfollowOA:la,openShareSheet:ma,requestCameraPermission:ga,createShortcut:Sa,openBioAuthentication:Ia,checkStateBioAuthentication:Na,showToast:Da,hideKeyboard:La,openPhone:Wa,openSMS:Va,viewOAQr:$a,keepScreen:es,onKeepScreen:ns,offKeepScreen:is,saveImageToGallery:us,openMiniApp:ps,vibrate:vs,openWebview:ws,getRouteParams:Es,getAppInfo:Ss,sendDataToPreviousMiniApp:Is,getPhoneNumber:Ns,openProfilePicker:Ds,connectWifi:Bs,openMediaPicker:Fs,getShareableLink:Vs,closeLoading:qs,requestUpdateZalo:Qs,onConfirmToExit:tu,offConfirmToExit:nu,getDeviceId:ru,getDeviceIdAsync:iu,getContext:au,getContextAsync:su,getAuthCode:cu,getZPIToken:du,setAccessToken:hu,openOutApp:vu,chooseImage:_u,getLocation:Tu,onCallbackData:Pu,createOrder:ku,selectPaymentMethod:xu,checkTransaction:ju,events:Xs,setAndroidBottomNavigationBar:Bu,setIOSBottomSafeArea:Wu,setStatusBar:Hu,configAppView:Ju,createOrderIAP:Yu,minimizeApp:tc,openPermissionSetting:ic,favoriteApp:sc,openGroupList:lc,requestSendNotification:fc,addRating:vc,interactOA:Tc,interactOa:Tc,isAllowedInteractWithOA:Pc,getSetting:Ac,authorize:Nc,checkZaloCameraPermission:Rc,getUserID:jc,getIDToken:Bc,createCameraContext:Vc,setupAd:Jc,loadAd:Qc,displayAd:el,refreshAd:rl,showOAWidget:al,showFunctionButtonWidget:cl,get FacingMode(){return k},get PhotoFormat(){return C},get PhotoQuality(){return N},get StreamType(){return M},ZMACameraImp:Fc,get NetworkType(){return d},get PlatformType(){return p},get JumpStatus(){return h},get ProfileType(){return m},get ChatType(){return v},get PostFeedType(){return y},get ShareSheetType(){return g},get OrientationType(){return _},get VibrateType(){return w},get MediaPickerType(){return b},get IAPPayType(){return T},get ProrationMode(){return E},get StatusBarType(){return S},get AndroidBottomNavigationBarType(){return P},get IOSSafeAreaBottomType(){return O},get TextAlignType(){return A}});window.ZaloMiniAppSDK=gl}();
10
+ !function(){"use strict";function e(e,t){if(null==e)return{};var n,r,i=function(e,t){if(null==e)return{};var n,r,i={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}var t,n=1048576,r=window.zAppID,i=window.APP_ID,o="https://zalo.me/s",a="https://h5.zdn.vn/zapps",s="h5.zdn.vn",u="/zapps",c={ZOAUTH:"h5.zdn.vn_zoauth",ZACC_SESSION:"h5.zdn.vn_zacc_session",JS_TOKEN:"h5.zdn.vn_zlink3rd",ZOAUTH_VRF:"h5.zdn.vn_zoauth_vrf",DEVICE_ID:"h5.zdn.vn_deviceID",CONTEXT_ID:"h5.zdn.vn_contextID",CONTEXT_TYPE:"h5.zdn.vn_contextType",UTOKEN_ZPI:"h5.zdn.vn_utoken_zpi",GTOKEN_ZPI:"h5.zdn.vn_gtoken_zpi",ZPP_ZPI:"h5.zdn.vn_zpp_zpi",ZPT_ZPI:"h5.zdn.vn_zpt_zpi"},l={GET_USER_INFO:"https://graph.zalo.me/v2.0/me",GET_ACCESS_TOKEN:"https://h5.zalo.me/openapi/access_token",GET_ACCESS_TOKEN_V3:"https://oauth.zaloapp.com/v3/access_token",GET_LIST_USER_INFO:"https://graph.zalo.me/v2.0/me/friends/list",CREATE_ORDER:"https://payment-mini.zalo.me/api/order/create",GET_APP_INFO:"https://h5.zalo.me/apps/get-info",SEND_ACTION_LOG:"https://h5.zalo.me/log/async",CREATE_SHARE_LINK:"https://h5.zalo.me/openapi/create-sharelink",CHECK_INTERACT_OA:"https://h5.zalo.me/openapi/check-interact-oa",GET_AUTH_SETTING:"https://h5.zalo.me/apis/users/auth-settings"};!function(e){e.REQUEST="REQUEST",e.MODIFIED_REQUEST="MODIFIED_REQUEST",e.RESPONSE="RESPONSE",e.MODIFIED_RESPONSE="MODIFIED_RESPONSE",e.NOT_FOUND="NOT_FOUND"}(t||(t={}));var d,p,f,h,m,v,y,g,_,w,b,T,E,P,S,O,A,I,k,C,N,M,R=0,x=-2e3,U=-1400,D=-1500,j=-1401,L=-1404,B=-1408,Z=-1409,z=-2004,W=-2005,F="Success",G="Unknown error. Please try again later.",H="Request limit exceeded. Please try again later.",V="Request timeout. Please try again later.",K="Please login (https://miniapp.zalo.me/docs/api/login) before to call this api",J="Login failed",q="This API is not supported in this version of Zalo",Q="User Authentication Required. Please grant User Authentication permission before requesting User Permission",$="Unable to pick media",Y="Unable to save image",X={SUCCESS:{code:R,message:F},UNKNOWN_ERROR:{code:x,message:G},UNAUTHORIZED:{code:j,message:K},FORBIDDEN:{code:-1403,message:"You don't have permission to call this api"},CLIENT_NOT_SUPPORT:{code:L,message:q},DECODE_FAILED:{code:-2001,message:"Can not decode id. Please check your params again."},TIME_OUT:{code:B,message:V},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."}},ee={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:{}},te={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:X.DUPLICATE_REQUEST}},iOS:{"-400":{mapTo:X.DUPLICATE_REQUEST}}}},UNFOLLOW_OA:{haveCallback:!0,requireAccessToken:!0,errorList:{android:{"-400":{mapTo:X.DUPLICATE_REQUEST}},iOS:{"-400":{mapTo:X.DUPLICATE_REQUEST}}}},OPEN_GAMEDETAIL:{},OPEN_SHARESHEET:{haveCallback:!0,requireAccessToken:!0,errorList:{android:{"-101":{mapTo:X.CLIENT_NOT_SUPPORT}},iOS:{"-101":{mapTo:X.CLIENT_NOT_SUPPORT}}}},REQUEST_PERMISSION_CAMERA:{errorList:{android:{"-2":{mapTo:X.USER_DENIED}},iOS:{"-2":{mapTo:X.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:X.USER_DENIED},"-400":{mapTo:X.DUPLICATE_REQUEST}},iOS:{"-1":{mapTo:X.USER_DENIED},"-400":{mapTo:X.DUPLICATE_REQUEST}}}},QUERY_LOCATION_HIDE:{haveCallback:!0},SHOW_TOAST:{haveCallback:!0,timeout:2},OPEN_APP:{},HIDE_KEYBOARD:{},OPEN_PHONE:{},OPEN_QR:{},OPEN_SMS:{},VIEW_MYQR:{haveCallback:!0,timeout:!0,requireAccessToken:!0},KEEP_SCREEN:{haveCallback:!0,timeout:2},CHANGE_AUTOROTATE:{skipJump:!0},CHECK_APP_INSTALLED:{},QUERY_SHOW:{},QUERY_HIDE:{},OPEN_INAPPRW:{},ZALORUN_GETTRACKINGSTATUS:{haveCallback:!0},ZALORUN_SETTRACKINGSTATUS:{haveCallback:!0},ZALORUN_GETDAYSTEP:{haveCallback:!0},ZALORUN_FORCESUBMITDATA:{haveCallback:!0},ZALORUN_SETWEIGHT:{haveCallback:!0},OPEN_PROFILE_EXT:{},DOWNLOAD_CATE:{haveCallback:!0},JUMP_LOGIN:{skipJump:!0,whiteList:!0},OPEN_ADTIMA_ADS_INTERSTITIAL:{},OPEN_ADTIMA_ADS:{},GET_ADIDCLIENT:{},SCAN_IBEACON:{},INTERACTIVE_VIBRATION:{},SAVE_IMAGE_GALLERY:{versionLive:{iOS:408},errorList:{android:{"-101":{mapTo:{code:W,message:Y},needMoreDetail:!0},"-102":{mapTo:{code:W,message:Y},needMoreDetail:!0}},iOS:{"-10":{mapTo:{code:W,message:Y},needMoreDetail:!0}}}},OPEN_MP:{versionLive:{iOS:402}},CHANGE_ACTIONBAR:{haveCallback:!0,timeout:2,versionLive:{iOS:402},skipJump:!0},ZBROWSER_MPDS:{haveCallback:!0,timeout:2,versionLive:{iOS:402}},WEBVIEW_SET_RESULT:{versionLive:{iOS:416}},MP_GET_NUMBER:{versionLive:{iOS:416},errorList:{android:{"-1":{mapTo:X.USER_DENIED},"-101":{mapTo:X.USER_DENIED},"-400":{mapTo:X.DUPLICATE_REQUEST}},iOS:{"-1":{mapTo:X.USER_DENIED},"-10":{mapTo:X.USER_DENIED},"-400":{mapTo:X.DUPLICATE_REQUEST}}}},MP_OPEN_PROFILE_PICKER:{requireAccessToken:!0,versionLive:{iOS:432},errorList:{android:{"-101":{mapTo:X.USER_CANCEL}},iOS:{"-101":{mapTo:X.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:X.USER_CANCEL},999:{mapTo:{code:z,message:$},needMoreDetail:!0}},iOS:{"-10":{mapTo:{code:z,message:$}}}}},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:X.USER_DENIED},"-400":{mapTo:X.DUPLICATE_REQUEST}},iOS:{"-1":{mapTo:X.USER_DENIED},"-400":{mapTo:X.DUPLICATE_REQUEST}}}},MP_ADD_RATING:{skipJump:!1},MP_ADD_MYFAVORITES:{skipJump:!1},MP_INTERACT_OA:{skipJump:!1,errorList:{android:{"-400":{mapTo:X.DUPLICATE_REQUEST}},iOS:{"-400":{mapTo:X.DUPLICATE_REQUEST}}}},MP_USER_AUTHORIZE:{skipJump:!1,errorList:{android:{"-400":{mapTo:X.DUPLICATE_REQUEST}},iOS:{"-400":{mapTo:X.DUPLICATE_REQUEST}}}},MP_SELECT_PAYMENT_METHOD:{skipJump:!1},MP_CONFIRM_REQUEST_PAYMENT:{skipJump:!1}},ne={android:{"-4":X.DECODE_FAILED,"-5":X.CLIENT_NOT_SUPPORT,"-14":X.TIME_OUT},iOS:{"-9":X.DECODE_FAILED,"-5":X.CLIENT_NOT_SUPPORT,"-14":X.TIME_OUT}},re={android:12100615,iOS:460,wp:0,unknown:0},ie=5*n,oe="https://payment-mini.zalo.me/api/order/create",ae="https://payment-mini.zalo.me/api/order/iap-create",se="https://payment-mini.zalo.me/api/transaction",ue="https://payment-mini.zalo.me/api/order/purchase",ce="DEFERRED",le="IMMEDIATE_AND_CHARGE_FULL_PRICE",de={SHOW_BACK:0,HIDE_BACK:3,SHOW_HOME:1,HIDE_HOME:0},pe=5,fe=6,he="#1843EF",me=0,ve={"-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 ye(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 ge(e){return function(){var t=this,n=arguments;return new Promise((function(r,i){var o=e.apply(t,n);function a(e){ye(o,r,i,a,s,"next",e)}function s(e){ye(o,r,i,a,s,"throw",e)}a(void 0)}))}}function _e(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 we(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function be(e,t){if(e){if("string"==typeof e)return _e(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)?_e(e,t):void 0}}function Te(e){return function(e){if(Array.isArray(e))return _e(e)}(e)||we(e)||be(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 Ee(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 Pe(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,Te(n))}catch(e){return"undefined"!=typeof console&&console.error&&console.error(e),null}}}function Se(e){var t=new URL(window.location.href).searchParams.get("env");return{isMp:window.location.hostname.includes(s)&&("TESTING_LOCAL"==t||window.location.pathname.startsWith(u)),isMpWeb:window.location.hostname.includes("localhost")}}Pe.async=function(e){return ge((function(){var t,n,r,i,o=arguments;return Ee(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,Te(n))];case 2:return[2,a.sent()];case 3:return i=a.sent(),"undefined"!=typeof console&&console.error&&console.error(i),[2,null];case 4:return[2]}}))}))},function(e){e.none="none",e.wifi="wifi",e.cellular="cellular",e.unknown="unknown"}(d||(d={})),function(e){e.wp="wp",e.android="android",e.iOS="iOS",e.unknown="unknown"}(p||(p={})),function(e){e.AppPaused="h5.event.paused",e.AppResumed="h5.event.resumed",e.NetworkChanged="h5.event.connection.changed",e.OnDataCallback="h5.event.webview.result",e.WebviewClosed="h5.event.webview.close",e.OpenApp="h5.event.open.mp",e.AppClose="h5.event.action.close",e.PaymentCallback="payment.callback",e.PaymentResult="action.payment.result",e.PaymentClose="action.payment.close"}(f||(f={})),function(e){e.DOING="doing",e.DONE="done"}(h||(h={})),function(e){e[e.user=1]="user",e[e.oa=0]="oa",e[e.aliasOA=2]="aliasOA"}(m||(m={})),function(e){e[e.user=1]="user",e[e.oa=0]="oa"}(v||(v={})),function(e){e[e.image=1]="image",e[e.link=4]="link",e[e.profile=5]="profile"}(y||(y={})),function(e){e[e.image=1]="image",e[e.gif=11]="gif",e[e.video=12]="video",e[e.link=4]="link",e[e.oa=5]="oa",e[e.zmp=20]="zmp",e[e.multi_image=21]="multi_image",e[e.zmp_deep_link=4]="zmp_deep_link",e[e.text=22]="text"}(g||(g={})),function(e){e[e.auto=1]="auto",e[e.portrait=2]="portrait",e[e.landscape=3]="landscape"}(_||(_={})),function(e){e[e.oneShot=0]="oneShot"}(w||(w={})),function(e){e[e.zcamera=3]="zcamera",e[e.zcamera_photo=1]="zcamera_photo",e[e.zcamera_video=2]="zcamera_video",e[e.zcamera_scan=7]="zcamera_scan",e[e.photo=4]="photo",e[e.video=5]="video",e[e.file=6]="file"}(b||(b={})),function(e){e.SUBSCRIPTION="SUBSCRIPTION",e.ONETIME="ONETIME"}(T||(T={})),function(e){e[e.UNKNOW=0]="UNKNOW",e[e.DEFERRED=1]="DEFERRED",e[e.IMMEDIATE_AND_CHARGE_FULL_PRICE=2]="IMMEDIATE_AND_CHARGE_FULL_PRICE"}(E||(E={})),function(e){e[e.normal=1]="normal",e[e.hidden=0]="hidden",e[e.transparent=2]="transparent"}(P||(P={})),function(e){e[e.show=1]="show",e[e.hide=0]="hide"}(S||(S={})),function(e){e[e.show=1]="show",e[e.hide=0]="hide"}(O||(O={})),function(e){e[e.left=0]="left",e[e.center=1]="center"}(A||(A={})),function(e){e.OnFrameCallback="h5.event.camera.frame",e.OnStartCallback="h5.event.camera.start",e.OnStopCallback="h5.event.camera.stop"}(I||(I={})),function(e){e.FRONT="user",e.BACK="environment"}(k||(k={})),function(e){e.WEBP="image/webp",e.PNG="image/png",e.JPEG="image/jpeg"}(C||(C={})),function(e){e.HIGH="high",e.NORMAL="normal",e.LOW="low"}(N||(N={})),function(e){e.VIDEO="video",e.AUDIO="audio"}(M||(M={}));var Oe,Ae=function(e){return e.isAndroid?p.android:e.isIOS?p.iOS:p.unknown};function Ie(e){var t=e.split("zalo")[1];return t&&t.replace(" ","").split("/")[1]||""}function ke(){var e=function(){var e=Pe((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:Se(),platform:t,platformName:Ae(t),zaloVersion:Ie(e).trim()}}}();if(e)return e}var Ce=(null===(Oe=ke())||void 0===Oe?void 0:Oe.appEnv)||{};function Ne(e){Ne.on&&Ne.engine(e)}Ne.on=!1,Ne.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 Me=function(e,n){var r,i={error:-1404,errorMessage:"".concat(e," is not found")};null==n||null===(r=n.fail)||void 0===r||r.call(n,i),Ne({stage:t.NOT_FOUND,type:"error",name:e,request:n,state:"fail",response:i})};function Re(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function xe(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){Re(e,t,n[t])}))}return e}function Ue(e,t){return function(e){if(Array.isArray(e))return e}(e)||we(e)||be(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 De="undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{};function je(){throw new Error("setTimeout has not been defined")}function Le(){throw new Error("clearTimeout has not been defined")}var Be=je,Ze=Le;function ze(e){if(Be===setTimeout)return setTimeout(e,0);if((Be===je||!Be)&&setTimeout)return Be=setTimeout,setTimeout(e,0);try{return Be(e,0)}catch(t){try{return Be.call(null,e,0)}catch(t){return Be.call(this,e,0)}}}"function"==typeof De.setTimeout&&(Be=setTimeout),"function"==typeof De.clearTimeout&&(Ze=clearTimeout);var We,Fe=[],Ge=!1,He=-1;function Ve(){Ge&&We&&(Ge=!1,We.length?Fe=We.concat(Fe):He=-1,Fe.length&&Ke())}function Ke(){if(!Ge){var e=ze(Ve);Ge=!0;for(var t=Fe.length;t;){for(We=Fe,Fe=[];++He<t;)We&&We[He].run();He=-1,t=Fe.length}We=null,Ge=!1,function(e){if(Ze===clearTimeout)return clearTimeout(e);if((Ze===Le||!Ze)&&clearTimeout)return Ze=clearTimeout,clearTimeout(e);try{Ze(e)}catch(t){try{return Ze.call(null,e)}catch(t){return Ze.call(this,e)}}}(e)}}function Je(e,t){this.fun=e,this.array=t}Je.prototype.run=function(){this.fun.apply(null,this.array)};function qe(){}var Qe=qe,$e=qe,Ye=qe,Xe=qe,et=qe,tt=qe,nt=qe;var rt=De.performance||{},it=rt.now||rt.mozNow||rt.msNow||rt.oNow||rt.webkitNow||function(){return(new Date).getTime()};var ot=new Date;var at,st={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];Fe.push(new Je(e,t)),1!==Fe.length||Ge||ze(Ke)},title:"browser",browser:!0,env:{},argv:[],version:"",versions:{},on:Qe,addListener:$e,once:Ye,off:Xe,removeListener:et,removeAllListeners:tt,emit:nt,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*it.call(rt),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-ot)/1e3}},ut=st,ct="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function lt(e){return e&&e.constructor===Symbol?"symbol":typeof e}function dt(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 ct?ct:"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 ut&&ut.env&&"true"===ut.env.REFLECT_METADATA_USE_MAP_POLYFILL,d=l||"function"!=typeof Map||"function"!=typeof Map.prototype.entries?ee():Map,p=l||"function"!=typeof Set||"function"!=typeof Set.prototype.entries?te():Set,f=new(l||"function"!=typeof WeakMap?ne():WeakMap);function h(e,t,n,r){if(U(n)){if(!G(e))throw new TypeError;if(!V(t))throw new TypeError;return P(e,t)}if(!G(e))throw new TypeError;if(!L(t))throw new TypeError;if(!L(r)&&!U(r)&&!D(r))throw new TypeError;return D(r)&&(r=void 0),S(e,t,n=F(n),r)}function m(e,t){function n(n,r){if(!L(n))throw new TypeError;if(!U(r)&&!K(r))throw new TypeError;N(e,t,n,r)}return n}function v(e,t,n,r){if(!L(n))throw new TypeError;return U(r)||(r=F(r)),N(e,t,n,r)}function y(e,t,n){if(!L(t))throw new TypeError;return U(n)||(n=F(n)),A(e,t,n)}function g(e,t,n){if(!L(t))throw new TypeError;return U(n)||(n=F(n)),I(e,t,n)}function _(e,t,n){if(!L(t))throw new TypeError;return U(n)||(n=F(n)),k(e,t,n)}function w(e,t,n){if(!L(t))throw new TypeError;return U(n)||(n=F(n)),C(e,t,n)}function b(e,t){if(!L(e))throw new TypeError;return U(t)||(t=F(t)),M(e,t)}function T(e,t){if(!L(e))throw new TypeError;return U(t)||(t=F(t)),R(e,t)}function E(e,t,n){if(!L(t))throw new TypeError;U(n)||(n=F(n));var r=O(t,n,!1);if(U(r))return!1;if(!r.delete(e))return!1;if(r.size>0)return!0;var i=f.get(t);return i.delete(n),i.size>0||f.delete(t),!0}function P(e,t){for(var n=e.length-1;n>=0;--n){var r=(0,e[n])(t);if(!U(r)&&!D(r)){if(!V(r))throw new TypeError;t=r}}return t}function S(e,t,n,r){for(var i=e.length-1;i>=0;--i){var o=(0,e[i])(t,n,r);if(!U(o)&&!D(o)){if(!L(o))throw new TypeError;r=o}}return r}function O(e,t,n){var r=f.get(e);if(U(r)){if(!n)return;r=new d,f.set(e,r)}var i=r.get(t);if(U(i)){if(!n)return;i=new d,r.set(t,i)}return i}function A(e,t,n){if(I(e,t,n))return!0;var r=X(t);return!D(r)&&A(e,r,n)}function I(e,t,n){var r=O(t,n,!1);return!U(r)&&z(r.has(e))}function k(e,t,n){if(I(e,t,n))return C(e,t,n);var r=X(t);return D(r)?void 0:k(e,r,n)}function C(e,t,n){var r=O(t,n,!1);if(!U(r))return r.get(e)}function N(e,t,n,r){O(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=O(e,t,!1);if(U(r))return n;for(var i=q(r.keys()),o=0;;){var a=$(i);if(!a)return n.length=o,n;var s=Q(a);try{n[o]=s}catch(e){try{Y(i)}finally{throw e}}o++}}function x(e){if(null===e)return 1;switch(typeof e){case"undefined":return 0;case"boolean":return 2;case"string":return 3;case"symbol":return 4;case"number":return 5;case"object":return null===e?1:6;default:return 6}}function U(e){return void 0===e}function D(e){return null===e}function j(e){return"symbol"==typeof e}function L(e){return"object"==typeof e?null!==e:"function"==typeof e}function B(e,t){switch(x(e)){case 0:case 1:case 2:case 3:case 4:case 5:return e}var n=3===t?"string":5===t?"number":"default",i=J(e,r);if(void 0!==i){var o=i.call(e,n);if(L(o))throw new TypeError;return o}return Z(e,"default"===n?"number":n)}function Z(e,t){if("string"===t){var n=e.toString;if(H(n))if(!L(i=n.call(e)))return i;if(H(r=e.valueOf))if(!L(i=r.call(e)))return i}else{var r;if(H(r=e.valueOf))if(!L(i=r.call(e)))return i;var i,o=e.toString;if(H(o))if(!L(i=o.call(e)))return i}throw new TypeError}function z(e){return!!e}function W(e){return""+e}function F(e){var t=B(e,3);return j(t)?t:W(t)}function G(e){return Array.isArray?Array.isArray(e):e instanceof Object?e instanceof Array:"[object Array]"===Object.prototype.toString.call(e)}function H(e){return"function"==typeof e}function V(e){return"function"==typeof e}function K(e){switch(x(e)){case 3:case 4:return!0;default:return!1}}function J(e,t){var n=e[t];if(null!=n){if(!H(n))throw new TypeError;return n}}function q(e){var t=J(e,i);if(!H(t))throw new TypeError;var n=t.call(e);if(!L(n))throw new TypeError;return n}function Q(e){return e.value}function $(e){var t=e.next();return!t.done&&t}function Y(e){var t=e.return;t&&t.call(e)}function X(e){var t=Object.getPrototypeOf(e);if("function"!=typeof e||e===c)return t;if(t!==c)return t;var n=e.prototype,r=n&&Object.getPrototypeOf(n);if(null==r||r===Object.prototype)return t;var i=r.constructor;return"function"!=typeof i||i===e?t:i}function ee(){var e={},t=[],n=function(){function e(e,t,n){this._index=0,this._keys=e,this._values=t,this._selector=n}return e.prototype["@@iterator"]=function(){return this},e.prototype[i]=function(){return this},e.prototype.next=function(){var e=this._index;if(e>=0&&e<this._keys.length){var n=this._selector(this._keys[e],this._values[e]);return e+1>=this._keys.length?(this._index=-1,this._keys=t,this._values=t):this._index++,{value:n,done:!1}}return{value:void 0,done:!0}},e.prototype.throw=function(e){throw this._index>=0&&(this._index=-1,this._keys=t,this._values=t),e},e.prototype.return=function(e){return this._index>=0&&(this._index=-1,this._keys=t,this._values=t),{value:e,done:!0}},e}();return function(){function t(){this._keys=[],this._values=[],this._cacheKey=e,this._cacheIndex=-2}return Object.defineProperty(t.prototype,"size",{get:function(){return this._keys.length},enumerable:!0,configurable:!0}),t.prototype.has=function(e){return this._find(e,!1)>=0},t.prototype.get=function(e){var t=this._find(e,!1);return t>=0?this._values[t]:void 0},t.prototype.set=function(e,t){var n=this._find(e,!0);return this._values[n]=t,this},t.prototype.delete=function(t){var n=this._find(t,!1);if(n>=0){for(var r=this._keys.length,i=n+1;i<r;i++)this._keys[i-1]=this._keys[i],this._values[i-1]=this._values[i];return this._keys.length--,this._values.length--,t===this._cacheKey&&(this._cacheKey=e,this._cacheIndex=-2),!0}return!1},t.prototype.clear=function(){this._keys.length=0,this._values.length=0,this._cacheKey=e,this._cacheIndex=-2},t.prototype.keys=function(){return new n(this._keys,this._values,r)},t.prototype.values=function(){return new n(this._keys,this._values,o)},t.prototype.entries=function(){return new n(this._keys,this._values,a)},t.prototype["@@iterator"]=function(){return this.entries()},t.prototype[i]=function(){return this.entries()},t.prototype._find=function(e,t){return this._cacheKey!==e&&(this._cacheIndex=this._keys.indexOf(this._cacheKey=e)),this._cacheIndex<0&&t&&(this._cacheIndex=this._keys.length,this._keys.push(e),this._values.push(void 0)),this._cacheIndex},t}();function r(e,t){return e}function o(e,t){return t}function a(e,t){return[e,t]}}function te(){return function(){function e(){this._map=new d}return Object.defineProperty(e.prototype,"size",{get:function(){return this._map.size},enumerable:!0,configurable:!0}),e.prototype.has=function(e){return this._map.has(e)},e.prototype.add=function(e){return this._map.set(e,e),this},e.prototype.delete=function(e){return this._map.delete(e)},e.prototype.clear=function(){this._map.clear()},e.prototype.keys=function(){return this._map.keys()},e.prototype.values=function(){return this._map.values()},e.prototype.entries=function(){return this._map.entries()},e.prototype["@@iterator"]=function(){return this.keys()},e.prototype[i]=function(){return this.keys()},e}()}function ne(){var e=16,n=u.create(),r=i();return function(){function e(){this._key=i()}return e.prototype.has=function(e){var t=o(e,!1);return void 0!==t&&u.has(t,this._key)},e.prototype.get=function(e){var t=o(e,!1);return void 0!==t?u.get(t,this._key):void 0},e.prototype.set=function(e,t){return o(e,!0)[this._key]=t,this},e.prototype.delete=function(e){var t=o(e,!1);return void 0!==t&&delete t[this._key]},e.prototype.clear=function(){this._key=i()},e}();function i(){var e;do{e="@@WeakMap@@"+c()}while(u.has(n,e));return n[e]=!0,e}function o(e,n){if(!t.call(e,r)){if(!n)return;Object.defineProperty(e,r,{value:u.create()})}return e[r]}function a(e,t){for(var n=0;n<t;++n)e[n]=255*Math.random()|0;return e}function s(e){return"function"==typeof Uint8Array?"undefined"!=typeof crypto?crypto.getRandomValues(new Uint8Array(e)):"undefined"!=typeof msCrypto?msCrypto.getRandomValues(new Uint8Array(e)):a(new Uint8Array(e),e):a(new Array(e),e)}function c(){var t=s(e);t[6]=79&t[6]|64,t[8]=191&t[8]|128;for(var n="",r=0;r<e;++r){var i=t[r];4!==r&&6!==r&&8!==r||(n+="-"),i<16&&(n+="0"),n+=i.toString(16).toLowerCase()}return n}}function re(e){return e.__=void 0,delete e.__,e}e("decorate",h),e("metadata",m),e("defineMetadata",v),e("hasMetadata",y),e("hasOwnMetadata",g),e("getMetadata",_),e("getOwnMetadata",w),e("getMetadataKeys",b),e("getOwnMetadataKeys",T),e("deleteMetadata",E)}(r)}()}(at||(at={}));var pt=Object.prototype.toString;var ft="[object Null]",ht="[object Undefined]";function mt(e){return null==e?void 0===e?ht:ft:function(e){return pt.call(e)}(e)}function vt(e){return null!=e&&"object"==typeof e}var yt={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||vt(e)&&"[object Number]"==mt(e)},isArray:function(e){return Array.isArray(e)},isRegExp:function(e){return vt(e)&&"[object RegExp]"==mt(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 gt(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _t(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 wt(e){return wt=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},wt(e)}function bt(e){return wt(e)}function Tt(e,t,n){return Tt="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=bt(e)););return e}(e,t);if(r){var i=Object.getOwnPropertyDescriptor(r,t);return i.get?i.get.call(n||e):i.value}},Tt(e,t,n)}function Et(e,t,n){return Tt(e,t,n)}function Pt(e,t){return Pt=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},Pt(e,t)}function St(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&&Pt(e,t)}function Ot(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function At(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=bt(e);if(t){var i=bt(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return function(e,t){return!t||"object"!==lt(t)&&"function"!=typeof t?Ot(e):t}(this,n)}}var It,kt,Ct=(It=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},It(kt={exports:{}},kt.exports),kt.exports),Nt="ACTION_CALLBACK";var Mt=function(e){St(n,e);var t=At(n);function n(){var e;return gt(this,n),(e=t.apply(this,arguments)).debug=dt("zmp:event-emitter"),e}var r=n.prototype;return r.h5ConfirmHandleEvent=function(e,t,n){ZaloJavaScriptInterface.jsH5EventCallback(e,t,n||"")},r.on=function(e,t,r){var i=this;if(e===Nt||e===f.PaymentCallback)return Et(bt(n.prototype),"on",this).call(this,e,t,r);this.debug("register ".concat(String(e),": ").concat(r));return Et(bt(n.prototype),"on",this).call(this,e,(function(n,o){i.h5ConfirmHandleEvent(n,e,r),t(o)}),r)},r.once=function(e,t,r){var i=this;if(e===Nt)return Et(bt(n.prototype),"once",this).call(this,e,t,r);this.debug("register once ".concat(String(e),": ").concat(r));return Et(bt(n.prototype),"once",this).call(this,e,(function(n,o){i.h5ConfirmHandleEvent(n,e,r),t(o)}),r)},n.getInstance=function(){return n.instance||(n.instance=new n),n.instance},n}(Ct);function Rt(e){Mt.getInstance().emit(Nt,e)}function xt(e){var t=[];for(var n in e)if(e.hasOwnProperty(n)){var r=e[n];if(void 0===r)return;if(null===r)return void t.push(n);t.push(encodeURIComponent(n)+"="+encodeURIComponent(r))}return t.join("&")}window.onNativeMessage=function(e,t){return function(n){Rt({serialId:e,actionName:t,result:n})}},window.zaloJSV2={zalo_h5_event_handler:function(e,t,n){var r=dt("zmp:zalo_h5_event_handler");r("eventId: ".concat(e,", eventName: ").concat(t,", eventData: ").concat(n));var o=ln(n);r("stringToData",o);var a=function(e,t){try{if(e===f.OpenApp){var n=t.url,r=new URL(n),o=r.pathname.split("/zapps/".concat(i))[1];return{path:"".concat(o||"/").concat(r.search)}}return t}catch(e){return t}}(t,o);Mt.getInstance().emit(t,e,a)}},window.zaloNative2JS={nativeCall:function(e,t,n){Mt.getInstance().emit(f.PaymentCallback,e,t,n)}};var Ut={encode:xt,decode:function(e,t){var n={};if(""===e)return n;for(var r=e.split("&"),i=0;i<r.length;i++){var o=r[i].split("=",2),a=decodeURIComponent(o[0]);if(t&&Object.prototype.hasOwnProperty.call(n,a))throw new URIError("Duplicate key: "+a);n[a]=2===o.length?decodeURIComponent(o[1]):null}return n},appendToUrl:function(e,t){return e+(-1!==e.indexOf("?")?"&":"?")+("string"==typeof t?t:xt(t))},getParameterByName:function(e,t){t||(t=window.location.href),e=e.replace(/[\[\]]/g,"\\$&");var n=new RegExp("[?&]"+e+"(=([^&#]*)|&|#|$)").exec(t);return n?n[2]?decodeURIComponent(n[2].replace(/\+/g," ")):"":null},getParamsAsObject:function(e){var t={};return e?(e.split("&").map((function(e){var n=e.split("=");n&&2==n.length&&(t[n[0]]=decodeURIComponent(n[1].replace(/\+/g," ")))})),t):t},toQueryString:function(e){if(!e)return"";if("object"!=(void 0===e||void 0===e?"undefined":lt(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":lt(r))?JSON.stringify(r):encodeURIComponent(r)].join("=");n.push(i)})),n.join("&")}},Dt={},jt=function(e,t,n){var r=t||"default";return function(){return(r in Dt?Dt[r](e,n):e).apply(this,arguments)}};jt.setWrapper=function(e){Dt[arguments.length<=1||void 0===arguments[1]?"default":arguments[1]]=e};var Lt={error:{code:1,error_subcode:1357046,message:"Received Invalid JSON reply.",type:"http"}};function Bt(e){try{return null===e?Lt:JSON.parse(e)}catch(e){return Lt}}var Zt,zt={execute:function(e,t,n,r){n.suppress_http_code=1;var i=Ut.encode(n);"post"!=t&&(e=Ut.appendToUrl(e,i),i="");var o=function(e,t){if(!self.XMLHttpRequest)return null;var n=new XMLHttpRequest,r=function(){};if(!("withCredentials"in n))return null;n.open(e,t,!0),n.setRequestHeader("Content-type","application/x-www-form-urlencoded");var i={send:function(e){n.send(e)}},o=jt((function(){o=r,"onload"in i&&i.onload(n)}),"entry","XMLHttpRequest:load"),a=jt((function(){a=r,"onerror"in i&&i.onerror(n)}),"entry","XMLHttpRequest:error");return n.onload=function(){o()},n.onerror=function(){a()},n.onreadystatechange=function(){4==n.readyState&&(200==n.status?o():a())},i}(t,e);return!!o&&(o.onload=function(e){r(Bt(e.responseText))},o.onerror=function(e){e.responseText?r(Bt(e.responseText)):r({error:{code:1,error_subcode:1357045,message:"unknown error (empty response)",status:e.status,type:"http"}})},o.send(i),!0)}},Wt=zt,Ft=(Zt=ge((function(e,t,n){var r,i,o,a;return Ee(this,(function(s){switch(s.label){case 0:return r={appId:e,versionStatus:t},yt.isUndefined(n)||(r.currentVersion=n),i=Ut.appendToUrl(l.GET_APP_INFO,r),[4,fetch(i,{credentials:"include"})];case 1:return(o=s.sent()).ok?[4,o.json()]:[3,3];case 2:if((a=s.sent()).err<0||!a.data)throw new Error(a);return[2,{name:a.data.name,version:a.data.version,description:a.data.description,appUrl:a.data.appUrl,qrCodeUrl:a.data.qrCodeUrl,logoUrl:a.data.logoUrl,cateID:a.data.cateType}];case 3:throw new Error("Can't get app info")}}))})),function(e,t,n){return Zt.apply(this,arguments)});function Gt(e){try{var t=e.map((function(e){return{action:e.action,error:e.error,message:e.message,data:e.data}}));Wt.execute(l.SEND_ACTION_LOG,"post",{appId:window.APP_ID,data:JSON.stringify(t)},(function(){})),window.zmpSentry&&window.zmpSentry.captureMessage("Result from native",{extra:{data:e}})}catch(e){}}var Ht=function(e){return e.replace(/[A-Z]/g,(function(e){return"_".concat(e.toLowerCase())}))},Vt=function(){var e,t,n=Number((null===(e=ke())||void 0===e?void 0:e.zaloVersion)||""),r=((null===(t=ke())||void 0===t?void 0:t.platformName)||"").toLowerCase();return"android"===r?n%1e4:n};function Kt(e,t){return null!=t&&"undefined"!=typeof Symbol&&t[Symbol.hasInstance]?!!t[Symbol.hasInstance](e):e instanceof t}var Jt,qt,Qt=function(){function e(t,n,r,i){gt(this,e),this.code=t,this.message=n,this.api=r,this.detail=i}var t=e.prototype;return t.toString=function(){return"api: ".concat(String(this.api),"; code: ").concat(this.code,"; message: ").concat(JSON.stringify(this.message))},t.toJSON=function(){return{code:this.code,message:this.message,api:this.api,detail:this.detail}},e}(),$t=function(e,t){return Kt(e,Qt)?function(e,t){return e.api=t,e.toJSON()}(e,t):function(e,t){return Kt(e,Error)?new Qt(x,e.message,t).toJSON():yt.isEmpty(null==e?void 0:e.message)||yt.isEmpty(null==e?void 0:e.code)?new Qt(x,G,t,e).toJSON():new Qt(e.code,e.message,t,e.detail).toJSON()}(e,t)},Yt=(Jt=ge((function(e){var t;return Ee(this,(function(n){switch(n.label){case 0:return t={headers:{"Content-Type":"application/x-www-form-urlencoded",authorization:"Bearer ".concat(e)}},[4,fetch(l.GET_AUTH_SETTING,xe({method:"GET"},t))];case 1:return[4,n.sent().json()];case 2:return[2,n.sent()]}}))})),function(e){return Jt.apply(this,arguments)}),Xt=ge((function(){return Ee(this,(function(e){return[2,new Promise(function(){var e=ge((function(e,t){var n,r,i,o;return Ee(this,(function(a){switch(a.label){case 0:return a.trys.push([0,3,,4]),[4,an.jumpAndGetToken()];case 1:return a.sent(),(r=null===(n=an.miniProgramConfig)||void 0===n?void 0:n.jwt)||t(new Qt(j,K,"getSetting")),[4,Yt(r)];case 2:return(i=a.sent())&&0===i.err?e({authSetting:i.data}):t(new Qt(i.err,i.msg,"getSetting")),[3,4];case 3:return o=a.sent(),t(o),[3,4];case 4:return[2]}}))}));return function(t,n){return e.apply(this,arguments)}}())]}))})),en=function(){var e,t,n,r=ke(),i={},o=Mt.getInstance(),a=[],s=!1;return s||(t=function(e){var t=e.serialId,n=dn(e.result),r=mn(null==n?void 0:n.action),o=yt.isEmpty(null==n?void 0:n.error_code)?0:null==n?void 0:n.error_code,s=null==n?void 0:n.error_message,u=(null==n?void 0:n.data)||n;if(r&&0===o){var c=JSON.parse(null==n?void 0:n.data);o=yt.isEmpty(null==c?void 0:c.error_code)?0:null==c?void 0:c.error_code,s=null==c?void 0:c.error_message,u=(null==c?void 0:c.data)||c}var l={error_code:o,error_message:s,data:u,action:(null==n?void 0:n.action)||e.actionName};if(t&&i[t]){var d=i[t],p=d.callback,f=d.timeout,h=d.isMultiCallback,m=d.options;!function(e,t){var n=t||{},r=n.success,i=n.fail;0===e.error_code?yt.isFunction(r)&&r(e):yt.isFunction(i)&&i(e)}(l,p),!h&&delete i[t],f&&clearTimeout(f);var v={action:null==l?void 0:l.action,error:null==l?void 0:l.error_code,message:null==l?void 0:l.error_message,data:{}};try{if("action.open.inapp"===l.action||"action.open.outapp"===l.action){var y=new URL(null==m?void 0:m.url),g="".concat(y.protocol,"//").concat(y.host).concat(y.pathname);v.data={url:g}}if("action.follow.oa"===l.action||"action.unfollow.oa"===l.action){var _=null==m?void 0:m.uid;v.data={uid:_}}if("action.open.chat"===l.action){var w=null==m?void 0:m.uId,b=null==m?void 0:m.type;v.data={uid:w,openChatType:b}}}catch(e){}a.push(v)}},Mt.getInstance().on(Nt,t),o.on(f.AppPaused,(function(){if(a.length>0){var e=a;a=[],Gt(e)}})),e?clearInterval(e):e=setInterval((function(){if(a.length>0){var e=a;a=[],Gt(e)}}),5e3),s=!0),n=ge((function(e,t,n,o){var a,s,u,c,l,d,p,f,h,m,v,y,g,_,w,b,T,E,P,S,O,A;return Ee(this,(function(I){switch(I.label){case 0:return s=Math.floor(1e6*Math.random()),u="".concat(e,"_").concat(s),c=_n(e),(null==o?void 0:o.actionName)&&o.actionName.length>0&&(c=null==o?void 0:o.actionName),l=(null==o?void 0:o.isMultiCallback)||!1,d=!1!==(null==o?void 0:o.timeout)&&((null==o?void 0:o.timeout)||!0),p=(null==o?void 0:o.haveCallback)||!1,f=(null==o?void 0:o.skipJump)||!1,h=(null==o?void 0:o.requireAccessToken)||!1,m=vn(c),t&&n&&(i[u]={options:t,callback:n,isMultiCallback:l},d&&p&&(i[u].timeout=setTimeout((function(){return Rt({serialId:u,result:{error_code:B,error_message:V,data:{timeout:d},action:e}}),null}),!0===d?8e3:1e3*d))),m?[4,Xt()]:[3,2];case 1:if(!1===(null==(y=I.sent())||null===(v=y.authSetting)||void 0===v?void 0:v["scope.userInfo"]))return Rt({serialId:u,result:{error_code:j,error_message:Q,data:{isMobile:null==r||null===(g=r.platform)||void 0===g?void 0:g.isMobile},action:e}}),[2];I.label=2;case 2:return _=mn(c),!(null==r||null===(a=r.platform)||void 0===a?void 0:a.isMobile)||!e||yt.isUndefined(ZaloJavaScriptInterface)||r.platform.isIOS&&!cn(e)||_&&!1===_.isSupported?(Rt({serialId:u,result:{error_code:L,error_message:q,data:{isMobile:null==r||null===(w=r.platform)||void 0===w?void 0:w.isMobile},action:e}}),[2]):(b=un(t),f?[3,4]:[4,an.getJSAccessToken()]);case 3:return E=I.sent(),[3,5];case 4:E="",I.label=5;case 5:T=E,I.label=6;case 6:return I.trys.push([6,10,,11]),f||!h?[3,8]:[4,an.getAccessToken()];case 7:return S=I.sent(),[3,9];case 8:S="",I.label=9;case 9:return P=S,[3,11];case 10:return O=I.sent(),Rt({serialId:u,result:{error_code:null==O?void 0:O.code,error_message:null==O?void 0:O.message,action:e}}),[2];case 11:return A=r.platform.isIOS?window.onNativeMessage(u,c):'window.onNativeMessage("'.concat(u,'", "').concat(c,'")'),[2,ZaloJavaScriptInterface.jsCall(T,c,P,b,A)]}}))})),function(e,t,r,i){return n.apply(this,arguments)}}(),tn={success:function(e,t){return{code:R,message:t||F,data:e||{}}},error:{failLimit:function(){return new Qt(Z,H)},badRequest:function(e){return new Qt(U,e)},loginFailed:function(e){return new Qt(j,"".concat(J,": ").concat(e))},loginRequired:function(){return new Qt(j,K)},cannotGetShareInfo:function(){return new Qt(D,"Can not get app info to share")},createIAPOrderFailed:function(e){var t=Object.keys(ve).find((function(t){return t===e.toString()}));return new Qt(e,t||G)},clientNotSupport:function(){return new Qt(L,q)}}},nn=(qt=function(e){var t,n,r,i=null===(t=ke())||void 0===t?void 0:t.platformName,o=gn(e.action),a=te[o],s=(null==a?void 0:a.skipJump)||!1,u=(null==a?void 0:a.errorList)||{};if("JUMP_LOGIN"===o)return new Qt(x,"Can not get auth code: ".concat(e.error_message));if(an.jumpStatus!==h.DONE&&!s)return new Qt(X.UNAUTHORIZED.code,X.UNAUTHORIZED.message);if("permission required!"===String(e.error_message).toLowerCase()||"no permission!"===String(e.error_message).toLowerCase())return new Qt(X.FORBIDDEN.code,X.FORBIDDEN.message);if(i&&(null===(n=ne[i])||void 0===n?void 0:n[e.error_code]))return new Qt(ne[i][e.error_code].code,ne[i][e.error_code].message);var c=null==u||null===(r=u[i])||void 0===r?void 0:r[String(e.error_code)];if(c){var l,d,p,f=null===(l=c.mapTo)||void 0===l?void 0:l.message;return(null==c?void 0:c.needMoreDetail)&&(f="".concat(null==c||null===(p=c.mapTo)||void 0===p?void 0:p.message,": ").concat(e.error_message)),new Qt(null===(d=c.mapTo)||void 0===d?void 0:d.code,f)}return new Qt(e.error_code,e.error_message)},function(e,n,r,i){var o=function(e,n){function r(r){return function(i){var o=yt.isEmpty(n)?void 0:n[r];if(o)return Ne({stage:t.RESPONSE,type:"log",state:r,name:e,response:i}),o("fail"===r?qt(i):null==i?void 0:i.data)}}return yt.isUndefined(e)&&(e=""),Object.assign({},{success:r("success"),fail:r("fail")})}(e,r),a=te[e],s=(null==i?void 0:i.delay)||0;setTimeout((function(){en(e,n,o,xe({},i,a))}),s)}),rn=function(){var e=ge((function(e){return Ee(this,(function(t){return[2,new Promise((function(t,n){nn("MP_USER_AUTHORIZE",{scopes:e,forceUpdate:!0},{success:function(e){yt.isEmpty(e)||t(e)},fail:function(e){n(e)}},{isMultiCallback:!1,timeout:!1})}))]}))}));return function(t){return e.apply(this,arguments)}}(),on=function(){function e(){gt(this,e),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 n,o,s,u=e.prototype;return u.initRetryLimit=function(e){var t=ee[e],n={lastCall:(new Date).getTime(),limit:t&&t.limit?t.limit:3,retry:0};return this.retryLimitMap[e]=n,n},u.resetRetryLimit=function(e){this.retryLimitMap[e].lastCall=(new Date).getTime(),this.retryLimitMap[e].retry=0},u.getRetryLimit=function(e){var t=this.retryLimitMap[e];return t&&t.lastCall&&t.retry||(t=this.initRetryLimit(e)),t},u.increaseRetryLimit=function(e){this.retryLimitMap[e].retry++},u.jump=function(){var e=this;return ge((function(){return Ee(this,(function(n){return[2,new Promise((function(n,r){e._jumpStatus?e._jumpStatus===h.DONE?n(h.DONE):n(h.DOING):(e._jumpStatus=h.DOING,Ne({stage:t.REQUEST,type:"log",name:"jump"}),en("JUMP_LOGIN",{},{success:function(t){var r=t.data;e._miniProgramConfig=(null==r?void 0:r.miniProgramConfig)||{};var i=(null==r?void 0:r.cookiesOAuthLogins)||[],o=i.find((function(e){return e.name===c.JS_TOKEN}));o&&(e._jsAccessToken=o.value,window.ZJSBridge.setJSToken&&window.ZJSBridge.setJSToken(o.value)),e._cookies=i;var a=e._cookies.find((function(e){return e.name===c.ZOAUTH}));(null==a?void 0:a.value)||Gt([{action:"action.jump.login",error:-102,message:"no zoauth",data:{}}]),n(h.DONE)},fail:function(e){Gt([{action:"action.jump.login",error:-101,message:e.message||"jump error",data:{}}]),r(e)}},{skipJump:!0}))}))]}))}))()},u.loginZaloV3=function(e,t,n){var r=this;return ge((function(){var i;return Ee(this,(function(o){switch(o.label){case 0:return i="".concat(l.GET_ACCESS_TOKEN_V3,"?app_id=").concat(t,"&redirect_uri=").concat(a,"/").concat(e,"/&code=").concat(n,"&isSDK=true"),[4,fetch(i).then(function(){var e=ge((function(e){var t,n,i;return Ee(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()]}}))}))()},u.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 ge((function(){var i,o;return Ee(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),yt.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(l.GET_ACCESS_TOKEN,xe({method:"POST",body:i},o)).then(function(){var e=ge((function(e){var t,n,i,o;return Ee(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()]}}))}))()},u.getAccessToken=function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=this;return ge((function(){var n,o,a,s,u,l,d,p,f;function h(){return m.apply(this,arguments)}function m(){return(m=ge((function(){return Ee(this,(function(e){switch(e.label){case 0:return[4,new Promise((function(e){var t=setInterval((function(){(o.getAccessTokenCount<=1||o._accessToken)&&(e("done"),clearInterval(t))}),200)}))];case 1:return[2,e.sent()]}}))}))).apply(this,arguments)}return Ee(this,(function(m){switch(m.label){case 0:return n=(new Date).getTime()-t.prevGetAccessTokenTimestamp,(o=t).getAccessTokenCount++,t.getAccessTokenCount>1?[4,h()]:[3,2];case 1:m.sent(),m.label=2;case 2:return t.manualSetAccessToken?(o.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?(o.getAccessTokenCount--,[2,Promise.resolve(t._accessToken)]):(t.accessToken="",[4,t.jumpAndGetToken(c.ZOAUTH)]);case 6:return u=m.sent(),[4,t.jumpAndGetToken(c.ZOAUTH_VRF)];case 7:if(l=m.sent(),d="zmp.getaccesstoken.fail",!a)throw o.getAccessTokenCount--,Gt([{action:d,error:-104,message:"no user auth",data:{}}]),tn.error.loginFailed("User Authentication Required");if(!u)return[3,15];m.label=8;case 8:return m.trys.push([8,13,,14]),l?[4,t.loginZaloV4(i,u,l)]:[3,10];case 9:return p=m.sent(),[3,12];case 10:return[4,t.loginZaloV3(i,r,u)];case 11:p=m.sent(),m.label=12;case 12:return[3,14];case 13:return f=m.sent(),p="",console.log("Can not get access token",f),Gt([{action:d,error:-103,message:String(f)||"Can not get access token",data:{}}]),[3,14];case 14:return o.getAccessTokenCount--,p?[2,Promise.resolve(t._accessToken)]:(Gt([{action:d,error:-101,message:"no accessToken",data:{}}]),[2,Promise.reject(tn.error.loginFailed("Can't get accessToken. Please try again later."))]);case 15:throw o.getAccessTokenCount--,Gt([{action:d,error:-102,message:"no oauth",data:{}}]),tn.error.loginFailed("Zalo app has not been activated")}}))}))()},u.verifyUserAuthorized=function(){var e=this;return ge((function(){var t,n,r,i,o,a;return Ee(this,(function(s){switch(s.label){case 0:if(n=!0,!1!==(null===(t=e._miniProgramConfig)||void 0===t?void 0:t.userAuthorized))return[3,6];s.label=1;case 1:return s.trys.push([1,5,,6]),(r=mn("action.mp.user.authorize"))&&r.isSupported?[4,Xt()]:[3,4];case 2:return!1!==(null==(o=s.sent())||null===(i=o.authSetting)||void 0===i?void 0:i["scope.userInfo"])?[3,4]:[4,rn()];case 3:a=s.sent(),n=(null==a?void 0:a["scope.userInfo"])||!1,s.label=4;case 4:return[3,6];case 5:return s.sent(),n=!1,[3,6];case 6:return[2,n]}}))}))()},u.setAccessToken=function(e){this.manualSetAccessToken=!0,this._accessToken=e,window.ZJSBridge.setZAccSession&&window.ZJSBridge.setZAccSession(e)},u.getJSAccessToken=function(){var e=this;return ge((function(){var t;return Ee(this,(function(n){switch(n.label){case 0:return e._jsAccessToken.length>0?[2,Promise.resolve(e._jsAccessToken)]:[4,e.jumpAndGetToken(c.JS_TOKEN)];case 1:return t=n.sent(),[2,Promise.resolve(t)]}}))}))()},u.getSync=function(e){var t;return null===(t=this._cookies.find((function(t){return t.name===e})))||void 0===t?void 0:t.value},u.jumpAndGetToken=function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=this;return new Promise(function(){var r=ge((function(r){var i,o,a,s;return Ee(this,(function(u){switch(u.label){case 0:return!t&&n._cookies.length>0?yt.isString(e)?(i=n._cookies.find((function(t){return t.name===e})),[2,r(null==i?void 0:i.value)]):[2,r("")]:(t&&n._jumpStatus===h.DONE&&(n._jumpStatus=void 0),o={name:e,cb:function(e){return r(e)}},[4,n.jump()]);case 1:return(a=u.sent())===h.DONE?(n._jumpStatus=a,n.WAITING_QUEUE.length&&(n.WAITING_QUEUE.forEach((function(e){var t=n._cookies.find((function(t){return t.name===e.name}));e.cb(null==t?void 0:t.value)})),n.WAITING_QUEUE=[]),s=n._cookies.find((function(e){return e.name===o.name})),o.cb(null==s?void 0:s.value)):n.WAITING_QUEUE.push(o),[2]}}))}));return function(e){return r.apply(this,arguments)}}())},e.getInstance=function(){return e.instance||(e.instance=new e),e.instance},n=e,(o=[{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}}])&&_t(n.prototype,o),s&&_t(n,s),e}(),an=on.getInstance(),sn=dt("zmp:utils:common"),un=function(e){if(yt.isObject(JSON)&&JSON.stringify)return JSON.stringify(e);if(void 0===e)return"undefined";if(null===e)return"null";try{if("string"==typeof e||null!==e.constructor.toString().match(/string/i))return'"'+e.replace(/"/g,'\\"')+'"'}catch(e){console.log(e)}var t;if(null!==Object.prototype.toString.call(e).match(/array/i)){t=[];for(var n=e.length,r=0;r<n;r++)t.push(un(e[r]));return"["+t.join(",")+"]"}if("object"==typeof e){for(var i in t=[],e)t.push('"'+i+'":'+un(e[i]));return"{"+t.join(",")+"}"}return e.toString()},cn=function(e){var t,n,r=te[e],i=(null===(t=ke())||void 0===t?void 0:t.zaloVersion)||0,o="versionLive"in r&&(null==r||null===(n=r.versionLive)||void 0===n?void 0:n.iOS)||0;return!!(Array.isArray(window.ignoreCheckSupport)&&window.ignoreCheckSupport.length>0&&window.ignoreCheckSupport.includes(e))||Number(i)>=o},ln=function(e){try{if(e){sn(e);var t=e.replace(/\\/g,"").replace(/&#39;/g,"'");try{t=decodeURIComponent(atob(e))}catch(e){}return sn("formattedValue",t,JSON.parse(t),lt(JSON.parse(t))),JSON.parse(t)}return null}catch(t){return sn("parse json error:",t),e}},dn=function(e){if(yt.isObject(JSON)&&JSON.parse&&yt.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 yt.isObject(e)?e:new Function("return "+e)()},pn=function(e){for(var t=document.getElementsByTagName("meta"),n=0;n<t.length;n++)if(t[n].getAttribute("name")===e||t[n].getAttribute("property")===e)return t[n].getAttribute("content");return""},fn=function(e){return btoa(encodeURIComponent(JSON.stringify(e)))};var hn=function(e){return"hidden"===e?P.hidden:"transparent"===e?P.transparent:P.normal},mn=function(e){if(void 0!==e){var t=an.miniProgramConfig;return((null==t?void 0:t.dynamicApis)||[]).find((function(t){return t.action===e&&!1===t.clientHandle}))}},vn=function(e){if(void 0===e)return!1;var t=an.miniProgramConfig;return((null==t?void 0:t.requiredAuthenList)||[]).indexOf(e)>=0},yn=function(){var e=ge((function(){return Ee(this,(function(e){return[2,new Promise(function(){var e=ge((function(e,t){var n;return Ee(this,(function(t){switch(t.label){case 0:return t.trys.push([0,2,,3]),[4,an.jumpAndGetToken()];case 1:return t.sent(),n=an.miniProgramConfig,e(!0===(null==n?void 0:n.canUseAccessTokenByDefault)),[3,3];case 2:return t.sent(),e(!1),[3,3];case 3:return[2]}}))}));return function(t,n){return e.apply(this,arguments)}}())]}))}));return function(){return e.apply(this,arguments)}}(),gn=function(e){return e.replace("action.","").replace(/\./g,"_").toUpperCase()},_n=function(e){return"action.".concat(e.replace(/\_/g,".").toLowerCase())};function wn(e,t,n,r){var i,o;!function(e,t){if(ee[e]){var n=an.getRetryLimit(e);n.lastCall&&(new Date).getTime()-n.lastCall>1e3&&an.resetRetryLimit(e);var r=n.limit||3;if(n.retry&&n.retry>=r)throw $t(tn.error.failLimit(),e);an.increaseRetryLimit(e)}}(e);var a=Array.isArray(n)&&n.length>0&&(null===(i=n[0])||void 0===i?void 0:i.success),s=Array.isArray(n)&&n.length>0&&(null===(o=n[0])||void 0===o?void 0:o.fail);try{var u=n;t.length>0&&t.forEach((function(t,r){var i=t.safeParse(n[r]);if(!i.success){var o,a=null===(o=i.error)||void 0===o?void 0:o.issues,s=a.map((function(e,t){var n=e.path.length>0?e.path.map((function(e,t){return t>0?"[".concat(e,"]"):e})).join(""):"arg";return"Error ".concat(t+1,": Code: ").concat(e.code," ~ Path: ").concat(n," ~ Message: ").concat(e.message)})).join(" | "),c=tn.error.badRequest(s);throw c.detail=a,$t(c,e)}u.push(i.data)}));var c=r.apply(void 0,Te(u));return yt.isPromise(c)?new Promise((function(t,n){c.then((function(e){if(!yt.isNull(a)&&yt.isFunction(a))return a(e);t(c)})).catch((function(t){var r=$t(t,e);if(!yt.isNull(s)&&yt.isFunction(s))return s(r);n(r)}))})):c}catch(t){if(!yt.isNull(s)&&yt.isFunction(s))return s(t);throw $t(t,e)}}function bn(e){return Tn.apply(this,arguments)}function Tn(){return(Tn=ge((function(e){return Ee(this,(function(t){return[2,wn("login",[],[e],ge((function(){return Ee(this,(function(e){switch(e.label){case 0:return Ce.isMp?[4,an.jumpAndGetToken(c.ZOAUTH)]:[3,2];case 1:return e.sent(),[2,"Success"];case 2:return Ce.isMpWeb?[2,Promise.resolve("")]:[2,Promise.reject(Me("login",{}))]}}))})))]}))}))).apply(this,arguments)}function En(e){return Pn.apply(this,arguments)}function Pn(){return(Pn=ge((function(e){return Ee(this,(function(t){return[2,wn("getAccessToken",[],[e],ge((function(){var e;return Ee(this,(function(t){switch(t.label){case 0:return Ce.isMp?[4,yn()]:[3,3];case 1:return e=!t.sent(),[4,an.getAccessToken(e)];case 2:return[2,t.sent()||""];case 3:return Ce.isMpWeb?[2,Promise.resolve("")]:[2,Promise.reject(Me("getAccessToken",{}))]}}))})))]}))}))).apply(this,arguments)}var Sn,On="2.40.0-beta.3";function An(){return wn("getVersion",[],[],(function(){return On}))}function In(){var e,t;return{version:pn("version-id")||"",apiVersion:On,zaloVersion:(null===(e=ke())||void 0===e?void 0:e.zaloVersion)||"",platform:(null===(t=ke())||void 0===t?void 0:t.platformName)||"",language:navigator.language,zaloLanguage:window.zLanguage||"vi",zaloTheme:window.zTheme||"light"}}function kn(){return wn("getSystemInfo",[],[],(function(){return In()}))}!function(e){e.assertEqual=e=>e,e.assertIs=function(e){},e.assertNever=function(e){throw new Error},e.arrayToEnum=e=>{const t={};for(const n of e)t[n]=n;return t},e.getValidEnumValues=t=>{const n=e.objectKeys(t).filter((e=>"number"!=typeof t[t[e]])),r={};for(const e of n)r[e]=t[e];return e.objectValues(r)},e.objectValues=t=>e.objectKeys(t).map((function(e){return t[e]})),e.objectKeys="function"==typeof Object.keys?e=>Object.keys(e):e=>{const t=[];for(const n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.push(n);return t},e.find=(e,t)=>{for(const n of e)if(t(n))return n},e.isInteger="function"==typeof Number.isInteger?e=>Number.isInteger(e):e=>"number"==typeof e&&isFinite(e)&&Math.floor(e)===e,e.joinValues=function(e,t=" | "){return e.map((e=>"string"==typeof e?`'${e}'`:e)).join(t)},e.jsonStringifyReplacer=(e,t)=>"bigint"==typeof t?t.toString():t}(Sn||(Sn={}));const Cn=Sn.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Nn=e=>{switch(typeof e){case"undefined":return Cn.undefined;case"string":return Cn.string;case"number":return isNaN(e)?Cn.nan:Cn.number;case"boolean":return Cn.boolean;case"function":return Cn.function;case"bigint":return Cn.bigint;case"symbol":return Cn.symbol;case"object":return Array.isArray(e)?Cn.array:null===e?Cn.null:e.then&&"function"==typeof e.then&&e.catch&&"function"==typeof e.catch?Cn.promise:"undefined"!=typeof Map&&e instanceof Map?Cn.map:"undefined"!=typeof Set&&e instanceof Set?Cn.set:"undefined"!=typeof Date&&e instanceof Date?Cn.date:Cn.object;default:return Cn.unknown}},Mn=Sn.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]);class Rn extends Error{constructor(e){super(),this.issues=[],this.addIssue=e=>{this.issues=[...this.issues,e]},this.addIssues=(e=[])=>{this.issues=[...this.issues,...e]};const t=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,t):this.__proto__=t,this.name="ZodError",this.issues=e}get errors(){return this.issues}format(e){const t=e||function(e){return e.message},n={_errors:[]},r=e=>{for(const i of e.issues)if("invalid_union"===i.code)i.unionErrors.map(r);else if("invalid_return_type"===i.code)r(i.returnTypeError);else if("invalid_arguments"===i.code)r(i.argumentsError);else if(0===i.path.length)n._errors.push(t(i));else{let e=n,r=0;for(;r<i.path.length;){const n=i.path[r];r===i.path.length-1?(e[n]=e[n]||{_errors:[]},e[n]._errors.push(t(i))):e[n]=e[n]||{_errors:[]},e=e[n],r++}}};return r(this),n}toString(){return this.message}get message(){return JSON.stringify(this.issues,Sn.jsonStringifyReplacer,2)}get isEmpty(){return 0===this.issues.length}flatten(e=(e=>e.message)){const t={},n=[];for(const r of this.issues)r.path.length>0?(t[r.path[0]]=t[r.path[0]]||[],t[r.path[0]].push(e(r))):n.push(e(r));return{formErrors:n,fieldErrors:t}}get formErrors(){return this.flatten()}}Rn.create=e=>new Rn(e);const xn=(e,t)=>{let n;switch(e.code){case Mn.invalid_type:n=e.received===Cn.undefined?"Required":`Expected ${e.expected}, received ${e.received}`;break;case Mn.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(e.expected,Sn.jsonStringifyReplacer)}`;break;case Mn.unrecognized_keys:n=`Unrecognized key(s) in object: ${Sn.joinValues(e.keys,", ")}`;break;case Mn.invalid_union:n="Invalid input";break;case Mn.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${Sn.joinValues(e.options)}`;break;case Mn.invalid_enum_value:n=`Invalid enum value. Expected ${Sn.joinValues(e.options)}, received '${e.received}'`;break;case Mn.invalid_arguments:n="Invalid function arguments";break;case Mn.invalid_return_type:n="Invalid function return type";break;case Mn.invalid_date:n="Invalid date";break;case Mn.invalid_string:"object"==typeof e.validation?"startsWith"in e.validation?n=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?n=`Invalid input: must end with "${e.validation.endsWith}"`:Sn.assertNever(e.validation):n="regex"!==e.validation?`Invalid ${e.validation}`:"Invalid";break;case Mn.too_small:n="array"===e.type?`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:"string"===e.type?`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:"number"===e.type?`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:"date"===e.type?`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(e.minimum)}`:"Invalid input";break;case Mn.too_big:n="array"===e.type?`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:"string"===e.type?`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:"number"===e.type?`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:"date"===e.type?`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(e.maximum)}`:"Invalid input";break;case Mn.custom:n="Invalid input";break;case Mn.invalid_intersection_types:n="Intersection results could not be merged";break;case Mn.not_multiple_of:n=`Number must be a multiple of ${e.multipleOf}`;break;case Mn.not_finite:n="Number must be finite";break;default:n=t.defaultError,Sn.assertNever(e)}return{message:n}};let Un=xn;function Dn(){return Un}const jn=e=>{const{data:t,path:n,errorMaps:r,issueData:i}=e,o=[...n,...i.path||[]],a={...i,path:o};let s="";const u=r.filter((e=>!!e)).slice().reverse();for(const e of u)s=e(a,{data:t,defaultError:s}).message;return{...i,path:o,message:i.message||s}};function Ln(e,t){const n=jn({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,Dn(),xn].filter((e=>!!e))});e.common.issues.push(n)}class Bn{constructor(){this.value="valid"}dirty(){"valid"===this.value&&(this.value="dirty")}abort(){"aborted"!==this.value&&(this.value="aborted")}static mergeArray(e,t){const n=[];for(const r of t){if("aborted"===r.status)return Zn;"dirty"===r.status&&e.dirty(),n.push(r.value)}return{status:e.value,value:n}}static async mergeObjectAsync(e,t){const n=[];for(const e of t)n.push({key:await e.key,value:await e.value});return Bn.mergeObjectSync(e,n)}static mergeObjectSync(e,t){const n={};for(const r of t){const{key:t,value:i}=r;if("aborted"===t.status)return Zn;if("aborted"===i.status)return Zn;"dirty"===t.status&&e.dirty(),"dirty"===i.status&&e.dirty(),(void 0!==i.value||r.alwaysSet)&&(n[t.value]=i.value)}return{status:e.value,value:n}}}const Zn=Object.freeze({status:"aborted"}),zn=e=>({status:"dirty",value:e}),Wn=e=>({status:"valid",value:e}),Fn=e=>"aborted"===e.status,Gn=e=>"dirty"===e.status,Hn=e=>"valid"===e.status,Vn=e=>"undefined"!=typeof Promise&&e instanceof Promise;var Kn;!function(e){e.errToObj=e=>"string"==typeof e?{message:e}:e||{},e.toString=e=>"string"==typeof e?e:null==e?void 0:e.message}(Kn||(Kn={}));class Jn{constructor(e,t,n,r){this.parent=e,this.data=t,this._path=n,this._key=r}get path(){return this._path.concat(this._key)}}const qn=(e,t)=>{if(Hn(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,error:new Rn(e.common.issues)}};function Qn(e){if(!e)return{};const{errorMap:t,invalid_type_error:n,required_error:r,description:i}=e;if(t&&(n||r))throw new Error('Can\'t use "invalid_type_error" or "required_error" in conjunction with custom error map.');if(t)return{errorMap:t,description:i};return{errorMap:(e,t)=>"invalid_type"!==e.code?{message:t.defaultError}:void 0===t.data?{message:null!=r?r:t.defaultError}:{message:null!=n?n:t.defaultError},description:i}}class $n{constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this)}get description(){return this._def.description}_getType(e){return Nn(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:Nn(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new Bn,ctx:{common:e.parent.common,data:e.data,parsedType:Nn(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const t=this._parse(e);if(Vn(t))throw new Error("Synchronous parse encountered promise.");return t}_parseAsync(e){const t=this._parse(e);return Promise.resolve(t)}parse(e,t){const n=this.safeParse(e,t);if(n.success)return n.data;throw n.error}safeParse(e,t){var n;const r={common:{issues:[],async:null!==(n=null==t?void 0:t.async)&&void 0!==n&&n,contextualErrorMap:null==t?void 0:t.errorMap},path:(null==t?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Nn(e)},i=this._parseSync({data:e,path:r.path,parent:r});return qn(r,i)}async parseAsync(e,t){const n=await this.safeParseAsync(e,t);if(n.success)return n.data;throw n.error}async safeParseAsync(e,t){const n={common:{issues:[],contextualErrorMap:null==t?void 0:t.errorMap,async:!0},path:(null==t?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Nn(e)},r=this._parse({data:e,path:n.path,parent:n}),i=await(Vn(r)?r:Promise.resolve(r));return qn(n,i)}refine(e,t){const n=e=>"string"==typeof t||void 0===t?{message:t}:"function"==typeof t?t(e):t;return this._refinement(((t,r)=>{const i=e(t),o=()=>r.addIssue({code:Mn.custom,...n(t)});return"undefined"!=typeof Promise&&i instanceof Promise?i.then((e=>!!e||(o(),!1))):!!i||(o(),!1)}))}refinement(e,t){return this._refinement(((n,r)=>!!e(n)||(r.addIssue("function"==typeof t?t(n,r):t),!1)))}_refinement(e){return new Ur({schema:this,typeName:Vr.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}optional(){return Dr.create(this,this._def)}nullable(){return jr.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return mr.create(this,this._def)}promise(){return xr.create(this,this._def)}or(e){return _r.create([this,e],this._def)}and(e){return Er.create(this,e,this._def)}transform(e){return new Ur({...Qn(this._def),schema:this,typeName:Vr.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const t="function"==typeof e?e:()=>e;return new Lr({...Qn(this._def),innerType:this,defaultValue:t,typeName:Vr.ZodDefault})}brand(){return new Wr({typeName:Vr.ZodBranded,type:this,...Qn(this._def)})}catch(e){const t="function"==typeof e?e:()=>e;return new Br({...Qn(this._def),innerType:this,catchValue:t,typeName:Vr.ZodCatch})}describe(e){return new(0,this.constructor)({...this._def,description:e})}pipe(e){return Fr.create(this,e)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const Yn=/^c[^\s-]{8,}$/i,Xn=/^[a-z][a-z0-9]*$/,er=/^([a-f0-9]{8}-[a-f0-9]{4}-[1-5][a-f0-9]{3}-[a-f0-9]{4}-[a-f0-9]{12}|00000000-0000-0000-0000-000000000000)$/i,tr=/^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|([^-]([a-zA-Z0-9-]*\.)+[a-zA-Z]{2,}))$/;class nr extends $n{constructor(){super(...arguments),this._regex=(e,t,n)=>this.refinement((t=>e.test(t)),{validation:t,code:Mn.invalid_string,...Kn.errToObj(n)}),this.nonempty=e=>this.min(1,Kn.errToObj(e)),this.trim=()=>new nr({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}_parse(e){this._def.coerce&&(e.data=String(e.data));if(this._getType(e)!==Cn.string){const t=this._getOrReturnCtx(e);return Ln(t,{code:Mn.invalid_type,expected:Cn.string,received:t.parsedType}),Zn}const t=new Bn;let n;for(const i of this._def.checks)if("min"===i.kind)e.data.length<i.value&&(n=this._getOrReturnCtx(e,n),Ln(n,{code:Mn.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!1,message:i.message}),t.dirty());else if("max"===i.kind)e.data.length>i.value&&(n=this._getOrReturnCtx(e,n),Ln(n,{code:Mn.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!1,message:i.message}),t.dirty());else if("length"===i.kind){const r=e.data.length>i.value,o=e.data.length<i.value;(r||o)&&(n=this._getOrReturnCtx(e,n),r?Ln(n,{code:Mn.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}):o&&Ln(n,{code:Mn.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}),t.dirty())}else if("email"===i.kind)tr.test(e.data)||(n=this._getOrReturnCtx(e,n),Ln(n,{validation:"email",code:Mn.invalid_string,message:i.message}),t.dirty());else if("uuid"===i.kind)er.test(e.data)||(n=this._getOrReturnCtx(e,n),Ln(n,{validation:"uuid",code:Mn.invalid_string,message:i.message}),t.dirty());else if("cuid"===i.kind)Yn.test(e.data)||(n=this._getOrReturnCtx(e,n),Ln(n,{validation:"cuid",code:Mn.invalid_string,message:i.message}),t.dirty());else if("cuid2"===i.kind)Xn.test(e.data)||(n=this._getOrReturnCtx(e,n),Ln(n,{validation:"cuid2",code:Mn.invalid_string,message:i.message}),t.dirty());else if("url"===i.kind)try{new URL(e.data)}catch(r){n=this._getOrReturnCtx(e,n),Ln(n,{validation:"url",code:Mn.invalid_string,message:i.message}),t.dirty()}else if("regex"===i.kind){i.regex.lastIndex=0;i.regex.test(e.data)||(n=this._getOrReturnCtx(e,n),Ln(n,{validation:"regex",code:Mn.invalid_string,message:i.message}),t.dirty())}else if("trim"===i.kind)e.data=e.data.trim();else if("startsWith"===i.kind)e.data.startsWith(i.value)||(n=this._getOrReturnCtx(e,n),Ln(n,{code:Mn.invalid_string,validation:{startsWith:i.value},message:i.message}),t.dirty());else if("endsWith"===i.kind)e.data.endsWith(i.value)||(n=this._getOrReturnCtx(e,n),Ln(n,{code:Mn.invalid_string,validation:{endsWith:i.value},message:i.message}),t.dirty());else if("datetime"===i.kind){((r=i).precision?r.offset?new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${r.precision}}(([+-]\\d{2}(:?\\d{2})?)|Z)$`):new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${r.precision}}Z$`):0===r.precision?r.offset?new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(([+-]\\d{2}(:?\\d{2})?)|Z)$"):new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}Z$"):r.offset?new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?(([+-]\\d{2}(:?\\d{2})?)|Z)$"):new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?Z$")).test(e.data)||(n=this._getOrReturnCtx(e,n),Ln(n,{code:Mn.invalid_string,validation:"datetime",message:i.message}),t.dirty())}else Sn.assertNever(i);var r;return{status:t.value,value:e.data}}_addCheck(e){return new nr({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...Kn.errToObj(e)})}url(e){return this._addCheck({kind:"url",...Kn.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...Kn.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...Kn.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...Kn.errToObj(e)})}datetime(e){var t;return"string"==typeof e?this._addCheck({kind:"datetime",precision:null,offset:!1,message:e}):this._addCheck({kind:"datetime",precision:void 0===(null==e?void 0:e.precision)?null:null==e?void 0:e.precision,offset:null!==(t=null==e?void 0:e.offset)&&void 0!==t&&t,...Kn.errToObj(null==e?void 0:e.message)})}regex(e,t){return this._addCheck({kind:"regex",regex:e,...Kn.errToObj(t)})}startsWith(e,t){return this._addCheck({kind:"startsWith",value:e,...Kn.errToObj(t)})}endsWith(e,t){return this._addCheck({kind:"endsWith",value:e,...Kn.errToObj(t)})}min(e,t){return this._addCheck({kind:"min",value:e,...Kn.errToObj(t)})}max(e,t){return this._addCheck({kind:"max",value:e,...Kn.errToObj(t)})}length(e,t){return this._addCheck({kind:"length",value:e,...Kn.errToObj(t)})}get isDatetime(){return!!this._def.checks.find((e=>"datetime"===e.kind))}get isEmail(){return!!this._def.checks.find((e=>"email"===e.kind))}get isURL(){return!!this._def.checks.find((e=>"url"===e.kind))}get isUUID(){return!!this._def.checks.find((e=>"uuid"===e.kind))}get isCUID(){return!!this._def.checks.find((e=>"cuid"===e.kind))}get isCUID2(){return!!this._def.checks.find((e=>"cuid2"===e.kind))}get minLength(){let e=null;for(const t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return e}get maxLength(){let e=null;for(const t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return e}}function rr(e,t){const n=(e.toString().split(".")[1]||"").length,r=(t.toString().split(".")[1]||"").length,i=n>r?n:r;return parseInt(e.toFixed(i).replace(".",""))%parseInt(t.toFixed(i).replace(".",""))/Math.pow(10,i)}nr.create=e=>{var t;return new nr({checks:[],typeName:Vr.ZodString,coerce:null!==(t=null==e?void 0:e.coerce)&&void 0!==t&&t,...Qn(e)})};class ir extends $n{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){this._def.coerce&&(e.data=Number(e.data));if(this._getType(e)!==Cn.number){const t=this._getOrReturnCtx(e);return Ln(t,{code:Mn.invalid_type,expected:Cn.number,received:t.parsedType}),Zn}let t;const n=new Bn;for(const r of this._def.checks)if("int"===r.kind)Sn.isInteger(e.data)||(t=this._getOrReturnCtx(e,t),Ln(t,{code:Mn.invalid_type,expected:"integer",received:"float",message:r.message}),n.dirty());else if("min"===r.kind){(r.inclusive?e.data<r.value:e.data<=r.value)&&(t=this._getOrReturnCtx(e,t),Ln(t,{code:Mn.too_small,minimum:r.value,type:"number",inclusive:r.inclusive,exact:!1,message:r.message}),n.dirty())}else if("max"===r.kind){(r.inclusive?e.data>r.value:e.data>=r.value)&&(t=this._getOrReturnCtx(e,t),Ln(t,{code:Mn.too_big,maximum:r.value,type:"number",inclusive:r.inclusive,exact:!1,message:r.message}),n.dirty())}else"multipleOf"===r.kind?0!==rr(e.data,r.value)&&(t=this._getOrReturnCtx(e,t),Ln(t,{code:Mn.not_multiple_of,multipleOf:r.value,message:r.message}),n.dirty()):"finite"===r.kind?Number.isFinite(e.data)||(t=this._getOrReturnCtx(e,t),Ln(t,{code:Mn.not_finite,message:r.message}),n.dirty()):Sn.assertNever(r);return{status:n.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,Kn.toString(t))}gt(e,t){return this.setLimit("min",e,!1,Kn.toString(t))}lte(e,t){return this.setLimit("max",e,!0,Kn.toString(t))}lt(e,t){return this.setLimit("max",e,!1,Kn.toString(t))}setLimit(e,t,n,r){return new ir({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:n,message:Kn.toString(r)}]})}_addCheck(e){return new ir({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:Kn.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:Kn.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:Kn.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:Kn.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:Kn.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:Kn.toString(t)})}finite(e){return this._addCheck({kind:"finite",message:Kn.toString(e)})}get minValue(){let e=null;for(const t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(const t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return e}get isInt(){return!!this._def.checks.find((e=>"int"===e.kind||"multipleOf"===e.kind&&Sn.isInteger(e.value)))}get isFinite(){let e=null,t=null;for(const n of this._def.checks){if("finite"===n.kind||"int"===n.kind||"multipleOf"===n.kind)return!0;"min"===n.kind?(null===t||n.value>t)&&(t=n.value):"max"===n.kind&&(null===e||n.value<e)&&(e=n.value)}return Number.isFinite(t)&&Number.isFinite(e)}}ir.create=e=>new ir({checks:[],typeName:Vr.ZodNumber,coerce:(null==e?void 0:e.coerce)||!1,...Qn(e)});class or extends $n{_parse(e){this._def.coerce&&(e.data=BigInt(e.data));if(this._getType(e)!==Cn.bigint){const t=this._getOrReturnCtx(e);return Ln(t,{code:Mn.invalid_type,expected:Cn.bigint,received:t.parsedType}),Zn}return Wn(e.data)}}or.create=e=>{var t;return new or({typeName:Vr.ZodBigInt,coerce:null!==(t=null==e?void 0:e.coerce)&&void 0!==t&&t,...Qn(e)})};class ar extends $n{_parse(e){this._def.coerce&&(e.data=Boolean(e.data));if(this._getType(e)!==Cn.boolean){const t=this._getOrReturnCtx(e);return Ln(t,{code:Mn.invalid_type,expected:Cn.boolean,received:t.parsedType}),Zn}return Wn(e.data)}}ar.create=e=>new ar({typeName:Vr.ZodBoolean,coerce:(null==e?void 0:e.coerce)||!1,...Qn(e)});class sr extends $n{_parse(e){this._def.coerce&&(e.data=new Date(e.data));if(this._getType(e)!==Cn.date){const t=this._getOrReturnCtx(e);return Ln(t,{code:Mn.invalid_type,expected:Cn.date,received:t.parsedType}),Zn}if(isNaN(e.data.getTime())){return Ln(this._getOrReturnCtx(e),{code:Mn.invalid_date}),Zn}const t=new Bn;let n;for(const r of this._def.checks)"min"===r.kind?e.data.getTime()<r.value&&(n=this._getOrReturnCtx(e,n),Ln(n,{code:Mn.too_small,message:r.message,inclusive:!0,exact:!1,minimum:r.value,type:"date"}),t.dirty()):"max"===r.kind?e.data.getTime()>r.value&&(n=this._getOrReturnCtx(e,n),Ln(n,{code:Mn.too_big,message:r.message,inclusive:!0,exact:!1,maximum:r.value,type:"date"}),t.dirty()):Sn.assertNever(r);return{status:t.value,value:new Date(e.data.getTime())}}_addCheck(e){return new sr({...this._def,checks:[...this._def.checks,e]})}min(e,t){return this._addCheck({kind:"min",value:e.getTime(),message:Kn.toString(t)})}max(e,t){return this._addCheck({kind:"max",value:e.getTime(),message:Kn.toString(t)})}get minDate(){let e=null;for(const t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return null!=e?new Date(e):null}get maxDate(){let e=null;for(const t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return null!=e?new Date(e):null}}sr.create=e=>new sr({checks:[],coerce:(null==e?void 0:e.coerce)||!1,typeName:Vr.ZodDate,...Qn(e)});class ur extends $n{_parse(e){if(this._getType(e)!==Cn.symbol){const t=this._getOrReturnCtx(e);return Ln(t,{code:Mn.invalid_type,expected:Cn.symbol,received:t.parsedType}),Zn}return Wn(e.data)}}ur.create=e=>new ur({typeName:Vr.ZodSymbol,...Qn(e)});class cr extends $n{_parse(e){if(this._getType(e)!==Cn.undefined){const t=this._getOrReturnCtx(e);return Ln(t,{code:Mn.invalid_type,expected:Cn.undefined,received:t.parsedType}),Zn}return Wn(e.data)}}cr.create=e=>new cr({typeName:Vr.ZodUndefined,...Qn(e)});class lr extends $n{_parse(e){if(this._getType(e)!==Cn.null){const t=this._getOrReturnCtx(e);return Ln(t,{code:Mn.invalid_type,expected:Cn.null,received:t.parsedType}),Zn}return Wn(e.data)}}lr.create=e=>new lr({typeName:Vr.ZodNull,...Qn(e)});class dr extends $n{constructor(){super(...arguments),this._any=!0}_parse(e){return Wn(e.data)}}dr.create=e=>new dr({typeName:Vr.ZodAny,...Qn(e)});class pr extends $n{constructor(){super(...arguments),this._unknown=!0}_parse(e){return Wn(e.data)}}pr.create=e=>new pr({typeName:Vr.ZodUnknown,...Qn(e)});class fr extends $n{_parse(e){const t=this._getOrReturnCtx(e);return Ln(t,{code:Mn.invalid_type,expected:Cn.never,received:t.parsedType}),Zn}}fr.create=e=>new fr({typeName:Vr.ZodNever,...Qn(e)});class hr extends $n{_parse(e){if(this._getType(e)!==Cn.undefined){const t=this._getOrReturnCtx(e);return Ln(t,{code:Mn.invalid_type,expected:Cn.void,received:t.parsedType}),Zn}return Wn(e.data)}}hr.create=e=>new hr({typeName:Vr.ZodVoid,...Qn(e)});class mr extends $n{_parse(e){const{ctx:t,status:n}=this._processInputParams(e),r=this._def;if(t.parsedType!==Cn.array)return Ln(t,{code:Mn.invalid_type,expected:Cn.array,received:t.parsedType}),Zn;if(null!==r.exactLength){const e=t.data.length>r.exactLength.value,i=t.data.length<r.exactLength.value;(e||i)&&(Ln(t,{code:e?Mn.too_big:Mn.too_small,minimum:i?r.exactLength.value:void 0,maximum:e?r.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:r.exactLength.message}),n.dirty())}if(null!==r.minLength&&t.data.length<r.minLength.value&&(Ln(t,{code:Mn.too_small,minimum:r.minLength.value,type:"array",inclusive:!0,exact:!1,message:r.minLength.message}),n.dirty()),null!==r.maxLength&&t.data.length>r.maxLength.value&&(Ln(t,{code:Mn.too_big,maximum:r.maxLength.value,type:"array",inclusive:!0,exact:!1,message:r.maxLength.message}),n.dirty()),t.common.async)return Promise.all([...t.data].map(((e,n)=>r.type._parseAsync(new Jn(t,e,t.path,n))))).then((e=>Bn.mergeArray(n,e)));const i=[...t.data].map(((e,n)=>r.type._parseSync(new Jn(t,e,t.path,n))));return Bn.mergeArray(n,i)}get element(){return this._def.type}min(e,t){return new mr({...this._def,minLength:{value:e,message:Kn.toString(t)}})}max(e,t){return new mr({...this._def,maxLength:{value:e,message:Kn.toString(t)}})}length(e,t){return new mr({...this._def,exactLength:{value:e,message:Kn.toString(t)}})}nonempty(e){return this.min(1,e)}}var vr;function yr(e){if(e instanceof gr){const t={};for(const n in e.shape){const r=e.shape[n];t[n]=Dr.create(yr(r))}return new gr({...e._def,shape:()=>t})}return e instanceof mr?mr.create(yr(e.element)):e instanceof Dr?Dr.create(yr(e.unwrap())):e instanceof jr?jr.create(yr(e.unwrap())):e instanceof Pr?Pr.create(e.items.map((e=>yr(e)))):e}mr.create=(e,t)=>new mr({type:e,minLength:null,maxLength:null,exactLength:null,typeName:Vr.ZodArray,...Qn(t)}),function(e){e.mergeShapes=(e,t)=>({...e,...t})}(vr||(vr={}));class gr extends $n{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(null!==this._cached)return this._cached;const e=this._def.shape(),t=Sn.objectKeys(e);return this._cached={shape:e,keys:t}}_parse(e){if(this._getType(e)!==Cn.object){const t=this._getOrReturnCtx(e);return Ln(t,{code:Mn.invalid_type,expected:Cn.object,received:t.parsedType}),Zn}const{status:t,ctx:n}=this._processInputParams(e),{shape:r,keys:i}=this._getCached(),o=[];if(!(this._def.catchall instanceof fr&&"strip"===this._def.unknownKeys))for(const e in n.data)i.includes(e)||o.push(e);const a=[];for(const e of i){const t=r[e],i=n.data[e];a.push({key:{status:"valid",value:e},value:t._parse(new Jn(n,i,n.path,e)),alwaysSet:e in n.data})}if(this._def.catchall instanceof fr){const e=this._def.unknownKeys;if("passthrough"===e)for(const e of o)a.push({key:{status:"valid",value:e},value:{status:"valid",value:n.data[e]}});else if("strict"===e)o.length>0&&(Ln(n,{code:Mn.unrecognized_keys,keys:o}),t.dirty());else if("strip"!==e)throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const e=this._def.catchall;for(const t of o){const r=n.data[t];a.push({key:{status:"valid",value:t},value:e._parse(new Jn(n,r,n.path,t)),alwaysSet:t in n.data})}}return n.common.async?Promise.resolve().then((async()=>{const e=[];for(const t of a){const n=await t.key;e.push({key:n,value:await t.value,alwaysSet:t.alwaysSet})}return e})).then((e=>Bn.mergeObjectSync(t,e))):Bn.mergeObjectSync(t,a)}get shape(){return this._def.shape()}strict(e){return Kn.errToObj,new gr({...this._def,unknownKeys:"strict",...void 0!==e?{errorMap:(t,n)=>{var r,i,o,a;const s=null!==(o=null===(i=(r=this._def).errorMap)||void 0===i?void 0:i.call(r,t,n).message)&&void 0!==o?o:n.defaultError;return"unrecognized_keys"===t.code?{message:null!==(a=Kn.errToObj(e).message)&&void 0!==a?a:s}:{message:s}}}:{}})}strip(){return new gr({...this._def,unknownKeys:"strip"})}passthrough(){return new gr({...this._def,unknownKeys:"passthrough"})}extend(e){return new gr({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new gr({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>vr.mergeShapes(this._def.shape(),e._def.shape()),typeName:Vr.ZodObject})}setKey(e,t){return this.augment({[e]:t})}catchall(e){return new gr({...this._def,catchall:e})}pick(e){const t={};return Sn.objectKeys(e).forEach((n=>{e[n]&&this.shape[n]&&(t[n]=this.shape[n])})),new gr({...this._def,shape:()=>t})}omit(e){const t={};return Sn.objectKeys(this.shape).forEach((n=>{e[n]||(t[n]=this.shape[n])})),new gr({...this._def,shape:()=>t})}deepPartial(){return yr(this)}partial(e){const t={};return Sn.objectKeys(this.shape).forEach((n=>{const r=this.shape[n];e&&!e[n]?t[n]=r:t[n]=r.optional()})),new gr({...this._def,shape:()=>t})}required(e){const t={};return Sn.objectKeys(this.shape).forEach((n=>{if(e&&!e[n])t[n]=this.shape[n];else{let e=this.shape[n];for(;e instanceof Dr;)e=e._def.innerType;t[n]=e}})),new gr({...this._def,shape:()=>t})}keyof(){return Nr(Sn.objectKeys(this.shape))}}gr.create=(e,t)=>new gr({shape:()=>e,unknownKeys:"strip",catchall:fr.create(),typeName:Vr.ZodObject,...Qn(t)}),gr.strictCreate=(e,t)=>new gr({shape:()=>e,unknownKeys:"strict",catchall:fr.create(),typeName:Vr.ZodObject,...Qn(t)}),gr.lazycreate=(e,t)=>new gr({shape:e,unknownKeys:"strip",catchall:fr.create(),typeName:Vr.ZodObject,...Qn(t)});class _r extends $n{_parse(e){const{ctx:t}=this._processInputParams(e),n=this._def.options;if(t.common.async)return Promise.all(n.map((async e=>{const n={...t,common:{...t.common,issues:[]},parent:null};return{result:await e._parseAsync({data:t.data,path:t.path,parent:n}),ctx:n}}))).then((function(e){for(const t of e)if("valid"===t.result.status)return t.result;for(const n of e)if("dirty"===n.result.status)return t.common.issues.push(...n.ctx.common.issues),n.result;const n=e.map((e=>new Rn(e.ctx.common.issues)));return Ln(t,{code:Mn.invalid_union,unionErrors:n}),Zn}));{let e;const r=[];for(const i of n){const n={...t,common:{...t.common,issues:[]},parent:null},o=i._parseSync({data:t.data,path:t.path,parent:n});if("valid"===o.status)return o;"dirty"!==o.status||e||(e={result:o,ctx:n}),n.common.issues.length&&r.push(n.common.issues)}if(e)return t.common.issues.push(...e.ctx.common.issues),e.result;const i=r.map((e=>new Rn(e)));return Ln(t,{code:Mn.invalid_union,unionErrors:i}),Zn}}get options(){return this._def.options}}_r.create=(e,t)=>new _r({options:e,typeName:Vr.ZodUnion,...Qn(t)});const wr=e=>e instanceof kr?wr(e.schema):e instanceof Ur?wr(e.innerType()):e instanceof Cr?[e.value]:e instanceof Mr?e.options:e instanceof Rr?Object.keys(e.enum):e instanceof Lr?wr(e._def.innerType):e instanceof cr?[void 0]:e instanceof lr?[null]:null;class br extends $n{_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==Cn.object)return Ln(t,{code:Mn.invalid_type,expected:Cn.object,received:t.parsedType}),Zn;const n=this.discriminator,r=t.data[n],i=this.optionsMap.get(r);return i?t.common.async?i._parseAsync({data:t.data,path:t.path,parent:t}):i._parseSync({data:t.data,path:t.path,parent:t}):(Ln(t,{code:Mn.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[n]}),Zn)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,t,n){const r=new Map;for(const n of t){const t=wr(n.shape[e]);if(!t)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(const i of t){if(r.has(i))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(i)}`);r.set(i,n)}}return new br({typeName:Vr.ZodDiscriminatedUnion,discriminator:e,options:t,optionsMap:r,...Qn(n)})}}function Tr(e,t){const n=Nn(e),r=Nn(t);if(e===t)return{valid:!0,data:e};if(n===Cn.object&&r===Cn.object){const n=Sn.objectKeys(t),r=Sn.objectKeys(e).filter((e=>-1!==n.indexOf(e))),i={...e,...t};for(const n of r){const r=Tr(e[n],t[n]);if(!r.valid)return{valid:!1};i[n]=r.data}return{valid:!0,data:i}}if(n===Cn.array&&r===Cn.array){if(e.length!==t.length)return{valid:!1};const n=[];for(let r=0;r<e.length;r++){const i=Tr(e[r],t[r]);if(!i.valid)return{valid:!1};n.push(i.data)}return{valid:!0,data:n}}return n===Cn.date&&r===Cn.date&&+e==+t?{valid:!0,data:e}:{valid:!1}}class Er extends $n{_parse(e){const{status:t,ctx:n}=this._processInputParams(e),r=(e,r)=>{if(Fn(e)||Fn(r))return Zn;const i=Tr(e.value,r.value);return i.valid?((Gn(e)||Gn(r))&&t.dirty(),{status:t.value,value:i.data}):(Ln(n,{code:Mn.invalid_intersection_types}),Zn)};return n.common.async?Promise.all([this._def.left._parseAsync({data:n.data,path:n.path,parent:n}),this._def.right._parseAsync({data:n.data,path:n.path,parent:n})]).then((([e,t])=>r(e,t))):r(this._def.left._parseSync({data:n.data,path:n.path,parent:n}),this._def.right._parseSync({data:n.data,path:n.path,parent:n}))}}Er.create=(e,t,n)=>new Er({left:e,right:t,typeName:Vr.ZodIntersection,...Qn(n)});class Pr extends $n{_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==Cn.array)return Ln(n,{code:Mn.invalid_type,expected:Cn.array,received:n.parsedType}),Zn;if(n.data.length<this._def.items.length)return Ln(n,{code:Mn.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),Zn;!this._def.rest&&n.data.length>this._def.items.length&&(Ln(n,{code:Mn.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),t.dirty());const r=[...n.data].map(((e,t)=>{const r=this._def.items[t]||this._def.rest;return r?r._parse(new Jn(n,e,n.path,t)):null})).filter((e=>!!e));return n.common.async?Promise.all(r).then((e=>Bn.mergeArray(t,e))):Bn.mergeArray(t,r)}get items(){return this._def.items}rest(e){return new Pr({...this._def,rest:e})}}Pr.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Pr({items:e,typeName:Vr.ZodTuple,rest:null,...Qn(t)})};class Sr extends $n{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==Cn.object)return Ln(n,{code:Mn.invalid_type,expected:Cn.object,received:n.parsedType}),Zn;const r=[],i=this._def.keyType,o=this._def.valueType;for(const e in n.data)r.push({key:i._parse(new Jn(n,e,n.path,e)),value:o._parse(new Jn(n,n.data[e],n.path,e))});return n.common.async?Bn.mergeObjectAsync(t,r):Bn.mergeObjectSync(t,r)}get element(){return this._def.valueType}static create(e,t,n){return new Sr(t instanceof $n?{keyType:e,valueType:t,typeName:Vr.ZodRecord,...Qn(n)}:{keyType:nr.create(),valueType:e,typeName:Vr.ZodRecord,...Qn(t)})}}class Or extends $n{_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==Cn.map)return Ln(n,{code:Mn.invalid_type,expected:Cn.map,received:n.parsedType}),Zn;const r=this._def.keyType,i=this._def.valueType,o=[...n.data.entries()].map((([e,t],o)=>({key:r._parse(new Jn(n,e,n.path,[o,"key"])),value:i._parse(new Jn(n,t,n.path,[o,"value"]))})));if(n.common.async){const e=new Map;return Promise.resolve().then((async()=>{for(const n of o){const r=await n.key,i=await n.value;if("aborted"===r.status||"aborted"===i.status)return Zn;"dirty"!==r.status&&"dirty"!==i.status||t.dirty(),e.set(r.value,i.value)}return{status:t.value,value:e}}))}{const e=new Map;for(const n of o){const r=n.key,i=n.value;if("aborted"===r.status||"aborted"===i.status)return Zn;"dirty"!==r.status&&"dirty"!==i.status||t.dirty(),e.set(r.value,i.value)}return{status:t.value,value:e}}}}Or.create=(e,t,n)=>new Or({valueType:t,keyType:e,typeName:Vr.ZodMap,...Qn(n)});class Ar extends $n{_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==Cn.set)return Ln(n,{code:Mn.invalid_type,expected:Cn.set,received:n.parsedType}),Zn;const r=this._def;null!==r.minSize&&n.data.size<r.minSize.value&&(Ln(n,{code:Mn.too_small,minimum:r.minSize.value,type:"set",inclusive:!0,exact:!1,message:r.minSize.message}),t.dirty()),null!==r.maxSize&&n.data.size>r.maxSize.value&&(Ln(n,{code:Mn.too_big,maximum:r.maxSize.value,type:"set",inclusive:!0,exact:!1,message:r.maxSize.message}),t.dirty());const i=this._def.valueType;function o(e){const n=new Set;for(const r of e){if("aborted"===r.status)return Zn;"dirty"===r.status&&t.dirty(),n.add(r.value)}return{status:t.value,value:n}}const a=[...n.data.values()].map(((e,t)=>i._parse(new Jn(n,e,n.path,t))));return n.common.async?Promise.all(a).then((e=>o(e))):o(a)}min(e,t){return new Ar({...this._def,minSize:{value:e,message:Kn.toString(t)}})}max(e,t){return new Ar({...this._def,maxSize:{value:e,message:Kn.toString(t)}})}size(e,t){return this.min(e,t).max(e,t)}nonempty(e){return this.min(1,e)}}Ar.create=(e,t)=>new Ar({valueType:e,minSize:null,maxSize:null,typeName:Vr.ZodSet,...Qn(t)});class Ir extends $n{constructor(){super(...arguments),this.validate=this.implement}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==Cn.function)return Ln(t,{code:Mn.invalid_type,expected:Cn.function,received:t.parsedType}),Zn;function n(e,n){return jn({data:e,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,Dn(),xn].filter((e=>!!e)),issueData:{code:Mn.invalid_arguments,argumentsError:n}})}function r(e,n){return jn({data:e,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,Dn(),xn].filter((e=>!!e)),issueData:{code:Mn.invalid_return_type,returnTypeError:n}})}const i={errorMap:t.common.contextualErrorMap},o=t.data;return this._def.returns instanceof xr?Wn((async(...e)=>{const t=new Rn([]),a=await this._def.args.parseAsync(e,i).catch((r=>{throw t.addIssue(n(e,r)),t})),s=await o(...a);return await this._def.returns._def.type.parseAsync(s,i).catch((e=>{throw t.addIssue(r(s,e)),t}))})):Wn(((...e)=>{const t=this._def.args.safeParse(e,i);if(!t.success)throw new Rn([n(e,t.error)]);const a=o(...t.data),s=this._def.returns.safeParse(a,i);if(!s.success)throw new Rn([r(a,s.error)]);return s.data}))}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new Ir({...this._def,args:Pr.create(e).rest(pr.create())})}returns(e){return new Ir({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,t,n){return new Ir({args:e||Pr.create([]).rest(pr.create()),returns:t||pr.create(),typeName:Vr.ZodFunction,...Qn(n)})}}class kr extends $n{get schema(){return this._def.getter()}_parse(e){const{ctx:t}=this._processInputParams(e);return this._def.getter()._parse({data:t.data,path:t.path,parent:t})}}kr.create=(e,t)=>new kr({getter:e,typeName:Vr.ZodLazy,...Qn(t)});class Cr extends $n{_parse(e){if(e.data!==this._def.value){const t=this._getOrReturnCtx(e);return Ln(t,{received:t.data,code:Mn.invalid_literal,expected:this._def.value}),Zn}return{status:"valid",value:e.data}}get value(){return this._def.value}}function Nr(e,t){return new Mr({values:e,typeName:Vr.ZodEnum,...Qn(t)})}Cr.create=(e,t)=>new Cr({value:e,typeName:Vr.ZodLiteral,...Qn(t)});class Mr extends $n{_parse(e){if("string"!=typeof e.data){const t=this._getOrReturnCtx(e),n=this._def.values;return Ln(t,{expected:Sn.joinValues(n),received:t.parsedType,code:Mn.invalid_type}),Zn}if(-1===this._def.values.indexOf(e.data)){const t=this._getOrReturnCtx(e),n=this._def.values;return Ln(t,{received:t.data,code:Mn.invalid_enum_value,options:n}),Zn}return Wn(e.data)}get options(){return this._def.values}get enum(){const e={};for(const t of this._def.values)e[t]=t;return e}get Values(){const e={};for(const t of this._def.values)e[t]=t;return e}get Enum(){const e={};for(const t of this._def.values)e[t]=t;return e}extract(e){return Mr.create(e)}exclude(e){return Mr.create(this.options.filter((t=>!e.includes(t))))}}Mr.create=Nr;class Rr extends $n{_parse(e){const t=Sn.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(e);if(n.parsedType!==Cn.string&&n.parsedType!==Cn.number){const e=Sn.objectValues(t);return Ln(n,{expected:Sn.joinValues(e),received:n.parsedType,code:Mn.invalid_type}),Zn}if(-1===t.indexOf(e.data)){const e=Sn.objectValues(t);return Ln(n,{received:n.data,code:Mn.invalid_enum_value,options:e}),Zn}return Wn(e.data)}get enum(){return this._def.values}}Rr.create=(e,t)=>new Rr({values:e,typeName:Vr.ZodNativeEnum,...Qn(t)});class xr extends $n{unwrap(){return this._def.type}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==Cn.promise&&!1===t.common.async)return Ln(t,{code:Mn.invalid_type,expected:Cn.promise,received:t.parsedType}),Zn;const n=t.parsedType===Cn.promise?t.data:Promise.resolve(t.data);return Wn(n.then((e=>this._def.type.parseAsync(e,{path:t.path,errorMap:t.common.contextualErrorMap}))))}}xr.create=(e,t)=>new xr({type:e,typeName:Vr.ZodPromise,...Qn(t)});class Ur extends $n{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===Vr.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){const{status:t,ctx:n}=this._processInputParams(e),r=this._def.effect||null;if("preprocess"===r.type){const e=r.transform(n.data);return n.common.async?Promise.resolve(e).then((e=>this._def.schema._parseAsync({data:e,path:n.path,parent:n}))):this._def.schema._parseSync({data:e,path:n.path,parent:n})}const i={addIssue:e=>{Ln(n,e),e.fatal?t.abort():t.dirty()},get path(){return n.path}};if(i.addIssue=i.addIssue.bind(i),"refinement"===r.type){const e=e=>{const t=r.refinement(e,i);if(n.common.async)return Promise.resolve(t);if(t instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return e};if(!1===n.common.async){const r=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});return"aborted"===r.status?Zn:("dirty"===r.status&&t.dirty(),e(r.value),{status:t.value,value:r.value})}return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then((n=>"aborted"===n.status?Zn:("dirty"===n.status&&t.dirty(),e(n.value).then((()=>({status:t.value,value:n.value}))))))}if("transform"===r.type){if(!1===n.common.async){const e=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(!Hn(e))return e;const o=r.transform(e.value,i);if(o instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:t.value,value:o}}return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then((e=>Hn(e)?Promise.resolve(r.transform(e.value,i)).then((e=>({status:t.value,value:e}))):e))}Sn.assertNever(r)}}Ur.create=(e,t,n)=>new Ur({schema:e,typeName:Vr.ZodEffects,effect:t,...Qn(n)}),Ur.createWithPreprocess=(e,t,n)=>new Ur({schema:t,effect:{type:"preprocess",transform:e},typeName:Vr.ZodEffects,...Qn(n)});class Dr extends $n{_parse(e){return this._getType(e)===Cn.undefined?Wn(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}Dr.create=(e,t)=>new Dr({innerType:e,typeName:Vr.ZodOptional,...Qn(t)});class jr extends $n{_parse(e){return this._getType(e)===Cn.null?Wn(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}jr.create=(e,t)=>new jr({innerType:e,typeName:Vr.ZodNullable,...Qn(t)});class Lr extends $n{_parse(e){const{ctx:t}=this._processInputParams(e);let n=t.data;return t.parsedType===Cn.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:t.path,parent:t})}removeDefault(){return this._def.innerType}}Lr.create=(e,t)=>new Lr({innerType:e,typeName:Vr.ZodDefault,defaultValue:"function"==typeof t.default?t.default:()=>t.default,...Qn(t)});class Br extends $n{_parse(e){const{ctx:t}=this._processInputParams(e),n=this._def.innerType._parse({data:t.data,path:t.path,parent:{...t,common:{...t.common,issues:[]}}});return Vn(n)?n.then((e=>({status:"valid",value:"valid"===e.status?e.value:this._def.catchValue()}))):{status:"valid",value:"valid"===n.status?n.value:this._def.catchValue()}}removeCatch(){return this._def.innerType}}Br.create=(e,t)=>new Br({innerType:e,typeName:Vr.ZodCatch,catchValue:"function"==typeof t.catch?t.catch:()=>t.catch,...Qn(t)});class Zr extends $n{_parse(e){if(this._getType(e)!==Cn.nan){const t=this._getOrReturnCtx(e);return Ln(t,{code:Mn.invalid_type,expected:Cn.nan,received:t.parsedType}),Zn}return{status:"valid",value:e.data}}}Zr.create=e=>new Zr({typeName:Vr.ZodNaN,...Qn(e)});const zr=Symbol("zod_brand");class Wr extends $n{_parse(e){const{ctx:t}=this._processInputParams(e),n=t.data;return this._def.type._parse({data:n,path:t.path,parent:t})}unwrap(){return this._def.type}}class Fr extends $n{_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.common.async){return(async()=>{const e=await this._def.in._parseAsync({data:n.data,path:n.path,parent:n});return"aborted"===e.status?Zn:"dirty"===e.status?(t.dirty(),zn(e.value)):this._def.out._parseAsync({data:e.value,path:n.path,parent:n})})()}{const e=this._def.in._parseSync({data:n.data,path:n.path,parent:n});return"aborted"===e.status?Zn:"dirty"===e.status?(t.dirty(),{status:"dirty",value:e.value}):this._def.out._parseSync({data:e.value,path:n.path,parent:n})}}static create(e,t){return new Fr({in:e,out:t,typeName:Vr.ZodPipeline})}}const Gr=(e,t={},n)=>e?dr.create().superRefine(((r,i)=>{if(!e(r)){const e="function"==typeof t?t(r):t,o="string"==typeof e?{message:e}:e;i.addIssue({code:"custom",...o,fatal:n})}})):dr.create(),Hr={object:gr.lazycreate};var Vr;!function(e){e.ZodString="ZodString",e.ZodNumber="ZodNumber",e.ZodNaN="ZodNaN",e.ZodBigInt="ZodBigInt",e.ZodBoolean="ZodBoolean",e.ZodDate="ZodDate",e.ZodSymbol="ZodSymbol",e.ZodUndefined="ZodUndefined",e.ZodNull="ZodNull",e.ZodAny="ZodAny",e.ZodUnknown="ZodUnknown",e.ZodNever="ZodNever",e.ZodVoid="ZodVoid",e.ZodArray="ZodArray",e.ZodObject="ZodObject",e.ZodUnion="ZodUnion",e.ZodDiscriminatedUnion="ZodDiscriminatedUnion",e.ZodIntersection="ZodIntersection",e.ZodTuple="ZodTuple",e.ZodRecord="ZodRecord",e.ZodMap="ZodMap",e.ZodSet="ZodSet",e.ZodFunction="ZodFunction",e.ZodLazy="ZodLazy",e.ZodLiteral="ZodLiteral",e.ZodEnum="ZodEnum",e.ZodEffects="ZodEffects",e.ZodNativeEnum="ZodNativeEnum",e.ZodOptional="ZodOptional",e.ZodNullable="ZodNullable",e.ZodDefault="ZodDefault",e.ZodCatch="ZodCatch",e.ZodPromise="ZodPromise",e.ZodBranded="ZodBranded",e.ZodPipeline="ZodPipeline"}(Vr||(Vr={}));const Kr=nr.create,Jr=ir.create,qr=Zr.create,Qr=or.create,$r=ar.create,Yr=sr.create,Xr=ur.create,ei=cr.create,ti=lr.create,ni=dr.create,ri=pr.create,ii=fr.create,oi=hr.create,ai=mr.create,si=gr.create,ui=gr.strictCreate,ci=_r.create,li=br.create,di=Er.create,pi=Pr.create,fi=Sr.create,hi=Or.create,mi=Ar.create,vi=Ir.create,yi=kr.create,gi=Cr.create,_i=Mr.create,wi=Rr.create,bi=xr.create,Ti=Ur.create,Ei=Dr.create,Pi=jr.create,Si=Ur.createWithPreprocess,Oi=Fr.create,Ai={string:e=>nr.create({...e,coerce:!0}),number:e=>ir.create({...e,coerce:!0}),boolean:e=>ar.create({...e,coerce:!0}),bigint:e=>or.create({...e,coerce:!0}),date:e=>sr.create({...e,coerce:!0})},Ii=Zn;var ki=Object.freeze({__proto__:null,defaultErrorMap:xn,setErrorMap:function(e){Un=e},getErrorMap:Dn,makeIssue:jn,EMPTY_PATH:[],addIssueToContext:Ln,ParseStatus:Bn,INVALID:Zn,DIRTY:zn,OK:Wn,isAborted:Fn,isDirty:Gn,isValid:Hn,isAsync:Vn,get util(){return Sn},ZodParsedType:Cn,getParsedType:Nn,ZodType:$n,ZodString:nr,ZodNumber:ir,ZodBigInt:or,ZodBoolean:ar,ZodDate:sr,ZodSymbol:ur,ZodUndefined:cr,ZodNull:lr,ZodAny:dr,ZodUnknown:pr,ZodNever:fr,ZodVoid:hr,ZodArray:mr,get objectUtil(){return vr},ZodObject:gr,ZodUnion:_r,ZodDiscriminatedUnion:br,ZodIntersection:Er,ZodTuple:Pr,ZodRecord:Sr,ZodMap:Or,ZodSet:Ar,ZodFunction:Ir,ZodLazy:kr,ZodLiteral:Cr,ZodEnum:Mr,ZodNativeEnum:Rr,ZodPromise:xr,ZodEffects:Ur,ZodTransformer:Ur,ZodOptional:Dr,ZodNullable:jr,ZodDefault:Lr,ZodCatch:Br,ZodNaN:Zr,BRAND:zr,ZodBranded:Wr,ZodPipeline:Fr,custom:Gr,Schema:$n,ZodSchema:$n,late:Hr,get ZodFirstPartyTypeKind(){return Vr},coerce:Ai,any:ni,array:ai,bigint:Qr,boolean:$r,date:Yr,discriminatedUnion:li,effect:Ti,enum:_i,function:vi,instanceof:(e,t={message:`Input not instance of ${e.name}`})=>Gr((t=>t instanceof e),t,!0),intersection:di,lazy:yi,literal:gi,map:hi,nan:qr,nativeEnum:wi,never:ii,null:ti,nullable:Pi,number:Jr,object:si,oboolean:()=>$r().optional(),onumber:()=>Jr().optional(),optional:Ei,ostring:()=>Kr().optional(),pipeline:Oi,preprocess:Si,promise:bi,record:fi,set:mi,strictObject:ui,string:Kr,symbol:Xr,transformer:Ti,tuple:pi,undefined:ei,union:ci,unknown:ri,void:oi,NEVER:Ii,ZodIssueCode:Mn,quotelessJson:e=>JSON.stringify(e,null,2).replace(/"([^"]+)":/g,"$1:"),ZodError:Rn}),Ci=function(){function e(){var t,n,r,o,s,u,c,l,d,p,f,h,m,v,y,g,_,w,b,T,E,P,S,O,A,I,k;gt(this,e),this.initConfig=window.APP_CONFIG;var C=yt.isString(null===(t=this.initConfig)||void 0===t||null===(n=t.app)||void 0===n?void 0:n.headerColor)&&(null===(r=this.initConfig)||void 0===r||null===(o=r.app)||void 0===o||null===(s=o.headerColor)||void 0===s?void 0:s.length)>0?pe:fe;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)?de.HIDE_BACK:de.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)?de.SHOW_HOME:de.HIDE_HOME,U=new URL(location.href),D=hn(null===(w=this.initConfig)||void 0===w||null===(b=w.app)||void 0===b?void 0:b.statusBar);"boolean"==typeof(null===(T=this.initConfig)||void 0===T||null===(E=T.app)||void 0===E?void 0:E.actionBarHidden)&&(C=(null===(N=this.initConfig)||void 0===N||null===(M=N.app)||void 0===M?void 0:M.actionBarHidden)?fe:pe);this.config={actionbarType:C,buttonType:R,statusbarType:D,dataConfig:{backgroundColor:(null===(P=this.initConfig)||void 0===P||null===(S=P.app)||void 0===S?void 0:S.headerColor)||he,textColor:(null===(O=this.initConfig)||void 0===O||null===(A=O.app)||void 0===A?void 0:A.textColor)||"",textAlign:(null===(I=this.initConfig)||void 0===I||null===(k=I.app)||void 0===k?void 0:k.textAlign)||me,viewInLeftType:R,confirmToExit:1},homeConfig:{enable:x,url:"".concat(a,"/").concat(i,"/").concat(U.search)}}}var t=e.prototype;return t.setNavigationBarTitle=function(e){return ge((function(){return Ee(this,(function(t){return[2,new Promise((function(t,n){nn("CHANGE_TITLE_HEADER",{title:e},{success:function(){t(),document.title=e},fail:function(e){n(e)}},{timeout:!1})}))]}))}))()},t.setNavigationBarLeftButton=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.config.dataConfig.confirmToExit,n=this;return ge((function(){var r,i;return Ee(this,(function(o){return void 0===(void 0===e?"undefined":lt(e))&&null===(void 0===e?"undefined":lt(e))||(r="none"===e||"home"===e?de.HIDE_BACK:de.SHOW_BACK,i="home"===e||"both"===e?de.SHOW_HOME:de.HIDE_HOME,n.config.buttonType=r,n.config.dataConfig.viewInLeftType=r,n.config.homeConfig.enable=i),n.config.dataConfig.confirmToExit=t,[2,new Promise((function(e,t){nn("CHANGE_ACTIONBAR_LEFTBUTTON_TYPE",xe({},n.config),{success:function(){e()},fail:function(e){t(e)}},{timeout:!1})}))]}))}))()},t.setAndroidBottomNavigationBar=function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=this;return ge((function(){var n,r,i;return Ee(this,(function(o){return r=e?S.hide:S.show,i=null===(n=ke())||void 0===n?void 0:n.platform,[2,new Promise((function(n,o){if(!(null==i?void 0:i.isAndroid))return n();nn("CHANGE_BOTTOMBAR",{bottombarType:r},{success:function(){t.hideAndroidBottomNavigationBar=!!e,window.ANDROID_BOTTOM_NAVIGATION_BAR_HIDDEN=!!e,n()},fail:function(e){o(e)}},{timeout:!1})}))]}))}))()},t.setIOSBottomSafeArea=function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=this;return ge((function(){var n,r,i;return Ee(this,(function(o){return r=e?O.hide:O.show,i=null===(n=ke())||void 0===n?void 0:n.platform,[2,new Promise((function(n,o){if(!(null==i?void 0:i.isIOS))return n();nn("CHANGE_BOTTOMBAR",{bottombarType:r},{success:function(){t.hideIOSSafeAreaBottom=!!e,window.IOS_BOTTOM_SAFE_AREA_HIDDEN=!!e,n()},fail:function(e){o(e)}},{timeout:!1,delay:200})}))]}))}))()},t.configHeader=function(e){var t=this;return ge((function(){var n;return Ee(this,(function(r){return n=t.config,yt.isString(e.headerColor)&&(n.dataConfig.backgroundColor=e.headerColor),yt.isString(e.headerTextColor)&&(n.dataConfig.textColor=e.headerTextColor),yt.isString(e.textAlign)&&("left"===e.textAlign?n.dataConfig.textAlign=A.left:"center"===e.textAlign&&(n.dataConfig.textAlign=A.center)),!0===e.hideActionBar?n.actionbarType=fe:!1===e.hideActionBar&&(n.actionbarType=pe),"normal"===e.statusBarType?n.statusbarType=P.normal:"hidden"===e.statusBarType?n.statusbarType=P.hidden:"transparent"===e.statusBarType&&(n.statusbarType=P.transparent),[2,new Promise((function(r,i){nn("CHANGE_ACTIONBAR",xe({},n),{success:function(){var i;t.config=xe({},n);var o,a=null===(i=ke())||void 0===i?void 0:i.platform;window.STATUS_BAR_TYPE=(o=t.config.statusbarType)===P.hidden?"hidden":o===P.transparent?"transparent":"normal",window.ACTION_BAR_HIDDEN=t.config.actionbarType===fe;var s=null===document||void 0===document?void 0:document.querySelector(":root");if(null==a?void 0:a.isAndroid){var u=0;if(("hidden"===e.statusBarType||"transparent"===e.statusBarType)&&e.hideActionBar){var c=window.ANDROID_STATUS_BAR_HEIGHT;isNaN(c)&&(c=Math.round(ZaloJavaScriptInterface.getStatusBarHeight()/window.devicePixelRatio)),u=c}u?null==s||s.style.setProperty("--zaui-safe-area-inset-top","".concat(u,"px")):null==s||s.style.setProperty("--zaui-safe-area-inset-top","env(safe-area-inset-top, 0px)")}r()},fail:function(e){i(e)}},{timeout:!1})}))]}))}))()},e.getInstance=function(){return e.instance||(e.instance=new e),e.instance},e}(),Ni=Ci.getInstance(),Mi=[si({title:Kr()}).optional()];function Ri(e){return xi.apply(this,arguments)}function xi(){return xi=ge((function(e){return Ee(this,(function(t){return[2,wn("setNavigationBarTitle",Mi,[e],function(){var e=ge((function(e){return Ee(this,(function(t){switch(t.label){case 0:return Ce.isMp?[4,Ni.setNavigationBarTitle(e.title)]:[3,2];case 1:return[2,t.sent()];case 2:return Ce.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Me("setNavigationBarTitle",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),xi.apply(this,arguments)}var Ui=[si({color:Kr(),textColor:ki.enum(["black","white"]).optional(),statusBarColor:Kr().optional()}).optional()];function Di(e){return ji.apply(this,arguments)}function ji(){return ji=ge((function(e){return Ee(this,(function(t){return[2,wn("setNavigationBarColor",Ui,[e],function(){var e=ge((function(e){return Ee(this,(function(t){switch(t.label){case 0:return Ce.isMp?[4,Ni.configHeader({hideActionBar:!(e.color.length>0),headerTextColor:e.textColor,headerColor:e.color.length>0?e.color:e.statusBarColor})]:[3,2];case 1:return[2,t.sent()];case 2:return Ce.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Me("setNavigationBarColor",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),ji.apply(this,arguments)}var Li=[si({type:ki.enum(["none","back","home","both"])}).optional()];function Bi(e){return Zi.apply(this,arguments)}function Zi(){return Zi=ge((function(e){return Ee(this,(function(t){return[2,wn("setNavigationBarLeftButton",Li,[e],function(){var e=ge((function(e){return Ee(this,(function(t){switch(t.label){case 0:return Ce.isMp?[4,Ni.setNavigationBarLeftButton(e.type)]:[3,2];case 1:return[2,t.sent()];case 2:return Ce.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Me("setNavigationBarLeftButton",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Zi.apply(this,arguments)}function zi(e,t,n){if(!t.has(e))throw new TypeError("attempted to "+n+" private field on non-instance");return t.get(e)}function Wi(e,t){return function(e,t){return t.get?t.get.call(e):t.value}(e,zi(e,t,"get"))}function Fi(e,t,n){!function(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}(e,t),t.set(e,n)}function Gi(e,t,n){return function(e,t,n){if(t.set)t.set.call(e,n);else{if(!t.writable)throw new TypeError("attempted to set read only private field");t.value=n}}(e,zi(e,t,"set"),n),n}var Hi,Vi,Ki,Ji=new WeakMap,qi=new WeakMap,Qi=new WeakMap,$i=function(){function e(t){gt(this,e),Fi(this,Ji,{writable:!0,value:localStorage}),Fi(this,qi,{writable:!0,value:void 0}),Fi(this,Qi,{writable:!0,value:void 0}),Gi(this,Qi,{keys:new Set,currentSize:0,limitSize:ie}),Gi(this,qi,t),this.findAllCurrentDataByApp(t)}var t=e.prototype;return t.findAllCurrentDataByApp=function(e){try{var t;for(t in Wi(this,Ji)){if(e)if(t.split("_")[0]!==e)continue;Wi(this,Qi).keys.add(t)}}catch(e){}},t.get=function(e){var t=this,n=new Map;return e.forEach((function(e){n.set(e,t.getSync(e))})),Promise.resolve(n)},t.getSync=function(e){return Wi(this,qi)&&(e="".concat(Wi(this,qi),"_").concat(e)),Wi(this,Qi).keys.has(e)?Wi(this,Ji).getItem(e):null},t.set=function(e){var t=this;return ge((function(){return Ee(this,(function(n){return Object.entries(e).forEach((function(e){var n=Ue(e,2),r=n[0],i=n[1];t.setSync(r,i.replace(/\\"/g,'"'))})),[2,Promise.resolve({errorKeys:[]})]}))}))()},t.setSync=function(e,t){Wi(this,qi)&&(e="".concat(Wi(this,qi),"_").concat(e)),Wi(this,Ji).setItem(e,t),Wi(this,Qi).keys.add(e)},t.getInfo=function(){var e=this;return ge((function(){return Ee(this,(function(t){return[2,Promise.resolve(e.getInfoSync())]}))}))()},t.getInfoSync=function(){var e=function(e,t){var n,r=0;for(n in e){var i=n.split("_")[0];e.hasOwnProperty(n)&&(t&&i!==t||(r+=2*(e[n].length+n.length)))}return r}(Wi(this,Ji),Wi(this,qi));return{currentSize:yt.isNumber(e)?Number((e/1024).toFixed(2)):0,limitSize:Number((ie/1024).toFixed(2))}},t.remove=function(e){var t=this;return ge((function(){return Ee(this,(function(n){return e.forEach((function(e){t.removeSync(e)})),[2,Promise.resolve({errorKeys:[]})]}))}))()},t.removeSync=function(e){Wi(this,qi)&&(e="".concat(Wi(this,qi),"_").concat(e)),Wi(this,Qi).keys.has(e)&&(Wi(this,Ji).removeItem(e),Wi(this,Qi).keys.delete(e))},t.clear=function(){var e=this;return ge((function(){return Ee(this,(function(t){return[2,Promise.resolve(e.clearSync())]}))}))()},t.clearSync=function(){var e=this;Wi(this,Qi).keys.forEach((function(t){Wi(e,qi)&&t.indexOf(Wi(e,qi))<0||(Wi(e,Ji).removeItem(t),Wi(e,Qi).keys.delete(t))}))},e}(),Yi=new WeakMap,Xi=new WeakMap,eo=function(){function e(t){gt(this,e),Fi(this,Yi,{writable:!0,value:void 0}),Fi(this,Xi,{writable:!0,value:void 0}),Gi(this,Xi,{keys:new Set,currentSize:0,limitSize:ie}),Gi(this,Yi,t)}var t=e.prototype;return t.get=function(e){var t=this;return ge((function(){return Ee(this,(function(n){return[2,new Promise((function(n,r){nn("ZBROWSER_MPDS",{mpds_action:"mpds.get",mpds_data:{keys:e},appId:Wi(t,Yi)},{success:function(e){var t=new Map;e&&e.mpds_data&&e.mpds_data.map&&(t=new Map(Object.entries(e.mpds_data.map))),n(t)},fail:function(e){r(e)}},{isMultiCallback:!1})}))]}))}))()},t.set=function(e){var t=this;return ge((function(){return Ee(this,(function(n){return[2,new Promise((function(n,r){nn("ZBROWSER_MPDS",{mpds_action:"mpds.set",mpds_data:{map:e},appId:Wi(t,Yi)},{success:function(e){var t=[];e&&e.mpds_data&&e.mpds_data.error_keys&&(t=e.mpds_data.error_keys),n({errorKeys:t})},fail:function(e){r(e)}},{isMultiCallback:!1})}))]}))}))()},t.getInfo=function(){var e=this;return ge((function(){return Ee(this,(function(t){return[2,new Promise((function(t,n){nn("ZBROWSER_MPDS",{mpds_action:"mpds.get.size",mpds_data:{},appId:Wi(e,Yi)},{success:function(e){var n=0;e&&e.mpds_data&&e.mpds_data.size&&(n=e.mpds_data.size),t({currentSize:yt.isNumber(n)?Number(Number(n)/1024):0,limitSize:Number(ie/1024)})},fail:function(e){n(e)}},{isMultiCallback:!1})}))]}))}))()},t.remove=function(e){var t=this;return ge((function(){return Ee(this,(function(n){return[2,new Promise((function(n,r){nn("ZBROWSER_MPDS",{mpds_action:"mpds.remove.key",mpds_data:{keys:e},appId:Wi(t,Yi)},{success:function(e){var t=[];e&&e.mpds_data&&e.mpds_data.error_keys&&(t=e.mpds_data.error_keys),n({errorKeys:t})},fail:function(e){r(e)}},{isMultiCallback:!1})}))]}))}))()},t.clear=function(){var e=this;return ge((function(){return Ee(this,(function(t){return[2,new Promise((function(t,n){nn("ZBROWSER_MPDS",{mpds_action:"mpds.clear.appData",mpds_data:{},appId:Wi(e,Yi)},{success:function(){t()},fail:function(e){n(e)}},{isMultiCallback:!1})}))]}))}))()},e}(),to=function(){function e(){gt(this,e)}var t=e.prototype;return t.getDataFromStorage=function(e){var t=this;return ge((function(){var n,r;return Ee(this,(function(i){switch(i.label){case 0:return[4,t.getInstance().get(e)];case 1:return n=i.sent(),r={},n.forEach((function(e,t){r[t]=ln(e)})),[2,r]}}))}))()},t.putDataToStorage=function(e){var t=this;return ge((function(){var n,r;return Ee(this,(function(i){switch(i.label){case 0:return n=t.getInstance(),r={},Object.entries(e).forEach((function(e){var t=Ue(e,2),n=t[0],i=t[1];yt.isUndefined(i)||yt.isNull(i)||(r[n]=fn(i))})),[4,n.set(r)];case 1:return[2,i.sent()]}}))}))()},t.removeDataFromStorage=function(e){var t=this;return ge((function(){return Ee(this,(function(n){switch(n.label){case 0:return[4,t.getInstance().remove(e)];case 1:return[2,n.sent()]}}))}))()},t.clearStorage=function(){var e=this;return ge((function(){return Ee(this,(function(t){switch(t.label){case 0:return[4,e.getInstance().clear()];case 1:return t.sent(),[2]}}))}))()},t.getStorageInfo=function(){var e=this;return ge((function(){return Ee(this,(function(t){switch(t.label){case 0:return[4,e.getInstance().getInfo()];case 1:return[2,t.sent()]}}))}))()},e}(),no=new WeakMap,ro=function(e){St(n,e);var t=At(n);function n(e){var r;return gt(this,n),Fi(Ot(r=t.call(this)),no,{writable:!0,value:void 0}),Gi(Ot(r),no,e),r}return n.prototype.getInstance=function(){return new $i(Wi(this,no))},n}(to),io=new WeakMap,oo=function(e){St(n,e);var t=At(n);function n(e){var r;return gt(this,n),Fi(Ot(r=t.call(this)),io,{writable:!0,value:void 0}),Gi(Ot(r),io,e),r}return n.prototype.getInstance=function(){return new eo(Wi(this,io))},n}(to),ao=new ro(i),so=(null===(Hi=ke())||void 0===Hi?void 0:Hi.zaloVersion)||"",uo=(null===(Vi=ke())||void 0===Vi?void 0:Vi.platformName)||"unknown";!!yt.isString(so)&&parseInt(so,10)>={android:12100571,iOS:400,wp:0,unknown:0}[uo]&&(null===(Ki=ke())||void 0===Ki?void 0:Ki.appEnv.isMp)&&(ao=new oo(i));var co=ao,lo=[si({data:ki.record(Kr(),ki.any())}).optional()];function po(e){return fo.apply(this,arguments)}function fo(){return fo=ge((function(e){return Ee(this,(function(t){return[2,wn("setStorage",lo,[e],function(){var e=ge((function(e){return Ee(this,(function(t){switch(t.label){case 0:return Ce.isMp||Ce.isMpWeb?[4,co.putDataToStorage(e.data)]:[3,2];case 1:return[2,t.sent()];case 2:return[2,Promise.reject(Me("setStorage",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),fo.apply(this,arguments)}var ho=[si({keys:ki.array(Kr())}).optional()];function mo(e){return vo.apply(this,arguments)}function vo(){return vo=ge((function(e){return Ee(this,(function(t){return[2,wn("getStorage",ho,[e],function(){var e=ge((function(e){return Ee(this,(function(t){switch(t.label){case 0:return Ce.isMp||Ce.isMpWeb?[4,co.getDataFromStorage(e.keys)]:[3,2];case 1:return[2,t.sent()];case 2:return[2,Promise.reject(Me("getStorage",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),vo.apply(this,arguments)}function yo(e){return go.apply(this,arguments)}function go(){return(go=ge((function(e){return Ee(this,(function(t){return[2,wn("getStorageInfo",[],[e],ge((function(){return Ee(this,(function(e){switch(e.label){case 0:return Ce.isMp||Ce.isMpWeb?[4,co.getStorageInfo()]:[3,2];case 1:return[2,e.sent()];case 2:return[2,Promise.reject(Me("getStorageInfo",{}))]}}))})))]}))}))).apply(this,arguments)}var _o=[si({keys:ki.array(Kr())}).optional()];function wo(e){return bo.apply(this,arguments)}function bo(){return bo=ge((function(e){return Ee(this,(function(t){return[2,wn("removeStorage",_o,[e],function(){var e=ge((function(e){return Ee(this,(function(t){switch(t.label){case 0:return Ce.isMp||Ce.isMpWeb?[4,co.removeDataFromStorage(e.keys)]:[3,2];case 1:return[2,t.sent()];case 2:return[2,Promise.reject(Me("removeStorage",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),bo.apply(this,arguments)}var To=[si({prefix:Kr().optional()}).optional()];function Eo(e){return Po.apply(this,arguments)}function Po(){return(Po=ge((function(e){return Ee(this,(function(t){return[2,wn("clearStorage",To,[e],ge((function(){return Ee(this,(function(e){switch(e.label){case 0:return Ce.isMp||Ce.isMpWeb?[4,co.clearStorage()]:[3,2];case 1:return[2,e.sent()];case 2:return[2,Promise.reject(Me("clearStorage",{}))]}}))})))]}))}))).apply(this,arguments)}var So=function(){var e=ge((function(e,t){var n,r,o,a;return Ee(this,(function(s){switch(s.label){case 0:return(r=t)?[3,2]:[4,yn()];case 1:r=!s.sent(),s.label=2;case 2:return n=r,[4,an.getAccessToken(n)];case 3:return o=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(l.GET_USER_INFO,"?fields=").concat(a,"&miniapp_id=").concat(i),{headers:{access_token:o||""}}).then(function(){var e=ge((function(e){var t,n,r,i;return Ee(this,(function(o){switch(o.label){case 0:return[4,e.json()];case 1:return r=o.sent(),i=null==r?void 0:r.user_id_by_oa,[2,{id:null==r?void 0:r.id,name:(null==r?void 0:r.name)||"",avatar:(null==r||null===(t=r.picture)||void 0===t||null===(n=t.data)||void 0===n?void 0:n.url)||"",idByOA:i,followedOA:!!(null==r?void 0:r.is_follower),isSensitive:null==r?void 0:r.is_sensitive}]}}))}));return function(t){return e.apply(this,arguments)}}())];case 4:return[2,s.sent()]}}))}));return function(t,n){return e.apply(this,arguments)}}(),Oo=[si({avatarType:ki.enum(["small","normal","large"]).optional(),autoRequestPermission:ki.boolean().default(!1).optional()}).optional()];function Ao(e){return Io.apply(this,arguments)}function Io(){return Io=ge((function(e){return Ee(this,(function(t){return[2,wn("getUserInfo",Oo,[e],function(){var e=ge((function(e){var t,n;return Ee(this,(function(r){switch(r.label){case 0:return Ce.isMp?(t=null==e?void 0:e.avatarType,n=null==e?void 0:e.autoRequestPermission,[4,So(t,n)]):[3,2];case 1:return[2,{userInfo:r.sent()}];case 2:return Ce.isMpWeb?[2,Promise.resolve({userInfo:{id:"3368637342326461234",name:"User Name",avatar:"https://h5.zdn.vn/static/images/avatar.png"}})]:[2,Promise.reject(Me("getUserInfo",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Io.apply(this,arguments)}var ko=function(e){return{NONE:e?-2:0,WIFI:e?0:1,"2G":2,"3G":e?15:2,"4G":e?13:2}},Co=ge((function(){return Ee(this,(function(e){return[2,new Promise((function(e,t){nn("WEBVIEW_NETWORKTYPE",{url:window.location.href,featureId:""},{success:function(t){var n,r,i,o=t.network,a=(null===(n=ke())||void 0===n||null===(r=n.platform)||void 0===r?void 0:r.isAndroid)||!1;switch(o){case ko(a).NONE:i=d.none;break;case ko(a).WIFI:i=d.wifi;break;case ko(a)["2G"]:case ko(a)["3G"]:case ko(a)["4G"]:i=d.cellular;break;default:i=d.unknown}e(i)},fail:function(e){t(e)}},{})}))]}))}));function No(e){return Mo.apply(this,arguments)}function Mo(){return(Mo=ge((function(e){return Ee(this,(function(t){return[2,wn("getNetworkType",[],[e],ge((function(){var e,t;return Ee(this,(function(n){switch(n.label){case 0:return Ce.isMp?[4,Co()]:[3,2];case 1:return[2,{networkType:n.sent()}];case 2:if(Ce.isMpWeb){switch(e=navigator.connection||navigator.mozConnection||navigator.webkitConnection,e.effectiveType){case"none":t=d.none;break;case"4g":t=d.wifi;break;case"3g":case"2g":t=d.cellular;break;default:t=d.unknown}return[2,Promise.resolve({networkType:t})]}return[2,Promise.reject(Me("getNetworkType",{}))]}}))})))]}))}))).apply(this,arguments)}var Ro=[ki.function().args(si({isConnected:ki.boolean(),networkType:ki.enum(["none","wifi","cellular","unknown"])})).returns(ki.void())];function xo(e){return wn("onNetworkStatusChange",Ro,[e],(function(e){var t=e;if(Ce.isMp)!function(e){Mt.getInstance().on(f.NetworkChanged,(function(t){var n=null==t?void 0:t.state;Co().then((function(t){e({isConnected:"CONNECTED"===n,networkType:t})}))}))}(t);else if(Ce.isMpWeb){var n=navigator.connection||navigator.mozConnection||navigator.webkitConnection,r=n.effectiveType;n.addEventListener("change",(function(){var e;switch(r){case"none":e=d.none;break;case"4g":e=d.wifi;break;case"3g":case"2g":e=d.cellular;break;default:e=d.unknown}t({isConnected:!0,networkType:e})}))}}))}var Uo=function(){var e=ge((function(e){var t,n,r,i,o,a;return Ee(this,(function(s){return a={subaction:0,scanning_type:yt.isNumber(null==e?void 0:e.scanningType)?e.scanningType:0,data:{scan_from_source:yt.isString(null==e?void 0:e.scanFromSource)?e.scanFromSource:"",expire:yt.isNumber(null==e?void 0:e.expire)?e.expire:3e3,monitor_interval:yt.isNumber(null==e?void 0:e.monitorInterval)?e.monitorInterval:60,domain:yt.isString(null==e?void 0:e.domain)?e.domain:"",scan_config:{scan_time:yt.isNumber(null==e||null===(t=e.scanConfig)||void 0===t?void 0:t.scanTime)?e.scanConfig.scanTime:15e3,time_between_scan:yt.isNumber(null==e||null===(n=e.scanConfig)||void 0===n?void 0:n.timeBetweenScan)?e.scanConfig.timeBetweenScan:1e4,beacon_timeout:yt.isNumber(null==e||null===(r=e.scanConfig)||void 0===r?void 0:r.beaconTimeout)?e.scanConfig.beaconTimeout:3e4,delayCheckConnectedTimeout:yt.isNumber(null==e||null===(i=e.scanConfig)||void 0===i?void 0:i.delayCheckConnectedTimeout)?e.scanConfig.delayCheckConnectedTimeout:5e3,beaconConnectedTimeout:yt.isNumber(null==e||null===(o=e.scanConfig)||void 0===o?void 0:o.beaconConnectedTimeout)?e.scanConfig.beaconConnectedTimeout:6e5},items:Array.isArray(null==e?void 0:e.items)?null==e?void 0:e.items:[]}},[2,new Promise((function(e,t){nn("SCAN_IBEACON",xe({},a),{success:function(){e(!0)},fail:function(e){t(e)}},{})}))]}))}));return function(t){return e.apply(this,arguments)}}(),Do=[si({scanningType:ki.number().refine((function(e){return[0,1].includes(e)}),{message:"The type must be either 0 or 1"}).default(0).optional(),expire:ki.number().optional(),monitorInterval:ki.number().optional(),domain:ki.string().optional(),scanConfig:si({scanTime:ki.number().optional(),timeBetweenScan:ki.number().optional(),beaconTimeout:ki.number().optional(),delayCheckConnectedTimeout:ki.number().optional(),beaconConnectedTimeout:ki.number().optional()}).optional(),items:ki.array(si({id:ki.string().optional(),distance:ki.number().optional(),monitor:si({enable:ki.boolean().optional(),movingRange:ki.number().optional()}).optional()})).optional(),scanFromSource:ki.string().optional()}).optional()];function jo(e){return Lo.apply(this,arguments)}function Lo(){return(Lo=ge((function(e){return Ee(this,(function(t){return[2,wn("startBeaconDiscovery",Do,[e],ge((function(){return Ee(this,(function(t){switch(t.label){case 0:return Ce.isMp?[4,Uo(e)]:[3,2];case 1:return[2,t.sent()];case 2:return Ce.isMpWeb?[2,Promise.resolve(!0)]:[2,Promise.reject(Me("startBeaconDiscovery",{}))]}}))})))]}))}))).apply(this,arguments)}var Bo=ge((function(){return Ee(this,(function(e){return[2,new Promise((function(e,t){nn("SCAN_IBEACON",{subaction:2},{success:function(){e(!0)},fail:function(e){t(e)}},{})}))]}))}));function Zo(e){return zo.apply(this,arguments)}function zo(){return(zo=ge((function(e){return Ee(this,(function(t){return[2,wn("stopBeaconDiscovery",[],[e],ge((function(){return Ee(this,(function(e){switch(e.label){case 0:return Ce.isMp?[4,Bo()]:[3,2];case 1:return[2,e.sent()];case 2:return Ce.isMpWeb?[2,Promise.resolve(!0)]:[2,Promise.reject(Me("stopBeaconDiscovery",{}))]}}))})))]}))}))).apply(this,arguments)}var Wo=ge((function(){return Ee(this,(function(e){return[2,new Promise((function(e,t){nn("SCAN_IBEACON",{subaction:1},{success:function(t){var n={beacons:[]};Array.isArray(t)&&t.forEach((function(e){var t={uuid:e.uuid,major:e.major,minor:e.minor,distance:e.distance,rssi:e.rssi};n.beacons.push(t)})),e(n)},fail:function(e){t(e)}},{isMultiCallback:!0})}))]}))}));function Fo(e){return Go.apply(this,arguments)}function Go(){return(Go=ge((function(e){return Ee(this,(function(t){return[2,wn("getBeacons",[],[e],ge((function(){return Ee(this,(function(e){switch(e.label){case 0:return Ce.isMp?[4,Wo()]:[3,2];case 1:return[2,e.sent()];case 2:return Ce.isMpWeb?[2,Promise.resolve({beacons:[]})]:[2,Promise.reject(Me("getBeacons",{}))]}}))})))]}))}))).apply(this,arguments)}var Ho=ge((function(){return Ee(this,(function(e){return[2,new Promise((function(e,t){nn("WINDOW_CLOSE",{},{success:function(t){e(t)},fail:function(e){t(e)}},{})}))]}))}));function Vo(e){return Ko.apply(this,arguments)}function Ko(){return(Ko=ge((function(e){return Ee(this,(function(t){return[2,wn("closeApp",[],[e],ge((function(){return Ee(this,(function(e){switch(e.label){case 0:return Ce.isMp?[4,Ho()]:[3,2];case 1:return[2,e.sent()];case 2:return Ce.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Me("closeApp",{}))]}}))})))]}))}))).apply(this,arguments)}var Jo=ge((function(){return Ee(this,(function(e){return[2,new Promise((function(e,t){nn("OPEN_QR",{skipOpenLink:!0},{success:function(t){e(t)},fail:function(e){t(e)}},{})}))]}))}));function qo(e){return Qo.apply(this,arguments)}function Qo(){return(Qo=ge((function(e){return Ee(this,(function(t){return[2,wn("scanQRCode",[],[e],ge((function(){return Ee(this,(function(e){switch(e.label){case 0:return Ce.isMp?[4,Jo()]:[3,2];case 1:return[2,e.sent()];case 2:return Ce.isMpWeb?[2,Promise.resolve({content:""})]:[2,Promise.reject(Me("scanQRCode",{}))]}}))})))]}))}))).apply(this,arguments)}var $o=function(){var e=ge((function(e,t,n,i){return Ee(this,(function(o){return[2,new Promise((function(o,a){nn("OPEN_PROFILE",{uId:e,type:m[t],zapp:r,sourceId:n,sourceIndex:i},{success:function(){o()},fail:function(e){a(e)}},{})}))]}))}));return function(t,n,r,i){return e.apply(this,arguments)}}(),Yo=[si({id:Kr(),type:ki.enum(["user","oa","aliasOA"]),sourceId:ki.any().optional(),sourceIndex:ki.any().optional()}).optional()];function Xo(e){return ea.apply(this,arguments)}function ea(){return ea=ge((function(e){return Ee(this,(function(t){return[2,wn("openProfile",Yo,[e],function(){var e=ge((function(e){var t,n,r,i;return Ee(this,(function(o){switch(o.label){case 0:return Ce.isMp?(t=e.id,n=e.type,r=e.sourceId,i=e.sourceIndex,[4,$o(t,n,r,i)]):[3,2];case 1:return[2,o.sent()];case 2:return Ce.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Me("openProfile",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),ea.apply(this,arguments)}var ta=function(){var e=ge((function(e,t){var n,i,o,a=arguments;return Ee(this,(function(s){return n=a.length>2&&void 0!==a[2]?a[2]:"",i=a.length>3?a[3]:void 0,o=a.length>4?a[4]:void 0,[2,new Promise((function(a,s){nn("OPEN_CHAT",{uId:e,type:v[t],msg:n,zapp:r,sourceId:i,sourceIndex:o},{success:function(){a()},fail:function(e){s(e)}},{})}))]}))}));return function(t,n){return e.apply(this,arguments)}}(),na=[si({id:Kr(),type:ki.enum(["user","oa"]),sourceId:ki.any().optional(),sourceIndex:ki.any().optional(),message:Kr().optional()}).optional()];function ra(e){return ia.apply(this,arguments)}function ia(){return ia=ge((function(e){return Ee(this,(function(t){return[2,wn("openChat",na,[e],function(){var e=ge((function(e){var t,n,r,i,o;return Ee(this,(function(a){switch(a.label){case 0:return Ce.isMp?(t=e.id,n=e.type,r=e.message,i=e.sourceId,o=e.sourceIndex,[4,ta(t,n,r,i,o)]):[3,2];case 1:return[2,a.sent()];case 2:return Ce.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Me("openChat",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),ia.apply(this,arguments)}function oa(e,t){return t=null!=t?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))})),e}var aa=function(){var e=ge((function(e,t){var n;return Ee(this,(function(i){switch(n={},e){case"image":n={photoUrl:null==t?void 0:t.imageUrl};break;case"link":n={link:null==t?void 0:t.link,title:null==t?void 0:t.title,thumb:null==t?void 0:t.thumb,description:null==t?void 0:t.description};break;case"profile":n={avt:null==t?void 0:t.avatar,uid:null==t?void 0:t.id,dpn:null==t?void 0:t.displayName}}return[2,new Promise((function(t,i){nn("OPEN_POSTFEED",oa(xe({type:y[e]},n),{zapp:r}),{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){i(e)}},{})}))]}))}));return function(t,n){return e.apply(this,arguments)}}(),sa=[ki.union([si({type:ki.enum(["image"]),data:si({imageUrl:Kr().url().optional()})}),si({type:ki.enum(["link"]),data:si({link:Kr().url(),title:Kr().max(100).optional(),thumb:Kr().url().optional(),description:Kr().max(400).default("").optional()})}),si({type:ki.enum(["profile"]),data:si({id:Kr().optional()})})])];function ua(e){return ca.apply(this,arguments)}function ca(){return ca=ge((function(e){return Ee(this,(function(t){return[2,wn("openPostFeed",sa,[e],function(){var e=ge((function(e){var t,n;return Ee(this,(function(r){switch(r.label){case 0:return Ce.isMp?(t=e.type,n=e.data,[4,aa(t,n)]):[3,2];case 1:return[2,r.sent()];case 2:return Ce.isMpWeb?[2,Promise.resolve({status:1,shareType:0,numberOfUser:0})]:[2,Promise.reject(Me("openPostFeed",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),ca.apply(this,arguments)}var la=function(){var e=ge((function(e){return Ee(this,(function(t){return[2,new Promise((function(t,n){nn("FOLLOW_OA",{uid:e,showDialogConfirm:!0,forceUpdate:!0,zapp:r},{success:function(e){t(e)},fail:function(e){n(e)}},{timeout:!1})}))]}))}));return function(t){return e.apply(this,arguments)}}(),da=[si({id:Kr(),showDialogConfirm:ki.boolean().optional()}).optional()];function pa(e){return fa.apply(this,arguments)}function fa(){return fa=ge((function(e){return Ee(this,(function(t){return[2,wn("followOA",da,[e],function(){var e=ge((function(e){var t;return Ee(this,(function(n){switch(n.label){case 0:return Ce.isMp?(t=e.id,[4,la(t)]):[3,2];case 1:return[2,n.sent()];case 2:return Ce.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Me("followOA",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),fa.apply(this,arguments)}var ha=function(){var e=ge((function(e){return Ee(this,(function(t){return[2,new Promise((function(t,n){nn("UNFOLLOW_OA",{uid:e,forceUpdate:!0,zapp:r},{success:function(){t()},fail:function(e){n(e)}},{})}))]}))}));return function(t){return e.apply(this,arguments)}}(),ma=[si({id:Kr()}).optional()];function va(e){return ya.apply(this,arguments)}function ya(){return ya=ge((function(e){return Ee(this,(function(t){return[2,wn("unfollowOA",ma,[e],function(){var e=ge((function(e){var t;return Ee(this,(function(n){switch(n.label){case 0:return Ce.isMp?(t=e.id,[4,ha(t)]):[3,2];case 1:return[2,n.sent()];case 2:return Ce.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Me("unfollowOA",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),ya.apply(this,arguments)}var ga=function(){var e=ge((function(e,t,n,r,i,a){var s,c,d,p,f,h,m,v;return Ee(this,(function(y){switch(y.label){case 0:return d=new URL(location.href),p=new URLSearchParams,f="".concat(d.pathname.replace(u,"")).concat(d.search),a&&(f="/".concat(e).concat("/"===a[0]?"":"/").concat(a)),!(h=new URL("".concat(o).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===(c=window.APP_VERSION)||void 0===c?void 0:c.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(l.CREATE_SHARE_LINK,xe({method:"POST",body:p},m))];case 1:return[4,y.sent().json()];case 2:if(!(v=y.sent())||0!==v.err)throw tn.error.cannotGetShareInfo();return h.search="".concat(h.search,"&zshareId=").concat(v.data.shareId),[2,oa(xe({},v.data),{shareableLink:h.href})]}}))}));return function(t,n,r,i,o,a){return e.apply(this,arguments)}}(),_a=function(){var e=ge((function(e,t){var n,o,a,s,u,c,l,d,p,f,h,m;return Ee(this,(function(v){switch(v.label){case 0:switch(n={},o=e,e){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 n={text:null==t?void 0:t.text,desc:(null==t?void 0:t.desc)||(null==t?void 0:t.description),autoParseLink:(null==t?void 0:t.autoParseLink)?1:0},[3,14];case 2:return c=[],l=(null===(s=ke())||void 0===s?void 0:s.zaloVersion)||0,d=(null===(u=ke())||void 0===u?void 0:u.platformName)||"unknown",Number(l)>=re[d]&&(o="multi_image"),Array.isArray(null==t?void 0:t.imageUrls)&&(null==t?void 0:t.imageUrls.length)>0?c=null==t?void 0:t.imageUrls:c.push(null==t?void 0:t.imageUrl),n={photoUrls:c,photoUrl:null==t?void 0:t.imageUrl,caption:null==t?void 0:t.caption},[3,14];case 3:return n={photoUrl:null==t?void 0:t.imageUrl,gifUrl:null==t?void 0:t.gifUrl,width:null==t?void 0:t.width,height:null==t?void 0:t.height},[3,14];case 4:return n={videoThumb:null==t?void 0:t.videoThumb,videoUrl:null==t?void 0:t.videoUrl,width:null==t?void 0:t.width,height:null==t?void 0:t.height},[3,14];case 5:return n={link:null==t?void 0:t.link,chatOnly:(null==t?void 0:t.chatOnly)?1:0},[3,14];case 6:return n={uid:null==t?void 0:t.id},[3,14];case 7:case 10:return[4,an.getAccessToken()];case 8:case 11:return a=v.sent(),[4,ga(i,a||"",(null==t?void 0:t.title)||"",(null==t?void 0:t.description)||"",(null==t?void 0:t.thumbnail)||"",null==t?void 0:t.path)];case 9:return p=v.sent(),n={data:{ZInstantAPIInfo:{url:"".concat(p.zinstantApi),zinstantdata_id:"templateId=".concat(p.ztemplateId,"&appId=").concat(i,"&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]),n={link:h.href,chatOnly:0},[3,14];case 13:return[3,14];case 14:return[2,new Promise((function(e,t){nn("OPEN_SHARESHEET",oa(xe({type:g[o]},n),{zapp:r}),{success:function(t){e({status:null==t?void 0:t.status,shareType:null==t?void 0:t.share_type,numberOfUser:null==t?void 0:t.uid_to_size})},fail:function(e){t(e)}},{timeout:!1})}))]}}))}));return function(t,n){return e.apply(this,arguments)}}(),wa=[ki.union([si({type:ki.enum(["text"]),data:si({text:Kr(),description:Kr().default("").optional(),autoParseLink:ki.boolean().default(!1).optional()})}),si({type:ki.enum(["image"]),data:si({imageUrl:Kr().url(),imageUrls:ki.array(Kr().url()).max(10).optional()})}),si({type:ki.enum(["link"]),data:si({link:Kr().url(),chatOnly:ki.boolean().optional()})}),si({type:ki.enum(["oa"]),data:si({id:Kr()})}),si({type:ki.enum(["gif"]),data:si({gifUrl:Kr().url(),imageUrl:Kr().url().optional(),width:Jr().min(0).optional(),height:Jr().min(0).optional()})}),si({type:ki.enum(["video"]),data:si({videoThumb:Kr().url(),videoUrl:Kr().url(),width:Jr().min(0).optional(),height:Jr().min(0).optional()})}),si({type:ki.enum(["zmp","zmp_deep_link"]),data:si({title:Kr().max(100),thumbnail:Kr().url(),path:Kr().optional(),description:Kr().max(400).default("").optional()})})])];function ba(e){return Ta.apply(this,arguments)}function Ta(){return Ta=ge((function(e){return Ee(this,(function(t){return[2,wn("openShareSheet",wa,[e],function(){var e=ge((function(e){var t,n;return Ee(this,(function(r){switch(r.label){case 0:return Ce.isMp?(t=e.type,n=e.data,[4,_a(t,n)]):[3,2];case 1:return[2,r.sent()];case 2:return Ce.isMpWeb?[2,Promise.resolve({status:2,shareType:0,numberOfUser:0})]:[2,Promise.reject(Me("openShareSheet",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Ta.apply(this,arguments)}var Ea=ge((function(){return Ee(this,(function(e){return[2,new Promise((function(e,t){nn("REQUEST_PERMISSION_CAMERA",{},{success:function(t){var n,r;(null===(n=ke())||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=ke())||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 Pa(e){return Sa.apply(this,arguments)}function Sa(){return(Sa=ge((function(e){return Ee(this,(function(t){return[2,wn("requestCameraPermission",[],[e],ge((function(){return Ee(this,(function(e){switch(e.label){case 0:return[4,Ea()];case 1:return[2,e.sent()]}}))})))]}))}))).apply(this,arguments)}var Oa=function(){var e=ge((function(e,t,n){return Ee(this,(function(r){return[2,new Promise((function(r,i){nn("CREATE_SHORTCUT",{url:e,title:t,iconUrl:n},{success:function(e){r(e)},fail:function(e){i(e)}},{})}))]}))}));return function(t,n,r){return e.apply(this,arguments)}}(),Aa=ge((function(){var e,t,n,r=arguments;return Ee(this,(function(o){switch(o.label){case 0:return e=r.length>0&&void 0!==r[0]?r[0]:i,t=r.length>1&&void 0!==r[1]?r[1]:0,n=In(),[4,Ft(e,t,n.version)];case 1:return[2,o.sent()]}}))})),Ia=function(){var e=ge((function(e){return Ee(this,(function(t){return[2,new Promise((function(t,n){nn("OPEN_OUTAPP",{url:e},{success:function(){t()},fail:function(e){n(e)}},{})}))]}))}));return function(t){return e.apply(this,arguments)}}(),ka=[si({params:ki.record(Kr(),Kr()).optional()}).optional()];function Ca(e){return Na.apply(this,arguments)}function Na(){return Na=ge((function(e){return Ee(this,(function(t){return[2,wn("createShortcut",ka,[e],function(){var e=ge((function(e){var t,n,r,a,s,u,c,l;return Ee(this,(function(d){switch(d.label){case 0:return Ce.isMp?[4,Aa(i,0)]:[3,6];case 1:return r=d.sent(),a=null===(t=ke())||void 0===t||null===(n=t.platform)||void 0===n?void 0:n.isIOS,s=r.logoUrl||pn("og:image:url")||"",u=r.name||document.title,(c=(null==e?void 0:e.params)?new URLSearchParams(null==e?void 0:e.params):new URLSearchParams).append("utm_source","zalo-shortcut"),c.append("utm_medium","default"),c.append("utm_campaign","default"),a?(c.append("appId",i),c.append("appName",u),c.append("appIcon",s),l="https://mini.zalo.me/shortcut.html?".concat(c.toString()),[4,Ia(encodeURI(l))]):[3,3];case 2:return d.sent(),[3,5];case 3:return[4,Oa("".concat(o,"/").concat(i,"/?").concat(c.toString()),u,s)];case 4:d.sent(),d.label=5;case 5:return[2,tn.success()];case 6:return Ce.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Me("createShortcut",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Na.apply(this,arguments)}var Ma=function(){var e=ge((function(e,t,n){return Ee(this,(function(i){return[2,new Promise((function(i,o){nn("PROMPT_AUTHENTICATION",{secret_data:e,app_id:r,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,r,o;i({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===(r=e.data)||void 0===r?void 0:r.error_message,payToken:null==e||null===(o=e.data)||void 0===o?void 0:o.pay_token}})},fail:function(e){o(e)}},{})}))]}))}));return function(t,n,r){return e.apply(this,arguments)}}(),Ra=[si({secretData:Kr(),ui:si({title:Kr().default("Xác thực").optional(),subTitle:Kr().default("Sử dụng sinh trắc học của bạn để xác thực").optional(),negativeButtonText:Kr().default("Đóng").optional()}).optional(),requireFingerprint:$r().default(!0).optional()}).optional()];function xa(e){return Ua.apply(this,arguments)}function Ua(){return Ua=ge((function(e){return Ee(this,(function(t){return[2,wn("openBioAuthentication",Ra,[e],function(){var e=ge((function(e){var t,n,r;return Ee(this,(function(i){switch(i.label){case 0:return Ce.isMp?(t=e.secretData,n=e.ui,r=e.requireFingerprint,[4,Ma(t,n,r)]):[3,2];case 1:return[2,i.sent()];case 2:return Ce.isMpWeb?[2,Promise.resolve({code:0,message:"OK",data:{domain:"",code:0,message:"",payToken:""}})]:[2,Promise.reject(Me("openBioAuthentication",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Ua.apply(this,arguments)}var Da=ge((function(){return Ee(this,(function(e){return[2,new Promise((function(e,t){nn("PROMPT_AUTHENTICATION_CHECK_STATE",{},{success:function(t){e(null==t?void 0:t.bio_state)},fail:function(e){t(e)}},{actionName:"action.prompt.authentication.check_state"})}))]}))}));function ja(e){return La.apply(this,arguments)}function La(){return(La=ge((function(e){return Ee(this,(function(t){return[2,wn("checkStateBioAuthentication",[],[e],ge((function(){return Ee(this,(function(e){switch(e.label){case 0:return Ce.isMp?[4,Da()]:[3,2];case 1:return[2,{bioState:e.sent()}];case 2:return Ce.isMpWeb?[2,Promise.resolve({bioState:""})]:[2,Promise.reject(Me("checkStateBioAuthentication",{}))]}}))})))]}))}))).apply(this,arguments)}var Ba=function(){var e=ge((function(e){return Ee(this,(function(t){return[2,new Promise((function(t,n){nn("SHOW_TOAST",{toast:e},{success:function(){t()},fail:function(e){n(e)}},{})}))]}))}));return function(t){return e.apply(this,arguments)}}(),Za=[si({message:Kr()}).optional()];function za(e){return Wa.apply(this,arguments)}function Wa(){return Wa=ge((function(e){return Ee(this,(function(t){return[2,wn("showToast",Za,[e],function(){var e=ge((function(e){return Ee(this,(function(t){switch(t.label){case 0:return Ce.isMp?[4,Ba(e.message)]:[3,2];case 1:return[2,t.sent()];case 2:return Ce.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Me("showToast",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Wa.apply(this,arguments)}var Fa=ge((function(){return Ee(this,(function(e){return[2,new Promise((function(e,t){nn("HIDE_KEYBOARD",{},{success:function(){e()},fail:function(e){t(e)}},{})}))]}))}));function Ga(e){return Ha.apply(this,arguments)}function Ha(){return(Ha=ge((function(e){return Ee(this,(function(t){return[2,wn("hideKeyboard",[],[e],ge((function(){return Ee(this,(function(e){switch(e.label){case 0:return Ce.isMp?[4,Fa()]:[3,2];case 1:return[2,e.sent()];case 2:return Ce.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Me("hideKeyboard",{}))]}}))})))]}))}))).apply(this,arguments)}var Va=function(){var e=ge((function(e){return Ee(this,(function(t){return[2,new Promise((function(t,n){nn("OPEN_PHONE",{phoneNum:e,phoneCode:e},{success:function(){t()},fail:function(e){n(e)}},{})}))]}))}));return function(t){return e.apply(this,arguments)}}(),Ka=[si({phoneNumber:Kr()})];function Ja(e){return qa.apply(this,arguments)}function qa(){return qa=ge((function(e){return Ee(this,(function(t){return[2,wn("openPhone",Ka,[e],function(){var e=ge((function(e){return Ee(this,(function(t){switch(t.label){case 0:return Ce.isMp?[4,Va(e.phoneNumber)]:[3,2];case 1:return[2,t.sent()];case 2:return Ce.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Me("openPhone",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),qa.apply(this,arguments)}var Qa=function(){var e=ge((function(e,t){return Ee(this,(function(n){return[2,new Promise((function(n,r){nn("OPEN_SMS",{content:t,phoneCode:e},{success:function(){n()},fail:function(e){r(e)}},{})}))]}))}));return function(t,n){return e.apply(this,arguments)}}(),$a=[si({content:Kr(),phoneNumber:Kr()})];function Ya(e){return Xa.apply(this,arguments)}function Xa(){return Xa=ge((function(e){return Ee(this,(function(t){return[2,wn("openSMS",$a,[e],function(){var e=ge((function(e){return Ee(this,(function(t){switch(t.label){case 0:return Ce.isMp?[4,Qa(e.phoneNumber,e.content)]:[3,2];case 1:return[2,t.sent()];case 2:return Ce.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Me("openSMS",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Xa.apply(this,arguments)}var es=function(){var e=ge((function(e){var t,n=arguments;return Ee(this,(function(i){return t=n.length>1&&void 0!==n[1]?n[1]:"",[2,new Promise((function(n,i){nn("VIEW_MYQR",{dpn:t,uid:e,zapp:r},{success:function(){n()},fail:function(e){i(e)}},{timeout:!1})}))]}))}));return function(t){return e.apply(this,arguments)}}(),ts=[si({id:Kr(),displayName:Kr().default("").optional()})];function ns(e){return rs.apply(this,arguments)}function rs(){return rs=ge((function(e){return Ee(this,(function(t){return[2,wn("viewOAQr",ts,[e],function(){var e=ge((function(e){return Ee(this,(function(t){switch(t.label){case 0:return Ce.isMp?[4,es(e.id,e.displayName)]:[3,2];case 1:return[2,t.sent()];case 2:return Ce.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Me("viewOAQr",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),rs.apply(this,arguments)}var is=function(){var e=ge((function(e){return Ee(this,(function(t){return[2,new Promise((function(t,n){nn("KEEP_SCREEN",{data:{keep_screen_on:e?1:0}},{success:function(){t()},fail:function(e){n(e)}},{})}))]}))}));return function(t){return e.apply(this,arguments)}}(),os=[si({keepScreenOn:$r()})];function as(e){return ss.apply(this,arguments)}function ss(){return ss=ge((function(e){return Ee(this,(function(t){return[2,wn("keepScreen",os,[e],function(){var e=ge((function(e){return Ee(this,(function(t){switch(t.label){case 0:return Ce.isMp?[4,is(e.keepScreenOn)]:[3,2];case 1:return[2,t.sent()];case 2:return Ce.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Me("keepScreen",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),ss.apply(this,arguments)}function us(e){return cs.apply(this,arguments)}function cs(){return(cs=ge((function(e){return Ee(this,(function(t){return[2,wn("onKeepScreen",[],[e],ge((function(){return Ee(this,(function(e){switch(e.label){case 0:return Ce.isMp?[4,is(!0)]:[3,2];case 1:return[2,e.sent()];case 2:return Ce.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Me("onKeepScreen",{}))]}}))})))]}))}))).apply(this,arguments)}function ls(e){return ds.apply(this,arguments)}function ds(){return(ds=ge((function(e){return Ee(this,(function(t){return[2,wn("offKeepScreen",[],[e],ge((function(){return Ee(this,(function(e){switch(e.label){case 0:return Ce.isMp?[4,is(!1)]:[3,2];case 1:return[2,e.sent()];case 2:return Ce.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Me("offKeepScreen",{}))]}}))})))]}))}))).apply(this,arguments)}var ps=function(){var e=ge((function(e,t){var n;return Ee(this,(function(r){return n={},e?n={imageBase64Data:e}:t&&(n={imageUrl:t}),[2,new Promise((function(e,t){nn("SAVE_IMAGE_GALLERY",xe({},n),{success:function(){e()},fail:function(e){t(e)}},{})}))]}))}));return function(t,n){return e.apply(this,arguments)}}(),fs=[si({imageBase64Data:Kr().optional(),imageUrl:Kr().url().optional()}).optional()];function hs(e){return ms.apply(this,arguments)}function ms(){return ms=ge((function(e){return Ee(this,(function(t){return[2,wn("saveImageToGallery",fs,[e],function(){var e=ge((function(e){return Ee(this,(function(t){switch(t.label){case 0:return Ce.isMp?[4,ps(e.imageBase64Data,e.imageUrl)]:[3,2];case 1:return[2,t.sent()];case 2:return Ce.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Me("saveImageToGallery",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),ms.apply(this,arguments)}var vs=function(){var e=ge((function(e){var t,n,r,i,o,s,u=arguments;return Ee(this,(function(c){switch(c.label){case 0:t=u.length>1&&void 0!==u[1]?u[1]:"/",n=u.length>2&&void 0!==u[2]?u[2]:{},c.label=1;case 1:return c.trys.push([1,3,,4]),[4,Aa(e,0)];case 2:return r=c.sent(),[3,4];case 3:return c.sent(),[3,4];case 4:i={appId:e},r&&(i.appName=r.name,i.appAvtUrl=r.logoUrl),o="".concat(a,"/").concat(e).concat(t);try{s=new URL(o),Object.entries(n).forEach((function(e){var t=Ue(e,2),n=t[0],r=t[1];s.searchParams.append(n,String(r))})),o=s.href}catch(e){}return[2,new Promise((function(e,t){nn("OPEN_MP",{mpUrl:o,mpInfo:i},{success:function(){e()},fail:function(e){t(e)}},{})}))]}}))}));return function(t){return e.apply(this,arguments)}}(),ys=[si({appId:Kr(),path:Kr().optional(),params:ki.record(Kr(),Kr()).optional()})];function gs(e){return _s.apply(this,arguments)}function _s(){return _s=ge((function(e){return Ee(this,(function(t){return[2,wn("openMiniApp",ys,[e],function(){var e=ge((function(e){return Ee(this,(function(t){switch(t.label){case 0:return Ce.isMp?[4,vs(e.appId,e.path,e.params)]:[3,2];case 1:return[2,t.sent()];case 2:return Ce.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Me("openMiniApp",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),_s.apply(this,arguments)}var ws=ge((function(){var e,t,n=arguments;return Ee(this,(function(r){return e=n.length>0&&void 0!==n[0]?n[0]:"oneShot",t=n.length>1?n[1]:void 0,[2,new Promise((function(n,r){nn("INTERACTIVE_VIBRATION",{type:w[e],vibrate_time:t},{success:function(){n()},fail:function(e){r(e)}},{})}))]}))})),bs=[si({type:ki.enum(["oneShot"]).default("oneShot"),milliseconds:Jr().optional()})];function Ts(e){return Es.apply(this,arguments)}function Es(){return Es=ge((function(e){return Ee(this,(function(t){return[2,wn("vibrate",bs,[e],function(){var e=ge((function(e){return Ee(this,(function(t){switch(t.label){case 0:return Ce.isMp?[4,ws(null==e?void 0:e.type,null==e?void 0:e.milliseconds)]:[3,2];case 1:return[2,t.sent()];case 2:return Ce.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Me("vibrate",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Es.apply(this,arguments)}var Ps=function(){var e=ge((function(e,t){var n,r,i,o;return Ee(this,(function(a){return n=new URL(e),r=n.href.includes("vnpay"),i=n.searchParams.get("typeInapp"),o=yt.isEmpty(t)?void 0:{modal_style:(null==t?void 0:t.style)?Ht(null==t?void 0:t.style):"bottom_sheet",left_button:(null==t?void 0:t.leftButton)?Ht(null==t?void 0:t.leftButton):"back"},!r&&yt.isEmpty(i)&&n.searchParams.set("typeInapp","1"),[2,new Promise((function(e,t){nn("OPEN_INAPP",{url:n.href,style:o},{success:function(){e()},fail:function(e){t(e)}},{})}))]}))}));return function(t,n){return e.apply(this,arguments)}}(),Ss=[si({url:Kr(),config:si({style:ki.enum(["bottomSheet","normal"]).default("bottomSheet").optional(),leftButton:ki.enum(["back","none"]).default("back").optional()}).optional()})];function Os(e){return As.apply(this,arguments)}function As(){return As=ge((function(e){return Ee(this,(function(t){return[2,wn("openWebview",Ss,[e],function(){var e=ge((function(e){return Ee(this,(function(t){switch(t.label){case 0:return Ce.isMp?[4,Ps(e.url,e.config)]:[3,2];case 1:return[2,t.sent()];case 2:return Ce.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Me("openWebview",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),As.apply(this,arguments)}function Is(){var e={},t=window.location.href;try{var n=new URL(t).searchParams.toString();n&&(e=Ut.getParamsAsObject(n))}catch(e){throw new Error("Invalid URL")}return e}function ks(){return wn("getRouteParams",[],[],(function(){return Is()}))}function Cs(e){return Ns.apply(this,arguments)}function Ns(){return(Ns=ge((function(e){return Ee(this,(function(t){return[2,wn("getAppInfo",[],[e],ge((function(){return Ee(this,(function(e){switch(e.label){case 0:return Ce.isMp?[4,Aa()]:[3,2];case 1:return[2,e.sent()];case 2:return Ce.isMpWeb?[2,Promise.resolve({description:"",name:"",version:"",appUrl:"",qrCodeUrl:""})]:[2,Promise.reject(Me("getAppInfo",{}))]}}))})))]}))}))).apply(this,arguments)}var Ms=function(){var e=ge((function(e){return Ee(this,(function(t){return[2,new Promise((function(t,n){nn("WEBVIEW_SET_RESULT",{result:fn(e)},{success:function(){t()},fail:function(e){n(e)}},{})}))]}))}));return function(t){return e.apply(this,arguments)}}(),Rs=[si({data:ki.any()})];function xs(e){return Us.apply(this,arguments)}function Us(){return Us=ge((function(e){return Ee(this,(function(t){return[2,wn("sendDataToPreviousMiniApp",Rs,[e],function(){var e=ge((function(e){return Ee(this,(function(t){switch(t.label){case 0:return Ce.isMp?[4,Ms(e.data)]:[3,2];case 1:return[2,t.sent()];case 2:return Ce.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Me("sendDataToPreviousMiniApp",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Us.apply(this,arguments)}var Ds=ge((function(){return Ee(this,(function(e){return[2,new Promise((function(e,t){var n,r;nn("MP_GET_NUMBER",{forceUpdate:!0},{success:function(n){var r={};if(null==n?void 0:n.token)return r.token=null==n?void 0:n.token,e(r);t(tn.error.clientNotSupport())},fail:function(e){t(e)}},{delay:(null===(n=ke())||void 0===n||null===(r=n.platform)||void 0===r?void 0:r.isIOS)?400:0})}))]}))}));function js(e){return Ls.apply(this,arguments)}function Ls(){return(Ls=ge((function(e){return Ee(this,(function(t){return[2,wn("getPhoneNumber",[],[e],ge((function(){return Ee(this,(function(e){switch(e.label){case 0:return Ce.isMp?[4,Ds()]:[3,2];case 1:return[2,e.sent()];case 2:return Ce.isMpWeb?[2,Promise.resolve({number:""})]:[2,Promise.reject(Me("getPhoneNumber",{}))]}}))})))]}))}))).apply(this,arguments)}var Bs=ge((function(){var e,t=arguments;return Ee(this,(function(n){return e=t.length>0&&void 0!==t[0]?t[0]:1,[2,new Promise((function(t,n){nn("MP_OPEN_PROFILE_PICKER",{maxProfile:e},{success:function(e){Array.isArray(e)?t(e.map((function(e){return e.id}))):t([])},fail:function(e){n(e)}},{isMultiCallback:!0})}))]}))})),Zs=[si({maxProfile:Jr().min(1).max(10).optional().default(1)})];function zs(e){return Ws.apply(this,arguments)}function Ws(){return Ws=ge((function(e){return Ee(this,(function(t){return[2,wn("openProfilePicker",Zs,[e],function(){var e=ge((function(e){var t,n,r,i,o;return Ee(this,(function(a){switch(a.label){case 0:return Ce.isMp?[4,Bs(null==e?void 0:e.maxProfile)]:[3,8];case 1:if(!((t=a.sent()).length>0))return[3,7];a.label=2;case 2:return a.trys.push([2,6,,7]),[4,an.getAccessToken()];case 3:return r=a.sent(),[4,fetch(l.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(yt.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 Ce.isMpWeb?[2,Promise.resolve({users:[]})]:[2,Promise.reject(Me("openProfilePicker",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Ws.apply(this,arguments)}var Fs=function(){var e=ge((function(e,t,n){var r;return Ee(this,(function(i){return r=t&&yt.isString(t)&&t.length>0?"wpa_wpa2":"open",[2,new Promise((function(i,o){nn("MP_JOIN_WIFI",{ssid:e,securityType:r,password:t,hiddenSsid:n},{success:function(e){i(e)},fail:function(e){o(e)}},{})}))]}))}));return function(t,n,r){return e.apply(this,arguments)}}(),Gs=[si({SSID:Kr(),password:Kr().optional(),hiddenSSID:$r().optional()})];function Hs(e){return Vs.apply(this,arguments)}function Vs(){return Vs=ge((function(e){return Ee(this,(function(t){return[2,wn("connectWifi",Gs,[e],function(){var e=ge((function(e){return Ee(this,(function(t){switch(t.label){case 0:return Ce.isMp?[4,Fs(e.SSID,e.password,e.hiddenSSID)]:[3,2];case 1:return[2,t.sent()];case 2:return Ce.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Me("connectWifi",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Vs.apply(this,arguments)}var Ks=function(){var e=ge((function(e,t,n,r,i,o){var a,s;return Ee(this,(function(u){return a={type:0,url:t,max_size:n||1048576},s={enable:1,aspect_ratio:"1:1"},[2,new Promise((function(t,n){nn("PICK_MEDIA",{media_type:b[e],edit_view:xe({},s,r),silent_request:i,upload:a,max_select_items:o},{success:function(e){t(null==e?void 0:e.result_content)},fail:function(e){n(e)}},{isMultiCallback:!0})}))]}))}));return function(t,n,r,i,o,a){return e.apply(this,arguments)}}(),Js=[si({type:ki.enum(["video","photo","file","zcamera","zcamera_photo","zcamera_video","zcamera_scan"]),serverUploadUrl:Kr().url(),maxItemSize:Jr().min(0).optional(),editView:si({enable:$r().optional(),aspectRatio:Kr().regex(/^d+:d+$/).optional()}).optional(),silentRequest:$r().optional(),maxSelectItem:Jr().min(1).optional()})];function qs(e){return Qs.apply(this,arguments)}function Qs(){return Qs=ge((function(e){return Ee(this,(function(t){return[2,wn("openMediaPicker",Js,[e],function(){var e=ge((function(e){var t,n,r,i,o,a;return Ee(this,(function(s){switch(s.label){case 0:return Ce.isMp?(i={},yt.isUndefined(null===(t=e.editView)||void 0===t?void 0:t.enable)||(null===(n=e.editView)||void 0===n?void 0:n.enable)?i.enable=1:i.enable=0,i.aspect_ratio=null===(r=e.editView)||void 0===r?void 0:r.aspectRatio,o=!0===e.silentRequest?1:0,a=e.maxSelectItem,[4,Ks(e.type,e.serverUploadUrl,e.maxItemSize,i,o,a)]):[3,2];case 1:return[2,{data:s.sent()}];case 2:return Ce.isMpWeb?[2,Promise.resolve({data:""})]:[2,Promise.reject(Me("openMediaPicker",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Qs.apply(this,arguments)}var $s=[si({title:Kr().max(100),description:Kr().max(400).default(""),thumbnail:Kr().url().optional(),path:Kr().optional()})];function Ys(e){return Xs.apply(this,arguments)}function Xs(){return Xs=ge((function(e){return Ee(this,(function(t){return[2,wn("getShareableLink",$s,[e],function(){var e=ge((function(e){var t;return Ee(this,(function(n){switch(n.label){case 0:return[4,an.getAccessToken()];case 1:return t=n.sent(),[4,ga(window.APP_ID,t||"",e.title,e.description,e.thumbnail,e.path)];case 2:return[2,n.sent().shareableLink]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Xs.apply(this,arguments)}var eu=function(){var e=ge((function(e){return Ee(this,(function(t){return[2,new Promise((function(t,n){nn("MP_CLOSE_LOADINGVIEW",{at:(new Date).getTime(),when:e,url:location.href},{success:function(e){t(e)},fail:function(e){n(e)}},{})}))]}))}));return function(t){return e.apply(this,arguments)}}();function tu(e){return nu.apply(this,arguments)}function nu(){return(nu=ge((function(e){return Ee(this,(function(t){return[2,wn("closeLoading",[],[e],ge((function(){return Ee(this,(function(e){switch(e.label){case 0:return Ce.isMp?[4,eu("user action")]:[3,2];case 1:return[2,e.sent()];case 2:return Ce.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Me("closeLoading",{}))]}}))})))]}))}))).apply(this,arguments)}function ru(e){return iu.apply(this,arguments)}function iu(){return iu=ge((function(e){return Ee(this,(function(t){return[2,wn("requestUpdateZalo",[],[e],ge((function(){var e,t,n;return Ee(this,(function(r){switch(r.label){case 0:return Ce.isMp?(n=(null===(e=ke())||void 0===e||null===(t=e.platform)||void 0===t?void 0:t.isIOS)?"https://apps.apple.com/vn/app/zalo/id579523206":"https://play.google.com/store/apps/details?id=com.zing.zalo",[4,Ia(n)]):[3,2];case 1:return[2,r.sent()];case 2:return Ce.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Me("requestUpdateZalo",{}))]}}))})))]}))})),iu.apply(this,arguments)}var ou=Mt.getInstance();ou.addListener=function(e,t,n){var r=e;return ou.addListener(f[r],t,n)};var au=[ki.function()];function su(e){return wn("onConfirmToExit",au,[e],(function(e){var t=e;Ce.isMp&&(ou.on(f.AppClose,t,'{"handle_h5": 1}'),Ni.setNavigationBarLeftButton(void 0,2))}))}function uu(){return wn("offConfirmToExit",[],[],(function(){Ce.isMp&&(ou.off(f.AppClose),Ni.setNavigationBarLeftButton(void 0,0))}))}function cu(){return wn("getDeviceId",[],[],(function(){return Ce.isMp&&an.getSync(c.DEVICE_ID)||""}))}function lu(e){return du.apply(this,arguments)}function du(){return(du=ge((function(e){return Ee(this,(function(t){return[2,wn("getDeviceIdAsync",[],[e],ge((function(){return Ee(this,(function(e){switch(e.label){case 0:return Ce.isMp?[4,an.jumpAndGetToken(c.DEVICE_ID)]:[3,2];case 1:return[2,e.sent()||""];case 2:return[2,Promise.resolve("")]}}))})))]}))}))).apply(this,arguments)}function pu(){return wn("getContext",[],[],(function(){if(Ce.isMp){var e=an.getSync(c.CONTEXT_ID)||"";return{type:an.getSync(c.CONTEXT_TYPE)||"",id:e}}return{type:"",id:""}}))}function fu(e){return hu.apply(this,arguments)}function hu(){return(hu=ge((function(e){return Ee(this,(function(t){return[2,wn("getContextAsync",[],[e],ge((function(){var e;return Ee(this,(function(t){switch(t.label){case 0:return Ce.isMp?[4,an.jumpAndGetToken(c.CONTEXT_ID)]:[3,3];case 1:return e=t.sent()||"",[4,an.jumpAndGetToken(c.CONTEXT_TYPE)];case 2:return[2,{type:t.sent()||"",id:e}];case 3:return[2,Promise.resolve({type:"",id:""})]}}))})))]}))}))).apply(this,arguments)}function mu(e){return vu.apply(this,arguments)}function vu(){return(vu=ge((function(e){return Ee(this,(function(t){return[2,wn("getAuthCode",[],[e],ge((function(){var e,t;return Ee(this,(function(n){switch(n.label){case 0:return Ce.isMp?[4,an.jumpAndGetToken(c.ZOAUTH,!0)]:[3,4];case 1:return e=n.sent()||"",[4,an.jumpAndGetToken(c.ZOAUTH_VRF)];case 2:return t=n.sent()||"",[4,an.verifyUserAuthorized()];case 3:if(n.sent())return[2,{authCode:e,authCodeVerify:t}];throw Gt([{action:"getAuthCode",error:-104,message:"no user auth",data:{}}]),tn.error.loginFailed("User Authentication Required");case 4:return[2,Promise.resolve({authCode:"",authCodeVerify:""})]}}))})))]}))}))).apply(this,arguments)}function yu(e){return gu.apply(this,arguments)}function gu(){return(gu=ge((function(e){return Ee(this,(function(t){return[2,wn("getZPIToken",[],[e],ge((function(){var e,t,n,r;return Ee(this,(function(i){switch(i.label){case 0:return Ce.isMp?[4,an.jumpAndGetToken(c.UTOKEN_ZPI)]:[3,5];case 1:return e=i.sent()||"",[4,an.jumpAndGetToken(c.GTOKEN_ZPI)];case 2:return t=i.sent()||"",[4,an.jumpAndGetToken(c.ZPP_ZPI)];case 3:return n=i.sent()||"",[4,an.jumpAndGetToken(c.ZPT_ZPI)];case 4:return r=i.sent()||"",[2,{utoken:e,gtoken:t,zpp:n,zpt:r}];case 5:return[2,Promise.resolve({utoken:"",gtoken:"",zpp:"",zpt:""})]}}))})))]}))}))).apply(this,arguments)}var _u=[Kr()];function wu(e){return wn("setAccessToken",_u,[e],(function(e){var t=e;an.setAccessToken(t)}))}var bu=[si({url:Kr().url()})];function Tu(e){return Eu.apply(this,arguments)}function Eu(){return Eu=ge((function(e){return Ee(this,(function(t){return[2,wn("openOutApp",bu,[e],function(){var e=ge((function(e){return Ee(this,(function(t){switch(t.label){case 0:return Ce.isMp?[4,Ia(e.url)]:[3,2];case 1:return[2,t.sent()];case 2:return Ce.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Me("openOutApp",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Eu.apply(this,arguments)}var Pu=[si({count:Jr().min(1).optional().default(1),sourceType:ki.array(ki.enum(["album","camera"])).max(2).default(["album","camera"]).optional(),cameraType:ki.enum(["back","front"]).default("front").optional()})];function Su(e){return Ou.apply(this,arguments)}function Ou(){return Ou=ge((function(e){return Ee(this,(function(t){return[2,wn("chooseImage",Pu,[e],function(){var e=ge((function(e){var t,n,r,i;return Ee(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)}}())]}))})),Ou.apply(this,arguments)}var Au=ge((function(){var e,t,n=arguments;return Ee(this,(function(r){return e=n.length>0&&void 0!==n[0]&&n[0],t=n.length>1&&void 0!==n[1]?n[1]:"Cho phép Zalo truy cập vào vị trí của thiết bị này?",[2,new Promise((function(n,r){nn("GET_LOCATION",{silent_request:e,permission_description:t,forceUpdate:!0},{success:function(e){var t={};if(null==e?void 0:e.token)return t.token=null==e?void 0:e.token,n(t);r(tn.error.clientNotSupport())},fail:function(e){r(e)}},{isMultiCallback:!0,timeout:!1})}))]}))}));function Iu(e){return ku.apply(this,arguments)}function ku(){return(ku=ge((function(e){return Ee(this,(function(t){return[2,wn("getLocation",[],[e],ge((function(){return Ee(this,(function(e){switch(e.label){case 0:return Ce.isMp?[4,Au()]:[3,2];case 1:return[2,e.sent()];case 2:return Ce.isMpWeb?[2,Promise.resolve({longitude:"105.788026",latitude:"21.0258773",timestamp:(new Date).getTime().toString(),provider:"fused"})]:[2,Promise.reject(Me("getLocation",{}))]}}))})))]}))}))).apply(this,arguments)}var Cu=[ki.function().args(si({data:ki.any()})).returns(ki.void())];function Nu(e){return wn("onCallbackData",Cu,[e],(function(){!function(e){Mt.getInstance().on(f.OnDataCallback,(function(t){e({data:t})}))}(e)}))}var Mu=function(){var e=ge((function(e){var t,n,r,o,a,s,u,c,l,d,p;return Ee(this,(function(f){switch(f.label){case 0:return n="",e||(e=Is()),"object"==typeof e&&((n=e.zmpOrderId||"")||(t=e.appTransID||e.orderId||e.apptransid)),"string"==typeof e&&(r=Ut.getParameterByName("orderId",e),o=Ut.getParameterByName("appTransID",e)||Ut.getParameterByName("apptransid",e),t=r||o),a={headers:{authorization:"Bearer "}},[4,an.getAccessToken().catch((function(){throw tn.error.loginRequired}))];case 1:return s=f.sent(),a.headers.authorization="Bearer ".concat(s),u=new URL(se),c={orderId:n,transId:t||"",appId:i},u.search=new URLSearchParams(c).toString(),[4,fetch(u.toString(),a)];case 2:return[4,f.sent().json()];case 3:if(!(l=f.sent()).data)throw tn.error.badRequest(l.msg);return d=l.data||{},p={err:l.err},0!==Object.keys(d).length&&d.constructor===Object&&Object.assign(p,xe({msg:d.resultMessage},d)),[2,p]}}))}));return function(t){return e.apply(this,arguments)}}(),Ru=function(){var e=ge((function(e,t,n,r,o,a,s){var u,c,l,d,p,h,m,v,y,g,_,w,b,T,E,P,S,O,A,I,k;return Ee(this,(function(C){switch(C.label){case 0:u=i,(c=new URLSearchParams).append("amount",e.toString()),c.append("item",encodeURIComponent(JSON.stringify(t))),c.append("appId",u),n&&c.append("desc",encodeURIComponent(n)),r&&(l=r,"object"==typeof r&&(l=JSON.stringify(r)),c.append("extradata",encodeURIComponent(l))),o&&(d=o,"object"==typeof o&&(d=JSON.stringify(o)),c.append("payload",encodeURIComponent(d))),a&&("string"==typeof a?(c.append("method",a),c.append("isCustom","false")):"object"==typeof a&&(c.append("method",a.id),c.append("isCustom",JSON.stringify(a.isCustom)))),s&&c.append("mac",s),p={headers:{"Content-Type":"application/x-www-form-urlencoded",authorization:"Bearer "}},C.label=1;case 1:return C.trys.push([1,6,,7]),[4,an.getAccessToken().catch((function(){throw tn.error.loginRequired}))];case 2:return m=C.sent(),p.headers.authorization="Bearer ".concat(m),[4,fetch(oe,oa(xe({method:"POST"},p),{body:c}))];case 3:return[4,C.sent().json()];case 4:if(!(v=C.sent()).data||0!==v.err)throw tn.error.badRequest(v.msg);return y=v.data.id,g=v.data.jwt,_=v.data.messageToken||"",w=window.APP_VERSION,b=window.APP_ENV,T={miniAppId:u,orderId:y},E=v.data.method,P=v.data.isCustom,g&&(T.token=g),w&&(T.version=w),b&&(T.env=b),E&&(T.method=E),P&&(T.isCustom=P),S=Ut.encode(T),O=new URL("?".concat(S),"https://payment-mini.zalo.me").toString(),A=Vt(),I=((null===(h=ke())||void 0===h?void 0:h.platformName)||"").toLowerCase(),[4,Ps(O,{style:"android"===I&&A<742?"normal":"bottomSheet"}).then((function(){var e=!1;Mt.getInstance().once(f.WebviewClosed,(function(){setTimeout(ge((function(){var t;return Ee(this,(function(n){switch(n.label){case 0:return e?[3,2]:[4,Mu({zmpOrderId:y})];case 1:(t=n.sent()).err>=0&&!t.isCustom&&Mt.getInstance().emit(f.PaymentClose,t.err,oa(xe({},t),{zmpOrderId:y})),n.label=2;case 2:return[2]}}))})),500)})),Mt.getInstance().once(f.OpenApp,(function(){e=!0}))}))];case 5:return C.sent(),[2,{orderId:y,messageToken:_}];case 6:throw k=C.sent(),console.log("Internal error"),k;case 7:return[2]}}))}));return function(t,n,r,i,o,a,s){return e.apply(this,arguments)}}(),xu=[si({amount:ki.union([Kr(),Jr()]),item:ki.array(ki.record(Kr(),ki.any())),desc:Kr(),extradata:ki.any().optional(),payload:ki.any().optional(),method:ki.union([ki.string(),ki.object({id:ki.string(),isCustom:ki.boolean()})]).optional(),mac:ki.string().optional()})];function Uu(e){return Du.apply(this,arguments)}function Du(){return Du=ge((function(e){return Ee(this,(function(t){return[2,wn("createOrder",xu,[e],function(){var e=ge((function(e){return Ee(this,(function(t){switch(t.label){case 0:return Ce.isMp?[4,Ru(e.amount,e.item,e.desc,e.extradata,e.payload,e.method,e.mac)]:[3,2];case 1:return[2,t.sent()];case 2:return Ce.isMpWeb?[2,Promise.resolve({orderId:"",messageToken:""})]:[2,Promise.reject(Me("createOrder",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Du.apply(this,arguments)}var ju=ge((function(){return Ee(this,(function(e){return[2,new Promise((function(e,t){nn("MP_CONFIRM_REQUEST_PAYMENT",{},{success:function(){e()},fail:function(e){t(e)}},{})}))]}))})),Lu=function(){var e=ge((function(e,t,n,r,o){var a,s,u,c,l,d,p,f,h,m,v,y;return Ee(this,(function(g){switch(g.label){case 0:a=i,(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),o&&s.append("mac",o),u={headers:{"Content-Type":"application/x-www-form-urlencoded",authorization:"Bearer "}},g.label=1;case 1:return g.trys.push([1,10,,11]),[4,an.getAccessToken().catch((function(){throw tn.error.loginRequired}))];case 2:return l=g.sent(),u.headers.authorization="Bearer ".concat(l),console.log("_purchase"),[4,an.jumpAndGetToken()];case 3:if(g.sent(),d=null===(c=an.miniProgramConfig)||void 0===c?void 0:c.showConfirmToPayment,console.log("showConfirmToPayment",d),!d)return[3,7];g.label=4;case 4:return g.trys.push([4,6,,7]),[4,ju()];case 5:return g.sent(),[3,7];case 6:throw p=g.sent(),console.error("Failed:",p),p;case 7:return[4,fetch(ue,oa(xe({method:"POST"},u),{body:s}))];case 8:return[4,g.sent().json()];case 9:if(!(f=g.sent()).data||0!==f.err)throw tn.error.badRequest(f.msg);return h=f.data.id,m=f.data.messageToken||"",v=f.data.transId||"",[2,{orderId:h,messageToken:m,transId:v}];case 10:throw y=g.sent(),console.log("Internal error"),y;case 11:return[2]}}))}));return function(t,n,r,i,o){return e.apply(this,arguments)}}(),Bu=[si({amount:ki.union([ki.string(),ki.number()]),desc:ki.string(),method:ki.string(),transId:ki.string().optional(),mac:ki.string().optional()})];function Zu(e){return zu.apply(this,arguments)}function zu(){return zu=ge((function(e){return Ee(this,(function(t){return[2,wn("purchase",Bu,[e],function(){var e=ge((function(e){return Ee(this,(function(t){switch(t.label){case 0:return Ce.isMp?[4,Lu(e.amount,e.desc,e.method,null==e?void 0:e.transId,null==e?void 0:e.mac)]:[3,2];case 1:return[2,t.sent()];case 2:return Ce.isMpWeb?[2,Promise.resolve({orderId:"",messageToken:"",transId:""})]:[2,Promise.reject(Me("purchase",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),zu.apply(this,arguments)}var Wu=function(){var e=ge((function(e,t){return Ee(this,(function(n){return[2,new Promise((function(n,r){var i=e&&(null==e?void 0:e.length)>0;nn("MP_SELECT_PAYMENT_METHOD",{isBinding:i,channels:e,selectedMethod:t,forceUpdate:!0},{success:function(e){console.log(e),n(e)},fail:function(e){r(e)}},{})}))]}))}));return function(t,n){return e.apply(this,arguments)}}(),Fu=[si({channels:ai(si({method:Kr(),subMethod:Kr().optional(),subInfo:Kr().optional()})).optional(),selectedMethod:si({method:Kr(),subMethod:Kr().optional()}).optional()}).optional()];function Gu(e){return Hu.apply(this,arguments)}function Hu(){return Hu=ge((function(e){return Ee(this,(function(t){return[2,wn("selectPaymentMethod",Fu,[e],function(){var e=ge((function(e){var t,n;return Ee(this,(function(r){switch(r.label){case 0:return Ce.isMp?(t=e.channels,n=e.selectedMethod,[4,Wu(t,n)]):[3,2];case 1:return[2,r.sent()];case 2:return Ce.isMpWeb?[2,Promise.resolve({method:""})]:[2,Promise.reject(Me("selectPaymentMethod",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Hu.apply(this,arguments)}var Vu=[si({data:ki.union([Kr(),ki.record(Kr(),Kr())])})];function Ku(e){return Ju.apply(this,arguments)}function Ju(){return Ju=ge((function(e){return Ee(this,(function(t){return[2,wn("checkTransaction",Vu,[e],function(){var e=ge((function(e){return Ee(this,(function(t){switch(t.label){case 0:return Ce.isMp?[4,Mu(e.data)]:[3,2];case 1:return[2,t.sent()];case 2:return Ce.isMpWeb?[2,Promise.resolve({msg:"Success",orderId:"",resultCode:1,transTime:(new Date).getTime().toString(),createdAt:(new Date).getTime().toString(),transId:""})]:[2,Promise.reject(Me("checkTransaction",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Ju.apply(this,arguments)}var qu=[si({hide:$r().default(!1).optional()}).optional()];function Qu(e){return $u.apply(this,arguments)}function $u(){return $u=ge((function(e){return Ee(this,(function(t){return[2,wn("setAndroidBottomNavigationBar",qu,[e],function(){var e=ge((function(e){return Ee(this,(function(t){switch(t.label){case 0:return Ce.isMp?[4,Ni.setAndroidBottomNavigationBar(e.hide)]:[3,2];case 1:return[2,t.sent()];case 2:return Ce.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Me("setAndroidBottomNavigationBar",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),$u.apply(this,arguments)}var Yu=[si({hide:$r().default(!1).optional()}).optional()];function Xu(e){return ec.apply(this,arguments)}function ec(){return ec=ge((function(e){return Ee(this,(function(t){return[2,wn("setIOSBottomSafeArea",Yu,[e],function(){var e=ge((function(e){return Ee(this,(function(t){switch(t.label){case 0:return Ce.isMp?[4,Ni.setIOSBottomSafeArea(e.hide)]:[3,2];case 1:return[2,t.sent()];case 2:return Ce.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Me("setIOSBottomSafeArea",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),ec.apply(this,arguments)}var tc=[si({type:ki.enum(["normal","hidden","transparent"]).default("normal").optional(),color:ki.string().optional()}).optional()];function nc(e){return rc.apply(this,arguments)}function rc(){return rc=ge((function(e){return Ee(this,(function(t){return[2,wn("setStatusBar",tc,[e],function(){var e=ge((function(e){return Ee(this,(function(t){switch(t.label){case 0:return Ce.isMp?[4,Ni.configHeader({statusBarType:e.type,headerColor:e.color})]:[3,2];case 1:return[2,t.sent()];case 2:return Ce.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Me("setStatusBar",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),rc.apply(this,arguments)}var ic=[si({headerTextColor:ki.enum(["black","white"]).optional(),headerColor:ki.string().optional(),actionBar:si({hide:ki.boolean().optional(),title:ki.string().optional(),leftButton:ki.enum(["back","none"]).optional(),textAlign:ki.enum(["left","center"]).default("left").optional()}).optional(),statusBarType:ki.enum(["normal","hidden","transparent"]).optional(),hideAndroidBottomNavigationBar:ki.boolean().optional(),hideIOSSafeAreaBottom:ki.boolean().optional()})];function oc(e){return ac.apply(this,arguments)}function ac(){return ac=ge((function(e){return Ee(this,(function(t){return[2,wn("configAppView",ic,[e],function(){var e=ge((function(e){var t,n,r,i,o,a,s;return Ee(this,(function(u){switch(u.label){case 0:return Ce.isMp?yt.isUndefined(null===(t=e.actionBar)||void 0===t?void 0:t.leftButton)?[3,2]:[4,Ni.setNavigationBarLeftButton(null===(a=e.actionBar)||void 0===a?void 0:a.leftButton)]:[3,13];case 1:u.sent(),u.label=2;case 2:return yt.isUndefined(null===(n=e.actionBar)||void 0===n?void 0:n.title)||!(null===(r=e.actionBar)||void 0===r?void 0:r.title)?[3,4]:[4,Ni.setNavigationBarTitle(null===(s=e.actionBar)||void 0===s?void 0:s.title)];case 3:u.sent(),u.label=4;case 4:return[4,Ni.configHeader({hideActionBar:null===(i=e.actionBar)||void 0===i?void 0:i.hide,statusBarType:e.statusBarType,headerTextColor:e.headerTextColor,headerColor:e.headerColor,textAlign:null===(o=e.actionBar)||void 0===o?void 0:o.textAlign})];case 5:u.sent(),u.label=6;case 6:return u.trys.push([6,11,,12]),"boolean"!=typeof e.hideAndroidBottomNavigationBar?[3,8]:[4,Ni.setAndroidBottomNavigationBar(e.hideAndroidBottomNavigationBar)];case 7:u.sent(),u.label=8;case 8:return"boolean"!=typeof e.hideIOSSafeAreaBottom?[3,10]:[4,Ni.setIOSBottomSafeArea(e.hideIOSSafeAreaBottom)];case 9:u.sent(),u.label=10;case 10:return[3,12];case 11:return u.sent(),[3,12];case 12:return[2];case 13:return Ce.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Me("configAppView",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),ac.apply(this,arguments)}var sc=function(){var e=ge((function(e,t,n,r,o,a){var s,u,c,l,d,p,f,h,m,v,y,g,_,w;return Ee(this,(function(b){switch(b.label){case 0:d=i,(p=new URLSearchParams).append("payType",t||T.SUBSCRIPTION),f=E.UNKNOW,n===le&&(f=E.IMMEDIATE_AND_CHARGE_FULL_PRICE),n===ce&&(f=E.DEFERRED),p.append("utm",o||"default"),p.append("merchantTransId",a||""),p.append("prorationMode",f.toString()),p.append("appId",d),r&&p.append("method",r),h="",(null===(s=ke())||void 0===s||null===(u=s.platform)||void 0===u?void 0:u.isIOS)?h="ios":(null===(c=ke())||void 0===c||null===(l=c.platform)||void 0===l?void 0:l.isAndroid)&&(h="android"),p.append("os",h),p.append("productId",e),m={headers:{"Content-Type":"application/x-www-form-urlencoded",authorization:"Bearer "}},b.label=1;case 1:return b.trys.push([1,5,,6]),[4,an.getAccessToken().catch((function(){throw tn.error.loginRequired}))];case 2:return v=b.sent(),m.headers.authorization="Bearer ".concat(v),[4,fetch(ae,oa(xe({method:"POST"},m),{body:p}))];case 3:return[4,b.sent().json()];case 4:if(!(y=b.sent()).data||!y.data.store||0!==y.err)throw tn.error.createIAPOrderFailed(y.err);return g=y.data.store,_=y.data.orderId,[2,new Promise((function(e,t){nn("IAP_REQUESTPAYMENT",xe({},g),{success:function(){e({orderId:_})},fail:function(e){t(e)}})}))];case 5:throw w=b.sent(),console.log("Internal error"),w;case 6:return[2]}}))}));return function(t,n,r,i,o,a){return e.apply(this,arguments)}}(),uc=[si({productId:Kr(),payType:ki.enum(["ONETIME","SUBSCRIPTION"]).optional(),prorationMode:ki.enum(["DEFERRED","IMMEDIATE_AND_CHARGE_FULL_PRICE"]).default("DEFERRED").optional(),utm:Kr().optional(),method:ki.enum(["IAP","IAP_SANDBOX"]).optional(),merchantTransId:Kr().optional()})];function cc(e){return lc.apply(this,arguments)}function lc(){return lc=ge((function(e){return Ee(this,(function(t){return[2,wn("createOrderIAP",uc,[e],function(){var e=ge((function(e){return Ee(this,(function(t){switch(t.label){case 0:return Ce.isMp?[4,sc(e.productId,e.payType,e.prorationMode,e.method,e.utm,e.merchantTransId)]:[3,2];case 1:return[2,t.sent()];case 2:return Ce.isMpWeb?[2,Promise.resolve({orderId:""})]:[2,Promise.reject(Me("createOrderIAP",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),lc.apply(this,arguments)}var dc=ge((function(){return Ee(this,(function(e){return[2,new Promise((function(e,t){nn("MA_MENU_MINIMIZE",{},{success:function(t){e(t)},fail:function(e){t(e)}},{})}))]}))}));function pc(e){return fc.apply(this,arguments)}function fc(){return(fc=ge((function(e){return Ee(this,(function(t){return[2,wn("minimizeApp",[],[e],ge((function(){return Ee(this,(function(e){switch(e.label){case 0:return Ce.isMp?[4,dc()]:[3,2];case 1:return[2,e.sent()];case 2:return Ce.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Me("minimizeApp",{}))]}}))})))]}))}))).apply(this,arguments)}var hc=ge((function(){return Ee(this,(function(e){return[2,new Promise((function(e,t){nn("MA_MENU_PERMISSION",{},{success:function(t){e(t)},fail:function(e){t(e)}},{}),e()}))]}))}));function mc(e){return vc.apply(this,arguments)}function vc(){return(vc=ge((function(e){return Ee(this,(function(t){return[2,wn("openPermissionSetting",[],[e],ge((function(){return Ee(this,(function(e){switch(e.label){case 0:return Ce.isMp?[4,hc()]:[3,2];case 1:return[2,e.sent()];case 2:return Ce.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Me("openPermissionSetting",{}))]}}))})))]}))}))).apply(this,arguments)}var yc=ge((function(){return Ee(this,(function(e){return[2,new Promise((function(e,t){nn("MP_ADD_MYFAVORITES",{timestamp:(new Date).getTime()},{success:function(t){e(t)},fail:function(e){t(e)}},{})}))]}))}));function gc(e){return _c.apply(this,arguments)}function _c(){return(_c=ge((function(e){return Ee(this,(function(t){return[2,wn("favoriteApp",[],[e],ge((function(){return Ee(this,(function(e){switch(e.label){case 0:return Ce.isMp?[4,yc()]:[3,2];case 1:return[2,e.sent()];case 2:return Ce.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Me("favoriteApp",{}))]}}))})))]}))}))).apply(this,arguments)}var wc=ge((function(){return Ee(this,(function(e){return[2,new Promise((function(e,t){nn("OPEN_GROUPLIST",{},{success:function(t){e(t)},fail:function(e){t(e)}},{})}))]}))}));function bc(e){return Tc.apply(this,arguments)}function Tc(){return(Tc=ge((function(e){return Ee(this,(function(t){return[2,wn("openGroupList",[],[e],ge((function(){return Ee(this,(function(e){switch(e.label){case 0:return Ce.isMp?[4,wc()]:[3,2];case 1:return[2,e.sent()];case 2:return Ce.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Me("openGroupList",{}))]}}))})))]}))}))).apply(this,arguments)}var Ec=ge((function(){var e;return Ee(this,(function(t){switch(t.label){case 0:return[4,an.getAccessToken()];case 1:return e=t.sent(),[2,new Promise((function(t,n){nn("MP_SEND_NOTIFICATION",{accessToken:e},{success:function(e){t(e)},fail:function(e){n(e)}},{delay:500})}))]}}))}));function Pc(e){return Sc.apply(this,arguments)}function Sc(){return(Sc=ge((function(e){return Ee(this,(function(t){return[2,wn("requestSendNotification",[],[e],ge((function(){return Ee(this,(function(e){switch(e.label){case 0:return Ce.isMp?[4,Ec()]:[3,2];case 1:return[2,e.sent()];case 2:return Ce.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Me("requestSendNotification",{}))]}}))})))]}))}))).apply(this,arguments)}var Oc=ge((function(){return Ee(this,(function(e){return[2,new Promise((function(e,t){nn("MP_ADD_RATING",{},{success:function(t){e(t)},fail:function(e){t(e)}},{})}))]}))}));function Ac(e){return Ic.apply(this,arguments)}function Ic(){return(Ic=ge((function(e){return Ee(this,(function(t){return[2,wn("addRating",[],[e],ge((function(){return Ee(this,(function(e){switch(e.label){case 0:return Ce.isMp?[4,Oc()]:[3,2];case 1:return[2,e.sent()];case 2:return Ce.isMpWeb?[2,Promise.resolve({})]:[2,Promise.reject(Me("addRating",{}))]}}))})))]}))}))).apply(this,arguments)}var kc,Cc=(kc=ge((function(e,t,n){var r,i;return Ee(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(l.CHECK_INTERACT_OA,xe({method:"POST",body:r},i))];case 1:return[4,o.sent().json()];case 2:return[2,o.sent()]}}))})),function(e,t,n){return kc.apply(this,arguments)}),Nc=function(){var e=ge((function(e){return Ee(this,(function(t){return[2,new Promise((function(t,n){nn("MP_INTERACT_OA",{oaId:e,forceUpdate:!0},{success:function(e){t(e)},fail:function(e){n(e)}},{})}))]}))}));return function(t){return e.apply(this,arguments)}}(),Mc=[si({oaId:Kr()})];function Rc(e){return xc.apply(this,arguments)}function xc(){return xc=ge((function(e){return Ee(this,(function(t){return[2,wn("interactOA",Mc,[e],function(){var e=ge((function(e){var t,n,r;return Ee(this,(function(o){switch(o.label){case 0:return Ce.isMp?(t=e.oaId,[4,an.getAccessToken()]):[3,5];case 1:return!(n=o.sent())||yt.isEmpty(n)?[3,3]:[4,Cc(t,i,n)];case 2:if(0===(null==(r=o.sent())?void 0:r.err))return[2,Promise.resolve({})];o.label=3;case 3:return[4,Nc(t)];case 4:return[2,o.sent()];case 5:return Ce.isMpWeb?[2,Promise.resolve({})]:[2,Promise.reject(Me("interactOA",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),xc.apply(this,arguments)}var Uc=[si({oaId:Kr()})];function Dc(e){return jc.apply(this,arguments)}function jc(){return jc=ge((function(e){return Ee(this,(function(t){return[2,wn("isAllowedInteractWithOA",Uc,[e],function(){var e=ge((function(e){var t,n,r;return Ee(this,(function(o){switch(o.label){case 0:return Ce.isMp?(t=e.oaId,[4,an.getAccessToken()]):[3,4];case 1:return!(n=o.sent())||yt.isEmpty(n)?[3,3]:[4,Cc(t,i,n)];case 2:return r=o.sent(),[2,Promise.resolve({status:0===(null==r?void 0:r.err)})];case 3:return[2,Promise.resolve({status:!1})];case 4:return Ce.isMpWeb?[2,Promise.resolve({status:!1})]:[2,Promise.reject(Me("IsAllowedInteractWithOA",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),jc.apply(this,arguments)}function Lc(e){return Bc.apply(this,arguments)}function Bc(){return(Bc=ge((function(e){return Ee(this,(function(t){return[2,wn("getSetting",[],[e],ge((function(){return Ee(this,(function(e){switch(e.label){case 0:return Ce.isMp?[4,Xt()]:[3,2];case 1:return[2,e.sent()];case 2:return Ce.isMpWeb?[2,Promise.resolve({authSetting:{}})]:[2,Promise.reject(Me("getSetting",{}))]}}))})))]}))}))).apply(this,arguments)}var Zc=ki.enum(["scope.userInfo","scope.userLocation","scope.userPhonenumber"]),zc=[si({scopes:ki.array(Zc).max(2).optional()}).optional()];function Wc(e){return Fc.apply(this,arguments)}function Fc(){return Fc=ge((function(e){return Ee(this,(function(t){return[2,wn("authorize",zc,[e],function(){var e=ge((function(e){var t,n,r,i;return Ee(this,(function(o){switch(o.label){case 0:return Ce.isMp?(n=null==e?void 0:e.scopes,r=Vt(),("android"===(i=((null===(t=ke())||void 0===t?void 0:t.platformName)||"").toLowerCase())&&r<724||"ios"===i&&r<573)&&n&&n.length>0?[2,Promise.reject(tn.error.clientNotSupport())]:[4,rn(null!=n?n:void 0)]):[3,2];case 1:return[2,o.sent()];case 2:return Ce.isMpWeb?[2,Promise.resolve({})]:[2,Promise.reject(Me("authorize",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Fc.apply(this,arguments)}var Gc=ge((function(){return Ee(this,(function(e){return[2,new Promise(function(){var e=ge((function(e,t){var n;return Ee(this,(function(r){switch(r.label){case 0:return yt.isUndefined(ZaloJavaScriptInterface)||"function"!=typeof ZaloJavaScriptInterface.checkCameraPermission?[3,2]:[4,ZaloJavaScriptInterface.checkCameraPermission()];case 1:return n=r.sent(),[2,e({userAllow:"grant"===n})];case 2:return t(tn.error.clientNotSupport()),[2]}}))}));return function(t,n){return e.apply(this,arguments)}}())]}))}));function Hc(e){return wn("checkZaloCameraPermission",[],[e],ge((function(){return Ee(this,(function(e){switch(e.label){case 0:return[4,Gc()];case 1:return[2,e.sent()]}}))})))}var Vc=ge((function(){return Ee(this,(function(e){return[2,new Promise(function(){var e=ge((function(e,t){var n,r,i;return Ee(this,(function(o){switch(o.label){case 0:return o.trys.push([0,2,,3]),[4,an.jumpAndGetToken()];case 1:return o.sent(),r=null===(n=an.miniProgramConfig)||void 0===n?void 0:n.userId,e(r),[3,3];case 2:return i=o.sent(),t(i),[3,3];case 3:return[2]}}))}));return function(t,n){return e.apply(this,arguments)}}())]}))}));function Kc(e){return Jc.apply(this,arguments)}function Jc(){return(Jc=ge((function(e){return Ee(this,(function(t){return[2,wn("getUserID",[],[e],ge((function(){return Ee(this,(function(e){switch(e.label){case 0:return Ce.isMp?[4,Vc()]:[3,2];case 1:return[2,e.sent()];case 2:return Ce.isMpWeb?[2,Promise.resolve(void 0)]:[2,Promise.reject(Me("getUserID",{}))]}}))})))]}))}))).apply(this,arguments)}var qc=ge((function(){return Ee(this,(function(e){return[2,new Promise(function(){var e=ge((function(e,t){var n,r,i;return Ee(this,(function(o){switch(o.label){case 0:return o.trys.push([0,2,,3]),[4,an.jumpAndGetToken()];case 1:return o.sent(),r=null===(n=an.miniProgramConfig)||void 0===n?void 0:n.idToken,e(r),[3,3];case 2:return i=o.sent(),t(i),[3,3];case 3:return[2]}}))}));return function(t,n){return e.apply(this,arguments)}}())]}))}));function Qc(e){return $c.apply(this,arguments)}function $c(){return($c=ge((function(e){return Ee(this,(function(t){return[2,wn("getIDToken",[],[e],ge((function(){return Ee(this,(function(e){switch(e.label){case 0:return Ce.isMp?[4,qc()]:[3,2];case 1:return[2,e.sent()];case 2:return Ce.isMpWeb?[2,Promise.resolve(void 0)]:[2,Promise.reject(Me("getIDToken",{}))]}}))})))]}))}))).apply(this,arguments)}var Yc={format:C.JPEG,quality:N.NORMAL,mirrored:!1,useVideoSourceSize:!1},Xc={width:1024,height:768,facingMode:k.FRONT,mirrored:!1,audio:!1,video:!0},el=function(){function e(t){var n,r,i,o,a,s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,u=this;gt(this,e),this._videoEnabled=!0,this._audioEnabled=null,this.tick=function(){if(u.haveVideoStream()&&u._userRequestFrameCallback){var e=u.getCanvas();if(u.drawFrame(),e){var t={data:e.toDataURL(C.PNG),width:e.width,height:e.height};Mt.getInstance().emit(I.OnFrameCallback,0,t),requestAnimationFrame(u.tick)}}},this._videoElement=t,this._mediaConstraints=null!=s?s:null,this._facingMode=null!==(n=null==s?void 0:s.facingMode)&&void 0!==n?n:Xc.facingMode,this._cameraList=[],this._stream=null,this._selectedDeviceId=null!==(r=null==s?void 0:s.deviceId)&&void 0!==r?r:"",this._canvasElement=null,this._ctx=null,this._hasUserMedia=!1,this._mirror=null!==(i=null==s?void 0:s.mirrored)&&void 0!==i?i:Xc.mirrored,this._userRequestFrameCallback=!1,this._audioEnabled=null!==(o=null==s?void 0:s.audio)&&void 0!==o?o:Xc.audio,this._videoEnabled=null!==(a=null==s?void 0:s.video)&&void 0!==a?a:Xc.video}var t=e.prototype;return t.on=function(e,t){Mt.getInstance().on(e,(function(e){t(e)})),e===I.OnFrameCallback&&(this._userRequestFrameCallback=!0,this.tick())},t.off=function(e){Mt.getInstance().off(e),e===I.OnFrameCallback&&(this._userRequestFrameCallback=!1)},t.getQualityNumber=function(e){switch(e){case"high":return.9;case"normal":default:return.6;case"low":return.2}},t.getFacingMode=function(){return this._facingMode},t.getCameraList=function(){return this._cameraList},t.getCameraCount=function(){return this._cameraList.length},t.getSelectedDeviceId=function(){return this._selectedDeviceId},t.setDeviceId=function(e){var t=this;return ge((function(){return Ee(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]}}))}))()},t.getVideoInputs=function(e){var t=this;return this._cameraList=[],e.forEach((function(e){"videoinput"===e.kind&&t._cameraList.push(e)})),this._cameraList},t.updateMediaConstraints=function(e){var t=this;return ge((function(){var n,r,i,o,a,s;return Ee(this,(function(u){switch(u.label){case 0:return yt.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]}}))}))()},t.getCurrentMediaConstraints=function(){var e=this._mediaConstraints,t={};this._videoElement.width=(null==e?void 0:e.width)||this._videoElement.width||Xc.width,this._videoElement.height=(null==e?void 0:e.height)||this._videoElement.height||Xc.height;var n=!1!==this._videoEnabled,r=!1!==this._audioEnabled;return n&&(""==this._selectedDeviceId&&null!==this._facingMode?t.facingMode=this._facingMode:t.deviceId={exact:this._selectedDeviceId},t.width={exact:this._videoElement.width},t.height={exact:this._videoElement.height}),{video:!!n&&t,audio:r}},t.selectCamera=function(){var e=!0,t=!1,n=void 0;try{for(var r,i=this._cameraList[Symbol.iterator]();!(e=(r=i.next()).done);e=!0){var o=r.value;if(this._facingMode==k.FRONT&&o.label.toLowerCase().includes("front")||this._facingMode==k.BACK&&o.label.toLowerCase().includes("back")){this._selectedDeviceId=o.deviceId;break}}}catch(e){t=!0,n=e}finally{try{e||null==i.return||i.return()}finally{if(t)throw n}}},t.flip=function(){var e=this;return ge((function(){return Ee(this,(function(t){switch(t.label){case 0:return e._facingMode=e._facingMode==k.FRONT?k.BACK:k.FRONT,e._videoElement.style.transform="",e.selectCamera(),e._hasUserMedia?[4,e.stream()]:[3,2];case 1:t.sent(),t.label=2;case 2:return[2]}}))}))()},t.start=function(){var e=this;return ge((function(){var t,n;return Ee(this,(function(r){return t=Mt.getInstance(),n=function(t){try{e._hasUserMedia&&e.stop()}catch(e){}},t.off(f.AppPaused,n),t.on(f.AppPaused,n),[2,new Promise(function(){var t=ge((function(t,n){var r;return Ee(this,(function(i){switch(i.label){case 0:return i.trys.push([0,2,,3]),[4,e.stream()];case 1:return i.sent(),Mt.getInstance().emit(I.OnStartCallback,0),t(e._selectedDeviceId),[3,3];case 2:return r=i.sent(),n(r),[3,3];case 3:return[2]}}))}));return function(e,n){return t.apply(this,arguments)}}())]}))}))()},t.info=function(){var e=this;return ge((function(){return Ee(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)}))}))]}))}))()},t.stream=function(){var e=this;return ge((function(){return Ee(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=ge((function(n){return Ee(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)}}))]}))}))()},t.handleUserMedia=function(e,t){var n=this;if(!e&&t){this._stream=t;try{this._videoElement&&(this._videoElement.srcObject=t,(this._facingMode==k.FRONT||this._mirror)&&(this._videoElement.style.transform="scale(-1,1)"),this._videoElement.onloadedmetadata=function(){n._userRequestFrameCallback&&n.tick()},this._videoElement.play().then((function(){n._hasUserMedia=!0})).catch((function(e){n._hasUserMedia=!1})))}catch(e){this._hasUserMedia=!1}}else this._hasUserMedia=!1},t.updateTrackEnable=function(e,t){var n=this;return ge((function(){return Ee(this,(function(r){switch(r.label){case 0:if(e===M.VIDEO){if(n._videoEnabled===t)return[2];n._videoEnabled=t}else{if(n._audioEnabled===t)return[2];n._audioEnabled=t}return[4,n.stream()];case 1:return r.sent(),[2]}}))}))()},t.pause=function(e){var t=this;return ge((function(){return Ee(this,(function(n){switch(n.label){case 0:return[4,t.updateTrackEnable(e,!1)];case 1:return n.sent(),[2]}}))}))()},t.resume=function(e){var t=this;return ge((function(){return Ee(this,(function(n){switch(n.label){case 0:return[4,t.updateTrackEnable(e,!0)];case 1:return n.sent(),[2]}}))}))()},t.isUsing=function(){return this._hasUserMedia},t.stop=function(){this._stop(),Mt.getInstance().emit(I.OnStopCallback,0)},t._stop=function(){e.stopMediaStream(this._stream),this._hasUserMedia=!1},t.setFacingMode=function(e){this._facingMode=e},t.setMirror=function(e){this._mirror=e,this._videoElement&&(this._videoElement.style.transform=e?"scale(-1,1)":"")},t.takePhoto=function(e){if(!this._hasUserMedia)return null;var t=e||{},n=this.getCanvas(t);if(this.drawFrame(t),n){var r=t.format||Yc.format;return{data:n.toDataURL(r,this.getQualityNumber(t.quality)),width:n.width,height:n.height}}return null},t.haveVideoStream=function(){var e=this._videoElement;return e&&e.videoHeight>0&&this._hasUserMedia},t.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},t.drawFrame=function(e){var t=this._videoElement,n=e||{};if(t&&this._ctx&&this._canvasElement){var r=this._canvasElement,i=this._ctx;r.width=(null==n?void 0:n.width)||r.width,r.height=(null==n?void 0:n.height)||r.height,((null==n?void 0:n.mirrored)||this._mirror||this._facingMode===k.FRONT)&&(i.translate(r.width,0),i.scale(-1,1)),i.drawImage(t,0,0,r.width,r.height),((null==n?void 0:n.mirrored)||this._mirror||this._facingMode===k.FRONT)&&(i.scale(-1,1),i.translate(-r.width,0))}},e.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())},e}(),tl=si({play:ki.function(),pause:ki.function()}).refine((function(e){return"play"in e&&"pause"in e}),{message:"Invalid HTMLVideoElement"}),nl=[si({videoElement:tl,mediaConstraints:ki.object({width:ki.number().min(100).optional(),height:ki.number().min(100).optional(),facingMode:ki.string().optional(),audio:ki.boolean().optional(),video:ki.boolean().optional(),deviceId:ki.string().optional(),mirrored:ki.boolean().optional()}).nullish()}).optional()];function rl(e){return wn("createCameraContext",nl,[e],(function(e){return console.log("createCameraContext",e),new el(e.videoElement,e.mediaConstraints)}))}var il=function(){function e(){var t,n;gt(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=Te(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;yt.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?yt.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?yt.isFunction(null===(t=window.AdtimaZMA)||void 0===t?void 0:t.refresh)&&window.AdtimaZMA.refresh(e):this.queue.push(this.refresh.bind(this,e))},t.processQueue=function(){for(;this.queue.length>0;){var e=this.queue.shift();e&&e()}},e.getInstance=function(){return e.instance||(e.instance=new e),e.instance},e}();function ol(e){return al.apply(this,arguments)}function al(){return(al=ge((function(e){return Ee(this,(function(t){return[2,wn("setupAd",[],[e],(function(){return il.getInstance().loadSDK()}))]}))}))).apply(this,arguments)}var sl=[si({ids:ki.union([ki.string(),ki.array(ki.string())]),config:si({display:ki.boolean().optional(),onClose:ki.function().optional()}).optional()})];function ul(e){return cl.apply(this,arguments)}function cl(){return cl=ge((function(e){return Ee(this,(function(t){return[2,wn("loadAd",sl,[e],function(){var e=ge((function(e){return Ee(this,(function(t){return il.getInstance().load(e.ids,e.config),[2]}))}));return function(t){return e.apply(this,arguments)}}())]}))})),cl.apply(this,arguments)}var ll=[si({id:ki.string()})];function dl(e){return pl.apply(this,arguments)}function pl(){return pl=ge((function(e){return Ee(this,(function(t){return[2,wn("displayAd",ll,[e],function(){var e=ge((function(e){return Ee(this,(function(t){return il.getInstance().display(e.id),[2]}))}));return function(t){return e.apply(this,arguments)}}())]}))})),pl.apply(this,arguments)}var fl=[si({id:ki.string().optional()}).optional()];function hl(e){return ml.apply(this,arguments)}function ml(){return ml=ge((function(e){return Ee(this,(function(t){return[2,wn("refreshAd",fl,[e],function(){var e=ge((function(e){return Ee(this,(function(t){return il.getInstance().refresh(e.id),[2]}))}));return function(t){return e.apply(this,arguments)}}())]}))})),ml.apply(this,arguments)}var vl=[si({id:Kr(),guidingText:Kr().optional(),color:Kr().optional(),onStatusChange:ki.function().optional()})];function yl(e){return gl.apply(this,arguments)}function gl(){return gl=ge((function(t){return Ee(this,(function(n){return[2,wn("showOAWidget",vl,[t],function(){var t=ge((function(t){var n,r,i,o,a,s,u,c;return Ee(this,(function(l){if(Ce.isMp){try{n=document.getElementById(t.id),r=t.onStatusChange,i=t.guidingText,o=t.color,a=e(t,["onStatusChange","guidingText","color"]),n&&(s=document.createElement("iframe"),u="iframeOAWidget_".concat(Date.now()),(c=new URL("https://h5.zalo.me/widgets/oa_widget.html")).searchParams.set("id",u),i&&c.searchParams.set("guidingText",i),o&&c.searchParams.set("color",o),Object.entries(a).forEach((function(e){var t=Ue(e,2),n=t[0],r=t[1];r&&c.searchParams.set("data-".concat(n),String(r))})),s.id=u,s.src=c.href,s.style.width="100%",s.style.height="100%",s.style.border="none",n.innerHTML=s.outerHTML,window.addEventListener("message",function(){var e=ge((function(e){var t,n,i,o,a,s,l,d;return Ee(this,(function(p){switch(p.label){case 0:return t=e.data,e.origin.startsWith("https://h5.zalo.me")?(n=document.getElementById(u),i=t.type,(o=new URL(t.href)).origin!==c.origin||o.pathname!==c.pathname||t.id!==u?[3,3]:"followOA"!==i&&"getOAInfo"!==i?[3,2]:[4,an.jumpAndGetToken()]):[3,3];case 1:return p.sent(),l=null===(a=an.miniProgramConfig)||void 0===a?void 0:a.jwt,null==n||null===(s=n.contentWindow)||void 0===s||s.postMessage({type:i,payload:{jwt:l}},"*"),[3,3];case 2:"oaInfo"===i?null==r||r(null===(d=t.payload)||void 0===d?void 0:d.followed):"openOA"===i?$o(t.payload.id,"oa"):"heightChange"===i&&(n.style.height="".concat(t.payload,"px")),p.label=3;case 3:return[2]}}))}));return function(t){return e.apply(this,arguments)}}(),!1))}catch(e){console.log(e)}return[2,Promise.resolve()]}return Ce.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Me("openMiniApp",{}))]}))}));return function(e){return t.apply(this,arguments)}}())]}))})),gl.apply(this,arguments)}var _l=[si({id:Kr(),type:Kr(),text:Kr(),color:Kr().optional(),disabled:ki.boolean().optional(),onDataReceived:ki.function().optional(),onError:ki.function().optional()})];function wl(e){return bl.apply(this,arguments)}function bl(){return bl=ge((function(t){return Ee(this,(function(n){return[2,wn("showFunctionButtonWidget",_l,[t],function(){var t=ge((function(t){var n,r,i,o,a,s,u;return Ee(this,(function(c){if(Ce.isMp){try{n=document.getElementById(t.id),r=t.onDataReceived,i=t.onError,o=e(t,["onDataReceived","onError"]),n&&(a=document.createElement("iframe"),s="iframeFunctionButtonWidget".concat(Date.now()),(u=new URL("https://h5.zalo.me/widgets/function_button_widget.html")).searchParams.set("id",s),Object.entries(o).forEach((function(e){var t=Ue(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=Ue(e,2),n=t[0],r=t[1];r&&a.setAttribute("data-".concat(n),String(r))})),n.innerHTML=a.outerHTML,window.addEventListener("message",function(){var e=ge((function(e){var t,n,a,c,l,d,p,f,h,m,v,y;return Ee(this,(function(g){switch(g.label){case 0:return t=e.data,e.origin.startsWith("https://h5.zalo.me")?(n=document.getElementById(s),a=t.type,(c=new URL(t.href)).origin!==u.origin||c.pathname!==u.pathname||t.id!==s?[3,4]:"buttonClicked"!==a?[3,3]:[4,an.jumpAndGetToken()]):[3,4];case 1:return g.sent(),f=null===(l=an.miniProgramConfig)||void 0===l?void 0:l.jwt,h=null===(d=an.miniProgramConfig)||void 0===d?void 0:d.encryptKey,[4,En()];case 2:return m=g.sent(),null==n||null===(p=n.contentWindow)||void 0===p||p.postMessage({type:a,payload:{jwt:f,encryptKey:h,accessToken:m}},"*"),[3,4];case 3:"onSuccess"===a?(null==(v=t.payload)?void 0:v.type)===o.type&&(null==r||r(null==v?void 0:v.data)):"onError"===a&&(null==(y=t.payload)?void 0:y.type)===o.type&&(null==i||i(null==y?void 0:y.data)),g.label=4;case 4:return[2]}}))}));return function(t){return e.apply(this,arguments)}}(),!1))}catch(e){console.log(e)}return[2,Promise.resolve()]}return Ce.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Me("openMiniApp",{}))]}))}));return function(e){return t.apply(this,arguments)}}())]}))})),bl.apply(this,arguments)}window.ZaloMiniAppSDK={getVersion:An},bn();var Tl=Object.freeze({__proto__:null,get Events(){return f},get EventName(){return f},get CameraEvents(){return I},login:bn,getAccessToken:En,getVersion:An,getSystemInfo:kn,setNavigationBarTitle:Ri,setNavigationBarColor:Di,setNavigationBarLeftButton:Bi,setStorage:po,getStorage:mo,getStorageInfo:yo,removeStorage:wo,clearStorage:Eo,getUserInfo:Ao,getNetworkType:No,onNetworkStatusChange:xo,startBeaconDiscovery:jo,stopBeaconDiscovery:Zo,getBeacons:Fo,closeApp:Vo,scanQRCode:qo,openProfile:Xo,openChat:ra,openPostFeed:ua,followOA:pa,unfollowOA:va,openShareSheet:ba,requestCameraPermission:Pa,createShortcut:Ca,openBioAuthentication:xa,checkStateBioAuthentication:ja,showToast:za,hideKeyboard:Ga,openPhone:Ja,openSMS:Ya,viewOAQr:ns,keepScreen:as,onKeepScreen:us,offKeepScreen:ls,saveImageToGallery:hs,openMiniApp:gs,vibrate:Ts,openWebview:Os,getRouteParams:ks,getAppInfo:Cs,sendDataToPreviousMiniApp:xs,getPhoneNumber:js,openProfilePicker:zs,connectWifi:Hs,openMediaPicker:qs,getShareableLink:Ys,closeLoading:tu,requestUpdateZalo:ru,onConfirmToExit:su,offConfirmToExit:uu,getDeviceId:cu,getDeviceIdAsync:lu,getContext:pu,getContextAsync:fu,getAuthCode:mu,getZPIToken:yu,setAccessToken:wu,openOutApp:Tu,chooseImage:Su,getLocation:Iu,onCallbackData:Nu,createOrder:Uu,purchase:Zu,selectPaymentMethod:Gu,checkTransaction:Ku,events:ou,setAndroidBottomNavigationBar:Qu,setIOSBottomSafeArea:Xu,setStatusBar:nc,configAppView:oc,createOrderIAP:cc,minimizeApp:pc,openPermissionSetting:mc,favoriteApp:gc,openGroupList:bc,requestSendNotification:Pc,addRating:Ac,interactOA:Rc,interactOa:Rc,isAllowedInteractWithOA:Dc,getSetting:Lc,authorize:Wc,checkZaloCameraPermission:Hc,getUserID:Kc,getIDToken:Qc,createCameraContext:rl,setupAd:ol,loadAd:ul,displayAd:dl,refreshAd:hl,showOAWidget:yl,showFunctionButtonWidget:wl,get FacingMode(){return k},get PhotoFormat(){return C},get PhotoQuality(){return N},get StreamType(){return M},ZMACameraImp:el}),El=Uu,Pl=Ku,Sl=cc,Ol=Gu,Al=Zu,Il=e(Tl,["createOrder","checkTransaction","createOrderIAP","selectPaymentMethod","purchase"]),kl={createOrder:El,checkTransaction:Pl,createOrderIAP:Sl,selectPaymentMethod:Ol},Cl={selectPaymentMethod:Ol,purchase:Al};!function(){var e,t=null===(e=ke())||void 0===e?void 0:e.appEnv;(null==t?void 0:t.isMp)&&(window.ZaloMiniAppSDK={},Object.assign(window.ZaloMiniAppSDK,Tl))}();var Nl=Object.freeze({__proto__:null,Payment:kl,CheckoutSDK:Cl,default:Il,get Events(){return f},get EventName(){return f},get CameraEvents(){return I},login:bn,getAccessToken:En,getVersion:An,getSystemInfo:kn,setNavigationBarTitle:Ri,setNavigationBarColor:Di,setNavigationBarLeftButton:Bi,setStorage:po,getStorage:mo,getStorageInfo:yo,removeStorage:wo,clearStorage:Eo,getUserInfo:Ao,getNetworkType:No,onNetworkStatusChange:xo,startBeaconDiscovery:jo,stopBeaconDiscovery:Zo,getBeacons:Fo,closeApp:Vo,scanQRCode:qo,openProfile:Xo,openChat:ra,openPostFeed:ua,followOA:pa,unfollowOA:va,openShareSheet:ba,requestCameraPermission:Pa,createShortcut:Ca,openBioAuthentication:xa,checkStateBioAuthentication:ja,showToast:za,hideKeyboard:Ga,openPhone:Ja,openSMS:Ya,viewOAQr:ns,keepScreen:as,onKeepScreen:us,offKeepScreen:ls,saveImageToGallery:hs,openMiniApp:gs,vibrate:Ts,openWebview:Os,getRouteParams:ks,getAppInfo:Cs,sendDataToPreviousMiniApp:xs,getPhoneNumber:js,openProfilePicker:zs,connectWifi:Hs,openMediaPicker:qs,getShareableLink:Ys,closeLoading:tu,requestUpdateZalo:ru,onConfirmToExit:su,offConfirmToExit:uu,getDeviceId:cu,getDeviceIdAsync:lu,getContext:pu,getContextAsync:fu,getAuthCode:mu,getZPIToken:yu,setAccessToken:wu,openOutApp:Tu,chooseImage:Su,getLocation:Iu,onCallbackData:Nu,createOrder:Uu,purchase:Zu,selectPaymentMethod:Gu,checkTransaction:Ku,events:ou,setAndroidBottomNavigationBar:Qu,setIOSBottomSafeArea:Xu,setStatusBar:nc,configAppView:oc,createOrderIAP:cc,minimizeApp:pc,openPermissionSetting:mc,favoriteApp:gc,openGroupList:bc,requestSendNotification:Pc,addRating:Ac,interactOA:Rc,interactOa:Rc,isAllowedInteractWithOA:Dc,getSetting:Lc,authorize:Wc,checkZaloCameraPermission:Hc,getUserID:Kc,getIDToken:Qc,createCameraContext:rl,setupAd:ol,loadAd:ul,displayAd:dl,refreshAd:hl,showOAWidget:yl,showFunctionButtonWidget:wl,get FacingMode(){return k},get PhotoFormat(){return C},get PhotoQuality(){return N},get StreamType(){return M},ZMACameraImp:el,get NetworkType(){return d},get PlatformType(){return p},get JumpStatus(){return h},get ProfileType(){return m},get ChatType(){return v},get PostFeedType(){return y},get ShareSheetType(){return g},get OrientationType(){return _},get VibrateType(){return w},get MediaPickerType(){return b},get IAPPayType(){return T},get ProrationMode(){return E},get StatusBarType(){return P},get AndroidBottomNavigationBarType(){return S},get IOSSafeAreaBottomType(){return O},get TextAlignType(){return A}});window.ZaloMiniAppSDK=Nl}();