zmp-sdk 2.37.1 → 2.37.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index.umd.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @timeBuild 03-04-2024 13:55:04
2
+ * @timeBuild 26-04-2024 11:00:33
3
3
  * @license zmp-sdk
4
4
  *
5
5
  * Copyright @ 2024. Zalo Group.
@@ -7,7 +7,7 @@
7
7
  * This source code is licensed under the MIT license found in the LICENSE file in the root directory of this source tree.
8
8
  */
9
9
 
10
- !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self)["zmp-sdk"]={})}(this,(function(e){"use strict";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 p,d=0,f=-2e3,h=-1400,m=-1500,v=-1401,y=-1404,g=-1408,_=-2004,w=-2005,b="Success",T="Unknown error. Please try again later.",E="Request timeout. Please try again later.",S="Please login (https://miniapp.zalo.me/docs/api/login) before to call this api",A="Login failed",O="This API is not supported in this version of Zalo",P="User Authentication Required. Please grant User Authentication permission before requesting User Permission",k="Unable to pick media",I="Unable to save image",N={SUCCESS:{code:d,message:b},UNKNOWN_ERROR:{code:f,message:T},UNAUTHORIZED:{code:v,message:S},FORBIDDEN:{code:-1403,message:"You don't have permission to call this api"},CLIENT_NOT_SUPPORT:{code:y,message:O},DECODE_FAILED:{code:-2001,message:"Can not decode id. Please check your params again."},TIME_OUT:{code:g,message:E},USER_DENIED:{code:-2002,message:"User denied"},USER_CANCEL:{code:-2003,message:"User cancel"}},C={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},REQUEST_PERMISSION_CAMERA:{errorList:{android:{"-2":{mapTo:N.USER_DENIED}},iOS:{"-2":{mapTo:N.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:N.USER_DENIED}},iOS:{"-1":{mapTo:N.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:w,message:I},needMoreDetail:!0},"-102":{mapTo:{code:w,message:I},needMoreDetail:!0}},iOS:{"-10":{mapTo:{code:w,message:I},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:N.USER_DENIED},"-101":{mapTo:N.USER_DENIED}},iOS:{"-1":{mapTo:N.USER_DENIED},"-10":{mapTo:N.USER_DENIED}}}},MP_OPEN_PROFILE_PICKER:{requireAccessToken:!0,versionLive:{iOS:432},errorList:{android:{"-101":{mapTo:N.USER_CANCEL}},iOS:{"-101":{mapTo:N.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:N.USER_CANCEL},999:{mapTo:{code:_,message:k},needMoreDetail:!0}},iOS:{"-10":{mapTo:{code:_,message:k}}}}},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:N.USER_DENIED}},iOS:{"-1":{mapTo:N.USER_DENIED}}}},MP_ADD_RATING:{skipJump:!1},MP_ADD_MYFAVORITES:{skipJump:!1},MP_INTERACT_OA:{skipJump:!1},MP_USER_AUTHORIZE:{skipJump:!1}},M={android:{"-4":N.DECODE_FAILED,"-5":N.CLIENT_NOT_SUPPORT,"-14":N.TIME_OUT},iOS:{"-9":N.DECODE_FAILED,"-5":N.CLIENT_NOT_SUPPORT,"-14":N.TIME_OUT}},x={android:12100615,iOS:460,wp:0,unknown:0},R=5*n,j="https://payment-mini.zalo.me/api/order/create",D="https://payment-mini.zalo.me/api/order/iap-create",U="https://payment-mini.zalo.me/api/transaction",B="DEFERRED",Z="IMMEDIATE_AND_CHARGE_FULL_PRICE",L={SHOW_BACK:0,HIDE_BACK:3,SHOW_HOME:1,HIDE_HOME:0},z=5,W=6,G="#1843EF",F=0,H={"-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 K(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 V(e){return function(){var t=this,n=arguments;return new Promise((function(r,i){var o=e.apply(t,n);function a(e){K(o,r,i,a,s,"next",e)}function s(e){K(o,r,i,a,s,"throw",e)}a(void 0)}))}}function J(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 q(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function $(e,t){if(e){if("string"==typeof e)return J(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)?J(e,t):void 0}}function Y(e){return function(e){if(Array.isArray(e))return J(e)}(e)||q(e)||$(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 Q(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 X(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,Y(n))}catch(e){return"undefined"!=typeof console&&console.error&&console.error(e),null}}}X.async=function(e){return V((function(){var t,n,r,i,o=arguments;return Q(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,Y(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.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}(p||(p={}));const ee=p.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),te=e=>{switch(typeof e){case"undefined":return ee.undefined;case"string":return ee.string;case"number":return isNaN(e)?ee.nan:ee.number;case"boolean":return ee.boolean;case"function":return ee.function;case"bigint":return ee.bigint;case"symbol":return ee.symbol;case"object":return Array.isArray(e)?ee.array:null===e?ee.null:e.then&&"function"==typeof e.then&&e.catch&&"function"==typeof e.catch?ee.promise:"undefined"!=typeof Map&&e instanceof Map?ee.map:"undefined"!=typeof Set&&e instanceof Set?ee.set:"undefined"!=typeof Date&&e instanceof Date?ee.date:ee.object;default:return ee.unknown}},ne=p.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 re 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,p.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()}}re.create=e=>new re(e);const ie=(e,t)=>{let n;switch(e.code){case ne.invalid_type:n=e.received===ee.undefined?"Required":`Expected ${e.expected}, received ${e.received}`;break;case ne.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(e.expected,p.jsonStringifyReplacer)}`;break;case ne.unrecognized_keys:n=`Unrecognized key(s) in object: ${p.joinValues(e.keys,", ")}`;break;case ne.invalid_union:n="Invalid input";break;case ne.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${p.joinValues(e.options)}`;break;case ne.invalid_enum_value:n=`Invalid enum value. Expected ${p.joinValues(e.options)}, received '${e.received}'`;break;case ne.invalid_arguments:n="Invalid function arguments";break;case ne.invalid_return_type:n="Invalid function return type";break;case ne.invalid_date:n="Invalid date";break;case ne.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}"`:p.assertNever(e.validation):n="regex"!==e.validation?`Invalid ${e.validation}`:"Invalid";break;case ne.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 ne.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 ne.custom:n="Invalid input";break;case ne.invalid_intersection_types:n="Intersection results could not be merged";break;case ne.not_multiple_of:n=`Number must be a multiple of ${e.multipleOf}`;break;case ne.not_finite:n="Number must be finite";break;default:n=t.defaultError,p.assertNever(e)}return{message:n}};let oe=ie;function ae(){return oe}const se=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 ue(e,t){const n=se({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,ae(),ie].filter((e=>!!e))});e.common.issues.push(n)}class ce{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 le;"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 ce.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 le;if("aborted"===i.status)return le;"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 le=Object.freeze({status:"aborted"}),pe=e=>({status:"dirty",value:e}),de=e=>({status:"valid",value:e}),fe=e=>"aborted"===e.status,he=e=>"dirty"===e.status,me=e=>"valid"===e.status,ve=e=>"undefined"!=typeof Promise&&e instanceof Promise;var ye;!function(e){e.errToObj=e=>"string"==typeof e?{message:e}:e||{},e.toString=e=>"string"==typeof e?e:null==e?void 0:e.message}(ye||(ye={}));class ge{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 _e=(e,t)=>{if(me(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 re(e.common.issues)}};function we(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 be{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 te(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:te(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new ce,ctx:{common:e.parent.common,data:e.data,parsedType:te(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const t=this._parse(e);if(ve(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:te(e)},i=this._parseSync({data:e,path:r.path,parent:r});return _e(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:te(e)},r=this._parse({data:e,path:n.path,parent:n}),i=await(ve(r)?r:Promise.resolve(r));return _e(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:ne.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 ot({schema:this,typeName:vt.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}optional(){return at.create(this,this._def)}nullable(){return st.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Ze.create(this,this._def)}promise(){return it.create(this,this._def)}or(e){return Ge.create([this,e],this._def)}and(e){return Ve.create(this,e,this._def)}transform(e){return new ot({...we(this._def),schema:this,typeName:vt.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const t="function"==typeof e?e:()=>e;return new ut({...we(this._def),innerType:this,defaultValue:t,typeName:vt.ZodDefault})}brand(){return new dt({typeName:vt.ZodBranded,type:this,...we(this._def)})}catch(e){const t="function"==typeof e?e:()=>e;return new ct({...we(this._def),innerType:this,catchValue:t,typeName:vt.ZodCatch})}describe(e){return new(0,this.constructor)({...this._def,description:e})}pipe(e){return ft.create(this,e)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const Te=/^c[^\s-]{8,}$/i,Ee=/^[a-z][a-z0-9]*$/,Se=/^([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,Ae=/^(([^<>()[\]\\.,;:\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 Oe extends be{constructor(){super(...arguments),this._regex=(e,t,n)=>this.refinement((t=>e.test(t)),{validation:t,code:ne.invalid_string,...ye.errToObj(n)}),this.nonempty=e=>this.min(1,ye.errToObj(e)),this.trim=()=>new Oe({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}_parse(e){this._def.coerce&&(e.data=String(e.data));if(this._getType(e)!==ee.string){const t=this._getOrReturnCtx(e);return ue(t,{code:ne.invalid_type,expected:ee.string,received:t.parsedType}),le}const t=new ce;let n;for(const i of this._def.checks)if("min"===i.kind)e.data.length<i.value&&(n=this._getOrReturnCtx(e,n),ue(n,{code:ne.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),ue(n,{code:ne.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?ue(n,{code:ne.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}):o&&ue(n,{code:ne.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}),t.dirty())}else if("email"===i.kind)Ae.test(e.data)||(n=this._getOrReturnCtx(e,n),ue(n,{validation:"email",code:ne.invalid_string,message:i.message}),t.dirty());else if("uuid"===i.kind)Se.test(e.data)||(n=this._getOrReturnCtx(e,n),ue(n,{validation:"uuid",code:ne.invalid_string,message:i.message}),t.dirty());else if("cuid"===i.kind)Te.test(e.data)||(n=this._getOrReturnCtx(e,n),ue(n,{validation:"cuid",code:ne.invalid_string,message:i.message}),t.dirty());else if("cuid2"===i.kind)Ee.test(e.data)||(n=this._getOrReturnCtx(e,n),ue(n,{validation:"cuid2",code:ne.invalid_string,message:i.message}),t.dirty());else if("url"===i.kind)try{new URL(e.data)}catch(r){n=this._getOrReturnCtx(e,n),ue(n,{validation:"url",code:ne.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),ue(n,{validation:"regex",code:ne.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),ue(n,{code:ne.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),ue(n,{code:ne.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),ue(n,{code:ne.invalid_string,validation:"datetime",message:i.message}),t.dirty())}else p.assertNever(i);var r;return{status:t.value,value:e.data}}_addCheck(e){return new Oe({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...ye.errToObj(e)})}url(e){return this._addCheck({kind:"url",...ye.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...ye.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...ye.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...ye.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,...ye.errToObj(null==e?void 0:e.message)})}regex(e,t){return this._addCheck({kind:"regex",regex:e,...ye.errToObj(t)})}startsWith(e,t){return this._addCheck({kind:"startsWith",value:e,...ye.errToObj(t)})}endsWith(e,t){return this._addCheck({kind:"endsWith",value:e,...ye.errToObj(t)})}min(e,t){return this._addCheck({kind:"min",value:e,...ye.errToObj(t)})}max(e,t){return this._addCheck({kind:"max",value:e,...ye.errToObj(t)})}length(e,t){return this._addCheck({kind:"length",value:e,...ye.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 Pe(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)}Oe.create=e=>{var t;return new Oe({checks:[],typeName:vt.ZodString,coerce:null!==(t=null==e?void 0:e.coerce)&&void 0!==t&&t,...we(e)})};class ke extends be{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)!==ee.number){const t=this._getOrReturnCtx(e);return ue(t,{code:ne.invalid_type,expected:ee.number,received:t.parsedType}),le}let t;const n=new ce;for(const r of this._def.checks)if("int"===r.kind)p.isInteger(e.data)||(t=this._getOrReturnCtx(e,t),ue(t,{code:ne.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),ue(t,{code:ne.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),ue(t,{code:ne.too_big,maximum:r.value,type:"number",inclusive:r.inclusive,exact:!1,message:r.message}),n.dirty())}else"multipleOf"===r.kind?0!==Pe(e.data,r.value)&&(t=this._getOrReturnCtx(e,t),ue(t,{code:ne.not_multiple_of,multipleOf:r.value,message:r.message}),n.dirty()):"finite"===r.kind?Number.isFinite(e.data)||(t=this._getOrReturnCtx(e,t),ue(t,{code:ne.not_finite,message:r.message}),n.dirty()):p.assertNever(r);return{status:n.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,ye.toString(t))}gt(e,t){return this.setLimit("min",e,!1,ye.toString(t))}lte(e,t){return this.setLimit("max",e,!0,ye.toString(t))}lt(e,t){return this.setLimit("max",e,!1,ye.toString(t))}setLimit(e,t,n,r){return new ke({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:n,message:ye.toString(r)}]})}_addCheck(e){return new ke({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:ye.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:ye.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:ye.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:ye.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:ye.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:ye.toString(t)})}finite(e){return this._addCheck({kind:"finite",message:ye.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&&p.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)}}ke.create=e=>new ke({checks:[],typeName:vt.ZodNumber,coerce:(null==e?void 0:e.coerce)||!1,...we(e)});class Ie extends be{_parse(e){this._def.coerce&&(e.data=BigInt(e.data));if(this._getType(e)!==ee.bigint){const t=this._getOrReturnCtx(e);return ue(t,{code:ne.invalid_type,expected:ee.bigint,received:t.parsedType}),le}return de(e.data)}}Ie.create=e=>{var t;return new Ie({typeName:vt.ZodBigInt,coerce:null!==(t=null==e?void 0:e.coerce)&&void 0!==t&&t,...we(e)})};class Ne extends be{_parse(e){this._def.coerce&&(e.data=Boolean(e.data));if(this._getType(e)!==ee.boolean){const t=this._getOrReturnCtx(e);return ue(t,{code:ne.invalid_type,expected:ee.boolean,received:t.parsedType}),le}return de(e.data)}}Ne.create=e=>new Ne({typeName:vt.ZodBoolean,coerce:(null==e?void 0:e.coerce)||!1,...we(e)});class Ce extends be{_parse(e){this._def.coerce&&(e.data=new Date(e.data));if(this._getType(e)!==ee.date){const t=this._getOrReturnCtx(e);return ue(t,{code:ne.invalid_type,expected:ee.date,received:t.parsedType}),le}if(isNaN(e.data.getTime())){return ue(this._getOrReturnCtx(e),{code:ne.invalid_date}),le}const t=new ce;let n;for(const r of this._def.checks)"min"===r.kind?e.data.getTime()<r.value&&(n=this._getOrReturnCtx(e,n),ue(n,{code:ne.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),ue(n,{code:ne.too_big,message:r.message,inclusive:!0,exact:!1,maximum:r.value,type:"date"}),t.dirty()):p.assertNever(r);return{status:t.value,value:new Date(e.data.getTime())}}_addCheck(e){return new Ce({...this._def,checks:[...this._def.checks,e]})}min(e,t){return this._addCheck({kind:"min",value:e.getTime(),message:ye.toString(t)})}max(e,t){return this._addCheck({kind:"max",value:e.getTime(),message:ye.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}}Ce.create=e=>new Ce({checks:[],coerce:(null==e?void 0:e.coerce)||!1,typeName:vt.ZodDate,...we(e)});class Me extends be{_parse(e){if(this._getType(e)!==ee.symbol){const t=this._getOrReturnCtx(e);return ue(t,{code:ne.invalid_type,expected:ee.symbol,received:t.parsedType}),le}return de(e.data)}}Me.create=e=>new Me({typeName:vt.ZodSymbol,...we(e)});class xe extends be{_parse(e){if(this._getType(e)!==ee.undefined){const t=this._getOrReturnCtx(e);return ue(t,{code:ne.invalid_type,expected:ee.undefined,received:t.parsedType}),le}return de(e.data)}}xe.create=e=>new xe({typeName:vt.ZodUndefined,...we(e)});class Re extends be{_parse(e){if(this._getType(e)!==ee.null){const t=this._getOrReturnCtx(e);return ue(t,{code:ne.invalid_type,expected:ee.null,received:t.parsedType}),le}return de(e.data)}}Re.create=e=>new Re({typeName:vt.ZodNull,...we(e)});class je extends be{constructor(){super(...arguments),this._any=!0}_parse(e){return de(e.data)}}je.create=e=>new je({typeName:vt.ZodAny,...we(e)});class De extends be{constructor(){super(...arguments),this._unknown=!0}_parse(e){return de(e.data)}}De.create=e=>new De({typeName:vt.ZodUnknown,...we(e)});class Ue extends be{_parse(e){const t=this._getOrReturnCtx(e);return ue(t,{code:ne.invalid_type,expected:ee.never,received:t.parsedType}),le}}Ue.create=e=>new Ue({typeName:vt.ZodNever,...we(e)});class Be extends be{_parse(e){if(this._getType(e)!==ee.undefined){const t=this._getOrReturnCtx(e);return ue(t,{code:ne.invalid_type,expected:ee.void,received:t.parsedType}),le}return de(e.data)}}Be.create=e=>new Be({typeName:vt.ZodVoid,...we(e)});class Ze extends be{_parse(e){const{ctx:t,status:n}=this._processInputParams(e),r=this._def;if(t.parsedType!==ee.array)return ue(t,{code:ne.invalid_type,expected:ee.array,received:t.parsedType}),le;if(null!==r.exactLength){const e=t.data.length>r.exactLength.value,i=t.data.length<r.exactLength.value;(e||i)&&(ue(t,{code:e?ne.too_big:ne.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&&(ue(t,{code:ne.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&&(ue(t,{code:ne.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 ge(t,e,t.path,n))))).then((e=>ce.mergeArray(n,e)));const i=[...t.data].map(((e,n)=>r.type._parseSync(new ge(t,e,t.path,n))));return ce.mergeArray(n,i)}get element(){return this._def.type}min(e,t){return new Ze({...this._def,minLength:{value:e,message:ye.toString(t)}})}max(e,t){return new Ze({...this._def,maxLength:{value:e,message:ye.toString(t)}})}length(e,t){return new Ze({...this._def,exactLength:{value:e,message:ye.toString(t)}})}nonempty(e){return this.min(1,e)}}var Le;function ze(e){if(e instanceof We){const t={};for(const n in e.shape){const r=e.shape[n];t[n]=at.create(ze(r))}return new We({...e._def,shape:()=>t})}return e instanceof Ze?Ze.create(ze(e.element)):e instanceof at?at.create(ze(e.unwrap())):e instanceof st?st.create(ze(e.unwrap())):e instanceof Je?Je.create(e.items.map((e=>ze(e)))):e}Ze.create=(e,t)=>new Ze({type:e,minLength:null,maxLength:null,exactLength:null,typeName:vt.ZodArray,...we(t)}),function(e){e.mergeShapes=(e,t)=>({...e,...t})}(Le||(Le={}));class We extends be{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=p.objectKeys(e);return this._cached={shape:e,keys:t}}_parse(e){if(this._getType(e)!==ee.object){const t=this._getOrReturnCtx(e);return ue(t,{code:ne.invalid_type,expected:ee.object,received:t.parsedType}),le}const{status:t,ctx:n}=this._processInputParams(e),{shape:r,keys:i}=this._getCached(),o=[];if(!(this._def.catchall instanceof Ue&&"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 ge(n,i,n.path,e)),alwaysSet:e in n.data})}if(this._def.catchall instanceof Ue){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&&(ue(n,{code:ne.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 ge(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=>ce.mergeObjectSync(t,e))):ce.mergeObjectSync(t,a)}get shape(){return this._def.shape()}strict(e){return ye.errToObj,new We({...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=ye.errToObj(e).message)&&void 0!==a?a:s}:{message:s}}}:{}})}strip(){return new We({...this._def,unknownKeys:"strip"})}passthrough(){return new We({...this._def,unknownKeys:"passthrough"})}extend(e){return new We({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new We({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>Le.mergeShapes(this._def.shape(),e._def.shape()),typeName:vt.ZodObject})}setKey(e,t){return this.augment({[e]:t})}catchall(e){return new We({...this._def,catchall:e})}pick(e){const t={};return p.objectKeys(e).forEach((n=>{e[n]&&this.shape[n]&&(t[n]=this.shape[n])})),new We({...this._def,shape:()=>t})}omit(e){const t={};return p.objectKeys(this.shape).forEach((n=>{e[n]||(t[n]=this.shape[n])})),new We({...this._def,shape:()=>t})}deepPartial(){return ze(this)}partial(e){const t={};return p.objectKeys(this.shape).forEach((n=>{const r=this.shape[n];e&&!e[n]?t[n]=r:t[n]=r.optional()})),new We({...this._def,shape:()=>t})}required(e){const t={};return p.objectKeys(this.shape).forEach((n=>{if(e&&!e[n])t[n]=this.shape[n];else{let e=this.shape[n];for(;e instanceof at;)e=e._def.innerType;t[n]=e}})),new We({...this._def,shape:()=>t})}keyof(){return tt(p.objectKeys(this.shape))}}We.create=(e,t)=>new We({shape:()=>e,unknownKeys:"strip",catchall:Ue.create(),typeName:vt.ZodObject,...we(t)}),We.strictCreate=(e,t)=>new We({shape:()=>e,unknownKeys:"strict",catchall:Ue.create(),typeName:vt.ZodObject,...we(t)}),We.lazycreate=(e,t)=>new We({shape:e,unknownKeys:"strip",catchall:Ue.create(),typeName:vt.ZodObject,...we(t)});class Ge extends be{_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 re(e.ctx.common.issues)));return ue(t,{code:ne.invalid_union,unionErrors:n}),le}));{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 re(e)));return ue(t,{code:ne.invalid_union,unionErrors:i}),le}}get options(){return this._def.options}}Ge.create=(e,t)=>new Ge({options:e,typeName:vt.ZodUnion,...we(t)});const Fe=e=>e instanceof Xe?Fe(e.schema):e instanceof ot?Fe(e.innerType()):e instanceof et?[e.value]:e instanceof nt?e.options:e instanceof rt?Object.keys(e.enum):e instanceof ut?Fe(e._def.innerType):e instanceof xe?[void 0]:e instanceof Re?[null]:null;class He extends be{_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==ee.object)return ue(t,{code:ne.invalid_type,expected:ee.object,received:t.parsedType}),le;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}):(ue(t,{code:ne.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[n]}),le)}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=Fe(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 He({typeName:vt.ZodDiscriminatedUnion,discriminator:e,options:t,optionsMap:r,...we(n)})}}function Ke(e,t){const n=te(e),r=te(t);if(e===t)return{valid:!0,data:e};if(n===ee.object&&r===ee.object){const n=p.objectKeys(t),r=p.objectKeys(e).filter((e=>-1!==n.indexOf(e))),i={...e,...t};for(const n of r){const r=Ke(e[n],t[n]);if(!r.valid)return{valid:!1};i[n]=r.data}return{valid:!0,data:i}}if(n===ee.array&&r===ee.array){if(e.length!==t.length)return{valid:!1};const n=[];for(let r=0;r<e.length;r++){const i=Ke(e[r],t[r]);if(!i.valid)return{valid:!1};n.push(i.data)}return{valid:!0,data:n}}return n===ee.date&&r===ee.date&&+e==+t?{valid:!0,data:e}:{valid:!1}}class Ve extends be{_parse(e){const{status:t,ctx:n}=this._processInputParams(e),r=(e,r)=>{if(fe(e)||fe(r))return le;const i=Ke(e.value,r.value);return i.valid?((he(e)||he(r))&&t.dirty(),{status:t.value,value:i.data}):(ue(n,{code:ne.invalid_intersection_types}),le)};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}))}}Ve.create=(e,t,n)=>new Ve({left:e,right:t,typeName:vt.ZodIntersection,...we(n)});class Je extends be{_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==ee.array)return ue(n,{code:ne.invalid_type,expected:ee.array,received:n.parsedType}),le;if(n.data.length<this._def.items.length)return ue(n,{code:ne.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),le;!this._def.rest&&n.data.length>this._def.items.length&&(ue(n,{code:ne.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 ge(n,e,n.path,t)):null})).filter((e=>!!e));return n.common.async?Promise.all(r).then((e=>ce.mergeArray(t,e))):ce.mergeArray(t,r)}get items(){return this._def.items}rest(e){return new Je({...this._def,rest:e})}}Je.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Je({items:e,typeName:vt.ZodTuple,rest:null,...we(t)})};class qe extends be{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!==ee.object)return ue(n,{code:ne.invalid_type,expected:ee.object,received:n.parsedType}),le;const r=[],i=this._def.keyType,o=this._def.valueType;for(const e in n.data)r.push({key:i._parse(new ge(n,e,n.path,e)),value:o._parse(new ge(n,n.data[e],n.path,e))});return n.common.async?ce.mergeObjectAsync(t,r):ce.mergeObjectSync(t,r)}get element(){return this._def.valueType}static create(e,t,n){return new qe(t instanceof be?{keyType:e,valueType:t,typeName:vt.ZodRecord,...we(n)}:{keyType:Oe.create(),valueType:e,typeName:vt.ZodRecord,...we(t)})}}class $e extends be{_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==ee.map)return ue(n,{code:ne.invalid_type,expected:ee.map,received:n.parsedType}),le;const r=this._def.keyType,i=this._def.valueType,o=[...n.data.entries()].map((([e,t],o)=>({key:r._parse(new ge(n,e,n.path,[o,"key"])),value:i._parse(new ge(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 le;"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 le;"dirty"!==r.status&&"dirty"!==i.status||t.dirty(),e.set(r.value,i.value)}return{status:t.value,value:e}}}}$e.create=(e,t,n)=>new $e({valueType:t,keyType:e,typeName:vt.ZodMap,...we(n)});class Ye extends be{_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==ee.set)return ue(n,{code:ne.invalid_type,expected:ee.set,received:n.parsedType}),le;const r=this._def;null!==r.minSize&&n.data.size<r.minSize.value&&(ue(n,{code:ne.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&&(ue(n,{code:ne.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 le;"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 ge(n,e,n.path,t))));return n.common.async?Promise.all(a).then((e=>o(e))):o(a)}min(e,t){return new Ye({...this._def,minSize:{value:e,message:ye.toString(t)}})}max(e,t){return new Ye({...this._def,maxSize:{value:e,message:ye.toString(t)}})}size(e,t){return this.min(e,t).max(e,t)}nonempty(e){return this.min(1,e)}}Ye.create=(e,t)=>new Ye({valueType:e,minSize:null,maxSize:null,typeName:vt.ZodSet,...we(t)});class Qe extends be{constructor(){super(...arguments),this.validate=this.implement}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==ee.function)return ue(t,{code:ne.invalid_type,expected:ee.function,received:t.parsedType}),le;function n(e,n){return se({data:e,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,ae(),ie].filter((e=>!!e)),issueData:{code:ne.invalid_arguments,argumentsError:n}})}function r(e,n){return se({data:e,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,ae(),ie].filter((e=>!!e)),issueData:{code:ne.invalid_return_type,returnTypeError:n}})}const i={errorMap:t.common.contextualErrorMap},o=t.data;return this._def.returns instanceof it?de((async(...e)=>{const t=new re([]),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}))})):de(((...e)=>{const t=this._def.args.safeParse(e,i);if(!t.success)throw new re([n(e,t.error)]);const a=o(...t.data),s=this._def.returns.safeParse(a,i);if(!s.success)throw new re([r(a,s.error)]);return s.data}))}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new Qe({...this._def,args:Je.create(e).rest(De.create())})}returns(e){return new Qe({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,t,n){return new Qe({args:e||Je.create([]).rest(De.create()),returns:t||De.create(),typeName:vt.ZodFunction,...we(n)})}}class Xe extends be{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})}}Xe.create=(e,t)=>new Xe({getter:e,typeName:vt.ZodLazy,...we(t)});class et extends be{_parse(e){if(e.data!==this._def.value){const t=this._getOrReturnCtx(e);return ue(t,{received:t.data,code:ne.invalid_literal,expected:this._def.value}),le}return{status:"valid",value:e.data}}get value(){return this._def.value}}function tt(e,t){return new nt({values:e,typeName:vt.ZodEnum,...we(t)})}et.create=(e,t)=>new et({value:e,typeName:vt.ZodLiteral,...we(t)});class nt extends be{_parse(e){if("string"!=typeof e.data){const t=this._getOrReturnCtx(e),n=this._def.values;return ue(t,{expected:p.joinValues(n),received:t.parsedType,code:ne.invalid_type}),le}if(-1===this._def.values.indexOf(e.data)){const t=this._getOrReturnCtx(e),n=this._def.values;return ue(t,{received:t.data,code:ne.invalid_enum_value,options:n}),le}return de(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 nt.create(e)}exclude(e){return nt.create(this.options.filter((t=>!e.includes(t))))}}nt.create=tt;class rt extends be{_parse(e){const t=p.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(e);if(n.parsedType!==ee.string&&n.parsedType!==ee.number){const e=p.objectValues(t);return ue(n,{expected:p.joinValues(e),received:n.parsedType,code:ne.invalid_type}),le}if(-1===t.indexOf(e.data)){const e=p.objectValues(t);return ue(n,{received:n.data,code:ne.invalid_enum_value,options:e}),le}return de(e.data)}get enum(){return this._def.values}}rt.create=(e,t)=>new rt({values:e,typeName:vt.ZodNativeEnum,...we(t)});class it extends be{unwrap(){return this._def.type}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==ee.promise&&!1===t.common.async)return ue(t,{code:ne.invalid_type,expected:ee.promise,received:t.parsedType}),le;const n=t.parsedType===ee.promise?t.data:Promise.resolve(t.data);return de(n.then((e=>this._def.type.parseAsync(e,{path:t.path,errorMap:t.common.contextualErrorMap}))))}}it.create=(e,t)=>new it({type:e,typeName:vt.ZodPromise,...we(t)});class ot extends be{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===vt.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=>{ue(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?le:("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?le:("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(!me(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=>me(e)?Promise.resolve(r.transform(e.value,i)).then((e=>({status:t.value,value:e}))):e))}p.assertNever(r)}}ot.create=(e,t,n)=>new ot({schema:e,typeName:vt.ZodEffects,effect:t,...we(n)}),ot.createWithPreprocess=(e,t,n)=>new ot({schema:t,effect:{type:"preprocess",transform:e},typeName:vt.ZodEffects,...we(n)});class at extends be{_parse(e){return this._getType(e)===ee.undefined?de(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}at.create=(e,t)=>new at({innerType:e,typeName:vt.ZodOptional,...we(t)});class st extends be{_parse(e){return this._getType(e)===ee.null?de(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}st.create=(e,t)=>new st({innerType:e,typeName:vt.ZodNullable,...we(t)});class ut extends be{_parse(e){const{ctx:t}=this._processInputParams(e);let n=t.data;return t.parsedType===ee.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:t.path,parent:t})}removeDefault(){return this._def.innerType}}ut.create=(e,t)=>new ut({innerType:e,typeName:vt.ZodDefault,defaultValue:"function"==typeof t.default?t.default:()=>t.default,...we(t)});class ct extends be{_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 ve(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}}ct.create=(e,t)=>new ct({innerType:e,typeName:vt.ZodCatch,catchValue:"function"==typeof t.catch?t.catch:()=>t.catch,...we(t)});class lt extends be{_parse(e){if(this._getType(e)!==ee.nan){const t=this._getOrReturnCtx(e);return ue(t,{code:ne.invalid_type,expected:ee.nan,received:t.parsedType}),le}return{status:"valid",value:e.data}}}lt.create=e=>new lt({typeName:vt.ZodNaN,...we(e)});const pt=Symbol("zod_brand");class dt extends be{_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 ft extends be{_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?le:"dirty"===e.status?(t.dirty(),pe(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?le:"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 ft({in:e,out:t,typeName:vt.ZodPipeline})}}const ht=(e,t={},n)=>e?je.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})}})):je.create(),mt={object:We.lazycreate};var vt;!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"}(vt||(vt={}));const yt=Oe.create,gt=ke.create,_t=lt.create,wt=Ie.create,bt=Ne.create,Tt=Ce.create,Et=Me.create,St=xe.create,At=Re.create,Ot=je.create,Pt=De.create,kt=Ue.create,It=Be.create,Nt=Ze.create,Ct=We.create,Mt=We.strictCreate,xt=Ge.create,Rt=He.create,jt=Ve.create,Dt=Je.create,Ut=qe.create,Bt=$e.create,Zt=Ye.create,Lt=Qe.create,zt=Xe.create,Wt=et.create,Gt=nt.create,Ft=rt.create,Ht=it.create,Kt=ot.create,Vt=at.create,Jt=st.create,qt=ot.createWithPreprocess,$t=ft.create,Yt={string:e=>Oe.create({...e,coerce:!0}),number:e=>ke.create({...e,coerce:!0}),boolean:e=>Ne.create({...e,coerce:!0}),bigint:e=>Ie.create({...e,coerce:!0}),date:e=>Ce.create({...e,coerce:!0})},Qt=le;var Xt,en,tn,nn,rn,on,an,sn,un,cn,ln,pn,dn,fn,hn,mn,vn,yn=Object.freeze({__proto__:null,defaultErrorMap:ie,setErrorMap:function(e){oe=e},getErrorMap:ae,makeIssue:se,EMPTY_PATH:[],addIssueToContext:ue,ParseStatus:ce,INVALID:le,DIRTY:pe,OK:de,isAborted:fe,isDirty:he,isValid:me,isAsync:ve,get util(){return p},ZodParsedType:ee,getParsedType:te,ZodType:be,ZodString:Oe,ZodNumber:ke,ZodBigInt:Ie,ZodBoolean:Ne,ZodDate:Ce,ZodSymbol:Me,ZodUndefined:xe,ZodNull:Re,ZodAny:je,ZodUnknown:De,ZodNever:Ue,ZodVoid:Be,ZodArray:Ze,get objectUtil(){return Le},ZodObject:We,ZodUnion:Ge,ZodDiscriminatedUnion:He,ZodIntersection:Ve,ZodTuple:Je,ZodRecord:qe,ZodMap:$e,ZodSet:Ye,ZodFunction:Qe,ZodLazy:Xe,ZodLiteral:et,ZodEnum:nt,ZodNativeEnum:rt,ZodPromise:it,ZodEffects:ot,ZodTransformer:ot,ZodOptional:at,ZodNullable:st,ZodDefault:ut,ZodCatch:ct,ZodNaN:lt,BRAND:pt,ZodBranded:dt,ZodPipeline:ft,custom:ht,Schema:be,ZodSchema:be,late:mt,get ZodFirstPartyTypeKind(){return vt},coerce:Yt,any:Ot,array:Nt,bigint:wt,boolean:bt,date:Tt,discriminatedUnion:Rt,effect:Kt,enum:Gt,function:Lt,instanceof:(e,t={message:`Input not instance of ${e.name}`})=>ht((t=>t instanceof e),t,!0),intersection:jt,lazy:zt,literal:Wt,map:Bt,nan:_t,nativeEnum:Ft,never:kt,null:At,nullable:Jt,number:gt,object:Ct,oboolean:()=>bt().optional(),onumber:()=>gt().optional(),optional:Vt,ostring:()=>yt().optional(),pipeline:$t,preprocess:qt,promise:Ht,record:Ut,set:Zt,strictObject:Mt,string:yt,symbol:Et,transformer:Kt,tuple:Dt,undefined:St,union:xt,unknown:Pt,void:It,NEVER:Qt,ZodIssueCode:ne,quotelessJson:e=>JSON.stringify(e,null,2).replace(/"([^"]+)":/g,"$1:"),ZodError:re});function gn(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")}}e.NetworkType=void 0,(Xt=e.NetworkType||(e.NetworkType={})).none="none",Xt.wifi="wifi",Xt.cellular="cellular",Xt.unknown="unknown",e.PlatformType=void 0,(en=e.PlatformType||(e.PlatformType={})).wp="wp",en.android="android",en.iOS="iOS",en.unknown="unknown",e.Events=void 0,(tn=e.Events||(e.Events={})).AppPaused="h5.event.paused",tn.AppResumed="h5.event.resumed",tn.NetworkChanged="h5.event.connection.changed",tn.OnDataCallback="h5.event.webview.result",tn.WebviewClosed="h5.event.webview.close",tn.OpenApp="h5.event.open.mp",tn.AppClose="h5.event.action.close",tn.PaymentCallback="payment.callback",tn.PaymentResult="action.payment.result",tn.PaymentClose="action.payment.close",e.JumpStatus=void 0,(nn=e.JumpStatus||(e.JumpStatus={})).DOING="doing",nn.DONE="done",e.ProfileType=void 0,(rn=e.ProfileType||(e.ProfileType={}))[rn.user=1]="user",rn[rn.oa=0]="oa",rn[rn.aliasOA=2]="aliasOA",e.ChatType=void 0,(on=e.ChatType||(e.ChatType={}))[on.user=1]="user",on[on.oa=0]="oa",e.PostFeedType=void 0,(an=e.PostFeedType||(e.PostFeedType={}))[an.image=1]="image",an[an.link=4]="link",an[an.profile=5]="profile",e.ShareSheetType=void 0,(sn=e.ShareSheetType||(e.ShareSheetType={}))[sn.image=1]="image",sn[sn.gif=11]="gif",sn[sn.video=12]="video",sn[sn.link=4]="link",sn[sn.oa=5]="oa",sn[sn.zmp=20]="zmp",sn[sn.multi_image=21]="multi_image",sn[sn.zmp_deep_link=4]="zmp_deep_link",e.OrientationType=void 0,(un=e.OrientationType||(e.OrientationType={}))[un.auto=1]="auto",un[un.portrait=2]="portrait",un[un.landscape=3]="landscape",e.VibrateType=void 0,(cn=e.VibrateType||(e.VibrateType={}))[cn.oneShot=0]="oneShot",e.MediaPickerType=void 0,(ln=e.MediaPickerType||(e.MediaPickerType={}))[ln.zcamera=3]="zcamera",ln[ln.zcamera_photo=1]="zcamera_photo",ln[ln.zcamera_video=2]="zcamera_video",ln[ln.zcamera_scan=7]="zcamera_scan",ln[ln.photo=4]="photo",ln[ln.video=5]="video",ln[ln.file=6]="file",e.IAPPayType=void 0,(pn=e.IAPPayType||(e.IAPPayType={})).SUBSCRIPTION="SUBSCRIPTION",pn.ONETIME="ONETIME",e.ProrationMode=void 0,(dn=e.ProrationMode||(e.ProrationMode={}))[dn.UNKNOW=0]="UNKNOW",dn[dn.DEFERRED=1]="DEFERRED",dn[dn.IMMEDIATE_AND_CHARGE_FULL_PRICE=2]="IMMEDIATE_AND_CHARGE_FULL_PRICE",e.StatusBarType=void 0,(fn=e.StatusBarType||(e.StatusBarType={}))[fn.normal=1]="normal",fn[fn.hidden=0]="hidden",fn[fn.transparent=2]="transparent",e.AndroidBottomNavigationBarType=void 0,(hn=e.AndroidBottomNavigationBarType||(e.AndroidBottomNavigationBarType={}))[hn.show=1]="show",hn[hn.hide=0]="hide",e.IOSSafeAreaBottomType=void 0,(mn=e.IOSSafeAreaBottomType||(e.IOSSafeAreaBottomType={}))[mn.show=1]="show",mn[mn.hide=0]="hide",e.TextAlignType=void 0,(vn=e.TextAlignType||(e.TextAlignType={}))[vn.left=0]="left",vn[vn.center=1]="center";var _n,wn=function(t){return t.isAndroid?e.PlatformType.android:t.isIOS?e.PlatformType.iOS:e.PlatformType.unknown};function bn(e){var t=e.split("zalo")[1];return t&&t.replace(" ","").split("/")[1]||""}function Tn(){var e=function(){var e=X((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:gn(),platform:t,platformName:wn(t),zaloVersion:bn(e).trim()}}}();if(e)return e}var En=(null===(_n=Tn())||void 0===_n?void 0:_n.appEnv)||{};function Sn(e){Sn.on&&Sn.engine(e)}Sn.on=!1,Sn.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 An=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),Sn({stage:t.NOT_FOUND,type:"error",name:e,request:n,state:"fail",response:i})};function On(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Pn(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){On(e,t,n[t])}))}return e}function kn(e,t){return function(e){if(Array.isArray(e))return e}(e)||q(e)||$(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 In="undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{};function Nn(){throw new Error("setTimeout has not been defined")}function Cn(){throw new Error("clearTimeout has not been defined")}var Mn=Nn,xn=Cn;function Rn(e){if(Mn===setTimeout)return setTimeout(e,0);if((Mn===Nn||!Mn)&&setTimeout)return Mn=setTimeout,setTimeout(e,0);try{return Mn(e,0)}catch(t){try{return Mn.call(null,e,0)}catch(t){return Mn.call(this,e,0)}}}"function"==typeof In.setTimeout&&(Mn=setTimeout),"function"==typeof In.clearTimeout&&(xn=clearTimeout);var jn,Dn=[],Un=!1,Bn=-1;function Zn(){Un&&jn&&(Un=!1,jn.length?Dn=jn.concat(Dn):Bn=-1,Dn.length&&Ln())}function Ln(){if(!Un){var e=Rn(Zn);Un=!0;for(var t=Dn.length;t;){for(jn=Dn,Dn=[];++Bn<t;)jn&&jn[Bn].run();Bn=-1,t=Dn.length}jn=null,Un=!1,function(e){if(xn===clearTimeout)return clearTimeout(e);if((xn===Cn||!xn)&&clearTimeout)return xn=clearTimeout,clearTimeout(e);try{xn(e)}catch(t){try{return xn.call(null,e)}catch(t){return xn.call(this,e)}}}(e)}}function zn(e,t){this.fun=e,this.array=t}zn.prototype.run=function(){this.fun.apply(null,this.array)};function Wn(){}var Gn=Wn,Fn=Wn,Hn=Wn,Kn=Wn,Vn=Wn,Jn=Wn,qn=Wn;var $n=In.performance||{},Yn=$n.now||$n.mozNow||$n.msNow||$n.oNow||$n.webkitNow||function(){return(new Date).getTime()};var Qn=new Date;var Xn,er={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];Dn.push(new zn(e,t)),1!==Dn.length||Un||Rn(Ln)},title:"browser",browser:!0,env:{},argv:[],version:"",versions:{},on:Gn,addListener:Fn,once:Hn,off:Kn,removeListener:Vn,removeAllListeners:Jn,emit:qn,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*Yn.call($n),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-Qn)/1e3}},tr=er,nr="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function rr(e){return e&&e.constructor===Symbol?"symbol":typeof e}function ir(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 nr?nr:"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 tr&&tr.env&&"true"===tr.env.REFLECT_METADATA_USE_MAP_POLYFILL,p=l||"function"!=typeof Map||"function"!=typeof Map.prototype.entries?ee():Map,d=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(j(n)){if(!F(e))throw new TypeError;if(!K(t))throw new TypeError;return S(e,t)}if(!F(e))throw new TypeError;if(!B(t))throw new TypeError;if(!B(r)&&!j(r)&&!D(r))throw new TypeError;return D(r)&&(r=void 0),A(e,t,n=G(n),r)}function m(e,t){function n(n,r){if(!B(n))throw new TypeError;if(!j(r)&&!V(r))throw new TypeError;C(e,t,n,r)}return n}function v(e,t,n,r){if(!B(n))throw new TypeError;return j(r)||(r=G(r)),C(e,t,n,r)}function y(e,t,n){if(!B(t))throw new TypeError;return j(n)||(n=G(n)),P(e,t,n)}function g(e,t,n){if(!B(t))throw new TypeError;return j(n)||(n=G(n)),k(e,t,n)}function _(e,t,n){if(!B(t))throw new TypeError;return j(n)||(n=G(n)),I(e,t,n)}function w(e,t,n){if(!B(t))throw new TypeError;return j(n)||(n=G(n)),N(e,t,n)}function b(e,t){if(!B(e))throw new TypeError;return j(t)||(t=G(t)),M(e,t)}function T(e,t){if(!B(e))throw new TypeError;return j(t)||(t=G(t)),x(e,t)}function E(e,t,n){if(!B(t))throw new TypeError;j(n)||(n=G(n));var r=O(t,n,!1);if(j(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(!j(r)&&!D(r)){if(!K(r))throw new TypeError;t=r}}return t}function A(e,t,n,r){for(var i=e.length-1;i>=0;--i){var o=(0,e[i])(t,n,r);if(!j(o)&&!D(o)){if(!B(o))throw new TypeError;r=o}}return r}function O(e,t,n){var r=f.get(e);if(j(r)){if(!n)return;r=new p,f.set(e,r)}var i=r.get(t);if(j(i)){if(!n)return;i=new p,r.set(t,i)}return i}function P(e,t,n){if(k(e,t,n))return!0;var r=X(t);return!D(r)&&P(e,r,n)}function k(e,t,n){var r=O(t,n,!1);return!j(r)&&z(r.has(e))}function I(e,t,n){if(k(e,t,n))return N(e,t,n);var r=X(t);return D(r)?void 0:I(e,r,n)}function N(e,t,n){var r=O(t,n,!1);if(!j(r))return r.get(e)}function C(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 d,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,p=i;l<p.length;l++){c=p[l];o.has(c)||(o.add(c),a.push(c))}return a}function x(e,t){var n=[],r=O(e,t,!1);if(j(r))return n;for(var i=q(r.keys()),o=0;;){var a=Y(i);if(!a)return n.length=o,n;var s=$(a);try{n[o]=s}catch(e){try{Q(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 j(e){return void 0===e}function D(e){return null===e}function U(e){return"symbol"==typeof e}function B(e){return"object"==typeof e?null!==e:"function"==typeof e}function Z(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(B(o))throw new TypeError;return o}return L(e,"default"===n?"number":n)}function L(e,t){if("string"===t){var n=e.toString;if(H(n))if(!B(i=n.call(e)))return i;if(H(r=e.valueOf))if(!B(i=r.call(e)))return i}else{var r;if(H(r=e.valueOf))if(!B(i=r.call(e)))return i;var i,o=e.toString;if(H(o))if(!B(i=o.call(e)))return i}throw new TypeError}function z(e){return!!e}function W(e){return""+e}function G(e){var t=Z(e,3);return U(t)?t:W(t)}function F(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 K(e){return"function"==typeof e}function V(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(!B(n))throw new TypeError;return n}function $(e){return e.value}function Y(e){var t=e.next();return!t.done&&t}function Q(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 p}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)}()}(Xn||(Xn={}));var or=Object.prototype.toString;var ar="[object Null]",sr="[object Undefined]";function ur(e){return null==e?void 0===e?sr:ar:function(e){return or.call(e)}(e)}function cr(e){return null!=e&&"object"==typeof e}var lr={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||cr(e)&&"[object Number]"==ur(e)},isArray:function(e){return Array.isArray(e)},isRegExp:function(e){return cr(e)&&"[object RegExp]"==ur(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 pr(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function dr(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 fr(e){return fr=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},fr(e)}function hr(e){return fr(e)}function mr(e,t,n){return mr="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=hr(e)););return e}(e,t);if(r){var i=Object.getOwnPropertyDescriptor(r,t);return i.get?i.get.call(n||e):i.value}},mr(e,t,n)}function vr(e,t,n){return mr(e,t,n)}function yr(e,t){return yr=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},yr(e,t)}function gr(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&&yr(e,t)}function _r(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function wr(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=hr(e);if(t){var i=hr(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return function(e,t){return!t||"object"!==rr(t)&&"function"!=typeof t?_r(e):t}(this,n)}}var br=function(e,t){return e(t={exports:{}},t.exports),t.exports
10
+ !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self)["zmp-sdk"]={})}(this,(function(e){"use strict";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 p,d=0,f=-2e3,h=-1400,m=-1500,v=-1401,y=-1404,g=-1408,_=-2004,b=-2005,w="Success",T="Unknown error. Please try again later.",E="Request timeout. Please try again later.",S="Please login (https://miniapp.zalo.me/docs/api/login) before to call this api",P="Login failed",A="This API is not supported in this version of Zalo",O="User Authentication Required. Please grant User Authentication permission before requesting User Permission",k="Unable to pick media",I="Unable to save image",N={SUCCESS:{code:d,message:w},UNKNOWN_ERROR:{code:f,message:T},UNAUTHORIZED:{code:v,message:S},FORBIDDEN:{code:-1403,message:"You don't have permission to call this api"},CLIENT_NOT_SUPPORT:{code:y,message:A},DECODE_FAILED:{code:-2001,message:"Can not decode id. Please check your params again."},TIME_OUT:{code:g,message:E},USER_DENIED:{code:-2002,message:"User denied"},USER_CANCEL:{code:-2003,message:"User cancel"}},C={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},REQUEST_PERMISSION_CAMERA:{errorList:{android:{"-2":{mapTo:N.USER_DENIED}},iOS:{"-2":{mapTo:N.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:N.USER_DENIED}},iOS:{"-1":{mapTo:N.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:b,message:I},needMoreDetail:!0},"-102":{mapTo:{code:b,message:I},needMoreDetail:!0}},iOS:{"-10":{mapTo:{code:b,message:I},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:N.USER_DENIED},"-101":{mapTo:N.USER_DENIED}},iOS:{"-1":{mapTo:N.USER_DENIED},"-10":{mapTo:N.USER_DENIED}}}},MP_OPEN_PROFILE_PICKER:{requireAccessToken:!0,versionLive:{iOS:432},errorList:{android:{"-101":{mapTo:N.USER_CANCEL}},iOS:{"-101":{mapTo:N.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:N.USER_CANCEL},999:{mapTo:{code:_,message:k},needMoreDetail:!0}},iOS:{"-10":{mapTo:{code:_,message:k}}}}},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:N.USER_DENIED}},iOS:{"-1":{mapTo:N.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}},M={android:{"-4":N.DECODE_FAILED,"-5":N.CLIENT_NOT_SUPPORT,"-14":N.TIME_OUT},iOS:{"-9":N.DECODE_FAILED,"-5":N.CLIENT_NOT_SUPPORT,"-14":N.TIME_OUT}},x={android:12100615,iOS:460,wp:0,unknown:0},R=5*n,j="https://payment-mini.zalo.me/api/order/create",D="https://payment-mini.zalo.me/api/order/iap-create",U="https://payment-mini.zalo.me/api/transaction",B="DEFERRED",Z="IMMEDIATE_AND_CHARGE_FULL_PRICE",L={SHOW_BACK:0,HIDE_BACK:3,SHOW_HOME:1,HIDE_HOME:0},z=5,W=6,G="#1843EF",F=0,H={"-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 K(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 V(e){return function(){var t=this,n=arguments;return new Promise((function(r,i){var o=e.apply(t,n);function a(e){K(o,r,i,a,s,"next",e)}function s(e){K(o,r,i,a,s,"throw",e)}a(void 0)}))}}function J(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 q(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function $(e,t){if(e){if("string"==typeof e)return J(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)?J(e,t):void 0}}function Y(e){return function(e){if(Array.isArray(e))return J(e)}(e)||q(e)||$(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 Q(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 X(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,Y(n))}catch(e){return"undefined"!=typeof console&&console.error&&console.error(e),null}}}X.async=function(e){return V((function(){var t,n,r,i,o=arguments;return Q(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,Y(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.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}(p||(p={}));const ee=p.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),te=e=>{switch(typeof e){case"undefined":return ee.undefined;case"string":return ee.string;case"number":return isNaN(e)?ee.nan:ee.number;case"boolean":return ee.boolean;case"function":return ee.function;case"bigint":return ee.bigint;case"symbol":return ee.symbol;case"object":return Array.isArray(e)?ee.array:null===e?ee.null:e.then&&"function"==typeof e.then&&e.catch&&"function"==typeof e.catch?ee.promise:"undefined"!=typeof Map&&e instanceof Map?ee.map:"undefined"!=typeof Set&&e instanceof Set?ee.set:"undefined"!=typeof Date&&e instanceof Date?ee.date:ee.object;default:return ee.unknown}},ne=p.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 re 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,p.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()}}re.create=e=>new re(e);const ie=(e,t)=>{let n;switch(e.code){case ne.invalid_type:n=e.received===ee.undefined?"Required":`Expected ${e.expected}, received ${e.received}`;break;case ne.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(e.expected,p.jsonStringifyReplacer)}`;break;case ne.unrecognized_keys:n=`Unrecognized key(s) in object: ${p.joinValues(e.keys,", ")}`;break;case ne.invalid_union:n="Invalid input";break;case ne.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${p.joinValues(e.options)}`;break;case ne.invalid_enum_value:n=`Invalid enum value. Expected ${p.joinValues(e.options)}, received '${e.received}'`;break;case ne.invalid_arguments:n="Invalid function arguments";break;case ne.invalid_return_type:n="Invalid function return type";break;case ne.invalid_date:n="Invalid date";break;case ne.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}"`:p.assertNever(e.validation):n="regex"!==e.validation?`Invalid ${e.validation}`:"Invalid";break;case ne.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 ne.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 ne.custom:n="Invalid input";break;case ne.invalid_intersection_types:n="Intersection results could not be merged";break;case ne.not_multiple_of:n=`Number must be a multiple of ${e.multipleOf}`;break;case ne.not_finite:n="Number must be finite";break;default:n=t.defaultError,p.assertNever(e)}return{message:n}};let oe=ie;function ae(){return oe}const se=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 ue(e,t){const n=se({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,ae(),ie].filter((e=>!!e))});e.common.issues.push(n)}class ce{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 le;"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 ce.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 le;if("aborted"===i.status)return le;"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 le=Object.freeze({status:"aborted"}),pe=e=>({status:"dirty",value:e}),de=e=>({status:"valid",value:e}),fe=e=>"aborted"===e.status,he=e=>"dirty"===e.status,me=e=>"valid"===e.status,ve=e=>"undefined"!=typeof Promise&&e instanceof Promise;var ye;!function(e){e.errToObj=e=>"string"==typeof e?{message:e}:e||{},e.toString=e=>"string"==typeof e?e:null==e?void 0:e.message}(ye||(ye={}));class ge{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 _e=(e,t)=>{if(me(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 re(e.common.issues)}};function be(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 we{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 te(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:te(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new ce,ctx:{common:e.parent.common,data:e.data,parsedType:te(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const t=this._parse(e);if(ve(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:te(e)},i=this._parseSync({data:e,path:r.path,parent:r});return _e(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:te(e)},r=this._parse({data:e,path:n.path,parent:n}),i=await(ve(r)?r:Promise.resolve(r));return _e(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:ne.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 ot({schema:this,typeName:vt.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}optional(){return at.create(this,this._def)}nullable(){return st.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Ze.create(this,this._def)}promise(){return it.create(this,this._def)}or(e){return Ge.create([this,e],this._def)}and(e){return Ve.create(this,e,this._def)}transform(e){return new ot({...be(this._def),schema:this,typeName:vt.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const t="function"==typeof e?e:()=>e;return new ut({...be(this._def),innerType:this,defaultValue:t,typeName:vt.ZodDefault})}brand(){return new dt({typeName:vt.ZodBranded,type:this,...be(this._def)})}catch(e){const t="function"==typeof e?e:()=>e;return new ct({...be(this._def),innerType:this,catchValue:t,typeName:vt.ZodCatch})}describe(e){return new(0,this.constructor)({...this._def,description:e})}pipe(e){return ft.create(this,e)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const Te=/^c[^\s-]{8,}$/i,Ee=/^[a-z][a-z0-9]*$/,Se=/^([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,Pe=/^(([^<>()[\]\\.,;:\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 Ae extends we{constructor(){super(...arguments),this._regex=(e,t,n)=>this.refinement((t=>e.test(t)),{validation:t,code:ne.invalid_string,...ye.errToObj(n)}),this.nonempty=e=>this.min(1,ye.errToObj(e)),this.trim=()=>new Ae({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}_parse(e){this._def.coerce&&(e.data=String(e.data));if(this._getType(e)!==ee.string){const t=this._getOrReturnCtx(e);return ue(t,{code:ne.invalid_type,expected:ee.string,received:t.parsedType}),le}const t=new ce;let n;for(const i of this._def.checks)if("min"===i.kind)e.data.length<i.value&&(n=this._getOrReturnCtx(e,n),ue(n,{code:ne.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),ue(n,{code:ne.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?ue(n,{code:ne.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}):o&&ue(n,{code:ne.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}),t.dirty())}else if("email"===i.kind)Pe.test(e.data)||(n=this._getOrReturnCtx(e,n),ue(n,{validation:"email",code:ne.invalid_string,message:i.message}),t.dirty());else if("uuid"===i.kind)Se.test(e.data)||(n=this._getOrReturnCtx(e,n),ue(n,{validation:"uuid",code:ne.invalid_string,message:i.message}),t.dirty());else if("cuid"===i.kind)Te.test(e.data)||(n=this._getOrReturnCtx(e,n),ue(n,{validation:"cuid",code:ne.invalid_string,message:i.message}),t.dirty());else if("cuid2"===i.kind)Ee.test(e.data)||(n=this._getOrReturnCtx(e,n),ue(n,{validation:"cuid2",code:ne.invalid_string,message:i.message}),t.dirty());else if("url"===i.kind)try{new URL(e.data)}catch(r){n=this._getOrReturnCtx(e,n),ue(n,{validation:"url",code:ne.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),ue(n,{validation:"regex",code:ne.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),ue(n,{code:ne.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),ue(n,{code:ne.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),ue(n,{code:ne.invalid_string,validation:"datetime",message:i.message}),t.dirty())}else p.assertNever(i);var r;return{status:t.value,value:e.data}}_addCheck(e){return new Ae({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...ye.errToObj(e)})}url(e){return this._addCheck({kind:"url",...ye.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...ye.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...ye.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...ye.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,...ye.errToObj(null==e?void 0:e.message)})}regex(e,t){return this._addCheck({kind:"regex",regex:e,...ye.errToObj(t)})}startsWith(e,t){return this._addCheck({kind:"startsWith",value:e,...ye.errToObj(t)})}endsWith(e,t){return this._addCheck({kind:"endsWith",value:e,...ye.errToObj(t)})}min(e,t){return this._addCheck({kind:"min",value:e,...ye.errToObj(t)})}max(e,t){return this._addCheck({kind:"max",value:e,...ye.errToObj(t)})}length(e,t){return this._addCheck({kind:"length",value:e,...ye.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 Oe(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)}Ae.create=e=>{var t;return new Ae({checks:[],typeName:vt.ZodString,coerce:null!==(t=null==e?void 0:e.coerce)&&void 0!==t&&t,...be(e)})};class ke extends we{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)!==ee.number){const t=this._getOrReturnCtx(e);return ue(t,{code:ne.invalid_type,expected:ee.number,received:t.parsedType}),le}let t;const n=new ce;for(const r of this._def.checks)if("int"===r.kind)p.isInteger(e.data)||(t=this._getOrReturnCtx(e,t),ue(t,{code:ne.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),ue(t,{code:ne.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),ue(t,{code:ne.too_big,maximum:r.value,type:"number",inclusive:r.inclusive,exact:!1,message:r.message}),n.dirty())}else"multipleOf"===r.kind?0!==Oe(e.data,r.value)&&(t=this._getOrReturnCtx(e,t),ue(t,{code:ne.not_multiple_of,multipleOf:r.value,message:r.message}),n.dirty()):"finite"===r.kind?Number.isFinite(e.data)||(t=this._getOrReturnCtx(e,t),ue(t,{code:ne.not_finite,message:r.message}),n.dirty()):p.assertNever(r);return{status:n.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,ye.toString(t))}gt(e,t){return this.setLimit("min",e,!1,ye.toString(t))}lte(e,t){return this.setLimit("max",e,!0,ye.toString(t))}lt(e,t){return this.setLimit("max",e,!1,ye.toString(t))}setLimit(e,t,n,r){return new ke({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:n,message:ye.toString(r)}]})}_addCheck(e){return new ke({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:ye.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:ye.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:ye.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:ye.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:ye.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:ye.toString(t)})}finite(e){return this._addCheck({kind:"finite",message:ye.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&&p.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)}}ke.create=e=>new ke({checks:[],typeName:vt.ZodNumber,coerce:(null==e?void 0:e.coerce)||!1,...be(e)});class Ie extends we{_parse(e){this._def.coerce&&(e.data=BigInt(e.data));if(this._getType(e)!==ee.bigint){const t=this._getOrReturnCtx(e);return ue(t,{code:ne.invalid_type,expected:ee.bigint,received:t.parsedType}),le}return de(e.data)}}Ie.create=e=>{var t;return new Ie({typeName:vt.ZodBigInt,coerce:null!==(t=null==e?void 0:e.coerce)&&void 0!==t&&t,...be(e)})};class Ne extends we{_parse(e){this._def.coerce&&(e.data=Boolean(e.data));if(this._getType(e)!==ee.boolean){const t=this._getOrReturnCtx(e);return ue(t,{code:ne.invalid_type,expected:ee.boolean,received:t.parsedType}),le}return de(e.data)}}Ne.create=e=>new Ne({typeName:vt.ZodBoolean,coerce:(null==e?void 0:e.coerce)||!1,...be(e)});class Ce extends we{_parse(e){this._def.coerce&&(e.data=new Date(e.data));if(this._getType(e)!==ee.date){const t=this._getOrReturnCtx(e);return ue(t,{code:ne.invalid_type,expected:ee.date,received:t.parsedType}),le}if(isNaN(e.data.getTime())){return ue(this._getOrReturnCtx(e),{code:ne.invalid_date}),le}const t=new ce;let n;for(const r of this._def.checks)"min"===r.kind?e.data.getTime()<r.value&&(n=this._getOrReturnCtx(e,n),ue(n,{code:ne.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),ue(n,{code:ne.too_big,message:r.message,inclusive:!0,exact:!1,maximum:r.value,type:"date"}),t.dirty()):p.assertNever(r);return{status:t.value,value:new Date(e.data.getTime())}}_addCheck(e){return new Ce({...this._def,checks:[...this._def.checks,e]})}min(e,t){return this._addCheck({kind:"min",value:e.getTime(),message:ye.toString(t)})}max(e,t){return this._addCheck({kind:"max",value:e.getTime(),message:ye.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}}Ce.create=e=>new Ce({checks:[],coerce:(null==e?void 0:e.coerce)||!1,typeName:vt.ZodDate,...be(e)});class Me extends we{_parse(e){if(this._getType(e)!==ee.symbol){const t=this._getOrReturnCtx(e);return ue(t,{code:ne.invalid_type,expected:ee.symbol,received:t.parsedType}),le}return de(e.data)}}Me.create=e=>new Me({typeName:vt.ZodSymbol,...be(e)});class xe extends we{_parse(e){if(this._getType(e)!==ee.undefined){const t=this._getOrReturnCtx(e);return ue(t,{code:ne.invalid_type,expected:ee.undefined,received:t.parsedType}),le}return de(e.data)}}xe.create=e=>new xe({typeName:vt.ZodUndefined,...be(e)});class Re extends we{_parse(e){if(this._getType(e)!==ee.null){const t=this._getOrReturnCtx(e);return ue(t,{code:ne.invalid_type,expected:ee.null,received:t.parsedType}),le}return de(e.data)}}Re.create=e=>new Re({typeName:vt.ZodNull,...be(e)});class je extends we{constructor(){super(...arguments),this._any=!0}_parse(e){return de(e.data)}}je.create=e=>new je({typeName:vt.ZodAny,...be(e)});class De extends we{constructor(){super(...arguments),this._unknown=!0}_parse(e){return de(e.data)}}De.create=e=>new De({typeName:vt.ZodUnknown,...be(e)});class Ue extends we{_parse(e){const t=this._getOrReturnCtx(e);return ue(t,{code:ne.invalid_type,expected:ee.never,received:t.parsedType}),le}}Ue.create=e=>new Ue({typeName:vt.ZodNever,...be(e)});class Be extends we{_parse(e){if(this._getType(e)!==ee.undefined){const t=this._getOrReturnCtx(e);return ue(t,{code:ne.invalid_type,expected:ee.void,received:t.parsedType}),le}return de(e.data)}}Be.create=e=>new Be({typeName:vt.ZodVoid,...be(e)});class Ze extends we{_parse(e){const{ctx:t,status:n}=this._processInputParams(e),r=this._def;if(t.parsedType!==ee.array)return ue(t,{code:ne.invalid_type,expected:ee.array,received:t.parsedType}),le;if(null!==r.exactLength){const e=t.data.length>r.exactLength.value,i=t.data.length<r.exactLength.value;(e||i)&&(ue(t,{code:e?ne.too_big:ne.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&&(ue(t,{code:ne.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&&(ue(t,{code:ne.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 ge(t,e,t.path,n))))).then((e=>ce.mergeArray(n,e)));const i=[...t.data].map(((e,n)=>r.type._parseSync(new ge(t,e,t.path,n))));return ce.mergeArray(n,i)}get element(){return this._def.type}min(e,t){return new Ze({...this._def,minLength:{value:e,message:ye.toString(t)}})}max(e,t){return new Ze({...this._def,maxLength:{value:e,message:ye.toString(t)}})}length(e,t){return new Ze({...this._def,exactLength:{value:e,message:ye.toString(t)}})}nonempty(e){return this.min(1,e)}}var Le;function ze(e){if(e instanceof We){const t={};for(const n in e.shape){const r=e.shape[n];t[n]=at.create(ze(r))}return new We({...e._def,shape:()=>t})}return e instanceof Ze?Ze.create(ze(e.element)):e instanceof at?at.create(ze(e.unwrap())):e instanceof st?st.create(ze(e.unwrap())):e instanceof Je?Je.create(e.items.map((e=>ze(e)))):e}Ze.create=(e,t)=>new Ze({type:e,minLength:null,maxLength:null,exactLength:null,typeName:vt.ZodArray,...be(t)}),function(e){e.mergeShapes=(e,t)=>({...e,...t})}(Le||(Le={}));class We extends we{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=p.objectKeys(e);return this._cached={shape:e,keys:t}}_parse(e){if(this._getType(e)!==ee.object){const t=this._getOrReturnCtx(e);return ue(t,{code:ne.invalid_type,expected:ee.object,received:t.parsedType}),le}const{status:t,ctx:n}=this._processInputParams(e),{shape:r,keys:i}=this._getCached(),o=[];if(!(this._def.catchall instanceof Ue&&"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 ge(n,i,n.path,e)),alwaysSet:e in n.data})}if(this._def.catchall instanceof Ue){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&&(ue(n,{code:ne.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 ge(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=>ce.mergeObjectSync(t,e))):ce.mergeObjectSync(t,a)}get shape(){return this._def.shape()}strict(e){return ye.errToObj,new We({...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=ye.errToObj(e).message)&&void 0!==a?a:s}:{message:s}}}:{}})}strip(){return new We({...this._def,unknownKeys:"strip"})}passthrough(){return new We({...this._def,unknownKeys:"passthrough"})}extend(e){return new We({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new We({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>Le.mergeShapes(this._def.shape(),e._def.shape()),typeName:vt.ZodObject})}setKey(e,t){return this.augment({[e]:t})}catchall(e){return new We({...this._def,catchall:e})}pick(e){const t={};return p.objectKeys(e).forEach((n=>{e[n]&&this.shape[n]&&(t[n]=this.shape[n])})),new We({...this._def,shape:()=>t})}omit(e){const t={};return p.objectKeys(this.shape).forEach((n=>{e[n]||(t[n]=this.shape[n])})),new We({...this._def,shape:()=>t})}deepPartial(){return ze(this)}partial(e){const t={};return p.objectKeys(this.shape).forEach((n=>{const r=this.shape[n];e&&!e[n]?t[n]=r:t[n]=r.optional()})),new We({...this._def,shape:()=>t})}required(e){const t={};return p.objectKeys(this.shape).forEach((n=>{if(e&&!e[n])t[n]=this.shape[n];else{let e=this.shape[n];for(;e instanceof at;)e=e._def.innerType;t[n]=e}})),new We({...this._def,shape:()=>t})}keyof(){return tt(p.objectKeys(this.shape))}}We.create=(e,t)=>new We({shape:()=>e,unknownKeys:"strip",catchall:Ue.create(),typeName:vt.ZodObject,...be(t)}),We.strictCreate=(e,t)=>new We({shape:()=>e,unknownKeys:"strict",catchall:Ue.create(),typeName:vt.ZodObject,...be(t)}),We.lazycreate=(e,t)=>new We({shape:e,unknownKeys:"strip",catchall:Ue.create(),typeName:vt.ZodObject,...be(t)});class Ge extends we{_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 re(e.ctx.common.issues)));return ue(t,{code:ne.invalid_union,unionErrors:n}),le}));{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 re(e)));return ue(t,{code:ne.invalid_union,unionErrors:i}),le}}get options(){return this._def.options}}Ge.create=(e,t)=>new Ge({options:e,typeName:vt.ZodUnion,...be(t)});const Fe=e=>e instanceof Xe?Fe(e.schema):e instanceof ot?Fe(e.innerType()):e instanceof et?[e.value]:e instanceof nt?e.options:e instanceof rt?Object.keys(e.enum):e instanceof ut?Fe(e._def.innerType):e instanceof xe?[void 0]:e instanceof Re?[null]:null;class He extends we{_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==ee.object)return ue(t,{code:ne.invalid_type,expected:ee.object,received:t.parsedType}),le;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}):(ue(t,{code:ne.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[n]}),le)}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=Fe(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 He({typeName:vt.ZodDiscriminatedUnion,discriminator:e,options:t,optionsMap:r,...be(n)})}}function Ke(e,t){const n=te(e),r=te(t);if(e===t)return{valid:!0,data:e};if(n===ee.object&&r===ee.object){const n=p.objectKeys(t),r=p.objectKeys(e).filter((e=>-1!==n.indexOf(e))),i={...e,...t};for(const n of r){const r=Ke(e[n],t[n]);if(!r.valid)return{valid:!1};i[n]=r.data}return{valid:!0,data:i}}if(n===ee.array&&r===ee.array){if(e.length!==t.length)return{valid:!1};const n=[];for(let r=0;r<e.length;r++){const i=Ke(e[r],t[r]);if(!i.valid)return{valid:!1};n.push(i.data)}return{valid:!0,data:n}}return n===ee.date&&r===ee.date&&+e==+t?{valid:!0,data:e}:{valid:!1}}class Ve extends we{_parse(e){const{status:t,ctx:n}=this._processInputParams(e),r=(e,r)=>{if(fe(e)||fe(r))return le;const i=Ke(e.value,r.value);return i.valid?((he(e)||he(r))&&t.dirty(),{status:t.value,value:i.data}):(ue(n,{code:ne.invalid_intersection_types}),le)};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}))}}Ve.create=(e,t,n)=>new Ve({left:e,right:t,typeName:vt.ZodIntersection,...be(n)});class Je extends we{_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==ee.array)return ue(n,{code:ne.invalid_type,expected:ee.array,received:n.parsedType}),le;if(n.data.length<this._def.items.length)return ue(n,{code:ne.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),le;!this._def.rest&&n.data.length>this._def.items.length&&(ue(n,{code:ne.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 ge(n,e,n.path,t)):null})).filter((e=>!!e));return n.common.async?Promise.all(r).then((e=>ce.mergeArray(t,e))):ce.mergeArray(t,r)}get items(){return this._def.items}rest(e){return new Je({...this._def,rest:e})}}Je.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Je({items:e,typeName:vt.ZodTuple,rest:null,...be(t)})};class qe extends we{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!==ee.object)return ue(n,{code:ne.invalid_type,expected:ee.object,received:n.parsedType}),le;const r=[],i=this._def.keyType,o=this._def.valueType;for(const e in n.data)r.push({key:i._parse(new ge(n,e,n.path,e)),value:o._parse(new ge(n,n.data[e],n.path,e))});return n.common.async?ce.mergeObjectAsync(t,r):ce.mergeObjectSync(t,r)}get element(){return this._def.valueType}static create(e,t,n){return new qe(t instanceof we?{keyType:e,valueType:t,typeName:vt.ZodRecord,...be(n)}:{keyType:Ae.create(),valueType:e,typeName:vt.ZodRecord,...be(t)})}}class $e extends we{_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==ee.map)return ue(n,{code:ne.invalid_type,expected:ee.map,received:n.parsedType}),le;const r=this._def.keyType,i=this._def.valueType,o=[...n.data.entries()].map((([e,t],o)=>({key:r._parse(new ge(n,e,n.path,[o,"key"])),value:i._parse(new ge(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 le;"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 le;"dirty"!==r.status&&"dirty"!==i.status||t.dirty(),e.set(r.value,i.value)}return{status:t.value,value:e}}}}$e.create=(e,t,n)=>new $e({valueType:t,keyType:e,typeName:vt.ZodMap,...be(n)});class Ye extends we{_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==ee.set)return ue(n,{code:ne.invalid_type,expected:ee.set,received:n.parsedType}),le;const r=this._def;null!==r.minSize&&n.data.size<r.minSize.value&&(ue(n,{code:ne.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&&(ue(n,{code:ne.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 le;"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 ge(n,e,n.path,t))));return n.common.async?Promise.all(a).then((e=>o(e))):o(a)}min(e,t){return new Ye({...this._def,minSize:{value:e,message:ye.toString(t)}})}max(e,t){return new Ye({...this._def,maxSize:{value:e,message:ye.toString(t)}})}size(e,t){return this.min(e,t).max(e,t)}nonempty(e){return this.min(1,e)}}Ye.create=(e,t)=>new Ye({valueType:e,minSize:null,maxSize:null,typeName:vt.ZodSet,...be(t)});class Qe extends we{constructor(){super(...arguments),this.validate=this.implement}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==ee.function)return ue(t,{code:ne.invalid_type,expected:ee.function,received:t.parsedType}),le;function n(e,n){return se({data:e,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,ae(),ie].filter((e=>!!e)),issueData:{code:ne.invalid_arguments,argumentsError:n}})}function r(e,n){return se({data:e,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,ae(),ie].filter((e=>!!e)),issueData:{code:ne.invalid_return_type,returnTypeError:n}})}const i={errorMap:t.common.contextualErrorMap},o=t.data;return this._def.returns instanceof it?de((async(...e)=>{const t=new re([]),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}))})):de(((...e)=>{const t=this._def.args.safeParse(e,i);if(!t.success)throw new re([n(e,t.error)]);const a=o(...t.data),s=this._def.returns.safeParse(a,i);if(!s.success)throw new re([r(a,s.error)]);return s.data}))}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new Qe({...this._def,args:Je.create(e).rest(De.create())})}returns(e){return new Qe({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,t,n){return new Qe({args:e||Je.create([]).rest(De.create()),returns:t||De.create(),typeName:vt.ZodFunction,...be(n)})}}class Xe extends we{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})}}Xe.create=(e,t)=>new Xe({getter:e,typeName:vt.ZodLazy,...be(t)});class et extends we{_parse(e){if(e.data!==this._def.value){const t=this._getOrReturnCtx(e);return ue(t,{received:t.data,code:ne.invalid_literal,expected:this._def.value}),le}return{status:"valid",value:e.data}}get value(){return this._def.value}}function tt(e,t){return new nt({values:e,typeName:vt.ZodEnum,...be(t)})}et.create=(e,t)=>new et({value:e,typeName:vt.ZodLiteral,...be(t)});class nt extends we{_parse(e){if("string"!=typeof e.data){const t=this._getOrReturnCtx(e),n=this._def.values;return ue(t,{expected:p.joinValues(n),received:t.parsedType,code:ne.invalid_type}),le}if(-1===this._def.values.indexOf(e.data)){const t=this._getOrReturnCtx(e),n=this._def.values;return ue(t,{received:t.data,code:ne.invalid_enum_value,options:n}),le}return de(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 nt.create(e)}exclude(e){return nt.create(this.options.filter((t=>!e.includes(t))))}}nt.create=tt;class rt extends we{_parse(e){const t=p.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(e);if(n.parsedType!==ee.string&&n.parsedType!==ee.number){const e=p.objectValues(t);return ue(n,{expected:p.joinValues(e),received:n.parsedType,code:ne.invalid_type}),le}if(-1===t.indexOf(e.data)){const e=p.objectValues(t);return ue(n,{received:n.data,code:ne.invalid_enum_value,options:e}),le}return de(e.data)}get enum(){return this._def.values}}rt.create=(e,t)=>new rt({values:e,typeName:vt.ZodNativeEnum,...be(t)});class it extends we{unwrap(){return this._def.type}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==ee.promise&&!1===t.common.async)return ue(t,{code:ne.invalid_type,expected:ee.promise,received:t.parsedType}),le;const n=t.parsedType===ee.promise?t.data:Promise.resolve(t.data);return de(n.then((e=>this._def.type.parseAsync(e,{path:t.path,errorMap:t.common.contextualErrorMap}))))}}it.create=(e,t)=>new it({type:e,typeName:vt.ZodPromise,...be(t)});class ot extends we{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===vt.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=>{ue(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?le:("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?le:("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(!me(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=>me(e)?Promise.resolve(r.transform(e.value,i)).then((e=>({status:t.value,value:e}))):e))}p.assertNever(r)}}ot.create=(e,t,n)=>new ot({schema:e,typeName:vt.ZodEffects,effect:t,...be(n)}),ot.createWithPreprocess=(e,t,n)=>new ot({schema:t,effect:{type:"preprocess",transform:e},typeName:vt.ZodEffects,...be(n)});class at extends we{_parse(e){return this._getType(e)===ee.undefined?de(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}at.create=(e,t)=>new at({innerType:e,typeName:vt.ZodOptional,...be(t)});class st extends we{_parse(e){return this._getType(e)===ee.null?de(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}st.create=(e,t)=>new st({innerType:e,typeName:vt.ZodNullable,...be(t)});class ut extends we{_parse(e){const{ctx:t}=this._processInputParams(e);let n=t.data;return t.parsedType===ee.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:t.path,parent:t})}removeDefault(){return this._def.innerType}}ut.create=(e,t)=>new ut({innerType:e,typeName:vt.ZodDefault,defaultValue:"function"==typeof t.default?t.default:()=>t.default,...be(t)});class ct extends we{_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 ve(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}}ct.create=(e,t)=>new ct({innerType:e,typeName:vt.ZodCatch,catchValue:"function"==typeof t.catch?t.catch:()=>t.catch,...be(t)});class lt extends we{_parse(e){if(this._getType(e)!==ee.nan){const t=this._getOrReturnCtx(e);return ue(t,{code:ne.invalid_type,expected:ee.nan,received:t.parsedType}),le}return{status:"valid",value:e.data}}}lt.create=e=>new lt({typeName:vt.ZodNaN,...be(e)});const pt=Symbol("zod_brand");class dt extends we{_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 ft extends we{_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?le:"dirty"===e.status?(t.dirty(),pe(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?le:"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 ft({in:e,out:t,typeName:vt.ZodPipeline})}}const ht=(e,t={},n)=>e?je.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})}})):je.create(),mt={object:We.lazycreate};var vt;!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"}(vt||(vt={}));const yt=Ae.create,gt=ke.create,_t=lt.create,bt=Ie.create,wt=Ne.create,Tt=Ce.create,Et=Me.create,St=xe.create,Pt=Re.create,At=je.create,Ot=De.create,kt=Ue.create,It=Be.create,Nt=Ze.create,Ct=We.create,Mt=We.strictCreate,xt=Ge.create,Rt=He.create,jt=Ve.create,Dt=Je.create,Ut=qe.create,Bt=$e.create,Zt=Ye.create,Lt=Qe.create,zt=Xe.create,Wt=et.create,Gt=nt.create,Ft=rt.create,Ht=it.create,Kt=ot.create,Vt=at.create,Jt=st.create,qt=ot.createWithPreprocess,$t=ft.create,Yt={string:e=>Ae.create({...e,coerce:!0}),number:e=>ke.create({...e,coerce:!0}),boolean:e=>Ne.create({...e,coerce:!0}),bigint:e=>Ie.create({...e,coerce:!0}),date:e=>Ce.create({...e,coerce:!0})},Qt=le;var Xt,en,tn,nn,rn,on,an,sn,un,cn,ln,pn,dn,fn,hn,mn,vn,yn=Object.freeze({__proto__:null,defaultErrorMap:ie,setErrorMap:function(e){oe=e},getErrorMap:ae,makeIssue:se,EMPTY_PATH:[],addIssueToContext:ue,ParseStatus:ce,INVALID:le,DIRTY:pe,OK:de,isAborted:fe,isDirty:he,isValid:me,isAsync:ve,get util(){return p},ZodParsedType:ee,getParsedType:te,ZodType:we,ZodString:Ae,ZodNumber:ke,ZodBigInt:Ie,ZodBoolean:Ne,ZodDate:Ce,ZodSymbol:Me,ZodUndefined:xe,ZodNull:Re,ZodAny:je,ZodUnknown:De,ZodNever:Ue,ZodVoid:Be,ZodArray:Ze,get objectUtil(){return Le},ZodObject:We,ZodUnion:Ge,ZodDiscriminatedUnion:He,ZodIntersection:Ve,ZodTuple:Je,ZodRecord:qe,ZodMap:$e,ZodSet:Ye,ZodFunction:Qe,ZodLazy:Xe,ZodLiteral:et,ZodEnum:nt,ZodNativeEnum:rt,ZodPromise:it,ZodEffects:ot,ZodTransformer:ot,ZodOptional:at,ZodNullable:st,ZodDefault:ut,ZodCatch:ct,ZodNaN:lt,BRAND:pt,ZodBranded:dt,ZodPipeline:ft,custom:ht,Schema:we,ZodSchema:we,late:mt,get ZodFirstPartyTypeKind(){return vt},coerce:Yt,any:At,array:Nt,bigint:bt,boolean:wt,date:Tt,discriminatedUnion:Rt,effect:Kt,enum:Gt,function:Lt,instanceof:(e,t={message:`Input not instance of ${e.name}`})=>ht((t=>t instanceof e),t,!0),intersection:jt,lazy:zt,literal:Wt,map:Bt,nan:_t,nativeEnum:Ft,never:kt,null:Pt,nullable:Jt,number:gt,object:Ct,oboolean:()=>wt().optional(),onumber:()=>gt().optional(),optional:Vt,ostring:()=>yt().optional(),pipeline:$t,preprocess:qt,promise:Ht,record:Ut,set:Zt,strictObject:Mt,string:yt,symbol:Et,transformer:Kt,tuple:Dt,undefined:St,union:xt,unknown:Ot,void:It,NEVER:Qt,ZodIssueCode:ne,quotelessJson:e=>JSON.stringify(e,null,2).replace(/"([^"]+)":/g,"$1:"),ZodError:re});function gn(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")}}e.NetworkType=void 0,(Xt=e.NetworkType||(e.NetworkType={})).none="none",Xt.wifi="wifi",Xt.cellular="cellular",Xt.unknown="unknown",e.PlatformType=void 0,(en=e.PlatformType||(e.PlatformType={})).wp="wp",en.android="android",en.iOS="iOS",en.unknown="unknown",e.Events=void 0,(tn=e.Events||(e.Events={})).AppPaused="h5.event.paused",tn.AppResumed="h5.event.resumed",tn.NetworkChanged="h5.event.connection.changed",tn.OnDataCallback="h5.event.webview.result",tn.WebviewClosed="h5.event.webview.close",tn.OpenApp="h5.event.open.mp",tn.AppClose="h5.event.action.close",tn.PaymentCallback="payment.callback",tn.PaymentResult="action.payment.result",tn.PaymentClose="action.payment.close",e.JumpStatus=void 0,(nn=e.JumpStatus||(e.JumpStatus={})).DOING="doing",nn.DONE="done",e.ProfileType=void 0,(rn=e.ProfileType||(e.ProfileType={}))[rn.user=1]="user",rn[rn.oa=0]="oa",rn[rn.aliasOA=2]="aliasOA",e.ChatType=void 0,(on=e.ChatType||(e.ChatType={}))[on.user=1]="user",on[on.oa=0]="oa",e.PostFeedType=void 0,(an=e.PostFeedType||(e.PostFeedType={}))[an.image=1]="image",an[an.link=4]="link",an[an.profile=5]="profile",e.ShareSheetType=void 0,(sn=e.ShareSheetType||(e.ShareSheetType={}))[sn.image=1]="image",sn[sn.gif=11]="gif",sn[sn.video=12]="video",sn[sn.link=4]="link",sn[sn.oa=5]="oa",sn[sn.zmp=20]="zmp",sn[sn.multi_image=21]="multi_image",sn[sn.zmp_deep_link=4]="zmp_deep_link",e.OrientationType=void 0,(un=e.OrientationType||(e.OrientationType={}))[un.auto=1]="auto",un[un.portrait=2]="portrait",un[un.landscape=3]="landscape",e.VibrateType=void 0,(cn=e.VibrateType||(e.VibrateType={}))[cn.oneShot=0]="oneShot",e.MediaPickerType=void 0,(ln=e.MediaPickerType||(e.MediaPickerType={}))[ln.zcamera=3]="zcamera",ln[ln.zcamera_photo=1]="zcamera_photo",ln[ln.zcamera_video=2]="zcamera_video",ln[ln.zcamera_scan=7]="zcamera_scan",ln[ln.photo=4]="photo",ln[ln.video=5]="video",ln[ln.file=6]="file",e.IAPPayType=void 0,(pn=e.IAPPayType||(e.IAPPayType={})).SUBSCRIPTION="SUBSCRIPTION",pn.ONETIME="ONETIME",e.ProrationMode=void 0,(dn=e.ProrationMode||(e.ProrationMode={}))[dn.UNKNOW=0]="UNKNOW",dn[dn.DEFERRED=1]="DEFERRED",dn[dn.IMMEDIATE_AND_CHARGE_FULL_PRICE=2]="IMMEDIATE_AND_CHARGE_FULL_PRICE",e.StatusBarType=void 0,(fn=e.StatusBarType||(e.StatusBarType={}))[fn.normal=1]="normal",fn[fn.hidden=0]="hidden",fn[fn.transparent=2]="transparent",e.AndroidBottomNavigationBarType=void 0,(hn=e.AndroidBottomNavigationBarType||(e.AndroidBottomNavigationBarType={}))[hn.show=1]="show",hn[hn.hide=0]="hide",e.IOSSafeAreaBottomType=void 0,(mn=e.IOSSafeAreaBottomType||(e.IOSSafeAreaBottomType={}))[mn.show=1]="show",mn[mn.hide=0]="hide",e.TextAlignType=void 0,(vn=e.TextAlignType||(e.TextAlignType={}))[vn.left=0]="left",vn[vn.center=1]="center";var _n,bn=function(t){return t.isAndroid?e.PlatformType.android:t.isIOS?e.PlatformType.iOS:e.PlatformType.unknown};function wn(e){var t=e.split("zalo")[1];return t&&t.replace(" ","").split("/")[1]||""}function Tn(){var e=function(){var e=X((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:gn(),platform:t,platformName:bn(t),zaloVersion:wn(e).trim()}}}();if(e)return e}var En=(null===(_n=Tn())||void 0===_n?void 0:_n.appEnv)||{};function Sn(e){Sn.on&&Sn.engine(e)}Sn.on=!1,Sn.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 Pn=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),Sn({stage:t.NOT_FOUND,type:"error",name:e,request:n,state:"fail",response:i})};function An(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function On(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){An(e,t,n[t])}))}return e}function kn(e,t){return function(e){if(Array.isArray(e))return e}(e)||q(e)||$(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 In="undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{};function Nn(){throw new Error("setTimeout has not been defined")}function Cn(){throw new Error("clearTimeout has not been defined")}var Mn=Nn,xn=Cn;function Rn(e){if(Mn===setTimeout)return setTimeout(e,0);if((Mn===Nn||!Mn)&&setTimeout)return Mn=setTimeout,setTimeout(e,0);try{return Mn(e,0)}catch(t){try{return Mn.call(null,e,0)}catch(t){return Mn.call(this,e,0)}}}"function"==typeof In.setTimeout&&(Mn=setTimeout),"function"==typeof In.clearTimeout&&(xn=clearTimeout);var jn,Dn=[],Un=!1,Bn=-1;function Zn(){Un&&jn&&(Un=!1,jn.length?Dn=jn.concat(Dn):Bn=-1,Dn.length&&Ln())}function Ln(){if(!Un){var e=Rn(Zn);Un=!0;for(var t=Dn.length;t;){for(jn=Dn,Dn=[];++Bn<t;)jn&&jn[Bn].run();Bn=-1,t=Dn.length}jn=null,Un=!1,function(e){if(xn===clearTimeout)return clearTimeout(e);if((xn===Cn||!xn)&&clearTimeout)return xn=clearTimeout,clearTimeout(e);try{xn(e)}catch(t){try{return xn.call(null,e)}catch(t){return xn.call(this,e)}}}(e)}}function zn(e,t){this.fun=e,this.array=t}zn.prototype.run=function(){this.fun.apply(null,this.array)};function Wn(){}var Gn=Wn,Fn=Wn,Hn=Wn,Kn=Wn,Vn=Wn,Jn=Wn,qn=Wn;var $n=In.performance||{},Yn=$n.now||$n.mozNow||$n.msNow||$n.oNow||$n.webkitNow||function(){return(new Date).getTime()};var Qn=new Date;var Xn,er={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];Dn.push(new zn(e,t)),1!==Dn.length||Un||Rn(Ln)},title:"browser",browser:!0,env:{},argv:[],version:"",versions:{},on:Gn,addListener:Fn,once:Hn,off:Kn,removeListener:Vn,removeAllListeners:Jn,emit:qn,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*Yn.call($n),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-Qn)/1e3}},tr=er,nr="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function rr(e){return e&&e.constructor===Symbol?"symbol":typeof e}function ir(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 nr?nr:"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 tr&&tr.env&&"true"===tr.env.REFLECT_METADATA_USE_MAP_POLYFILL,p=l||"function"!=typeof Map||"function"!=typeof Map.prototype.entries?ee():Map,d=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(j(n)){if(!F(e))throw new TypeError;if(!K(t))throw new TypeError;return S(e,t)}if(!F(e))throw new TypeError;if(!B(t))throw new TypeError;if(!B(r)&&!j(r)&&!D(r))throw new TypeError;return D(r)&&(r=void 0),P(e,t,n=G(n),r)}function m(e,t){function n(n,r){if(!B(n))throw new TypeError;if(!j(r)&&!V(r))throw new TypeError;C(e,t,n,r)}return n}function v(e,t,n,r){if(!B(n))throw new TypeError;return j(r)||(r=G(r)),C(e,t,n,r)}function y(e,t,n){if(!B(t))throw new TypeError;return j(n)||(n=G(n)),O(e,t,n)}function g(e,t,n){if(!B(t))throw new TypeError;return j(n)||(n=G(n)),k(e,t,n)}function _(e,t,n){if(!B(t))throw new TypeError;return j(n)||(n=G(n)),I(e,t,n)}function b(e,t,n){if(!B(t))throw new TypeError;return j(n)||(n=G(n)),N(e,t,n)}function w(e,t){if(!B(e))throw new TypeError;return j(t)||(t=G(t)),M(e,t)}function T(e,t){if(!B(e))throw new TypeError;return j(t)||(t=G(t)),x(e,t)}function E(e,t,n){if(!B(t))throw new TypeError;j(n)||(n=G(n));var r=A(t,n,!1);if(j(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(!j(r)&&!D(r)){if(!K(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(!j(o)&&!D(o)){if(!B(o))throw new TypeError;r=o}}return r}function A(e,t,n){var r=f.get(e);if(j(r)){if(!n)return;r=new p,f.set(e,r)}var i=r.get(t);if(j(i)){if(!n)return;i=new p,r.set(t,i)}return i}function O(e,t,n){if(k(e,t,n))return!0;var r=X(t);return!D(r)&&O(e,r,n)}function k(e,t,n){var r=A(t,n,!1);return!j(r)&&z(r.has(e))}function I(e,t,n){if(k(e,t,n))return N(e,t,n);var r=X(t);return D(r)?void 0:I(e,r,n)}function N(e,t,n){var r=A(t,n,!1);if(!j(r))return r.get(e)}function C(e,t,n,r){A(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 d,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,p=i;l<p.length;l++){c=p[l];o.has(c)||(o.add(c),a.push(c))}return a}function x(e,t){var n=[],r=A(e,t,!1);if(j(r))return n;for(var i=q(r.keys()),o=0;;){var a=Y(i);if(!a)return n.length=o,n;var s=$(a);try{n[o]=s}catch(e){try{Q(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 j(e){return void 0===e}function D(e){return null===e}function U(e){return"symbol"==typeof e}function B(e){return"object"==typeof e?null!==e:"function"==typeof e}function Z(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(B(o))throw new TypeError;return o}return L(e,"default"===n?"number":n)}function L(e,t){if("string"===t){var n=e.toString;if(H(n))if(!B(i=n.call(e)))return i;if(H(r=e.valueOf))if(!B(i=r.call(e)))return i}else{var r;if(H(r=e.valueOf))if(!B(i=r.call(e)))return i;var i,o=e.toString;if(H(o))if(!B(i=o.call(e)))return i}throw new TypeError}function z(e){return!!e}function W(e){return""+e}function G(e){var t=Z(e,3);return U(t)?t:W(t)}function F(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 K(e){return"function"==typeof e}function V(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(!B(n))throw new TypeError;return n}function $(e){return e.value}function Y(e){var t=e.next();return!t.done&&t}function Q(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 p}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",b),e("getMetadataKeys",w),e("getOwnMetadataKeys",T),e("deleteMetadata",E)}(r)}()}(Xn||(Xn={}));var or=Object.prototype.toString;var ar="[object Null]",sr="[object Undefined]";function ur(e){return null==e?void 0===e?sr:ar:function(e){return or.call(e)}(e)}function cr(e){return null!=e&&"object"==typeof e}var lr={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||cr(e)&&"[object Number]"==ur(e)},isArray:function(e){return Array.isArray(e)},isRegExp:function(e){return cr(e)&&"[object RegExp]"==ur(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 pr(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function dr(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 fr(e){return fr=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},fr(e)}function hr(e){return fr(e)}function mr(e,t,n){return mr="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=hr(e)););return e}(e,t);if(r){var i=Object.getOwnPropertyDescriptor(r,t);return i.get?i.get.call(n||e):i.value}},mr(e,t,n)}function vr(e,t,n){return mr(e,t,n)}function yr(e,t){return yr=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},yr(e,t)}function gr(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&&yr(e,t)}function _r(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function br(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=hr(e);if(t){var i=hr(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return function(e,t){return!t||"object"!==rr(t)&&"function"!=typeof t?_r(e):t}(this,n)}}var wr=function(e,t){return e(t={exports:{}},t.exports),t.exports
11
11
  /*! *****************************************************************************
12
12
  Copyright (C) Microsoft. All rights reserved.
13
13
  Licensed under the Apache License, Version 2.0 (the "License"); you may not use
@@ -21,4 +21,4 @@
21
21
 
22
22
  See the Apache Version 2.0 License for specific language governing permissions
23
23
  and limitations under the License.
24
- ***************************************************************************** */}((function(e){var t=Object.prototype.hasOwnProperty,n="~";function r(){}function i(e,t,n){this.fn=e,this.context=t,this.once=n||!1}function o(e,t,r,o,a){if("function"!=typeof r)throw new TypeError("The listener must be a function");var s=new i(r,o||e,a),u=n?n+t:t;return e._events[u]?e._events[u].fn?e._events[u]=[e._events[u],s]:e._events[u].push(s):(e._events[u]=s,e._eventsCount++),e}function a(e,t){0==--e._eventsCount?e._events=new r:delete e._events[t]}function s(){this._events=new r,this._eventsCount=0}Object.create&&(r.prototype=Object.create(null),(new r).__proto__||(n=!1)),s.prototype.eventNames=function(){var e,r,i=[];if(0===this._eventsCount)return i;for(r in e=this._events)t.call(e,r)&&i.push(n?r.slice(1):r);return Object.getOwnPropertySymbols?i.concat(Object.getOwnPropertySymbols(e)):i},s.prototype.listeners=function(e){var t=n?n+e:e,r=this._events[t];if(!r)return[];if(r.fn)return[r.fn];for(var i=0,o=r.length,a=new Array(o);i<o;i++)a[i]=r[i].fn;return a},s.prototype.listenerCount=function(e){var t=n?n+e:e,r=this._events[t];return r?r.fn?1:r.length:0},s.prototype.emit=function(e,t,r,i,o,a){var s=n?n+e:e;if(!this._events[s])return!1;var u,c,l=this._events[s],p=arguments.length;if(l.fn){switch(l.once&&this.removeListener(e,l.fn,void 0,!0),p){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(p-1);c<p;c++)u[c-1]=arguments[c];l.fn.apply(l.context,u)}else{var d,f=l.length;for(c=0;c<f;c++)switch(l[c].once&&this.removeListener(e,l[c].fn,void 0,!0),p){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(d=1,u=new Array(p-1);d<p;d++)u[d-1]=arguments[d];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})),Tr="ACTION_CALLBACK";var Er=function(t){gr(r,t);var n=wr(r);function r(){var e;return pr(this,r),(e=n.apply(this,arguments)).debug=ir("zmp:event-emitter"),e}var i=r.prototype;return i.h5ConfirmHandleEvent=function(e,t,n){ZaloJavaScriptInterface.jsH5EventCallback(e,t,n||"")},i.on=function(t,n,i){var o=this;if(t===Tr||t===e.Events.PaymentCallback)return vr(hr(r.prototype),"on",this).call(this,t,n,i);this.debug("register ".concat(String(t),": ").concat(i));return vr(hr(r.prototype),"on",this).call(this,t,(function(e,r){o.h5ConfirmHandleEvent(e,t,i),n(r)}),i)},i.once=function(e,t,n){var i=this;if(e===Tr)return vr(hr(r.prototype),"once",this).call(this,e,t,n);this.debug("register once ".concat(String(e),": ").concat(n));return vr(hr(r.prototype),"once",this).call(this,e,(function(r,o){i.h5ConfirmHandleEvent(r,e,n),t(o)}),n)},r.getInstance=function(){return r.instance||(r.instance=new r),r.instance},r}(br);function Sr(e){Er.getInstance().emit(Tr,e)}function Ar(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){Sr({serialId:e,actionName:t,result:n})}},window.zaloJSV2={zalo_h5_event_handler:function(t,n,r){var o=ir("zmp:zalo_h5_event_handler");o("eventId: ".concat(t,", eventName: ").concat(n,", eventData: ").concat(r));var a=ei(r);o("stringToData",a);var s=function(t,n){try{if(t===e.Events.OpenApp){var r=n.url,o=new URL(r),a=o.pathname.split("/zapps/".concat(i))[1];return{path:"".concat(a||"/").concat(o.search)}}return n}catch(e){return n}}(n,a);Er.getInstance().emit(n,t,s)}},window.zaloNative2JS={nativeCall:function(t,n,r){Er.getInstance().emit(e.Events.PaymentCallback,t,n,r)}};var Or={encode:Ar,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:Ar(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":rr(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":rr(r))?JSON.stringify(r):encodeURIComponent(r)].join("=");n.push(i)})),n.join("&")}},Pr={},kr=function(e,t,n){var r=t||"default";return function(){return(r in Pr?Pr[r](e,n):e).apply(this,arguments)}};kr.setWrapper=function(e){Pr[arguments.length<=1||void 0===arguments[1]?"default":arguments[1]]=e};var Ir={error:{code:1,error_subcode:1357046,message:"Received Invalid JSON reply.",type:"http"}};function Nr(e){try{return null===e?Ir:JSON.parse(e)}catch(e){return Ir}}var Cr,Mr={execute:function(e,t,n,r){n.suppress_http_code=1;var i=Or.encode(n);"post"!=t&&(e=Or.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=kr((function(){o=r,"onload"in i&&i.onload(n)}),"entry","XMLHttpRequest:load"),a=kr((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(Nr(e.responseText))},o.onerror=function(e){e.responseText?r(Nr(e.responseText)):r({error:{code:1,error_subcode:1357045,message:"unknown error (empty response)",status:e.status,type:"http"}})},o.send(i),!0)}},xr=Mr,Rr=(Cr=V((function(e,t,n){var r,i,o,a;return Q(this,(function(s){switch(s.label){case 0:return r={appId:e,versionStatus:t},lr.isUndefined(n)||(r.currentVersion=n),i=Or.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 Cr.apply(this,arguments)});function jr(e){try{var t=e.map((function(e){return{action:e.action,error:e.error,message:e.message,data:e.data}}));xr.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 Dr=function(e){return e.replace(/[A-Z]/g,(function(e){return"_".concat(e.toLowerCase())}))},Ur=function(){var e,t,n=Number((null===(e=Tn())||void 0===e?void 0:e.zaloVersion)||""),r=((null===(t=Tn())||void 0===t?void 0:t.platformName)||"").toLowerCase();return"android"===r?n%1e4:n};function Br(e,t){return null!=t&&"undefined"!=typeof Symbol&&t[Symbol.hasInstance]?!!t[Symbol.hasInstance](e):e instanceof t}var Zr,Lr,zr=function(){function e(t,n,r,i){pr(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}(),Wr=function(e,t){return Br(e,zr)?function(e,t){return e.api=t,e.toJSON()}(e,t):function(e,t){return Br(e,Error)?new zr(f,e.message,t).toJSON():lr.isEmpty(null==e?void 0:e.message)||lr.isEmpty(null==e?void 0:e.code)?new zr(f,T,t,e).toJSON():new zr(e.code,e.message,t,e.detail).toJSON()}(e,t)},Gr=(Zr=V((function(e){var t;return Q(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,Pn({method:"GET"},t))];case 1:return[4,n.sent().json()];case 2:return[2,n.sent()]}}))})),function(e){return Zr.apply(this,arguments)}),Fr=V((function(){return Q(this,(function(e){return[2,new Promise(function(){var e=V((function(e,t){var n,r,i,o;return Q(this,(function(a){switch(a.label){case 0:return a.trys.push([0,3,,4]),[4,$r.jumpAndGetToken()];case 1:return a.sent(),(r=null===(n=$r.miniProgramConfig)||void 0===n?void 0:n.jwt)||t(new zr(v,S,"getSetting")),[4,Gr(r)];case 2:return(i=a.sent())&&0===i.err?e({authSetting:i.data}):t(new zr(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)}}())]}))})),Hr=function(){var t,n,r,i=Tn(),o={},a=Er.getInstance(),s=[],u=!1;return u||(n=function(e){var t=e.serialId,n=ti(e.result),r=oi(null==n?void 0:n.action),i=lr.isEmpty(null==n?void 0:n.error_code)?0:null==n?void 0:n.error_code,a=null==n?void 0:n.error_message,u=(null==n?void 0:n.data)||n;if(r&&0===i){var c=JSON.parse(null==n?void 0:n.data);i=lr.isEmpty(null==c?void 0:c.error_code)?0:null==c?void 0:c.error_code,a=null==c?void 0:c.error_message,u=(null==c?void 0:c.data)||c}var l={error_code:i,error_message:a,data:u,action:(null==n?void 0:n.action)||e.actionName};if(t&&o[t]){var p=o[t],d=p.callback,f=p.timeout,h=p.isMultiCallback,m=p.options;!function(e,t){var n=t||{},r=n.success,i=n.fail;0===e.error_code?lr.isFunction(r)&&r(e):lr.isFunction(i)&&i(e)}(l,d),!h&&delete o[t],f&&clearTimeout(f);var v={action:null==l?void 0:l.action,error:null==l?void 0:l.error_code,message:null==l?void 0:l.error_message,data:{}};try{if("action.open.inapp"===l.action||"action.open.outapp"===l.action){var y=new URL(null==m?void 0:m.url),g="".concat(y.protocol,"//").concat(y.host).concat(y.pathname);v.data={url:g}}if("action.follow.oa"===l.action||"action.unfollow.oa"===l.action){var _=null==m?void 0:m.uid;v.data={uid:_}}if("action.open.chat"===l.action){var w=null==m?void 0:m.uId,b=null==m?void 0:m.type;v.data={uid:w,openChatType:b}}}catch(e){}s.push(v)}},Er.getInstance().on(Tr,n),a.on(e.Events.AppPaused,(function(){if(s.length>0){var e=s;s=[],jr(e)}})),t?clearInterval(t):t=setInterval((function(){if(s.length>0){var e=s;s=[],jr(e)}}),5e3),u=!0),r=V((function(e,t,n,r){var a,s,u,c,l,p,d,f,h,m,_,w,b,T,S,A,k,I,N,C,M,x;return Q(this,(function(R){switch(R.label){case 0:return s=Math.floor(1e6*Math.random()),u="".concat(e,"_").concat(s),c="action.".concat(e.replace(/\_/g,".").toLowerCase()),(null==r?void 0:r.actionName)&&r.actionName.length>0&&(c=null==r?void 0:r.actionName),l=(null==r?void 0:r.isMultiCallback)||!1,p=!1!==(null==r?void 0:r.timeout)&&((null==r?void 0:r.timeout)||!0),d=(null==r?void 0:r.haveCallback)||!1,f=(null==r?void 0:r.skipJump)||!1,h=(null==r?void 0:r.requireAccessToken)||!1,m=ai(c),t&&n&&(o[u]={options:t,callback:n,isMultiCallback:l},p&&d&&(o[u].timeout=setTimeout((function(){return Sr({serialId:u,result:{error_code:g,error_message:E,data:{timeout:p},action:e}}),null}),!0===p?8e3:1e3*p))),m?[4,Fr()]:[3,2];case 1:if(!1===(null==(w=R.sent())||null===(_=w.authSetting)||void 0===_?void 0:_["scope.userInfo"]))return Sr({serialId:u,result:{error_code:v,error_message:P,data:{isMobile:null==i||null===(b=i.platform)||void 0===b?void 0:b.isMobile},action:e}}),[2];R.label=2;case 2:return T=oi(c),!(null==i||null===(a=i.platform)||void 0===a?void 0:a.isMobile)||!e||lr.isUndefined(ZaloJavaScriptInterface)||i.platform.isIOS&&!Xr(e)||T&&!1===T.isSupported?(Sr({serialId:u,result:{error_code:y,error_message:O,data:{isMobile:null==i||null===(S=i.platform)||void 0===S?void 0:S.isMobile},action:e}}),[2]):(A=Qr(t),f?[3,4]:[4,$r.getJSAccessToken()]);case 3:return I=R.sent(),[3,5];case 4:I="",R.label=5;case 5:k=I,R.label=6;case 6:return R.trys.push([6,10,,11]),f||!h?[3,8]:[4,$r.getAccessToken()];case 7:return C=R.sent(),[3,9];case 8:C="",R.label=9;case 9:return N=C,[3,11];case 10:return M=R.sent(),Sr({serialId:u,result:{error_code:null==M?void 0:M.code,error_message:null==M?void 0:M.message,action:e}}),[2];case 11:return x=i.platform.isIOS?window.onNativeMessage(u,c):'window.onNativeMessage("'.concat(u,'", "').concat(c,'")'),[2,ZaloJavaScriptInterface.jsCall(k,c,N,A,x)]}}))})),function(e,t,n,i){return r.apply(this,arguments)}}(),Kr={success:function(e,t){return{code:d,message:t||b,data:e||{}}},error:{badRequest:function(e){return new zr(h,e)},loginFailed:function(e){return new zr(v,"".concat(A,": ").concat(e))},loginRequired:function(){return new zr(v,S)},cannotGetShareInfo:function(){return new zr(m,"Can not get app info to share")},createIAPOrderFailed:function(e){var t=Object.keys(H).find((function(t){return t===e.toString()}));return new zr(e,t||T)},clientNotSupport:function(){return new zr(y,O)}}},Vr=(Lr=function(t){var n,r,i,o=null===(n=Tn())||void 0===n?void 0:n.platformName,a=t.action.replace("action.","").replace(/\./g,"_").toUpperCase(),s=C[a],u=(null==s?void 0:s.skipJump)||!1,c=(null==s?void 0:s.errorList)||{};if("JUMP_LOGIN"===a)return new zr(f,"Can not get auth code: ".concat(t.error_message));if($r.jumpStatus!==e.JumpStatus.DONE&&!u)return new zr(N.UNAUTHORIZED.code,N.UNAUTHORIZED.message);if("permission required!"===String(t.error_message).toLowerCase()||"no permission!"===String(t.error_message).toLowerCase())return new zr(N.FORBIDDEN.code,N.FORBIDDEN.message);if(o&&(null===(r=M[o])||void 0===r?void 0:r[t.error_code]))return new zr(M[o][t.error_code].code,M[o][t.error_code].message);var l=null==c||null===(i=c[o])||void 0===i?void 0:i[String(t.error_code)];if(l){var p,d,h,m=null===(p=l.mapTo)||void 0===p?void 0:p.message;return(null==l?void 0:l.needMoreDetail)&&(m="".concat(null==l||null===(h=l.mapTo)||void 0===h?void 0:h.message,": ").concat(t.error_message)),new zr(null===(d=l.mapTo)||void 0===d?void 0:d.code,m)}return new zr(t.error_code,t.error_message)},function(e,n,r,i){var o=function(e,n){function r(r){return function(i){var o=lr.isEmpty(n)?void 0:n[r];if(o)return Sn({stage:t.RESPONSE,type:"log",state:r,name:e,response:i}),o("fail"===r?Lr(i):null==i?void 0:i.data)}}return lr.isUndefined(e)&&(e=""),Object.assign({},{success:r("success"),fail:r("fail")})}(e,r),a=C[e],s=(null==i?void 0:i.delay)||0;setTimeout((function(){Hr(e,n,o,Pn({},i,a))}),s)}),Jr=function(){var e=V((function(e){return Q(this,(function(t){return[2,new Promise((function(t,n){Vr("MP_USER_AUTHORIZE",{scopes:e,forceUpdate:!0},{success:function(e){lr.isEmpty(e)||t(e)},fail:function(e){n(e)}},{isMultiCallback:!1,timeout:!1})}))]}))}));return function(t){return e.apply(this,arguments)}}(),qr=function(){function n(){pr(this,n),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 o,s,u,p=n.prototype;return p.jump=function(){var n=this;return V((function(){return Q(this,(function(r){return[2,new Promise((function(r,i){n._jumpStatus?n._jumpStatus===e.JumpStatus.DONE?r(e.JumpStatus.DONE):r(e.JumpStatus.DOING):(n._jumpStatus=e.JumpStatus.DOING,Sn({stage:t.REQUEST,type:"log",name:"jump"}),Hr("JUMP_LOGIN",{},{success:function(t){var i=t.data;n._miniProgramConfig=(null==i?void 0:i.miniProgramConfig)||{};var o=(null==i?void 0:i.cookiesOAuthLogins)||[],a=o.find((function(e){return e.name===c.JS_TOKEN}));a&&(n._jsAccessToken=a.value,window.ZJSBridge.setJSToken&&window.ZJSBridge.setJSToken(a.value)),n._cookies=o;var s=n._cookies.find((function(e){return e.name===c.ZOAUTH}));(null==s?void 0:s.value)||jr([{action:"action.jump.login",error:-102,message:"no zoauth",data:{}}]),r(e.JumpStatus.DONE)},fail:function(e){jr([{action:"action.jump.login",error:-101,message:e.message||"jump error",data:{}}]),i(e)}},{skipJump:!0}))}))]}))}))()},p.loginZaloV3=function(e,t,n){var r=this;return V((function(){var i;return Q(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=V((function(e){var t,n,i;return Q(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()]}}))}))()},p.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 V((function(){var i,o;return Q(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),lr.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,Pn({method:"POST",body:i},o)).then(function(){var e=V((function(e){var t,n,i,o;return Q(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()]}}))}))()},p.getAccessToken=function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=this;return V((function(){var n,o,a,s,u,l,p,d,f;function h(){return m.apply(this,arguments)}function m(){return(m=V((function(){return Q(this,(function(e){switch(e.label){case 0:return[4,new Promise((function(e){var t=setInterval((function(){(a.getAccessTokenCount<=1||a._accessToken)&&(e("done"),clearInterval(t))}),200)}))];case 1:return[2,e.sent()]}}))}))).apply(this,arguments)}return Q(this,(function(m){switch(m.label){case 0:return o=(new Date).getTime()-t.prevGetAccessTokenTimestamp,(a=t).getAccessTokenCount++,t.getAccessTokenCount>1?[4,h()]:[3,2];case 1:m.sent(),m.label=2;case 2:return t.manualSetAccessToken||t._accessToken.length>0&&o<t.accessTokenExpiresIn&&(null===(n=t._miniProgramConfig)||void 0===n?void 0:n.userAuthorized)?(a.getAccessTokenCount--,[2,Promise.resolve(t._accessToken)]):(t.accessToken="",[4,t.jumpAndGetToken(c.ZOAUTH)]);case 3:return s=m.sent(),[4,t.jumpAndGetToken(c.ZOAUTH_VRF)];case 4:return u=m.sent(),l="zmp.getaccesstoken.fail",e?[4,t.verifyUserAuthorized()]:[3,6];case 5:return p=m.sent(),[3,7];case 6:p=!0,m.label=7;case 7:if(!p)throw a.getAccessTokenCount--,jr([{action:l,error:-104,message:"no user auth",data:{}}]),Kr.error.loginFailed("User Authentication Required");if(!s)return[3,15];m.label=8;case 8:return m.trys.push([8,13,,14]),u?[4,t.loginZaloV4(i,s,u)]:[3,10];case 9:return d=m.sent(),[3,12];case 10:return[4,t.loginZaloV3(i,r,s)];case 11:d=m.sent(),m.label=12;case 12:return[3,14];case 13:return f=m.sent(),d="",console.log("Can not get access token",f),jr([{action:l,error:-103,message:String(f)||"Can not get access token",data:{}}]),[3,14];case 14:return a.getAccessTokenCount--,d||jr([{action:l,error:-101,message:"no accessToken",data:{}}]),[2,Promise.resolve(t._accessToken)];case 15:throw a.getAccessTokenCount--,jr([{action:l,error:-102,message:"no oauth",data:{}}]),Kr.error.loginFailed("Zalo app has not been activated")}}))}))()},p.verifyUserAuthorized=function(){var e=this;return V((function(){var t,n,r,i,o,a;return Q(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=oi("action.mp.user.authorize"))&&r.isSupported?[4,Fr()]:[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,Jr()];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]}}))}))()},p.setAccessToken=function(e){this.manualSetAccessToken=!0,this._accessToken=e,window.ZJSBridge.setZAccSession&&window.ZJSBridge.setZAccSession(e)},p.getJSAccessToken=function(){var e=this;return V((function(){var t;return Q(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)]}}))}))()},p.getSync=function(e){var t;return null===(t=this._cookies.find((function(t){return t.name===e})))||void 0===t?void 0:t.value},p.jumpAndGetToken=function(t){var n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=this;return new Promise(function(){var i=V((function(i){var o,a,s,u;return Q(this,(function(c){switch(c.label){case 0:return!n&&r._cookies.length>0?lr.isString(t)?(o=r._cookies.find((function(e){return e.name===t})),[2,i(null==o?void 0:o.value)]):[2,i("")]:(n&&r._jumpStatus===e.JumpStatus.DONE&&(r._jumpStatus=void 0),a={name:t,cb:function(e){return i(e)}},[4,r.jump()]);case 1:return(s=c.sent())===e.JumpStatus.DONE?(r._jumpStatus=s,r.WAITING_QUEUE.length&&(r.WAITING_QUEUE.forEach((function(e){var t=r._cookies.find((function(t){return t.name===e.name}));e.cb(null==t?void 0:t.value)})),r.WAITING_QUEUE=[]),u=r._cookies.find((function(e){return e.name===a.name})),a.cb(null==u?void 0:u.value)):r.WAITING_QUEUE.push(a),[2]}}))}));return function(e){return i.apply(this,arguments)}}())},n.getInstance=function(){return n.instance||(n.instance=new n),n.instance},o=n,(s=[{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}}])&&dr(o.prototype,s),u&&dr(o,u),n}(),$r=qr.getInstance(),Yr=ir("zmp:utils:common"),Qr=function(e){if(lr.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(Qr(e[r]));return"["+t.join(",")+"]"}if("object"==typeof e){for(var i in t=[],e)t.push('"'+i+'":'+Qr(e[i]));return"{"+t.join(",")+"}"}return e.toString()},Xr=function(e){var t,n,r=C[e],i=(null===(t=Tn())||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},ei=function(e){try{if(e){Yr(e);var t=e.replace(/\\/g,"").replace(/&#39;/g,"'");try{t=decodeURIComponent(atob(e))}catch(e){}return Yr("formattedValue",t,JSON.parse(t),rr(JSON.parse(t))),JSON.parse(t)}return null}catch(t){return Yr("parse json error:",t),e}},ti=function(e){if(lr.isObject(JSON)&&JSON.parse&&lr.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 lr.isObject(e)?e:new Function("return "+e)()},ni=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""},ri=function(e){return btoa(encodeURIComponent(JSON.stringify(e)))};var ii=function(t){return"hidden"===t?e.StatusBarType.hidden:"transparent"===t?e.StatusBarType.transparent:e.StatusBarType.normal},oi=function(e){if(void 0!==e){var t=$r.miniProgramConfig;return((null==t?void 0:t.dynamicApis)||[]).find((function(t){return t.action===e&&!1===t.clientHandle}))}},ai=function(e){if(void 0===e)return!1;var t=$r.miniProgramConfig;return((null==t?void 0:t.requiredAuthenList)||[]).indexOf(e)>=0},si=function(){var e=V((function(){return Q(this,(function(e){return[2,new Promise(function(){var e=V((function(e,t){var n;return Q(this,(function(t){switch(t.label){case 0:return t.trys.push([0,2,,3]),[4,$r.jumpAndGetToken()];case 1:return t.sent(),n=$r.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 ui(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=Kr.error.badRequest(s);throw c.detail=a,Wr(c,e)}u.push(i.data)}));var c=r.apply(void 0,Y(u));return lr.isPromise(c)?new Promise((function(t,n){c.then((function(e){if(!lr.isNull(a)&&lr.isFunction(a))return a(e);t(c)})).catch((function(t){var r=Wr(t,e);if(!lr.isNull(s)&&lr.isFunction(s))return s(r);n(r)}))})):c}catch(t){if(!lr.isNull(s)&&lr.isFunction(s))return s(t);throw Wr(t,e)}}function ci(e){return li.apply(this,arguments)}function li(){return(li=V((function(e){return Q(this,(function(t){return[2,ui("login",[],[e],V((function(){return Q(this,(function(e){switch(e.label){case 0:return En.isMp?[4,$r.jumpAndGetToken(c.ZOAUTH)]:[3,2];case 1:return e.sent(),[2,"Success"];case 2:return En.isMpWeb?[2,Promise.resolve("")]:[2,Promise.reject(An("login",{}))]}}))})))]}))}))).apply(this,arguments)}function pi(e){return di.apply(this,arguments)}function di(){return(di=V((function(e){return Q(this,(function(t){return[2,ui("getAccessToken",[],[e],V((function(){var e;return Q(this,(function(t){switch(t.label){case 0:return En.isMp?[4,si()]:[3,3];case 1:return e=!t.sent(),[4,$r.getAccessToken(e)];case 2:return[2,t.sent()||""];case 3:return En.isMpWeb?[2,Promise.resolve("")]:[2,Promise.reject(An("getAccessToken",{}))]}}))})))]}))}))).apply(this,arguments)}var fi="2.37.1";function hi(){return ui("getVersion",[],[],(function(){return fi}))}function mi(){var e,t;return{version:ni("version-id")||"",apiVersion:fi,zaloVersion:(null===(e=Tn())||void 0===e?void 0:e.zaloVersion)||"",platform:(null===(t=Tn())||void 0===t?void 0:t.platformName)||"",language:navigator.language,zaloLanguage:window.zLanguage||"vi",zaloTheme:window.zTheme||"light"}}function vi(){return ui("getSystemInfo",[],[],(function(){return mi()}))}var yi=function(){function t(){var e,n,r,o,s,u,c,l,p,d,f,h,m,v,y,g,_,w,b,T,E,S,A,O,P,k,I;pr(this,t),this.initConfig=window.APP_CONFIG;var N=lr.isString(null===(e=this.initConfig)||void 0===e||null===(n=e.app)||void 0===n?void 0:n.headerColor)&&(null===(r=this.initConfig)||void 0===r||null===(o=r.app)||void 0===o||null===(s=o.headerColor)||void 0===s?void 0:s.length)>0?z:W;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===(p=l.app)||void 0===p?void 0:p.hideAndroidBottomNavigationBar);var C,M,x="none"===(null===(d=this.initConfig)||void 0===d||null===(f=d.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)?L.HIDE_BACK:L.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)?L.SHOW_HOME:L.HIDE_HOME,j=new URL(location.href),D=ii(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)&&(N=(null===(C=this.initConfig)||void 0===C||null===(M=C.app)||void 0===M?void 0:M.actionBarHidden)?W:z);this.config={actionbarType:N,buttonType:x,statusbarType:D,dataConfig:{backgroundColor:(null===(S=this.initConfig)||void 0===S||null===(A=S.app)||void 0===A?void 0:A.headerColor)||G,textColor:(null===(O=this.initConfig)||void 0===O||null===(P=O.app)||void 0===P?void 0:P.textColor)||"",textAlign:(null===(k=this.initConfig)||void 0===k||null===(I=k.app)||void 0===I?void 0:I.textAlign)||F,viewInLeftType:x,confirmToExit:1},homeConfig:{enable:R,url:"".concat(a,"/").concat(i,"/").concat(j.search)}}}var n=t.prototype;return n.setNavigationBarTitle=function(e){return V((function(){return Q(this,(function(t){return[2,new Promise((function(t,n){Vr("CHANGE_TITLE_HEADER",{title:e},{success:function(){t(),document.title=e},fail:function(e){n(e)}},{timeout:!1})}))]}))}))()},n.setNavigationBarLeftButton=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.config.dataConfig.confirmToExit,n=this;return V((function(){var r,i;return Q(this,(function(o){return void 0===(void 0===e?"undefined":rr(e))&&null===(void 0===e?"undefined":rr(e))||(r="none"===e||"home"===e?L.HIDE_BACK:L.SHOW_BACK,i="home"===e||"both"===e?L.SHOW_HOME:L.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){Vr("CHANGE_ACTIONBAR_LEFTBUTTON_TYPE",Pn({},n.config),{success:function(){e()},fail:function(e){t(e)}},{timeout:!1})}))]}))}))()},n.setAndroidBottomNavigationBar=function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],n=this;return V((function(){var r,i,o;return Q(this,(function(a){return i=t?e.AndroidBottomNavigationBarType.hide:e.AndroidBottomNavigationBarType.show,o=null===(r=Tn())||void 0===r?void 0:r.platform,[2,new Promise((function(e,r){if(!(null==o?void 0:o.isAndroid))return e();Vr("CHANGE_BOTTOMBAR",{bottombarType:i},{success:function(){n.hideAndroidBottomNavigationBar=!!t,window.ANDROID_BOTTOM_NAVIGATION_BAR_HIDDEN=!!t,e()},fail:function(e){r(e)}},{timeout:!1})}))]}))}))()},n.setIOSBottomSafeArea=function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],n=this;return V((function(){var r,i,o;return Q(this,(function(a){return i=t?e.IOSSafeAreaBottomType.hide:e.IOSSafeAreaBottomType.show,o=null===(r=Tn())||void 0===r?void 0:r.platform,[2,new Promise((function(e,r){if(!(null==o?void 0:o.isIOS))return e();Vr("CHANGE_BOTTOMBAR",{bottombarType:i},{success:function(){n.hideIOSSafeAreaBottom=!!t,window.IOS_BOTTOM_SAFE_AREA_HIDDEN=!!t,e()},fail:function(e){r(e)}},{timeout:!1,delay:200})}))]}))}))()},n.configHeader=function(t){var n=this;return V((function(){var r;return Q(this,(function(i){return r=n.config,lr.isString(t.headerColor)&&(r.dataConfig.backgroundColor=t.headerColor),lr.isString(t.headerTextColor)&&(r.dataConfig.textColor=t.headerTextColor),lr.isString(t.textAlign)&&("left"===t.textAlign?r.dataConfig.textAlign=e.TextAlignType.left:"center"===t.textAlign&&(r.dataConfig.textAlign=e.TextAlignType.center)),!0===t.hideActionBar?r.actionbarType=W:!1===t.hideActionBar&&(r.actionbarType=z),"normal"===t.statusBarType?r.statusbarType=e.StatusBarType.normal:"hidden"===t.statusBarType?r.statusbarType=e.StatusBarType.hidden:"transparent"===t.statusBarType&&(r.statusbarType=e.StatusBarType.transparent),[2,new Promise((function(i,o){Vr("CHANGE_ACTIONBAR",Pn({},r),{success:function(){var o;n.config=Pn({},r);var a,s=null===(o=Tn())||void 0===o?void 0:o.platform;window.STATUS_BAR_TYPE=(a=n.config.statusbarType)===e.StatusBarType.hidden?"hidden":a===e.StatusBarType.transparent?"transparent":"normal",window.ACTION_BAR_HIDDEN=n.config.actionbarType===W;var u=null===document||void 0===document?void 0:document.querySelector(":root");if(null==s?void 0:s.isAndroid){var c=0;if(("hidden"===t.statusBarType||"transparent"===t.statusBarType)&&t.hideActionBar){var l=window.ANDROID_STATUS_BAR_HEIGHT;isNaN(l)&&(l=Math.round(ZaloJavaScriptInterface.getStatusBarHeight()/window.devicePixelRatio)),c=l}c?null==u||u.style.setProperty("--zaui-safe-area-inset-top","".concat(c,"px")):null==u||u.style.setProperty("--zaui-safe-area-inset-top","env(safe-area-inset-top, 0px)")}i()},fail:function(e){o(e)}},{timeout:!1})}))]}))}))()},t.getInstance=function(){return t.instance||(t.instance=new t),t.instance},t}(),gi=yi.getInstance(),_i=[Ct({title:yt()}).optional()];function wi(e){return bi.apply(this,arguments)}function bi(){return bi=V((function(e){return Q(this,(function(t){return[2,ui("setNavigationBarTitle",_i,[e],function(){var e=V((function(e){return Q(this,(function(t){switch(t.label){case 0:return En.isMp?[4,gi.setNavigationBarTitle(e.title)]:[3,2];case 1:return[2,t.sent()];case 2:return En.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(An("setNavigationBarTitle",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),bi.apply(this,arguments)}var Ti=[Ct({color:yt(),textColor:yn.enum(["black","white"]).optional(),statusBarColor:yt().optional()}).optional()];function Ei(e){return Si.apply(this,arguments)}function Si(){return Si=V((function(e){return Q(this,(function(t){return[2,ui("setNavigationBarColor",Ti,[e],function(){var e=V((function(e){return Q(this,(function(t){switch(t.label){case 0:return En.isMp?[4,gi.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 En.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(An("setNavigationBarColor",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Si.apply(this,arguments)}var Ai=[Ct({type:yn.enum(["none","back","home","both"])}).optional()];function Oi(e){return Pi.apply(this,arguments)}function Pi(){return Pi=V((function(e){return Q(this,(function(t){return[2,ui("setNavigationBarLeftButton",Ai,[e],function(){var e=V((function(e){return Q(this,(function(t){switch(t.label){case 0:return En.isMp?[4,gi.setNavigationBarLeftButton(e.type)]:[3,2];case 1:return[2,t.sent()];case 2:return En.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(An("setNavigationBarLeftButton",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Pi.apply(this,arguments)}function ki(e,t,n){if(!t.has(e))throw new TypeError("attempted to "+n+" private field on non-instance");return t.get(e)}function Ii(e,t){return function(e,t){return t.get?t.get.call(e):t.value}(e,ki(e,t,"get"))}function Ni(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 Ci(e,t,n){return function(e,t,n){if(t.set)t.set.call(e,n);else{if(!t.writable)throw new TypeError("attempted to set read only private field");t.value=n}}(e,ki(e,t,"set"),n),n}var Mi,xi,Ri,ji=new WeakMap,Di=new WeakMap,Ui=new WeakMap,Bi=function(){function e(t){pr(this,e),Ni(this,ji,{writable:!0,value:localStorage}),Ni(this,Di,{writable:!0,value:void 0}),Ni(this,Ui,{writable:!0,value:void 0}),Ci(this,Ui,{keys:new Set,currentSize:0,limitSize:R}),Ci(this,Di,t),this.findAllCurrentDataByApp(t)}var t=e.prototype;return t.findAllCurrentDataByApp=function(e){try{var t;for(t in Ii(this,ji)){if(e)if(t.split("_")[0]!==e)continue;Ii(this,Ui).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 Ii(this,Di)&&(e="".concat(Ii(this,Di),"_").concat(e)),Ii(this,Ui).keys.has(e)?Ii(this,ji).getItem(e):null},t.set=function(e){var t=this;return V((function(){return Q(this,(function(n){return Object.entries(e).forEach((function(e){var n=kn(e,2),r=n[0],i=n[1];t.setSync(r,i.replace(/\\"/g,'"'))})),[2,Promise.resolve({errorKeys:[]})]}))}))()},t.setSync=function(e,t){Ii(this,Di)&&(e="".concat(Ii(this,Di),"_").concat(e)),Ii(this,ji).setItem(e,t),Ii(this,Ui).keys.add(e)},t.getInfo=function(){var e=this;return V((function(){return Q(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}(Ii(this,ji),Ii(this,Di));return{currentSize:lr.isNumber(e)?Number((e/1024).toFixed(2)):0,limitSize:Number((R/1024).toFixed(2))}},t.remove=function(e){var t=this;return V((function(){return Q(this,(function(n){return e.forEach((function(e){t.removeSync(e)})),[2,Promise.resolve({errorKeys:[]})]}))}))()},t.removeSync=function(e){Ii(this,Di)&&(e="".concat(Ii(this,Di),"_").concat(e)),Ii(this,Ui).keys.has(e)&&(Ii(this,ji).removeItem(e),Ii(this,Ui).keys.delete(e))},t.clear=function(){var e=this;return V((function(){return Q(this,(function(t){return[2,Promise.resolve(e.clearSync())]}))}))()},t.clearSync=function(){var e=this;Ii(this,Ui).keys.forEach((function(t){Ii(e,Di)&&t.indexOf(Ii(e,Di))<0||(Ii(e,ji).removeItem(t),Ii(e,Ui).keys.delete(t))}))},e}(),Zi=new WeakMap,Li=new WeakMap,zi=function(){function e(t){pr(this,e),Ni(this,Zi,{writable:!0,value:void 0}),Ni(this,Li,{writable:!0,value:void 0}),Ci(this,Li,{keys:new Set,currentSize:0,limitSize:R}),Ci(this,Zi,t)}var t=e.prototype;return t.get=function(e){var t=this;return V((function(){return Q(this,(function(n){return[2,new Promise((function(n,r){Vr("ZBROWSER_MPDS",{mpds_action:"mpds.get",mpds_data:{keys:e},appId:Ii(t,Zi)},{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 V((function(){return Q(this,(function(n){return[2,new Promise((function(n,r){Vr("ZBROWSER_MPDS",{mpds_action:"mpds.set",mpds_data:{map:e},appId:Ii(t,Zi)},{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 V((function(){return Q(this,(function(t){return[2,new Promise((function(t,n){Vr("ZBROWSER_MPDS",{mpds_action:"mpds.get.size",mpds_data:{},appId:Ii(e,Zi)},{success:function(e){var n=0;e&&e.mpds_data&&e.mpds_data.size&&(n=e.mpds_data.size),t({currentSize:lr.isNumber(n)?Number(Number(n)/1024):0,limitSize:Number(R/1024)})},fail:function(e){n(e)}},{isMultiCallback:!1})}))]}))}))()},t.remove=function(e){var t=this;return V((function(){return Q(this,(function(n){return[2,new Promise((function(n,r){Vr("ZBROWSER_MPDS",{mpds_action:"mpds.remove.key",mpds_data:{keys:e},appId:Ii(t,Zi)},{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 V((function(){return Q(this,(function(t){return[2,new Promise((function(t,n){Vr("ZBROWSER_MPDS",{mpds_action:"mpds.clear.appData",mpds_data:{},appId:Ii(e,Zi)},{success:function(){t()},fail:function(e){n(e)}},{isMultiCallback:!1})}))]}))}))()},e}(),Wi=function(){function e(){pr(this,e)}var t=e.prototype;return t.getDataFromStorage=function(e){var t=this;return V((function(){var n,r;return Q(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]=ei(e)})),[2,r]}}))}))()},t.putDataToStorage=function(e){var t=this;return V((function(){var n,r;return Q(this,(function(i){switch(i.label){case 0:return n=t.getInstance(),r={},Object.entries(e).forEach((function(e){var t=kn(e,2),n=t[0],i=t[1];lr.isUndefined(i)||lr.isNull(i)||(r[n]=ri(i))})),[4,n.set(r)];case 1:return[2,i.sent()]}}))}))()},t.removeDataFromStorage=function(e){var t=this;return V((function(){return Q(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 V((function(){return Q(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 V((function(){return Q(this,(function(t){switch(t.label){case 0:return[4,e.getInstance().getInfo()];case 1:return[2,t.sent()]}}))}))()},e}(),Gi=new WeakMap,Fi=function(e){gr(n,e);var t=wr(n);function n(e){var r;return pr(this,n),Ni(_r(r=t.call(this)),Gi,{writable:!0,value:void 0}),Ci(_r(r),Gi,e),r}return n.prototype.getInstance=function(){return new Bi(Ii(this,Gi))},n}(Wi),Hi=new WeakMap,Ki=function(e){gr(n,e);var t=wr(n);function n(e){var r;return pr(this,n),Ni(_r(r=t.call(this)),Hi,{writable:!0,value:void 0}),Ci(_r(r),Hi,e),r}return n.prototype.getInstance=function(){return new zi(Ii(this,Hi))},n}(Wi),Vi=new Fi(i),Ji=(null===(Mi=Tn())||void 0===Mi?void 0:Mi.zaloVersion)||"",qi=(null===(xi=Tn())||void 0===xi?void 0:xi.platformName)||"unknown";!!lr.isString(Ji)&&parseInt(Ji,10)>={android:12100571,iOS:400,wp:0,unknown:0}[qi]&&(null===(Ri=Tn())||void 0===Ri?void 0:Ri.appEnv.isMp)&&(Vi=new Ki(i));var $i=Vi,Yi=[Ct({data:yn.record(yt(),yn.any())}).optional()];function Qi(e){return Xi.apply(this,arguments)}function Xi(){return Xi=V((function(e){return Q(this,(function(t){return[2,ui("setStorage",Yi,[e],function(){var e=V((function(e){return Q(this,(function(t){switch(t.label){case 0:return En.isMp||En.isMpWeb?[4,$i.putDataToStorage(e.data)]:[3,2];case 1:return[2,t.sent()];case 2:return[2,Promise.reject(An("setStorage",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Xi.apply(this,arguments)}var eo=[Ct({keys:yn.array(yt())}).optional()];function to(e){return no.apply(this,arguments)}function no(){return no=V((function(e){return Q(this,(function(t){return[2,ui("getStorage",eo,[e],function(){var e=V((function(e){return Q(this,(function(t){switch(t.label){case 0:return En.isMp||En.isMpWeb?[4,$i.getDataFromStorage(e.keys)]:[3,2];case 1:return[2,t.sent()];case 2:return[2,Promise.reject(An("getStorage",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),no.apply(this,arguments)}function ro(e){return io.apply(this,arguments)}function io(){return(io=V((function(e){return Q(this,(function(t){return[2,ui("getStorageInfo",[],[e],V((function(){return Q(this,(function(e){switch(e.label){case 0:return En.isMp||En.isMpWeb?[4,$i.getStorageInfo()]:[3,2];case 1:return[2,e.sent()];case 2:return[2,Promise.reject(An("getStorageInfo",{}))]}}))})))]}))}))).apply(this,arguments)}var oo=[Ct({keys:yn.array(yt())}).optional()];function ao(e){return so.apply(this,arguments)}function so(){return so=V((function(e){return Q(this,(function(t){return[2,ui("removeStorage",oo,[e],function(){var e=V((function(e){return Q(this,(function(t){switch(t.label){case 0:return En.isMp||En.isMpWeb?[4,$i.removeDataFromStorage(e.keys)]:[3,2];case 1:return[2,t.sent()];case 2:return[2,Promise.reject(An("removeStorage",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),so.apply(this,arguments)}var uo=[Ct({prefix:yt().optional()}).optional()];function co(e){return lo.apply(this,arguments)}function lo(){return(lo=V((function(e){return Q(this,(function(t){return[2,ui("clearStorage",uo,[e],V((function(){return Q(this,(function(e){switch(e.label){case 0:return En.isMp||En.isMpWeb?[4,$i.clearStorage()]:[3,2];case 1:return[2,e.sent()];case 2:return[2,Promise.reject(An("clearStorage",{}))]}}))})))]}))}))).apply(this,arguments)}var po=function(){var e=V((function(e){var t,n;return Q(this,(function(r){switch(r.label){case 0:return[4,$r.getAccessToken(!0)];case 1:return t=r.sent(),n="id,name,user_id_by_oa,is_sensitive",n=e?"".concat(n,",picture.type(").concat(e,")"):"".concat(n,",picture"),[4,fetch("".concat(l.GET_USER_INFO,"?fields=").concat(n),{headers:{access_token:t||""}}).then(function(){var e=V((function(e){var t,n,r,i;return Q(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:!!i,isSensitive:null==r?void 0:r.is_sensitive}]}}))}));return function(t){return e.apply(this,arguments)}}())];case 2:return[2,r.sent()]}}))}));return function(t){return e.apply(this,arguments)}}(),fo=[Ct({avatarType:yn.enum(["small","normal","large"]).optional()}).optional()];function ho(e){return mo.apply(this,arguments)}function mo(){return mo=V((function(e){return Q(this,(function(t){return[2,ui("getUserInfo",fo,[e],function(){var e=V((function(e){var t;return Q(this,(function(n){switch(n.label){case 0:return En.isMp?(t=null==e?void 0:e.avatarType,[4,po(t)]):[3,2];case 1:return[2,{userInfo:n.sent()}];case 2:return En.isMpWeb?[2,Promise.resolve({userInfo:{id:"3368637342326461234",name:"User Name",avatar:"https://h5.zdn.vn/static/images/avatar.png"}})]:[2,Promise.reject(An("getUserInfo",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),mo.apply(this,arguments)}var vo=function(e){return{NONE:e?-2:0,WIFI:e?0:1,"2G":2,"3G":e?15:2,"4G":e?13:2}},yo=V((function(){return Q(this,(function(t){return[2,new Promise((function(t,n){Vr("WEBVIEW_NETWORKTYPE",{url:window.location.href,featureId:""},{success:function(n){var r,i,o,a=n.network,s=(null===(r=Tn())||void 0===r||null===(i=r.platform)||void 0===i?void 0:i.isAndroid)||!1;switch(a){case vo(s).NONE:o=e.NetworkType.none;break;case vo(s).WIFI:o=e.NetworkType.wifi;break;case vo(s)["2G"]:case vo(s)["3G"]:case vo(s)["4G"]:o=e.NetworkType.cellular;break;default:o=e.NetworkType.unknown}t(o)},fail:function(e){n(e)}},{})}))]}))}));function go(e){return _o.apply(this,arguments)}function _o(){return(_o=V((function(t){return Q(this,(function(n){return[2,ui("getNetworkType",[],[t],V((function(){var t,n;return Q(this,(function(r){switch(r.label){case 0:return En.isMp?[4,yo()]:[3,2];case 1:return[2,{networkType:r.sent()}];case 2:if(En.isMpWeb){switch(t=navigator.connection||navigator.mozConnection||navigator.webkitConnection,t.effectiveType){case"none":n=e.NetworkType.none;break;case"4g":n=e.NetworkType.wifi;break;case"3g":case"2g":n=e.NetworkType.cellular;break;default:n=e.NetworkType.unknown}return[2,Promise.resolve({networkType:n})]}return[2,Promise.reject(An("getNetworkType",{}))]}}))})))]}))}))).apply(this,arguments)}var wo=[yn.function().args(Ct({isConnected:yn.boolean(),networkType:yn.enum(["none","wifi","cellular","unknown"])})).returns(yn.void())];function bo(t){return ui("onNetworkStatusChange",wo,[t],(function(t){var n=t;if(En.isMp)!function(t){Er.getInstance().on(e.Events.NetworkChanged,(function(e){var n=null==e?void 0:e.state;yo().then((function(e){t({isConnected:"CONNECTED"===n,networkType:e})}))}))}(n);else if(En.isMpWeb){var r=navigator.connection||navigator.mozConnection||navigator.webkitConnection,i=r.effectiveType;r.addEventListener("change",(function(){var t;switch(i){case"none":t=e.NetworkType.none;break;case"4g":t=e.NetworkType.wifi;break;case"3g":case"2g":t=e.NetworkType.cellular;break;default:t=e.NetworkType.unknown}n({isConnected:!0,networkType:t})}))}}))}var To=function(){var e=V((function(e){var t,n,r,i,o,a;return Q(this,(function(s){return a={subaction:0,scanning_type:lr.isNumber(null==e?void 0:e.scanningType)?e.scanningType:0,data:{scan_from_source:lr.isString(null==e?void 0:e.scanFromSource)?e.scanFromSource:"",expire:lr.isNumber(null==e?void 0:e.expire)?e.expire:3e3,monitor_interval:lr.isNumber(null==e?void 0:e.monitorInterval)?e.monitorInterval:60,domain:lr.isString(null==e?void 0:e.domain)?e.domain:"",scan_config:{scan_time:lr.isNumber(null==e||null===(t=e.scanConfig)||void 0===t?void 0:t.scanTime)?e.scanConfig.scanTime:15e3,time_between_scan:lr.isNumber(null==e||null===(n=e.scanConfig)||void 0===n?void 0:n.timeBetweenScan)?e.scanConfig.timeBetweenScan:1e4,beacon_timeout:lr.isNumber(null==e||null===(r=e.scanConfig)||void 0===r?void 0:r.beaconTimeout)?e.scanConfig.beaconTimeout:3e4,delayCheckConnectedTimeout:lr.isNumber(null==e||null===(i=e.scanConfig)||void 0===i?void 0:i.delayCheckConnectedTimeout)?e.scanConfig.delayCheckConnectedTimeout:5e3,beaconConnectedTimeout:lr.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){Vr("SCAN_IBEACON",Pn({},a),{success:function(){e(!0)},fail:function(e){t(e)}},{})}))]}))}));return function(t){return e.apply(this,arguments)}}(),Eo=[Ct({scanningType:yn.number().refine((function(e){return[0,1].includes(e)}),{message:"The type must be either 0 or 1"}).default(0).optional(),expire:yn.number().optional(),monitorInterval:yn.number().optional(),domain:yn.string().optional(),scanConfig:Ct({scanTime:yn.number().optional(),timeBetweenScan:yn.number().optional(),beaconTimeout:yn.number().optional(),delayCheckConnectedTimeout:yn.number().optional(),beaconConnectedTimeout:yn.number().optional()}).optional(),items:yn.array(Ct({id:yn.string().optional(),distance:yn.number().optional(),monitor:Ct({enable:yn.boolean().optional(),movingRange:yn.number().optional()}).optional()})).optional(),scanFromSource:yn.string().optional()}).optional()];function So(e){return Ao.apply(this,arguments)}function Ao(){return(Ao=V((function(e){return Q(this,(function(t){return[2,ui("startBeaconDiscovery",Eo,[e],V((function(){return Q(this,(function(t){switch(t.label){case 0:return En.isMp?[4,To(e)]:[3,2];case 1:return[2,t.sent()];case 2:return En.isMpWeb?[2,Promise.resolve(!0)]:[2,Promise.reject(An("startBeaconDiscovery",{}))]}}))})))]}))}))).apply(this,arguments)}var Oo=V((function(){return Q(this,(function(e){return[2,new Promise((function(e,t){Vr("SCAN_IBEACON",{subaction:2},{success:function(){e(!0)},fail:function(e){t(e)}},{})}))]}))}));function Po(e){return ko.apply(this,arguments)}function ko(){return(ko=V((function(e){return Q(this,(function(t){return[2,ui("stopBeaconDiscovery",[],[e],V((function(){return Q(this,(function(e){switch(e.label){case 0:return En.isMp?[4,Oo()]:[3,2];case 1:return[2,e.sent()];case 2:return En.isMpWeb?[2,Promise.resolve(!0)]:[2,Promise.reject(An("stopBeaconDiscovery",{}))]}}))})))]}))}))).apply(this,arguments)}var Io=V((function(){return Q(this,(function(e){return[2,new Promise((function(e,t){Vr("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 No(e){return Co.apply(this,arguments)}function Co(){return(Co=V((function(e){return Q(this,(function(t){return[2,ui("getBeacons",[],[e],V((function(){return Q(this,(function(e){switch(e.label){case 0:return En.isMp?[4,Io()]:[3,2];case 1:return[2,e.sent()];case 2:return En.isMpWeb?[2,Promise.resolve({beacons:[]})]:[2,Promise.reject(An("getBeacons",{}))]}}))})))]}))}))).apply(this,arguments)}var Mo=V((function(){return Q(this,(function(e){return[2,new Promise((function(e,t){Vr("WINDOW_CLOSE",{},{success:function(t){e(t)},fail:function(e){t(e)}},{})}))]}))}));function xo(e){return Ro.apply(this,arguments)}function Ro(){return(Ro=V((function(e){return Q(this,(function(t){return[2,ui("closeApp",[],[e],V((function(){return Q(this,(function(e){switch(e.label){case 0:return En.isMp?[4,Mo()]:[3,2];case 1:return[2,e.sent()];case 2:return En.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(An("closeApp",{}))]}}))})))]}))}))).apply(this,arguments)}var jo=V((function(){return Q(this,(function(e){return[2,new Promise((function(e,t){Vr("OPEN_QR",{skipOpenLink:!0},{success:function(t){e(t)},fail:function(e){t(e)}},{})}))]}))}));function Do(e){return Uo.apply(this,arguments)}function Uo(){return(Uo=V((function(e){return Q(this,(function(t){return[2,ui("scanQRCode",[],[e],V((function(){return Q(this,(function(e){switch(e.label){case 0:return En.isMp?[4,jo()]:[3,2];case 1:return[2,e.sent()];case 2:return En.isMpWeb?[2,Promise.resolve({content:""})]:[2,Promise.reject(An("scanQRCode",{}))]}}))})))]}))}))).apply(this,arguments)}var Bo=function(){var t=V((function(t,n,i,o){return Q(this,(function(a){return[2,new Promise((function(a,s){Vr("OPEN_PROFILE",{uId:t,type:e.ProfileType[n],zapp:r,sourceId:i,sourceIndex:o},{success:function(){a()},fail:function(e){s(e)}},{})}))]}))}));return function(e,n,r,i){return t.apply(this,arguments)}}(),Zo=[Ct({id:yt(),type:yn.enum(["user","oa","aliasOA"]),sourceId:yn.any().optional(),sourceIndex:yn.any().optional()}).optional()];function Lo(e){return zo.apply(this,arguments)}function zo(){return zo=V((function(e){return Q(this,(function(t){return[2,ui("openProfile",Zo,[e],function(){var e=V((function(e){var t,n,r,i;return Q(this,(function(o){switch(o.label){case 0:return En.isMp?(t=e.id,n=e.type,r=e.sourceId,i=e.sourceIndex,[4,Bo(t,n,r,i)]):[3,2];case 1:return[2,o.sent()];case 2:return En.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(An("openProfile",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),zo.apply(this,arguments)}var Wo=function(){var t=V((function(t,n){var i,o,a,s=arguments;return Q(this,(function(u){return i=s.length>2&&void 0!==s[2]?s[2]:"",o=s.length>3?s[3]:void 0,a=s.length>4?s[4]:void 0,[2,new Promise((function(s,u){Vr("OPEN_CHAT",{uId:t,type:e.ChatType[n],msg:i,zapp:r,sourceId:o,sourceIndex:a},{success:function(){s()},fail:function(e){u(e)}},{})}))]}))}));return function(e,n){return t.apply(this,arguments)}}(),Go=[Ct({id:yt(),type:yn.enum(["user","oa"]),sourceId:yn.any().optional(),sourceIndex:yn.any().optional(),message:yt().optional()}).optional()];function Fo(e){return Ho.apply(this,arguments)}function Ho(){return Ho=V((function(e){return Q(this,(function(t){return[2,ui("openChat",Go,[e],function(){var e=V((function(e){var t,n,r,i,o;return Q(this,(function(a){switch(a.label){case 0:return En.isMp?(t=e.id,n=e.type,r=e.message,i=e.sourceId,o=e.sourceIndex,[4,Wo(t,n,r,i,o)]):[3,2];case 1:return[2,a.sent()];case 2:return En.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(An("openChat",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Ho.apply(this,arguments)}function Ko(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 Vo=function(){var t=V((function(t,n){var i;return Q(this,(function(o){switch(i={},t){case"image":i={photoUrl:null==n?void 0:n.imageUrl};break;case"link":i={link:null==n?void 0:n.link,title:null==n?void 0:n.title,thumb:null==n?void 0:n.thumb,description:null==n?void 0:n.description};break;case"profile":i={avt:null==n?void 0:n.avatar,uid:null==n?void 0:n.id,dpn:null==n?void 0:n.displayName}}return[2,new Promise((function(n,o){Vr("OPEN_POSTFEED",Ko(Pn({type:e.PostFeedType[t]},i),{zapp:r}),{success:function(e){n({status:null==e?void 0:e.status,shareType:null==e?void 0:e.share_type,numberOfUser:null==e?void 0:e.uid_to_size})},fail:function(e){o(e)}},{})}))]}))}));return function(e,n){return t.apply(this,arguments)}}(),Jo=[yn.union([Ct({type:yn.enum(["image"]),data:Ct({imageUrl:yt().url().optional()})}),Ct({type:yn.enum(["link"]),data:Ct({link:yt().url(),title:yt().max(100).optional(),thumb:yt().url().optional(),description:yt().max(400).default("").optional()})}),Ct({type:yn.enum(["profile"]),data:Ct({id:yt().optional()})})])];function qo(e){return $o.apply(this,arguments)}function $o(){return $o=V((function(e){return Q(this,(function(t){return[2,ui("openPostFeed",Jo,[e],function(){var e=V((function(e){var t,n;return Q(this,(function(r){switch(r.label){case 0:return En.isMp?(t=e.type,n=e.data,[4,Vo(t,n)]):[3,2];case 1:return[2,r.sent()];case 2:return En.isMpWeb?[2,Promise.resolve({status:1,shareType:0,numberOfUser:0})]:[2,Promise.reject(An("openPostFeed",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),$o.apply(this,arguments)}var Yo=function(){var e=V((function(e){return Q(this,(function(t){return[2,new Promise((function(t,n){Vr("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)}}(),Qo=[Ct({id:yt(),showDialogConfirm:yn.boolean().optional()}).optional()];function Xo(e){return ea.apply(this,arguments)}function ea(){return ea=V((function(e){return Q(this,(function(t){return[2,ui("followOA",Qo,[e],function(){var e=V((function(e){var t;return Q(this,(function(n){switch(n.label){case 0:return En.isMp?(t=e.id,[4,Yo(t)]):[3,2];case 1:return[2,n.sent()];case 2:return En.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(An("followOA",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),ea.apply(this,arguments)}var ta=function(){var e=V((function(e){return Q(this,(function(t){return[2,new Promise((function(t,n){Vr("UNFOLLOW_OA",{uid:e,forceUpdate:!0,zapp:r},{success:function(){t()},fail:function(e){n(e)}},{})}))]}))}));return function(t){return e.apply(this,arguments)}}(),na=[Ct({id:yt()}).optional()];function ra(e){return ia.apply(this,arguments)}function ia(){return ia=V((function(e){return Q(this,(function(t){return[2,ui("unfollowOA",na,[e],function(){var e=V((function(e){var t;return Q(this,(function(n){switch(n.label){case 0:return En.isMp?(t=e.id,[4,ta(t)]):[3,2];case 1:return[2,n.sent()];case 2:return En.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(An("unfollowOA",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),ia.apply(this,arguments)}var oa=function(){var e=V((function(e,t,n,r,i,a){var s,c,p,d,f,h;return Q(this,(function(m){switch(m.label){case 0:return s=new URL(location.href),c=new URLSearchParams,p="".concat(s.pathname.replace(u,"")).concat(s.search),a&&(p="/".concat(e).concat("/"===a[0]?"":"/").concat(a)),d=new URL("".concat(o).concat(p)),c.append("title",n),c.append("description",r||""),c.append("thumbnail",i||""),c.append("url",d.href),c.append("accessToken",t||""),f={headers:{"Content-Type":"application/x-www-form-urlencoded"}},[4,fetch(l.CREATE_SHARE_LINK,Pn({method:"POST",body:c},f))];case 1:return[4,m.sent().json()];case 2:if(!(h=m.sent())||0!==h.err)throw Kr.error.cannotGetShareInfo();return d.search="".concat(d.search,"&zshareId=").concat(h.data.shareId),[2,Ko(Pn({},h.data),{shareableLink:d.href})]}}))}));return function(t,n,r,i,o,a){return e.apply(this,arguments)}}(),aa=function(){var t=V((function(t,n){var o,a,s,u,c,l,p,d,f,h;return Q(this,(function(m){switch(m.label){case 0:switch(o={},a=t,t){case"image":return[3,1];case"gif":return[3,2];case"video":return[3,3];case"link":return[3,4];case"oa":return[3,5];case"zmp":return[3,6];case"zmp_deep_link":return[3,9]}return[3,12];case 1:return l=[],p=(null===(u=Tn())||void 0===u?void 0:u.zaloVersion)||0,d=(null===(c=Tn())||void 0===c?void 0:c.platformName)||"unknown",Number(p)>=x[d]&&(a="multi_image"),Array.isArray(null==n?void 0:n.imageUrls)&&(null==n?void 0:n.imageUrls.length)>0?l=null==n?void 0:n.imageUrls:l.push(null==n?void 0:n.imageUrl),o={photoUrls:l,photoUrl:null==n?void 0:n.imageUrl,caption:null==n?void 0:n.caption},[3,13];case 2:return o={photoUrl:null==n?void 0:n.imageUrl,gifUrl:null==n?void 0:n.gifUrl,width:null==n?void 0:n.width,height:null==n?void 0:n.height},[3,13];case 3:return o={videoThumb:null==n?void 0:n.videoThumb,videoUrl:null==n?void 0:n.videoUrl,width:null==n?void 0:n.width,height:null==n?void 0:n.height},[3,13];case 4:return o={link:null==n?void 0:n.link,chatOnly:(null==n?void 0:n.chatOnly)?1:0},[3,13];case 5:return o={uid:null==n?void 0:n.id},[3,13];case 6:case 9:return[4,$r.getAccessToken()];case 7:case 10:return s=m.sent(),[4,oa(i,s||"",(null==n?void 0:n.title)||"",(null==n?void 0:n.description)||"",(null==n?void 0:n.thumbnail)||"",null==n?void 0:n.path)];case 8:return f=m.sent(),o={data:{ZInstantAPIInfo:{url:"".concat(f.zinstantApi),zinstantdata_id:"templateId=".concat(f.ztemplateId,"&appId=").concat(i,"&shareId=").concat(f.shareId)},previewMsgText:{msg:{en:"Zalo Mini Program",vi:"Chương trình nhỏ"}},enableReactions:1}},[3,13];case 11:return h=m.sent().shareableLink,o={link:h,chatOnly:0},[3,13];case 12:return[3,13];case 13:return[2,new Promise((function(t,n){Vr("OPEN_SHARESHEET",Ko(Pn({type:e.ShareSheetType[a]},o),{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){n(e)}},{timeout:!1})}))]}}))}));return function(e,n){return t.apply(this,arguments)}}(),sa=[yn.union([Ct({type:yn.enum(["image"]),data:Ct({imageUrl:yt().url(),imageUrls:yn.array(yt().url()).max(10).optional()})}),Ct({type:yn.enum(["link"]),data:Ct({link:yt().url(),chatOnly:yn.boolean().optional()})}),Ct({type:yn.enum(["oa"]),data:Ct({id:yt()})}),Ct({type:yn.enum(["gif"]),data:Ct({gifUrl:yt().url(),imageUrl:yt().url().optional(),width:gt().min(0).optional(),height:gt().min(0).optional()})}),Ct({type:yn.enum(["video"]),data:Ct({videoThumb:yt().url(),videoUrl:yt().url(),width:gt().min(0).optional(),height:gt().min(0).optional()})}),Ct({type:yn.enum(["zmp","zmp_deep_link"]),data:Ct({title:yt().max(100),thumbnail:yt().url(),path:yt().optional(),description:yt().max(400).default("").optional()})})])];function ua(e){return ca.apply(this,arguments)}function ca(){return ca=V((function(e){return Q(this,(function(t){return[2,ui("openShareSheet",sa,[e],function(){var e=V((function(e){var t,n;return Q(this,(function(r){switch(r.label){case 0:return En.isMp?(t=e.type,n=e.data,[4,aa(t,n)]):[3,2];case 1:return[2,r.sent()];case 2:return En.isMpWeb?[2,Promise.resolve({status:2,shareType:0,numberOfUser:0})]:[2,Promise.reject(An("openShareSheet",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),ca.apply(this,arguments)}var la=V((function(){return Q(this,(function(e){return[2,new Promise((function(e,t){Vr("REQUEST_PERMISSION_CAMERA",{},{success:function(t){var n,r;(null===(n=Tn())||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=Tn())||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 da.apply(this,arguments)}function da(){return(da=V((function(e){return Q(this,(function(t){return[2,ui("requestCameraPermission",[],[e],V((function(){return Q(this,(function(e){switch(e.label){case 0:return[4,la()];case 1:return[2,e.sent()]}}))})))]}))}))).apply(this,arguments)}var fa=function(){var e=V((function(e,t,n){return Q(this,(function(r){return[2,new Promise((function(r,i){Vr("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)}}(),ha=V((function(){var e,t,n,r=arguments;return Q(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=mi(),[4,Rr(e,t,n.version)];case 1:return[2,o.sent()]}}))})),ma=function(){var e=V((function(e){return Q(this,(function(t){return[2,new Promise((function(t,n){Vr("OPEN_OUTAPP",{url:e},{success:function(){t()},fail:function(e){n(e)}},{})}))]}))}));return function(t){return e.apply(this,arguments)}}(),va=[Ct({params:yn.record(yt(),yt()).optional()}).optional()];function ya(e){return ga.apply(this,arguments)}function ga(){return ga=V((function(e){return Q(this,(function(t){return[2,ui("createShortcut",va,[e],function(){var e=V((function(e){var t,n,r,a,s,u,c,l;return Q(this,(function(p){switch(p.label){case 0:return En.isMp?[4,ha(i,0)]:[3,6];case 1:return r=p.sent(),a=null===(t=Tn())||void 0===t||null===(n=t.platform)||void 0===n?void 0:n.isIOS,s=r.logoUrl||ni("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,ma(encodeURI(l))]):[3,3];case 2:return p.sent(),[3,5];case 3:return[4,fa("".concat(o,"/").concat(i,"/?").concat(c.toString()),u,s)];case 4:p.sent(),p.label=5;case 5:return[2,Kr.success()];case 6:return En.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(An("createShortcut",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),ga.apply(this,arguments)}var _a=function(){var e=V((function(e,t,n){return Q(this,(function(i){return[2,new Promise((function(i,o){Vr("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)}}(),wa=[Ct({secretData:yt(),ui:Ct({title:yt().default("Xác thực").optional(),subTitle:yt().default("Sử dụng sinh trắc học của bạn để xác thực").optional(),negativeButtonText:yt().default("Đóng").optional()}).optional(),requireFingerprint:bt().default(!0).optional()}).optional()];function ba(e){return Ta.apply(this,arguments)}function Ta(){return Ta=V((function(e){return Q(this,(function(t){return[2,ui("openBioAuthentication",wa,[e],function(){var e=V((function(e){var t,n,r;return Q(this,(function(i){switch(i.label){case 0:return En.isMp?(t=e.secretData,n=e.ui,r=e.requireFingerprint,[4,_a(t,n,r)]):[3,2];case 1:return[2,i.sent()];case 2:return En.isMpWeb?[2,Promise.resolve({code:0,message:"OK",data:{domain:"",code:0,message:"",payToken:""}})]:[2,Promise.reject(An("openBioAuthentication",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Ta.apply(this,arguments)}var Ea=V((function(){return Q(this,(function(e){return[2,new Promise((function(e,t){Vr("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 Sa(e){return Aa.apply(this,arguments)}function Aa(){return(Aa=V((function(e){return Q(this,(function(t){return[2,ui("checkStateBioAuthentication",[],[e],V((function(){return Q(this,(function(e){switch(e.label){case 0:return En.isMp?[4,Ea()]:[3,2];case 1:return[2,{bioState:e.sent()}];case 2:return En.isMpWeb?[2,Promise.resolve({bioState:""})]:[2,Promise.reject(An("checkStateBioAuthentication",{}))]}}))})))]}))}))).apply(this,arguments)}var Oa=function(){var e=V((function(e){return Q(this,(function(t){return[2,new Promise((function(t,n){Vr("SHOW_TOAST",{toast:e},{success:function(){t()},fail:function(e){n(e)}},{})}))]}))}));return function(t){return e.apply(this,arguments)}}(),Pa=[Ct({message:yt()}).optional()];function ka(e){return Ia.apply(this,arguments)}function Ia(){return Ia=V((function(e){return Q(this,(function(t){return[2,ui("showToast",Pa,[e],function(){var e=V((function(e){return Q(this,(function(t){switch(t.label){case 0:return En.isMp?[4,Oa(e.message)]:[3,2];case 1:return[2,t.sent()];case 2:return En.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(An("showToast",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Ia.apply(this,arguments)}var Na=V((function(){return Q(this,(function(e){return[2,new Promise((function(e,t){Vr("HIDE_KEYBOARD",{},{success:function(){e()},fail:function(e){t(e)}},{})}))]}))}));function Ca(e){return Ma.apply(this,arguments)}function Ma(){return(Ma=V((function(e){return Q(this,(function(t){return[2,ui("hideKeyboard",[],[e],V((function(){return Q(this,(function(e){switch(e.label){case 0:return En.isMp?[4,Na()]:[3,2];case 1:return[2,e.sent()];case 2:return En.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(An("hideKeyboard",{}))]}}))})))]}))}))).apply(this,arguments)}var xa=function(){var e=V((function(e){return Q(this,(function(t){return[2,new Promise((function(t,n){Vr("OPEN_PHONE",{phoneNum:e,phoneCode:e},{success:function(){t()},fail:function(e){n(e)}},{})}))]}))}));return function(t){return e.apply(this,arguments)}}(),Ra=[Ct({phoneNumber:yt()})];function ja(e){return Da.apply(this,arguments)}function Da(){return Da=V((function(e){return Q(this,(function(t){return[2,ui("openPhone",Ra,[e],function(){var e=V((function(e){return Q(this,(function(t){switch(t.label){case 0:return En.isMp?[4,xa(e.phoneNumber)]:[3,2];case 1:return[2,t.sent()];case 2:return En.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(An("openPhone",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Da.apply(this,arguments)}var Ua=function(){var e=V((function(e,t){return Q(this,(function(n){return[2,new Promise((function(n,r){Vr("OPEN_SMS",{content:t,phoneCode:e},{success:function(){n()},fail:function(e){r(e)}},{})}))]}))}));return function(t,n){return e.apply(this,arguments)}}(),Ba=[Ct({content:yt(),phoneNumber:yt()})];function Za(e){return La.apply(this,arguments)}function La(){return La=V((function(e){return Q(this,(function(t){return[2,ui("openSMS",Ba,[e],function(){var e=V((function(e){return Q(this,(function(t){switch(t.label){case 0:return En.isMp?[4,Ua(e.phoneNumber,e.content)]:[3,2];case 1:return[2,t.sent()];case 2:return En.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(An("openSMS",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),La.apply(this,arguments)}var za=function(){var e=V((function(e){var t,n=arguments;return Q(this,(function(i){return t=n.length>1&&void 0!==n[1]?n[1]:"",[2,new Promise((function(n,i){Vr("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)}}(),Wa=[Ct({id:yt(),displayName:yt().default("").optional()})];function Ga(e){return Fa.apply(this,arguments)}function Fa(){return Fa=V((function(e){return Q(this,(function(t){return[2,ui("viewOAQr",Wa,[e],function(){var e=V((function(e){return Q(this,(function(t){switch(t.label){case 0:return En.isMp?[4,za(e.id,e.displayName)]:[3,2];case 1:return[2,t.sent()];case 2:return En.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(An("viewOAQr",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Fa.apply(this,arguments)}var Ha=function(){var e=V((function(e){return Q(this,(function(t){return[2,new Promise((function(t,n){Vr("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)}}(),Ka=[Ct({keepScreenOn:bt()})];function Va(e){return Ja.apply(this,arguments)}function Ja(){return Ja=V((function(e){return Q(this,(function(t){return[2,ui("keepScreen",Ka,[e],function(){var e=V((function(e){return Q(this,(function(t){switch(t.label){case 0:return En.isMp?[4,Ha(e.keepScreenOn)]:[3,2];case 1:return[2,t.sent()];case 2:return En.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(An("keepScreen",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Ja.apply(this,arguments)}function qa(e){return $a.apply(this,arguments)}function $a(){return($a=V((function(e){return Q(this,(function(t){return[2,ui("onKeepScreen",[],[e],V((function(){return Q(this,(function(e){switch(e.label){case 0:return En.isMp?[4,Ha(!0)]:[3,2];case 1:return[2,e.sent()];case 2:return En.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(An("onKeepScreen",{}))]}}))})))]}))}))).apply(this,arguments)}function Ya(e){return Qa.apply(this,arguments)}function Qa(){return(Qa=V((function(e){return Q(this,(function(t){return[2,ui("offKeepScreen",[],[e],V((function(){return Q(this,(function(e){switch(e.label){case 0:return En.isMp?[4,Ha(!1)]:[3,2];case 1:return[2,e.sent()];case 2:return En.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(An("offKeepScreen",{}))]}}))})))]}))}))).apply(this,arguments)}var Xa=function(){var e=V((function(e,t){var n;return Q(this,(function(r){return n={},e?n={imageBase64Data:e}:t&&(n={imageUrl:t}),[2,new Promise((function(e,t){Vr("SAVE_IMAGE_GALLERY",Pn({},n),{success:function(){e()},fail:function(e){t(e)}},{})}))]}))}));return function(t,n){return e.apply(this,arguments)}}(),es=[Ct({imageBase64Data:yt().optional(),imageUrl:yt().url().optional()}).optional()];function ts(e){return ns.apply(this,arguments)}function ns(){return ns=V((function(e){return Q(this,(function(t){return[2,ui("saveImageToGallery",es,[e],function(){var e=V((function(e){return Q(this,(function(t){switch(t.label){case 0:return En.isMp?[4,Xa(e.imageBase64Data,e.imageUrl)]:[3,2];case 1:return[2,t.sent()];case 2:return En.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(An("saveImageToGallery",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),ns.apply(this,arguments)}var rs=function(){var e=V((function(e){var t,n,r,i,o,s,u=arguments;return Q(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,ha(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=kn(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){Vr("OPEN_MP",{mpUrl:o,mpInfo:i},{success:function(){e()},fail:function(e){t(e)}},{})}))]}}))}));return function(t){return e.apply(this,arguments)}}(),is=[Ct({appId:yt(),path:yt().optional(),params:yn.record(yt(),yt()).optional()})];function os(e){return as.apply(this,arguments)}function as(){return as=V((function(e){return Q(this,(function(t){return[2,ui("openMiniApp",is,[e],function(){var e=V((function(e){return Q(this,(function(t){switch(t.label){case 0:return En.isMp?[4,rs(e.appId,e.path,e.params)]:[3,2];case 1:return[2,t.sent()];case 2:return En.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(An("openMiniApp",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),as.apply(this,arguments)}var ss=V((function(){var t,n,r=arguments;return Q(this,(function(i){return t=r.length>0&&void 0!==r[0]?r[0]:"oneShot",n=r.length>1?r[1]:void 0,[2,new Promise((function(r,i){Vr("INTERACTIVE_VIBRATION",{type:e.VibrateType[t],vibrate_time:n},{success:function(){r()},fail:function(e){i(e)}},{})}))]}))})),us=[Ct({type:yn.enum(["oneShot"]).default("oneShot"),milliseconds:gt().optional()})];function cs(e){return ls.apply(this,arguments)}function ls(){return ls=V((function(e){return Q(this,(function(t){return[2,ui("vibrate",us,[e],function(){var e=V((function(e){return Q(this,(function(t){switch(t.label){case 0:return En.isMp?[4,ss(null==e?void 0:e.type,null==e?void 0:e.milliseconds)]:[3,2];case 1:return[2,t.sent()];case 2:return En.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(An("vibrate",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),ls.apply(this,arguments)}var ps=function(){var e=V((function(e,t){var n,r,i,o;return Q(this,(function(a){return n=new URL(e),r=n.href.includes("vnpay"),i=n.searchParams.get("typeInapp"),o=lr.isEmpty(t)?void 0:{modal_style:(null==t?void 0:t.style)?Dr(null==t?void 0:t.style):"bottom_sheet",left_button:(null==t?void 0:t.leftButton)?Dr(null==t?void 0:t.leftButton):"back"},!r&&lr.isEmpty(i)&&n.searchParams.set("typeInapp","1"),[2,new Promise((function(e,t){Vr("OPEN_INAPP",{url:n.href,style:o},{success:function(){e()},fail:function(e){t(e)}},{})}))]}))}));return function(t,n){return e.apply(this,arguments)}}(),ds=[Ct({url:yt(),config:Ct({style:yn.enum(["bottomSheet","normal"]).default("bottomSheet").optional(),leftButton:yn.enum(["back","none"]).default("back").optional()}).optional()})];function fs(e){return hs.apply(this,arguments)}function hs(){return hs=V((function(e){return Q(this,(function(t){return[2,ui("openWebview",ds,[e],function(){var e=V((function(e){return Q(this,(function(t){switch(t.label){case 0:return En.isMp?[4,ps(e.url,e.config)]:[3,2];case 1:return[2,t.sent()];case 2:return En.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(An("openWebview",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),hs.apply(this,arguments)}function ms(){var e={},t=window.location.href;try{var n=new URL(t).searchParams.toString();n&&(e=Or.getParamsAsObject(n))}catch(e){throw new Error("Invalid URL")}return e}function vs(){return ui("getRouteParams",[],[],(function(){return ms()}))}function ys(e){return gs.apply(this,arguments)}function gs(){return(gs=V((function(e){return Q(this,(function(t){return[2,ui("getAppInfo",[],[e],V((function(){return Q(this,(function(e){switch(e.label){case 0:return En.isMp?[4,ha()]:[3,2];case 1:return[2,e.sent()];case 2:return En.isMpWeb?[2,Promise.resolve({description:"",name:"",version:"",appUrl:"",qrCodeUrl:""})]:[2,Promise.reject(An("getAppInfo",{}))]}}))})))]}))}))).apply(this,arguments)}var _s=function(){var e=V((function(e){return Q(this,(function(t){return[2,new Promise((function(t,n){Vr("WEBVIEW_SET_RESULT",{result:ri(e)},{success:function(){t()},fail:function(e){n(e)}},{})}))]}))}));return function(t){return e.apply(this,arguments)}}(),ws=[Ct({data:yn.any()})];function bs(e){return Ts.apply(this,arguments)}function Ts(){return Ts=V((function(e){return Q(this,(function(t){return[2,ui("sendDataToPreviousMiniApp",ws,[e],function(){var e=V((function(e){return Q(this,(function(t){switch(t.label){case 0:return En.isMp?[4,_s(e.data)]:[3,2];case 1:return[2,t.sent()];case 2:return En.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(An("sendDataToPreviousMiniApp",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Ts.apply(this,arguments)}var Es=V((function(){return Q(this,(function(e){return[2,new Promise((function(e,t){var n,r;Vr("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(Kr.error.clientNotSupport())},fail:function(e){t(e)}},{delay:(null===(n=Tn())||void 0===n||null===(r=n.platform)||void 0===r?void 0:r.isIOS)?400:0})}))]}))}));function Ss(e){return As.apply(this,arguments)}function As(){return(As=V((function(e){return Q(this,(function(t){return[2,ui("getPhoneNumber",[],[e],V((function(){return Q(this,(function(e){switch(e.label){case 0:return En.isMp?[4,Es()]:[3,2];case 1:return[2,e.sent()];case 2:return En.isMpWeb?[2,Promise.resolve({number:""})]:[2,Promise.reject(An("getPhoneNumber",{}))]}}))})))]}))}))).apply(this,arguments)}var Os=V((function(){var e,t=arguments;return Q(this,(function(n){return e=t.length>0&&void 0!==t[0]?t[0]:1,[2,new Promise((function(t,n){Vr("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})}))]}))})),Ps=[Ct({maxProfile:gt().min(1).max(10).optional().default(1)})];function ks(e){return Is.apply(this,arguments)}function Is(){return Is=V((function(e){return Q(this,(function(t){return[2,ui("openProfilePicker",Ps,[e],function(){var e=V((function(e){var t,n,r,i,o;return Q(this,(function(a){switch(a.label){case 0:return En.isMp?[4,Os(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,$r.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,p,d;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(lr.isUndefined(null===(p=i.data[e])||void 0===p?void 0:p.message)?"Unknown error":null===(d=i.data[e])||void 0===d?void 0:d.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 En.isMpWeb?[2,Promise.resolve({users:[]})]:[2,Promise.reject(An("openProfilePicker",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Is.apply(this,arguments)}var Ns=function(){var e=V((function(e,t,n){var r;return Q(this,(function(i){return r=t&&lr.isString(t)&&t.length>0?"wpa_wpa2":"open",[2,new Promise((function(i,o){Vr("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)}}(),Cs=[Ct({SSID:yt(),password:yt().optional(),hiddenSSID:bt().optional()})];function Ms(e){return xs.apply(this,arguments)}function xs(){return xs=V((function(e){return Q(this,(function(t){return[2,ui("connectWifi",Cs,[e],function(){var e=V((function(e){return Q(this,(function(t){switch(t.label){case 0:return En.isMp?[4,Ns(e.SSID,e.password,e.hiddenSSID)]:[3,2];case 1:return[2,t.sent()];case 2:return En.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(An("connectWifi",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),xs.apply(this,arguments)}var Rs=function(){var t=V((function(t,n,r,i,o,a){var s,u;return Q(this,(function(c){return s={type:0,url:n,maxSize:r||1048576},u={enable:1,aspect_ratio:"1:1"},[2,new Promise((function(n,r){Vr("PICK_MEDIA",{media_type:e.MediaPickerType[t],edit_view:Pn({},u,i),silent_request:o,upload:s,max_select_items:a},{success:function(e){n(null==e?void 0:e.result_content)},fail:function(e){r(e)}},{isMultiCallback:!0})}))]}))}));return function(e,n,r,i,o,a){return t.apply(this,arguments)}}(),js=[Ct({type:yn.enum(["video","photo","file","zcamera","zcamera_photo","zcamera_video","zcamera_scan"]),serverUploadUrl:yt().url(),maxItemSize:gt().min(0).optional(),editView:Ct({enable:bt().optional(),aspectRatio:yt().regex(/^d+:d+$/).optional()}).optional(),silentRequest:bt().optional(),maxSelectItem:gt().min(1).optional()})];function Ds(e){return Us.apply(this,arguments)}function Us(){return Us=V((function(e){return Q(this,(function(t){return[2,ui("openMediaPicker",js,[e],function(){var e=V((function(e){var t,n,r,i,o,a;return Q(this,(function(s){switch(s.label){case 0:return En.isMp?(i={},lr.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,Rs(e.type,e.serverUploadUrl,e.maxItemSize,i,o,a)]):[3,2];case 1:return[2,{data:s.sent()}];case 2:return En.isMpWeb?[2,Promise.resolve({data:""})]:[2,Promise.reject(An("openMediaPicker",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Us.apply(this,arguments)}var Bs=[Ct({title:yt().max(100),description:yt().max(400).default(""),thumbnail:yt().url().optional(),path:yt().optional()})];function Zs(e){return Ls.apply(this,arguments)}function Ls(){return Ls=V((function(e){return Q(this,(function(t){return[2,ui("getShareableLink",Bs,[e],function(){var e=V((function(e){var t;return Q(this,(function(n){switch(n.label){case 0:return[4,$r.getAccessToken()];case 1:return t=n.sent(),[4,oa(window.APP_ID,t||"",e.title,e.description,e.thumbnail,e.path)];case 2:return[2,n.sent().shareableLink]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Ls.apply(this,arguments)}var zs=function(){var e=V((function(e){return Q(this,(function(t){return[2,new Promise((function(t,n){Vr("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 Ws(e){return Gs.apply(this,arguments)}function Gs(){return(Gs=V((function(e){return Q(this,(function(t){return[2,ui("closeLoading",[],[e],V((function(){return Q(this,(function(e){switch(e.label){case 0:return En.isMp?[4,zs("user action")]:[3,2];case 1:return[2,e.sent()];case 2:return En.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(An("closeLoading",{}))]}}))})))]}))}))).apply(this,arguments)}function Fs(e){return Hs.apply(this,arguments)}function Hs(){return Hs=V((function(e){return Q(this,(function(t){return[2,ui("requestUpdateZalo",[],[e],V((function(){var e,t,n;return Q(this,(function(r){switch(r.label){case 0:return En.isMp?(n=(null===(e=Tn())||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,ma(n)]):[3,2];case 1:return[2,r.sent()];case 2:return En.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(An("requestUpdateZalo",{}))]}}))})))]}))})),Hs.apply(this,arguments)}var Ks=Er.getInstance();Ks.addListener=function(t,n,r){var i=t;return Ks.addListener(e.Events[i],n,r)};var Vs=[yn.function()];function Js(t){return ui("onConfirmToExit",Vs,[t],(function(t){var n=t;En.isMp&&(Ks.on(e.Events.AppClose,n,'{"handle_h5": 1}'),gi.setNavigationBarLeftButton(void 0,2))}))}function qs(){return ui("offConfirmToExit",[],[],(function(){En.isMp&&(Ks.off(e.Events.AppClose),gi.setNavigationBarLeftButton(void 0,0))}))}function $s(){return ui("getDeviceId",[],[],(function(){return En.isMp&&$r.getSync(c.DEVICE_ID)||""}))}function Ys(e){return Qs.apply(this,arguments)}function Qs(){return(Qs=V((function(e){return Q(this,(function(t){return[2,ui("getDeviceIdAsync",[],[e],V((function(){return Q(this,(function(e){switch(e.label){case 0:return En.isMp?[4,$r.jumpAndGetToken(c.DEVICE_ID)]:[3,2];case 1:return[2,e.sent()||""];case 2:return[2,Promise.resolve("")]}}))})))]}))}))).apply(this,arguments)}function Xs(){return ui("getContext",[],[],(function(){if(En.isMp){var e=$r.getSync(c.CONTEXT_ID)||"";return{type:$r.getSync(c.CONTEXT_TYPE)||"",id:e}}return{type:"",id:""}}))}function eu(e){return tu.apply(this,arguments)}function tu(){return(tu=V((function(e){return Q(this,(function(t){return[2,ui("getContextAsync",[],[e],V((function(){var e;return Q(this,(function(t){switch(t.label){case 0:return En.isMp?[4,$r.jumpAndGetToken(c.CONTEXT_ID)]:[3,3];case 1:return e=t.sent()||"",[4,$r.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 nu(e){return ru.apply(this,arguments)}function ru(){return(ru=V((function(e){return Q(this,(function(t){return[2,ui("getAuthCode",[],[e],V((function(){var e,t;return Q(this,(function(n){switch(n.label){case 0:return En.isMp?[4,$r.jumpAndGetToken(c.ZOAUTH,!0)]:[3,4];case 1:return e=n.sent()||"",[4,$r.jumpAndGetToken(c.ZOAUTH_VRF)];case 2:return t=n.sent()||"",[4,$r.verifyUserAuthorized()];case 3:if(n.sent())return[2,{authCode:e,authCodeVerify:t}];throw jr([{action:"getAuthCode",error:-104,message:"no user auth",data:{}}]),Kr.error.loginFailed("User Authentication Required");case 4:return[2,Promise.resolve({authCode:"",authCodeVerify:""})]}}))})))]}))}))).apply(this,arguments)}function iu(e){return ou.apply(this,arguments)}function ou(){return(ou=V((function(e){return Q(this,(function(t){return[2,ui("getZPIToken",[],[e],V((function(){var e,t,n,r;return Q(this,(function(i){switch(i.label){case 0:return En.isMp?[4,$r.jumpAndGetToken(c.UTOKEN_ZPI)]:[3,5];case 1:return e=i.sent()||"",[4,$r.jumpAndGetToken(c.GTOKEN_ZPI)];case 2:return t=i.sent()||"",[4,$r.jumpAndGetToken(c.ZPP_ZPI)];case 3:return n=i.sent()||"",[4,$r.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 au=[yt()];function su(e){return ui("setAccessToken",au,[e],(function(e){var t=e;$r.setAccessToken(t)}))}var uu=[Ct({url:yt().url()})];function cu(e){return lu.apply(this,arguments)}function lu(){return lu=V((function(e){return Q(this,(function(t){return[2,ui("openOutApp",uu,[e],function(){var e=V((function(e){return Q(this,(function(t){switch(t.label){case 0:return En.isMp?[4,ma(e.url)]:[3,2];case 1:return[2,t.sent()];case 2:return En.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(An("openOutApp",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),lu.apply(this,arguments)}var pu=[Ct({count:gt().min(1).optional().default(1),sourceType:yn.array(yn.enum(["album","camera"])).max(2).default(["album","camera"]).optional(),cameraType:yn.enum(["back","front"]).default("front").optional()})];function du(e){return fu.apply(this,arguments)}function fu(){return fu=V((function(e){return Q(this,(function(t){return[2,ui("chooseImage",pu,[e],function(){var e=V((function(e){var t,n,r,i;return Q(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)}}())]}))})),fu.apply(this,arguments)}var hu=V((function(){var e,t,n=arguments;return Q(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){Vr("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(Kr.error.clientNotSupport())},fail:function(e){r(e)}},{isMultiCallback:!0,timeout:!1})}))]}))}));function mu(e){return vu.apply(this,arguments)}function vu(){return(vu=V((function(e){return Q(this,(function(t){return[2,ui("getLocation",[],[e],V((function(){return Q(this,(function(e){switch(e.label){case 0:return En.isMp?[4,hu()]:[3,2];case 1:return[2,e.sent()];case 2:return En.isMpWeb?[2,Promise.resolve({longitude:"105.788026",latitude:"21.0258773",timestamp:(new Date).getTime().toString(),provider:"fused"})]:[2,Promise.reject(An("getLocation",{}))]}}))})))]}))}))).apply(this,arguments)}var yu=[yn.function().args(Ct({data:yn.any()})).returns(yn.void())];function gu(t){return ui("onCallbackData",yu,[t],(function(){!function(t){Er.getInstance().on(e.Events.OnDataCallback,(function(e){t({data:e})}))}(t)}))}var _u=function(){var e=V((function(e){var t,n,r,o,a,s,u,c,l,p,d;return Q(this,(function(f){switch(f.label){case 0:return n="",e||(e=ms()),"object"==typeof e&&((n=e.zmpOrderId||"")||(t=e.appTransID||e.orderId||e.apptransid)),"string"==typeof e&&(r=Or.getParameterByName("orderId",e),o=Or.getParameterByName("appTransID",e)||Or.getParameterByName("apptransid",e),t=r||o),a={headers:{authorization:"Bearer "}},[4,$r.getAccessToken().catch((function(){throw Kr.error.loginRequired}))];case 1:return s=f.sent(),a.headers.authorization="Bearer ".concat(s),u=new URL(U),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 Kr.error.badRequest(l.msg);return p=l.data||{},d={err:l.err},0!==Object.keys(p).length&&p.constructor===Object&&Object.assign(d,{msg:p.resultMessage,orderId:p.orderId,resultCode:p.resultCode,transTime:p.transTime,createdAt:p.createAt,transId:p.transId,path:p.path}),[2,d]}}))}));return function(t){return e.apply(this,arguments)}}(),wu=function(){var t=V((function(t,n,r,o,a,s){var u,c,l,p,d,f,h,m,v,y,g,_,w,b,T;return Q(this,(function(E){switch(E.label){case 0:u=i,(c=new URLSearchParams).append("amount",t.toString()),c.append("item",encodeURIComponent(JSON.stringify(n))),c.append("appId",u),r&&c.append("desc",encodeURIComponent(r)),o&&(l=o,"object"==typeof o&&(l=JSON.stringify(o)),c.append("extradata",encodeURIComponent(l))),a&&(p=a,"object"==typeof a&&(p=JSON.stringify(a)),c.append("payload",encodeURIComponent(p))),s&&c.append("method",s),d={headers:{"Content-Type":"application/x-www-form-urlencoded",authorization:"Bearer "}},E.label=1;case 1:return E.trys.push([1,6,,7]),[4,$r.getAccessToken().catch((function(){throw Kr.error.loginRequired}))];case 2:return f=E.sent(),d.headers.authorization="Bearer ".concat(f),[4,fetch(j,Ko(Pn({method:"POST"},d),{body:c}))];case 3:return[4,E.sent().json()];case 4:if(!(h=E.sent()).data||0!==h.err)throw Kr.error.badRequest(h.msg);return m=h.data.id,v=h.data.jwt,y=window.APP_VERSION,g=window.APP_ENV,_={miniAppId:u,orderId:m},v&&(_.token=v),y&&(_.version=y),g&&(_.env=g),s&&(_.method=s),w=Or.encode(_),b=new URL("?".concat(w),"https://payment-mini.zalo.me").toString(),[4,ps(b).then((function(){var t=!1;Er.getInstance().once(e.Events.WebviewClosed,(function(){setTimeout(V((function(){var n;return Q(this,(function(r){switch(r.label){case 0:return t?[3,2]:(console.log("orderId",m),[4,_u({zmpOrderId:m})]);case 1:(n=r.sent()).err>=0&&Er.getInstance().emit(e.Events.PaymentClose,n.err,Ko(Pn({},n),{zmpOrderId:m})),r.label=2;case 2:return[2]}}))})),500)})),Er.getInstance().once(e.Events.OpenApp,(function(){t=!0}))}))];case 5:return E.sent(),[2,{orderId:m}];case 6:throw T=E.sent(),console.log("Internal error"),T;case 7:return[2]}}))}));return function(e,n,r,i,o,a){return t.apply(this,arguments)}}(),bu=[Ct({amount:yn.union([yt(),gt()]),item:yn.array(yn.record(yt(),yn.any())),desc:yt(),extradata:yn.any().optional(),payload:yn.any().optional(),method:yn.enum(["MOMO","ZALOPAY","MOMO_SANDBOX","ZALOPAY_SANDBOX","CC","CC_SANDBOX","ATM","ATM_SANDBOX","VNPAY","VNPAY_SANDBOX"]).optional()})];function Tu(e){return Eu.apply(this,arguments)}function Eu(){return Eu=V((function(e){return Q(this,(function(t){return[2,ui("createOrder",bu,[e],function(){var e=V((function(e){return Q(this,(function(t){switch(t.label){case 0:return En.isMp?[4,wu(e.amount,e.item,e.desc,e.extradata,e.payload,e.method)]:[3,2];case 1:return[2,t.sent()];case 2:return En.isMpWeb?[2,Promise.resolve({orderId:""})]:[2,Promise.reject(An("createOrder",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Eu.apply(this,arguments)}var Su=[Ct({data:yn.union([yt(),yn.record(yt(),yt())])})];function Au(e){return Ou.apply(this,arguments)}function Ou(){return Ou=V((function(e){return Q(this,(function(t){return[2,ui("checkTransaction",Su,[e],function(){var e=V((function(e){return Q(this,(function(t){switch(t.label){case 0:return En.isMp?[4,_u(e.data)]:[3,2];case 1:return[2,t.sent()];case 2:return En.isMpWeb?[2,Promise.resolve({msg:"Success",orderId:"",resultCode:1,transTime:(new Date).getTime().toString(),createdAt:(new Date).getTime().toString(),transId:""})]:[2,Promise.reject(An("checkTransaction",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Ou.apply(this,arguments)}var Pu=[Ct({hide:bt().default(!1).optional()}).optional()];function ku(e){return Iu.apply(this,arguments)}function Iu(){return Iu=V((function(e){return Q(this,(function(t){return[2,ui("setAndroidBottomNavigationBar",Pu,[e],function(){var e=V((function(e){return Q(this,(function(t){switch(t.label){case 0:return En.isMp?[4,gi.setAndroidBottomNavigationBar(e.hide)]:[3,2];case 1:return[2,t.sent()];case 2:return En.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(An("setAndroidBottomNavigationBar",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Iu.apply(this,arguments)}var Nu=[Ct({hide:bt().default(!1).optional()}).optional()];function Cu(e){return Mu.apply(this,arguments)}function Mu(){return Mu=V((function(e){return Q(this,(function(t){return[2,ui("setIOSBottomSafeArea",Nu,[e],function(){var e=V((function(e){return Q(this,(function(t){switch(t.label){case 0:return En.isMp?[4,gi.setIOSBottomSafeArea(e.hide)]:[3,2];case 1:return[2,t.sent()];case 2:return En.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(An("setIOSBottomSafeArea",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Mu.apply(this,arguments)}var xu=[Ct({type:yn.enum(["normal","hidden","transparent"]).default("normal").optional(),color:yn.string().optional()}).optional()];function Ru(e){return ju.apply(this,arguments)}function ju(){return ju=V((function(e){return Q(this,(function(t){return[2,ui("setStatusBar",xu,[e],function(){var e=V((function(e){return Q(this,(function(t){switch(t.label){case 0:return En.isMp?[4,gi.configHeader({statusBarType:e.type,headerColor:e.color})]:[3,2];case 1:return[2,t.sent()];case 2:return En.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(An("setStatusBar",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),ju.apply(this,arguments)}var Du=[Ct({headerTextColor:yn.enum(["black","white"]).optional(),headerColor:yn.string().optional(),actionBar:Ct({hide:yn.boolean().optional(),title:yn.string().optional(),leftButton:yn.enum(["back","none"]).optional(),textAlign:yn.enum(["left","center"]).default("left").optional()}).optional(),statusBarType:yn.enum(["normal","hidden","transparent"]).optional(),hideAndroidBottomNavigationBar:yn.boolean().optional(),hideIOSSafeAreaBottom:yn.boolean().optional()})];function Uu(e){return Bu.apply(this,arguments)}function Bu(){return Bu=V((function(e){return Q(this,(function(t){return[2,ui("configAppView",Du,[e],function(){var e=V((function(e){var t,n,r,i,o,a,s;return Q(this,(function(u){switch(u.label){case 0:return En.isMp?lr.isUndefined(null===(t=e.actionBar)||void 0===t?void 0:t.leftButton)?[3,2]:[4,gi.setNavigationBarLeftButton(null===(a=e.actionBar)||void 0===a?void 0:a.leftButton)]:[3,13];case 1:u.sent(),u.label=2;case 2:return lr.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,gi.setNavigationBarTitle(null===(s=e.actionBar)||void 0===s?void 0:s.title)];case 3:u.sent(),u.label=4;case 4:return[4,gi.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,gi.setAndroidBottomNavigationBar(e.hideAndroidBottomNavigationBar)];case 7:u.sent(),u.label=8;case 8:return"boolean"!=typeof e.hideIOSSafeAreaBottom?[3,10]:[4,gi.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 En.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(An("configAppView",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Bu.apply(this,arguments)}var Zu=function(){var t=V((function(t,n,r,o,a,s){var u,c,l,p,d,f,h,m,v,y,g,_,w,b;return Q(this,(function(T){switch(T.label){case 0:d=i,(f=new URLSearchParams).append("payType",n||e.IAPPayType.SUBSCRIPTION),h=e.ProrationMode.UNKNOW,r===Z&&(h=e.ProrationMode.IMMEDIATE_AND_CHARGE_FULL_PRICE),r===B&&(h=e.ProrationMode.DEFERRED),f.append("utm",a||"default"),f.append("merchantTransId",s||""),f.append("prorationMode",h.toString()),f.append("appId",d),o&&f.append("method",o),m="",(null===(u=Tn())||void 0===u||null===(c=u.platform)||void 0===c?void 0:c.isIOS)?m="ios":(null===(l=Tn())||void 0===l||null===(p=l.platform)||void 0===p?void 0:p.isAndroid)&&(m="android"),f.append("os",m),f.append("productId",t),v={headers:{"Content-Type":"application/x-www-form-urlencoded",authorization:"Bearer "}},T.label=1;case 1:return T.trys.push([1,5,,6]),[4,$r.getAccessToken().catch((function(){throw Kr.error.loginRequired}))];case 2:return y=T.sent(),v.headers.authorization="Bearer ".concat(y),[4,fetch(D,Ko(Pn({method:"POST"},v),{body:f}))];case 3:return[4,T.sent().json()];case 4:if(!(g=T.sent()).data||!g.data.store||0!==g.err)throw Kr.error.createIAPOrderFailed(g.err);return _=g.data.store,w=g.data.orderId,[2,new Promise((function(e,t){Vr("IAP_REQUESTPAYMENT",Pn({},_),{success:function(){e({orderId:w})},fail:function(e){t(e)}})}))];case 5:throw b=T.sent(),console.log("Internal error"),b;case 6:return[2]}}))}));return function(e,n,r,i,o,a){return t.apply(this,arguments)}}(),Lu=[Ct({productId:yt(),payType:yn.enum(["ONETIME","SUBSCRIPTION"]).optional(),prorationMode:yn.enum(["DEFERRED","IMMEDIATE_AND_CHARGE_FULL_PRICE"]).default("DEFERRED").optional(),utm:yt().optional(),method:yn.enum(["IAP","IAP_SANDBOX"]).optional(),merchantTransId:yt().optional()})];function zu(e){return Wu.apply(this,arguments)}function Wu(){return Wu=V((function(e){return Q(this,(function(t){return[2,ui("createOrderIAP",Lu,[e],function(){var e=V((function(e){return Q(this,(function(t){switch(t.label){case 0:return En.isMp?[4,Zu(e.productId,e.payType,e.prorationMode,e.method,e.utm,e.merchantTransId)]:[3,2];case 1:return[2,t.sent()];case 2:return En.isMpWeb?[2,Promise.resolve({orderId:""})]:[2,Promise.reject(An("createOrderIAP",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Wu.apply(this,arguments)}var Gu=V((function(){return Q(this,(function(e){return[2,new Promise((function(e,t){Vr("MA_MENU_MINIMIZE",{},{success:function(t){e(t)},fail:function(e){t(e)}},{})}))]}))}));function Fu(e){return Hu.apply(this,arguments)}function Hu(){return(Hu=V((function(e){return Q(this,(function(t){return[2,ui("minimizeApp",[],[e],V((function(){return Q(this,(function(e){switch(e.label){case 0:return En.isMp?[4,Gu()]:[3,2];case 1:return[2,e.sent()];case 2:return En.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(An("minimizeApp",{}))]}}))})))]}))}))).apply(this,arguments)}var Ku=V((function(){return Q(this,(function(e){return[2,new Promise((function(e,t){Vr("MA_MENU_PERMISSION",{},{success:function(t){e(t)},fail:function(e){t(e)}},{}),e()}))]}))}));function Vu(e){return Ju.apply(this,arguments)}function Ju(){return(Ju=V((function(e){return Q(this,(function(t){return[2,ui("openPermissionSetting",[],[e],V((function(){return Q(this,(function(e){switch(e.label){case 0:return En.isMp?[4,Ku()]:[3,2];case 1:return[2,e.sent()];case 2:return En.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(An("openPermissionSetting",{}))]}}))})))]}))}))).apply(this,arguments)}var qu=V((function(){return Q(this,(function(e){return[2,new Promise((function(e,t){Vr("MP_ADD_MYFAVORITES",{timestamp:(new Date).getTime()},{success:function(t){e(t)},fail:function(e){t(e)}},{})}))]}))}));function $u(e){return Yu.apply(this,arguments)}function Yu(){return(Yu=V((function(e){return Q(this,(function(t){return[2,ui("favoriteApp",[],[e],V((function(){return Q(this,(function(e){switch(e.label){case 0:return En.isMp?[4,qu()]:[3,2];case 1:return[2,e.sent()];case 2:return En.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(An("favoriteApp",{}))]}}))})))]}))}))).apply(this,arguments)}var Qu=V((function(){return Q(this,(function(e){return[2,new Promise((function(e,t){Vr("OPEN_GROUPLIST",{},{success:function(t){e(t)},fail:function(e){t(e)}},{})}))]}))}));function Xu(e){return ec.apply(this,arguments)}function ec(){return(ec=V((function(e){return Q(this,(function(t){return[2,ui("openGroupList",[],[e],V((function(){return Q(this,(function(e){switch(e.label){case 0:return En.isMp?[4,Qu()]:[3,2];case 1:return[2,e.sent()];case 2:return En.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(An("openGroupList",{}))]}}))})))]}))}))).apply(this,arguments)}var tc=V((function(){var e;return Q(this,(function(t){switch(t.label){case 0:return[4,$r.getAccessToken()];case 1:return e=t.sent(),[2,new Promise((function(t,n){Vr("MP_SEND_NOTIFICATION",{accessToken:e},{success:function(e){t(e)},fail:function(e){n(e)}},{delay:500})}))]}}))}));function nc(e){return rc.apply(this,arguments)}function rc(){return(rc=V((function(e){return Q(this,(function(t){return[2,ui("requestSendNotification",[],[e],V((function(){return Q(this,(function(e){switch(e.label){case 0:return En.isMp?[4,tc()]:[3,2];case 1:return[2,e.sent()];case 2:return En.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(An("requestSendNotification",{}))]}}))})))]}))}))).apply(this,arguments)}var ic=V((function(){return Q(this,(function(e){return[2,new Promise((function(e,t){Vr("MP_ADD_RATING",{},{success:function(t){e(t)},fail:function(e){t(e)}},{})}))]}))}));function oc(e){return ac.apply(this,arguments)}function ac(){return(ac=V((function(e){return Q(this,(function(t){return[2,ui("addRating",[],[e],V((function(){return Q(this,(function(e){switch(e.label){case 0:return En.isMp?[4,ic()]:[3,2];case 1:return[2,e.sent()];case 2:return En.isMpWeb?[2,Promise.resolve({})]:[2,Promise.reject(An("addRating",{}))]}}))})))]}))}))).apply(this,arguments)}var sc,uc=(sc=V((function(e,t,n){var r,i;return Q(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,Pn({method:"POST",body:r},i))];case 1:return[4,o.sent().json()];case 2:return[2,o.sent()]}}))})),function(e,t,n){return sc.apply(this,arguments)}),cc=function(){var e=V((function(e){return Q(this,(function(t){return[2,new Promise((function(t,n){Vr("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)}}(),lc=[Ct({oaId:yt()})];function pc(e){return dc.apply(this,arguments)}function dc(){return dc=V((function(e){return Q(this,(function(t){return[2,ui("interactOA",lc,[e],function(){var e=V((function(e){var t,n,r;return Q(this,(function(o){switch(o.label){case 0:return En.isMp?(t=e.oaId,[4,$r.getAccessToken()]):[3,5];case 1:return!(n=o.sent())||lr.isEmpty(n)?[3,3]:[4,uc(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,cc(t)];case 4:return[2,o.sent()];case 5:return En.isMpWeb?[2,Promise.resolve({})]:[2,Promise.reject(An("interactOA",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),dc.apply(this,arguments)}var fc=[Ct({oaId:yt()})];function hc(e){return mc.apply(this,arguments)}function mc(){return mc=V((function(e){return Q(this,(function(t){return[2,ui("isAllowedInteractWithOA",fc,[e],function(){var e=V((function(e){var t,n,r;return Q(this,(function(o){switch(o.label){case 0:return En.isMp?(t=e.oaId,[4,$r.getAccessToken()]):[3,4];case 1:return!(n=o.sent())||lr.isEmpty(n)?[3,3]:[4,uc(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 En.isMpWeb?[2,Promise.resolve({status:!1})]:[2,Promise.reject(An("IsAllowedInteractWithOA",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),mc.apply(this,arguments)}function vc(e){return yc.apply(this,arguments)}function yc(){return(yc=V((function(e){return Q(this,(function(t){return[2,ui("getSetting",[],[e],V((function(){return Q(this,(function(e){switch(e.label){case 0:return En.isMp?[4,Fr()]:[3,2];case 1:return[2,e.sent()];case 2:return En.isMpWeb?[2,Promise.resolve({authSetting:{}})]:[2,Promise.reject(An("getSetting",{}))]}}))})))]}))}))).apply(this,arguments)}var gc=yn.enum(["scope.userInfo","scope.userLocation","scope.userPhonenumber"]),_c=[Ct({scopes:yn.array(gc).max(2).optional()}).optional()];function wc(e){return bc.apply(this,arguments)}function bc(){return bc=V((function(e){return Q(this,(function(t){return[2,ui("authorize",_c,[e],function(){var e=V((function(e){var t,n,r,i;return Q(this,(function(o){switch(o.label){case 0:return En.isMp?(n=null==e?void 0:e.scopes,r=Ur(),("android"===(i=((null===(t=Tn())||void 0===t?void 0:t.platformName)||"").toLowerCase())&&r<724||"ios"===i&&r<573)&&n&&n.length>0?[2,Promise.reject(Kr.error.clientNotSupport())]:[4,Jr(null!=n?n:void 0)]):[3,2];case 1:return[2,o.sent()];case 2:return En.isMpWeb?[2,Promise.resolve({})]:[2,Promise.reject(An("authorize",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),bc.apply(this,arguments)}var Tc=V((function(){return Q(this,(function(e){return[2,new Promise(function(){var e=V((function(e,t){var n;return Q(this,(function(r){switch(r.label){case 0:return lr.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(Kr.error.clientNotSupport()),[2]}}))}));return function(t,n){return e.apply(this,arguments)}}())]}))}));function Ec(e){return ui("checkZaloCameraPermission",[],[e],V((function(){return Q(this,(function(e){switch(e.label){case 0:return[4,Tc()];case 1:return[2,e.sent()]}}))})))}var Sc=V((function(){return Q(this,(function(e){return[2,new Promise(function(){var e=V((function(e,t){var n,r,i;return Q(this,(function(o){switch(o.label){case 0:return o.trys.push([0,2,,3]),[4,$r.jumpAndGetToken()];case 1:return o.sent(),r=null===(n=$r.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 Ac(e){return Oc.apply(this,arguments)}function Oc(){return(Oc=V((function(e){return Q(this,(function(t){return[2,ui("getUserID",[],[e],V((function(){return Q(this,(function(e){switch(e.label){case 0:return En.isMp?[4,Sc()]:[3,2];case 1:return[2,e.sent()];case 2:return En.isMpWeb?[2,Promise.resolve(void 0)]:[2,Promise.reject(An("getUserID",{}))]}}))})))]}))}))).apply(this,arguments)}var Pc=V((function(){return Q(this,(function(e){return[2,new Promise(function(){var e=V((function(e,t){var n,r,i;return Q(this,(function(o){switch(o.label){case 0:return o.trys.push([0,2,,3]),[4,$r.jumpAndGetToken()];case 1:return o.sent(),r=null===(n=$r.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 kc(e){return Ic.apply(this,arguments)}function Ic(){return(Ic=V((function(e){return Q(this,(function(t){return[2,ui("getIDToken",[],[e],V((function(){return Q(this,(function(e){switch(e.label){case 0:return En.isMp?[4,Pc()]:[3,2];case 1:return[2,e.sent()];case 2:return En.isMpWeb?[2,Promise.resolve(void 0)]:[2,Promise.reject(An("getIDToken",{}))]}}))})))]}))}))).apply(this,arguments)}var Nc=function(){function e(){var t,n;pr(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=Y(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;lr.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?lr.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?lr.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 Cc(e){return Mc.apply(this,arguments)}function Mc(){return(Mc=V((function(e){return Q(this,(function(t){return[2,ui("setupAd",[],[e],(function(){return Nc.getInstance().loadSDK()}))]}))}))).apply(this,arguments)}var xc=[Ct({ids:yn.union([yn.string(),yn.array(yn.string())]),config:Ct({display:yn.boolean().optional(),onClose:yn.function().optional()}).optional()})];function Rc(e){return jc.apply(this,arguments)}function jc(){return jc=V((function(e){return Q(this,(function(t){return[2,ui("loadAd",xc,[e],function(){var e=V((function(e){return Q(this,(function(t){return Nc.getInstance().load(e.ids,e.config),[2]}))}));return function(t){return e.apply(this,arguments)}}())]}))})),jc.apply(this,arguments)}var Dc=[Ct({id:yn.string()})];function Uc(e){return Bc.apply(this,arguments)}function Bc(){return Bc=V((function(e){return Q(this,(function(t){return[2,ui("displayAd",Dc,[e],function(){var e=V((function(e){return Q(this,(function(t){return Nc.getInstance().display(e.id),[2]}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Bc.apply(this,arguments)}var Zc=[Ct({id:yn.string().optional()}).optional()];function Lc(e){return zc.apply(this,arguments)}function zc(){return zc=V((function(e){return Q(this,(function(t){return[2,ui("refreshAd",Zc,[e],function(){var e=V((function(e){return Q(this,(function(t){return Nc.getInstance().refresh(e.id),[2]}))}));return function(t){return e.apply(this,arguments)}}())]}))})),zc.apply(this,arguments)}window.ZaloMiniAppSDK={getVersion:hi},ci();var Wc=Object.freeze({__proto__:null,get Events(){return e.Events},get EventName(){return e.Events},login:ci,getAccessToken:pi,getVersion:hi,getSystemInfo:vi,setNavigationBarTitle:wi,setNavigationBarColor:Ei,setNavigationBarLeftButton:Oi,setStorage:Qi,getStorage:to,getStorageInfo:ro,removeStorage:ao,clearStorage:co,getUserInfo:ho,getNetworkType:go,onNetworkStatusChange:bo,startBeaconDiscovery:So,stopBeaconDiscovery:Po,getBeacons:No,closeApp:xo,scanQRCode:Do,openProfile:Lo,openChat:Fo,openPostFeed:qo,followOA:Xo,unfollowOA:ra,openShareSheet:ua,requestCameraPermission:pa,createShortcut:ya,openBioAuthentication:ba,checkStateBioAuthentication:Sa,showToast:ka,hideKeyboard:Ca,openPhone:ja,openSMS:Za,viewOAQr:Ga,keepScreen:Va,onKeepScreen:qa,offKeepScreen:Ya,saveImageToGallery:ts,openMiniApp:os,vibrate:cs,openWebview:fs,getRouteParams:vs,getAppInfo:ys,sendDataToPreviousMiniApp:bs,getPhoneNumber:Ss,openProfilePicker:ks,connectWifi:Ms,openMediaPicker:Ds,getShareableLink:Zs,closeLoading:Ws,requestUpdateZalo:Fs,onConfirmToExit:Js,offConfirmToExit:qs,getDeviceId:$s,getDeviceIdAsync:Ys,getContext:Xs,getContextAsync:eu,getAuthCode:nu,getZPIToken:iu,setAccessToken:su,openOutApp:cu,chooseImage:du,getLocation:mu,onCallbackData:gu,createOrder:Tu,checkTransaction:Au,events:Ks,setAndroidBottomNavigationBar:ku,setIOSBottomSafeArea:Cu,setStatusBar:Ru,configAppView:Uu,createOrderIAP:zu,minimizeApp:Fu,openPermissionSetting:Vu,favoriteApp:$u,openGroupList:Xu,requestSendNotification:nc,addRating:oc,interactOA:pc,interactOa:pc,isAllowedInteractWithOA:hc,getSetting:vc,authorize:wc,checkZaloCameraPermission:Ec,getUserID:Ac,getIDToken:kc,setupAd:Cc,loadAd:Rc,displayAd:Uc,refreshAd:Lc}),Gc=Tu,Fc=Au,Hc=zu,Kc=function(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}(Wc,["createOrder","checkTransaction","createOrderIAP"]),Vc={createOrder:Gc,checkTransaction:Fc,createOrderIAP:Hc};!function(){var e,t=null===(e=Tn())||void 0===e?void 0:e.appEnv;(null==t?void 0:t.isMp)&&(window.ZaloMiniAppSDK={},Object.assign(window.ZaloMiniAppSDK,Wc))}(),e.EventName=e.Events,e.Payment=Vc,e.addRating=oc,e.authorize=wc,e.checkStateBioAuthentication=Sa,e.checkTransaction=Au,e.checkZaloCameraPermission=Ec,e.chooseImage=du,e.clearStorage=co,e.closeApp=xo,e.closeLoading=Ws,e.configAppView=Uu,e.connectWifi=Ms,e.createOrder=Tu,e.createOrderIAP=zu,e.createShortcut=ya,e.default=Kc,e.displayAd=Uc,e.events=Ks,e.favoriteApp=$u,e.followOA=Xo,e.getAccessToken=pi,e.getAppInfo=ys,e.getAuthCode=nu,e.getBeacons=No,e.getContext=Xs,e.getContextAsync=eu,e.getDeviceId=$s,e.getDeviceIdAsync=Ys,e.getIDToken=kc,e.getLocation=mu,e.getNetworkType=go,e.getPhoneNumber=Ss,e.getRouteParams=vs,e.getSetting=vc,e.getShareableLink=Zs,e.getStorage=to,e.getStorageInfo=ro,e.getSystemInfo=vi,e.getUserID=Ac,e.getUserInfo=ho,e.getVersion=hi,e.getZPIToken=iu,e.hideKeyboard=Ca,e.interactOA=pc,e.interactOa=pc,e.isAllowedInteractWithOA=hc,e.keepScreen=Va,e.loadAd=Rc,e.login=ci,e.minimizeApp=Fu,e.offConfirmToExit=qs,e.offKeepScreen=Ya,e.onCallbackData=gu,e.onConfirmToExit=Js,e.onKeepScreen=qa,e.onNetworkStatusChange=bo,e.openBioAuthentication=ba,e.openChat=Fo,e.openGroupList=Xu,e.openMediaPicker=Ds,e.openMiniApp=os,e.openOutApp=cu,e.openPermissionSetting=Vu,e.openPhone=ja,e.openPostFeed=qo,e.openProfile=Lo,e.openProfilePicker=ks,e.openSMS=Za,e.openShareSheet=ua,e.openWebview=fs,e.refreshAd=Lc,e.removeStorage=ao,e.requestCameraPermission=pa,e.requestSendNotification=nc,e.requestUpdateZalo=Fs,e.saveImageToGallery=ts,e.scanQRCode=Do,e.sendDataToPreviousMiniApp=bs,e.setAccessToken=su,e.setAndroidBottomNavigationBar=ku,e.setIOSBottomSafeArea=Cu,e.setNavigationBarColor=Ei,e.setNavigationBarLeftButton=Oi,e.setNavigationBarTitle=wi,e.setStatusBar=Ru,e.setStorage=Qi,e.setupAd=Cc,e.showToast=ka,e.startBeaconDiscovery=So,e.stopBeaconDiscovery=Po,e.unfollowOA=ra,e.vibrate=cs,e.viewOAQr=Ga,Object.defineProperty(e,"__esModule",{value:!0})}));
24
+ ***************************************************************************** */}((function(e){var t=Object.prototype.hasOwnProperty,n="~";function r(){}function i(e,t,n){this.fn=e,this.context=t,this.once=n||!1}function o(e,t,r,o,a){if("function"!=typeof r)throw new TypeError("The listener must be a function");var s=new i(r,o||e,a),u=n?n+t:t;return e._events[u]?e._events[u].fn?e._events[u]=[e._events[u],s]:e._events[u].push(s):(e._events[u]=s,e._eventsCount++),e}function a(e,t){0==--e._eventsCount?e._events=new r:delete e._events[t]}function s(){this._events=new r,this._eventsCount=0}Object.create&&(r.prototype=Object.create(null),(new r).__proto__||(n=!1)),s.prototype.eventNames=function(){var e,r,i=[];if(0===this._eventsCount)return i;for(r in e=this._events)t.call(e,r)&&i.push(n?r.slice(1):r);return Object.getOwnPropertySymbols?i.concat(Object.getOwnPropertySymbols(e)):i},s.prototype.listeners=function(e){var t=n?n+e:e,r=this._events[t];if(!r)return[];if(r.fn)return[r.fn];for(var i=0,o=r.length,a=new Array(o);i<o;i++)a[i]=r[i].fn;return a},s.prototype.listenerCount=function(e){var t=n?n+e:e,r=this._events[t];return r?r.fn?1:r.length:0},s.prototype.emit=function(e,t,r,i,o,a){var s=n?n+e:e;if(!this._events[s])return!1;var u,c,l=this._events[s],p=arguments.length;if(l.fn){switch(l.once&&this.removeListener(e,l.fn,void 0,!0),p){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(p-1);c<p;c++)u[c-1]=arguments[c];l.fn.apply(l.context,u)}else{var d,f=l.length;for(c=0;c<f;c++)switch(l[c].once&&this.removeListener(e,l[c].fn,void 0,!0),p){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(d=1,u=new Array(p-1);d<p;d++)u[d-1]=arguments[d];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})),Tr="ACTION_CALLBACK";var Er=function(t){gr(r,t);var n=br(r);function r(){var e;return pr(this,r),(e=n.apply(this,arguments)).debug=ir("zmp:event-emitter"),e}var i=r.prototype;return i.h5ConfirmHandleEvent=function(e,t,n){ZaloJavaScriptInterface.jsH5EventCallback(e,t,n||"")},i.on=function(t,n,i){var o=this;if(t===Tr||t===e.Events.PaymentCallback)return vr(hr(r.prototype),"on",this).call(this,t,n,i);this.debug("register ".concat(String(t),": ").concat(i));return vr(hr(r.prototype),"on",this).call(this,t,(function(e,r){o.h5ConfirmHandleEvent(e,t,i),n(r)}),i)},i.once=function(e,t,n){var i=this;if(e===Tr)return vr(hr(r.prototype),"once",this).call(this,e,t,n);this.debug("register once ".concat(String(e),": ").concat(n));return vr(hr(r.prototype),"once",this).call(this,e,(function(r,o){i.h5ConfirmHandleEvent(r,e,n),t(o)}),n)},r.getInstance=function(){return r.instance||(r.instance=new r),r.instance},r}(wr);function Sr(e){Er.getInstance().emit(Tr,e)}function Pr(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){Sr({serialId:e,actionName:t,result:n})}},window.zaloJSV2={zalo_h5_event_handler:function(t,n,r){var o=ir("zmp:zalo_h5_event_handler");o("eventId: ".concat(t,", eventName: ").concat(n,", eventData: ").concat(r));var a=ei(r);o("stringToData",a);var s=function(t,n){try{if(t===e.Events.OpenApp){var r=n.url,o=new URL(r),a=o.pathname.split("/zapps/".concat(i))[1];return{path:"".concat(a||"/").concat(o.search)}}return n}catch(e){return n}}(n,a);Er.getInstance().emit(n,t,s)}},window.zaloNative2JS={nativeCall:function(t,n,r){Er.getInstance().emit(e.Events.PaymentCallback,t,n,r)}};var Ar={encode:Pr,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:Pr(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":rr(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":rr(r))?JSON.stringify(r):encodeURIComponent(r)].join("=");n.push(i)})),n.join("&")}},Or={},kr=function(e,t,n){var r=t||"default";return function(){return(r in Or?Or[r](e,n):e).apply(this,arguments)}};kr.setWrapper=function(e){Or[arguments.length<=1||void 0===arguments[1]?"default":arguments[1]]=e};var Ir={error:{code:1,error_subcode:1357046,message:"Received Invalid JSON reply.",type:"http"}};function Nr(e){try{return null===e?Ir:JSON.parse(e)}catch(e){return Ir}}var Cr,Mr={execute:function(e,t,n,r){n.suppress_http_code=1;var i=Ar.encode(n);"post"!=t&&(e=Ar.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=kr((function(){o=r,"onload"in i&&i.onload(n)}),"entry","XMLHttpRequest:load"),a=kr((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(Nr(e.responseText))},o.onerror=function(e){e.responseText?r(Nr(e.responseText)):r({error:{code:1,error_subcode:1357045,message:"unknown error (empty response)",status:e.status,type:"http"}})},o.send(i),!0)}},xr=Mr,Rr=(Cr=V((function(e,t,n){var r,i,o,a;return Q(this,(function(s){switch(s.label){case 0:return r={appId:e,versionStatus:t},lr.isUndefined(n)||(r.currentVersion=n),i=Ar.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 Cr.apply(this,arguments)});function jr(e){try{var t=e.map((function(e){return{action:e.action,error:e.error,message:e.message,data:e.data}}));xr.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 Dr=function(e){return e.replace(/[A-Z]/g,(function(e){return"_".concat(e.toLowerCase())}))},Ur=function(){var e,t,n=Number((null===(e=Tn())||void 0===e?void 0:e.zaloVersion)||""),r=((null===(t=Tn())||void 0===t?void 0:t.platformName)||"").toLowerCase();return"android"===r?n%1e4:n};function Br(e,t){return null!=t&&"undefined"!=typeof Symbol&&t[Symbol.hasInstance]?!!t[Symbol.hasInstance](e):e instanceof t}var Zr,Lr,zr=function(){function e(t,n,r,i){pr(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}(),Wr=function(e,t){return Br(e,zr)?function(e,t){return e.api=t,e.toJSON()}(e,t):function(e,t){return Br(e,Error)?new zr(f,e.message,t).toJSON():lr.isEmpty(null==e?void 0:e.message)||lr.isEmpty(null==e?void 0:e.code)?new zr(f,T,t,e).toJSON():new zr(e.code,e.message,t,e.detail).toJSON()}(e,t)},Gr=(Zr=V((function(e){var t;return Q(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,On({method:"GET"},t))];case 1:return[4,n.sent().json()];case 2:return[2,n.sent()]}}))})),function(e){return Zr.apply(this,arguments)}),Fr=V((function(){return Q(this,(function(e){return[2,new Promise(function(){var e=V((function(e,t){var n,r,i,o;return Q(this,(function(a){switch(a.label){case 0:return a.trys.push([0,3,,4]),[4,$r.jumpAndGetToken()];case 1:return a.sent(),(r=null===(n=$r.miniProgramConfig)||void 0===n?void 0:n.jwt)||t(new zr(v,S,"getSetting")),[4,Gr(r)];case 2:return(i=a.sent())&&0===i.err?e({authSetting:i.data}):t(new zr(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)}}())]}))})),Hr=function(){var t,n,r,i=Tn(),o={},a=Er.getInstance(),s=[],u=!1;return u||(n=function(e){var t=e.serialId,n=ti(e.result),r=oi(null==n?void 0:n.action),i=lr.isEmpty(null==n?void 0:n.error_code)?0:null==n?void 0:n.error_code,a=null==n?void 0:n.error_message,u=(null==n?void 0:n.data)||n;if(r&&0===i){var c=JSON.parse(null==n?void 0:n.data);i=lr.isEmpty(null==c?void 0:c.error_code)?0:null==c?void 0:c.error_code,a=null==c?void 0:c.error_message,u=(null==c?void 0:c.data)||c}var l={error_code:i,error_message:a,data:u,action:(null==n?void 0:n.action)||e.actionName};if(t&&o[t]){var p=o[t],d=p.callback,f=p.timeout,h=p.isMultiCallback,m=p.options;!function(e,t){var n=t||{},r=n.success,i=n.fail;0===e.error_code?lr.isFunction(r)&&r(e):lr.isFunction(i)&&i(e)}(l,d),!h&&delete o[t],f&&clearTimeout(f);var v={action:null==l?void 0:l.action,error:null==l?void 0:l.error_code,message:null==l?void 0:l.error_message,data:{}};try{if("action.open.inapp"===l.action||"action.open.outapp"===l.action){var y=new URL(null==m?void 0:m.url),g="".concat(y.protocol,"//").concat(y.host).concat(y.pathname);v.data={url:g}}if("action.follow.oa"===l.action||"action.unfollow.oa"===l.action){var _=null==m?void 0:m.uid;v.data={uid:_}}if("action.open.chat"===l.action){var b=null==m?void 0:m.uId,w=null==m?void 0:m.type;v.data={uid:b,openChatType:w}}}catch(e){}s.push(v)}},Er.getInstance().on(Tr,n),a.on(e.Events.AppPaused,(function(){if(s.length>0){var e=s;s=[],jr(e)}})),t?clearInterval(t):t=setInterval((function(){if(s.length>0){var e=s;s=[],jr(e)}}),5e3),u=!0),r=V((function(e,t,n,r){var a,s,u,c,l,p,d,f,h,m,_,b,w,T,S,P,k,I,N,C,M,x;return Q(this,(function(R){switch(R.label){case 0:return s=Math.floor(1e6*Math.random()),u="".concat(e,"_").concat(s),c="action.".concat(e.replace(/\_/g,".").toLowerCase()),(null==r?void 0:r.actionName)&&r.actionName.length>0&&(c=null==r?void 0:r.actionName),l=(null==r?void 0:r.isMultiCallback)||!1,p=!1!==(null==r?void 0:r.timeout)&&((null==r?void 0:r.timeout)||!0),d=(null==r?void 0:r.haveCallback)||!1,f=(null==r?void 0:r.skipJump)||!1,h=(null==r?void 0:r.requireAccessToken)||!1,m=ai(c),t&&n&&(o[u]={options:t,callback:n,isMultiCallback:l},p&&d&&(o[u].timeout=setTimeout((function(){return Sr({serialId:u,result:{error_code:g,error_message:E,data:{timeout:p},action:e}}),null}),!0===p?8e3:1e3*p))),m?[4,Fr()]:[3,2];case 1:if(!1===(null==(b=R.sent())||null===(_=b.authSetting)||void 0===_?void 0:_["scope.userInfo"]))return Sr({serialId:u,result:{error_code:v,error_message:O,data:{isMobile:null==i||null===(w=i.platform)||void 0===w?void 0:w.isMobile},action:e}}),[2];R.label=2;case 2:return T=oi(c),!(null==i||null===(a=i.platform)||void 0===a?void 0:a.isMobile)||!e||lr.isUndefined(ZaloJavaScriptInterface)||i.platform.isIOS&&!Xr(e)||T&&!1===T.isSupported?(Sr({serialId:u,result:{error_code:y,error_message:A,data:{isMobile:null==i||null===(S=i.platform)||void 0===S?void 0:S.isMobile},action:e}}),[2]):(P=Qr(t),f?[3,4]:[4,$r.getJSAccessToken()]);case 3:return I=R.sent(),[3,5];case 4:I="",R.label=5;case 5:k=I,R.label=6;case 6:return R.trys.push([6,10,,11]),f||!h?[3,8]:[4,$r.getAccessToken()];case 7:return C=R.sent(),[3,9];case 8:C="",R.label=9;case 9:return N=C,[3,11];case 10:return M=R.sent(),Sr({serialId:u,result:{error_code:null==M?void 0:M.code,error_message:null==M?void 0:M.message,action:e}}),[2];case 11:return x=i.platform.isIOS?window.onNativeMessage(u,c):'window.onNativeMessage("'.concat(u,'", "').concat(c,'")'),[2,ZaloJavaScriptInterface.jsCall(k,c,N,P,x)]}}))})),function(e,t,n,i){return r.apply(this,arguments)}}(),Kr={success:function(e,t){return{code:d,message:t||w,data:e||{}}},error:{badRequest:function(e){return new zr(h,e)},loginFailed:function(e){return new zr(v,"".concat(P,": ").concat(e))},loginRequired:function(){return new zr(v,S)},cannotGetShareInfo:function(){return new zr(m,"Can not get app info to share")},createIAPOrderFailed:function(e){var t=Object.keys(H).find((function(t){return t===e.toString()}));return new zr(e,t||T)},clientNotSupport:function(){return new zr(y,A)}}},Vr=(Lr=function(t){var n,r,i,o=null===(n=Tn())||void 0===n?void 0:n.platformName,a=t.action.replace("action.","").replace(/\./g,"_").toUpperCase(),s=C[a],u=(null==s?void 0:s.skipJump)||!1,c=(null==s?void 0:s.errorList)||{};if("JUMP_LOGIN"===a)return new zr(f,"Can not get auth code: ".concat(t.error_message));if($r.jumpStatus!==e.JumpStatus.DONE&&!u)return new zr(N.UNAUTHORIZED.code,N.UNAUTHORIZED.message);if("permission required!"===String(t.error_message).toLowerCase()||"no permission!"===String(t.error_message).toLowerCase())return new zr(N.FORBIDDEN.code,N.FORBIDDEN.message);if(o&&(null===(r=M[o])||void 0===r?void 0:r[t.error_code]))return new zr(M[o][t.error_code].code,M[o][t.error_code].message);var l=null==c||null===(i=c[o])||void 0===i?void 0:i[String(t.error_code)];if(l){var p,d,h,m=null===(p=l.mapTo)||void 0===p?void 0:p.message;return(null==l?void 0:l.needMoreDetail)&&(m="".concat(null==l||null===(h=l.mapTo)||void 0===h?void 0:h.message,": ").concat(t.error_message)),new zr(null===(d=l.mapTo)||void 0===d?void 0:d.code,m)}return new zr(t.error_code,t.error_message)},function(e,n,r,i){var o=function(e,n){function r(r){return function(i){var o=lr.isEmpty(n)?void 0:n[r];if(o)return Sn({stage:t.RESPONSE,type:"log",state:r,name:e,response:i}),o("fail"===r?Lr(i):null==i?void 0:i.data)}}return lr.isUndefined(e)&&(e=""),Object.assign({},{success:r("success"),fail:r("fail")})}(e,r),a=C[e],s=(null==i?void 0:i.delay)||0;setTimeout((function(){Hr(e,n,o,On({},i,a))}),s)}),Jr=function(){var e=V((function(e){return Q(this,(function(t){return[2,new Promise((function(t,n){Vr("MP_USER_AUTHORIZE",{scopes:e,forceUpdate:!0},{success:function(e){lr.isEmpty(e)||t(e)},fail:function(e){n(e)}},{isMultiCallback:!1,timeout:!1})}))]}))}));return function(t){return e.apply(this,arguments)}}(),qr=function(){function n(){pr(this,n),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 o,s,u,p=n.prototype;return p.jump=function(){var n=this;return V((function(){return Q(this,(function(r){return[2,new Promise((function(r,i){n._jumpStatus?n._jumpStatus===e.JumpStatus.DONE?r(e.JumpStatus.DONE):r(e.JumpStatus.DOING):(n._jumpStatus=e.JumpStatus.DOING,Sn({stage:t.REQUEST,type:"log",name:"jump"}),Hr("JUMP_LOGIN",{},{success:function(t){var i=t.data;n._miniProgramConfig=(null==i?void 0:i.miniProgramConfig)||{};var o=(null==i?void 0:i.cookiesOAuthLogins)||[],a=o.find((function(e){return e.name===c.JS_TOKEN}));a&&(n._jsAccessToken=a.value,window.ZJSBridge.setJSToken&&window.ZJSBridge.setJSToken(a.value)),n._cookies=o;var s=n._cookies.find((function(e){return e.name===c.ZOAUTH}));(null==s?void 0:s.value)||jr([{action:"action.jump.login",error:-102,message:"no zoauth",data:{}}]),r(e.JumpStatus.DONE)},fail:function(e){jr([{action:"action.jump.login",error:-101,message:e.message||"jump error",data:{}}]),i(e)}},{skipJump:!0}))}))]}))}))()},p.loginZaloV3=function(e,t,n){var r=this;return V((function(){var i;return Q(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=V((function(e){var t,n,i;return Q(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()]}}))}))()},p.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 V((function(){var i,o;return Q(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),lr.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,On({method:"POST",body:i},o)).then(function(){var e=V((function(e){var t,n,i,o;return Q(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()]}}))}))()},p.getAccessToken=function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=this;return V((function(){var n,o,a,s,u,l,p,d,f;function h(){return m.apply(this,arguments)}function m(){return(m=V((function(){return Q(this,(function(e){switch(e.label){case 0:return[4,new Promise((function(e){var t=setInterval((function(){(a.getAccessTokenCount<=1||a._accessToken)&&(e("done"),clearInterval(t))}),200)}))];case 1:return[2,e.sent()]}}))}))).apply(this,arguments)}return Q(this,(function(m){switch(m.label){case 0:return o=(new Date).getTime()-t.prevGetAccessTokenTimestamp,(a=t).getAccessTokenCount++,t.getAccessTokenCount>1?[4,h()]:[3,2];case 1:m.sent(),m.label=2;case 2:return t.manualSetAccessToken||t._accessToken.length>0&&o<t.accessTokenExpiresIn&&(null===(n=t._miniProgramConfig)||void 0===n?void 0:n.userAuthorized)?(a.getAccessTokenCount--,[2,Promise.resolve(t._accessToken)]):(t.accessToken="",[4,t.jumpAndGetToken(c.ZOAUTH)]);case 3:return s=m.sent(),[4,t.jumpAndGetToken(c.ZOAUTH_VRF)];case 4:return u=m.sent(),l="zmp.getaccesstoken.fail",e?[4,t.verifyUserAuthorized()]:[3,6];case 5:return p=m.sent(),[3,7];case 6:p=!0,m.label=7;case 7:if(!p)throw a.getAccessTokenCount--,jr([{action:l,error:-104,message:"no user auth",data:{}}]),Kr.error.loginFailed("User Authentication Required");if(!s)return[3,15];m.label=8;case 8:return m.trys.push([8,13,,14]),u?[4,t.loginZaloV4(i,s,u)]:[3,10];case 9:return d=m.sent(),[3,12];case 10:return[4,t.loginZaloV3(i,r,s)];case 11:d=m.sent(),m.label=12;case 12:return[3,14];case 13:return f=m.sent(),d="",console.log("Can not get access token",f),jr([{action:l,error:-103,message:String(f)||"Can not get access token",data:{}}]),[3,14];case 14:return a.getAccessTokenCount--,d||jr([{action:l,error:-101,message:"no accessToken",data:{}}]),[2,Promise.resolve(t._accessToken)];case 15:throw a.getAccessTokenCount--,jr([{action:l,error:-102,message:"no oauth",data:{}}]),Kr.error.loginFailed("Zalo app has not been activated")}}))}))()},p.verifyUserAuthorized=function(){var e=this;return V((function(){var t,n,r,i,o,a;return Q(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=oi("action.mp.user.authorize"))&&r.isSupported?[4,Fr()]:[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,Jr()];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]}}))}))()},p.setAccessToken=function(e){this.manualSetAccessToken=!0,this._accessToken=e,window.ZJSBridge.setZAccSession&&window.ZJSBridge.setZAccSession(e)},p.getJSAccessToken=function(){var e=this;return V((function(){var t;return Q(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)]}}))}))()},p.getSync=function(e){var t;return null===(t=this._cookies.find((function(t){return t.name===e})))||void 0===t?void 0:t.value},p.jumpAndGetToken=function(t){var n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=this;return new Promise(function(){var i=V((function(i){var o,a,s,u;return Q(this,(function(c){switch(c.label){case 0:return!n&&r._cookies.length>0?lr.isString(t)?(o=r._cookies.find((function(e){return e.name===t})),[2,i(null==o?void 0:o.value)]):[2,i("")]:(n&&r._jumpStatus===e.JumpStatus.DONE&&(r._jumpStatus=void 0),a={name:t,cb:function(e){return i(e)}},[4,r.jump()]);case 1:return(s=c.sent())===e.JumpStatus.DONE?(r._jumpStatus=s,r.WAITING_QUEUE.length&&(r.WAITING_QUEUE.forEach((function(e){var t=r._cookies.find((function(t){return t.name===e.name}));e.cb(null==t?void 0:t.value)})),r.WAITING_QUEUE=[]),u=r._cookies.find((function(e){return e.name===a.name})),a.cb(null==u?void 0:u.value)):r.WAITING_QUEUE.push(a),[2]}}))}));return function(e){return i.apply(this,arguments)}}())},n.getInstance=function(){return n.instance||(n.instance=new n),n.instance},o=n,(s=[{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}}])&&dr(o.prototype,s),u&&dr(o,u),n}(),$r=qr.getInstance(),Yr=ir("zmp:utils:common"),Qr=function(e){if(lr.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(Qr(e[r]));return"["+t.join(",")+"]"}if("object"==typeof e){for(var i in t=[],e)t.push('"'+i+'":'+Qr(e[i]));return"{"+t.join(",")+"}"}return e.toString()},Xr=function(e){var t,n,r=C[e],i=(null===(t=Tn())||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},ei=function(e){try{if(e){Yr(e);var t=e.replace(/\\/g,"").replace(/&#39;/g,"'");try{t=decodeURIComponent(atob(e))}catch(e){}return Yr("formattedValue",t,JSON.parse(t),rr(JSON.parse(t))),JSON.parse(t)}return null}catch(t){return Yr("parse json error:",t),e}},ti=function(e){if(lr.isObject(JSON)&&JSON.parse&&lr.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 lr.isObject(e)?e:new Function("return "+e)()},ni=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""},ri=function(e){return btoa(encodeURIComponent(JSON.stringify(e)))};var ii=function(t){return"hidden"===t?e.StatusBarType.hidden:"transparent"===t?e.StatusBarType.transparent:e.StatusBarType.normal},oi=function(e){if(void 0!==e){var t=$r.miniProgramConfig;return((null==t?void 0:t.dynamicApis)||[]).find((function(t){return t.action===e&&!1===t.clientHandle}))}},ai=function(e){if(void 0===e)return!1;var t=$r.miniProgramConfig;return((null==t?void 0:t.requiredAuthenList)||[]).indexOf(e)>=0},si=function(){var e=V((function(){return Q(this,(function(e){return[2,new Promise(function(){var e=V((function(e,t){var n;return Q(this,(function(t){switch(t.label){case 0:return t.trys.push([0,2,,3]),[4,$r.jumpAndGetToken()];case 1:return t.sent(),n=$r.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 ui(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=Kr.error.badRequest(s);throw c.detail=a,Wr(c,e)}u.push(i.data)}));var c=r.apply(void 0,Y(u));return lr.isPromise(c)?new Promise((function(t,n){c.then((function(e){if(!lr.isNull(a)&&lr.isFunction(a))return a(e);t(c)})).catch((function(t){var r=Wr(t,e);if(!lr.isNull(s)&&lr.isFunction(s))return s(r);n(r)}))})):c}catch(t){if(!lr.isNull(s)&&lr.isFunction(s))return s(t);throw Wr(t,e)}}function ci(e){return li.apply(this,arguments)}function li(){return(li=V((function(e){return Q(this,(function(t){return[2,ui("login",[],[e],V((function(){return Q(this,(function(e){switch(e.label){case 0:return En.isMp?[4,$r.jumpAndGetToken(c.ZOAUTH)]:[3,2];case 1:return e.sent(),[2,"Success"];case 2:return En.isMpWeb?[2,Promise.resolve("")]:[2,Promise.reject(Pn("login",{}))]}}))})))]}))}))).apply(this,arguments)}function pi(e){return di.apply(this,arguments)}function di(){return(di=V((function(e){return Q(this,(function(t){return[2,ui("getAccessToken",[],[e],V((function(){var e;return Q(this,(function(t){switch(t.label){case 0:return En.isMp?[4,si()]:[3,3];case 1:return e=!t.sent(),[4,$r.getAccessToken(e)];case 2:return[2,t.sent()||""];case 3:return En.isMpWeb?[2,Promise.resolve("")]:[2,Promise.reject(Pn("getAccessToken",{}))]}}))})))]}))}))).apply(this,arguments)}var fi="2.37.2";function hi(){return ui("getVersion",[],[],(function(){return fi}))}function mi(){var e,t;return{version:ni("version-id")||"",apiVersion:fi,zaloVersion:(null===(e=Tn())||void 0===e?void 0:e.zaloVersion)||"",platform:(null===(t=Tn())||void 0===t?void 0:t.platformName)||"",language:navigator.language,zaloLanguage:window.zLanguage||"vi",zaloTheme:window.zTheme||"light"}}function vi(){return ui("getSystemInfo",[],[],(function(){return mi()}))}var yi=function(){function t(){var e,n,r,o,s,u,c,l,p,d,f,h,m,v,y,g,_,b,w,T,E,S,P,A,O,k,I;pr(this,t),this.initConfig=window.APP_CONFIG;var N=lr.isString(null===(e=this.initConfig)||void 0===e||null===(n=e.app)||void 0===n?void 0:n.headerColor)&&(null===(r=this.initConfig)||void 0===r||null===(o=r.app)||void 0===o||null===(s=o.headerColor)||void 0===s?void 0:s.length)>0?z:W;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===(p=l.app)||void 0===p?void 0:p.hideAndroidBottomNavigationBar);var C,M,x="none"===(null===(d=this.initConfig)||void 0===d||null===(f=d.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)?L.HIDE_BACK:L.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)?L.SHOW_HOME:L.HIDE_HOME,j=new URL(location.href),D=ii(null===(b=this.initConfig)||void 0===b||null===(w=b.app)||void 0===w?void 0:w.statusBar);"boolean"==typeof(null===(T=this.initConfig)||void 0===T||null===(E=T.app)||void 0===E?void 0:E.actionBarHidden)&&(N=(null===(C=this.initConfig)||void 0===C||null===(M=C.app)||void 0===M?void 0:M.actionBarHidden)?W:z);this.config={actionbarType:N,buttonType:x,statusbarType:D,dataConfig:{backgroundColor:(null===(S=this.initConfig)||void 0===S||null===(P=S.app)||void 0===P?void 0:P.headerColor)||G,textColor:(null===(A=this.initConfig)||void 0===A||null===(O=A.app)||void 0===O?void 0:O.textColor)||"",textAlign:(null===(k=this.initConfig)||void 0===k||null===(I=k.app)||void 0===I?void 0:I.textAlign)||F,viewInLeftType:x,confirmToExit:1},homeConfig:{enable:R,url:"".concat(a,"/").concat(i,"/").concat(j.search)}}}var n=t.prototype;return n.setNavigationBarTitle=function(e){return V((function(){return Q(this,(function(t){return[2,new Promise((function(t,n){Vr("CHANGE_TITLE_HEADER",{title:e},{success:function(){t(),document.title=e},fail:function(e){n(e)}},{timeout:!1})}))]}))}))()},n.setNavigationBarLeftButton=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.config.dataConfig.confirmToExit,n=this;return V((function(){var r,i;return Q(this,(function(o){return void 0===(void 0===e?"undefined":rr(e))&&null===(void 0===e?"undefined":rr(e))||(r="none"===e||"home"===e?L.HIDE_BACK:L.SHOW_BACK,i="home"===e||"both"===e?L.SHOW_HOME:L.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){Vr("CHANGE_ACTIONBAR_LEFTBUTTON_TYPE",On({},n.config),{success:function(){e()},fail:function(e){t(e)}},{timeout:!1})}))]}))}))()},n.setAndroidBottomNavigationBar=function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],n=this;return V((function(){var r,i,o;return Q(this,(function(a){return i=t?e.AndroidBottomNavigationBarType.hide:e.AndroidBottomNavigationBarType.show,o=null===(r=Tn())||void 0===r?void 0:r.platform,[2,new Promise((function(e,r){if(!(null==o?void 0:o.isAndroid))return e();Vr("CHANGE_BOTTOMBAR",{bottombarType:i},{success:function(){n.hideAndroidBottomNavigationBar=!!t,window.ANDROID_BOTTOM_NAVIGATION_BAR_HIDDEN=!!t,e()},fail:function(e){r(e)}},{timeout:!1})}))]}))}))()},n.setIOSBottomSafeArea=function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],n=this;return V((function(){var r,i,o;return Q(this,(function(a){return i=t?e.IOSSafeAreaBottomType.hide:e.IOSSafeAreaBottomType.show,o=null===(r=Tn())||void 0===r?void 0:r.platform,[2,new Promise((function(e,r){if(!(null==o?void 0:o.isIOS))return e();Vr("CHANGE_BOTTOMBAR",{bottombarType:i},{success:function(){n.hideIOSSafeAreaBottom=!!t,window.IOS_BOTTOM_SAFE_AREA_HIDDEN=!!t,e()},fail:function(e){r(e)}},{timeout:!1,delay:200})}))]}))}))()},n.configHeader=function(t){var n=this;return V((function(){var r;return Q(this,(function(i){return r=n.config,lr.isString(t.headerColor)&&(r.dataConfig.backgroundColor=t.headerColor),lr.isString(t.headerTextColor)&&(r.dataConfig.textColor=t.headerTextColor),lr.isString(t.textAlign)&&("left"===t.textAlign?r.dataConfig.textAlign=e.TextAlignType.left:"center"===t.textAlign&&(r.dataConfig.textAlign=e.TextAlignType.center)),!0===t.hideActionBar?r.actionbarType=W:!1===t.hideActionBar&&(r.actionbarType=z),"normal"===t.statusBarType?r.statusbarType=e.StatusBarType.normal:"hidden"===t.statusBarType?r.statusbarType=e.StatusBarType.hidden:"transparent"===t.statusBarType&&(r.statusbarType=e.StatusBarType.transparent),[2,new Promise((function(i,o){Vr("CHANGE_ACTIONBAR",On({},r),{success:function(){var o;n.config=On({},r);var a,s=null===(o=Tn())||void 0===o?void 0:o.platform;window.STATUS_BAR_TYPE=(a=n.config.statusbarType)===e.StatusBarType.hidden?"hidden":a===e.StatusBarType.transparent?"transparent":"normal",window.ACTION_BAR_HIDDEN=n.config.actionbarType===W;var u=null===document||void 0===document?void 0:document.querySelector(":root");if(null==s?void 0:s.isAndroid){var c=0;if(("hidden"===t.statusBarType||"transparent"===t.statusBarType)&&t.hideActionBar){var l=window.ANDROID_STATUS_BAR_HEIGHT;isNaN(l)&&(l=Math.round(ZaloJavaScriptInterface.getStatusBarHeight()/window.devicePixelRatio)),c=l}c?null==u||u.style.setProperty("--zaui-safe-area-inset-top","".concat(c,"px")):null==u||u.style.setProperty("--zaui-safe-area-inset-top","env(safe-area-inset-top, 0px)")}i()},fail:function(e){o(e)}},{timeout:!1})}))]}))}))()},t.getInstance=function(){return t.instance||(t.instance=new t),t.instance},t}(),gi=yi.getInstance(),_i=[Ct({title:yt()}).optional()];function bi(e){return wi.apply(this,arguments)}function wi(){return wi=V((function(e){return Q(this,(function(t){return[2,ui("setNavigationBarTitle",_i,[e],function(){var e=V((function(e){return Q(this,(function(t){switch(t.label){case 0:return En.isMp?[4,gi.setNavigationBarTitle(e.title)]:[3,2];case 1:return[2,t.sent()];case 2:return En.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Pn("setNavigationBarTitle",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),wi.apply(this,arguments)}var Ti=[Ct({color:yt(),textColor:yn.enum(["black","white"]).optional(),statusBarColor:yt().optional()}).optional()];function Ei(e){return Si.apply(this,arguments)}function Si(){return Si=V((function(e){return Q(this,(function(t){return[2,ui("setNavigationBarColor",Ti,[e],function(){var e=V((function(e){return Q(this,(function(t){switch(t.label){case 0:return En.isMp?[4,gi.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 En.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Pn("setNavigationBarColor",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Si.apply(this,arguments)}var Pi=[Ct({type:yn.enum(["none","back","home","both"])}).optional()];function Ai(e){return Oi.apply(this,arguments)}function Oi(){return Oi=V((function(e){return Q(this,(function(t){return[2,ui("setNavigationBarLeftButton",Pi,[e],function(){var e=V((function(e){return Q(this,(function(t){switch(t.label){case 0:return En.isMp?[4,gi.setNavigationBarLeftButton(e.type)]:[3,2];case 1:return[2,t.sent()];case 2:return En.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Pn("setNavigationBarLeftButton",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Oi.apply(this,arguments)}function ki(e,t,n){if(!t.has(e))throw new TypeError("attempted to "+n+" private field on non-instance");return t.get(e)}function Ii(e,t){return function(e,t){return t.get?t.get.call(e):t.value}(e,ki(e,t,"get"))}function Ni(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 Ci(e,t,n){return function(e,t,n){if(t.set)t.set.call(e,n);else{if(!t.writable)throw new TypeError("attempted to set read only private field");t.value=n}}(e,ki(e,t,"set"),n),n}var Mi,xi,Ri,ji=new WeakMap,Di=new WeakMap,Ui=new WeakMap,Bi=function(){function e(t){pr(this,e),Ni(this,ji,{writable:!0,value:localStorage}),Ni(this,Di,{writable:!0,value:void 0}),Ni(this,Ui,{writable:!0,value:void 0}),Ci(this,Ui,{keys:new Set,currentSize:0,limitSize:R}),Ci(this,Di,t),this.findAllCurrentDataByApp(t)}var t=e.prototype;return t.findAllCurrentDataByApp=function(e){try{var t;for(t in Ii(this,ji)){if(e)if(t.split("_")[0]!==e)continue;Ii(this,Ui).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 Ii(this,Di)&&(e="".concat(Ii(this,Di),"_").concat(e)),Ii(this,Ui).keys.has(e)?Ii(this,ji).getItem(e):null},t.set=function(e){var t=this;return V((function(){return Q(this,(function(n){return Object.entries(e).forEach((function(e){var n=kn(e,2),r=n[0],i=n[1];t.setSync(r,i.replace(/\\"/g,'"'))})),[2,Promise.resolve({errorKeys:[]})]}))}))()},t.setSync=function(e,t){Ii(this,Di)&&(e="".concat(Ii(this,Di),"_").concat(e)),Ii(this,ji).setItem(e,t),Ii(this,Ui).keys.add(e)},t.getInfo=function(){var e=this;return V((function(){return Q(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}(Ii(this,ji),Ii(this,Di));return{currentSize:lr.isNumber(e)?Number((e/1024).toFixed(2)):0,limitSize:Number((R/1024).toFixed(2))}},t.remove=function(e){var t=this;return V((function(){return Q(this,(function(n){return e.forEach((function(e){t.removeSync(e)})),[2,Promise.resolve({errorKeys:[]})]}))}))()},t.removeSync=function(e){Ii(this,Di)&&(e="".concat(Ii(this,Di),"_").concat(e)),Ii(this,Ui).keys.has(e)&&(Ii(this,ji).removeItem(e),Ii(this,Ui).keys.delete(e))},t.clear=function(){var e=this;return V((function(){return Q(this,(function(t){return[2,Promise.resolve(e.clearSync())]}))}))()},t.clearSync=function(){var e=this;Ii(this,Ui).keys.forEach((function(t){Ii(e,Di)&&t.indexOf(Ii(e,Di))<0||(Ii(e,ji).removeItem(t),Ii(e,Ui).keys.delete(t))}))},e}(),Zi=new WeakMap,Li=new WeakMap,zi=function(){function e(t){pr(this,e),Ni(this,Zi,{writable:!0,value:void 0}),Ni(this,Li,{writable:!0,value:void 0}),Ci(this,Li,{keys:new Set,currentSize:0,limitSize:R}),Ci(this,Zi,t)}var t=e.prototype;return t.get=function(e){var t=this;return V((function(){return Q(this,(function(n){return[2,new Promise((function(n,r){Vr("ZBROWSER_MPDS",{mpds_action:"mpds.get",mpds_data:{keys:e},appId:Ii(t,Zi)},{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 V((function(){return Q(this,(function(n){return[2,new Promise((function(n,r){Vr("ZBROWSER_MPDS",{mpds_action:"mpds.set",mpds_data:{map:e},appId:Ii(t,Zi)},{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 V((function(){return Q(this,(function(t){return[2,new Promise((function(t,n){Vr("ZBROWSER_MPDS",{mpds_action:"mpds.get.size",mpds_data:{},appId:Ii(e,Zi)},{success:function(e){var n=0;e&&e.mpds_data&&e.mpds_data.size&&(n=e.mpds_data.size),t({currentSize:lr.isNumber(n)?Number(Number(n)/1024):0,limitSize:Number(R/1024)})},fail:function(e){n(e)}},{isMultiCallback:!1})}))]}))}))()},t.remove=function(e){var t=this;return V((function(){return Q(this,(function(n){return[2,new Promise((function(n,r){Vr("ZBROWSER_MPDS",{mpds_action:"mpds.remove.key",mpds_data:{keys:e},appId:Ii(t,Zi)},{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 V((function(){return Q(this,(function(t){return[2,new Promise((function(t,n){Vr("ZBROWSER_MPDS",{mpds_action:"mpds.clear.appData",mpds_data:{},appId:Ii(e,Zi)},{success:function(){t()},fail:function(e){n(e)}},{isMultiCallback:!1})}))]}))}))()},e}(),Wi=function(){function e(){pr(this,e)}var t=e.prototype;return t.getDataFromStorage=function(e){var t=this;return V((function(){var n,r;return Q(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]=ei(e)})),[2,r]}}))}))()},t.putDataToStorage=function(e){var t=this;return V((function(){var n,r;return Q(this,(function(i){switch(i.label){case 0:return n=t.getInstance(),r={},Object.entries(e).forEach((function(e){var t=kn(e,2),n=t[0],i=t[1];lr.isUndefined(i)||lr.isNull(i)||(r[n]=ri(i))})),[4,n.set(r)];case 1:return[2,i.sent()]}}))}))()},t.removeDataFromStorage=function(e){var t=this;return V((function(){return Q(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 V((function(){return Q(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 V((function(){return Q(this,(function(t){switch(t.label){case 0:return[4,e.getInstance().getInfo()];case 1:return[2,t.sent()]}}))}))()},e}(),Gi=new WeakMap,Fi=function(e){gr(n,e);var t=br(n);function n(e){var r;return pr(this,n),Ni(_r(r=t.call(this)),Gi,{writable:!0,value:void 0}),Ci(_r(r),Gi,e),r}return n.prototype.getInstance=function(){return new Bi(Ii(this,Gi))},n}(Wi),Hi=new WeakMap,Ki=function(e){gr(n,e);var t=br(n);function n(e){var r;return pr(this,n),Ni(_r(r=t.call(this)),Hi,{writable:!0,value:void 0}),Ci(_r(r),Hi,e),r}return n.prototype.getInstance=function(){return new zi(Ii(this,Hi))},n}(Wi),Vi=new Fi(i),Ji=(null===(Mi=Tn())||void 0===Mi?void 0:Mi.zaloVersion)||"",qi=(null===(xi=Tn())||void 0===xi?void 0:xi.platformName)||"unknown";!!lr.isString(Ji)&&parseInt(Ji,10)>={android:12100571,iOS:400,wp:0,unknown:0}[qi]&&(null===(Ri=Tn())||void 0===Ri?void 0:Ri.appEnv.isMp)&&(Vi=new Ki(i));var $i=Vi,Yi=[Ct({data:yn.record(yt(),yn.any())}).optional()];function Qi(e){return Xi.apply(this,arguments)}function Xi(){return Xi=V((function(e){return Q(this,(function(t){return[2,ui("setStorage",Yi,[e],function(){var e=V((function(e){return Q(this,(function(t){switch(t.label){case 0:return En.isMp||En.isMpWeb?[4,$i.putDataToStorage(e.data)]:[3,2];case 1:return[2,t.sent()];case 2:return[2,Promise.reject(Pn("setStorage",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Xi.apply(this,arguments)}var eo=[Ct({keys:yn.array(yt())}).optional()];function to(e){return no.apply(this,arguments)}function no(){return no=V((function(e){return Q(this,(function(t){return[2,ui("getStorage",eo,[e],function(){var e=V((function(e){return Q(this,(function(t){switch(t.label){case 0:return En.isMp||En.isMpWeb?[4,$i.getDataFromStorage(e.keys)]:[3,2];case 1:return[2,t.sent()];case 2:return[2,Promise.reject(Pn("getStorage",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),no.apply(this,arguments)}function ro(e){return io.apply(this,arguments)}function io(){return(io=V((function(e){return Q(this,(function(t){return[2,ui("getStorageInfo",[],[e],V((function(){return Q(this,(function(e){switch(e.label){case 0:return En.isMp||En.isMpWeb?[4,$i.getStorageInfo()]:[3,2];case 1:return[2,e.sent()];case 2:return[2,Promise.reject(Pn("getStorageInfo",{}))]}}))})))]}))}))).apply(this,arguments)}var oo=[Ct({keys:yn.array(yt())}).optional()];function ao(e){return so.apply(this,arguments)}function so(){return so=V((function(e){return Q(this,(function(t){return[2,ui("removeStorage",oo,[e],function(){var e=V((function(e){return Q(this,(function(t){switch(t.label){case 0:return En.isMp||En.isMpWeb?[4,$i.removeDataFromStorage(e.keys)]:[3,2];case 1:return[2,t.sent()];case 2:return[2,Promise.reject(Pn("removeStorage",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),so.apply(this,arguments)}var uo=[Ct({prefix:yt().optional()}).optional()];function co(e){return lo.apply(this,arguments)}function lo(){return(lo=V((function(e){return Q(this,(function(t){return[2,ui("clearStorage",uo,[e],V((function(){return Q(this,(function(e){switch(e.label){case 0:return En.isMp||En.isMpWeb?[4,$i.clearStorage()]:[3,2];case 1:return[2,e.sent()];case 2:return[2,Promise.reject(Pn("clearStorage",{}))]}}))})))]}))}))).apply(this,arguments)}var po=function(){var e=V((function(e){var t,n;return Q(this,(function(r){switch(r.label){case 0:return[4,$r.getAccessToken(!0)];case 1:return t=r.sent(),n="id,name,user_id_by_oa,is_sensitive",n=e?"".concat(n,",picture.type(").concat(e,")"):"".concat(n,",picture"),[4,fetch("".concat(l.GET_USER_INFO,"?fields=").concat(n),{headers:{access_token:t||""}}).then(function(){var e=V((function(e){var t,n,r,i;return Q(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:!!i,isSensitive:null==r?void 0:r.is_sensitive}]}}))}));return function(t){return e.apply(this,arguments)}}())];case 2:return[2,r.sent()]}}))}));return function(t){return e.apply(this,arguments)}}(),fo=[Ct({avatarType:yn.enum(["small","normal","large"]).optional()}).optional()];function ho(e){return mo.apply(this,arguments)}function mo(){return mo=V((function(e){return Q(this,(function(t){return[2,ui("getUserInfo",fo,[e],function(){var e=V((function(e){var t;return Q(this,(function(n){switch(n.label){case 0:return En.isMp?(t=null==e?void 0:e.avatarType,[4,po(t)]):[3,2];case 1:return[2,{userInfo:n.sent()}];case 2:return En.isMpWeb?[2,Promise.resolve({userInfo:{id:"3368637342326461234",name:"User Name",avatar:"https://h5.zdn.vn/static/images/avatar.png"}})]:[2,Promise.reject(Pn("getUserInfo",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),mo.apply(this,arguments)}var vo=function(e){return{NONE:e?-2:0,WIFI:e?0:1,"2G":2,"3G":e?15:2,"4G":e?13:2}},yo=V((function(){return Q(this,(function(t){return[2,new Promise((function(t,n){Vr("WEBVIEW_NETWORKTYPE",{url:window.location.href,featureId:""},{success:function(n){var r,i,o,a=n.network,s=(null===(r=Tn())||void 0===r||null===(i=r.platform)||void 0===i?void 0:i.isAndroid)||!1;switch(a){case vo(s).NONE:o=e.NetworkType.none;break;case vo(s).WIFI:o=e.NetworkType.wifi;break;case vo(s)["2G"]:case vo(s)["3G"]:case vo(s)["4G"]:o=e.NetworkType.cellular;break;default:o=e.NetworkType.unknown}t(o)},fail:function(e){n(e)}},{})}))]}))}));function go(e){return _o.apply(this,arguments)}function _o(){return(_o=V((function(t){return Q(this,(function(n){return[2,ui("getNetworkType",[],[t],V((function(){var t,n;return Q(this,(function(r){switch(r.label){case 0:return En.isMp?[4,yo()]:[3,2];case 1:return[2,{networkType:r.sent()}];case 2:if(En.isMpWeb){switch(t=navigator.connection||navigator.mozConnection||navigator.webkitConnection,t.effectiveType){case"none":n=e.NetworkType.none;break;case"4g":n=e.NetworkType.wifi;break;case"3g":case"2g":n=e.NetworkType.cellular;break;default:n=e.NetworkType.unknown}return[2,Promise.resolve({networkType:n})]}return[2,Promise.reject(Pn("getNetworkType",{}))]}}))})))]}))}))).apply(this,arguments)}var bo=[yn.function().args(Ct({isConnected:yn.boolean(),networkType:yn.enum(["none","wifi","cellular","unknown"])})).returns(yn.void())];function wo(t){return ui("onNetworkStatusChange",bo,[t],(function(t){var n=t;if(En.isMp)!function(t){Er.getInstance().on(e.Events.NetworkChanged,(function(e){var n=null==e?void 0:e.state;yo().then((function(e){t({isConnected:"CONNECTED"===n,networkType:e})}))}))}(n);else if(En.isMpWeb){var r=navigator.connection||navigator.mozConnection||navigator.webkitConnection,i=r.effectiveType;r.addEventListener("change",(function(){var t;switch(i){case"none":t=e.NetworkType.none;break;case"4g":t=e.NetworkType.wifi;break;case"3g":case"2g":t=e.NetworkType.cellular;break;default:t=e.NetworkType.unknown}n({isConnected:!0,networkType:t})}))}}))}var To=function(){var e=V((function(e){var t,n,r,i,o,a;return Q(this,(function(s){return a={subaction:0,scanning_type:lr.isNumber(null==e?void 0:e.scanningType)?e.scanningType:0,data:{scan_from_source:lr.isString(null==e?void 0:e.scanFromSource)?e.scanFromSource:"",expire:lr.isNumber(null==e?void 0:e.expire)?e.expire:3e3,monitor_interval:lr.isNumber(null==e?void 0:e.monitorInterval)?e.monitorInterval:60,domain:lr.isString(null==e?void 0:e.domain)?e.domain:"",scan_config:{scan_time:lr.isNumber(null==e||null===(t=e.scanConfig)||void 0===t?void 0:t.scanTime)?e.scanConfig.scanTime:15e3,time_between_scan:lr.isNumber(null==e||null===(n=e.scanConfig)||void 0===n?void 0:n.timeBetweenScan)?e.scanConfig.timeBetweenScan:1e4,beacon_timeout:lr.isNumber(null==e||null===(r=e.scanConfig)||void 0===r?void 0:r.beaconTimeout)?e.scanConfig.beaconTimeout:3e4,delayCheckConnectedTimeout:lr.isNumber(null==e||null===(i=e.scanConfig)||void 0===i?void 0:i.delayCheckConnectedTimeout)?e.scanConfig.delayCheckConnectedTimeout:5e3,beaconConnectedTimeout:lr.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){Vr("SCAN_IBEACON",On({},a),{success:function(){e(!0)},fail:function(e){t(e)}},{})}))]}))}));return function(t){return e.apply(this,arguments)}}(),Eo=[Ct({scanningType:yn.number().refine((function(e){return[0,1].includes(e)}),{message:"The type must be either 0 or 1"}).default(0).optional(),expire:yn.number().optional(),monitorInterval:yn.number().optional(),domain:yn.string().optional(),scanConfig:Ct({scanTime:yn.number().optional(),timeBetweenScan:yn.number().optional(),beaconTimeout:yn.number().optional(),delayCheckConnectedTimeout:yn.number().optional(),beaconConnectedTimeout:yn.number().optional()}).optional(),items:yn.array(Ct({id:yn.string().optional(),distance:yn.number().optional(),monitor:Ct({enable:yn.boolean().optional(),movingRange:yn.number().optional()}).optional()})).optional(),scanFromSource:yn.string().optional()}).optional()];function So(e){return Po.apply(this,arguments)}function Po(){return(Po=V((function(e){return Q(this,(function(t){return[2,ui("startBeaconDiscovery",Eo,[e],V((function(){return Q(this,(function(t){switch(t.label){case 0:return En.isMp?[4,To(e)]:[3,2];case 1:return[2,t.sent()];case 2:return En.isMpWeb?[2,Promise.resolve(!0)]:[2,Promise.reject(Pn("startBeaconDiscovery",{}))]}}))})))]}))}))).apply(this,arguments)}var Ao=V((function(){return Q(this,(function(e){return[2,new Promise((function(e,t){Vr("SCAN_IBEACON",{subaction:2},{success:function(){e(!0)},fail:function(e){t(e)}},{})}))]}))}));function Oo(e){return ko.apply(this,arguments)}function ko(){return(ko=V((function(e){return Q(this,(function(t){return[2,ui("stopBeaconDiscovery",[],[e],V((function(){return Q(this,(function(e){switch(e.label){case 0:return En.isMp?[4,Ao()]:[3,2];case 1:return[2,e.sent()];case 2:return En.isMpWeb?[2,Promise.resolve(!0)]:[2,Promise.reject(Pn("stopBeaconDiscovery",{}))]}}))})))]}))}))).apply(this,arguments)}var Io=V((function(){return Q(this,(function(e){return[2,new Promise((function(e,t){Vr("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 No(e){return Co.apply(this,arguments)}function Co(){return(Co=V((function(e){return Q(this,(function(t){return[2,ui("getBeacons",[],[e],V((function(){return Q(this,(function(e){switch(e.label){case 0:return En.isMp?[4,Io()]:[3,2];case 1:return[2,e.sent()];case 2:return En.isMpWeb?[2,Promise.resolve({beacons:[]})]:[2,Promise.reject(Pn("getBeacons",{}))]}}))})))]}))}))).apply(this,arguments)}var Mo=V((function(){return Q(this,(function(e){return[2,new Promise((function(e,t){Vr("WINDOW_CLOSE",{},{success:function(t){e(t)},fail:function(e){t(e)}},{})}))]}))}));function xo(e){return Ro.apply(this,arguments)}function Ro(){return(Ro=V((function(e){return Q(this,(function(t){return[2,ui("closeApp",[],[e],V((function(){return Q(this,(function(e){switch(e.label){case 0:return En.isMp?[4,Mo()]:[3,2];case 1:return[2,e.sent()];case 2:return En.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Pn("closeApp",{}))]}}))})))]}))}))).apply(this,arguments)}var jo=V((function(){return Q(this,(function(e){return[2,new Promise((function(e,t){Vr("OPEN_QR",{skipOpenLink:!0},{success:function(t){e(t)},fail:function(e){t(e)}},{})}))]}))}));function Do(e){return Uo.apply(this,arguments)}function Uo(){return(Uo=V((function(e){return Q(this,(function(t){return[2,ui("scanQRCode",[],[e],V((function(){return Q(this,(function(e){switch(e.label){case 0:return En.isMp?[4,jo()]:[3,2];case 1:return[2,e.sent()];case 2:return En.isMpWeb?[2,Promise.resolve({content:""})]:[2,Promise.reject(Pn("scanQRCode",{}))]}}))})))]}))}))).apply(this,arguments)}var Bo=function(){var t=V((function(t,n,i,o){return Q(this,(function(a){return[2,new Promise((function(a,s){Vr("OPEN_PROFILE",{uId:t,type:e.ProfileType[n],zapp:r,sourceId:i,sourceIndex:o},{success:function(){a()},fail:function(e){s(e)}},{})}))]}))}));return function(e,n,r,i){return t.apply(this,arguments)}}(),Zo=[Ct({id:yt(),type:yn.enum(["user","oa","aliasOA"]),sourceId:yn.any().optional(),sourceIndex:yn.any().optional()}).optional()];function Lo(e){return zo.apply(this,arguments)}function zo(){return zo=V((function(e){return Q(this,(function(t){return[2,ui("openProfile",Zo,[e],function(){var e=V((function(e){var t,n,r,i;return Q(this,(function(o){switch(o.label){case 0:return En.isMp?(t=e.id,n=e.type,r=e.sourceId,i=e.sourceIndex,[4,Bo(t,n,r,i)]):[3,2];case 1:return[2,o.sent()];case 2:return En.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Pn("openProfile",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),zo.apply(this,arguments)}var Wo=function(){var t=V((function(t,n){var i,o,a,s=arguments;return Q(this,(function(u){return i=s.length>2&&void 0!==s[2]?s[2]:"",o=s.length>3?s[3]:void 0,a=s.length>4?s[4]:void 0,[2,new Promise((function(s,u){Vr("OPEN_CHAT",{uId:t,type:e.ChatType[n],msg:i,zapp:r,sourceId:o,sourceIndex:a},{success:function(){s()},fail:function(e){u(e)}},{})}))]}))}));return function(e,n){return t.apply(this,arguments)}}(),Go=[Ct({id:yt(),type:yn.enum(["user","oa"]),sourceId:yn.any().optional(),sourceIndex:yn.any().optional(),message:yt().optional()}).optional()];function Fo(e){return Ho.apply(this,arguments)}function Ho(){return Ho=V((function(e){return Q(this,(function(t){return[2,ui("openChat",Go,[e],function(){var e=V((function(e){var t,n,r,i,o;return Q(this,(function(a){switch(a.label){case 0:return En.isMp?(t=e.id,n=e.type,r=e.message,i=e.sourceId,o=e.sourceIndex,[4,Wo(t,n,r,i,o)]):[3,2];case 1:return[2,a.sent()];case 2:return En.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Pn("openChat",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Ho.apply(this,arguments)}function Ko(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 Vo=function(){var t=V((function(t,n){var i;return Q(this,(function(o){switch(i={},t){case"image":i={photoUrl:null==n?void 0:n.imageUrl};break;case"link":i={link:null==n?void 0:n.link,title:null==n?void 0:n.title,thumb:null==n?void 0:n.thumb,description:null==n?void 0:n.description};break;case"profile":i={avt:null==n?void 0:n.avatar,uid:null==n?void 0:n.id,dpn:null==n?void 0:n.displayName}}return[2,new Promise((function(n,o){Vr("OPEN_POSTFEED",Ko(On({type:e.PostFeedType[t]},i),{zapp:r}),{success:function(e){n({status:null==e?void 0:e.status,shareType:null==e?void 0:e.share_type,numberOfUser:null==e?void 0:e.uid_to_size})},fail:function(e){o(e)}},{})}))]}))}));return function(e,n){return t.apply(this,arguments)}}(),Jo=[yn.union([Ct({type:yn.enum(["image"]),data:Ct({imageUrl:yt().url().optional()})}),Ct({type:yn.enum(["link"]),data:Ct({link:yt().url(),title:yt().max(100).optional(),thumb:yt().url().optional(),description:yt().max(400).default("").optional()})}),Ct({type:yn.enum(["profile"]),data:Ct({id:yt().optional()})})])];function qo(e){return $o.apply(this,arguments)}function $o(){return $o=V((function(e){return Q(this,(function(t){return[2,ui("openPostFeed",Jo,[e],function(){var e=V((function(e){var t,n;return Q(this,(function(r){switch(r.label){case 0:return En.isMp?(t=e.type,n=e.data,[4,Vo(t,n)]):[3,2];case 1:return[2,r.sent()];case 2:return En.isMpWeb?[2,Promise.resolve({status:1,shareType:0,numberOfUser:0})]:[2,Promise.reject(Pn("openPostFeed",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),$o.apply(this,arguments)}var Yo=function(){var e=V((function(e){return Q(this,(function(t){return[2,new Promise((function(t,n){Vr("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)}}(),Qo=[Ct({id:yt(),showDialogConfirm:yn.boolean().optional()}).optional()];function Xo(e){return ea.apply(this,arguments)}function ea(){return ea=V((function(e){return Q(this,(function(t){return[2,ui("followOA",Qo,[e],function(){var e=V((function(e){var t;return Q(this,(function(n){switch(n.label){case 0:return En.isMp?(t=e.id,[4,Yo(t)]):[3,2];case 1:return[2,n.sent()];case 2:return En.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Pn("followOA",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),ea.apply(this,arguments)}var ta=function(){var e=V((function(e){return Q(this,(function(t){return[2,new Promise((function(t,n){Vr("UNFOLLOW_OA",{uid:e,forceUpdate:!0,zapp:r},{success:function(){t()},fail:function(e){n(e)}},{})}))]}))}));return function(t){return e.apply(this,arguments)}}(),na=[Ct({id:yt()}).optional()];function ra(e){return ia.apply(this,arguments)}function ia(){return ia=V((function(e){return Q(this,(function(t){return[2,ui("unfollowOA",na,[e],function(){var e=V((function(e){var t;return Q(this,(function(n){switch(n.label){case 0:return En.isMp?(t=e.id,[4,ta(t)]):[3,2];case 1:return[2,n.sent()];case 2:return En.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Pn("unfollowOA",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),ia.apply(this,arguments)}var oa=function(){var e=V((function(e,t,n,r,i,a){var s,c,p,d,f,h;return Q(this,(function(m){switch(m.label){case 0:return s=new URL(location.href),c=new URLSearchParams,p="".concat(s.pathname.replace(u,"")).concat(s.search),a&&(p="/".concat(e).concat("/"===a[0]?"":"/").concat(a)),d=new URL("".concat(o).concat(p)),c.append("title",n),c.append("description",r||""),c.append("thumbnail",i||""),c.append("url",d.href),c.append("accessToken",t||""),f={headers:{"Content-Type":"application/x-www-form-urlencoded"}},[4,fetch(l.CREATE_SHARE_LINK,On({method:"POST",body:c},f))];case 1:return[4,m.sent().json()];case 2:if(!(h=m.sent())||0!==h.err)throw Kr.error.cannotGetShareInfo();return d.search="".concat(d.search,"&zshareId=").concat(h.data.shareId),[2,Ko(On({},h.data),{shareableLink:d.href})]}}))}));return function(t,n,r,i,o,a){return e.apply(this,arguments)}}(),aa=function(){var t=V((function(t,n){var o,a,s,u,c,l,p,d,f,h;return Q(this,(function(m){switch(m.label){case 0:switch(o={},a=t,t){case"image":return[3,1];case"gif":return[3,2];case"video":return[3,3];case"link":return[3,4];case"oa":return[3,5];case"zmp":return[3,6];case"zmp_deep_link":return[3,9]}return[3,12];case 1:return l=[],p=(null===(u=Tn())||void 0===u?void 0:u.zaloVersion)||0,d=(null===(c=Tn())||void 0===c?void 0:c.platformName)||"unknown",Number(p)>=x[d]&&(a="multi_image"),Array.isArray(null==n?void 0:n.imageUrls)&&(null==n?void 0:n.imageUrls.length)>0?l=null==n?void 0:n.imageUrls:l.push(null==n?void 0:n.imageUrl),o={photoUrls:l,photoUrl:null==n?void 0:n.imageUrl,caption:null==n?void 0:n.caption},[3,13];case 2:return o={photoUrl:null==n?void 0:n.imageUrl,gifUrl:null==n?void 0:n.gifUrl,width:null==n?void 0:n.width,height:null==n?void 0:n.height},[3,13];case 3:return o={videoThumb:null==n?void 0:n.videoThumb,videoUrl:null==n?void 0:n.videoUrl,width:null==n?void 0:n.width,height:null==n?void 0:n.height},[3,13];case 4:return o={link:null==n?void 0:n.link,chatOnly:(null==n?void 0:n.chatOnly)?1:0},[3,13];case 5:return o={uid:null==n?void 0:n.id},[3,13];case 6:case 9:return[4,$r.getAccessToken()];case 7:case 10:return s=m.sent(),[4,oa(i,s||"",(null==n?void 0:n.title)||"",(null==n?void 0:n.description)||"",(null==n?void 0:n.thumbnail)||"",null==n?void 0:n.path)];case 8:return f=m.sent(),o={data:{ZInstantAPIInfo:{url:"".concat(f.zinstantApi),zinstantdata_id:"templateId=".concat(f.ztemplateId,"&appId=").concat(i,"&shareId=").concat(f.shareId)},previewMsgText:{msg:{en:"Zalo Mini Program",vi:"Chương trình nhỏ"}},enableReactions:1}},[3,13];case 11:return h=m.sent().shareableLink,o={link:h,chatOnly:0},[3,13];case 12:return[3,13];case 13:return[2,new Promise((function(t,n){Vr("OPEN_SHARESHEET",Ko(On({type:e.ShareSheetType[a]},o),{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){n(e)}},{timeout:!1})}))]}}))}));return function(e,n){return t.apply(this,arguments)}}(),sa=[yn.union([Ct({type:yn.enum(["image"]),data:Ct({imageUrl:yt().url(),imageUrls:yn.array(yt().url()).max(10).optional()})}),Ct({type:yn.enum(["link"]),data:Ct({link:yt().url(),chatOnly:yn.boolean().optional()})}),Ct({type:yn.enum(["oa"]),data:Ct({id:yt()})}),Ct({type:yn.enum(["gif"]),data:Ct({gifUrl:yt().url(),imageUrl:yt().url().optional(),width:gt().min(0).optional(),height:gt().min(0).optional()})}),Ct({type:yn.enum(["video"]),data:Ct({videoThumb:yt().url(),videoUrl:yt().url(),width:gt().min(0).optional(),height:gt().min(0).optional()})}),Ct({type:yn.enum(["zmp","zmp_deep_link"]),data:Ct({title:yt().max(100),thumbnail:yt().url(),path:yt().optional(),description:yt().max(400).default("").optional()})})])];function ua(e){return ca.apply(this,arguments)}function ca(){return ca=V((function(e){return Q(this,(function(t){return[2,ui("openShareSheet",sa,[e],function(){var e=V((function(e){var t,n;return Q(this,(function(r){switch(r.label){case 0:return En.isMp?(t=e.type,n=e.data,[4,aa(t,n)]):[3,2];case 1:return[2,r.sent()];case 2:return En.isMpWeb?[2,Promise.resolve({status:2,shareType:0,numberOfUser:0})]:[2,Promise.reject(Pn("openShareSheet",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),ca.apply(this,arguments)}var la=V((function(){return Q(this,(function(e){return[2,new Promise((function(e,t){Vr("REQUEST_PERMISSION_CAMERA",{},{success:function(t){var n,r;(null===(n=Tn())||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=Tn())||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 da.apply(this,arguments)}function da(){return(da=V((function(e){return Q(this,(function(t){return[2,ui("requestCameraPermission",[],[e],V((function(){return Q(this,(function(e){switch(e.label){case 0:return[4,la()];case 1:return[2,e.sent()]}}))})))]}))}))).apply(this,arguments)}var fa=function(){var e=V((function(e,t,n){return Q(this,(function(r){return[2,new Promise((function(r,i){Vr("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)}}(),ha=V((function(){var e,t,n,r=arguments;return Q(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=mi(),[4,Rr(e,t,n.version)];case 1:return[2,o.sent()]}}))})),ma=function(){var e=V((function(e){return Q(this,(function(t){return[2,new Promise((function(t,n){Vr("OPEN_OUTAPP",{url:e},{success:function(){t()},fail:function(e){n(e)}},{})}))]}))}));return function(t){return e.apply(this,arguments)}}(),va=[Ct({params:yn.record(yt(),yt()).optional()}).optional()];function ya(e){return ga.apply(this,arguments)}function ga(){return ga=V((function(e){return Q(this,(function(t){return[2,ui("createShortcut",va,[e],function(){var e=V((function(e){var t,n,r,a,s,u,c,l;return Q(this,(function(p){switch(p.label){case 0:return En.isMp?[4,ha(i,0)]:[3,6];case 1:return r=p.sent(),a=null===(t=Tn())||void 0===t||null===(n=t.platform)||void 0===n?void 0:n.isIOS,s=r.logoUrl||ni("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,ma(encodeURI(l))]):[3,3];case 2:return p.sent(),[3,5];case 3:return[4,fa("".concat(o,"/").concat(i,"/?").concat(c.toString()),u,s)];case 4:p.sent(),p.label=5;case 5:return[2,Kr.success()];case 6:return En.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Pn("createShortcut",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),ga.apply(this,arguments)}var _a=function(){var e=V((function(e,t,n){return Q(this,(function(i){return[2,new Promise((function(i,o){Vr("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)}}(),ba=[Ct({secretData:yt(),ui:Ct({title:yt().default("Xác thực").optional(),subTitle:yt().default("Sử dụng sinh trắc học của bạn để xác thực").optional(),negativeButtonText:yt().default("Đóng").optional()}).optional(),requireFingerprint:wt().default(!0).optional()}).optional()];function wa(e){return Ta.apply(this,arguments)}function Ta(){return Ta=V((function(e){return Q(this,(function(t){return[2,ui("openBioAuthentication",ba,[e],function(){var e=V((function(e){var t,n,r;return Q(this,(function(i){switch(i.label){case 0:return En.isMp?(t=e.secretData,n=e.ui,r=e.requireFingerprint,[4,_a(t,n,r)]):[3,2];case 1:return[2,i.sent()];case 2:return En.isMpWeb?[2,Promise.resolve({code:0,message:"OK",data:{domain:"",code:0,message:"",payToken:""}})]:[2,Promise.reject(Pn("openBioAuthentication",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Ta.apply(this,arguments)}var Ea=V((function(){return Q(this,(function(e){return[2,new Promise((function(e,t){Vr("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 Sa(e){return Pa.apply(this,arguments)}function Pa(){return(Pa=V((function(e){return Q(this,(function(t){return[2,ui("checkStateBioAuthentication",[],[e],V((function(){return Q(this,(function(e){switch(e.label){case 0:return En.isMp?[4,Ea()]:[3,2];case 1:return[2,{bioState:e.sent()}];case 2:return En.isMpWeb?[2,Promise.resolve({bioState:""})]:[2,Promise.reject(Pn("checkStateBioAuthentication",{}))]}}))})))]}))}))).apply(this,arguments)}var Aa=function(){var e=V((function(e){return Q(this,(function(t){return[2,new Promise((function(t,n){Vr("SHOW_TOAST",{toast:e},{success:function(){t()},fail:function(e){n(e)}},{})}))]}))}));return function(t){return e.apply(this,arguments)}}(),Oa=[Ct({message:yt()}).optional()];function ka(e){return Ia.apply(this,arguments)}function Ia(){return Ia=V((function(e){return Q(this,(function(t){return[2,ui("showToast",Oa,[e],function(){var e=V((function(e){return Q(this,(function(t){switch(t.label){case 0:return En.isMp?[4,Aa(e.message)]:[3,2];case 1:return[2,t.sent()];case 2:return En.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Pn("showToast",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Ia.apply(this,arguments)}var Na=V((function(){return Q(this,(function(e){return[2,new Promise((function(e,t){Vr("HIDE_KEYBOARD",{},{success:function(){e()},fail:function(e){t(e)}},{})}))]}))}));function Ca(e){return Ma.apply(this,arguments)}function Ma(){return(Ma=V((function(e){return Q(this,(function(t){return[2,ui("hideKeyboard",[],[e],V((function(){return Q(this,(function(e){switch(e.label){case 0:return En.isMp?[4,Na()]:[3,2];case 1:return[2,e.sent()];case 2:return En.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Pn("hideKeyboard",{}))]}}))})))]}))}))).apply(this,arguments)}var xa=function(){var e=V((function(e){return Q(this,(function(t){return[2,new Promise((function(t,n){Vr("OPEN_PHONE",{phoneNum:e,phoneCode:e},{success:function(){t()},fail:function(e){n(e)}},{})}))]}))}));return function(t){return e.apply(this,arguments)}}(),Ra=[Ct({phoneNumber:yt()})];function ja(e){return Da.apply(this,arguments)}function Da(){return Da=V((function(e){return Q(this,(function(t){return[2,ui("openPhone",Ra,[e],function(){var e=V((function(e){return Q(this,(function(t){switch(t.label){case 0:return En.isMp?[4,xa(e.phoneNumber)]:[3,2];case 1:return[2,t.sent()];case 2:return En.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Pn("openPhone",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Da.apply(this,arguments)}var Ua=function(){var e=V((function(e,t){return Q(this,(function(n){return[2,new Promise((function(n,r){Vr("OPEN_SMS",{content:t,phoneCode:e},{success:function(){n()},fail:function(e){r(e)}},{})}))]}))}));return function(t,n){return e.apply(this,arguments)}}(),Ba=[Ct({content:yt(),phoneNumber:yt()})];function Za(e){return La.apply(this,arguments)}function La(){return La=V((function(e){return Q(this,(function(t){return[2,ui("openSMS",Ba,[e],function(){var e=V((function(e){return Q(this,(function(t){switch(t.label){case 0:return En.isMp?[4,Ua(e.phoneNumber,e.content)]:[3,2];case 1:return[2,t.sent()];case 2:return En.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Pn("openSMS",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),La.apply(this,arguments)}var za=function(){var e=V((function(e){var t,n=arguments;return Q(this,(function(i){return t=n.length>1&&void 0!==n[1]?n[1]:"",[2,new Promise((function(n,i){Vr("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)}}(),Wa=[Ct({id:yt(),displayName:yt().default("").optional()})];function Ga(e){return Fa.apply(this,arguments)}function Fa(){return Fa=V((function(e){return Q(this,(function(t){return[2,ui("viewOAQr",Wa,[e],function(){var e=V((function(e){return Q(this,(function(t){switch(t.label){case 0:return En.isMp?[4,za(e.id,e.displayName)]:[3,2];case 1:return[2,t.sent()];case 2:return En.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Pn("viewOAQr",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Fa.apply(this,arguments)}var Ha=function(){var e=V((function(e){return Q(this,(function(t){return[2,new Promise((function(t,n){Vr("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)}}(),Ka=[Ct({keepScreenOn:wt()})];function Va(e){return Ja.apply(this,arguments)}function Ja(){return Ja=V((function(e){return Q(this,(function(t){return[2,ui("keepScreen",Ka,[e],function(){var e=V((function(e){return Q(this,(function(t){switch(t.label){case 0:return En.isMp?[4,Ha(e.keepScreenOn)]:[3,2];case 1:return[2,t.sent()];case 2:return En.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Pn("keepScreen",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Ja.apply(this,arguments)}function qa(e){return $a.apply(this,arguments)}function $a(){return($a=V((function(e){return Q(this,(function(t){return[2,ui("onKeepScreen",[],[e],V((function(){return Q(this,(function(e){switch(e.label){case 0:return En.isMp?[4,Ha(!0)]:[3,2];case 1:return[2,e.sent()];case 2:return En.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Pn("onKeepScreen",{}))]}}))})))]}))}))).apply(this,arguments)}function Ya(e){return Qa.apply(this,arguments)}function Qa(){return(Qa=V((function(e){return Q(this,(function(t){return[2,ui("offKeepScreen",[],[e],V((function(){return Q(this,(function(e){switch(e.label){case 0:return En.isMp?[4,Ha(!1)]:[3,2];case 1:return[2,e.sent()];case 2:return En.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Pn("offKeepScreen",{}))]}}))})))]}))}))).apply(this,arguments)}var Xa=function(){var e=V((function(e,t){var n;return Q(this,(function(r){return n={},e?n={imageBase64Data:e}:t&&(n={imageUrl:t}),[2,new Promise((function(e,t){Vr("SAVE_IMAGE_GALLERY",On({},n),{success:function(){e()},fail:function(e){t(e)}},{})}))]}))}));return function(t,n){return e.apply(this,arguments)}}(),es=[Ct({imageBase64Data:yt().optional(),imageUrl:yt().url().optional()}).optional()];function ts(e){return ns.apply(this,arguments)}function ns(){return ns=V((function(e){return Q(this,(function(t){return[2,ui("saveImageToGallery",es,[e],function(){var e=V((function(e){return Q(this,(function(t){switch(t.label){case 0:return En.isMp?[4,Xa(e.imageBase64Data,e.imageUrl)]:[3,2];case 1:return[2,t.sent()];case 2:return En.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Pn("saveImageToGallery",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),ns.apply(this,arguments)}var rs=function(){var e=V((function(e){var t,n,r,i,o,s,u=arguments;return Q(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,ha(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=kn(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){Vr("OPEN_MP",{mpUrl:o,mpInfo:i},{success:function(){e()},fail:function(e){t(e)}},{})}))]}}))}));return function(t){return e.apply(this,arguments)}}(),is=[Ct({appId:yt(),path:yt().optional(),params:yn.record(yt(),yt()).optional()})];function os(e){return as.apply(this,arguments)}function as(){return as=V((function(e){return Q(this,(function(t){return[2,ui("openMiniApp",is,[e],function(){var e=V((function(e){return Q(this,(function(t){switch(t.label){case 0:return En.isMp?[4,rs(e.appId,e.path,e.params)]:[3,2];case 1:return[2,t.sent()];case 2:return En.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Pn("openMiniApp",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),as.apply(this,arguments)}var ss=V((function(){var t,n,r=arguments;return Q(this,(function(i){return t=r.length>0&&void 0!==r[0]?r[0]:"oneShot",n=r.length>1?r[1]:void 0,[2,new Promise((function(r,i){Vr("INTERACTIVE_VIBRATION",{type:e.VibrateType[t],vibrate_time:n},{success:function(){r()},fail:function(e){i(e)}},{})}))]}))})),us=[Ct({type:yn.enum(["oneShot"]).default("oneShot"),milliseconds:gt().optional()})];function cs(e){return ls.apply(this,arguments)}function ls(){return ls=V((function(e){return Q(this,(function(t){return[2,ui("vibrate",us,[e],function(){var e=V((function(e){return Q(this,(function(t){switch(t.label){case 0:return En.isMp?[4,ss(null==e?void 0:e.type,null==e?void 0:e.milliseconds)]:[3,2];case 1:return[2,t.sent()];case 2:return En.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Pn("vibrate",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),ls.apply(this,arguments)}var ps=function(){var e=V((function(e,t){var n,r,i,o;return Q(this,(function(a){return n=new URL(e),r=n.href.includes("vnpay"),i=n.searchParams.get("typeInapp"),o=lr.isEmpty(t)?void 0:{modal_style:(null==t?void 0:t.style)?Dr(null==t?void 0:t.style):"bottom_sheet",left_button:(null==t?void 0:t.leftButton)?Dr(null==t?void 0:t.leftButton):"back"},!r&&lr.isEmpty(i)&&n.searchParams.set("typeInapp","1"),[2,new Promise((function(e,t){Vr("OPEN_INAPP",{url:n.href,style:o},{success:function(){e()},fail:function(e){t(e)}},{})}))]}))}));return function(t,n){return e.apply(this,arguments)}}(),ds=[Ct({url:yt(),config:Ct({style:yn.enum(["bottomSheet","normal"]).default("bottomSheet").optional(),leftButton:yn.enum(["back","none"]).default("back").optional()}).optional()})];function fs(e){return hs.apply(this,arguments)}function hs(){return hs=V((function(e){return Q(this,(function(t){return[2,ui("openWebview",ds,[e],function(){var e=V((function(e){return Q(this,(function(t){switch(t.label){case 0:return En.isMp?[4,ps(e.url,e.config)]:[3,2];case 1:return[2,t.sent()];case 2:return En.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Pn("openWebview",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),hs.apply(this,arguments)}function ms(){var e={},t=window.location.href;try{var n=new URL(t).searchParams.toString();n&&(e=Ar.getParamsAsObject(n))}catch(e){throw new Error("Invalid URL")}return e}function vs(){return ui("getRouteParams",[],[],(function(){return ms()}))}function ys(e){return gs.apply(this,arguments)}function gs(){return(gs=V((function(e){return Q(this,(function(t){return[2,ui("getAppInfo",[],[e],V((function(){return Q(this,(function(e){switch(e.label){case 0:return En.isMp?[4,ha()]:[3,2];case 1:return[2,e.sent()];case 2:return En.isMpWeb?[2,Promise.resolve({description:"",name:"",version:"",appUrl:"",qrCodeUrl:""})]:[2,Promise.reject(Pn("getAppInfo",{}))]}}))})))]}))}))).apply(this,arguments)}var _s=function(){var e=V((function(e){return Q(this,(function(t){return[2,new Promise((function(t,n){Vr("WEBVIEW_SET_RESULT",{result:ri(e)},{success:function(){t()},fail:function(e){n(e)}},{})}))]}))}));return function(t){return e.apply(this,arguments)}}(),bs=[Ct({data:yn.any()})];function ws(e){return Ts.apply(this,arguments)}function Ts(){return Ts=V((function(e){return Q(this,(function(t){return[2,ui("sendDataToPreviousMiniApp",bs,[e],function(){var e=V((function(e){return Q(this,(function(t){switch(t.label){case 0:return En.isMp?[4,_s(e.data)]:[3,2];case 1:return[2,t.sent()];case 2:return En.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Pn("sendDataToPreviousMiniApp",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Ts.apply(this,arguments)}var Es=V((function(){return Q(this,(function(e){return[2,new Promise((function(e,t){var n,r;Vr("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(Kr.error.clientNotSupport())},fail:function(e){t(e)}},{delay:(null===(n=Tn())||void 0===n||null===(r=n.platform)||void 0===r?void 0:r.isIOS)?400:0})}))]}))}));function Ss(e){return Ps.apply(this,arguments)}function Ps(){return(Ps=V((function(e){return Q(this,(function(t){return[2,ui("getPhoneNumber",[],[e],V((function(){return Q(this,(function(e){switch(e.label){case 0:return En.isMp?[4,Es()]:[3,2];case 1:return[2,e.sent()];case 2:return En.isMpWeb?[2,Promise.resolve({number:""})]:[2,Promise.reject(Pn("getPhoneNumber",{}))]}}))})))]}))}))).apply(this,arguments)}var As=V((function(){var e,t=arguments;return Q(this,(function(n){return e=t.length>0&&void 0!==t[0]?t[0]:1,[2,new Promise((function(t,n){Vr("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})}))]}))})),Os=[Ct({maxProfile:gt().min(1).max(10).optional().default(1)})];function ks(e){return Is.apply(this,arguments)}function Is(){return Is=V((function(e){return Q(this,(function(t){return[2,ui("openProfilePicker",Os,[e],function(){var e=V((function(e){var t,n,r,i,o;return Q(this,(function(a){switch(a.label){case 0:return En.isMp?[4,As(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,$r.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,p,d;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(lr.isUndefined(null===(p=i.data[e])||void 0===p?void 0:p.message)?"Unknown error":null===(d=i.data[e])||void 0===d?void 0:d.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 En.isMpWeb?[2,Promise.resolve({users:[]})]:[2,Promise.reject(Pn("openProfilePicker",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Is.apply(this,arguments)}var Ns=function(){var e=V((function(e,t,n){var r;return Q(this,(function(i){return r=t&&lr.isString(t)&&t.length>0?"wpa_wpa2":"open",[2,new Promise((function(i,o){Vr("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)}}(),Cs=[Ct({SSID:yt(),password:yt().optional(),hiddenSSID:wt().optional()})];function Ms(e){return xs.apply(this,arguments)}function xs(){return xs=V((function(e){return Q(this,(function(t){return[2,ui("connectWifi",Cs,[e],function(){var e=V((function(e){return Q(this,(function(t){switch(t.label){case 0:return En.isMp?[4,Ns(e.SSID,e.password,e.hiddenSSID)]:[3,2];case 1:return[2,t.sent()];case 2:return En.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Pn("connectWifi",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),xs.apply(this,arguments)}var Rs=function(){var t=V((function(t,n,r,i,o,a){var s,u;return Q(this,(function(c){return s={type:0,url:n,maxSize:r||1048576},u={enable:1,aspect_ratio:"1:1"},[2,new Promise((function(n,r){Vr("PICK_MEDIA",{media_type:e.MediaPickerType[t],edit_view:On({},u,i),silent_request:o,upload:s,max_select_items:a},{success:function(e){n(null==e?void 0:e.result_content)},fail:function(e){r(e)}},{isMultiCallback:!0})}))]}))}));return function(e,n,r,i,o,a){return t.apply(this,arguments)}}(),js=[Ct({type:yn.enum(["video","photo","file","zcamera","zcamera_photo","zcamera_video","zcamera_scan"]),serverUploadUrl:yt().url(),maxItemSize:gt().min(0).optional(),editView:Ct({enable:wt().optional(),aspectRatio:yt().regex(/^d+:d+$/).optional()}).optional(),silentRequest:wt().optional(),maxSelectItem:gt().min(1).optional()})];function Ds(e){return Us.apply(this,arguments)}function Us(){return Us=V((function(e){return Q(this,(function(t){return[2,ui("openMediaPicker",js,[e],function(){var e=V((function(e){var t,n,r,i,o,a;return Q(this,(function(s){switch(s.label){case 0:return En.isMp?(i={},lr.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,Rs(e.type,e.serverUploadUrl,e.maxItemSize,i,o,a)]):[3,2];case 1:return[2,{data:s.sent()}];case 2:return En.isMpWeb?[2,Promise.resolve({data:""})]:[2,Promise.reject(Pn("openMediaPicker",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Us.apply(this,arguments)}var Bs=[Ct({title:yt().max(100),description:yt().max(400).default(""),thumbnail:yt().url().optional(),path:yt().optional()})];function Zs(e){return Ls.apply(this,arguments)}function Ls(){return Ls=V((function(e){return Q(this,(function(t){return[2,ui("getShareableLink",Bs,[e],function(){var e=V((function(e){var t;return Q(this,(function(n){switch(n.label){case 0:return[4,$r.getAccessToken()];case 1:return t=n.sent(),[4,oa(window.APP_ID,t||"",e.title,e.description,e.thumbnail,e.path)];case 2:return[2,n.sent().shareableLink]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Ls.apply(this,arguments)}var zs=function(){var e=V((function(e){return Q(this,(function(t){return[2,new Promise((function(t,n){Vr("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 Ws(e){return Gs.apply(this,arguments)}function Gs(){return(Gs=V((function(e){return Q(this,(function(t){return[2,ui("closeLoading",[],[e],V((function(){return Q(this,(function(e){switch(e.label){case 0:return En.isMp?[4,zs("user action")]:[3,2];case 1:return[2,e.sent()];case 2:return En.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Pn("closeLoading",{}))]}}))})))]}))}))).apply(this,arguments)}function Fs(e){return Hs.apply(this,arguments)}function Hs(){return Hs=V((function(e){return Q(this,(function(t){return[2,ui("requestUpdateZalo",[],[e],V((function(){var e,t,n;return Q(this,(function(r){switch(r.label){case 0:return En.isMp?(n=(null===(e=Tn())||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,ma(n)]):[3,2];case 1:return[2,r.sent()];case 2:return En.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Pn("requestUpdateZalo",{}))]}}))})))]}))})),Hs.apply(this,arguments)}var Ks=Er.getInstance();Ks.addListener=function(t,n,r){var i=t;return Ks.addListener(e.Events[i],n,r)};var Vs=[yn.function()];function Js(t){return ui("onConfirmToExit",Vs,[t],(function(t){var n=t;En.isMp&&(Ks.on(e.Events.AppClose,n,'{"handle_h5": 1}'),gi.setNavigationBarLeftButton(void 0,2))}))}function qs(){return ui("offConfirmToExit",[],[],(function(){En.isMp&&(Ks.off(e.Events.AppClose),gi.setNavigationBarLeftButton(void 0,0))}))}function $s(){return ui("getDeviceId",[],[],(function(){return En.isMp&&$r.getSync(c.DEVICE_ID)||""}))}function Ys(e){return Qs.apply(this,arguments)}function Qs(){return(Qs=V((function(e){return Q(this,(function(t){return[2,ui("getDeviceIdAsync",[],[e],V((function(){return Q(this,(function(e){switch(e.label){case 0:return En.isMp?[4,$r.jumpAndGetToken(c.DEVICE_ID)]:[3,2];case 1:return[2,e.sent()||""];case 2:return[2,Promise.resolve("")]}}))})))]}))}))).apply(this,arguments)}function Xs(){return ui("getContext",[],[],(function(){if(En.isMp){var e=$r.getSync(c.CONTEXT_ID)||"";return{type:$r.getSync(c.CONTEXT_TYPE)||"",id:e}}return{type:"",id:""}}))}function eu(e){return tu.apply(this,arguments)}function tu(){return(tu=V((function(e){return Q(this,(function(t){return[2,ui("getContextAsync",[],[e],V((function(){var e;return Q(this,(function(t){switch(t.label){case 0:return En.isMp?[4,$r.jumpAndGetToken(c.CONTEXT_ID)]:[3,3];case 1:return e=t.sent()||"",[4,$r.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 nu(e){return ru.apply(this,arguments)}function ru(){return(ru=V((function(e){return Q(this,(function(t){return[2,ui("getAuthCode",[],[e],V((function(){var e,t;return Q(this,(function(n){switch(n.label){case 0:return En.isMp?[4,$r.jumpAndGetToken(c.ZOAUTH,!0)]:[3,4];case 1:return e=n.sent()||"",[4,$r.jumpAndGetToken(c.ZOAUTH_VRF)];case 2:return t=n.sent()||"",[4,$r.verifyUserAuthorized()];case 3:if(n.sent())return[2,{authCode:e,authCodeVerify:t}];throw jr([{action:"getAuthCode",error:-104,message:"no user auth",data:{}}]),Kr.error.loginFailed("User Authentication Required");case 4:return[2,Promise.resolve({authCode:"",authCodeVerify:""})]}}))})))]}))}))).apply(this,arguments)}function iu(e){return ou.apply(this,arguments)}function ou(){return(ou=V((function(e){return Q(this,(function(t){return[2,ui("getZPIToken",[],[e],V((function(){var e,t,n,r;return Q(this,(function(i){switch(i.label){case 0:return En.isMp?[4,$r.jumpAndGetToken(c.UTOKEN_ZPI)]:[3,5];case 1:return e=i.sent()||"",[4,$r.jumpAndGetToken(c.GTOKEN_ZPI)];case 2:return t=i.sent()||"",[4,$r.jumpAndGetToken(c.ZPP_ZPI)];case 3:return n=i.sent()||"",[4,$r.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 au=[yt()];function su(e){return ui("setAccessToken",au,[e],(function(e){var t=e;$r.setAccessToken(t)}))}var uu=[Ct({url:yt().url()})];function cu(e){return lu.apply(this,arguments)}function lu(){return lu=V((function(e){return Q(this,(function(t){return[2,ui("openOutApp",uu,[e],function(){var e=V((function(e){return Q(this,(function(t){switch(t.label){case 0:return En.isMp?[4,ma(e.url)]:[3,2];case 1:return[2,t.sent()];case 2:return En.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Pn("openOutApp",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),lu.apply(this,arguments)}var pu=[Ct({count:gt().min(1).optional().default(1),sourceType:yn.array(yn.enum(["album","camera"])).max(2).default(["album","camera"]).optional(),cameraType:yn.enum(["back","front"]).default("front").optional()})];function du(e){return fu.apply(this,arguments)}function fu(){return fu=V((function(e){return Q(this,(function(t){return[2,ui("chooseImage",pu,[e],function(){var e=V((function(e){var t,n,r,i;return Q(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)}}())]}))})),fu.apply(this,arguments)}var hu=V((function(){var e,t,n=arguments;return Q(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){Vr("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(Kr.error.clientNotSupport())},fail:function(e){r(e)}},{isMultiCallback:!0,timeout:!1})}))]}))}));function mu(e){return vu.apply(this,arguments)}function vu(){return(vu=V((function(e){return Q(this,(function(t){return[2,ui("getLocation",[],[e],V((function(){return Q(this,(function(e){switch(e.label){case 0:return En.isMp?[4,hu()]:[3,2];case 1:return[2,e.sent()];case 2:return En.isMpWeb?[2,Promise.resolve({longitude:"105.788026",latitude:"21.0258773",timestamp:(new Date).getTime().toString(),provider:"fused"})]:[2,Promise.reject(Pn("getLocation",{}))]}}))})))]}))}))).apply(this,arguments)}var yu=[yn.function().args(Ct({data:yn.any()})).returns(yn.void())];function gu(t){return ui("onCallbackData",yu,[t],(function(){!function(t){Er.getInstance().on(e.Events.OnDataCallback,(function(e){t({data:e})}))}(t)}))}var _u=function(){var e=V((function(e){var t,n,r,o,a,s,u,c,l,p,d;return Q(this,(function(f){switch(f.label){case 0:return n="",e||(e=ms()),"object"==typeof e&&((n=e.zmpOrderId||"")||(t=e.appTransID||e.orderId||e.apptransid)),"string"==typeof e&&(r=Ar.getParameterByName("orderId",e),o=Ar.getParameterByName("appTransID",e)||Ar.getParameterByName("apptransid",e),t=r||o),a={headers:{authorization:"Bearer "}},[4,$r.getAccessToken().catch((function(){throw Kr.error.loginRequired}))];case 1:return s=f.sent(),a.headers.authorization="Bearer ".concat(s),u=new URL(U),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 Kr.error.badRequest(l.msg);return p=l.data||{},d={err:l.err},0!==Object.keys(p).length&&p.constructor===Object&&Object.assign(d,{msg:p.resultMessage,orderId:p.orderId,resultCode:p.resultCode,transTime:p.transTime,createdAt:p.createAt,transId:p.transId,method:p.method,isCustom:p.isCustom,path:p.path}),[2,d]}}))}));return function(t){return e.apply(this,arguments)}}(),bu=function(){var t=V((function(t,n,r,o,a,s,u){var c,l,p,d,f,h,m,v,y,g,_,b,w,T,E;return Q(this,(function(S){switch(S.label){case 0:c=i,(l=new URLSearchParams).append("amount",t.toString()),l.append("item",encodeURIComponent(JSON.stringify(n))),l.append("appId",c),r&&l.append("desc",encodeURIComponent(r)),o&&(p=o,"object"==typeof o&&(p=JSON.stringify(o)),l.append("extradata",encodeURIComponent(p))),a&&(d=a,"object"==typeof a&&(d=JSON.stringify(a)),l.append("payload",encodeURIComponent(d))),s&&("string"==typeof s?(l.append("method",s),l.append("isCustom","false")):"object"==typeof s&&(l.append("method",s.id),l.append("isCustom",JSON.stringify(s.isCustom)))),u&&l.append("mac",u),f={headers:{"Content-Type":"application/x-www-form-urlencoded",authorization:"Bearer "}},S.label=1;case 1:return S.trys.push([1,6,,7]),[4,$r.getAccessToken().catch((function(){throw Kr.error.loginRequired}))];case 2:return h=S.sent(),f.headers.authorization="Bearer ".concat(h),[4,fetch(j,Ko(On({method:"POST"},f),{body:l}))];case 3:return[4,S.sent().json()];case 4:if(!(m=S.sent()).data||0!==m.err)throw Kr.error.badRequest(m.msg);return v=m.data.id,y=m.data.jwt,g=window.APP_VERSION,_=window.APP_ENV,b={miniAppId:c,orderId:v},y&&(b.token=y),g&&(b.version=g),_&&(b.env=_),s&&("string"==typeof s?(b.method=s,b.isCustom=!1):"object"==typeof s&&(b.method=s.id,b.isCustom=s.isCustom)),w=Ar.encode(b),T=new URL("?".concat(w),"https://payment-mini.zalo.me").toString(),[4,ps(T).then((function(){var t=!1;Er.getInstance().once(e.Events.WebviewClosed,(function(){setTimeout(V((function(){var n;return Q(this,(function(r){switch(r.label){case 0:return t?[3,2]:(console.log("orderId",v),[4,_u({zmpOrderId:v})]);case 1:(n=r.sent()).err>=0&&!n.isCustom&&Er.getInstance().emit(e.Events.PaymentClose,n.err,Ko(On({},n),{zmpOrderId:v})),r.label=2;case 2:return[2]}}))})),500)})),Er.getInstance().once(e.Events.OpenApp,(function(){t=!0}))}))];case 5:return S.sent(),[2,{orderId:v}];case 6:throw E=S.sent(),console.log("Internal error"),E;case 7:return[2]}}))}));return function(e,n,r,i,o,a,s){return t.apply(this,arguments)}}(),wu=[Ct({amount:yn.union([yt(),gt()]),item:yn.array(yn.record(yt(),yn.any())),desc:yt(),extradata:yn.any().optional(),payload:yn.any().optional(),method:yn.union([yn.string(),yn.object({id:yn.string(),isCustom:yn.boolean()})]).optional(),mac:yn.string().optional()})];function Tu(e){return Eu.apply(this,arguments)}function Eu(){return Eu=V((function(e){return Q(this,(function(t){return[2,ui("createOrder",wu,[e],function(){var e=V((function(e){return Q(this,(function(t){switch(t.label){case 0:return En.isMp?[4,bu(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 En.isMpWeb?[2,Promise.resolve({orderId:""})]:[2,Promise.reject(Pn("createOrder",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Eu.apply(this,arguments)}var Su=function(){var e=V((function(e){return Q(this,(function(t){return[2,new Promise((function(t,n){Vr("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)}}(),Pu=[Ct({method:yt().optional()}).optional()];function Au(e){return Ou.apply(this,arguments)}function Ou(){return Ou=V((function(e){return Q(this,(function(t){return[2,ui("selectPaymentMethod",Pu,[e],function(){var e=V((function(e){var t;return Q(this,(function(n){switch(n.label){case 0:return En.isMp?(t=e.method,[4,Su(t)]):[3,2];case 1:return[2,n.sent()];case 2:return En.isMpWeb?[2,Promise.resolve({method:""})]:[2,Promise.reject(Pn("selectPaymentMethod",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Ou.apply(this,arguments)}var ku=[Ct({data:yn.union([yt(),yn.record(yt(),yt())])})];function Iu(e){return Nu.apply(this,arguments)}function Nu(){return Nu=V((function(e){return Q(this,(function(t){return[2,ui("checkTransaction",ku,[e],function(){var e=V((function(e){return Q(this,(function(t){switch(t.label){case 0:return En.isMp?[4,_u(e.data)]:[3,2];case 1:return[2,t.sent()];case 2:return En.isMpWeb?[2,Promise.resolve({msg:"Success",orderId:"",resultCode:1,transTime:(new Date).getTime().toString(),createdAt:(new Date).getTime().toString(),transId:""})]:[2,Promise.reject(Pn("checkTransaction",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Nu.apply(this,arguments)}var Cu=[Ct({hide:wt().default(!1).optional()}).optional()];function Mu(e){return xu.apply(this,arguments)}function xu(){return xu=V((function(e){return Q(this,(function(t){return[2,ui("setAndroidBottomNavigationBar",Cu,[e],function(){var e=V((function(e){return Q(this,(function(t){switch(t.label){case 0:return En.isMp?[4,gi.setAndroidBottomNavigationBar(e.hide)]:[3,2];case 1:return[2,t.sent()];case 2:return En.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Pn("setAndroidBottomNavigationBar",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),xu.apply(this,arguments)}var Ru=[Ct({hide:wt().default(!1).optional()}).optional()];function ju(e){return Du.apply(this,arguments)}function Du(){return Du=V((function(e){return Q(this,(function(t){return[2,ui("setIOSBottomSafeArea",Ru,[e],function(){var e=V((function(e){return Q(this,(function(t){switch(t.label){case 0:return En.isMp?[4,gi.setIOSBottomSafeArea(e.hide)]:[3,2];case 1:return[2,t.sent()];case 2:return En.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Pn("setIOSBottomSafeArea",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Du.apply(this,arguments)}var Uu=[Ct({type:yn.enum(["normal","hidden","transparent"]).default("normal").optional(),color:yn.string().optional()}).optional()];function Bu(e){return Zu.apply(this,arguments)}function Zu(){return Zu=V((function(e){return Q(this,(function(t){return[2,ui("setStatusBar",Uu,[e],function(){var e=V((function(e){return Q(this,(function(t){switch(t.label){case 0:return En.isMp?[4,gi.configHeader({statusBarType:e.type,headerColor:e.color})]:[3,2];case 1:return[2,t.sent()];case 2:return En.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Pn("setStatusBar",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Zu.apply(this,arguments)}var Lu=[Ct({headerTextColor:yn.enum(["black","white"]).optional(),headerColor:yn.string().optional(),actionBar:Ct({hide:yn.boolean().optional(),title:yn.string().optional(),leftButton:yn.enum(["back","none"]).optional(),textAlign:yn.enum(["left","center"]).default("left").optional()}).optional(),statusBarType:yn.enum(["normal","hidden","transparent"]).optional(),hideAndroidBottomNavigationBar:yn.boolean().optional(),hideIOSSafeAreaBottom:yn.boolean().optional()})];function zu(e){return Wu.apply(this,arguments)}function Wu(){return Wu=V((function(e){return Q(this,(function(t){return[2,ui("configAppView",Lu,[e],function(){var e=V((function(e){var t,n,r,i,o,a,s;return Q(this,(function(u){switch(u.label){case 0:return En.isMp?lr.isUndefined(null===(t=e.actionBar)||void 0===t?void 0:t.leftButton)?[3,2]:[4,gi.setNavigationBarLeftButton(null===(a=e.actionBar)||void 0===a?void 0:a.leftButton)]:[3,13];case 1:u.sent(),u.label=2;case 2:return lr.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,gi.setNavigationBarTitle(null===(s=e.actionBar)||void 0===s?void 0:s.title)];case 3:u.sent(),u.label=4;case 4:return[4,gi.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,gi.setAndroidBottomNavigationBar(e.hideAndroidBottomNavigationBar)];case 7:u.sent(),u.label=8;case 8:return"boolean"!=typeof e.hideIOSSafeAreaBottom?[3,10]:[4,gi.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 En.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Pn("configAppView",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Wu.apply(this,arguments)}var Gu=function(){var t=V((function(t,n,r,o,a,s){var u,c,l,p,d,f,h,m,v,y,g,_,b,w;return Q(this,(function(T){switch(T.label){case 0:d=i,(f=new URLSearchParams).append("payType",n||e.IAPPayType.SUBSCRIPTION),h=e.ProrationMode.UNKNOW,r===Z&&(h=e.ProrationMode.IMMEDIATE_AND_CHARGE_FULL_PRICE),r===B&&(h=e.ProrationMode.DEFERRED),f.append("utm",a||"default"),f.append("merchantTransId",s||""),f.append("prorationMode",h.toString()),f.append("appId",d),o&&f.append("method",o),m="",(null===(u=Tn())||void 0===u||null===(c=u.platform)||void 0===c?void 0:c.isIOS)?m="ios":(null===(l=Tn())||void 0===l||null===(p=l.platform)||void 0===p?void 0:p.isAndroid)&&(m="android"),f.append("os",m),f.append("productId",t),v={headers:{"Content-Type":"application/x-www-form-urlencoded",authorization:"Bearer "}},T.label=1;case 1:return T.trys.push([1,5,,6]),[4,$r.getAccessToken().catch((function(){throw Kr.error.loginRequired}))];case 2:return y=T.sent(),v.headers.authorization="Bearer ".concat(y),[4,fetch(D,Ko(On({method:"POST"},v),{body:f}))];case 3:return[4,T.sent().json()];case 4:if(!(g=T.sent()).data||!g.data.store||0!==g.err)throw Kr.error.createIAPOrderFailed(g.err);return _=g.data.store,b=g.data.orderId,[2,new Promise((function(e,t){Vr("IAP_REQUESTPAYMENT",On({},_),{success:function(){e({orderId:b})},fail:function(e){t(e)}})}))];case 5:throw w=T.sent(),console.log("Internal error"),w;case 6:return[2]}}))}));return function(e,n,r,i,o,a){return t.apply(this,arguments)}}(),Fu=[Ct({productId:yt(),payType:yn.enum(["ONETIME","SUBSCRIPTION"]).optional(),prorationMode:yn.enum(["DEFERRED","IMMEDIATE_AND_CHARGE_FULL_PRICE"]).default("DEFERRED").optional(),utm:yt().optional(),method:yn.enum(["IAP","IAP_SANDBOX"]).optional(),merchantTransId:yt().optional()})];function Hu(e){return Ku.apply(this,arguments)}function Ku(){return Ku=V((function(e){return Q(this,(function(t){return[2,ui("createOrderIAP",Fu,[e],function(){var e=V((function(e){return Q(this,(function(t){switch(t.label){case 0:return En.isMp?[4,Gu(e.productId,e.payType,e.prorationMode,e.method,e.utm,e.merchantTransId)]:[3,2];case 1:return[2,t.sent()];case 2:return En.isMpWeb?[2,Promise.resolve({orderId:""})]:[2,Promise.reject(Pn("createOrderIAP",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Ku.apply(this,arguments)}var Vu=V((function(){return Q(this,(function(e){return[2,new Promise((function(e,t){Vr("MA_MENU_MINIMIZE",{},{success:function(t){e(t)},fail:function(e){t(e)}},{})}))]}))}));function Ju(e){return qu.apply(this,arguments)}function qu(){return(qu=V((function(e){return Q(this,(function(t){return[2,ui("minimizeApp",[],[e],V((function(){return Q(this,(function(e){switch(e.label){case 0:return En.isMp?[4,Vu()]:[3,2];case 1:return[2,e.sent()];case 2:return En.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Pn("minimizeApp",{}))]}}))})))]}))}))).apply(this,arguments)}var $u=V((function(){return Q(this,(function(e){return[2,new Promise((function(e,t){Vr("MA_MENU_PERMISSION",{},{success:function(t){e(t)},fail:function(e){t(e)}},{}),e()}))]}))}));function Yu(e){return Qu.apply(this,arguments)}function Qu(){return(Qu=V((function(e){return Q(this,(function(t){return[2,ui("openPermissionSetting",[],[e],V((function(){return Q(this,(function(e){switch(e.label){case 0:return En.isMp?[4,$u()]:[3,2];case 1:return[2,e.sent()];case 2:return En.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Pn("openPermissionSetting",{}))]}}))})))]}))}))).apply(this,arguments)}var Xu=V((function(){return Q(this,(function(e){return[2,new Promise((function(e,t){Vr("MP_ADD_MYFAVORITES",{timestamp:(new Date).getTime()},{success:function(t){e(t)},fail:function(e){t(e)}},{})}))]}))}));function ec(e){return tc.apply(this,arguments)}function tc(){return(tc=V((function(e){return Q(this,(function(t){return[2,ui("favoriteApp",[],[e],V((function(){return Q(this,(function(e){switch(e.label){case 0:return En.isMp?[4,Xu()]:[3,2];case 1:return[2,e.sent()];case 2:return En.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Pn("favoriteApp",{}))]}}))})))]}))}))).apply(this,arguments)}var nc=V((function(){return Q(this,(function(e){return[2,new Promise((function(e,t){Vr("OPEN_GROUPLIST",{},{success:function(t){e(t)},fail:function(e){t(e)}},{})}))]}))}));function rc(e){return ic.apply(this,arguments)}function ic(){return(ic=V((function(e){return Q(this,(function(t){return[2,ui("openGroupList",[],[e],V((function(){return Q(this,(function(e){switch(e.label){case 0:return En.isMp?[4,nc()]:[3,2];case 1:return[2,e.sent()];case 2:return En.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Pn("openGroupList",{}))]}}))})))]}))}))).apply(this,arguments)}var oc=V((function(){var e;return Q(this,(function(t){switch(t.label){case 0:return[4,$r.getAccessToken()];case 1:return e=t.sent(),[2,new Promise((function(t,n){Vr("MP_SEND_NOTIFICATION",{accessToken:e},{success:function(e){t(e)},fail:function(e){n(e)}},{delay:500})}))]}}))}));function ac(e){return sc.apply(this,arguments)}function sc(){return(sc=V((function(e){return Q(this,(function(t){return[2,ui("requestSendNotification",[],[e],V((function(){return Q(this,(function(e){switch(e.label){case 0:return En.isMp?[4,oc()]:[3,2];case 1:return[2,e.sent()];case 2:return En.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Pn("requestSendNotification",{}))]}}))})))]}))}))).apply(this,arguments)}var uc=V((function(){return Q(this,(function(e){return[2,new Promise((function(e,t){Vr("MP_ADD_RATING",{},{success:function(t){e(t)},fail:function(e){t(e)}},{})}))]}))}));function cc(e){return lc.apply(this,arguments)}function lc(){return(lc=V((function(e){return Q(this,(function(t){return[2,ui("addRating",[],[e],V((function(){return Q(this,(function(e){switch(e.label){case 0:return En.isMp?[4,uc()]:[3,2];case 1:return[2,e.sent()];case 2:return En.isMpWeb?[2,Promise.resolve({})]:[2,Promise.reject(Pn("addRating",{}))]}}))})))]}))}))).apply(this,arguments)}var pc,dc=(pc=V((function(e,t,n){var r,i;return Q(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,On({method:"POST",body:r},i))];case 1:return[4,o.sent().json()];case 2:return[2,o.sent()]}}))})),function(e,t,n){return pc.apply(this,arguments)}),fc=function(){var e=V((function(e){return Q(this,(function(t){return[2,new Promise((function(t,n){Vr("MP_INTERACT_OA",{oaId:e,forceUpdate:!0},{success:function(e){t(e)},fail:function(e){n(e)}},{})}))]}))}));return function(t){return e.apply(this,arguments)}}(),hc=[Ct({oaId:yt()})];function mc(e){return vc.apply(this,arguments)}function vc(){return vc=V((function(e){return Q(this,(function(t){return[2,ui("interactOA",hc,[e],function(){var e=V((function(e){var t,n,r;return Q(this,(function(o){switch(o.label){case 0:return En.isMp?(t=e.oaId,[4,$r.getAccessToken()]):[3,5];case 1:return!(n=o.sent())||lr.isEmpty(n)?[3,3]:[4,dc(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,fc(t)];case 4:return[2,o.sent()];case 5:return En.isMpWeb?[2,Promise.resolve({})]:[2,Promise.reject(Pn("interactOA",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),vc.apply(this,arguments)}var yc=[Ct({oaId:yt()})];function gc(e){return _c.apply(this,arguments)}function _c(){return _c=V((function(e){return Q(this,(function(t){return[2,ui("isAllowedInteractWithOA",yc,[e],function(){var e=V((function(e){var t,n,r;return Q(this,(function(o){switch(o.label){case 0:return En.isMp?(t=e.oaId,[4,$r.getAccessToken()]):[3,4];case 1:return!(n=o.sent())||lr.isEmpty(n)?[3,3]:[4,dc(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 En.isMpWeb?[2,Promise.resolve({status:!1})]:[2,Promise.reject(Pn("IsAllowedInteractWithOA",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),_c.apply(this,arguments)}function bc(e){return wc.apply(this,arguments)}function wc(){return(wc=V((function(e){return Q(this,(function(t){return[2,ui("getSetting",[],[e],V((function(){return Q(this,(function(e){switch(e.label){case 0:return En.isMp?[4,Fr()]:[3,2];case 1:return[2,e.sent()];case 2:return En.isMpWeb?[2,Promise.resolve({authSetting:{}})]:[2,Promise.reject(Pn("getSetting",{}))]}}))})))]}))}))).apply(this,arguments)}var Tc=yn.enum(["scope.userInfo","scope.userLocation","scope.userPhonenumber"]),Ec=[Ct({scopes:yn.array(Tc).max(2).optional()}).optional()];function Sc(e){return Pc.apply(this,arguments)}function Pc(){return Pc=V((function(e){return Q(this,(function(t){return[2,ui("authorize",Ec,[e],function(){var e=V((function(e){var t,n,r,i;return Q(this,(function(o){switch(o.label){case 0:return En.isMp?(n=null==e?void 0:e.scopes,r=Ur(),("android"===(i=((null===(t=Tn())||void 0===t?void 0:t.platformName)||"").toLowerCase())&&r<724||"ios"===i&&r<573)&&n&&n.length>0?[2,Promise.reject(Kr.error.clientNotSupport())]:[4,Jr(null!=n?n:void 0)]):[3,2];case 1:return[2,o.sent()];case 2:return En.isMpWeb?[2,Promise.resolve({})]:[2,Promise.reject(Pn("authorize",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Pc.apply(this,arguments)}var Ac=V((function(){return Q(this,(function(e){return[2,new Promise(function(){var e=V((function(e,t){var n;return Q(this,(function(r){switch(r.label){case 0:return lr.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(Kr.error.clientNotSupport()),[2]}}))}));return function(t,n){return e.apply(this,arguments)}}())]}))}));function Oc(e){return ui("checkZaloCameraPermission",[],[e],V((function(){return Q(this,(function(e){switch(e.label){case 0:return[4,Ac()];case 1:return[2,e.sent()]}}))})))}var kc=V((function(){return Q(this,(function(e){return[2,new Promise(function(){var e=V((function(e,t){var n,r,i;return Q(this,(function(o){switch(o.label){case 0:return o.trys.push([0,2,,3]),[4,$r.jumpAndGetToken()];case 1:return o.sent(),r=null===(n=$r.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 Ic(e){return Nc.apply(this,arguments)}function Nc(){return(Nc=V((function(e){return Q(this,(function(t){return[2,ui("getUserID",[],[e],V((function(){return Q(this,(function(e){switch(e.label){case 0:return En.isMp?[4,kc()]:[3,2];case 1:return[2,e.sent()];case 2:return En.isMpWeb?[2,Promise.resolve(void 0)]:[2,Promise.reject(Pn("getUserID",{}))]}}))})))]}))}))).apply(this,arguments)}var Cc=V((function(){return Q(this,(function(e){return[2,new Promise(function(){var e=V((function(e,t){var n,r,i;return Q(this,(function(o){switch(o.label){case 0:return o.trys.push([0,2,,3]),[4,$r.jumpAndGetToken()];case 1:return o.sent(),r=null===(n=$r.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 Mc(e){return xc.apply(this,arguments)}function xc(){return(xc=V((function(e){return Q(this,(function(t){return[2,ui("getIDToken",[],[e],V((function(){return Q(this,(function(e){switch(e.label){case 0:return En.isMp?[4,Cc()]:[3,2];case 1:return[2,e.sent()];case 2:return En.isMpWeb?[2,Promise.resolve(void 0)]:[2,Promise.reject(Pn("getIDToken",{}))]}}))})))]}))}))).apply(this,arguments)}var Rc=function(){function e(){var t,n;pr(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=Y(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;lr.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?lr.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?lr.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 Dc.apply(this,arguments)}function Dc(){return(Dc=V((function(e){return Q(this,(function(t){return[2,ui("setupAd",[],[e],(function(){return Rc.getInstance().loadSDK()}))]}))}))).apply(this,arguments)}var Uc=[Ct({ids:yn.union([yn.string(),yn.array(yn.string())]),config:Ct({display:yn.boolean().optional(),onClose:yn.function().optional()}).optional()})];function Bc(e){return Zc.apply(this,arguments)}function Zc(){return Zc=V((function(e){return Q(this,(function(t){return[2,ui("loadAd",Uc,[e],function(){var e=V((function(e){return Q(this,(function(t){return Rc.getInstance().load(e.ids,e.config),[2]}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Zc.apply(this,arguments)}var Lc=[Ct({id:yn.string()})];function zc(e){return Wc.apply(this,arguments)}function Wc(){return Wc=V((function(e){return Q(this,(function(t){return[2,ui("displayAd",Lc,[e],function(){var e=V((function(e){return Q(this,(function(t){return Rc.getInstance().display(e.id),[2]}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Wc.apply(this,arguments)}var Gc=[Ct({id:yn.string().optional()}).optional()];function Fc(e){return Hc.apply(this,arguments)}function Hc(){return Hc=V((function(e){return Q(this,(function(t){return[2,ui("refreshAd",Gc,[e],function(){var e=V((function(e){return Q(this,(function(t){return Rc.getInstance().refresh(e.id),[2]}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Hc.apply(this,arguments)}window.ZaloMiniAppSDK={getVersion:hi},ci();var Kc=Object.freeze({__proto__:null,get Events(){return e.Events},get EventName(){return e.Events},login:ci,getAccessToken:pi,getVersion:hi,getSystemInfo:vi,setNavigationBarTitle:bi,setNavigationBarColor:Ei,setNavigationBarLeftButton:Ai,setStorage:Qi,getStorage:to,getStorageInfo:ro,removeStorage:ao,clearStorage:co,getUserInfo:ho,getNetworkType:go,onNetworkStatusChange:wo,startBeaconDiscovery:So,stopBeaconDiscovery:Oo,getBeacons:No,closeApp:xo,scanQRCode:Do,openProfile:Lo,openChat:Fo,openPostFeed:qo,followOA:Xo,unfollowOA:ra,openShareSheet:ua,requestCameraPermission:pa,createShortcut:ya,openBioAuthentication:wa,checkStateBioAuthentication:Sa,showToast:ka,hideKeyboard:Ca,openPhone:ja,openSMS:Za,viewOAQr:Ga,keepScreen:Va,onKeepScreen:qa,offKeepScreen:Ya,saveImageToGallery:ts,openMiniApp:os,vibrate:cs,openWebview:fs,getRouteParams:vs,getAppInfo:ys,sendDataToPreviousMiniApp:ws,getPhoneNumber:Ss,openProfilePicker:ks,connectWifi:Ms,openMediaPicker:Ds,getShareableLink:Zs,closeLoading:Ws,requestUpdateZalo:Fs,onConfirmToExit:Js,offConfirmToExit:qs,getDeviceId:$s,getDeviceIdAsync:Ys,getContext:Xs,getContextAsync:eu,getAuthCode:nu,getZPIToken:iu,setAccessToken:su,openOutApp:cu,chooseImage:du,getLocation:mu,onCallbackData:gu,createOrder:Tu,selectPaymentMethod:Au,checkTransaction:Iu,events:Ks,setAndroidBottomNavigationBar:Mu,setIOSBottomSafeArea:ju,setStatusBar:Bu,configAppView:zu,createOrderIAP:Hu,minimizeApp:Ju,openPermissionSetting:Yu,favoriteApp:ec,openGroupList:rc,requestSendNotification:ac,addRating:cc,interactOA:mc,interactOa:mc,isAllowedInteractWithOA:gc,getSetting:bc,authorize:Sc,checkZaloCameraPermission:Oc,getUserID:Ic,getIDToken:Mc,setupAd:jc,loadAd:Bc,displayAd:zc,refreshAd:Fc}),Vc=Tu,Jc=Iu,qc=Hu,$c=Au,Yc=function(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}(Kc,["createOrder","checkTransaction","createOrderIAP","selectPaymentMethod"]),Qc={createOrder:Vc,checkTransaction:Jc,createOrderIAP:qc,selectPaymentMethod:$c};!function(){var e,t=null===(e=Tn())||void 0===e?void 0:e.appEnv;(null==t?void 0:t.isMp)&&(window.ZaloMiniAppSDK={},Object.assign(window.ZaloMiniAppSDK,Kc))}(),e.EventName=e.Events,e.Payment=Qc,e.addRating=cc,e.authorize=Sc,e.checkStateBioAuthentication=Sa,e.checkTransaction=Iu,e.checkZaloCameraPermission=Oc,e.chooseImage=du,e.clearStorage=co,e.closeApp=xo,e.closeLoading=Ws,e.configAppView=zu,e.connectWifi=Ms,e.createOrder=Tu,e.createOrderIAP=Hu,e.createShortcut=ya,e.default=Yc,e.displayAd=zc,e.events=Ks,e.favoriteApp=ec,e.followOA=Xo,e.getAccessToken=pi,e.getAppInfo=ys,e.getAuthCode=nu,e.getBeacons=No,e.getContext=Xs,e.getContextAsync=eu,e.getDeviceId=$s,e.getDeviceIdAsync=Ys,e.getIDToken=Mc,e.getLocation=mu,e.getNetworkType=go,e.getPhoneNumber=Ss,e.getRouteParams=vs,e.getSetting=bc,e.getShareableLink=Zs,e.getStorage=to,e.getStorageInfo=ro,e.getSystemInfo=vi,e.getUserID=Ic,e.getUserInfo=ho,e.getVersion=hi,e.getZPIToken=iu,e.hideKeyboard=Ca,e.interactOA=mc,e.interactOa=mc,e.isAllowedInteractWithOA=gc,e.keepScreen=Va,e.loadAd=Bc,e.login=ci,e.minimizeApp=Ju,e.offConfirmToExit=qs,e.offKeepScreen=Ya,e.onCallbackData=gu,e.onConfirmToExit=Js,e.onKeepScreen=qa,e.onNetworkStatusChange=wo,e.openBioAuthentication=wa,e.openChat=Fo,e.openGroupList=rc,e.openMediaPicker=Ds,e.openMiniApp=os,e.openOutApp=cu,e.openPermissionSetting=Yu,e.openPhone=ja,e.openPostFeed=qo,e.openProfile=Lo,e.openProfilePicker=ks,e.openSMS=Za,e.openShareSheet=ua,e.openWebview=fs,e.refreshAd=Fc,e.removeStorage=ao,e.requestCameraPermission=pa,e.requestSendNotification=ac,e.requestUpdateZalo=Fs,e.saveImageToGallery=ts,e.scanQRCode=Do,e.selectPaymentMethod=Au,e.sendDataToPreviousMiniApp=ws,e.setAccessToken=su,e.setAndroidBottomNavigationBar=Mu,e.setIOSBottomSafeArea=ju,e.setNavigationBarColor=Ei,e.setNavigationBarLeftButton=Ai,e.setNavigationBarTitle=bi,e.setStatusBar=Bu,e.setStorage=Qi,e.setupAd=jc,e.showToast=ka,e.startBeaconDiscovery=So,e.stopBeaconDiscovery=Oo,e.unfollowOA=ra,e.vibrate=cs,e.viewOAQr=Ga,Object.defineProperty(e,"__esModule",{value:!0})}));