zmp-sdk 2.38.2 → 2.39.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index.umd.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @timeBuild 11-06-2024 15:29:20
2
+ * @timeBuild 14-06-2024 13:40:52
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",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: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: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: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},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 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,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 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 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,...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!==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,...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:Ae.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=Ae.create,gt=ke.create,_t=lt.create,wt=Ie.create,bt=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:be,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:be,ZodSchema:be,late:mt,get ZodFirstPartyTypeKind(){return vt},coerce:Yt,any:At,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:Pt,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: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,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 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 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=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",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";function t(e,t){if(null==e)return{};var n,r,i=function(e,t){if(null==e)return{};var n,r,i={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}var n,r=1048576,i=window.zAppID,o=window.APP_ID,a="https://zalo.me/s",s="https://h5.zdn.vn/zapps",u="h5.zdn.vn",c="/zapps",l={ZOAUTH:"h5.zdn.vn_zoauth",ZACC_SESSION:"h5.zdn.vn_zacc_session",JS_TOKEN:"h5.zdn.vn_zlink3rd",ZOAUTH_VRF:"h5.zdn.vn_zoauth_vrf",DEVICE_ID:"h5.zdn.vn_deviceID",CONTEXT_ID:"h5.zdn.vn_contextID",CONTEXT_TYPE:"h5.zdn.vn_contextType",UTOKEN_ZPI:"h5.zdn.vn_utoken_zpi",GTOKEN_ZPI:"h5.zdn.vn_gtoken_zpi",ZPP_ZPI:"h5.zdn.vn_zpp_zpi",ZPT_ZPI:"h5.zdn.vn_zpt_zpi"},d={GET_USER_INFO:"https://graph.zalo.me/v2.0/me",GET_ACCESS_TOKEN:"https://h5.zalo.me/openapi/access_token",GET_ACCESS_TOKEN_V3:"https://oauth.zaloapp.com/v3/access_token",GET_LIST_USER_INFO:"https://graph.zalo.me/v2.0/me/friends/list",CREATE_ORDER:"https://payment-mini.zalo.me/api/order/create",GET_APP_INFO:"https://h5.zalo.me/apps/get-info",SEND_ACTION_LOG:"https://h5.zalo.me/log/async",CREATE_SHARE_LINK:"https://h5.zalo.me/openapi/create-sharelink",CHECK_INTERACT_OA:"https://h5.zalo.me/openapi/check-interact-oa",GET_AUTH_SETTING:"https://h5.zalo.me/apis/users/auth-settings"};!function(e){e.REQUEST="REQUEST",e.MODIFIED_REQUEST="MODIFIED_REQUEST",e.RESPONSE="RESPONSE",e.MODIFIED_RESPONSE="MODIFIED_RESPONSE",e.NOT_FOUND="NOT_FOUND"}(n||(n={}));var p,f=0,h=-2e3,m=-1400,v=-1500,y=-1401,g=-1404,_=-1408,w=-2004,b=-2005,T="Success",E="Unknown error. Please try again later.",S="Request timeout. Please try again later.",P="Please login (https://miniapp.zalo.me/docs/api/login) before to call this api",O="Login failed",A="This API is not supported in this version of Zalo",k="User Authentication Required. Please grant User Authentication permission before requesting User Permission",I="Unable to pick media",C="Unable to save image",N={SUCCESS:{code:f,message:T},UNKNOWN_ERROR:{code:h,message:E},UNAUTHORIZED:{code:y,message:P},FORBIDDEN:{code:-1403,message:"You don't have permission to call this api"},CLIENT_NOT_SUPPORT:{code:g,message:A},DECODE_FAILED:{code:-2001,message:"Can not decode id. Please check your params again."},TIME_OUT:{code:_,message:S},USER_DENIED:{code:-2002,message:"User denied"},USER_CANCEL:{code:-2003,message:"User cancel"}},M={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:C},needMoreDetail:!0},"-102":{mapTo:{code:b,message:C},needMoreDetail:!0}},iOS:{"-10":{mapTo:{code:b,message:C},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:w,message:I},needMoreDetail:!0}},iOS:{"-10":{mapTo:{code:w,message:I}}}}},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}},x={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}},R={android:12100615,iOS:460,wp:0,unknown:0},D=5*r,j="https://payment-mini.zalo.me/api/order/create",U="https://payment-mini.zalo.me/api/order/iap-create",B="https://payment-mini.zalo.me/api/transaction",L="DEFERRED",Z="IMMEDIATE_AND_CHARGE_FULL_PRICE",z={SHOW_BACK:0,HIDE_BACK:3,SHOW_HOME:1,HIDE_HOME:0},W=5,F=6,G="#1843EF",H=0,V={"-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 J(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 q(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 $(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function Q(e,t){if(e){if("string"==typeof e)return q(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)?q(e,t):void 0}}function Y(e){return function(e){if(Array.isArray(e))return q(e)}(e)||$(e)||Q(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 X(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 ee(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}}}ee.async=function(e){return J((function(){var t,n,r,i,o=arguments;return X(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 te=p.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),ne=e=>{switch(typeof e){case"undefined":return te.undefined;case"string":return te.string;case"number":return isNaN(e)?te.nan:te.number;case"boolean":return te.boolean;case"function":return te.function;case"bigint":return te.bigint;case"symbol":return te.symbol;case"object":return Array.isArray(e)?te.array:null===e?te.null:e.then&&"function"==typeof e.then&&e.catch&&"function"==typeof e.catch?te.promise:"undefined"!=typeof Map&&e instanceof Map?te.map:"undefined"!=typeof Set&&e instanceof Set?te.set:"undefined"!=typeof Date&&e instanceof Date?te.date:te.object;default:return te.unknown}},re=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 ie 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()}}ie.create=e=>new ie(e);const oe=(e,t)=>{let n;switch(e.code){case re.invalid_type:n=e.received===te.undefined?"Required":`Expected ${e.expected}, received ${e.received}`;break;case re.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(e.expected,p.jsonStringifyReplacer)}`;break;case re.unrecognized_keys:n=`Unrecognized key(s) in object: ${p.joinValues(e.keys,", ")}`;break;case re.invalid_union:n="Invalid input";break;case re.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${p.joinValues(e.options)}`;break;case re.invalid_enum_value:n=`Invalid enum value. Expected ${p.joinValues(e.options)}, received '${e.received}'`;break;case re.invalid_arguments:n="Invalid function arguments";break;case re.invalid_return_type:n="Invalid function return type";break;case re.invalid_date:n="Invalid date";break;case re.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 re.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 re.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 re.custom:n="Invalid input";break;case re.invalid_intersection_types:n="Intersection results could not be merged";break;case re.not_multiple_of:n=`Number must be a multiple of ${e.multipleOf}`;break;case re.not_finite:n="Number must be finite";break;default:n=t.defaultError,p.assertNever(e)}return{message:n}};let ae=oe;function se(){return ae}const ue=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 ce(e,t){const n=ue({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,se(),oe].filter((e=>!!e))});e.common.issues.push(n)}class le{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 de;"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 le.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 de;if("aborted"===i.status)return de;"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 de=Object.freeze({status:"aborted"}),pe=e=>({status:"dirty",value:e}),fe=e=>({status:"valid",value:e}),he=e=>"aborted"===e.status,me=e=>"dirty"===e.status,ve=e=>"valid"===e.status,ye=e=>"undefined"!=typeof Promise&&e instanceof Promise;var ge;!function(e){e.errToObj=e=>"string"==typeof e?{message:e}:e||{},e.toString=e=>"string"==typeof e?e:null==e?void 0:e.message}(ge||(ge={}));class _e{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 we=(e,t)=>{if(ve(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 ie(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 Te{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 ne(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:ne(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new le,ctx:{common:e.parent.common,data:e.data,parsedType:ne(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const t=this._parse(e);if(ye(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:ne(e)},i=this._parseSync({data:e,path:r.path,parent:r});return we(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:ne(e)},r=this._parse({data:e,path:n.path,parent:n}),i=await(ye(r)?r:Promise.resolve(r));return we(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:re.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 at({schema:this,typeName:yt.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}optional(){return st.create(this,this._def)}nullable(){return ut.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Ze.create(this,this._def)}promise(){return ot.create(this,this._def)}or(e){return Ge.create([this,e],this._def)}and(e){return Je.create(this,e,this._def)}transform(e){return new at({...be(this._def),schema:this,typeName:yt.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const t="function"==typeof e?e:()=>e;return new ct({...be(this._def),innerType:this,defaultValue:t,typeName:yt.ZodDefault})}brand(){return new ft({typeName:yt.ZodBranded,type:this,...be(this._def)})}catch(e){const t="function"==typeof e?e:()=>e;return new lt({...be(this._def),innerType:this,catchValue:t,typeName:yt.ZodCatch})}describe(e){return new(0,this.constructor)({...this._def,description:e})}pipe(e){return ht.create(this,e)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const Ee=/^c[^\s-]{8,}$/i,Se=/^[a-z][a-z0-9]*$/,Pe=/^([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,Oe=/^(([^<>()[\]\\.,;:\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 Te{constructor(){super(...arguments),this._regex=(e,t,n)=>this.refinement((t=>e.test(t)),{validation:t,code:re.invalid_string,...ge.errToObj(n)}),this.nonempty=e=>this.min(1,ge.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)!==te.string){const t=this._getOrReturnCtx(e);return ce(t,{code:re.invalid_type,expected:te.string,received:t.parsedType}),de}const t=new le;let n;for(const i of this._def.checks)if("min"===i.kind)e.data.length<i.value&&(n=this._getOrReturnCtx(e,n),ce(n,{code:re.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),ce(n,{code:re.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?ce(n,{code:re.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}):o&&ce(n,{code:re.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}),t.dirty())}else if("email"===i.kind)Oe.test(e.data)||(n=this._getOrReturnCtx(e,n),ce(n,{validation:"email",code:re.invalid_string,message:i.message}),t.dirty());else if("uuid"===i.kind)Pe.test(e.data)||(n=this._getOrReturnCtx(e,n),ce(n,{validation:"uuid",code:re.invalid_string,message:i.message}),t.dirty());else if("cuid"===i.kind)Ee.test(e.data)||(n=this._getOrReturnCtx(e,n),ce(n,{validation:"cuid",code:re.invalid_string,message:i.message}),t.dirty());else if("cuid2"===i.kind)Se.test(e.data)||(n=this._getOrReturnCtx(e,n),ce(n,{validation:"cuid2",code:re.invalid_string,message:i.message}),t.dirty());else if("url"===i.kind)try{new URL(e.data)}catch(r){n=this._getOrReturnCtx(e,n),ce(n,{validation:"url",code:re.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),ce(n,{validation:"regex",code:re.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),ce(n,{code:re.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),ce(n,{code:re.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),ce(n,{code:re.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",...ge.errToObj(e)})}url(e){return this._addCheck({kind:"url",...ge.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...ge.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...ge.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...ge.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,...ge.errToObj(null==e?void 0:e.message)})}regex(e,t){return this._addCheck({kind:"regex",regex:e,...ge.errToObj(t)})}startsWith(e,t){return this._addCheck({kind:"startsWith",value:e,...ge.errToObj(t)})}endsWith(e,t){return this._addCheck({kind:"endsWith",value:e,...ge.errToObj(t)})}min(e,t){return this._addCheck({kind:"min",value:e,...ge.errToObj(t)})}max(e,t){return this._addCheck({kind:"max",value:e,...ge.errToObj(t)})}length(e,t){return this._addCheck({kind:"length",value:e,...ge.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 ke(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:yt.ZodString,coerce:null!==(t=null==e?void 0:e.coerce)&&void 0!==t&&t,...be(e)})};class Ie extends Te{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)!==te.number){const t=this._getOrReturnCtx(e);return ce(t,{code:re.invalid_type,expected:te.number,received:t.parsedType}),de}let t;const n=new le;for(const r of this._def.checks)if("int"===r.kind)p.isInteger(e.data)||(t=this._getOrReturnCtx(e,t),ce(t,{code:re.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),ce(t,{code:re.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),ce(t,{code:re.too_big,maximum:r.value,type:"number",inclusive:r.inclusive,exact:!1,message:r.message}),n.dirty())}else"multipleOf"===r.kind?0!==ke(e.data,r.value)&&(t=this._getOrReturnCtx(e,t),ce(t,{code:re.not_multiple_of,multipleOf:r.value,message:r.message}),n.dirty()):"finite"===r.kind?Number.isFinite(e.data)||(t=this._getOrReturnCtx(e,t),ce(t,{code:re.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,ge.toString(t))}gt(e,t){return this.setLimit("min",e,!1,ge.toString(t))}lte(e,t){return this.setLimit("max",e,!0,ge.toString(t))}lt(e,t){return this.setLimit("max",e,!1,ge.toString(t))}setLimit(e,t,n,r){return new Ie({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:n,message:ge.toString(r)}]})}_addCheck(e){return new Ie({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:ge.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:ge.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:ge.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:ge.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:ge.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:ge.toString(t)})}finite(e){return this._addCheck({kind:"finite",message:ge.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)}}Ie.create=e=>new Ie({checks:[],typeName:yt.ZodNumber,coerce:(null==e?void 0:e.coerce)||!1,...be(e)});class Ce extends Te{_parse(e){this._def.coerce&&(e.data=BigInt(e.data));if(this._getType(e)!==te.bigint){const t=this._getOrReturnCtx(e);return ce(t,{code:re.invalid_type,expected:te.bigint,received:t.parsedType}),de}return fe(e.data)}}Ce.create=e=>{var t;return new Ce({typeName:yt.ZodBigInt,coerce:null!==(t=null==e?void 0:e.coerce)&&void 0!==t&&t,...be(e)})};class Ne extends Te{_parse(e){this._def.coerce&&(e.data=Boolean(e.data));if(this._getType(e)!==te.boolean){const t=this._getOrReturnCtx(e);return ce(t,{code:re.invalid_type,expected:te.boolean,received:t.parsedType}),de}return fe(e.data)}}Ne.create=e=>new Ne({typeName:yt.ZodBoolean,coerce:(null==e?void 0:e.coerce)||!1,...be(e)});class Me extends Te{_parse(e){this._def.coerce&&(e.data=new Date(e.data));if(this._getType(e)!==te.date){const t=this._getOrReturnCtx(e);return ce(t,{code:re.invalid_type,expected:te.date,received:t.parsedType}),de}if(isNaN(e.data.getTime())){return ce(this._getOrReturnCtx(e),{code:re.invalid_date}),de}const t=new le;let n;for(const r of this._def.checks)"min"===r.kind?e.data.getTime()<r.value&&(n=this._getOrReturnCtx(e,n),ce(n,{code:re.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),ce(n,{code:re.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 Me({...this._def,checks:[...this._def.checks,e]})}min(e,t){return this._addCheck({kind:"min",value:e.getTime(),message:ge.toString(t)})}max(e,t){return this._addCheck({kind:"max",value:e.getTime(),message:ge.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}}Me.create=e=>new Me({checks:[],coerce:(null==e?void 0:e.coerce)||!1,typeName:yt.ZodDate,...be(e)});class xe extends Te{_parse(e){if(this._getType(e)!==te.symbol){const t=this._getOrReturnCtx(e);return ce(t,{code:re.invalid_type,expected:te.symbol,received:t.parsedType}),de}return fe(e.data)}}xe.create=e=>new xe({typeName:yt.ZodSymbol,...be(e)});class Re extends Te{_parse(e){if(this._getType(e)!==te.undefined){const t=this._getOrReturnCtx(e);return ce(t,{code:re.invalid_type,expected:te.undefined,received:t.parsedType}),de}return fe(e.data)}}Re.create=e=>new Re({typeName:yt.ZodUndefined,...be(e)});class De extends Te{_parse(e){if(this._getType(e)!==te.null){const t=this._getOrReturnCtx(e);return ce(t,{code:re.invalid_type,expected:te.null,received:t.parsedType}),de}return fe(e.data)}}De.create=e=>new De({typeName:yt.ZodNull,...be(e)});class je extends Te{constructor(){super(...arguments),this._any=!0}_parse(e){return fe(e.data)}}je.create=e=>new je({typeName:yt.ZodAny,...be(e)});class Ue extends Te{constructor(){super(...arguments),this._unknown=!0}_parse(e){return fe(e.data)}}Ue.create=e=>new Ue({typeName:yt.ZodUnknown,...be(e)});class Be extends Te{_parse(e){const t=this._getOrReturnCtx(e);return ce(t,{code:re.invalid_type,expected:te.never,received:t.parsedType}),de}}Be.create=e=>new Be({typeName:yt.ZodNever,...be(e)});class Le extends Te{_parse(e){if(this._getType(e)!==te.undefined){const t=this._getOrReturnCtx(e);return ce(t,{code:re.invalid_type,expected:te.void,received:t.parsedType}),de}return fe(e.data)}}Le.create=e=>new Le({typeName:yt.ZodVoid,...be(e)});class Ze extends Te{_parse(e){const{ctx:t,status:n}=this._processInputParams(e),r=this._def;if(t.parsedType!==te.array)return ce(t,{code:re.invalid_type,expected:te.array,received:t.parsedType}),de;if(null!==r.exactLength){const e=t.data.length>r.exactLength.value,i=t.data.length<r.exactLength.value;(e||i)&&(ce(t,{code:e?re.too_big:re.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&&(ce(t,{code:re.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&&(ce(t,{code:re.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 _e(t,e,t.path,n))))).then((e=>le.mergeArray(n,e)));const i=[...t.data].map(((e,n)=>r.type._parseSync(new _e(t,e,t.path,n))));return le.mergeArray(n,i)}get element(){return this._def.type}min(e,t){return new Ze({...this._def,minLength:{value:e,message:ge.toString(t)}})}max(e,t){return new Ze({...this._def,maxLength:{value:e,message:ge.toString(t)}})}length(e,t){return new Ze({...this._def,exactLength:{value:e,message:ge.toString(t)}})}nonempty(e){return this.min(1,e)}}var ze;function We(e){if(e instanceof Fe){const t={};for(const n in e.shape){const r=e.shape[n];t[n]=st.create(We(r))}return new Fe({...e._def,shape:()=>t})}return e instanceof Ze?Ze.create(We(e.element)):e instanceof st?st.create(We(e.unwrap())):e instanceof ut?ut.create(We(e.unwrap())):e instanceof qe?qe.create(e.items.map((e=>We(e)))):e}Ze.create=(e,t)=>new Ze({type:e,minLength:null,maxLength:null,exactLength:null,typeName:yt.ZodArray,...be(t)}),function(e){e.mergeShapes=(e,t)=>({...e,...t})}(ze||(ze={}));class Fe extends Te{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)!==te.object){const t=this._getOrReturnCtx(e);return ce(t,{code:re.invalid_type,expected:te.object,received:t.parsedType}),de}const{status:t,ctx:n}=this._processInputParams(e),{shape:r,keys:i}=this._getCached(),o=[];if(!(this._def.catchall instanceof Be&&"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 _e(n,i,n.path,e)),alwaysSet:e in n.data})}if(this._def.catchall instanceof Be){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&&(ce(n,{code:re.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 _e(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=>le.mergeObjectSync(t,e))):le.mergeObjectSync(t,a)}get shape(){return this._def.shape()}strict(e){return ge.errToObj,new Fe({...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=ge.errToObj(e).message)&&void 0!==a?a:s}:{message:s}}}:{}})}strip(){return new Fe({...this._def,unknownKeys:"strip"})}passthrough(){return new Fe({...this._def,unknownKeys:"passthrough"})}extend(e){return new Fe({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new Fe({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>ze.mergeShapes(this._def.shape(),e._def.shape()),typeName:yt.ZodObject})}setKey(e,t){return this.augment({[e]:t})}catchall(e){return new Fe({...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 Fe({...this._def,shape:()=>t})}omit(e){const t={};return p.objectKeys(this.shape).forEach((n=>{e[n]||(t[n]=this.shape[n])})),new Fe({...this._def,shape:()=>t})}deepPartial(){return We(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 Fe({...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 st;)e=e._def.innerType;t[n]=e}})),new Fe({...this._def,shape:()=>t})}keyof(){return nt(p.objectKeys(this.shape))}}Fe.create=(e,t)=>new Fe({shape:()=>e,unknownKeys:"strip",catchall:Be.create(),typeName:yt.ZodObject,...be(t)}),Fe.strictCreate=(e,t)=>new Fe({shape:()=>e,unknownKeys:"strict",catchall:Be.create(),typeName:yt.ZodObject,...be(t)}),Fe.lazycreate=(e,t)=>new Fe({shape:e,unknownKeys:"strip",catchall:Be.create(),typeName:yt.ZodObject,...be(t)});class Ge extends Te{_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 ie(e.ctx.common.issues)));return ce(t,{code:re.invalid_union,unionErrors:n}),de}));{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 ie(e)));return ce(t,{code:re.invalid_union,unionErrors:i}),de}}get options(){return this._def.options}}Ge.create=(e,t)=>new Ge({options:e,typeName:yt.ZodUnion,...be(t)});const He=e=>e instanceof et?He(e.schema):e instanceof at?He(e.innerType()):e instanceof tt?[e.value]:e instanceof rt?e.options:e instanceof it?Object.keys(e.enum):e instanceof ct?He(e._def.innerType):e instanceof Re?[void 0]:e instanceof De?[null]:null;class Ve extends Te{_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==te.object)return ce(t,{code:re.invalid_type,expected:te.object,received:t.parsedType}),de;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}):(ce(t,{code:re.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[n]}),de)}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=He(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 Ve({typeName:yt.ZodDiscriminatedUnion,discriminator:e,options:t,optionsMap:r,...be(n)})}}function Ke(e,t){const n=ne(e),r=ne(t);if(e===t)return{valid:!0,data:e};if(n===te.object&&r===te.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===te.array&&r===te.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===te.date&&r===te.date&&+e==+t?{valid:!0,data:e}:{valid:!1}}class Je extends Te{_parse(e){const{status:t,ctx:n}=this._processInputParams(e),r=(e,r)=>{if(he(e)||he(r))return de;const i=Ke(e.value,r.value);return i.valid?((me(e)||me(r))&&t.dirty(),{status:t.value,value:i.data}):(ce(n,{code:re.invalid_intersection_types}),de)};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}))}}Je.create=(e,t,n)=>new Je({left:e,right:t,typeName:yt.ZodIntersection,...be(n)});class qe extends Te{_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==te.array)return ce(n,{code:re.invalid_type,expected:te.array,received:n.parsedType}),de;if(n.data.length<this._def.items.length)return ce(n,{code:re.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),de;!this._def.rest&&n.data.length>this._def.items.length&&(ce(n,{code:re.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 _e(n,e,n.path,t)):null})).filter((e=>!!e));return n.common.async?Promise.all(r).then((e=>le.mergeArray(t,e))):le.mergeArray(t,r)}get items(){return this._def.items}rest(e){return new qe({...this._def,rest:e})}}qe.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new qe({items:e,typeName:yt.ZodTuple,rest:null,...be(t)})};class $e extends Te{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!==te.object)return ce(n,{code:re.invalid_type,expected:te.object,received:n.parsedType}),de;const r=[],i=this._def.keyType,o=this._def.valueType;for(const e in n.data)r.push({key:i._parse(new _e(n,e,n.path,e)),value:o._parse(new _e(n,n.data[e],n.path,e))});return n.common.async?le.mergeObjectAsync(t,r):le.mergeObjectSync(t,r)}get element(){return this._def.valueType}static create(e,t,n){return new $e(t instanceof Te?{keyType:e,valueType:t,typeName:yt.ZodRecord,...be(n)}:{keyType:Ae.create(),valueType:e,typeName:yt.ZodRecord,...be(t)})}}class Qe extends Te{_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==te.map)return ce(n,{code:re.invalid_type,expected:te.map,received:n.parsedType}),de;const r=this._def.keyType,i=this._def.valueType,o=[...n.data.entries()].map((([e,t],o)=>({key:r._parse(new _e(n,e,n.path,[o,"key"])),value:i._parse(new _e(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 de;"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 de;"dirty"!==r.status&&"dirty"!==i.status||t.dirty(),e.set(r.value,i.value)}return{status:t.value,value:e}}}}Qe.create=(e,t,n)=>new Qe({valueType:t,keyType:e,typeName:yt.ZodMap,...be(n)});class Ye extends Te{_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==te.set)return ce(n,{code:re.invalid_type,expected:te.set,received:n.parsedType}),de;const r=this._def;null!==r.minSize&&n.data.size<r.minSize.value&&(ce(n,{code:re.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&&(ce(n,{code:re.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 de;"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 _e(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:ge.toString(t)}})}max(e,t){return new Ye({...this._def,maxSize:{value:e,message:ge.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:yt.ZodSet,...be(t)});class Xe extends Te{constructor(){super(...arguments),this.validate=this.implement}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==te.function)return ce(t,{code:re.invalid_type,expected:te.function,received:t.parsedType}),de;function n(e,n){return ue({data:e,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,se(),oe].filter((e=>!!e)),issueData:{code:re.invalid_arguments,argumentsError:n}})}function r(e,n){return ue({data:e,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,se(),oe].filter((e=>!!e)),issueData:{code:re.invalid_return_type,returnTypeError:n}})}const i={errorMap:t.common.contextualErrorMap},o=t.data;return this._def.returns instanceof ot?fe((async(...e)=>{const t=new ie([]),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}))})):fe(((...e)=>{const t=this._def.args.safeParse(e,i);if(!t.success)throw new ie([n(e,t.error)]);const a=o(...t.data),s=this._def.returns.safeParse(a,i);if(!s.success)throw new ie([r(a,s.error)]);return s.data}))}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new Xe({...this._def,args:qe.create(e).rest(Ue.create())})}returns(e){return new Xe({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,t,n){return new Xe({args:e||qe.create([]).rest(Ue.create()),returns:t||Ue.create(),typeName:yt.ZodFunction,...be(n)})}}class et extends Te{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})}}et.create=(e,t)=>new et({getter:e,typeName:yt.ZodLazy,...be(t)});class tt extends Te{_parse(e){if(e.data!==this._def.value){const t=this._getOrReturnCtx(e);return ce(t,{received:t.data,code:re.invalid_literal,expected:this._def.value}),de}return{status:"valid",value:e.data}}get value(){return this._def.value}}function nt(e,t){return new rt({values:e,typeName:yt.ZodEnum,...be(t)})}tt.create=(e,t)=>new tt({value:e,typeName:yt.ZodLiteral,...be(t)});class rt extends Te{_parse(e){if("string"!=typeof e.data){const t=this._getOrReturnCtx(e),n=this._def.values;return ce(t,{expected:p.joinValues(n),received:t.parsedType,code:re.invalid_type}),de}if(-1===this._def.values.indexOf(e.data)){const t=this._getOrReturnCtx(e),n=this._def.values;return ce(t,{received:t.data,code:re.invalid_enum_value,options:n}),de}return fe(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 rt.create(e)}exclude(e){return rt.create(this.options.filter((t=>!e.includes(t))))}}rt.create=nt;class it extends Te{_parse(e){const t=p.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(e);if(n.parsedType!==te.string&&n.parsedType!==te.number){const e=p.objectValues(t);return ce(n,{expected:p.joinValues(e),received:n.parsedType,code:re.invalid_type}),de}if(-1===t.indexOf(e.data)){const e=p.objectValues(t);return ce(n,{received:n.data,code:re.invalid_enum_value,options:e}),de}return fe(e.data)}get enum(){return this._def.values}}it.create=(e,t)=>new it({values:e,typeName:yt.ZodNativeEnum,...be(t)});class ot extends Te{unwrap(){return this._def.type}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==te.promise&&!1===t.common.async)return ce(t,{code:re.invalid_type,expected:te.promise,received:t.parsedType}),de;const n=t.parsedType===te.promise?t.data:Promise.resolve(t.data);return fe(n.then((e=>this._def.type.parseAsync(e,{path:t.path,errorMap:t.common.contextualErrorMap}))))}}ot.create=(e,t)=>new ot({type:e,typeName:yt.ZodPromise,...be(t)});class at extends Te{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===yt.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=>{ce(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?de:("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?de:("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(!ve(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=>ve(e)?Promise.resolve(r.transform(e.value,i)).then((e=>({status:t.value,value:e}))):e))}p.assertNever(r)}}at.create=(e,t,n)=>new at({schema:e,typeName:yt.ZodEffects,effect:t,...be(n)}),at.createWithPreprocess=(e,t,n)=>new at({schema:t,effect:{type:"preprocess",transform:e},typeName:yt.ZodEffects,...be(n)});class st extends Te{_parse(e){return this._getType(e)===te.undefined?fe(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}st.create=(e,t)=>new st({innerType:e,typeName:yt.ZodOptional,...be(t)});class ut extends Te{_parse(e){return this._getType(e)===te.null?fe(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}ut.create=(e,t)=>new ut({innerType:e,typeName:yt.ZodNullable,...be(t)});class ct extends Te{_parse(e){const{ctx:t}=this._processInputParams(e);let n=t.data;return t.parsedType===te.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:t.path,parent:t})}removeDefault(){return this._def.innerType}}ct.create=(e,t)=>new ct({innerType:e,typeName:yt.ZodDefault,defaultValue:"function"==typeof t.default?t.default:()=>t.default,...be(t)});class lt extends Te{_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 ye(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}}lt.create=(e,t)=>new lt({innerType:e,typeName:yt.ZodCatch,catchValue:"function"==typeof t.catch?t.catch:()=>t.catch,...be(t)});class dt extends Te{_parse(e){if(this._getType(e)!==te.nan){const t=this._getOrReturnCtx(e);return ce(t,{code:re.invalid_type,expected:te.nan,received:t.parsedType}),de}return{status:"valid",value:e.data}}}dt.create=e=>new dt({typeName:yt.ZodNaN,...be(e)});const pt=Symbol("zod_brand");class ft extends Te{_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 ht extends Te{_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?de:"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?de:"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 ht({in:e,out:t,typeName:yt.ZodPipeline})}}const mt=(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(),vt={object:Fe.lazycreate};var yt;!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"}(yt||(yt={}));const gt=Ae.create,_t=Ie.create,wt=dt.create,bt=Ce.create,Tt=Ne.create,Et=Me.create,St=xe.create,Pt=Re.create,Ot=De.create,At=je.create,kt=Ue.create,It=Be.create,Ct=Le.create,Nt=Ze.create,Mt=Fe.create,xt=Fe.strictCreate,Rt=Ge.create,Dt=Ve.create,jt=Je.create,Ut=qe.create,Bt=$e.create,Lt=Qe.create,Zt=Ye.create,zt=Xe.create,Wt=et.create,Ft=tt.create,Gt=rt.create,Ht=it.create,Vt=ot.create,Kt=at.create,Jt=st.create,qt=ut.create,$t=at.createWithPreprocess,Qt=ht.create,Yt={string:e=>Ae.create({...e,coerce:!0}),number:e=>Ie.create({...e,coerce:!0}),boolean:e=>Ne.create({...e,coerce:!0}),bigint:e=>Ce.create({...e,coerce:!0}),date:e=>Me.create({...e,coerce:!0})},Xt=de;var en,tn,nn,rn,on,an,sn,un,cn,ln,dn,pn,fn,hn,mn,vn,yn,gn,_n,wn,bn,Tn,En=Object.freeze({__proto__:null,defaultErrorMap:oe,setErrorMap:function(e){ae=e},getErrorMap:se,makeIssue:ue,EMPTY_PATH:[],addIssueToContext:ce,ParseStatus:le,INVALID:de,DIRTY:pe,OK:fe,isAborted:he,isDirty:me,isValid:ve,isAsync:ye,get util(){return p},ZodParsedType:te,getParsedType:ne,ZodType:Te,ZodString:Ae,ZodNumber:Ie,ZodBigInt:Ce,ZodBoolean:Ne,ZodDate:Me,ZodSymbol:xe,ZodUndefined:Re,ZodNull:De,ZodAny:je,ZodUnknown:Ue,ZodNever:Be,ZodVoid:Le,ZodArray:Ze,get objectUtil(){return ze},ZodObject:Fe,ZodUnion:Ge,ZodDiscriminatedUnion:Ve,ZodIntersection:Je,ZodTuple:qe,ZodRecord:$e,ZodMap:Qe,ZodSet:Ye,ZodFunction:Xe,ZodLazy:et,ZodLiteral:tt,ZodEnum:rt,ZodNativeEnum:it,ZodPromise:ot,ZodEffects:at,ZodTransformer:at,ZodOptional:st,ZodNullable:ut,ZodDefault:ct,ZodCatch:lt,ZodNaN:dt,BRAND:pt,ZodBranded:ft,ZodPipeline:ht,custom:mt,Schema:Te,ZodSchema:Te,late:vt,get ZodFirstPartyTypeKind(){return yt},coerce:Yt,any:At,array:Nt,bigint:bt,boolean:Tt,date:Et,discriminatedUnion:Dt,effect:Kt,enum:Gt,function:zt,instanceof:(e,t={message:`Input not instance of ${e.name}`})=>mt((t=>t instanceof e),t,!0),intersection:jt,lazy:Wt,literal:Ft,map:Lt,nan:wt,nativeEnum:Ht,never:It,null:Ot,nullable:qt,number:_t,object:Mt,oboolean:()=>Tt().optional(),onumber:()=>_t().optional(),optional:Jt,ostring:()=>gt().optional(),pipeline:Qt,preprocess:$t,promise:Vt,record:Bt,set:Zt,strictObject:xt,string:gt,symbol:St,transformer:Kt,tuple:Ut,undefined:Pt,union:Rt,unknown:kt,void:Ct,NEVER:Xt,ZodIssueCode:re,quotelessJson:e=>JSON.stringify(e,null,2).replace(/"([^"]+)":/g,"$1:"),ZodError:ie});function Sn(e){var t=new URL(window.location.href).searchParams.get("env");return{isMp:window.location.hostname.includes(u)&&("TESTING_LOCAL"==t||window.location.pathname.startsWith(c)),isMpWeb:window.location.hostname.includes("localhost")}}e.NetworkType=void 0,(en=e.NetworkType||(e.NetworkType={})).none="none",en.wifi="wifi",en.cellular="cellular",en.unknown="unknown",e.PlatformType=void 0,(tn=e.PlatformType||(e.PlatformType={})).wp="wp",tn.android="android",tn.iOS="iOS",tn.unknown="unknown",e.Events=void 0,(nn=e.Events||(e.Events={})).AppPaused="h5.event.paused",nn.AppResumed="h5.event.resumed",nn.NetworkChanged="h5.event.connection.changed",nn.OnDataCallback="h5.event.webview.result",nn.WebviewClosed="h5.event.webview.close",nn.OpenApp="h5.event.open.mp",nn.AppClose="h5.event.action.close",nn.PaymentCallback="payment.callback",nn.PaymentResult="action.payment.result",nn.PaymentClose="action.payment.close",e.JumpStatus=void 0,(rn=e.JumpStatus||(e.JumpStatus={})).DOING="doing",rn.DONE="done",e.ProfileType=void 0,(on=e.ProfileType||(e.ProfileType={}))[on.user=1]="user",on[on.oa=0]="oa",on[on.aliasOA=2]="aliasOA",e.ChatType=void 0,(an=e.ChatType||(e.ChatType={}))[an.user=1]="user",an[an.oa=0]="oa",e.PostFeedType=void 0,(sn=e.PostFeedType||(e.PostFeedType={}))[sn.image=1]="image",sn[sn.link=4]="link",sn[sn.profile=5]="profile",e.ShareSheetType=void 0,(un=e.ShareSheetType||(e.ShareSheetType={}))[un.image=1]="image",un[un.gif=11]="gif",un[un.video=12]="video",un[un.link=4]="link",un[un.oa=5]="oa",un[un.zmp=20]="zmp",un[un.multi_image=21]="multi_image",un[un.zmp_deep_link=4]="zmp_deep_link",un[un.text=22]="text",e.OrientationType=void 0,(cn=e.OrientationType||(e.OrientationType={}))[cn.auto=1]="auto",cn[cn.portrait=2]="portrait",cn[cn.landscape=3]="landscape",e.VibrateType=void 0,(ln=e.VibrateType||(e.VibrateType={}))[ln.oneShot=0]="oneShot",e.MediaPickerType=void 0,(dn=e.MediaPickerType||(e.MediaPickerType={}))[dn.zcamera=3]="zcamera",dn[dn.zcamera_photo=1]="zcamera_photo",dn[dn.zcamera_video=2]="zcamera_video",dn[dn.zcamera_scan=7]="zcamera_scan",dn[dn.photo=4]="photo",dn[dn.video=5]="video",dn[dn.file=6]="file",e.IAPPayType=void 0,(pn=e.IAPPayType||(e.IAPPayType={})).SUBSCRIPTION="SUBSCRIPTION",pn.ONETIME="ONETIME",e.ProrationMode=void 0,(fn=e.ProrationMode||(e.ProrationMode={}))[fn.UNKNOW=0]="UNKNOW",fn[fn.DEFERRED=1]="DEFERRED",fn[fn.IMMEDIATE_AND_CHARGE_FULL_PRICE=2]="IMMEDIATE_AND_CHARGE_FULL_PRICE",e.StatusBarType=void 0,(hn=e.StatusBarType||(e.StatusBarType={}))[hn.normal=1]="normal",hn[hn.hidden=0]="hidden",hn[hn.transparent=2]="transparent",e.AndroidBottomNavigationBarType=void 0,(mn=e.AndroidBottomNavigationBarType||(e.AndroidBottomNavigationBarType={}))[mn.show=1]="show",mn[mn.hide=0]="hide",e.IOSSafeAreaBottomType=void 0,(vn=e.IOSSafeAreaBottomType||(e.IOSSafeAreaBottomType={}))[vn.show=1]="show",vn[vn.hide=0]="hide",e.TextAlignType=void 0,(yn=e.TextAlignType||(e.TextAlignType={}))[yn.left=0]="left",yn[yn.center=1]="center",e.CameraEvents=void 0,(gn=e.CameraEvents||(e.CameraEvents={})).OnFrameCallback="h5.event.camera.frame",gn.OnStartCallback="h5.event.camera.start",gn.OnStopCallback="h5.event.camera.stop",e.FacingMode=void 0,(_n=e.FacingMode||(e.FacingMode={})).FRONT="user",_n.BACK="environment",e.PhotoFormat=void 0,(wn=e.PhotoFormat||(e.PhotoFormat={})).WEBP="image/webp",wn.PNG="image/png",wn.JPEG="image/jpeg",e.PhotoQuality=void 0,(bn=e.PhotoQuality||(e.PhotoQuality={})).HIGH="high",bn.NORMAL="normal",bn.LOW="low",e.StreamType=void 0,(Tn=e.StreamType||(e.StreamType={})).VIDEO="video",Tn.AUDIO="audio";var Pn,On=function(t){return t.isAndroid?e.PlatformType.android:t.isIOS?e.PlatformType.iOS:e.PlatformType.unknown};function An(e){var t=e.split("zalo")[1];return t&&t.replace(" ","").split("/")[1]||""}function kn(){var e=function(){var e=ee((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:Sn(),platform:t,platformName:On(t),zaloVersion:An(e).trim()}}}();if(e)return e}var In=(null===(Pn=kn())||void 0===Pn?void 0:Pn.appEnv)||{};function Cn(e){Cn.on&&Cn.engine(e)}Cn.on=!1,Cn.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 Nn=function(e,t){var r,i={error:-1404,errorMessage:"".concat(e," is not found")};null==t||null===(r=t.fail)||void 0===r||r.call(t,i),Cn({stage:n.NOT_FOUND,type:"error",name:e,request:t,state:"fail",response:i})};function Mn(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function xn(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){Mn(e,t,n[t])}))}return e}function Rn(e,t){return function(e){if(Array.isArray(e))return e}(e)||$(e)||Q(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 Dn="undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{};function jn(){throw new Error("setTimeout has not been defined")}function Un(){throw new Error("clearTimeout has not been defined")}var Bn=jn,Ln=Un;function Zn(e){if(Bn===setTimeout)return setTimeout(e,0);if((Bn===jn||!Bn)&&setTimeout)return Bn=setTimeout,setTimeout(e,0);try{return Bn(e,0)}catch(t){try{return Bn.call(null,e,0)}catch(t){return Bn.call(this,e,0)}}}"function"==typeof Dn.setTimeout&&(Bn=setTimeout),"function"==typeof Dn.clearTimeout&&(Ln=clearTimeout);var zn,Wn=[],Fn=!1,Gn=-1;function Hn(){Fn&&zn&&(Fn=!1,zn.length?Wn=zn.concat(Wn):Gn=-1,Wn.length&&Vn())}function Vn(){if(!Fn){var e=Zn(Hn);Fn=!0;for(var t=Wn.length;t;){for(zn=Wn,Wn=[];++Gn<t;)zn&&zn[Gn].run();Gn=-1,t=Wn.length}zn=null,Fn=!1,function(e){if(Ln===clearTimeout)return clearTimeout(e);if((Ln===Un||!Ln)&&clearTimeout)return Ln=clearTimeout,clearTimeout(e);try{Ln(e)}catch(t){try{return Ln.call(null,e)}catch(t){return Ln.call(this,e)}}}(e)}}function Kn(e,t){this.fun=e,this.array=t}Kn.prototype.run=function(){this.fun.apply(null,this.array)};function Jn(){}var qn=Jn,$n=Jn,Qn=Jn,Yn=Jn,Xn=Jn,er=Jn,tr=Jn;var nr=Dn.performance||{},rr=nr.now||nr.mozNow||nr.msNow||nr.oNow||nr.webkitNow||function(){return(new Date).getTime()};var ir=new Date;var or,ar={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];Wn.push(new Kn(e,t)),1!==Wn.length||Fn||Zn(Vn)},title:"browser",browser:!0,env:{},argv:[],version:"",versions:{},on:qn,addListener:$n,once:Qn,off:Yn,removeListener:Xn,removeAllListeners:er,emit:tr,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*rr.call(nr),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-ir)/1e3}},sr=ar,ur="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function cr(e){return e&&e.constructor===Symbol?"symbol":typeof e}function lr(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 ur?ur:"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 sr&&sr.env&&"true"===sr.env.REFLECT_METADATA_USE_MAP_POLYFILL,d=l||"function"!=typeof Map||"function"!=typeof Map.prototype.entries?ee():Map,p=l||"function"!=typeof Set||"function"!=typeof Set.prototype.entries?te():Set,f=new(l||"function"!=typeof WeakMap?ne():WeakMap);function h(e,t,n,r){if(D(n)){if(!G(e))throw new TypeError;if(!V(t))throw new TypeError;return S(e,t)}if(!G(e))throw new TypeError;if(!B(t))throw new TypeError;if(!B(r)&&!D(r)&&!j(r))throw new TypeError;return j(r)&&(r=void 0),P(e,t,n=F(n),r)}function m(e,t){function n(n,r){if(!B(n))throw new TypeError;if(!D(r)&&!K(r))throw new TypeError;N(e,t,n,r)}return n}function v(e,t,n,r){if(!B(n))throw new TypeError;return D(r)||(r=F(r)),N(e,t,n,r)}function y(e,t,n){if(!B(t))throw new TypeError;return D(n)||(n=F(n)),A(e,t,n)}function g(e,t,n){if(!B(t))throw new TypeError;return D(n)||(n=F(n)),k(e,t,n)}function _(e,t,n){if(!B(t))throw new TypeError;return D(n)||(n=F(n)),I(e,t,n)}function w(e,t,n){if(!B(t))throw new TypeError;return D(n)||(n=F(n)),C(e,t,n)}function b(e,t){if(!B(e))throw new TypeError;return D(t)||(t=F(t)),M(e,t)}function T(e,t){if(!B(e))throw new TypeError;return D(t)||(t=F(t)),x(e,t)}function E(e,t,n){if(!B(t))throw new TypeError;D(n)||(n=F(n));var r=O(t,n,!1);if(D(r))return!1;if(!r.delete(e))return!1;if(r.size>0)return!0;var i=f.get(t);return i.delete(n),i.size>0||f.delete(t),!0}function S(e,t){for(var n=e.length-1;n>=0;--n){var r=(0,e[n])(t);if(!D(r)&&!j(r)){if(!V(r))throw new TypeError;t=r}}return t}function P(e,t,n,r){for(var i=e.length-1;i>=0;--i){var o=(0,e[i])(t,n,r);if(!D(o)&&!j(o)){if(!B(o))throw new TypeError;r=o}}return r}function O(e,t,n){var r=f.get(e);if(D(r)){if(!n)return;r=new d,f.set(e,r)}var i=r.get(t);if(D(i)){if(!n)return;i=new d,r.set(t,i)}return i}function A(e,t,n){if(k(e,t,n))return!0;var r=X(t);return!j(r)&&A(e,r,n)}function k(e,t,n){var r=O(t,n,!1);return!D(r)&&z(r.has(e))}function I(e,t,n){if(k(e,t,n))return C(e,t,n);var r=X(t);return j(r)?void 0:I(e,r,n)}function C(e,t,n){var r=O(t,n,!1);if(!D(r))return r.get(e)}function N(e,t,n,r){O(n,r,!0).set(e,t)}function M(e,t){var n=x(e,t),r=X(e);if(null===r)return n;var i=M(r,t);if(i.length<=0)return n;if(n.length<=0)return i;for(var o=new p,a=[],s=0,u=n;s<u.length;s++){var c=u[s];o.has(c)||(o.add(c),a.push(c))}for(var l=0,d=i;l<d.length;l++){c=d[l];o.has(c)||(o.add(c),a.push(c))}return a}function x(e,t){var n=[],r=O(e,t,!1);if(D(r))return n;for(var i=q(r.keys()),o=0;;){var a=Q(i);if(!a)return n.length=o,n;var s=$(a);try{n[o]=s}catch(e){try{Y(i)}finally{throw e}}o++}}function R(e){if(null===e)return 1;switch(typeof e){case"undefined":return 0;case"boolean":return 2;case"string":return 3;case"symbol":return 4;case"number":return 5;case"object":return null===e?1:6;default:return 6}}function D(e){return void 0===e}function j(e){return null===e}function U(e){return"symbol"==typeof e}function B(e){return"object"==typeof e?null!==e:"function"==typeof e}function L(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 Z(e,"default"===n?"number":n)}function Z(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 F(e){var t=L(e,3);return U(t)?t:W(t)}function G(e){return Array.isArray?Array.isArray(e):e instanceof Object?e instanceof Array:"[object Array]"===Object.prototype.toString.call(e)}function H(e){return"function"==typeof e}function V(e){return"function"==typeof e}function K(e){switch(R(e)){case 3:case 4:return!0;default:return!1}}function J(e,t){var n=e[t];if(null!=n){if(!H(n))throw new TypeError;return n}}function q(e){var t=J(e,i);if(!H(t))throw new TypeError;var n=t.call(e);if(!B(n))throw new TypeError;return n}function $(e){return e.value}function Q(e){var t=e.next();return!t.done&&t}function Y(e){var t=e.return;t&&t.call(e)}function X(e){var t=Object.getPrototypeOf(e);if("function"!=typeof e||e===c)return t;if(t!==c)return t;var n=e.prototype,r=n&&Object.getPrototypeOf(n);if(null==r||r===Object.prototype)return t;var i=r.constructor;return"function"!=typeof i||i===e?t:i}function ee(){var e={},t=[],n=function(){function e(e,t,n){this._index=0,this._keys=e,this._values=t,this._selector=n}return e.prototype["@@iterator"]=function(){return this},e.prototype[i]=function(){return this},e.prototype.next=function(){var e=this._index;if(e>=0&&e<this._keys.length){var n=this._selector(this._keys[e],this._values[e]);return e+1>=this._keys.length?(this._index=-1,this._keys=t,this._values=t):this._index++,{value:n,done:!1}}return{value:void 0,done:!0}},e.prototype.throw=function(e){throw this._index>=0&&(this._index=-1,this._keys=t,this._values=t),e},e.prototype.return=function(e){return this._index>=0&&(this._index=-1,this._keys=t,this._values=t),{value:e,done:!0}},e}();return function(){function t(){this._keys=[],this._values=[],this._cacheKey=e,this._cacheIndex=-2}return Object.defineProperty(t.prototype,"size",{get:function(){return this._keys.length},enumerable:!0,configurable:!0}),t.prototype.has=function(e){return this._find(e,!1)>=0},t.prototype.get=function(e){var t=this._find(e,!1);return t>=0?this._values[t]:void 0},t.prototype.set=function(e,t){var n=this._find(e,!0);return this._values[n]=t,this},t.prototype.delete=function(t){var n=this._find(t,!1);if(n>=0){for(var r=this._keys.length,i=n+1;i<r;i++)this._keys[i-1]=this._keys[i],this._values[i-1]=this._values[i];return this._keys.length--,this._values.length--,t===this._cacheKey&&(this._cacheKey=e,this._cacheIndex=-2),!0}return!1},t.prototype.clear=function(){this._keys.length=0,this._values.length=0,this._cacheKey=e,this._cacheIndex=-2},t.prototype.keys=function(){return new n(this._keys,this._values,r)},t.prototype.values=function(){return new n(this._keys,this._values,o)},t.prototype.entries=function(){return new n(this._keys,this._values,a)},t.prototype["@@iterator"]=function(){return this.entries()},t.prototype[i]=function(){return this.entries()},t.prototype._find=function(e,t){return this._cacheKey!==e&&(this._cacheIndex=this._keys.indexOf(this._cacheKey=e)),this._cacheIndex<0&&t&&(this._cacheIndex=this._keys.length,this._keys.push(e),this._values.push(void 0)),this._cacheIndex},t}();function r(e,t){return e}function o(e,t){return t}function a(e,t){return[e,t]}}function te(){return function(){function e(){this._map=new d}return Object.defineProperty(e.prototype,"size",{get:function(){return this._map.size},enumerable:!0,configurable:!0}),e.prototype.has=function(e){return this._map.has(e)},e.prototype.add=function(e){return this._map.set(e,e),this},e.prototype.delete=function(e){return this._map.delete(e)},e.prototype.clear=function(){this._map.clear()},e.prototype.keys=function(){return this._map.keys()},e.prototype.values=function(){return this._map.values()},e.prototype.entries=function(){return this._map.entries()},e.prototype["@@iterator"]=function(){return this.keys()},e.prototype[i]=function(){return this.keys()},e}()}function ne(){var e=16,n=u.create(),r=i();return function(){function e(){this._key=i()}return e.prototype.has=function(e){var t=o(e,!1);return void 0!==t&&u.has(t,this._key)},e.prototype.get=function(e){var t=o(e,!1);return void 0!==t?u.get(t,this._key):void 0},e.prototype.set=function(e,t){return o(e,!0)[this._key]=t,this},e.prototype.delete=function(e){var t=o(e,!1);return void 0!==t&&delete t[this._key]},e.prototype.clear=function(){this._key=i()},e}();function i(){var e;do{e="@@WeakMap@@"+c()}while(u.has(n,e));return n[e]=!0,e}function o(e,n){if(!t.call(e,r)){if(!n)return;Object.defineProperty(e,r,{value:u.create()})}return e[r]}function a(e,t){for(var n=0;n<t;++n)e[n]=255*Math.random()|0;return e}function s(e){return"function"==typeof Uint8Array?"undefined"!=typeof crypto?crypto.getRandomValues(new Uint8Array(e)):"undefined"!=typeof msCrypto?msCrypto.getRandomValues(new Uint8Array(e)):a(new Uint8Array(e),e):a(new Array(e),e)}function c(){var t=s(e);t[6]=79&t[6]|64,t[8]=191&t[8]|128;for(var n="",r=0;r<e;++r){var i=t[r];4!==r&&6!==r&&8!==r||(n+="-"),i<16&&(n+="0"),n+=i.toString(16).toLowerCase()}return n}}function re(e){return e.__=void 0,delete e.__,e}e("decorate",h),e("metadata",m),e("defineMetadata",v),e("hasMetadata",y),e("hasOwnMetadata",g),e("getMetadata",_),e("getOwnMetadata",w),e("getMetadataKeys",b),e("getOwnMetadataKeys",T),e("deleteMetadata",E)}(r)}()}(or||(or={}));var dr=Object.prototype.toString;var pr="[object Null]",fr="[object Undefined]";function hr(e){return null==e?void 0===e?fr:pr:function(e){return dr.call(e)}(e)}function mr(e){return null!=e&&"object"==typeof e}var vr={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||mr(e)&&"[object Number]"==hr(e)},isArray:function(e){return Array.isArray(e)},isRegExp:function(e){return mr(e)&&"[object RegExp]"==hr(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 yr(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function gr(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 _r(e){return _r=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},_r(e)}function wr(e){return _r(e)}function br(e,t,n){return br="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=wr(e)););return e}(e,t);if(r){var i=Object.getOwnPropertyDescriptor(r,t);return i.get?i.get.call(n||e):i.value}},br(e,t,n)}function Tr(e,t,n){return br(e,t,n)}function Er(e,t){return Er=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},Er(e,t)}function Sr(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&&Er(e,t)}function Pr(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Or(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=wr(e);if(t){var i=wr(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return function(e,t){return!t||"object"!==cr(t)&&"function"!=typeof t?Pr(e):t}(this,n)}}var Ar=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 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 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,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==(w=R.sent())||null===(_=w.authSetting)||void 0===_?void 0:_["scope.userInfo"]))return Sr({serialId:u,result:{error_code:v,error_message:O,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: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||b,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.38.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,_,w,b,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===(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===(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 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(Pn("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(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=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(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,t){var n,r,o,a;return Q(this,(function(s){switch(s.label){case 0:return(r=t)?[3,2]:[4,si()];case 1:r=!s.sent(),s.label=2;case 2:return n=r,[4,$r.getAccessToken(n)];case 3:return o=s.sent(),a="id,name,user_id_by_oa,is_sensitive",a=e?"".concat(a,",picture.type(").concat(e,")"):"".concat(a,",picture"),[4,fetch("".concat(l.GET_USER_INFO,"?fields=").concat(a,"&miniapp_id=").concat(i),{headers:{access_token:o||""}}).then(function(){var e=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 4:return[2,s.sent()]}}))}));return function(t,n){return e.apply(this,arguments)}}(),fo=[Ct({avatarType:yn.enum(["small","normal","large"]).optional(),autoRequestPermission:yn.boolean().default(!1).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,n;return Q(this,(function(r){switch(r.label){case 0:return En.isMp?(t=null==e?void 0:e.avatarType,n=null==e?void 0:e.autoRequestPermission,[4,po(t,n)]):[3,2];case 1:return[2,{userInfo:r.sent()}];case 2:return 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 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",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,m,v;return Q(this,(function(y){switch(y.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=y.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=y.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=y.sent().shareableLink,m=new URL(h),v=m.searchParams.getAll("zshareId"),m.searchParams.delete("zshareId"),v.length>0&&m.searchParams.append("zshareId",v[0]),o={link:m.href,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)}}(),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(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: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(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)}}(),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(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: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(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: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(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,On({msg:p.resultMessage},p)),[2,d]}}))}));return function(t){return e.apply(this,arguments)}}(),wu=function(){var t=V((function(t,n,r,o,a,s,u){var c,l,p,d,f,h,m,v,y,g,_,w,b,T,E,S,P,A,O,k;return Q(this,(function(I){switch(I.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 "}},I.label=1;case 1:return I.trys.push([1,6,,7]),[4,$r.getAccessToken().catch((function(){throw Kr.error.loginRequired}))];case 2:return m=I.sent(),f.headers.authorization="Bearer ".concat(m),[4,fetch(j,Ko(On({method:"POST"},f),{body:l}))];case 3:return[4,I.sent().json()];case 4:if(!(v=I.sent()).data||0!==v.err)throw Kr.error.badRequest(v.msg);return y=v.data.id,g=v.data.jwt,_=window.APP_VERSION,w=window.APP_ENV,b={miniAppId:c,orderId:y},T=v.data.method,E=v.data.isCustom,g&&(b.token=g),_&&(b.version=_),w&&(b.env=w),T&&(b.method=T),E&&(b.isCustom=E),S=Ar.encode(b),P=new URL("?".concat(S),"https://payment-mini.zalo.me").toString(),A=Ur(),O=((null===(h=Tn())||void 0===h?void 0:h.platformName)||"").toLowerCase(),[4,ps(P,{style:"android"===O&&A<742?"normal":"bottomSheet"}).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]:[4,_u({zmpOrderId:y})];case 1:(n=r.sent()).err>=0&&!n.isCustom&&Er.getInstance().emit(e.Events.PaymentClose,n.err,Ko(On({},n),{zmpOrderId:y})),r.label=2;case 2:return[2]}}))})),500)})),Er.getInstance().once(e.Events.OpenApp,(function(){t=!0}))}))];case 5:return I.sent(),[2,{orderId:y}];case 6:throw k=I.sent(),console.log("Internal error"),k;case 7:return[2]}}))}));return function(e,n,r,i,o,a,s){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.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",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,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:bt().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:bt().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,_,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(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,w=g.data.orderId,[2,new Promise((function(e,t){Vr("IAP_REQUESTPAYMENT",On({},_),{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)}}(),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 wc(e){return bc.apply(this,arguments)}function bc(){return(bc=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)}var Kc=[Ct({id:yt(),guidingText:yt().optional(),color:yt().optional(),onStatusChange:yn.function().optional()})];function Vc(e){return Jc.apply(this,arguments)}function Jc(){return Jc=V((function(e){return Q(this,(function(t){return[2,ui("showOAWidget",Kc,[e],function(){var e=V((function(e){var t,n,r,i,o;return Q(this,(function(a){if(En.isMp)try{t=document.getElementById(e.id),n=e.guidingText,r=e.onStatusChange,i=e.color,t&&((o=document.createElement("iframe")).id="iframeOAWidget",o.src="https://h5.zalo.me/widgets/oa_widget.html?guidingText=".concat(n,"&color=").concat(i),o.style.width="100%",o.style.height="100%",o.style.border="none",t.innerHTML=o.outerHTML,window.addEventListener("message",function(){var e=V((function(e){var t,n,i,o,a,s,u;return Q(this,(function(c){switch(c.label){case 0:return t=e.data,e.origin.startsWith("https://h5.zalo.me")?(n=document.getElementById("iframeOAWidget"),"followOA"!==(i=t.type)&&"getOAInfo"!==i?[3,2]:[4,$r.jumpAndGetToken()]):[3,3];case 1:return c.sent(),s=null===(o=$r.miniProgramConfig)||void 0===o?void 0:o.jwt,null==n||null===(a=n.contentWindow)||void 0===a||a.postMessage({type:i,payload:{jwt:s}},"*"),[3,3];case 2:"oaInfo"===i?null==r||r(null===(u=t.payload)||void 0===u?void 0:u.followed):"openOA"===i?Bo(t.payload.id,"oa"):"heightChange"===i&&(n.style.height="".concat(t.payload,"px")),c.label=3;case 3:return[2]}}))}));return function(t){return e.apply(this,arguments)}}(),!1))}catch(e){console.log(e)}return En.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Pn("openMiniApp",{}))]}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Jc.apply(this,arguments)}window.ZaloMiniAppSDK={getVersion:hi},ci();var qc=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:Ai,setStorage:Qi,getStorage:to,getStorageInfo:ro,removeStorage:ao,clearStorage:co,getUserInfo:ho,getNetworkType:go,onNetworkStatusChange:bo,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: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,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:wc,authorize:Sc,checkZaloCameraPermission:Oc,getUserID:Ic,getIDToken:Mc,setupAd:jc,loadAd:Bc,displayAd:zc,refreshAd:Fc,showOAWidget:Vc}),$c=Tu,Yc=Iu,Qc=Hu,Xc=Au,el=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}(qc,["createOrder","checkTransaction","createOrderIAP","selectPaymentMethod"]),tl={createOrder:$c,checkTransaction:Yc,createOrderIAP:Qc,selectPaymentMethod:Xc};!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,qc))}(),e.EventName=e.Events,e.Payment=tl,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=el,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=wc,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=bo,e.openBioAuthentication=ba,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=bs,e.setAccessToken=su,e.setAndroidBottomNavigationBar=Mu,e.setIOSBottomSafeArea=ju,e.setNavigationBarColor=Ei,e.setNavigationBarLeftButton=Ai,e.setNavigationBarTitle=wi,e.setStatusBar=Bu,e.setStorage=Qi,e.setupAd=jc,e.showOAWidget=Vc,e.showToast=ka,e.startBeaconDiscovery=So,e.stopBeaconDiscovery=Oo,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],d=arguments.length;if(l.fn){switch(l.once&&this.removeListener(e,l.fn,void 0,!0),d){case 1:return l.fn.call(l.context),!0;case 2:return l.fn.call(l.context,t),!0;case 3:return l.fn.call(l.context,t,r),!0;case 4:return l.fn.call(l.context,t,r,i),!0;case 5:return l.fn.call(l.context,t,r,i,o),!0;case 6:return l.fn.call(l.context,t,r,i,o,a),!0}for(c=1,u=new Array(d-1);c<d;c++)u[c-1]=arguments[c];l.fn.apply(l.context,u)}else{var p,f=l.length;for(c=0;c<f;c++)switch(l[c].once&&this.removeListener(e,l[c].fn,void 0,!0),d){case 1:l[c].fn.call(l[c].context);break;case 2:l[c].fn.call(l[c].context,t);break;case 3:l[c].fn.call(l[c].context,t,r);break;case 4:l[c].fn.call(l[c].context,t,r,i);break;default:if(!u)for(p=1,u=new Array(d-1);p<d;p++)u[p-1]=arguments[p];l[c].fn.apply(l[c].context,u)}}return!0},s.prototype.on=function(e,t,n){return o(this,e,t,n,!1)},s.prototype.once=function(e,t,n){return o(this,e,t,n,!0)},s.prototype.removeListener=function(e,t,r,i){var o=n?n+e:e;if(!this._events[o])return this;if(!t)return a(this,o),this;var s=this._events[o];if(s.fn)s.fn!==t||i&&!s.once||r&&s.context!==r||a(this,o);else{for(var u=0,c=[],l=s.length;u<l;u++)(s[u].fn!==t||i&&!s[u].once||r&&s[u].context!==r)&&c.push(s[u]);c.length?this._events[o]=1===c.length?c[0]:c:a(this,o)}return this},s.prototype.removeAllListeners=function(e){var t;return e?(t=n?n+e:e,this._events[t]&&a(this,t)):(this._events=new r,this._eventsCount=0),this},s.prototype.off=s.prototype.removeListener,s.prototype.addListener=s.prototype.on,s.prefixed=n,s.EventEmitter=s,e.exports=s})),kr="ACTION_CALLBACK";var Ir=function(t){Sr(r,t);var n=Or(r);function r(){var e;return yr(this,r),(e=n.apply(this,arguments)).debug=lr("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===kr||t===e.Events.PaymentCallback)return Tr(wr(r.prototype),"on",this).call(this,t,n,i);this.debug("register ".concat(String(t),": ").concat(i));return Tr(wr(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===kr)return Tr(wr(r.prototype),"once",this).call(this,e,t,n);this.debug("register once ".concat(String(e),": ").concat(n));return Tr(wr(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}(Ar);function Cr(e){Ir.getInstance().emit(kr,e)}function Nr(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){Cr({serialId:e,actionName:t,result:n})}},window.zaloJSV2={zalo_h5_event_handler:function(t,n,r){var i=lr("zmp:zalo_h5_event_handler");i("eventId: ".concat(t,", eventName: ").concat(n,", eventData: ").concat(r));var a=ai(r);i("stringToData",a);var s=function(t,n){try{if(t===e.Events.OpenApp){var r=n.url,i=new URL(r),a=i.pathname.split("/zapps/".concat(o))[1];return{path:"".concat(a||"/").concat(i.search)}}return n}catch(e){return n}}(n,a);Ir.getInstance().emit(n,t,s)}},window.zaloNative2JS={nativeCall:function(t,n,r){Ir.getInstance().emit(e.Events.PaymentCallback,t,n,r)}};var Mr={encode:Nr,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:Nr(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":cr(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":cr(r))?JSON.stringify(r):encodeURIComponent(r)].join("=");n.push(i)})),n.join("&")}},xr={},Rr=function(e,t,n){var r=t||"default";return function(){return(r in xr?xr[r](e,n):e).apply(this,arguments)}};Rr.setWrapper=function(e){xr[arguments.length<=1||void 0===arguments[1]?"default":arguments[1]]=e};var Dr={error:{code:1,error_subcode:1357046,message:"Received Invalid JSON reply.",type:"http"}};function jr(e){try{return null===e?Dr:JSON.parse(e)}catch(e){return Dr}}var Ur,Br={execute:function(e,t,n,r){n.suppress_http_code=1;var i=Mr.encode(n);"post"!=t&&(e=Mr.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=Rr((function(){o=r,"onload"in i&&i.onload(n)}),"entry","XMLHttpRequest:load"),a=Rr((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(jr(e.responseText))},o.onerror=function(e){e.responseText?r(jr(e.responseText)):r({error:{code:1,error_subcode:1357045,message:"unknown error (empty response)",status:e.status,type:"http"}})},o.send(i),!0)}},Lr=Br,Zr=(Ur=J((function(e,t,n){var r,i,o,a;return X(this,(function(s){switch(s.label){case 0:return r={appId:e,versionStatus:t},vr.isUndefined(n)||(r.currentVersion=n),i=Mr.appendToUrl(d.GET_APP_INFO,r),[4,fetch(i,{credentials:"include"})];case 1:return(o=s.sent()).ok?[4,o.json()]:[3,3];case 2:if((a=s.sent()).err<0||!a.data)throw new Error(a);return[2,{name:a.data.name,version:a.data.version,description:a.data.description,appUrl:a.data.appUrl,qrCodeUrl:a.data.qrCodeUrl,logoUrl:a.data.logoUrl,cateID:a.data.cateType}];case 3:throw new Error("Can't get app info")}}))})),function(e,t,n){return Ur.apply(this,arguments)});function zr(e){try{var t=e.map((function(e){return{action:e.action,error:e.error,message:e.message,data:e.data}}));Lr.execute(d.SEND_ACTION_LOG,"post",{appId:window.APP_ID,data:JSON.stringify(t)},(function(){})),window.zmpSentry&&window.zmpSentry.captureMessage("Result from native",{extra:{data:e}})}catch(e){}}var Wr=function(e){return e.replace(/[A-Z]/g,(function(e){return"_".concat(e.toLowerCase())}))},Fr=function(){var e,t,n=Number((null===(e=kn())||void 0===e?void 0:e.zaloVersion)||""),r=((null===(t=kn())||void 0===t?void 0:t.platformName)||"").toLowerCase();return"android"===r?n%1e4:n};function Gr(e,t){return null!=t&&"undefined"!=typeof Symbol&&t[Symbol.hasInstance]?!!t[Symbol.hasInstance](e):e instanceof t}var Hr,Vr,Kr=function(){function e(t,n,r,i){yr(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}(),Jr=function(e,t){return Gr(e,Kr)?function(e,t){return e.api=t,e.toJSON()}(e,t):function(e,t){return Gr(e,Error)?new Kr(h,e.message,t).toJSON():vr.isEmpty(null==e?void 0:e.message)||vr.isEmpty(null==e?void 0:e.code)?new Kr(h,E,t,e).toJSON():new Kr(e.code,e.message,t,e.detail).toJSON()}(e,t)},qr=(Hr=J((function(e){var t;return X(this,(function(n){switch(n.label){case 0:return t={headers:{"Content-Type":"application/x-www-form-urlencoded",authorization:"Bearer ".concat(e)}},[4,fetch(d.GET_AUTH_SETTING,xn({method:"GET"},t))];case 1:return[4,n.sent().json()];case 2:return[2,n.sent()]}}))})),function(e){return Hr.apply(this,arguments)}),$r=J((function(){return X(this,(function(e){return[2,new Promise(function(){var e=J((function(e,t){var n,r,i,o;return X(this,(function(a){switch(a.label){case 0:return a.trys.push([0,3,,4]),[4,ni.jumpAndGetToken()];case 1:return a.sent(),(r=null===(n=ni.miniProgramConfig)||void 0===n?void 0:n.jwt)||t(new Kr(y,P,"getSetting")),[4,qr(r)];case 2:return(i=a.sent())&&0===i.err?e({authSetting:i.data}):t(new Kr(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)}}())]}))})),Qr=function(){var t,n,r,i=kn(),o={},a=Ir.getInstance(),s=[],u=!1;return u||(n=function(e){var t=e.serialId,n=si(e.result),r=di(null==n?void 0:n.action),i=vr.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=vr.isEmpty(null==c?void 0:c.error_code)?0:null==c?void 0:c.error_code,a=null==c?void 0:c.error_message,u=(null==c?void 0:c.data)||c}var l={error_code:i,error_message:a,data:u,action:(null==n?void 0:n.action)||e.actionName};if(t&&o[t]){var d=o[t],p=d.callback,f=d.timeout,h=d.isMultiCallback,m=d.options;!function(e,t){var n=t||{},r=n.success,i=n.fail;0===e.error_code?vr.isFunction(r)&&r(e):vr.isFunction(i)&&i(e)}(l,p),!h&&delete o[t],f&&clearTimeout(f);var v={action:null==l?void 0:l.action,error:null==l?void 0:l.error_code,message:null==l?void 0:l.error_message,data:{}};try{if("action.open.inapp"===l.action||"action.open.outapp"===l.action){var y=new URL(null==m?void 0:m.url),g="".concat(y.protocol,"//").concat(y.host).concat(y.pathname);v.data={url:g}}if("action.follow.oa"===l.action||"action.unfollow.oa"===l.action){var _=null==m?void 0:m.uid;v.data={uid:_}}if("action.open.chat"===l.action){var w=null==m?void 0:m.uId,b=null==m?void 0:m.type;v.data={uid:w,openChatType:b}}}catch(e){}s.push(v)}},Ir.getInstance().on(kr,n),a.on(e.Events.AppPaused,(function(){if(s.length>0){var e=s;s=[],zr(e)}})),t?clearInterval(t):t=setInterval((function(){if(s.length>0){var e=s;s=[],zr(e)}}),5e3),u=!0),r=J((function(e,t,n,r){var a,s,u,c,l,d,p,f,h,m,v,w,b,T,E,P,O,I,C,N,M,x;return X(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,d=!1!==(null==r?void 0:r.timeout)&&((null==r?void 0:r.timeout)||!0),p=(null==r?void 0:r.haveCallback)||!1,f=(null==r?void 0:r.skipJump)||!1,h=(null==r?void 0:r.requireAccessToken)||!1,m=pi(c),t&&n&&(o[u]={options:t,callback:n,isMultiCallback:l},d&&p&&(o[u].timeout=setTimeout((function(){return Cr({serialId:u,result:{error_code:_,error_message:S,data:{timeout:d},action:e}}),null}),!0===d?8e3:1e3*d))),m?[4,$r()]:[3,2];case 1:if(!1===(null==(w=R.sent())||null===(v=w.authSetting)||void 0===v?void 0:v["scope.userInfo"]))return Cr({serialId:u,result:{error_code:y,error_message:k,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=di(c),!(null==i||null===(a=i.platform)||void 0===a?void 0:a.isMobile)||!e||vr.isUndefined(ZaloJavaScriptInterface)||i.platform.isIOS&&!oi(e)||T&&!1===T.isSupported?(Cr({serialId:u,result:{error_code:g,error_message:A,data:{isMobile:null==i||null===(E=i.platform)||void 0===E?void 0:E.isMobile},action:e}}),[2]):(P=ii(t),f?[3,4]:[4,ni.getJSAccessToken()]);case 3:return I=R.sent(),[3,5];case 4:I="",R.label=5;case 5:O=I,R.label=6;case 6:return R.trys.push([6,10,,11]),f||!h?[3,8]:[4,ni.getAccessToken()];case 7:return N=R.sent(),[3,9];case 8:N="",R.label=9;case 9:return C=N,[3,11];case 10:return M=R.sent(),Cr({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(O,c,C,P,x)]}}))})),function(e,t,n,i){return r.apply(this,arguments)}}(),Yr={success:function(e,t){return{code:f,message:t||T,data:e||{}}},error:{badRequest:function(e){return new Kr(m,e)},loginFailed:function(e){return new Kr(y,"".concat(O,": ").concat(e))},loginRequired:function(){return new Kr(y,P)},cannotGetShareInfo:function(){return new Kr(v,"Can not get app info to share")},createIAPOrderFailed:function(e){var t=Object.keys(V).find((function(t){return t===e.toString()}));return new Kr(e,t||E)},clientNotSupport:function(){return new Kr(g,A)}}},Xr=(Vr=function(t){var n,r,i,o=null===(n=kn())||void 0===n?void 0:n.platformName,a=t.action.replace("action.","").replace(/\./g,"_").toUpperCase(),s=M[a],u=(null==s?void 0:s.skipJump)||!1,c=(null==s?void 0:s.errorList)||{};if("JUMP_LOGIN"===a)return new Kr(h,"Can not get auth code: ".concat(t.error_message));if(ni.jumpStatus!==e.JumpStatus.DONE&&!u)return new Kr(N.UNAUTHORIZED.code,N.UNAUTHORIZED.message);if("permission required!"===String(t.error_message).toLowerCase()||"no permission!"===String(t.error_message).toLowerCase())return new Kr(N.FORBIDDEN.code,N.FORBIDDEN.message);if(o&&(null===(r=x[o])||void 0===r?void 0:r[t.error_code]))return new Kr(x[o][t.error_code].code,x[o][t.error_code].message);var l=null==c||null===(i=c[o])||void 0===i?void 0:i[String(t.error_code)];if(l){var d,p,f,m=null===(d=l.mapTo)||void 0===d?void 0:d.message;return(null==l?void 0:l.needMoreDetail)&&(m="".concat(null==l||null===(f=l.mapTo)||void 0===f?void 0:f.message,": ").concat(t.error_message)),new Kr(null===(p=l.mapTo)||void 0===p?void 0:p.code,m)}return new Kr(t.error_code,t.error_message)},function(e,t,r,i){var o=function(e,t){function r(r){return function(i){var o=vr.isEmpty(t)?void 0:t[r];if(o)return Cn({stage:n.RESPONSE,type:"log",state:r,name:e,response:i}),o("fail"===r?Vr(i):null==i?void 0:i.data)}}return vr.isUndefined(e)&&(e=""),Object.assign({},{success:r("success"),fail:r("fail")})}(e,r),a=M[e],s=(null==i?void 0:i.delay)||0;setTimeout((function(){Qr(e,t,o,xn({},i,a))}),s)}),ei=function(){var e=J((function(e){return X(this,(function(t){return[2,new Promise((function(t,n){Xr("MP_USER_AUTHORIZE",{scopes:e,forceUpdate:!0},{success:function(e){vr.isEmpty(e)||t(e)},fail:function(e){n(e)}},{isMultiCallback:!1,timeout:!1})}))]}))}));return function(t){return e.apply(this,arguments)}}(),ti=function(){function t(){yr(this,t),this._jumpStatus=void 0,this.WAITING_QUEUE=[],this.getAccessTokenCount=0,this._accessToken="",this._jsAccessToken="",this.refreshToken="",this._cookies=[],this.accessTokenExpiresIn=0,this.prevGetAccessTokenTimestamp=(new Date).getTime(),this.manualSetAccessToken=!1,this._miniProgramConfig={}}var r,a,u,c=t.prototype;return c.jump=function(){var t=this;return J((function(){return X(this,(function(r){return[2,new Promise((function(r,i){t._jumpStatus?t._jumpStatus===e.JumpStatus.DONE?r(e.JumpStatus.DONE):r(e.JumpStatus.DOING):(t._jumpStatus=e.JumpStatus.DOING,Cn({stage:n.REQUEST,type:"log",name:"jump"}),Qr("JUMP_LOGIN",{},{success:function(n){var i=n.data;t._miniProgramConfig=(null==i?void 0:i.miniProgramConfig)||{};var o=(null==i?void 0:i.cookiesOAuthLogins)||[],a=o.find((function(e){return e.name===l.JS_TOKEN}));a&&(t._jsAccessToken=a.value,window.ZJSBridge.setJSToken&&window.ZJSBridge.setJSToken(a.value)),t._cookies=o;var s=t._cookies.find((function(e){return e.name===l.ZOAUTH}));(null==s?void 0:s.value)||zr([{action:"action.jump.login",error:-102,message:"no zoauth",data:{}}]),r(e.JumpStatus.DONE)},fail:function(e){zr([{action:"action.jump.login",error:-101,message:e.message||"jump error",data:{}}]),i(e)}},{skipJump:!0}))}))]}))}))()},c.loginZaloV3=function(e,t,n){var r=this;return J((function(){var i;return X(this,(function(o){switch(o.label){case 0:return i="".concat(d.GET_ACCESS_TOKEN_V3,"?app_id=").concat(t,"&redirect_uri=").concat(s,"/").concat(e,"/&code=").concat(n,"&isSDK=true"),[4,fetch(i).then(function(){var e=J((function(e){var t,n,i;return X(this,(function(o){switch(o.label){case 0:return[4,e.json()];case 1:return t=o.sent(),n=null==t?void 0:t.access_token,r._accessToken=n,i=1e3*parseInt(t.expires_in),r.accessTokenExpiresIn=i,r.prevGetAccessTokenTimestamp=(new Date).getTime(),window.ZJSBridge.setZAccSession&&window.ZJSBridge.setZAccSession(r._accessToken||""),[2,n]}}))}));return function(t){return e.apply(this,arguments)}}())];case 1:return[2,o.sent()]}}))}))()},c.loginZaloV4=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",r=this;return J((function(){var i,o;return X(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),vr.isNull(r.refreshToken)||0===r.refreshToken.length?i.append("grant_type","authorization_code"):(i.append("grant_type","refresh_token"),i.append("refresh_token",r.refreshToken||"")),o={headers:{"Content-Type":"application/x-www-form-urlencoded"}},[4,fetch(d.GET_ACCESS_TOKEN,xn({method:"POST",body:i},o)).then(function(){var e=J((function(e){var t,n,i,o;return X(this,(function(a){switch(a.label){case 0:return[4,e.json()];case 1:return t=a.sent(),n=(null==t?void 0:t.access_token)||"",i=(null==t?void 0:t.refresh_token)||"",r.refreshToken=i,r._accessToken=n,o=1e3*parseInt(null==t?void 0:t.expires_in),r.accessTokenExpiresIn=o,r.prevGetAccessTokenTimestamp=(new Date).getTime(),window.ZJSBridge.setZAccSession&&window.ZJSBridge.setZAccSession(n),[2,n]}}))}));return function(t){return e.apply(this,arguments)}}())];case 1:return[2,a.sent()]}}))}))()},c.getAccessToken=function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=this;return J((function(){var n,r,a,s,u,c,d,p,f;function h(){return m.apply(this,arguments)}function m(){return(m=J((function(){return X(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 X(this,(function(m){switch(m.label){case 0:return r=(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&&r<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(l.ZOAUTH)]);case 3:return s=m.sent(),[4,t.jumpAndGetToken(l.ZOAUTH_VRF)];case 4:return u=m.sent(),c="zmp.getaccesstoken.fail",e?[4,t.verifyUserAuthorized()]:[3,6];case 5:return d=m.sent(),[3,7];case 6:d=!0,m.label=7;case 7:if(!d)throw a.getAccessTokenCount--,zr([{action:c,error:-104,message:"no user auth",data:{}}]),Yr.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(o,s,u)]:[3,10];case 9:return p=m.sent(),[3,12];case 10:return[4,t.loginZaloV3(o,i,s)];case 11:p=m.sent(),m.label=12;case 12:return[3,14];case 13:return f=m.sent(),p="",console.log("Can not get access token",f),zr([{action:c,error:-103,message:String(f)||"Can not get access token",data:{}}]),[3,14];case 14:return a.getAccessTokenCount--,p||zr([{action:c,error:-101,message:"no accessToken",data:{}}]),[2,Promise.resolve(t._accessToken)];case 15:throw a.getAccessTokenCount--,zr([{action:c,error:-102,message:"no oauth",data:{}}]),Yr.error.loginFailed("Zalo app has not been activated")}}))}))()},c.verifyUserAuthorized=function(){var e=this;return J((function(){var t,n,r,i,o,a;return X(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=di("action.mp.user.authorize"))&&r.isSupported?[4,$r()]:[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,ei()];case 3:a=s.sent(),n=(null==a?void 0:a["scope.userInfo"])||!1,s.label=4;case 4:return[3,6];case 5:return s.sent(),n=!1,[3,6];case 6:return[2,n]}}))}))()},c.setAccessToken=function(e){this.manualSetAccessToken=!0,this._accessToken=e,window.ZJSBridge.setZAccSession&&window.ZJSBridge.setZAccSession(e)},c.getJSAccessToken=function(){var e=this;return J((function(){var t;return X(this,(function(n){switch(n.label){case 0:return e._jsAccessToken.length>0?[2,Promise.resolve(e._jsAccessToken)]:[4,e.jumpAndGetToken(l.JS_TOKEN)];case 1:return t=n.sent(),[2,Promise.resolve(t)]}}))}))()},c.getSync=function(e){var t;return null===(t=this._cookies.find((function(t){return t.name===e})))||void 0===t?void 0:t.value},c.jumpAndGetToken=function(t){var n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=this;return new Promise(function(){var i=J((function(i){var o,a,s,u;return X(this,(function(c){switch(c.label){case 0:return!n&&r._cookies.length>0?vr.isString(t)?(o=r._cookies.find((function(e){return e.name===t})),[2,i(null==o?void 0:o.value)]):[2,i("")]:(n&&r._jumpStatus===e.JumpStatus.DONE&&(r._jumpStatus=void 0),a={name:t,cb:function(e){return i(e)}},[4,r.jump()]);case 1:return(s=c.sent())===e.JumpStatus.DONE?(r._jumpStatus=s,r.WAITING_QUEUE.length&&(r.WAITING_QUEUE.forEach((function(e){var t=r._cookies.find((function(t){return t.name===e.name}));e.cb(null==t?void 0:t.value)})),r.WAITING_QUEUE=[]),u=r._cookies.find((function(e){return e.name===a.name})),a.cb(null==u?void 0:u.value)):r.WAITING_QUEUE.push(a),[2]}}))}));return function(e){return i.apply(this,arguments)}}())},t.getInstance=function(){return t.instance||(t.instance=new t),t.instance},r=t,(a=[{key:"jumpStatus",get:function(){return this._jumpStatus}},{key:"accessToken",set:function(e){this._accessToken=e,window.ZJSBridge.setZAccSession&&window.ZJSBridge.setZAccSession(e)}},{key:"miniProgramConfig",get:function(){return this._miniProgramConfig}}])&&gr(r.prototype,a),u&&gr(r,u),t}(),ni=ti.getInstance(),ri=lr("zmp:utils:common"),ii=function(e){if(vr.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(ii(e[r]));return"["+t.join(",")+"]"}if("object"==typeof e){for(var i in t=[],e)t.push('"'+i+'":'+ii(e[i]));return"{"+t.join(",")+"}"}return e.toString()},oi=function(e){var t,n,r=M[e],i=(null===(t=kn())||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},ai=function(e){try{if(e){ri(e);var t=e.replace(/\\/g,"").replace(/&#39;/g,"'");try{t=decodeURIComponent(atob(e))}catch(e){}return ri("formattedValue",t,JSON.parse(t),cr(JSON.parse(t))),JSON.parse(t)}return null}catch(t){return ri("parse json error:",t),e}},si=function(e){if(vr.isObject(JSON)&&JSON.parse&&vr.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 vr.isObject(e)?e:new Function("return "+e)()},ui=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""},ci=function(e){return btoa(encodeURIComponent(JSON.stringify(e)))};var li=function(t){return"hidden"===t?e.StatusBarType.hidden:"transparent"===t?e.StatusBarType.transparent:e.StatusBarType.normal},di=function(e){if(void 0!==e){var t=ni.miniProgramConfig;return((null==t?void 0:t.dynamicApis)||[]).find((function(t){return t.action===e&&!1===t.clientHandle}))}},pi=function(e){if(void 0===e)return!1;var t=ni.miniProgramConfig;return((null==t?void 0:t.requiredAuthenList)||[]).indexOf(e)>=0},fi=function(){var e=J((function(){return X(this,(function(e){return[2,new Promise(function(){var e=J((function(e,t){var n;return X(this,(function(t){switch(t.label){case 0:return t.trys.push([0,2,,3]),[4,ni.jumpAndGetToken()];case 1:return t.sent(),n=ni.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 hi(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=Yr.error.badRequest(s);throw c.detail=a,Jr(c,e)}u.push(i.data)}));var c=r.apply(void 0,Y(u));return vr.isPromise(c)?new Promise((function(t,n){c.then((function(e){if(!vr.isNull(a)&&vr.isFunction(a))return a(e);t(c)})).catch((function(t){var r=Jr(t,e);if(!vr.isNull(s)&&vr.isFunction(s))return s(r);n(r)}))})):c}catch(t){if(!vr.isNull(s)&&vr.isFunction(s))return s(t);throw Jr(t,e)}}function mi(e){return vi.apply(this,arguments)}function vi(){return(vi=J((function(e){return X(this,(function(t){return[2,hi("login",[],[e],J((function(){return X(this,(function(e){switch(e.label){case 0:return In.isMp?[4,ni.jumpAndGetToken(l.ZOAUTH)]:[3,2];case 1:return e.sent(),[2,"Success"];case 2:return In.isMpWeb?[2,Promise.resolve("")]:[2,Promise.reject(Nn("login",{}))]}}))})))]}))}))).apply(this,arguments)}function yi(e){return gi.apply(this,arguments)}function gi(){return(gi=J((function(e){return X(this,(function(t){return[2,hi("getAccessToken",[],[e],J((function(){var e;return X(this,(function(t){switch(t.label){case 0:return In.isMp?[4,fi()]:[3,3];case 1:return e=!t.sent(),[4,ni.getAccessToken(e)];case 2:return[2,t.sent()||""];case 3:return In.isMpWeb?[2,Promise.resolve("")]:[2,Promise.reject(Nn("getAccessToken",{}))]}}))})))]}))}))).apply(this,arguments)}var _i="2.39.0";function wi(){return hi("getVersion",[],[],(function(){return _i}))}function bi(){var e,t;return{version:ui("version-id")||"",apiVersion:_i,zaloVersion:(null===(e=kn())||void 0===e?void 0:e.zaloVersion)||"",platform:(null===(t=kn())||void 0===t?void 0:t.platformName)||"",language:navigator.language,zaloLanguage:window.zLanguage||"vi",zaloTheme:window.zTheme||"light"}}function Ti(){return hi("getSystemInfo",[],[],(function(){return bi()}))}var Ei=function(){function t(){var e,n,r,i,a,u,c,l,d,p,f,h,m,v,y,g,_,w,b,T,E,S,P,O,A,k,I;yr(this,t),this.initConfig=window.APP_CONFIG;var C=vr.isString(null===(e=this.initConfig)||void 0===e||null===(n=e.app)||void 0===n?void 0:n.headerColor)&&(null===(r=this.initConfig)||void 0===r||null===(i=r.app)||void 0===i||null===(a=i.headerColor)||void 0===a?void 0:a.length)>0?W:F;this.hideIOSSafeAreaBottom=!!(null===(u=this.initConfig)||void 0===u||null===(c=u.app)||void 0===c?void 0:c.hideIOSSafeAreaBottom),this.hideAndroidBottomNavigationBar=!!(null===(l=this.initConfig)||void 0===l||null===(d=l.app)||void 0===d?void 0:d.hideAndroidBottomNavigationBar);var N,M,x="none"===(null===(p=this.initConfig)||void 0===p||null===(f=p.app)||void 0===f?void 0:f.leftButton)||"home"===(null===(h=this.initConfig)||void 0===h||null===(m=h.app)||void 0===m?void 0:m.leftButton)?z.HIDE_BACK:z.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)?z.SHOW_HOME:z.HIDE_HOME,D=new URL(location.href),j=li(null===(w=this.initConfig)||void 0===w||null===(b=w.app)||void 0===b?void 0:b.statusBar);"boolean"==typeof(null===(T=this.initConfig)||void 0===T||null===(E=T.app)||void 0===E?void 0:E.actionBarHidden)&&(C=(null===(N=this.initConfig)||void 0===N||null===(M=N.app)||void 0===M?void 0:M.actionBarHidden)?F:W);this.config={actionbarType:C,buttonType:x,statusbarType:j,dataConfig:{backgroundColor:(null===(S=this.initConfig)||void 0===S||null===(P=S.app)||void 0===P?void 0:P.headerColor)||G,textColor:(null===(O=this.initConfig)||void 0===O||null===(A=O.app)||void 0===A?void 0:A.textColor)||"",textAlign:(null===(k=this.initConfig)||void 0===k||null===(I=k.app)||void 0===I?void 0:I.textAlign)||H,viewInLeftType:x,confirmToExit:1},homeConfig:{enable:R,url:"".concat(s,"/").concat(o,"/").concat(D.search)}}}var n=t.prototype;return n.setNavigationBarTitle=function(e){return J((function(){return X(this,(function(t){return[2,new Promise((function(t,n){Xr("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 J((function(){var r,i;return X(this,(function(o){return void 0===(void 0===e?"undefined":cr(e))&&null===(void 0===e?"undefined":cr(e))||(r="none"===e||"home"===e?z.HIDE_BACK:z.SHOW_BACK,i="home"===e||"both"===e?z.SHOW_HOME:z.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){Xr("CHANGE_ACTIONBAR_LEFTBUTTON_TYPE",xn({},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 J((function(){var r,i,o;return X(this,(function(a){return i=t?e.AndroidBottomNavigationBarType.hide:e.AndroidBottomNavigationBarType.show,o=null===(r=kn())||void 0===r?void 0:r.platform,[2,new Promise((function(e,r){if(!(null==o?void 0:o.isAndroid))return e();Xr("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 J((function(){var r,i,o;return X(this,(function(a){return i=t?e.IOSSafeAreaBottomType.hide:e.IOSSafeAreaBottomType.show,o=null===(r=kn())||void 0===r?void 0:r.platform,[2,new Promise((function(e,r){if(!(null==o?void 0:o.isIOS))return e();Xr("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 J((function(){var r;return X(this,(function(i){return r=n.config,vr.isString(t.headerColor)&&(r.dataConfig.backgroundColor=t.headerColor),vr.isString(t.headerTextColor)&&(r.dataConfig.textColor=t.headerTextColor),vr.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=F:!1===t.hideActionBar&&(r.actionbarType=W),"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){Xr("CHANGE_ACTIONBAR",xn({},r),{success:function(){var o;n.config=xn({},r);var a,s=null===(o=kn())||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===F;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}(),Si=Ei.getInstance(),Pi=[Mt({title:gt()}).optional()];function Oi(e){return Ai.apply(this,arguments)}function Ai(){return Ai=J((function(e){return X(this,(function(t){return[2,hi("setNavigationBarTitle",Pi,[e],function(){var e=J((function(e){return X(this,(function(t){switch(t.label){case 0:return In.isMp?[4,Si.setNavigationBarTitle(e.title)]:[3,2];case 1:return[2,t.sent()];case 2:return In.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Nn("setNavigationBarTitle",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Ai.apply(this,arguments)}var ki=[Mt({color:gt(),textColor:En.enum(["black","white"]).optional(),statusBarColor:gt().optional()}).optional()];function Ii(e){return Ci.apply(this,arguments)}function Ci(){return Ci=J((function(e){return X(this,(function(t){return[2,hi("setNavigationBarColor",ki,[e],function(){var e=J((function(e){return X(this,(function(t){switch(t.label){case 0:return In.isMp?[4,Si.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 In.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Nn("setNavigationBarColor",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Ci.apply(this,arguments)}var Ni=[Mt({type:En.enum(["none","back","home","both"])}).optional()];function Mi(e){return xi.apply(this,arguments)}function xi(){return xi=J((function(e){return X(this,(function(t){return[2,hi("setNavigationBarLeftButton",Ni,[e],function(){var e=J((function(e){return X(this,(function(t){switch(t.label){case 0:return In.isMp?[4,Si.setNavigationBarLeftButton(e.type)]:[3,2];case 1:return[2,t.sent()];case 2:return In.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Nn("setNavigationBarLeftButton",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),xi.apply(this,arguments)}function Ri(e,t,n){if(!t.has(e))throw new TypeError("attempted to "+n+" private field on non-instance");return t.get(e)}function Di(e,t){return function(e,t){return t.get?t.get.call(e):t.value}(e,Ri(e,t,"get"))}function ji(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 Ui(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,Ri(e,t,"set"),n),n}var Bi,Li,Zi,zi=new WeakMap,Wi=new WeakMap,Fi=new WeakMap,Gi=function(){function e(t){yr(this,e),ji(this,zi,{writable:!0,value:localStorage}),ji(this,Wi,{writable:!0,value:void 0}),ji(this,Fi,{writable:!0,value:void 0}),Ui(this,Fi,{keys:new Set,currentSize:0,limitSize:D}),Ui(this,Wi,t),this.findAllCurrentDataByApp(t)}var t=e.prototype;return t.findAllCurrentDataByApp=function(e){try{var t;for(t in Di(this,zi)){if(e)if(t.split("_")[0]!==e)continue;Di(this,Fi).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 Di(this,Wi)&&(e="".concat(Di(this,Wi),"_").concat(e)),Di(this,Fi).keys.has(e)?Di(this,zi).getItem(e):null},t.set=function(e){var t=this;return J((function(){return X(this,(function(n){return Object.entries(e).forEach((function(e){var n=Rn(e,2),r=n[0],i=n[1];t.setSync(r,i.replace(/\\"/g,'"'))})),[2,Promise.resolve({errorKeys:[]})]}))}))()},t.setSync=function(e,t){Di(this,Wi)&&(e="".concat(Di(this,Wi),"_").concat(e)),Di(this,zi).setItem(e,t),Di(this,Fi).keys.add(e)},t.getInfo=function(){var e=this;return J((function(){return X(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}(Di(this,zi),Di(this,Wi));return{currentSize:vr.isNumber(e)?Number((e/1024).toFixed(2)):0,limitSize:Number((D/1024).toFixed(2))}},t.remove=function(e){var t=this;return J((function(){return X(this,(function(n){return e.forEach((function(e){t.removeSync(e)})),[2,Promise.resolve({errorKeys:[]})]}))}))()},t.removeSync=function(e){Di(this,Wi)&&(e="".concat(Di(this,Wi),"_").concat(e)),Di(this,Fi).keys.has(e)&&(Di(this,zi).removeItem(e),Di(this,Fi).keys.delete(e))},t.clear=function(){var e=this;return J((function(){return X(this,(function(t){return[2,Promise.resolve(e.clearSync())]}))}))()},t.clearSync=function(){var e=this;Di(this,Fi).keys.forEach((function(t){Di(e,Wi)&&t.indexOf(Di(e,Wi))<0||(Di(e,zi).removeItem(t),Di(e,Fi).keys.delete(t))}))},e}(),Hi=new WeakMap,Vi=new WeakMap,Ki=function(){function e(t){yr(this,e),ji(this,Hi,{writable:!0,value:void 0}),ji(this,Vi,{writable:!0,value:void 0}),Ui(this,Vi,{keys:new Set,currentSize:0,limitSize:D}),Ui(this,Hi,t)}var t=e.prototype;return t.get=function(e){var t=this;return J((function(){return X(this,(function(n){return[2,new Promise((function(n,r){Xr("ZBROWSER_MPDS",{mpds_action:"mpds.get",mpds_data:{keys:e},appId:Di(t,Hi)},{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 J((function(){return X(this,(function(n){return[2,new Promise((function(n,r){Xr("ZBROWSER_MPDS",{mpds_action:"mpds.set",mpds_data:{map:e},appId:Di(t,Hi)},{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 J((function(){return X(this,(function(t){return[2,new Promise((function(t,n){Xr("ZBROWSER_MPDS",{mpds_action:"mpds.get.size",mpds_data:{},appId:Di(e,Hi)},{success:function(e){var n=0;e&&e.mpds_data&&e.mpds_data.size&&(n=e.mpds_data.size),t({currentSize:vr.isNumber(n)?Number(Number(n)/1024):0,limitSize:Number(D/1024)})},fail:function(e){n(e)}},{isMultiCallback:!1})}))]}))}))()},t.remove=function(e){var t=this;return J((function(){return X(this,(function(n){return[2,new Promise((function(n,r){Xr("ZBROWSER_MPDS",{mpds_action:"mpds.remove.key",mpds_data:{keys:e},appId:Di(t,Hi)},{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 J((function(){return X(this,(function(t){return[2,new Promise((function(t,n){Xr("ZBROWSER_MPDS",{mpds_action:"mpds.clear.appData",mpds_data:{},appId:Di(e,Hi)},{success:function(){t()},fail:function(e){n(e)}},{isMultiCallback:!1})}))]}))}))()},e}(),Ji=function(){function e(){yr(this,e)}var t=e.prototype;return t.getDataFromStorage=function(e){var t=this;return J((function(){var n,r;return X(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]=ai(e)})),[2,r]}}))}))()},t.putDataToStorage=function(e){var t=this;return J((function(){var n,r;return X(this,(function(i){switch(i.label){case 0:return n=t.getInstance(),r={},Object.entries(e).forEach((function(e){var t=Rn(e,2),n=t[0],i=t[1];vr.isUndefined(i)||vr.isNull(i)||(r[n]=ci(i))})),[4,n.set(r)];case 1:return[2,i.sent()]}}))}))()},t.removeDataFromStorage=function(e){var t=this;return J((function(){return X(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 J((function(){return X(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 J((function(){return X(this,(function(t){switch(t.label){case 0:return[4,e.getInstance().getInfo()];case 1:return[2,t.sent()]}}))}))()},e}(),qi=new WeakMap,$i=function(e){Sr(n,e);var t=Or(n);function n(e){var r;return yr(this,n),ji(Pr(r=t.call(this)),qi,{writable:!0,value:void 0}),Ui(Pr(r),qi,e),r}return n.prototype.getInstance=function(){return new Gi(Di(this,qi))},n}(Ji),Qi=new WeakMap,Yi=function(e){Sr(n,e);var t=Or(n);function n(e){var r;return yr(this,n),ji(Pr(r=t.call(this)),Qi,{writable:!0,value:void 0}),Ui(Pr(r),Qi,e),r}return n.prototype.getInstance=function(){return new Ki(Di(this,Qi))},n}(Ji),Xi=new $i(o),eo=(null===(Bi=kn())||void 0===Bi?void 0:Bi.zaloVersion)||"",to=(null===(Li=kn())||void 0===Li?void 0:Li.platformName)||"unknown";!!vr.isString(eo)&&parseInt(eo,10)>={android:12100571,iOS:400,wp:0,unknown:0}[to]&&(null===(Zi=kn())||void 0===Zi?void 0:Zi.appEnv.isMp)&&(Xi=new Yi(o));var no=Xi,ro=[Mt({data:En.record(gt(),En.any())}).optional()];function io(e){return oo.apply(this,arguments)}function oo(){return oo=J((function(e){return X(this,(function(t){return[2,hi("setStorage",ro,[e],function(){var e=J((function(e){return X(this,(function(t){switch(t.label){case 0:return In.isMp||In.isMpWeb?[4,no.putDataToStorage(e.data)]:[3,2];case 1:return[2,t.sent()];case 2:return[2,Promise.reject(Nn("setStorage",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),oo.apply(this,arguments)}var ao=[Mt({keys:En.array(gt())}).optional()];function so(e){return uo.apply(this,arguments)}function uo(){return uo=J((function(e){return X(this,(function(t){return[2,hi("getStorage",ao,[e],function(){var e=J((function(e){return X(this,(function(t){switch(t.label){case 0:return In.isMp||In.isMpWeb?[4,no.getDataFromStorage(e.keys)]:[3,2];case 1:return[2,t.sent()];case 2:return[2,Promise.reject(Nn("getStorage",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),uo.apply(this,arguments)}function co(e){return lo.apply(this,arguments)}function lo(){return(lo=J((function(e){return X(this,(function(t){return[2,hi("getStorageInfo",[],[e],J((function(){return X(this,(function(e){switch(e.label){case 0:return In.isMp||In.isMpWeb?[4,no.getStorageInfo()]:[3,2];case 1:return[2,e.sent()];case 2:return[2,Promise.reject(Nn("getStorageInfo",{}))]}}))})))]}))}))).apply(this,arguments)}var po=[Mt({keys:En.array(gt())}).optional()];function fo(e){return ho.apply(this,arguments)}function ho(){return ho=J((function(e){return X(this,(function(t){return[2,hi("removeStorage",po,[e],function(){var e=J((function(e){return X(this,(function(t){switch(t.label){case 0:return In.isMp||In.isMpWeb?[4,no.removeDataFromStorage(e.keys)]:[3,2];case 1:return[2,t.sent()];case 2:return[2,Promise.reject(Nn("removeStorage",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),ho.apply(this,arguments)}var mo=[Mt({prefix:gt().optional()}).optional()];function vo(e){return yo.apply(this,arguments)}function yo(){return(yo=J((function(e){return X(this,(function(t){return[2,hi("clearStorage",mo,[e],J((function(){return X(this,(function(e){switch(e.label){case 0:return In.isMp||In.isMpWeb?[4,no.clearStorage()]:[3,2];case 1:return[2,e.sent()];case 2:return[2,Promise.reject(Nn("clearStorage",{}))]}}))})))]}))}))).apply(this,arguments)}var go=function(){var e=J((function(e,t){var n,r,i,a;return X(this,(function(s){switch(s.label){case 0:return(r=t)?[3,2]:[4,fi()];case 1:r=!s.sent(),s.label=2;case 2:return n=r,[4,ni.getAccessToken(n)];case 3:return i=s.sent(),a="id,name,user_id_by_oa,is_sensitive",a=e?"".concat(a,",picture.type(").concat(e,")"):"".concat(a,",picture"),[4,fetch("".concat(d.GET_USER_INFO,"?fields=").concat(a,"&miniapp_id=").concat(o),{headers:{access_token:i||""}}).then(function(){var e=J((function(e){var t,n,r,i;return X(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 4:return[2,s.sent()]}}))}));return function(t,n){return e.apply(this,arguments)}}(),_o=[Mt({avatarType:En.enum(["small","normal","large"]).optional(),autoRequestPermission:En.boolean().default(!1).optional()}).optional()];function wo(e){return bo.apply(this,arguments)}function bo(){return bo=J((function(e){return X(this,(function(t){return[2,hi("getUserInfo",_o,[e],function(){var e=J((function(e){var t,n;return X(this,(function(r){switch(r.label){case 0:return In.isMp?(t=null==e?void 0:e.avatarType,n=null==e?void 0:e.autoRequestPermission,[4,go(t,n)]):[3,2];case 1:return[2,{userInfo:r.sent()}];case 2:return In.isMpWeb?[2,Promise.resolve({userInfo:{id:"3368637342326461234",name:"User Name",avatar:"https://h5.zdn.vn/static/images/avatar.png"}})]:[2,Promise.reject(Nn("getUserInfo",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),bo.apply(this,arguments)}var To=function(e){return{NONE:e?-2:0,WIFI:e?0:1,"2G":2,"3G":e?15:2,"4G":e?13:2}},Eo=J((function(){return X(this,(function(t){return[2,new Promise((function(t,n){Xr("WEBVIEW_NETWORKTYPE",{url:window.location.href,featureId:""},{success:function(n){var r,i,o,a=n.network,s=(null===(r=kn())||void 0===r||null===(i=r.platform)||void 0===i?void 0:i.isAndroid)||!1;switch(a){case To(s).NONE:o=e.NetworkType.none;break;case To(s).WIFI:o=e.NetworkType.wifi;break;case To(s)["2G"]:case To(s)["3G"]:case To(s)["4G"]:o=e.NetworkType.cellular;break;default:o=e.NetworkType.unknown}t(o)},fail:function(e){n(e)}},{})}))]}))}));function So(e){return Po.apply(this,arguments)}function Po(){return(Po=J((function(t){return X(this,(function(n){return[2,hi("getNetworkType",[],[t],J((function(){var t,n;return X(this,(function(r){switch(r.label){case 0:return In.isMp?[4,Eo()]:[3,2];case 1:return[2,{networkType:r.sent()}];case 2:if(In.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(Nn("getNetworkType",{}))]}}))})))]}))}))).apply(this,arguments)}var Oo=[En.function().args(Mt({isConnected:En.boolean(),networkType:En.enum(["none","wifi","cellular","unknown"])})).returns(En.void())];function Ao(t){return hi("onNetworkStatusChange",Oo,[t],(function(t){var n=t;if(In.isMp)!function(t){Ir.getInstance().on(e.Events.NetworkChanged,(function(e){var n=null==e?void 0:e.state;Eo().then((function(e){t({isConnected:"CONNECTED"===n,networkType:e})}))}))}(n);else if(In.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 ko=function(){var e=J((function(e){var t,n,r,i,o,a;return X(this,(function(s){return a={subaction:0,scanning_type:vr.isNumber(null==e?void 0:e.scanningType)?e.scanningType:0,data:{scan_from_source:vr.isString(null==e?void 0:e.scanFromSource)?e.scanFromSource:"",expire:vr.isNumber(null==e?void 0:e.expire)?e.expire:3e3,monitor_interval:vr.isNumber(null==e?void 0:e.monitorInterval)?e.monitorInterval:60,domain:vr.isString(null==e?void 0:e.domain)?e.domain:"",scan_config:{scan_time:vr.isNumber(null==e||null===(t=e.scanConfig)||void 0===t?void 0:t.scanTime)?e.scanConfig.scanTime:15e3,time_between_scan:vr.isNumber(null==e||null===(n=e.scanConfig)||void 0===n?void 0:n.timeBetweenScan)?e.scanConfig.timeBetweenScan:1e4,beacon_timeout:vr.isNumber(null==e||null===(r=e.scanConfig)||void 0===r?void 0:r.beaconTimeout)?e.scanConfig.beaconTimeout:3e4,delayCheckConnectedTimeout:vr.isNumber(null==e||null===(i=e.scanConfig)||void 0===i?void 0:i.delayCheckConnectedTimeout)?e.scanConfig.delayCheckConnectedTimeout:5e3,beaconConnectedTimeout:vr.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){Xr("SCAN_IBEACON",xn({},a),{success:function(){e(!0)},fail:function(e){t(e)}},{})}))]}))}));return function(t){return e.apply(this,arguments)}}(),Io=[Mt({scanningType:En.number().refine((function(e){return[0,1].includes(e)}),{message:"The type must be either 0 or 1"}).default(0).optional(),expire:En.number().optional(),monitorInterval:En.number().optional(),domain:En.string().optional(),scanConfig:Mt({scanTime:En.number().optional(),timeBetweenScan:En.number().optional(),beaconTimeout:En.number().optional(),delayCheckConnectedTimeout:En.number().optional(),beaconConnectedTimeout:En.number().optional()}).optional(),items:En.array(Mt({id:En.string().optional(),distance:En.number().optional(),monitor:Mt({enable:En.boolean().optional(),movingRange:En.number().optional()}).optional()})).optional(),scanFromSource:En.string().optional()}).optional()];function Co(e){return No.apply(this,arguments)}function No(){return(No=J((function(e){return X(this,(function(t){return[2,hi("startBeaconDiscovery",Io,[e],J((function(){return X(this,(function(t){switch(t.label){case 0:return In.isMp?[4,ko(e)]:[3,2];case 1:return[2,t.sent()];case 2:return In.isMpWeb?[2,Promise.resolve(!0)]:[2,Promise.reject(Nn("startBeaconDiscovery",{}))]}}))})))]}))}))).apply(this,arguments)}var Mo=J((function(){return X(this,(function(e){return[2,new Promise((function(e,t){Xr("SCAN_IBEACON",{subaction:2},{success:function(){e(!0)},fail:function(e){t(e)}},{})}))]}))}));function xo(e){return Ro.apply(this,arguments)}function Ro(){return(Ro=J((function(e){return X(this,(function(t){return[2,hi("stopBeaconDiscovery",[],[e],J((function(){return X(this,(function(e){switch(e.label){case 0:return In.isMp?[4,Mo()]:[3,2];case 1:return[2,e.sent()];case 2:return In.isMpWeb?[2,Promise.resolve(!0)]:[2,Promise.reject(Nn("stopBeaconDiscovery",{}))]}}))})))]}))}))).apply(this,arguments)}var Do=J((function(){return X(this,(function(e){return[2,new Promise((function(e,t){Xr("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 jo(e){return Uo.apply(this,arguments)}function Uo(){return(Uo=J((function(e){return X(this,(function(t){return[2,hi("getBeacons",[],[e],J((function(){return X(this,(function(e){switch(e.label){case 0:return In.isMp?[4,Do()]:[3,2];case 1:return[2,e.sent()];case 2:return In.isMpWeb?[2,Promise.resolve({beacons:[]})]:[2,Promise.reject(Nn("getBeacons",{}))]}}))})))]}))}))).apply(this,arguments)}var Bo=J((function(){return X(this,(function(e){return[2,new Promise((function(e,t){Xr("WINDOW_CLOSE",{},{success:function(t){e(t)},fail:function(e){t(e)}},{})}))]}))}));function Lo(e){return Zo.apply(this,arguments)}function Zo(){return(Zo=J((function(e){return X(this,(function(t){return[2,hi("closeApp",[],[e],J((function(){return X(this,(function(e){switch(e.label){case 0:return In.isMp?[4,Bo()]:[3,2];case 1:return[2,e.sent()];case 2:return In.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Nn("closeApp",{}))]}}))})))]}))}))).apply(this,arguments)}var zo=J((function(){return X(this,(function(e){return[2,new Promise((function(e,t){Xr("OPEN_QR",{skipOpenLink:!0},{success:function(t){e(t)},fail:function(e){t(e)}},{})}))]}))}));function Wo(e){return Fo.apply(this,arguments)}function Fo(){return(Fo=J((function(e){return X(this,(function(t){return[2,hi("scanQRCode",[],[e],J((function(){return X(this,(function(e){switch(e.label){case 0:return In.isMp?[4,zo()]:[3,2];case 1:return[2,e.sent()];case 2:return In.isMpWeb?[2,Promise.resolve({content:""})]:[2,Promise.reject(Nn("scanQRCode",{}))]}}))})))]}))}))).apply(this,arguments)}var Go=function(){var t=J((function(t,n,r,o){return X(this,(function(a){return[2,new Promise((function(a,s){Xr("OPEN_PROFILE",{uId:t,type:e.ProfileType[n],zapp:i,sourceId:r,sourceIndex:o},{success:function(){a()},fail:function(e){s(e)}},{})}))]}))}));return function(e,n,r,i){return t.apply(this,arguments)}}(),Ho=[Mt({id:gt(),type:En.enum(["user","oa","aliasOA"]),sourceId:En.any().optional(),sourceIndex:En.any().optional()}).optional()];function Vo(e){return Ko.apply(this,arguments)}function Ko(){return Ko=J((function(e){return X(this,(function(t){return[2,hi("openProfile",Ho,[e],function(){var e=J((function(e){var t,n,r,i;return X(this,(function(o){switch(o.label){case 0:return In.isMp?(t=e.id,n=e.type,r=e.sourceId,i=e.sourceIndex,[4,Go(t,n,r,i)]):[3,2];case 1:return[2,o.sent()];case 2:return In.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Nn("openProfile",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Ko.apply(this,arguments)}var Jo=function(){var t=J((function(t,n){var r,o,a,s=arguments;return X(this,(function(u){return r=s.length>2&&void 0!==s[2]?s[2]:"",o=s.length>3?s[3]:void 0,a=s.length>4?s[4]:void 0,[2,new Promise((function(s,u){Xr("OPEN_CHAT",{uId:t,type:e.ChatType[n],msg:r,zapp:i,sourceId:o,sourceIndex:a},{success:function(){s()},fail:function(e){u(e)}},{})}))]}))}));return function(e,n){return t.apply(this,arguments)}}(),qo=[Mt({id:gt(),type:En.enum(["user","oa"]),sourceId:En.any().optional(),sourceIndex:En.any().optional(),message:gt().optional()}).optional()];function $o(e){return Qo.apply(this,arguments)}function Qo(){return Qo=J((function(e){return X(this,(function(t){return[2,hi("openChat",qo,[e],function(){var e=J((function(e){var t,n,r,i,o;return X(this,(function(a){switch(a.label){case 0:return In.isMp?(t=e.id,n=e.type,r=e.message,i=e.sourceId,o=e.sourceIndex,[4,Jo(t,n,r,i,o)]):[3,2];case 1:return[2,a.sent()];case 2:return In.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Nn("openChat",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Qo.apply(this,arguments)}function Yo(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 Xo=function(){var t=J((function(t,n){var r;return X(this,(function(o){switch(r={},t){case"image":r={photoUrl:null==n?void 0:n.imageUrl};break;case"link":r={link:null==n?void 0:n.link,title:null==n?void 0:n.title,thumb:null==n?void 0:n.thumb,description:null==n?void 0:n.description};break;case"profile":r={avt:null==n?void 0:n.avatar,uid:null==n?void 0:n.id,dpn:null==n?void 0:n.displayName}}return[2,new Promise((function(n,o){Xr("OPEN_POSTFEED",Yo(xn({type:e.PostFeedType[t]},r),{zapp:i}),{success:function(e){n({status:null==e?void 0:e.status,shareType:null==e?void 0:e.share_type,numberOfUser:null==e?void 0:e.uid_to_size})},fail:function(e){o(e)}},{})}))]}))}));return function(e,n){return t.apply(this,arguments)}}(),ea=[En.union([Mt({type:En.enum(["image"]),data:Mt({imageUrl:gt().url().optional()})}),Mt({type:En.enum(["link"]),data:Mt({link:gt().url(),title:gt().max(100).optional(),thumb:gt().url().optional(),description:gt().max(400).default("").optional()})}),Mt({type:En.enum(["profile"]),data:Mt({id:gt().optional()})})])];function ta(e){return na.apply(this,arguments)}function na(){return na=J((function(e){return X(this,(function(t){return[2,hi("openPostFeed",ea,[e],function(){var e=J((function(e){var t,n;return X(this,(function(r){switch(r.label){case 0:return In.isMp?(t=e.type,n=e.data,[4,Xo(t,n)]):[3,2];case 1:return[2,r.sent()];case 2:return In.isMpWeb?[2,Promise.resolve({status:1,shareType:0,numberOfUser:0})]:[2,Promise.reject(Nn("openPostFeed",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),na.apply(this,arguments)}var ra=function(){var e=J((function(e){return X(this,(function(t){return[2,new Promise((function(t,n){Xr("FOLLOW_OA",{uid:e,showDialogConfirm:!0,forceUpdate:!0,zapp:i},{success:function(e){t(e)},fail:function(e){n(e)}},{timeout:!1})}))]}))}));return function(t){return e.apply(this,arguments)}}(),ia=[Mt({id:gt(),showDialogConfirm:En.boolean().optional()}).optional()];function oa(e){return aa.apply(this,arguments)}function aa(){return aa=J((function(e){return X(this,(function(t){return[2,hi("followOA",ia,[e],function(){var e=J((function(e){var t;return X(this,(function(n){switch(n.label){case 0:return In.isMp?(t=e.id,[4,ra(t)]):[3,2];case 1:return[2,n.sent()];case 2:return In.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Nn("followOA",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),aa.apply(this,arguments)}var sa=function(){var e=J((function(e){return X(this,(function(t){return[2,new Promise((function(t,n){Xr("UNFOLLOW_OA",{uid:e,forceUpdate:!0,zapp:i},{success:function(){t()},fail:function(e){n(e)}},{})}))]}))}));return function(t){return e.apply(this,arguments)}}(),ua=[Mt({id:gt()}).optional()];function ca(e){return la.apply(this,arguments)}function la(){return la=J((function(e){return X(this,(function(t){return[2,hi("unfollowOA",ua,[e],function(){var e=J((function(e){var t;return X(this,(function(n){switch(n.label){case 0:return In.isMp?(t=e.id,[4,sa(t)]):[3,2];case 1:return[2,n.sent()];case 2:return In.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Nn("unfollowOA",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),la.apply(this,arguments)}var da=function(){var e=J((function(e,t,n,r,i,o){var s,u,l,p,f,h;return X(this,(function(m){switch(m.label){case 0:return s=new URL(location.href),u=new URLSearchParams,l="".concat(s.pathname.replace(c,"")).concat(s.search),o&&(l="/".concat(e).concat("/"===o[0]?"":"/").concat(o)),p=new URL("".concat(a).concat(l)),u.append("title",n),u.append("description",r||""),u.append("thumbnail",i||""),u.append("url",p.href),u.append("accessToken",t||""),f={headers:{"Content-Type":"application/x-www-form-urlencoded"}},[4,fetch(d.CREATE_SHARE_LINK,xn({method:"POST",body:u},f))];case 1:return[4,m.sent().json()];case 2:if(!(h=m.sent())||0!==h.err)throw Yr.error.cannotGetShareInfo();return p.search="".concat(p.search,"&zshareId=").concat(h.data.shareId),[2,Yo(xn({},h.data),{shareableLink:p.href})]}}))}));return function(t,n,r,i,o,a){return e.apply(this,arguments)}}(),pa=function(){var t=J((function(t,n){var r,a,s,u,c,l,d,p,f,h,m,v;return X(this,(function(y){switch(y.label){case 0:switch(r={},a=t,t){case"text":return[3,1];case"image":return[3,2];case"gif":return[3,3];case"video":return[3,4];case"link":return[3,5];case"oa":return[3,6];case"zmp":return[3,7];case"zmp_deep_link":return[3,10]}return[3,13];case 1:return r={text:null==n?void 0:n.text,desc:null==n?void 0:n.desc,autoParseLink:(null==n?void 0:n.autoParseLink)?1:0},[3,14];case 2:return l=[],d=(null===(u=kn())||void 0===u?void 0:u.zaloVersion)||0,p=(null===(c=kn())||void 0===c?void 0:c.platformName)||"unknown",Number(d)>=R[p]&&(a="multi_image"),Array.isArray(null==n?void 0:n.imageUrls)&&(null==n?void 0:n.imageUrls.length)>0?l=null==n?void 0:n.imageUrls:l.push(null==n?void 0:n.imageUrl),r={photoUrls:l,photoUrl:null==n?void 0:n.imageUrl,caption:null==n?void 0:n.caption},[3,14];case 3:return r={photoUrl:null==n?void 0:n.imageUrl,gifUrl:null==n?void 0:n.gifUrl,width:null==n?void 0:n.width,height:null==n?void 0:n.height},[3,14];case 4:return r={videoThumb:null==n?void 0:n.videoThumb,videoUrl:null==n?void 0:n.videoUrl,width:null==n?void 0:n.width,height:null==n?void 0:n.height},[3,14];case 5:return r={link:null==n?void 0:n.link,chatOnly:(null==n?void 0:n.chatOnly)?1:0},[3,14];case 6:return r={uid:null==n?void 0:n.id},[3,14];case 7:case 10:return[4,ni.getAccessToken()];case 8:case 11:return s=y.sent(),[4,da(o,s||"",(null==n?void 0:n.title)||"",(null==n?void 0:n.description)||"",(null==n?void 0:n.thumbnail)||"",null==n?void 0:n.path)];case 9:return f=y.sent(),r={data:{ZInstantAPIInfo:{url:"".concat(f.zinstantApi),zinstantdata_id:"templateId=".concat(f.ztemplateId,"&appId=").concat(o,"&shareId=").concat(f.shareId)},previewMsgText:{msg:{en:"Zalo Mini Program",vi:"Chương trình nhỏ"}},enableReactions:1}},[3,14];case 12:return h=y.sent().shareableLink,m=new URL(h),v=m.searchParams.getAll("zshareId"),m.searchParams.delete("zshareId"),v.length>0&&m.searchParams.append("zshareId",v[0]),r={link:m.href,chatOnly:0},[3,14];case 13:return[3,14];case 14:return[2,new Promise((function(t,n){Xr("OPEN_SHARESHEET",Yo(xn({type:e.ShareSheetType[a]},r),{zapp:i}),{success:function(e){t({status:null==e?void 0:e.status,shareType:null==e?void 0:e.share_type,numberOfUser:null==e?void 0:e.uid_to_size})},fail:function(e){n(e)}},{timeout:!1})}))]}}))}));return function(e,n){return t.apply(this,arguments)}}(),fa=[En.union([Mt({type:En.enum(["text"]),data:Mt({text:gt(),desc:gt().optional(),autoParseLink:En.boolean().default(!1).optional()})}),Mt({type:En.enum(["image"]),data:Mt({imageUrl:gt().url(),imageUrls:En.array(gt().url()).max(10).optional()})}),Mt({type:En.enum(["link"]),data:Mt({link:gt().url(),chatOnly:En.boolean().optional()})}),Mt({type:En.enum(["oa"]),data:Mt({id:gt()})}),Mt({type:En.enum(["gif"]),data:Mt({gifUrl:gt().url(),imageUrl:gt().url().optional(),width:_t().min(0).optional(),height:_t().min(0).optional()})}),Mt({type:En.enum(["video"]),data:Mt({videoThumb:gt().url(),videoUrl:gt().url(),width:_t().min(0).optional(),height:_t().min(0).optional()})}),Mt({type:En.enum(["zmp","zmp_deep_link"]),data:Mt({title:gt().max(100),thumbnail:gt().url(),path:gt().optional(),description:gt().max(400).default("").optional()})})])];function ha(e){return ma.apply(this,arguments)}function ma(){return ma=J((function(e){return X(this,(function(t){return[2,hi("openShareSheet",fa,[e],function(){var e=J((function(e){var t,n;return X(this,(function(r){switch(r.label){case 0:return In.isMp?(t=e.type,n=e.data,[4,pa(t,n)]):[3,2];case 1:return[2,r.sent()];case 2:return In.isMpWeb?[2,Promise.resolve({status:2,shareType:0,numberOfUser:0})]:[2,Promise.reject(Nn("openShareSheet",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),ma.apply(this,arguments)}var va=J((function(){return X(this,(function(e){return[2,new Promise((function(e,t){Xr("REQUEST_PERMISSION_CAMERA",{},{success:function(t){var n,r;(null===(n=kn())||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=kn())||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 ya(e){return ga.apply(this,arguments)}function ga(){return(ga=J((function(e){return X(this,(function(t){return[2,hi("requestCameraPermission",[],[e],J((function(){return X(this,(function(e){switch(e.label){case 0:return[4,va()];case 1:return[2,e.sent()]}}))})))]}))}))).apply(this,arguments)}var _a=function(){var e=J((function(e,t,n){return X(this,(function(r){return[2,new Promise((function(r,i){Xr("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)}}(),wa=J((function(){var e,t,n,r=arguments;return X(this,(function(i){switch(i.label){case 0:return e=r.length>0&&void 0!==r[0]?r[0]:o,t=r.length>1&&void 0!==r[1]?r[1]:0,n=bi(),[4,Zr(e,t,n.version)];case 1:return[2,i.sent()]}}))})),ba=function(){var e=J((function(e){return X(this,(function(t){return[2,new Promise((function(t,n){Xr("OPEN_OUTAPP",{url:e},{success:function(){t()},fail:function(e){n(e)}},{})}))]}))}));return function(t){return e.apply(this,arguments)}}(),Ta=[Mt({params:En.record(gt(),gt()).optional()}).optional()];function Ea(e){return Sa.apply(this,arguments)}function Sa(){return Sa=J((function(e){return X(this,(function(t){return[2,hi("createShortcut",Ta,[e],function(){var e=J((function(e){var t,n,r,i,s,u,c,l;return X(this,(function(d){switch(d.label){case 0:return In.isMp?[4,wa(o,0)]:[3,6];case 1:return r=d.sent(),i=null===(t=kn())||void 0===t||null===(n=t.platform)||void 0===n?void 0:n.isIOS,s=r.logoUrl||ui("og:image:url")||"",u=r.name||document.title,(c=(null==e?void 0:e.params)?new URLSearchParams(null==e?void 0:e.params):new URLSearchParams).append("utm_source","zalo-shortcut"),c.append("utm_medium","default"),c.append("utm_campaign","default"),i?(c.append("appId",o),c.append("appName",u),c.append("appIcon",s),l="https://mini.zalo.me/shortcut.html?".concat(c.toString()),[4,ba(encodeURI(l))]):[3,3];case 2:return d.sent(),[3,5];case 3:return[4,_a("".concat(a,"/").concat(o,"/?").concat(c.toString()),u,s)];case 4:d.sent(),d.label=5;case 5:return[2,Yr.success()];case 6:return In.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Nn("createShortcut",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Sa.apply(this,arguments)}var Pa=function(){var e=J((function(e,t,n){return X(this,(function(r){return[2,new Promise((function(r,o){Xr("PROMPT_AUTHENTICATION",{secret_data:e,app_id:i,ui:{title:null==t?void 0:t.title,sub_title:null==t?void 0:t.subTitle,negative_text:null==t?void 0:t.negativeButtonText},require_fingerprint:n?1:0},{success:function(e){var t,n,i,o;r({code:null==e?void 0:e.error_code,message:null==e?void 0:e.error_message,data:{domain:null==e||null===(t=e.data)||void 0===t?void 0:t.domain,code:null==e||null===(n=e.data)||void 0===n?void 0:n.error_code,message:null==e||null===(i=e.data)||void 0===i?void 0:i.error_message,payToken:null==e||null===(o=e.data)||void 0===o?void 0:o.pay_token}})},fail:function(e){o(e)}},{})}))]}))}));return function(t,n,r){return e.apply(this,arguments)}}(),Oa=[Mt({secretData:gt(),ui:Mt({title:gt().default("Xác thực").optional(),subTitle:gt().default("Sử dụng sinh trắc học của bạn để xác thực").optional(),negativeButtonText:gt().default("Đóng").optional()}).optional(),requireFingerprint:Tt().default(!0).optional()}).optional()];function Aa(e){return ka.apply(this,arguments)}function ka(){return ka=J((function(e){return X(this,(function(t){return[2,hi("openBioAuthentication",Oa,[e],function(){var e=J((function(e){var t,n,r;return X(this,(function(i){switch(i.label){case 0:return In.isMp?(t=e.secretData,n=e.ui,r=e.requireFingerprint,[4,Pa(t,n,r)]):[3,2];case 1:return[2,i.sent()];case 2:return In.isMpWeb?[2,Promise.resolve({code:0,message:"OK",data:{domain:"",code:0,message:"",payToken:""}})]:[2,Promise.reject(Nn("openBioAuthentication",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),ka.apply(this,arguments)}var Ia=J((function(){return X(this,(function(e){return[2,new Promise((function(e,t){Xr("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 Ca(e){return Na.apply(this,arguments)}function Na(){return(Na=J((function(e){return X(this,(function(t){return[2,hi("checkStateBioAuthentication",[],[e],J((function(){return X(this,(function(e){switch(e.label){case 0:return In.isMp?[4,Ia()]:[3,2];case 1:return[2,{bioState:e.sent()}];case 2:return In.isMpWeb?[2,Promise.resolve({bioState:""})]:[2,Promise.reject(Nn("checkStateBioAuthentication",{}))]}}))})))]}))}))).apply(this,arguments)}var Ma=function(){var e=J((function(e){return X(this,(function(t){return[2,new Promise((function(t,n){Xr("SHOW_TOAST",{toast:e},{success:function(){t()},fail:function(e){n(e)}},{})}))]}))}));return function(t){return e.apply(this,arguments)}}(),xa=[Mt({message:gt()}).optional()];function Ra(e){return Da.apply(this,arguments)}function Da(){return Da=J((function(e){return X(this,(function(t){return[2,hi("showToast",xa,[e],function(){var e=J((function(e){return X(this,(function(t){switch(t.label){case 0:return In.isMp?[4,Ma(e.message)]:[3,2];case 1:return[2,t.sent()];case 2:return In.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Nn("showToast",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Da.apply(this,arguments)}var ja=J((function(){return X(this,(function(e){return[2,new Promise((function(e,t){Xr("HIDE_KEYBOARD",{},{success:function(){e()},fail:function(e){t(e)}},{})}))]}))}));function Ua(e){return Ba.apply(this,arguments)}function Ba(){return(Ba=J((function(e){return X(this,(function(t){return[2,hi("hideKeyboard",[],[e],J((function(){return X(this,(function(e){switch(e.label){case 0:return In.isMp?[4,ja()]:[3,2];case 1:return[2,e.sent()];case 2:return In.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Nn("hideKeyboard",{}))]}}))})))]}))}))).apply(this,arguments)}var La=function(){var e=J((function(e){return X(this,(function(t){return[2,new Promise((function(t,n){Xr("OPEN_PHONE",{phoneNum:e,phoneCode:e},{success:function(){t()},fail:function(e){n(e)}},{})}))]}))}));return function(t){return e.apply(this,arguments)}}(),Za=[Mt({phoneNumber:gt()})];function za(e){return Wa.apply(this,arguments)}function Wa(){return Wa=J((function(e){return X(this,(function(t){return[2,hi("openPhone",Za,[e],function(){var e=J((function(e){return X(this,(function(t){switch(t.label){case 0:return In.isMp?[4,La(e.phoneNumber)]:[3,2];case 1:return[2,t.sent()];case 2:return In.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Nn("openPhone",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Wa.apply(this,arguments)}var Fa=function(){var e=J((function(e,t){return X(this,(function(n){return[2,new Promise((function(n,r){Xr("OPEN_SMS",{content:t,phoneCode:e},{success:function(){n()},fail:function(e){r(e)}},{})}))]}))}));return function(t,n){return e.apply(this,arguments)}}(),Ga=[Mt({content:gt(),phoneNumber:gt()})];function Ha(e){return Va.apply(this,arguments)}function Va(){return Va=J((function(e){return X(this,(function(t){return[2,hi("openSMS",Ga,[e],function(){var e=J((function(e){return X(this,(function(t){switch(t.label){case 0:return In.isMp?[4,Fa(e.phoneNumber,e.content)]:[3,2];case 1:return[2,t.sent()];case 2:return In.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Nn("openSMS",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Va.apply(this,arguments)}var Ka=function(){var e=J((function(e){var t,n=arguments;return X(this,(function(r){return t=n.length>1&&void 0!==n[1]?n[1]:"",[2,new Promise((function(n,r){Xr("VIEW_MYQR",{dpn:t,uid:e,zapp:i},{success:function(){n()},fail:function(e){r(e)}},{timeout:!1})}))]}))}));return function(t){return e.apply(this,arguments)}}(),Ja=[Mt({id:gt(),displayName:gt().default("").optional()})];function qa(e){return $a.apply(this,arguments)}function $a(){return $a=J((function(e){return X(this,(function(t){return[2,hi("viewOAQr",Ja,[e],function(){var e=J((function(e){return X(this,(function(t){switch(t.label){case 0:return In.isMp?[4,Ka(e.id,e.displayName)]:[3,2];case 1:return[2,t.sent()];case 2:return In.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Nn("viewOAQr",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),$a.apply(this,arguments)}var Qa=function(){var e=J((function(e){return X(this,(function(t){return[2,new Promise((function(t,n){Xr("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)}}(),Ya=[Mt({keepScreenOn:Tt()})];function Xa(e){return es.apply(this,arguments)}function es(){return es=J((function(e){return X(this,(function(t){return[2,hi("keepScreen",Ya,[e],function(){var e=J((function(e){return X(this,(function(t){switch(t.label){case 0:return In.isMp?[4,Qa(e.keepScreenOn)]:[3,2];case 1:return[2,t.sent()];case 2:return In.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Nn("keepScreen",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),es.apply(this,arguments)}function ts(e){return ns.apply(this,arguments)}function ns(){return(ns=J((function(e){return X(this,(function(t){return[2,hi("onKeepScreen",[],[e],J((function(){return X(this,(function(e){switch(e.label){case 0:return In.isMp?[4,Qa(!0)]:[3,2];case 1:return[2,e.sent()];case 2:return In.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Nn("onKeepScreen",{}))]}}))})))]}))}))).apply(this,arguments)}function rs(e){return is.apply(this,arguments)}function is(){return(is=J((function(e){return X(this,(function(t){return[2,hi("offKeepScreen",[],[e],J((function(){return X(this,(function(e){switch(e.label){case 0:return In.isMp?[4,Qa(!1)]:[3,2];case 1:return[2,e.sent()];case 2:return In.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Nn("offKeepScreen",{}))]}}))})))]}))}))).apply(this,arguments)}var os=function(){var e=J((function(e,t){var n;return X(this,(function(r){return n={},e?n={imageBase64Data:e}:t&&(n={imageUrl:t}),[2,new Promise((function(e,t){Xr("SAVE_IMAGE_GALLERY",xn({},n),{success:function(){e()},fail:function(e){t(e)}},{})}))]}))}));return function(t,n){return e.apply(this,arguments)}}(),as=[Mt({imageBase64Data:gt().optional(),imageUrl:gt().url().optional()}).optional()];function ss(e){return us.apply(this,arguments)}function us(){return us=J((function(e){return X(this,(function(t){return[2,hi("saveImageToGallery",as,[e],function(){var e=J((function(e){return X(this,(function(t){switch(t.label){case 0:return In.isMp?[4,os(e.imageBase64Data,e.imageUrl)]:[3,2];case 1:return[2,t.sent()];case 2:return In.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Nn("saveImageToGallery",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),us.apply(this,arguments)}var cs=function(){var e=J((function(e){var t,n,r,i,o,a,u=arguments;return X(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,wa(e,0)];case 2:return r=c.sent(),[3,4];case 3:return c.sent(),[3,4];case 4:i={appId:e},r&&(i.appName=r.name,i.appAvtUrl=r.logoUrl),o="".concat(s,"/").concat(e).concat(t);try{a=new URL(o),Object.entries(n).forEach((function(e){var t=Rn(e,2),n=t[0],r=t[1];a.searchParams.append(n,String(r))})),o=a.href}catch(e){}return[2,new Promise((function(e,t){Xr("OPEN_MP",{mpUrl:o,mpInfo:i},{success:function(){e()},fail:function(e){t(e)}},{})}))]}}))}));return function(t){return e.apply(this,arguments)}}(),ls=[Mt({appId:gt(),path:gt().optional(),params:En.record(gt(),gt()).optional()})];function ds(e){return ps.apply(this,arguments)}function ps(){return ps=J((function(e){return X(this,(function(t){return[2,hi("openMiniApp",ls,[e],function(){var e=J((function(e){return X(this,(function(t){switch(t.label){case 0:return In.isMp?[4,cs(e.appId,e.path,e.params)]:[3,2];case 1:return[2,t.sent()];case 2:return In.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Nn("openMiniApp",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),ps.apply(this,arguments)}var fs=J((function(){var t,n,r=arguments;return X(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){Xr("INTERACTIVE_VIBRATION",{type:e.VibrateType[t],vibrate_time:n},{success:function(){r()},fail:function(e){i(e)}},{})}))]}))})),hs=[Mt({type:En.enum(["oneShot"]).default("oneShot"),milliseconds:_t().optional()})];function ms(e){return vs.apply(this,arguments)}function vs(){return vs=J((function(e){return X(this,(function(t){return[2,hi("vibrate",hs,[e],function(){var e=J((function(e){return X(this,(function(t){switch(t.label){case 0:return In.isMp?[4,fs(null==e?void 0:e.type,null==e?void 0:e.milliseconds)]:[3,2];case 1:return[2,t.sent()];case 2:return In.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Nn("vibrate",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),vs.apply(this,arguments)}var ys=function(){var e=J((function(e,t){var n,r,i,o;return X(this,(function(a){return n=new URL(e),r=n.href.includes("vnpay"),i=n.searchParams.get("typeInapp"),o=vr.isEmpty(t)?void 0:{modal_style:(null==t?void 0:t.style)?Wr(null==t?void 0:t.style):"bottom_sheet",left_button:(null==t?void 0:t.leftButton)?Wr(null==t?void 0:t.leftButton):"back"},!r&&vr.isEmpty(i)&&n.searchParams.set("typeInapp","1"),[2,new Promise((function(e,t){Xr("OPEN_INAPP",{url:n.href,style:o},{success:function(){e()},fail:function(e){t(e)}},{})}))]}))}));return function(t,n){return e.apply(this,arguments)}}(),gs=[Mt({url:gt(),config:Mt({style:En.enum(["bottomSheet","normal"]).default("bottomSheet").optional(),leftButton:En.enum(["back","none"]).default("back").optional()}).optional()})];function _s(e){return ws.apply(this,arguments)}function ws(){return ws=J((function(e){return X(this,(function(t){return[2,hi("openWebview",gs,[e],function(){var e=J((function(e){return X(this,(function(t){switch(t.label){case 0:return In.isMp?[4,ys(e.url,e.config)]:[3,2];case 1:return[2,t.sent()];case 2:return In.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Nn("openWebview",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),ws.apply(this,arguments)}function bs(){var e={},t=window.location.href;try{var n=new URL(t).searchParams.toString();n&&(e=Mr.getParamsAsObject(n))}catch(e){throw new Error("Invalid URL")}return e}function Ts(){return hi("getRouteParams",[],[],(function(){return bs()}))}function Es(e){return Ss.apply(this,arguments)}function Ss(){return(Ss=J((function(e){return X(this,(function(t){return[2,hi("getAppInfo",[],[e],J((function(){return X(this,(function(e){switch(e.label){case 0:return In.isMp?[4,wa()]:[3,2];case 1:return[2,e.sent()];case 2:return In.isMpWeb?[2,Promise.resolve({description:"",name:"",version:"",appUrl:"",qrCodeUrl:""})]:[2,Promise.reject(Nn("getAppInfo",{}))]}}))})))]}))}))).apply(this,arguments)}var Ps=function(){var e=J((function(e){return X(this,(function(t){return[2,new Promise((function(t,n){Xr("WEBVIEW_SET_RESULT",{result:ci(e)},{success:function(){t()},fail:function(e){n(e)}},{})}))]}))}));return function(t){return e.apply(this,arguments)}}(),Os=[Mt({data:En.any()})];function As(e){return ks.apply(this,arguments)}function ks(){return ks=J((function(e){return X(this,(function(t){return[2,hi("sendDataToPreviousMiniApp",Os,[e],function(){var e=J((function(e){return X(this,(function(t){switch(t.label){case 0:return In.isMp?[4,Ps(e.data)]:[3,2];case 1:return[2,t.sent()];case 2:return In.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Nn("sendDataToPreviousMiniApp",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),ks.apply(this,arguments)}var Is=J((function(){return X(this,(function(e){return[2,new Promise((function(e,t){var n,r;Xr("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(Yr.error.clientNotSupport())},fail:function(e){t(e)}},{delay:(null===(n=kn())||void 0===n||null===(r=n.platform)||void 0===r?void 0:r.isIOS)?400:0})}))]}))}));function Cs(e){return Ns.apply(this,arguments)}function Ns(){return(Ns=J((function(e){return X(this,(function(t){return[2,hi("getPhoneNumber",[],[e],J((function(){return X(this,(function(e){switch(e.label){case 0:return In.isMp?[4,Is()]:[3,2];case 1:return[2,e.sent()];case 2:return In.isMpWeb?[2,Promise.resolve({number:""})]:[2,Promise.reject(Nn("getPhoneNumber",{}))]}}))})))]}))}))).apply(this,arguments)}var Ms=J((function(){var e,t=arguments;return X(this,(function(n){return e=t.length>0&&void 0!==t[0]?t[0]:1,[2,new Promise((function(t,n){Xr("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})}))]}))})),xs=[Mt({maxProfile:_t().min(1).max(10).optional().default(1)})];function Rs(e){return Ds.apply(this,arguments)}function Ds(){return Ds=J((function(e){return X(this,(function(t){return[2,hi("openProfilePicker",xs,[e],function(){var e=J((function(e){var t,n,r,i,o;return X(this,(function(a){switch(a.label){case 0:return In.isMp?[4,Ms(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,ni.getAccessToken()];case 3:return r=a.sent(),[4,fetch(d.GET_LIST_USER_INFO,{method:"POST",headers:{"Content-Type":"application/json",access_token:r||""},body:JSON.stringify({fields:"id,name,picture",user_ids:t})})];case 4:return[4,a.sent().json()];case 5:if(0!==(i=a.sent()).error||!i.data)throw new Error(i.message);return n=t.map((function(e){var t,n,r,o,a,s,u,c,l,d,p;return{id:(null===(t=i.data[e])||void 0===t||null===(n=t.user_info)||void 0===n?void 0:n.user_id_by_app)||"",profile:{name:null===(r=i.data[e])||void 0===r||null===(o=r.user_info)||void 0===o?void 0:o.name,avatar:null===(a=i.data[e])||void 0===a||null===(s=a.user_info)||void 0===s||null===(u=s.picture)||void 0===u||null===(c=u.data)||void 0===c?void 0:c.url},code:0!==(null===(l=i.data[e])||void 0===l?void 0:l.error)?-1:0,message:"Get profile: ".concat(vr.isUndefined(null===(d=i.data[e])||void 0===d?void 0:d.message)?"Unknown error":null===(p=i.data[e])||void 0===p?void 0:p.message)}})),[3,7];case 6:return o=a.sent(),n=t.map((function(e){return{id:e,profile:{name:"",avatar:""},code:-1,message:"Can't get profile: ".concat(o.message)}})),[3,7];case 7:return[2,{users:n||[]}];case 8:return In.isMpWeb?[2,Promise.resolve({users:[]})]:[2,Promise.reject(Nn("openProfilePicker",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Ds.apply(this,arguments)}var js=function(){var e=J((function(e,t,n){var r;return X(this,(function(i){return r=t&&vr.isString(t)&&t.length>0?"wpa_wpa2":"open",[2,new Promise((function(i,o){Xr("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)}}(),Us=[Mt({SSID:gt(),password:gt().optional(),hiddenSSID:Tt().optional()})];function Bs(e){return Ls.apply(this,arguments)}function Ls(){return Ls=J((function(e){return X(this,(function(t){return[2,hi("connectWifi",Us,[e],function(){var e=J((function(e){return X(this,(function(t){switch(t.label){case 0:return In.isMp?[4,js(e.SSID,e.password,e.hiddenSSID)]:[3,2];case 1:return[2,t.sent()];case 2:return In.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Nn("connectWifi",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Ls.apply(this,arguments)}var Zs=function(){var t=J((function(t,n,r,i,o,a){var s,u;return X(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){Xr("PICK_MEDIA",{media_type:e.MediaPickerType[t],edit_view:xn({},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)}}(),zs=[Mt({type:En.enum(["video","photo","file","zcamera","zcamera_photo","zcamera_video","zcamera_scan"]),serverUploadUrl:gt().url(),maxItemSize:_t().min(0).optional(),editView:Mt({enable:Tt().optional(),aspectRatio:gt().regex(/^d+:d+$/).optional()}).optional(),silentRequest:Tt().optional(),maxSelectItem:_t().min(1).optional()})];function Ws(e){return Fs.apply(this,arguments)}function Fs(){return Fs=J((function(e){return X(this,(function(t){return[2,hi("openMediaPicker",zs,[e],function(){var e=J((function(e){var t,n,r,i,o,a;return X(this,(function(s){switch(s.label){case 0:return In.isMp?(i={},vr.isUndefined(null===(t=e.editView)||void 0===t?void 0:t.enable)||(null===(n=e.editView)||void 0===n?void 0:n.enable)?i.enable=1:i.enable=0,i.aspect_ratio=null===(r=e.editView)||void 0===r?void 0:r.aspectRatio,o=!0===e.silentRequest?1:0,a=e.maxSelectItem,[4,Zs(e.type,e.serverUploadUrl,e.maxItemSize,i,o,a)]):[3,2];case 1:return[2,{data:s.sent()}];case 2:return In.isMpWeb?[2,Promise.resolve({data:""})]:[2,Promise.reject(Nn("openMediaPicker",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Fs.apply(this,arguments)}var Gs=[Mt({title:gt().max(100),description:gt().max(400).default(""),thumbnail:gt().url().optional(),path:gt().optional()})];function Hs(e){return Vs.apply(this,arguments)}function Vs(){return Vs=J((function(e){return X(this,(function(t){return[2,hi("getShareableLink",Gs,[e],function(){var e=J((function(e){var t;return X(this,(function(n){switch(n.label){case 0:return[4,ni.getAccessToken()];case 1:return t=n.sent(),[4,da(window.APP_ID,t||"",e.title,e.description,e.thumbnail,e.path)];case 2:return[2,n.sent().shareableLink]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Vs.apply(this,arguments)}var Ks=function(){var e=J((function(e){return X(this,(function(t){return[2,new Promise((function(t,n){Xr("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 Js(e){return qs.apply(this,arguments)}function qs(){return(qs=J((function(e){return X(this,(function(t){return[2,hi("closeLoading",[],[e],J((function(){return X(this,(function(e){switch(e.label){case 0:return In.isMp?[4,Ks("user action")]:[3,2];case 1:return[2,e.sent()];case 2:return In.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Nn("closeLoading",{}))]}}))})))]}))}))).apply(this,arguments)}function $s(e){return Qs.apply(this,arguments)}function Qs(){return Qs=J((function(e){return X(this,(function(t){return[2,hi("requestUpdateZalo",[],[e],J((function(){var e,t,n;return X(this,(function(r){switch(r.label){case 0:return In.isMp?(n=(null===(e=kn())||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,ba(n)]):[3,2];case 1:return[2,r.sent()];case 2:return In.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Nn("requestUpdateZalo",{}))]}}))})))]}))})),Qs.apply(this,arguments)}var Ys=Ir.getInstance();Ys.addListener=function(t,n,r){var i=t;return Ys.addListener(e.Events[i],n,r)};var Xs=[En.function()];function eu(t){return hi("onConfirmToExit",Xs,[t],(function(t){var n=t;In.isMp&&(Ys.on(e.Events.AppClose,n,'{"handle_h5": 1}'),Si.setNavigationBarLeftButton(void 0,2))}))}function tu(){return hi("offConfirmToExit",[],[],(function(){In.isMp&&(Ys.off(e.Events.AppClose),Si.setNavigationBarLeftButton(void 0,0))}))}function nu(){return hi("getDeviceId",[],[],(function(){return In.isMp&&ni.getSync(l.DEVICE_ID)||""}))}function ru(e){return iu.apply(this,arguments)}function iu(){return(iu=J((function(e){return X(this,(function(t){return[2,hi("getDeviceIdAsync",[],[e],J((function(){return X(this,(function(e){switch(e.label){case 0:return In.isMp?[4,ni.jumpAndGetToken(l.DEVICE_ID)]:[3,2];case 1:return[2,e.sent()||""];case 2:return[2,Promise.resolve("")]}}))})))]}))}))).apply(this,arguments)}function ou(){return hi("getContext",[],[],(function(){if(In.isMp){var e=ni.getSync(l.CONTEXT_ID)||"";return{type:ni.getSync(l.CONTEXT_TYPE)||"",id:e}}return{type:"",id:""}}))}function au(e){return su.apply(this,arguments)}function su(){return(su=J((function(e){return X(this,(function(t){return[2,hi("getContextAsync",[],[e],J((function(){var e;return X(this,(function(t){switch(t.label){case 0:return In.isMp?[4,ni.jumpAndGetToken(l.CONTEXT_ID)]:[3,3];case 1:return e=t.sent()||"",[4,ni.jumpAndGetToken(l.CONTEXT_TYPE)];case 2:return[2,{type:t.sent()||"",id:e}];case 3:return[2,Promise.resolve({type:"",id:""})]}}))})))]}))}))).apply(this,arguments)}function uu(e){return cu.apply(this,arguments)}function cu(){return(cu=J((function(e){return X(this,(function(t){return[2,hi("getAuthCode",[],[e],J((function(){var e,t;return X(this,(function(n){switch(n.label){case 0:return In.isMp?[4,ni.jumpAndGetToken(l.ZOAUTH,!0)]:[3,4];case 1:return e=n.sent()||"",[4,ni.jumpAndGetToken(l.ZOAUTH_VRF)];case 2:return t=n.sent()||"",[4,ni.verifyUserAuthorized()];case 3:if(n.sent())return[2,{authCode:e,authCodeVerify:t}];throw zr([{action:"getAuthCode",error:-104,message:"no user auth",data:{}}]),Yr.error.loginFailed("User Authentication Required");case 4:return[2,Promise.resolve({authCode:"",authCodeVerify:""})]}}))})))]}))}))).apply(this,arguments)}function lu(e){return du.apply(this,arguments)}function du(){return(du=J((function(e){return X(this,(function(t){return[2,hi("getZPIToken",[],[e],J((function(){var e,t,n,r;return X(this,(function(i){switch(i.label){case 0:return In.isMp?[4,ni.jumpAndGetToken(l.UTOKEN_ZPI)]:[3,5];case 1:return e=i.sent()||"",[4,ni.jumpAndGetToken(l.GTOKEN_ZPI)];case 2:return t=i.sent()||"",[4,ni.jumpAndGetToken(l.ZPP_ZPI)];case 3:return n=i.sent()||"",[4,ni.jumpAndGetToken(l.ZPT_ZPI)];case 4:return r=i.sent()||"",[2,{utoken:e,gtoken:t,zpp:n,zpt:r}];case 5:return[2,Promise.resolve({utoken:"",gtoken:"",zpp:"",zpt:""})]}}))})))]}))}))).apply(this,arguments)}var pu=[gt()];function fu(e){return hi("setAccessToken",pu,[e],(function(e){var t=e;ni.setAccessToken(t)}))}var hu=[Mt({url:gt().url()})];function mu(e){return vu.apply(this,arguments)}function vu(){return vu=J((function(e){return X(this,(function(t){return[2,hi("openOutApp",hu,[e],function(){var e=J((function(e){return X(this,(function(t){switch(t.label){case 0:return In.isMp?[4,ba(e.url)]:[3,2];case 1:return[2,t.sent()];case 2:return In.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Nn("openOutApp",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),vu.apply(this,arguments)}var yu=[Mt({count:_t().min(1).optional().default(1),sourceType:En.array(En.enum(["album","camera"])).max(2).default(["album","camera"]).optional(),cameraType:En.enum(["back","front"]).default("front").optional()})];function gu(e){return _u.apply(this,arguments)}function _u(){return _u=J((function(e){return X(this,(function(t){return[2,hi("chooseImage",yu,[e],function(){var e=J((function(e){var t,n,r,i;return X(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)}}())]}))})),_u.apply(this,arguments)}var wu=J((function(){var e,t,n=arguments;return X(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){Xr("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(Yr.error.clientNotSupport())},fail:function(e){r(e)}},{isMultiCallback:!0,timeout:!1})}))]}))}));function bu(e){return Tu.apply(this,arguments)}function Tu(){return(Tu=J((function(e){return X(this,(function(t){return[2,hi("getLocation",[],[e],J((function(){return X(this,(function(e){switch(e.label){case 0:return In.isMp?[4,wu()]:[3,2];case 1:return[2,e.sent()];case 2:return In.isMpWeb?[2,Promise.resolve({longitude:"105.788026",latitude:"21.0258773",timestamp:(new Date).getTime().toString(),provider:"fused"})]:[2,Promise.reject(Nn("getLocation",{}))]}}))})))]}))}))).apply(this,arguments)}var Eu=[En.function().args(Mt({data:En.any()})).returns(En.void())];function Su(t){return hi("onCallbackData",Eu,[t],(function(){!function(t){Ir.getInstance().on(e.Events.OnDataCallback,(function(e){t({data:e})}))}(t)}))}var Pu=function(){var e=J((function(e){var t,n,r,i,a,s,u,c,l,d,p;return X(this,(function(f){switch(f.label){case 0:return n="",e||(e=bs()),"object"==typeof e&&((n=e.zmpOrderId||"")||(t=e.appTransID||e.orderId||e.apptransid)),"string"==typeof e&&(r=Mr.getParameterByName("orderId",e),i=Mr.getParameterByName("appTransID",e)||Mr.getParameterByName("apptransid",e),t=r||i),a={headers:{authorization:"Bearer "}},[4,ni.getAccessToken().catch((function(){throw Yr.error.loginRequired}))];case 1:return s=f.sent(),a.headers.authorization="Bearer ".concat(s),u=new URL(B),c={orderId:n,transId:t||"",appId:o},u.search=new URLSearchParams(c).toString(),[4,fetch(u.toString(),a)];case 2:return[4,f.sent().json()];case 3:if(!(l=f.sent()).data)throw Yr.error.badRequest(l.msg);return d=l.data||{},p={err:l.err},0!==Object.keys(d).length&&d.constructor===Object&&Object.assign(p,xn({msg:d.resultMessage},d)),[2,p]}}))}));return function(t){return e.apply(this,arguments)}}(),Ou=function(){var t=J((function(t,n,r,i,a,s,u){var c,l,d,p,f,h,m,v,y,g,_,w,b,T,E,S,P,O,A,k;return X(this,(function(I){switch(I.label){case 0:c=o,(l=new URLSearchParams).append("amount",t.toString()),l.append("item",encodeURIComponent(JSON.stringify(n))),l.append("appId",c),r&&l.append("desc",encodeURIComponent(r)),i&&(d=i,"object"==typeof i&&(d=JSON.stringify(i)),l.append("extradata",encodeURIComponent(d))),a&&(p=a,"object"==typeof a&&(p=JSON.stringify(a)),l.append("payload",encodeURIComponent(p))),s&&("string"==typeof s?(l.append("method",s),l.append("isCustom","false")):"object"==typeof s&&(l.append("method",s.id),l.append("isCustom",JSON.stringify(s.isCustom)))),u&&l.append("mac",u),f={headers:{"Content-Type":"application/x-www-form-urlencoded",authorization:"Bearer "}},I.label=1;case 1:return I.trys.push([1,6,,7]),[4,ni.getAccessToken().catch((function(){throw Yr.error.loginRequired}))];case 2:return m=I.sent(),f.headers.authorization="Bearer ".concat(m),[4,fetch(j,Yo(xn({method:"POST"},f),{body:l}))];case 3:return[4,I.sent().json()];case 4:if(!(v=I.sent()).data||0!==v.err)throw Yr.error.badRequest(v.msg);return y=v.data.id,g=v.data.jwt,_=window.APP_VERSION,w=window.APP_ENV,b={miniAppId:c,orderId:y},T=v.data.method,E=v.data.isCustom,g&&(b.token=g),_&&(b.version=_),w&&(b.env=w),T&&(b.method=T),E&&(b.isCustom=E),S=Mr.encode(b),P=new URL("?".concat(S),"https://payment-mini.zalo.me").toString(),O=Fr(),A=((null===(h=kn())||void 0===h?void 0:h.platformName)||"").toLowerCase(),[4,ys(P,{style:"android"===A&&O<742?"normal":"bottomSheet"}).then((function(){var t=!1;Ir.getInstance().once(e.Events.WebviewClosed,(function(){setTimeout(J((function(){var n;return X(this,(function(r){switch(r.label){case 0:return t?[3,2]:[4,Pu({zmpOrderId:y})];case 1:(n=r.sent()).err>=0&&!n.isCustom&&Ir.getInstance().emit(e.Events.PaymentClose,n.err,Yo(xn({},n),{zmpOrderId:y})),r.label=2;case 2:return[2]}}))})),500)})),Ir.getInstance().once(e.Events.OpenApp,(function(){t=!0}))}))];case 5:return I.sent(),[2,{orderId:y}];case 6:throw k=I.sent(),console.log("Internal error"),k;case 7:return[2]}}))}));return function(e,n,r,i,o,a,s){return t.apply(this,arguments)}}(),Au=[Mt({amount:En.union([gt(),_t()]),item:En.array(En.record(gt(),En.any())),desc:gt(),extradata:En.any().optional(),payload:En.any().optional(),method:En.union([En.string(),En.object({id:En.string(),isCustom:En.boolean()})]).optional(),mac:En.string().optional()})];function ku(e){return Iu.apply(this,arguments)}function Iu(){return Iu=J((function(e){return X(this,(function(t){return[2,hi("createOrder",Au,[e],function(){var e=J((function(e){return X(this,(function(t){switch(t.label){case 0:return In.isMp?[4,Ou(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 In.isMpWeb?[2,Promise.resolve({orderId:""})]:[2,Promise.reject(Nn("createOrder",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Iu.apply(this,arguments)}var Cu=function(){var e=J((function(e){return X(this,(function(t){return[2,new Promise((function(t,n){Xr("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)}}(),Nu=[Mt({method:gt().optional()}).optional()];function Mu(e){return xu.apply(this,arguments)}function xu(){return xu=J((function(e){return X(this,(function(t){return[2,hi("selectPaymentMethod",Nu,[e],function(){var e=J((function(e){var t;return X(this,(function(n){switch(n.label){case 0:return In.isMp?(t=e.method,[4,Cu(t)]):[3,2];case 1:return[2,n.sent()];case 2:return In.isMpWeb?[2,Promise.resolve({method:""})]:[2,Promise.reject(Nn("selectPaymentMethod",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),xu.apply(this,arguments)}var Ru=[Mt({data:En.union([gt(),En.record(gt(),gt())])})];function Du(e){return ju.apply(this,arguments)}function ju(){return ju=J((function(e){return X(this,(function(t){return[2,hi("checkTransaction",Ru,[e],function(){var e=J((function(e){return X(this,(function(t){switch(t.label){case 0:return In.isMp?[4,Pu(e.data)]:[3,2];case 1:return[2,t.sent()];case 2:return In.isMpWeb?[2,Promise.resolve({msg:"Success",orderId:"",resultCode:1,transTime:(new Date).getTime().toString(),createdAt:(new Date).getTime().toString(),transId:""})]:[2,Promise.reject(Nn("checkTransaction",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),ju.apply(this,arguments)}var Uu=[Mt({hide:Tt().default(!1).optional()}).optional()];function Bu(e){return Lu.apply(this,arguments)}function Lu(){return Lu=J((function(e){return X(this,(function(t){return[2,hi("setAndroidBottomNavigationBar",Uu,[e],function(){var e=J((function(e){return X(this,(function(t){switch(t.label){case 0:return In.isMp?[4,Si.setAndroidBottomNavigationBar(e.hide)]:[3,2];case 1:return[2,t.sent()];case 2:return In.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Nn("setAndroidBottomNavigationBar",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Lu.apply(this,arguments)}var Zu=[Mt({hide:Tt().default(!1).optional()}).optional()];function zu(e){return Wu.apply(this,arguments)}function Wu(){return Wu=J((function(e){return X(this,(function(t){return[2,hi("setIOSBottomSafeArea",Zu,[e],function(){var e=J((function(e){return X(this,(function(t){switch(t.label){case 0:return In.isMp?[4,Si.setIOSBottomSafeArea(e.hide)]:[3,2];case 1:return[2,t.sent()];case 2:return In.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Nn("setIOSBottomSafeArea",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Wu.apply(this,arguments)}var Fu=[Mt({type:En.enum(["normal","hidden","transparent"]).default("normal").optional(),color:En.string().optional()}).optional()];function Gu(e){return Hu.apply(this,arguments)}function Hu(){return Hu=J((function(e){return X(this,(function(t){return[2,hi("setStatusBar",Fu,[e],function(){var e=J((function(e){return X(this,(function(t){switch(t.label){case 0:return In.isMp?[4,Si.configHeader({statusBarType:e.type,headerColor:e.color})]:[3,2];case 1:return[2,t.sent()];case 2:return In.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Nn("setStatusBar",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Hu.apply(this,arguments)}var Vu=[Mt({headerTextColor:En.enum(["black","white"]).optional(),headerColor:En.string().optional(),actionBar:Mt({hide:En.boolean().optional(),title:En.string().optional(),leftButton:En.enum(["back","none"]).optional(),textAlign:En.enum(["left","center"]).default("left").optional()}).optional(),statusBarType:En.enum(["normal","hidden","transparent"]).optional(),hideAndroidBottomNavigationBar:En.boolean().optional(),hideIOSSafeAreaBottom:En.boolean().optional()})];function Ku(e){return Ju.apply(this,arguments)}function Ju(){return Ju=J((function(e){return X(this,(function(t){return[2,hi("configAppView",Vu,[e],function(){var e=J((function(e){var t,n,r,i,o,a,s;return X(this,(function(u){switch(u.label){case 0:return In.isMp?vr.isUndefined(null===(t=e.actionBar)||void 0===t?void 0:t.leftButton)?[3,2]:[4,Si.setNavigationBarLeftButton(null===(a=e.actionBar)||void 0===a?void 0:a.leftButton)]:[3,13];case 1:u.sent(),u.label=2;case 2:return vr.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,Si.setNavigationBarTitle(null===(s=e.actionBar)||void 0===s?void 0:s.title)];case 3:u.sent(),u.label=4;case 4:return[4,Si.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,Si.setAndroidBottomNavigationBar(e.hideAndroidBottomNavigationBar)];case 7:u.sent(),u.label=8;case 8:return"boolean"!=typeof e.hideIOSSafeAreaBottom?[3,10]:[4,Si.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 In.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Nn("configAppView",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Ju.apply(this,arguments)}var qu=function(){var t=J((function(t,n,r,i,a,s){var u,c,l,d,p,f,h,m,v,y,g,_,w,b;return X(this,(function(T){switch(T.label){case 0:p=o,(f=new URLSearchParams).append("payType",n||e.IAPPayType.SUBSCRIPTION),h=e.ProrationMode.UNKNOW,r===Z&&(h=e.ProrationMode.IMMEDIATE_AND_CHARGE_FULL_PRICE),r===L&&(h=e.ProrationMode.DEFERRED),f.append("utm",a||"default"),f.append("merchantTransId",s||""),f.append("prorationMode",h.toString()),f.append("appId",p),i&&f.append("method",i),m="",(null===(u=kn())||void 0===u||null===(c=u.platform)||void 0===c?void 0:c.isIOS)?m="ios":(null===(l=kn())||void 0===l||null===(d=l.platform)||void 0===d?void 0:d.isAndroid)&&(m="android"),f.append("os",m),f.append("productId",t),v={headers:{"Content-Type":"application/x-www-form-urlencoded",authorization:"Bearer "}},T.label=1;case 1:return T.trys.push([1,5,,6]),[4,ni.getAccessToken().catch((function(){throw Yr.error.loginRequired}))];case 2:return y=T.sent(),v.headers.authorization="Bearer ".concat(y),[4,fetch(U,Yo(xn({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 Yr.error.createIAPOrderFailed(g.err);return _=g.data.store,w=g.data.orderId,[2,new Promise((function(e,t){Xr("IAP_REQUESTPAYMENT",xn({},_),{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)}}(),$u=[Mt({productId:gt(),payType:En.enum(["ONETIME","SUBSCRIPTION"]).optional(),prorationMode:En.enum(["DEFERRED","IMMEDIATE_AND_CHARGE_FULL_PRICE"]).default("DEFERRED").optional(),utm:gt().optional(),method:En.enum(["IAP","IAP_SANDBOX"]).optional(),merchantTransId:gt().optional()})];function Qu(e){return Yu.apply(this,arguments)}function Yu(){return Yu=J((function(e){return X(this,(function(t){return[2,hi("createOrderIAP",$u,[e],function(){var e=J((function(e){return X(this,(function(t){switch(t.label){case 0:return In.isMp?[4,qu(e.productId,e.payType,e.prorationMode,e.method,e.utm,e.merchantTransId)]:[3,2];case 1:return[2,t.sent()];case 2:return In.isMpWeb?[2,Promise.resolve({orderId:""})]:[2,Promise.reject(Nn("createOrderIAP",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Yu.apply(this,arguments)}var Xu=J((function(){return X(this,(function(e){return[2,new Promise((function(e,t){Xr("MA_MENU_MINIMIZE",{},{success:function(t){e(t)},fail:function(e){t(e)}},{})}))]}))}));function ec(e){return tc.apply(this,arguments)}function tc(){return(tc=J((function(e){return X(this,(function(t){return[2,hi("minimizeApp",[],[e],J((function(){return X(this,(function(e){switch(e.label){case 0:return In.isMp?[4,Xu()]:[3,2];case 1:return[2,e.sent()];case 2:return In.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Nn("minimizeApp",{}))]}}))})))]}))}))).apply(this,arguments)}var nc=J((function(){return X(this,(function(e){return[2,new Promise((function(e,t){Xr("MA_MENU_PERMISSION",{},{success:function(t){e(t)},fail:function(e){t(e)}},{}),e()}))]}))}));function rc(e){return ic.apply(this,arguments)}function ic(){return(ic=J((function(e){return X(this,(function(t){return[2,hi("openPermissionSetting",[],[e],J((function(){return X(this,(function(e){switch(e.label){case 0:return In.isMp?[4,nc()]:[3,2];case 1:return[2,e.sent()];case 2:return In.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Nn("openPermissionSetting",{}))]}}))})))]}))}))).apply(this,arguments)}var oc=J((function(){return X(this,(function(e){return[2,new Promise((function(e,t){Xr("MP_ADD_MYFAVORITES",{timestamp:(new Date).getTime()},{success:function(t){e(t)},fail:function(e){t(e)}},{})}))]}))}));function ac(e){return sc.apply(this,arguments)}function sc(){return(sc=J((function(e){return X(this,(function(t){return[2,hi("favoriteApp",[],[e],J((function(){return X(this,(function(e){switch(e.label){case 0:return In.isMp?[4,oc()]:[3,2];case 1:return[2,e.sent()];case 2:return In.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Nn("favoriteApp",{}))]}}))})))]}))}))).apply(this,arguments)}var uc=J((function(){return X(this,(function(e){return[2,new Promise((function(e,t){Xr("OPEN_GROUPLIST",{},{success:function(t){e(t)},fail:function(e){t(e)}},{})}))]}))}));function cc(e){return lc.apply(this,arguments)}function lc(){return(lc=J((function(e){return X(this,(function(t){return[2,hi("openGroupList",[],[e],J((function(){return X(this,(function(e){switch(e.label){case 0:return In.isMp?[4,uc()]:[3,2];case 1:return[2,e.sent()];case 2:return In.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Nn("openGroupList",{}))]}}))})))]}))}))).apply(this,arguments)}var dc=J((function(){var e;return X(this,(function(t){switch(t.label){case 0:return[4,ni.getAccessToken()];case 1:return e=t.sent(),[2,new Promise((function(t,n){Xr("MP_SEND_NOTIFICATION",{accessToken:e},{success:function(e){t(e)},fail:function(e){n(e)}},{delay:500})}))]}}))}));function pc(e){return fc.apply(this,arguments)}function fc(){return(fc=J((function(e){return X(this,(function(t){return[2,hi("requestSendNotification",[],[e],J((function(){return X(this,(function(e){switch(e.label){case 0:return In.isMp?[4,dc()]:[3,2];case 1:return[2,e.sent()];case 2:return In.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Nn("requestSendNotification",{}))]}}))})))]}))}))).apply(this,arguments)}var hc=J((function(){return X(this,(function(e){return[2,new Promise((function(e,t){Xr("MP_ADD_RATING",{},{success:function(t){e(t)},fail:function(e){t(e)}},{})}))]}))}));function mc(e){return vc.apply(this,arguments)}function vc(){return(vc=J((function(e){return X(this,(function(t){return[2,hi("addRating",[],[e],J((function(){return X(this,(function(e){switch(e.label){case 0:return In.isMp?[4,hc()]:[3,2];case 1:return[2,e.sent()];case 2:return In.isMpWeb?[2,Promise.resolve({})]:[2,Promise.reject(Nn("addRating",{}))]}}))})))]}))}))).apply(this,arguments)}var yc,gc=(yc=J((function(e,t,n){var r,i;return X(this,(function(o){switch(o.label){case 0:return(r=new URLSearchParams).append("appId",t),r.append("accessToken",n),r.append("oaId",e),i={headers:{"Content-Type":"application/x-www-form-urlencoded"}},[4,fetch(d.CHECK_INTERACT_OA,xn({method:"POST",body:r},i))];case 1:return[4,o.sent().json()];case 2:return[2,o.sent()]}}))})),function(e,t,n){return yc.apply(this,arguments)}),_c=function(){var e=J((function(e){return X(this,(function(t){return[2,new Promise((function(t,n){Xr("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)}}(),wc=[Mt({oaId:gt()})];function bc(e){return Tc.apply(this,arguments)}function Tc(){return Tc=J((function(e){return X(this,(function(t){return[2,hi("interactOA",wc,[e],function(){var e=J((function(e){var t,n,r;return X(this,(function(i){switch(i.label){case 0:return In.isMp?(t=e.oaId,[4,ni.getAccessToken()]):[3,5];case 1:return!(n=i.sent())||vr.isEmpty(n)?[3,3]:[4,gc(t,o,n)];case 2:if(0===(null==(r=i.sent())?void 0:r.err))return[2,Promise.resolve({})];i.label=3;case 3:return[4,_c(t)];case 4:return[2,i.sent()];case 5:return In.isMpWeb?[2,Promise.resolve({})]:[2,Promise.reject(Nn("interactOA",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Tc.apply(this,arguments)}var Ec=[Mt({oaId:gt()})];function Sc(e){return Pc.apply(this,arguments)}function Pc(){return Pc=J((function(e){return X(this,(function(t){return[2,hi("isAllowedInteractWithOA",Ec,[e],function(){var e=J((function(e){var t,n,r;return X(this,(function(i){switch(i.label){case 0:return In.isMp?(t=e.oaId,[4,ni.getAccessToken()]):[3,4];case 1:return!(n=i.sent())||vr.isEmpty(n)?[3,3]:[4,gc(t,o,n)];case 2:return r=i.sent(),[2,Promise.resolve({status:0===(null==r?void 0:r.err)})];case 3:return[2,Promise.resolve({status:!1})];case 4:return In.isMpWeb?[2,Promise.resolve({status:!1})]:[2,Promise.reject(Nn("IsAllowedInteractWithOA",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Pc.apply(this,arguments)}function Oc(e){return Ac.apply(this,arguments)}function Ac(){return(Ac=J((function(e){return X(this,(function(t){return[2,hi("getSetting",[],[e],J((function(){return X(this,(function(e){switch(e.label){case 0:return In.isMp?[4,$r()]:[3,2];case 1:return[2,e.sent()];case 2:return In.isMpWeb?[2,Promise.resolve({authSetting:{}})]:[2,Promise.reject(Nn("getSetting",{}))]}}))})))]}))}))).apply(this,arguments)}var kc=En.enum(["scope.userInfo","scope.userLocation","scope.userPhonenumber"]),Ic=[Mt({scopes:En.array(kc).max(2).optional()}).optional()];function Cc(e){return Nc.apply(this,arguments)}function Nc(){return Nc=J((function(e){return X(this,(function(t){return[2,hi("authorize",Ic,[e],function(){var e=J((function(e){var t,n,r,i;return X(this,(function(o){switch(o.label){case 0:return In.isMp?(n=null==e?void 0:e.scopes,r=Fr(),("android"===(i=((null===(t=kn())||void 0===t?void 0:t.platformName)||"").toLowerCase())&&r<724||"ios"===i&&r<573)&&n&&n.length>0?[2,Promise.reject(Yr.error.clientNotSupport())]:[4,ei(null!=n?n:void 0)]):[3,2];case 1:return[2,o.sent()];case 2:return In.isMpWeb?[2,Promise.resolve({})]:[2,Promise.reject(Nn("authorize",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Nc.apply(this,arguments)}var Mc=J((function(){return X(this,(function(e){return[2,new Promise(function(){var e=J((function(e,t){var n;return X(this,(function(r){switch(r.label){case 0:return vr.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(Yr.error.clientNotSupport()),[2]}}))}));return function(t,n){return e.apply(this,arguments)}}())]}))}));function xc(e){return hi("checkZaloCameraPermission",[],[e],J((function(){return X(this,(function(e){switch(e.label){case 0:return[4,Mc()];case 1:return[2,e.sent()]}}))})))}var Rc=J((function(){return X(this,(function(e){return[2,new Promise(function(){var e=J((function(e,t){var n,r,i;return X(this,(function(o){switch(o.label){case 0:return o.trys.push([0,2,,3]),[4,ni.jumpAndGetToken()];case 1:return o.sent(),r=null===(n=ni.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 Dc(e){return jc.apply(this,arguments)}function jc(){return(jc=J((function(e){return X(this,(function(t){return[2,hi("getUserID",[],[e],J((function(){return X(this,(function(e){switch(e.label){case 0:return In.isMp?[4,Rc()]:[3,2];case 1:return[2,e.sent()];case 2:return In.isMpWeb?[2,Promise.resolve(void 0)]:[2,Promise.reject(Nn("getUserID",{}))]}}))})))]}))}))).apply(this,arguments)}var Uc=J((function(){return X(this,(function(e){return[2,new Promise(function(){var e=J((function(e,t){var n,r,i;return X(this,(function(o){switch(o.label){case 0:return o.trys.push([0,2,,3]),[4,ni.jumpAndGetToken()];case 1:return o.sent(),r=null===(n=ni.miniProgramConfig)||void 0===n?void 0:n.idToken,e(r),[3,3];case 2:return i=o.sent(),t(i),[3,3];case 3:return[2]}}))}));return function(t,n){return e.apply(this,arguments)}}())]}))}));function Bc(e){return Lc.apply(this,arguments)}function Lc(){return(Lc=J((function(e){return X(this,(function(t){return[2,hi("getIDToken",[],[e],J((function(){return X(this,(function(e){switch(e.label){case 0:return In.isMp?[4,Uc()]:[3,2];case 1:return[2,e.sent()];case 2:return In.isMpWeb?[2,Promise.resolve(void 0)]:[2,Promise.reject(Nn("getIDToken",{}))]}}))})))]}))}))).apply(this,arguments)}var Zc={format:e.PhotoFormat.JPEG,quality:e.PhotoQuality.NORMAL,mirrored:!1,useVideoSourceSize:!1},zc={width:1024,height:768,facingMode:e.FacingMode.FRONT,mirrored:!1,audio:!1,video:!0},Wc=function(){function t(n){var r,i,o,a,s,u=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,c=this;yr(this,t),this._videoEnabled=!0,this._audioEnabled=null,this.tick=function(){if(c.haveVideoStream()&&c._userRequestFrameCallback){var t=c.getCanvas();if(c.drawFrame(),t){var n={data:t.toDataURL(e.PhotoFormat.PNG),width:t.width,height:t.height};Ir.getInstance().emit(e.CameraEvents.OnFrameCallback,0,n),requestAnimationFrame(c.tick)}}},this._videoElement=n,this._mediaConstraints=null!=u?u:null,this._facingMode=null!==(r=null==u?void 0:u.facingMode)&&void 0!==r?r:zc.facingMode,this._cameraList=[],this._stream=null,this._selectedDeviceId=null!==(i=null==u?void 0:u.deviceId)&&void 0!==i?i:"",this._canvasElement=null,this._ctx=null,this._hasUserMedia=!1,this._mirror=null!==(o=null==u?void 0:u.mirrored)&&void 0!==o?o:zc.mirrored,this._userRequestFrameCallback=!1,this._audioEnabled=null!==(a=null==u?void 0:u.audio)&&void 0!==a?a:zc.audio,this._videoEnabled=null!==(s=null==u?void 0:u.video)&&void 0!==s?s:zc.video}var n=t.prototype;return n.on=function(t,n){Ir.getInstance().on(t,(function(e){n(e)})),t===e.CameraEvents.OnFrameCallback&&(this._userRequestFrameCallback=!0,this.tick())},n.off=function(t){Ir.getInstance().off(t),t===e.CameraEvents.OnFrameCallback&&(this._userRequestFrameCallback=!1)},n.getQualityNumber=function(e){switch(e){case"high":return.9;case"normal":default:return.6;case"low":return.2}},n.getFacingMode=function(){return this._facingMode},n.getCameraList=function(){return this._cameraList},n.getCameraCount=function(){return this._cameraList.length},n.getSelectedDeviceId=function(){return this._selectedDeviceId},n.setDeviceId=function(e){var t=this;return J((function(){return X(this,(function(n){switch(n.label){case 0:return t._selectedDeviceId=e,t._hasUserMedia?[4,t.stream()]:[3,2];case 1:n.sent(),n.label=2;case 2:return[2]}}))}))()},n.getVideoInputs=function(e){var t=this;return this._cameraList=[],e.forEach((function(e){"videoinput"===e.kind&&t._cameraList.push(e)})),this._cameraList},n.updateMediaConstraints=function(e){var t=this;return J((function(){var n,r,i,o,a,s;return X(this,(function(u){switch(u.label){case 0:return vr.isEmpty(e)?[2]:JSON.stringify(e)!==JSON.stringify(t._mediaConstraints)?(t._mediaConstraints=e,t._facingMode=null!==(n=null==e?void 0:e.facingMode)&&void 0!==n?n:t._facingMode,t._selectedDeviceId=null!==(r=null==e?void 0:e.deviceId)&&void 0!==r?r:t._selectedDeviceId,t._mirror=null!==(i=null==e?void 0:e.mirrored)&&void 0!==i?i:t._mirror,t._audioEnabled=null!==(o=null==e?void 0:e.audio)&&void 0!==o?o:t._audioEnabled,t._videoEnabled=null!==(a=null==e?void 0:e.video)&&void 0!==a?a:t._videoEnabled,t._selectedDeviceId=null!==(s=null==e?void 0:e.deviceId)&&void 0!==s?s:t._selectedDeviceId,t._hasUserMedia?[4,t.stream()]:[3,2]):[2];case 1:u.sent(),u.label=2;case 2:return[2]}}))}))()},n.getCurrentMediaConstraints=function(){var e=this._mediaConstraints,t={};this._videoElement.width=(null==e?void 0:e.width)||this._videoElement.width||zc.width,this._videoElement.height=(null==e?void 0:e.height)||this._videoElement.height||zc.height;var n=!1!==this._videoEnabled,r=!1!==this._audioEnabled;return n&&(""==this._selectedDeviceId&&null!==this._facingMode?t.facingMode=this._facingMode:t.deviceId={exact:this._selectedDeviceId},t.width={exact:this._videoElement.width},t.height={exact:this._videoElement.height}),{video:!!n&&t,audio:r}},n.selectCamera=function(){var t=!0,n=!1,r=void 0;try{for(var i,o=this._cameraList[Symbol.iterator]();!(t=(i=o.next()).done);t=!0){var a=i.value;if(this._facingMode==e.FacingMode.FRONT&&a.label.toLowerCase().includes("front")||this._facingMode==e.FacingMode.BACK&&a.label.toLowerCase().includes("back")){this._selectedDeviceId=a.deviceId;break}}}catch(e){n=!0,r=e}finally{try{t||null==o.return||o.return()}finally{if(n)throw r}}},n.flip=function(){var t=this;return J((function(){return X(this,(function(n){switch(n.label){case 0:return t._facingMode=t._facingMode==e.FacingMode.FRONT?e.FacingMode.BACK:e.FacingMode.FRONT,t._videoElement.style.transform="",t.selectCamera(),t._hasUserMedia?[4,t.stream()]:[3,2];case 1:n.sent(),n.label=2;case 2:return[2]}}))}))()},n.start=function(){var t=this;return J((function(){var n,r;return X(this,(function(i){return n=Ir.getInstance(),r=function(e){try{t._hasUserMedia&&t.stop()}catch(e){}},n.off(e.Events.AppPaused,r),n.on(e.Events.AppPaused,r),[2,new Promise(function(){var n=J((function(n,r){var i;return X(this,(function(o){switch(o.label){case 0:return o.trys.push([0,2,,3]),[4,t.stream()];case 1:return o.sent(),Ir.getInstance().emit(e.CameraEvents.OnStartCallback,0),n(t._selectedDeviceId),[3,3];case 2:return i=o.sent(),r(i),[3,3];case 3:return[2]}}))}));return function(e,t){return n.apply(this,arguments)}}())]}))}))()},n.info=function(){var e=this;return J((function(){return X(this,(function(t){return[2,new Promise((function(t,n){navigator.mediaDevices.enumerateDevices().then((function(n){e.getVideoInputs(n),t(e._cameraList)})).catch((function(e){n(e)}))}))]}))}))()},n.stream=function(){var e=this;return J((function(){return X(this,(function(t){return[2,new Promise((function(t,n){try{e._stop();var r=e.getCurrentMediaConstraints();if(!1===r.video&&!r.audio)return void t(e._facingMode);navigator.mediaDevices.getUserMedia(r).then(function(){var n=J((function(n){return X(this,(function(r){switch(r.label){case 0:return[4,e.info()];case 1:return r.sent(),e.selectCamera(),e.handleUserMedia(null,n),t(e._facingMode),[2]}}))}));return function(e){return n.apply(this,arguments)}}()).catch((function(t){e.handleUserMedia(t),n(t)}))}catch(e){n(e)}}))]}))}))()},n.handleUserMedia=function(t,n){var r=this;if(!t&&n){this._stream=n;try{this._videoElement&&(this._videoElement.srcObject=n,(this._facingMode==e.FacingMode.FRONT||this._mirror)&&(this._videoElement.style.transform="scale(-1,1)"),this._videoElement.onloadedmetadata=function(){r._userRequestFrameCallback&&r.tick()},this._videoElement.play().then((function(){r._hasUserMedia=!0})).catch((function(e){r._hasUserMedia=!1})))}catch(e){this._hasUserMedia=!1}}else this._hasUserMedia=!1},n.updateTrackEnable=function(t,n){var r=this;return J((function(){return X(this,(function(i){switch(i.label){case 0:if(t===e.StreamType.VIDEO){if(r._videoEnabled===n)return[2];r._videoEnabled=n}else{if(r._audioEnabled===n)return[2];r._audioEnabled=n}return[4,r.stream()];case 1:return i.sent(),[2]}}))}))()},n.pause=function(e){var t=this;return J((function(){return X(this,(function(n){switch(n.label){case 0:return[4,t.updateTrackEnable(e,!1)];case 1:return n.sent(),[2]}}))}))()},n.resume=function(e){var t=this;return J((function(){return X(this,(function(n){switch(n.label){case 0:return[4,t.updateTrackEnable(e,!0)];case 1:return n.sent(),[2]}}))}))()},n.isUsing=function(){return this._hasUserMedia},n.stop=function(){this._stop(),Ir.getInstance().emit(e.CameraEvents.OnStopCallback,0)},n._stop=function(){t.stopMediaStream(this._stream),this._hasUserMedia=!1},n.setFacingMode=function(e){this._facingMode=e},n.setMirror=function(e){this._mirror=e,this._videoElement&&(this._videoElement.style.transform=e?"scale(-1,1)":"")},n.takePhoto=function(e){if(!this._hasUserMedia)return null;var t=e||{},n=this.getCanvas(t);if(this.drawFrame(t),n){var r=t.format||Zc.format;return{data:n.toDataURL(r,this.getQualityNumber(t.quality)),width:n.width,height:n.height}}return null},n.haveVideoStream=function(){var e=this._videoElement;return e&&e.videoHeight>0&&this._hasUserMedia},n.getCanvas=function(e){var t=this._videoElement,n=e||{};if(!this.haveVideoStream())return null;if(!this._ctx){var r=t.videoWidth,i=t.videoHeight;if(!n.useVideoSourceSize){var o=r/i;i=(r=n.minScreenshotWidth||t.clientWidth)/o,n.minScreenshotHeight&&i<n.minScreenshotHeight&&(r=(i=n.minScreenshotHeight)*o)}this._canvasElement=document.createElement("canvas"),this._canvasElement.width=(null==n?void 0:n.width)||r,this._canvasElement.height=(null==n?void 0:n.height)||i,this._ctx=this._canvasElement.getContext("2d")}return this._canvasElement},n.drawFrame=function(t){var n=this._videoElement,r=t||{};if(n&&this._ctx&&this._canvasElement){var i=this._canvasElement,o=this._ctx;i.width=(null==r?void 0:r.width)||i.width,i.height=(null==r?void 0:r.height)||i.height,((null==r?void 0:r.mirrored)||this._mirror||this._facingMode===e.FacingMode.FRONT)&&(o.translate(i.width,0),o.scale(-1,1)),o.drawImage(n,0,0,i.width,i.height),((null==r?void 0:r.mirrored)||this._mirror||this._facingMode===e.FacingMode.FRONT)&&(o.scale(-1,1),o.translate(-i.width,0))}},t.stopMediaStream=function(e){e&&(e.getVideoTracks&&e.getAudioTracks?(e.getVideoTracks().map((function(t){e.removeTrack(t),t.stop()})),e.getAudioTracks().map((function(t){e.removeTrack(t),t.stop()}))):e.stop())},t}(),Fc=Mt({play:En.function(),pause:En.function()}).refine((function(e){return"play"in e&&"pause"in e}),{message:"Invalid HTMLVideoElement"}),Gc=[Mt({videoElement:Fc,mediaConstraints:En.object({width:En.number().min(100).optional(),height:En.number().min(100).optional(),facingMode:En.string().optional(),audio:En.boolean().optional(),video:En.boolean().optional(),deviceId:En.string().optional(),mirrored:En.boolean().optional()}).nullish()}).optional()];function Hc(e){return hi("createCameraContext",Gc,[e],(function(e){return console.log("createCameraContext",e),new Wc(e.videoElement,e.mediaConstraints)}))}var Vc=function(){function e(){var t,n;yr(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;vr.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?vr.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?vr.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 Kc(e){return Jc.apply(this,arguments)}function Jc(){return(Jc=J((function(e){return X(this,(function(t){return[2,hi("setupAd",[],[e],(function(){return Vc.getInstance().loadSDK()}))]}))}))).apply(this,arguments)}var qc=[Mt({ids:En.union([En.string(),En.array(En.string())]),config:Mt({display:En.boolean().optional(),onClose:En.function().optional()}).optional()})];function $c(e){return Qc.apply(this,arguments)}function Qc(){return Qc=J((function(e){return X(this,(function(t){return[2,hi("loadAd",qc,[e],function(){var e=J((function(e){return X(this,(function(t){return Vc.getInstance().load(e.ids,e.config),[2]}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Qc.apply(this,arguments)}var Yc=[Mt({id:En.string()})];function Xc(e){return el.apply(this,arguments)}function el(){return el=J((function(e){return X(this,(function(t){return[2,hi("displayAd",Yc,[e],function(){var e=J((function(e){return X(this,(function(t){return Vc.getInstance().display(e.id),[2]}))}));return function(t){return e.apply(this,arguments)}}())]}))})),el.apply(this,arguments)}var tl=[Mt({id:En.string().optional()}).optional()];function nl(e){return rl.apply(this,arguments)}function rl(){return rl=J((function(e){return X(this,(function(t){return[2,hi("refreshAd",tl,[e],function(){var e=J((function(e){return X(this,(function(t){return Vc.getInstance().refresh(e.id),[2]}))}));return function(t){return e.apply(this,arguments)}}())]}))})),rl.apply(this,arguments)}var il=[Mt({id:gt(),guidingText:gt().optional(),color:gt().optional(),onStatusChange:En.function().optional()})];function ol(e){return al.apply(this,arguments)}function al(){return al=J((function(e){return X(this,(function(n){return[2,hi("showOAWidget",il,[e],function(){var e=J((function(e){var n,r,i,o,a,s,u,c;return X(this,(function(l){if(In.isMp){try{n=document.getElementById(e.id),r=e.onStatusChange,i=e.guidingText,o=e.color,a=t(e,["onStatusChange","guidingText","color"]),n&&(s=document.createElement("iframe"),u="iframeOAWidget_".concat(Date.now()),(c=new URL("https://h5.zalo.me/widgets/oa_widget.html")).searchParams.set("id",u),i&&c.searchParams.set("guidingText",i),o&&c.searchParams.set("color",o),Object.entries(a).forEach((function(e){var t=Rn(e,2),n=t[0],r=t[1];r&&c.searchParams.set("data-".concat(n),String(r))})),s.id=u,s.src=c.href,s.style.width="100%",s.style.height="100%",s.style.border="none",n.innerHTML=s.outerHTML,window.addEventListener("message",function(){var e=J((function(e){var t,n,i,o,a,s,l,d;return X(this,(function(p){switch(p.label){case 0:return t=e.data,e.origin.startsWith("https://h5.zalo.me")?(n=document.getElementById(u),i=t.type,(o=new URL(t.href)).origin!==c.origin||o.pathname!==c.pathname||t.id!==u?[3,3]:"followOA"!==i&&"getOAInfo"!==i?[3,2]:[4,ni.jumpAndGetToken()]):[3,3];case 1:return p.sent(),l=null===(a=ni.miniProgramConfig)||void 0===a?void 0:a.jwt,null==n||null===(s=n.contentWindow)||void 0===s||s.postMessage({type:i,payload:{jwt:l}},"*"),[3,3];case 2:"oaInfo"===i?null==r||r(null===(d=t.payload)||void 0===d?void 0:d.followed):"openOA"===i?Go(t.payload.id,"oa"):"heightChange"===i&&(n.style.height="".concat(t.payload,"px")),p.label=3;case 3:return[2]}}))}));return function(t){return e.apply(this,arguments)}}(),!1))}catch(e){console.log(e)}return[2,Promise.resolve()]}return In.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Nn("openMiniApp",{}))]}))}));return function(t){return e.apply(this,arguments)}}())]}))})),al.apply(this,arguments)}var sl=[Mt({id:gt(),type:gt(),text:gt(),color:gt().optional(),disabled:En.boolean().optional(),onDataReceived:En.function().optional(),onError:En.function().optional()})];function ul(e){return cl.apply(this,arguments)}function cl(){return cl=J((function(e){return X(this,(function(n){return[2,hi("showFunctionButtonWidget",sl,[e],function(){var e=J((function(e){var n,r,i,o,a,s,u;return X(this,(function(c){if(In.isMp){try{n=document.getElementById(e.id),r=e.onDataReceived,i=e.onError,o=t(e,["onDataReceived","onError"]),n&&(a=document.createElement("iframe"),s="iframeFunctionButtonWidget".concat(Date.now()),(u=new URL("https://h5.zalo.me/widgets/function_button_widget.html")).searchParams.set("id",s),Object.entries(o).forEach((function(e){var t=Rn(e,2),n=t[0],r=t[1];r&&u.searchParams.set("data-".concat(n),String(r))})),a.id=s,a.src=u.href,a.style.width="100%",a.style.height="100%",a.style.border="none",Object.entries(o).forEach((function(e){var t=Rn(e,2),n=t[0],r=t[1];r&&a.setAttribute("data-".concat(n),String(r))})),n.innerHTML=a.outerHTML,window.addEventListener("message",function(){var e=J((function(e){var t,n,a,c,l,d,p,f,h,m,v,y;return X(this,(function(g){switch(g.label){case 0:return t=e.data,e.origin.startsWith("https://h5.zalo.me")?(n=document.getElementById(s),a=t.type,(c=new URL(t.href)).origin!==u.origin||c.pathname!==u.pathname||t.id!==s?[3,4]:"buttonClicked"!==a?[3,3]:[4,ni.jumpAndGetToken()]):[3,4];case 1:return g.sent(),f=null===(l=ni.miniProgramConfig)||void 0===l?void 0:l.jwt,h=null===(d=ni.miniProgramConfig)||void 0===d?void 0:d.encryptKey,[4,yi()];case 2:return m=g.sent(),null==n||null===(p=n.contentWindow)||void 0===p||p.postMessage({type:a,payload:{jwt:f,encryptKey:h,accessToken:m}},"*"),[3,4];case 3:"onSuccess"===a?(null==(v=t.payload)?void 0:v.type)===o.type&&(null==r||r(null==v?void 0:v.data)):"onError"===a&&(null==(y=t.payload)?void 0:y.type)===o.type&&(null==i||i(null==y?void 0:y.data)),g.label=4;case 4:return[2]}}))}));return function(t){return e.apply(this,arguments)}}(),!1))}catch(e){console.log(e)}return[2,Promise.resolve()]}return In.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Nn("openMiniApp",{}))]}))}));return function(t){return e.apply(this,arguments)}}())]}))})),cl.apply(this,arguments)}window.ZaloMiniAppSDK={getVersion:wi},mi();var ll=Object.freeze({__proto__:null,get Events(){return e.Events},get EventName(){return e.Events},get CameraEvents(){return e.CameraEvents},login:mi,getAccessToken:yi,getVersion:wi,getSystemInfo:Ti,setNavigationBarTitle:Oi,setNavigationBarColor:Ii,setNavigationBarLeftButton:Mi,setStorage:io,getStorage:so,getStorageInfo:co,removeStorage:fo,clearStorage:vo,getUserInfo:wo,getNetworkType:So,onNetworkStatusChange:Ao,startBeaconDiscovery:Co,stopBeaconDiscovery:xo,getBeacons:jo,closeApp:Lo,scanQRCode:Wo,openProfile:Vo,openChat:$o,openPostFeed:ta,followOA:oa,unfollowOA:ca,openShareSheet:ha,requestCameraPermission:ya,createShortcut:Ea,openBioAuthentication:Aa,checkStateBioAuthentication:Ca,showToast:Ra,hideKeyboard:Ua,openPhone:za,openSMS:Ha,viewOAQr:qa,keepScreen:Xa,onKeepScreen:ts,offKeepScreen:rs,saveImageToGallery:ss,openMiniApp:ds,vibrate:ms,openWebview:_s,getRouteParams:Ts,getAppInfo:Es,sendDataToPreviousMiniApp:As,getPhoneNumber:Cs,openProfilePicker:Rs,connectWifi:Bs,openMediaPicker:Ws,getShareableLink:Hs,closeLoading:Js,requestUpdateZalo:$s,onConfirmToExit:eu,offConfirmToExit:tu,getDeviceId:nu,getDeviceIdAsync:ru,getContext:ou,getContextAsync:au,getAuthCode:uu,getZPIToken:lu,setAccessToken:fu,openOutApp:mu,chooseImage:gu,getLocation:bu,onCallbackData:Su,createOrder:ku,selectPaymentMethod:Mu,checkTransaction:Du,events:Ys,setAndroidBottomNavigationBar:Bu,setIOSBottomSafeArea:zu,setStatusBar:Gu,configAppView:Ku,createOrderIAP:Qu,minimizeApp:ec,openPermissionSetting:rc,favoriteApp:ac,openGroupList:cc,requestSendNotification:pc,addRating:mc,interactOA:bc,interactOa:bc,isAllowedInteractWithOA:Sc,getSetting:Oc,authorize:Cc,checkZaloCameraPermission:xc,getUserID:Dc,getIDToken:Bc,createCameraContext:Hc,setupAd:Kc,loadAd:$c,displayAd:Xc,refreshAd:nl,showOAWidget:ol,showFunctionButtonWidget:ul,get FacingMode(){return e.FacingMode},get PhotoFormat(){return e.PhotoFormat},get PhotoQuality(){return e.PhotoQuality},get StreamType(){return e.StreamType},ZMACameraImp:Wc}),dl=ku,pl=Du,fl=Qu,hl=Mu,ml=t(ll,["createOrder","checkTransaction","createOrderIAP","selectPaymentMethod"]),vl={createOrder:dl,checkTransaction:pl,createOrderIAP:fl,selectPaymentMethod:hl};!function(){var e,t=null===(e=kn())||void 0===e?void 0:e.appEnv;(null==t?void 0:t.isMp)&&(window.ZaloMiniAppSDK={},Object.assign(window.ZaloMiniAppSDK,ll))}(),e.EventName=e.Events,e.Payment=vl,e.ZMACameraImp=Wc,e.addRating=mc,e.authorize=Cc,e.checkStateBioAuthentication=Ca,e.checkTransaction=Du,e.checkZaloCameraPermission=xc,e.chooseImage=gu,e.clearStorage=vo,e.closeApp=Lo,e.closeLoading=Js,e.configAppView=Ku,e.connectWifi=Bs,e.createCameraContext=Hc,e.createOrder=ku,e.createOrderIAP=Qu,e.createShortcut=Ea,e.default=ml,e.displayAd=Xc,e.events=Ys,e.favoriteApp=ac,e.followOA=oa,e.getAccessToken=yi,e.getAppInfo=Es,e.getAuthCode=uu,e.getBeacons=jo,e.getContext=ou,e.getContextAsync=au,e.getDeviceId=nu,e.getDeviceIdAsync=ru,e.getIDToken=Bc,e.getLocation=bu,e.getNetworkType=So,e.getPhoneNumber=Cs,e.getRouteParams=Ts,e.getSetting=Oc,e.getShareableLink=Hs,e.getStorage=so,e.getStorageInfo=co,e.getSystemInfo=Ti,e.getUserID=Dc,e.getUserInfo=wo,e.getVersion=wi,e.getZPIToken=lu,e.hideKeyboard=Ua,e.interactOA=bc,e.interactOa=bc,e.isAllowedInteractWithOA=Sc,e.keepScreen=Xa,e.loadAd=$c,e.login=mi,e.minimizeApp=ec,e.offConfirmToExit=tu,e.offKeepScreen=rs,e.onCallbackData=Su,e.onConfirmToExit=eu,e.onKeepScreen=ts,e.onNetworkStatusChange=Ao,e.openBioAuthentication=Aa,e.openChat=$o,e.openGroupList=cc,e.openMediaPicker=Ws,e.openMiniApp=ds,e.openOutApp=mu,e.openPermissionSetting=rc,e.openPhone=za,e.openPostFeed=ta,e.openProfile=Vo,e.openProfilePicker=Rs,e.openSMS=Ha,e.openShareSheet=ha,e.openWebview=_s,e.refreshAd=nl,e.removeStorage=fo,e.requestCameraPermission=ya,e.requestSendNotification=pc,e.requestUpdateZalo=$s,e.saveImageToGallery=ss,e.scanQRCode=Wo,e.selectPaymentMethod=Mu,e.sendDataToPreviousMiniApp=As,e.setAccessToken=fu,e.setAndroidBottomNavigationBar=Bu,e.setIOSBottomSafeArea=zu,e.setNavigationBarColor=Ii,e.setNavigationBarLeftButton=Mi,e.setNavigationBarTitle=Oi,e.setStatusBar=Gu,e.setStorage=io,e.setupAd=Kc,e.showFunctionButtonWidget=ul,e.showOAWidget=ol,e.showToast=Ra,e.startBeaconDiscovery=Co,e.stopBeaconDiscovery=xo,e.unfollowOA=ca,e.vibrate=ms,e.viewOAQr=qa,Object.defineProperty(e,"__esModule",{value:!0})}));