zmp-sdk 2.51.0-beta.2 → 2.51.0-beta.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index.umd.js CHANGED
@@ -1,8 +1,8 @@
1
1
  /**
2
- * @timeBuild 22-12-2025 15:58:34
2
+ * @timeBuild 28-01-2026 11:02:33
3
3
  * @license zmp-sdk
4
4
  *
5
- * Copyright @ 2025. Zalo Group.
5
+ * Copyright @ 2026. Zalo Group.
6
6
  *
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
  */
@@ -21,4 +21,4 @@
21
21
 
22
22
  See the Apache Version 2.0 License for specific language governing permissions
23
23
  and limitations under the License.
24
- ***************************************************************************** */}((function(e){var t=Object.prototype.hasOwnProperty,n="~";function r(){}function i(e,t,n){this.fn=e,this.context=t,this.once=n||!1}function o(e,t,r,o,a){if("function"!=typeof r)throw new TypeError("The listener must be a function");var s=new i(r,o||e,a),u=n?n+t:t;return e._events[u]?e._events[u].fn?e._events[u]=[e._events[u],s]:e._events[u].push(s):(e._events[u]=s,e._eventsCount++),e}function a(e,t){0==--e._eventsCount?e._events=new r:delete e._events[t]}function s(){this._events=new r,this._eventsCount=0}Object.create&&(r.prototype=Object.create(null),(new r).__proto__||(n=!1)),s.prototype.eventNames=function(){var e,r,i=[];if(0===this._eventsCount)return i;for(r in e=this._events)t.call(e,r)&&i.push(n?r.slice(1):r);return Object.getOwnPropertySymbols?i.concat(Object.getOwnPropertySymbols(e)):i},s.prototype.listeners=function(e){var t=n?n+e:e,r=this._events[t];if(!r)return[];if(r.fn)return[r.fn];for(var i=0,o=r.length,a=new Array(o);i<o;i++)a[i]=r[i].fn;return a},s.prototype.listenerCount=function(e){var t=n?n+e:e,r=this._events[t];return r?r.fn?1:r.length:0},s.prototype.emit=function(e,t,r,i,o,a){var s=n?n+e:e;if(!this._events[s])return!1;var u,c,l=this._events[s],d=arguments.length;if(l.fn){switch(l.once&&this.removeListener(e,l.fn,void 0,!0),d){case 1:return l.fn.call(l.context),!0;case 2:return l.fn.call(l.context,t),!0;case 3:return l.fn.call(l.context,t,r),!0;case 4:return l.fn.call(l.context,t,r,i),!0;case 5:return l.fn.call(l.context,t,r,i,o),!0;case 6:return l.fn.call(l.context,t,r,i,o,a),!0}for(c=1,u=new Array(d-1);c<d;c++)u[c-1]=arguments[c];l.fn.apply(l.context,u)}else{var p,f=l.length;for(c=0;c<f;c++)switch(l[c].once&&this.removeListener(e,l[c].fn,void 0,!0),d){case 1:l[c].fn.call(l[c].context);break;case 2:l[c].fn.call(l[c].context,t);break;case 3:l[c].fn.call(l[c].context,t,r);break;case 4:l[c].fn.call(l[c].context,t,r,i);break;default:if(!u)for(p=1,u=new Array(d-1);p<d;p++)u[p-1]=arguments[p];l[c].fn.apply(l[c].context,u)}}return!0},s.prototype.on=function(e,t,n){return o(this,e,t,n,!1)},s.prototype.once=function(e,t,n){return o(this,e,t,n,!0)},s.prototype.removeListener=function(e,t,r,i){var o=n?n+e:e;if(!this._events[o])return this;if(!t)return a(this,o),this;var s=this._events[o];if(s.fn)s.fn!==t||i&&!s.once||r&&s.context!==r||a(this,o);else{for(var u=0,c=[],l=s.length;u<l;u++)(s[u].fn!==t||i&&!s[u].once||r&&s[u].context!==r)&&c.push(s[u]);c.length?this._events[o]=1===c.length?c[0]:c:a(this,o)}return this},s.prototype.removeAllListeners=function(e){var t;return e?(t=n?n+e:e,this._events[t]&&a(this,t)):(this._events=new r,this._eventsCount=0),this},s.prototype.off=s.prototype.removeListener,s.prototype.addListener=s.prototype.on,s.prefixed=n,s.EventEmitter=s,e.exports=s})),Ft={enablePaymentDone:!1};function Gt(e){var t=e.data;return{orderId:t.zmpOrderId||t.orderId,transId:t.appTransID||t.apptransid||t.transId}}var Vt="ACTION_CALLBACK";function Ht(t,n,r,i){switch(!0){case"string"==typeof r||null===r:return[{eventName:t,eventId:n,data:r}];case t===e.Events.OpenApp&&(null==i?void 0:i.enablePaymentDone):var o=function(e){var t=new URL(e,window.location.origin),n=t.pathname.split("/")[3].toUpperCase().replace(/-/g,"_"),r={},i=t.searchParams.get("orderId"),o=t.searchParams.get("zmpOrderId"),a=t.searchParams.get("appTransID")||t.searchParams.get("apptransid");switch(n){case"MOMO":case"MOMO_SANDBOX":r.orderId=o,r.transId=i;break;default:r.orderId=o||i,r.transId=a}return r}(r.path);return[{eventName:e.Events.PaymentDone,eventId:n,data:o}];case t===e.Events.OnDataCallback:if(["PAY_BY_BANK","PAY_BY_CUSTOM_METHOD"].includes(null==r?void 0:r.eventType))return[{eventName:e.Events.OnDataCallback,eventId:n,data:r},{eventName:e.Events.PaymentDone,eventId:n,data:Gt(r)}];break;default:return[{eventName:t,eventId:n,data:r}]}}var Kt=function(t){Bt(r,t);var n=zt(r);function r(){var e;return Mt(this,r),(e=n.apply(this,arguments)).debug=St("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===Vt||t===e.Events.PaymentCallback)return Ut(Dt(r.prototype),"on",this).call(this,t,n,i);this.debug("register ".concat(String(t),": ").concat(i));return Ut(Dt(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===Vt)return Ut(Dt(r.prototype),"once",this).call(this,e,t,n);this.debug("register once ".concat(String(e),": ").concat(n));return Ut(Dt(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}(Wt);function Jt(e){Kt.getInstance().emit(Vt,e)}function qt(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){Jt({serialId:e,actionName:t,result:n})}},window.zaloJSV2={zalo_h5_event_handler:function(t,n,r){var i=St("zmp:zalo_h5_event_handler");i("eventId: ".concat(t,", eventName: ").concat(n,", eventData: ").concat(r));var a=kn(r);i("stringToData",a);var s=function(t,n){if(!n||"string"==typeof n)return n;try{if(t===e.Events.OpenApp){var r=n.url,i=new URL(r),a=i.pathname.split("/zapps/".concat(o))[1];return{path:"".concat(a||"/").concat(i.search)}}return n}catch(e){return n}}(n,a),u=Ht(n,t,s,Ft);null==u||u.forEach((function(e){Kt.getInstance().emit(e.eventName,e.eventId,e.data);var t=document.getElementById(Ae);t&&Zn(t,"appEvent",{eventName:e.eventName,eventId:e.eventId,data:e.data})}))}},window.zaloNative2JS={nativeCall:function(t,n,r){Kt.getInstance().emit(e.Events.PaymentCallback,t,n,r)}};var Qt={encode:qt,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:qt(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":Pt(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":Pt(r))?JSON.stringify(r):encodeURIComponent(r)].join("=");n.push(i)})),n.join("&")}},Yt={},$t=function(e,t,n){var r=t||"default";return function(){return(r in Yt?Yt[r](e,n):e).apply(this,arguments)}};$t.setWrapper=function(e){Yt[arguments.length<=1||void 0===arguments[1]?"default":arguments[1]]=e};var Xt={error:{code:1,error_subcode:1357046,message:"Received Invalid JSON reply.",type:"http"}};function en(e){try{return null===e?Xt:JSON.parse(e)}catch(e){return Xt}}var tn,nn={execute:function(e,t,n,r){n.suppress_http_code=1;var i=Qt.encode(n);"post"!=t&&(e=Qt.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=$t((function(){o=r,"onload"in i&&i.onload(n)}),"entry","XMLHttpRequest:load"),a=$t((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(en(e.responseText))},o.onerror=function(e){e.responseText?r(en(e.responseText)):r({error:{code:1,error_subcode:1357045,message:"unknown error (empty response)",status:e.status,type:"http"}})},o.send(i),!0)}},rn=nn,on=(tn=Ne((function(e,t,n){var r,i,o,a;return Le(this,(function(s){switch(s.label){case 0:return r={appId:e,versionStatus:t},Nt.isUndefined(n)||(r.currentVersion=n),i=Qt.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 tn.apply(this,arguments)});function an(e){try{var t=e.map((function(e){return{action:e.action,error:e.error,message:e.message,data:e.data}}));rn.execute(d.SEND_ACTION_LOG,"post",{appId:window.APP_ID,data:JSON.stringify(t)},(function(){}))}catch(e){}}var sn=function(e){return e.replace(/[A-Z]/g,(function(e){return"_".concat(e.toLowerCase())}))},un=function(){var e;return"android"===((null===(e=Fe())||void 0===e?void 0:e.platformName)||"").toLowerCase()},cn=function(){var e;return"ios"===((null===(e=Fe())||void 0===e?void 0:e.platformName)||"").toLowerCase()};function ln(e){var t=String(e);try{if(/^\d{9}$/.test(t)&&"0"===t[5])return Number(t.slice(0,5)+t.slice(6))}catch(e){}return Number(t)}var dn=function(){var e,t=0;if(window.zaloVersionCode)return ln(window.zaloVersionCode);var n=Number((null===(e=Fe())||void 0===e?void 0:e.zaloVersion)||"0");return n>=24112e3?t=n:un()?t=n%1e4:cn()&&(t=n),ln(t)};function pn(e,t){if(window.isAPISupport&&"function"==typeof window.isAPISupport)return window.isAPISupport(e,t);var n=dn();return un()?n>=e:!!cn()&&n>=t}function fn(e,t){return null!=t&&"undefined"!=typeof Symbol&&t[Symbol.hasInstance]?!!t[Symbol.hasInstance](e):e instanceof t}var hn,mn=function(){function e(t,n,r,i){Mt(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}(),vn=function(e,t){return fn(e,mn)?function(e,t){return e.api=t,e.toJSON()}(e,t):function(e,t){return fn(e,Error)?new mn(m,e.message,t).toJSON():Nt.isEmpty(null==e?void 0:e.message)||Nt.isEmpty(null==e?void 0:e.code)?new mn(m,O,t,e).toJSON():new mn(e.code,e.message,t,e.detail).toJSON()}(e,t)},yn=(hn=Ne((function(e){var t;return Le(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,Je({method:"GET"},t))];case 1:return[4,n.sent().json()];case 2:return[2,n.sent()]}}))})),function(e){return hn.apply(this,arguments)}),gn=Ne((function(){return Le(this,(function(e){return[2,new Promise(function(){var e=Ne((function(e,t){var n,r,i,o;return Le(this,(function(a){switch(a.label){case 0:return a.trys.push([0,3,,4]),[4,Sn.jumpAndGetToken()];case 1:return a.sent(),(r=null===(n=Sn.miniProgramConfig)||void 0===n?void 0:n.jwt)||t(new mn(g,N,"getSetting")),[4,yn(r)];case 2:return(i=a.sent())&&0===i.err?e({authSetting:i.data}):t(new mn(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)}}())]}))})),_n=function(){var t,n,r,i=Fe(),o={},a=Kt.getInstance(),s=[],u=!1;return u||(n=function(t){var n=t.serialId,r=Cn(t.result),i=xn(null==r?void 0:r.action),u=Nt.isEmpty(null==r?void 0:r.error_code)?0:null==r?void 0:r.error_code,c=null==r?void 0:r.error_message,l=(null==r?void 0:r.data)||r;if(i&&0===u){var d=JSON.parse(null==r?void 0:r.data);u=Nt.isEmpty(null==d?void 0:d.error_code)?0:null==d?void 0:d.error_code,c=null==d?void 0:d.error_message,l=(null==d?void 0:d.data)||d}var p={error_code:u,error_message:c,data:l,action:(null==r?void 0:r.action)||t.actionName};if(n&&o[n]){var f=o[n],h=f.callback,m=f.timeout,v=f.isMultiCallback,y=f.options,g=f.downloadListener;!function(e,t){var n=t||{},r=n.success,i=n.fail;0===e.error_code?Nt.isFunction(r)&&r(e):Nt.isFunction(i)&&i(e)}(p,h),!v&&delete o[n],m&&clearTimeout(m);var _={action:null==p?void 0:p.action,error:null==p?void 0:p.error_code,message:null==p?void 0:p.error_message,data:{}};try{if("action.open.inapp"===p.action||"action.open.outapp"===p.action){var w=new URL(null==y?void 0:y.url),T="".concat(w.protocol,"//").concat(w.host).concat(w.pathname);_.data={url:T}}if("action.follow.oa"===p.action||"action.unfollow.oa"===p.action){var b=null==y?void 0:y.uid;_.data={uid:b}}if("action.open.chat"===p.action){var E=null==y?void 0:y.uId,P=null==y?void 0:y.type;_.data={uid:E,openChatType:P}}(null==y?void 0:y.onProgress)&&g&&a.off(e.Events.DownloadProgress,g)}catch(e){}s.push(_)}},Kt.getInstance().on(Vt,n),a.on(e.Events.AppPaused,(function(){if(s.length>0){var e=s;s=[],an(e)}})),t?clearInterval(t):t=setInterval((function(){if(s.length>0){var e=s;s=[],an(e)}}),5e3),u=!0),r=Ne((function(t,n,r,s){var u,c,l,d,p,f,h,m,v,y,T,b,E,P,S,I,A,O,k,N,M,D,L;return Le(this,(function(U){switch(U.label){case 0:return c=Math.floor(1e6*Math.random()),l="".concat(t,"_").concat(c),d=jn(t),(null==s?void 0:s.actionName)&&s.actionName.length>0&&(d=null==s?void 0:s.actionName),p=(null==s?void 0:s.isMultiCallback)||!1,f=!1!==(null==s?void 0:s.timeout)&&((null==s?void 0:s.timeout)||!0),h=(null==s?void 0:s.haveCallback)||!1,m=(null==s?void 0:s.skipJump)||!1,v=(null==s?void 0:s.requireAccessToken)||!1,y=Dn(d),n&&r&&(o[l]={options:n,callback:r,isMultiCallback:p},f&&h&&(o[l].timeout=setTimeout((function(){return Jt({serialId:l,result:{error_code:w,error_message:C,data:{timeout:f},action:t}}),null}),!0===f?8e3:1e3*f))),y?[4,gn()]:[3,2];case 1:if(!1===(null==(b=U.sent())||null===(T=b.authSetting)||void 0===T?void 0:T["scope.userInfo"]))return Jt({serialId:l,result:{error_code:g,error_message:x,data:{isMobile:null==i||null===(E=i.platform)||void 0===E?void 0:E.isMobile},action:t}}),[2];U.label=2;case 2:return P=xn(d),!(null==i||null===(u=i.platform)||void 0===u?void 0:u.isMobile)||!t||Nt.isUndefined(ZaloJavaScriptInterface)||i.platform.isIOS&&!On(t)||P&&!1===P.isSupported?(Jt({serialId:l,result:{error_code:_,error_message:R,data:{isMobile:null==i||null===(S=i.platform)||void 0===S?void 0:S.isMobile},action:t}}),[2]):(I=An(n),m?[3,4]:[4,Sn.getJSAccessToken()]);case 3:return O=U.sent(),[3,5];case 4:O="",U.label=5;case 5:A=O,U.label=6;case 6:return U.trys.push([6,10,,11]),m||!v?[3,8]:[4,Sn.getAccessToken()];case 7:return N=U.sent(),[3,9];case 8:N="",U.label=9;case 9:return k=N,[3,11];case 10:return M=U.sent(),Jt({serialId:l,result:{error_code:null==M?void 0:M.code,error_message:null==M?void 0:M.message,action:t}}),[2];case 11:try{n&&(null==n?void 0:n.onProgress)&&(D=function(e){!function(e,t){e.url;var n=e.progress;t&&t(n)}(e,null==n?void 0:n.onProgress)},o[l].downloadListener=D,a.on(e.Events.DownloadProgress,D))}catch(e){}return L=i.platform.isIOS?window.onNativeMessage(l,d):'window.onNativeMessage("'.concat(l,'", "').concat(d,'")'),[2,ZaloJavaScriptInterface.jsCall(A,d,k,I,L)]}}))})),function(e,t,n,i){return r.apply(this,arguments)}}(),wn={success:function(e,t){return{code:h,message:t||A,data:e||{}}},error:{failLimit:function(){return new mn(T,k)},badRequest:function(e){return new mn(v,e)},loginFailed:function(e){return new mn(g,"".concat(M,": ").concat(e))},loginRequired:function(){return new mn(g,N)},cannotGetShareInfo:function(){return new mn(y,"Can not get app info to share")},createIAPOrderFailed:function(e){var t=Object.keys(re).find((function(t){return t===e.toString()}));return new mn(e,t||O)},clientNotSupport:function(){return new mn(_,R)}}},Tn=function(t){var n,r,i,o=null===(n=Fe())||void 0===n?void 0:n.platformName,a=Un(t.action),s=W[a],u=(null==s?void 0:s.skipJump)||!1,c=(null==s?void 0:s.errorList)||{};if("JUMP_LOGIN"===a)return new mn(m,"Can not get auth code: ".concat(t.error_message));if(Sn.jumpStatus!==e.JumpStatus.DONE&&!u)return new mn(Z.UNAUTHORIZED.code,Z.UNAUTHORIZED.message);if("permission required!"===String(t.error_message).toLowerCase()||"no permission!"===String(t.error_message).toLowerCase())return new mn(Z.FORBIDDEN.code,Z.FORBIDDEN.message);if(o&&(null===(r=F[o])||void 0===r?void 0:r[t.error_code]))return new mn(F[o][t.error_code].code,F[o][t.error_code].message);var l=null==c||null===(i=c[o])||void 0===i?void 0:i[String(t.error_code)];if(l){var d,p,f,h=null===(d=l.mapTo)||void 0===d?void 0:d.message;if(null==l?void 0:l.needMoreDetail)h="".concat(null==l||null===(f=l.mapTo)||void 0===f?void 0:f.message,": ").concat(t.error_message);return new mn(null===(p=l.mapTo)||void 0===p?void 0:p.code,h)}return new mn(t.error_code,t.error_message)},bn=function(e,t,r,i){var o=function(e,t){function r(r){return function(i){var o=Nt.isEmpty(t)?void 0:t[r];if(o)return Ve({stage:n.RESPONSE,type:"log",state:r,name:e,response:i}),o("fail"===r?Tn(i):null==i?void 0:i.data)}}return Nt.isUndefined(e)&&(e=""),Object.assign({},{success:r("success"),fail:r("fail")})}(e,r),a=W[e],s=(null==i?void 0:i.delay)||0;setTimeout((function(){_n(e,t,o,Je({},i,a))}),s)},En=function(){var e=Ne((function(e){return Le(this,(function(t){return[2,new Promise((function(t,n){bn("MP_USER_AUTHORIZE",{scopes:e,forceUpdate:!0},{success:function(e){Nt.isEmpty(e)||t(e)},fail:function(e){n(e)}},{isMultiCallback:!1,timeout:!1})}))]}))}));return function(t){return e.apply(this,arguments)}}(),Pn=function(){function t(){Mt(this,t),this._jumpStatus=void 0,this.WAITING_QUEUE=[],this.getAccessTokenCount=0,this._accessToken="",this._jsAccessToken="",this.refreshToken="",this._cookies=[],this.accessTokenExpiresIn=0,this.prevGetAccessTokenTimestamp=(new Date).getTime(),this.manualSetAccessToken=!1,this._miniProgramConfig={},this.retryLimitMap={}}var r,a,u,c=t.prototype;return c.initRetryLimit=function(e){var t=z[e],n={lastCall:(new Date).getTime(),limit:t&&t.limit?t.limit:3,retry:0};return this.retryLimitMap[e]=n,n},c.resetRetryLimit=function(e){this.retryLimitMap[e].lastCall=(new Date).getTime(),this.retryLimitMap[e].retry=0},c.getRetryLimit=function(e){var t=this.retryLimitMap[e];return t&&t.lastCall&&t.retry||(t=this.initRetryLimit(e)),t},c.increaseRetryLimit=function(e){this.retryLimitMap[e].retry++},c.jump=function(){var t=this;return Ne((function(){return Le(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,Ve({stage:n.REQUEST,type:"log",name:"jump"}),_n("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)||an([{action:"action.jump.login",error:-102,message:"no zoauth",data:{}}]),r(e.JumpStatus.DONE)},fail:function(e){an([{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 Ne((function(){var i;return Le(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=Ne((function(e){var t,n,i;return Le(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 Ne((function(){var i,o;return Le(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),Nt.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,Je({method:"POST",body:i},o)).then(function(){var e=Ne((function(e){var t,n,i,o;return Le(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 Ne((function(){var n,r,a,s,u,c,d,p,f;function h(){return m.apply(this,arguments)}function m(){return(m=Ne((function(){return Le(this,(function(e){switch(e.label){case 0:return[4,new Promise((function(e){var t=setInterval((function(){(r.getAccessTokenCount<=1||r._accessToken)&&(e("done"),clearInterval(t))}),200)}))];case 1:return[2,e.sent()]}}))}))).apply(this,arguments)}return Le(this,(function(m){switch(m.label){case 0:return n=(new Date).getTime()-t.prevGetAccessTokenTimestamp,(r=t).getAccessTokenCount++,t.getAccessTokenCount>1?[4,h()]:[3,2];case 1:m.sent(),m.label=2;case 2:return t.manualSetAccessToken?(r.getAccessTokenCount--,[2,Promise.resolve(t._accessToken)]):e?[4,t.verifyUserAuthorized()]:[3,4];case 3:return s=m.sent(),[3,5];case 4:s=!0,m.label=5;case 5:return a=s,t._accessToken.length>0&&n<t.accessTokenExpiresIn&&a?(r.getAccessTokenCount--,[2,Promise.resolve(t._accessToken)]):(t.accessToken="",[4,t.jumpAndGetToken(l.ZOAUTH)]);case 6:return u=m.sent(),[4,t.jumpAndGetToken(l.ZOAUTH_VRF)];case 7:if(c=m.sent(),d="zmp.getaccesstoken.fail",!a)throw r.getAccessTokenCount--,an([{action:d,error:-104,message:"no user auth",data:{}}]),wn.error.loginFailed("User Authentication Required");if(!u)return[3,15];m.label=8;case 8:return m.trys.push([8,13,,14]),c?[4,t.loginZaloV4(o,u,c)]:[3,10];case 9:return p=m.sent(),[3,12];case 10:return[4,t.loginZaloV3(o,i,u)];case 11:p=m.sent(),m.label=12;case 12:return[3,14];case 13:return f=m.sent(),p="",console.log("Can not get access token",f),an([{action:d,error:-103,message:String(f)||"Can not get access token",data:{}}]),[3,14];case 14:return r.getAccessTokenCount--,p?[2,Promise.resolve(t._accessToken)]:(an([{action:d,error:-101,message:"no accessToken",data:{}}]),[2,Promise.reject(wn.error.loginFailed("Can't get accessToken. Please try again later."))]);case 15:throw r.getAccessTokenCount--,an([{action:d,error:-102,message:"no oauth",data:{}}]),wn.error.loginFailed("Zalo app has not been activated")}}))}))()},c.verifyUserAuthorized=function(){var e=this;return Ne((function(){var t,n,r,i,o,a;return Le(this,(function(s){switch(s.label){case 0:return n=!0,[4,e.jumpAndGetToken()];case 1:if(s.sent(),!1!==(null===(t=e._miniProgramConfig)||void 0===t?void 0:t.userAuthorized))return[3,7];s.label=2;case 2:return s.trys.push([2,6,,7]),(r=xn("action.mp.user.authorize"))&&r.isSupported?[4,gn()]:[3,5];case 3:return!1!==(null==(o=s.sent())||null===(i=o.authSetting)||void 0===i?void 0:i["scope.userInfo"])?[3,5]:[4,En()];case 4:a=s.sent(),n=(null==a?void 0:a["scope.userInfo"])||!1,s.label=5;case 5:return[3,7];case 6:return s.sent(),n=!1,[3,7];case 7:return[2,n]}}))}))()},c.setAccessToken=function(e){this.manualSetAccessToken=!0,this._accessToken=e,window.ZJSBridge.setZAccSession&&window.ZJSBridge.setZAccSession(e)},c.getJSAccessToken=function(){var e=this;return Ne((function(){var t;return Le(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=Ne((function(i){var o,a,s,u;return Le(this,(function(c){switch(c.label){case 0:return!n&&r._cookies.length>0?Nt.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}}])&&Rt(r.prototype,a),u&&Rt(r,u),t}(),Sn=Pn.getInstance(),In=St("zmp:utils:common"),An=function(e){if(Nt.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(An(e[r]));return"["+t.join(",")+"]"}if("object"==typeof e){for(var i in t=[],e)t.push('"'+i+'":'+An(e[i]));return"{"+t.join(",")+"}"}return e.toString()},On=function(e){var t=W[e],n=dn(),r=t&&"object"==typeof t&&"versionLive"in t&&t.versionLive&&"iOS"in t.versionLive?t.versionLive.iOS:0;return!!(Array.isArray(window.ignoreCheckSupport)&&window.ignoreCheckSupport.length>0&&window.ignoreCheckSupport.includes(e))||n>=r},kn=function(e){try{if(e){In(e);var t=e.replace(/\\/g,"").replace(/&#39;/g,"'");try{t=decodeURIComponent(atob(e))}catch(e){}var n=JSON.parse(t);return In("formattedValue",t,n,void 0===n?"undefined":Pt(n)),n}return null}catch(t){return In("parse json error:",t),e}},Cn=function(e){if(Nt.isObject(JSON)&&JSON.parse&&Nt.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 Nt.isObject(e)?e:new Function("return "+e)()},Nn=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""},Mn=function(e){return btoa(encodeURIComponent(JSON.stringify(e)))};var Rn=function(t){return"hidden"===t?e.StatusBarType.hidden:"transparent"===t?e.StatusBarType.transparent:e.StatusBarType.normal},xn=function(e){if(void 0!==e){var t=Sn.miniProgramConfig;return((null==t?void 0:t.dynamicApis)||[]).find((function(t){return t.action===e&&!1===t.clientHandle}))}},Dn=function(e){if(void 0===e)return!1;var t=Sn.miniProgramConfig;return((null==t?void 0:t.requiredAuthenList)||[]).indexOf(e)>=0},Ln=function(){var e=Ne((function(){return Le(this,(function(e){return[2,new Promise(function(){var e=Ne((function(e,t){var n;return Le(this,(function(t){switch(t.label){case 0:return t.trys.push([0,2,,3]),[4,Sn.jumpAndGetToken()];case 1:return t.sent(),n=Sn.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)}}(),Un=function(e){return"action.get.device_info"===e?"GET_DEVICE_INFO":e.replace("action.","").replace(/\./g,"_").toUpperCase()},jn=function(e){return e.startsWith("action.")?e:"GET_DEVICE_INFO"===e?"action.get.device_info":"action.".concat(e.replace(/\_/g,".").toLowerCase())},Bn=function(e,t,n){"string"==typeof n&&n.length>0?e.set(t,n):"object"!=typeof n||Array.isArray(n)||Object.entries(n).forEach((function(n){var r=qe(n,2),i=r[0],o=r[1];null!=o&&""!==o&&e.set("".concat(t).concat(i),String(o))}))},Zn=function(e,t,n){var r;null===(r=e.contentWindow)||void 0===r||r.postMessage({type:t,payload:n},Oe)};function zn(e,t,n,r){var i,o;!function(e,t){if(z[e]){var n=Sn.getRetryLimit(e);n.lastCall&&(new Date).getTime()-n.lastCall>1e3&&Sn.resetRetryLimit(e);var r=n.limit||3;if(n.retry&&n.retry>=r)throw vn(wn.error.failLimit(),e);Sn.increaseRetryLimit(e)}}(e);var a=Array.isArray(n)&&n.length>0&&(null===(i=n[0])||void 0===i?void 0:i.success),s=Array.isArray(n)&&n.length>0&&(null===(o=n[0])||void 0===o?void 0:o.fail);try{var u=n;t.length>0&&t.forEach((function(t,r){var i=t.safeParse(n[r]);if(!i.success){var o,a=null===(o=i.error)||void 0===o?void 0:o.issues,s=a.map((function(e,t){var n=e.path.length>0?e.path.map((function(e,t){return t>0?"[".concat(e,"]"):e})).join(""):"arg";return"Error ".concat(t+1,": Code: ").concat(e.code," ~ Path: ").concat(n," ~ Message: ").concat(e.message)})).join(" | "),c=wn.error.badRequest(s);throw c.detail=a,vn(c,e)}u.push(i.data)}));var c=r.apply(void 0,De(u));return Nt.isPromise(c)?new Promise((function(t,n){c.then((function(e){if(!Nt.isNull(a)&&Nt.isFunction(a))return a(e);t(c)})).catch((function(t){var r=vn(t,e);if(!Nt.isNull(s)&&Nt.isFunction(s))return s(r);n(r)}))})):c}catch(t){if(!Nt.isNull(s)&&Nt.isFunction(s))return s(t);throw vn(t,e)}}function Wn(e){return Fn.apply(this,arguments)}function Fn(){return(Fn=Ne((function(e){return Le(this,(function(t){return[2,zn("login",[],[e],Ne((function(){return Le(this,(function(e){switch(e.label){case 0:return Ge.isMp?[4,Sn.jumpAndGetToken(l.ZOAUTH)]:[3,2];case 1:return e.sent(),[2,"Success"];case 2:return Ge.isMpWeb?[2,Promise.resolve("")]:[2,Promise.reject(He("login",{}))]}}))})))]}))}))).apply(this,arguments)}function Gn(e){return Vn.apply(this,arguments)}function Vn(){return(Vn=Ne((function(e){return Le(this,(function(t){return[2,zn("getAccessToken",[],[e],Ne((function(){var e;return Le(this,(function(t){switch(t.label){case 0:return Ge.isMp?[4,Ln()]:[3,3];case 1:return e=!t.sent(),[4,Sn.getAccessToken(e)];case 2:return[2,t.sent()||""];case 3:return Ge.isMpWeb?[2,Promise.resolve("")]:[2,Promise.reject(He("getAccessToken",{}))]}}))})))]}))}))).apply(this,arguments)}var Hn,Kn="2.51.0-beta.2";function Jn(){return zn("getVersion",[],[],(function(){return Kn}))}function qn(){var e;return{version:Nn("version-id")||"",apiVersion:Kn,zaloVersion:String(dn()),platform:(null===(e=Fe())||void 0===e?void 0:e.platformName)||"",language:navigator.language,zaloLanguage:window.zLanguage||"vi",zaloTheme:window.zTheme||"light"}}function Qn(){return zn("getSystemInfo",[],[],(function(){return qn()}))}!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}(Hn||(Hn={}));const Yn=Hn.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),$n=e=>{switch(typeof e){case"undefined":return Yn.undefined;case"string":return Yn.string;case"number":return isNaN(e)?Yn.nan:Yn.number;case"boolean":return Yn.boolean;case"function":return Yn.function;case"bigint":return Yn.bigint;case"symbol":return Yn.symbol;case"object":return Array.isArray(e)?Yn.array:null===e?Yn.null:e.then&&"function"==typeof e.then&&e.catch&&"function"==typeof e.catch?Yn.promise:"undefined"!=typeof Map&&e instanceof Map?Yn.map:"undefined"!=typeof Set&&e instanceof Set?Yn.set:"undefined"!=typeof Date&&e instanceof Date?Yn.date:Yn.object;default:return Yn.unknown}},Xn=Hn.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 er 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,Hn.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()}}er.create=e=>new er(e);const tr=(e,t)=>{let n;switch(e.code){case Xn.invalid_type:n=e.received===Yn.undefined?"Required":`Expected ${e.expected}, received ${e.received}`;break;case Xn.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(e.expected,Hn.jsonStringifyReplacer)}`;break;case Xn.unrecognized_keys:n=`Unrecognized key(s) in object: ${Hn.joinValues(e.keys,", ")}`;break;case Xn.invalid_union:n="Invalid input";break;case Xn.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${Hn.joinValues(e.options)}`;break;case Xn.invalid_enum_value:n=`Invalid enum value. Expected ${Hn.joinValues(e.options)}, received '${e.received}'`;break;case Xn.invalid_arguments:n="Invalid function arguments";break;case Xn.invalid_return_type:n="Invalid function return type";break;case Xn.invalid_date:n="Invalid date";break;case Xn.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}"`:Hn.assertNever(e.validation):n="regex"!==e.validation?`Invalid ${e.validation}`:"Invalid";break;case Xn.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 Xn.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 Xn.custom:n="Invalid input";break;case Xn.invalid_intersection_types:n="Intersection results could not be merged";break;case Xn.not_multiple_of:n=`Number must be a multiple of ${e.multipleOf}`;break;case Xn.not_finite:n="Number must be finite";break;default:n=t.defaultError,Hn.assertNever(e)}return{message:n}};let nr=tr;function rr(){return nr}const ir=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 or(e,t){const n=ir({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,rr(),tr].filter((e=>!!e))});e.common.issues.push(n)}class ar{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 sr;"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 ar.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 sr;if("aborted"===i.status)return sr;"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 sr=Object.freeze({status:"aborted"}),ur=e=>({status:"dirty",value:e}),cr=e=>({status:"valid",value:e}),lr=e=>"aborted"===e.status,dr=e=>"dirty"===e.status,pr=e=>"valid"===e.status,fr=e=>"undefined"!=typeof Promise&&e instanceof Promise;var hr;!function(e){e.errToObj=e=>"string"==typeof e?{message:e}:e||{},e.toString=e=>"string"==typeof e?e:null==e?void 0:e.message}(hr||(hr={}));class mr{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 vr=(e,t)=>{if(pr(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 er(e.common.issues)}};function yr(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 gr{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 $n(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:$n(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new ar,ctx:{common:e.parent.common,data:e.data,parsedType:$n(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const t=this._parse(e);if(fr(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:$n(e)},i=this._parseSync({data:e,path:r.path,parent:r});return vr(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:$n(e)},r=this._parse({data:e,path:n.path,parent:n}),i=await(fr(r)?r:Promise.resolve(r));return vr(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:Xn.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 ni({schema:this,typeName:fi.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}optional(){return ri.create(this,this._def)}nullable(){return ii.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Lr.create(this,this._def)}promise(){return ti.create(this,this._def)}or(e){return Zr.create([this,e],this._def)}and(e){return Gr.create(this,e,this._def)}transform(e){return new ni({...yr(this._def),schema:this,typeName:fi.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const t="function"==typeof e?e:()=>e;return new oi({...yr(this._def),innerType:this,defaultValue:t,typeName:fi.ZodDefault})}brand(){return new ci({typeName:fi.ZodBranded,type:this,...yr(this._def)})}catch(e){const t="function"==typeof e?e:()=>e;return new ai({...yr(this._def),innerType:this,catchValue:t,typeName:fi.ZodCatch})}describe(e){return new(0,this.constructor)({...this._def,description:e})}pipe(e){return li.create(this,e)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const _r=/^c[^\s-]{8,}$/i,wr=/^[a-z][a-z0-9]*$/,Tr=/^([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,br=/^(([^<>()[\]\\.,;:\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 Er extends gr{constructor(){super(...arguments),this._regex=(e,t,n)=>this.refinement((t=>e.test(t)),{validation:t,code:Xn.invalid_string,...hr.errToObj(n)}),this.nonempty=e=>this.min(1,hr.errToObj(e)),this.trim=()=>new Er({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}_parse(e){this._def.coerce&&(e.data=String(e.data));if(this._getType(e)!==Yn.string){const t=this._getOrReturnCtx(e);return or(t,{code:Xn.invalid_type,expected:Yn.string,received:t.parsedType}),sr}const t=new ar;let n;for(const i of this._def.checks)if("min"===i.kind)e.data.length<i.value&&(n=this._getOrReturnCtx(e,n),or(n,{code:Xn.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),or(n,{code:Xn.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?or(n,{code:Xn.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}):o&&or(n,{code:Xn.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}),t.dirty())}else if("email"===i.kind)br.test(e.data)||(n=this._getOrReturnCtx(e,n),or(n,{validation:"email",code:Xn.invalid_string,message:i.message}),t.dirty());else if("uuid"===i.kind)Tr.test(e.data)||(n=this._getOrReturnCtx(e,n),or(n,{validation:"uuid",code:Xn.invalid_string,message:i.message}),t.dirty());else if("cuid"===i.kind)_r.test(e.data)||(n=this._getOrReturnCtx(e,n),or(n,{validation:"cuid",code:Xn.invalid_string,message:i.message}),t.dirty());else if("cuid2"===i.kind)wr.test(e.data)||(n=this._getOrReturnCtx(e,n),or(n,{validation:"cuid2",code:Xn.invalid_string,message:i.message}),t.dirty());else if("url"===i.kind)try{new URL(e.data)}catch(r){n=this._getOrReturnCtx(e,n),or(n,{validation:"url",code:Xn.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),or(n,{validation:"regex",code:Xn.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),or(n,{code:Xn.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),or(n,{code:Xn.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),or(n,{code:Xn.invalid_string,validation:"datetime",message:i.message}),t.dirty())}else Hn.assertNever(i);var r;return{status:t.value,value:e.data}}_addCheck(e){return new Er({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...hr.errToObj(e)})}url(e){return this._addCheck({kind:"url",...hr.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...hr.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...hr.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...hr.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,...hr.errToObj(null==e?void 0:e.message)})}regex(e,t){return this._addCheck({kind:"regex",regex:e,...hr.errToObj(t)})}startsWith(e,t){return this._addCheck({kind:"startsWith",value:e,...hr.errToObj(t)})}endsWith(e,t){return this._addCheck({kind:"endsWith",value:e,...hr.errToObj(t)})}min(e,t){return this._addCheck({kind:"min",value:e,...hr.errToObj(t)})}max(e,t){return this._addCheck({kind:"max",value:e,...hr.errToObj(t)})}length(e,t){return this._addCheck({kind:"length",value:e,...hr.errToObj(t)})}get isDatetime(){return!!this._def.checks.find((e=>"datetime"===e.kind))}get isEmail(){return!!this._def.checks.find((e=>"email"===e.kind))}get isURL(){return!!this._def.checks.find((e=>"url"===e.kind))}get isUUID(){return!!this._def.checks.find((e=>"uuid"===e.kind))}get isCUID(){return!!this._def.checks.find((e=>"cuid"===e.kind))}get isCUID2(){return!!this._def.checks.find((e=>"cuid2"===e.kind))}get minLength(){let e=null;for(const t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return e}get maxLength(){let e=null;for(const t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return e}}function Pr(e,t){const n=(e.toString().split(".")[1]||"").length,r=(t.toString().split(".")[1]||"").length,i=n>r?n:r;return parseInt(e.toFixed(i).replace(".",""))%parseInt(t.toFixed(i).replace(".",""))/Math.pow(10,i)}Er.create=e=>{var t;return new Er({checks:[],typeName:fi.ZodString,coerce:null!==(t=null==e?void 0:e.coerce)&&void 0!==t&&t,...yr(e)})};class Sr extends gr{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)!==Yn.number){const t=this._getOrReturnCtx(e);return or(t,{code:Xn.invalid_type,expected:Yn.number,received:t.parsedType}),sr}let t;const n=new ar;for(const r of this._def.checks)if("int"===r.kind)Hn.isInteger(e.data)||(t=this._getOrReturnCtx(e,t),or(t,{code:Xn.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),or(t,{code:Xn.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),or(t,{code:Xn.too_big,maximum:r.value,type:"number",inclusive:r.inclusive,exact:!1,message:r.message}),n.dirty())}else"multipleOf"===r.kind?0!==Pr(e.data,r.value)&&(t=this._getOrReturnCtx(e,t),or(t,{code:Xn.not_multiple_of,multipleOf:r.value,message:r.message}),n.dirty()):"finite"===r.kind?Number.isFinite(e.data)||(t=this._getOrReturnCtx(e,t),or(t,{code:Xn.not_finite,message:r.message}),n.dirty()):Hn.assertNever(r);return{status:n.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,hr.toString(t))}gt(e,t){return this.setLimit("min",e,!1,hr.toString(t))}lte(e,t){return this.setLimit("max",e,!0,hr.toString(t))}lt(e,t){return this.setLimit("max",e,!1,hr.toString(t))}setLimit(e,t,n,r){return new Sr({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:n,message:hr.toString(r)}]})}_addCheck(e){return new Sr({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:hr.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:hr.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:hr.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:hr.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:hr.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:hr.toString(t)})}finite(e){return this._addCheck({kind:"finite",message:hr.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&&Hn.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)}}Sr.create=e=>new Sr({checks:[],typeName:fi.ZodNumber,coerce:(null==e?void 0:e.coerce)||!1,...yr(e)});class Ir extends gr{_parse(e){this._def.coerce&&(e.data=BigInt(e.data));if(this._getType(e)!==Yn.bigint){const t=this._getOrReturnCtx(e);return or(t,{code:Xn.invalid_type,expected:Yn.bigint,received:t.parsedType}),sr}return cr(e.data)}}Ir.create=e=>{var t;return new Ir({typeName:fi.ZodBigInt,coerce:null!==(t=null==e?void 0:e.coerce)&&void 0!==t&&t,...yr(e)})};class Ar extends gr{_parse(e){this._def.coerce&&(e.data=Boolean(e.data));if(this._getType(e)!==Yn.boolean){const t=this._getOrReturnCtx(e);return or(t,{code:Xn.invalid_type,expected:Yn.boolean,received:t.parsedType}),sr}return cr(e.data)}}Ar.create=e=>new Ar({typeName:fi.ZodBoolean,coerce:(null==e?void 0:e.coerce)||!1,...yr(e)});class Or extends gr{_parse(e){this._def.coerce&&(e.data=new Date(e.data));if(this._getType(e)!==Yn.date){const t=this._getOrReturnCtx(e);return or(t,{code:Xn.invalid_type,expected:Yn.date,received:t.parsedType}),sr}if(isNaN(e.data.getTime())){return or(this._getOrReturnCtx(e),{code:Xn.invalid_date}),sr}const t=new ar;let n;for(const r of this._def.checks)"min"===r.kind?e.data.getTime()<r.value&&(n=this._getOrReturnCtx(e,n),or(n,{code:Xn.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),or(n,{code:Xn.too_big,message:r.message,inclusive:!0,exact:!1,maximum:r.value,type:"date"}),t.dirty()):Hn.assertNever(r);return{status:t.value,value:new Date(e.data.getTime())}}_addCheck(e){return new Or({...this._def,checks:[...this._def.checks,e]})}min(e,t){return this._addCheck({kind:"min",value:e.getTime(),message:hr.toString(t)})}max(e,t){return this._addCheck({kind:"max",value:e.getTime(),message:hr.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}}Or.create=e=>new Or({checks:[],coerce:(null==e?void 0:e.coerce)||!1,typeName:fi.ZodDate,...yr(e)});class kr extends gr{_parse(e){if(this._getType(e)!==Yn.symbol){const t=this._getOrReturnCtx(e);return or(t,{code:Xn.invalid_type,expected:Yn.symbol,received:t.parsedType}),sr}return cr(e.data)}}kr.create=e=>new kr({typeName:fi.ZodSymbol,...yr(e)});class Cr extends gr{_parse(e){if(this._getType(e)!==Yn.undefined){const t=this._getOrReturnCtx(e);return or(t,{code:Xn.invalid_type,expected:Yn.undefined,received:t.parsedType}),sr}return cr(e.data)}}Cr.create=e=>new Cr({typeName:fi.ZodUndefined,...yr(e)});class Nr extends gr{_parse(e){if(this._getType(e)!==Yn.null){const t=this._getOrReturnCtx(e);return or(t,{code:Xn.invalid_type,expected:Yn.null,received:t.parsedType}),sr}return cr(e.data)}}Nr.create=e=>new Nr({typeName:fi.ZodNull,...yr(e)});class Mr extends gr{constructor(){super(...arguments),this._any=!0}_parse(e){return cr(e.data)}}Mr.create=e=>new Mr({typeName:fi.ZodAny,...yr(e)});class Rr extends gr{constructor(){super(...arguments),this._unknown=!0}_parse(e){return cr(e.data)}}Rr.create=e=>new Rr({typeName:fi.ZodUnknown,...yr(e)});class xr extends gr{_parse(e){const t=this._getOrReturnCtx(e);return or(t,{code:Xn.invalid_type,expected:Yn.never,received:t.parsedType}),sr}}xr.create=e=>new xr({typeName:fi.ZodNever,...yr(e)});class Dr extends gr{_parse(e){if(this._getType(e)!==Yn.undefined){const t=this._getOrReturnCtx(e);return or(t,{code:Xn.invalid_type,expected:Yn.void,received:t.parsedType}),sr}return cr(e.data)}}Dr.create=e=>new Dr({typeName:fi.ZodVoid,...yr(e)});class Lr extends gr{_parse(e){const{ctx:t,status:n}=this._processInputParams(e),r=this._def;if(t.parsedType!==Yn.array)return or(t,{code:Xn.invalid_type,expected:Yn.array,received:t.parsedType}),sr;if(null!==r.exactLength){const e=t.data.length>r.exactLength.value,i=t.data.length<r.exactLength.value;(e||i)&&(or(t,{code:e?Xn.too_big:Xn.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&&(or(t,{code:Xn.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&&(or(t,{code:Xn.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 mr(t,e,t.path,n))))).then((e=>ar.mergeArray(n,e)));const i=[...t.data].map(((e,n)=>r.type._parseSync(new mr(t,e,t.path,n))));return ar.mergeArray(n,i)}get element(){return this._def.type}min(e,t){return new Lr({...this._def,minLength:{value:e,message:hr.toString(t)}})}max(e,t){return new Lr({...this._def,maxLength:{value:e,message:hr.toString(t)}})}length(e,t){return new Lr({...this._def,exactLength:{value:e,message:hr.toString(t)}})}nonempty(e){return this.min(1,e)}}var Ur;function jr(e){if(e instanceof Br){const t={};for(const n in e.shape){const r=e.shape[n];t[n]=ri.create(jr(r))}return new Br({...e._def,shape:()=>t})}return e instanceof Lr?Lr.create(jr(e.element)):e instanceof ri?ri.create(jr(e.unwrap())):e instanceof ii?ii.create(jr(e.unwrap())):e instanceof Vr?Vr.create(e.items.map((e=>jr(e)))):e}Lr.create=(e,t)=>new Lr({type:e,minLength:null,maxLength:null,exactLength:null,typeName:fi.ZodArray,...yr(t)}),function(e){e.mergeShapes=(e,t)=>({...e,...t})}(Ur||(Ur={}));class Br extends gr{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=Hn.objectKeys(e);return this._cached={shape:e,keys:t}}_parse(e){if(this._getType(e)!==Yn.object){const t=this._getOrReturnCtx(e);return or(t,{code:Xn.invalid_type,expected:Yn.object,received:t.parsedType}),sr}const{status:t,ctx:n}=this._processInputParams(e),{shape:r,keys:i}=this._getCached(),o=[];if(!(this._def.catchall instanceof xr&&"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 mr(n,i,n.path,e)),alwaysSet:e in n.data})}if(this._def.catchall instanceof xr){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&&(or(n,{code:Xn.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 mr(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=>ar.mergeObjectSync(t,e))):ar.mergeObjectSync(t,a)}get shape(){return this._def.shape()}strict(e){return hr.errToObj,new Br({...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=hr.errToObj(e).message)&&void 0!==a?a:s}:{message:s}}}:{}})}strip(){return new Br({...this._def,unknownKeys:"strip"})}passthrough(){return new Br({...this._def,unknownKeys:"passthrough"})}extend(e){return new Br({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new Br({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>Ur.mergeShapes(this._def.shape(),e._def.shape()),typeName:fi.ZodObject})}setKey(e,t){return this.augment({[e]:t})}catchall(e){return new Br({...this._def,catchall:e})}pick(e){const t={};return Hn.objectKeys(e).forEach((n=>{e[n]&&this.shape[n]&&(t[n]=this.shape[n])})),new Br({...this._def,shape:()=>t})}omit(e){const t={};return Hn.objectKeys(this.shape).forEach((n=>{e[n]||(t[n]=this.shape[n])})),new Br({...this._def,shape:()=>t})}deepPartial(){return jr(this)}partial(e){const t={};return Hn.objectKeys(this.shape).forEach((n=>{const r=this.shape[n];e&&!e[n]?t[n]=r:t[n]=r.optional()})),new Br({...this._def,shape:()=>t})}required(e){const t={};return Hn.objectKeys(this.shape).forEach((n=>{if(e&&!e[n])t[n]=this.shape[n];else{let e=this.shape[n];for(;e instanceof ri;)e=e._def.innerType;t[n]=e}})),new Br({...this._def,shape:()=>t})}keyof(){return $r(Hn.objectKeys(this.shape))}}Br.create=(e,t)=>new Br({shape:()=>e,unknownKeys:"strip",catchall:xr.create(),typeName:fi.ZodObject,...yr(t)}),Br.strictCreate=(e,t)=>new Br({shape:()=>e,unknownKeys:"strict",catchall:xr.create(),typeName:fi.ZodObject,...yr(t)}),Br.lazycreate=(e,t)=>new Br({shape:e,unknownKeys:"strip",catchall:xr.create(),typeName:fi.ZodObject,...yr(t)});class Zr extends gr{_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 er(e.ctx.common.issues)));return or(t,{code:Xn.invalid_union,unionErrors:n}),sr}));{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 er(e)));return or(t,{code:Xn.invalid_union,unionErrors:i}),sr}}get options(){return this._def.options}}Zr.create=(e,t)=>new Zr({options:e,typeName:fi.ZodUnion,...yr(t)});const zr=e=>e instanceof Qr?zr(e.schema):e instanceof ni?zr(e.innerType()):e instanceof Yr?[e.value]:e instanceof Xr?e.options:e instanceof ei?Object.keys(e.enum):e instanceof oi?zr(e._def.innerType):e instanceof Cr?[void 0]:e instanceof Nr?[null]:null;class Wr extends gr{_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==Yn.object)return or(t,{code:Xn.invalid_type,expected:Yn.object,received:t.parsedType}),sr;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}):(or(t,{code:Xn.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[n]}),sr)}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=zr(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 Wr({typeName:fi.ZodDiscriminatedUnion,discriminator:e,options:t,optionsMap:r,...yr(n)})}}function Fr(e,t){const n=$n(e),r=$n(t);if(e===t)return{valid:!0,data:e};if(n===Yn.object&&r===Yn.object){const n=Hn.objectKeys(t),r=Hn.objectKeys(e).filter((e=>-1!==n.indexOf(e))),i={...e,...t};for(const n of r){const r=Fr(e[n],t[n]);if(!r.valid)return{valid:!1};i[n]=r.data}return{valid:!0,data:i}}if(n===Yn.array&&r===Yn.array){if(e.length!==t.length)return{valid:!1};const n=[];for(let r=0;r<e.length;r++){const i=Fr(e[r],t[r]);if(!i.valid)return{valid:!1};n.push(i.data)}return{valid:!0,data:n}}return n===Yn.date&&r===Yn.date&&+e==+t?{valid:!0,data:e}:{valid:!1}}class Gr extends gr{_parse(e){const{status:t,ctx:n}=this._processInputParams(e),r=(e,r)=>{if(lr(e)||lr(r))return sr;const i=Fr(e.value,r.value);return i.valid?((dr(e)||dr(r))&&t.dirty(),{status:t.value,value:i.data}):(or(n,{code:Xn.invalid_intersection_types}),sr)};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}))}}Gr.create=(e,t,n)=>new Gr({left:e,right:t,typeName:fi.ZodIntersection,...yr(n)});class Vr extends gr{_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==Yn.array)return or(n,{code:Xn.invalid_type,expected:Yn.array,received:n.parsedType}),sr;if(n.data.length<this._def.items.length)return or(n,{code:Xn.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),sr;!this._def.rest&&n.data.length>this._def.items.length&&(or(n,{code:Xn.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 mr(n,e,n.path,t)):null})).filter((e=>!!e));return n.common.async?Promise.all(r).then((e=>ar.mergeArray(t,e))):ar.mergeArray(t,r)}get items(){return this._def.items}rest(e){return new Vr({...this._def,rest:e})}}Vr.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Vr({items:e,typeName:fi.ZodTuple,rest:null,...yr(t)})};class Hr extends gr{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!==Yn.object)return or(n,{code:Xn.invalid_type,expected:Yn.object,received:n.parsedType}),sr;const r=[],i=this._def.keyType,o=this._def.valueType;for(const e in n.data)r.push({key:i._parse(new mr(n,e,n.path,e)),value:o._parse(new mr(n,n.data[e],n.path,e))});return n.common.async?ar.mergeObjectAsync(t,r):ar.mergeObjectSync(t,r)}get element(){return this._def.valueType}static create(e,t,n){return new Hr(t instanceof gr?{keyType:e,valueType:t,typeName:fi.ZodRecord,...yr(n)}:{keyType:Er.create(),valueType:e,typeName:fi.ZodRecord,...yr(t)})}}class Kr extends gr{_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==Yn.map)return or(n,{code:Xn.invalid_type,expected:Yn.map,received:n.parsedType}),sr;const r=this._def.keyType,i=this._def.valueType,o=[...n.data.entries()].map((([e,t],o)=>({key:r._parse(new mr(n,e,n.path,[o,"key"])),value:i._parse(new mr(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 sr;"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 sr;"dirty"!==r.status&&"dirty"!==i.status||t.dirty(),e.set(r.value,i.value)}return{status:t.value,value:e}}}}Kr.create=(e,t,n)=>new Kr({valueType:t,keyType:e,typeName:fi.ZodMap,...yr(n)});class Jr extends gr{_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==Yn.set)return or(n,{code:Xn.invalid_type,expected:Yn.set,received:n.parsedType}),sr;const r=this._def;null!==r.minSize&&n.data.size<r.minSize.value&&(or(n,{code:Xn.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&&(or(n,{code:Xn.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 sr;"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 mr(n,e,n.path,t))));return n.common.async?Promise.all(a).then((e=>o(e))):o(a)}min(e,t){return new Jr({...this._def,minSize:{value:e,message:hr.toString(t)}})}max(e,t){return new Jr({...this._def,maxSize:{value:e,message:hr.toString(t)}})}size(e,t){return this.min(e,t).max(e,t)}nonempty(e){return this.min(1,e)}}Jr.create=(e,t)=>new Jr({valueType:e,minSize:null,maxSize:null,typeName:fi.ZodSet,...yr(t)});class qr extends gr{constructor(){super(...arguments),this.validate=this.implement}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==Yn.function)return or(t,{code:Xn.invalid_type,expected:Yn.function,received:t.parsedType}),sr;function n(e,n){return ir({data:e,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,rr(),tr].filter((e=>!!e)),issueData:{code:Xn.invalid_arguments,argumentsError:n}})}function r(e,n){return ir({data:e,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,rr(),tr].filter((e=>!!e)),issueData:{code:Xn.invalid_return_type,returnTypeError:n}})}const i={errorMap:t.common.contextualErrorMap},o=t.data;return this._def.returns instanceof ti?cr((async(...e)=>{const t=new er([]),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}))})):cr(((...e)=>{const t=this._def.args.safeParse(e,i);if(!t.success)throw new er([n(e,t.error)]);const a=o(...t.data),s=this._def.returns.safeParse(a,i);if(!s.success)throw new er([r(a,s.error)]);return s.data}))}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new qr({...this._def,args:Vr.create(e).rest(Rr.create())})}returns(e){return new qr({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,t,n){return new qr({args:e||Vr.create([]).rest(Rr.create()),returns:t||Rr.create(),typeName:fi.ZodFunction,...yr(n)})}}class Qr extends gr{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})}}Qr.create=(e,t)=>new Qr({getter:e,typeName:fi.ZodLazy,...yr(t)});class Yr extends gr{_parse(e){if(e.data!==this._def.value){const t=this._getOrReturnCtx(e);return or(t,{received:t.data,code:Xn.invalid_literal,expected:this._def.value}),sr}return{status:"valid",value:e.data}}get value(){return this._def.value}}function $r(e,t){return new Xr({values:e,typeName:fi.ZodEnum,...yr(t)})}Yr.create=(e,t)=>new Yr({value:e,typeName:fi.ZodLiteral,...yr(t)});class Xr extends gr{_parse(e){if("string"!=typeof e.data){const t=this._getOrReturnCtx(e),n=this._def.values;return or(t,{expected:Hn.joinValues(n),received:t.parsedType,code:Xn.invalid_type}),sr}if(-1===this._def.values.indexOf(e.data)){const t=this._getOrReturnCtx(e),n=this._def.values;return or(t,{received:t.data,code:Xn.invalid_enum_value,options:n}),sr}return cr(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 Xr.create(e)}exclude(e){return Xr.create(this.options.filter((t=>!e.includes(t))))}}Xr.create=$r;class ei extends gr{_parse(e){const t=Hn.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(e);if(n.parsedType!==Yn.string&&n.parsedType!==Yn.number){const e=Hn.objectValues(t);return or(n,{expected:Hn.joinValues(e),received:n.parsedType,code:Xn.invalid_type}),sr}if(-1===t.indexOf(e.data)){const e=Hn.objectValues(t);return or(n,{received:n.data,code:Xn.invalid_enum_value,options:e}),sr}return cr(e.data)}get enum(){return this._def.values}}ei.create=(e,t)=>new ei({values:e,typeName:fi.ZodNativeEnum,...yr(t)});class ti extends gr{unwrap(){return this._def.type}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==Yn.promise&&!1===t.common.async)return or(t,{code:Xn.invalid_type,expected:Yn.promise,received:t.parsedType}),sr;const n=t.parsedType===Yn.promise?t.data:Promise.resolve(t.data);return cr(n.then((e=>this._def.type.parseAsync(e,{path:t.path,errorMap:t.common.contextualErrorMap}))))}}ti.create=(e,t)=>new ti({type:e,typeName:fi.ZodPromise,...yr(t)});class ni extends gr{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===fi.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=>{or(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?sr:("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?sr:("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(!pr(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=>pr(e)?Promise.resolve(r.transform(e.value,i)).then((e=>({status:t.value,value:e}))):e))}Hn.assertNever(r)}}ni.create=(e,t,n)=>new ni({schema:e,typeName:fi.ZodEffects,effect:t,...yr(n)}),ni.createWithPreprocess=(e,t,n)=>new ni({schema:t,effect:{type:"preprocess",transform:e},typeName:fi.ZodEffects,...yr(n)});class ri extends gr{_parse(e){return this._getType(e)===Yn.undefined?cr(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}ri.create=(e,t)=>new ri({innerType:e,typeName:fi.ZodOptional,...yr(t)});class ii extends gr{_parse(e){return this._getType(e)===Yn.null?cr(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}ii.create=(e,t)=>new ii({innerType:e,typeName:fi.ZodNullable,...yr(t)});class oi extends gr{_parse(e){const{ctx:t}=this._processInputParams(e);let n=t.data;return t.parsedType===Yn.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:t.path,parent:t})}removeDefault(){return this._def.innerType}}oi.create=(e,t)=>new oi({innerType:e,typeName:fi.ZodDefault,defaultValue:"function"==typeof t.default?t.default:()=>t.default,...yr(t)});class ai extends gr{_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 fr(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}}ai.create=(e,t)=>new ai({innerType:e,typeName:fi.ZodCatch,catchValue:"function"==typeof t.catch?t.catch:()=>t.catch,...yr(t)});class si extends gr{_parse(e){if(this._getType(e)!==Yn.nan){const t=this._getOrReturnCtx(e);return or(t,{code:Xn.invalid_type,expected:Yn.nan,received:t.parsedType}),sr}return{status:"valid",value:e.data}}}si.create=e=>new si({typeName:fi.ZodNaN,...yr(e)});const ui=Symbol("zod_brand");class ci extends gr{_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 li extends gr{_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?sr:"dirty"===e.status?(t.dirty(),ur(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?sr:"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 li({in:e,out:t,typeName:fi.ZodPipeline})}}const di=(e,t={},n)=>e?Mr.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})}})):Mr.create(),pi={object:Br.lazycreate};var fi;!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"}(fi||(fi={}));const hi=Er.create,mi=Sr.create,vi=si.create,yi=Ir.create,gi=Ar.create,_i=Or.create,wi=kr.create,Ti=Cr.create,bi=Nr.create,Ei=Mr.create,Pi=Rr.create,Si=xr.create,Ii=Dr.create,Ai=Lr.create,Oi=Br.create,ki=Br.strictCreate,Ci=Zr.create,Ni=Wr.create,Mi=Gr.create,Ri=Vr.create,xi=Hr.create,Di=Kr.create,Li=Jr.create,Ui=qr.create,ji=Qr.create,Bi=Yr.create,Zi=Xr.create,zi=ei.create,Wi=ti.create,Fi=ni.create,Gi=ri.create,Vi=ii.create,Hi=ni.createWithPreprocess,Ki=li.create,Ji={string:e=>Er.create({...e,coerce:!0}),number:e=>Sr.create({...e,coerce:!0}),boolean:e=>Ar.create({...e,coerce:!0}),bigint:e=>Ir.create({...e,coerce:!0}),date:e=>Or.create({...e,coerce:!0})},qi=sr;var Qi=Object.freeze({__proto__:null,defaultErrorMap:tr,setErrorMap:function(e){nr=e},getErrorMap:rr,makeIssue:ir,EMPTY_PATH:[],addIssueToContext:or,ParseStatus:ar,INVALID:sr,DIRTY:ur,OK:cr,isAborted:lr,isDirty:dr,isValid:pr,isAsync:fr,get util(){return Hn},ZodParsedType:Yn,getParsedType:$n,ZodType:gr,ZodString:Er,ZodNumber:Sr,ZodBigInt:Ir,ZodBoolean:Ar,ZodDate:Or,ZodSymbol:kr,ZodUndefined:Cr,ZodNull:Nr,ZodAny:Mr,ZodUnknown:Rr,ZodNever:xr,ZodVoid:Dr,ZodArray:Lr,get objectUtil(){return Ur},ZodObject:Br,ZodUnion:Zr,ZodDiscriminatedUnion:Wr,ZodIntersection:Gr,ZodTuple:Vr,ZodRecord:Hr,ZodMap:Kr,ZodSet:Jr,ZodFunction:qr,ZodLazy:Qr,ZodLiteral:Yr,ZodEnum:Xr,ZodNativeEnum:ei,ZodPromise:ti,ZodEffects:ni,ZodTransformer:ni,ZodOptional:ri,ZodNullable:ii,ZodDefault:oi,ZodCatch:ai,ZodNaN:si,BRAND:ui,ZodBranded:ci,ZodPipeline:li,custom:di,Schema:gr,ZodSchema:gr,late:pi,get ZodFirstPartyTypeKind(){return fi},coerce:Ji,any:Ei,array:Ai,bigint:yi,boolean:gi,date:_i,discriminatedUnion:Ni,effect:Fi,enum:Zi,function:Ui,instanceof:(e,t={message:`Input not instance of ${e.name}`})=>di((t=>t instanceof e),t,!0),intersection:Mi,lazy:ji,literal:Bi,map:Di,nan:vi,nativeEnum:zi,never:Si,null:bi,nullable:Vi,number:mi,object:Oi,oboolean:()=>gi().optional(),onumber:()=>mi().optional(),optional:Gi,ostring:()=>hi().optional(),pipeline:Ki,preprocess:Hi,promise:Wi,record:xi,set:Li,strictObject:ki,string:hi,symbol:wi,transformer:Fi,tuple:Ri,undefined:Ti,union:Ci,unknown:Pi,void:Ii,NEVER:qi,ZodIssueCode:Xn,quotelessJson:e=>JSON.stringify(e,null,2).replace(/"([^"]+)":/g,"$1:"),ZodError:er}),Yi=function(){function t(){var e,n,r,i,a,u,c,l,d,p,f,h,m,v,y,g,_,w,T,b,E,P,S,I,A,O,k;Mt(this,t),this.initConfig=window.APP_CONFIG;var C=Nt.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?X:ee;this.hideIOSSafeAreaBottom=!!(null===(u=this.initConfig)||void 0===u||null===(c=u.app)||void 0===c?void 0:c.hideIOSSafeAreaBottom),this.hideAndroidBottomNavigationBar=!!(null===(l=this.initConfig)||void 0===l||null===(d=l.app)||void 0===d?void 0:d.hideAndroidBottomNavigationBar);var N,M,R="none"===(null===(p=this.initConfig)||void 0===p||null===(f=p.app)||void 0===f?void 0:f.leftButton)||"home"===(null===(h=this.initConfig)||void 0===h||null===(m=h.app)||void 0===m?void 0:m.leftButton)?$.HIDE_BACK:$.SHOW_BACK,x="home"===(null===(v=this.initConfig)||void 0===v||null===(y=v.app)||void 0===y?void 0:y.leftButton)||"both"===(null===(g=this.initConfig)||void 0===g||null===(_=g.app)||void 0===_?void 0:_.leftButton)?$.SHOW_HOME:$.HIDE_HOME,D=new URL(location.href),L=Rn(null===(w=this.initConfig)||void 0===w||null===(T=w.app)||void 0===T?void 0:T.statusBar);"boolean"==typeof(null===(b=this.initConfig)||void 0===b||null===(E=b.app)||void 0===E?void 0:E.actionBarHidden)&&(C=(null===(N=this.initConfig)||void 0===N||null===(M=N.app)||void 0===M?void 0:M.actionBarHidden)?ee:X);this.config={actionbarType:C,buttonType:R,statusbarType:L,dataConfig:{backgroundColor:(null===(P=this.initConfig)||void 0===P||null===(S=P.app)||void 0===S?void 0:S.headerColor)||te,textColor:(null===(I=this.initConfig)||void 0===I||null===(A=I.app)||void 0===A?void 0:A.textColor)||"",textAlign:(null===(O=this.initConfig)||void 0===O||null===(k=O.app)||void 0===k?void 0:k.textAlign)||ne,viewInLeftType:R,confirmToExit:1},homeConfig:{enable:x,url:"".concat(s,"/").concat(o,"/").concat(D.search)}}}var n=t.prototype;return n.setNavigationBarTitle=function(e){return Ne((function(){return Le(this,(function(t){return[2,new Promise((function(t,n){bn("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 Ne((function(){var r,i;return Le(this,(function(o){return void 0===(void 0===e?"undefined":Pt(e))&&null===(void 0===e?"undefined":Pt(e))||(r="none"===e||"home"===e?$.HIDE_BACK:$.SHOW_BACK,i="home"===e||"both"===e?$.SHOW_HOME:$.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){bn("CHANGE_ACTIONBAR_LEFTBUTTON_TYPE",Je({},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 Ne((function(){var r,i,o;return Le(this,(function(a){return i=t?e.AndroidBottomNavigationBarType.hide:e.AndroidBottomNavigationBarType.show,o=null===(r=Fe())||void 0===r?void 0:r.platform,[2,new Promise((function(e,r){if(!(null==o?void 0:o.isAndroid))return e();bn("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 Ne((function(){var r,i,o;return Le(this,(function(a){return i=t?e.IOSSafeAreaBottomType.hide:e.IOSSafeAreaBottomType.show,o=null===(r=Fe())||void 0===r?void 0:r.platform,[2,new Promise((function(e,r){if(!(null==o?void 0:o.isIOS))return e();bn("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 Ne((function(){var r;return Le(this,(function(i){return r=n.config,Nt.isString(t.headerColor)&&(r.dataConfig.backgroundColor=t.headerColor),Nt.isString(t.headerTextColor)&&(r.dataConfig.textColor=t.headerTextColor),Nt.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=ee:!1===t.hideActionBar&&(r.actionbarType=X),"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){bn("CHANGE_ACTIONBAR",Je({},r),{success:function(){var o;n.config=Je({},r);var a,s=null===(o=Fe())||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===ee;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}(),$i=Yi.getInstance(),Xi=[Oi({title:hi()}).optional()];function eo(e){return to.apply(this,arguments)}function to(){return to=Ne((function(e){return Le(this,(function(t){return[2,zn("setNavigationBarTitle",Xi,[e],function(){var e=Ne((function(e){return Le(this,(function(t){switch(t.label){case 0:return Ge.isMp?[4,$i.setNavigationBarTitle(e.title)]:[3,2];case 1:return[2,t.sent()];case 2:return Ge.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(He("setNavigationBarTitle",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),to.apply(this,arguments)}var no=[Oi({color:hi(),textColor:Qi.enum(["black","white"]).optional(),statusBarColor:hi().optional()}).optional()];function ro(e){return io.apply(this,arguments)}function io(){return io=Ne((function(e){return Le(this,(function(t){return[2,zn("setNavigationBarColor",no,[e],function(){var e=Ne((function(e){return Le(this,(function(t){switch(t.label){case 0:return Ge.isMp?[4,$i.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 Ge.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(He("setNavigationBarColor",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),io.apply(this,arguments)}var oo=[Oi({type:Qi.enum(["none","back","home","both"])}).optional()];function ao(e){return so.apply(this,arguments)}function so(){return so=Ne((function(e){return Le(this,(function(t){return[2,zn("setNavigationBarLeftButton",oo,[e],function(){var e=Ne((function(e){return Le(this,(function(t){switch(t.label){case 0:return Ge.isMp?[4,$i.setNavigationBarLeftButton(e.type)]:[3,2];case 1:return[2,t.sent()];case 2:return Ge.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(He("setNavigationBarLeftButton",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),so.apply(this,arguments)}function uo(e,t,n){if(!t.has(e))throw new TypeError("attempted to "+n+" private field on non-instance");return t.get(e)}function co(e,t){return function(e,t){return t.get?t.get.call(e):t.value}(e,uo(e,t,"get"))}function lo(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 po(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,uo(e,t,"set"),n),n}var fo,ho,mo=function(){function e(){Mt(this,e)}var t=e.prototype;return t.getSynchronize=function(e){return new Map},t.setSynchronize=function(e){return{errorKeys:[]}},t.getInfoSynchronize=function(){return{currentSize:0,limitSize:0}},t.removeSynchronize=function(e){return{errorKeys:[]}},t.clearSynchronize=function(){},t.getItem=function(e){return this.getSynchronize([e]).get(e)||null},t.setItem=function(e,t){if(this.setSynchronize(Ke({},e,t)).errorKeys.length>0)throw new Error("Failed to set item: ".concat(e))},t.removeItem=function(e){this.removeSynchronize([e])},t.clear=function(){this.clearSynchronize()},t.getStorageInfo=function(){return this.getInfoSynchronize()},e}(),vo=new WeakMap,yo=new WeakMap,go=new WeakMap,_o=function(e){Bt(n,e);var t=zt(n);function n(e){var r;return Mt(this,n),lo(Zt(r=t.call(this)),vo,{writable:!0,value:localStorage}),lo(Zt(r),yo,{writable:!0,value:void 0}),lo(Zt(r),go,{writable:!0,value:void 0}),po(Zt(r),go,{keys:new Set,currentSize:0,limitSize:V}),po(Zt(r),yo,e),r.findAllCurrentDataByApp(e),r}var r=n.prototype;return r.findAllCurrentDataByApp=function(e){try{var t;for(t in co(this,vo)){if(e)if(t.split("_")[0]!==e)continue;co(this,go).keys.add(t)}}catch(e){}},r.get=function(e){var t=this,n=new Map;return e.forEach((function(e){n.set(e,t.getSync(e))})),Promise.resolve(n)},r.getSync=function(e){return co(this,yo)&&(e="".concat(co(this,yo),"_").concat(e)),co(this,go).keys.has(e)?co(this,vo).getItem(e):null},r.set=function(e){var t=this;return Ne((function(){return Le(this,(function(n){return Object.entries(e).forEach((function(e){var n=qe(e,2),r=n[0],i=n[1];t.setSync(r,i.replace(/\\"/g,'"'))})),[2,Promise.resolve({errorKeys:[]})]}))}))()},r.setSync=function(e,t){co(this,yo)&&(e="".concat(co(this,yo),"_").concat(e)),co(this,vo).setItem(e,t),co(this,go).keys.add(e)},r.getInfo=function(){var e=this;return Ne((function(){return Le(this,(function(t){return[2,Promise.resolve(e.getInfoSync())]}))}))()},r.getInfoSync=function(){var e=function(e,t){var n,r=0;for(n in e){var i=n.split("_")[0];e.hasOwnProperty(n)&&(t&&i!==t||(r+=2*(e[n].length+n.length)))}return r}(co(this,vo),co(this,yo));return{currentSize:Nt.isNumber(e)?Number((e/1024).toFixed(2)):0,limitSize:Number((V/1024).toFixed(2))}},r.remove=function(e){var t=this;return Ne((function(){return Le(this,(function(n){return e.forEach((function(e){t.removeSync(e)})),[2,Promise.resolve({errorKeys:[]})]}))}))()},r.removeSync=function(e){co(this,yo)&&(e="".concat(co(this,yo),"_").concat(e)),co(this,go).keys.has(e)&&(co(this,vo).removeItem(e),co(this,go).keys.delete(e))},r.clearAsync=function(){var e=this;return Ne((function(){return Le(this,(function(t){return[2,Promise.resolve(e.clearSync())]}))}))()},r.clearSync=function(){var e=this;co(this,go).keys.forEach((function(t){co(e,yo)&&t.indexOf(co(e,yo))<0||(co(e,vo).removeItem(t),co(e,go).keys.delete(t))}))},r.setSynchronize=function(e){var t=this;return Object.entries(e).forEach((function(e){var n=qe(e,2),r=n[0],i=n[1];t.setSync(r,i)})),{errorKeys:[]}},r.getSynchronize=function(e){var t=this,n=new Map;return e.forEach((function(e){n.set(e,t.getSync(e))})),n},r.getInfoSynchronize=function(){return this.getInfoSync()},r.clearSynchronize=function(){this.clearSync()},n}(mo),wo=new WeakMap,To=new WeakMap,bo=function(e){Bt(n,e);var t=zt(n);function n(e){var r;return Mt(this,n),lo(Zt(r=t.call(this)),wo,{writable:!0,value:void 0}),lo(Zt(r),To,{writable:!0,value:void 0}),po(Zt(r),To,{keys:new Set,currentSize:0,limitSize:V}),po(Zt(r),wo,e),r}var r=n.prototype;return r.get=function(e){var t=this;return Ne((function(){return Le(this,(function(n){return[2,new Promise((function(n,r){bn("ZBROWSER_MPDS",{mpds_action:"mpds.get",mpds_data:{keys:e},appId:co(t,wo)},{success:function(e){var t=new Map;e&&e.mpds_data&&e.mpds_data.map&&(t=new Map(Object.entries(e.mpds_data.map))),n(t)},fail:function(e){r(e)}},{isMultiCallback:!1})}))]}))}))()},r.getSynchronize=function(e){var t={mpds_action:"mpds.get",mpds_data:{keys:e},appId:co(this,wo)},n=new Map,r=this.handleResult(t);return r&&r.mpds_data&&r.mpds_data.map&&(n=new Map(Object.entries(r.mpds_data.map))),n},r.set=function(e){var t=this;return Ne((function(){return Le(this,(function(n){return[2,new Promise((function(n,r){bn("ZBROWSER_MPDS",{mpds_action:"mpds.set",mpds_data:{map:e},appId:co(t,wo)},{success:function(e){var t=[];e&&e.mpds_data&&e.mpds_data.error_keys&&(t=e.mpds_data.error_keys),n({errorKeys:t})},fail:function(e){r(e)}},{isMultiCallback:!1})}))]}))}))()},r.setSynchronize=function(e){var t={mpds_action:"mpds.set",mpds_data:{map:e},appId:co(this,wo)},n=[],r=this.handleResult(t);return r&&r.mpds_data&&r.mpds_data.error_keys&&(n=r.mpds_data.error_keys),{errorKeys:n}},r.getInfo=function(){var e=this;return Ne((function(){return Le(this,(function(t){return[2,new Promise((function(t,n){bn("ZBROWSER_MPDS",{mpds_action:"mpds.get.size",mpds_data:{},appId:co(e,wo)},{success:function(e){var n=0;e&&e.mpds_data&&e.mpds_data.size&&(n=e.mpds_data.size),t({currentSize:Nt.isNumber(n)?Number(Number(n)/1024):0,limitSize:Number(V/1024)})},fail:function(e){n(e)}},{isMultiCallback:!1})}))]}))}))()},r.getInfoSynchronize=function(){var e={mpds_action:"mpds.get.size",mpds_data:{},appId:co(this,wo)},t=0,n=this.handleResult(e);return n&&n.mpds_data&&n.mpds_data.size&&(t=n.mpds_data.size),{currentSize:Nt.isNumber(t)?Number(Number(t)/1024):0,limitSize:Number(V/1024)}},r.remove=function(e){var t=this;return Ne((function(){return Le(this,(function(n){return[2,new Promise((function(n,r){bn("ZBROWSER_MPDS",{mpds_action:"mpds.remove.key",mpds_data:{keys:e},appId:co(t,wo)},{success:function(e){var t=[];e&&e.mpds_data&&e.mpds_data.error_keys&&(t=e.mpds_data.error_keys),n({errorKeys:t})},fail:function(e){r(e)}},{isMultiCallback:!1})}))]}))}))()},r.removeSynchronize=function(e){var t={mpds_action:"mpds.remove.key",mpds_data:{keys:e},appId:co(this,wo)},n=[],r=this.handleResult(t);return r&&r.mpds_data&&r.mpds_data.error_keys&&(n=r.mpds_data.error_keys),{errorKeys:n}},r.clearAsync=function(){var e=this;return Ne((function(){return Le(this,(function(t){return[2,new Promise((function(t,n){bn("ZBROWSER_MPDS",{mpds_action:"mpds.clear.appData",mpds_data:{},appId:co(e,wo)},{success:function(){t()},fail:function(e){n(e)}},{isMultiCallback:!1})}))]}))}))()},r.clearSynchronize=function(){var e={mpds_action:"mpds.clear.appData",mpds_data:{},appId:co(this,wo)};this.handleResult(e)},r.handleResult=function(e){var t=null;try{var n=ZaloJavaScriptInterface.processActionMPDS(JSON.stringify(e));if(n=JSON.parse(n)){if(0===n.error_code)return n.data;t=Tn(n).toJSON()}}catch(e){t=e}finally{if(null!==t)throw t}return{}},n}(mo),Eo=function(){function e(){Mt(this,e)}var t=e.prototype;return t.getDataFromStorage=function(e){var t=this;return Ne((function(){var n,r;return Le(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]=kn(e)})),[2,r]}}))}))()},t.getItem=function(e){return this.getInstance().getItem(e)},t.putDataToStorage=function(e){var t=this;return Ne((function(){var n,r;return Le(this,(function(i){switch(i.label){case 0:return n=t.getInstance(),r={},Object.entries(e).forEach((function(e){var t=qe(e,2),n=t[0],i=t[1];Nt.isUndefined(i)||Nt.isNull(i)||(r[n]=Mn(i))})),[4,n.set(r)];case 1:return[2,i.sent()]}}))}))()},t.setItem=function(e,t){return this.getInstance().setItem(e,t)},t.removeDataFromStorage=function(e){var t=this;return Ne((function(){return Le(this,(function(n){switch(n.label){case 0:return[4,t.getInstance().remove(e)];case 1:return[2,n.sent()]}}))}))()},t.removeItem=function(e){this.getInstance().removeItem(e)},t.clearStorage=function(){var e=this;return Ne((function(){return Le(this,(function(t){switch(t.label){case 0:return[4,e.getInstance().clearAsync()];case 1:return t.sent(),[2]}}))}))()},t.clearStorageSync=function(){this.getInstance().clear()},t.getStorageInfo=function(){var e=this;return Ne((function(){return Le(this,(function(t){switch(t.label){case 0:return[4,e.getInstance().getInfo()];case 1:return[2,t.sent()]}}))}))()},t.getStorageInfoSync=function(){return this.getInstance().getStorageInfo()},e}(),Po=new WeakMap,So=function(e){Bt(n,e);var t=zt(n);function n(e){var r;return Mt(this,n),lo(Zt(r=t.call(this)),Po,{writable:!0,value:void 0}),po(Zt(r),Po,e),r}return n.prototype.getInstance=function(){return new _o(co(this,Po))},n}(Eo),Io=new WeakMap,Ao=function(e){Bt(n,e);var t=zt(n);function n(e){var r;return Mt(this,n),lo(Zt(r=t.call(this)),Io,{writable:!0,value:void 0}),po(Zt(r),Io,e),r}return n.prototype.getInstance=function(){return new bo(co(this,Io))},n}(Eo),Oo=new So(o),ko=dn(),Co=(null===(fo=Fe())||void 0===fo?void 0:fo.platformName)||"unknown";ko>0&&ko>={android:12100571,iOS:400,wp:0,unknown:0}[Co]&&(null===(ho=Fe())||void 0===ho?void 0:ho.appEnv.isMp)&&(Oo=new Ao(o));var No=Oo,Mo=[Oi({data:Qi.record(hi(),Qi.any())}).optional()];function Ro(e){return xo.apply(this,arguments)}function xo(){return xo=Ne((function(e){return Le(this,(function(t){return[2,zn("setStorage",Mo,[e],function(){var e=Ne((function(e){return Le(this,(function(t){switch(t.label){case 0:return Ge.isMp||Ge.isMpWeb?[4,No.putDataToStorage(e.data)]:[3,2];case 1:return[2,t.sent()];case 2:return[2,Promise.reject(He("setStorage",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),xo.apply(this,arguments)}var Do=[Oi({keys:Qi.array(hi())}).optional()];function Lo(e){return Uo.apply(this,arguments)}function Uo(){return Uo=Ne((function(e){return Le(this,(function(t){return[2,zn("getStorage",Do,[e],function(){var e=Ne((function(e){return Le(this,(function(t){switch(t.label){case 0:return Ge.isMp||Ge.isMpWeb?[4,No.getDataFromStorage(e.keys)]:[3,2];case 1:return[2,t.sent()];case 2:return[2,Promise.reject(He("getStorage",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Uo.apply(this,arguments)}function jo(e){return Bo.apply(this,arguments)}function Bo(){return(Bo=Ne((function(e){return Le(this,(function(t){return[2,zn("getStorageInfo",[],[e],Ne((function(){return Le(this,(function(e){switch(e.label){case 0:return Ge.isMp||Ge.isMpWeb?[4,No.getStorageInfo()]:[3,2];case 1:return[2,e.sent()];case 2:return[2,Promise.reject(He("getStorageInfo",{}))]}}))})))]}))}))).apply(this,arguments)}var Zo=[Oi({keys:Qi.array(hi())}).optional()];function zo(e){return Wo.apply(this,arguments)}function Wo(){return Wo=Ne((function(e){return Le(this,(function(t){return[2,zn("removeStorage",Zo,[e],function(){var e=Ne((function(e){return Le(this,(function(t){switch(t.label){case 0:return Ge.isMp||Ge.isMpWeb?[4,No.removeDataFromStorage(e.keys)]:[3,2];case 1:return[2,t.sent()];case 2:return[2,Promise.reject(He("removeStorage",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Wo.apply(this,arguments)}var Fo=[Oi({prefix:hi().optional()}).optional()];function Go(e){return Vo.apply(this,arguments)}function Vo(){return(Vo=Ne((function(e){return Le(this,(function(t){return[2,zn("clearStorage",Fo,[e],Ne((function(){return Le(this,(function(e){switch(e.label){case 0:return Ge.isMp||Ge.isMpWeb?[4,No.clearStorage()]:[3,2];case 1:return[2,e.sent()];case 2:return[2,Promise.reject(He("clearStorage",{}))]}}))})))]}))}))).apply(this,arguments)}var Ho=function(){var e=Ne((function(e,t){var n,r,i,a;return Le(this,(function(s){switch(s.label){case 0:return(r=t)?[3,2]:[4,Ln()];case 1:r=!s.sent(),s.label=2;case 2:return n=r,[4,Sn.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=Ne((function(e){var t,n,r,i,o,a;return Le(this,(function(s){switch(s.label){case 0:return[4,e.json()];case 1:if(r=s.sent(),void 0!==(i=null==r?void 0:r.error)&&0!==i)throw o=(null==r?void 0:r.message)||O,new mn(i,o);return a=null==r?void 0:r.user_id_by_oa,[2,{id:null==r?void 0:r.id,name:(null==r?void 0:r.name)||"",avatar:(null==r||null===(t=r.picture)||void 0===t||null===(n=t.data)||void 0===n?void 0:n.url)||"",idByOA:a,followedOA:!!(null==r?void 0:r.is_follower),isSensitive:null==r?void 0:r.is_sensitive}]}}))}));return function(t){return e.apply(this,arguments)}}())];case 4:return[2,s.sent()]}}))}));return function(t,n){return e.apply(this,arguments)}}(),Ko=[Oi({avatarType:Qi.enum(["small","normal","large"]).optional(),autoRequestPermission:Qi.boolean().default(!1).optional()}).optional()];function Jo(e){return qo.apply(this,arguments)}function qo(){return qo=Ne((function(e){return Le(this,(function(t){return[2,zn("getUserInfo",Ko,[e],function(){var e=Ne((function(e){var t,n,r;return Le(this,(function(i){switch(i.label){case 0:if(!Ge.isMp)return[3,4];t=null==e?void 0:e.avatarType,n=null==e?void 0:e.autoRequestPermission,i.label=1;case 1:return i.trys.push([1,3,,4]),[4,Ho(t,n)];case 2:return[2,{userInfo:i.sent()}];case 3:return r=i.sent(),[2,Promise.reject(r)];case 4:return Ge.isMpWeb?[2,Promise.resolve({userInfo:{id:"3368637342326461234",name:"User Name",avatar:"https://h5.zdn.vn/static/images/avatar.png"}})]:[2,Promise.reject(He("getUserInfo",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),qo.apply(this,arguments)}var Qo=function(e){return{NONE:e?-2:0,WIFI:e?0:1,"2G":2,"3G":e?15:2,"4G":e?13:2}},Yo=Ne((function(){return Le(this,(function(t){return[2,new Promise((function(t,n){bn("WEBVIEW_NETWORKTYPE",{url:window.location.href,featureId:""},{success:function(n){var r,i,o,a=n.network,s=(null===(r=Fe())||void 0===r||null===(i=r.platform)||void 0===i?void 0:i.isAndroid)||!1;switch(a){case Qo(s).NONE:o=e.NetworkType.none;break;case Qo(s).WIFI:o=e.NetworkType.wifi;break;case Qo(s)["2G"]:case Qo(s)["3G"]:case Qo(s)["4G"]:o=e.NetworkType.cellular;break;default:o=e.NetworkType.unknown}t(o)},fail:function(e){n(e)}},{})}))]}))}));function $o(e){return Xo.apply(this,arguments)}function Xo(){return(Xo=Ne((function(t){return Le(this,(function(n){return[2,zn("getNetworkType",[],[t],Ne((function(){var t,n;return Le(this,(function(r){switch(r.label){case 0:return Ge.isMp?[4,Yo()]:[3,2];case 1:return[2,{networkType:r.sent()}];case 2:if(Ge.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(He("getNetworkType",{}))]}}))})))]}))}))).apply(this,arguments)}var ea=[Qi.function().args(Oi({isConnected:Qi.boolean(),networkType:Qi.enum(["none","wifi","cellular","unknown"])})).returns(Qi.void())];function ta(t){return zn("onNetworkStatusChange",ea,[t],(function(t){var n=t;if(Ge.isMp)!function(t){Kt.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(Ge.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 na=function(){var e=Ne((function(e){var t,n,r,i,o,a;return Le(this,(function(s){return a={subaction:0,scanning_type:Nt.isNumber(null==e?void 0:e.scanningType)?e.scanningType:0,data:{scan_from_source:Nt.isString(null==e?void 0:e.scanFromSource)?e.scanFromSource:"",expire:Nt.isNumber(null==e?void 0:e.expire)?e.expire:3e3,monitor_interval:Nt.isNumber(null==e?void 0:e.monitorInterval)?e.monitorInterval:60,domain:Nt.isString(null==e?void 0:e.domain)?e.domain:"",scan_config:{scan_time:Nt.isNumber(null==e||null===(t=e.scanConfig)||void 0===t?void 0:t.scanTime)?e.scanConfig.scanTime:15e3,time_between_scan:Nt.isNumber(null==e||null===(n=e.scanConfig)||void 0===n?void 0:n.timeBetweenScan)?e.scanConfig.timeBetweenScan:1e4,beacon_timeout:Nt.isNumber(null==e||null===(r=e.scanConfig)||void 0===r?void 0:r.beaconTimeout)?e.scanConfig.beaconTimeout:3e4,delayCheckConnectedTimeout:Nt.isNumber(null==e||null===(i=e.scanConfig)||void 0===i?void 0:i.delayCheckConnectedTimeout)?e.scanConfig.delayCheckConnectedTimeout:5e3,beaconConnectedTimeout:Nt.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){bn("SCAN_IBEACON",Je({},a),{success:function(){e(!0)},fail:function(e){t(e)}},{})}))]}))}));return function(t){return e.apply(this,arguments)}}(),ra=[Oi({scanningType:Qi.number().refine((function(e){return[0,1].includes(e)}),{message:"The type must be either 0 or 1"}).default(0).optional(),expire:Qi.number().optional(),monitorInterval:Qi.number().optional(),domain:Qi.string().optional(),scanConfig:Oi({scanTime:Qi.number().optional(),timeBetweenScan:Qi.number().optional(),beaconTimeout:Qi.number().optional(),delayCheckConnectedTimeout:Qi.number().optional(),beaconConnectedTimeout:Qi.number().optional()}).optional(),items:Qi.array(Oi({id:Qi.string().optional(),distance:Qi.number().optional(),monitor:Oi({enable:Qi.boolean().optional(),movingRange:Qi.number().optional()}).optional()})).optional(),scanFromSource:Qi.string().optional()}).optional()];function ia(e){return oa.apply(this,arguments)}function oa(){return(oa=Ne((function(e){return Le(this,(function(t){return[2,zn("startBeaconDiscovery",ra,[e],Ne((function(){return Le(this,(function(t){switch(t.label){case 0:return Ge.isMp?[4,na(e)]:[3,2];case 1:return[2,t.sent()];case 2:return Ge.isMpWeb?[2,Promise.resolve(!0)]:[2,Promise.reject(He("startBeaconDiscovery",{}))]}}))})))]}))}))).apply(this,arguments)}var aa=Ne((function(){return Le(this,(function(e){return[2,new Promise((function(e,t){bn("SCAN_IBEACON",{subaction:2},{success:function(){e(!0)},fail:function(e){t(e)}},{})}))]}))}));function sa(e){return ua.apply(this,arguments)}function ua(){return(ua=Ne((function(e){return Le(this,(function(t){return[2,zn("stopBeaconDiscovery",[],[e],Ne((function(){return Le(this,(function(e){switch(e.label){case 0:return Ge.isMp?[4,aa()]:[3,2];case 1:return[2,e.sent()];case 2:return Ge.isMpWeb?[2,Promise.resolve(!0)]:[2,Promise.reject(He("stopBeaconDiscovery",{}))]}}))})))]}))}))).apply(this,arguments)}var ca=Ne((function(){return Le(this,(function(e){return[2,new Promise((function(e,t){bn("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 la(e){return da.apply(this,arguments)}function da(){return(da=Ne((function(e){return Le(this,(function(t){return[2,zn("getBeacons",[],[e],Ne((function(){return Le(this,(function(e){switch(e.label){case 0:return Ge.isMp?[4,ca()]:[3,2];case 1:return[2,e.sent()];case 2:return Ge.isMpWeb?[2,Promise.resolve({beacons:[]})]:[2,Promise.reject(He("getBeacons",{}))]}}))})))]}))}))).apply(this,arguments)}var pa=Ne((function(){return Le(this,(function(e){return[2,new Promise((function(e,t){bn("WINDOW_CLOSE",{},{success:function(t){e(t)},fail:function(e){t(e)}},{})}))]}))}));function fa(e){return ha.apply(this,arguments)}function ha(){return(ha=Ne((function(e){return Le(this,(function(t){return[2,zn("closeApp",[],[e],Ne((function(){return Le(this,(function(e){switch(e.label){case 0:return Ge.isMp?[4,pa()]:[3,2];case 1:return[2,e.sent()];case 2:return Ge.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(He("closeApp",{}))]}}))})))]}))}))).apply(this,arguments)}var ma=Ne((function(){return Le(this,(function(e){return[2,new Promise((function(e,t){bn("OPEN_QR",{skipOpenLink:!0},{success:function(t){e(t)},fail:function(e){t(e)}},{})}))]}))}));function va(e){return ya.apply(this,arguments)}function ya(){return(ya=Ne((function(e){return Le(this,(function(t){return[2,zn("scanQRCode",[],[e],Ne((function(){return Le(this,(function(e){switch(e.label){case 0:return Ge.isMp?[4,ma()]:[3,2];case 1:return[2,e.sent()];case 2:return Ge.isMpWeb?[2,Promise.resolve({content:""})]:[2,Promise.reject(He("scanQRCode",{}))]}}))})))]}))}))).apply(this,arguments)}var ga=function(){var t=Ne((function(t,n,r,o){return Le(this,(function(a){return[2,new Promise((function(a,s){bn("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)}}(),_a=[Oi({id:hi(),type:Qi.enum(["user","oa","aliasOA"]),sourceId:Qi.any().optional(),sourceIndex:Qi.any().optional()}).optional()];function wa(e){return Ta.apply(this,arguments)}function Ta(){return Ta=Ne((function(e){return Le(this,(function(t){return[2,zn("openProfile",_a,[e],function(){var e=Ne((function(e){var t,n,r,i;return Le(this,(function(o){switch(o.label){case 0:return Ge.isMp?(t=e.id,n=e.type,r=e.sourceId,i=e.sourceIndex,[4,ga(t,n,r,i)]):[3,2];case 1:return[2,o.sent()];case 2:return Ge.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(He("openProfile",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Ta.apply(this,arguments)}var ba=function(){var t=Ne((function(t,n){var r,o,a,s=arguments;return Le(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){bn("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)}}(),Ea=[Oi({id:hi(),type:Qi.enum(["user","oa"]),sourceId:Qi.any().optional(),sourceIndex:Qi.any().optional(),message:hi().optional()}).optional()];function Pa(e){return Sa.apply(this,arguments)}function Sa(){return Sa=Ne((function(e){return Le(this,(function(t){return[2,zn("openChat",Ea,[e],function(){var e=Ne((function(e){var t,n,r,i,o;return Le(this,(function(a){switch(a.label){case 0:return Ge.isMp?(t=e.id,n=e.type,r=e.message,i=e.sourceId,o=e.sourceIndex,[4,ba(t,n,r,i,o)]):[3,2];case 1:return[2,a.sent()];case 2:return Ge.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(He("openChat",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Sa.apply(this,arguments)}function Ia(e,t){return t=null!=t?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))})),e}var Aa=function(){var t=Ne((function(t,n){var r,o;return Le(this,(function(a){switch(r={},o=t,t){case"image":(null==n?void 0:n.imageUrls)?(o="multi_image",r={photoUrl:null==n?void 0:n.imageUrls}):r={photoUrl:null==n?void 0:n.imageUrl};break;case"link":r={link:null==n?void 0:n.link,title:null==n?void 0:n.title,thumb:null==n?void 0:n.thumb,description:null==n?void 0:n.description};break;case"profile":r={avt:null==n?void 0:n.avatar,uid:null==n?void 0:n.id,dpn:null==n?void 0:n.displayName}}return[2,new Promise((function(t,n){bn("OPEN_POSTFEED",Ia(Je({type:e.PostFeedType[o]},r),{zapp:i}),{success:function(e){t({status:null==e?void 0:e.status,shareType:null==e?void 0:e.share_type,numberOfUser:null==e?void 0:e.uid_to_size})},fail:function(e){n(e)}},{})}))]}))}));return function(e,n){return t.apply(this,arguments)}}(),Oa=[Qi.union([Oi({type:Qi.enum(["image"]),data:Oi({imageUrl:hi().url().optional(),imageUrls:Qi.array(hi().url()).optional()})}),Oi({type:Qi.enum(["link"]),data:Oi({link:hi().url(),title:hi().max(100).optional(),thumb:hi().url().optional(),description:hi().max(400).default("").optional()})}),Oi({type:Qi.enum(["profile"]),data:Oi({id:hi().optional()})})])];function ka(e){return Ca.apply(this,arguments)}function Ca(){return Ca=Ne((function(e){return Le(this,(function(t){return[2,zn("openPostFeed",Oa,[e],function(){var e=Ne((function(e){var t,n;return Le(this,(function(r){switch(r.label){case 0:return Ge.isMp?(t=e.type,n=e.data,[4,Aa(t,n)]):[3,2];case 1:return[2,r.sent()];case 2:return Ge.isMpWeb?[2,Promise.resolve({status:1,shareType:0,numberOfUser:0})]:[2,Promise.reject(He("openPostFeed",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Ca.apply(this,arguments)}var Na=function(){var e=Ne((function(e){return Le(this,(function(t){return[2,new Promise((function(t,n){bn("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)}}(),Ma=[Oi({id:hi(),showDialogConfirm:Qi.boolean().optional()}).optional()];function Ra(e){return xa.apply(this,arguments)}function xa(){return xa=Ne((function(e){return Le(this,(function(t){return[2,zn("followOA",Ma,[e],function(){var e=Ne((function(e){var t;return Le(this,(function(n){switch(n.label){case 0:return Ge.isMp?(t=e.id,[4,Na(t)]):[3,2];case 1:return[2,n.sent()];case 2:return Ge.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(He("followOA",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),xa.apply(this,arguments)}var Da=function(){var e=Ne((function(e){return Le(this,(function(t){return[2,new Promise((function(t,n){bn("UNFOLLOW_OA",{uid:e,forceUpdate:!0,zapp:i},{success:function(){t()},fail:function(e){n(e)}},{})}))]}))}));return function(t){return e.apply(this,arguments)}}(),La=[Oi({id:hi()}).optional()];function Ua(e){return ja.apply(this,arguments)}function ja(){return ja=Ne((function(e){return Le(this,(function(t){return[2,zn("unfollowOA",La,[e],function(){var e=Ne((function(e){var t;return Le(this,(function(n){switch(n.label){case 0:return Ge.isMp?(t=e.id,[4,Da(t)]):[3,2];case 1:return[2,n.sent()];case 2:return Ge.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(He("unfollowOA",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),ja.apply(this,arguments)}var Ba=function(){var e=Ne((function(e,t,n,r,i,o){var s,u,l,p,f,h,m,v;return Le(this,(function(y){switch(y.label){case 0:return l=new URL(location.href),p=new URLSearchParams,f="".concat(l.pathname.replace(c,"")).concat(l.search),o&&(f="/".concat(e).concat("/"===o[0]?"":"/").concat(o)),!(h=new URL("".concat(a).concat(f))).searchParams.has("env")&&(null===(s=window.APP_ENV)||void 0===s?void 0:s.length)>0&&h.searchParams.set("env",window.APP_ENV),!h.searchParams.has("version")&&(null===(u=window.APP_VERSION)||void 0===u?void 0:u.length)>0&&h.searchParams.set("version",window.APP_VERSION),p.append("title",n),p.append("description",r||""),p.append("thumbnail",i||""),p.append("url",h.href),p.append("accessToken",t||""),m={headers:{"Content-Type":"application/x-www-form-urlencoded"}},[4,fetch(d.CREATE_SHARE_LINK,Je({method:"POST",body:p},m))];case 1:return[4,y.sent().json()];case 2:if(!(v=y.sent())||0!==v.err)throw wn.error.cannotGetShareInfo();return h.search="".concat(h.search,"&zshareId=").concat(v.data.shareId),[2,Ia(Je({},v.data),{shareableLink:h.href})]}}))}));return function(t,n,r,i,o,a){return e.apply(this,arguments)}}(),Za=function(){var t=Ne((function(t,n){var r,a,s,u,c,l,d,p,f,h,m;return Le(this,(function(v){switch(v.label){case 0:switch(r={},a=t,t){case"text":return[3,1];case"image":return[3,2];case"gif":return[3,3];case"video":return[3,4];case"link":return[3,5];case"oa":return[3,6];case"zmp":return[3,7];case"zmp_deep_link":return[3,10]}return[3,13];case 1:return r={text:null==n?void 0:n.text,desc:(null==n?void 0:n.desc)||(null==n?void 0:n.description),autoParseLink:(null==n?void 0:n.autoParseLink)?1:0},[3,14];case 2:return c=[],l=dn(),d=(null===(u=Fe())||void 0===u?void 0:u.platformName)||"unknown",Number(l)>=G[d]&&(a="multi_image"),Array.isArray(null==n?void 0:n.imageUrls)&&(null==n?void 0:n.imageUrls.length)>0?c=null==n?void 0:n.imageUrls:c.push(null==n?void 0:n.imageUrl),r={photoUrls:c,photoUrl:null==n?void 0:n.imageUrl,caption:null==n?void 0:n.caption},[3,14];case 3:return r={photoUrl:null==n?void 0:n.imageUrl,gifUrl:null==n?void 0:n.gifUrl,width:null==n?void 0:n.width,height:null==n?void 0:n.height},[3,14];case 4:return r={videoThumb:null==n?void 0:n.videoThumb,videoUrl:null==n?void 0:n.videoUrl,width:null==n?void 0:n.width,height:null==n?void 0:n.height},[3,14];case 5:return r={link:null==n?void 0:n.link,chatOnly:(null==n?void 0:n.chatOnly)?1:0},[3,14];case 6:return r={uid:null==n?void 0:n.id},[3,14];case 7:case 10:return[4,Sn.getAccessToken()];case 8:case 11:return s=v.sent(),[4,Ba(o,s||"",(null==n?void 0:n.title)||"",(null==n?void 0:n.description)||"",(null==n?void 0:n.thumbnail)||"",null==n?void 0:n.path)];case 9:return p=v.sent(),r={data:{ZInstantAPIInfo:{url:"".concat(p.zinstantApi),zinstantdata_id:"templateId=".concat(p.ztemplateId,"&appId=").concat(o,"&shareId=").concat(p.shareId)},previewMsgText:{msg:{en:"Zalo Mini Program",vi:"Chương trình nhỏ"}},enableReactions:1}},[3,14];case 12:return f=v.sent().shareableLink,h=new URL(f),m=h.searchParams.getAll("zshareId"),h.searchParams.delete("zshareId"),m.length>0&&h.searchParams.append("zshareId",m[0]),r={link:h.href,chatOnly:0},[3,14];case 13:return[3,14];case 14:return[2,new Promise((function(t,n){bn("OPEN_SHARESHEET",Ia(Je({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)}}(),za=[Qi.union([Oi({type:Qi.enum(["text"]),data:Oi({text:hi(),description:hi().default("").optional(),autoParseLink:Qi.boolean().default(!1).optional()})}),Oi({type:Qi.enum(["image"]),data:Oi({imageUrl:hi().url().optional(),imageUrls:Qi.array(hi().url()).max(10).optional()})}),Oi({type:Qi.enum(["link"]),data:Oi({link:hi().url(),chatOnly:Qi.boolean().optional()})}),Oi({type:Qi.enum(["oa"]),data:Oi({id:hi()})}),Oi({type:Qi.enum(["gif"]),data:Oi({gifUrl:hi().url(),imageUrl:hi().url().optional(),width:mi().min(0).optional(),height:mi().min(0).optional()})}),Oi({type:Qi.enum(["video"]),data:Oi({videoThumb:hi().url(),videoUrl:hi().url(),width:mi().min(0).optional(),height:mi().min(0).optional()})}),Oi({type:Qi.enum(["zmp","zmp_deep_link"]),data:Oi({title:hi().max(100),thumbnail:hi().url(),path:hi().optional(),description:hi().max(400).default("").optional()})})])];function Wa(e){return Fa.apply(this,arguments)}function Fa(){return Fa=Ne((function(e){return Le(this,(function(t){return[2,zn("openShareSheet",za,[e],function(){var e=Ne((function(e){var t,n;return Le(this,(function(r){switch(r.label){case 0:return Ge.isMp?(t=e.type,n=e.data,[4,Za(t,n)]):[3,2];case 1:return[2,r.sent()];case 2:return Ge.isMpWeb?[2,Promise.resolve({status:2,shareType:0,numberOfUser:0})]:[2,Promise.reject(He("openShareSheet",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Fa.apply(this,arguments)}var Ga=Ne((function(){return Le(this,(function(e){return[2,new Promise((function(e,t){bn("REQUEST_PERMISSION_CAMERA",{},{success:function(t){var n,r;(null===(n=Fe())||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=Fe())||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 Va(e){return Ha.apply(this,arguments)}function Ha(){return(Ha=Ne((function(e){return Le(this,(function(t){return[2,zn("requestCameraPermission",[],[e],Ne((function(){return Le(this,(function(e){switch(e.label){case 0:return[4,Ga()];case 1:return[2,e.sent()]}}))})))]}))}))).apply(this,arguments)}var Ka=function(){var e=Ne((function(e,t,n){return Le(this,(function(r){return[2,new Promise((function(r,i){bn("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)}}(),Ja=Ne((function(){var e,t,n,r=arguments;return Le(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=qn(),[4,on(e,t,n.version)];case 1:return[2,i.sent()]}}))})),qa=function(){var e=Ne((function(e){return Le(this,(function(t){return[2,new Promise((function(t,n){bn("OPEN_OUTAPP",{url:e},{success:function(){t()},fail:function(e){n(e)}},{})}))]}))}));return function(t){return e.apply(this,arguments)}}(),Qa=[Oi({params:Qi.record(hi(),hi()).optional()}).optional()];function Ya(e){return $a.apply(this,arguments)}function $a(){return $a=Ne((function(e){return Le(this,(function(t){return[2,zn("createShortcut",Qa,[e],function(){var e=Ne((function(e){var t,n,r,i,s,u,c,l;return Le(this,(function(d){switch(d.label){case 0:return Ge.isMp?[4,Ja(o,0)]:[3,6];case 1:return r=d.sent(),i=null===(t=Fe())||void 0===t||null===(n=t.platform)||void 0===n?void 0:n.isIOS,s=r.logoUrl||Nn("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,qa(encodeURI(l))]):[3,3];case 2:return d.sent(),[3,5];case 3:return[4,Ka("".concat(a,"/").concat(o,"/?").concat(c.toString()),u,s)];case 4:d.sent(),d.label=5;case 5:return[2,wn.success()];case 6:return Ge.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(He("createShortcut",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),$a.apply(this,arguments)}var Xa=function(){var e=Ne((function(e,t,n){return Le(this,(function(r){return[2,new Promise((function(r,o){bn("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)}}(),es=[Oi({secretData:hi(),ui:Oi({title:hi().default("Xác thực").optional(),subTitle:hi().default("Sử dụng sinh trắc học của bạn để xác thực").optional(),negativeButtonText:hi().default("Đóng").optional()}).optional(),requireFingerprint:gi().default(!0).optional()}).optional()];function ts(e){return ns.apply(this,arguments)}function ns(){return ns=Ne((function(e){return Le(this,(function(t){return[2,zn("openBioAuthentication",es,[e],function(){var e=Ne((function(e){var t,n,r;return Le(this,(function(i){switch(i.label){case 0:return Ge.isMp?(t=e.secretData,n=e.ui,r=e.requireFingerprint,[4,Xa(t,n,r)]):[3,2];case 1:return[2,i.sent()];case 2:return Ge.isMpWeb?[2,Promise.resolve({code:0,message:"OK",data:{domain:"",code:0,message:"",payToken:""}})]:[2,Promise.reject(He("openBioAuthentication",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),ns.apply(this,arguments)}var rs=Ne((function(){return Le(this,(function(e){return[2,new Promise((function(e,t){bn("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 is(e){return os.apply(this,arguments)}function os(){return(os=Ne((function(e){return Le(this,(function(t){return[2,zn("checkStateBioAuthentication",[],[e],Ne((function(){return Le(this,(function(e){switch(e.label){case 0:return Ge.isMp?[4,rs()]:[3,2];case 1:return[2,{bioState:e.sent()}];case 2:return Ge.isMpWeb?[2,Promise.resolve({bioState:""})]:[2,Promise.reject(He("checkStateBioAuthentication",{}))]}}))})))]}))}))).apply(this,arguments)}var as=function(){var e=Ne((function(e){return Le(this,(function(t){return[2,new Promise((function(t,n){bn("SHOW_TOAST",{toast:e},{success:function(){t()},fail:function(e){n(e)}},{})}))]}))}));return function(t){return e.apply(this,arguments)}}(),ss=[Oi({message:hi()}).optional()];function us(e){return cs.apply(this,arguments)}function cs(){return cs=Ne((function(e){return Le(this,(function(t){return[2,zn("showToast",ss,[e],function(){var e=Ne((function(e){return Le(this,(function(t){switch(t.label){case 0:return Ge.isMp?[4,as(e.message)]:[3,2];case 1:return[2,t.sent()];case 2:return Ge.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(He("showToast",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),cs.apply(this,arguments)}var ls=Ne((function(){return Le(this,(function(e){return[2,new Promise((function(e,t){bn("HIDE_KEYBOARD",{},{success:function(){e()},fail:function(e){t(e)}},{})}))]}))}));function ds(e){return ps.apply(this,arguments)}function ps(){return(ps=Ne((function(e){return Le(this,(function(t){return[2,zn("hideKeyboard",[],[e],Ne((function(){return Le(this,(function(e){switch(e.label){case 0:return Ge.isMp?[4,ls()]:[3,2];case 1:return[2,e.sent()];case 2:return Ge.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(He("hideKeyboard",{}))]}}))})))]}))}))).apply(this,arguments)}var fs=function(){var e=Ne((function(e){return Le(this,(function(t){return[2,new Promise((function(t,n){bn("OPEN_PHONE",{phoneNum:e,phoneCode:e},{success:function(){t()},fail:function(e){n(e)}},{})}))]}))}));return function(t){return e.apply(this,arguments)}}(),hs=[Oi({phoneNumber:hi()})];function ms(e){return vs.apply(this,arguments)}function vs(){return vs=Ne((function(e){return Le(this,(function(t){return[2,zn("openPhone",hs,[e],function(){var e=Ne((function(e){return Le(this,(function(t){switch(t.label){case 0:return Ge.isMp?[4,fs(e.phoneNumber)]:[3,2];case 1:return[2,t.sent()];case 2:return Ge.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(He("openPhone",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),vs.apply(this,arguments)}var ys=function(){var e=Ne((function(e,t){return Le(this,(function(n){return[2,new Promise((function(n,r){bn("OPEN_SMS",{content:t,phoneCode:e},{success:function(){n()},fail:function(e){r(e)}},{})}))]}))}));return function(t,n){return e.apply(this,arguments)}}(),gs=[Oi({content:hi(),phoneNumber:hi()})];function _s(e){return ws.apply(this,arguments)}function ws(){return ws=Ne((function(e){return Le(this,(function(t){return[2,zn("openSMS",gs,[e],function(){var e=Ne((function(e){return Le(this,(function(t){switch(t.label){case 0:return Ge.isMp?[4,ys(e.phoneNumber,e.content)]:[3,2];case 1:return[2,t.sent()];case 2:return Ge.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(He("openSMS",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),ws.apply(this,arguments)}var Ts=function(){var e=Ne((function(e){var t,n=arguments;return Le(this,(function(r){return t=n.length>1&&void 0!==n[1]?n[1]:"",[2,new Promise((function(n,r){bn("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)}}(),bs=[Oi({id:hi(),displayName:hi().default("").optional()})];function Es(e){return Ps.apply(this,arguments)}function Ps(){return Ps=Ne((function(e){return Le(this,(function(t){return[2,zn("viewOAQr",bs,[e],function(){var e=Ne((function(e){return Le(this,(function(t){switch(t.label){case 0:return Ge.isMp?[4,Ts(e.id,e.displayName)]:[3,2];case 1:return[2,t.sent()];case 2:return Ge.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(He("viewOAQr",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Ps.apply(this,arguments)}var Ss=function(){var e=Ne((function(e){return Le(this,(function(t){return[2,new Promise((function(t,n){bn("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)}}(),Is=[Oi({keepScreenOn:gi()})];function As(e){return Os.apply(this,arguments)}function Os(){return Os=Ne((function(e){return Le(this,(function(t){return[2,zn("keepScreen",Is,[e],function(){var e=Ne((function(e){return Le(this,(function(t){switch(t.label){case 0:return Ge.isMp?[4,Ss(e.keepScreenOn)]:[3,2];case 1:return[2,t.sent()];case 2:return Ge.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(He("keepScreen",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Os.apply(this,arguments)}function ks(e){return Cs.apply(this,arguments)}function Cs(){return(Cs=Ne((function(e){return Le(this,(function(t){return[2,zn("onKeepScreen",[],[e],Ne((function(){return Le(this,(function(e){switch(e.label){case 0:return Ge.isMp?[4,Ss(!0)]:[3,2];case 1:return[2,e.sent()];case 2:return Ge.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(He("onKeepScreen",{}))]}}))})))]}))}))).apply(this,arguments)}function Ns(e){return Ms.apply(this,arguments)}function Ms(){return(Ms=Ne((function(e){return Le(this,(function(t){return[2,zn("offKeepScreen",[],[e],Ne((function(){return Le(this,(function(e){switch(e.label){case 0:return Ge.isMp?[4,Ss(!1)]:[3,2];case 1:return[2,e.sent()];case 2:return Ge.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(He("offKeepScreen",{}))]}}))})))]}))}))).apply(this,arguments)}var Rs=function(){var e=Ne((function(e,t,n){var r;return Le(this,(function(i){return r={},e?r={imageBase64Data:e}:t&&(r={imageUrl:t}),[2,new Promise((function(e,t){bn("SAVE_IMAGE_GALLERY",Ia(Je({},r),{onProgress:n}),{success:function(){e()},fail:function(e){t(e)}},{})}))]}))}));return function(t,n,r){return e.apply(this,arguments)}}(),xs=[Oi({imageBase64Data:hi().max(7e6).optional(),imageUrl:hi().url().optional()}).optional()];function Ds(e){return Ls.apply(this,arguments)}function Ls(){return Ls=Ne((function(e){return Le(this,(function(t){return[2,zn("saveImageToGallery",xs,[e],function(){var e=Ne((function(e){return Le(this,(function(t){switch(t.label){case 0:return Ge.isMp?[4,Rs(e.imageBase64Data,e.imageUrl,e.onProgress)]:[3,2];case 1:return[2,t.sent()];case 2:return Ge.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(He("saveImageToGallery",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Ls.apply(this,arguments)}var Us=function(){var e=Ne((function(e,t,n){var r;return Le(this,(function(i){return r={},t?r={videoBase64Data:t}:e&&(r={videoUrl:e}),[2,new Promise((function(e,t){bn("SAVE_VIDEO_GALLERY",Ia(Je({},r),{onProgress:n}),{success:function(){e()},fail:function(e){t(e)}},{})}))]}))}));return function(t,n,r){return e.apply(this,arguments)}}(),js=[Oi({videoUrl:hi().url().optional(),videoBase64Data:hi().max(7e6).optional()}).optional()];function Bs(e){return Zs.apply(this,arguments)}function Zs(){return Zs=Ne((function(e){return Le(this,(function(t){return[2,zn("saveVideoToGallery",js,[e],function(){var e=Ne((function(e){return Le(this,(function(t){switch(t.label){case 0:return Ge.isMp?[4,Us(e.videoUrl,e.videoBase64Data,e.onProgress)]:[3,2];case 1:return[2,t.sent()];case 2:return Ge.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(He("saveVideoToGallery",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Zs.apply(this,arguments)}var zs=function(){var e=Ne((function(e){var t,n,r,i,o,a,u=arguments;return Le(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,Ja(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=qe(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){bn("OPEN_MP",{mpUrl:o,mpInfo:i},{success:function(){e()},fail:function(e){t(e)}},{})}))]}}))}));return function(t){return e.apply(this,arguments)}}(),Ws=[Oi({appId:hi(),path:hi().optional(),params:Qi.record(hi(),hi()).optional()})];function Fs(e){return Gs.apply(this,arguments)}function Gs(){return Gs=Ne((function(e){return Le(this,(function(t){return[2,zn("openMiniApp",Ws,[e],function(){var e=Ne((function(e){return Le(this,(function(t){switch(t.label){case 0:return Ge.isMp?[4,zs(e.appId,e.path,e.params)]:[3,2];case 1:return[2,t.sent()];case 2:return Ge.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(He("openMiniApp",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Gs.apply(this,arguments)}var Vs=Ne((function(){var t,n,r=arguments;return Le(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){bn("INTERACTIVE_VIBRATION",{type:e.VibrateType[t],vibrate_time:n},{success:function(){r()},fail:function(e){i(e)}},{})}))]}))})),Hs=[Oi({type:Qi.enum(["oneShot"]).default("oneShot").optional(),milliseconds:mi().optional()})];function Ks(e){return Js.apply(this,arguments)}function Js(){return Js=Ne((function(e){return Le(this,(function(t){return[2,zn("vibrate",Hs,[e],function(){var e=Ne((function(e){return Le(this,(function(t){switch(t.label){case 0:return Ge.isMp?[4,Vs(null==e?void 0:e.type,null==e?void 0:e.milliseconds)]:[3,2];case 1:return[2,t.sent()];case 2:return Ge.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(He("vibrate",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Js.apply(this,arguments)}var qs=function(){var e=Ne((function(e,t,n){var r,i,o,a,s;return Le(this,(function(u){return r=new URL(e),i=r.href.includes("vnpay"),o=r.searchParams.get("typeInapp"),a=Nt.isEmpty(t)?void 0:{modal_style:(null==t?void 0:t.style)?sn(null==t?void 0:t.style):"bottom_sheet",left_button:(null==t?void 0:t.leftButton)?sn(null==t?void 0:t.leftButton):"back"},s=Number.isInteger(n)?n:void 0,!i&&Nt.isEmpty(o)&&r.searchParams.set("typeInapp","1"),[2,new Promise((function(e,t){bn("OPEN_INAPP",{url:r.href,style:a,h5_src_open:s},{success:function(){e()},fail:function(e){t(e)}},{})}))]}))}));return function(t,n,r){return e.apply(this,arguments)}}(),Qs=[Oi({url:hi(),config:Oi({style:Qi.enum(["bottomSheet","normal"]).default("bottomSheet").optional(),leftButton:Qi.enum(["back","none"]).default("back").optional()}).optional()})];function Ys(e){return $s.apply(this,arguments)}function $s(){return $s=Ne((function(e){return Le(this,(function(t){return[2,zn("openWebview",Qs,[e],function(){var e=Ne((function(e){return Le(this,(function(t){switch(t.label){case 0:return Ge.isMp?[4,qs(e.url,e.config)]:[3,2];case 1:return[2,t.sent()];case 2:return Ge.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(He("openWebview",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),$s.apply(this,arguments)}function Xs(){var e={},t=window.location.href;try{var n=new URL(t).searchParams.toString();n&&(e=Qt.getParamsAsObject(n))}catch(e){throw new Error("Invalid URL")}return e}function eu(){return zn("getRouteParams",[],[],(function(){return Xs()}))}function tu(e){return nu.apply(this,arguments)}function nu(){return(nu=Ne((function(e){return Le(this,(function(t){return[2,zn("getAppInfo",[],[e],Ne((function(){return Le(this,(function(e){switch(e.label){case 0:return Ge.isMp?[4,Ja()]:[3,2];case 1:return[2,e.sent()];case 2:return Ge.isMpWeb?[2,Promise.resolve({description:"",name:"",version:"",appUrl:"",qrCodeUrl:""})]:[2,Promise.reject(He("getAppInfo",{}))]}}))})))]}))}))).apply(this,arguments)}var ru=function(){var e=Ne((function(e){return Le(this,(function(t){return[2,new Promise((function(t,n){bn("WEBVIEW_SET_RESULT",{result:Mn(e)},{success:function(){t()},fail:function(e){n(e)}},{})}))]}))}));return function(t){return e.apply(this,arguments)}}(),iu=[Oi({data:Qi.any()})];function ou(e){return au.apply(this,arguments)}function au(){return au=Ne((function(e){return Le(this,(function(t){return[2,zn("sendDataToPreviousMiniApp",iu,[e],function(){var e=Ne((function(e){return Le(this,(function(t){switch(t.label){case 0:return Ge.isMp?[4,ru(e.data)]:[3,2];case 1:return[2,t.sent()];case 2:return Ge.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(He("sendDataToPreviousMiniApp",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),au.apply(this,arguments)}var su=Ne((function(){return Le(this,(function(e){return[2,new Promise((function(e,t){var n,r;bn("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(wn.error.clientNotSupport())},fail:function(e){t(e)}},{delay:(null===(n=Fe())||void 0===n||null===(r=n.platform)||void 0===r?void 0:r.isIOS)?400:0})}))]}))}));function uu(e){return cu.apply(this,arguments)}function cu(){return(cu=Ne((function(e){return Le(this,(function(t){return[2,zn("getPhoneNumber",[],[e],Ne((function(){return Le(this,(function(e){switch(e.label){case 0:return Ge.isMp?[4,su()]:[3,2];case 1:return[2,e.sent()];case 2:return Ge.isMpWeb?[2,Promise.resolve({number:""})]:[2,Promise.reject(He("getPhoneNumber",{}))]}}))})))]}))}))).apply(this,arguments)}var lu=Ne((function(){var t,n,r,a=arguments;return Le(this,(function(s){return t=a.length>0&&void 0!==a[0]?a[0]:1,n=a.length>1?a[1]:void 0,r=a.length>2?a[2]:void 0,[2,new Promise((function(a,s){bn("MP_OPEN_PROFILE_PICKER",Je({},n===e.OpenProfilePickerType.TOOL_DEL_FRIEND?{maxProfile:t,src:n,uids:r,zapp:i,appId:o}:{maxProfile:t}),{success:function(e){Array.isArray(e)?a(e.map((function(e){return e.id}))):a([])},fail:function(e){s(e)}},{isMultiCallback:!0})}))]}))})),du=[Oi({maxProfile:mi().optional().default(1),src:Qi.enum([e.OpenProfilePickerType.TOOL_DEL_FRIEND]).optional(),uids:Ai(hi()).optional()}).superRefine((function(t,n){var r=t.src,i=t.maxProfile;r===e.OpenProfilePickerType.TOOL_DEL_FRIEND?i<1&&n.addIssue({code:"custom",path:["maxProfile"],message:"maxProfile must be at least 1 when src is 'tool_del_friend'"}):(i<1||i>10)&&n.addIssue({code:"custom",path:["maxProfile"],message:"maxProfile must be between 1 and 10"})}))];function pu(e){return fu.apply(this,arguments)}function fu(){return fu=Ne((function(e){return Le(this,(function(t){return[2,zn("openProfilePicker",du,[e],function(){var e=Ne((function(e){var t,n,r,i,o,a,s,u,c,l,p,f;return Le(this,(function(h){switch(h.label){case 0:return Ge.isMp?[4,lu(null==e?void 0:e.maxProfile,null==e?void 0:e.src,null==e?void 0:e.uids)]:[3,12];case 1:return t=h.sent(),n=function(e,t){return Array.from({length:Math.ceil(e.length/t)},(function(n,r){return e.slice(r*t,r*t+t)}))},t.length>0?[4,Sn.getAccessToken()]:[3,11];case 2:r=h.sent(),i=n(t,20),o=[],a=!0,s=!1,u=void 0,h.label=3;case 3:h.trys.push([3,8,9,10]),c=function(){var e,t,n,i,a,s,u;return Le(this,(function(c){switch(c.label){case 0:e=p.value,c.label=1;case 1:return c.trys.push([1,4,,5]),[4,fetch(d.GET_LIST_USER_INFO,{method:"POST",headers:{"Content-Type":"application/json",access_token:r||""},body:JSON.stringify({fields:"id,name,picture",user_ids:e})})];case 2:return[4,c.sent().json()];case 3:if(0!==(t=c.sent()).error||!t.data)throw new Error(t.message);return i=e.map((function(e){var n,r,i,o,a,s,u,c,l,d,p;return{id:(null===(n=t.data[e])||void 0===n||null===(r=n.user_info)||void 0===r?void 0:r.user_id_by_app)||"",profile:{name:null===(i=t.data[e])||void 0===i||null===(o=i.user_info)||void 0===o?void 0:o.name,avatar:null===(a=t.data[e])||void 0===a||null===(s=a.user_info)||void 0===s||null===(u=s.picture)||void 0===u||null===(c=u.data)||void 0===c?void 0:c.url},code:0!==(null===(l=t.data[e])||void 0===l?void 0:l.error)?-1:0,message:"Get profile: ".concat(Nt.isUndefined(null===(d=t.data[e])||void 0===d?void 0:d.message)?"Unknown error":null===(p=t.data[e])||void 0===p?void 0:p.message)}})),(n=o).push.apply(n,De(i)),[3,5];case 4:return a=c.sent(),u=e.map((function(e){return{id:e,profile:{name:"",avatar:""},code:-1,message:"Can't get profile: ".concat(a.message)}})),(s=o).push.apply(s,De(u)),[3,5];case 5:return[2]}}))},l=i[Symbol.iterator](),h.label=4;case 4:return(a=(p=l.next()).done)?[3,7]:[5,Ue(c())];case 5:h.sent(),h.label=6;case 6:return a=!0,[3,4];case 7:return[3,10];case 8:return f=h.sent(),s=!0,u=f,[3,10];case 9:try{a||null==l.return||l.return()}finally{if(s)throw u}return[7];case 10:return[2,{users:o}];case 11:return[2,{users:[]}];case 12:return Ge.isMpWeb?[2,Promise.resolve({users:[]})]:[2,Promise.reject(He("openProfilePicker",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),fu.apply(this,arguments)}var hu=function(){var e=Ne((function(e,t,n){var r;return Le(this,(function(i){return r=t&&Nt.isString(t)&&t.length>0?"wpa_wpa2":"open",[2,new Promise((function(i,o){bn("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)}}(),mu=[Oi({SSID:hi(),password:hi().optional(),hiddenSSID:gi().optional()})];function vu(e){return yu.apply(this,arguments)}function yu(){return yu=Ne((function(e){return Le(this,(function(t){return[2,zn("connectWifi",mu,[e],function(){var e=Ne((function(e){return Le(this,(function(t){switch(t.label){case 0:return Ge.isMp?[4,hu(e.SSID,e.password,e.hiddenSSID)]:[3,2];case 1:return[2,t.sent()];case 2:return Ge.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(He("connectWifi",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),yu.apply(this,arguments)}var gu=function(){var t=Ne((function(t,n,r,i,o,a,s){var u,c;return Le(this,(function(l){return u=n&&n.length>0?{type:0,url:n,max_size:r||1048576}:null,c={enable:1,aspect_ratio:"1:1"},[2,new Promise((function(n,r){bn("PICK_MEDIA",{featureFlag:1,media_type:e.MediaPickerType[t],edit_view:Je({},c,i),silent_request:o,upload:u,max_select_items:a,compressLevel:null!=s?s:2},{success:function(e){n(null!==u?null==e?void 0:e.result_content:null==e?void 0:e.path)},fail:function(e){r(e)}},{isMultiCallback:!0})}))]}))}));return function(e,n,r,i,o,a,s){return t.apply(this,arguments)}}(),_u=[Oi({type:Qi.enum(["video","photo","file","zcamera","zcamera_photo","zcamera_video","zcamera_scan"]),serverUploadUrl:hi().url().optional(),maxItemSize:mi().min(0).optional(),editView:Oi({enable:gi().optional(),aspectRatio:hi().regex(/^\d+:\d+$/).optional()}).optional(),silentRequest:gi().optional(),maxSelectItem:mi().min(1).optional(),compressLevel:mi().min(0).max(3).optional().default(2)})];function wu(e){return Tu.apply(this,arguments)}function Tu(){return Tu=Ne((function(e){return Le(this,(function(t){return[2,zn("openMediaPicker",_u,[e],function(){var e=Ne((function(e){var t,n,r,i,o,a,s;return Le(this,(function(u){switch(u.label){case 0:return Ge.isMp?(i={},Nt.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,s=e.compressLevel||2,[4,gu(e.type,e.serverUploadUrl,e.maxItemSize,i,o,a,s)]):[3,2];case 1:return[2,{data:u.sent()}];case 2:return Ge.isMpWeb?[2,Promise.resolve({data:""})]:[2,Promise.reject(He("openMediaPicker",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Tu.apply(this,arguments)}var bu=[Oi({title:hi().max(100),description:hi().max(400).default(""),thumbnail:hi().url().optional(),path:hi().optional()})];function Eu(e){return Pu.apply(this,arguments)}function Pu(){return Pu=Ne((function(e){return Le(this,(function(t){return[2,zn("getShareableLink",bu,[e],function(){var e=Ne((function(e){var t;return Le(this,(function(n){switch(n.label){case 0:return[4,Sn.getAccessToken()];case 1:return t=n.sent(),[4,Ba(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)}}())]}))})),Pu.apply(this,arguments)}var Su=function(){var e=Ne((function(e){return Le(this,(function(t){return[2,new Promise((function(t,n){bn("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 Iu(e){return Au.apply(this,arguments)}function Au(){return(Au=Ne((function(e){return Le(this,(function(t){return[2,zn("closeLoading",[],[e],Ne((function(){return Le(this,(function(e){switch(e.label){case 0:return Ge.isMp?[4,Su("user action")]:[3,2];case 1:return[2,e.sent()];case 2:return Ge.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(He("closeLoading",{}))]}}))})))]}))}))).apply(this,arguments)}function Ou(e){return ku.apply(this,arguments)}function ku(){return ku=Ne((function(e){return Le(this,(function(t){return[2,zn("requestUpdateZalo",[],[e],Ne((function(){var e,t,n;return Le(this,(function(r){switch(r.label){case 0:return Ge.isMp?(n=(null===(e=Fe())||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,qa(n)]):[3,2];case 1:return[2,r.sent()];case 2:return Ge.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(He("requestUpdateZalo",{}))]}}))})))]}))})),ku.apply(this,arguments)}var Cu=Kt.getInstance();Cu.addListener=function(t,n,r){var i=t;return Cu.addListener(e.Events[i],n,r)};var Nu=[Qi.function()];function Mu(t){return zn("onConfirmToExit",Nu,[t],(function(t){var n=t;Ge.isMp&&(Cu.on(e.Events.AppClose,n,'{"handle_h5": 1}'),$i.setNavigationBarLeftButton(void 0,2))}))}function Ru(){return zn("offConfirmToExit",[],[],(function(){Ge.isMp&&(Cu.off(e.Events.AppClose),$i.setNavigationBarLeftButton(void 0,0))}))}function xu(){return zn("getDeviceId",[],[],(function(){return Ge.isMp&&Sn.getSync(l.DEVICE_ID)||""}))}function Du(e){return Lu.apply(this,arguments)}function Lu(){return(Lu=Ne((function(e){return Le(this,(function(t){return[2,zn("getDeviceIdAsync",[],[e],Ne((function(){return Le(this,(function(e){switch(e.label){case 0:return Ge.isMp?[4,Sn.jumpAndGetToken(l.DEVICE_ID)]:[3,2];case 1:return[2,e.sent()||""];case 2:return[2,Promise.resolve("")]}}))})))]}))}))).apply(this,arguments)}function Uu(){return zn("getContext",[],[],(function(){if(Ge.isMp){var e=Sn.getSync(l.CONTEXT_ID)||"";return{type:Sn.getSync(l.CONTEXT_TYPE)||"",id:e}}return{type:"",id:""}}))}function ju(e){return Bu.apply(this,arguments)}function Bu(){return(Bu=Ne((function(e){return Le(this,(function(t){return[2,zn("getContextAsync",[],[e],Ne((function(){var e;return Le(this,(function(t){switch(t.label){case 0:return Ge.isMp?[4,Sn.jumpAndGetToken(l.CONTEXT_ID)]:[3,3];case 1:return e=t.sent()||"",[4,Sn.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 Zu(e){return zu.apply(this,arguments)}function zu(){return(zu=Ne((function(e){return Le(this,(function(t){return[2,zn("getAuthCode",[],[e],Ne((function(){var e,t;return Le(this,(function(n){switch(n.label){case 0:return Ge.isMp?[4,Sn.jumpAndGetToken(l.ZOAUTH,!0)]:[3,4];case 1:return e=n.sent()||"",[4,Sn.jumpAndGetToken(l.ZOAUTH_VRF)];case 2:return t=n.sent()||"",[4,Sn.verifyUserAuthorized()];case 3:if(n.sent())return[2,{authCode:e,authCodeVerify:t}];throw an([{action:"getAuthCode",error:-104,message:"no user auth",data:{}}]),wn.error.loginFailed("User Authentication Required");case 4:return[2,Promise.resolve({authCode:"",authCodeVerify:""})]}}))})))]}))}))).apply(this,arguments)}function Wu(e){return Fu.apply(this,arguments)}function Fu(){return(Fu=Ne((function(e){return Le(this,(function(t){return[2,zn("getZPIToken",[],[e],Ne((function(){var e,t,n,r;return Le(this,(function(i){switch(i.label){case 0:return Ge.isMp?[4,Sn.jumpAndGetToken(l.UTOKEN_ZPI)]:[3,5];case 1:return e=i.sent()||"",[4,Sn.jumpAndGetToken(l.GTOKEN_ZPI)];case 2:return t=i.sent()||"",[4,Sn.jumpAndGetToken(l.ZPP_ZPI)];case 3:return n=i.sent()||"",[4,Sn.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 Gu=[hi()];function Vu(e){return zn("setAccessToken",Gu,[e],(function(e){var t=e;Sn.setAccessToken(t)}))}var Hu=[Oi({url:hi().url()})];function Ku(e){return Ju.apply(this,arguments)}function Ju(){return Ju=Ne((function(e){return Le(this,(function(t){return[2,zn("openOutApp",Hu,[e],function(){var e=Ne((function(e){return Le(this,(function(t){switch(t.label){case 0:return Ge.isMp?[4,qa(e.url)]:[3,2];case 1:return[2,t.sent()];case 2:return Ge.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(He("openOutApp",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Ju.apply(this,arguments)}var qu=[Oi({count:mi().min(1).optional().default(1),sourceType:Qi.array(Qi.enum(["album","camera"])).max(2).default(["album","camera"]).optional(),cameraType:Qi.enum(["back","front"]).default("front").optional()})];function Qu(e){return Yu.apply(this,arguments)}function Yu(){return Yu=Ne((function(e){return Le(this,(function(t){return[2,zn("chooseImage",qu,[e],function(){var e=Ne((function(e){var t,n,r,i;return Le(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)}}())]}))})),Yu.apply(this,arguments)}var $u=Ne((function(){var e,t,n=arguments;return Le(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){bn("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(wn.error.clientNotSupport())},fail:function(e){r(e)}},{isMultiCallback:!0,timeout:!1})}))]}))}));function Xu(e){return ec.apply(this,arguments)}function ec(){return(ec=Ne((function(e){return Le(this,(function(t){return[2,zn("getLocation",[],[e],Ne((function(){return Le(this,(function(e){switch(e.label){case 0:return Ge.isMp?[4,$u()]:[3,2];case 1:return[2,e.sent()];case 2:return Ge.isMpWeb?[2,Promise.resolve({token:""})]:[2,Promise.reject(He("getLocation",{}))]}}))})))]}))}))).apply(this,arguments)}var tc=[Qi.function().args(Oi({data:Qi.any()})).returns(Qi.void())];function nc(t){return zn("onCallbackData",tc,[t],(function(){!function(t){Kt.getInstance().on(e.Events.OnDataCallback,(function(e){t({data:e})}))}(t)}))}var rc=function(){var e=Ne((function(e){var t,n,r,i,o,a,s,u,c,l,d,p;return Le(this,(function(f){switch(f.label){case 0:return e||(e=Xs()),"object"==typeof e&&((r=e.zmpOrderId||e.orderId)||(n=e.appTransID||e.apptransid||e.transId)),"string"==typeof e&&(i=Qt.getParameterByName("orderId",e),o=Qt.getParameterByName("appTransID",e)||Qt.getParameterByName("apptransid",e),n=i||o),a={headers:{authorization:"Bearer "}},[4,Sn.jumpAndGetToken()];case 1:return f.sent(),s=null===(t=Sn.miniProgramConfig)||void 0===t?void 0:t.jwt,a.headers.authorization="Bearer ".concat(s),u=new URL(J),c={orderId:r||"",transId:n||""},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 wn.error.badRequest(l.msg);return d=l.data||{},p={err:l.err,msg:l.msg},0!==Object.keys(d).length&&d.constructor===Object&&Object.assign(p,Je({msg:d.resultMessage},d)),[2,p]}}))}));return function(t){return e.apply(this,arguments)}}(),ic=function(){var t=Ne((function(t,n,r,i,a,s,u){var c,l,d,p,f,h,m,v,y,g,_,w,T,b,E,P,S,I,A,O,k;return Le(this,(function(C){switch(C.label){case 0:c=o,(l=new URLSearchParams).append("amount",t.toString()),l.append("item",encodeURIComponent(JSON.stringify(n))),l.append("mac",i),r&&l.append("desc",encodeURIComponent(r)),a&&(d=a,"object"==typeof a&&(d=JSON.stringify(a)),l.append("extradata",encodeURIComponent(d))),s&&(p=s,"object"==typeof s&&(p=JSON.stringify(s)),l.append("payload",encodeURIComponent(p))),u&&("string"==typeof u?(l.append("method",u),l.append("isCustom","false")):"object"==typeof u&&(l.append("method",u.id),l.append("isCustom",JSON.stringify(u.isCustom)))),f={headers:{"Content-Type":"application/x-www-form-urlencoded",authorization:"Bearer "}},C.label=1;case 1:return C.trys.push([1,6,,7]),[4,Sn.jumpAndGetToken()];case 2:return C.sent(),m=null===(h=Sn.miniProgramConfig)||void 0===h?void 0:h.jwt,f.headers.authorization="Bearer ".concat(m),[4,fetch(H,Ia(Je({method:"POST"},f),{body:l}))];case 3:return[4,C.sent().json()];case 4:if(!(v=C.sent()).data||0!==v.err)throw wn.error.badRequest(v.msg);return y=v.data.id,g=v.data.jwt,_=v.data.messageToken||"",w=window.APP_VERSION,T=window.APP_ENV,b={miniAppId:c,orderId:y},E=v.data.method,P=v.data.isCustom,g&&(b.token=g),w&&(b.version=w),T&&(b.env=T),E&&(b.method=E),P&&(b.isCustom=P),S=Qt.encode(b),I=new URL("?".concat(S),"https://payment-mini.zalo.me").toString(),A=dn(),O=un()&&A<742?"normal":"bottomSheet",Ft.enablePaymentDone=Kt.getInstance().eventNames().includes(e.Events.PaymentDone),[4,qs(I,{style:O}).then((function(){var t=!1;Kt.getInstance().once(e.Events.WebviewClosed,(function(){setTimeout(Ne((function(){var n;return Le(this,(function(r){switch(r.label){case 0:return t?[3,2]:(Kt.getInstance().emit(e.Events.PaymentDone,y,{orderId:y}),[4,rc({zmpOrderId:y})]);case 1:(n=r.sent()).err>=0&&!n.isCustom&&Kt.getInstance().emit(e.Events.PaymentClose,n.err,Ia(Je({},n),{zmpOrderId:y})),r.label=2;case 2:return[2]}}))})),500)})),Kt.getInstance().once(e.Events.OpenApp,(function(){t=!0})),Kt.getInstance().once(e.Events.PaymentDone,(function(){t=!0,Ft.enablePaymentDone=!1}))}))];case 5:return C.sent(),[2,{orderId:y,messageToken:_}];case 6:throw k=C.sent(),console.log("Internal error"),k;case 7:return[2]}}))}));return function(e,n,r,i,o,a,s){return t.apply(this,arguments)}}(),oc=[Oi({amount:Qi.union([hi(),mi()]),item:Qi.array(Qi.record(hi(),Qi.any())),desc:Qi.string(),mac:Qi.string(),extradata:Qi.any().optional(),payload:Qi.any().optional(),method:Qi.union([Qi.string(),Qi.object({id:Qi.string(),isCustom:Qi.boolean()})]).optional()})];function ac(e){return sc.apply(this,arguments)}function sc(){return sc=Ne((function(e){return Le(this,(function(t){return[2,zn("createOrder",oc,[e],function(){var e=Ne((function(e){return Le(this,(function(t){switch(t.label){case 0:return Ge.isMp?[4,ic(e.amount,e.item,e.desc,e.mac,e.extradata,e.payload,e.method)]:[3,2];case 1:return[2,t.sent()];case 2:return Ge.isMpWeb?[2,Promise.resolve({orderId:"",messageToken:""})]:[2,Promise.reject(He("createOrder",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),sc.apply(this,arguments)}var uc=Ne((function(){return Le(this,(function(e){return[2,new Promise((function(e,t){bn("MP_CONFIRM_REQUEST_PAYMENT",{},{success:function(){e()},fail:function(e){t(e)}},{})}))]}))})),cc=function(){var e=Ne((function(e,t,n,r,i){var o,a,s,u,c,l,d,p,f,h,m;return Le(this,(function(v){switch(v.label){case 0:(o=new URLSearchParams).append("amount",e.toString()),t&&o.append("desc",encodeURIComponent(t)),n&&o.append("method",n),r&&o.append("transId",r),i&&o.append("mac",i),a={headers:{"Content-Type":"application/x-www-form-urlencoded",authorization:"Bearer "}},v.label=1;case 1:return v.trys.push([1,9,,10]),[4,Sn.jumpAndGetToken()];case 2:if(v.sent(),c=null===(s=Sn.miniProgramConfig)||void 0===s?void 0:s.jwt,a.headers.authorization="Bearer ".concat(c),!(null===(u=Sn.miniProgramConfig)||void 0===u?void 0:u.showConfirmToPayment))return[3,6];v.label=3;case 3:return v.trys.push([3,5,,6]),[4,uc()];case 4:return v.sent(),[3,6];case 5:throw l=v.sent(),console.error("Failed:",l),l;case 6:return[4,fetch(q,Ia(Je({method:"POST"},a),{body:o}))];case 7:return[4,v.sent().json()];case 8:if(!(d=v.sent()).data||0!==d.err)throw wn.error.badRequest(d.msg);return p=d.data.id,f=d.data.messageToken||"",h=d.data.transId||"",[2,{orderId:p,messageToken:f,transId:h}];case 9:throw m=v.sent(),console.log("Internal error"),m;case 10:return[2]}}))}));return function(t,n,r,i,o){return e.apply(this,arguments)}}(),lc=[Oi({amount:Qi.union([Qi.string(),Qi.number()]),desc:Qi.string(),method:Qi.string(),transId:Qi.string().optional(),mac:Qi.string().optional()})];function dc(e){return pc.apply(this,arguments)}function pc(){return pc=Ne((function(e){return Le(this,(function(t){return[2,zn("purchase",lc,[e],function(){var e=Ne((function(e){return Le(this,(function(t){switch(t.label){case 0:return Ge.isMp?[4,cc(e.amount,e.desc,e.method,null==e?void 0:e.transId,null==e?void 0:e.mac)]:[3,2];case 1:return[2,t.sent()];case 2:return Ge.isMpWeb?[2,Promise.resolve({orderId:"",messageToken:"",transId:""})]:[2,Promise.reject(He("purchase",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),pc.apply(this,arguments)}var fc=function(){var e=Ne((function(e,t){return Le(this,(function(n){return[2,new Promise((function(n,r){var i=e&&(null==e?void 0:e.length)>0;bn("MP_SELECT_PAYMENT_METHOD",{isBinding:i,channels:e,selectedMethod:t,forceUpdate:!0},{success:function(e){console.log(e),n(e)},fail:function(e){r(e)}},{})}))]}))}));return function(t,n){return e.apply(this,arguments)}}(),hc=[Oi({channels:Ai(Oi({method:hi(),subMethod:hi().optional(),subInfo:hi().optional()})).optional(),selectedMethod:Oi({method:hi(),subMethod:hi().optional()}).optional()}).optional()];function mc(e){return vc.apply(this,arguments)}function vc(){return vc=Ne((function(e){return Le(this,(function(t){return[2,zn("selectPaymentMethod",hc,[e],function(){var e=Ne((function(e){var t,n;return Le(this,(function(r){switch(r.label){case 0:return Ge.isMp?(t=e.channels,n=e.selectedMethod,[4,fc(t,n)]):[3,2];case 1:return[2,r.sent()];case 2:return Ge.isMpWeb?[2,Promise.resolve({method:""})]:[2,Promise.reject(He("selectPaymentMethod",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),vc.apply(this,arguments)}var yc=[Oi({data:Qi.union([hi(),Qi.record(hi(),hi().nullish())])})];function gc(e){return _c.apply(this,arguments)}function _c(){return _c=Ne((function(e){return Le(this,(function(t){return[2,zn("checkTransaction",yc,[e],function(){var e=Ne((function(e){return Le(this,(function(t){switch(t.label){case 0:return Ge.isMp?[4,rc(e.data)]:[3,2];case 1:return[2,t.sent()];case 2:return Ge.isMpWeb?[2,Promise.resolve({msg:"Success",orderId:"",resultCode:1,transTime:(new Date).getTime().toString(),createdAt:(new Date).getTime().toString(),transId:""})]:[2,Promise.reject(He("checkTransaction",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),_c.apply(this,arguments)}var wc=function(){var t=Ne((function(t,n,r,i,a,s){var u,c,l,d,p,f,h,m,v,y,g,_,w,T,b;return Le(this,(function(E){switch(E.label){case 0:p=o,(f=new URLSearchParams).append("payType",n||e.IAPPayType.SUBSCRIPTION),h=e.ProrationMode.UNKNOW,r===Y&&(h=e.ProrationMode.IMMEDIATE_AND_CHARGE_FULL_PRICE),r===Q&&(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=Fe())||void 0===u||null===(c=u.platform)||void 0===c?void 0:c.isIOS)?m="ios":(null===(l=Fe())||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 "}},E.label=1;case 1:return E.trys.push([1,5,,6]),[4,Sn.jumpAndGetToken()];case 2:return E.sent(),g=null===(y=Sn.miniProgramConfig)||void 0===y?void 0:y.jwt,v.headers.authorization="Bearer ".concat(g),[4,fetch(K,Ia(Je({method:"POST"},v),{body:f}))];case 3:return[4,E.sent().json()];case 4:if(!(_=E.sent()).data||!_.data.store||0!==_.err)throw wn.error.createIAPOrderFailed(_.err);return w=_.data.store,T=_.data.orderId,[2,new Promise((function(e,t){bn("IAP_REQUESTPAYMENT",Je({},w),{success:function(){e({orderId:T})},fail:function(e){t(e)}})}))];case 5:throw b=E.sent(),console.log("Internal error"),b;case 6:return[2]}}))}));return function(e,n,r,i,o,a){return t.apply(this,arguments)}}(),Tc=[Oi({productId:hi(),payType:Qi.enum(["ONETIME","SUBSCRIPTION"]).optional(),prorationMode:Qi.enum(["DEFERRED","IMMEDIATE_AND_CHARGE_FULL_PRICE"]).default("DEFERRED").optional(),utm:hi().optional(),method:Qi.enum(["IAP","IAP_SANDBOX"]).optional(),merchantTransId:hi().optional()})];function bc(e){return Ec.apply(this,arguments)}function Ec(){return Ec=Ne((function(e){return Le(this,(function(t){return[2,zn("createOrderIAP",Tc,[e],function(){var e=Ne((function(e){return Le(this,(function(t){switch(t.label){case 0:return Ge.isMp?[4,wc(e.productId,e.payType,e.prorationMode,e.method,e.utm,e.merchantTransId)]:[3,2];case 1:return[2,t.sent()];case 2:return Ge.isMpWeb?[2,Promise.resolve({orderId:""})]:[2,Promise.reject(He("createOrderIAP",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Ec.apply(this,arguments)}var Pc=[Oi({hide:gi().default(!1).optional()}).optional()];function Sc(e){return Ic.apply(this,arguments)}function Ic(){return Ic=Ne((function(e){return Le(this,(function(t){return[2,zn("setAndroidBottomNavigationBar",Pc,[e],function(){var e=Ne((function(e){return Le(this,(function(t){switch(t.label){case 0:return Ge.isMp?[4,$i.setAndroidBottomNavigationBar(e.hide)]:[3,2];case 1:return[2,t.sent()];case 2:return Ge.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(He("setAndroidBottomNavigationBar",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Ic.apply(this,arguments)}var Ac=[Oi({hide:gi().default(!1).optional()}).optional()];function Oc(e){return kc.apply(this,arguments)}function kc(){return kc=Ne((function(e){return Le(this,(function(t){return[2,zn("setIOSBottomSafeArea",Ac,[e],function(){var e=Ne((function(e){return Le(this,(function(t){switch(t.label){case 0:return Ge.isMp?[4,$i.setIOSBottomSafeArea(e.hide)]:[3,2];case 1:return[2,t.sent()];case 2:return Ge.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(He("setIOSBottomSafeArea",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),kc.apply(this,arguments)}var Cc=[Oi({type:Qi.enum(["normal","hidden","transparent"]).default("normal").optional(),color:Qi.string().optional()}).optional()];function Nc(e){return Mc.apply(this,arguments)}function Mc(){return Mc=Ne((function(e){return Le(this,(function(t){return[2,zn("setStatusBar",Cc,[e],function(){var e=Ne((function(e){return Le(this,(function(t){switch(t.label){case 0:return Ge.isMp?[4,$i.configHeader({statusBarType:e.type,headerColor:e.color})]:[3,2];case 1:return[2,t.sent()];case 2:return Ge.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(He("setStatusBar",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Mc.apply(this,arguments)}var Rc=[Oi({headerTextColor:Qi.enum(["black","white"]).optional(),headerColor:Qi.string().optional(),actionBar:Oi({hide:Qi.boolean().optional(),title:Qi.string().optional(),leftButton:Qi.enum(["back","none"]).optional(),textAlign:Qi.enum(["left","center"]).default("left").optional()}).optional(),statusBarType:Qi.enum(["normal","hidden","transparent"]).optional(),hideAndroidBottomNavigationBar:Qi.boolean().optional(),hideIOSSafeAreaBottom:Qi.boolean().optional()})];function xc(e){return Dc.apply(this,arguments)}function Dc(){return Dc=Ne((function(e){return Le(this,(function(t){return[2,zn("configAppView",Rc,[e],function(){var e=Ne((function(e){var t,n,r,i,o,a,s;return Le(this,(function(u){switch(u.label){case 0:return Ge.isMp?Nt.isUndefined(null===(t=e.actionBar)||void 0===t?void 0:t.leftButton)?[3,2]:[4,$i.setNavigationBarLeftButton(null===(a=e.actionBar)||void 0===a?void 0:a.leftButton)]:[3,13];case 1:u.sent(),u.label=2;case 2:return Nt.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,$i.setNavigationBarTitle(null===(s=e.actionBar)||void 0===s?void 0:s.title)];case 3:u.sent(),u.label=4;case 4:return[4,$i.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,$i.setAndroidBottomNavigationBar(e.hideAndroidBottomNavigationBar)];case 7:u.sent(),u.label=8;case 8:return"boolean"!=typeof e.hideIOSSafeAreaBottom?[3,10]:[4,$i.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 Ge.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(He("configAppView",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Dc.apply(this,arguments)}var Lc=Ne((function(){return Le(this,(function(e){return[2,new Promise((function(e,t){bn("MA_MENU_MINIMIZE",{},{success:function(t){e(t)},fail:function(e){t(e)}},{})}))]}))}));function Uc(e){return jc.apply(this,arguments)}function jc(){return(jc=Ne((function(e){return Le(this,(function(t){return[2,zn("minimizeApp",[],[e],Ne((function(){return Le(this,(function(e){switch(e.label){case 0:return Ge.isMp?[4,Lc()]:[3,2];case 1:return[2,e.sent()];case 2:return Ge.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(He("minimizeApp",{}))]}}))})))]}))}))).apply(this,arguments)}var Bc=Ne((function(){return Le(this,(function(e){return[2,new Promise((function(e,t){bn("MA_MENU_PERMISSION",{},{success:function(t){e(t)},fail:function(e){t(e)}},{}),e()}))]}))}));function Zc(e){return zc.apply(this,arguments)}function zc(){return(zc=Ne((function(e){return Le(this,(function(t){return[2,zn("openPermissionSetting",[],[e],Ne((function(){return Le(this,(function(e){switch(e.label){case 0:return Ge.isMp?[4,Bc()]:[3,2];case 1:return[2,e.sent()];case 2:return Ge.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(He("openPermissionSetting",{}))]}}))})))]}))}))).apply(this,arguments)}var Wc=Ne((function(){return Le(this,(function(e){return[2,new Promise((function(e,t){bn("MP_ADD_MYFAVORITES",{timestamp:(new Date).getTime()},{success:function(t){e(t)},fail:function(e){t(e)}},{})}))]}))}));function Fc(e){return Gc.apply(this,arguments)}function Gc(){return(Gc=Ne((function(e){return Le(this,(function(t){return[2,zn("favoriteApp",[],[e],Ne((function(){return Le(this,(function(e){switch(e.label){case 0:return Ge.isMp?[4,Wc()]:[3,2];case 1:return[2,e.sent()];case 2:return Ge.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(He("favoriteApp",{}))]}}))})))]}))}))).apply(this,arguments)}var Vc=Ne((function(){return Le(this,(function(e){return[2,new Promise((function(e,t){bn("OPEN_GROUPLIST",{},{success:function(t){e(t)},fail:function(e){t(e)}},{})}))]}))}));function Hc(e){return Kc.apply(this,arguments)}function Kc(){return(Kc=Ne((function(e){return Le(this,(function(t){return[2,zn("openGroupList",[],[e],Ne((function(){return Le(this,(function(e){switch(e.label){case 0:return Ge.isMp?[4,Vc()]:[3,2];case 1:return[2,e.sent()];case 2:return Ge.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(He("openGroupList",{}))]}}))})))]}))}))).apply(this,arguments)}var Jc=Ne((function(){var e;return Le(this,(function(t){switch(t.label){case 0:return[4,Sn.getAccessToken()];case 1:return e=t.sent(),[2,new Promise((function(t,n){bn("MP_SEND_NOTIFICATION",{accessToken:e},{success:function(e){t(e)},fail:function(e){n(e)}},{delay:500})}))]}}))}));function qc(e){return Qc.apply(this,arguments)}function Qc(){return(Qc=Ne((function(e){return Le(this,(function(t){return[2,zn("requestSendNotification",[],[e],Ne((function(){return Le(this,(function(e){switch(e.label){case 0:return Ge.isMp?[4,Jc()]:[3,2];case 1:return[2,e.sent()];case 2:return Ge.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(He("requestSendNotification",{}))]}}))})))]}))}))).apply(this,arguments)}var Yc=Ne((function(){return Le(this,(function(e){return[2,new Promise((function(e,t){bn("MP_ADD_RATING",{},{success:function(t){e(t)},fail:function(e){t(e)}},{})}))]}))}));function $c(e){return Xc.apply(this,arguments)}function Xc(){return(Xc=Ne((function(e){return Le(this,(function(t){return[2,zn("addRating",[],[e],Ne((function(){return Le(this,(function(e){switch(e.label){case 0:return Ge.isMp?[4,Yc()]:[3,2];case 1:return[2,e.sent()];case 2:return Ge.isMpWeb?[2,Promise.resolve({})]:[2,Promise.reject(He("addRating",{}))]}}))})))]}))}))).apply(this,arguments)}var el,tl=(el=Ne((function(e,t,n){var r,i;return Le(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,Je({method:"POST",body:r},i))];case 1:return[4,o.sent().json()];case 2:return[2,o.sent()]}}))})),function(e,t,n){return el.apply(this,arguments)}),nl=function(){var e=Ne((function(e){return Le(this,(function(t){return[2,new Promise((function(t,n){bn("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)}}(),rl=[Oi({oaId:hi()})];function il(e){return ol.apply(this,arguments)}function ol(){return ol=Ne((function(e){return Le(this,(function(t){return[2,zn("interactOA",rl,[e],function(){var e=Ne((function(e){var t,n,r;return Le(this,(function(i){switch(i.label){case 0:return Ge.isMp?(t=e.oaId,[4,Sn.getAccessToken()]):[3,5];case 1:return!(n=i.sent())||Nt.isEmpty(n)?[3,3]:[4,tl(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,nl(t)];case 4:return[2,i.sent()];case 5:return Ge.isMpWeb?[2,Promise.resolve({})]:[2,Promise.reject(He("interactOA",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),ol.apply(this,arguments)}var al=[Oi({oaId:hi()})];function sl(e){return ul.apply(this,arguments)}function ul(){return ul=Ne((function(e){return Le(this,(function(t){return[2,zn("isAllowedInteractWithOA",al,[e],function(){var e=Ne((function(e){var t,n,r;return Le(this,(function(i){switch(i.label){case 0:return Ge.isMp?(t=e.oaId,[4,Sn.getAccessToken()]):[3,4];case 1:return!(n=i.sent())||Nt.isEmpty(n)?[3,3]:[4,tl(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 Ge.isMpWeb?[2,Promise.resolve({status:!1})]:[2,Promise.reject(He("IsAllowedInteractWithOA",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),ul.apply(this,arguments)}function cl(e){return ll.apply(this,arguments)}function ll(){return(ll=Ne((function(e){return Le(this,(function(t){return[2,zn("getSetting",[],[e],Ne((function(){return Le(this,(function(e){switch(e.label){case 0:return Ge.isMp?[4,gn()]:[3,2];case 1:return[2,e.sent()];case 2:return Ge.isMpWeb?[2,Promise.resolve({authSetting:{}})]:[2,Promise.reject(He("getSetting",{}))]}}))})))]}))}))).apply(this,arguments)}var dl=Qi.enum(["scope.userInfo","scope.userLocation","scope.userPhonenumber"]),pl=[Oi({scopes:Qi.array(dl).max(2).optional()}).optional()];function fl(e){return hl.apply(this,arguments)}function hl(){return hl=Ne((function(e){return Le(this,(function(t){return[2,zn("authorize",pl,[e],function(){var e=Ne((function(e){var t;return Le(this,(function(n){switch(n.label){case 0:return Ge.isMp?(t=null==e?void 0:e.scopes,pn(724,573)?[4,En(null!=t?t:void 0)]:[3,2]):[3,3];case 1:return[2,n.sent()];case 2:return[2,Promise.reject(wn.error.clientNotSupport())];case 3:return Ge.isMpWeb?[2,Promise.resolve({})]:[2,Promise.reject(He("authorize",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),hl.apply(this,arguments)}var ml=Ne((function(){return Le(this,(function(e){return[2,new Promise(function(){var e=Ne((function(e,t){var n;return Le(this,(function(r){switch(r.label){case 0:return Nt.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(wn.error.clientNotSupport()),[2]}}))}));return function(t,n){return e.apply(this,arguments)}}())]}))}));function vl(e){return zn("checkZaloCameraPermission",[],[e],Ne((function(){return Le(this,(function(e){switch(e.label){case 0:return[4,ml()];case 1:return[2,e.sent()]}}))})))}var yl=Ne((function(){return Le(this,(function(e){return[2,new Promise(function(){var e=Ne((function(e,t){var n,r,i;return Le(this,(function(o){switch(o.label){case 0:return o.trys.push([0,2,,3]),[4,Sn.jumpAndGetToken()];case 1:return o.sent(),r=null===(n=Sn.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 gl(e){return _l.apply(this,arguments)}function _l(){return(_l=Ne((function(e){return Le(this,(function(t){return[2,zn("getUserID",[],[e],Ne((function(){return Le(this,(function(e){switch(e.label){case 0:return Ge.isMp?[4,yl()]:[3,2];case 1:return[2,e.sent()];case 2:return Ge.isMpWeb?[2,Promise.resolve(void 0)]:[2,Promise.reject(He("getUserID",{}))]}}))})))]}))}))).apply(this,arguments)}var wl=Ne((function(){return Le(this,(function(e){return[2,new Promise(function(){var e=Ne((function(e,t){var n,r,i;return Le(this,(function(o){switch(o.label){case 0:return o.trys.push([0,2,,3]),[4,Sn.jumpAndGetToken()];case 1:return o.sent(),r=null===(n=Sn.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 Tl(e){return bl.apply(this,arguments)}function bl(){return(bl=Ne((function(e){return Le(this,(function(t){return[2,zn("getIDToken",[],[e],Ne((function(){return Le(this,(function(e){switch(e.label){case 0:return Ge.isMp?[4,wl()]:[3,2];case 1:return[2,e.sent()];case 2:return Ge.isMpWeb?[2,Promise.resolve(void 0)]:[2,Promise.reject(He("getIDToken",{}))]}}))})))]}))}))).apply(this,arguments)}var El={format:e.PhotoFormat.JPEG,quality:e.PhotoQuality.NORMAL,mirrored:!1,useVideoSourceSize:!1},Pl={width:1024,height:768,facingMode:e.FacingMode.FRONT,mirrored:!1,audio:!1,video:!0},Sl=function(){function t(n){var r,i,o,a,s,u=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,c=this;Mt(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};Kt.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:Pl.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:Pl.mirrored,this._userRequestFrameCallback=!1,this._audioEnabled=null!==(a=null==u?void 0:u.audio)&&void 0!==a?a:Pl.audio,this._videoEnabled=null!==(s=null==u?void 0:u.video)&&void 0!==s?s:Pl.video}var n=t.prototype;return n.on=function(t,n){Kt.getInstance().on(t,(function(e){n(e)})),t===e.CameraEvents.OnFrameCallback&&(this._userRequestFrameCallback=!0,this.tick())},n.off=function(t){Kt.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 Ne((function(){return Le(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 Ne((function(){var n,r,i,o,a,s;return Le(this,(function(u){switch(u.label){case 0:return Nt.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||Pl.width,this._videoElement.height=(null==e?void 0:e.height)||this._videoElement.height||Pl.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 Ne((function(){return Le(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 Ne((function(){var n,r;return Le(this,(function(i){return n=Kt.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=Ne((function(n,r){var i;return Le(this,(function(o){switch(o.label){case 0:return o.trys.push([0,2,,3]),[4,t.stream()];case 1:return o.sent(),Kt.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 Ne((function(){return Le(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 Ne((function(){return Le(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=Ne((function(n){return Le(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 Ne((function(){return Le(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 Ne((function(){return Le(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 Ne((function(){return Le(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(),Kt.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||El.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}(),Il=Oi({play:Qi.function(),pause:Qi.function()}).refine((function(e){return"play"in e&&"pause"in e}),{message:"Invalid HTMLVideoElement"}),Al=[Oi({videoElement:Il,mediaConstraints:Qi.object({width:Qi.number().min(100).optional(),height:Qi.number().min(100).optional(),facingMode:Qi.string().optional(),audio:Qi.boolean().optional(),video:Qi.boolean().optional(),deviceId:Qi.string().optional(),mirrored:Qi.boolean().optional()}).nullish()}).optional()];function Ol(e){return zn("createCameraContext",Al,[e],(function(e){return new Sl(e.videoElement,e.mediaConstraints)}))}var kl=function(){function e(){var t,n;Mt(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=De(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;Nt.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?Nt.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?Nt.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 Cl(e){return Nl.apply(this,arguments)}function Nl(){return(Nl=Ne((function(e){return Le(this,(function(t){return[2,zn("setupAd",[],[e],(function(){return kl.getInstance().loadSDK()}))]}))}))).apply(this,arguments)}var Ml=[Oi({ids:Qi.union([Qi.string(),Qi.array(Qi.string())]),config:Oi({display:Qi.boolean().optional(),onClose:Qi.function().optional()}).optional()})];function Rl(e){return xl.apply(this,arguments)}function xl(){return xl=Ne((function(e){return Le(this,(function(t){return[2,zn("loadAd",Ml,[e],function(){var e=Ne((function(e){return Le(this,(function(t){return kl.getInstance().load(e.ids,e.config),[2]}))}));return function(t){return e.apply(this,arguments)}}())]}))})),xl.apply(this,arguments)}var Dl=[Oi({id:Qi.string()})];function Ll(e){return Ul.apply(this,arguments)}function Ul(){return Ul=Ne((function(e){return Le(this,(function(t){return[2,zn("displayAd",Dl,[e],function(){var e=Ne((function(e){return Le(this,(function(t){return kl.getInstance().display(e.id),[2]}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Ul.apply(this,arguments)}var jl=[Oi({id:Qi.string().optional()}).optional()];function Bl(e){return Zl.apply(this,arguments)}function Zl(){return Zl=Ne((function(e){return Le(this,(function(t){return[2,zn("refreshAd",jl,[e],function(){var e=Ne((function(e){return Le(this,(function(t){return kl.getInstance().refresh(e.id),[2]}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Zl.apply(this,arguments)}var zl,Wl=[Oi({id:hi(),guidingText:hi().optional(),color:hi().optional(),onStatusChange:Qi.function().optional(),onError:Qi.function().optional()}).catchall(Qi.any())];function Fl(e){return Gl.apply(this,arguments)}function Gl(){return Gl=Ne((function(e){return Le(this,(function(n){return[2,zn("showOAWidget",Wl,[e],function(){var e=Ne((function(e){var n,r,i,o,a,s,u,c;return Le(this,(function(l){if(Ge.isMp){try{n=document.getElementById(e.id),r=e.onStatusChange,i=e.guidingText,o=e.color,a=t(e,["onStatusChange","guidingText","color"]),n&&(s=document.createElement("iframe"),u="ifOAW-".concat(e.id,"-").concat(Date.now()),(c=new URL(ke.OA)).searchParams.set("id",u),c.searchParams.set("appId",window.APP_ID),i&&c.searchParams.set("guidingText",i),o&&c.searchParams.set("color",o),Object.entries(a).forEach((function(e){var t=qe(e,2),n=t[0],r=t[1];r&&c.searchParams.set("data-".concat(n),String(r))})),s.id=u,s.src=c.href,s.style.width="100%",s.style.height="100%",s.style.border="none",n.innerHTML=s.outerHTML,window.removeEventListener("message",zl,!1),zl=function(){var e=Ne((function(e){var t,n,i,o,a,s,l,d;return Le(this,(function(p){switch(p.label){case 0:return t=e.data,e.origin.startsWith(Oe)?(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,Sn.jumpAndGetToken()]):[3,3];case 1:return p.sent(),l=null===(a=Sn.miniProgramConfig)||void 0===a?void 0:a.jwt,null==n||null===(s=n.contentWindow)||void 0===s||s.postMessage({type:i,payload:{jwt:l}},Oe),[3,3];case 2:"oaInfo"===i?null==r||r(null===(d=t.payload)||void 0===d?void 0:d.followed):"openOA"===i?ga(t.payload.id,"oa"):"heightChange"===i&&(n.style.height="".concat(t.payload,"px")),p.label=3;case 3:return[2]}}))}));return function(t){return e.apply(this,arguments)}}(),window.addEventListener("message",zl,!1))}catch(e){console.log(e)}return[2,Promise.resolve()]}return Ge.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(He("showOAWidget",{}))]}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Gl.apply(this,arguments)}var Vl,Hl=[Qi.object({id:Qi.string(),type:Qi.string(),text:Qi.string(),color:Qi.string().optional(),disabled:Qi.boolean().optional(),onDataReceived:Qi.function().optional(),onError:Qi.function().optional()}).catchall(Qi.any())];function Kl(e){return Jl.apply(this,arguments)}function Jl(){return Jl=Ne((function(e){return Le(this,(function(n){return[2,zn("showFunctionButtonWidget",Hl,[e],function(){var e=Ne((function(e){var n,r,i,o,a,s,u;return Le(this,(function(c){if(Ge.isMp){try{n=document.getElementById(e.id),r=e.onDataReceived,i=e.onError,o=t(e,["onDataReceived","onError"]),n&&(a=document.createElement("iframe"),s="ifFBW-".concat(e.id,"-").concat(Date.now()),(u=new URL(ke.FUNCTION_BUTTON)).searchParams.set("id",s),u.searchParams.set("appId",window.APP_ID),Object.entries(o).forEach((function(e){var t=qe(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=qe(e,2),n=t[0],r=t[1];r&&a.setAttribute("data-".concat(n),String(r))})),n.innerHTML=a.outerHTML,window.removeEventListener("message",Vl,!1),Vl=function(){var e=Ne((function(e){var t,n,a,c,l,d,p,f,h,m,v,y,g;return Le(this,(function(_){switch(_.label){case 0:return t=e.data,e.origin.startsWith(Oe)?(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,Sn.jumpAndGetToken()]):[3,4];case 1:return _.sent(),f=null===(l=Sn.miniProgramConfig)||void 0===l?void 0:l.jwt,h=null===(d=Sn.miniProgramConfig)||void 0===d?void 0:d.encryptKey,[4,Gn()];case 2:return m=_.sent(),null==n||null===(p=n.contentWindow)||void 0===p||p.postMessage({type:a,payload:{jwt:f,encryptKey:h,accessToken:m}},Oe),[3,4];case 3:"onSuccess"===a?(null==(v=t.payload)?void 0:v.type)===o.type&&(y={callAction:function(e,t){var r;null==n||null===(r=n.contentWindow)||void 0===r||r.postMessage({type:"context.callAction",payload:{actionName:e,actionData:t}},Oe)}},null==r||r.apply(void 0,De(Object.values(v)).concat([y]))):"onError"===a&&(null==(g=t.payload)?void 0:g.type)===o.type&&(null==i||i(null==g?void 0:g.data)),_.label=4;case 4:return[2]}}))}));return function(t){return e.apply(this,arguments)}}(),window.addEventListener("message",Vl,!1))}catch(e){console.log(e)}return[2,Promise.resolve()]}return Ge.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(He("showFunctionButtonWidget",{}))]}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Jl.apply(this,arguments)}var ql=function(){var t=Ne((function(t,n){var r;return Le(this,(function(i){return r={},"cccd"===t&&(r={mrz:null==n?void 0:n.mrz}),[2,new Promise((function(n,i){bn("SCAN_NFC",{type:e.ScanNFCType[t],data:r},{success:function(e){if("cccd"===t){var r,i,o,a,s,u,c,l,d,p,f,h,m,v,y,g,_,w,T,b,E,P={dg1:null!==(r=e.dg1)&&void 0!==r?r:"",dg2:null!==(i=e.dg2)&&void 0!==i?i:"",dg3:null!==(o=e.dg3)&&void 0!==o?o:"",dg4:null!==(a=e.dg4)&&void 0!==a?a:"",dg5:null!==(s=e.dg5)&&void 0!==s?s:"",dg6:null!==(u=e.dg6)&&void 0!==u?u:"",dg7:null!==(c=e.dg7)&&void 0!==c?c:"",dg8:null!==(l=e.dg8)&&void 0!==l?l:"",dg9:null!==(d=e.dg9)&&void 0!==d?d:"",dg10:null!==(p=e.dg10)&&void 0!==p?p:"",dg11:null!==(f=e.dg11)&&void 0!==f?f:"",dg12:null!==(h=e.dg12)&&void 0!==h?h:"",dg13:null!==(m=e.dg13)&&void 0!==m?m:"",dg14:null!==(v=e.dg14)&&void 0!==v?v:"",dg15:null!==(y=e.dg15)&&void 0!==y?y:"",dg16:null!==(g=e.dg16)&&void 0!==g?g:"",com:null!==(_=e.com)&&void 0!==_?_:"",sod:null!==(w=e.sod)&&void 0!==w?w:"",challenge:null!==(T=e.challenge)&&void 0!==T?T:"",aAResult:null!==(b=e.aAResult)&&void 0!==b?b:"",eACCAResult:null!==(E=e.eACCAResult)&&void 0!==E?E:""};n(P)}else n({})},fail:function(e){i(e)}},{timeout:!1})}))]}))}));return function(e,n){return t.apply(this,arguments)}}(),Ql=[Oi({type:Qi.enum(["cccd"]),data:Oi({mrz:hi().max(90)})})];function Yl(e){return $l.apply(this,arguments)}function $l(){return $l=Ne((function(e){return Le(this,(function(t){return[2,zn("scanNFC",Ql,[e],function(){var e=Ne((function(e){var t,n;return Le(this,(function(r){switch(r.label){case 0:return Ge.isMp?pn(754,620)?(t=e.type,n=e.data,[4,ql(t,n)]):[3,2]:[3,3];case 1:return[2,r.sent()];case 2:return[2,Promise.reject(wn.error.clientNotSupport())];case 3:return Ge.isMpWeb?[2,Promise.resolve({})]:[2,Promise.reject(He("scanNFC",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),$l.apply(this,arguments)}var Xl=Ne((function(){return Le(this,(function(e){return[2,new Promise((function(e,t){bn("CHECK_NFC",{},{success:function(t){e(t)},fail:function(e){t(e)}},{timeout:!1})}))]}))}));function ed(e){return td.apply(this,arguments)}function td(){return(td=Ne((function(e){return Le(this,(function(t){return[2,zn("checkNFC",[],[e],Ne((function(){return Le(this,(function(e){switch(e.label){case 0:return Ge.isMp?[4,Xl()]:[3,2];case 1:return[2,e.sent()];case 2:return Ge.isMpWeb?[2,Promise.resolve({})]:[2,Promise.reject(He("checkNFC",{}))]}}))})))]}))}))).apply(this,arguments)}var nd=[Qi.string().trim().min(1)];var rd=[Qi.string().trim().min(1),Qi.string().trim()];var id=[Qi.string().trim().min(1)];var od={getItem:function(e){return zn("getItem",nd,[e],(function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];if(Ge.isMp||Ge.isMpWeb){if(pn(757,625))return No.getItem(t[0]);throw wn.error.clientNotSupport()}throw He("getItem",{})}))},setItem:function(e,t){return zn("setItem",rd,[e,t],(function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];if(Ge.isMp||Ge.isMpWeb){if(pn(757,625))return No.setItem(t[0],t[1]);throw wn.error.clientNotSupport()}throw He("setItem",{})}))},clear:function(){return zn("clear",[],[],(function(){if(Ge.isMp||Ge.isMpWeb){if(pn(757,625))return No.clearStorageSync();throw wn.error.clientNotSupport()}throw He("clear",{})}))},removeItem:function(e){return zn("removeItem",id,[e],(function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];if(Ge.isMp||Ge.isMpWeb){if(pn(757,625))return No.removeItem(t[0]);throw wn.error.clientNotSupport()}throw He("removeItem",{})}))},getStorageInfo:function(){return zn("getStorageInfoSync",[],[],(function(){if(Ge.isMp||Ge.isMpWeb){if(pn(757,625))return No.getStorageInfoSync();throw wn.error.clientNotSupport()}throw He("getStorageInfoSync",{})}))}},ad={purchase:dc,createOrder:ac,checkTransaction:gc,createOrderIAP:bc,selectPaymentMethod:mc},sd=ad,ud=function(){var e=Ne((function(e,t,n){var r;return Le(this,(function(i){return r={},t?r={fileBase64Data:t}:e&&(r={fileUrl:e}),[2,new Promise((function(e,t){bn("SAVE_FILE",Ia(Je({},r),{onProgress:n}),{success:function(t){e()},fail:function(e){t(e)}},{})}))]}))}));return function(t,n,r){return e.apply(this,arguments)}}(),cd=[Oi({url:Qi.string().url().optional(),fileBase64Data:Qi.string().max(7e6).optional()}).optional()];function ld(e){return dd.apply(this,arguments)}function dd(){return dd=Ne((function(e){return Le(this,(function(t){return[2,zn("downloadFile",cd,[e],function(){var e=Ne((function(e){return Le(this,(function(t){switch(t.label){case 0:return Ge.isMp?[4,ud(e.url,e.fileBase64Data,e.onProgress)]:[3,2];case 1:return[2,t.sent()];case 2:return Ge.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(He("downloadFile",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),dd.apply(this,arguments)}var pd=Qi.enum(["APP_INITIALIZING","APP_READY"]),fd=Qi.any();var hd,md={logEvent:function(e,t){return zn("logEvent",[pd,fd],[e,t],(function(e,t){if(Ge.isMp||Ge.isMpWeb){var n,r,i,o=Ia(Je({},"object"==typeof t&&null!==t?t:{}),{duration:Math.round(performance.now()),timestamp:Date.now()});return null===window||void 0===window||null===(n=window.zmpGlobal)||void 0===n||null===(r=n.eventManager)||void 0===r||null===(i=r.logEventForClient)||void 0===i||i.call(r,{type:p.DEV_TRACKING,eventCode:"APP_INITIALIZING"===e?f.APP_INITIALIZING:f.APP_READY}),an([{action:"zmp.app.lifecycle.tracking",error:0,message:"",data:Je({eventType:e},o)}])}throw He("logEvent",{})}))}},vd=[Oi({id:hi(),textColor:Qi.string().optional(),fontSize:Qi.string().optional(),buttonHeight:Qi.string().optional(),buttonColor:Qi.string().optional(),buttonTextColor:Qi.string().optional(),buttonRadius:Qi.string().optional(),buttonText:Qi.string().optional(),checkboxBGColor:Qi.string().optional(),checkboxCheckmarkColor:Qi.string().optional(),onClick:Qi.function().optional(),onStatusChange:Qi.function().optional(),onError:Qi.function().optional()}).catchall(Qi.any())];function yd(e){return gd.apply(this,arguments)}function gd(){return gd=Ne((function(e){return Le(this,(function(n){return[2,zn("showCustomOAWidget",vd,[e],function(){var e=Ne((function(e){var n,r,i,o,a,s,u,c,l,d,p,f,h,m,v,y,g,_,w,T,b;return Le(this,(function(E){if(Ge.isMp){try{n=document.getElementById(e.id),r=e.textColor,i=e.fontSize,o=e.buttonHeight,a=e.buttonColor,s=e.buttonTextColor,u=e.buttonRadius,c=e.buttonText,l=e.checkboxBGColor,d=e.checkboxCheckmarkColor,p=e.onStatusChange,f=e.onClick,h=e.onError,m=t(e,["textColor","fontSize","buttonHeight","buttonColor","buttonTextColor","buttonRadius","buttonText","checkboxBGColor","checkboxCheckmarkColor","onStatusChange","onClick","onError"]),n&&(v=document.createElement("iframe"),y="ifCOAW-".concat(e.id,"-").concat(Date.now()),g=new URL(ke.CUSTOM_OA),_={id:y,appId:window.APP_ID,textColor:r,fontSize:i,buttonHeight:o,buttonColor:a,buttonTextColor:s,buttonRadius:u,buttonText:c,checkboxBGColor:l,checkboxCheckmarkColor:d},Object.entries(m).forEach((function(e){var t=qe(e,2),n=t[0],r=t[1];r&&(_["data-".concat(n)]=String(r))})),w=JSON.stringify(_),P=w,S=(new TextEncoder).encode(P),I=Array.from(S).map((function(e){return String.fromCharCode(e)})).join(""),T=btoa(I),b=encodeURIComponent(T),Bn(g.searchParams,"data",b),v.id=y,v.src=g.href,v.style.width="100%",v.style.height="100%",v.style.border="none",n.innerHTML=v.outerHTML,window.removeEventListener("message",hd,!1),hd=function(){var e=Ne((function(e){var t,n,r,i,o,a,s,u,c;return Le(this,(function(l){switch(l.label){case 0:return t=e.data,e.origin.startsWith(Oe)?(n=document.getElementById(y),r=t.type,(i=new URL(t.href)).origin!==g.origin||i.pathname!==g.pathname||t.id!==y?[3,3]:"followOA"!==r&&"getOAInfo"!==r?[3,2]:[4,Sn.jumpAndGetToken()]):[3,3];case 1:return l.sent(),s=null===(o=Sn.miniProgramConfig)||void 0===o?void 0:o.jwt,null==n||null===(a=n.contentWindow)||void 0===a||a.postMessage({type:r,payload:{jwt:s}},Oe),[3,3];case 2:"oaInfo"===r?null==p||p(null===(u=t.payload)||void 0===u?void 0:u.followed):"openOA"===r?ga(t.payload.id,"oa"):"heightChange"===r?n.style.height="".concat(t.payload,"px"):"onClick"===r?null==f||f(null===(c=t.payload)||void 0===c?void 0:c.status):"onError"===r&&(null==h||h(t.payload)),l.label=3;case 3:return[2]}}))}));return function(t){return e.apply(this,arguments)}}(),window.addEventListener("message",hd,!1))}catch(e){console.log(e)}return[2,Promise.resolve()]}var P,S,I;return Ge.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(He("showCustomOAWidget",{}))]}))}));return function(t){return e.apply(this,arguments)}}())]}))})),gd.apply(this,arguments)}var _d,wd=[Oi({id:hi(),onMethodChange:Qi.function().optional()}).catchall(Qi.any())];function Td(){return Td=Ne((function(e){return Le(this,(function(n){return[2,zn("showWidget",wd,[e],function(){var e=Ne((function(e){var n,r,i,o,a,s,u,c,l,d,p,f;return Le(this,(function(h){if(Ge.isMp){try{n=document.getElementById(e.id),r=e.onMethodChange,i=e.fail,o=t(e,["onMethodChange","fail"]),n&&((a=document.getElementById(Ae))&&(null==a||null===(s=a.parentNode)||void 0===s||s.removeChild(a),a=null),a=document.createElement("iframe"),u=Ae,c=new URL(ke.CHECKOUT_KIT),l={id:u,appId:window.APP_ID},Object.entries(o).forEach((function(e){var t=qe(e,2),n=t[0],r=t[1];r&&(l["data-".concat(n)]=r)})),d=JSON.stringify(l),p=btoa(d),f=encodeURIComponent(p),Bn(c.searchParams,"data",f),a.id=u,a.src=c.href,a.style.width="100%",a.style.height="100%",a.style.border="none",n.innerHTML=a.outerHTML,window.removeEventListener("message",_d,!1),_d=function(){var e=Ne((function(e){var t,n,o,a,s,l,d,p,f,h;return Le(this,(function(m){switch(m.label){case 0:if(t=e.data,!e.origin.startsWith(Oe))return[3,9];if(n=t.type,o=document.getElementById(u),(a=new URL(t.href)).origin!==c.origin||a.pathname!==c.pathname||t.id!==u)return[3,9];switch(n){case"getInfo":return[3,1];case"getToken":return[3,2];case"heightChange":return[3,4];case"callAction":return[3,5];case"onMethodChange":return[3,6];case"onError":return[3,7]}return[3,8];case 1:return Zn(o,n,{appId:window.APP_ID,zaloVersion:dn(),appPlatform:null===(s=Fe())||void 0===s?void 0:s.platformName}),[3,9];case 2:return[4,Sn.jumpAndGetToken()];case 3:return m.sent(),d=null===(l=Sn.miniProgramConfig)||void 0===l?void 0:l.jwt,Zn(o,n,{jwt:d}),[3,9];case 4:return o.style.height="".concat(t.payload,"px"),[3,9];case 5:return p=t.payload,f=p.actionName,h=p.actionData,String(f).length>0&&bn(f,h,{success:function(e){Zn(o,n,{status:0,actionName:f,data:e})},fail:function(e){Zn(o,n,{status:-1,actionName:f,data:e})}},{}),[3,9];case 6:return null==r||r.apply(void 0,De(Object.values(t.payload))),[3,9];case 7:null==i||i(t.payload),m.label=8;case 8:return[3,9];case 9:return[2]}}))}));return function(t){return e.apply(this,arguments)}}(),window.addEventListener("message",_d,!1))}catch(e){console.log(e)}return[2,Promise.resolve()]}return Ge.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(He("showWidget",{}))]}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Td.apply(this,arguments)}var bd,Ed=[Oi({amount:Qi.union([Qi.string(),Qi.number()]),desc:Qi.string(),payload:Qi.object({}).catchall(Qi.any()).optional()}).catchall(Qi.any())];function Pd(){return Pd=Ne((function(e){return Le(this,(function(n){return[2,zn("purchase",Ed,[e],function(){var e=Ne((function(e){return Le(this,(function(n){return Ge.isMp?[2,new Promise((function(n,r){var i=document.getElementById(Ae),o=new URL(ke.CHECKOUT_KIT);if(!(i&&fn(i,HTMLIFrameElement)&&i.src.startsWith(o.origin)&&i.src.includes(o.pathname)))return r(He("purchase",{message:"Widget not found or not initialized."}));e.amount,e.desc,e.payload;var a=t(e,["amount","desc","payload"]),s="purchase";Zn(i,s,Je({amount:String(e.amount),desc:e.desc,payload:e.payload||{}},a)),window.removeEventListener("message",bd,!1),bd=function(){var e=Ne((function(e){var t,i,a;return Le(this,(function(u){if(t=e.data,e.origin.startsWith(Oe)&&(i=t.type,(a=new URL(t.href)).origin===o.origin&&a.pathname===o.pathname&&t.id===Ae)){if(i===s)return[2,n(t.payload)];if("onError"===i)return[2,r(t.payload)]}return[2]}))}));return function(t){return e.apply(this,arguments)}}(),window.addEventListener("message",bd,!1)}))]:Ge.isMpWeb?[2,Promise.resolve({orderId:"",messageToken:"",transId:""})]:[2,Promise.reject(He("purchase",{}))]}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Pd.apply(this,arguments)}var Sd={showWidget:function(e){return Td.apply(this,arguments)},purchase:function(e){return Pd.apply(this,arguments)}},Id=function(){var e=Ne((function(e){var t,n,r,i,o=arguments;return Le(this,(function(a){return t=o.length>1&&void 0!==o[1]?o[1]:"",n=o.length>2&&void 0!==o[2]&&o[2],r=o.length>3&&void 0!==o[3]&&o[3],i=o.length>4&&void 0!==o[4]&&o[4],[2,new Promise((function(o,a){bn("OPEN_DOCUMENT",{url:e,title:t,share:n,download:r,edit:i},{success:function(e){o()},fail:function(e){a(e)}},{timeout:!1})}))]}))}));return function(t){return e.apply(this,arguments)}}(),Ad=[Oi({url:hi(),title:hi().optional(),share:Qi.boolean().optional().default(!1),download:Qi.boolean().optional().default(!1),edit:Qi.boolean().optional().default(!1)})];function Od(e){return kd.apply(this,arguments)}function kd(){return kd=Ne((function(e){return Le(this,(function(t){return[2,zn("openDocument",Ad,[e],function(){var e=Ne((function(e){var t;return Le(this,(function(n){switch(n.label){case 0:return Ge.isMp?pn(25091842,666)?(t=!!(un()&&dn()>=25111864)&&e.share,[4,Id(e.url,e.title,t,e.download,e.edit)]):[3,2]:[3,3];case 1:return[2,n.sent()];case 2:return[2,Promise.reject(wn.error.clientNotSupport())];case 3:return Ge.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(He("openDocument",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),kd.apply(this,arguments)}function Cd(e){return Nd.apply(this,arguments)}function Nd(){return(Nd=Ne((function(e){return Le(this,(function(t){return[2,zn("getEntrySource",[],[e],Ne((function(){var e,t;return Le(this,(function(n){switch(n.label){case 0:return Ge.isMp?[4,Sn.jumpAndGetToken()]:[3,2];case 1:return n.sent(),t=null===(e=Sn.miniProgramConfig)||void 0===e?void 0:e.srcOpen,[2,Promise.resolve({srcOpen:t||""})];case 2:return[2,Promise.resolve({srcOpen:""})]}}))})))]}))}))).apply(this,arguments)}var Md=Ne((function(){return Le(this,(function(e){return[2,new Promise((function(e,t){bn("GET_DEVICE_INFO",{},{success:function(t){e(t)},fail:function(e){t(e)}},{})}))]}))}));function Rd(e){return xd.apply(this,arguments)}function xd(){return(xd=Ne((function(e){return Le(this,(function(t){return[2,zn("getDeviceInfo",[],[e],Ne((function(){return Le(this,(function(e){switch(e.label){case 0:return Ge.isMp?pn(25102854,674)?[4,Md()]:[3,2]:[3,3];case 1:return[2,e.sent()];case 2:return[2,Promise.reject(wn.error.clientNotSupport())];case 3:return Ge.isMpWeb?[2,Promise.resolve({})]:[2,Promise.reject(He("getDeviceInfo",{}))]}}))})))]}))}))).apply(this,arguments)}var Dd=function(){var e=Ne((function(e,t){return Le(this,(function(n){return[2,new Promise((function(n,r){bn("LFS_FILE_INFO",{file_path:e,digest_algorithm:t},{success:function(e){n(e)},fail:function(e){r(e)}},{})}))]}))}));return function(t,n){return e.apply(this,arguments)}}();function Ld(){return Ud.apply(this,arguments)}function Ud(){return(Ud=Ne((function(){return Le(this,(function(e){return[2,zn("isSupportLFS",[],[],Ne((function(){return Le(this,(function(e){return Ge.isMp?[2,Promise.resolve({support:pn(25112868,692)})]:Ge.isMpWeb?[2,Promise.resolve({support:!1})]:[2,Promise.reject(He("isSupportLFS",{}))]}))})))]}))}))).apply(this,arguments)}var jd=[Oi({filePath:Qi.string(),digestAlgorithm:Qi.enum(["sha1","md5"]).optional().default("md5")}).optional()];function Bd(){return Bd=Ne((function(e){return Le(this,(function(t){return[2,zn("getFileInfo",jd,[e],function(){var e=Ne((function(e){var t;return Le(this,(function(n){switch(n.label){case 0:return Ge.isMp?[4,Ld()]:[3,4];case 1:return n.sent().support?(t=e.digestAlgorithm||"md5",[4,Dd(e.filePath,t)]):[3,3];case 2:return[2,n.sent()];case 3:throw wn.error.clientNotSupport();case 4:return Ge.isMpWeb?[2,Promise.resolve({size:"",digest:"",type:""})]:[2,Promise.reject(He("getFileInfo",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Bd.apply(this,arguments)}var Zd=Ne((function(){return Le(this,(function(e){return[2,new Promise((function(e,t){bn("LFS_LIST",{},{success:function(t){var n=t.map((function(e){var t=Je({},e);try{t.filePath=t.file_path,t.createTime=t.created_time,delete t.file_path,delete t.created_time}catch(e){}return t}));e({list:n})},fail:function(e){t(e)}},{})}))]}))}));function zd(){return zd=Ne((function(e){return Le(this,(function(t){return[2,zn("getSavedFileList",[],[e],function(){var e=Ne((function(e){return Le(this,(function(e){switch(e.label){case 0:return Ge.isMp?[4,Ld()]:[3,4];case 1:return e.sent().support?[4,Zd()]:[3,3];case 2:return[2,e.sent()];case 3:throw wn.error.clientNotSupport();case 4:return Ge.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(He("getSavedFileList",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),zd.apply(this,arguments)}var Wd=function(){var e=Ne((function(e){return Le(this,(function(t){return[2,new Promise((function(t,n){bn("LFS_FILE_REMOVE",{file_path:e},{success:function(e){t(e)},fail:function(e){n(e)}},{})}))]}))}));return function(t){return e.apply(this,arguments)}}(),Fd=[Oi({filePath:Qi.string()}).optional()];function Gd(){return Gd=Ne((function(e){return Le(this,(function(t){return[2,zn("removeSavedFile",Fd,[e],function(){var e=Ne((function(e){return Le(this,(function(t){switch(t.label){case 0:return Ge.isMp?[4,Ld()]:[3,4];case 1:return t.sent().support?[4,Wd(e.filePath)]:[3,3];case 2:return[2,t.sent()];case 3:throw wn.error.clientNotSupport();case 4:return Ge.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(He("removeSavedFile",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Gd.apply(this,arguments)}var Vd=function(){var e=Ne((function(e,t){var n;return Le(this,(function(r){return n={file_path:e},[2,new Promise((function(e,r){bn("LFS_FILE_SAVE",Ia(Je({},n),{onProgress:t}),{success:function(t){e({savedPath:t})},fail:function(e){r(e)}},{})}))]}))}));return function(t,n){return e.apply(this,arguments)}}(),Hd=[Oi({filePath:Qi.string()}).optional()];function Kd(){return Kd=Ne((function(e){return Le(this,(function(t){return[2,zn("saveFile",Hd,[e],function(){var e=Ne((function(e){return Le(this,(function(t){switch(t.label){case 0:return Ge.isMp?[4,Ld()]:[3,4];case 1:return t.sent().support?[4,Vd(e.filePath,e.onProgress)]:[3,3];case 2:return[2,t.sent()];case 3:throw wn.error.clientNotSupport();case 4:return Ge.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(He("saveFile",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Kd.apply(this,arguments)}var Jd={getFileInfo:function(e){return Bd.apply(this,arguments)},getSavedFileList:function(e){return zd.apply(this,arguments)},removeSavedFile:function(e){return Gd.apply(this,arguments)},saveFile:function(e){return Kd.apply(this,arguments)},isSupportLFS:Ld};window.ZaloMiniAppSDK={getVersion:Jn},Wn();var qd=Object.freeze({__proto__:null,get Events(){return e.Events},get EventName(){return e.Events},get CameraEvents(){return e.CameraEvents},AppError:mn,login:Wn,getAccessToken:Gn,getVersion:Jn,getSystemInfo:Qn,setNavigationBarTitle:eo,setNavigationBarColor:ro,setNavigationBarLeftButton:ao,setStorage:Ro,getStorage:Lo,getStorageInfo:jo,removeStorage:zo,clearStorage:Go,getUserInfo:Jo,getNetworkType:$o,onNetworkStatusChange:ta,startBeaconDiscovery:ia,stopBeaconDiscovery:sa,getBeacons:la,closeApp:fa,scanQRCode:va,openProfile:wa,openChat:Pa,openPostFeed:ka,followOA:Ra,unfollowOA:Ua,openShareSheet:Wa,requestCameraPermission:Va,createShortcut:Ya,openBioAuthentication:ts,checkStateBioAuthentication:is,showToast:us,hideKeyboard:ds,openPhone:ms,openSMS:_s,viewOAQr:Es,keepScreen:As,onKeepScreen:ks,offKeepScreen:Ns,saveImageToGallery:Ds,saveVideoToGallery:Bs,openMiniApp:Fs,vibrate:Ks,openWebview:Ys,getRouteParams:eu,getAppInfo:tu,sendDataToPreviousMiniApp:ou,getPhoneNumber:uu,openProfilePicker:pu,connectWifi:vu,openMediaPicker:wu,getShareableLink:Eu,closeLoading:Iu,requestUpdateZalo:Ou,onConfirmToExit:Mu,offConfirmToExit:Ru,getDeviceId:xu,getDeviceIdAsync:Du,getContext:Uu,getContextAsync:ju,getAuthCode:Zu,getZPIToken:Wu,setAccessToken:Vu,openOutApp:Ku,chooseImage:Qu,getLocation:Xu,onCallbackData:nc,createOrder:ac,purchase:dc,selectPaymentMethod:mc,checkTransaction:gc,createOrderIAP:bc,events:Cu,setAndroidBottomNavigationBar:Sc,setIOSBottomSafeArea:Oc,setStatusBar:Nc,configAppView:xc,minimizeApp:Uc,openPermissionSetting:Zc,favoriteApp:Fc,openGroupList:Hc,requestSendNotification:qc,addRating:$c,interactOA:il,interactOa:il,isAllowedInteractWithOA:sl,getSetting:cl,authorize:fl,checkZaloCameraPermission:vl,getUserID:gl,getIDToken:Tl,createCameraContext:Ol,setupAd:Cl,loadAd:Rl,displayAd:Ll,refreshAd:Bl,showOAWidget:Fl,showFunctionButtonWidget:Kl,scanNFC:Yl,checkNFC:ed,nativeStorage:od,Payment:ad,CheckoutSDK:sd,downloadFile:ld,trackingManager:md,showCustomOAWidget:yd,CheckoutKit:Sd,openDocument:Od,getEntrySource:Cd,getDeviceInfo:Rd,LFSStorage:Jd,get FacingMode(){return e.FacingMode},get PhotoFormat(){return e.PhotoFormat},get PhotoQuality(){return e.PhotoQuality},get StreamType(){return e.StreamType},ZMACameraImp:Sl}),Qd=t(qd,["createOrder","checkTransaction","createOrderIAP","selectPaymentMethod","purchase"]);!function(){var e,t=null===(e=Fe())||void 0===e?void 0:e.appEnv;(null==t?void 0:t.isMp)&&(window.ZaloMiniAppSDK={},Object.assign(window.ZaloMiniAppSDK,qd))}(),e.AppError=mn,e.CheckoutKit=Sd,e.CheckoutSDK=sd,e.EventName=e.Events,e.LFSStorage=Jd,e.Payment=ad,e.ZMACameraImp=Sl,e.addRating=$c,e.authorize=fl,e.checkNFC=ed,e.checkStateBioAuthentication=is,e.checkTransaction=gc,e.checkZaloCameraPermission=vl,e.chooseImage=Qu,e.clearStorage=Go,e.closeApp=fa,e.closeLoading=Iu,e.configAppView=xc,e.connectWifi=vu,e.createCameraContext=Ol,e.createOrder=ac,e.createOrderIAP=bc,e.createShortcut=Ya,e.default=Qd,e.displayAd=Ll,e.downloadFile=ld,e.events=Cu,e.favoriteApp=Fc,e.followOA=Ra,e.getAccessToken=Gn,e.getAppInfo=tu,e.getAuthCode=Zu,e.getBeacons=la,e.getContext=Uu,e.getContextAsync=ju,e.getDeviceId=xu,e.getDeviceIdAsync=Du,e.getDeviceInfo=Rd,e.getEntrySource=Cd,e.getIDToken=Tl,e.getLocation=Xu,e.getNetworkType=$o,e.getPhoneNumber=uu,e.getRouteParams=eu,e.getSetting=cl,e.getShareableLink=Eu,e.getStorage=Lo,e.getStorageInfo=jo,e.getSystemInfo=Qn,e.getUserID=gl,e.getUserInfo=Jo,e.getVersion=Jn,e.getZPIToken=Wu,e.hideKeyboard=ds,e.interactOA=il,e.interactOa=il,e.isAllowedInteractWithOA=sl,e.keepScreen=As,e.loadAd=Rl,e.login=Wn,e.minimizeApp=Uc,e.nativeStorage=od,e.offConfirmToExit=Ru,e.offKeepScreen=Ns,e.onCallbackData=nc,e.onConfirmToExit=Mu,e.onKeepScreen=ks,e.onNetworkStatusChange=ta,e.openBioAuthentication=ts,e.openChat=Pa,e.openDocument=Od,e.openGroupList=Hc,e.openMediaPicker=wu,e.openMiniApp=Fs,e.openOutApp=Ku,e.openPermissionSetting=Zc,e.openPhone=ms,e.openPostFeed=ka,e.openProfile=wa,e.openProfilePicker=pu,e.openSMS=_s,e.openShareSheet=Wa,e.openWebview=Ys,e.purchase=dc,e.refreshAd=Bl,e.removeStorage=zo,e.requestCameraPermission=Va,e.requestSendNotification=qc,e.requestUpdateZalo=Ou,e.saveImageToGallery=Ds,e.saveVideoToGallery=Bs,e.scanNFC=Yl,e.scanQRCode=va,e.selectPaymentMethod=mc,e.sendDataToPreviousMiniApp=ou,e.setAccessToken=Vu,e.setAndroidBottomNavigationBar=Sc,e.setIOSBottomSafeArea=Oc,e.setNavigationBarColor=ro,e.setNavigationBarLeftButton=ao,e.setNavigationBarTitle=eo,e.setStatusBar=Nc,e.setStorage=Ro,e.setupAd=Cl,e.showCustomOAWidget=yd,e.showFunctionButtonWidget=Kl,e.showOAWidget=Fl,e.showToast=us,e.startBeaconDiscovery=ia,e.stopBeaconDiscovery=sa,e.trackingManager=md,e.unfollowOA=Ua,e.vibrate=Ks,e.viewOAQr=Es,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})),Ft={enablePaymentDone:!1};function Gt(e){var t=e.data;return{orderId:t.zmpOrderId||t.orderId,transId:t.appTransID||t.apptransid||t.transId}}var Vt="ACTION_CALLBACK";function Ht(t,n,r,i){switch(!0){case"string"==typeof r||null===r:return[{eventName:t,eventId:n,data:r}];case t===e.Events.OpenApp&&(null==i?void 0:i.enablePaymentDone):var o=function(e){var t=new URL(e,window.location.origin),n=t.pathname.split("/")[3].toUpperCase().replace(/-/g,"_"),r={},i=t.searchParams.get("orderId"),o=t.searchParams.get("zmpOrderId"),a=t.searchParams.get("appTransID")||t.searchParams.get("apptransid");switch(n){case"MOMO":case"MOMO_SANDBOX":r.orderId=o,r.transId=i;break;default:r.orderId=o||i,r.transId=a}return r}(r.path);return[{eventName:e.Events.PaymentDone,eventId:n,data:o}];case t===e.Events.OnDataCallback:if(["PAY_BY_BANK","PAY_BY_CUSTOM_METHOD"].includes(null==r?void 0:r.eventType))return[{eventName:e.Events.OnDataCallback,eventId:n,data:r},{eventName:e.Events.PaymentDone,eventId:n,data:Gt(r)}];break;default:return[{eventName:t,eventId:n,data:r}]}}var Kt=function(t){Bt(r,t);var n=zt(r);function r(){var e;return Mt(this,r),(e=n.apply(this,arguments)).debug=St("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===Vt||t===e.Events.PaymentCallback)return Ut(Dt(r.prototype),"on",this).call(this,t,n,i);this.debug("register ".concat(String(t),": ").concat(i));return Ut(Dt(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===Vt)return Ut(Dt(r.prototype),"once",this).call(this,e,t,n);this.debug("register once ".concat(String(e),": ").concat(n));return Ut(Dt(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}(Wt);function Jt(e){Kt.getInstance().emit(Vt,e)}function qt(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){Jt({serialId:e,actionName:t,result:n})}},window.zaloJSV2={zalo_h5_event_handler:function(t,n,r){var i=St("zmp:zalo_h5_event_handler");i("eventId: ".concat(t,", eventName: ").concat(n,", eventData: ").concat(r));var a=kn(r);i("stringToData",a);var s=function(t,n){if(!n||"string"==typeof n)return n;try{if(t===e.Events.OpenApp){var r=n.url,i=new URL(r),a=i.pathname.split("/zapps/".concat(o))[1];return{path:"".concat(a||"/").concat(i.search)}}return n}catch(e){return n}}(n,a),u=Ht(n,t,s,Ft);null==u||u.forEach((function(e){Kt.getInstance().emit(e.eventName,e.eventId,e.data);var t=document.getElementById(Ae);t&&Zn(t,"appEvent",{eventName:e.eventName,eventId:e.eventId,data:e.data})}))}},window.zaloNative2JS={nativeCall:function(t,n,r){Kt.getInstance().emit(e.Events.PaymentCallback,t,n,r)}};var Qt={encode:qt,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:qt(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":Pt(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":Pt(r))?JSON.stringify(r):encodeURIComponent(r)].join("=");n.push(i)})),n.join("&")}},Yt={},$t=function(e,t,n){var r=t||"default";return function(){return(r in Yt?Yt[r](e,n):e).apply(this,arguments)}};$t.setWrapper=function(e){Yt[arguments.length<=1||void 0===arguments[1]?"default":arguments[1]]=e};var Xt={error:{code:1,error_subcode:1357046,message:"Received Invalid JSON reply.",type:"http"}};function en(e){try{return null===e?Xt:JSON.parse(e)}catch(e){return Xt}}var tn,nn={execute:function(e,t,n,r){n.suppress_http_code=1;var i=Qt.encode(n);"post"!=t&&(e=Qt.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=$t((function(){o=r,"onload"in i&&i.onload(n)}),"entry","XMLHttpRequest:load"),a=$t((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(en(e.responseText))},o.onerror=function(e){e.responseText?r(en(e.responseText)):r({error:{code:1,error_subcode:1357045,message:"unknown error (empty response)",status:e.status,type:"http"}})},o.send(i),!0)}},rn=nn,on=(tn=Ne((function(e,t,n){var r,i,o,a;return Le(this,(function(s){switch(s.label){case 0:return r={appId:e,versionStatus:t},Nt.isUndefined(n)||(r.currentVersion=n),i=Qt.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 tn.apply(this,arguments)});function an(e){try{var t=e.map((function(e){return{action:e.action,error:e.error,message:e.message,data:e.data}}));rn.execute(d.SEND_ACTION_LOG,"post",{appId:window.APP_ID,data:JSON.stringify(t)},(function(){}))}catch(e){}}var sn=function(e){return e.replace(/[A-Z]/g,(function(e){return"_".concat(e.toLowerCase())}))},un=function(){var e;return"android"===((null===(e=Fe())||void 0===e?void 0:e.platformName)||"").toLowerCase()},cn=function(){var e;return"ios"===((null===(e=Fe())||void 0===e?void 0:e.platformName)||"").toLowerCase()};function ln(e){var t=String(e);try{if(/^\d{9}$/.test(t)&&"0"===t[5])return Number(t.slice(0,5)+t.slice(6))}catch(e){}return Number(t)}var dn=function(){var e,t=0;if(window.zaloVersionCode)return ln(window.zaloVersionCode);var n=Number((null===(e=Fe())||void 0===e?void 0:e.zaloVersion)||"0");return n>=24112e3?t=n:un()?t=n%1e4:cn()&&(t=n),ln(t)};function pn(e,t){if(window.isAPISupport&&"function"==typeof window.isAPISupport)return window.isAPISupport(e,t);var n=dn();return un()?n>=e:!!cn()&&n>=t}function fn(e,t){return null!=t&&"undefined"!=typeof Symbol&&t[Symbol.hasInstance]?!!t[Symbol.hasInstance](e):e instanceof t}var hn,mn=function(){function e(t,n,r,i){Mt(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}(),vn=function(e,t){return fn(e,mn)?function(e,t){return e.api=t,e.toJSON()}(e,t):function(e,t){return fn(e,Error)?new mn(m,e.message,t).toJSON():Nt.isEmpty(null==e?void 0:e.message)||Nt.isEmpty(null==e?void 0:e.code)?new mn(m,O,t,e).toJSON():new mn(e.code,e.message,t,e.detail).toJSON()}(e,t)},yn=(hn=Ne((function(e){var t;return Le(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,Je({method:"GET"},t))];case 1:return[4,n.sent().json()];case 2:return[2,n.sent()]}}))})),function(e){return hn.apply(this,arguments)}),gn=Ne((function(){return Le(this,(function(e){return[2,new Promise(function(){var e=Ne((function(e,t){var n,r,i,o;return Le(this,(function(a){switch(a.label){case 0:return a.trys.push([0,3,,4]),[4,Sn.jumpAndGetToken()];case 1:return a.sent(),(r=null===(n=Sn.miniProgramConfig)||void 0===n?void 0:n.jwt)||t(new mn(g,N,"getSetting")),[4,yn(r)];case 2:return(i=a.sent())&&0===i.err?e({authSetting:i.data}):t(new mn(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)}}())]}))})),_n=function(){var t,n,r,i=Fe(),o={},a=Kt.getInstance(),s=[],u=!1;return u||(n=function(t){var n=t.serialId,r=Cn(t.result),i=xn(null==r?void 0:r.action),u=Nt.isEmpty(null==r?void 0:r.error_code)?0:null==r?void 0:r.error_code,c=null==r?void 0:r.error_message,l=(null==r?void 0:r.data)||r;if(i&&0===u){var d=JSON.parse(null==r?void 0:r.data);u=Nt.isEmpty(null==d?void 0:d.error_code)?0:null==d?void 0:d.error_code,c=null==d?void 0:d.error_message,l=(null==d?void 0:d.data)||d}var p={error_code:u,error_message:c,data:l,action:(null==r?void 0:r.action)||t.actionName};if(n&&o[n]){var f=o[n],h=f.callback,m=f.timeout,v=f.isMultiCallback,y=f.options,g=f.downloadListener;!function(e,t){var n=t||{},r=n.success,i=n.fail;0===e.error_code?Nt.isFunction(r)&&r(e):Nt.isFunction(i)&&i(e)}(p,h),!v&&delete o[n],m&&clearTimeout(m);var _={action:null==p?void 0:p.action,error:null==p?void 0:p.error_code,message:null==p?void 0:p.error_message,data:{}};try{if("action.open.inapp"===p.action||"action.open.outapp"===p.action){var w=new URL(null==y?void 0:y.url),T="".concat(w.protocol,"//").concat(w.host).concat(w.pathname);_.data={url:T}}if("action.follow.oa"===p.action||"action.unfollow.oa"===p.action){var b=null==y?void 0:y.uid;_.data={uid:b}}if("action.open.chat"===p.action){var E=null==y?void 0:y.uId,P=null==y?void 0:y.type;_.data={uid:E,openChatType:P}}(null==y?void 0:y.onProgress)&&g&&a.off(e.Events.DownloadProgress,g)}catch(e){}s.push(_)}},Kt.getInstance().on(Vt,n),a.on(e.Events.AppPaused,(function(){if(s.length>0){var e=s;s=[],an(e)}})),t?clearInterval(t):t=setInterval((function(){if(s.length>0){var e=s;s=[],an(e)}}),5e3),u=!0),r=Ne((function(t,n,r,s){var u,c,l,d,p,f,h,m,v,y,T,b,E,P,S,I,A,O,k,N,M,D,L;return Le(this,(function(U){switch(U.label){case 0:return c=Math.floor(1e6*Math.random()),l="".concat(t,"_").concat(c),d=jn(t),(null==s?void 0:s.actionName)&&s.actionName.length>0&&(d=null==s?void 0:s.actionName),p=(null==s?void 0:s.isMultiCallback)||!1,f=!1!==(null==s?void 0:s.timeout)&&((null==s?void 0:s.timeout)||!0),h=(null==s?void 0:s.haveCallback)||!1,m=(null==s?void 0:s.skipJump)||!1,v=(null==s?void 0:s.requireAccessToken)||!1,y=Dn(d),n&&r&&(o[l]={options:n,callback:r,isMultiCallback:p},f&&h&&(o[l].timeout=setTimeout((function(){return Jt({serialId:l,result:{error_code:w,error_message:C,data:{timeout:f},action:t}}),null}),!0===f?8e3:1e3*f))),y?[4,gn()]:[3,2];case 1:if(!1===(null==(b=U.sent())||null===(T=b.authSetting)||void 0===T?void 0:T["scope.userInfo"]))return Jt({serialId:l,result:{error_code:g,error_message:x,data:{isMobile:null==i||null===(E=i.platform)||void 0===E?void 0:E.isMobile},action:t}}),[2];U.label=2;case 2:return P=xn(d),!(null==i||null===(u=i.platform)||void 0===u?void 0:u.isMobile)||!t||Nt.isUndefined(ZaloJavaScriptInterface)||i.platform.isIOS&&!On(t)||P&&!1===P.isSupported?(Jt({serialId:l,result:{error_code:_,error_message:R,data:{isMobile:null==i||null===(S=i.platform)||void 0===S?void 0:S.isMobile},action:t}}),[2]):(I=An(n),m?[3,4]:[4,Sn.getJSAccessToken()]);case 3:return O=U.sent(),[3,5];case 4:O="",U.label=5;case 5:A=O,U.label=6;case 6:return U.trys.push([6,10,,11]),m||!v?[3,8]:[4,Sn.getAccessToken()];case 7:return N=U.sent(),[3,9];case 8:N="",U.label=9;case 9:return k=N,[3,11];case 10:return M=U.sent(),Jt({serialId:l,result:{error_code:null==M?void 0:M.code,error_message:null==M?void 0:M.message,action:t}}),[2];case 11:try{n&&(null==n?void 0:n.onProgress)&&(D=function(e){!function(e,t){e.url;var n=e.progress;t&&t(n)}(e,null==n?void 0:n.onProgress)},o[l].downloadListener=D,a.on(e.Events.DownloadProgress,D))}catch(e){}return L=i.platform.isIOS?window.onNativeMessage(l,d):'window.onNativeMessage("'.concat(l,'", "').concat(d,'")'),[2,ZaloJavaScriptInterface.jsCall(A,d,k,I,L)]}}))})),function(e,t,n,i){return r.apply(this,arguments)}}(),wn={success:function(e,t){return{code:h,message:t||A,data:e||{}}},error:{failLimit:function(){return new mn(T,k)},badRequest:function(e){return new mn(v,e)},loginFailed:function(e){return new mn(g,"".concat(M,": ").concat(e))},loginRequired:function(){return new mn(g,N)},cannotGetShareInfo:function(){return new mn(y,"Can not get app info to share")},createIAPOrderFailed:function(e){var t=Object.keys(re).find((function(t){return t===e.toString()}));return new mn(e,t||O)},clientNotSupport:function(){return new mn(_,R)}}},Tn=function(t){var n,r,i,o=null===(n=Fe())||void 0===n?void 0:n.platformName,a=Un(t.action),s=W[a],u=(null==s?void 0:s.skipJump)||!1,c=(null==s?void 0:s.errorList)||{};if("JUMP_LOGIN"===a)return new mn(m,"Can not get auth code: ".concat(t.error_message));if(Sn.jumpStatus!==e.JumpStatus.DONE&&!u)return new mn(Z.UNAUTHORIZED.code,Z.UNAUTHORIZED.message);if("permission required!"===String(t.error_message).toLowerCase()||"no permission!"===String(t.error_message).toLowerCase())return new mn(Z.FORBIDDEN.code,Z.FORBIDDEN.message);if(o&&(null===(r=F[o])||void 0===r?void 0:r[t.error_code]))return new mn(F[o][t.error_code].code,F[o][t.error_code].message);var l=null==c||null===(i=c[o])||void 0===i?void 0:i[String(t.error_code)];if(l){var d,p,f,h=null===(d=l.mapTo)||void 0===d?void 0:d.message;if(null==l?void 0:l.needMoreDetail)h="".concat(null==l||null===(f=l.mapTo)||void 0===f?void 0:f.message,": ").concat(t.error_message);return new mn(null===(p=l.mapTo)||void 0===p?void 0:p.code,h)}return new mn(t.error_code,t.error_message)},bn=function(e,t,r,i){var o=function(e,t){function r(r){return function(i){var o=Nt.isEmpty(t)?void 0:t[r];if(o)return Ve({stage:n.RESPONSE,type:"log",state:r,name:e,response:i}),o("fail"===r?Tn(i):null==i?void 0:i.data)}}return Nt.isUndefined(e)&&(e=""),Object.assign({},{success:r("success"),fail:r("fail")})}(e,r),a=W[e],s=(null==i?void 0:i.delay)||0;setTimeout((function(){_n(e,t,o,Je({},i,a))}),s)},En=function(){var e=Ne((function(e){return Le(this,(function(t){return[2,new Promise((function(t,n){bn("MP_USER_AUTHORIZE",{scopes:e,forceUpdate:!0},{success:function(e){Nt.isEmpty(e)||t(e)},fail:function(e){n(e)}},{isMultiCallback:!1,timeout:!1})}))]}))}));return function(t){return e.apply(this,arguments)}}(),Pn=function(){function t(){Mt(this,t),this._jumpStatus=void 0,this.WAITING_QUEUE=[],this.getAccessTokenCount=0,this._accessToken="",this._jsAccessToken="",this.refreshToken="",this._cookies=[],this.accessTokenExpiresIn=0,this.prevGetAccessTokenTimestamp=(new Date).getTime(),this.manualSetAccessToken=!1,this._miniProgramConfig={},this.retryLimitMap={}}var r,a,u,c=t.prototype;return c.initRetryLimit=function(e){var t=z[e],n={lastCall:(new Date).getTime(),limit:t&&t.limit?t.limit:3,retry:0};return this.retryLimitMap[e]=n,n},c.resetRetryLimit=function(e){this.retryLimitMap[e].lastCall=(new Date).getTime(),this.retryLimitMap[e].retry=0},c.getRetryLimit=function(e){var t=this.retryLimitMap[e];return t&&t.lastCall&&t.retry||(t=this.initRetryLimit(e)),t},c.increaseRetryLimit=function(e){this.retryLimitMap[e].retry++},c.jump=function(){var t=this;return Ne((function(){return Le(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,Ve({stage:n.REQUEST,type:"log",name:"jump"}),_n("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)||an([{action:"action.jump.login",error:-102,message:"no zoauth",data:{}}]),r(e.JumpStatus.DONE)},fail:function(e){an([{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 Ne((function(){var i;return Le(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=Ne((function(e){var t,n,i;return Le(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 Ne((function(){var i,o;return Le(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),Nt.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,Je({method:"POST",body:i},o)).then(function(){var e=Ne((function(e){var t,n,i,o;return Le(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 Ne((function(){var n,r,a,s,u,c,d,p,f;function h(){return m.apply(this,arguments)}function m(){return(m=Ne((function(){return Le(this,(function(e){switch(e.label){case 0:return[4,new Promise((function(e){var t=setInterval((function(){(r.getAccessTokenCount<=1||r._accessToken)&&(e("done"),clearInterval(t))}),200)}))];case 1:return[2,e.sent()]}}))}))).apply(this,arguments)}return Le(this,(function(m){switch(m.label){case 0:return n=(new Date).getTime()-t.prevGetAccessTokenTimestamp,(r=t).getAccessTokenCount++,t.getAccessTokenCount>1?[4,h()]:[3,2];case 1:m.sent(),m.label=2;case 2:return t.manualSetAccessToken?(r.getAccessTokenCount--,[2,Promise.resolve(t._accessToken)]):e?[4,t.verifyUserAuthorized()]:[3,4];case 3:return s=m.sent(),[3,5];case 4:s=!0,m.label=5;case 5:return a=s,t._accessToken.length>0&&n<t.accessTokenExpiresIn&&a?(r.getAccessTokenCount--,[2,Promise.resolve(t._accessToken)]):(t.accessToken="",[4,t.jumpAndGetToken(l.ZOAUTH)]);case 6:return u=m.sent(),[4,t.jumpAndGetToken(l.ZOAUTH_VRF)];case 7:if(c=m.sent(),d="zmp.getaccesstoken.fail",!a)throw r.getAccessTokenCount--,an([{action:d,error:-104,message:"no user auth",data:{}}]),wn.error.loginFailed("User Authentication Required");if(!u)return[3,15];m.label=8;case 8:return m.trys.push([8,13,,14]),c?[4,t.loginZaloV4(o,u,c)]:[3,10];case 9:return p=m.sent(),[3,12];case 10:return[4,t.loginZaloV3(o,i,u)];case 11:p=m.sent(),m.label=12;case 12:return[3,14];case 13:return f=m.sent(),p="",console.log("Can not get access token",f),an([{action:d,error:-103,message:String(f)||"Can not get access token",data:{}}]),[3,14];case 14:return r.getAccessTokenCount--,p?[2,Promise.resolve(t._accessToken)]:(an([{action:d,error:-101,message:"no accessToken",data:{}}]),[2,Promise.reject(wn.error.loginFailed("Can't get accessToken. Please try again later."))]);case 15:throw r.getAccessTokenCount--,an([{action:d,error:-102,message:"no oauth",data:{}}]),wn.error.loginFailed("Zalo app has not been activated")}}))}))()},c.verifyUserAuthorized=function(){var e=this;return Ne((function(){var t,n,r,i,o,a;return Le(this,(function(s){switch(s.label){case 0:return n=!0,[4,e.jumpAndGetToken()];case 1:if(s.sent(),!1!==(null===(t=e._miniProgramConfig)||void 0===t?void 0:t.userAuthorized))return[3,7];s.label=2;case 2:return s.trys.push([2,6,,7]),(r=xn("action.mp.user.authorize"))&&r.isSupported?[4,gn()]:[3,5];case 3:return!1!==(null==(o=s.sent())||null===(i=o.authSetting)||void 0===i?void 0:i["scope.userInfo"])?[3,5]:[4,En()];case 4:a=s.sent(),n=(null==a?void 0:a["scope.userInfo"])||!1,s.label=5;case 5:return[3,7];case 6:return s.sent(),n=!1,[3,7];case 7:return[2,n]}}))}))()},c.setAccessToken=function(e){this.manualSetAccessToken=!0,this._accessToken=e,window.ZJSBridge.setZAccSession&&window.ZJSBridge.setZAccSession(e)},c.getJSAccessToken=function(){var e=this;return Ne((function(){var t;return Le(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=Ne((function(i){var o,a,s,u;return Le(this,(function(c){switch(c.label){case 0:return!n&&r._cookies.length>0?Nt.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}}])&&Rt(r.prototype,a),u&&Rt(r,u),t}(),Sn=Pn.getInstance(),In=St("zmp:utils:common"),An=function(e){if(Nt.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(An(e[r]));return"["+t.join(",")+"]"}if("object"==typeof e){for(var i in t=[],e)t.push('"'+i+'":'+An(e[i]));return"{"+t.join(",")+"}"}return e.toString()},On=function(e){var t=W[e],n=dn(),r=t&&"object"==typeof t&&"versionLive"in t&&t.versionLive&&"iOS"in t.versionLive?t.versionLive.iOS:0;return!!(Array.isArray(window.ignoreCheckSupport)&&window.ignoreCheckSupport.length>0&&window.ignoreCheckSupport.includes(e))||n>=r},kn=function(e){try{if(e){In(e);var t=e.replace(/\\/g,"").replace(/&#39;/g,"'");try{t=decodeURIComponent(atob(e))}catch(e){}var n=JSON.parse(t);return In("formattedValue",t,n,void 0===n?"undefined":Pt(n)),n}return null}catch(t){return In("parse json error:",t),e}},Cn=function(e){if(Nt.isObject(JSON)&&JSON.parse&&Nt.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 Nt.isObject(e)?e:new Function("return "+e)()},Nn=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""},Mn=function(e){return btoa(encodeURIComponent(JSON.stringify(e)))};var Rn=function(t){return"hidden"===t?e.StatusBarType.hidden:"transparent"===t?e.StatusBarType.transparent:e.StatusBarType.normal},xn=function(e){if(void 0!==e){var t=Sn.miniProgramConfig;return((null==t?void 0:t.dynamicApis)||[]).find((function(t){return t.action===e&&!1===t.clientHandle}))}},Dn=function(e){if(void 0===e)return!1;var t=Sn.miniProgramConfig;return((null==t?void 0:t.requiredAuthenList)||[]).indexOf(e)>=0},Ln=function(){var e=Ne((function(){return Le(this,(function(e){return[2,new Promise(function(){var e=Ne((function(e,t){var n;return Le(this,(function(t){switch(t.label){case 0:return t.trys.push([0,2,,3]),[4,Sn.jumpAndGetToken()];case 1:return t.sent(),n=Sn.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)}}(),Un=function(e){return"action.get.device_info"===e?"GET_DEVICE_INFO":e.replace("action.","").replace(/\./g,"_").toUpperCase()},jn=function(e){return e.startsWith("action.")?e:"GET_DEVICE_INFO"===e?"action.get.device_info":"action.".concat(e.replace(/\_/g,".").toLowerCase())},Bn=function(e,t,n){"string"==typeof n&&n.length>0?e.set(t,n):"object"!=typeof n||Array.isArray(n)||Object.entries(n).forEach((function(n){var r=qe(n,2),i=r[0],o=r[1];null!=o&&""!==o&&e.set("".concat(t).concat(i),String(o))}))},Zn=function(e,t,n){var r;null===(r=e.contentWindow)||void 0===r||r.postMessage({type:t,payload:n},Oe)};function zn(e,t,n,r){var i,o;!function(e,t){if(z[e]){var n=Sn.getRetryLimit(e);n.lastCall&&(new Date).getTime()-n.lastCall>1e3&&Sn.resetRetryLimit(e);var r=n.limit||3;if(n.retry&&n.retry>=r)throw vn(wn.error.failLimit(),e);Sn.increaseRetryLimit(e)}}(e);var a=Array.isArray(n)&&n.length>0&&(null===(i=n[0])||void 0===i?void 0:i.success),s=Array.isArray(n)&&n.length>0&&(null===(o=n[0])||void 0===o?void 0:o.fail);try{var u=n;t.length>0&&t.forEach((function(t,r){var i=t.safeParse(n[r]);if(!i.success){var o,a=null===(o=i.error)||void 0===o?void 0:o.issues,s=a.map((function(e,t){var n=e.path.length>0?e.path.map((function(e,t){return t>0?"[".concat(e,"]"):e})).join(""):"arg";return"Error ".concat(t+1,": Code: ").concat(e.code," ~ Path: ").concat(n," ~ Message: ").concat(e.message)})).join(" | "),c=wn.error.badRequest(s);throw c.detail=a,vn(c,e)}u.push(i.data)}));var c=r.apply(void 0,De(u));return Nt.isPromise(c)?new Promise((function(t,n){c.then((function(e){if(!Nt.isNull(a)&&Nt.isFunction(a))return a(e);t(c)})).catch((function(t){var r=vn(t,e);if(!Nt.isNull(s)&&Nt.isFunction(s))return s(r);n(r)}))})):c}catch(t){if(!Nt.isNull(s)&&Nt.isFunction(s))return s(t);throw vn(t,e)}}function Wn(e){return Fn.apply(this,arguments)}function Fn(){return(Fn=Ne((function(e){return Le(this,(function(t){return[2,zn("login",[],[e],Ne((function(){return Le(this,(function(e){switch(e.label){case 0:return Ge.isMp?[4,Sn.jumpAndGetToken(l.ZOAUTH)]:[3,2];case 1:return e.sent(),[2,"Success"];case 2:return Ge.isMpWeb?[2,Promise.resolve("")]:[2,Promise.reject(He("login",{}))]}}))})))]}))}))).apply(this,arguments)}function Gn(e){return Vn.apply(this,arguments)}function Vn(){return(Vn=Ne((function(e){return Le(this,(function(t){return[2,zn("getAccessToken",[],[e],Ne((function(){var e;return Le(this,(function(t){switch(t.label){case 0:return Ge.isMp?[4,Ln()]:[3,3];case 1:return e=!t.sent(),[4,Sn.getAccessToken(e)];case 2:return[2,t.sent()||""];case 3:return Ge.isMpWeb?[2,Promise.resolve("")]:[2,Promise.reject(He("getAccessToken",{}))]}}))})))]}))}))).apply(this,arguments)}var Hn,Kn="2.51.0-beta.3";function Jn(){return zn("getVersion",[],[],(function(){return Kn}))}function qn(){var e;return{version:Nn("version-id")||"",apiVersion:Kn,zaloVersion:String(dn()),platform:(null===(e=Fe())||void 0===e?void 0:e.platformName)||"",language:navigator.language,zaloLanguage:window.zLanguage||"vi",zaloTheme:window.zTheme||"light"}}function Qn(){return zn("getSystemInfo",[],[],(function(){return qn()}))}!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}(Hn||(Hn={}));const Yn=Hn.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),$n=e=>{switch(typeof e){case"undefined":return Yn.undefined;case"string":return Yn.string;case"number":return isNaN(e)?Yn.nan:Yn.number;case"boolean":return Yn.boolean;case"function":return Yn.function;case"bigint":return Yn.bigint;case"symbol":return Yn.symbol;case"object":return Array.isArray(e)?Yn.array:null===e?Yn.null:e.then&&"function"==typeof e.then&&e.catch&&"function"==typeof e.catch?Yn.promise:"undefined"!=typeof Map&&e instanceof Map?Yn.map:"undefined"!=typeof Set&&e instanceof Set?Yn.set:"undefined"!=typeof Date&&e instanceof Date?Yn.date:Yn.object;default:return Yn.unknown}},Xn=Hn.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 er 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,Hn.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()}}er.create=e=>new er(e);const tr=(e,t)=>{let n;switch(e.code){case Xn.invalid_type:n=e.received===Yn.undefined?"Required":`Expected ${e.expected}, received ${e.received}`;break;case Xn.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(e.expected,Hn.jsonStringifyReplacer)}`;break;case Xn.unrecognized_keys:n=`Unrecognized key(s) in object: ${Hn.joinValues(e.keys,", ")}`;break;case Xn.invalid_union:n="Invalid input";break;case Xn.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${Hn.joinValues(e.options)}`;break;case Xn.invalid_enum_value:n=`Invalid enum value. Expected ${Hn.joinValues(e.options)}, received '${e.received}'`;break;case Xn.invalid_arguments:n="Invalid function arguments";break;case Xn.invalid_return_type:n="Invalid function return type";break;case Xn.invalid_date:n="Invalid date";break;case Xn.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}"`:Hn.assertNever(e.validation):n="regex"!==e.validation?`Invalid ${e.validation}`:"Invalid";break;case Xn.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 Xn.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 Xn.custom:n="Invalid input";break;case Xn.invalid_intersection_types:n="Intersection results could not be merged";break;case Xn.not_multiple_of:n=`Number must be a multiple of ${e.multipleOf}`;break;case Xn.not_finite:n="Number must be finite";break;default:n=t.defaultError,Hn.assertNever(e)}return{message:n}};let nr=tr;function rr(){return nr}const ir=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 or(e,t){const n=ir({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,rr(),tr].filter((e=>!!e))});e.common.issues.push(n)}class ar{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 sr;"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 ar.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 sr;if("aborted"===i.status)return sr;"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 sr=Object.freeze({status:"aborted"}),ur=e=>({status:"dirty",value:e}),cr=e=>({status:"valid",value:e}),lr=e=>"aborted"===e.status,dr=e=>"dirty"===e.status,pr=e=>"valid"===e.status,fr=e=>"undefined"!=typeof Promise&&e instanceof Promise;var hr;!function(e){e.errToObj=e=>"string"==typeof e?{message:e}:e||{},e.toString=e=>"string"==typeof e?e:null==e?void 0:e.message}(hr||(hr={}));class mr{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 vr=(e,t)=>{if(pr(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 er(e.common.issues)}};function yr(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 gr{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 $n(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:$n(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new ar,ctx:{common:e.parent.common,data:e.data,parsedType:$n(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const t=this._parse(e);if(fr(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:$n(e)},i=this._parseSync({data:e,path:r.path,parent:r});return vr(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:$n(e)},r=this._parse({data:e,path:n.path,parent:n}),i=await(fr(r)?r:Promise.resolve(r));return vr(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:Xn.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 ni({schema:this,typeName:fi.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}optional(){return ri.create(this,this._def)}nullable(){return ii.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Lr.create(this,this._def)}promise(){return ti.create(this,this._def)}or(e){return Zr.create([this,e],this._def)}and(e){return Gr.create(this,e,this._def)}transform(e){return new ni({...yr(this._def),schema:this,typeName:fi.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const t="function"==typeof e?e:()=>e;return new oi({...yr(this._def),innerType:this,defaultValue:t,typeName:fi.ZodDefault})}brand(){return new ci({typeName:fi.ZodBranded,type:this,...yr(this._def)})}catch(e){const t="function"==typeof e?e:()=>e;return new ai({...yr(this._def),innerType:this,catchValue:t,typeName:fi.ZodCatch})}describe(e){return new(0,this.constructor)({...this._def,description:e})}pipe(e){return li.create(this,e)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const _r=/^c[^\s-]{8,}$/i,wr=/^[a-z][a-z0-9]*$/,Tr=/^([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,br=/^(([^<>()[\]\\.,;:\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 Er extends gr{constructor(){super(...arguments),this._regex=(e,t,n)=>this.refinement((t=>e.test(t)),{validation:t,code:Xn.invalid_string,...hr.errToObj(n)}),this.nonempty=e=>this.min(1,hr.errToObj(e)),this.trim=()=>new Er({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}_parse(e){this._def.coerce&&(e.data=String(e.data));if(this._getType(e)!==Yn.string){const t=this._getOrReturnCtx(e);return or(t,{code:Xn.invalid_type,expected:Yn.string,received:t.parsedType}),sr}const t=new ar;let n;for(const i of this._def.checks)if("min"===i.kind)e.data.length<i.value&&(n=this._getOrReturnCtx(e,n),or(n,{code:Xn.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),or(n,{code:Xn.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?or(n,{code:Xn.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}):o&&or(n,{code:Xn.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}),t.dirty())}else if("email"===i.kind)br.test(e.data)||(n=this._getOrReturnCtx(e,n),or(n,{validation:"email",code:Xn.invalid_string,message:i.message}),t.dirty());else if("uuid"===i.kind)Tr.test(e.data)||(n=this._getOrReturnCtx(e,n),or(n,{validation:"uuid",code:Xn.invalid_string,message:i.message}),t.dirty());else if("cuid"===i.kind)_r.test(e.data)||(n=this._getOrReturnCtx(e,n),or(n,{validation:"cuid",code:Xn.invalid_string,message:i.message}),t.dirty());else if("cuid2"===i.kind)wr.test(e.data)||(n=this._getOrReturnCtx(e,n),or(n,{validation:"cuid2",code:Xn.invalid_string,message:i.message}),t.dirty());else if("url"===i.kind)try{new URL(e.data)}catch(r){n=this._getOrReturnCtx(e,n),or(n,{validation:"url",code:Xn.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),or(n,{validation:"regex",code:Xn.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),or(n,{code:Xn.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),or(n,{code:Xn.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),or(n,{code:Xn.invalid_string,validation:"datetime",message:i.message}),t.dirty())}else Hn.assertNever(i);var r;return{status:t.value,value:e.data}}_addCheck(e){return new Er({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...hr.errToObj(e)})}url(e){return this._addCheck({kind:"url",...hr.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...hr.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...hr.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...hr.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,...hr.errToObj(null==e?void 0:e.message)})}regex(e,t){return this._addCheck({kind:"regex",regex:e,...hr.errToObj(t)})}startsWith(e,t){return this._addCheck({kind:"startsWith",value:e,...hr.errToObj(t)})}endsWith(e,t){return this._addCheck({kind:"endsWith",value:e,...hr.errToObj(t)})}min(e,t){return this._addCheck({kind:"min",value:e,...hr.errToObj(t)})}max(e,t){return this._addCheck({kind:"max",value:e,...hr.errToObj(t)})}length(e,t){return this._addCheck({kind:"length",value:e,...hr.errToObj(t)})}get isDatetime(){return!!this._def.checks.find((e=>"datetime"===e.kind))}get isEmail(){return!!this._def.checks.find((e=>"email"===e.kind))}get isURL(){return!!this._def.checks.find((e=>"url"===e.kind))}get isUUID(){return!!this._def.checks.find((e=>"uuid"===e.kind))}get isCUID(){return!!this._def.checks.find((e=>"cuid"===e.kind))}get isCUID2(){return!!this._def.checks.find((e=>"cuid2"===e.kind))}get minLength(){let e=null;for(const t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return e}get maxLength(){let e=null;for(const t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return e}}function Pr(e,t){const n=(e.toString().split(".")[1]||"").length,r=(t.toString().split(".")[1]||"").length,i=n>r?n:r;return parseInt(e.toFixed(i).replace(".",""))%parseInt(t.toFixed(i).replace(".",""))/Math.pow(10,i)}Er.create=e=>{var t;return new Er({checks:[],typeName:fi.ZodString,coerce:null!==(t=null==e?void 0:e.coerce)&&void 0!==t&&t,...yr(e)})};class Sr extends gr{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)!==Yn.number){const t=this._getOrReturnCtx(e);return or(t,{code:Xn.invalid_type,expected:Yn.number,received:t.parsedType}),sr}let t;const n=new ar;for(const r of this._def.checks)if("int"===r.kind)Hn.isInteger(e.data)||(t=this._getOrReturnCtx(e,t),or(t,{code:Xn.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),or(t,{code:Xn.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),or(t,{code:Xn.too_big,maximum:r.value,type:"number",inclusive:r.inclusive,exact:!1,message:r.message}),n.dirty())}else"multipleOf"===r.kind?0!==Pr(e.data,r.value)&&(t=this._getOrReturnCtx(e,t),or(t,{code:Xn.not_multiple_of,multipleOf:r.value,message:r.message}),n.dirty()):"finite"===r.kind?Number.isFinite(e.data)||(t=this._getOrReturnCtx(e,t),or(t,{code:Xn.not_finite,message:r.message}),n.dirty()):Hn.assertNever(r);return{status:n.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,hr.toString(t))}gt(e,t){return this.setLimit("min",e,!1,hr.toString(t))}lte(e,t){return this.setLimit("max",e,!0,hr.toString(t))}lt(e,t){return this.setLimit("max",e,!1,hr.toString(t))}setLimit(e,t,n,r){return new Sr({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:n,message:hr.toString(r)}]})}_addCheck(e){return new Sr({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:hr.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:hr.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:hr.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:hr.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:hr.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:hr.toString(t)})}finite(e){return this._addCheck({kind:"finite",message:hr.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&&Hn.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)}}Sr.create=e=>new Sr({checks:[],typeName:fi.ZodNumber,coerce:(null==e?void 0:e.coerce)||!1,...yr(e)});class Ir extends gr{_parse(e){this._def.coerce&&(e.data=BigInt(e.data));if(this._getType(e)!==Yn.bigint){const t=this._getOrReturnCtx(e);return or(t,{code:Xn.invalid_type,expected:Yn.bigint,received:t.parsedType}),sr}return cr(e.data)}}Ir.create=e=>{var t;return new Ir({typeName:fi.ZodBigInt,coerce:null!==(t=null==e?void 0:e.coerce)&&void 0!==t&&t,...yr(e)})};class Ar extends gr{_parse(e){this._def.coerce&&(e.data=Boolean(e.data));if(this._getType(e)!==Yn.boolean){const t=this._getOrReturnCtx(e);return or(t,{code:Xn.invalid_type,expected:Yn.boolean,received:t.parsedType}),sr}return cr(e.data)}}Ar.create=e=>new Ar({typeName:fi.ZodBoolean,coerce:(null==e?void 0:e.coerce)||!1,...yr(e)});class Or extends gr{_parse(e){this._def.coerce&&(e.data=new Date(e.data));if(this._getType(e)!==Yn.date){const t=this._getOrReturnCtx(e);return or(t,{code:Xn.invalid_type,expected:Yn.date,received:t.parsedType}),sr}if(isNaN(e.data.getTime())){return or(this._getOrReturnCtx(e),{code:Xn.invalid_date}),sr}const t=new ar;let n;for(const r of this._def.checks)"min"===r.kind?e.data.getTime()<r.value&&(n=this._getOrReturnCtx(e,n),or(n,{code:Xn.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),or(n,{code:Xn.too_big,message:r.message,inclusive:!0,exact:!1,maximum:r.value,type:"date"}),t.dirty()):Hn.assertNever(r);return{status:t.value,value:new Date(e.data.getTime())}}_addCheck(e){return new Or({...this._def,checks:[...this._def.checks,e]})}min(e,t){return this._addCheck({kind:"min",value:e.getTime(),message:hr.toString(t)})}max(e,t){return this._addCheck({kind:"max",value:e.getTime(),message:hr.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}}Or.create=e=>new Or({checks:[],coerce:(null==e?void 0:e.coerce)||!1,typeName:fi.ZodDate,...yr(e)});class kr extends gr{_parse(e){if(this._getType(e)!==Yn.symbol){const t=this._getOrReturnCtx(e);return or(t,{code:Xn.invalid_type,expected:Yn.symbol,received:t.parsedType}),sr}return cr(e.data)}}kr.create=e=>new kr({typeName:fi.ZodSymbol,...yr(e)});class Cr extends gr{_parse(e){if(this._getType(e)!==Yn.undefined){const t=this._getOrReturnCtx(e);return or(t,{code:Xn.invalid_type,expected:Yn.undefined,received:t.parsedType}),sr}return cr(e.data)}}Cr.create=e=>new Cr({typeName:fi.ZodUndefined,...yr(e)});class Nr extends gr{_parse(e){if(this._getType(e)!==Yn.null){const t=this._getOrReturnCtx(e);return or(t,{code:Xn.invalid_type,expected:Yn.null,received:t.parsedType}),sr}return cr(e.data)}}Nr.create=e=>new Nr({typeName:fi.ZodNull,...yr(e)});class Mr extends gr{constructor(){super(...arguments),this._any=!0}_parse(e){return cr(e.data)}}Mr.create=e=>new Mr({typeName:fi.ZodAny,...yr(e)});class Rr extends gr{constructor(){super(...arguments),this._unknown=!0}_parse(e){return cr(e.data)}}Rr.create=e=>new Rr({typeName:fi.ZodUnknown,...yr(e)});class xr extends gr{_parse(e){const t=this._getOrReturnCtx(e);return or(t,{code:Xn.invalid_type,expected:Yn.never,received:t.parsedType}),sr}}xr.create=e=>new xr({typeName:fi.ZodNever,...yr(e)});class Dr extends gr{_parse(e){if(this._getType(e)!==Yn.undefined){const t=this._getOrReturnCtx(e);return or(t,{code:Xn.invalid_type,expected:Yn.void,received:t.parsedType}),sr}return cr(e.data)}}Dr.create=e=>new Dr({typeName:fi.ZodVoid,...yr(e)});class Lr extends gr{_parse(e){const{ctx:t,status:n}=this._processInputParams(e),r=this._def;if(t.parsedType!==Yn.array)return or(t,{code:Xn.invalid_type,expected:Yn.array,received:t.parsedType}),sr;if(null!==r.exactLength){const e=t.data.length>r.exactLength.value,i=t.data.length<r.exactLength.value;(e||i)&&(or(t,{code:e?Xn.too_big:Xn.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&&(or(t,{code:Xn.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&&(or(t,{code:Xn.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 mr(t,e,t.path,n))))).then((e=>ar.mergeArray(n,e)));const i=[...t.data].map(((e,n)=>r.type._parseSync(new mr(t,e,t.path,n))));return ar.mergeArray(n,i)}get element(){return this._def.type}min(e,t){return new Lr({...this._def,minLength:{value:e,message:hr.toString(t)}})}max(e,t){return new Lr({...this._def,maxLength:{value:e,message:hr.toString(t)}})}length(e,t){return new Lr({...this._def,exactLength:{value:e,message:hr.toString(t)}})}nonempty(e){return this.min(1,e)}}var Ur;function jr(e){if(e instanceof Br){const t={};for(const n in e.shape){const r=e.shape[n];t[n]=ri.create(jr(r))}return new Br({...e._def,shape:()=>t})}return e instanceof Lr?Lr.create(jr(e.element)):e instanceof ri?ri.create(jr(e.unwrap())):e instanceof ii?ii.create(jr(e.unwrap())):e instanceof Vr?Vr.create(e.items.map((e=>jr(e)))):e}Lr.create=(e,t)=>new Lr({type:e,minLength:null,maxLength:null,exactLength:null,typeName:fi.ZodArray,...yr(t)}),function(e){e.mergeShapes=(e,t)=>({...e,...t})}(Ur||(Ur={}));class Br extends gr{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=Hn.objectKeys(e);return this._cached={shape:e,keys:t}}_parse(e){if(this._getType(e)!==Yn.object){const t=this._getOrReturnCtx(e);return or(t,{code:Xn.invalid_type,expected:Yn.object,received:t.parsedType}),sr}const{status:t,ctx:n}=this._processInputParams(e),{shape:r,keys:i}=this._getCached(),o=[];if(!(this._def.catchall instanceof xr&&"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 mr(n,i,n.path,e)),alwaysSet:e in n.data})}if(this._def.catchall instanceof xr){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&&(or(n,{code:Xn.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 mr(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=>ar.mergeObjectSync(t,e))):ar.mergeObjectSync(t,a)}get shape(){return this._def.shape()}strict(e){return hr.errToObj,new Br({...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=hr.errToObj(e).message)&&void 0!==a?a:s}:{message:s}}}:{}})}strip(){return new Br({...this._def,unknownKeys:"strip"})}passthrough(){return new Br({...this._def,unknownKeys:"passthrough"})}extend(e){return new Br({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new Br({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>Ur.mergeShapes(this._def.shape(),e._def.shape()),typeName:fi.ZodObject})}setKey(e,t){return this.augment({[e]:t})}catchall(e){return new Br({...this._def,catchall:e})}pick(e){const t={};return Hn.objectKeys(e).forEach((n=>{e[n]&&this.shape[n]&&(t[n]=this.shape[n])})),new Br({...this._def,shape:()=>t})}omit(e){const t={};return Hn.objectKeys(this.shape).forEach((n=>{e[n]||(t[n]=this.shape[n])})),new Br({...this._def,shape:()=>t})}deepPartial(){return jr(this)}partial(e){const t={};return Hn.objectKeys(this.shape).forEach((n=>{const r=this.shape[n];e&&!e[n]?t[n]=r:t[n]=r.optional()})),new Br({...this._def,shape:()=>t})}required(e){const t={};return Hn.objectKeys(this.shape).forEach((n=>{if(e&&!e[n])t[n]=this.shape[n];else{let e=this.shape[n];for(;e instanceof ri;)e=e._def.innerType;t[n]=e}})),new Br({...this._def,shape:()=>t})}keyof(){return $r(Hn.objectKeys(this.shape))}}Br.create=(e,t)=>new Br({shape:()=>e,unknownKeys:"strip",catchall:xr.create(),typeName:fi.ZodObject,...yr(t)}),Br.strictCreate=(e,t)=>new Br({shape:()=>e,unknownKeys:"strict",catchall:xr.create(),typeName:fi.ZodObject,...yr(t)}),Br.lazycreate=(e,t)=>new Br({shape:e,unknownKeys:"strip",catchall:xr.create(),typeName:fi.ZodObject,...yr(t)});class Zr extends gr{_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 er(e.ctx.common.issues)));return or(t,{code:Xn.invalid_union,unionErrors:n}),sr}));{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 er(e)));return or(t,{code:Xn.invalid_union,unionErrors:i}),sr}}get options(){return this._def.options}}Zr.create=(e,t)=>new Zr({options:e,typeName:fi.ZodUnion,...yr(t)});const zr=e=>e instanceof Qr?zr(e.schema):e instanceof ni?zr(e.innerType()):e instanceof Yr?[e.value]:e instanceof Xr?e.options:e instanceof ei?Object.keys(e.enum):e instanceof oi?zr(e._def.innerType):e instanceof Cr?[void 0]:e instanceof Nr?[null]:null;class Wr extends gr{_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==Yn.object)return or(t,{code:Xn.invalid_type,expected:Yn.object,received:t.parsedType}),sr;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}):(or(t,{code:Xn.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[n]}),sr)}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=zr(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 Wr({typeName:fi.ZodDiscriminatedUnion,discriminator:e,options:t,optionsMap:r,...yr(n)})}}function Fr(e,t){const n=$n(e),r=$n(t);if(e===t)return{valid:!0,data:e};if(n===Yn.object&&r===Yn.object){const n=Hn.objectKeys(t),r=Hn.objectKeys(e).filter((e=>-1!==n.indexOf(e))),i={...e,...t};for(const n of r){const r=Fr(e[n],t[n]);if(!r.valid)return{valid:!1};i[n]=r.data}return{valid:!0,data:i}}if(n===Yn.array&&r===Yn.array){if(e.length!==t.length)return{valid:!1};const n=[];for(let r=0;r<e.length;r++){const i=Fr(e[r],t[r]);if(!i.valid)return{valid:!1};n.push(i.data)}return{valid:!0,data:n}}return n===Yn.date&&r===Yn.date&&+e==+t?{valid:!0,data:e}:{valid:!1}}class Gr extends gr{_parse(e){const{status:t,ctx:n}=this._processInputParams(e),r=(e,r)=>{if(lr(e)||lr(r))return sr;const i=Fr(e.value,r.value);return i.valid?((dr(e)||dr(r))&&t.dirty(),{status:t.value,value:i.data}):(or(n,{code:Xn.invalid_intersection_types}),sr)};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}))}}Gr.create=(e,t,n)=>new Gr({left:e,right:t,typeName:fi.ZodIntersection,...yr(n)});class Vr extends gr{_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==Yn.array)return or(n,{code:Xn.invalid_type,expected:Yn.array,received:n.parsedType}),sr;if(n.data.length<this._def.items.length)return or(n,{code:Xn.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),sr;!this._def.rest&&n.data.length>this._def.items.length&&(or(n,{code:Xn.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 mr(n,e,n.path,t)):null})).filter((e=>!!e));return n.common.async?Promise.all(r).then((e=>ar.mergeArray(t,e))):ar.mergeArray(t,r)}get items(){return this._def.items}rest(e){return new Vr({...this._def,rest:e})}}Vr.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Vr({items:e,typeName:fi.ZodTuple,rest:null,...yr(t)})};class Hr extends gr{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!==Yn.object)return or(n,{code:Xn.invalid_type,expected:Yn.object,received:n.parsedType}),sr;const r=[],i=this._def.keyType,o=this._def.valueType;for(const e in n.data)r.push({key:i._parse(new mr(n,e,n.path,e)),value:o._parse(new mr(n,n.data[e],n.path,e))});return n.common.async?ar.mergeObjectAsync(t,r):ar.mergeObjectSync(t,r)}get element(){return this._def.valueType}static create(e,t,n){return new Hr(t instanceof gr?{keyType:e,valueType:t,typeName:fi.ZodRecord,...yr(n)}:{keyType:Er.create(),valueType:e,typeName:fi.ZodRecord,...yr(t)})}}class Kr extends gr{_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==Yn.map)return or(n,{code:Xn.invalid_type,expected:Yn.map,received:n.parsedType}),sr;const r=this._def.keyType,i=this._def.valueType,o=[...n.data.entries()].map((([e,t],o)=>({key:r._parse(new mr(n,e,n.path,[o,"key"])),value:i._parse(new mr(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 sr;"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 sr;"dirty"!==r.status&&"dirty"!==i.status||t.dirty(),e.set(r.value,i.value)}return{status:t.value,value:e}}}}Kr.create=(e,t,n)=>new Kr({valueType:t,keyType:e,typeName:fi.ZodMap,...yr(n)});class Jr extends gr{_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==Yn.set)return or(n,{code:Xn.invalid_type,expected:Yn.set,received:n.parsedType}),sr;const r=this._def;null!==r.minSize&&n.data.size<r.minSize.value&&(or(n,{code:Xn.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&&(or(n,{code:Xn.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 sr;"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 mr(n,e,n.path,t))));return n.common.async?Promise.all(a).then((e=>o(e))):o(a)}min(e,t){return new Jr({...this._def,minSize:{value:e,message:hr.toString(t)}})}max(e,t){return new Jr({...this._def,maxSize:{value:e,message:hr.toString(t)}})}size(e,t){return this.min(e,t).max(e,t)}nonempty(e){return this.min(1,e)}}Jr.create=(e,t)=>new Jr({valueType:e,minSize:null,maxSize:null,typeName:fi.ZodSet,...yr(t)});class qr extends gr{constructor(){super(...arguments),this.validate=this.implement}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==Yn.function)return or(t,{code:Xn.invalid_type,expected:Yn.function,received:t.parsedType}),sr;function n(e,n){return ir({data:e,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,rr(),tr].filter((e=>!!e)),issueData:{code:Xn.invalid_arguments,argumentsError:n}})}function r(e,n){return ir({data:e,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,rr(),tr].filter((e=>!!e)),issueData:{code:Xn.invalid_return_type,returnTypeError:n}})}const i={errorMap:t.common.contextualErrorMap},o=t.data;return this._def.returns instanceof ti?cr((async(...e)=>{const t=new er([]),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}))})):cr(((...e)=>{const t=this._def.args.safeParse(e,i);if(!t.success)throw new er([n(e,t.error)]);const a=o(...t.data),s=this._def.returns.safeParse(a,i);if(!s.success)throw new er([r(a,s.error)]);return s.data}))}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new qr({...this._def,args:Vr.create(e).rest(Rr.create())})}returns(e){return new qr({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,t,n){return new qr({args:e||Vr.create([]).rest(Rr.create()),returns:t||Rr.create(),typeName:fi.ZodFunction,...yr(n)})}}class Qr extends gr{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})}}Qr.create=(e,t)=>new Qr({getter:e,typeName:fi.ZodLazy,...yr(t)});class Yr extends gr{_parse(e){if(e.data!==this._def.value){const t=this._getOrReturnCtx(e);return or(t,{received:t.data,code:Xn.invalid_literal,expected:this._def.value}),sr}return{status:"valid",value:e.data}}get value(){return this._def.value}}function $r(e,t){return new Xr({values:e,typeName:fi.ZodEnum,...yr(t)})}Yr.create=(e,t)=>new Yr({value:e,typeName:fi.ZodLiteral,...yr(t)});class Xr extends gr{_parse(e){if("string"!=typeof e.data){const t=this._getOrReturnCtx(e),n=this._def.values;return or(t,{expected:Hn.joinValues(n),received:t.parsedType,code:Xn.invalid_type}),sr}if(-1===this._def.values.indexOf(e.data)){const t=this._getOrReturnCtx(e),n=this._def.values;return or(t,{received:t.data,code:Xn.invalid_enum_value,options:n}),sr}return cr(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 Xr.create(e)}exclude(e){return Xr.create(this.options.filter((t=>!e.includes(t))))}}Xr.create=$r;class ei extends gr{_parse(e){const t=Hn.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(e);if(n.parsedType!==Yn.string&&n.parsedType!==Yn.number){const e=Hn.objectValues(t);return or(n,{expected:Hn.joinValues(e),received:n.parsedType,code:Xn.invalid_type}),sr}if(-1===t.indexOf(e.data)){const e=Hn.objectValues(t);return or(n,{received:n.data,code:Xn.invalid_enum_value,options:e}),sr}return cr(e.data)}get enum(){return this._def.values}}ei.create=(e,t)=>new ei({values:e,typeName:fi.ZodNativeEnum,...yr(t)});class ti extends gr{unwrap(){return this._def.type}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==Yn.promise&&!1===t.common.async)return or(t,{code:Xn.invalid_type,expected:Yn.promise,received:t.parsedType}),sr;const n=t.parsedType===Yn.promise?t.data:Promise.resolve(t.data);return cr(n.then((e=>this._def.type.parseAsync(e,{path:t.path,errorMap:t.common.contextualErrorMap}))))}}ti.create=(e,t)=>new ti({type:e,typeName:fi.ZodPromise,...yr(t)});class ni extends gr{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===fi.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=>{or(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?sr:("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?sr:("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(!pr(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=>pr(e)?Promise.resolve(r.transform(e.value,i)).then((e=>({status:t.value,value:e}))):e))}Hn.assertNever(r)}}ni.create=(e,t,n)=>new ni({schema:e,typeName:fi.ZodEffects,effect:t,...yr(n)}),ni.createWithPreprocess=(e,t,n)=>new ni({schema:t,effect:{type:"preprocess",transform:e},typeName:fi.ZodEffects,...yr(n)});class ri extends gr{_parse(e){return this._getType(e)===Yn.undefined?cr(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}ri.create=(e,t)=>new ri({innerType:e,typeName:fi.ZodOptional,...yr(t)});class ii extends gr{_parse(e){return this._getType(e)===Yn.null?cr(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}ii.create=(e,t)=>new ii({innerType:e,typeName:fi.ZodNullable,...yr(t)});class oi extends gr{_parse(e){const{ctx:t}=this._processInputParams(e);let n=t.data;return t.parsedType===Yn.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:t.path,parent:t})}removeDefault(){return this._def.innerType}}oi.create=(e,t)=>new oi({innerType:e,typeName:fi.ZodDefault,defaultValue:"function"==typeof t.default?t.default:()=>t.default,...yr(t)});class ai extends gr{_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 fr(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}}ai.create=(e,t)=>new ai({innerType:e,typeName:fi.ZodCatch,catchValue:"function"==typeof t.catch?t.catch:()=>t.catch,...yr(t)});class si extends gr{_parse(e){if(this._getType(e)!==Yn.nan){const t=this._getOrReturnCtx(e);return or(t,{code:Xn.invalid_type,expected:Yn.nan,received:t.parsedType}),sr}return{status:"valid",value:e.data}}}si.create=e=>new si({typeName:fi.ZodNaN,...yr(e)});const ui=Symbol("zod_brand");class ci extends gr{_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 li extends gr{_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?sr:"dirty"===e.status?(t.dirty(),ur(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?sr:"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 li({in:e,out:t,typeName:fi.ZodPipeline})}}const di=(e,t={},n)=>e?Mr.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})}})):Mr.create(),pi={object:Br.lazycreate};var fi;!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"}(fi||(fi={}));const hi=Er.create,mi=Sr.create,vi=si.create,yi=Ir.create,gi=Ar.create,_i=Or.create,wi=kr.create,Ti=Cr.create,bi=Nr.create,Ei=Mr.create,Pi=Rr.create,Si=xr.create,Ii=Dr.create,Ai=Lr.create,Oi=Br.create,ki=Br.strictCreate,Ci=Zr.create,Ni=Wr.create,Mi=Gr.create,Ri=Vr.create,xi=Hr.create,Di=Kr.create,Li=Jr.create,Ui=qr.create,ji=Qr.create,Bi=Yr.create,Zi=Xr.create,zi=ei.create,Wi=ti.create,Fi=ni.create,Gi=ri.create,Vi=ii.create,Hi=ni.createWithPreprocess,Ki=li.create,Ji={string:e=>Er.create({...e,coerce:!0}),number:e=>Sr.create({...e,coerce:!0}),boolean:e=>Ar.create({...e,coerce:!0}),bigint:e=>Ir.create({...e,coerce:!0}),date:e=>Or.create({...e,coerce:!0})},qi=sr;var Qi=Object.freeze({__proto__:null,defaultErrorMap:tr,setErrorMap:function(e){nr=e},getErrorMap:rr,makeIssue:ir,EMPTY_PATH:[],addIssueToContext:or,ParseStatus:ar,INVALID:sr,DIRTY:ur,OK:cr,isAborted:lr,isDirty:dr,isValid:pr,isAsync:fr,get util(){return Hn},ZodParsedType:Yn,getParsedType:$n,ZodType:gr,ZodString:Er,ZodNumber:Sr,ZodBigInt:Ir,ZodBoolean:Ar,ZodDate:Or,ZodSymbol:kr,ZodUndefined:Cr,ZodNull:Nr,ZodAny:Mr,ZodUnknown:Rr,ZodNever:xr,ZodVoid:Dr,ZodArray:Lr,get objectUtil(){return Ur},ZodObject:Br,ZodUnion:Zr,ZodDiscriminatedUnion:Wr,ZodIntersection:Gr,ZodTuple:Vr,ZodRecord:Hr,ZodMap:Kr,ZodSet:Jr,ZodFunction:qr,ZodLazy:Qr,ZodLiteral:Yr,ZodEnum:Xr,ZodNativeEnum:ei,ZodPromise:ti,ZodEffects:ni,ZodTransformer:ni,ZodOptional:ri,ZodNullable:ii,ZodDefault:oi,ZodCatch:ai,ZodNaN:si,BRAND:ui,ZodBranded:ci,ZodPipeline:li,custom:di,Schema:gr,ZodSchema:gr,late:pi,get ZodFirstPartyTypeKind(){return fi},coerce:Ji,any:Ei,array:Ai,bigint:yi,boolean:gi,date:_i,discriminatedUnion:Ni,effect:Fi,enum:Zi,function:Ui,instanceof:(e,t={message:`Input not instance of ${e.name}`})=>di((t=>t instanceof e),t,!0),intersection:Mi,lazy:ji,literal:Bi,map:Di,nan:vi,nativeEnum:zi,never:Si,null:bi,nullable:Vi,number:mi,object:Oi,oboolean:()=>gi().optional(),onumber:()=>mi().optional(),optional:Gi,ostring:()=>hi().optional(),pipeline:Ki,preprocess:Hi,promise:Wi,record:xi,set:Li,strictObject:ki,string:hi,symbol:wi,transformer:Fi,tuple:Ri,undefined:Ti,union:Ci,unknown:Pi,void:Ii,NEVER:qi,ZodIssueCode:Xn,quotelessJson:e=>JSON.stringify(e,null,2).replace(/"([^"]+)":/g,"$1:"),ZodError:er}),Yi=function(){function t(){var e,n,r,i,a,u,c,l,d,p,f,h,m,v,y,g,_,w,T,b,E,P,S,I,A,O,k;Mt(this,t),this.initConfig=window.APP_CONFIG;var C=Nt.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?X:ee;this.hideIOSSafeAreaBottom=!!(null===(u=this.initConfig)||void 0===u||null===(c=u.app)||void 0===c?void 0:c.hideIOSSafeAreaBottom),this.hideAndroidBottomNavigationBar=!!(null===(l=this.initConfig)||void 0===l||null===(d=l.app)||void 0===d?void 0:d.hideAndroidBottomNavigationBar);var N,M,R="none"===(null===(p=this.initConfig)||void 0===p||null===(f=p.app)||void 0===f?void 0:f.leftButton)||"home"===(null===(h=this.initConfig)||void 0===h||null===(m=h.app)||void 0===m?void 0:m.leftButton)?$.HIDE_BACK:$.SHOW_BACK,x="home"===(null===(v=this.initConfig)||void 0===v||null===(y=v.app)||void 0===y?void 0:y.leftButton)||"both"===(null===(g=this.initConfig)||void 0===g||null===(_=g.app)||void 0===_?void 0:_.leftButton)?$.SHOW_HOME:$.HIDE_HOME,D=new URL(location.href),L=Rn(null===(w=this.initConfig)||void 0===w||null===(T=w.app)||void 0===T?void 0:T.statusBar);"boolean"==typeof(null===(b=this.initConfig)||void 0===b||null===(E=b.app)||void 0===E?void 0:E.actionBarHidden)&&(C=(null===(N=this.initConfig)||void 0===N||null===(M=N.app)||void 0===M?void 0:M.actionBarHidden)?ee:X);this.config={actionbarType:C,buttonType:R,statusbarType:L,dataConfig:{backgroundColor:(null===(P=this.initConfig)||void 0===P||null===(S=P.app)||void 0===S?void 0:S.headerColor)||te,textColor:(null===(I=this.initConfig)||void 0===I||null===(A=I.app)||void 0===A?void 0:A.textColor)||"",textAlign:(null===(O=this.initConfig)||void 0===O||null===(k=O.app)||void 0===k?void 0:k.textAlign)||ne,viewInLeftType:R,confirmToExit:1},homeConfig:{enable:x,url:"".concat(s,"/").concat(o,"/").concat(D.search)}}}var n=t.prototype;return n.setNavigationBarTitle=function(e){return Ne((function(){return Le(this,(function(t){return[2,new Promise((function(t,n){bn("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 Ne((function(){var r,i;return Le(this,(function(o){return void 0===(void 0===e?"undefined":Pt(e))&&null===(void 0===e?"undefined":Pt(e))||(r="none"===e||"home"===e?$.HIDE_BACK:$.SHOW_BACK,i="home"===e||"both"===e?$.SHOW_HOME:$.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){bn("CHANGE_ACTIONBAR_LEFTBUTTON_TYPE",Je({},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 Ne((function(){var r,i,o;return Le(this,(function(a){return i=t?e.AndroidBottomNavigationBarType.hide:e.AndroidBottomNavigationBarType.show,o=null===(r=Fe())||void 0===r?void 0:r.platform,[2,new Promise((function(e,r){if(!(null==o?void 0:o.isAndroid))return e();bn("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 Ne((function(){var r,i,o;return Le(this,(function(a){return i=t?e.IOSSafeAreaBottomType.hide:e.IOSSafeAreaBottomType.show,o=null===(r=Fe())||void 0===r?void 0:r.platform,[2,new Promise((function(e,r){if(!(null==o?void 0:o.isIOS))return e();bn("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 Ne((function(){var r;return Le(this,(function(i){return r=n.config,Nt.isString(t.headerColor)&&(r.dataConfig.backgroundColor=t.headerColor),Nt.isString(t.headerTextColor)&&(r.dataConfig.textColor=t.headerTextColor),Nt.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=ee:!1===t.hideActionBar&&(r.actionbarType=X),"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){bn("CHANGE_ACTIONBAR",Je({},r),{success:function(){var o;n.config=Je({},r);var a,s=null===(o=Fe())||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===ee;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}(),$i=Yi.getInstance(),Xi=[Oi({title:hi()}).optional()];function eo(e){return to.apply(this,arguments)}function to(){return to=Ne((function(e){return Le(this,(function(t){return[2,zn("setNavigationBarTitle",Xi,[e],function(){var e=Ne((function(e){return Le(this,(function(t){switch(t.label){case 0:return Ge.isMp?[4,$i.setNavigationBarTitle(e.title)]:[3,2];case 1:return[2,t.sent()];case 2:return Ge.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(He("setNavigationBarTitle",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),to.apply(this,arguments)}var no=[Oi({color:hi(),textColor:Qi.enum(["black","white"]).optional(),statusBarColor:hi().optional()}).optional()];function ro(e){return io.apply(this,arguments)}function io(){return io=Ne((function(e){return Le(this,(function(t){return[2,zn("setNavigationBarColor",no,[e],function(){var e=Ne((function(e){return Le(this,(function(t){switch(t.label){case 0:return Ge.isMp?[4,$i.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 Ge.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(He("setNavigationBarColor",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),io.apply(this,arguments)}var oo=[Oi({type:Qi.enum(["none","back","home","both"])}).optional()];function ao(e){return so.apply(this,arguments)}function so(){return so=Ne((function(e){return Le(this,(function(t){return[2,zn("setNavigationBarLeftButton",oo,[e],function(){var e=Ne((function(e){return Le(this,(function(t){switch(t.label){case 0:return Ge.isMp?[4,$i.setNavigationBarLeftButton(e.type)]:[3,2];case 1:return[2,t.sent()];case 2:return Ge.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(He("setNavigationBarLeftButton",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),so.apply(this,arguments)}function uo(e,t,n){if(!t.has(e))throw new TypeError("attempted to "+n+" private field on non-instance");return t.get(e)}function co(e,t){return function(e,t){return t.get?t.get.call(e):t.value}(e,uo(e,t,"get"))}function lo(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 po(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,uo(e,t,"set"),n),n}var fo,ho,mo=function(){function e(){Mt(this,e)}var t=e.prototype;return t.getSynchronize=function(e){return new Map},t.setSynchronize=function(e){return{errorKeys:[]}},t.getInfoSynchronize=function(){return{currentSize:0,limitSize:0}},t.removeSynchronize=function(e){return{errorKeys:[]}},t.clearSynchronize=function(){},t.getItem=function(e){return this.getSynchronize([e]).get(e)||null},t.setItem=function(e,t){if(this.setSynchronize(Ke({},e,t)).errorKeys.length>0)throw new Error("Failed to set item: ".concat(e))},t.removeItem=function(e){this.removeSynchronize([e])},t.clear=function(){this.clearSynchronize()},t.getStorageInfo=function(){return this.getInfoSynchronize()},e}(),vo=new WeakMap,yo=new WeakMap,go=new WeakMap,_o=function(e){Bt(n,e);var t=zt(n);function n(e){var r;return Mt(this,n),lo(Zt(r=t.call(this)),vo,{writable:!0,value:localStorage}),lo(Zt(r),yo,{writable:!0,value:void 0}),lo(Zt(r),go,{writable:!0,value:void 0}),po(Zt(r),go,{keys:new Set,currentSize:0,limitSize:V}),po(Zt(r),yo,e),r.findAllCurrentDataByApp(e),r}var r=n.prototype;return r.findAllCurrentDataByApp=function(e){try{var t;for(t in co(this,vo)){if(e)if(t.split("_")[0]!==e)continue;co(this,go).keys.add(t)}}catch(e){}},r.get=function(e){var t=this,n=new Map;return e.forEach((function(e){n.set(e,t.getSync(e))})),Promise.resolve(n)},r.getSync=function(e){return co(this,yo)&&(e="".concat(co(this,yo),"_").concat(e)),co(this,go).keys.has(e)?co(this,vo).getItem(e):null},r.set=function(e){var t=this;return Ne((function(){return Le(this,(function(n){return Object.entries(e).forEach((function(e){var n=qe(e,2),r=n[0],i=n[1];t.setSync(r,i.replace(/\\"/g,'"'))})),[2,Promise.resolve({errorKeys:[]})]}))}))()},r.setSync=function(e,t){co(this,yo)&&(e="".concat(co(this,yo),"_").concat(e)),co(this,vo).setItem(e,t),co(this,go).keys.add(e)},r.getInfo=function(){var e=this;return Ne((function(){return Le(this,(function(t){return[2,Promise.resolve(e.getInfoSync())]}))}))()},r.getInfoSync=function(){var e=function(e,t){var n,r=0;for(n in e){var i=n.split("_")[0];e.hasOwnProperty(n)&&(t&&i!==t||(r+=2*(e[n].length+n.length)))}return r}(co(this,vo),co(this,yo));return{currentSize:Nt.isNumber(e)?Number((e/1024).toFixed(2)):0,limitSize:Number((V/1024).toFixed(2))}},r.remove=function(e){var t=this;return Ne((function(){return Le(this,(function(n){return e.forEach((function(e){t.removeSync(e)})),[2,Promise.resolve({errorKeys:[]})]}))}))()},r.removeSync=function(e){co(this,yo)&&(e="".concat(co(this,yo),"_").concat(e)),co(this,go).keys.has(e)&&(co(this,vo).removeItem(e),co(this,go).keys.delete(e))},r.clearAsync=function(){var e=this;return Ne((function(){return Le(this,(function(t){return[2,Promise.resolve(e.clearSync())]}))}))()},r.clearSync=function(){var e=this;co(this,go).keys.forEach((function(t){co(e,yo)&&t.indexOf(co(e,yo))<0||(co(e,vo).removeItem(t),co(e,go).keys.delete(t))}))},r.setSynchronize=function(e){var t=this;return Object.entries(e).forEach((function(e){var n=qe(e,2),r=n[0],i=n[1];t.setSync(r,i)})),{errorKeys:[]}},r.getSynchronize=function(e){var t=this,n=new Map;return e.forEach((function(e){n.set(e,t.getSync(e))})),n},r.getInfoSynchronize=function(){return this.getInfoSync()},r.clearSynchronize=function(){this.clearSync()},n}(mo),wo=new WeakMap,To=new WeakMap,bo=function(e){Bt(n,e);var t=zt(n);function n(e){var r;return Mt(this,n),lo(Zt(r=t.call(this)),wo,{writable:!0,value:void 0}),lo(Zt(r),To,{writable:!0,value:void 0}),po(Zt(r),To,{keys:new Set,currentSize:0,limitSize:V}),po(Zt(r),wo,e),r}var r=n.prototype;return r.get=function(e){var t=this;return Ne((function(){return Le(this,(function(n){return[2,new Promise((function(n,r){bn("ZBROWSER_MPDS",{mpds_action:"mpds.get",mpds_data:{keys:e},appId:co(t,wo)},{success:function(e){var t=new Map;e&&e.mpds_data&&e.mpds_data.map&&(t=new Map(Object.entries(e.mpds_data.map))),n(t)},fail:function(e){r(e)}},{isMultiCallback:!1})}))]}))}))()},r.getSynchronize=function(e){var t={mpds_action:"mpds.get",mpds_data:{keys:e},appId:co(this,wo)},n=new Map,r=this.handleResult(t);return r&&r.mpds_data&&r.mpds_data.map&&(n=new Map(Object.entries(r.mpds_data.map))),n},r.set=function(e){var t=this;return Ne((function(){return Le(this,(function(n){return[2,new Promise((function(n,r){bn("ZBROWSER_MPDS",{mpds_action:"mpds.set",mpds_data:{map:e},appId:co(t,wo)},{success:function(e){var t=[];e&&e.mpds_data&&e.mpds_data.error_keys&&(t=e.mpds_data.error_keys),n({errorKeys:t})},fail:function(e){r(e)}},{isMultiCallback:!1})}))]}))}))()},r.setSynchronize=function(e){var t={mpds_action:"mpds.set",mpds_data:{map:e},appId:co(this,wo)},n=[],r=this.handleResult(t);return r&&r.mpds_data&&r.mpds_data.error_keys&&(n=r.mpds_data.error_keys),{errorKeys:n}},r.getInfo=function(){var e=this;return Ne((function(){return Le(this,(function(t){return[2,new Promise((function(t,n){bn("ZBROWSER_MPDS",{mpds_action:"mpds.get.size",mpds_data:{},appId:co(e,wo)},{success:function(e){var n=0;e&&e.mpds_data&&e.mpds_data.size&&(n=e.mpds_data.size),t({currentSize:Nt.isNumber(n)?Number(Number(n)/1024):0,limitSize:Number(V/1024)})},fail:function(e){n(e)}},{isMultiCallback:!1})}))]}))}))()},r.getInfoSynchronize=function(){var e={mpds_action:"mpds.get.size",mpds_data:{},appId:co(this,wo)},t=0,n=this.handleResult(e);return n&&n.mpds_data&&n.mpds_data.size&&(t=n.mpds_data.size),{currentSize:Nt.isNumber(t)?Number(Number(t)/1024):0,limitSize:Number(V/1024)}},r.remove=function(e){var t=this;return Ne((function(){return Le(this,(function(n){return[2,new Promise((function(n,r){bn("ZBROWSER_MPDS",{mpds_action:"mpds.remove.key",mpds_data:{keys:e},appId:co(t,wo)},{success:function(e){var t=[];e&&e.mpds_data&&e.mpds_data.error_keys&&(t=e.mpds_data.error_keys),n({errorKeys:t})},fail:function(e){r(e)}},{isMultiCallback:!1})}))]}))}))()},r.removeSynchronize=function(e){var t={mpds_action:"mpds.remove.key",mpds_data:{keys:e},appId:co(this,wo)},n=[],r=this.handleResult(t);return r&&r.mpds_data&&r.mpds_data.error_keys&&(n=r.mpds_data.error_keys),{errorKeys:n}},r.clearAsync=function(){var e=this;return Ne((function(){return Le(this,(function(t){return[2,new Promise((function(t,n){bn("ZBROWSER_MPDS",{mpds_action:"mpds.clear.appData",mpds_data:{},appId:co(e,wo)},{success:function(){t()},fail:function(e){n(e)}},{isMultiCallback:!1})}))]}))}))()},r.clearSynchronize=function(){var e={mpds_action:"mpds.clear.appData",mpds_data:{},appId:co(this,wo)};this.handleResult(e)},r.handleResult=function(e){var t=null;try{var n=ZaloJavaScriptInterface.processActionMPDS(JSON.stringify(e));if(n=JSON.parse(n)){if(0===n.error_code)return n.data;t=Tn(n).toJSON()}}catch(e){t=e}finally{if(null!==t)throw t}return{}},n}(mo),Eo=function(){function e(){Mt(this,e)}var t=e.prototype;return t.getDataFromStorage=function(e){var t=this;return Ne((function(){var n,r;return Le(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]=kn(e)})),[2,r]}}))}))()},t.getItem=function(e){return this.getInstance().getItem(e)},t.putDataToStorage=function(e){var t=this;return Ne((function(){var n,r;return Le(this,(function(i){switch(i.label){case 0:return n=t.getInstance(),r={},Object.entries(e).forEach((function(e){var t=qe(e,2),n=t[0],i=t[1];Nt.isUndefined(i)||Nt.isNull(i)||(r[n]=Mn(i))})),[4,n.set(r)];case 1:return[2,i.sent()]}}))}))()},t.setItem=function(e,t){return this.getInstance().setItem(e,t)},t.removeDataFromStorage=function(e){var t=this;return Ne((function(){return Le(this,(function(n){switch(n.label){case 0:return[4,t.getInstance().remove(e)];case 1:return[2,n.sent()]}}))}))()},t.removeItem=function(e){this.getInstance().removeItem(e)},t.clearStorage=function(){var e=this;return Ne((function(){return Le(this,(function(t){switch(t.label){case 0:return[4,e.getInstance().clearAsync()];case 1:return t.sent(),[2]}}))}))()},t.clearStorageSync=function(){this.getInstance().clear()},t.getStorageInfo=function(){var e=this;return Ne((function(){return Le(this,(function(t){switch(t.label){case 0:return[4,e.getInstance().getInfo()];case 1:return[2,t.sent()]}}))}))()},t.getStorageInfoSync=function(){return this.getInstance().getStorageInfo()},e}(),Po=new WeakMap,So=function(e){Bt(n,e);var t=zt(n);function n(e){var r;return Mt(this,n),lo(Zt(r=t.call(this)),Po,{writable:!0,value:void 0}),po(Zt(r),Po,e),r}return n.prototype.getInstance=function(){return new _o(co(this,Po))},n}(Eo),Io=new WeakMap,Ao=function(e){Bt(n,e);var t=zt(n);function n(e){var r;return Mt(this,n),lo(Zt(r=t.call(this)),Io,{writable:!0,value:void 0}),po(Zt(r),Io,e),r}return n.prototype.getInstance=function(){return new bo(co(this,Io))},n}(Eo),Oo=new So(o),ko=dn(),Co=(null===(fo=Fe())||void 0===fo?void 0:fo.platformName)||"unknown";ko>0&&ko>={android:12100571,iOS:400,wp:0,unknown:0}[Co]&&(null===(ho=Fe())||void 0===ho?void 0:ho.appEnv.isMp)&&(Oo=new Ao(o));var No=Oo,Mo=[Oi({data:Qi.record(hi(),Qi.any())}).optional()];function Ro(e){return xo.apply(this,arguments)}function xo(){return xo=Ne((function(e){return Le(this,(function(t){return[2,zn("setStorage",Mo,[e],function(){var e=Ne((function(e){return Le(this,(function(t){switch(t.label){case 0:return Ge.isMp||Ge.isMpWeb?[4,No.putDataToStorage(e.data)]:[3,2];case 1:return[2,t.sent()];case 2:return[2,Promise.reject(He("setStorage",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),xo.apply(this,arguments)}var Do=[Oi({keys:Qi.array(hi())}).optional()];function Lo(e){return Uo.apply(this,arguments)}function Uo(){return Uo=Ne((function(e){return Le(this,(function(t){return[2,zn("getStorage",Do,[e],function(){var e=Ne((function(e){return Le(this,(function(t){switch(t.label){case 0:return Ge.isMp||Ge.isMpWeb?[4,No.getDataFromStorage(e.keys)]:[3,2];case 1:return[2,t.sent()];case 2:return[2,Promise.reject(He("getStorage",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Uo.apply(this,arguments)}function jo(e){return Bo.apply(this,arguments)}function Bo(){return(Bo=Ne((function(e){return Le(this,(function(t){return[2,zn("getStorageInfo",[],[e],Ne((function(){return Le(this,(function(e){switch(e.label){case 0:return Ge.isMp||Ge.isMpWeb?[4,No.getStorageInfo()]:[3,2];case 1:return[2,e.sent()];case 2:return[2,Promise.reject(He("getStorageInfo",{}))]}}))})))]}))}))).apply(this,arguments)}var Zo=[Oi({keys:Qi.array(hi())}).optional()];function zo(e){return Wo.apply(this,arguments)}function Wo(){return Wo=Ne((function(e){return Le(this,(function(t){return[2,zn("removeStorage",Zo,[e],function(){var e=Ne((function(e){return Le(this,(function(t){switch(t.label){case 0:return Ge.isMp||Ge.isMpWeb?[4,No.removeDataFromStorage(e.keys)]:[3,2];case 1:return[2,t.sent()];case 2:return[2,Promise.reject(He("removeStorage",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Wo.apply(this,arguments)}var Fo=[Oi({prefix:hi().optional()}).optional()];function Go(e){return Vo.apply(this,arguments)}function Vo(){return(Vo=Ne((function(e){return Le(this,(function(t){return[2,zn("clearStorage",Fo,[e],Ne((function(){return Le(this,(function(e){switch(e.label){case 0:return Ge.isMp||Ge.isMpWeb?[4,No.clearStorage()]:[3,2];case 1:return[2,e.sent()];case 2:return[2,Promise.reject(He("clearStorage",{}))]}}))})))]}))}))).apply(this,arguments)}var Ho=function(){var e=Ne((function(e,t){var n,r,i,a;return Le(this,(function(s){switch(s.label){case 0:return(r=t)?[3,2]:[4,Ln()];case 1:r=!s.sent(),s.label=2;case 2:return n=r,[4,Sn.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=Ne((function(e){var t,n,r,i,o,a;return Le(this,(function(s){switch(s.label){case 0:return[4,e.json()];case 1:if(r=s.sent(),void 0!==(i=null==r?void 0:r.error)&&0!==i)throw o=(null==r?void 0:r.message)||O,new mn(i,o);return a=null==r?void 0:r.user_id_by_oa,[2,{id:null==r?void 0:r.id,name:(null==r?void 0:r.name)||"",avatar:(null==r||null===(t=r.picture)||void 0===t||null===(n=t.data)||void 0===n?void 0:n.url)||"",idByOA:a,followedOA:!!(null==r?void 0:r.is_follower),isSensitive:null==r?void 0:r.is_sensitive}]}}))}));return function(t){return e.apply(this,arguments)}}())];case 4:return[2,s.sent()]}}))}));return function(t,n){return e.apply(this,arguments)}}(),Ko=[Oi({avatarType:Qi.enum(["small","normal","large"]).optional(),autoRequestPermission:Qi.boolean().default(!1).optional()}).optional()];function Jo(e){return qo.apply(this,arguments)}function qo(){return qo=Ne((function(e){return Le(this,(function(t){return[2,zn("getUserInfo",Ko,[e],function(){var e=Ne((function(e){var t,n,r;return Le(this,(function(i){switch(i.label){case 0:if(!Ge.isMp)return[3,4];t=null==e?void 0:e.avatarType,n=null==e?void 0:e.autoRequestPermission,i.label=1;case 1:return i.trys.push([1,3,,4]),[4,Ho(t,n)];case 2:return[2,{userInfo:i.sent()}];case 3:return r=i.sent(),[2,Promise.reject(r)];case 4:return Ge.isMpWeb?[2,Promise.resolve({userInfo:{id:"3368637342326461234",name:"User Name",avatar:"https://h5.zdn.vn/static/images/avatar.png"}})]:[2,Promise.reject(He("getUserInfo",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),qo.apply(this,arguments)}var Qo=function(e){return{NONE:e?-2:0,WIFI:e?0:1,"2G":2,"3G":e?15:2,"4G":e?13:2}},Yo=Ne((function(){return Le(this,(function(t){return[2,new Promise((function(t,n){bn("WEBVIEW_NETWORKTYPE",{url:window.location.href,featureId:""},{success:function(n){var r,i,o,a=n.network,s=(null===(r=Fe())||void 0===r||null===(i=r.platform)||void 0===i?void 0:i.isAndroid)||!1;switch(a){case Qo(s).NONE:o=e.NetworkType.none;break;case Qo(s).WIFI:o=e.NetworkType.wifi;break;case Qo(s)["2G"]:case Qo(s)["3G"]:case Qo(s)["4G"]:o=e.NetworkType.cellular;break;default:o=e.NetworkType.unknown}t(o)},fail:function(e){n(e)}},{})}))]}))}));function $o(e){return Xo.apply(this,arguments)}function Xo(){return(Xo=Ne((function(t){return Le(this,(function(n){return[2,zn("getNetworkType",[],[t],Ne((function(){var t,n;return Le(this,(function(r){switch(r.label){case 0:return Ge.isMp?[4,Yo()]:[3,2];case 1:return[2,{networkType:r.sent()}];case 2:if(Ge.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(He("getNetworkType",{}))]}}))})))]}))}))).apply(this,arguments)}var ea=[Qi.function().args(Oi({isConnected:Qi.boolean(),networkType:Qi.enum(["none","wifi","cellular","unknown"])})).returns(Qi.void())];function ta(t){return zn("onNetworkStatusChange",ea,[t],(function(t){var n=t;if(Ge.isMp)!function(t){Kt.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(Ge.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 na=function(){var e=Ne((function(e){var t,n,r,i,o,a;return Le(this,(function(s){return a={subaction:0,scanning_type:Nt.isNumber(null==e?void 0:e.scanningType)?e.scanningType:0,data:{scan_from_source:Nt.isString(null==e?void 0:e.scanFromSource)?e.scanFromSource:"",expire:Nt.isNumber(null==e?void 0:e.expire)?e.expire:3e3,monitor_interval:Nt.isNumber(null==e?void 0:e.monitorInterval)?e.monitorInterval:60,domain:Nt.isString(null==e?void 0:e.domain)?e.domain:"",scan_config:{scan_time:Nt.isNumber(null==e||null===(t=e.scanConfig)||void 0===t?void 0:t.scanTime)?e.scanConfig.scanTime:15e3,time_between_scan:Nt.isNumber(null==e||null===(n=e.scanConfig)||void 0===n?void 0:n.timeBetweenScan)?e.scanConfig.timeBetweenScan:1e4,beacon_timeout:Nt.isNumber(null==e||null===(r=e.scanConfig)||void 0===r?void 0:r.beaconTimeout)?e.scanConfig.beaconTimeout:3e4,delayCheckConnectedTimeout:Nt.isNumber(null==e||null===(i=e.scanConfig)||void 0===i?void 0:i.delayCheckConnectedTimeout)?e.scanConfig.delayCheckConnectedTimeout:5e3,beaconConnectedTimeout:Nt.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){bn("SCAN_IBEACON",Je({},a),{success:function(){e(!0)},fail:function(e){t(e)}},{})}))]}))}));return function(t){return e.apply(this,arguments)}}(),ra=[Oi({scanningType:Qi.number().refine((function(e){return[0,1].includes(e)}),{message:"The type must be either 0 or 1"}).default(0).optional(),expire:Qi.number().optional(),monitorInterval:Qi.number().optional(),domain:Qi.string().optional(),scanConfig:Oi({scanTime:Qi.number().optional(),timeBetweenScan:Qi.number().optional(),beaconTimeout:Qi.number().optional(),delayCheckConnectedTimeout:Qi.number().optional(),beaconConnectedTimeout:Qi.number().optional()}).optional(),items:Qi.array(Oi({id:Qi.string().optional(),distance:Qi.number().optional(),monitor:Oi({enable:Qi.boolean().optional(),movingRange:Qi.number().optional()}).optional()})).optional(),scanFromSource:Qi.string().optional()}).optional()];function ia(e){return oa.apply(this,arguments)}function oa(){return(oa=Ne((function(e){return Le(this,(function(t){return[2,zn("startBeaconDiscovery",ra,[e],Ne((function(){return Le(this,(function(t){switch(t.label){case 0:return Ge.isMp?[4,na(e)]:[3,2];case 1:return[2,t.sent()];case 2:return Ge.isMpWeb?[2,Promise.resolve(!0)]:[2,Promise.reject(He("startBeaconDiscovery",{}))]}}))})))]}))}))).apply(this,arguments)}var aa=Ne((function(){return Le(this,(function(e){return[2,new Promise((function(e,t){bn("SCAN_IBEACON",{subaction:2},{success:function(){e(!0)},fail:function(e){t(e)}},{})}))]}))}));function sa(e){return ua.apply(this,arguments)}function ua(){return(ua=Ne((function(e){return Le(this,(function(t){return[2,zn("stopBeaconDiscovery",[],[e],Ne((function(){return Le(this,(function(e){switch(e.label){case 0:return Ge.isMp?[4,aa()]:[3,2];case 1:return[2,e.sent()];case 2:return Ge.isMpWeb?[2,Promise.resolve(!0)]:[2,Promise.reject(He("stopBeaconDiscovery",{}))]}}))})))]}))}))).apply(this,arguments)}var ca=Ne((function(){return Le(this,(function(e){return[2,new Promise((function(e,t){bn("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 la(e){return da.apply(this,arguments)}function da(){return(da=Ne((function(e){return Le(this,(function(t){return[2,zn("getBeacons",[],[e],Ne((function(){return Le(this,(function(e){switch(e.label){case 0:return Ge.isMp?[4,ca()]:[3,2];case 1:return[2,e.sent()];case 2:return Ge.isMpWeb?[2,Promise.resolve({beacons:[]})]:[2,Promise.reject(He("getBeacons",{}))]}}))})))]}))}))).apply(this,arguments)}var pa=Ne((function(){return Le(this,(function(e){return[2,new Promise((function(e,t){bn("WINDOW_CLOSE",{},{success:function(t){e(t)},fail:function(e){t(e)}},{})}))]}))}));function fa(e){return ha.apply(this,arguments)}function ha(){return(ha=Ne((function(e){return Le(this,(function(t){return[2,zn("closeApp",[],[e],Ne((function(){return Le(this,(function(e){switch(e.label){case 0:return Ge.isMp?[4,pa()]:[3,2];case 1:return[2,e.sent()];case 2:return Ge.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(He("closeApp",{}))]}}))})))]}))}))).apply(this,arguments)}var ma=Ne((function(){return Le(this,(function(e){return[2,new Promise((function(e,t){bn("OPEN_QR",{skipOpenLink:!0},{success:function(t){e(t)},fail:function(e){t(e)}},{})}))]}))}));function va(e){return ya.apply(this,arguments)}function ya(){return(ya=Ne((function(e){return Le(this,(function(t){return[2,zn("scanQRCode",[],[e],Ne((function(){return Le(this,(function(e){switch(e.label){case 0:return Ge.isMp?[4,ma()]:[3,2];case 1:return[2,e.sent()];case 2:return Ge.isMpWeb?[2,Promise.resolve({content:""})]:[2,Promise.reject(He("scanQRCode",{}))]}}))})))]}))}))).apply(this,arguments)}var ga=function(){var t=Ne((function(t,n,r,o){return Le(this,(function(a){return[2,new Promise((function(a,s){bn("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)}}(),_a=[Oi({id:hi(),type:Qi.enum(["user","oa","aliasOA"]),sourceId:Qi.any().optional(),sourceIndex:Qi.any().optional()}).optional()];function wa(e){return Ta.apply(this,arguments)}function Ta(){return Ta=Ne((function(e){return Le(this,(function(t){return[2,zn("openProfile",_a,[e],function(){var e=Ne((function(e){var t,n,r,i;return Le(this,(function(o){switch(o.label){case 0:return Ge.isMp?(t=e.id,n=e.type,r=e.sourceId,i=e.sourceIndex,[4,ga(t,n,r,i)]):[3,2];case 1:return[2,o.sent()];case 2:return Ge.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(He("openProfile",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Ta.apply(this,arguments)}var ba=function(){var t=Ne((function(t,n){var r,o,a,s=arguments;return Le(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){bn("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)}}(),Ea=[Oi({id:hi(),type:Qi.enum(["user","oa"]),sourceId:Qi.any().optional(),sourceIndex:Qi.any().optional(),message:hi().optional()}).optional()];function Pa(e){return Sa.apply(this,arguments)}function Sa(){return Sa=Ne((function(e){return Le(this,(function(t){return[2,zn("openChat",Ea,[e],function(){var e=Ne((function(e){var t,n,r,i,o;return Le(this,(function(a){switch(a.label){case 0:return Ge.isMp?(t=e.id,n=e.type,r=e.message,i=e.sourceId,o=e.sourceIndex,[4,ba(t,n,r,i,o)]):[3,2];case 1:return[2,a.sent()];case 2:return Ge.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(He("openChat",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Sa.apply(this,arguments)}function Ia(e,t){return t=null!=t?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))})),e}var Aa=function(){var t=Ne((function(t,n){var r,o;return Le(this,(function(a){switch(r={},o=t,t){case"image":(null==n?void 0:n.imageUrls)?(o="multi_image",r={photoUrl:null==n?void 0:n.imageUrls}):r={photoUrl:null==n?void 0:n.imageUrl};break;case"link":r={link:null==n?void 0:n.link,title:null==n?void 0:n.title,thumb:null==n?void 0:n.thumb,description:null==n?void 0:n.description};break;case"profile":r={avt:null==n?void 0:n.avatar,uid:null==n?void 0:n.id,dpn:null==n?void 0:n.displayName}}return[2,new Promise((function(t,n){bn("OPEN_POSTFEED",Ia(Je({type:e.PostFeedType[o]},r),{zapp:i}),{success:function(e){t({status:null==e?void 0:e.status,shareType:null==e?void 0:e.share_type,numberOfUser:null==e?void 0:e.uid_to_size})},fail:function(e){n(e)}},{})}))]}))}));return function(e,n){return t.apply(this,arguments)}}(),Oa=[Qi.union([Oi({type:Qi.enum(["image"]),data:Oi({imageUrl:hi().url().optional(),imageUrls:Qi.array(hi().url()).optional()})}),Oi({type:Qi.enum(["link"]),data:Oi({link:hi().url(),title:hi().max(100).optional(),thumb:hi().url().optional(),description:hi().max(400).default("").optional()})}),Oi({type:Qi.enum(["profile"]),data:Oi({id:hi().optional()})})])];function ka(e){return Ca.apply(this,arguments)}function Ca(){return Ca=Ne((function(e){return Le(this,(function(t){return[2,zn("openPostFeed",Oa,[e],function(){var e=Ne((function(e){var t,n;return Le(this,(function(r){switch(r.label){case 0:return Ge.isMp?(t=e.type,n=e.data,[4,Aa(t,n)]):[3,2];case 1:return[2,r.sent()];case 2:return Ge.isMpWeb?[2,Promise.resolve({status:1,shareType:0,numberOfUser:0})]:[2,Promise.reject(He("openPostFeed",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Ca.apply(this,arguments)}var Na=function(){var e=Ne((function(e){return Le(this,(function(t){return[2,new Promise((function(t,n){bn("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)}}(),Ma=[Oi({id:hi(),showDialogConfirm:Qi.boolean().optional()}).optional()];function Ra(e){return xa.apply(this,arguments)}function xa(){return xa=Ne((function(e){return Le(this,(function(t){return[2,zn("followOA",Ma,[e],function(){var e=Ne((function(e){var t;return Le(this,(function(n){switch(n.label){case 0:return Ge.isMp?(t=e.id,[4,Na(t)]):[3,2];case 1:return[2,n.sent()];case 2:return Ge.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(He("followOA",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),xa.apply(this,arguments)}var Da=function(){var e=Ne((function(e){return Le(this,(function(t){return[2,new Promise((function(t,n){bn("UNFOLLOW_OA",{uid:e,forceUpdate:!0,zapp:i},{success:function(){t()},fail:function(e){n(e)}},{})}))]}))}));return function(t){return e.apply(this,arguments)}}(),La=[Oi({id:hi()}).optional()];function Ua(e){return ja.apply(this,arguments)}function ja(){return ja=Ne((function(e){return Le(this,(function(t){return[2,zn("unfollowOA",La,[e],function(){var e=Ne((function(e){var t;return Le(this,(function(n){switch(n.label){case 0:return Ge.isMp?(t=e.id,[4,Da(t)]):[3,2];case 1:return[2,n.sent()];case 2:return Ge.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(He("unfollowOA",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),ja.apply(this,arguments)}var Ba=function(){var e=Ne((function(e,t,n,r,i,o){var s,u,l,p,f,h,m,v;return Le(this,(function(y){switch(y.label){case 0:return l=new URL(location.href),p=new URLSearchParams,f="".concat(l.pathname.replace(c,"")).concat(l.search),o&&(f="/".concat(e).concat("/"===o[0]?"":"/").concat(o)),!(h=new URL("".concat(a).concat(f))).searchParams.has("env")&&(null===(s=window.APP_ENV)||void 0===s?void 0:s.length)>0&&h.searchParams.set("env",window.APP_ENV),!h.searchParams.has("version")&&(null===(u=window.APP_VERSION)||void 0===u?void 0:u.length)>0&&h.searchParams.set("version",window.APP_VERSION),p.append("title",n),p.append("description",r||""),p.append("thumbnail",i||""),p.append("url",h.href),p.append("accessToken",t||""),m={headers:{"Content-Type":"application/x-www-form-urlencoded"}},[4,fetch(d.CREATE_SHARE_LINK,Je({method:"POST",body:p},m))];case 1:return[4,y.sent().json()];case 2:if(!(v=y.sent())||0!==v.err)throw wn.error.cannotGetShareInfo();return h.search="".concat(h.search,"&zshareId=").concat(v.data.shareId),[2,Ia(Je({},v.data),{shareableLink:h.href})]}}))}));return function(t,n,r,i,o,a){return e.apply(this,arguments)}}(),Za=function(){var t=Ne((function(t,n){var r,a,s,u,c,l,d,p,f,h,m;return Le(this,(function(v){switch(v.label){case 0:switch(r={},a=t,t){case"text":return[3,1];case"image":return[3,2];case"gif":return[3,3];case"video":return[3,4];case"link":return[3,5];case"oa":return[3,6];case"zmp":return[3,7];case"zmp_deep_link":return[3,10]}return[3,13];case 1:return r={text:null==n?void 0:n.text,desc:(null==n?void 0:n.desc)||(null==n?void 0:n.description),autoParseLink:(null==n?void 0:n.autoParseLink)?1:0},[3,14];case 2:return c=[],l=dn(),d=(null===(u=Fe())||void 0===u?void 0:u.platformName)||"unknown",Number(l)>=G[d]&&(a="multi_image"),Array.isArray(null==n?void 0:n.imageUrls)&&(null==n?void 0:n.imageUrls.length)>0?c=null==n?void 0:n.imageUrls:c.push(null==n?void 0:n.imageUrl),r={photoUrls:c,photoUrl:null==n?void 0:n.imageUrl,caption:null==n?void 0:n.caption},[3,14];case 3:return r={photoUrl:null==n?void 0:n.imageUrl,gifUrl:null==n?void 0:n.gifUrl,width:null==n?void 0:n.width,height:null==n?void 0:n.height},[3,14];case 4:return r={videoThumb:null==n?void 0:n.videoThumb,videoUrl:null==n?void 0:n.videoUrl,width:null==n?void 0:n.width,height:null==n?void 0:n.height},[3,14];case 5:return r={link:null==n?void 0:n.link,chatOnly:(null==n?void 0:n.chatOnly)?1:0},[3,14];case 6:return r={uid:null==n?void 0:n.id},[3,14];case 7:case 10:return[4,Sn.getAccessToken()];case 8:case 11:return s=v.sent(),[4,Ba(o,s||"",(null==n?void 0:n.title)||"",(null==n?void 0:n.description)||"",(null==n?void 0:n.thumbnail)||"",null==n?void 0:n.path)];case 9:return p=v.sent(),r={data:{ZInstantAPIInfo:{url:"".concat(p.zinstantApi),zinstantdata_id:"templateId=".concat(p.ztemplateId,"&appId=").concat(o,"&shareId=").concat(p.shareId)},previewMsgText:{msg:{en:"Zalo Mini Program",vi:"Chương trình nhỏ"}},enableReactions:1}},[3,14];case 12:return f=v.sent().shareableLink,h=new URL(f),m=h.searchParams.getAll("zshareId"),h.searchParams.delete("zshareId"),m.length>0&&h.searchParams.append("zshareId",m[0]),r={link:h.href,chatOnly:0},[3,14];case 13:return[3,14];case 14:return[2,new Promise((function(t,n){bn("OPEN_SHARESHEET",Ia(Je({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)}}(),za=[Qi.union([Oi({type:Qi.enum(["text"]),data:Oi({text:hi(),description:hi().default("").optional(),autoParseLink:Qi.boolean().default(!1).optional()})}),Oi({type:Qi.enum(["image"]),data:Oi({imageUrl:hi().url().optional(),imageUrls:Qi.array(hi().url()).max(10).optional()})}),Oi({type:Qi.enum(["link"]),data:Oi({link:hi().url(),chatOnly:Qi.boolean().optional()})}),Oi({type:Qi.enum(["oa"]),data:Oi({id:hi()})}),Oi({type:Qi.enum(["gif"]),data:Oi({gifUrl:hi().url(),imageUrl:hi().url().optional(),width:mi().min(0).optional(),height:mi().min(0).optional()})}),Oi({type:Qi.enum(["video"]),data:Oi({videoThumb:hi().url(),videoUrl:hi().url(),width:mi().min(0).optional(),height:mi().min(0).optional()})}),Oi({type:Qi.enum(["zmp","zmp_deep_link"]),data:Oi({title:hi().max(100),thumbnail:hi().url(),path:hi().optional(),description:hi().max(400).default("").optional()})})])];function Wa(e){return Fa.apply(this,arguments)}function Fa(){return Fa=Ne((function(e){return Le(this,(function(t){return[2,zn("openShareSheet",za,[e],function(){var e=Ne((function(e){var t,n;return Le(this,(function(r){switch(r.label){case 0:return Ge.isMp?(t=e.type,n=e.data,[4,Za(t,n)]):[3,2];case 1:return[2,r.sent()];case 2:return Ge.isMpWeb?[2,Promise.resolve({status:2,shareType:0,numberOfUser:0})]:[2,Promise.reject(He("openShareSheet",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Fa.apply(this,arguments)}var Ga=Ne((function(){return Le(this,(function(e){return[2,new Promise((function(e,t){bn("REQUEST_PERMISSION_CAMERA",{},{success:function(t){var n,r;(null===(n=Fe())||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=Fe())||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 Va(e){return Ha.apply(this,arguments)}function Ha(){return(Ha=Ne((function(e){return Le(this,(function(t){return[2,zn("requestCameraPermission",[],[e],Ne((function(){return Le(this,(function(e){switch(e.label){case 0:return[4,Ga()];case 1:return[2,e.sent()]}}))})))]}))}))).apply(this,arguments)}var Ka=function(){var e=Ne((function(e,t,n){return Le(this,(function(r){return[2,new Promise((function(r,i){bn("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)}}(),Ja=Ne((function(){var e,t,n,r=arguments;return Le(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=qn(),[4,on(e,t,n.version)];case 1:return[2,i.sent()]}}))})),qa=function(){var e=Ne((function(e){return Le(this,(function(t){return[2,new Promise((function(t,n){bn("OPEN_OUTAPP",{url:e},{success:function(){t()},fail:function(e){n(e)}},{})}))]}))}));return function(t){return e.apply(this,arguments)}}(),Qa=[Oi({params:Qi.record(hi(),hi()).optional()}).optional()];function Ya(e){return $a.apply(this,arguments)}function $a(){return $a=Ne((function(e){return Le(this,(function(t){return[2,zn("createShortcut",Qa,[e],function(){var e=Ne((function(e){var t,n,r,i,s,u,c,l;return Le(this,(function(d){switch(d.label){case 0:return Ge.isMp?[4,Ja(o,0)]:[3,6];case 1:return r=d.sent(),i=null===(t=Fe())||void 0===t||null===(n=t.platform)||void 0===n?void 0:n.isIOS,s=r.logoUrl||Nn("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,qa(encodeURI(l))]):[3,3];case 2:return d.sent(),[3,5];case 3:return[4,Ka("".concat(a,"/").concat(o,"/?").concat(c.toString()),u,s)];case 4:d.sent(),d.label=5;case 5:return[2,wn.success()];case 6:return Ge.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(He("createShortcut",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),$a.apply(this,arguments)}var Xa=function(){var e=Ne((function(e,t,n){return Le(this,(function(r){return[2,new Promise((function(r,o){bn("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)}}(),es=[Oi({secretData:hi(),ui:Oi({title:hi().default("Xác thực").optional(),subTitle:hi().default("Sử dụng sinh trắc học của bạn để xác thực").optional(),negativeButtonText:hi().default("Đóng").optional()}).optional(),requireFingerprint:gi().default(!0).optional()}).optional()];function ts(e){return ns.apply(this,arguments)}function ns(){return ns=Ne((function(e){return Le(this,(function(t){return[2,zn("openBioAuthentication",es,[e],function(){var e=Ne((function(e){var t,n,r;return Le(this,(function(i){switch(i.label){case 0:return Ge.isMp?(t=e.secretData,n=e.ui,r=e.requireFingerprint,[4,Xa(t,n,r)]):[3,2];case 1:return[2,i.sent()];case 2:return Ge.isMpWeb?[2,Promise.resolve({code:0,message:"OK",data:{domain:"",code:0,message:"",payToken:""}})]:[2,Promise.reject(He("openBioAuthentication",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),ns.apply(this,arguments)}var rs=Ne((function(){return Le(this,(function(e){return[2,new Promise((function(e,t){bn("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 is(e){return os.apply(this,arguments)}function os(){return(os=Ne((function(e){return Le(this,(function(t){return[2,zn("checkStateBioAuthentication",[],[e],Ne((function(){return Le(this,(function(e){switch(e.label){case 0:return Ge.isMp?[4,rs()]:[3,2];case 1:return[2,{bioState:e.sent()}];case 2:return Ge.isMpWeb?[2,Promise.resolve({bioState:""})]:[2,Promise.reject(He("checkStateBioAuthentication",{}))]}}))})))]}))}))).apply(this,arguments)}var as=function(){var e=Ne((function(e){return Le(this,(function(t){return[2,new Promise((function(t,n){bn("SHOW_TOAST",{toast:e},{success:function(){t()},fail:function(e){n(e)}},{})}))]}))}));return function(t){return e.apply(this,arguments)}}(),ss=[Oi({message:hi()}).optional()];function us(e){return cs.apply(this,arguments)}function cs(){return cs=Ne((function(e){return Le(this,(function(t){return[2,zn("showToast",ss,[e],function(){var e=Ne((function(e){return Le(this,(function(t){switch(t.label){case 0:return Ge.isMp?[4,as(e.message)]:[3,2];case 1:return[2,t.sent()];case 2:return Ge.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(He("showToast",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),cs.apply(this,arguments)}var ls=Ne((function(){return Le(this,(function(e){return[2,new Promise((function(e,t){bn("HIDE_KEYBOARD",{},{success:function(){e()},fail:function(e){t(e)}},{})}))]}))}));function ds(e){return ps.apply(this,arguments)}function ps(){return(ps=Ne((function(e){return Le(this,(function(t){return[2,zn("hideKeyboard",[],[e],Ne((function(){return Le(this,(function(e){switch(e.label){case 0:return Ge.isMp?[4,ls()]:[3,2];case 1:return[2,e.sent()];case 2:return Ge.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(He("hideKeyboard",{}))]}}))})))]}))}))).apply(this,arguments)}var fs=function(){var e=Ne((function(e){return Le(this,(function(t){return[2,new Promise((function(t,n){bn("OPEN_PHONE",{phoneNum:e,phoneCode:e},{success:function(){t()},fail:function(e){n(e)}},{})}))]}))}));return function(t){return e.apply(this,arguments)}}(),hs=[Oi({phoneNumber:hi()})];function ms(e){return vs.apply(this,arguments)}function vs(){return vs=Ne((function(e){return Le(this,(function(t){return[2,zn("openPhone",hs,[e],function(){var e=Ne((function(e){return Le(this,(function(t){switch(t.label){case 0:return Ge.isMp?[4,fs(e.phoneNumber)]:[3,2];case 1:return[2,t.sent()];case 2:return Ge.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(He("openPhone",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),vs.apply(this,arguments)}var ys=function(){var e=Ne((function(e,t){return Le(this,(function(n){return[2,new Promise((function(n,r){bn("OPEN_SMS",{content:t,phoneCode:e},{success:function(){n()},fail:function(e){r(e)}},{})}))]}))}));return function(t,n){return e.apply(this,arguments)}}(),gs=[Oi({content:hi(),phoneNumber:hi()})];function _s(e){return ws.apply(this,arguments)}function ws(){return ws=Ne((function(e){return Le(this,(function(t){return[2,zn("openSMS",gs,[e],function(){var e=Ne((function(e){return Le(this,(function(t){switch(t.label){case 0:return Ge.isMp?[4,ys(e.phoneNumber,e.content)]:[3,2];case 1:return[2,t.sent()];case 2:return Ge.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(He("openSMS",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),ws.apply(this,arguments)}var Ts=function(){var e=Ne((function(e){var t,n=arguments;return Le(this,(function(r){return t=n.length>1&&void 0!==n[1]?n[1]:"",[2,new Promise((function(n,r){bn("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)}}(),bs=[Oi({id:hi(),displayName:hi().default("").optional()})];function Es(e){return Ps.apply(this,arguments)}function Ps(){return Ps=Ne((function(e){return Le(this,(function(t){return[2,zn("viewOAQr",bs,[e],function(){var e=Ne((function(e){return Le(this,(function(t){switch(t.label){case 0:return Ge.isMp?[4,Ts(e.id,e.displayName)]:[3,2];case 1:return[2,t.sent()];case 2:return Ge.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(He("viewOAQr",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Ps.apply(this,arguments)}var Ss=function(){var e=Ne((function(e){return Le(this,(function(t){return[2,new Promise((function(t,n){bn("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)}}(),Is=[Oi({keepScreenOn:gi()})];function As(e){return Os.apply(this,arguments)}function Os(){return Os=Ne((function(e){return Le(this,(function(t){return[2,zn("keepScreen",Is,[e],function(){var e=Ne((function(e){return Le(this,(function(t){switch(t.label){case 0:return Ge.isMp?[4,Ss(e.keepScreenOn)]:[3,2];case 1:return[2,t.sent()];case 2:return Ge.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(He("keepScreen",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Os.apply(this,arguments)}function ks(e){return Cs.apply(this,arguments)}function Cs(){return(Cs=Ne((function(e){return Le(this,(function(t){return[2,zn("onKeepScreen",[],[e],Ne((function(){return Le(this,(function(e){switch(e.label){case 0:return Ge.isMp?[4,Ss(!0)]:[3,2];case 1:return[2,e.sent()];case 2:return Ge.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(He("onKeepScreen",{}))]}}))})))]}))}))).apply(this,arguments)}function Ns(e){return Ms.apply(this,arguments)}function Ms(){return(Ms=Ne((function(e){return Le(this,(function(t){return[2,zn("offKeepScreen",[],[e],Ne((function(){return Le(this,(function(e){switch(e.label){case 0:return Ge.isMp?[4,Ss(!1)]:[3,2];case 1:return[2,e.sent()];case 2:return Ge.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(He("offKeepScreen",{}))]}}))})))]}))}))).apply(this,arguments)}var Rs=function(){var e=Ne((function(e,t,n){var r;return Le(this,(function(i){return r={},e?r={imageBase64Data:e}:t&&(r={imageUrl:t}),[2,new Promise((function(e,t){bn("SAVE_IMAGE_GALLERY",Ia(Je({},r),{onProgress:n}),{success:function(){e()},fail:function(e){t(e)}},{})}))]}))}));return function(t,n,r){return e.apply(this,arguments)}}(),xs=[Oi({imageBase64Data:hi().max(7e6).optional(),imageUrl:hi().url().optional()}).optional()];function Ds(e){return Ls.apply(this,arguments)}function Ls(){return Ls=Ne((function(e){return Le(this,(function(t){return[2,zn("saveImageToGallery",xs,[e],function(){var e=Ne((function(e){return Le(this,(function(t){switch(t.label){case 0:return Ge.isMp?[4,Rs(e.imageBase64Data,e.imageUrl,e.onProgress)]:[3,2];case 1:return[2,t.sent()];case 2:return Ge.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(He("saveImageToGallery",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Ls.apply(this,arguments)}var Us=function(){var e=Ne((function(e,t,n){var r;return Le(this,(function(i){return r={},t?r={videoBase64Data:t}:e&&(r={videoUrl:e}),[2,new Promise((function(e,t){bn("SAVE_VIDEO_GALLERY",Ia(Je({},r),{onProgress:n}),{success:function(){e()},fail:function(e){t(e)}},{})}))]}))}));return function(t,n,r){return e.apply(this,arguments)}}(),js=[Oi({videoUrl:hi().url().optional(),videoBase64Data:hi().max(7e6).optional()}).optional()];function Bs(e){return Zs.apply(this,arguments)}function Zs(){return Zs=Ne((function(e){return Le(this,(function(t){return[2,zn("saveVideoToGallery",js,[e],function(){var e=Ne((function(e){return Le(this,(function(t){switch(t.label){case 0:return Ge.isMp?[4,Us(e.videoUrl,e.videoBase64Data,e.onProgress)]:[3,2];case 1:return[2,t.sent()];case 2:return Ge.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(He("saveVideoToGallery",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Zs.apply(this,arguments)}var zs=function(){var e=Ne((function(e){var t,n,r,i,o,a,u=arguments;return Le(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,Ja(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=qe(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){bn("OPEN_MP",{mpUrl:o,mpInfo:i},{success:function(){e()},fail:function(e){t(e)}},{})}))]}}))}));return function(t){return e.apply(this,arguments)}}(),Ws=[Oi({appId:hi(),path:hi().optional(),params:Qi.record(hi(),hi()).optional()})];function Fs(e){return Gs.apply(this,arguments)}function Gs(){return Gs=Ne((function(e){return Le(this,(function(t){return[2,zn("openMiniApp",Ws,[e],function(){var e=Ne((function(e){return Le(this,(function(t){switch(t.label){case 0:return Ge.isMp?[4,zs(e.appId,e.path,e.params)]:[3,2];case 1:return[2,t.sent()];case 2:return Ge.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(He("openMiniApp",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Gs.apply(this,arguments)}var Vs=Ne((function(){var t,n,r=arguments;return Le(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){bn("INTERACTIVE_VIBRATION",{type:e.VibrateType[t],vibrate_time:n},{success:function(){r()},fail:function(e){i(e)}},{})}))]}))})),Hs=[Oi({type:Qi.enum(["oneShot"]).default("oneShot").optional(),milliseconds:mi().optional()})];function Ks(e){return Js.apply(this,arguments)}function Js(){return Js=Ne((function(e){return Le(this,(function(t){return[2,zn("vibrate",Hs,[e],function(){var e=Ne((function(e){return Le(this,(function(t){switch(t.label){case 0:return Ge.isMp?[4,Vs(null==e?void 0:e.type,null==e?void 0:e.milliseconds)]:[3,2];case 1:return[2,t.sent()];case 2:return Ge.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(He("vibrate",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Js.apply(this,arguments)}var qs=function(){var e=Ne((function(e,t,n){var r,i,o,a,s;return Le(this,(function(u){return r=new URL(e),i=r.href.includes("vnpay"),o=r.searchParams.get("typeInapp"),a=Nt.isEmpty(t)?void 0:{modal_style:(null==t?void 0:t.style)?sn(null==t?void 0:t.style):"bottom_sheet",left_button:(null==t?void 0:t.leftButton)?sn(null==t?void 0:t.leftButton):"back"},s=Number.isInteger(n)?n:void 0,!i&&Nt.isEmpty(o)&&r.searchParams.set("typeInapp","1"),[2,new Promise((function(e,t){bn("OPEN_INAPP",{url:r.href,style:a,h5_src_open:s},{success:function(){e()},fail:function(e){t(e)}},{})}))]}))}));return function(t,n,r){return e.apply(this,arguments)}}(),Qs=[Oi({url:hi(),config:Oi({style:Qi.enum(["bottomSheet","normal"]).default("bottomSheet").optional(),leftButton:Qi.enum(["back","none"]).default("back").optional()}).optional()})];function Ys(e){return $s.apply(this,arguments)}function $s(){return $s=Ne((function(e){return Le(this,(function(t){return[2,zn("openWebview",Qs,[e],function(){var e=Ne((function(e){return Le(this,(function(t){switch(t.label){case 0:return Ge.isMp?[4,qs(e.url,e.config)]:[3,2];case 1:return[2,t.sent()];case 2:return Ge.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(He("openWebview",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),$s.apply(this,arguments)}function Xs(){var e={},t=window.location.href;try{var n=new URL(t).searchParams.toString();n&&(e=Qt.getParamsAsObject(n))}catch(e){throw new Error("Invalid URL")}return e}function eu(){return zn("getRouteParams",[],[],(function(){return Xs()}))}function tu(e){return nu.apply(this,arguments)}function nu(){return(nu=Ne((function(e){return Le(this,(function(t){return[2,zn("getAppInfo",[],[e],Ne((function(){return Le(this,(function(e){switch(e.label){case 0:return Ge.isMp?[4,Ja()]:[3,2];case 1:return[2,e.sent()];case 2:return Ge.isMpWeb?[2,Promise.resolve({description:"",name:"",version:"",appUrl:"",qrCodeUrl:""})]:[2,Promise.reject(He("getAppInfo",{}))]}}))})))]}))}))).apply(this,arguments)}var ru=function(){var e=Ne((function(e){return Le(this,(function(t){return[2,new Promise((function(t,n){bn("WEBVIEW_SET_RESULT",{result:Mn(e)},{success:function(){t()},fail:function(e){n(e)}},{})}))]}))}));return function(t){return e.apply(this,arguments)}}(),iu=[Oi({data:Qi.any()})];function ou(e){return au.apply(this,arguments)}function au(){return au=Ne((function(e){return Le(this,(function(t){return[2,zn("sendDataToPreviousMiniApp",iu,[e],function(){var e=Ne((function(e){return Le(this,(function(t){switch(t.label){case 0:return Ge.isMp?[4,ru(e.data)]:[3,2];case 1:return[2,t.sent()];case 2:return Ge.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(He("sendDataToPreviousMiniApp",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),au.apply(this,arguments)}var su=Ne((function(){return Le(this,(function(e){return[2,new Promise((function(e,t){var n,r;bn("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(wn.error.clientNotSupport())},fail:function(e){t(e)}},{delay:(null===(n=Fe())||void 0===n||null===(r=n.platform)||void 0===r?void 0:r.isIOS)?400:0})}))]}))}));function uu(e){return cu.apply(this,arguments)}function cu(){return(cu=Ne((function(e){return Le(this,(function(t){return[2,zn("getPhoneNumber",[],[e],Ne((function(){return Le(this,(function(e){switch(e.label){case 0:return Ge.isMp?[4,su()]:[3,2];case 1:return[2,e.sent()];case 2:return Ge.isMpWeb?[2,Promise.resolve({number:""})]:[2,Promise.reject(He("getPhoneNumber",{}))]}}))})))]}))}))).apply(this,arguments)}var lu=Ne((function(){var t,n,r,a=arguments;return Le(this,(function(s){return t=a.length>0&&void 0!==a[0]?a[0]:1,n=a.length>1?a[1]:void 0,r=a.length>2?a[2]:void 0,[2,new Promise((function(a,s){bn("MP_OPEN_PROFILE_PICKER",Je({},n===e.OpenProfilePickerType.TOOL_DEL_FRIEND?{maxProfile:t,src:n,uids:r,zapp:i,appId:o}:{maxProfile:t}),{success:function(e){Array.isArray(e)?a(e.map((function(e){return e.id}))):a([])},fail:function(e){s(e)}},{isMultiCallback:!0})}))]}))})),du=[Oi({maxProfile:mi().optional().default(1),src:Qi.enum([e.OpenProfilePickerType.TOOL_DEL_FRIEND]).optional(),uids:Ai(hi()).optional()}).superRefine((function(t,n){var r=t.src,i=t.maxProfile;r===e.OpenProfilePickerType.TOOL_DEL_FRIEND?i<1&&n.addIssue({code:"custom",path:["maxProfile"],message:"maxProfile must be at least 1 when src is 'tool_del_friend'"}):(i<1||i>10)&&n.addIssue({code:"custom",path:["maxProfile"],message:"maxProfile must be between 1 and 10"})}))];function pu(e){return fu.apply(this,arguments)}function fu(){return fu=Ne((function(e){return Le(this,(function(t){return[2,zn("openProfilePicker",du,[e],function(){var e=Ne((function(e){var t,n,r,i,o,a,s,u,c,l,p,f;return Le(this,(function(h){switch(h.label){case 0:return Ge.isMp?[4,lu(null==e?void 0:e.maxProfile,null==e?void 0:e.src,null==e?void 0:e.uids)]:[3,12];case 1:return t=h.sent(),n=function(e,t){return Array.from({length:Math.ceil(e.length/t)},(function(n,r){return e.slice(r*t,r*t+t)}))},t.length>0?[4,Sn.getAccessToken()]:[3,11];case 2:r=h.sent(),i=n(t,20),o=[],a=!0,s=!1,u=void 0,h.label=3;case 3:h.trys.push([3,8,9,10]),c=function(){var e,t,n,i,a,s,u;return Le(this,(function(c){switch(c.label){case 0:e=p.value,c.label=1;case 1:return c.trys.push([1,4,,5]),[4,fetch(d.GET_LIST_USER_INFO,{method:"POST",headers:{"Content-Type":"application/json",access_token:r||""},body:JSON.stringify({fields:"id,name,picture",user_ids:e})})];case 2:return[4,c.sent().json()];case 3:if(0!==(t=c.sent()).error||!t.data)throw new Error(t.message);return i=e.map((function(e){var n,r,i,o,a,s,u,c,l,d,p;return{id:(null===(n=t.data[e])||void 0===n||null===(r=n.user_info)||void 0===r?void 0:r.user_id_by_app)||"",profile:{name:null===(i=t.data[e])||void 0===i||null===(o=i.user_info)||void 0===o?void 0:o.name,avatar:null===(a=t.data[e])||void 0===a||null===(s=a.user_info)||void 0===s||null===(u=s.picture)||void 0===u||null===(c=u.data)||void 0===c?void 0:c.url},code:0!==(null===(l=t.data[e])||void 0===l?void 0:l.error)?-1:0,message:"Get profile: ".concat(Nt.isUndefined(null===(d=t.data[e])||void 0===d?void 0:d.message)?"Unknown error":null===(p=t.data[e])||void 0===p?void 0:p.message)}})),(n=o).push.apply(n,De(i)),[3,5];case 4:return a=c.sent(),u=e.map((function(e){return{id:e,profile:{name:"",avatar:""},code:-1,message:"Can't get profile: ".concat(a.message)}})),(s=o).push.apply(s,De(u)),[3,5];case 5:return[2]}}))},l=i[Symbol.iterator](),h.label=4;case 4:return(a=(p=l.next()).done)?[3,7]:[5,Ue(c())];case 5:h.sent(),h.label=6;case 6:return a=!0,[3,4];case 7:return[3,10];case 8:return f=h.sent(),s=!0,u=f,[3,10];case 9:try{a||null==l.return||l.return()}finally{if(s)throw u}return[7];case 10:return[2,{users:o}];case 11:return[2,{users:[]}];case 12:return Ge.isMpWeb?[2,Promise.resolve({users:[]})]:[2,Promise.reject(He("openProfilePicker",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),fu.apply(this,arguments)}var hu=function(){var e=Ne((function(e,t,n){var r;return Le(this,(function(i){return r=t&&Nt.isString(t)&&t.length>0?"wpa_wpa2":"open",[2,new Promise((function(i,o){bn("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)}}(),mu=[Oi({SSID:hi(),password:hi().optional(),hiddenSSID:gi().optional()})];function vu(e){return yu.apply(this,arguments)}function yu(){return yu=Ne((function(e){return Le(this,(function(t){return[2,zn("connectWifi",mu,[e],function(){var e=Ne((function(e){return Le(this,(function(t){switch(t.label){case 0:return Ge.isMp?[4,hu(e.SSID,e.password,e.hiddenSSID)]:[3,2];case 1:return[2,t.sent()];case 2:return Ge.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(He("connectWifi",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),yu.apply(this,arguments)}var gu=function(){var t=Ne((function(t,n,r,i,o,a,s){var u,c;return Le(this,(function(l){return u=n&&n.length>0?{type:0,url:n,max_size:r||1048576}:null,c={enable:1,aspect_ratio:"1:1"},[2,new Promise((function(n,r){bn("PICK_MEDIA",{featureFlag:1,media_type:e.MediaPickerType[t],edit_view:Je({},c,i),silent_request:o,upload:u,max_select_items:a,compressLevel:null!=s?s:2},{success:function(e){n(null!==u?null==e?void 0:e.result_content:null==e?void 0:e.path)},fail:function(e){r(e)}},{isMultiCallback:!0})}))]}))}));return function(e,n,r,i,o,a,s){return t.apply(this,arguments)}}(),_u=[Oi({type:Qi.enum(["video","photo","file","zcamera","zcamera_photo","zcamera_video","zcamera_scan"]),serverUploadUrl:hi().url().optional(),maxItemSize:mi().min(0).optional(),editView:Oi({enable:gi().optional(),aspectRatio:hi().regex(/^\d+:\d+$/).optional()}).optional(),silentRequest:gi().optional(),maxSelectItem:mi().min(1).optional(),compressLevel:mi().min(0).max(3).optional()})];function wu(e){return Tu.apply(this,arguments)}function Tu(){return Tu=Ne((function(e){return Le(this,(function(t){return[2,zn("openMediaPicker",_u,[e],function(){var e=Ne((function(e){var t,n,r,i,o,a,s;return Le(this,(function(u){switch(u.label){case 0:return Ge.isMp?(i={},Nt.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,s=e.compressLevel||2,[4,gu(e.type,e.serverUploadUrl,e.maxItemSize,i,o,a,s)]):[3,2];case 1:return[2,{data:u.sent()}];case 2:return Ge.isMpWeb?[2,Promise.resolve({data:""})]:[2,Promise.reject(He("openMediaPicker",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Tu.apply(this,arguments)}var bu=[Oi({title:hi().max(100),description:hi().max(400).default(""),thumbnail:hi().url().optional(),path:hi().optional()})];function Eu(e){return Pu.apply(this,arguments)}function Pu(){return Pu=Ne((function(e){return Le(this,(function(t){return[2,zn("getShareableLink",bu,[e],function(){var e=Ne((function(e){var t;return Le(this,(function(n){switch(n.label){case 0:return[4,Sn.getAccessToken()];case 1:return t=n.sent(),[4,Ba(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)}}())]}))})),Pu.apply(this,arguments)}var Su=function(){var e=Ne((function(e){return Le(this,(function(t){return[2,new Promise((function(t,n){bn("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 Iu(e){return Au.apply(this,arguments)}function Au(){return(Au=Ne((function(e){return Le(this,(function(t){return[2,zn("closeLoading",[],[e],Ne((function(){return Le(this,(function(e){switch(e.label){case 0:return Ge.isMp?[4,Su("user action")]:[3,2];case 1:return[2,e.sent()];case 2:return Ge.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(He("closeLoading",{}))]}}))})))]}))}))).apply(this,arguments)}function Ou(e){return ku.apply(this,arguments)}function ku(){return ku=Ne((function(e){return Le(this,(function(t){return[2,zn("requestUpdateZalo",[],[e],Ne((function(){var e,t,n;return Le(this,(function(r){switch(r.label){case 0:return Ge.isMp?(n=(null===(e=Fe())||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,qa(n)]):[3,2];case 1:return[2,r.sent()];case 2:return Ge.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(He("requestUpdateZalo",{}))]}}))})))]}))})),ku.apply(this,arguments)}var Cu=Kt.getInstance();Cu.addListener=function(t,n,r){var i=t;return Cu.addListener(e.Events[i],n,r)};var Nu=[Qi.function()];function Mu(t){return zn("onConfirmToExit",Nu,[t],(function(t){var n=t;Ge.isMp&&(Cu.on(e.Events.AppClose,n,'{"handle_h5": 1}'),$i.setNavigationBarLeftButton(void 0,2))}))}function Ru(){return zn("offConfirmToExit",[],[],(function(){Ge.isMp&&(Cu.off(e.Events.AppClose),$i.setNavigationBarLeftButton(void 0,0))}))}function xu(){return zn("getDeviceId",[],[],(function(){return Ge.isMp&&Sn.getSync(l.DEVICE_ID)||""}))}function Du(e){return Lu.apply(this,arguments)}function Lu(){return(Lu=Ne((function(e){return Le(this,(function(t){return[2,zn("getDeviceIdAsync",[],[e],Ne((function(){return Le(this,(function(e){switch(e.label){case 0:return Ge.isMp?[4,Sn.jumpAndGetToken(l.DEVICE_ID)]:[3,2];case 1:return[2,e.sent()||""];case 2:return[2,Promise.resolve("")]}}))})))]}))}))).apply(this,arguments)}function Uu(){return zn("getContext",[],[],(function(){if(Ge.isMp){var e=Sn.getSync(l.CONTEXT_ID)||"";return{type:Sn.getSync(l.CONTEXT_TYPE)||"",id:e}}return{type:"",id:""}}))}function ju(e){return Bu.apply(this,arguments)}function Bu(){return(Bu=Ne((function(e){return Le(this,(function(t){return[2,zn("getContextAsync",[],[e],Ne((function(){var e;return Le(this,(function(t){switch(t.label){case 0:return Ge.isMp?[4,Sn.jumpAndGetToken(l.CONTEXT_ID)]:[3,3];case 1:return e=t.sent()||"",[4,Sn.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 Zu(e){return zu.apply(this,arguments)}function zu(){return(zu=Ne((function(e){return Le(this,(function(t){return[2,zn("getAuthCode",[],[e],Ne((function(){var e,t;return Le(this,(function(n){switch(n.label){case 0:return Ge.isMp?[4,Sn.jumpAndGetToken(l.ZOAUTH,!0)]:[3,4];case 1:return e=n.sent()||"",[4,Sn.jumpAndGetToken(l.ZOAUTH_VRF)];case 2:return t=n.sent()||"",[4,Sn.verifyUserAuthorized()];case 3:if(n.sent())return[2,{authCode:e,authCodeVerify:t}];throw an([{action:"getAuthCode",error:-104,message:"no user auth",data:{}}]),wn.error.loginFailed("User Authentication Required");case 4:return[2,Promise.resolve({authCode:"",authCodeVerify:""})]}}))})))]}))}))).apply(this,arguments)}function Wu(e){return Fu.apply(this,arguments)}function Fu(){return(Fu=Ne((function(e){return Le(this,(function(t){return[2,zn("getZPIToken",[],[e],Ne((function(){var e,t,n,r;return Le(this,(function(i){switch(i.label){case 0:return Ge.isMp?[4,Sn.jumpAndGetToken(l.UTOKEN_ZPI)]:[3,5];case 1:return e=i.sent()||"",[4,Sn.jumpAndGetToken(l.GTOKEN_ZPI)];case 2:return t=i.sent()||"",[4,Sn.jumpAndGetToken(l.ZPP_ZPI)];case 3:return n=i.sent()||"",[4,Sn.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 Gu=[hi()];function Vu(e){return zn("setAccessToken",Gu,[e],(function(e){var t=e;Sn.setAccessToken(t)}))}var Hu=[Oi({url:hi().url()})];function Ku(e){return Ju.apply(this,arguments)}function Ju(){return Ju=Ne((function(e){return Le(this,(function(t){return[2,zn("openOutApp",Hu,[e],function(){var e=Ne((function(e){return Le(this,(function(t){switch(t.label){case 0:return Ge.isMp?[4,qa(e.url)]:[3,2];case 1:return[2,t.sent()];case 2:return Ge.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(He("openOutApp",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Ju.apply(this,arguments)}var qu=[Oi({count:mi().min(1).optional().default(1),sourceType:Qi.array(Qi.enum(["album","camera"])).max(2).default(["album","camera"]).optional(),cameraType:Qi.enum(["back","front"]).default("front").optional()})];function Qu(e){return Yu.apply(this,arguments)}function Yu(){return Yu=Ne((function(e){return Le(this,(function(t){return[2,zn("chooseImage",qu,[e],function(){var e=Ne((function(e){var t,n,r,i;return Le(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)}}())]}))})),Yu.apply(this,arguments)}var $u=Ne((function(){var e,t,n=arguments;return Le(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){bn("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(wn.error.clientNotSupport())},fail:function(e){r(e)}},{isMultiCallback:!0,timeout:!1})}))]}))}));function Xu(e){return ec.apply(this,arguments)}function ec(){return(ec=Ne((function(e){return Le(this,(function(t){return[2,zn("getLocation",[],[e],Ne((function(){return Le(this,(function(e){switch(e.label){case 0:return Ge.isMp?[4,$u()]:[3,2];case 1:return[2,e.sent()];case 2:return Ge.isMpWeb?[2,Promise.resolve({token:""})]:[2,Promise.reject(He("getLocation",{}))]}}))})))]}))}))).apply(this,arguments)}var tc=[Qi.function().args(Oi({data:Qi.any()})).returns(Qi.void())];function nc(t){return zn("onCallbackData",tc,[t],(function(){!function(t){Kt.getInstance().on(e.Events.OnDataCallback,(function(e){t({data:e})}))}(t)}))}var rc=function(){var e=Ne((function(e){var t,n,r,i,o,a,s,u,c,l,d,p;return Le(this,(function(f){switch(f.label){case 0:return e||(e=Xs()),"object"==typeof e&&((r=e.zmpOrderId||e.orderId)||(n=e.appTransID||e.apptransid||e.transId)),"string"==typeof e&&(i=Qt.getParameterByName("orderId",e),o=Qt.getParameterByName("appTransID",e)||Qt.getParameterByName("apptransid",e),n=i||o),a={headers:{authorization:"Bearer "}},[4,Sn.jumpAndGetToken()];case 1:return f.sent(),s=null===(t=Sn.miniProgramConfig)||void 0===t?void 0:t.jwt,a.headers.authorization="Bearer ".concat(s),u=new URL(J),c={orderId:r||"",transId:n||""},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 wn.error.badRequest(l.msg);return d=l.data||{},p={err:l.err,msg:l.msg},0!==Object.keys(d).length&&d.constructor===Object&&Object.assign(p,Je({msg:d.resultMessage},d)),[2,p]}}))}));return function(t){return e.apply(this,arguments)}}(),ic=function(){var t=Ne((function(t,n,r,i,a,s,u){var c,l,d,p,f,h,m,v,y,g,_,w,T,b,E,P,S,I,A,O,k;return Le(this,(function(C){switch(C.label){case 0:c=o,(l=new URLSearchParams).append("amount",t.toString()),l.append("item",encodeURIComponent(JSON.stringify(n))),l.append("mac",i),r&&l.append("desc",encodeURIComponent(r)),a&&(d=a,"object"==typeof a&&(d=JSON.stringify(a)),l.append("extradata",encodeURIComponent(d))),s&&(p=s,"object"==typeof s&&(p=JSON.stringify(s)),l.append("payload",encodeURIComponent(p))),u&&("string"==typeof u?(l.append("method",u),l.append("isCustom","false")):"object"==typeof u&&(l.append("method",u.id),l.append("isCustom",JSON.stringify(u.isCustom)))),f={headers:{"Content-Type":"application/x-www-form-urlencoded",authorization:"Bearer "}},C.label=1;case 1:return C.trys.push([1,6,,7]),[4,Sn.jumpAndGetToken()];case 2:return C.sent(),m=null===(h=Sn.miniProgramConfig)||void 0===h?void 0:h.jwt,f.headers.authorization="Bearer ".concat(m),[4,fetch(H,Ia(Je({method:"POST"},f),{body:l}))];case 3:return[4,C.sent().json()];case 4:if(!(v=C.sent()).data||0!==v.err)throw wn.error.badRequest(v.msg);return y=v.data.id,g=v.data.jwt,_=v.data.messageToken||"",w=window.APP_VERSION,T=window.APP_ENV,b={miniAppId:c,orderId:y},E=v.data.method,P=v.data.isCustom,g&&(b.token=g),w&&(b.version=w),T&&(b.env=T),E&&(b.method=E),P&&(b.isCustom=P),S=Qt.encode(b),I=new URL("?".concat(S),"https://payment-mini.zalo.me").toString(),A=dn(),O=un()&&A<742?"normal":"bottomSheet",Ft.enablePaymentDone=Kt.getInstance().eventNames().includes(e.Events.PaymentDone),[4,qs(I,{style:O}).then((function(){var t=!1;Kt.getInstance().once(e.Events.WebviewClosed,(function(){setTimeout(Ne((function(){var n;return Le(this,(function(r){switch(r.label){case 0:return t?[3,2]:(Kt.getInstance().emit(e.Events.PaymentDone,y,{orderId:y}),[4,rc({zmpOrderId:y})]);case 1:(n=r.sent()).err>=0&&!n.isCustom&&Kt.getInstance().emit(e.Events.PaymentClose,n.err,Ia(Je({},n),{zmpOrderId:y})),r.label=2;case 2:return[2]}}))})),500)})),Kt.getInstance().once(e.Events.OpenApp,(function(){t=!0})),Kt.getInstance().once(e.Events.PaymentDone,(function(){t=!0,Ft.enablePaymentDone=!1}))}))];case 5:return C.sent(),[2,{orderId:y,messageToken:_}];case 6:throw k=C.sent(),console.log("Internal error"),k;case 7:return[2]}}))}));return function(e,n,r,i,o,a,s){return t.apply(this,arguments)}}(),oc=[Oi({amount:Qi.union([hi(),mi()]),item:Qi.array(Qi.record(hi(),Qi.any())),desc:Qi.string(),mac:Qi.string(),extradata:Qi.any().optional(),payload:Qi.any().optional(),method:Qi.union([Qi.string(),Qi.object({id:Qi.string(),isCustom:Qi.boolean()})]).optional()})];function ac(e){return sc.apply(this,arguments)}function sc(){return sc=Ne((function(e){return Le(this,(function(t){return[2,zn("createOrder",oc,[e],function(){var e=Ne((function(e){return Le(this,(function(t){switch(t.label){case 0:return Ge.isMp?[4,ic(e.amount,e.item,e.desc,e.mac,e.extradata,e.payload,e.method)]:[3,2];case 1:return[2,t.sent()];case 2:return Ge.isMpWeb?[2,Promise.resolve({orderId:"",messageToken:""})]:[2,Promise.reject(He("createOrder",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),sc.apply(this,arguments)}var uc=Ne((function(){return Le(this,(function(e){return[2,new Promise((function(e,t){bn("MP_CONFIRM_REQUEST_PAYMENT",{},{success:function(){e()},fail:function(e){t(e)}},{})}))]}))})),cc=function(){var e=Ne((function(e,t,n,r,i){var o,a,s,u,c,l,d,p,f,h,m;return Le(this,(function(v){switch(v.label){case 0:(o=new URLSearchParams).append("amount",e.toString()),t&&o.append("desc",encodeURIComponent(t)),n&&o.append("method",n),r&&o.append("transId",r),i&&o.append("mac",i),a={headers:{"Content-Type":"application/x-www-form-urlencoded",authorization:"Bearer "}},v.label=1;case 1:return v.trys.push([1,9,,10]),[4,Sn.jumpAndGetToken()];case 2:if(v.sent(),c=null===(s=Sn.miniProgramConfig)||void 0===s?void 0:s.jwt,a.headers.authorization="Bearer ".concat(c),!(null===(u=Sn.miniProgramConfig)||void 0===u?void 0:u.showConfirmToPayment))return[3,6];v.label=3;case 3:return v.trys.push([3,5,,6]),[4,uc()];case 4:return v.sent(),[3,6];case 5:throw l=v.sent(),console.error("Failed:",l),l;case 6:return[4,fetch(q,Ia(Je({method:"POST"},a),{body:o}))];case 7:return[4,v.sent().json()];case 8:if(!(d=v.sent()).data||0!==d.err)throw wn.error.badRequest(d.msg);return p=d.data.id,f=d.data.messageToken||"",h=d.data.transId||"",[2,{orderId:p,messageToken:f,transId:h}];case 9:throw m=v.sent(),console.log("Internal error"),m;case 10:return[2]}}))}));return function(t,n,r,i,o){return e.apply(this,arguments)}}(),lc=[Oi({amount:Qi.union([Qi.string(),Qi.number()]),desc:Qi.string(),method:Qi.string(),transId:Qi.string().optional(),mac:Qi.string().optional()})];function dc(e){return pc.apply(this,arguments)}function pc(){return pc=Ne((function(e){return Le(this,(function(t){return[2,zn("purchase",lc,[e],function(){var e=Ne((function(e){return Le(this,(function(t){switch(t.label){case 0:return Ge.isMp?[4,cc(e.amount,e.desc,e.method,null==e?void 0:e.transId,null==e?void 0:e.mac)]:[3,2];case 1:return[2,t.sent()];case 2:return Ge.isMpWeb?[2,Promise.resolve({orderId:"",messageToken:"",transId:""})]:[2,Promise.reject(He("purchase",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),pc.apply(this,arguments)}var fc=function(){var e=Ne((function(e,t){return Le(this,(function(n){return[2,new Promise((function(n,r){var i=e&&(null==e?void 0:e.length)>0;bn("MP_SELECT_PAYMENT_METHOD",{isBinding:i,channels:e,selectedMethod:t,forceUpdate:!0},{success:function(e){console.log(e),n(e)},fail:function(e){r(e)}},{})}))]}))}));return function(t,n){return e.apply(this,arguments)}}(),hc=[Oi({channels:Ai(Oi({method:hi(),subMethod:hi().optional(),subInfo:hi().optional()})).optional(),selectedMethod:Oi({method:hi(),subMethod:hi().optional()}).optional()}).optional()];function mc(e){return vc.apply(this,arguments)}function vc(){return vc=Ne((function(e){return Le(this,(function(t){return[2,zn("selectPaymentMethod",hc,[e],function(){var e=Ne((function(e){var t,n;return Le(this,(function(r){switch(r.label){case 0:return Ge.isMp?(t=e.channels,n=e.selectedMethod,[4,fc(t,n)]):[3,2];case 1:return[2,r.sent()];case 2:return Ge.isMpWeb?[2,Promise.resolve({method:""})]:[2,Promise.reject(He("selectPaymentMethod",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),vc.apply(this,arguments)}var yc=[Oi({data:Qi.union([hi(),Qi.record(hi(),hi().nullish())])})];function gc(e){return _c.apply(this,arguments)}function _c(){return _c=Ne((function(e){return Le(this,(function(t){return[2,zn("checkTransaction",yc,[e],function(){var e=Ne((function(e){return Le(this,(function(t){switch(t.label){case 0:return Ge.isMp?[4,rc(e.data)]:[3,2];case 1:return[2,t.sent()];case 2:return Ge.isMpWeb?[2,Promise.resolve({msg:"Success",orderId:"",resultCode:1,transTime:(new Date).getTime().toString(),createdAt:(new Date).getTime().toString(),transId:""})]:[2,Promise.reject(He("checkTransaction",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),_c.apply(this,arguments)}var wc=function(){var t=Ne((function(t,n,r,i,a,s){var u,c,l,d,p,f,h,m,v,y,g,_,w,T,b;return Le(this,(function(E){switch(E.label){case 0:p=o,(f=new URLSearchParams).append("payType",n||e.IAPPayType.SUBSCRIPTION),h=e.ProrationMode.UNKNOW,r===Y&&(h=e.ProrationMode.IMMEDIATE_AND_CHARGE_FULL_PRICE),r===Q&&(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=Fe())||void 0===u||null===(c=u.platform)||void 0===c?void 0:c.isIOS)?m="ios":(null===(l=Fe())||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 "}},E.label=1;case 1:return E.trys.push([1,5,,6]),[4,Sn.jumpAndGetToken()];case 2:return E.sent(),g=null===(y=Sn.miniProgramConfig)||void 0===y?void 0:y.jwt,v.headers.authorization="Bearer ".concat(g),[4,fetch(K,Ia(Je({method:"POST"},v),{body:f}))];case 3:return[4,E.sent().json()];case 4:if(!(_=E.sent()).data||!_.data.store||0!==_.err)throw wn.error.createIAPOrderFailed(_.err);return w=_.data.store,T=_.data.orderId,[2,new Promise((function(e,t){bn("IAP_REQUESTPAYMENT",Je({},w),{success:function(){e({orderId:T})},fail:function(e){t(e)}})}))];case 5:throw b=E.sent(),console.log("Internal error"),b;case 6:return[2]}}))}));return function(e,n,r,i,o,a){return t.apply(this,arguments)}}(),Tc=[Oi({productId:hi(),payType:Qi.enum(["ONETIME","SUBSCRIPTION"]).optional(),prorationMode:Qi.enum(["DEFERRED","IMMEDIATE_AND_CHARGE_FULL_PRICE"]).default("DEFERRED").optional(),utm:hi().optional(),method:Qi.enum(["IAP","IAP_SANDBOX"]).optional(),merchantTransId:hi().optional()})];function bc(e){return Ec.apply(this,arguments)}function Ec(){return Ec=Ne((function(e){return Le(this,(function(t){return[2,zn("createOrderIAP",Tc,[e],function(){var e=Ne((function(e){return Le(this,(function(t){switch(t.label){case 0:return Ge.isMp?[4,wc(e.productId,e.payType,e.prorationMode,e.method,e.utm,e.merchantTransId)]:[3,2];case 1:return[2,t.sent()];case 2:return Ge.isMpWeb?[2,Promise.resolve({orderId:""})]:[2,Promise.reject(He("createOrderIAP",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Ec.apply(this,arguments)}var Pc=[Oi({hide:gi().default(!1).optional()}).optional()];function Sc(e){return Ic.apply(this,arguments)}function Ic(){return Ic=Ne((function(e){return Le(this,(function(t){return[2,zn("setAndroidBottomNavigationBar",Pc,[e],function(){var e=Ne((function(e){return Le(this,(function(t){switch(t.label){case 0:return Ge.isMp?[4,$i.setAndroidBottomNavigationBar(e.hide)]:[3,2];case 1:return[2,t.sent()];case 2:return Ge.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(He("setAndroidBottomNavigationBar",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Ic.apply(this,arguments)}var Ac=[Oi({hide:gi().default(!1).optional()}).optional()];function Oc(e){return kc.apply(this,arguments)}function kc(){return kc=Ne((function(e){return Le(this,(function(t){return[2,zn("setIOSBottomSafeArea",Ac,[e],function(){var e=Ne((function(e){return Le(this,(function(t){switch(t.label){case 0:return Ge.isMp?[4,$i.setIOSBottomSafeArea(e.hide)]:[3,2];case 1:return[2,t.sent()];case 2:return Ge.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(He("setIOSBottomSafeArea",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),kc.apply(this,arguments)}var Cc=[Oi({type:Qi.enum(["normal","hidden","transparent"]).default("normal").optional(),color:Qi.string().optional()}).optional()];function Nc(e){return Mc.apply(this,arguments)}function Mc(){return Mc=Ne((function(e){return Le(this,(function(t){return[2,zn("setStatusBar",Cc,[e],function(){var e=Ne((function(e){return Le(this,(function(t){switch(t.label){case 0:return Ge.isMp?[4,$i.configHeader({statusBarType:e.type,headerColor:e.color})]:[3,2];case 1:return[2,t.sent()];case 2:return Ge.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(He("setStatusBar",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Mc.apply(this,arguments)}var Rc=[Oi({headerTextColor:Qi.enum(["black","white"]).optional(),headerColor:Qi.string().optional(),actionBar:Oi({hide:Qi.boolean().optional(),title:Qi.string().optional(),leftButton:Qi.enum(["back","none"]).optional(),textAlign:Qi.enum(["left","center"]).default("left").optional()}).optional(),statusBarType:Qi.enum(["normal","hidden","transparent"]).optional(),hideAndroidBottomNavigationBar:Qi.boolean().optional(),hideIOSSafeAreaBottom:Qi.boolean().optional()})];function xc(e){return Dc.apply(this,arguments)}function Dc(){return Dc=Ne((function(e){return Le(this,(function(t){return[2,zn("configAppView",Rc,[e],function(){var e=Ne((function(e){var t,n,r,i,o,a,s;return Le(this,(function(u){switch(u.label){case 0:return Ge.isMp?Nt.isUndefined(null===(t=e.actionBar)||void 0===t?void 0:t.leftButton)?[3,2]:[4,$i.setNavigationBarLeftButton(null===(a=e.actionBar)||void 0===a?void 0:a.leftButton)]:[3,13];case 1:u.sent(),u.label=2;case 2:return Nt.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,$i.setNavigationBarTitle(null===(s=e.actionBar)||void 0===s?void 0:s.title)];case 3:u.sent(),u.label=4;case 4:return[4,$i.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,$i.setAndroidBottomNavigationBar(e.hideAndroidBottomNavigationBar)];case 7:u.sent(),u.label=8;case 8:return"boolean"!=typeof e.hideIOSSafeAreaBottom?[3,10]:[4,$i.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 Ge.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(He("configAppView",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Dc.apply(this,arguments)}var Lc=Ne((function(){return Le(this,(function(e){return[2,new Promise((function(e,t){bn("MA_MENU_MINIMIZE",{},{success:function(t){e(t)},fail:function(e){t(e)}},{})}))]}))}));function Uc(e){return jc.apply(this,arguments)}function jc(){return(jc=Ne((function(e){return Le(this,(function(t){return[2,zn("minimizeApp",[],[e],Ne((function(){return Le(this,(function(e){switch(e.label){case 0:return Ge.isMp?[4,Lc()]:[3,2];case 1:return[2,e.sent()];case 2:return Ge.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(He("minimizeApp",{}))]}}))})))]}))}))).apply(this,arguments)}var Bc=Ne((function(){return Le(this,(function(e){return[2,new Promise((function(e,t){bn("MA_MENU_PERMISSION",{},{success:function(t){e(t)},fail:function(e){t(e)}},{}),e()}))]}))}));function Zc(e){return zc.apply(this,arguments)}function zc(){return(zc=Ne((function(e){return Le(this,(function(t){return[2,zn("openPermissionSetting",[],[e],Ne((function(){return Le(this,(function(e){switch(e.label){case 0:return Ge.isMp?[4,Bc()]:[3,2];case 1:return[2,e.sent()];case 2:return Ge.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(He("openPermissionSetting",{}))]}}))})))]}))}))).apply(this,arguments)}var Wc=Ne((function(){return Le(this,(function(e){return[2,new Promise((function(e,t){bn("MP_ADD_MYFAVORITES",{timestamp:(new Date).getTime()},{success:function(t){e(t)},fail:function(e){t(e)}},{})}))]}))}));function Fc(e){return Gc.apply(this,arguments)}function Gc(){return(Gc=Ne((function(e){return Le(this,(function(t){return[2,zn("favoriteApp",[],[e],Ne((function(){return Le(this,(function(e){switch(e.label){case 0:return Ge.isMp?[4,Wc()]:[3,2];case 1:return[2,e.sent()];case 2:return Ge.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(He("favoriteApp",{}))]}}))})))]}))}))).apply(this,arguments)}var Vc=Ne((function(){return Le(this,(function(e){return[2,new Promise((function(e,t){bn("OPEN_GROUPLIST",{},{success:function(t){e(t)},fail:function(e){t(e)}},{})}))]}))}));function Hc(e){return Kc.apply(this,arguments)}function Kc(){return(Kc=Ne((function(e){return Le(this,(function(t){return[2,zn("openGroupList",[],[e],Ne((function(){return Le(this,(function(e){switch(e.label){case 0:return Ge.isMp?[4,Vc()]:[3,2];case 1:return[2,e.sent()];case 2:return Ge.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(He("openGroupList",{}))]}}))})))]}))}))).apply(this,arguments)}var Jc=Ne((function(){var e;return Le(this,(function(t){switch(t.label){case 0:return[4,Sn.getAccessToken()];case 1:return e=t.sent(),[2,new Promise((function(t,n){bn("MP_SEND_NOTIFICATION",{accessToken:e},{success:function(e){t(e)},fail:function(e){n(e)}},{delay:500})}))]}}))}));function qc(e){return Qc.apply(this,arguments)}function Qc(){return(Qc=Ne((function(e){return Le(this,(function(t){return[2,zn("requestSendNotification",[],[e],Ne((function(){return Le(this,(function(e){switch(e.label){case 0:return Ge.isMp?[4,Jc()]:[3,2];case 1:return[2,e.sent()];case 2:return Ge.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(He("requestSendNotification",{}))]}}))})))]}))}))).apply(this,arguments)}var Yc=Ne((function(){return Le(this,(function(e){return[2,new Promise((function(e,t){bn("MP_ADD_RATING",{},{success:function(t){e(t)},fail:function(e){t(e)}},{})}))]}))}));function $c(e){return Xc.apply(this,arguments)}function Xc(){return(Xc=Ne((function(e){return Le(this,(function(t){return[2,zn("addRating",[],[e],Ne((function(){return Le(this,(function(e){switch(e.label){case 0:return Ge.isMp?[4,Yc()]:[3,2];case 1:return[2,e.sent()];case 2:return Ge.isMpWeb?[2,Promise.resolve({})]:[2,Promise.reject(He("addRating",{}))]}}))})))]}))}))).apply(this,arguments)}var el,tl=(el=Ne((function(e,t,n){var r,i;return Le(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,Je({method:"POST",body:r},i))];case 1:return[4,o.sent().json()];case 2:return[2,o.sent()]}}))})),function(e,t,n){return el.apply(this,arguments)}),nl=function(){var e=Ne((function(e){return Le(this,(function(t){return[2,new Promise((function(t,n){bn("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)}}(),rl=[Oi({oaId:hi()})];function il(e){return ol.apply(this,arguments)}function ol(){return ol=Ne((function(e){return Le(this,(function(t){return[2,zn("interactOA",rl,[e],function(){var e=Ne((function(e){var t,n,r;return Le(this,(function(i){switch(i.label){case 0:return Ge.isMp?(t=e.oaId,[4,Sn.getAccessToken()]):[3,5];case 1:return!(n=i.sent())||Nt.isEmpty(n)?[3,3]:[4,tl(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,nl(t)];case 4:return[2,i.sent()];case 5:return Ge.isMpWeb?[2,Promise.resolve({})]:[2,Promise.reject(He("interactOA",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),ol.apply(this,arguments)}var al=[Oi({oaId:hi()})];function sl(e){return ul.apply(this,arguments)}function ul(){return ul=Ne((function(e){return Le(this,(function(t){return[2,zn("isAllowedInteractWithOA",al,[e],function(){var e=Ne((function(e){var t,n,r;return Le(this,(function(i){switch(i.label){case 0:return Ge.isMp?(t=e.oaId,[4,Sn.getAccessToken()]):[3,4];case 1:return!(n=i.sent())||Nt.isEmpty(n)?[3,3]:[4,tl(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 Ge.isMpWeb?[2,Promise.resolve({status:!1})]:[2,Promise.reject(He("IsAllowedInteractWithOA",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),ul.apply(this,arguments)}function cl(e){return ll.apply(this,arguments)}function ll(){return(ll=Ne((function(e){return Le(this,(function(t){return[2,zn("getSetting",[],[e],Ne((function(){return Le(this,(function(e){switch(e.label){case 0:return Ge.isMp?[4,gn()]:[3,2];case 1:return[2,e.sent()];case 2:return Ge.isMpWeb?[2,Promise.resolve({authSetting:{}})]:[2,Promise.reject(He("getSetting",{}))]}}))})))]}))}))).apply(this,arguments)}var dl=Qi.enum(["scope.userInfo","scope.userLocation","scope.userPhonenumber"]),pl=[Oi({scopes:Qi.array(dl).max(2).optional()}).optional()];function fl(e){return hl.apply(this,arguments)}function hl(){return hl=Ne((function(e){return Le(this,(function(t){return[2,zn("authorize",pl,[e],function(){var e=Ne((function(e){var t;return Le(this,(function(n){switch(n.label){case 0:return Ge.isMp?(t=null==e?void 0:e.scopes,pn(724,573)?[4,En(null!=t?t:void 0)]:[3,2]):[3,3];case 1:return[2,n.sent()];case 2:return[2,Promise.reject(wn.error.clientNotSupport())];case 3:return Ge.isMpWeb?[2,Promise.resolve({})]:[2,Promise.reject(He("authorize",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),hl.apply(this,arguments)}var ml=Ne((function(){return Le(this,(function(e){return[2,new Promise(function(){var e=Ne((function(e,t){var n;return Le(this,(function(r){switch(r.label){case 0:return Nt.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(wn.error.clientNotSupport()),[2]}}))}));return function(t,n){return e.apply(this,arguments)}}())]}))}));function vl(e){return zn("checkZaloCameraPermission",[],[e],Ne((function(){return Le(this,(function(e){switch(e.label){case 0:return[4,ml()];case 1:return[2,e.sent()]}}))})))}var yl=Ne((function(){return Le(this,(function(e){return[2,new Promise(function(){var e=Ne((function(e,t){var n,r,i;return Le(this,(function(o){switch(o.label){case 0:return o.trys.push([0,2,,3]),[4,Sn.jumpAndGetToken()];case 1:return o.sent(),r=null===(n=Sn.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 gl(e){return _l.apply(this,arguments)}function _l(){return(_l=Ne((function(e){return Le(this,(function(t){return[2,zn("getUserID",[],[e],Ne((function(){return Le(this,(function(e){switch(e.label){case 0:return Ge.isMp?[4,yl()]:[3,2];case 1:return[2,e.sent()];case 2:return Ge.isMpWeb?[2,Promise.resolve(void 0)]:[2,Promise.reject(He("getUserID",{}))]}}))})))]}))}))).apply(this,arguments)}var wl=Ne((function(){return Le(this,(function(e){return[2,new Promise(function(){var e=Ne((function(e,t){var n,r,i;return Le(this,(function(o){switch(o.label){case 0:return o.trys.push([0,2,,3]),[4,Sn.jumpAndGetToken()];case 1:return o.sent(),r=null===(n=Sn.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 Tl(e){return bl.apply(this,arguments)}function bl(){return(bl=Ne((function(e){return Le(this,(function(t){return[2,zn("getIDToken",[],[e],Ne((function(){return Le(this,(function(e){switch(e.label){case 0:return Ge.isMp?[4,wl()]:[3,2];case 1:return[2,e.sent()];case 2:return Ge.isMpWeb?[2,Promise.resolve(void 0)]:[2,Promise.reject(He("getIDToken",{}))]}}))})))]}))}))).apply(this,arguments)}var El={format:e.PhotoFormat.JPEG,quality:e.PhotoQuality.NORMAL,mirrored:!1,useVideoSourceSize:!1},Pl={width:1024,height:768,facingMode:e.FacingMode.FRONT,mirrored:!1,audio:!1,video:!0},Sl=function(){function t(n){var r,i,o,a,s,u=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,c=this;Mt(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};Kt.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:Pl.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:Pl.mirrored,this._userRequestFrameCallback=!1,this._audioEnabled=null!==(a=null==u?void 0:u.audio)&&void 0!==a?a:Pl.audio,this._videoEnabled=null!==(s=null==u?void 0:u.video)&&void 0!==s?s:Pl.video}var n=t.prototype;return n.on=function(t,n){Kt.getInstance().on(t,(function(e){n(e)})),t===e.CameraEvents.OnFrameCallback&&(this._userRequestFrameCallback=!0,this.tick())},n.off=function(t){Kt.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 Ne((function(){return Le(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 Ne((function(){var n,r,i,o,a,s;return Le(this,(function(u){switch(u.label){case 0:return Nt.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||Pl.width,this._videoElement.height=(null==e?void 0:e.height)||this._videoElement.height||Pl.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 Ne((function(){return Le(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 Ne((function(){var n,r;return Le(this,(function(i){return n=Kt.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=Ne((function(n,r){var i;return Le(this,(function(o){switch(o.label){case 0:return o.trys.push([0,2,,3]),[4,t.stream()];case 1:return o.sent(),Kt.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 Ne((function(){return Le(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 Ne((function(){return Le(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=Ne((function(n){return Le(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 Ne((function(){return Le(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 Ne((function(){return Le(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 Ne((function(){return Le(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(),Kt.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||El.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}(),Il=Oi({play:Qi.function(),pause:Qi.function()}).refine((function(e){return"play"in e&&"pause"in e}),{message:"Invalid HTMLVideoElement"}),Al=[Oi({videoElement:Il,mediaConstraints:Qi.object({width:Qi.number().min(100).optional(),height:Qi.number().min(100).optional(),facingMode:Qi.string().optional(),audio:Qi.boolean().optional(),video:Qi.boolean().optional(),deviceId:Qi.string().optional(),mirrored:Qi.boolean().optional()}).nullish()}).optional()];function Ol(e){return zn("createCameraContext",Al,[e],(function(e){return new Sl(e.videoElement,e.mediaConstraints)}))}var kl=function(){function e(){var t,n;Mt(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=De(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;Nt.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?Nt.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?Nt.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 Cl(e){return Nl.apply(this,arguments)}function Nl(){return(Nl=Ne((function(e){return Le(this,(function(t){return[2,zn("setupAd",[],[e],(function(){return kl.getInstance().loadSDK()}))]}))}))).apply(this,arguments)}var Ml=[Oi({ids:Qi.union([Qi.string(),Qi.array(Qi.string())]),config:Oi({display:Qi.boolean().optional(),onClose:Qi.function().optional()}).optional()})];function Rl(e){return xl.apply(this,arguments)}function xl(){return xl=Ne((function(e){return Le(this,(function(t){return[2,zn("loadAd",Ml,[e],function(){var e=Ne((function(e){return Le(this,(function(t){return kl.getInstance().load(e.ids,e.config),[2]}))}));return function(t){return e.apply(this,arguments)}}())]}))})),xl.apply(this,arguments)}var Dl=[Oi({id:Qi.string()})];function Ll(e){return Ul.apply(this,arguments)}function Ul(){return Ul=Ne((function(e){return Le(this,(function(t){return[2,zn("displayAd",Dl,[e],function(){var e=Ne((function(e){return Le(this,(function(t){return kl.getInstance().display(e.id),[2]}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Ul.apply(this,arguments)}var jl=[Oi({id:Qi.string().optional()}).optional()];function Bl(e){return Zl.apply(this,arguments)}function Zl(){return Zl=Ne((function(e){return Le(this,(function(t){return[2,zn("refreshAd",jl,[e],function(){var e=Ne((function(e){return Le(this,(function(t){return kl.getInstance().refresh(e.id),[2]}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Zl.apply(this,arguments)}var zl,Wl=[Oi({id:hi(),guidingText:hi().optional(),color:hi().optional(),onStatusChange:Qi.function().optional(),onError:Qi.function().optional()}).catchall(Qi.any())];function Fl(e){return Gl.apply(this,arguments)}function Gl(){return Gl=Ne((function(e){return Le(this,(function(n){return[2,zn("showOAWidget",Wl,[e],function(){var e=Ne((function(e){var n,r,i,o,a,s,u,c;return Le(this,(function(l){if(Ge.isMp){try{n=document.getElementById(e.id),r=e.onStatusChange,i=e.guidingText,o=e.color,a=t(e,["onStatusChange","guidingText","color"]),n&&(s=document.createElement("iframe"),u="ifOAW-".concat(e.id,"-").concat(Date.now()),(c=new URL(ke.OA)).searchParams.set("id",u),c.searchParams.set("appId",window.APP_ID),i&&c.searchParams.set("guidingText",i),o&&c.searchParams.set("color",o),Object.entries(a).forEach((function(e){var t=qe(e,2),n=t[0],r=t[1];r&&c.searchParams.set("data-".concat(n),String(r))})),s.id=u,s.src=c.href,s.style.width="100%",s.style.height="100%",s.style.border="none",n.innerHTML=s.outerHTML,window.removeEventListener("message",zl,!1),zl=function(){var e=Ne((function(e){var t,n,i,o,a,s,l,d;return Le(this,(function(p){switch(p.label){case 0:return t=e.data,e.origin.startsWith(Oe)?(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,Sn.jumpAndGetToken()]):[3,3];case 1:return p.sent(),l=null===(a=Sn.miniProgramConfig)||void 0===a?void 0:a.jwt,null==n||null===(s=n.contentWindow)||void 0===s||s.postMessage({type:i,payload:{jwt:l}},Oe),[3,3];case 2:"oaInfo"===i?null==r||r(null===(d=t.payload)||void 0===d?void 0:d.followed):"openOA"===i?ga(t.payload.id,"oa"):"heightChange"===i&&(n.style.height="".concat(t.payload,"px")),p.label=3;case 3:return[2]}}))}));return function(t){return e.apply(this,arguments)}}(),window.addEventListener("message",zl,!1))}catch(e){console.log(e)}return[2,Promise.resolve()]}return Ge.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(He("showOAWidget",{}))]}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Gl.apply(this,arguments)}var Vl,Hl=[Qi.object({id:Qi.string(),type:Qi.string(),text:Qi.string(),color:Qi.string().optional(),disabled:Qi.boolean().optional(),onDataReceived:Qi.function().optional(),onError:Qi.function().optional()}).catchall(Qi.any())];function Kl(e){return Jl.apply(this,arguments)}function Jl(){return Jl=Ne((function(e){return Le(this,(function(n){return[2,zn("showFunctionButtonWidget",Hl,[e],function(){var e=Ne((function(e){var n,r,i,o,a,s,u;return Le(this,(function(c){if(Ge.isMp){try{n=document.getElementById(e.id),r=e.onDataReceived,i=e.onError,o=t(e,["onDataReceived","onError"]),n&&(a=document.createElement("iframe"),s="ifFBW-".concat(e.id,"-").concat(Date.now()),(u=new URL(ke.FUNCTION_BUTTON)).searchParams.set("id",s),u.searchParams.set("appId",window.APP_ID),Object.entries(o).forEach((function(e){var t=qe(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=qe(e,2),n=t[0],r=t[1];r&&a.setAttribute("data-".concat(n),String(r))})),n.innerHTML=a.outerHTML,window.removeEventListener("message",Vl,!1),Vl=function(){var e=Ne((function(e){var t,n,a,c,l,d,p,f,h,m,v,y,g;return Le(this,(function(_){switch(_.label){case 0:return t=e.data,e.origin.startsWith(Oe)?(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,Sn.jumpAndGetToken()]):[3,4];case 1:return _.sent(),f=null===(l=Sn.miniProgramConfig)||void 0===l?void 0:l.jwt,h=null===(d=Sn.miniProgramConfig)||void 0===d?void 0:d.encryptKey,[4,Gn()];case 2:return m=_.sent(),null==n||null===(p=n.contentWindow)||void 0===p||p.postMessage({type:a,payload:{jwt:f,encryptKey:h,accessToken:m}},Oe),[3,4];case 3:"onSuccess"===a?(null==(v=t.payload)?void 0:v.type)===o.type&&(y={callAction:function(e,t){var r;null==n||null===(r=n.contentWindow)||void 0===r||r.postMessage({type:"context.callAction",payload:{actionName:e,actionData:t}},Oe)}},null==r||r.apply(void 0,De(Object.values(v)).concat([y]))):"onError"===a&&(null==(g=t.payload)?void 0:g.type)===o.type&&(null==i||i(null==g?void 0:g.data)),_.label=4;case 4:return[2]}}))}));return function(t){return e.apply(this,arguments)}}(),window.addEventListener("message",Vl,!1))}catch(e){console.log(e)}return[2,Promise.resolve()]}return Ge.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(He("showFunctionButtonWidget",{}))]}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Jl.apply(this,arguments)}var ql=function(){var t=Ne((function(t,n){var r;return Le(this,(function(i){return r={},"cccd"===t&&(r={mrz:null==n?void 0:n.mrz}),[2,new Promise((function(n,i){bn("SCAN_NFC",{type:e.ScanNFCType[t],data:r},{success:function(e){if("cccd"===t){var r,i,o,a,s,u,c,l,d,p,f,h,m,v,y,g,_,w,T,b,E,P={dg1:null!==(r=e.dg1)&&void 0!==r?r:"",dg2:null!==(i=e.dg2)&&void 0!==i?i:"",dg3:null!==(o=e.dg3)&&void 0!==o?o:"",dg4:null!==(a=e.dg4)&&void 0!==a?a:"",dg5:null!==(s=e.dg5)&&void 0!==s?s:"",dg6:null!==(u=e.dg6)&&void 0!==u?u:"",dg7:null!==(c=e.dg7)&&void 0!==c?c:"",dg8:null!==(l=e.dg8)&&void 0!==l?l:"",dg9:null!==(d=e.dg9)&&void 0!==d?d:"",dg10:null!==(p=e.dg10)&&void 0!==p?p:"",dg11:null!==(f=e.dg11)&&void 0!==f?f:"",dg12:null!==(h=e.dg12)&&void 0!==h?h:"",dg13:null!==(m=e.dg13)&&void 0!==m?m:"",dg14:null!==(v=e.dg14)&&void 0!==v?v:"",dg15:null!==(y=e.dg15)&&void 0!==y?y:"",dg16:null!==(g=e.dg16)&&void 0!==g?g:"",com:null!==(_=e.com)&&void 0!==_?_:"",sod:null!==(w=e.sod)&&void 0!==w?w:"",challenge:null!==(T=e.challenge)&&void 0!==T?T:"",aAResult:null!==(b=e.aAResult)&&void 0!==b?b:"",eACCAResult:null!==(E=e.eACCAResult)&&void 0!==E?E:""};n(P)}else n({})},fail:function(e){i(e)}},{timeout:!1})}))]}))}));return function(e,n){return t.apply(this,arguments)}}(),Ql=[Oi({type:Qi.enum(["cccd"]),data:Oi({mrz:hi().max(90)})})];function Yl(e){return $l.apply(this,arguments)}function $l(){return $l=Ne((function(e){return Le(this,(function(t){return[2,zn("scanNFC",Ql,[e],function(){var e=Ne((function(e){var t,n;return Le(this,(function(r){switch(r.label){case 0:return Ge.isMp?pn(754,620)?(t=e.type,n=e.data,[4,ql(t,n)]):[3,2]:[3,3];case 1:return[2,r.sent()];case 2:return[2,Promise.reject(wn.error.clientNotSupport())];case 3:return Ge.isMpWeb?[2,Promise.resolve({})]:[2,Promise.reject(He("scanNFC",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),$l.apply(this,arguments)}var Xl=Ne((function(){return Le(this,(function(e){return[2,new Promise((function(e,t){bn("CHECK_NFC",{},{success:function(t){e(t)},fail:function(e){t(e)}},{timeout:!1})}))]}))}));function ed(e){return td.apply(this,arguments)}function td(){return(td=Ne((function(e){return Le(this,(function(t){return[2,zn("checkNFC",[],[e],Ne((function(){return Le(this,(function(e){switch(e.label){case 0:return Ge.isMp?[4,Xl()]:[3,2];case 1:return[2,e.sent()];case 2:return Ge.isMpWeb?[2,Promise.resolve({})]:[2,Promise.reject(He("checkNFC",{}))]}}))})))]}))}))).apply(this,arguments)}var nd=[Qi.string().trim().min(1)];var rd=[Qi.string().trim().min(1),Qi.string().trim()];var id=[Qi.string().trim().min(1)];var od={getItem:function(e){return zn("getItem",nd,[e],(function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];if(Ge.isMp||Ge.isMpWeb){if(pn(757,625))return No.getItem(t[0]);throw wn.error.clientNotSupport()}throw He("getItem",{})}))},setItem:function(e,t){return zn("setItem",rd,[e,t],(function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];if(Ge.isMp||Ge.isMpWeb){if(pn(757,625))return No.setItem(t[0],t[1]);throw wn.error.clientNotSupport()}throw He("setItem",{})}))},clear:function(){return zn("clear",[],[],(function(){if(Ge.isMp||Ge.isMpWeb){if(pn(757,625))return No.clearStorageSync();throw wn.error.clientNotSupport()}throw He("clear",{})}))},removeItem:function(e){return zn("removeItem",id,[e],(function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];if(Ge.isMp||Ge.isMpWeb){if(pn(757,625))return No.removeItem(t[0]);throw wn.error.clientNotSupport()}throw He("removeItem",{})}))},getStorageInfo:function(){return zn("getStorageInfoSync",[],[],(function(){if(Ge.isMp||Ge.isMpWeb){if(pn(757,625))return No.getStorageInfoSync();throw wn.error.clientNotSupport()}throw He("getStorageInfoSync",{})}))}},ad={purchase:dc,createOrder:ac,checkTransaction:gc,createOrderIAP:bc,selectPaymentMethod:mc},sd=ad,ud=function(){var e=Ne((function(e,t,n){var r;return Le(this,(function(i){return r={},t?r={fileBase64Data:t}:e&&(r={fileUrl:e}),[2,new Promise((function(e,t){bn("SAVE_FILE",Ia(Je({},r),{onProgress:n}),{success:function(t){e()},fail:function(e){t(e)}},{})}))]}))}));return function(t,n,r){return e.apply(this,arguments)}}(),cd=[Oi({url:Qi.string().url().optional(),fileBase64Data:Qi.string().max(7e6).optional()}).optional()];function ld(e){return dd.apply(this,arguments)}function dd(){return dd=Ne((function(e){return Le(this,(function(t){return[2,zn("downloadFile",cd,[e],function(){var e=Ne((function(e){return Le(this,(function(t){switch(t.label){case 0:return Ge.isMp?[4,ud(e.url,e.fileBase64Data,e.onProgress)]:[3,2];case 1:return[2,t.sent()];case 2:return Ge.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(He("downloadFile",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),dd.apply(this,arguments)}var pd=Qi.enum(["APP_INITIALIZING","APP_READY"]),fd=Qi.any();var hd,md={logEvent:function(e,t){return zn("logEvent",[pd,fd],[e,t],(function(e,t){if(Ge.isMp||Ge.isMpWeb){var n,r,i,o=Ia(Je({},"object"==typeof t&&null!==t?t:{}),{duration:Math.round(performance.now()),timestamp:Date.now()});return null===window||void 0===window||null===(n=window.zmpGlobal)||void 0===n||null===(r=n.eventManager)||void 0===r||null===(i=r.logEventForClient)||void 0===i||i.call(r,{type:p.DEV_TRACKING,eventCode:"APP_INITIALIZING"===e?f.APP_INITIALIZING:f.APP_READY}),an([{action:"zmp.app.lifecycle.tracking",error:0,message:"",data:Je({eventType:e},o)}])}throw He("logEvent",{})}))}},vd=[Oi({id:hi(),textColor:Qi.string().optional(),fontSize:Qi.string().optional(),buttonHeight:Qi.string().optional(),buttonColor:Qi.string().optional(),buttonTextColor:Qi.string().optional(),buttonRadius:Qi.string().optional(),buttonText:Qi.string().optional(),checkboxBGColor:Qi.string().optional(),checkboxCheckmarkColor:Qi.string().optional(),onClick:Qi.function().optional(),onStatusChange:Qi.function().optional(),onError:Qi.function().optional()}).catchall(Qi.any())];function yd(e){return gd.apply(this,arguments)}function gd(){return gd=Ne((function(e){return Le(this,(function(n){return[2,zn("showCustomOAWidget",vd,[e],function(){var e=Ne((function(e){var n,r,i,o,a,s,u,c,l,d,p,f,h,m,v,y,g,_,w,T,b;return Le(this,(function(E){if(Ge.isMp){try{n=document.getElementById(e.id),r=e.textColor,i=e.fontSize,o=e.buttonHeight,a=e.buttonColor,s=e.buttonTextColor,u=e.buttonRadius,c=e.buttonText,l=e.checkboxBGColor,d=e.checkboxCheckmarkColor,p=e.onStatusChange,f=e.onClick,h=e.onError,m=t(e,["textColor","fontSize","buttonHeight","buttonColor","buttonTextColor","buttonRadius","buttonText","checkboxBGColor","checkboxCheckmarkColor","onStatusChange","onClick","onError"]),n&&(v=document.createElement("iframe"),y="ifCOAW-".concat(e.id,"-").concat(Date.now()),g=new URL(ke.CUSTOM_OA),_={id:y,appId:window.APP_ID,textColor:r,fontSize:i,buttonHeight:o,buttonColor:a,buttonTextColor:s,buttonRadius:u,buttonText:c,checkboxBGColor:l,checkboxCheckmarkColor:d},Object.entries(m).forEach((function(e){var t=qe(e,2),n=t[0],r=t[1];r&&(_["data-".concat(n)]=String(r))})),w=JSON.stringify(_),P=w,S=(new TextEncoder).encode(P),I=Array.from(S).map((function(e){return String.fromCharCode(e)})).join(""),T=btoa(I),b=encodeURIComponent(T),Bn(g.searchParams,"data",b),v.id=y,v.src=g.href,v.style.width="100%",v.style.height="100%",v.style.border="none",n.innerHTML=v.outerHTML,window.removeEventListener("message",hd,!1),hd=function(){var e=Ne((function(e){var t,n,r,i,o,a,s,u,c;return Le(this,(function(l){switch(l.label){case 0:return t=e.data,e.origin.startsWith(Oe)?(n=document.getElementById(y),r=t.type,(i=new URL(t.href)).origin!==g.origin||i.pathname!==g.pathname||t.id!==y?[3,3]:"followOA"!==r&&"getOAInfo"!==r?[3,2]:[4,Sn.jumpAndGetToken()]):[3,3];case 1:return l.sent(),s=null===(o=Sn.miniProgramConfig)||void 0===o?void 0:o.jwt,null==n||null===(a=n.contentWindow)||void 0===a||a.postMessage({type:r,payload:{jwt:s}},Oe),[3,3];case 2:"oaInfo"===r?null==p||p(null===(u=t.payload)||void 0===u?void 0:u.followed):"openOA"===r?ga(t.payload.id,"oa"):"heightChange"===r?n.style.height="".concat(t.payload,"px"):"onClick"===r?null==f||f(null===(c=t.payload)||void 0===c?void 0:c.status):"onError"===r&&(null==h||h(t.payload)),l.label=3;case 3:return[2]}}))}));return function(t){return e.apply(this,arguments)}}(),window.addEventListener("message",hd,!1))}catch(e){console.log(e)}return[2,Promise.resolve()]}var P,S,I;return Ge.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(He("showCustomOAWidget",{}))]}))}));return function(t){return e.apply(this,arguments)}}())]}))})),gd.apply(this,arguments)}var _d,wd=[Oi({id:hi(),onMethodChange:Qi.function().optional()}).catchall(Qi.any())];function Td(){return Td=Ne((function(e){return Le(this,(function(n){return[2,zn("showWidget",wd,[e],function(){var e=Ne((function(e){var n,r,i,o,a,s,u,c,l,d,p,f;return Le(this,(function(h){if(Ge.isMp){try{n=document.getElementById(e.id),r=e.onMethodChange,i=e.fail,o=t(e,["onMethodChange","fail"]),n&&((a=document.getElementById(Ae))&&(null==a||null===(s=a.parentNode)||void 0===s||s.removeChild(a),a=null),a=document.createElement("iframe"),u=Ae,c=new URL(ke.CHECKOUT_KIT),l={id:u,appId:window.APP_ID},Object.entries(o).forEach((function(e){var t=qe(e,2),n=t[0],r=t[1];r&&(l["data-".concat(n)]=r)})),d=JSON.stringify(l),p=btoa(d),f=encodeURIComponent(p),Bn(c.searchParams,"data",f),a.id=u,a.src=c.href,a.style.width="100%",a.style.height="100%",a.style.border="none",n.innerHTML=a.outerHTML,window.removeEventListener("message",_d,!1),_d=function(){var e=Ne((function(e){var t,n,o,a,s,l,d,p,f,h;return Le(this,(function(m){switch(m.label){case 0:if(t=e.data,!e.origin.startsWith(Oe))return[3,9];if(n=t.type,o=document.getElementById(u),(a=new URL(t.href)).origin!==c.origin||a.pathname!==c.pathname||t.id!==u)return[3,9];switch(n){case"getInfo":return[3,1];case"getToken":return[3,2];case"heightChange":return[3,4];case"callAction":return[3,5];case"onMethodChange":return[3,6];case"onError":return[3,7]}return[3,8];case 1:return Zn(o,n,{appId:window.APP_ID,zaloVersion:dn(),appPlatform:null===(s=Fe())||void 0===s?void 0:s.platformName}),[3,9];case 2:return[4,Sn.jumpAndGetToken()];case 3:return m.sent(),d=null===(l=Sn.miniProgramConfig)||void 0===l?void 0:l.jwt,Zn(o,n,{jwt:d}),[3,9];case 4:return o.style.height="".concat(t.payload,"px"),[3,9];case 5:return p=t.payload,f=p.actionName,h=p.actionData,String(f).length>0&&bn(f,h,{success:function(e){Zn(o,n,{status:0,actionName:f,data:e})},fail:function(e){Zn(o,n,{status:-1,actionName:f,data:e})}},{}),[3,9];case 6:return null==r||r.apply(void 0,De(Object.values(t.payload))),[3,9];case 7:null==i||i(t.payload),m.label=8;case 8:return[3,9];case 9:return[2]}}))}));return function(t){return e.apply(this,arguments)}}(),window.addEventListener("message",_d,!1))}catch(e){console.log(e)}return[2,Promise.resolve()]}return Ge.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(He("showWidget",{}))]}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Td.apply(this,arguments)}var bd,Ed=[Oi({amount:Qi.union([Qi.string(),Qi.number()]),desc:Qi.string(),payload:Qi.object({}).catchall(Qi.any()).optional()}).catchall(Qi.any())];function Pd(){return Pd=Ne((function(e){return Le(this,(function(n){return[2,zn("purchase",Ed,[e],function(){var e=Ne((function(e){return Le(this,(function(n){return Ge.isMp?[2,new Promise((function(n,r){var i=document.getElementById(Ae),o=new URL(ke.CHECKOUT_KIT);if(!(i&&fn(i,HTMLIFrameElement)&&i.src.startsWith(o.origin)&&i.src.includes(o.pathname)))return r(He("purchase",{message:"Widget not found or not initialized."}));e.amount,e.desc,e.payload;var a=t(e,["amount","desc","payload"]),s="purchase";Zn(i,s,Je({amount:String(e.amount),desc:e.desc,payload:e.payload||{}},a)),window.removeEventListener("message",bd,!1),bd=function(){var e=Ne((function(e){var t,i,a;return Le(this,(function(u){if(t=e.data,e.origin.startsWith(Oe)&&(i=t.type,(a=new URL(t.href)).origin===o.origin&&a.pathname===o.pathname&&t.id===Ae)){if(i===s)return[2,n(t.payload)];if("onError"===i)return[2,r(t.payload)]}return[2]}))}));return function(t){return e.apply(this,arguments)}}(),window.addEventListener("message",bd,!1)}))]:Ge.isMpWeb?[2,Promise.resolve({orderId:"",messageToken:"",transId:""})]:[2,Promise.reject(He("purchase",{}))]}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Pd.apply(this,arguments)}var Sd={showWidget:function(e){return Td.apply(this,arguments)},purchase:function(e){return Pd.apply(this,arguments)}},Id=function(){var e=Ne((function(e){var t,n,r,i,o=arguments;return Le(this,(function(a){return t=o.length>1&&void 0!==o[1]?o[1]:"",n=o.length>2&&void 0!==o[2]&&o[2],r=o.length>3&&void 0!==o[3]&&o[3],i=o.length>4&&void 0!==o[4]&&o[4],[2,new Promise((function(o,a){bn("OPEN_DOCUMENT",{url:e,title:t,share:n,download:r,edit:i},{success:function(e){o()},fail:function(e){a(e)}},{timeout:!1})}))]}))}));return function(t){return e.apply(this,arguments)}}(),Ad=[Oi({url:hi(),title:hi().optional(),share:Qi.boolean().optional().default(!1),download:Qi.boolean().optional().default(!1),edit:Qi.boolean().optional().default(!1)})];function Od(e){return kd.apply(this,arguments)}function kd(){return kd=Ne((function(e){return Le(this,(function(t){return[2,zn("openDocument",Ad,[e],function(){var e=Ne((function(e){var t;return Le(this,(function(n){switch(n.label){case 0:return Ge.isMp?pn(25091842,666)?(t=!!(un()&&dn()>=25111864)&&e.share,[4,Id(e.url,e.title,t,e.download,e.edit)]):[3,2]:[3,3];case 1:return[2,n.sent()];case 2:return[2,Promise.reject(wn.error.clientNotSupport())];case 3:return Ge.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(He("openDocument",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),kd.apply(this,arguments)}function Cd(e){return Nd.apply(this,arguments)}function Nd(){return(Nd=Ne((function(e){return Le(this,(function(t){return[2,zn("getEntrySource",[],[e],Ne((function(){var e,t;return Le(this,(function(n){switch(n.label){case 0:return Ge.isMp?[4,Sn.jumpAndGetToken()]:[3,2];case 1:return n.sent(),t=null===(e=Sn.miniProgramConfig)||void 0===e?void 0:e.srcOpen,[2,Promise.resolve({srcOpen:t||""})];case 2:return[2,Promise.resolve({srcOpen:""})]}}))})))]}))}))).apply(this,arguments)}var Md=Ne((function(){return Le(this,(function(e){return[2,new Promise((function(e,t){bn("GET_DEVICE_INFO",{},{success:function(t){e(t)},fail:function(e){t(e)}},{})}))]}))}));function Rd(e){return xd.apply(this,arguments)}function xd(){return(xd=Ne((function(e){return Le(this,(function(t){return[2,zn("getDeviceInfo",[],[e],Ne((function(){return Le(this,(function(e){switch(e.label){case 0:return Ge.isMp?pn(25102854,674)?[4,Md()]:[3,2]:[3,3];case 1:return[2,e.sent()];case 2:return[2,Promise.reject(wn.error.clientNotSupport())];case 3:return Ge.isMpWeb?[2,Promise.resolve({})]:[2,Promise.reject(He("getDeviceInfo",{}))]}}))})))]}))}))).apply(this,arguments)}var Dd=function(){var e=Ne((function(e,t){return Le(this,(function(n){return[2,new Promise((function(n,r){bn("LFS_FILE_INFO",{file_path:e,digest_algorithm:t},{success:function(e){n(e)},fail:function(e){r(e)}},{})}))]}))}));return function(t,n){return e.apply(this,arguments)}}();function Ld(){return Ud.apply(this,arguments)}function Ud(){return(Ud=Ne((function(){return Le(this,(function(e){return[2,zn("isSupportLFS",[],[],Ne((function(){return Le(this,(function(e){return Ge.isMp?[2,Promise.resolve({support:pn(25112868,692)})]:Ge.isMpWeb?[2,Promise.resolve({support:!1})]:[2,Promise.reject(He("isSupportLFS",{}))]}))})))]}))}))).apply(this,arguments)}var jd=[Oi({filePath:Qi.string(),digestAlgorithm:Qi.enum(["sha1","md5"]).optional().default("md5")}).optional()];function Bd(){return Bd=Ne((function(e){return Le(this,(function(t){return[2,zn("getFileInfo",jd,[e],function(){var e=Ne((function(e){var t;return Le(this,(function(n){switch(n.label){case 0:return Ge.isMp?[4,Ld()]:[3,4];case 1:return n.sent().support?(t=e.digestAlgorithm||"md5",[4,Dd(e.filePath,t)]):[3,3];case 2:return[2,n.sent()];case 3:throw wn.error.clientNotSupport();case 4:return Ge.isMpWeb?[2,Promise.resolve({size:"",digest:"",type:""})]:[2,Promise.reject(He("getFileInfo",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Bd.apply(this,arguments)}var Zd=Ne((function(){return Le(this,(function(e){return[2,new Promise((function(e,t){bn("LFS_LIST",{},{success:function(t){var n=t.map((function(e){var t=Je({},e);try{t.filePath=t.file_path,t.createTime=t.created_time,delete t.file_path,delete t.created_time}catch(e){}return t}));e({list:n})},fail:function(e){t(e)}},{})}))]}))}));function zd(){return zd=Ne((function(e){return Le(this,(function(t){return[2,zn("getSavedFileList",[],[e],function(){var e=Ne((function(e){return Le(this,(function(e){switch(e.label){case 0:return Ge.isMp?[4,Ld()]:[3,4];case 1:return e.sent().support?[4,Zd()]:[3,3];case 2:return[2,e.sent()];case 3:throw wn.error.clientNotSupport();case 4:return Ge.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(He("getSavedFileList",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),zd.apply(this,arguments)}var Wd=function(){var e=Ne((function(e){return Le(this,(function(t){return[2,new Promise((function(t,n){bn("LFS_FILE_REMOVE",{file_path:e},{success:function(e){t(e)},fail:function(e){n(e)}},{})}))]}))}));return function(t){return e.apply(this,arguments)}}(),Fd=[Oi({filePath:Qi.string()}).optional()];function Gd(){return Gd=Ne((function(e){return Le(this,(function(t){return[2,zn("removeSavedFile",Fd,[e],function(){var e=Ne((function(e){return Le(this,(function(t){switch(t.label){case 0:return Ge.isMp?[4,Ld()]:[3,4];case 1:return t.sent().support?[4,Wd(e.filePath)]:[3,3];case 2:return[2,t.sent()];case 3:throw wn.error.clientNotSupport();case 4:return Ge.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(He("removeSavedFile",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Gd.apply(this,arguments)}var Vd=function(){var e=Ne((function(e,t){var n;return Le(this,(function(r){return n={file_path:e},[2,new Promise((function(e,r){bn("LFS_FILE_SAVE",Ia(Je({},n),{onProgress:t}),{success:function(t){e({savedPath:t})},fail:function(e){r(e)}},{})}))]}))}));return function(t,n){return e.apply(this,arguments)}}(),Hd=[Oi({filePath:Qi.string()}).optional()];function Kd(){return Kd=Ne((function(e){return Le(this,(function(t){return[2,zn("saveFile",Hd,[e],function(){var e=Ne((function(e){return Le(this,(function(t){switch(t.label){case 0:return Ge.isMp?[4,Ld()]:[3,4];case 1:return t.sent().support?[4,Vd(e.filePath,e.onProgress)]:[3,3];case 2:return[2,t.sent()];case 3:throw wn.error.clientNotSupport();case 4:return Ge.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(He("saveFile",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Kd.apply(this,arguments)}var Jd={getFileInfo:function(e){return Bd.apply(this,arguments)},getSavedFileList:function(e){return zd.apply(this,arguments)},removeSavedFile:function(e){return Gd.apply(this,arguments)},saveFile:function(e){return Kd.apply(this,arguments)},isSupportLFS:Ld};window.ZaloMiniAppSDK={getVersion:Jn},Wn();var qd=Object.freeze({__proto__:null,get Events(){return e.Events},get EventName(){return e.Events},get CameraEvents(){return e.CameraEvents},AppError:mn,login:Wn,getAccessToken:Gn,getVersion:Jn,getSystemInfo:Qn,setNavigationBarTitle:eo,setNavigationBarColor:ro,setNavigationBarLeftButton:ao,setStorage:Ro,getStorage:Lo,getStorageInfo:jo,removeStorage:zo,clearStorage:Go,getUserInfo:Jo,getNetworkType:$o,onNetworkStatusChange:ta,startBeaconDiscovery:ia,stopBeaconDiscovery:sa,getBeacons:la,closeApp:fa,scanQRCode:va,openProfile:wa,openChat:Pa,openPostFeed:ka,followOA:Ra,unfollowOA:Ua,openShareSheet:Wa,requestCameraPermission:Va,createShortcut:Ya,openBioAuthentication:ts,checkStateBioAuthentication:is,showToast:us,hideKeyboard:ds,openPhone:ms,openSMS:_s,viewOAQr:Es,keepScreen:As,onKeepScreen:ks,offKeepScreen:Ns,saveImageToGallery:Ds,saveVideoToGallery:Bs,openMiniApp:Fs,vibrate:Ks,openWebview:Ys,getRouteParams:eu,getAppInfo:tu,sendDataToPreviousMiniApp:ou,getPhoneNumber:uu,openProfilePicker:pu,connectWifi:vu,openMediaPicker:wu,getShareableLink:Eu,closeLoading:Iu,requestUpdateZalo:Ou,onConfirmToExit:Mu,offConfirmToExit:Ru,getDeviceId:xu,getDeviceIdAsync:Du,getContext:Uu,getContextAsync:ju,getAuthCode:Zu,getZPIToken:Wu,setAccessToken:Vu,openOutApp:Ku,chooseImage:Qu,getLocation:Xu,onCallbackData:nc,createOrder:ac,purchase:dc,selectPaymentMethod:mc,checkTransaction:gc,createOrderIAP:bc,events:Cu,setAndroidBottomNavigationBar:Sc,setIOSBottomSafeArea:Oc,setStatusBar:Nc,configAppView:xc,minimizeApp:Uc,openPermissionSetting:Zc,favoriteApp:Fc,openGroupList:Hc,requestSendNotification:qc,addRating:$c,interactOA:il,interactOa:il,isAllowedInteractWithOA:sl,getSetting:cl,authorize:fl,checkZaloCameraPermission:vl,getUserID:gl,getIDToken:Tl,createCameraContext:Ol,setupAd:Cl,loadAd:Rl,displayAd:Ll,refreshAd:Bl,showOAWidget:Fl,showFunctionButtonWidget:Kl,scanNFC:Yl,checkNFC:ed,nativeStorage:od,Payment:ad,CheckoutSDK:sd,downloadFile:ld,trackingManager:md,showCustomOAWidget:yd,CheckoutKit:Sd,openDocument:Od,getEntrySource:Cd,getDeviceInfo:Rd,LFSStorage:Jd,get FacingMode(){return e.FacingMode},get PhotoFormat(){return e.PhotoFormat},get PhotoQuality(){return e.PhotoQuality},get StreamType(){return e.StreamType},ZMACameraImp:Sl}),Qd=t(qd,["createOrder","checkTransaction","createOrderIAP","selectPaymentMethod","purchase"]);!function(){var e,t=null===(e=Fe())||void 0===e?void 0:e.appEnv;(null==t?void 0:t.isMp)&&(window.ZaloMiniAppSDK={},Object.assign(window.ZaloMiniAppSDK,qd))}(),e.AppError=mn,e.CheckoutKit=Sd,e.CheckoutSDK=sd,e.EventName=e.Events,e.LFSStorage=Jd,e.Payment=ad,e.ZMACameraImp=Sl,e.addRating=$c,e.authorize=fl,e.checkNFC=ed,e.checkStateBioAuthentication=is,e.checkTransaction=gc,e.checkZaloCameraPermission=vl,e.chooseImage=Qu,e.clearStorage=Go,e.closeApp=fa,e.closeLoading=Iu,e.configAppView=xc,e.connectWifi=vu,e.createCameraContext=Ol,e.createOrder=ac,e.createOrderIAP=bc,e.createShortcut=Ya,e.default=Qd,e.displayAd=Ll,e.downloadFile=ld,e.events=Cu,e.favoriteApp=Fc,e.followOA=Ra,e.getAccessToken=Gn,e.getAppInfo=tu,e.getAuthCode=Zu,e.getBeacons=la,e.getContext=Uu,e.getContextAsync=ju,e.getDeviceId=xu,e.getDeviceIdAsync=Du,e.getDeviceInfo=Rd,e.getEntrySource=Cd,e.getIDToken=Tl,e.getLocation=Xu,e.getNetworkType=$o,e.getPhoneNumber=uu,e.getRouteParams=eu,e.getSetting=cl,e.getShareableLink=Eu,e.getStorage=Lo,e.getStorageInfo=jo,e.getSystemInfo=Qn,e.getUserID=gl,e.getUserInfo=Jo,e.getVersion=Jn,e.getZPIToken=Wu,e.hideKeyboard=ds,e.interactOA=il,e.interactOa=il,e.isAllowedInteractWithOA=sl,e.keepScreen=As,e.loadAd=Rl,e.login=Wn,e.minimizeApp=Uc,e.nativeStorage=od,e.offConfirmToExit=Ru,e.offKeepScreen=Ns,e.onCallbackData=nc,e.onConfirmToExit=Mu,e.onKeepScreen=ks,e.onNetworkStatusChange=ta,e.openBioAuthentication=ts,e.openChat=Pa,e.openDocument=Od,e.openGroupList=Hc,e.openMediaPicker=wu,e.openMiniApp=Fs,e.openOutApp=Ku,e.openPermissionSetting=Zc,e.openPhone=ms,e.openPostFeed=ka,e.openProfile=wa,e.openProfilePicker=pu,e.openSMS=_s,e.openShareSheet=Wa,e.openWebview=Ys,e.purchase=dc,e.refreshAd=Bl,e.removeStorage=zo,e.requestCameraPermission=Va,e.requestSendNotification=qc,e.requestUpdateZalo=Ou,e.saveImageToGallery=Ds,e.saveVideoToGallery=Bs,e.scanNFC=Yl,e.scanQRCode=va,e.selectPaymentMethod=mc,e.sendDataToPreviousMiniApp=ou,e.setAccessToken=Vu,e.setAndroidBottomNavigationBar=Sc,e.setIOSBottomSafeArea=Oc,e.setNavigationBarColor=ro,e.setNavigationBarLeftButton=ao,e.setNavigationBarTitle=eo,e.setStatusBar=Nc,e.setStorage=Ro,e.setupAd=Cl,e.showCustomOAWidget=yd,e.showFunctionButtonWidget=Kl,e.showOAWidget=Fl,e.showToast=us,e.startBeaconDiscovery=ia,e.stopBeaconDiscovery=sa,e.trackingManager=md,e.unfollowOA=Ua,e.vibrate=Ks,e.viewOAQr=Es,Object.defineProperty(e,"__esModule",{value:!0})}));