(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[476],{79742:function(e,t){"use strict";t.byteLength=function(e){var t=getLens(e),r=t[0],n=t[1];return(r+n)*3/4-n},t.toByteArray=function(e){var t,r,o=getLens(e),s=o[0],a=o[1],u=new i((s+a)*3/4-a),c=0,l=a>0?s-4:s;for(r=0;r>16&255,u[c++]=t>>8&255,u[c++]=255&t;return 2===a&&(t=n[e.charCodeAt(r)]<<2|n[e.charCodeAt(r+1)]>>4,u[c++]=255&t),1===a&&(t=n[e.charCodeAt(r)]<<10|n[e.charCodeAt(r+1)]<<4|n[e.charCodeAt(r+2)]>>2,u[c++]=t>>8&255,u[c++]=255&t),u},t.fromByteArray=function(e){for(var t,n=e.length,i=n%3,o=[],s=0,a=n-i;s>18&63]+r[i>>12&63]+r[i>>6&63]+r[63&i]);return o.join("")}(e,s,s+16383>a?a:s+16383));return 1===i?o.push(r[(t=e[n-1])>>2]+r[t<<4&63]+"=="):2===i&&o.push(r[(t=(e[n-2]<<8)+e[n-1])>>10]+r[t>>4&63]+r[t<<2&63]+"="),o.join("")};for(var r=[],n=[],i="undefined"!=typeof Uint8Array?Uint8Array:Array,o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",s=0,a=o.length;s0)throw Error("Invalid string. Length must be a multiple of 4");var r=e.indexOf("=");-1===r&&(r=t);var n=r===t?0:4-r%4;return[r,n]}n["-".charCodeAt(0)]=62,n["_".charCodeAt(0)]=63},48764:function(e,t,r){"use strict";/*! * The buffer module from node.js, for the browser. * * @author Feross Aboukhadijeh * @license MIT */var n=r(79742),i=r(80645),o="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;function createBuffer(e){if(e>2147483647)throw RangeError('The value "'+e+'" is invalid for option "size"');var t=new Uint8Array(e);return Object.setPrototypeOf(t,Buffer.prototype),t}function Buffer(e,t,r){if("number"==typeof e){if("string"==typeof t)throw TypeError('The "string" argument must be of type string. Received type number');return allocUnsafe(e)}return from(e,t,r)}function from(e,t,r){if("string"==typeof e)return function(e,t){if(("string"!=typeof t||""===t)&&(t="utf8"),!Buffer.isEncoding(t))throw TypeError("Unknown encoding: "+t);var r=0|byteLength(e,t),n=createBuffer(r),i=n.write(e,t);return i!==r&&(n=n.slice(0,i)),n}(e,t);if(ArrayBuffer.isView(e))return function(e){if(isInstance(e,Uint8Array)){var t=new Uint8Array(e);return fromArrayBuffer(t.buffer,t.byteOffset,t.byteLength)}return fromArrayLike(e)}(e);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);if(isInstance(e,ArrayBuffer)||e&&isInstance(e.buffer,ArrayBuffer)||"undefined"!=typeof SharedArrayBuffer&&(isInstance(e,SharedArrayBuffer)||e&&isInstance(e.buffer,SharedArrayBuffer)))return fromArrayBuffer(e,t,r);if("number"==typeof e)throw TypeError('The "value" argument must not be of type number. Received type number');var n=e.valueOf&&e.valueOf();if(null!=n&&n!==e)return Buffer.from(n,t,r);var i=function(e){if(Buffer.isBuffer(e)){var t,r=0|checked(e.length),n=createBuffer(r);return 0===n.length||e.copy(n,0,0,r),n}return void 0!==e.length?"number"!=typeof e.length||(t=e.length)!=t?createBuffer(0):fromArrayLike(e):"Buffer"===e.type&&Array.isArray(e.data)?fromArrayLike(e.data):void 0}(e);if(i)return i;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof e[Symbol.toPrimitive])return Buffer.from(e[Symbol.toPrimitive]("string"),t,r);throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}function assertSize(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"')}function allocUnsafe(e){return assertSize(e),createBuffer(e<0?0:0|checked(e))}function fromArrayLike(e){for(var t=e.length<0?0:0|checked(e.length),r=createBuffer(t),n=0;n=2147483647)throw RangeError("Attempt to allocate Buffer larger than maximum size: 0x7fffffff bytes");return 0|e}function byteLength(e,t){if(Buffer.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||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);var r=e.length,n=arguments.length>2&&!0===arguments[2];if(!n&&0===r)return 0;for(var i=!1;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return utf8ToBytes(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return base64ToBytes(e).length;default:if(i)return n?-1:utf8ToBytes(e).length;t=(""+t).toLowerCase(),i=!0}}function slowToString(e,t,r){var i,o,s=!1;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)))return"";for(e||(e="utf8");;)switch(e){case"hex":return function(e,t,r){var n=e.length;(!t||t<0)&&(t=0),(!r||r<0||r>n)&&(r=n);for(var i="",o=t;o2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),(o=r=+r)!=o&&(r=i?0:e.length-1),r<0&&(r=e.length+r),r>=e.length){if(i)return -1;r=e.length-1}else if(r<0){if(!i)return -1;r=0}if("string"==typeof t&&(t=Buffer.from(t,n)),Buffer.isBuffer(t))return 0===t.length?-1:arrayIndexOf(e,t,r,n,i);if("number"==typeof t)return(t&=255,"function"==typeof Uint8Array.prototype.indexOf)?i?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):arrayIndexOf(e,[t],r,n,i);throw TypeError("val must be string, number or Buffer")}function arrayIndexOf(e,t,r,n,i){var o,s=1,a=e.length,u=t.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(e.length<2||t.length<2)return -1;s=2,a/=2,u/=2,r/=2}function read(e,t){return 1===s?e[t]:e.readUInt16BE(t*s)}if(i){var c=-1;for(o=r;oa&&(r=a-u),o=r;o>=0;o--){for(var l=!0,f=0;f239?4:c>223?3:c>191?2:1;if(i+f<=r)switch(f){case 1:c<128&&(l=c);break;case 2:(192&(o=e[i+1]))==128&&(u=(31&c)<<6|63&o)>127&&(l=u);break;case 3:o=e[i+1],s=e[i+2],(192&o)==128&&(192&s)==128&&(u=(15&c)<<12|(63&o)<<6|63&s)>2047&&(u<55296||u>57343)&&(l=u);break;case 4:o=e[i+1],s=e[i+2],a=e[i+3],(192&o)==128&&(192&s)==128&&(192&a)==128&&(u=(15&c)<<18|(63&o)<<12|(63&s)<<6|63&a)>65535&&u<1114112&&(l=u)}null===l?(l=65533,f=1):l>65535&&(l-=65536,n.push(l>>>10&1023|55296),l=56320|1023&l),n.push(l),i+=f}return function(e){var t=e.length;if(t<=4096)return String.fromCharCode.apply(String,e);for(var r="",n=0;nr)throw RangeError("Trying to access beyond buffer length")}function checkInt(e,t,r,n,i,o){if(!Buffer.isBuffer(e))throw TypeError('"buffer" argument must be a Buffer instance');if(t>i||te.length)throw RangeError("Index out of range")}function checkIEEE754(e,t,r,n,i,o){if(r+n>e.length||r<0)throw RangeError("Index out of range")}function writeFloat(e,t,r,n,o){return t=+t,r>>>=0,o||checkIEEE754(e,t,r,4,34028234663852886e22,-34028234663852886e22),i.write(e,t,r,n,23,4),r+4}function writeDouble(e,t,r,n,o){return t=+t,r>>>=0,o||checkIEEE754(e,t,r,8,17976931348623157e292,-17976931348623157e292),i.write(e,t,r,n,52,8),r+8}t.lW=Buffer,t.h2=50,Buffer.TYPED_ARRAY_SUPPORT=function(){try{var e=new Uint8Array(1),t={foo:function(){return 42}};return Object.setPrototypeOf(t,Uint8Array.prototype),Object.setPrototypeOf(e,t),42===e.foo()}catch(e){return!1}}(),Buffer.TYPED_ARRAY_SUPPORT||"undefined"==typeof console||"function"!=typeof console.error||console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),Object.defineProperty(Buffer.prototype,"parent",{enumerable:!0,get:function(){if(Buffer.isBuffer(this))return this.buffer}}),Object.defineProperty(Buffer.prototype,"offset",{enumerable:!0,get:function(){if(Buffer.isBuffer(this))return this.byteOffset}}),Buffer.poolSize=8192,Buffer.from=function(e,t,r){return from(e,t,r)},Object.setPrototypeOf(Buffer.prototype,Uint8Array.prototype),Object.setPrototypeOf(Buffer,Uint8Array),Buffer.alloc=function(e,t,r){return(assertSize(e),e<=0)?createBuffer(e):void 0!==t?"string"==typeof r?createBuffer(e).fill(t,r):createBuffer(e).fill(t):createBuffer(e)},Buffer.allocUnsafe=function(e){return allocUnsafe(e)},Buffer.allocUnsafeSlow=function(e){return allocUnsafe(e)},Buffer.isBuffer=function(e){return null!=e&&!0===e._isBuffer&&e!==Buffer.prototype},Buffer.compare=function(e,t){if(isInstance(e,Uint8Array)&&(e=Buffer.from(e,e.offset,e.byteLength)),isInstance(t,Uint8Array)&&(t=Buffer.from(t,t.offset,t.byteLength)),!Buffer.isBuffer(e)||!Buffer.isBuffer(t))throw TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(e===t)return 0;for(var r=e.length,n=t.length,i=0,o=Math.min(r,n);in.length?Buffer.from(o).copy(n,i):Uint8Array.prototype.set.call(n,o,i);else if(Buffer.isBuffer(o))o.copy(n,i);else throw TypeError('"list" argument must be an Array of Buffers');i+=o.length}return n},Buffer.byteLength=byteLength,Buffer.prototype._isBuffer=!0,Buffer.prototype.swap16=function(){var e=this.length;if(e%2!=0)throw RangeError("Buffer size must be a multiple of 16-bits");for(var t=0;tr&&(e+=" ... "),""},o&&(Buffer.prototype[o]=Buffer.prototype.inspect),Buffer.prototype.compare=function(e,t,r,n,i){if(isInstance(e,Uint8Array)&&(e=Buffer.from(e,e.offset,e.byteLength)),!Buffer.isBuffer(e))throw TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(void 0===t&&(t=0),void 0===r&&(r=e?e.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),t<0||r>e.length||n<0||i>this.length)throw RangeError("out of range index");if(n>=i&&t>=r)return 0;if(n>=i)return -1;if(t>=r)return 1;if(t>>>=0,r>>>=0,n>>>=0,i>>>=0,this===e)return 0;for(var o=i-n,s=r-t,a=Math.min(o,s),u=this.slice(n,i),c=e.slice(t,r),l=0;l>>=0,isFinite(r)?(r>>>=0,void 0===n&&(n="utf8")):(n=r,r=void 0);else throw Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var i,o,s,a,u,c,l,f,p=this.length-t;if((void 0===r||r>p)&&(r=p),e.length>0&&(r<0||t<0)||t>this.length)throw RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var h=!1;;)switch(n){case"hex":return function(e,t,r,n){r=Number(r)||0;var i=e.length-r;n?(n=Number(n))>i&&(n=i):n=i;var o=t.length;n>o/2&&(n=o/2);for(var s=0;s>8,i.push(r%256),i.push(n);return i}(e,this.length-l),this,l,f);default:if(h)throw TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),h=!0}},Buffer.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}},Buffer.prototype.slice=function(e,t){var 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>>=0,t>>>=0,r||checkOffset(e,t,this.length);for(var n=this[e],i=1,o=0;++o>>=0,t>>>=0,r||checkOffset(e,t,this.length);for(var n=this[e+--t],i=1;t>0&&(i*=256);)n+=this[e+--t]*i;return n},Buffer.prototype.readUint8=Buffer.prototype.readUInt8=function(e,t){return e>>>=0,t||checkOffset(e,1,this.length),this[e]},Buffer.prototype.readUint16LE=Buffer.prototype.readUInt16LE=function(e,t){return e>>>=0,t||checkOffset(e,2,this.length),this[e]|this[e+1]<<8},Buffer.prototype.readUint16BE=Buffer.prototype.readUInt16BE=function(e,t){return e>>>=0,t||checkOffset(e,2,this.length),this[e]<<8|this[e+1]},Buffer.prototype.readUint32LE=Buffer.prototype.readUInt32LE=function(e,t){return e>>>=0,t||checkOffset(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},Buffer.prototype.readUint32BE=Buffer.prototype.readUInt32BE=function(e,t){return e>>>=0,t||checkOffset(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},Buffer.prototype.readIntLE=function(e,t,r){e>>>=0,t>>>=0,r||checkOffset(e,t,this.length);for(var n=this[e],i=1,o=0;++o=(i*=128)&&(n-=Math.pow(2,8*t)),n},Buffer.prototype.readIntBE=function(e,t,r){e>>>=0,t>>>=0,r||checkOffset(e,t,this.length);for(var n=t,i=1,o=this[e+--n];n>0&&(i*=256);)o+=this[e+--n]*i;return o>=(i*=128)&&(o-=Math.pow(2,8*t)),o},Buffer.prototype.readInt8=function(e,t){return(e>>>=0,t||checkOffset(e,1,this.length),128&this[e])?-((255-this[e]+1)*1):this[e]},Buffer.prototype.readInt16LE=function(e,t){e>>>=0,t||checkOffset(e,2,this.length);var r=this[e]|this[e+1]<<8;return 32768&r?4294901760|r:r},Buffer.prototype.readInt16BE=function(e,t){e>>>=0,t||checkOffset(e,2,this.length);var r=this[e+1]|this[e]<<8;return 32768&r?4294901760|r:r},Buffer.prototype.readInt32LE=function(e,t){return e>>>=0,t||checkOffset(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},Buffer.prototype.readInt32BE=function(e,t){return e>>>=0,t||checkOffset(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},Buffer.prototype.readFloatLE=function(e,t){return e>>>=0,t||checkOffset(e,4,this.length),i.read(this,e,!0,23,4)},Buffer.prototype.readFloatBE=function(e,t){return e>>>=0,t||checkOffset(e,4,this.length),i.read(this,e,!1,23,4)},Buffer.prototype.readDoubleLE=function(e,t){return e>>>=0,t||checkOffset(e,8,this.length),i.read(this,e,!0,52,8)},Buffer.prototype.readDoubleBE=function(e,t){return e>>>=0,t||checkOffset(e,8,this.length),i.read(this,e,!1,52,8)},Buffer.prototype.writeUintLE=Buffer.prototype.writeUIntLE=function(e,t,r,n){if(e=+e,t>>>=0,r>>>=0,!n){var i=Math.pow(2,8*r)-1;checkInt(this,e,t,r,i,0)}var o=1,s=0;for(this[t]=255&e;++s>>=0,r>>>=0,!n){var i=Math.pow(2,8*r)-1;checkInt(this,e,t,r,i,0)}var o=r-1,s=1;for(this[t+o]=255&e;--o>=0&&(s*=256);)this[t+o]=e/s&255;return t+r},Buffer.prototype.writeUint8=Buffer.prototype.writeUInt8=function(e,t,r){return e=+e,t>>>=0,r||checkInt(this,e,t,1,255,0),this[t]=255&e,t+1},Buffer.prototype.writeUint16LE=Buffer.prototype.writeUInt16LE=function(e,t,r){return e=+e,t>>>=0,r||checkInt(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},Buffer.prototype.writeUint16BE=Buffer.prototype.writeUInt16BE=function(e,t,r){return e=+e,t>>>=0,r||checkInt(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},Buffer.prototype.writeUint32LE=Buffer.prototype.writeUInt32LE=function(e,t,r){return e=+e,t>>>=0,r||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},Buffer.prototype.writeUint32BE=Buffer.prototype.writeUInt32BE=function(e,t,r){return e=+e,t>>>=0,r||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},Buffer.prototype.writeIntLE=function(e,t,r,n){if(e=+e,t>>>=0,!n){var i=Math.pow(2,8*r-1);checkInt(this,e,t,r,i-1,-i)}var o=0,s=1,a=0;for(this[t]=255&e;++o>0)-a&255;return t+r},Buffer.prototype.writeIntBE=function(e,t,r,n){if(e=+e,t>>>=0,!n){var i=Math.pow(2,8*r-1);checkInt(this,e,t,r,i-1,-i)}var o=r-1,s=1,a=0;for(this[t+o]=255&e;--o>=0&&(s*=256);)e<0&&0===a&&0!==this[t+o+1]&&(a=1),this[t+o]=(e/s>>0)-a&255;return t+r},Buffer.prototype.writeInt8=function(e,t,r){return e=+e,t>>>=0,r||checkInt(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},Buffer.prototype.writeInt16LE=function(e,t,r){return e=+e,t>>>=0,r||checkInt(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},Buffer.prototype.writeInt16BE=function(e,t,r){return e=+e,t>>>=0,r||checkInt(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},Buffer.prototype.writeInt32LE=function(e,t,r){return e=+e,t>>>=0,r||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},Buffer.prototype.writeInt32BE=function(e,t,r){return e=+e,t>>>=0,r||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},Buffer.prototype.writeFloatLE=function(e,t,r){return writeFloat(this,e,t,!0,r)},Buffer.prototype.writeFloatBE=function(e,t,r){return writeFloat(this,e,t,!1,r)},Buffer.prototype.writeDoubleLE=function(e,t,r){return writeDouble(this,e,t,!0,r)},Buffer.prototype.writeDoubleBE=function(e,t,r){return writeDouble(this,e,t,!1,r)},Buffer.prototype.copy=function(e,t,r,n){if(!Buffer.isBuffer(e))throw TypeError("argument should be a Buffer");if(r||(r=0),n||0===n||(n=this.length),t>=e.length&&(t=e.length),t||(t=0),n>0&&n=this.length)throw RangeError("Index out of range");if(n<0)throw RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),e.length-t>>=0,r=void 0===r?this.length:r>>>0,e||(e=0),"number"==typeof e)for(i=t;i55295&&r<57344){if(!i){if(r>56319||s+1===n){(t-=3)>-1&&o.push(239,191,189);continue}i=r;continue}if(r<56320){(t-=3)>-1&&o.push(239,191,189),i=r;continue}r=(i-55296<<10|r-56320)+65536}else i&&(t-=3)>-1&&o.push(239,191,189);if(i=null,r<128){if((t-=1)<0)break;o.push(r)}else if(r<2048){if((t-=2)<0)break;o.push(r>>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;o.push(r>>12|224,r>>6&63|128,63&r|128)}else if(r<1114112){if((t-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}else throw Error("Invalid code point")}return o}function base64ToBytes(e){return n.toByteArray(function(e){if((e=(e=e.split("=")[0]).trim().replace(s,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function blitBuffer(e,t,r,n){for(var i=0;i=t.length)&&!(i>=e.length);++i)t[i+r]=e[i];return i}function isInstance(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}var a=function(){for(var e="0123456789abcdef",t=Array(256),r=0;r<16;++r)for(var n=16*r,i=0;i<16;++i)t[n+i]=e[r]+e[i];return t}()},80645:function(e,t){/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh */t.read=function(e,t,r,n,i){var o,s,a=8*i-n-1,u=(1<>1,l=-7,f=r?i-1:0,p=r?-1:1,h=e[t+f];for(f+=p,o=h&(1<<-l)-1,h>>=-l,l+=a;l>0;o=256*o+e[t+f],f+=p,l-=8);for(s=o&(1<<-l)-1,o>>=-l,l+=n;l>0;s=256*s+e[t+f],f+=p,l-=8);if(0===o)o=1-c;else{if(o===u)return s?NaN:(h?-1:1)*(1/0);s+=Math.pow(2,n),o-=c}return(h?-1:1)*s*Math.pow(2,o-n)},t.write=function(e,t,r,n,i,o){var s,a,u,c=8*o-i-1,l=(1<>1,p=23===i?5960464477539062e-23:0,h=n?0:o-1,d=n?1:-1,b=t<0||0===t&&1/t<0?1:0;for(isNaN(t=Math.abs(t))||t===1/0?(a=isNaN(t)?1:0,s=l):(s=Math.floor(Math.log(t)/Math.LN2),t*(u=Math.pow(2,-s))<1&&(s--,u*=2),s+f>=1?t+=p/u:t+=p*Math.pow(2,1-f),t*u>=2&&(s++,u/=2),s+f>=l?(a=0,s=l):s+f>=1?(a=(t*u-1)*Math.pow(2,i),s+=f):(a=t*Math.pow(2,f-1)*Math.pow(2,i),s=0));i>=8;e[r+h]=255&a,h+=d,a/=256,i-=8);for(s=s<0;e[r+h]=255&s,h+=d,s/=256,c-=8);e[r+h-d]|=128*b}},83454:function(e,t,r){"use strict";var n,i;e.exports=(null==(n=r.g.process)?void 0:n.env)&&"object"==typeof(null==(i=r.g.process)?void 0:i.env)?r.g.process:r(77663)},77663:function(e){!function(){var t={229:function(e){var t,r,n,i=e.exports={};function defaultSetTimout(){throw Error("setTimeout has not been defined")}function defaultClearTimeout(){throw Error("clearTimeout has not been defined")}function runTimeout(e){if(t===setTimeout)return setTimeout(e,0);if((t===defaultSetTimout||!t)&&setTimeout)return t=setTimeout,setTimeout(e,0);try{return t(e,0)}catch(r){try{return t.call(null,e,0)}catch(r){return t.call(this,e,0)}}}!function(){try{t="function"==typeof setTimeout?setTimeout:defaultSetTimout}catch(e){t=defaultSetTimout}try{r="function"==typeof clearTimeout?clearTimeout:defaultClearTimeout}catch(e){r=defaultClearTimeout}}();var o=[],s=!1,a=-1;function cleanUpNextTick(){s&&n&&(s=!1,n.length?o=n.concat(o):a=-1,o.length&&drainQueue())}function drainQueue(){if(!s){var e=runTimeout(cleanUpNextTick);s=!0;for(var t=o.length;t;){for(n=o,o=[];++a1)for(var r=1;r{let t=e.charCodeAt(0);if(t>255)throw Error(`Only ASCII edit info can be encoded. Error attempting to encode ${n} on character ${e} (${t})`);return Array.from(t.toString(4).padStart(4,"0")).map(e=>String.fromCodePoint(i[e])).join("")}).join("")}`}`}Object.fromEntries(Object.entries(i).map(e=>e.reverse())),Object.fromEntries(Object.entries(n).map(e=>e.reverse()));var s=`${Object.values(n).map(e=>`\\u{${e.toString(16)}}`).join("")}`,a=RegExp(`[${s}]{4,}`,"gu");function stegaClean(e){var t,r;return e&&JSON.parse({cleaned:(t=JSON.stringify(e)).replace(a,""),encoded:(null==(r=t.match(a))?void 0:r[0])||""}.cleaned)}},80476:function(e,t,r){"use strict";r.d(t,{eI:function(){return eJ}});let n=!(typeof navigator>"u")&&"ReactNative"===navigator.product,i={timeout:n?6e4:12e4},processOptions=function(e){let t={...i,..."string"==typeof e?{url:e}:e};if(t.timeout=function normalizeTimeout(e){if(!1===e||0===e)return!1;if(e.connect||e.socket)return e;let t=Number(e);return isNaN(t)?normalizeTimeout(i.timeout):{connect:t,socket:t}}(t.timeout),t.query){let{url:e,searchParams:r}=function(e){let t=e.indexOf("?");if(-1===t)return{url:e,searchParams:new URLSearchParams};let r=e.slice(0,t),i=e.slice(t+1);if(!n)return{url:r,searchParams:new URLSearchParams(i)};if("function"!=typeof decodeURIComponent)throw Error("Broken `URLSearchParams` implementation, and `decodeURIComponent` is not defined");let o=new URLSearchParams;for(let e of i.split("&")){let[t,r]=e.split("=");t&&o.append(decodeQueryParam(t),decodeQueryParam(r||""))}return{url:r,searchParams:o}}(t.url);for(let[n,i]of Object.entries(t.query)){if(void 0!==i){if(Array.isArray(i))for(let e of i)r.append(n,e);else r.append(n,i)}let o=r.toString();o&&(t.url=`${e}?${o}`)}}return t.method=t.body&&!t.method?"POST":(t.method||"GET").toUpperCase(),t};function decodeQueryParam(e){return decodeURIComponent(e.replace(/\+/g," "))}let o=/^https?:\/\//i,validateOptions=function(e){if(!o.test(e.url))throw Error(`"${e.url}" is not a valid URL`)},middlewareReducer=e=>function(t,r,...n){let i="onError"===t,o=r;for(let r=0;r"u"?t[a]=u:(i=t[a],"[object Array]"===Object.prototype.toString.call(i))?t[a].push(u):t[a]=[t[a],u]}return t}).__esModule&&Object.prototype.hasOwnProperty.call(u,"default")?u.default:u,_=Object.defineProperty,__defNormalProp=(e,t,r)=>t in e?_(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,__publicField=(e,t,r)=>(__defNormalProp(e,"symbol"!=typeof t?t+"":t,r),r),__accessCheck=(e,t,r)=>{if(!t.has(e))throw TypeError("Cannot "+r)},__privateGet=(e,t,r)=>(__accessCheck(e,t,"read from private field"),r?r.call(e):t.get(e)),__privateAdd=(e,t,r)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,r)},__privateSet=(e,t,r,n)=>(__accessCheck(e,t,"write to private field"),t.set(e,r),r);let FetchXhr=class FetchXhr{constructor(){__publicField(this,"onabort"),__publicField(this,"onerror"),__publicField(this,"onreadystatechange"),__publicField(this,"ontimeout"),__publicField(this,"readyState",0),__publicField(this,"response"),__publicField(this,"responseText",""),__publicField(this,"responseType",""),__publicField(this,"status"),__publicField(this,"statusText"),__publicField(this,"withCredentials"),__privateAdd(this,f,void 0),__privateAdd(this,p,void 0),__privateAdd(this,h,void 0),__privateAdd(this,d,{}),__privateAdd(this,b,void 0),__privateAdd(this,y,{}),__privateAdd(this,v,void 0)}open(e,t,r){var n;__privateSet(this,f,e),__privateSet(this,p,t),__privateSet(this,h,""),this.readyState=1,null==(n=this.onreadystatechange)||n.call(this),__privateSet(this,b,void 0)}abort(){__privateGet(this,b)&&__privateGet(this,b).abort()}getAllResponseHeaders(){return __privateGet(this,h)}setRequestHeader(e,t){__privateGet(this,d)[e]=t}setInit(e,t=!0){__privateSet(this,y,e),__privateSet(this,v,t)}send(e){let t="arraybuffer"!==this.responseType,r={...__privateGet(this,y),method:__privateGet(this,f),headers:__privateGet(this,d),body:e};"function"==typeof AbortController&&__privateGet(this,v)&&(__privateSet(this,b,new AbortController),"u">typeof EventTarget&&__privateGet(this,b).signal instanceof EventTarget&&(r.signal=__privateGet(this,b).signal)),"u">typeof document&&(r.credentials=this.withCredentials?"include":"omit"),fetch(__privateGet(this,p),r).then(e=>(e.headers.forEach((e,t)=>{__privateSet(this,h,__privateGet(this,h)+`${t}: ${e}\r `)}),this.status=e.status,this.statusText=e.statusText,this.readyState=3,t?e.text():e.arrayBuffer())).then(e=>{var t;"string"==typeof e?this.responseText=e:this.response=e,this.readyState=4,null==(t=this.onreadystatechange)||t.call(this)}).catch(e=>{var t,r;if("AbortError"===e.name){null==(t=this.onabort)||t.call(this);return}null==(r=this.onerror)||r.call(this,e)})}};f=new WeakMap,p=new WeakMap,h=new WeakMap,d=new WeakMap,b=new WeakMap,y=new WeakMap,v=new WeakMap;let m="function"==typeof XMLHttpRequest?"xhr":"fetch",w="xhr"===m?XMLHttpRequest:FetchXhr,httpRequester=(e,t)=>{var r;let n=e.options,i=e.applyMiddleware("finalizeOptions",n),o={},s=e.applyMiddleware("interceptRequest",void 0,{adapter:m,context:e});if(s){let e=setTimeout(t,0,null,s);return{abort:()=>clearTimeout(e)}}let a=new w;a instanceof FetchXhr&&"object"==typeof i.fetch&&a.setInit(i.fetch,null==(r=i.useAbortSignal)||r);let u=i.headers,c=i.timeout,l=!1,f=!1,p=!1;if(a.onerror=e=>{a instanceof FetchXhr?onError(e instanceof Error?e:Error(`Request error while attempting to reach is ${i.url}`,{cause:e})):onError(Error(`Request error while attempting to reach is ${i.url}${e.lengthComputable?`(${e.loaded} of ${e.total} bytes transferred)`:""}`))},a.ontimeout=e=>{onError(Error(`Request timeout while attempting to reach ${i.url}${e.lengthComputable?`(${e.loaded} of ${e.total} bytes transferred)`:""}`))},a.onabort=()=>{stopTimers(!0),l=!0},a.onreadystatechange=()=>{c&&(stopTimers(),o.socket=setTimeout(()=>timeoutRequest("ESOCKETTIMEDOUT"),c.socket)),l||4!==a.readyState||0===a.status||function(){if(!(l||f||p)){if(0===a.status){onError(Error("Unknown XHR error"));return}stopTimers(),f=!0,t(null,{body:a.response||(""===a.responseType||"text"===a.responseType?a.responseText:""),url:i.url,method:i.method,headers:g(a.getAllResponseHeaders()),statusCode:a.status,statusMessage:a.statusText})}}()},a.open(i.method,i.url,!0),a.withCredentials=!!i.withCredentials,u&&a.setRequestHeader)for(let e in u)u.hasOwnProperty(e)&&a.setRequestHeader(e,u[e]);return i.rawBody&&(a.responseType="arraybuffer"),e.applyMiddleware("onRequest",{options:i,adapter:m,request:a,context:e}),a.send(i.body||null),c&&(o.connect=setTimeout(()=>timeoutRequest("ETIMEDOUT"),c.connect)),{abort:function(){l=!0,a&&a.abort()}};function timeoutRequest(t){p=!0,a.abort();let r=Error("ESOCKETTIMEDOUT"===t?`Socket timed out on request to ${i.url}`:`Connection timed out on request to ${i.url}`);r.code=t,e.channels.error.publish(r)}function stopTimers(e){(e||l||a.readyState>=2&&o.connect)&&clearTimeout(o.connect),o.socket&&clearTimeout(o.socket)}function onError(e){if(f)return;stopTimers(!0),f=!0,a=null;let r=e||Error(`Network error while attempting to reach ${i.url}`);r.isNetworkError=!0,r.request=i,t(r)}},getIt=(e=[],t=httpRequester)=>(function createRequester(e,t){let r=[],n=a.reduce((e,t)=>(e[t]=e[t]||[],e),{processOptions:[processOptions],validateOptions:[validateOptions]});function request(e){let r;let onResponse=(e,t,r)=>{let n=e,s=t;if(!n)try{s=o("onResponse",t,r)}catch(e){s=null,n=e}(n=n&&o("onError",n,r))?i.error.publish(n):s&&i.response.publish(s)},i=s.reduce((e,t)=>(e[t]=function(){let e=Object.create(null),t=0;return{publish:function(t){for(let r in e)e[r](t)},subscribe:function(r){let n=t++;return e[n]=r,function(){delete e[n]}}}}(),e),{}),o=middlewareReducer(n),a=o("processOptions",e);o("validateOptions",a);let u={options:a,channels:i,applyMiddleware:o},c=i.request.subscribe(e=>{r=t(e,(t,r)=>onResponse(t,r,e))});i.abort.subscribe(()=>{c(),r&&r.abort()});let l=o("onReturn",i,u);return l===i&&i.request.publish(u),l}return request.use=function(e){if(!e)throw Error("Tried to add middleware that resolved to falsey value");if("function"==typeof e)throw Error("Tried to add middleware that was a function. It probably expects you to pass options to it.");if(e.onReturn&&n.onReturn.length>0)throw Error("Tried to add new middleware with `onReturn` handler, but another handler has already been registered for this event");return a.forEach(t=>{e[t]&&n[t].push(e[t])}),r.push(e),request},request.clone=()=>createRequester(r,t),e.forEach(request.use),request})(e,t);var E,x,S=r(83454),$=r(48764).lW,O={exports:{}},common=function(e){function createDebug(e){let t,r=null,n,i;function debug2(...e){if(!debug2.enabled)return;let r=Number(new Date),n=r-(t||r);debug2.diff=n,debug2.prev=t,debug2.curr=r,t=r,e[0]=createDebug.coerce(e[0]),"string"!=typeof e[0]&&e.unshift("%O");let i=0;e[0]=e[0].replace(/%([a-zA-Z%])/g,(t,r)=>{if("%%"===t)return"%";i++;let n=createDebug.formatters[r];if("function"==typeof n){let r=e[i];t=n.call(debug2,r),e.splice(i,1),i--}return t}),createDebug.formatArgs.call(debug2,e),(debug2.log||createDebug.log).apply(debug2,e)}return debug2.namespace=e,debug2.useColors=createDebug.useColors(),debug2.color=createDebug.selectColor(e),debug2.extend=extend,debug2.destroy=createDebug.destroy,Object.defineProperty(debug2,"enabled",{enumerable:!0,configurable:!1,get:()=>null!==r?r:(n!==createDebug.namespaces&&(n=createDebug.namespaces,i=createDebug.enabled(e)),i),set:e=>{r=e}}),"function"==typeof createDebug.init&&createDebug.init(debug2),debug2}function extend(e,t){let r=createDebug(this.namespace+(typeof t>"u"?":":t)+e);return r.log=this.log,r}function toNamespace(e){return e.toString().substring(2,e.toString().length-2).replace(/\.\*\?$/,"*")}return createDebug.debug=createDebug,createDebug.default=createDebug,createDebug.coerce=function(e){return e instanceof Error?e.stack||e.message:e},createDebug.disable=function(){let e=[...createDebug.names.map(toNamespace),...createDebug.skips.map(toNamespace).map(e=>"-"+e)].join(",");return createDebug.enable(""),e},createDebug.enable=function(e){let t;createDebug.save(e),createDebug.namespaces=e,createDebug.names=[],createDebug.skips=[];let r=("string"==typeof e?e:"").split(/[\s,]+/),n=r.length;for(t=0;t=1.5*r?"s":"")}return x=1,E=function(e,t){t=t||{};var r,n,i=typeof e;if("string"===i&&e.length>0)return function(e){if(!((e=String(e)).length>100)){var t=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(e);if(t){var r=parseFloat(t[1]);switch((t[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return 315576e5*r;case"weeks":case"week":case"w":return 6048e5*r;case"days":case"day":case"d":return 864e5*r;case"hours":case"hour":case"hrs":case"hr":case"h":return 36e5*r;case"minutes":case"minute":case"mins":case"min":case"m":return 6e4*r;case"seconds":case"second":case"secs":case"sec":case"s":return 1e3*r;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return r;default:return}}}}(e);if("number"===i&&isFinite(e))return t.long?(r=Math.abs(e))>=864e5?plural(e,r,864e5,"day"):r>=36e5?plural(e,r,36e5,"hour"):r>=6e4?plural(e,r,6e4,"minute"):r>=1e3?plural(e,r,1e3,"second"):e+" ms":(n=Math.abs(e))>=864e5?Math.round(e/864e5)+"d":n>=36e5?Math.round(e/36e5)+"h":n>=6e4?Math.round(e/6e4)+"m":n>=1e3?Math.round(e/1e3)+"s":e+"ms";throw Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))}}(),createDebug.destroy=function(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")},Object.keys(e).forEach(t=>{createDebug[t]=e[t]}),createDebug.names=[],createDebug.skips=[],createDebug.formatters={},createDebug.selectColor=function(e){let t=0;for(let r=0;r{"%%"!==e&&(n++,"%c"===e&&(i=n))}),t.splice(i,0,r)},t.save=function(e){try{e?t.storage.setItem("debug",e):t.storage.removeItem("debug")}catch{}},t.load=function(){let e;try{e=t.storage.getItem("debug")}catch{}return!e&&"u">typeof S&&"env"in S&&(e=S.env.DEBUG),e},t.useColors=function(){return"u">typeof window&&!!window.process&&("renderer"===window.process.type||!!window.process.__nwjs)||!("u">typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))&&("u">typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"u">typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"u">typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||"u">typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/))},t.storage=function(){try{return localStorage}catch{}}(),t.destroy=(r=!1,()=>{r||(r=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}),t.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"],t.log=console.debug||console.log||(()=>{}),e.exports=common(t);let{formatters:n}=e.exports;n.j=function(e){try{return JSON.stringify(e)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}}(O,O.exports),O.exports,Object.prototype.hasOwnProperty;let A=typeof $>"u"?()=>!1:e=>$.isBuffer(e);/*! * is-plain-object * * Copyright (c) 2014-2017, Jon Schlinkert. * Released under the MIT License. */function isObject(e){return"[object Object]"===Object.prototype.toString.call(e)}let B=["boolean","string","number"],T={};"u">typeof globalThis?T=globalThis:"u">typeof window?T=window:"u">typeof global?T=global:"u">typeof self&&(T=self);var k=T,I=Object.defineProperty,middleware_browser_defNormalProp=(e,t,r)=>t in e?I(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,middleware_browser_publicField=(e,t,r)=>(middleware_browser_defNormalProp(e,"symbol"!=typeof t?t+"":t,r),r);let promise=(e={})=>{let t=e.implementation||Promise;if(!t)throw Error("`Promise` is not available in global scope, and no implementation was passed");return{onReturn:(r,n)=>new t((t,i)=>{let o=n.options.cancelToken;o&&o.promise.then(e=>{r.abort.publish(e),i(e)}),r.error.subscribe(i),r.response.subscribe(r=>{t(e.onlyBody?r.body:r)}),setTimeout(()=>{try{r.request.publish(n)}catch(e){i(e)}},0)})}};let Cancel=class Cancel{constructor(e){middleware_browser_publicField(this,"__CANCEL__",!0),middleware_browser_publicField(this,"message"),this.message=e}toString(){return`Cancel${this.message?`: ${this.message}`:""}`}};let F=class{constructor(e){if(middleware_browser_publicField(this,"promise"),middleware_browser_publicField(this,"reason"),"function"!=typeof e)throw TypeError("executor must be a function.");let t=null;this.promise=new Promise(e=>{t=e}),e(e=>{this.reason||(this.reason=new Cancel(e),t(this.reason))})}};middleware_browser_publicField(F,"source",()=>{let e;return{token:new F(t=>{e=t}),cancel:e}}),promise.Cancel=Cancel,promise.CancelToken=F,promise.isCancel=e=>!!(e&&null!=e&&e.__CANCEL__);var defaultShouldRetry=(e,t,r)=>("GET"===r.method||"HEAD"===r.method)&&(e.isNetworkError||!1);let isStream=e=>null!==e&&"object"==typeof e&&"function"==typeof e.pipe;var sharedRetry=e=>{let t=e.maxRetries||5,r=e.retryDelay||getRetryDelay,n=e.shouldRetry;return{onError:(e,i)=>{let o=i.options,s=o.maxRetries||t,a=o.retryDelay||r,u=o.shouldRetry||n,c=o.attemptNumber||0;if(isStream(o.body)||!u(e,c,o)||c>=s)return e;let l=Object.assign({},i,{options:Object.assign({},o,{attemptNumber:c+1})});return setTimeout(()=>i.channels.request.publish(l),a(c)),null}}};function getRetryDelay(e){return 100*Math.pow(2,e)+100*Math.random()}let retry=(e={})=>sharedRetry({shouldRetry:defaultShouldRetry,...e});retry.shouldRetry=defaultShouldRetry;var R=r(70655);function isFunction(e){return"function"==typeof e}function createErrorClass(e){var t=e(function(e){Error.call(e),e.stack=Error().stack});return t.prototype=Object.create(Error.prototype),t.prototype.constructor=t,t}var D=createErrorClass(function(e){return function(t){e(this),this.message=t?t.length+" errors occurred during unsubscription:\n"+t.map(function(e,t){return t+1+") "+e.toString()}).join("\n "):"",this.name="UnsubscriptionError",this.errors=t}});function arrRemove(e,t){if(e){var r=e.indexOf(t);0<=r&&e.splice(r,1)}}var j=function(){var e;function Subscription(e){this.initialTeardown=e,this.closed=!1,this._parentage=null,this._finalizers=null}return Subscription.prototype.unsubscribe=function(){if(!this.closed){this.closed=!0;var e,t,r,n,i,o=this._parentage;if(o){if(this._parentage=null,Array.isArray(o))try{for(var s=(0,R.XA)(o),a=s.next();!a.done;a=s.next())a.value.remove(this)}catch(t){e={error:t}}finally{try{a&&!a.done&&(t=s.return)&&t.call(s)}finally{if(e)throw e.error}}else o.remove(this)}var u=this.initialTeardown;if(isFunction(u))try{u()}catch(e){i=e instanceof D?e.errors:[e]}var c=this._finalizers;if(c){this._finalizers=null;try{for(var l=(0,R.XA)(c),f=l.next();!f.done;f=l.next()){var p=f.value;try{execFinalizer(p)}catch(e){i=null!=i?i:[],e instanceof D?i=(0,R.ev)((0,R.ev)([],(0,R.CR)(i)),(0,R.CR)(e.errors)):i.push(e)}}}catch(e){r={error:e}}finally{try{f&&!f.done&&(n=l.return)&&n.call(l)}finally{if(r)throw r.error}}}if(i)throw new D(i)}},Subscription.prototype.add=function(e){var t;if(e&&e!==this){if(this.closed)execFinalizer(e);else{if(e instanceof Subscription){if(e.closed||e._hasParent(this))return;e._addParent(this)}(this._finalizers=null!==(t=this._finalizers)&&void 0!==t?t:[]).push(e)}}},Subscription.prototype._hasParent=function(e){var t=this._parentage;return t===e||Array.isArray(t)&&t.includes(e)},Subscription.prototype._addParent=function(e){var t=this._parentage;this._parentage=Array.isArray(t)?(t.push(e),t):t?[t,e]:e},Subscription.prototype._removeParent=function(e){var t=this._parentage;t===e?this._parentage=null:Array.isArray(t)&&arrRemove(t,e)},Subscription.prototype.remove=function(e){var t=this._finalizers;t&&arrRemove(t,e),e instanceof Subscription&&e._removeParent(this)},Subscription.EMPTY=((e=new Subscription).closed=!0,e),Subscription}();function isSubscription(e){return e instanceof j||e&&"closed"in e&&isFunction(e.remove)&&isFunction(e.add)&&isFunction(e.unsubscribe)}function execFinalizer(e){isFunction(e)?e():e.unsubscribe()}j.EMPTY;var P={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1},U={setTimeout:function(e,t){for(var r=[],n=2;nt in e?ee(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,__publicField$3=(e,t,r)=>(__defNormalProp$3(e,"symbol"!=typeof t?t+"":t,r),r);let ClientError=class ClientError extends Error{constructor(e){let t=extractErrorProps(e);super(t.message),__publicField$3(this,"response"),__publicField$3(this,"statusCode",400),__publicField$3(this,"responseBody"),__publicField$3(this,"details"),Object.assign(this,t)}};let ServerError=class ServerError extends Error{constructor(e){let t=extractErrorProps(e);super(t.message),__publicField$3(this,"response"),__publicField$3(this,"statusCode",500),__publicField$3(this,"responseBody"),__publicField$3(this,"details"),Object.assign(this,t)}};function extractErrorProps(e){let t=e.body,r={response:e,statusCode:e.statusCode,responseBody:-1!==(e.headers["content-type"]||"").toLowerCase().indexOf("application/json")?JSON.stringify(t,null,2):t,message:"",details:void 0};if(t.error&&t.message)return r.message=`${t.error} - ${t.message}`,r;if(index_browser_isPlainObject(t)&&index_browser_isPlainObject(t.error)&&"mutationError"===t.error.type&&"string"==typeof t.error.description){let e=t.error.items||[],n=e.slice(0,5).map(e=>{var t;return null==(t=e.error)?void 0:t.description}).filter(Boolean),i=n.length?`: - ${n.join(` - `)}`:"";return e.length>5&&(i+=` ...and ${e.length-5} more`),r.message=`${t.error.description}${i}`,r.details=t.error,r}return t.error&&t.error.description?(r.message=t.error.description,r.details=t.error):r.message=t.error||t.message||function(e){let t=e.statusMessage?` ${e.statusMessage}`:"";return`${e.method}-request to ${e.url} resulted in HTTP ${e.statusCode}${t}`}(e),r}function index_browser_isPlainObject(e){return"object"==typeof e&&null!==e&&!Array.isArray(e)}let et={onResponse:e=>{if(e.statusCode>=500)throw new ServerError(e);if(e.statusCode>=400)throw new ClientError(e);return e}},er={onResponse:e=>{let t=e.headers["x-sanity-warning"];return(Array.isArray(t)?t:[t]).filter(Boolean).forEach(e=>console.warn(e)),e}};function shouldRetry(e,t,r){if(0===r.maxRetries)return!1;let n="GET"===r.method||"HEAD"===r.method,i=(r.uri||r.url).startsWith("/data/query"),o=e.response&&(429===e.response.statusCode||502===e.response.statusCode||503===e.response.statusCode);return(!!n||!!i)&&!!o||retry.shouldRetry(e,t,r)}function getSelection(e){if("string"==typeof e)return{id:e};if(Array.isArray(e))return{query:"*[_id in $ids]",params:{ids:e}};if("object"==typeof e&&null!==e&&"query"in e&&"string"==typeof e.query)return"params"in e&&"object"==typeof e.params&&null!==e.params?{query:e.query,params:e.params}:{query:e.query};let t=["* Document ID ()","* Array of document IDs","* Object containing `query`"].join(` `);throw Error(`Unknown selection - must be one of: ${t}`)}let en=["image","file"],ei=["before","after","replace"],dataset=e=>{if(!/^(~[a-z0-9]{1}[-\w]{0,63}|[a-z0-9]{1}[-\w]{0,63})$/.test(e))throw Error("Datasets can only contain lowercase characters, numbers, underscores and dashes, and start with tilde, and be maximum 64 characters")},projectId=e=>{if(!/^[-a-z0-9]+$/i.test(e))throw Error("`projectId` can only contain only a-z, 0-9 and dashes")},validateAssetType=e=>{if(-1===en.indexOf(e))throw Error(`Invalid asset type: ${e}. Must be one of ${en.join(", ")}`)},validateObject=(e,t)=>{if(null===t||"object"!=typeof t||Array.isArray(t))throw Error(`${e}() takes an object of properties`)},validateDocumentId=(e,t)=>{if("string"!=typeof t||!/^[a-z0-9_][a-z0-9_.-]{0,127}$/i.test(t)||t.includes(".."))throw Error(`${e}(): "${t}" is not a valid document ID`)},requireDocumentId=(e,t)=>{if(!t._id)throw Error(`${e}() requires that the document contains an ID ("_id" property)`);validateDocumentId(e,t._id)},validateInsert=(e,t,r)=>{let n="insert(at, selector, items)";if(-1===ei.indexOf(e)){let e=ei.map(e=>`"${e}"`).join(", ");throw Error(`${n} takes an "at"-argument which is one of: ${e}`)}if("string"!=typeof t)throw Error(`${n} takes a "selector"-argument which must be a string`);if(!Array.isArray(r))throw Error(`${n} takes an "items"-argument which must be an array`)},hasDataset=e=>{if(!e.dataset)throw Error("`dataset` must be provided to perform queries");return e.dataset||""},requestTag=e=>{if("string"!=typeof e||!/^[a-z0-9._-]{1,75}$/i.test(e))throw Error("Tag can only contain alphanumeric characters, underscores, dashes and dots, and be between one and 75 characters long.");return e};var eo=Object.defineProperty,__defNormalProp$2=(e,t,r)=>t in e?eo(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,__publicField$2=(e,t,r)=>(__defNormalProp$2(e,"symbol"!=typeof t?t+"":t,r),r),__accessCheck$7=(e,t,r)=>{if(!t.has(e))throw TypeError("Cannot "+r)},__privateGet$7=(e,t,r)=>(__accessCheck$7(e,t,"read from private field"),r?r.call(e):t.get(e)),__privateAdd$7=(e,t,r)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,r)},__privateSet$7=(e,t,r,n)=>(__accessCheck$7(e,t,"write to private field"),t.set(e,r),r);let BasePatch=class BasePatch{constructor(e,t={}){__publicField$2(this,"selection"),__publicField$2(this,"operations"),this.selection=e,this.operations=t}set(e){return this._assign("set",e)}setIfMissing(e){return this._assign("setIfMissing",e)}diffMatchPatch(e){return validateObject("diffMatchPatch",e),this._assign("diffMatchPatch",e)}unset(e){if(!Array.isArray(e))throw Error("unset(attrs) takes an array of attributes to unset, non-array given");return this.operations=Object.assign({},this.operations,{unset:e}),this}inc(e){return this._assign("inc",e)}dec(e){return this._assign("dec",e)}insert(e,t,r){return validateInsert(e,t,r),this._assign("insert",{[e]:t,items:r})}append(e,t){return this.insert("after",`${e}[-1]`,t)}prepend(e,t){return this.insert("before",`${e}[0]`,t)}splice(e,t,r,n){let i=t<0?t-1:t,o=typeof r>"u"||-1===r?-1:Math.max(0,t+r),s=i<0&&o>=0?"":o,a=`${e}[${i}:${s}]`;return this.insert("replace",a,n||[])}ifRevisionId(e){return this.operations.ifRevisionID=e,this}serialize(){return{...getSelection(this.selection),...this.operations}}toJSON(){return this.serialize()}reset(){return this.operations={},this}_assign(e,t,r=!0){return validateObject(e,t),this.operations=Object.assign({},this.operations,{[e]:Object.assign({},r&&this.operations[e]||{},t)}),this}_set(e,t){return this._assign(e,t,!1)}};let es=class _ObservablePatch2 extends BasePatch{constructor(e,t,r){super(e,t),__privateAdd$7(this,e_,void 0),__privateSet$7(this,e_,r)}clone(){return new _ObservablePatch2(this.selection,{...this.operations},__privateGet$7(this,e_))}commit(e){if(!__privateGet$7(this,e_))throw Error("No `client` passed to patch, either provide one or pass the patch to a clients `mutate()` method");let t="string"==typeof this.selection,r=Object.assign({returnFirst:t,returnDocuments:!0},e);return __privateGet$7(this,e_).mutate({patch:this.serialize()},r)}};e_=new WeakMap;let ea=class _Patch2 extends BasePatch{constructor(e,t,r){super(e,t),__privateAdd$7(this,em,void 0),__privateSet$7(this,em,r)}clone(){return new _Patch2(this.selection,{...this.operations},__privateGet$7(this,em))}commit(e){if(!__privateGet$7(this,em))throw Error("No `client` passed to patch, either provide one or pass the patch to a clients `mutate()` method");let t="string"==typeof this.selection,r=Object.assign({returnFirst:t,returnDocuments:!0},e);return __privateGet$7(this,em).mutate({patch:this.serialize()},r)}};em=new WeakMap;var eu=Object.defineProperty,index_browser_defNormalProp$1=(e,t,r)=>t in e?eu(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,index_browser_publicField$1=(e,t,r)=>(index_browser_defNormalProp$1(e,"symbol"!=typeof t?t+"":t,r),r),__accessCheck$6=(e,t,r)=>{if(!t.has(e))throw TypeError("Cannot "+r)},__privateGet$6=(e,t,r)=>(__accessCheck$6(e,t,"read from private field"),r?r.call(e):t.get(e)),__privateAdd$6=(e,t,r)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,r)},__privateSet$6=(e,t,r,n)=>(__accessCheck$6(e,t,"write to private field"),t.set(e,r),r);let ec={returnDocuments:!1};let BaseTransaction=class BaseTransaction{constructor(e=[],t){index_browser_publicField$1(this,"operations"),index_browser_publicField$1(this,"trxId"),this.operations=e,this.trxId=t}create(e){return validateObject("create",e),this._add({create:e})}createIfNotExists(e){let t="createIfNotExists";return validateObject(t,e),requireDocumentId(t,e),this._add({[t]:e})}createOrReplace(e){let t="createOrReplace";return validateObject(t,e),requireDocumentId(t,e),this._add({[t]:e})}delete(e){return validateDocumentId("delete",e),this._add({delete:{id:e}})}transactionId(e){return e?(this.trxId=e,this):this.trxId}serialize(){return[...this.operations]}toJSON(){return this.serialize()}reset(){return this.operations=[],this}_add(e){return this.operations.push(e),this}};let el=class _Transaction2 extends BaseTransaction{constructor(e,t,r){super(e,r),__privateAdd$6(this,ew,void 0),__privateSet$6(this,ew,t)}clone(){return new _Transaction2([...this.operations],__privateGet$6(this,ew),this.trxId)}commit(e){if(!__privateGet$6(this,ew))throw Error("No `client` passed to transaction, either provide one or pass the transaction to a clients `mutate()` method");return __privateGet$6(this,ew).mutate(this.serialize(),Object.assign({transactionId:this.trxId},ec,e||{}))}patch(e,t){if("string"!=typeof e&&e instanceof ea)return this._add({patch:e.serialize()});if("function"==typeof t){let r=t(new ea(e,{},__privateGet$6(this,ew)));if(!(r instanceof ea))throw Error("function passed to `patch()` must return the patch");return this._add({patch:r.serialize()})}return this._add({patch:{id:e,...t}})}};ew=new WeakMap;let ef=class _ObservableTransaction2 extends BaseTransaction{constructor(e,t,r){super(e,r),__privateAdd$6(this,eC,void 0),__privateSet$6(this,eC,t)}clone(){return new _ObservableTransaction2([...this.operations],__privateGet$6(this,eC),this.trxId)}commit(e){if(!__privateGet$6(this,eC))throw Error("No `client` passed to transaction, either provide one or pass the transaction to a clients `mutate()` method");return __privateGet$6(this,eC).mutate(this.serialize(),Object.assign({transactionId:this.trxId},ec,e||{}))}patch(e,t){if("string"!=typeof e&&e instanceof es)return this._add({patch:e.serialize()});if("function"==typeof t){let r=t(new es(e,{},__privateGet$6(this,eC)));if(!(r instanceof es))throw Error("function passed to `patch()` must return the patch");return this._add({patch:r.serialize()})}return this._add({patch:{id:e,...t}})}};function generateHelpUrl(e){return"https://www.sanity.io/help/"+e}eC=new WeakMap;let createWarningPrinter=e=>{var t;let r,n;return t=(...t)=>console.warn(e.join(" "),...t),r=!1,(...e)=>(r||(n=t(...e),r=!0),n)},ep=createWarningPrinter(["Since you haven't set a value for `useCdn`, we will deliver content using our","global, edge-cached API-CDN. If you wish to have content delivered faster, set","`useCdn: false` to use the Live API. Note: You may incur higher costs using the live API."]),eh=createWarningPrinter(["The Sanity client is configured with the `perspective` set to `previewDrafts`, which doesn't support the API-CDN.","The Live API will be used instead. Set `useCdn: false` in your configuration to hide this warning."]),ed=createWarningPrinter(["You have configured Sanity client to use a token in the browser. This may cause unintentional security issues.",`See ${generateHelpUrl("js-client-browser-token")} for more information and how to hide this warning.`]),eb=createWarningPrinter(["Using the Sanity client without specifying an API version is deprecated.",`See ${generateHelpUrl("js-client-api-version")}`]),ey=(createWarningPrinter(["The default export of @sanity/client has been deprecated. Use the named export `createClient` instead."]),{apiHost:"https://api.sanity.io",apiVersion:"1",useProjectHostname:!0,stega:{enabled:!1}}),ev=["localhost","127.0.0.1","0.0.0.0"],isLocal=e=>-1!==ev.indexOf(e),validateApiPerspective=function(e){switch(e){case"previewDrafts":case"published":case"raw":return;default:throw TypeError("Invalid API perspective string, expected `published`, `previewDrafts` or `raw`")}},initConfig=(e,t)=>{let r={...t,...e,stega:{..."boolean"==typeof t.stega?{enabled:t.stega}:t.stega||ey.stega,..."boolean"==typeof e.stega?{enabled:e.stega}:e.stega||{}}};r.apiVersion||eb();let n={...ey,...r},i=n.useProjectHostname;if(typeof Promise>"u"){let e=generateHelpUrl("js-client-promise-polyfill");throw Error(`No native Promise-implementation found, polyfill needed - see ${e}`)}if(i&&!n.projectId)throw Error("Configuration must contain `projectId`");if("string"==typeof n.perspective&&validateApiPerspective(n.perspective),"encodeSourceMap"in n)throw Error("It looks like you're using options meant for '@sanity/preview-kit/client'. 'encodeSourceMap' is not supported in '@sanity/client'. Did you mean 'stega.enabled'?");if("encodeSourceMapAtPath"in n)throw Error("It looks like you're using options meant for '@sanity/preview-kit/client'. 'encodeSourceMapAtPath' is not supported in '@sanity/client'. Did you mean 'stega.filter'?");if("boolean"!=typeof n.stega.enabled)throw Error(`stega.enabled must be a boolean, received ${n.stega.enabled}`);if(n.stega.enabled&&void 0===n.stega.studioUrl)throw Error("stega.studioUrl must be defined when stega.enabled is true");if(n.stega.enabled&&"string"!=typeof n.stega.studioUrl&&"function"!=typeof n.stega.studioUrl)throw Error(`stega.studioUrl must be a string or a function, received ${n.stega.studioUrl}`);let o="u">typeof window&&window.location&&window.location.hostname,s=o&&isLocal(window.location.hostname);o&&s&&n.token&&!0!==n.ignoreBrowserTokenWarning?ed():typeof n.useCdn>"u"&&ep(),i&&projectId(n.projectId),n.dataset&&dataset(n.dataset),"requestTagPrefix"in n&&(n.requestTagPrefix=n.requestTagPrefix?requestTag(n.requestTagPrefix).replace(/\.+$/,""):void 0),n.apiVersion=`${n.apiVersion}`.replace(/^v/,""),n.isDefaultApi=n.apiHost===ey.apiHost,n.useCdn=!1!==n.useCdn&&!n.withCredentials,function(e){if("1"===e||"X"===e)return;let t=new Date(e);if(!(/^\d{4}-\d{2}-\d{2}$/.test(e)&&t instanceof Date&&t.getTime()>0))throw Error("Invalid API version string, expected `1` or date in format `YYYY-MM-DD`")}(n.apiVersion);let a=n.apiHost.split("://",2),u=a[0],c=a[1],l=n.isDefaultApi?"apicdn.sanity.io":c;return n.useProjectHostname?(n.url=`${u}://${n.projectId}.${c}/v${n.apiVersion}`,n.cdnUrl=`${u}://${n.projectId}.${l}/v${n.apiVersion}`):(n.url=`${n.apiHost}/v${n.apiVersion}`,n.cdnUrl=n.url),n},encodeQueryString=({query:e,params:t={},options:r={}})=>{let n=new URLSearchParams,{tag:i,returnQuery:o,...s}=r;for(let[r,o]of(i&&n.append("tag",i),n.append("query",e),Object.entries(t)))n.append(`$${r}`,JSON.stringify(o));for(let[e,t]of Object.entries(s))t&&n.append(e,`${t}`);return!1===o&&n.append("returnQuery","false"),`?${n}`},excludeFalsey=(e,t)=>!1===e?void 0:typeof e>"u"?t:e,getMutationQuery=(e={})=>({dryRun:e.dryRun,returnIds:!0,returnDocuments:excludeFalsey(e.returnDocuments,!0),visibility:e.visibility||"sync",autoGenerateArrayKeys:e.autoGenerateArrayKeys,skipCrossDatasetReferenceValidation:e.skipCrossDatasetReferenceValidation}),isResponse=e=>"response"===e.type,getBody=e=>e.body,indexBy=(e,t)=>e.reduce((e,r)=>(e[t(r)]=r,e),Object.create(null));function _fetch(e,t,n,i,o={},s={}){let a="stega"in s?{...n||{},..."boolean"==typeof s.stega?{enabled:s.stega}:s.stega||{}}:n,u=a.enabled?(0,K.N)(o):o,c=!1===s.filterResponse?e=>e:e=>e.result,{cache:l,next:f,...p}={useAbortSignal:"u">typeof s.signal,resultSourceMap:a.enabled?"withKeyArraySelector":s.resultSourceMap,...s,returnQuery:!1===s.filterResponse&&!1!==s.returnQuery},h="u">typeof l||"u">typeof f?{...p,fetch:{cache:l,next:f}}:p,d=_dataRequest(e,t,"query",{query:i,params:u},h);return a.enabled?d.pipe(function(){for(var e=[],t=0;te))),map(([e,t])=>{let r=t(e.result,e.resultSourceMap,a);return c({...e,result:r})})):d.pipe(map(c))}function _getDocument(e,t,r,n={}){let i={uri:_getDataUrl(e,"doc",r),json:!0,tag:n.tag};return _requestObservable(e,t,i).pipe(filter(isResponse),map(e=>e.body.documents&&e.body.documents[0]))}function _getDocuments(e,t,r,n={}){let i={uri:_getDataUrl(e,"doc",r.join(",")),json:!0,tag:n.tag};return _requestObservable(e,t,i).pipe(filter(isResponse),map(e=>{let t=indexBy(e.body.documents||[],e=>e._id);return r.map(e=>t[e]||null)}))}function _createIfNotExists(e,t,r,n){return requireDocumentId("createIfNotExists",r),_create(e,t,r,"createIfNotExists",n)}function _createOrReplace(e,t,r,n){return requireDocumentId("createOrReplace",r),_create(e,t,r,"createOrReplace",n)}function _delete(e,t,r,n){return _dataRequest(e,t,"mutate",{mutations:[{delete:getSelection(r)}]},n)}function _mutate(e,t,r,n){let i;i=r instanceof ea||r instanceof es?{patch:r.serialize()}:r instanceof el||r instanceof ef?r.serialize():r;let o=Array.isArray(i)?i:[i],s=n&&n.transactionId||void 0;return _dataRequest(e,t,"mutate",{mutations:o,transactionId:s},n)}function _dataRequest(e,t,r,n,i={}){let o="mutate"===r,s="query"===r,a=o?"":encodeQueryString(n),u=!o&&a.length<11264,c=i.returnFirst,{timeout:l,token:f,tag:p,headers:h,returnQuery:d,lastLiveEventId:b}=i,y=_getDataUrl(e,r,u?a:""),v={method:u?"GET":"POST",uri:y,json:!0,body:u?void 0:n,query:o&&getMutationQuery(i),timeout:l,headers:h,token:f,tag:p,returnQuery:d,perspective:i.perspective,resultSourceMap:i.resultSourceMap,lastLiveEventId:Array.isArray(b)?b[0]:b,canUseCdn:s,signal:i.signal,fetch:i.fetch,useAbortSignal:i.useAbortSignal,useCdn:i.useCdn};return _requestObservable(e,t,v).pipe(filter(isResponse),map(getBody),map(e=>{if(!o)return e;let t=e.results||[];if(i.returnDocuments)return c?t[0]&&t[0].document:t.map(e=>e.document);let r=c?t[0]&&t[0].id:t.map(e=>e.id);return{transactionId:e.transactionId,results:t,[c?"documentId":"documentIds"]:r}}))}function _create(e,t,r,n,i={}){let o=Object.assign({returnFirst:!0,returnDocuments:!0},i);return _dataRequest(e,t,"mutate",{mutations:[{[n]:r}]},o)}function _requestObservable(e,t,r){var n,i,o;let s=r.url||r.uri,a=e.config(),u=typeof r.canUseCdn>"u"?["GET","HEAD"].indexOf(r.method||"GET")>=0&&0===s.indexOf("/data/"):r.canUseCdn,c=(null!=(n=r.useCdn)?n:a.useCdn)&&u,l=r.tag&&a.requestTagPrefix?[a.requestTagPrefix,r.tag].join("."):r.tag||a.requestTagPrefix;if(l&&null!==r.tag&&(r.query={tag:requestTag(l),...r.query}),["GET","HEAD","POST"].indexOf(r.method||"GET")>=0&&0===s.indexOf("/data/query/")){let e=null!=(i=r.resultSourceMap)?i:a.resultSourceMap;void 0!==e&&!1!==e&&(r.query={resultSourceMap:e,...r.query});let t=r.perspective||a.perspective;"string"==typeof t&&"raw"!==t&&(validateApiPerspective(t),r.query={perspective:t,...r.query},"previewDrafts"===t&&c&&(c=!1,eh())),r.lastLiveEventId&&(r.query={...r.query,lastLiveEventId:r.lastLiveEventId}),!1===r.returnQuery&&(r.query={returnQuery:"false",...r.query})}let f=function(e,t={}){let r={},n=t.token||e.token;n&&(r.Authorization=`Bearer ${n}`),t.useGlobalApi||e.useProjectHostname||!e.projectId||(r["X-Sanity-Project-ID"]=e.projectId);let i=!!(typeof t.withCredentials>"u"?e.token||e.withCredentials:t.withCredentials),o=typeof t.timeout>"u"?e.timeout:t.timeout;return Object.assign({},t,{headers:Object.assign({},r,t.headers||{}),timeout:typeof o>"u"?3e5:o,proxy:t.proxy||e.proxy,json:!0,withCredentials:i,fetch:"object"==typeof t.fetch&&"object"==typeof e.fetch?{...e.fetch,...t.fetch}:t.fetch||e.fetch})}(a,Object.assign({},r,{url:_getUrl(e,s,c)})),p=new V(e=>t(f,a.requester).subscribe(e));return r.signal?p.pipe((o=r.signal,e=>new V(t=>{let abort=()=>t.error(function(e){var t,r;if(eg)return new DOMException(null!=(t=null==e?void 0:e.reason)?t:"The operation was aborted.","AbortError");let n=Error(null!=(r=null==e?void 0:e.reason)?r:"The operation was aborted.");return n.name="AbortError",n}(o));if(o&&o.aborted){abort();return}let r=e.subscribe(t);return o.addEventListener("abort",abort),()=>{o.removeEventListener("abort",abort),r.unsubscribe()}}))):p}function _request(e,t,r){return _requestObservable(e,t,r).pipe(filter(e=>"response"===e.type),map(e=>e.body))}function _getDataUrl(e,t,r){let n=e.config(),i=hasDataset(n),o=`/${t}/${i}`;return`/data${r?`${o}/${r}`:o}`.replace(/\/($|\?)/,"$1")}function _getUrl(e,t,r=!1){let{url:n,cdnUrl:i}=e.config();return`${r?i:n}/${t.replace(/^\//,"")}`}let eg=!!globalThis.DOMException;var e_,em,ew,eC,eE,ex,__accessCheck$5=(e,t,r)=>{if(!t.has(e))throw TypeError("Cannot "+r)},__privateGet$5=(e,t,r)=>(__accessCheck$5(e,t,"read from private field"),r?r.call(e):t.get(e)),__privateAdd$5=(e,t,r)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,r)},__privateSet$5=(e,t,r,n)=>(__accessCheck$5(e,t,"write to private field"),t.set(e,r),r);let ObservableAssetsClient=class ObservableAssetsClient{constructor(e,t){__privateAdd$5(this,eE,void 0),__privateAdd$5(this,ex,void 0),__privateSet$5(this,eE,e),__privateSet$5(this,ex,t)}upload(e,t,r){return _upload(__privateGet$5(this,eE),__privateGet$5(this,ex),e,t,r)}};eE=new WeakMap,ex=new WeakMap;let AssetsClient=class AssetsClient{constructor(e,t){__privateAdd$5(this,eO,void 0),__privateAdd$5(this,eA,void 0),__privateSet$5(this,eO,e),__privateSet$5(this,eA,t)}upload(e,t,r){let n=_upload(__privateGet$5(this,eO),__privateGet$5(this,eA),e,t,r);return lastValueFrom(n.pipe(filter(e=>"response"===e.type),map(e=>e.body.document)))}};function _upload(e,t,r,n,i={}){validateAssetType(r);let o=i.extract||void 0;o&&!o.length&&(o=["none"]);let s=hasDataset(e.config()),a="image"===r?"images":"files",u=!(typeof File>"u")&&n instanceof File?Object.assign({filename:!1===i.preserveFilename?void 0:n.name,contentType:n.type},i):i,{tag:c,label:l,title:f,description:p,creditLine:h,filename:d,source:b}=u,y={label:l,title:f,description:p,filename:d,meta:o,creditLine:h};return b&&(y.sourceId=b.id,y.sourceName=b.name,y.sourceUrl=b.url),_requestObservable(e,t,{tag:c,method:"POST",timeout:u.timeout||0,uri:`/assets/${a}/${s}`,headers:u.contentType?{"Content-Type":u.contentType}:{},query:y,body:n})}eO=new WeakMap,eA=new WeakMap;var defaults=(e,t)=>Object.keys(t).concat(Object.keys(e)).reduce((r,n)=>(r[n]=typeof e[n]>"u"?t[n]:e[n],r),{});let pick=(e,t)=>t.reduce((t,r)=>(typeof e[r]>"u"||(t[r]=e[r]),t),{}),eS=["includePreviousRevision","includeResult","visibility","effectFormat","tag"],e$={includeResult:!0};function _listen(e,t,n={}){let{url:i,token:o,withCredentials:s,requestTagPrefix:a}=this.config(),u=n.tag&&a?[a,n.tag].join("."):n.tag,c={...defaults(n,e$),tag:u},l=pick(c,eS),f=encodeQueryString({query:e,params:t,options:{tag:u,...l}}),p=`${i}${_getDataUrl(this,"listen",f)}`;if(p.length>14800)return new V(e=>e.error(Error("Query too large for listener")));let h=c.events?c.events:["mutation"],d=-1!==h.indexOf("reconnect"),b={};return(o||s)&&(b.withCredentials=!0),o&&(b.headers={Authorization:`Bearer ${o}`}),new V(e=>{let t,n,i=!1,o=!1;function onError(){i||(d&&e.next({type:"reconnect"}),i||t.readyState!==t.CLOSED||(unsubscribe(),clearTimeout(n),n=setTimeout(open,100)))}function onChannelError(t){e.error(function(e){if(e instanceof Error)return e;let t=parseEvent$1(e);return t instanceof Error?t:Error(t.error?t.error.description?t.error.description:"string"==typeof t.error?t.error:JSON.stringify(t.error,null,2):t.message||"Unknown listener error")}(t))}function onMessage(t){let r=parseEvent$1(t);return r instanceof Error?e.error(r):e.next(r)}function onDisconnect(){i=!0,unsubscribe(),e.complete()}function unsubscribe(){t&&(t.removeEventListener("error",onError),t.removeEventListener("channelError",onChannelError),t.removeEventListener("disconnect",onDisconnect),h.forEach(e=>t.removeEventListener(e,onMessage)),t.close())}async function getEventSource(){let{default:e}=await r.e(3699).then(r.t.bind(r,33699,19));if(o)return;let t=new e(p,b);return t.addEventListener("error",onError),t.addEventListener("channelError",onChannelError),t.addEventListener("disconnect",onDisconnect),h.forEach(e=>t.addEventListener(e,onMessage)),t}function open(){getEventSource().then(e=>{e&&(t=e,o&&unsubscribe())}).catch(t=>{e.error(t),stop()})}function stop(){i=!0,unsubscribe(),o=!0}return open(),stop})}function parseEvent$1(e){try{let t=e.data&&JSON.parse(e.data)||{};return Object.assign({type:e.type},t)}catch(e){return e}}var eO,eA,eB,__accessCheck$4=(e,t,r)=>{if(!t.has(e))throw TypeError("Cannot "+r)},__privateGet$4=(e,t,r)=>(__accessCheck$4(e,t,"read from private field"),r?r.call(e):t.get(e)),__privateAdd$4=(e,t,r)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,r)},__privateSet$4=(e,t,r,n)=>(__accessCheck$4(e,t,"write to private field"),t.set(e,r),r);let LiveClient=class LiveClient{constructor(e){__privateAdd$4(this,eB,void 0),__privateSet$4(this,eB,e)}events(){let e=_getDataUrl(__privateGet$4(this,eB),"live/events"),t=new URL(__privateGet$4(this,eB).getUrl(e,!1)),n=["restart","message"];return new V(e=>{let i,o,s=!1,a=!1;function onError(t){if(!s){if("data"in t){let r=parseEvent(t);e.error(Error(r.message,{cause:r}))}i.readyState===i.CLOSED&&(unsubscribe(),clearTimeout(o),o=setTimeout(open,100))}}function onMessage(t){let r=parseEvent(t);return r instanceof Error?e.error(r):e.next(r)}function unsubscribe(){if(i){for(let e of(i.removeEventListener("error",onError),n))i.removeEventListener(e,onMessage);i.close()}}async function getEventSource(){let e=typeof EventSource>"u"?(await r.e(3699).then(r.t.bind(r,33699,19))).default:EventSource;if(a)return;let i=new e(t.toString());for(let e of(i.addEventListener("error",onError),n))i.addEventListener(e,onMessage);return i}function open(){getEventSource().then(e=>{e&&(i=e,a&&unsubscribe())}).catch(t=>{e.error(t),stop()})}function stop(){s=!0,unsubscribe(),a=!0}return open(),stop})}};function parseEvent(e){try{let t=e.data&&JSON.parse(e.data)||{};return{type:e.type,id:e.lastEventId,...t}}catch(e){return e}}eB=new WeakMap;var eT,ek,__accessCheck$3=(e,t,r)=>{if(!t.has(e))throw TypeError("Cannot "+r)},__privateGet$3=(e,t,r)=>(__accessCheck$3(e,t,"read from private field"),r?r.call(e):t.get(e)),__privateAdd$3=(e,t,r)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,r)},__privateSet$3=(e,t,r,n)=>(__accessCheck$3(e,t,"write to private field"),t.set(e,r),r);let ObservableDatasetsClient=class ObservableDatasetsClient{constructor(e,t){__privateAdd$3(this,eT,void 0),__privateAdd$3(this,ek,void 0),__privateSet$3(this,eT,e),__privateSet$3(this,ek,t)}create(e,t){return _modify(__privateGet$3(this,eT),__privateGet$3(this,ek),"PUT",e,t)}edit(e,t){return _modify(__privateGet$3(this,eT),__privateGet$3(this,ek),"PATCH",e,t)}delete(e){return _modify(__privateGet$3(this,eT),__privateGet$3(this,ek),"DELETE",e)}list(){return _request(__privateGet$3(this,eT),__privateGet$3(this,ek),{uri:"/datasets",tag:null})}};eT=new WeakMap,ek=new WeakMap;let DatasetsClient=class DatasetsClient{constructor(e,t){__privateAdd$3(this,eI,void 0),__privateAdd$3(this,eF,void 0),__privateSet$3(this,eI,e),__privateSet$3(this,eF,t)}create(e,t){return lastValueFrom(_modify(__privateGet$3(this,eI),__privateGet$3(this,eF),"PUT",e,t))}edit(e,t){return lastValueFrom(_modify(__privateGet$3(this,eI),__privateGet$3(this,eF),"PATCH",e,t))}delete(e){return lastValueFrom(_modify(__privateGet$3(this,eI),__privateGet$3(this,eF),"DELETE",e))}list(){return lastValueFrom(_request(__privateGet$3(this,eI),__privateGet$3(this,eF),{uri:"/datasets",tag:null}))}};function _modify(e,t,r,n,i){return dataset(n),_request(e,t,{method:r,uri:`/datasets/${n}`,body:i,tag:null})}eI=new WeakMap,eF=new WeakMap;var eI,eF,eR,eD,__accessCheck$2=(e,t,r)=>{if(!t.has(e))throw TypeError("Cannot "+r)},__privateGet$2=(e,t,r)=>(__accessCheck$2(e,t,"read from private field"),r?r.call(e):t.get(e)),__privateAdd$2=(e,t,r)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,r)},__privateSet$2=(e,t,r,n)=>(__accessCheck$2(e,t,"write to private field"),t.set(e,r),r);let ObservableProjectsClient=class ObservableProjectsClient{constructor(e,t){__privateAdd$2(this,eR,void 0),__privateAdd$2(this,eD,void 0),__privateSet$2(this,eR,e),__privateSet$2(this,eD,t)}list(e){let t=(null==e?void 0:e.includeMembers)===!1?"/projects?includeMembers=false":"/projects";return _request(__privateGet$2(this,eR),__privateGet$2(this,eD),{uri:t})}getById(e){return _request(__privateGet$2(this,eR),__privateGet$2(this,eD),{uri:`/projects/${e}`})}};eR=new WeakMap,eD=new WeakMap;let ProjectsClient=class ProjectsClient{constructor(e,t){__privateAdd$2(this,ej,void 0),__privateAdd$2(this,eP,void 0),__privateSet$2(this,ej,e),__privateSet$2(this,eP,t)}list(e){let t=(null==e?void 0:e.includeMembers)===!1?"/projects?includeMembers=false":"/projects";return lastValueFrom(_request(__privateGet$2(this,ej),__privateGet$2(this,eP),{uri:t}))}getById(e){return lastValueFrom(_request(__privateGet$2(this,ej),__privateGet$2(this,eP),{uri:`/projects/${e}`}))}};ej=new WeakMap,eP=new WeakMap;var ej,eP,eU,eG,__accessCheck$1=(e,t,r)=>{if(!t.has(e))throw TypeError("Cannot "+r)},__privateGet$1=(e,t,r)=>(__accessCheck$1(e,t,"read from private field"),r?r.call(e):t.get(e)),__privateAdd$1=(e,t,r)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,r)},__privateSet$1=(e,t,r,n)=>(__accessCheck$1(e,t,"write to private field"),t.set(e,r),r);let ObservableUsersClient=class ObservableUsersClient{constructor(e,t){__privateAdd$1(this,eU,void 0),__privateAdd$1(this,eG,void 0),__privateSet$1(this,eU,e),__privateSet$1(this,eG,t)}getById(e){return _request(__privateGet$1(this,eU),__privateGet$1(this,eG),{uri:`/users/${e}`})}};eU=new WeakMap,eG=new WeakMap;let UsersClient=class UsersClient{constructor(e,t){__privateAdd$1(this,eq,void 0),__privateAdd$1(this,eL,void 0),__privateSet$1(this,eq,e),__privateSet$1(this,eL,t)}getById(e){return lastValueFrom(_request(__privateGet$1(this,eq),__privateGet$1(this,eL),{uri:`/users/${e}`}))}};eq=new WeakMap,eL=new WeakMap;var eq,eL,eM,eN,ez=Object.defineProperty,index_browser_defNormalProp=(e,t,r)=>t in e?ez(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,index_browser_publicField=(e,t,r)=>(index_browser_defNormalProp(e,"symbol"!=typeof t?t+"":t,r),r),index_browser_accessCheck=(e,t,r)=>{if(!t.has(e))throw TypeError("Cannot "+r)},index_browser_privateGet=(e,t,r)=>(index_browser_accessCheck(e,t,"read from private field"),r?r.call(e):t.get(e)),index_browser_privateAdd=(e,t,r)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,r)},index_browser_privateSet=(e,t,r,n)=>(index_browser_accessCheck(e,t,"write to private field"),t.set(e,r),r);let eW=class _ObservableSanityClient2{constructor(e,t=ey){index_browser_publicField(this,"assets"),index_browser_publicField(this,"datasets"),index_browser_publicField(this,"live"),index_browser_publicField(this,"projects"),index_browser_publicField(this,"users"),index_browser_privateAdd(this,eM,void 0),index_browser_privateAdd(this,eN,void 0),index_browser_publicField(this,"listen",_listen),this.config(t),index_browser_privateSet(this,eN,e),this.assets=new ObservableAssetsClient(this,index_browser_privateGet(this,eN)),this.datasets=new ObservableDatasetsClient(this,index_browser_privateGet(this,eN)),this.live=new LiveClient(this),this.projects=new ObservableProjectsClient(this,index_browser_privateGet(this,eN)),this.users=new ObservableUsersClient(this,index_browser_privateGet(this,eN))}clone(){return new _ObservableSanityClient2(index_browser_privateGet(this,eN),this.config())}config(e){if(void 0===e)return{...index_browser_privateGet(this,eM)};if(index_browser_privateGet(this,eM)&&!1===index_browser_privateGet(this,eM).allowReconfigure)throw Error("Existing client instance cannot be reconfigured - use `withConfig(newConfig)` to return a new client");return index_browser_privateSet(this,eM,initConfig(e,index_browser_privateGet(this,eM)||{})),this}withConfig(e){let t=this.config();return new _ObservableSanityClient2(index_browser_privateGet(this,eN),{...t,...e,stega:{...t.stega||{},..."boolean"==typeof(null==e?void 0:e.stega)?{enabled:e.stega}:(null==e?void 0:e.stega)||{}}})}fetch(e,t,r){return _fetch(this,index_browser_privateGet(this,eN),index_browser_privateGet(this,eM).stega,e,t,r)}getDocument(e,t){return _getDocument(this,index_browser_privateGet(this,eN),e,t)}getDocuments(e,t){return _getDocuments(this,index_browser_privateGet(this,eN),e,t)}create(e,t){return _create(this,index_browser_privateGet(this,eN),e,"create",t)}createIfNotExists(e,t){return _createIfNotExists(this,index_browser_privateGet(this,eN),e,t)}createOrReplace(e,t){return _createOrReplace(this,index_browser_privateGet(this,eN),e,t)}delete(e,t){return _delete(this,index_browser_privateGet(this,eN),e,t)}mutate(e,t){return _mutate(this,index_browser_privateGet(this,eN),e,t)}patch(e,t){return new es(e,t,this)}transaction(e){return new ef(e,this)}request(e){return _request(this,index_browser_privateGet(this,eN),e)}getUrl(e,t){return _getUrl(this,e,t)}getDataUrl(e,t){return _getDataUrl(this,e,t)}};eM=new WeakMap,eN=new WeakMap;let eH=class _SanityClient2{constructor(e,t=ey){index_browser_publicField(this,"assets"),index_browser_publicField(this,"datasets"),index_browser_publicField(this,"live"),index_browser_publicField(this,"projects"),index_browser_publicField(this,"users"),index_browser_publicField(this,"observable"),index_browser_privateAdd(this,c,void 0),index_browser_privateAdd(this,l,void 0),index_browser_publicField(this,"listen",_listen),this.config(t),index_browser_privateSet(this,l,e),this.assets=new AssetsClient(this,index_browser_privateGet(this,l)),this.datasets=new DatasetsClient(this,index_browser_privateGet(this,l)),this.live=new LiveClient(this),this.projects=new ProjectsClient(this,index_browser_privateGet(this,l)),this.users=new UsersClient(this,index_browser_privateGet(this,l)),this.observable=new eW(e,t)}clone(){return new _SanityClient2(index_browser_privateGet(this,l),this.config())}config(e){if(void 0===e)return{...index_browser_privateGet(this,c)};if(index_browser_privateGet(this,c)&&!1===index_browser_privateGet(this,c).allowReconfigure)throw Error("Existing client instance cannot be reconfigured - use `withConfig(newConfig)` to return a new client");return this.observable&&this.observable.config(e),index_browser_privateSet(this,c,initConfig(e,index_browser_privateGet(this,c)||{})),this}withConfig(e){let t=this.config();return new _SanityClient2(index_browser_privateGet(this,l),{...t,...e,stega:{...t.stega||{},..."boolean"==typeof(null==e?void 0:e.stega)?{enabled:e.stega}:(null==e?void 0:e.stega)||{}}})}fetch(e,t,r){return lastValueFrom(_fetch(this,index_browser_privateGet(this,l),index_browser_privateGet(this,c).stega,e,t,r))}getDocument(e,t){return lastValueFrom(_getDocument(this,index_browser_privateGet(this,l),e,t))}getDocuments(e,t){return lastValueFrom(_getDocuments(this,index_browser_privateGet(this,l),e,t))}create(e,t){return lastValueFrom(_create(this,index_browser_privateGet(this,l),e,"create",t))}createIfNotExists(e,t){return lastValueFrom(_createIfNotExists(this,index_browser_privateGet(this,l),e,t))}createOrReplace(e,t){return lastValueFrom(_createOrReplace(this,index_browser_privateGet(this,l),e,t))}delete(e,t){return lastValueFrom(_delete(this,index_browser_privateGet(this,l),e,t))}mutate(e,t){return lastValueFrom(_mutate(this,index_browser_privateGet(this,l),e,t))}patch(e,t){return new ea(e,t,this)}transaction(e){return new el(e,this)}request(e){return lastValueFrom(_request(this,index_browser_privateGet(this,l),e))}dataRequest(e,t,r){return lastValueFrom(_dataRequest(this,index_browser_privateGet(this,l),e,t,r))}getUrl(e,t){return _getUrl(this,e,t)}getDataUrl(e,t){return _getDataUrl(this,e,t)}};c=new WeakMap,l=new WeakMap;let eV=function(e,t){var r;let n=getIt([retry({shouldRetry}),...e,er,{processOptions:e=>{let t=e.body;return t&&"function"!=typeof t.pipe&&!A(t)&&(-1!==B.indexOf(typeof t)||Array.isArray(t)||function(e){if(!1===isObject(e))return!1;let t=e.constructor;if(void 0===t)return!0;let r=t.prototype;return!(!1===isObject(r)||!1===r.hasOwnProperty("isPrototypeOf"))}(t))?Object.assign({},e,{body:JSON.stringify(e.body),headers:Object.assign({},e.headers,{"Content-Type":"application/json"})}):e}},{onResponse:e=>{let t=e.headers["content-type"]||"",n=r&&r.force||-1!==t.indexOf("application/json");return e.body&&t&&n?Object.assign({},e,{body:function(e){try{return JSON.parse(e)}catch(e){throw e.message=`Failed to parsed response body as JSON: ${e.message}`,e}}(e.body)}):e},processOptions:e=>Object.assign({},e,{headers:Object.assign({Accept:"application/json"},e.headers)})},{onRequest:e=>{if("xhr"!==e.adapter)return;let t=e.request,r=e.context;function handleProgress(e){return t=>{let n=t.lengthComputable?t.loaded/t.total*100:-1;r.channels.progress.publish({stage:e,percent:n,total:t.total,loaded:t.loaded,lengthComputable:t.lengthComputable})}}"upload"in t&&"onprogress"in t.upload&&(t.upload.onprogress=handleProgress("upload")),"onprogress"in t&&(t.onprogress=handleProgress("download"))}},et,function(e={}){let t=e.implementation||k.Observable;if(!t)throw Error("`Observable` is not available in global scope, and no implementation was passed");return{onReturn:(e,r)=>new t(t=>(e.error.subscribe(e=>t.error(e)),e.progress.subscribe(e=>t.next(Object.assign({type:"progress"},e))),e.response.subscribe(e=>{t.next(Object.assign({type:"response"},e)),t.complete()}),e.request.publish(r),()=>e.abort.publish()))}}({implementation:V})]);return{requester:n,createClient:e=>new t((t,r)=>(r||n)({maxRedirects:0,maxRetries:e.maxRetries,retryDelay:e.retryDelay,...t}),e)}}([],eH),eJ=(eV.requester,eV.createClient)}}]);