PageSourceSearch

https://cantos.vc/_next/static/chunks/18-5392b7110e440d64.js?dpl=d…9663162663833373337333230303038313665373031

js cantos.vc collected 2026-09-28 06:37:18 UTC 165,242 bytes, 16 lines download raw bytes

1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[18],{43026:function(t,e,n){n.d(e,{y:function(){return l}});var r=n(89909),i=n(14345),s=n(47152),o=n(78853),a=n(21925),u=n(94653),c=n(75803),l=function(){function t(t){t&&(this._subscribe=t)}return t.prototype.lift=function(e){var n=new t;return n.source=this,n.operator=e,n},t.prototype.subscribe=function(t,e,n){var s,o=this,a=(s=t)&&s instanceof r.Lv||s&&(0,u.m)(s.next)&&(0,u.m)(s.error)&&(0,u.m)(s.complete)&&(0,i.Nn)(s)?t:new r.Hp(t,e,n);return(0,c.x)(function(){var t=o.operator,e=o.source;a.add(t?t.call(a,e):e?o._subscribe(a):o._trySubscribe(a))}),a},t.prototype._trySubscribe=function(t){try{return this._subscribe(t)}catch(e){t.error(e)}},t.prototype.forEach=function(t,e){var n=this;return new(e=d(e))(function(e,i){var s=new r.Hp({next:function(e){try{t(e)}catch(t){i(t),s.unsubscribe()}},error:i,complete:e});n.subscribe(s)})},t.prototype._subscribe=function(t){var e;return null===(e=this.source)||void 0===e?void 0:e.subscribe(t)},t.prototype[s.L]=function(){return this},t.prototype.pipe=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return(0,o.U)(t)(this)},t.prototype.toPromise=function(t){var e=this;return new(t=d(t))(function(t,n){var r;e.subscribe(function(t){return r=t},function(t){return n(t)},function(){return t(r)})})},t.create=function(e){return new t(e)},t}();function d(t){var e;return null!==(e=null!=t?t:a.v.Promise)&&void 0!==e?e:Promise}},10947:function(t,e,n){n.d(e,{t:function(){return o}});var r=n(96164),i=n(49779),s=n(82858),o=function(t){function e(e,n,r){void 0===e&&(e=1/0),void 0===n&&(n=1/0),void 0===r&&(r=s.l);var i=t.call(this)||this;return i._bufferSize=e,i._windowTime=n,i._timestampProvider=r,i._buffer=[],i._infiniteTimeWindow=!0,i._infiniteTimeWindow=n===1/0,i._bufferSize=Math.max(1,e),i._windowTime=Math.max(1,n),i}return(0,r.ZT)(e,t),e.prototype.next=function(e){var n=this.isStopped,r=this._buffer,i=this._infiniteTimeWindow,s=this._timestampProvider,o=this._windowTime;!n&&(r.push(e),i||r.push(s.now()+o)),this._trimBuffer(),t.prototype.next.call(this,e)},e.prototype._subscribe=function(t){this._throwIfClosed(),this._trimBuffer();for(var e=this._innerSubscribe(t),n=this._infiniteTimeWindow,r=this._buffer.slice(),i=0;i<r.length&&!t.closed;i+=n?1:2)t.next(r[i]);return this._checkFinalizedStatuses(t),e},e.prototype._trimBuffer=function(){var t=this._bufferSize,e=this._timestampProvider,n=this._buffer,r=this._infiniteTimeWindow,i=(r?1:2)*t;if(t<1/0&&i<n.length&&n.splice(0,n.length-i),!r){for(var s=e.now(),o=0,a=1;a<n.length&&n[a]<=s;a+=2)o=a;o&&n.splice(0,o+1)}},e}(i.x)},49779:function(t,e,n){n.d(e,{x:function(){return c}});var r=n(96164),i=n(43026),s=n(14345),o=(0,n(21048).d)(function(t){return function(){t(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"}}),a=n(71856),u=n(75803),c=function(t){function e(){var e=t.call(this)||this;return e.closed=!1,e.currentObservers=null,e.observers=[],e.isStopped=!1,e.hasError=!1,e.thrownError=null,e}return(0,r.ZT)(e,t),e.prototype.lift=function(t){var e=new l(this,this);return e.operator=t,e},e.prototype._throwIfClosed=function(){if(this.closed)throw new o},e.prototype.next=function(t){var e=this;(0,u.x)(function(){var n,i;if(e._throwIfClosed(),!e.isStopped){e.currentObservers||(e.currentObservers=Array.from(e.observers));try{for(var s=(0,r.XA)(e.currentObservers),o=s.next();!o.done;o=s.next())o.value.next(t)}catch(t){n={error:t}}finally{try{o&&!o.done&&(i=s.return)&&i.call(s)}finally{if(n)throw n.error}}}})},e.prototype.error=function(t){var e=this;(0,u.x)(function(){if(e._throwIfClosed(),!e.isStopped){e.hasError=e.isStopped=!0,e.thrownError=t;for(var n=e.observers;n.length;)n.shift().error(t)}})},e.prototype.complete=function(){var t=this;(0,u.x)(function(){if(t._throwIfClosed(),!t.isStopped){t.isStopped=!0;for(var e=t.observers;e.length;)e.shift().complete()}})},e.prototype.unsubscribe=function(){this.isStopped=this.closed=!0,this.observers=this.currentObservers=null},Object.defineProperty(e.prototype,"observed",{get:function(){var t;return(null===(t=this.observers)||void 0===t?void 0:t.length)>0}
1,enumerable:!1,configurable:!0}),e.prototype._trySubscribe=function(e){return this._throwIfClosed(),t.prototype._trySubscribe.call(this,e)},e.prototype._subscribe=function(t){return this._throwIfClosed(),this._checkFinalizedStatuses(t),this._innerSubscribe(t)},e.prototype._innerSubscribe=function(t){var e=this,n=this.hasError,r=this.isStopped,i=this.observers;return n||r?s.Lc:(this.currentObservers=null,i.push(t),new s.w0(function(){e.currentObservers=null,(0,a.P)(i,t)}))},e.prototype._checkFinalizedStatuses=function(t){var e=this.hasError,n=this.thrownError,r=this.isStopped;e?t.error(n):r&&t.complete()},e.prototype.asObservable=function(){var t=new i.y;return t.source=this,t},e.create=function(t,e){return new l(t,e)},e}(i.y),l=function(t){function e(e,n){var r=t.call(this)||this;return r.destination=e,r.source=n,r}return(0,r.ZT)(e,t),e.prototype.next=function(t){var e,n;null===(n=null===(e=this.destination)||void 0===e?void 0:e.next)||void 0===n||n.call(e,t)},e.prototype.error=function(t){var e,n;null===(n=null===(e=this.destination)||void 0===e?void 0:e.error)||void 0===n||n.call(e,t)},e.prototype.complete=function(){var t,e;null===(e=null===(t=this.destination)||void 0===t?void 0:t.complete)||void 0===e||e.call(t)},e.prototype._subscribe=function(t){var e,n;return null!==(n=null===(e=this.source)||void 0===e?void 0:e.subscribe(t))&&void 0!==n?n:s.Lc},e}(c)},89909:function(t,e,n){n.d(e,{Hp:function(){return m},Lv:function(){return h}});var r=n(96164),i=n(94653),s=n(14345),o=n(21925),a=n(93990),u=n(22786),c=l("C",void 0,void 0);function l(t,e,n){return{kind:t,value:e,error:n}}var d=n(13192),f=n(75803),h=function(t){function e(e){var n=t.call(this)||this;return n.isStopped=!1,e?(n.destination=e,(0,s.Nn)(e)&&e.add(n)):n.destination=w,n}return(0,r.ZT)(e,t),e.create=function(t,e,n){return new m(t,e,n)},e.prototype.next=function(t){this.isStopped?b(l("N",t,void 0),this):this._next(t)},e.prototype.error=function(t){this.isStopped?b(l("E",void 0,t),this):(this.isStopped=!0,this._error(t))},e.prototype.complete=function(){this.isStopped?b(c,this):(this.isStopped=!0,this._complete())},e.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,t.prototype.unsubscribe.call(this),this.destination=null)},e.prototype._next=function(t){this.destination.next(t)},e.prototype._error=function(t){try{this.destination.error(t)}finally{this.unsubscribe()}},e.prototype._complete=function(){try{this.destination.complete()}finally{this.unsubscribe()}},e}(s.w0),p=Function.prototype.bind;function y(t,e){return p.call(t,e)}var g=function(){function t(t){this.partialObserver=t}return t.prototype.next=function(t){var e=this.partialObserver;if(e.next)try{e.next(t)}catch(t){v(t)}},t.prototype.error=function(t){var e=this.partialObserver;if(e.error)try{e.error(t)}catch(t){v(t)}else v(t)},t.prototype.complete=function(){var t=this.partialObserver;if(t.complete)try{t.complete()}catch(t){v(t)}},t}(),m=function(t){function e(e,n,r){var s,a,u=t.call(this)||this;return(0,i.m)(e)||!e?s={next:null!=e?e:void 0,error:null!=n?n:void 0,complete:null!=r?r:void 0}:u&&o.v.useDeprecatedNextContext?((a=Object.create(e)).unsubscribe=function(){return u.unsubscribe()},s={next:e.next&&y(e.next,a),error:e.error&&y(e.error,a),complete:e.complete&&y(e.complete,a)}):s=e,u.destination=new g(s),u}return(0,r.ZT)(e,t),e}(h);function v(t){o.v.useDeprecatedSynchronousErrorHandling?(0,f.O)(t):(0,a.h)(t)}function b(t,e){var n=o.v.onStoppedNotification;n&&d.z.setTimeout(function(){return n(t,e)})}var w={closed:!0,next:u.Z,error:function(t){throw t},complete:u.Z}},14345:function(t,e,n){n.d(e,{Lc:function(){return u},w0:function(){return a},Nn:function(){return c}});var r=n(96164),i=n(94653),s=(0,n(21048).d)(function(t){return function(e){t(this),this.message=e?e.length+" errors occurred during unsubscription:\n"+e.map(function(t,e){return e+1+") "+t.toString()}).join("\n  "):"",this.name="UnsubscriptionError",this.errors=e}}),o=n(71856),a=function(){var t;function e(t){this.initialTeardown=t,this.closed=!1,this._parentage=null,this._finalizers=null}return e.prototype.unsubscribe=function(){if(!this.closed){this.closed=!0;var t,e,n,o,a,u=this._parentage;if(u){if(this._parentage=null,Array.isArray(u))try{for(var c=(0,r.XA)(u),d=c.next();!d.done;d=c.next())d.value.remove(this)}catch(e){t={error:e}}finally{try{d&&!d.done&&(e=c.return)&&e.call(c)}finally{if(t)throw t.error}}else u.remove(this)}var f=this.initialTeardown;
1if((0,i.m)(f))try{f()}catch(t){a=t instanceof s?t.errors:[t]}var h=this._finalizers;if(h){this._finalizers=null;try{for(var p=(0,r.XA)(h),y=p.next();!y.done;y=p.next()){var g=y.value;try{l(g)}catch(t){a=null!=a?a:[],t instanceof s?a=(0,r.ev)((0,r.ev)([],(0,r.CR)(a)),(0,r.CR)(t.errors)):a.push(t)}}}catch(t){n={error:t}}finally{try{y&&!y.done&&(o=p.return)&&o.call(p)}finally{if(n)throw n.error}}}if(a)throw new s(a)}},e.prototype.add=function(t){var n;if(t&&t!==this){if(this.closed)l(t);else{if(t instanceof e){if(t.closed||t._hasParent(this))return;t._addParent(this)}(this._finalizers=null!==(n=this._finalizers)&&void 0!==n?n:[]).push(t)}}},e.prototype._hasParent=function(t){var e=this._parentage;return e===t||Array.isArray(e)&&e.includes(t)},e.prototype._addParent=function(t){var e=this._parentage;this._parentage=Array.isArray(e)?(e.push(t),e):e?[e,t]:t},e.prototype._removeParent=function(t){var e=this._parentage;e===t?this._parentage=null:Array.isArray(e)&&(0,o.P)(e,t)},e.prototype.remove=function(t){var n=this._finalizers;n&&(0,o.P)(n,t),t instanceof e&&t._removeParent(this)},e.EMPTY=((t=new e).closed=!0,t),e}(),u=a.EMPTY;function c(t){return t instanceof a||t&&"closed"in t&&(0,i.m)(t.remove)&&(0,i.m)(t.add)&&(0,i.m)(t.unsubscribe)}function l(t){(0,i.m)(t)?t():t.unsubscribe()}},21925:function(t,e,n){n.d(e,{v:function(){return r}});var r={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1}},5741:function(t,e,n){n.d(e,{z:function(){return s}});var r=n(10059),i=n(89909);function s(t,e){var n="object"==typeof e;return new Promise(function(s,o){var a=new i.Hp({next:function(t){s(t),a.unsubscribe()},error:o,complete:function(){n?s(e.defaultValue):o(new r.K)}});t.subscribe(a)})}},68781:function(t,e,n){n.d(e,{n:function(){return i}});var r=n(10059);function i(t,e){var n="object"==typeof e;return new Promise(function(i,s){var o,a=!1;t.subscribe({next:function(t){o=t,a=!0},error:s,complete:function(){a?i(o):n?i(e.defaultValue):s(new r.K)}})})}},22573:function(t,e,n){n.d(e,{a:function(){return f},l:function(){return h}});var r=n(43026),i=n(82174),s=n(44114),o=n(35911),a=n(99004),u=n(19327),c=n(87475),l=n(24311),d=n(44691);function f(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=(0,u.yG)(t),l=(0,u.jO)(t),d=(0,i.D)(t),f=d.args,p=d.keys;if(0===f.length)return(0,s.D)([],n);var y=new r.y(h(f,n,p?function(t){return(0,c.n)(p,t)}:o.y));return l?y.pipe((0,a.Z)(l)):y}function h(t,e,n){return void 0===n&&(n=o.y),function(r){p(e,function(){for(var i=t.length,o=Array(i),a=i,u=i,c=function(i){p(e,function(){var c=(0,s.D)(t[i],e),d=!1;c.subscribe((0,l.x)(r,function(t){o[i]=t,!d&&(d=!0,u--),u||r.next(n(o.slice()))},function(){--a||r.complete()}))},r)},d=0;d<i;d++)c(d)},r)}}function p(t,e,n){t?(0,d.f)(n,t,e):e()}},17091:function(t,e,n){n.d(e,{z:function(){return o}});var r=n(77875),i=n(19327),s=n(44114);function o(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return(0,r.u)()((0,s.D)(t,(0,i.yG)(t)))}},31940:function(t,e,n){n.d(e,{P:function(){return s}});var r=n(43026),i=n(96266);function s(t){return new r.y(function(e){(0,i.Xf)(t()).subscribe(e)})}},41748:function(t,e,n){n.d(e,{E:function(){return r}});var r=new(n(43026)).y(function(t){return t.complete()})},44114:function(t,e,n){n.d(e,{D:function(){return s}});var r=n(97481),i=n(96266);function s(t,e){return e?(0,r.x)(t,e):(0,i.Xf)(t)}},34748:function(t,e,n){n.d(e,{R:function(){return function t(e,n,p,y){if((0,u.m)(p)&&(y=p,p=void 0),y)return t(e,n,p).pipe((0,c.Z)(y));var g=(0,r.CR)((0,u.m)(e.addEventListener)&&(0,u.m)(e.removeEventListener)?d.map(function(t){return function(r){return e[t](n,r,p)}}):(0,u.m)(e.addListener)&&(0,u.m)(e.removeListener)?l.map(h(e,n)):(0,u.m)(e.on)&&(0,u.m)(e.off)?f.map(h(e,n)):[],2),m=g[0],v=g[1];if(!m&&(0,a.z)(e))return(0,o.z)(function(e){return t(e,n,p)})((0,i.Xf)(e));if(!m)throw TypeError("Invalid event target");return new s.y(function(t){var e=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return t.next(1<e.length?e:e[0])};return m(e),function(){return v(e)}})}}});var r=n(96164),i=n(96266),s=n(43026),o=n(60749),a=n(37374),u=n(94653),c=n(99004),l=["addListener","removeListener"],d=["addEventListener","removeEventListener"],f=["on","off"];function h(t,e){return function(n){return function(r){return t[n](e,r)}}}},96266:function(t,e,n){n.d(e,{Xf:function(){return y}});var r=n(96164),i=n(37374),s=n(51587),o=n(43026),a=n(85825),u=n(8664),c=n(73258),l=n(13114),d=n(85178),f=n(94653),h=n(93990),p=n(47152);function y(t){if(t instanceof o.y)return t;if(null!=t){if((0,a.c)(t))return new o.y(function(e){var n=t[p.L]();if((0,f.m)(n.subscribe))return n.subscribe(e);throw TypeError("Provided object does not correctly implement Symbol.observable")});if((0,i.z)(t))return new o.y(function(e){for(var n=0;n<t.length&&!e.closed;n++)e.next(t[n]);e.complete()});if((0,s.t)(t))return new o.y(function(e){t.then(function(t){e.closed||(e.next(t),e.complete())},function(t){return e.error(t)}).then(null,h.h)});if((0,u.D)(t))return g(t);if((0,l.T)(t))return new o.y(function(e){var n,i;try{for(var s=(0,r.XA)(t),o=s.next();!o.done;o=s.next()){var a=o.value;if(e.next(a),e.closed)return}}catch(t){n={error:t}}finally{try{o&&!o.done&&(i=s.return)&&i.call(s)}finally{if(n)throw n.error}}e.complete()});if((0,d.L)(t))return g((0,d.Q)(t))}throw(0,c.z)(t)}function g(t){return new o.y(function(e){(function(t,e){var n,i,s,o;return(0,r.mG)(this,void 0,void 0,function(){var a;return(0,r.Jh)(this,function(u){switch(u.label){case 0:u.trys.push([0,5,6,11]),n=(0,r.KL)(t),u.label=1;case 1:return[4,n.next()];case 2:if((i=u.sent()).done)return[3,4];if(a=i.value,e.next(a),e.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=n.return)))return[3,8];return[4,o.call(n)];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 e.complete(),[2]}})})})(t,e).catch(function(t){return e.error(t)})})}},14973:function(t,e,n){n.d(e,{T:function(){return u}});var r=n(85064),i=n(96266),s=n(41748),o=n(19327),a=n(44114);function u(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=(0,o.yG)(t),u=(0,o._6)(t,1/0);return t.length?1===t.length?(0,i.Xf)(t[0]):(0,r.J)(u)((0,a.D)(t,n)):s.E}},11735:function(t,e,n){n.d(e,{of:function(){return s}});var r=n(19327),i=n(44114);function s(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=(0,r.yG)(t);return(0,i.D)(t,n)}},66192:function(t,e,n){n.d(e,{_:function(){return s}});var r=n(43026),i=n(94653);function s(t,e){var n=(0,i.m)(t)?t:function(){return t},s=function(t){return t.error(n())};return new r.y(e?function(t){return e.schedule(s,0,t)}:s)}},48937:function(t,e,n){n.d(e,{H:function(){return a}});var r=n(43026),i=n(86157),s=n(35510),o=n(34935);function a(t,e,n){void 0===t&&(t=0),void 0===n&&(n=i.P);var a=-1;return null!=e&&((0,s.K)(e)?n=e:a=e),new r.y(function(e){var r=(0,o.q)(t)?+t-n.now():t;r<0&&(r=0);var i=0;return n.schedule(function(){e.closed||(e.next(i++),0<=a?this.schedule(void 0,a):e.complete())},r)})}},24311:function(t,e,n){n.d(e,{Q:function(){return s},x:function(){return i}});var r=n(96164);function i(t,e,n,r,i){return new s(t,e,n,r,i)}var s=function(t){function e(e,n,r,i,s,o){var a=t.call(this,e)||this;return a.onFinalize=s,a.shouldUnsubscribe=o,a._next=n?function(t){try{n(t)}catch(t){e.error(t)}}:t.prototype._next,a._error=i?function(t){try{i(t)}catch(t){e.error(t)}finally{this.unsubscribe()}}:t.prototype._error,a._complete=r?function(){try{r()}catch(t){e.error(t)}finally{this.unsubscribe()}}:t.prototype._complete,a}return(0,r.ZT)(e,t),e.prototype.unsubscribe=function(){var e;if(!this.shouldUnsubscribe||this.shouldUnsubscribe()){var n=this.closed;t.prototype.unsubscribe.call(this),n||null===(e=this.onFinalize)||void 0===e||e.call(this)}},e}(n(89909).Lv)},60952:function(t,e,n){n.d(e,{K:function(){return function t(e){return(0,s.e)(function(n,s){var o,a=null,u=!1;a=n.subscribe((0,i.x)(s,void 0,void 0,function(i){o=(0,r.Xf)(e(i,t(e)(n))),a?(a.unsubscribe(),a=null,o.subscribe(s)):u=!0})),u&&(a.unsubscribe(),a=null,o.subscribe(s))})}}});var r=n(96266),i=n(24311),s=n(78717)},77875:function(t,e,n){n.d(e,{u:function(){return i}});var r=n(85064);function i(){return(0,r.J)(1)}},74592:function(t,e,n){n.d(e,{b:function(){return s}});var r=n(60749),i=n(94653);function s(t,e){return(0,i.m)(e)?(0,r.z)(t,e,1):(0,r.z)(t,1)}},22631:function(t,e,n){n.d(e,{h:function(){return s}});var r=n(78717),i=n(24311);function s(t,e){return(0,r.e)(function(n,r){var s=0;n.subscribe((0,i.x)(r,function(n){return t.call(e,n,s++)&&r.next(n)}))})}},32023:function(t,e,n){n.d(e,{x:function(){return i}});var r=n(78717);function i(t){return(0,r.e)(function(e,n){try{e.subscribe(n)}finally{n.add(t)}})}},26112:function(t,e,n){n.d(e,{U:function(){return s}});var r=n(78717),i=n(24311);function s(t,e){return(0,r.e)(function(n,r){var s=0;n.subscribe((0,i.x)(r,function(n){r.next(t.call(e,n,s++))}))})}},85064:function(t,e,n){n.d(e,{J:function(){return s}});var r=n(60749),i=n(35911);function s(t){return void 0===t&&(t=1/0),(0,r.z)(i.y,t)}},35456:function(t,e,n){n.d(e,{p:function(){return o}});var r=n(96266),i=n(44691),s=n(24311);function o(t,e,n,o,a,u,c,l){var d=[],f=0,h=0,p=!1,y=function(){!p||d.length||f||e.complete()},g=function(t){return f<o?m(t):d.push(t)},m=function(t){u&&e.next(t),f++;var l=!1;(0,r.Xf)(n(t,h++)).subscribe((0,s.x)(e,function(t){null==a||a(t),u?g(t):e.next(t)},function(){l=!0},void 0,function(){if(l)try{for(f--;d.length&&f<o;)!function(){var t=d.shift();c?(0,i.f)(e,c,function(){return m(t)}):m(t)}();y()}catch(t){e.error(t)}}))};return t.subscribe((0,s.x)(e,g,function(){p=!0,y()})),function(){null==l||l()}}},60749:function(t,e,n){n.d(e,{z:function(){return function t(e,n,u){return(void 0===u&&(u=1/0),(0,a.m)(n))?t(function(t,s){return(0,r.U)(function(e,r){return n(t,e,s,r)})((0,i.Xf)(e(t,s)))},u):("number"==typeof n&&(u=n),(0,s.e)(function(t,n){return(0,o.p)(t,n,e,u)}))}}});var r=n(26112),i=n(96266),s=n(78717),o=n(35456),a=n(94653)},18176:function(t,e,n){n.d(e,{Q:function(){return o}});var r=n(44691),i=n(78717),s=n(24311);function o(t,e){return void 0===e&&(e=0),(0,i.e)(function(n,i){n.subscribe((0,s.x)(i,function(n){return(0,r.f)(i,t,function(){return i.next(n)},e)},function(){return(0,r.f)(i,t,function(){return i.complete()},e)},function(n){return(0,r.f)(i,t,function(){return i.error(n)},e)}))})}},97414:function(t,e,n){n.d(e,{B:function(){return u}});var r=n(96164),i=n(96266),s=n(49779),o=n(89909),a=n(78717);function u(t){void 0===t&&(t={});var e=t.connector,n=void 0===e?function(){return new s.x}:e,r=t.resetOnError,u=void 0===r||r,l=t.resetOnComplete,d=void 0===l||l,f=t.resetOnRefCountZero,h=void 0===f||f;return function(t){var e,r,s,l=0,f=!1,p=!1,y=function(){null==r||r.unsubscribe(),r=void 0},g=function(){y(),e=s=void 0,f=p=!1},m=function(){var t=e;g(),null==t||t.unsubscribe()};return(0,a.e)(function(t,a){l++,p||f||y();var v=s=null!=s?s:n();a.add(function(){0!=--l||p||f||(r=c(m,h))}),v.subscribe(a),!e&&l>0&&(e=new o.Hp({next:function(t){return v.next(t)},error:function(t){p=!0,y(),r=c(g,u,t),v.error(t)},complete:function(){f=!0,y(),r=c(g,d),v.complete()}}),(0,i.Xf)(t).subscribe(e))})(t)}}function c(t,e){for(var n=[],s=2;s<arguments.length;s++)n[s-2]=arguments[s];if(!0===e){t();return}if(!1!==e){var a=new o.Hp({next:function(){a.unsubscribe(),t()}});return(0,i.Xf)(e.apply(void 0,(0,r.ev)([],(0,r.CR)(n)))).subscribe(a)}}},90660:function(t,e,n){n.d(e,{d:function(){return s}});var r=n(10947),i=n(97414);function s(t,e,n){var s,o,a,u,c=!1;return t&&"object"==typeof t?(u=void 0===(s=t.bufferSize)?1/0:s,e=void 0===(o=t.windowTime)?1/0:o,c=void 0!==(a=t.refCount)&&a,n=t.scheduler):u=null!=t?t:1/0,(0,i.B)({connector:function(){return new r.t(u,e,n)},resetOnError:!0,resetOnComplete:!1,resetOnRefCountZero:c})}},2861:function(t,e,n){n.d(e,{q:function(){return o}});var r=n(41748),i=n(78717),s=n(24311);function o(t){return t<=0?function(){return r.E}:(0,i.e)(function(e,n){var r=0;e.subscribe((0,s.x)(n,function(e){++r<=t&&(n.next(e),t<=r&&n.complete())}))})}},73265:function(t,e,n){n.d(e,{R:function(){return a}});var r=n(78717),i=n(24311),s=n(96266),o=n(22786);function a(t){return(0,r.e)(function(e,n){(0,s.Xf)(t).subscribe((0,i.x)(n,function(){return n.complete()},o.Z)),n.closed||e.subscribe(n)})}},38360:function(t,e,n){n.d(e,{b:function(){return a}});var r=n(94653),i=n(78717),s=n(24311),o=n(35911);function a(t,e,n){var a=(0,r.m)(t)||e||n?{next:t,error:e,complete:n}:t;return a?(0,i.e)(function(t,e){null===(n=a.subscribe)||void 0===n||n.call(a);var n,r=!0;t.subscribe((0,s.x)(e,function(t){var n;null===(n=a.next)||void 0===n||n.call(a,t),e.next(t)},function(){var t;r=!1,null===(t=a.complete)||void 0===t||t.call(a),e.complete()},function(t){var n;r=!1,null===(n=a.error)||void 0===n||n.call(a,t),e.error(t)},function(){var t,e;r&&(null===(t=a.unsubscribe)||void 0===t||t.call(a)),null===(e=a.finalize)||void 0===e||e.call(a)}))}):o.y}},97481:function(t,e,n){n.d(e,{x:function(){return b}});var r=n(96266),i=n(18176),s=n(78717);function o(t,e){return void 0===e&&(e=0),(0,s.e)(function(n,r){r.add(t.schedule(function(){return n.subscribe(r)},e))})}var a=n(43026),u=n(79979),c=n(94653),l=n(44691);function d(t,e){if(!t)throw Error("Iterable cannot be null");return new a.y(function(n){(0,l.f)(n,e,function(){var r=t[Symbol.asyncIterator]();(0,l.f)(n,e,function(){r.next().then(function(t){t.done?n.complete():n.next(t.value)})},0,!0)})})}
1var f=n(85825),h=n(51587),p=n(37374),y=n(13114),g=n(8664),m=n(73258),v=n(85178);function b(t,e){if(null!=t){if((0,f.c)(t))return(0,r.Xf)(t).pipe(o(e),(0,i.Q)(e));if((0,p.z)(t))return new a.y(function(n){var r=0;return e.schedule(function(){r===t.length?n.complete():(n.next(t[r++]),n.closed||this.schedule())})});if((0,h.t)(t))return(0,r.Xf)(t).pipe(o(e),(0,i.Q)(e));if((0,g.D)(t))return d(t,e);if((0,y.T)(t))return new a.y(function(n){var r;return(0,l.f)(n,e,function(){r=t[u.h](),(0,l.f)(n,e,function(){var t,e,i;try{e=(t=r.next()).value,i=t.done}catch(t){n.error(t);return}i?n.complete():n.next(e)},0,!0)}),function(){return(0,c.m)(null==r?void 0:r.return)&&r.return()}});if((0,v.L)(t))return d((0,v.Q)(t),e)}throw(0,m.z)(t)}},84358:function(t,e,n){n.d(e,{o:function(){return a}});var r=n(96164),i=function(t){function e(e,n){return t.call(this)||this}return(0,r.ZT)(e,t),e.prototype.schedule=function(t,e){return void 0===e&&(e=0),this},e}(n(14345).w0),s={setInterval:function(t,e){for(var n=[],i=2;i<arguments.length;i++)n[i-2]=arguments[i];var o=s.delegate;return(null==o?void 0:o.setInterval)?o.setInterval.apply(o,(0,r.ev)([t,e],(0,r.CR)(n))):setInterval.apply(void 0,(0,r.ev)([t,e],(0,r.CR)(n)))},clearInterval:function(t){var e=s.delegate;return((null==e?void 0:e.clearInterval)||clearInterval)(t)},delegate:void 0},o=n(71856),a=function(t){function e(e,n){var r=t.call(this,e,n)||this;return r.scheduler=e,r.work=n,r.pending=!1,r}return(0,r.ZT)(e,t),e.prototype.schedule=function(t,e){if(void 0===e&&(e=0),this.closed)return this;this.state=t;var n,r=this.id,i=this.scheduler;return null!=r&&(this.id=this.recycleAsyncId(i,r,e)),this.pending=!0,this.delay=e,this.id=null!==(n=this.id)&&void 0!==n?n:this.requestAsyncId(i,this.id,e),this},e.prototype.requestAsyncId=function(t,e,n){return void 0===n&&(n=0),s.setInterval(t.flush.bind(t,this),n)},e.prototype.recycleAsyncId=function(t,e,n){if(void 0===n&&(n=0),null!=n&&this.delay===n&&!1===this.pending)return e;null!=e&&s.clearInterval(e)},e.prototype.execute=function(t,e){if(this.closed)return Error("executing a cancelled action");this.pending=!1;var n=this._execute(t,e);if(n)return n;!1===this.pending&&null!=this.id&&(this.id=this.recycleAsyncId(this.scheduler,this.id,null))},e.prototype._execute=function(t,e){var n,r=!1;try{this.work(t)}catch(t){r=!0,n=t||Error("Scheduled action threw falsy error")}if(r)return this.unsubscribe(),n},e.prototype.unsubscribe=function(){if(!this.closed){var e=this.id,n=this.scheduler,r=n.actions;this.work=this.state=this.scheduler=null,this.pending=!1,(0,o.P)(r,this),null!=e&&(this.id=this.recycleAsyncId(n,e,null)),this.delay=null,t.prototype.unsubscribe.call(this)}},e}(i)},90409:function(t,e,n){n.d(e,{v:function(){return o}});var r=n(96164),i=n(82858),s=function(){function t(e,n){void 0===n&&(n=t.now),this.schedulerActionCtor=e,this.now=n}return t.prototype.schedule=function(t,e,n){return void 0===e&&(e=0),new this.schedulerActionCtor(this,t).schedule(n,e)},t.now=i.l.now,t}(),o=function(t){function e(e,n){void 0===n&&(n=s.now);var r=t.call(this,e,n)||this;return r.actions=[],r._active=!1,r}return(0,r.ZT)(e,t),e.prototype.flush=function(t){var e,n=this.actions;if(this._active){n.push(t);return}this._active=!0;do if(e=t.execute(t.state,t.delay))break;while(t=n.shift());if(this._active=!1,e){for(;t=n.shift();)t.unsubscribe();throw e}},e}(s)},86157:function(t,e,n){n.d(e,{P:function(){return s},z:function(){return i}});var r=n(84358),i=new(n(90409)).v(r.o),s=i},82858:function(t,e,n){n.d(e,{l:function(){return r}});var r={now:function(){return(r.delegate||Date).now()},delegate:void 0}},13192:function(t,e,n){n.d(e,{z:function(){return i}});var r=n(96164),i={setTimeout:function(t,e){for(var n=[],s=2;s<arguments.length;s++)n[s-2]=arguments[s];var o=i.delegate;return(null==o?void 0:o.setTimeout)?o.setTimeout.apply(o,(0,r.ev)([t,e],(0,r.CR)(n))):setTimeout.apply(void 0,(0,r.ev)([t,e],(0,r.CR)(n)))},clearTimeout:function(t){var e=i.delegate;return((null==e?void 0:e.clearTimeout)||clearTimeout)(t)},delegate:void 0}},79979:function(t,e,n){n.d(e,{h:function(){return r}});var r="function"==typeof Symbol&&Symbol.iterator?Symbol.iterator:"@@iterator"},47152:function(t,e,n){n.d(e,{L:function(){return r}});var r="function"==typeof Symbol&&Symbol.observable||"@@observable"},10059:function(t,e,n){n.d(e,{K:function(){return r}});var r=(0,n(21048).d)(function(t){return function(){t(this),this.name="EmptyError",this.message="no elements in sequence"}})},19327:function(t,e,n){n.d(e,{_6:function(){return u},jO:function(){return o},yG:function(){return a}});var r=n(94653),i=n(35510);function s(t){return t[t.length-1]}function o(t){return(0,r.m)(s(t))?t.pop():void 0}function a(t){return(0,i.K)(s(t))?t.pop():void 0}function u(t,e){return"number"==typeof s(t)?t.pop():e}},82174:function(t,e,n){n.d(e,{D:function(){return a}});var r=Array.isArray,i=Object.getPrototypeOf,s=Object.prototype,o=Object.keys;function a(t){if(1===t.length){var e=t[0];if(r(e))return{args:e,keys:null};if(e&&"object"==typeof e&&i(e)===s){var n=o(e);return{args:n.map(function(t){return e[t]}),keys:n}}}return{args:t,keys:null}}},10428:function(t,e,n){n.d(e,{k:function(){return i}});var r=Array.isArray;function i(t){return 1===t.length&&r(t[0])?t[0]:t}},71856:function(t,e,n){n.d(e,{P:function(){return r}});function r(t,e){if(t){var n=t.indexOf(e);0<=n&&t.splice(n,1)}}},21048:function(t,e,n){n.d(e,{d:function(){return r}});function r(t){var e=t(function(t){Error.call(t),t.stack=Error().stack});return e.prototype=Object.create(Error.prototype),e.prototype.constructor=e,e}},87475:function(t,e,n){n.d(e,{n:function(){return r}});function r(t,e){return t.reduce(function(t,n,r){return t[n]=e[r],t},{})}},75803:function(t,e,n){n.d(e,{O:function(){return o},x:function(){return s}});var r=n(21925),i=null;function s(t){if(r.v.useDeprecatedSynchronousErrorHandling){var e=!i;if(e&&(i={errorThrown:!1,error:null}),t(),e){var n=i,s=n.errorThrown,o=n.error;if(i=null,s)throw o}}else t()}function o(t){r.v.useDeprecatedSynchronousErrorHandling&&i&&(i.errorThrown=!0,i.error=t)}},44691:function(t,e,n){n.d(e,{f:function(){return r}});function r(t,e,n,r,i){void 0===r&&(r=0),void 0===i&&(i=!1);var s=e.schedule(function(){n(),i?t.add(this.schedule(null,r)):this.unsubscribe()},r);if(t.add(s),!i)return s}},35911:function(t,e,n){n.d(e,{y:function(){return r}});function r(t){return t}},37374:function(t,e,n){n.d(e,{z:function(){return r}});var r=function(t){return t&&"number"==typeof t.length&&"function"!=typeof t}},8664:function(t,e,n){n.d(e,{D:function(){return i}});var r=n(94653);function i(t){return Symbol.asyncIterator&&(0,r.m)(null==t?void 0:t[Symbol.asyncIterator])}},34935:function(t,e,n){n.d(e,{q:function(){return r}});function r(t){return t instanceof Date&&!isNaN(t)}},94653:function(t,e,n){n.d(e,{m:function(){return r}});function r(t){return"function"==typeof t}},85825:function(t,e,n){n.d(e,{c:function(){return s}});var r=n(47152),i=n(94653);function s(t){return(0,i.m)(t[r.L])}},13114:function(t,e,n){n.d(e,{T:function(){return s}});var r=n(79979),i=n(94653);function s(t){return(0,i.m)(null==t?void 0:t[r.h])}},651:function(t,e,n){n.d(e,{b:function(){return s}});var r=n(43026),i=n(94653);function s(t){return!!t&&(t instanceof r.y||(0,i.m)(t.lift)&&(0,i.m)(t.subscribe))}},51587:function(t,e,n){n.d(e,{t:function(){return i}});var r=n(94653);function i(t){return(0,r.m)(null==t?void 0:t.then)}},85178:function(t,e,n){n.d(e,{L:function(){return o},Q:function(){return s}});var r=n(96164),i=n(94653);function s(t){return(0,r.FC)(this,arguments,function(){var e,n,i;return(0,r.Jh)(this,function(s){switch(s.label){case 0:e=t.getReader(),s.label=1;case 1:s.trys.push([1,,9,10]),s.label=2;case 2:return[4,(0,r.qq)(e.read())];case 3:if(i=(n=s.sent()).value,!n.done)return[3,5];return[4,(0,r.qq)(void 0)];case 4:return[2,s.sent()];case 5:return[4,(0,r.qq)(i)];case 6:return[4,s.sent()];case 7:return s.sent(),[3,2];case 8:return[3,10];case 9:return e.releaseLock(),[7];case 10:return[2]}})})}function o(t){return(0,i.m)(null==t?void 0:t.getReader)}},35510:function(t,e,n){n.d(e,{K:function(){return i}});var r=n(94653);function i(t){return t&&(0,r.m)(t.schedule)}},78717:function(t,e,n){n.d(e,{A:function(){return i},e:function(){return s}});var r=n(94653);function i(t){return(0,r.m)(null==t?void 0:t.lift)}function s(t){return function(e){if(i(e))return e.lift(function(e){try{return t(e,this)}catch(t){this.error(t)}});throw TypeError("Unable to lift unknown Observable type")}}},99004:function(t,e,n){n.d(e,{Z:function(){return o}});var r=n(96164),i=n(26112),s=Array.isArray;function o(t){return(0,i.U)(function(e){return s(e)?t.apply(void 0,(0,r.ev)([],(0,r.CR)(e))):t(e)}
1)}},22786:function(t,e,n){n.d(e,{Z:function(){return r}});function r(){}},78853:function(t,e,n){n.d(e,{U:function(){return s},z:function(){return i}});var r=n(35911);function i(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return s(t)}function s(t){return 0===t.length?r.y:1===t.length?t[0]:function(e){return t.reduce(function(t,e){return e(t)},e)}}},93990:function(t,e,n){n.d(e,{h:function(){return s}});var r=n(21925),i=n(13192);function s(t){i.z.setTimeout(function(){var e=r.v.onUnhandledError;if(e)e(t);else throw t})}},73258:function(t,e,n){n.d(e,{z:function(){return r}});function r(t){return TypeError("You provided "+(null!==t&&"object"==typeof t?"an invalid object":"'"+t+"'")+" where a stream was expected. You can provide an Observable, Promise, ReadableStream, Array, AsyncIterable, or Iterable.")}},41553:function(t,e,n){n.d(e,{E9:function(){return a},Y$:function(){return f},ah:function(){return v},p4:function(){return g},u5:function(){return d}});var r,i,s=n(61987);let o=new WeakMap;function a(t){return{config:t,start:(e,n)=>{let{self:r,system:i,emit:s}=n,a={receivers:void 0,dispose:void 0};o.set(r,a),a.dispose=t({input:e.input,system:i,self:r,sendBack:t=>{"stopped"!==r.getSnapshot().status&&r._parent&&i._relay(r,r._parent,t)},receive:t=>{a.receivers??=new Set,a.receivers.add(t)},emit:s})},transition:(t,e,n)=>{let r=o.get(n.self);return e.type===s.X?(t={...t,status:"stopped",error:void 0},r.dispose?.()):r.receivers?.forEach(t=>t(e)),t},getInitialSnapshot:(t,e)=>({status:"active",output:void 0,error:void 0,input:e}),getPersistedSnapshot:t=>t,restoreSnapshot:t=>t}}let u="xstate.observable.next",c="xstate.observable.error",l="xstate.observable.complete";function d(t){return{config:t,transition:(t,e)=>{if("active"!==t.status)return t;switch(e.type){case u:return{...t,context:e.data};case c:return{...t,status:"error",error:e.data,input:void 0,_subscription:void 0};case l:return{...t,status:"done",input:void 0,_subscription:void 0};case s.X:return t._subscription.unsubscribe(),{...t,status:"stopped",input:void 0,_subscription:void 0};default:return t}},getInitialSnapshot:(t,e)=>({status:"active",output:void 0,error:void 0,context:void 0,input:e,_subscription:void 0}),start:(e,{self:n,system:r,emit:i})=>{"done"!==e.status&&(e._subscription=t({input:e.input,system:r,self:n,emit:i}).subscribe({next:t=>{r._relay(n,n,{type:u,data:t})},error:t=>{r._relay(n,n,{type:c,data:t})},complete:()=>{r._relay(n,n,{type:l})}}))},getPersistedSnapshot:({_subscription:t,...e})=>e,restoreSnapshot:t=>({...t,_subscription:void 0})}}function f(t){return{config:t,transition:(t,e)=>{if("active"!==t.status)return t;switch(e.type){case c:return{...t,status:"error",error:e.data,input:void 0,_subscription:void 0};case l:return{...t,status:"done",input:void 0,_subscription:void 0};case s.X:return t._subscription.unsubscribe(),{...t,status:"stopped",input:void 0,_subscription:void 0};default:return t}},getInitialSnapshot:(t,e)=>({status:"active",output:void 0,error:void 0,context:void 0,input:e,_subscription:void 0}),start:(e,{self:n,system:r,emit:i})=>{"done"!==e.status&&(e._subscription=t({input:e.input,system:r,self:n,emit:i}).subscribe({next:t=>{n._parent&&r._relay(n,n._parent,t)},error:t=>{r._relay(n,n,{type:c,data:t})},complete:()=>{r._relay(n,n,{type:l})}}))},getPersistedSnapshot:({_subscription:t,...e})=>e,restoreSnapshot:t=>({...t,_subscription:void 0})}}let h="xstate.promise.resolve",p="xstate.promise.reject",y=new WeakMap;function g(t){return{config:t,transition:(t,e,n)=>{if("active"!==t.status)return t;switch(e.type){case h:{let n=e.data;return{...t,status:"done",output:n,input:void 0}}case p:return{...t,status:"error",error:e.data,input:void 0};case s.X:return y.get(n.self)?.abort(),{...t,status:"stopped",input:void 0};default:return t}},start:(e,{self:n,system:r,emit:i})=>{if("active"!==e.status)return;let s=new AbortController;y.set(n,s),Promise.resolve(t({input:e.input,system:r,self:n,signal:s.signal,emit:i})).then(t=>{"active"===n.getSnapshot().status&&(y.delete(n),r._relay(n,n,{type:h,data:t}))},t=>{"active"===n.getSnapshot().status&&(y.delete(n),r._relay(n,n,{type:p,data:t}))})},getInitialSnapshot:(t,e)=>({status:"active",output:void 0,error:void 0,input:e}),getPersistedSnapshot:t=>t,restoreSnapshot:t=>t}}let m=(i=void 0,{config:r=t=>void 0,transition:(t,e,n)=>({...t,context:r(t.context,e,n)}),getInitialSnapshot:(t,e)=>({status:"active",output:void 0,error:void 0,context:"function"==typeof i?i({input:e}):i}),getPersistedSnapshot:t=>t,restoreSnapshot:t=>t});function v(){return(0,s.c)(m)}},52499:function(t,e,n){n.d(e,{a:function(){return s}});var r=n(61987);function i(t,e,n,i,{assignment:s}){if(!e.context)throw Error("Cannot assign to undefined `context`. Ensure that `context` is defined in the machine config.");let o={},a={context:e.context,event:n.event,spawn:function(t,{machine:e,context:n},i,s){let o=(o,a)=>
1{if("string"!=typeof o)return(0,r.c)(o,{id:a?.id,parent:t.self,syncSnapshot:a?.syncSnapshot,input:a?.input,src:o,systemId:a?.systemId});{let u=(0,r.T)(e,o);if(!u)throw Error(`Actor logic '${o}' not implemented in machine '${e.id}'`);let c=(0,r.c)(u,{id:a?.id,parent:t.self,syncSnapshot:a?.syncSnapshot,input:"function"==typeof a?.input?a.input({context:n,event:i,self:t.self}):a?.input,src:o,systemId:a?.systemId});return s[c.id]=c,c}};return(e,n)=>{let i=o(e,n);return s[i.id]=i,t.defer(()=>{i._processingStatus!==r.W.Stopped&&i.start()}),i}}(t,e,n.event,o),self:t.self,system:t.system},u={};if("function"==typeof s)u=s(a,i);else for(let t of Object.keys(s)){let e=s[t];u[t]="function"==typeof e?e(a,i):e}let c=Object.assign({},e.context,u);return[(0,r.Y)(e,{context:c,children:Object.keys(o).length?{...e.children,...o}:e.children}),void 0,void 0]}function s(t){function e(t,e){}return e.type="xstate.assign",e.assignment=t,e.resolve=i,e}},17716:function(t,e,n){n.d(e,{a:function(){return u},b:function(){return p},e:function(){return g},l:function(){return b},s:function(){return h}});var r,i=n(61987),s=n(52499);function o(t,e,n,r,{event:i}){return[e,{event:"function"==typeof i?i(n,r):i},void 0]}function a(t,{event:e}){t.defer(()=>t.emit(e))}function u(t){function e(t,e){}return e.type="xstate.emit",e.event=t,e.resolve=o,e.execute=a,e}let c=((r={}).Parent="#_parent",r.Internal="#_internal",r);function l(t,e,n,r,{to:i,event:s,id:o,delay:a},u){let l,d;let f=e.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(n,r):s;if("string"==typeof a){let t=f&&f[a];l="function"==typeof t?t(n,r):t}else l="function"==typeof a?a(n,r):a;let p="function"==typeof i?i(n,r):i;if("string"==typeof p){if(!(d=p===c.Parent?t.self._parent:p===c.Internal?t.self:p.startsWith("#_")?e.children[p.slice(2)]:u.deferredActorIds?.includes(p)?p:e.children[p]))throw Error(`Unable to send event to actor '${p}' from machine '${e.machine.id}'.`)}else d=p||t.self;return[e,{to:d,targetId:"string"==typeof p?p:void 0,event:h,id:o,delay:l},void 0]}function d(t,e,n){"string"==typeof n.to&&(n.to=e.children[n.to])}function f(t,e){t.defer(()=>{let{to:n,event:r,delay:s,id:o}=e;if("number"==typeof s){t.system.scheduler.schedule(t.self,n,r,s,o);return}t.system._relay(t.self,n,r.type===i.U?(0,i.V)(t.self.id,r.data):r)})}function h(t,e,n){function r(t,e){}return r.type="xstate.sendTo",r.to=t,r.event=e,r.id=n?.id,r.delay=n?.delay,r.resolve=l,r.retryResolve=d,r.execute=f,r}function p(t,e){return h(c.Parent,t,e)}function y(t,e,n,r,{collect:o}){let a=[],c=function(t){a.push(t)};return c.assign=(...t)=>{a.push((0,s.a)(...t))},c.cancel=(...t)=>{a.push((0,i.a)(...t))},c.raise=(...t)=>{a.push((0,i.r)(...t))},c.sendTo=(...t)=>{a.push(h(...t))},c.sendParent=(...t)=>{a.push(p(...t))},c.spawnChild=(...t)=>{a.push((0,i.b)(...t))},c.stopChild=(...t)=>{a.push((0,i.s)(...t))},c.emit=(...t)=>{a.push(u(...t))},o({context:n.context,event:n.event,enqueue:c,check:t=>(0,i.x)(t,e.context,n.event,e),self:t.self,system:t.system},r),[e,void 0,a]}function g(t){function e(t,e){}return e.type="xstate.enqueueActions",e.collect=t,e.resolve=y,e}function m(t,e,n,r,{value:i,label:s}){return[e,{value:"function"==typeof i?i(n,r):i,label:s},void 0]}function v({logger:t},{value:e,label:n}){n?t(n,e):t(e)}function b(t=({context:t,event:e})=>({context:t,event:e}),e){function n(t,e){}return n.type="xstate.log",n.value=t,n.label=e,n.resolve=m,n.execute=v,n}},61987:function(t,e,n){var r;n.d(e,{$:function(){return k},B:function(){return tl},C:function(){return to},D:function(){return tT},E:function(){return te},F:function(){return tD},G:function(){return ti},H:function(){return tC},I:function(){return function t(e,n,r,i){return"string"==typeof n?function(t,e,n,r){let i=ty(t,e).next(n,r);return i&&i.length?i:t.next(n,r)}(e,n,r,i):1===Object.keys(n).length?function(e,n,r,i){let s=Object.keys(n),o=t(ty(e,s[0]),n[s[0]],r,i);return o&&o.length?o:e.next(r,i)}(e,n,r,i):function(e,n,r,i){let s=[];for(let o of Object.keys(n)){let a=n[o];if(!a)continue;let u=t(ty(e,o),a,r,i);u&&s.push(...u)}return s.length?s:e.next(r,i)}(e,n,r,i)}},J:function(){return tI},K:function(){return h},L:function(){return tE},M:function(){return tp}
1,N:function(){return a},O:function(){return g},P:function(){return ts},Q:function(){return tg},R:function(){return tM},S:function(){return o},T:function(){return I},U:function(){return c},V:function(){return f},W:function(){return O},X:function(){return l},Y:function(){return tU},a:function(){return M},b:function(){return N},c:function(){return P},d:function(){return G},e:function(){return H},g:function(){return tm},k:function(){return S},m:function(){return C},n:function(){return X},q:function(){return v},r:function(){return tN},s:function(){return B},t:function(){return b},u:function(){return tc},v:function(){return x},w:function(){return tu},x:function(){return Y},y:function(){return q},z:function(){return ta}});let i=t=>{if("undefined"==typeof window)return;let e=function(){let t="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:void 0!==n.g?n.g:void 0;if(t.__xstate__)return t.__xstate__}();e&&e.register(t)};class s{constructor(t){this._process=t,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(t){let e={value:t,next:null};if(this._current){this._last.next=e,this._last=e;return}this._current=e,this._last=e,this._active&&this.flush()}flush(){for(;this._current;){let t=this._current;this._process(t.value),this._current=t.next}this._last=null}}let o=".",a="",u="xstate.init",c="xstate.error",l="xstate.stop";function d(t,e){return{type:`xstate.done.state.${t}`,output:e}}function f(t,e){return{type:`xstate.error.actor.${t}`,error:e,actorId:t}}function h(t){return{type:u,input:t}}function p(t){setTimeout(()=>{throw t})}let y="function"==typeof Symbol&&Symbol.observable||"@@observable";function g(t){if(_(t))return t;let e=[],n="";for(let r=0;r<t.length;r++){switch(t.charCodeAt(r)){case 92:n+=t[r+1],r++;continue;case 46:e.push(n),n="";continue}n+=t[r]}return e.push(n),e}function m(t){return t&&"object"==typeof t&&"machine"in t&&"value"in t?t.value:"string"!=typeof t?t:function(t){if(1===t.length)return t[0];let e={},n=e;for(let e=0;e<t.length-1;e++)if(e===t.length-2)n[t[e]]=t[e+1];else{let r=n;n={},r[t[e]]=n}return e}(g(t))}function v(t,e){let n={},r=Object.keys(t);for(let i=0;i<r.length;i++){let s=r[i];n[s]=e(t[s],s,t,i)}return n}function b(t){return void 0===t?[]:_(t)?t:[t]}function w(t,e,n,r){return"function"==typeof t?t({context:e,event:n,self:r}):t}function _(t){return Array.isArray(t)}function x(t){return(_(t)?t:[t]).map(t=>void 0===t||"string"==typeof t?{target:t}:t)}function E(t){if(void 0!==t&&""!==t)return b(t)}function S(t,e,n){let r="object"==typeof t,i=r?t:void 0;return{next:(r?t.next:t)?.bind(i),error:(r?t.error:e)?.bind(i),complete:(r?t.complete:n)?.bind(i)}}function q(t,e){return`${e}.${t}`}function I(t,e){let n=e.match(/^xstate\.invoke\.(\d+)\.(.*)/);if(!n)return t.implementations.actors[e];let[,r,i]=n,s=t.getStateNodeById(i).config.invoke;return(Array.isArray(s)?s[r]:s).src}function C(t,e){if(e===t||"*"===e)return!0;if(!e.endsWith(".*"))return!1;let n=e.split("."),r=t.split(".");for(let t=0;t<n.length;t++){let e=n[t],i=r[t];if("*"===e)return t===n.length-1;if(e!==i)return!1}return!0}function $(t,e){return`${t.sessionId}.${e}`}let R=0,T=!1,k=1,O=((r={})[r.NotStarted=0]="NotStarted",r[r.Running=1]="Running",r[r.Stopped=2]="Stopped",r),A={clock:{setTimeout:(t,e)=>setTimeout(t,e),clearTimeout:t=>clearTimeout(t)},logger:console.log.bind(console),devTools:!1};
1class j{constructor(t,e){this.logic=t,this._snapshot=void 0,this.clock=void 0,this.options=void 0,this.id=void 0,this.mailbox=new s(this._process.bind(this)),this.observers=new Set,this.eventListeners=new Map,this.logger=void 0,this._processingStatus=O.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 n={...A,...e},{clock:r,logger:i,parent:o,syncSnapshot:a,id:u,systemId:c,inspect:l}=n;this.system=o?o.system:function(t,e){let n=new Map,r=new Map,i=new WeakMap,s=new Set,o={},{clock:a,logger:u}=e,c={schedule:(t,e,n,r,i=Math.random().toString(36).slice(2))=>{let s={source:t,target:e,event:n,delay:r,id:i,startedAt:Date.now()},u=$(t,i);l._snapshot._scheduledEvents[u]=s;let c=a.setTimeout(()=>{delete o[u],delete l._snapshot._scheduledEvents[u],l._relay(t,e,n)},r);o[u]=c},cancel:(t,e)=>{let n=$(t,e),r=o[n];delete o[n],delete l._snapshot._scheduledEvents[n],void 0!==r&&a.clearTimeout(r)},cancelAll:t=>{for(let e in l._snapshot._scheduledEvents){let n=l._snapshot._scheduledEvents[e];n.source===t&&c.cancel(t,n.id)}}},l={_snapshot:{_scheduledEvents:(e?.snapshot&&e.snapshot.scheduler)??{}},_bookId:()=>`x:${R++}`,_register:(t,e)=>(n.set(t,e),t),_unregister:t=>{n.delete(t.sessionId);let e=i.get(t);void 0!==e&&(r.delete(e),i.delete(t))},get:t=>r.get(t),getAll:()=>Object.fromEntries(r.entries()),_set:(t,e)=>{let n=r.get(t);if(n&&n!==e)throw Error(`Actor with system ID '${t}' already exists.`);r.set(t,e),i.set(e,t)},inspect:t=>{let e=S(t);return s.add(e),{unsubscribe(){s.delete(e)}}},_sendInspectionEvent:e=>{if(!s.size)return;let n={...e,rootId:t.sessionId};s.forEach(t=>t.next?.(n))},_relay:(t,e,n)=>{l._sendInspectionEvent({type:"@xstate.event",sourceRef:t,actorRef:e,event:n}),e._send(n)},scheduler:c,getSnapshot:()=>({_scheduledEvents:{...l._snapshot._scheduledEvents}}),start:()=>{let t=l._snapshot._scheduledEvents;for(let e in l._snapshot._scheduledEvents={},t){let{source:n,target:r,event:i,delay:s,id:o}=t[e];c.schedule(n,r,i,s,o)}},_clock:a,_logger:u};return l}(this,{clock:r,logger:i}),l&&!o&&this.system.inspect(S(l)),this.sessionId=this.system._bookId(),this.id=u??this.sessionId,this.logger=e?.logger??this.system._logger,this.clock=e?.clock??this.system._clock,this._parent=o,this._syncSnapshot=a,this.options=n,this.src=n.src??t,this.ref=this,this._actorScope={self:this,id:this.id,sessionId:this.sessionId,logger:this.logger,defer:t=>{this._deferred.push(t)},system:this.system,stopChild:t=>{if(t._parent!==this)throw Error(`Cannot stop child actor ${t.id} of ${this.id} because it is not a child`);t._stop()},emit:t=>{let e=this.eventListeners.get(t.type),n=this.eventListeners.get("*");if(e||n)for(let r of[...e?e.values():[],...n?n.values():[]])try{r(t)}catch(t){p(t)}},actionExecutor:t=>{let e=()=>{if(this._actorScope.system._sendInspectionEvent({type:"@xstate.action",actorRef:this,action:{type:t.type,params:t.params}}),!t.exec)return;let e=T;try{T=!0,t.exec(t.info,t.params)}finally{T=e}};this._processingStatus===O.Running?e():this._deferred.push(e)}},this.send=this.send.bind(this),this.system._sendInspectionEvent({type:"@xstate.actor",actorRef:this}),c&&(this.systemId=c,this.system._set(c,this)),this._initState(e?.snapshot??e?.state),c&&"active"!==this._snapshot.status&&this.system._unregister(this)}_initState(t){try{this._snapshot=t?this.logic.restoreSnapshot?this.logic.restoreSnapshot(t,this._actorScope):t:this.logic.getInitialSnapshot(this._actorScope,this.options?.input)}catch(t){this._snapshot={status:"error",output:void 0,error:t}}}update(t,e){let n;for(this._snapshot=t;n=this._deferred.shift();)try{n()}catch(e){this._deferred.length=0,this._snapshot={...t,status:"error",error:e}}switch(this._snapshot.status){case"active":for(let e of this.observers)try{e.next?.(t)}catch(t){p(t)}break;case"done":var r;for(let e of this.observers)try{e.next?.(t)}catch(t){p(t)}this._stopProcedure(),this._complete(),this._doneEvent=(r=this.id,{type:`xstate.done.actor.${r}`,output:this._snapshot.output,actorId:r}),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:e,snapshot:t})}subscribe(t,e,n){let r=S(t,e,n);if(this._processingStatus!==O.Stopped)this.observers.add(r);else switch(this._snapshot.status){case"done":try{r.complete?.()}catch(t){p(t)}break;case"error":{let t=this._snapshot.error;if(r.error)try{r.error(t)}catch(t){p(t)}else p(t)}}return{unsubscribe:()=>{this.observers.delete(r)}}}on(t,e){let n=this.eventListeners.get(t);n||(n=new Set,this.eventListeners.set(t,n));let r=e.bind(void 0);return n.add(r),{unsubscribe:()=>{n.delete(r)}}}
1start(){if(this._processingStatus===O.Running)return this;this._syncSnapshot&&this.subscribe({next:t=>{"active"===t.status&&this.system._relay(this,this._parent,{type:`xstate.snapshot.${this.id}`,snapshot:t})},error:()=>{}}),this.system._register(this.sessionId,this),this.systemId&&this.system._set(this.systemId,this),this._processingStatus=O.Running;let t=h(this.options.input);switch(this.system._sendInspectionEvent({type:"@xstate.event",sourceRef:this._parent,actorRef:this,event:t}),this._snapshot.status){case"done":return this.update(this._snapshot,t),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(t){return this._snapshot={...this._snapshot,status:"error",error:t},this._error(t),this}return this.update(this._snapshot,t),this.options.devTools&&this.attachDevTools(),this.mailbox.start(),this}_process(t){let e,n;try{e=this.logic.transition(this._snapshot,t,this._actorScope)}catch(t){n={err:t}}if(n){let{err:t}=n;this._snapshot={...this._snapshot,status:"error",error:t},this._error(t);return}this.update(e,t),t.type===l&&(this._stopProcedure(),this._complete())}_stop(){return this._processingStatus===O.Stopped||((this.mailbox.clear(),this._processingStatus===O.NotStarted)?this._processingStatus=O.Stopped:this.mailbox.enqueue({type:l})),this}stop(){if(this._parent)throw Error("A non-root actor cannot be stopped directly.");return this._stop()}_complete(){for(let t of this.observers)try{t.complete?.()}catch(t){p(t)}this.observers.clear()}_reportError(t){if(!this.observers.size){this._parent||p(t);return}let e=!1;for(let n of this.observers){let r=n.error;e||=!r;try{r?.(t)}catch(t){p(t)}}this.observers.clear(),e&&p(t)}_error(t){this._stopProcedure(),this._reportError(t),this._parent&&this.system._relay(this,this._parent,f(this.id,t))}_stopProcedure(){return this._processingStatus!==O.Running||(this.system.scheduler.cancelAll(this),this.mailbox.clear(),this.mailbox=new s(this._process.bind(this)),this._processingStatus=O.Stopped,this.system._unregister(this)),this}_send(t){this._processingStatus!==O.Stopped&&this.mailbox.enqueue(t)}send(t){this.system._relay(void 0,this,t)}attachDevTools(){let{devTools:t}=this.options;t&&("function"==typeof t?t:i)(this)}toJSON(){return{xstate$$type:k,id:this.id}}getPersistedSnapshot(t){return this.logic.getPersistedSnapshot(this._snapshot,t)}[y](){return this}getSnapshot(){return this._snapshot}}function P(t,...[e]){return new j(t,e)}function D(t,e,n,r,{sendId:i}){return[e,{sendId:"function"==typeof i?i(n,r):i},void 0]}function U(t,e){t.defer(()=>{t.system.scheduler.cancel(t.self,e.sendId)})}function M(t){function e(t,e){}return e.type="xstate.cancel",e.sendId=t,e.resolve=D,e.execute=U,e}function F(t,e,n,r,{id:i,systemId:s,src:o,input:a,syncSnapshot:u}){let c,l;let d="string"==typeof o?I(e.machine,o):o,f="function"==typeof i?i(n):i;return d&&(l="function"==typeof a?a({context:e.context,event:n.event,self:t.self}):a,c=P(d,{id:f,src:o,parent:t.self,syncSnapshot:u,systemId:s,input:l})),[tU(e,{children:{...e.children,[f]:c}}),{id:i,systemId:s,actorRef:c,src:o,input:l},void 0]}function z(t,{actorRef:e}){e&&t.defer(()=>{e._processingStatus!==O.Stopped&&e.start()})}function N(...[t,{id:e,systemId:n,input:r,syncSnapshot:i=!1}={}]){function s(t,e){}return s.type="xstate.spawnChild",s.id=e,s.systemId=n,s.src=t,s.input=r,s.syncSnapshot=i,s.resolve=F,s.execute=z,s}function L(t,e,n,r,{actorRef:i}){let s="function"==typeof i?i(n,r):i,o="string"==typeof s?e.children[s]:s,a=e.children;return o&&(a={...a},delete a[o.id]),[tU(e,{children:a}),o,void 0]}function V(t,e){if(e){if(t.system._unregister(e),e._processingStatus!==O.Running){t.stopChild(e);return}t.defer(()=>{t.stopChild(e)})}}function B(t){function e(t,e){}return e.type="xstate.stopChild",e.actorRef=t,e.resolve=L,e.execute=V,e}function Z(t,e,{stateValue:n}){if("string"==typeof n&&ts(n)){let e=t.machine.getStateNodeById(n);return t._nodes.some(t=>t===e)}return t.matches(n)}function H(t){function e(){return!1}return e.check=Z,e.stateValue=t,e}function W(t,{context:e,event:n},{guards:r}){return!Y(r[0],e,n,t)}function X(t){function e(t,e){return!1}return e.check=W,e.guards=[t],e}function J(t,{context:e,event:n},{guards:r}){return r.every(r=>Y(r,e,n,t))}function G(t){function e(t,e){return!1}return e.check=J,e.guards=t,e}function Y(t,e,n,r){let{machine:i}=r,s="function"==typeof t,o=s?t:i.implementations.guards["string"==typeof t?t:t.type];if(!s&&!o)throw Error(`Guard '${"string"==typeof t?t:t.type}' is not implemented.'.`);if("function"!=typeof o)return Y(o,e,n,r);let a={context:e,event:n},u=s||"string"==typeof t?void 0:"params"in t?"function"==typeof t.params?t.params({context:e,event:n}):t.params:void 0;return"check"in o?o.check(r,a,o):o(a,u)}let K=t=>"atomic"===t.type||"final"===t.type;function Q(t){return Object.values(t.states).filter(t=>"history"!==t.type)}function tt(t,e){let n=[];if(e===t)return n;let r=t.parent;for(;r&&r!==e;)n.push(r),r=r.parent;return n}function te(t){let e=new Set(t),n=tn(e);for(let t of e)if("compound"!==t.type||n.get(t)&&n.get(t).length){if("parallel"===t.type){for(let n of Q(t))if("history"!==n.type&&!e.has(n))for(let t of th(n))e.add(t)}}else th(t).forEach(t=>e.add(t));for(let t of e){let n=t.parent;for(;n;)e.add(n),n=n.parent}return e}function tn(t){let e=new Map;for(let n of t)e.has(n)||e.set(n,[]),n.parent&&(e.has(n.parent)||e.set(n.parent,[]),e.get(n.parent).push(n));return e}function tr(t,e){return function t(e,n){let r=n.get(e);if(!r)return{};if("compound"===e.type){let t=r[0];if(!t)return{};if(K(t))return t.key}let i={};for(let e of r)i[e.key]=t(e,n);return i}(t,tn(te(e)))}function ti(t,e){return"compound"===e.type?Q(e).some(e=>"final"===e.type&&t.has(e)):"parallel"===e.type?Q(e).every(e=>ti(t,e)):"final"===e.type}let ts=t=>"#"===t[0];function to(t,e){return t.transitions.get(e)||[...t.transitions.keys()].filter(t=>C(e,t)).sort((t,e)=>e.length-t.length).flatMap(e=>t.transitions.get(e))}function ta(t){let e=t.config.after;if(!e)return[];let n=e=>{var n;let r=(n=t.id,{type:`xstate.after.${e}.${n}`}),i=r.type;return t.entry.push(tN(r,{id:i,delay:e})),t.exit.push(M(i)),i};return Object.keys(e).flatMap(t=>{let r=e[t],i=Number.isNaN(+t)?t:+t,s=n(i);return b("string"==typeof r?{target:r}:r).map(t=>({...t,event:s,delay:i}))}).map(e=>{let{delay:n}=e;return{...tu(t,e.event,e),delay:n}})}function tu(t,e,n){let r=E(n.target),i=n.reenter??!1,s=function(t,e){if(void 0!==e)return e.map(e=>{if("string"!=typeof e)return e;if(ts(e))return t.machine.getStateNodeById(e);let n=e[0]===o;if(n&&!t.parent)return tg(t,e.slice(1));let r=n?t.key+e:e;if(t.parent)try{return tg(t.parent,r)}catch(e){throw Error(`Invalid transition definition for state node '${t.id}':
2${e.message}`)}else throw Error(`Invalid target: "${e}" is not a valid target from the root node. Did you mean ".${e}"?`)})}(t,r),a={...n,actions:b(n.actions),guard:n.guard,target:s,source:t,reenter
2:i,eventType:e,toJSON:()=>({...a,source:`#${t.id}`,target:s?s.map(t=>`#${t.id}`):void 0})};return a}function tc(t){let e=new Map;if(t.config.on)for(let n of Object.keys(t.config.on)){if(n===a)throw Error('Null events ("") cannot be specified as a transition key. Use `always: { ... }` instead.');let r=t.config.on[n];e.set(n,x(r).map(e=>tu(t,n,e)))}if(t.config.onDone){let n=`xstate.done.state.${t.id}`;e.set(n,x(t.config.onDone).map(e=>tu(t,n,e)))}for(let n of t.invoke){if(n.onDone){let r=`xstate.done.actor.${n.id}`;e.set(r,x(n.onDone).map(e=>tu(t,r,e)))}if(n.onError){let r=`xstate.error.actor.${n.id}`;e.set(r,x(n.onError).map(e=>tu(t,r,e)))}if(n.onSnapshot){let r=`xstate.snapshot.${n.id}`;e.set(r,x(n.onSnapshot).map(e=>tu(t,r,e)))}}for(let n of t.after){let t=e.get(n.eventType);t||(t=[],e.set(n.eventType,t)),t.push(n)}return e}function tl(t,e){let n="string"==typeof e?t.states[e]:e?t.states[e.target]:void 0;if(!n&&e)throw Error(`Initial state node "${e}" not found on parent state node #${t.id}`);let r={source:t,actions:e&&"string"!=typeof e?b(e.actions):[],eventType:null,reenter:!1,target:n?[n]:[],toJSON:()=>({...r,source:`#${t.id}`,target:n?[`#${n.id}`]:[]})};return r}function td(t){let e=E(t.config.target);return e?{target:e.map(e=>"string"==typeof e?tg(t.parent,e):e)}:t.parent.initial}function tf(t){return"history"===t.type}function th(t){let e=tp(t);for(let n of e)for(let r of tt(n,t))e.add(r);return e}function tp(t){let e=new Set;return!function t(n){if(!e.has(n)){if(e.add(n),"compound"===n.type)t(n.initial.target[0]);else if("parallel"===n.type)for(let e of Q(n))t(e)}}(t),e}function ty(t,e){if(ts(e))return t.machine.getStateNodeById(e);if(!t.states)throw Error(`Unable to retrieve child state '${e}' from '${t.id}'; no child states exist.`);let n=t.states[e];if(!n)throw Error(`Child state '${e}' does not exist on '${t.id}'`);return n}function tg(t,e){if("string"==typeof e&&ts(e))try{return t.machine.getStateNodeById(e)}catch{}let n=g(e).slice(),r=t;for(;n.length;){let t=n.shift();if(!t.length)break;r=ty(r,t)}return r}function tm(t,e){if("string"==typeof e){let n=t.states[e];if(!n)throw Error(`State '${e}' does not exist on '${t.id}'`);return[t,n]}let n=Object.keys(e),r=n.map(e=>ty(t,e)).filter(Boolean);return[t.machine.root,t].concat(r,n.reduce((n,r)=>{let i=ty(t,r);if(!i)return n;let s=tm(i,e[r]);return n.concat(s)},[]))}function tv(t,e){let n=t;for(;n.parent&&n.parent!==e;)n=n.parent;return n.parent===e}function tb(t,e,n){let r=new Set;for(let i of t){let t=!1,s=new Set;for(let o of r)if(function(t,e){let n=new Set(t),r=new Set(e);for(let t of n)if(r.has(t))return!0;for(let t of r)if(n.has(t))return!0;return!1}(tx([i],e,n),tx([o],e,n))){if(tv(i.source,o.source))s.add(o);else{t=!0;break}}if(!t){for(let t of s)r.delete(t);r.add(i)}}return Array.from(r)}function tw(t,e){if(!t.target)return[];let n=new Set;for(let r of t.target)if(tf(r)){if(e[r.id])for(let t of e[r.id])n.add(t);else for(let t of tw(td(r),e))n.add(t)}else n.add(r);return[...n]}function t_(t,e){let n=tw(t,e);if(!n)return;if(!t.reenter&&n.every(e=>e===t.source||tv(e,t.source)))return t.source;let r=function(t){let[e,...n]=t;for(let t of tt(e,void 0))if(n.every(e=>tv(e,t)))return t}(n.concat(t.source));return r||(t.reenter?void 0:t.source.machine.root)}function tx(t,e,n){let r=new Set;for(let i of t)if(i.target?.length){let t=t_(i,n);for(let n of(i.reenter&&i.source===t&&r.add(t),e))tv(n,t)&&r.add(n)}return[...r]}function tE(t,e,n,r,i,s){if(!t.length)return e;let o=new Set(e._nodes),a=e.historyValue,u=tb(t,o,a),c=e;i||([c,a]=function(t,e,n,r,i,s,o,a){let u,c=t,l=tx(r,i,s);for(let t of(l.sort((t,e)=>e.order-t.order),l))for(let e of function(t){return Object.keys(t.states).map(e=>t.states[e]).filter(t=>"history"===t.type)}(t)){let n;n="deep"===e.history?e=>K(e)&&tv(e,t):e=>e.parent===t,(u??={...s})[e.id]=Array.from(i).filter(n)}for(let t of l)c=tI(c,e,n,[...t.exit,...t.invoke.map(t=>B(t.id))],o,void 0),i.delete(t);return[c,u||s]}(c,r,n,u,o,a,s,n.actionExecutor)),c=function(t,e,n,r,i,s,o,a){let u=t,c=new Set,l=new Set;(function(t,e,n,r){for(let i of t){let t=t_(i,e);for(let s of i.target||[])!tf(s)&&(i.source!==s||i.source!==t||i.reenter)&&(r.add(s),n.add(s)),tS(s,e,n,r);for(let s of tw(i,e)){let o=tt(s,t);t?.type==="parallel"&&o.push(t),tq(r,e,n,o,!i.source.parent&&i.reenter?void 0:t)}}})(r,o,l,c),a&&l.add(t.machine.root);let f=new Set;for(let t of[...c].sort((t,e)=>t.order-e.order)){i.add(t);let r=[];for(let e of(r.push(...t.entry),t.invoke))r.push(N(e.src,{...e,syncSnapshot:!!e.onSnapshot}));if(l.has(t)){let e=t.initial.actions;r.push(...e)}if(u=tI(u,e,n,r,s,t.invoke.map(t=>
2t.id)),"final"===t.type){let r=t.parent,o=r?.type==="parallel"?r:r?.parent,a=o||t;for(r?.type==="compound"&&s.push(d(r.id,void 0!==t.output?w(t.output,u.context,e,n.self):void 0));o?.type==="parallel"&&!f.has(o)&&ti(i,o);)f.add(o),s.push(d(o.id)),a=o,o=o.parent;if(o)continue;u=tU(u,{status:"done",output:function(t,e,n,r,i){if(void 0===r.output)return;let s=d(i.id,void 0!==i.output&&i.parent?w(i.output,t.context,e,n.self):void 0);return w(r.output,t.context,s,n.self)}(u,e,n,u.machine.root,a)})}}return u}(c=tI(c,r,n,u.flatMap(t=>t.actions),s,void 0),r,n,u,o,s,a,i);let l=[...o];"done"===c.status&&(c=tI(c,r,n,l.sort((t,e)=>e.order-t.order).flatMap(t=>t.exit),s,void 0));try{if(a===e.historyValue&&function(t,e){if(t.length!==e.size)return!1;for(let n of t)if(!e.has(n))return!1;return!0}(e._nodes,o))return c;return tU(c,{_nodes:l,historyValue:a})}catch(t){throw t}}function tS(t,e,n,r){if(tf(t)){if(e[t.id]){let i=e[t.id];for(let t of i)r.add(t),tS(t,e,n,r);for(let s of i)tq(r,e,n,tt(s,t.parent))}else{let i=td(t);for(let s of i.target)r.add(s),i===t.parent?.initial&&n.add(t.parent),tS(s,e,n,r);for(let s of i.target)tq(r,e,n,tt(s,t.parent))}}else if("compound"===t.type){let[i]=t.initial.target;tf(i)||(r.add(i),n.add(i)),tS(i,e,n,r),tq(r,e,n,tt(i,t))}else if("parallel"===t.type)for(let i of Q(t).filter(t=>!tf(t)))[...r].some(t=>tv(t,i))||(tf(i)||(r.add(i),n.add(i)),tS(i,e,n,r))}function tq(t,e,n,r,i){for(let s of r)if((!i||tv(s,i))&&t.add(s),"parallel"===s.type)for(let r of Q(s).filter(t=>!tf(t)))[...t].some(t=>tv(t,r))||(t.add(r),tS(r,e,n,t))}function tI(t,e,n,r,i,s){let o=s?[]:void 0,a=function t(e,n,r,i,s,o){let{machine:a}=e,u=e;for(let e of i){var c;let i="function"==typeof e,l=i?e:(c="string"==typeof e?e:e.type,a.implementations.actions[c]),d={context:u.context,event:n,self:r.self,system:r.system},f=i||"string"==typeof e?void 0:"params"in e?"function"==typeof e.params?e.params({context:u.context,event:n}):e.params:void 0;if(!l||!("resolve"in l)){r.actionExecutor({type:"string"==typeof e?e:"object"==typeof e?e.type:e.name||"(anonymous)",info:d,params:f,exec:l});continue}let[h,p,y]=l.resolve(r,u,d,f,l,s);u=h,"retryResolve"in l&&o?.push([l,p]),"execute"in l&&r.actionExecutor({type:l.type,info:d,params:p,exec:l.execute.bind(null,r,p)}),y&&(u=t(u,n,r,y,s,o))}return u}(t,e,n,r,{internalQueue:i,deferredActorIds:s},o);return o?.forEach(([t,e])=>{t.retryResolve(n,a,e)}),a}function tC(t,e,n,r){let i=t,s=[];function o(t,e,r){n.system._sendInspectionEvent({type:"@xstate.microstep",actorRef:n.self,event:e,snapshot:t,_transitions:r}),s.push(t)}if(e.type===l)return o(i=tU(t$(i,e,n),{status:"stopped"}),e,[]),{snapshot:i,microstates:s};let a=e;if(a.type!==u){let e=a,u=e.type.startsWith("xstate.error.actor"),c=tR(e,i);if(u&&!c.length)return o(i=tU(t,{status:"error",error:e.error}),e,[]),{snapshot:i,microstates:s};o(i=tE(c,t,n,a,!1,r),e,c)}let c=!0;for(;"active"===i.status;){let t=c?function(t,e){let n=new Set;for(let r of t._nodes.filter(K))t:for(let i of[r].concat(tt(r,void 0)))if(i.always){for(let r of i.always)if(void 0===r.guard||Y(r.guard,t.context,e,t)){n.add(r);break t}}return tb(Array.from(n),new Set(t._nodes),t.historyValue)}(i,a):[],e=t.length?i:void 0;if(!t.length){if(!r.length)break;t=tR(a=r.shift(),i)}c=(i=tE(t,i,n,a,!1,r))!==e,o(i,a,t)}return"active"!==i.status&&t$(i,a,n),{snapshot:i,microstates:s}}function t$(t,e,n){return tI(t,e,n,Object.values(t.children).map(t=>B(t)),[],void 0)}function tR(t,e){return e.machine.getTransitionData(e,t)}function tT(t,e){let n=te(tm(t,e));return tr(t,[...n])}let tk=function(t){return function t(e,n){let r=m(e),i=m(n);return"string"==typeof i?"string"==typeof r&&i===r:"string"==typeof r?r in i:Object.keys(r).every(e=>e in i&&t(r[e],i[e]))}(t,this.value)},tO=function(t){return this.tags.has(t)},tA=function(t){let e=this.machine.getTransitionData(this,t);return!!e?.length&&e.some(t=>void 0!==t.target||t.actions.length)},tj=function(){let{_nodes:t,tags:e,machine:n,getMeta:r,toJSON:i,can:s,hasTag:o,matches:a,...u}=this;return{...u,tags:Array.from(e)}},tP=function(){return this._nodes.reduce((t,e)=>(void 0!==e.meta&&(t[e.id]=e.meta),t),{})};function tD(t,e){return{status:t.status,output:t.output,error:t.error,machine:e,context:t.context,_nodes:t._nodes,value:tr(e.root,t._nodes),tags:new Set(t._nodes.flatMap(t=>t.tags)),children:t.children,historyValue:t.historyValue||{},matches:tk,hasTag:tO,can:tA,getMeta:tP,toJSON:tj}}function tU(t,e={}){return tD({...t,...e},t.machine)}function tM(t,e){let{_nodes:n,tags:r,machine:i,children:s,context:o,can:a,hasTag:u,matches:c,getMeta:l,toJSON:d,...f}=t,h={};for(let t in s){let n=s[t];h[t]={snapshot:n.getPersistedSnapshot(e),src:n.src,systemId:n.systemId,syncSnapshot:n._syncSnapshot}}return{...f,context:function t(e){let n;for(let r in e){let i=e[r];if(i&&"object"==typeof i){if("sessionId"in i&&"send"in i&&"ref"in i)(n??=Array.isArray(e)?e.slice():{...e})[r]={xstate$$type:k,id:i.id};else{let s=t(i);s!==i&&((n??=Array.isArray(e)?e.slice():{...e})[r]=s)}}}return n??e}(o),children:h,historyValue:function(t){if("object"!=typeof t||null===t)return{};let e={};for(let n in t){let r=t[n];Array.isArray(r)&&(e[n]=r.map(t=>({id:t.id})))}return e}(f.historyValue)}}function tF(t,e,n,r,{event:i,id:s,delay:o},{internalQueue:a}){let u;let c=e.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(n,r):i;if("string"==typeof o){let t=c&&c[o];u="function"==typeof t?t(n,r):t}else u="function"==typeof o?o(n,r):o;return"number"!=typeof u&&a.push(l),[e,{event:l,id:s,delay:u},void 0]}function tz(t,e){let{event:n,delay:r,id:i}=e;if("number"==typeof r){t.defer(()=>{let e=t.self;t.system.scheduler.schedule(e,e,n,r,i)});return}}function tN(t,e){function n(t,e){}return n.type="xstate.raise",n.event=t,n.id=e?.id,n.delay=e?.delay,n.resolve=tF,n.execute=tz,n}},97375:function(t,e,n){n.d(e,{ZD:function(){return f},cY:function(){return function t({schemas:e,actors:n,actions:s,guards:o,delays:a}){return{assign:i.a,sendTo:d.s,raise:r.r,log:d.l,cancel:r.a,stopChild:r.s,enqueueActions:d.e,emit:d.a,spawnChild:r.b,createStateConfig:t=>t,createAction:t=>t,createMachine:t=>new l({...t,schemas:e},{actors:n,actions:s,guards:o,delays:a}),extend:r=>t({schemas:e,actors:n,actions:{...s,...r.actions},guards:{...o,...r.guards},delays:{...a,...r.delays}})}}}}),n(41553);var r=n(61987),i=n(52499);let s=new WeakMap;function o(t,e,n){let r=s.get(t);return r?e in r||(r[e]=n()):(r={[e]:n()},s.set(t,r)),r[e]}let a={},u=t=>"string"==typeof t?{type:t}:"function"==typeof t?"resolve"in t?{type:t.type}:{type:t.name}:t;class c{constructor(t,e){if(this.config=t,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=e._parent,this.key=e._key,this.machine=e._machine,this.path=this.parent?this.parent.path.concat(this.key):[],this.id=this.config.id||[this.machine.id,...this.path].join(r.S),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?(0,r.q)(this.config.states,(t,e)=>new c(t,{_parent:this,_key:e,_machine:this.machine})):a,"compound"===this.type&&!this.config.initial)throw Error(`No initial state specified for c
2ompound 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=(0,r.t)(this.config.entry).slice(),this.exit=(0,r.t)(this.config.exit).slice(),this.meta=this.config.meta,this.output="final"!==this.type&&this.parent?void 0:this.config.output,this.tags=(0,r.t)(t.tags).slice()}_initialize(){this.transitions=(0,r.u)(this),this.config.always&&(this.always=(0,r.v)(this.config.always).map(t=>(0,r.w)(this,r.N,t))),Object.keys(this.states).forEach(t=>{this.states[t]._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(u),eventType:null,reenter:!1,toJSON:()=>({target:this.initial.target.map(t=>`#${t.id}`),source:`#${this.id}`,actions:this.initial.actions.map(u),eventType:null})}:void 0,history:this.history,states:(0,r.q)(this.states,t=>t.definition),on:this.on,transitions:[...this.transitions.values()].flat().map(t=>({...t,actions:t.actions.map(u)})),entry:this.entry.map(u),exit:this.exit.map(u),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 o(this,"invoke",()=>(0,r.t)(this.config.invoke).map((t,e)=>{let{src:n,systemId:i}=t,s=t.id??(0,r.y)(this.id,e),o="string"==typeof n?n:`xstate.invoke.${(0,r.y)(this.id,e)}`;return{...t,src:o,id:s,systemId:i,toJSON(){let{onDone:e,onError:n,...r}=t;return{...r,type:"xstate.invoke",src:o,id:s}}}}))}get on(){return o(this,"on",()=>[...this.transitions].flatMap(([t,e])=>e.map(e=>[t,e])).reduce((t,[e,n])=>(t[e]=t[e]||[],t[e].push(n),t),{}))}get after(){return o(this,"delayedTransitions",()=>(0,r.z)(this))}get initial(){return o(this,"initial",()=>(0,r.B)(this,this.config.initial))}next(t,e){let n;let i=e.type,s=[];for(let a of o(this,`candidates-${i}`,()=>(0,r.C)(this,i))){let{guard:o}=a,u=t.context,c=!1;try{c=!o||(0,r.x)(o,u,e,t)}catch(e){let t="string"==typeof o?o:"object"==typeof o?o.type:void 0;throw Error(`Unable to evaluate guard ${t?`'${t}' `:""}in transition for event '${i}' in state node '${this.id}':
3${e.message}`)}if(c){s.push(...a.actions),n=a;break}}return n?[n]:void 0}get events(){return o(this,"events",()=>{let{states:t}=this,e=new Set(this.ownEvents);if(t)for(let n of Object.keys(t)){let r=t[n];if(r.states)for(let t of r.events)e.add(`${t}`)}return Array.from(e)})}get ownEvents(){return Array.from(new Set(Object.keys(Object.fromEntries(this.transitions)).filter(t=>this.transitions.get(t).some(t=>!(!t.target&&!t.actions.length&&!t.reenter)))))}}class l{constructor(t,e){this.config=t,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=t.id||"(machine)",this.implementations={actors:e?.actors??{},actions:e?.actions??{},delays:e?.delays??{},guards:e?.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 c(t,{_key:this.id,_machine:this}),this.root._initialize(),this.states=this.root.states,this.events=this.root.events}provide(t){let{actions:e,guards:n,actors:r,delays:i}=this.implementations;return new l(this.config,{actions:{...e,...t.actions},guards:{...n,...t.guards},actors:{...r,...t.actors},delays:{...i,...t.delays}})}resolveState(t){let e=(0,r.D)(this.root,t.value),n=(0,r.E)((0,r.g)(this.root,e));return(0,r.F)({_nodes:[...n],context:t.context||{},children:{},status:(0,r.G)(n,this.root)?"done":t.status||"active",output:t.output,error:t.error,historyValue:t.historyValue},this)}transition(t,e,n){return(0,r.H)(t,e,n,[]).snapshot}microstep(t,e,n){return(0,r.H)(t,e,n,[]).microstates}getTransitionData(t,e){return(0,r.I)(this.root,t.value,t,e)||[]}getPreInitialState(t,e,n){let{context:s}=this.config,o=(0,r.F)({context:"function"!=typeof s&&s?s:{},_nodes:[this.root],children:{},status:"active"},this);return"function"==typeof s?(0,r.J)(o,e,t,[(0,i.a)(({spawn:t,event:e,self:n})=>s({spawn:t,input:e.input,self:n}))],n,void 0):o}getInitialSnapshot(t,e){let n=(0,r.K)(e),i=[],s=this.getPreInitialState(t,n,i),o=(0,r.L)([{target:[...(0,r.M)(this.root)],source:this.root,reenter
3:!0,actions:[],eventType:null,toJSON:null}],s,t,n,!0,i),{snapshot:a}=(0,r.H)(o,n,t,i);return a}start(t){Object.values(t.children).forEach(t=>{"active"===t.getSnapshot().status&&t.start()})}getStateNodeById(t){let e=(0,r.O)(t),n=e.slice(1),i=(0,r.P)(e[0])?e[0].slice(1):e[0],s=this.idMap.get(i);if(!s)throw Error(`Child state node '#${i}' does not exist on machine '${this.id}'`);return(0,r.Q)(s,n)}get definition(){return this.root.definition}toJSON(){return this.definition}getPersistedSnapshot(t,e){return(0,r.R)(t,e)}restoreSnapshot(t,e){let n={},i=t.children;Object.keys(i).forEach(t=>{let s=i[t],o=s.snapshot,a=s.src,u="string"==typeof a?(0,r.T)(this,a):a;if(!u)return;let c=(0,r.c)(u,{id:t,parent:e.self,syncSnapshot:s.syncSnapshot,snapshot:o,src:a,systemId:s.systemId});n[t]=c});let s=function(t,e){if(!e||"object"!=typeof e)return{};let n={};for(let r in e)for(let i of e[r]){let e=function(t,e){if(e instanceof c)return e;try{return t.machine.getStateNodeById(e.id)}catch{}}(t,i);e&&(n[r]??=[],n[r].push(e))}return n}(this.root,t.historyValue),o=(0,r.F)({...t,children:n,_nodes:Array.from((0,r.E)((0,r.g)(this.root,t.value))),historyValue:s},this),a=new Set;return!function t(e,n){if(!a.has(e))for(let i in a.add(e),e){let s=e[i];if(s&&"object"==typeof s){if("xstate$$type"in s&&s.xstate$$type===r.$){e[i]=n[s.id];continue}t(s,n)}}}(o.context,n),o}}var d=n(17716);function f(t,e){let n=(0,r.t)(e);if(!n.some(e=>(0,r.m)(t.type,e))){let e=1===n.length?`type matching "${n[0]}"`:`one of types matching "${n.join('", "')}"`;throw Error(`Expected event ${JSON.stringify(t)} to have ${e}`)}}},10110:function(t,e,n){function r(t){return"object"==typeof t&&null!==t&&!Array.isArray(t)}n.d(e,{tZ:function(){return $},U2:function(){return l},qy:function(){return b},vs:function(){return x},eB:function(){return _},XL:function(){return w},Cb:function(){return m},Y_:function(){return v},F5:function(){return q},Mx:function(){return C},eT:function(){return p},BB:function(){return d},lV:function(){return function t(e,n,i=[]){if(null!==e&&Array.isArray(e))return e.map((e,s)=>{if(r(e)){let r=e._key;if("string"==typeof r)return t(e,n,i.concat({_key:r,_index:s}))}return t(e,n,i.concat(s))});if(r(e)){if("block"===e._type||"span"===e._type){let r={...e};return"block"===e._type?r.children=t(e.children,n,i.concat("children")):"span"===e._type&&(r.text=t(e.text,n,i.concat("text"))),r}return Object.fromEntries(Object.entries(e).map(([e,r])=>[e,t(r,n,i.concat(e))]))}return n(e,i)}}});let i=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,s=/_key\s*==\s*['"](.*)['"]/,o=/^\d*:\d*$/;function a(t){return"number"==typeof t||"string"==typeof t&&/^\[\d+\]$/.test(t)}function u(t){return"string"==typeof t?s.test(t.trim()):"object"==typeof t&&"_key"in t}function c(t){if("string"==typeof t&&o.test(t))return!0;if(!Array.isArray(t)||2!==t.length)return!1;let[e,n]=t;return("number"==typeof e||""===e)&&("number"==typeof n||""===n)}function l(t,e,n){let r="string"==typeof e?f(e):e;if(!Array.isArray(r))throw Error("Path must be an array or a string");let i=t;for(let t=0;t<r.length;t++){let e=r[t];if(a(e)){if(!Array.isArray(i))return n;i=i[e]}if(u(e)){if(!Array.isArray(i))return n;i=i.find(t=>t._key===e._key)}if("string"==typeof e&&(i="object"==typeof i&&null!==i?i[e]:void 0),typeof i>"u")return n}return i}function d(t){if(!Array.isArray(t))throw Error("Path is not an array");return t.reduce((t,e,n)=>{let r=typeof e;if("number"===r)return`${t}[${e}]`;if("string"===r)return`${t}${0===n?"":"."}${e}`;if(u(e)&&e._key)return`${t}[_key=="${e._key}"]`;if(Array.isArray(e)){let[n,r]=e;return`${t}[${n}:${r}]`}throw Error(`Unsupported path segment \`${JSON.stringify(e)}\``)},"")}function f(t){if("string"!=typeof t)throw Error("Path is not a string");let e=t.match(i);if(!e)throw Error("Invalid path string");return e.map(h)}function h(t){return a(t)?Number(t.replace(/[^\d]/g,"")):u(t)?{_key:t.match(s)[1]}:c(t)?function(t){let[e,n]=t.split(":").map(t=>""===t?t:Number(t));return[e,n]}(t):t}var p=Object.freeze({__proto__:null,fromString:f,get:l,isIndexSegment:a,isIndexTuple:c,isKeySegment:u,reKeySegment:s,toString:d});let y="drafts.",g="versions.";function m(t){return t.startsWith(y)}function v(t){return t.startsWith(g)}function b(t){return v(t)?y+x(t):m(t)?t:y+t}function w(t,e){if("drafts"===e||"published"===e)throw Error('Version can not be "published" or "drafts"');return`${g}${e}.${x(t)}`}function _(t){if(!v(t))return;let[e,n,...r]=t.split(".");return n}function x(t){return v(t)?t.split(".").slice(2).join("."):m(t)?t.slice(y.length):t}let E={"\f":"\\f","\n":"\\n","\r":"\\r","	":"\\t","'":"\\'","\\":"\\\\"},S={"\\f":"\f","\\n":`
4`,"\\r":"\r","\\t":"	","\\'":"'","\\\\":"\\"};function q(t){let e;let n=[],r=/\['(.*?)'\]|\[(\d+)\]|\[\?\(@\._key=='(.*?)'\)\]/g;for(;null!==(e=r.exec(t));){if(void 0!==e[1]){let t=e[1].replace(/\\(\\|f|n|r|t|')/g,t=>S[t]);n.push(t);continue}if(void 0!==e[2]){n.push(parseInt(e[2],10));continue}if(void 0!==e[3]){let t=e[3].replace(/\\(\\')/g,t=>S[t]);n.push({_key:t,_index:-1});continue}}return n}function I(t){return t.map(t=>{if("string"==typeof t||"number"==typeof t)return t;if(-1!==t._index)return t._index;throw Error(`invalid segment:${JSON.stringify(t)}`)})}function C(t,e){var n;if(!e?.mappings)return;let r=(n=I(t),`$${n.map(t=>"string"==typeof t?`['${t.replace(/[\f\n\r\t'\\]/g,t=>E[t])}']`:"number"==typeof t?`[${t}]`:""!==t._key?`[?(@._key=='${t._key.replace(/['\\]/g,t=>E[t])}')]`:`[${t._index}]`).join("")}`);
4if(void 0!==e.mappings[r])return{mapping:e.mappings[r],matchedPath:r,pathSuffix:""};let i=I(t).map(t=>"string"==typeof t?`['${t.replace(/[\f\n\r\t'\\]/g,t=>E[t])}']`:"number"==typeof t?`[${t}]`:""!==t._key?`[?(@._key=='${t._key.replace(/['\\]/g,t=>E[t])}')]`:`[${t._index}]`);for(let t=i.length-1;t>=0;t--){let n=`$${i.slice(0,t).join("")}`,s=e.mappings[n];if(s){let t=r.substring(n.length);return{mapping:s,matchedPath:n,pathSuffix:t}}}}function $(t){let{baseUrl:e,workspace:n="default",tool:r="default",id:i,type:s,path:o,projectId:a,dataset:u}=t;if(!e)throw Error("baseUrl is required");if(!o)throw Error("path is required");if(!i)throw Error("id is required");if("/"!==e&&e.endsWith("/"))throw Error("baseUrl must not end with a slash");let c="default"===n?void 0:n,l="default"===r?void 0:r,f=x(i),h=Array.isArray(o)?d(o.map(t=>{if("string"==typeof t||"number"==typeof t)return t;if(""!==t._key)return{_key:t._key};if(-1!==t._index)return t._index;throw Error(`invalid segment:${JSON.stringify(t)}`)})):o,p=new URLSearchParams({baseUrl:e,id:f,type:s,path:h});if(c&&p.set("workspace",c),l&&p.set("tool",l),a&&p.set("projectId",a),u&&p.set("dataset",u),m(i)||v(i)){if(v(i)){let t=_(i);p.set("perspective",t)}}else p.set("perspective","published");let y=["/"===e?"":e];c&&y.push(c);let g=["mode=presentation",`id=${f}`,`type=${s}`,`path=${encodeURIComponent(h)}`];return l&&g.push(`tool=${l}`),y.push("intent","edit",`${g.join(";")}?${p}`),y.join("/")}},4248:function(t,e,n){n.d(e,{rB:function(){return t5},XF:function(){return tv},Ap:function(){return tS},nl:function(){return tb},eI:function(){return nx},U4:function(){return t9}});let r=!(typeof navigator>"u")&&"ReactNative"===navigator.product,i={timeout:r?6e4:12e4},s=function(t){let e={...i,..."string"==typeof t?{url:t}:t};if(e.timeout=function t(e){if(!1===e||0===e)return!1;if(e.connect||e.socket)return e;let n=Number(e);return isNaN(n)?t(i.timeout):{connect:n,socket:n}}(e.timeout),e.query){let{url:t,searchParams:n}=function(t){let e=t.indexOf("?");if(-1===e)return{url:t,searchParams:new URLSearchParams};let n=t.slice(0,e),i=t.slice(e+1);if(!r)return{url:n,searchParams:new URLSearchParams(i)};if("function"!=typeof decodeURIComponent)throw Error("Broken `URLSearchParams` implementation, and `decodeURIComponent` is not defined");let s=new URLSearchParams;for(let t of i.split("&")){let[e,n]=t.split("=");e&&s.append(o(e),o(n||""))}return{url:n,searchParams:s}}(e.url);for(let[r,i]of Object.entries(e.query)){if(void 0!==i){if(Array.isArray(i))for(let t of i)n.append(r,t);else n.append(r,i)}let s=n.toString();s&&(e.url=`${t}?${s}`)}}return e.method=e.body&&!e.method?"POST":(e.method||"GET").toUpperCase(),e};function o(t){return decodeURIComponent(t.replace(/\+/g," "))}let a=/^https?:\/\//i,u=function(t){if(!a.test(t.url))throw Error(`"${t.url}" is not a valid URL`)},c=["request","response","progress","error","abort"],l=["processOptions","validateOptions","interceptRequest","finalizeOptions","onRequest","onResponse","onError","onReturn","onHeaders"];var d,f,h,p,y=(d=function(){if(p)return h;p=1;var t=function(t){return t.replace(/^\s+|\s+$/g,"")};return h=function(e){if(!e)return{};for(var n=Object.create(null),r=t(e).split("\n"),i=0;i<r.length;i++){var s,o=r[i],a=o.indexOf(":"),u=t(o.slice(0,a)).toLowerCase(),c=t(o.slice(a+1));typeof n[u]>"u"?n[u]=c:(s=n[u],"[object Array]"===Object.prototype.toString.call(s))?n[u].push(c):n[u]=[n[u],c]}return n}}())&&d.__esModule&&Object.prototype.hasOwnProperty.call(d,"default")?d.default:d;class g{onabort;onerror;onreadystatechange;ontimeout;readyState=0;response;responseText="";responseType="";status;statusText;withCredentials;#t;#e;#n;#r={};#i;#s={};#o;open(t,e,n){this.#t=t,this.#e=e,this.#n="",this.readyState=1,this.onreadystatechange?.(),this.#i=void 0}abort(){this.#i&&this.#i.abort()}getAllResponseHeaders(){return this.#n}setRequestHeader(t,e){this.#r[t]=e}setInit(t,e=!0){this.#s=t,this.#o=e}send(t){let e="arraybuffer"!==this.responseType,n={...this.#s,method:this.#t,headers:this.#r,body:t};"function"==typeof AbortController&&this.#o&&(this.#i=new AbortController,"u">typeof EventTarget&&this.#i.signal instanceof EventTarget&&(n.signal=this.#i.signal)),"u">typeof document&&(n.credentials=this.withCredentials?"include":"omit"),fetch(this.#e,n).then(t=>
4(t.headers.forEach((t,e)=>{this.#n+=`${e}: ${t}\r
5`}),this.status=t.status,this.statusText=t.statusText,this.readyState=3,this.onreadystatechange?.(),e?t.text():t.arrayBuffer())).then(t=>{"string"==typeof t?this.responseText=t:this.response=t,this.readyState=4,this.onreadystatechange?.()}).catch(t=>{"AbortError"!==t.name?this.onerror?.(t):this.onabort?.()})}}let m="function"==typeof XMLHttpRequest?"xhr":"fetch",v="xhr"===m?XMLHttpRequest:g,b=(t,e)=>{let n=t.options,r=t.applyMiddleware("finalizeOptions",n),i={},s=t.applyMiddleware("interceptRequest",void 0,{adapter:m,context:t});if(s){let t=setTimeout(e,0,null,s);return{abort:()=>clearTimeout(t)}}let o=new v;o instanceof g&&"object"==typeof r.fetch&&o.setInit(r.fetch,r.useAbortSignal??!0);let a=r.headers,u=r.timeout,c=!1,l=!1,d=!1;if(o.onerror=t=>{p(o instanceof g?t instanceof Error?t:Error(`Request error while attempting to reach is ${r.url}`,{cause:t}):Error(`Request error while attempting to reach is ${r.url}${t.lengthComputable?`(${t.loaded} of ${t.total} bytes transferred)`:""}`))},o.ontimeout=t=>{p(Error(`Request timeout while attempting to reach ${r.url}${t.lengthComputable?`(${t.loaded} of ${t.total} bytes transferred)`:""}`))},o.onabort=()=>{h(!0),c=!0},o.onreadystatechange=function(){u&&(h(),i.socket=setTimeout(()=>f("ESOCKETTIMEDOUT"),u.socket)),!c&&o&&4===o.readyState&&0!==o.status&&function(){if(!(c||l||d)){if(0===o.status)return void p(Error("Unknown XHR error"));h(),l=!0,e(null,{body:o.response||(""===o.responseType||"text"===o.responseType?o.responseText:""),url:r.url,method:r.method,headers:y(o.getAllResponseHeaders()),statusCode:o.status,statusMessage:o.statusText})}}()},o.open(r.method,r.url,!0),o.withCredentials=!!r.withCredentials,a&&o.setRequestHeader)for(let t in a)a.hasOwnProperty(t)&&o.setRequestHeader(t,a[t]);return r.rawBody&&(o.responseType="arraybuffer"),t.applyMiddleware("onRequest",{options:r,adapter:m,request:o,context:t}),o.send(r.body||null),u&&(i.connect=setTimeout(()=>f("ETIMEDOUT"),u.connect)),{abort:function(){c=!0,o&&o.abort()}};function f(e){d=!0,o.abort();let n=Error("ESOCKETTIMEDOUT"===e?`Socket timed out on request to ${r.url}`:`Connection timed out on request to ${r.url}`);n.code=e,t.channels.error.publish(n)}function h(t){(t||c||o&&o.readyState>=2&&i.connect)&&clearTimeout(i.connect),i.socket&&clearTimeout(i.socket)}function p(t){if(l)return;h(!0),l=!0,o=null;let n=t||Error(`Network error while attempting to reach ${r.url}`);n.isNetworkError=!0,n.request=r,e(n)}},w=(t=[],e=b)=>(function t(e,n){let r=[],i=l.reduce((t,e)=>(t[e]=t[e]||[],t),{processOptions:[s],validateOptions:[u]});function o(t){let e;let r=c.reduce((t,e)=>(t[e]=function(){let t=Object.create(null),e=0;return{publish:function(e){for(let n in t)t[n](e)},subscribe:function(n){let r=e++;return t[r]=n,function(){delete t[r]}}}}(),t),{}),s=function(t,e,...n){let r="onError"===t,s=e;for(let e=0;e<i[t].length&&(s=(0,i[t][e])(s,...n),!r||s);e++);return s},o=s("processOptions",t);s("validateOptions",o);let a={options:o,channels:r,applyMiddleware:s},u=r.request.subscribe(t=>{e=n(t,(e,n)=>((t,e,n)=>{let i=t,o=e;if(!i)try{o=s("onResponse",e,n)}catch(t){o=null,i=t}(i=i&&s("onError",i,n))?r.error.publish(i):o&&r.response.publish(o)})(e,n,t))});r.abort.subscribe(()=>{u(),e&&e.abort()});let l=s("onReturn",r,a);return l===r&&r.request.publish(a),l}return o.use=function(t){if(!t)throw Error("Tried to add middleware that resolved to falsey value");if("function"==typeof t)throw Error("Tried to add middleware that was a function. It probably expects you to pass options to it.");if(t.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 l.forEach(e=>{t[e]&&i[e].push(t[e])}),r.push(t),o},o.clone=()=>t(r,n),e.forEach(o.use),o})(t,e);var _,x,E,S,q,I=n(28070),C=n(12036).lW,$={exports:{}};q||(q=1,function(t,e){let n;e.formatArgs=function(e){if(e[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+e[0]+(this.useColors?"%c ":" ")+"+"+t.exports.humanize(this.diff),!this.useColors)return;let n="color: "+this.color;e.splice(1,0,n,"color: inherit");let r=0,i=0;e[0].replace(/%[a-zA-Z%]/g,t=>{"%%"!==t&&(r++,"%c"===t&&(i=r))}),e.splice(i,0,n)},e.save=function(t){try{t?e.storage.setItem("debug",t):e.storage.removeItem("debug")}catch{}},e.load=function(){let t;try{t=e.storage.getItem("debug")||e.storage.getItem("DEBUG")}catch{}return!t&&"u">typeof I&&"env"in I&&(t=I.env.DEBUG),t},e.useColors=function(){let t;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+)/))&&
5("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&&(t=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(t[1],10)>=31||"u">typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/))},e.storage=function(){try{return localStorage}catch{}}(),e.destroy=(n=!1,()=>{n||(n=!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`."))}),e.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"],e.log=console.debug||console.log||(()=>{}),t.exports=(S?E:(S=1,E=function(t){function e(t){let r,i,s,o=null;function a(...t){if(!a.enabled)return;let n=Number(new Date),i=n-(r||n);a.diff=i,a.prev=r,a.curr=n,r=n,t[0]=e.coerce(t[0]),"string"!=typeof t[0]&&t.unshift("%O");let s=0;t[0]=t[0].replace(/%([a-zA-Z%])/g,(n,r)=>{if("%%"===n)return"%";s++;let i=e.formatters[r];if("function"==typeof i){let e=t[s];n=i.call(a,e),t.splice(s,1),s--}return n}),e.formatArgs.call(a,t),(a.log||e.log).apply(a,t)}return a.namespace=t,a.useColors=e.useColors(),a.color=e.selectColor(t),a.extend=n,a.destroy=e.destroy,Object.defineProperty(a,"enabled",{enumerable:!0,configurable:!1,get:()=>null!==o?o:(i!==e.namespaces&&(i=e.namespaces,s=e.enabled(t)),s),set
5:t=>{o=t}}),"function"==typeof e.init&&e.init(a),a}function n(t,n){let r=e(this.namespace+(typeof n>"u"?":":n)+t);return r.log=this.log,r}function r(t,e){let n=0,r=0,i=-1,s=0;for(;n<t.length;)if(r<e.length&&(e[r]===t[n]||"*"===e[r]))"*"===e[r]?(i=r,s=n):n++,r++;else{if(-1===i)return!1;r=i+1,n=++s}for(;r<e.length&&"*"===e[r];)r++;return r===e.length}return e.debug=e,e.default=e,e.coerce=function(t){return t instanceof Error?t.stack||t.message:t},e.disable=function(){let t=[...e.names,...e.skips.map(t=>"-"+t)].join(",");return e.enable(""),t},e.enable=function(t){for(let n of(e.save(t),e.namespaces=t,e.names=[],e.skips=[],("string"==typeof t?t:"").trim().replace(/\s+/g,",").split(",").filter(Boolean)))"-"===n[0]?e.skips.push(n.slice(1)):e.names.push(n)},e.enabled=function(t){for(let n of e.skips)if(r(t,n))return!1;for(let n of e.names)if(r(t,n))return!0;return!1},e.humanize=function(){if(x)return _;function t(t,e,n,r){return Math.round(t/n)+" "+r+(e>=1.5*n?"s":"")}return x=1,_=function(e,n){n=n||{};var r,i,s=typeof e;if("string"===s&&e.length>0)return function(t){if(!((t=String(t)).length>100)){var e=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(t);if(e){var n=parseFloat(e[1]);switch((e[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return 315576e5*n;case"weeks":case"week":case"w":return 6048e5*n;case"days":case"day":case"d":return 864e5*n;case"hours":case"hour":case"hrs":case"hr":case"h":return 36e5*n;case"minutes":case"minute":case"mins":case"min":case"m":return 6e4*n;case"seconds":case"second":case"secs":case"sec":case"s":return 1e3*n;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return n;default:return}}}}(e);if("number"===s&&isFinite(e))return n.long?(i=Math.abs(e))>=864e5?t(e,i,864e5,"day"):i>=36e5?t(e,i,36e5,"hour"):i>=6e4?t(e,i,6e4,"minute"):i>=1e3?t(e,i,1e3,"second"):e+" ms":(r=Math.abs(e))>=864e5?Math.round(e/864e5)+"d":r>=36e5?Math.round(e/36e5)+"h":r>=6e4?Math.round(e/6e4)+"m":r>=1e3?Math.round(e/1e3)+"s":e+"ms";throw Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))}}(),e.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(t).forEach(n=>{e[n]=t[n]}),e.names=[],e.skips=[],e.formatters={},e.selectColor=function(t){let n=0;for(let e=0;e<t.length;e++)n=(n<<5)-n+t.charCodeAt(e)|0;return e.colors[Math.abs(n)%e.colors.length]},e.enable(e.load()),e}))(e);let{formatters:r}=t.exports;r.j=function(t){try{return JSON.stringify(t)}catch(t){return"[UnexpectedJSONParseError]: "+t.message}}}($,$.exports)),$.exports,Object.prototype.hasOwnProperty;let R=typeof C>"u"?()=>!1:t=>C.isBuffer(t);function T(t){return"[object Object]"===Object.prototype.toString.call(t)}let k=["boolean","string","number"],O={};"u">typeof globalThis?O=globalThis:"u">typeof window?O=window:"u">typeof global?O=global:"u">typeof self&&(O=self);var A=O;let j=(t={})=>{let e=t.implementation||Promise;if(!e)throw Error("`Promise` is not available in global scope, and no implementation was passed");return{onReturn:(n,r)=>new e((e,i)=>{let s=r.options.cancelToken;s&&s.promise.then(t=>{n.abort.publish(t),i(t)}),n.error.subscribe(i),n.response.subscribe(n=>{e(t.onlyBody?n.body:n)}),setTimeout(()=>{try{n.request.publish(r)}catch(t){i(t)}},0)})}};class P{__CANCEL__=!0;message;constructor(t){this.message=t}toString(){return"Cancel"+(this.message?`: ${this.message}`:"")}}class D{promise;reason;constructor(t){if("function"!=typeof t)throw TypeError("executor must be a function.");let e=null;this.promise=new Promise(t=>{e=t}),t(t=>{this.reason||(this.reason=new P(t),e(this.reason))})}static source=()=>{let t;return{token:new D(e=>{t=e}),cancel:t}}}j.Cancel=P,j.CancelToken=D,j.isCancel=t=>!(!t||!t?.__CANCEL__);var U=(t,e,n)=>("GET"===n.method||"HEAD"===n.method)&&(t.isNetworkError||!1);function M(t){return 100*Math.pow(2,t)+100*Math.random()}let F=(t={})=>(t=>{let e=t.maxRetries||5,n=t.retryDelay||M,r=t.shouldRetry;return{onError:(t,i)=>{var s;let o=i.options,a=o.maxRetries||e,u=o.retryDelay||n,c=o.shouldRetry||r,l=o.attemptNumber||0;if(null!==(s=o.body)&&"object"==typeof s&&"function"==typeof s.pipe||!c(t,l,o)||l>=a)return t;let d=Object.assign({},i,{options:Object.assign({},o,{attemptNumber:l+1})});return setTimeout(()=>i.channels.request.publish(d),u(l)),null}}})({shouldRetry:U,...t});F.shouldRetry=U;var z=n(43026),N=n(31940),L=n(651),V=n(11735),B=n(60749),Z=n(44114),H=n(68781),W=n(90660),X=n(60952),J=n(17091),G=n(48937),Y=n(66192),K=n(38360),Q=n(32023),tt=n(97414),te=n(14973),tn=n(26112),tr=n(5741),ti=n(4824),ts=n(96164),to=n(22573),ta=n(78717),tu=n(10428),tc=n(99004),tl=n(78853),td=n(19327);function tf(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=(0,td.jO)(t);return n?(0,tl.z)(tf.apply(void 0,(0,ts.ev)([],(0,ts.CR)(t))),(0,tc.Z)(n)):(0,ta.e)(function(e,n){(0,to.l)((0,ts.ev)([e],(0,ts.CR)((0,tu.k)(t))))(n)})}var th=n(22631),tp=n(10110),ty=n(36642);let tg=/\r\n|[\n\r\u2028\u2029]/;function tm(t,e){let n=0;for(let r=0;r<e.length;r++){let i=e[r].length+1;if(n+i>t)return{line:r+1,column:t-n};n+=i}return{line:e.length,column:e[e.length-1]?.length??0}}
5class tv extends Error{response;statusCode=400;responseBody;details;constructor(t,e){let n=tw(t,e);super(n.message),Object.assign(this,n)}}class tb extends Error{response;statusCode=500;responseBody;details;constructor(t){let e=tw(t);super(e.message),Object.assign(this,e)}}function tw(t,e){let n=t.body,r={response:t,statusCode:t.statusCode,responseBody:-1!==(t.headers["content-type"]||"").toLowerCase().indexOf("application/json")?JSON.stringify(n,null,2):n,message:"",details:void 0};if(!(0,ti.Uy)(n))return r.message=tE(t,n),r;let i=n.error;if("string"==typeof i&&"string"==typeof n.message)return r.message=`${i} - ${n.message}`,r;if("object"!=typeof i||null===i)return"string"==typeof i?r.message=i:"string"==typeof n.message?r.message=n.message:r.message=tE(t,n),r;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 t=i.items||[],e=t.slice(0,5).map(t=>t.error?.description).filter(Boolean),s=e.length?`:
6- ${e.join(`
7- `)}`:"";return t.length>5&&(s+=`
8...and ${t.length-5} more`),r.message=`${i.description}${s}`,r.details=n.error,r}if(t_(i)){let t=e?.options?.query?.tag;return r.message=tx(i,t),r.details=n.error,r}return"description"in i&&"string"==typeof i.description?(r.message=i.description,r.details=i):r.message=tE(t,n),r}function t_(t){return(0,ti.Uy)(t)&&"queryParseError"===t.type&&"string"==typeof t.query&&"number"==typeof t.start&&"number"==typeof t.end}function tx(t,e){let{query:n,start:r,end:i,description:s}=t;if(!n||typeof r>"u")return`GROQ query parse error: ${s}`;let o=e?`
9
10Tag: ${e}`:"";return`GROQ query parse error:
11${function(t,e,n){let r=t.split(tg),{start:i,end:s,markerLines:o}=function(t,e){let n={...t.start},r={...n,...t.end},i=n.line??-1,s=n.column??0,o=r.line,a=r.column,u=Math.max(i-3,0),c=Math.min(e.length,o+3);-1===i&&(u=0),-1===o&&(c=e.length);let l=o-i,d={};if(l)for(let t=0;t<=l;t++){let n=t+i;if(s){if(0===t){let t=e[n-1].length;d[n]=[s,t-s+1]}else if(t===l)d[n]=[0,a];else{let r=e[n-t].length;d[n]=[0,r]}}else d[n]=!0}else s===a?s?d[i]=[s,0]:d[i]=!0:d[i]=[s,a-s];return{start:u,end:c,markerLines:d}}({start:tm(e.start,r),end:e.end?tm(e.end,r):void 0},r),a=`${s}`.length;return t.split(tg,s).slice(i,s).map((t,e)=>{let r=i+1+e,s=` ${` ${r}`.slice(-a)} |`,u=o[r],c=!o[r+1];if(!u)return` ${s}${t.length>0?` ${t}`:""}`;let l="";if(Array.isArray(u)){let e=t.slice(0,Math.max(u[0]-1,0)).replace(/[^\t]/g," "),r=u[1]||1;l=[`
12 `,s.replace(/\d/g," ")," ",e,"^".repeat(r)].join(""),c&&n&&(l+=" "+n)}return[">",s,t.length>0?` ${t}`:"",l].join("")}).join(`
13`)}(n,{start:r,end:i},s)}${o}`}function tE(t,e){let n="string"==typeof e?` (${e.length>100?`${e.slice(0,100)}\u2026`:e})`:"",r=t.statusMessage?` ${t.statusMessage}`:"";return`${t.method}-request to ${t.url} resulted in HTTP ${t.statusCode}${r}${n}`}class tS extends Error{projectId;addOriginUrl;constructor({projectId:t}){super("CorsOriginError"),this.name="CorsOriginError",this.projectId=t;let e=new URL(`https://sanity.io/manage/project/${t}/api`);if("u">typeof location){let{origin:t}=location;e.searchParams.set("cors","add"),e.searchParams.set("origin",t),this.addOriginUrl=e,this.message=`The current origin is not allowed to connect to the Live Content API. Add it here: ${e}`}else this.message=`The current origin is not allowed to connect to the Live Content API. Change your configuration here: ${e}`}}let tq={onResponse:(t,e)=>{if(t.statusCode>=500)throw new tb(t);if(t.statusCode>=400)throw new tv(t,e);return t}};function tI(t,e={}){return w([F({shouldRetry:tC}),...t,function(t={}){let e={},n=e=>void 0!==t.ignoreWarnings&&(Array.isArray(t.ignoreWarnings)?t.ignoreWarnings:[t.ignoreWarnings]).some(t=>"string"==typeof t?e.includes(t):t instanceof RegExp&&t.test(e));return{onResponse:t=>{let r=t.headers["x-sanity-warning"];for(let t of Array.isArray(r)?r:[r])!t||e[t]||n(t)||(e[t]=!0,console.warn(t));return t}}}(e),{processOptions:t=>{let e=t.body;return!e||"function"==typeof e.pipe||R(e)||-1===k.indexOf(typeof e)&&!Array.isArray(e)&&!function(t){if(!1===T(t))return!1;let e=t.constructor;if(void 0===e)return!0;let n=e.prototype;return!(!1===T(n)||!1===n.hasOwnProperty("isPrototypeOf"))}(e)?t:Object.assign({},t,{body:JSON.stringify(t.body),headers:Object.assign({},t.headers,{"Content-Type":"application/json"})})}},{onResponse:t=>{let e=t.headers["content-type"]||"",n=-1!==e.indexOf("application/json");return t.body&&e&&n?Object.assign({},t,{body:function(t){try{return JSON.parse(t)}catch(t){throw t.message=`Failed to parsed response body as JSON: ${t.message}`,t}}(t.body)}):t},processOptions:t=>Object.assign({},t,{headers:Object.assign({Accept:"application/json"},t.headers)})},{onRequest:t=>{if("xhr"!==t.adapter)return;let e=t.request,n=t.context;function r(t){return e=>{let r=e.lengthComputable?e.loaded/e.total*100:-1;n.channels.progress.publish({stage:t,percent:r,total:e.total,loaded:e.loaded,lengthComputable:e.lengthComputable})}}"upload"in e&&"onprogress"in e.upload&&(e.upload.onprogress=r("upload")),"onprogress"in e&&(e.onprogress=r("download"))}},tq,function(t={}){let e=t.implementation||A.Observable;if(!e)throw Error("`Observable` is not available in global scope, and n
13o implementation was passed");return{onReturn:(t,n)=>new e(e=>(t.error.subscribe(t=>e.error(t)),t.progress.subscribe(t=>e.next(Object.assign({type:"progress"},t))),t.response.subscribe(t=>{e.next(Object.assign({type:"response"},t)),e.complete()}),t.request.publish(n),()=>t.abort.publish()))}}({implementation:z.y})])}function tC(t,e,n){if(0===n.maxRetries)return!1;let r="GET"===n.method||"HEAD"===n.method,i=(n.uri||n.url).startsWith("/data/query"),s=t.response&&(429===t.response.statusCode||502===t.response.statusCode||503===t.response.statusCode);return(!!r||!!i)&&!!s||F.shouldRetry(t,e,n)}function t$(t){return"https://www.sanity.io/help/"+t}let tR=["image","file"],tT=["before","after","replace"],tk=t=>{if(!/^(~[a-z0-9]{1}[-\w]{0,63}|[a-z0-9]{1}[-\w]{0,63})$/.test(t))throw Error("Datasets can only contain lowercase characters, numbers, underscores and dashes, and start with tilde, and be maximum 64 characters")},tO=t=>{if(!/^[-a-z0-9]+$/i.test(t))throw Error("`projectId` can only contain only a-z, 0-9 and dashes")},tA=t=>{if(-1===tR.indexOf(t))throw Error(`Invalid asset type: ${t}. Must be one of ${tR.join(", ")}`)},tj=(t,e)=>{if(null===e||"object"!=typeof e||Array.isArray(e))throw Error(`${t}() takes an object of properties`)},tP=(t,e)=>{if("string"!=typeof e||!/^[a-z0-9_][a-z0-9_.-]{0,127}$/i.test(e)||e.includes(".."))throw Error(`${t}(): "${e}" is not a valid document ID`)},tD=(t,e)=>{if(!e._id)throw Error(`${t}() requires that the document contains an ID ("_id" property)`);tP(t,e._id)},tU=(t,e)=>{if("string"!=typeof e)throw Error(`\`${t}()\`: \`${e}\` is not a valid document type`)},tM=(t,e)=>{if(!e._type)throw Error(`\`${t}()\` requires that the document contains a type (\`_type\` property)`);tU(t,e._type)},tF=(t,e)=>{if(e._id&&e._id!==t)throw Error(`The provided document ID (\`${e._id}\`) does not match the generated version ID (\`${t}\`)`)},tz=(t,e,n)=>{let r="insert(at, selector, items)";if(-1===tT.indexOf(t)){let t=tT.map(t=>`"${t}"`).join(", ");throw Error(`${r} takes an "at"-argument which is one of: ${t}`)}if("string"!=typeof e)throw Error(`${r} takes a "selector"-argument which must be a string`);if(!Array.isArray(n))throw Error(`${r} takes an "items"-argument which must be an array`)},tN=t=>{if(t.dataset)return t.dataset;let e=t.resource;if(e&&"dataset"===e.type){let t=e.id.split(".");if(2!==t.length)throw Error('Dataset resource ID must be in the format "project.dataset"');return t[1]}throw Error("`dataset` must be provided to perform queries")},tL=t=>{if("string"!=typeof t||!/^[a-z0-9._-]{1,75}$/i.test(t))throw Error("Tag can only contain alphanumeric characters, underscores, dashes and dots, and be between one and 75 characters long.");return t},tV=t=>{let e=t.resource;if(!e)throw Error("`resource` must be provided to perform resource queries");let{type:n,id:r}=e;switch(n){case"dataset":if(2!==r.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: ${n.toString()}`)}},tB=(t,e)=>{if(e.resource)throw Error(`\`${t}\` does not support resource-based operations`)},tZ=t=>{var e;let n,r;return e=(...e)=>console.warn(t.join(" "),...e),n=!1,(...t)=>(n||(r=e(...t),n=!0),r)},tH=tZ(["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"]),tW=tZ(["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."]),tX=tZ(["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."]),tJ=tZ(["The `previewDrafts` perspective has been renamed to  `drafts` and will be removed in a future API version"]),tG=tZ(["You have configured Sanity client to use a token in the browser. This may cause unintentional security issues.",`See ${t$("js-client-browser-token")} for more information and how to hide this warning.`]),tY=tZ(["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`."]),tK=tZ(["Using the Sanity client without specifying an API version is deprecated.",`See ${t$("js-client-api-version")}`]),tQ=(tZ(["The default export of @sanity/client has been deprecated. Use the named export `createClient` instead."]),tZ(["You have called `createVersion()` with a defined `document`. The recommended approach is to provide a `baseId` and `releaseId` instead."])),t0=tZ(["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."]),t1={apiHost:"https://api.sanity.io",apiVersion:"1",useProjectHostname:!0,stega:{enabled:!1}},t3=["localhost","127.0.0.1","0.0.0.0"],t6=t=>-1!==t3.indexOf(t);function t9(t){if(Array.isArray(t)&&t.length>1&&t.includes("raw"))throw TypeError('Invalid API perspective value: "raw". The raw-perspective can not be combined with other perspectives')}let t4=(t,e)=>{let n={...e,...t,stega:{..."boolean"==typeof e.stega?{enabled:e.stega}:e.stega||t1.stega,..."boolean"==typeof t.stega?{enabled:t.stega}:t.stega||{}}};n.apiVersion||tK();let r={...t1,...n};r["~experimental_resource"]&&!r.resource&&(t0(),r.resource=r["~experimental_resource"]);let i=r.resource,s=r.useProjectHostname&&!i;if(typeof Promise>"u"){let t=t$("js-client-promise-polyfill");throw Error(`No native Promise-implementation found, polyfill needed - see ${t}`)}if(s&&!r.projectId)throw Error("Configuration must contain `projectId`");if(i&&tV(r),"u">typeof r.perspective&&t9(r.perspective),"encodeSourceMap"in r)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 r)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'?");
13if("boolean"!=typeof r.stega.enabled)throw Error(`stega.enabled must be a boolean, received ${r.stega.enabled}`);if(r.stega.enabled&&void 0===r.stega.studioUrl)throw Error("stega.studioUrl must be defined when stega.enabled is true");if(r.stega.enabled&&"string"!=typeof r.stega.studioUrl&&"function"!=typeof r.stega.studioUrl)throw Error(`stega.studioUrl must be a string or a function, received ${r.stega.studioUrl}`);let o="u">typeof window&&window.location&&window.location.hostname,a=o&&t6(window.location.hostname),u=!!r.token;r.withCredentials&&u&&(tY(),r.withCredentials=!1),o&&a&&u&&!0!==r.ignoreBrowserTokenWarning?tG():typeof r.useCdn>"u"&&tW(),s&&tO(r.projectId),r.dataset&&tk(r.dataset),"requestTagPrefix"in r&&(r.requestTagPrefix=r.requestTagPrefix?tL(r.requestTagPrefix).replace(/\.+$/,""):void 0),r.apiVersion=`${r.apiVersion}`.replace(/^v/,""),r.isDefaultApi=r.apiHost===t1.apiHost,!0===r.useCdn&&r.withCredentials&&tH(),r.useCdn=!1!==r.useCdn&&!r.withCredentials,function(t){if("1"===t||"X"===t)return;let e=new Date(t);if(!(/^\d{4}-\d{2}-\d{2}$/.test(t)&&e instanceof Date&&e.getTime()>0))throw Error("Invalid API version string, expected `1` or date in format `YYYY-MM-DD`")}(r.apiVersion);let c=r.apiHost.split("://",2),l=c[0],d=c[1],f=r.isDefaultApi?"apicdn.sanity.io":d;return s?(r.url=`${l}://${r.projectId}.${d}/v${r.apiVersion}`,r.cdnUrl=`${l}://${r.projectId}.${f}/v${r.apiVersion}`):(r.url=`${r.apiHost}/v${r.apiVersion}`,r.cdnUrl=r.url),r};class t2 extends Error{name="ConnectionFailedError"}
13class t7 extends Error{name="DisconnectError";reason;constructor(t,e,n={}){super(t,n),this.reason=e}}class t5 extends Error{name="ChannelError";data;constructor(t,e){super(t),this.data=e}}class t8 extends Error{name="MessageError";data;constructor(t,e,n={}){super(t,n),this.data=e}}class et extends Error{name="MessageParseError"}let ee=["channelError","disconnect"];function en(t,e){return(0,N.P)(()=>{let e=t();return(0,L.b)(e)?e:(0,V.of)(e)}).pipe((0,B.z)(t=>new z.y(n=>{let r=e.includes("open"),i=e.includes("reconnect");function s(e){if("data"in e){let[t,r]=er(e);n.error(t?new et("Unable to parse EventSource error message",{cause:r}):new t8((r?.data).message,r));return}t.readyState===t.CLOSED?n.error(new t2("EventSource connection failed")):i&&n.next({type:"reconnect"})}function o(){n.next({type:"open"})}function a(e){let[r,i]=er(e);if(r){n.error(new et("Unable to parse EventSource message",{cause:r}));return}if("channelError"===e.type){let e=new URL(t.url).searchParams.get("tag");n.error(new t5(function(t,e){let n=t.error;return n?t_(n)?tx(n,e):n.description?n.description:"string"==typeof n?n:JSON.stringify(n,null,2):t.message||"Unknown listener error"}(i?.data,e),i.data));return}if("disconnect"===e.type){n.error(new t7(`Server disconnected client: ${i.data?.reason||"unknown error"}`));return}n.next({type:e.type,id:e.lastEventId,...i.data?{data:i.data}:{}})}t.addEventListener("error",s),r&&t.addEventListener("open",o);let u=[...new Set([...ee,...e])].filter(t=>"error"!==t&&"open"!==t&&"reconnect"!==t);return u.forEach(e=>t.addEventListener(e,a)),()=>{t.removeEventListener("error",s),r&&t.removeEventListener("open",o),u.forEach(e=>t.removeEventListener(e,a)),t.close()}})))}function er(t){try{let e="string"==typeof t.data&&JSON.parse(t.data);return[null,{type:t.type,id:t.lastEventId,...!function(t){for(let e in t)return!1;return!0}(e)?{data:e}:{}}]}catch(t){return[t,null]}}function ei(t){if("string"==typeof t)return{id:t};if(Array.isArray(t))return{query:"*[_id in $ids]",params:{ids:t}};if("object"==typeof t&&null!==t&&"query"in t&&"string"==typeof t.query)return"params"in t&&"object"==typeof t.params&&null!==t.params?{query:t.query,params:t.params}:{query:t.query};let e=["* Document ID (<docId>)","* Array of document IDs","* Object containing `query`"].join(`
14`);throw Error(`Unknown selection - must be one of:
15
16${e}`)}class es{selection;operations;constructor(t,e={}){this.selection=t,this.operations=e}set(t){return this._assign("set",t)}setIfMissing(t){return this._assign("setIfMissing",t)}diffMatchPatch(t){return tj("diffMatchPatch",t),this._assign("diffMatchPatch",t)}unset(t){if(!Array.isArray(t))throw Error("unset(attrs) takes an array of attributes to unset, non-array given");return this.operations=Object.assign({},this.operations,{unset:t}),this}inc(t){return this._assign("inc",t)}dec(t){return this._assign("dec",t)}insert(t,e,n){return tz(t,e,n),this._assign("insert",{[t]:e,items:n})}append(t,e){return this.insert("after",`${t}[-1]`,e)}prepend(t,e){return this.insert("before",`${t}[0]`,e)}splice(t,e,n,r){let i=e<0?e-1:e,s=typeof n>"u"||-1===n?-1:Math.max(0,e+n),o=`${t}[${i}:${i<0&&s>=0?"":s}]`;return this.insert("replace",o,r||[])}ifRevisionId(t){return this.operations.ifRevisionID=t,this}serialize(){return{...ei(this.selection),...this.operations}}toJSON(){return this.serialize()}reset(){return this.operations={},this}_assign(t,e,n=!0){return tj(t,e),this.operations=Object.assign({},this.operations,{[t]:Object.assign({},n&&this.operations[t]||{},e)}),this}_set(t,e){return this._assign(t,e,!1)}}class eo extends es{#a;constructor(t,e,n){super(t,e),this.#a=n}clone(){return new eo(this.selection,{...this.operations},this.#a)}commit(t){if(!this.#a)throw Error("No `client` passed to patch, either provide one or pass the patch to a clients `mutate()` method");let e=Object.assign({returnFirst:"string"==typeof this.selection,returnDocuments:!0},t);return this.#a.mutate({patch:this.serialize()},e)}}class ea extends es{#a;constructor(t,e,n){super(t,e),this.#a=n}clone(){return new ea(this.selection,{...this.operations},this.#a)}commit(t){if(!this.#a)throw Error("No `client` passed to patch, either provide one or pass the patch to a clients `mutate()` method");let e=Object.assign({returnFirst:"string"==typeof this.selection,returnDocuments:!0},t);return this.#a.mutate({patch:this.serialize()},e)}}let eu={returnDocuments:!1};class ec{operations;trxId;constructor(t=[],e){this.operations=t,this.trxId=e}create(t){return tj("create",t),this._add({create:t})}createIfNotExists(t){let e="createIfNotExists";return tj(e,t),tD(e,t),this._add({[e]:t})}createOrReplace(t){let e="createOrReplace";return tj(e,t),tD(e,t),this._add({[e]:t})}delete(t){return tP("delete",t),this._add({delete:{id:t}})}transactionId(t){return t?(this.trxId=t,this):this.trxId}serialize(){return[...this.operations]}toJSON(){return this.serialize()}reset(){return this.operations=[],this}_add(t){return this.operations.push(t),this}}class el extends ec{#a;constructor(t,e,n){super(t,n),this.#a=e}clone(){return new el([...this.operations],this.#a,this.trxId)}commit(t){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},eu,t||{}))}patch(t,e){let n="function"==typeof e,r="string"!=typeof t&&t instanceof ea,i="object"==typeof t&&("query"in t||"id"in t);if(r)return this._add({patch:t.serialize()});if(n){let n=e(new ea(t,{},this.#a));if(!(n instanceof ea))throw Error("function passed to `patch()` must return the patch");return this._add({patch:n.serialize()})}if(i){let n=new ea(t,e||{},this.#a);return this._add({patch:n.serialize()})}return this._add({patch:{id:t,...e}})}}class ed extends ec{#a;constructor(t,e,n){super(t,n),this.#a=e}clone(){return new ed([...this.operations],this.#a,this.trxId)}commit(t){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},eu,t||{}))}patch(t,e){let n="function"==typeof e;if("string"!=typeof t&&t instanceof eo)return this._add({patch:t.serialize()});if(n){let n=e(new eo(t,{},this.#a));if(!(n instanceof eo))throw Error("function passed to `patch()` must return the patch");return this._add({patch:n.serialize()})}return this._add({patch:{id:t,...e}})}}let ef=({query:t,params:e={},options:n={}})=>{let r=new URLSearchParams,{tag:i,includeMutations:s,returnQuery:o,...a}=n;for(let[n,s]of(i&&r.append("tag",i),r.append("query",t),Object.entries(e)))void 0!==s&&r.append(`$${n}`,JSON.stringify(s));for(let[t,e]of Object.entries(a))e&&r.append(t,`${e}`);return!1===o&&r.append("returnQuery","false"),!1===s&&r.append("includeMutations","fal
16se"),`?${r}`},eh=(t,e)=>!1===t?void 0:typeof t>"u"?e:t,ep=(t={})=>({dryRun:t.dryRun,returnIds:!0,returnDocuments:eh(t.returnDocuments,!0),visibility:t.visibility||"sync",autoGenerateArrayKeys:t.autoGenerateArrayKeys,skipCrossDatasetReferenceValidation:t.skipCrossDatasetReferenceValidation}),ey=t=>"response"===t.type,eg=t=>t.body,em=(t,e)=>t.reduce((t,n)=>(t[e(n)]=n,t),Object.create(null));function ev(t,e,r,i,s={},o={}){let a="stega"in o?{...r||{},..."boolean"==typeof o.stega?{enabled:o.stega}:o.stega||{}}:r,u=a.enabled?(0,ti.NG)(s):s,c=!1===o.filterResponse?t=>t:t=>t.result,{cache:l,next:d,...f}={useAbortSignal:"u">typeof o.signal,resultSourceMap:a.enabled?"withKeyArraySelector":o.resultSourceMap,...o,returnQuery:!1===o.filterResponse&&!1!==o.returnQuery},h=eO(t,e,"query",{query:i,params:u},"u">typeof l||"u">typeof d?{...f,fetch:{cache:l,next:d}}:f);return a.enabled?h.pipe(function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return tf.apply(void 0,(0,ts.ev)([],(0,ts.CR)(t)))}((0,Z.D)(n.e(2793).then(n.bind(n,92793)).then(function(t){return t.stegaEncodeSourceMap$1}).then(({stegaEncodeSourceMap:t})=>t))),(0,tn.U)(([t,e])=>{let n=e(t.result,t.resultSourceMap,a);return c({...t,result:n})})):h.pipe((0,tn.U)(c))}function eb(t,e,n,r={}){let i={uri:eV(t,"doc",(()=>{if(!r.releaseId)return n;let t=(0,tp.eB)(n);if(!t){if((0,tp.Cb)(n))throw Error(`The document ID (\`${n}\`) is a draft, but \`options.releaseId\` is set as \`${r.releaseId}\``);return(0,tp.XL)(n,r.releaseId)}if(t!==r.releaseId)throw Error(`The document ID (\`${n}\`) is already a version of \`${t}\` release, but this does not match the provided \`options.releaseId\` (\`${r.releaseId}\`)`);return n})()),json:!0,tag:r.tag,signal:r.signal,query:void 0!==r.includeAllVersions?{includeAllVersions:r.includeAllVersions}:void 0};return eN(t,e,i).pipe((0,th.h)(ey),(0,tn.U)(t=>{let e=t.body.documents;return e?r.includeAllVersions?e:e[0]:r.includeAllVersions?[]:void 0}))}function ew(t,e,n,r={}){let i={uri:eV(t,"doc",n.join(",")),json:!0,tag:r.tag,signal:r.signal};return eN(t,e,i).pipe((0,th.h)(ey),(0,tn.U)(t=>{let e=em(t.body.documents||[],t=>t._id);return n.map(t=>e[t]||null)}))}function e_(t,e,n,r={}){return eO(t,e,"query",{query:"*[sanity::partOfRelease($releaseId)]",params:{releaseId:n}},r)}function ex(t,e,n,r){return tD("createIfNotExists",n),eA(t,e,n,"createIfNotExists",r)}function eE(t,e,n,r){return tD("createOrReplace",n),eA(t,e,n,"createOrReplace",r)}function eS(t,e,n,r,i){return tD("createVersion",n),tM("createVersion",n),tQ(),ek(t,e,{actionType:"sanity.action.document.version.create",publishedId:r,document:n},i)}function eq(t,e,n,r,i,s,o){if(!r)throw Error("`createVersion()` requires `baseId` when no `document` is provided");if(!n)throw Error("`createVersion()` requires `publishedId` when `baseId` is provided");return tP("createVersion",r),tP("createVersion",n),ek(t,e,{actionType:"sanity.action.document.version.create",publishedId:n,baseId:r,versionId:i?(0,tp.XL)(n,i):(0,tp.qy)(n),ifBaseRevisionId:s},o)}function eI(t,e,n,r){return eO(t,e,"mutate",{mutations:[{delete:ei(n)}]},r)}function eC(t,e,n,r=!1,i){return ek(t,e,{actionType:"sanity.action.document.version.discard",versionId:n,purge:r},i)}function e$(t,e,n,r){return tD("replaceVersion",n),tM("replaceVersion",n),ek(t,e,{actionType:"sanity.action.document.version.replace",document:n},r)}function eR(t,e,n,r,i){return ek(t,e,{actionType:"sanity.action.document.version.unpublish",versionId:n,publishedId:r},i)}function eT(t,e,n,r){let i;return eO(t,e,"mutate",{mutations:Array.isArray(i=n instanceof ea||n instanceof eo?{patch:n.serialize()}:n instanceof el||n instanceof ed?n.serialize():n)?i:[i],transactionId:r&&r.transactionId||void 0},r)}function ek(t,e,n,r){let i=Array.isArray(n)?n:[n];return eO(t,e,"actions",{actions:i,transactionId:r&&r.transactionId||void 0,skipCrossDatasetReferenceValidation:r&&r.skipCrossDatasetReferenceValidation||void 0,dryRun:r&&r.dryRun||void 0},r)}function eO(t,e,n,r,i={}){let s="mutate"===n,o="actions"===n,a=s||o?"":ef(r),u=!s&&!o&&a.length<11264,c=i.returnFirst,{timeout:l,token:d,tag:f,headers:h,returnQuery:p,lastLiveEventId:y,cacheMode:g}=i,m=eV(t,n,u?a:"");return eN(t,e,{method:u?"GET":"POST",uri:m,json:!0,body:u?void 0:r,query:s&&ep(i),timeout:l,headers:h,token:d,tag:f,returnQuery:p,perspective:i.perspective,resultSourceMap:i.resultSourceMap,lastLiveEventId:Array.isArray(y)?y[0]:y,cacheMode:g,canUseCdn:"query"===n,signal:i.signal,fetch:i.fetch,useAbortSignal:i.useAbortSignal,useCdn:i.useCdn}).pipe((0,th.h)(ey),(0,tn.U)(eg),(0,tn.U)(t=>{if(!s)return t;let e=t.results||[];if(i.returnDocuments)return c?e[0]&&e[0].document:e.map(t=>t.document);let n=c?e[0]&&e[0].id:e.map(t=>
16t.id);return{transactionId:t.transactionId,results:e,[c?"documentId":"documentIds"]:n}}))}function eA(t,e,n,r,i={}){return eO(t,e,"mutate",{mutations:[{[r]:n}]},Object.assign({returnFirst:!0,returnDocuments:!0},i))}let ej=t=>{let e=t.config();return void 0!==e.dataset&&void 0!==e.projectId||void 0!==e.resource},eP=(t,e)=>ej(t)&&e.startsWith(eV(t,"query")),eD=(t,e)=>ej(t)&&e.startsWith(eV(t,"mutate")),eU=(t,e)=>ej(t)&&e.startsWith(eV(t,"doc","")),eM=(t,e)=>ej(t)&&e.startsWith(eV(t,"listen")),eF=(t,e)=>ej(t)&&e.startsWith(eV(t,"history","")),ez=(t,e)=>e.startsWith("/data/")||eP(t,e)||eD(t,e)||eU(t,e)||eM(t,e)||eF(t,e);function eN(t,e,n){var r;let i=n.url||n.uri,s=t.config(),o=typeof n.canUseCdn>"u"?["GET","HEAD"].indexOf(n.method||"GET")>=0&&ez(t,i):n.canUseCdn,a=(n.useCdn??s.useCdn)&&o,u=n.tag&&s.requestTagPrefix?[s.requestTagPrefix,n.tag].join("."):n.tag||s.requestTagPrefix;if(u&&null!==n.tag&&(n.query={tag:tL(u),...n.query}),["GET","HEAD","POST"].indexOf(n.method||"GET")>=0&&eP(t,i)){let t=n.resultSourceMap??s.resultSourceMap;void 0!==t&&!1!==t&&(n.query={resultSourceMap:t,...n.query});let e=n.perspective||s.perspective;"u">typeof e&&("previewDrafts"===e&&tJ(),t9(e),n.query={perspective:Array.isArray(e)?e.join(","):e,...n.query},(Array.isArray(e)&&e.length>0||"previewDrafts"===e||"drafts"===e)&&a&&(a=!1,tX())),n.lastLiveEventId&&(n.query={...n.query,lastLiveEventId:n.lastLiveEventId}),!1===n.returnQuery&&(n.query={returnQuery:"false",...n.query}),a&&"noStale"==n.cacheMode&&(n.query={cacheMode:"noStale",...n.query})}let c=function(t,e={}){let n={};t.headers&&Object.assign(n,t.headers);let r=e.token||t.token;r&&(n.Authorization=`Bearer ${r}`),e.useGlobalApi||t.useProjectHostname||!t.projectId||(n["X-Sanity-Project-ID"]=t.projectId);let i=!!(typeof e.withCredentials>"u"?t.withCredentials:e.withCredentials),s=typeof e.timeout>"u"?t.timeout:e.timeout;return Object.assign({},e,{headers:Object.assign({},n,e.headers||{}),timeout:typeof s>"u"?3e5:s,proxy:e.proxy||t.proxy,json:!0,withCredentials:i,fetch:"object"==typeof e.fetch&&"object"==typeof t.fetch?{...t.fetch,...e.fetch}:e.fetch||t.fetch})}(s,Object.assign({},n,{url:eB(t,i,a)})),l=new z.y(t=>e(c,s.requester).subscribe(t));return n.signal?l.pipe((r=n.signal,t=>new z.y(e=>{let n=()=>e.error(function(t){if(eZ)return new DOMException(t?.reason??"The operation was aborted.","AbortError");let e=Error(t?.reason??"The operation was aborted.");return e.name="AbortError",e}(r));if(r&&r.aborted){n();return}let i=t.subscribe(e);return r.addEventListener("abort",n),()=>{r.removeEventListener("abort",n),i.unsubscribe()}}))):l}function eL(t,e,n){return eN(t,e,n).pipe((0,th.h)(t=>"response"===t.type),(0,tn.U)(t=>t.body))}function eV(t,e,n){let r=t.config();if(r.resource){tV(r);let t=eH(r),i=void 0!==n?`${e}/${n}`:e;return`${t}/${i}`.replace(/\/($|\?)/,"$1")}let i=tN(r),s=`/${e}/${i}`;return`/data${void 0!==n?`${s}/${n}`:s}`.replace(/\/($|\?)/,"$1")}function eB(t,e,n=!1){let{url:r,cdnUrl:i}=t.config();return`${n?i:r}/${e.replace(/^\//,"")}`}let eZ=!!globalThis.DOMException,eH=t=>{let e=t.resource;if(!e)throw Error("`resource` must be provided to perform resource queries");let{type:n,id:r}=e;switch(n){case"dataset":{let t=r.split(".");if(2!==t.length)throw Error('Dataset ID must be in the format "project.dataset"');return`/projects/${t[0]}/datasets/${t[1]}`}case"canvas":return`/canvases/${r}`;case"media-library":return`/media-libraries/${r}`;case"dashboard":return`/dashboards/${r}`;default:throw Error(`Unsupported resource type: ${n.toString()}`)}};function eW(t,e,n){let r=tN(t.config());return eL(t,e,{method:"POST",uri:`/agent/action/generate/${r}`,body:n})}function eX(t,e,n){let r=tN(t.config());return eL(t,e,{method:"POST",uri:`/agent/action/transform/${r}`,body:n})}function eJ(t,e,n){let r=tN(t.config());return eL(t,e,{method:"POST",uri:`/agent/action/translate/${r}`,body:n})}class eG{#a;#u;constructor(t,e){this.#a=t,this.#u=e}generate(t){return eW(this.#a,this.#u,t)}transform(t){return eX(this.#a,this.#u,t)}translate(t){return eJ(this.#a,this.#u,t)}}class eY{#a;#u;constructor(t,e){this.#a=t,this.#u=e}generate(t){return(0,H.n)(eW(this.#a,this.#u,t))}transform(t){return(0,H.n)(eX(this.#a,this.#u,t))}translate(t){return(0,H.n)(eJ(this.#a,this.#u,t))}prompt(t){return(0,H.n)(function(t,e,n){let r=tN(t.config());return eL(t,e,{method:"POST",uri:`/agent/action/prompt/${r}`,body:n})}(this.#a,this.#u,t))}patch(t){return(0,H.n)(function(t,e,n){let r=tN(t.config());return eL(t,e,{method:"POST",uri:`/agent/action/patch/${r}`,body:n})}(this.#a,this.#u,t))}}class eK{#a;#u;
16constructor(t,e){this.#a=t,this.#u=e}upload(t,e,n){return e0(this.#a,this.#u,t,e,n)}}class eQ{#a;#u;constructor(t,e){this.#a=t,this.#u=e}upload(t,e,n){let r=e0(this.#a,this.#u,t,e,n);return(0,H.n)(r.pipe((0,th.h)(t=>"response"===t.type),(0,tn.U)(t=>t.body.document)))}}function e0(t,e,n,r,i={}){tA(n);let s=i.extract||void 0;s&&!s.length&&(s=["none"]);let o=t.config(),a=!(typeof File>"u")&&r instanceof File?Object.assign({filename:!1===i.preserveFilename?void 0:r.name,contentType:r.type},i):i,{tag:u,label:c,title:l,description:d,creditLine:f,filename:h,source:p}=a,y=o.resource?.type==="media-library",g=y?{title:l,filename:h}:{label:c,title:l,description:d,filename:h,meta:s,creditLine:f};return p&&!y&&(g.sourceId=p.id,g.sourceName=p.name,g.sourceUrl=p.url),eN(t,e,{tag:u,method:"POST",timeout:a.timeout||0,uri:function(t,e){let n="image"===e?"images":"files",r=t.resource;if(r){let{type:t,id:e}=r;switch(t){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/${e}/assets/${n}`;case"media-library":return`/media-libraries/${e}/upload`;case"dashboard":return`/dashboards/${e}/assets/${n}`;default:throw Error(`Unsupported resource type: ${t.toString()}`)}}let i=tN(t);return`assets/${n}/${i}`}(o,n),headers:a.contentType?{"Content-Type":a.contentType}:{},query:g,body:r})}var e1=(t,e)=>Object.keys(e).concat(Object.keys(t)).reduce((n,r)=>(n[r]=typeof t[r]>"u"?e[r]:t[r],n),{});let e3=(t,e)=>e.reduce((e,n)=>(typeof t[n]>"u"||(e[n]=t[n]),e),{}),e6=(0,N.P)(()=>n.e(7424).then(n.t.bind(n,17424,19))).pipe((0,tn.U)(({default:t})=>t),(0,W.d)(1));function e9(){return function(t){return t.pipe((0,X.K)((t,e)=>t instanceof t2?(0,J.z)((0,V.of)({type:"reconnect"}),(0,G.H)(1e3).pipe((0,B.z)(()=>e))):(0,Y._)(()=>t)))}}let e4=["includePreviousRevision","includeResult","includeMutations","includeAllVersions","visibility","effectFormat","enableResume","tag"],e2={includeResult:!0};function e7(t,e,n={}){let{url:r,token:i,withCredentials:s,requestTagPrefix:o,headers:a}=this.config(),u=n.tag&&o?[o,n.tag].join("."):n.tag,c={...e1(n,e2),tag:u},l=ef({query:t,params:e,options:{tag:u,...e3(c,e4)}}),d=`${r}${eV(this,"listen",l)}`;if(d.length>14800)return(0,Y._)(()=>Error("Query too large for listener"));let f=c.events?c.events:["mutation"],h={};return s&&(h.withCredentials=!0),(i||a)&&(h.headers={},i&&(h.headers.Authorization=`Bearer ${i}`),a&&Object.assign(h.headers,a)),en(()=>(typeof EventSource>"u"||h.headers?e6:(0,V.of)(EventSource)).pipe((0,tn.U)(t=>new t(d,h))),f).pipe(e9(),(0,th.h)(t=>f.includes(t.type)),(0,tn.U)(t=>({type:t.type,..."data"in t?t.data:{}})))}let e5="2021-03-25";class e8{#a;constructor(t){this.#a=t}events({includeDrafts:t=!1,tag:e}={}){var n,r,i;let{projectId:s,apiVersion:o,token:a,withCredentials:u,requestTagPrefix:c,headers:l}=this.#a.config(),d=o.replace(/^v/,"");if("X"!==d&&d<e5)throw Error(`The live events API requires API version ${e5} or later. The current API version is ${d}. Please update your API version to use this feature.`);if(t&&!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 f=eV(this.#a,"live/events"),h=new URL(this.#a.getUrl(f,!1)),p=e&&c?[c,e].join("."):e;p&&h.searchParams.set("tag",p),t&&h.searchParams.set("includeDrafts","true");let y={};t&&u&&(y.withCredentials=!0),(t&&a||l)&&(y.headers={},t&&a&&(y.headers.Authorization=`Bearer ${a}`),l&&Object.assign(y.headers,l));let g=`${h.href}::${JSON.stringify(y)}`,m=nt.get(g);if(m)return m;let v=en(()=>(typeof EventSource>"u"||y.headers?e6:(0,V.of)(EventSource)).pipe((0,tn.U)(t=>new t(h.href,y))),["message","restart","welcome","reconnect","goaway"]),b=(r={method:"OPTIONS",mode:"cors",credentials:y.withCredentials?"include":"omit",headers:y.headers},new z.y(t=>{let e=new AbortController,n=e.signal;return fetch(h,{...r,signal:e.signal}).then(e=>{t.next(e),t.complete()},e=>{n.aborted||t.error(e)}),()=>e.abort()})).pipe((0,X.K)(()=>{throw new tS({projectId:s})})),w=v.pipe(e9(),(0,B.z)(t=>"reconnect"===t.type?b.pipe((0,B.z)(()=>(0,V.of)(t))):(0,V.of)(t)),(0,X.K)(t=>b.pipe((0,B.z)(()=>{throw t}))),(0,tn.U)(t=>{if("message"===t.type){let{data:e,...n}=t;return{...n,tags:e.tags}}return t})).pipe((0,Q.x)(()=>nt.delete(g)),(i="function"==typeof(n={predicate:t=>"welcome"===t.type})?{predicate:n}:n,t=>{let e,n=!1,{predicate:r,...s}=i,o=t.pipe((0,K.b)(t=>{i.predicate(t)&&(n=!0,e=t)}),(0,Q.x)(()=>{n=!1,e=void 0}),(0,tt.B)(s)),a=new z.y(t=>{n&&t.next(e),t.complete()});return(0,te.T)(o,a)}));return nt.set(g,w),w}}
16let nt=new Map;class ne{#a;#u;constructor(t,e){this.#a=t,this.#u=e}create(t,e){return ni(this.#a,this.#u,"PUT",t,e)}edit(t,e){return ni(this.#a,this.#u,"PATCH",t,e)}delete(t){return ni(this.#a,this.#u,"DELETE",t)}list(){tB("dataset",this.#a.config());let t=this.#a.config(),e=t.projectId,n="/datasets";return!1===t.useProjectHostname&&(n=`/projects/${e}/datasets`),eL(this.#a,this.#u,{uri:n,tag:null})}getEmbeddingsSettings(t){return tB("dataset",this.#a.config()),tk(t),eL(this.#a,this.#u,{uri:nr(this.#a,t),tag:null})}editEmbeddingsSettings(t,e){return tB("dataset",this.#a.config()),tk(t),eL(this.#a,this.#u,{method:"PUT",uri:nr(this.#a,t),body:e,tag:null})}}class nn{#a;#u;constructor(t,e){this.#a=t,this.#u=e}create(t,e){return tB("dataset",this.#a.config()),(0,H.n)(ni(this.#a,this.#u,"PUT",t,e))}edit(t,e){return tB("dataset",this.#a.config()),(0,H.n)(ni(this.#a,this.#u,"PATCH",t,e))}delete(t){return tB("dataset",this.#a.config()),(0,H.n)(ni(this.#a,this.#u,"DELETE",t))}list(){tB("dataset",this.#a.config());let t=this.#a.config(),e=t.projectId,n="/datasets";return!1===t.useProjectHostname&&(n=`/projects/${e}/datasets`),(0,H.n)(eL(this.#a,this.#u,{uri:n,tag:null}))}getEmbeddingsSettings(t){return tB("dataset",this.#a.config()),tk(t),(0,H.n)(eL(this.#a,this.#u,{uri:nr(this.#a,t),tag:null}))}editEmbeddingsSettings(t,e){return tB("dataset",this.#a.config()),tk(t),(0,H.n)(eL(this.#a,this.#u,{method:"PUT",uri:nr(this.#a,t),body:e,tag:null}))}}function nr(t,e){let n=t.config();return!1===n.useProjectHostname?`/projects/${n.projectId}/datasets/${e}/settings/embeddings`:`/datasets/${e}/settings/embeddings`}function ni(t,e,n,r,i){return tB("dataset",t.config()),tk(r),eL(t,e,{method:n,uri:`/datasets/${r}`,body:i,tag:null})}class ns{#a;#u;constructor(t,e){this.#a=t,this.#u=e}getPlaybackInfo(t,e={}){let n=this.#a.config(),r=(n.resource||n["~experimental_resource"])?.id,{instanceId:i,libraryId:s}=function(t){let e="object"==typeof t&&"_ref"in t?t._ref:t,n=na.exec(e);if(n){let[,t,e]=n;return{libraryId:t,instanceId:e}}if("string"==typeof t&&t.startsWith("video-"))return{instanceId:t};throw Error(`Invalid video asset instance identifier "${e}": must be a valid video instance id or a Global Dataset Reference (GDR) to the video asset in the Media Library`)}(t),o=s||r;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(t){let e={};if(t.transformations){let{thumbnail:n,animated:r,storyboard:i}=t.transformations;n&&(n.width&&(e.thumbnailWidth=n.width),n.height&&(e.thumbnailHeight=n.height),void 0!==n.time&&(e.thumbnailTime=n.time),n.fit&&(e.thumbnailFit=n.fit),n.format&&(e.thumbnailFormat=n.format)),r&&(r.width&&(e.animatedWidth=r.width),r.height&&(e.animatedHeight=r.height),void 0!==r.start&&(e.animatedStart=r.start),void 0!==r.end&&(e.animatedEnd=r.end),r.fps&&(e.animatedFps=r.fps),r.format&&(e.animatedFormat=r.format)),i&&i.format&&(e.storyboardFormat=i.format)}return t.expiration&&(e.expiration=t.expiration),e}(e);return eL(this.#a,this.#u,{method:"GET",uri:a,query:u})}}class no{#a;#u;constructor(t,e){this.#a=t,this.#u=e}getPlaybackInfo(t,e={}){return(0,H.n)(new ns(this.#a.observable,this.#u).getPlaybackInfo(t,e))}}let na=/^media-library:(ml[^:]+):([^:]+)$/;class nu{#a;#u;constructor(t,e){this.#a=t,this.#u=e}list(t){let e={};return t?.includeMembers===!1&&(e.includeMembers="false"),t?.organizationId&&(e.organizationId=t.organizationId),eL(this.#a,this.#u,{uri:"/projects",query:e})}getById(t){return eL(this.#a,this.#u,{uri:`/projects/${t}`})}}class nc{#a;#u;constructor(t,e){this.#a=t,this.#u=e}list(t){let e={};return t?.includeMembers===!1&&(e.includeMembers="false"),t?.organizationId&&(e.organizationId=t.organizationId),(0,H.n)(eL(this.#a,this.#u,{uri:"/projects",query:e}))}getById(t){return(0,H.n)(eL(this.#a,this.#u,{uri:`/projects/${t}`}))}}let nl=(0,ty.kP)("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789",8),nd=(t,e)=>e?(0,tp.XL)(t,e):(0,tp.qy)(t);function nf(t,{releaseId:e,publishedId:n,document:r}
16){if(n&&r._id){let t=nd(n,e);return tF(t,r),t}if(r._id){let n=(0,tp.Cb)(r._id),i=(0,tp.Y_)(r._id);if(!n&&!i)throw Error(`\`${t}()\` requires a document with an \`_id\` that is a version or draft ID`);if(e){if(n)throw Error(`\`${t}()\` was called with a document ID (\`${r._id}\`) that is a draft ID, but a release ID (\`${e}\`) was also provided.`);let i=(0,tp.eB)(r._id);if(i!==e)throw Error(`\`${t}()\` was called with a document ID (\`${r._id}\`) that is a version ID, but the release ID (\`${e}\`) does not match the document's version ID (\`${i}\`).`)}return r._id}if(n)return nd(n,e);throw Error(`\`${t}()\` requires either a publishedId or a document with an \`_id\``)}let nh=(t,e)=>{if("object"==typeof t&&null!==t&&("releaseId"in t||"metadata"in t)){let{releaseId:n=nl(),metadata:r={}}=t;return[n,r,e]}return[nl(),{},t]},np=(t,e)=>{let[n,r,i]=nh(t,e);return{action:{actionType:"sanity.action.release.create",releaseId:n,metadata:{...r,releaseType:r.releaseType||"undecided"}},options:i}};class ny{#a;#u;constructor(t,e){this.#a=t,this.#u=e}get({releaseId:t},e){return eb(this.#a,this.#u,`_.releases.${t}`,e)}create(t,e){let{action:n,options:r}=np(t,e),{releaseId:i,metadata:s}=n;return ek(this.#a,this.#u,n,r).pipe((0,tn.U)(t=>({...t,releaseId:i,metadata:s})))}edit({releaseId:t,patch:e},n){return ek(this.#a,this.#u,{actionType:"sanity.action.release.edit",releaseId:t,patch:e},n)}publish({releaseId:t},e){return ek(this.#a,this.#u,{actionType:"sanity.action.release.publish",releaseId:t},e)}archive({releaseId:t},e){return ek(this.#a,this.#u,{actionType:"sanity.action.release.archive",releaseId:t},e)}unarchive({releaseId:t},e){return ek(this.#a,this.#u,{actionType:"sanity.action.release.unarchive",releaseId:t},e)}schedule({releaseId:t,publishAt:e},n){return ek(this.#a,this.#u,{actionType:"sanity.action.release.schedule",releaseId:t,publishAt:e},n)}unschedule({releaseId:t},e){return ek(this.#a,this.#u,{actionType:"sanity.action.release.unschedule",releaseId:t},e)}delete({releaseId:t},e){return ek(this.#a,this.#u,{actionType:"sanity.action.release.delete",releaseId:t},e)}fetchDocuments({releaseId:t},e){return e_(this.#a,this.#u,t,e)}}class ng{#a;#u;constructor(t,e){this.#a=t,this.#u=e}get({releaseId:t},e){return(0,H.n)(eb(this.#a,this.#u,`_.releases.${t}`,e))}async create(t,e){let{action:n,options:r}=np(t,e),{releaseId:i,metadata:s}=n;return{...await (0,H.n)(ek(this.#a,this.#u,n,r)),releaseId:i,metadata:s}}edit({releaseId:t,patch:e},n){return(0,H.n)(ek(this.#a,this.#u,{actionType:"sanity.action.release.edit",releaseId:t,patch:e},n))}publish({releaseId:t},e){return(0,H.n)(ek(this.#a,this.#u,{actionType:"sanity.action.release.publish",releaseId:t},e))}archive({releaseId:t},e){return(0,H.n)(ek(this.#a,this.#u,{actionType:"sanity.action.release.archive",releaseId:t},e))}unarchive({releaseId:t},e){return(0,H.n)(ek(this.#a,this.#u,{actionType:"sanity.action.release.unarchive",releaseId:t},e))}schedule({releaseId:t,publishAt:e},n){return(0,H.n)(ek(this.#a,this.#u,{actionType:"sanity.action.release.schedule",releaseId:t,publishAt:e},n))}unschedule({releaseId:t},e){return(0,H.n)(ek(this.#a,this.#u,{actionType:"sanity.action.release.unschedule",releaseId:t},e))}delete({releaseId:t},e){return(0,H.n)(ek(this.#a,this.#u,{actionType:"sanity.action.release.delete",releaseId:t},e))}fetchDocuments({releaseId:t},e){return(0,H.n)(e_(this.#a,this.#u,t,e))}}class nm{#a;#u;constructor(t,e){this.#a=t,this.#u=e}getById(t){return eL(this.#a,this.#u,{uri:`/users/${t}`})}}class nv{#a;#u;constructor(t,e){this.#a=t,this.#u=e}getById(t){return(0,H.n)(eL(this.#a,this.#u,{uri:`/users/${t}`}))}}class nb{assets;datasets;live;mediaLibrary;projects;users;agent;releases;#c;#u;listen=e7;constructor(t,e=t1){this.config(e),this.#u=t,this.assets=new eK(this,this.#u),this.datasets=new ne(this,this.#u),this.live=new e8(this),this.mediaLibrary={video:new ns(this,this.#u)},this.projects=new nu(this,this.#u),this.users=new nm(this,this.#u),this.agent={action:new eG(this,this.#u)},this.releases=new ny(this,this.#u)}clone(){return new nb(this.#u,this.config())}config(t){if(void 0===t)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=t4(t,this.#c||{}),this}withConfig(t){let e=this.config();return new nb(this.#u,{...e,...t,stega:{...e.stega||{},..."boolean"==typeof t?.stega?{enabled:t.stega}:t?.stega||{}}})}fetch(t,e,n){return ev(this,this.#u,this.#c.stega,t,e,n)}getDocument(t,e){if(e?.includeAllVersions===!0)return eb(this,this.#u,t,{...e,includeAllVersions:!0});let n={signal:e?.signal,tag:e?.tag,releaseId:e?.releaseId,...e&&"includeAllVersions"in e?{includeAllVersions:!1}:{}};return eb(this,this.#u,t,n)}getDocuments(t,e){return ew(this,this.#u,t,e)}create(t,e){return eA(this,this.#u,t,"create",e)}createIfNotExists(t,e){return ex(this,this.#u,t,e)}createOrReplace(t,e){return eE(this,this.#u,t,e)}createVersion({document:t,publishedId:e,releaseId:n,baseId:r,ifBaseRevisionId:i},s){if(!t)return eq(this,this.#u,e,r,n,i,s);let o=nf("createVersion",{document:t,publishedId:e,releaseId:n}),a={...t,_id:o},u=e||(0,tp.vs)(t._id);return eS(this,this.#u,a,u,s)}delete(t,e){return eI(this,this.#u,t,e)}discardVersion({releaseId:t,publishedId:e},n,r){let i=nd(e,t);return eC(this,this.#u,i,n,r)}replaceVersion({document:t,publishedId:e,releaseId:n},r){let i=nf("replaceVersion",{document:t,publishedId:e,releaseId:n}),s={...t,_id:i};return e$(this,this.#u,s,r)}unpublishVersion({releaseId:t,publishedId:e},n){let r=(0,tp.XL)(e,t);return eR(this,this.#u,r,e,n)}mutate(t,e){return eT(this,this.#u,t,e)}patch(t,e){return new eo(t,e,this)}transaction(t){return new ed(t,this)}action(t,e){return ek(this,this.#u,t,e)}request(t){return eL(this,this.#u,t)}getUrl(t,e){return eB(this,t,e)}getDataUrl(t,e){return eV(this,t,e)}}class nw{assets;datasets;live;mediaLibrary;projects;users;agent;releases;observable;#c;#u;listen=e7;constructor(t,e=t1){this.config(e),this.#u=t,this.assets=new eQ(this,this.#u),this.datasets=new nn(this,this.#u),this.live=new e8(this),this.mediaLibrary={video:new no(this,this.#u)}
16,this.projects=new nc(this,this.#u),this.users=new nv(this,this.#u),this.agent={action:new eY(this,this.#u)},this.releases=new ng(this,this.#u),this.observable=new nb(t,e)}clone(){return new nw(this.#u,this.config())}config(t){if(void 0===t)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(t),this.#c=t4(t,this.#c||{}),this}withConfig(t){let e=this.config();return new nw(this.#u,{...e,...t,stega:{...e.stega||{},..."boolean"==typeof t?.stega?{enabled:t.stega}:t?.stega||{}}})}fetch(t,e,n){return(0,H.n)(ev(this,this.#u,this.#c.stega,t,e,n))}getDocument(t,e){if(e?.includeAllVersions===!0)return(0,H.n)(eb(this,this.#u,t,{...e,includeAllVersions:!0}));let n={signal:e?.signal,tag:e?.tag,releaseId:e?.releaseId,...e&&"includeAllVersions"in e?{includeAllVersions:!1}:{}};return(0,H.n)(eb(this,this.#u,t,n))}getDocuments(t,e){return(0,H.n)(ew(this,this.#u,t,e))}create(t,e){return(0,H.n)(eA(this,this.#u,t,"create",e))}createIfNotExists(t,e){return(0,H.n)(ex(this,this.#u,t,e))}createOrReplace(t,e){return(0,H.n)(eE(this,this.#u,t,e))}createVersion({document:t,publishedId:e,releaseId:n,baseId:r,ifBaseRevisionId:i},s){if(!t)return(0,tr.z)(eq(this,this.#u,e,r,n,i,s));let o=nf("createVersion",{document:t,publishedId:e,releaseId:n}),a={...t,_id:o},u=e||(0,tp.vs)(t._id);return(0,tr.z)(eS(this,this.#u,a,u,s))}delete(t,e){return(0,H.n)(eI(this,this.#u,t,e))}discardVersion({releaseId:t,publishedId:e},n,r){let i=nd(e,t);return(0,H.n)(eC(this,this.#u,i,n,r))}replaceVersion({document:t,publishedId:e,releaseId:n},r){let i=nf("replaceVersion",{document:t,publishedId:e,releaseId:n}),s={...t,_id:i};return(0,tr.z)(e$(this,this.#u,s,r))}unpublishVersion({releaseId:t,publishedId:e},n){let r=(0,tp.XL)(e,t);return(0,H.n)(eR(this,this.#u,r,e,n))}mutate(t,e){return(0,H.n)(eT(this,this.#u,t,e))}patch(t,e){return new ea(t,e,this)}transaction(t){return new el(t,this)}action(t,e){return(0,H.n)(ek(this,this.#u,t,e))}request(t){return(0,H.n)(eL(this,this.#u,t))}dataRequest(t,e,n){return(0,H.n)(eO(this,this.#u,t,e,n))}getUrl(t,e){return eB(this,t,e)}getDataUrl(t,e){return eV(this,t,e)}}let n_={requester:tI(f=[]),createClient:t=>{let e=tI(f,{ignoreWarnings:t.ignoreWarnings});return new nw((n,r)=>(r||e)({maxRedirects:0,maxRetries:t.maxRetries,retryDelay:t.retryDelay,lineage:t.lineage,...n}),t)}},nx=(n_.requester,n_.createClient)},15066:function(t,e,n){n.d(e,{yK:function(){return C},Hq:function(){return T},ei:function(){return A},bK:function(){return k},Ol:function(){return O},UE:function(){return R},Ag:function(){return $},XK:function(){return U},E0:function(){return N},F8:function(){return I},dS:function(){return V},zB:function(){return L},lB:function(){return P}});var r=n(55222),i=n(41553),s=n(97375),o=n(17716),a=n(52499),u=n(61987),c=n(31940),l=n(34748),d=n(26112),f=n(78853),h=n(22631),p=n(96164),y=n(78717),g=n(24311),m=n(71856),v=n(74592),b=n(2861),w=n(41748),_=n(73265);let x=t=>({context:e})=>{let{count:n,include:r,exclude:i,responseType:s="message.received"}=t;return{count:n,domain:e.domain,from:e.connectTo,include:r?Array.isArray(r)?r:[r]:[],exclude:i?Array.isArray(i)?i:[i]:[],responseType:s,target:e.target,to:e.name}},E=t=>e=>{let{data:n}=e;return(!t.include.length||t.include.includes(n.type))&&(!t.exclude.length||!t.exclude.includes(n.type))&&n.domain===t.domain&&n.from===t.from&&n.to===t.to&&(!t.target||e.source===t.target)},S=t=>e=>({type:t,message:e}),q=(0,c.P)(()=>(0,l.R)(window,"message")),I=t=>(0,i.Y$)(({input:e})=>{var n,r;return q.pipe(t?(0,d.U)(t):(0,f.z)(),(0,h.h)(E(e)),(0,d.U)(S(e.responseType)),e.count?(0,f.z)((n=e.count,void 0===r&&(r=null),r=null!=r?r:n,(0,y.e)(function(t,e){var i=[],s=0;t.subscribe((0,g.x)(e,function(t){var o,a,u,c,l=null;s++%r==0&&i.push([]);try{for(var d=(0,p.XA)(i),f=d.next();!f.done;f=d.next()){var h=f.value;h.push(t),n<=h.length&&(l=null!=l?l:[]).push(h)}}catch(t){o={error:t}}finally{try{f&&!f.done&&(a=d.return)&&a.call(d)}finally{if(o)throw o.error}}if(l)try{for(var y=(0,p.XA)(l),g=y.next();!g.done;g=y.next()){var h=g.value;(0,m.P)(i,h),e.next(h)}}catch(t){u={error:t}}finally{try{g&&!g.done&&(c=y.return)&&c.call(y)}finally{if(u)throw u.error}}},function(){var t,n;try{for(var r=(0,p.XA)(i),s=r.next();!s.done;s=r.next()){var o=s.value;e.next(o)}}catch(e){t={error:e}}finally{try{s&&!s.done&&(n=r.return)&&n.call(r)}finally{if(t)throw t.error}}e.complete()},void 0,function(){i=null}))})),(0,v.b)(t=>t),(0,b.q)(e.count)):(0,f.z)())}),C="sanity/comlink",$="comlink/response",R="comlink/heartbeat",T="comlink/disconnect",k="comlink/handshake/syn",O="comlink/handshake/syn-ack",A="
16comlink/handshake/ack",j=t=>e=>e.pipe((0,b.q)(1),(0,d.U)(()=>{throw Error(t)})),P=()=>(0,s.cY)({types:{},actors:{listen:(0,i.Y$)(({input:t})=>{let e=t.signal?(0,l.R)(t.signal,"abort").pipe(j(`Request ${t.requestId} aborted`)):w.E;return(0,l.R)(window,"message").pipe((0,h.h)(e=>e.data?.type===$&&e.data?.responseTo===t.requestId&&!!e.source&&t.sources.has(e.source)),(0,b.q)(t.sources.size),(0,_.R)(e))})},actions:{"send message":({context:t},e)=>{let{sources:n,targetOrigin:r}=t,{message:i}=e;n.forEach(t=>{t.postMessage(i,{targetOrigin:r})})},"on success":(0,o.s)(({context:t})=>t.parentRef,({context:t,self:e})=>(t.response&&t.resolvable?.resolve(t.response),{type:"request.success",requestId:e.id,response:t.response,responseTo:t.responseTo})),"on fail":(0,o.s)(({context:t})=>t.parentRef,({context:t,self:e})=>(t.suppressWarnings||console.warn(`[@sanity/comlink] Received no response to message '${t.type}' on client '${t.from}' (ID: '${t.id}').`),t.resolvable?.reject(Error("No response received")),{type:"request.failed",requestId:e.id})),"on abort":(0,o.s)(({context:t})=>t.parentRef,({context:t,self:e})=>(t.resolvable?.reject(Error("Request aborted")),{type:"request.aborted",requestId:e.id}))},guards:{expectsResponse:({context:t})=>t.expectResponse},delays:{initialTimeout:0,responseTimeout:({context:t})=>t.responseTimeout??3e3}}).createMachine({context:({input:t})=>({channelId:t.channelId,data:t.data,domain:t.domain,expectResponse:t.expectResponse??!1,from:t.from,id:`msg-${(0,r.Z)()}`,parentRef:t.parentRef,resolvable:t.resolvable,response:null,responseTimeout:t.responseTimeout,responseTo:t.responseTo,signal:t.signal,sources:t.sources instanceof Set?t.sources:new Set([t.sources]),suppressWarnings:t.suppressWarnings,targetOrigin:t.targetOrigin,to:t.to,type:t.type}),initial:"idle",on:{abort:".aborted"},states:{idle:{after:{initialTimeout:[{target:"sending"}]}},sending:{entry:{type:"send message",params:({context:t})=>{let{channelId:e,data:n,domain:r,from:i,id:s,responseTo:o,to:a,type:u}=t;return{message:{channelId:e,data:n,domain:r,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:t})=>({requestId:t.id,sources:t.sources,signal:t.signal}),onError:"aborted"},after:{responseTimeout:"failed"},on:{message:{actions:(0,a.a)({response:({event:t})=>t.data.data,responseTo:({event:t})=>t.data.responseTo}),target:"success"}}},failed:{type:"final",entry:"on fail"},success:{type:"final",entry:"on success"},aborted:{type:"final",entry:"on abort"}},output:({context:t,self:e})=>({requestId:e.id,response:t.response,responseTo:t.responseTo})}),D=(0,i.E9)(({sendBack:t,input:e})=>{let n=()=>{t(e.event)};e.immediate&&n();let r=setInterval(n,e.interval);return()=>{clearInterval(r)}}),U=()=>(0,s.cY)({types:{},actors:{requestMachine:P(),listen:I(),sendBackAtInterval:D},actions:{"buffer message":(0,o.e)(({enqueue:t})=>{t.assign({buffer:({event:t,context:e})=>((0,s.ZD)(t,"post"),[...e.buffer,t.data])}),t.emit(({event:t})=>((0,s.ZD)(t,"post"),{type:"buffer.added",message:t.data}))}),"create request":(0,a.a)({requests:({context:t,event:e,self:n,spawn:i})=>{(0,s.ZD)(e,"request");let o=(Array.isArray(e.data)?e.data:[e.data]).map(e=>i("requestMachine",{id:`req-${(0,r.Z)()}`,input:{channelId:t.channelId,data:e.data,domain:t.domain,expectResponse:e.expectResponse,from:t.name,parentRef:n,responseTo:e.responseTo,sources:t.target,targetOrigin:t.targetOrigin,to:t.connectTo,type:e.type}}));return[...t.requests,...o]}}),"emit received message":(0,o.e)(({enqueue:t})=>{t.emit(({event:t})=>((0,s.ZD)(t,"message.received"),{type:"message",message:t.message.data}))}),"emit status":(0,o.a)((t,e)=>({type:"status",status:e.status})),"post message":(0,u.r)(({event:t})=>((0,s.ZD)(t,"post"),{type:"request",data:{data:t.data.data,expectResponse:!0,type:t.data.type}})),"remove request":(0,o.e)(({context:t,enqueue:e,event:n})=>{(0,s.ZD)(n,["request.success","request.failed","request.aborted"]),(0,u.s)(n.requestId),e.assign({requests:t.requests.filter(({id:t})=>t!==n.requestId)})}),respond:(0,u.r)(({event:t})=>((0,s.ZD)(t,"response"),{type:"request",data:{data:t.data,type:$,responseTo:t.respondTo}})),"send handshake ack":(0,u.r)({type:"request",data:{type:A}}),"send disconnect":(0,u.r)(()=>({type:"request",data:{type:T}})),"send handshake syn":(0,u.r)({type:"request",data:{type:k}}),"send pending messages":(0,o.e)(({enqueue:t})=>{t.raise(({context:t})=>({type:"request",data:t.buffer.map(({data:t,type:e})=>({data:t,type:e}))})),t.emit(({context:t})=>({type:"buffer.flushed",messages:t.buffer})),t.assign({buffer:[]})}),"set target":(0,a.a)({target:({event:t})=>((0,s.ZD)(t,"target.set"),t.target)})},guards:{"has target":({context:t})=>!!t.target,"should send heartbeats":({context:t})=>t.heartbeat}}).createMachine({id:"connection",context:({input:t})=>({id:t.id||`${t.name}-${(0,r.Z)()}`,buffer:[],channelId:`chn-${(0,r.Z)()}`,connectTo:t.connectTo,domain:t.domain??C,heartbeat:t.heartbeat??!1,name:t.name,requests:[],target:t.target,targetOrigin:t.targetOrigin}),on:{"target.set":{actions:"set target"},"request.success":{actions:"remove request"},"request.failed":{actions:"remove request"}}
16,initial:"idle",states:{idle:{entry:[{type:"emit status",params:{status:"idle"}}],on:{connect:{target:"handshaking",guard:"has target"},post:{actions:"buffer message"}}},handshaking:{id:"handshaking",entry:[{type:"emit status",params:{status:"handshaking"}}],invoke:[{id:"send syn",src:"sendBackAtInterval",input:()=>({event:{type:"syn"},interval:500,immediate:!0})},{id:"listen for handshake",src:"listen",input:t=>x({include:O,count:1})(t)}],on:{syn:{actions:"send handshake syn"},request:{actions:"create request"},post:{actions:"buffer message"},"message.received":{target:"connected"},disconnect:{target:"disconnected"}},exit:"send handshake ack"},connected:{entry:["send pending messages",{type:"emit status",params:{status:"connected"}}],invoke:{id:"listen for messages",src:"listen",input:x({exclude:[$,R]})},on:{post:{actions:"post message"},request:{actions:"create request"},response:{actions:"respond"},"message.received":{actions:"emit received message"},disconnect:{target:"disconnected"}},initial:"heartbeat",states:{heartbeat:{initial:"checking",states:{checking:{always:{guard:"should send heartbeats",target:"sending"}},sending:{on:{"request.failed":{target:"#handshaking"}},invoke:{id:"send heartbeat",src:"sendBackAtInterval",input:()=>({event:{type:"post",data:{type:R,data:void 0}},interval:2e3,immediate:!1})}}}}}},disconnected:{id:"disconnected",entry:["send disconnect",{type:"emit status",params:{status:"disconnected"}}],on:{request:{actions:"create request"},post:{actions:"buffer message"},connect:{target:"handshaking",guard:"has target"}}}}}),M=(t,e=U())=>{let n=t.id||`${t.name}-${(0,r.Z)()}
16`,i=(0,u.c)(e,{input:{...t,id:n}}),s=new Map,o=new Map;i.on("message",async({message:t})=>{let e=s.get(t.type);if(e){e.forEach(async e=>{let n=await e(t.data);n&&i.send({type:"response",respondTo:t.id,data:n})});return}let n=o.get(t.type);n?n.add(t):o.set(t.type,new Set([t]))});let a=()=>{i.stop()};return{actor:i,connect:()=>{i.send({type:"connect"})},disconnect:()=>{i.send({type:"disconnect"})},id:n,name:t.name,machine:e,on:(t,e,n)=>{let r=s.get(t)||new Set;s.has(t)||s.set(t,r),r.add(e);let a=o.get(t);if(a){let r=n?.replay??1;Array.from(a).slice(-r).forEach(async({data:t,id:n})=>{let r=await e(t);r&&i.send({type:"response",respondTo:n,data:r})}),o.delete(t)}return()=>{r.delete(e)}},onStatus:(t,e)=>{let n=i.on("status",n=>{e&&n.status!==e||t(n.status)});return()=>n.unsubscribe()},post:(t,e)=>{i.send({type:"post",data:{type:t,data:e}})},setTarget:t=>{i.send({type:"target.set",target:t})},start:()=>(i.start(),a),stop:a,get target(){return i.getSnapshot().context.target}}},F=t=>{t.disconnect(),setTimeout(()=>{t.stop()},0)},z=()=>{},N=t=>{let{targetOrigin:e}=t,n=new Set,r=new Set;return{addTarget:t=>{if(n.has(t))return z;if(!n.size||!r.size)return n.add(t),r.forEach(e=>{e.connections.forEach(e=>{e.setTarget(t),e.connect()})}),()=>{n.delete(t),r.forEach(e=>{e.connections.forEach(e=>{e.target===t&&e.disconnect()})})};n.add(t);let i=new Set;return r.forEach(n=>{let r=M({...n.input,target:t,targetOrigin:e},n.machine);i.add(r),n.connections.add(r),n.subscribers.forEach(({type:t,handler:e,unsubscribers:n})=>{n.push(r.on(t,e))}),n.internalEventSubscribers.forEach(({type:t,handler:e,unsubscribers:n})=>{let i=r.actor.on(t,e);n.push(()=>i.unsubscribe())}),n.statusSubscribers.forEach(({handler:t,unsubscribers:e})=>{e.push(r.onStatus(e=>t({connection:r.id,status:e})))}),r.start(),r.connect()}),()=>{n.delete(t),i.forEach(t=>{F(t),r.forEach(e=>{e.connections.delete(t)})})}},createChannel:(t,i=U())=>{let s={connections:new Set,input:t,internalEventSubscribers:new Set,machine:i,statusSubscribers:new Set,subscribers:new Set};r.add(s);let{connections:o,internalEventSubscribers:a,statusSubscribers:u,subscribers:c}=s;if(n.size)n.forEach(n=>{let r=M({...t,target:n,targetOrigin:e},i);o.add(r)});else{let n=M({...t,targetOrigin:e},i);o.add(n)}let l=()=>{let t=s.connections;t.forEach(F),t.clear(),r.delete(s)};return{on:(t,e)=>{let n=[];o.forEach(r=>{n.push(r.on(t,e))});let r={type:t,handler:e,unsubscribers:n};return c.add(r),()=>{n.forEach(t=>t()),c.delete(r)}},onInternalEvent:(t,e)=>{let n=[];o.forEach(r=>{let i=r.actor.on(t,e);n.push(()=>i.unsubscribe())});let r={type:t,handler:e,unsubscribers:n};return a.add(r),()=>{n.forEach(t=>t()),a.delete(r)}},onStatus:t=>{let e=[];o.forEach(n=>{e.push(n.onStatus(e=>t({connection:n.id,status:e})))});let n={handler:t,unsubscribers:e};return u.add(n),()=>{e.forEach(t=>t()),u.delete(n)}},post:(...t)=>{let[e,n]=t;o.forEach(t=>{t.post(e,n)})},start:()=>(o.forEach(t=>{t.start(),t.connect()}),l),stop:l}},destroy:()=>{r.forEach(({connections:t})=>{t.forEach(F),t.clear()}),r.clear(),n.clear()}}},L=()=>(0,s.cY)({types:{},actors:{requestMachine:P(),listen:I()},actions:{"buffer handshake":(0,a.a)({handshakeBuffer:({event:t,context:e})=>((0,s.ZD)(t,"message.received"),[...e.handshakeBuffer,t])}),"buffer message":(0,o.e)(({enqueue:t})=>{t.assign({buffer:({event:t,context:e})=>((0,s.ZD)(t,"post"),[...e.buffer,{data:t.data,resolvable:t.resolvable,options:t.options}])}),t.emit(({event:t})=>((0,s.ZD)(t,"post"),{type:"buffer.added",message:t.data}))}),"create request":(0,a.a)({requests:({context:t,event:e,self:n,spawn:i})=>{(0,s.ZD)(e,"request");let o=(Array.isArray(e.data)?e.data:[e.data]).map(e=>i("requestMachine",{id:`req-${(0,r.Z)()}`,input:{channelId:t.channelId,data:e.data,domain:t.domain,expectResponse:e.expectResponse,from:t.name,parentRef:n,resolvable:e.resolvable,responseTimeout:e.options?.responseTimeout,responseTo:e.responseTo,signal:e.options?.signal,sources:t.target,suppressWarnings:e.options?.suppressWarnings,targetOrigin:t.targetOrigin,to:t.connectTo,type:e.type}}));return[...t.requests,...o]}}),"emit heartbeat":(0,o.a)(()=>({type:"heartbeat"})),"emit received message":(0,o.e)(({enqueue:t})=>{t.emit(({event:t})=>((0,s.ZD)(t,"message.received"),{type:"message",message:t.message.data}))}),"emit status":(0,o.a)((t,e)=>({type:"status",status:e.status})),"post message":(0,u.r)(({event:t})=>((0,s.ZD)(t,"post"),{type:"request",data:{data:t.data.data,expectResponse:!!t.resolvable,type:t.data.type,resolvable:t.resolvable,options:t.options}})),"process pending handshakes":(0,o.e)(({context:t,enqueue:e})=>{t.handshakeBuffer.forEach(t=>e.raise(t)),e.assign({handshakeBuffer:[]})}),"remove request":(0,o.e)(({context:t,enqueue:e,event:n})=>{(0,s.ZD)(n,["request.success","request.failed","request.aborted"]),(0,u.s)(n.requestId),e.assign({requests:t.requests.filter(({id:t})=>t!==n.requestId)})}),"send response":(0,u.r)(({event:t})=>((0,s.ZD)(t,["message.received","heartbeat.received"]),{type:"request",data:{type:$,responseTo:t.message.data.id,data:void 0}})),"send handshake syn ack":(0,u.r)({type:"request",data:{type:O}}),"send pending messages":(0,o.e)(({enqueue:t})=>{t.raise(({context:t})=>({type:"request",data:t.buffer.map(({data:t,resolvable:e,options:n})=>({data:t.data,type:t.type,expectResponse:!!e,resolvable:e,options:n}))})),t.emit(({context:t})=>({type:"buffer.flushed",messages:t.buffer.map(({data:t})=>t)})),t.assign({buffer:[]})}),"set connection config":(0,a.a)({channelId:({event:t})=>((0,s.ZD)(t,"handshake.syn"),t.message.data.channelId),target:({event:t})=>((0,s.ZD)(t,"handshake.syn"),t.message.source||void 0),targetOrigin:({event:t})=>((0,s.ZD)(t,"handshake.syn"),t.message.origin)})},guards:{hasSource:({context:t})=>null!==t.target}}).createMachine({id:"node",context:({input:t})=>({buffer:[],channelId:null,connectTo:t.connectTo,domain:t.domain??C,handshakeBuffer:[],name:t.name,requests:[],target:void 0,targetOrigin:null}),invoke:{id:"listen for handshake syn",src:"listen",input:x({include:k,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"}}
16,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:x({include:A,count:1,responseType:"handshake.complete"}),onDone:"connected"},{id:"listen for disconnect",src:"listen",input:x({include:T,count:1,responseType:"disconnect"})},{id:"listen for messages",src:"listen",input:x({exclude:[T,k,A,R,$]})}],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:x({exclude:[T,k,A,R,$]})},{id:"listen for heartbeat",src:"listen",input:x({include:R,responseType:"heartbeat.received"})},{id:"listen for disconnect",src:"listen",input:x({include:T,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"]}}}}}),V=(t,e=L())=>{let n;
16let r=(0,u.c)(e,{input:t}),i=new Map,s=new Map;r.on("message",({message:t})=>{let e=i.get(t.type);if(e){e.forEach(e=>e(t.data));return}let n=s.get(t.type);n?n.add(t):s.set(t.type,new Set([t]))});let o=()=>{r.stop()};return{actor:r,fetch:(t,e,n)=>{let i,s;let{responseTimeout:o=1e4,signal:a,suppressWarnings:u}=n||{},c="function"==typeof Promise.withResolvers?Promise.withResolvers():{promise:new Promise((t,e)=>{i=t,s=e}),resolve:i,reject:s};return r.send({type:"post",data:{type:t,data:e},resolvable:c,options:{responseTimeout:o,signal:a,suppressWarnings:u}}),c.promise},machine:e,on:(t,e,n)=>{let r=i.get(t)||new Set;i.has(t)||i.set(t,r),r.add(e);let o=s.get(t);if(o){let r=n?.replay??1;Array.from(o).slice(-r).forEach(({data:t})=>e(t)),s.delete(t)}return()=>{r.delete(e)}},onStatus:(t,e)=>{let i=r.on("status",r=>{n=r.status,e&&r.status!==e||t(r.status)});return n&&t(n),()=>i.unsubscribe()},post:(t,e)=>{r.send({type:"post",data:{type:t,data:e}})},start:()=>(r.start(),o),stop:o}}},36642:function(t,e,n){n.d(e,{kP:function(){return s},x0:function(){return o}});let r=t=>crypto.getRandomValues(new Uint8Array(t)),i=(t,e,n)=>{let r=(2<<Math.log(t.length-1)/Math.LN2)-1,i=-~(1.6*r*e/t.length);return (s=e)=>{let o="";for(;;){let e=n(i),a=0|i;for(;a--;)if((o+=t[e[a]&r]||"").length===s)return o}}},s=(t,e=21)=>i(t,e,r),o=(t=21)=>crypto.getRandomValues(new Uint8Array(t)).reduce((t,e)=>((e&=63)<36?t+=e.toString(36):e<62?t+=(e-26).toString(36).toUpperCase():e>62?t+="-":t+="_",t),"")},96164:function(t,e,n){n.d(e,{CR:function(){return c},FC:function(){return f},Jh:function(){return a},KL:function(){return h},XA:function(){return u},ZT:function(){return i},ev:function(){return l},mG:function(){return o},pi:function(){return s},qq:function(){return d}});var r=function(t,e){return(r=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)};function i(t,e){if("function"!=typeof e&&null!==e)throw TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}var s=function(){return(s=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t}).apply(this,arguments)};function o(t,e,n,r){return new(n||(n=Promise))(function(i,s){function o(t){try{u(r.next(t))}catch(t){s(t)}}function a(t){try{u(r.throw(t))}catch(t){s(t)}}function u(t){var e;t.done?i(t.value):((e=t.value)instanceof n?e:new n(function(t){t(e)})).then(o,a)}u((r=r.apply(t,e||[])).next())})}function a(t,e){var n,r,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(n)throw TypeError("Generator is already executing.");for(;o&&(o=0,a[0]&&(s=0)),s;)try{if(n=1,r&&(i=2&a[0]?r.return:a[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,a[1])).done)return i;switch(r=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++,r=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=e.call(t,s)}catch(t){a=[6,t],r=0}finally{n=i=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,u])}}}function u(t){var e="function"==typeof Symbol&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function c(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,s=n.call(t),o=[];try{for(;(void 0===e||e-- >0)&&!(r=s.next()).done;)o.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=s.return)&&n.call(s)}finally{if(i)throw i.error}}return o}function l(t,e,n){if(n||2==arguments.length)for(var r,i=0,s=e.length;i<s;i++)!r&&i in e||(r||(r=Array.prototype.slice.call(e,0,i)),r[i]=e[i]);return t.concat(r||Array.prototype.slice.call(e))}function d(t){return this instanceof d?(this.v=t,this):new d(t)}function f(t,e,n){if(!Symbol.asyncIterator)throw TypeError("Symbol.asyncIterator is not defined.");var r,i=n.apply(t,e||[]),s=[];return r=Object.create(("function"==typeof AsyncIterator?AsyncIterator:Object).prototype),o("next"),o("throw"),o("return",function(t){return function(e){return Promise.resolve(e).then(t,c)}}),r[Symbol.asyncIterator]=function(){return this},r;function o(t,e){i[t]&&(r[t]=function(e){return new Promise(function(n,r){s.push([t,e,n,r])>1||a(t,e)})},e&&(r[t]=e(r[t])))}function a(t,e){try{var n;(n=i[t](e)).value instanceof d?Promise.resolve(n.value.v).then(u,c):l(s[0][2],n)}catch(t){l(s[0][3],t)}}function u(t){a("next",t)}function c(t){a("throw",t)}function l(t,e){t(e),s.shift(),s.length&&a(s[0][0],s[0][1])}}function h(t){if(!Symbol.asyncIterator)throw TypeError("Symbol.asyncIterator is not defined.");var e,n=t[Symbol.asyncIterator];return n?n.call(t):(t=u(t),e={},r("next"),r("throw"),r("return"),e[Symbol.asyncIterator]=function(){return this},e);function r(n){e[n]=t[n]&&function(e){return new Promise(function(r,i){!function(t,e,n,r){Promise.resolve(r).then(function(e){t({value:e,done:n})},e)}(r,i,(e=t[n](e)).done,e.value)})}}}"function"==typeof SuppressedError&&SuppressedError},68859:function(t,e,n){n.d(e,{i:function(){return a}});var r=n(99743);let i=r.createContext(!0);function s(){throw Error("A function wrapped in useEffectEvent can't be called during rendering.")}let o=()=>{try{return r.use(i)}catch{return!1}};function a(t){let e=r.useRef(s);return r.useInsertionEffect(()=>{e.current=t},[t]),(...t)=>(o()&&s(),(0,e.current)(...t))}},55222:function(t,e,n){let r;n.d(e,{Z:function(){return a}});var i={randomUUID:"undefined"!=typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};let s=new Uint8Array(16),o=[];for(let t=0;t<256;++t)o.push((t+256).toString(16).slice(1));var a=function(t,e,n){if(i.randomUUID&&!e&&!t)return i.randomUUID();let a=(t=t||{}).random??t.rng?.()??function(){if(!r){if("undefined"==typeof crypto||!crypto.getRandomValues)throw Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");r=crypto.getRandomValues.bind(crypto)}return r(s)}();if(a.length<16)throw Error("Random bytes length must be >= 16");if(a[6]=15&a[6]|64,a[8]=63&a[8]|128,e){if((n=n||0)<0||n+16>e.length)throw RangeError(`UUID byte range ${n}:${n+15} is out of buffer bounds`);for(let t=0;t<16;++t)e[n+t]=a[t];return e}return function(t,e=0){return(o[t[e+0]]+o[t[e+1]]+o[t[e+2]]+o[t[e+3]]+"-"+o[t[e+4]]+o[t[e+5]]+"-"+o[t[e+6]]+o[t[e+7]]+"-"+o[t[e+8]]+o[t[e+9]]+"-"+o[t[e+10]]+o[t[e+11]]+o[t[e+12]]+o[t[e+13]]+o[t[e+14]]+o[t[e+15]]).toLowerCase()}(a)}}}]);

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.