Files
tk-mini-program/unpackage/dist/build/mp-weixin/common/vendor.js
pengxiaolong 0044f8f334 优化代码
2025-09-29 20:48:31 +08:00

20 lines
451 KiB
JavaScript
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

"use strict";
/**
* @vue/shared v3.4.21
* (c) 2018-present Yuxi (Evan) You and Vue contributors
* @license MIT
**/
function e(e,t){const n=new Set(e.split(","));return t?e=>n.has(e.toLowerCase()):e=>n.has(e)}const t={},n=[],i=()=>{},o=()=>!1,s=e=>111===e.charCodeAt(0)&&110===e.charCodeAt(1)&&(e.charCodeAt(2)>122||e.charCodeAt(2)<97),r=e=>e.startsWith("onUpdate:"),a=Object.assign,c=(e,t)=>{const n=e.indexOf(t);n>-1&&e.splice(n,1)},l=Object.prototype.hasOwnProperty,u=(e,t)=>l.call(e,t),p=Array.isArray,d=e=>"[object Map]"===x(e),h=e=>"[object Set]"===x(e),f=e=>"function"==typeof e,m=e=>"string"==typeof e,g=e=>"symbol"==typeof e,v=e=>null!==e&&"object"==typeof e,y=e=>(v(e)||f(e))&&f(e.then)&&f(e.catch),b=Object.prototype.toString,x=e=>b.call(e),S=e=>"[object Object]"===x(e),k=e=>m(e)&&"NaN"!==e&&"-"!==e[0]&&""+parseInt(e,10)===e,C=e(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),w=e=>{const t=Object.create(null);return n=>t[n]||(t[n]=e(n))},E=/-(\w)/g,T=w((e=>e.replace(E,((e,t)=>t?t.toUpperCase():"")))),I=/\B([A-Z])/g,_=w((e=>e.replace(I,"-$1").toLowerCase())),O=w((e=>e.charAt(0).toUpperCase()+e.slice(1))),A=w((e=>e?`on${O(e)}`:"")),R=(e,t)=>!Object.is(e,t),P=(e,t)=>{for(let n=0;n<e.length;n++)e[n](t)},M=e=>{const t=parseFloat(e);return isNaN(t)?e:t};function N(e){if(p(e)){const t={};for(let n=0;n<e.length;n++){const i=e[n],o=m(i)?j(i):N(i);if(o)for(const e in o)t[e]=o[e]}return t}if(m(e)||v(e))return e}const D=/;(?![^(]*\))/g,B=/:([^]+)/,L=/\/\*[^]*?\*\//g;function j(e){const t={};return e.replace(L,"").split(D).forEach((e=>{if(e){const n=e.split(B);n.length>1&&(t[n[0].trim()]=n[1].trim())}})),t}function U(e){let t="";if(m(e))t=e;else if(p(e))for(let n=0;n<e.length;n++){const i=U(e[n]);i&&(t+=i+" ")}else if(v(e))for(const n in e)e[n]&&(t+=n+" ");return t.trim()}const F=(e,t)=>t&&t.__v_isRef?F(e,t.value):d(t)?{[`Map(${t.size})`]:[...t.entries()].reduce(((e,[t,n],i)=>(e[G(t,i)+" =>"]=n,e)),{})}:h(t)?{[`Set(${t.size})`]:[...t.values()].map((e=>G(e)))}:g(t)?G(t):!v(t)||p(t)||S(t)?t:String(t),G=(e,t="")=>{var n;return g(e)?`Symbol(${null!=(n=e.description)?n:t})`:e},q="onShow",z="onHide",H="onLaunch",$="onError",V="onThemeChange",K="onPageNotFound",W="onUnhandledRejection",X="onLoad",J="onReady",Q="onUnload",Y="onInit",Z="onSaveExitState",ee="onResize",te="onBackPress",ne="onPageScroll",ie="onTabItemTap",oe="onReachBottom",se="onPullDownRefresh",re="onShareTimeline",ae="onShareChat",ce="onAddToFavorites",le="onShareAppMessage",ue="onNavigationBarButtonTap",pe="onNavigationBarSearchInputClicked",de="onNavigationBarSearchInputChanged",he="onNavigationBarSearchInputConfirmed",fe="onNavigationBarSearchInputFocusChanged",me="virtualHostId";function ge(e,t=null){let n;return(...i)=>(e&&(n=e.apply(t,i),e=null),n)}function ve(e,t){if(!m(t))return;const n=(t=t.replace(/\[(\d+)\]/g,".$1")).split(".");let i=n[0];return e||(e={}),1===n.length?e[i]:ve(e[i],n.slice(1).join("."))}function ye(e){let t={};return S(e)&&Object.keys(e).sort().forEach((n=>{const i=n;t[i]=e[i]})),Object.keys(t)?t:e}const be=/:/g;const xe=encodeURIComponent;function Se(e,t=xe){const n=e?Object.keys(e).map((n=>{let i=e[n];return void 0===typeof i||null===i?i="":S(i)&&(i=JSON.stringify(i)),t(n)+"="+t(i)})).filter((e=>e.length>0)).join("&"):null;return n?`?${n}`:""}const ke=[Y,X,q,z,Q,te,ne,ie,oe,se,re,le,ae,ce,Z,ue,pe,de,he,fe];const Ce=[q,z,H,$,V,K,W,"onExit",Y,X,J,Q,ee,te,ne,ie,oe,se,re,ce,le,ae,Z,ue,pe,de,he,fe],we=(()=>({onPageScroll:1,onShareAppMessage:2,onShareTimeline:4}))();function Ee(e,t,n=!0){return!(n&&!f(t))&&(Ce.indexOf(e)>-1||0===e.indexOf("on"))}let Te;const Ie=[];const _e=ge(((e,t)=>t(e))),Oe=function(){};Oe.prototype={_id:1,on:function(e,t,n){var i=this.e||(this.e={});return(i[e]||(i[e]=[])).push({fn:t,ctx:n,_id:this._id}),this._id++},once:function(e,t,n){var i=this;function o(){i.off(e,o),t.apply(n,arguments)}return o._=t,this.on(e,o,n)},emit:function(e){for(var t=[].slice.call(arguments,1),n=((this.e||(this.e={}))[e]||[]).slice(),i=0,o=n.length;i<o;i++)n[i].fn.apply(n[i].ctx,t);return this},off:function(e,t){var n=this.e||(this.e={}),i=n[e],o=[];if(i&&t){for(var s=i.length-1;s>=0;s--)if(i[s].fn===t||i[s].fn._===t||i[s]._id===t){i.splice(s,1);break}o=i}return o.length?n[e]=o:delete n[e],this}};var Ae=Oe;const Re=["{","}"];const Pe=/^(?:\d)+/,Me=/^(?:\w)+/;const Ne="zh-Hans",De="zh-Hant",Be="en",Le=Object.prototype.hasOwnProperty,je=(e,t)=>Le.call(e,t),Ue=new class{constructor(){this._caches=Object.create(null)}interpolate(e,t,n=Re){if(!t)return[e];let i=this._caches[e];return i||(i=function(e,[t,n]){const i=[];let o=0,s="";for(;o<e.length;){let r=e[o++];if(r===t){s&&i.push({type:"text",value:s}),s="";let t="";for(r=e[o++];void 0!==r&&r!==n;)t+=r,r=e[o++];const a=r===n,c=Pe.test(t)?"list":a&&Me.test(t)?"named":"unknown";i.push({value:t,type:c})}else s+=r}return s&&i.push({type:"text",value:s}),i}(e,n),this._caches[e]=i),function(e,t){const n=[];let i=0;const o=Array.isArray(t)?"list":(s=t,null!==s&&"object"==typeof s?"named":"unknown");var s;if("unknown"===o)return n;for(;i<e.length;){const s=e[i];switch(s.type){case"text":n.push(s.value);break;case"list":n.push(t[parseInt(s.value,10)]);break;case"named":"named"===o&&n.push(t[s.value])}i++}return n}(i,t)}};function Fe(e,t){if(!e)return;if(e=e.trim().replace(/_/g,"-"),t&&t[e])return e;if("chinese"===(e=e.toLowerCase()))return Ne;if(0===e.indexOf("zh"))return e.indexOf("-hans")>-1?Ne:e.indexOf("-hant")>-1?De:(n=e,["-tw","-hk","-mo","-cht"].find((e=>-1!==n.indexOf(e)))?De:Ne);var n;let i=[Be,"fr","es"];t&&Object.keys(t).length>0&&(i=Object.keys(t));const o=function(e,t){return t.find((t=>0===e.indexOf(t)))}(e,i);return o||void 0}class Ge{constructor({locale:e,fallbackLocale:t,messages:n,watcher:i,formater:o}){this.locale=Be,this.fallbackLocale=Be,this.message={},this.messages={},this.watchers=[],t&&(this.fallbackLocale=t),this.formater=o||Ue,this.messages=n||{},this.setLocale(e||Be),i&&this.watchLocale(i)}setLocale(e){const t=this.locale;this.locale=Fe(e,this.messages)||this.fallbackLocale,this.messages[this.locale]||(this.messages[this.locale]={}),this.message=this.messages[this.locale],t!==this.locale&&this.watchers.forEach((e=>{e(this.locale,t)}))}getLocale(){return this.locale}watchLocale(e){const t=this.watchers.push(e)-1;return()=>{this.watchers.splice(t,1)}}add(e,t,n=!0){const i=this.messages[e];i?n?Object.assign(i,t):Object.keys(t).forEach((e=>{je(i,e)||(i[e]=t[e])})):this.messages[e]=t}f(e,t,n){return this.formater.interpolate(e,t,n).join("")}t(e,t,n){let i=this.message;return"string"==typeof t?(t=Fe(t,this.messages))&&(i=this.messages[t]):n=t,je(i,e)?this.formater.interpolate(i[e],n).join(""):(console.warn(`Cannot translate the value of keypath ${e}. Use the value of keypath as default.`),e)}}function qe(e){return function(){try{return e.apply(e,arguments)}catch(Wa){console.error(Wa)}}}let ze=1;const He={};function $e(e,t,n){if("number"==typeof e){const i=He[e];if(i)return i.keepAlive||delete He[e],i.callback(t,n)}return t}const Ve="success",Ke="fail",We="complete";function Xe(e,t={},{beforeAll:n,beforeSuccess:i}={}){S(t)||(t={});const{success:o,fail:s,complete:r}=function(e){const t={};for(const n in e){const i=e[n];f(i)&&(t[n]=qe(i),delete e[n])}return t}(t),a=f(o),c=f(s),l=f(r),u=ze++;return function(e,t,n,i=!1){He[e]={name:t,keepAlive:i,callback:n}}(u,e,(u=>{(u=u||{}).errMsg=function(e,t){return e&&-1!==e.indexOf(":fail")?t+e.substring(e.indexOf(":fail")):t+":ok"}(u.errMsg,e),f(n)&&n(u),u.errMsg===e+":ok"?(f(i)&&i(u,t),a&&o(u)):c&&s(u),l&&r(u)})),u}const Je="success",Qe="fail",Ye="complete",Ze={},et={};function nt(e,t){return function(n){return e(n,t)||n}}function it(e,t,n){let i=!1;for(let o=0;o<e.length;o++){const s=e[o];if(i)i=Promise.resolve(nt(s,n));else{const e=s(t,n);if(y(e)&&(i=Promise.resolve(e)),!1===e)return{then(){},catch(){}}}}return i||{then:e=>e(t),catch(){}}}function ot(e,t={}){return[Je,Qe,Ye].forEach((n=>{const i=e[n];if(!p(i))return;const o=t[n];t[n]=function(e){it(i,e,t).then((e=>f(o)&&o(e)||e))}})),t}function st(e,t){const n=[];p(Ze.returnValue)&&n.push(...Ze.returnValue);const i=et[e];return i&&p(i.returnValue)&&n.push(...i.returnValue),n.forEach((e=>{t=e(t)||t})),t}function rt(e){const t=Object.create(null);Object.keys(Ze).forEach((e=>{"returnValue"!==e&&(t[e]=Ze[e].slice())}));const n=et[e];return n&&Object.keys(n).forEach((e=>{"returnValue"!==e&&(t[e]=(t[e]||[]).concat(n[e]))})),t}function at(e,t,n,i){const o=rt(e);if(o&&Object.keys(o).length){if(p(o.invoke)){return it(o.invoke,n).then((n=>t(ot(rt(e),n),...i)))}return t(ot(o,n),...i)}return t(n,...i)}function ct(e,t){return(n={},...i)=>function(e){return!(!S(e)||![Ve,Ke,We].find((t=>f(e[t]))))}(n)?st(e,at(e,t,a({},n),i)):st(e,new Promise(((o,s)=>{at(e,t,a({},n,{success:o,fail:s}),i)})))}function lt(e,t,n,i={}){const o=t+":fail";let s="";return s=n?0===n.indexOf(o)?n:o+" "+n:o,delete i.errCode,$e(e,a({errMsg:s},i))}function ut(e,t,n,i){const o=function(e){e[0]}(t);if(o)return o}function pt(e,t,n,i){return n=>{const o=Xe(e,n,i),s=ut(0,[n]);return s?lt(o,e,s):t(n,{resolve:t=>function(e,t,n){return $e(e,a(n||{},{errMsg:t+":ok"}))}(o,e,t),reject:(t,n)=>lt(o,e,function(e){return!e||m(e)?e:e.stack?("undefined"!=typeof globalThis&&globalThis.harmonyChannel||console.error(e.message+"\n"+e.stack),e.message):e}(t),n)})}}function dt(e,t,n,i){return function(e,t){return(...e)=>{const n=ut(0,e);if(n)throw new Error(n);return t.apply(null,e)}}(0,t)}let ht=!1,ft=0,mt=0;const gt=dt(0,((e,t)=>{if(0===ft&&function(){var e,t;let n,i,o;{const s=(null===(e=wx.getWindowInfo)||void 0===e?void 0:e.call(wx))||wx.getSystemInfoSync(),r=(null===(t=wx.getDeviceInfo)||void 0===t?void 0:t.call(wx))||wx.getSystemInfoSync();n=s.windowWidth,i=s.pixelRatio,o=r.platform}ft=n,mt=i,ht="ios"===o}(),0===(e=Number(e)))return 0;let n=e/750*(t||ft);return n<0&&(n=-n),n=Math.floor(n+1e-4),0===n&&(n=1!==mt&&ht?.5:1),e<0?-n:n}));function vt(e,t){Object.keys(t).forEach((n=>{f(t[n])&&(e[n]=function(e,t){const n=t?e?e.concat(t):p(t)?t:[t]:e;return n?function(e){const t=[];for(let n=0;n<e.length;n++)-1===t.indexOf(e[n])&&t.push(e[n]);return t}(n):n}(e[n],t[n]))}))}function yt(e,t){e&&t&&Object.keys(t).forEach((n=>{const i=e[n],o=t[n];p(i)&&f(o)&&c(i,o)}))}const bt=dt(0,((e,t)=>{m(e)&&S(t)?vt(et[e]||(et[e]={}),t):S(e)&&vt(Ze,e)})),xt=dt(0,((e,t)=>{m(e)?S(t)?yt(et[e],t):delete et[e]:S(e)&&yt(Ze,e)}));const St=new class{constructor(){this.$emitter=new Ae}on(e,t){return this.$emitter.on(e,t)}once(e,t){return this.$emitter.once(e,t)}off(e,t){e?this.$emitter.off(e,t):this.$emitter.e={}}emit(e,...t){this.$emitter.emit(e,...t)}},kt=dt(0,((e,t)=>(St.on(e,t),()=>St.off(e,t)))),Ct=dt(0,((e,t)=>(St.once(e,t),()=>St.off(e,t)))),wt=dt(0,((e,t)=>{p(e)||(e=e?[e]:[]),e.forEach((e=>{St.off(e,t)}))})),Et=dt(0,((e,...t)=>{St.emit(e,...t)}));let Tt,It,_t;function Ot(e){try{return JSON.parse(e)}catch(Wa){}return e}const At=[];function Rt(e,t){At.forEach((n=>{n(e,t)})),At.length=0}const Pt=ct(Mt="getPushClientId",function(e,t,n,i){return pt(e,t,0,i)}(Mt,((e,{resolve:t,reject:n})=>{Promise.resolve().then((()=>{void 0===_t&&(_t=!1,Tt="",It="uniPush is not enabled"),At.push(((e,i)=>{e?t({cid:e}):n(i)})),void 0!==Tt&&Rt(Tt,It)}))}),0,Nt));var Mt,Nt;const Dt=[],Bt=/^\$|__f__|getLocale|setLocale|sendNativeEvent|restoreGlobal|requireGlobal|getCurrentSubNVue|getMenuButtonBoundingClientRect|^report|interceptors|Interceptor$|getSubNVueById|requireNativePlugin|upx2px|rpx2px|hideKeyboard|canIUse|^create|Sync$|Manager$|base64ToArrayBuffer|arrayBufferToBase64|getDeviceInfo|getAppBaseInfo|getWindowInfo|getSystemSetting|getAppAuthorizeSetting/,Lt=/^create|Manager$/,jt=["createBLEConnection"],Ut=["request","downloadFile","uploadFile","connectSocket"],Ft=["createBLEConnection"],Gt=/^on|^off/;function qt(e){return Lt.test(e)&&-1===jt.indexOf(e)}function zt(e){return Bt.test(e)&&-1===Ft.indexOf(e)}function Ht(e){return-1!==Ut.indexOf(e)}function $t(e){return!(qt(e)||zt(e)||function(e){return Gt.test(e)&&"onPush"!==e}(e))}function Vt(e,t){return $t(e)&&f(t)?function(n={},...i){return f(n.success)||f(n.fail)||f(n.complete)?st(e,at(e,t,a({},n),i)):st(e,new Promise(((o,s)=>{at(e,t,a({},n,{success:o,fail:s}),i)})))}:t}Promise.prototype.finally||(Promise.prototype.finally=function(e){const t=this.constructor;return this.then((n=>t.resolve(e&&e()).then((()=>n))),(n=>t.resolve(e&&e()).then((()=>{throw n}))))});const Kt=["success","fail","cancel","complete"];const Wt=()=>{const e=f(getApp)&&getApp({allowDefault:!0});return e&&e.$vm?e.$vm.$locale:function(){var e;let t="";{const n=(null===(e=wx.getAppBaseInfo)||void 0===e?void 0:e.call(wx))||wx.getSystemInfoSync();t=Fe(n&&n.language?n.language:Be)||Be}return t}()},Xt=[];"undefined"!=typeof global&&(global.getLocale=Wt);const Jt="__DC_STAT_UUID";let Qt;function Yt(e=wx){return function(t,n){Qt=Qt||e.getStorageSync(Jt),Qt||(Qt=Date.now()+""+Math.floor(1e7*Math.random()),wx.setStorage({key:Jt,data:Qt})),n.deviceId=Qt}}function Zt(e,t){if(e.safeArea){const n=e.safeArea;t.safeAreaInsets={top:n.top,left:n.left,right:e.windowWidth-n.right,bottom:e.screenHeight-n.bottom}}}function en(e,t){let n="",i="";switch(n=e.split(" ")[0]||t,i=e.split(" ")[1]||"",n=n.toLowerCase(),n){case"harmony":case"ohos":case"openharmony":n="harmonyos";break;case"iphone os":n="ios";break;case"mac":case"darwin":n="macos";break;case"windows_nt":n="windows"}return{osName:n,osVersion:i}}function tn(e,t){let n=e.deviceType||"phone";{const e={ipad:"pad",windows:"pc",mac:"pc"},i=Object.keys(e),o=t.toLowerCase();for(let t=0;t<i.length;t++){const s=i[t];if(-1!==o.indexOf(s)){n=e[s];break}}}return n}function nn(e){let t=e;return t&&(t=t.toLowerCase()),t}function on(e){return Wt?Wt():e}function sn(e){let t=e.hostName||"WeChat";return e.environment?t=e.environment:e.host&&e.host.env&&(t=e.host.env),t}const rn={returnValue:(e,t)=>{Zt(e,t),Yt()(e,t),function(e,t){const{brand:n="",model:i="",system:o="",language:s="",theme:r,version:c,platform:l,fontSizeSetting:u,SDKVersion:p,pixelRatio:d,deviceOrientation:h}=e,{osName:f,osVersion:m}=en(o,l);let g=c,v=tn(e,i),y=nn(n),b=sn(e),x=h,S=d,k=p;const C=(s||"").replace(/_/g,"-"),w={appId:"__UNI__A6CDB98",appName:"tk-mini-program",appVersion:"1.0.0",appVersionCode:"100",appLanguage:on(C),uniCompileVersion:"4.76",uniCompilerVersion:"4.76",uniRuntimeVersion:"4.76",uniPlatform:"mp-weixin",deviceBrand:y,deviceModel:i,deviceType:v,devicePixelRatio:S,deviceOrientation:x,osName:f,osVersion:m,hostTheme:r,hostVersion:g,hostLanguage:C,hostName:b,hostSDKVersion:k,hostFontSizeSetting:u,windowTop:0,windowBottom:0,osLanguage:void 0,osTheme:void 0,ua:void 0,hostPackageName:void 0,browserName:void 0,browserVersion:void 0,isUniAppX:!1};a(t,w)}(e,t)}},an=rn,cn={args(e,t){let n=parseInt(e.current);if(isNaN(n))return;const i=e.urls;if(!p(i))return;const o=i.length;return o?(n<0?n=0:n>=o&&(n=o-1),n>0?(t.current=i[n],t.urls=i.filter(((e,t)=>!(t<n)||e!==i[n]))):t.current=i[0],{indicator:!1,loop:!1}):void 0}},ln={args(e,t){t.alertText=e.title}},un={returnValue:(e,t)=>{const{brand:n,model:i,system:o="",platform:s=""}=e;let r=tn(e,i),c=nn(n);Yt()(e,t);const{osName:l,osVersion:u}=en(o,s);t=ye(a(t,{deviceType:r,deviceBrand:c,deviceModel:i,osName:l,osVersion:u}))}},pn={returnValue:(e,t)=>{const{version:n,language:i,SDKVersion:o,theme:s}=e;let r=sn(e),c=(i||"").replace(/_/g,"-");const l={hostVersion:n,hostLanguage:c,hostName:r,hostSDKVersion:o,hostTheme:s,appId:"__UNI__A6CDB98",appName:"tk-mini-program",appVersion:"1.0.0",appVersionCode:"100",appLanguage:on(c),isUniAppX:!1,uniPlatform:"mp-weixin",uniCompileVersion:"4.76",uniCompilerVersion:"4.76",uniRuntimeVersion:"4.76"};a(t,l)}},dn={returnValue:(e,t)=>{Zt(e,t),t=ye(a(t,{windowTop:0,windowBottom:0}))}},hn={args(e){const t=getApp({allowDefault:!0})||{};t.$vm?Zo($,e,t.$vm.$):(wx.$onErrorHandlers||(wx.$onErrorHandlers=[]),wx.$onErrorHandlers.push(e))}},fn={args(e){const t=getApp({allowDefault:!0})||{};if(t.$vm){if(e.__weh){const n=t.$vm.$[$];if(n){const t=n.indexOf(e.__weh);t>-1&&n.splice(t,1)}}}else{if(!wx.$onErrorHandlers)return;const t=wx.$onErrorHandlers.findIndex((t=>t===e));-1!==t&&wx.$onErrorHandlers.splice(t,1)}}},mn={args(){if(wx.__uni_console__){if(wx.__uni_console_warned__)return;wx.__uni_console_warned__=!0,console.warn("开发模式下小程序日志回显会使用 socket 连接,为了避免冲突,建议使用 SocketTask 的方式去管理 WebSocket 或手动关闭日志回显功能。[详情](https://uniapp.dcloud.net.cn/tutorial/run/mp-log.html)")}}},gn=mn,vn={$on:kt,$off:wt,$once:Ct,$emit:Et,upx2px:gt,rpx2px:gt,interceptors:{},addInterceptor:bt,removeInterceptor:xt,onCreateVueApp:function(e){if(Te)return e(Te);Ie.push(e)},invokeCreateVueAppHook:function(e){Te=e,Ie.forEach((t=>t(e)))},getLocale:Wt,setLocale:e=>{const t=f(getApp)&&getApp();if(!t)return!1;return t.$vm.$locale!==e&&(t.$vm.$locale=e,Xt.forEach((t=>t({locale:e}))),!0)},onLocaleChange:e=>{-1===Xt.indexOf(e)&&Xt.push(e)},getPushClientId:Pt,onPushMessage:e=>{-1===Dt.indexOf(e)&&Dt.push(e)},offPushMessage:e=>{if(e){const t=Dt.indexOf(e);t>-1&&Dt.splice(t,1)}else Dt.length=0},invokePushCallback:function(e){if("enabled"===e.type)_t=!0;else if("clientId"===e.type)Tt=e.cid,It=e.errMsg,Rt(Tt,e.errMsg);else if("pushMsg"===e.type){const t={type:"receive",data:Ot(e.message)};for(let e=0;e<Dt.length;e++){if((0,Dt[e])(t),t.stopped)break}}else"click"===e.type&&Dt.forEach((t=>{t({type:"click",data:Ot(e.message)})}))},__f__:function(e,t,...n){t&&n.push(t),console[e].apply(console,n)}};const yn=["qy","env","error","version","lanDebug","cloud","serviceMarket","router","worklet","__webpack_require_UNI_MP_PLUGIN__"],bn=["lanDebug","router","worklet"],xn=wx.getLaunchOptionsSync?wx.getLaunchOptionsSync():null;function Sn(e){return(!xn||1154!==xn.scene||!bn.includes(e))&&(yn.indexOf(e)>-1||"function"==typeof wx[e])}function kn(){const e={};for(const t in wx)Sn(t)&&(e[t]=wx[t]);return"undefined"!=typeof globalThis&&"undefined"==typeof requireMiniProgram&&(globalThis.wx=e),e}const Cn=["__route__","__wxExparserNodeId__","__wxWebviewId__"],wn=(En={oauth:["weixin"],share:["weixin"],payment:["wxpay"],push:["weixin"]},function({service:e,success:t,fail:n,complete:i}){let o;En[e]?(o={errMsg:"getProvider:ok",service:e,provider:En[e]},f(t)&&t(o)):(o={errMsg:"getProvider:fail:服务["+e+"]不存在"},f(n)&&n(o)),f(i)&&i(o)});var En;const Tn=kn();Tn.canIUse("getAppBaseInfo")||(Tn.getAppBaseInfo=Tn.getSystemInfoSync),Tn.canIUse("getWindowInfo")||(Tn.getWindowInfo=Tn.getSystemInfoSync),Tn.canIUse("getDeviceInfo")||(Tn.getDeviceInfo=Tn.getSystemInfoSync);let In=Tn.getAppBaseInfo&&Tn.getAppBaseInfo();In||(In=Tn.getSystemInfoSync());const _n=In?In.host:null,On=_n&&"SAAASDK"===_n.env?Tn.miniapp.shareVideoMessage:Tn.shareVideoMessage;var An=Object.freeze({__proto__:null,createSelectorQuery:function(){const e=Tn.createSelectorQuery(),t=e.in;return e.in=function(e){return e.$scope?t.call(this,e.$scope):t.call(this,function(e){const t=Object.create(null);return Cn.forEach((n=>{t[n]=e[n]})),t}(e))},e},getProvider:wn,shareVideoMessage:On});const Rn={args(e,t){e.compressedHeight&&!t.compressHeight&&(t.compressHeight=e.compressedHeight),e.compressedWidth&&!t.compressWidth&&(t.compressWidth=e.compressedWidth)}};var Pn=Object.freeze({__proto__:null,compressImage:Rn,getAppAuthorizeSetting:{returnValue:function(e,t){const{locationReducedAccuracy:n}=e;t.locationAccuracy="unsupported",!0===n?t.locationAccuracy="reduced":!1===n&&(t.locationAccuracy="full")}},getAppBaseInfo:pn,getDeviceInfo:un,getSystemInfo:rn,getSystemInfoSync:an,getWindowInfo:dn,offError:fn,onError:hn,onSocketMessage:gn,onSocketOpen:mn,previewImage:cn,redirectTo:{},showActionSheet:ln});const Mn=kn();var Nn=function(e,t,n=wx){const i=function(e){function t(e,t,n){return function(o){return t(i(e,o,n))}}function n(e,n,i={},o={},s=!1){if(S(n)){const r=!0===s?n:{};f(i)&&(i=i(n,r)||{});for(const a in n)if(u(i,a)){let t=i[a];f(t)&&(t=t(n[a],n,r)),t?m(t)?r[t]=n[a]:S(t)&&(r[t.name?t.name:a]=t.value):console.warn(`微信小程序 ${e} 暂不支持 ${a}`)}else if(-1!==Kt.indexOf(a)){const i=n[a];f(i)&&(r[a]=t(e,i,o))}else s||u(r,a)||(r[a]=n[a]);return r}return f(n)&&(f(i)&&i(n,{}),n=t(e,n,o)),n}function i(t,i,o,s=!1){return f(e.returnValue)&&(i=e.returnValue(t,i)),n(t,i,o,{},s||!1)}return function(t,o){const s=u(e,t);if(!s&&"function"!=typeof wx[t])return o;const r=s||f(e.returnValue)||qt(t)||Ht(t),a=s||f(o);if(!s&&!o)return function(){console.error(`微信小程序 暂不支持${t}`)};if(!r||!a)return o;const c=e[t];return function(e,o){let s=c||{};f(c)&&(s=c(e));const r=[e=n(t,e,s.args,s.returnValue)];void 0!==o&&r.push(o);const a=wx[s.name||t].apply(wx,r);return(qt(t)||Ht(t))&&a&&!a.__v_skip&&(a.__v_skip=!0),zt(t)?i(t,a,s.returnValue,qt(t)):a}}}(t);return new Proxy({},{get:(t,o)=>u(t,o)?t[o]:u(e,o)?Vt(o,e[o]):u(vn,o)?Vt(o,vn[o]):Vt(o,i(o,n[o]))})}(An,Pn,Mn);let Dn,Bn;class Ln{constructor(e=!1){this.detached=e,this._active=!0,this.effects=[],this.cleanups=[],this.parent=Dn,!e&&Dn&&(this.index=(Dn.scopes||(Dn.scopes=[])).push(this)-1)}get active(){return this._active}run(e){if(this._active){const t=Dn;try{return Dn=this,e()}finally{Dn=t}}}on(){Dn=this}off(){Dn=this.parent}stop(e){if(this._active){let t,n;for(t=0,n=this.effects.length;t<n;t++)this.effects[t].stop();for(t=0,n=this.cleanups.length;t<n;t++)this.cleanups[t]();if(this.scopes)for(t=0,n=this.scopes.length;t<n;t++)this.scopes[t].stop(!0);if(!this.detached&&this.parent&&!e){const e=this.parent.scopes.pop();e&&e!==this&&(this.parent.scopes[this.index]=e,e.index=this.index)}this.parent=void 0,this._active=!1}}}function jn(e){return new Ln(e)}function Un(){return Dn}class Fn{constructor(e,t,n,i){this.fn=e,this.trigger=t,this.scheduler=n,this.active=!0,this.deps=[],this._dirtyLevel=4,this._trackId=0,this._runnings=0,this._shouldSchedule=!1,this._depsLength=0,function(e,t=Dn){t&&t.active&&t.effects.push(e)}(this,i)}get dirty(){if(2===this._dirtyLevel||3===this._dirtyLevel){this._dirtyLevel=1,Kn();for(let e=0;e<this._depsLength;e++){const t=this.deps[e];if(t.computed&&(t.computed.value,this._dirtyLevel>=4))break}1===this._dirtyLevel&&(this._dirtyLevel=0),Wn()}return this._dirtyLevel>=4}set dirty(e){this._dirtyLevel=e?4:0}run(){if(this._dirtyLevel=0,!this.active)return this.fn();let e=Hn,t=Bn;try{return Hn=!0,Bn=this,this._runnings++,Gn(this),this.fn()}finally{qn(this),this._runnings--,Bn=t,Hn=e}}stop(){var e;this.active&&(Gn(this),qn(this),null==(e=this.onStop)||e.call(this),this.active=!1)}}function Gn(e){e._trackId++,e._depsLength=0}function qn(e){if(e.deps.length>e._depsLength){for(let t=e._depsLength;t<e.deps.length;t++)zn(e.deps[t],e);e.deps.length=e._depsLength}}function zn(e,t){const n=e.get(t);void 0!==n&&t._trackId!==n&&(e.delete(t),0===e.size&&e.cleanup())}let Hn=!0,$n=0;const Vn=[];function Kn(){Vn.push(Hn),Hn=!1}function Wn(){const e=Vn.pop();Hn=void 0===e||e}function Xn(){$n++}function Jn(){for($n--;!$n&&Yn.length;)Yn.shift()()}function Qn(e,t,n){if(t.get(e)!==e._trackId){t.set(e,e._trackId);const n=e.deps[e._depsLength];n!==t?(n&&zn(n,e),e.deps[e._depsLength++]=t):e._depsLength++}}const Yn=[];function Zn(e,t,n){Xn();for(const i of e.keys()){let n;i._dirtyLevel<t&&(null!=n?n:n=e.get(i)===i._trackId)&&(i._shouldSchedule||(i._shouldSchedule=0===i._dirtyLevel),i._dirtyLevel=t),i._shouldSchedule&&(null!=n?n:n=e.get(i)===i._trackId)&&(i.trigger(),i._runnings&&!i.allowRecurse||2===i._dirtyLevel||(i._shouldSchedule=!1,i.scheduler&&Yn.push(i.scheduler)))}Jn()}const ei=(e,t)=>{const n=new Map;return n.cleanup=e,n.computed=t,n},ti=new WeakMap,ni=Symbol(""),ii=Symbol("");function oi(e,t,n){if(Hn&&Bn){let t=ti.get(e);t||ti.set(e,t=new Map);let i=t.get(n);i||t.set(n,i=ei((()=>t.delete(n)))),Qn(Bn,i)}}function si(e,t,n,i,o,s){const r=ti.get(e);if(!r)return;let a=[];if("clear"===t)a=[...r.values()];else if("length"===n&&p(e)){const e=Number(i);r.forEach(((t,n)=>{("length"===n||!g(n)&&n>=e)&&a.push(t)}))}else switch(void 0!==n&&a.push(r.get(n)),t){case"add":p(e)?k(n)&&a.push(r.get("length")):(a.push(r.get(ni)),d(e)&&a.push(r.get(ii)));break;case"delete":p(e)||(a.push(r.get(ni)),d(e)&&a.push(r.get(ii)));break;case"set":d(e)&&a.push(r.get(ni))}Xn();for(const c of a)c&&Zn(c,4);Jn()}const ri=e("__proto__,__v_isRef,__isVue"),ai=new Set(Object.getOwnPropertyNames(Symbol).filter((e=>"arguments"!==e&&"caller"!==e)).map((e=>Symbol[e])).filter(g)),ci=li();function li(){const e={};return["includes","indexOf","lastIndexOf"].forEach((t=>{e[t]=function(...e){const n=Xi(this);for(let t=0,o=this.length;t<o;t++)oi(n,0,t+"");const i=n[t](...e);return-1===i||!1===i?n[t](...e.map(Xi)):i}})),["push","pop","shift","unshift","splice"].forEach((t=>{e[t]=function(...e){Kn(),Xn();const n=Xi(this)[t].apply(this,e);return Jn(),Wn(),n}})),e}function ui(e){const t=Xi(this);return oi(t,0,e),t.hasOwnProperty(e)}class pi{constructor(e=!1,t=!1){this._isReadonly=e,this._isShallow=t}get(e,t,n){const i=this._isReadonly,o=this._isShallow;if("__v_isReactive"===t)return!i;if("__v_isReadonly"===t)return i;if("__v_isShallow"===t)return o;if("__v_raw"===t)return n===(i?o?Gi:Fi:o?Ui:ji).get(e)||Object.getPrototypeOf(e)===Object.getPrototypeOf(n)?e:void 0;const s=p(e);if(!i){if(s&&u(ci,t))return Reflect.get(ci,t,n);if("hasOwnProperty"===t)return ui}const r=Reflect.get(e,t,n);return(g(t)?ai.has(t):ri(t))?r:(i||oi(e,0,t),o?r:no(r)?s&&k(t)?r:r.value:v(r)?i?Hi(r):zi(r):r)}}class di extends pi{constructor(e=!1){super(!1,e)}set(e,t,n,i){let o=e[t];if(!this._isShallow){const t=Ki(o);if(Wi(n)||Ki(n)||(o=Xi(o),n=Xi(n)),!p(e)&&no(o)&&!no(n))return!t&&(o.value=n,!0)}const s=p(e)&&k(t)?Number(t)<e.length:u(e,t),r=Reflect.set(e,t,n,i);return e===Xi(i)&&(s?R(n,o)&&si(e,"set",t,n):si(e,"add",t,n)),r}deleteProperty(e,t){const n=u(e,t);e[t];const i=Reflect.deleteProperty(e,t);return i&&n&&si(e,"delete",t,void 0),i}has(e,t){const n=Reflect.has(e,t);return g(t)&&ai.has(t)||oi(e,0,t),n}ownKeys(e){return oi(e,0,p(e)?"length":ni),Reflect.ownKeys(e)}}class hi extends pi{constructor(e=!1){super(!0,e)}set(e,t){return!0}deleteProperty(e,t){return!0}}const fi=new di,mi=new hi,gi=new di(!0),vi=e=>e,yi=e=>Reflect.getPrototypeOf(e);function bi(e,t,n=!1,i=!1){const o=Xi(e=e.__v_raw),s=Xi(t);n||(R(t,s)&&oi(o,0,t),oi(o,0,s));const{has:r}=yi(o),a=i?vi:n?Yi:Qi;return r.call(o,t)?a(e.get(t)):r.call(o,s)?a(e.get(s)):void(e!==o&&e.get(t))}function xi(e,t=!1){const n=this.__v_raw,i=Xi(n),o=Xi(e);return t||(R(e,o)&&oi(i,0,e),oi(i,0,o)),e===o?n.has(e):n.has(e)||n.has(o)}function Si(e,t=!1){return e=e.__v_raw,!t&&oi(Xi(e),0,ni),Reflect.get(e,"size",e)}function ki(e){e=Xi(e);const t=Xi(this);return yi(t).has.call(t,e)||(t.add(e),si(t,"add",e,e)),this}function Ci(e,t){t=Xi(t);const n=Xi(this),{has:i,get:o}=yi(n);let s=i.call(n,e);s||(e=Xi(e),s=i.call(n,e));const r=o.call(n,e);return n.set(e,t),s?R(t,r)&&si(n,"set",e,t):si(n,"add",e,t),this}function wi(e){const t=Xi(this),{has:n,get:i}=yi(t);let o=n.call(t,e);o||(e=Xi(e),o=n.call(t,e)),i&&i.call(t,e);const s=t.delete(e);return o&&si(t,"delete",e,void 0),s}function Ei(){const e=Xi(this),t=0!==e.size,n=e.clear();return t&&si(e,"clear",void 0,void 0),n}function Ti(e,t){return function(n,i){const o=this,s=o.__v_raw,r=Xi(s),a=t?vi:e?Yi:Qi;return!e&&oi(r,0,ni),s.forEach(((e,t)=>n.call(i,a(e),a(t),o)))}}function Ii(e,t,n){return function(...i){const o=this.__v_raw,s=Xi(o),r=d(s),a="entries"===e||e===Symbol.iterator&&r,c="keys"===e&&r,l=o[e](...i),u=n?vi:t?Yi:Qi;return!t&&oi(s,0,c?ii:ni),{next(){const{value:e,done:t}=l.next();return t?{value:e,done:t}:{value:a?[u(e[0]),u(e[1])]:u(e),done:t}},[Symbol.iterator](){return this}}}}function _i(e){return function(...t){return"delete"!==e&&("clear"===e?void 0:this)}}function Oi(){const e={get(e){return bi(this,e)},get size(){return Si(this)},has:xi,add:ki,set:Ci,delete:wi,clear:Ei,forEach:Ti(!1,!1)},t={get(e){return bi(this,e,!1,!0)},get size(){return Si(this)},has:xi,add:ki,set:Ci,delete:wi,clear:Ei,forEach:Ti(!1,!0)},n={get(e){return bi(this,e,!0)},get size(){return Si(this,!0)},has(e){return xi.call(this,e,!0)},add:_i("add"),set:_i("set"),delete:_i("delete"),clear:_i("clear"),forEach:Ti(!0,!1)},i={get(e){return bi(this,e,!0,!0)},get size(){return Si(this,!0)},has(e){return xi.call(this,e,!0)},add:_i("add"),set:_i("set"),delete:_i("delete"),clear:_i("clear"),forEach:Ti(!0,!0)};return["keys","values","entries",Symbol.iterator].forEach((o=>{e[o]=Ii(o,!1,!1),n[o]=Ii(o,!0,!1),t[o]=Ii(o,!1,!0),i[o]=Ii(o,!0,!0)})),[e,n,t,i]}const[Ai,Ri,Pi,Mi]=Oi();function Ni(e,t){const n=t?e?Mi:Pi:e?Ri:Ai;return(t,i,o)=>"__v_isReactive"===i?!e:"__v_isReadonly"===i?e:"__v_raw"===i?t:Reflect.get(u(n,i)&&i in t?n:t,i,o)}const Di={get:Ni(!1,!1)},Bi={get:Ni(!1,!0)},Li={get:Ni(!0,!1)},ji=new WeakMap,Ui=new WeakMap,Fi=new WeakMap,Gi=new WeakMap;function qi(e){return e.__v_skip||!Object.isExtensible(e)?0:function(e){switch(e){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}((e=>x(e).slice(8,-1))(e))}function zi(e){return Ki(e)?e:$i(e,!1,fi,Di,ji)}function Hi(e){return $i(e,!0,mi,Li,Fi)}function $i(e,t,n,i,o){if(!v(e))return e;if(e.__v_raw&&(!t||!e.__v_isReactive))return e;const s=o.get(e);if(s)return s;const r=qi(e);if(0===r)return e;const a=new Proxy(e,2===r?i:n);return o.set(e,a),a}function Vi(e){return Ki(e)?Vi(e.__v_raw):!(!e||!e.__v_isReactive)}function Ki(e){return!(!e||!e.__v_isReadonly)}function Wi(e){return!(!e||!e.__v_isShallow)}function Xi(e){const t=e&&e.__v_raw;return t?Xi(t):e}function Ji(e){return Object.isExtensible(e)&&((e,t,n)=>{Object.defineProperty(e,t,{configurable:!0,enumerable:!1,value:n})})(e,"__v_skip",!0),e}const Qi=e=>v(e)?zi(e):e,Yi=e=>v(e)?Hi(e):e;class Zi{constructor(e,t,n,i){this.getter=e,this._setter=t,this.dep=void 0,this.__v_isRef=!0,this.__v_isReadonly=!1,this.effect=new Fn((()=>e(this._value)),(()=>to(this,2===this.effect._dirtyLevel?2:3))),this.effect.computed=this,this.effect.active=this._cacheable=!i,this.__v_isReadonly=n}get value(){const e=Xi(this);return e._cacheable&&!e.effect.dirty||!R(e._value,e._value=e.effect.run())||to(e,4),eo(e),e.effect._dirtyLevel>=2&&to(e,2),e._value}set value(e){this._setter(e)}get _dirty(){return this.effect.dirty}set _dirty(e){this.effect.dirty=e}}function eo(e){var t;Hn&&Bn&&(e=Xi(e),Qn(Bn,null!=(t=e.dep)?t:e.dep=ei((()=>e.dep=void 0),e instanceof Zi?e:void 0)))}function to(e,t=4,n){const i=(e=Xi(e)).dep;i&&Zn(i,t)}function no(e){return!(!e||!0!==e.__v_isRef)}function io(e){return function(e,t){if(no(e))return e;return new oo(e,t)}(e,!1)}class oo{constructor(e,t){this.__v_isShallow=t,this.dep=void 0,this.__v_isRef=!0,this._rawValue=t?e:Xi(e),this._value=t?e:Qi(e)}get value(){return eo(this),this._value}set value(e){const t=this.__v_isShallow||Wi(e)||Ki(e);e=t?e:Xi(e),R(e,this._rawValue)&&(this._rawValue=e,this._value=t?e:Qi(e),to(this,4))}}function so(e){return no(e)?e.value:e}const ro={get:(e,t,n)=>so(Reflect.get(e,t,n)),set:(e,t,n,i)=>{const o=e[t];return no(o)&&!no(n)?(o.value=n,!0):Reflect.set(e,t,n,i)}};function ao(e){return Vi(e)?e:new Proxy(e,ro)}class co{constructor(e,t,n){this._object=e,this._key=t,this._defaultValue=n,this.__v_isRef=!0}get value(){const e=this._object[this._key];return void 0===e?this._defaultValue:e}set value(e){this._object[this._key]=e}get dep(){return e=Xi(this._object),t=this._key,null==(n=ti.get(e))?void 0:n.get(t);var e,t,n}}function lo(e,t,n){const i=e[t];return no(i)?i:new co(e,t,n)}function uo(e,t,n,i){try{return i?e(...i):e()}catch(o){ho(o,t,n)}}function po(e,t,n,i){if(f(e)){const o=uo(e,t,n,i);return o&&y(o)&&o.catch((e=>{ho(e,t,n)})),o}const o=[];for(let s=0;s<e.length;s++)o.push(po(e[s],t,n,i));return o}function ho(e,t,n,i=!0){const o=t?t.vnode:null;if(t){let i=t.parent;const o=t.proxy,s=`https://vuejs.org/error-reference/#runtime-${n}`;for(;i;){const t=i.ec;if(t)for(let n=0;n<t.length;n++)if(!1===t[n](e,o,s))return;i=i.parent}const r=t.appContext.config.errorHandler;if(r)return void uo(r,null,10,[e,o,s])}fo(e,n,o,i)}function fo(e,t,n,i=!0){console.error(e)}let mo=!1,go=!1;const vo=[];let yo=0;const bo=[];let xo=null,So=0;const ko=Promise.resolve();let Co=null;function wo(e){const t=Co||ko;return e?t.then(this?e.bind(this):e):t}function Eo(e){vo.length&&vo.includes(e,mo&&e.allowRecurse?yo+1:yo)||(null==e.id?vo.push(e):vo.splice(function(e){let t=yo+1,n=vo.length;for(;t<n;){const i=t+n>>>1,o=vo[i],s=Oo(o);s<e||s===e&&o.pre?t=i+1:n=i}return t}(e.id),0,e),To())}function To(){mo||go||(go=!0,Co=ko.then(Ro))}function Io(e){p(e)?bo.push(...e):xo&&xo.includes(e,e.allowRecurse?So+1:So)||bo.push(e),To()}function _o(e,t,n=(mo?yo+1:0)){for(;n<vo.length;n++){const e=vo[n];e&&e.pre&&(vo.splice(n,1),n--,e())}}const Oo=e=>null==e.id?1/0:e.id,Ao=(e,t)=>{const n=Oo(e)-Oo(t);if(0===n){if(e.pre&&!t.pre)return-1;if(t.pre&&!e.pre)return 1}return n};function Ro(e){go=!1,mo=!0,vo.sort(Ao);try{for(yo=0;yo<vo.length;yo++){const e=vo[yo];e&&!1!==e.active&&uo(e,null,14)}}finally{yo=0,vo.length=0,function(){if(bo.length){const e=[...new Set(bo)].sort(((e,t)=>Oo(e)-Oo(t)));if(bo.length=0,xo)return void xo.push(...e);for(xo=e,So=0;So<xo.length;So++)xo[So]();xo=null,So=0}}(),mo=!1,Co=null,(vo.length||bo.length)&&Ro()}}function Po(e,n,...i){if(e.isUnmounted)return;const o=e.vnode.props||t;let s=i;const r=n.startsWith("update:"),a=r&&n.slice(7);if(a&&a in o){const e=`${"modelValue"===a?"model":a}Modifiers`,{number:n,trim:r}=o[e]||t;r&&(s=i.map((e=>m(e)?e.trim():e))),n&&(s=i.map(M))}let c,l=o[c=A(n)]||o[c=A(T(n))];!l&&r&&(l=o[c=A(_(n))]),l&&po(l,e,6,s);const u=o[c+"Once"];if(u){if(e.emitted){if(e.emitted[c])return}else e.emitted={};e.emitted[c]=!0,po(u,e,6,s)}}function Mo(e,t,n=!1){const i=t.emitsCache,o=i.get(e);if(void 0!==o)return o;const s=e.emits;let r={},c=!1;if(!f(e)){const i=e=>{const n=Mo(e,t,!0);n&&(c=!0,a(r,n))};!n&&t.mixins.length&&t.mixins.forEach(i),e.extends&&i(e.extends),e.mixins&&e.mixins.forEach(i)}return s||c?(p(s)?s.forEach((e=>r[e]=null)):a(r,s),v(e)&&i.set(e,r),r):(v(e)&&i.set(e,null),null)}function No(e,t){return!(!e||!s(t))&&(t=t.slice(2).replace(/Once$/,""),u(e,t[0].toLowerCase()+t.slice(1))||u(e,_(t))||u(e,t))}let Do=null;function Bo(e){const t=Do;return Do=e,e&&e.type.__scopeId,t}const Lo="components";function jo(e,t){return e&&(e[t]||e[T(t)]||e[O(T(t))])}const Uo={};function Fo(e,t,n){return Go(e,t,n)}function Go(e,n,{immediate:o,deep:s,flush:r,once:a,onTrack:l,onTrigger:u}=t){if(n&&a){const e=n;n=(...t)=>{e(...t),E()}}const d=Gs,h=e=>!0===s?e:Ho(e,!1===s?1:void 0);let m,g,v=!1,y=!1;if(no(e)?(m=()=>e.value,v=Wi(e)):Vi(e)?(m=()=>h(e),v=!0):p(e)?(y=!0,v=e.some((e=>Vi(e)||Wi(e))),m=()=>e.map((e=>no(e)?e.value:Vi(e)?h(e):f(e)?uo(e,d,2):void 0))):m=f(e)?n?()=>uo(e,d,2):()=>(g&&g(),po(e,d,3,[b])):i,n&&s){const e=m;m=()=>Ho(e())}let b=e=>{g=C.onStop=()=>{uo(e,d,4),g=C.onStop=void 0}},x=y?new Array(e.length).fill(Uo):Uo;const S=()=>{if(C.active&&C.dirty)if(n){const e=C.run();(s||v||(y?e.some(((e,t)=>R(e,x[t]))):R(e,x)))&&(g&&g(),po(n,d,3,[e,x===Uo?void 0:y&&x[0]===Uo?[]:x,b]),x=e)}else C.run()};let k;S.allowRecurse=!!n,"sync"===r?k=S:"post"===r?k=()=>Bs(S,d&&d.suspense):(S.pre=!0,d&&(S.id=d.uid),k=()=>Eo(S));const C=new Fn(m,i,k),w=Un(),E=()=>{C.stop(),w&&c(w.effects,C)};return n?o?S():x=C.run():"post"===r?Bs(C.run.bind(C),d&&d.suspense):C.run(),E}function qo(e,t,n){const i=this.proxy,o=m(e)?e.includes(".")?zo(i,e):()=>i[e]:e.bind(i,i);let s;f(t)?s=t:(s=t.handler,n=t);const r=$s(this),a=Go(o,s.bind(i),n);return r(),a}function zo(e,t){const n=t.split(".");return()=>{let t=e;for(let e=0;e<n.length&&t;e++)t=t[n[e]];return t}}function Ho(e,t,n=0,i){if(!v(e)||e.__v_skip)return e;if(t&&t>0){if(n>=t)return e;n++}if((i=i||new Set).has(e))return e;if(i.add(e),no(e))Ho(e.value,t,n,i);else if(p(e))for(let o=0;o<e.length;o++)Ho(e[o],t,n,i);else if(h(e)||d(e))e.forEach((e=>{Ho(e,t,n,i)}));else if(S(e))for(const o in e)Ho(e[o],t,n,i);return e}function $o(){return{app:null,config:{isNativeTag:o,performance:!1,globalProperties:{},optionMergeStrategies:{},errorHandler:void 0,warnHandler:void 0,compilerOptions:{}},mixins:[],components:{},directives:{},provides:Object.create(null),optionsCache:new WeakMap,propsCache:new WeakMap,emitsCache:new WeakMap}}let Vo=0;let Ko=null;function Wo(e,t,n=!1){const i=Gs||Do;if(i||Ko){const o=i?null==i.parent?i.vnode.appContext&&i.vnode.appContext.provides:i.parent.provides:Ko._context.provides;if(o&&e in o)return o[e];if(arguments.length>1)return n&&f(t)?t.call(i&&i.proxy):t}}function Xo(e,t){Qo(e,"a",t)}function Jo(e,t){Qo(e,"da",t)}function Qo(e,t,n=Gs){const i=e.__wdc||(e.__wdc=()=>{let t=n;for(;t;){if(t.isDeactivated)return;t=t.parent}return e()});if(Zo(t,i,n),n){let e=n.parent;for(;e&&e.parent;)e.parent.vnode.type.__isKeepAlive&&Yo(i,t,n,e),e=e.parent}}function Yo(e,t,n,i){const o=Zo(t,e,i,!0);rs((()=>{c(i[t],o)}),n)}function Zo(e,t,n=Gs,i=!1){if(n){(function(e){return ke.indexOf(e)>-1})(e)&&(n=n.root);const o=n[e]||(n[e]=[]),s=t.__weh||(t.__weh=(...i)=>{if(n.isUnmounted)return;Kn();const o=$s(n),s=po(t,n,e,i);return o(),Wn(),s});return i?o.unshift(s):o.push(s),s}}const es=e=>(t,n=Gs)=>(!Ws||"sp"===e)&&Zo(e,((...e)=>t(...e)),n),ts=es("bm"),ns=es("m"),is=es("bu"),os=es("u"),ss=es("bum"),rs=es("um"),as=es("sp"),cs=es("rtg"),ls=es("rtc");function us(e,t=Gs){Zo("ec",e,t)}const ps=e=>e?Ks(e)?Qs(e)||e.proxy:ps(e.parent):null;const ds=a(Object.create(null),{$:function(e){return e},$el:e=>e.__$el||(e.__$el={}),$data:e=>e.data,$props:e=>e.props,$attrs:e=>e.attrs,$slots:e=>e.slots,$refs:e=>e.refs,$parent:e=>ps(e.parent),$root:e=>ps(e.root),$emit:e=>e.emit,$options:e=>xs(e),$forceUpdate:e=>e.f||(e.f=()=>{e.effect.dirty=!0,Eo(e.update)}),$watch:e=>qo.bind(e)}),hs=(e,n)=>e!==t&&!e.__isScriptSetup&&u(e,n),fs={get({_:e},n){const{ctx:i,setupState:o,data:s,props:r,accessCache:a,type:c,appContext:l}=e;let p;if("$"!==n[0]){const c=a[n];if(void 0!==c)switch(c){case 1:return o[n];case 2:return s[n];case 4:return i[n];case 3:return r[n]}else{if(hs(o,n))return a[n]=1,o[n];if(s!==t&&u(s,n))return a[n]=2,s[n];if((p=e.propsOptions[0])&&u(p,n))return a[n]=3,r[n];if(i!==t&&u(i,n))return a[n]=4,i[n];gs&&(a[n]=0)}}const d=ds[n];let h,f;return d?("$attrs"===n&&oi(e,0,n),d(e)):(h=c.__cssModules)&&(h=h[n])?h:i!==t&&u(i,n)?(a[n]=4,i[n]):(f=l.config.globalProperties,u(f,n)?f[n]:void 0)},set({_:e},n,i){const{data:o,setupState:s,ctx:r}=e;return hs(s,n)?(s[n]=i,!0):o!==t&&u(o,n)?(o[n]=i,!0):!u(e.props,n)&&(("$"!==n[0]||!(n.slice(1)in e))&&(r[n]=i,!0))},has({_:{data:e,setupState:n,accessCache:i,ctx:o,appContext:s,propsOptions:r}},a){let c;return!!i[a]||e!==t&&u(e,a)||hs(n,a)||(c=r[0])&&u(c,a)||u(o,a)||u(ds,a)||u(s.config.globalProperties,a)},defineProperty(e,t,n){return null!=n.get?e._.accessCache[t]=0:u(n,"value")&&this.set(e,t,n.value,null),Reflect.defineProperty(e,t,n)}};function ms(e){return p(e)?e.reduce(((e,t)=>(e[t]=null,e)),{}):e}let gs=!0;function vs(e){const t=xs(e),n=e.proxy,o=e.ctx;gs=!1,t.beforeCreate&&ys(t.beforeCreate,e,"bc");const{data:s,computed:r,methods:a,watch:c,provide:l,inject:u,created:d,beforeMount:h,mounted:m,beforeUpdate:g,updated:y,activated:b,deactivated:x,beforeDestroy:S,beforeUnmount:k,destroyed:C,unmounted:w,render:E,renderTracked:T,renderTriggered:I,errorCaptured:_,serverPrefetch:O,expose:A,inheritAttrs:R,components:P,directives:M,filters:N}=t;if(u&&function(e,t){p(e)&&(e=ws(e));for(const n in e){const i=e[n];let o;o=v(i)?"default"in i?Wo(i.from||n,i.default,!0):Wo(i.from||n):Wo(i),no(o)?Object.defineProperty(t,n,{enumerable:!0,configurable:!0,get:()=>o.value,set:e=>o.value=e}):t[n]=o}}(u,o),a)for(const i in a){const e=a[i];f(e)&&(o[i]=e.bind(n))}if(s){const t=s.call(n,n);v(t)&&(e.data=zi(t))}if(gs=!0,r)for(const p in r){const e=r[p],t=f(e)?e.bind(n,n):f(e.get)?e.get.bind(n,n):i,s=!f(e)&&f(e.set)?e.set.bind(n):i,a=Ys({get:t,set:s});Object.defineProperty(o,p,{enumerable:!0,configurable:!0,get:()=>a.value,set:e=>a.value=e})}if(c)for(const i in c)bs(c[i],o,n,i);function D(e,t){p(t)?t.forEach((t=>e(t.bind(n)))):t&&e(t.bind(n))}if(function(){if(l){const e=f(l)?l.call(n):l;Reflect.ownKeys(e).forEach((t=>{!function(e,t){if(Gs){let n=Gs.provides;const i=Gs.parent&&Gs.parent.provides;i===n&&(n=Gs.provides=Object.create(i)),n[e]=t,"app"===Gs.type.mpType&&Gs.appContext.app.provide(e,t)}}(t,e[t])}))}}(),d&&ys(d,e,"c"),D(ts,h),D(ns,m),D(is,g),D(os,y),D(Xo,b),D(Jo,x),D(us,_),D(ls,T),D(cs,I),D(ss,k),D(rs,w),D(as,O),p(A))if(A.length){const t=e.exposed||(e.exposed={});A.forEach((e=>{Object.defineProperty(t,e,{get:()=>n[e],set:t=>n[e]=t})}))}else e.exposed||(e.exposed={});E&&e.render===i&&(e.render=E),null!=R&&(e.inheritAttrs=R),P&&(e.components=P),M&&(e.directives=M),e.ctx.$onApplyOptions&&e.ctx.$onApplyOptions(t,e,n)}function ys(e,t,n){po(p(e)?e.map((e=>e.bind(t.proxy))):e.bind(t.proxy),t,n)}function bs(e,t,n,i){const o=i.includes(".")?zo(n,i):()=>n[i];if(m(e)){const n=t[e];f(n)&&Fo(o,n)}else if(f(e))Fo(o,e.bind(n));else if(v(e))if(p(e))e.forEach((e=>bs(e,t,n,i)));else{const i=f(e.handler)?e.handler.bind(n):t[e.handler];f(i)&&Fo(o,i,e)}}function xs(e){const t=e.type,{mixins:n,extends:i}=t,{mixins:o,optionsCache:s,config:{optionMergeStrategies:r}}=e.appContext,a=s.get(t);let c;return a?c=a:o.length||n||i?(c={},o.length&&o.forEach((e=>Ss(c,e,r,!0))),Ss(c,t,r)):c=t,v(t)&&s.set(t,c),c}function Ss(e,t,n,i=!1){const{mixins:o,extends:s}=t;s&&Ss(e,s,n,!0),o&&o.forEach((t=>Ss(e,t,n,!0)));for(const r in t)if(i&&"expose"===r);else{const i=ks[r]||n&&n[r];e[r]=i?i(e[r],t[r]):t[r]}return e}const ks={data:Cs,props:Is,emits:Is,methods:Ts,computed:Ts,beforeCreate:Es,created:Es,beforeMount:Es,mounted:Es,beforeUpdate:Es,updated:Es,beforeDestroy:Es,beforeUnmount:Es,destroyed:Es,unmounted:Es,activated:Es,deactivated:Es,errorCaptured:Es,serverPrefetch:Es,components:Ts,directives:Ts,watch:function(e,t){if(!e)return t;if(!t)return e;const n=a(Object.create(null),e);for(const i in t)n[i]=Es(e[i],t[i]);return n},provide:Cs,inject:function(e,t){return Ts(ws(e),ws(t))}};function Cs(e,t){return t?e?function(){return a(f(e)?e.call(this,this):e,f(t)?t.call(this,this):t)}:t:e}function ws(e){if(p(e)){const t={};for(let n=0;n<e.length;n++)t[e[n]]=e[n];return t}return e}function Es(e,t){return e?[...new Set([].concat(e,t))]:t}function Ts(e,t){return e?a(Object.create(null),e,t):t}function Is(e,t){return e?p(e)&&p(t)?[...new Set([...e,...t])]:a(Object.create(null),ms(e),ms(null!=t?t:{})):t}function _s(e,t,n,i=!1){const o={},s={};e.propsDefaults=Object.create(null),Os(e,t,o,s);for(const r in e.propsOptions[0])r in o||(o[r]=void 0);n?e.props=i?o:$i(o,!1,gi,Bi,Ui):e.type.props?e.props=o:e.props=s,e.attrs=s}function Os(e,n,i,o){const[s,r]=e.propsOptions;let a,c=!1;if(n)for(let t in n){if(C(t))continue;const l=n[t];let p;s&&u(s,p=T(t))?r&&r.includes(p)?(a||(a={}))[p]=l:i[p]=l:No(e.emitsOptions,t)||t in o&&l===o[t]||(o[t]=l,c=!0)}if(r){const n=Xi(i),o=a||t;for(let t=0;t<r.length;t++){const a=r[t];i[a]=As(s,n,a,o[a],e,!u(o,a))}}return c}function As(e,t,n,i,o,s){const r=e[n];if(null!=r){const e=u(r,"default");if(e&&void 0===i){const e=r.default;if(r.type!==Function&&!r.skipFactory&&f(e)){const{propsDefaults:s}=o;if(n in s)i=s[n];else{const r=$s(o);i=s[n]=e.call(null,t),r()}}else i=e}r[0]&&(s&&!e?i=!1:!r[1]||""!==i&&i!==_(n)||(i=!0))}return i}function Rs(e,i,o=!1){const s=i.propsCache,r=s.get(e);if(r)return r;const c=e.props,l={},d=[];let h=!1;if(!f(e)){const t=e=>{h=!0;const[t,n]=Rs(e,i,!0);a(l,t),n&&d.push(...n)};!o&&i.mixins.length&&i.mixins.forEach(t),e.extends&&t(e.extends),e.mixins&&e.mixins.forEach(t)}if(!c&&!h)return v(e)&&s.set(e,n),n;if(p(c))for(let n=0;n<c.length;n++){const e=T(c[n]);Ps(e)&&(l[e]=t)}else if(c)for(const t in c){const e=T(t);if(Ps(e)){const n=c[t],i=l[e]=p(n)||f(n)?{type:n}:a({},n);if(i){const t=Ds(Boolean,i.type),n=Ds(String,i.type);i[0]=t>-1,i[1]=n<0||t<n,(t>-1||u(i,"default"))&&d.push(e)}}}const m=[l,d];return v(e)&&s.set(e,m),m}function Ps(e){return"$"!==e[0]&&!C(e)}function Ms(e){if(null===e)return"null";if("function"==typeof e)return e.name||"";if("object"==typeof e){return e.constructor&&e.constructor.name||""}return""}function Ns(e,t){return Ms(e)===Ms(t)}function Ds(e,t){return p(t)?t.findIndex((t=>Ns(t,e))):f(t)&&Ns(t,e)?0:-1}const Bs=Io;function Ls(e){return e?Vi(t=e)||Ki(t)||"__vInternal"in e?a({},e):e:null;var t}const js=$o();let Us=0;function Fs(e,n,i){const o=e.type,s=(n?n.appContext:e.appContext)||js,r={uid:Us++,vnode:e,type:o,parent:n,appContext:s,root:null,next:null,subTree:null,effect:null,update:null,scope:new Ln(!0),render:null,proxy:null,exposed:null,exposeProxy:null,withProxy:null,provides:n?n.provides:Object.create(s.provides),accessCache:null,renderCache:[],components:null,directives:null,propsOptions:Rs(o,s),emitsOptions:Mo(o,s),emit:null,emitted:null,propsDefaults:t,inheritAttrs:o.inheritAttrs,ctx:t,data:t,props:t,attrs:t,slots:t,refs:t,setupState:t,setupContext:null,attrsProxy:null,slotsProxy:null,suspense:i,suspenseId:i?i.pendingId:0,asyncDep:null,asyncResolved:!1,isMounted:!1,isUnmounted:!1,isDeactivated:!1,bc:null,c:null,bm:null,m:null,bu:null,u:null,um:null,bum:null,da:null,a:null,rtg:null,rtc:null,ec:null,sp:null,$uniElements:new Map,$templateUniElementRefs:[],$templateUniElementStyles:{},$eS:{},$eA:{}};return r.ctx={_:r},r.root=n?n.root:r,r.emit=Po.bind(null,r),e.ce&&e.ce(r),r}let Gs=null;const qs=()=>Gs||Do;let zs,Hs;zs=e=>{Gs=e},Hs=e=>{Ws=e};const $s=e=>{const t=Gs;return zs(e),e.scope.on(),()=>{e.scope.off(),zs(t)}},Vs=()=>{Gs&&Gs.scope.off(),zs(null)};function Ks(e){return 4&e.vnode.shapeFlag}let Ws=!1;function Xs(e,t=!1){t&&Hs(t);const{props:n}=e.vnode,i=Ks(e);_s(e,n,i,t);const o=i?function(e){const t=e.type;e.accessCache=Object.create(null),e.proxy=Ji(new Proxy(e.ctx,fs));const{setup:n}=t;if(n){const t=e.setupContext=n.length>1?function(e){const t=t=>{e.exposed=t||{}};return{get attrs(){return function(e){return e.attrsProxy||(e.attrsProxy=new Proxy(e.attrs,{get:(t,n)=>(oi(e,0,"$attrs"),t[n])}))}(e)},slots:e.slots,emit:e.emit,expose:t}}(e):null,i=$s(e);Kn();const o=uo(n,e,0,[e.props,t]);Wn(),i(),y(o)?o.then(Vs,Vs):function(e,t){f(t)?e.render=t:v(t)&&(e.setupState=ao(t));Js(e)}(e,o)}else Js(e)}(e):void 0;return t&&Hs(!1),o}function Js(e,t,n){const o=e.type;e.render||(e.render=o.render||i);{const t=$s(e);Kn();try{vs(e)}finally{Wn(),t()}}}function Qs(e){if(e.exposed)return e.exposeProxy||(e.exposeProxy=new Proxy(ao(Ji(e.exposed)),{get:(t,n)=>n in t?t[n]:e.proxy[n],has:(e,t)=>t in e||t in ds}))}const Ys=(e,t)=>{const n=function(e,t,n=!1){let o,s;const r=f(e);return r?(o=e,s=i):(o=e.get,s=e.set),new Zi(o,s,r||!s,n)}(e,0,Ws);return n},Zs="3.4.21";function er(e){return so(e)}const tr="[object Array]",nr="[object Object]";function ir(e,t){const n={};return or(e,t),sr(e,t,"",n),n}function or(e,t){if((e=er(e))===t)return;const n=x(e),i=x(t);if(n==nr&&i==nr)for(let o in t){const n=e[o];void 0===n?e[o]=null:or(n,t[o])}else n==tr&&i==tr&&e.length>=t.length&&t.forEach(((t,n)=>{or(e[n],t)}))}function sr(e,t,n,i){if((e=er(e))===t)return;const o=x(e),s=x(t);if(o==nr)if(s!=nr||Object.keys(e).length<Object.keys(t).length)rr(i,n,e);else for(let r in e){const o=er(e[r]),s=t[r],a=x(o),c=x(s);if(a!=tr&&a!=nr)o!=s&&rr(i,(""==n?"":n+".")+r,o);else if(a==tr)c!=tr||o.length<s.length?rr(i,(""==n?"":n+".")+r,o):o.forEach(((e,t)=>{sr(e,s[t],(""==n?"":n+".")+r+"["+t+"]",i)}));else if(a==nr)if(c!=nr||Object.keys(o).length<Object.keys(s).length)rr(i,(""==n?"":n+".")+r,o);else for(let e in o)sr(o[e],s[e],(""==n?"":n+".")+r+"."+e,i)}else o==tr?s!=tr||e.length<t.length?rr(i,n,e):e.forEach(((e,o)=>{sr(e,t[o],n+"["+o+"]",i)})):rr(i,n,e)}function rr(e,t,n){e[t]=n}function ar(e){const t=e.ctx.__next_tick_callbacks;if(t&&t.length){const e=t.slice(0);t.length=0;for(let t=0;t<e.length;t++)e[t]()}}function cr(e,t){const n=e.ctx;if(!n.__next_tick_pending&&!function(e){return vo.includes(e.update)}(e))return wo(t&&t.bind(e.proxy));let i;return n.__next_tick_callbacks||(n.__next_tick_callbacks=[]),n.__next_tick_callbacks.push((()=>{t?uo(t.bind(e.proxy),e,14):i&&i(e.proxy)})),new Promise((e=>{i=e}))}function lr(e,t){const n=typeof(e=er(e));if("object"===n&&null!==e){let n=t.get(e);if(void 0!==n)return n;if(p(e)){const i=e.length;n=new Array(i),t.set(e,n);for(let o=0;o<i;o++)n[o]=lr(e[o],t)}else{n={},t.set(e,n);for(const i in e)u(e,i)&&(n[i]=lr(e[i],t))}return n}if("symbol"!==n)return e}function ur(e){return lr(e,"undefined"!=typeof WeakMap?new WeakMap:new Map)}function pr(e,t,n){if(!t)return;(t=ur(t)).$eS=e.$eS||{},t.$eA=e.$eA||{};const i=e.ctx,o=i.mpType;if("page"===o||"component"===o){t.r0=1;const o=i.$scope,s=Object.keys(t),r=ir(t,n||function(e,t){const n=e.data,i=Object.create(null);return t.forEach((e=>{i[e]=n[e]})),i}(o,s));Object.keys(r).length?(i.__next_tick_pending=!0,o.setData(r,(()=>{i.__next_tick_pending=!1,ar(e)})),_o()):ar(e)}}function dr(e,t,n){t.appContext.config.globalProperties.$applyOptions(e,t,n);const i=e.computed;if(i){const e=Object.keys(i);if(e.length){const n=t.ctx;n.$computedKeys||(n.$computedKeys=[]),n.$computedKeys.push(...e)}}delete t.ctx.$onApplyOptions}function hr(e,t=!1){const{setupState:n,$templateRefs:i,$templateUniElementRefs:o,ctx:{$scope:s,$mpPlatform:r}}=e;if("mp-alipay"===r)return;if(!s||!i&&!o)return;if(t)return i&&i.forEach((e=>fr(e,null,n))),void(o&&o.forEach((e=>fr(e,null,n))));const a="mp-baidu"===r||"mp-toutiao"===r,c=e=>{if(0===e.length)return[];const t=(s.selectAllComponents(".r")||[]).concat(s.selectAllComponents(".r-i-f")||[]);return e.filter((e=>{const i=function(e,t){const n=e.find((e=>e&&(e.properties||e.props).uI===t));if(n){const e=n.$vm;return e?Qs(e.$)||e:function(e){v(e)&&Ji(e);return e}(n)}return null}(t,e.i);return!(!a||null!==i)||(fr(e,i,n),!1)}))},l=()=>{if(i){const t=c(i);t.length&&e.proxy&&e.proxy.$scope&&e.proxy.$scope.setData({r1:1},(()=>{c(t)}))}};o&&o.length&&cr(e,(()=>{o.forEach((e=>{p(e.v)?e.v.forEach((t=>{fr(e,t,n)})):fr(e,e.v,n)}))})),s._$setRef?s._$setRef(l):cr(e,l)}function fr({r:e,f:t},n,i){if(f(e))e(n,{});else{const o=m(e),s=no(e);if(o||s)if(t){if(!s)return;p(e.value)||(e.value=[]);const t=e.value;if(-1===t.indexOf(n)){if(t.push(n),!n)return;n.$&&ss((()=>c(t,n)),n.$)}}else o?u(i,e)&&(i[e]=n):no(e)&&(e.value=n)}}const mr=Io;function gr(e,t){const n=e.component=Fs(e,t.parentComponent,null);return n.renderer=t.mpType?t.mpType:"component",n.ctx.$onApplyOptions=dr,n.ctx.$children=[],"app"===t.mpType&&(n.render=i),t.onBeforeSetup&&t.onBeforeSetup(n,t),Xs(n),t.parentComponent&&n.proxy&&t.parentComponent.ctx.$children.push(Qs(n)||n.proxy),function(e){const t=Sr.bind(e);e.$updateScopedSlots=()=>wo((()=>Eo(t)));const n=()=>{if(e.isMounted){const{next:t,bu:n,u:i}=e;kr(e,!1),xr(),n&&P(n),kr(e,!0),pr(e,yr(e)),i&&mr(i)}else ss((()=>{hr(e,!0)}),e),pr(e,yr(e))},o=e.effect=new Fn(n,i,(()=>Eo(s)),e.scope),s=e.update=()=>{o.dirty&&o.run()};s.id=e.uid,kr(e,!0),s()}(n),n.proxy}const vr=e=>{let t;for(const n in e)("class"===n||"style"===n||s(n))&&((t||(t={}))[n]=e[n]);return t};function yr(e){const{type:t,vnode:n,proxy:i,withProxy:o,props:s,propsOptions:[r],slots:a,attrs:c,emit:l,render:u,renderCache:p,data:d,setupState:h,ctx:f,uid:m,appContext:{app:{config:{globalProperties:{pruneComponentPropsCache:g}}}},inheritAttrs:v}=e;let y;e.$uniElementIds=new Map,e.$templateRefs=[],e.$templateUniElementRefs=[],e.$templateUniElementStyles={},e.$ei=0,g(m),e.__counter=0===e.__counter?1:0;const b=Bo(e);try{if(4&n.shapeFlag){br(v,s,r,c);const e=o||i;y=u.call(e,e,p,s,h,d,f)}else{br(v,s,r,t.props?c:vr(c));const e=t;y=e.length>1?e(s,{attrs:c,slots:a,emit:l}):e(s,null)}}catch(x){ho(x,e,1),y=!1}return hr(e),Bo(b),y}function br(e,t,n,i){if(t&&i&&!1!==e){const e=Object.keys(i).filter((e=>"class"!==e&&"style"!==e));if(!e.length)return;n&&e.some(r)?e.forEach((e=>{r(e)&&e.slice(9)in n||(t[e]=i[e])})):e.forEach((e=>t[e]=i[e]))}}const xr=e=>{Kn(),_o(),Wn()};function Sr(){const e=this.$scopedSlotsData;if(!e||0===e.length)return;const t=this.ctx.$scope,n=t.data,i=Object.create(null);e.forEach((({path:e,index:t,data:o})=>{const s=ve(n,e),r=m(t)?`${e}.${t}`:`${e}[${t}]`;if(void 0===s||void 0===s[t])i[r]=o;else{const e=ir(o,s[t]);Object.keys(e).forEach((t=>{i[r+"."+t]=e[t]}))}})),e.length=0,Object.keys(i).length&&t.setData(i)}function kr({effect:e,update:t},n){e.allowRecurse=t.allowRecurse=n}const Cr=function(e,t=null){f(e)||(e=a({},e)),null==t||v(t)||(t=null);const n=$o(),i=new WeakSet,o=n.app={_uid:Vo++,_component:e,_props:t,_container:null,_context:n,_instance:null,version:Zs,get config(){return n.config},set config(e){},use:(e,...t)=>(i.has(e)||(e&&f(e.install)?(i.add(e),e.install(o,...t)):f(e)&&(i.add(e),e(o,...t))),o),mixin:e=>(n.mixins.includes(e)||n.mixins.push(e),o),component:(e,t)=>t?(n.components[e]=t,o):n.components[e],directive:(e,t)=>t?(n.directives[e]=t,o):n.directives[e],mount(){},unmount(){},provide:(e,t)=>(n.provides[e]=t,o),runWithContext(e){const t=Ko;Ko=o;try{return e()}finally{Ko=t}}};return o};function wr(e,t=null){("undefined"!=typeof window?window:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof global?global:"undefined"!=typeof my?my:void 0).__VUE__=!0;const n=Cr(e,t),o=n._context;o.config.globalProperties.$nextTick=function(e){return cr(this.$,e)};const s=e=>(e.appContext=o,e.shapeFlag=6,e),r=function(e,t){return gr(s(e),t)},a=function(e){return e&&function(e){const{bum:t,scope:n,update:i,um:o}=e;t&&P(t);{const t=e.parent;if(t){const n=t.ctx.$children,i=Qs(e)||e.proxy,o=n.indexOf(i);o>-1&&n.splice(o,1)}}n.stop(),i&&(i.active=!1),o&&mr(o),mr((()=>{e.isUnmounted=!0}))}(e.$)};return n.mount=function(){e.render=i;const t=gr(s({type:e}),{mpType:"app",mpInstance:null,parentComponent:null,slots:[],props:null});return n._instance=t.$,t.$app=n,t.$createComponent=r,t.$destroyComponent=a,o.$appInstance=t,t},n.unmount=function(){},n}function Er(e,t,n,i){f(t)&&Zo(e,t.bind(n),i)}function Tr(e,t,n){!function(e,t,n){const i=e.mpType||n.$mpType;!i||"component"===i||"page"===i&&"component"===t.renderer||Object.keys(e).forEach((i=>{if(Ee(i,e[i],!1)){const o=e[i];p(o)?o.forEach((e=>Er(i,e,n,t))):Er(i,o,n,t)}}))}(e,t,n)}function Ir(e,t,n){return e[t]=n}function _r(e,...t){const n=this[e];return n?n(...t):(console.error(`method ${e} not found`),null)}function Or(e){const t=e.config.errorHandler;return function(n,i,o){t&&t(n,i,o);const s=e._instance;if(!s||!s.proxy)throw n;s[$]?s.proxy.$callHook($,n):fo(n,0,i&&i.$.vnode,!1)}}function Ar(e,t){return e?[...new Set([].concat(e,t))]:t}let Rr;const Pr="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",Mr=/^(?:[A-Za-z\d+/]{4})*?(?:[A-Za-z\d+/]{2}(?:==)?|[A-Za-z\d+/]{3}=?)?$/;function Nr(){const e=Nn.getStorageSync("uni_id_token")||"",t=e.split(".");if(!e||3!==t.length)return{uid:null,role:[],permission:[],tokenExpired:0};let n;try{n=JSON.parse((i=t[1],decodeURIComponent(Rr(i).split("").map((function(e){return"%"+("00"+e.charCodeAt(0).toString(16)).slice(-2)})).join(""))))}catch(o){throw new Error("获取当前用户信息出错,详细错误信息为:"+o.message)}var i;return n.tokenExpired=1e3*n.exp,delete n.exp,delete n.iat,n}function Dr(e){const t=e.config;var n;t.errorHandler=_e(e,Or),n=t.optionMergeStrategies,Ce.forEach((e=>{n[e]=Ar}));const i=t.globalProperties;!function(e){e.uniIDHasRole=function(e){const{role:t}=Nr();return t.indexOf(e)>-1},e.uniIDHasPermission=function(e){const{permission:t}=Nr();return this.uniIDHasRole("admin")||t.indexOf(e)>-1},e.uniIDTokenValid=function(){const{tokenExpired:e}=Nr();return e>Date.now()}}(i),i.$set=Ir,i.$applyOptions=Tr,i.$callMethod=_r,Nn.invokeCreateVueAppHook(e)}Rr="function"!=typeof atob?function(e){if(e=String(e).replace(/[\t\n\f\r ]+/g,""),!Mr.test(e))throw new Error("Failed to execute 'atob' on 'Window': The string to be decoded is not correctly encoded.");var t;e+="==".slice(2-(3&e.length));for(var n,i,o="",s=0;s<e.length;)t=Pr.indexOf(e.charAt(s++))<<18|Pr.indexOf(e.charAt(s++))<<12|(n=Pr.indexOf(e.charAt(s++)))<<6|(i=Pr.indexOf(e.charAt(s++))),o+=64===n?String.fromCharCode(t>>16&255):64===i?String.fromCharCode(t>>16&255,t>>8&255):String.fromCharCode(t>>16&255,t>>8&255,255&t);return o}:atob;const Br=Object.create(null);function Lr(e){delete Br[e]}function jr(e){if(!e)return;const[t,n]=e.split(",");return Br[t]?Br[t][parseInt(n)]:void 0}var Ur={install(e){Dr(e),e.config.globalProperties.pruneComponentPropsCache=Lr;const t=e.mount;e.mount=function(n){const i=t.call(e,n),o=function(){const e="createApp";if("undefined"!=typeof global&&void 0!==global[e])return global[e];if("undefined"!=typeof my)return my[e]}();return o?o(i):"undefined"!=typeof createMiniProgramApp&&createMiniProgramApp(i),i}}};function Fr(e){return m(e)?e:function(e){let t="";if(!e||m(e))return t;for(const n in e)t+=`${n.startsWith("--")?n:_(n)}:${e[n]};`;return t}(N(e))}function Gr(e,t){const n=qs(),o=n.ctx,s=void 0===t||"mp-weixin"!==o.$mpPlatform&&"mp-qq"!==o.$mpPlatform&&"mp-xhs"!==o.$mpPlatform||!m(t)&&"number"!=typeof t?"":"_"+t,r="e"+n.$ei+++s,c=o.$scope;if(!e)return delete c[r],r;const l=c[r];return l?l.value=e:c[r]=function(e,t){const n=e=>{var o;(o=e).type&&o.target&&(o.preventDefault=i,o.stopPropagation=i,o.stopImmediatePropagation=i,u(o,"detail")||(o.detail={}),u(o,"markerId")&&(o.detail="object"==typeof o.detail?o.detail:{},o.detail.markerId=o.markerId),S(o.detail)&&u(o.detail,"checked")&&!u(o.detail,"value")&&(o.detail.value=o.detail.checked),S(o.detail)&&(o.target=a({},o.target,o.detail)));let s=[e];t&&t.ctx.$getTriggerEventDetail&&"number"==typeof e.detail&&(e.detail=t.ctx.$getTriggerEventDetail(e.detail)),e.detail&&e.detail.__args__&&(s=e.detail.__args__);const r=n.value,c=()=>po(function(e,t){if(p(t)){const n=e.stopImmediatePropagation;return e.stopImmediatePropagation=()=>{n&&n.call(e),e._stopped=!0},t.map((e=>t=>!t._stopped&&e(t)))}return t}(e,r),t,5,s),l=e.target,d=!!l&&(!!l.dataset&&"true"===String(l.dataset.eventsync));if(!qr.includes(e.type)||d){const t=c();if("input"===e.type&&(p(t)||y(t)))return;return t}setTimeout(c)};return n.value=e,n}(e,n),r}const qr=["tap","longpress","longtap","transitionend","animationstart","animationiteration","animationend","touchforcechange"];const zr=function(e,t=null){return e&&(e.mpType="app"),wr(e,t).use(Ur)};const Hr=["externalClasses"];const $r=/_(.*)_worklet_factory_/;function Vr(e,t){const n=e.$children;for(let o=n.length-1;o>=0;o--){const e=n[o];if(e.$scope._$vueId===t)return e}let i;for(let o=n.length-1;o>=0;o--)if(i=Vr(n[o],t),i)return i}const Kr=["createSelectorQuery","createIntersectionObserver","selectAllComponents","selectComponent"];function Wr(e,t){const n=e.ctx;n.mpType=t.mpType,n.$mpType=t.mpType,n.$mpPlatform="mp-weixin",n.$scope=t.mpInstance,Object.defineProperties(n,{[me]:{get(){const e=this.$scope.data[me];return void 0===e?"":e}}}),n.$mp={},n._self={},e.slots={},p(t.slots)&&t.slots.length&&(t.slots.forEach((t=>{e.slots[t]=!0})),e.slots.d&&(e.slots.default=!0)),n.getOpenerEventChannel=function(){return t.mpInstance.getOpenerEventChannel()},n.$hasHook=Xr,n.$callHook=Jr,e.emit=function(e,t){return function(n,...i){const o=t.$scope;if(o&&n){const e={__args__:i};o.triggerEvent(n,e)}return e.apply(this,[n,...i])}}(e.emit,n)}function Xr(e){const t=this.$[e];return!(!t||!t.length)}function Jr(e,t){"mounted"===e&&(Jr.call(this,"bm"),this.$.isMounted=!0,e="m");const n=this.$[e];return n&&((e,t)=>{let n;for(let i=0;i<e.length;i++)n=e[i](t);return n})(n,t)}const Qr=[X,q,z,Q,ee,ie,oe,se,ce];function Yr(e,t=new Set){if(e){Object.keys(e).forEach((n=>{Ee(n,e[n])&&t.add(n)}));{const{extends:n,mixins:i}=e;i&&i.forEach((e=>Yr(e,t))),n&&Yr(n,t)}}return t}function Zr(e,t,n){-1!==n.indexOf(t)||u(e,t)||(e[t]=function(e){return this.$vm&&this.$vm.$callHook(t,e)})}const ea=[J];function ta(e,t,n=ea){t.forEach((t=>Zr(e,t,n)))}function na(e,t,n=ea){Yr(t).forEach((t=>Zr(e,t,n)))}const ia=ge((()=>{const e=[],t=f(getApp)&&getApp({allowDefault:!0});if(t&&t.$vm&&t.$vm.$){const n=t.$vm.$.appContext.mixins;if(p(n)){const t=Object.keys(we);n.forEach((n=>{t.forEach((t=>{u(n,t)&&!e.includes(t)&&e.push(t)}))}))}}return e}));const oa=[q,z,$,V,K,W];function sa(e,t){const n=e.$,i={globalData:e.$options&&e.$options.globalData||{},$vm:e,onLaunch(t){this.$vm=e;const i=n.ctx;this.$vm&&i.$scope&&i.$callHook||(Wr(n,{mpType:"app",mpInstance:this,slots:[]}),i.globalData=this.globalData,e.$callHook(H,t))}},o=wx.$onErrorHandlers;o&&(o.forEach((e=>{Zo($,e,n)})),o.length=0),function(e){const t=io(function(){var e;let t="";{const n=(null===(e=wx.getAppBaseInfo)||void 0===e?void 0:e.call(wx))||wx.getSystemInfoSync();t=Fe(n&&n.language?n.language:Be)||Be}return t}());Object.defineProperty(e,"$locale",{get:()=>t.value,set(e){t.value=e}})}(e);const s=e.$.type;ta(i,oa),na(i,s);{const e=s.methods;e&&a(i,e)}return i}function ra(e,t){if(f(e.onLaunch)){const t=wx.getLaunchOptionsSync&&wx.getLaunchOptionsSync();e.onLaunch(t)}f(e.onShow)&&wx.onAppShow&&wx.onAppShow((e=>{t.$callHook("onShow",e)})),f(e.onHide)&&wx.onAppHide&&wx.onAppHide((e=>{t.$callHook("onHide",e)}))}const aa=["eO","uR","uRIF","uI","uT","uP","uS"];function ca(e){e.properties||(e.properties={}),a(e.properties,function(e,t=!1){const n={};if(!t){let e=function(e){const t=Object.create(null);e&&e.forEach((e=>{t[e]=!0})),this.setData({$slots:t})};aa.forEach((e=>{n[e]={type:null,value:""}})),n.uS={type:null,value:[]},n.uS.observer=e}return e.behaviors&&e.behaviors.includes("wx://form-field")&&(e.properties&&e.properties.name||(n.name={type:null,value:""}),e.properties&&e.properties.value||(n.value={type:null,value:""})),n}(e),function(e){const t={};return e&&e.virtualHost&&(t.virtualHostStyle={type:null,value:""},t.virtualHostClass={type:null,value:""},t.virtualHostHidden={type:null,value:""},t[me]={type:null,value:""}),t}(e.options))}const la=[String,Number,Boolean,Object,Array,null];function ua(e,t){const n=function(e){return p(e)&&1===e.length?e[0]:e}(e);return-1!==la.indexOf(n)?n:null}function pa(e,t){return(t?function(e){const t={};S(e)&&Object.keys(e).forEach((n=>{-1===aa.indexOf(n)&&(t[n]=e[n])}));return t}(e):jr(e.uP))||{}}function da(e){const t=function(){const e=this.properties.uP;e&&(this.$vm?function(e,t){const n=Xi(t.props),i=jr(e)||{};ha(n,i)&&(!function(e,t,n,i){const{props:o,attrs:s,vnode:{patchFlag:r}}=e,a=Xi(o),[c]=e.propsOptions;let l=!1;if(!(i||r>0)||16&r){let i;Os(e,t,o,s)&&(l=!0);for(const s in a)t&&(u(t,s)||(i=_(s))!==s&&u(t,i))||(c?!n||void 0===n[s]&&void 0===n[i]||(o[s]=As(c,a,s,void 0,e,!0)):delete o[s]);if(s!==a)for(const e in s)t&&u(t,e)||(delete s[e],l=!0)}else if(8&r){const n=e.vnode.dynamicProps;for(let i=0;i<n.length;i++){let r=n[i];if(No(e.emitsOptions,r))continue;const p=t[r];if(c)if(u(s,r))p!==s[r]&&(s[r]=p,l=!0);else{const t=T(r);o[t]=As(c,a,t,p,e,!1)}else p!==s[r]&&(s[r]=p,l=!0)}}l&&si(e,"set","$attrs")}(t,i,n,!1),o=t.update,vo.indexOf(o)>-1&&function(e){const t=vo.indexOf(e);t>yo&&vo.splice(t,1)}(t.update),t.update());var o}(e,this.$vm.$):"m"===this.properties.uT&&function(e,t){const n=t.properties,i=jr(e)||{};ha(n,i,!1)&&t.setData(i)}(e,this))};e.observers||(e.observers={}),e.observers.uP=t}function ha(e,t,n=!0){const i=Object.keys(t);if(n&&i.length!==Object.keys(e).length)return!0;for(let o=0;o<i.length;o++){const n=i[o];if(t[n]!==e[n])return!0}return!1}function fa(e,t){e.data={},e.behaviors=function(e){const t=e.behaviors;let n=e.props;n||(e.props=n=[]);const i=[];return p(t)&&t.forEach((e=>{i.push(e.replace("uni://","wx://")),"uni://form-field"===e&&(p(n)?(n.push("name"),n.push("modelValue")):(n.name={type:String,default:""},n.modelValue={type:[String,Number,Boolean,Array,Object,Date],default:""}))})),i}(t)}function ma(e,{parse:t,mocks:n,isPage:i,isPageInProject:o,initRelation:s,handleLink:r,initLifetimes:c}){e=e.default||e;const l={multipleSlots:!0,addGlobalClass:!0,pureDataPattern:/^uP$/};p(e.mixins)&&e.mixins.forEach((e=>{v(e.options)&&a(l,e.options)})),e.options&&a(l,e.options);const d={options:l,lifetimes:c({mocks:n,isPage:i,initRelation:s,vueOptions:e}),pageLifetimes:{show(){this.$vm&&this.$vm.$callHook("onPageShow")},hide(){this.$vm&&this.$vm.$callHook("onPageHide")},resize(e){this.$vm&&this.$vm.$callHook("onPageResize",e)}},methods:{__l:r}};var h,f,m,g;return fa(d,e),ca(d),da(d),function(e,t){Hr.forEach((n=>{u(t,n)&&(e[n]=t[n])}))}(d,e),h=d.methods,f=e.wxsCallMethods,p(f)&&f.forEach((e=>{h[e]=function(t){return this.$vm[e](t)}})),m=d.methods,(g=e.methods)&&Object.keys(g).forEach((e=>{const t=e.match($r);if(t){const n=t[1];m[e]=g[e],m[n]=g[n]}})),t&&t(d,{handleLink:r}),d}let ga,va;function ya(){return getApp().$vm}function ba(e,t){const{parse:n,mocks:i,isPage:o,initRelation:s,handleLink:r,initLifetimes:a}=t,c=ma(e,{mocks:i,isPage:o,isPageInProject:!0,initRelation:s,handleLink:r,initLifetimes:a});!function({properties:e},t){p(t)?t.forEach((t=>{e[t]={type:String,value:""}})):S(t)&&Object.keys(t).forEach((n=>{const i=t[n];if(S(i)){let t=i.default;f(t)&&(t=t());const o=i.type;i.type=ua(o),e[n]={type:i.type,value:t}}else e[n]={type:ua(i)}}))}(c,(e.default||e).props);const l=c.methods;return l.onLoad=function(e){var t;return this.options=e,this.$page={fullPath:(t=this.route+Se(e),function(e){return 0===e.indexOf("/")}(t)?t:"/"+t)},this.$vm&&this.$vm.$callHook(X,e)},ta(l,Qr),na(l,e),function(e,t){if(!t)return;Object.keys(we).forEach((n=>{t&we[n]&&Zr(e,n,[])}))}(l,e.__runtimeHooks),ta(l,ia()),n&&n(c,{handleLink:r}),c}const xa=Page,Sa=Component;function ka(e){const t=e.triggerEvent,n=function(n,...i){return t.apply(e,[(o=n,T(o.replace(be,"-"))),...i]);var o};try{e.triggerEvent=n}catch(i){e._triggerEvent=n}}function Ca(e,t,n){const i=t[e];t[e]=i?function(...e){return ka(this),i.apply(this,e)}:function(){ka(this)}}Page=function(e){return Ca(X,e),xa(e)},Component=function(e){Ca("created",e);return e.properties&&e.properties.uP||(ca(e),da(e)),Sa(e)};var wa=Object.freeze({__proto__:null,handleLink:function(e){const t=e.detail||e.value,n=t.vuePid;let i;n&&(i=Vr(this.$vm,n)),i||(i=this.$vm),t.parent=i},initLifetimes:function({mocks:e,isPage:t,initRelation:n,vueOptions:i}){return{attached(){let o=this.properties;!function(e,t){if(!e)return;const n=e.split(","),i=n.length;1===i?t._$vueId=n[0]:2===i&&(t._$vueId=n[0],t._$vuePid=n[1])}(o.uI,this);const s={vuePid:this._$vuePid};n(this,s);const r=this,a=t(r);let c=o;this.$vm=function(e,t){ga||(ga=ya().$createComponent);const n=ga(e,t);return Qs(n.$)||n}({type:i,props:pa(c,a)},{mpType:a?"page":"component",mpInstance:r,slots:o.uS||{},parentComponent:s.parent&&s.parent.$,onBeforeSetup(t,n){!function(e,t){Object.defineProperty(e,"refs",{get(){const e={};return function(e,t,n){e.selectAllComponents(t).forEach((e=>{const t=e.properties.uR;n[t]=e.$vm||e}))}(t,".r",e),t.selectAllComponents(".r-i-f").forEach((t=>{const n=t.properties.uR;n&&(e[n]||(e[n]=[]),e[n].push(t.$vm||t))})),e}})}(t,r),function(e,t,n){const i=e.ctx;n.forEach((n=>{u(t,n)&&(e[n]=i[n]=t[n])}))}(t,r,e),function(e,t){Wr(e,t);const n=e.ctx;Kr.forEach((e=>{n[e]=function(...t){const i=n.$scope;if(i&&i[e])return i[e].apply(i,t)}}))}(t,n)}}),a||function(e){const t=e.$options;p(t.behaviors)&&t.behaviors.includes("uni://form-field")&&e.$watch("modelValue",(()=>{e.$scope&&e.$scope.setData({name:e.name,value:e.modelValue})}),{immediate:!0})}(this.$vm)},ready(){this.$vm&&(this.$vm.$callHook("mounted"),this.$vm.$callHook(J))},detached(){var e;this.$vm&&(Lr(this.$vm.$.uid),e=this.$vm,va||(va=ya().$destroyComponent),va(e))}}},initRelation:function(e,t){e.triggerEvent("__l",t)},isPage:function(e){return!!e.route},mocks:["__route__","__wxExparserNodeId__","__wxWebviewId__"]});const Ea=function(e){return App(sa(e))},Ta=(Ia=wa,function(e){return Component(ba(e,Ia))});var Ia;const _a=function(e){return function(t){return Component(ma(t,e))}}(wa),Oa=function(e){ra(sa(e),e)},Aa=function(e){const t=sa(e),n=f(getApp)&&getApp({allowDefault:!0});if(!n)return;e.$.ctx.$scope=n;const i=n.globalData;i&&Object.keys(t.globalData).forEach((e=>{u(i,e)||(i[e]=t.globalData[e])})),Object.keys(t).forEach((e=>{u(n,e)||(n[e]=t[e])})),ra(t,e)};wx.createApp=global.createApp=Ea,wx.createPage=Ta,wx.createComponent=_a,wx.createPluginApp=global.createPluginApp=Oa,wx.createSubpackageApp=global.createSubpackageApp=Aa;
/*!
* pinia v2.1.7
* (c) 2023 Eduardo San Martin Morote
* @license MIT
*/
let Ra;const Pa=e=>Ra=e,Ma=Symbol();function Na(e){return e&&"object"==typeof e&&"[object Object]"===Object.prototype.toString.call(e)&&"function"!=typeof e.toJSON}var Da,Ba;(Ba=Da||(Da={})).direct="direct",Ba.patchObject="patch object",Ba.patchFunction="patch function";const La=()=>{};function ja(e,t,n,i=La){e.push(t);const o=()=>{const n=e.indexOf(t);n>-1&&(e.splice(n,1),i())};return!n&&Un()&&function(e){Dn&&Dn.cleanups.push(e)}(o),o}function Ua(e,...t){e.slice().forEach((e=>{e(...t)}))}const Fa=e=>e();function Ga(e,t){e instanceof Map&&t instanceof Map&&t.forEach(((t,n)=>e.set(n,t))),e instanceof Set&&t instanceof Set&&t.forEach(e.add,e);for(const n in t){if(!t.hasOwnProperty(n))continue;const i=t[n],o=e[n];Na(o)&&Na(i)&&e.hasOwnProperty(n)&&!no(i)&&!Vi(i)?e[n]=Ga(o,i):e[n]=i}return e}const qa=Symbol();const{assign:za}=Object;function Ha(e,t,n,i){const{state:o,actions:s,getters:r}=t,a=n.state.value[e];let c;return c=$a(e,(function(){a||(n.state.value[e]=o?o():{});const t=function(e){const t=p(e)?new Array(e.length):{};for(const n in e)t[n]=lo(e,n);return t}(n.state.value[e]);return za(t,s,Object.keys(r||{}).reduce(((t,i)=>(t[i]=Ji(Ys((()=>{Pa(n);const t=n._s.get(e);return r[i].call(t,t)}))),t)),{}))}),t,n,i,!0),c}function $a(e,t,n={},i,o,s){let r;const a=za({actions:{}},n),c={deep:!0};let l,u,p,d=[],h=[];const f=i.state.value[e];let m;function g(t){let n;l=u=!1,"function"==typeof t?(t(i.state.value[e]),n={type:Da.patchFunction,storeId:e,events:p}):(Ga(i.state.value[e],t),n={type:Da.patchObject,payload:t,storeId:e,events:p});const o=m=Symbol();wo().then((()=>{m===o&&(l=!0)})),u=!0,Ua(d,n,i.state.value[e])}s||f||(i.state.value[e]={}),io({});const v=s?function(){const{state:e}=n,t=e?e():{};this.$patch((e=>{za(e,t)}))}:La;function y(t,n){return function(){Pa(i);const o=Array.from(arguments),s=[],r=[];let a;Ua(h,{args:o,name:t,store:b,after:function(e){s.push(e)},onError:function(e){r.push(e)}});try{a=n.apply(this&&this.$id===e?this:b,o)}catch(c){throw Ua(r,c),c}return a instanceof Promise?a.then((e=>(Ua(s,e),e))).catch((e=>(Ua(r,e),Promise.reject(e)))):(Ua(s,a),a)}}const b=zi({_p:i,$id:e,$onAction:ja.bind(null,h),$patch:g,$reset:v,$subscribe(t,n={}){const o=ja(d,t,n.detached,(()=>s())),s=r.run((()=>Fo((()=>i.state.value[e]),(i=>{("sync"===n.flush?u:l)&&t({storeId:e,type:Da.direct,events:p},i)}),za({},c,n))));return o},$dispose:function(){r.stop(),d=[],h=[],i._s.delete(e)}});i._s.set(e,b);const x=(i._a&&i._a.runWithContext||Fa)((()=>i._e.run((()=>(r=jn()).run(t)))));for(const C in x){const t=x[C];if(no(t)&&(!no(k=t)||!k.effect)||Vi(t))s||(!f||Na(S=t)&&S.hasOwnProperty(qa)||(no(t)?t.value=f[C]:Ga(t,f[C])),i.state.value[e][C]=t);else if("function"==typeof t){const e=y(C,t);x[C]=e,a.actions[C]=t}}var S,k;return za(b,x),za(Xi(b),x),Object.defineProperty(b,"$state",{get:()=>i.state.value[e],set:e=>{g((t=>{za(t,e)}))}}),i._p.forEach((e=>{za(b,r.run((()=>e({store:b,app:i._a,pinia:i,options:a}))))})),f&&s&&n.hydrate&&n.hydrate(b.$state,f),l=!0,u=!0,b}var Va,Ka,Wa;(Wa=Va||(Va={})).UNIAPP="uniapp",Wa.REACT_NATIVE="rn",Wa.COCOS="cocos",Wa.UNKNOWN="unknown";class Xa{constructor(){this.framework=null,this.methods={[Va.UNIAPP]:this.isUniApp,[Va.REACT_NATIVE]:this.isReactNative,[Va.COCOS]:this.isCocos};const e=this.methods,t=Object.keys(e);for(const n of t)if((0,e[n])()){this.framework=n;break}this.framework=this.framework||Va.UNKNOWN,this.framework}static currentFramework(){return this.instance||(this.instance=new Xa),this.instance.framework}isUniApp(){try{return"function"==typeof Nn.getSystemInfoSync}catch(Wa){return!1}}isReactNative(){try{return"object"==typeof navigator&&"ReactNative"===navigator.product}catch(Wa){return!1}}isTaro(){try{return void 0!==process.env.TARO_ENV}catch(Wa){return!1}}isCocos(){try{return void 0!==cc.sys.localStorage}catch(Wa){return!1}}}class Ja{static init(e){Xa.currentFramework()===Va.REACT_NATIVE&&(this.validate(e),this.platform=e.platform,this.asyncStorage=e.asyncStorage)}static validate(e){if(!e)throw new Error("'reactNativeOptions' is missing when calling GoEasy.getInstance()");if(!e.platform)throw new Error("'platform' is missing in GoEasy 'reactNativeOptions'");if(!e.asyncStorage)throw new Error("'asyncStorage' is missing in GoEasy 'reactNativeOptions'")}}!function(e){e.DISCONNECTED="disconnected",e.DISCONNECTING="disconnecting",e.CONNECTING="connecting",e.CONNECTED="connected",e.RECONNECTING="reconnecting",e.RECONNECTED="reconnected",e.EXPIRED_RECONNECTED="reconnected",e.CONNECT_FAILED="connect_failed"}(Ka||(Ka={}));const Qa="2.13.17";var Ya,Za;!function(e){e.PRIVATE="private",e.GROUP="group",e.SYSTEM="system",e.CS="cs"}(Ya||(Ya={})),function(e){e.NEW="new",e.SENDING="sending",e.SUCCESS="success",e.FAIL="fail"}(Za||(Za={}));class ec{}class tc{constructor(e,t){this.id=e,this.data=t}}let nc=new class{isDef(e){return!this.isUndef(e)}isUndef(e){return null==e}isPrimitive(e){return"string"==typeof e||"number"==typeof e||"symbol"==typeof e||"boolean"==typeof e}isObject(e){return null!==e&&"object"==typeof e}isPlainObject(e){return"[object Object]"===Object.prototype.toString.call(e)}isRegExp(e){return"[object RegExp]"===Object.prototype.toString.call(e)}isValidArrayIndex(e){let t=parseFloat(String(e));return t>=0&&Math.floor(t)===t&&isFinite(e)}isString(e){return"string"==typeof e}isNumber(e){return"number"==typeof e}isStringOrNumber(e){return this.isString(e)||this.isNumber(e)}isArray(e){return"[object Array]"===Object.prototype.toString.call(e)}isEmpty(e){return this.isArray(e)?0===e.length:this.isObject(e)?!this.isDef(e):!this.isNumber(e)&&(this.isString(e)?""===e.trim():!this.isDef(e))}isNative(e){return"function"==typeof e&&/native code/.test(e.toString())}isFunction(e){return"function"==typeof e}isBoolean(e){return"boolean"==typeof e}isTrue(e){return!0===e}isFalse(e){return!1===e}isNull(e){return null===e}};var ic;!function(e){e.MP_WX="mp-wx",e.MP_WGAME="mp-wgame",e.MP_BYTE="mp-byte",e.MP_BAIDU="mp-baidu",e.MP_ALI="mp-ali",e.BROWSER="browser",e.NODE="node",e.UNI_IOS="uni-ios",e.UNI_ANDROID="uni-android",e.COCOS_IOS="cocos-ios",e.COCOS_ANDROID="cocos-android",e.RN_IOS="rn-ios",e.RN_ANDROID="rn-android",e.UNKNOWN="unknown"}(ic||(ic={}));class oc{constructor(){this.platform=null,this.methods={[ic.BROWSER]:this.isBrowser,[ic.MP_WX]:this.isMPWX,[ic.MP_WGAME]:this.isMPWeGame,[ic.MP_BYTE]:this.isMPByte,[ic.MP_BAIDU]:this.isMPBaidu,[ic.MP_ALI]:this.isMPAli,[ic.NODE]:this.isNode,[ic.UNI_IOS]:this.isUniAppIOS,[ic.UNI_ANDROID]:this.isUniAppAndroid,[ic.COCOS_IOS]:this.isCocosIOS,[ic.COCOS_ANDROID]:this.isCocosAndroid,[ic.RN_IOS]:this.isRNiOS,[ic.RN_ANDROID]:this.isRNAndroid};const e=this.methods,t=Object.keys(e);for(const n of t)if((0,e[n])()){this.platform=n;break}this.platform=this.platform||ic.UNKNOWN,this.platform}static currentPlatform(){return this.instance||(this.instance=new oc),oc.instance.platform}isBrowser(){return"undefined"!=typeof navigator&&"Taro"!==navigator.product&&"ReactNative"!==navigator.product&&"undefined"==typeof GameGlobal&&("undefined"==typeof cc||null!==cc.sys.browserType)&&"undefined"==typeof my&&"undefined"==typeof tt&&"undefined"==typeof swan}isMPWX(){return"object"==typeof Mn&&"function"==typeof Mn.getSystemInfoSync&&"undefined"==typeof WebSocket&&"undefined"==typeof XMLHttpRequest&&"undefined"==typeof plus&&"undefined"==typeof tt}isMPWeGame(){return"object"==typeof GameGlobal}isMPByte(){return"object"==typeof tt&&"function"==typeof tt.getSystemInfoSync}isMPBaidu(){return"object"==typeof swan&&"function"==typeof swan.getSystemInfoSync}isMPAli(){return"object"==typeof my&&"function"==typeof my.getSystemInfoSync}isNode(){try{return"node"===process.release.name}catch(Wa){return!1}}isUniAppIOS(){try{return"ios"===Nn.getSystemInfoSync().platform&&"app"===Nn.getSystemInfoSync().uniPlatform}catch(Wa){return!1}}isUniAppAndroid(){try{return"android"===Nn.getSystemInfoSync().platform&&"app"===Nn.getSystemInfoSync().uniPlatform}catch(Wa){return!1}}isCocosIOS(){try{return"iOS"===cc.sys.os}catch(Wa){return!1}}isCocosAndroid(){try{return"Android"===cc.sys.os}catch(Wa){return!1}}isRNiOS(){try{return"ios"===Ja.platform.OS}catch(Wa){return!1}}isRNAndroid(){try{return"android"===Ja.platform.OS}catch(Wa){return!1}}}class sc{}sc.type=ic,sc.current=oc.currentPlatform();class rc{onFrontend(e){this.onFrontendCallback=e}}class ac extends rc{constructor(){super(...arguments),this.runningBackend=!1}startCheck(){"object"==typeof plus&&(plus.globalEvent.addEventListener("resume",(()=>{this.runningBackend=!1,this.runningBackend,this.onFrontendCallback&&this.onFrontendCallback()}),!1),plus.globalEvent.addEventListener("pause",(()=>{this.runningBackend=!0,this.runningBackend}),!1))}isBackend(){return this.runningBackend}support(){const e=oc.currentPlatform();return[ic.UNI_IOS,ic.UNI_ANDROID].includes(e)}}class lc extends rc{constructor(){super(...arguments),this.runningBackend=!1}startCheck(){Mn.onAppShow((()=>{this.runningBackend=!1})),Mn.onAppHide((()=>{this.runningBackend=!0}))}isBackend(){return this.runningBackend}support(){return oc.currentPlatform()===ic.MP_WX}}const uc=new class{constructor(){[new ac,new lc].forEach((e=>{if(e.support())return this.checker=e,void this.checker.startCheck()}))}isBackend(){return this.checker&&this.checker.isBackend()}onFrontend(e){this.checker.onFrontend(e)}};var pc,dc,hc=Object.freeze({__proto__:null,runStatus:uc});!function(e){e.authorize="authorize",e.manualDisconnect="manualDisconnect",e.subscribe="subscribe",e.unsubscribe="unsubscribe",e.publish="publish",e.ack="ack",e.historyMessages="historyMessages",e.hereNow="hereNow",e.hereNowByUserIds="hereNowByUserIds",e.PUBSUB_PRESENCE_SUBSCRIBE="PUBSUB_PRESENCE_SUBSCRIBE",e.PUBSUB_PRESENCE_UNSUBSCRIBE="PUBSUB_PRESENCE_UNSUBSCRIBE",e.PUBSUB_PRESENCE_HERENOW="PUBSUB_PRESENCE_HERENOW",e.imLastConversations="imLastConversations",e.markPrivateMessageAsRead="markPrivateMessageAsRead",e.markGroupMessageAsRead="markGroupMessageAsRead",e.imGroupOnlineCount="imGroupOnlineCount",e.imHereNow="imHereNow",e.imGroupHereNow="imGroupHereNow",e.publishIM="publishIM",e.subscribeUserPresence="subscribeUserPresence",e.unsubscribeUserPresence="unsubscribeUserPresence",e.subscribeGroupPresence="subscribeGroupPresence",e.unsubscribeGroupPresence="unsubscribeGroupPresence",e.removeConversation="removeConversation",e.topConversation="topConversation",e.imData="imData",e.subscribeGroups="subscribeGroups",e.unsubscribeGroup="unsubscribeGroup",e.IM_DELETE_MESSAGE="IM_DELETE_MESSAGE",e.IM_HISTORY="IM_HISTORY",e.IM_HISTORY_CHANGE="IM_HISTORY_CHANGE",e.IM_RECALL_MESSAGE="IM_RECALL_MESSAGE",e.IM_MARK_AS_READ="IM_MARK_AS_READ",e.CS_PENDING_CONVERSATION="CS_PENDING_CONVERSATION",e.CS_ACCEPT="CS_ACCEPT",e.CS_END="CS_END",e.CS_TRANSFER="CS_TRANSFER",e.CS_AGENTS="CS_AGENTS",e.CS_CUSTOMER_STATUS="CS_CUSTOMER_STATUS",e.CS_MY_TEAMS="CS_MY_TEAMS",e.CS_ONLINE="CS_ONLINE",e.CS_OFFLINE="CS_OFFLINE",e.CS_LIVE_SESSION="CS_LIVE_SESSION",e.CS_QUIT_LIVE="CS_QUIT_LIVE",e.SET_IOS_BADGE="SET_IOS_BADGE",e.MD_CMD="MD_CMD"}(pc||(pc={})),function(e){e[e.connect=3e3]="connect",e[e.reconnectionDelayMax=3e3]="reconnectionDelayMax",e[e.commonQuerySingle=2500]="commonQuerySingle",e[e.commonQueryTotal=12e3]="commonQueryTotal",e[e.commonRequestSingle=1700]="commonRequestSingle",e[e.commonRequestTotal=12e3]="commonRequestTotal",e[e.commonInfiniteSingle=1700]="commonInfiniteSingle",e[e.commonInfiniteTotal=864e5]="commonInfiniteTotal"}(dc||(dc={}));class fc{static onSuccess(e,t){nc.isFunction(e.onSuccess)&&e.onSuccess(t)}static onFailed(e,t){if(!nc.isObject(e)||!nc.isFunction(e.onFailed))throw t;e.onFailed(t)}}function mc(e,t,n,i){return new(n||(n=Promise))((function(o,s){function r(e){try{c(i.next(e))}catch(t){s(t)}}function a(e){try{c(i.throw(e))}catch(t){s(t)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(r,a)}c((i=i.apply(e,t||[])).next())}))}"function"==typeof SuppressedError&&SuppressedError;var gc="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function vc(e){if(e.__esModule)return e;var t=Object.defineProperty({},"__esModule",{value:!0});return Object.keys(e).forEach((function(n){var i=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,i.get?i:{enumerable:!0,get:function(){return e[n]}})})),t}var yc={exports:{}};!function(){function e(t){if(t)return function(t){for(var n in e.prototype)t[n]=e.prototype[n];return t}(t)}yc.exports=e,e.prototype.on=e.prototype.addEventListener=function(e,t){return this._callbacks=this._callbacks||{},(this._callbacks["$"+e]=this._callbacks["$"+e]||[]).push(t),this},e.prototype.once=function(e,t){function n(){this.off(e,n),t.apply(this,arguments)}return n.fn=t,this.on(e,n),this},e.prototype.off=e.prototype.removeListener=e.prototype.removeAllListeners=e.prototype.removeEventListener=function(e,t){if(this._callbacks=this._callbacks||{},0==arguments.length)return this._callbacks={},this;var n,i=this._callbacks["$"+e];if(!i)return this;if(1==arguments.length)return delete this._callbacks["$"+e],this;for(var o=0;o<i.length;o++)if((n=i[o])===t||n.fn===t){i.splice(o,1);break}return this},e.prototype.emit=function(e){this._callbacks=this._callbacks||{};var t=[].slice.call(arguments,1),n=this._callbacks["$"+e];if(n)for(var i=0,o=(n=n.slice(0)).length;i<o;++i)n[i].apply(this,t);return this},e.prototype.listeners=function(e){return this._callbacks=this._callbacks||{},this._callbacks["$"+e]||[]},e.prototype.hasListeners=function(e){return!!this.listeners(e).length}}();var bc=yc.exports,xc={exports:{}},Sc="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof window.msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto);if(Sc){var kc=new Uint8Array(16);xc.exports=function(){return Sc(kc),kc}}else{var Cc=new Array(16);xc.exports=function(){for(var e,t=0;t<16;t++)!(3&t)&&(e=4294967296*Math.random()),Cc[t]=e>>>((3&t)<<3)&255;return Cc}}for(var wc=[],Ec=0;Ec<256;++Ec)wc[Ec]=(Ec+256).toString(16).substr(1);var Tc,Ic,_c=function(e,t){var n=t||0,i=wc;return[i[e[n++]],i[e[n++]],i[e[n++]],i[e[n++]],"-",i[e[n++]],i[e[n++]],"-",i[e[n++]],i[e[n++]],"-",i[e[n++]],i[e[n++]],"-",i[e[n++]],i[e[n++]],i[e[n++]],i[e[n++]],i[e[n++]],i[e[n++]]].join("")},Oc=xc.exports,Ac=_c,Rc=0,Pc=0,Mc=xc.exports,Nc=_c,Dc=function(e,t,n){var i=t&&n||0,o=t||[],s=(e=e||{}).node||Tc,r=void 0!==e.clockseq?e.clockseq:Ic;if(null==s||null==r){var a=Oc();null==s&&(s=Tc=[1|a[0],a[1],a[2],a[3],a[4],a[5]]),null==r&&(r=Ic=16383&(a[6]<<8|a[7]))}var c=void 0!==e.msecs?e.msecs:(new Date).getTime(),l=void 0!==e.nsecs?e.nsecs:Pc+1,u=c-Rc+(l-Pc)/1e4;if(u<0&&void 0===e.clockseq&&(r=r+1&16383),(u<0||c>Rc)&&void 0===e.nsecs&&(l=0),l>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");Rc=c,Pc=l,Ic=r;var p=(1e4*(268435455&(c+=122192928e5))+l)%4294967296;o[i++]=p>>>24&255,o[i++]=p>>>16&255,o[i++]=p>>>8&255,o[i++]=255&p;var d=c/4294967296*1e4&268435455;o[i++]=d>>>8&255,o[i++]=255&d,o[i++]=d>>>24&15|16,o[i++]=d>>>16&255,o[i++]=r>>>8|128,o[i++]=255&r;for(var h=0;h<6;++h)o[i+h]=s[h];return t||Ac(o)},Bc=function(e,t,n){var i=t&&n||0;"string"==typeof e&&(t="binary"===e?new Array(16):null,e=null);var o=(e=e||{}).random||(e.rng||Mc)();if(o[6]=15&o[6]|64,o[8]=63&o[8]|128,t)for(var s=0;s<16;++s)t[i+s]=o[s];return t||Nc(o)},Lc=Bc;Lc.v1=Dc,Lc.v4=Bc;var jc=Lc;class Uc{support(){return!0}getParams(){return this.params}setData(e){this.active=e.a,this.data=e.d}preConnect(e){}postConnect(){}}class Fc{static initModule(e){e.support()&&this.modules.set(e.name,e)}static getParams(){return mc(this,void 0,void 0,(function*(){let e={};for(const[t,n]of this.modules)e[t]=(yield n.getParams())||null;return e}))}static setDatas(e){Object.keys(e).forEach((t=>{this.modules.get(t).setData(e[t])}))}static preConnect(e){this.modules.forEach(((t,n)=>{t.preConnect(e)}))}static postConnect(){this.modules.forEach(((e,t)=>{e.postConnect()}))}}Fc.Module=Uc,Fc.modules=new Map;const Gc=bc;class qc{constructor(){this.emitter=new Gc}on(e,t){return this.emitter.on(e,t),this}once(e,t){return this.emitter.once(e,t),this}off(e,t){return this.emitter.off(e,t),this}fire(e,t){return this.emitter.emit(e,t),this}}class zc{constructor(){this.eventDriver=new qc}on(e,t){this.eventDriver.on(e,t)}off(e,t){this.eventDriver.off(e,t)}fire(e,t){this.eventDriver.fire(e,t)}}let Hc=new class{isDef(e){return!this.isUndef(e)}isUndef(e){return null==e}isPrimitive(e){return"string"==typeof e||"number"==typeof e||"symbol"==typeof e||"boolean"==typeof e}isObject(e){return null!==e&&"object"==typeof e}isPlainObject(e){return"[object Object]"===Object.prototype.toString.call(e)}isRegExp(e){return"[object RegExp]"===Object.prototype.toString.call(e)}isValidArrayIndex(e){let t=parseFloat(String(e));return t>=0&&Math.floor(t)===t&&isFinite(e)}isString(e){return"string"==typeof e}isNumber(e){return"number"==typeof e}isStringOrNumber(e){return this.isString(e)||this.isNumber(e)}isArray(e){return"[object Array]"===Object.prototype.toString.call(e)}isEmpty(e){return this.isArray(e)?0===e.length:this.isObject(e)?!this.isDef(e):!this.isNumber(e)&&(this.isString(e)?""===e.trim():!this.isDef(e))}isNative(e){return"function"==typeof e&&/native code/.test(e.toString())}isFunction(e){return"function"==typeof e}isBoolean(e){return"boolean"==typeof e}isTrue(e){return!0===e}isFalse(e){return!1===e}isNull(e){return null===e}};const $c=bc;class Vc{constructor(){this.emitter=new $c}on(e,t){if(!Hc.isString(e))throw Error("event require a string.");if(!Hc.isFunction(t))throw Error("callback must be a function");this.emitter.on(e,t)}fire(e,t){this.emitter.emit(e,t)}off(e,t){this.emitter.off(e,t)}}class Kc{static init(e,t,n,i,o,s){this.Socket=e,this.N=t,this.Member=n,this.v=i,this.Platform=o,this.GModules=s}}const Wc=jc;class Xc{static get(){return Wc.v1().replace(/-/g,"")}}var Jc,Qc;(Qc=Jc||(Jc={})).WRITE="WRITE",Qc.READ="READ",Qc.NONE="NONE";class Yc{constructor(e){this.permission=Jc.NONE,this.singleTimeout=0,this.totalTimeout=0,this.startTime=0,this.complete=!1,this.retried=0,this.unique=!1,this.uuid=Xc.get(),this.name=e.name,this.params=e.params,this.permission=e.permission,this.totalTimeout=e.totalTimeout,this.singleTimeout=e.singleTimeout,e.unique&&(this.unique=e.unique),this.success=t=>{this.complete||(this.end(),e.success(t))},this.fail=t=>{this.complete||(this.end(),e.fail(t))}}start(){this.startTime=Date.now(),this.initAutoTimeout()}end(){this.complete=!0,clearTimeout(this.timeoutHandler)}initAutoTimeout(){this.timeoutHandler=setTimeout((()=>{this.complete||this.fail({resultCode:408,content:"Host unreachable or timeout"})}),this.totalTimeout)}}class Zc extends Uc{static init(){return this.module=new Zc,this.module.name=this.GN_MODULE_NAME,this.module}static setRegId(e,t){if(e){this.module.regIdPromise=e;let n=t;this.module.params={v:{npv:n}}}}preConnect(e){this.wxmpId=e.wxmpId}getParams(){return mc(this,void 0,void 0,(function*(){if(this.params=this.params||{},this.regIdPromise)try{const e=new Promise(((e,t)=>{setTimeout((()=>t("timeout")),1e3)}));this.params.regId=yield Promise.race([this.regIdPromise,e])}catch(Wa){console.warn("Failed to register the Manufacturers Push service:"+JSON.stringify(Wa))}return this.params.wxmpId=this.wxmpId,this.params}))}}Zc.GN_MODULE_NAME="GN";class el{static init(e){this.allowNotification=!0===e;let t=Zc.init();Fc.initModule(t),this.supportAppNotification()&&(this.uniappPlugin=Nn.requireNativePlugin("GoEasy-Uniapp"),this.uniappPlugin?(this.regIdPromise=this.askRegId(),this.v=this.uniappPlugin.v(),Zc.setRegId(this.regIdPromise,this.v)):console.warn("No GoEasy-Uniapp Native Plugin."),this.setClientBadge(0))}static addAssembler(e){this.payloadAssemblers.push(e)}static assemblePayload(e){let t=this.payloadAssemblers.find((t=>t.support(e)));return t?t.assemble(e):e}static createLocalNotification(e,t,n,i,o){uc.isBackend()&&(n.g=1,"undefined"!=typeof plus&&(i?(this.uniappPlugin&&this.uniappPlugin.playSound(i),plus.push.createMessage(t,JSON.stringify(n),{title:e,sound:"none"})):plus.push.createMessage(t,JSON.stringify(n),{title:e}),"+1"===o&&this.setClientBadge(el.badge+1)))}static setBadge(e){if(!Number.isInteger(e.badge)||e.badge<0)fc.onFailed(e,"badge must be an integer greater than or equal to 0.");else if(el.supportAppNotification())if(this.uniappPlugin&&oc.currentPlatform()===ic.UNI_IOS){let t=new Yc({name:pc.SET_IOS_BADGE,params:{badge:e.badge},unique:!0,singleTimeout:dc.commonRequestSingle,totalTimeout:dc.commonRequestTotal,permission:Jc.WRITE,success:()=>{fc.onSuccess(e),this.setClientBadge(e.badge)},fail:t=>{fc.onFailed(e,t.content)}});Kc.Socket.e(t)}else fc.onSuccess(e),this.setClientBadge(e.badge)}static setClientBadge(e){"vivo"!==plus.device.vendor&&(el.badge=e,plus.runtime.setBadgeNumber(e))}static askRegId(){let e=null,t=0;const n=()=>new Promise(((i,o)=>{this.uniappPlugin.regId((e=>{i(e)}),(i=>{if(!(1e6===i.data.code&&t<=10))return clearTimeout(e),o(i);e=setTimeout((()=>{t++,this.regIdPromise=n()}),3500)}))}));return n()}static getRegIdPromise(){return this.regIdPromise}static supportAppNotification(){const e=oc.currentPlatform();return this.allowNotification&&(e===ic.UNI_ANDROID||e===ic.UNI_IOS)}static listenPlusClickNotification(){plus.push.addEventListener("click",(e=>{try{if(e){const t="string"==typeof e.payload?JSON.parse(e.payload):e.payload;if(this.availableIntent(t)){let e=this.assemblePayload(t);plus.push.clear(),this.onClickNotificationCallback(e)}}}catch(t){}}))}static availableIntent(e){return e&&Object.keys(e).length&&e.g&&1===parseInt(e.g)}static getIntentData(){this.uniappPlugin.getIntentData((e=>{if(!this.availableIntent(e))return;let t=this.assemblePayload(e);const n=oc.currentPlatform();plus.push.clear(),n===ic.UNI_ANDROID&&this.uniappPlugin.clearAll(),this.onClickNotificationCallback(t)}))}static listenClick(){this.listenPlusClickNotification();const e=oc.currentPlatform();this.uniappPlugin&&e===ic.UNI_ANDROID&&(this.getIntentData(),uc.onFrontend((()=>{this.getIntentData()})))}static onClickNotification(e){if(el.supportAppNotification()){if(!nc.isFunction(e))throw new Error("The arguments must be a function.");null===this.onClickNotificationCallback?(this.onClickNotificationCallback=e,this.listenClick()):console.warn("The onClickNotification event has been listened on. Please do not listen to it more than once.")}else console.warn("The current environment doesn't support or allowNotification is false.")}}function tl(...e){}el.uniappPlugin=null,el.v=null,el.regIdPromise=null,el.onClickNotificationCallback=null,el.payloadAssemblers=new Array;const nl=new class{validateId(e,t){if(nc.isEmpty(e))throw{code:400,content:` ${t} is required.`};if(!nc.isString(e))throw{code:400,content:`TypeError: ${t} require string.`}}validateIdArray(e,t){if(!Array.isArray(e)||0===e.length)throw{code:400,content:`TypeError: ${t} require array.`};if(e.length>100)throw{code:400,content:`${t} is over max length 100.`};for(let n=0;n<e.length;n++){if(!nc.isStringOrNumber(e[n]))throw{code:400,content:`TypeError: ${t} item require string or number.`};if(nc.isNumber(e[n])&&(e[n]=e[n].toString()),0==e[n].length)throw{code:400,content:`${t} has empty item.`}}if(Array.from(new Set(e)).length<e.length)throw{code:400,content:`Duplicate element in ${t}`}}validateChannel(e,t){if(nc.isEmpty(e))throw{code:400,content:` ${t} is required.`};if(!nc.isStringOrNumber(e))throw{code:400,content:`TypeError: ${t} require string or number.`}}validateChannelArray(e,t){this.validateIdArray(e,t)}validateChannelAndChannels(e,t){let n=!nc.isEmpty(e),i=!nc.isEmpty(t);if(!n&&!i)throw{code:400,content:"channel is required."};if(n&&i)throw{code:400,content:"subscribe to either channel or channels, not both."};n&&this.validateChannel(e,"channel"),i&&this.validateChannelArray(t,"channels")}validateCallbackOptions(e){if(!nc.isObject(e))throw{code:400,content:"bad parameters"}}validateNotification(e){function t(e,t,n){if(!(nc.isString(e[t])&&e[t].length<=n))throw{code:400,content:`notification.${t} must be a string of no more than ${n} characters`}}function n(e,t,n,i){let o=e[t];if(nc.isObject(o)&&nc.isDef(o[n])){let e={code:400,content:`notification.vendorOptions.${t}.${n} require a ${i}}`},s=o[n];if("string"===i&&!nc.isString(s))throw e;if("number"===i&&!nc.isNumber(s))throw e}}if(!nc.isObject(e))throw{code:400,content:"TypeError: notification requires an object."};{if(t(e,"title",32),t(e,"body",50),nc.isDef(e.sound)&&!nc.isString(e.sound))throw{code:400,content:"notification.sound must be a string"};if(nc.isDef(e.badge)&&!nc.isString(e.badge))throw{code:400,content:"notification.badge must be a string"};e.badge=e.badge||"0";let i=e.vendorOptions;nc.isObject(i)&&(n(i,"huawei","category","string"),n(i,"xiaomi","channel_id","string"),n(i,"oppo","channel_id","string"),n(i,"vivo","classification","number"),n(i,"vivo","category","string"))}}validateValIsEmpty(e,t){if(nc.isUndef(e)||nc.isEmpty(e))throw{code:400,content:`${t} is empty`}}validateWXMPTemplateMsg(e){if(nc.isObject(e)){if(!nc.isString(e.template_id))throw{code:400,content:"template_id must be string."};if(!nc.isEmpty(e.url)&&!nc.isString(e.url))throw{code:400,content:"url must be string"};if(!(nc.isEmpty(e.miniprogram)||nc.isString(e.miniprogram.appid)&&nc.isString(e.miniprogram.pagepath)))throw{code:400,content:"miniprogram.appid and miniprogram.pagepath must be strings."};if(!nc.isObject(e.data))throw{code:400,content:"data requires an object."}}else if(nc.isPrimitive(e))throw{code:400,content:"wxmpTemplateMsg must be an object."}}validateObject(e,t){if(nc.isUndef(e)||!nc.isObject(e))throw{code:400,content:t+" must be an object."}}validateString(e,t){if(nc.isUndef(e)||!nc.isString(e))throw{code:400,content:t+" must be a string."}}};function il(e){if(null===e||"object"!=typeof e||"isActiveClone"in e)return e;let t=e instanceof Array?[]:{};for(let n in e)"object"==typeof e[n]?t[n]=il(e[n]):t[n]=e[n];return t}class ol{publish(e){nc.isFunction(e.onFailed)||(e.onFailed=tl),nc.isFunction(e.onSuccess)||(e.onSuccess=tl),this.validate(e),e.channel=e.channel.toString();let t={channel:e.channel,content:e.message,nt:e.notification,at:e.accessToken,guid:Xc.get(),q:e.qos};e.wxmpTemplateMsg&&(t.wxmpTemplateMsg=il(e.wxmpTemplateMsg),t.wxmpTemplateMsg.data=JSON.stringify(t.wxmpTemplateMsg.data));let n=new Yc({name:pc.publish,params:t,unique:!0,singleTimeout:dc.commonRequestSingle,totalTimeout:dc.commonRequestTotal,permission:Jc.WRITE,success:function(t){e.onSuccess({code:200,content:"ok"})},fail:function(t){e.onFailed({code:t.resultCode,content:t.content})}});Kc.Socket.e(n)}validate(e){if(nl.validateChannel(e.channel,"channel"),nc.isEmpty(e.message))throw{code:400,content:"message is required."};if(!nc.isString(e.message))throw{code:400,content:"TypeError: message requires string."};if(e.message.length>1e4)throw{code:400,content:"Message over max length 10000."};if(e.qos&&!(e.qos in[0,1]))throw{code:400,content:"Qos must be 0 or 1."};e.wxmpTemplateMsg&&nl.validateWXMPTemplateMsg(e.wxmpTemplateMsg),nc.isDef(e.notification)&&nl.validateNotification(e.notification)}}class sl{constructor(e){if(this.options=e,this.channels=e.channels||[e.channel],!nc.isEmpty(e.channel)){let t=e.channel.toString();this.channels=[t]}nc.isEmpty(e.channels)||(this.channels=e.channels.toString().split(","))}}var rl,al,cl;!function(e){e.message="message",e.imMessage="imMessage",e.userPresence="userPresence",e.groupPresence="groupPresence",e.PS_PRESENCE_EVENT="PS_PRESENCE_EVENT",e.IM_MSG_READ="IM_MSG_READ",e.IM_MSG_DELETED="IM_MSG_DELETED",e.IM_MSG_RECALLED="IM_MSG_RECALLED",e.CS_ONLINE_CHANGED="CS_ONLINE_CHANGED"}(rl||(rl={})),function(e){e.CONNECTED="CONNECTED",e.RECONNECTED="RECONNECTED",e.DISCONNECTED="DISCONNECTED",e.LOST="LOST",e.EXPIRED_RECONNECTED="EXPIRED_RECONNECTED",e.NEW_MESSAGE="NEW_MESSAGE",e.CONNECTING="CONNECTING"}(al||(al={}));class ll{constructor(){this.subscriptions=[],Kc.Socket.onMessage(rl.message,this.onNewMessage.bind(this)),Kc.Socket.on(al.EXPIRED_RECONNECTED,this.expiredResubscribe.bind(this)),Kc.Socket.on(al.RECONNECTED,this.resubscribePresenceChannel.bind(this))}expiredResubscribe(){this.subscriptions.forEach((e=>{this.doSubscribe(e,!1)}))}resubscribePresenceChannel(){this.subscriptions.forEach((e=>{let t=e.options;t.presence&&t.presence.enable&&this.doSubscribe(e,!0)}))}onNewMessage(e){if(e.n.indexOf("_presence")>-1)return;e.a&&Kc.Socket.sendAck("ack",{i:e.i,c:e.n});let t={time:e.t,channel:e.n,content:e.c};this.createNotification(e),this.findSubscriptionByChannel(t.channel).options.onMessage(t)}createNotification(e){const t=Kc.N.supportAppNotification();if(!nc.isObject(e.nt)||!t)return;const n={ch:e.n,ctt:e.c};Kc.N.createLocalNotification(e.nt.t,e.nt.c,n,e.nt.sound,e.nt.badge)}subscribe(e){if(nl.validateChannelAndChannels(e.channel,e.channels),nc.isDef(e.presence)){let t=e.presence.enable;if(!nc.isBoolean(t))throw{code:400,content:"Subscription failed. presence.enable must be a boolean"};if(t&&!Kc.Socket.user().id)throw{code:400,content:"Subscription failed. If presence is enable, the id must be specified when calling the connect method"}}let t=new sl(e);this.doSubscribe(t,!1).then((()=>{this.subscriptions.push(t),fc.onSuccess(e,{code:200,content:"ok"})})).catch((t=>{fc.onFailed(e,{code:t.resultCode,content:t.content})}))}doSubscribe(e,t){let n=e.options;return new Promise(((i,o)=>{let s=new Yc({name:pc.subscribe,permission:Jc.READ,singleTimeout:dc.commonRequestSingle,totalTimeout:dc.commonRequestTotal,params:{channels:e.channels,accessToken:n.accessToken,presence:n.presence,resubscribe:t},success:()=>{i()},fail:e=>{o(e)}});Kc.Socket.e(s)}))}unsubscribe(e){nl.validateChannel(e.channel,"channel"),e.channel=e.channel.toString();const t=this.findSubscriptionByChannel(e.channel);if(!t)return void e.onFailed({code:400,content:"channel["+e.channel+"] is not subscribed"});let n=new Yc({name:pc.unsubscribe,params:{channel:e.channel,presence:t.options.presence},permission:Jc.READ,singleTimeout:dc.commonRequestSingle,totalTimeout:dc.commonRequestTotal,success:()=>{e.onSuccess({code:200,content:"ok"}),this.removeChannel(e.channel)},fail:function(t){e.onFailed({code:t.resultCode,content:t.content})}});Kc.Socket.e(n)}removeChannel(e){for(let t=this.subscriptions.length-1;t>=0;t--){const n=this.subscriptions[t].channels,i=n.indexOf(e);if(i>-1){n.splice(i,1),0===n.length&&this.subscriptions.splice(t,1);break}}}findSubscriptionByChannel(e){let t=!1,n=null;for(let i=this.subscriptions.length-1;i>=0;i--){let o=this.subscriptions[i].channels;for(let s=0;s<o.length;s++)if(o[s]==e){t=!0,n=this.subscriptions[i];break}if(t)break}return n}}class ul{get(e){nc.isFunction(e.onSuccess)||(e.onSuccess=tl),nc.isFunction(e.onFailed)||(e.onFailed=tl),nl.validateChannel(e.channel,"channel"),e.channel=e.channel.toString();let t=new Yc({name:pc.historyMessages,permission:Jc.READ,params:e,singleTimeout:dc.commonQuerySingle,totalTimeout:dc.commonQueryTotal,success:t=>{e.onSuccess({code:t.resultCode||t.code||200,content:t.content})},fail:t=>{e.onFailed({code:t.resultCode||t.code,content:t.content})}});Kc.Socket.e(t)}}class pl{constructor(){this.channelPresenceMap=new Map,this.onPresenceEvent=e=>{let t=this.channelPresenceMap.get(e.channel);null==t||t.onPresence(e)},this.expireAllChannelPresences=()=>{this.channelPresenceMap.forEach(((e,t)=>{e.expire()}))},this.resubscribe=()=>{this.channelPresenceMap.forEach(((e,t)=>{e.subscribed()&&e.doSubscribe()}))},Kc.Socket.on(al.LOST,this.expireAllChannelPresences),Kc.Socket.on(al.RECONNECTED,this.resubscribe),Kc.Socket.onMessage(rl.PS_PRESENCE_EVENT,this.onPresenceEvent)}hereNow(e){nl.validateChannel(e.channel,"channel");let t,n=this.channelPresenceMap.get(e.channel.toString());n&&n.queryPromise?(e.limit&&e.limit>n.membersLimit&&n.doQuery(e.limit),t=n.queryPromise):t=hl(e.channel,e.limit),t.then((t=>{e.onSuccess(t)})).catch((t=>{e.onFailed(t)}))}subscribe(e){if(nl.validateChannel(e.channel,"channel"),nc.isUndef(e.onPresence)||!nc.isFunction(e.onPresence))throw{code:400,content:"Subscription Presence failed. onPresence callback function is required"};let t=e.channel.toString(),n=this.channelPresenceMap.get(t);n||(n=new dl(t),this.channelPresenceMap.set(t,n)),n.subscribe(e)}unsubscribe(e){nl.validateChannel(e.channel,"channel");let t=e.channel.toString();if(this.channelPresenceMap.get(t)){let n=new Yc({name:pc.PUBSUB_PRESENCE_UNSUBSCRIBE,permission:Jc.READ,singleTimeout:dc.commonRequestSingle,totalTimeout:dc.commonRequestTotal,params:{channel:t},success:n=>{this.channelPresenceMap.delete(t),e.onSuccess()},fail:t=>{e.onFailed(t)}});Kc.Socket.e(n)}else e.onSuccess()}}class dl{constructor(e){this.membersLimit=10,this.queried=!1,this.channel=e}onPresence(e){return mc(this,void 0,void 0,(function*(){this.queried?this.update(e):yield this.queryPromise,this.on({channel:this.channel,action:e.action,member:e.member,time:e.time,amount:this.amount,members:this.membersByLimit()})}))}membersByLimit(){return this.members.slice(0,this.membersLimit)}subscribe(e){return mc(this,void 0,void 0,(function*(){if(e.membersLimit&&(this.membersLimit=Math.min(e.membersLimit,300)),!this.subscribed())try{yield this.doSubscribe()}catch(t){return void e.onFailed(t)}this.on=e.onPresence,e.onSuccess()}))}doSubscribe(){return this.doQuery(this.membersLimit),new Promise(((e,t)=>{let n=new Yc({name:pc.PUBSUB_PRESENCE_SUBSCRIBE,permission:Jc.READ,params:{channel:this.channel},singleTimeout:dc.commonRequestSingle,totalTimeout:dc.commonRequestTotal,success:t=>{e()},fail:e=>{t(e)}});Kc.Socket.e(n)}))}doQuery(e){this.queryPromise=hl(this.channel,e),this.queryPromise.then((e=>{this.members=e.content.members,this.amount=e.content.amount,this.queried=!0})).catch((e=>{throw e}))}update(e){if(["join","back"].includes(e.action))this.members.unshift(e.member);else if(["leave","timeout"].includes(e.action)){let t=this.members.findIndex((t=>t.id===e.member.id));t>-1&&this.members.splice(t,1)}this.amount=e.amount}expire(){this.queried=!1,this.queryPromise=null}subscribed(){return void 0!==this.on}}function hl(e,t){return t||(t=10),new Promise(((n,i)=>{let o={channel:e,limit:t},s=new Yc({name:pc.PUBSUB_PRESENCE_HERENOW,permission:Jc.READ,params:o,singleTimeout:dc.commonQuerySingle,totalTimeout:dc.commonQueryTotal,success:e=>{n(e)},fail:e=>{i(e)}});Kc.Socket.e(s)}))}class fl{constructor(){this.publisher=new ol,this.subscriber=new ll,this.presence2=new pl,this.histories=new ul}static init(){this.instance=new fl}publish(e){this.publisher.publish(e)}subscribe(e){this.subscriber.subscribe(e)}unsubscribe(e){this.subscriber.unsubscribe(e)}subscribePresence(e){this.presence2.subscribe(e)}unsubscribePresence(e){this.presence2.unsubscribe(e)}history(e){this.histories.get(e)}hereNow(e){this.presence2.hereNow(e)}}class ml extends Uc{static init(){return this.module=new ml,this.module.name=this.GWS_MODULE_NAME,this.initGN(),this.module}static initGN(){el.addAssembler(new class{assemble(e){return{channel:e.ch,content:e.ctt}}support(e){return!!e.ch}})}postConnect(){fl.init()}static check(){if(!this.module)throw{code:400,content:"PubSub not initialized. Please include 'PUBSUB' in the 'modules' during GoEasy initialization."}}}ml.GWS_MODULE_NAME="GWS";class gl{constructor(){}}!function(e){e.aliYun="ALI",e.qiNiu="QN",e.tencent="TX",e.s3="S3"}(cl||(cl={}));let vl=new class extends gl{constructor(){super()}upload(e,t){try{return e.storageLocation===cl.s3?this.uploadToS3(e,t):(delete e.parameters.fileRes,new Promise(((n,i)=>{Nn.uploadFile({url:e.host,filePath:this.getTempFilePath(e),name:"file",formData:e.parameters,success(e){200===e.statusCode?n():i({code:e.statusCode,content:e.errMsg})},fail(e){i({code:500,content:e.errMsg})}}).onProgressUpdate((e=>{t&&t(e)}))})))}catch(n){return new Promise(((e,t)=>{t({code:500,content:n})}))}}getTempFilePath(e){let t=e.file;return t.tempFilePath||t.fullPath||t.path}uploadToS3(e,t){return new Promise(((t,n)=>mc(this,void 0,void 0,(function*(){const i=yield this.fileToArrayBuffer(e);Nn.request({url:e.url,method:"PUT",header:e.headers,data:i,success(i){200===i.statusCode?(e.storageLocation===cl.s3&&(e.url=e.url.split("?")[0]),t()):n({code:i.statusCode,content:i.errMsg})},fail(e){n({code:500,content:e.errMsg})}})}))))}fileToArrayBuffer(e){return new Promise(((t,n)=>{const i=this.getTempFilePath(e);if("undefined"!=typeof plus)plus.io.resolveLocalFileSystemURL(i,(e=>{e.file((e=>{let i=new plus.io.FileReader;i.onloadend=e=>{const n=Nn.base64ToArrayBuffer(e.target.result.split(",")[1]);t(n)},i.onerror=function(e){n(e)},i.readAsDataURL(e)}))}),(e=>{n("Resolve file URL failed: "+e.message)}));else if("undefined"!=typeof FileReader){const i=new FileReader;i.onload=()=>{t(i.result)},i.onerror=e=>{n(e)},i.readAsArrayBuffer(e.file)}else if("object"==typeof Mn&&Mn.canIUse("getFileSystemManager"))try{const e=Mn.getFileSystemManager().readFileSync(i);t(e)}catch(o){n(o)}}))}};const yl=new class extends gl{upload(e,t){try{return e.storageLocation===cl.s3?this.uploadToS3(e,t):new Promise(((n,i)=>{Mn.uploadFile({url:e.host,filePath:this.getTempFilePath(e),name:"file",formData:e.parameters,success(e){200===e.statusCode?n():i({code:e.statusCode,content:e.errMsg})},fail(e){i({code:500,content:e.errMsg})}}).onProgressUpdate((e=>{t&&t(e)}))}))}catch(n){return new Promise(((e,t)=>{t({code:500,content:n})}))}}getTempFilePath(e){let t=e.file||e.fileRes;return t.path||t.tempFilePath}uploadToS3(e,t){return new Promise(((t,n)=>mc(this,void 0,void 0,(function*(){const i=yield this.fileToArrayBuffer(this.getTempFilePath(e));Mn.request({url:e.url,method:"PUT",header:e.headers,data:i,success(i){200===i.statusCode?(e.storageLocation===cl.s3&&(e.url=e.url.split("?")[0]),t()):n({code:i.statusCode,content:i.errMsg})},fail(e){n({code:500,content:e.errMsg})}})}))))}fileToArrayBuffer(e){return new Promise(((t,n)=>{try{t(Mn.getFileSystemManager().readFileSync(e))}catch(i){n(i)}}))}},bl=new class extends gl{constructor(){super()}upload(e,t){return new Promise(((n,i)=>{try{const o=new XMLHttpRequest,s=e.storageLocation===cl.s3,r=s?"PUT":"POST",a=s?e.url:e.host;o.open(r,a,!0);for(let t in e.headers)o.setRequestHeader(t,e.headers[t]);o.upload.onprogress=function(e){t&&t(e)},o.upload.onloadstart=function(e){t&&t(e)},o.upload.onloadend=function(e){t&&t(e)};let c=new FormData;for(let t in e.parameters)"fileRes"==t?c.append("file",e.parameters[t]):c.append(t,e.parameters[t]);const l=s?e.file:c;o.send(l),o.onreadystatechange=function(){4==o.readyState&&(o.status>=200&&o.status<300||304==o.status?(s&&(e.url=e.url.split("?")[0]),n()):i({code:o.status,content:o.responseText}))}}catch(o){i({code:500,content:o})}}))}fileToArrayBuffer(e){return new Promise(((t,n)=>{const i=new FileReader;i.onload=()=>{t(i.result)},i.onerror=e=>{n(e)},i.readAsArrayBuffer(e)}))}},xl=new class extends gl{upload(e,t){try{return e.storageLocation===cl.s3?this.uploadToS3(e,t):(delete e.parameters.fileRes,new Promise(((n,i)=>{my.uploadFile({url:e.host,filePath:this.getTempFilePath(e),fileType:"image",name:"file",formData:e.parameters,success(e){200===e.statusCode?n():i({code:e.statusCode,content:e.errMsg})},fail(e){i({code:500,content:e.errMsg})}}).onProgressUpdate((e=>{t&&t(e)}))})))}catch(n){return new Promise(((e,t)=>{t({code:500,content:n})}))}}getTempFilePath(e){let t=e.file;return t.path||t.tempFilePath}uploadToS3(e,t){return new Promise(((t,n)=>mc(this,void 0,void 0,(function*(){const i=yield this.fileToArrayBuffer(this.getTempFilePath(e));my.request({url:e.url,method:"PUT",header:e.headers,data:i,success(i){200===i.statusCode?(e.storageLocation===cl.s3&&(e.url=e.url.split("?")[0]),t()):n({code:i.statusCode,content:i.errMsg})},fail(e){n({code:500,content:e.errMsg})}})}))))}fileToArrayBuffer(e){return new Promise(((t,n)=>{my.getFileSystemManager().readFile({filePath:e,success:e=>{t(e.data)},fail(e){n(e)}})}))}},Sl=new class extends gl{upload(e,t){try{return e.storageLocation===cl.s3?this.uploadToS3(e,t):(delete e.parameters.fileRes,new Promise(((n,i)=>{swan.uploadFile({url:e.host,filePath:this.getTempFilePath(e),name:"file",formData:e.parameters,success(e){200===e.statusCode?n():i({code:e.statusCode,content:e.errMsg})},fail(e){i({code:500,content:e.errMsg})}}).onProgressUpdate((e=>{t&&t(e)}))})))}catch(n){return new Promise(((e,t)=>{t({code:500,content:n})}))}}getTempFilePath(e){let t=e.file;return t.path||t.tempFilePath}uploadToS3(e,t){return new Promise(((t,n)=>mc(this,void 0,void 0,(function*(){const i=yield this.fileToArrayBuffer(this.getTempFilePath(e));swan.request({url:e.url,method:"PUT",header:e.headers,data:i,success(i){200===i.statusCode?(e.storageLocation===cl.s3&&(e.url=e.url.split("?")[0]),t()):n({code:i.statusCode,content:i.errMsg})},fail(e){n({code:500,content:e.errMsg})}})}))))}fileToArrayBuffer(e){return new Promise(((t,n)=>{swan.getFileSystemManager().readFile({filePath:e,success:e=>{t(e.data)},fail:e=>{n(e)}})}))}};class kl{constructor(e,t,n){this.storageLocation=e,this.url=t,this.name=n}}const Cl=new class{constructor(){this.uploader={[Va.UNIAPP]:vl,[ic.MP_WX]:yl,[ic.BROWSER]:bl,[ic.MP_ALI]:xl,[ic.MP_BAIDU]:Sl,[Va.REACT_NATIVE]:bl,[ic.MP_BYTE]:yl}}upload(e,t){return mc(this,void 0,void 0,(function*(){const n=Xa.currentFramework(),i=oc.currentPlatform(),o=n===Va.UNKNOWN?i:n;let s=this.uploader[o];return yield s.upload(e,t),new kl(e.storageLocation,e.url,e.newFileName)}))}};class wl{resolve(e){return new Promise(((t,n)=>{let i=new Yc({name:"uploadToken",params:{filename:e},permission:Jc.WRITE,singleTimeout:dc.commonRequestSingle,totalTimeout:dc.commonRequestTotal,fail(e){n(e.content)},success(e){200===e.code?t(e.content):n(e.content)}});Kc.Socket.e(i)}))}}class El{constructor(e,t,n,i,o,s,r){this.storageLocation=e,this.host=t,this.headers=n,this.parameters=i,this.file=o,this.newFileName=s,this.url=r}}class Tl{constructor(){}newFileName(e){return e&&e.newFilename||""}}let Il=new class extends Tl{constructor(){super()}url(e){return e.host+"/"+e.dir+"/"+this.newFileName(e)}build(e,t,n){let i,o=this.newFileName(e);return i={key:e.dir+"/"+o,OSSAccessKeyId:e.accessKeyId,policy:e.policy,signature:e.signature,success_action_status:"200",fileRes:t},n&&(i={key:e.dir+"/"+o,OSSAccessKeyId:e.accessKeyId,policy:e.policy,signature:e.signature,success_action_status:"200","Content-Disposition":"attachment;filename="+t.name,fileRes:t}),new El(cl.aliYun,e.host,null,i,t,o,this.url(e))}},_l=new class extends Tl{constructor(){super()}url(e){return e.host+"/"+e.key}build(e,t,n){let i={"q-sign-algorithm":e.qSignAlgorithm,"q-ak":e.qAk,"q-key-time":e.qKeyTime,"q-signature":e.qSignature,policy:e.policy,"x-cos-security-token":e.xCosSecurityToken,success_action_status:"200",key:e.key,fileRes:t};return n&&(i={"q-sign-algorithm":e.qSignAlgorithm,"q-ak":e.qAk,"q-key-time":e.qKeyTime,"q-signature":e.qSignature,policy:e.policy,"x-cos-security-token":e.xCosSecurityToken,success_action_status:"200",key:e.key,"Content-Disposition":`attachment;filename=${t.name}`,fileRes:t}),new El(cl.tencent,e.host,null,i,t,e.key,this.url(e))}},Ol=new class extends Tl{constructor(){super()}url(e){return e.uploadUrl}build(e,t,n){const i={file:t};return new El(cl.s3,null,{"Content-Type":"application/octet-stream"},i,t,t.name,this.url(e))}};class Al{constructor(){this.uploadTokenResolver=new wl}builder(e){if(e===cl.aliYun)return Il;if(e===cl.tencent)return _l;if(e===cl.s3)return Ol;throw new Error("Only Ali OSS and Tencent COS are supported, unknown storage location:"+e)}build(e,t,n){return mc(this,void 0,void 0,(function*(){try{let i=yield this.uploadTokenResolver.resolve(t),o=this.builder(i.vendor).build(i,e,n);return Promise.resolve(o)}catch(i){return Promise.reject(i)}}))}}class Rl{constructor(){this.requestBuilder=new Al,this.fileUploader=Cl}upload(e,t,n,i){return mc(this,void 0,void 0,(function*(){try{let o=yield this.requestBuilder.build(e,t,i);return this.fileUploader.upload(o,n)}catch(o){return Promise.reject(o)}}))}}var Pl,Ml,Nl,Dl;!function(e){e.MESSAGE_SENDING="IM_INTERNAL_MESSAGE_SENDING",e.MESSAGE_SEND_SUCCESS="IM_INTERNAL_MESSAGE_SEND_SUCCESS",e.MESSAGE_SEND_FAILED="IM_INTERNAL_MESSAGE_SEND_FAILED",e.MESSAGE_RECEIVED="IM_INTERNAL_MESSAGE_RECEIVED",e.MESSAGE_RECALLED="IM_INTERNAL_MESSAGE_RECALLED",e.MAX_MESSAGE_CHANGED="IM_INTERNAL_MAX_MESSAGE_CHANGED",e.MAX_MESSAGE_DELETED="IM_INTERNAL_MAX_MESSAGE_DELETED",e.UNREAD_AMOUNT_CHANGED="IM_INTERNAL_UNREAD_MESSAGE_CHANGED",e.CS_ONLINE_SUCCESS="CS_ONLINE_SUCCESS",e.CS_OFFLINE_SUCCESS="CS_OFFLINE_SUCCESS",e.CS_ACCEPTED="CS_ACCEPTED",e.CS_ENDED="CS_ENDED",e.CS_TRANSFER="CS_TRANSFER",e.CS_AGENT_MESSAGE_RECEIVED="CS_AGENT_MESSAGE_RECEIVED"}(Pl||(Pl={}));class Bl{clearUseLessAttribute(){delete this.buildOptions}isOtherSent(){return this.senderId!==Kc.Socket.user().id}getToData(){return this.buildOptions.createOptions.to.data}}class Ll{}!function(e){e.TEXT="text",e.IMAGE="image",e.FILE="file",e.VIDEO="video",e.AUDIO="audio"}(Ml||(Ml={}));class jl extends Ll{constructor(){super(...arguments),this.goEasyUploader=new Rl}improve(e){let t=e.message;return new Promise(((e,n)=>{let i,o,s=t.buildOptions.createOptions;t.type===Ml.VIDEO?(o=t.payload,i=o.video.name):(o=t.payload,i=o.name),this.goEasyUploader.upload(s.file,i,s.onProgress,t.type===Ml.FILE).then((n=>{n.storageLocation!==cl.s3&&(n.url=encodeURI(n.url)),this.setPayload(n,t),e()})).catch((e=>{n(e)}))}))}setPayload(e,t){t.payload.url=e.url}}class Ul extends jl{setPayload(e,t){let n,i=t.payload;switch(i.video.url=e.url,i.video.name=e.name,i.thumbnail.height>200&&(i.thumbnail.height=200,i.thumbnail.width=200*i.video.width/i.video.height),e.storageLocation){case cl.aliYun:n="?x-oss-process=video/snapshot,t_0000,f_jpg,h_"+i.thumbnail.height+",m_fast,ar_auto";break;case cl.tencent:n="?ci-process=snapshot&time=1&format=jpg&height="+i.thumbnail.height;break;case cl.s3:n="?process=video&height="+i.thumbnail.height;break;default:throw new Error("Only Ali OSS and Tencent COS are supported, unknown storage location:"+e.storageLocation)}i.thumbnail.url=e.url+n}}class Fl extends jl{setPayload(e,t){let n,i=t.payload;i.url=e.url;const o=i.height>200?200:i.height;switch(e.storageLocation){case cl.aliYun:n="?x-oss-process=image/resize,m_lfit,h_"+o;break;case cl.tencent:n=`?imageMogr2/thumbnail/x${o}`;break;case cl.s3:n=`?process=image&height=${o}`;break;default:throw new Error("Only Ali OSS and Tencent COS are supported, unknown storage location:"+e.storageLocation)}i.thumbnail=e.url+n}}class Gl{constructor(){this.improvers={[Ml.FILE]:new jl,[Ml.AUDIO]:new jl,[Ml.IMAGE]:new Fl,[Ml.VIDEO]:new Ul}}improve(e){let t=this.improvers[e.message.type];if(t)try{return t.improve(e)}catch(n){return Promise.reject(n)}return Promise.resolve()}}class ql extends zc{static init(){this.i=new ql}}class zl{constructor(e,t,n,i,o){this.validate(e),this.mt=e.type,this.to=t.id.toString(),this.d=JSON.stringify(t.data),this.p=JSON.stringify(e.payload),n&&(this.nt=n),o&&(this.at=o),i&&(this.wxmpTemplateMsg=il(i),this.wxmpTemplateMsg.data=JSON.stringify(this.wxmpTemplateMsg.data));let s=t.type;if(this.t=s,s===Ya.CS){let t=e;this.tid=t.teamId}this.guid=e.messageId}validate(e){if(e.type===Ml.TEXT&&JSON.stringify(e.payload).length>3072)throw Error("message-length limit 3kb")}}class Hl{constructor(){this.payloadImprover=new Gl}send(e){this.validate(e);let t=e.message,n=e.accessToken,i=t.buildOptions,o=i.createOptions,s=o.notification,r=o.wxmpTemplateMsg,a=o.to;a.data||(a.data={}),t.status=Za.SENDING;let c=i.complete,l=this.payloadImprover.improve(e);Promise.all([c,l]).then((()=>mc(this,void 0,void 0,(function*(){if(o.beforeSend){const e=JSON.parse(JSON.stringify(t));yield o.beforeSend(e)}this.doSend(t,a,s,r,n,e)})))).catch((n=>{t.status=Za.FAIL,fc.onFailed(e,{code:n&&n.code||400,content:n&&n.content||n})}))}doSend(e,t,n,i,o,s){let r=new zl(e,t,n,i,o);ql.i.fire(Pl.MESSAGE_SENDING,e);let a=new Yc({name:pc.publishIM,params:r,unique:!0,permission:Jc.WRITE,singleTimeout:dc.commonRequestSingle,totalTimeout:dc.commonRequestTotal,fail:t=>{e.status=Za.FAIL,ql.i.fire(Pl.MESSAGE_SEND_FAILED,e),fc.onFailed(s,{code:t.resultCode,content:t.content})},success:t=>{if(e.status=Za.SUCCESS,e.timestamp=t.content.timestamp,e.messageId=JSON.stringify(t.content.id),e.scene()===Ya.CS){let n=e;n.customerId()!==Kc.Socket.user().id&&(n.sessionId=t.content.sessionId)}e.clearUseLessAttribute(),ql.i.fire(Pl.MESSAGE_SEND_SUCCESS,e),fc.onSuccess(s,e)}});Kc.Socket.e(a)}validate(e){let t=e.message;if(!(t instanceof Bl))throw new Error("it is invalid message");if(t.status!==Za.NEW)throw new Error("Please create a new message, a message can only be sent once")}}class $l{insert(e,t){let n=this.binarySearch(e,t);if(n>=0)e.splice(n,1,t);else{let i=-n-1;e.splice(i,0,t)}}binarySearch(e,t){let n=0,i=e.length-1;for(;n<=i;){let o=i+n>>1,s=this.compare(t,e[o]);if(s>0)n=o+1;else{if(!(s<0))return o;i=o-1}}return-n-1}}class Vl{constructor(e){this.messages=new Array,this.allLoaded=!1,this.target=e}all(){return this.messages}sliceOverLengthMessages(){this.messages.length>Vl.CACHE_MAX_LENGTH&&(this.messages=this.messages.slice(-Vl.CACHE_MAX_LENGTH),!0===this.allLoaded&&(this.allLoaded=!1))}getMaxMessage(){return this.messages[this.messages.length-1]}loadLocalMessages(e,t){let n=[],i=this.messages.length;if(t){if(i>0){let o=this.messages[0].timestamp,s=this.messages[i-1].timestamp;if(t>=o&&t<=s)for(let r=i-1;r>=0;r--){let i=this.messages[r];if(i.timestamp<t){if(!(n.length<e))break;n.unshift(i)}}}}else n=this.messages.slice(-e);return n}cacheServerMessages(e,t){let n=this.messages[0];this.messages.length<Vl.CACHE_MAX_LENGTH&&(!e.lastTimestamp||this.messages.length>0&&n.timestamp===e.lastTimestamp)&&(t.forEach((e=>{Vl.sortedInserter.insert(this.messages,e)})),t.length<e.limit&&(this.allLoaded=!0))}findMessageByTime(e){return this.messages.find((t=>e===t.timestamp))}findMessagesByTimes(e){let t=[];return e.forEach((e=>{let n=this.findMessageByTime(e);nc.isDef(n)&&t.push(n)})),t}existsMessage(e){return this.findMessageIndexById(e)>-1}findMessageIndexById(e){return this.messages.findIndex((t=>e===t.messageId))}deleteMessage(e){let t=this.findMessageIndexById(e);t>=0&&this.messages.splice(t,1)}recallMessage(e){return e.times.map((e=>this.findMessageByTime(e))).filter((e=>nc.isDef(e))).map((t=>(t.recalled=!0,t.recaller=e.recaller,t)))}isEmpty(){return 0===this.messages.length}deleteMessages(e){e.forEach((e=>{this.deleteMessage(e.messageId)}))}saveMessage(e){Vl.sortedInserter.insert(this.messages,e),this.deleteGroupConversationMessage(),this.sliceOverLengthMessages()}deleteGroupConversationMessage(){this.target.scene===Ya.GROUP&&this.messages.length>=2&&1===this.messages[0].x&&this.messages.shift()}maxSuccessMessageTime(){for(let e=this.messages.length-1;e>=0;e--)if(this.messages[e].status===Za.SUCCESS)return this.messages[e].timestamp;return 0}minTime(){return this.isEmpty()?0:this.messages[0].timestamp}correctPosition(e){this.deleteMessage(e.messageId),this.saveMessage(e)}}Vl.CACHE_MAX_LENGTH=200,Vl.sortedInserter=new class extends $l{compare(e,t){let n=e.timestamp-t.timestamp;return n>0?1:0===n?0:-1}};class Kl{constructor(e,t,n){this.scene=e,this.id=t,nc.isDef(n)&&(this.teamId=n)}toString(){return Ya.PRIVATE===this.scene||Ya.GROUP===this.scene?this.scene+"#"+this.id:this.scene+"#"+this.id+"#"+this.teamId}customerId(){if(Ya.CS===this.scene)return this.id===this.teamId?Kc.Socket.user().id:this.id}static byScene(e,t,n){return new Kl(e,t,n)}static byIMMessage(e){let t,n,i=e.scene();if(i===Ya.PRIVATE){let t=e.senderId,i=e.targetId();n=Kc.Socket.user().id===t?i:t}else if(i===Ya.GROUP)n=e.targetId();else{if(i!==Ya.CS)throw{code:400,content:`scene ${i} not exists`};n=e.targetId(),t=e.teamId}return new Kl(i,n,t)}static byMessageReadRemoteEvent(e){let t,n=e.scene,i=e.targetId,o=e.markerId,s=e.teamId;return n===Ya.PRIVATE?t=Kc.Socket.user().id===o?i:o:n===Ya.GROUP?t=i:n===Ya.CS&&(t=i===s?o===Kc.Socket.user().id?s:o:o===Kc.Socket.user().id?i:s),new Kl(n,t,s)}static byIMMessageDeletedEvent(e){let t=e.scene,n=e.deleterId;if(t===Ya.PRIVATE){let i=Kc.Socket.user().id===n?e.targetId:n;return new Kl(t,i)}if(t===Ya.GROUP)return new Kl(t,e.targetId)}static byConversationDTO(e){let t=e.lastMessage;return this.byIMMessage(t)}static byConversationId(e,t){let n;if(e===Ya.PRIVATE){let e=t.split(":",2);n=e[0]===Kc.Socket.user().id?e[1]:e[0]}else n=t;return new Kl(e,n)}}class Wl{constructor(e){this.times=new Array;let t=e[0],n=Kl.byIMMessage(t);this.scene=n.scene,this.targetId=n.id,e.forEach((e=>{e.status===Za.SUCCESS&&this.times.push(e.timestamp)})),this.times.sort(((e,t)=>e<t?-1:e==t?0:1))}}class Xl{static deleteServerMessages(e){let t=new Wl(e);return t.times.length<0?Promise.resolve():new Promise(((e,n)=>{let i=new Yc({name:pc.IM_DELETE_MESSAGE,params:t,permission:Jc.WRITE,singleTimeout:dc.commonQuerySingle,totalTimeout:dc.commonQueryTotal,success:t=>{200===t.code?e(t):n(t)},fail:e=>{n(e)}});Kc.Socket.e(i)}))}static validate(e){let t=e.messages;for(let n=0;n<t.length;n++){let e=t[n];if(e.status===Za.SENDING)throw{code:400,content:"message["+n+"] is '"+e.status+"' and cannot be deleted"}}}}class Jl{constructor(e,t,n,i,o){this.scene=e,this.id=t,this.after=n,this.min=i,this.teamId=o}}class Ql{constructor(e,t,n,i){this.id=e,this.scene=t,this.lastTimestamp=n,this.teamId=i}}class Yl extends Bl{constructor(){super(...arguments),this.read=!1}scene(){return Ya.PRIVATE}targetId(){return this.receiverId}}class Zl extends Bl{scene(){return Ya.GROUP}targetId(){return this.groupId}}class eu extends Bl{constructor(){super(...arguments),this.accepted=!1}scene(){return Ya.CS}targetId(){return Kc.Socket.user().id===this.customerId()?this.teamId:this.customerId()}sendByCustomer(){return this.to===this.teamId}customerId(){return this.sendByCustomer()?this.senderId:this.to}isOtherSent(){return Kc.Socket.user().id===this.customerId()?this.senderId!==Kc.Socket.user().id:this.senderId===this.customerId()}}!function(e){e.ACCEPT="CS_ACCEPT",e.END="CS_END",e.TRANSFER="CS_TRANSFER"}(Nl||(Nl={}));class tu{build(e){let t,n=e.t;n===Ya.PRIVATE?(t=new Yl,t.read=!1,t.receiverId=e.r):n===Ya.GROUP?(t=new Zl,t.groupId=e.r,t.senderData=e.d?JSON.parse(e.d):{}):n===Ya.CS&&(t=new eu,t.to=e.r,t.teamId=e.tid,t.senderData=e.d?JSON.parse(e.d):{},t.accepted=e.accepted,t.customerId()!==Kc.Socket.user().id&&(t.sessionId=e.sessionId)),t.senderId=e.s,t.messageId=e.i,t.timestamp=e.ts,t.type=e.mt;let i=e.p;if(nc.isDef(i))if(n===Ya.CS&&t.type===Nl.TRANSFER){let e=JSON.parse(i);e.transferTo.data=JSON.parse(e.transferTo.data),t.payload=e}else t.payload=JSON.parse(i);let o=e.rc;return nc.isDef(o)&&!0===o?(t.recalled=o,t.recaller=e.recaller):t.recalled=!1,t.status=Za.SUCCESS,t}}class nu{constructor(){this.builder=new tu}sync(e,t,n,i,o){let s=new Jl(e,t,n,i,o);return new Promise(((e,t)=>{let n=new Yc({name:pc.IM_HISTORY_CHANGE,params:s,permission:Jc.READ,singleTimeout:dc.commonQuerySingle,totalTimeout:dc.commonQueryTotal,fail:e=>{t(e)},success:t=>{let n=t.content;e(n)}});Kc.Socket.e(n)}))}loadServerMessages(e,t){return new Promise(((n,i)=>{let o=new Yc({name:pc.IM_HISTORY,params:t,permission:Jc.READ,singleTimeout:dc.commonQuerySingle,totalTimeout:dc.commonQueryTotal,fail:e=>{i(e)},success:t=>{let i=t.content;i.messages=this.convertServerMessages(e,i.messages),n(i)}});Kc.Socket.e(o)}))}convertServerMessages(e,t){let n=[],i=e.scene,o=e.id;return t.forEach((t=>{if(t.t=i,Ya.PRIVATE===i)t.r=t.s===Kc.Socket.user().id?o:Kc.Socket.user().id;else if(Ya.GROUP===i)t.r=o;else if(Ya.CS===i){let n=e.customerId(),i=e.teamId;n===Kc.Socket.user().id?t.r=i:t.r=n}let s=this.builder.build(t);n.push(s)})),n}updateServerOffsets(e,t){return mc(this,void 0,void 0,(function*(){let n=new Ql(t.id,t.scene,e,t.teamId);return new Promise(((e,t)=>{let i=new Yc({name:pc.IM_MARK_AS_READ,params:n,permission:Jc.WRITE,singleTimeout:dc.commonRequestSingle,totalTimeout:dc.commonRequestTotal,success:t=>{e(t)},fail:e=>{t(e)}});Kc.Socket.e(i)}))}))}}nu.instance=new nu;class iu{constructor(){this.offsetMap=new Map,this.markingTime=0,this.userId=Kc.Socket.user().id}updateOffset(e,t){let n=this.offsetMap.get(e);return nc.isDef(n)?t>n&&(this.offsetMap.set(e,t),!0):(this.offsetMap.set(e,t),!0)}updateUserOffsets(e){e.forEach((e=>{let t=e.userId,n=e.offset;this.updateOffset(t,n)}))}updateMyOffset(e){return this.updateOffset(this.userId,e)}myOffset(){return this.getOffset(this.userId)}getOffset(e){return this.offsetMap.get(e)||0}}class ou{constructor(e,t,n,i,o){this.id=e,this.scene=t,this.lastTimestamp=n,this.limit=i,this.teamId=o}}class su{constructor(e){this.history=e}pre(){this.oldLastMessage=this.history.getMaxMessage(),this.oldUnreadAmount=this.history.unreadAmount(),this.oldLastMessage&&(this.oldLastMessageRecalled=this.oldLastMessage.recalled,this.oldLastMessageRead=this.oldLastMessage.read,this.oldLastMessageStatus=this.oldLastMessage.status)}post(){let e,t,n,i=this.history.unreadAmount(),o=this.history.getMaxMessage();o&&(n=o.status,e=o.read,t=o.recalled);let s=this.history.target;this.oldLastMessage!==o||this.oldLastMessageRead!==e||this.oldLastMessageRecalled!==t||this.oldLastMessageStatus!==n?o?ql.i.fire(Pl.MAX_MESSAGE_CHANGED,o):ql.i.fire(Pl.MAX_MESSAGE_DELETED,s):this.oldUnreadAmount!==i&&ql.i.fire(Pl.UNREAD_AMOUNT_CHANGED,s)}}class ru{constructor(e,t,n,i){this.scene=e,this.conversationId=t,this.recaller=n,this.times=i}}class au{static init(){this.eventCenter=new Vc}static on(e,t){this.eventCenter.on(e,t)}static fire(e,t){this.eventCenter.fire(e,t)}static off(e,t){this.eventCenter.off(e,t)}}!function(e){e.PRIVATE_MESSAGE_RECEIVED="PRIVATE_MESSAGE_RECEIVED",e.GROUP_MESSAGE_RECEIVED="GROUP_MESSAGE_RECEIVED",e.SYSTEM_MESSAGE_RECEIVED="SYSTEM_MESSAGE_RECEIVED",e.CONVERSATIONS_UPDATED="CONVERSATIONS_UPDATED",e.HISTORY_EXPIRED="HISTORY_EXPIRED",e.USER_PRESENCE="USER_PRESENCE",e.GROUP_PRESENCE="GROUP_PRESENCE",e.MESSAGE_DELETED="MESSAGE_DELETED",e.MESSAGE_READ="MESSAGE_READ",e.MESSAGE_RECALLED="MESSAGE_RECALLED",e.CS_MESSAGE_RECEIVED="CS_MESSAGE_RECEIVED",e.PENDING_CONVERSATIONS_UPDATED="PENDING_CONVERSATIONS_UPDATED"}(Dl||(Dl={}));class cu{constructor(e){this.expiredTime=0,this.remoteHistory=nu.instance,this.target=e,this.userOffsets=new iu,this.messageCache=new Vl(e)}initMaxMessageAndOffsets(e,t){this.existsMessage(e)||(this.messageCache.saveMessage(e),t.forEach((e=>{this.markLocalMessagesRead(this.messageCache.all(),e.userId,e.offset,!1)})))}existsMessage(e){return this.messageCache.existsMessage(e.messageId)}loadHistory(e,t){return mc(this,void 0,void 0,(function*(){return this.expiredTime>0&&!this.messageCache.isEmpty()&&(yield this.updateByServerChange()),nc.isUndef(t)?t=10:t>30&&(t=30),yield this.loadServerMessages(e,t)}))}loadServerMessages(e,t){return mc(this,void 0,void 0,(function*(){let n=this.messageCache.loadLocalMessages(t,e);if(!1===this.messageCache.allLoaded&&n.length!==t){let i=t-n.length,o=n[0]?n[0].timestamp:e,s=new ou(this.target.id.toString(),this.target.scene,o,i,this.target.teamId),r=yield this.remoteHistory.loadServerMessages(this.target,s),a=r.messages;n=a.concat(n),this.messageCache.cacheServerMessages(s,a),r.userOffsets.forEach((e=>{this.userOffsets.updateOffset(e.userId,e.offset)})),this.userOffsets.offsetMap.forEach(((e,t)=>{this.markLocalMessagesRead(a,t,e,!1)}))}return n}))}deleteMessages(e){return mc(this,void 0,void 0,(function*(){yield this.aopUnreadAmountMaxMessage((()=>mc(this,void 0,void 0,(function*(){let t=e.messages;yield Xl.deleteServerMessages(t),this.messageCache.deleteMessages(t),fc.onSuccess(e)}))))}))}syncDeletedMessage(e,t){this.aopUnreadAmountMaxMessage((()=>{this.doSyncDeletedMessage(e,t)}))}doSyncDeletedMessage(e,t){if(e===Kc.Socket.user().id){let e=this.messageCache.findMessagesByTimes(t);this.messageCache.deleteMessages(e),e.length>0&&au.fire(Dl.MESSAGE_DELETED,e)}}recallMessages(e){return mc(this,void 0,void 0,(function*(){yield this.aopUnreadAmountMaxMessage((()=>mc(this,void 0,void 0,(function*(){this.doRecall(e)}))))}))}doRecall(e){let t=this.messageCache.recallMessage(e);t.length>0&&au.fire(Dl.MESSAGE_RECALLED,t)}expire(){this.messageCache.isEmpty()||(this.expiredTime=this.messageCache.maxSuccessMessageTime())}updateByServerChange(){return mc(this,void 0,void 0,(function*(){yield this.aopUnreadAmountMaxMessage((()=>mc(this,void 0,void 0,(function*(){let e=yield this.remoteHistory.sync(this.target.scene,this.target.id,this.expiredTime,this.messageCache.minTime(),this.target.teamId);e.userOffsets.forEach((e=>{this.markLocalMessagesRead(this.messageCache.all(),e.userId,e.offset,!0)}));let t=e.deletedMessageTimes;t.length>0&&this.doSyncDeletedMessage(Kc.Socket.user().id,t);let n=e.recalledMessages;n.length>0&&n.forEach((e=>{let t=new ru(this.target.scene,this.target.id,e.recaller,e.times);this.doRecall(t)})),this.expiredTime=0}))))}))}markRead(){return mc(this,void 0,void 0,(function*(){yield this.aopUnreadAmountMaxMessage((()=>mc(this,void 0,void 0,(function*(){let e=this.messageCache.maxSuccessMessageTime();e>this.userOffsets.myOffset()&&(this.userOffsets.markingTime=e,yield this.remoteHistory.updateServerOffsets(e,this.target),e===this.userOffsets.markingTime&&this.markLocalMessagesRead(this.messageCache.all(),Kc.Socket.user().id,e,!0))}))))}))}syncMarkedMessage(e){this.aopUnreadAmountMaxMessage((()=>{this.markLocalMessagesRead(this.messageCache.all(),e.markerId,e.time,!0)}))}onMessageSending(e){this.aopUnreadAmountMaxMessage((()=>{this.messageCache.saveMessage(e)}))}onMessageSendSuccess(e){this.aopUnreadAmountMaxMessage((()=>{this.messageCache.correctPosition(e),this.markLocalMessagesRead(this.messageCache.all(),Kc.Socket.user().id,e.timestamp,!0)}))}onMessageSendFailed(e){this.getMaxMessage()===e&&ql.i.fire(Pl.MAX_MESSAGE_CHANGED,e)}onMessageReceived(e){this.aopUnreadAmountMaxMessage((()=>{this.messageCache.saveMessage(e),this.markLocalMessagesRead(this.messageCache.all(),e.senderId,e.timestamp,!0)}))}aopUnreadAmountMaxMessage(e,t){return mc(this,void 0,void 0,(function*(){try{let t=new su(this);t.pre(),yield e(),t.post()}catch(n){fc.onFailed(t,n)}}))}markLocalMessagesRead(e,t,n,i){if(this.userOffsets.updateOffset(t,n),this.isOtherUserId(t)){let t=this.markMySentRead(e,n);i&&t.length>0&&au.fire(Dl.MESSAGE_READ,t)}else t===Kc.Socket.user().id&&this.markOthersSentRead(e,n)}markOthersSentRead(e,t){if(this.target.scene===Ya.PRIVATE)for(let n=e.length-1;n>=0;n--){let i=e[n];if(i.isOtherSent()&&i.timestamp<=t){if(i.read)break;i.read=!0}}}markMySentRead(e,t){let n=new Array;if(this.target.scene===Ya.PRIVATE)for(let i=e.length-1;i>=0;i--){let o=e[i];if(!o.isOtherSent()&&o.timestamp<=t&&o.status===Za.SUCCESS){if(o.read)break;o.read=!0,n.push(o)}}return n}isOtherUserId(e){if(this.target.scene===Ya.CS){let t=this.target.customerId();return Kc.Socket.user().id===t?e!==Kc.Socket.user().id:e===t}return e!==Kc.Socket.user().id}unreadAmount(e){let t=0,n=this.userOffsets.myOffset(),i=this.messageCache.all();for(const o of i)o.isOtherSent()&&!1===o.recalled&&o.timestamp>n&&(t+=1);return t}getMaxMessage(e){return this.messageCache.getMaxMessage()}maxTime(e){let t=this.getMaxMessage();return nc.isDef(t)?t.timestamp:0}}class lu{constructor(e,t){this.teamId=e,this.customerId=t}}class uu{}class pu{constructor(e,t,n){this.teamId=e,this.teamData=JSON.stringify(t),this.agentData=JSON.stringify(n)}}class du{constructor(e){this.teamId=e}}class hu{constructor(e){this.teamId=e}}var fu={exports:{}},mu=/^(?:(?![^:@]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@]*)(?::([^:@]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,gu=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"],vu=function(e){var t=e,n=e.indexOf("["),i=e.indexOf("]");-1!=n&&-1!=i&&(e=e.substring(0,n)+e.substring(n,i).replace(/:/g,";")+e.substring(i,e.length));for(var o=mu.exec(e||""),s={},r=14;r--;)s[gu[r]]=o[r]||"";return-1!=n&&-1!=i&&(s.source=t,s.host=s.host.substring(1,s.host.length-1).replace(/;/g,":"),s.authority=s.authority.replace("[","").replace("]","").replace(/;/g,":"),s.ipv6uri=!0),s},yu={exports:{}},bu={exports:{}},xu=1e3,Su=6e4,ku=60*Su,Cu=24*ku,wu=function(e,t){t=t||{};var n,i=typeof e;if("string"===i&&e.length>0)return function(e){if(!((e=String(e)).length>100)){var t=/^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(e);if(t){var n=parseFloat(t[1]);switch((t[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return 315576e5*n;case"days":case"day":case"d":return n*Cu;case"hours":case"hour":case"hrs":case"hr":case"h":return n*ku;case"minutes":case"minute":case"mins":case"min":case"m":return n*Su;case"seconds":case"second":case"secs":case"sec":case"s":return n*xu;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return n;default:return}}}}(e);if("number"===i&&!1===isNaN(e))return t.long?Eu(n=e,Cu,"day")||Eu(n,ku,"hour")||Eu(n,Su,"minute")||Eu(n,xu,"second")||n+" ms":function(e){return e>=Cu?Math.round(e/Cu)+"d":e>=ku?Math.round(e/ku)+"h":e>=Su?Math.round(e/Su)+"m":e>=xu?Math.round(e/xu)+"s":e+"ms"}(e);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))};function Eu(e,t,n){if(!(e<t))return e<1.5*t?Math.floor(e/t)+" "+n:Math.ceil(e/t)+" "+n+"s"}!function(e,t){function n(e){var n;function o(){if(o.enabled){var e=o,i=+new Date,s=i-(n||i);e.diff=s,e.prev=n,e.curr=i,n=i;for(var r=new Array(arguments.length),a=0;a<r.length;a++)r[a]=arguments[a];r[0]=t.coerce(r[0]),"string"!=typeof r[0]&&r.unshift("%O");var c=0;r[0]=r[0].replace(/%([a-zA-Z%])/g,(function(n,i){if("%%"===n)return n;c++;var o=t.formatters[i];if("function"==typeof o){var s=r[c];n=o.call(e,s),r.splice(c,1),c--}return n})),t.formatArgs.call(e,r),(o.log||t.log||console.log.bind(console)).apply(e,r)}}return o.namespace=e,o.enabled=t.enabled(e),o.useColors=t.useColors(),o.color=function(e){var n,i=0;for(n in e)i=(i<<5)-i+e.charCodeAt(n),i|=0;return t.colors[Math.abs(i)%t.colors.length]}(e),o.destroy=i,"function"==typeof t.init&&t.init(o),t.instances.push(o),o}function i(){var e=t.instances.indexOf(this);return-1!==e&&(t.instances.splice(e,1),!0)}(t=bu.exports=n.debug=n.default=n).coerce=function(e){return e instanceof Error?e.stack||e.message:e},t.disable=function(){t.enable("")},t.enable=function(e){var n;t.save(e),t.names=[],t.skips=[];var i=("string"==typeof e?e:"").split(/[\s,]+/),o=i.length;for(n=0;n<o;n++)i[n]&&("-"===(e=i[n].replace(/\*/g,".*?"))[0]?t.skips.push(new RegExp("^"+e.substr(1)+"$")):t.names.push(new RegExp("^"+e+"$")));for(n=0;n<t.instances.length;n++){var s=t.instances[n];s.enabled=t.enabled(s.namespace)}},t.enabled=function(e){if("*"===e[e.length-1])return!0;var n,i;for(n=0,i=t.skips.length;n<i;n++)if(t.skips[n].test(e))return!1;for(n=0,i=t.names.length;n<i;n++)if(t.names[n].test(e))return!0;return!1},t.humanize=wu,t.instances=[],t.names=[],t.skips=[],t.formatters={}}(0,bu.exports),function(e,t){function n(){var e;try{e=t.storage.debug}catch(n){}return!e&&"undefined"!=typeof process&&"env"in process&&(e=process.env.DEBUG),e}(t=e.exports=bu.exports).log=function(){return"object"==typeof console&&console.log&&Function.prototype.apply.call(console.log,console,arguments)},t.formatArgs=function(e){var n=this.useColors;if(e[0]=(n?"%c":"")+this.namespace+(n?" %c":" ")+e[0]+(n?"%c ":" ")+"+"+t.humanize(this.diff),n){var i="color: "+this.color;e.splice(1,0,i,"color: inherit");var o=0,s=0;e[0].replace(/%[a-zA-Z%]/g,(function(e){"%%"!==e&&(o++,"%c"===e&&(s=o))})),e.splice(s,0,i)}},t.save=function(e){try{null==e?t.storage.removeItem("debug"):t.storage.debug=e}catch(n){}},t.load=n,t.useColors=function(){return!("undefined"==typeof window||!window.process||"renderer"!==window.process.type)||("undefined"==typeof navigator||!navigator.userAgent||!navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))&&("undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/))},t.storage="undefined"!=typeof chrome&&void 0!==chrome.storage?chrome.storage.local:function(){try{return window.localStorage}catch(e){}}(),t.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"],t.formatters.j=function(e){try{return JSON.stringify(e)}catch(t){return"[UnexpectedJSONParseError]: "+t.message}},t.enable(n())}(yu,yu.exports);var Tu=vu,Iu=yu.exports("socket.io-client:url"),_u=function(e,t){var n=e;t=t||"undefined"!=typeof location&&location,null==e&&(e=t.protocol+"//"+t.host),"string"==typeof e&&("/"===e.charAt(0)&&(e="/"===e.charAt(1)?t.protocol+e:t.host+e),/^(https?|wss?):\/\//.test(e)||(Iu("protocol-less url %s",e),e=void 0!==t?t.protocol+"//"+e:"https://"+e),Iu("parse %s",e),n=Tu(e)),n.port||(/^(http|ws)$/.test(n.protocol)?n.port="80":/^(http|ws)s$/.test(n.protocol)&&(n.port="443")),n.path=n.path||"/";var i=-1!==n.host.indexOf(":")?"["+n.host+"]":n.host;return n.id=n.protocol+"://"+i+":"+n.port,n.href=n.protocol+"://"+i+(t&&t.port===n.port?"":":"+n.port),n},Ou={},Au={}.toString,Ru=Array.isArray||function(e){return"[object Array]"==Au.call(e)};!function(e){yu.exports("socket.io-parser");var t=yc.exports,n=Ru;function i(){}e.protocol=4,e.types=["CONNECT","DISCONNECT","EVENT","ACK","ERROR","BINARY_EVENT","BINARY_ACK"],e.CONNECT=0,e.DISCONNECT=1,e.EVENT=2,e.ACK=3,e.ERROR=4,e.BINARY_EVENT=5,e.BINARY_ACK=6,e.Encoder=i,e.Decoder=s;var o=e.ERROR+'"encode error"';function s(){this.reconstructor=null}function r(t){return{type:e.ERROR,data:"parser error: "+t}}i.prototype.encode=function(t,n){n([function(t){var n=""+t.type;if(e.BINARY_EVENT!==t.type&&e.BINARY_ACK!==t.type||(n+=t.attachments+"-"),t.nsp&&"/"!==t.nsp&&(n+=t.nsp+","),null!=t.id&&(n+=t.id),null!=t.data){var i=function(e){try{return JSON.stringify(e)}catch(t){return!1}}(t.data);if(!1===i)return o;n+=i}return n}(t)])},t(s.prototype),s.prototype.add=function(t){var i;if("string"!=typeof t)throw new Error("Unknown type: "+t);i=function(t){var i=0,o={type:Number(t.charAt(0))};if(null==e.types[o.type])return r("unknown packet type "+o.type);if(e.BINARY_EVENT===o.type||e.BINARY_ACK===o.type){for(var s="";"-"!==t.charAt(++i)&&(s+=t.charAt(i),i!=t.length););if(s!=Number(s)||"-"!==t.charAt(i))throw new Error("Illegal attachments");o.attachments=Number(s)}if("/"===t.charAt(i+1))for(o.nsp="";++i&&","!==(c=t.charAt(i))&&(o.nsp+=c,i!==t.length););else o.nsp="/";var a=t.charAt(i+1);if(""!==a&&Number(a)==a){for(o.id="";++i;){var c;if(null==(c=t.charAt(i))||Number(c)!=c){--i;break}if(o.id+=t.charAt(i),i===t.length)break}o.id=Number(o.id)}if(t.charAt(++i)){var l=function(e){try{return JSON.parse(e)}catch(t){return!1}}(t.substr(i));if(!1===l||o.type!==e.ERROR&&!n(l))return r("invalid payload");o.data=l}return o}(t),this.emit("decoded",i)},s.prototype.destroy=function(){this.reconstructor&&this.reconstructor.finishedReconstruction()}}(Ou);var Pu={exports:{}},Mu={},Nu={},Du=Object.keys||function(e){var t=[],n=Object.prototype.hasOwnProperty;for(var i in e)n.call(e,i)&&t.push(i);return t},Bu=Ru,Lu=Object.prototype.toString,ju="function"==typeof Blob||"undefined"!=typeof Blob&&"[object BlobConstructor]"===Lu.call(Blob),Uu="function"==typeof File||"undefined"!=typeof File&&"[object FileConstructor]"===Lu.call(File),Fu=function e(t){if(!t||"object"!=typeof t)return!1;if(Bu(t)){for(var n=0,i=t.length;n<i;n++)if(e(t[n]))return!0;return!1}if("function"==typeof Buffer&&Buffer.isBuffer&&Buffer.isBuffer(t)||"function"==typeof ArrayBuffer&&t instanceof ArrayBuffer||ju&&t instanceof Blob||Uu&&t instanceof File)return!0;if(t.toJSON&&"function"==typeof t.toJSON&&1===arguments.length)return e(t.toJSON(),!0);for(var o in t)if(Object.prototype.hasOwnProperty.call(t,o)&&e(t[o]))return!0;return!1},Gu=function(e,t,n){var i=!1;return n=n||qu,o.count=e,0===e?t():o;function o(e,s){if(o.count<=0)throw new Error("after called too many times");--o.count,e?(i=!0,t(e),t=n):0!==o.count||i||t(null,s)}};function qu(){}var zu,Hu,$u,Vu=String.fromCharCode;function Ku(e){for(var t,n,i=[],o=0,s=e.length;o<s;)(t=e.charCodeAt(o++))>=55296&&t<=56319&&o<s?56320==(64512&(n=e.charCodeAt(o++)))?i.push(((1023&t)<<10)+(1023&n)+65536):(i.push(t),o--):i.push(t);return i}function Wu(e,t){if(e>=55296&&e<=57343){if(t)throw Error("Lone surrogate U+"+e.toString(16).toUpperCase()+" is not a scalar value");return!1}return!0}function Xu(e,t){return Vu(e>>t&63|128)}function Ju(e,t){if(!(4294967168&e))return Vu(e);var n="";return 4294965248&e?4294901760&e?!(4292870144&e)&&(n=Vu(e>>18&7|240),n+=Xu(e,12),n+=Xu(e,6)):(Wu(e,t)||(e=65533),n=Vu(e>>12&15|224),n+=Xu(e,6)):n=Vu(e>>6&31|192),n+Vu(63&e|128)}function Qu(){if($u>=Hu)throw Error("Invalid byte index");var e=255&zu[$u];if($u++,128==(192&e))return 63&e;throw Error("Invalid continuation byte")}function Yu(e){var t,n;if($u>Hu)throw Error("Invalid byte index");if($u==Hu)return!1;if(t=255&zu[$u],$u++,!(128&t))return t;if(192==(224&t)){if((n=(31&t)<<6|Qu())>=128)return n;throw Error("Invalid continuation byte")}if(224==(240&t)){if((n=(15&t)<<12|Qu()<<6|Qu())>=2048)return Wu(n,e)?n:65533;throw Error("Invalid continuation byte")}if(240==(248&t)&&(n=(7&t)<<18|Qu()<<12|Qu()<<6|Qu())>=65536&&n<=1114111)return n;throw Error("Invalid UTF-8 detected")}var Zu={version:"2.1.2",encode:function(e,t){for(var n=!1!==(t=t||{}).strict,i=Ku(e),o=i.length,s=-1,r="";++s<o;)r+=Ju(i[s],n);return r},decode:function(e,t){var n=!1!==(t=t||{}).strict;zu=Ku(e),Hu=zu.length,$u=0;for(var i,o=[];!1!==(i=Yu(n));)o.push(i);return function(e){for(var t,n=e.length,i=-1,o="";++i<n;)(t=e[i])>65535&&(o+=Vu((t-=65536)>>>10&1023|55296),t=56320|1023&t),o+=Vu(t);return o}(o)}},ep=void 0!==ep?ep:"undefined"!=typeof WebKitBlobBuilder?WebKitBlobBuilder:"undefined"!=typeof MSBlobBuilder?MSBlobBuilder:"undefined"!=typeof MozBlobBuilder&&MozBlobBuilder,tp=function(){try{return 2===new Blob(["hi"]).size}catch(Wa){return!1}}(),np=tp&&function(){try{return 2===new Blob([new Uint8Array([1,2])]).size}catch(Wa){return!1}}(),ip=ep&&ep.prototype.append&&ep.prototype.getBlob;function op(e){return e.map((function(e){if(e.buffer instanceof ArrayBuffer){var t=e.buffer;if(e.byteLength!==t.byteLength){var n=new Uint8Array(e.byteLength);n.set(new Uint8Array(t,e.byteOffset,e.byteLength)),t=n.buffer}return t}return e}))}function sp(e,t){t=t||{};var n=new ep;return op(e).forEach((function(e){n.append(e)})),t.type?n.getBlob(t.type):n.getBlob()}function rp(e,t){return new Blob(op(e),t||{})}"undefined"!=typeof Blob&&(sp.prototype=Blob.prototype,rp.prototype=Blob.prototype);var ap=tp?np?Blob:rp:ip?sp:void 0;!function(e){var t=Du,n=Fu,i=Gu,o=Zu;e.protocol=3;var s=e.packets={open:0,close:1,ping:2,pong:3,message:4,upgrade:5,noop:6},r=t(s),a={type:"error",data:"parser error"},c=ap;e.encodePacket=function(e,t,n,i){"function"==typeof t&&(i=t,t=!1),"function"==typeof n&&(i=n,n=null),void 0===e.data||e.data.buffer||e.data;var r=s[e.type];return void 0!==e.data&&(r+=n?o.encode(String(e.data),{strict:!1}):String(e.data)),i(""+r)},e.decodePacket=function(e,t,n){if(void 0===e)return a;if("string"==typeof e){if(n&&!1===(e=function(e){try{e=o.decode(e,{strict:!1})}catch(t){return!1}return e}(e)))return a;var i=e.charAt(0);return Number(i)==i&&r[i]?e.length>1?{type:r[i],data:e.substring(1)}:{type:r[i]}:a}i=new Uint8Array(e)[0];var s=sliceBuffer(e,1);return c&&"blob"===t&&(s=new c([s])),{type:r[i],data:s}},e.encodePayload=function(t,o,s){"function"==typeof o&&(s=o,o=null);var r=n(t);if(!t.length)return s("0:");!function(t){for(var n=new Array(t.length),a=i(t.length,(function(e,t){return s(t.join(""))})),c=function(t,i,s){!function(t,n){e.encodePacket(t,!!r&&o,!0,(function(e){n(null,function(e){return e.length+":"+e}(e))}))}(i,(function(e,i){n[t]=i,s(e,n)}))},l=0;l<t.length;l++)c(l,t[l],a)}(t)},e.decodePayload=function(t,n,i){var o;if("function"==typeof n&&(i=n,n=null),""===t)return i(a,0,1);for(var s,r,c="",l=0,u=t.length;l<u;l++){var p=t.charAt(l);if(":"===p){if(""===c||c!=(s=Number(c)))return i(a,0,1);if(c!=(r=t.substr(l+1,s)).length)return i(a,0,1);if(r.length){if(o=e.decodePacket(r,n,!0),a.type===o.type&&a.data===o.data)return i(a,0,1);if(!1===i(o,l+s,u))return}l+=s,c=""}else c+=p}return""!==c?i(a,0,1):void 0}}(Nu);var cp=Nu,lp=up;function up(e){this.path=e.path,this.hostname=e.hostname,this.port=e.port,this.secure=e.secure,this.query=e.query,this.timestampParam=e.timestampParam,this.timestampRequests=e.timestampRequests,this.readyState="",this.agent=e.agent||!1,this.socket=e.socket,this.enablesXDR=e.enablesXDR,this.pfx=e.pfx,this.key=e.key,this.passphrase=e.passphrase,this.cert=e.cert,this.ca=e.ca,this.ciphers=e.ciphers,this.rejectUnauthorized=e.rejectUnauthorized,this.forceNode=e.forceNode,this.isReactNative=e.isReactNative,this.extraHeaders=e.extraHeaders,this.localAddress=e.localAddress}(0,yc.exports)(up.prototype),up.prototype.onError=function(e,t){var n=new Error(e);return n.type="TransportError",n.description=t,this.emit("error",n),this},up.prototype.open=function(){return"closed"!==this.readyState&&""!==this.readyState||(this.readyState="opening",this.doOpen()),this},up.prototype.close=function(){return"opening"!==this.readyState&&"open"!==this.readyState||(this.doClose(),this.onClose()),this},up.prototype.send=function(e){if("open"!==this.readyState)throw new Error("Transport not open");this.write(e)},up.prototype.onOpen=function(){this.readyState="open",this.writable=!0,this.emit("open")},up.prototype.onData=function(e){var t=cp.decodePacket(e,this.socket.binaryType);this.onPacket(t)},up.prototype.onPacket=function(e){this.emit("packet",e)},up.prototype.onClose=function(){this.readyState="closed",this.emit("close")};var pp,dp={encode:function(e){var t="";for(var n in e)e.hasOwnProperty(n)&&(t.length&&(t+="&"),t+=encodeURIComponent(n)+"="+encodeURIComponent(e[n]));return t},decode:function(e){for(var t={},n=e.split("&"),i=0,o=n.length;i<o;i++){var s=n[i].split("=");t[decodeURIComponent(s[0])]=decodeURIComponent(s[1])}return t}},hp=function(e,t){var n=function(){};n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e},fp="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_".split(""),mp={},gp=0,vp=0;function yp(e){var t="";do{t=fp[e%64]+t,e=Math.floor(e/64)}while(e>0);return t}function bp(){var e=yp(+new Date);return e!==pp?(gp=0,pp=e):e+"."+yp(gp++)}for(;vp<64;vp++)mp[fp[vp]]=vp;bp.encode=yp,bp.decode=function(e){var t=0;for(vp=0;vp<e.length;vp++)t=64*t+mp[e.charAt(vp)];return t};var xp=bp,Sp={exports:{}};try{Sp.exports="undefined"!=typeof XMLHttpRequest&&"withCredentials"in new XMLHttpRequest}catch(Wa){Sp.exports=!1}var kp=Sp.exports,Cp=lp,wp=dp,Ep=Nu,Tp=hp,Ip=xp,_p=yu.exports("engine.io-client:polling"),Op=Rp,Ap=null!=new function(e){var t=e.xdomain,n=e.xscheme,i=e.enablesXDR;try{if("undefined"!=typeof XMLHttpRequest&&(!t||kp))return new XMLHttpRequest}catch(o){}try{if("undefined"!=typeof XDomainRequest&&!n&&i)return new XDomainRequest}catch(o){}if(!t)try{return new(self[["Active"].concat("Object").join("X")])("Microsoft.XMLHTTP")}catch(o){}}({xdomain:!1}).responseType;function Rp(e){var t=e&&e.forceBase64;Ap&&!t||(this.supportsBinary=!1),Cp.call(this,e)}Tp(Rp,Cp),Rp.prototype.name="polling",Rp.prototype.doOpen=function(){this.poll()},Rp.prototype.pause=function(e){var t=this;function n(){_p("paused"),t.readyState="paused",e()}if(this.readyState="pausing",this.polling||!this.writable){var i=0;this.polling&&(_p("we are currently polling - waiting to pause"),i++,this.once("pollComplete",(function(){_p("pre-pause polling complete"),--i||n()}))),this.writable||(_p("we are currently writing - waiting to pause"),i++,this.once("drain",(function(){_p("pre-pause writing complete"),--i||n()})))}else n()},Rp.prototype.poll=function(){_p("polling"),this.polling=!0,this.doPoll(),this.emit("poll")},Rp.prototype.onData=function(e){var t=this;_p("polling got data %s",e),Ep.decodePayload(e,this.socket.binaryType,(function(e,n,i){if("opening"===t.readyState&&t.onOpen(),"close"===e.type)return t.onClose(),!1;t.onPacket(e)})),"closed"!==this.readyState&&(this.polling=!1,this.emit("pollComplete"),"open"===this.readyState?this.poll():_p('ignoring poll - transport state "%s"',this.readyState))},Rp.prototype.doClose=function(){var e=this;function t(){_p("writing close packet"),e.write([{type:"close"}])}"open"===this.readyState?(_p("transport open - closing"),t()):(_p("transport not open - deferring close"),this.once("open",t))},Rp.prototype.write=function(e){var t=this;this.writable=!1;var n=function(){t.writable=!0,t.emit("drain")};Ep.encodePayload(e,this.supportsBinary,(function(e){t.doWrite(e,n)}))},Rp.prototype.uri=function(){var e=this.query||{},t=this.secure?"https":"http",n="";return!1!==this.timestampRequests&&(e[this.timestampParam]=Ip()),this.supportsBinary||e.sid||(e.b64=1),e=wp.encode(e),this.port&&("https"===t&&443!==Number(this.port)||"http"===t&&80!==Number(this.port))&&(n=":"+this.port),e.length&&(e="?"+e),t+"://"+(-1!==this.hostname.indexOf(":")?"["+this.hostname+"]":this.hostname)+n+this.path+e};var Pp,Mp=Op,Np=jp,Dp=/\n/g,Bp=/\\n/g;function Lp(){}function jp(e){if(Mp.call(this,e),this.query=this.query||{},!Pp){var t="undefined"!=typeof self?self:"undefined"!=typeof window?window:void 0!==gc?gc:{};Pp=t.___eio=t.___eio||[]}this.index=Pp.length;var n=this;Pp.push((function(e){n.onData(e)})),this.query.j=this.index,"function"==typeof addEventListener&&addEventListener("beforeunload",(function(){n.script&&(n.script.onerror=Lp)}),!1)}hp(jp,Mp),jp.prototype.supportsBinary=!1,jp.prototype.doClose=function(){this.script&&(this.script.parentNode.removeChild(this.script),this.script=null),this.form&&(this.form.parentNode.removeChild(this.form),this.form=null,this.iframe=null),Mp.prototype.doClose.call(this)},jp.prototype.doPoll=function(){var e=this,t=document.createElement("script");this.script&&(this.script.parentNode.removeChild(this.script),this.script=null),t.async=!0,t.src=this.uri(),t.onerror=function(t){e.onError("jsonp poll error",t)};var n=document.getElementsByTagName("script")[0];n?n.parentNode.insertBefore(t,n):(document.head||document.body).appendChild(t),this.script=t,"undefined"!=typeof navigator&&/gecko/i.test(navigator.userAgent)&&setTimeout((function(){var e=document.createElement("iframe");document.body.appendChild(e),document.body.removeChild(e)}),100)},jp.prototype.doWrite=function(e,t){var n=this;if(!this.form){var i,o=document.createElement("form"),s=document.createElement("textarea"),r=this.iframeId="eio_iframe_"+this.index;o.className="socketio",o.style.position="absolute",o.style.top="-1000px",o.style.left="-1000px",o.target=r,o.method="POST",o.setAttribute("accept-charset","utf-8"),s.name="d",o.appendChild(s),document.body.appendChild(o),this.form=o,this.area=s}function a(){c(),t()}function c(){if(n.iframe)try{n.form.removeChild(n.iframe)}catch(t){n.onError("jsonp polling iframe removal error",t)}try{var e='<iframe src="javascript:0" name="'+n.iframeId+'">';i=document.createElement(e)}catch(t){(i=document.createElement("iframe")).name=n.iframeId,i.src="javascript:0"}i.id=n.iframeId,n.form.appendChild(i),n.iframe=i}this.form.action=this.uri(),c(),e=e.replace(Bp,"\\\n"),this.area.value=e.replace(Dp,"\\n");try{this.form.submit()}catch(l){}this.iframe.attachEvent?this.iframe.onreadystatechange=function(){"complete"===n.iframe.readyState&&a()}:this.iframe.onload=a};var Up,Fp,Gp=lp,qp=Nu,zp=dp,Hp=hp,$p=xp,Vp=yu.exports("engine.io-client:websocket");(void 0===Nn&&void 0===Mn&&"undefined"==typeof my&&"undefined"==typeof swan||"undefined"!=typeof WebSocket)&&("undefined"!=typeof WebSocket?Up=WebSocket:"undefined"!=typeof self&&(Up=self.WebSocket||self.MozWebSocket));var Kp=Up||Fp;(void 0===Nn&&void 0===Mn&&"undefined"==typeof my&&"undefined"==typeof swan||"undefined"!=typeof WebSocket)&&"undefined"==typeof GameGlobal||(Kp=function(e){var t=this;if(t.onopen=function(){},t.onclose=function(){},t.onmessage=function(e){},t.onerror=function(e){},"object"==typeof tt&&tt.getSystemInfo){let n=tt.connectSocket({url:e});t.send=function(e){n.send({data:e})},t.close=function(){n.close()},n.onOpen((function(){t.onopen()})),n.onError((function(e){t.onerror(e)})),n.onMessage((function(e){t.onmessage(e)})),n.onClose((function(){t.onclose()}))}else if("undefined"!=typeof my)my.connectSocket({url:e}),t.send=function(e){my.sendSocketMessage({data:e})},t.close=function(e){my.closeSocket()},my.onSocketOpen((function(e){t.onopen()})),my.onSocketError((function(e){t.onerror(e)})),my.onSocketMessage((function(e){t.onmessage(e)})),my.onSocketClose((e=>{t.onclose(e)}));else if("undefined"!=typeof swan)swan.connectSocket({url:e}),t.send=function(e){swan.sendSocketMessage({data:e})},t.close=function(e){swan.closeSocket()},swan.onSocketOpen((function(e){t.onopen()})),swan.onSocketError((function(e){t.onerror(e)})),swan.onSocketMessage((function(e){t.onmessage(e)})),swan.onSocketClose((e=>{t.onclose(e)}));else if(void 0!==Nn){var n=Nn.connectSocket({url:e,complete:()=>{}});t.send=function(e){n.send({data:e})},t.close=function(){n.close()},n.onOpen((function(e){t.onopen()})),n.onError((function(e){t.onerror(e)})),n.onMessage((function(e){t.onmessage(e)})),n.onClose((function(e){t.onclose()}))}else{var i=Mn.connectSocket({url:e});t.send=function(e){i.send({data:e})},t.close=function(e){i.close({code:1e3})},i.onOpen((function(){t.onopen()})),i.onError((function(e){t.onerror(e)})),i.onMessage((function(e){t.onmessage(e)})),i.onClose((function(e){t.onclose(e)}))}});var Wp=Xp;function Xp(e){e&&e.forceBase64&&(this.supportsBinary=!1),(void 0===Nn&&void 0===Mn&&"undefined"==typeof my&&"undefined"==typeof swan||"undefined"!=typeof WebSocket)&&(this.perMessageDeflate=e.perMessageDeflate,this.usingBrowserWebSocket=Up&&!e.forceNode,this.protocols=e.protocols,this.usingBrowserWebSocket||(Kp=Fp)),Gp.call(this,e)}Hp(Xp,Gp),Xp.prototype.name="websocket",Xp.prototype.supportsBinary=!1,Xp.prototype.doOpen=function(){if(this.check()){var e,t,n=this.uri();if((void 0===Nn&&void 0===Mn&&"undefined"==typeof my&&"undefined"==typeof swan||"undefined"!=typeof WebSocket)&&(e=this.protocols),(t=void 0===Nn&&void 0===Mn&&"undefined"==typeof my&&"undefined"==typeof swan||"undefined"!=typeof WebSocket?{agent:this.agent,perMessageDeflate:this.perMessageDeflate}:{agent:this.agent}).pfx=this.pfx,t.key=this.key,t.passphrase=this.passphrase,t.cert=this.cert,t.ca=this.ca,t.ciphers=this.ciphers,t.rejectUnauthorized=this.rejectUnauthorized,"object"==typeof navigator&&"ReactNative"===navigator.product&&(t={}),this.extraHeaders&&(t.headers=this.extraHeaders),this.localAddress&&(t.localAddress=this.localAddress),"undefined"!=typeof cc&&"Windows"===cc.sys.os)cc.resources.load("cacert",((e,t)=>{const i=t.nativeUrl;this.ws=new Kp(n,[],i),this.ws.binaryType="arraybuffer",this.addEventListeners()}));else{try{void 0===Nn&&void 0===Mn&&"undefined"==typeof my&&"undefined"==typeof swan||"undefined"!=typeof WebSocket?this.ws=this.usingBrowserWebSocket&&!this.isReactNative?e?new Kp(n,e):new Kp(n):new Kp(n,e,t):this.ws=new Kp(n)}catch(i){return this.emit("error",i)}void 0===this.ws.binaryType&&(this.supportsBinary=!1),this.ws.supports&&this.ws.supports.binary?(this.supportsBinary=!0,this.ws.binaryType="nodebuffer"):this.ws.binaryType="arraybuffer",this.addEventListeners()}}},Xp.prototype.addEventListeners=function(){var e=this;this.ws.onopen=function(){e.onOpen()},this.ws.onclose=function(){e.onClose()},this.ws.onmessage=function(t){e.onData(t.data)},this.ws.onerror=function(t){e.onError("websocket error",t)}},Xp.prototype.write=function(e){var t=this;this.writable=!1;for(var n=e.length,i=0,o=n;i<o;i++)!function(e){qp.encodePacket(e,t.supportsBinary,(function(i){if(void 0===Nn&&void 0===Mn&&"undefined"==typeof my&&"undefined"==typeof swan||"undefined"!=typeof WebSocket){if(!t.usingBrowserWebSocket){var o={};e.options&&(o.compress=e.options.compress),t.perMessageDeflate&&("string"==typeof i?Buffer.byteLength(i):i.length)<t.perMessageDeflate.threshold&&(o.compress=!1)}try{t.usingBrowserWebSocket?t.ws.send(i):t.ws.send(i,o)}catch(s){Vp("websocket closed before onclose event")}}else try{t.ws.send(i)}catch(s){Vp("websocket closed before onclose event")}--n||(t.emit("flush"),setTimeout((function(){t.writable=!0,t.emit("drain")}),0))}))}(e[i])},Xp.prototype.onClose=function(){Gp.prototype.onClose.call(this)},Xp.prototype.doClose=function(){void 0!==this.ws&&this.ws.close()},Xp.prototype.uri=function(){var e=this.query||{},t=this.secure?"wss":"ws",n="";return this.port&&("wss"===t&&443!==Number(this.port)||"ws"===t&&80!==Number(this.port))&&(n=":"+this.port),this.timestampRequests&&(e[this.timestampParam]=$p()),this.supportsBinary||(e.b64=1),(e=zp.encode(e)).length&&(e="?"+e),t+"://"+(-1!==this.hostname.indexOf(":")?"["+this.hostname+"]":this.hostname)+n+this.path+e},Xp.prototype.check=function(){return!(!Kp||"__initialize"in Kp&&this.name===Xp.prototype.name)};var Jp=Np,Qp=Wp;Mu.polling=function(e){var t=!1,n=!1;if(e.jsonp,"undefined"!=typeof location){var i="https:"===location.protocol,o=location.port;o||(o=i?443:80),t=e.hostname!==location.hostname||o!==e.port,n=e.secure!==i}return e.xdomain=t,e.xscheme=n,new Jp(e)},Mu.websocket=Qp;var Yp=[].indexOf,Zp=function(e,t){if(Yp)return e.indexOf(t);for(var n=0;n<e.length;++n)if(e[n]===t)return n;return-1},ed=Mu,td=yc.exports,nd=yu.exports("engine.io-client:socket"),id=Zp,od=Nu,sd=vu,rd=dp,ad=cd;function cd(e,t){if(!(this instanceof cd))return new cd(e,t);t=t||{},e&&"object"==typeof e&&(t=e,e=null),e?(e=sd(e),t.hostname=e.host,t.secure="https"===e.protocol||"wss"===e.protocol,t.port=e.port,e.query&&(t.query=e.query)):t.host&&(t.hostname=sd(t.host).host),this.secure=null!=t.secure?t.secure:"undefined"!=typeof location&&"https:"===location.protocol,t.hostname&&!t.port&&(t.port=this.secure?"443":"80"),this.agent=t.agent||!1,this.hostname=t.hostname||("undefined"!=typeof location?location.hostname:"localhost"),this.port=t.port||("undefined"!=typeof location&&location.port?location.port:this.secure?443:80),this.query=t.query||{},"string"==typeof this.query&&(this.query=rd.decode(this.query)),this.upgrade=!1!==t.upgrade,this.path=(t.path||"/engine.io").replace(/\/$/,"")+"/",this.forceJSONP=!!t.forceJSONP,this.jsonp=!1!==t.jsonp,this.forceBase64=!!t.forceBase64,this.enablesXDR=!!t.enablesXDR,this.timestampParam=t.timestampParam||"t",this.timestampRequests=t.timestampRequests,this.transports=t.transports||["polling","websocket"],this.transportOptions=t.transportOptions||{},this.readyState="",this.writeBuffer=[],this.prevBufferLen=0,this.policyPort=t.policyPort||843,this.rememberUpgrade=t.rememberUpgrade||!1,this.binaryType=null,this.onlyBinaryUpgrades=t.onlyBinaryUpgrades,this.perMessageDeflate=!1!==t.perMessageDeflate&&(t.perMessageDeflate||{}),!0===this.perMessageDeflate&&(this.perMessageDeflate={}),this.perMessageDeflate&&null==this.perMessageDeflate.threshold&&(this.perMessageDeflate.threshold=1024),this.pfx=t.pfx||null,this.key=t.key||null,this.passphrase=t.passphrase||null,this.cert=t.cert||null,this.ca=t.ca||null,this.ciphers=t.ciphers||null,this.rejectUnauthorized=void 0===t.rejectUnauthorized||t.rejectUnauthorized,this.forceNode=!!t.forceNode,this.isReactNative="undefined"!=typeof navigator&&"string"==typeof navigator.product&&"reactnative"===navigator.product.toLowerCase(),("undefined"==typeof self||this.isReactNative)&&(t.extraHeaders&&Object.keys(t.extraHeaders).length>0&&(this.extraHeaders=t.extraHeaders),t.localAddress&&(this.localAddress=t.localAddress)),this.id=null,this.upgrades=null,this.pingInterval=null,this.pingTimeout=null,this.pingIntervalTimer=null,this.pingTimeoutTimer=null,this.open()}cd.priorWebsocketSuccess=!1,td(cd.prototype),cd.protocol=od.protocol,cd.Socket=cd,cd.Transport=lp,cd.transports=Mu,cd.parser=Nu,cd.prototype.createTransport=function(e){nd('creating transport "%s"',e);var t=function(e){var t={};for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);return t}(this.query);t.EIO=od.protocol,t.transport=e;var n=this.transportOptions[e]||{};return this.id&&(t.sid=this.id),new ed[e]({query:t,socket:this,agent:n.agent||this.agent,hostname:n.hostname||this.hostname,port:n.port||this.port,secure:n.secure||this.secure,path:n.path||this.path,forceJSONP:n.forceJSONP||this.forceJSONP,jsonp:n.jsonp||this.jsonp,forceBase64:n.forceBase64||this.forceBase64,enablesXDR:n.enablesXDR||this.enablesXDR,timestampRequests:n.timestampRequests||this.timestampRequests,timestampParam:n.timestampParam||this.timestampParam,policyPort:n.policyPort||this.policyPort,pfx:n.pfx||this.pfx,key:n.key||this.key,passphrase:n.passphrase||this.passphrase,cert:n.cert||this.cert,ca:n.ca||this.ca,ciphers:n.ciphers||this.ciphers,rejectUnauthorized:n.rejectUnauthorized||this.rejectUnauthorized,perMessageDeflate:n.perMessageDeflate||this.perMessageDeflate,extraHeaders:n.extraHeaders||this.extraHeaders,forceNode:n.forceNode||this.forceNode,localAddress:n.localAddress||this.localAddress,requestTimeout:n.requestTimeout||this.requestTimeout,protocols:n.protocols||void 0,isReactNative:this.isReactNative})},cd.prototype.open=function(){var e;if(this.rememberUpgrade&&cd.priorWebsocketSuccess&&-1!==this.transports.indexOf("websocket"))e="websocket";else{if(0===this.transports.length){var t=this;return void setTimeout((function(){t.emit("error","No transports available")}),0)}e=this.transports[0]}this.readyState="opening";try{e=this.createTransport(e)}catch(n){return this.transports.shift(),void this.open()}e.open(),this.setTransport(e)},cd.prototype.setTransport=function(e){nd("setting transport %s",e.name);var t=this;this.transport&&(nd("clearing existing transport %s",this.transport.name),this.transport.removeAllListeners()),this.transport=e,e.on("drain",(function(){t.onDrain()})).on("packet",(function(e){t.onPacket(e)})).on("error",(function(e){t.onError(e)})).on("close",(function(){t.onClose("transport close")}))},cd.prototype.probe=function(e){nd('probing transport "%s"',e);var t=this.createTransport(e,{probe:1}),n=!1,i=this;function o(){if(i.onlyBinaryUpgrades){var o=!this.supportsBinary&&i.transport.supportsBinary;n=n||o}n||(nd('probe transport "%s" opened',e),t.send([{type:"ping",data:"probe"}]),t.once("packet",(function(o){if(!n)if("pong"===o.type&&"probe"===o.data){if(nd('probe transport "%s" pong',e),i.upgrading=!0,i.emit("upgrading",t),!t)return;cd.priorWebsocketSuccess="websocket"===t.name,nd('pausing current transport "%s"',i.transport.name),i.transport.pause((function(){n||"closed"!==i.readyState&&(nd("changing transport and sending upgrade packet"),u(),i.setTransport(t),t.send([{type:"upgrade"}]),i.emit("upgrade",t),t=null,i.upgrading=!1,i.flush())}))}else{nd('probe transport "%s" failed',e);var s=new Error("probe error");s.transport=t.name,i.emit("upgradeError",s)}})))}function s(){n||(n=!0,u(),t.close(),t=null)}function r(n){var o=new Error("probe error: "+n);o.transport=t.name,s(),nd('probe transport "%s" failed because of error: %s',e,n),i.emit("upgradeError",o)}function a(){r("transport closed")}function c(){r("socket closed")}function l(e){t&&e.name!==t.name&&(nd('"%s" works - aborting "%s"',e.name,t.name),s())}function u(){t.removeListener("open",o),t.removeListener("error",r),t.removeListener("close",a),i.removeListener("close",c),i.removeListener("upgrading",l)}cd.priorWebsocketSuccess=!1,t.once("open",o),t.once("error",r),t.once("close",a),this.once("close",c),this.once("upgrading",l),t.open()},cd.prototype.onOpen=function(){if(nd("socket open"),this.readyState="open",cd.priorWebsocketSuccess="websocket"===this.transport.name,this.emit("open"),this.flush(),"open"===this.readyState&&this.upgrade&&this.transport.pause){nd("starting upgrade probes");for(var e=0,t=this.upgrades.length;e<t;e++)this.probe(this.upgrades[e])}},cd.prototype.onPacket=function(e){if("opening"===this.readyState||"open"===this.readyState||"closing"===this.readyState)switch(nd('socket receive: type "%s", data "%s"',e.type,e.data),this.emit("packet",e),this.emit("heartbeat"),e.type){case"open":this.onHandshake(JSON.parse(e.data));break;case"pong":this.setPing(),this.emit("pong");break;case"error":var t=new Error("server error");t.code=e.data,this.onError(t);break;case"message":this.emit("data",e.data),this.emit("message",e.data)}else nd('packet received with socket readyState "%s"',this.readyState)},cd.prototype.onHandshake=function(e){this.emit("handshake",e),this.id=e.sid,this.transport.query.sid=e.sid,this.upgrades=this.filterUpgrades(e.upgrades),this.pingInterval=e.pingInterval,this.pingTimeout=e.pingTimeout,this.onOpen(),"closed"!==this.readyState&&(this.setPing(),this.removeListener("heartbeat",this.onHeartbeat),this.on("heartbeat",this.onHeartbeat))},cd.prototype.onHeartbeat=function(e){clearTimeout(this.pingTimeoutTimer);var t=this;t.pingTimeoutTimer=setTimeout((function(){"closed"!==t.readyState&&t.onClose("ping timeout")}),e||t.pingInterval+t.pingTimeout)},cd.prototype.setPing=function(){var e=this;clearTimeout(e.pingIntervalTimer),e.pingIntervalTimer=setTimeout((function(){nd("writing ping packet - expecting pong within %sms",e.pingTimeout),e.ping(),e.onHeartbeat(e.pingTimeout)}),e.pingInterval)},cd.prototype.ping=function(){var e=this;this.sendPacket("ping",(function(){e.emit("ping")}))},cd.prototype.onDrain=function(){this.writeBuffer.splice(0,this.prevBufferLen),this.prevBufferLen=0,0===this.writeBuffer.length?this.emit("drain"):this.flush()},cd.prototype.flush=function(){"closed"!==this.readyState&&this.transport.writable&&!this.upgrading&&this.writeBuffer.length&&(nd("flushing %d packets in socket",this.writeBuffer.length),this.transport.send(this.writeBuffer),this.prevBufferLen=this.writeBuffer.length,this.emit("flush"))},cd.prototype.write=cd.prototype.send=function(e,t,n){return this.sendPacket("message",e,t,n),this},cd.prototype.sendPacket=function(e,t,n,i){if("function"==typeof t&&(i=t,t=void 0),"function"==typeof n&&(i=n,n=null),"closing"!==this.readyState&&"closed"!==this.readyState){(n=n||{}).compress=!1!==n.compress;var o={type:e,data:t,options:n};this.emit("packetCreate",o),this.writeBuffer.push(o),i&&this.once("flush",i),this.flush()}},cd.prototype.close=function(){if("opening"===this.readyState||"open"===this.readyState){this.readyState="closing";var e=this;this.writeBuffer.length?this.once("drain",(function(){this.upgrading?i():t()})):this.upgrading?i():t()}function t(){e.onClose("forced close"),nd("socket closing - telling transport to close"),e.transport.close()}function n(){e.removeListener("upgrade",n),e.removeListener("upgradeError",n),t()}function i(){e.once("upgrade",n),e.once("upgradeError",n)}return this},cd.prototype.onError=function(e){nd("socket error %j",e),cd.priorWebsocketSuccess=!1,this.emit("error",e),this.onClose("transport error",e)},cd.prototype.onClose=function(e,t){"opening"!==this.readyState&&"open"!==this.readyState&&"closing"!==this.readyState||(nd('socket close with reason: "%s"',e),clearTimeout(this.pingIntervalTimer),clearTimeout(this.pingTimeoutTimer),this.transport.removeAllListeners("close"),this.transport.close(),this.transport.removeAllListeners(),this.readyState="closed",this.id=null,this.emit("close",e,t),this.writeBuffer=[],this.prevBufferLen=0)},cd.prototype.filterUpgrades=function(e){for(var t=[],n=0,i=e.length;n<i;n++)~id(this.transports,e[n])&&t.push(e[n]);return t},Pu.exports=ad,Pu.exports.parser=Nu;var ld={exports:{}},ud=function(e,t){for(var n=[],i=(t=t||0)||0;i<e.length;i++)n[i-t]=e[i];return n},pd=function(e,t,n){return e.on(t,n),{destroy:function(){e.removeListener(t,n)}}},dd=[].slice,hd=function(e,t){if("string"==typeof t&&(t=e[t]),"function"!=typeof t)throw new Error("bind() requires a function");var n=dd.call(arguments,2);return function(){return t.apply(e,n.concat(dd.call(arguments)))}};!function(e){var t=Ou,n=yc.exports,i=ud,o=pd,s=hd,r=(yu.exports("socket.io-client:socket"),dp),a=Fu;e.exports=u;var c={connect:1,connect_error:1,connect_timeout:1,connecting:1,disconnect:1,error:1,reconnect:1,reconnect_attempt:1,reconnect_failed:1,reconnect_error:1,reconnecting:1,ping:1,pong:1},l=n.prototype.emit;function u(e,t,n){this.io=e,this.nsp=t,this.json=this,this.ids=0,this.acks={},this.receiveBuffer=[],this.sendBuffer=[],this.connected=!1,this.disconnected=!0,this.flags={},n&&n.query&&(this.query=n.query),this.io.autoConnect&&this.open()}n(u.prototype),u.prototype.subEvents=function(){if(!this.subs){var e=this.io;this.subs=[o(e,"open",s(this,"onopen")),o(e,"packet",s(this,"onpacket")),o(e,"close",s(this,"onclose"))]}},u.prototype.open=u.prototype.connect=function(){return this.connected||(this.subEvents(),this.io.open(),"open"===this.io.readyState&&this.onopen(),this.emit("connecting")),this},u.prototype.send=function(){var e=i(arguments);return e.unshift("message"),this.emit.apply(this,e),this},u.prototype.emit=function(e){if(c.hasOwnProperty(e))return l.apply(this,arguments),this;var n=i(arguments),o={type:(void 0!==this.flags.binary?this.flags.binary:a(n))?t.BINARY_EVENT:t.EVENT,data:n,options:{}};return o.options.compress=!this.flags||!1!==this.flags.compress,"function"==typeof n[n.length-1]&&(this.ids,this.acks[this.ids]=n.pop(),o.id=this.ids++),this.connected?this.packet(o):this.sendBuffer.push(o),this.flags={},this},u.prototype.packet=function(e){e.nsp=this.nsp,this.io.packet(e)},u.prototype.onopen=function(){if("/"!==this.nsp)if(this.query){var e="object"==typeof this.query?r.encode(this.query):this.query;this.packet({type:t.CONNECT,query:e})}else this.packet({type:t.CONNECT})},u.prototype.onclose=function(e){this.connected=!1,this.disconnected=!0,delete this.id,this.emit("disconnect",e)},u.prototype.onpacket=function(e){var n=e.nsp===this.nsp,i=e.type===t.ERROR&&"/"===e.nsp;if(n||i)switch(e.type){case t.CONNECT:this.onconnect();break;case t.EVENT:case t.BINARY_EVENT:this.onevent(e);break;case t.ACK:case t.BINARY_ACK:this.onack(e);break;case t.DISCONNECT:this.ondisconnect();break;case t.ERROR:this.emit("error",e.data)}},u.prototype.onevent=function(e){var t=e.data||[];null!=e.id&&t.push(this.ack(e.id)),this.connected?l.apply(this,t):this.receiveBuffer.push(t)},u.prototype.ack=function(e){var n=this,o=!1;return function(){if(!o){o=!0;var s=i(arguments);n.packet({type:a(s)?t.BINARY_ACK:t.ACK,id:e,data:s})}}},u.prototype.onack=function(e){var t=this.acks[e.id];"function"==typeof t?(e.id,e.data,t.apply(this,e.data),delete this.acks[e.id]):e.id},u.prototype.onconnect=function(){this.connected=!0,this.disconnected=!1,this.emit("connect"),this.emitBuffered()},u.prototype.emitBuffered=function(){var e;for(e=0;e<this.receiveBuffer.length;e++)l.apply(this,this.receiveBuffer[e]);for(this.receiveBuffer=[],e=0;e<this.sendBuffer.length;e++)this.packet(this.sendBuffer[e]);this.sendBuffer=[]},u.prototype.ondisconnect=function(){this.nsp,this.destroy(),this.onclose("io server disconnect")},u.prototype.destroy=function(){if(this.subs){for(var e=0;e<this.subs.length;e++)this.subs[e].destroy();this.subs=null}this.io.destroy(this)},u.prototype.close=u.prototype.disconnect=function(){return this.connected&&(this.nsp,this.packet({type:t.DISCONNECT})),this.destroy(),this.connected&&this.onclose("io client disconnect"),this},u.prototype.compress=function(e){return this.flags.compress=e,this},u.prototype.binary=function(e){return this.flags.binary=e,this}}(ld);var fd=md;function md(e){e=e||{},this.ms=e.min||100,this.max=e.max||1e4,this.factor=e.factor||2,this.jitter=e.jitter>0&&e.jitter<=1?e.jitter:0,this.attempts=0}md.prototype.duration=function(){var e=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var t=Math.random(),n=Math.floor(t*this.jitter*e);e=1&Math.floor(10*t)?e+n:e-n}return 0|Math.min(e,this.max)},md.prototype.reset=function(){this.attempts=0},md.prototype.setMin=function(e){this.ms=e},md.prototype.setMax=function(e){this.max=e},md.prototype.setJitter=function(e){this.jitter=e};class gd{static init(e,t,n){this.host=e,(void 0!==t&&!1===t||!0===n)&&(this.https=!1)}static isMP(){return[ic.MP_WX,ic.MP_ALI,ic.MP_BYTE,ic.MP_WGAME,ic.MP_BAIDU].includes(oc.currentPlatform())}static uri(){let e="http";return this.https&&(e+="s"),e+"://"+this.index()+this.host}static index(){return 0==this.i?this.i=Math.floor(Math.random()*this.max)+1:this.i=this.i%this.max+1,this.i}}gd.i=0,gd.max=5,gd.https=!0;var vd=vc(Object.freeze({__proto__:null,URIResolver:gd})),yd=vc(hc),bd=Pu.exports,xd=ld.exports,Sd=yc.exports,kd=Ou,Cd=pd,wd=hd,Ed=(yu.exports("socket.io-client:manager"),Zp),Td=fd;const{URIResolver:Id}=vd;var _d=yd.runStatus,Od=Object.prototype.hasOwnProperty,Ad=Rd;function Rd(e,t){if(!(this instanceof Rd))return new Rd(e,t);e&&"object"==typeof e&&(t=e,e=void 0),(t=t||{}).path=t.path||"/socket.io",this.nsps={},this.subs=[],this.opts=t,this.reconnection(!1!==t.reconnection),this.reconnectionAttempts(t.reconnectionAttempts||1/0),this.reconnectionDelay(t.reconnectionDelay||1e3),this.reconnectionDelayMax(t.reconnectionDelayMax||5e3),this.randomizationFactor(t.randomizationFactor||.5),this.backoff=new Td({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(null==t.timeout?2e4:t.timeout),this.readyState="closed",this.uri=e,this.connecting=[],this.lastPing=null,this.encoding=!1,this.packetBuffer=[];var n=t.parser||kd;this.encoder=new n.Encoder,this.decoder=new n.Decoder,this.autoConnect=!1!==t.autoConnect,this.autoConnect&&this.open()}Rd.prototype.emitAll=function(){for(var e in this.emit.apply(this,arguments),this.nsps)Od.call(this.nsps,e)&&this.nsps[e].emit.apply(this.nsps[e],arguments)},Rd.prototype.updateSocketIds=function(){for(var e in this.nsps)Od.call(this.nsps,e)&&(this.nsps[e].id=this.generateId(e))},Rd.prototype.generateId=function(e){return("/"===e?"":e+"#")+this.engine.id},Sd(Rd.prototype),Rd.prototype.reconnection=function(e){return arguments.length?(this._reconnection=!!e,this):this._reconnection},Rd.prototype.reconnectionAttempts=function(e){return arguments.length?(this._reconnectionAttempts=e,this):this._reconnectionAttempts},Rd.prototype.reconnectionDelay=function(e){return arguments.length?(this._reconnectionDelay=e,this.backoff&&this.backoff.setMin(e),this):this._reconnectionDelay},Rd.prototype.randomizationFactor=function(e){return arguments.length?(this._randomizationFactor=e,this.backoff&&this.backoff.setJitter(e),this):this._randomizationFactor},Rd.prototype.reconnectionDelayMax=function(e){return arguments.length?(this._reconnectionDelayMax=e,this.backoff&&this.backoff.setMax(e),this):this._reconnectionDelayMax},Rd.prototype.timeout=function(e){return arguments.length?(this._timeout=e,this):this._timeout},Rd.prototype.maybeReconnectOnOpen=function(){!this.reconnecting&&this._reconnection&&0===this.backoff.attempts&&this.reconnect()},Rd.prototype.open=Rd.prototype.connect=function(e,t){if(this.readyState,~this.readyState.indexOf("open"))return this;this.uri,this.engine=bd(this.uri,this.opts);var n=this.engine,i=this;this.readyState="opening",this.skipReconnect=!1;var o=Cd(n,"open",(function(){i.onopen(),e&&e()})),s=Cd(n,"error",(async function(t){if(i.uri=Id.uri(),i.cleanup(),i.readyState="closed",i.emitAll("connect_error",t),e){var n=new Error("Connection error");n.data=t,e(n)}else i.maybeReconnectOnOpen()}));if(!1!==this._timeout){var r=this._timeout,a=setTimeout((function(){o.destroy(),n.close(),n.emit("error","timeout"),i.emitAll("connect_timeout",r)}),r);this.subs.push({destroy:function(){clearTimeout(a)}})}return this.subs.push(o),this.subs.push(s),this},Rd.prototype.onopen=function(){this.cleanup(),this.readyState="open",this.emit("open");var e=this.engine;this.subs.push(Cd(e,"data",wd(this,"ondata"))),this.subs.push(Cd(e,"ping",wd(this,"onping"))),this.subs.push(Cd(e,"pong",wd(this,"onpong"))),this.subs.push(Cd(e,"error",wd(this,"onerror"))),this.subs.push(Cd(e,"close",wd(this,"onclose"))),this.subs.push(Cd(this.decoder,"decoded",wd(this,"ondecoded")))},Rd.prototype.onping=function(){this.lastPing=new Date,this.emitAll("ping")},Rd.prototype.onpong=function(){this.emitAll("pong",new Date-this.lastPing)},Rd.prototype.ondata=function(e){this.decoder.add(e)},Rd.prototype.ondecoded=function(e){this.emit("packet",e)},Rd.prototype.onerror=function(e){this.emitAll("error",e)},Rd.prototype.socket=function(e,t){var n=this.nsps[e];if(!n){n=new xd(this,e,t),this.nsps[e]=n;var i=this;n.on("connecting",o),n.on("connect",(function(){n.id=i.generateId(e)})),this.autoConnect&&o()}function o(){~Ed(i.connecting,n)||i.connecting.push(n)}return n},Rd.prototype.destroy=function(e){var t=Ed(this.connecting,e);~t&&this.connecting.splice(t,1),this.connecting.length||this.close()},Rd.prototype.packet=function(e){var t=this;e.query&&0===e.type&&(e.nsp+="?"+e.query),t.encoding?t.packetBuffer.push(e):(t.encoding=!0,this.encoder.encode(e,(function(n){for(var i=0;i<n.length;i++)t.engine.write(n[i],e.options);t.encoding=!1,t.processPacketQueue()})))},Rd.prototype.processPacketQueue=function(){if(this.packetBuffer.length>0&&!this.encoding){var e=this.packetBuffer.shift();this.packet(e)}},Rd.prototype.cleanup=function(){for(var e=this.subs.length,t=0;t<e;t++)this.subs.shift().destroy();this.packetBuffer=[],this.encoding=!1,this.lastPing=null,this.decoder.destroy()},Rd.prototype.close=Rd.prototype.disconnect=function(){this.skipReconnect=!0,this.reconnecting=!1,"opening"===this.readyState&&this.cleanup(),this.backoff.reset(),this.readyState="closed",this.engine&&this.engine.close()},Rd.prototype.onclose=function(e){this.cleanup(),this.backoff.reset(),this.readyState="closed",this.emit("close",e),this._reconnection&&!this.skipReconnect&&this.reconnect()},Rd.prototype.reconnect=function(){if(_d.isBackend(),this.reconnecting||this.skipReconnect)return this;var e=this;if(this.backoff.attempts>=this._reconnectionAttempts)this.backoff.reset(),this.emitAll("reconnect_failed"),this.reconnecting=!1;else{var t=this.backoff.duration();this.reconnecting=!0;var n=setTimeout((function(){if(_d.isBackend())return e.reconnecting=!1,e.reconnect(),void e.emitAll("reconnect_error","Uniapp running backend, skipped reconnect...");e.skipReconnect||(e.emitAll("reconnect_attempt",e.backoff.attempts),e.emitAll("reconnecting",e.backoff.attempts),e.skipReconnect||e.open((function(t){t?(e.reconnecting=!1,e.reconnect(),e.emitAll("reconnect_error",t.data)):e.onreconnect()})))}),t);this.subs.push({destroy:function(){clearTimeout(n)}})}},Rd.prototype.onreconnect=function(){var e=this.backoff.attempts;this.reconnecting=!1,this.backoff.reset(),this.updateSocketIds(),this.emitAll("reconnect",e)},function(e,t){var n=_u,i=Ou,o=Ad;yu.exports("socket.io-client"),e.exports=t=r;var s=t.managers={};function r(e,t){"object"==typeof e&&(t=e,e=void 0),t=t||{};var i,r=n(e),a=r.source,c=r.id,l=r.path,u=s[c]&&l in s[c].nsps;return t.forceNew||t["force new connection"]||!1===t.multiplex||u?i=o(a,t):(s[c]||(s[c]=o(a,t)),i=s[c]),r.query&&!t.query&&(t.query=r.query),i.socket(r.path,t)}t.protocol=i.protocol,t.connect=r,t.Manager=Ad,t.Socket=ld.exports}(fu,fu.exports);const Pd=fu.exports;class Md{constructor(){this.io=Pd,this.status=Ka.DISCONNECTED,this.permissions=[Jc.NONE],this.connectedObservers=[],this.disconnectedObservers=[]}connect(){this.status=Ka.CONNECTING}socketio(){return this.io}on(e,t){this.io.on(e,t)}disconnect(){this.io.disconnect()}getStatus(){return this.status}addConnectedObserver(e){nc.isFunction(e)&&this.connectedObservers.push(e)}addDisconnectedObserver(e){nc.isFunction(e)&&this.disconnectedObservers.push(e)}notify(e,t){for(let n=0;n<e.length;n++)e[n](t)}}class Nd extends Md{constructor(e){super(),this.reconnectingObservers=[],this.addReconnectingObserver(e.onReconnecting),this.addDisconnectedObserver(e.onDisconnected)}connect(e){super.connect(),this.io=this.io.connect(e.uri,e.opts),this.initListener()}initListener(){this.io.on("connect",(()=>{this.status=Ka.CONNECTED,this.notify(this.connectedObservers)})),this.io.on("reconnecting",(e=>{this.status=Ka.CONNECTING,this.notify(this.reconnectingObservers,e)})),this.io.on("disconnect",(()=>{this.status=Ka.DISCONNECTED,this.notify(this.disconnectedObservers)})),this.io.on("connect_error",(function(e){}))}addReconnectingObserver(e){this.reconnectingObservers.push(e)}}class Dd{static get(e){const t=encodeURIComponent(e)+"=",n=document.cookie.split("; ");for(const i of n)if(i.startsWith(t))return decodeURIComponent(i.substring(t.length));return null}static set(e,t,n,i,o="/",s=!1){let r=encodeURIComponent(e)+"="+encodeURIComponent(t);n instanceof Date&&(r+="; expires="+n.toGMTString()),o&&(r+="; path="+o),i&&(r+="; domain="+i),s&&(r+="; secure"),document.cookie=r}static remove(e,t,n="/",i=!1){Dd.set(e,"",new Date(0),t,n,i)}}class Bd{asyncGet(e){let t=this.get(e);return Promise.resolve(t)}asyncPut(e,t){return this.put(e,t),Promise.resolve()}get(e){let t=this.doGet(e);return t=JSON.parse(t),t}put(e,t){this.doPut(e,JSON.stringify(t))}}class Ld extends Bd{constructor(){super(),this.domain=null,this.domain="undefined"!=typeof location&&/^(?:[A-za-z0-9-]+\.)+[A-za-z]{2,4}(?:[\/\?#][\/=\?%\-&~`@[\]\':+!\.#\w]*)?$/.test(location.host)?location.host.split(".").slice(-2).join("."):null}doGet(e){return Dd.get(e)||null}doPut(e,t){const n=new Date(2030,12,31,0,0,0,0),i=this.domain;Dd.set(e,t,n,i)}remove(e){const t=this.domain;Dd.remove(e,t)}support(){return"undefined"!=typeof navigator&&!0===navigator.cookieEnabled}}class jd extends Bd{doGet(e){return localStorage.getItem(e)||null}doPut(e,t){localStorage.setItem(e,t)}remove(e){localStorage.removeItem(e)}support(){return!("undefined"!=typeof GameGlobal||"undefined"==typeof localStorage||!localStorage.setItem)}}class Ud extends Bd{doGet(e){return Nn.getStorageSync(e)||null}doPut(e,t){Nn.setStorageSync(e,t)}remove(e){Nn.removeStorageSync(e)}support(){return!("object"!=typeof Nn||!Nn.getStorageSync)}}class Fd extends Bd{doGet(e){return cc.sys.localStorage.getItem(e)||null}doPut(e,t){cc.sys.localStorage.setItem(e,t)}remove(e){cc.sys.localStorage.removeItem(e)}support(){return"undefined"!=typeof cc&&void 0!==cc.sys.localStorage}}class Gd extends Bd{doGet(e){return Mn.getStorageSync(e)||null}doPut(e,t){Mn.setStorageSync(e,t)}remove(e){Mn.removeStorageSync(e)}support(){return!("object"!=typeof Mn||!Mn.getStorageSync||"undefined"!=typeof tt)}}class qd extends Bd{asyncGet(e){return mc(this,void 0,void 0,(function*(){const t=yield Ja.asyncStorage.getItem(e);return JSON.parse(t)}))}asyncPut(e,t){return Ja.asyncStorage.setItem(e,JSON.stringify(t))}doPut(e,t){throw new Error("Method not implemented.")}remove(e){Ja.asyncStorage.removeItem(e)}support(){return Xa.currentFramework()===Va.REACT_NATIVE}doGet(e){throw new Error("Method not implemented.")}}class zd extends Bd{doGet(e){const t=my.getStorageSync({key:e}).data||null;return"string"==typeof JSON.parse(t)?JSON.parse(t):t}doPut(e,t){my.setStorageSync({key:e,data:JSON.stringify(t)})}remove(e){my.removeStorageSync({key:e})}support(){return!("undefined"==typeof my||!my.getStorageSync)}}class Hd extends Bd{doGet(e){return tt.getStorageSync(e)||null}doPut(e,t){tt.setStorageSync(e,t)}remove(e){tt.removeStorageSync(e)}support(){return!("object"!=typeof tt||!tt.getStorageSync)}}class $d extends Bd{doGet(e){return swan.getStorageSync(e)||null}doPut(e,t){swan.setStorageSync(e,t)}remove(e){swan.removeStorageSync(e)}support(){return!("undefined"==typeof swan||!swan.getStorageSync)}}class Vd{constructor(){this.supportedStorage=null;const e=Vd.storages;e.push(new Ud),e.push(new Fd),e.push(new jd),e.push(new Gd),e.push(new qd),e.push(new zd),e.push(new $d),e.push(new Hd),e.push(new Ld),this.dispatch(),this.supportedStorage}static localStorage(){return this.instance.supportedStorage}dispatch(){for(let e of Vd.storages)if(e.support()){this.supportedStorage=e;break}}}Vd.storages=new Array,Vd.instance=new Vd;class Kd{static get(){return mc(this,void 0,void 0,(function*(){let e,t=Vd.localStorage();return null!==t&&(e=yield t.asyncGet(Kd.SM_KEY)),e}))}static put(e){return mc(this,void 0,void 0,(function*(){var t=Vd.localStorage();let n=e.sm;null!==t&&n&&t.asyncPut(Kd.SM_KEY,n)}))}}Kd.SM_KEY="GE-SM";class Wd{static e(e,t){let n="";for(let s=0;s<e.length;s++)n+=(i=e.charCodeAt(s),o=void 0,(o=i)>=32&&o<=126?String.fromCharCode(function(e){let n=e+t;return n>126?n-126+32:n}(i)):String.fromCharCode(i));var i,o;return n}}class Xd{static initRNUniqueId(){if(Xa.currentFramework()===Va.REACT_NATIVE){let e=Ja.platform,t=e.constants,n={os:e.OS};return"android"===n.os?n.f=t.Fingerprint:n.v=e.Version,JSON.stringify(n)}return null}static initPlusDeviceId(){return new Promise(((e,t)=>{"undefined"!=typeof plus?plus.device.getInfo({success:t=>{e(t.uuid)},fail:e=>{t(e)}}):e(null)}))}static getVideoCard(){var e;if(oc.currentPlatform()===ic.BROWSER&&"undefined"!=typeof document){const t=document.createElement("canvas"),n=null!==(e=t.getContext("webgl"))&&void 0!==e?e:t.getContext("experimental-webgl");if(n&&"getExtension"in n){let e=0,t=0;if(navigator.userAgent.indexOf("Firefox")>-1)t=n.VENDOR,e=n.RENDERER;else{let i=n.getExtension("WEBGL_debug_renderer_info");if(!i)return null;t=i.UNMASKED_VENDOR_WEBGL,e=i.UNMASKED_RENDERER_WEBGL}const i={vendor:(n.getParameter(t)||"").toString(),renderer:(n.getParameter(e)||"").toString()};return JSON.stringify(i)}}return null}static z(){return mc(this,void 0,void 0,(function*(){const e={p:oc.currentPlatform(),f:Xa.currentFramework(),vc:this.getVideoCard(),rfp:this.initRNUniqueId()};return Wd.e(JSON.stringify(e),5)}))}}class Jd{constructor(e){this.rocketsBuffer=new Set,this.socket=e,this.socket.addConnectedObserver(this.onSocketConnected.bind(this))}emit(e){this.socket.status!==Ka.DISCONNECTED?(e.start(),this.doEmit(e)):e.fail({resultCode:"409",content:"Please connect first"})}doEmit(e){if(!e.complete)if(this.socket.status!==Ka.CONNECT_FAILED)if(this.isConnected())if(this.hasPermission(e)){let t=setTimeout((()=>{this.doEmit(e)}),e.singleTimeout);e.unique&&(e.params.retried=e.retried),this.socket.socketio().emit(e.name,e.params,(n=>{clearTimeout(t),200===n.resultCode||200==n.code?e.success(n):e.fail(n)})),e.retried++}else e.fail({resultCode:401,content:"No permission"});else this.isConnecting()&&this.rocketsBuffer.add(e);else e.fail({resultCode:408,content:"Failed to connect GoEasy."})}hasPermission(e){return!!this.socket.permissions.find((t=>t===e.permission))}isConnected(){return[Ka.CONNECTED,Ka.RECONNECTED,Ka.EXPIRED_RECONNECTED,Ka.DISCONNECTING].includes(this.socket.status)}isConnecting(){return[Ka.CONNECTING,Ka.RECONNECTING].includes(this.socket.status)}onSocketConnected(){this.emitBuffer()}emitBuffer(){Array.from(this.rocketsBuffer).forEach((e=>{this.rocketsBuffer.delete(e),this.doEmit(e)}))}}class Qd extends zc{static init(){Qd.i=new Qd}static fire(e,t){this.i.fire(e,t)}static on(e,t){this.i.on(e,t)}static off(e,t){this.i.off(e,t)}}class Yd extends Md{constructor(e,t){super(),this.ioSocket=null,this.sid=null,this.anonymous=!1,this.userId=null,this.artifactVersion=Qa,this.vname=null,this.uri=null,this.ioOpts=null,this.reconnectingTimes=0,this.messageObservers=new Map,this.connectFailedObservers=[],this.connectingObservers=[],this.expiredReconnectedObservers=[],this.options=e,this.ioSocket=new Nd({onDisconnected:this.onIoDisconnected.bind(this),onReconnecting:this.onIoReconnecting.bind(this)}),this.ioSocketEmitter=new Jd(this.ioSocket),this.ioSocket.addConnectedObserver(this.onIoReconnected.bind(this)),this.initOptions(t),this.connect()}initUserId(){let e=this.connectOptions.id;nc.isEmpty(e)?this.anonymous=!0:this.userId=e.toString()}socketio(){return this.ioSocket.socketio()}extendOptions(){let e=this.connectOptions;if(nc.isNull(e.data)||nc.isDef(e.data)&&!nc.isObject(e.data))throw{code:400,content:"TypeError: data requires an object."};if((nc.isDef(e.data)?String(e.data).length:0)>300&&nc.isObject(e)&&nc.isFunction(e.onFailed))throw{code:400,content:"user.data-length limit 300 byte."};if(nc.isObject(e.wxmpId)){if(nc.isEmpty(e.wxmpId.appid))throw{code:400,content:"wxmpId.appid is required."};if(nc.isEmpty(e.wxmpId.openid))throw{code:400,content:"wxmpId.openid is required. requires string."}}else if(nc.isPrimitive(e.wxmpId))throw{code:400,content:"TypeError: wxmpId requires an object."}}initUriAndOpts(){let e=this.options;gd.init(e.host,e.forceTLS,e.supportOldBrowser),this.uri=gd.uri();let t=["websocket"];!0===e.supportOldBrowser&&t.push("polling"),this.ioOpts={transports:t,timeout:dc.connect,reconnectionDelayMax:dc.reconnectionDelayMax}}onIoReconnected(){this.status===Ka.RECONNECTING&&this.authorize()}sendAck(e,t){this.ioSocket.io.emit(e,t)}initOptions(e){this.connectOptions=e,this.addConnectedObserver(e.onSuccess),this.addConnectFailedObserver(e.onFailed),this.addConnectingObserver(e.onProgress),this.initUserId()}connect(){this.initUriAndOpts(),this.extendOptions(),super.connect(),this.onConnecting(),this.ioSocket.connect({uri:this.uri,opts:this.ioOpts}),this.authorize()}disconnect(){return new Promise(((e,t)=>{this.status=Ka.DISCONNECTING;let n=()=>{this.ioSocket.disconnect(),this.status=Ka.DISCONNECTED,Qd.fire(al.DISCONNECTED),e()};const i=Fc.modules.get("GN");if(i&&(i.params.regId||this.connectOptions.wxmpId)){let e=e=>{t(e)},i=new Yc({name:pc.manualDisconnect,params:{},permission:Jc.READ,singleTimeout:dc.commonRequestSingle,totalTimeout:dc.commonRequestTotal,fail:e,success:n});Kc.Socket.e(i)}else n()}))}authorize(){return mc(this,void 0,void 0,(function*(){let e=this.connectOptions,t={appkey:this.options.appkey,userId:this.userId,userData:JSON.stringify(e.data),otp:e.otp,artifactVersion:this.artifactVersion,sid:this.sid,mP:yield Fc.getParams(),a:this.anonymous,z:yield Xd.z(),sm:yield Kd.get(),c:{n:this.vname,v:this.artifactVersion}};JSON.stringify(t);let n=new Yc({name:pc.authorize,params:t,permission:Jc.NONE,singleTimeout:dc.commonInfiniteSingle,totalTimeout:dc.commonInfiniteTotal,success:e=>{this.onAuthorizeSuccess(e)},fail:e=>{this.onAuthorizeFailed(e)}});this.ioSocketEmitter.emit(n)}))}onConnecting(){Qd.fire(al.CONNECTING,this.reconnectingTimes),this.notify(this.connectingObservers,this.reconnectingTimes)}onIoReconnecting(){this.reconnectingTimes++,this.status==Ka.CONNECTED||this.status==Ka.EXPIRED_RECONNECTED||this.status==Ka.RECONNECTING?this.status=Ka.RECONNECTING:this.status=Ka.CONNECTING,this.onConnecting()}onIoDisconnected(){this.status!==Ka.DISCONNECTING&&(this.status=Ka.RECONNECTING,Qd.fire(al.LOST),this.notify(this.disconnectedObservers))}onAuthorizeSuccess(e){Kd.put(e),Fc.setDatas(e.mD),this.status===Ka.RECONNECTING?this.sid!==e.sid?(this.status=Ka.EXPIRED_RECONNECTED,this.sid=e.sid,Qd.fire(al.EXPIRED_RECONNECTED),this.notify(this.expiredReconnectedObservers)):(this.status=Ka.RECONNECTED,Qd.fire(al.RECONNECTED)):(this.status=Ka.CONNECTED,this.sid=e.sid),e.enablePublish&&(this.permissions.find((e=>e==Jc.WRITE))||this.permissions.push(Jc.WRITE)),e.enableSubscribe&&(this.permissions.find((e=>e==Jc.READ))||this.permissions.push(Jc.READ)),this.reconnectingTimes=0,Qd.fire(al.CONNECTED),this.notify(this.connectedObservers)}onAuthorizeFailed(e){this.ioSocket.disconnect(),this.status=Ka.CONNECT_FAILED;let t={code:e.resultCode||408,content:e.content||"Host unreachable or timeout"};this.notify(this.connectFailedObservers,t)}addConnectingObserver(e){nc.isFunction(e)&&this.connectingObservers.push(e)}addConnectFailedObserver(e){nc.isFunction(e)&&this.connectFailedObservers.push(e)}addExpiredReconnectedObserver(e){nc.isFunction(e)&&this.expiredReconnectedObservers.push(e)}onMessage(e,t){this.ioSocket.io._callbacks.hasOwnProperty("$"+e)||this.ioSocket.io.on(e,t)}user(){let e=this.connectOptions;return e?{id:e.id,data:e.data}:null}}class Zd{constructor(e){this.guidList=[],this.socket=e}offMessage(e,t){Qd.off(al.NEW_MESSAGE+"_"+e,t)}onMessage(e,t){Qd.on(al.NEW_MESSAGE+"_"+e,t),this.socket.onMessage(e,(t=>{this.fire(e,t)}))}fire(e,t){let n=this.filter(t);n&&Qd.fire(al.NEW_MESSAGE+"_"+e,n)}filter(e){if("string"==typeof e&&(e=JSON.parse(e)),e.i){if(this.guidList.findIndex((t=>t===e.i))>-1)return;this.guidList.unshift(e.i),this.guidList.length>300&&this.guidList.pop()}return e}}class eh{static init(e){this.i=new eh(e)}constructor(e){this.goeasyOptions=e}static connect(e,t){if(this.status()!==Ka.DISCONNECTED&&nc.isObject(e)&&nc.isFunction(e.onFailed))return void e.onFailed({code:408,content:"It is already connected, don't try again until disconnect() is called. "});this.confirmUserIdAndData(e),Qd.init();let n=this.i;Fc.preConnect(e),n.socket=new Yd(n.goeasyOptions,e),n.socket.vname=t,n.emitter=new Jd(n.socket),n.messageListener=new Zd(n.socket),Fc.postConnect()}static confirmUserIdAndData(e){if(Fc.modules.get("GIM"))nl.validateId(e.id,"id"),nl.validateObject(e.data,"data");else if("string"==typeof e.id&&e.id.length>60)throw{code:400,content:"id over max length 60"}}static e(e){this.i.emitter.emit(e)}static sendAck(e,t){this.i.socket.sendAck(e,t)}static status(){return this.i&&this.i.socket?this.i.socket.getStatus():Ka.DISCONNECTED}static on(e,t){Qd.on(e,t)}static off(e,t){Qd.off(e,t)}static offMessage(e,t){this.i.messageListener.offMessage(e,t)}static onMessage(e,t){this.i.messageListener.onMessage(e,t)}static disconnect(e){this.status()===Ka.CONNECTED||this.status()===Ka.RECONNECTED?this.i.socket.disconnect().then((()=>{fc.onSuccess(e)})).catch((t=>{fc.onFailed(e,t)})):fc.onFailed(e,{code:408,content:"Host unreachable or timeout"})}static user(){return this.i.socket.user()}}eh.EVENT=al;class th{static getInstance(){return th.instance||(th.instance=new th),th.instance}constructor(){this.synchronized=!0,this.onlineChanged=e=>{e.online?this.teamIds.add(e.teamId):this.teamIds.delete(e.teamId)},this.onDisconnected=()=>{this.queryMyTeamPromise=null,this.teamIds=null},this.onConnected=()=>{this.synchronized&&(this.queryMyTeamPromise=this.queryTeams())},eh.on(eh.EVENT.LOST,this.onDisconnected),eh.on(eh.EVENT.RECONNECTED,this.onConnected),eh.onMessage(rl.CS_ONLINE_CHANGED,this.onlineChanged)}queryTeams(){return this.queryMyTeamPromise||(this.queryMyTeamPromise=new Promise(((e,t)=>{let n=new Yc({name:pc.CS_MY_TEAMS,params:{},permission:Jc.READ,singleTimeout:dc.commonQuerySingle,totalTimeout:dc.commonQueryTotal,fail:e=>{t(e)},success:t=>{this.teamIds=new Set(t.content),this.synchronized=!0,e(this.teamIds)}});Kc.Socket.e(n)}))),this.queryMyTeamPromise}myTeams(){if(this.synchronized&&this.queryMyTeamPromise)return this.teamIds;throw"please query team first."}isOnline(e,t){return mc(this,void 0,void 0,(function*(){yield this.queryTeams(),fc.onSuccess(t,this.teamIds.has(e))}))}online(e,t){if(!nc.isObject(t.agentData)||!nc.isObject(t.teamData))throw{code:400,content:"agentData and teamData require an object"};let n=new pu(e,t.teamData,t.agentData),i=new Yc({name:pc.CS_ONLINE,params:n,permission:Jc.WRITE,singleTimeout:dc.commonRequestSingle,totalTimeout:dc.commonRequestTotal,fail:e=>{fc.onFailed(t,e)},success:n=>{this.teamIds.add(e),fc.onSuccess(t),ql.i.fire(Pl.CS_ONLINE_SUCCESS)}});Kc.Socket.e(i)}offline(e,t){let n=new du(e),i=new Yc({name:pc.CS_OFFLINE,params:n,permission:Jc.WRITE,singleTimeout:dc.commonRequestSingle,totalTimeout:dc.commonRequestTotal,fail:e=>{fc.onFailed(t,e)},success:n=>{this.teamIds.delete(e),fc.onSuccess(t),ql.i.fire(Pl.CS_OFFLINE_SUCCESS)}});Kc.Socket.e(i)}agents(e,t){let n=new hu(e),i=new Yc({name:pc.CS_AGENTS,params:n,permission:Jc.READ,singleTimeout:dc.commonQuerySingle,totalTimeout:dc.commonQueryTotal,fail:e=>{fc.onFailed(t,e)},success:e=>{e.content.forEach((e=>{e.data=JSON.parse(e.data)})),fc.onSuccess(t,e)}});Kc.Socket.e(i)}}class nh{constructor(e){this.onMessageReceived=e=>{let t=nh.session;if(e.scene()===Ya.CS&&t.liveOptions){let n=e,i=t.liveOptions.customerId;t.teamId===n.teamId&&n.customerId()===i&&(t.tryUpdateStatus(n),t.liveOptions.onNewMessage(n))}},this.teamId=e,ql.i.on(Pl.CS_AGENT_MESSAGE_RECEIVED,this.onMessageReceived),ql.i.on(Pl.CS_ACCEPTED,this.onMessageReceived),ql.i.on(Pl.CS_ENDED,this.onMessageReceived),ql.i.on(Pl.CS_TRANSFER,this.onMessageReceived),eh.on(al.DISCONNECTED,nh.destroy)}static live(e,t){return mc(this,void 0,void 0,(function*(){let n=t.customerId;nl.validateId(n,"customerId");let i=new lu(e,n);yield th.getInstance().queryTeams();let o=new Yc({name:pc.CS_LIVE_SESSION,params:i,permission:Jc.WRITE,singleTimeout:dc.commonRequestSingle,totalTimeout:dc.commonRequestTotal,fail:e=>{fc.onFailed(t,e)},success:n=>{nh.destroy(),this.session=new nh(e),this.session.liveOptions=t;let i=n.content.customerStatus;"ACCEPTED"===i.status&&(i.agent.data=JSON.parse(i.agent.data)),this.session.status=i,this.session.liveOptions.onStatusUpdated(this.session.status),fc.onSuccess(t)}});Kc.Socket.e(o)}))}customerId(){return this.liveOptions.customerId}static isMyCustomer(e){let t=nh.session;if(t&&t.teamId===e.teamId&&t.customerId()===e.customerId()){let n=th.getInstance().myTeams(),i=t.status.agent;return n.has(e.teamId)&&(!i||i.id===Kc.Socket.user().id)}return!0}static isMyMessage(e){let t=Kl.byIMMessage(e);return e.type===Nl.TRANSFER&&e.payload.transferTo.id===Kc.Socket.user().id||this.isMyCustomer(t)}static quit(e){let t=nh.session;if(t){let n=t.liveOptions.customerId;nl.validateId(n,"customerId");let i=new lu(t.teamId,n),o=new Yc({name:pc.CS_QUIT_LIVE,params:i,permission:Jc.WRITE,singleTimeout:dc.commonRequestSingle,totalTimeout:dc.commonRequestTotal,fail:t=>{fc.onFailed(e,t)},success:t=>{nh.destroy(),fc.onSuccess(e)}});Kc.Socket.e(o)}}tryUpdateStatus(e){if("FREE"!==this.status.status&&this.status.sessionId>e.sessionId)return;let t;switch(e.type){case Nl.ACCEPT:t=new uu,t.status="ACCEPTED",t.start=e.payload.sessionStart,t.sessionId=e.sessionId,t.agent=new tc(e.senderId,e.senderData);break;case Nl.END:t=new uu,t.status="FREE";break;case Nl.TRANSFER:t=new uu,t.status="ACCEPTED",t.start=e.payload.sessionStart,t.sessionId=e.sessionId,t.agent=e.payload.transferTo;break;default:"FREE"===this.status.status&&(t=new uu,t.status="PENDING",t.start=e.timestamp,t.sessionId=e.sessionId)}t&&(this.status=t,this.liveOptions.onStatusUpdated(t))}}nh.destroy=()=>{let e=nh.session;e&&(ql.i.off(Pl.CS_AGENT_MESSAGE_RECEIVED,e.onMessageReceived),ql.i.off(Pl.CS_ACCEPTED,e.onMessageReceived),ql.i.off(Pl.CS_ENDED,e.onMessageReceived),ql.i.off(Pl.CS_TRANSFER,e.onMessageReceived),eh.off(al.DISCONNECTED,nh.destroy),nh.session=null)};class ih extends cu{constructor(e){super(e),this.unread=0,this.markingAmount=0}loadHistory(e,t){return mc(this,void 0,void 0,(function*(){return nc.isUndef(t)?t=10:t>30&&(t=30),yield this.loadServerMessages(e,t)}))}loadServerMessages(e,t){return mc(this,void 0,void 0,(function*(){let n=new ou(this.target.id.toString(),this.target.scene,e,t,this.target.teamId),i=yield this.remoteHistory.loadServerMessages(this.target,n);return i.userOffsets.forEach((e=>{this.userOffsets.updateOffset(e.userId,e.offset)})),i.messages}))}deleteMessages(e){return mc(this,void 0,void 0,(function*(){fc.onFailed(e,"Delete CS message is not supported yet")}))}initMaxMessageAndOffsets(e,t){t.forEach((e=>{this.userOffsets.updateOffset(e.userId,e.offset)})),(nc.isUndef(this.acceptedMaxMessage)||this.acceptedMaxMessage.timestamp<e.timestamp)&&this.increaseUnreadAmount(e),this.saveAcceptedMessage(e)}initPendingMaxMessageAndOffsets(e,t){t.forEach((e=>{this.userOffsets.updateOffset(e.userId,e.offset)})),this.savePendingMessage(e)}savePendingMessage(e){this.pendingMaxMessage?this.pendingMaxMessage.timestamp<e.timestamp&&(this.pendingMaxMessage=e):this.pendingMaxMessage=e}saveAcceptedMessage(e){this.acceptedMaxMessage?this.acceptedMaxMessage.timestamp<e.timestamp&&(this.acceptedMaxMessage=e):this.acceptedMaxMessage=e}onMessageSending(e){this.saveAcceptedMessage(e),ql.i.fire(Pl.MAX_MESSAGE_CHANGED,e)}onMessageSendSuccess(e){this.saveAcceptedMessage(e),this.userOffsets.updateOffset(e.senderId,e.timestamp),this.acceptedMaxMessage===e&&ql.i.fire(Pl.MAX_MESSAGE_CHANGED,e)}onMessageSendFailed(e){this.acceptedMaxMessage===e&&ql.i.fire(Pl.MAX_MESSAGE_CHANGED,e)}onMessageReceived(e){nh.isMyMessage(e)&&(!e.accepted||e.senderId!==Kc.Socket.user().id&&e.type===Nl.ACCEPT?this.savePendingMessage(e):this.saveAcceptedMessage(e),this.userOffsets.updateOffset(e.senderId,e.timestamp),this.increaseUnreadAmount(e),ql.i.fire(Pl.MAX_MESSAGE_CHANGED,e))}increaseUnreadAmount(e){(e.sendByCustomer()||e.type===Nl.TRANSFER&&e.senderId!==Kc.Socket.user().id)&&this.userOffsets.myOffset()<e.timestamp&&e.accepted&&(this.unread+=1)}markRead(){return mc(this,void 0,void 0,(function*(){let e=this.maxAcceptedMessageTime();nh.isMyCustomer(this.target)&&this.preMark(e)&&(yield this.remoteHistory.updateServerOffsets(e,this.target),this.postMark(e))}))}preMark(e){let t=this.userOffsets.myOffset();return e>this.userOffsets.markingTime&&e>t&&(this.userOffsets.markingTime=e,this.markingAmount=this.unread,!0)}postMark(e){e===this.userOffsets.markingTime&&(this.unread-=this.markingAmount,this.markingAmount=0,this.userOffsets.updateOffset(Kc.Socket.user().id,e),ql.i.fire(Pl.UNREAD_AMOUNT_CHANGED,this.target))}syncMarkedMessage(e){}getMaxMessage(e){return e?this.acceptedMaxMessage:this.pendingMaxMessage}unreadAmount(e){return e?this.unread:0}existsMessage(e){return this.acceptedMaxMessage&&this.acceptedMaxMessage.messageId===e.messageId||this.pendingMaxMessage&&this.pendingMaxMessage.messageId===e.messageId}maxAcceptedMessageTime(){return this.acceptedMaxMessage?this.acceptedMaxMessage.timestamp:0}maxTime(e){let t=this.getMaxMessage(e);return t?t.timestamp:0}}class oh extends cu{constructor(e){super(e)}deleteMessages(e){return mc(this,void 0,void 0,(function*(){fc.onFailed(e,"Delete CS message is not supported yet")}))}}class sh{static validateMessageArray(e){if(!nc.isArray(e)||nc.isEmpty(e))throw{code:400,content:"messages requires non empty array"};if(e.length>20)throw{code:400,content:"The maximum number of messages is 20"};let t=Kl.byIMMessage(e[0]);for(let n=0;n<e.length;n++){let i=e[n];if(!(i instanceof Bl))throw{code:400,content:"message["+n+"] is not a correct message"};if(n>0){let e=Kl.byIMMessage(i);if(e.scene!==t.scene||e.id!==t.id)throw{code:400,content:"each message must be from the same friend or group"}}}}}class rh{static init(){return rh.instance=new rh,rh.instance}constructor(){this.map=new Map,this.onMessageSending=e=>{let t=Kl.byIMMessage(e);this.findOrCreateHistory(t).onMessageSending(e)},this.onMessageSendSuccess=e=>{let t=Kl.byIMMessage(e);this.findHistory(t).onMessageSendSuccess(e)},this.onMessageSendFailed=e=>{let t=Kl.byIMMessage(e);this.findHistory(t).onMessageSendFailed(e)},this.onMessageReceived=e=>{let t=Kl.byIMMessage(e),n=this.findOrCreateHistory(t);n.expiredTime>0&&(this.map.delete(t.toString()),n=this.findOrCreateHistory(t)),n.onMessageReceived(e)},this.onRemoteMarkRead=e=>{let t=Kl.byMessageReadRemoteEvent(e),n=this.findHistory(t);n&&n.syncMarkedMessage(e)},this.onRemoteMessageDeleted=e=>{let t=Kl.byIMMessageDeletedEvent(e),n=this.findHistory(t);n&&n.syncDeletedMessage(e.deleterId,e.times)},this.onMessageRecalled=e=>{let t=Kl.byConversationId(e.scene,e.conversationId),n=this.findHistory(t);n&&n.recallMessages(e)},this.onDisconnected=()=>{this.map.forEach(((e,t)=>{e.expire()}))},this.onReconnected=()=>{au.fire(Dl.HISTORY_EXPIRED)},this.destroy=()=>{},this.initialListeners()}initialListeners(){ql.i.on(Pl.MESSAGE_SENDING,this.onMessageSending),ql.i.on(Pl.MESSAGE_SEND_SUCCESS,this.onMessageSendSuccess),ql.i.on(Pl.MESSAGE_SEND_FAILED,this.onMessageSendFailed),ql.i.on(Pl.MESSAGE_RECEIVED,this.onMessageReceived),ql.i.on(Pl.CS_AGENT_MESSAGE_RECEIVED,this.onMessageReceived),ql.i.on(Pl.CS_ACCEPTED,this.onMessageReceived),ql.i.on(Pl.CS_ENDED,this.onMessageReceived),ql.i.on(Pl.CS_TRANSFER,this.onMessageReceived),ql.i.on(Pl.MESSAGE_RECALLED,this.onMessageRecalled),eh.onMessage(rl.IM_MSG_READ,this.onRemoteMarkRead),eh.onMessage(rl.IM_MSG_DELETED,this.onRemoteMessageDeleted),eh.on(eh.EVENT.LOST,this.onDisconnected),eh.on(eh.EVENT.RECONNECTED,this.onReconnected)}loadHistory(e,t){return mc(this,void 0,void 0,(function*(){let n=this.queryToTarget(e,t),i=this.findOrCreateHistory(n);i.expiredTime>0&&(this.map.delete(n.toString()),i=this.findOrCreateHistory(n));let o=yield i.loadHistory(e.lastTimestamp,e.limit);fc.onSuccess(e,{code:200,content:o})}))}queryToTarget(e,t){if(nc.isDef(e.userId))return new Kl(Ya.PRIVATE,e.userId);if(nc.isDef(e.groupId))return new Kl(Ya.GROUP,e.groupId);if(nc.isDef(e.type)){if(!Object.values(Ya).includes(e.type))throw new Error("incorrect type, must be: "+Object.values(Ya));if(nc.isUndef(e.id))throw new Error("If type is not empty, id is required.");return Ya.CS==e.type&&nc.isUndef(t)&&(t=e.id),new Kl(e.type,e.id,t)}throw new Error("incorrect query options.")}privateMarkAsRead(e){return mc(this,void 0,void 0,(function*(){if(nc.isUndef(e.userId))throw new Error("userId could not be empty.");let t=Kl.byScene(Ya.PRIVATE,e.userId);yield this.markAsRead(t,e)}))}groupMarkAsRead(e){return mc(this,void 0,void 0,(function*(){if(nc.isUndef(e.groupId))throw new Error("groupId could not be empty.");let t=Kl.byScene(Ya.GROUP,e.groupId);yield this.markAsRead(t,e)}))}markMessageAsRead(e,t){return mc(this,void 0,void 0,(function*(){if(nc.isUndef(e.id))throw new Error("id could not be empty.");if(!Object.values(Ya).includes(e.type))throw new Error("incorrect type, must be: "+Object.values(Ya));Ya.CS==e.type&&nc.isUndef(t)&&(t=e.id);let n=Kl.byScene(e.type,e.id,t);yield this.markAsRead(n,e)}))}markAsRead(e,t){return mc(this,void 0,void 0,(function*(){let n=this.findHistory(e);n&&(yield n.markRead()),fc.onSuccess(t)}))}deleteMessage(e){return mc(this,void 0,void 0,(function*(){this.validateMessageArray(e.messages),Xl.validate(e);let t=e.messages[0],n=Kl.byIMMessage(t),i=this.findHistory(n);if(!i)throw{code:400,content:"No message that could be deleted"};yield i.deleteMessages(e)}))}findOrCreateHistory(e){let t=this.findHistory(e);return t||(t=e.scene===Ya.CS?Kc.Socket.user().id===e.customerId()?new oh(e):new ih(e):new cu(e),this.map.set(e.toString(),t),t)}static get(e){return rh.instance.findOrCreateHistory(e)}findHistory(e){return this.map.get(e.toString())}validateMessageArray(e){sh.validateMessageArray(e)}}class ah{constructor(e){this.top=!1,this.data=null,this.dataLoaded=!1,this.target=e}toDto(){let e=this.target.scene,t=this.target.id,n=new ec;return e===Ya.PRIVATE?n.userId=t:e===Ya.GROUP?n.groupId=t:e===Ya.CS&&(n.id=this.target.teamId),n.type=e,n.lastMessage=this.getMaxMessage(),n.unread=this.getUnreadAmount(),n.top=this.top,n.data=this.data,n}getMaxMessage(){return rh.get(this.target).getMaxMessage()}getUnreadAmount(){return rh.get(this.target).unreadAmount()}maxMessageTime(){return rh.get(this.target).maxTime()}}class ch extends ah{constructor(e){super(e),this.accepted=!1}toDto(){let e=new ec,t=this.target.scene,n=this.target.id,i=this.target.teamId;return e.id=n,e.teamId=i,e.type=t,e.lastMessage=this.getMaxMessage(),e.unread=this.getUnreadAmount(),e.top=this.top,e.data=this.data,e.ended=this.isEnded(),e}isEnded(){let e=this.getMaxMessage(),t=e.type,n=e.payload;return t===Nl.END||t===Nl.TRANSFER&&n.transferTo.id!==Kc.Socket.user().id}getMaxMessage(){return rh.get(this.target).getMaxMessage(this.accepted)}getUnreadAmount(){return rh.get(this.target).unreadAmount(this.accepted)}maxMessageTime(){return rh.get(this.target).maxTime(this.accepted)}}class lh{constructor(e,t,n,i){this.type=e,this.top=t,this.targetId=n,this.teamId=i}}class uh{constructor(e,t,n){this.type=e,this.targetId=t,this.teamId=n}}class ph{constructor(e,t,n){this.type=e,this.targetId=t,this.teamId=n}}class dh{top(e,t){let n=new lh(e.scene,t,e.id,e.teamId);return new Promise(((e,t)=>{let i=new Yc({name:pc.topConversation,params:n,permission:Jc.WRITE,singleTimeout:dc.commonRequestSingle,totalTimeout:dc.commonRequestTotal,success:n=>{200===n.code?e(n):t(n)},fail:e=>{t(e)}});Kc.Socket.e(i)}))}remove(e){let t=new uh(e.scene,e.id,e.teamId);return new Promise(((e,n)=>{let i=new Yc({name:pc.removeConversation,params:t,permission:Jc.WRITE,singleTimeout:dc.commonRequestSingle,totalTimeout:dc.commonRequestTotal,success:t=>{200==t.code?e(t):n(t)},fail:e=>{n(e)}});Kc.Socket.e(i)}))}query(e){return new Promise(((t,n)=>{let i=new Yc({name:e,params:{},permission:Jc.READ,singleTimeout:dc.commonQuerySingle,totalTimeout:dc.commonQueryTotal,fail:e=>{n(e)},success:e=>mc(this,void 0,void 0,(function*(){t(e)}))});Kc.Socket.e(i)}))}loadData(e){let t=new ph(e.scene,e.id,e.teamId);return new Promise(((e,n)=>{let i=new Yc({name:pc.imData,params:t,permission:Jc.READ,singleTimeout:dc.commonQuerySingle,totalTimeout:dc.commonQueryTotal,success:t=>{let n=JSON.parse(t.content);e(n)},fail:e=>{n(e)}});Kc.Socket.e(i)}))}}dh.instance=new dh;class hh{constructor(){this.list=new Array,this.builder=new tu,this.remoteConversations=dh.instance,this.synchronized=!1,ql.i.on(Pl.MAX_MESSAGE_CHANGED,this.onMaxMessageChanged.bind(this)),ql.i.on(Pl.UNREAD_AMOUNT_CHANGED,this.onUnreadMessageChanged.bind(this)),ql.i.on(Pl.MAX_MESSAGE_DELETED,this.onMaxMessageDeleted.bind(this))}onUnreadMessageChanged(e){this.findConversation(e)&&this.fireUpdated()}fireUpdated(){this.debounce(this.triggerUpdate.bind(this))}triggerUpdate(){let e=this.loadLocalConversations(),t=this.getUpdatedEventName();au.fire(t,{unreadTotal:e.content.unreadTotal,conversations:e.content.conversations})}getUpdatedEventName(){return Dl.CONVERSATIONS_UPDATED}latestConversations(e){return mc(this,void 0,void 0,(function*(){this.synchronized||(yield this.loadServerConversations());let t=this.loadLocalConversations();fc.onSuccess(e,t)}))}loadServerConversations(){return mc(this,void 0,void 0,(function*(){let e=this.rocketName(),t=yield this.remoteConversations.query(e);this.convertAbbrConversation(t.content),this.synchronized=!0}))}rocketName(){return pc.imLastConversations}convertAbbrConversation(e){let t=e;for(const n of t){let e=n.t,t=n.top,i=n.d?JSON.parse(n.d):{},o=n.userOffsets;n.lmsg.t=e;let s=n.lmsg,r=this.builder.build(s),a=Kl.byIMMessage(r),c=this.findConversation(a);nc.isUndef(c)?(c=this.buildByAbbr(n,r),this.insertOne(c)):(c.top=t,c.data=i),a.scene===Ya.GROUP&&(r.x=1),rh.get(a).initMaxMessageAndOffsets(r,o),this.correctPosition(c)}}onMaxMessageDeleted(e){this.removeConversation(e)}onMaxMessageChanged(e){return mc(this,void 0,void 0,(function*(){if(e.scene()===Ya.CS){let t=e;if(Kc.Socket.user().id!=t.customerId()&&(!1===t.accepted||t.type===Nl.ACCEPT&&t.senderId!=Kc.Socket.user().id))return}yield this.saveOrUpdateConversation(e)}))}saveOrUpdateConversation(e){return mc(this,void 0,void 0,(function*(){let t=e.status,n=Kl.byIMMessage(e),i=this.findConversation(n);nc.isUndef(i)&&t!==Za.FAIL&&(i=this.buildByMessage(e),this.insertOne(i),t===Za.SUCCESS&&(i.data=yield this.remoteConversations.loadData(n),i.dataLoaded=!0)),t===Za.SENDING&&(i.data=e.getToData(),i.dataLoaded=!0),i&&i.dataLoaded&&(this.correctPosition(i),this.fireUpdated())}))}debounce(e){clearTimeout(this.timer),this.timer=setTimeout((()=>{e()}),500)}loadLocalConversations(){let e=0,t=new Array;for(const n of this.list)if(n.dataLoaded&&n.getMaxMessage()){e+=n.getUnreadAmount();let i=n.toDto();t.push(i)}return{code:200,content:{unreadTotal:e,conversations:t}}}findConversationIndex(e){return this.list.findIndex((t=>e.toString()===t.target.toString()))}findConversation(e){let t=this.findConversationIndex(e);return this.list[t]}removeLocalConversation(e){let t=this.findConversationIndex(e.target);this.list.splice(t,1)}insertOne(e){hh.sortedInserter.insert(this.list,e),this.list.length>hh.CONVERSATIONS_MAX_LENGTH&&0===this.list[this.list.length-1].getUnreadAmount()&&this.list.pop()}correctPosition(e){this.removeLocalConversation(e),this.insertOne(e)}removeConversation(e){let t=this.findConversation(e);t&&(this.removeLocalConversation(t),this.fireUpdated())}top(e,t,n){return mc(this,void 0,void 0,(function*(){if(!nc.isBoolean(t))throw new Error("top must be boolean.");let i=this.findConversation(e);if(!i)throw new Error("conversation does not exist.");i.top!=t&&(yield this.remoteConversations.top(e,t),i.top=t,this.correctPosition(i)),this.fireUpdated(),fc.onSuccess(n)}))}remove(e,t){return mc(this,void 0,void 0,(function*(){let n=this.findConversation(e);if(!n)throw new Error("conversation does not exist.");if(n instanceof ch&&!n.isEnded())throw new Error("CS conversation can only be deleted after it ends");yield this.remoteConversations.remove(e),this.removeLocalConversation(n),this.fireUpdated(),fc.onSuccess(t)}))}buildByAbbr(e,t){let n,i=Kl.byIMMessage(t);if(e.t===Ya.CS){let e=t;Kc.Socket.user().id===e.customerId()?n=new ah(i):(n=new ch(i),n.accepted=e.accepted)}else n=new ah(i);return n.dataLoaded=!0,n.top=e.top,n.data=e.d?JSON.parse(e.d):{},n}buildByMessage(e){let t,n=Kl.byIMMessage(e);if(e.scene()===Ya.CS){let i=e;Kc.Socket.user().id===i.customerId()?t=new ah(n):(t=new ch(n),t.accepted=i.accepted)}else t=new ah(n);return t}}hh.CONVERSATIONS_MAX_LENGTH=200,hh.sortedInserter=new class extends $l{compare(e,t){let n;if(e.top==t.top){let i=e.maxMessageTime();n=t.maxMessageTime()-i}else n=e.top?-1:1;return 0===n?0:n>0?1:-1}};class fh extends Uc{static init(){return this.module=new fh,this.module.name=this.GIM_MODULE_NAME,this.initGN(),this.module}static initGN(){el.addAssembler(new class{assemble(e){let t={messageId:e.id,timestamp:e.tm,type:e.t,senderId:e.sid,toType:e.tt};return e.tt===Ya.GROUP&&(t.groupId=e.gid),t}support(e){return!!e.sid}})}postConnect(){yf.init()}static check(){if(!this.module)throw{code:400,content:"IM not initialized. Please include 'IM' in the 'modules' during GoEasy initialization."}}}fh.GIM_MODULE_NAME="GIM";class mh extends hh{constructor(){super(),this.expired=!1,ql.i.on(Pl.CS_ONLINE_SUCCESS,this.onCSOnlineSuccess.bind(this)),ql.i.on(Pl.CS_OFFLINE_SUCCESS,this.onCSOfflineSuccess.bind(this)),eh.on(eh.EVENT.LOST,this.onDisconnected.bind(this)),eh.on(eh.EVENT.RECONNECTED,this.onConnected.bind(this))}onMaxMessageChanged(e){return mc(this,void 0,void 0,(function*(){if(e.scene()===Ya.CS){let t=e;if(t.customerId()!=Kc.Socket.user().id&&(!1===t.accepted||t.type===Nl.ACCEPT))if(Nl.ACCEPT===e.type){let t=Kl.byIMMessage(e);this.removeConversation(t)}else yield this.saveOrUpdateConversation(e)}}))}latestConversations(e){const t=Object.create(null,{latestConversations:{get:()=>super.latestConversations}});return mc(this,void 0,void 0,(function*(){let n=this.synchronized;yield t.latestConversations.call(this,e),this.list.length>0&&!n&&this.fireUpdated()}))}onUnreadMessageChanged(e){}onCSOnlineSuccess(){return mc(this,void 0,void 0,(function*(){yield this.loadServerConversations(),this.fireUpdated()}))}onCSOfflineSuccess(){this.list=[],this.fireUpdated()}getUpdatedEventName(){return Dl.PENDING_CONVERSATIONS_UPDATED}rocketName(){return pc.CS_PENDING_CONVERSATION}convertAbbrConversation(e){return mc(this,void 0,void 0,(function*(){let t=e;for(const e of t){e.lastMessage.t=Ya.CS;let t=e.customerData,n=e.lastMessage,i=e.userOffsets,o=t?JSON.parse(t):{},s=this.builder.build(n),r=Kl.byIMMessage(s),a=this.findConversation(r);nc.isUndef(a)&&(a=new ch(r),a.accepted=s.accepted,a.dataLoaded=!0,this.insertOne(a)),a.top=!1,a.data=o,rh.get(r).initPendingMaxMessageAndOffsets(s,i),this.correctPosition(a)}}))}onDisconnected(){this.expired=!0}onConnected(){return mc(this,void 0,void 0,(function*(){this.expired&&fh.module&&fh.module.active&&(this.expired=!1,this.list=[],yield this.loadServerConversations(),this.fireUpdated())}))}}class gh{constructor(){this.conversations=new hh,this.pendingConversations=new mh}latestConversations(e){this.conversations.latestConversations(e)}latestPendingConversations(e){this.pendingConversations.latestConversations(e)}topPrivateConversation(e){let t=Kl.byScene(Ya.PRIVATE,e.userId);this.conversations.top(t,e.top,e)}topGroupConversation(e){let t=Kl.byScene(Ya.GROUP,e.groupId);this.conversations.top(t,e.top,e)}topConversation(e){let t=e.conversation;this.validateConversationDTO(t);let n=Kl.byConversationDTO(t);this.conversations.top(n,e.top,e)}removePrivateConversation(e){let t=Kl.byScene(Ya.PRIVATE,e.userId);this.conversations.remove(t,e)}removeGroupConversation(e){let t=Kl.byScene(Ya.GROUP,e.groupId);this.conversations.remove(t,e)}removeConversation(e){let t=e.conversation;this.validateConversationDTO(t);let n=Kl.byConversationDTO(t);this.conversations.remove(n,e)}validateConversationDTO(e){if(!(e instanceof ec))throw new Error("Incorrect conversation object.");{let t=e.lastMessage;if(t instanceof eu&&t.customerId()!==Kc.Socket.user().id&&!1===t.accepted)throw new Error("pending conversation cannot be topped or removed.")}}}class vh{constructor(){this.builder=new tu,Kc.Socket.onMessage(rl.imMessage,this.onMessageReceived.bind(this))}onMessageReceived(e){if(e.t!==Ya.CS){let t=this.builder.build(e);this.sendAck(t);let n=Kl.byIMMessage(t),i=n.scene;rh.get(n).existsMessage(t)||(this.createNotification(e),ql.i.fire(Pl.MESSAGE_RECEIVED,t),i===Ya.PRIVATE?au.fire(Dl.PRIVATE_MESSAGE_RECEIVED,t):i===Ya.GROUP&&au.fire(Dl.GROUP_MESSAGE_RECEIVED,t))}}sendAck(e){Kc.Socket.sendAck("imAck",{publishGuid:e.messageId})}createNotification(e){const t=Kc.N.supportAppNotification();if(!nc.isObject(e.nt)||e.s===Kc.Socket.user().id||!t)return;let n={id:e.i,tm:e.ts,t:e.mt,sid:e.s,tt:e.t};n.tt===Ya.GROUP&&(n.gid=e.r),Kc.N.createLocalNotification(e.nt.t,e.nt.c,n,e.nt.sound,e.nt.badge)}}class yh{constructor(){this.subscribedGroups=[],Kc.Socket.on(al.EXPIRED_RECONNECTED,this.expiredResubscribeGroups.bind(this))}expiredResubscribeGroups(){this.subscribedGroups.forEach((e=>mc(this,void 0,void 0,(function*(){yield this.doSubscribeGroup(e)}))))}subscribe(e){let t=e.groupIds;nl.validateIdArray(t,"groupIds");let n=new bh(t,e.accessToken);this.doSubscribeGroup(n).then((()=>{this.subscribedGroups.push(n),fc.onSuccess(e,{code:200,content:"ok"})})).catch((t=>{fc.onFailed(e,{code:t.resultCode||408,content:t.content||"Failed to subscribe group message"})}))}doSubscribeGroup(e){return new Promise(((t,n)=>{let i=e.groupIds.toString().split(","),o=new Yc({name:pc.subscribeGroups,params:{groupIds:i,at:e.accessToken},permission:Jc.WRITE,singleTimeout:dc.commonRequestSingle,totalTimeout:dc.commonRequestTotal,success:()=>{t()},fail:e=>{n(e)}});Kc.Socket.e(o)}))}unsubscribe(e){nl.validateId(e.groupId,"groupId"),e.groupId=e.groupId.toString();let t=new Yc({name:pc.unsubscribeGroup,params:{groupId:e.groupId},permission:Jc.READ,singleTimeout:dc.commonRequestSingle,totalTimeout:dc.commonRequestTotal,success:()=>{this.deleteSubscriptionByGroupId(e.groupId),fc.onSuccess(e,{code:200,content:"ok"})},fail:t=>{fc.onFailed(e,{code:t.resultCode||408,content:t.content||"Failed to unsubscribe group message"})}});Kc.Socket.e(t)}deleteSubscriptionByGroupId(e){this.subscribedGroups=this.subscribedGroups.filter((t=>{const n=t.groupIds.findIndex((t=>t==e));return n>-1&&t.groupIds.splice(n,1),t.groupIds.length>0}))}}class bh{constructor(e,t){this.groupIds=e,this.accessToken=t}}class xh{constructor(){this.newMessageReceived=e=>{let t=null;e.c&&(t=JSON.parse(e.c)),t&&t.events&&t.events.map((e=>{let n=e.userData?JSON.parse(e.userData):{},i={time:e.time,action:e.action,groupOnlineCount:t.userAmount,groupId:t.groupId,id:e.userId,data:n};au.fire(Dl.GROUP_PRESENCE,i)}))},eh.onMessage(rl.groupPresence,this.newMessageReceived)}presence(e){nl.validateIdArray(e.groupIds,"groupIds"),e.groupIds.toString().split(",");let t={groupIds:e.groupIds};this.emitRocket(pc.subscribeGroupPresence,t,(()=>{fc.onSuccess(e,{code:200,content:"ok"})}),(t=>{fc.onFailed(e,{code:t.code||408,content:t.content||"Failed to subscribe group message"})}),dc.commonRequestSingle,dc.commonRequestTotal)}unPresence(e){nl.validateId(e.groupId,"groupId"),e.groupId=e.groupId.toString();let t={groupId:e.groupId};this.emitRocket(pc.unsubscribeGroupPresence,t,(()=>{fc.onSuccess(e,{code:200,content:"ok"})}),(t=>{fc.onFailed(e,{code:t.code||408,content:t.content||"Failed to unsubscribe presence"})}),dc.commonRequestSingle,dc.commonRequestTotal)}emitRocket(e,t,n,i,o,s){let r=new Yc({name:e,params:t,singleTimeout:o,totalTimeout:s,permission:Jc.WRITE,success:n,fail:i});Kc.Socket.e(r)}}class Sh{get(e){nl.validateId(e.groupId,"groupId"),e.groupId=e.groupId.toString();let t=new Yc({name:pc.imGroupOnlineCount,params:{groupId:e.groupId},permission:Jc.READ,singleTimeout:dc.commonQuerySingle,totalTimeout:dc.commonQueryTotal,fail:function(t){fc.onFailed(e,t||{code:408,content:"Failed to query online group users"})},success:function(t){200==t.code?fc.onSuccess(e,t):fc.onFailed(e,t)}});Kc.Socket.e(t)}}class kh{doHereNow(e,t,n){let i=new Yc({name:e,params:t,permission:Jc.READ,singleTimeout:dc.commonQuerySingle,totalTimeout:dc.commonQueryTotal,fail:e=>{fc.onFailed(n,e)},success:e=>{let t=e.content;e.content=t.map((e=>{let t=e.userData?JSON.parse(e.userData):{};return{id:e.userId,data:t}})),fc.onSuccess(n,e)}});Kc.Socket.e(i)}}class Ch extends kh{hereNow(e){nl.validateId(e.groupId,"groupId"),e.groupId=e.groupId.toString();let t={groupId:e.groupId};this.doHereNow(pc.imGroupHereNow,t,e)}}class wh{constructor(){this.newMessageReceived=e=>{let t=[];e.c&&(t=JSON.parse(e.c).events||[]),t.map((e=>{let t=e.userData?JSON.parse(e.userData):{},n={time:e.time,action:e.action,id:e.userId,data:t};au.fire(Dl.USER_PRESENCE,n)}))},eh.onMessage(rl.userPresence,this.newMessageReceived)}presence(e){nl.validateIdArray(e.userIds,"userIds"),e.userIds.toString().split(",");let t={userIds:e.userIds};this.emitRocket(pc.subscribeUserPresence,t,(()=>{fc.onSuccess(e,{code:200,content:"ok"})}),(t=>{fc.onFailed(e,{code:t.code||408,content:t.content||"Failed to subscribe group message"})}),dc.commonRequestSingle,dc.commonRequestTotal)}unPresence(e){nl.validateId(e.userId,"userId"),e.userId=e.userId.toString();let t={userId:e.userId};this.emitRocket(pc.unsubscribeUserPresence,t,(()=>{fc.onSuccess(e,{code:200,content:"ok"})}),(t=>{fc.onFailed(e,{code:t.code||408,content:t.content||"Failed to unsubscribe presence"})}),dc.commonRequestSingle,dc.commonRequestTotal)}emitRocket(e,t,n,i,o,s){let r=new Yc({name:e,params:t,singleTimeout:o,totalTimeout:s,permission:Jc.WRITE,success:n,fail:i});Kc.Socket.e(r)}}class Eh extends kh{hereNow(e){let t=e.userIds;nl.validateIdArray(t,"userIds"),t.toString().split(","),this.doHereNow(pc.imHereNow,e,e)}}const Th=new class{fileExtension(e,t){if(nc.isString(e))try{let n=e.split(t);return n[n.length-1]}catch(n){throw Error(n)}}};class Ih{}class _h extends Ih{constructor(){super(...arguments),this.contentType="",this.name="",this.size=0,this.url=""}}class Oh extends _h{constructor(){super(...arguments),this.width=0,this.height=0}}class Ah{build(e){this.validate(e.createOptions);let t=this.create();return this.setPayload(e,t),t}}class Rh extends Ah{create(){return new _h}setPayload(e,t){let n=t,i=e.createOptions.file;n.url=i.path,n.name=i.name,n.size=i.size,n.contentType=i.type,e.complete=Promise.resolve()}validate(e){if(!nc.isObject(e))throw Error("it is an empty message.");if(!nc.isDef(e.file))throw Error("file is empty.")}}class Ph extends Rh{create(){return new Oh}setPayload(e,t){super.setPayload(e,t);let n=e.createOptions.file,i=t,o=n.path||n.tempFilePath,s=nc.isEmpty(n.name)||void 0===n.name?o:n.name;i.name="wx-image."+Th.fileExtension(s,"."),i.contentType="image/"+Th.fileExtension(s,"."),i.url=o,i.size=n.size,e.complete=new Promise(((e,t)=>{Mn.getImageInfo({src:i.url,success(t){i.width=t.width,i.height=t.height,e()},fail(e){t(e)}})}))}validate(e){super.validate(e)}}class Mh extends _h{constructor(){super(...arguments),this.duration=0}}class Nh extends Rh{create(){return new Mh}setPayload(e,t){super.setPayload(e,t);let n=e.createOptions.file,i=t,o=n.tempFilePath,s=nc.isEmpty(n.name)||null==n.name?o:n.name,r=n.duration,a=n.fileSize;i.url=o,i.size=a,i.duration=r/1e3,i.name="wx-audio."+Th.fileExtension(s,"."),i.contentType="audio/"+Th.fileExtension(s,"."),e.complete=Promise.resolve()}validate(e){super.validate(e)}}class Dh extends Ih{constructor(){super(...arguments),this.text=""}}class Bh extends Ah{create(){return new Dh}setPayload(e,t){let n=t,i=e.createOptions;n.text=i.text,e.complete=Promise.resolve()}validate(e){if(nc.isEmpty(e.text))throw{code:400,content:"text is empty"};if(!nc.isString(e.text))throw{code:400,content:"TypeError: text requires string."};if(""===e.text.trim())throw{code:400,content:"text is empty"};if(e.text.length>2500)throw{code:400,content:"Message text over max length 2500"}}}class Lh extends Ih{constructor(){super(...arguments),this.video=new Uh,this.thumbnail=new jh}}class jh{constructor(){this.name="",this.url="",this.width=0,this.height=0,this.contentType=""}initURL(e){oc.currentPlatform()===ic.BROWSER&&this.htmlUrl(e)}htmlUrl(e){let t=document.createElement("canvas");t.width=e.videoWidth,t.height=e.videoHeight,t.getContext("2d").drawImage(e,0,0,t.width,t.height),this.url=t.toDataURL("image/png")}}class Uh{constructor(){this.name="",this.url="",this.width=0,this.height=0,this.contentType="",this.size=0,this.duration=0}}class Fh extends Ah{create(){return new Lh}setPayload(e,t){let n=e.createOptions.file,i=t,o=i.video,s=i.thumbnail,{duration:r,height:a,size:c,tempFilePath:l,thumbTempFilePath:u,width:p,name:d=""}=n,h=nc.isEmpty(d)?l:d;o.contentType="video/"+Th.fileExtension(h,"."),o.name="wx-video."+Th.fileExtension(h,"."),o.url=l,o.width=s.width=p,o.height=s.height=a,o.size=c,o.duration=r,s.url=u,s.contentType="image/jpg",s.name="wx-thumbnail.jpg",e.complete=Promise.resolve()}validate(e){if(!nc.isObject(e))throw Error("it is an empty message.");if(!nc.isDef(e.file))throw Error("file is empty.")}}class Gh extends Ah{create(){return new _h}setPayload(e,t){let n=t,i=e.createOptions.file;n.url=i.fullPath||i.path,n.name=i.name,n.size=i.size,n.contentType=i.type,i.type,e.complete=Promise.resolve()}validate(e){if(!nc.isObject(e))throw Error("it is an empty message.");if(!nc.isDef(e.file))throw Error("file is empty.")}}class qh extends Gh{create(){return new Oh}setPayload(e,t){let n=t,i=e.createOptions.file;n.url=i.path,n.size=i.size;let o=nc.isEmpty(i.name)||void 0===i.name?i.path:i.name;n.contentType="image/"+Th.fileExtension(o,"."),n.name="uni-image."+Th.fileExtension(o,"."),e.complete=new Promise(((e,t)=>{Nn.getImageInfo({src:i.path,success(t){n.width=t.width,n.height=t.height,e()},fail(e){t(e)}})}))}validate(e){super.validate(e)}}class zh extends Gh{create(){return new Mh}setPayload(e,t){let n=e.createOptions,i=t,o=n.file,s=o.tempFilePath,r=nc.isEmpty(o.name)||null==o.name?s:o.name;i.url=s,i.name="uni-audio."+Th.fileExtension(r,"."),i.contentType="audio/"+Th.fileExtension(r,"."),e.complete=new Promise(((e,t)=>{Nn.getFileInfo({filePath:s,success:o=>{let r=o.size;if(i.size=r,0===r)e();else if(nc.isDef(n.file.duration))i.duration=n.file.duration/1e3,e();else{const n=Nn.createInnerAudioContext();n.src=s,n.onCanplay((function(o){o.errCode?(n.destroy(),t(o)):(i.duration=n.duration,n.destroy(),e())})),n.onError((i=>{n.destroy(),-99===i.errCode?e():t(i)}))}},fail(e){t(e)}})}))}validate(e){super.validate(e)}}class Hh extends Ah{create(){return new Lh}setPayload(e,t){let n=e.createOptions.file,i=t,o=i.video,s=i.thumbnail,{duration:r,height:a,size:c,tempFilePath:l,width:u,name:p=""}=n,d=nc.isEmpty(p)?l:p;o.size=c,o.width=u,o.height=a,o.url=l,o.duration=r,o.contentType="video/"+Th.fileExtension(d,"."),o.name="uni-video."+Th.fileExtension(d,"."),s.url=l,s.height=200,s.width=Number((o.width*s.height/o.height).toFixed(0)),s.contentType="image/jpg",s.name="uni-thumbnail.jpg",e.complete=Promise.resolve()}validate(e){if(!nc.isObject(e))throw Error("it is an empty message.");if(!nc.isDef(e.file))throw Error("file is empty.")}}class $h extends Ah{create(){return new _h}setPayload(e,t){let n=t,i=e.createOptions.file,o=window.URL||window.webkitURL;n.url=o.createObjectURL(i),n.name=i.name,n.size=i.size,n.contentType=i.type,e.complete=Promise.resolve()}validate(e){if(!nc.isObject(e))throw Error("it is an empty message.");if(!(e.file instanceof File))throw Error("wrong file type.");if(0==e.file.size)throw Error("File size is 0.");if(e.file.size>524288e3)throw Error("message-length limit 30mib")}}class Vh extends $h{create(){return new Oh}setPayload(e,t){super.setPayload(e,t);let n=e.createOptions.file,i=t,o=window.URL||window.webkitURL,s=new Image;s.src=o.createObjectURL(n),e.complete=new Promise(((e,t)=>{s.onload=function(){i.width=s.width,i.height=s.height,o.revokeObjectURL(s.src),e()},s.onerror=function(e){o.revokeObjectURL(s.src),t(e)}}))}validate(e){super.validate(e);let t=["gif","jpg","png","jpeg"];if(!t.find((t=>t===e.file.type.split("/")[1].toLowerCase())))throw Error("Only "+t.join(",")+" is supported image.")}}class Kh extends $h{create(){return new Mh}setPayload(e,t){super.setPayload(e,t);let n=e.createOptions.file,i=t,o=window.URL||window.webkitURL,s=document.createElement("audio");s.src=o.createObjectURL(n),e.complete=new Promise(((e,t)=>{s.onloadedmetadata=()=>{i.duration=s.duration,o.revokeObjectURL(s.src),e()},s.onerror=e=>{o.revokeObjectURL(s.src),t(e)}}))}validate(e){super.validate(e);let t=["mp3","ogg","wav","wma","ape","acc","mpeg"];if(!t.find((t=>t===e.file.type.split("/")[1].toLowerCase())))throw Error("Only "+t.join(",")+" is supported audio.")}}class Wh extends Ah{create(){return new Lh}setPayload(e,t){let n=e.createOptions.file,i=t,o=i.video,s=i.thumbnail,r=window.URL||window.webkitURL,a=document.createElement("video");a.src=r.createObjectURL(n),o.size=n.size,o.name=n.name,o.contentType=n.type,o.url=a.src,s.name=n.name,s.contentType="image/jpg",e.complete=new Promise(((e,t)=>{a.onloadedmetadata=()=>{o.duration=a.duration,o.width=a.videoWidth,o.height=a.videoHeight,s.width=a.videoWidth,s.height=a.videoHeight,s.url=this.getThumbnailUrl(a),r.revokeObjectURL(a.src),e()},a.onerror=function(e){r.revokeObjectURL(a.src),t(e)}}))}getThumbnailUrl(e){let t=document.createElement("canvas");return t.width=e.videoWidth,t.height=e.videoHeight,t.getContext("2d").drawImage(e,0,0,t.width,t.height),t.toDataURL("image/png")}validate(e){if(!nc.isObject(e))throw Error("it is an empty message.");if(!(e.file instanceof File))throw Error("wrong file type.");if(0==e.file.size)throw Error("File size is 0.");if(e.file.size>31457280)throw Error("message-length limit 30mib");let t=["avi","mov","rmvb","rm","flv","mp4","3gp","quicktime"];if(!t.find((t=>t===e.file.type.split("/")[1].toLowerCase())))throw Error("Only "+t.join(",")+" is supported video.")}}class Xh extends Ah{create(){return new Lh}setPayload(e,t){let n=e.createOptions.file,i=t,o=i.video,s=i.thumbnail,{duration:r,height:a,size:c,tempFilePath:l,tempVideoThumbPath:u,width:p}=n;o.size=c,o.width=p,o.height=a,o.url=l,o.duration=r,o.contentType="video/mp4",o.name="ali-video.mp4",s.url=u,s.height=200,s.width=Number((o.width*s.height/o.height).toFixed(0)),s.contentType="image/jpg",s.name="ali-thumbnail.jpg",e.complete=Promise.resolve()}validate(e){if(!nc.isObject(e))throw Error("it is an empty message.");if(!nc.isDef(e.file))throw Error("file is empty.")}}class Jh extends Ah{create(){return new _h}setPayload(e,t){e.complete=Promise.reject("Alipay not support file message.")}validate(e){if(!nc.isObject(e))throw Error("it is an empty message.");if(!nc.isDef(e.file))throw Error("file is empty.")}}class Qh extends Jh{create(){return new Oh}setPayload(e,t){let n=t,i=e.createOptions.file;n.url=i.path,n.size=i.size,e.complete=new Promise(((e,t)=>{my.getImageInfo({src:i.path,success(t){n.width=t.width,n.height=t.height,n.contentType="image/"+t.type,n.name="ali-image."+t.type,e()},fail(e){t(e)}})}))}validate(e){super.validate(e)}}class Yh extends Jh{create(){return new Mh}setPayload(e,t){let n=t,i=e.createOptions.file,o=i.tempFilePath;n.url=o,n.name="ali-audio."+Th.fileExtension(o,"."),n.contentType="audio/"+Th.fileExtension(o,"."),n.duration=i.duration,n.size=i.fileSize,e.complete=Promise.resolve()}validate(e){super.validate(e)}}class Zh extends Ah{create(){return new Lh}setPayload(e,t){let n=e.createOptions.file,i=t,o=i.video,s=i.thumbnail,{duration:r,height:a,size:c,tempFilePath:l,thumbTempFilePath:u,width:p}=n;o.size=c,o.width=p,o.height=a,o.url=l,o.duration=r,o.contentType="video/"+Th.fileExtension(l,"."),o.name="baidu-video."+Th.fileExtension(l,"."),s.url=u,s.height=200,s.width=Number((o.width*s.height/o.height).toFixed(0)),s.contentType="image/"+Th.fileExtension(u,"."),s.name="baidu-thumbnail."+Th.fileExtension(l,"."),e.complete=Promise.resolve()}validate(e){if(!nc.isObject(e))throw Error("it is an empty message.");if(!nc.isDef(e.file))throw Error("file is empty.")}}class ef extends Ah{create(){return new _h}setPayload(e,t){e.complete=Promise.reject("Baidu app not support file message.")}validate(e){}}class tf extends ef{create(){return new Mh}setPayload(e,t){let n=t,i=e.createOptions.file,o=i.tempFilePath;n.url=o,n.name="baidu-audio."+Th.fileExtension(o,"."),n.contentType="audio/"+Th.fileExtension(o,"."),n.duration=i.duration/1e3,n.size=i.fileSize,e.complete=Promise.resolve()}validate(e){super.validate(e)}}class nf extends ef{create(){return new Oh}setPayload(e,t){let n=t,i=e.createOptions.file;n.url=i.path,n.size=i.size,e.complete=new Promise(((e,t)=>{swan.getImageInfo({src:i.path,success(t){n.width=t.width,n.height=t.height,n.contentType="image/"+t.type,n.name="baidu-image."+t.type,e()},fail(e){t(e)}})}))}validate(e){super.validate(e)}}class of extends Ah{create(){return new _h}setPayload(e,t){let n=t,i=e.createOptions.file;const{uri:o,type:s,size:r,name:a}=i;n.url=decodeURIComponent(o),n.name=a,n.size=r,n.contentType=s,e.complete=Promise.resolve()}validate(e){if(!nc.isObject(e))throw Error("it is an empty message.");if(!nc.isDef(e.file))throw Error("file is empty.")}}class sf extends of{create(){return new Oh}setPayload(e,t){let n=t,i=e.createOptions.file;const{uri:o,fileSize:s,type:r,fileName:a,width:c,height:l}=i;n.url=o,n.size=s,n.contentType=r,n.name=a,n.width=c,n.height=l,e.complete=Promise.resolve()}validate(e){super.validate(e)}}class rf extends Ah{create(){return new Lh}setPayload(e,t){let n=e.createOptions.file;const i=t,{video:o,thumbnail:s}=i,{uri:r,type:a,fileSize:c,fileName:l,duration:u,height:p,width:d}=n;o.size=c,o.width=d,o.height=p,o.url=r,o.duration=u,o.contentType=a,o.name=l,s.url=r,s.name="rn-thumbnail.jpg",s.height=200,s.width=Number((o.width*s.height/o.height).toFixed(0)),s.contentType="image/jpg",e.complete=Promise.resolve()}validate(e){if(!nc.isObject(e))throw Error("it is an empty message.");if(!nc.isDef(e.file))throw Error("file is empty.")}}class af extends of{create(){return new Mh}setPayload(e,t){let n=e.createOptions,i=t,o=n.file;const{uri:s,name:r,duration:a,size:c}=o;i.url=s,i.duration=Number((a/1e3).toFixed(2)),i.size=c,i.name=r||"rn-audio."+Th.fileExtension(s,"."),i.contentType="audio/"+Th.fileExtension(s,"."),n.file={uri:s,type:i.contentType,name:i.name},e.complete=Promise.resolve()}validate(e){super.validate(e)}}class cf extends Ih{}class lf extends Ah{create(){return new cf}setPayload(e,t){let n=e.createOptions;t.payload=n.payload,e.complete=Promise.resolve()}validate(e){let t=e.type,n=e.payload;if(nc.isEmpty(t))throw Error("type is empty.");if(!nc.isString(t))throw Error("type require a string");if(nc.isEmpty(n))throw Error("payload is empty.");if(!nc.isPlainObject(n)&&!nc.isStringOrNumber(n))throw Error("payload require object | string | number.")}}class uf{constructor(e,t){this.type=e,this.createOptions=t}}class pf{constructor(){this.framework=Xa.currentFramework(),this.platform=oc.currentPlatform(),this.payloadBuilders={[Va.UNIAPP]:{image:new qh,file:new Gh,audio:new zh,video:new Hh,text:new Bh},[ic.MP_WX]:{image:new Ph,file:new Rh,audio:new Nh,video:new Fh,text:new Bh},[ic.BROWSER]:{image:new Vh,file:new $h,audio:new Kh,video:new Wh,text:new Bh},[ic.MP_ALI]:{image:new Qh,file:new Jh,audio:new Yh,video:new Xh,text:new Bh},[ic.MP_BAIDU]:{image:new nf,file:new ef,audio:new tf,video:new Zh,text:new Bh},[Va.REACT_NATIVE]:{image:new sf,file:new of,audio:new af,video:new rf,text:new Bh},[ic.MP_BYTE]:{image:new Ph,file:new Rh,audio:new Nh,video:new Fh,text:new Bh}}}buildMessage(e,t){const n=this.framework===Va.UNKNOWN?this.platform:this.framework;let i=this.payloadBuilders[n][e],o=new uf(e,t);if(i){let e=i.build(o);o.payload=e}else{let e=(new lf).build(o);o.payload=e.payload}let s=this.build(o);return o.complete.then((()=>{fc.onSuccess(t,s)})).catch((e=>{fc.onFailed(t,e)})),s}build(e){let t,n=e.type,i=e.payload,o=e.createOptions,s=o.to,r=s.type;return this.validate(o),r===Ya.GROUP?(t=new Zl,t.groupId=s.id.toString(),t.senderData=Kc.Socket.user().data):r===Ya.PRIVATE?(t=new Yl,t.read=!1,t.receiverId=s.id.toString()):r===Ya.CS&&(t=new eu,t.to=s.id.toString(),t.teamId=s.id.toString(),t.senderData=Kc.Socket.user().data),t.senderId=Kc.Socket.user().id,t.messageId=Xc.get(),t.payload=i,t.timestamp=Date.now(),t.type=n,t.recalled=!1,t.status=Za.NEW,t.buildOptions=e,t}validate(e){const t=e.to;if(!t)throw new Error("message require property to.");if(!nc.isObject(t))throw new Error("TypeError: to requires an object.");if(!nc.isObject(t.data))throw new Error("TypeError: to.data requires an object.");if(!t.type||t.type!==Ya.GROUP&&t.type!==Ya.PRIVATE&&t.type!==Ya.CS)throw new Error("message require property to.type");if(nl.validateId(t.id,"to.id"),Kc.Socket.user().id===t.id)throw new Error("to.id can not be the same as your id.");nc.isDef(e.notification)&&nl.validateNotification(e.notification),e.wxmpTemplateMsg&&nl.validateWXMPTemplateMsg(e.wxmpTemplateMsg)}}class df extends vh{onMessageReceived(e){if(e.t===Ya.CS){let t=this.builder.build(e);this.sendAck(t);let n=Kl.byIMMessage(t);rh.get(n).existsMessage(t)||(t.customerId()===Kc.Socket.user().id?(this.createNotification(e),ql.i.fire(Pl.MESSAGE_RECEIVED,t),au.fire(Dl.CS_MESSAGE_RECEIVED,t)):th.getInstance().queryTeams().then((()=>{nh.isMyMessage(t)&&this.createNotification(e),ql.i.fire(Pl.CS_AGENT_MESSAGE_RECEIVED,t)})))}}}class hf{constructor(e){this.times=new Array;let t=e[0],n=Kl.byIMMessage(t);this.scene=n.scene,this.targetId=n.id,e.forEach((e=>{this.times.push(e.timestamp)})),this.times.sort(((e,t)=>e<t?-1:e==t?0:1))}}class ff{constructor(){this.onRemoteRecalled=e=>{ql.i.fire(Pl.MESSAGE_RECALLED,e)},eh.onMessage(rl.IM_MSG_RECALLED,this.onRemoteRecalled)}recallMessage(e){return mc(this,void 0,void 0,(function*(){sh.validateMessageArray(e.messages),this.validate(e);let t=e.messages;yield this.recallServerMessages(t);let n=t[0],i=n.scene(),o=this.toConversationId(i,n.senderId,n.targetId()),s={id:Kc.Socket.user().id,data:Kc.Socket.user().data},r=t.map((e=>e.timestamp)),a=new ru(i,o,s,r);ql.i.fire(Pl.MESSAGE_RECALLED,a),fc.onSuccess(e)}))}toConversationId(e,t,n){if(Ya.PRIVATE===e)return o=n,(i=t).localeCompare(o)>0?`${i}:${o}`:`${o}:${i}`;var i,o;if(Ya.GROUP===e)return n;throw{code:400,content:`scene: ${e} not support`}}recallServerMessages(e){let t=new hf(e);return 0===t.times.length?Promise.resolve():new Promise(((e,n)=>{let i=new Yc({name:pc.IM_RECALL_MESSAGE,params:t,permission:Jc.WRITE,singleTimeout:dc.commonRequestSingle,totalTimeout:dc.commonRequestTotal,fail:e=>{n(e)},success:t=>{200===t.code?e(t):n(t)}});Kc.Socket.e(i)}))}validate(e){let t=e.messages;for(let n=0;n<t.length;n++){let e=t[n];if(e.scene()===Ya.CS)throw{code:400,content:"Recall CS message is not supported yet."};if(e.status!==Za.SUCCESS)throw{code:400,content:"message["+n+"] is '"+e.status+"' and cannot be recalled"};if(e.recalled)throw{code:400,content:"message["+n+"] has been recalled"};if(e.senderId!==Kc.Socket.user().id)throw{code:400,content:"it is not allowed to recall messages sent by others"}}}}class mf{constructor(){this.map=new Map}getData(e){return this.map.get(e)}setData(e,t){this.map.set(e,t)}}class gf{constructor(){this.dataCache=new mf}static init(){this.i=new gf}getData(...e){return mc(this,void 0,void 0,(function*(){let t=[],n=new Map;return e.forEach((e=>{let i=this.dataCache.getData(e);i?n.set(e,i):t.push(e)})),0===t.length||(yield this.fetchData(...t)).forEach(((e,t)=>{this.dataCache.setData(t,e),n.set(t,e)})),Promise.resolve(n)}))}fetchData(...e){return new Promise(((t,n)=>{let i=new Yc({name:pc.MD_CMD,permission:Jc.READ,singleTimeout:dc.commonRequestSingle,totalTimeout:dc.commonRequestTotal,params:{name:"GET",data:{ids:e}},success:e=>{if(200===e.code){const n=new Map;e.content.forEach((e=>{n.set(e.id,e.data)})),t(n)}else n(e)},fail:e=>{n(e)}});Kc.Socket.e(i)}))}setData(e,t){this.dataCache.setData(e,t)}}class vf{constructor(){ql.i.on(Pl.MESSAGE_RECEIVED,this.onMessageReceived),ql.i.on(Pl.MESSAGE_SENDING,this.onMessageSending)}onMessageSending(e){let t=Kl.byIMMessage(e);t.scene===Ya.PRIVATE&&gf.i.setData(t.id,e.getToData())}onMessageReceived(e){if(Kl.byIMMessage(e).scene===Ya.GROUP){let t=e;gf.i.setData(t.senderId,t.senderData)}}}class yf{constructor(){this._iMReceiver=new vh,this.csMessageReceiver=new df,this.memberDataUpdator=new vf,this._userHereNow=new Eh,this.goEasyUploader=new Rl,this._groupHereNow=new Ch,this._groupOnlineCount=new Sh,this.groupMessageSubscriber=new yh,this.messageBuilder=new pf,this.messageSender=new Hl,this.recaller=new ff,this._groupPresenceSubscriber=new xh,this._userPresenceSubscriber=new wh,this.conversations=new gh,this.histories=rh.init()}static init(){ql.init(),au.init(),yf.instance=new yf}static i(){if(yf.instance)return yf.instance;throw Error("Please connect first.")}validateModules(){if(eh.status()===Ka.DISCONNECTED)throw Error("Please call connect() first.");fh.check()}catch(e,t){return mc(this,void 0,void 0,(function*(){try{this.validateModules(),nl.validateCallbackOptions(t),yield e()}catch(n){fc.onFailed(t,n)}}))}on(e,t){au.on(e,t)}off(e,t){au.off(e,t)}createTextMessage(e){return this.validateModules(),this.messageBuilder.buildMessage(Ml.TEXT,e)}createImageMessage(e){return this.validateModules(),this.messageBuilder.buildMessage(Ml.IMAGE,e)}createFileMessage(e){return this.validateModules(),this.messageBuilder.buildMessage(Ml.FILE,e)}createAudioMessage(e){return this.validateModules(),this.messageBuilder.buildMessage(Ml.AUDIO,e)}createVideoMessage(e){return this.validateModules(),this.messageBuilder.buildMessage(Ml.VIDEO,e)}createCustomMessage(e){return this.validateModules(),this.messageBuilder.buildMessage(e.type,e)}sendMessage(e){this.catch((()=>{this.messageSender.send(e)}),e)}recallMessage(e){this.catch((()=>{this.recaller.recallMessage(e)}),e)}deleteMessage(e){this.catch((()=>{this.histories.deleteMessage(e)}),e)}markGroupMessageAsRead(e){this.catch((()=>mc(this,void 0,void 0,(function*(){yield this.histories.groupMarkAsRead(e)}))),e)}markPrivateMessageAsRead(e){this.catch((()=>mc(this,void 0,void 0,(function*(){yield this.histories.privateMarkAsRead(e)}))),e)}markMessageAsRead(e,t){this.catch((()=>mc(this,void 0,void 0,(function*(){yield this.histories.markMessageAsRead(e,t)}))),e)}latestConversations(e){this.validateModules(),this.conversations.latestConversations(e)}removePrivateConversation(e){this.catch((()=>this.conversations.removePrivateConversation(e)),e)}removeGroupConversation(e){this.catch((()=>this.conversations.removeGroupConversation(e)),e)}topPrivateConversation(e){this.catch((()=>this.conversations.topPrivateConversation(e)),e)}topGroupConversation(e){this.catch((()=>this.conversations.topGroupConversation(e)),e)}history(e,t){this.catch((()=>{this.histories.loadHistory(e,t)}),e)}subscribeUserPresence(e){this.catch((()=>this._userPresenceSubscriber.presence(e)),e)}unsubscribeUserPresence(e){this.catch((()=>this._userPresenceSubscriber.unPresence(e)),e)}hereNow(e){this.catch((()=>this._userHereNow.hereNow(e)),e)}subscribeGroup(e){this.catch((()=>this.groupMessageSubscriber.subscribe(e)),e)}unsubscribeGroup(e){this.catch((()=>this.groupMessageSubscriber.unsubscribe(e)),e)}subscribeGroupPresence(e){this.catch((()=>this._groupPresenceSubscriber.presence(e)),e)}unsubscribeGroupPresence(e){this.catch((()=>this._groupPresenceSubscriber.unPresence(e)),e)}groupHereNow(e){this.catch((()=>this._groupHereNow.hereNow(e)),e)}groupOnlineCount(e){this.catch((()=>this._groupOnlineCount.get(e)),e)}latestPendingConversations(e){this.validateModules(),this.conversations.latestPendingConversations(e)}topConversation(e){this.validateModules(),this.conversations.topConversation(e)}removeConversation(e){this.validateModules(),this.conversations.removeConversation(e)}}class bf{constructor(e,t){this.customerId=e,this.teamId=t}}class xf{constructor(e,t){this.teamId=e;let n=new tc(t.id.toString(),JSON.stringify(t.data));this.customer=n}}class Sf{constructor(e,t,n){this.customerId=e,this.teamId=t,this.agentId=n}}class kf{constructor(e,t){this.customerId=e,this.teamId=t}}class Cf{constructor(e){this.builder=new tu,this.teamId=e}accept(e,t){let n=t.customer;if(nc.isUndef(n))throw{code:400,content:"customer is required."};nl.validateId(n.id,"customer.id");let i=n.data;if(nc.isUndef(i)||!nc.isObject(i))throw{code:400,content:"customer data must be non-empty object."};let o=new xf(e,n),s=new Yc({name:pc.CS_ACCEPT,params:o,permission:Jc.WRITE,singleTimeout:dc.commonRequestSingle,totalTimeout:dc.commonRequestTotal,fail:e=>{fc.onFailed(t,e)},success:e=>{let n=this.builder.build(e.content.message);ql.i.fire(Pl.CS_ACCEPTED,n),fc.onSuccess(t)}});Kc.Socket.e(s)}end(e,t){nl.validateId(t.id,"id");let n=t.id.toString(),i=new kf(n,e),o=new Yc({name:pc.CS_END,params:i,permission:Jc.WRITE,singleTimeout:dc.commonRequestSingle,totalTimeout:dc.commonRequestTotal,fail:e=>{fc.onFailed(t,e)},success:e=>{let n=this.builder.build(e.content.message);ql.i.fire(Pl.CS_ENDED,n),fc.onSuccess(t)}});Kc.Socket.e(o)}queryCustomerStatus(e,t){return mc(this,void 0,void 0,(function*(){nl.validateId(t.id,"id");let n=yield this.doCustomerStatus(e,t.id);this.activeCustomerStatus=n,this.activeCustomerStatusOptions=t,fc.onSuccess(t,n)}))}doCustomerStatus(e,t){let n=t.toString(),i=new bf(n,e);return new Promise(((e,t)=>{let n=new Yc({name:pc.CS_CUSTOMER_STATUS,params:i,permission:Jc.READ,singleTimeout:dc.commonQuerySingle,totalTimeout:dc.commonQueryTotal,fail:e=>{t(e)},success:t=>{let n=t.content;n.agent&&(n.agent.data=JSON.parse(n.agent.data)),e(n)}});Kc.Socket.e(n)}))}transfer(e,t){nl.validateId(t.customerId,"customerId"),nl.validateId(t.agentId,"agentId");let n=t.customerId.toString(),i=t.agentId.toString(),o=new Sf(n,e,i),s=new Yc({name:pc.CS_TRANSFER,params:o,permission:Jc.WRITE,singleTimeout:dc.commonRequestSingle,totalTimeout:dc.commonRequestTotal,fail:e=>{fc.onFailed(t,e)},success:e=>{let n=this.builder.build(e.content.message);ql.i.fire(Pl.CS_TRANSFER,n),fc.onSuccess(t)}});Kc.Socket.e(s)}}class wf{createTextMessage(e,t){let n=yf.i().createTextMessage(t);this.extendProps(e,n)}createImageMessage(e,t){let n=yf.i().createImageMessage(t);this.extendProps(e,n)}createFileMessage(e,t){let n=yf.i().createFileMessage(t);this.extendProps(e,n)}createAudioMessage(e,t){let n=yf.i().createAudioMessage(t);this.extendProps(e,n)}createVideoMessage(e,t){let n=yf.i().createVideoMessage(t);this.extendProps(e,n)}createCustomMessage(e,t){let n=yf.i().createCustomMessage(t);this.extendProps(e,n)}extendProps(e,t){if(t.scene()===Ya.CS){let n=t;n.teamId=e,n.accepted=!0}}}class Ef{constructor(e){this.teamId=e,this.agentStatus=th.getInstance(),this.conversationHandler=new Cf(e),this.messageCreator=new wf}catch(e,t){return mc(this,void 0,void 0,(function*(){try{nl.validateCallbackOptions(t),yield e()}catch(n){fc.onFailed(t,n)}}))}isOnline(e){this.catch((()=>{this.agentStatus.isOnline(this.teamId,e)}),e)}online(e){this.catch((()=>{this.agentStatus.online(this.teamId,e)}),e)}offline(e){this.catch((()=>{this.agentStatus.offline(this.teamId,e)}),e)}customerStatus(e){this.catch((()=>{this.conversationHandler.queryCustomerStatus(this.teamId,e)}),e)}accept(e){this.catch((()=>{this.conversationHandler.accept(this.teamId,e)}),e)}end(e){this.catch((()=>{this.conversationHandler.end(this.teamId,e)}),e)}history(e){yf.i().history(e,this.teamId)}markMessageAsRead(e){yf.i().markMessageAsRead(e,this.teamId)}createTextMessage(e){this.messageCreator.createTextMessage(this.teamId,e)}createImageMessage(e){this.messageCreator.createImageMessage(this.teamId,e)}createFileMessage(e){this.messageCreator.createFileMessage(this.teamId,e)}createAudioMessage(e){this.messageCreator.createAudioMessage(this.teamId,e)}createVideoMessage(e){this.messageCreator.createVideoMessage(this.teamId,e)}createCustomMessage(e){this.messageCreator.createCustomMessage(this.teamId,e)}transfer(e){this.catch((()=>{this.conversationHandler.transfer(this.teamId,e)}),e)}agents(e){this.catch((()=>{this.agentStatus.agents(this.teamId,e)}),e)}liveSession(e){this.catch((()=>{nh.live(this.teamId,e)}),e)}quitLiveSession(e){this.catch((()=>{nh.quit(e)}),e)}listenCustomer(e){let t={customerId:e.id,onNewMessage:e.onNewMessage,onStatusUpdated:e.onStatusUpdated,onFailed:e.onFailed,onSuccess:e.onSuccess};this.catch((()=>{nh.live(this.teamId,t)}),e)}cancelListenCustomer(e){this.catch((()=>{nh.quit(e)}),e)}}class Tf{static team(e){nl.validateId(e,"teamId");let t=this.teams.get(e);return t||(t=new Ef(e.toString()),this.teams.set(e.toString(),t)),t}}Tf.teams=new Map;class If{constructor(e){this.id=e}isOnline(e){Tf.team(this.id).isOnline(e)}online(e){Tf.team(this.id).online(e)}offline(e){Tf.team(this.id).offline(e)}customerStatus(e){Tf.team(this.id).customerStatus(e)}accept(e){Tf.team(this.id).accept(e)}end(e){Tf.team(this.id).end(e)}history(e){Tf.team(this.id).history(e)}markMessageAsRead(e){Tf.team(this.id).markMessageAsRead(e)}createTextMessage(e){Tf.team(this.id).createTextMessage(e)}createImageMessage(e){Tf.team(this.id).createImageMessage(e)}createFileMessage(e){Tf.team(this.id).createFileMessage(e)}createAudioMessage(e){Tf.team(this.id).createAudioMessage(e)}createVideoMessage(e){Tf.team(this.id).createVideoMessage(e)}createCustomMessage(e){Tf.team(this.id).createCustomMessage(e)}transfer(e){Tf.team(this.id).transfer(e)}agents(e){Tf.team(this.id).agents(e)}liveSession(e){Tf.team(this.id).liveSession(e)}quitLiveSession(e){Tf.team(this.id).quitLiveSession(e)}listenCustomer(e){Tf.team(this.id).listenCustomer(e)}cancelListenCustomer(e){Tf.team(this.id).cancelListenCustomer(e)}}class _f{static getInstance(e){return this.init(e),_f}static init(e){if(this.getConnectionStatus()!==Ka.DISCONNECTED)throw new Error("Initialization failed. Please disconnect and try again.");this.validateOptions(e),Ja.init(e.reactNativeOptions),this.options=e,eh.init(e),e.allowNotification&&el.init(e.allowNotification),e.modules&&(e.modules.includes("PUBSUB")&&Fc.initModule(ml.init()),e.modules.includes("IM")&&Fc.initModule(fh.init())),gf.init(),Kc.init(eh,el,gf,Qa,sc,Fc)}static setBadge(e){el.setBadge(e)}static connect(e){eh.connect(e,"JS")}static disconnect(e){eh.disconnect(e)}static getConnectionStatus(){return eh.status()}static validateOptions(e){let t="";if(!nc.isObject(e))throw t="options is require an object.",Error(t);if(!nc.isPrimitive(e.appkey)||0==e.appkey.length)throw t="Invalid options:'appkey' is empty.",Error(t);if(!nc.isPrimitive(e.host)||0==e.host.length)throw t="Invalid options:'host' is empty.",Error(t);if(!nc.isArray(e.modules))throw t="Invalid options: 'modules' must be nonempty array",Error(t);if(!e.modules.includes("im")&&!e.modules.includes("pubsub"))throw t="Invalid options: 'modules' must include at least one of 'im' or 'pubsub'.",Error(t);e.modules=e.modules.map((e=>e.toUpperCase()))}static onClickNotification(e){el.onClickNotification(e)}static c(e){e.init(Kc.Socket,Kc.N,Kc.Member,Kc.v,Kc.Platform,Fc)}}function Of(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}_f.version=Qa,_f.IM_EVENT=Dl,_f.IM_SCENE=Ya,_f.im=class{static on(e,t){yf.i().on(e,t)}static off(e,t){yf.i().off(e,t)}static createTextMessage(e){return yf.i().createTextMessage(e)}static createImageMessage(e){return yf.i().createImageMessage(e)}static createFileMessage(e){return yf.i().createFileMessage(e)}static createAudioMessage(e){return yf.i().createAudioMessage(e)}static createVideoMessage(e){return yf.i().createVideoMessage(e)}static createCustomMessage(e){return yf.i().createCustomMessage(e)}static sendMessage(e){yf.i().sendMessage(e)}static recallMessage(e){yf.i().recallMessage(e)}static deleteMessage(e){yf.i().deleteMessage(e)}static markGroupMessageAsRead(e){yf.i().markGroupMessageAsRead(e)}static markPrivateMessageAsRead(e){yf.i().markPrivateMessageAsRead(e)}static latestConversations(e){yf.i().latestConversations(e)}static removePrivateConversation(e){yf.i().removePrivateConversation(e)}static removeGroupConversation(e){yf.i().removeGroupConversation(e)}static topPrivateConversation(e){yf.i().topPrivateConversation(e)}static topGroupConversation(e){yf.i().topGroupConversation(e)}static history(e){yf.i().history(e)}static subscribeUserPresence(e){yf.i().subscribeUserPresence(e)}static unsubscribeUserPresence(e){yf.i().unsubscribeUserPresence(e)}static hereNow(e){yf.i().hereNow(e)}static subscribeGroup(e){yf.i().subscribeGroup(e)}static unsubscribeGroup(e){yf.i().unsubscribeGroup(e)}static subscribeGroupPresence(e){yf.i().subscribeGroupPresence(e)}static unsubscribeGroupPresence(e){yf.i().unsubscribeGroupPresence(e)}static groupHereNow(e){yf.i().groupHereNow(e)}static groupOnlineCount(e){yf.i().groupOnlineCount(e)}static markMessageAsRead(e){yf.i().markMessageAsRead(e)}static csteam(e){return new If(e)}static pendingConversations(e){yf.i().latestPendingConversations(e)}static topConversation(e){yf.i().topConversation(e)}static removeConversation(e){yf.i().removeConversation(e)}},_f.pubsub=class{static publish(e){this.catch((()=>{fl.instance.publish(e)}),e)}static subscribe(e){this.catch((()=>{fl.instance.subscribe(e)}),e)}static unsubscribe(e){this.catch((()=>{fl.instance.unsubscribe(e)}),e)}static subscribePresence(e){this.catch((()=>{fl.instance.subscribePresence(e)}),e)}static unsubscribePresence(e){this.catch((()=>{fl.instance.unsubscribePresence(e)}),e)}static history(e){this.catch((()=>{fl.instance.history(e)}),e)}static hereNow(e){this.catch((()=>{fl.instance.hereNow(e)}),e)}static catch(e,t){try{if(ml.check(),[Ka.DISCONNECTED,Ka.DISCONNECTING,Ka.CONNECT_FAILED].includes(Kc.Socket.status()))throw new Error("Please call connect() first.");e()}catch(n){fc.onFailed(t,n)}}};var Af={exports:{}};window,Af.exports=function(e){var t={};function n(i){if(t[i])return t[i].exports;var o=t[i]={i:i,l:!1,exports:{}};return e[i].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=e,n.c=t,n.d=function(e,t,i){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:i})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var i=Object.create(null);if(n.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(i,o,function(t){return e[t]}.bind(null,o));return i},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="/Users/chrisftian/Documents/projects/cos-sdk/cos-wx-sdk-v5/dist",n(n.s=8)}([function(e,t,n){function i(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return o(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?o(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var i=0,s=function(){};return{s:s,n:function(){return i>=e.length?{done:!0}:{done:!1,value:e[i++]}},e:function(e){throw e},f:s}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var r,a=!0,c=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){c=!0,r=e},f:function(){try{a||null==n.return||n.return()}finally{if(c)throw r}}}}function o(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);n<t;n++)i[n]=e[n];return i}function s(){
/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */
s=function(){return t};var e,t={},n=Object.prototype,i=n.hasOwnProperty,o=Object.defineProperty||function(e,t,n){e[t]=n.value},r="function"==typeof Symbol?Symbol:{},c=r.iterator||"@@iterator",l=r.asyncIterator||"@@asyncIterator",u=r.toStringTag||"@@toStringTag";function p(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{p({},"")}catch(N){p=function(e,t,n){return e[t]=n}}function d(e,t,n,i){var s=t&&t.prototype instanceof b?t:b,r=Object.create(s.prototype),a=new P(i||[]);return o(r,"_invoke",{value:_(e,n,a)}),r}function h(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(i){return{type:"throw",arg:i}}}t.wrap=d;var f="suspendedStart",m="suspendedYield",g="executing",v="completed",y={};function b(){}function x(){}function S(){}var k={};p(k,c,(function(){return this}));var C=Object.getPrototypeOf,w=C&&C(C(M([])));w&&w!==n&&i.call(w,c)&&(k=w);var E=S.prototype=b.prototype=Object.create(k);function T(e){["next","throw","return"].forEach((function(t){p(e,t,(function(e){return this._invoke(t,e)}))}))}function I(e,t){function n(o,s,r,c){var l=h(e[o],e,s);if("throw"!==l.type){var u=l.arg,p=u.value;return p&&"object"==a(p)&&i.call(p,"__await")?t.resolve(p.__await).then((function(e){n("next",e,r,c)}),(function(e){n("throw",e,r,c)})):t.resolve(p).then((function(e){u.value=e,r(u)}),(function(e){return n("throw",e,r,c)}))}c(l.arg)}var s;o(this,"_invoke",{value:function(e,i){function o(){return new t((function(t,o){n(e,i,t,o)}))}return s=s?s.then(o,o):o()}})}function _(t,n,i){var o=f;return function(s,r){if(o===g)throw Error("Generator is already running");if(o===v){if("throw"===s)throw r;return{value:e,done:!0}}for(i.method=s,i.arg=r;;){var a=i.delegate;if(a){var c=O(a,i);if(c){if(c===y)continue;return c}}if("next"===i.method)i.sent=i._sent=i.arg;else if("throw"===i.method){if(o===f)throw o=v,i.arg;i.dispatchException(i.arg)}else"return"===i.method&&i.abrupt("return",i.arg);o=g;var l=h(t,n,i);if("normal"===l.type){if(o=i.done?v:m,l.arg===y)continue;return{value:l.arg,done:i.done}}"throw"===l.type&&(o=v,i.method="throw",i.arg=l.arg)}}}function O(t,n){var i=n.method,o=t.iterator[i];if(o===e)return n.delegate=null,"throw"===i&&t.iterator.return&&(n.method="return",n.arg=e,O(t,n),"throw"===n.method)||"return"!==i&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+i+"' method")),y;var s=h(o,t.iterator,n.arg);if("throw"===s.type)return n.method="throw",n.arg=s.arg,n.delegate=null,y;var r=s.arg;return r?r.done?(n[t.resultName]=r.value,n.next=t.nextLoc,"return"!==n.method&&(n.method="next",n.arg=e),n.delegate=null,y):r:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,y)}function A(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function R(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function P(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(A,this),this.reset(!0)}function M(t){if(t||""===t){var n=t[c];if(n)return n.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,s=function n(){for(;++o<t.length;)if(i.call(t,o))return n.value=t[o],n.done=!1,n;return n.value=e,n.done=!0,n};return s.next=s}}throw new TypeError(a(t)+" is not iterable")}return x.prototype=S,o(E,"constructor",{value:S,configurable:!0}),o(S,"constructor",{value:x,configurable:!0}),x.displayName=p(S,u,"GeneratorFunction"),t.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===x||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,S):(e.__proto__=S,p(e,u,"GeneratorFunction")),e.prototype=Object.create(E),e},t.awrap=function(e){return{__await:e}},T(I.prototype),p(I.prototype,l,(function(){return this})),t.AsyncIterator=I,t.async=function(e,n,i,o,s){void 0===s&&(s=Promise);var r=new I(d(e,n,i,o),s);return t.isGeneratorFunction(n)?r:r.next().then((function(e){return e.done?e.value:r.next()}))},T(E),p(E,u,"Generator"),p(E,c,(function(){return this})),p(E,"toString",(function(){return"[object Generator]"})),t.keys=function(e){var t=Object(e),n=[];for(var i in t)n.push(i);return n.reverse(),function e(){for(;n.length;){var i=n.pop();if(i in t)return e.value=i,e.done=!1,e}return e.done=!0,e}},t.values=M,P.prototype={constructor:P,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(R),!t)for(var n in this)"t"===n.charAt(0)&&i.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=e)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var n=this;function o(i,o){return a.type="throw",a.arg=t,n.next=i,o&&(n.method="next",n.arg=e),!!o}for(var s=this.tryEntries.length-1;s>=0;--s){var r=this.tryEntries[s],a=r.completion;if("root"===r.tryLoc)return o("end");if(r.tryLoc<=this.prev){var c=i.call(r,"catchLoc"),l=i.call(r,"finallyLoc");if(c&&l){if(this.prev<r.catchLoc)return o(r.catchLoc,!0);if(this.prev<r.finallyLoc)return o(r.finallyLoc)}else if(c){if(this.prev<r.catchLoc)return o(r.catchLoc,!0)}else{if(!l)throw Error("try statement without catch or finally");if(this.prev<r.finallyLoc)return o(r.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&i.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var s=o;break}}s&&("break"===e||"continue"===e)&&s.tryLoc<=t&&t<=s.finallyLoc&&(s=null);var r=s?s.completion:{};return r.type=e,r.arg=t,s?(this.method="next",this.next=s.finallyLoc,y):this.complete(r)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),y},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),R(n),y}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var i=n.completion;if("throw"===i.type){var o=i.arg;R(n)}return o}}throw Error("illegal catch attempt")},delegateYield:function(t,n,i){return this.delegate={iterator:M(t),resultName:n,nextLoc:i},"next"===this.method&&(this.arg=e),y}},t}function r(e,t,n,i,o,s,r){try{var a=e[s](r),c=a.value}catch(l){return void n(l)}a.done?t(c):Promise.resolve(c).then(i,o)}function a(e){return(a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var c=n(10),l=n(13),u=n(14),p=u.btoa,d=Mn.getFileSystemManager(),h=n(2),f=n(15),m=f.XMLParser,g=f.XMLBuilder,v=new m({ignoreDeclaration:!0,ignoreAttributes:!0,parseTagValue:!1,trimValues:!1}),y=new g,b=function e(t){if(_(t))for(var n in t){var i=t[n];"string"==typeof i?"#text"===n&&delete t[n]:Array.isArray(i)?i.forEach((function(t){e(t)})):_(i)&&e(i)}};function x(e){return encodeURIComponent(e).replace(/!/g,"%21").replace(/'/g,"%27").replace(/\(/g,"%28").replace(/\)/g,"%29").replace(/\*/g,"%2A")}function S(e,t){var n=[];for(var i in e)e.hasOwnProperty(i)&&n.push(t?x(i).toLowerCase():i);return n.sort((function(e,t){return(e=e.toLowerCase())===(t=t.toLowerCase())?0:e>t?1:-1}))}var k=["cache-control","content-disposition","content-encoding","content-length","content-md5","content-type","expect","expires","host","if-match","if-modified-since","if-none-match","if-unmodified-since","origin","range","transfer-encoding","pic-operations"],C=function(){},w=function(e){var t={};for(var n in e)e.hasOwnProperty(n)&&void 0!==e[n]&&null!==e[n]&&(t[n]=e[n]);return t};function E(e){return A(e,(function(e){return"object"===a(e)&&null!==e?E(e):e}))}function T(e,t){return O(t,(function(n,i){e[i]=t[i]})),e}function I(e){return e instanceof Array}function _(e){return"[object Object]"===Object.prototype.toString.call(e)}function O(e,t){for(var n in e)e.hasOwnProperty(n)&&t(e[n],n)}function A(e,t){var n=I(e)?[]:{};for(var i in e)e.hasOwnProperty(i)&&(n[i]=t(e[i],i));return n}var R,P,M=function(e,t){if(t=T({},t),"getAuth"!==e&&"getV4Auth"!==e&&"getObjectUrl"!==e){var n=t.Headers||{};t&&"object"===a(t)&&(function(){for(var e in t)t.hasOwnProperty(e)&&e.indexOf("x-cos-")>-1&&(n[e]=t[e])}(),U.each({"x-cos-mfa":"MFA","Content-MD5":"ContentMD5","Content-Length":"ContentLength","Content-Type":"ContentType",Expect:"Expect",Expires:"Expires","Cache-Control":"CacheControl","Content-Disposition":"ContentDisposition","Content-Encoding":"ContentEncoding",Range:"Range","If-Modified-Since":"IfModifiedSince","If-Unmodified-Since":"IfUnmodifiedSince","If-Match":"IfMatch","If-None-Match":"IfNoneMatch","x-cos-copy-source":"CopySource","x-cos-copy-source-Range":"CopySourceRange","x-cos-metadata-directive":"MetadataDirective","x-cos-copy-source-If-Modified-Since":"CopySourceIfModifiedSince","x-cos-copy-source-If-Unmodified-Since":"CopySourceIfUnmodifiedSince","x-cos-copy-source-If-Match":"CopySourceIfMatch","x-cos-copy-source-If-None-Match":"CopySourceIfNoneMatch","x-cos-acl":"ACL","x-cos-grant-read":"GrantRead","x-cos-grant-write":"GrantWrite","x-cos-grant-full-control":"GrantFullControl","x-cos-grant-read-acp":"GrantReadAcp","x-cos-grant-write-acp":"GrantWriteAcp","x-cos-storage-class":"StorageClass","x-cos-traffic-limit":"TrafficLimit","x-cos-mime-limit":"MimeLimit","x-cos-forbid-overwrite":"ForbidOverwrite","x-cos-server-side-encryption-customer-algorithm":"SSECustomerAlgorithm","x-cos-server-side-encryption-customer-key":"SSECustomerKey","x-cos-server-side-encryption-customer-key-MD5":"SSECustomerKeyMD5","x-cos-server-side-encryption":"ServerSideEncryption","x-cos-server-side-encryption-cos-kms-key-id":"SSEKMSKeyId","x-cos-server-side-encryption-context":"SSEContext","Pic-Operations":"PicOperations"},(function(e,i){void 0!==t[e]&&(n[i]=t[e])})),t.Headers=w(n))}return t},N=function(e){return new Promise((function(t,n){d.readFile({filePath:e,success:function(e){t(e.data)},fail:function(e){n((null==e?void 0:e.errMsg)||"")}})}))},D=(R=s().mark((function e(t,n,i){return s().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("postObject"!==t){e.next=4;break}i(),e.next=21;break;case 4:if("putObject"!==t){e.next=20;break}if(void 0!==n.Body||!n.FilePath){e.next=17;break}return e.prev=6,e.next=9,N(n.FilePath);case 9:n.Body=e.sent,e.next=17;break;case 12:return e.prev=12,e.t0=e.catch(6),n.Body=void 0,i({error:"readFile error, ".concat(e.t0)}),e.abrupt("return");case 17:void 0!==n.Body?(n.ContentLength=n.Body.byteLength,i(null,n.ContentLength)):i({error:"missing param Body"}),e.next=21;break;case 20:n.FilePath?d.stat({path:n.FilePath,success:function(e){var t=e.stats;n.FileStat=t,n.FileStat.FilePath=n.FilePath;var o=t.isDirectory()?0:t.size;n.ContentLength=o=o||0,i(null,o)},fail:function(e){i(e)}}):i({error:"missing param FilePath"});case 21:case"end":return e.stop()}}),e,null,[[6,12]])})),P=function(){var e=this,t=arguments;return new Promise((function(n,i){var o=R.apply(e,t);function s(e){r(o,n,i,s,a,"next",e)}function a(e){r(o,n,i,s,a,"throw",e)}s(void 0)}))},function(e,t,n){return P.apply(this,arguments)}),B=function(e){return Date.now()+(e||0)},L=function(e,t){if(!e||!t)return-1;e=e.split("."),t=t.split(".");for(var n=Math.max(e.length,t.length);e.length<n;)e.push("0");for(;t.length<n;)t.push("0");for(var i=0;i<n;i++){var o=parseInt(e[i]),s=parseInt(t[i]);if(o>s)return 1;if(o<s)return-1}return 0},j=function(){var e={},t={};Mn.canIUse("getAppBaseInfo")&&(e=Mn.getAppBaseInfo()||{}),Mn.canIUse("getDeviceInfo")&&(t=Mn.getDeviceInfo()||{});var n=e.SDKVersion,i=(t.platform,L(n,"2.10.0")>=0);return function(){return i}}(),U={noop:C,formatParams:M,apiWrapper:function(e,t){return function(n,i){var o,s=this;if("function"==typeof n&&(i=n,n={}),n=M(e,n),s.options.EnableReporter)if("sliceUploadFile"===n.calledBySdk||"sliceCopyFile"===n.calledBySdk)o=n.tracker&&n.tracker.generateSubTracker({apiName:e});else if(["uploadFile","uploadFiles"].includes(e))o=null;else{var r=0;n.Body&&(r="string"==typeof n.Body?n.Body.length:n.Body.size||n.Body.byteLength||0);var a=s.options.UseAccelerate||"string"==typeof s.options.Domain&&s.options.Domain.includes("accelerate.");o=new h({Beacon:s.options.BeaconReporter,clsReporter:s.options.ClsReporter,bucket:n.Bucket,region:n.Region,apiName:e,realApi:e,accelerate:a,fileKey:n.Key,fileSize:r,deepTracker:s.options.DeepTracker,customId:s.options.CustomId,delay:s.options.TrackerDelay})}n.tracker=o;var c=function(e){return e&&e.headers&&(e.headers["x-ci-request-id"]&&(e.RequestId=e.headers["x-ci-request-id"]),e.headers["x-cos-request-id"]&&(e.RequestId=e.headers["x-cos-request-id"]),e.headers["x-cos-version-id"]&&(e.VersionId=e.headers["x-cos-version-id"]),e.headers["x-cos-delete-marker"]&&(e.DeleteMarker=e.headers["x-cos-delete-marker"])),e},l=function(e,t){o&&o.report(e,t),i&&i(c(e),c(t))},u=function(){if("getService"!==e&&"abortUploadTask"!==e){var t=function(e,t){var n=t.Bucket,i=t.Region,o=t.Key;if(e.indexOf("Bucket")>-1||"deleteMultipleObject"===e||"multipartList"===e||"listObjectVersions"===e){if(!n)return"Bucket";if(!i)return"Region"}else if(e.indexOf("Object")>-1||e.indexOf("multipart")>-1||"sliceUploadFile"===e||"abortUploadTask"===e||"uploadFile"===e){if(!n)return"Bucket";if(!i)return"Region";if(!o)return"Key"}return!1}(e,n);if(t)return"missing param "+t;if(n.Region){if(n.Region.indexOf("cos.")>-1)return'param Region should not be start with "cos."';if(!/^([a-z\d-]+)$/.test(n.Region))return"Region format error.";!s.options.CompatibilityMode&&-1===n.Region.indexOf("-")&&"yfb"!==n.Region&&"default"!==n.Region&&n.Region}if(n.Bucket){if(!/^([a-z\d-]+)-(\d+)$/.test(n.Bucket))if(n.AppId)n.Bucket=n.Bucket+"-"+n.AppId;else{if(!s.options.AppId)return'Bucket should format as "test-1250000000".';n.Bucket=n.Bucket+"-"+s.options.AppId}n.AppId&&delete n.AppId}n.Key&&"/"===n.Key.substr(0,1)&&(n.Key=n.Key.substr(1))}}(),p=["getAuth","getObjectUrl"].includes(e);if(!p&&!i)return new Promise((function(e,o){if(i=function(t,n){t?o(t):e(n)},u)return l({error:u});t.call(s,n,l)}));if(u)return l({error:u});var d=t.call(s,n,l);return p?d:void 0}},xml2json:function(e){var t=v.parse(e);return b(t),t},json2xml:function(e){return y.build(e)},md5:c,clearKey:w,fileSlice:function(e,t,n,i){e?d.readFile({filePath:e,position:t,length:n-t,success:function(e){i(e.data)},fail:function(){i(null)}}):i(null)},getBodyMd5:function(e,t,n){n=n||C,e&&t&&t instanceof ArrayBuffer?U.getFileMd5(t,(function(e,t){n(t)})):n()},getFileMd5:function(e,t){var n=c(e);return t&&t(n),n},binaryBase64:function(e){var t,n,i,o="";for(t=0,n=e.length/2;t<n;t++)i=parseInt(e[2*t]+e[2*t+1],16),o+=String.fromCharCode(i);return p(o)},extend:T,isArray:I,isInArray:function(e,t){for(var n=!1,i=0;i<e.length;i++)if(t===e[i]){n=!0;break}return n},makeArray:function(e){return I(e)?e:[e]},each:O,map:A,filter:function(e,t){var n=I(e),i=n?[]:{};for(var o in e)e.hasOwnProperty(o)&&t(e[o],o)&&(n?i.push(e[o]):i[o]=e[o]);return i},clone:E,attr:function(e,t,n){return e&&t in e?e[t]:n},uuid:function(){var e=function(){return(65536*(1+Math.random())|0).toString(16).substring(1)};return e()+e()+"-"+e()+"-"+e()+"-"+e()+"-"+e()+e()+e()},camSafeUrlEncode:x,throttleOnProgress:function(e,t){var n,i,o=this,s=0,r=0,a=Date.now();function c(){if(i=0,t&&"function"==typeof t){n=Date.now();var o,c=Math.max(0,Math.round((r-s)/((n-a)/1e3)*100)/100)||0;o=0===r&&0===e?1:Math.floor(r/e*100)/100||0,a=n,s=r;try{t({loaded:r,total:e,speed:c,percent:o})}catch(l){}}}return function(t,n){if(t&&(r=t.loaded,e=t.total),n)clearTimeout(i),c();else{if(i)return;i=setTimeout(c,o.options.ProgressInterval)}}},getFileSize:D,getFileSizeByPath:function(e){return new Promise((function(t,n){d.stat({path:e,success:function(e){var n=e.stats,i=n.isDirectory()?0:n.size;t(i)},fail:function(e){n((null==e?void 0:e.errMsg)||"")}})}))},getSkewTime:B,obj2str:function(e,t){var n,i,o,s=[],r=S(e);for(n=0;n<r.length;n++)o=void 0===e[i=r[n]]||null===e[i]?"":""+e[i],i=t?x(i).toLowerCase():x(i),o=x(o)||"",s.push(i+"="+o);return s.join("&")},getAuth:function(e){var t,n=(e=e||{}).SecretId,i=e.SecretKey,o=e.KeyTime,s=(e.method||e.Method||"get").toLowerCase(),r=E(e.Query||e.params||{}),a=function(e){var t={};for(var n in e){var i=n.toLowerCase();(i.indexOf("x-cos-")>-1||i.indexOf("x-ci-")>-1||k.indexOf(i)>-1)&&(t[n]=e[n])}return t}(E(e.Headers||e.headers||{})),c=e.Key||"";e.UseRawKey?t=e.Pathname||e.pathname||"/"+c:0!==(t=e.Pathname||e.pathname||c).indexOf("/")&&(t="/"+t);var u=!1!==e.ForceSignHost;if(!a.Host&&!a.host&&e.Bucket&&e.Region&&u&&(a.Host=e.Bucket+".cos."+e.Region+".myqcloud.com"),n&&i){var p=Math.round(B(e.SystemClockOffset)/1e3)-1,d=p,h=e.Expires||e.expires;d+=void 0===h?900:1*h||0;var f=n,m=o||p+";"+d,g=o||p+";"+d,v=S(a,!0).join(";").toLowerCase(),y=S(r,!0).join(";").toLowerCase(),b=l.HmacSHA1(g,i).toString(),x=[s,t,U.obj2str(r,!0),U.obj2str(a,!0),""].join("\n"),C=["sha1",m,l.SHA1(x).toString(),""].join("\n");return["q-sign-algorithm=sha1","q-ak="+f,"q-sign-time="+m,"q-key-time="+g,"q-header-list="+v,"q-url-param-list="+y,"q-signature="+l.HmacSHA1(C,b).toString()].join("&")}},compareVersion:L,canFileSlice:j,isCIHost:function(e){return/^https?:\/\/([^/]+\.)?ci\.[^/]+/.test(e)},error:function(e,t){var n=e;return e.message=e.message||null,"string"==typeof t?(e.error=t,e.message=t):"object"===a(t)&&null!==t&&(T(e,t),(t.code||t.name)&&(e.code=t.code||t.name),t.message&&(e.message=t.message),t.stack&&(e.stack=t.stack)),"function"==typeof Object.defineProperty&&(Object.defineProperty(e,"name",{writable:!0,enumerable:!1}),Object.defineProperty(e,"message",{enumerable:!0})),e.name=t&&t.name||e.name||e.code||"Error",e.code||(e.code=e.name),e.error||(e.error=E(n)),e},getSourceParams:function(e){var t=this.options.CopySourceParser;if(t)return t(e);var n=e.match(/^([^.]+-\d+)\.cos(v6|-cdc|-internal)?\.([^.]+)\.((myqcloud\.com)|(tencentcos\.cn))\/(.+)$/);return n?{Bucket:n[1],Region:n[3],Key:n[7]}:null},encodeBase64:function(e,t){var n=u.encode(e);return t&&(n=n.replaceAll("+","-").replaceAll("/","_").replaceAll("=","")),n},simplifyPath:function(e){var t,n=[],o=i(e.split("/"));try{for(o.s();!(t=o.n()).done;){var s=t.value;".."===s?n.length&&n.pop():s.length&&"."!==s&&n.push(s)}}catch(r){o.e(r)}finally{o.f()}return"/"+n.join("/")},arrayBufferToString:function(e){return new TextDecoder("utf-8").decode(e)},parseResBody:function(e){var t;if(e&&"string"==typeof e){var n=e.trim(),i=0===n.indexOf("<"),o=0===n.indexOf("{");if(i)t=U.xml2json(e)||{};else if(o)try{var s=e.replace(/\n/g," "),r=JSON.parse(s);t="[object Object]"===Object.prototype.toString.call(r)?r:e}catch(a){t=e}else t=e}else t=e||{};return t}};e.exports=U},function(e,t,n){const i=":A-Za-z_\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD",o="["+i+"]["+i+"\\-.\\d\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*",s=new RegExp("^"+o+"$");t.isExist=function(e){return void 0!==e},t.isEmptyObject=function(e){return 0===Object.keys(e).length},t.merge=function(e,t,n){if(t){const i=Object.keys(t),o=i.length;for(let s=0;s<o;s++)e[i[s]]="strict"===n?[t[i[s]]]:t[i[s]]}},t.getValue=function(e){return t.isExist(e)?e:""},t.isName=function(e){return!(null==s.exec(e))},t.getAllMatches=function(e,t){const n=[];let i=t.exec(e);for(;i;){const o=[];o.startIndex=t.lastIndex-i[0].length;const s=i.length;for(let e=0;e<s;e++)o.push(i[e]);n.push(o),i=t.exec(e)}return n},t.nameRegexp=o},function(e,t,n){function i(e){return(i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function o(){
/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */
o=function(){return t};var e,t={},n=Object.prototype,s=n.hasOwnProperty,r=Object.defineProperty||function(e,t,n){e[t]=n.value},a="function"==typeof Symbol?Symbol:{},c=a.iterator||"@@iterator",l=a.asyncIterator||"@@asyncIterator",u=a.toStringTag||"@@toStringTag";function p(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{p({},"")}catch(N){p=function(e,t,n){return e[t]=n}}function d(e,t,n,i){var o=t&&t.prototype instanceof b?t:b,s=Object.create(o.prototype),a=new P(i||[]);return r(s,"_invoke",{value:_(e,n,a)}),s}function h(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(i){return{type:"throw",arg:i}}}t.wrap=d;var f="suspendedStart",m="suspendedYield",g="executing",v="completed",y={};function b(){}function x(){}function S(){}var k={};p(k,c,(function(){return this}));var C=Object.getPrototypeOf,w=C&&C(C(M([])));w&&w!==n&&s.call(w,c)&&(k=w);var E=S.prototype=b.prototype=Object.create(k);function T(e){["next","throw","return"].forEach((function(t){p(e,t,(function(e){return this._invoke(t,e)}))}))}function I(e,t){function n(o,r,a,c){var l=h(e[o],e,r);if("throw"!==l.type){var u=l.arg,p=u.value;return p&&"object"==i(p)&&s.call(p,"__await")?t.resolve(p.__await).then((function(e){n("next",e,a,c)}),(function(e){n("throw",e,a,c)})):t.resolve(p).then((function(e){u.value=e,a(u)}),(function(e){return n("throw",e,a,c)}))}c(l.arg)}var o;r(this,"_invoke",{value:function(e,i){function s(){return new t((function(t,o){n(e,i,t,o)}))}return o=o?o.then(s,s):s()}})}function _(t,n,i){var o=f;return function(s,r){if(o===g)throw Error("Generator is already running");if(o===v){if("throw"===s)throw r;return{value:e,done:!0}}for(i.method=s,i.arg=r;;){var a=i.delegate;if(a){var c=O(a,i);if(c){if(c===y)continue;return c}}if("next"===i.method)i.sent=i._sent=i.arg;else if("throw"===i.method){if(o===f)throw o=v,i.arg;i.dispatchException(i.arg)}else"return"===i.method&&i.abrupt("return",i.arg);o=g;var l=h(t,n,i);if("normal"===l.type){if(o=i.done?v:m,l.arg===y)continue;return{value:l.arg,done:i.done}}"throw"===l.type&&(o=v,i.method="throw",i.arg=l.arg)}}}function O(t,n){var i=n.method,o=t.iterator[i];if(o===e)return n.delegate=null,"throw"===i&&t.iterator.return&&(n.method="return",n.arg=e,O(t,n),"throw"===n.method)||"return"!==i&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+i+"' method")),y;var s=h(o,t.iterator,n.arg);if("throw"===s.type)return n.method="throw",n.arg=s.arg,n.delegate=null,y;var r=s.arg;return r?r.done?(n[t.resultName]=r.value,n.next=t.nextLoc,"return"!==n.method&&(n.method="next",n.arg=e),n.delegate=null,y):r:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,y)}function A(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function R(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function P(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(A,this),this.reset(!0)}function M(t){if(t||""===t){var n=t[c];if(n)return n.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,r=function n(){for(;++o<t.length;)if(s.call(t,o))return n.value=t[o],n.done=!1,n;return n.value=e,n.done=!0,n};return r.next=r}}throw new TypeError(i(t)+" is not iterable")}return x.prototype=S,r(E,"constructor",{value:S,configurable:!0}),r(S,"constructor",{value:x,configurable:!0}),x.displayName=p(S,u,"GeneratorFunction"),t.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===x||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,S):(e.__proto__=S,p(e,u,"GeneratorFunction")),e.prototype=Object.create(E),e},t.awrap=function(e){return{__await:e}},T(I.prototype),p(I.prototype,l,(function(){return this})),t.AsyncIterator=I,t.async=function(e,n,i,o,s){void 0===s&&(s=Promise);var r=new I(d(e,n,i,o),s);return t.isGeneratorFunction(n)?r:r.next().then((function(e){return e.done?e.value:r.next()}))},T(E),p(E,u,"Generator"),p(E,c,(function(){return this})),p(E,"toString",(function(){return"[object Generator]"})),t.keys=function(e){var t=Object(e),n=[];for(var i in t)n.push(i);return n.reverse(),function e(){for(;n.length;){var i=n.pop();if(i in t)return e.value=i,e.done=!1,e}return e.done=!0,e}},t.values=M,P.prototype={constructor:P,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(R),!t)for(var n in this)"t"===n.charAt(0)&&s.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=e)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var n=this;function i(i,o){return a.type="throw",a.arg=t,n.next=i,o&&(n.method="next",n.arg=e),!!o}for(var o=this.tryEntries.length-1;o>=0;--o){var r=this.tryEntries[o],a=r.completion;if("root"===r.tryLoc)return i("end");if(r.tryLoc<=this.prev){var c=s.call(r,"catchLoc"),l=s.call(r,"finallyLoc");if(c&&l){if(this.prev<r.catchLoc)return i(r.catchLoc,!0);if(this.prev<r.finallyLoc)return i(r.finallyLoc)}else if(c){if(this.prev<r.catchLoc)return i(r.catchLoc,!0)}else{if(!l)throw Error("try statement without catch or finally");if(this.prev<r.finallyLoc)return i(r.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var i=this.tryEntries[n];if(i.tryLoc<=this.prev&&s.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var o=i;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var r=o?o.completion:{};return r.type=e,r.arg=t,o?(this.method="next",this.next=o.finallyLoc,y):this.complete(r)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),y},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),R(n),y}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var i=n.completion;if("throw"===i.type){var o=i.arg;R(n)}return o}}throw Error("illegal catch attempt")},delegateYield:function(t,n,i){return this.delegate={iterator:M(t),resultName:n,nextLoc:i},"next"===this.method&&(this.arg=e),y}},t}function s(e,t,n,i,o,s,r){try{var a=e[s](r),c=a.value}catch(l){return void n(l)}a.done?t(c):Promise.resolve(c).then(i,o)}function r(e){return function(){var t=this,n=arguments;return new Promise((function(i,o){var r=e.apply(t,n);function a(e){s(r,i,o,a,c,"next",e)}function c(e){s(r,i,o,a,c,"throw",e)}a(void 0)}))}}function a(e,t,n){return(t=l(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function c(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,l(i.key),i)}}function l(e){var t=function(e,t){if("object"!=i(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var o=n.call(e,t||"default");if("object"!=i(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==i(t)?t:t+""}var u=n(3),p=null,d=function(e){return!e||e<0?0:(e/1e3).toFixed(3)},h=function(){var e=function(){return(65536*(1+Math.random())|0).toString(16).substring(1)};return e()+e()+"-"+e()+"-"+e()+"-"+e()+"-"+e()+e()+e()},f=function(){return new Promise((function(e){if(Mn.canIUse("getNetworkType"))try{Mn.getNetworkType({success:function(t){e(t.networkType)}})}catch(t){e("can_not_get_network_type")}else e("can_not_get_network_type")}))},m=function(){var e={devicePlatform:"can_not_get_system_info",wxVersion:"can_not_get_system_info",wxSystem:"can_not_get_system_info",wxSdkVersion:"can_not_get_system_info"},t={},n={};Mn.canIUse("getAppBaseInfo")&&(t=Mn.getAppBaseInfo()||{}),Mn.canIUse("getDeviceInfo")&&(n=Mn.getDeviceInfo()||{});var i=t.SDKVersion||"can_not_get_system_info",o=t.version||"can_not_get_system_info",s=n.platform||"can_not_get_system_info",r=n.system||"can_not_get_system_info";return Object.assign(e,{devicePlatform:s,wxVersion:o,wxSystem:r,wxSdkVersion:i}),e}();function g(e){return e.replace(/([A-Z])/g,"_$1").toLowerCase()}function v(e){var t,n={},i=["sdkVersionName","sdkVersionCode","osName","networkType","requestName","requestResult","bucket","region","appid","accelerate","url","host","requestPath","userAgent","httpMethod","httpSize","httpSpeed","httpTookTime","httpMd5","httpSign","httpFullTime","httpDomain","partNumber","httpRetryTimes","customId","traceId","realApi"],o=[].concat(i,["errorNode","errorCode","errorName","errorMessage","errorRequestId","errorHttpCode","errorServiceName","errorType","fullError"]),s="Success"===e.requestResult?i:o;for(var r in e)s.includes(r)&&(n[g(r)]=e[r]);return n.request_name=e.realApi?(t=e.realApi,["putObject","sliceUploadFile","uploadFile","uploadFiles"].includes(t)?"UploadTask":"getObject"===t?"DownloadTask":["putObjectCopy","sliceCopyFile"].includes(t)?"CopyTask":t):e.requestName,n}var y=function(){function e(t){var n;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e);var i=t.parent,o=t.traceId,s=t.bucket,r=t.region,c=t.apiName,l=t.realApi,d=t.httpMethod,f=t.fileKey,g=t.fileSize,v=t.accelerate,y=t.customId,b=t.delay,x=t.deepTracker,S=t.Beacon,k=t.clsReporter,C=s&&s.substr(s.lastIndexOf("-")+1)||"";this.parent=i,this.deepTracker=x,this.delay=b,k&&!this.clsReporter&&(this.clsReporter=k),this.params=(a(n={sdkVersionName:"cos-wx-sdk-v5",sdkVersionCode:u.version,osName:m.devicePlatform,networkType:"",requestName:c||"",requestResult:"",realApi:l,bucket:s,region:r,accelerate:v,httpMethod:d,url:"",host:"",httpDomain:"",requestPath:f||"",errorType:"",errorCode:"",errorName:"",errorMessage:"",errorRequestId:"",errorHttpCode:0,errorServiceName:"",errorNode:"",httpTookTime:0,httpSize:g||0,httpMd5:0,httpSign:0,httpFullTime:0,httpSpeed:0,size:g||0},"httpMd5",0),a(n,"httpSign",0),a(n,"httpFull",0),a(n,"name",c||""),a(n,"tookTime",0),a(n,"md5StartTime",0),a(n,"md5EndTime",0),a(n,"signStartTime",0),a(n,"signEndTime",0),a(n,"httpStartTime",0),a(n,"httpEndTime",0),a(n,"startTime",(new Date).getTime()),a(n,"endTime",0),a(n,"traceId",o||h()),a(n,"appid",C),a(n,"partNumber",0),a(n,"httpRetryTimes",0),a(n,"customId",y||""),a(n,"partTime",0),n),S&&(this.beacon=function(e,t){if(!p){if("function"!=typeof e)throw new Error("Beacon not found");p=new e({appkey:"0WEB05PY6MHRGK0U",versionCode:u.version,channelID:"mp_sdk",openid:"openid",unionid:"unid",strictMode:!1,delay:t,sessionDuration:6e4})}return p}(S,b))}var t,n,i,s;return t=e,n=[{key:"formatResult",value:(s=r(o().mark((function e(t,n){var i,s,r,a,c,l,u,p,h,m,g,v,y,b,x,S,k,C,w,E,T,I,_,O,A,R,P;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return m=(new Date).getTime(),e.next=3,f();case 3:if(g=e.sent,v=t?(null==t||null===(i=t.error)||void 0===i||null===(s=i.error)||void 0===s?void 0:s.Code)||"Error":"",y=t&&((null==t||null===(r=t.error)||void 0===r||null===(a=r.error)||void 0===a?void 0:a.Message)||(null==t||null===(c=t.error)||void 0===c?void 0:c.error)||(null==t?void 0:t.error))||"",b=y,x=t?null==t||null===(l=t.error)||void 0===l?void 0:l.statusCode:n.statusCode,S=t?null==t||null===(u=t.error)||void 0===u||null===(p=u.error)||void 0===p?void 0:p.Resource:"",k=t?(null==t||null===(h=t.error)||void 0===h?void 0:h.RequestId)||"":(null==n?void 0:n.RequestId)||"",C=t?k?"Server":"Client":"","getObject"===this.params.requestName&&(this.params.httpSize=n?n.headers&&n.headers["content-length"]:0),w="sliceUploadFile"===this.params.realApi,E="sliceCopyFile"===this.params.realApi,w||E?(T=this.params.httpSize/1024/this.params.partTime,Object.assign(this.params,{httpSpeed:T<0?0:T.toFixed(3)})):(I=m-this.params.startTime,_=this.params.httpEndTime-this.params.httpStartTime,O=this.params.httpSize/1024/(_/1e3),A=this.params.md5EndTime-this.params.md5StartTime,R=this.params.signEndTime-this.params.signStartTime,this.parent&&(this.parent.addParamValue("httpTookTime",d(_)),this.parent.addParamValue("httpFullTime",d(I)),this.parent.addParamValue("httpMd5",d(A)),this.parent.addParamValue("httpSign",d(R)),["multipartUpload","uploadPartCopy","putObjectCopy"].includes(this.params.requestName)&&this.parent.addParamValue("partTime",d(_))),Object.assign(this.params,{httpFullTime:d(I),httpMd5:d(A),httpSign:d(R),httpTookTime:d(_),httpSpeed:O<0?0:O.toFixed(3)})),Object.assign(this.params,{networkType:g,requestResult:t?"Failure":"Success",errorType:C,errorCode:v,errorHttpCode:x,errorName:b,errorMessage:y,errorServiceName:S,errorRequestId:k}),!t||v&&y||(this.params.fullError=t?JSON.stringify(t):""),"getObject"===this.params.name&&(this.params.size=n?n.headers&&n.headers["content-length"]:-1),this.params.url){try{P=/^http(s)?:\/\/(.*?)\//.exec(this.params.url),this.params.host=P[2]}catch(o){this.params.host=this.params.url}this.params.httpDomain=this.params.host}case 19:case"end":return e.stop()}}),e,this)}))),function(e,t){return s.apply(this,arguments)})},{key:"report",value:(i=r(o().mark((function e(t,n){var i;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.beacon||this.clsReporter){e.next=2;break}return e.abrupt("return");case 2:return e.next=4,this.formatResult(t,n);case 4:i=v(this.params),this.beacon&&this.sendEventsToBeacon(i),this.clsReporter&&this.sendEventsToCLS(i);case 7:case"end":return e.stop()}}),e,this)}))),function(e,t){return i.apply(this,arguments)})},{key:"setParams",value:function(e){Object.assign(this.params,e)}},{key:"addParamValue",value:function(e,t){this.params[e]=(+this.params[e]+ +t).toFixed(3)}},{key:"sendEventsToBeacon",value:function(e){if("sliceUploadFile"!==this.params.requestName&&"sliceUploadFile"!==this.params.realApi||this.deepTracker){var t="qcloud_track_cos_sdk";0===this.delay?this.beacon&&this.beacon.onDirectUserAction(t,e):this.beacon&&this.beacon.onUserAction(t,e)}}},{key:"sendEventsToCLS",value:function(e){var t=!(0!==this.delay);this.clsReporter.log(e,t)}},{key:"generateSubTracker",value:function(t){return Object.assign(t,{parent:this,deepTracker:this.deepTracker,traceId:this.params.traceId,bucket:this.params.bucket,region:this.params.region,accelerate:this.params.accelerate,fileKey:this.params.requestPath,customId:this.params.customId,delay:this.params.delay,clsReporter:this.clsReporter}),new e(t)}}],n&&c(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),e}();e.exports=y},function(e){e.exports=JSON.parse('{"name":"cos-wx-sdk-v5","version":"1.8.0","description":"小程序 SDK for [腾讯云对象存储服务](https://cloud.tencent.com/product/cos)","main":"dist/cos-wx-sdk-v5.min.js","scripts":{"prettier":"prettier --write src demo/demo-sdk.js demo/test.js demo/ciDemo","dev":"cross-env NODE_ENV=development node build.js --mode=development","build":"cross-env NODE_ENV=production node build.js --mode=production","sts.js":"node server/sts.js","postinstall":"patch-package"},"repository":{"type":"git","url":"http://github.com/tencentyun/cos-wx-sdk-v5.git"},"author":"carsonxu","license":"ISC","dependencies":{"fast-xml-parser":"4.5.0","mime":"^2.4.6"},"devDependencies":{"@babel/core":"7.17.9","@babel/preset-env":"7.16.11","babel-loader":"8.2.5","body-parser":"^1.18.3","cross-env":"^7.0.3","express":"^4.17.1","patch-package":"^8.0.0","prettier":"^3.0.1","qcloud-cos-sts":"^3.0.2","terser-webpack-plugin":"4.2.3","webpack":"4.46.0","webpack-cli":"4.10.0"}}')},function(e,t,n){const i=n(1),o={allowBooleanAttributes:!1,unpairedTags:[]};function s(e){return" "===e||"\t"===e||"\n"===e||"\r"===e}function r(e,t){const n=t;for(;t<e.length;t++)if("?"!=e[t]&&" "!=e[t]);else{const i=e.substr(n,t-n);if(t>5&&"xml"===i)return f("InvalidXml","XML declaration allowed only at the start of the document.",g(e,t));if("?"==e[t]&&">"==e[t+1]){t++;break}}return t}function a(e,t){if(e.length>t+5&&"-"===e[t+1]&&"-"===e[t+2]){for(t+=3;t<e.length;t++)if("-"===e[t]&&"-"===e[t+1]&&">"===e[t+2]){t+=2;break}}else if(e.length>t+8&&"D"===e[t+1]&&"O"===e[t+2]&&"C"===e[t+3]&&"T"===e[t+4]&&"Y"===e[t+5]&&"P"===e[t+6]&&"E"===e[t+7]){let n=1;for(t+=8;t<e.length;t++)if("<"===e[t])n++;else if(">"===e[t]&&(n--,0===n))break}else if(e.length>t+9&&"["===e[t+1]&&"C"===e[t+2]&&"D"===e[t+3]&&"A"===e[t+4]&&"T"===e[t+5]&&"A"===e[t+6]&&"["===e[t+7])for(t+=8;t<e.length;t++)if("]"===e[t]&&"]"===e[t+1]&&">"===e[t+2]){t+=2;break}return t}t.validate=function(e,t){t=Object.assign({},o,t);const n=[];let c=!1,l=!1;"\ufeff"===e[0]&&(e=e.substr(1));for(let o=0;o<e.length;o++)if("<"===e[o]&&"?"===e[o+1]){if(o+=2,o=r(e,o),o.err)return o}else{if("<"!==e[o]){if(s(e[o]))continue;return f("InvalidChar","char '"+e[o]+"' is not expected.",g(e,o))}{let m=o;if(o++,"!"===e[o]){o=a(e,o);continue}{let v=!1;"/"===e[o]&&(v=!0,o++);let y="";for(;o<e.length&&">"!==e[o]&&" "!==e[o]&&"\t"!==e[o]&&"\n"!==e[o]&&"\r"!==e[o];o++)y+=e[o];if(y=y.trim(),"/"===y[y.length-1]&&(y=y.substring(0,y.length-1),o--),p=y,!i.isName(p)){let t;return t=0===y.trim().length?"Invalid space after '<'.":"Tag '"+y+"' is an invalid name.",f("InvalidTag",t,g(e,o))}const b=u(e,o);if(!1===b)return f("InvalidAttr","Attributes for '"+y+"' have open quote.",g(e,o));let x=b.value;if(o=b.index,"/"===x[x.length-1]){const n=o-x.length;x=x.substring(0,x.length-1);const i=d(x,t);if(!0!==i)return f(i.err.code,i.err.msg,g(e,n+i.err.line));c=!0}else if(v){if(!b.tagClosed)return f("InvalidTag","Closing tag '"+y+"' doesn't have proper closing.",g(e,o));if(x.trim().length>0)return f("InvalidTag","Closing tag '"+y+"' can't have attributes or invalid starting.",g(e,m));if(0===n.length)return f("InvalidTag","Closing tag '"+y+"' has not been opened.",g(e,m));{const t=n.pop();if(y!==t.tagName){let n=g(e,t.tagStartPos);return f("InvalidTag","Expected closing tag '"+t.tagName+"' (opened in line "+n.line+", col "+n.col+") instead of closing tag '"+y+"'.",g(e,m))}0==n.length&&(l=!0)}}else{const i=d(x,t);if(!0!==i)return f(i.err.code,i.err.msg,g(e,o-x.length+i.err.line));if(!0===l)return f("InvalidXml","Multiple possible root nodes found.",g(e,o));-1!==t.unpairedTags.indexOf(y)||n.push({tagName:y,tagStartPos:m}),c=!0}for(o++;o<e.length;o++)if("<"===e[o]){if("!"===e[o+1]){o++,o=a(e,o);continue}if("?"!==e[o+1])break;if(o=r(e,++o),o.err)return o}else if("&"===e[o]){const t=h(e,o);if(-1==t)return f("InvalidChar","char '&' is not expected.",g(e,o));o=t}else if(!0===l&&!s(e[o]))return f("InvalidXml","Extra text at the end",g(e,o));"<"===e[o]&&o--}}}var p;return c?1==n.length?f("InvalidTag","Unclosed tag '"+n[0].tagName+"'.",g(e,n[0].tagStartPos)):!(n.length>0)||f("InvalidXml","Invalid '"+JSON.stringify(n.map((e=>e.tagName)),null,4).replace(/\r?\n/g,"")+"' found.",{line:1,col:1}):f("InvalidXml","Start tag expected.",1)};const c='"',l="'";function u(e,t){let n="",i="",o=!1;for(;t<e.length;t++){if(e[t]===c||e[t]===l)""===i?i=e[t]:i!==e[t]||(i="");else if(">"===e[t]&&""===i){o=!0;break}n+=e[t]}return""===i&&{value:n,index:t,tagClosed:o}}const p=new RegExp("(\\s*)([^\\s=]+)(\\s*=)?(\\s*(['\"])(([\\s\\S])*?)\\5)?","g");function d(e,t){const n=i.getAllMatches(e,p),o={};for(let i=0;i<n.length;i++){if(0===n[i][1].length)return f("InvalidAttr","Attribute '"+n[i][2]+"' has no space in starting.",v(n[i]));if(void 0!==n[i][3]&&void 0===n[i][4])return f("InvalidAttr","Attribute '"+n[i][2]+"' is without value.",v(n[i]));if(void 0===n[i][3]&&!t.allowBooleanAttributes)return f("InvalidAttr","boolean attribute '"+n[i][2]+"' is not allowed.",v(n[i]));const e=n[i][2];if(!m(e))return f("InvalidAttr","Attribute '"+e+"' is an invalid name.",v(n[i]));if(o.hasOwnProperty(e))return f("InvalidAttr","Attribute '"+e+"' is repeated.",v(n[i]));o[e]=1}return!0}function h(e,t){if(";"===e[++t])return-1;if("#"===e[t])return function(e,t){let n=/\d/;for("x"===e[t]&&(t++,n=/[\da-fA-F]/);t<e.length;t++){if(";"===e[t])return t;if(!e[t].match(n))break}return-1}(e,++t);let n=0;for(;t<e.length;t++,n++)if(!(e[t].match(/\w/)&&n<20)){if(";"===e[t])break;return-1}return t}function f(e,t,n){return{err:{code:e,msg:t,line:n.line||n,col:n.col}}}function m(e){return i.isName(e)}function g(e,t){const n=e.substring(0,t).split(/\r?\n/);return{line:n.length,col:n[n.length-1].length+1}}function v(e){return e.startIndex+e[1].length}},function(e,t){e.exports=function(e){return"function"==typeof e?e:Array.isArray(e)?t=>{for(const n of e){if("string"==typeof n&&t===n)return!0;if(n instanceof RegExp&&n.test(t))return!0}}:()=>!1}},function(e,t){var n=function(e){var t={},n=function(e){return!t[e]&&(t[e]=[]),t[e]};e.on=function(e,t){n(e).push(t)},e.off=function(e,t){for(var i=n(e),o=i.length-1;o>=0;o--)t===i[o]&&i.splice(o,1)},e.emit=function(e,t){for(var i=n(e).map((function(e){return e})),o=0;o<i.length;o++)i[o](t)}};e.exports.init=n,e.exports.EventProxy=function(){n(this)}},function(e,t,n){var i,o,s=n(0),r="cos_sdk_upload_cache",a=function(){try{i.length?Mn.setStorageSync(r,JSON.stringify(i)):Mn.removeStorageSync(r)}catch(e){}},c=function(){if(!i){i=function(){try{var e=JSON.parse(Mn.getStorageSync(r))}catch(t){}return e||(e=[]),e}();for(var e=!1,t=Math.round(Date.now()/1e3),n=i.length-1;n>=0;n--){var o=i[n][2];(!o||o+2592e3<t)&&(i.splice(n,1),e=!0)}e&&a()}},l=function(){o||(o=setTimeout((function(){a(),o=null}),400))},u={using:{},setUsing:function(e){u.using[e]=!0},removeUsing:function(e){delete u.using[e]},getFileId:function(e,t,n,i){return e.FilePath&&e.size&&e.lastModifiedTime&&t?s.md5([e.FilePath].join("::"))+"-"+s.md5([e.size,e.mode,e.lastAccessedTime,e.lastModifiedTime,t,n,i].join("::")):null},getCopyFileId:function(e,t,n,i,o){var r=t["content-length"],a=t.etag||"",c=t["last-modified"];return e&&n?s.md5([e,r,a,c,n,i,o].join("::")):null},getUploadIdList:function(e){if(!e)return null;c();for(var t=[],n=0;n<i.length;n++)i[n][0]===e&&t.push(i[n][1]);return t.length?t:null},saveUploadId:function(e,t,n){if(c(),e){for(var o=e.substr(0,e.indexOf("-")+1),s=i.length-1;s>=0;s--){var r=i[s];(r[0]===e&&r[1]===t||e!==r[0]&&0===r[0].indexOf(o))&&i.splice(s,1)}i.unshift([e,t,Math.round(Date.now()/1e3)]),i.length>n&&i.splice(n),l()}},removeUploadId:function(e){c(),delete u.using[e];for(var t=i.length-1;t>=0;t--)i[t][1]===e&&i.splice(t,1);l()}};e.exports=u},function(e,t,n){var i=n(9);e.exports=i},function(e,t,n){var i=n(0),o=n(6),s=n(25),r=n(26),a=n(32),c=n(3),l={SecretId:"",SecretKey:"",SecurityToken:"",StartTime:0,ExpiredTime:0,ChunkRetryTimes:2,FileParallelLimit:3,ChunkParallelLimit:3,ChunkSize:1048576,SliceSize:1048576,CopyChunkParallelLimit:20,CopyChunkSize:10485760,CopySliceSize:10485760,MaxPartNumber:1e4,ProgressInterval:1e3,UploadQueueSize:1e4,Domain:"",ServiceDomain:"",Protocol:"",CompatibilityMode:!1,ForcePathStyle:!1,Timeout:0,CorrectClockSkew:!0,SystemClockOffset:0,UploadCheckContentMd5:!1,UploadAddMetaMd5:!1,UploadIdCacheLimit:50,UseAccelerate:!1,ForceSignHost:!0,HttpDNSServiceId:"",SimpleUploadMethod:"postObject",AutoSwitchHost:!1,CopySourceParser:null,ObjectKeySimplifyCheck:!0,DeepTracker:!1,TrackerDelay:5e3,CustomId:"",BeaconReporter:null,ClsReporter:null},u=function(e){if(this.options=i.extend(i.clone(l),e||{}),this.options.FileParallelLimit=Math.max(1,this.options.FileParallelLimit),this.options.ChunkParallelLimit=Math.max(1,this.options.ChunkParallelLimit),this.options.ChunkRetryTimes=Math.max(0,this.options.ChunkRetryTimes),this.options.ChunkSize=Math.max(1048576,this.options.ChunkSize),this.options.CopyChunkParallelLimit=Math.max(1,this.options.CopyChunkParallelLimit),this.options.CopyChunkSize=Math.max(1048576,this.options.CopyChunkSize),this.options.CopySliceSize=Math.max(0,this.options.CopySliceSize),this.options.MaxPartNumber=Math.max(1024,Math.min(1e4,this.options.MaxPartNumber)),this.options.Timeout=Math.max(0,this.options.Timeout),this.options.EnableReporter=this.options.BeaconReporter||this.options.ClsReporter,this.options.AppId,this.options.SecretId&&this.options.SecretId.indexOf(" "),this.options.SecretKey&&this.options.SecretKey.indexOf(" "),this.options.ForcePathStyle)throw new Error("ForcePathStyle is not supported");o.init(this),s.init(this)};r.init(u,s),a.init(u,s),u.util={md5:i.md5,xml2json:i.xml2json,json2xml:i.json2xml,encodeBase64:i.encodeBase64},u.getAuthorization=i.getAuth,u.version=c.version,e.exports=u},function(e,t,n){(function(e){var t;function i(e){return(i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}!function(){var o="input is invalid type",s="object"===("undefined"==typeof window?"undefined":i(window)),r=s?window:{};r.JS_MD5_NO_WINDOW&&(s=!1),!s&&"object"===("undefined"==typeof self?"undefined":i(self))&&(r=self);var a,c=!r.JS_MD5_NO_COMMON_JS&&"object"===i(e)&&e.exports,l=n(12),u=!r.JS_MD5_NO_ARRAY_BUFFER&&"undefined"!=typeof ArrayBuffer,p="0123456789abcdef".split(""),d=[128,32768,8388608,-2147483648],h=[0,8,16,24],f=["hex","array","digest","buffer","arrayBuffer","base64"],m="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split(""),g=[];if(u){var v=new ArrayBuffer(68);a=new Uint8Array(v),g=new Uint32Array(v)}!r.JS_MD5_NO_NODE_JS&&Array.isArray||(Array.isArray=function(e){return"[object Array]"===Object.prototype.toString.call(e)}),!u||!r.JS_MD5_NO_ARRAY_BUFFER_IS_VIEW&&ArrayBuffer.isView||(ArrayBuffer.isView=function(e){return"object"===i(e)&&e.buffer&&e.buffer.constructor===ArrayBuffer});var y=function(e){return function(t){return new b(!0).update(t)[e]()}};function b(e){if(e)g[0]=g[16]=g[1]=g[2]=g[3]=g[4]=g[5]=g[6]=g[7]=g[8]=g[9]=g[10]=g[11]=g[12]=g[13]=g[14]=g[15]=0,this.blocks=g,this.buffer8=a;else if(u){var t=new ArrayBuffer(68);this.buffer8=new Uint8Array(t),this.blocks=new Uint32Array(t)}else this.blocks=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];this.h0=this.h1=this.h2=this.h3=this.start=this.bytes=this.hBytes=0,this.finalized=this.hashed=!1,this.first=!0}b.prototype.update=function(e){if(!this.finalized){var t,n=i(e);if("string"!==n){if("object"!==n)throw o;if(null===e)throw o;if(!u||e.constructor!==ArrayBuffer&&"ArrayBuffer"!==e.constructor.name){if(!(Array.isArray(e)||u&&ArrayBuffer.isView(e)))throw o}else e=new Uint8Array(e);t=!0}for(var s,r,a=0,c=e.length,l=this.blocks,p=this.buffer8;a<c;){if(this.hashed&&(this.hashed=!1,l[0]=l[16],l[16]=l[1]=l[2]=l[3]=l[4]=l[5]=l[6]=l[7]=l[8]=l[9]=l[10]=l[11]=l[12]=l[13]=l[14]=l[15]=0),t)if(u)for(r=this.start;a<c&&r<64;++a)p[r++]=e[a];else for(r=this.start;a<c&&r<64;++a)l[r>>2]|=e[a]<<h[3&r++];else if(u)for(r=this.start;a<c&&r<64;++a)(s=e.charCodeAt(a))<128?p[r++]=s:s<2048?(p[r++]=192|s>>6,p[r++]=128|63&s):s<55296||s>=57344?(p[r++]=224|s>>12,p[r++]=128|s>>6&63,p[r++]=128|63&s):(s=65536+((1023&s)<<10|1023&e.charCodeAt(++a)),p[r++]=240|s>>18,p[r++]=128|s>>12&63,p[r++]=128|s>>6&63,p[r++]=128|63&s);else for(r=this.start;a<c&&r<64;++a)(s=e.charCodeAt(a))<128?l[r>>2]|=s<<h[3&r++]:s<2048?(l[r>>2]|=(192|s>>6)<<h[3&r++],l[r>>2]|=(128|63&s)<<h[3&r++]):s<55296||s>=57344?(l[r>>2]|=(224|s>>12)<<h[3&r++],l[r>>2]|=(128|s>>6&63)<<h[3&r++],l[r>>2]|=(128|63&s)<<h[3&r++]):(s=65536+((1023&s)<<10|1023&e.charCodeAt(++a)),l[r>>2]|=(240|s>>18)<<h[3&r++],l[r>>2]|=(128|s>>12&63)<<h[3&r++],l[r>>2]|=(128|s>>6&63)<<h[3&r++],l[r>>2]|=(128|63&s)<<h[3&r++]);this.lastByteIndex=r,this.bytes+=r-this.start,r>=64?(this.start=r-64,this.hash(),this.hashed=!0):this.start=r}return this.bytes>4294967295&&(this.hBytes+=this.bytes/4294967296|0,this.bytes=this.bytes%4294967296),this}},b.prototype.finalize=function(){if(!this.finalized){this.finalized=!0;var e=this.blocks,t=this.lastByteIndex;e[t>>2]|=d[3&t],t>=56&&(this.hashed||this.hash(),e[0]=e[16],e[16]=e[1]=e[2]=e[3]=e[4]=e[5]=e[6]=e[7]=e[8]=e[9]=e[10]=e[11]=e[12]=e[13]=e[14]=e[15]=0),e[14]=this.bytes<<3,e[15]=this.hBytes<<3|this.bytes>>>29,this.hash()}},b.prototype.hash=function(){var e,t,n,i,o,s,r=this.blocks;this.first?t=((t=((e=((e=r[0]-680876937)<<7|e>>>25)-271733879|0)^(n=((n=(-271733879^(i=((i=(-1732584194^2004318071&e)+r[1]-117830708)<<12|i>>>20)+e|0)&(-271733879^e))+r[2]-1126478375)<<17|n>>>15)+i|0)&(i^e))+r[3]-1316259209)<<22|t>>>10)+n|0:(e=this.h0,t=this.h1,n=this.h2,t=((t+=((e=((e+=((i=this.h3)^t&(n^i))+r[0]-680876936)<<7|e>>>25)+t|0)^(n=((n+=(t^(i=((i+=(n^e&(t^n))+r[1]-389564586)<<12|i>>>20)+e|0)&(e^t))+r[2]+606105819)<<17|n>>>15)+i|0)&(i^e))+r[3]-1044525330)<<22|t>>>10)+n|0),t=((t+=((e=((e+=(i^t&(n^i))+r[4]-176418897)<<7|e>>>25)+t|0)^(n=((n+=(t^(i=((i+=(n^e&(t^n))+r[5]+1200080426)<<12|i>>>20)+e|0)&(e^t))+r[6]-1473231341)<<17|n>>>15)+i|0)&(i^e))+r[7]-45705983)<<22|t>>>10)+n|0,t=((t+=((e=((e+=(i^t&(n^i))+r[8]+1770035416)<<7|e>>>25)+t|0)^(n=((n+=(t^(i=((i+=(n^e&(t^n))+r[9]-1958414417)<<12|i>>>20)+e|0)&(e^t))+r[10]-42063)<<17|n>>>15)+i|0)&(i^e))+r[11]-1990404162)<<22|t>>>10)+n|0,t=((t+=((e=((e+=(i^t&(n^i))+r[12]+1804603682)<<7|e>>>25)+t|0)^(n=((n+=(t^(i=((i+=(n^e&(t^n))+r[13]-40341101)<<12|i>>>20)+e|0)&(e^t))+r[14]-1502002290)<<17|n>>>15)+i|0)&(i^e))+r[15]+1236535329)<<22|t>>>10)+n|0,t=((t+=((i=((i+=(t^n&((e=((e+=(n^i&(t^n))+r[1]-165796510)<<5|e>>>27)+t|0)^t))+r[6]-1069501632)<<9|i>>>23)+e|0)^e&((n=((n+=(e^t&(i^e))+r[11]+643717713)<<14|n>>>18)+i|0)^i))+r[0]-373897302)<<20|t>>>12)+n|0,t=((t+=((i=((i+=(t^n&((e=((e+=(n^i&(t^n))+r[5]-701558691)<<5|e>>>27)+t|0)^t))+r[10]+38016083)<<9|i>>>23)+e|0)^e&((n=((n+=(e^t&(i^e))+r[15]-660478335)<<14|n>>>18)+i|0)^i))+r[4]-405537848)<<20|t>>>12)+n|0,t=((t+=((i=((i+=(t^n&((e=((e+=(n^i&(t^n))+r[9]+568446438)<<5|e>>>27)+t|0)^t))+r[14]-1019803690)<<9|i>>>23)+e|0)^e&((n=((n+=(e^t&(i^e))+r[3]-187363961)<<14|n>>>18)+i|0)^i))+r[8]+1163531501)<<20|t>>>12)+n|0,t=((t+=((i=((i+=(t^n&((e=((e+=(n^i&(t^n))+r[13]-1444681467)<<5|e>>>27)+t|0)^t))+r[2]-51403784)<<9|i>>>23)+e|0)^e&((n=((n+=(e^t&(i^e))+r[7]+1735328473)<<14|n>>>18)+i|0)^i))+r[12]-1926607734)<<20|t>>>12)+n|0,t=((t+=((s=(i=((i+=((o=t^n)^(e=((e+=(o^i)+r[5]-378558)<<4|e>>>28)+t|0))+r[8]-2022574463)<<11|i>>>21)+e|0)^e)^(n=((n+=(s^t)+r[11]+1839030562)<<16|n>>>16)+i|0))+r[14]-35309556)<<23|t>>>9)+n|0,t=((t+=((s=(i=((i+=((o=t^n)^(e=((e+=(o^i)+r[1]-1530992060)<<4|e>>>28)+t|0))+r[4]+1272893353)<<11|i>>>21)+e|0)^e)^(n=((n+=(s^t)+r[7]-155497632)<<16|n>>>16)+i|0))+r[10]-1094730640)<<23|t>>>9)+n|0,t=((t+=((s=(i=((i+=((o=t^n)^(e=((e+=(o^i)+r[13]+681279174)<<4|e>>>28)+t|0))+r[0]-358537222)<<11|i>>>21)+e|0)^e)^(n=((n+=(s^t)+r[3]-722521979)<<16|n>>>16)+i|0))+r[6]+76029189)<<23|t>>>9)+n|0,t=((t+=((s=(i=((i+=((o=t^n)^(e=((e+=(o^i)+r[9]-640364487)<<4|e>>>28)+t|0))+r[12]-421815835)<<11|i>>>21)+e|0)^e)^(n=((n+=(s^t)+r[15]+530742520)<<16|n>>>16)+i|0))+r[2]-995338651)<<23|t>>>9)+n|0,t=((t+=((i=((i+=(t^((e=((e+=(n^(t|~i))+r[0]-198630844)<<6|e>>>26)+t|0)|~n))+r[7]+1126891415)<<10|i>>>22)+e|0)^((n=((n+=(e^(i|~t))+r[14]-1416354905)<<15|n>>>17)+i|0)|~e))+r[5]-57434055)<<21|t>>>11)+n|0,t=((t+=((i=((i+=(t^((e=((e+=(n^(t|~i))+r[12]+1700485571)<<6|e>>>26)+t|0)|~n))+r[3]-1894986606)<<10|i>>>22)+e|0)^((n=((n+=(e^(i|~t))+r[10]-1051523)<<15|n>>>17)+i|0)|~e))+r[1]-2054922799)<<21|t>>>11)+n|0,t=((t+=((i=((i+=(t^((e=((e+=(n^(t|~i))+r[8]+1873313359)<<6|e>>>26)+t|0)|~n))+r[15]-30611744)<<10|i>>>22)+e|0)^((n=((n+=(e^(i|~t))+r[6]-1560198380)<<15|n>>>17)+i|0)|~e))+r[13]+1309151649)<<21|t>>>11)+n|0,t=((t+=((i=((i+=(t^((e=((e+=(n^(t|~i))+r[4]-145523070)<<6|e>>>26)+t|0)|~n))+r[11]-1120210379)<<10|i>>>22)+e|0)^((n=((n+=(e^(i|~t))+r[2]+718787259)<<15|n>>>17)+i|0)|~e))+r[9]-343485551)<<21|t>>>11)+n|0,this.first?(this.h0=e+1732584193|0,this.h1=t-271733879|0,this.h2=n-1732584194|0,this.h3=i+271733878|0,this.first=!1):(this.h0=this.h0+e|0,this.h1=this.h1+t|0,this.h2=this.h2+n|0,this.h3=this.h3+i|0)},b.prototype.hex=function(){this.finalize();var e=this.h0,t=this.h1,n=this.h2,i=this.h3;return p[e>>4&15]+p[15&e]+p[e>>12&15]+p[e>>8&15]+p[e>>20&15]+p[e>>16&15]+p[e>>28&15]+p[e>>24&15]+p[t>>4&15]+p[15&t]+p[t>>12&15]+p[t>>8&15]+p[t>>20&15]+p[t>>16&15]+p[t>>28&15]+p[t>>24&15]+p[n>>4&15]+p[15&n]+p[n>>12&15]+p[n>>8&15]+p[n>>20&15]+p[n>>16&15]+p[n>>28&15]+p[n>>24&15]+p[i>>4&15]+p[15&i]+p[i>>12&15]+p[i>>8&15]+p[i>>20&15]+p[i>>16&15]+p[i>>28&15]+p[i>>24&15]},b.prototype.toString=b.prototype.hex,b.prototype.digest=function(){this.finalize();var e=this.h0,t=this.h1,n=this.h2,i=this.h3;return[255&e,e>>8&255,e>>16&255,e>>24&255,255&t,t>>8&255,t>>16&255,t>>24&255,255&n,n>>8&255,n>>16&255,n>>24&255,255&i,i>>8&255,i>>16&255,i>>24&255]},b.prototype.array=b.prototype.digest,b.prototype.arrayBuffer=function(){this.finalize();var e=new ArrayBuffer(16),t=new Uint32Array(e);return t[0]=this.h0,t[1]=this.h1,t[2]=this.h2,t[3]=this.h3,e},b.prototype.buffer=b.prototype.arrayBuffer,b.prototype.base64=function(){for(var e,t,n,i="",o=this.array(),s=0;s<15;)e=o[s++],t=o[s++],n=o[s++],i+=m[e>>>2]+m[63&(e<<4|t>>>4)]+m[63&(t<<2|n>>>6)]+m[63&n];return e=o[s],i+(m[e>>>2]+m[e<<4&63]+"==")};var x=function(){var e=y("hex");e.getCtx=e.create=function(){return new b},e.update=function(t){return e.create().update(t)};for(var t=0;t<f.length;++t){var n=f[t];e[n]=y(n)}return e}();c?e.exports=x:(r.md5=x,l&&(void 0===(t=function(){return x}.call(x,n,x,e))||(e.exports=t)))}()}).call(this,n(11)(e))},function(e,t){e.exports=function(e){return e.webpackPolyfill||(e.deprecate=function(){},e.paths=[],e.children||(e.children=[]),Object.defineProperty(e,"loaded",{enumerable:!0,get:function(){return e.l}}),Object.defineProperty(e,"id",{enumerable:!0,get:function(){return e.i}}),e.webpackPolyfill=1),e}},function(e,t){(function(t){e.exports=t}).call(this,{})},function(e,t){var n,i,o,s,r,a,c,l,u,p=p||function(e){var t={},n=t.lib={},i=function(){},o=n.Base={extend:function(e){i.prototype=this;var t=new i;return e&&t.mixIn(e),t.hasOwnProperty("init")||(t.init=function(){t.$super.init.apply(this,arguments)}),t.init.prototype=t,t.$super=this,t},create:function(){var e=this.extend();return e.init.apply(e,arguments),e},init:function(){},mixIn:function(e){for(var t in e)e.hasOwnProperty(t)&&(this[t]=e[t]);e.hasOwnProperty("toString")&&(this.toString=e.toString)},clone:function(){return this.init.prototype.extend(this)}},s=n.WordArray=o.extend({init:function(e,t){e=this.words=e||[],this.sigBytes=null!=t?t:4*e.length},toString:function(e){return(e||a).stringify(this)},concat:function(e){var t=this.words,n=e.words,i=this.sigBytes;if(e=e.sigBytes,this.clamp(),i%4)for(var o=0;o<e;o++)t[i+o>>>2]|=(n[o>>>2]>>>24-o%4*8&255)<<24-(i+o)%4*8;else if(65535<n.length)for(o=0;o<e;o+=4)t[i+o>>>2]=n[o>>>2];else t.push.apply(t,n);return this.sigBytes+=e,this},clamp:function(){var t=this.words,n=this.sigBytes;t[n>>>2]&=4294967295<<32-n%4*8,t.length=e.ceil(n/4)},clone:function(){var e=o.clone.call(this);return e.words=this.words.slice(0),e},random:function(t){for(var n=[],i=0;i<t;i+=4)n.push(4294967296*e.random()|0);return new s.init(n,t)}}),r=t.enc={},a=r.Hex={stringify:function(e){var t=e.words;e=e.sigBytes;for(var n=[],i=0;i<e;i++){var o=t[i>>>2]>>>24-i%4*8&255;n.push((o>>>4).toString(16)),n.push((15&o).toString(16))}return n.join("")},parse:function(e){for(var t=e.length,n=[],i=0;i<t;i+=2)n[i>>>3]|=parseInt(e.substr(i,2),16)<<24-i%8*4;return new s.init(n,t/2)}},c=r.Latin1={stringify:function(e){var t=e.words;e=e.sigBytes;for(var n=[],i=0;i<e;i++)n.push(String.fromCharCode(t[i>>>2]>>>24-i%4*8&255));return n.join("")},parse:function(e){for(var t=e.length,n=[],i=0;i<t;i++)n[i>>>2]|=(255&e.charCodeAt(i))<<24-i%4*8;return new s.init(n,t)}},l=r.Utf8={stringify:function(e){try{return decodeURIComponent(escape(c.stringify(e)))}catch(t){throw Error("Malformed UTF-8 data")}},parse:function(e){return c.parse(unescape(encodeURIComponent(e)))}},u=n.BufferedBlockAlgorithm=o.extend({reset:function(){this._data=new s.init,this._nDataBytes=0},_append:function(e){"string"==typeof e&&(e=l.parse(e)),this._data.concat(e),this._nDataBytes+=e.sigBytes},_process:function(t){var n=this._data,i=n.words,o=n.sigBytes,r=this.blockSize,a=o/(4*r);if(t=(a=t?e.ceil(a):e.max((0|a)-this._minBufferSize,0))*r,o=e.min(4*t,o),t){for(var c=0;c<t;c+=r)this._doProcessBlock(i,c);c=i.splice(0,t),n.sigBytes-=o}return new s.init(c,o)},clone:function(){var e=o.clone.call(this);return e._data=this._data.clone(),e},_minBufferSize:0});n.Hasher=u.extend({cfg:o.extend(),init:function(e){this.cfg=this.cfg.extend(e),this.reset()},reset:function(){u.reset.call(this),this._doReset()},update:function(e){return this._append(e),this._process(),this},finalize:function(e){return e&&this._append(e),this._doFinalize()},blockSize:16,_createHelper:function(e){return function(t,n){return new e.init(n).finalize(t)}},_createHmacHelper:function(e){return function(t,n){return new p.HMAC.init(e,n).finalize(t)}}});var p=t.algo={};return t}(Math);i=(r=(n=p).lib).WordArray,o=r.Hasher,s=[],r=n.algo.SHA1=o.extend({_doReset:function(){this._hash=new i.init([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(e,t){for(var n=this._hash.words,i=n[0],o=n[1],r=n[2],a=n[3],c=n[4],l=0;80>l;l++){if(16>l)s[l]=0|e[t+l];else{var u=s[l-3]^s[l-8]^s[l-14]^s[l-16];s[l]=u<<1|u>>>31}u=(i<<5|i>>>27)+c+s[l],u=20>l?u+(1518500249+(o&r|~o&a)):40>l?u+(1859775393+(o^r^a)):60>l?u+((o&r|o&a|r&a)-1894007588):u+((o^r^a)-899497514),c=a,a=r,r=o<<30|o>>>2,o=i,i=u}n[0]=n[0]+i|0,n[1]=n[1]+o|0,n[2]=n[2]+r|0,n[3]=n[3]+a|0,n[4]=n[4]+c|0},_doFinalize:function(){var e=this._data,t=e.words,n=8*this._nDataBytes,i=8*e.sigBytes;return t[i>>>5]|=128<<24-i%32,t[14+(i+64>>>9<<4)]=Math.floor(n/4294967296),t[15+(i+64>>>9<<4)]=n,e.sigBytes=4*t.length,this._process(),this._hash},clone:function(){var e=o.clone.call(this);return e._hash=this._hash.clone(),e}}),n.SHA1=o._createHelper(r),n.HmacSHA1=o._createHmacHelper(r),u=(l=p).enc.Utf8,l.algo.HMAC=l.lib.Base.extend({init:function(e,t){e=this._hasher=new e.init,"string"==typeof t&&(t=u.parse(t));var n=e.blockSize,i=4*n;t.sigBytes>i&&(t=e.finalize(t)),t.clamp();for(var o=this._oKey=t.clone(),s=this._iKey=t.clone(),r=o.words,a=s.words,c=0;c<n;c++)r[c]^=1549556828,a[c]^=909522486;o.sigBytes=s.sigBytes=i,this.reset()},reset:function(){var e=this._hasher;e.reset(),e.update(this._iKey)},update:function(e){return this._hasher.update(e),this},finalize:function(e){var t=this._hasher;return e=t.finalize(e),t.reset(),t.finalize(this._oKey.clone().concat(e))}}),c=(a=p).lib.WordArray,a.enc.Base64={stringify:function(e){var t=e.words,n=e.sigBytes,i=this._map;e.clamp();for(var o=[],s=0;s<n;s+=3)for(var r=(t[s>>>2]>>>24-s%4*8&255)<<16|(t[s+1>>>2]>>>24-(s+1)%4*8&255)<<8|t[s+2>>>2]>>>24-(s+2)%4*8&255,a=0;a<4&&s+.75*a<n;a++)o.push(i.charAt(r>>>6*(3-a)&63));var c=i.charAt(64);if(c)for(;o.length%4;)o.push(c);return o.join("")},parse:function(e){var t=e.length,n=this._map,i=n.charAt(64);if(i){var o=e.indexOf(i);-1!=o&&(t=o)}for(var s=[],r=0,a=0;a<t;a++)if(a%4){var l=n.indexOf(e.charAt(a-1))<<a%4*2,u=n.indexOf(e.charAt(a))>>>6-a%4*2;s[r>>>2]|=(l|u)<<24-r%4*8,r++}return c.create(s,r)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="},e.exports=p},function(e,t){var n,i,o,s,r,a,c,l,u,p,d,h,f,m,g,v,y,b,x,S=(i=(n=n||{}).Base64,s=function(e){for(var t={},n=0,i=e.length;n<i;n++)t[e.charAt(n)]=n;return t}(o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"),r=String.fromCharCode,a=function(e){if(e.length<2)return(t=e.charCodeAt(0))<128?e:t<2048?r(192|t>>>6)+r(128|63&t):r(224|t>>>12&15)+r(128|t>>>6&63)+r(128|63&t);var t=65536+1024*(e.charCodeAt(0)-55296)+(e.charCodeAt(1)-56320);return r(240|t>>>18&7)+r(128|t>>>12&63)+r(128|t>>>6&63)+r(128|63&t)},c=/[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g,l=function(e){return e.replace(c,a)},u=function(e){var t=[0,2,1][e.length%3],n=e.charCodeAt(0)<<16|(e.length>1?e.charCodeAt(1):0)<<8|(e.length>2?e.charCodeAt(2):0);return[o.charAt(n>>>18),o.charAt(n>>>12&63),t>=2?"=":o.charAt(n>>>6&63),t>=1?"=":o.charAt(63&n)].join("")},p=n.btoa?function(e){return n.btoa(e)}:function(e){return e.replace(/[\s\S]{1,3}/g,u)},d=function(e){return p(l(e))},h=function(e,t){return t?d(String(e)).replace(/[+\/]/g,(function(e){return"+"==e?"-":"_"})).replace(/=/g,""):d(String(e))},f=new RegExp(["[À-ß][€-¿]","[à-ï][€-¿]{2}","[ð-÷][€-¿]{3}"].join("|"),"g"),m=function(e){switch(e.length){case 4:var t=((7&e.charCodeAt(0))<<18|(63&e.charCodeAt(1))<<12|(63&e.charCodeAt(2))<<6|63&e.charCodeAt(3))-65536;return r(55296+(t>>>10))+r(56320+(1023&t));case 3:return r((15&e.charCodeAt(0))<<12|(63&e.charCodeAt(1))<<6|63&e.charCodeAt(2));default:return r((31&e.charCodeAt(0))<<6|63&e.charCodeAt(1))}},g=function(e){return e.replace(f,m)},v=function(e){var t=e.length,n=t%4,i=(t>0?s[e.charAt(0)]<<18:0)|(t>1?s[e.charAt(1)]<<12:0)|(t>2?s[e.charAt(2)]<<6:0)|(t>3?s[e.charAt(3)]:0),o=[r(i>>>16),r(i>>>8&255),r(255&i)];return o.length-=[0,0,2,1][n],o.join("")},y=n.atob?function(e){return n.atob(e)}:function(e){return e.replace(/[\s\S]{1,4}/g,v)},b=function(e){return g(y(e))},{VERSION:"2.1.9",atob:y,btoa:p,fromBase64:x=function(e){return b(String(e).replace(/[-_]/g,(function(e){return"-"==e?"+":"/"})).replace(/[^A-Za-z0-9\+\/]/g,""))},toBase64:h,utob:l,encode:h,encodeURI:function(e){return h(e,!0)},btou:g,decode:x,noConflict:function(){var e=n.Base64;return n.Base64=i,e}});e.exports=S},function(e,t,n){const i=n(4),o=n(16),s=n(23);e.exports={XMLParser:o,XMLValidator:i,XMLBuilder:s}},function(e,t,n){const{buildOptions:i}=n(17),o=n(18),{prettify:s}=n(22),r=n(4);e.exports=class{constructor(e){this.externalEntities={},this.options=i(e)}parse(e,t){if("string"==typeof e);else{if(!e.toString)throw new Error("XML data is accepted in String or Bytes[] form.");e=e.toString()}if(t){!0===t&&(t={});const n=r.validate(e,t);if(!0!==n)throw Error(`${n.err.msg}:${n.err.line}:${n.err.col}`)}const n=new o(this.options);n.addExternalEntities(this.externalEntities);const i=n.parseXml(e);return this.options.preserveOrder||void 0===i?i:s(i,this.options)}addEntity(e,t){if(-1!==t.indexOf("&"))throw new Error("Entity value can't have '&'");if(-1!==e.indexOf("&")||-1!==e.indexOf(";"))throw new Error("An entity must be set without '&' and ';'. Eg. use '#xD' for '&#xD;'");if("&"===t)throw new Error("An entity with value '&' is not permitted");this.externalEntities[e]=t}}},function(e,t){const n={preserveOrder:!1,attributeNamePrefix:"@_",attributesGroupName:!1,textNodeName:"#text",ignoreAttributes:!0,removeNSPrefix:!1,allowBooleanAttributes:!1,parseTagValue:!0,parseAttributeValue:!1,trimValues:!0,cdataPropName:!1,numberParseOptions:{hex:!0,leadingZeros:!0,eNotation:!0},tagValueProcessor:function(e,t){return t},attributeValueProcessor:function(e,t){return t},stopNodes:[],alwaysCreateTextNode:!1,isArray:()=>!1,commentPropName:!1,unpairedTags:[],processEntities:!0,htmlEntities:!1,ignoreDeclaration:!1,ignorePiTags:!1,transformTagName:!1,transformAttributeName:!1,updateTag:function(e,t,n){return e}};t.buildOptions=function(e){return Object.assign({},n,e)},t.defaultOptions=n},function(e,t,n){const i=n(1),o=n(19),s=n(20),r=n(21),a=n(5);function c(e){const t=Object.keys(e);for(let n=0;n<t.length;n++){const i=t[n];this.lastEntities[i]={regex:new RegExp("&"+i+";","g"),val:e[i]}}}function l(e,t,n,i,o,s,r){if(void 0!==e&&(this.options.trimValues&&!i&&(e=e.trim()),e.length>0)){r||(e=this.replaceEntitiesValue(e));const i=this.options.tagValueProcessor(t,e,n,o,s);return null==i?e:typeof i!=typeof e||i!==e?i:this.options.trimValues||e.trim()===e?S(e,this.options.parseTagValue,this.options.numberParseOptions):e}}function u(e){if(this.options.removeNSPrefix){const t=e.split(":"),n="/"===e.charAt(0)?"/":"";if("xmlns"===t[0])return"";2===t.length&&(e=n+t[1])}return e}const p=new RegExp("([^\\s=]+)\\s*(=\\s*(['\"])([\\s\\S]*?)\\3)?","gm");function d(e,t,n){if(!0!==this.options.ignoreAttributes&&"string"==typeof e){const n=i.getAllMatches(e,p),o=n.length,s={};for(let e=0;e<o;e++){const i=this.resolveNameSpace(n[e][1]);if(this.ignoreAttributesFn(i,t))continue;let o=n[e][4],r=this.options.attributeNamePrefix+i;if(i.length)if(this.options.transformAttributeName&&(r=this.options.transformAttributeName(r)),"__proto__"===r&&(r="#__proto__"),void 0!==o){this.options.trimValues&&(o=o.trim()),o=this.replaceEntitiesValue(o);const e=this.options.attributeValueProcessor(i,o,t);s[r]=null==e?o:typeof e!=typeof o||e!==o?e:S(o,this.options.parseAttributeValue,this.options.numberParseOptions)}else this.options.allowBooleanAttributes&&(s[r]=!0)}if(!Object.keys(s).length)return;if(this.options.attributesGroupName){const e={};return e[this.options.attributesGroupName]=s,e}return s}}const h=function(e){const t=new o("!xml");let n=t,i="",r="";for(let a=0;a<e.length;a++)if("<"===e[a])if("/"===e[a+1]){const t=y(e,">",a,"Closing Tag is not closed.");let o=e.substring(a+2,t).trim();if(this.options.removeNSPrefix){const e=o.indexOf(":");-1!==e&&(o=o.substr(e+1))}this.options.transformTagName&&(o=this.options.transformTagName(o)),n&&(i=this.saveTextToParentTag(i,n,r));const s=r.substring(r.lastIndexOf(".")+1);if(o&&-1!==this.options.unpairedTags.indexOf(o))throw new Error(`Unpaired tag can not be used as closing tag: </${o}>`);let c=0;s&&-1!==this.options.unpairedTags.indexOf(s)?(c=r.lastIndexOf(".",r.lastIndexOf(".")-1),this.tagsNodeStack.pop()):c=r.lastIndexOf("."),r=r.substring(0,c),n=this.tagsNodeStack.pop(),i="",a=t}else if("?"===e[a+1]){let t=b(e,a,!1,"?>");if(!t)throw new Error("Pi Tag is not closed.");if(i=this.saveTextToParentTag(i,n,r),this.options.ignoreDeclaration&&"?xml"===t.tagName||this.options.ignorePiTags);else{const e=new o(t.tagName);e.add(this.options.textNodeName,""),t.tagName!==t.tagExp&&t.attrExpPresent&&(e[":@"]=this.buildAttributesMap(t.tagExp,r,t.tagName)),this.addChild(n,e,r)}a=t.closeIndex+1}else if("!--"===e.substr(a+1,3)){const t=y(e,"--\x3e",a+4,"Comment is not closed.");if(this.options.commentPropName){const o=e.substring(a+4,t-2);i=this.saveTextToParentTag(i,n,r),n.add(this.options.commentPropName,[{[this.options.textNodeName]:o}])}a=t}else if("!D"===e.substr(a+1,2)){const t=s(e,a);this.docTypeEntities=t.entities,a=t.i}else if("!["===e.substr(a+1,2)){const t=y(e,"]]>",a,"CDATA is not closed.")-2,o=e.substring(a+9,t);i=this.saveTextToParentTag(i,n,r);let s=this.parseTextData(o,n.tagname,r,!0,!1,!0,!0);null==s&&(s=""),this.options.cdataPropName?n.add(this.options.cdataPropName,[{[this.options.textNodeName]:o}]):n.add(this.options.textNodeName,s),a=t+2}else{let s=b(e,a,this.options.removeNSPrefix),c=s.tagName;const l=s.rawTagName;let u=s.tagExp,p=s.attrExpPresent,d=s.closeIndex;this.options.transformTagName&&(c=this.options.transformTagName(c)),n&&i&&"!xml"!==n.tagname&&(i=this.saveTextToParentTag(i,n,r,!1));const h=n;if(h&&-1!==this.options.unpairedTags.indexOf(h.tagname)&&(n=this.tagsNodeStack.pop(),r=r.substring(0,r.lastIndexOf("."))),c!==t.tagname&&(r+=r?"."+c:c),this.isItStopNode(this.options.stopNodes,r,c)){let t="";if(u.length>0&&u.lastIndexOf("/")===u.length-1)"/"===c[c.length-1]?(c=c.substr(0,c.length-1),r=r.substr(0,r.length-1),u=c):u=u.substr(0,u.length-1),a=s.closeIndex;else if(-1!==this.options.unpairedTags.indexOf(c))a=s.closeIndex;else{const n=this.readStopNodeData(e,l,d+1);if(!n)throw new Error(`Unexpected end of ${l}`);a=n.i,t=n.tagContent}const i=new o(c);c!==u&&p&&(i[":@"]=this.buildAttributesMap(u,r,c)),t&&(t=this.parseTextData(t,c,r,!0,p,!0,!0)),r=r.substr(0,r.lastIndexOf(".")),i.add(this.options.textNodeName,t),this.addChild(n,i,r)}else{if(u.length>0&&u.lastIndexOf("/")===u.length-1){"/"===c[c.length-1]?(c=c.substr(0,c.length-1),r=r.substr(0,r.length-1),u=c):u=u.substr(0,u.length-1),this.options.transformTagName&&(c=this.options.transformTagName(c));const e=new o(c);c!==u&&p&&(e[":@"]=this.buildAttributesMap(u,r,c)),this.addChild(n,e,r),r=r.substr(0,r.lastIndexOf("."))}else{const e=new o(c);this.tagsNodeStack.push(n),c!==u&&p&&(e[":@"]=this.buildAttributesMap(u,r,c)),this.addChild(n,e,r),n=e}i="",a=d}}else i+=e[a];return t.child};function f(e,t,n){const i=this.options.updateTag(t.tagname,n,t[":@"]);!1===i||("string"==typeof i?(t.tagname=i,e.addChild(t)):e.addChild(t))}const m=function(e){if(this.options.processEntities){for(let t in this.docTypeEntities){const n=this.docTypeEntities[t];e=e.replace(n.regx,n.val)}for(let t in this.lastEntities){const n=this.lastEntities[t];e=e.replace(n.regex,n.val)}if(this.options.htmlEntities)for(let t in this.htmlEntities){const n=this.htmlEntities[t];e=e.replace(n.regex,n.val)}e=e.replace(this.ampEntity.regex,this.ampEntity.val)}return e};function g(e,t,n,i){return e&&(void 0===i&&(i=0===Object.keys(t.child).length),void 0!==(e=this.parseTextData(e,t.tagname,n,!1,!!t[":@"]&&0!==Object.keys(t[":@"]).length,i))&&""!==e&&t.add(this.options.textNodeName,e),e=""),e}function v(e,t,n){const i="*."+n;for(const o in e){const n=e[o];if(i===n||t===n)return!0}return!1}function y(e,t,n,i){const o=e.indexOf(t,n);if(-1===o)throw new Error(i);return o+t.length-1}function b(e,t,n,i=">"){const o=function(e,t,n=">"){let i,o="";for(let s=t;s<e.length;s++){let t=e[s];if(i)t===i&&(i="");else if('"'===t||"'"===t)i=t;else if(t===n[0]){if(!n[1])return{data:o,index:s};if(e[s+1]===n[1])return{data:o,index:s}}else"\t"===t&&(t=" ");o+=t}}(e,t+1,i);if(!o)return;let s=o.data;const r=o.index,a=s.search(/\s/);let c=s,l=!0;-1!==a&&(c=s.substring(0,a),s=s.substring(a+1).trimStart());const u=c;if(n){const e=c.indexOf(":");-1!==e&&(c=c.substr(e+1),l=c!==o.data.substr(e+1))}return{tagName:c,tagExp:s,closeIndex:r,attrExpPresent:l,rawTagName:u}}function x(e,t,n){const i=n;let o=1;for(;n<e.length;n++)if("<"===e[n])if("/"===e[n+1]){const s=y(e,">",n,`${t} is not closed`);if(e.substring(n+2,s).trim()===t&&(o--,0===o))return{tagContent:e.substring(i,n),i:s};n=s}else if("?"===e[n+1])n=y(e,"?>",n+1,"StopNode is not closed.");else if("!--"===e.substr(n+1,3))n=y(e,"--\x3e",n+3,"StopNode is not closed.");else if("!["===e.substr(n+1,2))n=y(e,"]]>",n,"StopNode is not closed.")-2;else{const i=b(e,n,">");i&&((i&&i.tagName)===t&&"/"!==i.tagExp[i.tagExp.length-1]&&o++,n=i.closeIndex)}}function S(e,t,n){if(t&&"string"==typeof e){const t=e.trim();return"true"===t||"false"!==t&&r(e,n)}return i.isExist(e)?e:""}e.exports=class{constructor(e){this.options=e,this.currentNode=null,this.tagsNodeStack=[],this.docTypeEntities={},this.lastEntities={apos:{regex:/&(apos|#39|#x27);/g,val:"'"},gt:{regex:/&(gt|#62|#x3E);/g,val:">"},lt:{regex:/&(lt|#60|#x3C);/g,val:"<"},quot:{regex:/&(quot|#34|#x22);/g,val:'"'}},this.ampEntity={regex:/&(amp|#38|#x26);/g,val:"&"},this.htmlEntities={space:{regex:/&(nbsp|#160);/g,val:" "},cent:{regex:/&(cent|#162);/g,val:"¢"},pound:{regex:/&(pound|#163);/g,val:"£"},yen:{regex:/&(yen|#165);/g,val:"¥"},euro:{regex:/&(euro|#8364);/g,val:"€"},copyright:{regex:/&(copy|#169);/g,val:"©"},reg:{regex:/&(reg|#174);/g,val:"®"},inr:{regex:/&(inr|#8377);/g,val:"₹"},num_dec:{regex:/&#([0-9]{1,7});/g,val:(e,t)=>String.fromCharCode(Number.parseInt(t,10))},num_hex:{regex:/&#x([0-9a-fA-F]{1,6});/g,val:(e,t)=>String.fromCharCode(Number.parseInt(t,16))}},this.addExternalEntities=c,this.parseXml=h,this.parseTextData=l,this.resolveNameSpace=u,this.buildAttributesMap=d,this.isItStopNode=v,this.replaceEntitiesValue=m,this.readStopNodeData=x,this.saveTextToParentTag=g,this.addChild=f,this.ignoreAttributesFn=a(this.options.ignoreAttributes)}}},function(e,t,n){e.exports=class{constructor(e){this.tagname=e,this.child=[],this[":@"]={}}add(e,t){"__proto__"===e&&(e="#__proto__"),this.child.push({[e]:t})}addChild(e){"__proto__"===e.tagname&&(e.tagname="#__proto__"),e[":@"]&&Object.keys(e[":@"]).length>0?this.child.push({[e.tagname]:e.child,":@":e[":@"]}):this.child.push({[e.tagname]:e.child})}}},function(e,t,n){const i=n(1);function o(e,t){let n="";for(;t<e.length&&"'"!==e[t]&&'"'!==e[t];t++)n+=e[t];if(n=n.trim(),-1!==n.indexOf(" "))throw new Error("External entites are not supported");const i=e[t++];let o="";for(;t<e.length&&e[t]!==i;t++)o+=e[t];return[n,o,t]}function s(e,t){return"!"===e[t+1]&&"-"===e[t+2]&&"-"===e[t+3]}function r(e,t){return"!"===e[t+1]&&"E"===e[t+2]&&"N"===e[t+3]&&"T"===e[t+4]&&"I"===e[t+5]&&"T"===e[t+6]&&"Y"===e[t+7]}function a(e,t){return"!"===e[t+1]&&"E"===e[t+2]&&"L"===e[t+3]&&"E"===e[t+4]&&"M"===e[t+5]&&"E"===e[t+6]&&"N"===e[t+7]&&"T"===e[t+8]}function c(e,t){return"!"===e[t+1]&&"A"===e[t+2]&&"T"===e[t+3]&&"T"===e[t+4]&&"L"===e[t+5]&&"I"===e[t+6]&&"S"===e[t+7]&&"T"===e[t+8]}function l(e,t){return"!"===e[t+1]&&"N"===e[t+2]&&"O"===e[t+3]&&"T"===e[t+4]&&"A"===e[t+5]&&"T"===e[t+6]&&"I"===e[t+7]&&"O"===e[t+8]&&"N"===e[t+9]}function u(e){if(i.isName(e))return e;throw new Error(`Invalid entity name ${e}`)}e.exports=function(e,t){const n={};if("O"!==e[t+3]||"C"!==e[t+4]||"T"!==e[t+5]||"Y"!==e[t+6]||"P"!==e[t+7]||"E"!==e[t+8])throw new Error("Invalid Tag instead of DOCTYPE");{t+=9;let i=1,p=!1,d=!1,h="";for(;t<e.length;t++)if("<"!==e[t]||d)if(">"===e[t]){if(d?"-"===e[t-1]&&"-"===e[t-2]&&(d=!1,i--):i--,0===i)break}else"["===e[t]?p=!0:h+=e[t];else{if(p&&r(e,t))t+=7,[entityName,val,t]=o(e,t+1),-1===val.indexOf("&")&&(n[u(entityName)]={regx:RegExp(`&${entityName};`,"g"),val:val});else if(p&&a(e,t))t+=8;else if(p&&c(e,t))t+=8;else if(p&&l(e,t))t+=9;else{if(!s)throw new Error("Invalid DOCTYPE");d=!0}i++,h=""}if(0!==i)throw new Error("Unclosed DOCTYPE")}return{entities:n,i:t}}},function(e,t){const n=/^[-+]?0x[a-fA-F0-9]+$/,i=/^([\-\+])?(0*)(\.[0-9]+([eE]\-?[0-9]+)?|[0-9]+(\.[0-9]+([eE]\-?[0-9]+)?)?)$/;!Number.parseInt&&window.parseInt&&(Number.parseInt=window.parseInt),!Number.parseFloat&&window.parseFloat&&(Number.parseFloat=window.parseFloat);const o={hex:!0,leadingZeros:!0,decimalPoint:".",eNotation:!0};e.exports=function(e,t={}){if(t=Object.assign({},o,t),!e||"string"!=typeof e)return e;let s=e.trim();if(void 0!==t.skipLike&&t.skipLike.test(s))return e;if(t.hex&&n.test(s))return Number.parseInt(s,16);{const n=i.exec(s);if(n){const i=n[1],o=n[2];let a=(r=n[3])&&-1!==r.indexOf(".")?("."===(r=r.replace(/0+$/,""))?r="0":"."===r[0]?r="0"+r:"."===r[r.length-1]&&(r=r.substr(0,r.length-1)),r):r;const c=n[4]||n[6];if(!t.leadingZeros&&o.length>0&&i&&"."!==s[2])return e;if(!t.leadingZeros&&o.length>0&&!i&&"."!==s[1])return e;{const n=Number(s),r=""+n;return-1!==r.search(/[eE]/)||c?t.eNotation?n:e:-1!==s.indexOf(".")?"0"===r&&""===a||r===a||i&&r==="-"+a?n:e:o?a===r||i+a===r?n:e:s===r||s===i+r?n:e}}return e}var r}},function(e,t,n){function i(e,t,n){let a;const c={};for(let l=0;l<e.length;l++){const u=e[l],p=o(u);let d="";if(d=void 0===n?p:n+"."+p,p===t.textNodeName)void 0===a?a=u[p]:a+=""+u[p];else{if(void 0===p)continue;if(u[p]){let e=i(u[p],t,d);const n=r(e,t);u[":@"]?s(e,u[":@"],d,t):1!==Object.keys(e).length||void 0===e[t.textNodeName]||t.alwaysCreateTextNode?0===Object.keys(e).length&&(t.alwaysCreateTextNode?e[t.textNodeName]="":e=""):e=e[t.textNodeName],void 0!==c[p]&&c.hasOwnProperty(p)?(Array.isArray(c[p])||(c[p]=[c[p]]),c[p].push(e)):t.isArray(p,d,n)?c[p]=[e]:c[p]=e}}}return"string"==typeof a?a.length>0&&(c[t.textNodeName]=a):void 0!==a&&(c[t.textNodeName]=a),c}function o(e){const t=Object.keys(e);for(let n=0;n<t.length;n++){const e=t[n];if(":@"!==e)return e}}function s(e,t,n,i){if(t){const o=Object.keys(t),s=o.length;for(let r=0;r<s;r++){const s=o[r];i.isArray(s,n+"."+s,!0,!0)?e[s]=[t[s]]:e[s]=t[s]}}}function r(e,t){const{textNodeName:n}=t,i=Object.keys(e).length;return 0===i||!(1!==i||!e[n]&&"boolean"!=typeof e[n]&&0!==e[n])}t.prettify=function(e,t){return i(e,t)}},function(e,t,n){const i=n(24),o=n(5),s={attributeNamePrefix:"@_",attributesGroupName:!1,textNodeName:"#text",ignoreAttributes:!0,cdataPropName:!1,format:!1,indentBy:" ",suppressEmptyNode:!1,suppressUnpairedNode:!0,suppressBooleanAttributes:!0,tagValueProcessor:function(e,t){return t},attributeValueProcessor:function(e,t){return t},preserveOrder:!1,commentPropName:!1,unpairedTags:[],entities:[{regex:new RegExp("&","g"),val:"&amp;"},{regex:new RegExp(">","g"),val:"&gt;"},{regex:new RegExp("<","g"),val:"&lt;"},{regex:new RegExp("'","g"),val:"&apos;"},{regex:new RegExp('"',"g"),val:"&quot;"}],processEntities:!0,stopNodes:[],oneListGroup:!1};function r(e){this.options=Object.assign({},s,e),!0===this.options.ignoreAttributes||this.options.attributesGroupName?this.isAttribute=function(){return!1}:(this.ignoreAttributesFn=o(this.options.ignoreAttributes),this.attrPrefixLen=this.options.attributeNamePrefix.length,this.isAttribute=l),this.processTextOrObjNode=a,this.options.format?(this.indentate=c,this.tagEndChar=">\n",this.newLine="\n"):(this.indentate=function(){return""},this.tagEndChar=">",this.newLine="")}function a(e,t,n,i){const o=this.j2x(e,n+1,i.concat(t));return void 0!==e[this.options.textNodeName]&&1===Object.keys(e).length?this.buildTextValNode(e[this.options.textNodeName],t,o.attrStr,n):this.buildObjectNode(o.val,t,o.attrStr,n)}function c(e){return this.options.indentBy.repeat(e)}function l(e){return!(!e.startsWith(this.options.attributeNamePrefix)||e===this.options.textNodeName)&&e.substr(this.attrPrefixLen)}r.prototype.build=function(e){return this.options.preserveOrder?i(e,this.options):(Array.isArray(e)&&this.options.arrayNodeName&&this.options.arrayNodeName.length>1&&(e={[this.options.arrayNodeName]:e}),this.j2x(e,0,[]).val)},r.prototype.j2x=function(e,t,n){let i="",o="";const s=n.join(".");for(let r in e)if(Object.prototype.hasOwnProperty.call(e,r))if(void 0===e[r])this.isAttribute(r)&&(o+="");else if(null===e[r])this.isAttribute(r)?o+="":"?"===r[0]?o+=this.indentate(t)+"<"+r+"?"+this.tagEndChar:o+=this.indentate(t)+"<"+r+"/"+this.tagEndChar;else if(e[r]instanceof Date)o+=this.buildTextValNode(e[r],r,"",t);else if("object"!=typeof e[r]){const n=this.isAttribute(r);if(n&&!this.ignoreAttributesFn(n,s))i+=this.buildAttrPairStr(n,""+e[r]);else if(!n)if(r===this.options.textNodeName){let t=this.options.tagValueProcessor(r,""+e[r]);o+=this.replaceEntitiesValue(t)}else o+=this.buildTextValNode(e[r],r,"",t)}else if(Array.isArray(e[r])){const i=e[r].length;let s="",a="";for(let c=0;c<i;c++){const i=e[r][c];if(void 0===i);else if(null===i)"?"===r[0]?o+=this.indentate(t)+"<"+r+"?"+this.tagEndChar:o+=this.indentate(t)+"<"+r+"/"+this.tagEndChar;else if("object"==typeof i)if(this.options.oneListGroup){const e=this.j2x(i,t+1,n.concat(r));s+=e.val,this.options.attributesGroupName&&i.hasOwnProperty(this.options.attributesGroupName)&&(a+=e.attrStr)}else s+=this.processTextOrObjNode(i,r,t,n);else if(this.options.oneListGroup){let e=this.options.tagValueProcessor(r,i);e=this.replaceEntitiesValue(e),s+=e}else s+=this.buildTextValNode(i,r,"",t)}this.options.oneListGroup&&(s=this.buildObjectNode(s,r,a,t)),o+=s}else if(this.options.attributesGroupName&&r===this.options.attributesGroupName){const t=Object.keys(e[r]),n=t.length;for(let o=0;o<n;o++)i+=this.buildAttrPairStr(t[o],""+e[r][t[o]])}else o+=this.processTextOrObjNode(e[r],r,t,n);return{attrStr:i,val:o}},r.prototype.buildAttrPairStr=function(e,t){return t=this.options.attributeValueProcessor(e,""+t),t=this.replaceEntitiesValue(t),this.options.suppressBooleanAttributes&&"true"===t?" "+e:" "+e+'="'+t+'"'},r.prototype.buildObjectNode=function(e,t,n,i){if(""===e)return"?"===t[0]?this.indentate(i)+"<"+t+n+"?"+this.tagEndChar:this.indentate(i)+"<"+t+n+this.closeTag(t)+this.tagEndChar;{let o="</"+t+this.tagEndChar,s="";return"?"===t[0]&&(s="?",o=""),!n&&""!==n||-1!==e.indexOf("<")?!1!==this.options.commentPropName&&t===this.options.commentPropName&&0===s.length?this.indentate(i)+`\x3c!--${e}--\x3e`+this.newLine:this.indentate(i)+"<"+t+n+s+this.tagEndChar+e+this.indentate(i)+o:this.indentate(i)+"<"+t+n+s+">"+e+o}},r.prototype.closeTag=function(e){let t="";return-1!==this.options.unpairedTags.indexOf(e)?this.options.suppressUnpairedNode||(t="/"):t=this.options.suppressEmptyNode?"/":`></${e}`,t},r.prototype.buildTextValNode=function(e,t,n,i){if(!1!==this.options.cdataPropName&&t===this.options.cdataPropName)return this.indentate(i)+`<![CDATA[${e}]]>`+this.newLine;if(!1!==this.options.commentPropName&&t===this.options.commentPropName)return this.indentate(i)+`\x3c!--${e}--\x3e`+this.newLine;if("?"===t[0])return this.indentate(i)+"<"+t+n+"?"+this.tagEndChar;{let o=this.options.tagValueProcessor(t,e);return o=this.replaceEntitiesValue(o),""===o?this.indentate(i)+"<"+t+n+this.closeTag(t)+this.tagEndChar:this.indentate(i)+"<"+t+n+">"+o+"</"+t+this.tagEndChar}},r.prototype.replaceEntitiesValue=function(e){if(e&&e.length>0&&this.options.processEntities)for(let t=0;t<this.options.entities.length;t++){const n=this.options.entities[t];e=e.replace(n.regex,n.val)}return e},e.exports=r},function(e,t){function n(e,t,a,c){let l="",u=!1;for(let p=0;p<e.length;p++){const d=e[p],h=i(d);if(void 0===h)continue;let f="";if(f=0===a.length?h:`${a}.${h}`,h===t.textNodeName){let e=d[h];s(f,t)||(e=t.tagValueProcessor(h,e),e=r(e,t)),u&&(l+=c),l+=e,u=!1;continue}if(h===t.cdataPropName){u&&(l+=c),l+=`<![CDATA[${d[h][0][t.textNodeName]}]]>`,u=!1;continue}if(h===t.commentPropName){l+=c+`\x3c!--${d[h][0][t.textNodeName]}--\x3e`,u=!0;continue}if("?"===h[0]){const e=o(d[":@"],t),n="?xml"===h?"":c;let i=d[h][0][t.textNodeName];i=0!==i.length?" "+i:"",l+=n+`<${h}${i}${e}?>`,u=!0;continue}let m=c;""!==m&&(m+=t.indentBy);const g=c+`<${h}${o(d[":@"],t)}`,v=n(d[h],t,f,m);-1!==t.unpairedTags.indexOf(h)?t.suppressUnpairedNode?l+=g+">":l+=g+"/>":v&&0!==v.length||!t.suppressEmptyNode?v&&v.endsWith(">")?l+=g+`>${v}${c}</${h}>`:(l+=g+">",v&&""!==c&&(v.includes("/>")||v.includes("</"))?l+=c+t.indentBy+v+c:l+=v,l+=`</${h}>`):l+=g+"/>",u=!0}return l}function i(e){const t=Object.keys(e);for(let n=0;n<t.length;n++){const i=t[n];if(e.hasOwnProperty(i)&&":@"!==i)return i}}function o(e,t){let n="";if(e&&!t.ignoreAttributes)for(let i in e){if(!e.hasOwnProperty(i))continue;let o=t.attributeValueProcessor(i,e[i]);o=r(o,t),!0===o&&t.suppressBooleanAttributes?n+=` ${i.substr(t.attributeNamePrefix.length)}`:n+=` ${i.substr(t.attributeNamePrefix.length)}="${o}"`}return n}function s(e,t){let n=(e=e.substr(0,e.length-t.textNodeName.length-1)).substr(e.lastIndexOf(".")+1);for(let i in t.stopNodes)if(t.stopNodes[i]===e||t.stopNodes[i]==="*."+n)return!0;return!1}function r(e,t){if(e&&e.length>0&&t.processEntities)for(let n=0;n<t.entities.length;n++){const i=t.entities[n];e=e.replace(i.regex,i.val)}return e}e.exports=function(e,t){let i="";return t.format&&t.indentBy.length>0&&(i="\n"),n(e,t,"",i)}},function(e,t,n){var i=n(7),o=n(0),s={};e.exports.transferToTaskMethod=function(e,t){s[t]=e[t],e[t]=function(e,n){e.SkipTask?s[t].call(this,e,n):this._addTask(t,e,n)}},e.exports.init=function(e){var t,n,r=[],a={},c=0,l=0,u=function(e){var t={id:e.id,Bucket:e.Bucket,Region:e.Region,Key:e.Key,FilePath:e.FilePath,state:e.state,loaded:e.loaded,size:e.size,speed:e.speed,percent:e.percent,hashPercent:e.hashPercent,error:e.error};return e.FilePath&&(t.FilePath=e.FilePath),t},p=(n=function(){t=0,e.emit("task-list-update",{list:o.map(r,u)}),e.emit("list-update",{list:o.map(r,u)})},function(){t||(t=setTimeout(n))}),d=function(){if(!(r.length<=e.options.UploadQueueSize)){for(var t=0;t<l&&t<r.length&&r.length>e.options.UploadQueueSize;){var n="waiting"===r[t].state||"checking"===r[t].state||"uploading"===r[t].state;r[t]&&n?t++:(a[r[t].id]&&delete a[r[t].id],r.splice(t,1),l--)}p()}},h=function t(){if(!(c>=e.options.FileParallelLimit)){for(;r[l]&&"waiting"!==r[l].state;)l++;if(!(l>=r.length)){var n=r[l];l++,c++,n.state="checking",n.params.onTaskStart&&n.params.onTaskStart(u(n)),!n.params.UploadData&&(n.params.UploadData={});var i=o.formatParams(n.api,n.params);s[n.api].call(e,i,(function(i,o){e._isRunningTask(n.id)&&("checking"!==n.state&&"uploading"!==n.state||(n.state=i?"error":"success",i&&(n.error=i),c--,p(),t(),n.callback&&n.callback(i,o),"success"===n.state&&(n.params&&(delete n.params.UploadData,delete n.params.Body,delete n.params),delete n.callback)),d())})),p(),setTimeout(t)}}},f=function(t,n){var o=a[t];if(o){var s=o&&"waiting"===o.state,r=o&&("checking"===o.state||"uploading"===o.state);if("canceled"===n&&"canceled"!==o.state||"paused"===n&&s||"paused"===n&&r){if("paused"===n&&o.params.Body&&"function"==typeof o.params.Body.pipe)return;o.state=n,e.emit("inner-kill-task",{TaskId:t,toState:n});try{var l=o&&o.params&&o.params.UploadData.UploadId}catch(u){}"canceled"===n&&l&&i.removeUsing(l),p(),r&&(c--,h()),"canceled"===n&&(o.params&&(delete o.params.UploadData,delete o.params.Body,delete o.params),delete o.callback)}d()}};e._addTasks=function(t){o.each(t,(function(t){e._addTask(t.api,t.params,t.callback,!0)})),p()},e._addTask=function(t,n,i,s){var c="postObject"===e.options.SimpleUploadMethod?"postObject":"putObject";"sliceUploadFile"!==t||o.canFileSlice()||(t=c),n=o.formatParams(t,n);var l=o.uuid();n.TaskId=l,n.onTaskReady&&n.onTaskReady(l);var u={params:n,callback:i,api:t,index:r.length,id:l,Bucket:n.Bucket,Region:n.Region,Key:n.Key,FilePath:n.FilePath||"",state:"waiting",loaded:0,size:0,speed:0,percent:0,hashPercent:0,error:null},f=n.onHashProgress;n.onHashProgress=function(t){e._isRunningTask(u.id)&&(u.hashPercent=t.percent,f&&f(t),p())};var m=n.onProgress;return n.onProgress=function(t){e._isRunningTask(u.id)&&("checking"===u.state&&(u.state="uploading"),u.loaded=t.loaded,u.size=t.total,u.speed=t.speed,u.percent=t.percent,m&&m(t),p())},o.getFileSize(t,n,(function(e,t){e?i(e):(a[l]=u,r.push(u),u.size=t,!s&&p(),h(),d())})),l},e._isRunningTask=function(e){var t=a[e];return!(!t||"checking"!==t.state&&"uploading"!==t.state)},e.getTaskList=function(){return o.map(r,u)},e.cancelTask=function(e){f(e,"canceled")},e.pauseTask=function(e){f(e,"paused")},e.restartTask=function(e){var t=a[e];!t||"paused"!==t.state&&"error"!==t.state||(t.state="waiting",p(),l=Math.min(l,t.index),h())},e.isUploadRunning=function(){return c||l<r.length}}},function(e,t,n){var i=n(27),o=n(0),s=n(28);function r(e){var t={GrantFullControl:[],GrantWrite:[],GrantRead:[],GrantReadAcp:[],GrantWriteAcp:[],ACL:""},n={FULL_CONTROL:"GrantFullControl",WRITE:"GrantWrite",READ:"GrantRead",READ_ACP:"GrantReadAcp",WRITE_ACP:"GrantWriteAcp"},i=(e&&e.AccessControlList||{}).Grant;i&&(i=o.isArray(i)?i:[i]);var s={READ:0,WRITE:0,FULL_CONTROL:0};return i&&i.length&&o.each(i,(function(i){"qcs::cam::anyone:anyone"===i.Grantee.ID||"http://cam.qcloud.com/groups/global/AllUsers"===i.Grantee.URI?s[i.Permission]=1:i.Grantee.ID!==e.Owner.ID&&t[n[i.Permission]].push('id="'+i.Grantee.ID+'"')})),s.FULL_CONTROL||s.WRITE&&s.READ?t.ACL="public-read-write":s.READ?t.ACL="public-read":t.ACL="private",o.each(n,(function(e){t[e]=a(t[e].join(","))})),t}function a(e){var t,n,i=e.split(","),o={};for(t=0;t<i.length;)o[n=i[t].trim()]?i.splice(t,1):(o[n]=!0,i[t]=n,t++);return i.join(",")}function c(e){var t=e.bucket,n=t.substr(0,t.lastIndexOf("-")),i=t.substr(t.lastIndexOf("-")+1),s=e.domain,r=e.region,a=e.object;s||(s=["cn-south","cn-south-2","cn-north","cn-east","cn-southwest","sg"].indexOf(r)>-1?"{Region}.myqcloud.com":"cos.{Region}.myqcloud.com",e.ForcePathStyle||(s="{Bucket}."+s)),s=(s=s.replace(/\{\{AppId\}\}/gi,i).replace(/\{\{Bucket\}\}/gi,n).replace(/\{\{Region\}\}/gi,r).replace(/\{\{.*?\}\}/gi,"")).replace(/\{AppId\}/gi,i).replace(/\{BucketName\}/gi,n).replace(/\{Bucket\}/gi,t).replace(/\{Region\}/gi,r).replace(/\{.*?\}/gi,""),/^[a-zA-Z]+:\/\//.test(s)||(s="https://"+s),"/"===s.slice(-1)&&(s=s.slice(0,-1));var c=s;return e.ForcePathStyle&&(c+="/"+t),c+="/",a&&(c+=o.camSafeUrlEncode(a).replace(/%2F/g,"/")),e.isLocation&&(c=c.replace(/^https?:\/\//,"")),c}var l=function(e){if(!e.Bucket||!e.Region)return"";var t=void 0===e.UseAccelerate?this.options.UseAccelerate:e.UseAccelerate;return(e.Url||c({ForcePathStyle:this.options.ForcePathStyle,protocol:this.options.Protocol,domain:this.options.Domain,bucket:e.Bucket,region:t?"accelerate":e.Region})).replace(/^https?:\/\/([^/]+)(\/.*)?$/,"$1")};function u(e,t){var n=o.clone(e.Headers),i="";o.each(n,(function(e,t){(""===e||["content-type","cache-control"].indexOf(t.toLowerCase())>-1)&&delete n[t],"host"===t.toLowerCase()&&(i=e)}));var s=!1!==e.ForceSignHost;!i&&e.SignHost&&s&&(n.Host=e.SignHost);var r=!1,a=function(e,n){r||(r=!0,n&&n.XCosSecurityToken&&!n.SecurityToken&&((n=o.clone(n)).SecurityToken=n.XCosSecurityToken,delete n.XCosSecurityToken),t&&t(e,n))},c=this,l=e.Bucket||"",u=e.Region||"",p="name/cos:PostObject"!==e.Action&&e.Key?e.Key:"";c.options.ForcePathStyle&&l&&(p=l+"/"+p);var d="/"+p,h={},f=e.Scope;if(!f){var m=e.Action||"",g=e.ResourceKey||e.Key||"";f=e.Scope||[{action:m,bucket:l,region:u,prefix:g}]}var v=o.md5(JSON.stringify(f));c._StsCache=c._StsCache||[],function(){var e,t;for(e=c._StsCache.length-1;e>=0;e--){t=c._StsCache[e];var n=Math.round(o.getSkewTime(c.options.SystemClockOffset)/1e3)+30;if(t.StartTime&&n<t.StartTime||n>=t.ExpiredTime)c._StsCache.splice(e,1);else if(!t.ScopeLimit||t.ScopeLimit&&t.ScopeKey===v){h=t;break}}}();var y=function(){var t="";h.StartTime&&e.Expires?t=h.StartTime+";"+(h.StartTime+1*e.Expires):h.StartTime&&h.ExpiredTime&&(t=h.StartTime+";"+h.ExpiredTime);var i={Authorization:o.getAuth({SecretId:h.TmpSecretId,SecretKey:h.TmpSecretKey,Method:e.Method,Pathname:d,Query:e.Query,Headers:n,Expires:e.Expires,SystemClockOffset:c.options.SystemClockOffset,KeyTime:t,ForceSignHost:s}),SecurityToken:h.SecurityToken||h.XCosSecurityToken||"",Token:h.Token||"",ClientIP:h.ClientIP||"",ClientUA:h.ClientUA||"",SignFrom:"client"};a(null,i)},b=function(e){if(e.Authorization){var t=!1,n=e.Authorization;if(n)if(n.indexOf(" ")>-1)t=!1;else if(n.indexOf("q-sign-algorithm=")>-1&&n.indexOf("q-ak=")>-1&&n.indexOf("q-sign-time=")>-1&&n.indexOf("q-key-time=")>-1&&n.indexOf("q-url-param-list=")>-1)t=!0;else try{(n=atob(n)).indexOf("a=")>-1&&n.indexOf("k=")>-1&&n.indexOf("t=")>-1&&n.indexOf("r=")>-1&&n.indexOf("b=")>-1&&(t=!0)}catch(i){}if(!t)return o.error(new Error("getAuthorization callback params format error"))}else{if(!e.TmpSecretId)return o.error(new Error('getAuthorization callback params missing "TmpSecretId"'));if(!e.TmpSecretKey)return o.error(new Error('getAuthorization callback params missing "TmpSecretKey"'));if(!e.SecurityToken&&!e.XCosSecurityToken)return o.error(new Error('getAuthorization callback params missing "SecurityToken"'));if(!e.ExpiredTime)return o.error(new Error('getAuthorization callback params missing "ExpiredTime"'));if(e.ExpiredTime&&10!==e.ExpiredTime.toString().length)return o.error(new Error('getAuthorization callback params "ExpiredTime" should be 10 digits'));if(e.StartTime&&10!==e.StartTime.toString().length)return o.error(new Error('getAuthorization callback params "StartTime" should be 10 StartTime'))}return!1};if(h.ExpiredTime&&h.ExpiredTime-o.getSkewTime(c.options.SystemClockOffset)/1e3>60)y();else if(c.options.getAuthorization)c.options.getAuthorization.call(c,{Bucket:l,Region:u,Method:e.Method,Key:p,Pathname:d,Query:e.Query,Headers:n,Scope:f,SystemClockOffset:c.options.SystemClockOffset,ForceSignHost:s},(function(e){"string"==typeof e&&(e={Authorization:e});var t=b(e);if(t)return a(t);e.Authorization?a(null,e):((h=e||{}).Scope=f,h.ScopeKey=v,c._StsCache.push(h),y())}));else{if(!c.options.getSTS)return function(){var t="";if(c.options.StartTime&&e.Expires){if(10!==c.options.StartTime.toString().length)return a(o.error(new Error('params "StartTime" should be 10 digits')));t=c.options.StartTime+";"+(c.options.StartTime+1*e.Expires)}else if(c.options.StartTime&&c.options.ExpiredTime){if(10!==c.options.StartTime.toString().length)return a(o.error(new Error('params "StartTime" should be 10 digits')));if(10!==c.options.ExpiredTime.toString().length)return a(o.error(new Error('params "ExpiredTime" should be 10 digits')));t=c.options.StartTime+";"+1*c.options.ExpiredTime}var i={Authorization:o.getAuth({SecretId:e.SecretId||c.options.SecretId,SecretKey:e.SecretKey||c.options.SecretKey,Method:e.Method,Pathname:d,Query:e.Query,Headers:n,Expires:e.Expires,KeyTime:t,SystemClockOffset:c.options.SystemClockOffset,ForceSignHost:s}),SecurityToken:c.options.SecurityToken||c.options.XCosSecurityToken,SignFrom:"client"};return a(null,i),i}();c.options.getSTS.call(c,{Bucket:l,Region:u},(function(e){(h=e||{}).Scope=f,h.ScopeKey=v,h.TmpSecretId||(h.TmpSecretId=h.SecretId),h.TmpSecretKey||(h.TmpSecretKey=h.SecretKey);var t=b(h);if(t)return a(t);c._StsCache.push(h),y()}))}return""}function p(e){var t=this,n=!1,i=!1,s=!1,r=e.headers&&(e.headers.date||e.headers.Date)||e.error&&e.error.ServerTime;try{var a=e.error.Code,c=e.error.Message;("RequestTimeTooSkewed"===a||"AccessDenied"===a&&"Request has expired"===c)&&(s=!0)}catch(d){}if(e){if(s&&r){var l=Date.parse(r);this.options.CorrectClockSkew&&Math.abs(o.getSkewTime(this.options.SystemClockOffset)-l)>=3e4&&(this.options.SystemClockOffset=l-Date.now(),n=!0)}else{if(5===Math.floor(e.statusCode/100))return{canRetry:!0,networkError:!1};if("timeout"===e.message)return{canRetry:!0,networkError:t.options.AutoSwitchHost}}if(e.statusCode){var u=Math.floor(e.statusCode/100),p=(null==e?void 0:e.headers)&&(null==e?void 0:e.headers["x-cos-request-id"]);[3,4,5].includes(u)&&!p&&(n=t.options.AutoSwitchHost,i=!0)}else n=!0,i=t.options.AutoSwitchHost}return{canRetry:n,networkError:i}}function d(e){var t=e.requestUrl,n=e.clientCalcSign,i=e.networkError;return!!this.options.AutoSwitchHost&&!!t&&!!n&&!!i&&/^https?:\/\/[^\/]*\.cos\.[^\/]*\.myqcloud\.com(\/.*)?$/.test(t)&&!/^https?:\/\/[^\/]*\.cos\.accelerate\.myqcloud\.com(\/.*)?$/.test(t)}function h(e,t){var n=this;!e.headers&&(e.headers={}),!e.qs&&(e.qs={}),e.VersionId&&(e.qs.versionId=e.VersionId),e.qs=o.clearKey(e.qs),e.headers&&(e.headers=o.clearKey(e.headers)),e.qs&&(e.qs=o.clearKey(e.qs));var i=o.clone(e.qs);e.action&&(i[e.action]="");var s=e.url||e.Url,r=e.SignHost||l.call(this,{Bucket:e.Bucket,Region:e.Region,Url:s}),a=e.tracker;!function o(s){var c=n.options.SystemClockOffset;e.SwitchHost&&(r=r.replace(/myqcloud.com/,"tencentcos.cn")),a&&a.setParams({signStartTime:(new Date).getTime(),httpRetryTimes:s-1}),u.call(n,{Bucket:e.Bucket||"",Region:e.Region||"",Method:e.method,Key:e.Key,Query:i,Headers:e.headers,SignHost:r,Action:e.Action,ResourceKey:e.ResourceKey,Scope:e.Scope,ForceSignHost:n.options.ForceSignHost},(function(i,r){i?t(i):(a&&a.setParams({signEndTime:(new Date).getTime(),httpStartTime:(new Date).getTime()}),e.AuthData=r,f.call(n,e,(function(i,l){var u=!1,h=!1;if(i){var f=p.call(n,i);u=f.canRetry||c!==n.options.SystemClockOffset,h=f.networkError}if(a&&a.setParams({httpEndTime:(new Date).getTime()}),i&&s<4&&u){e.headers&&(delete e.headers.Authorization,delete e.headers.token,delete e.headers.clientIP,delete e.headers.clientUA,e.headers["x-cos-security-token"]&&delete e.headers["x-cos-security-token"],e.headers["x-ci-security-token"]&&delete e.headers["x-ci-security-token"]);var m=d.call(n,{requestUrl:(null==i?void 0:i.url)||"",clientCalcSign:"client"===(null==r?void 0:r.SignFrom),networkError:h});e.SwitchHost=m,e.headers["x-cos-sdk-retry"]="true",o(s+1)}else t(i,l)})))}))}(1)}function f(e,t){var n=this,s=e.TaskId;if(!s||n._isRunningTask(s)){var r=e.Bucket,a=e.Region,l=e.Key,u=e.method||"GET",p=e.url||e.Url,d=e.body,h=e.json,f=e.rawBody,m=e.dataType,g=n.options.HttpDNSServiceId;n.options.UseAccelerate&&(a="accelerate"),p=p||c({ForcePathStyle:n.options.ForcePathStyle,protocol:n.options.Protocol,domain:n.options.Domain,bucket:r,region:a,object:l}),e.SwitchHost&&(p=p.replace(/myqcloud.com/,"tencentcos.cn"));var v=l?p:"";e.action&&(p=p+"?"+e.action),e.qsStr&&(p=p.indexOf("?")>-1?p+"&"+e.qsStr:p+"?"+e.qsStr);var y={method:u,url:p,headers:e.headers,qs:e.qs,filePath:e.filePath,body:d,json:h,httpDNSServiceId:g,dataType:m},b="x-cos-security-token";o.isCIHost(p)&&(b="x-ci-security-token"),y.headers.Authorization=e.AuthData.Authorization,e.AuthData.Token&&(y.headers.token=e.AuthData.Token),e.AuthData.ClientIP&&(y.headers.clientIP=e.AuthData.ClientIP),e.AuthData.ClientUA&&(y.headers.clientUA=e.AuthData.ClientUA),e.AuthData.SecurityToken&&(y.headers[b]=e.AuthData.SecurityToken),y.headers&&(y.headers=o.clearKey(y.headers)),y=o.clearKey(y),e.onProgress&&"function"==typeof e.onProgress&&(y.onProgress=function(t){if(!s||n._isRunningTask(s)){var i=t?t.loaded:0;e.onProgress({loaded:i,total:t.total})}}),this.options.Timeout&&(y.timeout=this.options.Timeout),n.options.ForcePathStyle&&(y.pathStyle=n.options.ForcePathStyle),n.emit("before-send",y);var x,S=y.url.includes("accelerate."),k=y.qs?Object.keys(y.qs).map((function(e){return"".concat(e,"=").concat(y.qs[e])})).join("&"):"",C=k?y.url+"?"+k:y.url;e.tracker&&(e.tracker.setParams({url:C,httpMethod:y.method,accelerate:S,httpSize:(null===(x=y.body)||void 0===x?void 0:x.size)||0}),e.tracker.parent&&!e.tracker.parent.params.url&&e.tracker.parent.setParams({url:v,accelerate:S}));var w=i(y,(function(e,i,r){if("abort"!==e){var a,c=function(e,r){if(s&&n.off("inner-kill-task",E),!a){a=!0;var c={};i&&i.statusCode&&(c.statusCode=i.statusCode),i&&i.headers&&(c.headers=i.headers),e?(y.url&&(c.url=y.url),y.method&&(c.method=y.method),e=o.extend(e||{},c),t(e,null)):(r=o.extend(r||{},c),t(null,r)),w=null}};if(e)c({error:e});else{var l=i.statusCode,u=2===Math.floor(l/100);if(f){if(u)return c(null,{body:r});if(r instanceof ArrayBuffer){var p=o.arrayBufferToString(r),d=o.parseResBody(p);return c({error:d.Error||d})}}var h=o.parseResBody(r);u?h.Error?c({error:h.Error}):c(null,h):c({error:h.Error||h})}}})),E=function e(t){t.TaskId===s&&(w&&w.abort&&w.abort(),n.off("inner-kill-task",e))};s&&n.on("inner-kill-task",E)}}var m={getService:function(e,t){"function"==typeof e&&(t=e,e={});var n="https:",i=this.options.ServiceDomain,s=e.Region;i?(i=i.replace(/\{\{Region\}\}/gi,s||"").replace(/\{\{.*?\}\}/gi,""),/^[a-zA-Z]+:\/\//.test(i)||(i=n+"//"+i),"/"===i.slice(-1)&&(i=i.slice(0,-1))):i=s?n+"//cos."+s+".myqcloud.com":n+"//service.cos.myqcloud.com",i.replace(/^https?:\/\/([^/]+)(\/.*)?$/,"$1"),h.call(this,{Action:"name/cos:GetService",url:i,method:"GET",headers:e.Headers,tracker:e.tracker},(function(e,n){if(e)return t(e);var i=n&&n.ListAllMyBucketsResult&&n.ListAllMyBucketsResult.Buckets&&n.ListAllMyBucketsResult.Buckets.Bucket||[];i=o.isArray(i)?i:[i];var s=n&&n.ListAllMyBucketsResult&&n.ListAllMyBucketsResult.Owner||{};t(null,{Buckets:i,Owner:s,statusCode:n.statusCode,headers:n.headers})}))},putBucket:function(e,t){var n=this,i="";if(e.BucketAZConfig){var s={BucketAZConfig:e.BucketAZConfig};i=o.json2xml({CreateBucketConfiguration:s})}h.call(this,{Action:"name/cos:PutBucket",method:"PUT",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,body:i,tracker:e.tracker},(function(i,o){if(i)return t(i);var s=c({protocol:n.options.Protocol,domain:n.options.Domain,bucket:e.Bucket,region:e.Region,isLocation:!0});t(null,{Location:s,statusCode:o.statusCode,headers:o.headers})}))},headBucket:function(e,t){h.call(this,{Action:"name/cos:HeadBucket",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,method:"HEAD",tracker:e.tracker},(function(e,n){t(e,n)}))},getBucket:function(e,t){var n={};n.prefix=e.Prefix||"",n.delimiter=e.Delimiter,n.marker=e.Marker,n["max-keys"]=e.MaxKeys,n["encoding-type"]=e.EncodingType,h.call(this,{Action:"name/cos:GetBucket",ResourceKey:n.prefix,method:"GET",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,qs:n,tracker:e.tracker},(function(e,n){if(e)return t(e);var i=n.ListBucketResult||{},s=i.Contents||[],r=i.CommonPrefixes||[];s=o.isArray(s)?s:[s],r=o.isArray(r)?r:[r];var a=o.clone(i);o.extend(a,{Contents:s,CommonPrefixes:r,statusCode:n.statusCode,headers:n.headers}),t(null,a)}))},deleteBucket:function(e,t){h.call(this,{Action:"name/cos:DeleteBucket",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,method:"DELETE",tracker:e.tracker},(function(e,n){return e&&204===e.statusCode?t(null,{statusCode:e.statusCode}):e?t(e):void t(null,{statusCode:n.statusCode,headers:n.headers})}))},putBucketAcl:function(e,t){var n=e.Headers,i="";if(e.AccessControlPolicy){var s=o.clone(e.AccessControlPolicy||{}),r=s.Grants||s.Grant;r=o.isArray(r)?r:[r],delete s.Grant,delete s.Grants,s.AccessControlList={Grant:r},i=o.json2xml({AccessControlPolicy:s}),n["Content-Type"]="application/xml",n["Content-MD5"]=o.binaryBase64(o.md5(i))}o.each(n,(function(e,t){0===t.indexOf("x-cos-grant-")&&(n[t]=a(n[t]))})),h.call(this,{Action:"name/cos:PutBucketACL",method:"PUT",Bucket:e.Bucket,Region:e.Region,headers:n,action:"acl",body:i,tracker:e.tracker},(function(e,n){if(e)return t(e);t(null,{statusCode:n.statusCode,headers:n.headers})}))},getBucketAcl:function(e,t){h.call(this,{Action:"name/cos:GetBucketACL",method:"GET",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,action:"acl",tracker:e.tracker},(function(e,n){if(e)return t(e);var i=n.AccessControlPolicy||{},s=i.Owner||{},a=i.AccessControlList.Grant||[];a=o.isArray(a)?a:[a];var c=r(i);n.headers&&n.headers["x-cos-acl"]&&(c.ACL=n.headers["x-cos-acl"]),c=o.extend(c,{Owner:s,Grants:a,statusCode:n.statusCode,headers:n.headers}),t(null,c)}))},putBucketCors:function(e,t){var n=(e.CORSConfiguration||{}).CORSRules||e.CORSRules||[];n=o.clone(o.isArray(n)?n:[n]),o.each(n,(function(e){o.each(["AllowedOrigin","AllowedHeader","AllowedMethod","ExposeHeader"],(function(t){var n=t+"s",i=e[n]||e[t]||[];delete e[n],e[t]=o.isArray(i)?i:[i]}))}));var i={CORSRule:n};e.ResponseVary&&(i.ResponseVary=e.ResponseVary);var s=o.json2xml({CORSConfiguration:i}),r=e.Headers;r["Content-Type"]="application/xml",r["Content-MD5"]=o.binaryBase64(o.md5(s)),h.call(this,{Action:"name/cos:PutBucketCORS",method:"PUT",Bucket:e.Bucket,Region:e.Region,body:s,action:"cors",headers:r,tracker:e.tracker},(function(e,n){if(e)return t(e);t(null,{statusCode:n.statusCode,headers:n.headers})}))},getBucketCors:function(e,t){h.call(this,{Action:"name/cos:GetBucketCORS",method:"GET",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,action:"cors",tracker:e.tracker},(function(e,n){if(e)if(404===e.statusCode&&e.error&&"NoSuchCORSConfiguration"===e.error.Code){var i={CORSRules:[],statusCode:e.statusCode};e.headers&&(i.headers=e.headers),t(null,i)}else t(e);else{var s=n.CORSConfiguration||{},r=s.CORSRules||s.CORSRule||[];r=o.clone(o.isArray(r)?r:[r]);var a=s.ResponseVary;o.each(r,(function(e){o.each(["AllowedOrigin","AllowedHeader","AllowedMethod","ExposeHeader"],(function(t){var n=t+"s",i=e[n]||e[t]||[];delete e[t],e[n]=o.isArray(i)?i:[i]}))})),t(null,{CORSRules:r,ResponseVary:a,statusCode:n.statusCode,headers:n.headers})}}))},deleteBucketCors:function(e,t){h.call(this,{Action:"name/cos:DeleteBucketCORS",method:"DELETE",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,action:"cors",tracker:e.tracker},(function(e,n){return e&&204===e.statusCode?t(null,{statusCode:e.statusCode}):e?t(e):void t(null,{statusCode:n.statusCode||e.statusCode,headers:n.headers})}))},getBucketLocation:function(e,t){h.call(this,{Action:"name/cos:GetBucketLocation",method:"GET",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,action:"location",tracker:e.tracker},(function(e,n){if(e)return t(e);t(null,n)}))},getBucketPolicy:function(e,t){h.call(this,{Action:"name/cos:GetBucketPolicy",method:"GET",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,action:"policy",rawBody:!0,tracker:e.tracker},(function(e,n){if(e)return e.statusCode&&403===e.statusCode?t({ErrorStatus:"Access Denied"}):e.statusCode&&405===e.statusCode?t({ErrorStatus:"Method Not Allowed"}):e.statusCode&&404===e.statusCode?t({ErrorStatus:"Policy Not Found"}):t(e);var i={};try{i=JSON.parse(n.body)}catch(o){}t(null,{Policy:i,statusCode:n.statusCode,headers:n.headers})}))},putBucketPolicy:function(e,t){var n=e.Policy,i=n;try{"string"==typeof n?n=JSON.parse(i):i=JSON.stringify(n)}catch(r){t({error:"Policy format error"})}var s=e.Headers;s["Content-Type"]="application/json",s["Content-MD5"]=o.binaryBase64(o.md5(i)),h.call(this,{Action:"name/cos:PutBucketPolicy",method:"PUT",Bucket:e.Bucket,Region:e.Region,action:"policy",body:i,headers:s,json:!0,tracker:e.tracker},(function(e,n){return e&&204===e.statusCode?t(null,{statusCode:e.statusCode}):e?t(e):void t(null,{statusCode:n.statusCode,headers:n.headers})}))},deleteBucketPolicy:function(e,t){h.call(this,{Action:"name/cos:DeleteBucketPolicy",method:"DELETE",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,action:"policy",tracker:e.tracker},(function(e,n){return e&&204===e.statusCode?t(null,{statusCode:e.statusCode}):e?t(e):void t(null,{statusCode:n.statusCode||e.statusCode,headers:n.headers})}))},putBucketTagging:function(e,t){var n=e.Tagging||{},i=n.TagSet||n.Tags||e.Tags||[];i=o.clone(o.isArray(i)?i:[i]);var s=o.json2xml({Tagging:{TagSet:{Tag:i}}}),r=e.Headers;r["Content-Type"]="application/xml",r["Content-MD5"]=o.binaryBase64(o.md5(s)),h.call(this,{Action:"name/cos:PutBucketTagging",method:"PUT",Bucket:e.Bucket,Region:e.Region,body:s,action:"tagging",headers:r,tracker:e.tracker},(function(e,n){return e&&204===e.statusCode?t(null,{statusCode:e.statusCode}):e?t(e):void t(null,{statusCode:n.statusCode,headers:n.headers})}))},getBucketTagging:function(e,t){h.call(this,{Action:"name/cos:GetBucketTagging",method:"GET",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,action:"tagging",tracker:e.tracker},(function(e,n){if(e)if(404!==e.statusCode||!e.error||"Not Found"!==e.error&&"NoSuchTagSet"!==e.error.Code)t(e);else{var i={Tags:[],statusCode:e.statusCode};e.headers&&(i.headers=e.headers),t(null,i)}else{var s=[];try{s=n.Tagging.TagSet.Tag||[]}catch(r){}s=o.clone(o.isArray(s)?s:[s]),t(null,{Tags:s,statusCode:n.statusCode,headers:n.headers})}}))},deleteBucketTagging:function(e,t){h.call(this,{Action:"name/cos:DeleteBucketTagging",method:"DELETE",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,action:"tagging",tracker:e.tracker},(function(e,n){return e&&204===e.statusCode?t(null,{statusCode:e.statusCode}):e?t(e):void t(null,{statusCode:n.statusCode,headers:n.headers})}))},putBucketLifecycle:function(e,t){var n=(e.LifecycleConfiguration||{}).Rules||e.Rules||[];n=o.clone(n);var i=o.json2xml({LifecycleConfiguration:{Rule:n}}),s=e.Headers;s["Content-Type"]="application/xml",s["Content-MD5"]=o.binaryBase64(o.md5(i)),h.call(this,{Action:"name/cos:PutBucketLifecycle",method:"PUT",Bucket:e.Bucket,Region:e.Region,body:i,action:"lifecycle",headers:s,tracker:e.tracker},(function(e,n){return e&&204===e.statusCode?t(null,{statusCode:e.statusCode}):e?t(e):void t(null,{statusCode:n.statusCode,headers:n.headers})}))},getBucketLifecycle:function(e,t){h.call(this,{Action:"name/cos:GetBucketLifecycle",method:"GET",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,action:"lifecycle",tracker:e.tracker},(function(e,n){if(e)if(404===e.statusCode&&e.error&&"NoSuchLifecycleConfiguration"===e.error.Code){var i={Rules:[],statusCode:e.statusCode};e.headers&&(i.headers=e.headers),t(null,i)}else t(e);else{var s=[];try{s=n.LifecycleConfiguration.Rule||[]}catch(r){}s=o.clone(o.isArray(s)?s:[s]),t(null,{Rules:s,statusCode:n.statusCode,headers:n.headers})}}))},deleteBucketLifecycle:function(e,t){h.call(this,{Action:"name/cos:DeleteBucketLifecycle",method:"DELETE",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,action:"lifecycle",tracker:e.tracker},(function(e,n){return e&&204===e.statusCode?t(null,{statusCode:e.statusCode}):e?t(e):void t(null,{statusCode:n.statusCode,headers:n.headers})}))},putBucketVersioning:function(e,t){if(e.VersioningConfiguration){var n=e.VersioningConfiguration||{},i=o.json2xml({VersioningConfiguration:n}),s=e.Headers;s["Content-Type"]="application/xml",s["Content-MD5"]=o.binaryBase64(o.md5(i)),h.call(this,{Action:"name/cos:PutBucketVersioning",method:"PUT",Bucket:e.Bucket,Region:e.Region,body:i,action:"versioning",headers:s,tracker:e.tracker},(function(e,n){return e&&204===e.statusCode?t(null,{statusCode:e.statusCode}):e?t(e):void t(null,{statusCode:n.statusCode,headers:n.headers})}))}else t({error:"missing param VersioningConfiguration"})},getBucketVersioning:function(e,t){h.call(this,{Action:"name/cos:GetBucketVersioning",method:"GET",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,action:"versioning",tracker:e.tracker},(function(e,n){e||!n.VersioningConfiguration&&(n.VersioningConfiguration={}),t(e,n)}))},putBucketReplication:function(e,t){var n=o.clone(e.ReplicationConfiguration),i=o.json2xml({ReplicationConfiguration:n});i=(i=i.replace(/<(\/?)Rules>/gi,"<$1Rule>")).replace(/<(\/?)Tags>/gi,"<$1Tag>");var s=e.Headers;s["Content-Type"]="application/xml",s["Content-MD5"]=o.binaryBase64(o.md5(i)),h.call(this,{Action:"name/cos:PutBucketReplication",method:"PUT",Bucket:e.Bucket,Region:e.Region,body:i,action:"replication",headers:s,tracker:e.tracker},(function(e,n){return e&&204===e.statusCode?t(null,{statusCode:e.statusCode}):e?t(e):void t(null,{statusCode:n.statusCode,headers:n.headers})}))},getBucketReplication:function(e,t){h.call(this,{Action:"name/cos:GetBucketReplication",method:"GET",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,action:"replication",tracker:e.tracker},(function(e,n){if(e)if(404!==e.statusCode||!e.error||"Not Found"!==e.error&&"ReplicationConfigurationnotFoundError"!==e.error.Code)t(e);else{var i={ReplicationConfiguration:{Rules:[]},statusCode:e.statusCode};e.headers&&(i.headers=e.headers),t(null,i)}else e||!n.ReplicationConfiguration&&(n.ReplicationConfiguration={}),n.ReplicationConfiguration.Rule&&(n.ReplicationConfiguration.Rules=n.ReplicationConfiguration.Rule,delete n.ReplicationConfiguration.Rule),t(e,n)}))},deleteBucketReplication:function(e,t){h.call(this,{Action:"name/cos:DeleteBucketReplication",method:"DELETE",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,action:"replication",tracker:e.tracker},(function(e,n){return e&&204===e.statusCode?t(null,{statusCode:e.statusCode}):e?t(e):void t(null,{statusCode:n.statusCode,headers:n.headers})}))},putBucketWebsite:function(e,t){if(e.WebsiteConfiguration){var n=o.clone(e.WebsiteConfiguration||{}),i=n.RoutingRules||n.RoutingRule||[];i=o.isArray(i)?i:[i],delete n.RoutingRule,delete n.RoutingRules,i.length&&(n.RoutingRules={RoutingRule:i});var s=o.json2xml({WebsiteConfiguration:n}),r=e.Headers;r["Content-Type"]="application/xml",r["Content-MD5"]=o.binaryBase64(o.md5(s)),h.call(this,{Action:"name/cos:PutBucketWebsite",method:"PUT",Bucket:e.Bucket,Region:e.Region,body:s,action:"website",headers:r,tracker:e.tracker},(function(e,n){return e&&204===e.statusCode?t(null,{statusCode:e.statusCode}):e?t(e):void t(null,{statusCode:n.statusCode,headers:n.headers})}))}else t({error:"missing param WebsiteConfiguration"})},getBucketWebsite:function(e,t){h.call(this,{Action:"name/cos:GetBucketWebsite",method:"GET",Bucket:e.Bucket,Region:e.Region,Key:e.Key,headers:e.Headers,action:"website",tracker:e.tracker},(function(e,n){if(e)if(404===e.statusCode&&"NoSuchWebsiteConfiguration"===e.error.Code){var i={WebsiteConfiguration:{},statusCode:e.statusCode};e.headers&&(i.headers=e.headers),t(null,i)}else t(e);else{var s=n.WebsiteConfiguration||{};if(s.RoutingRules){var r=o.clone(s.RoutingRules.RoutingRule||[]);r=o.makeArray(r),s.RoutingRules=r}t(null,{WebsiteConfiguration:s,statusCode:n.statusCode,headers:n.headers})}}))},deleteBucketWebsite:function(e,t){h.call(this,{Action:"name/cos:DeleteBucketWebsite",method:"DELETE",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,action:"website",tracker:e.tracker},(function(e,n){return e&&204===e.statusCode?t(null,{statusCode:e.statusCode}):e?t(e):void t(null,{statusCode:n.statusCode,headers:n.headers})}))},putBucketReferer:function(e,t){if(e.RefererConfiguration){var n=o.clone(e.RefererConfiguration||{}),i=n.DomainList||{},s=i.Domains||i.Domain||[];(s=o.isArray(s)?s:[s]).length&&(n.DomainList={Domain:s});var r=o.json2xml({RefererConfiguration:n}),a=e.Headers;a["Content-Type"]="application/xml",a["Content-MD5"]=o.binaryBase64(o.md5(r)),h.call(this,{Action:"name/cos:PutBucketReferer",method:"PUT",Bucket:e.Bucket,Region:e.Region,body:r,action:"referer",headers:a,tracker:e.tracker},(function(e,n){return e&&204===e.statusCode?t(null,{statusCode:e.statusCode}):e?t(e):void t(null,{statusCode:n.statusCode,headers:n.headers})}))}else t({error:"missing param RefererConfiguration"})},getBucketReferer:function(e,t){h.call(this,{Action:"name/cos:GetBucketReferer",method:"GET",Bucket:e.Bucket,Region:e.Region,Key:e.Key,headers:e.Headers,action:"referer",tracker:e.tracker},(function(e,n){if(e)if(404===e.statusCode&&"NoSuchRefererConfiguration"===e.error.Code){var i={WebsiteConfiguration:{},statusCode:e.statusCode};e.headers&&(i.headers=e.headers),t(null,i)}else t(e);else{var s=n.RefererConfiguration||{};if(s.DomainList){var r=o.makeArray(s.DomainList.Domain||[]);s.DomainList={Domains:r}}t(null,{RefererConfiguration:s,statusCode:n.statusCode,headers:n.headers})}}))},putBucketDomain:function(e,t){var n=(e.DomainConfiguration||{}).DomainRule||e.DomainRule||[];n=o.clone(n);var i=o.json2xml({DomainConfiguration:{DomainRule:n}}),s=e.Headers;s["Content-Type"]="application/xml",s["Content-MD5"]=o.binaryBase64(o.md5(i)),h.call(this,{Action:"name/cos:PutBucketDomain",method:"PUT",Bucket:e.Bucket,Region:e.Region,body:i,action:"domain",headers:s,tracker:e.tracker},(function(e,n){return e&&204===e.statusCode?t(null,{statusCode:e.statusCode}):e?t(e):void t(null,{statusCode:n.statusCode,headers:n.headers})}))},getBucketDomain:function(e,t){h.call(this,{Action:"name/cos:GetBucketDomain",method:"GET",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,action:"domain",tracker:e.tracker},(function(e,n){if(e)return t(e);var i=[];try{i=n.DomainConfiguration.DomainRule||[]}catch(s){}i=o.clone(o.isArray(i)?i:[i]),t(null,{DomainRule:i,statusCode:n.statusCode,headers:n.headers})}))},deleteBucketDomain:function(e,t){h.call(this,{Action:"name/cos:DeleteBucketDomain",method:"DELETE",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,action:"domain",tracker:e.tracker},(function(e,n){return e&&204===e.statusCode?t(null,{statusCode:e.statusCode}):e?t(e):void t(null,{statusCode:n.statusCode,headers:n.headers})}))},putBucketOrigin:function(e,t){var n=(e.OriginConfiguration||{}).OriginRule||e.OriginRule||[];n=o.clone(n);var i=o.json2xml({OriginConfiguration:{OriginRule:n}}),s=e.Headers;s["Content-Type"]="application/xml",s["Content-MD5"]=o.binaryBase64(o.md5(i)),h.call(this,{Action:"name/cos:PutBucketOrigin",method:"PUT",Bucket:e.Bucket,Region:e.Region,body:i,action:"origin",headers:s,tracker:e.tracker},(function(e,n){return e&&204===e.statusCode?t(null,{statusCode:e.statusCode}):e?t(e):void t(null,{statusCode:n.statusCode,headers:n.headers})}))},getBucketOrigin:function(e,t){h.call(this,{Action:"name/cos:GetBucketOrigin",method:"GET",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,action:"origin",tracker:e.tracker},(function(e,n){if(e)return t(e);var i=[];try{i=n.OriginConfiguration.OriginRule||[]}catch(s){}i=o.clone(o.isArray(i)?i:[i]),t(null,{OriginRule:i,statusCode:n.statusCode,headers:n.headers})}))},deleteBucketOrigin:function(e,t){h.call(this,{Action:"name/cos:DeleteBucketOrigin",method:"DELETE",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,action:"origin",tracker:e.tracker},(function(e,n){return e&&204===e.statusCode?t(null,{statusCode:e.statusCode}):e?t(e):void t(null,{statusCode:n.statusCode,headers:n.headers})}))},putBucketLogging:function(e,t){var n=o.json2xml({BucketLoggingStatus:e.BucketLoggingStatus||""}),i=e.Headers;i["Content-Type"]="application/xml",i["Content-MD5"]=o.binaryBase64(o.md5(n)),h.call(this,{Action:"name/cos:PutBucketLogging",method:"PUT",Bucket:e.Bucket,Region:e.Region,body:n,action:"logging",headers:i,tracker:e.tracker},(function(e,n){return e&&204===e.statusCode?t(null,{statusCode:e.statusCode}):e?t(e):void t(null,{statusCode:n.statusCode,headers:n.headers})}))},getBucketLogging:function(e,t){h.call(this,{Action:"name/cos:GetBucketLogging",method:"GET",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,action:"logging",tracker:e.tracker},(function(e,n){if(e)return t(e);delete n.BucketLoggingStatus._xmlns,t(null,{BucketLoggingStatus:n.BucketLoggingStatus,statusCode:n.statusCode,headers:n.headers})}))},putBucketInventory:function(e,t){var n=o.clone(e.InventoryConfiguration);if(n.OptionalFields){var i=n.OptionalFields||[];n.OptionalFields={Field:i}}if(n.Destination&&n.Destination.COSBucketDestination&&n.Destination.COSBucketDestination.Encryption){var s=n.Destination.COSBucketDestination.Encryption;Object.keys(s).indexOf("SSECOS")>-1&&(s["SSE-COS"]=s.SSECOS,delete s.SSECOS)}var r=o.json2xml({InventoryConfiguration:n}),a=e.Headers;a["Content-Type"]="application/xml",a["Content-MD5"]=o.binaryBase64(o.md5(r)),h.call(this,{Action:"name/cos:PutBucketInventory",method:"PUT",Bucket:e.Bucket,Region:e.Region,body:r,action:"inventory",qs:{id:e.Id},headers:a,tracker:e.tracker},(function(e,n){return e&&204===e.statusCode?t(null,{statusCode:e.statusCode}):e?t(e):void t(null,{statusCode:n.statusCode,headers:n.headers})}))},getBucketInventory:function(e,t){h.call(this,{Action:"name/cos:GetBucketInventory",method:"GET",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,action:"inventory",qs:{id:e.Id},tracker:e.tracker},(function(e,n){if(e)return t(e);var i=n.InventoryConfiguration;if(i&&i.OptionalFields&&i.OptionalFields.Field){var s=i.OptionalFields.Field;o.isArray(s)||(s=[s]),i.OptionalFields=s}if(i.Destination&&i.Destination.COSBucketDestination&&i.Destination.COSBucketDestination.Encryption){var r=i.Destination.COSBucketDestination.Encryption;Object.keys(r).indexOf("SSE-COS")>-1&&(r.SSECOS=r["SSE-COS"],delete r["SSE-COS"])}t(null,{InventoryConfiguration:i,statusCode:n.statusCode,headers:n.headers})}))},listBucketInventory:function(e,t){h.call(this,{Action:"name/cos:ListBucketInventory",method:"GET",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,action:"inventory",qs:{"continuation-token":e.ContinuationToken},tracker:e.tracker},(function(e,n){if(e)return t(e);var i=n.ListInventoryConfigurationResult,s=i.InventoryConfiguration||[];s=o.isArray(s)?s:[s],delete i.InventoryConfiguration,o.each(s,(function(e){if(e&&e.OptionalFields&&e.OptionalFields.Field){var t=e.OptionalFields.Field;o.isArray(t)||(t=[t]),e.OptionalFields=t}if(e.Destination&&e.Destination.COSBucketDestination&&e.Destination.COSBucketDestination.Encryption){var n=e.Destination.COSBucketDestination.Encryption;Object.keys(n).indexOf("SSE-COS")>-1&&(n.SSECOS=n["SSE-COS"],delete n["SSE-COS"])}})),i.InventoryConfigurations=s,o.extend(i,{statusCode:n.statusCode,headers:n.headers}),t(null,i)}))},deleteBucketInventory:function(e,t){h.call(this,{Action:"name/cos:DeleteBucketInventory",method:"DELETE",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,action:"inventory",qs:{id:e.Id},tracker:e.tracker},(function(e,n){return e&&204===e.statusCode?t(null,{statusCode:e.statusCode}):e?t(e):void t(null,{statusCode:n.statusCode,headers:n.headers})}))},putBucketAccelerate:function(e,t){if(e.AccelerateConfiguration){var n={AccelerateConfiguration:e.AccelerateConfiguration||{}},i=o.json2xml(n),s={"Content-Type":"application/xml"};s["Content-MD5"]=o.binaryBase64(o.md5(i)),h.call(this,{Interface:"putBucketAccelerate",Action:"name/cos:PutBucketAccelerate",method:"PUT",Bucket:e.Bucket,Region:e.Region,body:i,action:"accelerate",headers:s,tracker:e.tracker},(function(e,n){if(e)return t(e);t(null,{statusCode:n.statusCode,headers:n.headers})}))}else t({error:"missing param AccelerateConfiguration"})},getBucketAccelerate:function(e,t){h.call(this,{Interface:"getBucketAccelerate",Action:"name/cos:GetBucketAccelerate",method:"GET",Bucket:e.Bucket,Region:e.Region,action:"accelerate",tracker:e.tracker},(function(e,n){e||!n.AccelerateConfiguration&&(n.AccelerateConfiguration={}),t(e,n)}))},getObject:function(e,t){if(this.options.ObjectKeySimplifyCheck&&"/"===o.simplifyPath(e.Key))t(o.error(new Error("The Getobject Key is illegal")));else{var n=e.Query||{},i=e.QueryString||"",s=e.tracker;s&&s.setParams({signStartTime:(new Date).getTime()}),n["response-content-type"]=e.ResponseContentType,n["response-content-language"]=e.ResponseContentLanguage,n["response-expires"]=e.ResponseExpires,n["response-cache-control"]=e.ResponseCacheControl,n["response-content-disposition"]=e.ResponseContentDisposition,n["response-content-encoding"]=e.ResponseContentEncoding,h.call(this,{Action:"name/cos:GetObject",method:"GET",Bucket:e.Bucket,Region:e.Region,Key:e.Key,VersionId:e.VersionId,headers:e.Headers,qs:n,qsStr:i,rawBody:!0,dataType:e.DataType,tracker:s},(function(n,i){if(n){var s=n.statusCode;return e.Headers["If-Modified-Since"]&&s&&304===s?t(null,{NotModified:!0}):t(n)}t(null,{Body:i.body,ETag:o.attr(i.headers,"etag",""),statusCode:i.statusCode,headers:i.headers})}))}},headObject:function(e,t){h.call(this,{Action:"name/cos:HeadObject",method:"HEAD",Bucket:e.Bucket,Region:e.Region,Key:e.Key,VersionId:e.VersionId,headers:e.Headers,tracker:e.tracker},(function(n,i){if(n){var s=n.statusCode;return e.Headers["If-Modified-Since"]&&s&&304===s?t(null,{NotModified:!0,statusCode:s}):t(n)}i.ETag=o.attr(i.headers,"etag",""),t(null,i)}))},listObjectVersions:function(e,t){var n={};n.prefix=e.Prefix||"",n.delimiter=e.Delimiter,n["key-marker"]=e.KeyMarker,n["version-id-marker"]=e.VersionIdMarker,n["max-keys"]=e.MaxKeys,n["encoding-type"]=e.EncodingType,h.call(this,{Action:"name/cos:GetBucketObjectVersions",ResourceKey:n.prefix,method:"GET",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,qs:n,action:"versions",tracker:e.tracker},(function(e,n){if(e)return t(e);var i=n.ListVersionsResult||{},s=i.DeleteMarker||[];s=o.isArray(s)?s:[s];var r=i.Version||[];r=o.isArray(r)?r:[r];var a=o.clone(i);delete a.DeleteMarker,delete a.Version,o.extend(a,{DeleteMarkers:s,Versions:r,statusCode:n.statusCode,headers:n.headers}),t(null,a)}))},putObject:function(e,t){var n=this,i=e.ContentLength,r=o.throttleOnProgress.call(n,i,e.onProgress),a=e.Headers;a["Cache-Control"]||a["cache-control"]||(a["Cache-Control"]=""),a["Content-Type"]||a["content-type"]||(a["Content-Type"]=s.getType(e.Key)||"application/octet-stream");var l=e.UploadAddMetaMd5||n.options.UploadAddMetaMd5||n.options.UploadCheckContentMd5,u=e.tracker;l&&u&&u.setParams({md5StartTime:(new Date).getTime()}),o.getBodyMd5(l,e.Body,(function(s){s&&(u&&u.setParams({md5EndTime:(new Date).getTime()}),n.options.UploadCheckContentMd5&&(a["Content-MD5"]=o.binaryBase64(s)),(e.UploadAddMetaMd5||n.options.UploadAddMetaMd5)&&(a["x-cos-meta-md5"]=s)),void 0!==e.ContentLength&&(a["Content-Length"]=e.ContentLength),r(null,!0),h.call(n,{Action:"name/cos:PutObject",TaskId:e.TaskId,method:"PUT",Bucket:e.Bucket,Region:e.Region,Key:e.Key,headers:e.Headers,qs:e.Query,body:e.Body,onProgress:r,tracker:u},(function(s,a){if(s)return r(null,!0),t(s);r({loaded:i,total:i},!0);var l=c({ForcePathStyle:n.options.ForcePathStyle,protocol:n.options.Protocol,domain:n.options.Domain,bucket:e.Bucket,region:n.options.UseAccelerate?"accelerate":e.Region,object:e.Key});l=l.substr(l.indexOf("://")+3),a.Location=l,a.ETag=o.attr(a.headers,"etag",""),t(null,a)}))}))},postObject:function(e,t){var n=this,i={},s=e.FilePath;if(s){for(var r in i["Cache-Control"]=e.CacheControl,i["Content-Disposition"]=e.ContentDisposition,i["Content-Encoding"]=e.ContentEncoding,i["Content-MD5"]=e.ContentMD5,i["Content-Length"]=e.ContentLength,i["Content-Type"]=e.ContentType,i.Expect=e.Expect,i.Expires=e.Expires,i["x-cos-acl"]=e.ACL,i["x-cos-grant-read"]=e.GrantRead,i["x-cos-grant-write"]=e.GrantWrite,i["x-cos-grant-full-control"]=e.GrantFullControl,i["x-cos-storage-class"]=e.StorageClass,i["x-cos-mime-limit"]=e.MimeLimit,i["x-cos-traffic-limit"]=e.TrafficLimit,i["x-cos-forbid-overwrite"]=e.ForbidOverwrite,i["x-cos-server-side-encryption-customer-algorithm"]=e.SSECustomerAlgorithm,i["x-cos-server-side-encryption-customer-key"]=e.SSECustomerKey,i["x-cos-server-side-encryption-customer-key-MD5"]=e.SSECustomerKeyMD5,i["x-cos-server-side-encryption"]=e.ServerSideEncryption,i["x-cos-server-side-encryption-cos-kms-key-id"]=e.SSEKMSKeyId,i["x-cos-server-side-encryption-context"]=e.SSEContext,delete i["Content-Length"],delete i["content-length"],e)r.indexOf("x-cos-meta-")>-1&&(i[r]=e[r]);var a=o.throttleOnProgress.call(n,i["Content-Length"],e.onProgress);h.call(this,{Action:"name/cos:PostObject",method:"POST",Bucket:e.Bucket,Region:e.Region,Key:e.Key,headers:i,qs:e.Query,filePath:s,TaskId:e.TaskId,onProgress:a,tracker:e.tracker},(function(i,o){if(a(null,!0),i)return t(i);if(o&&o.headers){var r=o.headers,l=r.etag||r.Etag||r.ETag||"",u=s.substr(s.lastIndexOf("/")+1),p=c({ForcePathStyle:n.options.ForcePathStyle,protocol:n.options.Protocol,domain:n.options.Domain,bucket:e.Bucket,region:e.Region,object:e.Key.replace(/\$\{filename\}/g,u),isLocation:!0});return t(null,{Location:p,statusCode:o.statusCode,headers:r,ETag:l})}t(null,o)}))}else t({error:"missing param FilePath"})},deleteObject:function(e,t){h.call(this,{Action:"name/cos:DeleteObject",method:"DELETE",Bucket:e.Bucket,Region:e.Region,Key:e.Key,headers:e.Headers,VersionId:e.VersionId,tracker:e.tracker},(function(e,n){if(e){var i=e.statusCode;return i&&204===i?t(null,{statusCode:i}):i&&404===i?t(null,{BucketNotFound:!0,statusCode:i}):t(e)}t(null,{statusCode:n.statusCode,headers:n.headers})}))},getObjectAcl:function(e,t){var n={};e.VersionId&&(n.versionId=e.VersionId),h.call(this,{Action:"name/cos:GetObjectACL",method:"GET",Bucket:e.Bucket,Region:e.Region,Key:e.Key,headers:e.Headers,qs:n,action:"acl",tracker:e.tracker},(function(e,n){if(e)return t(e);var i=n.AccessControlPolicy||{},s=i.Owner||{},a=i.AccessControlList&&i.AccessControlList.Grant||[];a=o.isArray(a)?a:[a];var c=r(i);n.headers&&n.headers["x-cos-acl"]&&(c.ACL=n.headers["x-cos-acl"]),c=o.extend(c,{Owner:s,Grants:a,statusCode:n.statusCode,headers:n.headers}),t(null,c)}))},putObjectAcl:function(e,t){var n=e.Headers,i="";if(e.AccessControlPolicy){var s=o.clone(e.AccessControlPolicy||{}),r=s.Grants||s.Grant;r=o.isArray(r)?r:[r],delete s.Grant,delete s.Grants,s.AccessControlList={Grant:r},i=o.json2xml({AccessControlPolicy:s}),n["Content-Type"]="application/xml",n["Content-MD5"]=o.binaryBase64(o.md5(i))}o.each(n,(function(e,t){0===t.indexOf("x-cos-grant-")&&(n[t]=a(n[t]))})),h.call(this,{Action:"name/cos:PutObjectACL",method:"PUT",Bucket:e.Bucket,Region:e.Region,Key:e.Key,action:"acl",headers:n,body:i,tracker:e.tracker},(function(e,n){if(e)return t(e);t(null,{statusCode:n.statusCode,headers:n.headers})}))},optionsObject:function(e,t){var n=e.Headers;n.Origin=e.Origin,n["Access-Control-Request-Method"]=e.AccessControlRequestMethod,n["Access-Control-Request-Headers"]=e.AccessControlRequestHeaders,h.call(this,{Action:"name/cos:OptionsObject",method:"OPTIONS",Bucket:e.Bucket,Region:e.Region,Key:e.Key,headers:n,tracker:e.tracker},(function(e,n){if(e)return e.statusCode&&403===e.statusCode?t(null,{OptionsForbidden:!0,statusCode:e.statusCode}):t(e);var i=n.headers||{};t(null,{AccessControlAllowOrigin:i["access-control-allow-origin"],AccessControlAllowMethods:i["access-control-allow-methods"],AccessControlAllowHeaders:i["access-control-allow-headers"],AccessControlExposeHeaders:i["access-control-expose-headers"],AccessControlMaxAge:i["access-control-max-age"],statusCode:n.statusCode,headers:n.headers})}))},putObjectCopy:function(e,t){var n=e.Headers;!n["Cache-Control"]&&n["cache-control"]&&(n["Cache-Control"]="");var i=e.CopySource||"",s=o.getSourceParams.call(this,i);if(s){var r=s.Bucket,a=s.Region,c=decodeURIComponent(s.Key);h.call(this,{Scope:[{action:"name/cos:GetObject",bucket:r,region:a,prefix:c},{action:"name/cos:PutObject",bucket:e.Bucket,region:e.Region,prefix:e.Key}],method:"PUT",Bucket:e.Bucket,Region:e.Region,Key:e.Key,VersionId:e.VersionId,headers:e.Headers,tracker:e.tracker},(function(e,n){if(e)return t(e);var i=o.clone(n.CopyObjectResult||{});o.extend(i,{statusCode:n.statusCode,headers:n.headers}),t(null,i)}))}else t({error:"CopySource format error"})},deleteMultipleObject:function(e,t){var n=e.Objects||[],i=e.Quiet;n=o.isArray(n)?n:[n];var s=o.json2xml({Delete:{Object:n,Quiet:i||!1}}),r=e.Headers;r["Content-Type"]="application/xml",r["Content-MD5"]=o.binaryBase64(o.md5(s));var a=o.map(n,(function(t){return{action:"name/cos:DeleteObject",bucket:e.Bucket,region:e.Region,prefix:t.Key}}));h.call(this,{Scope:a,method:"POST",Bucket:e.Bucket,Region:e.Region,body:s,action:"delete",headers:r,tracker:e.tracker},(function(e,n){if(e)return t(e);var i=n.DeleteResult||{},s=i.Deleted||[],r=i.Error||[];s=o.isArray(s)?s:[s],r=o.isArray(r)?r:[r];var a=o.clone(i);o.extend(a,{Error:r,Deleted:s,statusCode:n.statusCode,headers:n.headers}),t(null,a)}))},restoreObject:function(e,t){var n=e.Headers;if(e.RestoreRequest){var i=e.RestoreRequest||{},s=o.json2xml({RestoreRequest:i});n["Content-Type"]="application/xml",n["Content-MD5"]=o.binaryBase64(o.md5(s)),h.call(this,{Action:"name/cos:RestoreObject",method:"POST",Bucket:e.Bucket,Region:e.Region,Key:e.Key,VersionId:e.VersionId,body:s,action:"restore",headers:n,tracker:e.tracker},(function(e,n){t(e,n)}))}else t({error:"missing param RestoreRequest"})},putObjectTagging:function(e,t){var n=e.Tagging||{},i=n.TagSet||n.Tags||e.Tags||[];i=o.clone(o.isArray(i)?i:[i]);var s=o.json2xml({Tagging:{TagSet:{Tag:i}}}),r=e.Headers;r["Content-Type"]="application/xml",r["Content-MD5"]=o.binaryBase64(o.md5(s)),h.call(this,{Interface:"putObjectTagging",Action:"name/cos:PutObjectTagging",method:"PUT",Bucket:e.Bucket,Key:e.Key,Region:e.Region,body:s,action:"tagging",headers:r,VersionId:e.VersionId,tracker:e.tracker},(function(e,n){return e&&204===e.statusCode?t(null,{statusCode:e.statusCode}):e?t(e):void t(null,{statusCode:n.statusCode,headers:n.headers})}))},getObjectTagging:function(e,t){h.call(this,{Interface:"getObjectTagging",Action:"name/cos:GetObjectTagging",method:"GET",Key:e.Key,Bucket:e.Bucket,Region:e.Region,headers:e.Headers,action:"tagging",VersionId:e.VersionId,tracker:e.tracker},(function(e,n){if(e)if(404!==e.statusCode||!e.error||"Not Found"!==e.error&&"NoSuchTagSet"!==e.error.Code)t(e);else{var i={Tags:[],statusCode:e.statusCode};e.headers&&(i.headers=e.headers),t(null,i)}else{var s=[];try{s=n.Tagging.TagSet.Tag||[]}catch(r){}s=o.clone(o.isArray(s)?s:[s]),t(null,{Tags:s,statusCode:n.statusCode,headers:n.headers})}}))},deleteObjectTagging:function(e,t){h.call(this,{Interface:"deleteObjectTagging",Action:"name/cos:DeleteObjectTagging",method:"DELETE",Bucket:e.Bucket,Region:e.Region,Key:e.Key,headers:e.Headers,action:"tagging",VersionId:e.VersionId,tracker:e.tracker},(function(e,n){return e&&204===e.statusCode?t(null,{statusCode:e.statusCode}):e?t(e):void t(null,{statusCode:n.statusCode,headers:n.headers})}))},appendObject:function(e,t){h.call(this,{Action:"name/cos:AppendObject",method:"POST",Bucket:e.Bucket,Region:e.Region,action:"append",Key:e.Key,body:e.Body,qs:{position:e.Position},headers:e.Headers,tracker:e.tracker},(function(e,n){if(e)return t(e);t(null,n)}))},uploadPartCopy:function(e,t){var n=e.CopySource||"",i=o.getSourceParams.call(this,n);if(i){var s=i.Bucket,r=i.Region,a=decodeURIComponent(i.Key);h.call(this,{Scope:[{action:"name/cos:GetObject",bucket:s,region:r,prefix:a},{action:"name/cos:PutObject",bucket:e.Bucket,region:e.Region,prefix:e.Key}],method:"PUT",Bucket:e.Bucket,Region:e.Region,Key:e.Key,VersionId:e.VersionId,qs:{partNumber:e.PartNumber,uploadId:e.UploadId},headers:e.Headers,tracker:e.tracker},(function(e,n){if(e)return t(e);var i=o.clone(n.CopyPartResult||{});o.extend(i,{statusCode:n.statusCode,headers:n.headers}),t(null,i)}))}else t({error:"CopySource format error"})},multipartInit:function(e,t){var n=e.Headers,i=e.tracker;n["Cache-Control"]||n["cache-control"]||(n["Cache-Control"]=""),n["Content-Type"]||n["content-type"]||(n["Content-Type"]=s.getType(e.Key)||"application/octet-stream"),h.call(this,{Action:"name/cos:InitiateMultipartUpload",method:"POST",Bucket:e.Bucket,Region:e.Region,Key:e.Key,action:"uploads",headers:e.Headers,qs:e.Query,tracker:i},(function(e,n){return e?(i&&i.parent&&i.parent.setParams({errorNode:"multipartInit"}),t(e)):(n=o.clone(n||{}))&&n.InitiateMultipartUploadResult?t(null,o.extend(n.InitiateMultipartUploadResult,{statusCode:n.statusCode,headers:n.headers})):void t(null,n)}))},multipartUpload:function(e,t){var n=this;o.getFileSize("multipartUpload",e,(function(){var i=e.tracker,s=n.options.UploadCheckContentMd5;s&&i&&i.setParams({md5StartTime:(new Date).getTime()}),o.getBodyMd5(s,e.Body,(function(r){r&&(e.Headers["Content-MD5"]=o.binaryBase64(r),s&&i&&i.setParams({md5EndTime:(new Date).getTime()})),i&&i.setParams({partNumber:e.PartNumber}),h.call(n,{Action:"name/cos:UploadPart",TaskId:e.TaskId,method:"PUT",Bucket:e.Bucket,Region:e.Region,Key:e.Key,qs:{partNumber:e.PartNumber,uploadId:e.UploadId},headers:e.Headers,onProgress:e.onProgress,body:e.Body||null,tracker:i},(function(e,n){if(e)return i&&i.parent&&i.parent.setParams({errorNode:"multipartUpload"}),t(e);t(null,{ETag:o.attr(n.headers,"etag",{}),statusCode:n.statusCode,headers:n.headers})}))}))}))},multipartComplete:function(e,t){for(var n=this,i=e.UploadId,s=e.Parts,r=e.tracker,a=0,l=s.length;a<l;a++)0!==s[a].ETag.indexOf('"')&&(s[a].ETag='"'+s[a].ETag+'"');var u=o.json2xml({CompleteMultipartUpload:{Part:s}}),p=e.Headers;p["Content-Type"]="application/xml",p["Content-MD5"]=o.binaryBase64(o.md5(u)),h.call(this,{Action:"name/cos:CompleteMultipartUpload",method:"POST",Bucket:e.Bucket,Region:e.Region,Key:e.Key,qs:{uploadId:i},body:u,headers:p,tracker:r},(function(i,s){if(i)return r&&r.parent&&r.parent.setParams({errorNode:"multipartComplete"}),t(i);var a=c({ForcePathStyle:n.options.ForcePathStyle,protocol:n.options.Protocol,domain:n.options.Domain,bucket:e.Bucket,region:n.options.UseAccelerate?"accelerate":e.Region,object:e.Key,isLocation:!0}),l=s.CompleteMultipartUploadResult||{},u=o.extend(l,{Location:a,statusCode:s.statusCode,headers:s.headers});t(null,u)}))},multipartList:function(e,t){var n={};n.delimiter=e.Delimiter,n["encoding-type"]=e.EncodingType,n.prefix=e.Prefix||"",n["max-uploads"]=e.MaxUploads,n["key-marker"]=e.KeyMarker,n["upload-id-marker"]=e.UploadIdMarker,n=o.clearKey(n);var i=e.tracker;i&&i.setParams({signStartTime:(new Date).getTime()}),h.call(this,{Action:"name/cos:ListMultipartUploads",ResourceKey:n.prefix,method:"GET",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,qs:n,action:"uploads",tracker:i},(function(e,n){if(e)return i&&i.parent&&i.parent.setParams({errorNode:"multipartList"}),t(e);if(n&&n.ListMultipartUploadsResult){var s=n.ListMultipartUploadsResult.Upload||[],r=n.ListMultipartUploadsResult.CommonPrefixes||[];r=o.isArray(r)?r:[r],s=o.isArray(s)?s:[s],n.ListMultipartUploadsResult.Upload=s,n.ListMultipartUploadsResult.CommonPrefixes=r}var a=o.clone(n.ListMultipartUploadsResult||{});o.extend(a,{statusCode:n.statusCode,headers:n.headers}),t(null,a)}))},multipartListPart:function(e,t){var n={},i=e.tracker;n.uploadId=e.UploadId,n["encoding-type"]=e.EncodingType,n["max-parts"]=e.MaxParts,n["part-number-marker"]=e.PartNumberMarker,h.call(this,{Action:"name/cos:ListParts",method:"GET",Bucket:e.Bucket,Region:e.Region,Key:e.Key,headers:e.Headers,qs:n,tracker:i},(function(e,n){if(e)return i&&i.parent&&i.parent.setParams({errorNode:"multipartListPart"}),t(e);var s=n.ListPartsResult||{},r=s.Part||[];r=o.isArray(r)?r:[r],s.Part=r;var a=o.clone(s);o.extend(a,{statusCode:n.statusCode,headers:n.headers}),t(null,a)}))},multipartAbort:function(e,t){var n={};n.uploadId=e.UploadId,h.call(this,{Action:"name/cos:AbortMultipartUpload",method:"DELETE",Bucket:e.Bucket,Region:e.Region,Key:e.Key,headers:e.Headers,qs:n,tracker:e.tracker},(function(e,n){if(e)return t(e);t(null,{statusCode:n.statusCode,headers:n.headers})}))},request:function(e,t){h.call(this,{method:e.Method,Bucket:e.Bucket,Region:e.Region,Key:e.Key,action:e.Action,headers:e.Headers,qs:e.Query,body:e.Body,Url:e.Url,rawBody:e.RawBody,dataType:e.DataType,tracker:e.tracker},(function(e,n){if(e)return t(e);n&&n.body&&(n.Body=n.body,delete n.body),t(e,n)}))},getObjectUrl:function(e,t){var n=this,i=void 0===e.UseAccelerate?n.options.UseAccelerate:e.UseAccelerate,s=c({ForcePathStyle:n.options.ForcePathStyle,protocol:e.Protocol||n.options.Protocol,domain:e.Domain||n.options.Domain,bucket:e.Bucket,region:i?"accelerate":e.Region,object:e.Key}),r="";e.Query&&(r+=o.obj2str(e.Query)),e.QueryString&&(r+=(r?"&":"")+e.QueryString);var a=s;if(void 0!==e.Sign&&!e.Sign)return r&&(a+="?"+r),t(null,{Url:a}),a;var p=l.call(this,{Bucket:e.Bucket,Region:e.Region,UseAccelerate:e.UseAccelerate,Url:s}),d=u.call(this,{Action:"PUT"===(e.Method||"").toUpperCase()?"name/cos:PutObject":"name/cos:GetObject",Bucket:e.Bucket||"",Region:e.Region||"",Method:e.Method||"get",Key:e.Key,Expires:e.Expires,Headers:e.Headers,Query:e.Query,SignHost:p,ForceSignHost:!1!==e.ForceSignHost&&n.options.ForceSignHost},(function(e,n){if(t)if(e)t(e);else{var i=s;i+="?"+(n.Authorization.indexOf("q-signature")>-1?(o=n.Authorization,a=o.match(/q-url-param-list.*?(?=&)/g)[0],c="q-url-param-list="+encodeURIComponent(a.replace(/q-url-param-list=/,"")).toLowerCase(),l=new RegExp(a,"g"),o.replace(l,c)):"sign="+encodeURIComponent(n.Authorization)),n.SecurityToken&&(i+="&x-cos-security-token="+n.SecurityToken),n.ClientIP&&(i+="&clientIP="+n.ClientIP),n.ClientUA&&(i+="&clientUA="+n.ClientUA),n.Token&&(i+="&token="+n.Token),r&&(i+="&"+r),setTimeout((function(){t(null,{Url:i})}))}var o,a,c,l}));return d?(a+="?"+d.Authorization+(d.SecurityToken?"&x-cos-security-token="+d.SecurityToken:""),r&&(a+="&"+r)):r&&(a+="?"+r),a},getAuth:function(e){return o.getAuth({SecretId:e.SecretId||this.options.SecretId||"",SecretKey:e.SecretKey||this.options.SecretKey||"",Bucket:e.Bucket,Region:e.Region,Method:e.Method,Key:e.Key,Query:e.Query,Headers:e.Headers,Expires:e.Expires,SystemClockOffset:this.options.SystemClockOffset})}};e.exports.init=function(e,t){t.transferToTaskMethod(m,"postObject"),t.transferToTaskMethod(m,"putObject"),o.each(m,(function(t,n){e.prototype[n]=o.apiWrapper(n,t)}))}},function(e,t){function n(e){return encodeURIComponent(e).replace(/!/g,"%21").replace(/'/g,"%27").replace(/\(/g,"%28").replace(/\)/g,"%29").replace(/\*/g,"%2A")}var i=function(e,t){var i,o,s,r=[],a=function(e,t){var i=[];for(var o in e)e.hasOwnProperty(o)&&i.push(t?n(o).toLowerCase():o);return i.sort((function(e,t){return(e=e.toLowerCase())===(t=t.toLowerCase())?0:e>t?1:-1}))}(e);for(i=0;i<a.length;i++)s=void 0===e[o=a[i]]||null===e[o]?"":""+e[o],o=t?n(o).toLowerCase():n(o),s=n(s)||"",r.push(o+"="+s);return r.join("&")};e.exports=function(e,t){var n,o=e.filePath,s=e.headers||{},r=e.url||e.Url,a=e.method,c=e.onProgress,l=e.httpDNSServiceId,u=function(e,n){var i=n.header,o={};if(i)for(var s in i)i.hasOwnProperty(s)&&(o[s.toLowerCase()]=i[s]);t(e,{statusCode:n.statusCode,headers:o},n.data)};if(o){var p,d=r.match(/^(https?:\/\/[^/]+\/)([^/]*\/?)(.*)$/);e.pathStyle?(p=decodeURIComponent(d[3]||""),r=d[1]+d[2]):(p=decodeURIComponent(d[2]+d[3]||""),r=d[1]);var h={key:p,success_action_status:200,Signature:s.Authorization},f=["Cache-Control","Content-Type","Content-Disposition","Content-Encoding","Expires","x-cos-storage-class","x-cos-security-token","x-ci-security-token"];for(var m in e.headers)e.headers.hasOwnProperty(m)&&(m.indexOf("x-cos-meta-")>-1||f.indexOf(m)>-1)&&(h[m]=e.headers[m]);s["x-cos-acl"]&&(h.acl=s["x-cos-acl"]),!h["Content-Type"]&&(h["Content-Type"]=""),(n=Mn.uploadFile({url:r,method:a,name:"file",header:s,filePath:o,formData:h,timeout:e.timeout,success:function(e){u(null,e)},fail:function(e){u(e.errMsg,e)}})).onProgressUpdate((function(e){c&&c({loaded:e.totalBytesSent,total:e.totalBytesExpectedToSend,progress:e.progress/100})}))}else{var g=e.qs&&i(e.qs)||"";g&&(r+=(r.indexOf("?")>-1?"&":"?")+g),s["Content-Length"]&&delete s["Content-Length"];var v={url:r,method:a,header:s,dataType:"text",data:e.body,responseType:e.dataType||"text",timeout:e.timeout,redirect:"manual",success:function(e){u(null,e)},fail:function(e){u(e.errMsg,e)}};l&&Object.assign(v,{enableHttpDNS:!0,httpDNSServiceId:l}),n=Mn.request(v)}return n}},function(e,t,n){let i=n(29);e.exports=new i(n(30),n(31))},function(e,t,n){function i(){this._types=Object.create(null),this._extensions=Object.create(null);for(let e=0;e<arguments.length;e++)this.define(arguments[e]);this.define=this.define.bind(this),this.getType=this.getType.bind(this),this.getExtension=this.getExtension.bind(this)}i.prototype.define=function(e,t){for(let n in e){let i=e[n].map((function(e){return e.toLowerCase()}));n=n.toLowerCase();for(let e=0;e<i.length;e++){const o=i[e];if("*"!==o[0]){if(!t&&o in this._types)throw new Error('Attempt to change mapping for "'+o+'" extension from "'+this._types[o]+'" to "'+n+'". Pass `force=true` to allow this, otherwise remove "'+o+'" from the list of extensions for "'+n+'".');this._types[o]=n}}if(t||!this._extensions[n]){const e=i[0];this._extensions[n]="*"!==e[0]?e:e.substr(1)}}},i.prototype.getType=function(e){let t=(e=String(e)).replace(/^.*[/\\]/,"").toLowerCase(),n=t.replace(/^.*\./,"").toLowerCase(),i=t.length<e.length;return(n.length<t.length-1||!i)&&this._types[n]||null},i.prototype.getExtension=function(e){return(e=/^\s*([^;\s]*)/.test(e)&&RegExp.$1)&&this._extensions[e.toLowerCase()]||null},e.exports=i},function(e,t){e.exports={"application/andrew-inset":["ez"],"application/applixware":["aw"],"application/atom+xml":["atom"],"application/atomcat+xml":["atomcat"],"application/atomdeleted+xml":["atomdeleted"],"application/atomsvc+xml":["atomsvc"],"application/atsc-dwd+xml":["dwd"],"application/atsc-held+xml":["held"],"application/atsc-rsat+xml":["rsat"],"application/bdoc":["bdoc"],"application/calendar+xml":["xcs"],"application/ccxml+xml":["ccxml"],"application/cdfx+xml":["cdfx"],"application/cdmi-capability":["cdmia"],"application/cdmi-container":["cdmic"],"application/cdmi-domain":["cdmid"],"application/cdmi-object":["cdmio"],"application/cdmi-queue":["cdmiq"],"application/cu-seeme":["cu"],"application/dash+xml":["mpd"],"application/davmount+xml":["davmount"],"application/docbook+xml":["dbk"],"application/dssc+der":["dssc"],"application/dssc+xml":["xdssc"],"application/ecmascript":["es","ecma"],"application/emma+xml":["emma"],"application/emotionml+xml":["emotionml"],"application/epub+zip":["epub"],"application/exi":["exi"],"application/express":["exp"],"application/fdt+xml":["fdt"],"application/font-tdpfr":["pfr"],"application/geo+json":["geojson"],"application/gml+xml":["gml"],"application/gpx+xml":["gpx"],"application/gxf":["gxf"],"application/gzip":["gz"],"application/hjson":["hjson"],"application/hyperstudio":["stk"],"application/inkml+xml":["ink","inkml"],"application/ipfix":["ipfix"],"application/its+xml":["its"],"application/java-archive":["jar","war","ear"],"application/java-serialized-object":["ser"],"application/java-vm":["class"],"application/javascript":["js","mjs"],"application/json":["json","map"],"application/json5":["json5"],"application/jsonml+json":["jsonml"],"application/ld+json":["jsonld"],"application/lgr+xml":["lgr"],"application/lost+xml":["lostxml"],"application/mac-binhex40":["hqx"],"application/mac-compactpro":["cpt"],"application/mads+xml":["mads"],"application/manifest+json":["webmanifest"],"application/marc":["mrc"],"application/marcxml+xml":["mrcx"],"application/mathematica":["ma","nb","mb"],"application/mathml+xml":["mathml"],"application/mbox":["mbox"],"application/mediaservercontrol+xml":["mscml"],"application/metalink+xml":["metalink"],"application/metalink4+xml":["meta4"],"application/mets+xml":["mets"],"application/mmt-aei+xml":["maei"],"application/mmt-usd+xml":["musd"],"application/mods+xml":["mods"],"application/mp21":["m21","mp21"],"application/mp4":["mp4s","m4p"],"application/msword":["doc","dot"],"application/mxf":["mxf"],"application/n-quads":["nq"],"application/n-triples":["nt"],"application/node":["cjs"],"application/octet-stream":["bin","dms","lrf","mar","so","dist","distz","pkg","bpk","dump","elc","deploy","exe","dll","deb","dmg","iso","img","msi","msp","msm","buffer"],"application/oda":["oda"],"application/oebps-package+xml":["opf"],"application/ogg":["ogx"],"application/omdoc+xml":["omdoc"],"application/onenote":["onetoc","onetoc2","onetmp","onepkg"],"application/oxps":["oxps"],"application/p2p-overlay+xml":["relo"],"application/patch-ops-error+xml":["xer"],"application/pdf":["pdf"],"application/pgp-encrypted":["pgp"],"application/pgp-signature":["asc","sig"],"application/pics-rules":["prf"],"application/pkcs10":["p10"],"application/pkcs7-mime":["p7m","p7c"],"application/pkcs7-signature":["p7s"],"application/pkcs8":["p8"],"application/pkix-attr-cert":["ac"],"application/pkix-cert":["cer"],"application/pkix-crl":["crl"],"application/pkix-pkipath":["pkipath"],"application/pkixcmp":["pki"],"application/pls+xml":["pls"],"application/postscript":["ai","eps","ps"],"application/provenance+xml":["provx"],"application/pskc+xml":["pskcxml"],"application/raml+yaml":["raml"],"application/rdf+xml":["rdf","owl"],"application/reginfo+xml":["rif"],"application/relax-ng-compact-syntax":["rnc"],"application/resource-lists+xml":["rl"],"application/resource-lists-diff+xml":["rld"],"application/rls-services+xml":["rs"],"application/route-apd+xml":["rapd"],"application/route-s-tsid+xml":["sls"],"application/route-usd+xml":["rusd"],"application/rpki-ghostbusters":["gbr"],"application/rpki-manifest":["mft"],"application/rpki-roa":["roa"],"application/rsd+xml":["rsd"],"application/rss+xml":["rss"],"application/rtf":["rtf"],"application/sbml+xml":["sbml"],"application/scvp-cv-request":["scq"],"application/scvp-cv-response":["scs"],"application/scvp-vp-request":["spq"],"application/scvp-vp-response":["spp"],"application/sdp":["sdp"],"application/senml+xml":["senmlx"],"application/sensml+xml":["sensmlx"],"application/set-payment-initiation":["setpay"],"application/set-registration-initiation":["setreg"],"application/shf+xml":["shf"],"application/sieve":["siv","sieve"],"application/smil+xml":["smi","smil"],"application/sparql-query":["rq"],"application/sparql-results+xml":["srx"],"application/srgs":["gram"],"application/srgs+xml":["grxml"],"application/sru+xml":["sru"],"application/ssdl+xml":["ssdl"],"application/ssml+xml":["ssml"],"application/swid+xml":["swidtag"],"application/tei+xml":["tei","teicorpus"],"application/thraud+xml":["tfi"],"application/timestamped-data":["tsd"],"application/toml":["toml"],"application/trig":["trig"],"application/ttml+xml":["ttml"],"application/ubjson":["ubj"],"application/urc-ressheet+xml":["rsheet"],"application/urc-targetdesc+xml":["td"],"application/voicexml+xml":["vxml"],"application/wasm":["wasm"],"application/widget":["wgt"],"application/winhlp":["hlp"],"application/wsdl+xml":["wsdl"],"application/wspolicy+xml":["wspolicy"],"application/xaml+xml":["xaml"],"application/xcap-att+xml":["xav"],"application/xcap-caps+xml":["xca"],"application/xcap-diff+xml":["xdf"],"application/xcap-el+xml":["xel"],"application/xcap-ns+xml":["xns"],"application/xenc+xml":["xenc"],"application/xhtml+xml":["xhtml","xht"],"application/xliff+xml":["xlf"],"application/xml":["xml","xsl","xsd","rng"],"application/xml-dtd":["dtd"],"application/xop+xml":["xop"],"application/xproc+xml":["xpl"],"application/xslt+xml":["*xsl","xslt"],"application/xspf+xml":["xspf"],"application/xv+xml":["mxml","xhvml","xvml","xvm"],"application/yang":["yang"],"application/yin+xml":["yin"],"application/zip":["zip"],"audio/3gpp":["*3gpp"],"audio/adpcm":["adp"],"audio/amr":["amr"],"audio/basic":["au","snd"],"audio/midi":["mid","midi","kar","rmi"],"audio/mobile-xmf":["mxmf"],"audio/mp3":["*mp3"],"audio/mp4":["m4a","mp4a"],"audio/mpeg":["mpga","mp2","mp2a","mp3","m2a","m3a"],"audio/ogg":["oga","ogg","spx","opus"],"audio/s3m":["s3m"],"audio/silk":["sil"],"audio/wav":["wav"],"audio/wave":["*wav"],"audio/webm":["weba"],"audio/xm":["xm"],"font/collection":["ttc"],"font/otf":["otf"],"font/ttf":["ttf"],"font/woff":["woff"],"font/woff2":["woff2"],"image/aces":["exr"],"image/apng":["apng"],"image/avif":["avif"],"image/bmp":["bmp"],"image/cgm":["cgm"],"image/dicom-rle":["drle"],"image/emf":["emf"],"image/fits":["fits"],"image/g3fax":["g3"],"image/gif":["gif"],"image/heic":["heic"],"image/heic-sequence":["heics"],"image/heif":["heif"],"image/heif-sequence":["heifs"],"image/hej2k":["hej2"],"image/hsj2":["hsj2"],"image/ief":["ief"],"image/jls":["jls"],"image/jp2":["jp2","jpg2"],"image/jpeg":["jpeg","jpg","jpe"],"image/jph":["jph"],"image/jphc":["jhc"],"image/jpm":["jpm"],"image/jpx":["jpx","jpf"],"image/jxr":["jxr"],"image/jxra":["jxra"],"image/jxrs":["jxrs"],"image/jxs":["jxs"],"image/jxsc":["jxsc"],"image/jxsi":["jxsi"],"image/jxss":["jxss"],"image/ktx":["ktx"],"image/ktx2":["ktx2"],"image/png":["png"],"image/sgi":["sgi"],"image/svg+xml":["svg","svgz"],"image/t38":["t38"],"image/tiff":["tif","tiff"],"image/tiff-fx":["tfx"],"image/webp":["webp"],"image/wmf":["wmf"],"message/disposition-notification":["disposition-notification"],"message/global":["u8msg"],"message/global-delivery-status":["u8dsn"],"message/global-disposition-notification":["u8mdn"],"message/global-headers":["u8hdr"],"message/rfc822":["eml","mime"],"model/3mf":["3mf"],"model/gltf+json":["gltf"],"model/gltf-binary":["glb"],"model/iges":["igs","iges"],"model/mesh":["msh","mesh","silo"],"model/mtl":["mtl"],"model/obj":["obj"],"model/step+xml":["stpx"],"model/step+zip":["stpz"],"model/step-xml+zip":["stpxz"],"model/stl":["stl"],"model/vrml":["wrl","vrml"],"model/x3d+binary":["*x3db","x3dbz"],"model/x3d+fastinfoset":["x3db"],"model/x3d+vrml":["*x3dv","x3dvz"],"model/x3d+xml":["x3d","x3dz"],"model/x3d-vrml":["x3dv"],"text/cache-manifest":["appcache","manifest"],"text/calendar":["ics","ifb"],"text/coffeescript":["coffee","litcoffee"],"text/css":["css"],"text/csv":["csv"],"text/html":["html","htm","shtml"],"text/jade":["jade"],"text/jsx":["jsx"],"text/less":["less"],"text/markdown":["markdown","md"],"text/mathml":["mml"],"text/mdx":["mdx"],"text/n3":["n3"],"text/plain":["txt","text","conf","def","list","log","in","ini"],"text/richtext":["rtx"],"text/rtf":["*rtf"],"text/sgml":["sgml","sgm"],"text/shex":["shex"],"text/slim":["slim","slm"],"text/spdx":["spdx"],"text/stylus":["stylus","styl"],"text/tab-separated-values":["tsv"],"text/troff":["t","tr","roff","man","me","ms"],"text/turtle":["ttl"],"text/uri-list":["uri","uris","urls"],"text/vcard":["vcard"],"text/vtt":["vtt"],"text/xml":["*xml"],"text/yaml":["yaml","yml"],"video/3gpp":["3gp","3gpp"],"video/3gpp2":["3g2"],"video/h261":["h261"],"video/h263":["h263"],"video/h264":["h264"],"video/iso.segment":["m4s"],"video/jpeg":["jpgv"],"video/jpm":["*jpm","jpgm"],"video/mj2":["mj2","mjp2"],"video/mp2t":["ts"],"video/mp4":["mp4","mp4v","mpg4"],"video/mpeg":["mpeg","mpg","mpe","m1v","m2v"],"video/ogg":["ogv"],"video/quicktime":["qt","mov"],"video/webm":["webm"]}},function(e,t){e.exports={"application/prs.cww":["cww"],"application/vnd.1000minds.decision-model+xml":["1km"],"application/vnd.3gpp.pic-bw-large":["plb"],"application/vnd.3gpp.pic-bw-small":["psb"],"application/vnd.3gpp.pic-bw-var":["pvb"],"application/vnd.3gpp2.tcap":["tcap"],"application/vnd.3m.post-it-notes":["pwn"],"application/vnd.accpac.simply.aso":["aso"],"application/vnd.accpac.simply.imp":["imp"],"application/vnd.acucobol":["acu"],"application/vnd.acucorp":["atc","acutc"],"application/vnd.adobe.air-application-installer-package+zip":["air"],"application/vnd.adobe.formscentral.fcdt":["fcdt"],"application/vnd.adobe.fxp":["fxp","fxpl"],"application/vnd.adobe.xdp+xml":["xdp"],"application/vnd.adobe.xfdf":["xfdf"],"application/vnd.ahead.space":["ahead"],"application/vnd.airzip.filesecure.azf":["azf"],"application/vnd.airzip.filesecure.azs":["azs"],"application/vnd.amazon.ebook":["azw"],"application/vnd.americandynamics.acc":["acc"],"application/vnd.amiga.ami":["ami"],"application/vnd.android.package-archive":["apk"],"application/vnd.anser-web-certificate-issue-initiation":["cii"],"application/vnd.anser-web-funds-transfer-initiation":["fti"],"application/vnd.antix.game-component":["atx"],"application/vnd.apple.installer+xml":["mpkg"],"application/vnd.apple.keynote":["key"],"application/vnd.apple.mpegurl":["m3u8"],"application/vnd.apple.numbers":["numbers"],"application/vnd.apple.pages":["pages"],"application/vnd.apple.pkpass":["pkpass"],"application/vnd.aristanetworks.swi":["swi"],"application/vnd.astraea-software.iota":["iota"],"application/vnd.audiograph":["aep"],"application/vnd.balsamiq.bmml+xml":["bmml"],"application/vnd.blueice.multipass":["mpm"],"application/vnd.bmi":["bmi"],"application/vnd.businessobjects":["rep"],"application/vnd.chemdraw+xml":["cdxml"],"application/vnd.chipnuts.karaoke-mmd":["mmd"],"application/vnd.cinderella":["cdy"],"application/vnd.citationstyles.style+xml":["csl"],"application/vnd.claymore":["cla"],"application/vnd.cloanto.rp9":["rp9"],"application/vnd.clonk.c4group":["c4g","c4d","c4f","c4p","c4u"],"application/vnd.cluetrust.cartomobile-config":["c11amc"],"application/vnd.cluetrust.cartomobile-config-pkg":["c11amz"],"application/vnd.commonspace":["csp"],"application/vnd.contact.cmsg":["cdbcmsg"],"application/vnd.cosmocaller":["cmc"],"application/vnd.crick.clicker":["clkx"],"application/vnd.crick.clicker.keyboard":["clkk"],"application/vnd.crick.clicker.palette":["clkp"],"application/vnd.crick.clicker.template":["clkt"],"application/vnd.crick.clicker.wordbank":["clkw"],"application/vnd.criticaltools.wbs+xml":["wbs"],"application/vnd.ctc-posml":["pml"],"application/vnd.cups-ppd":["ppd"],"application/vnd.curl.car":["car"],"application/vnd.curl.pcurl":["pcurl"],"application/vnd.dart":["dart"],"application/vnd.data-vision.rdz":["rdz"],"application/vnd.dbf":["dbf"],"application/vnd.dece.data":["uvf","uvvf","uvd","uvvd"],"application/vnd.dece.ttml+xml":["uvt","uvvt"],"application/vnd.dece.unspecified":["uvx","uvvx"],"application/vnd.dece.zip":["uvz","uvvz"],"application/vnd.denovo.fcselayout-link":["fe_launch"],"application/vnd.dna":["dna"],"application/vnd.dolby.mlp":["mlp"],"application/vnd.dpgraph":["dpg"],"application/vnd.dreamfactory":["dfac"],"application/vnd.ds-keypoint":["kpxx"],"application/vnd.dvb.ait":["ait"],"application/vnd.dvb.service":["svc"],"application/vnd.dynageo":["geo"],"application/vnd.ecowin.chart":["mag"],"application/vnd.enliven":["nml"],"application/vnd.epson.esf":["esf"],"application/vnd.epson.msf":["msf"],"application/vnd.epson.quickanime":["qam"],"application/vnd.epson.salt":["slt"],"application/vnd.epson.ssf":["ssf"],"application/vnd.eszigno3+xml":["es3","et3"],"application/vnd.ezpix-album":["ez2"],"application/vnd.ezpix-package":["ez3"],"application/vnd.fdf":["fdf"],"application/vnd.fdsn.mseed":["mseed"],"application/vnd.fdsn.seed":["seed","dataless"],"application/vnd.flographit":["gph"],"application/vnd.fluxtime.clip":["ftc"],"application/vnd.framemaker":["fm","frame","maker","book"],"application/vnd.frogans.fnc":["fnc"],"application/vnd.frogans.ltf":["ltf"],"application/vnd.fsc.weblaunch":["fsc"],"application/vnd.fujitsu.oasys":["oas"],"application/vnd.fujitsu.oasys2":["oa2"],"application/vnd.fujitsu.oasys3":["oa3"],"application/vnd.fujitsu.oasysgp":["fg5"],"application/vnd.fujitsu.oasysprs":["bh2"],"application/vnd.fujixerox.ddd":["ddd"],"application/vnd.fujixerox.docuworks":["xdw"],"application/vnd.fujixerox.docuworks.binder":["xbd"],"application/vnd.fuzzysheet":["fzs"],"application/vnd.genomatix.tuxedo":["txd"],"application/vnd.geogebra.file":["ggb"],"application/vnd.geogebra.tool":["ggt"],"application/vnd.geometry-explorer":["gex","gre"],"application/vnd.geonext":["gxt"],"application/vnd.geoplan":["g2w"],"application/vnd.geospace":["g3w"],"application/vnd.gmx":["gmx"],"application/vnd.google-apps.document":["gdoc"],"application/vnd.google-apps.presentation":["gslides"],"application/vnd.google-apps.spreadsheet":["gsheet"],"application/vnd.google-earth.kml+xml":["kml"],"application/vnd.google-earth.kmz":["kmz"],"application/vnd.grafeq":["gqf","gqs"],"application/vnd.groove-account":["gac"],"application/vnd.groove-help":["ghf"],"application/vnd.groove-identity-message":["gim"],"application/vnd.groove-injector":["grv"],"application/vnd.groove-tool-message":["gtm"],"application/vnd.groove-tool-template":["tpl"],"application/vnd.groove-vcard":["vcg"],"application/vnd.hal+xml":["hal"],"application/vnd.handheld-entertainment+xml":["zmm"],"application/vnd.hbci":["hbci"],"application/vnd.hhe.lesson-player":["les"],"application/vnd.hp-hpgl":["hpgl"],"application/vnd.hp-hpid":["hpid"],"application/vnd.hp-hps":["hps"],"application/vnd.hp-jlyt":["jlt"],"application/vnd.hp-pcl":["pcl"],"application/vnd.hp-pclxl":["pclxl"],"application/vnd.hydrostatix.sof-data":["sfd-hdstx"],"application/vnd.ibm.minipay":["mpy"],"application/vnd.ibm.modcap":["afp","listafp","list3820"],"application/vnd.ibm.rights-management":["irm"],"application/vnd.ibm.secure-container":["sc"],"application/vnd.iccprofile":["icc","icm"],"application/vnd.igloader":["igl"],"application/vnd.immervision-ivp":["ivp"],"application/vnd.immervision-ivu":["ivu"],"application/vnd.insors.igm":["igm"],"application/vnd.intercon.formnet":["xpw","xpx"],"application/vnd.intergeo":["i2g"],"application/vnd.intu.qbo":["qbo"],"application/vnd.intu.qfx":["qfx"],"application/vnd.ipunplugged.rcprofile":["rcprofile"],"application/vnd.irepository.package+xml":["irp"],"application/vnd.is-xpr":["xpr"],"application/vnd.isac.fcs":["fcs"],"application/vnd.jam":["jam"],"application/vnd.jcp.javame.midlet-rms":["rms"],"application/vnd.jisp":["jisp"],"application/vnd.joost.joda-archive":["joda"],"application/vnd.kahootz":["ktz","ktr"],"application/vnd.kde.karbon":["karbon"],"application/vnd.kde.kchart":["chrt"],"application/vnd.kde.kformula":["kfo"],"application/vnd.kde.kivio":["flw"],"application/vnd.kde.kontour":["kon"],"application/vnd.kde.kpresenter":["kpr","kpt"],"application/vnd.kde.kspread":["ksp"],"application/vnd.kde.kword":["kwd","kwt"],"application/vnd.kenameaapp":["htke"],"application/vnd.kidspiration":["kia"],"application/vnd.kinar":["kne","knp"],"application/vnd.koan":["skp","skd","skt","skm"],"application/vnd.kodak-descriptor":["sse"],"application/vnd.las.las+xml":["lasxml"],"application/vnd.llamagraphics.life-balance.desktop":["lbd"],"application/vnd.llamagraphics.life-balance.exchange+xml":["lbe"],"application/vnd.lotus-1-2-3":["123"],"application/vnd.lotus-approach":["apr"],"application/vnd.lotus-freelance":["pre"],"application/vnd.lotus-notes":["nsf"],"application/vnd.lotus-organizer":["org"],"application/vnd.lotus-screencam":["scm"],"application/vnd.lotus-wordpro":["lwp"],"application/vnd.macports.portpkg":["portpkg"],"application/vnd.mapbox-vector-tile":["mvt"],"application/vnd.mcd":["mcd"],"application/vnd.medcalcdata":["mc1"],"application/vnd.mediastation.cdkey":["cdkey"],"application/vnd.mfer":["mwf"],"application/vnd.mfmp":["mfm"],"application/vnd.micrografx.flo":["flo"],"application/vnd.micrografx.igx":["igx"],"application/vnd.mif":["mif"],"application/vnd.mobius.daf":["daf"],"application/vnd.mobius.dis":["dis"],"application/vnd.mobius.mbk":["mbk"],"application/vnd.mobius.mqy":["mqy"],"application/vnd.mobius.msl":["msl"],"application/vnd.mobius.plc":["plc"],"application/vnd.mobius.txf":["txf"],"application/vnd.mophun.application":["mpn"],"application/vnd.mophun.certificate":["mpc"],"application/vnd.mozilla.xul+xml":["xul"],"application/vnd.ms-artgalry":["cil"],"application/vnd.ms-cab-compressed":["cab"],"application/vnd.ms-excel":["xls","xlm","xla","xlc","xlt","xlw"],"application/vnd.ms-excel.addin.macroenabled.12":["xlam"],"application/vnd.ms-excel.sheet.binary.macroenabled.12":["xlsb"],"application/vnd.ms-excel.sheet.macroenabled.12":["xlsm"],"application/vnd.ms-excel.template.macroenabled.12":["xltm"],"application/vnd.ms-fontobject":["eot"],"application/vnd.ms-htmlhelp":["chm"],"application/vnd.ms-ims":["ims"],"application/vnd.ms-lrm":["lrm"],"application/vnd.ms-officetheme":["thmx"],"application/vnd.ms-outlook":["msg"],"application/vnd.ms-pki.seccat":["cat"],"application/vnd.ms-pki.stl":["*stl"],"application/vnd.ms-powerpoint":["ppt","pps","pot"],"application/vnd.ms-powerpoint.addin.macroenabled.12":["ppam"],"application/vnd.ms-powerpoint.presentation.macroenabled.12":["pptm"],"application/vnd.ms-powerpoint.slide.macroenabled.12":["sldm"],"application/vnd.ms-powerpoint.slideshow.macroenabled.12":["ppsm"],"application/vnd.ms-powerpoint.template.macroenabled.12":["potm"],"application/vnd.ms-project":["mpp","mpt"],"application/vnd.ms-word.document.macroenabled.12":["docm"],"application/vnd.ms-word.template.macroenabled.12":["dotm"],"application/vnd.ms-works":["wps","wks","wcm","wdb"],"application/vnd.ms-wpl":["wpl"],"application/vnd.ms-xpsdocument":["xps"],"application/vnd.mseq":["mseq"],"application/vnd.musician":["mus"],"application/vnd.muvee.style":["msty"],"application/vnd.mynfc":["taglet"],"application/vnd.neurolanguage.nlu":["nlu"],"application/vnd.nitf":["ntf","nitf"],"application/vnd.noblenet-directory":["nnd"],"application/vnd.noblenet-sealer":["nns"],"application/vnd.noblenet-web":["nnw"],"application/vnd.nokia.n-gage.ac+xml":["*ac"],"application/vnd.nokia.n-gage.data":["ngdat"],"application/vnd.nokia.n-gage.symbian.install":["n-gage"],"application/vnd.nokia.radio-preset":["rpst"],"application/vnd.nokia.radio-presets":["rpss"],"application/vnd.novadigm.edm":["edm"],"application/vnd.novadigm.edx":["edx"],"application/vnd.novadigm.ext":["ext"],"application/vnd.oasis.opendocument.chart":["odc"],"application/vnd.oasis.opendocument.chart-template":["otc"],"application/vnd.oasis.opendocument.database":["odb"],"application/vnd.oasis.opendocument.formula":["odf"],"application/vnd.oasis.opendocument.formula-template":["odft"],"application/vnd.oasis.opendocument.graphics":["odg"],"application/vnd.oasis.opendocument.graphics-template":["otg"],"application/vnd.oasis.opendocument.image":["odi"],"application/vnd.oasis.opendocument.image-template":["oti"],"application/vnd.oasis.opendocument.presentation":["odp"],"application/vnd.oasis.opendocument.presentation-template":["otp"],"application/vnd.oasis.opendocument.spreadsheet":["ods"],"application/vnd.oasis.opendocument.spreadsheet-template":["ots"],"application/vnd.oasis.opendocument.text":["odt"],"application/vnd.oasis.opendocument.text-master":["odm"],"application/vnd.oasis.opendocument.text-template":["ott"],"application/vnd.oasis.opendocument.text-web":["oth"],"application/vnd.olpc-sugar":["xo"],"application/vnd.oma.dd2+xml":["dd2"],"application/vnd.openblox.game+xml":["obgx"],"application/vnd.openofficeorg.extension":["oxt"],"application/vnd.openstreetmap.data+xml":["osm"],"application/vnd.openxmlformats-officedocument.presentationml.presentation":["pptx"],"application/vnd.openxmlformats-officedocument.presentationml.slide":["sldx"],"application/vnd.openxmlformats-officedocument.presentationml.slideshow":["ppsx"],"application/vnd.openxmlformats-officedocument.presentationml.template":["potx"],"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":["xlsx"],"application/vnd.openxmlformats-officedocument.spreadsheetml.template":["xltx"],"application/vnd.openxmlformats-officedocument.wordprocessingml.document":["docx"],"application/vnd.openxmlformats-officedocument.wordprocessingml.template":["dotx"],"application/vnd.osgeo.mapguide.package":["mgp"],"application/vnd.osgi.dp":["dp"],"application/vnd.osgi.subsystem":["esa"],"application/vnd.palm":["pdb","pqa","oprc"],"application/vnd.pawaafile":["paw"],"application/vnd.pg.format":["str"],"application/vnd.pg.osasli":["ei6"],"application/vnd.picsel":["efif"],"application/vnd.pmi.widget":["wg"],"application/vnd.pocketlearn":["plf"],"application/vnd.powerbuilder6":["pbd"],"application/vnd.previewsystems.box":["box"],"application/vnd.proteus.magazine":["mgz"],"application/vnd.publishare-delta-tree":["qps"],"application/vnd.pvi.ptid1":["ptid"],"application/vnd.quark.quarkxpress":["qxd","qxt","qwd","qwt","qxl","qxb"],"application/vnd.rar":["rar"],"application/vnd.realvnc.bed":["bed"],"application/vnd.recordare.musicxml":["mxl"],"application/vnd.recordare.musicxml+xml":["musicxml"],"application/vnd.rig.cryptonote":["cryptonote"],"application/vnd.rim.cod":["cod"],"application/vnd.rn-realmedia":["rm"],"application/vnd.rn-realmedia-vbr":["rmvb"],"application/vnd.route66.link66+xml":["link66"],"application/vnd.sailingtracker.track":["st"],"application/vnd.seemail":["see"],"application/vnd.sema":["sema"],"application/vnd.semd":["semd"],"application/vnd.semf":["semf"],"application/vnd.shana.informed.formdata":["ifm"],"application/vnd.shana.informed.formtemplate":["itp"],"application/vnd.shana.informed.interchange":["iif"],"application/vnd.shana.informed.package":["ipk"],"application/vnd.simtech-mindmapper":["twd","twds"],"application/vnd.smaf":["mmf"],"application/vnd.smart.teacher":["teacher"],"application/vnd.software602.filler.form+xml":["fo"],"application/vnd.solent.sdkm+xml":["sdkm","sdkd"],"application/vnd.spotfire.dxp":["dxp"],"application/vnd.spotfire.sfs":["sfs"],"application/vnd.stardivision.calc":["sdc"],"application/vnd.stardivision.draw":["sda"],"application/vnd.stardivision.impress":["sdd"],"application/vnd.stardivision.math":["smf"],"application/vnd.stardivision.writer":["sdw","vor"],"application/vnd.stardivision.writer-global":["sgl"],"application/vnd.stepmania.package":["smzip"],"application/vnd.stepmania.stepchart":["sm"],"application/vnd.sun.wadl+xml":["wadl"],"application/vnd.sun.xml.calc":["sxc"],"application/vnd.sun.xml.calc.template":["stc"],"application/vnd.sun.xml.draw":["sxd"],"application/vnd.sun.xml.draw.template":["std"],"application/vnd.sun.xml.impress":["sxi"],"application/vnd.sun.xml.impress.template":["sti"],"application/vnd.sun.xml.math":["sxm"],"application/vnd.sun.xml.writer":["sxw"],"application/vnd.sun.xml.writer.global":["sxg"],"application/vnd.sun.xml.writer.template":["stw"],"application/vnd.sus-calendar":["sus","susp"],"application/vnd.svd":["svd"],"application/vnd.symbian.install":["sis","sisx"],"application/vnd.syncml+xml":["xsm"],"application/vnd.syncml.dm+wbxml":["bdm"],"application/vnd.syncml.dm+xml":["xdm"],"application/vnd.syncml.dmddf+xml":["ddf"],"application/vnd.tao.intent-module-archive":["tao"],"application/vnd.tcpdump.pcap":["pcap","cap","dmp"],"application/vnd.tmobile-livetv":["tmo"],"application/vnd.trid.tpt":["tpt"],"application/vnd.triscape.mxs":["mxs"],"application/vnd.trueapp":["tra"],"application/vnd.ufdl":["ufd","ufdl"],"application/vnd.uiq.theme":["utz"],"application/vnd.umajin":["umj"],"application/vnd.unity":["unityweb"],"application/vnd.uoml+xml":["uoml"],"application/vnd.vcx":["vcx"],"application/vnd.visio":["vsd","vst","vss","vsw"],"application/vnd.visionary":["vis"],"application/vnd.vsf":["vsf"],"application/vnd.wap.wbxml":["wbxml"],"application/vnd.wap.wmlc":["wmlc"],"application/vnd.wap.wmlscriptc":["wmlsc"],"application/vnd.webturbo":["wtb"],"application/vnd.wolfram.player":["nbp"],"application/vnd.wordperfect":["wpd"],"application/vnd.wqd":["wqd"],"application/vnd.wt.stf":["stf"],"application/vnd.xara":["xar"],"application/vnd.xfdl":["xfdl"],"application/vnd.yamaha.hv-dic":["hvd"],"application/vnd.yamaha.hv-script":["hvs"],"application/vnd.yamaha.hv-voice":["hvp"],"application/vnd.yamaha.openscoreformat":["osf"],"application/vnd.yamaha.openscoreformat.osfpvg+xml":["osfpvg"],"application/vnd.yamaha.smaf-audio":["saf"],"application/vnd.yamaha.smaf-phrase":["spf"],"application/vnd.yellowriver-custom-menu":["cmp"],"application/vnd.zul":["zir","zirz"],"application/vnd.zzazz.deck+xml":["zaz"],"application/x-7z-compressed":["7z"],"application/x-abiword":["abw"],"application/x-ace-compressed":["ace"],"application/x-apple-diskimage":["*dmg"],"application/x-arj":["arj"],"application/x-authorware-bin":["aab","x32","u32","vox"],"application/x-authorware-map":["aam"],"application/x-authorware-seg":["aas"],"application/x-bcpio":["bcpio"],"application/x-bdoc":["*bdoc"],"application/x-bittorrent":["torrent"],"application/x-blorb":["blb","blorb"],"application/x-bzip":["bz"],"application/x-bzip2":["bz2","boz"],"application/x-cbr":["cbr","cba","cbt","cbz","cb7"],"application/x-cdlink":["vcd"],"application/x-cfs-compressed":["cfs"],"application/x-chat":["chat"],"application/x-chess-pgn":["pgn"],"application/x-chrome-extension":["crx"],"application/x-cocoa":["cco"],"application/x-conference":["nsc"],"application/x-cpio":["cpio"],"application/x-csh":["csh"],"application/x-debian-package":["*deb","udeb"],"application/x-dgc-compressed":["dgc"],"application/x-director":["dir","dcr","dxr","cst","cct","cxt","w3d","fgd","swa"],"application/x-doom":["wad"],"application/x-dtbncx+xml":["ncx"],"application/x-dtbook+xml":["dtb"],"application/x-dtbresource+xml":["res"],"application/x-dvi":["dvi"],"application/x-envoy":["evy"],"application/x-eva":["eva"],"application/x-font-bdf":["bdf"],"application/x-font-ghostscript":["gsf"],"application/x-font-linux-psf":["psf"],"application/x-font-pcf":["pcf"],"application/x-font-snf":["snf"],"application/x-font-type1":["pfa","pfb","pfm","afm"],"application/x-freearc":["arc"],"application/x-futuresplash":["spl"],"application/x-gca-compressed":["gca"],"application/x-glulx":["ulx"],"application/x-gnumeric":["gnumeric"],"application/x-gramps-xml":["gramps"],"application/x-gtar":["gtar"],"application/x-hdf":["hdf"],"application/x-httpd-php":["php"],"application/x-install-instructions":["install"],"application/x-iso9660-image":["*iso"],"application/x-iwork-keynote-sffkey":["*key"],"application/x-iwork-numbers-sffnumbers":["*numbers"],"application/x-iwork-pages-sffpages":["*pages"],"application/x-java-archive-diff":["jardiff"],"application/x-java-jnlp-file":["jnlp"],"application/x-keepass2":["kdbx"],"application/x-latex":["latex"],"application/x-lua-bytecode":["luac"],"application/x-lzh-compressed":["lzh","lha"],"application/x-makeself":["run"],"application/x-mie":["mie"],"application/x-mobipocket-ebook":["prc","mobi"],"application/x-ms-application":["application"],"application/x-ms-shortcut":["lnk"],"application/x-ms-wmd":["wmd"],"application/x-ms-wmz":["wmz"],"application/x-ms-xbap":["xbap"],"application/x-msaccess":["mdb"],"application/x-msbinder":["obd"],"application/x-mscardfile":["crd"],"application/x-msclip":["clp"],"application/x-msdos-program":["*exe"],"application/x-msdownload":["*exe","*dll","com","bat","*msi"],"application/x-msmediaview":["mvb","m13","m14"],"application/x-msmetafile":["*wmf","*wmz","*emf","emz"],"application/x-msmoney":["mny"],"application/x-mspublisher":["pub"],"application/x-msschedule":["scd"],"application/x-msterminal":["trm"],"application/x-mswrite":["wri"],"application/x-netcdf":["nc","cdf"],"application/x-ns-proxy-autoconfig":["pac"],"application/x-nzb":["nzb"],"application/x-perl":["pl","pm"],"application/x-pilot":["*prc","*pdb"],"application/x-pkcs12":["p12","pfx"],"application/x-pkcs7-certificates":["p7b","spc"],"application/x-pkcs7-certreqresp":["p7r"],"application/x-rar-compressed":["*rar"],"application/x-redhat-package-manager":["rpm"],"application/x-research-info-systems":["ris"],"application/x-sea":["sea"],"application/x-sh":["sh"],"application/x-shar":["shar"],"application/x-shockwave-flash":["swf"],"application/x-silverlight-app":["xap"],"application/x-sql":["sql"],"application/x-stuffit":["sit"],"application/x-stuffitx":["sitx"],"application/x-subrip":["srt"],"application/x-sv4cpio":["sv4cpio"],"application/x-sv4crc":["sv4crc"],"application/x-t3vm-image":["t3"],"application/x-tads":["gam"],"application/x-tar":["tar"],"application/x-tcl":["tcl","tk"],"application/x-tex":["tex"],"application/x-tex-tfm":["tfm"],"application/x-texinfo":["texinfo","texi"],"application/x-tgif":["*obj"],"application/x-ustar":["ustar"],"application/x-virtualbox-hdd":["hdd"],"application/x-virtualbox-ova":["ova"],"application/x-virtualbox-ovf":["ovf"],"application/x-virtualbox-vbox":["vbox"],"application/x-virtualbox-vbox-extpack":["vbox-extpack"],"application/x-virtualbox-vdi":["vdi"],"application/x-virtualbox-vhd":["vhd"],"application/x-virtualbox-vmdk":["vmdk"],"application/x-wais-source":["src"],"application/x-web-app-manifest+json":["webapp"],"application/x-x509-ca-cert":["der","crt","pem"],"application/x-xfig":["fig"],"application/x-xliff+xml":["*xlf"],"application/x-xpinstall":["xpi"],"application/x-xz":["xz"],"application/x-zmachine":["z1","z2","z3","z4","z5","z6","z7","z8"],"audio/vnd.dece.audio":["uva","uvva"],"audio/vnd.digital-winds":["eol"],"audio/vnd.dra":["dra"],"audio/vnd.dts":["dts"],"audio/vnd.dts.hd":["dtshd"],"audio/vnd.lucent.voice":["lvp"],"audio/vnd.ms-playready.media.pya":["pya"],"audio/vnd.nuera.ecelp4800":["ecelp4800"],"audio/vnd.nuera.ecelp7470":["ecelp7470"],"audio/vnd.nuera.ecelp9600":["ecelp9600"],"audio/vnd.rip":["rip"],"audio/x-aac":["aac"],"audio/x-aiff":["aif","aiff","aifc"],"audio/x-caf":["caf"],"audio/x-flac":["flac"],"audio/x-m4a":["*m4a"],"audio/x-matroska":["mka"],"audio/x-mpegurl":["m3u"],"audio/x-ms-wax":["wax"],"audio/x-ms-wma":["wma"],"audio/x-pn-realaudio":["ram","ra"],"audio/x-pn-realaudio-plugin":["rmp"],"audio/x-realaudio":["*ra"],"audio/x-wav":["*wav"],"chemical/x-cdx":["cdx"],"chemical/x-cif":["cif"],"chemical/x-cmdf":["cmdf"],"chemical/x-cml":["cml"],"chemical/x-csml":["csml"],"chemical/x-xyz":["xyz"],"image/prs.btif":["btif"],"image/prs.pti":["pti"],"image/vnd.adobe.photoshop":["psd"],"image/vnd.airzip.accelerator.azv":["azv"],"image/vnd.dece.graphic":["uvi","uvvi","uvg","uvvg"],"image/vnd.djvu":["djvu","djv"],"image/vnd.dvb.subtitle":["*sub"],"image/vnd.dwg":["dwg"],"image/vnd.dxf":["dxf"],"image/vnd.fastbidsheet":["fbs"],"image/vnd.fpx":["fpx"],"image/vnd.fst":["fst"],"image/vnd.fujixerox.edmics-mmr":["mmr"],"image/vnd.fujixerox.edmics-rlc":["rlc"],"image/vnd.microsoft.icon":["ico"],"image/vnd.ms-dds":["dds"],"image/vnd.ms-modi":["mdi"],"image/vnd.ms-photo":["wdp"],"image/vnd.net-fpx":["npx"],"image/vnd.pco.b16":["b16"],"image/vnd.tencent.tap":["tap"],"image/vnd.valve.source.texture":["vtf"],"image/vnd.wap.wbmp":["wbmp"],"image/vnd.xiff":["xif"],"image/vnd.zbrush.pcx":["pcx"],"image/x-3ds":["3ds"],"image/x-cmu-raster":["ras"],"image/x-cmx":["cmx"],"image/x-freehand":["fh","fhc","fh4","fh5","fh7"],"image/x-icon":["*ico"],"image/x-jng":["jng"],"image/x-mrsid-image":["sid"],"image/x-ms-bmp":["*bmp"],"image/x-pcx":["*pcx"],"image/x-pict":["pic","pct"],"image/x-portable-anymap":["pnm"],"image/x-portable-bitmap":["pbm"],"image/x-portable-graymap":["pgm"],"image/x-portable-pixmap":["ppm"],"image/x-rgb":["rgb"],"image/x-tga":["tga"],"image/x-xbitmap":["xbm"],"image/x-xpixmap":["xpm"],"image/x-xwindowdump":["xwd"],"message/vnd.wfa.wsc":["wsc"],"model/vnd.collada+xml":["dae"],"model/vnd.dwf":["dwf"],"model/vnd.gdl":["gdl"],"model/vnd.gtw":["gtw"],"model/vnd.mts":["mts"],"model/vnd.opengex":["ogex"],"model/vnd.parasolid.transmit.binary":["x_b"],"model/vnd.parasolid.transmit.text":["x_t"],"model/vnd.sap.vds":["vds"],"model/vnd.usdz+zip":["usdz"],"model/vnd.valve.source.compiled-map":["bsp"],"model/vnd.vtu":["vtu"],"text/prs.lines.tag":["dsc"],"text/vnd.curl":["curl"],"text/vnd.curl.dcurl":["dcurl"],"text/vnd.curl.mcurl":["mcurl"],"text/vnd.curl.scurl":["scurl"],"text/vnd.dvb.subtitle":["sub"],"text/vnd.fly":["fly"],"text/vnd.fmi.flexstor":["flx"],"text/vnd.graphviz":["gv"],"text/vnd.in3d.3dml":["3dml"],"text/vnd.in3d.spot":["spot"],"text/vnd.sun.j2me.app-descriptor":["jad"],"text/vnd.wap.wml":["wml"],"text/vnd.wap.wmlscript":["wmls"],"text/x-asm":["s","asm"],"text/x-c":["c","cc","cxx","cpp","h","hh","dic"],"text/x-component":["htc"],"text/x-fortran":["f","for","f77","f90"],"text/x-handlebars-template":["hbs"],"text/x-java-source":["java"],"text/x-lua":["lua"],"text/x-markdown":["mkd"],"text/x-nfo":["nfo"],"text/x-opml":["opml"],"text/x-org":["*org"],"text/x-pascal":["p","pas"],"text/x-processing":["pde"],"text/x-sass":["sass"],"text/x-scss":["scss"],"text/x-setext":["etx"],"text/x-sfv":["sfv"],"text/x-suse-ymp":["ymp"],"text/x-uuencode":["uu"],"text/x-vcalendar":["vcs"],"text/x-vcard":["vcf"],"video/vnd.dece.hd":["uvh","uvvh"],"video/vnd.dece.mobile":["uvm","uvvm"],"video/vnd.dece.pd":["uvp","uvvp"],"video/vnd.dece.sd":["uvs","uvvs"],"video/vnd.dece.video":["uvv","uvvv"],"video/vnd.dvb.file":["dvb"],"video/vnd.fvt":["fvt"],"video/vnd.mpegurl":["mxu","m4u"],"video/vnd.ms-playready.media.pyv":["pyv"],"video/vnd.uvvu.mp4":["uvu","uvvu"],"video/vnd.vivo":["viv"],"video/x-f4v":["f4v"],"video/x-fli":["fli"],"video/x-flv":["flv"],"video/x-m4v":["m4v"],"video/x-matroska":["mkv","mk3d","mks"],"video/x-mng":["mng"],"video/x-ms-asf":["asf","asx"],"video/x-ms-vob":["vob"],"video/x-ms-wm":["wm"],"video/x-ms-wmv":["wmv"],"video/x-ms-wmx":["wmx"],"video/x-ms-wvx":["wvx"],"video/x-msvideo":["avi"],"video/x-sgi-movie":["movie"],"video/x-smv":["smv"],"x-conference/x-cooltalk":["ice"]}},function(e,t,n){function i(){
/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */
i=function(){return t};var e,t={},n=Object.prototype,s=n.hasOwnProperty,r=Object.defineProperty||function(e,t,n){e[t]=n.value},a="function"==typeof Symbol?Symbol:{},c=a.iterator||"@@iterator",l=a.asyncIterator||"@@asyncIterator",u=a.toStringTag||"@@toStringTag";function p(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{p({},"")}catch(N){p=function(e,t,n){return e[t]=n}}function d(e,t,n,i){var o=t&&t.prototype instanceof b?t:b,s=Object.create(o.prototype),a=new P(i||[]);return r(s,"_invoke",{value:_(e,n,a)}),s}function h(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(i){return{type:"throw",arg:i}}}t.wrap=d;var f="suspendedStart",m="suspendedYield",g="executing",v="completed",y={};function b(){}function x(){}function S(){}var k={};p(k,c,(function(){return this}));var C=Object.getPrototypeOf,w=C&&C(C(M([])));w&&w!==n&&s.call(w,c)&&(k=w);var E=S.prototype=b.prototype=Object.create(k);function T(e){["next","throw","return"].forEach((function(t){p(e,t,(function(e){return this._invoke(t,e)}))}))}function I(e,t){function n(i,r,a,c){var l=h(e[i],e,r);if("throw"!==l.type){var u=l.arg,p=u.value;return p&&"object"==o(p)&&s.call(p,"__await")?t.resolve(p.__await).then((function(e){n("next",e,a,c)}),(function(e){n("throw",e,a,c)})):t.resolve(p).then((function(e){u.value=e,a(u)}),(function(e){return n("throw",e,a,c)}))}c(l.arg)}var i;r(this,"_invoke",{value:function(e,o){function s(){return new t((function(t,i){n(e,o,t,i)}))}return i=i?i.then(s,s):s()}})}function _(t,n,i){var o=f;return function(s,r){if(o===g)throw Error("Generator is already running");if(o===v){if("throw"===s)throw r;return{value:e,done:!0}}for(i.method=s,i.arg=r;;){var a=i.delegate;if(a){var c=O(a,i);if(c){if(c===y)continue;return c}}if("next"===i.method)i.sent=i._sent=i.arg;else if("throw"===i.method){if(o===f)throw o=v,i.arg;i.dispatchException(i.arg)}else"return"===i.method&&i.abrupt("return",i.arg);o=g;var l=h(t,n,i);if("normal"===l.type){if(o=i.done?v:m,l.arg===y)continue;return{value:l.arg,done:i.done}}"throw"===l.type&&(o=v,i.method="throw",i.arg=l.arg)}}}function O(t,n){var i=n.method,o=t.iterator[i];if(o===e)return n.delegate=null,"throw"===i&&t.iterator.return&&(n.method="return",n.arg=e,O(t,n),"throw"===n.method)||"return"!==i&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+i+"' method")),y;var s=h(o,t.iterator,n.arg);if("throw"===s.type)return n.method="throw",n.arg=s.arg,n.delegate=null,y;var r=s.arg;return r?r.done?(n[t.resultName]=r.value,n.next=t.nextLoc,"return"!==n.method&&(n.method="next",n.arg=e),n.delegate=null,y):r:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,y)}function A(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function R(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function P(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(A,this),this.reset(!0)}function M(t){if(t||""===t){var n=t[c];if(n)return n.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var i=-1,r=function n(){for(;++i<t.length;)if(s.call(t,i))return n.value=t[i],n.done=!1,n;return n.value=e,n.done=!0,n};return r.next=r}}throw new TypeError(o(t)+" is not iterable")}return x.prototype=S,r(E,"constructor",{value:S,configurable:!0}),r(S,"constructor",{value:x,configurable:!0}),x.displayName=p(S,u,"GeneratorFunction"),t.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===x||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,S):(e.__proto__=S,p(e,u,"GeneratorFunction")),e.prototype=Object.create(E),e},t.awrap=function(e){return{__await:e}},T(I.prototype),p(I.prototype,l,(function(){return this})),t.AsyncIterator=I,t.async=function(e,n,i,o,s){void 0===s&&(s=Promise);var r=new I(d(e,n,i,o),s);return t.isGeneratorFunction(n)?r:r.next().then((function(e){return e.done?e.value:r.next()}))},T(E),p(E,u,"Generator"),p(E,c,(function(){return this})),p(E,"toString",(function(){return"[object Generator]"})),t.keys=function(e){var t=Object(e),n=[];for(var i in t)n.push(i);return n.reverse(),function e(){for(;n.length;){var i=n.pop();if(i in t)return e.value=i,e.done=!1,e}return e.done=!0,e}},t.values=M,P.prototype={constructor:P,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(R),!t)for(var n in this)"t"===n.charAt(0)&&s.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=e)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var n=this;function i(i,o){return a.type="throw",a.arg=t,n.next=i,o&&(n.method="next",n.arg=e),!!o}for(var o=this.tryEntries.length-1;o>=0;--o){var r=this.tryEntries[o],a=r.completion;if("root"===r.tryLoc)return i("end");if(r.tryLoc<=this.prev){var c=s.call(r,"catchLoc"),l=s.call(r,"finallyLoc");if(c&&l){if(this.prev<r.catchLoc)return i(r.catchLoc,!0);if(this.prev<r.finallyLoc)return i(r.finallyLoc)}else if(c){if(this.prev<r.catchLoc)return i(r.catchLoc,!0)}else{if(!l)throw Error("try statement without catch or finally");if(this.prev<r.finallyLoc)return i(r.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var i=this.tryEntries[n];if(i.tryLoc<=this.prev&&s.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var o=i;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var r=o?o.completion:{};return r.type=e,r.arg=t,o?(this.method="next",this.next=o.finallyLoc,y):this.complete(r)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),y},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),R(n),y}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var i=n.completion;if("throw"===i.type){var o=i.arg;R(n)}return o}}throw Error("illegal catch attempt")},delegateYield:function(t,n,i){return this.delegate={iterator:M(t),resultName:n,nextLoc:i},"next"===this.method&&(this.arg=e),y}},t}function o(e){return(o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function s(e,t,n,i,o,s,r){try{var a=e[s](r),c=a.value}catch(l){return void n(l)}a.done?t(c):Promise.resolve(c).then(i,o)}function r(e){return function(){var t=this,n=arguments;return new Promise((function(i,o){var r=e.apply(t,n);function a(e){s(r,i,o,a,c,"next",e)}function c(e){s(r,i,o,a,c,"throw",e)}a(void 0)}))}}var a=n(7),c=n(33),l=n(6).EventProxy,u=n(0),p=n(2);function d(e,t){var n=e.TaskId,i=e.Bucket,o=e.Region,s=e.Key,r=e.StorageClass,p=this,d={},m=e.FileSize,g=e.SliceSize,v=Math.ceil(m/g),y=0,b=u.throttleOnProgress.call(p,m,e.onHashProgress),x=function(t,n){var i=t.length;return 0===i?n(null,!0):i>v||i>1&&Math.max(t[0].Size,t[1].Size)!==g?n(null,!1):void function o(s){if(s<i){var r=t[s];a=r.PartNumber,c=function(e,t){t&&t.ETag===r.ETag&&t.Size===r.Size?o(s+1):n(null,!1)},l=g*(a-1),p=Math.min(l+g,m),h=p-l,d[a]?c(null,{PartNumber:a,ETag:d[a],Size:h}):u.fileSlice(e.FilePath,l,p,(function(e){try{var t=u.getFileMd5(e)}catch(i){return c(i)}var n='"'+t+'"';d[a]=n,y+=h,c(null,{PartNumber:a,ETag:n,Size:h}),b({loaded:y,total:m})}))}else n(null,!0);var a,c,l,p,h}(0)},S=new l;S.on("error",(function(e){if(p._isRunningTask(n))return t(e)})),S.on("upload_id_available",(function(e){var n={},i=[];u.each(e.PartList,(function(e){n[e.PartNumber]=e}));for(var o=1;o<=v;o++){var s=n[o];s?(s.PartNumber=o,s.Uploaded=!0):s={PartNumber:o,ETag:null,Uploaded:!1},i.push(s)}e.PartList=i,t(null,e)})),S.on("no_available_upload_id",(function(){if(p._isRunningTask(n)){var a=u.extend({Bucket:i,Region:o,Key:s,Headers:u.clone(e.Headers),Query:u.clone(e.Query),StorageClass:r,calledBySdk:"sliceUploadFile",tracker:e.tracker},e);p.multipartInit(a,(function(e,i){if(p._isRunningTask(n)){if(e)return S.emit("error",e);var o=i.UploadId;if(!o)return t({Message:"no upload id"});S.emit("upload_id_available",{UploadId:o,PartList:[]})}}))}})),S.on("has_and_check_upload_id",(function(t){t=t.reverse(),c.eachLimit(t,1,(function(t,r){p._isRunningTask(n)&&(a.using[t]?r():f.call(p,{Bucket:i,Region:o,Key:s,UploadId:t,tracker:e.tracker},(function(e,i){if(p._isRunningTask(n)){if(e)return a.removeUsing(t),S.emit("error",e);var o=i.PartList;o.forEach((function(e){e.PartNumber*=1,e.Size*=1,e.ETag=e.ETag||""})),x(o,(function(e,i){if(p._isRunningTask(n))return e?S.emit("error",e):void(i?r({UploadId:t,PartList:o}):r())}))}})))}),(function(e){p._isRunningTask(n)&&(b(null,!0),e&&e.UploadId?S.emit("upload_id_available",e):S.emit("no_available_upload_id"))}))})),S.on("seek_local_avail_upload_id",(function(t){var r=a.getFileId(e.FileStat,e.ChunkSize,i,s),c=a.getUploadIdList(r);r&&c?function r(l){if(l>=c.length)S.emit("has_and_check_upload_id",t);else{var d=c[l];if(!u.isInArray(t,d))return a.removeUploadId(d),void r(l+1);a.using[d]?r(l+1):f.call(p,{Bucket:i,Region:o,Key:s,UploadId:d,tracker:e.tracker},(function(e,t){p._isRunningTask(n)&&(e?(a.removeUploadId(d),r(l+1)):S.emit("upload_id_available",{UploadId:d,PartList:t.PartList}))}))}}(0):S.emit("has_and_check_upload_id",t)})),S.on("get_remote_upload_id_list",(function(){h.call(p,{Bucket:i,Region:o,Key:s,tracker:e.tracker},(function(t,o){if(p._isRunningTask(n)){if(t)return S.emit("error",t);var c=u.filter(o.UploadList,(function(e){return e.Key===s&&(!r||e.StorageClass.toUpperCase()===r.toUpperCase())})).reverse().map((function(e){return e.UploadId||e.UploadID}));if(c.length)S.emit("seek_local_avail_upload_id",c);else{var l,d=a.getFileId(e.FileStat,e.ChunkSize,i,s);d&&(l=a.getUploadIdList(d))&&u.each(l,(function(e){a.removeUploadId(e)})),S.emit("no_available_upload_id")}}}))})),S.emit("get_remote_upload_id_list")}function h(e,t){var n=this,i=[],o={Bucket:e.Bucket,Region:e.Region,Prefix:e.Key,calledBySdk:e.calledBySdk||"sliceUploadFile",tracker:e.tracker};!function e(){n.multipartList(o,(function(n,s){if(n)return t(n);i.push.apply(i,s.Upload||[]),"true"===s.IsTruncated?(o.KeyMarker=s.NextKeyMarker,o.UploadIdMarker=s.NextUploadIdMarker,e()):t(null,{UploadList:i})}))}()}function f(e,t){var n=this,i=[],o={Bucket:e.Bucket,Region:e.Region,Key:e.Key,UploadId:e.UploadId,calledBySdk:"sliceUploadFile",tracker:e.tracker};!function e(){n.multipartListPart(o,(function(n,s){if(n)return t(n);i.push.apply(i,s.Part||[]),"true"===s.IsTruncated?(o.PartNumberMarker=s.NextPartNumberMarker,e()):t(null,{PartList:i})}))}()}function m(e,t){var n=this,i=e.TaskId,o=e.Bucket,s=e.Region,r=e.Key,a=e.UploadData,l=e.FileSize,p=e.SliceSize,d=Math.min(e.AsyncLimit||n.options.ChunkParallelLimit||1,256),h=e.FilePath,f=Math.ceil(l/p),m=0,v=e.ServerSideEncryption,y=u.filter(a.PartList,(function(e){return e.Uploaded&&(m+=e.PartNumber>=f&&l%p||p),!e.Uploaded})),b=e.onProgress;c.eachLimit(y,d,(function(t,c){if(n._isRunningTask(i)){var u=t.PartNumber,d=Math.min(l,t.PartNumber*p)-(t.PartNumber-1)*p,f=0;g.call(n,{TaskId:i,Bucket:o,Region:s,Key:r,SliceSize:p,FileSize:l,PartNumber:u,ServerSideEncryption:v,FilePath:h,UploadData:a,onProgress:function(e){m+=e.loaded-f,f=e.loaded,b({loaded:m,total:l})},tracker:e.tracker},(function(e,o){n._isRunningTask(i)&&(e?m-=f:(m+=d-f,t.ETag=o.ETag),b({loaded:m,total:l}),c(e||null,o))}))}}),(function(e){if(n._isRunningTask(i))return e?t(e):void t(null,{UploadId:a.UploadId,SliceList:a.PartList})}))}function g(e,t){var n=this,i=e.TaskId,o=e.Bucket,s=e.Region,r=e.Key,a=e.FileSize,l=e.FilePath,p=1*e.PartNumber,d=e.SliceSize,h=e.ServerSideEncryption,f=e.UploadData,m=n.options.ChunkRetryTimes+1,g=e.Headers||{},v=d*(p-1),y=d,b=v+d;b>a&&(y=(b=a)-v);var x=["x-cos-traffic-limit","x-cos-mime-limit"],S={};u.each(g,(function(e,t){x.indexOf(t)>-1&&(S[t]=e)})),u.fileSlice(l,v,b,(function(a){var l=u.getFileMd5(a),d=l?u.binaryBase64(l):null,g=f.PartList[p-1];c.retry(m,(function(t){n._isRunningTask(i)&&n.multipartUpload({TaskId:i,Bucket:o,Region:s,Key:r,ContentLength:y,PartNumber:p,UploadId:f.UploadId,ServerSideEncryption:h,Body:a,Headers:S,onProgress:e.onProgress,ContentMD5:d,calledBySdk:"sliceUploadFile",tracker:e.tracker},(function(e,o){if(n._isRunningTask(i))return e?t(e):(g.Uploaded=!0,t(null,o))}))}),(function(e,o){if(n._isRunningTask(i))return t(e,o)}))}))}function v(e,t){var n=e.Bucket,i=e.Region,o=e.Key,s=e.UploadId,r=e.SliceList,a=this,l=this.options.ChunkRetryTimes+1,u=r.map((function(e){return{PartNumber:e.PartNumber,ETag:e.ETag}}));c.retry(l,(function(t){a.multipartComplete({Bucket:n,Region:i,Key:o,UploadId:s,Parts:u,calledBySdk:"sliceUploadFile",Headers:e.Headers||{},tracker:e.tracker},t)}),(function(e,n){t(e,n)}))}function y(e,t){var n=e.Bucket,i=e.Region,o=e.Key,s=e.AbortArray,r=e.AsyncLimit||1,a=this,l=0,u=new Array(s.length);c.eachLimit(s,r,(function(t,s){var r=l;if(o&&o!==t.Key)return u[r]={error:{KeyNotMatch:!0}},void s(null);var c=t.UploadId||t.UploadID;a.multipartAbort({Bucket:n,Region:i,Key:t.Key,Headers:e.Headers,UploadId:c},(function(e){var o={Bucket:n,Region:i,Key:t.Key,UploadId:c};u[r]={error:e,task:o},s(null)})),l++}),(function(e){if(e)return t(e);for(var n=[],i=[],o=0,s=u.length;o<s;o++){var r=u[o];r.task&&(r.error?i.push(r.task):n.push(r.task))}return t(null,{successList:n,errorList:i})}))}function b(){return(b=r(i().mark((function e(t,n){var s,r,a,c,l,d,h,f,m,g,v,y;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return s=this,r=void 0===t.SliceSize?s.options.SliceSize:t.SliceSize,a=[],e.prev=3,e.next=6,u.getFileSizeByPath(t.FilePath);case 6:c=e.sent,e.next=13;break;case 9:return e.prev=9,e.t0=e.catch(3),n({error:e.t0}),e.abrupt("return");case 13:l={TaskId:""},s.options.EnableReporter&&(d=s.options.UseAccelerate||"string"==typeof s.options.Domain&&s.options.Domain.includes("accelerate."),h=c>r?"sliceUploadFile":"putObject",t.tracker=new p({Beacon:s.options.BeaconReporter,clsReporter:s.options.ClsReporter,bucket:t.Bucket,region:t.Region,apiName:"uploadFile",realApi:h,fileKey:t.Key,fileSize:c,accelerate:d,deepTracker:s.options.DeepTracker,customId:s.options.CustomId,delay:s.options.TrackerDelay})),u.each(t,(function(e,t){"object"!==o(e)&&"function"!=typeof e&&(l[t]=e)})),f=t.onTaskReady,t.onTaskReady=function(e){l.TaskId=e,f&&f(e)},m=t.onFileFinish,g=function(e,i){t.tracker&&t.tracker.report(e,i),m&&m(e,i,l),n&&n(e,i)},v="postObject"===s.options.SimpleUploadMethod?"postObject":"putObject",y=c>r?"sliceUploadFile":v,a.push({api:y,params:t,callback:g}),s._addTasks(a);case 24:case"end":return e.stop()}}),e,this,[[3,9]])})))).apply(this,arguments)}function x(){return x=r(i().mark((function e(t,n){var s,a,c,l,d,h,f,m,g,v,y;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return s=this,a=void 0===t.SliceSize?s.options.SliceSize:t.SliceSize,c=0,l=0,d=u.throttleOnProgress.call(s,l,t.onProgress),h=t.files.length,f=t.onFileFinish,m=Array(h),g=function(e,t,i){d(null,!0),f&&f(e,t,i),m[i.Index]={options:i,error:e,data:t},--h<=0&&n&&n(null,{files:m})},v=[],y=function(){return t.files.map((function(e,t){return new Promise((n=r(i().mark((function n(r){var h,f,m,y,b,x,S,k,C,w,E;return i().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return h=0,n.prev=1,n.next=4,u.getFileSizeByPath(e.FilePath);case 4:h=n.sent,n.next=9;break;case 7:n.prev=7,n.t0=n.catch(1);case 9:f={Index:t,TaskId:""},c+=h,s.options.EnableReporter&&(m=s.options.UseAccelerate||"string"==typeof s.options.Domain&&s.options.Domain.includes("accelerate."),y=h>a?"sliceUploadFile":"putObject",e.tracker=new p({Beacon:s.options.BeaconReporter,clsReporter:s.options.ClsReporter,bucket:e.Bucket,region:e.Region,apiName:"uploadFiles",realApi:y,fileKey:e.Key,fileSize:h,accelerate:m,deepTracker:s.options.DeepTracker,customId:s.options.CustomId,delay:s.options.TrackerDelay})),u.each(e,(function(e,t){"object"!==o(e)&&"function"!=typeof e&&(f[t]=e)})),b=e.onTaskReady,e.onTaskReady=function(e){f.TaskId=e,b&&b(e)},x=0,S=e.onProgress,e.onProgress=function(e){l=l-x+e.loaded,x=e.loaded,S&&S(e),d({loaded:l,total:c})},k=e.onFileFinish,C=function(t,n){e.tracker&&e.tracker.report(t,n),k&&k(t,n),g&&g(t,n,f)},w="postObject"===s.options.SimpleUploadMethod?"postObject":"putObject",E=h>a?"sliceUploadFile":w,v.push({api:E,params:e,callback:C}),r(!0);case 24:case"end":return n.stop()}}),n,null,[[1,7]])}))),function(e){return n.apply(this,arguments)}));var n}))},e.next=13,Promise.all(y());case 13:s._addTasks(v);case 14:case"end":return e.stop()}}),e,this)}))),x.apply(this,arguments)}function S(e,t){var n=e.TaskId,i=e.Bucket,o=e.Region,s=e.Key,r=e.CopySource,a=e.UploadId,l=1*e.PartNumber,u=e.CopySourceRange,p=this.options.ChunkRetryTimes+1,d=this;c.retry(p,(function(t){d.uploadPartCopy({TaskId:n,Bucket:i,Region:o,Key:s,CopySource:r,UploadId:a,PartNumber:l,CopySourceRange:u,onProgress:e.onProgress,tracker:e.tracker,calledBySdk:e.calledBySdk},(function(e,n){t(e||null,n)}))}),(function(e,n){return t(e,n)}))}var k={sliceUploadFile:function(e,t){var n=this;if(!u.canFileSlice())return e.SkipTask=!0,void("postObject"===n.options.SimpleUploadMethod?n.postObject(e,t):n.putObject(e,t));var i,o,s=new l,r=e.TaskId,c=e.Bucket,p=e.Region,h=e.Key,f=e.FilePath,g=e.ChunkSize||e.SliceSize||n.options.ChunkSize,y=e.AsyncLimit,b=e.StorageClass,x=e.ServerSideEncryption,S=e.onHashProgress,k=e.tracker;k&&k.setParams({chunkSize:g}),s.on("error",(function(i){if(n._isRunningTask(r)){var o={UploadId:e.UploadData.UploadId||"",err:i,error:i};return t(o)}})),s.on("upload_complete",(function(n){var i=u.extend({UploadId:e.UploadData.UploadId||""},n);t(null,i)})),s.on("upload_slice_complete",(function(t){var l={};u.each(e.Headers,(function(e,t){var n=t.toLowerCase();0!==n.indexOf("x-cos-meta-")&&"pic-operations"!==n||(l[t]=e)})),v.call(n,{Bucket:c,Region:p,Key:h,UploadId:t.UploadId,SliceList:t.SliceList,Headers:l,tracker:k},(function(e,c){if(n._isRunningTask(r)){if(a.removeUsing(t.UploadId),e)return o(null,!0),s.emit("error",e);a.removeUploadId(t.UploadId),o({loaded:i,total:i},!0),s.emit("upload_complete",c)}}))})),s.on("get_upload_data_finish",(function(t){var l=a.getFileId(e.FileStat,e.ChunkSize,c,h);l&&a.saveUploadId(l,t.UploadId,n.options.UploadIdCacheLimit),a.setUsing(t.UploadId),o(null,!0),m.call(n,{TaskId:r,Bucket:c,Region:p,Key:h,FilePath:f,FileSize:i,SliceSize:g,AsyncLimit:y,ServerSideEncryption:x,UploadData:t,onProgress:o,tracker:k},(function(e,t){if(n._isRunningTask(r))return e?(o(null,!0),s.emit("error",e)):void s.emit("upload_slice_complete",t)}))})),s.on("get_file_size_finish",(function(){if(o=u.throttleOnProgress.call(n,i,e.onProgress),e.UploadData.UploadId)s.emit("get_upload_data_finish",e.UploadData);else{var t=u.extend({TaskId:r,Bucket:c,Region:p,Key:h,Headers:e.Headers,StorageClass:b,FilePath:f,FileSize:i,SliceSize:g,onHashProgress:S,tracker:k},e);t.FileSize=i,d.call(n,t,(function(t,i){if(n._isRunningTask(r)){if(t)return s.emit("error",t);e.UploadData.UploadId=i.UploadId,e.UploadData.PartList=i.PartList,s.emit("get_upload_data_finish",e.UploadData)}}))}})),i=e.ContentLength,delete e.ContentLength,!e.Headers&&(e.Headers={}),u.each(e.Headers,(function(t,n){"content-length"===n.toLowerCase()&&delete e.Headers[n]})),function(){for(var t=[1,2,4,8,16,32,64,128,256,512,1024,2048,4096,5120],o=1048576,s=0;s<t.length&&!(i/(o=1024*t[s]*1024)<=n.options.MaxPartNumber);s++);e.ChunkSize=e.SliceSize=g=Math.max(g,o)}(),0===i?(e.Body="",e.ContentLength=0,e.SkipTask=!0,n.putObject(e,(function(e,n){if(e)return t(e);t(null,n)}))):s.emit("get_file_size_finish")},abortUploadTask:function(e,t){var n=e.Bucket,i=e.Region,o=e.Key,s=e.UploadId,r=e.Level||"task",a=e.AsyncLimit,c=this,u=new l;if(u.on("error",(function(e){return t(e)})),u.on("get_abort_array",(function(s){y.call(c,{Bucket:n,Region:i,Key:o,Headers:e.Headers,AsyncLimit:a,AbortArray:s},(function(e,n){if(e)return t(e);t(null,n)}))})),"bucket"===r)h.call(c,{Bucket:n,Region:i,calledBySdk:"abortUploadTask"},(function(e,n){if(e)return t(e);u.emit("get_abort_array",n.UploadList||[])}));else if("file"===r){if(!o)return t({error:"abort_upload_task_no_key"});h.call(c,{Bucket:n,Region:i,Key:o,calledBySdk:"abortUploadTask"},(function(e,n){if(e)return t(e);u.emit("get_abort_array",n.UploadList||[])}))}else{if("task"!==r)return t({error:"abort_unknown_level"});if(!s)return t({error:"abort_upload_task_no_id"});if(!o)return t({error:"abort_upload_task_no_key"});u.emit("get_abort_array",[{Key:o,UploadId:s}])}},uploadFile:function(e,t){return b.apply(this,arguments)},uploadFiles:function(e,t){return x.apply(this,arguments)},sliceCopyFile:function(e,t){var n=new l,i=this,o=e.Bucket,s=e.Region,r=e.Key,p=e.CopySource,d=u.getSourceParams.call(this,p);if(d){var h=d.Bucket,m=d.Region,g=decodeURIComponent(d.Key),v=void 0===e.CopySliceSize?i.options.CopySliceSize:e.CopySliceSize;v=Math.max(0,v);var y,b,x=e.CopyChunkSize||this.options.CopyChunkSize,k=this.options.CopyChunkParallelLimit,C=this.options.ChunkRetryTimes+1,w=0,E=0,T={},I={},_={};n.on("copy_slice_complete",(function(n){u.each(e.Headers,(function(e,t){t.toLowerCase().indexOf("x-cos-meta-")}));var l=u.map(n.PartList,(function(e){return{PartNumber:e.PartNumber,ETag:e.ETag}}));c.retry(C,(function(t){i.multipartComplete({Bucket:o,Region:s,Key:r,UploadId:n.UploadId,Parts:l,tracker:e.tracker,calledBySdk:"sliceCopyFile"},t)}),(function(e,i){if(a.removeUsing(n.UploadId),e)return b(null,!0),t(e);a.removeUploadId(n.UploadId),b({loaded:y,total:y},!0),t(null,i)}))})),n.on("get_copy_data_finish",(function(l){var d=a.getCopyFileId(p,T,x,o,r);d&&a.saveUploadId(d,l.UploadId,i.options.UploadIdCacheLimit),a.setUsing(l.UploadId);var h=u.filter(l.PartList,(function(e){return e.Uploaded&&(E+=e.PartNumber>=w&&y%x||x),!e.Uploaded}));c.eachLimit(h,k,(function(t,n){var a=t.PartNumber,u=t.CopySourceRange,d=t.end-t.start,h=0;c.retry(C,(function(t){S.call(i,{Bucket:o,Region:s,Key:r,CopySource:p,UploadId:l.UploadId,PartNumber:a,CopySourceRange:u,tracker:e.tracker,calledBySdk:"sliceCopyFile",onProgress:function(e){E+=e.loaded-h,h=e.loaded,b({loaded:E,total:y})}},t)}),(function(e,i){if(e)return n(e);b({loaded:E,total:y}),E+=d-h,t.ETag=i.ETag,n(e||null,i)}))}),(function(e){if(e)return a.removeUsing(l.UploadId),b(null,!0),t(e);n.emit("copy_slice_complete",l)}))})),n.on("get_chunk_size_finish",(function(){var c=function(){i.multipartInit({Bucket:o,Region:s,Key:r,Headers:_,tracker:e.tracker,calledBySdk:"sliceCopyFile"},(function(i,o){if(i)return t(i);e.UploadId=o.UploadId,n.emit("get_copy_data_finish",{UploadId:e.UploadId,PartList:e.PartList})}))},l=a.getCopyFileId(p,T,x,o,r),d=a.getUploadIdList(l);if(!l||!d)return c();!function t(l){if(l>=d.length)return c();var p=d[l];if(a.using[p])return t(l+1);f.call(i,{Bucket:o,Region:s,Key:r,UploadId:p,tracker:e.tracker,calledBySdk:"sliceCopyFile"},(function(i,o){if(i)a.removeUploadId(p),t(l+1);else{if(a.using[p])return t(l+1);var s={},r=0;u.each(o.PartList,(function(e){var t=parseInt(e.Size),n=r+t-1;s[e.PartNumber+"|"+r+"|"+n]=e.ETag,r+=t})),u.each(e.PartList,(function(e){var t=s[e.PartNumber+"|"+e.start+"|"+e.end];t&&(e.ETag=t,e.Uploaded=!0)})),n.emit("get_copy_data_finish",{UploadId:p,PartList:e.PartList})}}))}(0)})),n.on("get_file_size_finish",(function(){var o;if(function(){for(var t=[1,2,4,8,16,32,64,128,256,512,1024,2048,4096,5120],n=1048576,o=0;o<t.length&&!(y/(n=1024*t[o]*1024)<=i.options.MaxPartNumber);o++);e.ChunkSize=x=Math.max(x,n),w=Math.ceil(y/x);for(var s=[],r=1;r<=w;r++){var a=(r-1)*x,c=r*x<y?r*x-1:y-1,l={PartNumber:r,start:a,end:c,CopySourceRange:"bytes="+a+"-"+c};s.push(l)}e.PartList=s}(),(o="Replaced"===e.Headers["x-cos-metadata-directive"]?e.Headers:I)["x-cos-storage-class"]=e.Headers["x-cos-storage-class"]||I["x-cos-storage-class"],o=u.clearKey(o),"ARCHIVE"===I["x-cos-storage-class"]||"DEEP_ARCHIVE"===I["x-cos-storage-class"]){var s=I["x-cos-restore"];if(!s||'ongoing-request="true"'===s)return void t({error:"Unrestored archive object is not allowed to be copied"})}delete o["x-cos-copy-source"],delete o["x-cos-metadata-directive"],delete o["x-cos-copy-source-If-Modified-Since"],delete o["x-cos-copy-source-If-Unmodified-Since"],delete o["x-cos-copy-source-If-Match"],delete o["x-cos-copy-source-If-None-Match"],n.emit("get_chunk_size_finish")})),i.headObject({Bucket:h,Region:m,Key:g,tracker:e.tracker,calledBySdk:"sliceCopyFile"},(function(o,s){if(o)o.statusCode&&404===o.statusCode?t({ErrorStatus:g+" Not Exist"}):t(o);else if(void 0!==(y=e.FileSize=s.headers["content-length"])&&y)if(e.tracker&&e.tracker.setParams({httpSize:y}),b=u.throttleOnProgress.call(i,y,e.onProgress),y<=v)e.Headers["x-cos-metadata-directive"]||(e.Headers["x-cos-metadata-directive"]="Copy"),i.putObjectCopy(Object.assign(e,{calledBySdk:"sliceCopyFile"}),(function(e,n){if(e)return b(null,!0),t(e);b({loaded:y,total:y},!0),t(e,n)}));else{var r=s.headers;T=r,I={"Cache-Control":r["cache-control"],"Content-Disposition":r["content-disposition"],"Content-Encoding":r["content-encoding"],"Content-Type":r["content-type"],Expires:r.expires,"x-cos-storage-class":r["x-cos-storage-class"]},u.each(r,(function(e,t){var n="x-cos-meta-";0===t.indexOf(n)&&t.length>11&&(I[t]=e)})),n.emit("get_file_size_finish")}else t({error:'get Content-Length error, please add "Content-Length" to CORS ExposeHeader setting.'})}))}else t({error:"CopySource format error"})}};e.exports.init=function(e,t){t.transferToTaskMethod(k,"sliceUploadFile"),u.each(k,(function(t,n){e.prototype[n]=u.apiWrapper(n,t)}))}},function(e,t){var n={eachLimit:function(e,t,n,i){if(i=i||function(){},!e.length||t<=0)return i();var o=0,s=0,r=0;!function a(){if(o>=e.length)return i();for(;r<t&&s<e.length;)r+=1,n(e[(s+=1)-1],(function(t){t?(i(t),i=function(){}):(r-=1,(o+=1)>=e.length?i():a())}))}()},retry:function(e,t,n){e<1?n():function i(o){t((function(t,s){t&&o<e?i(o+1):n(t,s)}))}(1)}};e.exports=n}]);const Rf=Of(Af.exports);exports.COS=Rf,exports._export_sfc=(e,t)=>{const n=e.__vccOpts||e;for(const[i,o]of t)n[i]=o;return n},exports.createPinia=function(){const e=jn(!0),t=e.run((()=>io({})));let n=[],i=[];const o=Ji({install(e){Pa(o),o._a=e,e.provide(Ma,o),e.config.globalProperties.$pinia=o,i.forEach((e=>n.push(e))),i=[]},use(e){return this._a?n.push(e):i.push(e),this},_p:n,_a:null,_e:e,_s:new Map,state:t});return o},exports.createSSRApp=zr,exports.defineStore=function(e,t,n){let i,o;const s="function"==typeof t;function r(e,n){(e=e||(!!(Gs||Do||Ko)?Wo(Ma,null):null))&&Pa(e),(e=Ra)._s.has(i)||(s?$a(i,t,o,e):Ha(i,o,e));return e._s.get(i)}return"string"==typeof e?(i=e,o=s?n:t):(o=e,i=e.id),r.$id=i,r},exports.e=(e,...t)=>a(e,...t),exports.f=(e,t)=>function(e,t){let n;if(p(e)||m(e)){n=new Array(e.length);for(let i=0,o=e.length;i<o;i++)n[i]=t(e[i],i,i)}else if("number"==typeof e){n=new Array(e);for(let i=0;i<e;i++)n[i]=t(i+1,i,i)}else if(v(e))if(e[Symbol.iterator])n=Array.from(e,((e,n)=>t(e,n,n)));else{const i=Object.keys(e);n=new Array(i.length);for(let o=0,s=i.length;o<s;o++){const s=i[o];n[o]=t(e[s],s,o)}}else n=[];return n}(e,t),exports.getCurrentInstance=qs,exports.index=Nn,exports.initVueI18n=function(e,t={},n,i){if("string"!=typeof e){const n=[t,e];e=n[0],t=n[1]}"string"!=typeof e&&(e=void 0!==Nn&&Nn.getLocale?Nn.getLocale():"undefined"!=typeof global&&global.getLocale?global.getLocale():Be),"string"!=typeof n&&(n="undefined"!=typeof __uniConfig&&__uniConfig.fallbackLocale||Be);const o=new Ge({locale:e,fallbackLocale:n,messages:t,watcher:i});let s=(e,t)=>{if("function"!=typeof getApp)s=function(e,t){return o.t(e,t)};else{let e=!1;s=function(t,n){const i=getApp().$vm;return i&&(i.$locale,e||(e=!0,function(e,t){e.$watchLocale?e.$watchLocale((e=>{t.setLocale(e)})):e.$watch((()=>e.$locale),(e=>{t.setLocale(e)}))}(i,o))),o.t(t,n)}}return s(e,t)};return{i18n:o,f:(e,t,n)=>o.f(e,t,n),t:(e,t)=>s(e,t),add:(e,t,n=!0)=>o.add(e,t,n),watch:e=>o.watchLocale(e),getLocale:()=>o.getLocale(),setLocale:e=>o.setLocale(e)}},exports.jo=_f,exports.n=e=>U(e),exports.o=(e,t)=>Gr(e,t),exports.onMounted=ns,exports.p=e=>function(e){const{uid:t,__counter:n}=qs();return t+","+((Br[t]||(Br[t]=[])).push(Ls(e))-1)+","+n}(e),exports.reactive=zi,exports.ref=io,exports.resolveComponent=function(e,t){return function(e,t,n=!0,i=!1){const o=Do||Gs;if(o){const n=o.type;if(e===Lo){const e=function(e,t=!0){return f(e)?e.displayName||e.name:e.name||t&&e.__name}(n,!1);if(e&&(e===t||e===T(t)||e===O(T(t))))return n}const s=jo(o[e]||n[e],t)||jo(o.appContext[e],t);return!s&&i?n:s}}(Lo,e,!0,t)||e},exports.s=e=>Fr(e),exports.sr=(e,t,n)=>function(e,t,n={}){const{$templateRefs:i}=qs();i.push({i:t,r:e,k:n.k,f:n.f})}(e,t,n),exports.t=e=>(e=>m(e)?e:null==e?"":p(e)||v(e)&&(e.toString===b||!f(e.toString))?JSON.stringify(e,F,2):String(e))(e),exports.unref=so,exports.wx$1=Mn;