1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[86],{31379:function(e,t){"use strict";t.byteLength=function(e){var t=u(e),r=t[0],n=t[1];return(r+n)*3/4-n},t.toByteArray=function(e){var t,r,s=u(e),o=s[0],a=s[1],c=new i((o+a)*3/4-a),l=0,f=a>0?o-4:o;for(r=0;r<f;r+=4)t=n[e.charCodeAt(r)]<<18|n[e.charCodeAt(r+1)]<<12|n[e.charCodeAt(r+2)]<<6|n[e.charCodeAt(r+3)],c[l++]=t>>16&255,c[l++]=t>>8&255,c[l++]=255&t;return 2===a&&(t=n[e.charCodeAt(r)]<<2|n[e.charCodeAt(r+1)]>>4,c[l++]=255&t),1===a&&(t=n[e.charCodeAt(r)]<<10|n[e.charCodeAt(r+1)]<<4|n[e.charCodeAt(r+2)]>>2,c[l++]=t>>8&255,c[l++]=255&t),c},t.fromByteArray=function(e){for(var t,n=e.length,i=n%3,s=[],o=0,a=n-i;o<a;o+=16383)s.push(function(e,t,n){for(var i,s=[],o=t;o<n;o+=3)s.push(r[(i=(e[o]<<16&16711680)+(e[o+1]<<8&65280)+(255&e[o+2]))>>18&63]+r[i>>12&63]+r[i>>6&63]+r[63&i]);return s.join("")}(e,o,o+16383>a?a:o+16383));return 1===i?s.push(r[(t=e[n-1])>>2]+r[t<<4&63]+"=="):2===i&&s.push(r[(t=(e[n-2]<<8)+e[n-1])>>10]+r[t>>4&63]+r[t<<2&63]+"="),s.join("")};for(var r=[],n=[],i="undefined"!=typeof Uint8Array?Uint8Array:Array,s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",o=0,a=s.length;o<a;++o)r[o]=s[o],n[s.charCodeAt(o)]=o;function u(e){var t=e.length;if(t%4>0)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},41989:function(e,t,r){"use strict";let n=r(31379),i=r(30152),s="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;function o(e){if(e>2147483647)throw RangeError('The value "'+e+'" is invalid for option "size"');let t=new Uint8Array(e);return Object.setPrototypeOf(t,a.prototype),t}function a(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 l(e)}return u(e,t,r)}function u(e,t,r){if("string"==typeof e)return function(e,t){if(("string"!=typeof t||""===t)&&(t="utf8"),!a.isEncoding(t))throw TypeError("Unknown encoding: "+t);let r=0|p(e,t),n=o(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(B(e,Uint8Array)){let t=new Uint8Array(e);return h(t.buffer,t.byteOffset,t.byteLength)}return f(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(B(e,ArrayBuffer)||e&&B(e.buffer,ArrayBuffer)||"undefined"!=typeof SharedArrayBuffer&&(B(e,SharedArrayBuffer)||e&&B(e.buffer,SharedArrayBuffer)))return h(e,t,r);if("number"==typeof e)throw TypeError('The "value" argument must not be of type number. Received type number');let n=e.valueOf&&e.valueOf();if(null!=n&&n!==e)return a.from(n,t,r);let i=function(e){var t;if(a.isBuffer(e)){let t=0|d(e.length),r=o(t);return 0===r.length||e.copy(r,0,0,t),r}return void 0!==e.length?"number"!=typeof e.length||(t=e.length)!=t?o(0):f(e):"Buffer"===e.type&&Array.isArray(e.data)?f(e.data):void 0}(e);if(i)return i;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof e[Symbol.toPrimitive])return a.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 c(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 l(e){return c(e),o(e<0?0:0|d(e))}function f(e){let t=e.length<0?0:0|d(e.length),r=o(t);for(let n=0;n<t;n+=1)r[n]=255&e[n];return r}function h(e,t,r){let n;if(t<0||e.byteLength<t)throw RangeError('"offset" is outside of buffer bounds');if(e.byteLength<t+(r||0))throw RangeError('"length" is outside of buffer bounds');return Object.setPrototypeOf(n=void 0===t&&void 0===r?new Uint8Array(e):void 0===r?new Uint8Array(e,t):new Uint8Array(e,t,r),a.prototype),n}function d(e){if(e>=2147483647)throw RangeError("Attempt to allocate Buffer larger than maximum size: 0x7fffffff bytes");return 0|e}function p(e,t){if(a.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||B(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,n=arguments.length>2&&!0===arguments[2];if(!n&&0===r)return 0;let i=!1;for(;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return j(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return U(e).length;default:if(i)return n?-1:j(e).length;t=(""+t).toLowerCase(),i=!0}}function y(e,t,r){let i=!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){let n=e.length;(!t||t<0)&&(t=0),(!r||r<0||r>n)&&(r=n);let i="";for(let n=t;n<r;++n)i+=M[e[n]];return i}(this,t,r);case"utf8":case"utf-8":return b(this,t,r);case"ascii":return function(e,t,r){let n="";r=Math.min(e.length,r);for(let i=t;i<r;++i)n+=String.fromCharCode(127&e[i]);return n}(this,t,r);case"latin1":case"binary":return function(e,t,r){let n="";r=Math.min(e.length,r);for(let i=t;i<r;++i)n+=String.fromCharCode(e[i]);return n}(this,t,r);case"base64":var s,o;return s=t,o=r,0===s&&o===this.length?n.fromByteArray(this):n.fromByteArray(this.slice(s,o));case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return function(e,t,r){let n=e.slice(t,r),i="";for(let e=0;e<n.length-1;
1e+=2)i+=String.fromCharCode(n[e]+256*n[e+1]);return i}(this,t,r);default:if(i)throw TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),i=!0}}function g(e,t,r){let n=e[t];e[t]=e[r],e[r]=n}function m(e,t,r,n,i){var s;if(0===e.length)return -1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),(s=r=+r)!=s&&(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=a.from(t,n)),a.isBuffer(t))return 0===t.length?-1:v(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):v(e,[t],r,n,i);throw TypeError("val must be string, number or Buffer")}function v(e,t,r,n,i){let s,o=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;o=2,a/=2,u/=2,r/=2}function c(e,t){return 1===o?e[t]:e.readUInt16BE(t*o)}if(i){let n=-1;for(s=r;s<a;s++)if(c(e,s)===c(t,-1===n?0:s-n)){if(-1===n&&(n=s),s-n+1===u)return n*o}else -1!==n&&(s-=s-n),n=-1}else for(r+u>a&&(r=a-u),s=r;s>=0;s--){let r=!0;for(let n=0;n<u;n++)if(c(e,s+n)!==c(t,n)){r=!1;break}if(r)return s}return -1}function b(e,t,r){r=Math.min(e.length,r);let n=[],i=t;for(;i<r;){let t=e[i],s=null,o=t>239?4:t>223?3:t>191?2:1;if(i+o<=r){let r,n,a,u;switch(o){case 1:t<128&&(s=t);break;case 2:(192&(r=e[i+1]))==128&&(u=(31&t)<<6|63&r)>127&&(s=u);break;case 3:r=e[i+1],n=e[i+2],(192&r)==128&&(192&n)==128&&(u=(15&t)<<12|(63&r)<<6|63&n)>2047&&(u<55296||u>57343)&&(s=u);break;case 4:r=e[i+1],n=e[i+2],a=e[i+3],(192&r)==128&&(192&n)==128&&(192&a)==128&&(u=(15&t)<<18|(63&r)<<12|(63&n)<<6|63&a)>65535&&u<1114112&&(s=u)}}null===s?(s=65533,o=1):s>65535&&(s-=65536,n.push(s>>>10&1023|55296),s=56320|1023&s),n.push(s),i+=o}return function(e){let t=e.length;if(t<=4096)return String.fromCharCode.apply(String,e);let r="",n=0;for(;n<t;)r+=String.fromCharCode.apply(String,e.slice(n,n+=4096));return r}(n)}function w(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")}function E(e,t,r,n,i,s){if(!a.isBuffer(e))throw TypeError('"buffer" argument must be a Buffer instance');if(t>i||t<s)throw RangeError('"value" argument is out of bounds');if(r+n>e.length)throw RangeError("Index out of range")}function _(e,t,r,n,i){A(t,n,i,e,r,7);let s=Number(t&BigInt(4294967295));e[r++]=s,s>>=8,e[r++]=s,s>>=8,e[r++]=s,s>>=8,e[r++]=s;let o=Number(t>>BigInt(32)&BigInt(4294967295));return e[r++]=o,o>>=8,e[r++]=o,o>>=8,e[r++]=o,o>>=8,e[r++]=o,r}function x(e,t,r,n,i){A(t,n,i,e,r,7);let s=Number(t&BigInt(4294967295));e[r+7]=s,s>>=8,e[r+6]=s,s>>=8,e[r+5]=s,s>>=8,e[r+4]=s;let o=Number(t>>BigInt(32)&BigInt(4294967295));return e[r+3]=o,o>>=8,e[r+2]=o,o>>=8,e[r+1]=o,o>>=8,e[r]=o,r+8}function I(e,t,r,n,i,s){if(r+n>e.length||r<0)throw RangeError("Index out of range")}function S(e,t,r,n,s){return t=+t,r>>>=0,s||I(e,t,r,4,34028234663852886e22,-34028234663852886e22),i.write(e,t,r,n,23,4),r+4}function R(e,t,r,n,s){return t=+t,r>>>=0,s||I(e,t,r,8,17976931348623157e292,-17976931348623157e292),i.write(e,t,r,n,52,8),r+8}t.lW=a,t.h2=50,a.TYPED_ARRAY_SUPPORT=function(){try{let 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}}(),a.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(a.prototype,"parent",{enumerable:!0,get:function(){if(a.isBuffer(this))return this.buffer}}),Object.defineProperty(a.prototype,"offset",{enumerable:!0,get:function(){if(a.isBuffer(this))return this.byteOffset}}),a.poolSize=8192,a.from=function(e,t,r){return u(e,t,r)},Object.setPrototypeOf(a.prototype,Uint8Array.prototype),Object.setPrototypeOf(a,Uint8Array),a.alloc=function(e,t,r){return(c(e),e<=0)?o(e):void 0!==t?"string"==typeof r?o(e).fill(t,r):o(e).fill(t):o(e)},a.allocUnsafe=function(e){return l(e)},a.allocUnsafeSlow=function(e){return l(e)},a.isBuffer=function(e){return null!=e&&!0===e._isBuffer&&e!==a.prototype},a.compare=function(e,t){if(B(e,Uint8Array)&&(e=a.from(e,e.offset,e.byteLength)),B(t,Uint8Array)&&(t=a.from(t,t.offset,t.byteLength)),!
vendor: 12,506 bytes, line 1
1a.isBuffer(e)||!a.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,n=t.length;for(let i=0,s=Math.min(r,n);i<s;++i)if(e[i]!==t[i]){r=e[i],n=t[i];break}return r<n?-1:n<r?1:0},a.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},a.concat=function(e,t){let r;if(!Array.isArray(e))throw TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return a.alloc(0);if(void 0===t)for(r=0,t=0;r<e.length;++r)t+=e[r].length;let n=a.allocUnsafe(t),i=0;for(r=0;r<e.length;++r){let t=e[r];if(B(t,Uint8Array))i+t.length>n.length?(a.isBuffer(t)||(t=a.from(t)),t.copy(n,i)):Uint8Array.prototype.set.call(n,t,i);else if(a.isBuffer(t))t.copy(n,i);else throw TypeError('"list" argument must be an Array of Buffers');i+=t.length}return n},a.byteLength=p,a.prototype._isBuffer=!0,a.prototype.swap16=function(){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)g(this,t,t+1);return this},a.prototype.swap32=function(){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)g(this,t,t+3),g(this,t+1,t+2);return this},a.prototype.swap64=function(){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)g(this,t,t+7),g(this,t+1,t+6),g(this,t+2,t+5),g(this,t+3,t+4);return this},a.prototype.toString=function(){let e=this.length;return 0===e?"":0==arguments.length?b(this,0,e):y.apply(this,arguments)},a.prototype.toLocaleString=a.prototype.toString,a.prototype.equals=function(e){if(!a.isBuffer(e))throw TypeError("Argument must be a Buffer");return this===e||0===a.compare(this,e)},a.prototype.inspect=function(){let e="",r=t.h2;return e=this.toString("hex",0,r).replace(/(.{2})/g,"$1 ").trim(),this.length>r&&(e+=" ... "),"<Buffer "+e+">"},s&&(a.prototype[s]=a.prototype.inspect),a.prototype.compare=function(e,t,r,n,i){if(B(e,Uint8Array)&&(e=a.from(e,e.offset,e.byteLength)),!a.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;let s=i-n,o=r-t,u=Math.min(s,o),c=this.slice(n,i),l=e.slice(t,r);for(let e=0;e<u;++e)if(c[e]!==l[e]){s=c[e],o=l[e];break}return s<o?-1:o<s?1:0},a.prototype.includes=function(e,t,r){return -1!==this.indexOf(e,t,r)},a.prototype.indexOf=function(e,t,r){return m(this,e,t,r,!0)},a.prototype.lastIndexOf=function(e,t,r){return m(this,e,t,r,!1)},a.prototype.write=function(e,t,r,n){var i,s,o,a,u,c,l,f;if(void 0===t)n="utf8",r=this.length,t=0;else if(void 0===r&&"string"==typeof t)n=t,r=this.length,t=0;else if(isFinite(t))t>>>=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");let h=this.length-t;if((void 0===r||r>h)&&(r=h),e.length>0&&(r<0||t<0)||t>this.length)throw RangeError("Attempt to write outside buffer bounds");n||(n="utf8");let d=!1;for(;;)switch(n){case"hex":return function(e,t,r,n){let i;r=Number(r)||0;let s=e.length-r;n?(n=Number(n))>s&&(n=s):n=s;let o=t.length;for(n>o/2&&(n=o/2),i=0;i<n;++i){let n=parseInt(t.substr(2*i,2),16);if(n!=n)break;e[r+i]=n}return i}(this,e,t,r);case"utf8":case"utf-8":return i=t,s=r,P(j(e,this.length-i),this,i,s);case"ascii":case"latin1":case"binary":return o=t,a=r,P(function(e){let t=[];for(let r=0;r<e.length;++r)t.push(255&e.charCodeAt(r));return t}(e),this,o,a);case"base64":return u=t,c=r,P(U(e),this,u,c);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return l=t,f=r,P(function(e,t){let r,n;let i=[];for(let s=0;s<e.length&&!((t-=2)<0);++s)n=(r=e.charCodeAt(s))>>8,i.push(r%256),i.push(n);return i}(e,this.length-l),this,l,f);default:if(d)throw TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),d=!0}},a.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}},a.prototype.slice=function(e,t){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 n=this.subarray(e,t);return Object.setPrototypeOf(n,a.prototype),n},a.prototype.readUintLE=a.prototype.readUIntLE=function(e,t,r){e>>>=0,t>>>=0,r||w(e,t,this.length);let n=this[e],i=1,s=0;for(;++s<t&&(i*=256);)n+=this[e+s]*i;return n},a.prototype.readUintBE=a.prototype.readUIntBE=function(e,t,r){e>>>=0,t>>>=0,r||w(e,t,this.length);let n=this[e+--t],i=1;for(;t>0&&(i*=256);)n+=this[e+--t]*i;return n},a.prototype.readUint8=a.prototype.readUInt8=function(e,t){return e>>>=0,t||w(e,1,this.length),this[e]},a.prototype.readUint16LE=a.prototype.readUInt16LE=function(e,t){return e>>>=0,t||w(e,2,this.length),this[e]|this[e+1]<<8},a.prototype.readUint16BE=a.prototype.readUInt16BE=function(e,t){return e>>>=0,t||w(e,2,this.length),this[e]<<8|this[e+1]},a.prototype.readUint32LE=a.prototype.readUInt32LE=function(e,t){return e>>>=0,t||w(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},a.prototype.readUint32BE=a.prototype.readUInt32BE=function(e,t){return e>>>=0,t||w(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},a.prototype.readBigUInt64LE=L(function(e){O(e>>>=0,"offset");let t=this[e],r=this[e+7];(void 0===t||void 0===r)&&q(e,this.length-8);let n=t+256*this[++e]+65536*this[++e]+16777216*this[++e],i=this[++e]+256*this[++e]+65536*this[++e]+16777216*r;return BigInt(n)+(BigInt(i)<<BigInt(32))}),a.prototype.readBigUInt64BE=L(function(e){O(e>>>=0,"offset");let t=this[e],r=this[e+7];(void 0===t||void 0===r)&&q(e,this.length-8);let n=16777216*t+65536*this[++e]+256*this[++e]+this[++e],i=16777216*this[++e]+65536*this[++e]+256*this[++e]+r;return(BigInt(n)<<BigInt(32))+BigInt(i)}),a.prototype.readIntLE=function(e,t,r){e>>>=0,t>>>=0,r||w(e,t,this.length);let n=this[e],i=1,s=0;for(;++s<t&&(i*=256);)n+=this[e+s]*i;return n>=(i*=128)&&(n-=Math.pow(2,8*t)),n},a.prototype.readIntBE=function(e,t,r){e>>>=0,t>>>=0,r||w(e,t,this.length);let n=t,i=1,s=this[e+--n];for(;n>0&&(i*=256);)s+=this[e+--n]*i;return s>=(i*=128)&&(s-=Math.pow(2,8*t)),s},a.prototype.readInt8=function(e,t){return(e>>>=0,t||w(e,1,this.length),128&this[e])?-((255-this[e]+1)*1):this[e]},a.prototype.readInt16LE=function(e,t){e>>>=0,t||w(e,2,this.length);let r=this[e]|this[e+1]<<8;return 32768&r?4294901760|r:r},a.prototype.readInt16BE=function(e,t){e>>>=0,t||w(e,2,this.length);let r=this[e+1]|this[e]<<8;return 32768&r?4294901760|r:r},a.prototype.readInt32LE=function(e,t){return e>>>=0,t||w(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},a.prototype.readInt32BE=function(e,t){return e>>>=0,t||w(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},a.prototype.readBigInt64LE=L(function(e){O(e>>>=0,"offset");let t=this[e],r=this[e+7];return(void 0===t||void 0===r)&&q(e,this.length-8),(BigInt(this[e+4]+256*this[e+5]+65536*this[e+6]+(r<<24))<<BigInt(32))+BigInt(t+256*this[++e]+65536*this[++e]+16777216*this[++e])}),a.prototype.readBigInt64BE=L(function(e){O(e>>>=0,"offset");let t=this[e],r=this[e+7];return(void 0===t||void 0===r)&&q(e,this.length-8),(BigInt((t<<24)+65536*this[++e]+256*this[++e]+this[++e])<<BigInt(32))+BigInt(16777216*this[++e]+65536*this[++e]+256*this[++e]+r)}),a.prototype.readFloatLE=function(e,t){return e>>>=0,t||w(e,4,this.length),i.read(this,e,!0,23,4)},a.prototype.readFloatBE=function(e,t){return e>>>=0,t||w(e,4,this.length),i.read(this,e,!1,23,4)},a.prototype.readDoubleLE=function(e,t){return e>>>=0,t||w(e,8,this.length),i.read(this,e,!0,52,8)},a.prototype.readDoubleBE=function(e,t){return e>>>=0,t||w(e,8,this.length),i.read(this,e,!1,52,8)},a.prototype.writeUintLE=a.prototype.writeUIntLE=function(e,t,r,n){if(e=+e,t>>>=0,r>>>=0,!n){let n=Math.pow(2,8*r)-1;E(this,e,t,r,n,0)}let i=1,s=0;for(this[t]=255&e;++s<r&&(i*=256);)this[t+s]=e/i&255;return t+r},a.prototype.writeUintBE=a.prototype.writeUIntBE=function(e,t,r,n){if(e=+e,t>>>=0,r>>>=0,!n){let n=Math.pow(2,8*r)-1;E(this,e,t,r,n,0)}let i=r-1,s=1;for(this[t+i]=255&e;--i>=0&&(s*=256);)this[t+i]=e/s&255;return t+r},a.prototype.writeUint8=a.prototype.writeUInt8=function(e,t,r){return e=+e,t>>>=0,r||E(this,e,t,1,255,0),this[t]=255&e,t+1},a.prototype.writeUint16LE=a.prototype.writeUInt16LE=function(e,t,r){return e=+e,t>>>=0,r||E(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},a.prototype.writeUint16BE=a.prototype.writeUInt16BE=function(e,t,r){return e=+e,t>>>=0,r||E(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},a.prototype.writeUint32LE=a.prototype.writeUInt32LE=function(e,t,r){return e=+e,t>>>=0,r||E(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},a.prototype.writeUint32BE=a.prototype.writeUInt32BE=function(e,t,r){return e=+e,t>>>=0,r||E(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},a.prototype.writeBigUInt64LE=L(function(e,t=0){return _(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))}),a.prototype.writeBigUInt64BE=L(function(e,t=0){return x(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))}),a.prototype.writeIntLE=function(e,t,r,n){if(e=+e,t>>>=0,!n){let n=Math.pow(2,8*r-1);E(this,e,t,r,n-1,-n)}let i=0,s=1,o=0;for(this[t]=255&e;++i<r&&(s*=256);)e<0&&0===o&&0!==this[t+i-1]&&(o=1),this[t+i]=(e/s>>0)-o&255;return t+r},a.prototype.writeIntBE=function(e,t,r,n){if(e=+e,t>>>=0,!n){let n=Math.pow(2,8*r-1);E(this,e,t,r,n-1,-n)}let i=r-1,s=1,o=0;for(this[t+i]=255&e;--i>=0&&(s*=256);)e<0&&0===o&&0!==this[t+i+1]&&(o=1),this[t+i]=(e/s>>0)-o&255;return t+r},a.prototype.writeInt8=function(e,t,r){return e=+e,t>>>=0,r||E(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},a.prototype.writeInt16LE=function(e,t,r){return e=+e,t>>>=0,r||E(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},a.prototype.writeInt16BE=function(e,t,r){return e=+e,t>>>=0,r||E(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},a.prototype.writeInt32LE=function(e,t,r){return e=+e,t>>>=0,r||E(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},a.prototype.writeInt32BE=function(e,t,r){return e=+e,t>>>=0,r||E(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},a.prototype.writeBigInt64LE=L(function(e,t=0){return _(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),a.prototype.writeBigInt64BE=L(function(e,t=0){return x(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),a.prototype.writeFloatLE=function(e,t,r){return S(this,e,t,!0,r)},a.prototype.writeFloatBE=function(e,t,r){return S(this,e,t,!1,r)},a.prototype.writeDoubleLE=function(e,t,r){return R(this,e,t,!0,r)},a.prototype.writeDoubleBE=function(e,t,r){return R(this,e,t,!1,r)},a.prototype.copy=function(e,t,r,n){if(!a.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<r&&(n=r),n===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(n<0)throw RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),e.length-t<n-r&&(n=e.length-t+r);let i=n-r;return this===e&&"function"==typeof Uint8Array.prototype.copyWithin?this.copyWithin(t,r,n):Uint8Array.prototype.set.call(e,this.subarray(r,n),t),i},a.prototype.fill=function(e,t,r,n){let i;if("string"==typeof e){if("string"==typeof t?(n=t,t=0,r=this.length):"string"==typeof r&&(n=r,r=this.length),void 0!==n&&"string"!=typeof n)throw TypeError("encoding must be a string");if("string"==typeof n&&!a.isEncoding(n))throw TypeError("Unknown encoding: "+n);if(1===e.length){let t=e.charCodeAt(0);("utf8"===n&&t<128||"latin1"===n)&&(e=t)}}else"number"==typeof e?e&=255:"boolean"==typeof e&&(e=Number(e));if(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(i=t;i<r;++i)this[i]=e;else{let s=a.isBuffer(e)?e:a.from(e,n),o=s.length;
1if(0===o)throw TypeError('The value "'+e+'" is invalid for argument "value"');for(i=0;i<r-t;++i)this[i+t]=s[i%o]}return this};let C={};function T(e,t,r){C[e]=class extends r{constructor(){super(),Object.defineProperty(this,"message",{value:t.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${e}]`,this.stack,delete this.name}get code(){return e}set code(e){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:e,writable:!0})}toString(){return`${this.name} [${e}]: ${this.message}`}}}function $(e){let t="",r=e.length,n="-"===e[0]?1:0;for(;r>=n+4;r-=3)t=`_${e.slice(r-3,r)}${t}`;return`${e.slice(0,r)}${t}`}function A(e,t,r,n,i,s){if(e>r||e<t){let n;let i="bigint"==typeof t?"n":"";throw n=s>3?0===t||t===BigInt(0)?`>= 0${i} and < 2${i} ** ${(s+1)*8}${i}`:`>= -(2${i} ** ${(s+1)*8-1}${i}) and < 2 ** ${(s+1)*8-1}${i}`:`>= ${t}${i} and <= ${r}${i}`,new C.ERR_OUT_OF_RANGE("value",n,e)}O(i,"offset"),(void 0===n[i]||void 0===n[i+s])&&q(i,n.length-(s+1))}function O(e,t){if("number"!=typeof e)throw new C.ERR_INVALID_ARG_TYPE(t,"number",e)}function q(e,t,r){if(Math.floor(e)!==e)throw O(e,r),new C.ERR_OUT_OF_RANGE(r||"offset","an integer",e);if(t<0)throw new C.ERR_BUFFER_OUT_OF_BOUNDS;throw new C.ERR_OUT_OF_RANGE(r||"offset",`>= ${r?1:0} and <= ${t}`,e)}T("ERR_BUFFER_OUT_OF_BOUNDS",function(e){return e?`${e} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),T("ERR_INVALID_ARG_TYPE",function(e,t){return`The "${e}" argument must be of type number. Received type ${typeof t}`},TypeError),T("ERR_OUT_OF_RANGE",function(e,t,r){let n=`The value of "${e}" is out of range.`,i=r;return Number.isInteger(r)&&Math.abs(r)>4294967296?i=$(String(r)):"bigint"==typeof r&&(i=String(r),(r>BigInt(2)**BigInt(32)||r<-(BigInt(2)**BigInt(32)))&&(i=$(i)),i+="n"),n+=` It must be ${t}. Received ${i}`},RangeError);let k=/[^+/0-9A-Za-z-_]/g;function j(e,t){let r;t=t||1/0;let n=e.length,i=null,s=[];for(let o=0;o<n;++o){if((r=e.charCodeAt(o))>55295&&r<57344){if(!i){if(r>56319||o+1===n){(t-=3)>-1&&s.push(239,191,189);continue}i=r;continue}if(r<56320){(t-=3)>-1&&s.push(239,191,189),i=r;continue}r=(i-55296<<10|r-56320)+65536}else i&&(t-=3)>-1&&s.push(239,191,189);if(i=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}function U(e){return n.toByteArray(function(e){if((e=(e=e.split("=")[0]).trim().replace(k,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function P(e,t,r,n){let i;for(i=0;i<n&&!(i+r>=t.length)&&!(i>=e.length);++i)t[i+r]=e[i];return i}function B(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}let M=function(){let e="0123456789abcdef",t=Array(256);for(let r=0;r<16;++r){let n=16*r;for(let i=0;i<16;++i)t[n+i]=e[r]+e[i]}return t}();function L(e){return"undefined"==typeof BigInt?D:e}function D(){throw Error("BigInt not supported")}},30152:function(e,t){t.read=function(e,t,r,n,i){var s,o,a=8*i-n-1,u=(1<<a)-1,c=u>>1,l=-7,f=r?i-1:0,h=r?-1:1,d=e[t+f];for(f+=h,s=d&(1<<-l)-1,d>>=-l,l+=a;l>0;s=256*s+e[t+f],f+=h,l-=8);for(o=s&(1<<-l)-1,s>>=-l,l+=n;l>0;o=256*o+e[t+f],f+=h,l-=8);if(0===s)s=1-c;else{if(s===u)return o?NaN:1/0*(d?-1:1);o+=Math.pow(2,n),s-=c}return(d?-1:1)*o*Math.pow(2,s-n)},t.write=function(e,t,r,n,i,s){var o,a,u,c=8*s-i-1,l=(1<<c)-1,f=l>>1,h=23===i?5960464477539062e-23:0,d=n?0:s-1,p=n?1:-1,y=t<0||0===t&&1/t<0?1:0;for(isNaN(t=Math.abs(t))||t===1/0?(a=isNaN(t)?1:0,o=l):(o=Math.floor(Math.log(t)/Math.LN2),t*(u=Math.pow(2,-o))<1&&(o--,u*=2),o+f>=1?t+=h/u:t+=h*Math.pow(2,1-f),t*u>=2&&(o++,u/=2),o+f>=l?(a=0,o=l):o+f>=1?(a=(t*u-1)*Math.pow(2,i),o+=f):(a=t*Math.pow(2,f-1)*Math.pow(2,i),o=0));i>=8;e[r+d]=255&a,d+=p,a/=256,i-=8);for(o=o<<i|a,c+=i;c>0;e[r+d]=255&o,d+=p,o/=256,c-=8);e[r+d-p]|=128*y}},50455:function(e,t,r){"use strict";r.d(t,{default:function(){return i.a}});var n=r(26593),i=r.n(n)}
1,43620:function(e,t,r){"use strict";var n=r(42251);r.o(n,"usePathname")&&r.d(t,{usePathname:function(){return n.usePathname}}),r.o(n,"useRouter")&&r.d(t,{useRouter:function(){return n.useRouter}}),r.o(n,"useSearchParams")&&r.d(t,{useSearchParams:function(){return n.useSearchParams}})},55561:function(e,t,r){"use strict";Object.defineProperty(t,"$",{enumerable:!0,get:function(){return i}});let n=r(87878);function i(e){let{createServerReference:t}=r(15072);return t(e,n.callServer)}},26593:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"default",{enumerable:!0,get:function(){return s}});let n=r(55764);r(26742),r(93415);let i=n._(r(99746));function s(e,t){var r;let n={loading:e=>{let{error:t,isLoading:r,pastDelay:n}=e;return null}};"function"==typeof e&&(n.loader=e);let s={...n,...t};return(0,i.default)({...s,modules:null==(r=s.loadableGenerated)?void 0:r.modules})}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},5582:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"BailoutToCSR",{enumerable:!0,get:function(){return i}});let n=r(15911);function i(e){let{reason:t,children:r}=e;if("undefined"==typeof window)throw new n.BailoutToCSRError(t);return r}},99746:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"default",{enumerable:!0,get:function(){return c}});let n=r(26742),i=r(93415),s=r(5582),o=r(20379);function a(e){return{default:e&&"default"in e?e.default:e}}let u={loader:()=>Promise.resolve(a(()=>null)),loading:null,ssr:!0},c=function(e){let t={...u,...e},r=(0,i.lazy)(()=>t.loader().then(a)),c=t.loading;function l(e){let a=c?(0,n.jsx)(c,{isLoading:!0,pastDelay:!0,error:null}):null,u=t.ssr?(0,n.jsxs)(n.Fragment,{children:["undefined"==typeof window?(0,n.jsx)(o.PreloadCss,{moduleIds:t.modules}):null,(0,n.jsx)(r,{...e})]}):(0,n.jsx)(s.BailoutToCSR,{reason:"next/dynamic",children:(0,n.jsx)(r,{...e})});return(0,n.jsx)(i.Suspense,{fallback:a,children:u})}return l.displayName="LoadableComponent",l}},20379:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"PreloadCss",{enumerable:!0,get:function(){return s}});let n=r(26742),i=r(82184);function s(e){let{moduleIds:t}=e;if("undefined"!=typeof window)return null;let r=(0,i.getExpectedRequestStore)("next/dynamic css"),s=[];if(r.reactLoadableManifest&&t){let e=r.reactLoadableManifest;for(let r of t){if(!e[r])continue;let t=e[r].files.filter(e=>e.endsWith(".css"));s.push(...t)}}return 0===s.length?null:(0,n.jsx)(n.Fragment,{children:s.map(e=>(0,n.jsx)("link",{precedence:"dynamic",rel:"stylesheet",href:r.assetPrefix+"/_next/"+encodeURI(e),as:"style"},e))})}},55420:function(e,t,r){"use strict";r.d(t,{y:function(){return l}});var n=r(48234),i=r(36545),s=r(63365),o=r(22018),a=r(77933),u=r(94690),c=r(61290),l=function(){function e(e){e&&(this._subscribe=e)}return e.prototype.lift=function(t){var r=new e;return r.source=this,r.operator=t,r},e.prototype.subscribe=function(e,t,r){var s,o=this,a=(s=e)&&s instanceof n.Lv||s&&(0,u.m)(s.next)&&(0,u.m)(s.error)&&(0,u.m)(s.complete)&&(0,i.Nn)(s)?e:new n.Hp(e,t,r);return(0,c.x)(function(){var e=o.operator,t=o.source;a.add(e?e.call(a,t):t?o._subscribe(a):o._trySubscribe(a))}),a},e.prototype._trySubscribe=function(e){try{return this._subscribe(e)}catch(t){e.error(t)}},e.prototype.forEach=function(e,t){var r=this;return new(t=f(t))(function(t,i){var s=new n.Hp({next:function(t){try{e(t)}catch(e){i(e),s.unsubscribe()}},error:i,complete:t});r.subscribe(s)})},e.prototype._subscribe=function(e){var t;return null===(t=this.source)||void 0===t?void 0:t.subscribe(e)},e.prototype[s.L]=function(){return this},e.prototype.pipe=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return(0,o.U)(e)(this)},e.prototype.toPromise=function(e){var t=this;return new(e=f(e))(function(e,r){var n;t.subscribe(function(e){return n=e},function(e){return r(e)},function(){return e(n)})})},e.create=function(t){return new e(t)},e}();function f(e){var t;return null!==(t=null!=e?e:a.v.Promise)&&void 0!==t?t:Promise}},48234:function(e,t,r){"use strict";r.d(t,{Hp:function(){return m},Lv:function(){return d}});var n=r(29978),i=r(94690),s=r(36545),o=r(77933),a=r(86378),u=r(36896),c=l("C",void 0,void 0);function l(e,t,r){return{kind:e,value:t,error:r}}var f=r(6257),h=r(61290),d=function(e){function t(t){var r=e.call(this)||this;return r.isStopped=!1,t?(r.destination=t,(0,s.Nn)(t)&&t.add(r)):r.destination=w,r}return(0,n.ZT)(t,e),t.create=function(e,t,r){return new m(e,t,r)},t.prototype.next=function(e){this.isStopped?b(l("N",e,void 0),this):this._next(e)},t.prototype.error=function(e){this.isStopped?b(l("E",void 0,e),this):(this.isStopped=!0,this._error(e))},t.prototype.complete=function(){this.isStopped?b(c,this):(this.isStopped=!0,this._complete())},t.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,e.prototype.unsubscribe.call(this),this.destination=null)},t.prototype._next=function(e){this.destination.next(e)},t.prototype._error=function(e){try{this.destination.error(e)}finally{this.unsubscribe()}},t.prototype._complete=function(){try{this.destination.complete()}finally{this.unsubscribe()}},t}(s.w0),p=Function.prototype.bind;function y(e,t){return p.call(e,t)}var g=function(){function e(e){this.partialObserver=e}return e.prototype.next=function(e){var t=this.partialObserver;if(t.next)try{t.next(e)}catch(e){v(e)}},e.prototype.error=function(e){var t=this.partialObserver;if(t.error)try{t.error(e)}catch(e){v(e)}else v(e)},e.prototype.complete=function(){var e=this.partialObserver;if(e.complete)try{e.complete()}catch(e){v(e)}},e}(),m=function(e){function t(t,r,n){var s,a,u=e.call(this)||this;return(0,i.m)(t)||!t?s={next:null!=t?t:void 0,error:null!=r?r:void 0,complete:null!=n?n:void 0}
1:u&&o.v.useDeprecatedNextContext?((a=Object.create(t)).unsubscribe=function(){return u.unsubscribe()},s={next:t.next&&y(t.next,a),error:t.error&&y(t.error,a),complete:t.complete&&y(t.complete,a)}):s=t,u.destination=new g(s),u}return(0,n.ZT)(t,e),t}(d);function v(e){o.v.useDeprecatedSynchronousErrorHandling?(0,h.O)(e):(0,a.h)(e)}function b(e,t){var r=o.v.onStoppedNotification;r&&f.z.setTimeout(function(){return r(e,t)})}var w={closed:!0,next:u.Z,error:function(e){throw e},complete:u.Z}},36545:function(e,t,r){"use strict";r.d(t,{Lc:function(){return u},w0:function(){return a},Nn:function(){return c}});var n=r(29978),i=r(94690),s=(0,r(55549).d)(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}}),o=r(85580),a=function(){var e;function t(e){this.initialTeardown=e,this.closed=!1,this._parentage=null,this._finalizers=null}return t.prototype.unsubscribe=function(){if(!this.closed){this.closed=!0;var e,t,r,o,a,u=this._parentage;if(u){if(this._parentage=null,Array.isArray(u))try{for(var c=(0,n.XA)(u),f=c.next();!f.done;f=c.next())f.value.remove(this)}catch(t){e={error:t}}finally{try{f&&!f.done&&(t=c.return)&&t.call(c)}finally{if(e)throw e.error}}else u.remove(this)}var h=this.initialTeardown;if((0,i.m)(h))try{h()}catch(e){a=e instanceof s?e.errors:[e]}var d=this._finalizers;if(d){this._finalizers=null;try{for(var p=(0,n.XA)(d),y=p.next();!y.done;y=p.next()){var g=y.value;try{l(g)}catch(e){a=null!=a?a:[],e instanceof s?a=(0,n.ev)((0,n.ev)([],(0,n.CR)(a)),(0,n.CR)(e.errors)):a.push(e)}}}catch(e){r={error:e}}finally{try{y&&!y.done&&(o=p.return)&&o.call(p)}finally{if(r)throw r.error}}}if(a)throw new s(a)}},t.prototype.add=function(e){var r;if(e&&e!==this){if(this.closed)l(e);else{if(e instanceof t){if(e.closed||e._hasParent(this))return;e._addParent(this)}(this._finalizers=null!==(r=this._finalizers)&&void 0!==r?r:[]).push(e)}}},t.prototype._hasParent=function(e){var t=this._parentage;return t===e||Array.isArray(t)&&t.includes(e)},t.prototype._addParent=function(e){var t=this._parentage;this._parentage=Array.isArray(t)?(t.push(e),t):t?[t,e]:e},t.prototype._removeParent=function(e){var t=this._parentage;t===e?this._parentage=null:Array.isArray(t)&&(0,o.P)(t,e)},t.prototype.remove=function(e){var r=this._finalizers;r&&(0,o.P)(r,e),e instanceof t&&e._removeParent(this)},t.EMPTY=((e=new t).closed=!0,e),t}(),u=a.EMPTY;function c(e){return e instanceof a||e&&"closed"in e&&(0,i.m)(e.remove)&&(0,i.m)(e.add)&&(0,i.m)(e.unsubscribe)}function l(e){(0,i.m)(e)?e():e.unsubscribe()}},77933:function(e,t,r){"use strict";r.d(t,{v:function(){return n}});var n={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1}},93103:function(e,t,r){"use strict";r.d(t,{P:function(){return s}});var n=r(55420),i=r(8082);function s(e){return new n.y(function(t){(0,i.Xf)(e()).subscribe(t)})}},33174:function(e,t,r){"use strict";r.d(t,{E:function(){return n}});var n=new(r(55420)).y(function(e){return e.complete()})},8082:function(e,t,r){"use strict";r.d(t,{Xf:function(){return y}});var n=r(29978),i=r(39114),s=r(56413),o=r(55420),a=r(73356),u=r(83832),c=r(35481),l=r(87434),f=r(19312),h=r(94690),d=r(86378),p=r(63365);function y(e){if(e instanceof o.y)return e;if(null!=e){if((0,a.c)(e))return new o.y(function(t){var r=e[p.L]();if((0,h.m)(r.subscribe))return r.subscribe(t);throw TypeError("Provided object does not correctly implement Symbol.observable")});if((0,i.z)(e))return new o.y(function(t){for(var r=0;r<e.length&&!t.closed;r++)t.next(e[r]);t.complete()});if((0,s.t)(e))return new o.y(function(t){e.then(function(e){t.closed||(t.next(e),t.complete())},function(e){return t.error(e)}).then(null,d.h)});if((0,u.D)(e))return g(e);if((0,l.T)(e))return new o.y(function(t){var r,i;try{for(var s=(0,n.XA)(e),o=s.next();!o.done;o=s.next()){var a=o.value;if(t.next(a),t.closed)return}}catch(e){r={error:e}}finally{try{o&&!o.done&&(i=s.return)&&i.call(s)}finally{if(r)throw r.error}}t.complete()});if((0,f.L)(e))return g((0,f.Q)(e))}throw(0,c.z)(e)}function g(e){return new o.y(function(t){(function(e,t){var r,i,s,o;return(0,n.mG)(this,void 0,void 0,function(){var a;return(0,n.Jh)(this,function(u){switch(u.label){case 0:u.trys.push([0,5,6,11]),r=(0,n.KL)(e),u.label=1;case 1:return[4,r.next()];case 2:if((i=u.sent()).done)return[3,4];if(a=i.value,t.next(a),t.closed)return[2];u.label=3;case 3:return[3,1];case 4:return[3,11];case 5:return s={error:u.sent()},[3,11];
1case 6:if(u.trys.push([6,,9,10]),!(i&&!i.done&&(o=r.return)))return[3,8];return[4,o.call(r)];case 7:u.sent(),u.label=8;case 8:return[3,10];case 9:if(s)throw s.error;return[7];case 10:return[7];case 11:return t.complete(),[2]}})})})(e,t).catch(function(e){return t.error(e)})})}},12204:function(e,t,r){"use strict";r.d(t,{x:function(){return i}});var n=r(29978);function i(e,t,r,n,i){return new s(e,t,r,n,i)}var s=function(e){function t(t,r,n,i,s,o){var a=e.call(this,t)||this;return a.onFinalize=s,a.shouldUnsubscribe=o,a._next=r?function(e){try{r(e)}catch(e){t.error(e)}}:e.prototype._next,a._error=i?function(e){try{i(e)}catch(e){t.error(e)}finally{this.unsubscribe()}}:e.prototype._error,a._complete=n?function(){try{n()}catch(e){t.error(e)}finally{this.unsubscribe()}}:e.prototype._complete,a}return(0,n.ZT)(t,e),t.prototype.unsubscribe=function(){var t;if(!this.shouldUnsubscribe||this.shouldUnsubscribe()){var r=this.closed;e.prototype.unsubscribe.call(this),r||null===(t=this.onFinalize)||void 0===t||t.call(this)}},t}(r(48234).Lv)},28756:function(e,t,r){"use strict";r.d(t,{h:function(){return s}});var n=r(42448),i=r(12204);function s(e,t){return(0,n.e)(function(r,n){var s=0;r.subscribe((0,i.x)(n,function(r){return e.call(t,r,s++)&&n.next(r)}))})}},33633:function(e,t,r){"use strict";r.d(t,{U:function(){return s}});var n=r(42448),i=r(12204);function s(e,t){return(0,n.e)(function(r,n){var s=0;r.subscribe((0,i.x)(n,function(r){n.next(e.call(t,r,s++))}))})}},67383:function(e,t,r){"use strict";r.d(t,{z:function(){return function e(t,r,u){return(void 0===u&&(u=1/0),(0,a.m)(r))?e(function(e,s){return(0,n.U)(function(t,n){return r(e,t,s,n)})((0,i.Xf)(t(e,s)))},u):("number"==typeof r&&(u=r),(0,s.e)(function(e,r){var n,s,a,c,l,f,h,d,p;return n=u,a=[],c=0,l=0,f=!1,h=function(){!f||a.length||c||r.complete()},d=function(e){return c<n?p(e):a.push(e)},p=function(e){c++;var u=!1;(0,i.Xf)(t(e,l++)).subscribe((0,o.x)(r,function(e){s?d(e):r.next(e)},function(){u=!0},void 0,function(){if(u)try{for(c--;a.length&&c<n;)!function(){var e=a.shift();p(e)}();h()}catch(e){r.error(e)}}))},e.subscribe((0,o.x)(r,d,function(){f=!0,h()})),function(){}}))}}});var n=r(33633),i=r(8082),s=r(42448),o=(r(52877),r(12204)),a=r(94690)},6257:function(e,t,r){"use strict";r.d(t,{z:function(){return i}});var n=r(29978),i={setTimeout:function(e,t){for(var r=[],s=2;s<arguments.length;s++)r[s-2]=arguments[s];var o=i.delegate;return(null==o?void 0:o.setTimeout)?o.setTimeout.apply(o,(0,n.ev)([e,t],(0,n.CR)(r))):setTimeout.apply(void 0,(0,n.ev)([e,t],(0,n.CR)(r)))},clearTimeout:function(e){var t=i.delegate;return((null==t?void 0:t.clearTimeout)||clearTimeout)(e)},delegate:void 0}},98140:function(e,t,r){"use strict";r.d(t,{h:function(){return n}});var n="function"==typeof Symbol&&Symbol.iterator?Symbol.iterator:"@@iterator"},63365:function(e,t,r){"use strict";r.d(t,{L:function(){return n}});var n="function"==typeof Symbol&&Symbol.observable||"@@observable"},85580:function(e,t,r){"use strict";function n(e,t){if(e){var r=e.indexOf(t);0<=r&&e.splice(r,1)}}r.d(t,{P:function(){return n}})},55549:function(e,t,r){"use strict";function n(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}r.d(t,{d:function(){return n}})},61290:function(e,t,r){"use strict";r.d(t,{O:function(){return o},x:function(){return s}});var n=r(77933),i=null;function s(e){if(n.v.useDeprecatedSynchronousErrorHandling){var t=!i;if(t&&(i={errorThrown:!1,error:null}),e(),t){var r=i,s=r.errorThrown,o=r.error;if(i=null,s)throw o}}else e()}function o(e){n.v.useDeprecatedSynchronousErrorHandling&&i&&(i.errorThrown=!0,i.error=e)}},52877:function(e,t,r){"use strict";function n(e,t,r,n,i){void 0===n&&(n=0),void 0===i&&(i=!1);var s=t.schedule(function(){r(),i?e.add(this.schedule(null,n)):this.unsubscribe()},n);if(e.add(s),!i)return s}r.d(t,{f:function(){return n}})},71560:function(e,t,r){"use strict";function n(e){return e}r.d(t,{y:function(){return n}})},39114:function(e,t,r){"use strict";r.d(t,{z:function(){return n}});var n=function(e){return e&&"number"==typeof e.length&&"function"!=typeof e}},83832:function(e,t,r){"use strict";r.d(t,{D:function(){return i}});var n=r(94690);function i(e){return Symbol.asyncIterator&&(0,n.m)(null==e?void 0:e[Symbol.asyncIterator])}},94690:function(e,t,r){"use strict";function n(e){return"function"==typeof e}r.d(t,{m:function(){return n}})},73356:function(e,t,r){"use strict";r.d(t,{c:function(){return s}});var n=r(63365),i=r(94690);function s(e){return(0,i.m)(e[n.L])}},87434:function(e,t,r){"use strict";r.d(t,{T:function(){return s}});var n=r(98140),i=r(94690);function s(e){return(0,i.m)(null==e?void 0:e[n.h])}},56413:function(e,t,r){"use strict";r.d(t,{t:function(){return i}});var n=r(94690);function i(e){return(0,n.m)(null==e?void 0:e.then)}},19312:function(e,t,r){"use strict";r.d(t,{L:function(){return o},Q:function(){return s}});var n=r(29978),i=r(94690);function s(e){return(0,n.FC)(this,arguments,function(){var t,r,i;return(0,n.Jh)(this,function(s){switch(s.label){case 0:t=e.getReader(),s.label=1;case 1:s.trys.push([1,,9,10]),s.label=2;case 2:return[4,(0,n.qq)(t.read())];case 3:if(i=(r=s.sent()).value,!r.done)return[3,5];return[4,(0,n.qq)(void 0)];case 4:return[2,s.sent()];case 5:return[4,(0,n.qq)(i)];case 6:return[4,s.sent()];case 7:return s.sent(),[3,2];case 8:return[3,10];case 9:return t.releaseLock(),[7];case 10:return[2]}})})}function o(e){return(0,i.m)(null==e?void 0:e.getReader)}},42448:function(e,t,r){"use strict";r.d(t,{e:function(){return i}});var n=r(94690);function i(e){return function(t){if((0,n.m)(null==t?void 0:t.lift))return t.lift(function(t){try{return e(t,this)}catch(e){this.error(e)}});throw TypeError("Unable to lift unknown Observable type")}}},86442:function(e,t,r){"use strict";r.d(t,{Z:function(){return o}});var n=r(29978),i=r(33633),s=Array.isArray;function o(e){return(0,i.U)(function(t){return s(t)?e.apply(void 0,(0,n.ev)([],(0,n.CR)(t))):e(t)})}},36896:function(e,t,r){"use strict";function n(){}r.d(t,{Z:function(){return n}})},22018:function(e,t,r){"use strict";r.d(t,{U:function(){return s},z:function(){return i}});var n=r(71560);function i(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return s(e)}function s(e){return 0===e.length?n.y:1===e.length?e[0]:function(t){return e.reduce(function(e,t){return t(e)},t)}}},86378:function(e,t,r){"use strict";r.d(t,{h:function(){return s}});var n=r(77933),i=r(6257);function s(e){i.z.setTimeout(function(){var t=n.v.onUnhandledError;if(t)t(e);else throw e})}},35481:function(e,t,r){"use strict";function n(e){return TypeError("You provided "+(null!==e&&"object"==typeof e?"an invali
1d object":"'"+e+"'")+" where a stream was expected. You can provide an Observable, Promise, ReadableStream, Array, AsyncIterable, or Iterable.")}r.d(t,{z:function(){return n}})},28070:function(e){var t,r,n,i=e.exports={};function s(){throw Error("setTimeout has not been defined")}function o(){throw Error("clearTimeout has not been defined")}function a(e){if(t===setTimeout)return setTimeout(e,0);if((t===s||!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:s}catch(e){t=s}try{r="function"==typeof clearTimeout?clearTimeout:o}catch(e){r=o}}();var u=[],c=!1,l=-1;function f(){c&&n&&(c=!1,n.length?u=n.concat(u):l=-1,u.length&&h())}function h(){if(!c){var e=a(f);c=!0;for(var t=u.length;t;){for(n=u,u=[];++l<t;)n&&n[l].run();l=-1,t=u.length}n=null,c=!1,function(e){if(r===clearTimeout)return clearTimeout(e);if((r===o||!r)&&clearTimeout)return r=clearTimeout,clearTimeout(e);try{r(e)}catch(t){try{return r.call(null,e)}catch(t){return r.call(this,e)}}}(e)}}function d(e,t){this.fun=e,this.array=t}function p(){}i.nextTick=function(e){var t=Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)t[r-1]=arguments[r];u.push(new d(e,t)),1!==u.length||c||a(h)},d.prototype.run=function(){this.fun.apply(null,this.array)},i.title="browser",i.browser=!0,i.env={},i.argv=[],i.version="",i.versions={},i.on=p,i.addListener=p,i.once=p,i.off=p,i.removeListener=p,i.removeAllListeners=p,i.emit=p,i.prependListener=p,i.prependOnceListener=p,i.listeners=function(e){return[]},i.binding=function(e){throw Error("process.binding is not supported")},i.cwd=function(){return"/"},i.chdir=function(e){throw Error("process.chdir is not supported")},i.umask=function(){return 0}},10554:function(e,t,r){"use strict";function n(e){return"object"==typeof e&&null!==e&&!Array.isArray(e)}r.d(t,{NG:function(){return u},Uy:function(){return n}});var i={0:8203,1:8204,2:8205,3:8290,4:8291,5:8288,6:65279,7:8289,8:119155,9:119156,a:119157,b:119158,c:119159,d:119160,e:119161,f:119162},s={0:8203,1:8204,2:8205,3:65279};[,,,,].fill(String.fromCodePoint(s[0])).join(""),Object.fromEntries(Object.entries(s).map(e=>e.reverse())),Object.fromEntries(Object.entries(i).map(e=>e.reverse()));var o=`${Object.values(i).map(e=>`\\u{${e.toString(16)}}`).join("")}`,a=RegExp(`[${o}]{4,}`,"gu");function u(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)}},36522:function(e,t,r){"use strict";let n;r.d(t,{yK:function(){return tI},Hq:function(){return tC},ei:function(){return tA},bK:function(){return tT},Ol:function(){return t$},UE:function(){return tR},Ag:function(){return tS},F8:function(){return tx},dS:function(){return tj},zB:function(){return tk},lB:function(){return tq}});var i,s,o,a,u,c={randomUUID:"undefined"!=typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};let l=new Uint8Array(16),f=[];for(let e=0;e<256;++e)f.push((e+256).toString(16).slice(1));var h=function(e,t,r){if(c.randomUUID&&!t&&!e)return c.randomUUID();let i=(e=e||{}).random??e.rng?.()??function(){if(!n){if("undefined"==typeof crypto||!crypto.getRandomValues)throw Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");n=crypto.getRandomValues.bind(crypto)}return n(l)}();if(i.length<16)throw Error("Random bytes length must be >= 16");if(i[6]=15&i[6]|64,i[8]=63&i[8]|128,t){if((r=r||0)<0||r+16>t.length)throw RangeError(`UUID byte range ${r}:${r+15} is out of buffer bounds`);for(let e=0;e<16;++e)t[r+e]=i[e];return t}return function(e,t=0){return(f[e[t+0]]+f[e[t+1]]+f[e[t+2]]+f[e[t+3]]+"-"+f[e[t+4]]+f[e[t+5]]+"-"+f[e[t+6]]+f[e[t+7]]+"-"+f[e[t+8]]+f[e[t+9]]+"-"+f[e[t+10]]+f[e[t+11]]+f[e[t+12]]+f[e[t+13]]+f[e[t+14]]+f[e[t+15]]).toLowerCase()}(i)};let d=e=>{if("undefined"==typeof window)return;let t=function(){let e="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:void 0!==r.g?r.g:void 0;if(e.__xstate__)return e.__xstate__}();t&&t.register(e)};class p{constructor(e){this._process=e,this._active=!1,this._current=null,this._last=null}start(){this._active=!0,this.flush()}clear(){this._current&&(this._current.next=null,this._last=this._current)}enqueue(e){let t={value:e,next:null};if(this._current){this._last.next=t,this._last=t;return}this._current=t,this._last=t,this._active&&this.flush()}flush(){for(;this._current;){let e=this._current;this._process(e.value),this._current=e.next}this._last=null}}let y="xstate.init",g="xstate.stop";function m(e,t){return{type:`xstate.done.state.${e}`,output:t}}function v(e,t){return{type:`xstate.error.actor.${e}`,error:t,actorId:e}}function b(e){return{type:y,input:e}}function w(e){setTimeout(()=>{throw e})}let E="function"==typeof Symbol&&Symbol.observable||"@@observable";function _(e){if(C(e))return e;let t=[],r="";for(let n=0;n<e.length;n++){switch(e.charCodeAt(n)){case 92:r+=e[n+1],n++;continue;case 46:t.push(r),r="";
1continue}r+=e[n]}return t.push(r),t}function x(e){return e&&"object"==typeof e&&"machine"in e&&"value"in e?e.value:"string"!=typeof e?e:function(e){if(1===e.length)return e[0];let t={},r=t;for(let t=0;t<e.length-1;t++)if(t===e.length-2)r[e[t]]=e[t+1];else{let n=r;r={},n[e[t]]=r}return t}(_(e))}function I(e,t){let r={},n=Object.keys(e);for(let i=0;i<n.length;i++){let s=n[i];r[s]=t(e[s],s,e,i)}return r}function S(e){return void 0===e?[]:C(e)?e:[e]}function R(e,t,r,n){return"function"==typeof e?e({context:t,event:r,self:n}):e}function C(e){return Array.isArray(e)}function T(e){return(C(e)?e:[e]).map(e=>void 0===e||"string"==typeof e?{target:e}:e)}function $(e){if(void 0!==e&&""!==e)return S(e)}function A(e,t,r){let n="object"==typeof e,i=n?e:void 0;return{next:(n?e.next:e)?.bind(i),error:(n?e.error:t)?.bind(i),complete:(n?e.complete:r)?.bind(i)}}function O(e,t){let r=t.match(/^xstate\.invoke\.(\d+)\.(.*)/);if(!r)return e.implementations.actors[t];let[,n,i]=r,s=e.getStateNodeById(i).config.invoke;return(Array.isArray(s)?s[n]:s).src}function q(e,t){if(t===e||"*"===t)return!0;if(!t.endsWith(".*"))return!1;let r=t.split("."),n=e.split(".");for(let e=0;e<r.length;e++){let t=r[e],i=n[e];if("*"===t)return e===r.length-1;if(t!==i)return!1}return!0}function k(e,t){return`${e.sessionId}.${t}`}let j=0,U=!1,P=((i={})[i.NotStarted=0]="NotStarted",i[i.Running=1]="Running",i[i.Stopped=2]="Stopped",i),B={clock:{setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e)},logger:console.log.bind(console),devTools:!1};class M{constructor(e,t){this.logic=e,this._snapshot=void 0,this.clock=void 0,this.options=void 0,this.id=void 0,this.mailbox=new p(this._process.bind(this)),this.observers=new Set,this.eventListeners=new Map,this.logger=void 0,this._processingStatus=P.NotStarted,this._parent=void 0,this._syncSnapshot=void 0,this.ref=void 0,this._actorScope=void 0,this.systemId=void 0,this.sessionId=void 0,this.system=void 0,this._doneEvent=void 0,this.src=void 0,this._deferred=[];let r={...B,...t},{clock:n,logger:i,parent:s,syncSnapshot:o,id:a,systemId:u,inspect:c}=r;this.system=s?s.system:function(e,t){let r=new Map,n=new Map,i=new WeakMap,s=new Set,o={},{clock:a,logger:u}=t,c={schedule:(e,t,r,n,i=Math.random().toString(36).slice(2))=>{let s={source:e,target:t,event:r,delay:n,id:i,startedAt:Date.now()},u=k(e,i);l._snapshot._scheduledEvents[u]=s;let c=a.setTimeout(()=>{delete o[u],delete l._snapshot._scheduledEvents[u],l._relay(e,t,r)},n);o[u]=c},cancel:(e,t)=>{let r=k(e,t),n=o[r];delete o[r],delete l._snapshot._scheduledEvents[r],void 0!==n&&a.clearTimeout(n)},cancelAll:e=>{for(let t in l._snapshot._scheduledEvents){let r=l._snapshot._scheduledEvents[t];r.source===e&&c.cancel(e,r.id)}}},l={_snapshot:{_scheduledEvents:(t?.snapshot&&t.snapshot.scheduler)??{}},_bookId:()=>`x:${j++}`,_register:(e,t)=>(r.set(e,t),e),_unregister:e=>{r.delete(e.sessionId);let t=i.get(e);void 0!==t&&(n.delete(t),i.delete(e))},get:e=>n.get(e),getAll:()=>Object.fromEntries(n.entries()),_set:(e,t)=>{let r=n.get(e);if(r&&r!==t)throw Error(`Actor with system ID '${e}' already exists.`);n.set(e,t),i.set(t,e)},inspect:e=>{let t=A(e);return s.add(t),{unsubscribe(){s.delete(t)}}},_sendInspectionEvent:t=>{if(!s.size)return;let r={...t,rootId:e.sessionId};s.forEach(e=>e.next?.(r))},_relay:(e,t,r)=>{l._sendInspectionEvent({type:"@xstate.event",sourceRef:e,actorRef:t,event:r}),t._send(r)},scheduler:c,getSnapshot:()=>({_scheduledEvents:{...l._snapshot._scheduledEvents}}),start:()=>{let e=l._snapshot._scheduledEvents;for(let t in l._snapshot._scheduledEvents={},e){let{source:r,target:n,event:i,delay:s,id:o}=e[t];c.schedule(r,n,i,s,o)}},_clock:a,_logger:u};return l}(this,{clock:n,logger:i}),c&&!s&&this.system.inspect(A(c)),this.sessionId=this.system._bookId(),this.id=a??this.sessionId,this.logger=t?.logger??this.system._logger,this.clock=t?.clock??this.system._clock,this._parent=s,this._syncSnapshot=o,this.options=r,this.src=r.src??e,this.ref=this,this._actorScope={self:this,id:this.id,sessionId:this.sessionId,logger:this.logger,defer:e=>{this._deferred.push(e)},system:this.system,stopChild:e=>
1{if(e._parent!==this)throw Error(`Cannot stop child actor ${e.id} of ${this.id} because it is not a child`);e._stop()},emit:e=>{let t=this.eventListeners.get(e.type),r=this.eventListeners.get("*");if(t||r)for(let n of[...t?t.values():[],...r?r.values():[]])try{n(e)}catch(e){w(e)}},actionExecutor:e=>{let t=()=>{if(this._actorScope.system._sendInspectionEvent({type:"@xstate.action",actorRef:this,action:{type:e.type,params:e.params}}),!e.exec)return;let t=U;try{U=!0,e.exec(e.info,e.params)}finally{U=t}};this._processingStatus===P.Running?t():this._deferred.push(t)}},this.send=this.send.bind(this),this.system._sendInspectionEvent({type:"@xstate.actor",actorRef:this}),u&&(this.systemId=u,this.system._set(u,this)),this._initState(t?.snapshot??t?.state),u&&"active"!==this._snapshot.status&&this.system._unregister(this)}_initState(e){try{this._snapshot=e?this.logic.restoreSnapshot?this.logic.restoreSnapshot(e,this._actorScope):e:this.logic.getInitialSnapshot(this._actorScope,this.options?.input)}catch(e){this._snapshot={status:"error",output:void 0,error:e}}}update(e,t){let r;for(this._snapshot=e;r=this._deferred.shift();)try{r()}catch(t){this._deferred.length=0,this._snapshot={...e,status:"error",error:t}}switch(this._snapshot.status){case"active":for(let t of this.observers)try{t.next?.(e)}catch(e){w(e)}break;case"done":var n;for(let t of this.observers)try{t.next?.(e)}catch(e){w(e)}this._stopProcedure(),this._complete(),this._doneEvent=(n=this.id,{type:`xstate.done.actor.${n}`,output:this._snapshot.output,actorId:n}),this._parent&&this.system._relay(this,this._parent,this._doneEvent);break;case"error":this._error(this._snapshot.error)}this.system._sendInspectionEvent({type:"@xstate.snapshot",actorRef:this,event:t,snapshot:e})}subscribe(e,t,r){let n=A(e,t,r);if(this._processingStatus!==P.Stopped)this.observers.add(n);else switch(this._snapshot.status){case"done":try{n.complete?.()}catch(e){w(e)}break;case"error":{let e=this._snapshot.error;if(n.error)try{n.error(e)}catch(e){w(e)}else w(e)}}return{unsubscribe:()=>{this.observers.delete(n)}}}on(e,t){let r=this.eventListeners.get(e);r||(r=new Set,this.eventListeners.set(e,r));let n=t.bind(void 0);return r.add(n),{unsubscribe:()=>{r.delete(n)}}}start(){if(this._processingStatus===P.Running)return this;this._syncSnapshot&&this.subscribe({next:e=>{"active"===e.status&&this.system._relay(this,this._parent,{type:`xstate.snapshot.${this.id}`,snapshot:e})},error:()=>{}}),this.system._register(this.sessionId,this),this.systemId&&this.system._set(this.systemId,this),this._processingStatus=P.Running;let e=b(this.options.input);switch(this.system._sendInspectionEvent({type:"@xstate.event",sourceRef:this._parent,actorRef:this,event:e}),this._snapshot.status){case"done":return this.update(this._snapshot,e),this;case"error":return this._error(this._snapshot.error),this}if(this._parent||this.system.start(),this.logic.start)try{this.logic.start(this._snapshot,this._actorScope)}catch(e){return this._snapshot={...this._snapshot,status:"error",error:e},this._error(e),this}return this.update(this._snapshot,e),this.options.devTools&&this.attachDevTools(),this.mailbox.start(),this}_process(e){let t,r;try{t=this.logic.transition(this._snapshot,e,this._actorScope)}catch(e){r={err:e}}if(r){let{err:e}=r;this._snapshot={...this._snapshot,status:"error",error:e},this._error(e);return}this.update(t,e),e.type===g&&(this._stopProcedure(),this._complete())}_stop(){return this._processingStatus===P.Stopped||((this.mailbox.clear(),this._processingStatus===P.NotStarted)?this._processingStatus=P.Stopped:this.mailbox.enqueue({type:g})),this}stop(){if(this._parent)throw Error("A non-root actor cannot be stopped directly.");return this._stop()}_complete(){for(let e of this.observers)try{e.complete?.()}catch(e){w(e)}this.observers.clear(),this.eventListeners.clear()}_reportError(e){if(!this.observers.size){this._parent||w(e),this.eventListeners.clear();return}let t=!1;for(let r of this.observers){let n=r.error;t||=!n;try{n?.(e)}catch(e){w(e)}}this.observers.clear(),this.eventListeners.clear(),t&&w(e)}_error(e){this._stopProcedure(),this._reportError(e),this._parent&&this.system._relay(this,this._parent,v(this.id,e))}_stopProcedure(){return this._processingStatus!==P.Running||(this.system.scheduler.cancelAll(this),this.mailbox.clear(),this.mailbox=new p(this._process.bind(this)),this._processingStatus=P.Stopped,this.system._unregister(this)),this}_send(e){this._processingStatus!==P.Stopped&&this.mailbox.enqueue(e)}send(e){this.system._relay(void 0,this,e)}attachDevTools(){let{devTools:e}=this.options;e&&("function"==typeof e?e:d)(this)}toJSON(){return{xstate$$type:1,id:this.id}}getPersistedSnapshot(e){return this.logic.getPersistedSnapshot(this._snapshot,e)}[E](){return this}getSnapshot(){return this._snapshot}}function L(e,...[t]){return new M(e,t)}function D(e,t,r,n,{sendId:i}){return[t,{sendId:"function"==typeof i?i(r,n):i},void 0]}function F(e,t){e.defer(()=>{e.system.scheduler.cancel(e.self,t.sendId)})}function N(e){function t(e,t){}return t.type="xstate.cancel",t.sendId=e,t.resolve=D,t.execute=F,t}function z(e,t,r,n,{id:i,systemId:s,src:o,input:a,syncSnapshot:u}){let c,l;let f="string"==typeof o?O(t.machine,o):o,h="function"==typeof i?i(r):i;return f&&(l="function"==typeof a?a({context:t.context,event:r.event,self:e.self}):a,c=L(f,{id:h,src:o,parent:e.self,syncSnapshot:u,systemId:s,input:l})),[eA(t,{children:{...t.children,[h]:c}}),{id:i,systemId:s,actorRef:c,src:o,input:l},void 0]}function V(e,{actorRef:t}){t&&e.defer(()=>{t._processingStatus!==P.Stopped&&t.start()})}function W(...[e,{id:t,systemId:r,input:n,syncSnapshot:i=!1}={}]){function s(e,t){}return s.type="xstate.spawnChild",s.id=t,s.systemId=r,s.src=e,s.input=n,s.syncSnapshot=i,s.resolve=z,s.execute=V,s}function H(e,t,r,n,{actorRef:i}){let s="function"==typeof i?i(r,n):i,o="string"==typeof s?t.children[s]:s,a=t.children;return o&&(a={...a},delete a[o.id]),[eA(t,{children:a}),o,void 0]}function G(e,t){if(t){if(!function e(t,r){let n=r.getSnapshot();if(n&&"children"in n)for(let r of Object.values(n.children))e(t,r);t.system._unregister(r)}(e,t),t._processingStatus!==P.Running){e.stopChild(t);return}e.defer(()=>{e.stopChild(t)})}}function J(e){function t(e,t){}return t.type="xstate.stopChild",t.actorRef=e,t.resolve=H,t.execute=G,t}function X(e,t,r,n){let{machine:i}=n,s="function"==typeof e,o=s?e:i.implementations.guards["string"==typeof e?e:e.type];if(!s&&!o)throw Error(`Guard '${"string"==typeof e?e:e.type}' is not implemented.'.`);if("function"!=typeof o)return X(o,t,r,n);let a={context:t,event:r},u=s||"string"==typeof e?void 0:"params"in e?"function"==typeof e.params?e.params({context:t,event:r}):e.params:void 0;return"check"in o?o.check(n,a,o):o(a,u)}function Z(e){return"atomic"===e.type||"final"===e.type}function Y(e){return Object.values(e.states).filter(e=>"history"!==e.type)}function K(e,t){let r=[];if(t===e)return r;let n=e.parent;for(;n&&n!==t;)r.push(n),n=n.parent;return r}function Q(e){let t=new Set(e),r=ee(t);for(let e of t)if("compound"!==e.type||r.get(e)&&r.get(e).length){if("parallel"===e.type){for(let r of Y(e))if("history"!==r.type&&!t.has(r))for(let e of ea(r))t.add(e)}}
1else ea(e).forEach(e=>t.add(e));for(let e of t){let r=e.parent;for(;r;)t.add(r),r=r.parent}return t}function ee(e){let t=new Map;for(let r of e)t.has(r)||t.set(r,[]),r.parent&&(t.has(r.parent)||t.set(r.parent,[]),t.get(r.parent).push(r));return t}function et(e,t){return function e(t,r){let n=r.get(t);if(!n)return{};if("compound"===t.type){let e=n[0];if(!e)return{};if(Z(e))return e.key}let i={};for(let t of n)i[t.key]=e(t,r);return i}(e,ee(Q(t)))}function er(e,t){return"compound"===t.type?Y(t).some(t=>"final"===t.type&&e.has(t)):"parallel"===t.type?Y(t).every(t=>er(e,t)):"final"===t.type}let en=e=>"#"===e[0];function ei(e,t,r){let n=$(r.target),i=r.reenter??!1,s=function(e,t){if(void 0!==t)return t.map(t=>{if("string"!=typeof t)return t;if(en(t))return e.machine.getStateNodeById(t);let r="."===t[0];if(r&&!e.parent)return el(e,t.slice(1));let n=r?e.key+t:t;if(e.parent)try{return el(e.parent,n)}catch(t){throw Error(`Invalid transition definition for state node '${e.id}': 2${t.message}`)}else throw Error(`Invalid target: "${t}" is not a valid target from the root node. Did you mean ".${t}"?`)})}(e,n),o={...r,actions:S(r.actions),guard:r.guard,target:s,source:e,reenter
2:i,eventType:t,toJSON:()=>({...o,source:`#${e.id}`,target:s?s.map(e=>`#${e.id}`):void 0})};return o}function es(e){let t=$(e.config.target);return t?{target:t.map(t=>"string"==typeof t?el(e.parent,t):t)}:e.parent.initial}function eo(e){return"history"===e.type}function ea(e){let t=eu(e);for(let r of t)for(let n of K(r,e))t.add(n);return t}function eu(e){let t=new Set;return!function e(r){if(!t.has(r)){if(t.add(r),"compound"===r.type)e(r.initial.target[0]);else if("parallel"===r.type)for(let t of Y(r))e(t)}}(e),t}function ec(e,t){if(en(t))return e.machine.getStateNodeById(t);if(!e.states)throw Error(`Unable to retrieve child state '${t}' from '${e.id}'; no child states exist.`);let r=e.states[t];if(!r)throw Error(`Child state '${t}' does not exist on '${e.id}'`);return r}function el(e,t){if("string"==typeof t&&en(t))try{return e.machine.getStateNodeById(t)}catch{}let r=_(t).slice(),n=e;for(;r.length;){let e=r.shift();if(!e.length)break;n=ec(n,e)}return n}function ef(e,t){if("string"==typeof t){let r=e.states[t];if(!r)throw Error(`State '${t}' does not exist on '${e.id}'`);return[e,r]}let r=Object.keys(t),n=r.map(t=>ec(e,t)).filter(Boolean);return[e.machine.root,e].concat(n,r.reduce((r,n)=>{let i=ec(e,n);if(!i)return r;let s=ef(i,t[n]);return r.concat(s)},[]))}function eh(e,t){let r=e;for(;r.parent&&r.parent!==t;)r=r.parent;return r.parent===t}function ed(e,t,r){let n=new Set;for(let i of e){let e=!1,s=new Set;for(let o of n)if(function(e,t){let r=new Set(e),n=new Set(t);for(let e of r)if(n.has(e))return!0;for(let e of n)if(r.has(e))return!0;return!1}(eg([i],t,r),eg([o],t,r))){if(eh(i.source,o.source))s.add(o);else{e=!0;break}}if(!e){for(let e of s)n.delete(e);n.add(i)}}return Array.from(n)}function ep(e,t){if(!e.target)return[];let r=new Set;for(let n of e.target)if(eo(n)){if(t[n.id])for(let e of t[n.id])r.add(e);else for(let e of ep(es(n),t))r.add(e)}else r.add(n);return[...r]}function ey(e,t){let r=ep(e,t);if(!r)return;if(!e.reenter&&r.every(t=>t===e.source||eh(t,e.source)))return e.source;let n=function(e){let[t,...r]=e;for(let e of K(t,void 0))if(r.every(t=>eh(t,e)))return e}(r.concat(e.source));return n||(e.reenter?void 0:e.source.machine.root)}function eg(e,t,r){let n=new Set;for(let i of e)if(i.target?.length){let e=ey(i,r);for(let r of(i.reenter&&i.source===e&&n.add(e),t))eh(r,e)&&n.add(r)}return[...n]}function em(e,t,r,n,i,s){let o=[];if(!e.length)return[t,o];let a=r.actionExecutor;r.actionExecutor=e=>{o.push(e),a(e)};try{let a=new Set(t._nodes),u=t.historyValue,c=ed(e,a,u),l=t;i||([l,u]=function(e,t,r,n,i,s,o,a){let u,c=e,l=eg(n,i,s);for(let e of(l.sort((e,t)=>t.order-e.order),l))for(let t of function(e){return Object.keys(e.states).map(t=>e.states[t]).filter(e=>"history"===e.type)}(e)){let r;r="deep"===t.history?t=>Z(t)&&eh(t,e):t=>t.parent===e,(u??={...s})[t.id]=Array.from(i).filter(r)}for(let e of l)c=ew(c,t,r,[...e.exit,...e.invoke.map(e=>J(e.id))],o,void 0),i.delete(e);return[c,u||s]}(l,n,r,c,a,u,s,r.actionExecutor)),l=ew(l,n,r,c.flatMap(e=>e.actions),s,void 0),l=function(e,t,r,n,i,s,o,a){let u=e,c=new Set,l=new Set;(function(e,t,r,n){for(let i of e){let e=ey(i,t);for(let s of i.target||[])!eo(s)&&(i.source!==s||i.source!==e||i.reenter)&&(n.add(s),r.add(s)),ev(s,t,r,n);for(let s of ep(i,t)){let o=K(s,e);e?.type==="parallel"&&o.push(e),eb(n,t,r,o,!i.source.parent&&i.reenter?void 0:e)}}})(n,o,l,c),a&&l.add(e.machine.root);let f=new Set;for(let e of[...c].sort((e,t)=>e.order-t.order)){i.add(e);let n=[];for(let t of(n.push(...e.entry),e.invoke))n.push(W(t.src,{...t,syncSnapshot:!!t.onSnapshot}));if(l.has(e)){let t=e.initial.actions;n.push(...t)}if(u=ew(u,t,r,n,s,e.invoke.map(e=>e.id)),"final"===e.type){let n=e.parent,o=n?.type==="parallel"?n:n?.parent,a=o||e;for(n?.type==="compound"&&s.push(m(n.id,void 0!==e.output?R(e.output,u.context,t,r.self):void 0));o?.type==="parallel"&&!f.has(o)&&er(i,o);)f.add(o),s.push(m(o.id)),a=o,o=o.parent;if(o)continue;u=eA(u,{status:"done",output:function(e,t,r,n,i){if(void 0===n.output)return;let s=m(i.id,void 0!==i.output&&i.parent?R(i.output,e.context,t,r.self):void 0);return R(n.output,e.context,s,r.self)}(u,t,r,u.machine.root,a)})}}return u}(l,n,r,c,a,s,u,i);let f=[...a];"done"===l.status&&(l=ew(l,n,r,f.sort((e,t)=>
2t.order-e.order).flatMap(e=>e.exit),s,void 0));try{if(u===t.historyValue&&function(e,t){if(e.length!==t.size)return!1;for(let r of e)if(!t.has(r))return!1;return!0}(t._nodes,a))return[l,o];return[eA(l,{_nodes:f,historyValue:u}),o]}catch(e){throw e}}finally{r.actionExecutor=a}}function ev(e,t,r,n){if(eo(e)){if(t[e.id]){let i=t[e.id];for(let e of i)n.add(e),ev(e,t,r,n);for(let s of i)eb(n,t,r,K(s,e.parent))}else{let i=es(e);for(let s of i.target)n.add(s),i===e.parent?.initial&&r.add(e.parent),ev(s,t,r,n);for(let s of i.target)eb(n,t,r,K(s,e.parent))}}else if("compound"===e.type){let[i]=e.initial.target;eo(i)||(n.add(i),r.add(i)),ev(i,t,r,n),eb(n,t,r,K(i,e))}else if("parallel"===e.type)for(let i of Y(e).filter(e=>!eo(e)))[...n].some(e=>eh(e,i))||(eo(i)||(n.add(i),r.add(i)),ev(i,t,r,n))}function eb(e,t,r,n,i){for(let s of n)if((!i||eh(s,i))&&e.add(s),"parallel"===s.type)for(let n of Y(s).filter(e=>!eo(e)))[...e].some(e=>eh(e,n))||(e.add(n),ev(n,t,r,e))}function ew(e,t,r,n,i,s){let o=s?[]:void 0,a=function e(t,r,n,i,s,o){let{machine:a}=t,u=t;for(let t of i){var c;let i="function"==typeof t,l=i?t:(c="string"==typeof t?t:t.type,a.implementations.actions[c]),f={context:u.context,event:r,self:n.self,system:n.system},h=i||"string"==typeof t?void 0:"params"in t?"function"==typeof t.params?t.params({context:u.context,event:r}):t.params:void 0;if(!l||!("resolve"in l)){n.actionExecutor({type:"string"==typeof t?t:"object"==typeof t?t.type:t.name||"(anonymous)",info:f,params:h,exec:l});continue}let[d,p,y]=l.resolve(n,u,f,h,l,s);u=d,"retryResolve"in l&&o?.push([l,p]),"execute"in l&&n.actionExecutor({type:l.type,info:f,params:p,exec:l.execute.bind(null,n,p)}),y&&(u=e(u,r,n,y,s,o))}return u}(e,t,r,n,{internalQueue:i,deferredActorIds:s},o);return o?.forEach(([e,t])=>{e.retryResolve(r,a,t)}),a}function eE(e,t,r,n){let i=e,s=[];function o(e,t,n){r.system._sendInspectionEvent({type:"@xstate.microstep",actorRef:r.self,event:t,snapshot:e[0],_transitions:n}),s.push(e)}if(t.type===g)return o([i=eA(e_(i,t,r),{status:"stopped"}),[]],t,[]),{snapshot:i,microsteps:s};let a=t;if(a.type!==y){let t=a,u=t.type.startsWith("xstate.error.actor"),c=ex(t,i);if(u&&!c.length)return o([i=eA(e,{status:"error",error:t.error}),[]],t,[]),{snapshot:i,microsteps:s};let l=em(c,e,r,a,!1,n);i=l[0],o(l,t,c)}let u=!0;for(;"active"===i.status;){let e=u?function(e,t){let r=new Set;for(let n of e._nodes.filter(Z))e:for(let i of[n].concat(K(n,void 0)))if(i.always){for(let n of i.always)if(void 0===n.guard||X(n.guard,e.context,t,e)){r.add(n);break e}}return ed(Array.from(r),new Set(e._nodes),e.historyValue)}(i,a):[],t=e.length?i:void 0;if(!e.length){if(!n.length)break;e=ex(a=n.shift(),i)}let s=em(e,i,r,a,!1,n);u=(i=s[0])!==t,o(s,a,e)}return"active"!==i.status&&e_(i,a,r),{snapshot:i,microsteps:s}}function e_(e,t,r){return ew(e,t,r,Object.values(e.children).map(e=>J(e)),[],void 0)}function ex(e,t){return t.machine.getTransitionData(t,e)}let eI=function(e){return function e(t,r){let n=x(t),i=x(r);return"string"==typeof i?"string"==typeof n&&i===n:"string"==typeof n?n in i:Object.keys(n).every(t=>t in i&&e(n[t],i[t]))}(e,this.value)},eS=function(e){return this.tags.has(e)},eR=function(e){let t=this.machine.getTransitionData(this,e);return!!t?.length&&t.some(e=>void 0!==e.target||e.actions.length)},eC=function(){let{_nodes:e,tags:t,machine:r,getMeta:n,toJSON:i,can:s,hasTag:o,matches:a,...u}=this;return{...u,tags:Array.from(t)}},eT=function(){return this._nodes.reduce((e,t)=>(void 0!==t.meta&&(e[t.id]=t.meta),e),{})};function e$(e,t){return{status:e.status,output:e.output,error:e.error,machine:t,context:e.context,_nodes:e._nodes,value:et(t.root,e._nodes),tags:new Set(e._nodes.flatMap(e=>e.tags)),children:e.children,historyValue:e.historyValue||{},matches:eI,hasTag:eS,can:eR,getMeta:eT,toJSON:eC}}function eA(e,t={}){return e$({...e,...t},e.machine)}function eO(e,t,r,n,{event:i,id:s,delay:o},{internalQueue:a}){let u;let c=t.machine.implementations.delays;if("string"==typeof i)throw Error(`Only event objects may be used with raise; use raise({ type: "${i}" }) instead`);let l="function"==typeof i?i(r,n):i;if("string"==typeof o){let e=c&&c[o];u="function"==typeof e?e(r,n):e}else u="function"==typeof o?o(r,n):o;return"number"!=typeof u&&a.push(l),[t,{event:l,id:s,delay:u},void 0]}function eq(e,t){let{event:r,delay:n,id:i}=t;if("number"==typeof n){e.defer(()=>{let t=e.self;e.system.scheduler.schedule(t,t,r,n,i)});return}}function ek(e,t){function r(e,t){}return r.type="xstate.raise",r.event=e,r.id=t?.id,r.delay=t?.delay,r.resolve=eO,r.execute=eq,r}let ej=new WeakMap,eU="xstate.observable.error",eP="xstate.observable.complete";function eB(e){return{config:e,transition:(e,t)=>{if("active"!==e.status)return e;switch(t.type){case eU:return{...e,status:"error",error:t.data,input:void 0,_subscription:void 0};case eP:return{...e,status:"done",input:void 0,_subscription:void 0};case g:return e._subscription.unsubscribe(),{...e,status:"stopped",input:void 0,_subscription:void 0};default:return e}},getInitialSnapshot:(e,t)=>
2({status:"active",output:void 0,error:void 0,context:void 0,input:t,_subscription:void 0}),start:(t,{self:r,system:n,emit:i})=>{"done"!==t.status&&(t._subscription=e({input:t.input,system:n,self:r,emit:i}).subscribe({next:e=>{r._parent&&n._relay(r,r._parent,e)},error:e=>{n._relay(r,r,{type:eU,data:e})},complete:()=>{n._relay(r,r,{type:eP})}}))},getPersistedSnapshot:({_subscription:e,...t})=>t,restoreSnapshot:e=>({...e,_subscription:void 0})}}function eM(e,t,r,n,{assignment:i}){if(!t.context)throw Error("Cannot assign to undefined `context`. Ensure that `context` is defined in the machine config.");let s={},o={context:t.context,event:r.event,spawn:function(e,{machine:t,context:r},n,i){let s=(s,o)=>{if("string"!=typeof s)return L(s,{id:o?.id,parent:e.self,syncSnapshot:o?.syncSnapshot,input:o?.input,src:s,systemId:o?.systemId});{let a=O(t,s);if(!a)throw Error(`Actor logic '${s}' not implemented in machine '${t.id}'`);let u=L(a,{id:o?.id,parent:e.self,syncSnapshot:o?.syncSnapshot,input:"function"==typeof o?.input?o.input({context:r,event:n,self:e.self}):o?.input,src:s,systemId:o?.systemId});return i[u.id]=u,u}};return(t,r)=>{let n=s(t,r);return i[n.id]=n,e.defer(()=>{n._processingStatus!==P.Stopped&&n.start()}),n}}(e,t,r.event,s),self:e.self,system:e.system},a={};if("function"==typeof i)a=i(o,n);else for(let e of Object.keys(i)){let t=i[e];a[e]="function"==typeof t?t(o,n):t}let u=Object.assign({},t.context,a);return[eA(t,{context:u,children:Object.keys(s).length?{...t.children,...s}:t.children}),void 0,void 0]}function eL(e){function t(e,t){}return t.type="xstate.assign",t.assignment=e,t.resolve=eM,t}new WeakMap,o=void 0,s=e=>void 0,e=>e;let eD=new WeakMap;function eF(e,t,r){let n=eD.get(e);return n?t in n||(n[t]=r()):(n={[t]:r()},eD.set(e,n)),n[t]}let eN={},ez=e=>"string"==typeof e?{type:e}:"function"==typeof e?"resolve"in e?{type:e.type}:{type:e.name}:e;class eV{constructor(e,t){if(this.config=e,this.key=void 0,this.id=void 0,this.type=void 0,this.path=void 0,this.states=void 0,this.history=void 0,this.entry=void 0,this.exit=void 0,this.parent=void 0,this.machine=void 0,this.meta=void 0,this.output=void 0,this.order=-1,this.description=void 0,this.tags=[],this.transitions=void 0,this.always=void 0,this.parent=t._parent,this.key=t._key,this.machine=t._machine,this.path=this.parent?this.parent.path.concat(this.key):[],this.id=this.config.id||[this.machine.id,...this.path].join("."),this.type=this.config.type||(this.config.states&&Object.keys(this.config.states).length?"compound":this.config.history?"history":"atomic"),this.description=this.config.description,this.order=this.machine.idMap.size,this.machine.idMap.set(this.id,this),this.states=this.config.states?I(this.config.states,(e,t)=>new eV(e,{_parent:this,_key:t,_machine:this.machine})):eN,"compound"===this.type&&!this.config.initial)throw Error(`No initial state specified for compound state node "#${this.id}". Try adding { initial: "${Object.keys(this.states)[0]}" } to the state config.`);this.history=!0===this.config.history?"shallow":this.config.history||!1,this.entry=S(this.config.entry).slice(),this.exit=S(this.config.exit).slice(),this.meta=this.config.meta,this.output="final"!==this.type&&this.parent?void 0:this.config.output,this.tags=S(e.tags).slice()}_initialize(){this.transitions=function(e){let t=new Map;if(e.config.on)for(let r of Object.keys(e.config.on)){if(""===r)throw Error('Null events ("") cannot be specified as a transition key. Use `always: { ... }` instead.');let n=e.config.on[r];t.set(r,T(n).map(t=>ei(e,r,t)))}if(e.config.onDone){let r=`xstate.done.state.${e.id}`;t.set(r,T(e.config.onDone).map(t=>ei(e,r,t)))}for(let r of e.invoke){if(r.onDone){let n=`xstate.done.actor.${r.id}`;t.set(n,T(r.onDone).map(t=>ei(e,n,t)))}if(r.onError){let n=`xstate.error.actor.${r.id}`;t.set(n,T(r.onError).map(t=>ei(e,n,t)))}if(r.onSnapshot){let n=`xstate.snapshot.${r.id}`;t.set(n,T(r.onSnapshot).map(t=>ei(e,n,t)))}}for(let r of e.after){let e=t.get(r.eventType);e||(e=[],t.set(r.eventType,e)),e.push(r)}return t}(this),this.config.always&&(this.always=T(this.config.always).map(e=>
2ei(this,"",e))),Object.keys(this.states).forEach(e=>{this.states[e]._initialize()})}get definition(){return{id:this.id,key:this.key,version:this.machine.version,type:this.type,initial:this.initial?{target:this.initial.target,source:this,actions:this.initial.actions.map(ez),eventType:null,reenter:!1,toJSON:()=>({target:this.initial.target.map(e=>`#${e.id}`),source:`#${this.id}`,actions:this.initial.actions.map(ez),eventType:null})}:void 0,history:this.history,states:I(this.states,e=>e.definition),on:this.on,transitions:[...this.transitions.values()].flat().map(e=>({...e,actions:e.actions.map(ez)})),entry:this.entry.map(ez),exit:this.exit.map(ez),meta:this.meta,order:this.order||-1,output:this.output,invoke:this.invoke,description:this.description,tags:this.tags}}toJSON(){return this.definition}get invoke(){return eF(this,"invoke",()=>S(this.config.invoke).map((e,t)=>{var r,n;let{src:i,systemId:s}=e,o=e.id??(r=this.id,`${t}.${r}`),a="string"==typeof i?i:`xstate.invoke.${n=this.id,`${t}.${n}`}`;return{...e,src:a,id:o,systemId:s,toJSON(){let{onDone:t,onError:r,...n}=e;return{...n,type:"xstate.invoke",src:a,id:o}}}}))}get on(){return eF(this,"on",()=>[...this.transitions].flatMap(([e,t])=>t.map(t=>[e,t])).reduce((e,[t,r])=>(e[t]=e[t]||[],e[t].push(r),e),{}))}get after(){return eF(this,"delayedTransitions",()=>(function(e){let t=e.config.after;if(!t)return[];let r=t=>{var r;let n=(r=e.id,{type:`xstate.after.${t}.${r}`}),i=n.type;return e.entry.push(ek(n,{id:i,delay:t})),e.exit.push(N(i)),i};return Object.keys(t).flatMap(e=>{let n=t[e],i=Number.isNaN(+e)?e:+e,s=r(i);return S("string"==typeof n?{target:n}:n).map(e=>({...e,event:s,delay:i}))}).map(t=>{let{delay:r}=t;return{...ei(e,t.event,t),delay:r}})})(this))}get initial(){return eF(this,"initial",()=>(function(e,t){let r="string"==typeof t?e.states[t]:t?e.states[t.target]:void 0;if(!r&&t)throw Error(`Initial state node "${t}" not found on parent state node #${e.id}`);let n={source:e,actions:t&&"string"!=typeof t?S(t.actions):[],eventType:null,reenter:!1,target:r?[r]:[],toJSON:()=>({...n,source:`#${e.id}`,target:r?[`#${r.id}`]:[]})};return n})(this,this.config.initial))}next(e,t){let r;let n=t.type,i=[];for(let s of eF(this,`candidates-${n}`,()=>{var e;return e=this,e.transitions.get(n)||[...e.transitions.keys()].filter(e=>q(n,e)).sort((e,t)=>t.length-e.length).flatMap(t=>e.transitions.get(t))})){let{guard:o}=s,a=e.context,u=!1;try{u=!o||X(o,a,t,e)}catch(t){let e="string"==typeof o?o:"object"==typeof o?o.type:void 0;throw Error(`Unable to evaluate guard ${e?`'${e}' `:""}in transition for event '${n}' in state node '${this.id}': 3${t.message}`)}if(u){i.push(...s.actions),r=s;break}}return r?[r]:void 0}get events(){return eF(this,"events",()=>{let{states:e}=this,t=new Set(this.ownEvents);if(e)for(let r of Object.keys(e)){let n=e[r];if(n.states)for(let e of n.events)t.add(`${e}`)}return Array.from(t)})}get ownEvents(){return Array.from(new Set(Object.keys(Object.fromEntries(this.transitions)).filter(e=>this.transitions.get(e).some(e=>!(!e.target&&!e.actions.length&&!e.reenter)))))}}class eW{constructor(e,t){this.config=e,this.version=void 0,this.schemas=void 0,this.implementations=void 0,this.__xstatenode=!0,this.idMap=new Map,this.root=void 0,this.id=void 0,this.states=void 0,this.events=void 0,this.id=e.id||"(machine)",this.implementations={actors:t?.actors??{},actions:t?.actions??{},delays:t?.delays??{},guards:t?.guards??{}},this.version=this.config.version,this.schemas=this.config.schemas,this.transition=this.transition.bind(this),this.getInitialSnapshot=this.getInitialSnapshot.bind(this),this.getPersistedSnapshot=this.getPersistedSnapshot.bind(this),this.restoreSnapshot=this.restoreSnapshot.bind(this),this.start=this.start.bind(this),this.root=new eV(e,{_key:this.id,_machine:this}),this.root._initialize(),function(e){let t=[],r=n=>{Object.values(n).forEach(n=>{if(n.config.route&&n.config.id){let r=n.config.id,i=n.config.route.guard,s={...n.config.route,guard:(e,t)=>e.event.to===`#${r}`&&(!i||"function"!=typeof i||i(e,t)),target:`#${r}`};t.push(ei(e,"xstate.route",s))}n.states&&r(n.states)})};r(e.states),t.length>0&&e.transitions.set("xstate.route",t)}(this.root),this.states=this.root.states,this.events=this.root.events}provide(e){let{actions:t,guards:r,actors:n,delays:i}=this.implementations;return new eW(this.config,{actions:{...t,...e.actions},guards:{...r,...e.guards},actors:{...n,...e.actors},delays:{...i,...e.delays}})}resolveState(e){let t=function(e,t){let r=Q(ef(e,t));return et(e,[...r])}(this.root,e.value),r=Q(ef(this.root,t));return e$({_nodes:[...r],context:e.context||{},children:{},status:er(r,this.root)?"done":e.status||"active",output:e.output,error:e.error,historyValue:e.historyValue},this)}transition(e,t,r){return eE(e,t,r,[]).snapshot}microstep(e,t,r){return eE(e,t,r,[]).microsteps.map(([e])=>e)}getTransitionData(e,t){return function e(t,r,n,i){return"string"==typeof r?function(e,t,r,n){let i=ec(e,t).next(r,n);return i&&i.length?i:e.next(r,n)}(t,r,n,i):1===Object.keys(r).length?function(t,r,n,i){let s=Object.keys(r),o=e(ec(t,s[0]),r[s[0]],n,i);return o&&o.length?o:t.next(n,i)}(t,r,n,i):function(t,r,n,i){let s=[];for(let o of Object.keys(r)){let a=r[o];if(!a)continue;let u=e(ec(t,o),a,n,i);u&&s.push(...u)}return s.length?s:t.next(n,i)}(t,r,n,i)}(this.root,e.value,e,t)||[]}
3_getPreInitialState(e,t,r){let{context:n}=this.config,i=e$({context:"function"!=typeof n&&n?n:{},_nodes:[this.root],children:{},status:"active"},this);return"function"==typeof n?ew(i,t,e,[eL(({spawn:e,event:t,self:r})=>n({spawn:e,input:t.input,self:r}))],r,void 0):i}getInitialSnapshot(e,t){var r;let n=b(t),i=[],s=this._getPreInitialState(e,n,i),[o]=em([{target:[...eu(r=this.root)],source:r,reenter:!0,actions:[],eventType:null,toJSON:null}],s,e,n,!0,i),{snapshot:a}=eE(o,n,e,i);return a}start(e){Object.values(e.children).forEach(e=>{"active"===e.getSnapshot().status&&e.start()})}getStateNodeById(e){let t=_(e),r=t.slice(1),n=en(t[0])?t[0].slice(1):t[0],i=this.idMap.get(n);if(!i)throw Error(`Child state node '#${n}' does not exist on machine '${this.id}'`);return el(i,r)}get definition(){return this.root.definition}toJSON(){return this.definition}getPersistedSnapshot(e,t){return function(e,t){let{_nodes:r,tags:n,machine:i,children:s,context:o,can:a,hasTag:u,matches:c,getMeta:l,toJSON:f,...h}=e,d={};for(let e in s){let r=s[e];d[e]={snapshot:r.getPersistedSnapshot(t),src:r.src,systemId:r.systemId,syncSnapshot:r._syncSnapshot}}return{...h,context:function e(t){let r;for(let n in t){let i=t[n];if(i&&"object"==typeof i){if("sessionId"in i&&"send"in i&&"ref"in i)(r??=Array.isArray(t)?t.slice():{...t})[n]={xstate$$type:1,id:i.id};else{let s=e(i);s!==i&&((r??=Array.isArray(t)?t.slice():{...t})[n]=s)}}}return r??t}(o),children:d,historyValue:function(e){if("object"!=typeof e||null===e)return{};let t={};for(let r in e){let n=e[r];Array.isArray(n)&&(t[r]=n.map(e=>({id:e.id})))}return t}(h.historyValue)}}(e,t)}restoreSnapshot(e,t){let r={},n=e.children;Object.keys(n).forEach(e=>{let i=n[e],s=i.snapshot,o=i.src,a="string"==typeof o?O(this,o):o;if(!a)return;let u=L(a,{id:e,parent:t.self,syncSnapshot:i.syncSnapshot,snapshot:s,src:o,systemId:i.systemId});r[e]=u});let i=function(e,t){if(!t||"object"!=typeof t)return{};let r={};for(let n in t)for(let i of t[n]){let t=function(e,t){if(t instanceof eV)return t;try{return e.machine.getStateNodeById(t.id)}catch{}}(e,i);t&&(r[n]??=[],r[n].push(t))}return r}(this.root,e.historyValue),s=e$({...e,children:r,_nodes:Array.from(Q(ef(this.root,e.value))),historyValue:i},this),o=new Set;return!function e(t,r){if(!o.has(t))for(let n in o.add(t),t){let i=t[n];if(i&&"object"==typeof i){if("xstate$$type"in i&&1===i.xstate$$type){t[n]=r[i.id];continue}e(i,r)}}}(s.context,r),s}}function eH(e,t,r,n,{event:i}){return[t,{event:"function"==typeof i?i(r,n):i},void 0]}function eG(e,{event:t}){e.defer(()=>e.emit(t))}function eJ(e){function t(e,t){}return t.type="xstate.emit",t.event=e,t.resolve=eH,t.execute=eG,t}let eX=((a={}).Parent="#_parent",a.Internal="#_internal",a);function eZ(e,t,r,n,{to:i,event:s,id:o,delay:a},u){let c,l;let f=t.machine.implementations.delays;if("string"==typeof s)throw Error(`Only event objects may be used with sendTo; use sendTo({ type: "${s}" }) instead`);let h="function"==typeof s?s(r,n):s;if("string"==typeof a){let e=f&&f[a];c="function"==typeof e?e(r,n):e}else c="function"==typeof a?a(r,n):a;let d="function"==typeof i?i(r,n):i;if("string"==typeof d){if(!(l=d===eX.Parent?e.self._parent:d===eX.Internal?e.self:d.startsWith("#_")?t.children[d.slice(2)]:u.deferredActorIds?.includes(d)?d:t.children[d]))throw Error(`Unable to send event to actor '${d}' from machine '${t.machine.id}'.`)}else l=d||e.self;return[t,{to:l,targetId:"string"==typeof d?d:void 0,event:h,id:o,delay:c},void 0]}function eY(e,t,r){"string"==typeof r.to&&(r.to=t.children[r.to])}function eK(e,t){e.defer(()=>{let{to:r,event:n,delay:i,id:s}=t;if("number"==typeof i){e.system.scheduler.schedule(e.self,r,n,i,s);return}e.system._relay(e.self,r,"xstate.error"===n.type?v(e.self.id,n.data):n)})}function eQ(e,t,r){function n(e,t){}return n.type="xstate.sendTo",n.to=e,n.event=t,n.id=r?.id,n.delay=r?.delay,n.resolve=eZ,n.retryResolve=eY,n.execute=eK,n}function e0(e,t,r,n,{collect:i}){let s=[],o=function(e){s.push(e)};return o.assign=(...e)=>{s.push(eL(...e))},o.cancel=(...e)=>{s.push(N(...e))},o.raise=(...e)=>
3{s.push(ek(...e))},o.sendTo=(...e)=>{s.push(eQ(...e))},o.sendParent=(...e)=>{s.push(function(e,t){return eQ(eX.Parent,e,t)}(...e))},o.spawnChild=(...e)=>{s.push(W(...e))},o.stopChild=(...e)=>{s.push(J(...e))},o.emit=(...e)=>{s.push(eJ(...e))},i({context:r.context,event:r.event,enqueue:o,check:e=>X(e,t.context,r.event,t),self:e.self,system:e.system},n),[t,void 0,s]}function e1(e){function t(e,t){}return t.type="xstate.enqueueActions",t.collect=e,t.resolve=e0,t}function e2(e,t,r,n,{value:i,label:s}){return[t,{value:"function"==typeof i?i(r,n):i,label:s},void 0]}function e3({logger:e},{value:t,label:r}){r?e(r,t):e(t)}function e6(e=({context:e,event:t})=>({context:e,event:t}),t){function r(e,t){}return r.type="xstate.log",r.value=e,r.label=t,r.resolve=e2,r.execute=e3,r}function e5(e,t){let r=S(t);if(!r.some(t=>q(e.type,t))){let t=1===r.length?`type matching "${r[0]}"`:`one of types matching "${r.join('", "')}"`;throw Error(`Expected event ${JSON.stringify(e)} to have ${t}`)}}function e8({schemas:e,actors:t,actions:r,guards:n,delays:i}){return{assign:eL,sendTo:eQ,raise:ek,log:e6,cancel:N,stopChild:J,enqueueActions:e1,emit:eJ,spawnChild:W,createStateConfig:e=>e,createAction:e=>e,createMachine:s=>new eW({...s,schemas:e},{actors:t,actions:r,guards:n,delays:i}),extend:s=>e8({schemas:e,actors:t,actions:{...r,...s.actions},guards:{...n,...s.guards},delays:{...i,...s.delays}})}}var e4=r(93103),e9=r(29978),e7=r(8082),te=r(55420),tt=r(67383),tr=r(39114),tn=r(94690),ti=r(86442),ts=["addListener","removeListener"],to=["addEventListener","removeEventListener"],ta=["on","off"];function tu(e,t,r,n){if((0,tn.m)(r)&&(n=r,r=void 0),n)return tu(e,t,r).pipe((0,ti.Z)(n));var i=(0,e9.CR)((0,tn.m)(e.addEventListener)&&(0,tn.m)(e.removeEventListener)?to.map(function(n){return function(i){return e[n](t,i,r)}}):(0,tn.m)(e.addListener)&&(0,tn.m)(e.removeListener)?ts.map(tc(e,t)):(0,tn.m)(e.on)&&(0,tn.m)(e.off)?ta.map(tc(e,t)):[],2),s=i[0],o=i[1];if(!s&&(0,tr.z)(e))return(0,tt.z)(function(e){return tu(e,t,r)})((0,e7.Xf)(e));if(!s)throw TypeError("Invalid event target");return new te.y(function(e){var t=function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];return e.next(1<t.length?t:t[0])};return s(t),function(){return o(t)}})}function tc(e,t){return function(r){return function(n){return e[r](t,n)}}}var tl=r(33633),tf=r(22018),th=r(28756),td=r(42448),tp=r(12204),ty=r(85580),tg=r(33174);function tm(e){return e<=0?function(){return tg.E}:(0,td.e)(function(t,r){var n=0;t.subscribe((0,tp.x)(r,function(t){++n<=e&&(r.next(t),e<=n&&r.complete())}))})}var tv=r(36896);let tb=e=>({context:t})=>{let{count:r,include:n,exclude:i,responseType:s="message.received"}=e;return{count:r,domain:t.domain,from:t.connectTo,include:n?Array.isArray(n)?n:[n]:[],exclude:i?Array.isArray(i)?i:[i]:[],responseType:s,target:t.target,to:t.name}},tw=e=>t=>{let{data:r}=t;return(!e.include.length||e.include.includes(r.type))&&(!e.exclude.length||!e.exclude.includes(r.type))&&r.domain===e.domain&&r.from===e.from&&r.to===e.to&&(!e.target||t.source===e.target)},tE=e=>t=>({type:e,message:t}),t_=(0,e4.P)(()=>tu(window,"message")),tx=e=>eB(({input:t})=>{var r,n,i,s;return t_.pipe(e?(0,tl.U)(e):(0,tf.z)(),(0,th.h)(tw(t)),(0,tl.U)(tE(t.responseType)),t.count?(0,tf.z)((r=t.count,void 0===n&&(n=null),n=null!=n?n:r,(0,td.e)(function(e,t){var i=[],s=0;e.subscribe((0,tp.x)(t,function(e){var o,a,u,c,l=null;s++%n==0&&i.push([]);try{for(var f=(0,e9.XA)(i),h=f.next();!h.done;h=f.next()){var d=h.value;d.push(e),r<=d.length&&(l=null!=l?l:[]).push(d)}}catch(e){o={error:e}}finally{try{h&&!h.done&&(a=f.return)&&a.call(f)}finally{if(o)throw o.error}}if(l)try{for(var p=(0,e9.XA)(l),y=p.next();!y.done;y=p.next()){var d=y.value;(0,ty.P)(i,d),t.next(d)}}catch(e){u={error:e}}finally{try{y&&!y.done&&(c=p.return)&&c.call(p)}finally{if(u)throw u.error}}},function(){var e,r;try{for(var n=(0,e9.XA)(i),s=n.next();!s.done;s=n.next()){var o=s.value;t.next(o)}}catch(t){e={error:t}}finally{try{s&&!s.done&&(r=n.return)&&r.call(n)}finally{if(e)throw e.error}}t.complete()},void 0,function(){i=null}))})),(i=e=>
3e,(0,tn.m)(void 0)?(0,tt.z)(i,s,1):(0,tt.z)(i,1)),tm(t.count)):(0,tf.z)())}),tI="sanity/comlink",tS="comlink/response",tR="comlink/heartbeat",tC="comlink/disconnect",tT="comlink/handshake/syn",t$="comlink/handshake/syn-ack",tA="comlink/handshake/ack",tO=e=>t=>t.pipe(tm(1),(0,tl.U)(()=>{throw Error(e)})),tq=()=>e8({types:{},actors:{listen:eB(({input:e})=>{let t=e.signal?tu(e.signal,"abort").pipe(tO(`Request ${e.requestId} aborted`)):tg.E;return tu(window,"message").pipe((0,th.h)(t=>t.data?.type===tS&&t.data?.responseTo===e.requestId&&!!t.source&&e.sources.has(t.source)),tm(e.sources.size),(0,td.e)(function(e,r){(0,e7.Xf)(t).subscribe((0,tp.x)(r,function(){return r.complete()},tv.Z)),r.closed||e.subscribe(r)}))})},actions:{"send message":({context:e},t)=>{let{sources:r,targetOrigin:n}=e,{message:i}=t;r.forEach(e=>{e.postMessage(i,{targetOrigin:n})})},"on success":eQ(({context:e})=>e.parentRef,({context:e,self:t})=>(e.response&&e.resolvable?.resolve(e.response),{type:"request.success",requestId:t.id,response:e.response,responseTo:e.responseTo})),"on fail":eQ(({context:e})=>e.parentRef,({context:e,self:t})=>(e.suppressWarnings||console.warn(`[@sanity/comlink] Received no response to message '${e.type}' on client '${e.from}' (ID: '${e.id}').`),e.resolvable?.reject(Error("No response received")),{type:"request.failed",requestId:t.id})),"on abort":eQ(({context:e})=>e.parentRef,({context:e,self:t})=>(e.resolvable?.reject(Error("Request aborted")),{type:"request.aborted",requestId:t.id}))},guards:{expectsResponse:({context:e})=>e.expectResponse},delays:{initialTimeout:0,responseTimeout:({context:e})=>e.responseTimeout??3e3}}).createMachine({context:({input:e})=>({channelId:e.channelId,data:e.data,domain:e.domain,expectResponse:e.expectResponse??!1,from:e.from,id:`msg-${h()}`,parentRef:e.parentRef,resolvable:e.resolvable,response:null,responseTimeout:e.responseTimeout,responseTo:e.responseTo,signal:e.signal,sources:e.sources instanceof Set?e.sources:new Set([e.sources]),suppressWarnings:e.suppressWarnings,targetOrigin:e.targetOrigin,to:e.to,type:e.type}),initial:"idle",on:{abort:".aborted"},states:{idle:{after:{initialTimeout:[{target:"sending"}]}},sending:{entry:{type:"send message",params:({context:e})=>{let{channelId:t,data:r,domain:n,from:i,id:s,responseTo:o,to:a,type:u}=e;return{message:{channelId:t,data:r,domain:n,from:i,id:s,to:a,type:u,responseTo:o}}}},always:[{guard:"expectsResponse",target:"awaiting"},"success"]},awaiting:{invoke:{id:"listen for response",src:"listen",input:({context:e})=>({requestId:e.id,sources:e.sources,signal:e.signal}),onError:"aborted"},after:{responseTimeout:"failed"},on:{message:{actions:eL({response:({event:e})=>e.data.data,responseTo:({event:e})=>e.data.responseTo}),target:"success"}}},failed:{type:"final",entry:"on fail"},success:{type:"final",entry:"on success"},aborted:{type:"final",entry:"on abort"}},output:({context:e,self:t})=>({requestId:t.id,response:e.response,responseTo:e.responseTo})});u=({sendBack:e,input:t})=>{let r=()=>{e(t.event)};t.immediate&&r();let n=setInterval(r,t.interval);return()=>{clearInterval(n)}},e=>e;let tk=()=>e8({types:{},actors:{requestMachine:tq(),listen:tx()},actions:{"buffer handshake":eL({handshakeBuffer:({event:e,context:t})=>(e5(e,"message.received"),[...t.handshakeBuffer,e])}),"buffer message":e1(({enqueue:e})=>{e.assign({buffer:({event:e,context:t})=>(e5(e,"post"),[...t.buffer,{data:e.data,resolvable:e.resolvable,options:e.options}])}),e.emit(({event:e})=>(e5(e,"post"),{type:"buffer.added",message:e.data}))}),"create request":eL({requests:({context:e,event:t,self:r,spawn:n})=>{e5(t,"request");let i=(Array.isArray(t.data)?t.data:[t.data]).map(t=>n("requestMachine",{id:`req-${h()}`,input:{channelId:e.channelId,data:t.data,domain:e.domain,expectResponse:t.expectResponse,from:e.name,parentRef:r,resolvable:t.resolvable,responseTimeout:t.options?.responseTimeout,responseTo:t.responseTo,signal:t.options?.signal,sources:e.target,suppressWarnings:t.options?.suppressWarnings,targetOrigin:e.targetOrigin,to:e.connectTo,type:t.type}}));return[...e.requests,...i]}}),"emit heartbeat":eJ(()=>({type:"heartbeat"})),"emit received message":e1(({enqueue:e})=>{e.emit(({event:e})=>(e5(e,"message.received"),{type:"message",message:e.message.data}))}),"emit status":eJ((e,t)=>({type:"status",status:t.status})),"post message":ek(({event:e})=>(e5(e,"post"),{type:"request",data:{data:e.data.data,expectResponse:!!e.resolvable,type:e.data.type,resolvable:e.resolvable,options:e.options}})),"process pending handshakes":e1(({context:e,enqueue:t})=>
3{e.handshakeBuffer.forEach(e=>t.raise(e)),t.assign({handshakeBuffer:[]})}),"remove request":e1(({context:e,enqueue:t,event:r})=>{e5(r,["request.success","request.failed","request.aborted"]),J(r.requestId),t.assign({requests:e.requests.filter(({id:e})=>e!==r.requestId)})}),"send response":ek(({event:e})=>(e5(e,["message.received","heartbeat.received"]),{type:"request",data:{type:tS,responseTo:e.message.data.id,data:void 0}})),"send handshake syn ack":ek({type:"request",data:{type:t$}}),"send pending messages":e1(({enqueue:e})=>{e.raise(({context:e})=>({type:"request",data:e.buffer.map(({data:e,resolvable:t,options:r})=>({data:e.data,type:e.type,expectResponse:!!t,resolvable:t,options:r}))})),e.emit(({context:e})=>({type:"buffer.flushed",messages:e.buffer.map(({data:e})=>e)})),e.assign({buffer:[]})}),"set connection config":eL({channelId:({event:e})=>(e5(e,"handshake.syn"),e.message.data.channelId),target:({event:e})=>(e5(e,"handshake.syn"),e.message.source||void 0),targetOrigin:({event:e})=>(e5(e,"handshake.syn"),e.message.origin)})},guards:{hasSource:({context:e})=>null!==e.target}}).createMachine({id:"node",context:({input:e})=>({buffer:[],channelId:null,connectTo:e.connectTo,domain:e.domain??tI,handshakeBuffer:[],name:e.name,requests:[],target:void 0,targetOrigin:null}),invoke:{id:"listen for handshake syn",src:"listen",input:tb({include:tT,responseType:"handshake.syn"})},on:{"request.success":{actions:"remove request"},"request.failed":{actions:"remove request"},"request.aborted":{actions:"remove request"},"handshake.syn":{actions:"set connection config",target:".handshaking"}},initial:"idle",states:{idle:{entry:[{type:"emit status",params:{status:"idle"}}],on:{post:{actions:"buffer message"}}},handshaking:{guard:"hasSource",entry:["send handshake syn ack",{type:"emit status",params:{status:"handshaking"}}],invoke:[{id:"listen for handshake ack",src:"listen",input:tb({include:tA,count:1,responseType:"handshake.complete"}),onDone:"connected"},{id:"listen for disconnect",src:"listen",input:tb({include:tC,count:1,responseType:"disconnect"})},{id:"listen for messages",src:"listen",input:tb({exclude:[tC,tT,tA,tR,tS]})}],on:{request:{actions:"create request"},post:{actions:"buffer message"},"message.received":{actions:"buffer handshake"},disconnect:{target:"idle"}}},connected:{entry:["process pending handshakes","send pending messages",{type:"emit status",params:{status:"connected"}}],invoke:[{id:"listen for messages",src:"listen",input:tb({exclude:[tC,tT,tA,tR,tS]})},{id:"listen for heartbeat",src:"listen",input:tb({include:tR,responseType:"heartbeat.received"})},{id:"listen for disconnect",src:"listen",input:tb({include:tC,count:1,responseType:"disconnect"})}],on:{request:{actions:"create request"},post:{actions:"post message"},disconnect:{target:"idle"},"message.received":{actions:["send response","emit received message"]},"heartbeat.received":{actions:["send response","emit heartbeat"]}}}}}),tj=(e,t=tk())=>{let r;let n=L(t,{input:e}),i=new Map,s=new Map;n.on("message",({message:e})=>{let t=i.get(e.type);if(t){t.forEach(t=>t(e.data));return}let r=s.get(e.type);r?r.add(e):s.set(e.type,new Set([e]))});let o=()=>{n.stop()};return{actor:n,fetch:(e,t,r)=>{let i,s;let{responseTimeout:o=1e4,signal:a,suppressWarnings:u}=r||{},c="function"==typeof Promise.withResolvers?Promise.withResolvers():{promise:new Promise((e,t)=>{i=e,s=t}),resolve:i,reject:s};return n.send({type:"post",data:{type:e,data:t},resolvable:c,options:{responseTimeout:o,signal:a,suppressWarnings:u}}),c.promise},machine:t,on:(e,t,r)=>{let n=i.get(e)||new Set;i.has(e)||i.set(e,n),n.add(t);let o=s.get(e);if(o){let n=r?.replay??1;Array.from(o).slice(-n).forEach(({data:e})=>t(e)),s.delete(e)}return()=>{n.delete(t)}},onStatus:(e,t)=>{let i=n.on("status",n=>{r=n.status,t&&n.status!==t||e(n.status)});return r&&e(r),()=>i.unsubscribe()},post:(e,t)=>{n.send({type:"post",data:{type:e,data:t}})},start:()=>(n.start(),o),stop:o}}},90581:function(e,t,r){"use strict";r.d(t,{Bk:function(){return s},Qs:function(){return f},Uw:function(){return a},Y5:function(){return u},id:function(){return c},re:function(){return l}});let n=new Set,i="checking";function s(e){if(i!==e)for(let t of(i=e,n))t()}let o=new Set;function a(e){for(let e of o)e()}let u=new Set,c=null;function l(e){for(let t of(c=e,u))t()}function f(e,t){for(let e of u)e()}},91290:function(e,t,r){"use strict";r.d(t,{default:function(){return s}});var n=r(26742);let i=(0,r(50455).default)(()=>r.e(902).then(r.bind(r,88902)),{loadableGenerated:{webpack:()=>[require.resolveWeak("../_chunks-es/SanityLiveStream.js")]},ssr:!1});function s(e){return(0,n.jsx)(i,{...e})}},68680:function(e,t,r){"use strict";r.d(t,{default:function(){return nh}});var n,i,s,o=r(26742);let a=!(typeof navigator>"u")&&"ReactNative"===navigator.product,u={timeout:a?6e4:12e4},c=function(e){let t={...u,..."string"==typeof e?{url:e}:e};if(t.timeout=function e(t){if(!1===t||0===t)return!1;if(t.connect||t.socket)return t;let r=Number(t);return isNaN(r)?e(u.timeout):{connect:r,socket:r}}(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),n=e.slice(t+1);if(!a)return{url:r,searchParams:new URLSearchParams(n)};if("function"!=typeof decodeURIComponent)throw Error("Broken `URLSearchParams` implementation, and `decodeURIComponent` is not defined");let i=new URLSearchParams;for(let e of n.split("&")){let[t,r]=e.split("=");t&&i.append(l(t),l(r||""))}return{url:r,searchParams:i}}(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 s=r.toString();s&&(t.url=`${e}?${s}`)}}return t.method=t.body&&!t.method?"POST":(t.method||"GET").toUpperCase(),t};function l(e){return decodeURIComponent(e.replace(/\+/g," "))}let f=/^https?:\/\//i,h=function(e){if(!f.test(e.url))throw Error(`"${e.url}" is not a valid URL`)},d=["request","response","progress","error","abort"],p=["processOptions","validateOptions","interceptRequest","finalizeOptions","onRequest","onResponse","onError","onReturn","onHeaders"];var y,g,m,v=(y=function(){if(m)return g;m=1;var e=function(e){return e.replace(/^\s+|\s+$/g,"")};return g=function(t){if(!t)return{};for(var r=Object.create(null),n=e(t).split("\n"),i=0;i<n.length;i++){var s,o=n[i],a=o.indexOf(":"),u=e(o.slice(0,a)).toLowerCase(),c=e(o.slice(a+1));typeof r[u]>"u"?r[u]=c:(s=r[u],"[object Array]"===Object.prototype.toString.call(s))?r[u].push(c):r[u]=[r[u],c]}return r}}())&&y.__esModule&&Object.prototype.hasOwnProperty.call(y,"default")?y.default:y;class b{onabort;onerror;onreadystatechange;ontimeout;readyState=0;response;responseText="";responseType="";status;statusText;withCredentials;#e;#t;#r;#n={};#i;#s={};#o;open(e,t,r){this.#e=e,this.#t=t,this.#r="",this.readyState=1,this.onreadystatechange?.(),this.#i=void 0}abort(){this.#i&&this.#i.abort()}getAllResponseHeaders(){return this.#r}setRequestHeader(e,t){this.#n[e]=t}setInit(e,t=!0){this.#s=e,this.#o=t}send(e){let t="arraybuffer"!==this.responseType,r={...this.#s,method:this.#e,headers:this.#n,body:e};"function"==typeof AbortController&&this.#o&&(this.#i=new AbortController,"u">typeof EventTarget&&this.#i.signal instanceof EventTarget&&(r.signal=this.#i.signal)),"u">typeof document&&(r.credentials=this.withCredentials?"include":"omit"),fetch(this.#t,r).then(e=>
3(e.headers.forEach((e,t)=>{this.#r+=`${t}: ${e}\r 4`}),this.status=e.status,this.statusText=e.statusText,this.readyState=3,this.onreadystatechange?.(),t?e.text():e.arrayBuffer())).then(e=>{"string"==typeof e?this.responseText=e:this.response=e,this.readyState=4,this.onreadystatechange?.()}).catch(e=>{"AbortError"!==e.name?this.onerror?.(e):this.onabort?.()})}}let w="function"==typeof XMLHttpRequest?"xhr":"fetch",E="xhr"===w?XMLHttpRequest:b,_=(e,t)=>{let r=e.options,n=e.applyMiddleware("finalizeOptions",r),i={},s=e.applyMiddleware("interceptRequest",void 0,{adapter:w,context:e});if(s){let e=setTimeout(t,0,null,s);return{abort:()=>clearTimeout(e)}}let o=new E;o instanceof b&&"object"==typeof n.fetch&&o.setInit(n.fetch,n.useAbortSignal??!0);let a=n.headers,u=n.timeout,c=!1,l=!1,f=!1;if(o.onerror=e=>{p(o instanceof b?e instanceof Error?e:Error(`Request error while attempting to reach is ${n.url}`,{cause:e}):Error(`Request error while attempting to reach is ${n.url}${e.lengthComputable?`(${e.loaded} of ${e.total} bytes transferred)`:""}`))},o.ontimeout=e=>{p(Error(`Request timeout while attempting to reach ${n.url}${e.lengthComputable?`(${e.loaded} of ${e.total} bytes transferred)`:""}`))},o.onabort=()=>{d(!0),c=!0},o.onreadystatechange=function(){u&&(d(),i.socket=setTimeout(()=>h("ESOCKETTIMEDOUT"),u.socket)),!c&&o&&4===o.readyState&&0!==o.status&&function(){if(!(c||l||f)){if(0===o.status)return void p(Error("Unknown XHR error"));d(),l=!0,t(null,{body:o.response||(""===o.responseType||"text"===o.responseType?o.responseText:""),url:n.url,method:n.method,headers:v(o.getAllResponseHeaders()),statusCode:o.status,statusMessage:o.statusText})}}()},o.open(n.method,n.url,!0),o.withCredentials=!!n.withCredentials,a&&o.setRequestHeader)for(let e in a)a.hasOwnProperty(e)&&o.setRequestHeader(e,a[e]);return n.rawBody&&(o.responseType="arraybuffer"),e.applyMiddleware("onRequest",{options:n,adapter:w,request:o,context:e}),o.send(n.body||null),u&&(i.connect=setTimeout(()=>h("ETIMEDOUT"),u.connect)),{abort:function(){c=!0,o&&o.abort()}};function h(t){f=!0,o.abort();let r=Error("ESOCKETTIMEDOUT"===t?`Socket timed out on request to ${n.url}`:`Connection timed out on request to ${n.url}`);r.code=t,e.channels.error.publish(r)}function d(e){(e||c||o&&o.readyState>=2&&i.connect)&&clearTimeout(i.connect),i.socket&&clearTimeout(i.socket)}function p(e){if(l)return;d(!0),l=!0,o=null;let r=e||Error(`Network error while attempting to reach ${n.url}`);r.isNetworkError=!0,r.request=n,t(r)}},x=(e=[],t=_)=>(function e(t,r){let n=[],i=p.reduce((e,t)=>(e[t]=e[t]||[],e),{processOptions:[c],validateOptions:[h]});function s(e){let t;let n=d.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),{}),s=function(e,t,...r){let n="onError"===e,s=t;for(let t=0;t<i[e].length&&(s=(0,i[e][t])(s,...r),!n||s);t++);return s},o=s("processOptions",e);s("validateOptions",o);let a={options:o,channels:n,applyMiddleware:s},u=n.request.subscribe(e=>{t=r(e,(t,r)=>((e,t,r)=>{let i=e,o=t;if(!i)try{o=s("onResponse",t,r)}catch(e){o=null,i=e}(i=i&&s("onError",i,r))?n.error.publish(i):o&&n.response.publish(o)})(t,r,e))});n.abort.subscribe(()=>{u(),t&&t.abort()});let c=s("onReturn",n,a);return c===n&&n.request.publish(a),c}return s.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&&i.onReturn.length>0)throw Error("Tried to add new middleware with `onReturn` handler, but another handler has already been registered for this event");return p.forEach(t=>{e[t]&&i[t].push(e[t])}),n.push(e),s},s.clone=()=>e(n,r),t.forEach(s.use),s})(e,t);var I,S,R,C,T,$=r(28070),A=r(41989).lW,O={exports:{}};T||(T=1,function(e,t){let r;t.formatArgs=function(t){if(t[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+t[0]+(this.useColors?"%c ":" ")+"+"+e.exports.humanize(this.diff),!this.useColors)return;let r="color: "+this.color;t.splice(1,0,r,"color: inherit");let n=0,i=0;t[0].replace(/%[a-zA-Z%]/g,e=>{"%%"!==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")||t.storage.getItem("DEBUG")}catch{}return!e&&"u">typeof $&&"env"in $&&(e=$.env.DEBUG),e},t.useColors=function(){let e;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+)/))&&
4("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&&(e=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(e[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=(C?R:(C=1,R=function(e){function t(e){let n,i,s,o=null;function a(...e){if(!a.enabled)return;let r=Number(new Date),i=r-(n||r);a.diff=i,a.prev=n,a.curr=r,n=r,e[0]=t.coerce(e[0]),"string"!=typeof e[0]&&e.unshift("%O");let s=0;e[0]=e[0].replace(/%([a-zA-Z%])/g,(r,n)=>{if("%%"===r)return"%";s++;let i=t.formatters[n];if("function"==typeof i){let t=e[s];r=i.call(a,t),e.splice(s,1),s--}return r}),t.formatArgs.call(a,e),(a.log||t.log).apply(a,e)}return a.namespace=e,a.useColors=t.useColors(),a.color=t.selectColor(e),a.extend=r,a.destroy=t.destroy,Object.defineProperty(a,"enabled",{enumerable:!0,configurable:!1,get:()=>null!==o?o:(i!==t.namespaces&&(i=t.namespaces,s=t.enabled(e)),s),set:e=>{o=e}}),"function"==typeof t.init&&t.init(a),a}function r(e,r){let n=t(this.namespace+(typeof r>"u"?":":r)+e);return n.log=this.log,n}function n(e,t){let r=0,n=0,i=-1,s=0;for(;r<e.length;)if(n<t.length&&(t[n]===e[r]||"*"===t[n]))"*"===t[n]?(i=n,s=r):r++,n++;else{if(-1===i)return!1;n=i+1,r=++s}for(;n<t.length&&"*"===t[n];)n++;return n===t.length}return t.debug=t,t.default=t,t.coerce=function(e){return e instanceof Error?e.stack||e.message:e},t.disable=function(){let e=[...t.names,...t.skips.map(e=>"-"+e)].join(",");return t.enable(""),e},t.enable=function(e){for(let r of(t.save(e),t.namespaces=e,t.names=[],t.skips=[],("string"==typeof e?e:"").trim().replace(/\s+/g,",").split(",").filter(Boolean)))"-"===r[0]?t.skips.push(r.slice(1)):t.names.push(r)},t.enabled=function(e){for(let r of t.skips)if(n(e,r))return!1;for(let r of t.names)if(n(e,r))return!0;return!1},t.humanize=function(){if(S)return I;function e(e,t,r,n){return Math.round(e/r)+" "+n+(t>=1.5*r?"s":"")}return S=1,I=function(t,r){r=r||{};var n,i,s=typeof t;if("string"===s&&t.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}}}}(t);if("number"===s&&isFinite(t))return r.long?(i=Math.abs(t))>=864e5?e(t,i,864e5,"day"):i>=36e5?e(t,i,36e5,"hour"):i>=6e4?e(t,i,6e4,"minute"):i>=1e3?e(t,i,1e3,"second"):t+" ms":(n=Math.abs(t))>=864e5?Math.round(t/864e5)+"d":n>=36e5?Math.round(t/36e5)+"h":n>=6e4?Math.round(t/6e4)+"m":n>=1e3?Math.round(t/1e3)+"s":t+"ms";throw Error("val is not a non-empty string or a valid number. val="+JSON.stringify(t))}}(),t.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(r=>{t[r]=e[r]}),t.names=[],t.skips=[],t.formatters={},t.selectColor=function(e){let r=0;for(let t=0;t<e.length;t++)r=(r<<5)-r+e.charCodeAt(t)|0;return t.colors[Math.abs(r)%t.colors.length]},t.enable(t.load()),t}))(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 q=typeof A>"u"?()=>!1:e=>A.isBuffer(e);function k(e){return"[object Object]"===Object.prototype.toString.call(e)}let j=["boolean","string","number"],U={};"u">typeof globalThis?U=globalThis:"u">typeof window?U=window:"u">typeof global?U=global:"u">typeof self&&(U=self);var P=U;let B=(e={})=>{let t=e.implementation||Promise;if(!t)throw Error("`Promise` is not available in global scope, and n
4o implementation was passed");return{onReturn:(r,n)=>new t((t,i)=>{let s=n.options.cancelToken;s&&s.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)})}};class M{__CANCEL__=!0;message;constructor(e){this.message=e}toString(){return"Cancel"+(this.message?`: ${this.message}`:"")}}class L{promise;reason;constructor(e){if("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 M(e),t(this.reason))})}static source=()=>{let e;return{token:new L(t=>{e=t}),cancel:e}}}B.Cancel=M,B.CancelToken=L,B.isCancel=e=>!(!e||!e?.__CANCEL__);var D=(e,t,r)=>("GET"===r.method||"HEAD"===r.method)&&(e.isNetworkError||!1);function F(e){return 100*Math.pow(2,e)+100*Math.random()}let N=(e={})=>(e=>{let t=e.maxRetries||5,r=e.retryDelay||F,n=e.shouldRetry;return{onError:(e,i)=>{var s;let o=i.options,a=o.maxRetries||t,u=o.retryDelay||r,c=o.shouldRetry||n,l=o.attemptNumber||0;if(null!==(s=o.body)&&"object"==typeof s&&"function"==typeof s.pipe||!c(e,l,o)||l>=a)return e;let f=Object.assign({},i,{options:Object.assign({},o,{attemptNumber:l+1})});return setTimeout(()=>i.channels.request.publish(f),u(l)),null}}})({shouldRetry:D,...e});N.shouldRetry=D;var z=r(55420),V=r(93103),W=r(94690);function H(e){return e[e.length-1]}function G(e){var t;return(t=H(e))&&(0,W.m)(t.schedule)?e.pop():void 0}var J=r(8082),X=r(52877),Z=r(42448),Y=r(12204);function K(e,t){return void 0===t&&(t=0),(0,Z.e)(function(r,n){r.subscribe((0,Y.x)(n,function(r){return(0,X.f)(n,e,function(){return n.next(r)},t)},function(){return(0,X.f)(n,e,function(){return n.complete()},t)},function(r){return(0,X.f)(n,e,function(){return n.error(r)},t)}))})}function Q(e,t){return void 0===t&&(t=0),(0,Z.e)(function(r,n){n.add(e.schedule(function(){return r.subscribe(n)},t))})}var ee=r(98140);function et(e,t){if(!e)throw Error("Iterable cannot be null");return new z.y(function(r){(0,X.f)(r,t,function(){var n=e[Symbol.asyncIterator]();(0,X.f)(r,t,function(){n.next().then(function(e){e.done?r.complete():r.next(e.value)})},0,!0)})})}var er=r(73356),en=r(56413),ei=r(39114),es=r(87434),eo=r(83832),ea=r(35481),eu=r(19312);function ec(e,t){return t?function(e,t){if(null!=e){if((0,er.c)(e))return(0,J.Xf)(e).pipe(Q(t),K(t));if((0,ei.z)(e))return new z.y(function(r){var n=0;return t.schedule(function(){n===e.length?r.complete():(r.next(e[n++]),r.closed||this.schedule())})});if((0,en.t)(e))return(0,J.Xf)(e).pipe(Q(t),K(t));if((0,eo.D)(e))return et(e,t);if((0,es.T)(e))return new z.y(function(r){var n;return(0,X.f)(r,t,function(){n=e[ee.h](),(0,X.f)(r,t,function(){var e,t,i;try{t=(e=n.next()).value,i=e.done}catch(e){r.error(e);return}i?r.complete():r.next(t)},0,!0)}),function(){return(0,W.m)(null==n?void 0:n.return)&&n.return()}});if((0,eu.L)(e))return et((0,eu.Q)(e),t)}throw(0,ea.z)(e)}(e,t):(0,J.Xf)(e)}function el(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=G(e);return ec(e,r)}var ef=r(67383),eh=r(55549),ed=(0,eh.d)(function(e){return function(){e(this),this.name="EmptyError",this.message="no elements in sequence"}});function ep(e,t){var r="object"==typeof t;return new Promise(function(n,i){var s,o=!1;e.subscribe({next:function(e){s=e,o=!0},error:i,complete:function(){o?n(s):r?n(t.defaultValue):i(new ed)}})})}var ey=r(29978),eg=r(36545),em=(0,eh.d)(function(e){return function(){e(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"}}),ev=r(85580),eb=r(61290),ew=function(e){function t(){var t=e.call(this)||this;return t.closed=!1,t.currentObservers=null,t.observers=[],t.isStopped=!1,t.hasError=!1,t.thrownError=null,t}return(0,ey.ZT)(t,e),t.prototype.lift=function(e){var t=new eE(this,this);return t.operator=e,t},t.prototype._throwIfClosed=function(){if(this.closed)throw new em},t.prototype.next=function(e){var t=this;(0,eb.x)(function(){var r,n;if(t._throwIfClosed(),!t.isStopped){t.currentObservers||(t.currentObservers=Array.from(t.observers));try{for(var i=(0,ey.XA)(t.currentObservers),s=i.next();!s.done;s=i.next())s.value.next(e)}catch(e){r={error:e}}finally{try{s&&!s.done&&(n=i.return)&&n.call(i)}finally{if(r)throw r.error}}}})},t.prototype.error=function(e){var t=this;(0,eb.x)(function(){if(t._throwIfClosed(),!t.isStopped){t.hasError=t.isStopped=!0,t.thrownError=e;for(var r=t.observers;r.length;)r.shift().error(e)}})},t.prototype.complete=function(){var e=this;(0,eb.x)(function(){if(e._throwIfClosed(),!e.isStopped){e.isStopped=!0;for(var t=e.observers;t.length;)t.shift().complete()}})},t.prototype.unsubscribe=function(){this.isStopped=this.closed=!0,this.observers=this.currentObservers=null},Object.defineProperty(t.prototype,"observed",{get:function(){var e;return(null===(e=this.observers)||void 0===e?void 0:e.length)>0}
4,enumerable:!1,configurable:!0}),t.prototype._trySubscribe=function(t){return this._throwIfClosed(),e.prototype._trySubscribe.call(this,t)},t.prototype._subscribe=function(e){return this._throwIfClosed(),this._checkFinalizedStatuses(e),this._innerSubscribe(e)},t.prototype._innerSubscribe=function(e){var t=this,r=this.hasError,n=this.isStopped,i=this.observers;return r||n?eg.Lc:(this.currentObservers=null,i.push(e),new eg.w0(function(){t.currentObservers=null,(0,ev.P)(i,e)}))},t.prototype._checkFinalizedStatuses=function(e){var t=this.hasError,r=this.thrownError,n=this.isStopped;t?e.error(r):n&&e.complete()},t.prototype.asObservable=function(){var e=new z.y;return e.source=this,e},t.create=function(e,t){return new eE(e,t)},t}(z.y),eE=function(e){function t(t,r){var n=e.call(this)||this;return n.destination=t,n.source=r,n}return(0,ey.ZT)(t,e),t.prototype.next=function(e){var t,r;null===(r=null===(t=this.destination)||void 0===t?void 0:t.next)||void 0===r||r.call(t,e)},t.prototype.error=function(e){var t,r;null===(r=null===(t=this.destination)||void 0===t?void 0:t.error)||void 0===r||r.call(t,e)},t.prototype.complete=function(){var e,t;null===(t=null===(e=this.destination)||void 0===e?void 0:e.complete)||void 0===t||t.call(e)},t.prototype._subscribe=function(e){var t,r;return null!==(r=null===(t=this.source)||void 0===t?void 0:t.subscribe(e))&&void 0!==r?r:eg.Lc},t}(ew),e_={now:function(){return(e_.delegate||Date).now()},delegate:void 0},ex=function(e){function t(t,r,n){void 0===t&&(t=1/0),void 0===r&&(r=1/0),void 0===n&&(n=e_);var i=e.call(this)||this;return i._bufferSize=t,i._windowTime=r,i._timestampProvider=n,i._buffer=[],i._infiniteTimeWindow=!0,i._infiniteTimeWindow=r===1/0,i._bufferSize=Math.max(1,t),i._windowTime=Math.max(1,r),i}return(0,ey.ZT)(t,e),t.prototype.next=function(t){var r=this.isStopped,n=this._buffer,i=this._infiniteTimeWindow,s=this._timestampProvider,o=this._windowTime;!r&&(n.push(t),i||n.push(s.now()+o)),this._trimBuffer(),e.prototype.next.call(this,t)},t.prototype._subscribe=function(e){this._throwIfClosed(),this._trimBuffer();for(var t=this._innerSubscribe(e),r=this._infiniteTimeWindow,n=this._buffer.slice(),i=0;i<n.length&&!e.closed;i+=r?1:2)e.next(n[i]);return this._checkFinalizedStatuses(e),t},t.prototype._trimBuffer=function(){var e=this._bufferSize,t=this._timestampProvider,r=this._buffer,n=this._infiniteTimeWindow,i=(n?1:2)*e;if(e<1/0&&i<r.length&&r.splice(0,r.length-i),!n){for(var s=t.now(),o=0,a=1;a<r.length&&r[a]<=s;a+=2)o=a;o&&r.splice(0,o+1)}},t}(ew),eI=r(48234);function eS(e){void 0===e&&(e={});var t=e.connector,r=void 0===t?function(){return new ew}:t,n=e.resetOnError,i=void 0===n||n,s=e.resetOnComplete,o=void 0===s||s,a=e.resetOnRefCountZero,u=void 0===a||a;return function(e){var t,n,s,a=0,c=!1,l=!1,f=function(){null==n||n.unsubscribe(),n=void 0},h=function(){f(),t=s=void 0,c=l=!1},d=function(){var e=t;h(),null==e||e.unsubscribe()};return(0,Z.e)(function(e,p){a++,l||c||f();var y=s=null!=s?s:r();p.add(function(){0!=--a||l||c||(n=eR(d,u))}),y.subscribe(p),!t&&a>0&&(t=new eI.Hp({next:function(e){return y.next(e)},error:function(e){l=!0,f(),n=eR(h,i,e),y.error(e)},complete:function(){c=!0,f(),n=eR(h,o),y.complete()}}),(0,J.Xf)(e).subscribe(t))})(e)}}function eR(e,t){for(var r=[],n=2;n<arguments.length;n++)r[n-2]=arguments[n];if(!0===t){e();return}if(!1!==t){var i=new eI.Hp({next:function(){i.unsubscribe(),e()}});return(0,J.Xf)(t.apply(void 0,(0,ey.ev)([],(0,ey.CR)(r)))).subscribe(i)}}function eC(e){return(0,Z.e)(function(t,r){var n,i=null,s=!1;i=t.subscribe((0,Y.x)(r,void 0,void 0,function(o){n=(0,J.Xf)(e(o,eC(e)(t))),i?(i.unsubscribe(),i=null,n.subscribe(r)):s=!0})),s&&(i.unsubscribe(),i=null,n.subscribe(r))})}var eT=r(71560);function e$(e){return void 0===e&&(e=1/0),(0,ef.z)(eT.y,e)}var eA=function(e){function t(t,r){return e.call(this)||this}return(0,ey.ZT)(t,e),t.prototype.schedule=function(e,t){return void 0===t&&(t=0),this},t}(eg.w0),eO={setInterval:function(e,t){for(var r=[],n=2;n<arguments.length;n++)r[n-2]=arguments[n];var i=eO.delegate;return(null==i?void 0:i.setInterval)?i.setInterval.apply(i,(0,ey.ev)([e,t],(0,ey.CR)(r))):setInterval.apply(void 0,(0,ey.ev)([e,t],(0,ey.CR)(r)))},clearInterval:function(e){var t=eO.delegate;return((null==t?void 0:t.clearInterval)||clearInterval)(e)},delegate:void 0},eq=function(e){function t(t,r){var n=e.call(this,t,r)||this;
4return n.scheduler=t,n.work=r,n.pending=!1,n}return(0,ey.ZT)(t,e),t.prototype.schedule=function(e,t){if(void 0===t&&(t=0),this.closed)return this;this.state=e;var r,n=this.id,i=this.scheduler;return null!=n&&(this.id=this.recycleAsyncId(i,n,t)),this.pending=!0,this.delay=t,this.id=null!==(r=this.id)&&void 0!==r?r:this.requestAsyncId(i,this.id,t),this},t.prototype.requestAsyncId=function(e,t,r){return void 0===r&&(r=0),eO.setInterval(e.flush.bind(e,this),r)},t.prototype.recycleAsyncId=function(e,t,r){if(void 0===r&&(r=0),null!=r&&this.delay===r&&!1===this.pending)return t;null!=t&&eO.clearInterval(t)},t.prototype.execute=function(e,t){if(this.closed)return Error("executing a cancelled action");this.pending=!1;var r=this._execute(e,t);if(r)return r;!1===this.pending&&null!=this.id&&(this.id=this.recycleAsyncId(this.scheduler,this.id,null))},t.prototype._execute=function(e,t){var r,n=!1;try{this.work(e)}catch(e){n=!0,r=e||Error("Scheduled action threw falsy error")}if(n)return this.unsubscribe(),r},t.prototype.unsubscribe=function(){if(!this.closed){var t=this.id,r=this.scheduler,n=r.actions;this.work=this.state=this.scheduler=null,this.pending=!1,(0,ev.P)(n,this),null!=t&&(this.id=this.recycleAsyncId(r,t,null)),this.delay=null,e.prototype.unsubscribe.call(this)}},t}(eA),ek=function(){function e(t,r){void 0===r&&(r=e.now),this.schedulerActionCtor=t,this.now=r}return e.prototype.schedule=function(e,t,r){return void 0===t&&(t=0),new this.schedulerActionCtor(this,e).schedule(r,t)},e.now=e_.now,e}(),ej=new(function(e){function t(t,r){void 0===r&&(r=ek.now);var n=e.call(this,t,r)||this;return n.actions=[],n._active=!1,n}return(0,ey.ZT)(t,e),t.prototype.flush=function(e){var t,r=this.actions;if(this._active){r.push(e);return}this._active=!0;do if(t=e.execute(e.state,e.delay))break;while(e=r.shift());if(this._active=!1,t){for(;e=r.shift();)e.unsubscribe();throw t}},t}(ek))(eq);function eU(e,t){var r=(0,W.m)(e)?e:function(){return e},n=function(e){return e.error(r())};return new z.y(t?function(e){return t.schedule(n,0,e)}:n)}function eP(e){return(0,Z.e)(function(t,r){try{t.subscribe(r)}finally{r.add(e)}})}var eB=r(33174),eM=r(33633);function eL(e,t){var r="object"==typeof t;return new Promise(function(n,i){var s=new eI.Hp({next:function(e){n(e),s.unsubscribe()},error:i,complete:function(){r?n(t.defaultValue):i(new ed)}});e.subscribe(s)})}var eD=r(10554);function eF(e,t,r){e?(0,X.f)(r,e,t):t()}var eN=Array.isArray,ez=r(86442),eV=r(22018);function eW(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=(0,W.m)(H(e))?e.pop():void 0;return r?(0,eV.z)(eW.apply(void 0,(0,ey.ev)([],(0,ey.CR)(e))),(0,ez.Z)(r)):(0,Z.e)(function(t,r){var n,i,s;(n=(0,ey.ev)([t],(0,ey.CR)(1===e.length&&eN(e[0])?e[0]:e)),void 0===s&&(s=eT.y),function(e){eF(void 0,function(){for(var t=n.length,r=Array(t),o=t,a=t,u=function(t){eF(i,function(){var u=ec(n[t],i),c=!1;u.subscribe((0,Y.x)(e,function(n){r[t]=n,!c&&(c=!0,a--),a||e.next(s(r.slice()))},function(){--o||e.complete()}))},e)},c=0;c<t;c++)u(c)},e)})(r)})}var eH=r(28756);let eG="drafts.",eJ="versions.";function eX(e){return e.startsWith(eG)}function eZ(e){return e.startsWith(eJ)}function eY(e){return eZ(e)?eG+e0(e):eX(e)?e:eG+e}function eK(e,t){if("drafts"===t||"published"===t)throw Error('Version can not be "published" or "drafts"');return`${eJ}${t}.${e0(e)}`}function eQ(e){if(!eZ(e))return;let[t,r,...n]=e.split(".");return r}function e0(e){return eZ(e)?e.split(".").slice(2).join("."):eX(e)?e.slice(eG.length):e}let e1=e=>crypto.getRandomValues(new Uint8Array(e)),e2=(e,t,r)=>{let n=(2<<Math.log(e.length-1)/Math.LN2)-1,i=-~(1.6*n*t/e.length);return (s=t)=>{let o="";for(;;){let t=r(i),a=0|i;for(;a--;)if((o+=e[t[a]&n]||"").length===s)return o}}},e3=/\r\n|[\n\r\u2028\u2029]/;function e6(e,t){let r=0;for(let n=0;n<t.length;n++){let i=t[n].length+1;if(r+i>e)return{line:n+1,column:e-r};r+=i}return{line:t.length,column:t[t.length-1]?.length??0}}class e5 extends Error{response;statusCode=400;responseBody;details;constructor(e,t){let r=e4(e,t);super(r.message),Object.assign(this,r)}}class e8 extends Error{response;statusCode=500;responseBody;details;constructor(e){let t=e4(e);super(t.message),Object.assign(this,t)}}function e4(e,t){let r=e.body,n={response:e,statusCode:e.statusCode,responseBody:-1!==(e.headers["content-type"]||"").toLowerCase().indexOf("application/json")?JSON.stringify(r,null,2):r,message:"",details:void 0};if(!(0,eD.Uy)(r))return n.message=te(e,r),n;let i=r.error;if("string"==typeof i&&"string"==typeof r.message)return n.message=`${i} - ${r.message}`,n;if("object"!=typeof i||null===i)return"string"==typeof i?n.message=i:"string"==typeof r.message?n.message=r.message:n.message=te(e,r),n;if("type"in i&&"mutationError"===i.type&&"description"in i&&"string"==typeof i.description||"type"in i&&"actionError"===i.type&&"description"in i&&"string"==typeof i.description){let e=i.items||[],t=e.slice(0,5).map(e=>
4e.error?.description).filter(Boolean),s=t.length?`: 5- ${t.join(` 6- `)}`:"";return e.length>5&&(s+=` 7...and ${e.length-5} more`),n.message=`${i.description}${s}`,n.details=r.error,n}if(e9(i)){let e=t?.options?.query?.tag;return n.message=e7(i,e),n.details=r.error,n}return"description"in i&&"string"==typeof i.description?(n.message=i.description,n.details=i):n.message=te(e,r),n}function e9(e){return(0,eD.Uy)(e)&&"queryParseError"===e.type&&"string"==typeof e.query&&"number"==typeof e.start&&"number"==typeof e.end}function e7(e,t){let{query:r,start:n,end:i,description:s}=e;if(!r||typeof n>"u")return`GROQ query parse error: ${s}`;let o=t?` 8 9Tag: ${t}`:"";return`GROQ query parse error: 10${function(e,t,r){let n=e.split(e3),{start:i,end:s,markerLines:o}=function(e,t){let r={...e.start},n={...r,...e.end},i=r.line??-1,s=r.column??0,o=n.line,a=n.column,u=Math.max(i-3,0),c=Math.min(t.length,o+3);-1===i&&(u=0),-1===o&&(c=t.length);let l=o-i,f={};if(l)for(let e=0;e<=l;e++){let r=e+i;if(s){if(0===e){let e=t[r-1].length;f[r]=[s,e-s+1]}else if(e===l)f[r]=[0,a];else{let n=t[r-e].length;f[r]=[0,n]}}else f[r]=!0}else s===a?s?f[i]=[s,0]:f[i]=!0:f[i]=[s,a-s];return{start:u,end:c,markerLines:f}}({start:e6(t.start,n),end:t.end?e6(t.end,n):void 0},n),a=`${s}`.length;return e.split(e3,s).slice(i,s).map((e,t)=>{let n=i+1+t,s=` ${` ${n}`.slice(-a)} |`,u=o[n],c=!o[n+1];if(!u)return` ${s}${e.length>0?` ${e}`:""}`;let l="";if(Array.isArray(u)){let t=e.slice(0,Math.max(u[0]-1,0)).replace(/[^\t]/g," "),n=u[1]||1;l=[` 11 `,s.replace(/\d/g," ")," ",t,"^".repeat(n)].join(""),c&&r&&(l+=" "+r)}return[">",s,e.length>0?` ${e}`:"",l].join("")}).join(` 12`)}(r,{start:n,end:i},s)}${o}`}function te(e,t){let r="string"==typeof t?` (${t.length>100?`${t.slice(0,100)}\u2026`:t})`:"",n=e.statusMessage?` ${e.statusMessage}`:"";return`${e.method}-request to ${e.url} resulted in HTTP ${e.statusCode}${n}${r}`}class tt extends Error{projectId;addOriginUrl;constructor({projectId:e}){super("CorsOriginError"),this.name="CorsOriginError",this.projectId=e;let t=new URL(`https://sanity.io/manage/project/${e}/api`);if("u">typeof location){let{origin:e}=location;t.searchParams.set("cors","add"),t.searchParams.set("origin",e),this.addOriginUrl=t,this.message=`The current origin is not allowed to connect to the Live Content API. Add it here: ${t}`}else this.message=`The current origin is not allowed to connect to the Live Content API. Change your configuration here: ${t}`}}let tr={onResponse:(e,t)=>{if(e.statusCode>=500)throw new e8(e);if(e.statusCode>=400)throw new e5(e,t);return e}};function tn(e,t={}){return x([N({shouldRetry:ti}),...e,function(e={}){let t={},r=t=>void 0!==e.ignoreWarnings&&(Array.isArray(e.ignoreWarnings)?e.ignoreWarnings:[e.ignoreWarnings]).some(e=>"string"==typeof e?t.includes(e):e instanceof RegExp&&e.test(t));return{onResponse:e=>{let n=e.headers["x-sanity-warning"];for(let e of Array.isArray(n)?n:[n])!e||t[e]||r(e)||(t[e]=!0,console.warn(e));return e}}}(t),{processOptions:e=>{let t=e.body;return!t||"function"==typeof t.pipe||q(t)||-1===j.indexOf(typeof t)&&!Array.isArray(t)&&!function(e){if(!1===k(e))return!1;let t=e.constructor;if(void 0===t)return!0;let r=t.prototype;return!(!1===k(r)||!1===r.hasOwnProperty("isPrototypeOf"))}(t)?e:Object.assign({},e,{body:JSON.stringify(e.body),headers:Object.assign({},e.headers,{"Content-Type":"application/json"})})}},{onResponse:e=>{let t=e.headers["content-type"]||"",r=-1!==t.indexOf("application/json");return e.body&&t&&r?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 n(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=n("upload")),"onprogress"in t&&(t.onprogress=n("download"))}},tr,function(e={}){let t=e.implementation||P.Observable;if(!t)throw Error("`Observable` is not available in global scope, and n
12o 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:z.y})])}function ti(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"),s=e.response&&(429===e.response.statusCode||502===e.response.statusCode||503===e.response.statusCode);return(!!n||!!i)&&!!s||N.shouldRetry(e,t,r)}function ts(e){return"https://www.sanity.io/help/"+e}let to=["image","file"],ta=["before","after","replace"],tu=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")},tc=e=>{if(!/^[-a-z0-9]+$/i.test(e))throw Error("`projectId` can only contain only a-z, 0-9 and dashes")},tl=e=>{if(-1===to.indexOf(e))throw Error(`Invalid asset type: ${e}. Must be one of ${to.join(", ")}`)},tf=(e,t)=>{if(null===t||"object"!=typeof t||Array.isArray(t))throw Error(`${e}() takes an object of properties`)},th=(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`)},td=(e,t)=>{if(!t._id)throw Error(`${e}() requires that the document contains an ID ("_id" property)`);th(e,t._id)},tp=(e,t)=>{if("string"!=typeof t)throw Error(`\`${e}()\`: \`${t}\` is not a valid document type`)},ty=(e,t)=>{if(!t._type)throw Error(`\`${e}()\` requires that the document contains a type (\`_type\` property)`);tp(e,t._type)},tg=(e,t)=>{if(t._id&&t._id!==e)throw Error(`The provided document ID (\`${t._id}\`) does not match the generated version ID (\`${e}\`)`)},tm=(e,t,r)=>{let n="insert(at, selector, items)";if(-1===ta.indexOf(e)){let e=ta.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`)},tv=e=>{if(e.dataset)return e.dataset;let t=e.resource;if(t&&"dataset"===t.type){let e=t.id.split(".");if(2!==e.length)throw Error('Dataset resource ID must be in the format "project.dataset"');return e[1]}throw Error("`dataset` must be provided to perform queries")},tb=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},tw=e=>{let t=e.resource;if(!t)throw Error("`resource` must be provided to perform resource queries");let{type:r,id:n}=t;switch(r){case"dataset":if(2!==n.split(".").length)throw Error('Dataset resource ID must be in the format "project.dataset"');return;case"dashboard":case"media-library":case"canvas":return;default:throw Error(`Unsupported resource type: ${r.toString()}`)}},tE=(e,t)=>{if(t.resource)throw Error(`\`${e}\` does not support resource-based operations`)},t_=e=>{var t;let r,n;return t=(...t)=>console.warn(e.join(" "),...t),r=!1,(...e)=>(r||(n=t(...e),r=!0),n)},tx=t_(["Because you set `withCredentials` to true, we will override your `useCdn`","setting to be false since (cookie-based) credentials are never set on the CDN"]),tI=t_(["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."]),tS=t_(["The Sanity client is configured with the `perspective` set to `drafts` or `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."]),tR=t_(["The `previewDrafts` perspective has been renamed to `drafts` and will be removed in a future API version"]),tC=t_(["You have configured Sanity client to use a token in the browser. This may cause unintentional security issues.",`See ${ts("js-client-browser-token")} for more information and how to hide this warning.`]),tT=t_(["You have configured Sanity client to use a token, but also provided `withCredentials: true`.","This is no longer supported - only token will be used - remove `withCredentials: true`."]),t$=t_(["Using the Sanity client without specifying an API version is deprecated.",`See ${ts("js-client-api-version")}`]),tA=(t_(["The default export of @sanity/client has been deprecated. Use the named export `createClient` instead."]),t_(["You have called `createVersion()` with a defined `document`. The recommended approach is to provide a `baseId` and `releaseId` instead."])),tO=t_(["The `~experimental_resource` configuration property has been renamed to `resource`.","Please update your client configuration to use `resource` instead. Support for `~experimental_resource` will be removed in a future version."]),tq={apiHost:"https://api.sanity.io",apiVersion:"1",useProjectHostname:!0,stega:{enabled:!1}},tk=["localhost","127.0.0.1","0.0.0.0"],tj=e=>-1!==tk.indexOf(e);function tU(e){if(Array.isArray(e)&&e.length>1&&e.includes("raw"))throw TypeError('Invalid API perspective value: "raw". The raw-perspective can not be combined with other perspectives')}let tP=(e,t)=>{let r={...t,...e,stega:{..."boolean"==typeof t.stega?{enabled:t.stega}:t.stega||tq.stega,..."boolean"==typeof e.stega?{enabled:e.stega}:e.stega||{}}};r.apiVersion||t$();let n={...tq,...r};n["~experimental_resource"]&&!n.resource&&(tO(),n.resource=n["~experimental_resource"]);let i=n.resource,s=n.useProjectHostname&&!i;if(typeof Promise>"u"){let e=ts("js-client-promise-polyfill");throw Error(`No native Promise-implementation found, polyfill needed - see ${e}`)}if(s&&!n.projectId)throw Error("Configuration must contain `projectId`");if(i&&tw(n),"u">typeof n.perspective&&tU(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'?");
12if("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,a=o&&tj(window.location.hostname),u=!!n.token;n.withCredentials&&u&&(tT(),n.withCredentials=!1),o&&a&&u&&!0!==n.ignoreBrowserTokenWarning?tC():typeof n.useCdn>"u"&&tI(),s&&tc(n.projectId),n.dataset&&tu(n.dataset),"requestTagPrefix"in n&&(n.requestTagPrefix=n.requestTagPrefix?tb(n.requestTagPrefix).replace(/\.+$/,""):void 0),n.apiVersion=`${n.apiVersion}`.replace(/^v/,""),n.isDefaultApi=n.apiHost===tq.apiHost,!0===n.useCdn&&n.withCredentials&&tx(),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 c=n.apiHost.split("://",2),l=c[0],f=c[1],h=n.isDefaultApi?"apicdn.sanity.io":f;return s?(n.url=`${l}://${n.projectId}.${f}/v${n.apiVersion}`,n.cdnUrl=`${l}://${n.projectId}.${h}/v${n.apiVersion}`):(n.url=`${n.apiHost}/v${n.apiVersion}`,n.cdnUrl=n.url),n};class tB extends Error{name="ConnectionFailedError"}class tM extends Error{name="DisconnectError";reason;constructor(e,t,r={}){super(e,r),this.reason=t}}class tL extends Error{name="ChannelError";data;constructor(e,t){super(e),this.data=t}}class tD extends Error{name="MessageError";data;constructor(e,t,r={}){super(e,r),this.data=t}}class tF extends Error{name="MessageParseError"}let tN=["channelError","disconnect"];function tz(e,t){return(0,V.P)(()=>{let t=e();return t&&(t instanceof z.y||(0,W.m)(t.lift)&&(0,W.m)(t.subscribe))?t:el(t)}).pipe((0,ef.z)(e=>new z.y(r=>{let n=t.includes("open"),i=t.includes("reconnect");function s(t){if("data"in t){let[e,n]=tV(t);r.error(e?new tF("Unable to parse EventSource error message",{cause:n}):new tD((n?.data).message,n));return}e.readyState===e.CLOSED?r.error(new tB("EventSource connection failed")):i&&r.next({type:"reconnect"})}function o(){r.next({type:"open"})}function a(t){let[n,i]=tV(t);if(n){r.error(new tF("Unable to parse EventSource message",{cause:n}));return}if("channelError"===t.type){let t=new URL(e.url).searchParams.get("tag");r.error(new tL(function(e,t){let r=e.error;return r?e9(r)?e7(r,t):r.description?r.description:"string"==typeof r?r:JSON.stringify(r,null,2):e.message||"Unknown listener error"}(i?.data,t),i.data));return}if("disconnect"===t.type){r.error(new tM(`Server disconnected client: ${i.data?.reason||"unknown error"}`));return}r.next({type:t.type,id:t.lastEventId,...i.data?{data:i.data}:{}})}e.addEventListener("error",s),n&&e.addEventListener("open",o);let u=[...new Set([...tN,...t])].filter(e=>"error"!==e&&"open"!==e&&"reconnect"!==e);return u.forEach(t=>e.addEventListener(t,a)),()=>{e.removeEventListener("error",s),n&&e.removeEventListener("open",o),u.forEach(t=>e.removeEventListener(t,a)),e.close()}})))}function tV(e){try{let t="string"==typeof e.data&&JSON.parse(e.data);return[null,{type:e.type,id:e.lastEventId,...!function(e){for(let t in e)return!1;return!0}(t)?{data:t}:{}}]}catch(e){return[e,null]}}function tW(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 (<docId>)","* Array of document IDs","* Object containing `query`"].join(` 13`);throw Error(`Unknown selection - must be one of: 14 15${t}`)}class tH{selection;operations;constructor(e,t={}){this.selection=e,this.operations=t}set(e){return this._assign("set",e)}setIfMissing(e){return this._assign("setIfMissing",e)}diffMatchPatch(e){return tf("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 tm(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,s=typeof r>"u"||-1===r?-1:Math.max(0,t+r),o=`${e}[${i}:${i<0&&s>=0?"":s}]`;return this.insert("replace",o,n||[])}ifRevisionId(e){return this.operations.ifRevisionID=e,this}serialize(){return{...tW(this.selection),...this.operations}}toJSON(){return this.serialize()}reset(){return this.operations={},this}_assign(e,t,r=!0){return tf(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)}}class tG extends tH{#a;constructor(e,t,r){super(e,t),this.#a=r}clone(){return new tG(this.selection,{...this.operations},this.#a)}commit(e){if(!this.#a)throw Error("No `client` passed to patch, either provide one or pass the patch to a clients `mutate()` method");let t=Object.assign({returnFirst:"string"==typeof this.selection,returnDocuments:!0},e);return this.#a.mutate({patch:this.serialize()},t)}}class tJ extends tH{#a;constructor(e,t,r){super(e,t),this.#a=r}clone(){return new tJ(this.selection,{...this.operations},this.#a)}commit(e){if(!this.#a)throw Error("No `client` passed to patch, either provide one or pass the patch to a clients `mutate()` method");let t=Object.assign({returnFirst:"string"==typeof this.selection,returnDocuments:!0},e);return this.#a.mutate({patch:this.serialize()},t)}}let tX={returnDocuments:!1};class tZ{operations;trxId;constructor(e=[],t){this.operations=e,this.trxId=t}create(e){return tf("create",e),this._add({create:e})}createIfNotExists(e){let t="createIfNotExists";return tf(t,e),td(t,e),this._add({[t]:e})}createOrReplace(e){let t="createOrReplace";return tf(t,e),td(t,e),this._add({[t]:e})}delete(e){return th("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}}class tY extends tZ{#a;constructor(e,t,r){super(e,r),this.#a=t}clone(){return new tY([...this.operations],this.#a,this.trxId)}commit(e){if(!this.#a)throw Error("No `client` passed to transaction, either provide one or pass the transaction to a clients `mutate()` method");return this.#a.mutate(this.serialize(),Object.assign({transactionId:this.trxId},tX,e||{}))}patch(e,t){let r="function"==typeof t,n="string"!=typeof e&&e instanceof tJ,i="object"==typeof e&&("query"in e||"id"in e);if(n)return this._add({patch:e.serialize()});if(r){let r=t(new tJ(e,{},this.#a));if(!(r instanceof tJ))throw Error("function passed to `patch()` must return the patch");return this._add({patch:r.serialize()})}if(i){let r=new tJ(e,t||{},this.#a);return this._add({patch:r.serialize()})}return this._add({patch:{id:e,...t}})}}class tK extends tZ{#a;constructor(e,t,r){super(e,r),this.#a=t}clone(){return new tK([...this.operations],this.#a,this.trxId)}commit(e){if(!this.#a)throw Error("No `client` passed to transaction, either provide one or pass the transaction to a clients `mutate()` method");return this.#a.mutate(this.serialize(),Object.assign({transactionId:this.trxId},tX,e||{}))}patch(e,t){let r="function"==typeof t;if("string"!=typeof e&&e instanceof tG)return this._add({patch:e.serialize()});if(r){let r=t(new tG(e,{},this.#a));if(!(r instanceof tG))throw Error("function passed to `patch()` must return the patch");return this._add({patch:r.serialize()})}return this._add({patch:{id:e,...t}})}}let tQ=({query:e,params:t={},options:r={}})=>{let n=new URLSearchParams,{tag:i,includeMutations:s,returnQuery:o,...a}=r;for(let[r,s]of(i&&n.append("tag",i),n.append("query",e),Object.entries(t)))void 0!==s&&n.append(`$${r}`,JSON.stringify(s));for(let[e,t]of Object.entries(a))t&&n.append(e,`${t}`);return!1===o&&n.append("returnQuery","false"),!1===s&&n.append("includeMutations","fal
15se"),`?${n}`},t0=(e,t)=>!1===e?void 0:typeof e>"u"?t:e,t1=(e={})=>({dryRun:e.dryRun,returnIds:!0,returnDocuments:t0(e.returnDocuments,!0),visibility:e.visibility||"sync",autoGenerateArrayKeys:e.autoGenerateArrayKeys,skipCrossDatasetReferenceValidation:e.skipCrossDatasetReferenceValidation}),t2=e=>"response"===e.type,t3=e=>e.body,t6=(e,t)=>e.reduce((e,r)=>(e[t(r)]=r,e),Object.create(null));function t5(e,t,n,i,s={},o={}){let a="stega"in o?{...n||{},..."boolean"==typeof o.stega?{enabled:o.stega}:o.stega||{}}:n,u=a.enabled?(0,eD.NG)(s):s,c=!1===o.filterResponse?e=>e:e=>e.result,{cache:l,next:f,...h}={useAbortSignal:"u">typeof o.signal,resultSourceMap:a.enabled?"withKeyArraySelector":o.resultSourceMap,...o,returnQuery:!1===o.filterResponse&&!1!==o.returnQuery},d=rc(e,t,"query",{query:i,params:u},"u">typeof l||"u">typeof f?{...h,fetch:{cache:l,next:f}}:h);return a.enabled?d.pipe(function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return eW.apply(void 0,(0,ey.ev)([],(0,ey.CR)(e)))}(ec(r.e(498).then(r.bind(r,11498)).then(function(e){return e.stegaEncodeSourceMap$1}).then(({stegaEncodeSourceMap:e})=>e))),(0,eM.U)(([e,t])=>{let r=t(e.result,e.resultSourceMap,a);return c({...e,result:r})})):d.pipe((0,eM.U)(c))}function t8(e,t,r,n={}){let i={uri:rw(e,"doc",(()=>{if(!n.releaseId)return r;let e=eQ(r);if(!e){if(eX(r))throw Error(`The document ID (\`${r}\`) is a draft, but \`options.releaseId\` is set as \`${n.releaseId}\``);return eK(r,n.releaseId)}if(e!==n.releaseId)throw Error(`The document ID (\`${r}\`) is already a version of \`${e}\` release, but this does not match the provided \`options.releaseId\` (\`${n.releaseId}\`)`);return r})()),json:!0,tag:n.tag,signal:n.signal,query:void 0!==n.includeAllVersions?{includeAllVersions:n.includeAllVersions}:void 0};return rv(e,t,i).pipe((0,eH.h)(t2),(0,eM.U)(e=>{let t=e.body.documents;return t?n.includeAllVersions?t:t[0]:n.includeAllVersions?[]:void 0}))}function t4(e,t,r,n={}){let i={uri:rw(e,"doc",r.join(",")),json:!0,tag:n.tag,signal:n.signal};return rv(e,t,i).pipe((0,eH.h)(t2),(0,eM.U)(e=>{let t=t6(e.body.documents||[],e=>e._id);return r.map(e=>t[e]||null)}))}function t9(e,t,r,n={}){return rc(e,t,"query",{query:"*[sanity::partOfRelease($releaseId)]",params:{releaseId:r}},n)}function t7(e,t,r,n){return td("createIfNotExists",r),rl(e,t,r,"createIfNotExists",n)}function re(e,t,r,n){return td("createOrReplace",r),rl(e,t,r,"createOrReplace",n)}function rt(e,t,r,n,i){return td("createVersion",r),ty("createVersion",r),tA(),ru(e,t,{actionType:"sanity.action.document.version.create",publishedId:n,document:r},i)}function rr(e,t,r,n,i,s,o){if(!n)throw Error("`createVersion()` requires `baseId` when no `document` is provided");if(!r)throw Error("`createVersion()` requires `publishedId` when `baseId` is provided");return th("createVersion",n),th("createVersion",r),ru(e,t,{actionType:"sanity.action.document.version.create",publishedId:r,baseId:n,versionId:i?eK(r,i):eY(r),ifBaseRevisionId:s},o)}function rn(e,t,r,n){return rc(e,t,"mutate",{mutations:[{delete:tW(r)}]},n)}function ri(e,t,r,n=!1,i){return ru(e,t,{actionType:"sanity.action.document.version.discard",versionId:r,purge:n},i)}function rs(e,t,r,n){return td("replaceVersion",r),ty("replaceVersion",r),ru(e,t,{actionType:"sanity.action.document.version.replace",document:r},n)}function ro(e,t,r,n,i){return ru(e,t,{actionType:"sanity.action.document.version.unpublish",versionId:r,publishedId:n},i)}function ra(e,t,r,n){let i;return rc(e,t,"mutate",{mutations:Array.isArray(i=r instanceof tJ||r instanceof tG?{patch:r.serialize()}:r instanceof tY||r instanceof tK?r.serialize():r)?i:[i],transactionId:n&&n.transactionId||void 0},n)}function ru(e,t,r,n){let i=Array.isArray(r)?r:[r];return rc(e,t,"actions",{actions:i,transactionId:n&&n.transactionId||void 0,skipCrossDatasetReferenceValidation:n&&n.skipCrossDatasetReferenceValidation||void 0,dryRun:n&&n.dryRun||void 0},n)}function rc(e,t,r,n,i={}){let s="mutate"===r,o="actions"===r,a=s||o?"":tQ(n),u=!s&&!o&&a.length<11264,c=i.returnFirst,{timeout:l,token:f,tag:h,headers:d,returnQuery:p,lastLiveEventId:y,cacheMode:g}=i,m=rw(e,r,u?a:"");return rv(e,t,{method:u?"GET":"POST",uri:m,json:!0,body:u?void 0:n,query:s&&t1(i),timeout:l,headers:d,token:f,tag:h,returnQuery:p,perspective:i.perspective,resultSourceMap:i.resultSourceMap,lastLiveEventId:Array.isArray(y)?y[0]:y,cacheMode:g,canUseCdn:"query"===r,signal:i.signal,fetch:i.fetch,useAbortSignal:i.useAbortSignal,useCdn:i.useCdn}).pipe((0,eH.h)(t2),(0,eM.U)(t3),(0,eM.U)(e=>{if(!s)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 rl(e,t,r,n,i={}){return rc(e,t,"mutate",{mutations:[{[n]:r}]},Object.assign({returnFirst:!0,returnDocuments:!0},i))}let rf=e=>{let t=e.config();return void 0!==t.dataset&&void 0!==t.projectId||void 0!==t.resource},rh=(e,t)=>rf(e)&&t.startsWith(rw(e,"query")),rd=(e,t)=>rf(e)&&t.startsWith(rw(e,"mutate")),rp=(e,t)=>rf(e)&&t.startsWith(rw(e,"doc","")),ry=(e,t)=>rf(e)&&t.startsWith(rw(e,"listen")),rg=(e,t)=>rf(e)&&t.startsWith(rw(e,"history","")),rm=(e,t)=>
15t.startsWith("/data/")||rh(e,t)||rd(e,t)||rp(e,t)||ry(e,t)||rg(e,t);function rv(e,t,r){var n;let i=r.url||r.uri,s=e.config(),o=typeof r.canUseCdn>"u"?["GET","HEAD"].indexOf(r.method||"GET")>=0&&rm(e,i):r.canUseCdn,a=(r.useCdn??s.useCdn)&&o,u=r.tag&&s.requestTagPrefix?[s.requestTagPrefix,r.tag].join("."):r.tag||s.requestTagPrefix;if(u&&null!==r.tag&&(r.query={tag:tb(u),...r.query}),["GET","HEAD","POST"].indexOf(r.method||"GET")>=0&&rh(e,i)){let e=r.resultSourceMap??s.resultSourceMap;void 0!==e&&!1!==e&&(r.query={resultSourceMap:e,...r.query});let t=r.perspective||s.perspective;"u">typeof t&&("previewDrafts"===t&&tR(),tU(t),r.query={perspective:Array.isArray(t)?t.join(","):t,...r.query},(Array.isArray(t)&&t.length>0||"previewDrafts"===t||"drafts"===t)&&a&&(a=!1,tS())),r.lastLiveEventId&&(r.query={...r.query,lastLiveEventId:r.lastLiveEventId}),!1===r.returnQuery&&(r.query={returnQuery:"false",...r.query}),a&&"noStale"==r.cacheMode&&(r.query={cacheMode:"noStale",...r.query})}let c=function(e,t={}){let r={};e.headers&&Object.assign(r,e.headers);let 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.withCredentials:t.withCredentials),s=typeof t.timeout>"u"?e.timeout:t.timeout;return Object.assign({},t,{headers:Object.assign({},r,t.headers||{}),timeout:typeof s>"u"?3e5:s,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})}(s,Object.assign({},r,{url:rE(e,i,a)})),l=new z.y(e=>t(c,s.requester).subscribe(e));return r.signal?l.pipe((n=r.signal,e=>new z.y(t=>{let r=()=>t.error(function(e){if(r_)return new DOMException(e?.reason??"The operation was aborted.","AbortError");let t=Error(e?.reason??"The operation was aborted.");return t.name="AbortError",t}(n));if(n&&n.aborted){r();return}let i=e.subscribe(t);return n.addEventListener("abort",r),()=>{n.removeEventListener("abort",r),i.unsubscribe()}}))):l}function rb(e,t,r){return rv(e,t,r).pipe((0,eH.h)(e=>"response"===e.type),(0,eM.U)(e=>e.body))}function rw(e,t,r){let n=e.config();if(n.resource){tw(n);let e=rx(n),i=void 0!==r?`${t}/${r}`:t;return`${e}/${i}`.replace(/\/($|\?)/,"$1")}let i=tv(n),s=`/${t}/${i}`;return`/data${void 0!==r?`${s}/${r}`:s}`.replace(/\/($|\?)/,"$1")}function rE(e,t,r=!1){let{url:n,cdnUrl:i}=e.config();return`${r?i:n}/${t.replace(/^\//,"")}`}let r_=!!globalThis.DOMException,rx=e=>{let t=e.resource;if(!t)throw Error("`resource` must be provided to perform resource queries");let{type:r,id:n}=t;switch(r){case"dataset":{let e=n.split(".");if(2!==e.length)throw Error('Dataset ID must be in the format "project.dataset"');return`/projects/${e[0]}/datasets/${e[1]}`}case"canvas":return`/canvases/${n}`;case"media-library":return`/media-libraries/${n}`;case"dashboard":return`/dashboards/${n}`;default:throw Error(`Unsupported resource type: ${r.toString()}`)}};function rI(e,t,r){let n=tv(e.config());return rb(e,t,{method:"POST",uri:`/agent/action/generate/${n}`,body:r})}function rS(e,t,r){let n=tv(e.config());return rb(e,t,{method:"POST",uri:`/agent/action/transform/${n}`,body:r})}function rR(e,t,r){let n=tv(e.config());return rb(e,t,{method:"POST",uri:`/agent/action/translate/${n}`,body:r})}class rC{#a;#u;constructor(e,t){this.#a=e,this.#u=t}generate(e){return rI(this.#a,this.#u,e)}transform(e){return rS(this.#a,this.#u,e)}translate(e){return rR(this.#a,this.#u,e)}}class rT{#a;#u;constructor(e,t){this.#a=e,this.#u=t}generate(e){return ep(rI(this.#a,this.#u,e))}transform(e){return ep(rS(this.#a,this.#u,e))}translate(e){return ep(rR(this.#a,this.#u,e))}prompt(e){return ep(function(e,t,r){let n=tv(e.config());return rb(e,t,{method:"POST",uri:`/agent/action/prompt/${n}`,body:r})}(this.#a,this.#u,e))}patch(e){return ep(function(e,t,r){let n=tv(e.config());return rb(e,t,{method:"POST",uri:`/agent/action/patch/${n}`,body:r})}(this.#a,this.#u,e))}}class r${#a;#u;constructor(e,t){this.#a=e,this.#u=t}upload(e,t,r){return rO(this.#a,this.#u,e,t,r)}}class rA{#a;#u;constructor(e,t){this.#a=e,this.#u=t}upload(e,t,r){return ep(rO(this.#a,this.#u,e,t,r).pipe((0,eH.h)(e=>"response"===e.type),(0,eM.U)(e=>e.body.document)))}}function rO(e,t,r,n,i={}){tl(r);let s=i.extract||void 0;s&&!s.length&&(s=["none"]);let o=e.config(),a=!(typeof File>"u")&&n instanceof File?Object.assign({filename:!1===i.preserveFilename?void 0:n.name,contentType:n.type},i):i,{tag:u,label:c,title:l,description:f,creditLine:h,filename:d,source:p}=a,y=o.resource?.type==="media-library",g=y?{title:l,filename:d}:{label:c,title:l,description:f,filename:d,meta:s,creditLine:h};return p&&!y&&(g.sourceId=p.id,g.sourceName=p.name,g.sourceUrl=p.url),rv(e,t,{tag:u,method:"POST",timeout:a.timeout||0,uri:function(e,t){let r="image"===t?"images":"files",n=e.resource;if(n){let{type:e,id:t}=n;switch(e){case"dataset":throw Error("Assets are not supported for dataset resources, yet. Configure the client with `{projectId: <projectId>, dataset: <datasetId>}` instead.");case"canvas":return`/canvases/${t}/assets/${r}`;case"media-library":return`/media-libraries/${t}/upload`;case"dashboard":return`/dashboards/${t}/assets/${r}`;default:throw Error(`Unsupported resource type: ${e.toString()}`)}}let i=tv(e);return`assets/${r}/${i}`}(o,r),headers:a.contentType?{"Content-Type":a.contentType}:{},query:g,body:n})}var rq=(e,t)=>
15Object.keys(t).concat(Object.keys(e)).reduce((r,n)=>(r[n]=typeof e[n]>"u"?t[n]:e[n],r),{});let rk=(e,t)=>t.reduce((t,r)=>(typeof e[r]>"u"||(t[r]=e[r]),t),{}),rj=(0,V.P)(()=>r.e(45).then(r.t.bind(r,17045,19))).pipe((0,eM.U)(({default:e})=>e),eS({connector:function(){return new ex(1,n,i)},resetOnError:!0,resetOnComplete:!1,resetOnRefCountZero:!1}));function rU(){return function(e){return e.pipe(eC((e,t)=>{var r;return e instanceof tB?function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return e$(1)(ec(e,G(e)))}(el({type:"reconnect"}),(void 0===r&&(r=ej),new z.y(function(e){var t=1e3,n=0;return r.schedule(function(){e.closed||(e.next(n++),e.complete())},t)})).pipe((0,ef.z)(()=>t))):eU(()=>e)}))}}let rP=["includePreviousRevision","includeResult","includeMutations","includeAllVersions","visibility","effectFormat","enableResume","tag"],rB={includeResult:!0};function rM(e,t,r={}){let{url:n,token:i,withCredentials:s,requestTagPrefix:o,headers:a}=this.config(),u=r.tag&&o?[o,r.tag].join("."):r.tag,c={...rq(r,rB),tag:u},l=tQ({query:e,params:t,options:{tag:u,...rk(c,rP)}}),f=`${n}${rw(this,"listen",l)}`;if(f.length>14800)return eU(()=>Error("Query too large for listener"));let h=c.events?c.events:["mutation"],d={};return s&&(d.withCredentials=!0),(i||a)&&(d.headers={},i&&(d.headers.Authorization=`Bearer ${i}`),a&&Object.assign(d.headers,a)),tz(()=>(typeof EventSource>"u"||d.headers?rj:el(EventSource)).pipe((0,eM.U)(e=>new e(f,d))),h).pipe(rU(),(0,eH.h)(e=>h.includes(e.type)),(0,eM.U)(e=>({type:e.type,..."data"in e?e.data:{}})))}let rL="2021-03-25";class rD{#a;constructor(e){this.#a=e}events({includeDrafts:e=!1,tag:t}={}){var r,n,i;let{projectId:s,apiVersion:o,token:a,withCredentials:u,requestTagPrefix:c,headers:l}=this.#a.config(),f=o.replace(/^v/,"");if("X"!==f&&f<rL)throw Error(`The live events API requires API version ${rL} or later. The current API version is ${f}. Please update your API version to use this feature.`);if(e&&!a&&!u)throw Error("The live events API requires a token or withCredentials when 'includeDrafts: true'. Please update your client configuration. The token should have the lowest possible access role.");let h=rw(this.#a,"live/events"),d=new URL(this.#a.getUrl(h,!1)),p=t&&c?[c,t].join("."):t;p&&d.searchParams.set("tag",p),e&&d.searchParams.set("includeDrafts","true");let y={};e&&u&&(y.withCredentials=!0),(e&&a||l)&&(y.headers={},e&&a&&(y.headers.Authorization=`Bearer ${a}`),l&&Object.assign(y.headers,l));let g=`${d.href}::${JSON.stringify(y)}`,m=rF.get(g);if(m)return m;let v=tz(()=>(typeof EventSource>"u"||y.headers?rj:el(EventSource)).pipe((0,eM.U)(e=>new e(d.href,y))),["message","restart","welcome","reconnect","goaway"]),b=(n={method:"OPTIONS",mode:"cors",credentials:y.withCredentials?"include":"omit",headers:y.headers},new z.y(e=>{let t=new AbortController,r=t.signal;return fetch(d,{...n,signal:t.signal}).then(t=>{e.next(t),e.complete()},t=>{r.aborted||e.error(t)}),()=>t.abort()})).pipe(eC(()=>{throw new tt({projectId:s})})),w=v.pipe(rU(),(0,ef.z)(e=>"reconnect"===e.type?b.pipe((0,ef.z)(()=>el(e))):el(e)),eC(e=>b.pipe((0,ef.z)(()=>{throw e}))),(0,eM.U)(e=>{if("message"===e.type){let{data:t,...r}=e;return{...r,tags:t.tags}}return e})).pipe(eP(()=>rF.delete(g)),(i="function"==typeof(r={predicate:e=>"welcome"===e.type})?{predicate:r}:r,e=>{var t,r,n,s;let o,a=!1,{predicate:u,...c}=i;return function(){for(var e,t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];var n=G(t),i=(e=1/0,"number"==typeof H(t)?t.pop():e);return t.length?1===t.length?(0,J.Xf)(t[0]):e$(i)(ec(t,n)):eB.E}(e.pipe((t=e=>{i.predicate(e)&&(a=!0,o=e)},(s=(0,W.m)(t)?{next:t,error:r,complete:n}:t)?(0,Z.e)(function(e,t){null===(r=s.subscribe)||void 0===r||r.call(s);var r,n=!0;e.subscribe((0,Y.x)(t,function(e){var r;null===(r=s.next)||void 0===r||r.call(s,e),t.next(e)},function(){var e;n=!1,null===(e=s.complete)||void 0===e||e.call(s),t.complete()},function(e){var r;n=!1,null===(r=s.error)||void 0===r||r.call(s,e),t.error(e)},function(){var e,t;n&&(null===(e=s.unsubscribe)||void 0===e||e.call(s)),null===(t=s.finalize)||void 0===t||t.call(s)}))}):eT.y),eP(()=>{a=!1,o=void 0}),eS(c)),new z.y(e=>{a&&e.next(o),e.complete()}
15))}));return rF.set(g,w),w}}let rF=new Map;class rN{#a;#u;constructor(e,t){this.#a=e,this.#u=t}create(e,t){return rV(this.#a,this.#u,"PUT",e,t)}edit(e,t){return rV(this.#a,this.#u,"PATCH",e,t)}delete(e){return rV(this.#a,this.#u,"DELETE",e)}list(){tE("dataset",this.#a.config());let e=this.#a.config(),t=e.projectId,r="/datasets";return!1===e.useProjectHostname&&(r=`/projects/${t}/datasets`),rb(this.#a,this.#u,{uri:r,tag:null})}}class rz{#a;#u;constructor(e,t){this.#a=e,this.#u=t}create(e,t){return tE("dataset",this.#a.config()),ep(rV(this.#a,this.#u,"PUT",e,t))}edit(e,t){return tE("dataset",this.#a.config()),ep(rV(this.#a,this.#u,"PATCH",e,t))}delete(e){return tE("dataset",this.#a.config()),ep(rV(this.#a,this.#u,"DELETE",e))}list(){tE("dataset",this.#a.config());let e=this.#a.config(),t=e.projectId,r="/datasets";return!1===e.useProjectHostname&&(r=`/projects/${t}/datasets`),ep(rb(this.#a,this.#u,{uri:r,tag:null}))}}function rV(e,t,r,n,i){return tE("dataset",e.config()),tu(n),rb(e,t,{method:r,uri:`/datasets/${n}`,body:i,tag:null})}class rW{#a;#u;constructor(e,t){this.#a=e,this.#u=t}getPlaybackInfo(e,t={}){let r=this.#a.config(),n=(r.resource||r["~experimental_resource"])?.id,{instanceId:i,libraryId:s}=function(e){let t="object"==typeof e&&"_ref"in e?e._ref:e,r=rG.exec(t);if(r){let[,e,t]=r;return{libraryId:e,instanceId:t}}if("string"==typeof e&&e.startsWith("video-"))return{instanceId:e};throw Error(`Invalid video asset instance identifier "${t}": must be a valid video instance id or a Global Dataset Reference (GDR) to the video asset in the Media Library`)}(e),o=s||n;if(!o)throw Error("Could not determine Media Library ID - you need to provide a valid Media Library ID in the client config or a Media Library GDR");let a=`/media-libraries/${o}/video/${i}/playback-info`,u=function(e){let t={};if(e.transformations){let{thumbnail:r,animated:n,storyboard:i}=e.transformations;r&&(r.width&&(t.thumbnailWidth=r.width),r.height&&(t.thumbnailHeight=r.height),void 0!==r.time&&(t.thumbnailTime=r.time),r.fit&&(t.thumbnailFit=r.fit),r.format&&(t.thumbnailFormat=r.format)),n&&(n.width&&(t.animatedWidth=n.width),n.height&&(t.animatedHeight=n.height),void 0!==n.start&&(t.animatedStart=n.start),void 0!==n.end&&(t.animatedEnd=n.end),n.fps&&(t.animatedFps=n.fps),n.format&&(t.animatedFormat=n.format)),i&&i.format&&(t.storyboardFormat=i.format)}return e.expiration&&(t.expiration=e.expiration),t}(t);return rb(this.#a,this.#u,{method:"GET",uri:a,query:u})}}class rH{#a;#u;constructor(e,t){this.#a=e,this.#u=t}getPlaybackInfo(e,t={}){return ep(new rW(this.#a.observable,this.#u).getPlaybackInfo(e,t))}}let rG=/^media-library:(ml[^:]+):([^:]+)$/;class rJ{#a;#u;constructor(e,t){this.#a=e,this.#u=t}list(e){let t={};return e?.includeMembers===!1&&(t.includeMembers="false"),e?.organizationId&&(t.organizationId=e.organizationId),rb(this.#a,this.#u,{uri:"/projects",query:t})}getById(e){return rb(this.#a,this.#u,{uri:`/projects/${e}`})}}class rX{#a;#u;constructor(e,t){this.#a=e,this.#u=t}list(e){let t={};return e?.includeMembers===!1&&(t.includeMembers="false"),e?.organizationId&&(t.organizationId=e.organizationId),ep(rb(this.#a,this.#u,{uri:"/projects",query:t}))}getById(e){return ep(rb(this.#a,this.#u,{uri:`/projects/${e}`}))}}let rZ=((e,t=21)=>e2(e,t,e1))("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789",8),rY=(e,t)=>t?eK(e,t):eY(e);function rK(e,{releaseId:t,publishedId:r,document:n}){if(r&&n._id){let e=rY(r,t);return tg(e,n),e}if(n._id){let r=eX(n._id),i=eZ(n._id);if(!r&&!i)throw Error(`\`${e}()\` requires a document with an \`_id\` that is a version or draft ID`);if(t){if(r)throw Error(`\`${e}()\` was called with a document ID (\`${n._id}\`) that is a draft ID, but a release ID (\`${t}\`) was also provided.`);let i=eQ(n._id);if(i!==t)throw Error(`\`${e}()\` was called with a document ID (\`${n._id}\`) that is a version ID, but the release ID (\`${t}\`) does not match the document's version ID (\`${i}\`).`)}return n._id}if(r)return rY(r,t);throw Error(`\`${e}()\` requires either a publishedId or a document with an \`_id\``)}let rQ=(e,t)=>{if("object"==typeof e&&null!==e&&("releaseId"in e||"metadata"in e)){let{releaseId:r=rZ(),metadata:n={}}=e;return[r,n,t]}return[rZ(),{},e]},r0=(e,t)=>{let[r,n,i]=rQ(e,t);return{action:{actionType:"sanity.action.release.create",releaseId:r,metadata:{...n,releaseType:n.releaseType||"undecided"}},options:i}};class r1{#a;#u;
15constructor(e,t){this.#a=e,this.#u=t}get({releaseId:e},t){return t8(this.#a,this.#u,`_.releases.${e}`,t)}create(e,t){let{action:r,options:n}=r0(e,t),{releaseId:i,metadata:s}=r;return ru(this.#a,this.#u,r,n).pipe((0,eM.U)(e=>({...e,releaseId:i,metadata:s})))}edit({releaseId:e,patch:t},r){return ru(this.#a,this.#u,{actionType:"sanity.action.release.edit",releaseId:e,patch:t},r)}publish({releaseId:e},t){return ru(this.#a,this.#u,{actionType:"sanity.action.release.publish",releaseId:e},t)}archive({releaseId:e},t){return ru(this.#a,this.#u,{actionType:"sanity.action.release.archive",releaseId:e},t)}unarchive({releaseId:e},t){return ru(this.#a,this.#u,{actionType:"sanity.action.release.unarchive",releaseId:e},t)}schedule({releaseId:e,publishAt:t},r){return ru(this.#a,this.#u,{actionType:"sanity.action.release.schedule",releaseId:e,publishAt:t},r)}unschedule({releaseId:e},t){return ru(this.#a,this.#u,{actionType:"sanity.action.release.unschedule",releaseId:e},t)}delete({releaseId:e},t){return ru(this.#a,this.#u,{actionType:"sanity.action.release.delete",releaseId:e},t)}fetchDocuments({releaseId:e},t){return t9(this.#a,this.#u,e,t)}}class r2{#a;#u;constructor(e,t){this.#a=e,this.#u=t}get({releaseId:e},t){return ep(t8(this.#a,this.#u,`_.releases.${e}`,t))}async create(e,t){let{action:r,options:n}=r0(e,t),{releaseId:i,metadata:s}=r;return{...await ep(ru(this.#a,this.#u,r,n)),releaseId:i,metadata:s}}edit({releaseId:e,patch:t},r){return ep(ru(this.#a,this.#u,{actionType:"sanity.action.release.edit",releaseId:e,patch:t},r))}publish({releaseId:e},t){return ep(ru(this.#a,this.#u,{actionType:"sanity.action.release.publish",releaseId:e},t))}archive({releaseId:e},t){return ep(ru(this.#a,this.#u,{actionType:"sanity.action.release.archive",releaseId:e},t))}unarchive({releaseId:e},t){return ep(ru(this.#a,this.#u,{actionType:"sanity.action.release.unarchive",releaseId:e},t))}schedule({releaseId:e,publishAt:t},r){return ep(ru(this.#a,this.#u,{actionType:"sanity.action.release.schedule",releaseId:e,publishAt:t},r))}unschedule({releaseId:e},t){return ep(ru(this.#a,this.#u,{actionType:"sanity.action.release.unschedule",releaseId:e},t))}delete({releaseId:e},t){return ep(ru(this.#a,this.#u,{actionType:"sanity.action.release.delete",releaseId:e},t))}fetchDocuments({releaseId:e},t){return ep(t9(this.#a,this.#u,e,t))}}class r3{#a;#u;constructor(e,t){this.#a=e,this.#u=t}getById(e){return rb(this.#a,this.#u,{uri:`/users/${e}`})}}class r6{#a;#u;constructor(e,t){this.#a=e,this.#u=t}getById(e){return ep(rb(this.#a,this.#u,{uri:`/users/${e}`}))}}class r5{assets;datasets;live;mediaLibrary;projects;users;agent;releases;#c;#u;listen=rM;constructor(e,t=tq){this.config(t),this.#u=e,this.assets=new r$(this,this.#u),this.datasets=new rN(this,this.#u),this.live=new rD(this),this.mediaLibrary={video:new rW(this,this.#u)},this.projects=new rJ(this,this.#u),this.users=new r3(this,this.#u),this.agent={action:new rC(this,this.#u)},this.releases=new r1(this,this.#u)}clone(){return new r5(this.#u,this.config())}config(e){if(void 0===e)return{...this.#c};if(this.#c&&!1===this.#c.allowReconfigure)throw Error("Existing client instance cannot be reconfigured - use `withConfig(newConfig)` to return a new client");return this.#c=tP(e,this.#c||{}),this}withConfig(e){let t=this.config();return new r5(this.#u,{...t,...e,stega:{...t.stega||{},..."boolean"==typeof e?.stega?{enabled:e.stega}:e?.stega||{}}})}fetch(e,t,r){return t5(this,this.#u,this.#c.stega,e,t,r)}getDocument(e,t){if(t?.includeAllVersions===!0)return t8(this,this.#u,e,{...t,includeAllVersions:!0});let r={signal:t?.signal,tag:t?.tag,releaseId:t?.releaseId,...t&&"includeAllVersions"in t?{includeAllVersions:!1}:{}};return t8(this,this.#u,e,r)}getDocuments(e,t){return t4(this,this.#u,e,t)}create(e,t){return rl(this,this.#u,e,"create",t)}createIfNotExists(e,t){return t7(this,this.#u,e,t)}createOrReplace(e,t){return re(this,this.#u,e,t)}createVersion({document:e,publishedId:t,releaseId:r,baseId:n,ifBaseRevisionId:i},s){if(!e)return rr(this,this.#u,t,n,r,i,s);let o=rK("createVersion",{document:e,publishedId:t,releaseId:r}),a={...e,_id:o},u=t||e0(e._id);return rt(this,this.#u,a,u,s)}delete(e,t){return rn(this,this.#u,e,t)}discardVersion({releaseId:e,publishedId:t},r,n){let i=rY(t,e);return ri(this,this.#u,i,r,n)}replaceVersion({document:e,publishedId:t,releaseId:r},n){let i=rK("replaceVersion",{document:e,publishedId:t,releaseId:r}),s={...e,_id:i};return rs(this,this.#u,s,n)}unpublishVersion({releaseId:e,publishedId:t},r){let n=eK(t,e);return ro(this,this.#u,n,t,r)}mutate(e,t){return ra(this,this.#u,e,t)}patch(e,t){return new tG(e,t,this)}transaction(e){return new tK(e,this)}action(e,t){return ru(this,this.#u,e,t)}request(e){return rb(this,this.#u,e)}getUrl(e,t){return rE(this,e,t)}getDataUrl(e,t){return rw(this,e,t)}}class r8{assets;datasets;live;mediaLibrary;projects;users;agent;releases;observable;#c;#u;listen=rM;constructor(e,t=tq){this.config(t),this.#u=e,this.assets=new rA(this,this.#u),this.datasets=new rz(this,this.#u),this.live=new rD(this),this.mediaLibrary={video:new rH(this,this.#u)}
15,this.projects=new rX(this,this.#u),this.users=new r6(this,this.#u),this.agent={action:new rT(this,this.#u)},this.releases=new r2(this,this.#u),this.observable=new r5(e,t)}clone(){return new r8(this.#u,this.config())}config(e){if(void 0===e)return{...this.#c};if(this.#c&&!1===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),this.#c=tP(e,this.#c||{}),this}withConfig(e){let t=this.config();return new r8(this.#u,{...t,...e,stega:{...t.stega||{},..."boolean"==typeof e?.stega?{enabled:e.stega}:e?.stega||{}}})}fetch(e,t,r){return ep(t5(this,this.#u,this.#c.stega,e,t,r))}getDocument(e,t){if(t?.includeAllVersions===!0)return ep(t8(this,this.#u,e,{...t,includeAllVersions:!0}));let r={signal:t?.signal,tag:t?.tag,releaseId:t?.releaseId,...t&&"includeAllVersions"in t?{includeAllVersions:!1}:{}};return ep(t8(this,this.#u,e,r))}getDocuments(e,t){return ep(t4(this,this.#u,e,t))}create(e,t){return ep(rl(this,this.#u,e,"create",t))}createIfNotExists(e,t){return ep(t7(this,this.#u,e,t))}createOrReplace(e,t){return ep(re(this,this.#u,e,t))}createVersion({document:e,publishedId:t,releaseId:r,baseId:n,ifBaseRevisionId:i},s){if(!e)return eL(rr(this,this.#u,t,n,r,i,s));let o=rK("createVersion",{document:e,publishedId:t,releaseId:r}),a={...e,_id:o},u=t||e0(e._id);return eL(rt(this,this.#u,a,u,s))}delete(e,t){return ep(rn(this,this.#u,e,t))}discardVersion({releaseId:e,publishedId:t},r,n){let i=rY(t,e);return ep(ri(this,this.#u,i,r,n))}replaceVersion({document:e,publishedId:t,releaseId:r},n){let i=rK("replaceVersion",{document:e,publishedId:t,releaseId:r}),s={...e,_id:i};return eL(rs(this,this.#u,s,n))}unpublishVersion({releaseId:e,publishedId:t},r){let n=eK(t,e);return ep(ro(this,this.#u,n,t,r))}mutate(e,t){return ep(ra(this,this.#u,e,t))}patch(e,t){return new tJ(e,t,this)}transaction(e){return new tY(e,this)}action(e,t){return ep(ru(this,this.#u,e,t))}request(e){return ep(rb(this,this.#u,e))}dataRequest(e,t,r){return ep(rc(this,this.#u,e,t,r))}getUrl(e,t){return rE(this,e,t)}getDataUrl(e,t){return rw(this,e,t)}}let r4={requester:tn(s=[]),createClient:e=>{let t=tn(s,{ignoreWarnings:e.ignoreWarnings});return new r8((r,n)=>(n||t)({maxRedirects:0,maxRetries:e.maxRetries,retryDelay:e.retryDelay,lineage:e.lineage,...r}),e)}},r9=(r4.requester,r4.createClient);var r7=r(43538),ne=r(66639),nt=r(50455),nr=r(43620),nn=r(93415),ni=r(22167),ns=r(90581);let no=(0,nt.default)(()=>r.e(25).then(r.bind(r,89025)),{loadableGenerated:{webpack:()=>[require.resolveWeak("../_chunks-es/PresentationComlink.js")]},ssr:!1}),na=(0,nt.default)(()=>r.e(873).then(r.bind(r,50873)),{loadableGenerated:{webpack:()=>[require.resolveWeak("../_chunks-es/RefreshOnMount.js")]},ssr:!1}),nu=(0,nt.default)(()=>r.e(85).then(r.bind(r,41085)),{loadableGenerated:{webpack:()=>[require.resolveWeak("../_chunks-es/RefreshOnFocus.js")]},ssr:!1}),nc=(0,nt.default)(()=>r.e(836).then(r.bind(r,73836)),{loadableGenerated:{webpack:()=>[require.resolveWeak("../_chunks-es/RefreshOnReconnect.js")]},ssr:!1});function nl(e){e instanceof tt?console.warn(`Sanity Live is unable to connect to the Sanity API as the current origin - ${window.origin} - is not in the list of allowed CORS origins for this Sanity Project.`,e.addOriginUrl&&"Add it here:",e.addOriginUrl?.toString()):console.error(e)}function nf(e,t){t?console.warn("Sanity Live connection closed, switching to long polling set to a interval of",t/1e3,"seconds and the server gave this reason:",e.reason):console.error("Sanity Live connection closed, automatic revalidation is disabled, the server gave this reason:",e.reason)}function nh(e){let{projectId:t,dataset:r,apiHost:n,apiVersion:i,useProjectHostname:s,token:a,requestTagPrefix:u,draftModeEnabled:c,draftModePerspective:l,refreshOnMount:f=!1,refreshOnFocus:h=!c&&(typeof window>"u"||window.self===window.top),refreshOnReconnect:d=!0,intervalOnGoAway:p=3e4,requestTag:y="next-loader.live",onError:g=nl,onGoAway:m=nf,revalidateSyncTags:v=r7.n}=e,b=(0,nn.useMemo)(()=>r9({projectId:t,dataset:r,apiHost:n,apiVersion:i,useProjectHostname:s,ignoreBrowserTokenWarning:!0,token:a,useCdn:!1,requestTagPrefix:u}),[n,i,r,t,u,a,s]),[w,E]=(0,nn.useState)(!1),_=(0,nr.useRouter)(),x=(0,ni.i)(e=>{"message"===e.type?v(e.tags):"restart"===e.type||"reconnect"===e.type?_.refresh():"goaway"===e.type&&(m(e,p),E(p))});(0,nn.useEffect)(()=>{let e=b.live.events({includeDrafts:!!a,tag:y}).subscribe({next:x,error:e=>{g(e)}});return()=>e.unsubscribe()},[b.live,g,y,a]),(0,nn.useEffect)(()=>{c&&l?(0,ns.Bk)(l):(0,ns.Bk)("unknown")},[c,l]);let[I,S]=(0,nn.useState)(!1);(0,nn.useEffect)(()=>
15{if(!(0,ne.Ig)()){if(c&&a){(0,ns.Uw)("live");return}if(c){(0,ns.Uw)("static");return}(0,ns.Uw)("unknown")}},[c,a]),(0,nn.useEffect)(()=>{if(!(0,ne.Ig)())return;let e=new AbortController,t=setTimeout(()=>(0,ns.Uw)("live"),3e3);return window.addEventListener("message",r=>{let{data:n}=r;n&&"object"==typeof n&&"domain"in n&&"sanity/channels"===n.domain&&"from"in n&&"presentation"===n.from&&(clearTimeout(t),(0,ns.Uw)((0,ne.Ax)()?"presentation-window":"presentation-iframe"),S(!0),e.abort())},{signal:e.signal}),()=>{clearTimeout(t),e.abort()}},[]);let R=(0,nn.useRef)(void 0);return(0,nn.useEffect)(()=>{if(c)return clearTimeout(R.current),()=>{R.current=setTimeout(()=>{console.warn("Sanity Live: Draft mode was enabled, but is now being disabled")})}},[c]),(0,nn.useEffect)(()=>{if(!w)return;let e=setInterval(()=>_.refresh(),w);return()=>clearInterval(e)},[w,_]),(0,o.jsxs)(o.Fragment,{children:[c&&I&&(0,o.jsx)(no,{projectId:t,dataset:r,draftModeEnabled:c,draftModePerspective:l}),!c&&f&&(0,o.jsx)(na,{}),!c&&h&&(0,o.jsx)(nu,{}),!c&&d&&(0,o.jsx)(nc,{})]})}nh.displayName="SanityLive"},43538:function(e,t,r){"use strict";r.d(t,{N:function(){return i},n:function(){return s}}),r(87878);var n=r(55561),i=(0,n.$)("8f8c118ec13d179110713fe6d973bfa8fe1655ab"),s=(0,n.$)("c3d29922a2ad9f32366d1553af878f473b69fa4e")},66639:function(e,t,r){"use strict";r.d(t,{Ax:function(){return l},Ig:function(){return f},XP:function(){return c}});var n=r(36522);let i={"handshake/syn":n.bK,"handshake/syn-ack":n.Ol,"handshake/ack":n.ei,"channel/response":n.Ag,"channel/heartbeat":n.UE,"channel/disconnect":n.Hq,"overlay/focus":"visual-editing/focus","overlay/navigate":"visual-editing/navigate","overlay/toggle":"visual-editing/toggle","presentation/toggleOverlay":"presentation/toggle-overlay"},s={[n.bK]:"handshake/syn",[n.Ol]:"handshake/syn-ack",[n.ei]:"handshake/ack",[n.Ag]:"channel/response",[n.UE]:"channel/heartbeat",[n.Hq]:"channel/disconnect","visual-editing/focus":"overlay/focus","visual-editing/navigate":"overlay/navigate","visual-editing/toggle":"overlay/toggle","presentation/toggle-overlay":"presentation/toggleOverlay"},o=e=>{let{data:t}=e;return t&&"object"==typeof t&&"domain"in t&&"type"in t&&"from"in t&&"to"in t&&("sanity/channels"===t.domain&&(t.domain=n.yK),"overlays"===t.to&&(t.to="visual-editing"),"overlays"===t.from&&(t.from="visual-editing"),t.channelId=t.connectionId,delete t.connectionId,t.type=i[t.type]??t.type),e},a=e=>{let{channelId:t,...r}=e,i={...r,connectionId:t};return i.domain===n.yK&&(i.domain="sanity/channels"),"visual-editing"===i.to&&(i.to="overlays"),"visual-editing"===i.from&&(i.from="overlays"),i.type=s[i.type]??i.type,"channel/response"===i.type&&i.responseTo&&!i.data&&(i.data={responseTo:i.responseTo}),("handshake/syn"===i.type||"handshake/syn-ack"===i.type||"handshake/ack"===i.type)&&(i.data={id:i.connectionId}),i},u=({context:e},t)=>{let{sources:r,targetOrigin:n}=e,i=a(t.message);r.forEach(e=>{e.postMessage(i,{targetOrigin:n})})},c=()=>({listen:(0,n.F8)(o),requestMachine:(0,n.lB)().provide({actions:{"send message":u}})});function l(){return!!window.opener}function f(){return window.self!==window.top||l()}},29876:function(e,t,r){"use strict";r.d(t,{YD:function(){return d},df:function(){return h}});var n=r(93415),i=Object.defineProperty,s=(e,t,r)=>t in e?i(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,o=(e,t,r)=>s(e,"symbol"!=typeof t?t+"":t,r),a=new Map,u=new WeakMap,c=0,l=void 0;function f(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:l;if(void 0===window.IntersectionObserver&&void 0!==n){let i=e.getBoundingClientRect();return t(n,{isIntersecting:n,target:e,intersectionRatio:"number"==typeof r.threshold?r.threshold:0,time:0,boundingClientRect:i,intersectionRect:i,rootBounds:i}),()=>{}}let{id:i,observer:s,elements:o}=function(e){let t=Object.keys(e).sort().filter(t=>void 0!==e[t]).map(t=>{var r;return`${t}_${"root"===t?(r=e.root)?(u.has(r)||(c+=1,u.set(r,c.toString())),u.get(r)):"0":e[t]}`}).toString(),r=a.get(t);if(!r){let n;let i=new Map,s=new IntersectionObserver(t=>{t.forEach(t=>{var r;let s=t.isIntersecting&&n.some(e=>t.intersectionRatio>=e);e.trackVisibility&&void 0===t.isVisible&&(t.isVisible=s),null==(r=i.get(t.target))||r.forEach(e
15=>{e(s,t)})})},e);n=s.thresholds||(Array.isArray(e.threshold)?e.threshold:[e.threshold||0]),r={id:t,observer:s,elements:i},a.set(t,r)}return r}(r),f=o.get(e)||[];return o.has(e)||o.set(e,f),f.push(t),s.observe(e),function(){f.splice(f.indexOf(t),1),0===f.length&&(o.delete(e),s.unobserve(e)),0===o.size&&(s.disconnect(),a.delete(i))}}var h=class extends n.Component{constructor(e){super(e),o(this,"node",null),o(this,"_unobserveCb",null),o(this,"handleNode",e=>{!this.node||(this.unobserve(),e||this.props.triggerOnce||this.props.skip||this.setState({inView:!!this.props.initialInView,entry:void 0})),this.node=e||null,this.observeNode()}),o(this,"handleChange",(e,t)=>{e&&this.props.triggerOnce&&this.unobserve(),"function"!=typeof this.props.children||this.setState({inView:e,entry:t}),this.props.onChange&&this.props.onChange(e,t)}),this.state={inView:!!e.initialInView,entry:void 0}}componentDidMount(){this.unobserve(),this.observeNode()}componentDidUpdate(e){(e.rootMargin!==this.props.rootMargin||e.root!==this.props.root||e.threshold!==this.props.threshold||e.skip!==this.props.skip||e.trackVisibility!==this.props.trackVisibility||e.delay!==this.props.delay)&&(this.unobserve(),this.observeNode())}componentWillUnmount(){this.unobserve()}observeNode(){if(!this.node||this.props.skip)return;let{threshold:e,root:t,rootMargin:r,trackVisibility:n,delay:i,fallbackInView:s}=this.props;this._unobserveCb=f(this.node,this.handleChange,{threshold:e,root:t,rootMargin:r,trackVisibility:n,delay:i},s)}unobserve(){this._unobserveCb&&(this._unobserveCb(),this._unobserveCb=null)}render(){let{children:e}=this.props;if("function"==typeof e){let{inView:t,entry:r}=this.state;return e({inView:t,entry:r,ref:this.handleNode})}let{as:t,triggerOnce:r,threshold:i,root:s,rootMargin:o,onChange:a,skip:u,trackVisibility:c,delay:l,initialInView:f,fallbackInView:h,...d}=this.props;return n.createElement(t||"div",{ref:this.handleNode,...d},e)}};function d(){var e;let{threshold:t,delay:r,trackVisibility:i,rootMargin:s,root:o,triggerOnce:a,skip:u,initialInView:c,fallbackInView:l,onChange:h}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},[d,p]=n.useState(null),y=n.useRef(h),[g,m]=n.useState({inView:!!c,entry:void 0});y.current=h,n.useEffect(()=>{let e;if(!u&&d)return e=f(d,(t,r)=>{m({inView:t,entry:r}),y.current&&y.current(t,r),r.isIntersecting&&a&&e&&(e(),e=void 0)},{root:o,rootMargin:s,threshold:t,trackVisibility:i,delay:r},l),()=>{e&&e()}},[Array.isArray(t)?t.toString():t,d,o,s,a,u,i,l,r]);let v=null==(e=g.entry)?void 0:e.target,b=n.useRef(void 0);d||!v||a||u||b.current===v||(b.current=v,m({inView:!!c,entry:void 0}));let w=[p,g.inView,g.entry];return w.ref=w[0],w.inView=w[1],w.entry=w[2],w}},29978:function(e,t,r){"use strict";r.d(t,{CR:function(){return u},FC:function(){return f},Jh:function(){return o},KL:function(){return h},XA:function(){return a},ZT:function(){return i},ev:function(){return c},mG:function(){return s},qq:function(){return l}});var n=function(e,t){return(n=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)};function i(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}function s(e,t,r,n){return new(r||(r=Promise))(function(i,s){function o(e){try{u(n.next(e))}catch(e){s(e)}}function a(e){try{u(n.throw(e))}catch(e){s(e)}}function u(e){var t;e.done?i(e.value):((t=e.value)instanceof r?t:new r(function(e){e(t)})).then(o,a)}u((n=n.apply(e,t||[])).next())})}function o(e,t){var r,n,i,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]},o=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return o.next=a(0),o.throw=a(1),o.return=a(2),"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(a){return function(u){return function(a){if(r)throw TypeError("Generator is already executing.");for(;o&&(o=0,a[0]&&(s=0)),s;)try{if(r=1,n&&(i=2&a[0]?n.return:a[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,a[1])).done)return i;switch(n=0,i&&(a=[2&a[0],i.value]),a[0]){case 0:case 1:i=a;break;case 4:return s.label++,{value:a[1],done:!1};case 5:s.label++,n=a[1],a=[0];continue;case 7:a=s.ops.pop(),s.trys.pop();continue;default:if(!(i=(i=s.trys).length>0&&i[i.length-1])&&(6===a[0]||2===a[0])){s=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]<i[3])){s.label=a[1];break}if(6===a[0]&&s.label<i[1]){s.label=i[1],i=a;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(a);break}i[2]&&s.ops.pop(),s.trys.pop();continue}a=t.call(e,s)}catch(e){a=[6,e],n=0}finally{r=i=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,u])}}}function a(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);
vendor: 1,177 bytes, line 15
15if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function u(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,s=r.call(e),o=[];try{for(;(void 0===t||t-- >0)&&!(n=s.next()).done;)o.push(n.value)}catch(e){i={error:e}}finally{try{n&&!n.done&&(r=s.return)&&r.call(s)}finally{if(i)throw i.error}}return o}function c(e,t,r){if(r||2==arguments.length)for(var n,i=0,s=t.length;i<s;i++)!n&&i in t||(n||(n=Array.prototype.slice.call(t,0,i)),n[i]=t[i]);return e.concat(n||Array.prototype.slice.call(t))}function l(e){return this instanceof l?(this.v=e,this):new l(e)}function f(e,t,r){if(!Symbol.asyncIterator)throw TypeError("Symbol.asyncIterator is not defined.");var n,i=r.apply(e,t||[]),s=[];return n=Object.create(("function"==typeof AsyncIterator?AsyncIterator:Object).prototype),o("next"),o("throw"),o("return",function(e){return function(t){return Promise.resolve(t).then(e,c)}}),n[Symbol.asyncIterator]=function(){return this},n;function o(e,t){i[e]&&(n[e]=function(t){return new Promise(function(r,n){
15s.push([e,t,r,n])>1||a(e,t)})},t&&(n[e]=t(n[e])))}function a(e,t){try{var r;(r=i[e](t)).value instanceof l?Promise.resolve(r.value.v).then(u,c):f(s[0][2],r)}catch(e){f(s[0][3],e)}}function u(e){a("next",e)}function c(e){a("throw",e)}function f(e,t){e(t),s.shift(),s.length&&a(s[0][0],s[0][1])}}function h(e){if(!Symbol.asyncIterator)throw TypeError("Symbol.asyncIterator is not defined.");var t,r=e[Symbol.asyncIterator];return r?r.call(e):(e=a(e),t={},n("next"),n("throw"),n("return"),t[Symbol.asyncIterator]=function(){return this},t);function n(r){t[r]=e[r]&&function(t){return new Promise(function(n,i){!function(e,t,r,n){Promise.resolve(n).then(function(t){e({value:t,done:r})},t)}(n,i,(t=e[r](t)).done,t.value)})}}}"function"==typeof SuppressedError&&SuppressedError},22167:function(e,t,r){"use strict";r.d(t,{i:function(){return a}});var n=r(93415);let i=n.createContext(!0);function s(){throw Error("A function wrapped in useEffectEvent can't be called during rendering.")}let o=()=>{try{return n.use(i)}catch{return!1}};function a(e){let t=n.useRef(s);return n.useInsertionEffect(()=>{t.current=e},[e]),(...e)=>(o()&&s(),(0,t.current)(...e))}}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.