@cloudbase/js-sdk 2.21.9-alpha.5 → 2.21.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs.js +1 -3
- package/dist/index.esm.js +1 -3
- package/index.d.ts +5 -22
- package/miniprogram_dist/app.js +1 -1
- package/miniprogram_dist/index.js +1 -1
- package/miniprogram_dist/model.js +1 -1
- package/package.json +13 -14
- package/miniprogram_dist/mysql.js +0 -1
- package/mysql/dist/index.d.ts +0 -1
- package/mysql/dist/index.esm.js +0 -3
- package/mysql/dist/index.js +0 -21
- package/mysql/package.json +0 -6
package/miniprogram_dist/app.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/*! For license information please see app.js.LICENSE.txt */
|
|
2
|
-
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define("cloudbase",[],t):"object"==typeof exports?exports.cloudbase=t():e.cloudbase=t()}("undefined"!=typeof window?window:this,(function(){return function(){var e={23:function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},o=n(r(353)),i=n(r(878));o.default.registerVersion(i.default.version);try{window.cloudbase=o.default}catch(e){}t.default=o.default,e.exports=o.default},353:function(e,t,r){"use strict";r.r(t),r.d(t,{LANGS:function(){return Fo},cloudbase:function(){return di},default:function(){return fi},getBaseEndPoint:function(){return Co}});var n="@cloudbase/js-sdk";function o(){return n}var i,a="https:",s={INVALID_PARAMS:"INVALID_PARAMS",INVALID_SYNTAX:"INVALID_SYNTAX",INVALID_OPERATION:"INVALID_OPERATION",OPERATION_FAIL:"OPERATION_FAIL",NETWORK_ERROR:"NETWORK_ERROR",UNKOWN_ERROR:"UNKOWN_ERROR"};!function(e){e.local="local",e.none="none",e.session="session"}(i||(i={}));var u=function(){};function l(e,t,r){void 0===r&&(r={});var n=/\?/.test(t),o="";for(var i in r)""===o?!n&&(t+="?"):o+="&",o+=i+"="+encodeURIComponent(r[i]);return/^http(s)?\:\/\//.test(t+=o)?t:""+e+t}function c(e){return"[object FormData]"===Object.prototype.toString.call(e)}function d(e,t,r){void 0===r&&(r={});var n=/\?/.test(t),o="";return Object.keys(r).forEach((function(e){""===o?!n&&(t+="?"):o+="&",o+="".concat(e,"=").concat(encodeURIComponent(r[e]))})),/^http(s)?:\/\//.test(t+=o)?t:"".concat(e).concat(t)}function f(e,t){console.warn("[".concat(o(),"][").concat(e,"]:").concat(t))}var h,p,b=(h=function(e,t){return h=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},h(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}h(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),y=function(){return y=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},y.apply(this,arguments)},m=function(e,t,r,n){return new(r||(r=Promise))((function(o,i){function a(e){try{u(n.next(e))}catch(e){i(e)}}function s(e){try{u(n.throw(e))}catch(e){i(e)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}u((n=n.apply(e,t||[])).next())}))},v=function(e,t){var r,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(s){return function(u){return function(s){if(r)throw new TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(a=0)),a;)try{if(r=1,n&&(o=2&s[0]?n.return:s[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,s[1])).done)return o;switch(n=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,n=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){a.label=s[1];break}if(6===s[0]&&a.label<o[1]){a.label=o[1],o=s;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(s);break}o[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],n=0}finally{r=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,u])}}},_=function(e){function t(t){var r=e.call(this)||this,n=t.timeout,o=t.timeoutMsg,i=t.restrictedMethods;return r.timeout=n||0,r.timeoutMsg=o||"请求超时",r.restrictedMethods=i||["get","post","upload","download"],r}return b(t,e),t.prototype.get=function(e){return this.request(y(y({},e),{method:"get"}),this.restrictedMethods.includes("get"))},t.prototype.post=function(e){return this.request(y(y({},e),{method:"post"}),this.restrictedMethods.includes("post"))},t.prototype.put=function(e){return this.request(y(y({},e),{method:"put"}))},t.prototype.upload=function(e){var t=e.data,r=e.file,n=e.name,o=e.method,i=e.headers,a=void 0===i?{}:i,s={post:"post",put:"put"}[null==o?void 0:o.toLowerCase()]||"put",u=new FormData;return"post"===s?(Object.keys(t).forEach((function(e){u.append(e,t[e])})),u.append("key",n),u.append("file",r),this.request(y(y({},e),{data:u,method:s}),this.restrictedMethods.includes("upload"))):this.request(y(y({},e),{method:"put",headers:a,body:r}),this.restrictedMethods.includes("upload"))},t.prototype.download=function(e){return m(this,void 0,void 0,(function(){var t,r,n,o;return v(this,(function(i){switch(i.label){case 0:return i.trys.push([0,2,,3]),[4,this.get(y(y({},e),{headers:{},responseType:"blob"}))];case 1:return t=i.sent().data,r=window.URL.createObjectURL(new Blob([t])),n=decodeURIComponent(new URL(e.url).pathname.split("/").pop()||""),(o=document.createElement("a")).href=r,o.setAttribute("download",n),o.style.display="none",document.body.appendChild(o),o.click(),window.URL.revokeObjectURL(r),document.body.removeChild(o),[3,3];case 2:return i.sent(),[3,3];case 3:return[2,new Promise((function(t){t({statusCode:200,tempFilePath:e.url})}))]}}))}))},t.prototype.fetch=function(e){var t;return m(this,void 0,void 0,(function(){var r,n,o,i,a,s,u,l,c,d,f,h=this;return v(this,(function(p){switch(p.label){case 0:return r=new AbortController,n=e.url,o=e.enableAbort,i=void 0!==o&&o,a=e.stream,s=void 0!==a&&a,u=e.signal,l=e.timeout,c=null!=l?l:this.timeout,u&&(u.aborted&&r.abort(),u.addEventListener("abort",(function(){return r.abort()}))),d=null,i&&c&&(d=setTimeout((function(){console.warn(h.timeoutMsg),r.abort(new Error(h.timeoutMsg))}),c)),[4,fetch(n,y(y({},e),{signal:r.signal})).then((function(e){return m(h,void 0,void 0,(function(){var t,r,n;return v(this,(function(o){switch(o.label){case 0:return clearTimeout(d),e.ok?(t=e,[3,3]):[3,1];case 1:return n=(r=Promise).reject,[4,e.json()];case 2:t=n.apply(r,[o.sent()]),o.label=3;case 3:return[2,t]}}))}))})).catch((function(e){return clearTimeout(d),Promise.reject(e)}))];case 1:return f=p.sent(),[2,{data:s?f.body:(null===(t=f.headers.get("content-type"))||void 0===t?void 0:t.includes("application/json"))?f.json():f.text(),statusCode:f.status,header:f.headers}]}}))}))},t.prototype.request=function(e,t){var r=this;void 0===t&&(t=!1);var n=String(e.method).toLowerCase()||"get";return new Promise((function(o){var i,s,u=e.url,l=e.headers,f=void 0===l?{}:l,h=e.data,p=e.responseType,b=e.withCredentials,y=e.body,m=e.onUploadProgress,v=d(a,u,"get"===n?h:{}),_=new XMLHttpRequest;_.open(n,v),p&&(_.responseType=p),Object.keys(f).forEach((function(e){_.setRequestHeader(e,f[e])})),m&&_.upload.addEventListener("progress",m),_.onreadystatechange=function(){var e={};if(4===_.readyState){var t=_.getAllResponseHeaders().trim().split(/[\r\n]+/),r={};t.forEach((function(e){var t=e.split(": "),n=t.shift().toLowerCase(),o=t.join(": ");r[n]=o})),e.header=r,e.statusCode=_.status;try{e.data="blob"===p?_.response:JSON.parse(_.responseText)}catch(t){e.data="blob"===p?_.response:_.responseText}clearTimeout(i),o(e)}},t&&r.timeout&&(i=setTimeout((function(){console.warn(r.timeoutMsg),_.abort()}),r.timeout)),s=c(h)?h:"application/x-www-form-urlencoded"===f["content-type"]?function(e){void 0===e&&(e={});var t=[];return Object.keys(e).forEach((function(r){t.push("".concat(r,"=").concat(encodeURIComponent(e[r])))})),t.join("&")}(h):y||(h?JSON.stringify(h):void 0),b&&(_.withCredentials=!0),_.send(s)}))},t}(u),g=function(){return g=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},g.apply(this,arguments)};!function(e){e.WEB="web",e.WX_MP="wx_mp"}(p||(p={}));var w=function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},e(t,r)};return function(t,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),S=function(e,t,r,n){return new(r||(r=Promise))((function(o,i){function a(e){try{u(n.next(e))}catch(e){i(e)}}function s(e){try{u(n.throw(e))}catch(e){i(e)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}u((n=n.apply(e,t||[])).next())}))},O=function(e,t){var r,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(s){return function(u){return function(s){if(r)throw new TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(a=0)),a;)try{if(r=1,n&&(o=2&s[0]?n.return:s[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,s[1])).done)return o;switch(n=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,n=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){a.label=s[1];break}if(6===s[0]&&a.label<o[1]){a.label=o[1],o=s;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(s);break}o[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],n=0}finally{r=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,u])}}},P=function(e){function t(t){var r=e.call(this)||this;return r.root=t,t.tcbCacheObject||(t.tcbCacheObject={}),r}return w(t,e),t.prototype.setItem=function(e,t){this.root.tcbCacheObject[e]=t},t.prototype.getItem=function(e){return this.root.tcbCacheObject[e]},t.prototype.removeItem=function(e){delete this.root.tcbCacheObject[e]},t.prototype.clear=function(){delete this.root.tcbCacheObject},t}((function(){})),E=function(){function e(e){this.keys={};var t=e.persistence,r=e.platformInfo,n=void 0===r?{}:r,o=e.keys,i=void 0===o?{}:o;this.platformInfo=n,this.storage||(this.persistenceTag=this.platformInfo.adapter.primaryStorage||t,this.storage=function(e,t){switch(e){case"local":default:return t.localStorage?t.localStorage:(f(s.INVALID_PARAMS,"localStorage is not supported on current platform"),new P(t.root));case"none":return new P(t.root)}}(this.persistenceTag,this.platformInfo.adapter),this.keys=i)}return Object.defineProperty(e.prototype,"mode",{get:function(){return this.storage.mode||"sync"},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"persistence",{get:function(){return this.persistenceTag},enumerable:!1,configurable:!0}),e.prototype.setStore=function(e,t,r){if("async"!==this.mode){if(this.storage)try{var n={version:r||"localCachev1",content:t};this.storage.setItem(e,JSON.stringify(n))}catch(e){throw new Error(JSON.stringify({code:s.OPERATION_FAIL,msg:"[".concat(o(),"][").concat(s.OPERATION_FAIL,"]setStore failed"),info:e}))}}else f(s.INVALID_OPERATION,"current platform's storage is asynchronous, please use setStoreAsync insteed")},e.prototype.setStoreAsync=function(e,t,r){return S(this,void 0,void 0,(function(){var n;return O(this,(function(o){switch(o.label){case 0:if(!this.storage)return[2];o.label=1;case 1:return o.trys.push([1,3,,4]),n={version:r||"localCachev1",content:t},[4,this.storage.setItem(e,JSON.stringify(n))];case 2:return o.sent(),[3,4];case 3:return o.sent(),[2];case 4:return[2]}}))}))},e.prototype.getStore=function(e,t){var r;if("async"!==this.mode){try{if("undefined"!=typeof process&&(null===(r={IS_MP_BUILD:!0})||void 0===r?void 0:r.tcb_token))return{IS_MP_BUILD:!0}.tcb_token;if(!this.storage)return""}catch(e){return""}t=t||"localCachev1";var n=this.storage.getItem(e);return n&&n.indexOf(t)>=0?JSON.parse(n).content:""}f(s.INVALID_OPERATION,"current platform's storage is asynchronous, please use getStoreAsync insteed")},e.prototype.getStoreAsync=function(e,t){var r;return S(this,void 0,void 0,(function(){var n;return O(this,(function(o){switch(o.label){case 0:try{if("undefined"!=typeof process&&(null===(r={IS_MP_BUILD:!0})||void 0===r?void 0:r.tcb_token))return[2,{IS_MP_BUILD:!0}.tcb_token];if(!this.storage)return[2,""]}catch(e){return[2,""]}return t=t||"localCachev1",[4,this.storage.getItem(e)];case 1:return(n=o.sent())&&n.indexOf(t)>=0?[2,JSON.parse(n).content]:[2,""]}}))}))},e.prototype.removeStore=function(e){"async"!==this.mode?this.storage.removeItem(e):f(s.INVALID_OPERATION,"current platform's storage is asynchronous, please use removeStoreAsync insteed")},e.prototype.removeStoreAsync=function(e){return S(this,void 0,void 0,(function(){return O(this,(function(t){switch(t.label){case 0:return[4,this.storage.removeItem(e)];case 1:return t.sent(),[2]}}))}))},e}(),T=function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},e(t,r)};return function(t,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),R=function(e,t){this.data=t||null,this.name=e},A=function(e){function t(t,r){var n=e.call(this,"error",{error:t,data:r})||this;return n.error=t,n}return T(t,e),t}(R),C=function(){function e(){this.listeners={}}return e.prototype.on=function(e,t){return function(e,t,r){r[e]=r[e]||[],r[e].push(t)}(e,t,this.listeners),this},e.prototype.off=function(e,t){return function(e,t,r){if(null==r?void 0:r[e]){var n=r[e].indexOf(t);-1!==n&&r[e].splice(n,1)}}(e,t,this.listeners),this},e.prototype.fire=function(e,t){if(e instanceof A)return console.error(e.error),this;var r="string"==typeof e?new R(e,t||{}):e,n=r.name;if(this.listens(n)){r.target=this;for(var o=0,i=this.listeners[n]?function(e,t,r){if(r||2===arguments.length)for(var n,o=0,i=t.length;o<i;o++)!n&&o in t||(n||(n=Array.prototype.slice.call(t,0,o)),n[o]=t[o]);return e.concat(n||Array.prototype.slice.call(t))}([],this.listeners[n],!0):[];o<i.length;o++)i[o].call(this,r)}return this},e.prototype.listens=function(e){return this.listeners[e]&&this.listeners[e].length>0},e}();new C;var I=new C,j="lang_change";function k(e){this.message=e}function q(e){this.message=e}function x(){}function L(e){return"object"==typeof e&&null!==e||"function"==typeof e}"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.indexOf("Firefox"),k.prototype=new Error,k.prototype.name="InvalidCharacterError","undefined"!=typeof window&&window.atob&&window.atob.bind(window),q.prototype=new Error,q.prototype.name="InvalidTokenError";const N=x;function W(e,t){try{Object.defineProperty(e,"name",{value:t,configurable:!0})}catch(e){}}const M=Promise,D=Promise.resolve.bind(M),F=Promise.prototype.then,B=Promise.reject.bind(M),U=D;function z(e){return new M(e)}function $(e){return z((t=>t(e)))}function V(e){return B(e)}function H(e,t,r){return F.call(e,t,r)}function Y(e,t,r){H(H(e,t,r),void 0,N)}function G(e,t){Y(e,t)}function K(e,t){Y(e,void 0,t)}function Q(e,t,r){return H(e,t,r)}function J(e){H(e,void 0,N)}let X=e=>{if("function"==typeof queueMicrotask)X=queueMicrotask;else{const e=$(void 0);X=t=>H(e,t)}return X(e)};function Z(e,t,r){if("function"!=typeof e)throw new TypeError("Argument is not a function");return Function.prototype.apply.call(e,t,r)}function ee(e,t,r){try{return $(Z(e,t,r))}catch(e){return V(e)}}class te{constructor(){this._cursor=0,this._size=0,this._front={_elements:[],_next:void 0},this._back=this._front,this._cursor=0,this._size=0}get length(){return this._size}push(e){const t=this._back;let r=t;16383===t._elements.length&&(r={_elements:[],_next:void 0}),t._elements.push(e),r!==t&&(this._back=r,t._next=r),++this._size}shift(){const e=this._front;let t=e;const r=this._cursor;let n=r+1;const o=e._elements,i=o[r];return 16384===n&&(t=e._next,n=0),--this._size,this._cursor=n,e!==t&&(this._front=t),o[r]=void 0,i}forEach(e){let t=this._cursor,r=this._front,n=r._elements;for(;!(t===n.length&&void 0===r._next||t===n.length&&(r=r._next,n=r._elements,t=0,0===n.length));)e(n[t]),++t}peek(){const e=this._front,t=this._cursor;return e._elements[t]}}const re=Symbol("[[AbortSteps]]"),ne=Symbol("[[ErrorSteps]]"),oe=Symbol("[[CancelSteps]]"),ie=Symbol("[[PullSteps]]"),ae=Symbol("[[ReleaseSteps]]");function se(e,t){e._ownerReadableStream=t,t._reader=e,"readable"===t._state?de(e):"closed"===t._state?function(e){de(e),pe(e)}(e):fe(e,t._storedError)}function ue(e,t){return mn(e._ownerReadableStream,t)}function le(e){const t=e._ownerReadableStream;"readable"===t._state?he(e,new TypeError("Reader was released and can no longer be used to monitor the stream's closedness")):function(e){fe(e,new TypeError("Reader was released and can no longer be used to monitor the stream's closedness"))}(e),t._readableStreamController[ae](),t._reader=void 0,e._ownerReadableStream=void 0}function ce(e){return new TypeError("Cannot "+e+" a stream using a released reader")}function de(e){e._closedPromise=z(((t,r)=>{e._closedPromise_resolve=t,e._closedPromise_reject=r}))}function fe(e,t){de(e),he(e,t)}function he(e,t){void 0!==e._closedPromise_reject&&(J(e._closedPromise),e._closedPromise_reject(t),e._closedPromise_resolve=void 0,e._closedPromise_reject=void 0)}function pe(e){void 0!==e._closedPromise_resolve&&(e._closedPromise_resolve(void 0),e._closedPromise_resolve=void 0,e._closedPromise_reject=void 0)}const be=Number.isFinite||function(e){return"number"==typeof e&&isFinite(e)},ye=Math.trunc||function(e){return e<0?Math.ceil(e):Math.floor(e)};function me(e,t){if(void 0!==e&&"object"!=typeof(r=e)&&"function"!=typeof r)throw new TypeError(`${t} is not an object.`);var r}function ve(e,t){if("function"!=typeof e)throw new TypeError(`${t} is not a function.`)}function _e(e,t){if(!function(e){return"object"==typeof e&&null!==e||"function"==typeof e}(e))throw new TypeError(`${t} is not an object.`)}function ge(e,t,r){if(void 0===e)throw new TypeError(`Parameter ${t} is required in '${r}'.`)}function we(e,t,r){if(void 0===e)throw new TypeError(`${t} is required in '${r}'.`)}function Se(e){return Number(e)}function Oe(e){return 0===e?0:e}function Pe(e,t){const r=Number.MAX_SAFE_INTEGER;let n=Number(e);if(n=Oe(n),!be(n))throw new TypeError(`${t} is not a finite number`);if(n=function(e){return Oe(ye(e))}(n),n<0||n>r)throw new TypeError(`${t} is outside the accepted range of 0 to ${r}, inclusive`);return be(n)&&0!==n?n:0}function Ee(e,t){if(!bn(e))throw new TypeError(`${t} is not a ReadableStream.`)}function Te(e){return new je(e)}function Re(e,t){e._reader._readRequests.push(t)}function Ae(e,t,r){const n=e._reader._readRequests.shift();r?n._closeSteps():n._chunkSteps(t)}function Ce(e){return e._reader._readRequests.length}function Ie(e){const t=e._reader;return void 0!==t&&!!ke(t)}class je{constructor(e){if(ge(e,1,"ReadableStreamDefaultReader"),Ee(e,"First parameter"),yn(e))throw new TypeError("This stream has already been locked for exclusive reading by another reader");se(this,e),this._readRequests=new te}get closed(){return ke(this)?this._closedPromise:V(Le("closed"))}cancel(e=void 0){return ke(this)?void 0===this._ownerReadableStream?V(ce("cancel")):ue(this,e):V(Le("cancel"))}read(){if(!ke(this))return V(Le("read"));if(void 0===this._ownerReadableStream)return V(ce("read from"));let e,t;const r=z(((r,n)=>{e=r,t=n}));return qe(this,{_chunkSteps:t=>e({value:t,done:!1}),_closeSteps:()=>e({value:void 0,done:!0}),_errorSteps:e=>t(e)}),r}releaseLock(){if(!ke(this))throw Le("releaseLock");void 0!==this._ownerReadableStream&&function(e){le(e),xe(e,new TypeError("Reader was released"))}(this)}}function ke(e){return!!L(e)&&!!Object.prototype.hasOwnProperty.call(e,"_readRequests")&&e instanceof je}function qe(e,t){const r=e._ownerReadableStream;r._disturbed=!0,"closed"===r._state?t._closeSteps():"errored"===r._state?t._errorSteps(r._storedError):r._readableStreamController[ie](t)}function xe(e,t){const r=e._readRequests;e._readRequests=new te,r.forEach((e=>{e._errorSteps(t)}))}function Le(e){return new TypeError(`ReadableStreamDefaultReader.prototype.${e} can only be used on a ReadableStreamDefaultReader`)}var Ne,We,Me;function De(e){return e.slice()}function Fe(e,t,r,n,o){new Uint8Array(e).set(new Uint8Array(r,n,o),t)}Object.defineProperties(je.prototype,{cancel:{enumerable:!0},read:{enumerable:!0},releaseLock:{enumerable:!0},closed:{enumerable:!0}}),W(je.prototype.cancel,"cancel"),W(je.prototype.read,"read"),W(je.prototype.releaseLock,"releaseLock"),"symbol"==typeof Symbol.toStringTag&&Object.defineProperty(je.prototype,Symbol.toStringTag,{value:"ReadableStreamDefaultReader",configurable:!0});let Be=e=>(Be="function"==typeof e.transfer?e=>e.transfer():"function"==typeof structuredClone?e=>structuredClone(e,{transfer:[e]}):e=>e,Be(e)),Ue=e=>(Ue="boolean"==typeof e.detached?e=>e.detached:e=>0===e.byteLength,Ue(e));function ze(e,t,r){if(e.slice)return e.slice(t,r);const n=r-t,o=new ArrayBuffer(n);return Fe(o,0,e,t,n),o}function $e(e,t){const r=e[t];if(null!=r){if("function"!=typeof r)throw new TypeError(`${String(t)} is not a function`);return r}}function Ve(e){try{const t=e.done,r=e.value;return H(U(r),(e=>({done:t,value:e})))}catch(e){return V(e)}}const He=null!==(Me=null!==(Ne=Symbol.asyncIterator)&&void 0!==Ne?Ne:null===(We=Symbol.for)||void 0===We?void 0:We.call(Symbol,"Symbol.asyncIterator"))&&void 0!==Me?Me:"@@asyncIterator";function Ye(e,t="sync",r){if(void 0===r)if("async"===t){if(void 0===(r=$e(e,He)))return function(e){const t={next(){let t;try{t=Ge(e)}catch(e){return V(e)}return Ve(t)},return(t){let r;try{const n=$e(e.iterator,"return");if(void 0===n)return $({done:!0,value:t});r=Z(n,e.iterator,[t])}catch(e){return V(e)}return L(r)?Ve(r):V(new TypeError("The iterator.return() method must return an object"))}};return{iterator:t,nextMethod:t.next,done:!1}}(Ye(e,"sync",$e(e,Symbol.iterator)))}else r=$e(e,Symbol.iterator);if(void 0===r)throw new TypeError("The object is not iterable");const n=Z(r,e,[]);if(!L(n))throw new TypeError("The iterator method must return an object");return{iterator:n,nextMethod:n.next,done:!1}}function Ge(e){const t=Z(e.nextMethod,e.iterator,[]);if(!L(t))throw new TypeError("The iterator.next() method must return an object");return t}class Ke{constructor(e,t){this._ongoingPromise=void 0,this._isFinished=!1,this._reader=e,this._preventCancel=t}next(){const e=()=>this._nextSteps();return this._ongoingPromise=this._ongoingPromise?Q(this._ongoingPromise,e,e):e(),this._ongoingPromise}return(e){const t=()=>this._returnSteps(e);return this._ongoingPromise?Q(this._ongoingPromise,t,t):t()}_nextSteps(){if(this._isFinished)return Promise.resolve({value:void 0,done:!0});const e=this._reader;let t,r;const n=z(((e,n)=>{t=e,r=n}));return qe(e,{_chunkSteps:e=>{this._ongoingPromise=void 0,X((()=>t({value:e,done:!1})))},_closeSteps:()=>{this._ongoingPromise=void 0,this._isFinished=!0,le(e),t({value:void 0,done:!0})},_errorSteps:t=>{this._ongoingPromise=void 0,this._isFinished=!0,le(e),r(t)}}),n}_returnSteps(e){if(this._isFinished)return Promise.resolve({value:e,done:!0});this._isFinished=!0;const t=this._reader;if(!this._preventCancel){const r=ue(t,e);return le(t),Q(r,(()=>({value:e,done:!0})))}return le(t),$({value:e,done:!0})}}const Qe={next(){return Je(this)?this._asyncIteratorImpl.next():V(Xe("next"))},return(e){return Je(this)?this._asyncIteratorImpl.return(e):V(Xe("return"))},[He](){return this}};function Je(e){if(!L(e))return!1;if(!Object.prototype.hasOwnProperty.call(e,"_asyncIteratorImpl"))return!1;try{return e._asyncIteratorImpl instanceof Ke}catch(e){return!1}}function Xe(e){return new TypeError(`ReadableStreamAsyncIterator.${e} can only be used on a ReadableSteamAsyncIterator`)}Object.defineProperty(Qe,He,{enumerable:!1});const Ze=Number.isNaN||function(e){return e!=e};function et(e){const t=ze(e.buffer,e.byteOffset,e.byteOffset+e.byteLength);return new Uint8Array(t)}function tt(e){const t=e._queue.shift();return e._queueTotalSize-=t.size,e._queueTotalSize<0&&(e._queueTotalSize=0),t.value}function rt(e,t,r){if("number"!=typeof(n=r)||Ze(n)||n<0||r===1/0)throw new RangeError("Size must be a finite, non-NaN, non-negative number.");var n;e._queue.push({value:t,size:r}),e._queueTotalSize+=r}function nt(e){e._queue=new te,e._queueTotalSize=0}function ot(e){return e===DataView}class it{constructor(){throw new TypeError("Illegal constructor")}get view(){if(!ut(this))throw qt("view");return this._view}respond(e){if(!ut(this))throw qt("respond");if(ge(e,1,"respond"),e=Pe(e,"First parameter"),void 0===this._associatedReadableByteStreamController)throw new TypeError("This BYOB request has been invalidated");if(Ue(this._view.buffer))throw new TypeError("The BYOB request's buffer has been detached and so cannot be used as a response");It(this._associatedReadableByteStreamController,e)}respondWithNewView(e){if(!ut(this))throw qt("respondWithNewView");if(ge(e,1,"respondWithNewView"),!ArrayBuffer.isView(e))throw new TypeError("You can only respond with array buffer views");if(void 0===this._associatedReadableByteStreamController)throw new TypeError("This BYOB request has been invalidated");if(Ue(e.buffer))throw new TypeError("The given view's buffer has been detached and so cannot be used as a response");jt(this._associatedReadableByteStreamController,e)}}Object.defineProperties(it.prototype,{respond:{enumerable:!0},respondWithNewView:{enumerable:!0},view:{enumerable:!0}}),W(it.prototype.respond,"respond"),W(it.prototype.respondWithNewView,"respondWithNewView"),"symbol"==typeof Symbol.toStringTag&&Object.defineProperty(it.prototype,Symbol.toStringTag,{value:"ReadableStreamBYOBRequest",configurable:!0});class at{constructor(){throw new TypeError("Illegal constructor")}get byobRequest(){if(!st(this))throw xt("byobRequest");return At(this)}get desiredSize(){if(!st(this))throw xt("desiredSize");return Ct(this)}close(){if(!st(this))throw xt("close");if(this._closeRequested)throw new TypeError("The stream has already been closed; do not close it again!");const e=this._controlledReadableByteStream._state;if("readable"!==e)throw new TypeError(`The stream (in ${e} state) is not in the readable state and cannot be closed`);Pt(this)}enqueue(e){if(!st(this))throw xt("enqueue");if(ge(e,1,"enqueue"),!ArrayBuffer.isView(e))throw new TypeError("chunk must be an array buffer view");if(0===e.byteLength)throw new TypeError("chunk must have non-zero byteLength");if(0===e.buffer.byteLength)throw new TypeError("chunk's buffer must have non-zero byteLength");if(this._closeRequested)throw new TypeError("stream is closed or draining");const t=this._controlledReadableByteStream._state;if("readable"!==t)throw new TypeError(`The stream (in ${t} state) is not in the readable state and cannot be enqueued to`);Et(this,e)}error(e=void 0){if(!st(this))throw xt("error");Tt(this,e)}[oe](e){ct(this),nt(this);const t=this._cancelAlgorithm(e);return Ot(this),t}[ie](e){const t=this._controlledReadableByteStream;if(this._queueTotalSize>0)return void Rt(this,e);const r=this._autoAllocateChunkSize;if(void 0!==r){let n;try{n=new ArrayBuffer(r)}catch(t){return void e._errorSteps(t)}const o={buffer:n,bufferByteLength:r,byteOffset:0,byteLength:r,bytesFilled:0,minimumFill:1,elementSize:1,viewConstructor:Uint8Array,readerType:"default"};this._pendingPullIntos.push(o)}Re(t,e),lt(this)}[ae](){if(this._pendingPullIntos.length>0){const e=this._pendingPullIntos.peek();e.readerType="none",this._pendingPullIntos=new te,this._pendingPullIntos.push(e)}}}function st(e){return!!L(e)&&!!Object.prototype.hasOwnProperty.call(e,"_controlledReadableByteStream")&&e instanceof at}function ut(e){return!!L(e)&&!!Object.prototype.hasOwnProperty.call(e,"_associatedReadableByteStreamController")&&e instanceof it}function lt(e){const t=function(e){const t=e._controlledReadableByteStream;return"readable"===t._state&&(!e._closeRequested&&(!!e._started&&(!!(Ie(t)&&Ce(t)>0)||(!!(Dt(t)&&Mt(t)>0)||Ct(e)>0))))}(e);t&&(e._pulling?e._pullAgain=!0:(e._pulling=!0,Y(e._pullAlgorithm(),(()=>(e._pulling=!1,e._pullAgain&&(e._pullAgain=!1,lt(e)),null)),(t=>(Tt(e,t),null)))))}function ct(e){_t(e),e._pendingPullIntos=new te}function dt(e,t){let r=!1;"closed"===e._state&&(r=!0);const n=ft(t);"default"===t.readerType?Ae(e,n,r):function(e,t,r){const n=e._reader._readIntoRequests.shift();r?n._closeSteps(t):n._chunkSteps(t)}(e,n,r)}function ft(e){const t=e.bytesFilled,r=e.elementSize;return new e.viewConstructor(e.buffer,e.byteOffset,t/r)}function ht(e,t,r,n){e._queue.push({buffer:t,byteOffset:r,byteLength:n}),e._queueTotalSize+=n}function pt(e,t,r,n){let o;try{o=ze(t,r,r+n)}catch(t){throw Tt(e,t),t}ht(e,o,0,n)}function bt(e,t){t.bytesFilled>0&&pt(e,t.buffer,t.byteOffset,t.bytesFilled),St(e)}function yt(e,t){const r=Math.min(e._queueTotalSize,t.byteLength-t.bytesFilled),n=t.bytesFilled+r;let o=r,i=!1;const a=n-n%t.elementSize;a>=t.minimumFill&&(o=a-t.bytesFilled,i=!0);const s=e._queue;for(;o>0;){const r=s.peek(),n=Math.min(o,r.byteLength),i=t.byteOffset+t.bytesFilled;Fe(t.buffer,i,r.buffer,r.byteOffset,n),r.byteLength===n?s.shift():(r.byteOffset+=n,r.byteLength-=n),e._queueTotalSize-=n,mt(0,n,t),o-=n}return i}function mt(e,t,r){r.bytesFilled+=t}function vt(e){0===e._queueTotalSize&&e._closeRequested?(Ot(e),vn(e._controlledReadableByteStream)):lt(e)}function _t(e){null!==e._byobRequest&&(e._byobRequest._associatedReadableByteStreamController=void 0,e._byobRequest._view=null,e._byobRequest=null)}function gt(e){for(;e._pendingPullIntos.length>0;){if(0===e._queueTotalSize)return;const t=e._pendingPullIntos.peek();yt(e,t)&&(St(e),dt(e._controlledReadableByteStream,t))}}function wt(e,t){const r=e._pendingPullIntos.peek();_t(e),"closed"===e._controlledReadableByteStream._state?function(e,t){"none"===t.readerType&&St(e);const r=e._controlledReadableByteStream;if(Dt(r))for(;Mt(r)>0;)dt(r,St(e))}(e,r):function(e,t,r){if(mt(0,t,r),"none"===r.readerType)return bt(e,r),void gt(e);if(r.bytesFilled<r.minimumFill)return;St(e);const n=r.bytesFilled%r.elementSize;if(n>0){const t=r.byteOffset+r.bytesFilled;pt(e,r.buffer,t-n,n)}r.bytesFilled-=n,dt(e._controlledReadableByteStream,r),gt(e)}(e,t,r),lt(e)}function St(e){return e._pendingPullIntos.shift()}function Ot(e){e._pullAlgorithm=void 0,e._cancelAlgorithm=void 0}function Pt(e){const t=e._controlledReadableByteStream;if(!e._closeRequested&&"readable"===t._state)if(e._queueTotalSize>0)e._closeRequested=!0;else{if(e._pendingPullIntos.length>0){const t=e._pendingPullIntos.peek();if(t.bytesFilled%t.elementSize!=0){const t=new TypeError("Insufficient bytes to fill elements in the given buffer");throw Tt(e,t),t}}Ot(e),vn(t)}}function Et(e,t){const r=e._controlledReadableByteStream;if(e._closeRequested||"readable"!==r._state)return;const{buffer:n,byteOffset:o,byteLength:i}=t;if(Ue(n))throw new TypeError("chunk's buffer is detached and so cannot be enqueued");const a=Be(n);if(e._pendingPullIntos.length>0){const t=e._pendingPullIntos.peek();if(Ue(t.buffer))throw new TypeError("The BYOB request's buffer has been detached and so cannot be filled with an enqueued chunk");_t(e),t.buffer=Be(t.buffer),"none"===t.readerType&&bt(e,t)}Ie(r)?(function(e){const t=e._controlledReadableByteStream._reader;for(;t._readRequests.length>0;){if(0===e._queueTotalSize)return;Rt(e,t._readRequests.shift())}}(e),0===Ce(r)?ht(e,a,o,i):(e._pendingPullIntos.length>0&&St(e),Ae(r,new Uint8Array(a,o,i),!1))):Dt(r)?(ht(e,a,o,i),gt(e)):ht(e,a,o,i),lt(e)}function Tt(e,t){const r=e._controlledReadableByteStream;"readable"===r._state&&(ct(e),nt(e),Ot(e),_n(r,t))}function Rt(e,t){const r=e._queue.shift();e._queueTotalSize-=r.byteLength,vt(e);const n=new Uint8Array(r.buffer,r.byteOffset,r.byteLength);t._chunkSteps(n)}function At(e){if(null===e._byobRequest&&e._pendingPullIntos.length>0){const t=e._pendingPullIntos.peek(),r=new Uint8Array(t.buffer,t.byteOffset+t.bytesFilled,t.byteLength-t.bytesFilled),n=Object.create(it.prototype);!function(e,t,r){e._associatedReadableByteStreamController=t,e._view=r}(n,e,r),e._byobRequest=n}return e._byobRequest}function Ct(e){const t=e._controlledReadableByteStream._state;return"errored"===t?null:"closed"===t?0:e._strategyHWM-e._queueTotalSize}function It(e,t){const r=e._pendingPullIntos.peek();if("closed"===e._controlledReadableByteStream._state){if(0!==t)throw new TypeError("bytesWritten must be 0 when calling respond() on a closed stream")}else{if(0===t)throw new TypeError("bytesWritten must be greater than 0 when calling respond() on a readable stream");if(r.bytesFilled+t>r.byteLength)throw new RangeError("bytesWritten out of range")}r.buffer=Be(r.buffer),wt(e,t)}function jt(e,t){const r=e._pendingPullIntos.peek();if("closed"===e._controlledReadableByteStream._state){if(0!==t.byteLength)throw new TypeError("The view's length must be 0 when calling respondWithNewView() on a closed stream")}else if(0===t.byteLength)throw new TypeError("The view's length must be greater than 0 when calling respondWithNewView() on a readable stream");if(r.byteOffset+r.bytesFilled!==t.byteOffset)throw new RangeError("The region specified by view does not match byobRequest");if(r.bufferByteLength!==t.buffer.byteLength)throw new RangeError("The buffer of view has different capacity than byobRequest");if(r.bytesFilled+t.byteLength>r.byteLength)throw new RangeError("The region specified by view is larger than byobRequest");const n=t.byteLength;r.buffer=Be(t.buffer),wt(e,n)}function kt(e,t,r,n,o,i,a){t._controlledReadableByteStream=e,t._pullAgain=!1,t._pulling=!1,t._byobRequest=null,t._queue=t._queueTotalSize=void 0,nt(t),t._closeRequested=!1,t._started=!1,t._strategyHWM=i,t._pullAlgorithm=n,t._cancelAlgorithm=o,t._autoAllocateChunkSize=a,t._pendingPullIntos=new te,e._readableStreamController=t,Y($(r()),(()=>(t._started=!0,lt(t),null)),(e=>(Tt(t,e),null)))}function qt(e){return new TypeError(`ReadableStreamBYOBRequest.prototype.${e} can only be used on a ReadableStreamBYOBRequest`)}function xt(e){return new TypeError(`ReadableByteStreamController.prototype.${e} can only be used on a ReadableByteStreamController`)}function Lt(e,t){if("byob"!=(e=`${e}`))throw new TypeError(`${t} '${e}' is not a valid enumeration value for ReadableStreamReaderMode`);return e}function Nt(e){return new Ft(e)}function Wt(e,t){e._reader._readIntoRequests.push(t)}function Mt(e){return e._reader._readIntoRequests.length}function Dt(e){const t=e._reader;return void 0!==t&&!!Bt(t)}Object.defineProperties(at.prototype,{close:{enumerable:!0},enqueue:{enumerable:!0},error:{enumerable:!0},byobRequest:{enumerable:!0},desiredSize:{enumerable:!0}}),W(at.prototype.close,"close"),W(at.prototype.enqueue,"enqueue"),W(at.prototype.error,"error"),"symbol"==typeof Symbol.toStringTag&&Object.defineProperty(at.prototype,Symbol.toStringTag,{value:"ReadableByteStreamController",configurable:!0});class Ft{constructor(e){if(ge(e,1,"ReadableStreamBYOBReader"),Ee(e,"First parameter"),yn(e))throw new TypeError("This stream has already been locked for exclusive reading by another reader");if(!st(e._readableStreamController))throw new TypeError("Cannot construct a ReadableStreamBYOBReader for a stream not constructed with a byte source");se(this,e),this._readIntoRequests=new te}get closed(){return Bt(this)?this._closedPromise:V($t("closed"))}cancel(e=void 0){return Bt(this)?void 0===this._ownerReadableStream?V(ce("cancel")):ue(this,e):V($t("cancel"))}read(e,t={}){if(!Bt(this))return V($t("read"));if(!ArrayBuffer.isView(e))return V(new TypeError("view must be an array buffer view"));if(0===e.byteLength)return V(new TypeError("view must have non-zero byteLength"));if(0===e.buffer.byteLength)return V(new TypeError("view's buffer must have non-zero byteLength"));if(Ue(e.buffer))return V(new TypeError("view's buffer has been detached"));let r;try{r=function(e,t){var r;return me(e,t),{min:Pe(null!==(r=null==e?void 0:e.min)&&void 0!==r?r:1,`${t} has member 'min' that`)}}(t,"options")}catch(e){return V(e)}const n=r.min;if(0===n)return V(new TypeError("options.min must be greater than 0"));if(function(e){return ot(e.constructor)}(e)){if(n>e.byteLength)return V(new RangeError("options.min must be less than or equal to view's byteLength"))}else if(n>e.length)return V(new RangeError("options.min must be less than or equal to view's length"));if(void 0===this._ownerReadableStream)return V(ce("read from"));let o,i;const a=z(((e,t)=>{o=e,i=t}));return Ut(this,e,n,{_chunkSteps:e=>o({value:e,done:!1}),_closeSteps:e=>o({value:e,done:!0}),_errorSteps:e=>i(e)}),a}releaseLock(){if(!Bt(this))throw $t("releaseLock");void 0!==this._ownerReadableStream&&function(e){le(e),zt(e,new TypeError("Reader was released"))}(this)}}function Bt(e){return!!L(e)&&!!Object.prototype.hasOwnProperty.call(e,"_readIntoRequests")&&e instanceof Ft}function Ut(e,t,r,n){const o=e._ownerReadableStream;o._disturbed=!0,"errored"===o._state?n._errorSteps(o._storedError):function(e,t,r,n){const o=e._controlledReadableByteStream,i=t.constructor,a=function(e){return ot(e)?1:e.BYTES_PER_ELEMENT}(i),{byteOffset:s,byteLength:u}=t,l=r*a;let c;try{c=Be(t.buffer)}catch(e){return void n._errorSteps(e)}const d={buffer:c,bufferByteLength:c.byteLength,byteOffset:s,byteLength:u,bytesFilled:0,minimumFill:l,elementSize:a,viewConstructor:i,readerType:"byob"};if(e._pendingPullIntos.length>0)return e._pendingPullIntos.push(d),void Wt(o,n);if("closed"!==o._state){if(e._queueTotalSize>0){if(yt(e,d)){const t=ft(d);return vt(e),void n._chunkSteps(t)}if(e._closeRequested){const t=new TypeError("Insufficient bytes to fill elements in the given buffer");return Tt(e,t),void n._errorSteps(t)}}e._pendingPullIntos.push(d),Wt(o,n),lt(e)}else{const e=new i(d.buffer,d.byteOffset,0);n._closeSteps(e)}}(o._readableStreamController,t,r,n)}function zt(e,t){const r=e._readIntoRequests;e._readIntoRequests=new te,r.forEach((e=>{e._errorSteps(t)}))}function $t(e){return new TypeError(`ReadableStreamBYOBReader.prototype.${e} can only be used on a ReadableStreamBYOBReader`)}function Vt(e,t){const{highWaterMark:r}=e;if(void 0===r)return t;if(Ze(r)||r<0)throw new RangeError("Invalid highWaterMark");return r}function Ht(e){const{size:t}=e;return t||(()=>1)}function Yt(e,t){me(e,t);const r=null==e?void 0:e.highWaterMark,n=null==e?void 0:e.size;return{highWaterMark:void 0===r?void 0:Se(r),size:void 0===n?void 0:Gt(n,`${t} has member 'size' that`)}}function Gt(e,t){return ve(e,t),t=>Se(e(t))}function Kt(e,t,r){return ve(e,r),r=>ee(e,t,[r])}function Qt(e,t,r){return ve(e,r),()=>ee(e,t,[])}function Jt(e,t,r){return ve(e,r),r=>Z(e,t,[r])}function Xt(e,t,r){return ve(e,r),(r,n)=>ee(e,t,[r,n])}function Zt(e,t){if(!or(e))throw new TypeError(`${t} is not a WritableStream.`)}Object.defineProperties(Ft.prototype,{cancel:{enumerable:!0},read:{enumerable:!0},releaseLock:{enumerable:!0},closed:{enumerable:!0}}),W(Ft.prototype.cancel,"cancel"),W(Ft.prototype.read,"read"),W(Ft.prototype.releaseLock,"releaseLock"),"symbol"==typeof Symbol.toStringTag&&Object.defineProperty(Ft.prototype,Symbol.toStringTag,{value:"ReadableStreamBYOBReader",configurable:!0});const er="function"==typeof AbortController;class tr{constructor(e={},t={}){void 0===e?e=null:_e(e,"First parameter");const r=Yt(t,"Second parameter"),n=function(e,t){me(e,t);const r=null==e?void 0:e.abort,n=null==e?void 0:e.close,o=null==e?void 0:e.start,i=null==e?void 0:e.type,a=null==e?void 0:e.write;return{abort:void 0===r?void 0:Kt(r,e,`${t} has member 'abort' that`),close:void 0===n?void 0:Qt(n,e,`${t} has member 'close' that`),start:void 0===o?void 0:Jt(o,e,`${t} has member 'start' that`),write:void 0===a?void 0:Xt(a,e,`${t} has member 'write' that`),type:i}}(e,"First parameter");if(nr(this),void 0!==n.type)throw new RangeError("Invalid type is specified");const o=Ht(r);!function(e,t,r,n){const o=Object.create(wr.prototype);let i,a,s,u;i=void 0!==t.start?()=>t.start(o):()=>{},a=void 0!==t.write?e=>t.write(e,o):()=>$(void 0),s=void 0!==t.close?()=>t.close():()=>$(void 0),u=void 0!==t.abort?e=>t.abort(e):()=>$(void 0),Or(e,o,i,a,s,u,r,n)}(this,n,Vt(r,1),o)}get locked(){if(!or(this))throw Ir("locked");return ir(this)}abort(e=void 0){return or(this)?ir(this)?V(new TypeError("Cannot abort a stream that already has a writer")):ar(this,e):V(Ir("abort"))}close(){return or(this)?ir(this)?V(new TypeError("Cannot close a stream that already has a writer")):dr(this)?V(new TypeError("Cannot close an already-closing stream")):sr(this):V(Ir("close"))}getWriter(){if(!or(this))throw Ir("getWriter");return rr(this)}}function rr(e){return new pr(e)}function nr(e){e._state="writable",e._storedError=void 0,e._writer=void 0,e._writableStreamController=void 0,e._writeRequests=new te,e._inFlightWriteRequest=void 0,e._closeRequest=void 0,e._inFlightCloseRequest=void 0,e._pendingAbortRequest=void 0,e._backpressure=!1}function or(e){return!!L(e)&&!!Object.prototype.hasOwnProperty.call(e,"_writableStreamController")&&e instanceof tr}function ir(e){return void 0!==e._writer}function ar(e,t){var r;if("closed"===e._state||"errored"===e._state)return $(void 0);e._writableStreamController._abortReason=t,null===(r=e._writableStreamController._abortController)||void 0===r||r.abort(t);const n=e._state;if("closed"===n||"errored"===n)return $(void 0);if(void 0!==e._pendingAbortRequest)return e._pendingAbortRequest._promise;let o=!1;"erroring"===n&&(o=!0,t=void 0);const i=z(((r,n)=>{e._pendingAbortRequest={_promise:void 0,_resolve:r,_reject:n,_reason:t,_wasAlreadyErroring:o}}));return e._pendingAbortRequest._promise=i,o||lr(e,t),i}function sr(e){const t=e._state;if("closed"===t||"errored"===t)return V(new TypeError(`The stream (in ${t} state) is not in the writable state and cannot be closed`));const r=z(((t,r)=>{const n={_resolve:t,_reject:r};e._closeRequest=n})),n=e._writer;var o;return void 0!==n&&e._backpressure&&"writable"===t&&Ur(n),rt(o=e._writableStreamController,gr,0),Tr(o),r}function ur(e,t){"writable"!==e._state?cr(e):lr(e,t)}function lr(e,t){const r=e._writableStreamController;e._state="erroring",e._storedError=t;const n=e._writer;void 0!==n&&mr(n,t),!function(e){return void 0!==e._inFlightWriteRequest||void 0!==e._inFlightCloseRequest}(e)&&r._started&&cr(e)}function cr(e){e._state="errored",e._writableStreamController[ne]();const t=e._storedError;if(e._writeRequests.forEach((e=>{e._reject(t)})),e._writeRequests=new te,void 0===e._pendingAbortRequest)return void fr(e);const r=e._pendingAbortRequest;if(e._pendingAbortRequest=void 0,r._wasAlreadyErroring)return r._reject(t),void fr(e);Y(e._writableStreamController[re](r._reason),(()=>(r._resolve(),fr(e),null)),(t=>(r._reject(t),fr(e),null)))}function dr(e){return void 0!==e._closeRequest||void 0!==e._inFlightCloseRequest}function fr(e){void 0!==e._closeRequest&&(e._closeRequest._reject(e._storedError),e._closeRequest=void 0);const t=e._writer;void 0!==t&&Nr(t,e._storedError)}function hr(e,t){const r=e._writer;void 0!==r&&t!==e._backpressure&&(t?function(e){Mr(e)}(r):Ur(r)),e._backpressure=t}Object.defineProperties(tr.prototype,{abort:{enumerable:!0},close:{enumerable:!0},getWriter:{enumerable:!0},locked:{enumerable:!0}}),W(tr.prototype.abort,"abort"),W(tr.prototype.close,"close"),W(tr.prototype.getWriter,"getWriter"),"symbol"==typeof Symbol.toStringTag&&Object.defineProperty(tr.prototype,Symbol.toStringTag,{value:"WritableStream",configurable:!0});class pr{constructor(e){if(ge(e,1,"WritableStreamDefaultWriter"),Zt(e,"First parameter"),ir(e))throw new TypeError("This stream has already been locked for exclusive writing by another writer");this._ownerWritableStream=e,e._writer=this;const t=e._state;if("writable"===t)!dr(e)&&e._backpressure?Mr(this):Fr(this),xr(this);else if("erroring"===t)Dr(this,e._storedError),xr(this);else if("closed"===t)Fr(this),xr(this),Wr(this);else{const t=e._storedError;Dr(this,t),Lr(this,t)}}get closed(){return br(this)?this._closedPromise:V(kr("closed"))}get desiredSize(){if(!br(this))throw kr("desiredSize");if(void 0===this._ownerWritableStream)throw qr("desiredSize");return function(e){const t=e._ownerWritableStream,r=t._state;return"errored"===r||"erroring"===r?null:"closed"===r?0:Er(t._writableStreamController)}(this)}get ready(){return br(this)?this._readyPromise:V(kr("ready"))}abort(e=void 0){return br(this)?void 0===this._ownerWritableStream?V(qr("abort")):function(e,t){return ar(e._ownerWritableStream,t)}(this,e):V(kr("abort"))}close(){if(!br(this))return V(kr("close"));const e=this._ownerWritableStream;return void 0===e?V(qr("close")):dr(e)?V(new TypeError("Cannot close an already-closing stream")):yr(this)}releaseLock(){if(!br(this))throw kr("releaseLock");void 0!==this._ownerWritableStream&&vr(this)}write(e=void 0){return br(this)?void 0===this._ownerWritableStream?V(qr("write to")):_r(this,e):V(kr("write"))}}function br(e){return!!L(e)&&!!Object.prototype.hasOwnProperty.call(e,"_ownerWritableStream")&&e instanceof pr}function yr(e){return sr(e._ownerWritableStream)}function mr(e,t){"pending"===e._readyPromiseState?Br(e,t):function(e,t){Dr(e,t)}(e,t)}function vr(e){const t=e._ownerWritableStream,r=new TypeError("Writer was released and can no longer be used to monitor the stream's closedness");mr(e,r),function(e,t){"pending"===e._closedPromiseState?Nr(e,t):function(e,t){Lr(e,t)}(e,t)}(e,r),t._writer=void 0,e._ownerWritableStream=void 0}function _r(e,t){const r=e._ownerWritableStream,n=r._writableStreamController,o=function(e,t){try{return e._strategySizeAlgorithm(t)}catch(t){return Rr(e,t),1}}(n,t);if(r!==e._ownerWritableStream)return V(qr("write to"));const i=r._state;if("errored"===i)return V(r._storedError);if(dr(r)||"closed"===i)return V(new TypeError("The stream is closing or closed and cannot be written to"));if("erroring"===i)return V(r._storedError);const a=function(e){return z(((t,r)=>{const n={_resolve:t,_reject:r};e._writeRequests.push(n)}))}(r);return function(e,t,r){try{rt(e,t,r)}catch(t){return void Rr(e,t)}const n=e._controlledWritableStream;dr(n)||"writable"!==n._state||hr(n,Ar(e)),Tr(e)}(n,t,o),a}Object.defineProperties(pr.prototype,{abort:{enumerable:!0},close:{enumerable:!0},releaseLock:{enumerable:!0},write:{enumerable:!0},closed:{enumerable:!0},desiredSize:{enumerable:!0},ready:{enumerable:!0}}),W(pr.prototype.abort,"abort"),W(pr.prototype.close,"close"),W(pr.prototype.releaseLock,"releaseLock"),W(pr.prototype.write,"write"),"symbol"==typeof Symbol.toStringTag&&Object.defineProperty(pr.prototype,Symbol.toStringTag,{value:"WritableStreamDefaultWriter",configurable:!0});const gr={};class wr{constructor(){throw new TypeError("Illegal constructor")}get abortReason(){if(!Sr(this))throw jr("abortReason");return this._abortReason}get signal(){if(!Sr(this))throw jr("signal");if(void 0===this._abortController)throw new TypeError("WritableStreamDefaultController.prototype.signal is not supported");return this._abortController.signal}error(e=void 0){if(!Sr(this))throw jr("error");"writable"===this._controlledWritableStream._state&&Cr(this,e)}[re](e){const t=this._abortAlgorithm(e);return Pr(this),t}[ne](){nt(this)}}function Sr(e){return!!L(e)&&!!Object.prototype.hasOwnProperty.call(e,"_controlledWritableStream")&&e instanceof wr}function Or(e,t,r,n,o,i,a,s){t._controlledWritableStream=e,e._writableStreamController=t,t._queue=void 0,t._queueTotalSize=void 0,nt(t),t._abortReason=void 0,t._abortController=function(){if(er)return new AbortController}(),t._started=!1,t._strategySizeAlgorithm=s,t._strategyHWM=a,t._writeAlgorithm=n,t._closeAlgorithm=o,t._abortAlgorithm=i;const u=Ar(t);hr(e,u),Y($(r()),(()=>(t._started=!0,Tr(t),null)),(r=>(t._started=!0,ur(e,r),null)))}function Pr(e){e._writeAlgorithm=void 0,e._closeAlgorithm=void 0,e._abortAlgorithm=void 0,e._strategySizeAlgorithm=void 0}function Er(e){return e._strategyHWM-e._queueTotalSize}function Tr(e){const t=e._controlledWritableStream;if(!e._started)return;if(void 0!==t._inFlightWriteRequest)return;if("erroring"===t._state)return void cr(t);if(0===e._queue.length)return;const r=e._queue.peek().value;r===gr?function(e){const t=e._controlledWritableStream;(function(e){e._inFlightCloseRequest=e._closeRequest,e._closeRequest=void 0})(t),tt(e);const r=e._closeAlgorithm();Pr(e),Y(r,(()=>(function(e){e._inFlightCloseRequest._resolve(void 0),e._inFlightCloseRequest=void 0,"erroring"===e._state&&(e._storedError=void 0,void 0!==e._pendingAbortRequest&&(e._pendingAbortRequest._resolve(),e._pendingAbortRequest=void 0)),e._state="closed";const t=e._writer;void 0!==t&&Wr(t)}(t),null)),(e=>(function(e,t){e._inFlightCloseRequest._reject(t),e._inFlightCloseRequest=void 0,void 0!==e._pendingAbortRequest&&(e._pendingAbortRequest._reject(t),e._pendingAbortRequest=void 0),ur(e,t)}(t,e),null)))}(e):function(e,t){const r=e._controlledWritableStream;!function(e){e._inFlightWriteRequest=e._writeRequests.shift()}(r),Y(e._writeAlgorithm(t),(()=>{!function(e){e._inFlightWriteRequest._resolve(void 0),e._inFlightWriteRequest=void 0}(r);const t=r._state;if(tt(e),!dr(r)&&"writable"===t){const t=Ar(e);hr(r,t)}return Tr(e),null}),(t=>("writable"===r._state&&Pr(e),function(e,t){e._inFlightWriteRequest._reject(t),e._inFlightWriteRequest=void 0,ur(e,t)}(r,t),null)))}(e,r)}function Rr(e,t){"writable"===e._controlledWritableStream._state&&Cr(e,t)}function Ar(e){return Er(e)<=0}function Cr(e,t){const r=e._controlledWritableStream;Pr(e),lr(r,t)}function Ir(e){return new TypeError(`WritableStream.prototype.${e} can only be used on a WritableStream`)}function jr(e){return new TypeError(`WritableStreamDefaultController.prototype.${e} can only be used on a WritableStreamDefaultController`)}function kr(e){return new TypeError(`WritableStreamDefaultWriter.prototype.${e} can only be used on a WritableStreamDefaultWriter`)}function qr(e){return new TypeError("Cannot "+e+" a stream using a released writer")}function xr(e){e._closedPromise=z(((t,r)=>{e._closedPromise_resolve=t,e._closedPromise_reject=r,e._closedPromiseState="pending"}))}function Lr(e,t){xr(e),Nr(e,t)}function Nr(e,t){void 0!==e._closedPromise_reject&&(J(e._closedPromise),e._closedPromise_reject(t),e._closedPromise_resolve=void 0,e._closedPromise_reject=void 0,e._closedPromiseState="rejected")}function Wr(e){void 0!==e._closedPromise_resolve&&(e._closedPromise_resolve(void 0),e._closedPromise_resolve=void 0,e._closedPromise_reject=void 0,e._closedPromiseState="resolved")}function Mr(e){e._readyPromise=z(((t,r)=>{e._readyPromise_resolve=t,e._readyPromise_reject=r})),e._readyPromiseState="pending"}function Dr(e,t){Mr(e),Br(e,t)}function Fr(e){Mr(e),Ur(e)}function Br(e,t){void 0!==e._readyPromise_reject&&(J(e._readyPromise),e._readyPromise_reject(t),e._readyPromise_resolve=void 0,e._readyPromise_reject=void 0,e._readyPromiseState="rejected")}function Ur(e){void 0!==e._readyPromise_resolve&&(e._readyPromise_resolve(void 0),e._readyPromise_resolve=void 0,e._readyPromise_reject=void 0,e._readyPromiseState="fulfilled")}Object.defineProperties(wr.prototype,{abortReason:{enumerable:!0},signal:{enumerable:!0},error:{enumerable:!0}}),"symbol"==typeof Symbol.toStringTag&&Object.defineProperty(wr.prototype,Symbol.toStringTag,{value:"WritableStreamDefaultController",configurable:!0});const zr="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof global?global:void 0,$r=function(){const e=null==zr?void 0:zr.DOMException;return function(e){if("function"!=typeof e&&"object"!=typeof e)return!1;if("DOMException"!==e.name)return!1;try{return new e,!0}catch(e){return!1}}(e)?e:void 0}()||function(){const e=function(e,t){this.message=e||"",this.name=t||"Error",Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor)};return W(e,"DOMException"),e.prototype=Object.create(Error.prototype),Object.defineProperty(e.prototype,"constructor",{value:e,writable:!0,configurable:!0}),e}();function Vr(e,t,r,n,o,i){const a=Te(e),s=rr(t);e._disturbed=!0;let u=!1,l=$(void 0);return z(((c,d)=>{let f;if(void 0!==i){if(f=()=>{const r=void 0!==i.reason?i.reason:new $r("Aborted","AbortError"),a=[];n||a.push((()=>"writable"===t._state?ar(t,r):$(void 0))),o||a.push((()=>"readable"===e._state?mn(e,r):$(void 0))),v((()=>Promise.all(a.map((e=>e())))),!0,r)},i.aborted)return void f();i.addEventListener("abort",f)}var h,p,b;if(m(e,a._closedPromise,(e=>(n?_(!0,e):v((()=>ar(t,e)),!0,e),null))),m(t,s._closedPromise,(t=>(o?_(!0,t):v((()=>mn(e,t)),!0,t),null))),h=e,p=a._closedPromise,b=()=>(r?_():v((()=>function(e){const t=e._ownerWritableStream,r=t._state;return dr(t)||"closed"===r?$(void 0):"errored"===r?V(t._storedError):yr(e)}(s))),null),"closed"===h._state?b():G(p,b),dr(t)||"closed"===t._state){const t=new TypeError("the destination writable stream closed before all data could be piped to it");o?_(!0,t):v((()=>mn(e,t)),!0,t)}function y(){const e=l;return H(l,(()=>e!==l?y():void 0))}function m(e,t,r){"errored"===e._state?r(e._storedError):K(t,r)}function v(e,r,n){function o(){return Y(e(),(()=>g(r,n)),(e=>g(!0,e))),null}u||(u=!0,"writable"!==t._state||dr(t)?o():G(y(),o))}function _(e,r){u||(u=!0,"writable"!==t._state||dr(t)?g(e,r):G(y(),(()=>g(e,r))))}function g(e,t){return vr(s),le(a),void 0!==i&&i.removeEventListener("abort",f),e?d(t):c(void 0),null}J(z(((e,t)=>{!function r(n){n?e():H(u?$(!0):H(s._readyPromise,(()=>z(((e,t)=>{qe(a,{_chunkSteps:t=>{l=H(_r(s,t),void 0,x),e(!1)},_closeSteps:()=>e(!0),_errorSteps:t})})))),r,t)}(!1)})))}))}class Hr{constructor(){throw new TypeError("Illegal constructor")}get desiredSize(){if(!Yr(this))throw nn("desiredSize");return en(this)}close(){if(!Yr(this))throw nn("close");if(!tn(this))throw new TypeError("The stream is not in a state that permits close");Jr(this)}enqueue(e=void 0){if(!Yr(this))throw nn("enqueue");if(!tn(this))throw new TypeError("The stream is not in a state that permits enqueue");return Xr(this,e)}error(e=void 0){if(!Yr(this))throw nn("error");Zr(this,e)}[oe](e){nt(this);const t=this._cancelAlgorithm(e);return Qr(this),t}[ie](e){const t=this._controlledReadableStream;if(this._queue.length>0){const r=tt(this);this._closeRequested&&0===this._queue.length?(Qr(this),vn(t)):Gr(this),e._chunkSteps(r)}else Re(t,e),Gr(this)}[ae](){}}function Yr(e){return!!L(e)&&!!Object.prototype.hasOwnProperty.call(e,"_controlledReadableStream")&&e instanceof Hr}function Gr(e){Kr(e)&&(e._pulling?e._pullAgain=!0:(e._pulling=!0,Y(e._pullAlgorithm(),(()=>(e._pulling=!1,e._pullAgain&&(e._pullAgain=!1,Gr(e)),null)),(t=>(Zr(e,t),null)))))}function Kr(e){const t=e._controlledReadableStream;return!!tn(e)&&!!e._started&&(!!(yn(t)&&Ce(t)>0)||en(e)>0)}function Qr(e){e._pullAlgorithm=void 0,e._cancelAlgorithm=void 0,e._strategySizeAlgorithm=void 0}function Jr(e){if(!tn(e))return;const t=e._controlledReadableStream;e._closeRequested=!0,0===e._queue.length&&(Qr(e),vn(t))}function Xr(e,t){if(!tn(e))return;const r=e._controlledReadableStream;if(yn(r)&&Ce(r)>0)Ae(r,t,!1);else{let r;try{r=e._strategySizeAlgorithm(t)}catch(t){throw Zr(e,t),t}try{rt(e,t,r)}catch(t){throw Zr(e,t),t}}Gr(e)}function Zr(e,t){const r=e._controlledReadableStream;"readable"===r._state&&(nt(e),Qr(e),_n(r,t))}function en(e){const t=e._controlledReadableStream._state;return"errored"===t?null:"closed"===t?0:e._strategyHWM-e._queueTotalSize}function tn(e){const t=e._controlledReadableStream._state;return!e._closeRequested&&"readable"===t}function rn(e,t,r,n,o,i,a){t._controlledReadableStream=e,t._queue=void 0,t._queueTotalSize=void 0,nt(t),t._started=!1,t._closeRequested=!1,t._pullAgain=!1,t._pulling=!1,t._strategySizeAlgorithm=a,t._strategyHWM=i,t._pullAlgorithm=n,t._cancelAlgorithm=o,e._readableStreamController=t,Y($(r()),(()=>(t._started=!0,Gr(t),null)),(e=>(Zr(t,e),null)))}function nn(e){return new TypeError(`ReadableStreamDefaultController.prototype.${e} can only be used on a ReadableStreamDefaultController`)}function on(e){return L(t=e)&&void 0!==t.getReader?function(e){let t;return t=fn(x,(function(){let r;try{r=e.read()}catch(r){return V(r)}return Q(r,(e=>{if(!L(e))throw new TypeError("The promise returned by the reader.read() method must fulfill with an object");if(e.done)Jr(t._readableStreamController);else{const r=e.value;Xr(t._readableStreamController,r)}}))}),(function(t){try{return $(e.cancel(t))}catch(t){return V(t)}}),0),t}(e.getReader()):function(e){let t;const r=Ye(e,"async");return t=fn(x,(function(){let e;try{e=Ge(r)}catch(e){return V(e)}return Q($(e),(e=>{if(!L(e))throw new TypeError("The promise returned by the iterator.next() method must fulfill with an object");if(e.done)Jr(t._readableStreamController);else{const r=e.value;Xr(t._readableStreamController,r)}}))}),(function(e){const t=r.iterator;let n;try{n=$e(t,"return")}catch(e){return V(e)}return void 0===n?$(void 0):Q(ee(n,t,[e]),(e=>{if(!L(e))throw new TypeError("The promise returned by the iterator.return() method must fulfill with an object")}))}),0),t}(e);var t}function an(e,t,r){return ve(e,r),r=>ee(e,t,[r])}function sn(e,t,r){return ve(e,r),r=>ee(e,t,[r])}function un(e,t,r){return ve(e,r),r=>Z(e,t,[r])}function ln(e,t){if("bytes"!=(e=`${e}`))throw new TypeError(`${t} '${e}' is not a valid enumeration value for ReadableStreamType`);return e}function cn(e,t){me(e,t);const r=null==e?void 0:e.preventAbort,n=null==e?void 0:e.preventCancel,o=null==e?void 0:e.preventClose,i=null==e?void 0:e.signal;return void 0!==i&&function(e,t){if(!function(e){if("object"!=typeof e||null===e)return!1;try{return"boolean"==typeof e.aborted}catch(e){return!1}}(e))throw new TypeError(`${t} is not an AbortSignal.`)}(i,`${t} has member 'signal' that`),{preventAbort:Boolean(r),preventCancel:Boolean(n),preventClose:Boolean(o),signal:i}}Object.defineProperties(Hr.prototype,{close:{enumerable:!0},enqueue:{enumerable:!0},error:{enumerable:!0},desiredSize:{enumerable:!0}}),W(Hr.prototype.close,"close"),W(Hr.prototype.enqueue,"enqueue"),W(Hr.prototype.error,"error"),"symbol"==typeof Symbol.toStringTag&&Object.defineProperty(Hr.prototype,Symbol.toStringTag,{value:"ReadableStreamDefaultController",configurable:!0});class dn{constructor(e={},t={}){void 0===e?e=null:_e(e,"First parameter");const r=Yt(t,"Second parameter"),n=function(e,t){me(e,t);const r=e,n=null==r?void 0:r.autoAllocateChunkSize,o=null==r?void 0:r.cancel,i=null==r?void 0:r.pull,a=null==r?void 0:r.start,s=null==r?void 0:r.type;return{autoAllocateChunkSize:void 0===n?void 0:Pe(n,`${t} has member 'autoAllocateChunkSize' that`),cancel:void 0===o?void 0:an(o,r,`${t} has member 'cancel' that`),pull:void 0===i?void 0:sn(i,r,`${t} has member 'pull' that`),start:void 0===a?void 0:un(a,r,`${t} has member 'start' that`),type:void 0===s?void 0:ln(s,`${t} has member 'type' that`)}}(e,"First parameter");if(pn(this),"bytes"===n.type){if(void 0!==r.size)throw new RangeError("The strategy for a byte stream cannot have a size function");!function(e,t,r){const n=Object.create(at.prototype);let o,i,a;o=void 0!==t.start?()=>t.start(n):()=>{},i=void 0!==t.pull?()=>t.pull(n):()=>$(void 0),a=void 0!==t.cancel?e=>t.cancel(e):()=>$(void 0);const s=t.autoAllocateChunkSize;if(0===s)throw new TypeError("autoAllocateChunkSize must be greater than 0");kt(e,n,o,i,a,r,s)}(this,n,Vt(r,0))}else{const e=Ht(r);!function(e,t,r,n){const o=Object.create(Hr.prototype);let i,a,s;i=void 0!==t.start?()=>t.start(o):()=>{},a=void 0!==t.pull?()=>t.pull(o):()=>$(void 0),s=void 0!==t.cancel?e=>t.cancel(e):()=>$(void 0),rn(e,o,i,a,s,r,n)}(this,n,Vt(r,1),e)}}get locked(){if(!bn(this))throw gn("locked");return yn(this)}cancel(e=void 0){return bn(this)?yn(this)?V(new TypeError("Cannot cancel a stream that already has a reader")):mn(this,e):V(gn("cancel"))}getReader(e=void 0){if(!bn(this))throw gn("getReader");return void 0===function(e,t){me(e,t);const r=null==e?void 0:e.mode;return{mode:void 0===r?void 0:Lt(r,`${t} has member 'mode' that`)}}(e,"First parameter").mode?Te(this):Nt(this)}pipeThrough(e,t={}){if(!bn(this))throw gn("pipeThrough");ge(e,1,"pipeThrough");const r=function(e,t){me(e,t);const r=null==e?void 0:e.readable;we(r,"readable","ReadableWritablePair"),Ee(r,`${t} has member 'readable' that`);const n=null==e?void 0:e.writable;return we(n,"writable","ReadableWritablePair"),Zt(n,`${t} has member 'writable' that`),{readable:r,writable:n}}(e,"First parameter"),n=cn(t,"Second parameter");if(yn(this))throw new TypeError("ReadableStream.prototype.pipeThrough cannot be used on a locked ReadableStream");if(ir(r.writable))throw new TypeError("ReadableStream.prototype.pipeThrough cannot be used on a locked WritableStream");return J(Vr(this,r.writable,n.preventClose,n.preventAbort,n.preventCancel,n.signal)),r.readable}pipeTo(e,t={}){if(!bn(this))return V(gn("pipeTo"));if(void 0===e)return V("Parameter 1 is required in 'pipeTo'.");if(!or(e))return V(new TypeError("ReadableStream.prototype.pipeTo's first argument must be a WritableStream"));let r;try{r=cn(t,"Second parameter")}catch(e){return V(e)}return yn(this)?V(new TypeError("ReadableStream.prototype.pipeTo cannot be used on a locked ReadableStream")):ir(e)?V(new TypeError("ReadableStream.prototype.pipeTo cannot be used on a locked WritableStream")):Vr(this,e,r.preventClose,r.preventAbort,r.preventCancel,r.signal)}tee(){if(!bn(this))throw gn("tee");return De(function(e){return st(e._readableStreamController)?function(e){let t,r,n,o,i,a=Te(e),s=!1,u=!1,l=!1,c=!1,d=!1;const f=z((e=>{i=e}));function h(e){K(e._closedPromise,(t=>(e!==a||(Tt(n._readableStreamController,t),Tt(o._readableStreamController,t),c&&d||i(void 0)),null)))}function p(){Bt(a)&&(le(a),a=Te(e),h(a)),qe(a,{_chunkSteps:t=>{X((()=>{u=!1,l=!1;const r=t;let a=t;if(!c&&!d)try{a=et(t)}catch(t){return Tt(n._readableStreamController,t),Tt(o._readableStreamController,t),void i(mn(e,t))}c||Et(n._readableStreamController,r),d||Et(o._readableStreamController,a),s=!1,u?y():l&&m()}))},_closeSteps:()=>{s=!1,c||Pt(n._readableStreamController),d||Pt(o._readableStreamController),n._readableStreamController._pendingPullIntos.length>0&&It(n._readableStreamController,0),o._readableStreamController._pendingPullIntos.length>0&&It(o._readableStreamController,0),c&&d||i(void 0)},_errorSteps:()=>{s=!1}})}function b(t,r){ke(a)&&(le(a),a=Nt(e),h(a));const f=r?o:n,p=r?n:o;Ut(a,t,1,{_chunkSteps:t=>{X((()=>{u=!1,l=!1;const n=r?d:c;if(r?c:d)n||jt(f._readableStreamController,t);else{let r;try{r=et(t)}catch(t){return Tt(f._readableStreamController,t),Tt(p._readableStreamController,t),void i(mn(e,t))}n||jt(f._readableStreamController,t),Et(p._readableStreamController,r)}s=!1,u?y():l&&m()}))},_closeSteps:e=>{s=!1;const t=r?d:c,n=r?c:d;t||Pt(f._readableStreamController),n||Pt(p._readableStreamController),void 0!==e&&(t||jt(f._readableStreamController,e),!n&&p._readableStreamController._pendingPullIntos.length>0&&It(p._readableStreamController,0)),t&&n||i(void 0)},_errorSteps:()=>{s=!1}})}function y(){if(s)return u=!0,$(void 0);s=!0;const e=At(n._readableStreamController);return null===e?p():b(e._view,!1),$(void 0)}function m(){if(s)return l=!0,$(void 0);s=!0;const e=At(o._readableStreamController);return null===e?p():b(e._view,!0),$(void 0)}function v(){}return n=hn(v,y,(function(n){if(c=!0,t=n,d){const n=De([t,r]),o=mn(e,n);i(o)}return f})),o=hn(v,m,(function(n){if(d=!0,r=n,c){const n=De([t,r]),o=mn(e,n);i(o)}return f})),h(a),[n,o]}(e):function(e){const t=Te(e);let r,n,o,i,a,s=!1,u=!1,l=!1,c=!1;const d=z((e=>{a=e}));function f(){return s?(u=!0,$(void 0)):(s=!0,qe(t,{_chunkSteps:e=>{X((()=>{u=!1;const t=e,r=e;l||Xr(o._readableStreamController,t),c||Xr(i._readableStreamController,r),s=!1,u&&f()}))},_closeSteps:()=>{s=!1,l||Jr(o._readableStreamController),c||Jr(i._readableStreamController),l&&c||a(void 0)},_errorSteps:()=>{s=!1}}),$(void 0))}function h(){}return o=fn(h,f,(function(t){if(l=!0,r=t,c){const t=De([r,n]),o=mn(e,t);a(o)}return d})),i=fn(h,f,(function(t){if(c=!0,n=t,l){const t=De([r,n]),o=mn(e,t);a(o)}return d})),K(t._closedPromise,(e=>(Zr(o._readableStreamController,e),Zr(i._readableStreamController,e),l&&c||a(void 0),null))),[o,i]}(e)}(this))}values(e=void 0){if(!bn(this))throw gn("values");return function(e,t){const r=Te(e),n=new Ke(r,t),o=Object.create(Qe);return o._asyncIteratorImpl=n,o}(this,function(e){me(e,"First parameter");const t=null==e?void 0:e.preventCancel;return{preventCancel:Boolean(t)}}(e).preventCancel)}[He](e){return this.values(e)}static from(e){return on(e)}}function fn(e,t,r,n=1,o=()=>1){const i=Object.create(dn.prototype);return pn(i),rn(i,Object.create(Hr.prototype),e,t,r,n,o),i}function hn(e,t,r){const n=Object.create(dn.prototype);return pn(n),kt(n,Object.create(at.prototype),e,t,r,0,void 0),n}function pn(e){e._state="readable",e._reader=void 0,e._storedError=void 0,e._disturbed=!1}function bn(e){return!!L(e)&&!!Object.prototype.hasOwnProperty.call(e,"_readableStreamController")&&e instanceof dn}function yn(e){return void 0!==e._reader}function mn(e,t){if(e._disturbed=!0,"closed"===e._state)return $(void 0);if("errored"===e._state)return V(e._storedError);vn(e);const r=e._reader;if(void 0!==r&&Bt(r)){const e=r._readIntoRequests;r._readIntoRequests=new te,e.forEach((e=>{e._closeSteps(void 0)}))}return Q(e._readableStreamController[oe](t),x)}function vn(e){e._state="closed";const t=e._reader;if(void 0!==t&&(pe(t),ke(t))){const e=t._readRequests;t._readRequests=new te,e.forEach((e=>{e._closeSteps()}))}}function _n(e,t){e._state="errored",e._storedError=t;const r=e._reader;void 0!==r&&(he(r,t),ke(r)?xe(r,t):zt(r,t))}function gn(e){return new TypeError(`ReadableStream.prototype.${e} can only be used on a ReadableStream`)}function wn(e,t){me(e,t);const r=null==e?void 0:e.highWaterMark;return we(r,"highWaterMark","QueuingStrategyInit"),{highWaterMark:Se(r)}}Object.defineProperties(dn,{from:{enumerable:!0}}),Object.defineProperties(dn.prototype,{cancel:{enumerable:!0},getReader:{enumerable:!0},pipeThrough:{enumerable:!0},pipeTo:{enumerable:!0},tee:{enumerable:!0},values:{enumerable:!0},locked:{enumerable:!0}}),W(dn.from,"from"),W(dn.prototype.cancel,"cancel"),W(dn.prototype.getReader,"getReader"),W(dn.prototype.pipeThrough,"pipeThrough"),W(dn.prototype.pipeTo,"pipeTo"),W(dn.prototype.tee,"tee"),W(dn.prototype.values,"values"),"symbol"==typeof Symbol.toStringTag&&Object.defineProperty(dn.prototype,Symbol.toStringTag,{value:"ReadableStream",configurable:!0}),Object.defineProperty(dn.prototype,He,{value:dn.prototype.values,writable:!0,configurable:!0});const Sn=e=>e.byteLength;W(Sn,"size");class On{constructor(e){ge(e,1,"ByteLengthQueuingStrategy"),e=wn(e,"First parameter"),this._byteLengthQueuingStrategyHighWaterMark=e.highWaterMark}get highWaterMark(){if(!En(this))throw Pn("highWaterMark");return this._byteLengthQueuingStrategyHighWaterMark}get size(){if(!En(this))throw Pn("size");return Sn}}function Pn(e){return new TypeError(`ByteLengthQueuingStrategy.prototype.${e} can only be used on a ByteLengthQueuingStrategy`)}function En(e){return!!L(e)&&!!Object.prototype.hasOwnProperty.call(e,"_byteLengthQueuingStrategyHighWaterMark")&&e instanceof On}Object.defineProperties(On.prototype,{highWaterMark:{enumerable:!0},size:{enumerable:!0}}),"symbol"==typeof Symbol.toStringTag&&Object.defineProperty(On.prototype,Symbol.toStringTag,{value:"ByteLengthQueuingStrategy",configurable:!0});const Tn=()=>1;W(Tn,"size");class Rn{constructor(e){ge(e,1,"CountQueuingStrategy"),e=wn(e,"First parameter"),this._countQueuingStrategyHighWaterMark=e.highWaterMark}get highWaterMark(){if(!Cn(this))throw An("highWaterMark");return this._countQueuingStrategyHighWaterMark}get size(){if(!Cn(this))throw An("size");return Tn}}function An(e){return new TypeError(`CountQueuingStrategy.prototype.${e} can only be used on a CountQueuingStrategy`)}function Cn(e){return!!L(e)&&!!Object.prototype.hasOwnProperty.call(e,"_countQueuingStrategyHighWaterMark")&&e instanceof Rn}function In(e,t,r){return ve(e,r),r=>ee(e,t,[r])}function jn(e,t,r){return ve(e,r),r=>Z(e,t,[r])}function kn(e,t,r){return ve(e,r),(r,n)=>ee(e,t,[r,n])}function qn(e,t,r){return ve(e,r),r=>ee(e,t,[r])}Object.defineProperties(Rn.prototype,{highWaterMark:{enumerable:!0},size:{enumerable:!0}}),"symbol"==typeof Symbol.toStringTag&&Object.defineProperty(Rn.prototype,Symbol.toStringTag,{value:"CountQueuingStrategy",configurable:!0});class xn{constructor(e={},t={},r={}){void 0===e&&(e=null);const n=Yt(t,"Second parameter"),o=Yt(r,"Third parameter"),i=function(e,t){me(e,t);const r=null==e?void 0:e.cancel,n=null==e?void 0:e.flush,o=null==e?void 0:e.readableType,i=null==e?void 0:e.start,a=null==e?void 0:e.transform,s=null==e?void 0:e.writableType;return{cancel:void 0===r?void 0:qn(r,e,`${t} has member 'cancel' that`),flush:void 0===n?void 0:In(n,e,`${t} has member 'flush' that`),readableType:o,start:void 0===i?void 0:jn(i,e,`${t} has member 'start' that`),transform:void 0===a?void 0:kn(a,e,`${t} has member 'transform' that`),writableType:s}}(e,"First parameter");if(void 0!==i.readableType)throw new RangeError("Invalid readableType specified");if(void 0!==i.writableType)throw new RangeError("Invalid writableType specified");const a=Vt(o,0),s=Ht(o),u=Vt(n,1),l=Ht(n);let c;!function(e,t,r,n,o,i){function a(){return t}e._writable=function(e,t,r,n,o=1,i=()=>1){const a=Object.create(tr.prototype);return nr(a),Or(a,Object.create(wr.prototype),e,t,r,n,o,i),a}(a,(function(t){return function(e,t){const r=e._transformStreamController;return e._backpressure?Q(e._backpressureChangePromise,(()=>{const n=e._writable;if("erroring"===n._state)throw n._storedError;return $n(r,t)})):$n(r,t)}(e,t)}),(function(){return function(e){const t=e._transformStreamController;if(void 0!==t._finishPromise)return t._finishPromise;const r=e._readable;t._finishPromise=z(((e,r)=>{t._finishPromise_resolve=e,t._finishPromise_reject=r}));const n=t._flushAlgorithm();return Un(t),Y(n,(()=>("errored"===r._state?Yn(t,r._storedError):(Jr(r._readableStreamController),Hn(t)),null)),(e=>(Zr(r._readableStreamController,e),Yn(t,e),null))),t._finishPromise}(e)}),(function(t){return function(e,t){const r=e._transformStreamController;if(void 0!==r._finishPromise)return r._finishPromise;const n=e._readable;r._finishPromise=z(((e,t)=>{r._finishPromise_resolve=e,r._finishPromise_reject=t}));const o=r._cancelAlgorithm(t);return Un(r),Y(o,(()=>("errored"===n._state?Yn(r,n._storedError):(Zr(n._readableStreamController,t),Hn(r)),null)),(e=>(Zr(n._readableStreamController,e),Yn(r,e),null))),r._finishPromise}(e,t)}),r,n),e._readable=fn(a,(function(){return function(e){return Dn(e,!1),e._backpressureChangePromise}(e)}),(function(t){return function(e,t){const r=e._transformStreamController;if(void 0!==r._finishPromise)return r._finishPromise;const n=e._writable;r._finishPromise=z(((e,t)=>{r._finishPromise_resolve=e,r._finishPromise_reject=t}));const o=r._cancelAlgorithm(t);return Un(r),Y(o,(()=>("errored"===n._state?Yn(r,n._storedError):(Rr(n._writableStreamController,t),Mn(e),Hn(r)),null)),(t=>(Rr(n._writableStreamController,t),Mn(e),Yn(r,t),null))),r._finishPromise}(e,t)}),o,i),e._backpressure=void 0,e._backpressureChangePromise=void 0,e._backpressureChangePromise_resolve=void 0,Dn(e,!0),e._transformStreamController=void 0}(this,z((e=>{c=e})),u,l,a,s),function(e,t){const r=Object.create(Fn.prototype);let n,o,i;n=void 0!==t.transform?e=>t.transform(e,r):e=>{try{return zn(r,e),$(void 0)}catch(e){return V(e)}},o=void 0!==t.flush?()=>t.flush(r):()=>$(void 0),i=void 0!==t.cancel?e=>t.cancel(e):()=>$(void 0),function(e,t,r,n,o){t._controlledTransformStream=e,e._transformStreamController=t,t._transformAlgorithm=r,t._flushAlgorithm=n,t._cancelAlgorithm=o,t._finishPromise=void 0,t._finishPromise_resolve=void 0,t._finishPromise_reject=void 0}(e,r,n,o,i)}(this,i),void 0!==i.start?c(i.start(this._transformStreamController)):c(void 0)}get readable(){if(!Ln(this))throw Gn("readable");return this._readable}get writable(){if(!Ln(this))throw Gn("writable");return this._writable}}function Ln(e){return!!L(e)&&!!Object.prototype.hasOwnProperty.call(e,"_transformStreamController")&&e instanceof xn}function Nn(e,t){Zr(e._readable._readableStreamController,t),Wn(e,t)}function Wn(e,t){Un(e._transformStreamController),Rr(e._writable._writableStreamController,t),Mn(e)}function Mn(e){e._backpressure&&Dn(e,!1)}function Dn(e,t){void 0!==e._backpressureChangePromise&&e._backpressureChangePromise_resolve(),e._backpressureChangePromise=z((t=>{e._backpressureChangePromise_resolve=t})),e._backpressure=t}Object.defineProperties(xn.prototype,{readable:{enumerable:!0},writable:{enumerable:!0}}),"symbol"==typeof Symbol.toStringTag&&Object.defineProperty(xn.prototype,Symbol.toStringTag,{value:"TransformStream",configurable:!0});class Fn{constructor(){throw new TypeError("Illegal constructor")}get desiredSize(){if(!Bn(this))throw Vn("desiredSize");return en(this._controlledTransformStream._readable._readableStreamController)}enqueue(e=void 0){if(!Bn(this))throw Vn("enqueue");zn(this,e)}error(e=void 0){if(!Bn(this))throw Vn("error");var t;t=e,Nn(this._controlledTransformStream,t)}terminate(){if(!Bn(this))throw Vn("terminate");!function(e){const t=e._controlledTransformStream;Jr(t._readable._readableStreamController),Wn(t,new TypeError("TransformStream terminated"))}(this)}}function Bn(e){return!!L(e)&&!!Object.prototype.hasOwnProperty.call(e,"_controlledTransformStream")&&e instanceof Fn}function Un(e){e._transformAlgorithm=void 0,e._flushAlgorithm=void 0,e._cancelAlgorithm=void 0}function zn(e,t){const r=e._controlledTransformStream,n=r._readable._readableStreamController;if(!tn(n))throw new TypeError("Readable side is not in a state that permits enqueue");try{Xr(n,t)}catch(e){throw Wn(r,e),r._readable._storedError}const o=function(e){return!Kr(e)}(n);o!==r._backpressure&&Dn(r,!0)}function $n(e,t){return Q(e._transformAlgorithm(t),void 0,(t=>{throw Nn(e._controlledTransformStream,t),t}))}function Vn(e){return new TypeError(`TransformStreamDefaultController.prototype.${e} can only be used on a TransformStreamDefaultController`)}function Hn(e){void 0!==e._finishPromise_resolve&&(e._finishPromise_resolve(),e._finishPromise_resolve=void 0,e._finishPromise_reject=void 0)}function Yn(e,t){void 0!==e._finishPromise_reject&&(J(e._finishPromise),e._finishPromise_reject(t),e._finishPromise_resolve=void 0,e._finishPromise_reject=void 0)}function Gn(e){return new TypeError(`TransformStream.prototype.${e} can only be used on a TransformStream`)}Object.defineProperties(Fn.prototype,{enqueue:{enumerable:!0},error:{enumerable:!0},terminate:{enumerable:!0},desiredSize:{enumerable:!0}}),W(Fn.prototype.enqueue,"enqueue"),W(Fn.prototype.error,"error"),W(Fn.prototype.terminate,"terminate"),"symbol"==typeof Symbol.toStringTag&&Object.defineProperty(Fn.prototype,Symbol.toStringTag,{value:"TransformStreamDefaultController",configurable:!0});var Kn,Qn=(Kn=function(e,t){return Kn=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},Kn(e,t)},function(e,t){function r(){this.constructor=e}Kn(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),Jn=function(){return Jn=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},Jn.apply(this,arguments)},Xn="Error when aborting requestTask",Zn=function(e){function t(t){void 0===t&&(t={});var r=e.call(this)||this,n=t.timeout,o=t.timeoutMsg,i=t.restrictedMethods;return r._timeout=n||0,r._timeoutMsg=o||"请求超时",r._restrictedMethods=i||["get","post","upload","download"],r}return Qn(t,e),t.prototype.post=function(e){var t=this;return new Promise((function(r,n){var o=e.url,i=e.data,a=e.headers,s=wx.request({url:l("https:",o),data:i,timeout:t._timeout,method:"POST",header:a,success:function(e){e.statusCode>=200&&e.statusCode<300?r({statusCode:e.statusCode,status:e.statusCode,data:e.data}):n(e)},fail:function(e){n(e)},complete:function(e){if(e&&e.errMsg&&t._timeout&&-1!==t._restrictedMethods.indexOf("post")&&"request:fail timeout"===e.errMsg){console.warn(t._timeoutMsg);try{s.abort()}catch(e){}}}})}))},t.prototype.get=function(e){var t=this;return new Promise((function(r,n){var o=e.url,i=e.body,a=e.headers,s=l("https:",o),u=wx.request({url:s,data:i,timeout:t._timeout,method:"GET",header:a,success:function(e){e.statusCode>=200&&e.statusCode<300?r({statusCode:e.statusCode,status:e.statusCode,data:e.data}):n(e)},fail:function(e){n(e)},complete:function(e){if(e&&e.errMsg&&t._timeout&&-1!==t._restrictedMethods.indexOf("get")&&e.errMsg.includes("timeout")){console.warn(t._timeoutMsg);try{u.abort()}catch(e){console.warn(Xn,e)}}}})}))},t.prototype.upload=function(e){var t=this,r=this;return new Promise((function(n){return function(e,t,r,n){return new(r||(r=Promise))((function(o,i){function a(e){try{u(n.next(e))}catch(e){i(e)}}function s(e){try{u(n.throw(e))}catch(e){i(e)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}u((n=n.apply(e,t||[])).next())}))}(t,void 0,void 0,(function(){var t,o,i,a,s,u;return function(e,t){var r,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,n=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}}(this,(function(l){return t=e.url,o=e.file,i=e.data,a=e.headers,s=e.onUploadProgress,u=wx.uploadFile({url:t,filePath:o,name:"file",formData:Jn({},i),header:a,timeout:this._timeout,success:function(e){var t={statusCode:e.statusCode,data:e.data||{}};200===e.statusCode&&i.success_action_status&&(t.statusCode=parseInt(i.success_action_status,10)),n(t)},fail:function(e){n(e)},complete:function(e){if(e&&e.errMsg&&r._timeout&&-1!==r._restrictedMethods.indexOf("upload")&&"request:fail timeout"===e.errMsg){console.warn(r._timeoutMsg);try{u.abort()}catch(e){}}}}),s&&u.onProgressUpdate((function(e){s(e)})),[2]}))}))}))},t.prototype.download=function(e){var t=this,r=this;return new Promise((function(n,o){var i=e.url,a=e.headers,s=wx.downloadFile({url:l("https:",i),header:a,timeout:t._timeout,success:function(e){200===e.statusCode&&e.tempFilePath?n({statusCode:200,tempFilePath:e.tempFilePath}):n(e)},fail:function(e){o(e)},complete:function(e){if(e&&e.errMsg&&r._timeout&&-1!==r._restrictedMethods.indexOf("download")&&"request:fail timeout"===e.errMsg){console.warn(r._timeoutMsg);try{s.abort()}catch(e){}}}})}))},t.prototype.fetch=function(e){var t=e.url,r=e.body,n=e.enableAbort,o=e.headers,i=e.method,a=e.stream,s=void 0!==a&&a,u=e.signal,c=e.timeout,d=this,f=null!=c?c:this._timeout,h=null,p=new dn({start:function(e){h=e},cancel:function(){h=null}});return new Promise((function(e,a){s&&e({data:p});var c=wx.request({url:l("https:",t),data:r,timeout:f,method:i.toUpperCase(),header:o,success:function(t){var r;null===(r=h)||void 0===r||r.close(),!s&&e(t)},fail:function(e){var t;if(null===(t=h)||void 0===t||t.close(),a(e),s)throw e},complete:function(e){if(e&&e.errMsg&&f&&-1!==d._restrictedMethods.indexOf("post")&&n&&"request:fail timeout"===e.errMsg){console.warn(d._timeoutMsg);try{c.abort()}catch(e){console.warn(Xn,e)}}},enableChunked:s});if(c.onChunkReceived((function(e){var t;null===(t=h)||void 0===t||t.enqueue(new Uint8Array(e.data))})),u){var b=function(){try{c.abort()}catch(e){console.warn(Xn,e)}};u.aborted?b():u.addEventListener("abort",(function(){return b()}))}}))},t}(u),eo={setItem:function(e,t){wx.setStorageSync(e,t)},getItem:function(e){return wx.getStorageSync(e)},removeItem:function(e){wx.removeStorageSync(e)},clear:function(){wx.clearStorageSync()}},to=function(e,t){void 0===t&&(t={});var r=wx.connectSocket(Jn({url:e},t));return{set onopen(e){r.onOpen(e)},set onmessage(e){r.onMessage(e)},set onclose(e){r.onClose(e)},set onerror(e){r.onError(e)},send:function(e){return r.send({data:e})},close:function(e,t){return r.close({code:e,reason:t})},get readyState(){return r.readyState},CONNECTING:0,OPEN:1,CLOSING:2,CLOSED:3}},ro={genAdapter:function(e){var t={root:{globalThis:{}},reqClass:Zn,wsClass:to,captchaOptions:{openURIWithCallback:function(t){var r=e.EventBus,n={},o=t;console.log("openURIWithCallback",t);var i=t.match(/^(data:.*?)(\?[^#\s]*)?$/);if(i){o=i[1],console.log("openURIWithCallback url",o);var a=i[2];a&&(n=function(e){var t={},r=e.replace(/^[?#]/,"");return r?(r.split("&").forEach((function(e){var r=e.split("="),n=r[0],o=r[1];n=decodeURIComponent(n),o=decodeURIComponent(o),n&&(t[n]?Array.isArray(t[n])?t[n].push(o):t[n]=[t[n],o]:t[n]=o)})),t):t}(a))}console.log("openURIWithCallback queryObj",n);var s=n.token,u=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(e);o<n.length;o++)t.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(e,n[o])&&(r[n[o]]=e[n[o]])}return r}(n,["token"]);return/^data:/.test(o)&&!s?Promise.reject({error:"invalid_argument",error_description:"invalie captcha data: "+t}):s?new Promise((function(e){console.log("wait for captcha..."),r.$emit("CAPTCHA_DATA_CHANGE",Jn(Jn({},u),{token:s,url:o})),r.$once("RESOLVE_CAPTCHA_DATA",(function(t){e(t)}))})):Promise.reject({error:"unimplemented",error_description:"need to impl captcha data"})}},localStorage:eo,primaryStorage:i.local,getAppSign:function(){var e=wx.getAccountInfoSync();return"undefined"!=typeof App||"undefined"!=typeof getApp||wx.onAppHide||wx.offAppHide||wx.onAppShow||wx.offAppShow?e&&e.miniProgram?e.miniProgram.appId:"":e&&e.plugin?e.plugin.appId:""}};return t},isMatch:function(){if("undefined"==typeof wx)return!1;if("undefined"==typeof Page)return!1;if(!wx.getSystemInfoSync)return!1;if(!wx.getStorageSync)return!1;if(!wx.setStorageSync)return!1;if(!wx.connectSocket)return!1;if(!wx.request)return!1;try{if(!wx.getSystemInfoSync())return!1;if("qq"===wx.getSystemInfoSync().AppPlatform)return!1}catch(e){return!1}return!0},runtime:"wx_mp"},no=ro,oo=function(e,t,r){if(r||2===arguments.length)for(var n,o=0,i=t.length;o<i;o++)!n&&o in t||(n||(n=Array.prototype.slice.call(t,0,o)),n[o]=t[o]);return e.concat(n||Array.prototype.slice.call(t))},io=s,ao={};function so(e,t){var r=t.name,n=t.namespace,o=t.entity,i=t.injectEvents,a=t.IIFE,s=void 0!==a&&a;if(ao[r]||n&&e[n])throw new Error(JSON.stringify({code:io.INVALID_OPERATION,msg:"Duplicate component ".concat(r)}));if(s){if(!o||"function"!=typeof o)throw new Error(JSON.stringify({code:io.INVALID_PARAMS,msg:"IIFE component's entity must be a function"}));o.call(e)}if(ao[r]=t,n?e.prototype[n]=o:uo(e.prototype,o),i){var u=i.bus,l=i.events;if(!u||!l||0===l.length)return;var c=e.prototype.fire||function(){};e.prototype.events||(e.prototype.events={}),(e.prototype.events||{})[r]?e.prototype.events[r].events=oo(oo([],e.prototype.events[r].events,!0),l,!0):e.prototype.events[r]={bus:u,events:l},e.prototype.fire=function(e,t){c(e,t);for(var r=0,n=Object.keys(this.events);r<n.length;r++){var o=n[r],i=this.events[o],a=i.bus;if(i.events.includes(e)){a.fire(e,t);break}}}}}function uo(e,t){if(!(t instanceof Object))return t;switch(t.constructor){case Date:return new Date(t.getTime());case Object:void 0===e&&(e={});break;case Array:e=[];break;default:return t}for(var r=0,n=Object.keys(t);r<n.length;r++){var o=n[r];Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=uo(e[o],t[o]))}return e}var lo={},co=function(){return co=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},co.apply(this,arguments)},fo=E,ho={},po={};function bo(e){var t=e.env,r=e.platformInfo,n={userInfoKey:"".concat("user_info","_").concat(t)};ho[t]=ho[t]||new fo(co(co({},e),{keys:n,platformInfo:r})),po[t]=po[t]||new fo(co(co({},e),{keys:n,platformInfo:r,persistence:"local"}))}function yo(e){return po[e]}var mo=function(){return mo=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},mo.apply(this,arguments)},vo=["ap-shanghai","ap-guangzhou","ap-shenzhen-fsi","ap-shanghai-fsi","ap-nanjing","ap-beijing","ap-chengdu","ap-chongqing","ap-hongkong"],_o="",go="@cloudbase/js-sdk";function wo(){return _o}var So,Oo=[],Po=["env","endPointKey","region"],Eo="https:";function To(e){return Oo.find((function(t){return Po.filter((function(t){return null!=e[t]})).every((function(r){return t[r]===e[r]}))}))}function Ro(e){var t,r;e.protocol&&!/:$/.test(e.protocol)&&(e.protocol="".concat(e.protocol,":"));var n,o=To(e);o?(null!=e.baseUrl&&(o.baseUrl=e.baseUrl),null!=e.protocol&&(o.protocol=e.protocol)):Oo.push(mo(mo({},e),{protocol:null!==(t=e.protocol)&&void 0!==t?t:Eo})),"CLOUD_API"===e.endPointKey&&(n=null!==(r=e.protocol)&&void 0!==r?r:Eo,a=n)}function Ao(e,t,r){return To({env:e,endPointKey:t,region:r})}function Co(e,t){void 0===t&&(t="CLOUD_API");var r=Ao(e,t||"CLOUD_API"),n=r.protocol,o=r.baseUrl;return"".concat(n).concat(o).match(/(http(s)?:)?\/\/([^/?#]*)/)[0]}!function(e){e.NULL="NULL",e.ANONYMOUS="ANONYMOUS",e.WECHAT="WECHAT",e.WECHAT_PUBLIC="WECHAT-PUBLIC",e.WECHAT_OPEN="WECHAT-OPEN",e.CUSTOM="CUSTOM",e.EMAIL="EMAIL",e.USERNAME="USERNAME",e.PHONE="PHONE"}(So||(So={}));var Io=function(){return Io=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},Io.apply(this,arguments)},jo=function(e,t,r,n){return new(r||(r=Promise))((function(o,i){function a(e){try{u(n.next(e))}catch(e){i(e)}}function s(e){try{u(n.throw(e))}catch(e){i(e)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}u((n=n.apply(e,t||[])).next())}))},ko=function(e,t){var r,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(s){return function(u){return function(s){if(r)throw new TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(a=0)),a;)try{if(r=1,n&&(o=2&s[0]?n.return:s[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,s[1])).done)return o;switch(n=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,n=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){a.label=s[1];break}if(6===s[0]&&a.label<o[1]){a.label=o[1],o=s;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(s);break}o[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],n=0}finally{r=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,u])}}},qo=s,xo=c,Lo=d,No=["auth.getJwt","auth.logout","auth.signInWithTicket","auth.signInAnonymously","auth.signIn","auth.fetchAccessTokenWithRefreshToken","auth.signUpWithEmailAndPassword","auth.activateEndUserMail","auth.sendPasswordResetEmail","auth.resetPasswordWithToken","auth.isUsernameRegistered"];function Wo(e,t,r){var n=e[t];e[t]=function(t){var o={},i={};r.forEach((function(r){var n=r.call(e,t),a=n.data,s=n.headers;Object.assign(o,a),Object.assign(i,s)}));var a=t.data;return a&&(xo(a)?Object.keys(o).forEach((function(e){a.append(e,o[e])})):t.data=Io(Io({},a),o)),t.headers=Io(Io({},t.headers||{}),i),n.call(e,t)}}function Mo(){var e=Math.random().toString(16).slice(2);return{data:{seqId:e},headers:{"X-SDK-Version":"@cloudbase/js-sdk/".concat(wo()),"x-seqid":e}}}var Do,Fo,Bo=function(){function e(e){var t=this;this.throwWhenRequestFail=!1,this.config=e;var r={timeout:this.config.timeout,timeoutMsg:"[@cloudbase/js-sdk] 请求在".concat(this.config.timeout/1e3,"s内未完成,已中断"),restrictedMethods:["post","put"]};this.reqClass=new lo.adapter.reqClass(r),this.throwWhenRequestFail=e.throw||!1,this.localCache=yo(this.config.env),Wo(this.reqClass,"post",[Mo]),Wo(this.reqClass,"upload",[Mo]),Wo(this.reqClass,"download",[Mo]),I.on(j,(function(e){var r;t.config.i18n=(null===(r=e.data)||void 0===r?void 0:r.i18n)||t.config.i18n}))}return e.prototype.getDefaultHeaders=function(){var e,t,r;return(e={})[null===(t=this.config.i18n)||void 0===t?void 0:t.LANG_HEADER_KEY]=null===(r=this.config.i18n)||void 0===r?void 0:r.lang,e},e.prototype.post=function(e,t){return jo(this,void 0,void 0,(function(){return ko(this,(function(r){switch(r.label){case 0:return[4,this.reqClass.post(Io(Io({},e),{headers:Io(Io({},e.headers),this.getDefaultHeaders()),customReqOpts:t}))];case 1:return[2,r.sent()]}}))}))},e.prototype.upload=function(e){return jo(this,void 0,void 0,(function(){return ko(this,(function(t){switch(t.label){case 0:return[4,this.reqClass.upload(Io(Io({},e),{headers:Io(Io({},e.headers),this.getDefaultHeaders())}))];case 1:return[2,t.sent()]}}))}))},e.prototype.download=function(e){return jo(this,void 0,void 0,(function(){return ko(this,(function(t){switch(t.label){case 0:return[4,this.reqClass.download(Io(Io({},e),{headers:Io(Io({},e.headers),this.getDefaultHeaders())}))];case 1:return[2,t.sent()]}}))}))},e.prototype.getBaseEndPoint=function(e){return void 0===e&&(e="CLOUD_API"),Co(this.config.env,e)},e.prototype.getOauthAccessTokenV2=function(e){return jo(this,void 0,void 0,(function(){var t,r;return ko(this,(function(n){switch(n.label){case 0:return[4,e.getAccessToken()];case 1:return t=n.sent(),[4,e.getCredentials()];case 2:return r=n.sent(),[2,{accessToken:t,accessTokenExpire:new Date(r.expires_at).getTime()}]}}))}))},e.prototype.request=function(e,t,r,n){var o,i;return jo(this,void 0,void 0,(function(){var a,s,u,l,c,d,f,h,p,b,y,m,v,_,g,w,S,O,P,E,T;return ko(this,(function(R){switch(R.label){case 0:if(a="x-tcb-trace_".concat(this.config.env),s="application/x-www-form-urlencoded",u=Io({action:e,dataVersion:"2020-01-10",env:this.config.env},t),-1!==No.indexOf(e))return[3,2];if(!(l=this.config._fromApp).oauthInstance)throw new Error("you can't request without auth");return c=l.oauthInstance,d=c.oauth2client,f=u,[4,this.getOauthAccessTokenV2(d)];case 1:f.access_token=R.sent().accessToken,R.label=2;case 2:return"storage.uploadFile"===e?(h=new FormData,Object.keys(h).forEach((function(e){Object.prototype.hasOwnProperty.call(h,e)&&void 0!==h[e]&&h.append(e,u[e])})),s="multipart/form-data"):(s="application/json;charset=UTF-8",h={},Object.keys(u).forEach((function(e){void 0!==u[e]&&(h[e]=u[e])}))),p={headers:Io({"content-type":s},this.getDefaultHeaders())},(null==r?void 0:r.onUploadProgress)&&(p.onUploadProgress=r.onUploadProgress),this.config.region&&(p.headers["X-TCB-Region"]=this.config.region),(b=this.localCache.getStore(a))&&(p.headers["X-TCB-Trace"]=b),y=void 0!==(null==r?void 0:r.parse)?r.parse:t.parse,m=void 0!==(null==r?void 0:r.inQuery)?r.inQuery:t.inQuery,v=void 0!==(null==r?void 0:r.search)?r.search:t.search,_=Io(Io({},(null==r?void 0:r.defaultQuery)||{}),{env:this.config.env}),y&&(_.parse=!0),m&&(_=Io(Io({},m),_)),g=this.config.endPointMode||"CLOUD_API",w=Ao(this.config.env,g),S=w.baseUrl,O=w.protocol,"functions.invokeFunction"!==e&&!/^(storage|database)\./.test(e)||"GATEWAY"!==g||(S="".concat(S.match(/\/\/([^/?#]*)/)[0],"/web")),P=r.pathname?Lo(O,"".concat(null===(o=Co(this.config.env,g))||void 0===o?void 0:o.replace(/^https?:/,""),"/").concat(r.pathname),_):Lo(O,S,_),v&&(P+=v),[4,this.post(Io({url:P,data:h},p),n)];case 3:if(E=R.sent(),(T=null===(i=E.header)||void 0===i?void 0:i["x-tcb-trace"])&&this.localCache.setStore(a,T),200!==Number(E.status)&&200!==Number(E.statusCode)||!E.data)throw new Error("network request error");return[2,E]}}))}))},e.prototype.fetch=function(e){var t,r,n,o,i,a,s,u;return jo(this,void 0,void 0,(function(){var l,c,d,f,h,p,b,y=this;return ko(this,(function(m){switch(m.label){case 0:l=e.token,c=e.headers,d=void 0===c?{}:c,f=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(e);o<n.length;o++)t.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(e,n[o])&&(r[n[o]]=e[n[o]])}return r}(e,["token","headers"]),h=function(){return jo(y,void 0,void 0,(function(){var e,t,r;return ko(this,(function(n){switch(n.label){case 0:if(null!=l)return[2,l];if(!(e=this.config._fromApp).oauthInstance)throw new Error("you can't request without auth");return t=e.oauthInstance,r=t.oauth2client,[4,this.getOauthAccessTokenV2(r)];case 1:return[2,n.sent().accessToken]}}))}))},p=function(){return jo(y,void 0,void 0,(function(){var e,t,r,n,o;return ko(this,(function(i){switch(i.label){case 0:return t=(e=this.reqClass).fetch,n={},o={"X-SDK-Version":"@cloudbase/js-sdk/".concat(wo())},r="Bearer ".concat,[4,h()];case 1:return[2,t.apply(e,[Io.apply(void 0,[(n.headers=Io.apply(void 0,[Io.apply(void 0,[(o.Authorization=r.apply("Bearer ",[i.sent()]),o),this.getDefaultHeaders()]),d]),n),f])])]}}))}))},m.label=1;case 1:return m.trys.push([1,3,,6]),[4,p()];case 2:return[2,m.sent()];case 3:if("ACCESS_TOKEN_EXPIRED"!==(null==(b=m.sent())?void 0:b.code))return[3,5];if("function"!=typeof(null===(o=null===(n=null===(r=null===(t=this.config)||void 0===t?void 0:t._fromApp)||void 0===r?void 0:r.oauthInstance)||void 0===n?void 0:n.authApi)||void 0===o?void 0:o.refreshTokenForce))throw b;return[4,null===(u=null===(s=null===(a=null===(i=this.config)||void 0===i?void 0:i._fromApp)||void 0===a?void 0:a.oauthInstance)||void 0===s?void 0:s.authApi)||void 0===u?void 0:u.refreshTokenForce()];case 4:return m.sent(),[2,p()];case 5:throw b;case 6:return[2]}}))}))},e.prototype.send=function(e,t,r,n){return void 0===t&&(t={}),void 0===r&&(r={}),jo(this,void 0,void 0,(function(){var o;return ko(this,(function(i){switch(i.label){case 0:return[4,this.request(e,t,Io(Io({},r),{onUploadProgress:t.onUploadProgress}),n)];case 1:if((o=i.sent()).data.code&&this.throwWhenRequestFail)throw new Error(JSON.stringify({code:qo.OPERATION_FAIL,msg:"[".concat(o.data.code,"] ").concat(o.data.message)}));return[2,o.data]}}))}))},e.prototype.gateWay=function(e,t){return jo(this,void 0,void 0,(function(){var r,n,o,i,a,s,u,l,c,d,f,h,p,b,y,m;return ko(this,(function(v){switch(v.label){case 0:if(r=e.name,n=e.data,o=e.path,i=void 0===o?"":o,a=e.method,s=e.header,u=void 0===s?{}:s,!r||!i)throw new Error(JSON.stringify({code:qo.INVALID_PARAMS,msg:"[gateWay] invalid function name or path"}));try{l=n?JSON.stringify(n):""}catch(e){throw new Error(JSON.stringify({code:qo.INVALID_PARAMS,msg:"[gateWay] invalid data"}))}return c=function(){var e=(new Date).getTime(),t=(null===Date||void 0===Date?void 0:Date.now)&&1e3*Date.now()||0;return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(r){var n=16*Math.random();return e>0?(n=(e+n)%16|0,e=Math.floor(e/16)):(n=(t+n)%16|0,t=Math.floor(t/16)),("x"===r?n:7&n|8).toString(16)}))}(),d=Ao(this.config.env,"GATEWAY"),f=d.baseUrl,h=d.protocol,p="".concat(h).concat(f,"/").concat(i,"/").concat(r),[4,this.fetch({method:a||"POST",headers:Io({"Content-Type":"application/json; charset=utf-8","X-Request-Id":c},u),body:l,url:p,customReqOpts:t})];case 1:return b=v.sent(),y=[Io({requestId:c},b)],m={},[4,b.data];case 2:return[2,Io.apply(void 0,y.concat([(m.data=v.sent(),m)]))]}}))}))},e}(),Uo={};!function(e){e.ZH="zh-CN",e.EN="en-US"}(Fo||(Fo={}));var zo=((Do={})[Fo.EN]={"请检查调用方式,或前往云开发 AI+ 首页查看文档":"Please check the calling method or visit the AI+ homepage to view the documentation","AI+ 请求出错,错误码":"AI+ request error, error code","错误信息":"error message","未实现":"not implemented","小程序不支持 wasm 加载":"wasm loading is not supported in mini programs","小程序不支持动态 js 加载":"dynamic js loading is not supported in mini programs","请求超时":"request timeout","缺少 privatelink sdk 地址":"missing privatelink sdk address"},Do),$o=function(e,t){var r;return(null===(r=zo[t])||void 0===r?void 0:r[e])||e},Vo=function(e,t){var r,n,o=function(e){return"lang_".concat(e.clientId||e.env)}(t),i=(e.adapter||{}).localStorage,a=t.lang||(null===(r=null==i?void 0:i.getItem)||void 0===r?void 0:r.call(i,o))||Fo.ZH;return null===(n=null==i?void 0:i.setItem)||void 0===n||n.call(i,o,a),new Proxy({t:function(e){return $o(e,a)},LANG_HEADER_KEY:"Accept-Language",lang:a},{get:function(e,t){var r;return"lang"===t&&(null===(r=null==i?void 0:i.getItem)||void 0===r?void 0:r.call(i,o))||e[t]},set:function(e,t,r){var n;return"lang"===t&&r!==e[t]&&(e[t]=r,e.t=function(e){return $o(e,r)},null===(n=null==i?void 0:i.setItem)||void 0===n||n.call(i,o,r),I.fire(j,{i18n:e})),e[t]=r,!0}})},Ho=r(794),Yo=function(){return Yo=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},Yo.apply(this,arguments)},Go=function(e,t,r,n){return new(r||(r=Promise))((function(o,i){function a(e){try{u(n.next(e))}catch(e){i(e)}}function s(e){try{u(n.throw(e))}catch(e){i(e)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}u((n=n.apply(e,t||[])).next())}))},Ko=function(e,t){var r,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(s){return function(u){return function(s){if(r)throw new TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(a=0)),a;)try{if(r=1,n&&(o=2&s[0]?n.return:s[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,s[1])).done)return o;switch(n=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,n=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){a.label=s[1];break}if(6===s[0]&&a.label<o[1]){a.label=o[1],o=s;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(s);break}o[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],n=0}finally{r=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,u])}}};function Qo(e,t){var r,n,o;return Go(this,void 0,void 0,(function(){var i,a,s,u,l,c,d,f,h,p,b,y,m,v,_;return Ko(this,(function(g){switch(g.label){case 0:if(a=(i=e||{}).name,s=i.body,u=i.path,l=void 0===u?"":u,c=i.method,d=void 0===c?"POST":c,f=i.headers,h=void 0===f?{}:f,p=i.token,!a)throw new Error(JSON.stringify({code:Ho.ERRORS.INVALID_PARAMS,msg:"[apis] invalid api name"}));return b=this.getEndPointWithKey("GATEWAY"),y=b.BASE_URL,m=b.PROTOCOL,v="".concat(m).concat(y,"/apis/").concat(a),_=l.startsWith("/")?l:"/".concat(l),[4,this.request.fetch(Yo({url:"".concat(v).concat(_),method:d||"POST",headers:Yo({"Content-Type":"application/json; charset=utf-8"},h),body:s,token:(null===(r=null==p?void 0:p.trim)||void 0===r?void 0:r.call(p))||(null===(o=null===(n=h.Authorization)||void 0===n?void 0:n.replace)||void 0===o?void 0:o.call(n,/^Bearer /,""))||null},t))];case 1:return[4,g.sent().data];case 2:return[2,g.sent()]}}))}))}var Jo=["GET","POST","PUT","DELETE","HEAD","OPTIONS","PATCH","REQUEST"];function Xo(e){var t=this;return new Proxy({},{get:function(r,n){if("string"!=typeof n)throw new Error("[apis] method must be string");var o=n.toLocaleUpperCase();if(!Jo.includes(o))throw new Error("[apis] invalid method: ".concat(n));return function(r,n){return Go(t,void 0,void 0,(function(){return Ko(this,(function(t){switch(t.label){case 0:return[4,Qo.call(this,Yo({name:e,method:("REQUEST"===o?r.method:o)||"POST"},r),n)];case 1:return[2,t.sent()]}}))}))}}})}function Zo(){var e=this;return new Proxy({},{get:function(t,r){if("string"==typeof r)return Xo.call(e,r)}})}var ei=function(){return ei=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},ei.apply(this,arguments)},ti=function(e,t,r,n){var o,i=arguments.length,a=i<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,r,a):o(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},ri=function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},ni=s,oi="https://support.qq.com/products/148793",ii=f,ai=function(e){return e.mode,e.customInfo,e.title,e.messages,function(e,t,r){}},si={timeout:15e3,persistence:"local"},ui=6e5,li={},ci=function(){function e(e){this.cloudbaseConfig=e||this.cloudbaseConfig,this.authInstance=null,this.oauthInstance=null,this.version=wo()}return Object.defineProperty(e.prototype,"config",{get:function(){return this.cloudbaseConfig},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"platform",{get:function(){return lo},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"cache",{get:function(){return e=this.cloudbaseConfig.env,ho[e];var e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"localCache",{get:function(){return yo(this.cloudbaseConfig.env)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"request",{get:function(){return e=this.cloudbaseConfig.env,Uo[e];var e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"apis",{get:function(){return Zo.call(this)},enumerable:!1,configurable:!0}),e.prototype.init=function(t){var r;if(!t.env)throw new Error(JSON.stringify({code:ni.INVALID_PARAMS,msg:"env must not be specified"}));lo.adapter||this.useDefaultAdapter();var n={timeout:t.timeout||5e3,timeoutMsg:"[".concat(go,"][REQUEST TIMEOUT] request had been abort since didn't finished within").concat(t.timeout/1e3,"s")};this.requestClient=new lo.adapter.reqClass(n),this.cloudbaseConfig=ei(ei(ei({},si),t),{i18n:Vo(lo,t)}),delete this.cloudbaseConfig.lang,this.cloudbaseConfig.timeout=this.formatTimeout(this.cloudbaseConfig.timeout);var o=this.cloudbaseConfig,i=o.env,a=o.persistence,s=o.debug,u=o.timeout,l=o.oauthClient,c=o.i18n;bo({env:i,persistence:a,debug:s,platformInfo:this.platform}),function(e,t){Ro({env:e,region:t,baseUrl:"//".concat(e,".").concat(t||"ap-shanghai",".tcb-api.tencentcloudapi.com/web"),protocol:void 0,endPointKey:"CLOUD_API"})}(i,t.region||""),function(e,t,r){void 0===r&&(r="ap-shanghai"),r=r||"ap-shanghai";var n="//".concat(e,".api.tcloudbasegateway.com/v1");vo.includes(r)||(n="//".concat(e,".api.intl.tcloudbasegateway.com/v1")),Ro({endPointKey:"GATEWAY",env:e,baseUrl:n,protocol:t})}(i,Eo,t.region||"");var d=new e(this.cloudbaseConfig);return function(e){Uo[e.env]=new Bo(Io(Io({},e),{throw:!0}))}({env:i,region:t.region||"",timeout:u,oauthClient:l,_fromApp:d,i18n:c,endPointMode:t.endPointMode}),d.requestClient=this.requestClient,null===(r=null==this?void 0:this.fire)||void 0===r||r.call(this,"cloudbase_init",d),this.try2InitAuth(t,d),d},e.prototype.updateConfig=function(e){var t=e.persistence,r=e.debug;this.cloudbaseConfig.persistence=t,this.cloudbaseConfig.debug=r,bo({env:this.cloudbaseConfig.env,persistence:t,debug:r,platformInfo:this.platform})},e.prototype.updateLang=function(e){var t;e&&e!==(null===(t=this.cloudbaseConfig.i18n)||void 0===t?void 0:t.lang)&&(this.cloudbaseConfig.i18n.lang=e)},e.prototype.registerExtension=function(e){li[e.name]=e},e.prototype.invokeExtension=function(e,t){return function(e,t,r,n){return new(r||(r=Promise))((function(o,i){function a(e){try{u(n.next(e))}catch(e){i(e)}}function s(e){try{u(n.throw(e))}catch(e){i(e)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}u((n=n.apply(e,t||[])).next())}))}(this,void 0,void 0,(function(){var r;return function(e,t){var r,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(s){return function(u){return function(s){if(r)throw new TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(a=0)),a;)try{if(r=1,n&&(o=2&s[0]?n.return:s[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,s[1])).done)return o;switch(n=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,n=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){a.label=s[1];break}if(6===s[0]&&a.label<o[1]){a.label=o[1],o=s;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(s);break}o[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],n=0}finally{r=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,u])}}}(this,(function(n){switch(n.label){case 0:if(!(r=li[e]))throw new Error(JSON.stringify({code:ni.INVALID_PARAMS,msg:"extension:".concat(e," must be registered before invoke")}));return[4,r.invoke(t,this)];case 1:return[2,n.sent()]}}))}))},e.prototype.useAdapters=function(e,t){var r=function(e,t){for(var r,n=0,o=(r=e,"[object Array]"===Object.prototype.toString.call(r)?e:[e]);n<o.length;n++){var i=o[n],a=i.isMatch,s=i.genAdapter,u=i.runtime;if(a())return{adapter:g({isMatch:a},s(t)),runtime:u}}}(e,t)||{},n=r.adapter,o=r.runtime;n&&(lo.adapter=n),o&&(lo.runtime=o)},e.prototype.registerHook=function(t){!function(e,t){var r=t.entity,n=t.target;if(Object.prototype.hasOwnProperty.call(e,n))throw new Error(JSON.stringify({code:io.INVALID_OPERATION,msg:"target:".concat(n," is not exist")}));var o=e.prototype[n];if("function"!=typeof o)throw new Error(JSON.stringify({code:io.INVALID_OPERATION,msg:"target:".concat(n," is not a function which is the only type supports hook")}));e.prototype[n]=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return r.call.apply(r,oo([this],e,!1)),o.call.apply(o,oo([this],e,!1))}}(e,t)},e.prototype.registerComponent=function(t){so(e,t)},e.prototype.registerVersion=function(e){!function(e){_o=e}(e),this.version=e},e.prototype.registerSdkName=function(e){!function(e){go=e,function(e){n=e}(e)}(e)},e.prototype.registerEndPoint=function(e,t){Ro({baseUrl:e,protocol:t,env:this.config.env,endPointKey:"CLOUD_API"})},e.prototype.registerEndPointWithKey=function(e){Ro({env:this.config.env,endPointKey:e.key,baseUrl:e.url,protocol:e.protocol})},e.prototype.getEndPointWithKey=function(e){var t=Ao(this.config.env,e);return{BASE_URL:t.baseUrl,PROTOCOL:t.protocol}},e.prototype.parseCaptcha=function(e){var t={},r=e.match(/^(data:.*?)(\?[^#\s]*)?$/);if(r){e=r[1];var n=r[2];n&&(t=function(e){e=e.replace(/^\?/,"");var t={};return e.split("&").forEach((function(e){var r=e.split("="),n=r[0],o=r[1];n=decodeURIComponent(n),o=decodeURIComponent(o),n&&(t[n]?Array.isArray(t[n])?t[n].push(o):t[n]=[t[n],o]:t[n]=o)})),t}(n))}var o=t.token,i=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(e);o<n.length;o++)t.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(e,n[o])&&(r[n[o]]=e[n[o]])}return r}(t,["token"]);return/^data:/.test(e)&&!o?{error:"invalid_argument",error_description:"invalid captcha data: ".concat(e)}:o?{state:i.state,token:o,captchaData:e}:{error:"unimplemented",error_description:"need to impl captcha data"}},e.prototype.useDefaultAdapter=function(){var e={adapter:{type:"default",root:window,reqClass:_,wsClass:WebSocket,localStorage:localStorage},runtime:p.WEB},t=e.adapter,r=e.runtime;lo.adapter=t,lo.runtime=r},e.prototype.formatTimeout=function(e){switch(!0){case e>ui:return ii(ni.INVALID_PARAMS,"timeout is greater than maximum value[10min]"),ui;case e<100:return ii(ni.INVALID_PARAMS,"timeout is less than maximum value[100ms]"),100;default:return e}},e.prototype.try2InitAuth=function(e,t){try{e.accessKey&&t.auth()}catch(e){console.log("try2InitAuth error:",e)}},ti([ai({mode:"sync",title:"Cloudbase 初始化失败",messages:["请确认以下各项:"," 1 - 调用 cloudbase.init() 的语法或参数是否正确"," 2 - 如果是非浏览器环境,是否配置了安全应用来源(https://docs.cloudbase.net/api-reference/webv3/adapter#%E7%AC%AC-2-%E6%AD%A5%E9%85%8D%E7%BD%AE%E5%AE%89%E5%85%A8%E5%BA%94%E7%94%A8%E6%9D%A5%E6%BA%90)","如果问题依然存在,建议到官方问答社区提问或寻找帮助:".concat(oi)]}),ri("design:type",Function),ri("design:paramtypes",[Object]),ri("design:returntype",e)],e.prototype,"init",null),ti([ai({title:"调用扩展能力失败",messages:["请确认以下各项:"," 1 - 调用 invokeExtension() 的语法或参数是否正确"," 2 - 被调用的扩展能力是否已经安装并通过 registerExtension() 注册","如果问题依然存在,建议到官方问答社区提问或寻找帮助:".concat(oi)]}),ri("design:type",Function),ri("design:paramtypes",[String,Object]),ri("design:returntype",Promise)],e.prototype,"invokeExtension",null),e}(),di=new ci;di.useAdapters(no);var fi=di},946:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.COMMUNITY_SITE_URL=t.IS_DEBUG_MODE=t.getProtocol=t.setProtocol=t.getSdkName=t.setSdkName=void 0;var r="@cloudbase/js-sdk";t.setSdkName=function(e){r=e},t.getSdkName=function(){return r};var n="https:";t.setProtocol=function(e){n=e},t.getProtocol=function(){return n},t.IS_DEBUG_MODE=!1,t.COMMUNITY_SITE_URL="https://support.qq.com/products/148793"},205:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ERRORS=void 0,t.ERRORS={INVALID_PARAMS:"INVALID_PARAMS",INVALID_SYNTAX:"INVALID_SYNTAX",INVALID_OPERATION:"INVALID_OPERATION",OPERATION_FAIL:"OPERATION_FAIL",NETWORK_ERROR:"NETWORK_ERROR",UNKOWN_ERROR:"UNKOWN_ERROR"}},794:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var o=Object.getOwnPropertyDescriptor(t,r);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,o)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),o=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),t.OATUH_LOGINTYPE=void 0,o(r(946),t),o(r(205),t),t.OATUH_LOGINTYPE="constants"},47:function(e){var t=function(e){"use strict";var t,r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(e,t,r){e[t]=r.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",s=i.asyncIterator||"@@asyncIterator",u=i.toStringTag||"@@toStringTag";function l(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{l({},"")}catch(e){l=function(e,t,r){return e[t]=r}}function c(e,t,r,n){var i=t&&t.prototype instanceof m?t:m,a=Object.create(i.prototype),s=new I(n||[]);return o(a,"_invoke",{value:T(e,r,s)}),a}function d(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}e.wrap=c;var f="suspendedStart",h="suspendedYield",p="executing",b="completed",y={};function m(){}function v(){}function _(){}var g={};l(g,a,(function(){return this}));var w=Object.getPrototypeOf,S=w&&w(w(j([])));S&&S!==r&&n.call(S,a)&&(g=S);var O=_.prototype=m.prototype=Object.create(g);function P(e){["next","throw","return"].forEach((function(t){l(e,t,(function(e){return this._invoke(t,e)}))}))}function E(e,t){function r(o,i,a,s){var u=d(e[o],e,i);if("throw"!==u.type){var l=u.arg,c=l.value;return c&&"object"==typeof c&&n.call(c,"__await")?t.resolve(c.__await).then((function(e){r("next",e,a,s)}),(function(e){r("throw",e,a,s)})):t.resolve(c).then((function(e){l.value=e,a(l)}),(function(e){return r("throw",e,a,s)}))}s(u.arg)}var i;o(this,"_invoke",{value:function(e,n){function o(){return new t((function(t,o){r(e,n,t,o)}))}return i=i?i.then(o,o):o()}})}function T(e,r,n){var o=f;return function(i,a){if(o===p)throw new Error("Generator is already running");if(o===b){if("throw"===i)throw a;return{value:t,done:!0}}for(n.method=i,n.arg=a;;){var s=n.delegate;if(s){var u=R(s,n);if(u){if(u===y)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===f)throw o=b,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=p;var l=d(e,r,n);if("normal"===l.type){if(o=n.done?b:h,l.arg===y)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(o=b,n.method="throw",n.arg=l.arg)}}}function R(e,r){var n=r.method,o=e.iterator[n];if(o===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,R(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),y;var i=d(o,e.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,y;var a=i.arg;return a?a.done?(r[e.resultName]=a.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,y):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.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 C(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function I(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(A,this),this.reset(!0)}function j(e){if(null!=e){var r=e[a];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,i=function r(){for(;++o<e.length;)if(n.call(e,o))return r.value=e[o],r.done=!1,r;return r.value=t,r.done=!0,r};return i.next=i}}throw new TypeError(typeof e+" is not iterable")}return v.prototype=_,o(O,"constructor",{value:_,configurable:!0}),o(_,"constructor",{value:v,configurable:!0}),v.displayName=l(_,u,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===v||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,_):(e.__proto__=_,l(e,u,"GeneratorFunction")),e.prototype=Object.create(O),e},e.awrap=function(e){return{__await:e}},P(E.prototype),l(E.prototype,s,(function(){return this})),e.AsyncIterator=E,e.async=function(t,r,n,o,i){void 0===i&&(i=Promise);var a=new E(c(t,r,n,o),i);return e.isGeneratorFunction(r)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},P(O),l(O,u,"Generator"),l(O,a,(function(){return this})),l(O,"toString",(function(){return"[object Generator]"})),e.keys=function(e){var t=Object(e),r=[];for(var n in t)r.push(n);return r.reverse(),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},e.values=j,I.prototype={constructor:I,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(C),!e)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var r=this;function o(n,o){return s.type="throw",s.arg=e,r.next=n,o&&(r.method="next",r.arg=t),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],s=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var u=n.call(a,"catchLoc"),l=n.call(a,"finallyLoc");if(u&&l){if(this.prev<a.catchLoc)return o(a.catchLoc,!0);if(this.prev<a.finallyLoc)return o(a.finallyLoc)}else if(u){if(this.prev<a.catchLoc)return o(a.catchLoc,!0)}else{if(!l)throw new Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return o(a.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===e||"continue"===e)&&i.tryLoc<=t&&t<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=e,a.arg=t,i?(this.method="next",this.next=i.finallyLoc,y):this.complete(a)},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 r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),C(r),y}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var o=n.arg;C(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:j(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),y}},e}(e.exports);try{regeneratorRuntime=t}catch(e){"object"==typeof globalThis?globalThis.regeneratorRuntime=t:Function("r","regeneratorRuntime = r")(t)}},878:function(e){"use strict";e.exports=JSON.parse('{"version":"2.21.9-alpha.5"}')}},t={};function r(n){var o=t[n];if(void 0!==o)return o.exports;var i=t[n]={exports:{}};return e[n].call(i.exports,i,i.exports,r),i.exports}return r.d=function(e,t){for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r(47),r(23)}()}));
|
|
2
|
+
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define("cloudbase",[],t):"object"==typeof exports?exports.cloudbase=t():e.cloudbase=t()}("undefined"!=typeof window?window:this,(function(){return function(){var e={23:function(e,t,r){"use strict";var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},n=o(r(353)),i=o(r(878));n.default.registerVersion(i.default.version);try{window.cloudbase=n.default}catch(e){}t.default=n.default,e.exports=n.default},353:function(e,t,r){"use strict";r.r(t),r.d(t,{LANGS:function(){return Bn},cloudbase:function(){return fi},default:function(){return pi},getBaseEndPoint:function(){return In}});var o="@cloudbase/js-sdk";function n(){return o}var i,a="https:",s={INVALID_PARAMS:"INVALID_PARAMS",INVALID_SYNTAX:"INVALID_SYNTAX",INVALID_OPERATION:"INVALID_OPERATION",OPERATION_FAIL:"OPERATION_FAIL",NETWORK_ERROR:"NETWORK_ERROR",UNKOWN_ERROR:"UNKOWN_ERROR"};!function(e){e.local="local",e.none="none",e.session="session"}(i||(i={}));var u=function(){};function l(e,t,r){void 0===r&&(r={});var o=/\?/.test(t),n="";for(var i in r)""===n?!o&&(t+="?"):n+="&",n+=i+"="+encodeURIComponent(r[i]);return/^http(s)?\:\/\//.test(t+=n)?t:""+e+t}function c(e){return"[object FormData]"===Object.prototype.toString.call(e)}function d(e,t,r){void 0===r&&(r={});var o=/\?/.test(t),n="";return Object.keys(r).forEach((function(e){""===n?!o&&(t+="?"):n+="&",n+="".concat(e,"=").concat(encodeURIComponent(r[e]))})),/^http(s)?:\/\//.test(t+=n)?t:"".concat(e).concat(t)}function f(e,t){console.warn("[".concat(n(),"][").concat(e,"]:").concat(t))}var p,h,b=(p=function(e,t){return p=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},p(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}p(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),y=function(){return y=Object.assign||function(e){for(var t,r=1,o=arguments.length;r<o;r++)for(var n in t=arguments[r])Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e},y.apply(this,arguments)},m=function(e,t,r,o){return new(r||(r=Promise))((function(n,i){function a(e){try{u(o.next(e))}catch(e){i(e)}}function s(e){try{u(o.throw(e))}catch(e){i(e)}}function u(e){var t;e.done?n(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}u((o=o.apply(e,t||[])).next())}))},v=function(e,t){var r,o,n,i,a={label:0,sent:function(){if(1&n[0])throw n[1];return n[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(s){return function(u){return function(s){if(r)throw new TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(a=0)),a;)try{if(r=1,o&&(n=2&s[0]?o.return:s[0]?o.throw||((n=o.return)&&n.call(o),0):o.next)&&!(n=n.call(o,s[1])).done)return n;switch(o=0,n&&(s=[2&s[0],n.value]),s[0]){case 0:case 1:n=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,o=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((n=(n=a.trys).length>0&&n[n.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!n||s[1]>n[0]&&s[1]<n[3])){a.label=s[1];break}if(6===s[0]&&a.label<n[1]){a.label=n[1],n=s;break}if(n&&a.label<n[2]){a.label=n[2],a.ops.push(s);break}n[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],o=0}finally{r=n=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,u])}}},_=function(e){function t(t){var r=e.call(this)||this,o=t.timeout,n=t.timeoutMsg,i=t.restrictedMethods;return r.timeout=o||0,r.timeoutMsg=n||"请求超时",r.restrictedMethods=i||["get","post","upload","download"],r}return b(t,e),t.prototype.get=function(e){return this.request(y(y({},e),{method:"get"}),this.restrictedMethods.includes("get"))},t.prototype.post=function(e){return this.request(y(y({},e),{method:"post"}),this.restrictedMethods.includes("post"))},t.prototype.put=function(e){return this.request(y(y({},e),{method:"put"}))},t.prototype.upload=function(e){var t=e.data,r=e.file,o=e.name,n=e.method,i=e.headers,a=void 0===i?{}:i,s={post:"post",put:"put"}[null==n?void 0:n.toLowerCase()]||"put",u=new FormData;return"post"===s?(Object.keys(t).forEach((function(e){u.append(e,t[e])})),u.append("key",o),u.append("file",r),this.request(y(y({},e),{data:u,method:s}),this.restrictedMethods.includes("upload"))):this.request(y(y({},e),{method:"put",headers:a,body:r}),this.restrictedMethods.includes("upload"))},t.prototype.download=function(e){return m(this,void 0,void 0,(function(){var t,r,o,n;return v(this,(function(i){switch(i.label){case 0:return i.trys.push([0,2,,3]),[4,this.get(y(y({},e),{headers:{},responseType:"blob"}))];case 1:return t=i.sent().data,r=window.URL.createObjectURL(new Blob([t])),o=decodeURIComponent(new URL(e.url).pathname.split("/").pop()||""),(n=document.createElement("a")).href=r,n.setAttribute("download",o),n.style.display="none",document.body.appendChild(n),n.click(),window.URL.revokeObjectURL(r),document.body.removeChild(n),[3,3];case 2:return i.sent(),[3,3];case 3:return[2,new Promise((function(t){t({statusCode:200,tempFilePath:e.url})}))]}}))}))},t.prototype.fetch=function(e){var t;return m(this,void 0,void 0,(function(){var r,o,n,i,a,s,u,l,c,d,f,p=this;return v(this,(function(h){switch(h.label){case 0:return r=new AbortController,o=e.url,n=e.enableAbort,i=void 0!==n&&n,a=e.stream,s=void 0!==a&&a,u=e.signal,l=e.timeout,c=null!=l?l:this.timeout,u&&(u.aborted&&r.abort(),u.addEventListener("abort",(function(){return r.abort()}))),d=null,i&&c&&(d=setTimeout((function(){console.warn(p.timeoutMsg),r.abort(new Error(p.timeoutMsg))}),c)),[4,fetch(o,y(y({},e),{signal:r.signal})).then((function(e){return m(p,void 0,void 0,(function(){var t,r,o;return v(this,(function(n){switch(n.label){case 0:return clearTimeout(d),e.ok?(t=e,[3,3]):[3,1];case 1:return o=(r=Promise).reject,[4,e.json()];case 2:t=o.apply(r,[n.sent()]),n.label=3;case 3:return[2,t]}}))}))})).catch((function(e){return clearTimeout(d),Promise.reject(e)}))];case 1:return f=h.sent(),[2,{data:s?f.body:(null===(t=f.headers.get("content-type"))||void 0===t?void 0:t.includes("application/json"))?f.json():f.text(),statusCode:f.status,header:f.headers}]}}))}))},t.prototype.request=function(e,t){var r=this;void 0===t&&(t=!1);var o=String(e.method).toLowerCase()||"get";return new Promise((function(n){var i,s,u=e.url,l=e.headers,f=void 0===l?{}:l,p=e.data,h=e.responseType,b=e.withCredentials,y=e.body,m=e.onUploadProgress,v=d(a,u,"get"===o?p:{}),_=new XMLHttpRequest;_.open(o,v),h&&(_.responseType=h),Object.keys(f).forEach((function(e){_.setRequestHeader(e,f[e])})),m&&_.upload.addEventListener("progress",m),_.onreadystatechange=function(){var e={};if(4===_.readyState){var t=_.getAllResponseHeaders().trim().split(/[\r\n]+/),r={};t.forEach((function(e){var t=e.split(": "),o=t.shift().toLowerCase(),n=t.join(": ");r[o]=n})),e.header=r,e.statusCode=_.status;try{e.data="blob"===h?_.response:JSON.parse(_.responseText)}catch(t){e.data="blob"===h?_.response:_.responseText}clearTimeout(i),n(e)}},t&&r.timeout&&(i=setTimeout((function(){console.warn(r.timeoutMsg),_.abort()}),r.timeout)),s=c(p)?p:"application/x-www-form-urlencoded"===f["content-type"]?function(e){void 0===e&&(e={});var t=[];return Object.keys(e).forEach((function(r){t.push("".concat(r,"=").concat(encodeURIComponent(e[r])))})),t.join("&")}(p):y||(p?JSON.stringify(p):void 0),b&&(_.withCredentials=!0),_.send(s)}))},t}(u),g=function(){return g=Object.assign||function(e){for(var t,r=1,o=arguments.length;r<o;r++)for(var n in t=arguments[r])Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e},g.apply(this,arguments)};!function(e){e.WEB="web",e.WX_MP="wx_mp"}(h||(h={}));var w=function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},e(t,r)};return function(t,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function o(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(o.prototype=r.prototype,new o)}}(),S=function(e,t,r,o){return new(r||(r=Promise))((function(n,i){function a(e){try{u(o.next(e))}catch(e){i(e)}}function s(e){try{u(o.throw(e))}catch(e){i(e)}}function u(e){var t;e.done?n(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}u((o=o.apply(e,t||[])).next())}))},O=function(e,t){var r,o,n,i,a={label:0,sent:function(){if(1&n[0])throw n[1];return n[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(s){return function(u){return function(s){if(r)throw new TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(a=0)),a;)try{if(r=1,o&&(n=2&s[0]?o.return:s[0]?o.throw||((n=o.return)&&n.call(o),0):o.next)&&!(n=n.call(o,s[1])).done)return n;switch(o=0,n&&(s=[2&s[0],n.value]),s[0]){case 0:case 1:n=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,o=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((n=(n=a.trys).length>0&&n[n.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!n||s[1]>n[0]&&s[1]<n[3])){a.label=s[1];break}if(6===s[0]&&a.label<n[1]){a.label=n[1],n=s;break}if(n&&a.label<n[2]){a.label=n[2],a.ops.push(s);break}n[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],o=0}finally{r=n=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,u])}}},P=function(e){function t(t){var r=e.call(this)||this;return r.root=t,t.tcbCacheObject||(t.tcbCacheObject={}),r}return w(t,e),t.prototype.setItem=function(e,t){this.root.tcbCacheObject[e]=t},t.prototype.getItem=function(e){return this.root.tcbCacheObject[e]},t.prototype.removeItem=function(e){delete this.root.tcbCacheObject[e]},t.prototype.clear=function(){delete this.root.tcbCacheObject},t}((function(){})),E=function(){function e(e){this.keys={};var t=e.persistence,r=e.platformInfo,o=void 0===r?{}:r,n=e.keys,i=void 0===n?{}:n;this.platformInfo=o,this.storage||(this.persistenceTag=this.platformInfo.adapter.primaryStorage||t,this.storage=function(e,t){switch(e){case"local":default:return t.localStorage?t.localStorage:(f(s.INVALID_PARAMS,"localStorage is not supported on current platform"),new P(t.root));case"none":return new P(t.root)}}(this.persistenceTag,this.platformInfo.adapter),this.keys=i)}return Object.defineProperty(e.prototype,"mode",{get:function(){return this.storage.mode||"sync"},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"persistence",{get:function(){return this.persistenceTag},enumerable:!1,configurable:!0}),e.prototype.setStore=function(e,t,r){if("async"!==this.mode){if(this.storage)try{var o={version:r||"localCachev1",content:t};this.storage.setItem(e,JSON.stringify(o))}catch(e){throw new Error(JSON.stringify({code:s.OPERATION_FAIL,msg:"[".concat(n(),"][").concat(s.OPERATION_FAIL,"]setStore failed"),info:e}))}}else f(s.INVALID_OPERATION,"current platform's storage is asynchronous, please use setStoreAsync insteed")},e.prototype.setStoreAsync=function(e,t,r){return S(this,void 0,void 0,(function(){var o;return O(this,(function(n){switch(n.label){case 0:if(!this.storage)return[2];n.label=1;case 1:return n.trys.push([1,3,,4]),o={version:r||"localCachev1",content:t},[4,this.storage.setItem(e,JSON.stringify(o))];case 2:return n.sent(),[3,4];case 3:return n.sent(),[2];case 4:return[2]}}))}))},e.prototype.getStore=function(e,t){var r;if("async"!==this.mode){try{if("undefined"!=typeof process&&(null===(r={IS_MP_BUILD:!0})||void 0===r?void 0:r.tcb_token))return{IS_MP_BUILD:!0}.tcb_token;if(!this.storage)return""}catch(e){return""}t=t||"localCachev1";var o=this.storage.getItem(e);return o&&o.indexOf(t)>=0?JSON.parse(o).content:""}f(s.INVALID_OPERATION,"current platform's storage is asynchronous, please use getStoreAsync insteed")},e.prototype.getStoreAsync=function(e,t){var r;return S(this,void 0,void 0,(function(){var o;return O(this,(function(n){switch(n.label){case 0:try{if("undefined"!=typeof process&&(null===(r={IS_MP_BUILD:!0})||void 0===r?void 0:r.tcb_token))return[2,{IS_MP_BUILD:!0}.tcb_token];if(!this.storage)return[2,""]}catch(e){return[2,""]}return t=t||"localCachev1",[4,this.storage.getItem(e)];case 1:return(o=n.sent())&&o.indexOf(t)>=0?[2,JSON.parse(o).content]:[2,""]}}))}))},e.prototype.removeStore=function(e){"async"!==this.mode?this.storage.removeItem(e):f(s.INVALID_OPERATION,"current platform's storage is asynchronous, please use removeStoreAsync insteed")},e.prototype.removeStoreAsync=function(e){return S(this,void 0,void 0,(function(){return O(this,(function(t){switch(t.label){case 0:return[4,this.storage.removeItem(e)];case 1:return t.sent(),[2]}}))}))},e}(),T=function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},e(t,r)};return function(t,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function o(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(o.prototype=r.prototype,new o)}}(),R=function(e,t){this.data=t||null,this.name=e},A=function(e){function t(t,r){var o=e.call(this,"error",{error:t,data:r})||this;return o.error=t,o}return T(t,e),t}(R),C=function(){function e(){this.listeners={}}return e.prototype.on=function(e,t){return function(e,t,r){r[e]=r[e]||[],r[e].push(t)}(e,t,this.listeners),this},e.prototype.off=function(e,t){return function(e,t,r){if(null==r?void 0:r[e]){var o=r[e].indexOf(t);-1!==o&&r[e].splice(o,1)}}(e,t,this.listeners),this},e.prototype.fire=function(e,t){if(e instanceof A)return console.error(e.error),this;var r="string"==typeof e?new R(e,t||{}):e,o=r.name;if(this.listens(o)){r.target=this;for(var n=0,i=this.listeners[o]?function(e,t,r){if(r||2===arguments.length)for(var o,n=0,i=t.length;n<i;n++)!o&&n in t||(o||(o=Array.prototype.slice.call(t,0,n)),o[n]=t[n]);return e.concat(o||Array.prototype.slice.call(t))}([],this.listeners[o],!0):[];n<i.length;n++)i[n].call(this,r)}return this},e.prototype.listens=function(e){return this.listeners[e]&&this.listeners[e].length>0},e}();new C;var I=new C,j="lang_change";function k(e){this.message=e}function q(e){this.message=e}"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.indexOf("Firefox"),k.prototype=new Error,k.prototype.name="InvalidCharacterError","undefined"!=typeof window&&window.atob&&window.atob.bind(window),q.prototype=new Error,q.prototype.name="InvalidTokenError";var x=function(e,t,r){if(r||2===arguments.length)for(var o,n=0,i=t.length;n<i;n++)!o&&n in t||(o||(o=Array.prototype.slice.call(t,0,n)),o[n]=t[n]);return e.concat(o||Array.prototype.slice.call(t))},L=s,N={};function W(e,t){var r=t.name,o=t.namespace,n=t.entity,i=t.injectEvents,a=t.IIFE,s=void 0!==a&&a;if(N[r]||o&&e[o])throw new Error(JSON.stringify({code:L.INVALID_OPERATION,msg:"Duplicate component ".concat(r)}));if(s){if(!n||"function"!=typeof n)throw new Error(JSON.stringify({code:L.INVALID_PARAMS,msg:"IIFE component's entity must be a function"}));n.call(e)}if(N[r]=t,o?e.prototype[o]=n:M(e.prototype,n),i){var u=i.bus,l=i.events;if(!u||!l||0===l.length)return;var c=e.prototype.fire||function(){};e.prototype.events||(e.prototype.events={}),(e.prototype.events||{})[r]?e.prototype.events[r].events=x(x([],e.prototype.events[r].events,!0),l,!0):e.prototype.events[r]={bus:u,events:l},e.prototype.fire=function(e,t){c(e,t);for(var r=0,o=Object.keys(this.events);r<o.length;r++){var n=o[r],i=this.events[n],a=i.bus;if(i.events.includes(e)){a.fire(e,t);break}}}}}function M(e,t){if(!(t instanceof Object))return t;switch(t.constructor){case Date:return new Date(t.getTime());case Object:void 0===e&&(e={});break;case Array:e=[];break;default:return t}for(var r=0,o=Object.keys(t);r<o.length;r++){var n=o[r];Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=M(e[n],t[n]))}return e}function D(){}function F(e){return"object"==typeof e&&null!==e||"function"==typeof e}const B=D;function U(e,t){try{Object.defineProperty(e,"name",{value:t,configurable:!0})}catch(e){}}const z=Promise,$=Promise.resolve.bind(z),V=Promise.prototype.then,H=Promise.reject.bind(z),G=$;function Y(e){return new z(e)}function K(e){return Y((t=>t(e)))}function Q(e){return H(e)}function J(e,t,r){return V.call(e,t,r)}function X(e,t,r){J(J(e,t,r),void 0,B)}function Z(e,t){X(e,t)}function ee(e,t){X(e,void 0,t)}function te(e,t,r){return J(e,t,r)}function re(e){J(e,void 0,B)}let oe=e=>{if("function"==typeof queueMicrotask)oe=queueMicrotask;else{const e=K(void 0);oe=t=>J(e,t)}return oe(e)};function ne(e,t,r){if("function"!=typeof e)throw new TypeError("Argument is not a function");return Function.prototype.apply.call(e,t,r)}function ie(e,t,r){try{return K(ne(e,t,r))}catch(e){return Q(e)}}class ae{constructor(){this._cursor=0,this._size=0,this._front={_elements:[],_next:void 0},this._back=this._front,this._cursor=0,this._size=0}get length(){return this._size}push(e){const t=this._back;let r=t;16383===t._elements.length&&(r={_elements:[],_next:void 0}),t._elements.push(e),r!==t&&(this._back=r,t._next=r),++this._size}shift(){const e=this._front;let t=e;const r=this._cursor;let o=r+1;const n=e._elements,i=n[r];return 16384===o&&(t=e._next,o=0),--this._size,this._cursor=o,e!==t&&(this._front=t),n[r]=void 0,i}forEach(e){let t=this._cursor,r=this._front,o=r._elements;for(;!(t===o.length&&void 0===r._next||t===o.length&&(r=r._next,o=r._elements,t=0,0===o.length));)e(o[t]),++t}peek(){const e=this._front,t=this._cursor;return e._elements[t]}}const se=Symbol("[[AbortSteps]]"),ue=Symbol("[[ErrorSteps]]"),le=Symbol("[[CancelSteps]]"),ce=Symbol("[[PullSteps]]"),de=Symbol("[[ReleaseSteps]]");function fe(e,t){e._ownerReadableStream=t,t._reader=e,"readable"===t._state?ye(e):"closed"===t._state?function(e){ye(e),_e(e)}(e):me(e,t._storedError)}function pe(e,t){return So(e._ownerReadableStream,t)}function he(e){const t=e._ownerReadableStream;"readable"===t._state?ve(e,new TypeError("Reader was released and can no longer be used to monitor the stream's closedness")):function(e){me(e,new TypeError("Reader was released and can no longer be used to monitor the stream's closedness"))}(e),t._readableStreamController[de](),t._reader=void 0,e._ownerReadableStream=void 0}function be(e){return new TypeError("Cannot "+e+" a stream using a released reader")}function ye(e){e._closedPromise=Y(((t,r)=>{e._closedPromise_resolve=t,e._closedPromise_reject=r}))}function me(e,t){ye(e),ve(e,t)}function ve(e,t){void 0!==e._closedPromise_reject&&(re(e._closedPromise),e._closedPromise_reject(t),e._closedPromise_resolve=void 0,e._closedPromise_reject=void 0)}function _e(e){void 0!==e._closedPromise_resolve&&(e._closedPromise_resolve(void 0),e._closedPromise_resolve=void 0,e._closedPromise_reject=void 0)}const ge=Number.isFinite||function(e){return"number"==typeof e&&isFinite(e)},we=Math.trunc||function(e){return e<0?Math.ceil(e):Math.floor(e)};function Se(e,t){if(void 0!==e&&"object"!=typeof(r=e)&&"function"!=typeof r)throw new TypeError(`${t} is not an object.`);var r}function Oe(e,t){if("function"!=typeof e)throw new TypeError(`${t} is not a function.`)}function Pe(e,t){if(!function(e){return"object"==typeof e&&null!==e||"function"==typeof e}(e))throw new TypeError(`${t} is not an object.`)}function Ee(e,t,r){if(void 0===e)throw new TypeError(`Parameter ${t} is required in '${r}'.`)}function Te(e,t,r){if(void 0===e)throw new TypeError(`${t} is required in '${r}'.`)}function Re(e){return Number(e)}function Ae(e){return 0===e?0:e}function Ce(e,t){const r=Number.MAX_SAFE_INTEGER;let o=Number(e);if(o=Ae(o),!ge(o))throw new TypeError(`${t} is not a finite number`);if(o=function(e){return Ae(we(e))}(o),o<0||o>r)throw new TypeError(`${t} is outside the accepted range of 0 to ${r}, inclusive`);return ge(o)&&0!==o?o:0}function Ie(e,t){if(!go(e))throw new TypeError(`${t} is not a ReadableStream.`)}function je(e){return new Ne(e)}function ke(e,t){e._reader._readRequests.push(t)}function qe(e,t,r){const o=e._reader._readRequests.shift();r?o._closeSteps():o._chunkSteps(t)}function xe(e){return e._reader._readRequests.length}function Le(e){const t=e._reader;return void 0!==t&&!!We(t)}class Ne{constructor(e){if(Ee(e,1,"ReadableStreamDefaultReader"),Ie(e,"First parameter"),wo(e))throw new TypeError("This stream has already been locked for exclusive reading by another reader");fe(this,e),this._readRequests=new ae}get closed(){return We(this)?this._closedPromise:Q(Fe("closed"))}cancel(e=void 0){return We(this)?void 0===this._ownerReadableStream?Q(be("cancel")):pe(this,e):Q(Fe("cancel"))}read(){if(!We(this))return Q(Fe("read"));if(void 0===this._ownerReadableStream)return Q(be("read from"));let e,t;const r=Y(((r,o)=>{e=r,t=o}));return Me(this,{_chunkSteps:t=>e({value:t,done:!1}),_closeSteps:()=>e({value:void 0,done:!0}),_errorSteps:e=>t(e)}),r}releaseLock(){if(!We(this))throw Fe("releaseLock");void 0!==this._ownerReadableStream&&function(e){he(e),De(e,new TypeError("Reader was released"))}(this)}}function We(e){return!!F(e)&&!!Object.prototype.hasOwnProperty.call(e,"_readRequests")&&e instanceof Ne}function Me(e,t){const r=e._ownerReadableStream;r._disturbed=!0,"closed"===r._state?t._closeSteps():"errored"===r._state?t._errorSteps(r._storedError):r._readableStreamController[ce](t)}function De(e,t){const r=e._readRequests;e._readRequests=new ae,r.forEach((e=>{e._errorSteps(t)}))}function Fe(e){return new TypeError(`ReadableStreamDefaultReader.prototype.${e} can only be used on a ReadableStreamDefaultReader`)}var Be,Ue,ze;function $e(e){return e.slice()}function Ve(e,t,r,o,n){new Uint8Array(e).set(new Uint8Array(r,o,n),t)}Object.defineProperties(Ne.prototype,{cancel:{enumerable:!0},read:{enumerable:!0},releaseLock:{enumerable:!0},closed:{enumerable:!0}}),U(Ne.prototype.cancel,"cancel"),U(Ne.prototype.read,"read"),U(Ne.prototype.releaseLock,"releaseLock"),"symbol"==typeof Symbol.toStringTag&&Object.defineProperty(Ne.prototype,Symbol.toStringTag,{value:"ReadableStreamDefaultReader",configurable:!0});let He=e=>(He="function"==typeof e.transfer?e=>e.transfer():"function"==typeof structuredClone?e=>structuredClone(e,{transfer:[e]}):e=>e,He(e)),Ge=e=>(Ge="boolean"==typeof e.detached?e=>e.detached:e=>0===e.byteLength,Ge(e));function Ye(e,t,r){if(e.slice)return e.slice(t,r);const o=r-t,n=new ArrayBuffer(o);return Ve(n,0,e,t,o),n}function Ke(e,t){const r=e[t];if(null!=r){if("function"!=typeof r)throw new TypeError(`${String(t)} is not a function`);return r}}function Qe(e){try{const t=e.done,r=e.value;return J(G(r),(e=>({done:t,value:e})))}catch(e){return Q(e)}}const Je=null!==(ze=null!==(Be=Symbol.asyncIterator)&&void 0!==Be?Be:null===(Ue=Symbol.for)||void 0===Ue?void 0:Ue.call(Symbol,"Symbol.asyncIterator"))&&void 0!==ze?ze:"@@asyncIterator";function Xe(e,t="sync",r){if(void 0===r)if("async"===t){if(void 0===(r=Ke(e,Je)))return function(e){const t={next(){let t;try{t=Ze(e)}catch(e){return Q(e)}return Qe(t)},return(t){let r;try{const o=Ke(e.iterator,"return");if(void 0===o)return K({done:!0,value:t});r=ne(o,e.iterator,[t])}catch(e){return Q(e)}return F(r)?Qe(r):Q(new TypeError("The iterator.return() method must return an object"))}};return{iterator:t,nextMethod:t.next,done:!1}}(Xe(e,"sync",Ke(e,Symbol.iterator)))}else r=Ke(e,Symbol.iterator);if(void 0===r)throw new TypeError("The object is not iterable");const o=ne(r,e,[]);if(!F(o))throw new TypeError("The iterator method must return an object");return{iterator:o,nextMethod:o.next,done:!1}}function Ze(e){const t=ne(e.nextMethod,e.iterator,[]);if(!F(t))throw new TypeError("The iterator.next() method must return an object");return t}class et{constructor(e,t){this._ongoingPromise=void 0,this._isFinished=!1,this._reader=e,this._preventCancel=t}next(){const e=()=>this._nextSteps();return this._ongoingPromise=this._ongoingPromise?te(this._ongoingPromise,e,e):e(),this._ongoingPromise}return(e){const t=()=>this._returnSteps(e);return this._ongoingPromise?te(this._ongoingPromise,t,t):t()}_nextSteps(){if(this._isFinished)return Promise.resolve({value:void 0,done:!0});const e=this._reader;let t,r;const o=Y(((e,o)=>{t=e,r=o}));return Me(e,{_chunkSteps:e=>{this._ongoingPromise=void 0,oe((()=>t({value:e,done:!1})))},_closeSteps:()=>{this._ongoingPromise=void 0,this._isFinished=!0,he(e),t({value:void 0,done:!0})},_errorSteps:t=>{this._ongoingPromise=void 0,this._isFinished=!0,he(e),r(t)}}),o}_returnSteps(e){if(this._isFinished)return Promise.resolve({value:e,done:!0});this._isFinished=!0;const t=this._reader;if(!this._preventCancel){const r=pe(t,e);return he(t),te(r,(()=>({value:e,done:!0})))}return he(t),K({value:e,done:!0})}}const tt={next(){return rt(this)?this._asyncIteratorImpl.next():Q(ot("next"))},return(e){return rt(this)?this._asyncIteratorImpl.return(e):Q(ot("return"))},[Je](){return this}};function rt(e){if(!F(e))return!1;if(!Object.prototype.hasOwnProperty.call(e,"_asyncIteratorImpl"))return!1;try{return e._asyncIteratorImpl instanceof et}catch(e){return!1}}function ot(e){return new TypeError(`ReadableStreamAsyncIterator.${e} can only be used on a ReadableSteamAsyncIterator`)}Object.defineProperty(tt,Je,{enumerable:!1});const nt=Number.isNaN||function(e){return e!=e};function it(e){const t=Ye(e.buffer,e.byteOffset,e.byteOffset+e.byteLength);return new Uint8Array(t)}function at(e){const t=e._queue.shift();return e._queueTotalSize-=t.size,e._queueTotalSize<0&&(e._queueTotalSize=0),t.value}function st(e,t,r){if("number"!=typeof(o=r)||nt(o)||o<0||r===1/0)throw new RangeError("Size must be a finite, non-NaN, non-negative number.");var o;e._queue.push({value:t,size:r}),e._queueTotalSize+=r}function ut(e){e._queue=new ae,e._queueTotalSize=0}function lt(e){return e===DataView}class ct{constructor(){throw new TypeError("Illegal constructor")}get view(){if(!pt(this))throw Mt("view");return this._view}respond(e){if(!pt(this))throw Mt("respond");if(Ee(e,1,"respond"),e=Ce(e,"First parameter"),void 0===this._associatedReadableByteStreamController)throw new TypeError("This BYOB request has been invalidated");if(Ge(this._view.buffer))throw new TypeError("The BYOB request's buffer has been detached and so cannot be used as a response");Lt(this._associatedReadableByteStreamController,e)}respondWithNewView(e){if(!pt(this))throw Mt("respondWithNewView");if(Ee(e,1,"respondWithNewView"),!ArrayBuffer.isView(e))throw new TypeError("You can only respond with array buffer views");if(void 0===this._associatedReadableByteStreamController)throw new TypeError("This BYOB request has been invalidated");if(Ge(e.buffer))throw new TypeError("The given view's buffer has been detached and so cannot be used as a response");Nt(this._associatedReadableByteStreamController,e)}}Object.defineProperties(ct.prototype,{respond:{enumerable:!0},respondWithNewView:{enumerable:!0},view:{enumerable:!0}}),U(ct.prototype.respond,"respond"),U(ct.prototype.respondWithNewView,"respondWithNewView"),"symbol"==typeof Symbol.toStringTag&&Object.defineProperty(ct.prototype,Symbol.toStringTag,{value:"ReadableStreamBYOBRequest",configurable:!0});class dt{constructor(){throw new TypeError("Illegal constructor")}get byobRequest(){if(!ft(this))throw Dt("byobRequest");return qt(this)}get desiredSize(){if(!ft(this))throw Dt("desiredSize");return xt(this)}close(){if(!ft(this))throw Dt("close");if(this._closeRequested)throw new TypeError("The stream has already been closed; do not close it again!");const e=this._controlledReadableByteStream._state;if("readable"!==e)throw new TypeError(`The stream (in ${e} state) is not in the readable state and cannot be closed`);Ct(this)}enqueue(e){if(!ft(this))throw Dt("enqueue");if(Ee(e,1,"enqueue"),!ArrayBuffer.isView(e))throw new TypeError("chunk must be an array buffer view");if(0===e.byteLength)throw new TypeError("chunk must have non-zero byteLength");if(0===e.buffer.byteLength)throw new TypeError("chunk's buffer must have non-zero byteLength");if(this._closeRequested)throw new TypeError("stream is closed or draining");const t=this._controlledReadableByteStream._state;if("readable"!==t)throw new TypeError(`The stream (in ${t} state) is not in the readable state and cannot be enqueued to`);It(this,e)}error(e=void 0){if(!ft(this))throw Dt("error");jt(this,e)}[le](e){bt(this),ut(this);const t=this._cancelAlgorithm(e);return At(this),t}[ce](e){const t=this._controlledReadableByteStream;if(this._queueTotalSize>0)return void kt(this,e);const r=this._autoAllocateChunkSize;if(void 0!==r){let o;try{o=new ArrayBuffer(r)}catch(t){return void e._errorSteps(t)}const n={buffer:o,bufferByteLength:r,byteOffset:0,byteLength:r,bytesFilled:0,minimumFill:1,elementSize:1,viewConstructor:Uint8Array,readerType:"default"};this._pendingPullIntos.push(n)}ke(t,e),ht(this)}[de](){if(this._pendingPullIntos.length>0){const e=this._pendingPullIntos.peek();e.readerType="none",this._pendingPullIntos=new ae,this._pendingPullIntos.push(e)}}}function ft(e){return!!F(e)&&!!Object.prototype.hasOwnProperty.call(e,"_controlledReadableByteStream")&&e instanceof dt}function pt(e){return!!F(e)&&!!Object.prototype.hasOwnProperty.call(e,"_associatedReadableByteStreamController")&&e instanceof ct}function ht(e){const t=function(e){const t=e._controlledReadableByteStream;return"readable"===t._state&&(!e._closeRequested&&(!!e._started&&(!!(Le(t)&&xe(t)>0)||(!!($t(t)&&zt(t)>0)||xt(e)>0))))}(e);t&&(e._pulling?e._pullAgain=!0:(e._pulling=!0,X(e._pullAlgorithm(),(()=>(e._pulling=!1,e._pullAgain&&(e._pullAgain=!1,ht(e)),null)),(t=>(jt(e,t),null)))))}function bt(e){Pt(e),e._pendingPullIntos=new ae}function yt(e,t){let r=!1;"closed"===e._state&&(r=!0);const o=mt(t);"default"===t.readerType?qe(e,o,r):function(e,t,r){const o=e._reader._readIntoRequests.shift();r?o._closeSteps(t):o._chunkSteps(t)}(e,o,r)}function mt(e){const t=e.bytesFilled,r=e.elementSize;return new e.viewConstructor(e.buffer,e.byteOffset,t/r)}function vt(e,t,r,o){e._queue.push({buffer:t,byteOffset:r,byteLength:o}),e._queueTotalSize+=o}function _t(e,t,r,o){let n;try{n=Ye(t,r,r+o)}catch(t){throw jt(e,t),t}vt(e,n,0,o)}function gt(e,t){t.bytesFilled>0&&_t(e,t.buffer,t.byteOffset,t.bytesFilled),Rt(e)}function wt(e,t){const r=Math.min(e._queueTotalSize,t.byteLength-t.bytesFilled),o=t.bytesFilled+r;let n=r,i=!1;const a=o-o%t.elementSize;a>=t.minimumFill&&(n=a-t.bytesFilled,i=!0);const s=e._queue;for(;n>0;){const r=s.peek(),o=Math.min(n,r.byteLength),i=t.byteOffset+t.bytesFilled;Ve(t.buffer,i,r.buffer,r.byteOffset,o),r.byteLength===o?s.shift():(r.byteOffset+=o,r.byteLength-=o),e._queueTotalSize-=o,St(0,o,t),n-=o}return i}function St(e,t,r){r.bytesFilled+=t}function Ot(e){0===e._queueTotalSize&&e._closeRequested?(At(e),Oo(e._controlledReadableByteStream)):ht(e)}function Pt(e){null!==e._byobRequest&&(e._byobRequest._associatedReadableByteStreamController=void 0,e._byobRequest._view=null,e._byobRequest=null)}function Et(e){for(;e._pendingPullIntos.length>0;){if(0===e._queueTotalSize)return;const t=e._pendingPullIntos.peek();wt(e,t)&&(Rt(e),yt(e._controlledReadableByteStream,t))}}function Tt(e,t){const r=e._pendingPullIntos.peek();Pt(e),"closed"===e._controlledReadableByteStream._state?function(e,t){"none"===t.readerType&&Rt(e);const r=e._controlledReadableByteStream;if($t(r))for(;zt(r)>0;)yt(r,Rt(e))}(e,r):function(e,t,r){if(St(0,t,r),"none"===r.readerType)return gt(e,r),void Et(e);if(r.bytesFilled<r.minimumFill)return;Rt(e);const o=r.bytesFilled%r.elementSize;if(o>0){const t=r.byteOffset+r.bytesFilled;_t(e,r.buffer,t-o,o)}r.bytesFilled-=o,yt(e._controlledReadableByteStream,r),Et(e)}(e,t,r),ht(e)}function Rt(e){return e._pendingPullIntos.shift()}function At(e){e._pullAlgorithm=void 0,e._cancelAlgorithm=void 0}function Ct(e){const t=e._controlledReadableByteStream;if(!e._closeRequested&&"readable"===t._state)if(e._queueTotalSize>0)e._closeRequested=!0;else{if(e._pendingPullIntos.length>0){const t=e._pendingPullIntos.peek();if(t.bytesFilled%t.elementSize!=0){const t=new TypeError("Insufficient bytes to fill elements in the given buffer");throw jt(e,t),t}}At(e),Oo(t)}}function It(e,t){const r=e._controlledReadableByteStream;if(e._closeRequested||"readable"!==r._state)return;const{buffer:o,byteOffset:n,byteLength:i}=t;if(Ge(o))throw new TypeError("chunk's buffer is detached and so cannot be enqueued");const a=He(o);if(e._pendingPullIntos.length>0){const t=e._pendingPullIntos.peek();if(Ge(t.buffer))throw new TypeError("The BYOB request's buffer has been detached and so cannot be filled with an enqueued chunk");Pt(e),t.buffer=He(t.buffer),"none"===t.readerType&>(e,t)}Le(r)?(function(e){const t=e._controlledReadableByteStream._reader;for(;t._readRequests.length>0;){if(0===e._queueTotalSize)return;kt(e,t._readRequests.shift())}}(e),0===xe(r)?vt(e,a,n,i):(e._pendingPullIntos.length>0&&Rt(e),qe(r,new Uint8Array(a,n,i),!1))):$t(r)?(vt(e,a,n,i),Et(e)):vt(e,a,n,i),ht(e)}function jt(e,t){const r=e._controlledReadableByteStream;"readable"===r._state&&(bt(e),ut(e),At(e),Po(r,t))}function kt(e,t){const r=e._queue.shift();e._queueTotalSize-=r.byteLength,Ot(e);const o=new Uint8Array(r.buffer,r.byteOffset,r.byteLength);t._chunkSteps(o)}function qt(e){if(null===e._byobRequest&&e._pendingPullIntos.length>0){const t=e._pendingPullIntos.peek(),r=new Uint8Array(t.buffer,t.byteOffset+t.bytesFilled,t.byteLength-t.bytesFilled),o=Object.create(ct.prototype);!function(e,t,r){e._associatedReadableByteStreamController=t,e._view=r}(o,e,r),e._byobRequest=o}return e._byobRequest}function xt(e){const t=e._controlledReadableByteStream._state;return"errored"===t?null:"closed"===t?0:e._strategyHWM-e._queueTotalSize}function Lt(e,t){const r=e._pendingPullIntos.peek();if("closed"===e._controlledReadableByteStream._state){if(0!==t)throw new TypeError("bytesWritten must be 0 when calling respond() on a closed stream")}else{if(0===t)throw new TypeError("bytesWritten must be greater than 0 when calling respond() on a readable stream");if(r.bytesFilled+t>r.byteLength)throw new RangeError("bytesWritten out of range")}r.buffer=He(r.buffer),Tt(e,t)}function Nt(e,t){const r=e._pendingPullIntos.peek();if("closed"===e._controlledReadableByteStream._state){if(0!==t.byteLength)throw new TypeError("The view's length must be 0 when calling respondWithNewView() on a closed stream")}else if(0===t.byteLength)throw new TypeError("The view's length must be greater than 0 when calling respondWithNewView() on a readable stream");if(r.byteOffset+r.bytesFilled!==t.byteOffset)throw new RangeError("The region specified by view does not match byobRequest");if(r.bufferByteLength!==t.buffer.byteLength)throw new RangeError("The buffer of view has different capacity than byobRequest");if(r.bytesFilled+t.byteLength>r.byteLength)throw new RangeError("The region specified by view is larger than byobRequest");const o=t.byteLength;r.buffer=He(t.buffer),Tt(e,o)}function Wt(e,t,r,o,n,i,a){t._controlledReadableByteStream=e,t._pullAgain=!1,t._pulling=!1,t._byobRequest=null,t._queue=t._queueTotalSize=void 0,ut(t),t._closeRequested=!1,t._started=!1,t._strategyHWM=i,t._pullAlgorithm=o,t._cancelAlgorithm=n,t._autoAllocateChunkSize=a,t._pendingPullIntos=new ae,e._readableStreamController=t,X(K(r()),(()=>(t._started=!0,ht(t),null)),(e=>(jt(t,e),null)))}function Mt(e){return new TypeError(`ReadableStreamBYOBRequest.prototype.${e} can only be used on a ReadableStreamBYOBRequest`)}function Dt(e){return new TypeError(`ReadableByteStreamController.prototype.${e} can only be used on a ReadableByteStreamController`)}function Ft(e,t){if("byob"!=(e=`${e}`))throw new TypeError(`${t} '${e}' is not a valid enumeration value for ReadableStreamReaderMode`);return e}function Bt(e){return new Vt(e)}function Ut(e,t){e._reader._readIntoRequests.push(t)}function zt(e){return e._reader._readIntoRequests.length}function $t(e){const t=e._reader;return void 0!==t&&!!Ht(t)}Object.defineProperties(dt.prototype,{close:{enumerable:!0},enqueue:{enumerable:!0},error:{enumerable:!0},byobRequest:{enumerable:!0},desiredSize:{enumerable:!0}}),U(dt.prototype.close,"close"),U(dt.prototype.enqueue,"enqueue"),U(dt.prototype.error,"error"),"symbol"==typeof Symbol.toStringTag&&Object.defineProperty(dt.prototype,Symbol.toStringTag,{value:"ReadableByteStreamController",configurable:!0});class Vt{constructor(e){if(Ee(e,1,"ReadableStreamBYOBReader"),Ie(e,"First parameter"),wo(e))throw new TypeError("This stream has already been locked for exclusive reading by another reader");if(!ft(e._readableStreamController))throw new TypeError("Cannot construct a ReadableStreamBYOBReader for a stream not constructed with a byte source");fe(this,e),this._readIntoRequests=new ae}get closed(){return Ht(this)?this._closedPromise:Q(Kt("closed"))}cancel(e=void 0){return Ht(this)?void 0===this._ownerReadableStream?Q(be("cancel")):pe(this,e):Q(Kt("cancel"))}read(e,t={}){if(!Ht(this))return Q(Kt("read"));if(!ArrayBuffer.isView(e))return Q(new TypeError("view must be an array buffer view"));if(0===e.byteLength)return Q(new TypeError("view must have non-zero byteLength"));if(0===e.buffer.byteLength)return Q(new TypeError("view's buffer must have non-zero byteLength"));if(Ge(e.buffer))return Q(new TypeError("view's buffer has been detached"));let r;try{r=function(e,t){var r;return Se(e,t),{min:Ce(null!==(r=null==e?void 0:e.min)&&void 0!==r?r:1,`${t} has member 'min' that`)}}(t,"options")}catch(e){return Q(e)}const o=r.min;if(0===o)return Q(new TypeError("options.min must be greater than 0"));if(function(e){return lt(e.constructor)}(e)){if(o>e.byteLength)return Q(new RangeError("options.min must be less than or equal to view's byteLength"))}else if(o>e.length)return Q(new RangeError("options.min must be less than or equal to view's length"));if(void 0===this._ownerReadableStream)return Q(be("read from"));let n,i;const a=Y(((e,t)=>{n=e,i=t}));return Gt(this,e,o,{_chunkSteps:e=>n({value:e,done:!1}),_closeSteps:e=>n({value:e,done:!0}),_errorSteps:e=>i(e)}),a}releaseLock(){if(!Ht(this))throw Kt("releaseLock");void 0!==this._ownerReadableStream&&function(e){he(e),Yt(e,new TypeError("Reader was released"))}(this)}}function Ht(e){return!!F(e)&&!!Object.prototype.hasOwnProperty.call(e,"_readIntoRequests")&&e instanceof Vt}function Gt(e,t,r,o){const n=e._ownerReadableStream;n._disturbed=!0,"errored"===n._state?o._errorSteps(n._storedError):function(e,t,r,o){const n=e._controlledReadableByteStream,i=t.constructor,a=function(e){return lt(e)?1:e.BYTES_PER_ELEMENT}(i),{byteOffset:s,byteLength:u}=t,l=r*a;let c;try{c=He(t.buffer)}catch(e){return void o._errorSteps(e)}const d={buffer:c,bufferByteLength:c.byteLength,byteOffset:s,byteLength:u,bytesFilled:0,minimumFill:l,elementSize:a,viewConstructor:i,readerType:"byob"};if(e._pendingPullIntos.length>0)return e._pendingPullIntos.push(d),void Ut(n,o);if("closed"!==n._state){if(e._queueTotalSize>0){if(wt(e,d)){const t=mt(d);return Ot(e),void o._chunkSteps(t)}if(e._closeRequested){const t=new TypeError("Insufficient bytes to fill elements in the given buffer");return jt(e,t),void o._errorSteps(t)}}e._pendingPullIntos.push(d),Ut(n,o),ht(e)}else{const e=new i(d.buffer,d.byteOffset,0);o._closeSteps(e)}}(n._readableStreamController,t,r,o)}function Yt(e,t){const r=e._readIntoRequests;e._readIntoRequests=new ae,r.forEach((e=>{e._errorSteps(t)}))}function Kt(e){return new TypeError(`ReadableStreamBYOBReader.prototype.${e} can only be used on a ReadableStreamBYOBReader`)}function Qt(e,t){const{highWaterMark:r}=e;if(void 0===r)return t;if(nt(r)||r<0)throw new RangeError("Invalid highWaterMark");return r}function Jt(e){const{size:t}=e;return t||(()=>1)}function Xt(e,t){Se(e,t);const r=null==e?void 0:e.highWaterMark,o=null==e?void 0:e.size;return{highWaterMark:void 0===r?void 0:Re(r),size:void 0===o?void 0:Zt(o,`${t} has member 'size' that`)}}function Zt(e,t){return Oe(e,t),t=>Re(e(t))}function er(e,t,r){return Oe(e,r),r=>ie(e,t,[r])}function tr(e,t,r){return Oe(e,r),()=>ie(e,t,[])}function rr(e,t,r){return Oe(e,r),r=>ne(e,t,[r])}function or(e,t,r){return Oe(e,r),(r,o)=>ie(e,t,[r,o])}function nr(e,t){if(!lr(e))throw new TypeError(`${t} is not a WritableStream.`)}Object.defineProperties(Vt.prototype,{cancel:{enumerable:!0},read:{enumerable:!0},releaseLock:{enumerable:!0},closed:{enumerable:!0}}),U(Vt.prototype.cancel,"cancel"),U(Vt.prototype.read,"read"),U(Vt.prototype.releaseLock,"releaseLock"),"symbol"==typeof Symbol.toStringTag&&Object.defineProperty(Vt.prototype,Symbol.toStringTag,{value:"ReadableStreamBYOBReader",configurable:!0});const ir="function"==typeof AbortController;class ar{constructor(e={},t={}){void 0===e?e=null:Pe(e,"First parameter");const r=Xt(t,"Second parameter"),o=function(e,t){Se(e,t);const r=null==e?void 0:e.abort,o=null==e?void 0:e.close,n=null==e?void 0:e.start,i=null==e?void 0:e.type,a=null==e?void 0:e.write;return{abort:void 0===r?void 0:er(r,e,`${t} has member 'abort' that`),close:void 0===o?void 0:tr(o,e,`${t} has member 'close' that`),start:void 0===n?void 0:rr(n,e,`${t} has member 'start' that`),write:void 0===a?void 0:or(a,e,`${t} has member 'write' that`),type:i}}(e,"First parameter");if(ur(this),void 0!==o.type)throw new RangeError("Invalid type is specified");const n=Jt(r);!function(e,t,r,o){const n=Object.create(Tr.prototype);let i,a,s,u;i=void 0!==t.start?()=>t.start(n):()=>{},a=void 0!==t.write?e=>t.write(e,n):()=>K(void 0),s=void 0!==t.close?()=>t.close():()=>K(void 0),u=void 0!==t.abort?e=>t.abort(e):()=>K(void 0),Ar(e,n,i,a,s,u,r,o)}(this,o,Qt(r,1),n)}get locked(){if(!lr(this))throw Lr("locked");return cr(this)}abort(e=void 0){return lr(this)?cr(this)?Q(new TypeError("Cannot abort a stream that already has a writer")):dr(this,e):Q(Lr("abort"))}close(){return lr(this)?cr(this)?Q(new TypeError("Cannot close a stream that already has a writer")):yr(this)?Q(new TypeError("Cannot close an already-closing stream")):fr(this):Q(Lr("close"))}getWriter(){if(!lr(this))throw Lr("getWriter");return sr(this)}}function sr(e){return new _r(e)}function ur(e){e._state="writable",e._storedError=void 0,e._writer=void 0,e._writableStreamController=void 0,e._writeRequests=new ae,e._inFlightWriteRequest=void 0,e._closeRequest=void 0,e._inFlightCloseRequest=void 0,e._pendingAbortRequest=void 0,e._backpressure=!1}function lr(e){return!!F(e)&&!!Object.prototype.hasOwnProperty.call(e,"_writableStreamController")&&e instanceof ar}function cr(e){return void 0!==e._writer}function dr(e,t){var r;if("closed"===e._state||"errored"===e._state)return K(void 0);e._writableStreamController._abortReason=t,null===(r=e._writableStreamController._abortController)||void 0===r||r.abort(t);const o=e._state;if("closed"===o||"errored"===o)return K(void 0);if(void 0!==e._pendingAbortRequest)return e._pendingAbortRequest._promise;let n=!1;"erroring"===o&&(n=!0,t=void 0);const i=Y(((r,o)=>{e._pendingAbortRequest={_promise:void 0,_resolve:r,_reject:o,_reason:t,_wasAlreadyErroring:n}}));return e._pendingAbortRequest._promise=i,n||hr(e,t),i}function fr(e){const t=e._state;if("closed"===t||"errored"===t)return Q(new TypeError(`The stream (in ${t} state) is not in the writable state and cannot be closed`));const r=Y(((t,r)=>{const o={_resolve:t,_reject:r};e._closeRequest=o})),o=e._writer;var n;return void 0!==o&&e._backpressure&&"writable"===t&&Gr(o),st(n=e._writableStreamController,Er,0),jr(n),r}function pr(e,t){"writable"!==e._state?br(e):hr(e,t)}function hr(e,t){const r=e._writableStreamController;e._state="erroring",e._storedError=t;const o=e._writer;void 0!==o&&Sr(o,t),!function(e){return void 0!==e._inFlightWriteRequest||void 0!==e._inFlightCloseRequest}(e)&&r._started&&br(e)}function br(e){e._state="errored",e._writableStreamController[ue]();const t=e._storedError;if(e._writeRequests.forEach((e=>{e._reject(t)})),e._writeRequests=new ae,void 0===e._pendingAbortRequest)return void mr(e);const r=e._pendingAbortRequest;if(e._pendingAbortRequest=void 0,r._wasAlreadyErroring)return r._reject(t),void mr(e);X(e._writableStreamController[se](r._reason),(()=>(r._resolve(),mr(e),null)),(t=>(r._reject(t),mr(e),null)))}function yr(e){return void 0!==e._closeRequest||void 0!==e._inFlightCloseRequest}function mr(e){void 0!==e._closeRequest&&(e._closeRequest._reject(e._storedError),e._closeRequest=void 0);const t=e._writer;void 0!==t&&Br(t,e._storedError)}function vr(e,t){const r=e._writer;void 0!==r&&t!==e._backpressure&&(t?function(e){zr(e)}(r):Gr(r)),e._backpressure=t}Object.defineProperties(ar.prototype,{abort:{enumerable:!0},close:{enumerable:!0},getWriter:{enumerable:!0},locked:{enumerable:!0}}),U(ar.prototype.abort,"abort"),U(ar.prototype.close,"close"),U(ar.prototype.getWriter,"getWriter"),"symbol"==typeof Symbol.toStringTag&&Object.defineProperty(ar.prototype,Symbol.toStringTag,{value:"WritableStream",configurable:!0});class _r{constructor(e){if(Ee(e,1,"WritableStreamDefaultWriter"),nr(e,"First parameter"),cr(e))throw new TypeError("This stream has already been locked for exclusive writing by another writer");this._ownerWritableStream=e,e._writer=this;const t=e._state;if("writable"===t)!yr(e)&&e._backpressure?zr(this):Vr(this),Dr(this);else if("erroring"===t)$r(this,e._storedError),Dr(this);else if("closed"===t)Vr(this),Dr(this),Ur(this);else{const t=e._storedError;$r(this,t),Fr(this,t)}}get closed(){return gr(this)?this._closedPromise:Q(Wr("closed"))}get desiredSize(){if(!gr(this))throw Wr("desiredSize");if(void 0===this._ownerWritableStream)throw Mr("desiredSize");return function(e){const t=e._ownerWritableStream,r=t._state;return"errored"===r||"erroring"===r?null:"closed"===r?0:Ir(t._writableStreamController)}(this)}get ready(){return gr(this)?this._readyPromise:Q(Wr("ready"))}abort(e=void 0){return gr(this)?void 0===this._ownerWritableStream?Q(Mr("abort")):function(e,t){return dr(e._ownerWritableStream,t)}(this,e):Q(Wr("abort"))}close(){if(!gr(this))return Q(Wr("close"));const e=this._ownerWritableStream;return void 0===e?Q(Mr("close")):yr(e)?Q(new TypeError("Cannot close an already-closing stream")):wr(this)}releaseLock(){if(!gr(this))throw Wr("releaseLock");void 0!==this._ownerWritableStream&&Or(this)}write(e=void 0){return gr(this)?void 0===this._ownerWritableStream?Q(Mr("write to")):Pr(this,e):Q(Wr("write"))}}function gr(e){return!!F(e)&&!!Object.prototype.hasOwnProperty.call(e,"_ownerWritableStream")&&e instanceof _r}function wr(e){return fr(e._ownerWritableStream)}function Sr(e,t){"pending"===e._readyPromiseState?Hr(e,t):function(e,t){$r(e,t)}(e,t)}function Or(e){const t=e._ownerWritableStream,r=new TypeError("Writer was released and can no longer be used to monitor the stream's closedness");Sr(e,r),function(e,t){"pending"===e._closedPromiseState?Br(e,t):function(e,t){Fr(e,t)}(e,t)}(e,r),t._writer=void 0,e._ownerWritableStream=void 0}function Pr(e,t){const r=e._ownerWritableStream,o=r._writableStreamController,n=function(e,t){try{return e._strategySizeAlgorithm(t)}catch(t){return kr(e,t),1}}(o,t);if(r!==e._ownerWritableStream)return Q(Mr("write to"));const i=r._state;if("errored"===i)return Q(r._storedError);if(yr(r)||"closed"===i)return Q(new TypeError("The stream is closing or closed and cannot be written to"));if("erroring"===i)return Q(r._storedError);const a=function(e){return Y(((t,r)=>{const o={_resolve:t,_reject:r};e._writeRequests.push(o)}))}(r);return function(e,t,r){try{st(e,t,r)}catch(t){return void kr(e,t)}const o=e._controlledWritableStream;yr(o)||"writable"!==o._state||vr(o,qr(e)),jr(e)}(o,t,n),a}Object.defineProperties(_r.prototype,{abort:{enumerable:!0},close:{enumerable:!0},releaseLock:{enumerable:!0},write:{enumerable:!0},closed:{enumerable:!0},desiredSize:{enumerable:!0},ready:{enumerable:!0}}),U(_r.prototype.abort,"abort"),U(_r.prototype.close,"close"),U(_r.prototype.releaseLock,"releaseLock"),U(_r.prototype.write,"write"),"symbol"==typeof Symbol.toStringTag&&Object.defineProperty(_r.prototype,Symbol.toStringTag,{value:"WritableStreamDefaultWriter",configurable:!0});const Er={};class Tr{constructor(){throw new TypeError("Illegal constructor")}get abortReason(){if(!Rr(this))throw Nr("abortReason");return this._abortReason}get signal(){if(!Rr(this))throw Nr("signal");if(void 0===this._abortController)throw new TypeError("WritableStreamDefaultController.prototype.signal is not supported");return this._abortController.signal}error(e=void 0){if(!Rr(this))throw Nr("error");"writable"===this._controlledWritableStream._state&&xr(this,e)}[se](e){const t=this._abortAlgorithm(e);return Cr(this),t}[ue](){ut(this)}}function Rr(e){return!!F(e)&&!!Object.prototype.hasOwnProperty.call(e,"_controlledWritableStream")&&e instanceof Tr}function Ar(e,t,r,o,n,i,a,s){t._controlledWritableStream=e,e._writableStreamController=t,t._queue=void 0,t._queueTotalSize=void 0,ut(t),t._abortReason=void 0,t._abortController=function(){if(ir)return new AbortController}(),t._started=!1,t._strategySizeAlgorithm=s,t._strategyHWM=a,t._writeAlgorithm=o,t._closeAlgorithm=n,t._abortAlgorithm=i;const u=qr(t);vr(e,u),X(K(r()),(()=>(t._started=!0,jr(t),null)),(r=>(t._started=!0,pr(e,r),null)))}function Cr(e){e._writeAlgorithm=void 0,e._closeAlgorithm=void 0,e._abortAlgorithm=void 0,e._strategySizeAlgorithm=void 0}function Ir(e){return e._strategyHWM-e._queueTotalSize}function jr(e){const t=e._controlledWritableStream;if(!e._started)return;if(void 0!==t._inFlightWriteRequest)return;if("erroring"===t._state)return void br(t);if(0===e._queue.length)return;const r=e._queue.peek().value;r===Er?function(e){const t=e._controlledWritableStream;(function(e){e._inFlightCloseRequest=e._closeRequest,e._closeRequest=void 0})(t),at(e);const r=e._closeAlgorithm();Cr(e),X(r,(()=>(function(e){e._inFlightCloseRequest._resolve(void 0),e._inFlightCloseRequest=void 0,"erroring"===e._state&&(e._storedError=void 0,void 0!==e._pendingAbortRequest&&(e._pendingAbortRequest._resolve(),e._pendingAbortRequest=void 0)),e._state="closed";const t=e._writer;void 0!==t&&Ur(t)}(t),null)),(e=>(function(e,t){e._inFlightCloseRequest._reject(t),e._inFlightCloseRequest=void 0,void 0!==e._pendingAbortRequest&&(e._pendingAbortRequest._reject(t),e._pendingAbortRequest=void 0),pr(e,t)}(t,e),null)))}(e):function(e,t){const r=e._controlledWritableStream;!function(e){e._inFlightWriteRequest=e._writeRequests.shift()}(r),X(e._writeAlgorithm(t),(()=>{!function(e){e._inFlightWriteRequest._resolve(void 0),e._inFlightWriteRequest=void 0}(r);const t=r._state;if(at(e),!yr(r)&&"writable"===t){const t=qr(e);vr(r,t)}return jr(e),null}),(t=>("writable"===r._state&&Cr(e),function(e,t){e._inFlightWriteRequest._reject(t),e._inFlightWriteRequest=void 0,pr(e,t)}(r,t),null)))}(e,r)}function kr(e,t){"writable"===e._controlledWritableStream._state&&xr(e,t)}function qr(e){return Ir(e)<=0}function xr(e,t){const r=e._controlledWritableStream;Cr(e),hr(r,t)}function Lr(e){return new TypeError(`WritableStream.prototype.${e} can only be used on a WritableStream`)}function Nr(e){return new TypeError(`WritableStreamDefaultController.prototype.${e} can only be used on a WritableStreamDefaultController`)}function Wr(e){return new TypeError(`WritableStreamDefaultWriter.prototype.${e} can only be used on a WritableStreamDefaultWriter`)}function Mr(e){return new TypeError("Cannot "+e+" a stream using a released writer")}function Dr(e){e._closedPromise=Y(((t,r)=>{e._closedPromise_resolve=t,e._closedPromise_reject=r,e._closedPromiseState="pending"}))}function Fr(e,t){Dr(e),Br(e,t)}function Br(e,t){void 0!==e._closedPromise_reject&&(re(e._closedPromise),e._closedPromise_reject(t),e._closedPromise_resolve=void 0,e._closedPromise_reject=void 0,e._closedPromiseState="rejected")}function Ur(e){void 0!==e._closedPromise_resolve&&(e._closedPromise_resolve(void 0),e._closedPromise_resolve=void 0,e._closedPromise_reject=void 0,e._closedPromiseState="resolved")}function zr(e){e._readyPromise=Y(((t,r)=>{e._readyPromise_resolve=t,e._readyPromise_reject=r})),e._readyPromiseState="pending"}function $r(e,t){zr(e),Hr(e,t)}function Vr(e){zr(e),Gr(e)}function Hr(e,t){void 0!==e._readyPromise_reject&&(re(e._readyPromise),e._readyPromise_reject(t),e._readyPromise_resolve=void 0,e._readyPromise_reject=void 0,e._readyPromiseState="rejected")}function Gr(e){void 0!==e._readyPromise_resolve&&(e._readyPromise_resolve(void 0),e._readyPromise_resolve=void 0,e._readyPromise_reject=void 0,e._readyPromiseState="fulfilled")}Object.defineProperties(Tr.prototype,{abortReason:{enumerable:!0},signal:{enumerable:!0},error:{enumerable:!0}}),"symbol"==typeof Symbol.toStringTag&&Object.defineProperty(Tr.prototype,Symbol.toStringTag,{value:"WritableStreamDefaultController",configurable:!0});const Yr="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof global?global:void 0,Kr=function(){const e=null==Yr?void 0:Yr.DOMException;return function(e){if("function"!=typeof e&&"object"!=typeof e)return!1;if("DOMException"!==e.name)return!1;try{return new e,!0}catch(e){return!1}}(e)?e:void 0}()||function(){const e=function(e,t){this.message=e||"",this.name=t||"Error",Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor)};return U(e,"DOMException"),e.prototype=Object.create(Error.prototype),Object.defineProperty(e.prototype,"constructor",{value:e,writable:!0,configurable:!0}),e}();function Qr(e,t,r,o,n,i){const a=je(e),s=sr(t);e._disturbed=!0;let u=!1,l=K(void 0);return Y(((c,d)=>{let f;if(void 0!==i){if(f=()=>{const r=void 0!==i.reason?i.reason:new Kr("Aborted","AbortError"),a=[];o||a.push((()=>"writable"===t._state?dr(t,r):K(void 0))),n||a.push((()=>"readable"===e._state?So(e,r):K(void 0))),v((()=>Promise.all(a.map((e=>e())))),!0,r)},i.aborted)return void f();i.addEventListener("abort",f)}var p,h,b;if(m(e,a._closedPromise,(e=>(o?_(!0,e):v((()=>dr(t,e)),!0,e),null))),m(t,s._closedPromise,(t=>(n?_(!0,t):v((()=>So(e,t)),!0,t),null))),p=e,h=a._closedPromise,b=()=>(r?_():v((()=>function(e){const t=e._ownerWritableStream,r=t._state;return yr(t)||"closed"===r?K(void 0):"errored"===r?Q(t._storedError):wr(e)}(s))),null),"closed"===p._state?b():Z(h,b),yr(t)||"closed"===t._state){const t=new TypeError("the destination writable stream closed before all data could be piped to it");n?_(!0,t):v((()=>So(e,t)),!0,t)}function y(){const e=l;return J(l,(()=>e!==l?y():void 0))}function m(e,t,r){"errored"===e._state?r(e._storedError):ee(t,r)}function v(e,r,o){function n(){return X(e(),(()=>g(r,o)),(e=>g(!0,e))),null}u||(u=!0,"writable"!==t._state||yr(t)?n():Z(y(),n))}function _(e,r){u||(u=!0,"writable"!==t._state||yr(t)?g(e,r):Z(y(),(()=>g(e,r))))}function g(e,t){return Or(s),he(a),void 0!==i&&i.removeEventListener("abort",f),e?d(t):c(void 0),null}re(Y(((e,t)=>{!function r(o){o?e():J(u?K(!0):J(s._readyPromise,(()=>Y(((e,t)=>{Me(a,{_chunkSteps:t=>{l=J(Pr(s,t),void 0,D),e(!1)},_closeSteps:()=>e(!0),_errorSteps:t})})))),r,t)}(!1)})))}))}class Jr{constructor(){throw new TypeError("Illegal constructor")}get desiredSize(){if(!Xr(this))throw uo("desiredSize");return io(this)}close(){if(!Xr(this))throw uo("close");if(!ao(this))throw new TypeError("The stream is not in a state that permits close");ro(this)}enqueue(e=void 0){if(!Xr(this))throw uo("enqueue");if(!ao(this))throw new TypeError("The stream is not in a state that permits enqueue");return oo(this,e)}error(e=void 0){if(!Xr(this))throw uo("error");no(this,e)}[le](e){ut(this);const t=this._cancelAlgorithm(e);return to(this),t}[ce](e){const t=this._controlledReadableStream;if(this._queue.length>0){const r=at(this);this._closeRequested&&0===this._queue.length?(to(this),Oo(t)):Zr(this),e._chunkSteps(r)}else ke(t,e),Zr(this)}[de](){}}function Xr(e){return!!F(e)&&!!Object.prototype.hasOwnProperty.call(e,"_controlledReadableStream")&&e instanceof Jr}function Zr(e){eo(e)&&(e._pulling?e._pullAgain=!0:(e._pulling=!0,X(e._pullAlgorithm(),(()=>(e._pulling=!1,e._pullAgain&&(e._pullAgain=!1,Zr(e)),null)),(t=>(no(e,t),null)))))}function eo(e){const t=e._controlledReadableStream;return!!ao(e)&&!!e._started&&(!!(wo(t)&&xe(t)>0)||io(e)>0)}function to(e){e._pullAlgorithm=void 0,e._cancelAlgorithm=void 0,e._strategySizeAlgorithm=void 0}function ro(e){if(!ao(e))return;const t=e._controlledReadableStream;e._closeRequested=!0,0===e._queue.length&&(to(e),Oo(t))}function oo(e,t){if(!ao(e))return;const r=e._controlledReadableStream;if(wo(r)&&xe(r)>0)qe(r,t,!1);else{let r;try{r=e._strategySizeAlgorithm(t)}catch(t){throw no(e,t),t}try{st(e,t,r)}catch(t){throw no(e,t),t}}Zr(e)}function no(e,t){const r=e._controlledReadableStream;"readable"===r._state&&(ut(e),to(e),Po(r,t))}function io(e){const t=e._controlledReadableStream._state;return"errored"===t?null:"closed"===t?0:e._strategyHWM-e._queueTotalSize}function ao(e){const t=e._controlledReadableStream._state;return!e._closeRequested&&"readable"===t}function so(e,t,r,o,n,i,a){t._controlledReadableStream=e,t._queue=void 0,t._queueTotalSize=void 0,ut(t),t._started=!1,t._closeRequested=!1,t._pullAgain=!1,t._pulling=!1,t._strategySizeAlgorithm=a,t._strategyHWM=i,t._pullAlgorithm=o,t._cancelAlgorithm=n,e._readableStreamController=t,X(K(r()),(()=>(t._started=!0,Zr(t),null)),(e=>(no(t,e),null)))}function uo(e){return new TypeError(`ReadableStreamDefaultController.prototype.${e} can only be used on a ReadableStreamDefaultController`)}function lo(e){return F(t=e)&&void 0!==t.getReader?function(e){let t;return t=mo(D,(function(){let r;try{r=e.read()}catch(r){return Q(r)}return te(r,(e=>{if(!F(e))throw new TypeError("The promise returned by the reader.read() method must fulfill with an object");if(e.done)ro(t._readableStreamController);else{const r=e.value;oo(t._readableStreamController,r)}}))}),(function(t){try{return K(e.cancel(t))}catch(t){return Q(t)}}),0),t}(e.getReader()):function(e){let t;const r=Xe(e,"async");return t=mo(D,(function(){let e;try{e=Ze(r)}catch(e){return Q(e)}return te(K(e),(e=>{if(!F(e))throw new TypeError("The promise returned by the iterator.next() method must fulfill with an object");if(e.done)ro(t._readableStreamController);else{const r=e.value;oo(t._readableStreamController,r)}}))}),(function(e){const t=r.iterator;let o;try{o=Ke(t,"return")}catch(e){return Q(e)}return void 0===o?K(void 0):te(ie(o,t,[e]),(e=>{if(!F(e))throw new TypeError("The promise returned by the iterator.return() method must fulfill with an object")}))}),0),t}(e);var t}function co(e,t,r){return Oe(e,r),r=>ie(e,t,[r])}function fo(e,t,r){return Oe(e,r),r=>ie(e,t,[r])}function po(e,t,r){return Oe(e,r),r=>ne(e,t,[r])}function ho(e,t){if("bytes"!=(e=`${e}`))throw new TypeError(`${t} '${e}' is not a valid enumeration value for ReadableStreamType`);return e}function bo(e,t){Se(e,t);const r=null==e?void 0:e.preventAbort,o=null==e?void 0:e.preventCancel,n=null==e?void 0:e.preventClose,i=null==e?void 0:e.signal;return void 0!==i&&function(e,t){if(!function(e){if("object"!=typeof e||null===e)return!1;try{return"boolean"==typeof e.aborted}catch(e){return!1}}(e))throw new TypeError(`${t} is not an AbortSignal.`)}(i,`${t} has member 'signal' that`),{preventAbort:Boolean(r),preventCancel:Boolean(o),preventClose:Boolean(n),signal:i}}Object.defineProperties(Jr.prototype,{close:{enumerable:!0},enqueue:{enumerable:!0},error:{enumerable:!0},desiredSize:{enumerable:!0}}),U(Jr.prototype.close,"close"),U(Jr.prototype.enqueue,"enqueue"),U(Jr.prototype.error,"error"),"symbol"==typeof Symbol.toStringTag&&Object.defineProperty(Jr.prototype,Symbol.toStringTag,{value:"ReadableStreamDefaultController",configurable:!0});class yo{constructor(e={},t={}){void 0===e?e=null:Pe(e,"First parameter");const r=Xt(t,"Second parameter"),o=function(e,t){Se(e,t);const r=e,o=null==r?void 0:r.autoAllocateChunkSize,n=null==r?void 0:r.cancel,i=null==r?void 0:r.pull,a=null==r?void 0:r.start,s=null==r?void 0:r.type;return{autoAllocateChunkSize:void 0===o?void 0:Ce(o,`${t} has member 'autoAllocateChunkSize' that`),cancel:void 0===n?void 0:co(n,r,`${t} has member 'cancel' that`),pull:void 0===i?void 0:fo(i,r,`${t} has member 'pull' that`),start:void 0===a?void 0:po(a,r,`${t} has member 'start' that`),type:void 0===s?void 0:ho(s,`${t} has member 'type' that`)}}(e,"First parameter");if(_o(this),"bytes"===o.type){if(void 0!==r.size)throw new RangeError("The strategy for a byte stream cannot have a size function");!function(e,t,r){const o=Object.create(dt.prototype);let n,i,a;n=void 0!==t.start?()=>t.start(o):()=>{},i=void 0!==t.pull?()=>t.pull(o):()=>K(void 0),a=void 0!==t.cancel?e=>t.cancel(e):()=>K(void 0);const s=t.autoAllocateChunkSize;if(0===s)throw new TypeError("autoAllocateChunkSize must be greater than 0");Wt(e,o,n,i,a,r,s)}(this,o,Qt(r,0))}else{const e=Jt(r);!function(e,t,r,o){const n=Object.create(Jr.prototype);let i,a,s;i=void 0!==t.start?()=>t.start(n):()=>{},a=void 0!==t.pull?()=>t.pull(n):()=>K(void 0),s=void 0!==t.cancel?e=>t.cancel(e):()=>K(void 0),so(e,n,i,a,s,r,o)}(this,o,Qt(r,1),e)}}get locked(){if(!go(this))throw Eo("locked");return wo(this)}cancel(e=void 0){return go(this)?wo(this)?Q(new TypeError("Cannot cancel a stream that already has a reader")):So(this,e):Q(Eo("cancel"))}getReader(e=void 0){if(!go(this))throw Eo("getReader");return void 0===function(e,t){Se(e,t);const r=null==e?void 0:e.mode;return{mode:void 0===r?void 0:Ft(r,`${t} has member 'mode' that`)}}(e,"First parameter").mode?je(this):Bt(this)}pipeThrough(e,t={}){if(!go(this))throw Eo("pipeThrough");Ee(e,1,"pipeThrough");const r=function(e,t){Se(e,t);const r=null==e?void 0:e.readable;Te(r,"readable","ReadableWritablePair"),Ie(r,`${t} has member 'readable' that`);const o=null==e?void 0:e.writable;return Te(o,"writable","ReadableWritablePair"),nr(o,`${t} has member 'writable' that`),{readable:r,writable:o}}(e,"First parameter"),o=bo(t,"Second parameter");if(wo(this))throw new TypeError("ReadableStream.prototype.pipeThrough cannot be used on a locked ReadableStream");if(cr(r.writable))throw new TypeError("ReadableStream.prototype.pipeThrough cannot be used on a locked WritableStream");return re(Qr(this,r.writable,o.preventClose,o.preventAbort,o.preventCancel,o.signal)),r.readable}pipeTo(e,t={}){if(!go(this))return Q(Eo("pipeTo"));if(void 0===e)return Q("Parameter 1 is required in 'pipeTo'.");if(!lr(e))return Q(new TypeError("ReadableStream.prototype.pipeTo's first argument must be a WritableStream"));let r;try{r=bo(t,"Second parameter")}catch(e){return Q(e)}return wo(this)?Q(new TypeError("ReadableStream.prototype.pipeTo cannot be used on a locked ReadableStream")):cr(e)?Q(new TypeError("ReadableStream.prototype.pipeTo cannot be used on a locked WritableStream")):Qr(this,e,r.preventClose,r.preventAbort,r.preventCancel,r.signal)}tee(){if(!go(this))throw Eo("tee");return $e(function(e){return ft(e._readableStreamController)?function(e){let t,r,o,n,i,a=je(e),s=!1,u=!1,l=!1,c=!1,d=!1;const f=Y((e=>{i=e}));function p(e){ee(e._closedPromise,(t=>(e!==a||(jt(o._readableStreamController,t),jt(n._readableStreamController,t),c&&d||i(void 0)),null)))}function h(){Ht(a)&&(he(a),a=je(e),p(a)),Me(a,{_chunkSteps:t=>{oe((()=>{u=!1,l=!1;const r=t;let a=t;if(!c&&!d)try{a=it(t)}catch(t){return jt(o._readableStreamController,t),jt(n._readableStreamController,t),void i(So(e,t))}c||It(o._readableStreamController,r),d||It(n._readableStreamController,a),s=!1,u?y():l&&m()}))},_closeSteps:()=>{s=!1,c||Ct(o._readableStreamController),d||Ct(n._readableStreamController),o._readableStreamController._pendingPullIntos.length>0&&Lt(o._readableStreamController,0),n._readableStreamController._pendingPullIntos.length>0&&Lt(n._readableStreamController,0),c&&d||i(void 0)},_errorSteps:()=>{s=!1}})}function b(t,r){We(a)&&(he(a),a=Bt(e),p(a));const f=r?n:o,h=r?o:n;Gt(a,t,1,{_chunkSteps:t=>{oe((()=>{u=!1,l=!1;const o=r?d:c;if(r?c:d)o||Nt(f._readableStreamController,t);else{let r;try{r=it(t)}catch(t){return jt(f._readableStreamController,t),jt(h._readableStreamController,t),void i(So(e,t))}o||Nt(f._readableStreamController,t),It(h._readableStreamController,r)}s=!1,u?y():l&&m()}))},_closeSteps:e=>{s=!1;const t=r?d:c,o=r?c:d;t||Ct(f._readableStreamController),o||Ct(h._readableStreamController),void 0!==e&&(t||Nt(f._readableStreamController,e),!o&&h._readableStreamController._pendingPullIntos.length>0&&Lt(h._readableStreamController,0)),t&&o||i(void 0)},_errorSteps:()=>{s=!1}})}function y(){if(s)return u=!0,K(void 0);s=!0;const e=qt(o._readableStreamController);return null===e?h():b(e._view,!1),K(void 0)}function m(){if(s)return l=!0,K(void 0);s=!0;const e=qt(n._readableStreamController);return null===e?h():b(e._view,!0),K(void 0)}function v(){}return o=vo(v,y,(function(o){if(c=!0,t=o,d){const o=$e([t,r]),n=So(e,o);i(n)}return f})),n=vo(v,m,(function(o){if(d=!0,r=o,c){const o=$e([t,r]),n=So(e,o);i(n)}return f})),p(a),[o,n]}(e):function(e){const t=je(e);let r,o,n,i,a,s=!1,u=!1,l=!1,c=!1;const d=Y((e=>{a=e}));function f(){return s?(u=!0,K(void 0)):(s=!0,Me(t,{_chunkSteps:e=>{oe((()=>{u=!1;const t=e,r=e;l||oo(n._readableStreamController,t),c||oo(i._readableStreamController,r),s=!1,u&&f()}))},_closeSteps:()=>{s=!1,l||ro(n._readableStreamController),c||ro(i._readableStreamController),l&&c||a(void 0)},_errorSteps:()=>{s=!1}}),K(void 0))}function p(){}return n=mo(p,f,(function(t){if(l=!0,r=t,c){const t=$e([r,o]),n=So(e,t);a(n)}return d})),i=mo(p,f,(function(t){if(c=!0,o=t,l){const t=$e([r,o]),n=So(e,t);a(n)}return d})),ee(t._closedPromise,(e=>(no(n._readableStreamController,e),no(i._readableStreamController,e),l&&c||a(void 0),null))),[n,i]}(e)}(this))}values(e=void 0){if(!go(this))throw Eo("values");return function(e,t){const r=je(e),o=new et(r,t),n=Object.create(tt);return n._asyncIteratorImpl=o,n}(this,function(e){Se(e,"First parameter");const t=null==e?void 0:e.preventCancel;return{preventCancel:Boolean(t)}}(e).preventCancel)}[Je](e){return this.values(e)}static from(e){return lo(e)}}function mo(e,t,r,o=1,n=()=>1){const i=Object.create(yo.prototype);return _o(i),so(i,Object.create(Jr.prototype),e,t,r,o,n),i}function vo(e,t,r){const o=Object.create(yo.prototype);return _o(o),Wt(o,Object.create(dt.prototype),e,t,r,0,void 0),o}function _o(e){e._state="readable",e._reader=void 0,e._storedError=void 0,e._disturbed=!1}function go(e){return!!F(e)&&!!Object.prototype.hasOwnProperty.call(e,"_readableStreamController")&&e instanceof yo}function wo(e){return void 0!==e._reader}function So(e,t){if(e._disturbed=!0,"closed"===e._state)return K(void 0);if("errored"===e._state)return Q(e._storedError);Oo(e);const r=e._reader;if(void 0!==r&&Ht(r)){const e=r._readIntoRequests;r._readIntoRequests=new ae,e.forEach((e=>{e._closeSteps(void 0)}))}return te(e._readableStreamController[le](t),D)}function Oo(e){e._state="closed";const t=e._reader;if(void 0!==t&&(_e(t),We(t))){const e=t._readRequests;t._readRequests=new ae,e.forEach((e=>{e._closeSteps()}))}}function Po(e,t){e._state="errored",e._storedError=t;const r=e._reader;void 0!==r&&(ve(r,t),We(r)?De(r,t):Yt(r,t))}function Eo(e){return new TypeError(`ReadableStream.prototype.${e} can only be used on a ReadableStream`)}function To(e,t){Se(e,t);const r=null==e?void 0:e.highWaterMark;return Te(r,"highWaterMark","QueuingStrategyInit"),{highWaterMark:Re(r)}}Object.defineProperties(yo,{from:{enumerable:!0}}),Object.defineProperties(yo.prototype,{cancel:{enumerable:!0},getReader:{enumerable:!0},pipeThrough:{enumerable:!0},pipeTo:{enumerable:!0},tee:{enumerable:!0},values:{enumerable:!0},locked:{enumerable:!0}}),U(yo.from,"from"),U(yo.prototype.cancel,"cancel"),U(yo.prototype.getReader,"getReader"),U(yo.prototype.pipeThrough,"pipeThrough"),U(yo.prototype.pipeTo,"pipeTo"),U(yo.prototype.tee,"tee"),U(yo.prototype.values,"values"),"symbol"==typeof Symbol.toStringTag&&Object.defineProperty(yo.prototype,Symbol.toStringTag,{value:"ReadableStream",configurable:!0}),Object.defineProperty(yo.prototype,Je,{value:yo.prototype.values,writable:!0,configurable:!0});const Ro=e=>e.byteLength;U(Ro,"size");class Ao{constructor(e){Ee(e,1,"ByteLengthQueuingStrategy"),e=To(e,"First parameter"),this._byteLengthQueuingStrategyHighWaterMark=e.highWaterMark}get highWaterMark(){if(!Io(this))throw Co("highWaterMark");return this._byteLengthQueuingStrategyHighWaterMark}get size(){if(!Io(this))throw Co("size");return Ro}}function Co(e){return new TypeError(`ByteLengthQueuingStrategy.prototype.${e} can only be used on a ByteLengthQueuingStrategy`)}function Io(e){return!!F(e)&&!!Object.prototype.hasOwnProperty.call(e,"_byteLengthQueuingStrategyHighWaterMark")&&e instanceof Ao}Object.defineProperties(Ao.prototype,{highWaterMark:{enumerable:!0},size:{enumerable:!0}}),"symbol"==typeof Symbol.toStringTag&&Object.defineProperty(Ao.prototype,Symbol.toStringTag,{value:"ByteLengthQueuingStrategy",configurable:!0});const jo=()=>1;U(jo,"size");class ko{constructor(e){Ee(e,1,"CountQueuingStrategy"),e=To(e,"First parameter"),this._countQueuingStrategyHighWaterMark=e.highWaterMark}get highWaterMark(){if(!xo(this))throw qo("highWaterMark");return this._countQueuingStrategyHighWaterMark}get size(){if(!xo(this))throw qo("size");return jo}}function qo(e){return new TypeError(`CountQueuingStrategy.prototype.${e} can only be used on a CountQueuingStrategy`)}function xo(e){return!!F(e)&&!!Object.prototype.hasOwnProperty.call(e,"_countQueuingStrategyHighWaterMark")&&e instanceof ko}function Lo(e,t,r){return Oe(e,r),r=>ie(e,t,[r])}function No(e,t,r){return Oe(e,r),r=>ne(e,t,[r])}function Wo(e,t,r){return Oe(e,r),(r,o)=>ie(e,t,[r,o])}function Mo(e,t,r){return Oe(e,r),r=>ie(e,t,[r])}Object.defineProperties(ko.prototype,{highWaterMark:{enumerable:!0},size:{enumerable:!0}}),"symbol"==typeof Symbol.toStringTag&&Object.defineProperty(ko.prototype,Symbol.toStringTag,{value:"CountQueuingStrategy",configurable:!0});class Do{constructor(e={},t={},r={}){void 0===e&&(e=null);const o=Xt(t,"Second parameter"),n=Xt(r,"Third parameter"),i=function(e,t){Se(e,t);const r=null==e?void 0:e.cancel,o=null==e?void 0:e.flush,n=null==e?void 0:e.readableType,i=null==e?void 0:e.start,a=null==e?void 0:e.transform,s=null==e?void 0:e.writableType;return{cancel:void 0===r?void 0:Mo(r,e,`${t} has member 'cancel' that`),flush:void 0===o?void 0:Lo(o,e,`${t} has member 'flush' that`),readableType:n,start:void 0===i?void 0:No(i,e,`${t} has member 'start' that`),transform:void 0===a?void 0:Wo(a,e,`${t} has member 'transform' that`),writableType:s}}(e,"First parameter");if(void 0!==i.readableType)throw new RangeError("Invalid readableType specified");if(void 0!==i.writableType)throw new RangeError("Invalid writableType specified");const a=Qt(n,0),s=Jt(n),u=Qt(o,1),l=Jt(o);let c;!function(e,t,r,o,n,i){function a(){return t}e._writable=function(e,t,r,o,n=1,i=()=>1){const a=Object.create(ar.prototype);return ur(a),Ar(a,Object.create(Tr.prototype),e,t,r,o,n,i),a}(a,(function(t){return function(e,t){const r=e._transformStreamController;return e._backpressure?te(e._backpressureChangePromise,(()=>{const o=e._writable;if("erroring"===o._state)throw o._storedError;return Ko(r,t)})):Ko(r,t)}(e,t)}),(function(){return function(e){const t=e._transformStreamController;if(void 0!==t._finishPromise)return t._finishPromise;const r=e._readable;t._finishPromise=Y(((e,r)=>{t._finishPromise_resolve=e,t._finishPromise_reject=r}));const o=t._flushAlgorithm();return Go(t),X(o,(()=>("errored"===r._state?Xo(t,r._storedError):(ro(r._readableStreamController),Jo(t)),null)),(e=>(no(r._readableStreamController,e),Xo(t,e),null))),t._finishPromise}(e)}),(function(t){return function(e,t){const r=e._transformStreamController;if(void 0!==r._finishPromise)return r._finishPromise;const o=e._readable;r._finishPromise=Y(((e,t)=>{r._finishPromise_resolve=e,r._finishPromise_reject=t}));const n=r._cancelAlgorithm(t);return Go(r),X(n,(()=>("errored"===o._state?Xo(r,o._storedError):(no(o._readableStreamController,t),Jo(r)),null)),(e=>(no(o._readableStreamController,e),Xo(r,e),null))),r._finishPromise}(e,t)}),r,o),e._readable=mo(a,(function(){return function(e){return $o(e,!1),e._backpressureChangePromise}(e)}),(function(t){return function(e,t){const r=e._transformStreamController;if(void 0!==r._finishPromise)return r._finishPromise;const o=e._writable;r._finishPromise=Y(((e,t)=>{r._finishPromise_resolve=e,r._finishPromise_reject=t}));const n=r._cancelAlgorithm(t);return Go(r),X(n,(()=>("errored"===o._state?Xo(r,o._storedError):(kr(o._writableStreamController,t),zo(e),Jo(r)),null)),(t=>(kr(o._writableStreamController,t),zo(e),Xo(r,t),null))),r._finishPromise}(e,t)}),n,i),e._backpressure=void 0,e._backpressureChangePromise=void 0,e._backpressureChangePromise_resolve=void 0,$o(e,!0),e._transformStreamController=void 0}(this,Y((e=>{c=e})),u,l,a,s),function(e,t){const r=Object.create(Vo.prototype);let o,n,i;o=void 0!==t.transform?e=>t.transform(e,r):e=>{try{return Yo(r,e),K(void 0)}catch(e){return Q(e)}},n=void 0!==t.flush?()=>t.flush(r):()=>K(void 0),i=void 0!==t.cancel?e=>t.cancel(e):()=>K(void 0),function(e,t,r,o,n){t._controlledTransformStream=e,e._transformStreamController=t,t._transformAlgorithm=r,t._flushAlgorithm=o,t._cancelAlgorithm=n,t._finishPromise=void 0,t._finishPromise_resolve=void 0,t._finishPromise_reject=void 0}(e,r,o,n,i)}(this,i),void 0!==i.start?c(i.start(this._transformStreamController)):c(void 0)}get readable(){if(!Fo(this))throw Zo("readable");return this._readable}get writable(){if(!Fo(this))throw Zo("writable");return this._writable}}function Fo(e){return!!F(e)&&!!Object.prototype.hasOwnProperty.call(e,"_transformStreamController")&&e instanceof Do}function Bo(e,t){no(e._readable._readableStreamController,t),Uo(e,t)}function Uo(e,t){Go(e._transformStreamController),kr(e._writable._writableStreamController,t),zo(e)}function zo(e){e._backpressure&&$o(e,!1)}function $o(e,t){void 0!==e._backpressureChangePromise&&e._backpressureChangePromise_resolve(),e._backpressureChangePromise=Y((t=>{e._backpressureChangePromise_resolve=t})),e._backpressure=t}Object.defineProperties(Do.prototype,{readable:{enumerable:!0},writable:{enumerable:!0}}),"symbol"==typeof Symbol.toStringTag&&Object.defineProperty(Do.prototype,Symbol.toStringTag,{value:"TransformStream",configurable:!0});class Vo{constructor(){throw new TypeError("Illegal constructor")}get desiredSize(){if(!Ho(this))throw Qo("desiredSize");return io(this._controlledTransformStream._readable._readableStreamController)}enqueue(e=void 0){if(!Ho(this))throw Qo("enqueue");Yo(this,e)}error(e=void 0){if(!Ho(this))throw Qo("error");var t;t=e,Bo(this._controlledTransformStream,t)}terminate(){if(!Ho(this))throw Qo("terminate");!function(e){const t=e._controlledTransformStream;ro(t._readable._readableStreamController),Uo(t,new TypeError("TransformStream terminated"))}(this)}}function Ho(e){return!!F(e)&&!!Object.prototype.hasOwnProperty.call(e,"_controlledTransformStream")&&e instanceof Vo}function Go(e){e._transformAlgorithm=void 0,e._flushAlgorithm=void 0,e._cancelAlgorithm=void 0}function Yo(e,t){const r=e._controlledTransformStream,o=r._readable._readableStreamController;if(!ao(o))throw new TypeError("Readable side is not in a state that permits enqueue");try{oo(o,t)}catch(e){throw Uo(r,e),r._readable._storedError}const n=function(e){return!eo(e)}(o);n!==r._backpressure&&$o(r,!0)}function Ko(e,t){return te(e._transformAlgorithm(t),void 0,(t=>{throw Bo(e._controlledTransformStream,t),t}))}function Qo(e){return new TypeError(`TransformStreamDefaultController.prototype.${e} can only be used on a TransformStreamDefaultController`)}function Jo(e){void 0!==e._finishPromise_resolve&&(e._finishPromise_resolve(),e._finishPromise_resolve=void 0,e._finishPromise_reject=void 0)}function Xo(e,t){void 0!==e._finishPromise_reject&&(re(e._finishPromise),e._finishPromise_reject(t),e._finishPromise_resolve=void 0,e._finishPromise_reject=void 0)}function Zo(e){return new TypeError(`TransformStream.prototype.${e} can only be used on a TransformStream`)}Object.defineProperties(Vo.prototype,{enqueue:{enumerable:!0},error:{enumerable:!0},terminate:{enumerable:!0},desiredSize:{enumerable:!0}}),U(Vo.prototype.enqueue,"enqueue"),U(Vo.prototype.error,"error"),U(Vo.prototype.terminate,"terminate"),"symbol"==typeof Symbol.toStringTag&&Object.defineProperty(Vo.prototype,Symbol.toStringTag,{value:"TransformStreamDefaultController",configurable:!0});var en,tn=(en=function(e,t){return en=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},en(e,t)},function(e,t){function r(){this.constructor=e}en(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),rn=function(){return rn=Object.assign||function(e){for(var t,r=1,o=arguments.length;r<o;r++)for(var n in t=arguments[r])Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e},rn.apply(this,arguments)},on="Error when aborting requestTask",nn=function(e){function t(t){void 0===t&&(t={});var r=e.call(this)||this,o=t.timeout,n=t.timeoutMsg,i=t.restrictedMethods;return r._timeout=o||0,r._timeoutMsg=n||"请求超时",r._restrictedMethods=i||["get","post","upload","download"],r}return tn(t,e),t.prototype.post=function(e){var t=this;return new Promise((function(r,o){var n=e.url,i=e.data,a=e.headers,s=wx.request({url:l("https:",n),data:i,timeout:t._timeout,method:"POST",header:a,success:function(e){e.statusCode>=200&&e.statusCode<300?r({statusCode:e.statusCode,status:e.statusCode,data:e.data}):o(e)},fail:function(e){o(e)},complete:function(e){if(e&&e.errMsg&&t._timeout&&-1!==t._restrictedMethods.indexOf("post")&&"request:fail timeout"===e.errMsg){console.warn(t._timeoutMsg);try{s.abort()}catch(e){}}}})}))},t.prototype.get=function(e){var t=this;return new Promise((function(r,o){var n=e.url,i=e.body,a=e.headers,s=l("https:",n),u=wx.request({url:s,data:i,timeout:t._timeout,method:"GET",header:a,success:function(e){e.statusCode>=200&&e.statusCode<300?r({statusCode:e.statusCode,status:e.statusCode,data:e.data}):o(e)},fail:function(e){o(e)},complete:function(e){if(e&&e.errMsg&&t._timeout&&-1!==t._restrictedMethods.indexOf("get")&&e.errMsg.includes("timeout")){console.warn(t._timeoutMsg);try{u.abort()}catch(e){console.warn(on,e)}}}})}))},t.prototype.upload=function(e){var t=this,r=this;return new Promise((function(o){return function(e,t,r,o){return new(r||(r=Promise))((function(n,i){function a(e){try{u(o.next(e))}catch(e){i(e)}}function s(e){try{u(o.throw(e))}catch(e){i(e)}}function u(e){var t;e.done?n(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}u((o=o.apply(e,t||[])).next())}))}(t,void 0,void 0,(function(){var t,n,i,a,s,u;return function(e,t){var r,o,n,i,a={label:0,sent:function(){if(1&n[0])throw n[1];return n[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,o&&(n=2&i[0]?o.return:i[0]?o.throw||((n=o.return)&&n.call(o),0):o.next)&&!(n=n.call(o,i[1])).done)return n;switch(o=0,n&&(i=[2&i[0],n.value]),i[0]){case 0:case 1:n=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,o=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((n=(n=a.trys).length>0&&n[n.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!n||i[1]>n[0]&&i[1]<n[3])){a.label=i[1];break}if(6===i[0]&&a.label<n[1]){a.label=n[1],n=i;break}if(n&&a.label<n[2]){a.label=n[2],a.ops.push(i);break}n[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],o=0}finally{r=n=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}}(this,(function(l){return t=e.url,n=e.file,i=e.data,a=e.headers,s=e.onUploadProgress,u=wx.uploadFile({url:t,filePath:n,name:"file",formData:rn({},i),header:a,timeout:this._timeout,success:function(e){var t={statusCode:e.statusCode,data:e.data||{}};200===e.statusCode&&i.success_action_status&&(t.statusCode=parseInt(i.success_action_status,10)),o(t)},fail:function(e){o(e)},complete:function(e){if(e&&e.errMsg&&r._timeout&&-1!==r._restrictedMethods.indexOf("upload")&&"request:fail timeout"===e.errMsg){console.warn(r._timeoutMsg);try{u.abort()}catch(e){}}}}),s&&u.onProgressUpdate((function(e){s(e)})),[2]}))}))}))},t.prototype.download=function(e){var t=this,r=this;return new Promise((function(o,n){var i=e.url,a=e.headers,s=wx.downloadFile({url:l("https:",i),header:a,timeout:t._timeout,success:function(e){200===e.statusCode&&e.tempFilePath?o({statusCode:200,tempFilePath:e.tempFilePath}):o(e)},fail:function(e){n(e)},complete:function(e){if(e&&e.errMsg&&r._timeout&&-1!==r._restrictedMethods.indexOf("download")&&"request:fail timeout"===e.errMsg){console.warn(r._timeoutMsg);try{s.abort()}catch(e){}}}})}))},t.prototype.fetch=function(e){var t=e.url,r=e.body,o=e.enableAbort,n=e.headers,i=e.method,a=e.stream,s=void 0!==a&&a,u=e.signal,c=e.timeout,d=this,f=null!=c?c:this._timeout,p=null,h=new yo({start:function(e){p=e},cancel:function(){p=null}});return new Promise((function(e,a){s&&e({data:h});var c=wx.request({url:l("https:",t),data:r,timeout:f,method:i.toUpperCase(),header:n,success:function(t){var r;null===(r=p)||void 0===r||r.close(),!s&&e(t)},fail:function(e){var t;if(null===(t=p)||void 0===t||t.close(),a(e),s)throw e},complete:function(e){if(e&&e.errMsg&&f&&-1!==d._restrictedMethods.indexOf("post")&&o&&"request:fail timeout"===e.errMsg){console.warn(d._timeoutMsg);try{c.abort()}catch(e){console.warn(on,e)}}},enableChunked:s});if(c.onChunkReceived((function(e){var t;null===(t=p)||void 0===t||t.enqueue(new Uint8Array(e.data))})),u){var b=function(){try{c.abort()}catch(e){console.warn(on,e)}};u.aborted?b():u.addEventListener("abort",(function(){return b()}))}}))},t}(u),an={setItem:function(e,t){wx.setStorageSync(e,t)},getItem:function(e){return wx.getStorageSync(e)},removeItem:function(e){wx.removeStorageSync(e)},clear:function(){wx.clearStorageSync()}},sn=function(e,t){void 0===t&&(t={});var r=wx.connectSocket(rn({url:e},t));return{set onopen(e){r.onOpen(e)},set onmessage(e){r.onMessage(e)},set onclose(e){r.onClose(e)},set onerror(e){r.onError(e)},send:function(e){return r.send({data:e})},close:function(e,t){return r.close({code:e,reason:t})},get readyState(){return r.readyState},CONNECTING:0,OPEN:1,CLOSING:2,CLOSED:3}};function un(e){var t={},r=e.replace(/^[?#]/,"");return r?(r.split("&").forEach((function(e){var r=e.split("="),o=r[0],n=r[1];o=decodeURIComponent(o),n=decodeURIComponent(n),o&&(t[o]?Array.isArray(t[o])?t[o].push(n):t[o]=[t[o],n]:t[o]=n)})),t):t}var ln={genAdapter:function(e){return{root:{globalThis:{}},reqClass:nn,wsClass:sn,captchaOptions:{openURIWithCallback:function(t){var r=e.EventBus,o={},n=t;console.log("openURIWithCallback",t);var i=t.match(/^(data:.*?)(\?[^#\s]*)?$/);if(i){n=i[1],console.log("openURIWithCallback url",n);var a=i[2];a&&(o=un(a))}console.log("openURIWithCallback queryObj",o);var s=o.token,u=function(e,t){var r={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(r[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var n=0;for(o=Object.getOwnPropertySymbols(e);n<o.length;n++)t.indexOf(o[n])<0&&Object.prototype.propertyIsEnumerable.call(e,o[n])&&(r[o[n]]=e[o[n]])}return r}(o,["token"]);return/^data:/.test(n)&&!s?Promise.reject({error:"invalid_argument",error_description:"invalie captcha data: "+t}):s?new Promise((function(e){console.log("wait for captcha..."),r.$emit("CAPTCHA_DATA_CHANGE",rn(rn({},u),{token:s,url:n})),r.$once("RESOLVE_CAPTCHA_DATA",(function(t){e(t)}))})):Promise.reject({error:"unimplemented",error_description:"need to impl captcha data"})}},localStorage:an,primaryStorage:i.local,getAppSign:function(){var e=wx.getAccountInfoSync();return"undefined"!=typeof App||"undefined"!=typeof getApp||wx.onAppHide||wx.offAppHide||wx.onAppShow||wx.offAppShow?e&&e.miniProgram?e.miniProgram.appId:"":e&&e.plugin?e.plugin.appId:""}}},isMatch:function(){if("undefined"==typeof wx)return!1;if("undefined"==typeof Page)return!1;if(!wx.getSystemInfoSync)return!1;if(!wx.getStorageSync)return!1;if(!wx.setStorageSync)return!1;if(!wx.connectSocket)return!1;if(!wx.request)return!1;try{if(!wx.getSystemInfoSync())return!1;if("qq"===wx.getSystemInfoSync().AppPlatform)return!1}catch(e){return!1}return!0},runtime:"wx_mp"},cn=function(){return cn=Object.assign||function(e){for(var t,r=1,o=arguments.length;r<o;r++)for(var n in t=arguments[r])Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e},cn.apply(this,arguments)},dn={},fn=function(){return fn=Object.assign||function(e){for(var t,r=1,o=arguments.length;r<o;r++)for(var n in t=arguments[r])Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e},fn.apply(this,arguments)},pn=E,hn={},bn={};function yn(e){var t=e.env,r=e.platformInfo,o={userInfoKey:"".concat("user_info","_").concat(t)};hn[t]=hn[t]||new pn(fn(fn({},e),{keys:o,platformInfo:r})),bn[t]=bn[t]||new pn(fn(fn({},e),{keys:o,platformInfo:r,persistence:"local"}))}function mn(e){return bn[e]}var vn=function(){return vn=Object.assign||function(e){for(var t,r=1,o=arguments.length;r<o;r++)for(var n in t=arguments[r])Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e},vn.apply(this,arguments)},_n=["ap-shanghai","ap-guangzhou","ap-shenzhen-fsi","ap-shanghai-fsi","ap-nanjing","ap-beijing","ap-chengdu","ap-chongqing","ap-hongkong"],gn="",wn="@cloudbase/js-sdk";function Sn(){return gn}var On,Pn=[],En=["env","endPointKey","region"],Tn="https:";function Rn(e){return Pn.find((function(t){return En.filter((function(t){return null!=e[t]})).every((function(r){return t[r]===e[r]}))}))}function An(e){var t,r;e.protocol&&!/:$/.test(e.protocol)&&(e.protocol="".concat(e.protocol,":"));var o,n=Rn(e);n?(null!=e.baseUrl&&(n.baseUrl=e.baseUrl),null!=e.protocol&&(n.protocol=e.protocol)):Pn.push(vn(vn({},e),{protocol:null!==(t=e.protocol)&&void 0!==t?t:Tn})),"CLOUD_API"===e.endPointKey&&(o=null!==(r=e.protocol)&&void 0!==r?r:Tn,a=o)}function Cn(e,t,r){return Rn({env:e,endPointKey:t,region:r})}function In(e,t){void 0===t&&(t="CLOUD_API");var r=Cn(e,t||"CLOUD_API"),o=r.protocol,n=r.baseUrl;return"".concat(o).concat(n).match(/(http(s)?:)?\/\/([^/?#]*)/)[0]}!function(e){e.NULL="NULL",e.ANONYMOUS="ANONYMOUS",e.WECHAT="WECHAT",e.WECHAT_PUBLIC="WECHAT-PUBLIC",e.WECHAT_OPEN="WECHAT-OPEN",e.CUSTOM="CUSTOM",e.EMAIL="EMAIL",e.USERNAME="USERNAME",e.PHONE="PHONE"}(On||(On={}));var jn=function(){return jn=Object.assign||function(e){for(var t,r=1,o=arguments.length;r<o;r++)for(var n in t=arguments[r])Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e},jn.apply(this,arguments)},kn=function(e,t,r,o){return new(r||(r=Promise))((function(n,i){function a(e){try{u(o.next(e))}catch(e){i(e)}}function s(e){try{u(o.throw(e))}catch(e){i(e)}}function u(e){var t;e.done?n(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}u((o=o.apply(e,t||[])).next())}))},qn=function(e,t){var r,o,n,i,a={label:0,sent:function(){if(1&n[0])throw n[1];return n[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(s){return function(u){return function(s){if(r)throw new TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(a=0)),a;)try{if(r=1,o&&(n=2&s[0]?o.return:s[0]?o.throw||((n=o.return)&&n.call(o),0):o.next)&&!(n=n.call(o,s[1])).done)return n;switch(o=0,n&&(s=[2&s[0],n.value]),s[0]){case 0:case 1:n=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,o=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((n=(n=a.trys).length>0&&n[n.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!n||s[1]>n[0]&&s[1]<n[3])){a.label=s[1];break}if(6===s[0]&&a.label<n[1]){a.label=n[1],n=s;break}if(n&&a.label<n[2]){a.label=n[2],a.ops.push(s);break}n[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],o=0}finally{r=n=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,u])}}},xn=s,Ln=c,Nn=d,Wn=["auth.getJwt","auth.logout","auth.signInWithTicket","auth.signInAnonymously","auth.signIn","auth.fetchAccessTokenWithRefreshToken","auth.signUpWithEmailAndPassword","auth.activateEndUserMail","auth.sendPasswordResetEmail","auth.resetPasswordWithToken","auth.isUsernameRegistered"];function Mn(e,t,r){var o=e[t];e[t]=function(t){var n={},i={};r.forEach((function(r){var o=r.call(e,t),a=o.data,s=o.headers;Object.assign(n,a),Object.assign(i,s)}));var a=t.data;return a&&(Ln(a)?Object.keys(n).forEach((function(e){a.append(e,n[e])})):t.data=jn(jn({},a),n)),t.headers=jn(jn({},t.headers||{}),i),o.call(e,t)}}function Dn(){var e=Math.random().toString(16).slice(2);return{data:{seqId:e},headers:{"X-SDK-Version":"@cloudbase/js-sdk/".concat(Sn()),"x-seqid":e}}}var Fn,Bn,Un=function(){function e(e){var t=this;this.throwWhenRequestFail=!1,this.config=e;var r={timeout:this.config.timeout,timeoutMsg:"[@cloudbase/js-sdk] 请求在".concat(this.config.timeout/1e3,"s内未完成,已中断"),restrictedMethods:["post","put"]};this.reqClass=new dn.adapter.reqClass(r),this.throwWhenRequestFail=e.throw||!1,this.localCache=mn(this.config.env),Mn(this.reqClass,"post",[Dn]),Mn(this.reqClass,"upload",[Dn]),Mn(this.reqClass,"download",[Dn]),I.on(j,(function(e){var r;t.config.i18n=(null===(r=e.data)||void 0===r?void 0:r.i18n)||t.config.i18n}))}return e.prototype.getDefaultHeaders=function(){var e,t,r;return(e={})[null===(t=this.config.i18n)||void 0===t?void 0:t.LANG_HEADER_KEY]=null===(r=this.config.i18n)||void 0===r?void 0:r.lang,e},e.prototype.post=function(e,t){return kn(this,void 0,void 0,(function(){return qn(this,(function(r){switch(r.label){case 0:return[4,this.reqClass.post(jn(jn({},e),{headers:jn(jn({},e.headers),this.getDefaultHeaders()),customReqOpts:t}))];case 1:return[2,r.sent()]}}))}))},e.prototype.upload=function(e){return kn(this,void 0,void 0,(function(){return qn(this,(function(t){switch(t.label){case 0:return[4,this.reqClass.upload(jn(jn({},e),{headers:jn(jn({},e.headers),this.getDefaultHeaders())}))];case 1:return[2,t.sent()]}}))}))},e.prototype.download=function(e){return kn(this,void 0,void 0,(function(){return qn(this,(function(t){switch(t.label){case 0:return[4,this.reqClass.download(jn(jn({},e),{headers:jn(jn({},e.headers),this.getDefaultHeaders())}))];case 1:return[2,t.sent()]}}))}))},e.prototype.getBaseEndPoint=function(e){return void 0===e&&(e="CLOUD_API"),In(this.config.env,e)},e.prototype.getOauthAccessTokenV2=function(e){return kn(this,void 0,void 0,(function(){var t,r;return qn(this,(function(o){switch(o.label){case 0:return[4,e.getAccessToken()];case 1:return t=o.sent(),[4,e.getCredentials()];case 2:return r=o.sent(),[2,{accessToken:t,accessTokenExpire:new Date(r.expires_at).getTime()}]}}))}))},e.prototype.request=function(e,t,r,o){var n,i;return kn(this,void 0,void 0,(function(){var a,s,u,l,c,d,f,p,h,b,y,m,v,_,g,w,S,O,P,E,T;return qn(this,(function(R){switch(R.label){case 0:if(a="x-tcb-trace_".concat(this.config.env),s="application/x-www-form-urlencoded",u=jn({action:e,dataVersion:"2020-01-10",env:this.config.env},t),-1!==Wn.indexOf(e))return[3,2];if(!(l=this.config._fromApp).oauthInstance)throw new Error("you can't request without auth");return c=l.oauthInstance,d=c.oauth2client,f=u,[4,this.getOauthAccessTokenV2(d)];case 1:f.access_token=R.sent().accessToken,R.label=2;case 2:return"storage.uploadFile"===e?(p=new FormData,Object.keys(p).forEach((function(e){Object.prototype.hasOwnProperty.call(p,e)&&void 0!==p[e]&&p.append(e,u[e])})),s="multipart/form-data"):(s="application/json;charset=UTF-8",p={},Object.keys(u).forEach((function(e){void 0!==u[e]&&(p[e]=u[e])}))),h={headers:jn({"content-type":s},this.getDefaultHeaders())},(null==r?void 0:r.onUploadProgress)&&(h.onUploadProgress=r.onUploadProgress),this.config.region&&(h.headers["X-TCB-Region"]=this.config.region),(b=this.localCache.getStore(a))&&(h.headers["X-TCB-Trace"]=b),y=void 0!==(null==r?void 0:r.parse)?r.parse:t.parse,m=void 0!==(null==r?void 0:r.inQuery)?r.inQuery:t.inQuery,v=void 0!==(null==r?void 0:r.search)?r.search:t.search,_=jn(jn({},(null==r?void 0:r.defaultQuery)||{}),{env:this.config.env}),y&&(_.parse=!0),m&&(_=jn(jn({},m),_)),g=this.config.endPointMode||"CLOUD_API",w=Cn(this.config.env,g),S=w.baseUrl,O=w.protocol,"functions.invokeFunction"!==e&&!/^(storage|database)\./.test(e)||"GATEWAY"!==g||(S="".concat(S.match(/\/\/([^/?#]*)/)[0],"/web")),P=r.pathname?Nn(O,"".concat(null===(n=In(this.config.env,g))||void 0===n?void 0:n.replace(/^https?:/,""),"/").concat(r.pathname),_):Nn(O,S,_),v&&(P+=v),[4,this.post(jn({url:P,data:p},h),o)];case 3:if(E=R.sent(),(T=null===(i=E.header)||void 0===i?void 0:i["x-tcb-trace"])&&this.localCache.setStore(a,T),200!==Number(E.status)&&200!==Number(E.statusCode)||!E.data)throw new Error("network request error");return[2,E]}}))}))},e.prototype.fetch=function(e){var t,r,o,n,i,a,s,u;return kn(this,void 0,void 0,(function(){var l,c,d,f,p,h,b,y=this;return qn(this,(function(m){switch(m.label){case 0:l=e.token,c=e.headers,d=void 0===c?{}:c,f=function(e,t){var r={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(r[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var n=0;for(o=Object.getOwnPropertySymbols(e);n<o.length;n++)t.indexOf(o[n])<0&&Object.prototype.propertyIsEnumerable.call(e,o[n])&&(r[o[n]]=e[o[n]])}return r}(e,["token","headers"]),p=function(){return kn(y,void 0,void 0,(function(){var e,t,r;return qn(this,(function(o){switch(o.label){case 0:if(null!=l)return[2,l];if(!(e=this.config._fromApp).oauthInstance)throw new Error("you can't request without auth");return t=e.oauthInstance,r=t.oauth2client,[4,this.getOauthAccessTokenV2(r)];case 1:return[2,o.sent().accessToken]}}))}))},h=function(){return kn(y,void 0,void 0,(function(){var e,t,r,o,n;return qn(this,(function(i){switch(i.label){case 0:return t=(e=this.reqClass).fetch,o={},n={"X-SDK-Version":"@cloudbase/js-sdk/".concat(Sn())},r="Bearer ".concat,[4,p()];case 1:return[2,t.apply(e,[jn.apply(void 0,[(o.headers=jn.apply(void 0,[jn.apply(void 0,[(n.Authorization=r.apply("Bearer ",[i.sent()]),n),this.getDefaultHeaders()]),d]),o),f])])]}}))}))},m.label=1;case 1:return m.trys.push([1,3,,6]),[4,h()];case 2:return[2,m.sent()];case 3:if("ACCESS_TOKEN_EXPIRED"!==(null==(b=m.sent())?void 0:b.code))return[3,5];if("function"!=typeof(null===(n=null===(o=null===(r=null===(t=this.config)||void 0===t?void 0:t._fromApp)||void 0===r?void 0:r.oauthInstance)||void 0===o?void 0:o.authApi)||void 0===n?void 0:n.refreshTokenForce))throw b;return[4,null===(u=null===(s=null===(a=null===(i=this.config)||void 0===i?void 0:i._fromApp)||void 0===a?void 0:a.oauthInstance)||void 0===s?void 0:s.authApi)||void 0===u?void 0:u.refreshTokenForce()];case 4:return m.sent(),[2,h()];case 5:throw b;case 6:return[2]}}))}))},e.prototype.send=function(e,t,r,o){return void 0===t&&(t={}),void 0===r&&(r={}),kn(this,void 0,void 0,(function(){var n;return qn(this,(function(i){switch(i.label){case 0:return[4,this.request(e,t,jn(jn({},r),{onUploadProgress:t.onUploadProgress}),o)];case 1:if((n=i.sent()).data.code&&this.throwWhenRequestFail)throw new Error(JSON.stringify({code:xn.OPERATION_FAIL,msg:"[".concat(n.data.code,"] ").concat(n.data.message)}));return[2,n.data]}}))}))},e.prototype.gateWay=function(e,t){return kn(this,void 0,void 0,(function(){var r,o,n,i,a,s,u,l,c,d,f,p,h,b,y,m;return qn(this,(function(v){switch(v.label){case 0:if(r=e.name,o=e.data,n=e.path,i=void 0===n?"":n,a=e.method,s=e.header,u=void 0===s?{}:s,!r||!i)throw new Error(JSON.stringify({code:xn.INVALID_PARAMS,msg:"[gateWay] invalid function name or path"}));try{l=o?JSON.stringify(o):""}catch(e){throw new Error(JSON.stringify({code:xn.INVALID_PARAMS,msg:"[gateWay] invalid data"}))}return c=function(){var e=(new Date).getTime(),t=(null===Date||void 0===Date?void 0:Date.now)&&1e3*Date.now()||0;return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(r){var o=16*Math.random();return e>0?(o=(e+o)%16|0,e=Math.floor(e/16)):(o=(t+o)%16|0,t=Math.floor(t/16)),("x"===r?o:7&o|8).toString(16)}))}(),d=Cn(this.config.env,"GATEWAY"),f=d.baseUrl,p=d.protocol,h="".concat(p).concat(f,"/").concat(i,"/").concat(r),[4,this.fetch({method:a||"POST",headers:jn({"Content-Type":"application/json; charset=utf-8","X-Request-Id":c},u),body:l,url:h,customReqOpts:t})];case 1:return b=v.sent(),y=[jn({requestId:c},b)],m={},[4,b.data];case 2:return[2,jn.apply(void 0,y.concat([(m.data=v.sent(),m)]))]}}))}))},e}(),zn={};!function(e){e.ZH="zh-CN",e.EN="en-US"}(Bn||(Bn={}));var $n=((Fn={})[Bn.EN]={"请检查调用方式,或前往云开发 AI+ 首页查看文档":"Please check the calling method or visit the AI+ homepage to view the documentation","AI+ 请求出错,错误码":"AI+ request error, error code","错误信息":"error message","未实现":"not implemented","小程序不支持 wasm 加载":"wasm loading is not supported in mini programs","小程序不支持动态 js 加载":"dynamic js loading is not supported in mini programs","请求超时":"request timeout","缺少 privatelink sdk 地址":"missing privatelink sdk address"},Fn),Vn=function(e,t){var r;return(null===(r=$n[t])||void 0===r?void 0:r[e])||e},Hn=function(e,t){var r,o,n=function(e){return"lang_".concat(e.clientId||e.env)}(t),i=(e.adapter||{}).localStorage,a=t.lang||(null===(r=null==i?void 0:i.getItem)||void 0===r?void 0:r.call(i,n))||Bn.ZH;return null===(o=null==i?void 0:i.setItem)||void 0===o||o.call(i,n,a),new Proxy({t:function(e){return Vn(e,a)},LANG_HEADER_KEY:"Accept-Language",lang:a},{get:function(e,t){var r;return"lang"===t&&(null===(r=null==i?void 0:i.getItem)||void 0===r?void 0:r.call(i,n))||e[t]},set:function(e,t,r){var o;return"lang"===t&&r!==e[t]&&(e[t]=r,e.t=function(e){return Vn(e,r)},null===(o=null==i?void 0:i.setItem)||void 0===o||o.call(i,n,r),I.fire(j,{i18n:e})),e[t]=r,!0}})},Gn=r(794),Yn=function(){return Yn=Object.assign||function(e){for(var t,r=1,o=arguments.length;r<o;r++)for(var n in t=arguments[r])Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e},Yn.apply(this,arguments)},Kn=function(e,t,r,o){return new(r||(r=Promise))((function(n,i){function a(e){try{u(o.next(e))}catch(e){i(e)}}function s(e){try{u(o.throw(e))}catch(e){i(e)}}function u(e){var t;e.done?n(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}u((o=o.apply(e,t||[])).next())}))},Qn=function(e,t){var r,o,n,i,a={label:0,sent:function(){if(1&n[0])throw n[1];return n[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(s){return function(u){return function(s){if(r)throw new TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(a=0)),a;)try{if(r=1,o&&(n=2&s[0]?o.return:s[0]?o.throw||((n=o.return)&&n.call(o),0):o.next)&&!(n=n.call(o,s[1])).done)return n;switch(o=0,n&&(s=[2&s[0],n.value]),s[0]){case 0:case 1:n=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,o=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((n=(n=a.trys).length>0&&n[n.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!n||s[1]>n[0]&&s[1]<n[3])){a.label=s[1];break}if(6===s[0]&&a.label<n[1]){a.label=n[1],n=s;break}if(n&&a.label<n[2]){a.label=n[2],a.ops.push(s);break}n[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],o=0}finally{r=n=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,u])}}};function Jn(e,t){var r,o,n;return Kn(this,void 0,void 0,(function(){var i,a,s,u,l,c,d,f,p,h,b,y,m,v,_;return Qn(this,(function(g){switch(g.label){case 0:if(a=(i=e||{}).name,s=i.body,u=i.path,l=void 0===u?"":u,c=i.method,d=void 0===c?"POST":c,f=i.headers,p=void 0===f?{}:f,h=i.token,!a)throw new Error(JSON.stringify({code:Gn.ERRORS.INVALID_PARAMS,msg:"[apis] invalid api name"}));return b=this.getEndPointWithKey("GATEWAY"),y=b.BASE_URL,m=b.PROTOCOL,v="".concat(m).concat(y,"/apis/").concat(a),_=l.startsWith("/")?l:"/".concat(l),[4,this.request.fetch(Yn({url:"".concat(v).concat(_),method:d||"POST",headers:Yn({"Content-Type":"application/json; charset=utf-8"},p),body:s,token:(null===(r=null==h?void 0:h.trim)||void 0===r?void 0:r.call(h))||(null===(n=null===(o=p.Authorization)||void 0===o?void 0:o.replace)||void 0===n?void 0:n.call(o,/^Bearer /,""))||null},t))];case 1:return[4,g.sent().data];case 2:return[2,g.sent()]}}))}))}var Xn=["GET","POST","PUT","DELETE","HEAD","OPTIONS","PATCH","REQUEST"];function Zn(e){var t=this;return new Proxy({},{get:function(r,o){if("string"!=typeof o)throw new Error("[apis] method must be string");var n=o.toLocaleUpperCase();if(!Xn.includes(n))throw new Error("[apis] invalid method: ".concat(o));return function(r,o){return Kn(t,void 0,void 0,(function(){return Qn(this,(function(t){switch(t.label){case 0:return[4,Jn.call(this,Yn({name:e,method:("REQUEST"===n?r.method:n)||"POST"},r),o)];case 1:return[2,t.sent()]}}))}))}}})}function ei(){var e=this;return new Proxy({},{get:function(t,r){if("string"==typeof r)return Zn.call(e,r)}})}var ti=function(){return ti=Object.assign||function(e){for(var t,r=1,o=arguments.length;r<o;r++)for(var n in t=arguments[r])Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e},ti.apply(this,arguments)},ri=function(e,t,r,o){var n,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},oi=function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},ni=s,ii="https://support.qq.com/products/148793",ai=f,si=function(e){return e.mode,e.customInfo,e.title,e.messages,function(e,t,r){}},ui={timeout:15e3,persistence:"local"},li=6e5,ci={},di=function(){function e(e){this.cloudbaseConfig=e||this.cloudbaseConfig,this.authInstance=null,this.oauthInstance=null,this.version=Sn()}return Object.defineProperty(e.prototype,"config",{get:function(){return this.cloudbaseConfig},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"platform",{get:function(){return dn},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"cache",{get:function(){return e=this.cloudbaseConfig.env,hn[e];var e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"localCache",{get:function(){return mn(this.cloudbaseConfig.env)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"request",{get:function(){return e=this.cloudbaseConfig.env,zn[e];var e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"apis",{get:function(){return ei.call(this)},enumerable:!1,configurable:!0}),e.prototype.init=function(t){var r;if(!t.env)throw new Error(JSON.stringify({code:ni.INVALID_PARAMS,msg:"env must not be specified"}));dn.adapter||this.useDefaultAdapter();var o={timeout:t.timeout||5e3,timeoutMsg:"[".concat(wn,"][REQUEST TIMEOUT] request had been abort since didn't finished within").concat(t.timeout/1e3,"s")};this.requestClient=new dn.adapter.reqClass(o),this.cloudbaseConfig=ti(ti(ti({},ui),t),{i18n:Hn(dn,t)}),delete this.cloudbaseConfig.lang,this.cloudbaseConfig.timeout=this.formatTimeout(this.cloudbaseConfig.timeout);var n=this.cloudbaseConfig,i=n.env,a=n.persistence,s=n.debug,u=n.timeout,l=n.oauthClient,c=n.i18n;yn({env:i,persistence:a,debug:s,platformInfo:this.platform}),function(e,t){An({env:e,region:t,baseUrl:"//".concat(e,".").concat(t||"ap-shanghai",".tcb-api.tencentcloudapi.com/web"),protocol:void 0,endPointKey:"CLOUD_API"})}(i,t.region||""),function(e,t,r){void 0===r&&(r="ap-shanghai"),r=r||"ap-shanghai";var o="//".concat(e,".api.tcloudbasegateway.com/v1");_n.includes(r)||(o="//".concat(e,".api.intl.tcloudbasegateway.com/v1")),An({endPointKey:"GATEWAY",env:e,baseUrl:o,protocol:t})}(i,Tn,t.region||"");var d=new e(this.cloudbaseConfig);return function(e){zn[e.env]=new Un(jn(jn({},e),{throw:!0}))}({env:i,region:t.region||"",timeout:u,oauthClient:l,_fromApp:d,i18n:c,endPointMode:t.endPointMode}),d.requestClient=this.requestClient,null===(r=null==this?void 0:this.fire)||void 0===r||r.call(this,"cloudbase_init",d),this.try2InitAuth(t,d),d},e.prototype.updateConfig=function(e){var t=e.persistence,r=e.debug;this.cloudbaseConfig.persistence=t,this.cloudbaseConfig.debug=r,yn({env:this.cloudbaseConfig.env,persistence:t,debug:r,platformInfo:this.platform})},e.prototype.updateLang=function(e){var t;e&&e!==(null===(t=this.cloudbaseConfig.i18n)||void 0===t?void 0:t.lang)&&(this.cloudbaseConfig.i18n.lang=e)},e.prototype.registerExtension=function(e){ci[e.name]=e},e.prototype.invokeExtension=function(e,t){return function(e,t,r,o){return new(r||(r=Promise))((function(n,i){function a(e){try{u(o.next(e))}catch(e){i(e)}}function s(e){try{u(o.throw(e))}catch(e){i(e)}}function u(e){var t;e.done?n(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}u((o=o.apply(e,t||[])).next())}))}(this,void 0,void 0,(function(){var r;return function(e,t){var r,o,n,i,a={label:0,sent:function(){if(1&n[0])throw n[1];return n[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(s){return function(u){return function(s){if(r)throw new TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(a=0)),a;)try{if(r=1,o&&(n=2&s[0]?o.return:s[0]?o.throw||((n=o.return)&&n.call(o),0):o.next)&&!(n=n.call(o,s[1])).done)return n;switch(o=0,n&&(s=[2&s[0],n.value]),s[0]){case 0:case 1:n=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,o=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((n=(n=a.trys).length>0&&n[n.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!n||s[1]>n[0]&&s[1]<n[3])){a.label=s[1];break}if(6===s[0]&&a.label<n[1]){a.label=n[1],n=s;break}if(n&&a.label<n[2]){a.label=n[2],a.ops.push(s);break}n[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],o=0}finally{r=n=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,u])}}}(this,(function(o){switch(o.label){case 0:if(!(r=ci[e]))throw new Error(JSON.stringify({code:ni.INVALID_PARAMS,msg:"extension:".concat(e," must be registered before invoke")}));return[4,r.invoke(t,this)];case 1:return[2,o.sent()]}}))}))},e.prototype.useAdapters=function(e,t){var r=function(e,t){for(var r,o=0,n=(r=e,"[object Array]"===Object.prototype.toString.call(r)?e:[e]);o<n.length;o++){var i=n[o],a=i.isMatch,s=i.genAdapter,u=i.runtime;if(a())return{adapter:g({isMatch:a},s(t)),runtime:u}}}(e,t)||{},o=r.adapter,n=r.runtime;o&&(dn.adapter=o),n&&(dn.runtime=n)},e.prototype.registerHook=function(t){!function(e,t){var r=t.entity,o=t.target;if(Object.prototype.hasOwnProperty.call(e,o))throw new Error(JSON.stringify({code:L.INVALID_OPERATION,msg:"target:".concat(o," is not exist")}));var n=e.prototype[o];if("function"!=typeof n)throw new Error(JSON.stringify({code:L.INVALID_OPERATION,msg:"target:".concat(o," is not a function which is the only type supports hook")}));e.prototype[o]=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return r.call.apply(r,x([this],e,!1)),n.call.apply(n,x([this],e,!1))}}(e,t)},e.prototype.registerComponent=function(t){W(e,t)},e.prototype.registerVersion=function(e){!function(e){gn=e}(e),this.version=e},e.prototype.registerSdkName=function(e){!function(e){wn=e,function(e){o=e}(e)}(e)},e.prototype.registerEndPoint=function(e,t){An({baseUrl:e,protocol:t,env:this.config.env,endPointKey:"CLOUD_API"})},e.prototype.registerEndPointWithKey=function(e){An({env:this.config.env,endPointKey:e.key,baseUrl:e.url,protocol:e.protocol})},e.prototype.getEndPointWithKey=function(e){var t=Cn(this.config.env,e);return{BASE_URL:t.baseUrl,PROTOCOL:t.protocol}},e.prototype.parseCaptcha=function(e){var t={},r=e.match(/^(data:.*?)(\?[^#\s]*)?$/);if(r){e=r[1];var o=r[2];o&&(t=function(e){e=e.replace(/^\?/,"");var t={};return e.split("&").forEach((function(e){var r=e.split("="),o=r[0],n=r[1];o=decodeURIComponent(o),n=decodeURIComponent(n),o&&(t[o]?Array.isArray(t[o])?t[o].push(n):t[o]=[t[o],n]:t[o]=n)})),t}(o))}var n=t.token,i=function(e,t){var r={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(r[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var n=0;for(o=Object.getOwnPropertySymbols(e);n<o.length;n++)t.indexOf(o[n])<0&&Object.prototype.propertyIsEnumerable.call(e,o[n])&&(r[o[n]]=e[o[n]])}return r}(t,["token"]);return/^data:/.test(e)&&!n?{error:"invalid_argument",error_description:"invalid captcha data: ".concat(e)}:n?{state:i.state,token:n,captchaData:e}:{error:"unimplemented",error_description:"need to impl captcha data"}},e.prototype.useDefaultAdapter=function(){var e={adapter:{type:"default",root:window,reqClass:_,wsClass:WebSocket,localStorage:localStorage},runtime:h.WEB},t=e.adapter,r=e.runtime;dn.adapter=t,dn.runtime=r},e.prototype.formatTimeout=function(e){switch(!0){case e>li:return ai(ni.INVALID_PARAMS,"timeout is greater than maximum value[10min]"),li;case e<100:return ai(ni.INVALID_PARAMS,"timeout is less than maximum value[100ms]"),100;default:return e}},e.prototype.try2InitAuth=function(e,t){try{e.accessKey&&t.auth()}catch(e){console.log("try2InitAuth error:",e)}},ri([si({mode:"sync",title:"Cloudbase 初始化失败",messages:["请确认以下各项:"," 1 - 调用 cloudbase.init() 的语法或参数是否正确"," 2 - 如果是非浏览器环境,是否配置了安全应用来源(https://docs.cloudbase.net/api-reference/webv3/adapter#%E7%AC%AC-2-%E6%AD%A5%E9%85%8D%E7%BD%AE%E5%AE%89%E5%85%A8%E5%BA%94%E7%94%A8%E6%9D%A5%E6%BA%90)","如果问题依然存在,建议到官方问答社区提问或寻找帮助:".concat(ii)]}),oi("design:type",Function),oi("design:paramtypes",[Object]),oi("design:returntype",e)],e.prototype,"init",null),ri([si({title:"调用扩展能力失败",messages:["请确认以下各项:"," 1 - 调用 invokeExtension() 的语法或参数是否正确"," 2 - 被调用的扩展能力是否已经安装并通过 registerExtension() 注册","如果问题依然存在,建议到官方问答社区提问或寻找帮助:".concat(ii)]}),oi("design:type",Function),oi("design:paramtypes",[String,Object]),oi("design:returntype",Promise)],e.prototype,"invokeExtension",null),e}(),fi=new di;fi.useAdapters((nn.prototype.upload=function(e){var t=this,r=this;return new Promise((function(o){var n=e.url,i=e.file,a=e.data,s=e.headers,u=wx.getFileSystemManager(),l=wx.request({url:n,method:e.method,header:cn({"content-type":" "},s),data:u.readFileSync(i),timeout:t._timeout,success:function(e){var t={statusCode:e.statusCode,data:e.data||{}};200===e.statusCode&&(null==a?void 0:a.success_action_status)&&(t.statusCode=parseInt(a.success_action_status,10)),o(t)},fail:function(e){o(e)},complete:function(e){if((null==e?void 0:e.errMsg)&&r._timeout&&-1!==r._restrictedMethods.indexOf("upload")&&"request:fail timeout"===e.errMsg){console.warn(r._timeoutMsg);try{l.abort()}catch(e){}}}})}))},ln.genAdapter=function(e){return{root:{globalThis:{}},reqClass:nn,wsClass:sn,captchaOptions:{openURIWithCallback:function(t){var r=e.EventBus,o={},n=t;console.log("openURIWithCallback",t);var i=t.match(/^(data:.*?)(\?[^#\s]*)?$/);if(i){n=i[1],console.log("openURIWithCallback url",n);var a=i[2];a&&(o=un(a))}console.log("openURIWithCallback queryObj",o);var s=o.token,u=function(e,t){var r={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(r[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var n=0;for(o=Object.getOwnPropertySymbols(e);n<o.length;n++)t.indexOf(o[n])<0&&Object.prototype.propertyIsEnumerable.call(e,o[n])&&(r[o[n]]=e[o[n]])}return r}(o,["token"]);return/^data:/.test(n)&&!s?Promise.reject({error:"invalid_argument",error_description:"invalie captcha data: ".concat(t)}):s?new Promise((function(e){console.log("wait for captcha..."),r.$emit("CAPTCHA_DATA_CHANGE",cn(cn({},u),{token:s,url:n})),r.$once("RESOLVE_CAPTCHA_DATA",(function(t){e(t)}))})):Promise.reject({error:"unimplemented",error_description:"need to impl captcha data"})}},localStorage:an,primaryStorage:i.local,getAppSign:function(){var e=wx.getAccountInfoSync();return"undefined"!=typeof App||"undefined"!=typeof getApp||wx.onAppHide||wx.offAppHide||wx.onAppShow||wx.offAppShow?e&&e.miniProgram?e.miniProgram.appId:"":e&&e.plugin?e.plugin.appId:""}}},ln));var pi=fi},946:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.COMMUNITY_SITE_URL=t.IS_DEBUG_MODE=t.getProtocol=t.setProtocol=t.getSdkName=t.setSdkName=void 0;var r="@cloudbase/js-sdk";t.setSdkName=function(e){r=e},t.getSdkName=function(){return r};var o="https:";t.setProtocol=function(e){o=e},t.getProtocol=function(){return o},t.IS_DEBUG_MODE=!1,t.COMMUNITY_SITE_URL="https://support.qq.com/products/148793"},205:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ERRORS=void 0,t.ERRORS={INVALID_PARAMS:"INVALID_PARAMS",INVALID_SYNTAX:"INVALID_SYNTAX",INVALID_OPERATION:"INVALID_OPERATION",OPERATION_FAIL:"OPERATION_FAIL",NETWORK_ERROR:"NETWORK_ERROR",UNKOWN_ERROR:"UNKOWN_ERROR"}},794:function(e,t,r){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,r,o){void 0===o&&(o=r);var n=Object.getOwnPropertyDescriptor(t,r);n&&!("get"in n?!t.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,o,n)}:function(e,t,r,o){void 0===o&&(o=r),e[o]=t[r]}),n=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||o(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),t.OATUH_LOGINTYPE=void 0,n(r(946),t),n(r(205),t),t.OATUH_LOGINTYPE="constants"},47:function(e){var t=function(e){"use strict";var t,r=Object.prototype,o=r.hasOwnProperty,n=Object.defineProperty||function(e,t,r){e[t]=r.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",s=i.asyncIterator||"@@asyncIterator",u=i.toStringTag||"@@toStringTag";function l(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{l({},"")}catch(e){l=function(e,t,r){return e[t]=r}}function c(e,t,r,o){var i=t&&t.prototype instanceof m?t:m,a=Object.create(i.prototype),s=new I(o||[]);return n(a,"_invoke",{value:T(e,r,s)}),a}function d(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}e.wrap=c;var f="suspendedStart",p="suspendedYield",h="executing",b="completed",y={};function m(){}function v(){}function _(){}var g={};l(g,a,(function(){return this}));var w=Object.getPrototypeOf,S=w&&w(w(j([])));S&&S!==r&&o.call(S,a)&&(g=S);var O=_.prototype=m.prototype=Object.create(g);function P(e){["next","throw","return"].forEach((function(t){l(e,t,(function(e){return this._invoke(t,e)}))}))}function E(e,t){function r(n,i,a,s){var u=d(e[n],e,i);if("throw"!==u.type){var l=u.arg,c=l.value;return c&&"object"==typeof c&&o.call(c,"__await")?t.resolve(c.__await).then((function(e){r("next",e,a,s)}),(function(e){r("throw",e,a,s)})):t.resolve(c).then((function(e){l.value=e,a(l)}),(function(e){return r("throw",e,a,s)}))}s(u.arg)}var i;n(this,"_invoke",{value:function(e,o){function n(){return new t((function(t,n){r(e,o,t,n)}))}return i=i?i.then(n,n):n()}})}function T(e,r,o){var n=f;return function(i,a){if(n===h)throw new Error("Generator is already running");if(n===b){if("throw"===i)throw a;return{value:t,done:!0}}for(o.method=i,o.arg=a;;){var s=o.delegate;if(s){var u=R(s,o);if(u){if(u===y)continue;return u}}if("next"===o.method)o.sent=o._sent=o.arg;else if("throw"===o.method){if(n===f)throw n=b,o.arg;o.dispatchException(o.arg)}else"return"===o.method&&o.abrupt("return",o.arg);n=h;var l=d(e,r,o);if("normal"===l.type){if(n=o.done?b:p,l.arg===y)continue;return{value:l.arg,done:o.done}}"throw"===l.type&&(n=b,o.method="throw",o.arg=l.arg)}}}function R(e,r){var o=r.method,n=e.iterator[o];if(n===t)return r.delegate=null,"throw"===o&&e.iterator.return&&(r.method="return",r.arg=t,R(e,r),"throw"===r.method)||"return"!==o&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+o+"' method")),y;var i=d(n,e.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,y;var a=i.arg;return a?a.done?(r[e.resultName]=a.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,y):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.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 C(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function I(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(A,this),this.reset(!0)}function j(e){if(null!=e){var r=e[a];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var n=-1,i=function r(){for(;++n<e.length;)if(o.call(e,n))return r.value=e[n],r.done=!1,r;return r.value=t,r.done=!0,r};return i.next=i}}throw new TypeError(typeof e+" is not iterable")}return v.prototype=_,n(O,"constructor",{value:_,configurable:!0}),n(_,"constructor",{value:v,configurable:!0}),v.displayName=l(_,u,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===v||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,_):(e.__proto__=_,l(e,u,"GeneratorFunction")),e.prototype=Object.create(O),e},e.awrap=function(e){return{__await:e}},P(E.prototype),l(E.prototype,s,(function(){return this})),e.AsyncIterator=E,e.async=function(t,r,o,n,i){void 0===i&&(i=Promise);var a=new E(c(t,r,o,n),i);return e.isGeneratorFunction(r)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},P(O),l(O,u,"Generator"),l(O,a,(function(){return this})),l(O,"toString",(function(){return"[object Generator]"})),e.keys=function(e){var t=Object(e),r=[];for(var o in t)r.push(o);return r.reverse(),function e(){for(;r.length;){var o=r.pop();if(o in t)return e.value=o,e.done=!1,e}return e.done=!0,e}},e.values=j,I.prototype={constructor:I,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(C),!e)for(var r in this)"t"===r.charAt(0)&&o.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var r=this;function n(o,n){return s.type="throw",s.arg=e,r.next=o,n&&(r.method="next",r.arg=t),!!n}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],s=a.completion;if("root"===a.tryLoc)return n("end");if(a.tryLoc<=this.prev){var u=o.call(a,"catchLoc"),l=o.call(a,"finallyLoc");if(u&&l){if(this.prev<a.catchLoc)return n(a.catchLoc,!0);if(this.prev<a.finallyLoc)return n(a.finallyLoc)}else if(u){if(this.prev<a.catchLoc)return n(a.catchLoc,!0)}else{if(!l)throw new Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return n(a.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var n=this.tryEntries[r];if(n.tryLoc<=this.prev&&o.call(n,"finallyLoc")&&this.prev<n.finallyLoc){var i=n;break}}i&&("break"===e||"continue"===e)&&i.tryLoc<=t&&t<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=e,a.arg=t,i?(this.method="next",this.next=i.finallyLoc,y):this.complete(a)},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 r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),C(r),y}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var o=r.completion;if("throw"===o.type){var n=o.arg;C(r)}return n}}throw new Error("illegal catch attempt")},delegateYield:function(e,r,o){return this.delegate={iterator:j(e),resultName:r,nextLoc:o},"next"===this.method&&(this.arg=t),y}},e}(e.exports);try{regeneratorRuntime=t}catch(e){"object"==typeof globalThis?globalThis.regeneratorRuntime=t:Function("r","regeneratorRuntime = r")(t)}},878:function(e){"use strict";e.exports=JSON.parse('{"version":"2.21.10"}')}},t={};function r(o){var n=t[o];if(void 0!==n)return n.exports;var i=t[o]={exports:{}};return e[o].call(i.exports,i,i.exports,r),i.exports}return r.d=function(e,t){for(var o in t)r.o(t,o)&&!r.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:t[o]})},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r(47),r(23)}()}));
|