"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1842],{48742:function(e,t,r){r.d(t,{Weu:function(){return V}}),r(57681);let a=[],s=[],n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(let e=0,t=n.length;e<t;++e)a[e]=n[e],s[n.charCodeAt(e)]=e;function i(e){let t;let r=e.length,s=r%3,n=[];for(let t=0,i=r-s;t<i;t+=16383)n.push(function(e,t,r){let s;let n=[];for(let i=t;i<r;i+=3)n.push(a[(s=(e[i]<<16&16711680)+(e[i+1]<<8&65280)+(255&e[i+2]))>>18&63]+a[s>>12&63]+a[s>>6&63]+a[63&s]);return n.join("")}(e,t,t+16383>i?i:t+16383));return 1===s?n.push(a[(t=e[r-1])>>2]+a[t<<4&63]+"=="):2===s&&n.push(a[(t=(e[r-2]<<8)+e[r-1])>>10]+a[t>>4&63]+a[t<<2&63]+"="),n.join("")}s["-".charCodeAt(0)]=62,s["_".charCodeAt(0)]=63;class o extends Uint8Array{constructor(e,t,r){if("number"==typeof e){if("string"==typeof t)throw TypeError("The first argument must be of type string, received type number");if(e<0)throw RangeError("The buffer size cannot be negative");super(e<0?0:0|o._checked(e))}else if("string"==typeof e){if("string"!=typeof t&&(t="utf8"),!o.isEncoding(t))throw TypeError("Unknown encoding: "+t);let r=0|o.byteLength(e,t);super(r);let a=this.write(e,0,this.length,t);if(a!==r)throw TypeError("Number of bytes written did not match expected length (wrote "+a+", expected "+r+")")}else if(ArrayBuffer.isView(e)){if(o._isInstance(e,Uint8Array)){let t=new Uint8Array(e),r=t.buffer,a=t.byteOffset,s=t.byteLength;if(a<0||r.byteLength<a)throw RangeError("offset is outside of buffer bounds");if(r.byteLength<a+(s||0))throw RangeError("length is outside of buffer bounds");super(new Uint8Array(r,a,s))}else{let t=e.length<0?0:0|o._checked(e.length);super(new Uint8Array(t));for(let r=0;r<t;r++)this[r]=255&e[r]}}else if(null==e)throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);else if(o._isInstance(e,ArrayBuffer)||e&&o._isInstance(e.buffer,ArrayBuffer)){let a=t;if(a<0||e.byteLength<a)throw RangeError("offset is outside of buffer bounds");if(e.byteLength<a+(r||0))throw RangeError("length is outside of buffer bounds");super(new Uint8Array(e,a,r))}else if(Array.isArray(e)){let t=e.length<0?0:0|o._checked(e.length);super(new Uint8Array(t));for(let r=0;r<t;r++)this[r]=255&e[r]}else throw TypeError("Unable to determine the correct way to allocate buffer for type "+typeof e)}toJSON(){return{type:"Buffer",data:Array.prototype.slice.call(this)}}write(e,t,r,a){if(void 0===t)a="utf8",r=this.length,t=0;else if(void 0===r&&"string"==typeof t)a=t,r=this.length,t=0;else if("number"==typeof t&&isFinite(t))t>>>=0,"number"==typeof r&&isFinite(r)?(r>>>=0,a??(a="utf8")):"string"==typeof r&&(a=r,r=void 0);else throw Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");let s=this.length-t;if((void 0===r||r>s)&&(r=s),e.length>0&&(r<0||t<0)||t>this.length)throw RangeError("Attempt to write outside buffer bounds");switch(a||(a="utf8"),o._getEncoding(a)){case"hex":return o._hexWrite(this,e,t,r);case"utf8":return o._utf8Write(this,e,t,r);case"ascii":case"latin1":case"binary":return o._asciiWrite(this,e,t,r);case"ucs2":case"utf16le":return o._ucs2Write(this,e,t,r);case"base64":return o._base64Write(this,e,t,r)}}toString(e,t,r){let a=this.length;if(0===a)return"";if(0==arguments.length)return o._utf8Slice(this,0,a);if((void 0===t||t<0)&&(t=0),t>this.length||((void 0===r||r>this.length)&&(r=this.length),r<=0)||(r>>>=0,t>>>=0,r<=t))return"";switch(e||(e="utf8"),o._getEncoding(e)){case"hex":return o._hexSlice(this,t,r);case"utf8":return o._utf8Slice(this,t,r);case"ascii":return o._asciiSlice(this,t,r);case"latin1":case"binary":return o._latin1Slice(this,t,r);case"ucs2":case"utf16le":return o._utf16leSlice(this,t,r);case"base64":return o._base64Slice(this,t,r)}}equals(e){if(!o.isBuffer(e))throw TypeError("Argument must be a Buffer");return this===e||0===o.compare(this,e)}compare(e,t,r,a,s){if(o._isInstance(e,Uint8Array)&&(e=o.from(e,e.byteOffset,e.byteLength)),!o.isBuffer(e))throw TypeError("Argument must be a Buffer or Uint8Array");if(t??(t=0),r??(r=e?e.length:0),a??(a=0),s??(s=this.length),t<0||r>e.length||a<0||s>this.length)throw RangeError("Out of range index");if(a>=s&&t>=r)return 0;if(a>=s)return -1;if(t>=r)return 1;if(t>>>=0,r>>>=0,a>>>=0,s>>>=0,this===e)return 0;let n=s-a,i=r-t,h=Math.min(n,i),l=this.slice(a,s),u=e.slice(t,r);for(let e=0;e<h;++e)if(l[e]!==u[e]){n=l[e],i=u[e];break}return n<i?-1:i<n?1:0}copy(e,t,r,a){if(!o.isBuffer(e))throw TypeError("argument should be a Buffer");if(r||(r=0),t||(t=0),a||0===a||(a=this.length),t>=e.length&&(t=e.length),t||(t=0),a>0&&a<r&&(a=r),a===r||0===e.length||0===this.length)return 0;if(t<0)throw RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw RangeError("Index out of range");if(a<0)throw RangeError("sourceEnd out of bounds");a>this.length&&(a=this.length),e.length-t<a-r&&(a=e.length-t+r);let s=a-r;return this===e&&"function"==typeof Uint8Array.prototype.copyWithin?this.copyWithin(t,r,a):Uint8Array.prototype.set.call(e,this.subarray(r,a),t),s}slice(e,t){e||(e=0);let r=this.length;e=~~e,t=void 0===t?r:~~t,e<0?(e+=r)<0&&(e=0):e>r&&(e=r),t<0?(t+=r)<0&&(t=0):t>r&&(t=r),t<e&&(t=e);let a=this.subarray(e,t);return Object.setPrototypeOf(a,o.prototype),a}writeUIntLE(e,t,r,a){if(e=+e,t>>>=0,r>>>=0,!a){let a=Math.pow(2,8*r)-1;o._checkInt(this,e,t,r,a,0)}let s=1,n=0;for(this[t]=255&e;++n<r&&(s*=256);)this[t+n]=e/s&255;return t+r}writeUIntBE(e,t,r,a){if(e=+e,t>>>=0,r>>>=0,!a){let a=Math.pow(2,8*r)-1;o._checkInt(this,e,t,r,a,0)}let s=r-1,n=1;for(this[t+s]=255&e;--s>=0&&(n*=256);)this[t+s]=e/n&255;return t+r}writeIntLE(e,t,r,a){if(e=+e,t>>>=0,!a){let a=Math.pow(2,8*r-1);o._checkInt(this,e,t,r,a-1,-a)}let s=0,n=1,i=0;for(this[t]=255&e;++s<r&&(n*=256);)e<0&&0===i&&0!==this[t+s-1]&&(i=1),this[t+s]=(e/n>>0)-i&255;return t+r}writeIntBE(e,t,r,a){if(e=+e,t>>>=0,!a){let a=Math.pow(2,8*r-1);o._checkInt(this,e,t,r,a-1,-a)}let s=r-1,n=1,i=0;for(this[t+s]=255&e;--s>=0&&(n*=256);)e<0&&0===i&&0!==this[t+s+1]&&(i=1),this[t+s]=(e/n>>0)-i&255;return t+r}readUIntLE(e,t,r){e>>>=0,t>>>=0,r||o._checkOffset(e,t,this.length);let a=this[e],s=1,n=0;for(;++n<t&&(s*=256);)a+=this[e+n]*s;return a}readUIntBE(e,t,r){e>>>=0,t>>>=0,r||o._checkOffset(e,t,this.length);let a=this[e+--t],s=1;for(;t>0&&(s*=256);)a+=this[e+--t]*s;return a}readIntLE(e,t,r){e>>>=0,t>>>=0,r||o._checkOffset(e,t,this.length);let a=this[e],s=1,n=0;for(;++n<t&&(s*=256);)a+=this[e+n]*s;return a>=(s*=128)&&(a-=Math.pow(2,8*t)),a}readIntBE(e,t,r){e>>>=0,t>>>=0,r||o._checkOffset(e,t,this.length);let a=t,s=1,n=this[e+--a];for(;a>0&&(s*=256);)n+=this[e+--a]*s;return n>=(s*=128)&&(n-=Math.pow(2,8*t)),n}readUInt8(e,t){return e>>>=0,t||o._checkOffset(e,1,this.length),this[e]}readUInt16LE(e,t){return e>>>=0,t||o._checkOffset(e,2,this.length),this[e]|this[e+1]<<8}readUInt16BE(e,t){return e>>>=0,t||o._checkOffset(e,2,this.length),this[e]<<8|this[e+1]}readUInt32LE(e,t){return e>>>=0,t||o._checkOffset(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]}readUInt32BE(e,t){return e>>>=0,t||o._checkOffset(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])}readInt8(e,t){return(e>>>=0,t||o._checkOffset(e,1,this.length),128&this[e])?-((255-this[e]+1)*1):this[e]}readInt16LE(e,t){e>>>=0,t||o._checkOffset(e,2,this.length);let r=this[e]|this[e+1]<<8;return 32768&r?4294901760|r:r}readInt16BE(e,t){e>>>=0,t||o._checkOffset(e,2,this.length);let r=this[e+1]|this[e]<<8;return 32768&r?4294901760|r:r}readInt32LE(e,t){return e>>>=0,t||o._checkOffset(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24}readInt32BE(e,t){return e>>>=0,t||o._checkOffset(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]}swap16(){let e=this.length;if(e%2!=0)throw RangeError("Buffer size must be a multiple of 16-bits");for(let t=0;t<e;t+=2)this._swap(this,t,t+1);return this}swap32(){let e=this.length;if(e%4!=0)throw RangeError("Buffer size must be a multiple of 32-bits");for(let t=0;t<e;t+=4)this._swap(this,t,t+3),this._swap(this,t+1,t+2);return this}swap64(){let e=this.length;if(e%8!=0)throw RangeError("Buffer size must be a multiple of 64-bits");for(let t=0;t<e;t+=8)this._swap(this,t,t+7),this._swap(this,t+1,t+6),this._swap(this,t+2,t+5),this._swap(this,t+3,t+4);return this}_swap(e,t,r){let a=e[t];e[t]=e[r],e[r]=a}writeUInt8(e,t,r){return e=+e,t>>>=0,r||o._checkInt(this,e,t,1,255,0),this[t]=255&e,t+1}writeUInt16LE(e,t,r){return e=+e,t>>>=0,r||o._checkInt(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2}writeUInt16BE(e,t,r){return e=+e,t>>>=0,r||o._checkInt(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2}writeUInt32LE(e,t,r){return e=+e,t>>>=0,r||o._checkInt(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4}writeUInt32BE(e,t,r){return e=+e,t>>>=0,r||o._checkInt(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4}writeInt8(e,t,r){return e=+e,t>>>=0,r||o._checkInt(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1}writeInt16LE(e,t,r){return e=+e,t>>>=0,r||o._checkInt(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2}writeInt16BE(e,t,r){return e=+e,t>>>=0,r||o._checkInt(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2}writeInt32LE(e,t,r){return e=+e,t>>>=0,r||o._checkInt(this,e,t,4,2147483647,-2147483648),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4}writeInt32BE(e,t,r){return e=+e,t>>>=0,r||o._checkInt(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4}fill(e,t,r,a){let s;if("string"==typeof e){if("string"==typeof t?(a=t,t=0,r=this.length):"string"==typeof r&&(a=r,r=this.length),void 0!==a&&"string"!=typeof a)throw TypeError("encoding must be a string");if("string"==typeof a&&!o.isEncoding(a))throw TypeError("Unknown encoding: "+a);if(1===e.length){let t=e.charCodeAt(0);"utf8"===a&&t<128&&(e=t)}}else"number"==typeof e?e&=255:"boolean"==typeof e&&(e=Number(e));if(t??(t=0),r??(r=this.length),t<0||this.length<t||this.length<r)throw RangeError("Out of range index");if(r<=t)return this;if(t>>>=0,r=void 0===r?this.length:r>>>0,e||(e=0),"number"==typeof e)for(s=t;s<r;++s)this[s]=e;else{let n=o.isBuffer(e)?e:o.from(e,a),i=n.length;if(0===i)throw TypeError('The value "'+e+'" is invalid for argument "value"');for(s=0;s<r-t;++s)this[s+t]=n[s%i]}return this}indexOf(e,t,r){return this._bidirectionalIndexOf(this,e,t,r,!0)}lastIndexOf(e,t,r){return this._bidirectionalIndexOf(this,e,t,r,!1)}_bidirectionalIndexOf(e,t,r,a,s){if(0===e.length)return -1;if("string"==typeof r?(a=r,r=0):void 0===r?r=0:r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),(r=+r)!=r&&(r=s?0:e.length-1),r<0&&(r=e.length+r),r>=e.length){if(s)return -1;r=e.length-1}else if(r<0){if(!s)return -1;r=0}if("string"==typeof t&&(t=o.from(t,a)),o.isBuffer(t))return 0===t.length?-1:o._arrayIndexOf(e,t,r,a,s);if("number"==typeof t)return(t&=255,"function"==typeof Uint8Array.prototype.indexOf)?s?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):o._arrayIndexOf(e,o.from([t]),r,a,s);throw TypeError("val must be string, number or Buffer")}includes(e,t,r){return -1!==this.indexOf(e,t,r)}static from(e,t,r){return new o(e,t,r)}static isBuffer(e){return null!=e&&e!==o.prototype&&o._isInstance(e,o)}static isEncoding(e){switch(e.toLowerCase()){case"hex":case"utf8":case"ascii":case"binary":case"latin1":case"ucs2":case"utf16le":case"base64":return!0;default:return!1}}static byteLength(e,t){if(o.isBuffer(e))return e.length;if("string"!=typeof e&&(ArrayBuffer.isView(e)||o._isInstance(e,ArrayBuffer)))return e.byteLength;if("string"!=typeof e)throw TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);let r=e.length,a=arguments.length>2&&!0===arguments[2];if(!a&&0===r)return 0;switch(t?.toLowerCase()){case"ascii":case"latin1":case"binary":return r;case"utf8":return o._utf8ToBytes(e).length;case"hex":return r>>>1;case"ucs2":case"utf16le":return 2*r;case"base64":return o._base64ToBytes(e).length;default:return a?-1:o._utf8ToBytes(e).length}}static concat(e,t){let r;if(!Array.isArray(e))throw TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return o.alloc(0);if(void 0===t)for(r=0,t=0;r<e.length;++r)t+=e[r].length;let a=o.allocUnsafe(t),s=0;for(r=0;r<e.length;++r){let t=e[r];if(o._isInstance(t,Uint8Array))s+t.length>a.length?(o.isBuffer(t)||(t=o.from(t)),t.copy(a,s)):Uint8Array.prototype.set.call(a,t,s);else if(o.isBuffer(t))t.copy(a,s);else throw TypeError('"list" argument must be an Array of Buffers');s+=t.length}return a}static compare(e,t){if(o._isInstance(e,Uint8Array)&&(e=o.from(e,e.byteOffset,e.byteLength)),o._isInstance(t,Uint8Array)&&(t=o.from(t,t.byteOffset,t.byteLength)),!o.isBuffer(e)||!o.isBuffer(t))throw TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(e===t)return 0;let r=e.length,a=t.length;for(let s=0,n=Math.min(r,a);s<n;++s)if(e[s]!==t[s]){r=e[s],a=t[s];break}return r<a?-1:a<r?1:0}static alloc(e,t,r){if("number"!=typeof e)throw TypeError('"size" argument must be of type number');if(e<0)throw RangeError('The value "'+e+'" is invalid for option "size"');return e<=0?new o(e):void 0!==t?"string"==typeof r?new o(e).fill(t,0,e,r):new o(e).fill(t):new o(e)}static allocUnsafe(e){if("number"!=typeof e)throw TypeError('"size" argument must be of type number');if(e<0)throw RangeError('The value "'+e+'" is invalid for option "size"');return new o(e<0?0:0|o._checked(e))}static _isInstance(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}static _checked(e){if(e>=2147483647)throw RangeError("Attempt to allocate Buffer larger than maximum size: 0x7fffffff bytes");return 0|e}static _blitBuffer(e,t,r,a){let s;for(s=0;s<a&&!(s+r>=t.length)&&!(s>=e.length);++s)t[s+r]=e[s];return s}static _utf8Write(e,t,r,a){return o._blitBuffer(o._utf8ToBytes(t,e.length-r),e,r,a)}static _asciiWrite(e,t,r,a){return o._blitBuffer(o._asciiToBytes(t),e,r,a)}static _base64Write(e,t,r,a){return o._blitBuffer(o._base64ToBytes(t),e,r,a)}static _ucs2Write(e,t,r,a){return o._blitBuffer(o._utf16leToBytes(t,e.length-r),e,r,a)}static _hexWrite(e,t,r,a){let s;r=Number(r)||0;let n=e.length-r;a?(a=Number(a))>n&&(a=n):a=n;let i=t.length;for(a>i/2&&(a=i/2),s=0;s<a;++s){let a=parseInt(t.substr(2*s,2),16);if(a!=a)break;e[r+s]=a}return s}static _utf8ToBytes(e,t){let r;t=t||1/0;let a=e.length,s=[],n=null;for(let i=0;i<a;++i){if((r=e.charCodeAt(i))>55295&&r<57344){if(!n){if(r>56319||i+1===a){(t-=3)>-1&&s.push(239,191,189);continue}n=r;continue}if(r<56320){(t-=3)>-1&&s.push(239,191,189),n=r;continue}r=(n-55296<<10|r-56320)+65536}else n&&(t-=3)>-1&&s.push(239,191,189);if(n=null,r<128){if((t-=1)<0)break;s.push(r)}else if(r<2048){if((t-=2)<0)break;s.push(r>>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;s.push(r>>12|224,r>>6&63|128,63&r|128)}else if(r<1114112){if((t-=4)<0)break;s.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}else throw Error("Invalid code point")}return s}static _base64ToBytes(e){return function(e){let t,r;let a=function(e){let t=e.length;if(t%4>0)throw Error("Invalid string. Length must be a multiple of 4");let r=e.indexOf("=");-1===r&&(r=t);let a=r===t?0:4-r%4;return[r,a]}(e),n=a[0],i=a[1],o=new Uint8Array((n+i)*3/4-i),h=0,l=i>0?n-4:n;for(r=0;r<l;r+=4)t=s[e.charCodeAt(r)]<<18|s[e.charCodeAt(r+1)]<<12|s[e.charCodeAt(r+2)]<<6|s[e.charCodeAt(r+3)],o[h++]=t>>16&255,o[h++]=t>>8&255,o[h++]=255&t;return 2===i&&(t=s[e.charCodeAt(r)]<<2|s[e.charCodeAt(r+1)]>>4,o[h++]=255&t),1===i&&(t=s[e.charCodeAt(r)]<<10|s[e.charCodeAt(r+1)]<<4|s[e.charCodeAt(r+2)]>>2,o[h++]=t>>8&255,o[h++]=255&t),o}(function(e){if((e=(e=e.split("=")[0]).trim().replace(l,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}static _asciiToBytes(e){let t=[];for(let r=0;r<e.length;++r)t.push(255&e.charCodeAt(r));return t}static _utf16leToBytes(e,t){let r,a;let s=[];for(let n=0;n<e.length&&!((t-=2)<0);++n)a=(r=e.charCodeAt(n))>>8,s.push(r%256),s.push(a);return s}static _hexSlice(e,t,r){let a=e.length;(!t||t<0)&&(t=0),(!r||r<0||r>a)&&(r=a);let s="";for(let a=t;a<r;++a)s+=h[e[a]];return s}static _base64Slice(e,t,r){return 0===t&&r===e.length?i(e):i(e.slice(t,r))}static _utf8Slice(e,t,r){r=Math.min(e.length,r);let a=[],s=t;for(;s<r;){let t=e[s],n=null,i=t>239?4:t>223?3:t>191?2:1;if(s+i<=r){let r,a,o,h;switch(i){case 1:t<128&&(n=t);break;case 2:(192&(r=e[s+1]))==128&&(h=(31&t)<<6|63&r)>127&&(n=h);break;case 3:r=e[s+1],a=e[s+2],(192&r)==128&&(192&a)==128&&(h=(15&t)<<12|(63&r)<<6|63&a)>2047&&(h<55296||h>57343)&&(n=h);break;case 4:r=e[s+1],a=e[s+2],o=e[s+3],(192&r)==128&&(192&a)==128&&(192&o)==128&&(h=(15&t)<<18|(63&r)<<12|(63&a)<<6|63&o)>65535&&h<1114112&&(n=h)}}null===n?(n=65533,i=1):n>65535&&(n-=65536,a.push(n>>>10&1023|55296),n=56320|1023&n),a.push(n),s+=i}return o._decodeCodePointsArray(a)}static _decodeCodePointsArray(e){let t=e.length;if(t<=4096)return String.fromCharCode.apply(String,e);let r="",a=0;for(;a<t;)r+=String.fromCharCode.apply(String,e.slice(a,a+=4096));return r}static _asciiSlice(e,t,r){let a="";r=Math.min(e.length,r);for(let s=t;s<r;++s)a+=String.fromCharCode(127&e[s]);return a}static _latin1Slice(e,t,r){let a="";r=Math.min(e.length,r);for(let s=t;s<r;++s)a+=String.fromCharCode(e[s]);return a}static _utf16leSlice(e,t,r){let a=e.slice(t,r),s="";for(let e=0;e<a.length-1;e+=2)s+=String.fromCharCode(a[e]+256*a[e+1]);return s}static _arrayIndexOf(e,t,r,a,s){let n,i=1,h=e.length,l=t.length;if(void 0!==a&&("ucs2"===(a=o._getEncoding(a))||"utf16le"===a)){if(e.length<2||t.length<2)return -1;i=2,h/=2,l/=2,r/=2}function u(e,t){return 1===i?e[t]:e.readUInt16BE(t*i)}if(s){let a=-1;for(n=r;n<h;n++)if(u(e,n)===u(t,-1===a?0:n-a)){if(-1===a&&(a=n),n-a+1===l)return a*i}else -1!==a&&(n-=n-a),a=-1}else for(r+l>h&&(r=h-l),n=r;n>=0;n--){let r=!0;for(let a=0;a<l;a++)if(u(e,n+a)!==u(t,a)){r=!1;break}if(r)return n}return -1}static _checkOffset(e,t,r){if(e%1!=0||e<0)throw RangeError("offset is not uint");if(e+t>r)throw RangeError("Trying to access beyond buffer length")}static _checkInt(e,t,r,a,s,n){if(!o.isBuffer(e))throw TypeError('"buffer" argument must be a Buffer instance');if(t>s||t<n)throw RangeError('"value" argument is out of bounds');if(r+a>e.length)throw RangeError("Index out of range")}static _getEncoding(e){let t=!1,r="";for(;;)switch(e){case"hex":return"hex";case"utf8":return"utf8";case"ascii":return"ascii";case"binary":return"binary";case"latin1":return"latin1";case"ucs2":return"ucs2";case"utf16le":return"utf16le";case"base64":return"base64";default:if(t)throw TypeError("Unknown or unsupported encoding: "+r);t=!0,r=e,e=e.toLowerCase()}}}let h=function(){let e="0123456789abcdef",t=Array(256);for(let r=0;r<16;++r){let a=16*r;for(let s=0;s<16;++s)t[a+s]=e[r]+e[s]}return t}(),l=/[^+/0-9A-Za-z-_]/g;function u(e){return null!=e}function c(e){return Object.fromEntries(Object.entries(e).filter(([,e])=>u(e)))}function d(e){try{return e instanceof Blob}catch(e){return!1}}function f(e){return!!e&&"object"==typeof e&&!Array.isArray(e)&&!(e instanceof Date)&&!d(e)}function m(e){return null!=e}function b(e){return m(e)&&"string"==typeof e}function p(e){return m(e)&&"number"==typeof e}async function g(e){return new Promise(t=>setTimeout(t,e))}var y,w,k,B,N,I,_,A,E,x,v,C,U=e=>{throw TypeError(e)},S=(e,t,r)=>t.has(e)||U("Cannot "+r),T=(e,t,r)=>(S(e,t,"read from private field"),r?r.call(e):t.get(e)),M=(e,t,r)=>t.has(e)?U("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,r),O=(e,t,r,a)=>(S(e,t,"write to private field"),t.set(e,r),r),W=(e,t,r)=>(S(e,t,"access private method"),r);class R{constructor(e=10){M(this,B),M(this,y),M(this,w),M(this,k),O(this,w,[]),O(this,k,e),this.running=0,this.started=0}setFetch(e){O(this,y,e)}getFetch(){if(!T(this,y))throw Error("Fetch not set");return T(this,y)}request(e,t){let r=new Date,a=this.getFetch(),s=async(n=!1)=>{let i;let{promise:o,cancel:h}={cancel:()=>clearTimeout(i),promise:new Promise(e=>{i=setTimeout(()=>{e()},3e5)})},l=await Promise.race([a(e,t),o.then(()=>null)]).finally(h);if(!l)throw Error("Request timed out");if(429===l.status){let e=function(e){if(p(e))return e;if(b(e)){let t=Number(e);if(!Number.isNaN(t))return t}}(l.headers?.get("x-ratelimit-reset"))??1;return await g(1e3*e),await s(!0)}if(n){let e=new Date().getTime()-r.getTime();console.warn(`A request to Xata hit branch rate limits, was retried and stalled for ${e}ms`)}return l};return W(this,B,N).call(this,async()=>await s())}}function L(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(e){let t=16*Math.random()|0;return("x"==e?t:3&t|8).toString(16)})}y=new WeakMap,w=new WeakMap,k=new WeakMap,B=new WeakSet,N=function(e){let t=new Promise(e=>T(this,w).push(e)).finally(()=>{this.started--,this.running++}).then(()=>e()).finally(()=>{this.running--;let e=T(this,w).shift();void 0!==e&&(this.started++,e())});if(this.running+this.started<T(this,k)){let e=T(this,w).shift();void 0!==e&&(this.started++,e())}return t};class j extends Error{constructor(e,t){super(e,t)}}class q extends j{constructor(e,t,r){super(D(t)),this.status=e,this.errors=$(t)?t.errors:[{message:D(t),status:e}],this.requestId=r,t instanceof Error&&(this.stack=t.stack,this.cause=t.cause)}toString(){let e=super.toString();return`[${this.status}] (${this.requestId??"Unknown"}): ${e}`}}function $(e){return f(e)&&Array.isArray(e.errors)}function D(e){return e instanceof Error?e.message:b(e)?e:f(e)&&b(e.message)?e.message:$(e)?"Bulk operation failed":"Unexpected error"}let P={production:{main:"https://api.xata.io",workspaces:"https://{workspaceId}.{region}.xata.sh"},staging:{main:"https://api.staging-xata.dev",workspaces:"https://{workspaceId}.{region}.staging-xata.dev"},dev:{main:"https://api.dev-xata.dev",workspaces:"https://{workspaceId}.{region}.dev-xata.dev"},local:{main:"http://localhost:6001",workspaces:"http://{workspaceId}.{region}.localhost:6001"}},z=new R,F=(e,t={},r={})=>{let a=new URLSearchParams(Object.entries(t).reduce((e,[t,r])=>null==r?e:{...e,[t]:r},{})).toString(),s=a.length>0?`?${a}`:"",n=Object.entries(r).reduce((e,[t,r])=>({...e,[t]:encodeURIComponent(String(r??"")).replace("%3A",":")}),{});return e.replace(/\{\w*\}/g,e=>n[e.slice(1,-1)])+s};async function J(e,t){if(!m(e))return;if(d(e)||"function"==typeof e.text)return e;let{"Content-Type":r}=t??{};return"application/json"===String(r).toLowerCase()&&f(e)?JSON.stringify(e):e}let X=L();async function G({url:e,method:t,body:r,headers:a,pathParams:s,queryParams:n,fetch:i,apiKey:o,endpoint:h,apiUrl:l,workspacesApiUrl:d,trace:f,signal:p,clientID:g,sessionID:y,clientName:w,xataAgentExtra:k,fetchOptions:B={},rawResponse:N=!1}){return z.setFetch(i),await f(`${t.toUpperCase()} ${e}`,async({setAttributes:i})=>{let f=F(function({method:e,endpoint:t,path:r,workspacesApiUrl:a,apiUrl:s,pathParams:n={}}){if("dataPlane"===t){let t=b(a)?`${a}${r}`:a(r,n);if("PUT"===e.toUpperCase()&&["/db/{dbBranchName}/tables/{tableName}/data/{recordId}/column/{columnName}/file","/db/{dbBranchName}/tables/{tableName}/data/{recordId}/column/{columnName}/file/{fileId}"].includes(r)){let{host:e}=function(e){if(!b(e))return null;let[t,r]=Object.entries({production:e.match(/(?:https:\/\/)?([^.]+)(?:\.([^.]+))\.xata\.sh\/db\/([^:]+):?(.*)?/),staging:e.match(/(?:https:\/\/)?([^.]+)(?:\.([^.]+))\.staging-xata\.dev\/db\/([^:]+):?(.*)?/),dev:e.match(/(?:https:\/\/)?([^.]+)(?:\.([^.]+))\.dev-xata\.dev\/db\/([^:]+):?(.*)?/),local:e.match(/(?:https?:\/\/)?([^.]+)(?:\.([^.]+))\.localhost:(?:\d+)\/db\/([^:]+):?(.*)?/)}).find(([,e])=>null!==e)??[];return b(t)&&Object.keys(P).includes(t)&&r?{workspace:r[1],region:r[2],database:r[3],branch:r[4],host:t}:null}(t)??{};switch(e){case"production":t=t.replace("xata.sh","upload.xata.sh");break;case"staging":t=t.replace("staging-xata.dev","upload.staging-xata.dev");break;case"dev":t=t.replace("dev-xata.dev","upload.dev-xata.dev")}}let s=b(n.workspace)?t.replace("{workspaceId}",String(n.workspace)):t;return b(n.region)?s.replace("{region}",String(n.region)):s}return`${s}${r}`}({method:t,endpoint:h,path:e,workspacesApiUrl:d,pathParams:s,apiUrl:l}),n,s),I=f.includes("localhost")?f.replace(/^[^.]+\.[^.]+\./,"http://"):f;i({"http.url":I,"http.target":F(e,n,s)});let _=[["client","TS_SDK"],["version","0.29.5"],m(w)?["service",w]:void 0,...Object.entries(k??{})].filter(u).map(([e,t])=>`${e}=${t}`).join("; "),A=c({"Accept-Encoding":"identity","Content-Type":"application/json","X-Xata-Client-ID":g??X,"X-Xata-Session-ID":y??L(),"X-Xata-Agent":_,...a,...function(e){let{groups:t}=/.*:\/\/(?<host>[^/]+).*/.exec(e)??{};return t?.host?{Host:t.host}:{}}(f),Authorization:`Bearer ${o}`}),E=await z.request(I,{...B,method:t.toUpperCase(),body:await J(r,A),headers:A,signal:p}),{host:x,protocol:v}=function(e){try{let{host:t,protocol:r}=new URL(e);return{host:t,protocol:r}}catch(e){return{}}}(E.url),C=E.headers?.get("x-request-id")??void 0;i({"xata.trace.kind":"http","http.request_id":C,"http.status_code":E.status,"http.host":x,"http.scheme":v?.replace(":",""),"cf.ray":E.headers?.get("cf-ray")??void 0});let U=E.headers?.get("x-xata-message");if(U&&console.warn(U),204===E.status)return{};if(429===E.status)throw new q(E.status,"Rate limit exceeded",C);try{let e=N?await E.blob():await E.json();if(E.ok)return e;throw new q(E.status,e,C)}catch(e){throw new q(E.status,e,C)}},{"http.method":t.toUpperCase(),"http.route":e})}let K=async e=>G({...e,endpoint:"dataPlane"}),H=(e,t)=>K({url:"/db/{dbBranchName}",method:"get",...e,signal:t}),Q=async e=>G({...e,endpoint:"controlPlane"});function V(e,...t){if(!m(e))return;let r=t.flatMap(e=>Object.entries(e).map(([e,t])=>{if("trim"===e){let{left:r=0,top:a=0,right:s=0,bottom:n=0}=t;return`${e}=${[a,s,n,r].join(";")}`}if("gravity"===e&&"object"==typeof t){let{x:r=.5,y:a=.5}=t;return`${e}=${[r,a].join("x")}`}return`${e}=${t}`})).join(","),{hostname:a,pathname:s,search:n}=new URL(e),i=s.split("/"),o=i.findIndex(e=>"transform"===e),h=o>=0?i.splice(o,2):[],l=`/transform/${[h[1],r].filter(m).join(",")}`,u=i.join("/");return`https://${a}${l}${u}${n}`}!function e(t,r){let a={...t};for(let[t,s]of Object.entries(r))f(s)&&f(a[t])?a[t]=e(a[t],s):a[t]=s;return a}({migrations:{applyMigration:(e,t)=>K({url:"/db/{dbBranchName}/migrations/apply",method:"post",...e,signal:t}),startMigration:(e,t)=>K({url:"/db/{dbBranchName}/migrations/start",method:"post",...e,signal:t}),completeMigration:(e,t)=>K({url:"/db/{dbBranchName}/migrations/complete",method:"post",...e,signal:t}),rollbackMigration:(e,t)=>K({url:"/db/{dbBranchName}/migrations/rollback",method:"post",...e,signal:t}),adaptTable:(e,t)=>K({url:"/db/{dbBranchName}/migrations/adapt/{tableName}",method:"post",...e,signal:t}),adaptAllTables:(e,t)=>K({url:"/db/{dbBranchName}/migrations/adapt",method:"post",...e,signal:t}),getBranchMigrationJobStatus:(e,t)=>K({url:"/db/{dbBranchName}/migrations/status",method:"get",...e,signal:t}),getMigrationJobStatus:(e,t)=>K({url:"/db/{dbBranchName}/migrations/jobs/{jobId}",method:"get",...e,signal:t}),getMigrationHistory:(e,t)=>K({url:"/db/{dbBranchName}/migrations/history",method:"get",...e,signal:t}),getSchema:(e,t)=>K({url:"/db/{dbBranchName}/schema",method:"get",...e,signal:t}),getBranchMigrationHistory:(e,t)=>K({url:"/db/{dbBranchName}/migrations",method:"get",...e,signal:t}),getBranchMigrationPlan:(e,t)=>K({url:"/db/{dbBranchName}/migrations/plan",method:"post",...e,signal:t}),executeBranchMigrationPlan:(e,t)=>K({url:"/db/{dbBranchName}/migrations/execute",method:"post",...e,signal:t}),getBranchSchemaHistory:(e,t)=>K({url:"/db/{dbBranchName}/schema/history",method:"post",...e,signal:t}),compareBranchWithUserSchema:(e,t)=>K({url:"/db/{dbBranchName}/schema/compare",method:"post",...e,signal:t}),compareBranchSchemas:(e,t)=>K({url:"/db/{dbBranchName}/schema/compare/{branchName}",method:"post",...e,signal:t}),updateBranchSchema:(e,t)=>K({url:"/db/{dbBranchName}/schema/update",method:"post",...e,signal:t}),previewBranchSchemaEdit:(e,t)=>K({url:"/db/{dbBranchName}/schema/preview",method:"post",...e,signal:t}),applyBranchSchemaEdit:(e,t)=>K({url:"/db/{dbBranchName}/schema/apply",method:"post",...e,signal:t}),pushBranchMigrations:(e,t)=>K({url:"/db/{dbBranchName}/schema/push",method:"post",...e,signal:t})},branch:{getBranchList:(e,t)=>K({url:"/dbs/{dbName}",method:"get",...e,signal:t}),getBranchDetails:H,createBranch:(e,t)=>K({url:"/db/{dbBranchName}",method:"put",...e,signal:t}),deleteBranch:(e,t)=>K({url:"/db/{dbBranchName}",method:"delete",...e,signal:t}),copyBranch:(e,t)=>K({url:"/db/{dbBranchName}/copy",method:"post",...e,signal:t}),updateBranchMetadata:(e,t)=>K({url:"/db/{dbBranchName}/metadata",method:"put",...e,signal:t}),getBranchMetadata:(e,t)=>K({url:"/db/{dbBranchName}/metadata",method:"get",...e,signal:t}),getBranchStats:(e,t)=>K({url:"/db/{dbBranchName}/stats",method:"get",...e,signal:t}),getGitBranchesMapping:(e,t)=>K({url:"/dbs/{dbName}/gitBranches",method:"get",...e,signal:t}),addGitBranchesEntry:(e,t)=>K({url:"/dbs/{dbName}/gitBranches",method:"post",...e,signal:t}),removeGitBranchesEntry:(e,t)=>K({url:"/dbs/{dbName}/gitBranches",method:"delete",...e,signal:t}),resolveBranch:(e,t)=>K({url:"/dbs/{dbName}/resolveBranch",method:"get",...e,signal:t})},database:{getDatabaseSettings:(e,t)=>K({url:"/dbs/{dbName}/settings",method:"get",...e,signal:t}),updateDatabaseSettings:(e,t)=>K({url:"/dbs/{dbName}/settings",method:"patch",...e,signal:t})},migrationRequests:{queryMigrationRequests:(e,t)=>K({url:"/dbs/{dbName}/migrations/query",method:"post",...e,signal:t}),createMigrationRequest:(e,t)=>K({url:"/dbs/{dbName}/migrations",method:"post",...e,signal:t}),getMigrationRequest:(e,t)=>K({url:"/dbs/{dbName}/migrations/{mrNumber}",method:"get",...e,signal:t}),updateMigrationRequest:(e,t)=>K({url:"/dbs/{dbName}/migrations/{mrNumber}",method:"patch",...e,signal:t}),listMigrationRequestsCommits:(e,t)=>K({url:"/dbs/{dbName}/migrations/{mrNumber}/commits",method:"post",...e,signal:t}),compareMigrationRequest:(e,t)=>K({url:"/dbs/{dbName}/migrations/{mrNumber}/compare",method:"post",...e,signal:t}),getMigrationRequestIsMerged:(e,t)=>K({url:"/dbs/{dbName}/migrations/{mrNumber}/merge",method:"get",...e,signal:t}),mergeMigrationRequest:(e,t)=>K({url:"/dbs/{dbName}/migrations/{mrNumber}/merge",method:"post",...e,signal:t})},table:{createTable:(e,t)=>K({url:"/db/{dbBranchName}/tables/{tableName}",method:"put",...e,signal:t}),deleteTable:(e,t)=>K({url:"/db/{dbBranchName}/tables/{tableName}",method:"delete",...e,signal:t}),updateTable:(e,t)=>K({url:"/db/{dbBranchName}/tables/{tableName}",method:"patch",...e,signal:t}),getTableSchema:(e,t)=>K({url:"/db/{dbBranchName}/tables/{tableName}/schema",method:"get",...e,signal:t}),setTableSchema:(e,t)=>K({url:"/db/{dbBranchName}/tables/{tableName}/schema",method:"put",...e,signal:t}),getTableColumns:(e,t)=>K({url:"/db/{dbBranchName}/tables/{tableName}/columns",method:"get",...e,signal:t}),addTableColumn:(e,t)=>K({url:"/db/{dbBranchName}/tables/{tableName}/columns",method:"post",...e,signal:t}),getColumn:(e,t)=>K({url:"/db/{dbBranchName}/tables/{tableName}/columns/{columnName}",method:"get",...e,signal:t}),updateColumn:(e,t)=>K({url:"/db/{dbBranchName}/tables/{tableName}/columns/{columnName}",method:"patch",...e,signal:t}),deleteColumn:(e,t)=>K({url:"/db/{dbBranchName}/tables/{tableName}/columns/{columnName}",method:"delete",...e,signal:t})},records:{branchTransaction:(e,t)=>K({url:"/db/{dbBranchName}/transaction",method:"post",...e,signal:t}),insertRecord:(e,t)=>K({url:"/db/{dbBranchName}/tables/{tableName}/data",method:"post",...e,signal:t}),getRecord:(e,t)=>K({url:"/db/{dbBranchName}/tables/{tableName}/data/{recordId}",method:"get",...e,signal:t}),insertRecordWithID:(e,t)=>K({url:"/db/{dbBranchName}/tables/{tableName}/data/{recordId}",method:"put",...e,signal:t}),updateRecordWithID:(e,t)=>K({url:"/db/{dbBranchName}/tables/{tableName}/data/{recordId}",method:"patch",...e,signal:t}),upsertRecordWithID:(e,t)=>K({url:"/db/{dbBranchName}/tables/{tableName}/data/{recordId}",method:"post",...e,signal:t}),deleteRecord:(e,t)=>K({url:"/db/{dbBranchName}/tables/{tableName}/data/{recordId}",method:"delete",...e,signal:t}),bulkInsertTableRecords:(e,t)=>K({url:"/db/{dbBranchName}/tables/{tableName}/bulk",method:"post",...e,signal:t})},files:{getFileItem:(e,t)=>K({url:"/db/{dbBranchName}/tables/{tableName}/data/{recordId}/column/{columnName}/file/{fileId}",method:"get",...e,signal:t}),putFileItem:(e,t)=>K({url:"/db/{dbBranchName}/tables/{tableName}/data/{recordId}/column/{columnName}/file/{fileId}",method:"put",...e,signal:t}),deleteFileItem:(e,t)=>K({url:"/db/{dbBranchName}/tables/{tableName}/data/{recordId}/column/{columnName}/file/{fileId}",method:"delete",...e,signal:t}),getFile:(e,t)=>K({url:"/db/{dbBranchName}/tables/{tableName}/data/{recordId}/column/{columnName}/file",method:"get",...e,signal:t}),putFile:(e,t)=>K({url:"/db/{dbBranchName}/tables/{tableName}/data/{recordId}/column/{columnName}/file",method:"put",...e,signal:t}),deleteFile:(e,t)=>K({url:"/db/{dbBranchName}/tables/{tableName}/data/{recordId}/column/{columnName}/file",method:"delete",...e,signal:t}),fileAccess:(e,t)=>K({url:"/file/{fileId}",method:"get",...e,signal:t}),fileUpload:(e,t)=>K({url:"/file/{fileId}",method:"put",...e,signal:t})},searchAndFilter:{queryTable:(e,t)=>K({url:"/db/{dbBranchName}/tables/{tableName}/query",method:"post",...e,signal:t}),searchBranch:(e,t)=>K({url:"/db/{dbBranchName}/search",method:"post",...e,signal:t}),searchTable:(e,t)=>K({url:"/db/{dbBranchName}/tables/{tableName}/search",method:"post",...e,signal:t}),vectorSearchTable:(e,t)=>K({url:"/db/{dbBranchName}/tables/{tableName}/vectorSearch",method:"post",...e,signal:t}),askTable:(e,t)=>K({url:"/db/{dbBranchName}/tables/{tableName}/ask",method:"post",...e,signal:t}),askTableSession:(e,t)=>K({url:"/db/{dbBranchName}/tables/{tableName}/ask/{sessionId}",method:"post",...e,signal:t}),summarizeTable:(e,t)=>K({url:"/db/{dbBranchName}/tables/{tableName}/summarize",method:"post",...e,signal:t}),aggregateTable:(e,t)=>K({url:"/db/{dbBranchName}/tables/{tableName}/aggregate",method:"post",...e,signal:t})},sql:{sqlQuery:(e,t)=>K({url:"/db/{dbBranchName}/sql",method:"post",...e,signal:t}),sqlBatchQuery:(e,t)=>K({url:"/db/{dbBranchName}/sql/batch",method:"post",...e,signal:t})}},{oAuth:{getAuthorizationCode:(e,t)=>Q({url:"/oauth/authorize",method:"get",...e,signal:t}),grantAuthorizationCode:(e,t)=>Q({url:"/oauth/authorize",method:"post",...e,signal:t}),getUserOAuthClients:(e,t)=>Q({url:"/user/oauth/clients",method:"get",...e,signal:t}),deleteUserOAuthClient:(e,t)=>Q({url:"/user/oauth/clients/{clientId}",method:"delete",...e,signal:t}),getUserOAuthAccessTokens:(e,t)=>Q({url:"/user/oauth/tokens",method:"get",...e,signal:t}),deleteOAuthAccessToken:(e,t)=>Q({url:"/user/oauth/tokens/{token}",method:"delete",...e,signal:t}),updateOAuthAccessToken:(e,t)=>Q({url:"/user/oauth/tokens/{token}",method:"patch",...e,signal:t})},users:{getUser:(e,t)=>Q({url:"/user",method:"get",...e,signal:t}),updateUser:(e,t)=>Q({url:"/user",method:"put",...e,signal:t}),deleteUser:(e,t)=>Q({url:"/user",method:"delete",...e,signal:t})},authentication:{getUserAPIKeys:(e,t)=>Q({url:"/user/keys",method:"get",...e,signal:t}),createUserAPIKey:(e,t)=>Q({url:"/user/keys/{keyName}",method:"post",...e,signal:t}),deleteUserAPIKey:(e,t)=>Q({url:"/user/keys/{keyName}",method:"delete",...e,signal:t})},workspaces:{getWorkspacesList:(e,t)=>Q({url:"/workspaces",method:"get",...e,signal:t}),createWorkspace:(e,t)=>Q({url:"/workspaces",method:"post",...e,signal:t}),getWorkspace:(e,t)=>Q({url:"/workspaces/{workspaceId}",method:"get",...e,signal:t}),updateWorkspace:(e,t)=>Q({url:"/workspaces/{workspaceId}",method:"put",...e,signal:t}),deleteWorkspace:(e,t)=>Q({url:"/workspaces/{workspaceId}",method:"delete",...e,signal:t}),getWorkspaceSettings:(e,t)=>Q({url:"/workspaces/{workspaceId}/settings",method:"get",...e,signal:t}),updateWorkspaceSettings:(e,t)=>Q({url:"/workspaces/{workspaceId}/settings",method:"patch",...e,signal:t}),getWorkspaceMembersList:(e,t)=>Q({url:"/workspaces/{workspaceId}/members",method:"get",...e,signal:t}),updateWorkspaceMemberRole:(e,t)=>Q({url:"/workspaces/{workspaceId}/members/{userId}",method:"put",...e,signal:t}),removeWorkspaceMember:(e,t)=>Q({url:"/workspaces/{workspaceId}/members/{userId}",method:"delete",...e,signal:t})},invites:{inviteWorkspaceMember:(e,t)=>Q({url:"/workspaces/{workspaceId}/invites",method:"post",...e,signal:t}),updateWorkspaceMemberInvite:(e,t)=>Q({url:"/workspaces/{workspaceId}/invites/{inviteId}",method:"patch",...e,signal:t}),cancelWorkspaceMemberInvite:(e,t)=>Q({url:"/workspaces/{workspaceId}/invites/{inviteId}",method:"delete",...e,signal:t}),acceptWorkspaceMemberInvite:(e,t)=>Q({url:"/workspaces/{workspaceId}/invites/{inviteKey}/accept",method:"post",...e,signal:t}),resendWorkspaceMemberInvite:(e,t)=>Q({url:"/workspaces/{workspaceId}/invites/{inviteId}/resend",method:"post",...e,signal:t})},xbcontrolOther:{listClusters:(e,t)=>Q({url:"/workspaces/{workspaceId}/clusters",method:"get",...e,signal:t}),createCluster:(e,t)=>Q({url:"/workspaces/{workspaceId}/clusters",method:"post",...e,signal:t}),getCluster:(e,t)=>Q({url:"/workspaces/{workspaceId}/clusters/{clusterId}",method:"get",...e,signal:t}),updateCluster:(e,t)=>Q({url:"/workspaces/{workspaceId}/clusters/{clusterId}",method:"patch",...e,signal:t}),deleteCluster:(e,t)=>Q({url:"/workspaces/{workspaceId}/clusters/{clusterId}",method:"delete",...e,signal:t})},databases:{getDatabaseList:(e,t)=>Q({url:"/workspaces/{workspaceId}/dbs",method:"get",...e,signal:t}),createDatabase:(e,t)=>Q({url:"/workspaces/{workspaceId}/dbs/{dbName}",method:"put",...e,signal:t}),deleteDatabase:(e,t)=>Q({url:"/workspaces/{workspaceId}/dbs/{dbName}",method:"delete",...e,signal:t}),getDatabaseMetadata:(e,t)=>Q({url:"/workspaces/{workspaceId}/dbs/{dbName}",method:"get",...e,signal:t}),updateDatabaseMetadata:(e,t)=>Q({url:"/workspaces/{workspaceId}/dbs/{dbName}",method:"patch",...e,signal:t}),renameDatabase:(e,t)=>Q({url:"/workspaces/{workspaceId}/dbs/{dbName}/rename",method:"post",...e,signal:t}),getDatabaseGithubSettings:(e,t)=>Q({url:"/workspaces/{workspaceId}/dbs/{dbName}/github",method:"get",...e,signal:t}),updateDatabaseGithubSettings:(e,t)=>Q({url:"/workspaces/{workspaceId}/dbs/{dbName}/github",method:"put",...e,signal:t}),deleteDatabaseGithubSettings:(e,t)=>Q({url:"/workspaces/{workspaceId}/dbs/{dbName}/github",method:"delete",...e,signal:t}),listRegions:(e,t)=>Q({url:"/workspaces/{workspaceId}/regions",method:"get",...e,signal:t})}}),new WeakMap,new WeakMap;class Z{constructor(e){this.id=e.id,this.name=e.name,this.mediaType=e.mediaType,this.base64Content=e.base64Content,this.enablePublicUrl=e.enablePublicUrl,this.signedUrlTimeout=e.signedUrlTimeout,this.uploadUrlTimeout=e.uploadUrlTimeout,this.size=e.size,this.version=e.version,this.url=e.url,this.signedUrl=e.signedUrl,this.uploadUrl=e.uploadUrl,this.attributes=e.attributes}static fromBuffer(e,t={}){let r=e.toString("base64");return new Z({...t,base64Content:r})}toBuffer(){if(!this.base64Content)throw Error('File content is not available, please select property "base64Content" when querying the file');return o.from(this.base64Content,"base64")}static fromArrayBuffer(e,t={}){let r=new Uint8Array(e);return this.fromUint8Array(r,t)}toArrayBuffer(){if(!this.base64Content)throw Error('File content is not available, please select property "base64Content" when querying the file');return new ArrayBuffer(atob(this.base64Content).length)}static fromUint8Array(e,t={}){let r="";for(let t=0;t<e.byteLength;t++)r+=String.fromCharCode(e[t]);let a=btoa(r);return new Z({...t,base64Content:a})}toUint8Array(){if(!this.base64Content)throw Error('File content is not available, please select property "base64Content" when querying the file');let e=atob(this.base64Content),t=new Uint8Array(e.length);for(let r=0;r<e.length;r++)t[r]=e.charCodeAt(r);return t}static async fromBlob(e,t={}){let r=t.name??e.name,a=e.type,s=await e.arrayBuffer();return this.fromArrayBuffer(s,{...t,name:r,mediaType:a})}toBlob(){if(!this.base64Content)throw Error('File content is not available, please select property "base64Content" when querying the file');let e=atob(this.base64Content),t=new Uint8Array(e.length);for(let r=0;r<e.length;r++)t[r]=e.charCodeAt(r);return new Blob([t],{type:this.mediaType})}static fromString(e,t={}){let r=btoa(e);return new Z({...t,base64Content:r})}toString(){if(!this.base64Content)throw Error('File content is not available, please select property "base64Content" when querying the file');return atob(this.base64Content)}static fromBase64(e,t={}){return new Z({...t,base64Content:e})}toBase64(){if(!this.base64Content)throw Error('File content is not available, please select property "base64Content" when querying the file');return this.base64Content}transform(...e){return{url:V(this.url,...e),signedUrl:V(this.signedUrl,...e),metadataUrl:V(this.url,...e,{format:"json"}),metadataSignedUrl:V(this.signedUrl,...e,{format:"json"})}}}var Y=e=>{throw TypeError(e)},ee=(e,t,r)=>t.has(e)||Y("Cannot "+r);new WeakMap;class et extends Array{constructor(...e){super(...et.parseConstructorParams(...e))}static parseConstructorParams(...e){return 1===e.length&&"number"==typeof e[0]?Array(e[0]):e.length<=1&&Array.isArray(e[0]??[])?Array(...e[0]??[]):Array(...e)}toArray(){return Array(...this)}toSerializable(){return JSON.parse(this.toString())}toString(){return JSON.stringify(this.toArray())}map(e,t){return this.toArray().map(e,t)}}new WeakMap;var er=e=>{throw TypeError(e)},ea=(e,t,r)=>t.has(e)||er("Cannot "+r);new WeakMap,new WeakMap,new WeakMap,new WeakSet;var es=e=>{throw TypeError(e)},en=(e,t,r)=>t.has(e)||es("Cannot "+r),ei=(e,t,r)=>(en(e,t,"read from private field"),r?r.call(e):t.get(e)),eo=(e,t,r,a)=>(en(e,t,"write to private field"),t.set(e,r),r);new WeakMap,E=new WeakMap,new WeakMap,new WeakMap,x=new WeakMap,new WeakMap,new WeakSet;new WeakMap,new WeakMap,new WeakSet;class eh{constructor(){this.classes={}}add(e){this.classes[e.name]=e}toJSON(e){return JSON.stringify(function e(t){if(Array.isArray(t))return t.map(e);let r=typeof t;if("undefined"===r)return{__:"undefined"};if("bigint"===r)return{__:"bigint",___:t.toString()};if(null===t||"object"!==r)return t;let a=t.constructor,s={__:a.name};for(let[r,a]of Object.entries(t))s[r]=e(a);return a===Date&&(s.___=t.toISOString()),a===Map&&(s.___=Object.fromEntries(t)),a===Set&&(s.___=[...t]),s}(e))}fromJSON(e){return JSON.parse(e,(e,t)=>{if(t&&"object"==typeof t&&!Array.isArray(t)){let{__:e,___:r,...a}=t,s=this.classes[e];if(s)return Object.assign(Object.create(s.prototype),a);if("Date"===e)return new Date(r);if("Set"===e)return new Set(r);if("Map"===e)return new Map(Object.entries(r));if("bigint"===e)return BigInt(r);if("undefined"===e)return;return a}return t})}}new eh}}]);