zmp-sdk 2.15.0 → 2.15.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.umd.js CHANGED
@@ -15,4 +15,4 @@
15
15
  ***************************************************************************** */
16
16
  function Wn(e,t,n,r){var i,o=arguments.length,a=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(a=(o<3?i(a):o>3?i(t,n,a):i(t,n))||a);return o>3&&a&&Object.defineProperty(t,n,a),a}function Hn(e,t){return function(n,r){t(n,r,e)}}function Zn(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{u(r.next(e))}catch(e){o(e)}}function s(e){try{u(r.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}u((r=r.apply(e,t||[])).next())}))}function qn(e,t){if(!t.has(e))throw new TypeError("attempted to get private field on non-instance");return t.get(e)}function Gn(e,t,n){if(!t.has(e))throw new TypeError("attempted to set private field on non-instance");return t.set(e,n),n}var $n=n((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],f=arguments.length;if(l.fn){switch(l.once&&this.removeListener(e,l.fn,void 0,!0),f){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(f-1);c<f;c++)u[c-1]=arguments[c];l.fn.apply(l.context,u)}else{var h,d=l.length;for(c=0;c<d;c++)switch(l[c].once&&this.removeListener(e,l[c].fn,void 0,!0),f){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(h=1,u=new Array(f-1);h<f;h++)u[h-1]=arguments[h];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}));class Kn extends $n{constructor(){super(),this.debug=cn("zmp:event-emitter")}static getInstance(){return Kn.instance||(Kn.instance=new Kn),Kn.instance}h5ConfirmHandleEvent(e,t,n){ZaloJavaScriptInterface.jsH5EventCallback(e,t,n||"")}on(e,t,n){this.debug(`register ${e}: ${n}`);return super.on(e,((r,i)=>{this.h5ConfirmHandleEvent(r,e,n),t(i)}),n)}once(e,t,n){this.debug(`register once ${e}: ${n}`);return super.once(e,((r,i)=>{this.h5ConfirmHandleEvent(r,e,n),t(i)}),n)}}var Yn=function(e,t){return function(){for(var n=new Array(arguments.length),r=0;r<n.length;r++)n[r]=arguments[r];return e.apply(t,n)}},Vn=Object.prototype.toString;function Jn(e){return"[object Array]"===Vn.call(e)}function Qn(e){return void 0===e}function Xn(e){return null!==e&&"object"==typeof e}function er(e){if("[object Object]"!==Vn.call(e))return!1;var t=Object.getPrototypeOf(e);return null===t||t===Object.prototype}function tr(e){return"[object Function]"===Vn.call(e)}function nr(e,t){if(null!=e)if("object"!=typeof e&&(e=[e]),Jn(e))for(var n=0,r=e.length;n<r;n++)t.call(null,e[n],n,e);else for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.call(null,e[i],i,e)}var rr={isArray:Jn,isArrayBuffer:function(e){return"[object ArrayBuffer]"===Vn.call(e)},isBuffer:function(e){return null!==e&&!Qn(e)&&null!==e.constructor&&!Qn(e.constructor)&&"function"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)},isFormData:function(e){return"undefined"!=typeof FormData&&e instanceof FormData},isArrayBufferView:function(e){return"undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&e.buffer instanceof ArrayBuffer},isString:function(e){return"string"==typeof e},isNumber:function(e){return"number"==typeof e},isObject:Xn,isPlainObject:er,isUndefined:Qn,isDate:function(e){return"[object Date]"===Vn.call(e)},isFile:function(e){return"[object File]"===Vn.call(e)},isBlob:function(e){return"[object Blob]"===Vn.call(e)},isFunction:tr,isStream:function(e){return Xn(e)&&tr(e.pipe)},isURLSearchParams:function(e){return"undefined"!=typeof URLSearchParams&&e instanceof URLSearchParams},isStandardBrowserEnv:function(){return("undefined"==typeof navigator||"ReactNative"!==navigator.product&&"NativeScript"!==navigator.product&&"NS"!==navigator.product)&&("undefined"!=typeof window&&"undefined"!=typeof document)},forEach:nr,merge:function e(){var t={};function n(n,r){er(t[r])&&er(n)?t[r]=e(t[r],n):er(n)?t[r]=e({},n):Jn(n)?t[r]=n.slice():t[r]=n}for(var r=0,i=arguments.length;r<i;r++)nr(arguments[r],n);return t},extend:function(e,t,n){return nr(t,(function(t,r){e[r]=n&&"function"==typeof t?Yn(t,n):t})),e},trim:function(e){return e.replace(/^\s*/,"").replace(/\s*$/,"")},stripBOM:function(e){return 65279===e.charCodeAt(0)&&(e=e.slice(1)),e}};function ir(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}var or=function(e,t,n){if(!t)return e;var r;if(n)r=n(t);else if(rr.isURLSearchParams(t))r=t.toString();else{var i=[];rr.forEach(t,(function(e,t){null!=e&&(rr.isArray(e)?t+="[]":e=[e],rr.forEach(e,(function(e){rr.isDate(e)?e=e.toISOString():rr.isObject(e)&&(e=JSON.stringify(e)),i.push(ir(t)+"="+ir(e))})))})),r=i.join("&")}if(r){var o=e.indexOf("#");-1!==o&&(e=e.slice(0,o)),e+=(-1===e.indexOf("?")?"?":"&")+r}return e};function ar(){this.handlers=[]}ar.prototype.use=function(e,t){return this.handlers.push({fulfilled:e,rejected:t}),this.handlers.length-1},ar.prototype.eject=function(e){this.handlers[e]&&(this.handlers[e]=null)},ar.prototype.forEach=function(e){rr.forEach(this.handlers,(function(t){null!==t&&e(t)}))};var sr,ur,cr=ar,lr=function(e,t,n){return rr.forEach(n,(function(n){e=n(e,t)})),e},fr=function(e){return!(!e||!e.__CANCEL__)},hr=function(e,t){rr.forEach(e,(function(n,r){r!==t&&r.toUpperCase()===t.toUpperCase()&&(e[t]=n,delete e[r])}))},dr=function(e,t,n,r,i){return e.config=t,n&&(e.code=n),e.request=r,e.response=i,e.isAxiosError=!0,e.toJSON=function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:this.config,code:this.code}},e},pr=function(e,t,n,r,i){var o=new Error(e);return dr(o,t,n,r,i)},vr=function(e,t,n){var r=n.config.validateStatus;n.status&&r&&!r(n.status)?t(pr("Request failed with status code "+n.status,n.config,null,n.request,n)):e(n)},gr=rr.isStandardBrowserEnv()?{write:function(e,t,n,r,i,o){var a=[];a.push(e+"="+encodeURIComponent(t)),rr.isNumber(n)&&a.push("expires="+new Date(n).toGMTString()),rr.isString(r)&&a.push("path="+r),rr.isString(i)&&a.push("domain="+i),!0===o&&a.push("secure"),document.cookie=a.join("; ")},read:function(e){var t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove:function(e){this.write(e,"",Date.now()-864e5)}}:{write:function(){},read:function(){return null},remove:function(){}},_r=function(e,t){return e&&!function(e){return/^([a-z][a-z\d\+\-\.]*:)?\/\//i.test(e)}(t)?function(e,t){return t?e.replace(/\/+$/,"")+"/"+t.replace(/^\/+/,""):e}(e,t):t},mr=["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"],yr=rr.isStandardBrowserEnv()?function(){var e,t=/(msie|trident)/i.test(navigator.userAgent),n=document.createElement("a");function r(e){var r=e;return t&&(n.setAttribute("href",r),r=n.href),n.setAttribute("href",r),{href:n.href,protocol:n.protocol?n.protocol.replace(/:$/,""):"",host:n.host,search:n.search?n.search.replace(/^\?/,""):"",hash:n.hash?n.hash.replace(/^#/,""):"",hostname:n.hostname,port:n.port,pathname:"/"===n.pathname.charAt(0)?n.pathname:"/"+n.pathname}}return e=r(window.location.href),function(t){var n=rr.isString(t)?r(t):t;return n.protocol===e.protocol&&n.host===e.host}}():function(){return!0},wr=function(e){return new Promise((function(t,n){var r=e.data,i=e.headers;rr.isFormData(r)&&delete i["Content-Type"];var o=new XMLHttpRequest;if(e.auth){var a=e.auth.username||"",s=e.auth.password?unescape(encodeURIComponent(e.auth.password)):"";i.Authorization="Basic "+btoa(a+":"+s)}var u=_r(e.baseURL,e.url);if(o.open(e.method.toUpperCase(),or(u,e.params,e.paramsSerializer),!0),o.timeout=e.timeout,o.onreadystatechange=function(){if(o&&4===o.readyState&&(0!==o.status||o.responseURL&&0===o.responseURL.indexOf("file:"))){var r,i,a,s,u,c="getAllResponseHeaders"in o?(r=o.getAllResponseHeaders(),u={},r?(rr.forEach(r.split("\n"),(function(e){if(s=e.indexOf(":"),i=rr.trim(e.substr(0,s)).toLowerCase(),a=rr.trim(e.substr(s+1)),i){if(u[i]&&mr.indexOf(i)>=0)return;u[i]="set-cookie"===i?(u[i]?u[i]:[]).concat([a]):u[i]?u[i]+", "+a:a}})),u):u):null,l={data:e.responseType&&"text"!==e.responseType?o.response:o.responseText,status:o.status,statusText:o.statusText,headers:c,config:e,request:o};vr(t,n,l),o=null}},o.onabort=function(){o&&(n(pr("Request aborted",e,"ECONNABORTED",o)),o=null)},o.onerror=function(){n(pr("Network Error",e,null,o)),o=null},o.ontimeout=function(){var t="timeout of "+e.timeout+"ms exceeded";e.timeoutErrorMessage&&(t=e.timeoutErrorMessage),n(pr(t,e,"ECONNABORTED",o)),o=null},rr.isStandardBrowserEnv()){var c=(e.withCredentials||yr(u))&&e.xsrfCookieName?gr.read(e.xsrfCookieName):void 0;c&&(i[e.xsrfHeaderName]=c)}if("setRequestHeader"in o&&rr.forEach(i,(function(e,t){void 0===r&&"content-type"===t.toLowerCase()?delete i[t]:o.setRequestHeader(t,e)})),rr.isUndefined(e.withCredentials)||(o.withCredentials=!!e.withCredentials),e.responseType)try{o.responseType=e.responseType}catch(t){if("json"!==e.responseType)throw t}"function"==typeof e.onDownloadProgress&&o.addEventListener("progress",e.onDownloadProgress),"function"==typeof e.onUploadProgress&&o.upload&&o.upload.addEventListener("progress",e.onUploadProgress),e.cancelToken&&e.cancelToken.promise.then((function(e){o&&(o.abort(),n(e),o=null)})),r||(r=null),o.send(r)}))},br=Nr(o.fetch)&&Nr(o.ReadableStream);function Er(e){ur||(ur=new o.XMLHttpRequest).open("GET",o.location.host?"/":"https://example.com");try{return ur.responseType=e,ur.responseType===e}catch(e){return!1}}var Ar=void 0!==o.ArrayBuffer,Tr=Ar&&Nr(o.ArrayBuffer.prototype.slice),kr=Ar&&Er("arraybuffer"),Sr=!br&&Tr&&Er("ms-stream"),Or=!br&&Ar&&Er("moz-chunked-arraybuffer"),Cr=Nr(ur.overrideMimeType),Rr=Nr(o.VBArray);function Nr(e){return"function"==typeof e}function Ir(){}function Pr(){Pr.init.call(this)}function xr(e){return void 0===e._maxListeners?Pr.defaultMaxListeners:e._maxListeners}function Lr(e,t,n){if(t)e.call(n);else for(var r=e.length,i=Wr(e,r),o=0;o<r;++o)i[o].call(n)}function Br(e,t,n,r){if(t)e.call(n,r);else for(var i=e.length,o=Wr(e,i),a=0;a<i;++a)o[a].call(n,r)}function jr(e,t,n,r,i){if(t)e.call(n,r,i);else for(var o=e.length,a=Wr(e,o),s=0;s<o;++s)a[s].call(n,r,i)}function Ur(e,t,n,r,i,o){if(t)e.call(n,r,i,o);else for(var a=e.length,s=Wr(e,a),u=0;u<a;++u)s[u].call(n,r,i,o)}function Dr(e,t,n,r){if(t)e.apply(n,r);else for(var i=e.length,o=Wr(e,i),a=0;a<i;++a)o[a].apply(n,r)}function Mr(e,t,n,r){var i,o,a,s;if("function"!=typeof n)throw new TypeError('"listener" argument must be a function');if((o=e._events)?(o.newListener&&(e.emit("newListener",t,n.listener?n.listener:n),o=e._events),a=o[t]):(o=e._events=new Ir,e._eventsCount=0),a){if("function"==typeof a?a=o[t]=r?[n,a]:[a,n]:r?a.unshift(n):a.push(n),!a.warned&&(i=xr(e))&&i>0&&a.length>i){a.warned=!0;var u=new Error("Possible EventEmitter memory leak detected. "+a.length+" "+t+" listeners added. Use emitter.setMaxListeners() to increase limit");u.name="MaxListenersExceededWarning",u.emitter=e,u.type=t,u.count=a.length,s=u,"function"==typeof console.warn?console.warn(s):console.log(s)}}else a=o[t]=n,++e._eventsCount;return e}function zr(e,t,n){var r=!1;function i(){e.removeListener(t,i),r||(r=!0,n.apply(e,arguments))}return i.listener=n,i}function Fr(e){var t=this._events;if(t){var n=t[e];if("function"==typeof n)return 1;if(n)return n.length}return 0}function Wr(e,t){for(var n=new Array(t);t--;)n[t]=e[t];return n}function Hr(){this.head=null,this.tail=null,this.length=0}ur=null,Ir.prototype=Object.create(null),Pr.EventEmitter=Pr,Pr.usingDomains=!1,Pr.prototype.domain=void 0,Pr.prototype._events=void 0,Pr.prototype._maxListeners=void 0,Pr.defaultMaxListeners=10,Pr.init=function(){this.domain=null,Pr.usingDomains&&undefined.active,this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=new Ir,this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},Pr.prototype.setMaxListeners=function(e){if("number"!=typeof e||e<0||isNaN(e))throw new TypeError('"n" argument must be a positive number');return this._maxListeners=e,this},Pr.prototype.getMaxListeners=function(){return xr(this)},Pr.prototype.emit=function(e){var t,n,r,i,o,a,s,u="error"===e;if(a=this._events)u=u&&null==a.error;else if(!u)return!1;if(s=this.domain,u){if(t=arguments[1],!s){if(t instanceof Error)throw t;var c=new Error('Uncaught, unspecified "error" event. ('+t+")");throw c.context=t,c}return t||(t=new Error('Uncaught, unspecified "error" event')),t.domainEmitter=this,t.domain=s,t.domainThrown=!1,s.emit("error",t),!1}if(!(n=a[e]))return!1;var l="function"==typeof n;switch(r=arguments.length){case 1:Lr(n,l,this);break;case 2:Br(n,l,this,arguments[1]);break;case 3:jr(n,l,this,arguments[1],arguments[2]);break;case 4:Ur(n,l,this,arguments[1],arguments[2],arguments[3]);break;default:for(i=new Array(r-1),o=1;o<r;o++)i[o-1]=arguments[o];Dr(n,l,this,i)}return!0},Pr.prototype.addListener=function(e,t){return Mr(this,e,t,!1)},Pr.prototype.on=Pr.prototype.addListener,Pr.prototype.prependListener=function(e,t){return Mr(this,e,t,!0)},Pr.prototype.once=function(e,t){if("function"!=typeof t)throw new TypeError('"listener" argument must be a function');return this.on(e,zr(this,e,t)),this},Pr.prototype.prependOnceListener=function(e,t){if("function"!=typeof t)throw new TypeError('"listener" argument must be a function');return this.prependListener(e,zr(this,e,t)),this},Pr.prototype.removeListener=function(e,t){var n,r,i,o,a;if("function"!=typeof t)throw new TypeError('"listener" argument must be a function');if(!(r=this._events))return this;if(!(n=r[e]))return this;if(n===t||n.listener&&n.listener===t)0==--this._eventsCount?this._events=new Ir:(delete r[e],r.removeListener&&this.emit("removeListener",e,n.listener||t));else if("function"!=typeof n){for(i=-1,o=n.length;o-- >0;)if(n[o]===t||n[o].listener&&n[o].listener===t){a=n[o].listener,i=o;break}if(i<0)return this;if(1===n.length){if(n[0]=void 0,0==--this._eventsCount)return this._events=new Ir,this;delete r[e]}else!function(e,t){for(var n=t,r=n+1,i=e.length;r<i;n+=1,r+=1)e[n]=e[r];e.pop()}(n,i);r.removeListener&&this.emit("removeListener",e,a||t)}return this},Pr.prototype.removeAllListeners=function(e){var t,n;if(!(n=this._events))return this;if(!n.removeListener)return 0===arguments.length?(this._events=new Ir,this._eventsCount=0):n[e]&&(0==--this._eventsCount?this._events=new Ir:delete n[e]),this;if(0===arguments.length){for(var r,i=Object.keys(n),o=0;o<i.length;++o)"removeListener"!==(r=i[o])&&this.removeAllListeners(r);return this.removeAllListeners("removeListener"),this._events=new Ir,this._eventsCount=0,this}if("function"==typeof(t=n[e]))this.removeListener(e,t);else if(t)do{this.removeListener(e,t[t.length-1])}while(t[0]);return this},Pr.prototype.listeners=function(e){var t,n=this._events;return n&&(t=n[e])?"function"==typeof t?[t.listener||t]:function(e){for(var t=new Array(e.length),n=0;n<t.length;++n)t[n]=e[n].listener||e[n];return t}(t):[]},Pr.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):Fr.call(e,t)},Pr.prototype.listenerCount=Fr,Pr.prototype.eventNames=function(){return this._eventsCount>0?Reflect.ownKeys(this._events):[]},Hr.prototype.push=function(e){var t={data:e,next:null};this.length>0?this.tail.next=t:this.head=t,this.tail=t,++this.length},Hr.prototype.unshift=function(e){var t={data:e,next:this.head};0===this.length&&(this.tail=t),this.head=t,++this.length},Hr.prototype.shift=function(){if(0!==this.length){var e=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,e}},Hr.prototype.clear=function(){this.head=this.tail=null,this.length=0},Hr.prototype.join=function(e){if(0===this.length)return"";for(var t=this.head,n=""+t.data;t=t.next;)n+=e+t.data;return n},Hr.prototype.concat=function(e){if(0===this.length)return oe.alloc(0);if(1===this.length)return this.head.data;for(var t=oe.allocUnsafe(e>>>0),n=this.head,r=0;n;)n.data.copy(t,r),r+=n.data.length,n=n.next;return t};var Zr=oe.isEncoding||function(e){switch(e&&e.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function qr(e){switch(this.encoding=(e||"utf8").toLowerCase().replace(/[-_]/,""),function(e){if(e&&!Zr(e))throw new Error("Unknown encoding: "+e)}(e),this.encoding){case"utf8":this.surrogateSize=3;break;case"ucs2":case"utf16le":this.surrogateSize=2,this.detectIncompleteChar=$r;break;case"base64":this.surrogateSize=3,this.detectIncompleteChar=Kr;break;default:return void(this.write=Gr)}this.charBuffer=new oe(6),this.charReceived=0,this.charLength=0}function Gr(e){return e.toString(this.encoding)}function $r(e){this.charReceived=e.length%2,this.charLength=this.charReceived?2:0}function Kr(e){this.charReceived=e.length%3,this.charLength=this.charReceived?3:0}qr.prototype.write=function(e){for(var t="";this.charLength;){var n=e.length>=this.charLength-this.charReceived?this.charLength-this.charReceived:e.length;if(e.copy(this.charBuffer,this.charReceived,0,n),this.charReceived+=n,this.charReceived<this.charLength)return"";if(e=e.slice(n,e.length),!((i=(t=this.charBuffer.slice(0,this.charLength).toString(this.encoding)).charCodeAt(t.length-1))>=55296&&i<=56319)){if(this.charReceived=this.charLength=0,0===e.length)return t;break}this.charLength+=this.surrogateSize,t=""}this.detectIncompleteChar(e);var r=e.length;this.charLength&&(e.copy(this.charBuffer,0,e.length-this.charReceived,r),r-=this.charReceived);var i;r=(t+=e.toString(this.encoding,0,r)).length-1;if((i=t.charCodeAt(r))>=55296&&i<=56319){var o=this.surrogateSize;return this.charLength+=o,this.charReceived+=o,this.charBuffer.copy(this.charBuffer,o,0,o),e.copy(this.charBuffer,0,0,o),t.substring(0,r)}return t},qr.prototype.detectIncompleteChar=function(e){for(var t=e.length>=3?3:e.length;t>0;t--){var n=e[e.length-t];if(1==t&&n>>5==6){this.charLength=2;break}if(t<=2&&n>>4==14){this.charLength=3;break}if(t<=3&&n>>3==30){this.charLength=4;break}}this.charReceived=t},qr.prototype.end=function(e){var t="";if(e&&e.length&&(t=this.write(e)),this.charReceived){var n=this.charReceived,r=this.charBuffer,i=this.encoding;t+=r.slice(0,n).toString(i)}return t},Jr.ReadableState=Vr;var Yr=Ve("stream");function Vr(e,t){e=e||{},this.objectMode=!!e.objectMode,t instanceof ki&&(this.objectMode=this.objectMode||!!e.readableObjectMode);var n=e.highWaterMark,r=this.objectMode?16:16384;this.highWaterMark=n||0===n?n:r,this.highWaterMark=~~this.highWaterMark,this.buffer=new Hr,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.defaultEncoding=e.defaultEncoding||"utf8",this.ranOut=!1,this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,e.encoding&&(this.decoder=new qr(e.encoding),this.encoding=e.encoding)}function Jr(e){if(!(this instanceof Jr))return new Jr(e);this._readableState=new Vr(e,this),this.readable=!0,e&&"function"==typeof e.read&&(this._read=e.read),Pr.call(this)}function Qr(e,t,n,r,i){var o=function(e,t){var n=null;oe.isBuffer(t)||"string"==typeof t||null==t||e.objectMode||(n=new TypeError("Invalid non-string/buffer chunk"));return n}(t,n);if(o)e.emit("error",o);else if(null===n)t.reading=!1,function(e,t){if(t.ended)return;if(t.decoder){var n=t.decoder.end();n&&n.length&&(t.buffer.push(n),t.length+=t.objectMode?1:n.length)}t.ended=!0,ti(e)}(e,t);else if(t.objectMode||n&&n.length>0)if(t.ended&&!i){var a=new Error("stream.push() after EOF");e.emit("error",a)}else if(t.endEmitted&&i){var s=new Error("stream.unshift() after end event");e.emit("error",s)}else{var u;!t.decoder||i||r||(n=t.decoder.write(n),u=!t.objectMode&&0===n.length),i||(t.reading=!1),u||(t.flowing&&0===t.length&&!t.sync?(e.emit("data",n),e.read(0)):(t.length+=t.objectMode?1:n.length,i?t.buffer.unshift(n):t.buffer.push(n),t.needReadable&&ti(e))),function(e,t){t.readingMore||(t.readingMore=!0,_(ri,e,t))}(e,t)}else i||(t.reading=!1);return function(e){return!e.ended&&(e.needReadable||e.length<e.highWaterMark||0===e.length)}(t)}Ze(Jr,Pr),Jr.prototype.push=function(e,t){var n=this._readableState;return n.objectMode||"string"!=typeof e||(t=t||n.defaultEncoding)!==n.encoding&&(e=oe.from(e,t),t=""),Qr(this,n,e,t,!1)},Jr.prototype.unshift=function(e){return Qr(this,this._readableState,e,"",!0)},Jr.prototype.isPaused=function(){return!1===this._readableState.flowing},Jr.prototype.setEncoding=function(e){return this._readableState.decoder=new qr(e),this._readableState.encoding=e,this};var Xr=8388608;function ei(e,t){return e<=0||0===t.length&&t.ended?0:t.objectMode?1:e!=e?t.flowing&&t.length?t.buffer.head.data.length:t.length:(e>t.highWaterMark&&(t.highWaterMark=function(e){return e>=Xr?e=Xr:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}(e)),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0))}function ti(e){var t=e._readableState;t.needReadable=!1,t.emittedReadable||(Yr("emitReadable",t.flowing),t.emittedReadable=!0,t.sync?_(ni,e):ni(e))}function ni(e){Yr("emit readable"),e.emit("readable"),ai(e)}function ri(e,t){for(var n=t.length;!t.reading&&!t.flowing&&!t.ended&&t.length<t.highWaterMark&&(Yr("maybeReadMore read 0"),e.read(0),n!==t.length);)n=t.length;t.readingMore=!1}function ii(e){Yr("readable nexttick read 0"),e.read(0)}function oi(e,t){t.reading||(Yr("resume read 0"),e.read(0)),t.resumeScheduled=!1,t.awaitDrain=0,e.emit("resume"),ai(e),t.flowing&&!t.reading&&e.read(0)}function ai(e){var t=e._readableState;for(Yr("flow",t.flowing);t.flowing&&null!==e.read(););}function si(e,t){return 0===t.length?null:(t.objectMode?n=t.buffer.shift():!e||e>=t.length?(n=t.decoder?t.buffer.join(""):1===t.buffer.length?t.buffer.head.data:t.buffer.concat(t.length),t.buffer.clear()):n=function(e,t,n){var r;e<t.head.data.length?(r=t.head.data.slice(0,e),t.head.data=t.head.data.slice(e)):r=e===t.head.data.length?t.shift():n?function(e,t){var n=t.head,r=1,i=n.data;e-=i.length;for(;n=n.next;){var o=n.data,a=e>o.length?o.length:e;if(a===o.length?i+=o:i+=o.slice(0,e),0===(e-=a)){a===o.length?(++r,n.next?t.head=n.next:t.head=t.tail=null):(t.head=n,n.data=o.slice(a));break}++r}return t.length-=r,i}(e,t):function(e,t){var n=oe.allocUnsafe(e),r=t.head,i=1;r.data.copy(n),e-=r.data.length;for(;r=r.next;){var o=r.data,a=e>o.length?o.length:e;if(o.copy(n,n.length-e,0,a),0===(e-=a)){a===o.length?(++i,r.next?t.head=r.next:t.head=t.tail=null):(t.head=r,r.data=o.slice(a));break}++i}return t.length-=i,n}(e,t);return r}(e,t.buffer,t.decoder),n);var n}function ui(e){var t=e._readableState;if(t.length>0)throw new Error('"endReadable()" called on non-empty stream');t.endEmitted||(t.ended=!0,_(ci,t,e))}function ci(e,t){e.endEmitted||0!==e.length||(e.endEmitted=!0,t.readable=!1,t.emit("end"))}function li(e,t){for(var n=0,r=e.length;n<r;n++)if(e[n]===t)return n;return-1}function fi(){}function hi(e,t,n){this.chunk=e,this.encoding=t,this.callback=n,this.next=null}function di(e,t){Object.defineProperty(this,"buffer",{get:$e((function(){return this.getBuffer()}),"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.")}),e=e||{},this.objectMode=!!e.objectMode,t instanceof ki&&(this.objectMode=this.objectMode||!!e.writableObjectMode);var n=e.highWaterMark,r=this.objectMode?16:16384;this.highWaterMark=n||0===n?n:r,this.highWaterMark=~~this.highWaterMark,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1;var i=!1===e.decodeStrings;this.decodeStrings=!i,this.defaultEncoding=e.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(e){!function(e,t){var n=e._writableState,r=n.sync,i=n.writecb;if(function(e){e.writing=!1,e.writecb=null,e.length-=e.writelen,e.writelen=0}(n),t)!function(e,t,n,r,i){--t.pendingcb,n?_(i,r):i(r);e._writableState.errorEmitted=!0,e.emit("error",r)}(e,n,r,t,i);else{var o=mi(n);o||n.corked||n.bufferProcessing||!n.bufferedRequest||_i(e,n),r?_(gi,e,n,o,i):gi(e,n,o,i)}}(t,e)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.bufferedRequestCount=0,this.corkedRequestsFree=new bi(this)}function pi(e){if(!(this instanceof pi||this instanceof ki))return new pi(e);this._writableState=new di(e,this),this.writable=!0,e&&("function"==typeof e.write&&(this._write=e.write),"function"==typeof e.writev&&(this._writev=e.writev)),Pr.call(this)}function vi(e,t,n,r,i,o,a){t.writelen=r,t.writecb=a,t.writing=!0,t.sync=!0,n?e._writev(i,t.onwrite):e._write(i,o,t.onwrite),t.sync=!1}function gi(e,t,n,r){n||function(e,t){0===t.length&&t.needDrain&&(t.needDrain=!1,e.emit("drain"))}(e,t),t.pendingcb--,r(),wi(e,t)}function _i(e,t){t.bufferProcessing=!0;var n=t.bufferedRequest;if(e._writev&&n&&n.next){var r=t.bufferedRequestCount,i=new Array(r),o=t.corkedRequestsFree;o.entry=n;for(var a=0;n;)i[a]=n,n=n.next,a+=1;vi(e,t,!0,t.length,i,"",o.finish),t.pendingcb++,t.lastBufferedRequest=null,o.next?(t.corkedRequestsFree=o.next,o.next=null):t.corkedRequestsFree=new bi(t)}else{for(;n;){var s=n.chunk,u=n.encoding,c=n.callback;if(vi(e,t,!1,t.objectMode?1:s.length,s,u,c),n=n.next,t.writing)break}null===n&&(t.lastBufferedRequest=null)}t.bufferedRequestCount=0,t.bufferedRequest=n,t.bufferProcessing=!1}function mi(e){return e.ending&&0===e.length&&null===e.bufferedRequest&&!e.finished&&!e.writing}function yi(e,t){t.prefinished||(t.prefinished=!0,e.emit("prefinish"))}function wi(e,t){var n=mi(t);return n&&(0===t.pendingcb?(yi(e,t),t.finished=!0,e.emit("finish")):yi(e,t)),n}function bi(e){var t=this;this.next=null,this.entry=null,this.finish=function(n){var r=t.entry;for(t.entry=null;r;){var i=r.callback;e.pendingcb--,i(n),r=r.next}e.corkedRequestsFree?e.corkedRequestsFree.next=t:e.corkedRequestsFree=t}}Jr.prototype.read=function(e){Yr("read",e),e=parseInt(e,10);var t=this._readableState,n=e;if(0!==e&&(t.emittedReadable=!1),0===e&&t.needReadable&&(t.length>=t.highWaterMark||t.ended))return Yr("read: emitReadable",t.length,t.ended),0===t.length&&t.ended?ui(this):ti(this),null;if(0===(e=ei(e,t))&&t.ended)return 0===t.length&&ui(this),null;var r,i=t.needReadable;return Yr("need readable",i),(0===t.length||t.length-e<t.highWaterMark)&&Yr("length less than watermark",i=!0),t.ended||t.reading?Yr("reading or ended",i=!1):i&&(Yr("do read"),t.reading=!0,t.sync=!0,0===t.length&&(t.needReadable=!0),this._read(t.highWaterMark),t.sync=!1,t.reading||(e=ei(n,t))),null===(r=e>0?si(e,t):null)?(t.needReadable=!0,e=0):t.length-=e,0===t.length&&(t.ended||(t.needReadable=!0),n!==e&&t.ended&&ui(this)),null!==r&&this.emit("data",r),r},Jr.prototype._read=function(e){this.emit("error",new Error("not implemented"))},Jr.prototype.pipe=function(e,t){var n=this,r=this._readableState;switch(r.pipesCount){case 0:r.pipes=e;break;case 1:r.pipes=[r.pipes,e];break;default:r.pipes.push(e)}r.pipesCount+=1,Yr("pipe count=%d opts=%j",r.pipesCount,t);var i=!t||!1!==t.end?a:c;function o(e){Yr("onunpipe"),e===n&&c()}function a(){Yr("onend"),e.end()}r.endEmitted?_(i):n.once("end",i),e.on("unpipe",o);var s=function(e){return function(){var t=e._readableState;Yr("pipeOnDrain",t.awaitDrain),t.awaitDrain&&t.awaitDrain--,0===t.awaitDrain&&e.listeners("data").length&&(t.flowing=!0,ai(e))}}(n);e.on("drain",s);var u=!1;function c(){Yr("cleanup"),e.removeListener("close",d),e.removeListener("finish",p),e.removeListener("drain",s),e.removeListener("error",h),e.removeListener("unpipe",o),n.removeListener("end",a),n.removeListener("end",c),n.removeListener("data",f),u=!0,!r.awaitDrain||e._writableState&&!e._writableState.needDrain||s()}var l=!1;function f(t){Yr("ondata"),l=!1,!1!==e.write(t)||l||((1===r.pipesCount&&r.pipes===e||r.pipesCount>1&&-1!==li(r.pipes,e))&&!u&&(Yr("false write response, pause",n._readableState.awaitDrain),n._readableState.awaitDrain++,l=!0),n.pause())}function h(t){Yr("onerror",t),v(),e.removeListener("error",h),0===function(e,t){return e.listeners(t).length}(e,"error")&&e.emit("error",t)}function d(){e.removeListener("finish",p),v()}function p(){Yr("onfinish"),e.removeListener("close",d),v()}function v(){Yr("unpipe"),n.unpipe(e)}return n.on("data",f),function(e,t,n){if("function"==typeof e.prependListener)return e.prependListener(t,n);e._events&&e._events[t]?Array.isArray(e._events[t])?e._events[t].unshift(n):e._events[t]=[n,e._events[t]]:e.on(t,n)}(e,"error",h),e.once("close",d),e.once("finish",p),e.emit("pipe",n),r.flowing||(Yr("pipe resume"),n.resume()),e},Jr.prototype.unpipe=function(e){var t=this._readableState;if(0===t.pipesCount)return this;if(1===t.pipesCount)return e&&e!==t.pipes||(e||(e=t.pipes),t.pipes=null,t.pipesCount=0,t.flowing=!1,e&&e.emit("unpipe",this)),this;if(!e){var n=t.pipes,r=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var i=0;i<r;i++)n[i].emit("unpipe",this);return this}var o=li(t.pipes,e);return-1===o||(t.pipes.splice(o,1),t.pipesCount-=1,1===t.pipesCount&&(t.pipes=t.pipes[0]),e.emit("unpipe",this)),this},Jr.prototype.on=function(e,t){var n=Pr.prototype.on.call(this,e,t);if("data"===e)!1!==this._readableState.flowing&&this.resume();else if("readable"===e){var r=this._readableState;r.endEmitted||r.readableListening||(r.readableListening=r.needReadable=!0,r.emittedReadable=!1,r.reading?r.length&&ti(this):_(ii,this))}return n},Jr.prototype.addListener=Jr.prototype.on,Jr.prototype.resume=function(){var e=this._readableState;return e.flowing||(Yr("resume"),e.flowing=!0,function(e,t){t.resumeScheduled||(t.resumeScheduled=!0,_(oi,e,t))}(this,e)),this},Jr.prototype.pause=function(){return Yr("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(Yr("pause"),this._readableState.flowing=!1,this.emit("pause")),this},Jr.prototype.wrap=function(e){var t=this._readableState,n=!1,r=this;for(var i in e.on("end",(function(){if(Yr("wrapped end"),t.decoder&&!t.ended){var e=t.decoder.end();e&&e.length&&r.push(e)}r.push(null)})),e.on("data",(function(i){(Yr("wrapped data"),t.decoder&&(i=t.decoder.write(i)),t.objectMode&&null==i)||(t.objectMode||i&&i.length)&&(r.push(i)||(n=!0,e.pause()))})),e)void 0===this[i]&&"function"==typeof e[i]&&(this[i]=function(t){return function(){return e[t].apply(e,arguments)}}(i));return function(e,t){for(var n=0,r=e.length;n<r;n++)t(e[n],n)}(["error","close","destroy","pause","resume"],(function(t){e.on(t,r.emit.bind(r,t))})),r._read=function(t){Yr("wrapped _read",t),n&&(n=!1,e.resume())},r},Jr._fromList=si,pi.WritableState=di,Ze(pi,Pr),di.prototype.getBuffer=function(){for(var e=this.bufferedRequest,t=[];e;)t.push(e),e=e.next;return t},pi.prototype.pipe=function(){this.emit("error",new Error("Cannot pipe, not readable"))},pi.prototype.write=function(e,t,n){var r=this._writableState,i=!1;return"function"==typeof t&&(n=t,t=null),oe.isBuffer(e)?t="buffer":t||(t=r.defaultEncoding),"function"!=typeof n&&(n=fi),r.ended?function(e,t){var n=new Error("write after end");e.emit("error",n),_(t,n)}(this,n):function(e,t,n,r){var i=!0,o=!1;return null===n?o=new TypeError("May not write null values to stream"):oe.isBuffer(n)||"string"==typeof n||void 0===n||t.objectMode||(o=new TypeError("Invalid non-string/buffer chunk")),o&&(e.emit("error",o),_(r,o),i=!1),i}(this,r,e,n)&&(r.pendingcb++,i=function(e,t,n,r,i){n=function(e,t,n){e.objectMode||!1===e.decodeStrings||"string"!=typeof t||(t=oe.from(t,n));return t}(t,n,r),oe.isBuffer(n)&&(r="buffer");var o=t.objectMode?1:n.length;t.length+=o;var a=t.length<t.highWaterMark;a||(t.needDrain=!0);if(t.writing||t.corked){var s=t.lastBufferedRequest;t.lastBufferedRequest=new hi(n,r,i),s?s.next=t.lastBufferedRequest:t.bufferedRequest=t.lastBufferedRequest,t.bufferedRequestCount+=1}else vi(e,t,!1,o,n,r,i);return a}(this,r,e,t,n)),i},pi.prototype.cork=function(){this._writableState.corked++},pi.prototype.uncork=function(){var e=this._writableState;e.corked&&(e.corked--,e.writing||e.corked||e.finished||e.bufferProcessing||!e.bufferedRequest||_i(this,e))},pi.prototype.setDefaultEncoding=function(e){if("string"==typeof e&&(e=e.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((e+"").toLowerCase())>-1))throw new TypeError("Unknown encoding: "+e);return this._writableState.defaultEncoding=e,this},pi.prototype._write=function(e,t,n){n(new Error("not implemented"))},pi.prototype._writev=null,pi.prototype.end=function(e,t,n){var r=this._writableState;"function"==typeof e?(n=e,e=null,t=null):"function"==typeof t&&(n=t,t=null),null!=e&&this.write(e,t),r.corked&&(r.corked=1,this.uncork()),r.ending||r.finished||function(e,t,n){t.ending=!0,wi(e,t),n&&(t.finished?_(n):e.once("finish",n));t.ended=!0,e.writable=!1}(this,r,n)},Ze(ki,Jr);for(var Ei=Object.keys(pi.prototype),Ai=0;Ai<Ei.length;Ai++){var Ti=Ei[Ai];ki.prototype[Ti]||(ki.prototype[Ti]=pi.prototype[Ti])}function ki(e){if(!(this instanceof ki))return new ki(e);Jr.call(this,e),pi.call(this,e),e&&!1===e.readable&&(this.readable=!1),e&&!1===e.writable&&(this.writable=!1),this.allowHalfOpen=!0,e&&!1===e.allowHalfOpen&&(this.allowHalfOpen=!1),this.once("end",Si)}function Si(){this.allowHalfOpen||this._writableState.ended||_(Oi,this)}function Oi(e){e.end()}function Ci(e){this.afterTransform=function(t,n){return function(e,t,n){var r=e._transformState;r.transforming=!1;var i=r.writecb;if(!i)return e.emit("error",new Error("no writecb in Transform class"));r.writechunk=null,r.writecb=null,null!=n&&e.push(n);i(t);var o=e._readableState;o.reading=!1,(o.needReadable||o.length<o.highWaterMark)&&e._read(o.highWaterMark)}(e,t,n)},this.needTransform=!1,this.transforming=!1,this.writecb=null,this.writechunk=null,this.writeencoding=null}function Ri(e){if(!(this instanceof Ri))return new Ri(e);ki.call(this,e),this._transformState=new Ci(this);var t=this;this._readableState.needReadable=!0,this._readableState.sync=!1,e&&("function"==typeof e.transform&&(this._transform=e.transform),"function"==typeof e.flush&&(this._flush=e.flush)),this.once("prefinish",(function(){"function"==typeof this._flush?this._flush((function(e){Ni(t,e)})):Ni(t)}))}function Ni(e,t){if(t)return e.emit("error",t);var n=e._writableState,r=e._transformState;if(n.length)throw new Error("Calling transform done when ws.length != 0");if(r.transforming)throw new Error("Calling transform done when still transforming");return e.push(null)}function Ii(e){if(!(this instanceof Ii))return new Ii(e);Ri.call(this,e)}function Pi(){Pr.call(this)}Ze(Ri,ki),Ri.prototype.push=function(e,t){return this._transformState.needTransform=!1,ki.prototype.push.call(this,e,t)},Ri.prototype._transform=function(e,t,n){throw new Error("Not implemented")},Ri.prototype._write=function(e,t,n){var r=this._transformState;if(r.writecb=n,r.writechunk=e,r.writeencoding=t,!r.transforming){var i=this._readableState;(r.needTransform||i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}},Ri.prototype._read=function(e){var t=this._transformState;null!==t.writechunk&&t.writecb&&!t.transforming?(t.transforming=!0,this._transform(t.writechunk,t.writeencoding,t.afterTransform)):t.needTransform=!0},Ze(Ii,Ri),Ii.prototype._transform=function(e,t,n){n(null,e)},Ze(Pi,Pr),Pi.Readable=Jr,Pi.Writable=pi,Pi.Duplex=ki,Pi.Transform=Ri,Pi.PassThrough=Ii,Pi.Stream=Pi,Pi.prototype.pipe=function(e,t){var n=this;function r(t){e.writable&&!1===e.write(t)&&n.pause&&n.pause()}function i(){n.readable&&n.resume&&n.resume()}n.on("data",r),e.on("drain",i),e._isStdio||t&&!1===t.end||(n.on("end",a),n.on("close",s));var o=!1;function a(){o||(o=!0,e.end())}function s(){o||(o=!0,"function"==typeof e.destroy&&e.destroy())}function u(e){if(c(),0===Pr.listenerCount(this,"error"))throw e}function c(){n.removeListener("data",r),e.removeListener("drain",i),n.removeListener("end",a),n.removeListener("close",s),n.removeListener("error",u),e.removeListener("error",u),n.removeListener("end",c),n.removeListener("close",c),e.removeListener("close",c)}return n.on("error",u),e.on("error",u),n.on("end",c),n.on("close",c),e.on("close",c),e.emit("pipe",n),e};var xi=3,Li=4;function Bi(e,t,n){var r,i=this;if(Jr.call(i),i._mode=n,i.headers={},i.rawHeaders=[],i.trailers={},i.rawTrailers=[],i.on("end",(function(){N.nextTick((function(){i.emit("close")}))})),"fetch"===n){i._fetchResponse=t,i.url=t.url,i.statusCode=t.status,i.statusMessage=t.statusText;for(var o,a,s=t.headers[Symbol.iterator]();o=(a=s.next()).value,!a.done;)i.headers[o[0].toLowerCase()]=o[1],i.rawHeaders.push(o[0],o[1]);var u=t.body.getReader();(r=function(){u.read().then((function(e){i._destroyed||(e.done?i.push(null):(i.push(new oe(e.value)),r()))}))})()}else{if(i._xhr=e,i._pos=0,i.url=e.responseURL,i.statusCode=e.status,i.statusMessage=e.statusText,e.getAllResponseHeaders().split(/\r?\n/).forEach((function(e){var t=e.match(/^([^:]+):\s*(.*)/);if(t){var n=t[1].toLowerCase();"set-cookie"===n?(void 0===i.headers[n]&&(i.headers[n]=[]),i.headers[n].push(t[2])):void 0!==i.headers[n]?i.headers[n]+=", "+t[2]:i.headers[n]=t[2],i.rawHeaders.push(t[1],t[2])}})),i._charset="x-user-defined",!Cr){var c=i.rawHeaders["mime-type"];if(c){var l=c.match(/;\s*charset=([^;])(;|$)/);l&&(i._charset=l[1].toLowerCase())}i._charset||(i._charset="utf-8")}}}function ji(e){var t,n=this;pi.call(n),n._opts=e,n._body=[],n._headers={},e.auth&&n.setHeader("Authorization","Basic "+new oe(e.auth).toString("base64")),Object.keys(e.headers).forEach((function(t){n.setHeader(t,e.headers[t])}));var r=!0;if("disable-fetch"===e.mode)r=!1,t=!0;else if("prefer-streaming"===e.mode)t=!1;else if("allow-wrong-content-type"===e.mode)t=!Cr;else{if(e.mode&&"default"!==e.mode&&"prefer-fast"!==e.mode)throw new Error("Invalid value for opts.mode");t=!0}n._mode=function(e,t){return br&&t?"fetch":Or?"moz-chunked-arraybuffer":Sr?"ms-stream":kr&&e?"arraybuffer":Rr&&e?"text:vbarray":"text"}(t,r),n.on("finish",(function(){n._onFinish()}))}Ze(Bi,Jr),Bi.prototype._read=function(){},Bi.prototype._onXHRProgress=function(){var e=this,t=e._xhr,n=null;switch(e._mode){case"text:vbarray":if(t.readyState!==Li)break;try{n=new o.VBArray(t.responseBody).toArray()}catch(e){}if(null!==n){e.push(new oe(n));break}case"text":try{n=t.responseText}catch(t){e._mode="text:vbarray";break}if(n.length>e._pos){var r=n.substr(e._pos);if("x-user-defined"===e._charset){for(var i=new oe(r.length),a=0;a<r.length;a++)i[a]=255&r.charCodeAt(a);e.push(i)}else e.push(r,e._charset);e._pos=n.length}break;case"arraybuffer":if(t.readyState!==Li||!t.response)break;n=t.response,e.push(new oe(new Uint8Array(n)));break;case"moz-chunked-arraybuffer":if(n=t.response,t.readyState!==xi||!n)break;e.push(new oe(new Uint8Array(n)));break;case"ms-stream":if(n=t.response,t.readyState!==xi)break;var s=new o.MSStreamReader;s.onprogress=function(){s.result.byteLength>e._pos&&(e.push(new oe(new Uint8Array(s.result.slice(e._pos)))),e._pos=s.result.byteLength)},s.onload=function(){e.push(null)},s.readAsArrayBuffer(n)}e._xhr.readyState===Li&&"ms-stream"!==e._mode&&e.push(null)},Ze(ji,pi);var Ui=["accept-charset","accept-encoding","access-control-request-headers","access-control-request-method","connection","content-length","cookie","cookie2","date","dnt","expect","host","keep-alive","origin","referer","te","trailer","transfer-encoding","upgrade","user-agent","via"];ji.prototype.setHeader=function(e,t){var n=e.toLowerCase();-1===Ui.indexOf(n)&&(this._headers[n]={name:e,value:t})},ji.prototype.getHeader=function(e){return this._headers[e.toLowerCase()].value},ji.prototype.removeHeader=function(e){delete this._headers[e.toLowerCase()]},ji.prototype._onFinish=function(){var e=this;if(!e._destroyed){var t,n=e._opts,r=e._headers;if("POST"!==n.method&&"PUT"!==n.method&&"PATCH"!==n.method||(t=function(){if(void 0!==sr)return sr;try{new o.Blob([new ArrayBuffer(1)]),sr=!0}catch(e){sr=!1}return sr}()?new o.Blob(e._body.map((function(e){return function(e){if(e instanceof Uint8Array){if(0===e.byteOffset&&e.byteLength===e.buffer.byteLength)return e.buffer;if("function"==typeof e.buffer.slice)return e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength)}if(We(e)){for(var t=new Uint8Array(e.length),n=e.length,r=0;r<n;r++)t[r]=e[r];return t.buffer}throw new Error("Argument must be a Buffer")}(e)})),{type:(r["content-type"]||{}).value||""}):oe.concat(e._body).toString()),"fetch"===e._mode){var i=Object.keys(r).map((function(e){return[r[e].name,r[e].value]}));o.fetch(e._opts.url,{method:e._opts.method,headers:i,body:t,mode:"cors",credentials:n.withCredentials?"include":"same-origin"}).then((function(t){e._fetchResponse=t,e._connect()}),(function(t){e.emit("error",t)}))}else{var a=e._xhr=new o.XMLHttpRequest;try{a.open(e._opts.method,e._opts.url,!0)}catch(t){return void N.nextTick((function(){e.emit("error",t)}))}"responseType"in a&&(a.responseType=e._mode.split(":")[0]),"withCredentials"in a&&(a.withCredentials=!!n.withCredentials),"text"===e._mode&&"overrideMimeType"in a&&a.overrideMimeType("text/plain; charset=x-user-defined"),Object.keys(r).forEach((function(e){a.setRequestHeader(r[e].name,r[e].value)})),e._response=null,a.onreadystatechange=function(){switch(a.readyState){case xi:case Li:e._onXHRProgress()}},"moz-chunked-arraybuffer"===e._mode&&(a.onprogress=function(){e._onXHRProgress()}),a.onerror=function(){e._destroyed||e.emit("error",new Error("XHR error"))};try{a.send(t)}catch(t){return void N.nextTick((function(){e.emit("error",t)}))}}}},ji.prototype._onXHRProgress=function(){var e=this;(function(e){try{var t=e.status;return null!==t&&0!==t}catch(e){return!1}})(e._xhr)&&!e._destroyed&&(e._response||e._connect(),e._response._onXHRProgress())},ji.prototype._connect=function(){var e=this;e._destroyed||(e._response=new Bi(e._xhr,e._fetchResponse,e._mode),e.emit("response",e._response))},ji.prototype._write=function(e,t,n){this._body.push(e),n()},ji.prototype.abort=ji.prototype.destroy=function(){var e=this;e._destroyed=!0,e._response&&(e._response._destroyed=!0),e._xhr&&e._xhr.abort()},ji.prototype.end=function(e,t,n){"function"==typeof e&&(n=e,e=void 0),pi.prototype.end.call(this,e,t,n)},ji.prototype.flushHeaders=function(){},ji.prototype.setTimeout=function(){},ji.prototype.setNoDelay=function(){},ji.prototype.setSocketKeepAlive=function(){};
17
17
  /*! https://mths.be/punycode v1.4.1 by @mathias */
18
- var Di=2147483647,Mi=/[^\x20-\x7E]/,zi=/[\x2E\u3002\uFF0E\uFF61]/g,Fi={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},Wi=Math.floor,Hi=String.fromCharCode;function Zi(e){throw new RangeError(Fi[e])}function qi(e,t){return e+22+75*(e<26)-((0!=t)<<5)}function Gi(e,t,n){var r=0;for(e=n?Wi(e/700):e>>1,e+=Wi(e/t);e>455;r+=36)e=Wi(e/35);return Wi(r+36*e/(e+38))}function $i(e){return function(e,t){var n=e.split("@"),r="";n.length>1&&(r=n[0]+"@",e=n[1]);var i=function(e,t){for(var n=e.length,r=[];n--;)r[n]=t(e[n]);return r}((e=e.replace(zi,".")).split("."),t).join(".");return r+i}(e,(function(e){return Mi.test(e)?"xn--"+function(e){var t,n,r,i,o,a,s,u,c,l,f,h,d,p,v,g=[];for(h=(e=function(e){for(var t,n,r=[],i=0,o=e.length;i<o;)(t=e.charCodeAt(i++))>=55296&&t<=56319&&i<o?56320==(64512&(n=e.charCodeAt(i++)))?r.push(((1023&t)<<10)+(1023&n)+65536):(r.push(t),i--):r.push(t);return r}(e)).length,t=128,n=0,o=72,a=0;a<h;++a)(f=e[a])<128&&g.push(Hi(f));for(r=i=g.length,i&&g.push("-");r<h;){for(s=Di,a=0;a<h;++a)(f=e[a])>=t&&f<s&&(s=f);for(s-t>Wi((Di-n)/(d=r+1))&&Zi("overflow"),n+=(s-t)*d,t=s,a=0;a<h;++a)if((f=e[a])<t&&++n>Di&&Zi("overflow"),f==t){for(u=n,c=36;!(u<(l=c<=o?1:c>=o+26?26:c-o));c+=36)v=u-l,p=36-l,g.push(Hi(qi(l+v%p,0))),u=Wi(v/p);g.push(Hi(qi(u,0))),o=Gi(n,d,r==i),n=0,++r}++n,++t}return g.join("")}(e):e}))}function Ki(e,t){return Object.prototype.hasOwnProperty.call(e,t)}var Yi=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)};function Vi(e){switch(typeof e){case"string":return e;case"boolean":return e?"true":"false";case"number":return isFinite(e)?e:"";default:return""}}function Ji(e,t){if(e.map)return e.map(t);for(var n=[],r=0;r<e.length;r++)n.push(t(e[r],r));return n}var Qi=Object.keys||function(e){var t=[];for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.push(n);return t};function Xi(e,t,n,r){t=t||"&",n=n||"=";var i={};if("string"!=typeof e||0===e.length)return i;var o=/\+/g;e=e.split(t);var a=1e3;r&&"number"==typeof r.maxKeys&&(a=r.maxKeys);var s=e.length;a>0&&s>a&&(s=a);for(var u=0;u<s;++u){var c,l,f,h,d=e[u].replace(o,"%20"),p=d.indexOf(n);p>=0?(c=d.substr(0,p),l=d.substr(p+1)):(c=d,l=""),f=decodeURIComponent(c),h=decodeURIComponent(l),Ki(i,f)?Yi(i[f])?i[f].push(h):i[f]=[i[f],h]:i[f]=h}return i}var eo={parse:vo,resolve:yo,resolveObject:wo,format:_o,Url:to};function to(){this.protocol=null,this.slashes=null,this.auth=null,this.host=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.query=null,this.pathname=null,this.path=null,this.href=null}var no=/^([a-z0-9.+-]+:)/i,ro=/:[0-9]*$/,io=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,oo=["{","}","|","\\","^","`"].concat(["<",">",'"',"`"," ","\r","\n","\t"]),ao=["'"].concat(oo),so=["%","/","?",";","#"].concat(ao),uo=["/","?","#"],co=/^[+a-z0-9A-Z_-]{0,63}$/,lo=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,fo={javascript:!0,"javascript:":!0},ho={javascript:!0,"javascript:":!0},po={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0};function vo(e,t,n){if(e&&ht(e)&&e instanceof to)return e;var r=new to;return r.parse(e,t,n),r}function go(e,t,n,r){if(!ut(t))throw new TypeError("Parameter 'url' must be a string, not "+typeof t);var i=t.indexOf("?"),o=-1!==i&&i<t.indexOf("#")?"?":"#",a=t.split(o);a[0]=a[0].replace(/\\/g,"/");var s=t=a.join(o);if(s=s.trim(),!r&&1===t.split("#").length){var u=io.exec(s);if(u)return e.path=s,e.href=s,e.pathname=u[1],u[2]?(e.search=u[2],e.query=n?Xi(e.search.substr(1)):e.search.substr(1)):n&&(e.search="",e.query={}),e}var c,l,f,h,d=no.exec(s);if(d){var p=(d=d[0]).toLowerCase();e.protocol=p,s=s.substr(d.length)}if(r||d||s.match(/^\/\/[^@\/]+@[^@\/]+/)){var v="//"===s.substr(0,2);!v||d&&ho[d]||(s=s.substr(2),e.slashes=!0)}if(!ho[d]&&(v||d&&!po[d])){var g,_,m=-1;for(c=0;c<uo.length;c++)-1!==(l=s.indexOf(uo[c]))&&(-1===m||l<m)&&(m=l);for(-1!==(_=-1===m?s.lastIndexOf("@"):s.lastIndexOf("@",m))&&(g=s.slice(0,_),s=s.slice(_+1),e.auth=decodeURIComponent(g)),m=-1,c=0;c<so.length;c++)-1!==(l=s.indexOf(so[c]))&&(-1===m||l<m)&&(m=l);-1===m&&(m=s.length),e.host=s.slice(0,m),s=s.slice(m),bo(e),e.hostname=e.hostname||"";var y="["===e.hostname[0]&&"]"===e.hostname[e.hostname.length-1];if(!y){var w=e.hostname.split(/\./);for(c=0,f=w.length;c<f;c++){var b=w[c];if(b&&!b.match(co)){for(var E="",A=0,T=b.length;A<T;A++)b.charCodeAt(A)>127?E+="x":E+=b[A];if(!E.match(co)){var k=w.slice(0,c),S=w.slice(c+1),O=b.match(lo);O&&(k.push(O[1]),S.unshift(O[2])),S.length&&(s="/"+S.join(".")+s),e.hostname=k.join(".");break}}}}e.hostname.length>255?e.hostname="":e.hostname=e.hostname.toLowerCase(),y||(e.hostname=$i(e.hostname)),h=e.port?":"+e.port:"";var C=e.hostname||"";e.host=C+h,e.href+=e.host,y&&(e.hostname=e.hostname.substr(1,e.hostname.length-2),"/"!==s[0]&&(s="/"+s))}if(!fo[p])for(c=0,f=ao.length;c<f;c++){var R=ao[c];if(-1!==s.indexOf(R)){var N=encodeURIComponent(R);N===R&&(N=escape(R)),s=s.split(R).join(N)}}var I=s.indexOf("#");-1!==I&&(e.hash=s.substr(I),s=s.slice(0,I));var P=s.indexOf("?");if(-1!==P?(e.search=s.substr(P),e.query=s.substr(P+1),n&&(e.query=Xi(e.query)),s=s.slice(0,P)):n&&(e.search="",e.query={}),s&&(e.pathname=s),po[p]&&e.hostname&&!e.pathname&&(e.pathname="/"),e.pathname||e.search){h=e.pathname||"";var x=e.search||"";e.path=h+x}return e.href=mo(e),e}function _o(e){return ut(e)&&(e=go({},e)),mo(e)}function mo(e){var t=e.auth||"";t&&(t=(t=encodeURIComponent(t)).replace(/%3A/i,":"),t+="@");var n=e.protocol||"",r=e.pathname||"",i=e.hash||"",o=!1,a="";e.host?o=t+e.host:e.hostname&&(o=t+(-1===e.hostname.indexOf(":")?e.hostname:"["+this.hostname+"]"),e.port&&(o+=":"+e.port)),e.query&&ht(e.query)&&Object.keys(e.query).length&&(a=function(e,t,n,r){return t=t||"&",n=n||"=",null===e&&(e=void 0),"object"==typeof e?Ji(Qi(e),(function(r){var i=encodeURIComponent(Vi(r))+n;return Yi(e[r])?Ji(e[r],(function(e){return i+encodeURIComponent(Vi(e))})).join(t):i+encodeURIComponent(Vi(e[r]))})).join(t):r?encodeURIComponent(Vi(r))+n+encodeURIComponent(Vi(e)):""}(e.query));var s=e.search||a&&"?"+a||"";return n&&":"!==n.substr(-1)&&(n+=":"),e.slashes||(!n||po[n])&&!1!==o?(o="//"+(o||""),r&&"/"!==r.charAt(0)&&(r="/"+r)):o||(o=""),i&&"#"!==i.charAt(0)&&(i="#"+i),s&&"?"!==s.charAt(0)&&(s="?"+s),n+o+(r=r.replace(/[?#]/g,(function(e){return encodeURIComponent(e)})))+(s=s.replace("#","%23"))+i}function yo(e,t){return vo(e,!1,!0).resolve(t)}function wo(e,t){return e?vo(e,!1,!0).resolveObject(t):t}function bo(e){var t=e.host,n=ro.exec(t);n&&(":"!==(n=n[0])&&(e.port=n.substr(1)),t=t.substr(0,t.length-n.length)),t&&(e.hostname=t)}to.prototype.parse=function(e,t,n){return go(this,e,t,n)},to.prototype.format=function(){return mo(this)},to.prototype.resolve=function(e){return this.resolveObject(vo(e,!1,!0)).format()},to.prototype.resolveObject=function(e){if(ut(e)){var t=new to;t.parse(e,!1,!0),e=t}for(var n,r=new to,i=Object.keys(this),o=0;o<i.length;o++){var a=i[o];r[a]=this[a]}if(r.hash=e.hash,""===e.href)return r.href=r.format(),r;if(e.slashes&&!e.protocol){for(var s=Object.keys(e),u=0;u<s.length;u++){var c=s[u];"protocol"!==c&&(r[c]=e[c])}return po[r.protocol]&&r.hostname&&!r.pathname&&(r.path=r.pathname="/"),r.href=r.format(),r}if(e.protocol&&e.protocol!==r.protocol){if(!po[e.protocol]){for(var l=Object.keys(e),f=0;f<l.length;f++){var h=l[f];r[h]=e[h]}return r.href=r.format(),r}if(r.protocol=e.protocol,e.host||ho[e.protocol])r.pathname=e.pathname;else{for(n=(e.pathname||"").split("/");n.length&&!(e.host=n.shift()););e.host||(e.host=""),e.hostname||(e.hostname=""),""!==n[0]&&n.unshift(""),n.length<2&&n.unshift(""),r.pathname=n.join("/")}if(r.search=e.search,r.query=e.query,r.host=e.host||"",r.auth=e.auth,r.hostname=e.hostname||e.host,r.port=e.port,r.pathname||r.search){var d=r.pathname||"",p=r.search||"";r.path=d+p}return r.slashes=r.slashes||e.slashes,r.href=r.format(),r}var v,g=r.pathname&&"/"===r.pathname.charAt(0),_=e.host||e.pathname&&"/"===e.pathname.charAt(0),m=_||g||r.host&&e.pathname,y=m,w=r.pathname&&r.pathname.split("/")||[],b=r.protocol&&!po[r.protocol];if(n=e.pathname&&e.pathname.split("/")||[],b&&(r.hostname="",r.port=null,r.host&&(""===w[0]?w[0]=r.host:w.unshift(r.host)),r.host="",e.protocol&&(e.hostname=null,e.port=null,e.host&&(""===n[0]?n[0]=e.host:n.unshift(e.host)),e.host=null),m=m&&(""===n[0]||""===w[0])),_)r.host=e.host||""===e.host?e.host:r.host,r.hostname=e.hostname||""===e.hostname?e.hostname:r.hostname,r.search=e.search,r.query=e.query,w=n;else if(n.length)w||(w=[]),w.pop(),w=w.concat(n),r.search=e.search,r.query=e.query;else if(!at(e.search))return b&&(r.hostname=r.host=w.shift(),(v=!!(r.host&&r.host.indexOf("@")>0)&&r.host.split("@"))&&(r.auth=v.shift(),r.host=r.hostname=v.shift())),r.search=e.search,r.query=e.query,ot(r.pathname)&&ot(r.search)||(r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")),r.href=r.format(),r;if(!w.length)return r.pathname=null,r.search?r.path="/"+r.search:r.path=null,r.href=r.format(),r;for(var E=w.slice(-1)[0],A=(r.host||e.host||w.length>1)&&("."===E||".."===E)||""===E,T=0,k=w.length;k>=0;k--)"."===(E=w[k])?w.splice(k,1):".."===E?(w.splice(k,1),T++):T&&(w.splice(k,1),T--);if(!m&&!y)for(;T--;T)w.unshift("..");!m||""===w[0]||w[0]&&"/"===w[0].charAt(0)||w.unshift(""),A&&"/"!==w.join("/").substr(-1)&&w.push("");var S=""===w[0]||w[0]&&"/"===w[0].charAt(0);return b&&(r.hostname=r.host=S?"":w.length?w.shift():"",(v=!!(r.host&&r.host.indexOf("@")>0)&&r.host.split("@"))&&(r.auth=v.shift(),r.host=r.hostname=v.shift())),(m=m||r.host&&w.length)&&!S&&w.unshift(""),w.length?r.pathname=w.join("/"):(r.pathname=null,r.path=null),ot(r.pathname)&&ot(r.search)||(r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")),r.auth=e.auth||r.auth,r.slashes=r.slashes||e.slashes,r.href=r.format(),r},to.prototype.parseHost=function(){return bo(this)};var Eo=Object.freeze({__proto__:null,parse:vo,resolve:yo,resolveObject:wo,format:_o,default:eo,Url:to});function Ao(e,t){"string"==typeof e&&(e=vo(e));var n=-1===o.location.protocol.search(/^https?:$/)?"http:":"",r=e.protocol||n,i=e.hostname||e.host,a=e.port,s=e.path||"/";i&&-1!==i.indexOf(":")&&(i="["+i+"]"),e.url=(i?r+"//"+i:"")+(a?":"+a:"")+s,e.method=(e.method||"GET").toUpperCase(),e.headers=e.headers||{};var u=new ji(e);return t&&u.on("response",t),u}function To(e,t){var n=Ao(e,t);return n.end(),n}function ko(){}ko.defaultMaxSockets=4;var So=["CHECKOUT","CONNECT","COPY","DELETE","GET","HEAD","LOCK","M-SEARCH","MERGE","MKACTIVITY","MKCOL","MOVE","NOTIFY","OPTIONS","PATCH","POST","PROPFIND","PROPPATCH","PURGE","PUT","REPORT","SEARCH","SUBSCRIBE","TRACE","UNLOCK","UNSUBSCRIBE"],Oo={100:"Continue",101:"Switching Protocols",102:"Processing",200:"OK",201:"Created",202:"Accepted",203:"Non-Authoritative Information",204:"No Content",205:"Reset Content",206:"Partial Content",207:"Multi-Status",300:"Multiple Choices",301:"Moved Permanently",302:"Moved Temporarily",303:"See Other",304:"Not Modified",305:"Use Proxy",307:"Temporary Redirect",400:"Bad Request",401:"Unauthorized",402:"Payment Required",403:"Forbidden",404:"Not Found",405:"Method Not Allowed",406:"Not Acceptable",407:"Proxy Authentication Required",408:"Request Time-out",409:"Conflict",410:"Gone",411:"Length Required",412:"Precondition Failed",413:"Request Entity Too Large",414:"Request-URI Too Large",415:"Unsupported Media Type",416:"Requested Range Not Satisfiable",417:"Expectation Failed",418:"I'm a teapot",422:"Unprocessable Entity",423:"Locked",424:"Failed Dependency",425:"Unordered Collection",426:"Upgrade Required",428:"Precondition Required",429:"Too Many Requests",431:"Request Header Fields Too Large",500:"Internal Server Error",501:"Not Implemented",502:"Bad Gateway",503:"Service Unavailable",504:"Gateway Time-out",505:"HTTP Version Not Supported",506:"Variant Also Negotiates",507:"Insufficient Storage",509:"Bandwidth Limit Exceeded",510:"Not Extended",511:"Network Authentication Required"},Co={request:Ao,get:To,Agent:ko,METHODS:So,STATUS_CODES:Oo},Ro=Object.freeze({__proto__:null,request:Ao,get:To,Agent:ko,METHODS:So,STATUS_CODES:Oo,default:Co});function No(e,t){if(e===t)return 0;for(var n=e.length,r=t.length,i=0,o=Math.min(n,r);i<o;++i)if(e[i]!==t[i]){n=e[i],r=t[i];break}return n<r?-1:r<n?1:0}var Io,Po=Object.prototype.hasOwnProperty,xo=Object.keys||function(e){var t=[];for(var n in e)Po.call(e,n)&&t.push(n);return t},Lo=Array.prototype.slice;function Bo(){return void 0!==Io?Io:Io="foo"===function(){}.name}function jo(e){return Object.prototype.toString.call(e)}function Uo(e){return!We(e)&&("function"==typeof o.ArrayBuffer&&("function"==typeof ArrayBuffer.isView?ArrayBuffer.isView(e):!!e&&(e instanceof DataView||!!(e.buffer&&e.buffer instanceof ArrayBuffer))))}function Do(e,t){e||Zo(e,!0,t,"==",qo)}var Mo=/\s*function\s+([^\(\s]*)\s*/;function zo(e){if(vt(e)){if(Bo())return e.name;var t=e.toString().match(Mo);return t&&t[1]}}function Fo(e){this.name="AssertionError",this.actual=e.actual,this.expected=e.expected,this.operator=e.operator,e.message?(this.message=e.message,this.generatedMessage=!1):(this.message=function(e){return Wo(Ho(e.actual),128)+" "+e.operator+" "+Wo(Ho(e.expected),128)}(this),this.generatedMessage=!0);var t=e.stackStartFunction||Zo;if(Error.captureStackTrace)Error.captureStackTrace(this,t);else{var n=new Error;if(n.stack){var r=n.stack,i=zo(t),o=r.indexOf("\n"+i);if(o>=0){var a=r.indexOf("\n",o+1);r=r.substring(a+1)}this.stack=r}}}function Wo(e,t){return"string"==typeof e?e.length<t?e:e.slice(0,t):e}function Ho(e){if(Bo()||!vt(e))return Je(e);var t=zo(e);return"[Function"+(t?": "+t:"")+"]"}function Zo(e,t,n,r,i){throw new Fo({message:n,actual:e,expected:t,operator:r,stackStartFunction:i})}function qo(e,t){e||Zo(e,!0,t,"==",qo)}function Go(e,t,n){e!=t&&Zo(e,t,n,"==",Go)}function $o(e,t,n){e==t&&Zo(e,t,n,"!=",$o)}function Ko(e,t,n){Vo(e,t,!1)||Zo(e,t,n,"deepEqual",Ko)}function Yo(e,t,n){Vo(e,t,!0)||Zo(e,t,n,"deepStrictEqual",Yo)}function Vo(e,t,n,r){if(e===t)return!0;if(We(e)&&We(t))return 0===No(e,t);if(dt(e)&&dt(t))return e.getTime()===t.getTime();if(ft(e)&&ft(t))return e.source===t.source&&e.global===t.global&&e.multiline===t.multiline&&e.lastIndex===t.lastIndex&&e.ignoreCase===t.ignoreCase;if(null!==e&&"object"==typeof e||null!==t&&"object"==typeof t){if(Uo(e)&&Uo(t)&&jo(e)===jo(t)&&!(e instanceof Float32Array||e instanceof Float64Array))return 0===No(new Uint8Array(e.buffer),new Uint8Array(t.buffer));if(We(e)!==We(t))return!1;var i=(r=r||{actual:[],expected:[]}).actual.indexOf(e);return-1!==i&&i===r.expected.indexOf(t)||(r.actual.push(e),r.expected.push(t),function(e,t,n,r){if(null==e||null==t)return!1;if(gt(e)||gt(t))return e===t;if(n&&Object.getPrototypeOf(e)!==Object.getPrototypeOf(t))return!1;var i=Jo(e),o=Jo(t);if(i&&!o||!i&&o)return!1;if(i)return Vo(e=Lo.call(e),t=Lo.call(t),n);var a,s,u=xo(e),c=xo(t);if(u.length!==c.length)return!1;for(u.sort(),c.sort(),s=u.length-1;s>=0;s--)if(u[s]!==c[s])return!1;for(s=u.length-1;s>=0;s--)if(!Vo(e[a=u[s]],t[a],n,r))return!1;return!0}(e,t,n,r))}return n?e===t:e==t}function Jo(e){return"[object Arguments]"==Object.prototype.toString.call(e)}function Qo(e,t,n){Vo(e,t,!1)&&Zo(e,t,n,"notDeepEqual",Qo)}function Xo(e,t,n){Vo(e,t,!0)&&Zo(e,t,n,"notDeepStrictEqual",Xo)}function ea(e,t,n){e!==t&&Zo(e,t,n,"===",ea)}function ta(e,t,n){e===t&&Zo(e,t,n,"!==",ta)}function na(e,t){if(!e||!t)return!1;if("[object RegExp]"==Object.prototype.toString.call(t))return t.test(e);try{if(e instanceof t)return!0}catch(e){}return!Error.isPrototypeOf(t)&&!0===t.call({},e)}function ra(e,t,n,r){var i;if("function"!=typeof t)throw new TypeError('"block" argument must be a function');"string"==typeof n&&(r=n,n=null),i=function(e){var t;try{e()}catch(e){t=e}return t}(t),r=(n&&n.name?" ("+n.name+").":".")+(r?" "+r:"."),e&&!i&&Zo(i,n,"Missing expected exception"+r);var o="string"==typeof r,a=!e&&i&&!n;if((!e&&pt(i)&&o&&na(i,n)||a)&&Zo(i,n,"Got unwanted exception"+r),e&&i&&n&&!na(i,n)||!e&&i)throw i}function ia(e,t,n){ra(!0,e,t,n)}function oa(e,t,n){ra(!1,e,t,n)}function aa(e){if(e)throw e}Do.AssertionError=Fo,Ze(Fo,Error),Do.fail=Zo,Do.ok=qo,Do.equal=Go,Do.notEqual=$o,Do.deepEqual=Ko,Do.deepStrictEqual=Yo,Do.notDeepEqual=Qo,Do.notDeepStrictEqual=Xo,Do.strictEqual=ea,Do.notStrictEqual=ta,Do.throws=ia,Do.doesNotThrow=oa,Do.ifError=aa;var sa,ua=Object.freeze({__proto__:null,default:Do,AssertionError:Fo,fail:Zo,ok:qo,assert:qo,equal:Go,notEqual:$o,deepEqual:Ko,deepStrictEqual:Yo,notDeepEqual:Qo,notDeepStrictEqual:Xo,strictEqual:ea,notStrictEqual:ta,throws:ia,doesNotThrow:oa,ifError:aa}),ca=function(){if(!sa)try{sa=cn("follow-redirects")}catch(e){sa=function(){}}sa.apply(null,arguments)},la=r(Eo),fa=r(Ro),ha=r(ua),da=la.URL,pa=Pi.Writable,va=["abort","aborted","connect","error","socket","timeout"],ga=Object.create(null);va.forEach((function(e){ga[e]=function(t,n,r){this._redirectable.emit(e,t,n,r)}}));var _a=Sa("ERR_FR_REDIRECTION_FAILURE",""),ma=Sa("ERR_FR_TOO_MANY_REDIRECTS","Maximum number of redirects exceeded"),ya=Sa("ERR_FR_MAX_BODY_LENGTH_EXCEEDED","Request body larger than maxBodyLength limit"),wa=Sa("ERR_STREAM_WRITE_AFTER_END","write after end");function ba(e,t){pa.call(this),this._sanitizeOptions(e),this._options=e,this._ended=!1,this._ending=!1,this._redirectCount=0,this._redirects=[],this._requestBodyLength=0,this._requestBodyBuffers=[],t&&this.on("response",t);var n=this;this._onNativeResponse=function(e){n._processResponse(e)},this._performRequest()}function Ea(e){var t={maxRedirects:21,maxBodyLength:10485760},n={};return Object.keys(e).forEach((function(r){var i=r+":",o=n[i]=e[r],a=t[r]=Object.create(o);Object.defineProperties(a,{request:{value:function(e,r,o){if("string"==typeof e){var a=e;try{e=Ta(new da(a))}catch(t){e=la.parse(a)}}else da&&e instanceof da?e=Ta(e):(o=r,r=e,e={protocol:i});return"function"==typeof r&&(o=r,r=null),(r=Object.assign({maxRedirects:t.maxRedirects,maxBodyLength:t.maxBodyLength},e,r)).nativeProtocols=n,ha.equal(r.protocol,i,"protocol mismatch"),ca("options",r),new ba(r,o)},configurable:!0,enumerable:!0,writable:!0},get:{value:function(e,t,n){var r=a.request(e,t,n);return r.end(),r},configurable:!0,enumerable:!0,writable:!0}})})),t}function Aa(){}function Ta(e){var t={protocol:e.protocol,hostname:e.hostname.startsWith("[")?e.hostname.slice(1,-1):e.hostname,hash:e.hash,search:e.search,pathname:e.pathname,path:e.pathname+e.search,href:e.href};return""!==e.port&&(t.port=Number(e.port)),t}function ka(e,t){var n;for(var r in t)e.test(r)&&(n=t[r],delete t[r]);return n}function Sa(e,t){function n(e){Error.captureStackTrace(this,this.constructor),this.message=e||t}return n.prototype=new Error,n.prototype.constructor=n,n.prototype.name="Error ["+e+"]",n.prototype.code=e,n}function Oa(e){for(var t=0;t<va.length;t++)e.removeListener(va[t],ga[va[t]]);e.on("error",Aa),e.abort()}ba.prototype=Object.create(pa.prototype),ba.prototype.abort=function(){Oa(this._currentRequest),this.emit("abort")},ba.prototype.write=function(e,t,n){if(this._ending)throw new wa;if(!("string"==typeof e||"object"==typeof e&&"length"in e))throw new TypeError("data should be a string, Buffer or Uint8Array");"function"==typeof t&&(n=t,t=null),0!==e.length?this._requestBodyLength+e.length<=this._options.maxBodyLength?(this._requestBodyLength+=e.length,this._requestBodyBuffers.push({data:e,encoding:t}),this._currentRequest.write(e,t,n)):(this.emit("error",new ya),this.abort()):n&&n()},ba.prototype.end=function(e,t,n){if("function"==typeof e?(n=e,e=t=null):"function"==typeof t&&(n=t,t=null),e){var r=this,i=this._currentRequest;this.write(e,t,(function(){r._ended=!0,i.end(null,null,n)})),this._ending=!0}else this._ended=this._ending=!0,this._currentRequest.end(null,null,n)},ba.prototype.setHeader=function(e,t){this._options.headers[e]=t,this._currentRequest.setHeader(e,t)},ba.prototype.removeHeader=function(e){delete this._options.headers[e],this._currentRequest.removeHeader(e)},ba.prototype.setTimeout=function(e,t){var n=this;function r(t){t.setTimeout(e),t.removeListener("timeout",t.destroy),t.addListener("timeout",t.destroy)}function i(t){n._timeout&&clearTimeout(n._timeout),n._timeout=setTimeout((function(){n.emit("timeout"),o()}),e),r(t)}function o(){clearTimeout(this._timeout),t&&n.removeListener("timeout",t),this.socket||n._currentRequest.removeListener("socket",i)}return t&&this.on("timeout",t),this.socket?i(this.socket):this._currentRequest.once("socket",i),this.on("socket",r),this.once("response",o),this.once("error",o),this},["flushHeaders","getHeader","setNoDelay","setSocketKeepAlive"].forEach((function(e){ba.prototype[e]=function(t,n){return this._currentRequest[e](t,n)}})),["aborted","connection","socket"].forEach((function(e){Object.defineProperty(ba.prototype,e,{get:function(){return this._currentRequest[e]}})})),ba.prototype._sanitizeOptions=function(e){if(e.headers||(e.headers={}),e.host&&(e.hostname||(e.hostname=e.host),delete e.host),!e.pathname&&e.path){var t=e.path.indexOf("?");t<0?e.pathname=e.path:(e.pathname=e.path.substring(0,t),e.search=e.path.substring(t))}},ba.prototype._performRequest=function(){var e=this._options.protocol,t=this._options.nativeProtocols[e];if(t){if(this._options.agents){var n=e.substr(0,e.length-1);this._options.agent=this._options.agents[n]}var r=this._currentRequest=t.request(this._options,this._onNativeResponse);this._currentUrl=la.format(this._options),r._redirectable=this;for(var i=0;i<va.length;i++)r.on(va[i],ga[va[i]]);if(this._isRedirect){var o=0,a=this,s=this._requestBodyBuffers;!function e(t){if(r===a._currentRequest)if(t)a.emit("error",t);else if(o<s.length){var n=s[o++];r.finished||r.write(n.data,n.encoding,e)}else a._ended&&r.end()}()}}else this.emit("error",new TypeError("Unsupported protocol "+e))},ba.prototype._processResponse=function(e){var t=e.statusCode;this._options.trackRedirects&&this._redirects.push({url:this._currentUrl,headers:e.headers,statusCode:t});var n=e.headers.location;if(n&&!1!==this._options.followRedirects&&t>=300&&t<400){if(Oa(this._currentRequest),e.destroy(),++this._redirectCount>this._options.maxRedirects)return void this.emit("error",new ma);((301===t||302===t)&&"POST"===this._options.method||303===t&&!/^(?:GET|HEAD)$/.test(this._options.method))&&(this._options.method="GET",this._requestBodyBuffers=[],ka(/^content-/i,this._options.headers));var r=ka(/^host$/i,this._options.headers)||la.parse(this._currentUrl).hostname,i=la.resolve(this._currentUrl,n);ca("redirecting to",i),this._isRedirect=!0;var o=la.parse(i);if(Object.assign(this._options,o),o.hostname!==r&&ka(/^authorization$/i,this._options.headers),"function"==typeof this._options.beforeRedirect){var a={headers:e.headers};try{this._options.beforeRedirect.call(null,this._options,a)}catch(e){return void this.emit("error",e)}this._sanitizeOptions(this._options)}try{this._performRequest()}catch(e){var s=new _a("Redirected request failed: "+e.message);s.cause=e,this.emit("error",s)}}else e.responseUrl=this._currentUrl,e.redirects=this._redirects,this.emit("response",e),this._requestBodyBuffers=[]};var Ca=Ea({http:fa,https:fa}),Ra=Ea;Ca.wrap=Ra;var Na={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"};function Ia(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}function Pa(e,t,n,r,i){if(t.subarray&&e.subarray)e.set(t.subarray(n,n+r),i);else for(var o=0;o<r;o++)e[i+o]=t[n+o]}var xa=Uint8Array,La=Uint16Array,Ba=Int32Array;function ja(e){for(var t=e.length;--t>=0;)e[t]=0}var Ua=256,Da=286,Ma=30,za=15,Fa=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0],Wa=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],Ha=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],Za=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],qa=new Array(576);ja(qa);var Ga=new Array(60);ja(Ga);var $a=new Array(512);ja($a);var Ka=new Array(256);ja(Ka);var Ya=new Array(29);ja(Ya);var Va,Ja,Qa,Xa=new Array(Ma);function es(e,t,n,r,i){this.static_tree=e,this.extra_bits=t,this.extra_base=n,this.elems=r,this.max_length=i,this.has_stree=e&&e.length}function ts(e,t){this.dyn_tree=e,this.max_code=0,this.stat_desc=t}function ns(e){return e<256?$a[e]:$a[256+(e>>>7)]}function rs(e,t){e.pending_buf[e.pending++]=255&t,e.pending_buf[e.pending++]=t>>>8&255}function is(e,t,n){e.bi_valid>16-n?(e.bi_buf|=t<<e.bi_valid&65535,rs(e,e.bi_buf),e.bi_buf=t>>16-e.bi_valid,e.bi_valid+=n-16):(e.bi_buf|=t<<e.bi_valid&65535,e.bi_valid+=n)}function os(e,t,n){is(e,n[2*t],n[2*t+1])}function as(e,t){var n=0;do{n|=1&e,e>>>=1,n<<=1}while(--t>0);return n>>>1}function ss(e,t,n){var r,i,o=new Array(16),a=0;for(r=1;r<=za;r++)o[r]=a=a+n[r-1]<<1;for(i=0;i<=t;i++){var s=e[2*i+1];0!==s&&(e[2*i]=as(o[s]++,s))}}function us(e){var t;for(t=0;t<Da;t++)e.dyn_ltree[2*t]=0;for(t=0;t<Ma;t++)e.dyn_dtree[2*t]=0;for(t=0;t<19;t++)e.bl_tree[2*t]=0;e.dyn_ltree[512]=1,e.opt_len=e.static_len=0,e.last_lit=e.matches=0}function cs(e){e.bi_valid>8?rs(e,e.bi_buf):e.bi_valid>0&&(e.pending_buf[e.pending++]=e.bi_buf),e.bi_buf=0,e.bi_valid=0}function ls(e,t,n,r){var i=2*t,o=2*n;return e[i]<e[o]||e[i]===e[o]&&r[t]<=r[n]}function fs(e,t,n){for(var r=e.heap[n],i=n<<1;i<=e.heap_len&&(i<e.heap_len&&ls(t,e.heap[i+1],e.heap[i],e.depth)&&i++,!ls(t,r,e.heap[i],e.depth));)e.heap[n]=e.heap[i],n=i,i<<=1;e.heap[n]=r}function hs(e,t,n){var r,i,o,a,s=0;if(0!==e.last_lit)do{r=e.pending_buf[e.d_buf+2*s]<<8|e.pending_buf[e.d_buf+2*s+1],i=e.pending_buf[e.l_buf+s],s++,0===r?os(e,i,t):(os(e,(o=Ka[i])+Ua+1,t),0!==(a=Fa[o])&&is(e,i-=Ya[o],a),os(e,o=ns(--r),n),0!==(a=Wa[o])&&is(e,r-=Xa[o],a))}while(s<e.last_lit);os(e,256,t)}function ds(e,t){var n,r,i,o=t.dyn_tree,a=t.stat_desc.static_tree,s=t.stat_desc.has_stree,u=t.stat_desc.elems,c=-1;for(e.heap_len=0,e.heap_max=573,n=0;n<u;n++)0!==o[2*n]?(e.heap[++e.heap_len]=c=n,e.depth[n]=0):o[2*n+1]=0;for(;e.heap_len<2;)o[2*(i=e.heap[++e.heap_len]=c<2?++c:0)]=1,e.depth[i]=0,e.opt_len--,s&&(e.static_len-=a[2*i+1]);for(t.max_code=c,n=e.heap_len>>1;n>=1;n--)fs(e,o,n);i=u;do{n=e.heap[1],e.heap[1]=e.heap[e.heap_len--],fs(e,o,1),r=e.heap[1],e.heap[--e.heap_max]=n,e.heap[--e.heap_max]=r,o[2*i]=o[2*n]+o[2*r],e.depth[i]=(e.depth[n]>=e.depth[r]?e.depth[n]:e.depth[r])+1,o[2*n+1]=o[2*r+1]=i,e.heap[1]=i++,fs(e,o,1)}while(e.heap_len>=2);e.heap[--e.heap_max]=e.heap[1],function(e,t){var n,r,i,o,a,s,u=t.dyn_tree,c=t.max_code,l=t.stat_desc.static_tree,f=t.stat_desc.has_stree,h=t.stat_desc.extra_bits,d=t.stat_desc.extra_base,p=t.stat_desc.max_length,v=0;for(o=0;o<=za;o++)e.bl_count[o]=0;for(u[2*e.heap[e.heap_max]+1]=0,n=e.heap_max+1;n<573;n++)(o=u[2*u[2*(r=e.heap[n])+1]+1]+1)>p&&(o=p,v++),u[2*r+1]=o,r>c||(e.bl_count[o]++,a=0,r>=d&&(a=h[r-d]),s=u[2*r],e.opt_len+=s*(o+a),f&&(e.static_len+=s*(l[2*r+1]+a)));if(0!==v){do{for(o=p-1;0===e.bl_count[o];)o--;e.bl_count[o]--,e.bl_count[o+1]+=2,e.bl_count[p]--,v-=2}while(v>0);for(o=p;0!==o;o--)for(r=e.bl_count[o];0!==r;)(i=e.heap[--n])>c||(u[2*i+1]!==o&&(e.opt_len+=(o-u[2*i+1])*u[2*i],u[2*i+1]=o),r--)}}(e,t),ss(o,c,e.bl_count)}function ps(e,t,n){var r,i,o=-1,a=t[1],s=0,u=7,c=4;for(0===a&&(u=138,c=3),t[2*(n+1)+1]=65535,r=0;r<=n;r++)i=a,a=t[2*(r+1)+1],++s<u&&i===a||(s<c?e.bl_tree[2*i]+=s:0!==i?(i!==o&&e.bl_tree[2*i]++,e.bl_tree[32]++):s<=10?e.bl_tree[34]++:e.bl_tree[36]++,s=0,o=i,0===a?(u=138,c=3):i===a?(u=6,c=3):(u=7,c=4))}function vs(e,t,n){var r,i,o=-1,a=t[1],s=0,u=7,c=4;for(0===a&&(u=138,c=3),r=0;r<=n;r++)if(i=a,a=t[2*(r+1)+1],!(++s<u&&i===a)){if(s<c)do{os(e,i,e.bl_tree)}while(0!=--s);else 0!==i?(i!==o&&(os(e,i,e.bl_tree),s--),os(e,16,e.bl_tree),is(e,s-3,2)):s<=10?(os(e,17,e.bl_tree),is(e,s-3,3)):(os(e,18,e.bl_tree),is(e,s-11,7));s=0,o=i,0===a?(u=138,c=3):i===a?(u=6,c=3):(u=7,c=4)}}ja(Xa);var gs=!1;function _s(e){gs||(!function(){var e,t,n,r,i,o=new Array(16);for(n=0,r=0;r<28;r++)for(Ya[r]=n,e=0;e<1<<Fa[r];e++)Ka[n++]=r;for(Ka[n-1]=r,i=0,r=0;r<16;r++)for(Xa[r]=i,e=0;e<1<<Wa[r];e++)$a[i++]=r;for(i>>=7;r<Ma;r++)for(Xa[r]=i<<7,e=0;e<1<<Wa[r]-7;e++)$a[256+i++]=r;for(t=0;t<=za;t++)o[t]=0;for(e=0;e<=143;)qa[2*e+1]=8,e++,o[8]++;for(;e<=255;)qa[2*e+1]=9,e++,o[9]++;for(;e<=279;)qa[2*e+1]=7,e++,o[7]++;for(;e<=287;)qa[2*e+1]=8,e++,o[8]++;for(ss(qa,287,o),e=0;e<Ma;e++)Ga[2*e+1]=5,Ga[2*e]=as(e,5);Va=new es(qa,Fa,257,Da,za),Ja=new es(Ga,Wa,0,Ma,za),Qa=new es(new Array(0),Ha,0,19,7)}(),gs=!0),e.l_desc=new ts(e.dyn_ltree,Va),e.d_desc=new ts(e.dyn_dtree,Ja),e.bl_desc=new ts(e.bl_tree,Qa),e.bi_buf=0,e.bi_valid=0,us(e)}function ms(e,t,n,r){is(e,0+(r?1:0),3),function(e,t,n,r){cs(e),r&&(rs(e,n),rs(e,~n)),Pa(e.pending_buf,e.window,t,n,e.pending),e.pending+=n}(e,t,n,!0)}function ys(e){is(e,2,3),os(e,256,qa),function(e){16===e.bi_valid?(rs(e,e.bi_buf),e.bi_buf=0,e.bi_valid=0):e.bi_valid>=8&&(e.pending_buf[e.pending++]=255&e.bi_buf,e.bi_buf>>=8,e.bi_valid-=8)}(e)}function ws(e,t,n,r){var i,o,a=0;e.level>0?(2===e.strm.data_type&&(e.strm.data_type=function(e){var t,n=4093624447;for(t=0;t<=31;t++,n>>>=1)if(1&n&&0!==e.dyn_ltree[2*t])return 0;if(0!==e.dyn_ltree[18]||0!==e.dyn_ltree[20]||0!==e.dyn_ltree[26])return 1;for(t=32;t<Ua;t++)if(0!==e.dyn_ltree[2*t])return 1;return 0}(e)),ds(e,e.l_desc),ds(e,e.d_desc),a=function(e){var t;for(ps(e,e.dyn_ltree,e.l_desc.max_code),ps(e,e.dyn_dtree,e.d_desc.max_code),ds(e,e.bl_desc),t=18;t>=3&&0===e.bl_tree[2*Za[t]+1];t--);return e.opt_len+=3*(t+1)+5+5+4,t}(e),i=e.opt_len+3+7>>>3,(o=e.static_len+3+7>>>3)<=i&&(i=o)):i=o=n+5,n+4<=i&&-1!==t?ms(e,t,n,r):4===e.strategy||o===i?(is(e,2+(r?1:0),3),hs(e,qa,Ga)):(is(e,4+(r?1:0),3),function(e,t,n,r){var i;for(is(e,t-257,5),is(e,n-1,5),is(e,r-4,4),i=0;i<r;i++)is(e,e.bl_tree[2*Za[i]+1],3);vs(e,e.dyn_ltree,t-1),vs(e,e.dyn_dtree,n-1)}(e,e.l_desc.max_code+1,e.d_desc.max_code+1,a+1),hs(e,e.dyn_ltree,e.dyn_dtree)),us(e),r&&cs(e)}function bs(e,t,n){return e.pending_buf[e.d_buf+2*e.last_lit]=t>>>8&255,e.pending_buf[e.d_buf+2*e.last_lit+1]=255&t,e.pending_buf[e.l_buf+e.last_lit]=255&n,e.last_lit++,0===t?e.dyn_ltree[2*n]++:(e.matches++,t--,e.dyn_ltree[2*(Ka[n]+Ua+1)]++,e.dyn_dtree[2*ns(t)]++),e.last_lit===e.lit_bufsize-1}function Es(e,t,n,r){for(var i=65535&e|0,o=e>>>16&65535|0,a=0;0!==n;){n-=a=n>2e3?2e3:n;do{o=o+(i=i+t[r++]|0)|0}while(--a);i%=65521,o%=65521}return i|o<<16|0}var As=function(){for(var e,t=[],n=0;n<256;n++){e=n;for(var r=0;r<8;r++)e=1&e?3988292384^e>>>1:e>>>1;t[n]=e}return t}();function Ts(e,t,n,r){var i=As,o=r+n;e^=-1;for(var a=r;a<o;a++)e=e>>>8^i[255&(e^t[a])];return-1^e}var ks,Ss=-2,Os=258,Cs=262,Rs=103,Ns=113,Is=666;function Ps(e,t){return e.msg=Na[t],t}function xs(e){return(e<<1)-(e>4?9:0)}function Ls(e){for(var t=e.length;--t>=0;)e[t]=0}function Bs(e){var t=e.state,n=t.pending;n>e.avail_out&&(n=e.avail_out),0!==n&&(Pa(e.output,t.pending_buf,t.pending_out,n,e.next_out),e.next_out+=n,t.pending_out+=n,e.total_out+=n,e.avail_out-=n,t.pending-=n,0===t.pending&&(t.pending_out=0))}function js(e,t){ws(e,e.block_start>=0?e.block_start:-1,e.strstart-e.block_start,t),e.block_start=e.strstart,Bs(e.strm)}function Us(e,t){e.pending_buf[e.pending++]=t}function Ds(e,t){e.pending_buf[e.pending++]=t>>>8&255,e.pending_buf[e.pending++]=255&t}function Ms(e,t){var n,r,i=e.max_chain_length,o=e.strstart,a=e.prev_length,s=e.nice_match,u=e.strstart>e.w_size-Cs?e.strstart-(e.w_size-Cs):0,c=e.window,l=e.w_mask,f=e.prev,h=e.strstart+Os,d=c[o+a-1],p=c[o+a];e.prev_length>=e.good_match&&(i>>=2),s>e.lookahead&&(s=e.lookahead);do{if(c[(n=t)+a]===p&&c[n+a-1]===d&&c[n]===c[o]&&c[++n]===c[o+1]){o+=2,n++;do{}while(c[++o]===c[++n]&&c[++o]===c[++n]&&c[++o]===c[++n]&&c[++o]===c[++n]&&c[++o]===c[++n]&&c[++o]===c[++n]&&c[++o]===c[++n]&&c[++o]===c[++n]&&o<h);if(r=Os-(h-o),o=h-Os,r>a){if(e.match_start=t,a=r,r>=s)break;d=c[o+a-1],p=c[o+a]}}}while((t=f[t&l])>u&&0!=--i);return a<=e.lookahead?a:e.lookahead}function zs(e){var t,n,r,i,o,a,s,u,c,l,f=e.w_size;do{if(i=e.window_size-e.lookahead-e.strstart,e.strstart>=f+(f-Cs)){Pa(e.window,e.window,f,f,0),e.match_start-=f,e.strstart-=f,e.block_start-=f,t=n=e.hash_size;do{r=e.head[--t],e.head[t]=r>=f?r-f:0}while(--n);t=n=f;do{r=e.prev[--t],e.prev[t]=r>=f?r-f:0}while(--n);i+=f}if(0===e.strm.avail_in)break;if(a=e.strm,s=e.window,u=e.strstart+e.lookahead,c=i,l=void 0,(l=a.avail_in)>c&&(l=c),n=0===l?0:(a.avail_in-=l,Pa(s,a.input,a.next_in,l,u),1===a.state.wrap?a.adler=Es(a.adler,s,l,u):2===a.state.wrap&&(a.adler=Ts(a.adler,s,l,u)),a.next_in+=l,a.total_in+=l,l),e.lookahead+=n,e.lookahead+e.insert>=3)for(o=e.strstart-e.insert,e.ins_h=e.window[o],e.ins_h=(e.ins_h<<e.hash_shift^e.window[o+1])&e.hash_mask;e.insert&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[o+3-1])&e.hash_mask,e.prev[o&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=o,o++,e.insert--,!(e.lookahead+e.insert<3)););}while(e.lookahead<Cs&&0!==e.strm.avail_in)}function Fs(e,t){for(var n,r;;){if(e.lookahead<Cs){if(zs(e),e.lookahead<Cs&&0===t)return 1;if(0===e.lookahead)break}if(n=0,e.lookahead>=3&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+3-1])&e.hash_mask,n=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),0!==n&&e.strstart-n<=e.w_size-Cs&&(e.match_length=Ms(e,n)),e.match_length>=3)if(r=bs(e,e.strstart-e.match_start,e.match_length-3),e.lookahead-=e.match_length,e.match_length<=e.max_lazy_match&&e.lookahead>=3){e.match_length--;do{e.strstart++,e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+3-1])&e.hash_mask,n=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart}while(0!=--e.match_length);e.strstart++}else e.strstart+=e.match_length,e.match_length=0,e.ins_h=e.window[e.strstart],e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+1])&e.hash_mask;else r=bs(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++;if(r&&(js(e,!1),0===e.strm.avail_out))return 1}return e.insert=e.strstart<2?e.strstart:2,4===t?(js(e,!0),0===e.strm.avail_out?3:4):e.last_lit&&(js(e,!1),0===e.strm.avail_out)?1:2}function Ws(e,t){for(var n,r,i;;){if(e.lookahead<Cs){if(zs(e),e.lookahead<Cs&&0===t)return 1;if(0===e.lookahead)break}if(n=0,e.lookahead>=3&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+3-1])&e.hash_mask,n=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),e.prev_length=e.match_length,e.prev_match=e.match_start,e.match_length=2,0!==n&&e.prev_length<e.max_lazy_match&&e.strstart-n<=e.w_size-Cs&&(e.match_length=Ms(e,n),e.match_length<=5&&(1===e.strategy||3===e.match_length&&e.strstart-e.match_start>4096)&&(e.match_length=2)),e.prev_length>=3&&e.match_length<=e.prev_length){i=e.strstart+e.lookahead-3,r=bs(e,e.strstart-1-e.prev_match,e.prev_length-3),e.lookahead-=e.prev_length-1,e.prev_length-=2;do{++e.strstart<=i&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+3-1])&e.hash_mask,n=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart)}while(0!=--e.prev_length);if(e.match_available=0,e.match_length=2,e.strstart++,r&&(js(e,!1),0===e.strm.avail_out))return 1}else if(e.match_available){if((r=bs(e,0,e.window[e.strstart-1]))&&js(e,!1),e.strstart++,e.lookahead--,0===e.strm.avail_out)return 1}else e.match_available=1,e.strstart++,e.lookahead--}return e.match_available&&(r=bs(e,0,e.window[e.strstart-1]),e.match_available=0),e.insert=e.strstart<2?e.strstart:2,4===t?(js(e,!0),0===e.strm.avail_out?3:4):e.last_lit&&(js(e,!1),0===e.strm.avail_out)?1:2}function Hs(e,t,n,r,i){this.good_length=e,this.max_lazy=t,this.nice_length=n,this.max_chain=r,this.func=i}function Zs(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=8,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new La(1146),this.dyn_dtree=new La(122),this.bl_tree=new La(78),Ls(this.dyn_ltree),Ls(this.dyn_dtree),Ls(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new La(16),this.heap=new La(573),Ls(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new La(573),Ls(this.depth),this.l_buf=0,this.lit_bufsize=0,this.last_lit=0,this.d_buf=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}function qs(e){var t=function(e){var t;return e&&e.state?(e.total_in=e.total_out=0,e.data_type=2,(t=e.state).pending=0,t.pending_out=0,t.wrap<0&&(t.wrap=-t.wrap),t.status=t.wrap?42:Ns,e.adler=2===t.wrap?0:1,t.last_flush=0,_s(t),0):Ps(e,Ss)}(e);return 0===t&&function(e){e.window_size=2*e.w_size,Ls(e.head),e.max_lazy_match=ks[e.level].max_lazy,e.good_match=ks[e.level].good_length,e.nice_match=ks[e.level].nice_length,e.max_chain_length=ks[e.level].max_chain,e.strstart=0,e.block_start=0,e.lookahead=0,e.insert=0,e.match_length=e.prev_length=2,e.match_available=0,e.ins_h=0}(e.state),t}function Gs(e,t){var n,r,i,o;if(!e||!e.state||t>5||t<0)return e?Ps(e,Ss):Ss;if(r=e.state,!e.output||!e.input&&0!==e.avail_in||r.status===Is&&4!==t)return Ps(e,0===e.avail_out?-5:Ss);if(r.strm=e,n=r.last_flush,r.last_flush=t,42===r.status)if(2===r.wrap)e.adler=0,Us(r,31),Us(r,139),Us(r,8),r.gzhead?(Us(r,(r.gzhead.text?1:0)+(r.gzhead.hcrc?2:0)+(r.gzhead.extra?4:0)+(r.gzhead.name?8:0)+(r.gzhead.comment?16:0)),Us(r,255&r.gzhead.time),Us(r,r.gzhead.time>>8&255),Us(r,r.gzhead.time>>16&255),Us(r,r.gzhead.time>>24&255),Us(r,9===r.level?2:r.strategy>=2||r.level<2?4:0),Us(r,255&r.gzhead.os),r.gzhead.extra&&r.gzhead.extra.length&&(Us(r,255&r.gzhead.extra.length),Us(r,r.gzhead.extra.length>>8&255)),r.gzhead.hcrc&&(e.adler=Ts(e.adler,r.pending_buf,r.pending,0)),r.gzindex=0,r.status=69):(Us(r,0),Us(r,0),Us(r,0),Us(r,0),Us(r,0),Us(r,9===r.level?2:r.strategy>=2||r.level<2?4:0),Us(r,3),r.status=Ns);else{var a=8+(r.w_bits-8<<4)<<8;a|=(r.strategy>=2||r.level<2?0:r.level<6?1:6===r.level?2:3)<<6,0!==r.strstart&&(a|=32),a+=31-a%31,r.status=Ns,Ds(r,a),0!==r.strstart&&(Ds(r,e.adler>>>16),Ds(r,65535&e.adler)),e.adler=1}if(69===r.status)if(r.gzhead.extra){for(i=r.pending;r.gzindex<(65535&r.gzhead.extra.length)&&(r.pending!==r.pending_buf_size||(r.gzhead.hcrc&&r.pending>i&&(e.adler=Ts(e.adler,r.pending_buf,r.pending-i,i)),Bs(e),i=r.pending,r.pending!==r.pending_buf_size));)Us(r,255&r.gzhead.extra[r.gzindex]),r.gzindex++;r.gzhead.hcrc&&r.pending>i&&(e.adler=Ts(e.adler,r.pending_buf,r.pending-i,i)),r.gzindex===r.gzhead.extra.length&&(r.gzindex=0,r.status=73)}else r.status=73;if(73===r.status)if(r.gzhead.name){i=r.pending;do{if(r.pending===r.pending_buf_size&&(r.gzhead.hcrc&&r.pending>i&&(e.adler=Ts(e.adler,r.pending_buf,r.pending-i,i)),Bs(e),i=r.pending,r.pending===r.pending_buf_size)){o=1;break}o=r.gzindex<r.gzhead.name.length?255&r.gzhead.name.charCodeAt(r.gzindex++):0,Us(r,o)}while(0!==o);r.gzhead.hcrc&&r.pending>i&&(e.adler=Ts(e.adler,r.pending_buf,r.pending-i,i)),0===o&&(r.gzindex=0,r.status=91)}else r.status=91;if(91===r.status)if(r.gzhead.comment){i=r.pending;do{if(r.pending===r.pending_buf_size&&(r.gzhead.hcrc&&r.pending>i&&(e.adler=Ts(e.adler,r.pending_buf,r.pending-i,i)),Bs(e),i=r.pending,r.pending===r.pending_buf_size)){o=1;break}o=r.gzindex<r.gzhead.comment.length?255&r.gzhead.comment.charCodeAt(r.gzindex++):0,Us(r,o)}while(0!==o);r.gzhead.hcrc&&r.pending>i&&(e.adler=Ts(e.adler,r.pending_buf,r.pending-i,i)),0===o&&(r.status=Rs)}else r.status=Rs;if(r.status===Rs&&(r.gzhead.hcrc?(r.pending+2>r.pending_buf_size&&Bs(e),r.pending+2<=r.pending_buf_size&&(Us(r,255&e.adler),Us(r,e.adler>>8&255),e.adler=0,r.status=Ns)):r.status=Ns),0!==r.pending){if(Bs(e),0===e.avail_out)return r.last_flush=-1,0}else if(0===e.avail_in&&xs(t)<=xs(n)&&4!==t)return Ps(e,-5);if(r.status===Is&&0!==e.avail_in)return Ps(e,-5);if(0!==e.avail_in||0!==r.lookahead||0!==t&&r.status!==Is){var s=2===r.strategy?function(e,t){for(var n;;){if(0===e.lookahead&&(zs(e),0===e.lookahead)){if(0===t)return 1;break}if(e.match_length=0,n=bs(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++,n&&(js(e,!1),0===e.strm.avail_out))return 1}return e.insert=0,4===t?(js(e,!0),0===e.strm.avail_out?3:4):e.last_lit&&(js(e,!1),0===e.strm.avail_out)?1:2}(r,t):3===r.strategy?function(e,t){for(var n,r,i,o,a=e.window;;){if(e.lookahead<=Os){if(zs(e),e.lookahead<=Os&&0===t)return 1;if(0===e.lookahead)break}if(e.match_length=0,e.lookahead>=3&&e.strstart>0&&(r=a[i=e.strstart-1])===a[++i]&&r===a[++i]&&r===a[++i]){o=e.strstart+Os;do{}while(r===a[++i]&&r===a[++i]&&r===a[++i]&&r===a[++i]&&r===a[++i]&&r===a[++i]&&r===a[++i]&&r===a[++i]&&i<o);e.match_length=Os-(o-i),e.match_length>e.lookahead&&(e.match_length=e.lookahead)}if(e.match_length>=3?(n=bs(e,1,e.match_length-3),e.lookahead-=e.match_length,e.strstart+=e.match_length,e.match_length=0):(n=bs(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++),n&&(js(e,!1),0===e.strm.avail_out))return 1}return e.insert=0,4===t?(js(e,!0),0===e.strm.avail_out?3:4):e.last_lit&&(js(e,!1),0===e.strm.avail_out)?1:2}(r,t):ks[r.level].func(r,t);if(3!==s&&4!==s||(r.status=Is),1===s||3===s)return 0===e.avail_out&&(r.last_flush=-1),0;if(2===s&&(1===t?ys(r):5!==t&&(ms(r,0,0,!1),3===t&&(Ls(r.head),0===r.lookahead&&(r.strstart=0,r.block_start=0,r.insert=0))),Bs(e),0===e.avail_out))return r.last_flush=-1,0}return 4!==t?0:r.wrap<=0?1:(2===r.wrap?(Us(r,255&e.adler),Us(r,e.adler>>8&255),Us(r,e.adler>>16&255),Us(r,e.adler>>24&255),Us(r,255&e.total_in),Us(r,e.total_in>>8&255),Us(r,e.total_in>>16&255),Us(r,e.total_in>>24&255)):(Ds(r,e.adler>>>16),Ds(r,65535&e.adler)),Bs(e),r.wrap>0&&(r.wrap=-r.wrap),0!==r.pending?0:1)}ks=[new Hs(0,0,0,0,(function(e,t){var n=65535;for(n>e.pending_buf_size-5&&(n=e.pending_buf_size-5);;){if(e.lookahead<=1){if(zs(e),0===e.lookahead&&0===t)return 1;if(0===e.lookahead)break}e.strstart+=e.lookahead,e.lookahead=0;var r=e.block_start+n;if((0===e.strstart||e.strstart>=r)&&(e.lookahead=e.strstart-r,e.strstart=r,js(e,!1),0===e.strm.avail_out))return 1;if(e.strstart-e.block_start>=e.w_size-Cs&&(js(e,!1),0===e.strm.avail_out))return 1}return e.insert=0,4===t?(js(e,!0),0===e.strm.avail_out?3:4):(e.strstart>e.block_start&&(js(e,!1),e.strm.avail_out),1)})),new Hs(4,4,8,4,Fs),new Hs(4,5,16,8,Fs),new Hs(4,6,32,32,Fs),new Hs(4,4,16,16,Ws),new Hs(8,16,32,32,Ws),new Hs(8,16,128,128,Ws),new Hs(8,32,128,256,Ws),new Hs(32,128,258,1024,Ws),new Hs(32,258,258,4096,Ws)];function $s(e,t){var n,r,i,o,a,s,u,c,l,f,h,d,p,v,g,_,m,y,w,b,E,A,T,k,S;n=e.state,r=e.next_in,k=e.input,i=r+(e.avail_in-5),o=e.next_out,S=e.output,a=o-(t-e.avail_out),s=o+(e.avail_out-257),u=n.dmax,c=n.wsize,l=n.whave,f=n.wnext,h=n.window,d=n.hold,p=n.bits,v=n.lencode,g=n.distcode,_=(1<<n.lenbits)-1,m=(1<<n.distbits)-1;e:do{p<15&&(d+=k[r++]<<p,p+=8,d+=k[r++]<<p,p+=8),y=v[d&_];t:for(;;){if(d>>>=w=y>>>24,p-=w,0===(w=y>>>16&255))S[o++]=65535&y;else{if(!(16&w)){if(0==(64&w)){y=v[(65535&y)+(d&(1<<w)-1)];continue t}if(32&w){n.mode=12;break e}e.msg="invalid literal/length code",n.mode=30;break e}b=65535&y,(w&=15)&&(p<w&&(d+=k[r++]<<p,p+=8),b+=d&(1<<w)-1,d>>>=w,p-=w),p<15&&(d+=k[r++]<<p,p+=8,d+=k[r++]<<p,p+=8),y=g[d&m];n:for(;;){if(d>>>=w=y>>>24,p-=w,!(16&(w=y>>>16&255))){if(0==(64&w)){y=g[(65535&y)+(d&(1<<w)-1)];continue n}e.msg="invalid distance code",n.mode=30;break e}if(E=65535&y,p<(w&=15)&&(d+=k[r++]<<p,(p+=8)<w&&(d+=k[r++]<<p,p+=8)),(E+=d&(1<<w)-1)>u){e.msg="invalid distance too far back",n.mode=30;break e}if(d>>>=w,p-=w,E>(w=o-a)){if((w=E-w)>l&&n.sane){e.msg="invalid distance too far back",n.mode=30;break e}if(A=0,T=h,0===f){if(A+=c-w,w<b){b-=w;do{S[o++]=h[A++]}while(--w);A=o-E,T=S}}else if(f<w){if(A+=c+f-w,(w-=f)<b){b-=w;do{S[o++]=h[A++]}while(--w);if(A=0,f<b){b-=w=f;do{S[o++]=h[A++]}while(--w);A=o-E,T=S}}}else if(A+=f-w,w<b){b-=w;do{S[o++]=h[A++]}while(--w);A=o-E,T=S}for(;b>2;)S[o++]=T[A++],S[o++]=T[A++],S[o++]=T[A++],b-=3;b&&(S[o++]=T[A++],b>1&&(S[o++]=T[A++]))}else{A=o-E;do{S[o++]=S[A++],S[o++]=S[A++],S[o++]=S[A++],b-=3}while(b>2);b&&(S[o++]=S[A++],b>1&&(S[o++]=S[A++]))}break}}break}}while(r<i&&o<s);r-=b=p>>3,d&=(1<<(p-=b<<3))-1,e.next_in=r,e.next_out=o,e.avail_in=r<i?i-r+5:5-(r-i),e.avail_out=o<s?s-o+257:257-(o-s),n.hold=d,n.bits=p}var Ks=15,Ys=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0],Vs=[16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78],Js=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0],Qs=[16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64];function Xs(e,t,n,r,i,o,a,s){var u,c,l,f,h,d,p,v,g,_=s.bits,m=0,y=0,w=0,b=0,E=0,A=0,T=0,k=0,S=0,O=0,C=null,R=0,N=new La(16),I=new La(16),P=null,x=0;for(m=0;m<=Ks;m++)N[m]=0;for(y=0;y<r;y++)N[t[n+y]]++;for(E=_,b=Ks;b>=1&&0===N[b];b--);if(E>b&&(E=b),0===b)return i[o++]=20971520,i[o++]=20971520,s.bits=1,0;for(w=1;w<b&&0===N[w];w++);for(E<w&&(E=w),k=1,m=1;m<=Ks;m++)if(k<<=1,(k-=N[m])<0)return-1;if(k>0&&(0===e||1!==b))return-1;for(I[1]=0,m=1;m<Ks;m++)I[m+1]=I[m]+N[m];for(y=0;y<r;y++)0!==t[n+y]&&(a[I[t[n+y]]++]=y);if(0===e?(C=P=a,d=19):1===e?(C=Ys,R-=257,P=Vs,x-=257,d=256):(C=Js,P=Qs,d=-1),O=0,y=0,m=w,h=o,A=E,T=0,l=-1,f=(S=1<<E)-1,1===e&&S>852||2===e&&S>592)return 1;for(;;){p=m-T,a[y]<d?(v=0,g=a[y]):a[y]>d?(v=P[x+a[y]],g=C[R+a[y]]):(v=96,g=0),u=1<<m-T,w=c=1<<A;do{i[h+(O>>T)+(c-=u)]=p<<24|v<<16|g|0}while(0!==c);for(u=1<<m-1;O&u;)u>>=1;if(0!==u?(O&=u-1,O+=u):O=0,y++,0==--N[m]){if(m===b)break;m=t[n+a[y]]}if(m>E&&(O&f)!==l){for(0===T&&(T=E),h+=w,k=1<<(A=m-T);A+T<b&&!((k-=N[A+T])<=0);)A++,k<<=1;if(S+=1<<A,1===e&&S>852||2===e&&S>592)return 1;i[l=O&f]=E<<24|A<<16|h-o|0}}return 0!==O&&(i[h+O]=m-T<<24|64<<16|0),s.bits=E,0}var eu=-2,tu=12,nu=30;function ru(e){return(e>>>24&255)+(e>>>8&65280)+((65280&e)<<8)+((255&e)<<24)}function iu(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new La(320),this.work=new La(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function ou(e){var t;return e&&e.state?((t=e.state).wsize=0,t.whave=0,t.wnext=0,function(e){var t;return e&&e.state?(t=e.state,e.total_in=e.total_out=t.total=0,e.msg="",t.wrap&&(e.adler=1&t.wrap),t.mode=1,t.last=0,t.havedict=0,t.dmax=32768,t.head=null,t.hold=0,t.bits=0,t.lencode=t.lendyn=new Ba(852),t.distcode=t.distdyn=new Ba(592),t.sane=1,t.back=-1,0):eu}(e)):eu}function au(e,t){var n,r;return e?(r=new iu,e.state=r,r.window=null,0!==(n=function(e,t){var n,r;return e&&e.state?(r=e.state,t<0?(n=0,t=-t):(n=1+(t>>4),t<48&&(t&=15)),t&&(t<8||t>15)?eu:(null!==r.window&&r.wbits!==t&&(r.window=null),r.wrap=n,r.wbits=t,ou(e))):eu}(e,t))&&(e.state=null),n):eu}var su,uu,cu=!0;function lu(e){if(cu){var t;for(su=new Ba(512),uu=new Ba(32),t=0;t<144;)e.lens[t++]=8;for(;t<256;)e.lens[t++]=9;for(;t<280;)e.lens[t++]=7;for(;t<288;)e.lens[t++]=8;for(Xs(1,e.lens,0,288,su,0,e.work,{bits:9}),t=0;t<32;)e.lens[t++]=5;Xs(2,e.lens,0,32,uu,0,e.work,{bits:5}),cu=!1}e.lencode=su,e.lenbits=9,e.distcode=uu,e.distbits=5}function fu(e,t){var n,r,i,o,a,s,u,c,l,f,h,d,p,v,g,_,m,y,w,b,E,A,T,k,S=0,O=new xa(4),C=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];if(!e||!e.state||!e.output||!e.input&&0!==e.avail_in)return eu;(n=e.state).mode===tu&&(n.mode=13),a=e.next_out,i=e.output,u=e.avail_out,o=e.next_in,r=e.input,s=e.avail_in,c=n.hold,l=n.bits,f=s,h=u,A=0;e:for(;;)switch(n.mode){case 1:if(0===n.wrap){n.mode=13;break}for(;l<16;){if(0===s)break e;s--,c+=r[o++]<<l,l+=8}if(2&n.wrap&&35615===c){n.check=0,O[0]=255&c,O[1]=c>>>8&255,n.check=Ts(n.check,O,2,0),c=0,l=0,n.mode=2;break}if(n.flags=0,n.head&&(n.head.done=!1),!(1&n.wrap)||(((255&c)<<8)+(c>>8))%31){e.msg="incorrect header check",n.mode=nu;break}if(8!=(15&c)){e.msg="unknown compression method",n.mode=nu;break}if(l-=4,E=8+(15&(c>>>=4)),0===n.wbits)n.wbits=E;else if(E>n.wbits){e.msg="invalid window size",n.mode=nu;break}n.dmax=1<<E,e.adler=n.check=1,n.mode=512&c?10:tu,c=0,l=0;break;case 2:for(;l<16;){if(0===s)break e;s--,c+=r[o++]<<l,l+=8}if(n.flags=c,8!=(255&n.flags)){e.msg="unknown compression method",n.mode=nu;break}if(57344&n.flags){e.msg="unknown header flags set",n.mode=nu;break}n.head&&(n.head.text=c>>8&1),512&n.flags&&(O[0]=255&c,O[1]=c>>>8&255,n.check=Ts(n.check,O,2,0)),c=0,l=0,n.mode=3;case 3:for(;l<32;){if(0===s)break e;s--,c+=r[o++]<<l,l+=8}n.head&&(n.head.time=c),512&n.flags&&(O[0]=255&c,O[1]=c>>>8&255,O[2]=c>>>16&255,O[3]=c>>>24&255,n.check=Ts(n.check,O,4,0)),c=0,l=0,n.mode=4;case 4:for(;l<16;){if(0===s)break e;s--,c+=r[o++]<<l,l+=8}n.head&&(n.head.xflags=255&c,n.head.os=c>>8),512&n.flags&&(O[0]=255&c,O[1]=c>>>8&255,n.check=Ts(n.check,O,2,0)),c=0,l=0,n.mode=5;case 5:if(1024&n.flags){for(;l<16;){if(0===s)break e;s--,c+=r[o++]<<l,l+=8}n.length=c,n.head&&(n.head.extra_len=c),512&n.flags&&(O[0]=255&c,O[1]=c>>>8&255,n.check=Ts(n.check,O,2,0)),c=0,l=0}else n.head&&(n.head.extra=null);n.mode=6;case 6:if(1024&n.flags&&((d=n.length)>s&&(d=s),d&&(n.head&&(E=n.head.extra_len-n.length,n.head.extra||(n.head.extra=new Array(n.head.extra_len)),Pa(n.head.extra,r,o,d,E)),512&n.flags&&(n.check=Ts(n.check,r,d,o)),s-=d,o+=d,n.length-=d),n.length))break e;n.length=0,n.mode=7;case 7:if(2048&n.flags){if(0===s)break e;d=0;do{E=r[o+d++],n.head&&E&&n.length<65536&&(n.head.name+=String.fromCharCode(E))}while(E&&d<s);if(512&n.flags&&(n.check=Ts(n.check,r,d,o)),s-=d,o+=d,E)break e}else n.head&&(n.head.name=null);n.length=0,n.mode=8;case 8:if(4096&n.flags){if(0===s)break e;d=0;do{E=r[o+d++],n.head&&E&&n.length<65536&&(n.head.comment+=String.fromCharCode(E))}while(E&&d<s);if(512&n.flags&&(n.check=Ts(n.check,r,d,o)),s-=d,o+=d,E)break e}else n.head&&(n.head.comment=null);n.mode=9;case 9:if(512&n.flags){for(;l<16;){if(0===s)break e;s--,c+=r[o++]<<l,l+=8}if(c!==(65535&n.check)){e.msg="header crc mismatch",n.mode=nu;break}c=0,l=0}n.head&&(n.head.hcrc=n.flags>>9&1,n.head.done=!0),e.adler=n.check=0,n.mode=tu;break;case 10:for(;l<32;){if(0===s)break e;s--,c+=r[o++]<<l,l+=8}e.adler=n.check=ru(c),c=0,l=0,n.mode=11;case 11:if(0===n.havedict)return e.next_out=a,e.avail_out=u,e.next_in=o,e.avail_in=s,n.hold=c,n.bits=l,2;e.adler=n.check=1,n.mode=tu;case tu:if(5===t||6===t)break e;case 13:if(n.last){c>>>=7&l,l-=7&l,n.mode=27;break}for(;l<3;){if(0===s)break e;s--,c+=r[o++]<<l,l+=8}switch(n.last=1&c,l-=1,3&(c>>>=1)){case 0:n.mode=14;break;case 1:if(lu(n),n.mode=20,6===t){c>>>=2,l-=2;break e}break;case 2:n.mode=17;break;case 3:e.msg="invalid block type",n.mode=nu}c>>>=2,l-=2;break;case 14:for(c>>>=7&l,l-=7&l;l<32;){if(0===s)break e;s--,c+=r[o++]<<l,l+=8}if((65535&c)!=(c>>>16^65535)){e.msg="invalid stored block lengths",n.mode=nu;break}if(n.length=65535&c,c=0,l=0,n.mode=15,6===t)break e;case 15:n.mode=16;case 16:if(d=n.length){if(d>s&&(d=s),d>u&&(d=u),0===d)break e;Pa(i,r,o,d,a),s-=d,o+=d,u-=d,a+=d,n.length-=d;break}n.mode=tu;break;case 17:for(;l<14;){if(0===s)break e;s--,c+=r[o++]<<l,l+=8}if(n.nlen=257+(31&c),c>>>=5,l-=5,n.ndist=1+(31&c),c>>>=5,l-=5,n.ncode=4+(15&c),c>>>=4,l-=4,n.nlen>286||n.ndist>30){e.msg="too many length or distance symbols",n.mode=nu;break}n.have=0,n.mode=18;case 18:for(;n.have<n.ncode;){for(;l<3;){if(0===s)break e;s--,c+=r[o++]<<l,l+=8}n.lens[C[n.have++]]=7&c,c>>>=3,l-=3}for(;n.have<19;)n.lens[C[n.have++]]=0;if(n.lencode=n.lendyn,n.lenbits=7,T={bits:n.lenbits},A=Xs(0,n.lens,0,19,n.lencode,0,n.work,T),n.lenbits=T.bits,A){e.msg="invalid code lengths set",n.mode=nu;break}n.have=0,n.mode=19;case 19:for(;n.have<n.nlen+n.ndist;){for(;_=(S=n.lencode[c&(1<<n.lenbits)-1])>>>16&255,m=65535&S,!((g=S>>>24)<=l);){if(0===s)break e;s--,c+=r[o++]<<l,l+=8}if(m<16)c>>>=g,l-=g,n.lens[n.have++]=m;else{if(16===m){for(k=g+2;l<k;){if(0===s)break e;s--,c+=r[o++]<<l,l+=8}if(c>>>=g,l-=g,0===n.have){e.msg="invalid bit length repeat",n.mode=nu;break}E=n.lens[n.have-1],d=3+(3&c),c>>>=2,l-=2}else if(17===m){for(k=g+3;l<k;){if(0===s)break e;s--,c+=r[o++]<<l,l+=8}l-=g,E=0,d=3+(7&(c>>>=g)),c>>>=3,l-=3}else{for(k=g+7;l<k;){if(0===s)break e;s--,c+=r[o++]<<l,l+=8}l-=g,E=0,d=11+(127&(c>>>=g)),c>>>=7,l-=7}if(n.have+d>n.nlen+n.ndist){e.msg="invalid bit length repeat",n.mode=nu;break}for(;d--;)n.lens[n.have++]=E}}if(n.mode===nu)break;if(0===n.lens[256]){e.msg="invalid code -- missing end-of-block",n.mode=nu;break}if(n.lenbits=9,T={bits:n.lenbits},A=Xs(1,n.lens,0,n.nlen,n.lencode,0,n.work,T),n.lenbits=T.bits,A){e.msg="invalid literal/lengths set",n.mode=nu;break}if(n.distbits=6,n.distcode=n.distdyn,T={bits:n.distbits},A=Xs(2,n.lens,n.nlen,n.ndist,n.distcode,0,n.work,T),n.distbits=T.bits,A){e.msg="invalid distances set",n.mode=nu;break}if(n.mode=20,6===t)break e;case 20:n.mode=21;case 21:if(s>=6&&u>=258){e.next_out=a,e.avail_out=u,e.next_in=o,e.avail_in=s,n.hold=c,n.bits=l,$s(e,h),a=e.next_out,i=e.output,u=e.avail_out,o=e.next_in,r=e.input,s=e.avail_in,c=n.hold,l=n.bits,n.mode===tu&&(n.back=-1);break}for(n.back=0;_=(S=n.lencode[c&(1<<n.lenbits)-1])>>>16&255,m=65535&S,!((g=S>>>24)<=l);){if(0===s)break e;s--,c+=r[o++]<<l,l+=8}if(_&&0==(240&_)){for(y=g,w=_,b=m;_=(S=n.lencode[b+((c&(1<<y+w)-1)>>y)])>>>16&255,m=65535&S,!(y+(g=S>>>24)<=l);){if(0===s)break e;s--,c+=r[o++]<<l,l+=8}c>>>=y,l-=y,n.back+=y}if(c>>>=g,l-=g,n.back+=g,n.length=m,0===_){n.mode=26;break}if(32&_){n.back=-1,n.mode=tu;break}if(64&_){e.msg="invalid literal/length code",n.mode=nu;break}n.extra=15&_,n.mode=22;case 22:if(n.extra){for(k=n.extra;l<k;){if(0===s)break e;s--,c+=r[o++]<<l,l+=8}n.length+=c&(1<<n.extra)-1,c>>>=n.extra,l-=n.extra,n.back+=n.extra}n.was=n.length,n.mode=23;case 23:for(;_=(S=n.distcode[c&(1<<n.distbits)-1])>>>16&255,m=65535&S,!((g=S>>>24)<=l);){if(0===s)break e;s--,c+=r[o++]<<l,l+=8}if(0==(240&_)){for(y=g,w=_,b=m;_=(S=n.distcode[b+((c&(1<<y+w)-1)>>y)])>>>16&255,m=65535&S,!(y+(g=S>>>24)<=l);){if(0===s)break e;s--,c+=r[o++]<<l,l+=8}c>>>=y,l-=y,n.back+=y}if(c>>>=g,l-=g,n.back+=g,64&_){e.msg="invalid distance code",n.mode=nu;break}n.offset=m,n.extra=15&_,n.mode=24;case 24:if(n.extra){for(k=n.extra;l<k;){if(0===s)break e;s--,c+=r[o++]<<l,l+=8}n.offset+=c&(1<<n.extra)-1,c>>>=n.extra,l-=n.extra,n.back+=n.extra}if(n.offset>n.dmax){e.msg="invalid distance too far back",n.mode=nu;break}n.mode=25;case 25:if(0===u)break e;if(d=h-u,n.offset>d){if((d=n.offset-d)>n.whave&&n.sane){e.msg="invalid distance too far back",n.mode=nu;break}d>n.wnext?(d-=n.wnext,p=n.wsize-d):p=n.wnext-d,d>n.length&&(d=n.length),v=n.window}else v=i,p=a-n.offset,d=n.length;d>u&&(d=u),u-=d,n.length-=d;do{i[a++]=v[p++]}while(--d);0===n.length&&(n.mode=21);break;case 26:if(0===u)break e;i[a++]=n.length,u--,n.mode=21;break;case 27:if(n.wrap){for(;l<32;){if(0===s)break e;s--,c|=r[o++]<<l,l+=8}if(h-=u,e.total_out+=h,n.total+=h,h&&(e.adler=n.check=n.flags?Ts(n.check,i,h,a-h):Es(n.check,i,h,a-h)),h=u,(n.flags?c:ru(c))!==n.check){e.msg="incorrect data check",n.mode=nu;break}c=0,l=0}n.mode=28;case 28:if(n.wrap&&n.flags){for(;l<32;){if(0===s)break e;s--,c+=r[o++]<<l,l+=8}if(c!==(4294967295&n.total)){e.msg="incorrect length check",n.mode=nu;break}c=0,l=0}n.mode=29;case 29:A=1;break e;case nu:A=-3;break e;case 31:return-4;case 32:default:return eu}return e.next_out=a,e.avail_out=u,e.next_in=o,e.avail_in=s,n.hold=c,n.bits=l,(n.wsize||h!==e.avail_out&&n.mode<nu&&(n.mode<27||4!==t))&&function(e,t,n,r){var i,o=e.state;null===o.window&&(o.wsize=1<<o.wbits,o.wnext=0,o.whave=0,o.window=new xa(o.wsize)),r>=o.wsize?(Pa(o.window,t,n-o.wsize,o.wsize,0),o.wnext=0,o.whave=o.wsize):((i=o.wsize-o.wnext)>r&&(i=r),Pa(o.window,t,n-r,i,o.wnext),(r-=i)?(Pa(o.window,t,n-r,r,0),o.wnext=r,o.whave=o.wsize):(o.wnext+=i,o.wnext===o.wsize&&(o.wnext=0),o.whave<o.wsize&&(o.whave+=i)))}(e,e.output,e.next_out,h-e.avail_out),f-=e.avail_in,h-=e.avail_out,e.total_in+=f,e.total_out+=h,n.total+=h,n.wrap&&h&&(e.adler=n.check=n.flags?Ts(n.check,i,h,e.next_out-h):Es(n.check,i,h,e.next_out-h)),e.data_type=n.bits+(n.last?64:0)+(n.mode===tu?128:0)+(20===n.mode||15===n.mode?256:0),(0===f&&0===h||4===t)&&0===A&&(A=-5),A}var hu;function du(e){if(e<1||e>7)throw new TypeError("Bad argument");this.mode=e,this.init_done=!1,this.write_in_progress=!1,this.pending_close=!1,this.windowBits=0,this.level=0,this.memLevel=0,this.strategy=0,this.dictionary=null}function pu(e,t){for(var n=0;n<e.length;n++)this[t+n]=e[n]}du.prototype.init=function(e,t,n,r,i){var o;switch(this.windowBits=e,this.level=t,this.memLevel=n,this.strategy=r,3!==this.mode&&4!==this.mode||(this.windowBits+=16),7===this.mode&&(this.windowBits+=32),5!==this.mode&&6!==this.mode||(this.windowBits=-this.windowBits),this.strm=new Ia,this.mode){case 1:case 3:case 5:o=function(e,t,n,r,i,o){if(!e)return Ss;var a=1;if(-1===t&&(t=6),r<0?(a=0,r=-r):r>15&&(a=2,r-=16),i<1||i>9||8!==n||r<8||r>15||t<0||t>9||o<0||o>4)return Ps(e,Ss);8===r&&(r=9);var s=new Zs;return e.state=s,s.strm=e,s.wrap=a,s.gzhead=null,s.w_bits=r,s.w_size=1<<s.w_bits,s.w_mask=s.w_size-1,s.hash_bits=i+7,s.hash_size=1<<s.hash_bits,s.hash_mask=s.hash_size-1,s.hash_shift=~~((s.hash_bits+3-1)/3),s.window=new xa(2*s.w_size),s.head=new La(s.hash_size),s.prev=new La(s.w_size),s.lit_bufsize=1<<i+6,s.pending_buf_size=4*s.lit_bufsize,s.pending_buf=new xa(s.pending_buf_size),s.d_buf=1*s.lit_bufsize,s.l_buf=3*s.lit_bufsize,s.level=t,s.strategy=o,s.method=n,qs(e)}(this.strm,this.level,8,this.windowBits,this.memLevel,this.strategy);break;case 2:case 4:case 6:case 7:o=au(this.strm,this.windowBits);break;default:throw new Error("Unknown mode "+this.mode)}0===o?(this.write_in_progress=!1,this.init_done=!0):this._error(o)},du.prototype.params=function(){throw new Error("deflateParams Not supported")},du.prototype._writeCheck=function(){if(!this.init_done)throw new Error("write before init");if(0===this.mode)throw new Error("already finalized");if(this.write_in_progress)throw new Error("write already in progress");if(this.pending_close)throw new Error("close is pending")},du.prototype.write=function(e,t,n,r,i,o,a){this._writeCheck(),this.write_in_progress=!0;var s=this;return N.nextTick((function(){s.write_in_progress=!1;var u=s._write(e,t,n,r,i,o,a);s.callback(u[0],u[1]),s.pending_close&&s.close()})),this},du.prototype.writeSync=function(e,t,n,r,i,o,a){return this._writeCheck(),this._write(e,t,n,r,i,o,a)},du.prototype._write=function(e,t,n,r,i,o,a){if(this.write_in_progress=!0,0!==e&&1!==e&&2!==e&&3!==e&&4!==e&&5!==e)throw new Error("Invalid flush value");null==t&&(t=new oe(0),r=0,n=0),i._set?i.set=i._set:i.set=pu;var s,u=this.strm;switch(u.avail_in=r,u.input=t,u.next_in=n,u.avail_out=a,u.output=i,u.next_out=o,this.mode){case 1:case 3:case 5:s=Gs(u,e);break;case 7:case 2:case 4:case 6:s=fu(u,e);break;default:throw new Error("Unknown mode "+this.mode)}return 1!==s&&0!==s&&this._error(s),this.write_in_progress=!1,[u.avail_in,u.avail_out]},du.prototype.close=function(){this.write_in_progress?this.pending_close=!0:(this.pending_close=!1,1===this.mode||3===this.mode||5===this.mode?function(e){var t;e&&e.state&&(42!==(t=e.state.status)&&69!==t&&73!==t&&91!==t&&t!==Rs&&t!==Ns&&t!==Is?Ps(e,Ss):(e.state=null,t===Ns&&Ps(e,-3)))}(this.strm):function(e){if(!e||!e.state)return eu;var t=e.state;t.window&&(t.window=null),e.state=null}(this.strm),this.mode=0)},du.prototype.reset=function(){switch(this.mode){case 1:case 5:hu=qs(this.strm);break;case 2:case 6:hu=ou(this.strm)}0!==hu&&this._error(hu)},du.prototype._error=function(e){this.onerror(Na[e]+": "+this.strm.msg,e),this.write_in_progress=!1,this.pending_close&&this.close()};var vu=Object.freeze({__proto__:null,NONE:0,DEFLATE:1,INFLATE:2,GZIP:3,GUNZIP:4,DEFLATERAW:5,INFLATERAW:6,UNZIP:7,Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8,Zlib:du});var gu={};Object.keys(vu).forEach((function(e){gu[e]=vu[e]})),gu.Z_MIN_WINDOWBITS=8,gu.Z_MAX_WINDOWBITS=15,gu.Z_DEFAULT_WINDOWBITS=15,gu.Z_MIN_CHUNK=64,gu.Z_MAX_CHUNK=1/0,gu.Z_DEFAULT_CHUNK=16384,gu.Z_MIN_MEMLEVEL=1,gu.Z_MAX_MEMLEVEL=9,gu.Z_DEFAULT_MEMLEVEL=8,gu.Z_MIN_LEVEL=-1,gu.Z_MAX_LEVEL=9,gu.Z_DEFAULT_LEVEL=gu.Z_DEFAULT_COMPRESSION;var _u={Z_OK:gu.Z_OK,Z_STREAM_END:gu.Z_STREAM_END,Z_NEED_DICT:gu.Z_NEED_DICT,Z_ERRNO:gu.Z_ERRNO,Z_STREAM_ERROR:gu.Z_STREAM_ERROR,Z_DATA_ERROR:gu.Z_DATA_ERROR,Z_MEM_ERROR:gu.Z_MEM_ERROR,Z_BUF_ERROR:gu.Z_BUF_ERROR,Z_VERSION_ERROR:gu.Z_VERSION_ERROR};function mu(e){return new Fu(e)}function yu(e){return new Wu(e)}function wu(e){return new qu(e)}function bu(e){return new Gu(e)}function Eu(e){return new Hu(e)}function Au(e){return new Zu(e)}function Tu(e){return new $u(e)}function ku(e,t,n){return"function"==typeof t&&(n=t,t={}),Mu(new Fu(t),e,n)}function Su(e,t){return zu(new Fu(t),e)}function Ou(e,t,n){return"function"==typeof t&&(n=t,t={}),Mu(new Hu(t),e,n)}function Cu(e,t){return zu(new Hu(t),e)}function Ru(e,t,n){return"function"==typeof t&&(n=t,t={}),Mu(new qu(t),e,n)}function Nu(e,t){return zu(new qu(t),e)}function Iu(e,t,n){return"function"==typeof t&&(n=t,t={}),Mu(new $u(t),e,n)}function Pu(e,t){return zu(new $u(t),e)}function xu(e,t,n){return"function"==typeof t&&(n=t,t={}),Mu(new Wu(t),e,n)}function Lu(e,t){return zu(new Wu(t),e)}function Bu(e,t,n){return"function"==typeof t&&(n=t,t={}),Mu(new Zu(t),e,n)}function ju(e,t){return zu(new Zu(t),e)}function Uu(e,t,n){return"function"==typeof t&&(n=t,t={}),Mu(new Gu(t),e,n)}function Du(e,t){return zu(new Gu(t),e)}function Mu(e,t,n){var r=[],i=0;function o(){for(var t;null!==(t=e.read());)r.push(t),i+=t.length;e.once("readable",o)}function a(){var t=oe.concat(r,i);r=[],n(null,t),e.close()}e.on("error",(function(t){e.removeListener("end",a),e.removeListener("readable",o),n(t)})),e.on("end",a),e.end(t),o()}function zu(e,t){if("string"==typeof t&&(t=new oe(t)),!oe.isBuffer(t))throw new TypeError("Not a string or buffer");var n=gu.Z_FINISH;return e._processChunk(t,n)}function Fu(e){if(!(this instanceof Fu))return new Fu(e);Ku.call(this,e,gu.DEFLATE)}function Wu(e){if(!(this instanceof Wu))return new Wu(e);Ku.call(this,e,gu.INFLATE)}function Hu(e){if(!(this instanceof Hu))return new Hu(e);Ku.call(this,e,gu.GZIP)}function Zu(e){if(!(this instanceof Zu))return new Zu(e);Ku.call(this,e,gu.GUNZIP)}function qu(e){if(!(this instanceof qu))return new qu(e);Ku.call(this,e,gu.DEFLATERAW)}function Gu(e){if(!(this instanceof Gu))return new Gu(e);Ku.call(this,e,gu.INFLATERAW)}function $u(e){if(!(this instanceof $u))return new $u(e);Ku.call(this,e,gu.UNZIP)}function Ku(e,t){if(this._opts=e=e||{},this._chunkSize=e.chunkSize||gu.Z_DEFAULT_CHUNK,Ri.call(this,e),e.flush&&e.flush!==gu.Z_NO_FLUSH&&e.flush!==gu.Z_PARTIAL_FLUSH&&e.flush!==gu.Z_SYNC_FLUSH&&e.flush!==gu.Z_FULL_FLUSH&&e.flush!==gu.Z_FINISH&&e.flush!==gu.Z_BLOCK)throw new Error("Invalid flush flag: "+e.flush);if(this._flushFlag=e.flush||gu.Z_NO_FLUSH,e.chunkSize&&(e.chunkSize<gu.Z_MIN_CHUNK||e.chunkSize>gu.Z_MAX_CHUNK))throw new Error("Invalid chunk size: "+e.chunkSize);if(e.windowBits&&(e.windowBits<gu.Z_MIN_WINDOWBITS||e.windowBits>gu.Z_MAX_WINDOWBITS))throw new Error("Invalid windowBits: "+e.windowBits);if(e.level&&(e.level<gu.Z_MIN_LEVEL||e.level>gu.Z_MAX_LEVEL))throw new Error("Invalid compression level: "+e.level);if(e.memLevel&&(e.memLevel<gu.Z_MIN_MEMLEVEL||e.memLevel>gu.Z_MAX_MEMLEVEL))throw new Error("Invalid memLevel: "+e.memLevel);if(e.strategy&&e.strategy!=gu.Z_FILTERED&&e.strategy!=gu.Z_HUFFMAN_ONLY&&e.strategy!=gu.Z_RLE&&e.strategy!=gu.Z_FIXED&&e.strategy!=gu.Z_DEFAULT_STRATEGY)throw new Error("Invalid strategy: "+e.strategy);if(e.dictionary&&!oe.isBuffer(e.dictionary))throw new Error("Invalid dictionary: it should be a Buffer instance");this._binding=new gu.Zlib(t);var n=this;this._hadError=!1,this._binding.onerror=function(e,t){n._binding=null,n._hadError=!0;var r=new Error(e);r.errno=t,r.code=gu.codes[t],n.emit("error",r)};var r=gu.Z_DEFAULT_COMPRESSION;"number"==typeof e.level&&(r=e.level);var i=gu.Z_DEFAULT_STRATEGY;"number"==typeof e.strategy&&(i=e.strategy),this._binding.init(e.windowBits||gu.Z_DEFAULT_WINDOWBITS,r,e.memLevel||gu.Z_DEFAULT_MEMLEVEL,i,e.dictionary),this._buffer=new oe(this._chunkSize),this._offset=0,this._closed=!1,this._level=r,this._strategy=i,this.once("end",this.close)}Object.keys(_u).forEach((function(e){_u[_u[e]]=e})),Ze(Ku,Ri),Ku.prototype.params=function(e,t,n){if(e<gu.Z_MIN_LEVEL||e>gu.Z_MAX_LEVEL)throw new RangeError("Invalid compression level: "+e);if(t!=gu.Z_FILTERED&&t!=gu.Z_HUFFMAN_ONLY&&t!=gu.Z_RLE&&t!=gu.Z_FIXED&&t!=gu.Z_DEFAULT_STRATEGY)throw new TypeError("Invalid strategy: "+t);if(this._level!==e||this._strategy!==t){var r=this;this.flush(gu.Z_SYNC_FLUSH,(function(){r._binding.params(e,t),r._hadError||(r._level=e,r._strategy=t,n&&n())}))}else N.nextTick(n)},Ku.prototype.reset=function(){return this._binding.reset()},Ku.prototype._flush=function(e){this._transform(new oe(0),"",e)},Ku.prototype.flush=function(e,t){var n=this._writableState;if(("function"==typeof e||void 0===e&&!t)&&(t=e,e=gu.Z_FULL_FLUSH),n.ended)t&&N.nextTick(t);else if(n.ending)t&&this.once("end",t);else if(n.needDrain){var r=this;this.once("drain",(function(){r.flush(t)}))}else this._flushFlag=e,this.write(new oe(0),"",t)},Ku.prototype.close=function(e){if(e&&N.nextTick(e),!this._closed){this._closed=!0,this._binding.close();var t=this;N.nextTick((function(){t.emit("close")}))}},Ku.prototype._transform=function(e,t,n){var r,i=this._writableState,o=(i.ending||i.ended)&&(!e||i.length===e.length);if(null===!e&&!oe.isBuffer(e))return n(new Error("invalid input"));o?r=gu.Z_FINISH:(r=this._flushFlag,e.length>=i.length&&(this._flushFlag=this._opts.flush||gu.Z_NO_FLUSH)),this._processChunk(e,r,n)},Ku.prototype._processChunk=function(e,t,n){var r=e&&e.length,i=this._chunkSize-this._offset,o=0,a=this,s="function"==typeof n;if(!s){var u,c=[],l=0;this.on("error",(function(e){u=e}));do{var f=this._binding.writeSync(t,e,o,r,this._buffer,this._offset,i)}while(!this._hadError&&p(f[0],f[1]));if(this._hadError)throw u;var h=oe.concat(c,l);return this.close(),h}var d=this._binding.write(t,e,o,r,this._buffer,this._offset,i);function p(u,f){if(!a._hadError){var h=i-f;if(function(e,t){if(!e)throw new Error(t)}(h>=0,"have should not go down"),h>0){var d=a._buffer.slice(a._offset,a._offset+h);a._offset+=h,s?a.push(d):(c.push(d),l+=d.length)}if((0===f||a._offset>=a._chunkSize)&&(i=a._chunkSize,a._offset=0,a._buffer=new oe(a._chunkSize)),0===f){if(o+=r-u,r=u,!s)return!0;var v=a._binding.write(t,e,o,r,a._buffer,a._offset,a._chunkSize);return v.callback=p,void(v.buffer=e)}if(!s)return!1;n()}}d.buffer=e,d.callback=p},Ze(Fu,Ku),Ze(Wu,Ku),Ze(Hu,Ku),Ze(Zu,Ku),Ze(qu,Ku),Ze(Gu,Ku),Ze($u,Ku);var Yu={codes:_u,createDeflate:mu,createInflate:yu,createDeflateRaw:wu,createInflateRaw:bu,createGzip:Eu,createGunzip:Au,createUnzip:Tu,deflate:ku,deflateSync:Su,gzip:Ou,gzipSync:Cu,deflateRaw:Ru,deflateRawSync:Nu,unzip:Iu,unzipSync:Pu,inflate:xu,inflateSync:Lu,gunzip:Bu,gunzipSync:ju,inflateRaw:Uu,inflateRawSync:Du,Deflate:Fu,Inflate:Wu,Gzip:Hu,Gunzip:Zu,DeflateRaw:qu,InflateRaw:Gu,Unzip:$u,Zlib:Ku},Vu=Object.freeze({__proto__:null,codes:_u,createDeflate:mu,createInflate:yu,createDeflateRaw:wu,createInflateRaw:bu,createGzip:Eu,createGunzip:Au,createUnzip:Tu,deflate:ku,deflateSync:Su,gzip:Ou,gzipSync:Cu,deflateRaw:Ru,deflateRawSync:Nu,unzip:Iu,unzipSync:Pu,inflate:xu,inflateSync:Lu,gunzip:Bu,gunzipSync:ju,inflateRaw:Uu,inflateRawSync:Du,Deflate:Fu,Inflate:Wu,Gzip:Hu,Gunzip:Zu,DeflateRaw:qu,InflateRaw:Gu,Unzip:$u,Zlib:Ku,default:Yu}),Ju=[["axios@0.21.1","/Users/nguyentuankiet/Work/Zalo/Projects/ZaloMiniProgram/TestNewFunction"]],Qu="axios@0.21.1",Xu="axios@0.21.1",ec="sha512-dKQiRHxGD9PPRIUNIWvZhPTPpl1rf/OxTYKsqKUDjBwYylTvV7SjSHJb9ratfyzM6wCdLCOYLzs73qpg5c4iGA==",tc="/zmp-sdk/axios",nc={},rc={type:"version",registry:!0,raw:"axios@0.21.1",name:"axios",escapedName:"axios",rawSpec:"0.21.1",saveSpec:null,fetchSpec:"0.21.1"},ic=["/zmp-sdk"],oc="https://registry.npmjs.org/axios/-/axios-0.21.1.tgz",ac="0.21.1",sc="/Users/nguyentuankiet/Work/Zalo/Projects/ZaloMiniProgram/TestNewFunction",uc={name:"Matt Zabriskie"},cc={"./lib/adapters/http.js":"./lib/adapters/xhr.js"},lc={url:"https://github.com/axios/axios/issues"},fc=[{path:"./dist/axios.min.js",threshold:"5kB"}],hc={"follow-redirects":"^1.10.0"},dc="Promise based HTTP client for the browser and node.js",pc={bundlesize:"^0.17.0",coveralls:"^3.0.0","es6-promise":"^4.2.4",grunt:"^1.0.2","grunt-banner":"^0.6.0","grunt-cli":"^1.2.0","grunt-contrib-clean":"^1.1.0","grunt-contrib-watch":"^1.0.0","grunt-eslint":"^20.1.0","grunt-karma":"^2.0.0","grunt-mocha-test":"^0.13.3","grunt-ts":"^6.0.0-beta.19","grunt-webpack":"^1.0.18","istanbul-instrumenter-loader":"^1.0.0","jasmine-core":"^2.4.1",karma:"^1.3.0","karma-chrome-launcher":"^2.2.0","karma-coverage":"^1.1.1","karma-firefox-launcher":"^1.1.0","karma-jasmine":"^1.1.1","karma-jasmine-ajax":"^0.1.13","karma-opera-launcher":"^1.0.0","karma-safari-launcher":"^1.0.0","karma-sauce-launcher":"^1.2.0","karma-sinon":"^1.0.5","karma-sourcemap-loader":"^0.3.7","karma-webpack":"^1.7.0","load-grunt-tasks":"^3.5.2",minimist:"^1.2.0",mocha:"^5.2.0",sinon:"^4.5.0",typescript:"^2.8.1","url-search-params":"^0.10.0",webpack:"^1.13.1","webpack-dev-server":"^1.14.1"},vc="https://github.com/axios/axios",gc="dist/axios.min.js",_c=["xhr","http","ajax","promise","node"],mc="index.js",yc="axios",wc={type:"git",url:"git+https://github.com/axios/axios.git"},bc={build:"NODE_ENV=production grunt build",coveralls:"cat coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js",examples:"node ./examples/server.js",fix:"eslint --fix lib/**/*.js",postversion:"git push && git push --tags",preversion:"npm test",start:"node ./sandbox/server.js",test:"grunt test && bundlesize",version:"npm run build && grunt version && git add -A dist && git add CHANGELOG.md bower.json package.json"},Ec="./index.d.ts",Ac="dist/axios.min.js",Tc="0.21.1",kc={_args:Ju,_from:Qu,_id:Xu,_inBundle:false,_integrity:ec,_location:tc,_phantomChildren:nc,_requested:rc,_requiredBy:ic,_resolved:oc,_spec:ac,_where:sc,author:uc,browser:cc,bugs:lc,bundlesize:fc,dependencies:hc,description:dc,devDependencies:pc,homepage:vc,jsdelivr:gc,keywords:_c,license:"MIT",main:mc,name:yc,repository:wc,scripts:bc,typings:Ec,unpkg:Ac,version:Tc},Sc=Object.freeze({__proto__:null,_args:Ju,_from:Qu,_id:Xu,_inBundle:false,_integrity:ec,_location:tc,_phantomChildren:nc,_requested:rc,_requiredBy:ic,_resolved:oc,_spec:ac,_where:sc,author:uc,browser:cc,bugs:lc,bundlesize:fc,dependencies:hc,description:dc,devDependencies:pc,homepage:vc,jsdelivr:gc,keywords:_c,license:"MIT",main:mc,name:yc,repository:wc,scripts:bc,typings:Ec,unpkg:Ac,version:Tc,default:kc}),Oc=r(Vu),Cc=r(Sc),Rc=Ca.http,Nc=Ca.https,Ic=/https:?/;function Pc(e,t,n){if(e.hostname=t.host,e.host=t.host,e.port=t.port,e.path=n,t.auth){var r=oe.from(t.auth.username+":"+t.auth.password,"utf8").toString("base64");e.headers["Proxy-Authorization"]="Basic "+r}e.beforeRedirect=function(e){e.headers.host=e.host,Pc(e,t,e.href)}}var xc=function(e){return new Promise((function(t,n){var r=function(e){t(e)},i=function(e){n(e)},o=e.data,a=e.headers;if(a["User-Agent"]||a["user-agent"]||(a["User-Agent"]="axios/"+Cc.version),o&&!rr.isStream(o)){if(oe.isBuffer(o));else if(rr.isArrayBuffer(o))o=oe.from(new Uint8Array(o));else{if(!rr.isString(o))return i(pr("Data after transformation must be a string, an ArrayBuffer, a Buffer, or a Stream",e));o=oe.from(o,"utf-8")}a["Content-Length"]=o.length}var s=void 0;e.auth&&(s=(e.auth.username||"")+":"+(e.auth.password||""));var u=_r(e.baseURL,e.url),c=la.parse(u),l=c.protocol||"http:";if(!s&&c.auth){var f=c.auth.split(":");s=(f[0]||"")+":"+(f[1]||"")}s&&delete a.Authorization;var h=Ic.test(l),d=h?e.httpsAgent:e.httpAgent,p={path:or(c.path,e.params,e.paramsSerializer).replace(/^\?/,""),method:e.method.toUpperCase(),headers:a,agent:d,agents:{http:e.httpAgent,https:e.httpsAgent},auth:s};e.socketPath?p.socketPath=e.socketPath:(p.hostname=c.hostname,p.port=c.port);var v,g=e.proxy;if(!g&&!1!==g){var _=l.slice(0,-1)+"_proxy",m=N.env[_]||N.env[_.toUpperCase()];if(m){var y=la.parse(m),w=N.env.no_proxy||N.env.NO_PROXY,b=!0;if(w)b=!w.split(",").map((function(e){return e.trim()})).some((function(e){return!!e&&("*"===e||("."===e[0]&&c.hostname.substr(c.hostname.length-e.length)===e||c.hostname===e))}));if(b&&(g={host:y.hostname,port:y.port,protocol:y.protocol},y.auth)){var E=y.auth.split(":");g.auth={username:E[0],password:E[1]}}}}g&&(p.headers.host=c.hostname+(c.port?":"+c.port:""),Pc(p,g,l+"//"+c.hostname+(c.port?":"+c.port:"")+p.path));var A=h&&(!g||Ic.test(g.protocol));e.transport?v=e.transport:0===e.maxRedirects?v=fa:(e.maxRedirects&&(p.maxRedirects=e.maxRedirects),v=A?Nc:Rc),e.maxBodyLength>-1&&(p.maxBodyLength=e.maxBodyLength);var T=v.request(p,(function(t){if(!T.aborted){var n=t,o=t.req||T;if(204!==t.statusCode&&"HEAD"!==o.method&&!1!==e.decompress)switch(t.headers["content-encoding"]){case"gzip":case"compress":case"deflate":n=n.pipe(Oc.createUnzip()),delete t.headers["content-encoding"]}var a={status:t.statusCode,statusText:t.statusMessage,headers:t.headers,config:e,request:o};if("stream"===e.responseType)a.data=n,vr(r,i,a);else{var s=[];n.on("data",(function(t){s.push(t),e.maxContentLength>-1&&oe.concat(s).length>e.maxContentLength&&(n.destroy(),i(pr("maxContentLength size of "+e.maxContentLength+" exceeded",e,null,o)))})),n.on("error",(function(t){T.aborted||i(dr(t,e,null,o))})),n.on("end",(function(){var t=oe.concat(s);"arraybuffer"!==e.responseType&&(t=t.toString(e.responseEncoding),e.responseEncoding&&"utf8"!==e.responseEncoding||(t=rr.stripBOM(t))),a.data=t,vr(r,i,a)}))}}}));T.on("error",(function(t){T.aborted&&"ERR_FR_TOO_MANY_REDIRECTS"!==t.code||i(dr(t,e,null,T))})),e.timeout&&T.setTimeout(e.timeout,(function(){T.abort(),i(pr("timeout of "+e.timeout+"ms exceeded",e,"ECONNABORTED",T))})),e.cancelToken&&e.cancelToken.promise.then((function(e){T.aborted||(T.abort(),i(e))})),rr.isStream(o)?o.on("error",(function(t){i(dr(t,e,null,T))})).pipe(T):T.end(o)}))},Lc={"Content-Type":"application/x-www-form-urlencoded"};function Bc(e,t){!rr.isUndefined(e)&&rr.isUndefined(e["Content-Type"])&&(e["Content-Type"]=t)}var jc,Uc={adapter:("undefined"!=typeof XMLHttpRequest?jc=wr:void 0!==N&&"[object process]"===Object.prototype.toString.call(N)&&(jc=xc),jc),transformRequest:[function(e,t){return hr(t,"Accept"),hr(t,"Content-Type"),rr.isFormData(e)||rr.isArrayBuffer(e)||rr.isBuffer(e)||rr.isStream(e)||rr.isFile(e)||rr.isBlob(e)?e:rr.isArrayBufferView(e)?e.buffer:rr.isURLSearchParams(e)?(Bc(t,"application/x-www-form-urlencoded;charset=utf-8"),e.toString()):rr.isObject(e)?(Bc(t,"application/json;charset=utf-8"),JSON.stringify(e)):e}],transformResponse:[function(e){if("string"==typeof e)try{e=JSON.parse(e)}catch(e){}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,validateStatus:function(e){return e>=200&&e<300}};Uc.headers={common:{Accept:"application/json, text/plain, */*"}},rr.forEach(["delete","get","head"],(function(e){Uc.headers[e]={}})),rr.forEach(["post","put","patch"],(function(e){Uc.headers[e]=rr.merge(Lc)}));var Dc=Uc;function Mc(e){e.cancelToken&&e.cancelToken.throwIfRequested()}var zc=function(e){return Mc(e),e.headers=e.headers||{},e.data=lr(e.data,e.headers,e.transformRequest),e.headers=rr.merge(e.headers.common||{},e.headers[e.method]||{},e.headers),rr.forEach(["delete","get","head","post","put","patch","common"],(function(t){delete e.headers[t]})),(e.adapter||Dc.adapter)(e).then((function(t){return Mc(e),t.data=lr(t.data,t.headers,e.transformResponse),t}),(function(t){return fr(t)||(Mc(e),t&&t.response&&(t.response.data=lr(t.response.data,t.response.headers,e.transformResponse))),Promise.reject(t)}))},Fc=function(e,t){t=t||{};var n={},r=["url","method","data"],i=["headers","auth","proxy","params"],o=["baseURL","transformRequest","transformResponse","paramsSerializer","timeout","timeoutMessage","withCredentials","adapter","responseType","xsrfCookieName","xsrfHeaderName","onUploadProgress","onDownloadProgress","decompress","maxContentLength","maxBodyLength","maxRedirects","transport","httpAgent","httpsAgent","cancelToken","socketPath","responseEncoding"],a=["validateStatus"];function s(e,t){return rr.isPlainObject(e)&&rr.isPlainObject(t)?rr.merge(e,t):rr.isPlainObject(t)?rr.merge({},t):rr.isArray(t)?t.slice():t}function u(r){rr.isUndefined(t[r])?rr.isUndefined(e[r])||(n[r]=s(void 0,e[r])):n[r]=s(e[r],t[r])}rr.forEach(r,(function(e){rr.isUndefined(t[e])||(n[e]=s(void 0,t[e]))})),rr.forEach(i,u),rr.forEach(o,(function(r){rr.isUndefined(t[r])?rr.isUndefined(e[r])||(n[r]=s(void 0,e[r])):n[r]=s(void 0,t[r])})),rr.forEach(a,(function(r){r in t?n[r]=s(e[r],t[r]):r in e&&(n[r]=s(void 0,e[r]))}));var c=r.concat(i).concat(o).concat(a),l=Object.keys(e).concat(Object.keys(t)).filter((function(e){return-1===c.indexOf(e)}));return rr.forEach(l,u),n};function Wc(e){this.defaults=e,this.interceptors={request:new cr,response:new cr}}Wc.prototype.request=function(e){"string"==typeof e?(e=arguments[1]||{}).url=arguments[0]:e=e||{},(e=Fc(this.defaults,e)).method?e.method=e.method.toLowerCase():this.defaults.method?e.method=this.defaults.method.toLowerCase():e.method="get";var t=[zc,void 0],n=Promise.resolve(e);for(this.interceptors.request.forEach((function(e){t.unshift(e.fulfilled,e.rejected)})),this.interceptors.response.forEach((function(e){t.push(e.fulfilled,e.rejected)}));t.length;)n=n.then(t.shift(),t.shift());return n},Wc.prototype.getUri=function(e){return e=Fc(this.defaults,e),or(e.url,e.params,e.paramsSerializer).replace(/^\?/,"")},rr.forEach(["delete","get","head","options"],(function(e){Wc.prototype[e]=function(t,n){return this.request(Fc(n||{},{method:e,url:t,data:(n||{}).data}))}})),rr.forEach(["post","put","patch"],(function(e){Wc.prototype[e]=function(t,n,r){return this.request(Fc(r||{},{method:e,url:t,data:n}))}}));var Hc=Wc;function Zc(e){this.message=e}Zc.prototype.toString=function(){return"Cancel"+(this.message?": "+this.message:"")},Zc.prototype.__CANCEL__=!0;var qc=Zc;function Gc(e){if("function"!=typeof e)throw new TypeError("executor must be a function.");var t;this.promise=new Promise((function(e){t=e}));var n=this;e((function(e){n.reason||(n.reason=new qc(e),t(n.reason))}))}Gc.prototype.throwIfRequested=function(){if(this.reason)throw this.reason},Gc.source=function(){var e;return{token:new Gc((function(t){e=t})),cancel:e}};var $c=Gc;function Kc(e){var t=new Hc(e),n=Yn(Hc.prototype.request,t);return rr.extend(n,Hc.prototype,t),rr.extend(n,t),n}var Yc=Kc(Dc);Yc.Axios=Hc,Yc.create=function(e){return Kc(Fc(Yc.defaults,e))},Yc.Cancel=qc,Yc.CancelToken=$c,Yc.isCancel=fr,Yc.all=function(e){return Promise.all(e)},Yc.spread=function(e){return function(t){return e.apply(null,t)}},Yc.isAxiosError=function(e){return"object"==typeof e&&!0===e.isAxiosError};var Vc=Yc,Jc=Yc;Vc.default=Jc;var Qc=Vc,Xc=(()=>{const e=Nn();return{MINI_APP_LINK:"https://zalo.me/app/link/zapps",MINI_APP_INTERNAL_LINK:"https://h5.zdn.vn/zapps",COOKIE_NAME:{ZOAUTH:"h5.zdn.vn_zoauth",ZACC_SESSiON:"h5.zdn.vn_zacc_session",JS_TOKEN:"h5.zdn.vn_zlink3rd",ZOAUTH_VRF:"h5.zdn.vn_zoauth_vrf"},APIS:{GET_USER_INFO:"https://graph.zalo.me/v2.0/me",GET_ACCESS_TOKEN:"https://h5.zalo.me/openapi/access_token",GET_ACCESS_TOKEN_V3:"https://oauth.zaloapp.com/v3/access_token"},STORAGE_DATA_LIMIT:102400,STORAGE_LIMIT:5242880,NETWORK_TYPE:{NONE:e.isAndroid?-2:0,WIFI:e.isAndroid?0:1,"2G":(e.isAndroid,2),"3G":e.isAndroid?15:2,"4G":e.isAndroid?13:2}}})();const el={encode:function(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("&")},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:el.encode(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?"undefined":typeof 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?"undefined":typeof r)?JSON.stringify(r):encodeURIComponent(r)].join("=");n.push(i)})),n.join("&")}};var tl={},nl=function(e,t,n){var r=t||"default";return function(){var t=r in tl?tl[r](e,n):e;return t.apply(this,arguments)}};nl.setWrapper=function(e){var t=arguments.length<=1||void 0===arguments[1]?"default":arguments[1];tl[t]=e};var rl={error:{code:1,error_subcode:1357046,message:"Received Invalid JSON reply.",type:"http"}};function il(e){try{return null===e?rl:JSON.parse(e)}catch(e){return rl}}var ol={execute:function(e,t,n,r){n.suppress_http_code=1;var i=el.encode(n);"post"!=t&&(e=el.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=nl((function(){o=r,"onload"in i&&i.onload(n)}),"entry","XMLHttpRequest:load"),a=nl((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(il(e.responseText))},o.onerror=function(e){e.responseText?r(il(e.responseText)):r({error:{code:1,error_subcode:1357045,message:"unknown error (empty response)",status:e.status,type:"http"}})},o.send(i),!0)}};class al extends $n{constructor(){super(),this.debug=cn("zmp:ZaloJSBridge"),this.events=Kn.getInstance(),this._accessTk=jn("zacc_session")||"DEFAULT_ACCESS_TOKEN",this._jsAccessTk=jn("zlink3rd")||"DEFAULT_JS_TOKEN",this.results=[],this._userAgent=Rn(),this._device=Nn(),this._jsCallFuncCallbacks={},this.events.on(e.Events.AppPaused,(()=>{if(this.results.length>0){let e=this.results;this.results=[];try{this.sendLogData(e)}catch(e){}}})),this.sendLogTimer?clearInterval(this.sendLogTimer):this.sendLogTimer=setInterval((()=>{if(this.results.length>0){let e=this.results;this.results=[];try{this.sendLogData(e)}catch(e){}}}),5e3)}static getInstance(){return al.instance||(al.instance=new al),al.instance}set accessTk(e){this._accessTk=e}set jsAccessTk(e){this._jsAccessTk=e}sendLogData(e){try{ol.execute("https://h5.zalo.me/log/async","post",{appId:window.APP_ID,data:JSON.stringify(e)},(e=>{}))}catch(e){}}onJSCall(e,t){try{const n=Un(t);if(this._jsCallFuncCallbacks[e]){const t=this._jsCallFuncCallbacks[e].callback,r=this._jsCallFuncCallbacks[e].timeout;if(t){try{t.call(this,n)}catch(e){console.error("Call callback error",e)}r&&clearTimeout(r),this._jsCallFuncCallbacks[e]=null,delete this._jsCallFuncCallbacks[e]}}this.results.push({action:n.action,error:n.error_code})}catch(e){console.log("onJSCall","error",e)}}onMultiJSCall(e,t){try{const n=Un(t);if(this._jsCallFuncCallbacks[e]){const t=this._jsCallFuncCallbacks[e].callback,r=this._jsCallFuncCallbacks[e].timeout;if(t){try{t.call(this,n)}catch(e){console.error("Call callback error",e)}r&&clearTimeout(r)}}this.results.push({action:n.action,error:n.error_code})}catch(e){console.log("onMultiJSCall","error",e)}}nativeEventHandler(e,t,n){this.debug(`eventId: ${e}, eventName: ${t}, eventData: ${n}`);const r=Fn(n);this.debug(r),this.events.emit(t,e,r)}defaultCallback(e){null!=e&&(e=Un(e))}jsCall(e,t,n,r=!1,o=3,a=!0){try{const s=((e="")=>`${e.normalize("NFD").replace(Tn,"").replace(kn,"d").replace(Sn,"").toLowerCase()}_${Math.random().toString(36).substr(2,4)}`)(e);if(!this._device.isMobile||i.isEmpty(e))return this.onJSCall(s,{error_code:-13,error_message:"params invalid!",data:{device:this._device.isMobile,jsToken:this._jsAccessTk,access_token:this._accessTk},action:e}),!1;null==t&&(t={}),n||(n=this.defaultCallback);const u={error_code:-14,error_message:"Request Timeout!",data:{},action:e};this._jsCallFuncCallbacks[s]={timeout:a&&pn.includes(e)&&setTimeout((()=>{this.onJSCall(s,u)}),8e3),callback:n};try{return t=Dn(t),r?this._device.isIOS?ZaloJavaScriptInterface.jsCall(this._jsAccessTk,e,this._accessTk,t,window.onMultiJSCall(s)):ZaloJavaScriptInterface.jsCall(this._jsAccessTk,e,this._accessTk,t,`window.onMultiJSCall('${s}')`):this._device.isIOS?ZaloJavaScriptInterface.jsCall(this._jsAccessTk,e,this._accessTk,t,window.onJSCall(s)):ZaloJavaScriptInterface.jsCall(this._jsAccessTk,e,this._accessTk,t,`window.onJSCall('${s}')`)}catch(i){if(!(o-- >0)){const n={error_code:-5,error_message:"Not ready!",data:{userAgent:this._userAgent,options:t,jsToken:this._jsAccessTk,access_token:this._accessTk},action:e,js_error:i};return this.onJSCall(s,n),!1}setTimeout((()=>{this.jsCall(e,t,n,r,o)}),500)}}catch(e){console.log("jsCall","error",e)}return!1}}class sl{constructor(e,t,n){this.code=e,this.message=t,this.api=n}toString(){return`api: ${this.api}; code: ${this.code}; message: ${this.message}`}}class ul extends sl{constructor(e,t){super(e,t),this.message=`${t}. ${wn.READ_MORE}`,this.handler()}handler(){switch(this.code){case e.NativeCode.token_invalid:this.code=_n,this.message=wn.LOGIN_REQUIRED;break;case e.NativeCode.not_permission:this.code=mn,this.message=wn.NOT_PERMISSION;break;case e.NativeCode.client_not_support:this.code=yn,this.message=wn.CLIENT_NOT_SUPPORT;break;case e.NativeCode.decode_failed:this.message=wn.DECODE_FAILED}}}const cl={handler:null,setHandler(e){this.handler=e}};cl.setHandler(((e,t)=>t instanceof sl?(t.api=e,t):new sl(-2001,i.isNull(t.message)?"Unknown Error":t.message,e)));const ll=(e,t,n)=>{const r=n.value;return n.value=function(...e){return Zn(this,void 0,void 0,(function*(){const{success:n,fail:o}=Array.isArray(e)&&e.length>0&&e[0];return new Promise(((a,s)=>Zn(this,void 0,void 0,(function*(){try{const t=yield r.apply(this,e);!i.isNull(n)&&i.isFunction(n)?n.call(null,t,this):a(t)}catch(e){if((null==e?void 0:e.code)===_n||(null==e?void 0:e.code)===mn){let t=!1;this instanceof Tf&&(t=this.getLoginStatus()),t||(e=new sl(_n,wn.LOGIN_REQUIRED))}const{handler:n}=cl,r=n.call(null,t,e,this);window.zmpSentry&&window.zmpSentry.throwError(r.toString()),!i.isNull(o)&&i.isFunction(o)?o.call(null,r,this):console.error("Error:",r)}}))))}))},n},fl=(e,t,n)=>{const r=n.value;return n.value=function(...e){try{return r.apply(this,e)}catch(e){if((null==e?void 0:e.code)===_n||(null==e?void 0:e.code)===mn){let t=!1;this instanceof Tf&&(t=this.getLoginStatus()),t||(e=new sl(_n,wn.LOGIN_REQUIRED))}const{handler:n}=cl;!i.isNull(n)&&i.isFunction(n)?n.call(null,t,e,this):console.warn(e.message)}},n};var hl;class dl{constructor(){hl.set(this,void 0),Gn(this,hl,al.getInstance())}setZAccSession(e){qn(this,hl).accessTk=e}setJSToken(e){qn(this,hl).jsAccessTk=e}callNative(e,t,n){return new Promise(((r,i)=>{const o=o=>Zn(this,void 0,void 0,(function*(){try{const a=new ul(o.error_code,`${o.action}: ${o.error_message}`);if(null==n?void 0:n.callback){const e=yield n.callback(o,a);return r(e)}if(o&&o.error_code>=0)r(o.data||{});else if(o&&o.error_code<0){try{window.zmpSentry&&window.zmpSentry.captureMessage(`${e}: call native fail`,{extra:{data:t,rs:o}})}catch(e){}return i(a)}}catch(e){return i(e)}})),a=Nn().isIOS,s=(e=>{var t,n;const r=e.slice(7,e.length).replace(/\./gi,"_").toUpperCase(),i=Pn(),o=(null===(n=null===(t=dn[r])||void 0===t?void 0:t.version_live)||void 0===n?void 0:n.iOS)||0;return!!(Array.isArray(window.ignoreCheckSupport)&&window.ignoreCheckSupport.length>0&&window.ignoreCheckSupport.includes(e))||i>=o})(e);if(a&&!s){const t=new ul(-5,`${e}: Client isn't support this action`);return i(t)}qn(this,hl).jsCall(e,t,o,null==n?void 0:n.isMultiCallback,null==n?void 0:n.nRetry,null==n?void 0:n.haveTimeout)}))}}hl=new WeakMap;const pl={badRequest:e=>new sl(vn,e),loginFailed:()=>new sl(vn,wn.LOGIN_FAILED),loginRequired:()=>new sl(_n,wn.LOGIN_REQUIRED),missingParam:e=>new sl(vn,`Missing required argument: ${e}`),wrongTypeParam:(e,t,n)=>new sl(vn,`Wrong type of parameter '${e}'. Expected ${t}, but got ${n}`),cannotGetShareInfo:()=>new sl(gn,"Can not get app info to share"),lengthInvalid:e=>new sl(vn,`${e} length is invalid.`)};var vl,gl,_l,ml,yl,wl="2.15.0";class bl{static getVersion(){return wl}static getSystemInfo(){return{version:In("version-id")||"",apiVersion:wl,zaloVersion:Pn(),platform:xn(),language:navigator.language}}static getAppInfo(){return Zn(this,void 0,void 0,(function*(){let e={};const t=this.getAppId(),n=this.getSystemInfo(),r=el.appendToUrl(`https://h5.zalo.me/${bn}`,{appId:t,versionStatus:0,currentVersion:n.version}),i=yield fetch(r,{credentials:"include"});if(i.ok){const t=yield i.json();if(t.err<0||!t.data)throw new Error(t);e={name:t.data.name,version:t.data.version,description:t.data.description,appUrl:t.data.appUrl,qrCodeUrl:t.data.qrCodeUrl}}return e}))}}class El{static setNavigationBarTitle(e){return Zn(this,void 0,void 0,(function*(){yield this.callNative(dn.CHANGE_TITLE_HEADER.name,{title:e.title},{haveTimeout:!1})}))}static setNavigationBarColor(e){return Zn(this,void 0,void 0,(function*(){if(i.isString(e.color)&&e.color.length>0){const t={};i.isEmpty(e.color)||(t.backgroundColor=e.color),i.isEmpty(e.textColor)||(t.textColor=e.textColor),yield this.callNative(dn.CHANGE_ACTIONBAR.name,{actionbarType:5,dataConfig:t,homeConfig:{enable:this.isShowHomeButton?1:0,url:`${Xc.MINI_APP_INTERNAL_LINK}/${this.getAppId()}/`}},{haveTimeout:!1}),this.isShowNavBar=!0}else{const t={};i.isEmpty(e.statusBarColor)||(t.backgroundColor=e.statusBarColor),i.isEmpty(e.textColor)||(t.textColor=e.textColor),yield this.callNative(dn.CHANGE_ACTIONBAR.name,{actionbarType:6,dataConfig:t},{haveTimeout:!1}),this.isShowNavBar=!1}}))}static setNavigationBarLeftButton(e){return Zn(this,void 0,void 0,(function*(){let t={};switch(e.type){case"none":this.isShowHomeButton=!1,t={buttonType:3,dataConfig:{confirmToExit:1},homeConfig:{enable:0,url:`${Xc.MINI_APP_INTERNAL_LINK}/${this.getAppId()}/`}};break;case"back":this.isShowHomeButton=!1,t={buttonType:0,dataConfig:{confirmToExit:1},homeConfig:{enable:0,url:`${Xc.MINI_APP_INTERNAL_LINK}/${this.getAppId()}/`}};break;case"home":this.isShowHomeButton=!0,t={buttonType:3,dataConfig:{confirmToExit:1},homeConfig:{enable:1,url:`${Xc.MINI_APP_INTERNAL_LINK}/${this.getAppId()}/`}};break;case"both":this.isShowHomeButton=!0,t={buttonType:0,dataConfig:{confirmToExit:1},homeConfig:{enable:1,url:`${Xc.MINI_APP_INTERNAL_LINK}/${this.getAppId()}/`}}}yield this.callNative(dn.CHANGE_ACTIONBAR_LEFTBUTTON_TYPE.name,Object.assign({},t),{haveTimeout:!1})}))}static setNavigationBarRightButton(e){return Zn(this,void 0,void 0,(function*(){yield this.callNative(dn.CREATE_OPTIONS_MENU.name,{supportToolBar:e.supportToolBar,reset:e.reset,menuListItems:e.menuListItems,zapp:this.getAppId()})}))}}class Al{static setBackgroundColor(e){return Zn(this,void 0,void 0,(function*(){i.isString(e.backgroundColor)&&e.backgroundColor.length>0&&(yield this.callNative(dn.CHANGE_ACTIONBAR.name,{actionbarType:this.isShowNavBar?5:6,dataConfig:{backgroundColor:e.backgroundColor,textColor:e.textColor}}))}))}}class Tl{constructor(e,t,n,r){this.title=r,this.severity=t;const i=new Date;if(this.time=i.toLocaleTimeString(),this.content=e,n>0){const e=(new Error).stack;this.stack=e?e.replace("Error\n",""):""}}toString(){return(this.content.stack?[this.title,this.severity.toUpperCase(),this.time,this.content,this.content.stack.replace("Error:","")]:[this.title,this.severity.toUpperCase(),this.time,JSON.stringify(this.content),this.stack]).join(" ")}}vl=new WeakMap,gl=new WeakMap,_l=new WeakMap,ml=new WeakMap,yl=new WeakMap;const kl=new class{constructor(){vl.set(this,3),gl.set(this,["none","error","warn","info"]),_l.set(this,"[zmp] > "),ml.set(this,{error:0,warn:0,info:0,firstError:null,lastError:null}),yl.set(this,((e,t,n)=>{qn(this,ml)[qn(this,gl)[e]]++;const r=qn(this,gl)[e];if(Gn(this,_l,qn(this,_l)+("string"!=typeof t?new Tl(t,r,e,n).toString():t)),!(e>qn(this,vl)))switch(e){case 1:console.error(qn(this,_l));break;case 2:console.warn(qn(this,_l));break;case 3:console.info(qn(this,_l));break;default:throw new Error("internal")}}))}setLogLevel(e){Gn(this,vl,e)}info(e){qn(this,yl).call(this,3,e)}warn(e,t){qn(this,yl).call(this,2,e,t)}error(e,t){qn(this,yl).call(this,1,e,t)}getMetrics(){return qn(this,ml)}};class Sl{static setDeviceOrientation(t){return Zn(this,void 0,void 0,(function*(){yield this.callNative(dn.CHANGE_AUTOROTATE.name,{autoRotate:e.OrientationType[t.rotate]})}))}static getNetworkType(t){return Zn(this,void 0,void 0,(function*(){return yield this.callNative(dn.WEBVIEW_NETWORKTYPE.name,{url:window.location.href,featureId:""}).then((t=>{let n;switch(t.network){case Xc.NETWORK_TYPE.NONE:n=e.NetworkType.none;break;case Xc.NETWORK_TYPE.WIFI:n=e.NetworkType.wifi;break;case Xc.NETWORK_TYPE["2G"]:case Xc.NETWORK_TYPE["3G"]:case Xc.NETWORK_TYPE["4G"]:n=e.NetworkType.cellular;break;default:n=e.NetworkType.unknown}return{networkType:n}}))}))}static onNetworkStatusChange(t){return Zn(this,void 0,void 0,(function*(){yield this.events.on(e.Events.NetworkChanged,(e=>{const n=e&&e.state;this.getNetworkType().then((e=>{const r={isConnected:"CONNECTED"===n,networkType:e&&e.networkType};t(r)})).catch((e=>{kl.error(e,"onNetworkStatusChange")}))}))}))}static startBeaconDiscovery(e){var t,n,r,o,a;return Zn(this,void 0,void 0,(function*(){const s={subaction:0,scanning_type:i.isNumber(null==e?void 0:e.scanningType)?e.scanningType:0,data:{scan_from_source:i.isString(null==e?void 0:e.scanFromSource)?e.scanFromSource:"",expire:i.isNumber(null==e?void 0:e.expire)?e.expire:3e3,monitor_interval:i.isNumber(null==e?void 0:e.monitorInterval)?e.monitorInterval:60,domain:i.isString(null==e?void 0:e.domain)?e.domain:"",scan_config:{scan_time:i.isNumber(null===(t=null==e?void 0:e.scanConfig)||void 0===t?void 0:t.scanTime)?e.scanConfig.scanTime:15e3,time_between_scan:i.isNumber(null===(n=null==e?void 0:e.scanConfig)||void 0===n?void 0:n.timeBetweenScan)?e.scanConfig.timeBetweenScan:1e4,beacon_timeout:i.isNumber(null===(r=null==e?void 0:e.scanConfig)||void 0===r?void 0:r.beaconTimeout)?e.scanConfig.beaconTimeout:3e4,delayCheckConnectedTimeout:i.isNumber(null===(o=null==e?void 0:e.scanConfig)||void 0===o?void 0:o.delayCheckConnectedTimeout)?e.scanConfig.delayCheckConnectedTimeout:5e3,beaconConnectedTimeout:i.isNumber(null===(a=null==e?void 0:e.scanConfig)||void 0===a?void 0:a.beaconConnectedTimeout)?e.scanConfig.beaconConnectedTimeout:6e5},items:Array.isArray(null==e?void 0:e.items)?null==e?void 0:e.items:[]}};return yield this.callNative(dn.SCAN_IBEACON.name,Object.assign({},s)),!0}))}static stopBeaconDiscovery(e){return Zn(this,void 0,void 0,(function*(){return yield this.callNative(dn.SCAN_IBEACON.name,Object.assign({},{subaction:2})),!0}))}static getBeacons(e){return Zn(this,void 0,void 0,(function*(){return yield this.callNative(dn.SCAN_IBEACON.name,Object.assign({},{subaction:1}),{isMultiCallback:!0}).then((e=>{const t={beacons:[]};return Array.isArray(e)&&e.forEach((e=>{const n={uuid:e.uuid,major:e.major,minor:e.minor,distance:e.distance,rssi:e.rssi};t.beacons.push(n)})),t}))}))}static stopBluetoothDevicesDiscovery(){return Zn(this,void 0,void 0,(function*(){return this.callNative("",{})}))}static startBluetoothDevicesDiscovery(e){return Zn(this,void 0,void 0,(function*(){return this.callNative("",Object.assign({},e))}))}static openBluetoothAdapter(){return Zn(this,void 0,void 0,(function*(){return this.callNative("",{})}))}static onBluetoothDeviceFound(){return Zn(this,void 0,void 0,(function*(){return this.callNative("",{})}))}static onBluetoothAdapterStateChange(){return Zn(this,void 0,void 0,(function*(){return Promise.resolve()}))}static getConnectedBluetoothDevices(e){return Zn(this,void 0,void 0,(function*(){const t={services:e.services||[]};return this.callNative("",t)}))}static getBluetoothDevices(){return Zn(this,void 0,void 0,(function*(){return this.callNative("",{})}))}static getBluetoothAdapterState(){return Zn(this,void 0,void 0,(function*(){return this.callNative("",{})}))}static closeBluetoothAdapter(){return Zn(this,void 0,void 0,(function*(){return this.callNative("",{})}))}static scanQRCode(e){return Zn(this,void 0,void 0,(function*(){return yield this.callNative(dn.OPEN_QR.name,{skipOpenLink:!0})}))}static showToast(e){return Zn(this,void 0,void 0,(function*(){yield this.callNative(dn.SHOW_TOAST.name,{toast:e.message})}))}static hideKeyboard(e){return Zn(this,void 0,void 0,(function*(){yield this.callNative(dn.HIDE_KEYBOARD.name,{})}))}static openPhone(e){return Zn(this,void 0,void 0,(function*(){yield this.callNative(dn.OPEN_PHONE.name,{phoneNum:e.phoneNumber,phoneCode:e.phoneNumber})}))}static openSMS(e){return Zn(this,void 0,void 0,(function*(){yield this.callNative(dn.OPEN_SMS.name,{content:e.content,phoneCode:e.phoneNumber})}))}static keepScreen(e){return Zn(this,void 0,void 0,(function*(){return yield this.callNative(dn.KEEP_SCREEN.name,{data:{keep_screen_on:e.keepScreenOn?1:0}})}))}static openBioAuthentication(e){return Zn(this,void 0,void 0,(function*(){return yield this.callNative(dn.PROMPT_AUTHENTICATION.name,{secret_data:e.secretData,app_id:this.getZAppId(),ui:{title:e.ui.title,sub_title:e.ui.subTitle,negative_text:e.ui.negativeButtonText},require_fingerprint:e.requireFingerprint?1:0}).then((e=>{var t,n,r,i;return{code:null==e?void 0:e.error_code,message:null==e?void 0:e.error_message,data:{domain:null===(t=null==e?void 0:e.data)||void 0===t?void 0:t.domain,code:null===(n=null==e?void 0:e.data)||void 0===n?void 0:n.error_code,message:null===(r=null==e?void 0:e.data)||void 0===r?void 0:r.error_message,payToken:null===(i=null==e?void 0:e.data)||void 0===i?void 0:i.pay_token}}}))}))}static checkStateBioAuthentication(e){return Zn(this,void 0,void 0,(function*(){return yield this.callNative(dn.PROMPT_AUTHENTICATION_CHECK_STATE.name,{}).then((e=>({bioState:null==e?void 0:e.bio_state})))}))}static vibrate(t){return Zn(this,void 0,void 0,(function*(){return yield this.callNative(dn.INTERACTIVE_VIBRATION.name,{type:e.VibrateType[t.type],vibrate_time:t.milliseconds})}))}}var Ol,Cl,Rl,Nl,Il,Pl,xl,Ll,Bl,jl,Ul,Dl,Ml,zl,Fl,Wl,Hl,Zl,ql,Gl,$l,Kl,Yl,Vl,Jl,Ql,Xl,ef,tf,nf;class rf{constructor(e){Ol.set(this,localStorage),Cl.set(this,void 0),Rl.set(this,void 0),Nn(),Gn(this,Rl,{keys:new Set,currentSize:0,limitSize:Xc.STORAGE_LIMIT}),Gn(this,Cl,e),this.findAllCurrentDataByApp(e)}findAllCurrentDataByApp(e){try{let t;for(t in qn(this,Ol)){if(e){if(t.split("_")[0]!==e)continue}qn(this,Rl).keys.add(t)}}catch(e){kl.error(e,"LocalResourceStorage > findAllCurrentDataByApp")}}get(e){let t=new Map;return e.forEach((e=>{t.set(e,this.getSync(e))})),Promise.resolve(t)}getSync(e){return qn(this,Cl)&&(e=`${qn(this,Cl)}_${e}`),qn(this,Rl).keys.has(e)?qn(this,Ol).getItem(e):null}set(e){return Zn(this,void 0,void 0,(function*(){return Object.entries(e).forEach((([e,t])=>{this.setSync(e,t.replace(/\\"/g,'"'))})),Promise.resolve({errorKeys:[]})}))}setSync(e,t){qn(this,Cl)&&(e=`${qn(this,Cl)}_${e}`),qn(this,Ol).setItem(e,t),qn(this,Rl).keys.add(e)}getInfo(){return Zn(this,void 0,void 0,(function*(){return Promise.resolve(this.getInfoSync())}))}getInfoSync(){const e=((e,t)=>{let n,r,i=0;for(r in e){const o=r.split("_")[0];e.hasOwnProperty(r)&&(t&&o!==t||(n=2*(e[r].length+r.length),i+=n))}return i})(qn(this,Ol),qn(this,Cl));return{currentSize:i.isNumber(e)?Number((e/1024).toFixed(2)):0,limitSize:Number((Xc.STORAGE_LIMIT/1024).toFixed(2))}}remove(e){return Zn(this,void 0,void 0,(function*(){return e.forEach((e=>{this.removeSync(e)})),Promise.resolve({errorKeys:[]})}))}removeSync(e){qn(this,Cl)&&(e=`${qn(this,Cl)}_${e}`),qn(this,Rl).keys.has(e)&&(qn(this,Ol).removeItem(e),qn(this,Rl).keys.delete(e))}clear(){return Zn(this,void 0,void 0,(function*(){return Promise.resolve(this.clearSync())}))}clearSync(){qn(this,Rl).keys.forEach((e=>{qn(this,Cl)&&e.indexOf(qn(this,Cl))<0||(qn(this,Ol).removeItem(e),qn(this,Rl).keys.delete(e))}))}}Ol=new WeakMap,Cl=new WeakMap,Rl=new WeakMap;class of extends dl{constructor(e){super(),Nl.set(this,void 0),Il.set(this,void 0),Gn(this,Il,{keys:new Set,currentSize:0,limitSize:Xc.STORAGE_LIMIT}),Gn(this,Nl,e)}get(e){return Zn(this,void 0,void 0,(function*(){return yield this.callNative(dn.ZBROWSER_MPDS.name,{mpds_action:"mpds.get",mpds_data:{keys:e},appId:qn(this,Nl)},{isMultiCallback:!1}).then((e=>{let t=new Map;return e&&e.mpds_data&&e.mpds_data.map&&(t=new Map(Object.entries(e.mpds_data.map))),t}))}))}set(e){return Zn(this,void 0,void 0,(function*(){return{errorKeys:yield this.callNative(dn.ZBROWSER_MPDS.name,{mpds_action:"mpds.set",mpds_data:{map:e},appId:qn(this,Nl)},{isMultiCallback:!1}).then((e=>{let t=[];return e&&e.mpds_data&&e.mpds_data.error_keys&&(t=e.mpds_data.error_keys),t}))}}))}getInfo(){return Zn(this,void 0,void 0,(function*(){const e=yield this.callNative(dn.ZBROWSER_MPDS.name,{mpds_action:"mpds.get.size",mpds_data:{},appId:qn(this,Nl)},{isMultiCallback:!1}).then((e=>{let t=0;return e&&e.mpds_data&&e.mpds_data.size&&(t=e.mpds_data.size),t}));return{currentSize:i.isNumber(e)?Number(e/1024):0,limitSize:Number(Xc.STORAGE_LIMIT/1024)}}))}remove(e){return Zn(this,void 0,void 0,(function*(){return{errorKeys:yield this.callNative(dn.ZBROWSER_MPDS.name,{mpds_action:"mpds.remove.key",mpds_data:{keys:e},appId:qn(this,Nl)},{isMultiCallback:!1}).then((e=>{let t=[];return e&&e.mpds_data&&e.mpds_data.error_keys&&(t=e.mpds_data.error_keys),t}))}}))}clear(){return Zn(this,void 0,void 0,(function*(){yield this.callNative(dn.ZBROWSER_MPDS.name,{mpds_action:"mpds.clear.appData",mpds_data:{},appId:qn(this,Nl)})}))}}Nl=new WeakMap,Il=new WeakMap;class af{getDataFromStorage(e){return Zn(this,void 0,void 0,(function*(){const t=this.getInstance(),n=yield t.get(e),r={};return n.forEach(((e,t)=>{r[t]=Fn(e)})),r}))}putDataToStorage(e){return Zn(this,void 0,void 0,(function*(){const t=this.getInstance(),n={};return Object.entries(e).forEach((([e,t])=>{i.isUndefined(t)||i.isNull(t)||(n[e]=zn(t))})),yield t.set(n)}))}removeDataFromStorage(e){return Zn(this,void 0,void 0,(function*(){const t=this.getInstance();return yield t.remove(e)}))}clearStorage(){return Zn(this,void 0,void 0,(function*(){const e=this.getInstance();yield e.clear()}))}getStorageInfo(){return Zn(this,void 0,void 0,(function*(){const e=this.getInstance();return yield e.getInfo()}))}}class sf extends af{constructor(e){super(),Pl.set(this,void 0),Gn(this,Pl,e)}getInstance(){return new rf(qn(this,Pl))}}Pl=new WeakMap;class uf extends af{constructor(e){super(),xl.set(this,void 0),Gn(this,xl,e)}getInstance(){return new of(qn(this,xl))}}xl=new WeakMap;class cf{static setStorage(e){return Zn(this,void 0,void 0,(function*(){let t=new sf(this.getAppId());return Mn()&&(t=new uf(this.getAppId())),yield t.putDataToStorage(e.data)}))}static getStorage(e){return Zn(this,void 0,void 0,(function*(){let t=new sf(this.getAppId());Mn()&&(t=new uf(this.getAppId()));return yield t.getDataFromStorage(e.keys)}))}static getStorageInfo(e){return Zn(this,void 0,void 0,(function*(){let e=new sf(this.getAppId());return Mn()&&(e=new uf(this.getAppId())),yield e.getStorageInfo()}))}static removeStorage(e){return Zn(this,void 0,void 0,(function*(){let t=new sf(this.getAppId());return Mn()&&(t=new uf(this.getAppId())),yield t.removeDataFromStorage(e.keys)}))}static clearStorage(e={}){return Zn(this,void 0,void 0,(function*(){let e=new sf(this.getAppId());Mn()&&(e=new uf(this.getAppId())),yield e.clearStorage()}))}}class lf{static getUserInfo(e){return Zn(this,void 0,void 0,(function*(){const t=yield this.getAccessToken();let n="id,name,picture";(null==e?void 0:e.avatarType)&&(n=`${n}.type(${null==e?void 0:e.avatarType})`);return{userInfo:yield Qc.get(Xc.APIS.GET_USER_INFO,{params:{fields:n,access_token:t}}).then((e=>{const t=e.data,n={id:t.id,name:t.name,birthday:"",gender:"",avatar:t.picture&&t.picture.data&&t.picture.data.url};return console.warn("'birthday' and 'gender' are deprecated"),n}))}}))}static getPhoneNumber(e){return Zn(this,void 0,void 0,(function*(){return yield this.callNative(dn.MP_GET_NUMBER.name,{},{isMultiCallback:!0,callback:(e,t)=>{if(0===e.error_code){const t={number:e.data};return Promise.resolve(t)}return Promise.reject(t)}})}))}}class ff{static closeApp(e){return Zn(this,void 0,void 0,(function*(){yield this.callNative(dn.WINDOW_CLOSE.name,{})}))}static openMiniApp(e){return Zn(this,void 0,void 0,(function*(){const t=null==e?void 0:e.appId,n=(null==e?void 0:e.params)||{},r=Object.entries(n).map((function([e,t]){return[e,t].join("=")})).join("&");yield this.callNative(dn.OPEN_MP.name,{mpUrl:`${Xc.MINI_APP_INTERNAL_LINK}/${t}/${r.length>0?"?"+r:""}`,mpInfo:{appId:t}})}))}static openWebview(e){return Zn(this,void 0,void 0,(function*(){yield this.callNative(dn.OPEN_INAPP.name,{url:e.url})}))}}class hf{static getLocation(e){return Zn(this,void 0,void 0,(function*(){return yield this.callNative(dn.GET_LOCATION.name,{silent_request:!1,permission_description:"Cho phép Zalo truy cập vào vị trí của thiết bị này?"},{isMultiCallback:!0,haveTimeout:!1,callback:(e,t)=>{if(0===e.error_code){const t=e.data,n={latitude:t.latitude,longitude:t.longitude,timestamp:t.timestamp,provider:t.provider};return Promise.resolve(n)}return Promise.reject(t)}})}))}static sendLocation(e){return Zn(this,void 0,void 0,(function*(){yield this.callNative(dn.QUERY_LOCATION_HIDE.name,{title:e.title,touserid:e.toUserId,zapp:this.getZAppId()})}))}}class df{static requestCameraPermission(e){return Zn(this,void 0,void 0,(function*(){return yield this.callNative(dn.REQUEST_PERMISSION_CAMERA.name,{},{callback:(e,t)=>-2===e.error_code||e.error_code>=0?Promise.resolve({userAllow:-2!==e.error_code,message:e.error_message}):Promise.reject(t)})}))}static saveImageToPhotosAlbum(e){return Zn(this,void 0,void 0,(function*(){let t={};return t=i.isEmpty(e.imageBase64Data)?Object.assign(Object.assign({},t),{imageUrl:e.imageUrl}):Object.assign(Object.assign({},t),{imageBase64Data:e.imageBase64Data}),yield this.callNative(dn.SAVE_IMAGE_GALLERY.name,Object.assign({},t))}))}}class pf{static viewOAQr(e){return Zn(this,void 0,void 0,(function*(){yield this.callNative(dn.VIEW_MYQR.name,{dpn:e.displayName,uid:e.id,zapp:this.getZAppId()},{haveTimeout:!1})}))}static openProfile(t){return Zn(this,void 0,void 0,(function*(){return yield this.callNative(dn.OPEN_PROFILE.name,{uId:t.id,type:e.ProfileType[t.type],zapp:this.getZAppId(),sourceId:t.sourceId,sourceIndex:t.sourceIndex})}))}static openChat(t){return Zn(this,void 0,void 0,(function*(){return yield this.callNative(dn.OPEN_CHAT.name,{uId:t.id,type:e.ChatType[t.type],zapp:this.getZAppId(),sourceId:t.sourceId,sourceIndex:t.sourceIndex})}))}static openPostFeed(t){return Zn(this,void 0,void 0,(function*(){let n={};switch(t.type){case"image":n={photoUrl:t.data.imageUrl};break;case"link":n={link:t.data.link,title:t.data.title,thumb:t.data.thumb,description:t.data.description};break;case"profile":n={avt:t.data.avatar,uid:t.data.id,dpn:t.data.displayName}}return yield this.callNative(dn.OPEN_POSTFEED.name,Object.assign(Object.assign({type:e.PostFeedType[t.type]},n),{zapp:this.getZAppId()})).then((e=>({status:e.status,shareType:e.share_type,numberOfUser:e.uid_to_size})))}))}static followOA(e){return Zn(this,void 0,void 0,(function*(){yield this.callNative(dn.FOLLOW_OA.name,{uid:e.id,showDialogConfirm:!0,zapp:this.getZAppId()},{haveTimeout:!1})}))}static unfollowOA(e){return Zn(this,void 0,void 0,(function*(){yield this.callNative(dn.UNFOLLOW_OA.name,{uid:e.id,zapp:this.getZAppId()},{haveTimeout:!1})}))}static openShareSheet(t){return Zn(this,void 0,void 0,(function*(){let n={};switch(t.type){case"image":n={photoUrl:t.data.imageUrl};break;case"gif":n={photoUrl:t.data.imageUrl,gifUrl:t.data.gifUrl,width:t.data.width,height:t.data.height};break;case"video":n={videoThumb:t.data.videoThumb,videoUrl:t.data.videoUrl,width:t.data.width,height:t.data.height};break;case"link":n={link:t.data.link,chatOnly:t.data.chatOnly?1:0};break;case"oa":n={uid:t.data.id};break;case"zmp":const e=new URL(location.href),r=new URLSearchParams,o=yield this.getAccessToken(),a={vi:"",en:""};let s=`${e.pathname}${e.search}`;t.data.path&&(s=`/zapps/${this.getAppId()}${"/"===t.data.path[0]?"":"/"}${t.data.path}`);const u=new URL(`https://zalo.me/app/link${s}`);i.isString(t.data.description)?a.en=a.vi=t.data.description:i.isObject(t.data.description)&&(a.en=t.data.description.en||"",a.vi=t.data.description.vi||""),r.append("title",t.data.title),r.append("description",a.vi||a.en),r.append("thumbnail",t.data.thumbnail),r.append("url",u.href),r.append("accessToken",o||"");const c={headers:{"Content-Type":"application/x-www-form-urlencoded"}},l=(yield Qc.post("https://h5.zalo.me/openapi/create-sharelink",r,c)).data;if(!l||0!==l.err)throw pl.cannotGetShareInfo();const f=Pn(),h=Nn();h.isAndroid&&f%1e5<=593||h.isIOS&&f<=424?(u.search=`${u.search}&zshareId=${l.data.shareId}`,n={link:u.href,chatOnly:t.data.chatOnly?1:0},t.type="link"):n={data:{ZInstantAPIInfo:{url:`${l.data.zinstantApi}`,zinstantdata_id:`templateId=11412&appId=${this.getAppId()}&shareId=${l.data.shareId}`},previewMsgText:{msg:{en:a.en,vi:a.vi}},enableReactions:1}}}return yield this.callNative(dn.OPEN_SHARESHEET.name,Object.assign(Object.assign({type:e.ShareSheetType[t.type]},n),{zapp:this.getZAppId()}),{haveTimeout:!1}).then((e=>({status:e.status,shareType:e.share_type,numberOfUser:e.uid_to_size})))}))}static createShortcut(e){return Zn(this,void 0,void 0,(function*(){yield this.callNative(dn.CREATE_SHORTCUT.name,{url:`${Xc.MINI_APP_LINK}/${this.getAppId()}/`,title:document.title,iconUrl:`https:${In("og:image:url")}`})}))}static openProfilePicker(e){return Zn(this,void 0,void 0,(function*(){return yield this.callNative(dn.MP_OPEN_PROFILE_PICKER.name,{maxProfile:null==e?void 0:e.maxProfile},{isMultiCallback:!0,callback:(e,t)=>{if(0===e.error_code){const t={userIDs:e.data};return Promise.resolve(t)}return Promise.reject(t)}})}))}static getActionsSupported(t){return Zn(this,void 0,void 0,(function*(){return yield this.callNative(dn.GET_SUPPORTED_ACTIONS.name,{},{isMultiCallback:!1,callback:(t,n)=>{const r=xn();if(Array.isArray(t.actions)&&t.actions.length>0){const e=Object.keys(dn).filter((e=>dn[e].skip_jump)),n={actions:[...t.actions,...e]};return Promise.resolve(n)}if(r===e.PlatformType.iOS){const e={actions:An};return Promise.resolve(e)}return Promise.reject(n)}})}))}}class vf{static getRouteParams(){let e={};const t=window.location.href;try{let n=new URL(t).searchParams.toString();n&&(e=el.getParamsAsObject(n))}catch(e){throw new Error("Url không hợp lệ")}return e}static sendDataToPreviousMiniApp(e){return Zn(this,void 0,void 0,(function*(){return yield this.callNative(dn.WEBVIEW_SET_RESULT.name,{result:zn(e.data)})}))}static onCallbackData(t){return Zn(this,void 0,void 0,(function*(){yield this.events.on(e.Events.OnDataCallback,(e=>{t({data:e})}))}))}}class gf extends dl{constructor(){super(),Ll.set(this,window.zAppID),Bl.set(this,window.APP_ID),jl.set(this,window.APP_CONFIG||{}),Ul.set(this,void 0),Dl.set(this,void 0),Ml.set(this,void 0),zl.set(this,null),Fl.set(this,{timer:{getToken:0}}),Wl.set(this,void 0),Hl.set(this,void 0),Zl.set(this,null),this.events=Kn.getInstance(),ql.set(this,(()=>{const e=qn(this,jl).app||null;if(e){const t=e.title,n=e.headerColor,r=e.textColor,o=e.statusBarColor,a=e.leftButton;if(i.isString(t)&&this.setNavigationBarTitle({title:t}),i.isString(n)){const e={color:n};!i.isString(r)||"black"!==r&&"white"!==r||(e.textColor=r),i.isString(o)&&(e.statusBarColor=o),this.setNavigationBarColor(e)}i.isString(a)&&this.setNavigationBarLeftButton({type:a})}})),Gl.set(this,(()=>{try{qn(this,ql).call(this)}catch(e){console.error(e)}})),$l.set(this,(()=>new Promise(((e,t)=>{i.isUndefined(qn(this,Zl))||i.isNull(qn(this,Zl))?this.callNative("action.jump.login",{}).then((t=>{const n=t&&t.cookiesOAuthLogins||[],r=n.find((e=>e.name===Xc.COOKIE_NAME.JS_TOKEN));r&&(this.setJSToken(r.value),window.ZJSBridge.setJSToken&&window.ZJSBridge.setJSToken(r.value)),Gn(this,Zl,n),e(n)})).catch((e=>{t(e)})):e(qn(this,Zl))})))),Kl.set(this,El.setNavigationBarRightButton),this.getVersion=bl.getVersion,this.getSystemInfo=bl.getSystemInfo,this.setNavigationBarTitle=El.setNavigationBarTitle,this.setNavigationBarColor=El.setNavigationBarColor,this.setNavigationBarLeftButton=El.setNavigationBarLeftButton,this.setBackgroundColor=Al.setBackgroundColor,this.setDeviceOrientation=Sl.setDeviceOrientation,this.setStorage=cf.setStorage,this.getStorage=cf.getStorage,this.getStorageInfo=cf.getStorageInfo,this.removeStorage=cf.removeStorage,this.clearStorage=cf.clearStorage,this.getUserInfo=lf.getUserInfo,this.getNetworkType=Sl.getNetworkType,this.onNetworkStatusChange=Sl.onNetworkStatusChange,this.startBeaconDiscovery=Sl.startBeaconDiscovery,this.stopBeaconDiscovery=Sl.stopBeaconDiscovery,this.getBeacons=Sl.getBeacons,this.closeApp=ff.closeApp,this.getLocation=hf.getLocation,this.stopBluetoothDevicesDiscovery=Sl.stopBluetoothDevicesDiscovery,this.startBluetoothDevicesDiscovery=Sl.stopBluetoothDevicesDiscovery,this.openBluetoothAdapter=Sl.openBluetoothAdapter,this.onBluetoothDeviceFound=Sl.onBluetoothDeviceFound,this.onBluetoothAdapterStateChange=Sl.onBluetoothAdapterStateChange,this.getConnectedBluetoothDevices=Sl.getConnectedBluetoothDevices,this.getBluetoothDevices=Sl.getBluetoothDevices,this.getBluetoothAdapterState=Sl.getBluetoothAdapterState,this.closeBluetoothAdapter=Sl.closeBluetoothAdapter,this.scanQRCode=Sl.scanQRCode,this.openProfile=pf.openProfile,this.openChat=pf.openChat,this.openPostFeed=pf.openPostFeed,this.followOA=pf.followOA,this.unFollowOA=pf.unfollowOA,this.openShareSheet=pf.openShareSheet,this.requestCameraPermission=df.requestCameraPermission,this.createShortcut=pf.createShortcut,this.openBioAuthentication=Sl.openBioAuthentication,this.checkStateBioAuthentication=Sl.checkStateBioAuthentication,this.sendLocation=hf.sendLocation,this.showToast=Sl.showToast,this.hideKeyboard=Sl.hideKeyboard,this.openPhone=Sl.openPhone,this.openSMS=Sl.openSMS,this.viewOAQr=pf.viewOAQr,this.keepScreen=Sl.keepScreen,this.saveImageToPhotosAlbum=df.saveImageToPhotosAlbum,this.openMiniApp=ff.openMiniApp,this.vibrate=Sl.vibrate,this.openWebview=ff.openWebview,this.getRouteParams=vf.getRouteParams,this.getAppInfo=bl.getAppInfo,this.sendDataToPreviousMiniApp=vf.sendDataToPreviousMiniApp,this.onCallbackData=vf.onCallbackData,this.getPhoneNumber=lf.getPhoneNumber,this.openProfilePicker=pf.openProfilePicker,Yl.set(this,pf.getActionsSupported),Gn(this,Ul,null),Gn(this,Dl,null),Gn(this,Ml,null),this.isShowNavBar=!0,this.isShowHomeButton=!0,Gn(this,Wl,0),Gn(this,Hl,0)}static getInstance(){return gf.instance||(gf.instance=new gf),gf.instance}getLoginStatus(){return i.isString(qn(this,Ml))&&qn(this,Ml).length>0}getAppId(){return qn(this,Bl)}getZAppId(){return qn(this,Ll)}login(e){return Zn(this,void 0,void 0,(function*(){const e=yield qn(this,$l).call(this),t=e.find((e=>e.name===Xc.COOKIE_NAME.ZOAUTH)),n=e.find((e=>e.name===Xc.COOKIE_NAME.ZOAUTH_VRF));if(!i.isUndefined(t)&&!i.isNull(t)&&i.isString(t.value)){if(Gn(this,Ul,t.value),i.isUndefined(n)||i.isNull(n)||!i.isString(n.value)?yield this.loginZaloV3():(Gn(this,Dl,n.value),yield this.loginZaloV4()),!qn(this,Ml))throw pl.loginFailed();return qn(this,Ml)}throw pl.loginFailed()}))}loginZaloV3(){return Zn(this,void 0,void 0,(function*(){return yield Qc.get(Xc.APIS.GET_ACCESS_TOKEN_V3,{params:{app_id:qn(this,Ll),redirect_uri:`${Xc.MINI_APP_INTERNAL_LINK}/${qn(this,Bl)}/`,code:qn(this,Ul),isSDK:!0}}).then((e=>{let t=e.data;if(t.access_token){Gn(this,Ml,t.access_token);const e=1e3*parseInt(t.expires_in);return Gn(this,Hl,e),Gn(this,Wl,(new Date).getTime()),this.setZAccSession(qn(this,Ml)||""),window.ZJSBridge.setZAccSession&&window.ZJSBridge.setZAccSession(qn(this,Ml)||""),qn(this,Ml)}return null}))}))}loginZaloV4(){return Zn(this,void 0,void 0,(function*(){const e=new URLSearchParams;e.append("app_id",qn(this,Bl)),e.append("code",qn(this,Ul)||""),e.append("code_verifier",qn(this,Dl)||""),i.isNull(qn(this,zl))?e.append("grant_type","authorization_code"):(e.append("grant_type","refresh_token"),e.append("refresh_token",qn(this,zl)||""));return yield Qc.post(Xc.APIS.GET_ACCESS_TOKEN,e,{headers:{"Content-Type":"application/x-www-form-urlencoded"}}).then((e=>{const t=e.data;if(t.refresh_token&&Gn(this,zl,t.refresh_token),t.access_token){Gn(this,Ml,t.access_token);const e=1e3*parseInt(t.expires_in);return Gn(this,Hl,e),Gn(this,Wl,(new Date).getTime()),this.setZAccSession(qn(this,Ml)||""),window.ZJSBridge.setZAccSession&&window.ZJSBridge.setZAccSession(qn(this,Ml)||""),qn(this,Ml)}return null}))}))}getAccessToken(e){return Zn(this,void 0,void 0,(function*(){const e=(new Date).getTime()-qn(this,Wl);if(!qn(this,Ml))throw pl.loginRequired();return e<qn(this,Hl)?qn(this,Ml):yield this.login()}))}}Ll=new WeakMap,Bl=new WeakMap,jl=new WeakMap,Ul=new WeakMap,Dl=new WeakMap,Ml=new WeakMap,zl=new WeakMap,Fl=new WeakMap,Wl=new WeakMap,Hl=new WeakMap,Zl=new WeakMap,ql=new WeakMap,Gl=new WeakMap,$l=new WeakMap,Kl=new WeakMap,Yl=new WeakMap;class _f{constructor(){Vl.set(this,window.zAppID),Jl.set(this,window.APP_CONFIG||{}),Ql.set(this,"DEFAULT ZOAUTH"),Xl.set(this,"DEFAULT ACCESS TOKEN"),ef.set(this,{timer:{getToken:0}}),tf.set(this,!1),this.getLoginStatus=()=>qn(this,tf),this.getAppId=()=>qn(this,Vl),this.login=()=>(Gn(this,tf,!0),Promise.resolve(qn(this,Ql))),this.getAccessToken=()=>Promise.resolve(qn(this,Xl)),this.getVersion=bl.getVersion,this.getSystemInfo=bl.getSystemInfo,this.setNavigationBarTitle=()=>Promise.resolve(),this.setNavigationBarColor=()=>Promise.resolve(),this.setBackgroundColor=()=>Promise.resolve(),this.setNavigationBarLeftButton=()=>Promise.resolve(),this.setDeviceOrientation=()=>Promise.resolve(),this.setStorage=e=>Zn(this,void 0,void 0,(function*(){const t=new sf(this.getAppId());return yield t.putDataToStorage(e.data),{errorKeys:[]}})),this.getStorage=e=>Zn(this,void 0,void 0,(function*(){const t=new sf(this.getAppId());return yield t.getDataFromStorage(e.keys)})),this.getStorageInfo=e=>Zn(this,void 0,void 0,(function*(){const e=new sf(this.getAppId());return yield e.getStorageInfo()})),this.removeStorage=e=>Zn(this,void 0,void 0,(function*(){const t=new sf(this.getAppId());return yield t.removeDataFromStorage(e.keys)})),this.clearStorage=e=>Zn(this,void 0,void 0,(function*(){const e=new sf(this.getAppId());return yield e.clearStorage()})),this.getUserInfo=()=>(console.warn("birthday and gender are deprecated"),Promise.resolve({userInfo:{id:"3368637342326461234",name:"User Name",avatar:"https://h5.zdn.vn/static/images/avatar.png"}})),this.getNetworkType=()=>{let t;switch((navigator.connection||navigator.mozConnection||navigator.webkitConnection).effectiveType){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}const n={networkType:t};return Promise.resolve(n)},this.onNetworkStatusChange=t=>{const n=navigator.connection||navigator.mozConnection||navigator.webkitConnection,r=n.effectiveType;return n.addEventListener("change",(function(){let n;switch(r){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}t({isConnected:!0,networkType:n})})),Promise.resolve()},this.startBeaconDiscovery=e=>Promise.resolve(!0),this.stopBeaconDiscovery=e=>Promise.resolve(!0),this.getBeacons=e=>Promise.resolve({beacons:[]}),this.closeApp=()=>Promise.resolve(),this.getLocation=()=>Promise.resolve({longitude:"105.788026",latitude:"21.0258773",timestamp:(new Date).getTime().toString(),provider:"fused"}),this.onBackButtonClick=()=>Promise.resolve(),this.stopBluetoothDevicesDiscovery=()=>Promise.resolve(),this.startBluetoothDevicesDiscovery=()=>Promise.resolve(),this.openBluetoothAdapter=()=>Promise.resolve(),this.onBluetoothDeviceFound=()=>Promise.resolve(),this.onBluetoothAdapterStateChange=()=>Promise.resolve(),this.getConnectedBluetoothDevices=()=>Promise.resolve(),this.getBluetoothDevices=()=>Promise.resolve(),this.getBluetoothAdapterState=()=>Promise.resolve(),this.closeBluetoothAdapter=()=>Promise.resolve(),this.scanQRCode=()=>Promise.resolve({content:"132"}),this.openProfile=()=>Promise.resolve(),this.openChat=()=>Promise.resolve(),this.openPostFeed=()=>Promise.resolve({status:1,shareType:0,numberOfUser:0}),this.followOA=()=>Promise.resolve(),this.unFollowOA=()=>Promise.resolve(),this.openShareSheet=()=>Promise.resolve({status:2,shareType:0,numberOfUser:0}),this.requestCameraPermission=()=>Promise.resolve({userAllow:!0,message:"Success"}),this.createShortcut=()=>Promise.resolve(),this.openBioAuthentication=()=>Promise.resolve({code:0,message:"OK",data:{domain:"",code:0,message:"",payToken:""}}),this.checkStateBioAuthentication=()=>Promise.resolve({bioState:""}),this.sendLocation=()=>Promise.resolve(),this.showToast=()=>Promise.resolve(),this.hideKeyboard=()=>Promise.resolve(),this.openPhone=()=>Promise.resolve(),this.openSMS=()=>Promise.resolve(),this.viewOAQr=()=>Promise.resolve(),this.keepScreen=()=>Promise.resolve(),this.saveImageToPhotosAlbum=()=>Promise.resolve(),this.openMiniApp=e=>Promise.resolve(),this.vibrate=()=>Promise.resolve(),this.openWebview=e=>(location.replace(e.url),Promise.resolve()),this.getRouteParams=vf.getRouteParams,this.getAppInfo=()=>Promise.resolve({description:"",name:"",version:"",appUrl:"",qrCodeUrl:""}),this.sendDataToPreviousMiniApp=e=>Promise.resolve(),this.onCallbackData=e=>(e({data:""}),Promise.resolve()),this.getPhoneNumber=()=>(console.warn("This api only works on zalo app"),Promise.resolve({number:""})),this.openProfilePicker=()=>(console.warn("This api only works on zalo app"),Promise.resolve({userIDs:[]}))}on(e,t,n){throw new Error("Method not implemented.")}once(e,t,n){throw new Error("Method not implemented.")}off(e,t,n,r){throw new Error("Method not implemented.")}removeAllListeners(e){throw new Error("Method not implemented.")}}Vl=new WeakMap,Jl=new WeakMap,Ql=new WeakMap,Xl=new WeakMap,ef=new WeakMap,tf=new WeakMap,function(e){!function(n){var r="object"==typeof t?t:"object"==typeof self?self:"object"==typeof this?this:Function("return this;")(),i=o(e);function o(e,t){return function(n,r){"function"!=typeof e[n]&&Object.defineProperty(e,n,{configurable:!0,writable:!0,value:r}),t&&t(n,r)}}void 0===r.Reflect?r.Reflect=e:i=o(r.Reflect,i),function(e){var t=Object.prototype.hasOwnProperty,n="function"==typeof Symbol,r=n&&void 0!==Symbol.toPrimitive?Symbol.toPrimitive:"@@toPrimitive",i=n&&void 0!==Symbol.iterator?Symbol.iterator:"@@iterator",o="function"==typeof Object.create,a={__proto__:[]}instanceof Array,s=!o&&!a,u={create:o?function(){return ie(Object.create(null))}:a?function(){return ie({__proto__:null})}:function(){return ie({})},has:s?function(e,n){return t.call(e,n)}:function(e,t){return t in e},get:s?function(e,n){return t.call(e,n)?e[n]:void 0}:function(e,t){return e[t]}},c=Object.getPrototypeOf(Function),l="object"==typeof N&&N.env&&"true"===N.env.REFLECT_METADATA_USE_MAP_POLYFILL,f=l||"function"!=typeof Map||"function"!=typeof Map.prototype.entries?te():Map,h=l||"function"!=typeof Set||"function"!=typeof Set.prototype.entries?ne():Set,d=new(l||"function"!=typeof WeakMap?re():WeakMap);function p(e,t,n,r){if(j(n)){if(!q(e))throw new TypeError;if(!$(t))throw new TypeError;return T(e,t)}if(!q(e))throw new TypeError;if(!M(t))throw new TypeError;if(!M(r)&&!j(r)&&!U(r))throw new TypeError;return U(r)&&(r=void 0),k(e,t,n=Z(n),r)}function v(e,t){function n(n,r){if(!M(n))throw new TypeError;if(!j(r)&&!K(r))throw new TypeError;P(e,t,n,r)}return n}function g(e,t,n,r){if(!M(n))throw new TypeError;return j(r)||(r=Z(r)),P(e,t,n,r)}function _(e,t,n){if(!M(t))throw new TypeError;return j(n)||(n=Z(n)),O(e,t,n)}function m(e,t,n){if(!M(t))throw new TypeError;return j(n)||(n=Z(n)),C(e,t,n)}function y(e,t,n){if(!M(t))throw new TypeError;return j(n)||(n=Z(n)),R(e,t,n)}function w(e,t,n){if(!M(t))throw new TypeError;return j(n)||(n=Z(n)),I(e,t,n)}function b(e,t){if(!M(e))throw new TypeError;return j(t)||(t=Z(t)),x(e,t)}function E(e,t){if(!M(e))throw new TypeError;return j(t)||(t=Z(t)),L(e,t)}function A(e,t,n){if(!M(t))throw new TypeError;j(n)||(n=Z(n));var r=S(t,n,!1);if(j(r))return!1;if(!r.delete(e))return!1;if(r.size>0)return!0;var i=d.get(t);return i.delete(n),i.size>0||d.delete(t),!0}function T(e,t){for(var n=e.length-1;n>=0;--n){var r=(0,e[n])(t);if(!j(r)&&!U(r)){if(!$(r))throw new TypeError;t=r}}return t}function k(e,t,n,r){for(var i=e.length-1;i>=0;--i){var o=(0,e[i])(t,n,r);if(!j(o)&&!U(o)){if(!M(o))throw new TypeError;r=o}}return r}function S(e,t,n){var r=d.get(e);if(j(r)){if(!n)return;r=new f,d.set(e,r)}var i=r.get(t);if(j(i)){if(!n)return;i=new f,r.set(t,i)}return i}function O(e,t,n){if(C(e,t,n))return!0;var r=ee(t);return!U(r)&&O(e,r,n)}function C(e,t,n){var r=S(t,n,!1);return!j(r)&&W(r.has(e))}function R(e,t,n){if(C(e,t,n))return I(e,t,n);var r=ee(t);return U(r)?void 0:R(e,r,n)}function I(e,t,n){var r=S(t,n,!1);if(!j(r))return r.get(e)}function P(e,t,n,r){S(n,r,!0).set(e,t)}function x(e,t){var n=L(e,t),r=ee(e);if(null===r)return n;var i=x(r,t);if(i.length<=0)return n;if(n.length<=0)return i;for(var o=new h,a=[],s=0,u=n;s<u.length;s++){var c=u[s];o.has(c)||(o.add(c),a.push(c))}for(var l=0,f=i;l<f.length;l++){c=f[l];o.has(c)||(o.add(c),a.push(c))}return a}function L(e,t){var n=[],r=S(e,t,!1);if(j(r))return n;for(var i=V(r.keys()),o=0;;){var a=Q(i);if(!a)return n.length=o,n;var s=J(a);try{n[o]=s}catch(e){try{X(i)}finally{throw e}}o++}}function B(e){if(null===e)return 1;switch(typeof e){case"undefined":return 0;case"boolean":return 2;case"string":return 3;case"symbol":return 4;case"number":return 5;case"object":return null===e?1:6;default:return 6}}function j(e){return void 0===e}function U(e){return null===e}function D(e){return"symbol"==typeof e}function M(e){return"object"==typeof e?null!==e:"function"==typeof e}function z(e,t){switch(B(e)){case 0:case 1:case 2:case 3:case 4:case 5:return e}var n=3===t?"string":5===t?"number":"default",i=Y(e,r);if(void 0!==i){var o=i.call(e,n);if(M(o))throw new TypeError;return o}return F(e,"default"===n?"number":n)}function F(e,t){if("string"===t){var n=e.toString;if(G(n))if(!M(i=n.call(e)))return i;if(G(r=e.valueOf))if(!M(i=r.call(e)))return i}else{var r;if(G(r=e.valueOf))if(!M(i=r.call(e)))return i;var i,o=e.toString;if(G(o))if(!M(i=o.call(e)))return i}throw new TypeError}function W(e){return!!e}function H(e){return""+e}function Z(e){var t=z(e,3);return D(t)?t:H(t)}function q(e){return Array.isArray?Array.isArray(e):e instanceof Object?e instanceof Array:"[object Array]"===Object.prototype.toString.call(e)}function G(e){return"function"==typeof e}function $(e){return"function"==typeof e}function K(e){switch(B(e)){case 3:case 4:return!0;default:return!1}}function Y(e,t){var n=e[t];if(null!=n){if(!G(n))throw new TypeError;return n}}function V(e){var t=Y(e,i);if(!G(t))throw new TypeError;var n=t.call(e);if(!M(n))throw new TypeError;return n}function J(e){return e.value}function Q(e){var t=e.next();return!t.done&&t}function X(e){var t=e.return;t&&t.call(e)}function ee(e){var t=Object.getPrototypeOf(e);if("function"!=typeof e||e===c)return t;if(t!==c)return t;var n=e.prototype,r=n&&Object.getPrototypeOf(n);if(null==r||r===Object.prototype)return t;var i=r.constructor;return"function"!=typeof i||i===e?t:i}function te(){var e={},t=[],n=function(){function e(e,t,n){this._index=0,this._keys=e,this._values=t,this._selector=n}return e.prototype["@@iterator"]=function(){return this},e.prototype[i]=function(){return this},e.prototype.next=function(){var e=this._index;if(e>=0&&e<this._keys.length){var n=this._selector(this._keys[e],this._values[e]);return e+1>=this._keys.length?(this._index=-1,this._keys=t,this._values=t):this._index++,{value:n,done:!1}}return{value:void 0,done:!0}},e.prototype.throw=function(e){throw this._index>=0&&(this._index=-1,this._keys=t,this._values=t),e},e.prototype.return=function(e){return this._index>=0&&(this._index=-1,this._keys=t,this._values=t),{value:e,done:!0}},e}();return function(){function t(){this._keys=[],this._values=[],this._cacheKey=e,this._cacheIndex=-2}return Object.defineProperty(t.prototype,"size",{get:function(){return this._keys.length},enumerable:!0,configurable:!0}),t.prototype.has=function(e){return this._find(e,!1)>=0},t.prototype.get=function(e){var t=this._find(e,!1);return t>=0?this._values[t]:void 0},t.prototype.set=function(e,t){var n=this._find(e,!0);return this._values[n]=t,this},t.prototype.delete=function(t){var n=this._find(t,!1);if(n>=0){for(var r=this._keys.length,i=n+1;i<r;i++)this._keys[i-1]=this._keys[i],this._values[i-1]=this._values[i];return this._keys.length--,this._values.length--,t===this._cacheKey&&(this._cacheKey=e,this._cacheIndex=-2),!0}return!1},t.prototype.clear=function(){this._keys.length=0,this._values.length=0,this._cacheKey=e,this._cacheIndex=-2},t.prototype.keys=function(){return new n(this._keys,this._values,r)},t.prototype.values=function(){return new n(this._keys,this._values,o)},t.prototype.entries=function(){return new n(this._keys,this._values,a)},t.prototype["@@iterator"]=function(){return this.entries()},t.prototype[i]=function(){return this.entries()},t.prototype._find=function(e,t){return this._cacheKey!==e&&(this._cacheIndex=this._keys.indexOf(this._cacheKey=e)),this._cacheIndex<0&&t&&(this._cacheIndex=this._keys.length,this._keys.push(e),this._values.push(void 0)),this._cacheIndex},t}();function r(e,t){return e}function o(e,t){return t}function a(e,t){return[e,t]}}function ne(){return function(){function e(){this._map=new f}return Object.defineProperty(e.prototype,"size",{get:function(){return this._map.size},enumerable:!0,configurable:!0}),e.prototype.has=function(e){return this._map.has(e)},e.prototype.add=function(e){return this._map.set(e,e),this},e.prototype.delete=function(e){return this._map.delete(e)},e.prototype.clear=function(){this._map.clear()},e.prototype.keys=function(){return this._map.keys()},e.prototype.values=function(){return this._map.values()},e.prototype.entries=function(){return this._map.entries()},e.prototype["@@iterator"]=function(){return this.keys()},e.prototype[i]=function(){return this.keys()},e}()}function re(){var e=16,n=u.create(),r=i();return function(){function e(){this._key=i()}return e.prototype.has=function(e){var t=o(e,!1);return void 0!==t&&u.has(t,this._key)},e.prototype.get=function(e){var t=o(e,!1);return void 0!==t?u.get(t,this._key):void 0},e.prototype.set=function(e,t){return o(e,!0)[this._key]=t,this},e.prototype.delete=function(e){var t=o(e,!1);return void 0!==t&&delete t[this._key]},e.prototype.clear=function(){this._key=i()},e}();function i(){var e;do{e="@@WeakMap@@"+c()}while(u.has(n,e));return n[e]=!0,e}function o(e,n){if(!t.call(e,r)){if(!n)return;Object.defineProperty(e,r,{value:u.create()})}return e[r]}function a(e,t){for(var n=0;n<t;++n)e[n]=255*Math.random()|0;return e}function s(e){return"function"==typeof Uint8Array?"undefined"!=typeof crypto?crypto.getRandomValues(new Uint8Array(e)):"undefined"!=typeof msCrypto?msCrypto.getRandomValues(new Uint8Array(e)):a(new Uint8Array(e),e):a(new Array(e),e)}function c(){var t=s(e);t[6]=79&t[6]|64,t[8]=191&t[8]|128;for(var n="",r=0;r<e;++r){var i=t[r];4!==r&&6!==r&&8!==r||(n+="-"),i<16&&(n+="0"),n+=i.toString(16).toLowerCase()}return n}}function ie(e){return e.__=void 0,delete e.__,e}e("decorate",p),e("metadata",v),e("defineMetadata",g),e("hasMetadata",_),e("hasOwnMetadata",m),e("getMetadata",y),e("getOwnMetadata",w),e("getMetadataKeys",b),e("getOwnMetadataKeys",E),e("deleteMetadata",A)}(i)}()}(nf||(nf={}));const mf=Symbol("required"),yf=Symbol("checkType"),wf=(...e)=>(t,n,r)=>{let i=Reflect.getOwnMetadata(mf,t,n)||[];i.push({parameterIndex:r,fields:e}),Reflect.defineMetadata(mf,i,t,n)},bf=(e,t,n)=>(r,i,o)=>{let a=Reflect.getOwnMetadata(yf,r,i)||[];a.push({parameterIndex:o,type:e,properties:t,key:n}),Reflect.defineMetadata(yf,a,r,i)};const Ef=(e,t,n)=>{const r=n.value,o=r.toString().match(/\(.*?\)/)[0].replace(/[()]/gi,"").replace(/\s/gi,"").split(",");return n.value=function(){const n=Reflect.getOwnMetadata(mf,e,t),a=Reflect.getOwnMetadata(yf,e,t);return a&&a.forEach((e=>{const{parameterIndex:t,type:n,properties:r,key:a}=e;let s=arguments[t],u=o[t];if(!i.isEmpty(a)){const e=null==a?void 0:a.split(".");Array.isArray(e)&&e.length>0&&e.forEach((e=>{s=s[e],u=`${u}.${e}`}))}const c=typeof s;if(!i.isUndefined(s)){if(!Ln(s,n))throw pl.wrongTypeParam(u,n,Array.isArray(s)?"array":null===s?"null":c);"object"===n&&Object.entries(r).forEach((([e,t])=>{const n=s[e];if(!i.isUndefined(n)){if(Array.isArray(t)&&!t.includes(n))throw pl.wrongTypeParam(`${u}.${e}`,`${t}`.replace(/,/g,"|"),`'${n}'`);if(!Array.isArray(t)&&!Ln(n,t))throw pl.wrongTypeParam(`${u}.${e}`,t,Array.isArray(n)?"array":null===n?"null":typeof n)}}))}})),n&&n.forEach((e=>{const{parameterIndex:t,fields:n}=e,r=arguments[t],a=o[t],s=typeof r;if(!Array.isArray(r)&&"object"===s&&n.some((e=>i.isUndefined(r[e]))))throw pl.missingParam(`${n} in ${a}`);if("object"!==s&&(t>=arguments.length||i.isUndefined(r)))throw pl.missingParam(a)})),r.apply(this,arguments)},n};var Af;class Tf{constructor(){this.events=Kn.getInstance(),Af.set(this,void 0),Gn(this,Af,this.getInstance()),this.events.addListener=(t,n,r)=>{const i=t;return this.events.addListener(e.Events[i],n,r)}}login(e){return Zn(this,void 0,void 0,(function*(){return yield qn(this,Af).login(e)}))}getLoginStatus(){return qn(this,Af).getLoginStatus()}getAccessToken(e){return Zn(this,void 0,void 0,(function*(){return yield qn(this,Af).getAccessToken(e)}))}getVersion(){return qn(this,Af).getVersion()}getSystemInfo(){return qn(this,Af).getSystemInfo()}setNavigationBarTitle(e){return Zn(this,void 0,void 0,(function*(){return qn(this,Af).setNavigationBarTitle(e)}))}setNavigationBarColor(e){return Zn(this,void 0,void 0,(function*(){return yield qn(this,Af).setNavigationBarColor(e)}))}setBackgroundColor(e){return Zn(this,void 0,void 0,(function*(){return yield qn(this,Af).setBackgroundColor(e)}))}setNavigationBarLeftButton(e){return Zn(this,void 0,void 0,(function*(){return yield qn(this,Af).setNavigationBarLeftButton(e)}))}setDeviceOrientation(e){return Zn(this,void 0,void 0,(function*(){return yield qn(this,Af).setDeviceOrientation(e)}))}setStorage(e){return Zn(this,void 0,void 0,(function*(){return yield qn(this,Af).setStorage(e)}))}getStorage(e){return Zn(this,void 0,void 0,(function*(){return yield qn(this,Af).getStorage(e)}))}getStorageInfo(e){return Zn(this,void 0,void 0,(function*(){return yield qn(this,Af).getStorageInfo(e)}))}removeStorage(e){return Zn(this,void 0,void 0,(function*(){return yield qn(this,Af).removeStorage(e)}))}clearStorage(e){return Zn(this,void 0,void 0,(function*(){return yield qn(this,Af).clearStorage(e)}))}getUserInfo(e){return Zn(this,void 0,void 0,(function*(){return yield qn(this,Af).getUserInfo(e)}))}getNetworkType(e){return Zn(this,void 0,void 0,(function*(){return yield qn(this,Af).getNetworkType(e)}))}onNetworkStatusChange(e){return Zn(this,void 0,void 0,(function*(){return yield qn(this,Af).onNetworkStatusChange(e)}))}startBeaconDiscovery(e){return Zn(this,void 0,void 0,(function*(){return yield qn(this,Af).startBeaconDiscovery(e)}))}stopBeaconDiscovery(e){return Zn(this,void 0,void 0,(function*(){return yield qn(this,Af).stopBeaconDiscovery(e)}))}getBeacons(e){return Zn(this,void 0,void 0,(function*(){return yield qn(this,Af).getBeacons(e)}))}closeApp(e){return Zn(this,void 0,void 0,(function*(){return yield qn(this,Af).closeApp(e)}))}getLocation(e){return Zn(this,void 0,void 0,(function*(){return yield qn(this,Af).getLocation(e)}))}stopBluetoothDevicesDiscovery(){return Zn(this,void 0,void 0,(function*(){return yield qn(this,Af).stopBluetoothDevicesDiscovery()}))}startBluetoothDevicesDiscovery(e){return Zn(this,void 0,void 0,(function*(){return yield qn(this,Af).startBluetoothDevicesDiscovery(e)}))}openBluetoothAdapter(){return Zn(this,void 0,void 0,(function*(){return yield qn(this,Af).openBluetoothAdapter()}))}onBluetoothDeviceFound(){return Zn(this,void 0,void 0,(function*(){return yield qn(this,Af).onBluetoothDeviceFound()}))}onBluetoothAdapterStateChange(){return Zn(this,void 0,void 0,(function*(){return yield qn(this,Af).onBluetoothAdapterStateChange()}))}getConnectedBluetoothDevices(e){return Zn(this,void 0,void 0,(function*(){return yield qn(this,Af).getConnectedBluetoothDevices(e)}))}getBluetoothDevices(){return Zn(this,void 0,void 0,(function*(){return yield qn(this,Af).getBluetoothDevices()}))}getBluetoothAdapterState(){return Zn(this,void 0,void 0,(function*(){return yield qn(this,Af).getBluetoothAdapterState()}))}closeBluetoothAdapter(){return Zn(this,void 0,void 0,(function*(){return yield qn(this,Af).closeBluetoothAdapter()}))}scanQRCode(e){return Zn(this,void 0,void 0,(function*(){return yield qn(this,Af).scanQRCode(e)}))}openProfile(e){return Zn(this,void 0,void 0,(function*(){yield qn(this,Af).openProfile(e)}))}openChat(e){return Zn(this,void 0,void 0,(function*(){yield qn(this,Af).openChat(e)}))}openPostFeed(e){return Zn(this,void 0,void 0,(function*(){const t=e.type;if("image"===t&&Bn(e.data.imageUrl))throw pl.wrongTypeParam("object.data.imageUrl","valid url","invalid");if("link"===t&&(Bn(e.data.link)||!Cn(e.data.link)))throw pl.wrongTypeParam("object.data.link","valid url","invalid");if("profile"===t){if(Bn(e.data.id))throw pl.wrongTypeParam("object.data.id","valid id","empty");if(Bn(e.data.avatar)||!Cn(e.data.avatar))throw pl.wrongTypeParam("object.data.avatar","valid url","invalid");if(Bn(e.data.displayName))throw pl.wrongTypeParam("object.data.displayName","valid displayName","empty")}return yield qn(this,Af).openPostFeed(e)}))}followOA(e){return Zn(this,void 0,void 0,(function*(){return yield qn(this,Af).followOA(e)}))}unfollowOA(e){return Zn(this,void 0,void 0,(function*(){return yield qn(this,Af).unFollowOA(e)}))}openShareSheet(e){return Zn(this,void 0,void 0,(function*(){const t=e.type;if("image"===t&&Bn(e.data.imageUrl))throw pl.wrongTypeParam("object.data.imageUrl","valid url","invalid");if("gif"===t&&(Bn(e.data.gifUrl)||!Cn(e.data.gifUrl)))throw pl.wrongTypeParam("object.data.gifUrl","valid url","invalid");if("video"===t){if(Bn(e.data.videoThumb)||!Cn(e.data.videoThumb))throw pl.wrongTypeParam("object.data.videoThumb","valid url","invalid");if(Bn(e.data.videoUrl)||!Cn(e.data.videoUrl))throw pl.wrongTypeParam("object.data.videoUrl","valid url","invalid")}else{if("link"===t&&(Bn(e.data.link)||!Cn(e.data.link)))throw pl.wrongTypeParam("object.data.link","valid url","invalid");if("oa"===t&&Bn(e.data.id))throw pl.wrongTypeParam("object.data.id","valid id","empty");if("zmp"===t){if(i.isNull(e.data.title)||i.isNull(e.data.description))throw pl.missingParam(["data.title","data.description"]);{const t=e.data.title,n={vi:"",en:""};if(i.isString(e.data.description))n.en=n.vi=e.data.description;else{if(!i.isObject(e.data.description))throw pl.wrongTypeParam("data.description","string | {vi: string, en: string}",typeof e.data.description);n.en=e.data.description.en||"",n.vi=e.data.description.vi||""}if(t.length>100||n.vi.length>400||n.en.length>400)throw pl.lengthInvalid("'title' or 'description'");e.data.description=n}}}return yield qn(this,Af).openShareSheet(e)}))}requestCameraPermission(e){return Zn(this,void 0,void 0,(function*(){return yield qn(this,Af).requestCameraPermission(e)}))}createShortcut(e){return Zn(this,void 0,void 0,(function*(){yield qn(this,Af).createShortcut(e)}))}openBioAuthentication(e){var t;return Zn(this,void 0,void 0,(function*(){return i.isUndefined(e.requireFingerprint)&&(e.requireFingerprint=!0),Bn(null===(t=e.ui)||void 0===t?void 0:t.title)&&(e.ui=Object.assign(Object.assign({},e.ui),{title:"Xác thực"})),Bn(e.ui.subTitle)&&(e.ui=Object.assign(Object.assign({},e.ui),{subTitle:"Sử dụng sinh trắc học của bạn để xác thực"})),Bn(e.ui.negativeButtonText)&&(e.ui=Object.assign(Object.assign({},e.ui),{negativeButtonText:"Đóng"})),yield qn(this,Af).openBioAuthentication(e)}))}checkStateBioAuthentication(e){return Zn(this,void 0,void 0,(function*(){return yield qn(this,Af).checkStateBioAuthentication(e)}))}sendLocation(e){return Zn(this,void 0,void 0,(function*(){yield qn(this,Af).sendLocation(e)}))}showToast(e){return Zn(this,void 0,void 0,(function*(){yield qn(this,Af).showToast(e)}))}hideKeyboard(e){return Zn(this,void 0,void 0,(function*(){yield qn(this,Af).hideKeyboard(e)}))}openPhone(e){return Zn(this,void 0,void 0,(function*(){return yield qn(this,Af).openPhone(e)}))}openSMS(e){return Zn(this,void 0,void 0,(function*(){if(!/^\+?\d+$/.test(e.phoneNumber))throw pl.wrongTypeParam("object.phoneNumber","valid phone","invalid");yield qn(this,Af).openSMS(e)}))}viewOAQr(e){return Zn(this,void 0,void 0,(function*(){(i.isUndefined(e.displayName)||i.isNull(e.displayName))&&(e.displayName=""),yield qn(this,Af).viewOAQr(e)}))}keepScreen(e){return Zn(this,void 0,void 0,(function*(){return yield qn(this,Af).keepScreen(e)}))}saveImageToPhotosAlbum(e){return Zn(this,void 0,void 0,(function*(){if(Bn(e.imageBase64Data)&&Bn(e.imageUrl))throw pl.wrongTypeParam("object.imageBase64Data | object.imageUrl","valid data","invalid");if(!Bn(e.imageUrl)&&!Cn(e.imageUrl))throw pl.wrongTypeParam("object.imageUrl","valid url","invalid");return yield qn(this,Af).saveImageToPhotosAlbum(e)}))}openMiniApp(e){return Zn(this,void 0,void 0,(function*(){if(!i.isEmpty(e.params)){const t=e.params||{};Object.keys(t).forEach((e=>{"object"==typeof t[e]&&(t[e]=JSON.stringify(t[e])),t[e]=""+encodeURIComponent(t[e])})),e.params=t}yield qn(this,Af).openMiniApp(e)}))}vibrate(e){return Zn(this,void 0,void 0,(function*(){Bn(e.type)&&(e.type="oneShot"),Bn(e.milliseconds)&&(e.milliseconds=500),yield qn(this,Af).vibrate(e)}))}openWebview(e){return Zn(this,void 0,void 0,(function*(){yield qn(this,Af).openWebview(e)}))}getRouteParams(){return qn(this,Af).getRouteParams()}getAppInfo(e){return qn(this,Af).getAppInfo()}sendDataToPreviousMiniApp(e){return qn(this,Af).sendDataToPreviousMiniApp(e)}onCallbackData(e){return Zn(this,void 0,void 0,(function*(){return yield qn(this,Af).onCallbackData(e)}))}getPhoneNumber(e){return Zn(this,void 0,void 0,(function*(){return yield qn(this,Af).getPhoneNumber()}))}openProfilePicker(e){if(i.isUndefined(e.maxProfile)||e.maxProfile<1)e.maxProfile=1;else if(e.maxProfile>10)throw pl.badRequest("maxProfile must be in between 1 and 10");return qn(this,Af).openProfilePicker(e)}}Af=new WeakMap,Wn([ll],Tf.prototype,"login",null),Wn([fl],Tf.prototype,"getLoginStatus",null),Wn([ll],Tf.prototype,"getAccessToken",null),Wn([fl],Tf.prototype,"getVersion",null),Wn([fl],Tf.prototype,"getSystemInfo",null),Wn([ll,Ef,Hn(0,bf("object",{title:"string"})),Hn(0,wf("title"))],Tf.prototype,"setNavigationBarTitle",null),Wn([ll,Ef,Hn(0,bf("object",{color:"string",textColor:["white","black"],statusBarColor:"string"})),Hn(0,wf("color"))],Tf.prototype,"setNavigationBarColor",null),Wn([ll,Ef,Hn(0,bf("object",{backgroundColor:"string",textColor:["white","black"]})),Hn(0,wf("backgroundColor"))],Tf.prototype,"setBackgroundColor",null),Wn([ll,Ef,Hn(0,bf("object",{type:["none","back","home","both"]})),Hn(0,wf("type"))],Tf.prototype,"setNavigationBarLeftButton",null),Wn([ll,Ef,Hn(0,bf("object",{rotate:["auto","portrait","landscape"]})),Hn(0,wf("rotate"))],Tf.prototype,"setDeviceOrientation",null),Wn([ll,Ef,Hn(0,bf("object",{data:"object"})),Hn(0,wf("data"))],Tf.prototype,"setStorage",null),Wn([ll,Ef,Hn(0,bf("object",{keys:"array<string>"})),Hn(0,wf("keys"))],Tf.prototype,"getStorage",null),Wn([ll],Tf.prototype,"getStorageInfo",null),Wn([ll,Ef,Hn(0,bf("object",{keys:"array<string>"})),Hn(0,wf("keys"))],Tf.prototype,"removeStorage",null),Wn([ll],Tf.prototype,"clearStorage",null),Wn([ll,Ef,Hn(0,bf("object",{avatarType:["small","normal","large"]}))],Tf.prototype,"getUserInfo",null),Wn([ll],Tf.prototype,"getNetworkType",null),Wn([ll],Tf.prototype,"onNetworkStatusChange",null),Wn([ll],Tf.prototype,"startBeaconDiscovery",null),Wn([ll],Tf.prototype,"stopBeaconDiscovery",null),Wn([ll],Tf.prototype,"getBeacons",null),Wn([ll],Tf.prototype,"closeApp",null),Wn([ll],Tf.prototype,"getLocation",null),Wn([ll],Tf.prototype,"stopBluetoothDevicesDiscovery",null),Wn([ll],Tf.prototype,"startBluetoothDevicesDiscovery",null),Wn([ll],Tf.prototype,"openBluetoothAdapter",null),Wn([ll],Tf.prototype,"onBluetoothDeviceFound",null),Wn([ll],Tf.prototype,"onBluetoothAdapterStateChange",null),Wn([ll],Tf.prototype,"getConnectedBluetoothDevices",null),Wn([ll],Tf.prototype,"getBluetoothDevices",null),Wn([ll],Tf.prototype,"getBluetoothAdapterState",null),Wn([ll],Tf.prototype,"closeBluetoothAdapter",null),Wn([ll],Tf.prototype,"scanQRCode",null),Wn([ll,Ef,Hn(0,bf("object",{type:["user","oa","aliasOA"],id:"string"})),Hn(0,wf("type","id"))],Tf.prototype,"openProfile",null),Wn([ll,Ef,Hn(0,bf("object",{type:["user","oa"],id:"string"})),Hn(0,wf("type","id"))],Tf.prototype,"openChat",null),Wn([ll,Ef,Hn(0,bf("object",{type:["image","link","profile"],data:"object"})),Hn(0,bf("object",{imageUrl:"string",link:"string",title:"string",thumb:"string",description:"string",avatar:"string",id:"string",displayName:"string"},"data")),Hn(0,wf("type","data"))],Tf.prototype,"openPostFeed",null),Wn([ll,Ef,Hn(0,bf("object",{id:"string",showDialogConfirm:"boolean"})),Hn(0,wf("id"))],Tf.prototype,"followOA",null),Wn([ll,Ef,Hn(0,bf("object",{id:"string"})),Hn(0,wf("id"))],Tf.prototype,"unfollowOA",null),Wn([ll,Ef,Hn(0,bf("object",{type:["image","gif","video","link","oa","zmp"],data:"object"})),Hn(0,bf("object",{imageUrl:"string",gifUrl:"string",width:"number",height:"number",videoThumb:"string",videoUrl:"string",link:"string",chatOnly:"boolean",id:"string",title:"string",thumbnail:"url",path:"string"},"data")),Hn(0,wf("type","data"))],Tf.prototype,"openShareSheet",null),Wn([ll],Tf.prototype,"requestCameraPermission",null),Wn([ll],Tf.prototype,"createShortcut",null),Wn([ll,Ef,Hn(0,wf("secretData")),Hn(0,bf("object",{secretData:"string",ui:"object",requireFingerprint:"boolean"})),Hn(0,bf("object",{title:"string",subTitle:"string",negativeButtonText:"string"},"ui"))],Tf.prototype,"openBioAuthentication",null),Wn([ll],Tf.prototype,"checkStateBioAuthentication",null),Wn([ll,Ef,Hn(0,wf("toUserId"))],Tf.prototype,"sendLocation",null),Wn([ll,Ef,Hn(0,wf("message"))],Tf.prototype,"showToast",null),Wn([ll],Tf.prototype,"hideKeyboard",null),Wn([ll,Ef,Hn(0,wf("phoneNumber")),Hn(0,bf("object",{phoneNumber:"string"}))],Tf.prototype,"openPhone",null),Wn([ll,Ef,Hn(0,wf("content","phoneNumber")),Hn(0,bf("object",{content:"string",phoneNumber:"string"}))],Tf.prototype,"openSMS",null),Wn([ll,Ef,Hn(0,wf("id")),Hn(0,bf("object",{id:"string",displayName:"string"}))],Tf.prototype,"viewOAQr",null),Wn([ll],Tf.prototype,"keepScreen",null),Wn([ll,Ef,Hn(0,bf("object",{imageBase64Data:"string",imageUrl:"string",type:"string"}))],Tf.prototype,"saveImageToPhotosAlbum",null),Wn([ll,Ef,Hn(0,wf("appId")),Hn(0,bf("object",{appId:"string",params:"object"}))],Tf.prototype,"openMiniApp",null),Wn([ll,Ef,Hn(0,bf("object",{type:["oneShot"],milliseconds:"number"}))],Tf.prototype,"vibrate",null),Wn([ll,Ef,Hn(0,wf("url")),Hn(0,bf("object",{url:"string"}))],Tf.prototype,"openWebview",null),Wn([fl],Tf.prototype,"getRouteParams",null),Wn([ll],Tf.prototype,"getAppInfo",null),Wn([ll],Tf.prototype,"sendDataToPreviousMiniApp",null),Wn([ll],Tf.prototype,"onCallbackData",null),Wn([ll],Tf.prototype,"getPhoneNumber",null),Wn([ll,Ef,Hn(0,bf("object",{maxProfile:"number"}))],Tf.prototype,"openProfilePicker",null);class kf extends Tf{getInstance(){return gf.getInstance()}}class Sf extends Tf{getInstance(){return new _f}}const Of=Nn();e.default=void 0,window.onJSCall=e=>function(t){al.getInstance().onJSCall(e,t)},window.onMultiJSCall=e=>function(t){al.getInstance().onMultiJSCall(e,t)},window.zaloJSV2={zalo_h5_event_handler:function(e,t,n){al.getInstance().nativeEventHandler(e,t,n)}},Of.isZalo?e.default=new kf:e.default=new Sf,window.ZaloMiniAppSDK=e.default,e.SDKCreator=Tf,e.default=e.default,Object.defineProperty(e,"__esModule",{value:!0})}));
18
+ var Di=2147483647,Mi=/[^\x20-\x7E]/,zi=/[\x2E\u3002\uFF0E\uFF61]/g,Fi={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},Wi=Math.floor,Hi=String.fromCharCode;function Zi(e){throw new RangeError(Fi[e])}function qi(e,t){return e+22+75*(e<26)-((0!=t)<<5)}function Gi(e,t,n){var r=0;for(e=n?Wi(e/700):e>>1,e+=Wi(e/t);e>455;r+=36)e=Wi(e/35);return Wi(r+36*e/(e+38))}function $i(e){return function(e,t){var n=e.split("@"),r="";n.length>1&&(r=n[0]+"@",e=n[1]);var i=function(e,t){for(var n=e.length,r=[];n--;)r[n]=t(e[n]);return r}((e=e.replace(zi,".")).split("."),t).join(".");return r+i}(e,(function(e){return Mi.test(e)?"xn--"+function(e){var t,n,r,i,o,a,s,u,c,l,f,h,d,p,v,g=[];for(h=(e=function(e){for(var t,n,r=[],i=0,o=e.length;i<o;)(t=e.charCodeAt(i++))>=55296&&t<=56319&&i<o?56320==(64512&(n=e.charCodeAt(i++)))?r.push(((1023&t)<<10)+(1023&n)+65536):(r.push(t),i--):r.push(t);return r}(e)).length,t=128,n=0,o=72,a=0;a<h;++a)(f=e[a])<128&&g.push(Hi(f));for(r=i=g.length,i&&g.push("-");r<h;){for(s=Di,a=0;a<h;++a)(f=e[a])>=t&&f<s&&(s=f);for(s-t>Wi((Di-n)/(d=r+1))&&Zi("overflow"),n+=(s-t)*d,t=s,a=0;a<h;++a)if((f=e[a])<t&&++n>Di&&Zi("overflow"),f==t){for(u=n,c=36;!(u<(l=c<=o?1:c>=o+26?26:c-o));c+=36)v=u-l,p=36-l,g.push(Hi(qi(l+v%p,0))),u=Wi(v/p);g.push(Hi(qi(u,0))),o=Gi(n,d,r==i),n=0,++r}++n,++t}return g.join("")}(e):e}))}function Ki(e,t){return Object.prototype.hasOwnProperty.call(e,t)}var Yi=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)};function Vi(e){switch(typeof e){case"string":return e;case"boolean":return e?"true":"false";case"number":return isFinite(e)?e:"";default:return""}}function Ji(e,t){if(e.map)return e.map(t);for(var n=[],r=0;r<e.length;r++)n.push(t(e[r],r));return n}var Qi=Object.keys||function(e){var t=[];for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.push(n);return t};function Xi(e,t,n,r){t=t||"&",n=n||"=";var i={};if("string"!=typeof e||0===e.length)return i;var o=/\+/g;e=e.split(t);var a=1e3;r&&"number"==typeof r.maxKeys&&(a=r.maxKeys);var s=e.length;a>0&&s>a&&(s=a);for(var u=0;u<s;++u){var c,l,f,h,d=e[u].replace(o,"%20"),p=d.indexOf(n);p>=0?(c=d.substr(0,p),l=d.substr(p+1)):(c=d,l=""),f=decodeURIComponent(c),h=decodeURIComponent(l),Ki(i,f)?Yi(i[f])?i[f].push(h):i[f]=[i[f],h]:i[f]=h}return i}var eo={parse:vo,resolve:yo,resolveObject:wo,format:_o,Url:to};function to(){this.protocol=null,this.slashes=null,this.auth=null,this.host=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.query=null,this.pathname=null,this.path=null,this.href=null}var no=/^([a-z0-9.+-]+:)/i,ro=/:[0-9]*$/,io=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,oo=["{","}","|","\\","^","`"].concat(["<",">",'"',"`"," ","\r","\n","\t"]),ao=["'"].concat(oo),so=["%","/","?",";","#"].concat(ao),uo=["/","?","#"],co=/^[+a-z0-9A-Z_-]{0,63}$/,lo=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,fo={javascript:!0,"javascript:":!0},ho={javascript:!0,"javascript:":!0},po={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0};function vo(e,t,n){if(e&&ht(e)&&e instanceof to)return e;var r=new to;return r.parse(e,t,n),r}function go(e,t,n,r){if(!ut(t))throw new TypeError("Parameter 'url' must be a string, not "+typeof t);var i=t.indexOf("?"),o=-1!==i&&i<t.indexOf("#")?"?":"#",a=t.split(o);a[0]=a[0].replace(/\\/g,"/");var s=t=a.join(o);if(s=s.trim(),!r&&1===t.split("#").length){var u=io.exec(s);if(u)return e.path=s,e.href=s,e.pathname=u[1],u[2]?(e.search=u[2],e.query=n?Xi(e.search.substr(1)):e.search.substr(1)):n&&(e.search="",e.query={}),e}var c,l,f,h,d=no.exec(s);if(d){var p=(d=d[0]).toLowerCase();e.protocol=p,s=s.substr(d.length)}if(r||d||s.match(/^\/\/[^@\/]+@[^@\/]+/)){var v="//"===s.substr(0,2);!v||d&&ho[d]||(s=s.substr(2),e.slashes=!0)}if(!ho[d]&&(v||d&&!po[d])){var g,_,m=-1;for(c=0;c<uo.length;c++)-1!==(l=s.indexOf(uo[c]))&&(-1===m||l<m)&&(m=l);for(-1!==(_=-1===m?s.lastIndexOf("@"):s.lastIndexOf("@",m))&&(g=s.slice(0,_),s=s.slice(_+1),e.auth=decodeURIComponent(g)),m=-1,c=0;c<so.length;c++)-1!==(l=s.indexOf(so[c]))&&(-1===m||l<m)&&(m=l);-1===m&&(m=s.length),e.host=s.slice(0,m),s=s.slice(m),bo(e),e.hostname=e.hostname||"";var y="["===e.hostname[0]&&"]"===e.hostname[e.hostname.length-1];if(!y){var w=e.hostname.split(/\./);for(c=0,f=w.length;c<f;c++){var b=w[c];if(b&&!b.match(co)){for(var E="",A=0,T=b.length;A<T;A++)b.charCodeAt(A)>127?E+="x":E+=b[A];if(!E.match(co)){var k=w.slice(0,c),S=w.slice(c+1),O=b.match(lo);O&&(k.push(O[1]),S.unshift(O[2])),S.length&&(s="/"+S.join(".")+s),e.hostname=k.join(".");break}}}}e.hostname.length>255?e.hostname="":e.hostname=e.hostname.toLowerCase(),y||(e.hostname=$i(e.hostname)),h=e.port?":"+e.port:"";var C=e.hostname||"";e.host=C+h,e.href+=e.host,y&&(e.hostname=e.hostname.substr(1,e.hostname.length-2),"/"!==s[0]&&(s="/"+s))}if(!fo[p])for(c=0,f=ao.length;c<f;c++){var R=ao[c];if(-1!==s.indexOf(R)){var N=encodeURIComponent(R);N===R&&(N=escape(R)),s=s.split(R).join(N)}}var I=s.indexOf("#");-1!==I&&(e.hash=s.substr(I),s=s.slice(0,I));var P=s.indexOf("?");if(-1!==P?(e.search=s.substr(P),e.query=s.substr(P+1),n&&(e.query=Xi(e.query)),s=s.slice(0,P)):n&&(e.search="",e.query={}),s&&(e.pathname=s),po[p]&&e.hostname&&!e.pathname&&(e.pathname="/"),e.pathname||e.search){h=e.pathname||"";var x=e.search||"";e.path=h+x}return e.href=mo(e),e}function _o(e){return ut(e)&&(e=go({},e)),mo(e)}function mo(e){var t=e.auth||"";t&&(t=(t=encodeURIComponent(t)).replace(/%3A/i,":"),t+="@");var n=e.protocol||"",r=e.pathname||"",i=e.hash||"",o=!1,a="";e.host?o=t+e.host:e.hostname&&(o=t+(-1===e.hostname.indexOf(":")?e.hostname:"["+this.hostname+"]"),e.port&&(o+=":"+e.port)),e.query&&ht(e.query)&&Object.keys(e.query).length&&(a=function(e,t,n,r){return t=t||"&",n=n||"=",null===e&&(e=void 0),"object"==typeof e?Ji(Qi(e),(function(r){var i=encodeURIComponent(Vi(r))+n;return Yi(e[r])?Ji(e[r],(function(e){return i+encodeURIComponent(Vi(e))})).join(t):i+encodeURIComponent(Vi(e[r]))})).join(t):r?encodeURIComponent(Vi(r))+n+encodeURIComponent(Vi(e)):""}(e.query));var s=e.search||a&&"?"+a||"";return n&&":"!==n.substr(-1)&&(n+=":"),e.slashes||(!n||po[n])&&!1!==o?(o="//"+(o||""),r&&"/"!==r.charAt(0)&&(r="/"+r)):o||(o=""),i&&"#"!==i.charAt(0)&&(i="#"+i),s&&"?"!==s.charAt(0)&&(s="?"+s),n+o+(r=r.replace(/[?#]/g,(function(e){return encodeURIComponent(e)})))+(s=s.replace("#","%23"))+i}function yo(e,t){return vo(e,!1,!0).resolve(t)}function wo(e,t){return e?vo(e,!1,!0).resolveObject(t):t}function bo(e){var t=e.host,n=ro.exec(t);n&&(":"!==(n=n[0])&&(e.port=n.substr(1)),t=t.substr(0,t.length-n.length)),t&&(e.hostname=t)}to.prototype.parse=function(e,t,n){return go(this,e,t,n)},to.prototype.format=function(){return mo(this)},to.prototype.resolve=function(e){return this.resolveObject(vo(e,!1,!0)).format()},to.prototype.resolveObject=function(e){if(ut(e)){var t=new to;t.parse(e,!1,!0),e=t}for(var n,r=new to,i=Object.keys(this),o=0;o<i.length;o++){var a=i[o];r[a]=this[a]}if(r.hash=e.hash,""===e.href)return r.href=r.format(),r;if(e.slashes&&!e.protocol){for(var s=Object.keys(e),u=0;u<s.length;u++){var c=s[u];"protocol"!==c&&(r[c]=e[c])}return po[r.protocol]&&r.hostname&&!r.pathname&&(r.path=r.pathname="/"),r.href=r.format(),r}if(e.protocol&&e.protocol!==r.protocol){if(!po[e.protocol]){for(var l=Object.keys(e),f=0;f<l.length;f++){var h=l[f];r[h]=e[h]}return r.href=r.format(),r}if(r.protocol=e.protocol,e.host||ho[e.protocol])r.pathname=e.pathname;else{for(n=(e.pathname||"").split("/");n.length&&!(e.host=n.shift()););e.host||(e.host=""),e.hostname||(e.hostname=""),""!==n[0]&&n.unshift(""),n.length<2&&n.unshift(""),r.pathname=n.join("/")}if(r.search=e.search,r.query=e.query,r.host=e.host||"",r.auth=e.auth,r.hostname=e.hostname||e.host,r.port=e.port,r.pathname||r.search){var d=r.pathname||"",p=r.search||"";r.path=d+p}return r.slashes=r.slashes||e.slashes,r.href=r.format(),r}var v,g=r.pathname&&"/"===r.pathname.charAt(0),_=e.host||e.pathname&&"/"===e.pathname.charAt(0),m=_||g||r.host&&e.pathname,y=m,w=r.pathname&&r.pathname.split("/")||[],b=r.protocol&&!po[r.protocol];if(n=e.pathname&&e.pathname.split("/")||[],b&&(r.hostname="",r.port=null,r.host&&(""===w[0]?w[0]=r.host:w.unshift(r.host)),r.host="",e.protocol&&(e.hostname=null,e.port=null,e.host&&(""===n[0]?n[0]=e.host:n.unshift(e.host)),e.host=null),m=m&&(""===n[0]||""===w[0])),_)r.host=e.host||""===e.host?e.host:r.host,r.hostname=e.hostname||""===e.hostname?e.hostname:r.hostname,r.search=e.search,r.query=e.query,w=n;else if(n.length)w||(w=[]),w.pop(),w=w.concat(n),r.search=e.search,r.query=e.query;else if(!at(e.search))return b&&(r.hostname=r.host=w.shift(),(v=!!(r.host&&r.host.indexOf("@")>0)&&r.host.split("@"))&&(r.auth=v.shift(),r.host=r.hostname=v.shift())),r.search=e.search,r.query=e.query,ot(r.pathname)&&ot(r.search)||(r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")),r.href=r.format(),r;if(!w.length)return r.pathname=null,r.search?r.path="/"+r.search:r.path=null,r.href=r.format(),r;for(var E=w.slice(-1)[0],A=(r.host||e.host||w.length>1)&&("."===E||".."===E)||""===E,T=0,k=w.length;k>=0;k--)"."===(E=w[k])?w.splice(k,1):".."===E?(w.splice(k,1),T++):T&&(w.splice(k,1),T--);if(!m&&!y)for(;T--;T)w.unshift("..");!m||""===w[0]||w[0]&&"/"===w[0].charAt(0)||w.unshift(""),A&&"/"!==w.join("/").substr(-1)&&w.push("");var S=""===w[0]||w[0]&&"/"===w[0].charAt(0);return b&&(r.hostname=r.host=S?"":w.length?w.shift():"",(v=!!(r.host&&r.host.indexOf("@")>0)&&r.host.split("@"))&&(r.auth=v.shift(),r.host=r.hostname=v.shift())),(m=m||r.host&&w.length)&&!S&&w.unshift(""),w.length?r.pathname=w.join("/"):(r.pathname=null,r.path=null),ot(r.pathname)&&ot(r.search)||(r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")),r.auth=e.auth||r.auth,r.slashes=r.slashes||e.slashes,r.href=r.format(),r},to.prototype.parseHost=function(){return bo(this)};var Eo=Object.freeze({__proto__:null,parse:vo,resolve:yo,resolveObject:wo,format:_o,default:eo,Url:to});function Ao(e,t){"string"==typeof e&&(e=vo(e));var n=-1===o.location.protocol.search(/^https?:$/)?"http:":"",r=e.protocol||n,i=e.hostname||e.host,a=e.port,s=e.path||"/";i&&-1!==i.indexOf(":")&&(i="["+i+"]"),e.url=(i?r+"//"+i:"")+(a?":"+a:"")+s,e.method=(e.method||"GET").toUpperCase(),e.headers=e.headers||{};var u=new ji(e);return t&&u.on("response",t),u}function To(e,t){var n=Ao(e,t);return n.end(),n}function ko(){}ko.defaultMaxSockets=4;var So=["CHECKOUT","CONNECT","COPY","DELETE","GET","HEAD","LOCK","M-SEARCH","MERGE","MKACTIVITY","MKCOL","MOVE","NOTIFY","OPTIONS","PATCH","POST","PROPFIND","PROPPATCH","PURGE","PUT","REPORT","SEARCH","SUBSCRIBE","TRACE","UNLOCK","UNSUBSCRIBE"],Oo={100:"Continue",101:"Switching Protocols",102:"Processing",200:"OK",201:"Created",202:"Accepted",203:"Non-Authoritative Information",204:"No Content",205:"Reset Content",206:"Partial Content",207:"Multi-Status",300:"Multiple Choices",301:"Moved Permanently",302:"Moved Temporarily",303:"See Other",304:"Not Modified",305:"Use Proxy",307:"Temporary Redirect",400:"Bad Request",401:"Unauthorized",402:"Payment Required",403:"Forbidden",404:"Not Found",405:"Method Not Allowed",406:"Not Acceptable",407:"Proxy Authentication Required",408:"Request Time-out",409:"Conflict",410:"Gone",411:"Length Required",412:"Precondition Failed",413:"Request Entity Too Large",414:"Request-URI Too Large",415:"Unsupported Media Type",416:"Requested Range Not Satisfiable",417:"Expectation Failed",418:"I'm a teapot",422:"Unprocessable Entity",423:"Locked",424:"Failed Dependency",425:"Unordered Collection",426:"Upgrade Required",428:"Precondition Required",429:"Too Many Requests",431:"Request Header Fields Too Large",500:"Internal Server Error",501:"Not Implemented",502:"Bad Gateway",503:"Service Unavailable",504:"Gateway Time-out",505:"HTTP Version Not Supported",506:"Variant Also Negotiates",507:"Insufficient Storage",509:"Bandwidth Limit Exceeded",510:"Not Extended",511:"Network Authentication Required"},Co={request:Ao,get:To,Agent:ko,METHODS:So,STATUS_CODES:Oo},Ro=Object.freeze({__proto__:null,request:Ao,get:To,Agent:ko,METHODS:So,STATUS_CODES:Oo,default:Co});function No(e,t){if(e===t)return 0;for(var n=e.length,r=t.length,i=0,o=Math.min(n,r);i<o;++i)if(e[i]!==t[i]){n=e[i],r=t[i];break}return n<r?-1:r<n?1:0}var Io,Po=Object.prototype.hasOwnProperty,xo=Object.keys||function(e){var t=[];for(var n in e)Po.call(e,n)&&t.push(n);return t},Lo=Array.prototype.slice;function Bo(){return void 0!==Io?Io:Io="foo"===function(){}.name}function jo(e){return Object.prototype.toString.call(e)}function Uo(e){return!We(e)&&("function"==typeof o.ArrayBuffer&&("function"==typeof ArrayBuffer.isView?ArrayBuffer.isView(e):!!e&&(e instanceof DataView||!!(e.buffer&&e.buffer instanceof ArrayBuffer))))}function Do(e,t){e||Zo(e,!0,t,"==",qo)}var Mo=/\s*function\s+([^\(\s]*)\s*/;function zo(e){if(vt(e)){if(Bo())return e.name;var t=e.toString().match(Mo);return t&&t[1]}}function Fo(e){this.name="AssertionError",this.actual=e.actual,this.expected=e.expected,this.operator=e.operator,e.message?(this.message=e.message,this.generatedMessage=!1):(this.message=function(e){return Wo(Ho(e.actual),128)+" "+e.operator+" "+Wo(Ho(e.expected),128)}(this),this.generatedMessage=!0);var t=e.stackStartFunction||Zo;if(Error.captureStackTrace)Error.captureStackTrace(this,t);else{var n=new Error;if(n.stack){var r=n.stack,i=zo(t),o=r.indexOf("\n"+i);if(o>=0){var a=r.indexOf("\n",o+1);r=r.substring(a+1)}this.stack=r}}}function Wo(e,t){return"string"==typeof e?e.length<t?e:e.slice(0,t):e}function Ho(e){if(Bo()||!vt(e))return Je(e);var t=zo(e);return"[Function"+(t?": "+t:"")+"]"}function Zo(e,t,n,r,i){throw new Fo({message:n,actual:e,expected:t,operator:r,stackStartFunction:i})}function qo(e,t){e||Zo(e,!0,t,"==",qo)}function Go(e,t,n){e!=t&&Zo(e,t,n,"==",Go)}function $o(e,t,n){e==t&&Zo(e,t,n,"!=",$o)}function Ko(e,t,n){Vo(e,t,!1)||Zo(e,t,n,"deepEqual",Ko)}function Yo(e,t,n){Vo(e,t,!0)||Zo(e,t,n,"deepStrictEqual",Yo)}function Vo(e,t,n,r){if(e===t)return!0;if(We(e)&&We(t))return 0===No(e,t);if(dt(e)&&dt(t))return e.getTime()===t.getTime();if(ft(e)&&ft(t))return e.source===t.source&&e.global===t.global&&e.multiline===t.multiline&&e.lastIndex===t.lastIndex&&e.ignoreCase===t.ignoreCase;if(null!==e&&"object"==typeof e||null!==t&&"object"==typeof t){if(Uo(e)&&Uo(t)&&jo(e)===jo(t)&&!(e instanceof Float32Array||e instanceof Float64Array))return 0===No(new Uint8Array(e.buffer),new Uint8Array(t.buffer));if(We(e)!==We(t))return!1;var i=(r=r||{actual:[],expected:[]}).actual.indexOf(e);return-1!==i&&i===r.expected.indexOf(t)||(r.actual.push(e),r.expected.push(t),function(e,t,n,r){if(null==e||null==t)return!1;if(gt(e)||gt(t))return e===t;if(n&&Object.getPrototypeOf(e)!==Object.getPrototypeOf(t))return!1;var i=Jo(e),o=Jo(t);if(i&&!o||!i&&o)return!1;if(i)return Vo(e=Lo.call(e),t=Lo.call(t),n);var a,s,u=xo(e),c=xo(t);if(u.length!==c.length)return!1;for(u.sort(),c.sort(),s=u.length-1;s>=0;s--)if(u[s]!==c[s])return!1;for(s=u.length-1;s>=0;s--)if(!Vo(e[a=u[s]],t[a],n,r))return!1;return!0}(e,t,n,r))}return n?e===t:e==t}function Jo(e){return"[object Arguments]"==Object.prototype.toString.call(e)}function Qo(e,t,n){Vo(e,t,!1)&&Zo(e,t,n,"notDeepEqual",Qo)}function Xo(e,t,n){Vo(e,t,!0)&&Zo(e,t,n,"notDeepStrictEqual",Xo)}function ea(e,t,n){e!==t&&Zo(e,t,n,"===",ea)}function ta(e,t,n){e===t&&Zo(e,t,n,"!==",ta)}function na(e,t){if(!e||!t)return!1;if("[object RegExp]"==Object.prototype.toString.call(t))return t.test(e);try{if(e instanceof t)return!0}catch(e){}return!Error.isPrototypeOf(t)&&!0===t.call({},e)}function ra(e,t,n,r){var i;if("function"!=typeof t)throw new TypeError('"block" argument must be a function');"string"==typeof n&&(r=n,n=null),i=function(e){var t;try{e()}catch(e){t=e}return t}(t),r=(n&&n.name?" ("+n.name+").":".")+(r?" "+r:"."),e&&!i&&Zo(i,n,"Missing expected exception"+r);var o="string"==typeof r,a=!e&&i&&!n;if((!e&&pt(i)&&o&&na(i,n)||a)&&Zo(i,n,"Got unwanted exception"+r),e&&i&&n&&!na(i,n)||!e&&i)throw i}function ia(e,t,n){ra(!0,e,t,n)}function oa(e,t,n){ra(!1,e,t,n)}function aa(e){if(e)throw e}Do.AssertionError=Fo,Ze(Fo,Error),Do.fail=Zo,Do.ok=qo,Do.equal=Go,Do.notEqual=$o,Do.deepEqual=Ko,Do.deepStrictEqual=Yo,Do.notDeepEqual=Qo,Do.notDeepStrictEqual=Xo,Do.strictEqual=ea,Do.notStrictEqual=ta,Do.throws=ia,Do.doesNotThrow=oa,Do.ifError=aa;var sa,ua=Object.freeze({__proto__:null,default:Do,AssertionError:Fo,fail:Zo,ok:qo,assert:qo,equal:Go,notEqual:$o,deepEqual:Ko,deepStrictEqual:Yo,notDeepEqual:Qo,notDeepStrictEqual:Xo,strictEqual:ea,notStrictEqual:ta,throws:ia,doesNotThrow:oa,ifError:aa}),ca=function(){if(!sa)try{sa=cn("follow-redirects")}catch(e){sa=function(){}}sa.apply(null,arguments)},la=r(Eo),fa=r(Ro),ha=r(ua),da=la.URL,pa=Pi.Writable,va=["abort","aborted","connect","error","socket","timeout"],ga=Object.create(null);va.forEach((function(e){ga[e]=function(t,n,r){this._redirectable.emit(e,t,n,r)}}));var _a=Sa("ERR_FR_REDIRECTION_FAILURE",""),ma=Sa("ERR_FR_TOO_MANY_REDIRECTS","Maximum number of redirects exceeded"),ya=Sa("ERR_FR_MAX_BODY_LENGTH_EXCEEDED","Request body larger than maxBodyLength limit"),wa=Sa("ERR_STREAM_WRITE_AFTER_END","write after end");function ba(e,t){pa.call(this),this._sanitizeOptions(e),this._options=e,this._ended=!1,this._ending=!1,this._redirectCount=0,this._redirects=[],this._requestBodyLength=0,this._requestBodyBuffers=[],t&&this.on("response",t);var n=this;this._onNativeResponse=function(e){n._processResponse(e)},this._performRequest()}function Ea(e){var t={maxRedirects:21,maxBodyLength:10485760},n={};return Object.keys(e).forEach((function(r){var i=r+":",o=n[i]=e[r],a=t[r]=Object.create(o);Object.defineProperties(a,{request:{value:function(e,r,o){if("string"==typeof e){var a=e;try{e=Ta(new da(a))}catch(t){e=la.parse(a)}}else da&&e instanceof da?e=Ta(e):(o=r,r=e,e={protocol:i});return"function"==typeof r&&(o=r,r=null),(r=Object.assign({maxRedirects:t.maxRedirects,maxBodyLength:t.maxBodyLength},e,r)).nativeProtocols=n,ha.equal(r.protocol,i,"protocol mismatch"),ca("options",r),new ba(r,o)},configurable:!0,enumerable:!0,writable:!0},get:{value:function(e,t,n){var r=a.request(e,t,n);return r.end(),r},configurable:!0,enumerable:!0,writable:!0}})})),t}function Aa(){}function Ta(e){var t={protocol:e.protocol,hostname:e.hostname.startsWith("[")?e.hostname.slice(1,-1):e.hostname,hash:e.hash,search:e.search,pathname:e.pathname,path:e.pathname+e.search,href:e.href};return""!==e.port&&(t.port=Number(e.port)),t}function ka(e,t){var n;for(var r in t)e.test(r)&&(n=t[r],delete t[r]);return n}function Sa(e,t){function n(e){Error.captureStackTrace(this,this.constructor),this.message=e||t}return n.prototype=new Error,n.prototype.constructor=n,n.prototype.name="Error ["+e+"]",n.prototype.code=e,n}function Oa(e){for(var t=0;t<va.length;t++)e.removeListener(va[t],ga[va[t]]);e.on("error",Aa),e.abort()}ba.prototype=Object.create(pa.prototype),ba.prototype.abort=function(){Oa(this._currentRequest),this.emit("abort")},ba.prototype.write=function(e,t,n){if(this._ending)throw new wa;if(!("string"==typeof e||"object"==typeof e&&"length"in e))throw new TypeError("data should be a string, Buffer or Uint8Array");"function"==typeof t&&(n=t,t=null),0!==e.length?this._requestBodyLength+e.length<=this._options.maxBodyLength?(this._requestBodyLength+=e.length,this._requestBodyBuffers.push({data:e,encoding:t}),this._currentRequest.write(e,t,n)):(this.emit("error",new ya),this.abort()):n&&n()},ba.prototype.end=function(e,t,n){if("function"==typeof e?(n=e,e=t=null):"function"==typeof t&&(n=t,t=null),e){var r=this,i=this._currentRequest;this.write(e,t,(function(){r._ended=!0,i.end(null,null,n)})),this._ending=!0}else this._ended=this._ending=!0,this._currentRequest.end(null,null,n)},ba.prototype.setHeader=function(e,t){this._options.headers[e]=t,this._currentRequest.setHeader(e,t)},ba.prototype.removeHeader=function(e){delete this._options.headers[e],this._currentRequest.removeHeader(e)},ba.prototype.setTimeout=function(e,t){var n=this;function r(t){t.setTimeout(e),t.removeListener("timeout",t.destroy),t.addListener("timeout",t.destroy)}function i(t){n._timeout&&clearTimeout(n._timeout),n._timeout=setTimeout((function(){n.emit("timeout"),o()}),e),r(t)}function o(){clearTimeout(this._timeout),t&&n.removeListener("timeout",t),this.socket||n._currentRequest.removeListener("socket",i)}return t&&this.on("timeout",t),this.socket?i(this.socket):this._currentRequest.once("socket",i),this.on("socket",r),this.once("response",o),this.once("error",o),this},["flushHeaders","getHeader","setNoDelay","setSocketKeepAlive"].forEach((function(e){ba.prototype[e]=function(t,n){return this._currentRequest[e](t,n)}})),["aborted","connection","socket"].forEach((function(e){Object.defineProperty(ba.prototype,e,{get:function(){return this._currentRequest[e]}})})),ba.prototype._sanitizeOptions=function(e){if(e.headers||(e.headers={}),e.host&&(e.hostname||(e.hostname=e.host),delete e.host),!e.pathname&&e.path){var t=e.path.indexOf("?");t<0?e.pathname=e.path:(e.pathname=e.path.substring(0,t),e.search=e.path.substring(t))}},ba.prototype._performRequest=function(){var e=this._options.protocol,t=this._options.nativeProtocols[e];if(t){if(this._options.agents){var n=e.substr(0,e.length-1);this._options.agent=this._options.agents[n]}var r=this._currentRequest=t.request(this._options,this._onNativeResponse);this._currentUrl=la.format(this._options),r._redirectable=this;for(var i=0;i<va.length;i++)r.on(va[i],ga[va[i]]);if(this._isRedirect){var o=0,a=this,s=this._requestBodyBuffers;!function e(t){if(r===a._currentRequest)if(t)a.emit("error",t);else if(o<s.length){var n=s[o++];r.finished||r.write(n.data,n.encoding,e)}else a._ended&&r.end()}()}}else this.emit("error",new TypeError("Unsupported protocol "+e))},ba.prototype._processResponse=function(e){var t=e.statusCode;this._options.trackRedirects&&this._redirects.push({url:this._currentUrl,headers:e.headers,statusCode:t});var n=e.headers.location;if(n&&!1!==this._options.followRedirects&&t>=300&&t<400){if(Oa(this._currentRequest),e.destroy(),++this._redirectCount>this._options.maxRedirects)return void this.emit("error",new ma);((301===t||302===t)&&"POST"===this._options.method||303===t&&!/^(?:GET|HEAD)$/.test(this._options.method))&&(this._options.method="GET",this._requestBodyBuffers=[],ka(/^content-/i,this._options.headers));var r=ka(/^host$/i,this._options.headers)||la.parse(this._currentUrl).hostname,i=la.resolve(this._currentUrl,n);ca("redirecting to",i),this._isRedirect=!0;var o=la.parse(i);if(Object.assign(this._options,o),o.hostname!==r&&ka(/^authorization$/i,this._options.headers),"function"==typeof this._options.beforeRedirect){var a={headers:e.headers};try{this._options.beforeRedirect.call(null,this._options,a)}catch(e){return void this.emit("error",e)}this._sanitizeOptions(this._options)}try{this._performRequest()}catch(e){var s=new _a("Redirected request failed: "+e.message);s.cause=e,this.emit("error",s)}}else e.responseUrl=this._currentUrl,e.redirects=this._redirects,this.emit("response",e),this._requestBodyBuffers=[]};var Ca=Ea({http:fa,https:fa}),Ra=Ea;Ca.wrap=Ra;var Na={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"};function Ia(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}function Pa(e,t,n,r,i){if(t.subarray&&e.subarray)e.set(t.subarray(n,n+r),i);else for(var o=0;o<r;o++)e[i+o]=t[n+o]}var xa=Uint8Array,La=Uint16Array,Ba=Int32Array;function ja(e){for(var t=e.length;--t>=0;)e[t]=0}var Ua=256,Da=286,Ma=30,za=15,Fa=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0],Wa=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],Ha=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],Za=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],qa=new Array(576);ja(qa);var Ga=new Array(60);ja(Ga);var $a=new Array(512);ja($a);var Ka=new Array(256);ja(Ka);var Ya=new Array(29);ja(Ya);var Va,Ja,Qa,Xa=new Array(Ma);function es(e,t,n,r,i){this.static_tree=e,this.extra_bits=t,this.extra_base=n,this.elems=r,this.max_length=i,this.has_stree=e&&e.length}function ts(e,t){this.dyn_tree=e,this.max_code=0,this.stat_desc=t}function ns(e){return e<256?$a[e]:$a[256+(e>>>7)]}function rs(e,t){e.pending_buf[e.pending++]=255&t,e.pending_buf[e.pending++]=t>>>8&255}function is(e,t,n){e.bi_valid>16-n?(e.bi_buf|=t<<e.bi_valid&65535,rs(e,e.bi_buf),e.bi_buf=t>>16-e.bi_valid,e.bi_valid+=n-16):(e.bi_buf|=t<<e.bi_valid&65535,e.bi_valid+=n)}function os(e,t,n){is(e,n[2*t],n[2*t+1])}function as(e,t){var n=0;do{n|=1&e,e>>>=1,n<<=1}while(--t>0);return n>>>1}function ss(e,t,n){var r,i,o=new Array(16),a=0;for(r=1;r<=za;r++)o[r]=a=a+n[r-1]<<1;for(i=0;i<=t;i++){var s=e[2*i+1];0!==s&&(e[2*i]=as(o[s]++,s))}}function us(e){var t;for(t=0;t<Da;t++)e.dyn_ltree[2*t]=0;for(t=0;t<Ma;t++)e.dyn_dtree[2*t]=0;for(t=0;t<19;t++)e.bl_tree[2*t]=0;e.dyn_ltree[512]=1,e.opt_len=e.static_len=0,e.last_lit=e.matches=0}function cs(e){e.bi_valid>8?rs(e,e.bi_buf):e.bi_valid>0&&(e.pending_buf[e.pending++]=e.bi_buf),e.bi_buf=0,e.bi_valid=0}function ls(e,t,n,r){var i=2*t,o=2*n;return e[i]<e[o]||e[i]===e[o]&&r[t]<=r[n]}function fs(e,t,n){for(var r=e.heap[n],i=n<<1;i<=e.heap_len&&(i<e.heap_len&&ls(t,e.heap[i+1],e.heap[i],e.depth)&&i++,!ls(t,r,e.heap[i],e.depth));)e.heap[n]=e.heap[i],n=i,i<<=1;e.heap[n]=r}function hs(e,t,n){var r,i,o,a,s=0;if(0!==e.last_lit)do{r=e.pending_buf[e.d_buf+2*s]<<8|e.pending_buf[e.d_buf+2*s+1],i=e.pending_buf[e.l_buf+s],s++,0===r?os(e,i,t):(os(e,(o=Ka[i])+Ua+1,t),0!==(a=Fa[o])&&is(e,i-=Ya[o],a),os(e,o=ns(--r),n),0!==(a=Wa[o])&&is(e,r-=Xa[o],a))}while(s<e.last_lit);os(e,256,t)}function ds(e,t){var n,r,i,o=t.dyn_tree,a=t.stat_desc.static_tree,s=t.stat_desc.has_stree,u=t.stat_desc.elems,c=-1;for(e.heap_len=0,e.heap_max=573,n=0;n<u;n++)0!==o[2*n]?(e.heap[++e.heap_len]=c=n,e.depth[n]=0):o[2*n+1]=0;for(;e.heap_len<2;)o[2*(i=e.heap[++e.heap_len]=c<2?++c:0)]=1,e.depth[i]=0,e.opt_len--,s&&(e.static_len-=a[2*i+1]);for(t.max_code=c,n=e.heap_len>>1;n>=1;n--)fs(e,o,n);i=u;do{n=e.heap[1],e.heap[1]=e.heap[e.heap_len--],fs(e,o,1),r=e.heap[1],e.heap[--e.heap_max]=n,e.heap[--e.heap_max]=r,o[2*i]=o[2*n]+o[2*r],e.depth[i]=(e.depth[n]>=e.depth[r]?e.depth[n]:e.depth[r])+1,o[2*n+1]=o[2*r+1]=i,e.heap[1]=i++,fs(e,o,1)}while(e.heap_len>=2);e.heap[--e.heap_max]=e.heap[1],function(e,t){var n,r,i,o,a,s,u=t.dyn_tree,c=t.max_code,l=t.stat_desc.static_tree,f=t.stat_desc.has_stree,h=t.stat_desc.extra_bits,d=t.stat_desc.extra_base,p=t.stat_desc.max_length,v=0;for(o=0;o<=za;o++)e.bl_count[o]=0;for(u[2*e.heap[e.heap_max]+1]=0,n=e.heap_max+1;n<573;n++)(o=u[2*u[2*(r=e.heap[n])+1]+1]+1)>p&&(o=p,v++),u[2*r+1]=o,r>c||(e.bl_count[o]++,a=0,r>=d&&(a=h[r-d]),s=u[2*r],e.opt_len+=s*(o+a),f&&(e.static_len+=s*(l[2*r+1]+a)));if(0!==v){do{for(o=p-1;0===e.bl_count[o];)o--;e.bl_count[o]--,e.bl_count[o+1]+=2,e.bl_count[p]--,v-=2}while(v>0);for(o=p;0!==o;o--)for(r=e.bl_count[o];0!==r;)(i=e.heap[--n])>c||(u[2*i+1]!==o&&(e.opt_len+=(o-u[2*i+1])*u[2*i],u[2*i+1]=o),r--)}}(e,t),ss(o,c,e.bl_count)}function ps(e,t,n){var r,i,o=-1,a=t[1],s=0,u=7,c=4;for(0===a&&(u=138,c=3),t[2*(n+1)+1]=65535,r=0;r<=n;r++)i=a,a=t[2*(r+1)+1],++s<u&&i===a||(s<c?e.bl_tree[2*i]+=s:0!==i?(i!==o&&e.bl_tree[2*i]++,e.bl_tree[32]++):s<=10?e.bl_tree[34]++:e.bl_tree[36]++,s=0,o=i,0===a?(u=138,c=3):i===a?(u=6,c=3):(u=7,c=4))}function vs(e,t,n){var r,i,o=-1,a=t[1],s=0,u=7,c=4;for(0===a&&(u=138,c=3),r=0;r<=n;r++)if(i=a,a=t[2*(r+1)+1],!(++s<u&&i===a)){if(s<c)do{os(e,i,e.bl_tree)}while(0!=--s);else 0!==i?(i!==o&&(os(e,i,e.bl_tree),s--),os(e,16,e.bl_tree),is(e,s-3,2)):s<=10?(os(e,17,e.bl_tree),is(e,s-3,3)):(os(e,18,e.bl_tree),is(e,s-11,7));s=0,o=i,0===a?(u=138,c=3):i===a?(u=6,c=3):(u=7,c=4)}}ja(Xa);var gs=!1;function _s(e){gs||(!function(){var e,t,n,r,i,o=new Array(16);for(n=0,r=0;r<28;r++)for(Ya[r]=n,e=0;e<1<<Fa[r];e++)Ka[n++]=r;for(Ka[n-1]=r,i=0,r=0;r<16;r++)for(Xa[r]=i,e=0;e<1<<Wa[r];e++)$a[i++]=r;for(i>>=7;r<Ma;r++)for(Xa[r]=i<<7,e=0;e<1<<Wa[r]-7;e++)$a[256+i++]=r;for(t=0;t<=za;t++)o[t]=0;for(e=0;e<=143;)qa[2*e+1]=8,e++,o[8]++;for(;e<=255;)qa[2*e+1]=9,e++,o[9]++;for(;e<=279;)qa[2*e+1]=7,e++,o[7]++;for(;e<=287;)qa[2*e+1]=8,e++,o[8]++;for(ss(qa,287,o),e=0;e<Ma;e++)Ga[2*e+1]=5,Ga[2*e]=as(e,5);Va=new es(qa,Fa,257,Da,za),Ja=new es(Ga,Wa,0,Ma,za),Qa=new es(new Array(0),Ha,0,19,7)}(),gs=!0),e.l_desc=new ts(e.dyn_ltree,Va),e.d_desc=new ts(e.dyn_dtree,Ja),e.bl_desc=new ts(e.bl_tree,Qa),e.bi_buf=0,e.bi_valid=0,us(e)}function ms(e,t,n,r){is(e,0+(r?1:0),3),function(e,t,n,r){cs(e),r&&(rs(e,n),rs(e,~n)),Pa(e.pending_buf,e.window,t,n,e.pending),e.pending+=n}(e,t,n,!0)}function ys(e){is(e,2,3),os(e,256,qa),function(e){16===e.bi_valid?(rs(e,e.bi_buf),e.bi_buf=0,e.bi_valid=0):e.bi_valid>=8&&(e.pending_buf[e.pending++]=255&e.bi_buf,e.bi_buf>>=8,e.bi_valid-=8)}(e)}function ws(e,t,n,r){var i,o,a=0;e.level>0?(2===e.strm.data_type&&(e.strm.data_type=function(e){var t,n=4093624447;for(t=0;t<=31;t++,n>>>=1)if(1&n&&0!==e.dyn_ltree[2*t])return 0;if(0!==e.dyn_ltree[18]||0!==e.dyn_ltree[20]||0!==e.dyn_ltree[26])return 1;for(t=32;t<Ua;t++)if(0!==e.dyn_ltree[2*t])return 1;return 0}(e)),ds(e,e.l_desc),ds(e,e.d_desc),a=function(e){var t;for(ps(e,e.dyn_ltree,e.l_desc.max_code),ps(e,e.dyn_dtree,e.d_desc.max_code),ds(e,e.bl_desc),t=18;t>=3&&0===e.bl_tree[2*Za[t]+1];t--);return e.opt_len+=3*(t+1)+5+5+4,t}(e),i=e.opt_len+3+7>>>3,(o=e.static_len+3+7>>>3)<=i&&(i=o)):i=o=n+5,n+4<=i&&-1!==t?ms(e,t,n,r):4===e.strategy||o===i?(is(e,2+(r?1:0),3),hs(e,qa,Ga)):(is(e,4+(r?1:0),3),function(e,t,n,r){var i;for(is(e,t-257,5),is(e,n-1,5),is(e,r-4,4),i=0;i<r;i++)is(e,e.bl_tree[2*Za[i]+1],3);vs(e,e.dyn_ltree,t-1),vs(e,e.dyn_dtree,n-1)}(e,e.l_desc.max_code+1,e.d_desc.max_code+1,a+1),hs(e,e.dyn_ltree,e.dyn_dtree)),us(e),r&&cs(e)}function bs(e,t,n){return e.pending_buf[e.d_buf+2*e.last_lit]=t>>>8&255,e.pending_buf[e.d_buf+2*e.last_lit+1]=255&t,e.pending_buf[e.l_buf+e.last_lit]=255&n,e.last_lit++,0===t?e.dyn_ltree[2*n]++:(e.matches++,t--,e.dyn_ltree[2*(Ka[n]+Ua+1)]++,e.dyn_dtree[2*ns(t)]++),e.last_lit===e.lit_bufsize-1}function Es(e,t,n,r){for(var i=65535&e|0,o=e>>>16&65535|0,a=0;0!==n;){n-=a=n>2e3?2e3:n;do{o=o+(i=i+t[r++]|0)|0}while(--a);i%=65521,o%=65521}return i|o<<16|0}var As=function(){for(var e,t=[],n=0;n<256;n++){e=n;for(var r=0;r<8;r++)e=1&e?3988292384^e>>>1:e>>>1;t[n]=e}return t}();function Ts(e,t,n,r){var i=As,o=r+n;e^=-1;for(var a=r;a<o;a++)e=e>>>8^i[255&(e^t[a])];return-1^e}var ks,Ss=-2,Os=258,Cs=262,Rs=103,Ns=113,Is=666;function Ps(e,t){return e.msg=Na[t],t}function xs(e){return(e<<1)-(e>4?9:0)}function Ls(e){for(var t=e.length;--t>=0;)e[t]=0}function Bs(e){var t=e.state,n=t.pending;n>e.avail_out&&(n=e.avail_out),0!==n&&(Pa(e.output,t.pending_buf,t.pending_out,n,e.next_out),e.next_out+=n,t.pending_out+=n,e.total_out+=n,e.avail_out-=n,t.pending-=n,0===t.pending&&(t.pending_out=0))}function js(e,t){ws(e,e.block_start>=0?e.block_start:-1,e.strstart-e.block_start,t),e.block_start=e.strstart,Bs(e.strm)}function Us(e,t){e.pending_buf[e.pending++]=t}function Ds(e,t){e.pending_buf[e.pending++]=t>>>8&255,e.pending_buf[e.pending++]=255&t}function Ms(e,t){var n,r,i=e.max_chain_length,o=e.strstart,a=e.prev_length,s=e.nice_match,u=e.strstart>e.w_size-Cs?e.strstart-(e.w_size-Cs):0,c=e.window,l=e.w_mask,f=e.prev,h=e.strstart+Os,d=c[o+a-1],p=c[o+a];e.prev_length>=e.good_match&&(i>>=2),s>e.lookahead&&(s=e.lookahead);do{if(c[(n=t)+a]===p&&c[n+a-1]===d&&c[n]===c[o]&&c[++n]===c[o+1]){o+=2,n++;do{}while(c[++o]===c[++n]&&c[++o]===c[++n]&&c[++o]===c[++n]&&c[++o]===c[++n]&&c[++o]===c[++n]&&c[++o]===c[++n]&&c[++o]===c[++n]&&c[++o]===c[++n]&&o<h);if(r=Os-(h-o),o=h-Os,r>a){if(e.match_start=t,a=r,r>=s)break;d=c[o+a-1],p=c[o+a]}}}while((t=f[t&l])>u&&0!=--i);return a<=e.lookahead?a:e.lookahead}function zs(e){var t,n,r,i,o,a,s,u,c,l,f=e.w_size;do{if(i=e.window_size-e.lookahead-e.strstart,e.strstart>=f+(f-Cs)){Pa(e.window,e.window,f,f,0),e.match_start-=f,e.strstart-=f,e.block_start-=f,t=n=e.hash_size;do{r=e.head[--t],e.head[t]=r>=f?r-f:0}while(--n);t=n=f;do{r=e.prev[--t],e.prev[t]=r>=f?r-f:0}while(--n);i+=f}if(0===e.strm.avail_in)break;if(a=e.strm,s=e.window,u=e.strstart+e.lookahead,c=i,l=void 0,(l=a.avail_in)>c&&(l=c),n=0===l?0:(a.avail_in-=l,Pa(s,a.input,a.next_in,l,u),1===a.state.wrap?a.adler=Es(a.adler,s,l,u):2===a.state.wrap&&(a.adler=Ts(a.adler,s,l,u)),a.next_in+=l,a.total_in+=l,l),e.lookahead+=n,e.lookahead+e.insert>=3)for(o=e.strstart-e.insert,e.ins_h=e.window[o],e.ins_h=(e.ins_h<<e.hash_shift^e.window[o+1])&e.hash_mask;e.insert&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[o+3-1])&e.hash_mask,e.prev[o&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=o,o++,e.insert--,!(e.lookahead+e.insert<3)););}while(e.lookahead<Cs&&0!==e.strm.avail_in)}function Fs(e,t){for(var n,r;;){if(e.lookahead<Cs){if(zs(e),e.lookahead<Cs&&0===t)return 1;if(0===e.lookahead)break}if(n=0,e.lookahead>=3&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+3-1])&e.hash_mask,n=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),0!==n&&e.strstart-n<=e.w_size-Cs&&(e.match_length=Ms(e,n)),e.match_length>=3)if(r=bs(e,e.strstart-e.match_start,e.match_length-3),e.lookahead-=e.match_length,e.match_length<=e.max_lazy_match&&e.lookahead>=3){e.match_length--;do{e.strstart++,e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+3-1])&e.hash_mask,n=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart}while(0!=--e.match_length);e.strstart++}else e.strstart+=e.match_length,e.match_length=0,e.ins_h=e.window[e.strstart],e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+1])&e.hash_mask;else r=bs(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++;if(r&&(js(e,!1),0===e.strm.avail_out))return 1}return e.insert=e.strstart<2?e.strstart:2,4===t?(js(e,!0),0===e.strm.avail_out?3:4):e.last_lit&&(js(e,!1),0===e.strm.avail_out)?1:2}function Ws(e,t){for(var n,r,i;;){if(e.lookahead<Cs){if(zs(e),e.lookahead<Cs&&0===t)return 1;if(0===e.lookahead)break}if(n=0,e.lookahead>=3&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+3-1])&e.hash_mask,n=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),e.prev_length=e.match_length,e.prev_match=e.match_start,e.match_length=2,0!==n&&e.prev_length<e.max_lazy_match&&e.strstart-n<=e.w_size-Cs&&(e.match_length=Ms(e,n),e.match_length<=5&&(1===e.strategy||3===e.match_length&&e.strstart-e.match_start>4096)&&(e.match_length=2)),e.prev_length>=3&&e.match_length<=e.prev_length){i=e.strstart+e.lookahead-3,r=bs(e,e.strstart-1-e.prev_match,e.prev_length-3),e.lookahead-=e.prev_length-1,e.prev_length-=2;do{++e.strstart<=i&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+3-1])&e.hash_mask,n=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart)}while(0!=--e.prev_length);if(e.match_available=0,e.match_length=2,e.strstart++,r&&(js(e,!1),0===e.strm.avail_out))return 1}else if(e.match_available){if((r=bs(e,0,e.window[e.strstart-1]))&&js(e,!1),e.strstart++,e.lookahead--,0===e.strm.avail_out)return 1}else e.match_available=1,e.strstart++,e.lookahead--}return e.match_available&&(r=bs(e,0,e.window[e.strstart-1]),e.match_available=0),e.insert=e.strstart<2?e.strstart:2,4===t?(js(e,!0),0===e.strm.avail_out?3:4):e.last_lit&&(js(e,!1),0===e.strm.avail_out)?1:2}function Hs(e,t,n,r,i){this.good_length=e,this.max_lazy=t,this.nice_length=n,this.max_chain=r,this.func=i}function Zs(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=8,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new La(1146),this.dyn_dtree=new La(122),this.bl_tree=new La(78),Ls(this.dyn_ltree),Ls(this.dyn_dtree),Ls(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new La(16),this.heap=new La(573),Ls(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new La(573),Ls(this.depth),this.l_buf=0,this.lit_bufsize=0,this.last_lit=0,this.d_buf=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}function qs(e){var t=function(e){var t;return e&&e.state?(e.total_in=e.total_out=0,e.data_type=2,(t=e.state).pending=0,t.pending_out=0,t.wrap<0&&(t.wrap=-t.wrap),t.status=t.wrap?42:Ns,e.adler=2===t.wrap?0:1,t.last_flush=0,_s(t),0):Ps(e,Ss)}(e);return 0===t&&function(e){e.window_size=2*e.w_size,Ls(e.head),e.max_lazy_match=ks[e.level].max_lazy,e.good_match=ks[e.level].good_length,e.nice_match=ks[e.level].nice_length,e.max_chain_length=ks[e.level].max_chain,e.strstart=0,e.block_start=0,e.lookahead=0,e.insert=0,e.match_length=e.prev_length=2,e.match_available=0,e.ins_h=0}(e.state),t}function Gs(e,t){var n,r,i,o;if(!e||!e.state||t>5||t<0)return e?Ps(e,Ss):Ss;if(r=e.state,!e.output||!e.input&&0!==e.avail_in||r.status===Is&&4!==t)return Ps(e,0===e.avail_out?-5:Ss);if(r.strm=e,n=r.last_flush,r.last_flush=t,42===r.status)if(2===r.wrap)e.adler=0,Us(r,31),Us(r,139),Us(r,8),r.gzhead?(Us(r,(r.gzhead.text?1:0)+(r.gzhead.hcrc?2:0)+(r.gzhead.extra?4:0)+(r.gzhead.name?8:0)+(r.gzhead.comment?16:0)),Us(r,255&r.gzhead.time),Us(r,r.gzhead.time>>8&255),Us(r,r.gzhead.time>>16&255),Us(r,r.gzhead.time>>24&255),Us(r,9===r.level?2:r.strategy>=2||r.level<2?4:0),Us(r,255&r.gzhead.os),r.gzhead.extra&&r.gzhead.extra.length&&(Us(r,255&r.gzhead.extra.length),Us(r,r.gzhead.extra.length>>8&255)),r.gzhead.hcrc&&(e.adler=Ts(e.adler,r.pending_buf,r.pending,0)),r.gzindex=0,r.status=69):(Us(r,0),Us(r,0),Us(r,0),Us(r,0),Us(r,0),Us(r,9===r.level?2:r.strategy>=2||r.level<2?4:0),Us(r,3),r.status=Ns);else{var a=8+(r.w_bits-8<<4)<<8;a|=(r.strategy>=2||r.level<2?0:r.level<6?1:6===r.level?2:3)<<6,0!==r.strstart&&(a|=32),a+=31-a%31,r.status=Ns,Ds(r,a),0!==r.strstart&&(Ds(r,e.adler>>>16),Ds(r,65535&e.adler)),e.adler=1}if(69===r.status)if(r.gzhead.extra){for(i=r.pending;r.gzindex<(65535&r.gzhead.extra.length)&&(r.pending!==r.pending_buf_size||(r.gzhead.hcrc&&r.pending>i&&(e.adler=Ts(e.adler,r.pending_buf,r.pending-i,i)),Bs(e),i=r.pending,r.pending!==r.pending_buf_size));)Us(r,255&r.gzhead.extra[r.gzindex]),r.gzindex++;r.gzhead.hcrc&&r.pending>i&&(e.adler=Ts(e.adler,r.pending_buf,r.pending-i,i)),r.gzindex===r.gzhead.extra.length&&(r.gzindex=0,r.status=73)}else r.status=73;if(73===r.status)if(r.gzhead.name){i=r.pending;do{if(r.pending===r.pending_buf_size&&(r.gzhead.hcrc&&r.pending>i&&(e.adler=Ts(e.adler,r.pending_buf,r.pending-i,i)),Bs(e),i=r.pending,r.pending===r.pending_buf_size)){o=1;break}o=r.gzindex<r.gzhead.name.length?255&r.gzhead.name.charCodeAt(r.gzindex++):0,Us(r,o)}while(0!==o);r.gzhead.hcrc&&r.pending>i&&(e.adler=Ts(e.adler,r.pending_buf,r.pending-i,i)),0===o&&(r.gzindex=0,r.status=91)}else r.status=91;if(91===r.status)if(r.gzhead.comment){i=r.pending;do{if(r.pending===r.pending_buf_size&&(r.gzhead.hcrc&&r.pending>i&&(e.adler=Ts(e.adler,r.pending_buf,r.pending-i,i)),Bs(e),i=r.pending,r.pending===r.pending_buf_size)){o=1;break}o=r.gzindex<r.gzhead.comment.length?255&r.gzhead.comment.charCodeAt(r.gzindex++):0,Us(r,o)}while(0!==o);r.gzhead.hcrc&&r.pending>i&&(e.adler=Ts(e.adler,r.pending_buf,r.pending-i,i)),0===o&&(r.status=Rs)}else r.status=Rs;if(r.status===Rs&&(r.gzhead.hcrc?(r.pending+2>r.pending_buf_size&&Bs(e),r.pending+2<=r.pending_buf_size&&(Us(r,255&e.adler),Us(r,e.adler>>8&255),e.adler=0,r.status=Ns)):r.status=Ns),0!==r.pending){if(Bs(e),0===e.avail_out)return r.last_flush=-1,0}else if(0===e.avail_in&&xs(t)<=xs(n)&&4!==t)return Ps(e,-5);if(r.status===Is&&0!==e.avail_in)return Ps(e,-5);if(0!==e.avail_in||0!==r.lookahead||0!==t&&r.status!==Is){var s=2===r.strategy?function(e,t){for(var n;;){if(0===e.lookahead&&(zs(e),0===e.lookahead)){if(0===t)return 1;break}if(e.match_length=0,n=bs(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++,n&&(js(e,!1),0===e.strm.avail_out))return 1}return e.insert=0,4===t?(js(e,!0),0===e.strm.avail_out?3:4):e.last_lit&&(js(e,!1),0===e.strm.avail_out)?1:2}(r,t):3===r.strategy?function(e,t){for(var n,r,i,o,a=e.window;;){if(e.lookahead<=Os){if(zs(e),e.lookahead<=Os&&0===t)return 1;if(0===e.lookahead)break}if(e.match_length=0,e.lookahead>=3&&e.strstart>0&&(r=a[i=e.strstart-1])===a[++i]&&r===a[++i]&&r===a[++i]){o=e.strstart+Os;do{}while(r===a[++i]&&r===a[++i]&&r===a[++i]&&r===a[++i]&&r===a[++i]&&r===a[++i]&&r===a[++i]&&r===a[++i]&&i<o);e.match_length=Os-(o-i),e.match_length>e.lookahead&&(e.match_length=e.lookahead)}if(e.match_length>=3?(n=bs(e,1,e.match_length-3),e.lookahead-=e.match_length,e.strstart+=e.match_length,e.match_length=0):(n=bs(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++),n&&(js(e,!1),0===e.strm.avail_out))return 1}return e.insert=0,4===t?(js(e,!0),0===e.strm.avail_out?3:4):e.last_lit&&(js(e,!1),0===e.strm.avail_out)?1:2}(r,t):ks[r.level].func(r,t);if(3!==s&&4!==s||(r.status=Is),1===s||3===s)return 0===e.avail_out&&(r.last_flush=-1),0;if(2===s&&(1===t?ys(r):5!==t&&(ms(r,0,0,!1),3===t&&(Ls(r.head),0===r.lookahead&&(r.strstart=0,r.block_start=0,r.insert=0))),Bs(e),0===e.avail_out))return r.last_flush=-1,0}return 4!==t?0:r.wrap<=0?1:(2===r.wrap?(Us(r,255&e.adler),Us(r,e.adler>>8&255),Us(r,e.adler>>16&255),Us(r,e.adler>>24&255),Us(r,255&e.total_in),Us(r,e.total_in>>8&255),Us(r,e.total_in>>16&255),Us(r,e.total_in>>24&255)):(Ds(r,e.adler>>>16),Ds(r,65535&e.adler)),Bs(e),r.wrap>0&&(r.wrap=-r.wrap),0!==r.pending?0:1)}ks=[new Hs(0,0,0,0,(function(e,t){var n=65535;for(n>e.pending_buf_size-5&&(n=e.pending_buf_size-5);;){if(e.lookahead<=1){if(zs(e),0===e.lookahead&&0===t)return 1;if(0===e.lookahead)break}e.strstart+=e.lookahead,e.lookahead=0;var r=e.block_start+n;if((0===e.strstart||e.strstart>=r)&&(e.lookahead=e.strstart-r,e.strstart=r,js(e,!1),0===e.strm.avail_out))return 1;if(e.strstart-e.block_start>=e.w_size-Cs&&(js(e,!1),0===e.strm.avail_out))return 1}return e.insert=0,4===t?(js(e,!0),0===e.strm.avail_out?3:4):(e.strstart>e.block_start&&(js(e,!1),e.strm.avail_out),1)})),new Hs(4,4,8,4,Fs),new Hs(4,5,16,8,Fs),new Hs(4,6,32,32,Fs),new Hs(4,4,16,16,Ws),new Hs(8,16,32,32,Ws),new Hs(8,16,128,128,Ws),new Hs(8,32,128,256,Ws),new Hs(32,128,258,1024,Ws),new Hs(32,258,258,4096,Ws)];function $s(e,t){var n,r,i,o,a,s,u,c,l,f,h,d,p,v,g,_,m,y,w,b,E,A,T,k,S;n=e.state,r=e.next_in,k=e.input,i=r+(e.avail_in-5),o=e.next_out,S=e.output,a=o-(t-e.avail_out),s=o+(e.avail_out-257),u=n.dmax,c=n.wsize,l=n.whave,f=n.wnext,h=n.window,d=n.hold,p=n.bits,v=n.lencode,g=n.distcode,_=(1<<n.lenbits)-1,m=(1<<n.distbits)-1;e:do{p<15&&(d+=k[r++]<<p,p+=8,d+=k[r++]<<p,p+=8),y=v[d&_];t:for(;;){if(d>>>=w=y>>>24,p-=w,0===(w=y>>>16&255))S[o++]=65535&y;else{if(!(16&w)){if(0==(64&w)){y=v[(65535&y)+(d&(1<<w)-1)];continue t}if(32&w){n.mode=12;break e}e.msg="invalid literal/length code",n.mode=30;break e}b=65535&y,(w&=15)&&(p<w&&(d+=k[r++]<<p,p+=8),b+=d&(1<<w)-1,d>>>=w,p-=w),p<15&&(d+=k[r++]<<p,p+=8,d+=k[r++]<<p,p+=8),y=g[d&m];n:for(;;){if(d>>>=w=y>>>24,p-=w,!(16&(w=y>>>16&255))){if(0==(64&w)){y=g[(65535&y)+(d&(1<<w)-1)];continue n}e.msg="invalid distance code",n.mode=30;break e}if(E=65535&y,p<(w&=15)&&(d+=k[r++]<<p,(p+=8)<w&&(d+=k[r++]<<p,p+=8)),(E+=d&(1<<w)-1)>u){e.msg="invalid distance too far back",n.mode=30;break e}if(d>>>=w,p-=w,E>(w=o-a)){if((w=E-w)>l&&n.sane){e.msg="invalid distance too far back",n.mode=30;break e}if(A=0,T=h,0===f){if(A+=c-w,w<b){b-=w;do{S[o++]=h[A++]}while(--w);A=o-E,T=S}}else if(f<w){if(A+=c+f-w,(w-=f)<b){b-=w;do{S[o++]=h[A++]}while(--w);if(A=0,f<b){b-=w=f;do{S[o++]=h[A++]}while(--w);A=o-E,T=S}}}else if(A+=f-w,w<b){b-=w;do{S[o++]=h[A++]}while(--w);A=o-E,T=S}for(;b>2;)S[o++]=T[A++],S[o++]=T[A++],S[o++]=T[A++],b-=3;b&&(S[o++]=T[A++],b>1&&(S[o++]=T[A++]))}else{A=o-E;do{S[o++]=S[A++],S[o++]=S[A++],S[o++]=S[A++],b-=3}while(b>2);b&&(S[o++]=S[A++],b>1&&(S[o++]=S[A++]))}break}}break}}while(r<i&&o<s);r-=b=p>>3,d&=(1<<(p-=b<<3))-1,e.next_in=r,e.next_out=o,e.avail_in=r<i?i-r+5:5-(r-i),e.avail_out=o<s?s-o+257:257-(o-s),n.hold=d,n.bits=p}var Ks=15,Ys=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0],Vs=[16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78],Js=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0],Qs=[16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64];function Xs(e,t,n,r,i,o,a,s){var u,c,l,f,h,d,p,v,g,_=s.bits,m=0,y=0,w=0,b=0,E=0,A=0,T=0,k=0,S=0,O=0,C=null,R=0,N=new La(16),I=new La(16),P=null,x=0;for(m=0;m<=Ks;m++)N[m]=0;for(y=0;y<r;y++)N[t[n+y]]++;for(E=_,b=Ks;b>=1&&0===N[b];b--);if(E>b&&(E=b),0===b)return i[o++]=20971520,i[o++]=20971520,s.bits=1,0;for(w=1;w<b&&0===N[w];w++);for(E<w&&(E=w),k=1,m=1;m<=Ks;m++)if(k<<=1,(k-=N[m])<0)return-1;if(k>0&&(0===e||1!==b))return-1;for(I[1]=0,m=1;m<Ks;m++)I[m+1]=I[m]+N[m];for(y=0;y<r;y++)0!==t[n+y]&&(a[I[t[n+y]]++]=y);if(0===e?(C=P=a,d=19):1===e?(C=Ys,R-=257,P=Vs,x-=257,d=256):(C=Js,P=Qs,d=-1),O=0,y=0,m=w,h=o,A=E,T=0,l=-1,f=(S=1<<E)-1,1===e&&S>852||2===e&&S>592)return 1;for(;;){p=m-T,a[y]<d?(v=0,g=a[y]):a[y]>d?(v=P[x+a[y]],g=C[R+a[y]]):(v=96,g=0),u=1<<m-T,w=c=1<<A;do{i[h+(O>>T)+(c-=u)]=p<<24|v<<16|g|0}while(0!==c);for(u=1<<m-1;O&u;)u>>=1;if(0!==u?(O&=u-1,O+=u):O=0,y++,0==--N[m]){if(m===b)break;m=t[n+a[y]]}if(m>E&&(O&f)!==l){for(0===T&&(T=E),h+=w,k=1<<(A=m-T);A+T<b&&!((k-=N[A+T])<=0);)A++,k<<=1;if(S+=1<<A,1===e&&S>852||2===e&&S>592)return 1;i[l=O&f]=E<<24|A<<16|h-o|0}}return 0!==O&&(i[h+O]=m-T<<24|64<<16|0),s.bits=E,0}var eu=-2,tu=12,nu=30;function ru(e){return(e>>>24&255)+(e>>>8&65280)+((65280&e)<<8)+((255&e)<<24)}function iu(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new La(320),this.work=new La(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function ou(e){var t;return e&&e.state?((t=e.state).wsize=0,t.whave=0,t.wnext=0,function(e){var t;return e&&e.state?(t=e.state,e.total_in=e.total_out=t.total=0,e.msg="",t.wrap&&(e.adler=1&t.wrap),t.mode=1,t.last=0,t.havedict=0,t.dmax=32768,t.head=null,t.hold=0,t.bits=0,t.lencode=t.lendyn=new Ba(852),t.distcode=t.distdyn=new Ba(592),t.sane=1,t.back=-1,0):eu}(e)):eu}function au(e,t){var n,r;return e?(r=new iu,e.state=r,r.window=null,0!==(n=function(e,t){var n,r;return e&&e.state?(r=e.state,t<0?(n=0,t=-t):(n=1+(t>>4),t<48&&(t&=15)),t&&(t<8||t>15)?eu:(null!==r.window&&r.wbits!==t&&(r.window=null),r.wrap=n,r.wbits=t,ou(e))):eu}(e,t))&&(e.state=null),n):eu}var su,uu,cu=!0;function lu(e){if(cu){var t;for(su=new Ba(512),uu=new Ba(32),t=0;t<144;)e.lens[t++]=8;for(;t<256;)e.lens[t++]=9;for(;t<280;)e.lens[t++]=7;for(;t<288;)e.lens[t++]=8;for(Xs(1,e.lens,0,288,su,0,e.work,{bits:9}),t=0;t<32;)e.lens[t++]=5;Xs(2,e.lens,0,32,uu,0,e.work,{bits:5}),cu=!1}e.lencode=su,e.lenbits=9,e.distcode=uu,e.distbits=5}function fu(e,t){var n,r,i,o,a,s,u,c,l,f,h,d,p,v,g,_,m,y,w,b,E,A,T,k,S=0,O=new xa(4),C=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];if(!e||!e.state||!e.output||!e.input&&0!==e.avail_in)return eu;(n=e.state).mode===tu&&(n.mode=13),a=e.next_out,i=e.output,u=e.avail_out,o=e.next_in,r=e.input,s=e.avail_in,c=n.hold,l=n.bits,f=s,h=u,A=0;e:for(;;)switch(n.mode){case 1:if(0===n.wrap){n.mode=13;break}for(;l<16;){if(0===s)break e;s--,c+=r[o++]<<l,l+=8}if(2&n.wrap&&35615===c){n.check=0,O[0]=255&c,O[1]=c>>>8&255,n.check=Ts(n.check,O,2,0),c=0,l=0,n.mode=2;break}if(n.flags=0,n.head&&(n.head.done=!1),!(1&n.wrap)||(((255&c)<<8)+(c>>8))%31){e.msg="incorrect header check",n.mode=nu;break}if(8!=(15&c)){e.msg="unknown compression method",n.mode=nu;break}if(l-=4,E=8+(15&(c>>>=4)),0===n.wbits)n.wbits=E;else if(E>n.wbits){e.msg="invalid window size",n.mode=nu;break}n.dmax=1<<E,e.adler=n.check=1,n.mode=512&c?10:tu,c=0,l=0;break;case 2:for(;l<16;){if(0===s)break e;s--,c+=r[o++]<<l,l+=8}if(n.flags=c,8!=(255&n.flags)){e.msg="unknown compression method",n.mode=nu;break}if(57344&n.flags){e.msg="unknown header flags set",n.mode=nu;break}n.head&&(n.head.text=c>>8&1),512&n.flags&&(O[0]=255&c,O[1]=c>>>8&255,n.check=Ts(n.check,O,2,0)),c=0,l=0,n.mode=3;case 3:for(;l<32;){if(0===s)break e;s--,c+=r[o++]<<l,l+=8}n.head&&(n.head.time=c),512&n.flags&&(O[0]=255&c,O[1]=c>>>8&255,O[2]=c>>>16&255,O[3]=c>>>24&255,n.check=Ts(n.check,O,4,0)),c=0,l=0,n.mode=4;case 4:for(;l<16;){if(0===s)break e;s--,c+=r[o++]<<l,l+=8}n.head&&(n.head.xflags=255&c,n.head.os=c>>8),512&n.flags&&(O[0]=255&c,O[1]=c>>>8&255,n.check=Ts(n.check,O,2,0)),c=0,l=0,n.mode=5;case 5:if(1024&n.flags){for(;l<16;){if(0===s)break e;s--,c+=r[o++]<<l,l+=8}n.length=c,n.head&&(n.head.extra_len=c),512&n.flags&&(O[0]=255&c,O[1]=c>>>8&255,n.check=Ts(n.check,O,2,0)),c=0,l=0}else n.head&&(n.head.extra=null);n.mode=6;case 6:if(1024&n.flags&&((d=n.length)>s&&(d=s),d&&(n.head&&(E=n.head.extra_len-n.length,n.head.extra||(n.head.extra=new Array(n.head.extra_len)),Pa(n.head.extra,r,o,d,E)),512&n.flags&&(n.check=Ts(n.check,r,d,o)),s-=d,o+=d,n.length-=d),n.length))break e;n.length=0,n.mode=7;case 7:if(2048&n.flags){if(0===s)break e;d=0;do{E=r[o+d++],n.head&&E&&n.length<65536&&(n.head.name+=String.fromCharCode(E))}while(E&&d<s);if(512&n.flags&&(n.check=Ts(n.check,r,d,o)),s-=d,o+=d,E)break e}else n.head&&(n.head.name=null);n.length=0,n.mode=8;case 8:if(4096&n.flags){if(0===s)break e;d=0;do{E=r[o+d++],n.head&&E&&n.length<65536&&(n.head.comment+=String.fromCharCode(E))}while(E&&d<s);if(512&n.flags&&(n.check=Ts(n.check,r,d,o)),s-=d,o+=d,E)break e}else n.head&&(n.head.comment=null);n.mode=9;case 9:if(512&n.flags){for(;l<16;){if(0===s)break e;s--,c+=r[o++]<<l,l+=8}if(c!==(65535&n.check)){e.msg="header crc mismatch",n.mode=nu;break}c=0,l=0}n.head&&(n.head.hcrc=n.flags>>9&1,n.head.done=!0),e.adler=n.check=0,n.mode=tu;break;case 10:for(;l<32;){if(0===s)break e;s--,c+=r[o++]<<l,l+=8}e.adler=n.check=ru(c),c=0,l=0,n.mode=11;case 11:if(0===n.havedict)return e.next_out=a,e.avail_out=u,e.next_in=o,e.avail_in=s,n.hold=c,n.bits=l,2;e.adler=n.check=1,n.mode=tu;case tu:if(5===t||6===t)break e;case 13:if(n.last){c>>>=7&l,l-=7&l,n.mode=27;break}for(;l<3;){if(0===s)break e;s--,c+=r[o++]<<l,l+=8}switch(n.last=1&c,l-=1,3&(c>>>=1)){case 0:n.mode=14;break;case 1:if(lu(n),n.mode=20,6===t){c>>>=2,l-=2;break e}break;case 2:n.mode=17;break;case 3:e.msg="invalid block type",n.mode=nu}c>>>=2,l-=2;break;case 14:for(c>>>=7&l,l-=7&l;l<32;){if(0===s)break e;s--,c+=r[o++]<<l,l+=8}if((65535&c)!=(c>>>16^65535)){e.msg="invalid stored block lengths",n.mode=nu;break}if(n.length=65535&c,c=0,l=0,n.mode=15,6===t)break e;case 15:n.mode=16;case 16:if(d=n.length){if(d>s&&(d=s),d>u&&(d=u),0===d)break e;Pa(i,r,o,d,a),s-=d,o+=d,u-=d,a+=d,n.length-=d;break}n.mode=tu;break;case 17:for(;l<14;){if(0===s)break e;s--,c+=r[o++]<<l,l+=8}if(n.nlen=257+(31&c),c>>>=5,l-=5,n.ndist=1+(31&c),c>>>=5,l-=5,n.ncode=4+(15&c),c>>>=4,l-=4,n.nlen>286||n.ndist>30){e.msg="too many length or distance symbols",n.mode=nu;break}n.have=0,n.mode=18;case 18:for(;n.have<n.ncode;){for(;l<3;){if(0===s)break e;s--,c+=r[o++]<<l,l+=8}n.lens[C[n.have++]]=7&c,c>>>=3,l-=3}for(;n.have<19;)n.lens[C[n.have++]]=0;if(n.lencode=n.lendyn,n.lenbits=7,T={bits:n.lenbits},A=Xs(0,n.lens,0,19,n.lencode,0,n.work,T),n.lenbits=T.bits,A){e.msg="invalid code lengths set",n.mode=nu;break}n.have=0,n.mode=19;case 19:for(;n.have<n.nlen+n.ndist;){for(;_=(S=n.lencode[c&(1<<n.lenbits)-1])>>>16&255,m=65535&S,!((g=S>>>24)<=l);){if(0===s)break e;s--,c+=r[o++]<<l,l+=8}if(m<16)c>>>=g,l-=g,n.lens[n.have++]=m;else{if(16===m){for(k=g+2;l<k;){if(0===s)break e;s--,c+=r[o++]<<l,l+=8}if(c>>>=g,l-=g,0===n.have){e.msg="invalid bit length repeat",n.mode=nu;break}E=n.lens[n.have-1],d=3+(3&c),c>>>=2,l-=2}else if(17===m){for(k=g+3;l<k;){if(0===s)break e;s--,c+=r[o++]<<l,l+=8}l-=g,E=0,d=3+(7&(c>>>=g)),c>>>=3,l-=3}else{for(k=g+7;l<k;){if(0===s)break e;s--,c+=r[o++]<<l,l+=8}l-=g,E=0,d=11+(127&(c>>>=g)),c>>>=7,l-=7}if(n.have+d>n.nlen+n.ndist){e.msg="invalid bit length repeat",n.mode=nu;break}for(;d--;)n.lens[n.have++]=E}}if(n.mode===nu)break;if(0===n.lens[256]){e.msg="invalid code -- missing end-of-block",n.mode=nu;break}if(n.lenbits=9,T={bits:n.lenbits},A=Xs(1,n.lens,0,n.nlen,n.lencode,0,n.work,T),n.lenbits=T.bits,A){e.msg="invalid literal/lengths set",n.mode=nu;break}if(n.distbits=6,n.distcode=n.distdyn,T={bits:n.distbits},A=Xs(2,n.lens,n.nlen,n.ndist,n.distcode,0,n.work,T),n.distbits=T.bits,A){e.msg="invalid distances set",n.mode=nu;break}if(n.mode=20,6===t)break e;case 20:n.mode=21;case 21:if(s>=6&&u>=258){e.next_out=a,e.avail_out=u,e.next_in=o,e.avail_in=s,n.hold=c,n.bits=l,$s(e,h),a=e.next_out,i=e.output,u=e.avail_out,o=e.next_in,r=e.input,s=e.avail_in,c=n.hold,l=n.bits,n.mode===tu&&(n.back=-1);break}for(n.back=0;_=(S=n.lencode[c&(1<<n.lenbits)-1])>>>16&255,m=65535&S,!((g=S>>>24)<=l);){if(0===s)break e;s--,c+=r[o++]<<l,l+=8}if(_&&0==(240&_)){for(y=g,w=_,b=m;_=(S=n.lencode[b+((c&(1<<y+w)-1)>>y)])>>>16&255,m=65535&S,!(y+(g=S>>>24)<=l);){if(0===s)break e;s--,c+=r[o++]<<l,l+=8}c>>>=y,l-=y,n.back+=y}if(c>>>=g,l-=g,n.back+=g,n.length=m,0===_){n.mode=26;break}if(32&_){n.back=-1,n.mode=tu;break}if(64&_){e.msg="invalid literal/length code",n.mode=nu;break}n.extra=15&_,n.mode=22;case 22:if(n.extra){for(k=n.extra;l<k;){if(0===s)break e;s--,c+=r[o++]<<l,l+=8}n.length+=c&(1<<n.extra)-1,c>>>=n.extra,l-=n.extra,n.back+=n.extra}n.was=n.length,n.mode=23;case 23:for(;_=(S=n.distcode[c&(1<<n.distbits)-1])>>>16&255,m=65535&S,!((g=S>>>24)<=l);){if(0===s)break e;s--,c+=r[o++]<<l,l+=8}if(0==(240&_)){for(y=g,w=_,b=m;_=(S=n.distcode[b+((c&(1<<y+w)-1)>>y)])>>>16&255,m=65535&S,!(y+(g=S>>>24)<=l);){if(0===s)break e;s--,c+=r[o++]<<l,l+=8}c>>>=y,l-=y,n.back+=y}if(c>>>=g,l-=g,n.back+=g,64&_){e.msg="invalid distance code",n.mode=nu;break}n.offset=m,n.extra=15&_,n.mode=24;case 24:if(n.extra){for(k=n.extra;l<k;){if(0===s)break e;s--,c+=r[o++]<<l,l+=8}n.offset+=c&(1<<n.extra)-1,c>>>=n.extra,l-=n.extra,n.back+=n.extra}if(n.offset>n.dmax){e.msg="invalid distance too far back",n.mode=nu;break}n.mode=25;case 25:if(0===u)break e;if(d=h-u,n.offset>d){if((d=n.offset-d)>n.whave&&n.sane){e.msg="invalid distance too far back",n.mode=nu;break}d>n.wnext?(d-=n.wnext,p=n.wsize-d):p=n.wnext-d,d>n.length&&(d=n.length),v=n.window}else v=i,p=a-n.offset,d=n.length;d>u&&(d=u),u-=d,n.length-=d;do{i[a++]=v[p++]}while(--d);0===n.length&&(n.mode=21);break;case 26:if(0===u)break e;i[a++]=n.length,u--,n.mode=21;break;case 27:if(n.wrap){for(;l<32;){if(0===s)break e;s--,c|=r[o++]<<l,l+=8}if(h-=u,e.total_out+=h,n.total+=h,h&&(e.adler=n.check=n.flags?Ts(n.check,i,h,a-h):Es(n.check,i,h,a-h)),h=u,(n.flags?c:ru(c))!==n.check){e.msg="incorrect data check",n.mode=nu;break}c=0,l=0}n.mode=28;case 28:if(n.wrap&&n.flags){for(;l<32;){if(0===s)break e;s--,c+=r[o++]<<l,l+=8}if(c!==(4294967295&n.total)){e.msg="incorrect length check",n.mode=nu;break}c=0,l=0}n.mode=29;case 29:A=1;break e;case nu:A=-3;break e;case 31:return-4;case 32:default:return eu}return e.next_out=a,e.avail_out=u,e.next_in=o,e.avail_in=s,n.hold=c,n.bits=l,(n.wsize||h!==e.avail_out&&n.mode<nu&&(n.mode<27||4!==t))&&function(e,t,n,r){var i,o=e.state;null===o.window&&(o.wsize=1<<o.wbits,o.wnext=0,o.whave=0,o.window=new xa(o.wsize)),r>=o.wsize?(Pa(o.window,t,n-o.wsize,o.wsize,0),o.wnext=0,o.whave=o.wsize):((i=o.wsize-o.wnext)>r&&(i=r),Pa(o.window,t,n-r,i,o.wnext),(r-=i)?(Pa(o.window,t,n-r,r,0),o.wnext=r,o.whave=o.wsize):(o.wnext+=i,o.wnext===o.wsize&&(o.wnext=0),o.whave<o.wsize&&(o.whave+=i)))}(e,e.output,e.next_out,h-e.avail_out),f-=e.avail_in,h-=e.avail_out,e.total_in+=f,e.total_out+=h,n.total+=h,n.wrap&&h&&(e.adler=n.check=n.flags?Ts(n.check,i,h,e.next_out-h):Es(n.check,i,h,e.next_out-h)),e.data_type=n.bits+(n.last?64:0)+(n.mode===tu?128:0)+(20===n.mode||15===n.mode?256:0),(0===f&&0===h||4===t)&&0===A&&(A=-5),A}var hu;function du(e){if(e<1||e>7)throw new TypeError("Bad argument");this.mode=e,this.init_done=!1,this.write_in_progress=!1,this.pending_close=!1,this.windowBits=0,this.level=0,this.memLevel=0,this.strategy=0,this.dictionary=null}function pu(e,t){for(var n=0;n<e.length;n++)this[t+n]=e[n]}du.prototype.init=function(e,t,n,r,i){var o;switch(this.windowBits=e,this.level=t,this.memLevel=n,this.strategy=r,3!==this.mode&&4!==this.mode||(this.windowBits+=16),7===this.mode&&(this.windowBits+=32),5!==this.mode&&6!==this.mode||(this.windowBits=-this.windowBits),this.strm=new Ia,this.mode){case 1:case 3:case 5:o=function(e,t,n,r,i,o){if(!e)return Ss;var a=1;if(-1===t&&(t=6),r<0?(a=0,r=-r):r>15&&(a=2,r-=16),i<1||i>9||8!==n||r<8||r>15||t<0||t>9||o<0||o>4)return Ps(e,Ss);8===r&&(r=9);var s=new Zs;return e.state=s,s.strm=e,s.wrap=a,s.gzhead=null,s.w_bits=r,s.w_size=1<<s.w_bits,s.w_mask=s.w_size-1,s.hash_bits=i+7,s.hash_size=1<<s.hash_bits,s.hash_mask=s.hash_size-1,s.hash_shift=~~((s.hash_bits+3-1)/3),s.window=new xa(2*s.w_size),s.head=new La(s.hash_size),s.prev=new La(s.w_size),s.lit_bufsize=1<<i+6,s.pending_buf_size=4*s.lit_bufsize,s.pending_buf=new xa(s.pending_buf_size),s.d_buf=1*s.lit_bufsize,s.l_buf=3*s.lit_bufsize,s.level=t,s.strategy=o,s.method=n,qs(e)}(this.strm,this.level,8,this.windowBits,this.memLevel,this.strategy);break;case 2:case 4:case 6:case 7:o=au(this.strm,this.windowBits);break;default:throw new Error("Unknown mode "+this.mode)}0===o?(this.write_in_progress=!1,this.init_done=!0):this._error(o)},du.prototype.params=function(){throw new Error("deflateParams Not supported")},du.prototype._writeCheck=function(){if(!this.init_done)throw new Error("write before init");if(0===this.mode)throw new Error("already finalized");if(this.write_in_progress)throw new Error("write already in progress");if(this.pending_close)throw new Error("close is pending")},du.prototype.write=function(e,t,n,r,i,o,a){this._writeCheck(),this.write_in_progress=!0;var s=this;return N.nextTick((function(){s.write_in_progress=!1;var u=s._write(e,t,n,r,i,o,a);s.callback(u[0],u[1]),s.pending_close&&s.close()})),this},du.prototype.writeSync=function(e,t,n,r,i,o,a){return this._writeCheck(),this._write(e,t,n,r,i,o,a)},du.prototype._write=function(e,t,n,r,i,o,a){if(this.write_in_progress=!0,0!==e&&1!==e&&2!==e&&3!==e&&4!==e&&5!==e)throw new Error("Invalid flush value");null==t&&(t=new oe(0),r=0,n=0),i._set?i.set=i._set:i.set=pu;var s,u=this.strm;switch(u.avail_in=r,u.input=t,u.next_in=n,u.avail_out=a,u.output=i,u.next_out=o,this.mode){case 1:case 3:case 5:s=Gs(u,e);break;case 7:case 2:case 4:case 6:s=fu(u,e);break;default:throw new Error("Unknown mode "+this.mode)}return 1!==s&&0!==s&&this._error(s),this.write_in_progress=!1,[u.avail_in,u.avail_out]},du.prototype.close=function(){this.write_in_progress?this.pending_close=!0:(this.pending_close=!1,1===this.mode||3===this.mode||5===this.mode?function(e){var t;e&&e.state&&(42!==(t=e.state.status)&&69!==t&&73!==t&&91!==t&&t!==Rs&&t!==Ns&&t!==Is?Ps(e,Ss):(e.state=null,t===Ns&&Ps(e,-3)))}(this.strm):function(e){if(!e||!e.state)return eu;var t=e.state;t.window&&(t.window=null),e.state=null}(this.strm),this.mode=0)},du.prototype.reset=function(){switch(this.mode){case 1:case 5:hu=qs(this.strm);break;case 2:case 6:hu=ou(this.strm)}0!==hu&&this._error(hu)},du.prototype._error=function(e){this.onerror(Na[e]+": "+this.strm.msg,e),this.write_in_progress=!1,this.pending_close&&this.close()};var vu=Object.freeze({__proto__:null,NONE:0,DEFLATE:1,INFLATE:2,GZIP:3,GUNZIP:4,DEFLATERAW:5,INFLATERAW:6,UNZIP:7,Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8,Zlib:du});var gu={};Object.keys(vu).forEach((function(e){gu[e]=vu[e]})),gu.Z_MIN_WINDOWBITS=8,gu.Z_MAX_WINDOWBITS=15,gu.Z_DEFAULT_WINDOWBITS=15,gu.Z_MIN_CHUNK=64,gu.Z_MAX_CHUNK=1/0,gu.Z_DEFAULT_CHUNK=16384,gu.Z_MIN_MEMLEVEL=1,gu.Z_MAX_MEMLEVEL=9,gu.Z_DEFAULT_MEMLEVEL=8,gu.Z_MIN_LEVEL=-1,gu.Z_MAX_LEVEL=9,gu.Z_DEFAULT_LEVEL=gu.Z_DEFAULT_COMPRESSION;var _u={Z_OK:gu.Z_OK,Z_STREAM_END:gu.Z_STREAM_END,Z_NEED_DICT:gu.Z_NEED_DICT,Z_ERRNO:gu.Z_ERRNO,Z_STREAM_ERROR:gu.Z_STREAM_ERROR,Z_DATA_ERROR:gu.Z_DATA_ERROR,Z_MEM_ERROR:gu.Z_MEM_ERROR,Z_BUF_ERROR:gu.Z_BUF_ERROR,Z_VERSION_ERROR:gu.Z_VERSION_ERROR};function mu(e){return new Fu(e)}function yu(e){return new Wu(e)}function wu(e){return new qu(e)}function bu(e){return new Gu(e)}function Eu(e){return new Hu(e)}function Au(e){return new Zu(e)}function Tu(e){return new $u(e)}function ku(e,t,n){return"function"==typeof t&&(n=t,t={}),Mu(new Fu(t),e,n)}function Su(e,t){return zu(new Fu(t),e)}function Ou(e,t,n){return"function"==typeof t&&(n=t,t={}),Mu(new Hu(t),e,n)}function Cu(e,t){return zu(new Hu(t),e)}function Ru(e,t,n){return"function"==typeof t&&(n=t,t={}),Mu(new qu(t),e,n)}function Nu(e,t){return zu(new qu(t),e)}function Iu(e,t,n){return"function"==typeof t&&(n=t,t={}),Mu(new $u(t),e,n)}function Pu(e,t){return zu(new $u(t),e)}function xu(e,t,n){return"function"==typeof t&&(n=t,t={}),Mu(new Wu(t),e,n)}function Lu(e,t){return zu(new Wu(t),e)}function Bu(e,t,n){return"function"==typeof t&&(n=t,t={}),Mu(new Zu(t),e,n)}function ju(e,t){return zu(new Zu(t),e)}function Uu(e,t,n){return"function"==typeof t&&(n=t,t={}),Mu(new Gu(t),e,n)}function Du(e,t){return zu(new Gu(t),e)}function Mu(e,t,n){var r=[],i=0;function o(){for(var t;null!==(t=e.read());)r.push(t),i+=t.length;e.once("readable",o)}function a(){var t=oe.concat(r,i);r=[],n(null,t),e.close()}e.on("error",(function(t){e.removeListener("end",a),e.removeListener("readable",o),n(t)})),e.on("end",a),e.end(t),o()}function zu(e,t){if("string"==typeof t&&(t=new oe(t)),!oe.isBuffer(t))throw new TypeError("Not a string or buffer");var n=gu.Z_FINISH;return e._processChunk(t,n)}function Fu(e){if(!(this instanceof Fu))return new Fu(e);Ku.call(this,e,gu.DEFLATE)}function Wu(e){if(!(this instanceof Wu))return new Wu(e);Ku.call(this,e,gu.INFLATE)}function Hu(e){if(!(this instanceof Hu))return new Hu(e);Ku.call(this,e,gu.GZIP)}function Zu(e){if(!(this instanceof Zu))return new Zu(e);Ku.call(this,e,gu.GUNZIP)}function qu(e){if(!(this instanceof qu))return new qu(e);Ku.call(this,e,gu.DEFLATERAW)}function Gu(e){if(!(this instanceof Gu))return new Gu(e);Ku.call(this,e,gu.INFLATERAW)}function $u(e){if(!(this instanceof $u))return new $u(e);Ku.call(this,e,gu.UNZIP)}function Ku(e,t){if(this._opts=e=e||{},this._chunkSize=e.chunkSize||gu.Z_DEFAULT_CHUNK,Ri.call(this,e),e.flush&&e.flush!==gu.Z_NO_FLUSH&&e.flush!==gu.Z_PARTIAL_FLUSH&&e.flush!==gu.Z_SYNC_FLUSH&&e.flush!==gu.Z_FULL_FLUSH&&e.flush!==gu.Z_FINISH&&e.flush!==gu.Z_BLOCK)throw new Error("Invalid flush flag: "+e.flush);if(this._flushFlag=e.flush||gu.Z_NO_FLUSH,e.chunkSize&&(e.chunkSize<gu.Z_MIN_CHUNK||e.chunkSize>gu.Z_MAX_CHUNK))throw new Error("Invalid chunk size: "+e.chunkSize);if(e.windowBits&&(e.windowBits<gu.Z_MIN_WINDOWBITS||e.windowBits>gu.Z_MAX_WINDOWBITS))throw new Error("Invalid windowBits: "+e.windowBits);if(e.level&&(e.level<gu.Z_MIN_LEVEL||e.level>gu.Z_MAX_LEVEL))throw new Error("Invalid compression level: "+e.level);if(e.memLevel&&(e.memLevel<gu.Z_MIN_MEMLEVEL||e.memLevel>gu.Z_MAX_MEMLEVEL))throw new Error("Invalid memLevel: "+e.memLevel);if(e.strategy&&e.strategy!=gu.Z_FILTERED&&e.strategy!=gu.Z_HUFFMAN_ONLY&&e.strategy!=gu.Z_RLE&&e.strategy!=gu.Z_FIXED&&e.strategy!=gu.Z_DEFAULT_STRATEGY)throw new Error("Invalid strategy: "+e.strategy);if(e.dictionary&&!oe.isBuffer(e.dictionary))throw new Error("Invalid dictionary: it should be a Buffer instance");this._binding=new gu.Zlib(t);var n=this;this._hadError=!1,this._binding.onerror=function(e,t){n._binding=null,n._hadError=!0;var r=new Error(e);r.errno=t,r.code=gu.codes[t],n.emit("error",r)};var r=gu.Z_DEFAULT_COMPRESSION;"number"==typeof e.level&&(r=e.level);var i=gu.Z_DEFAULT_STRATEGY;"number"==typeof e.strategy&&(i=e.strategy),this._binding.init(e.windowBits||gu.Z_DEFAULT_WINDOWBITS,r,e.memLevel||gu.Z_DEFAULT_MEMLEVEL,i,e.dictionary),this._buffer=new oe(this._chunkSize),this._offset=0,this._closed=!1,this._level=r,this._strategy=i,this.once("end",this.close)}Object.keys(_u).forEach((function(e){_u[_u[e]]=e})),Ze(Ku,Ri),Ku.prototype.params=function(e,t,n){if(e<gu.Z_MIN_LEVEL||e>gu.Z_MAX_LEVEL)throw new RangeError("Invalid compression level: "+e);if(t!=gu.Z_FILTERED&&t!=gu.Z_HUFFMAN_ONLY&&t!=gu.Z_RLE&&t!=gu.Z_FIXED&&t!=gu.Z_DEFAULT_STRATEGY)throw new TypeError("Invalid strategy: "+t);if(this._level!==e||this._strategy!==t){var r=this;this.flush(gu.Z_SYNC_FLUSH,(function(){r._binding.params(e,t),r._hadError||(r._level=e,r._strategy=t,n&&n())}))}else N.nextTick(n)},Ku.prototype.reset=function(){return this._binding.reset()},Ku.prototype._flush=function(e){this._transform(new oe(0),"",e)},Ku.prototype.flush=function(e,t){var n=this._writableState;if(("function"==typeof e||void 0===e&&!t)&&(t=e,e=gu.Z_FULL_FLUSH),n.ended)t&&N.nextTick(t);else if(n.ending)t&&this.once("end",t);else if(n.needDrain){var r=this;this.once("drain",(function(){r.flush(t)}))}else this._flushFlag=e,this.write(new oe(0),"",t)},Ku.prototype.close=function(e){if(e&&N.nextTick(e),!this._closed){this._closed=!0,this._binding.close();var t=this;N.nextTick((function(){t.emit("close")}))}},Ku.prototype._transform=function(e,t,n){var r,i=this._writableState,o=(i.ending||i.ended)&&(!e||i.length===e.length);if(null===!e&&!oe.isBuffer(e))return n(new Error("invalid input"));o?r=gu.Z_FINISH:(r=this._flushFlag,e.length>=i.length&&(this._flushFlag=this._opts.flush||gu.Z_NO_FLUSH)),this._processChunk(e,r,n)},Ku.prototype._processChunk=function(e,t,n){var r=e&&e.length,i=this._chunkSize-this._offset,o=0,a=this,s="function"==typeof n;if(!s){var u,c=[],l=0;this.on("error",(function(e){u=e}));do{var f=this._binding.writeSync(t,e,o,r,this._buffer,this._offset,i)}while(!this._hadError&&p(f[0],f[1]));if(this._hadError)throw u;var h=oe.concat(c,l);return this.close(),h}var d=this._binding.write(t,e,o,r,this._buffer,this._offset,i);function p(u,f){if(!a._hadError){var h=i-f;if(function(e,t){if(!e)throw new Error(t)}(h>=0,"have should not go down"),h>0){var d=a._buffer.slice(a._offset,a._offset+h);a._offset+=h,s?a.push(d):(c.push(d),l+=d.length)}if((0===f||a._offset>=a._chunkSize)&&(i=a._chunkSize,a._offset=0,a._buffer=new oe(a._chunkSize)),0===f){if(o+=r-u,r=u,!s)return!0;var v=a._binding.write(t,e,o,r,a._buffer,a._offset,a._chunkSize);return v.callback=p,void(v.buffer=e)}if(!s)return!1;n()}}d.buffer=e,d.callback=p},Ze(Fu,Ku),Ze(Wu,Ku),Ze(Hu,Ku),Ze(Zu,Ku),Ze(qu,Ku),Ze(Gu,Ku),Ze($u,Ku);var Yu={codes:_u,createDeflate:mu,createInflate:yu,createDeflateRaw:wu,createInflateRaw:bu,createGzip:Eu,createGunzip:Au,createUnzip:Tu,deflate:ku,deflateSync:Su,gzip:Ou,gzipSync:Cu,deflateRaw:Ru,deflateRawSync:Nu,unzip:Iu,unzipSync:Pu,inflate:xu,inflateSync:Lu,gunzip:Bu,gunzipSync:ju,inflateRaw:Uu,inflateRawSync:Du,Deflate:Fu,Inflate:Wu,Gzip:Hu,Gunzip:Zu,DeflateRaw:qu,InflateRaw:Gu,Unzip:$u,Zlib:Ku},Vu=Object.freeze({__proto__:null,codes:_u,createDeflate:mu,createInflate:yu,createDeflateRaw:wu,createInflateRaw:bu,createGzip:Eu,createGunzip:Au,createUnzip:Tu,deflate:ku,deflateSync:Su,gzip:Ou,gzipSync:Cu,deflateRaw:Ru,deflateRawSync:Nu,unzip:Iu,unzipSync:Pu,inflate:xu,inflateSync:Lu,gunzip:Bu,gunzipSync:ju,inflateRaw:Uu,inflateRawSync:Du,Deflate:Fu,Inflate:Wu,Gzip:Hu,Gunzip:Zu,DeflateRaw:qu,InflateRaw:Gu,Unzip:$u,Zlib:Ku,default:Yu}),Ju=[["axios@0.21.1","/Users/nguyentuankiet/Work/Zalo/Projects/ZaloMiniProgram/TestNewFunction"]],Qu="axios@0.21.1",Xu="axios@0.21.1",ec="sha512-dKQiRHxGD9PPRIUNIWvZhPTPpl1rf/OxTYKsqKUDjBwYylTvV7SjSHJb9ratfyzM6wCdLCOYLzs73qpg5c4iGA==",tc="/zmp-sdk/axios",nc={},rc={type:"version",registry:!0,raw:"axios@0.21.1",name:"axios",escapedName:"axios",rawSpec:"0.21.1",saveSpec:null,fetchSpec:"0.21.1"},ic=["/zmp-sdk"],oc="https://registry.npmjs.org/axios/-/axios-0.21.1.tgz",ac="0.21.1",sc="/Users/nguyentuankiet/Work/Zalo/Projects/ZaloMiniProgram/TestNewFunction",uc={name:"Matt Zabriskie"},cc={"./lib/adapters/http.js":"./lib/adapters/xhr.js"},lc={url:"https://github.com/axios/axios/issues"},fc=[{path:"./dist/axios.min.js",threshold:"5kB"}],hc={"follow-redirects":"^1.10.0"},dc="Promise based HTTP client for the browser and node.js",pc={bundlesize:"^0.17.0",coveralls:"^3.0.0","es6-promise":"^4.2.4",grunt:"^1.0.2","grunt-banner":"^0.6.0","grunt-cli":"^1.2.0","grunt-contrib-clean":"^1.1.0","grunt-contrib-watch":"^1.0.0","grunt-eslint":"^20.1.0","grunt-karma":"^2.0.0","grunt-mocha-test":"^0.13.3","grunt-ts":"^6.0.0-beta.19","grunt-webpack":"^1.0.18","istanbul-instrumenter-loader":"^1.0.0","jasmine-core":"^2.4.1",karma:"^1.3.0","karma-chrome-launcher":"^2.2.0","karma-coverage":"^1.1.1","karma-firefox-launcher":"^1.1.0","karma-jasmine":"^1.1.1","karma-jasmine-ajax":"^0.1.13","karma-opera-launcher":"^1.0.0","karma-safari-launcher":"^1.0.0","karma-sauce-launcher":"^1.2.0","karma-sinon":"^1.0.5","karma-sourcemap-loader":"^0.3.7","karma-webpack":"^1.7.0","load-grunt-tasks":"^3.5.2",minimist:"^1.2.0",mocha:"^5.2.0",sinon:"^4.5.0",typescript:"^2.8.1","url-search-params":"^0.10.0",webpack:"^1.13.1","webpack-dev-server":"^1.14.1"},vc="https://github.com/axios/axios",gc="dist/axios.min.js",_c=["xhr","http","ajax","promise","node"],mc="index.js",yc="axios",wc={type:"git",url:"git+https://github.com/axios/axios.git"},bc={build:"NODE_ENV=production grunt build",coveralls:"cat coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js",examples:"node ./examples/server.js",fix:"eslint --fix lib/**/*.js",postversion:"git push && git push --tags",preversion:"npm test",start:"node ./sandbox/server.js",test:"grunt test && bundlesize",version:"npm run build && grunt version && git add -A dist && git add CHANGELOG.md bower.json package.json"},Ec="./index.d.ts",Ac="dist/axios.min.js",Tc="0.21.1",kc={_args:Ju,_from:Qu,_id:Xu,_inBundle:false,_integrity:ec,_location:tc,_phantomChildren:nc,_requested:rc,_requiredBy:ic,_resolved:oc,_spec:ac,_where:sc,author:uc,browser:cc,bugs:lc,bundlesize:fc,dependencies:hc,description:dc,devDependencies:pc,homepage:vc,jsdelivr:gc,keywords:_c,license:"MIT",main:mc,name:yc,repository:wc,scripts:bc,typings:Ec,unpkg:Ac,version:Tc},Sc=Object.freeze({__proto__:null,_args:Ju,_from:Qu,_id:Xu,_inBundle:false,_integrity:ec,_location:tc,_phantomChildren:nc,_requested:rc,_requiredBy:ic,_resolved:oc,_spec:ac,_where:sc,author:uc,browser:cc,bugs:lc,bundlesize:fc,dependencies:hc,description:dc,devDependencies:pc,homepage:vc,jsdelivr:gc,keywords:_c,license:"MIT",main:mc,name:yc,repository:wc,scripts:bc,typings:Ec,unpkg:Ac,version:Tc,default:kc}),Oc=r(Vu),Cc=r(Sc),Rc=Ca.http,Nc=Ca.https,Ic=/https:?/;function Pc(e,t,n){if(e.hostname=t.host,e.host=t.host,e.port=t.port,e.path=n,t.auth){var r=oe.from(t.auth.username+":"+t.auth.password,"utf8").toString("base64");e.headers["Proxy-Authorization"]="Basic "+r}e.beforeRedirect=function(e){e.headers.host=e.host,Pc(e,t,e.href)}}var xc=function(e){return new Promise((function(t,n){var r=function(e){t(e)},i=function(e){n(e)},o=e.data,a=e.headers;if(a["User-Agent"]||a["user-agent"]||(a["User-Agent"]="axios/"+Cc.version),o&&!rr.isStream(o)){if(oe.isBuffer(o));else if(rr.isArrayBuffer(o))o=oe.from(new Uint8Array(o));else{if(!rr.isString(o))return i(pr("Data after transformation must be a string, an ArrayBuffer, a Buffer, or a Stream",e));o=oe.from(o,"utf-8")}a["Content-Length"]=o.length}var s=void 0;e.auth&&(s=(e.auth.username||"")+":"+(e.auth.password||""));var u=_r(e.baseURL,e.url),c=la.parse(u),l=c.protocol||"http:";if(!s&&c.auth){var f=c.auth.split(":");s=(f[0]||"")+":"+(f[1]||"")}s&&delete a.Authorization;var h=Ic.test(l),d=h?e.httpsAgent:e.httpAgent,p={path:or(c.path,e.params,e.paramsSerializer).replace(/^\?/,""),method:e.method.toUpperCase(),headers:a,agent:d,agents:{http:e.httpAgent,https:e.httpsAgent},auth:s};e.socketPath?p.socketPath=e.socketPath:(p.hostname=c.hostname,p.port=c.port);var v,g=e.proxy;if(!g&&!1!==g){var _=l.slice(0,-1)+"_proxy",m=N.env[_]||N.env[_.toUpperCase()];if(m){var y=la.parse(m),w=N.env.no_proxy||N.env.NO_PROXY,b=!0;if(w)b=!w.split(",").map((function(e){return e.trim()})).some((function(e){return!!e&&("*"===e||("."===e[0]&&c.hostname.substr(c.hostname.length-e.length)===e||c.hostname===e))}));if(b&&(g={host:y.hostname,port:y.port,protocol:y.protocol},y.auth)){var E=y.auth.split(":");g.auth={username:E[0],password:E[1]}}}}g&&(p.headers.host=c.hostname+(c.port?":"+c.port:""),Pc(p,g,l+"//"+c.hostname+(c.port?":"+c.port:"")+p.path));var A=h&&(!g||Ic.test(g.protocol));e.transport?v=e.transport:0===e.maxRedirects?v=fa:(e.maxRedirects&&(p.maxRedirects=e.maxRedirects),v=A?Nc:Rc),e.maxBodyLength>-1&&(p.maxBodyLength=e.maxBodyLength);var T=v.request(p,(function(t){if(!T.aborted){var n=t,o=t.req||T;if(204!==t.statusCode&&"HEAD"!==o.method&&!1!==e.decompress)switch(t.headers["content-encoding"]){case"gzip":case"compress":case"deflate":n=n.pipe(Oc.createUnzip()),delete t.headers["content-encoding"]}var a={status:t.statusCode,statusText:t.statusMessage,headers:t.headers,config:e,request:o};if("stream"===e.responseType)a.data=n,vr(r,i,a);else{var s=[];n.on("data",(function(t){s.push(t),e.maxContentLength>-1&&oe.concat(s).length>e.maxContentLength&&(n.destroy(),i(pr("maxContentLength size of "+e.maxContentLength+" exceeded",e,null,o)))})),n.on("error",(function(t){T.aborted||i(dr(t,e,null,o))})),n.on("end",(function(){var t=oe.concat(s);"arraybuffer"!==e.responseType&&(t=t.toString(e.responseEncoding),e.responseEncoding&&"utf8"!==e.responseEncoding||(t=rr.stripBOM(t))),a.data=t,vr(r,i,a)}))}}}));T.on("error",(function(t){T.aborted&&"ERR_FR_TOO_MANY_REDIRECTS"!==t.code||i(dr(t,e,null,T))})),e.timeout&&T.setTimeout(e.timeout,(function(){T.abort(),i(pr("timeout of "+e.timeout+"ms exceeded",e,"ECONNABORTED",T))})),e.cancelToken&&e.cancelToken.promise.then((function(e){T.aborted||(T.abort(),i(e))})),rr.isStream(o)?o.on("error",(function(t){i(dr(t,e,null,T))})).pipe(T):T.end(o)}))},Lc={"Content-Type":"application/x-www-form-urlencoded"};function Bc(e,t){!rr.isUndefined(e)&&rr.isUndefined(e["Content-Type"])&&(e["Content-Type"]=t)}var jc,Uc={adapter:("undefined"!=typeof XMLHttpRequest?jc=wr:void 0!==N&&"[object process]"===Object.prototype.toString.call(N)&&(jc=xc),jc),transformRequest:[function(e,t){return hr(t,"Accept"),hr(t,"Content-Type"),rr.isFormData(e)||rr.isArrayBuffer(e)||rr.isBuffer(e)||rr.isStream(e)||rr.isFile(e)||rr.isBlob(e)?e:rr.isArrayBufferView(e)?e.buffer:rr.isURLSearchParams(e)?(Bc(t,"application/x-www-form-urlencoded;charset=utf-8"),e.toString()):rr.isObject(e)?(Bc(t,"application/json;charset=utf-8"),JSON.stringify(e)):e}],transformResponse:[function(e){if("string"==typeof e)try{e=JSON.parse(e)}catch(e){}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,validateStatus:function(e){return e>=200&&e<300}};Uc.headers={common:{Accept:"application/json, text/plain, */*"}},rr.forEach(["delete","get","head"],(function(e){Uc.headers[e]={}})),rr.forEach(["post","put","patch"],(function(e){Uc.headers[e]=rr.merge(Lc)}));var Dc=Uc;function Mc(e){e.cancelToken&&e.cancelToken.throwIfRequested()}var zc=function(e){return Mc(e),e.headers=e.headers||{},e.data=lr(e.data,e.headers,e.transformRequest),e.headers=rr.merge(e.headers.common||{},e.headers[e.method]||{},e.headers),rr.forEach(["delete","get","head","post","put","patch","common"],(function(t){delete e.headers[t]})),(e.adapter||Dc.adapter)(e).then((function(t){return Mc(e),t.data=lr(t.data,t.headers,e.transformResponse),t}),(function(t){return fr(t)||(Mc(e),t&&t.response&&(t.response.data=lr(t.response.data,t.response.headers,e.transformResponse))),Promise.reject(t)}))},Fc=function(e,t){t=t||{};var n={},r=["url","method","data"],i=["headers","auth","proxy","params"],o=["baseURL","transformRequest","transformResponse","paramsSerializer","timeout","timeoutMessage","withCredentials","adapter","responseType","xsrfCookieName","xsrfHeaderName","onUploadProgress","onDownloadProgress","decompress","maxContentLength","maxBodyLength","maxRedirects","transport","httpAgent","httpsAgent","cancelToken","socketPath","responseEncoding"],a=["validateStatus"];function s(e,t){return rr.isPlainObject(e)&&rr.isPlainObject(t)?rr.merge(e,t):rr.isPlainObject(t)?rr.merge({},t):rr.isArray(t)?t.slice():t}function u(r){rr.isUndefined(t[r])?rr.isUndefined(e[r])||(n[r]=s(void 0,e[r])):n[r]=s(e[r],t[r])}rr.forEach(r,(function(e){rr.isUndefined(t[e])||(n[e]=s(void 0,t[e]))})),rr.forEach(i,u),rr.forEach(o,(function(r){rr.isUndefined(t[r])?rr.isUndefined(e[r])||(n[r]=s(void 0,e[r])):n[r]=s(void 0,t[r])})),rr.forEach(a,(function(r){r in t?n[r]=s(e[r],t[r]):r in e&&(n[r]=s(void 0,e[r]))}));var c=r.concat(i).concat(o).concat(a),l=Object.keys(e).concat(Object.keys(t)).filter((function(e){return-1===c.indexOf(e)}));return rr.forEach(l,u),n};function Wc(e){this.defaults=e,this.interceptors={request:new cr,response:new cr}}Wc.prototype.request=function(e){"string"==typeof e?(e=arguments[1]||{}).url=arguments[0]:e=e||{},(e=Fc(this.defaults,e)).method?e.method=e.method.toLowerCase():this.defaults.method?e.method=this.defaults.method.toLowerCase():e.method="get";var t=[zc,void 0],n=Promise.resolve(e);for(this.interceptors.request.forEach((function(e){t.unshift(e.fulfilled,e.rejected)})),this.interceptors.response.forEach((function(e){t.push(e.fulfilled,e.rejected)}));t.length;)n=n.then(t.shift(),t.shift());return n},Wc.prototype.getUri=function(e){return e=Fc(this.defaults,e),or(e.url,e.params,e.paramsSerializer).replace(/^\?/,"")},rr.forEach(["delete","get","head","options"],(function(e){Wc.prototype[e]=function(t,n){return this.request(Fc(n||{},{method:e,url:t,data:(n||{}).data}))}})),rr.forEach(["post","put","patch"],(function(e){Wc.prototype[e]=function(t,n,r){return this.request(Fc(r||{},{method:e,url:t,data:n}))}}));var Hc=Wc;function Zc(e){this.message=e}Zc.prototype.toString=function(){return"Cancel"+(this.message?": "+this.message:"")},Zc.prototype.__CANCEL__=!0;var qc=Zc;function Gc(e){if("function"!=typeof e)throw new TypeError("executor must be a function.");var t;this.promise=new Promise((function(e){t=e}));var n=this;e((function(e){n.reason||(n.reason=new qc(e),t(n.reason))}))}Gc.prototype.throwIfRequested=function(){if(this.reason)throw this.reason},Gc.source=function(){var e;return{token:new Gc((function(t){e=t})),cancel:e}};var $c=Gc;function Kc(e){var t=new Hc(e),n=Yn(Hc.prototype.request,t);return rr.extend(n,Hc.prototype,t),rr.extend(n,t),n}var Yc=Kc(Dc);Yc.Axios=Hc,Yc.create=function(e){return Kc(Fc(Yc.defaults,e))},Yc.Cancel=qc,Yc.CancelToken=$c,Yc.isCancel=fr,Yc.all=function(e){return Promise.all(e)},Yc.spread=function(e){return function(t){return e.apply(null,t)}},Yc.isAxiosError=function(e){return"object"==typeof e&&!0===e.isAxiosError};var Vc=Yc,Jc=Yc;Vc.default=Jc;var Qc=Vc,Xc=(()=>{const e=Nn();return{MINI_APP_LINK:"https://zalo.me/app/link/zapps",MINI_APP_INTERNAL_LINK:"https://h5.zdn.vn/zapps",COOKIE_NAME:{ZOAUTH:"h5.zdn.vn_zoauth",ZACC_SESSiON:"h5.zdn.vn_zacc_session",JS_TOKEN:"h5.zdn.vn_zlink3rd",ZOAUTH_VRF:"h5.zdn.vn_zoauth_vrf"},APIS:{GET_USER_INFO:"https://graph.zalo.me/v2.0/me",GET_ACCESS_TOKEN:"https://h5.zalo.me/openapi/access_token",GET_ACCESS_TOKEN_V3:"https://oauth.zaloapp.com/v3/access_token"},STORAGE_DATA_LIMIT:102400,STORAGE_LIMIT:5242880,NETWORK_TYPE:{NONE:e.isAndroid?-2:0,WIFI:e.isAndroid?0:1,"2G":(e.isAndroid,2),"3G":e.isAndroid?15:2,"4G":e.isAndroid?13:2}}})();const el={encode:function(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("&")},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:el.encode(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?"undefined":typeof 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?"undefined":typeof r)?JSON.stringify(r):encodeURIComponent(r)].join("=");n.push(i)})),n.join("&")}};var tl={},nl=function(e,t,n){var r=t||"default";return function(){var t=r in tl?tl[r](e,n):e;return t.apply(this,arguments)}};nl.setWrapper=function(e){var t=arguments.length<=1||void 0===arguments[1]?"default":arguments[1];tl[t]=e};var rl={error:{code:1,error_subcode:1357046,message:"Received Invalid JSON reply.",type:"http"}};function il(e){try{return null===e?rl:JSON.parse(e)}catch(e){return rl}}var ol={execute:function(e,t,n,r){n.suppress_http_code=1;var i=el.encode(n);"post"!=t&&(e=el.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=nl((function(){o=r,"onload"in i&&i.onload(n)}),"entry","XMLHttpRequest:load"),a=nl((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(il(e.responseText))},o.onerror=function(e){e.responseText?r(il(e.responseText)):r({error:{code:1,error_subcode:1357045,message:"unknown error (empty response)",status:e.status,type:"http"}})},o.send(i),!0)}};class al extends $n{constructor(){super(),this.debug=cn("zmp:ZaloJSBridge"),this.events=Kn.getInstance(),this._accessTk=jn("zacc_session")||"DEFAULT_ACCESS_TOKEN",this._jsAccessTk=jn("zlink3rd")||"DEFAULT_JS_TOKEN",this.results=[],this._userAgent=Rn(),this._device=Nn(),this._jsCallFuncCallbacks={},this.events.on(e.Events.AppPaused,(()=>{if(this.results.length>0){let e=this.results;this.results=[];try{this.sendLogData(e)}catch(e){}}})),this.sendLogTimer?clearInterval(this.sendLogTimer):this.sendLogTimer=setInterval((()=>{if(this.results.length>0){let e=this.results;this.results=[];try{this.sendLogData(e)}catch(e){}}}),5e3)}static getInstance(){return al.instance||(al.instance=new al),al.instance}set accessTk(e){this._accessTk=e}set jsAccessTk(e){this._jsAccessTk=e}sendLogData(e){try{ol.execute("https://h5.zalo.me/log/async","post",{appId:window.APP_ID,data:JSON.stringify(e)},(e=>{}))}catch(e){}}onJSCall(e,t){try{const n=Un(t);if(this._jsCallFuncCallbacks[e]){const t=this._jsCallFuncCallbacks[e].callback,r=this._jsCallFuncCallbacks[e].timeout;if(t){try{t.call(this,n)}catch(e){console.error("Call callback error",e)}r&&clearTimeout(r),this._jsCallFuncCallbacks[e]=null,delete this._jsCallFuncCallbacks[e]}}this.results.push({action:n.action,error:n.error_code})}catch(e){console.log("onJSCall","error",e)}}onMultiJSCall(e,t){try{const n=Un(t);if(this._jsCallFuncCallbacks[e]){const t=this._jsCallFuncCallbacks[e].callback,r=this._jsCallFuncCallbacks[e].timeout;if(t){try{t.call(this,n)}catch(e){console.error("Call callback error",e)}r&&clearTimeout(r)}}this.results.push({action:n.action,error:n.error_code})}catch(e){console.log("onMultiJSCall","error",e)}}nativeEventHandler(e,t,n){this.debug(`eventId: ${e}, eventName: ${t}, eventData: ${n}`);const r=Fn(n);this.debug(r),this.events.emit(t,e,r)}defaultCallback(e){null!=e&&(e=Un(e))}jsCall(e,t,n,r=!1,o=3,a=!0){try{const s=((e="")=>`${e.normalize("NFD").replace(Tn,"").replace(kn,"d").replace(Sn,"").toLowerCase()}_${Math.random().toString(36).substr(2,4)}`)(e);if(!this._device.isMobile||i.isEmpty(e))return this.onJSCall(s,{error_code:-13,error_message:"params invalid!",data:{device:this._device.isMobile,jsToken:this._jsAccessTk,access_token:this._accessTk},action:e}),!1;null==t&&(t={}),n||(n=this.defaultCallback);const u={error_code:-14,error_message:"Request Timeout!",data:{},action:e};this._jsCallFuncCallbacks[s]={timeout:a&&pn.includes(e)&&setTimeout((()=>{this.onJSCall(s,u)}),8e3),callback:n};try{return t=Dn(t),r?this._device.isIOS?ZaloJavaScriptInterface.jsCall(this._jsAccessTk,e,this._accessTk,t,window.onMultiJSCall(s)):ZaloJavaScriptInterface.jsCall(this._jsAccessTk,e,this._accessTk,t,`window.onMultiJSCall('${s}')`):this._device.isIOS?ZaloJavaScriptInterface.jsCall(this._jsAccessTk,e,this._accessTk,t,window.onJSCall(s)):ZaloJavaScriptInterface.jsCall(this._jsAccessTk,e,this._accessTk,t,`window.onJSCall('${s}')`)}catch(i){if(!(o-- >0)){const n={error_code:-5,error_message:"Not ready!",data:{userAgent:this._userAgent,options:t,jsToken:this._jsAccessTk,access_token:this._accessTk},action:e,js_error:i};return this.onJSCall(s,n),!1}setTimeout((()=>{this.jsCall(e,t,n,r,o)}),500)}}catch(e){console.log("jsCall","error",e)}return!1}}class sl{constructor(e,t,n){this.code=e,this.message=t,this.api=n}toString(){return`api: ${this.api}; code: ${this.code}; message: ${this.message}`}}class ul extends sl{constructor(e,t){super(e,t),this.message=`${t}. ${wn.READ_MORE}`,this.handler()}handler(){switch(this.code){case e.NativeCode.token_invalid:this.code=_n,this.message=wn.LOGIN_REQUIRED;break;case e.NativeCode.not_permission:this.code=mn,this.message=wn.NOT_PERMISSION;break;case e.NativeCode.client_not_support:this.code=yn,this.message=wn.CLIENT_NOT_SUPPORT;break;case e.NativeCode.decode_failed:this.message=wn.DECODE_FAILED}}}const cl={handler:null,setHandler(e){this.handler=e}};cl.setHandler(((e,t)=>t instanceof sl?(t.api=e,t):new sl(-2001,i.isNull(t.message)?"Unknown Error":t.message,e)));const ll=(e,t,n)=>{const r=n.value;return n.value=function(...e){return Zn(this,void 0,void 0,(function*(){const{success:n,fail:o}=Array.isArray(e)&&e.length>0&&e[0];return new Promise(((a,s)=>Zn(this,void 0,void 0,(function*(){try{const t=yield r.apply(this,e);!i.isNull(n)&&i.isFunction(n)?n.call(null,t,this):a(t)}catch(e){if((null==e?void 0:e.code)===_n||(null==e?void 0:e.code)===mn){let t=!1;this instanceof Tf&&(t=this.getLoginStatus()),t||(e=new sl(_n,wn.LOGIN_REQUIRED))}const{handler:n}=cl,r=n.call(null,t,e,this);window.zmpSentry&&window.zmpSentry.throwError(r.toString()),!i.isNull(o)&&i.isFunction(o)?o.call(null,r,this):console.error("Error:",r)}}))))}))},n},fl=(e,t,n)=>{const r=n.value;return n.value=function(...e){try{return r.apply(this,e)}catch(e){if((null==e?void 0:e.code)===_n||(null==e?void 0:e.code)===mn){let t=!1;this instanceof Tf&&(t=this.getLoginStatus()),t||(e=new sl(_n,wn.LOGIN_REQUIRED))}const{handler:n}=cl;!i.isNull(n)&&i.isFunction(n)?n.call(null,t,e,this):console.warn(e.message)}},n};var hl;class dl{constructor(){hl.set(this,void 0),Gn(this,hl,al.getInstance())}setZAccSession(e){qn(this,hl).accessTk=e}setJSToken(e){qn(this,hl).jsAccessTk=e}callNative(e,t,n){return new Promise(((r,i)=>{const o=o=>Zn(this,void 0,void 0,(function*(){try{const a=new ul(o.error_code,`${o.action}: ${o.error_message}`);if(null==n?void 0:n.callback){const e=yield n.callback(o,a);return r(e)}if(o&&o.error_code>=0)r(o.data||{});else if(o&&o.error_code<0){try{window.zmpSentry&&window.zmpSentry.captureMessage(`${e}: call native fail`,{extra:{data:t,rs:o}})}catch(e){}return i(a)}}catch(e){return i(e)}})),a=Nn().isIOS,s=(e=>{var t,n;const r=e.slice(7,e.length).replace(/\./gi,"_").toUpperCase(),i=Pn(),o=(null===(n=null===(t=dn[r])||void 0===t?void 0:t.version_live)||void 0===n?void 0:n.iOS)||0;return!!(Array.isArray(window.ignoreCheckSupport)&&window.ignoreCheckSupport.length>0&&window.ignoreCheckSupport.includes(e))||i>=o})(e);if(a&&!s){const t=new ul(-5,`${e}: Client isn't support this action`);return i(t)}qn(this,hl).jsCall(e,t,o,null==n?void 0:n.isMultiCallback,null==n?void 0:n.nRetry,null==n?void 0:n.haveTimeout)}))}}hl=new WeakMap;const pl={badRequest:e=>new sl(vn,e),loginFailed:()=>new sl(vn,wn.LOGIN_FAILED),loginRequired:()=>new sl(_n,wn.LOGIN_REQUIRED),missingParam:e=>new sl(vn,`Missing required argument: ${e}`),wrongTypeParam:(e,t,n)=>new sl(vn,`Wrong type of parameter '${e}'. Expected ${t}, but got ${n}`),cannotGetShareInfo:()=>new sl(gn,"Can not get app info to share"),lengthInvalid:e=>new sl(vn,`${e} length is invalid.`)};var vl,gl,_l,ml,yl,wl="2.15.1";class bl{static getVersion(){return wl}static getSystemInfo(){return{version:In("version-id")||"",apiVersion:wl,zaloVersion:Pn(),platform:xn(),language:navigator.language}}static getAppInfo(){return Zn(this,void 0,void 0,(function*(){let e={};const t=this.getAppId(),n=this.getSystemInfo(),r=el.appendToUrl(`https://h5.zalo.me/${bn}`,{appId:t,versionStatus:0,currentVersion:n.version}),i=yield fetch(r,{credentials:"include"});if(i.ok){const t=yield i.json();if(t.err<0||!t.data)throw new Error(t);e={name:t.data.name,version:t.data.version,description:t.data.description,appUrl:t.data.appUrl,qrCodeUrl:t.data.qrCodeUrl}}return e}))}}class El{static setNavigationBarTitle(e){return Zn(this,void 0,void 0,(function*(){yield this.callNative(dn.CHANGE_TITLE_HEADER.name,{title:e.title},{haveTimeout:!1})}))}static setNavigationBarColor(e){return Zn(this,void 0,void 0,(function*(){if(i.isString(e.color)&&e.color.length>0){const t={};i.isEmpty(e.color)||(t.backgroundColor=e.color),i.isEmpty(e.textColor)||(t.textColor=e.textColor),yield this.callNative(dn.CHANGE_ACTIONBAR.name,{actionbarType:5,dataConfig:t,homeConfig:{enable:this.isShowHomeButton?1:0,url:`${Xc.MINI_APP_INTERNAL_LINK}/${this.getAppId()}/`}},{haveTimeout:!1}),this.isShowNavBar=!0}else{const t={};i.isEmpty(e.statusBarColor)||(t.backgroundColor=e.statusBarColor),i.isEmpty(e.textColor)||(t.textColor=e.textColor),yield this.callNative(dn.CHANGE_ACTIONBAR.name,{actionbarType:6,dataConfig:t},{haveTimeout:!1}),this.isShowNavBar=!1}}))}static setNavigationBarLeftButton(e){return Zn(this,void 0,void 0,(function*(){let t={};switch(e.type){case"none":this.isShowHomeButton=!1,t={buttonType:3,dataConfig:{confirmToExit:1},homeConfig:{enable:0,url:`${Xc.MINI_APP_INTERNAL_LINK}/${this.getAppId()}/`}};break;case"back":this.isShowHomeButton=!1,t={buttonType:0,dataConfig:{confirmToExit:1},homeConfig:{enable:0,url:`${Xc.MINI_APP_INTERNAL_LINK}/${this.getAppId()}/`}};break;case"home":this.isShowHomeButton=!0,t={buttonType:3,dataConfig:{confirmToExit:1},homeConfig:{enable:1,url:`${Xc.MINI_APP_INTERNAL_LINK}/${this.getAppId()}/`}};break;case"both":this.isShowHomeButton=!0,t={buttonType:0,dataConfig:{confirmToExit:1},homeConfig:{enable:1,url:`${Xc.MINI_APP_INTERNAL_LINK}/${this.getAppId()}/`}}}yield this.callNative(dn.CHANGE_ACTIONBAR_LEFTBUTTON_TYPE.name,Object.assign({},t),{haveTimeout:!1})}))}static setNavigationBarRightButton(e){return Zn(this,void 0,void 0,(function*(){yield this.callNative(dn.CREATE_OPTIONS_MENU.name,{supportToolBar:e.supportToolBar,reset:e.reset,menuListItems:e.menuListItems,zapp:this.getAppId()})}))}}class Al{static setBackgroundColor(e){return Zn(this,void 0,void 0,(function*(){i.isString(e.backgroundColor)&&e.backgroundColor.length>0&&(yield this.callNative(dn.CHANGE_ACTIONBAR.name,{actionbarType:this.isShowNavBar?5:6,dataConfig:{backgroundColor:e.backgroundColor,textColor:e.textColor}}))}))}}class Tl{constructor(e,t,n,r){this.title=r,this.severity=t;const i=new Date;if(this.time=i.toLocaleTimeString(),this.content=e,n>0){const e=(new Error).stack;this.stack=e?e.replace("Error\n",""):""}}toString(){return(this.content.stack?[this.title,this.severity.toUpperCase(),this.time,this.content,this.content.stack.replace("Error:","")]:[this.title,this.severity.toUpperCase(),this.time,JSON.stringify(this.content),this.stack]).join(" ")}}vl=new WeakMap,gl=new WeakMap,_l=new WeakMap,ml=new WeakMap,yl=new WeakMap;const kl=new class{constructor(){vl.set(this,3),gl.set(this,["none","error","warn","info"]),_l.set(this,"[zmp] > "),ml.set(this,{error:0,warn:0,info:0,firstError:null,lastError:null}),yl.set(this,((e,t,n)=>{qn(this,ml)[qn(this,gl)[e]]++;const r=qn(this,gl)[e];if(Gn(this,_l,qn(this,_l)+("string"!=typeof t?new Tl(t,r,e,n).toString():t)),!(e>qn(this,vl)))switch(e){case 1:console.error(qn(this,_l));break;case 2:console.warn(qn(this,_l));break;case 3:console.info(qn(this,_l));break;default:throw new Error("internal")}}))}setLogLevel(e){Gn(this,vl,e)}info(e){qn(this,yl).call(this,3,e)}warn(e,t){qn(this,yl).call(this,2,e,t)}error(e,t){qn(this,yl).call(this,1,e,t)}getMetrics(){return qn(this,ml)}};class Sl{static setDeviceOrientation(t){return Zn(this,void 0,void 0,(function*(){yield this.callNative(dn.CHANGE_AUTOROTATE.name,{autoRotate:e.OrientationType[t.rotate]})}))}static getNetworkType(t){return Zn(this,void 0,void 0,(function*(){return yield this.callNative(dn.WEBVIEW_NETWORKTYPE.name,{url:window.location.href,featureId:""}).then((t=>{let n;switch(t.network){case Xc.NETWORK_TYPE.NONE:n=e.NetworkType.none;break;case Xc.NETWORK_TYPE.WIFI:n=e.NetworkType.wifi;break;case Xc.NETWORK_TYPE["2G"]:case Xc.NETWORK_TYPE["3G"]:case Xc.NETWORK_TYPE["4G"]:n=e.NetworkType.cellular;break;default:n=e.NetworkType.unknown}return{networkType:n}}))}))}static onNetworkStatusChange(t){return Zn(this,void 0,void 0,(function*(){yield this.events.on(e.Events.NetworkChanged,(e=>{const n=e&&e.state;this.getNetworkType().then((e=>{const r={isConnected:"CONNECTED"===n,networkType:e&&e.networkType};t(r)})).catch((e=>{kl.error(e,"onNetworkStatusChange")}))}))}))}static startBeaconDiscovery(e){var t,n,r,o,a;return Zn(this,void 0,void 0,(function*(){const s={subaction:0,scanning_type:i.isNumber(null==e?void 0:e.scanningType)?e.scanningType:0,data:{scan_from_source:i.isString(null==e?void 0:e.scanFromSource)?e.scanFromSource:"",expire:i.isNumber(null==e?void 0:e.expire)?e.expire:3e3,monitor_interval:i.isNumber(null==e?void 0:e.monitorInterval)?e.monitorInterval:60,domain:i.isString(null==e?void 0:e.domain)?e.domain:"",scan_config:{scan_time:i.isNumber(null===(t=null==e?void 0:e.scanConfig)||void 0===t?void 0:t.scanTime)?e.scanConfig.scanTime:15e3,time_between_scan:i.isNumber(null===(n=null==e?void 0:e.scanConfig)||void 0===n?void 0:n.timeBetweenScan)?e.scanConfig.timeBetweenScan:1e4,beacon_timeout:i.isNumber(null===(r=null==e?void 0:e.scanConfig)||void 0===r?void 0:r.beaconTimeout)?e.scanConfig.beaconTimeout:3e4,delayCheckConnectedTimeout:i.isNumber(null===(o=null==e?void 0:e.scanConfig)||void 0===o?void 0:o.delayCheckConnectedTimeout)?e.scanConfig.delayCheckConnectedTimeout:5e3,beaconConnectedTimeout:i.isNumber(null===(a=null==e?void 0:e.scanConfig)||void 0===a?void 0:a.beaconConnectedTimeout)?e.scanConfig.beaconConnectedTimeout:6e5},items:Array.isArray(null==e?void 0:e.items)?null==e?void 0:e.items:[]}};return yield this.callNative(dn.SCAN_IBEACON.name,Object.assign({},s)),!0}))}static stopBeaconDiscovery(e){return Zn(this,void 0,void 0,(function*(){return yield this.callNative(dn.SCAN_IBEACON.name,Object.assign({},{subaction:2})),!0}))}static getBeacons(e){return Zn(this,void 0,void 0,(function*(){return yield this.callNative(dn.SCAN_IBEACON.name,Object.assign({},{subaction:1}),{isMultiCallback:!0}).then((e=>{const t={beacons:[]};return Array.isArray(e)&&e.forEach((e=>{const n={uuid:e.uuid,major:e.major,minor:e.minor,distance:e.distance,rssi:e.rssi};t.beacons.push(n)})),t}))}))}static stopBluetoothDevicesDiscovery(){return Zn(this,void 0,void 0,(function*(){return this.callNative("",{})}))}static startBluetoothDevicesDiscovery(e){return Zn(this,void 0,void 0,(function*(){return this.callNative("",Object.assign({},e))}))}static openBluetoothAdapter(){return Zn(this,void 0,void 0,(function*(){return this.callNative("",{})}))}static onBluetoothDeviceFound(){return Zn(this,void 0,void 0,(function*(){return this.callNative("",{})}))}static onBluetoothAdapterStateChange(){return Zn(this,void 0,void 0,(function*(){return Promise.resolve()}))}static getConnectedBluetoothDevices(e){return Zn(this,void 0,void 0,(function*(){const t={services:e.services||[]};return this.callNative("",t)}))}static getBluetoothDevices(){return Zn(this,void 0,void 0,(function*(){return this.callNative("",{})}))}static getBluetoothAdapterState(){return Zn(this,void 0,void 0,(function*(){return this.callNative("",{})}))}static closeBluetoothAdapter(){return Zn(this,void 0,void 0,(function*(){return this.callNative("",{})}))}static scanQRCode(e){return Zn(this,void 0,void 0,(function*(){return yield this.callNative(dn.OPEN_QR.name,{skipOpenLink:!0})}))}static showToast(e){return Zn(this,void 0,void 0,(function*(){yield this.callNative(dn.SHOW_TOAST.name,{toast:e.message})}))}static hideKeyboard(e){return Zn(this,void 0,void 0,(function*(){yield this.callNative(dn.HIDE_KEYBOARD.name,{})}))}static openPhone(e){return Zn(this,void 0,void 0,(function*(){yield this.callNative(dn.OPEN_PHONE.name,{phoneNum:e.phoneNumber,phoneCode:e.phoneNumber})}))}static openSMS(e){return Zn(this,void 0,void 0,(function*(){yield this.callNative(dn.OPEN_SMS.name,{content:e.content,phoneCode:e.phoneNumber})}))}static keepScreen(e){return Zn(this,void 0,void 0,(function*(){return yield this.callNative(dn.KEEP_SCREEN.name,{data:{keep_screen_on:e.keepScreenOn?1:0}})}))}static openBioAuthentication(e){return Zn(this,void 0,void 0,(function*(){return yield this.callNative(dn.PROMPT_AUTHENTICATION.name,{secret_data:e.secretData,app_id:this.getZAppId(),ui:{title:e.ui.title,sub_title:e.ui.subTitle,negative_text:e.ui.negativeButtonText},require_fingerprint:e.requireFingerprint?1:0}).then((e=>{var t,n,r,i;return{code:null==e?void 0:e.error_code,message:null==e?void 0:e.error_message,data:{domain:null===(t=null==e?void 0:e.data)||void 0===t?void 0:t.domain,code:null===(n=null==e?void 0:e.data)||void 0===n?void 0:n.error_code,message:null===(r=null==e?void 0:e.data)||void 0===r?void 0:r.error_message,payToken:null===(i=null==e?void 0:e.data)||void 0===i?void 0:i.pay_token}}}))}))}static checkStateBioAuthentication(e){return Zn(this,void 0,void 0,(function*(){return yield this.callNative(dn.PROMPT_AUTHENTICATION_CHECK_STATE.name,{}).then((e=>({bioState:null==e?void 0:e.bio_state})))}))}static vibrate(t){return Zn(this,void 0,void 0,(function*(){return yield this.callNative(dn.INTERACTIVE_VIBRATION.name,{type:e.VibrateType[t.type],vibrate_time:t.milliseconds})}))}}var Ol,Cl,Rl,Nl,Il,Pl,xl,Ll,Bl,jl,Ul,Dl,Ml,zl,Fl,Wl,Hl,Zl,ql,Gl,$l,Kl,Yl,Vl,Jl,Ql,Xl,ef,tf,nf;class rf{constructor(e){Ol.set(this,localStorage),Cl.set(this,void 0),Rl.set(this,void 0),Nn(),Gn(this,Rl,{keys:new Set,currentSize:0,limitSize:Xc.STORAGE_LIMIT}),Gn(this,Cl,e),this.findAllCurrentDataByApp(e)}findAllCurrentDataByApp(e){try{let t;for(t in qn(this,Ol)){if(e){if(t.split("_")[0]!==e)continue}qn(this,Rl).keys.add(t)}}catch(e){kl.error(e,"LocalResourceStorage > findAllCurrentDataByApp")}}get(e){let t=new Map;return e.forEach((e=>{t.set(e,this.getSync(e))})),Promise.resolve(t)}getSync(e){return qn(this,Cl)&&(e=`${qn(this,Cl)}_${e}`),qn(this,Rl).keys.has(e)?qn(this,Ol).getItem(e):null}set(e){return Zn(this,void 0,void 0,(function*(){return Object.entries(e).forEach((([e,t])=>{this.setSync(e,t.replace(/\\"/g,'"'))})),Promise.resolve({errorKeys:[]})}))}setSync(e,t){qn(this,Cl)&&(e=`${qn(this,Cl)}_${e}`),qn(this,Ol).setItem(e,t),qn(this,Rl).keys.add(e)}getInfo(){return Zn(this,void 0,void 0,(function*(){return Promise.resolve(this.getInfoSync())}))}getInfoSync(){const e=((e,t)=>{let n,r,i=0;for(r in e){const o=r.split("_")[0];e.hasOwnProperty(r)&&(t&&o!==t||(n=2*(e[r].length+r.length),i+=n))}return i})(qn(this,Ol),qn(this,Cl));return{currentSize:i.isNumber(e)?Number((e/1024).toFixed(2)):0,limitSize:Number((Xc.STORAGE_LIMIT/1024).toFixed(2))}}remove(e){return Zn(this,void 0,void 0,(function*(){return e.forEach((e=>{this.removeSync(e)})),Promise.resolve({errorKeys:[]})}))}removeSync(e){qn(this,Cl)&&(e=`${qn(this,Cl)}_${e}`),qn(this,Rl).keys.has(e)&&(qn(this,Ol).removeItem(e),qn(this,Rl).keys.delete(e))}clear(){return Zn(this,void 0,void 0,(function*(){return Promise.resolve(this.clearSync())}))}clearSync(){qn(this,Rl).keys.forEach((e=>{qn(this,Cl)&&e.indexOf(qn(this,Cl))<0||(qn(this,Ol).removeItem(e),qn(this,Rl).keys.delete(e))}))}}Ol=new WeakMap,Cl=new WeakMap,Rl=new WeakMap;class of extends dl{constructor(e){super(),Nl.set(this,void 0),Il.set(this,void 0),Gn(this,Il,{keys:new Set,currentSize:0,limitSize:Xc.STORAGE_LIMIT}),Gn(this,Nl,e)}get(e){return Zn(this,void 0,void 0,(function*(){return yield this.callNative(dn.ZBROWSER_MPDS.name,{mpds_action:"mpds.get",mpds_data:{keys:e},appId:qn(this,Nl)},{isMultiCallback:!1}).then((e=>{let t=new Map;return e&&e.mpds_data&&e.mpds_data.map&&(t=new Map(Object.entries(e.mpds_data.map))),t}))}))}set(e){return Zn(this,void 0,void 0,(function*(){return{errorKeys:yield this.callNative(dn.ZBROWSER_MPDS.name,{mpds_action:"mpds.set",mpds_data:{map:e},appId:qn(this,Nl)},{isMultiCallback:!1}).then((e=>{let t=[];return e&&e.mpds_data&&e.mpds_data.error_keys&&(t=e.mpds_data.error_keys),t}))}}))}getInfo(){return Zn(this,void 0,void 0,(function*(){const e=yield this.callNative(dn.ZBROWSER_MPDS.name,{mpds_action:"mpds.get.size",mpds_data:{},appId:qn(this,Nl)},{isMultiCallback:!1}).then((e=>{let t=0;return e&&e.mpds_data&&e.mpds_data.size&&(t=e.mpds_data.size),t}));return{currentSize:i.isNumber(e)?Number(e/1024):0,limitSize:Number(Xc.STORAGE_LIMIT/1024)}}))}remove(e){return Zn(this,void 0,void 0,(function*(){return{errorKeys:yield this.callNative(dn.ZBROWSER_MPDS.name,{mpds_action:"mpds.remove.key",mpds_data:{keys:e},appId:qn(this,Nl)},{isMultiCallback:!1}).then((e=>{let t=[];return e&&e.mpds_data&&e.mpds_data.error_keys&&(t=e.mpds_data.error_keys),t}))}}))}clear(){return Zn(this,void 0,void 0,(function*(){yield this.callNative(dn.ZBROWSER_MPDS.name,{mpds_action:"mpds.clear.appData",mpds_data:{},appId:qn(this,Nl)})}))}}Nl=new WeakMap,Il=new WeakMap;class af{getDataFromStorage(e){return Zn(this,void 0,void 0,(function*(){const t=this.getInstance(),n=yield t.get(e),r={};return n.forEach(((e,t)=>{r[t]=Fn(e)})),r}))}putDataToStorage(e){return Zn(this,void 0,void 0,(function*(){const t=this.getInstance(),n={};return Object.entries(e).forEach((([e,t])=>{i.isUndefined(t)||i.isNull(t)||(n[e]=zn(t))})),yield t.set(n)}))}removeDataFromStorage(e){return Zn(this,void 0,void 0,(function*(){const t=this.getInstance();return yield t.remove(e)}))}clearStorage(){return Zn(this,void 0,void 0,(function*(){const e=this.getInstance();yield e.clear()}))}getStorageInfo(){return Zn(this,void 0,void 0,(function*(){const e=this.getInstance();return yield e.getInfo()}))}}class sf extends af{constructor(e){super(),Pl.set(this,void 0),Gn(this,Pl,e)}getInstance(){return new rf(qn(this,Pl))}}Pl=new WeakMap;class uf extends af{constructor(e){super(),xl.set(this,void 0),Gn(this,xl,e)}getInstance(){return new of(qn(this,xl))}}xl=new WeakMap;class cf{static setStorage(e){return Zn(this,void 0,void 0,(function*(){let t=new sf(this.getAppId());return Mn()&&(t=new uf(this.getAppId())),yield t.putDataToStorage(e.data)}))}static getStorage(e){return Zn(this,void 0,void 0,(function*(){let t=new sf(this.getAppId());Mn()&&(t=new uf(this.getAppId()));return yield t.getDataFromStorage(e.keys)}))}static getStorageInfo(e){return Zn(this,void 0,void 0,(function*(){let e=new sf(this.getAppId());return Mn()&&(e=new uf(this.getAppId())),yield e.getStorageInfo()}))}static removeStorage(e){return Zn(this,void 0,void 0,(function*(){let t=new sf(this.getAppId());return Mn()&&(t=new uf(this.getAppId())),yield t.removeDataFromStorage(e.keys)}))}static clearStorage(e={}){return Zn(this,void 0,void 0,(function*(){let e=new sf(this.getAppId());Mn()&&(e=new uf(this.getAppId())),yield e.clearStorage()}))}}class lf{static getUserInfo(e){return Zn(this,void 0,void 0,(function*(){const t=yield this.getAccessToken();let n="id,name,picture";(null==e?void 0:e.avatarType)&&(n=`${n}.type(${null==e?void 0:e.avatarType})`);return{userInfo:yield Qc.get(Xc.APIS.GET_USER_INFO,{params:{fields:n,access_token:t}}).then((e=>{const t=e.data,n={id:t.id,name:t.name,birthday:"",gender:"",avatar:t.picture&&t.picture.data&&t.picture.data.url};return console.warn("'birthday' and 'gender' are deprecated"),n}))}}))}static getPhoneNumber(e){return Zn(this,void 0,void 0,(function*(){return yield this.callNative(dn.MP_GET_NUMBER.name,{},{isMultiCallback:!0,callback:(e,t)=>{if(0===e.error_code){const t={number:e.data};return Promise.resolve(t)}return Promise.reject(t)}})}))}}class ff{static closeApp(e){return Zn(this,void 0,void 0,(function*(){yield this.callNative(dn.WINDOW_CLOSE.name,{})}))}static openMiniApp(e){return Zn(this,void 0,void 0,(function*(){const t=null==e?void 0:e.appId,n=(null==e?void 0:e.params)||{},r=Object.entries(n).map((function([e,t]){return[e,t].join("=")})).join("&");yield this.callNative(dn.OPEN_MP.name,{mpUrl:`${Xc.MINI_APP_INTERNAL_LINK}/${t}/${r.length>0?"?"+r:""}`,mpInfo:{appId:t}})}))}static openWebview(e){return Zn(this,void 0,void 0,(function*(){yield this.callNative(dn.OPEN_INAPP.name,{url:e.url})}))}}class hf{static getLocation(e){return Zn(this,void 0,void 0,(function*(){return yield this.callNative(dn.GET_LOCATION.name,{silent_request:!1,permission_description:"Cho phép Zalo truy cập vào vị trí của thiết bị này?"},{isMultiCallback:!0,haveTimeout:!1,callback:(e,t)=>{if(0===e.error_code){const t=e.data,n={latitude:t.latitude,longitude:t.longitude,timestamp:t.timestamp,provider:t.provider};return Promise.resolve(n)}return Promise.reject(t)}})}))}static sendLocation(e){return Zn(this,void 0,void 0,(function*(){yield this.callNative(dn.QUERY_LOCATION_HIDE.name,{title:e.title,touserid:e.toUserId,zapp:this.getZAppId()})}))}}class df{static requestCameraPermission(e){return Zn(this,void 0,void 0,(function*(){return yield this.callNative(dn.REQUEST_PERMISSION_CAMERA.name,{},{callback:(e,t)=>-2===e.error_code||e.error_code>=0?Promise.resolve({userAllow:-2!==e.error_code,message:e.error_message}):Promise.reject(t)})}))}static saveImageToPhotosAlbum(e){return Zn(this,void 0,void 0,(function*(){let t={};return t=i.isEmpty(e.imageBase64Data)?Object.assign(Object.assign({},t),{imageUrl:e.imageUrl}):Object.assign(Object.assign({},t),{imageBase64Data:e.imageBase64Data}),yield this.callNative(dn.SAVE_IMAGE_GALLERY.name,Object.assign({},t))}))}}class pf{static viewOAQr(e){return Zn(this,void 0,void 0,(function*(){yield this.callNative(dn.VIEW_MYQR.name,{dpn:e.displayName,uid:e.id,zapp:this.getZAppId()},{haveTimeout:!1})}))}static openProfile(t){return Zn(this,void 0,void 0,(function*(){return yield this.callNative(dn.OPEN_PROFILE.name,{uId:t.id,type:e.ProfileType[t.type],zapp:this.getZAppId(),sourceId:t.sourceId,sourceIndex:t.sourceIndex})}))}static openChat(t){return Zn(this,void 0,void 0,(function*(){return yield this.callNative(dn.OPEN_CHAT.name,{uId:t.id,type:e.ChatType[t.type],zapp:this.getZAppId(),sourceId:t.sourceId,sourceIndex:t.sourceIndex})}))}static openPostFeed(t){return Zn(this,void 0,void 0,(function*(){let n={};switch(t.type){case"image":n={photoUrl:t.data.imageUrl};break;case"link":n={link:t.data.link,title:t.data.title,thumb:t.data.thumb,description:t.data.description};break;case"profile":n={avt:t.data.avatar,uid:t.data.id,dpn:t.data.displayName}}return yield this.callNative(dn.OPEN_POSTFEED.name,Object.assign(Object.assign({type:e.PostFeedType[t.type]},n),{zapp:this.getZAppId()})).then((e=>({status:e.status,shareType:e.share_type,numberOfUser:e.uid_to_size})))}))}static followOA(e){return Zn(this,void 0,void 0,(function*(){yield this.callNative(dn.FOLLOW_OA.name,{uid:e.id,showDialogConfirm:!0,zapp:this.getZAppId()},{haveTimeout:!1})}))}static unfollowOA(e){return Zn(this,void 0,void 0,(function*(){yield this.callNative(dn.UNFOLLOW_OA.name,{uid:e.id,zapp:this.getZAppId()},{haveTimeout:!1})}))}static openShareSheet(t){return Zn(this,void 0,void 0,(function*(){let n={};switch(t.type){case"image":n={photoUrl:t.data.imageUrl};break;case"gif":n={photoUrl:t.data.imageUrl,gifUrl:t.data.gifUrl,width:t.data.width,height:t.data.height};break;case"video":n={videoThumb:t.data.videoThumb,videoUrl:t.data.videoUrl,width:t.data.width,height:t.data.height};break;case"link":n={link:t.data.link,chatOnly:t.data.chatOnly?1:0};break;case"oa":n={uid:t.data.id};break;case"zmp":const e=new URL(location.href),r=new URLSearchParams,o=yield this.getAccessToken(),a={vi:"",en:""};let s=`${e.pathname}${e.search}`;t.data.path&&(s=`/zapps/${this.getAppId()}${"/"===t.data.path[0]?"":"/"}${t.data.path}`);const u=new URL(`https://zalo.me/app/link${s}`);i.isString(t.data.description)?a.en=a.vi=t.data.description:i.isObject(t.data.description)&&(a.en=t.data.description.en||"",a.vi=t.data.description.vi||""),r.append("title",t.data.title),r.append("description",a.vi||a.en),r.append("thumbnail",t.data.thumbnail),r.append("url",u.href),r.append("accessToken",o||"");const c={headers:{"Content-Type":"application/x-www-form-urlencoded"}},l=(yield Qc.post("https://h5.zalo.me/openapi/create-sharelink",r,c)).data;if(!l||0!==l.err)throw pl.cannotGetShareInfo();const f=Pn(),h=Nn();h.isAndroid&&f%1e5<=593||h.isIOS&&f<=424?(u.search=`${u.search}&zshareId=${l.data.shareId}`,n={link:u.href,chatOnly:t.data.chatOnly?1:0},t.type="link"):n={data:{ZInstantAPIInfo:{url:`${l.data.zinstantApi}`,zinstantdata_id:`templateId=11412&appId=${this.getAppId()}&shareId=${l.data.shareId}`},previewMsgText:{msg:{en:a.en,vi:a.vi}},enableReactions:1}}}return yield this.callNative(dn.OPEN_SHARESHEET.name,Object.assign(Object.assign({type:e.ShareSheetType[t.type]},n),{zapp:this.getZAppId()}),{haveTimeout:!1}).then((e=>({status:e.status,shareType:e.share_type,numberOfUser:e.uid_to_size})))}))}static createShortcut(e){return Zn(this,void 0,void 0,(function*(){yield this.callNative(dn.CREATE_SHORTCUT.name,{url:`${Xc.MINI_APP_LINK}/${this.getAppId()}/`,title:document.title,iconUrl:`https:${In("og:image:url")}`})}))}static openProfilePicker(e){return Zn(this,void 0,void 0,(function*(){return yield this.callNative(dn.MP_OPEN_PROFILE_PICKER.name,{maxProfile:null==e?void 0:e.maxProfile},{isMultiCallback:!0,callback:(e,t)=>{if(0===e.error_code){const t={userIDs:e.data};return Promise.resolve(t)}return Promise.reject(t)}})}))}static getActionsSupported(t){return Zn(this,void 0,void 0,(function*(){return yield this.callNative(dn.GET_SUPPORTED_ACTIONS.name,{},{isMultiCallback:!1,callback:(t,n)=>{const r=xn();if(Array.isArray(t.actions)&&t.actions.length>0){const e=Object.keys(dn).filter((e=>dn[e].skip_jump)),n={actions:[...t.actions,...e]};return Promise.resolve(n)}if(r===e.PlatformType.iOS){const e={actions:An};return Promise.resolve(e)}return Promise.reject(n)}})}))}}class vf{static getRouteParams(){let e={};const t=window.location.href;try{let n=new URL(t).searchParams.toString();n&&(e=el.getParamsAsObject(n))}catch(e){throw new Error("Url không hợp lệ")}return e}static sendDataToPreviousMiniApp(e){return Zn(this,void 0,void 0,(function*(){return yield this.callNative(dn.WEBVIEW_SET_RESULT.name,{result:zn(e.data)})}))}static onCallbackData(t){return Zn(this,void 0,void 0,(function*(){yield this.events.on(e.Events.OnDataCallback,(e=>{t({data:e})}))}))}}class gf extends dl{constructor(){var e,t,n,r;super(),Ll.set(this,window.zAppID),Bl.set(this,window.APP_ID),jl.set(this,window.APP_CONFIG||{}),Ul.set(this,void 0),Dl.set(this,void 0),Ml.set(this,void 0),zl.set(this,null),Fl.set(this,{timer:{getToken:0}}),Wl.set(this,void 0),Hl.set(this,void 0),Zl.set(this,null),this.events=Kn.getInstance(),ql.set(this,(()=>{const e=qn(this,jl).app||null;if(e){const t=e.title,n=e.headerColor,r=e.textColor,o=e.statusBarColor,a=e.leftButton;if(i.isString(t)&&this.setNavigationBarTitle({title:t}),i.isString(n)){const e={color:n};!i.isString(r)||"black"!==r&&"white"!==r||(e.textColor=r),i.isString(o)&&(e.statusBarColor=o),this.setNavigationBarColor(e)}i.isString(a)&&this.setNavigationBarLeftButton({type:a})}})),Gl.set(this,(()=>{try{qn(this,ql).call(this)}catch(e){console.error(e)}})),$l.set(this,(()=>new Promise(((e,t)=>{i.isUndefined(qn(this,Zl))||i.isNull(qn(this,Zl))?this.callNative("action.jump.login",{}).then((t=>{const n=t&&t.cookiesOAuthLogins||[],r=n.find((e=>e.name===Xc.COOKIE_NAME.JS_TOKEN));r&&(this.setJSToken(r.value),window.ZJSBridge.setJSToken&&window.ZJSBridge.setJSToken(r.value)),Gn(this,Zl,n),e(n)})).catch((e=>{t(e)})):e(qn(this,Zl))})))),Kl.set(this,El.setNavigationBarRightButton),this.getVersion=bl.getVersion,this.getSystemInfo=bl.getSystemInfo,this.setNavigationBarTitle=El.setNavigationBarTitle,this.setNavigationBarColor=El.setNavigationBarColor,this.setNavigationBarLeftButton=El.setNavigationBarLeftButton,this.setBackgroundColor=Al.setBackgroundColor,this.setDeviceOrientation=Sl.setDeviceOrientation,this.setStorage=cf.setStorage,this.getStorage=cf.getStorage,this.getStorageInfo=cf.getStorageInfo,this.removeStorage=cf.removeStorage,this.clearStorage=cf.clearStorage,this.getUserInfo=lf.getUserInfo,this.getNetworkType=Sl.getNetworkType,this.onNetworkStatusChange=Sl.onNetworkStatusChange,this.startBeaconDiscovery=Sl.startBeaconDiscovery,this.stopBeaconDiscovery=Sl.stopBeaconDiscovery,this.getBeacons=Sl.getBeacons,this.closeApp=ff.closeApp,this.getLocation=hf.getLocation,this.stopBluetoothDevicesDiscovery=Sl.stopBluetoothDevicesDiscovery,this.startBluetoothDevicesDiscovery=Sl.stopBluetoothDevicesDiscovery,this.openBluetoothAdapter=Sl.openBluetoothAdapter,this.onBluetoothDeviceFound=Sl.onBluetoothDeviceFound,this.onBluetoothAdapterStateChange=Sl.onBluetoothAdapterStateChange,this.getConnectedBluetoothDevices=Sl.getConnectedBluetoothDevices,this.getBluetoothDevices=Sl.getBluetoothDevices,this.getBluetoothAdapterState=Sl.getBluetoothAdapterState,this.closeBluetoothAdapter=Sl.closeBluetoothAdapter,this.scanQRCode=Sl.scanQRCode,this.openProfile=pf.openProfile,this.openChat=pf.openChat,this.openPostFeed=pf.openPostFeed,this.followOA=pf.followOA,this.unFollowOA=pf.unfollowOA,this.openShareSheet=pf.openShareSheet,this.requestCameraPermission=df.requestCameraPermission,this.createShortcut=pf.createShortcut,this.openBioAuthentication=Sl.openBioAuthentication,this.checkStateBioAuthentication=Sl.checkStateBioAuthentication,this.sendLocation=hf.sendLocation,this.showToast=Sl.showToast,this.hideKeyboard=Sl.hideKeyboard,this.openPhone=Sl.openPhone,this.openSMS=Sl.openSMS,this.viewOAQr=pf.viewOAQr,this.keepScreen=Sl.keepScreen,this.saveImageToPhotosAlbum=df.saveImageToPhotosAlbum,this.openMiniApp=ff.openMiniApp,this.vibrate=Sl.vibrate,this.openWebview=ff.openWebview,this.getRouteParams=vf.getRouteParams,this.getAppInfo=bl.getAppInfo,this.sendDataToPreviousMiniApp=vf.sendDataToPreviousMiniApp,this.onCallbackData=vf.onCallbackData,this.getPhoneNumber=lf.getPhoneNumber,this.openProfilePicker=pf.openProfilePicker,Yl.set(this,pf.getActionsSupported),Gn(this,Ul,null),Gn(this,Dl,null),Gn(this,Ml,null),this.isShowNavBar=!0,Gn(this,Wl,0),Gn(this,Hl,0),this.isShowHomeButton="home"===(null===(t=null===(e=qn(this,jl))||void 0===e?void 0:e.app)||void 0===t?void 0:t.leftButton)||"both"===(null===(r=null===(n=qn(this,jl))||void 0===n?void 0:n.app)||void 0===r?void 0:r.leftButton)}static getInstance(){return gf.instance||(gf.instance=new gf),gf.instance}getLoginStatus(){return i.isString(qn(this,Ml))&&qn(this,Ml).length>0}getAppId(){return qn(this,Bl)}getZAppId(){return qn(this,Ll)}login(e){return Zn(this,void 0,void 0,(function*(){const e=yield qn(this,$l).call(this),t=e.find((e=>e.name===Xc.COOKIE_NAME.ZOAUTH)),n=e.find((e=>e.name===Xc.COOKIE_NAME.ZOAUTH_VRF));if(!i.isUndefined(t)&&!i.isNull(t)&&i.isString(t.value)){if(Gn(this,Ul,t.value),i.isUndefined(n)||i.isNull(n)||!i.isString(n.value)?yield this.loginZaloV3():(Gn(this,Dl,n.value),yield this.loginZaloV4()),!qn(this,Ml))throw pl.loginFailed();return qn(this,Ml)}throw pl.loginFailed()}))}loginZaloV3(){return Zn(this,void 0,void 0,(function*(){return yield Qc.get(Xc.APIS.GET_ACCESS_TOKEN_V3,{params:{app_id:qn(this,Ll),redirect_uri:`${Xc.MINI_APP_INTERNAL_LINK}/${qn(this,Bl)}/`,code:qn(this,Ul),isSDK:!0}}).then((e=>{let t=e.data;if(t.access_token){Gn(this,Ml,t.access_token);const e=1e3*parseInt(t.expires_in);return Gn(this,Hl,e),Gn(this,Wl,(new Date).getTime()),this.setZAccSession(qn(this,Ml)||""),window.ZJSBridge.setZAccSession&&window.ZJSBridge.setZAccSession(qn(this,Ml)||""),qn(this,Ml)}return null}))}))}loginZaloV4(){return Zn(this,void 0,void 0,(function*(){const e=new URLSearchParams;e.append("app_id",qn(this,Bl)),e.append("code",qn(this,Ul)||""),e.append("code_verifier",qn(this,Dl)||""),i.isNull(qn(this,zl))?e.append("grant_type","authorization_code"):(e.append("grant_type","refresh_token"),e.append("refresh_token",qn(this,zl)||""));return yield Qc.post(Xc.APIS.GET_ACCESS_TOKEN,e,{headers:{"Content-Type":"application/x-www-form-urlencoded"}}).then((e=>{const t=e.data;if(t.refresh_token&&Gn(this,zl,t.refresh_token),t.access_token){Gn(this,Ml,t.access_token);const e=1e3*parseInt(t.expires_in);return Gn(this,Hl,e),Gn(this,Wl,(new Date).getTime()),this.setZAccSession(qn(this,Ml)||""),window.ZJSBridge.setZAccSession&&window.ZJSBridge.setZAccSession(qn(this,Ml)||""),qn(this,Ml)}return null}))}))}getAccessToken(e){return Zn(this,void 0,void 0,(function*(){const e=(new Date).getTime()-qn(this,Wl);if(!qn(this,Ml))throw pl.loginRequired();return e<qn(this,Hl)?qn(this,Ml):yield this.login()}))}}Ll=new WeakMap,Bl=new WeakMap,jl=new WeakMap,Ul=new WeakMap,Dl=new WeakMap,Ml=new WeakMap,zl=new WeakMap,Fl=new WeakMap,Wl=new WeakMap,Hl=new WeakMap,Zl=new WeakMap,ql=new WeakMap,Gl=new WeakMap,$l=new WeakMap,Kl=new WeakMap,Yl=new WeakMap;class _f{constructor(){Vl.set(this,window.zAppID),Jl.set(this,window.APP_CONFIG||{}),Ql.set(this,"DEFAULT ZOAUTH"),Xl.set(this,"DEFAULT ACCESS TOKEN"),ef.set(this,{timer:{getToken:0}}),tf.set(this,!1),this.getLoginStatus=()=>qn(this,tf),this.getAppId=()=>qn(this,Vl),this.login=()=>(Gn(this,tf,!0),Promise.resolve(qn(this,Ql))),this.getAccessToken=()=>Promise.resolve(qn(this,Xl)),this.getVersion=bl.getVersion,this.getSystemInfo=bl.getSystemInfo,this.setNavigationBarTitle=()=>Promise.resolve(),this.setNavigationBarColor=()=>Promise.resolve(),this.setBackgroundColor=()=>Promise.resolve(),this.setNavigationBarLeftButton=()=>Promise.resolve(),this.setDeviceOrientation=()=>Promise.resolve(),this.setStorage=e=>Zn(this,void 0,void 0,(function*(){const t=new sf(this.getAppId());return yield t.putDataToStorage(e.data),{errorKeys:[]}})),this.getStorage=e=>Zn(this,void 0,void 0,(function*(){const t=new sf(this.getAppId());return yield t.getDataFromStorage(e.keys)})),this.getStorageInfo=e=>Zn(this,void 0,void 0,(function*(){const e=new sf(this.getAppId());return yield e.getStorageInfo()})),this.removeStorage=e=>Zn(this,void 0,void 0,(function*(){const t=new sf(this.getAppId());return yield t.removeDataFromStorage(e.keys)})),this.clearStorage=e=>Zn(this,void 0,void 0,(function*(){const e=new sf(this.getAppId());return yield e.clearStorage()})),this.getUserInfo=()=>(console.warn("birthday and gender are deprecated"),Promise.resolve({userInfo:{id:"3368637342326461234",name:"User Name",avatar:"https://h5.zdn.vn/static/images/avatar.png"}})),this.getNetworkType=()=>{let t;switch((navigator.connection||navigator.mozConnection||navigator.webkitConnection).effectiveType){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}const n={networkType:t};return Promise.resolve(n)},this.onNetworkStatusChange=t=>{const n=navigator.connection||navigator.mozConnection||navigator.webkitConnection,r=n.effectiveType;return n.addEventListener("change",(function(){let n;switch(r){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}t({isConnected:!0,networkType:n})})),Promise.resolve()},this.startBeaconDiscovery=e=>Promise.resolve(!0),this.stopBeaconDiscovery=e=>Promise.resolve(!0),this.getBeacons=e=>Promise.resolve({beacons:[]}),this.closeApp=()=>Promise.resolve(),this.getLocation=()=>Promise.resolve({longitude:"105.788026",latitude:"21.0258773",timestamp:(new Date).getTime().toString(),provider:"fused"}),this.onBackButtonClick=()=>Promise.resolve(),this.stopBluetoothDevicesDiscovery=()=>Promise.resolve(),this.startBluetoothDevicesDiscovery=()=>Promise.resolve(),this.openBluetoothAdapter=()=>Promise.resolve(),this.onBluetoothDeviceFound=()=>Promise.resolve(),this.onBluetoothAdapterStateChange=()=>Promise.resolve(),this.getConnectedBluetoothDevices=()=>Promise.resolve(),this.getBluetoothDevices=()=>Promise.resolve(),this.getBluetoothAdapterState=()=>Promise.resolve(),this.closeBluetoothAdapter=()=>Promise.resolve(),this.scanQRCode=()=>Promise.resolve({content:"132"}),this.openProfile=()=>Promise.resolve(),this.openChat=()=>Promise.resolve(),this.openPostFeed=()=>Promise.resolve({status:1,shareType:0,numberOfUser:0}),this.followOA=()=>Promise.resolve(),this.unFollowOA=()=>Promise.resolve(),this.openShareSheet=()=>Promise.resolve({status:2,shareType:0,numberOfUser:0}),this.requestCameraPermission=()=>Promise.resolve({userAllow:!0,message:"Success"}),this.createShortcut=()=>Promise.resolve(),this.openBioAuthentication=()=>Promise.resolve({code:0,message:"OK",data:{domain:"",code:0,message:"",payToken:""}}),this.checkStateBioAuthentication=()=>Promise.resolve({bioState:""}),this.sendLocation=()=>Promise.resolve(),this.showToast=()=>Promise.resolve(),this.hideKeyboard=()=>Promise.resolve(),this.openPhone=()=>Promise.resolve(),this.openSMS=()=>Promise.resolve(),this.viewOAQr=()=>Promise.resolve(),this.keepScreen=()=>Promise.resolve(),this.saveImageToPhotosAlbum=()=>Promise.resolve(),this.openMiniApp=e=>Promise.resolve(),this.vibrate=()=>Promise.resolve(),this.openWebview=e=>(location.replace(e.url),Promise.resolve()),this.getRouteParams=vf.getRouteParams,this.getAppInfo=()=>Promise.resolve({description:"",name:"",version:"",appUrl:"",qrCodeUrl:""}),this.sendDataToPreviousMiniApp=e=>Promise.resolve(),this.onCallbackData=e=>(e({data:""}),Promise.resolve()),this.getPhoneNumber=()=>(console.warn("This api only works on zalo app"),Promise.resolve({number:""})),this.openProfilePicker=()=>(console.warn("This api only works on zalo app"),Promise.resolve({userIDs:[]}))}on(e,t,n){throw new Error("Method not implemented.")}once(e,t,n){throw new Error("Method not implemented.")}off(e,t,n,r){throw new Error("Method not implemented.")}removeAllListeners(e){throw new Error("Method not implemented.")}}Vl=new WeakMap,Jl=new WeakMap,Ql=new WeakMap,Xl=new WeakMap,ef=new WeakMap,tf=new WeakMap,function(e){!function(n){var r="object"==typeof t?t:"object"==typeof self?self:"object"==typeof this?this:Function("return this;")(),i=o(e);function o(e,t){return function(n,r){"function"!=typeof e[n]&&Object.defineProperty(e,n,{configurable:!0,writable:!0,value:r}),t&&t(n,r)}}void 0===r.Reflect?r.Reflect=e:i=o(r.Reflect,i),function(e){var t=Object.prototype.hasOwnProperty,n="function"==typeof Symbol,r=n&&void 0!==Symbol.toPrimitive?Symbol.toPrimitive:"@@toPrimitive",i=n&&void 0!==Symbol.iterator?Symbol.iterator:"@@iterator",o="function"==typeof Object.create,a={__proto__:[]}instanceof Array,s=!o&&!a,u={create:o?function(){return ie(Object.create(null))}:a?function(){return ie({__proto__:null})}:function(){return ie({})},has:s?function(e,n){return t.call(e,n)}:function(e,t){return t in e},get:s?function(e,n){return t.call(e,n)?e[n]:void 0}:function(e,t){return e[t]}},c=Object.getPrototypeOf(Function),l="object"==typeof N&&N.env&&"true"===N.env.REFLECT_METADATA_USE_MAP_POLYFILL,f=l||"function"!=typeof Map||"function"!=typeof Map.prototype.entries?te():Map,h=l||"function"!=typeof Set||"function"!=typeof Set.prototype.entries?ne():Set,d=new(l||"function"!=typeof WeakMap?re():WeakMap);function p(e,t,n,r){if(j(n)){if(!q(e))throw new TypeError;if(!$(t))throw new TypeError;return T(e,t)}if(!q(e))throw new TypeError;if(!M(t))throw new TypeError;if(!M(r)&&!j(r)&&!U(r))throw new TypeError;return U(r)&&(r=void 0),k(e,t,n=Z(n),r)}function v(e,t){function n(n,r){if(!M(n))throw new TypeError;if(!j(r)&&!K(r))throw new TypeError;P(e,t,n,r)}return n}function g(e,t,n,r){if(!M(n))throw new TypeError;return j(r)||(r=Z(r)),P(e,t,n,r)}function _(e,t,n){if(!M(t))throw new TypeError;return j(n)||(n=Z(n)),O(e,t,n)}function m(e,t,n){if(!M(t))throw new TypeError;return j(n)||(n=Z(n)),C(e,t,n)}function y(e,t,n){if(!M(t))throw new TypeError;return j(n)||(n=Z(n)),R(e,t,n)}function w(e,t,n){if(!M(t))throw new TypeError;return j(n)||(n=Z(n)),I(e,t,n)}function b(e,t){if(!M(e))throw new TypeError;return j(t)||(t=Z(t)),x(e,t)}function E(e,t){if(!M(e))throw new TypeError;return j(t)||(t=Z(t)),L(e,t)}function A(e,t,n){if(!M(t))throw new TypeError;j(n)||(n=Z(n));var r=S(t,n,!1);if(j(r))return!1;if(!r.delete(e))return!1;if(r.size>0)return!0;var i=d.get(t);return i.delete(n),i.size>0||d.delete(t),!0}function T(e,t){for(var n=e.length-1;n>=0;--n){var r=(0,e[n])(t);if(!j(r)&&!U(r)){if(!$(r))throw new TypeError;t=r}}return t}function k(e,t,n,r){for(var i=e.length-1;i>=0;--i){var o=(0,e[i])(t,n,r);if(!j(o)&&!U(o)){if(!M(o))throw new TypeError;r=o}}return r}function S(e,t,n){var r=d.get(e);if(j(r)){if(!n)return;r=new f,d.set(e,r)}var i=r.get(t);if(j(i)){if(!n)return;i=new f,r.set(t,i)}return i}function O(e,t,n){if(C(e,t,n))return!0;var r=ee(t);return!U(r)&&O(e,r,n)}function C(e,t,n){var r=S(t,n,!1);return!j(r)&&W(r.has(e))}function R(e,t,n){if(C(e,t,n))return I(e,t,n);var r=ee(t);return U(r)?void 0:R(e,r,n)}function I(e,t,n){var r=S(t,n,!1);if(!j(r))return r.get(e)}function P(e,t,n,r){S(n,r,!0).set(e,t)}function x(e,t){var n=L(e,t),r=ee(e);if(null===r)return n;var i=x(r,t);if(i.length<=0)return n;if(n.length<=0)return i;for(var o=new h,a=[],s=0,u=n;s<u.length;s++){var c=u[s];o.has(c)||(o.add(c),a.push(c))}for(var l=0,f=i;l<f.length;l++){c=f[l];o.has(c)||(o.add(c),a.push(c))}return a}function L(e,t){var n=[],r=S(e,t,!1);if(j(r))return n;for(var i=V(r.keys()),o=0;;){var a=Q(i);if(!a)return n.length=o,n;var s=J(a);try{n[o]=s}catch(e){try{X(i)}finally{throw e}}o++}}function B(e){if(null===e)return 1;switch(typeof e){case"undefined":return 0;case"boolean":return 2;case"string":return 3;case"symbol":return 4;case"number":return 5;case"object":return null===e?1:6;default:return 6}}function j(e){return void 0===e}function U(e){return null===e}function D(e){return"symbol"==typeof e}function M(e){return"object"==typeof e?null!==e:"function"==typeof e}function z(e,t){switch(B(e)){case 0:case 1:case 2:case 3:case 4:case 5:return e}var n=3===t?"string":5===t?"number":"default",i=Y(e,r);if(void 0!==i){var o=i.call(e,n);if(M(o))throw new TypeError;return o}return F(e,"default"===n?"number":n)}function F(e,t){if("string"===t){var n=e.toString;if(G(n))if(!M(i=n.call(e)))return i;if(G(r=e.valueOf))if(!M(i=r.call(e)))return i}else{var r;if(G(r=e.valueOf))if(!M(i=r.call(e)))return i;var i,o=e.toString;if(G(o))if(!M(i=o.call(e)))return i}throw new TypeError}function W(e){return!!e}function H(e){return""+e}function Z(e){var t=z(e,3);return D(t)?t:H(t)}function q(e){return Array.isArray?Array.isArray(e):e instanceof Object?e instanceof Array:"[object Array]"===Object.prototype.toString.call(e)}function G(e){return"function"==typeof e}function $(e){return"function"==typeof e}function K(e){switch(B(e)){case 3:case 4:return!0;default:return!1}}function Y(e,t){var n=e[t];if(null!=n){if(!G(n))throw new TypeError;return n}}function V(e){var t=Y(e,i);if(!G(t))throw new TypeError;var n=t.call(e);if(!M(n))throw new TypeError;return n}function J(e){return e.value}function Q(e){var t=e.next();return!t.done&&t}function X(e){var t=e.return;t&&t.call(e)}function ee(e){var t=Object.getPrototypeOf(e);if("function"!=typeof e||e===c)return t;if(t!==c)return t;var n=e.prototype,r=n&&Object.getPrototypeOf(n);if(null==r||r===Object.prototype)return t;var i=r.constructor;return"function"!=typeof i||i===e?t:i}function te(){var e={},t=[],n=function(){function e(e,t,n){this._index=0,this._keys=e,this._values=t,this._selector=n}return e.prototype["@@iterator"]=function(){return this},e.prototype[i]=function(){return this},e.prototype.next=function(){var e=this._index;if(e>=0&&e<this._keys.length){var n=this._selector(this._keys[e],this._values[e]);return e+1>=this._keys.length?(this._index=-1,this._keys=t,this._values=t):this._index++,{value:n,done:!1}}return{value:void 0,done:!0}},e.prototype.throw=function(e){throw this._index>=0&&(this._index=-1,this._keys=t,this._values=t),e},e.prototype.return=function(e){return this._index>=0&&(this._index=-1,this._keys=t,this._values=t),{value:e,done:!0}},e}();return function(){function t(){this._keys=[],this._values=[],this._cacheKey=e,this._cacheIndex=-2}return Object.defineProperty(t.prototype,"size",{get:function(){return this._keys.length},enumerable:!0,configurable:!0}),t.prototype.has=function(e){return this._find(e,!1)>=0},t.prototype.get=function(e){var t=this._find(e,!1);return t>=0?this._values[t]:void 0},t.prototype.set=function(e,t){var n=this._find(e,!0);return this._values[n]=t,this},t.prototype.delete=function(t){var n=this._find(t,!1);if(n>=0){for(var r=this._keys.length,i=n+1;i<r;i++)this._keys[i-1]=this._keys[i],this._values[i-1]=this._values[i];return this._keys.length--,this._values.length--,t===this._cacheKey&&(this._cacheKey=e,this._cacheIndex=-2),!0}return!1},t.prototype.clear=function(){this._keys.length=0,this._values.length=0,this._cacheKey=e,this._cacheIndex=-2},t.prototype.keys=function(){return new n(this._keys,this._values,r)},t.prototype.values=function(){return new n(this._keys,this._values,o)},t.prototype.entries=function(){return new n(this._keys,this._values,a)},t.prototype["@@iterator"]=function(){return this.entries()},t.prototype[i]=function(){return this.entries()},t.prototype._find=function(e,t){return this._cacheKey!==e&&(this._cacheIndex=this._keys.indexOf(this._cacheKey=e)),this._cacheIndex<0&&t&&(this._cacheIndex=this._keys.length,this._keys.push(e),this._values.push(void 0)),this._cacheIndex},t}();function r(e,t){return e}function o(e,t){return t}function a(e,t){return[e,t]}}function ne(){return function(){function e(){this._map=new f}return Object.defineProperty(e.prototype,"size",{get:function(){return this._map.size},enumerable:!0,configurable:!0}),e.prototype.has=function(e){return this._map.has(e)},e.prototype.add=function(e){return this._map.set(e,e),this},e.prototype.delete=function(e){return this._map.delete(e)},e.prototype.clear=function(){this._map.clear()},e.prototype.keys=function(){return this._map.keys()},e.prototype.values=function(){return this._map.values()},e.prototype.entries=function(){return this._map.entries()},e.prototype["@@iterator"]=function(){return this.keys()},e.prototype[i]=function(){return this.keys()},e}()}function re(){var e=16,n=u.create(),r=i();return function(){function e(){this._key=i()}return e.prototype.has=function(e){var t=o(e,!1);return void 0!==t&&u.has(t,this._key)},e.prototype.get=function(e){var t=o(e,!1);return void 0!==t?u.get(t,this._key):void 0},e.prototype.set=function(e,t){return o(e,!0)[this._key]=t,this},e.prototype.delete=function(e){var t=o(e,!1);return void 0!==t&&delete t[this._key]},e.prototype.clear=function(){this._key=i()},e}();function i(){var e;do{e="@@WeakMap@@"+c()}while(u.has(n,e));return n[e]=!0,e}function o(e,n){if(!t.call(e,r)){if(!n)return;Object.defineProperty(e,r,{value:u.create()})}return e[r]}function a(e,t){for(var n=0;n<t;++n)e[n]=255*Math.random()|0;return e}function s(e){return"function"==typeof Uint8Array?"undefined"!=typeof crypto?crypto.getRandomValues(new Uint8Array(e)):"undefined"!=typeof msCrypto?msCrypto.getRandomValues(new Uint8Array(e)):a(new Uint8Array(e),e):a(new Array(e),e)}function c(){var t=s(e);t[6]=79&t[6]|64,t[8]=191&t[8]|128;for(var n="",r=0;r<e;++r){var i=t[r];4!==r&&6!==r&&8!==r||(n+="-"),i<16&&(n+="0"),n+=i.toString(16).toLowerCase()}return n}}function ie(e){return e.__=void 0,delete e.__,e}e("decorate",p),e("metadata",v),e("defineMetadata",g),e("hasMetadata",_),e("hasOwnMetadata",m),e("getMetadata",y),e("getOwnMetadata",w),e("getMetadataKeys",b),e("getOwnMetadataKeys",E),e("deleteMetadata",A)}(i)}()}(nf||(nf={}));const mf=Symbol("required"),yf=Symbol("checkType"),wf=(...e)=>(t,n,r)=>{let i=Reflect.getOwnMetadata(mf,t,n)||[];i.push({parameterIndex:r,fields:e}),Reflect.defineMetadata(mf,i,t,n)},bf=(e,t,n)=>(r,i,o)=>{let a=Reflect.getOwnMetadata(yf,r,i)||[];a.push({parameterIndex:o,type:e,properties:t,key:n}),Reflect.defineMetadata(yf,a,r,i)};const Ef=(e,t,n)=>{const r=n.value,o=r.toString().match(/\(.*?\)/)[0].replace(/[()]/gi,"").replace(/\s/gi,"").split(",");return n.value=function(){const n=Reflect.getOwnMetadata(mf,e,t),a=Reflect.getOwnMetadata(yf,e,t);return a&&a.forEach((e=>{const{parameterIndex:t,type:n,properties:r,key:a}=e;let s=arguments[t],u=o[t];if(!i.isEmpty(a)){const e=null==a?void 0:a.split(".");Array.isArray(e)&&e.length>0&&e.forEach((e=>{s=s[e],u=`${u}.${e}`}))}const c=typeof s;if(!i.isUndefined(s)){if(!Ln(s,n))throw pl.wrongTypeParam(u,n,Array.isArray(s)?"array":null===s?"null":c);"object"===n&&Object.entries(r).forEach((([e,t])=>{const n=s[e];if(!i.isUndefined(n)){if(Array.isArray(t)&&!t.includes(n))throw pl.wrongTypeParam(`${u}.${e}`,`${t}`.replace(/,/g,"|"),`'${n}'`);if(!Array.isArray(t)&&!Ln(n,t))throw pl.wrongTypeParam(`${u}.${e}`,t,Array.isArray(n)?"array":null===n?"null":typeof n)}}))}})),n&&n.forEach((e=>{const{parameterIndex:t,fields:n}=e,r=arguments[t],a=o[t],s=typeof r;if(!Array.isArray(r)&&"object"===s&&n.some((e=>i.isUndefined(r[e]))))throw pl.missingParam(`${n} in ${a}`);if("object"!==s&&(t>=arguments.length||i.isUndefined(r)))throw pl.missingParam(a)})),r.apply(this,arguments)},n};var Af;class Tf{constructor(){this.events=Kn.getInstance(),Af.set(this,void 0),Gn(this,Af,this.getInstance()),this.events.addListener=(t,n,r)=>{const i=t;return this.events.addListener(e.Events[i],n,r)}}login(e){return Zn(this,void 0,void 0,(function*(){return yield qn(this,Af).login(e)}))}getLoginStatus(){return qn(this,Af).getLoginStatus()}getAccessToken(e){return Zn(this,void 0,void 0,(function*(){return yield qn(this,Af).getAccessToken(e)}))}getVersion(){return qn(this,Af).getVersion()}getSystemInfo(){return qn(this,Af).getSystemInfo()}setNavigationBarTitle(e){return Zn(this,void 0,void 0,(function*(){return qn(this,Af).setNavigationBarTitle(e)}))}setNavigationBarColor(e){return Zn(this,void 0,void 0,(function*(){return yield qn(this,Af).setNavigationBarColor(e)}))}setBackgroundColor(e){return Zn(this,void 0,void 0,(function*(){return yield qn(this,Af).setBackgroundColor(e)}))}setNavigationBarLeftButton(e){return Zn(this,void 0,void 0,(function*(){return yield qn(this,Af).setNavigationBarLeftButton(e)}))}setDeviceOrientation(e){return Zn(this,void 0,void 0,(function*(){return yield qn(this,Af).setDeviceOrientation(e)}))}setStorage(e){return Zn(this,void 0,void 0,(function*(){return yield qn(this,Af).setStorage(e)}))}getStorage(e){return Zn(this,void 0,void 0,(function*(){return yield qn(this,Af).getStorage(e)}))}getStorageInfo(e){return Zn(this,void 0,void 0,(function*(){return yield qn(this,Af).getStorageInfo(e)}))}removeStorage(e){return Zn(this,void 0,void 0,(function*(){return yield qn(this,Af).removeStorage(e)}))}clearStorage(e){return Zn(this,void 0,void 0,(function*(){return yield qn(this,Af).clearStorage(e)}))}getUserInfo(e){return Zn(this,void 0,void 0,(function*(){return yield qn(this,Af).getUserInfo(e)}))}getNetworkType(e){return Zn(this,void 0,void 0,(function*(){return yield qn(this,Af).getNetworkType(e)}))}onNetworkStatusChange(e){return Zn(this,void 0,void 0,(function*(){return yield qn(this,Af).onNetworkStatusChange(e)}))}startBeaconDiscovery(e){return Zn(this,void 0,void 0,(function*(){return yield qn(this,Af).startBeaconDiscovery(e)}))}stopBeaconDiscovery(e){return Zn(this,void 0,void 0,(function*(){return yield qn(this,Af).stopBeaconDiscovery(e)}))}getBeacons(e){return Zn(this,void 0,void 0,(function*(){return yield qn(this,Af).getBeacons(e)}))}closeApp(e){return Zn(this,void 0,void 0,(function*(){return yield qn(this,Af).closeApp(e)}))}getLocation(e){return Zn(this,void 0,void 0,(function*(){return yield qn(this,Af).getLocation(e)}))}stopBluetoothDevicesDiscovery(){return Zn(this,void 0,void 0,(function*(){return yield qn(this,Af).stopBluetoothDevicesDiscovery()}))}startBluetoothDevicesDiscovery(e){return Zn(this,void 0,void 0,(function*(){return yield qn(this,Af).startBluetoothDevicesDiscovery(e)}))}openBluetoothAdapter(){return Zn(this,void 0,void 0,(function*(){return yield qn(this,Af).openBluetoothAdapter()}))}onBluetoothDeviceFound(){return Zn(this,void 0,void 0,(function*(){return yield qn(this,Af).onBluetoothDeviceFound()}))}onBluetoothAdapterStateChange(){return Zn(this,void 0,void 0,(function*(){return yield qn(this,Af).onBluetoothAdapterStateChange()}))}getConnectedBluetoothDevices(e){return Zn(this,void 0,void 0,(function*(){return yield qn(this,Af).getConnectedBluetoothDevices(e)}))}getBluetoothDevices(){return Zn(this,void 0,void 0,(function*(){return yield qn(this,Af).getBluetoothDevices()}))}getBluetoothAdapterState(){return Zn(this,void 0,void 0,(function*(){return yield qn(this,Af).getBluetoothAdapterState()}))}closeBluetoothAdapter(){return Zn(this,void 0,void 0,(function*(){return yield qn(this,Af).closeBluetoothAdapter()}))}scanQRCode(e){return Zn(this,void 0,void 0,(function*(){return yield qn(this,Af).scanQRCode(e)}))}openProfile(e){return Zn(this,void 0,void 0,(function*(){yield qn(this,Af).openProfile(e)}))}openChat(e){return Zn(this,void 0,void 0,(function*(){yield qn(this,Af).openChat(e)}))}openPostFeed(e){return Zn(this,void 0,void 0,(function*(){const t=e.type;if("image"===t&&Bn(e.data.imageUrl))throw pl.wrongTypeParam("object.data.imageUrl","valid url","invalid");if("link"===t&&(Bn(e.data.link)||!Cn(e.data.link)))throw pl.wrongTypeParam("object.data.link","valid url","invalid");if("profile"===t){if(Bn(e.data.id))throw pl.wrongTypeParam("object.data.id","valid id","empty");if(Bn(e.data.avatar)||!Cn(e.data.avatar))throw pl.wrongTypeParam("object.data.avatar","valid url","invalid");if(Bn(e.data.displayName))throw pl.wrongTypeParam("object.data.displayName","valid displayName","empty")}return yield qn(this,Af).openPostFeed(e)}))}followOA(e){return Zn(this,void 0,void 0,(function*(){return yield qn(this,Af).followOA(e)}))}unfollowOA(e){return Zn(this,void 0,void 0,(function*(){return yield qn(this,Af).unFollowOA(e)}))}openShareSheet(e){return Zn(this,void 0,void 0,(function*(){const t=e.type;if("image"===t&&Bn(e.data.imageUrl))throw pl.wrongTypeParam("object.data.imageUrl","valid url","invalid");if("gif"===t&&(Bn(e.data.gifUrl)||!Cn(e.data.gifUrl)))throw pl.wrongTypeParam("object.data.gifUrl","valid url","invalid");if("video"===t){if(Bn(e.data.videoThumb)||!Cn(e.data.videoThumb))throw pl.wrongTypeParam("object.data.videoThumb","valid url","invalid");if(Bn(e.data.videoUrl)||!Cn(e.data.videoUrl))throw pl.wrongTypeParam("object.data.videoUrl","valid url","invalid")}else{if("link"===t&&(Bn(e.data.link)||!Cn(e.data.link)))throw pl.wrongTypeParam("object.data.link","valid url","invalid");if("oa"===t&&Bn(e.data.id))throw pl.wrongTypeParam("object.data.id","valid id","empty");if("zmp"===t){if(i.isNull(e.data.title)||i.isNull(e.data.description))throw pl.missingParam(["data.title","data.description"]);{const t=e.data.title,n={vi:"",en:""};if(i.isString(e.data.description))n.en=n.vi=e.data.description;else{if(!i.isObject(e.data.description))throw pl.wrongTypeParam("data.description","string | {vi: string, en: string}",typeof e.data.description);n.en=e.data.description.en||"",n.vi=e.data.description.vi||""}if(t.length>100||n.vi.length>400||n.en.length>400)throw pl.lengthInvalid("'title' or 'description'");e.data.description=n}}}return yield qn(this,Af).openShareSheet(e)}))}requestCameraPermission(e){return Zn(this,void 0,void 0,(function*(){return yield qn(this,Af).requestCameraPermission(e)}))}createShortcut(e){return Zn(this,void 0,void 0,(function*(){yield qn(this,Af).createShortcut(e)}))}openBioAuthentication(e){var t;return Zn(this,void 0,void 0,(function*(){return i.isUndefined(e.requireFingerprint)&&(e.requireFingerprint=!0),Bn(null===(t=e.ui)||void 0===t?void 0:t.title)&&(e.ui=Object.assign(Object.assign({},e.ui),{title:"Xác thực"})),Bn(e.ui.subTitle)&&(e.ui=Object.assign(Object.assign({},e.ui),{subTitle:"Sử dụng sinh trắc học của bạn để xác thực"})),Bn(e.ui.negativeButtonText)&&(e.ui=Object.assign(Object.assign({},e.ui),{negativeButtonText:"Đóng"})),yield qn(this,Af).openBioAuthentication(e)}))}checkStateBioAuthentication(e){return Zn(this,void 0,void 0,(function*(){return yield qn(this,Af).checkStateBioAuthentication(e)}))}sendLocation(e){return Zn(this,void 0,void 0,(function*(){yield qn(this,Af).sendLocation(e)}))}showToast(e){return Zn(this,void 0,void 0,(function*(){yield qn(this,Af).showToast(e)}))}hideKeyboard(e){return Zn(this,void 0,void 0,(function*(){yield qn(this,Af).hideKeyboard(e)}))}openPhone(e){return Zn(this,void 0,void 0,(function*(){return yield qn(this,Af).openPhone(e)}))}openSMS(e){return Zn(this,void 0,void 0,(function*(){if(!/^\+?\d+$/.test(e.phoneNumber))throw pl.wrongTypeParam("object.phoneNumber","valid phone","invalid");yield qn(this,Af).openSMS(e)}))}viewOAQr(e){return Zn(this,void 0,void 0,(function*(){(i.isUndefined(e.displayName)||i.isNull(e.displayName))&&(e.displayName=""),yield qn(this,Af).viewOAQr(e)}))}keepScreen(e){return Zn(this,void 0,void 0,(function*(){return yield qn(this,Af).keepScreen(e)}))}saveImageToPhotosAlbum(e){return Zn(this,void 0,void 0,(function*(){if(Bn(e.imageBase64Data)&&Bn(e.imageUrl))throw pl.wrongTypeParam("object.imageBase64Data | object.imageUrl","valid data","invalid");if(!Bn(e.imageUrl)&&!Cn(e.imageUrl))throw pl.wrongTypeParam("object.imageUrl","valid url","invalid");return yield qn(this,Af).saveImageToPhotosAlbum(e)}))}openMiniApp(e){return Zn(this,void 0,void 0,(function*(){if(!i.isEmpty(e.params)){const t=e.params||{};Object.keys(t).forEach((e=>{"object"==typeof t[e]&&(t[e]=JSON.stringify(t[e])),t[e]=""+encodeURIComponent(t[e])})),e.params=t}yield qn(this,Af).openMiniApp(e)}))}vibrate(e){return Zn(this,void 0,void 0,(function*(){Bn(e.type)&&(e.type="oneShot"),Bn(e.milliseconds)&&(e.milliseconds=500),yield qn(this,Af).vibrate(e)}))}openWebview(e){return Zn(this,void 0,void 0,(function*(){yield qn(this,Af).openWebview(e)}))}getRouteParams(){return qn(this,Af).getRouteParams()}getAppInfo(e){return qn(this,Af).getAppInfo()}sendDataToPreviousMiniApp(e){return qn(this,Af).sendDataToPreviousMiniApp(e)}onCallbackData(e){return Zn(this,void 0,void 0,(function*(){return yield qn(this,Af).onCallbackData(e)}))}getPhoneNumber(e){return Zn(this,void 0,void 0,(function*(){return yield qn(this,Af).getPhoneNumber()}))}openProfilePicker(e){if(i.isUndefined(e.maxProfile)||e.maxProfile<1)e.maxProfile=1;else if(e.maxProfile>10)throw pl.badRequest("maxProfile must be in between 1 and 10");return qn(this,Af).openProfilePicker(e)}}Af=new WeakMap,Wn([ll],Tf.prototype,"login",null),Wn([fl],Tf.prototype,"getLoginStatus",null),Wn([ll],Tf.prototype,"getAccessToken",null),Wn([fl],Tf.prototype,"getVersion",null),Wn([fl],Tf.prototype,"getSystemInfo",null),Wn([ll,Ef,Hn(0,bf("object",{title:"string"})),Hn(0,wf("title"))],Tf.prototype,"setNavigationBarTitle",null),Wn([ll,Ef,Hn(0,bf("object",{color:"string",textColor:["white","black"],statusBarColor:"string"})),Hn(0,wf("color"))],Tf.prototype,"setNavigationBarColor",null),Wn([ll,Ef,Hn(0,bf("object",{backgroundColor:"string",textColor:["white","black"]})),Hn(0,wf("backgroundColor"))],Tf.prototype,"setBackgroundColor",null),Wn([ll,Ef,Hn(0,bf("object",{type:["none","back","home","both"]})),Hn(0,wf("type"))],Tf.prototype,"setNavigationBarLeftButton",null),Wn([ll,Ef,Hn(0,bf("object",{rotate:["auto","portrait","landscape"]})),Hn(0,wf("rotate"))],Tf.prototype,"setDeviceOrientation",null),Wn([ll,Ef,Hn(0,bf("object",{data:"object"})),Hn(0,wf("data"))],Tf.prototype,"setStorage",null),Wn([ll,Ef,Hn(0,bf("object",{keys:"array<string>"})),Hn(0,wf("keys"))],Tf.prototype,"getStorage",null),Wn([ll],Tf.prototype,"getStorageInfo",null),Wn([ll,Ef,Hn(0,bf("object",{keys:"array<string>"})),Hn(0,wf("keys"))],Tf.prototype,"removeStorage",null),Wn([ll],Tf.prototype,"clearStorage",null),Wn([ll,Ef,Hn(0,bf("object",{avatarType:["small","normal","large"]}))],Tf.prototype,"getUserInfo",null),Wn([ll],Tf.prototype,"getNetworkType",null),Wn([ll],Tf.prototype,"onNetworkStatusChange",null),Wn([ll],Tf.prototype,"startBeaconDiscovery",null),Wn([ll],Tf.prototype,"stopBeaconDiscovery",null),Wn([ll],Tf.prototype,"getBeacons",null),Wn([ll],Tf.prototype,"closeApp",null),Wn([ll],Tf.prototype,"getLocation",null),Wn([ll],Tf.prototype,"stopBluetoothDevicesDiscovery",null),Wn([ll],Tf.prototype,"startBluetoothDevicesDiscovery",null),Wn([ll],Tf.prototype,"openBluetoothAdapter",null),Wn([ll],Tf.prototype,"onBluetoothDeviceFound",null),Wn([ll],Tf.prototype,"onBluetoothAdapterStateChange",null),Wn([ll],Tf.prototype,"getConnectedBluetoothDevices",null),Wn([ll],Tf.prototype,"getBluetoothDevices",null),Wn([ll],Tf.prototype,"getBluetoothAdapterState",null),Wn([ll],Tf.prototype,"closeBluetoothAdapter",null),Wn([ll],Tf.prototype,"scanQRCode",null),Wn([ll,Ef,Hn(0,bf("object",{type:["user","oa","aliasOA"],id:"string"})),Hn(0,wf("type","id"))],Tf.prototype,"openProfile",null),Wn([ll,Ef,Hn(0,bf("object",{type:["user","oa"],id:"string"})),Hn(0,wf("type","id"))],Tf.prototype,"openChat",null),Wn([ll,Ef,Hn(0,bf("object",{type:["image","link","profile"],data:"object"})),Hn(0,bf("object",{imageUrl:"string",link:"string",title:"string",thumb:"string",description:"string",avatar:"string",id:"string",displayName:"string"},"data")),Hn(0,wf("type","data"))],Tf.prototype,"openPostFeed",null),Wn([ll,Ef,Hn(0,bf("object",{id:"string",showDialogConfirm:"boolean"})),Hn(0,wf("id"))],Tf.prototype,"followOA",null),Wn([ll,Ef,Hn(0,bf("object",{id:"string"})),Hn(0,wf("id"))],Tf.prototype,"unfollowOA",null),Wn([ll,Ef,Hn(0,bf("object",{type:["image","gif","video","link","oa","zmp"],data:"object"})),Hn(0,bf("object",{imageUrl:"string",gifUrl:"string",width:"number",height:"number",videoThumb:"string",videoUrl:"string",link:"string",chatOnly:"boolean",id:"string",title:"string",thumbnail:"url",path:"string"},"data")),Hn(0,wf("type","data"))],Tf.prototype,"openShareSheet",null),Wn([ll],Tf.prototype,"requestCameraPermission",null),Wn([ll],Tf.prototype,"createShortcut",null),Wn([ll,Ef,Hn(0,wf("secretData")),Hn(0,bf("object",{secretData:"string",ui:"object",requireFingerprint:"boolean"})),Hn(0,bf("object",{title:"string",subTitle:"string",negativeButtonText:"string"},"ui"))],Tf.prototype,"openBioAuthentication",null),Wn([ll],Tf.prototype,"checkStateBioAuthentication",null),Wn([ll,Ef,Hn(0,wf("toUserId"))],Tf.prototype,"sendLocation",null),Wn([ll,Ef,Hn(0,wf("message"))],Tf.prototype,"showToast",null),Wn([ll],Tf.prototype,"hideKeyboard",null),Wn([ll,Ef,Hn(0,wf("phoneNumber")),Hn(0,bf("object",{phoneNumber:"string"}))],Tf.prototype,"openPhone",null),Wn([ll,Ef,Hn(0,wf("content","phoneNumber")),Hn(0,bf("object",{content:"string",phoneNumber:"string"}))],Tf.prototype,"openSMS",null),Wn([ll,Ef,Hn(0,wf("id")),Hn(0,bf("object",{id:"string",displayName:"string"}))],Tf.prototype,"viewOAQr",null),Wn([ll],Tf.prototype,"keepScreen",null),Wn([ll,Ef,Hn(0,bf("object",{imageBase64Data:"string",imageUrl:"string",type:"string"}))],Tf.prototype,"saveImageToPhotosAlbum",null),Wn([ll,Ef,Hn(0,wf("appId")),Hn(0,bf("object",{appId:"string",params:"object"}))],Tf.prototype,"openMiniApp",null),Wn([ll,Ef,Hn(0,bf("object",{type:["oneShot"],milliseconds:"number"}))],Tf.prototype,"vibrate",null),Wn([ll,Ef,Hn(0,wf("url")),Hn(0,bf("object",{url:"string"}))],Tf.prototype,"openWebview",null),Wn([fl],Tf.prototype,"getRouteParams",null),Wn([ll],Tf.prototype,"getAppInfo",null),Wn([ll],Tf.prototype,"sendDataToPreviousMiniApp",null),Wn([ll],Tf.prototype,"onCallbackData",null),Wn([ll],Tf.prototype,"getPhoneNumber",null),Wn([ll,Ef,Hn(0,bf("object",{maxProfile:"number"}))],Tf.prototype,"openProfilePicker",null);class kf extends Tf{getInstance(){return gf.getInstance()}}class Sf extends Tf{getInstance(){return new _f}}const Of=Nn();e.default=void 0,window.onJSCall=e=>function(t){al.getInstance().onJSCall(e,t)},window.onMultiJSCall=e=>function(t){al.getInstance().onMultiJSCall(e,t)},window.zaloJSV2={zalo_h5_event_handler:function(e,t,n){al.getInstance().nativeEventHandler(e,t,n)}},Of.isZalo?e.default=new kf:e.default=new Sf,window.ZaloMiniAppSDK=e.default,e.SDKCreator=Tf,e.default=e.default,Object.defineProperty(e,"__esModule",{value:!0})}));