PageSourceSearch

https://static.run/_next/static/chunks/4850-7787ed454895af6b.js

js static.run collected 2026-09-29 23:09:49 UTC 157,512 bytes, 16 lines download raw bytes

1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[4850],{1253:(e,t,r)=>{r.d(t,{Kn:()=>u,yU:()=>a,Uv:()=>c});var n=r(60827),s=r(5251),i=(0,r(46137).L)(function(e){return function(t){e(this),this.message=t?t.length+" errors occurred during unsubscription:\n"+t.map(function(e,t){return t+1+") "+e.toString()}).join("\n  "):"",this.name="UnsubscriptionError",this.errors=t}}),o=r(61278),a=function(){var e;function t(e){this.initialTeardown=e,this.closed=!1,this._parentage=null,this._finalizers=null}return t.prototype.unsubscribe=function(){if(!this.closed){this.closed=!0;var e,t,r,o,a,u=this._parentage;if(u)if(this._parentage=null,Array.isArray(u))try{for(var c=(0,n.Ju)(u),h=c.next();!h.done;h=c.next())h.value.remove(this)}catch(t){e={error:t}}finally{try{h&&!h.done&&(t=c.return)&&t.call(c)}finally{if(e)throw e.error}}else u.remove(this);var d=this.initialTeardown;if((0,s.T)(d))try{d()}catch(e){a=e instanceof i?e.errors:[e]}var p=this._finalizers;if(p){this._finalizers=null;try{for(var f=(0,n.Ju)(p),y=f.next();!y.done;y=f.next()){var g=y.value;try{l(g)}catch(e){a=null!=a?a:[],e instanceof i?a=(0,n.fX)((0,n.fX)([],(0,n.zs)(a)),(0,n.zs)(e.errors)):a.push(e)}}}catch(e){r={error:e}}finally{try{y&&!y.done&&(o=f.return)&&o.call(f)}finally{if(r)throw r.error}}}if(a)throw new i(a)}},t.prototype.add=function(e){var r;if(e&&e!==this)if(this.closed)l(e);else{if(e instanceof t){if(e.closed||e._hasParent(this))return;e._addParent(this)}(this._finalizers=null!=(r=this._finalizers)?r:[]).push(e)}},t.prototype._hasParent=function(e){var t=this._parentage;return t===e||Array.isArray(t)&&t.includes(e)},t.prototype._addParent=function(e){var t=this._parentage;this._parentage=Array.isArray(t)?(t.push(e),t):t?[t,e]:e},t.prototype._removeParent=function(e){var t=this._parentage;t===e?this._parentage=null:Array.isArray(t)&&(0,o.o)(t,e)},t.prototype.remove=function(e){var r=this._finalizers;r&&(0,o.o)(r,e),e instanceof t&&e._removeParent(this)},(e=new t).closed=!0,t.EMPTY=e,t}(),u=a.EMPTY;function c(e){return e instanceof a||e&&"closed"in e&&(0,s.T)(e.remove)&&(0,s.T)(e.add)&&(0,s.T)(e.unsubscribe)}function l(e){(0,s.T)(e)?e():e.unsubscribe()}},1807:(e,t,r)=>{r.d(t,{a:()=>a,b:()=>p,e:()=>y,l:()=>m,s:()=>d});var n=r(30701),s=r(79216);function i(e,t,r,n,{event:s}){return[t,{event:"function"==typeof s?s(r,n):s},void 0]}function o(e,{event:t}){e.defer(()=>e.emit(t))}function a(e){function t(e,t){}return t.type="xstate.emit",t.event=e,t.resolve=i,t.execute=o,t}let u=function(e){return e.Parent="#_parent",e.Internal="#_internal",e}({});function c(e,t,r,n,{to:s,event:i,id:o,delay:a},c){let l,h,d=t.machine.implementations.delays;if("string"==typeof i)throw Error(`Only event objects may be used with sendTo; use sendTo({ type: "${i}" }) instead`);let p="function"==typeof i?i(r,n):i;if("string"==typeof a){let e=d&&d[a];l="function"==typeof e?e(r,n):e}else l="function"==typeof a?a(r,n):a;let f="function"==typeof s?s(r,n):s;if("string"==typeof f){if(!(h=f===u.Parent?e.self._parent:f===u.Internal?e.self:f.startsWith("#_")?t.children[f.slice(2)]:c.deferredActorIds?.includes(f)?f:t.children[f]))throw Error(`Unable to send event to actor '${f}' from machine '${t.machine.id}'.`)}else h=f||e.self;return[t,{to:h,targetId:"string"==typeof f?f:void 0,event:p,id:o,delay:l},void 0]}function l(e,t,r){"string"==typeof r.to&&(r.to=t.children[r.to])}function h(e,t){e.defer(()=>{let{to:r,event:s,delay:i,id:o}=t;if("number"==typeof i)return void e.system.scheduler.schedule(e.self,r,s,i,o);e.system._relay(e.self,r,s.type===n.Y?(0,n.Z)(e.self.id,s.data):s)})}function d(e,t,r){function n(e,t){}return n.type="xstate.sendTo",n.to=e,n.event=t,n.id=r?.id,n.delay=r?.delay,n.resolve=c,n.retryResolve=l,n.execute=h,n}function p(e,t){return d(u.Parent,e,t)}function f(e,t,r,i,{collect:o}){let u=[],c=function(e){u.push(e)};return c.assign=(...e)=>{u.push((0,s.a)(...e))},c.cancel=(...e)=>{u.push((0,n.b)(...e))},c.raise=(...e)=>{u.push((0,n.r)(...e))},c.sendTo=(...e)=>{u.push(d(...e))},c.sendParent=(...e)=>{u.push(p(...e))},c.spawnChild=(...e)=>{u.push((0,n.d)(...e))},c.stopChild=(...e)=>{u.push((0,n.s)(...e))},c.emit=(...e)=>{u.push(a(...e))},o({context:r.context,event:r.event,enqueue:c,check:e=>(0,n.E)(e,t.context,r.event,t),self:e.self,system:e.system},i),[t,void 0,u]}function y(e){function t(e,t){}return t.type="xstate.enqueueActions",t.collect=e,t.resolve=f,t}function g(e,t,r,n,{value:s,label:i}){return[t,{value:"function"==typeof s?s(r,n):s,label:i},void 0]}function v({logger:e},{value:t,label:r}){r?e(r,t):e(t)}function m(e=({context:e,event:t})=>({context:e,event:t}),t){function r(e,t){}return r.type="xstate.log",r.value=e,r.label=t,r.resolve=g,r.execute=v,r}},2599:(e,t,r)=>{r.d(t,{W:()=>function e(t){return(0,i.N)(function(r,i){var o,a=null,u=!1;a=r.subscribe((0,s._)(i,void 0,void 0,function(s){o=(0,n.Tg)(t(s,e(t)(r))),a?(a.unsubscribe(),a=null,o.subscribe(i)):u=!0})),u&&(a.unsubscribe(),a=null,o.subscribe(i))})}});var n=r(67060),s=r(85473),i=r(8482)},3607:(e,t,r)=>{r.d(t,{L:()=>n});function n(e){return TypeError("You provided "+(null!==e&&"object"==typeof e?"an invali
1d object":"'"+e+"'")+" where a stream was expected. You can provide an Observable, Promise, ReadableStream, Array, AsyncIterable, or Iterable.")}},3689:(e,t,r)=>{r.d(t,{DT:()=>d,mj:()=>function e({schemas:t,actors:r,actions:i,guards:o,delays:a}){return{assign:s.a,sendTo:h.s,raise:n.r,log:h.l,cancel:n.b,stopChild:n.s,enqueueActions:h.e,emit:h.a,spawnChild:n.d,createStateConfig:e=>e,createAction:e=>e,createMachine:e=>new l({...e,schemas:t},{actors:r,actions:i,guards:o,delays:a}),extend:n=>e({schemas:t,actors:r,actions:{...i,...n.actions},guards:{...o,...n.guards},delays:{...a,...n.delays}})}}});var n=r(30701),s=r(79216);let i=new WeakMap;function o(e,t,r){let n=i.get(e);return n?t in n||(n[t]=r()):(n={[t]:r()},i.set(e,n)),n[t]}let a={},u=e=>"string"==typeof e?{type:e}:"function"==typeof e?"resolve"in e?{type:e.type}:{type:e.name}:e;class c{constructor(e,t){if(this.config=e,this.key=void 0,this.id=void 0,this.type=void 0,this.path=void 0,this.states=void 0,this.history=void 0,this.entry=void 0,this.exit=void 0,this.parent=void 0,this.machine=void 0,this.meta=void 0,this.output=void 0,this.order=-1,this.description=void 0,this.tags=[],this.transitions=void 0,this.always=void 0,this.parent=t._parent,this.key=t._key,this.machine=t._machine,this.path=this.parent?this.parent.path.concat(this.key):[],this.id=this.config.id||[this.machine.id,...this.path].join(n.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,n.z)(this.config.states,(e,t)=>new c(e,{_parent:this,_key:t,_machine:this.machine})):a,"compound"===this.type&&!this.config.initial)throw Error(`No initial state specified for compound state node "#${this.id}". Try adding { initial: "${Object.keys(this.states)[0]}" } to the state config.`);this.history=!0===this.config.history?"shallow":this.config.history||!1,this.entry=(0,n.t)(this.config.entry).slice(),this.exit=(0,n.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,n.t)(e.tags).slice()}_initialize(){this.transitions=(0,n.B)(this),this.config.always&&(this.always=(0,n.C)(this.config.always).map(e=>(0,n.D)(this,n.N,e))),Object.keys(this.states).forEach(e=>{this.states[e]._initialize()})}get definition(){return{id:this.id,key:this.key,version:this.machine.version,type:this.t
1ype,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(e=>`#${e.id}`),source:`#${this.id}`,actions:this.initial.actions.map(u),eventType:null})}:void 0,history:this.history,states:(0,n.z)(this.states,e=>e.definition),on:this.on,transitions:[...this.transitions.values()].flat().map(e=>({...e,actions:e.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,n.t)(this.config.invoke).map((e,t)=>{let{src:r,systemId:s}=e,i=e.id??(0,n.F)(this.id,t),o="string"==typeof r?r:`xstate.invoke.${(0,n.F)(this.id,t)}`;return{...e,src:o,id:i,systemId:s,toJSON(){let{onDone:t,onError:r,...n}=e;return{...n,type:"xstate.invoke",src:o,id:i}}}}))}get on(){return o(this,"on",()=>[...this.transitions].flatMap(([e,t])=>t.map(t=>[e,t])).reduce((e,[t,r])=>(e[t]=e[t]||[],e[t].push(r),e),{}))}get after(){return o(this,"delayedTransitions",()=>(0,n.G)(this))}get initial(){return o(this,"initial",()=>(0,n.H)(this,this.config.initial))}next(e,t){let r,s=t.type,i=[];for(let a of o(this,`candidates-${s}`,()=>(0,n.I)(this,s))){let{guard:o}=a,u=e.context,c=!1;try{c=!o||(0,n.E)(o,u,t,e)}catch(t){let e="string"==typeof o?o:"object"==typeof o?o.type:void 0;throw Error(`Unable to evaluate guard ${e?`'${e}' `:""}in transition for event '${s}' in state node '${this.id}':
2${t.message}`)}if(c){i.push(...a.actions),r=a;break}}return r?[r]:void 0}get events(){return o(this,"events",()=>{let{states:e}=this,t=new Set(this.ownEvents);if(e)for(let r of Object.keys(e)){let n=e[r];if(n.states)for(let e of n.events)t.add(`${e}`)}return Array.from(t)})}get ownEvents(){return Array.from(new Set(Object.keys(Object.fromEntries(this.transitions)).filter(e=>this.transitions.get(e).some(e=>!(!e.target&&!e.actions.length&&!e.reenter)))))}}class l{constructor(e,t){this.config=e,this.version=void 0,this.schemas=void 0,this.implementations=void 0,this.options=void 0,this.__xstatenode=!0,this.idMap=new Map,this.root=void 0,this.id=void 0,this.states=void 0,this.events=void 0,this.id=e.id||"(machine)",this.implementations={actors:t?.actors??{},actions:t?.actions??{},delays:t?.delays??{},guards:t?.guards??{}},this.version=this.config.version,this.schemas=this.config.schemas,this.options={maxIterations:1/0,...this.config.options},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(e,{_key:this.id,_machine:this}),this.root._initialize(),(0,n.J)(this.root),this.states=this.root.states,this.events=this.root.events}provide(e){let{actions:t,guards:r,actors:n,delays:s}=this.implementations;return new l(this.config,{actions:{...t,...e.actions},guards:{...r,...e.guards},actors:{...n,...e.actors},delays:{...s,...e.delays}})}resolveState(e){let t=(0,n.K)(this.root,e.value),r=(0,n.L)((0,n.q)(this.root,t));return(0,n.M)({_nodes:[...r],context:e.context||{},children:{},status:(0,n.O)(r,this.root)?"done":e.status||"active",output:e.output,error:e.error,historyValue:e.historyValue},this)}transition(e,t,r){return(0,n.e)(e,t,r,[]).snapshot}microstep(e,t,r){return(0,n.e)(e,t,r,[]).microsteps.map(([e])=>e)}getTransitionData(e,t){return(0,n.P)(this.root,e.value,e,t)||[]}_getPreInitialState(e,t,r){let{context:i}=this.config,o=(0,n.M)({context:"function"!=typeof i&&i?i:{},_nodes:[this.root],children:{},status:"active"},this);return"function"==typeof i?(0,n.Q)(o,t,e,[(0,s.a)(({spawn:e,event:t,self:r})=>i({spawn:e,input:t.input,self:r}))],r,void 0):o}getInitialSnapshot(e,t){let r=(0,n.f)(t),s=[],i=this._getPreInitialState(e,r,s),[o]=(0,n.g)(this.root,i,e,r,s),{snapshot:a}=(0,n.e)(o,r,e,s);return a}start(e){Object.values(e.children).forEach(e=>{"active"===e.getSnapshot().status&&e.start()})}getStateNodeById(e){let t=(0,n.R)(e),r=t.slice(1),s=(0,n.T)(t[0])?t[0].slice(1):t[0],i=this.idMap.get(s);if(!i)throw Error(`Child state node '#${s}' does not exist on machine '${this.id}'`);return(0,n.U)(i,r)}get definition(){return this.root.definition}toJSON(){return this.definition}getPersistedSnapshot(e,t){return(0,n.V)(e,t)}restoreSnapshot(e,t){let r={},s=e.children;
2Object.keys(s).forEach(e=>{let i=s[e],o=i.snapshot,a=i.src,u="string"==typeof a?(0,n.W)(this,a):a;if(!u)return;let c=(0,n.c)(u,{id:e,parent:t.self,syncSnapshot:i.syncSnapshot,snapshot:o,src:a,systemId:i.systemId});r[e]=c});let i=function(e,t){if(!t||"object"!=typeof t)return{};let r={};for(let n in t)for(let s of t[n]){let t=function(e,t){if(t instanceof c)return t;try{return e.machine.getStateNodeById(t.id)}catch{}}(e,s);t&&(r[n]??=[],r[n].push(t))}return r}(this.root,e.historyValue),o=(0,n.M)({...e,children:r,_nodes:Array.from((0,n.L)((0,n.q)(this.root,e.value))),historyValue:i},this),a=new Set;return!function e(t,r){if(!a.has(t))for(let s in a.add(t),t){let i=t[s];if(i&&"object"==typeof i){if("xstate$$type"in i&&i.xstate$$type===n.$){t[s]=r[i.id];continue}e(i,r)}}}(o.context,r),o}}var h=r(1807);function d(e,t){let r=(0,n.t)(t);if(!r.some(t=>(0,n.m)(e.type,t))){let t=1===r.length?`type matching "${r[0]}"`:`one of types matching "${r.join('", "')}"`;throw Error(`Expected event ${JSON.stringify(e)} to have ${t}`)}}},5251:(e,t,r)=>{r.d(t,{T:()=>n});function n(e){return"function"==typeof e}},7039:(e,t,r)=>{r.d(t,{q:()=>o});var n=r(60827),s=r(62841),i=function(){function e(t,r){void 0===r&&(r=e.now),this.schedulerActionCtor=t,this.now=r}return e.prototype.schedule=function(e,t,r){return void 0===t&&(t=0),new this.schedulerActionCtor(this,e).schedule(r,t)},e.now=s.U.now,e}(),o=function(e){function t(t,r){void 0===r&&(r=i.now);var n=e.call(this,t,r)||this;return n.actions=[],n._active=!1,n}return(0,n.C6)(t,e),t.prototype.flush=function(e){var t,r=this.actions;if(this._active)return void r.push(e);this._active=!0;do if(t=e.execute(e.state,e.delay))break;while(e=r.shift());if(this._active=!1,t){for(;e=r.shift();)e.unsubscribe();throw t}},t}(i)},7556:(e,t,r)=>{r.d(t,{c:()=>b});var n=r(67060),s=r(75457),i=r(8482);function o(e,t){return void 0===t&&(t=0),(0,i.N)(function(r,n){n.add(e.schedule(function(){return r.subscribe(n)},t))})}var a=r(14511),u=r(22933),c=r(5251),l=r(80759);function h(e,t){if(!e)throw Error("Iterable cannot be null");return new a.c(function(r){(0,l.N)(r,t,function(){var n=e[Symbol.asyncIterator]();(0,l.N)(r,t,function(){n.next().then(function(e){e.done?r.complete():r.next(e.value)})},0,!0)})})}var d=r(58709),p=r(31972),f=r(33071),y=r(74041),g=r(73495),v=r(3607),m=r(86256);function b(e,t){if(null!=e){if((0,d.l)(e))return(0,n.Tg)(e).pipe(o(t),(0,s.Q)(t));if((0,f.X)(e))return new a.c(function(r){var n=0;return t.schedule(function(){n===e.length?r.complete():(r.next(e[n++]),r.closed||this.schedule())})});if((0,p.y)(e))return(0,n.Tg)(e).pipe(o(t),(0,s.Q)(t));if((0,g.T)(e))return h(e,t);if((0,y.x)(e))return new a.c(function(r){var n;return(0,l.N)(r,t,function(){n=e[u.l](),(0,l.N)(r,t,function(){var e,t,s;try{t=(e=n.next()).value,s=e.done}catch(e){r.error(e);return}s?r.complete():r.next(t)},0,!0)}),function(){return(0,c.T)(null==n?void 0:n.return)&&n.return()}});if((0,m.U)(e))return h((0,m.C)(e),t)}throw(0,v.L)(e)}},7654:(e,t,r)=>{r.d(t,{Ms:()=>v,vU:()=>p});var n=r(60827),s=r(5251),i=r(1253),o=r(9652),a=r(49130),u=r(14527),c=l("C",void 0,void 0);function l(e,t,r){return{kind:e,value:t,error:r}}var h=r(31962),d=r(70998),p=function(e){function t(t){var r=e.call(this)||this;return r.isStopped=!1,t?(r.destination=t,(0,i.Uv)(t)&&t.add(r)):r.destination=w,r}return(0,n.C6)(t,e),t.create=function(e,t,r){return new v(e,t,r)},t.prototype.next=function(e){this.isStopped?b(l("N",e,void 0),this):this._next(e)},t.prototype.error=function(e){this.isStopped?b(l("E",void 0,e),this):(this.isStopped=!0,this._error(e))},t.prototype.complete=function(){this.isStopped?b(c,this):(this.isStopped=!0,this._complete())},t.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,e.prototype.unsubscribe.call(this),this.destination=null)},t.prototype._next=function(e){this.destination.next(e)},t.prototype._error=function(e){try{this.destination.error(e)}finally{this.unsubscribe()}},t.prototype._complete=function(){try{this.destination.complete()}finally{this.unsubscribe()}},t}(i.yU),f=Function.prototype.bind;function y(e,t){return f.call(e,t)}var g=function(){function e(e){this.partialObserver=e}return e.prototype.next=function(e){var t=this.partialObserver;if(t.next)try{t.next(e)}catch(e){m(e)}},e.prototype.error=function(e){var t=this.partialObserver;if(t.error)try{t.error(e)}catch(e){m(e)}else m(e)},e.prototype.complete=function(){var e=this.partialObserver;if(e.complete)try{e.complete()}catch(e){m(e)}},e}(),v=function(e){function t(t,r,n){var i,a,u=e.call(this)||this;return(0,s.T)(t)||!t?i={next:null!=t?t:void 0,error:null!=r?r:void 0,complete:null!=n?n:void 0}
2:u&&o.$.useDeprecatedNextContext?((a=Object.create(t)).unsubscribe=function(){return u.unsubscribe()},i={next:t.next&&y(t.next,a),error:t.error&&y(t.error,a),complete:t.complete&&y(t.complete,a)}):i=t,u.destination=new g(i),u}return(0,n.C6)(t,e),t}(p);function m(e){o.$.useDeprecatedSynchronousErrorHandling?(0,d.l)(e):(0,a.m)(e)}function b(e,t){var r=o.$.onStoppedNotification;r&&h.f.setTimeout(function(){return r(e,t)})}var w={closed:!0,next:u.l,error:function(e){throw e},complete:u.l}},8482:(e,t,r)=>{r.d(t,{N:()=>i,S:()=>s});var n=r(5251);function s(e){return(0,n.T)(null==e?void 0:e.lift)}function i(e){return function(t){if(s(t))return t.lift(function(t){try{return e(t,this)}catch(e){this.error(e)}});throw TypeError("Unable to lift unknown Observable type")}}},8992:(e,t,r)=>{r.d(t,{A_:()=>g,C:()=>d,IM:()=>w,R8:()=>y,T4:()=>v,_S:()=>b,ct:()=>m,iz:()=>_});let n=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,s=/_key\s*==\s*['"](.*)['"]/,i=/^\d*:\d*$/;function o(e){return"number"==typeof e||"string"==typeof e&&/^\[\d+\]$/.test(e)}function a(e){return"string"==typeof e?s.test(e.trim()):"object"==typeof e&&"_key"in e}function u(e){if("string"==typeof e&&i.test(e))return!0;if(!Array.isArray(e)||2!==e.length)return!1;let[t,r]=e;return("number"==typeof t||""===t)&&("number"==typeof r||""===r)}function c(e){if(!Array.isArray(e))throw Error("Path is not an array");return e.reduce((e,t,r)=>{let n=typeof t;if("number"===n)return`${e}[${t}]`;if("string"===n)return`${e}${0===r?"":"."}${t}`;if(a(t)&&t._key)return`${e}[_key=="${t._key}"]`;if(Array.isArray(t)){let[r,n]=t;return`${e}[${r}:${n}]`}throw Error(`Unsupported path segment \`${JSON.stringify(t)}\``)},"")}function l(e){if("string"!=typeof e)throw Error("Path is not a string");let t=e.match(n);if(!t)throw Error("Invalid path string");return t.map(h)}function h(e){return o(e)?Number(e.replace(/[^\d]/g,"")):a(e)?{_key:e.match(s)[1]}:u(e)?function(e){let[t,r]=e.split(":").map(e=>""===e?e:Number(e));return[t,r]}(e):e}var d=Object.freeze({__proto__:null,fromString:l,get:function(e,t,r){let n="string"==typeof t?l(t):t;if(!Array.isArray(n))throw Error("Path must be an array or a string");let s=e;for(let e=0;e<n.length;e++){let t=n[e];if(o(t)){if(!Array.isArray(s))return r;s=s[t]}if(a(t)){if(!Array.isArray(s))return r;s=s.find(e=>e._key===t._key)}if("string"==typeof t&&(s="object"==typeof s&&null!==s?s[t]:void 0),typeof s>"u")return r}return s},isIndexSegment:o,isIndexTuple:u,isKeySegment:a,reKeySegment:s,toString:c});let p="drafts.",f="versions.";function y(e){return e.startsWith(p)}function g(e){return e.startsWith(f)}function v(e){return g(e)?p+w(e):y(e)?e:p+e}function m(e,t){if("drafts"===t||"published"===t)throw Error('Version can not be "published" or "drafts"');return`${f}${t}.${w(e)}`}function b(e){if(!g(e))return;let[t,r]=e.split(".");return r}function w(e){return g(e)?e.split(".").slice(2).join("."):y(e)?e.slice(p.length):e}function _(e){let{baseUrl:t,workspace:r="default",tool:n="default",id:s,type:i,path:o,projectId:a,dataset:u}=e;if(!t)throw Error("baseUrl is required");if(!o)throw Error("path is required");if(!s)throw Error("id is required");if("/"!==t&&t.endsWith("/"))throw Error("baseUrl must not end with a slash");let l="default"===r?void 0:r,h="default"===n?void 0:n,d=w(s),p=Array.isArray(o)?c(o.map(e=>{if("string"==typeof e||"number"==typeof e)return e;if(""!==e._key)return{_key:e._key};if(-1!==e._index)return e._index;throw Error(`invalid segment:${JSON.stringify(e)}`)})):o,f=new URLSearchParams({baseUrl:t,id:d,type:i,path:p});if(l&&f.set("workspace",l),h&&f.set("tool",h),a&&f.set("projectId",a),u&&f.set("dataset",u),y(s)||g(s)){if(g(s)){let e=b(s);f.set("perspective",e)}}else f.set("perspective","published");let v=["/"===t?"":t];l&&v.push(l);let m=["mode=presentation",`id=${d}`,`type=${i}`,`path=${encodeURIComponent(p)}`];return h&&m.push(`tool=${h}`),v.push("intent","edit",`${m.join(";")}?${f}`),v.join("/")}},9652:(e,t,r)=>{r.d(t,{$:()=>n});var n={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNext
2Context:!1}},11526:(e,t,r)=>{r.d(t,{Z:()=>function e(t,r,u){return(void 0===u&&(u=1/0),(0,a.T)(r))?e(function(e,i){return(0,n.T)(function(t,n){return r(e,t,i,n)})((0,s.Tg)(t(e,i)))},u):("number"==typeof r&&(u=r),(0,i.N)(function(e,r){return(0,o.h)(e,r,t,u)}))}});var n=r(75478),s=r(67060),i=r(8482),o=r(70382),a=r(5251)},11903:(e,t,r)=>{r.d(t,{s:()=>s});var n=r(91766);function s(e,t){var r="object"==typeof t;return new Promise(function(s,i){var o,a=!1;e.subscribe({next:function(e){o=e,a=!0},error:i,complete:function(){a?s(o):r?s(t.defaultValue):i(new n.G)}})})}},13325:(e,t,r)=>{r.d(t,{Q:()=>a});var n=r(8482),s=r(85473),i=r(67060),o=r(14527);function a(e){return(0,n.N)(function(t,r){(0,i.Tg)(e).subscribe((0,s._)(r,function(){return r.complete()},o.l)),r.closed||t.subscribe(r)})}},14238:(e,t,r)=>{r.d(t,{$:()=>i});var n=r(14511),s=r(5251);function i(e,t){var r=(0,s.T)(e)?e:function(){return e},i=function(e){return e.error(r())};return new n.c(t?function(e){return t.schedule(i,0,e)}:i)}},14511:(e,t,r)=>{r.d(t,{c:()=>l});var n=r(7654),s=r(1253),i=r(19710),o=r(70019),a=r(9652),u=r(5251),c=r(70998),l=function(){function e(e){e&&(this._subscribe=e)}return e.prototype.lift=function(t){var r=new e;return r.source=this,r.operator=t,r},e.prototype.subscribe=function(e,t,r){var i=this,o=!function(e){return e&&e instanceof n.vU||e&&(0,u.T)(e.next)&&(0,u.T)(e.error)&&(0,u.T)(e.complete)&&(0,s.Uv)(e)}(e)?new n.Ms(e,t,r):e;return(0,c.Y)(function(){var e=i.operator,t=i.source;o.add(e?e.call(o,t):t?i._subscribe(o):i._trySubscribe(o))}),o},e.prototype._trySubscribe=function(e){try{return this._subscribe(e)}catch(t){e.error(t)}},e.prototype.forEach=function(e,t){var r=this;return new(t=h(t))(function(t,s){var i=new n.Ms({next:function(t){try{e(t)}catch(e){s(e),i.unsubscribe()}},error:s,complete:t});r.subscribe(i)})},e.prototype._subscribe=function(e){var t;return null==(t=this.source)?void 0:t.subscribe(e)},e.prototype[i.s]=function(){return this},e.prototype.pipe=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return(0,o.m)(e)(this)},e.prototype.toPromise=function(e){var t=this;return new(e=h(e))(function(e,r){var n;t.subscribe(function(e){return n=e},function(e){return r(e)},function(){return e(n)})})},e.create=function(t){return new e(t)},e}();function h(e){var t;return null!=(t=null!=e?e:a.$.Promise)?t:Promise}},14527:(e,t,r)=>{r.d(t,{l:()=>n});function n(){}},15595:(e,t,r)=>{r.d(t,{m:()=>o});var n=r(60827),s=r(24976),i=r(62841),o=function(e){function t(t,r,n){void 0===t&&(t=1/0),void 0===r&&(r=1/0),void 0===n&&(n=i.U);var s=e.call(this)||this;return s._bufferSize=t,s._windowTime=r,s._timestampProvider=n,s._buffer=[],s._infiniteTimeWindow=!0,s._infiniteTimeWindow=r===1/0,s._bufferSize=Math.max(1,t),s._windowTime=Math.max(1,r),s}return(0,n.C6)(t,e),t.prototype.next=function(t){var r=this.isStopped,n=this._buffer,s=this._infiniteTimeWindow,i=this._timestampProvider,o=this._windowTime;!r&&(n.push(t),s||n.push(i.now()+o)),this._trimBuffer(),e.prototype.next.call(this,t)},t.prototype._subscribe=function(e){this._throwIfClosed(),this._trimBuffer();for(var t=this._innerSubscribe(e),r=this._infiniteTimeWindow,n=this._buffer.slice(),s=0;s<n.length&&!e.closed;s+=r?1:2)e.next(n[s]);return this._checkFinalizedStatuses(e),t},t.prototype._trimBuffer=function(){var e=this._bufferSize,t=this._timestampProvider,r=this._buffer,n=this._infiniteTimeWindow,s=(n?1:2)*e;if(e<1/0&&s<r.length&&r.splice(0,r.length-s),!n){for(var i=t.now(),o=0,a=1;a<r.length&&r[a]<=i;a+=2)o=a;o&&r.splice(0,o+1)}},t}(s.B)},15605:(e,t,r)=>{r.d(t,{of:()=>i});var n=r(50274),s=r(17092);function i(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=(0,n.lI)(e);return(0,s.H)(e,r)}},17092:(e,t,r)=>{r.d(t,{H:()=>i});var n=r(7556),s=r(67060);function i(e,t){return t?(0,n.c)(e,t):(0,s.Tg)(e)}},19290:(e,t,r)=>{r.d(t,{T:()=>i});var n=r(64081),s=r(8482);function i(e,t){return(0,s.N)((0,n.S)(e,t,arguments.length>=2,!1,!0))}},19502:(e,t,r)=>{r.d(t,{P:()=>p,z:()=>d});var n=r(14511),s=r(99465),i=r(17092),o=r(44385),a=r(24490),u=r(50274),c=r(64996),l=r(85473),h=r(80759);function d(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=(0,u.lI)(e),l=(0,u.ms)(e),h=(0,s.D)(e),d=h.args,f=h.keys;if(0===d.length)return(0,i.H)([],r);var y=new n.c(p(d,r,f?function(e){return(0,c.e)(f,e)}:o.D));return l?y.pipe((0,a.I)(l)):y}function p(e,t,r){return void 0===r&&(r=o.D),function(n){f(t,function(){for(var s=e.length,o=Array(s),a=s,u=s,c=function(s){f(t,function(){var c=(0,i.H)(e[s],t),h=!1;c.subscribe((0,l._)(n,function(e){o[s]=e,!h&&(h=!0,u--),u||n.next(r(o.slice()))},function(){--a||n.complete()}
2))},n)},h=0;h<s;h++)c(h)},n)}}function f(e,t,r){e?(0,h.N)(r,e,t):t()}},19710:(e,t,r)=>{r.d(t,{s:()=>n});var n="function"==typeof Symbol&&Symbol.observable||"@@observable"},22529:(e,t,r)=>{r.d(t,{w:()=>n});var n=new(r(14511)).c(function(e){return e.complete()})},22933:(e,t,r)=>{r.d(t,{l:()=>n});var n="function"==typeof Symbol&&Symbol.iterator?Symbol.iterator:"@@iterator"},24490:(e,t,r)=>{r.d(t,{I:()=>o});var n=r(60827),s=r(75478),i=Array.isArray;function o(e){return(0,s.T)(function(t){return i(t)?e.apply(void 0,(0,n.fX)([],(0,n.zs)(t))):e(t)})}},24976:(e,t,r)=>{r.d(t,{B:()=>c});var n=r(60827),s=r(14511),i=r(1253),o=(0,r(46137).L)(function(e){return function(){e(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"}}),a=r(61278),u=r(70998),c=function(e){function t(){var t=e.call(this)||this;return t.closed=!1,t.currentObservers=null,t.observers=[],t.isStopped=!1,t.hasError=!1,t.thrownError=null,t}return(0,n.C6)(t,e),t.prototype.lift=function(e){var t=new l(this,this);return t.operator=e,t},t.prototype._throwIfClosed=function(){if(this.closed)throw new o},t.prototype.next=function(e){var t=this;(0,u.Y)(function(){var r,s;if(t._throwIfClosed(),!t.isStopped){t.currentObservers||(t.currentObservers=Array.from(t.observers));try{for(var i=(0,n.Ju)(t.currentObservers),o=i.next();!o.done;o=i.next())o.value.next(e)}catch(e){r={error:e}}finally{try{o&&!o.done&&(s=i.return)&&s.call(i)}finally{if(r)throw r.error}}}})},t.prototype.error=function(e){var t=this;(0,u.Y)(function(){if(t._throwIfClosed(),!t.isStopped){t.hasError=t.isStopped=!0,t.thrownError=e;for(var r=t.observers;r.length;)r.shift().error(e)}})},t.prototype.complete=function(){var e=this;(0,u.Y)(function(){if(e._throwIfClosed(),!e.isStopped){e.isStopped=!0;for(var t=e.observers;t.length;)t.shift().complete()}})},t.prototype.unsubscribe=function(){this.isStopped=this.closed=!0,this.observers=this.currentObservers=null},Object.defineProperty(t.prototype,"observed",{get:function(){var e;return(null==(e=this.observers)?void 0:e.length)>0},enumerable:!1,configurable:!0}),t.prototype._trySubscribe=function(t){return this._throwIfClosed(),e.prototype._trySubscribe.call(this,t)},t.prototype._subscribe=function(e){return this._throwIfClosed(),this._checkFinalizedStatuses(e),this._innerSubscribe(e)},t.prototype._innerSubscribe=function(e){var t=this,r=this.hasError,n=this.isStopped,s=this.observers;return r||n?i.Kn:(this.currentObservers=null,s.push(e),new i.yU(function(){t.currentObservers=null,(0,a.o)(s,e)}))},t.prototype._checkFinalizedStatuses=function(e){var t=this.hasError,r=this.thrownError,n=this.isStopped;t?e.error(r):n&&e.complete()},t.prototype.asObservable=function(){var e=new s.c;return e.source=this,e},t.create=function(e,t){return new l(e,t)},t}(s.c),l=function(e){function t(t,r){var n=e.call(this)||this;return n.destination=t,n.source=r,n}return(0,n.C6)(t,e),t.prototype.next=function(e){var t,r;null==(r=null==(t=this.destination)?void 0:t.next)||r.call(t,e)},t.prototype.error=function(e){var t,r;null==(r=null==(t=this.destination)?void 0:t.error)||r.call(t,e)},t.prototype.complete=function(){var e,t;null==(t=null==(e=this.destination)?void 0:e.complete)||t.call(e)},t.prototype._subscribe=function(e){var t,r;return null!=(r=null==(t=this.source)?void 0:t.subscribe(e))?r:i.Kn},t}(c)},25165:(e,t,r)=>{r.d(t,{_:()=>i});var n=r(91766),s=r(7654);function i(e,t){var r="object"==typeof t;return new Promise(function(i,o){var a=new s.Ms({next:function(e){i(e),a.unsubscribe()},error:o,complete:function(){r?i(t.defaultValue):o(new n.G)}});e.subscribe(a)})}},25382:(e,t,r)=>{r.d(t,{H6:()=>f,OX:()=>u,SP:()=>i,Sx:()=>d});var n=r(30701);let s=new WeakMap;function i(e){return{config:e,start:(t,r)=>{let{self:n,system:i,emit:o}=r,a={receivers:void 0,dispose:void 0};s.set(n,a),a.dispose=e({input:t.input,system:i,self:n,sendBack:e=>{"stopped"!==n.getSnapshot().status&&n._parent&&i._relay(n,n._parent,e)},receive:e=>{a.receivers??=new Set,a.receivers.add(e)},emit:o})},transition:(e,t,r)=>{let i=s.get(r.self);return t.type===n.X?(e={...e,status:"stopped",error:void 0},s.delete(r.self),i.receivers?.clear(),i.dispose?.()):i.receivers?.forEach(e
2=>e(t)),e},getInitialSnapshot:(e,t)=>({status:"active",output:void 0,error:void 0,input:t}),getPersistedSnapshot:e=>e,restoreSnapshot:e=>e}}let o="xstate.observable.error",a="xstate.observable.complete";function u(e){return{config:e,transition:(e,t)=>{if("active"!==e.status)return e;switch(t.type){case o:return{...e,status:"error",error:t.data,input:void 0,_subscription:void 0};case a:return{...e,status:"done",input:void 0,_subscription:void 0};case n.X:return e._subscription.unsubscribe(),{...e,status:"stopped",input:void 0,_subscription:void 0};default:return e}},getInitialSnapshot:(e,t)=>({status:"active",output:void 0,error:void 0,context:void 0,input:t,_subscription:void 0}),start:(t,{self:r,system:n,emit:s})=>{"done"!==t.status&&(t._subscription=e({input:t.input,system:n,self:r,emit:s}).subscribe({next:e=>{r._parent&&n._relay(r,r._parent,e)},error:e=>{n._relay(r,r,{type:o,data:e})},complete:()=>{n._relay(r,r,{type:a})}}))},getPersistedSnapshot:({_subscription:e,...t})=>t,restoreSnapshot:e=>({...e,_subscription:void 0})}}let c="xstate.promise.resolve",l="xstate.promise.reject",h=new WeakMap;function d(e){return{config:e,transition:(e,t,r)=>{if("active"!==e.status)return e;switch(t.type){case c:{let r=t.data;return{...e,status:"done",output:r,input:void 0}}case l:return{...e,status:"error",error:t.data,input:void 0};case n.X:return h.get(r.self)?.abort(),h.delete(r.self),{...e,status:"stopped",input:void 0};default:return e}},start:(t,{self:r,system:n,emit:s})=>{if("active"!==t.status)return;let i=new AbortController;h.set(r,i),Promise.resolve(e({input:t.input,system:n,self:r,signal:i.signal,emit:s})).then(e=>{"active"===r.getSnapshot().status&&(h.delete(r),n._relay(r,r,{type:c,data:e}))},e=>{"active"===r.getSnapshot().status&&(h.delete(r),n._relay(r,r,{type:l,data:e}))})},getInitialSnapshot:(e,t)=>({status:"active",output:void 0,error:void 0,input:t}),getPersistedSnapshot:e=>e,restoreSnapshot:e=>e}}let p=function(e,t){return{config:e,transition:(t,r,n)=>({...t,context:e(t.context,r,n)}),getInitialSnapshot:(e,r)=>({status:"active",output:void 0,error:void 0,context:"function"==typeof t?t({input:r}):t}),getPersistedSnapshot:e=>e,restoreSnapshot:e=>e}}(e=>void 0,void 0);
2function f(){return(0,n.c)(p)}},28886:(e,t,r)=>{r.d(t,{p:()=>i});var n=r(8482),s=r(85473);function i(e,t){return(0,n.N)(function(r,n){var i=0;r.subscribe((0,s._)(n,function(r){return e.call(t,r,i++)&&n.next(r)}))})}},30701:(e,t,r)=>{r.d(t,{$:()=>R,B:()=>ea,C:()=>w,D:()=>eo,E:()=>G,F:()=>E,G:()=>ei,H:()=>ec,I:()=>es,J:()=>eu,K:()=>eq,L:()=>K,M:()=>eD,N:()=>i,O:()=>er,P:()=>function e(t,r,n,s){if("string"==typeof r){let e=ef(t,r).next(n,s);return e&&e.length?e:t.next(n,s)}if(1===Object.keys(r).length){let i=Object.keys(r),o=e(ef(t,i[0]),r[i[0]],n,s);return o&&o.length?o:t.next(n,s)}let i=[];for(let o of Object.keys(r)){let a=r[o];if(!a)continue;let u=e(ef(t,o),a,n,s);u&&i.push(...u)}return i.length?i:t.next(n,s)},Q:()=>eT,R:()=>f,S:()=>s,T:()=>en,U:()=>ey,V:()=>eN,W:()=>S,X:()=>u,Y:()=>a,Z:()=>l,_:()=>q,a0:()=>eM,b:()=>D,c:()=>O,d:()=>U,e:()=>e$,f:()=>h,g:()=>ex,k:()=>X,l:()=>H,m:()=>I,n:()=>B,q:()=>eg,r:()=>ez,s:()=>L,t:()=>v,x:()=>x,z:()=>g});class n{constructor(e){this._process=e,this._active=!1,this._current=null,this._last=null}start(){this._active=!0,this.flush()}clear(){this._current&&(this._current.next=null,this._last=this._current)}enqueue(e){let t={value:e,next:null};if(this._current){this._last.next=t,this._last=t;return}this._current=t,this._last=t,this._active&&this.flush()}flush(){for(;this._current;){let e=this._current;this._process(e.value),this._current=e.next}this._last=null}}let s=".",i="",o="xstate.init",a="xstate.error",u="xstate.stop";function c(e,t){return{type:`xstate.done.state.${e}`,output:t}}function l(e,t){return{type:`xstate.error.actor.${e}`,error:t,actorId:e}}function h(e){return{type:o,input:e}}function d(e){setTimeout(()=>{throw e})}let p="function"==typeof Symbol&&Symbol.observable||"@@observable";function f(e){if(b(e))return e;let t=[],r="";for(let n=0;n<e.length;n++){switch(e.charCodeAt(n)){case 92:r+=e[n+1],n++;continue;case 46:t.push(r),r="";
2continue}r+=e[n]}return t.push(r),t}function y(e){var t;return(t=e)&&"object"==typeof t&&"machine"in t&&"value"in t?e.value:"string"!=typeof e?e:function(e){if(1===e.length)return e[0];let t={},r=t;for(let t=0;t<e.length-1;t++)if(t===e.length-2)r[e[t]]=e[t+1];else{let n=r;r={},n[e[t]]=r}return t}(f(e))}function g(e,t){let r={},n=Object.keys(e);for(let s=0;s<n.length;s++){let i=n[s];r[i]=t(e[i],i,e,s)}return r}function v(e){var t;return void 0===e?[]:b(t=e)?t:[t]}function m(e,t,r,n){return"function"==typeof e?e({context:t,event:r,self:n}):e}function b(e){return Array.isArray(e)}function w(e){var t;return(b(t=e)?t:[t]).map(e=>void 0===e||"string"==typeof e?{target:e}:e)}function _(e){if(void 0!==e&&""!==e)return v(e)}function x(e,t,r){let n="object"==typeof e,s=n?e:void 0;return{next:(n?e.next:e)?.bind(s),error:(n?e.error:t)?.bind(s),complete:(n?e.complete:r)?.bind(s)}}function E(e,t){return`${t}.${e}`}function S(e,t){let r=t.match(/^xstate\.invoke\.(\d+)\.(.*)/);if(!r)return e.implementations.actors[t];let[,n,s]=r,i=e.getStateNodeById(s).config.invoke;return(Array.isArray(i)?i[n]:i).src}function I(e,t){if(t===e||"*"===t)return!0;if(!t.endsWith(".*"))return!1;let r=t.split("."),n=e.split(".");for(let e=0;e<r.length;e++){let t=r[e],s=n[e];if("*"===t)return e===r.length-1;if(t!==s)return!1}return!0}function T(e,t){return`${e.sessionId}.${t}`}let $=0,C=!1,R=1,q=function(e){return e[e.NotStarted=0]="NotStarted",e[e.Running=1]="Running",e[e.Stopped=2]="Stopped",e}({}),j={clock:{setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e)},logger:console.log.bind(console),devTools:!1};class k{constructor(e,t){this.logic=e,this._snapshot=void 0,this.clock=void 0,this.options=void 0,this.id=void 0,this.mailbox=new n(this._process.bind(this)),this.observers=new Set,this.eventListeners=new Map,this.logger=void 0,this._processingStatus=q.NotStarted,this._parent=void 0,this._syncSnapshot=void 0,this.ref=void 0,this._actorScope=void 0,this.systemId=void 0,this.sessionId=void 0,this.system=void 0,this._doneEvent=void 0,this.src=void 0,this._deferred=[];let r={...j,...t},{clock:s,logger:i,parent:o,syncSnapshot:a,id:u,systemId:c,inspect:l}=r;this.system=o?o.system:function(e,t){let r=new Map,n=new Map,s=new WeakMap,i=new Set,o={},{clock:a,logger:u}=t,c={schedule:(e,t,r,n,s=Math.random().toString(36).slice(2))=>{let i={source:e,target:t,event:r,delay:n,id:s,startedAt:Date.now()},u=T(e,s);l._snapshot._scheduledEvents[u]=i;let c=a.setTimeout(()=>{delete o[u],delete l._snapshot._scheduledEvents[u],l._relay(e,t,r)},n);o[u]=c},cancel:(e,t)=>{let r=T(e,t),n=o[r];delete o[r],delete l._snapshot._scheduledEvents[r],void 0!==n&&a.clearTimeout(n)},cancelAll:e=>{for(let t in l._snapshot._scheduledEvents){let r=l._snapshot._scheduledEvents[t];r.source===e&&c.cancel(e,r.id)}}},l={_snapshot:{_scheduledEvents:(t?.snapshot&&t.snapshot.scheduler)??{}},_bookId:()=>`x:${$++}`,_register:(e,t)=>(r.set(e,t),e),_unregister:e=>{r.delete(e.sessionId);let t=s.get(e);void 0!==t&&(n.delete(t),s.delete(e))},get:e=>n.get(e),getAll:()=>Object.fromEntries(n.entries()),_set:(e,t)=>{let r=n.get(e);if(r&&r!==t)throw Error(`Actor with system ID '${e}' already exists.`);n.set(e,t),s.set(t,e)},inspect:e=>{let t=x(e);return i.add(t),{unsubscribe(){i.delete(t)}}},_sendInspectionEvent:t=>{if(!i.size)return;let r={...t,rootId:e.sessionId};i.forEach(e=>e.next?.(r))},_relay:(e,t,r)=>{l._sendInspectionEvent({type:"@xstate.event",sourceRef:e,actorRef:t,event:r}),t._send(r)},scheduler:c,getSnapshot:()=>({_scheduledEvents:{...l._snapshot._scheduledEvents}}),start:()=>{let e=l._snapshot._scheduledEvents;for(let t in l._snapshot._scheduledEvents={},e){let{source:r,target:n,event:s,delay:i,id:o}=e[t];c.schedule(r,n,s,i,o)}},_clock:a,_logger:u};return l}(this,{clock:s,logger:i}),l&&!o&&this.system.inspect(x(l)),this.sessionId=this.system._bookId(),this.id=u??this.sessionId,this.logger=t?.logger??this.system._logger,this.clock=t?.clock??this.system._clock,this._parent=o,this._syncSnapshot=a,this.options=r,this.src=r.src??e,this.ref=this,this._actorScope={self:this,id:this.id,sessionId:this.sessionId,logger:this.logger,defer:e=>{this._deferred.push(e)},system:this.system,stopChild:e=>
2{if(e._parent!==this)throw Error(`Cannot stop child actor ${e.id} of ${this.id} because it is not a child`);e._stop()},emit:e=>{let t=this.eventListeners.get(e.type),r=this.eventListeners.get("*");if(t||r)for(let n of[...t?t.values():[],...r?r.values():[]])try{n(e)}catch(e){d(e)}},actionExecutor:e=>{let t=()=>{if(this._actorScope.system._sendInspectionEvent({type:"@xstate.action",actorRef:this,action:{type:e.type,params:e.params}}),!e.exec)return;let t=C;try{C=!0,e.exec(e.info,e.params)}finally{C=t}};this._processingStatus===q.Running?t():this._deferred.push(t)}},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(t?.snapshot??t?.state),c&&"active"!==this._snapshot.status&&this.system._unregister(this)}_initState(e){try{this._snapshot=e?this.logic.restoreSnapshot?this.logic.restoreSnapshot(e,this._actorScope):e:this.logic.getInitialSnapshot(this._actorScope,this.options?.input)}catch(e){this._snapshot={status:"error",output:void 0,error:e}}}update(e,t){let r;for(this._snapshot=e;r=this._deferred.shift();)try{r()}catch(t){this._deferred.length=0,this._snapshot={...e,status:"error",error:t}}switch(this._snapshot.status){case"active":for(let t of this.observers)try{t.next?.(e)}catch(e){d(e)}break;case"done":var n;for(let t of this.observers)try{t.next?.(e)}catch(e){d(e)}this._stopProcedure(),this._complete(),this._doneEvent=(n=this.id,{type:`xstate.done.actor.${n}`,output:this._snapshot.output,actorId:n}),this._parent&&this.system._relay(this,this._parent,this._doneEvent);break;case"error":this._error(this._snapshot.error)}this.system._sendInspectionEvent({type:"@xstate.snapshot",actorRef:this,event:t,snapshot:e})}subscribe(e,t,r){let n=x(e,t,r);if(this._processingStatus!==q.Stopped)this.observers.add(n);else switch(this._snapshot.status){case"done":try{n.complete?.()}catch(e){d(e)}break;case"error":{let e=this._snapshot.error;if(n.error)try{n.error(e)}catch(e){d(e)}else d(e)}}return{unsubscribe:()=>{this.observers.delete(n)}}}on(e,t){let r=this.eventListeners.get(e);r||(r=new Set,this.eventListeners.set(e,r));let n=t.bind(void 0);return r.add(n),{unsubscribe:()=>{r.delete(n)}}}select(e,t=Object.is){return{subscribe:r=>{let n=x(r),s=e(this.getSnapshot());return this.subscribe(r=>{let i=e(r);t(s,i)||(s=i,n.next?.(i))})},get:()=>e(this.getSnapshot())}}start(){if(this._processingStatus===q.Running)return this;this._syncSnapshot&&this.subscribe({next:e=>{"active"===e.status&&this.system._relay(this,this._parent,{type:`xstate.snapshot.${this.id}`,snapshot:e})},error:()=>{}}),this.system._register(this.sessionId,this),this.systemId&&this.system._set(this.systemId,this),this._processingStatus=q.Running;let e=h(this.options.input);switch(this.system._sendInspectionEvent({type:"@xstate.event",sourceRef:this._parent,actorRef:this,event:e}),this._snapshot.status){case"done":return this.update(this._snapshot,e),this;case"error":return this._error(this._snapshot.error),this}if(this._parent||this.system.start(),this.logic.start)try{this.logic.start(this._snapshot,this._actorScope)}catch(e){return this._snapshot={...this._snapshot,status:"error",error:e},this._error(e),this}return this.update(this._snapshot,e),this.options.devTools&&this.attachDevTools(),this.mailbox.start(),this}_process(e){let t,r;try{t=this.logic.transition(this._snapshot,e,this._actorScope)}catch(e){r={err:e}}if(r){let{err:e}=r;this._snapshot={...this._snapshot,status:"error",error:e},this._error(e);return}this.update(t,e),e.type===u&&(this._stopProcedure(),this._complete())}_stop(){return this._processingStatus===q.Stopped||((this.mailbox.clear(),this._processingStatus===q.NotStarted)?this._processingStatus=q.Stopped:this.mailbox.enqueue({type:u})),this}stop(){if(this._parent)throw Error("A non-root actor cannot be stopped directly.");return this._stop()}_complete(){for(let e of this.observers)try{e.complete?.()}catch(e){d(e)}this.observers.clear(),this.eventListeners.clear()}_reportError(e){if(!this.observers.size){this._parent||d(e),this.eventListeners.clear();return}let t=!1;for(let r of this.observers){let n=r.error;t||=!n;try{n?.(e)}catch(e){d(e)}}this.observers.clear(),this.eventListeners.clear(),t&&d(e)}_error(e){this._stopProcedure(),this._reportError(e),this._parent&&this.system._relay(this,this._parent,l(this.id,e))}_stopProcedure(){return this._processingStatus!==q.Running||(this.system.scheduler.cancelAll(this),this.mailbox.clear(),this.mailbox=new n(this._process.bind(this)),this._processingStatus=q.Stopped,this.system._unregister(this)),this}_send(e){this._processingStatus!==q.Stopped&&this.mailbox.enqueue(e)}send(e){this.system._relay(void 0,this,e)}attachDevTools(){let{devTools:e}=this.options;e&&("function"==typeof e?e:e=>{if("undefined"==typeof window)return;let t=function(){let e="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:void 0!==r.g?r.g:void 0;if(e.__xstate__)return e.__xstate__}();t&&t.register(e)})(this)}toJSON(){return{xstate$$type:R,id:this.id}}getPersistedSnapshot(e){return this.logic.getPersistedSnapshot(this._snapshot,e)}[p](){return this}getSnapshot(){return this._snapshot}}function O(e,...[t]){return new k(e,t)}function A(e,t,r,n,{sendId:s}){return[t,{sendId:"function"==typeof s?s(r,n):s},void 0]}function P(e,t){e.defer(()=>{e.system.scheduler.cancel(e.self,t.sendId)})}function D(e){function t(e,t){}return t.type="xstate.cancel",t.sendId=e,t.resolve=A,t.execute=P,t}function M(e,t,r,n,{id:s,systemId:i,src:o,input:a,syncSnapshot:u}){let c,l,h="string"==typeof o?S(t.machine,o):o,d="function"==typeof s?s(r):s;return h&&(l="function"==typeof a?a({context:t.context,event:r.event,self:e.self}):a,c=O(h,{id:d,src:o,parent:e.self,syncSnapshot:u,systemId:i,input:l})),[eM(t,{children:{...t.children,[d]:c}}),{id:s,systemId:i,actorRef:c,src:o,input:l},void 0]}function N(e,{actorRef:t}){t&&e.defer(()=>{t._processingStatus!==q.Stopped&&t.start()})}function U(...[e,{id:t,systemId:r,input:n,syncSnapshot:s=!1}={}]){function i(e,t){}return i.type="xstate.spawnChild",i.id=t,i.systemId=r,i.src=e,i.input=n,i.syncSnapshot=s,i.resolve=M,i.execute=N,i}function F(e,t,r,n,{actorRef:s}){let i="function"==typeof s?s(r,n):s,o="string"==typeof i?t.children[i]:i,a=t.children;return o&&(a={...a},delete a[o.id]),[eM(t,{children:a}),o,void 0]}function z(e,t){if(t){if(!function e(t,r){let n=r.getSnapshot();if(n&&"children"in n)for(let r of Object.values(n.children))e(t,r);t.system._unregister(r)}(e,t),t._processingStatus!==q.Running)return void e.stopChild(t);e.defer(()=>{e.stopChild(t)})}}function L(e){function t(e,t){}return t.type="xstate.stopChild",t.actorRef=e,t.resolve=F,t.execute=z,t}function V(e,t,{stateValue:r}){if("string"==typeof r&&en(r)){let t=e.machine.getStateNodeById(r);return e._nodes.some(e=>e===t)}return e.matches(r)}function H(e){function t(){return!1}return t.check=V,t.stateValue=e,t}function W(e,{context:t,event:r},{guards:n}){return!G(n[0],t,r,e)}function B(e){function t(e,t){return!1}return t.check=W,t.guards=[e],t}function J(e,{context:t,event:r},{guards:n}){return n.every(n=>G(n,t,r,e))}function X(e){function t(e,t){return!1}return t.check=J,t.guards=e,t}function G(e,t,r,n){let{machine:s}=n,i="function"==typeof e,o=i?e:s.implementations.guards["string"==typeof e?e:e.type];if(!i&&!o)throw Error(`Guard '${"string"==typeof e?e:e.type}' is not implemented.'.`);if("function"!=typeof o)return G(o,t,r,n);let a={context:t,event:r},u=i||"string"==typeof e?void 0:"params"in e?"function"==typeof e.params?e.params({context:t,event:r}):e.params:void 0;return"check"in o?o.check(n,a,o):o(a,u)}function Y(e){return"atomic"===e.type||"final"===e.type}function Q(e){return Object.values(e.states).filter(e=>"history"!==e.type)}function Z(e,t){let r=[];if(t===e)return r;let n=e.parent;for(;n&&n!==t;)r.push(n),n=n.parent;return r}function K(e){let t=new Set(e),r=ee(t);for(let e of t)if("compound"!==e.type||r.get(e)&&r.get(e).length){if("parallel"===e.type){for(let r of Q(e))if("history"!==r.type&&!t.has(r))for(let e of ed(r))t.add(e)}}
2else ed(e).forEach(e=>t.add(e));for(let e of t){let r=e.parent;for(;r;)t.add(r),r=r.parent}return t}function ee(e){let t=new Map;for(let r of e)t.has(r)||t.set(r,[]),r.parent&&(t.has(r.parent)||t.set(r.parent,[]),t.get(r.parent).push(r));return t}function et(e,t){return function e(t,r){let n=r.get(t);if(!n)return{};if("compound"===t.type){let e=n[0];if(!e)return{};if(Y(e))return e.key}let s={};for(let t of n)s[t.key]=e(t,r);return s}(e,ee(K(t)))}function er(e,t){return"compound"===t.type?Q(t).some(t=>"final"===t.type&&e.has(t)):"parallel"===t.type?Q(t).every(t=>er(e,t)):"final"===t.type}let en=e=>"#"===e[0];function es(e,t){let r=e.transitions.get(t),n=[...e.transitions.keys()].filter(e=>e!==t&&I(t,e)).sort((e,t)=>t.length-e.length).flatMap(t=>e.transitions.get(t));return r?[...r,...n]:n}function ei(e){let t=e.config.after;return t?Object.keys(t).flatMap(r=>{let n=t[r],s=Number.isNaN(+r)?r:+r,i=(t=>{var r;let n=(r=e.id,{type:`xstate.after.${t}.${r}`}),s=n.type;return e.entry.push(ez(n,{id:s,delay:t})),e.exit.push(D(s)),s})(s);return v("string"==typeof n?{target:n}:n).map(e=>({...e,event:i,delay:s}))}).map(t=>{let{delay:r}=t;return{...eo(e,t.event,t),delay:r}}):[]}function eo(e,t,r){let n=_(r.target),i=r.reenter??!1,o=function(e,t){if(void 0!==t)return t.map(t=>{if("string"!=typeof t)return t;if(en(t))return e.machine.getStateNodeById(t);let r=t[0]===s;if(r&&!e.parent)return ey(e,t.slice(1));let n=r?e.key+t:t;if(e.parent)try{return ey(e.parent,n)}catch(t){throw Error(`Invalid transition definition for state node '${e.id}':
3${t.message}`)}throw Error(`Invalid target: "${t}" is not a valid target from the root node. Did you mean ".${t}"?`)})}(e,n),a={...r,actions:v(r.actions),guard:r.guard,target:o,source:e,reenter
3:i,eventType:t,toJSON:()=>({...a,source:`#${e.id}`,target:o?o.map(e=>`#${e.id}`):void 0})};return a}function ea(e){let t=new Map;if(e.config.on)for(let r of Object.keys(e.config.on)){if(r===i)throw Error('Null events ("") cannot be specified as a transition key. Use `always: { ... }` instead.');let n=e.config.on[r];t.set(r,w(n).map(t=>eo(e,r,t)))}if(e.config.onDone){let r=`xstate.done.state.${e.id}`;t.set(r,w(e.config.onDone).map(t=>eo(e,r,t)))}for(let r of e.invoke){if(r.onDone){let n=`xstate.done.actor.${r.id}`;t.set(n,w(r.onDone).map(t=>eo(e,n,t)))}if(r.onError){let n=`xstate.error.actor.${r.id}`;t.set(n,w(r.onError).map(t=>eo(e,n,t)))}if(r.onSnapshot){let n=`xstate.snapshot.${r.id}`;t.set(n,w(r.onSnapshot).map(t=>eo(e,n,t)))}}for(let r of e.after){let e=t.get(r.eventType);e||(e=[],t.set(r.eventType,e)),e.push(r)}return t}function eu(e){let t=[],r=n=>{Object.values(n).forEach(n=>{if(n.config.route&&n.config.id){let r=n.config.id,s=n.config.route.guard,i=({event:e})=>e.to===`#${r}`,o={...n.config.route,guard:s?X([i,s]):i,target:`#${r}`};t.push(eo(e,"xstate.route",o))}n.states&&r(n.states)})};r(e.states),t.length>0&&e.transitions.set("xstate.route",t)}function ec(e,t){let r="string"==typeof t?e.states[t]:t?e.states[t.target]:void 0;if(!r&&t)throw Error(`Initial state node "${t}" not found on parent state node #${e.id}`);let n={source:e,actions:t&&"string"!=typeof t?v(t.actions):[],eventType:null,reenter:!1,target:r?[r]:[],toJSON:()=>({...n,source:`#${e.id}`,target:r?[`#${r.id}`]:[]})};return n}function el(e){let t=_(e.config.target);return t?{target:t.map(t=>"string"==typeof t?ey(e.parent,t):t)}:"parallel"===e.parent.type?{target:[e.parent]}:e.parent.initial}function eh(e){return"history"===e.type}function ed(e){let t=ep(e);for(let r of t)for(let n of Z(r,e))t.add(n);return t}function ep(e){let t=new Set;return!function e(r){if(!t.has(r)){if(t.add(r),"compound"===r.type)e(r.initial.target[0]);else if("parallel"===r.type)for(let t of Q(r))e(t)}}(e),t}function ef(e,t){if(en(t))return e.machine.getStateNodeById(t);if(!e.states)throw Error(`Unable to retrieve child state '${t}' from '${e.id}'; no child states exist.`);let r=e.states[t];if(!r)throw Error(`Child state '${t}' does not exist on '${e.id}'`);return r}function ey(e,t){if("string"==typeof t&&en(t))try{return e.machine.getStateNodeById(t)}catch{}let r=f(t).slice(),n=e;for(;r.length;){let e=r.shift();if(!e.length)break;n=ef(n,e)}return n}function eg(e,t){if("string"==typeof t){let r=e.states[t];if(!r)throw Error(`State '${t}' does not exist on '${e.id}'`);return[e,r]}let r=Object.keys(t),n=r.map(t=>ef(e,t)).filter(Boolean);return[e.machine.root,e].concat(n,r.reduce((r,n)=>{let s=ef(e,n);if(!s)return r;let i=eg(s,t[n]);return r.concat(i)},[]))}function ev(e,t){let r=e;for(;r.parent&&r.parent!==t;)r=r.parent;return r.parent===t}function em(e,t,r){let n=new Set;for(let s of e){let e=!1,i=new Set;for(let o of n)if(function(e,t){let r=new Set(e),n=new Set(t);for(let e of r)if(n.has(e))return!0;for(let e of n)if(r.has(e))return!0;return!1}(e_([s],t,r),e_([o],t,r)))if(ev(s.source,o.source))i.add(o);else{e=!0;break}if(!e){for(let e of i)n.delete(e);n.add(s)}}return Array.from(n)}function eb(e,t){if(!e.target)return[];let r=new Set;for(let n of e.target)if(eh(n))if(t[n.id])for(let e of t[n.id])r.add(e);else for(let e of eb(el(n),t))r.add(e);else r.add(n);return[...r]}function ew(e,t){let r=eb(e,t);if(!r)return;if(!e.reenter&&r.every(t=>t===e.source||ev(t,e.source)))return e.source;let n=function(e){let[t,...r]=e;for(let e of Z(t,void 0))if(r.every(t=>ev(t,e)))return e}(r.concat(e.source));return n||(e.reenter?void 0:e.source.machine.root)}function e_(e,t,r){let n=new Set;for(let s of e)if(s.target?.length){let e=ew(s,r);for(let r of(s.reenter&&s.source===e&&n.add(e),t))ev(r,e)&&n.add(r)}return[...n]}function ex(e,t,r,n,s){return eE([{target:[...ep(e)],source:e,reenter
3:!0,actions:[],eventType:null,toJSON:null}],t,r,n,!0,s)}function eE(e,t,r,n,s,i){let o=[];if(!e.length)return[t,o];let a=r.actionExecutor;r.actionExecutor=e=>{o.push(e),a(e)};try{let a=new Set(t._nodes),u=t.historyValue,l=em(e,a,u),h=t;s||([h,u]=function(e,t,r,n,s,i,o,a){let u,c=e,l=e_(n,s,i);for(let e of(l.sort((e,t)=>t.order-e.order),l))for(let t of function(e){return Object.keys(e.states).map(t=>e.states[t]).filter(e=>"history"===e.type)}(e)){let r;r="deep"===t.history?t=>Y(t)&&ev(t,e):t=>t.parent===e,(u??={...i})[t.id]=Array.from(s).filter(r)}for(let e of l)c=eT(c,t,r,[...e.exit,...e.invoke.map(e=>L(e.id))],o,void 0),s.delete(e);return[c,u||i]}(h,n,r,l,a,u,i,r.actionExecutor)),h=eT(h,n,r,l.flatMap(e=>e.actions),i,void 0),h=function(e,t,r,n,s,i,o,a){let u=e,l=new Set,h=new Set;(function(e,t,r,n){for(let s of e){let e=ew(s,t);for(let i of s.target||[])!eh(i)&&(s.source!==i||s.source!==e||s.reenter)&&(n.add(i),r.add(i)),eS(i,t,r,n);for(let i of eb(s,t)){let o=Z(i,e);e?.type==="parallel"&&o.push(e),eI(n,t,r,o,!s.source.parent&&s.reenter?void 0:e)}}})(n,o,h,l),a&&h.add(e.machine.root);let d=new Set;for(let e of[...l].sort((e,t)=>e.order-t.order)){s.add(e);let n=[];for(let t of(n.push(...e.entry),e.invoke))n.push(U(t.src,{...t,syncSnapshot:!!t.onSnapshot}));if(h.has(e)){let t=e.initial.actions;n.push(...t)}if(u=eT(u,t,r,n,i,e.invoke.map(e=>e.id)),"final"===e.type){let n=e.parent,o=n?.type==="parallel"?n:n?.parent,a=o||e;for(n?.type==="compound"&&i.push(c(n.id,void 0!==e.output?m(e.output,u.context,t,r.self):void 0));o?.type==="parallel"&&!d.has(o)&&er(s,o);)d.add(o),i.push(c(o.id)),a=o,o=o.parent;if(o)continue;u=eM(u,{status:"done",output:function(e,t,r,n,s){if(void 0===n.output)return;let i=c(s.id,void 0!==s.output&&s.parent?m(s.output,e.context,t,r.self):void 0);return m(n.output,e.context,i,r.self)}(u,t,r,u.machine.root,a)})}}return u}(h,n,r,l,a,i,u,s);let d=[...a];"done"===h.status&&(h=eT(h,n,r,d.sort((e,t)=>t.order-e.order).flatMap(e=>e.exit),i,void 0));try{if(u===t.historyValue&&function(e,t){if(e.length!==t.size)return!1;for(let r of e)if(!t.has(r))return!1;return!0}(t._nodes,a))return[h,o];return[eM(h,{_nodes:d,historyValue:u}),o]}catch(e){throw e}}finally{r.actionExecutor=a}}function eS(e,t,r,n){var s,i,o,a;if(eh(e))if(t[e.id]){let o=t[e.id];for(let e of o)n.add(e),eS(e,t,r,n);for(let a of o){s=a,i=e.parent,eI(n,t,r,Z(s,i))}}else{let s=el(e);for(let i of s.target)n.add(i),s===e.parent?.initial&&r.add(e.parent),eS(i,t,r,n);for(let i of s.target){o=i,a=e.parent,eI(n,t,r,Z(o,a))}}else if("compound"===e.type){let[s]=e.initial.target;eh(s)||(n.add(s),r.add(s)),eS(s,t,r,n),eI(n,t,r,Z(s,e))}else if("parallel"===e.type)for(let s of Q(e).filter(e=>!eh(e)))[...n].some(e=>ev(e,s))||(eh(s)||(n.add(s),r.add(s)),eS(s,t,r,n))}function eI(e,t,r,n,s){for(let i of n)if((!s||ev(i,s))&&e.add(i),"parallel"===i.type)for(let n of Q(i).filter(e=>!eh(e)))[...e].some(e=>ev(e,n))||(e.add(n),eS(n,t,r,e))}function eT(e,t,r,n,s,i){let o=i?[]:void 0,a=function e(t,r,n,s,i,o){let{machine:a}=t,u=t;for(let t of s){var c;let s="function"==typeof t,l=s?t:(c="string"==typeof t?t:t.type,a.implementations.actions[c]),h={context:u.context,event:r,self:n.self,system:n.system},d=s||"string"==typeof t?void 0:"params"in t?"function"==typeof t.params?t.params({context:u.context,event:r}):t.params:void 0;if(!l||!("resolve"in l)){n.actionExecutor({type:"string"==typeof t?t:"object"==typeof t?t.type:t.name||"(anonymous)",info:h,params:d,exec:l});continue}let[p,f,y]=l.resolve(n,u,h,d,l,i);u=p,"retryResolve"in l&&o?.push([l,f]),"execute"in l&&n.actionExecutor({type:l.type,info:h,params:f,exec:l.execute.bind(null,n,f)}),y&&(u=e(u,r,n,y,i,o))}return u}(e,t,r,n,{internalQueue:s,deferredActorIds:i},o);return o?.forEach(([e,t])=>{e.retryResolve(r,a,t)}),a}function e$(e,t,r,n){let s=e,i=[];function a(e,t,n){r.system._sendInspectionEvent({type:"@xstate.microstep",actorRef:r.self,event:t,snapshot:e[0],_transitions:n}),i.push(e)}if(t.type===u)return a([s=eM(eC(s,t,r),{status:"stopped"}),[]],t,[]),{snapshot:s,microsteps:i};let c=t;if(c.type!==o){let t=c,o=t.type.startsWith("xstate.error.actor"),u=eR(t,s);if(o&&!u.length)return a([s=eM(e,{status:"error",error:t.error}),[]],t,[]),{snapshot:s,microsteps:i};let l=eE(u,e,r,c,!1,n);s=l[0],a(l,t,u)}let l=!0,h=e.machine.options?.maxIterations??1/0,d=0;for(;"active"===s.status;){if(++d>h)throw Error(`Infinite loop detected: the machine has processed more than ${h} microsteps without reaching a stable state. This usually happens when there's a cycle of transitions (e.g., eventless transitions or raised events causing state A -> B -> C -> A).`);let e=l?function(e,t){let r=new Set;for(let n of e._nodes.filter(Y))e:for(let s of[n].concat(Z(n,void 0)))if(s.always){for(let n of s.always)if(void 0===n.guard||G(n.guard,e.context,t,e)){r.add(n);break e}}return em(Array.from(r),new Set(e._nodes),e.historyValue)}(s,c):[],t=e.length?s:void 0;if(!e.length){if(!n.length)break;e=eR(c=n.shift(),s)}let i=eE(e,s,r,c,!1,n);l=(s=i[0])!==t,a(i,c,e)}return"active"!==s.status&&eC(s,c,r),{snapshot:s,microsteps:i}}function eC(e,t,r){return eT(e,t,r,Object.values(e.children).map(e=>L(e)),[],void 0)}function eR(e,t){return t.machine.getTransitionData(t,e)}function eq(e,t){let r=K(eg(e,t));return et(e,[...r])}let ej=function(e){return function e(t,r){let n=y(t),s=y(r);return"string"==typeof s?"string"==typeof n&&s===n:"string"==typeof n?n in s:Object.keys(n).every(t=>t in s&&e(n[t],s[t]))}(e,this.value)},ek=function(e){return this.tags.has(e)},eO=function(e){let t=this.machine.getTransitionData(this,e);return!!t?.length&&t.some(e=>void 0!==e.target||e.actions.length)},eA=function(){let{_nodes:e,tags:t,machine:r,getMeta:n,toJSON:s,can:i,hasTag:o,matches:a,...u}=this;return{...u,tags:Array.from(t)}},eP=function(){return this._nodes.reduce((e,t)=>
3(void 0!==t.meta&&(e[t.id]=t.meta),e),{})};function eD(e,t){return{status:e.status,output:e.output,error:e.error,machine:t,context:e.context,_nodes:e._nodes,value:et(t.root,e._nodes),tags:new Set(e._nodes.flatMap(e=>e.tags)),children:e.children,historyValue:e.historyValue||{},matches:ej,hasTag:ek,can:eO,getMeta:eP,toJSON:eA}}function eM(e,t={}){return eD({...e,...t},e.machine)}function eN(e,t){let{_nodes:r,tags:n,machine:s,children:i,context:o,can:a,hasTag:u,matches:c,getMeta:l,toJSON:h,...d}=e,p={};for(let e in i){let r=i[e];p[e]={snapshot:r.getPersistedSnapshot(t),src:r.src,systemId:r.systemId,syncSnapshot:r._syncSnapshot}}return{...d,context:function e(t){let r;for(let n in t){let s=t[n];if(s&&"object"==typeof s)if("sessionId"in s&&"send"in s&&"ref"in s)(r??=Array.isArray(t)?t.slice():{...t})[n]={xstate$$type:R,id:s.id};else{let i=e(s);i!==s&&((r??=Array.isArray(t)?t.slice():{...t})[n]=i)}}return r??t}(o),children:p,historyValue:function(e){if("object"!=typeof e||null===e)return{};let t={};for(let r in e){let n=e[r];Array.isArray(n)&&(t[r]=n.map(e=>({id:e.id})))}return t}(d.historyValue)}}function eU(e,t,r,n,{event:s,id:i,delay:o},{internalQueue:a}){let u,c=t.machine.implementations.delays;if("string"==typeof s)throw Error(`Only event objects may be used with raise; use raise({ type: "${s}" }) instead`);let l="function"==typeof s?s(r,n):s;if("string"==typeof o){let e=c&&c[o];u="function"==typeof e?e(r,n):e}else u="function"==typeof o?o(r,n):o;return"number"!=typeof u&&a.push(l),[t,{event:l,id:i,delay:u},void 0]}function eF(e,t){let{event:r,delay:n,id:s}=t;if("number"==typeof n)return void e.defer(()=>{let t=e.self;e.system.scheduler.schedule(t,t,r,n,s)})}function ez(e,t){function r(e,t){}return r.type="xstate.raise",r.event=e,r.id=t?.id,r.delay=t?.delay,r.resolve=eU,r.execute=eF,r}},31962:(e,t,r)=>{r.d(t,{f:()=>s});var n=r(60827),s={setTimeout:function(e,t){for(var r=[],i=2;i<arguments.length;i++)r[i-2]=arguments[i];var o=s.delegate;return(null==o?void 0:o.setTimeout)?o.setTimeout.apply(o,(0,n.fX)([e,t],(0,n.zs)(r))):setTimeout.apply(void 0,(0,n.fX)([e,t],(0,n.zs)(r)))},clearTimeout:function(e){var t=s.delegate;return((null==t?void 0:t.clearTimeout)||clearTimeout)(e)},delegate:void 0}},31972:(e,t,r)=>{r.d(t,{y:()=>s});var n=r(5251);function s(e){return(0,n.T)(null==e?void 0:e.then)}},32968:(e,t,r)=>{r.d(t,{E:()=>s,b:()=>i});var n=r(44285),s=new(r(7039)).q(n.R),i=s},33071:(e,t,r)=>{r.d(t,{X:()=>n});var n=function(e){return e&&"number"==typeof e.length&&"function"!=typeof e}},34547:(e,t,r)=>{r.d(t,{v:()=>n});function n(e){return e instanceof Date&&!isNaN(e)}},36309:(e,t,r)=>{r.d(t,{M:()=>a});var n=r(5251),s=r(8482),i=r(85473),o=r(44385);function a(e,t,r){var a=(0,n.T)(e)||t||r?{next:e,error:t,complete:r}:e;return a?(0,s.N)(function(e,t){null==(r=a.subscribe)||r.call(a);var r,n=!0;e.subscribe((0,i._)(t,function(e){var r;null==(r=a.next)||r.call(a,e),t.next(e)},function(){var e;n=!1,null==(e=a.complete)||e.call(a),t.complete()},function(e){var r;n=!1,null==(r=a.error)||r.call(a,e),t.error(e)},function(){var e,t;n&&(null==(e=a.unsubscribe)||e.call(a)),null==(t=a.finalize)||t.call(a)}))}):o.D}},38038:(e,t,r)=>{r.d(t,{A:()=>i});var n=r(14511),s=r(5251);function i(e){return!!e&&(e instanceof n.c||(0,s.T)(e.lift)&&(0,s.T)(e.subscribe))}},38430:(e,t,r)=>{r.d(t,{H:()=>i});var n=r(11526),s=r(5251);function i(e,t){return(0,s.T)(t)?(0,n.Z)(e,t,1):(0,n.Z)(e,1)}},41640:(e,t,r)=>{r.d(t,{v:()=>i});var n=r(14511),s=r(67060);function i(e){return new n.c(function(t){(0,s.Tg)(e()).subscribe(t)})}},42631:(e,t,r)=>{r.d(t,{s:()=>o});var n=r(22529),s=r(8482),i=r(85473);function o(e){return e<=0?function(){return n.w}:(0,s.N)(function(t,r){var n=0;t.subscribe((0,i._)(r,function(t){++n<=e&&(r.next(t),e<=n&&r.complete())}))})}},44285:(e,t,r)=>{r.d(t,{R:()=>a});var n=r(60827),s=function(e){function t(t,r){return e.call(this)||this}return(0,n.C6)(t,e),t.prototype.schedule=function(e,t){return void 0===t&&(t=0),this},t}(r(1253).yU),i={setInterval:function(e,t){for(var r=[],s=2;s<arguments.length;s++)r[s-2]=arguments[s];var o=i.delegate;return(null==o?void 0:o.setInterval)?o.setInterval.apply(o,(0,n.fX)([e,t],(0,n.zs)(r))):setInterval.apply(void 0,(0,n.fX)([e,t],(0,n.zs)(r)))},clearInterval:function(e){var t=i.delegate;return((null==t?void 0:t.clearInterval)||clearInterval)(e)},delegate:void 0},o=r(61278),a=function(e){function t(t,r){var n=e.call(this,t,r)||this;
3return n.scheduler=t,n.work=r,n.pending=!1,n}return(0,n.C6)(t,e),t.prototype.schedule=function(e,t){if(void 0===t&&(t=0),this.closed)return this;this.state=e;var r,n=this.id,s=this.scheduler;return null!=n&&(this.id=this.recycleAsyncId(s,n,t)),this.pending=!0,this.delay=t,this.id=null!=(r=this.id)?r:this.requestAsyncId(s,this.id,t),this},t.prototype.requestAsyncId=function(e,t,r){return void 0===r&&(r=0),i.setInterval(e.flush.bind(e,this),r)},t.prototype.recycleAsyncId=function(e,t,r){if(void 0===r&&(r=0),null!=r&&this.delay===r&&!1===this.pending)return t;null!=t&&i.clearInterval(t)},t.prototype.execute=function(e,t){if(this.closed)return Error("executing a cancelled action");this.pending=!1;var r=this._execute(e,t);if(r)return r;!1===this.pending&&null!=this.id&&(this.id=this.recycleAsyncId(this.scheduler,this.id,null))},t.prototype._execute=function(e,t){var r,n=!1;try{this.work(e)}catch(e){n=!0,r=e||Error("Scheduled action threw falsy error")}if(n)return this.unsubscribe(),r},t.prototype.unsubscribe=function(){if(!this.closed){var t=this.id,r=this.scheduler,n=r.actions;this.work=this.state=this.scheduler=null,this.pending=!1,(0,o.o)(n,this),null!=t&&(this.id=this.recycleAsyncId(r,t,null)),this.delay=null,e.prototype.unsubscribe.call(this)}},t}(s)},44385:(e,t,r)=>{r.d(t,{D:()=>n});function n(e){return e}},44527:(e,t,r)=>{function n(e){return"object"==typeof e&&null!==e&&!Array.isArray(e)}r.d(t,{Q:()=>h,u4:()=>n,y:()=>u});var s={0:8203,1:8204,2:8205,3:8290,4:8291,5:8288,6:65279,7:8289,8:119155,9:119156,a:119157,b:119158,c:119159,d:119160,e:119161,f:119162},i={0:8203,1:8204,2:8205,3:65279},o={0:String.fromCodePoint(i[0]),1:String.fromCodePoint(i[1]),2:String.fromCodePoint(i[2]),3:String.fromCodePoint(i[3])},a=[,,,,].fill(String.fromCodePoint(i[0])).join("");function u(e,t,r="auto"){return!0===r||"auto"===r&&(!(!Number.isNaN(Number(e))||/[a-z]/i.test(e)&&!/\d+(?:[-:\/]\d+){2}(?:T\d+(?:[-:\/]\d+){1,2}(\.\d+)?Z?)?/.test(e))&&Date.parse(e)||function(e){try{new URL(e,e.startsWith("/")?"https://acme.com":void 0)}catch{return!1}return!0}(e))?e:`${e}${function(e){let t=JSON.stringify(e),r=new TextEncoder().encode(t),n="";for(let e=0;e<r.length;e++){let t=r[e];n+=o[t>>6&3]+o[t>>4&3]+o[t>>2&3]+o[3&t]}return a+n}(t)}`}Object.fromEntries(Object.entries(o).map(e=>[e[1],+e[0]])),Object.fromEntries(Object.entries(s).map(e=>e.reverse()));var c=`${Object.values(s).map(e=>`\\u{${e.toString(16)}}`).join("")}`,l=RegExp(`[${c}]{4,}`,"gu");function h(e){var t,r;return e&&JSON.parse({cleaned:(t=JSON.stringify(e)).replace(l,""),encoded:(null==(r=t.match(l))?void 0:r[0])||""}.cleaned)}},44935:(e,t,r)=>{r.d(t,{V2:()=>I,FS:()=>C,IM:()=>j,Tx:()=>R,Rr:()=>q,vd:()=>$,_K:()=>T,CC:()=>S,RM:()=>A,Uc:()=>O,tP:()=>k});var n=r(53454),s=r(25382),i=r(3689),o=r(1807),a=r(79216),u=r(30701),c=r(41640),l=r(83208),h=r(75478),d=r(70019),p=r(28886),f=r(60827),y=r(8482),g=r(85473),v=r(61278),m=r(38430),b=r(42631),w=r(22529),_=r(13325);let x=e=>({context:t})=>{let{count:r,include:n,exclude:s,responseType:i="message.received"}=e;return{count:r,domain:t.domain,from:t.connectTo,include:n?Array.isArray(n)?n:[n]:[],exclude:s?Array.isArray(s)?s:[s]:[],responseType:i,target:t.target,to:t.name}},E=(0,c.v)(()=>(0,l.R)(window,"message")),S=e=>(0,s.OX)(({input:t})=>{let r;return E.pipe(e?(0,h.T)(e):(0,d.F)(),(0,p.p)((e=>t=>{let{data:r}=t;return(!e.include.length||e.include.includes(r.type))&&(!e.exclude.length||!e.exclude.includes(r.type))&&r.domain===e.domain&&r.from===e.from&&r.to===e.to&&(!e.target||t.source===e.target)})(t)),(0,h.T)((r=t.responseType,e=>({type:r,message:e}))),t.count?(0,d.F)(function(e,t){return void 0===t&&(t=null),t=null!=t?t:e,(0,y.N)(function(r,n){var s=[],i=0;r.subscribe((0,g._)(n,function(r){var o,a,u,c,l=null;i++%t==0&&s.push([]);try{for(var h=(0,f.Ju)(s),d=h.next();!d.done;d=h.next()){var p=d.value;p.push(r),e<=p.length&&(l=null!=l?l:[]).push(p)}}catch(e){o={error:e}}finally{try{d&&!d.done&&(a=h.return)&&a.call(h)}finally{if(o)throw o.error}}if(l)try{for(var y=(0,f.Ju)(l),g=y.next();!g.done;g=y.next()){var p=g.value;(0,v.o)(s,p),n.next(p)}}catch(e){u={error:e}}finally{try{g&&!g.done&&(c=y.return)&&c.call(y)}finally{if(u)throw u.error}}},function(){var e,t;try{for(var r=(0,f.Ju)(s),i=r.next();!i.done;i=r.next()){var o=i.value;n.next(o)}}catch(t){e={error:t}}finally{try{i&&!i.done&&(t=r.return)&&t.call(r)}finally{if(e)throw e.error}}n.complete()},void 0,function(){s=null}))})}(t.count),(0,m.H)(e=>e),(0,b.s)(t.count)):(0,d.F)())}),I="sanity/comlink",T="comlink/response",$="comlink/heartbeat",C="comlink/disconnect",R="comlink/handshake/syn",q="comlink/handshake/syn-ack",j="comlink/handshake/ack",k=()=>(0,i.mj)({types:{},actors:{listen:(0,s.OX)(({input:e})=>{let t,r=e.signal?(0,l.R)(e.signal,"abort").pipe((t=`Request ${e.requestId} aborted`,e=>e.pipe((0,b.s)(1),(0,h.T)(()=>{throw Error(t)})))):w.w;return(0,l.R)(window,"message").pipe((0,p.p)(t=>t.data?.type===T&&t.data?.responseTo===e.requestId&&!!t.source&&e.sources.has(t.source)),(0,b.s)(e.s
3ources.size),(0,_.Q)(r))})},actions:{"send message":({context:e},t)=>{let{sources:r,targetOrigin:n}=e,{message:s}=t;r.forEach(e=>{e.postMessage(s,{targetOrigin:n})})},"on success":(0,o.s)(({context:e})=>e.parentRef,({context:e,self:t})=>(e.response&&e.resolvable?.resolve(e.response),{type:"request.success",requestId:t.id,response:e.response,responseTo:e.responseTo})),"on fail":(0,o.s)(({context:e})=>e.parentRef,({context:e,self:t})=>(e.suppressWarnings||console.warn(`[@sanity/comlink] Received no response to message '${e.type}' on client '${e.from}' (ID: '${e.id}').`),e.resolvable?.reject(Error("No response received")),{type:"request.failed",requestId:t.id})),"on abort":(0,o.s)(({context:e})=>e.parentRef,({context:e,self:t})=>(e.resolvable?.reject(Error("Request aborted")),{type:"request.aborted",requestId:t.id}))},guards:{expectsResponse:({context:e})=>e.expectResponse},delays:{initialTimeout:0,responseTimeout:({context:e})=>e.responseTimeout??3e3}}).createMachine({context:({input:e})=>({channelId:e.channelId,data:e.data,domain:e.domain,expectResponse:e.expectResponse??!1,from:e.from,id:`msg-${(0,n.A)()}`,parentRef:e.parentRef,resolvable:e.resolvable,response:null,responseTimeout:e.responseTimeout,responseTo:e.responseTo,signal:e.signal,sources:e.sources instanceof Set?e.sources:new Set([e.sources]),suppressWarnings:e.suppressWarnings,targetOrigin:e.targetOrigin,to:e.to,type:e.type}),initial:"idle",on:{abort:".aborted"},states:{idle:{after:{initialTimeout:[{target:"sending"}]}},sending:{entry:{type:"send message",params:({context:e})=>{let{channelId:t,data:r,domain:n,from:s,id:i,responseTo:o,to:a,type:u}=e;return{message:{channelId:t,data:r,domain:n,from:s,id:i,to:a,type:u,responseTo:o}}}},always:[{guard:"expectsResponse",target:"awaiting"},"success"]},awaiting:{invoke:{id:"listen for response",src:"listen",input:({context:e})=>({requestId:e.id,sources:e.sources,signal:e.signal}),onError:"aborted"},after:{responseTimeout:"failed"},on:{message:{actions:(0,a.a)({response:({event:e})=>e.data.data,responseTo:({event:e})=>e.data.responseTo}),target:"success"}}},failed:{type:"final",entry:"on fail"},success:{type:"final",entry:"on success"},aborted:{type:"final",entry:"on abort"}},output:({context:e,self:t})=>({requestId:t.id,response:e.response,responseTo:e.responseTo})});(0,s.SP)(({sendBack:e,input:t})=>{let r=()=>{e(t.event)};t.immediate&&r();let n=setInterval(r,t.interval);return()=>{clearInterval(n)}});let O=()=>(0,i.mj)({types:{},actors:{requestMachine:k(),listen:S()},actions:{"buffer handshake":(0,a.a)({handshakeBuffer:({event:e,context:t})=>((0,i.DT)(e,"message.received"),[...t.handshakeBuffer,e])}),"buffer message":(0,o.e)(({enqueue:e})=>{e.assign({buffer:({event:e,context:t})=>((0,i.DT)(e,"post"),[...t.buffer,{data:e.data,resolvable:e.resolvable,options:e.options}])}),e.emit(({event:e})=>((0,i.DT)(e,"post"),{type:"buffer.added",message:e.data}))}),"create request":(0,a.a)({requests:({context:e,event:t,self:r,spawn:s})=>{(0,i.DT)(t,"request");let o=(Array.isArray(t.data)?t.data:[t.data]).map(t=>s("requestMachine",{id:`req-${(0,n.A)()}`,input:{channelId:e.channelId,data:t.data,domain:e.domain,expectResponse:t.expectResponse,from:e.name,parentRef:r,resolvable:t.resolvable,responseTimeout:t.options?.responseTimeout,responseTo:t.responseTo,signal:t.options?.signal,sources:e.target,suppressWarnings:t.options?.suppressWarnings,targetOrigin:e.targetOrigin,to:e.connectTo,type:t.type}}));return[...e.requests,...o]}}),"emit heartbeat":(0,o.a)(()=>({type:"heartbeat"})),"emit received message":(0,o.e)(({enqueue:e})=>{e.emit(({event:e})=>((0,i.DT)(e,"message.received"),{type:"message",message:e.message.data}))}),"emit status":(0,o.a)((e,t)=>({type:"status",status:t.status})),"post message":(0,u.r)(({event:e})=>((0,i.DT)(e,"post"),{type:"request",data:{data:e.data.data,expectResponse:!!e.resolvable,type:e.data.type,resolvable:e.resolvable,options:e.options}})),"process pending handshakes":(0,o.e)(({context:e,enqueue:t})=>{e.handshakeBuffer.forEach(e=>t.raise(e)),t.assign({handshakeBuffer:[]})}),"remove request":(0,o.e)(({context:e,enqueue:t,event:r})=>{(0,i.DT)(r,["request.success","request.failed","request.aborted"]),(0,u.s)(r.requestId),t.assign({requests:e.requests.filter(({id:e})=>e!==r.requestId)})}),"send response":(0,u.r)(({event:e})=>((0,i.DT)(e,["message.received","heartbeat.received"]),{type:"request",data:{type:T,responseTo:e.message.data.id,data:void 0}})),"send handshake syn ack":(0,u.r)({type:"request",data:{type:q}}),"send pending messages":(0,o.e)(({enqueue:e})=>{e.raise(({context:e})=>({type:"request",data:e.buffer.map(({data:e,resolvable:t,options:r})=>({data:e.data,type:e.type,expectResponse:!!t,resolvable:t,options:r}))})),e.emit(({context:e})=>({type:"buffer.flushed",messages:e.buffer.map(({data:e})=>e)}
3)),e.assign({buffer:[]})}),"set connection config":(0,a.a)({channelId:({event:e})=>((0,i.DT)(e,"handshake.syn"),e.message.data.channelId),target:({event:e})=>((0,i.DT)(e,"handshake.syn"),e.message.source||void 0),targetOrigin:({event:e})=>((0,i.DT)(e,"handshake.syn"),e.message.origin)})},guards:{hasSource:({context:e})=>null!==e.target}}).createMachine({id:"node",context:({input:e})=>({buffer:[],channelId:null,connectTo:e.connectTo,domain:e.domain??I,handshakeBuffer:[],name:e.name,requests:[],target:void 0,targetOrigin:null}),invoke:{id:"listen for handshake syn",src:"listen",input:x({include:R,responseType:"handshake.syn"})},on:{"request.success":{actions:"remove request"},"request.failed":{actions:"remove request"},"request.aborted":{actions:"remove request"},"handshake.syn":{actions:"set connection config",target:".handshaking"}},initial:"idle",states:{idle:{entry:[{type:"emit status",params:{status:"idle"}}],on:{post:{actions:"buffer message"}}},handshaking:{guard:"hasSource",entry:["send handshake syn ack",{type:"emit status",params:{status:"handshaking"}}],invoke:[{id:"listen for handshake ack",src:"listen",input:x({include:j,count:1,responseType:"handshake.complete"}),onDone:"connected"},{id:"listen for disconnect",src:"listen",input:x({include:C,count:1,responseType:"disconnect"})},{id:"listen for messages",src:"listen",input:x({exclude:[C,R,j,$,T]})}],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:[C,R,j,$,T]})},{id:"listen for heartbeat",src:"listen",input:x({include:$,responseType:"heartbeat.received"})},{id:"listen for disconnect",src:"listen",input:x({include:C,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"]}}}}}),A=(e,t=O())=>{let r,n=(0,u.c)(t,{input:e}),s=new Map,i=new Map;n.on("message",({message:e})=>{let t=s.get(e.type);if(t)return void t.forEach(t=>t(e.data));let r=i.get(e.type);r?r.add(e):i.set(e.type,new Set([e]))});let o=()=>{n.stop()};return{actor:n,fetch:(e,t,r)=>{let{responseTimeout:s=1e4,signal:i,suppressWarnings:o}=r||{},a=function(){let e,t;return"function"==typeof Promise.withResolvers?Promise.withResolvers():{promise:new Promise((r,n)=>{e=r,t=n}),resolve:e,reject:t}}();return n.send({type:"post",data:{type:e,data:t},resolvable:a,options:{responseTimeout:s,signal:i,suppressWarnings:o}}),a.promise},machine:t,on:(e,t,r)=>{let n=s.get(e)||new Set;s.has(e)||s.set(e,n),n.add(t);let o=i.get(e);if(o){let n=r?.replay??1;Array.from(o).slice(-n).forEach(({data:e})=>t(e)),i.delete(e)}return()=>{n.delete(t)}},onStatus:(e,t)=>{let s=n.on("status",n=>{r=n.status,t&&n.status!==t||e(n.status)});return r&&e(r),()=>s.unsubscribe()},post:(e,t)=>{n.send({type:"post",data:{type:e,data:t}})},start:()=>(n.start(),o),stop:o}}},45412:(e,t,r)=>{r.d(t,{t:()=>i});var n=r(15595),s=r(54039);function i(e,t,r){var i,o,a,u,c=!1;return e&&"object"==typeof e?(u=void 0===(i=e.bufferSize)?1/0:i,t=void 0===(o=e.windowTime)?1/0:o,c=void 0!==(a=e.refCount)&&a,r=e.scheduler):u=null!=e?e:1/0,(0,s.u)({connector:function(){return new n.m(u,t,r)},resetOnError:!0,resetOnComplete:!1,resetOnRefCountZero:c})}},46137:(e,t,r)=>{r.d(t,{L:()=>n});function n(e){var t=e(function(e){Error.call(e),e.stack=Error().stack});return t.prototype=Object.create(Error.prototype),t.prototype.constructor=t,t}},48714:(e,t,r)=>{r.d(t,{j:()=>s});var n=r(8482);function s(e){return(0,n.N)(function(t,r){try{t.subscribe(r)}finally{r.add(e)}})}},49130:(e,t,r)=>{r.d(t,{m:()=>i});var n=r(9652),s=r(31962);function i(e){s.f.setTimeout(function(){var t=n.$.onUnhandledError;if(t)t(e);else throw e})}},50274:(e,t,r)=>{r.d(t,{R0:()=>u,lI:()=>a,ms:()=>o});var n=r(5251),s=r(59036);function i(e){return e[e.length-1]}function o(e){return(0,n.T)(i(e))?e.pop():void 0}function a(e){return(0,s.m)(i(e))?e.pop():void 0}function u(e,t){return"number"==typeof i(e)?e.pop():t}},53454:(e,t,r)=>{let n;r.d(t,{A:()=>a});let s={randomUUID:"undefined"!=typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)},i=new Uint8Array(16),o=[];for(let e=0;e<256;++e)o.push((e+256).toString(16).slice(1));let a=function(e,t,r){if(s.randomUUID&&!t&&!e)return s.randomUUID();let a=(e=e||{}
3).random??e.rng?.()??function(){if(!n){if("undefined"==typeof crypto||!crypto.getRandomValues)throw Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");n=crypto.getRandomValues.bind(crypto)}return n(i)}();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,t){if((r=r||0)<0||r+16>t.length)throw RangeError(`UUID byte range ${r}:${r+15} is out of buffer bounds`);for(let e=0;e<16;++e)t[r+e]=a[e];return t}return function(e,t=0){return(o[e[t+0]]+o[e[t+1]]+o[e[t+2]]+o[e[t+3]]+"-"+o[e[t+4]]+o[e[t+5]]+"-"+o[e[t+6]]+o[e[t+7]]+"-"+o[e[t+8]]+o[e[t+9]]+"-"+o[e[t+10]]+o[e[t+11]]+o[e[t+12]]+o[e[t+13]]+o[e[t+14]]+o[e[t+15]]).toLowerCase()}(a)}},54039:(e,t,r)=>{r.d(t,{u:()=>u});var n=r(60827),s=r(67060),i=r(24976),o=r(7654),a=r(8482);function u(e){void 0===e&&(e={});var t=e.connector,r=void 0===t?function(){return new i.B}:t,n=e.resetOnError,u=void 0===n||n,l=e.resetOnComplete,h=void 0===l||l,d=e.resetOnRefCountZero,p=void 0===d||d;return function(e){var t,n,i,l=0,d=!1,f=!1,y=function(){null==n||n.unsubscribe(),n=void 0},g=function(){y(),t=i=void 0,d=f=!1},v=function(){var e=t;g(),null==e||e.unsubscribe()};return(0,a.N)(function(e,a){l++,f||d||y();var m=i=null!=i?i:r();a.add(function(){0!=--l||f||d||(n=c(v,p))}),m.subscribe(a),!t&&l>0&&(t=new o.Ms({next:function(e){return m.next(e)},error:function(e){f=!0,y(),n=c(g,u,e),m.error(e)},complete:function(){d=!0,y(),n=c(g,h),m.complete()}}),(0,s.Tg)(e).subscribe(t))})(e)}}function c(e,t){for(var r=[],i=2;i<arguments.length;i++)r[i-2]=arguments[i];if(!0===t)return void e();if(!1!==t){var a=new o.Ms({next:function(){a.unsubscribe(),e()}});return(0,s.Tg)(t.apply(void 0,(0,n.fX)([],(0,n.zs)(r)))).subscribe(a)}}},58709:(e,t,r)=>{r.d(t,{l:()=>i});var n=r(19710),s=r(5251);function i(e){return(0,s.T)(e[n.s])}},59036:(e,t,r)=>{r.d(t,{m:()=>s});var n=r(5251);function s(e){return e&&(0,n.T)(e.schedule)}},59477:(e,t,r)=>{r.d(t,{O:()=>a});var n=r(14511),s=r(32968),i=r(59036),o=r(34547);function a(e,t,r){void 0===e&&(e=0),void 0===r&&(r=s.b);var a=-1;return null!=t&&((0,i.m)(t)?r=t:a=t),new n.c(function(t){var n=(0,o.v)(e)?e-r.now():e;n<0&&(n=0);var s=0;return r.schedule(function(){t.closed||(t.next(s++),0<=a?this.schedule(void 0,a):t.complete())},n)})}},60827:(e,t,r)=>{r.d(t,{AQ:()=>d,C6:()=>s,Cl:()=>i,Ju:()=>u,N3:()=>h,YH:()=>a,fX:()=>l,sH:()=>o,xN:()=>p,zs:()=>c});var n=function(e,t){return(n=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)};function s(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}var i=function(){return(i=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var s in t=arguments[r])Object.prototype.hasOwnProperty.call(t,s)&&(e[s]=t[s]);return e}).apply(this,arguments)};function o(e,t,r,n){return new(r||(r=Promise))(function(s,i){function o(e){try{u(n.next(e))}catch(e){i(e)}}function a(e){try{u(n.throw(e))}catch(e){i(e)}}function u(e){var t;e.done?s(e.value):((t=e.value)instanceof r?t:new r(function(e){e(t)})).then(o,a)}u((n=n.apply(e,t||[])).next())})}function a(e,t){var r,n,s,i={label:0,sent:function(){if(1&s[0])throw s[1];return s[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){var c=[a,u];if(r)throw TypeError("Generator is already executing.");for(;o&&(o=0,c[0]&&(i=0)),i;)try{if(r=1,n&&(s=2&c[0]?n.return:c[0]?n.throw||((s=n.return)&&s.call(n),0):n.next)&&!(s=s.call(n,c[1])).done)return s;switch(n=0,s&&(c=[2&c[0],s.value]),c[0]){case 0:case 1:s=c;break;case 4:return i.label++,{value:c[1],done:!1};case 5:i.label++,n=c[1],c=[0];continue;case 7:c=i.ops.pop(),i.trys.pop();continue;default:if(!(s=(s=i.trys).length>0&&s[s.length-1])&&(6===c[0]||2===c[0])){i=0;continue}if(3===c[0]&&(!s||c[1]>s[0]&&c[1]<s[3])){i.label=c[1];break}if(6===c[0]&&i.label<s[1]){i.label=s[1],s=c;break}if(s&&i.label<s[2]){i.label=s[2],i.ops.push(c);break}s[2]&&i.ops.pop(),i.trys.pop();continue}c=t.call(e,i)}catch(e){c=[6,e],n=0}finally{r=s=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}}function u(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);
3if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function c(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,s,i=r.call(e),o=[];try{for(;(void 0===t||t-- >0)&&!(n=i.next()).done;)o.push(n.value)}catch(e){s={error:e}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(s)throw s.error}}return o}function l(e,t,r){if(r||2==arguments.length)for(var n,s=0,i=t.length;s<i;s++)!n&&s in t||(n||(n=Array.prototype.slice.call(t,0,s)),n[s]=t[s]);return e.concat(n||Array.prototype.slice.call(t))}function h(e){return this instanceof h?(this.v=e,this):new h(e)}function d(e,t,r){if(!Symbol.asyncIterator)throw TypeError("Symbol.asyncIterator is not defined.");var n,s=r.apply(e,t||[]),i=[];return n=Object.create(("function"==typeof AsyncIterator?AsyncIterator:Object).prototype),o("next"),o("throw"),o("return",function(e){return function(t){return Promise.resolve(t).then(e,c)}}),n[Symbol.asyncIterator]=function(){return this},n;function o(e,t){s[e]&&(n[e]=function(t){return new Promise(function(r,n){i.push([e,t,r,n])>1||a(e,t)})},t&&(n[e]=t(n[e])))}function a(e,t){try{var r;(r=s[e](t)).value instanceof h?Promise.resolve(r.value.v).then(u,c):l(i[0][2],r)}catch(e){l(i[0][3],e)}}function u(e){a("next",e)}function c(e){a("throw",e)}function l(e,t){e(t),i.shift(),i.length&&a(i[0][0],i[0][1])}}function p(e){if(!Symbol.asyncIterator)throw TypeError("Symbol.asyncIterator is not defined.");var t,r=e[Symbol.asyncIterator];return r?r.call(e):(e=u(e),t={},n("next"),n("throw"),n("return"),t[Symbol.asyncIterator]=function(){return this},t);function n(r){t[r]=e[r]&&function(t){return new Promise(function(n,s){var i,o,a;i=n,o=s,a=(t=e[r](t)).done,Promise.resolve(t.value).then(function(e){i({value:e,done:a})},o)})}}}Object.create,Object.create,"function"==typeof SuppressedError&&SuppressedError},61278:(e,t,r)=>{r.d(t,{o:()=>n});function n(e,t){if(e){var r=e.indexOf(t);0<=r&&e.splice(r,1)}}},61910:(e,t,r)=>{r.d(t,{K:()=>s});var n=Array.isArray;function s(e){return 1===e.length&&n(e[0])?e[0]:e}},62841:(e,t,r)=>{r.d(t,{U:()=>n});var n={now:function(){return(n.delegate||Date).now()},delegate:void 0}},64081:(e,t,r)=>{r.d(t,{S:()=>s});var n=r(85473);function s(e,t,r,s,i){return function(o,a){var u=r,c=t,l=0;o.subscribe((0,n._)(a,function(t){var r=l++;c=u?e(c,t,r):(u=!0,t),s&&a.next(c)},i&&function(){u&&a.next(c),a.complete()}))}}},64996:(e,t,r)=>{r.d(t,{e:()=>n});function n(e,t){return e.reduce(function(e,r,n){return e[r]=t[n],e},{})}},66399:(e,t,r)=>{r.d(t,{Q6:()=>e3,MZ:()=>ev,u_:()=>eS,gP:()=>em,UU:()=>ra});let n=!(typeof navigator>"u")&&"ReactNative"===navigator.product,s={timeout:n?6e4:12e4},i=function(e){let t={...s,..."string"==typeof e?{url:e}:e};if(t.timeout=function e(t){if(!1===t||0===t)return!1;if(t.connect||t.socket)return t;let r=Number(t);return isNaN(r)?e(s.timeout):{connect:r,socket:r}}(t.timeout),t.query){let{url:e,searchParams:r}=function(e){let t=e.indexOf("?");if(-1===t)return{url:e,searchParams:new URLSearchParams};let r=e.slice(0,t),s=e.slice(t+1);if(!n)return{url:r,searchParams:new URLSearchParams(s)};if("function"!=typeof decodeURIComponent)throw Error("Broken `URLSearchParams` implementation, and `decodeURIComponent` is not defined");let i=new URLSearchParams;for(let e of s.split("&")){let[t,r]=e.split("=");t&&i.append(o(t),o(r||""))}return{url:r,searchParams:i}}(t.url);for(let[n,s]of Object.entries(t.query)){if(void 0!==s)if(Array.isArray(s))for(let e of s)r.append(n,e);else r.append(n,s);let i=r.toString();i&&(t.url=`${e}?${i}`)}}return t.method=t.body&&!t.method?"POST":(t.method||"GET").toUpperCase(),t};function o(e){return decodeURIComponent(e.replace(/\+/g," "))}let a=/^https?:\/\//i,u=function(e){if(!a.test(e.url))throw Error(`"${e.url}" is not a valid URL`)},c=["request","response","progress","error","abort"],l=["processOptions","validateOptions","interceptRequest","finalizeOptions","onRequest","onResponse","onError","onReturn","onHeaders"];
3var h,d,p=function(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}(function(){if(d)return h;d=1;var e=function(e){return e.replace(/^\s+|\s+$/g,"")};return h=function(t){if(!t)return{};for(var r=Object.create(null),n=e(t).split("\n"),s=0;s<n.length;s++){var i,o=n[s],a=o.indexOf(":"),u=e(o.slice(0,a)).toLowerCase(),c=e(o.slice(a+1));typeof r[u]>"u"?r[u]=c:(i=r[u],"[object Array]"===Object.prototype.toString.call(i))?r[u].push(c):r[u]=[r[u],c]}return r}}());class f{onabort;onerror;onreadystatechange;ontimeout;readyState=0;response;responseText="";responseType="";status;statusText;withCredentials;#e;#t;#r;#n={};#s;#i={};#o;open(e,t,r){this.#e=e,this.#t=t,this.#r="",this.readyState=1,this.onreadystatechange?.(),this.#s=void 0}abort(){this.#s&&this.#s.abort()}getAllResponseHeaders(){return this.#r}setRequestHeader(e,t){this.#n[e]=t}setInit(e,t=!0){this.#i=e,this.#o=t}send(e){let t="arraybuffer"!==this.responseType,r={...this.#i,method:this.#e,headers:this.#n,body:e};"function"==typeof AbortController&&this.#o&&(this.#s=new AbortController,"u">typeof EventTarget&&this.#s.signal instanceof EventTarget&&(r.signal=this.#s.signal)),"u">typeof document&&(r.credentials=this.withCredentials?"include":"omit"),fetch(this.#t,r).then(e=>(e.headers.forEach((e,t)=>{this.#r+=`${t}: ${e}\r
4`}),this.status=e.status,this.statusText=e.statusText,this.readyState=3,this.onreadystatechange?.(),t?e.text():e.arrayBuffer())).then(e=>{"string"==typeof e?this.responseText=e:this.response=e,this.readyState=4,this.onreadystatechange?.()}).catch(e=>{"AbortError"!==e.name?this.onerror?.(e):this.onabort?.()})}}let y="function"==typeof XMLHttpRequest?"xhr":"fetch",g="xhr"===y?XMLHttpRequest:f,v=(e,t)=>{let r=e.options,n=e.applyMiddleware("finalizeOptions",r),s={},i=e.applyMiddleware("interceptRequest",void 0,{adapter:y,context:e});if(i){let e=setTimeout(t,0,null,i);return{abort:()=>clearTimeout(e)}}let o=new g;o instanceof f&&"object"==typeof n.fetch&&o.setInit(n.fetch,n.useAbortSignal??!0);let a=n.headers,u=n.timeout,c=!1,l=!1,h=!1;if(o.onerror=e=>{m(o instanceof f?e instanceof Error?e:Error(`Request error while attempting to reach ${n.url}`,{cause:e}):Error(`Request error while attempting to reach is ${n.url}${e.lengthComputable?`(${e.loaded} of ${e.total} bytes transferred)`:""}`))},o.ontimeout=e=>{m(Error(`Request timeout while attempting to reach ${n.url}${e.lengthComputable?`(${e.loaded} of ${e.total} bytes transferred)`:""}`))},o.onabort=()=>{v(!0),c=!0},o.onreadystatechange=function(){u&&(v(),s.socket=setTimeout(()=>d("ESOCKETTIMEDOUT"),u.socket)),!c&&o&&4===o.readyState&&0!==o.status&&function(){if(!(c||l||h)){if(0===o.status)return m(Error("Unknown XHR error"));v(),l=!0,t(null,{body:o.response||(""===o.responseType||"text"===o.responseType?o.responseText:""),url:n.url,method:n.method,headers:p(o.getAllResponseHeaders()),statusCode:o.status,statusMessage:o.statusText})}}()},o.open(n.method,n.url,!0),o.withCredentials=!!n.withCredentials,a&&o.setRequestHeader)for(let e in a)a.hasOwnProperty(e)&&o.setRequestHeader(e,a[e]);return n.rawBody&&(o.responseType="arraybuffer"),e.applyMiddleware("onRequest",{options:n,adapter:y,request:o,context:e}),o.send(n.body||null),u&&(s.connect=setTimeout(()=>d("ETIMEDOUT"),u.connect)),{abort:function(){c=!0,o&&o.abort()}};function d(t){h=!0,o.abort();let r=Error("ESOCKETTIMEDOUT"===t?`Socket timed out on request to ${n.url}`:`Connection timed out on request to ${n.url}`);r.code=t,e.channels.error.publish(r)}function v(e){(e||c||o&&o.readyState>=2&&s.connect)&&clearTimeout(s.connect),s.socket&&clearTimeout(s.socket)}function m(e){if(l)return;v(!0),l=!0,o=null;let r=e||Error(`Network error while attempting to reach ${n.url}`);r.isNetworkError=!0,r.request=n,t(r)}};var m,b,w,_,x,E=r(55036),S=r(65304).hp,I={exports:{}};x||(x=1,function(e,t){let r;t.formatArgs=function(t){if(t[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+t[0]+(this.useColors?"%c ":" ")+"+"+e.exports.humanize(this.diff),!this.useColors)return;let r="color: "+this.color;t.splice(1,0,r,"color: inherit");let n=0,s=0;t[0].replace(/%[a-zA-Z%]/g,e=>{"%%"!==e&&(n++,"%c"===e&&(s=n))}),t.splice(s,0,r)},t.save=function(e){try{e?t.storage.setItem("debug",e):t.storage.removeItem("debug")}catch{}},t.load=function(){let e;try{e=t.storage.getItem("debug")||t.storage.getItem("DEBUG")}catch{}return!e&&"u">typeof E&&"env"in E&&(e=E.env.DEBUG),e},t.useColors=function(){let e;return"u">typeof window&&!!window.process&&("renderer"===window.process.type||!!window.process.__nwjs)||!("u">typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))&&
4("u">typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"u">typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"u">typeof navigator&&navigator.userAgent&&(e=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(e[1],10)>=31||"u">typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/))},t.storage=function(){try{return localStorage}catch{}}(),r=!1,t.destroy=()=>{r||(r=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))},t.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"],t.log=console.debug||console.log||(()=>{}),e.exports=(_?w:(_=1,w=function(e){function t(e){let n,s,i,o=null;function a(...e){if(!a.enabled)return;let r=Number(new Date);a.diff=r-(n||r),a.prev=n,a.curr=r,n=r,e[0]=t.coerce(e[0]),"string"!=typeof e[0]&&e.unshift("%O");let s=0;e[0]=e[0].replace(/%([a-zA-Z%])/g,(r,n)=>{if("%%"===r)return"%";s++;let i=t.formatters[n];if("function"==typeof i){let t=e[s];r=i.call(a,t),e.splice(s,1),s--}return r}),t.formatArgs.call(a,e),(a.log||t.log).apply(a,e)}return a.namespace=e,a.useColors=t.useColors(),a.color=t.selectColor(e),a.extend=r,a.destroy=t.destroy,Object.defineProperty(a,"enabled",{enumerable:!0,configurable:!1,get:()=>null!==o?o:(s!==t.namespaces&&(s=t.namespaces,i=t.enabled(e)),i),set:e=>{o=e}}),"function"==typeof t.init&&t.init(a),a}function r(e,r){let n=t(this.namespace+(typeof r>"u"?":":r)+e);return n.log=this.log,n}function n(e,t){let r=0,n=0,s=-1,i=0;for(;r<e.length;)if(n<t.length&&(t[n]===e[r]||"*"===t[n]))"*"===t[n]?(s=n,i=r):r++,n++;else{if(-1===s)return!1;n=s+1,r=++i}for(;n<t.length&&"*"===t[n];)n++;return n===t.length}return t.debug=t,t.default=t,t.coerce=function(e){return e instanceof Error?e.stack||e.message:e},t.disable=function(){let e=[...t.names,...t.skips.map(e=>"-"+e)].join(",");return t.enable(""),e},t.enable=function(e){for(let r of(t.save(e),t.namespaces=e,t.names=[],t.skips=[],("string"==typeof e?e:"").trim().replace(/\s+/g,",").split(",").filter(Boolean)))"-"===r[0]?t.skips.push(r.slice(1)):t.names.push(r)},t.enabled=function(e){for(let r of t.skips)if(n(e,r))return!1;for(let r of t.names)if(n(e,r))return!0;return!1},t.humanize=function(){if(b)return m;b=1;function e(e,t,r,n){return Math.round(e/r)+" "+n+(t>=1.5*r?"s":"")}return m=function(t,r){r=r||{};var n,s,i=typeof t;if("string"===i&&t.length>0){var o=t;if(!((o=String(o)).length>100)){var a=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(o);if(a){var u=parseFloat(a[1]);switch((a[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return 315576e5*u;case"weeks":case"week":case"w":return 6048e5*u;case"days":case"day":case"d":return 864e5*u;case"hours":case"hour":case"hrs":case"hr":case"h":return 36e5*u;case"minutes":case"minute":case"mins":case"min":case"m":return 6e4*u;case"seconds":case"second":case"secs":case"sec":case"s":return 1e3*u;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return u}}}return}if("number"===i&&isFinite(t))return r.long?(s=Math.abs(t))>=864e5?e(t,s,864e5,"day"):s>=36e5?e(t,s,36e5,"hour"):s>=6e4?e(t,s,6e4,"minute"):s>=1e3?e(t,s,1e3,"second"):t+" ms":(n=Math.abs(t))>=864e5?Math.round(t/864e5)+"d":n>=36e5?Math.round(t/36e5)+"h":n>=6e4?Math.round(t/6e4)+"m":n>=1e3?Math.round(t/1e3)+"s":t+"ms";throw Error("val is not a non-empty string or a valid number. val="+JSON.stringify(t))}}(),t.destroy=function(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")},Object.keys(e).forEach(r=>{t[r]=e[r]}),t.names=[],t.skips=[],t.formatters={},t.selectColor=function(e){let r=0;for(let t=0;t<e.length;t++)r=(r<<5)-r+e.charCodeAt(t)|0;return t.colors[Math.abs(r)%t.colors.length]},t.enable(t.load()),t}))(t);let{formatters:n}=e.exports;n.j=function(e){try{return JSON.stringify(e)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}}
4(I,I.exports)),I.exports,Object.prototype.hasOwnProperty;let T=typeof S>"u"?()=>!1:e=>S.isBuffer(e);function $(e){return"[object Object]"===Object.prototype.toString.call(e)}let C=["boolean","string","number"],R={};"u">typeof globalThis?R=globalThis:"u">typeof window?R=window:"u">typeof global?R=global:"u">typeof self&&(R=self);var q=R;let j=(e={})=>{let t=e.implementation||Promise;if(!t)throw Error("`Promise` is not available in global scope, and no implementation was passed");return{onReturn:(r,n)=>new t((t,s)=>{let i=n.options.cancelToken;i&&i.promise.then(e=>{r.abort.publish(e),s(e)}),r.error.subscribe(s),r.response.subscribe(r=>{t(e.onlyBody?r.body:r)}),setTimeout(()=>{try{r.request.publish(n)}catch(e){s(e)}},0)})}};class k{__CANCEL__=!0;message;constructor(e){this.message=e}toString(){return"Cancel"+(this.message?`: ${this.message}`:"")}}class O{promise;reason;constructor(e){if("function"!=typeof e)throw TypeError("executor must be a function.");let t=null;this.promise=new Promise(e=>{t=e}),e(e=>{this.reason||(this.reason=new k(e),t(this.reason))})}static source=()=>{let e;return{token:new O(t=>{e=t}),cancel:e}}}j.Cancel=k,j.CancelToken=O,j.isCancel=e=>!(!e||!e?.__CANCEL__);var A=(e,t,r)=>("GET"===r.method||"HEAD"===r.method)&&(e.isNetworkError||!1);function P(e){return 100*Math.pow(2,e)+100*Math.random()}let D=(e={})=>(e=>{let t=e.maxRetries||5,r=e.retryDelay||P,n=e.shouldRetry;return{onError:(e,s)=>{var i;let o=s.options,a=o.maxRetries||t,u=o.retryDelay||r,c=o.shouldRetry||n,l=o.attemptNumber||0;if(null!==(i=o.body)&&"object"==typeof i&&"function"==typeof i.pipe||!c(e,l,o)||l>=a)return e;let h=Object.assign({},s,{options:Object.assign({},o,{attemptNumber:l+1})});return setTimeout(()=>s.channels.request.publish(h),u(l)),null}}})({shouldRetry:A,...e});D.shouldRetry=A;var M=r(14511),N=r(41640),U=r(38038),F=r(15605),z=r(11526),L=r(17092),V=r(11903),H=r(45412),W=r(2599),B=r(71640),J=r(59477),X=r(14238),G=r(36309),Y=r(48714),Q=r(54039),Z=r(69376),K=r(75478),ee=r(25165),et=r(44527),er=r(60827),en=r(19502),es=r(8482),ei=r(61910),eo=r(24490),ea=r(70019),eu=r(50274);function ec(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=(0,eu.ms)(e);return r?(0,ea.F)(ec.apply(void 0,(0,er.fX)([],(0,er.zs)(e))),(0,eo.I)(r)):(0,es.N)(function(t,r){(0,en.P)((0,er.fX)([t],(0,er.zs)((0,ei.K)(e))))(r)})}var el=r(28886),eh=r(38430),ed=r(19290),ep=r(8992),ef=r(88816);let ey=/\r\n|[\n\r\u2028\u2029]/;function eg(e,t){let r=0;for(let n=0;n<t.length;n++){let s=t[n].length+1;if(r+s>e)return{line:n+1,column:e-r};r+=s}return{line:t.length,column:t[t.length-1]?.length??0}}class ev extends Error{response;statusCode=400;responseBody;traceId;details;constructor(e,t){let r=eb(e,t);super(r.message),Object.assign(this,r)}}class em extends Error{response;statusCode=500;responseBody;traceId;details;constructor(e){let t=eb(e);super(t.message),Object.assign(this,t)}}function eb(e,t){var r,n,s;let i=e.body,o={response:e,statusCode:e.statusCode,responseBody:(r=i,-1!==(e.headers["content-type"]||"").toLowerCase().indexOf("application/json")?JSON.stringify(r,null,2):r),traceId:function(e){let t=e?.headers?.traceparent;if(t)return t.split("-")[1]}(e),message:"",details:void 0};if(!(0,et.u4)(i))return o.message=`${ex(e,i)}${eE(o.traceId)}`,o;let a=i.error;if("string"==typeof a&&"string"==typeof i.message)return o.message=`${a} - ${i.message}${eE(o.traceId)}`,o;if("object"!=typeof a||null===a)return"string"==typeof a?o.message=`${a}${eE(o.traceId)}`:"string"==typeof i.message?o.message=`${i.message}${eE(o.traceId)}`:o.message=`${ex(e,i)}${eE(o.traceId)}`,o;if("type"in(n=a)&&"mutationError"===n.type&&"description"in n&&"string"==typeof n.description||"type"in(s=a)&&"actionError"===s.type&&"description"in s&&"string"==typeof s.description){let e=a.items||[],t=e.slice(0,5).map(e=>e.error?.description).filter(Boolean),r=t.length?`:
5- ${t.join(`
6- `)}`:"";return e.length>5&&(r+=`
7...and ${e.length-5} more`),o.message=`${a.description}${eE(o.traceId)}${r}`,o.details=i.error,o}return ew(a)?(o.message=e_(a,t?.options?.query?.tag,o.traceId),o.details=i.error):"description"in a&&"string"==typeof a.description?(o.message=`${a.description}${eE(o.traceId)}`,o.details=a):o.message=`${ex(e,i)}${eE(o.traceId)}`,o}function ew(e){return(0,et.u4)(e)&&"queryParseError"===e.type&&"string"==typeof e.query&&"number"==typeof e.start&&"number"==typeof e.end}function e_(e,t,r){let{query:n,start:s,end:i,description:o}=e,a=r?`
8(traceId: ${r})`:"";if(!n||typeof s>"u")return`GROQ query parse error: ${o}${a}`;let u=t?`
9
10Tag: ${t}`:"";return`GROQ query parse error:
11${function(e,t,r){let n=e.split(ey),{start:s,end:i,markerLines:o}=function(e,t){let r={...e.start},n={...r,...e.end},s=r.line??-1,i=r.column??0,o=n.line,a=n.column,u=Math.max(s-3,0),c=Math.min(t.length,o+3);-1===s&&(u=0),-1===o&&(c=t.length);let l=o-s,h={};if(l)for(let e=0;e<=l;e++){let r=e+s;if(i)if(0===e){let e=t[r-1].length;h[r]=[i,e-i+1]}else if(e===l)h[r]=[0,a];else{let n=t[r-e].length;h[r]=[0,n]}else h[r]=!0}else i===a?i?h[s]=[i,0]:h[s]=!0:h[s]=[i,a-i];return{start:u,end:c,markerLines:h}}({start:eg(t.start,n),end:t.end?eg(t.end,n):void 0},n),a=`${i}`.length;return e.split(ey,i).slice(s,i).map((e,t)=>{let n=s+1+t,i=` ${` ${n}`.slice(-a)} |`,u=o[n],c=!o[n+1];if(!u)return` ${i}${e.length>0?` ${e}`:""}`;let l="";if(Array.isArray(u)){let t=e.slice(0,Math.max(u[0]-1,0)).replace(/[^\t]/g," "),n=u[1]||1;l=`
12 `+i.replace(/\d/g," ")+" "+t+"^".repeat(n),c&&r&&(l+=" "+r)}return">"+i+(e.length>0?` ${e}`:"")+l}).join(`
13`)}(n,{start:s,end:i},o)}${u}${a}`}function ex(e,t){var r,n;let s="string"==typeof t?` (${n=100,(r=t).length>100?`${r.slice(0,n)}\u2026`:r})`:"",i=e.statusMessage?` ${e.statusMessage}`:"";return`${e.method}-request to ${e.url} resulted in HTTP ${e.statusCode}${i}${s}`}function eE(e){return e?` (traceId: ${e})`:""}
13class eS extends Error{projectId;addOriginUrl;constructor({projectId:e,credentials:t}={}){if(super("CorsOriginError"),this.name="CorsOriginError",this.projectId=e,e&&"u">typeof location){let r=new URL(`https://sanity.io/manage/project/${e}/api`),{origin:n}=location;r.searchParams.set("cors","add"),r.searchParams.set("origin",n),t&&r.searchParams.set("credentials",""),this.addOriginUrl=r,this.message=`The current origin is not allowed to connect to the Live Content API. Add it here: ${r}`}else e?this.message=`The current origin is not allowed to connect to the Live Content API. Change your configuration here: https://sanity.io/manage/project/${e}/api`:this.message="The current origin is not allowed to connect to the Live Content API."}}let eI={onResponse:(e,t)=>{if(e.statusCode>=500)throw new em(e);if(e.statusCode>=400)throw new ev(e,t);return e}};function eT(e,t={}){return((e=[],t=v)=>(function e(t,r){let n=[],s=l.reduce((e,t)=>(e[t]=e[t]||[],e),{processOptions:[i],validateOptions:[u]});function o(e){let t,n="object"==typeof e&&e.callSiteStack?e.callSiteStack:void 0,i=n?void 0:Error(),o=c.reduce((e,t)=>(e[t]=function(){let e=Object.create(null),t=0;return{publish:function(t){for(let r in e)e[r](t)},subscribe:function(r){let n=t++;return e[n]=r,function(){delete e[n]}}}}(),e),{}),a=function(e,t,...r){let n="onError"===e,i=t;for(let t=0;t<s[e].length&&(i=(0,s[e][t])(i,...r),!n||i);t++);return i},u=a("processOptions",e);a("validateOptions",u);let l={options:u,channels:o,applyMiddleware:a},h=o.request.subscribe(e=>{t=r(e,(t,r)=>((e,t,r)=>{let s=e,u=t;if(!s)try{u=a("onResponse",t,r)}catch(e){u=null,s=e}if(s=s&&a("onError",s,r)){if(s instanceof Error){let e=n?.stack||i?.stack;if("string"==typeof e){let t=e.split("\n").slice(n?1:2);t.length>0&&(s.stack+="\n"+t.join("\n"))}}o.error.publish(s)}else u&&o.response.publish(u)})(t,r,e))});o.abort.subscribe(()=>{h(),t&&t.abort()});let d=a("onReturn",o,l);return d===o&&o.request.publish(l),d}return o.use=function(e){if(!e)throw Error("Tried to add middleware that resolved to falsey value");if("function"==typeof e)throw Error("Tried to add middleware that was a function. It probably expects you to pass options to it.");if(e.onReturn&&s.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(t=>{e[t]&&s[t].push(e[t])}),n.push(e),o},o.clone=()=>e(n,r),t.forEach(o.use),o})(e,t))([D({shouldRetry:e$}),...e,function(e={}){let t={},r=t=>void 0!==e.ignoreWarnings&&(Array.isArray(e.ignoreWarnings)?e.ignoreWarnings:[e.ignoreWarnings]).some(e=>"string"==typeof e?t.includes(e):e instanceof RegExp&&e.test(t));return{onResponse:e=>{let n=e.headers["x-sanity-warning"];for(let e of Array.isArray(n)?n:[n])!e||t[e]||r(e)||(t[e]=!0,console.warn(e));return e}}}(t),{processOptions:e=>{let t=e.body;return!t||"function"==typeof t.pipe||T(t)||-1===C.indexOf(typeof t)&&!Array.isArray(t)&&!function(e){if(!1===$(e))return!1;let t=e.constructor;if(void 0===t)return!0;let r=t.prototype;return!1!==$(r)&&!1!==r.hasOwnProperty("isPrototypeOf")}(t)?e:Object.assign({},e,{body:JSON.stringify(e.body),headers:Object.assign({},e.headers,{"Content-Type":"application/json"})})}},{onResponse:e=>{let t=e.headers["content-type"]||"",r=-1!==t.indexOf("application/json");return e.body&&t&&r?Object.assign({},e,{body:function(e){try{return JSON.parse(e)}catch(e){throw e.message=`Failed to parsed response body as JSON: ${e.message}`,e}}(e.body)}):e},processOptions:e=>Object.assign({},e,{headers:Object.assign({Accept:"application/json"},e.headers)})},{onRequest:e=>{if("xhr"!==e.adapter)return;let t=e.request,r=e.context;function n(e){return t=>{let n=t.lengthComputable?t.loaded/t.total*100:-1;r.channels.progress.publish({stage:e,percent:n,total:t.total,loaded:t.loaded,lengthComputable:t.lengthComputable})}}"upload"in t&&"onprogress"in t.upload&&(t.upload.onprogress=n("upload")),"onprogress"in t&&(t.onprogress=n("download"))}},eI,function(e={}){let t=e.implementation||q.Observable;if(!t)throw Error("`Observable` is not available in global scope, and n
13o implementation was passed");return{onReturn:(e,r)=>new t(t=>(e.error.subscribe(e=>t.error(e)),e.progress.subscribe(e=>t.next(Object.assign({type:"progress"},e))),e.response.subscribe(e=>{t.next(Object.assign({type:"response"},e)),t.complete()}),e.request.publish(r),()=>e.abort.publish()))}}({implementation:M.c})])}function e$(e,t,r){if(0===r.maxRetries)return!1;let n="GET"===r.method||"HEAD"===r.method,s=(r.uri||r.url).startsWith("/data/query"),i=e.response&&(429===e.response.statusCode||502===e.response.statusCode||503===e.response.statusCode);return(!!n||!!s)&&!!i||D.shouldRetry(e,t,r)}function eC(e){return"https://www.sanity.io/help/"+e}let eR=["image","file"],eq=["before","after","replace"],ej=e=>{if(!/^(~[a-z0-9]{1}[-\w]{0,63}|[a-z0-9]{1}[-\w]{0,63})$/.test(e))throw Error("Datasets can only contain lowercase characters, numbers, underscores and dashes, and start with tilde, and be maximum 64 characters")},ek=(e,t)=>{if(null===t||"object"!=typeof t||Array.isArray(t))throw Error(`${e}() takes an object of properties`)},eO=(e,t)=>{if("string"!=typeof t||!/^[a-z0-9_][a-z0-9_.-]{0,127}$/i.test(t)||t.includes(".."))throw Error(`${e}(): "${t}" is not a valid document ID`)},eA=(e,t)=>{if(!t._id)throw Error(`${e}() requires that the document contains an ID ("_id" property)`);eO(e,t._id)},eP=(e,t)=>{if(!t._type)throw Error(`\`${e}()\` requires that the document contains a type (\`_type\` property)`);((e,t)=>
13{if("string"!=typeof t)throw Error(`\`${e}()\`: \`${t}\` is not a valid document type`)})(e,t._type)},eD=e=>{if(e.dataset)return e.dataset;let t=e.resource;if(t&&"dataset"===t.type){let e=t.id.split(".");if(2!==e.length)throw Error('Dataset resource ID must be in the format "project.dataset"');return e[1]}throw Error("`dataset` must be provided to perform queries")},eM=e=>{if("string"!=typeof e||!/^[a-z0-9._-]{1,75}$/i.test(e))throw Error("Tag can only contain alphanumeric characters, underscores, dashes and dots, and be between one and 75 characters long.");return e},eN=e=>{let t=e.resource;if(!t)throw Error("`resource` must be provided to perform resource queries");let{type:r,id:n}=t;switch(r){case"dataset":if(2!==n.split(".").length)throw Error('Dataset resource ID must be in the format "project.dataset"');return;case"dashboard":case"media-library":case"canvas":return;default:throw Error(`Unsupported resource type: ${r.toString()}`)}},eU=(e,t)=>{if(t.resource)throw Error(`\`${e}\` does not support resource-based operations`)},eF=e=>(function(e){let t=!1,r;return(...n)=>(t||(r=e(...n),t=!0),r)})((...t)=>console.warn(e.join(" "),...t)),ez=eF(["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"]),eL=eF(["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."]),eV=eF(["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."]),eH=eF(["The `previewDrafts` perspective has been renamed to  `drafts` and will be removed in a future API version"]),eW=eF(["You have configured Sanity client to use a token in the browser. This may cause unintentional security issues.",`See ${eC("js-client-browser-token")} for more information and how to hide this warning.`]),eB=eF(["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`."]),eJ=eF(["Using the Sanity client without specifying an API version is deprecated.",`See ${eC("js-client-api-version")}`]),eX=(eF(["The default export of @sanity/client has been deprecated. Use the named export `createClient` instead."]),eF(["You have called `createVersion()` with a defined `document`. The recommended approach is to provide a `baseId` and `releaseId` instead."])),eG=eF(["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."]),eY={apiHost:"https://api.sanity.io",apiVersion:"1",useProjectHostname:!0,stega:{enabled:!1}},eQ=["localhost","127.0.0.1","0.0.0.0"];function eZ(e){if(Array.isArray(e)&&e.length>1&&e.includes("raw"))throw TypeError('Invalid API perspective value: "raw". The raw-perspective can not be combined with other perspectives')}let eK=(e,t)=>{let r,n={...t,...e,stega:{..."boolean"==typeof t.stega?{enabled:t.stega}:t.stega||eY.stega,..."boolean"==typeof e.stega?{enabled:e.stega}:e.stega||{}}};n.apiVersion||eJ();let s={...eY,...n};s["~experimental_resource"]&&!s.resource&&(eG(),s.resource=s["~experimental_resource"]);let i=s.resource,o=s.useProjectHostname&&!i;if(typeof Promise>"u"){let e=eC("js-client-promise-polyfill");throw Error(`No native Promise-implementation found, polyfill needed - see ${e}`)}if(o&&!s.projectId)throw Error("Configuration must contain `projectId`");if(i&&eN(s),"u">typeof s.perspective&&eZ(s.perspective),"encodeSourceMap"in s)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 s)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 s.stega.enabled)throw Error(`stega.enabled must be a boolean, received ${s.stega.enabled}`);if(s.stega.enabled&&void 0===s.stega.studioUrl)throw Error("stega.studioUrl must be defined when stega.enabled is true");if(s.stega.enabled&&"string"!=typeof s.stega.studioUrl&&"function"!=typeof s.stega.studioUrl)throw Error(`stega.studioUrl must be a string or a function, received ${s.stega.studioUrl}`);let a="u">typeof window&&window.location&&window.location.hostname,u=a&&(r=window.location.hostname,-1!==eQ.indexOf(r)),c=!!s.token;s.withCredentials&&c&&(eB(),s.withCredentials=!1),a&&u&&c&&!0!==s.ignoreBrowserTokenWarning?eW():typeof s.useCdn>"u"&&eL(),o&&(e=>{if(!/^[-a-z0-9]+$/i.test(e))throw Error("`projectId` can only contain only a-z, 0-9 and dashes")})(s.projectId),s.dataset&&ej(s.dataset),"requestTagPrefix"in s&&(s.requestTagPrefix=s.requestTagPrefix?eM(s.requestTagPrefix).replace(/\.+$/,""):void 0),s.apiVersion=`${s.apiVersion}`.replace(/^v/,""),s.isDefaultApi=s.apiHost===eY.apiHost,!0===s.useCdn&&s.withCredentials&&ez(),s.useCdn=!1!==s.useCdn&&!s.withCredentials,function(e){if("1"===e||"X"===e)return;let t=new Date(e);if(!(/^\d{4}-\d{2}-\d{2}$/.test(e)&&t instanceof Date&&t.getTime()>0))throw Error("Invalid API version string, expected `1` or date in format `YYYY-MM-DD`")}(s.apiVersion);let l=s.apiHost.split("://",2),h=l[0],d=l[1],p=s.isDefaultApi?"apicdn.sanity.io":d;return o?(s.url=`${h}://${s.projectId}.${d}/v${s.apiVersion}`,s.cdnUrl=`${h}://${s.projectId}.${p}/v${s.apiVersion}`):(s.url=`${s.apiHost}/v${s.apiVersion}`,s.cdnUrl=s.url),s};class e0 extends Error{name="ConnectionFailedError";status;constructor(e,t={}){let{status:r,...n}=t;super(e,n),this.status=r}}class e1 extends Error{name="DisconnectError";reason;constructor(e,t,r={}){super(e,r),this.reason=t}}class e3 extends Error{name="ChannelError";data;constructor(e,t){super(e),this.data=t}}class e2 extends Error{name="MessageError";data;constructor(e,t,r={}){super(e,r),this.data=t}}class e6 extends Error{name="MessageParseError"}let e5=["channelError","disconnect"];function e4(e,t){return(0,N.v)(()=>{let t=e();return(0,U.A)(t)?t:(0,F.of)(t)}).pipe((0,z.Z)(e=>{var r,n;return r=e,n=t,new M.c(e=>{let t=n.includes("open"),s=n.includes("reconnect");function i(t){if("data"in t){let[r,n]=e9(t);e.error(r?new e6("Unable to parse EventSource error message",{cause:n}):new e2((n?.data).message,n));return}let n=t.status,i="number"==typeof n?n:void 0;if(void 0!==i)return void e.error(new e0("EventSource connection failed",{status:i}));r.readyState===r.CLOSED?e.error(new e0("EventSource connection failed")):s&&e.next({type:"reconnect"})}function o(){e.next({type:"open"})}function a(t){let[n,s]=e9(t);if(n)return void e.error(new e6("Unable to parse EventSource message",{cause:n}));if("channelError"===t.type){let t=new URL(r.url).searchParams.get("tag");e.error(new e3(function(e,t){let r=e.error;return r?ew(r)?e_(r,t):r.description?r.description:"string"==typeof r?r:JSON.stringify(r,null,2):e.message||"Unknown listener error"}(s?.data,t),s.data));return}if("disconnect"===t.type)return void e.error(new e1(`Server disconnected client: ${s.data?.reason||"unknown error"}`));e.next({type:t.type,id:t.lastEventId,...s.data?{data:s.data}:{}})}r.addEventListener("error",i),t&&r.addEventListener("open",o);let u=[...new Set([...e5,...n])].filter(e=>"error"!==e&&"open"!==e&&"reconnect"!==e);return u.forEach(e=>r.addEventListener(e,a)),()=>{r.removeEventListener("error",i),t&&r.removeEventListener("open",o),u.forEach(e=>r.removeEventListener(e,a)),r.close()}})}))}function e9(e){try{let t="string"==typeof e.data&&JSON.parse(e.data);return[null,{type:e.type,id:e.lastEventId,...!function(e){for(let t in e)return!1;return!0}(t)?{data:t}:{}}]}catch(e){return[e,null]}}function e7(e){if("string"==typeof e)return{id:e};if(Array.isArray(e))return{query:"*[_id in $ids]",params:{ids:e}};if("object"==typeof e&&null!==e&&"query"in e&&"string"==typeof e.query)return"params"in e&&"object"==typeof e.params&&null!==e.params?{query:e.query,params:e.params}:{query:e.query};let t=["* Document ID (<docId>)","* Array of document IDs","* Object containing `query`"].join(`
14`);throw Error(`Unknown selection - must be one of:
15
16${t}`)}class e8{selection;operations;constructor(e,t={}){this.selection=e,this.operations=t}set(e){return this._assign("set",e)}setIfMissing(e){return this._assign("setIfMissing",e)}diffMatchPatch(e){return ek("diffMatchPatch",e),this._assign("diffMatchPatch",e)}unset(e){if(!Array.isArray(e))throw Error("unset(attrs) takes an array of attributes to unset, non-array given");return this.operations=Object.assign({},this.operations,{unset:e}),this}inc(e){return this._assign("inc",e)}dec(e){return this._assign("dec",e)}insert(e,t,r){return((e,t,r)=>{let n="insert(at, selector, items)";if(-1===eq.indexOf(e)){let e=eq.map(e=>`"${e}"`).join(", ");throw Error(`${n} takes an "at"-argument which is one of: ${e}`)}if("string"!=typeof t)throw Error(`${n} takes a "selector"-argument which must be a string`);if(!Array.isArray(r))throw Error(`${n} takes an "items"-argument which must be an array`)})(e,t,r),this._assign("insert",{[e]:t,items:r})}append(e,t){return this.insert("after",`${e}[-1]`,t)}prepend(e,t){return this.insert("before",`${e}[0]`,t)}splice(e,t,r,n){let s=t<0?t-1:t,i=typeof r>"u"||-1===r?-1:Math.max(0,t+r),o=`${e}[${s}:${s<0&&i>=0?"":i}]`;return this.insert("replace",o,n||[])}ifRevisionId(e){return this.operations.ifRevisionID=e,this}serialize(){return{...e7(this.selection),...this.operations}}toJSON(){return this.serialize()}reset(){return this.operations={},this}_assign(e,t,r=!0){return ek(e,t),this.operations=Object.assign({},this.operations,{[e]:Object.assign({},r&&this.operations[e]||{},t)}),this}_set(e,t){return this._assign(e,t,!1)}}class te extends e8{#a;constructor(e,t,r){super(e,t),this.#a=r}clone(){return new te(this.selection,{...this.operations},this.#a)}commit(e){if(!this.#a)throw Error("No `client` passed to patch, either provide one or pass the patch to a clients `mutate()` method");let t=Object.assign({returnFirst:"string"==typeof this.selection,returnDocuments:!0},e);return this.#a.mutate({patch:this.serialize()},t)}}class tt extends e8{#a;constructor(e,t,r){super(e,t),this.#a=r}clone(){return new tt(this.selection,{...this.operations},this.#a)}commit(e){if(!this.#a)throw Error("No `client` passed to patch, either provide one or pass the patch to a clients `mutate()` method");let t=Object.assign({returnFirst:"string"==typeof this.selection,returnDocuments:!0},e);return this.#a.mutate({patch:this.serialize()},t)}}let tr={returnDocuments:!1};class tn{operations;trxId;constructor(e=[],t){this.operations=e,this.trxId=t}create(e){return ek("create",e),this._add({create:e})}createIfNotExists(e){let t="createIfNotExists";return ek(t,e),eA(t,e),this._add({[t]:e})}createOrReplace(e){let t="createOrReplace";return ek(t,e),eA(t,e),this._add({[t]:e})}delete(e){return eO("delete",e),this._add({delete:{id:e}})}transactionId(e){return e?(this.trxId=e,this):this.trxId}serialize(){return[...this.operations]}toJSON(){return this.serialize()}reset(){return this.operations=[],this}_add(e){return this.operations.push(e),this}}class ts extends tn{#a;constructor(e,t,r){super(e,r),this.#a=t}clone(){return new ts([...this.operations],this.#a,this.trxId)}commit(e){if(!this.#a)throw Error("No `client` passed to transaction, either provide one or pass the transaction to a clients `mutate()` method");return this.#a.mutate(this.serialize(),Object.assign({transactionId:this.trxId},tr,e||{}))}patch(e,t){let r="function"==typeof t,n="string"!=typeof e&&e instanceof tt,s="object"==typeof e&&("query"in e||"id"in e);if(n)return this._add({patch:e.serialize()});if(r){let r=t(new tt(e,{},this.#a));if(!(r instanceof tt))throw Error("function passed to `patch()` must return the patch");return this._add({patch:r.serialize()})}if(s){let r=new tt(e,t||{},this.#a);return this._add({patch:r.serialize()})}return this._add({patch:{id:e,...t}})}}class ti extends tn{#a;constructor(e,t,r){super(e,r),this.#a=t}clone(){return new ti([...this.operations],this.#a,this.trxId)}commit(e){if(!this.#a)throw Error("No `client` passed to transaction, either provide one or pass the transaction to a clients `mutate()` method");return this.#a.mutate(this.serialize(),Object.assign({transactionId:this.trxId},tr,e||{}))}patch(e,t){let r="function"==typeof t;if("string"!=typeof e&&e instanceof te)return this._add({patch:e.serialize()});if(r){let r=t(new te(e,{},this.#a));if(!(r instanceof te))throw Error("function passed to `patch()` must return the patch");return this._add({patch:r.serialize()})}return this._add({patch:{id:e,...t}})}}let to=({query:e,params:t={},options:r={}})=>{let n=new URLSearchParams,{tag:s,includeMutations:i,returnQuery:o,...a}=r;for(let[r,i]of(s&&n.append("tag",s),n.append("query",e),Object.entries(t)))void 0!==i&&n.append(`$${r}`,JSON.stringify(i));for(let[e,t]of Object.entries(a))t&&n.append(e,`${t}`);return!1===o&&n.append("returnQuery","false"),!1===i&&n.append("includeMutations","fal
16se"),`?${n}`},ta=e=>"response"===e.type,tu=e=>e.body;function tc(e,t,n,s,i={},o={}){let a="stega"in o?{...n||{},..."boolean"==typeof o.stega?{enabled:o.stega}:o.stega||{}}:n,u=a.enabled?(0,et.Q)(i):i,c=!1===o.filterResponse?e=>e:e=>e.result,{cache:l,next:h,...d}={useAbortSignal:"u">typeof o.signal,resultSourceMap:a.enabled?"withKeyArraySelector":o.resultSourceMap,...o,returnQuery:!1===o.filterResponse&&!1!==o.returnQuery},p=tS(e,t,"query",{query:s,params:u},"u">typeof l||"u">typeof h?{...d,fetch:{cache:l,next:h}}:d);return a.enabled?p.pipe(function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return ec.apply(void 0,(0,er.fX)([],(0,er.zs)(e)))}((0,L.H)(r.e(6929).then(r.bind(r,26929)).then(function(e){return e.stegaEncodeSourceMap$1}).then(({stegaEncodeSourceMap:e})=>e))),(0,K.T)(([e,t])=>{let r=t(e.result,e.resultSourceMap,a);return c({...e,result:r})})):p.pipe((0,K.T)(c))}function tl(e,t,r,n={}){let s={uri:tq(e,"doc",(()=>{if(!n.releaseId)return r;let e=(0,ep._S)(r);if(!e){if((0,ep.R8)(r))throw Error(`The document ID (\`${r}\`) is a draft, but \`options.releaseId\` is set as \`${n.releaseId}\``);return(0,ep.ct)(r,n.releaseId)}if(e!==n.releaseId)throw Error(`The document ID (\`${r}\`) is already a version of \`${e}\` release, but this does not match the provided \`options.releaseId\` (\`${n.releaseId}\`)`);return r})()),json:!0,tag:n.tag,signal:n.signal,query:void 0!==n.includeAllVersions?{includeAllVersions:n.includeAllVersions}:void 0};return tC(e,t,s).pipe((0,el.p)(ta),(0,K.T)(e=>{let t=e.body.documents;return t?n.includeAllVersions?t:t[0]:n.includeAllVersions?[]:void 0}))}function th(e,t,r,n={}){let s={uri:tq(e,"doc",r.join(",")),json:!0,tag:n.tag,signal:n.signal};return tC(e,t,s).pipe((0,el.p)(ta),(0,K.T)(e=>{let t,n,s=(t=e.body.documents||[],n=e=>e._id,t.reduce((e,t)=>(e[n(t)]=t,e),Object.create(null)));return r.map(e=>s[e]||null)}))}function td(e,t,r,n={}){if(0===r.length)return(0,F.of)(new Set);let s=[];for(let e=0;e<r.length;e+=100)s.push(r.slice(e,e+100));return(0,L.H)(s).pipe((0,eh.H)(r=>tC(e,t,{uri:tq(e,"doc",r.map(encodeURIComponent).join(",")),tag:n.tag,signal:n.signal,query:{excludeContent:!0}}).pipe((0,el.p)(ta),(0,K.T)(e=>{let t=new Set;for(let r of e.body.omitted||[])"existence"===r.reason&&t.add(r.id);return new Set(r.filter(e=>!t.has(e)))}))),(0,ed.T)((e,t)=>{for(let r of t)e.add(r);return e},new Set))}function tp(e,t,r,n={}){return tS(e,t,"query",{query:"*[sanity::partOfRelease($releaseId)]",params:{releaseId:r}},n)}function tf(e,t,r,n){return eA("createIfNotExists",r),tI(e,t,r,"createIfNotExists",n)}function ty(e,t,r,n){return eA("createOrReplace",r),tI(e,t,r,"createOrReplace",n)}function tg(e,t,r,n,s){return eA("createVersion",r),eP("createVersion",r),eX(),tE(e,t,{actionType:"sanity.action.document.version.create",publishedId:n,document:r},s)}function tv(e,t,r,n,s,i,o){if(!n)throw Error("`createVersion()` requires `baseId` when no `document` is provided");if(!r)throw Error("`createVersion()` requires `publishedId` when `baseId` is provided");return eO("createVersion",n),eO("createVersion",r),tE(e,t,{actionType:"sanity.action.document.version.create",publishedId:r,baseId:n,versionId:s?(0,ep.ct)(r,s):(0,ep.T4)(r),ifBaseRevisionId:i},o)}function tm(e,t,r,n){return tS(e,t,"mutate",{mutations:[{delete:e7(r)}]},n)}function tb(e,t,r,n=!1,s){return tE(e,t,{actionType:"sanity.action.document.version.discard",versionId:r,purge:n},s)}function tw(e,t,r,n){return eA("replaceVersion",r),eP("replaceVersion",r),tE(e,t,{actionType:"sanity.action.document.version.replace",document:r},n)}function t_(e,t,r,n,s){return tE(e,t,{actionType:"sanity.action.document.version.unpublish",versionId:r,publishedId:n},s)}function tx(e,t,r,n){let s;return tS(e,t,"mutate",{mutations:Array.isArray(s=r instanceof tt||r instanceof te?{patch:r.serialize()}:r instanceof ts||r instanceof ti?r.serialize():r)?s:[s],transactionId:n&&n.transactionId||void 0},n)}function tE(e,t,r,n){let s=Array.isArray(r)?r:[r],i=n&&n.transactionId||void 0;return tS(e,t,"actions",{actions:s,transactionId:i,skipCrossDatasetReferenceValidation:n&&n.skipCrossDatasetReferenceValidation||void 0,dryRun:n&&n.dryRun||void 0},n)}function tS(e,t,r,n,s={}){let i="mutate"===r,o="actions"===r,a=i||o?"":to(n),u=!i&&!o&&a.length<11264,c=u?a:"",l=s.returnFirst,{timeout:h,token:d,tag:p,headers:f,returnQuery:y,lastLiveEventId:g,cacheMode:v}=s,m={method:u?"GET":"POST",uri:tq(e,r,c),json:!0,body:u?void 0:n,query:i&&((e={})=>{let t,r;return{dryRun:e.dryRun,returnIds:!0,returnDocuments:(t=e.returnDocuments,r=!0,!1===t?void 0:typeof t>"u"?r:t),visibility:e.visibility||"sync",autoGenerateArrayKeys:e.autoGenerateArrayKeys,skipCrossDatasetReferenceValidation:e.skipCrossDatasetReferenceValidation}})(s),timeout:h,headers:f,token:d,tag:p,returnQuery:y,perspective:s.perspective,variant:s.variant,resultSourceMap:s.resultSourceMap,lastLiveEventId:Array.isArray(g)?g[0]:g,cacheMode:v,canUseCdn:"query"===r,signal:s.signal,fetch:s.fetch,useAbortSignal:s.useAbortSignal,useCdn:s.useCdn};return tC(e,t,m).pipe((0,el.p)(ta),(0,K.T)(tu),(0,K.T)(e=>{if(!i)return e;let t=e.results||[];if(s.returnDocuments)return l?t[0]&&t[0].document:t.map(e=>e.document);let r=l?t[0]&&t[0].id:t.map(e=>e.id);return{transactionId:e.transactionId,results:t,[l?"documentId":"documentIds"]:r}}))}function tI(e,t,r,n,s={}){return tS(e,t,"mutate",{mutations:[{[n]:r}]},Object.assign({returnFirst:!0,returnDocuments:!0},s))}let tT=e=>{let t=e.config();return void 0!==t.dataset&&void 0!==t.projectId||void 0!==t.resource}
16,t$=(e,t)=>tT(e)&&t.startsWith(tq(e,"query"));function tC(e,t,r){var n;let s=Error(),i=r.url||r.uri,o=e.config(),a=typeof r.canUseCdn>"u"?["GET","HEAD"].indexOf(r.method||"GET")>=0&&(i.startsWith("/data/")||t$(e,i)||tT(e)&&i.startsWith(tq(e,"mutate"))||tT(e)&&i.startsWith(tq(e,"doc",""))||tT(e)&&i.startsWith(tq(e,"listen"))||tT(e)&&i.startsWith(tq(e,"history",""))):r.canUseCdn,u=(r.useCdn??o.useCdn)&&a,c=r.tag&&o.requestTagPrefix?[o.requestTagPrefix,r.tag].join("."):r.tag||o.requestTagPrefix;if(c&&null!==r.tag&&(r.query={tag:eM(c),...r.query}),["GET","HEAD","POST"].indexOf(r.method||"GET")>=0&&t$(e,i)){let e=r.resultSourceMap??o.resultSourceMap;void 0!==e&&!1!==e&&(r.query={resultSourceMap:e,...r.query});let t=r.perspective||o.perspective;"u">typeof t&&("previewDrafts"===t&&eH(),eZ(t),r.query={perspective:Array.isArray(t)?t.join(","):t,...r.query},(Array.isArray(t)&&t.length>0||"previewDrafts"===t||"drafts"===t)&&u&&(u=!1,eV()));let n=r.variant||o.variant;"string"==typeof n&&(r.query={variant:n,...r.query}),"object"==typeof n&&(r.query={variantCondition:Object.entries(n).map(([e,t])=>`${e}:${t}`).toSorted(),...r.query}),r.lastLiveEventId&&(r.query={...r.query,lastLiveEventId:r.lastLiveEventId}),!1===r.returnQuery&&(r.query={returnQuery:"false",...r.query}),u&&"noStale"==r.cacheMode&&(r.query={cacheMode:"noStale",...r.query})}let l=function(e,t={}){let r={};e.headers&&Object.assign(r,e.headers);let n=t.token||e.token;n&&(r.Authorization=`Bearer ${n}`),t.useGlobalApi||e.useProjectHostname||!e.projectId||(r["X-Sanity-Project-ID"]=e.projectId);let s=!!(typeof t.withCredentials>"u"?e.withCredentials:t.withCredentials),i=typeof t.timeout>"u"?e.timeout:t.timeout;return Object.assign({},t,{headers:Object.assign({},r,t.headers||{}),timeout:typeof i>"u"?3e5:i,proxy:t.proxy||e.proxy,json:!0,withCredentials:s,fetch:"object"==typeof t.fetch&&"object"==typeof e.fetch?{...e.fetch,...t.fetch}:t.fetch||e.fetch})}(o,Object.assign({},r,{url:tj(e,i,u),callSiteStack:s})),h=new M.c(e=>t(l,o.requester).subscribe(e));return r.signal?h.pipe((n=r.signal,e=>new M.c(t=>{let r=()=>t.error(function(e){if(tk)return new DOMException(e?.reason??"The operation was aborted.","AbortError");let t=Error(e?.reason??"The operation was aborted.");return t.name="AbortError",t}(n));if(n&&n.aborted)return void r();let s=e.subscribe(t);return n.addEventListener("abort",r),()=>{n.removeEventListener("abort",r),s.unsubscribe()}}))):h}function tR(e,t,r){return tC(e,t,r).pipe((0,el.p)(e=>"response"===e.type),(0,K.T)(e=>e.body))}function tq(e,t,r){let n=e.config();if(n.resource){eN(n);let e=tO(n),s=void 0!==r?`${t}/${r}`:t;return`${e}/${s}`.replace(/\/($|\?)/,"$1")}let s=eD(n),i=`/${t}/${s}`;return`/data${void 0!==r?`${i}/${r}`:i}`.replace(/\/($|\?)/,"$1")}function tj(e,t,r=!1){let{url:n,cdnUrl:s}=e.config();return`${r?s:n}/${t.replace(/^\//,"")}`}let tk=!!globalThis.DOMException,tO=e=>{let t=e.resource;if(!t)throw Error("`resource` must be provided to perform resource queries");let{type:r,id:n}=t;switch(r){case"dataset":{let e=n.split(".");if(2!==e.length)throw Error('Dataset ID must be in the format "project.dataset"');return`/projects/${e[0]}/datasets/${e[1]}`}case"canvas":return`/canvases/${n}`;case"media-library":return`/media-libraries/${n}`;case"dashboard":return`/dashboards/${n}`;default:throw Error(`Unsupported resource type: ${r.toString()}`)}};function tA(e,t,r){let n=eD(e.config());return tR(e,t,{method:"POST",uri:`/agent/action/generate/${n}`,body:r})}function tP(e,t,r){let n=eD(e.config());return tR(e,t,{method:"POST",uri:`/agent/action/transform/${n}`,body:r})}function tD(e,t,r){let n=eD(e.config());return tR(e,t,{method:"POST",uri:`/agent/action/translate/${n}`,body:r})}class tM{#a;#u;constructor(e,t){this.#a=e,this.#u=t}generate(e){return tA(this.#a,this.#u,e)}transform(e){return tP(this.#a,this.#u,e)}translate(e){return tD(this.#a,this.#u,e)}}class tN{#a;#u;constructor(e,t){this.#a=e,this.#u=t}generate(e){return(0,V.s)(tA(this.#a,this.#u,e))}transform(e){return(0,V.s)(tP(this.#a,this.#u,e))}translate(e){return(0,V.s)(tD(this.#a,this.#u,e))}prompt(e){return(0,V.s)(function(e,t,r){let n=eD(e.config());return tR(e,t,{method:"POST",uri:`/agent/action/prompt/${n}`,body:r})}(this.#a,this.#u,e))}patch(e){return(0,V.s)(function(e,t,r){let n=eD(e.config());return tR(e,t,{method:"POST",uri:`/agent/action/patch/${n}`,body:r})}(this.#a,this.#u,e))}}class tU{#a;#u;
16constructor(e,t){this.#a=e,this.#u=t}upload(e,t,r){return tz(this.#a,this.#u,e,t,r)}}class tF{#a;#u;constructor(e,t){this.#a=e,this.#u=t}upload(e,t,r){let n=tz(this.#a,this.#u,e,t,r);return(0,V.s)(n.pipe((0,el.p)(e=>"response"===e.type),(0,K.T)(e=>e.body.document)))}}function tz(e,t,r,n,s={}){var i,o;if(-1===eR.indexOf(r))throw Error(`Invalid asset type: ${r}. Must be one of ${eR.join(", ")}`);let a=s.extract||void 0;a&&!a.length&&(a=["none"]);let u=e.config(),c=(i=s,o=n,!(typeof File>"u")&&o instanceof File?Object.assign({filename:!1===i.preserveFilename?void 0:o.name,contentType:o.type},i):i),{tag:l,label:h,title:d,description:p,creditLine:f,filename:y,source:g}=c,v=u.resource?.type==="media-library",m=v?{title:d,filename:y}:{label:h,title:d,description:p,filename:y,meta:a,creditLine:f};return g&&!v&&(m.sourceId=g.id,m.sourceName=g.name,m.sourceUrl=g.url),tC(e,t,{tag:l,method:"POST",timeout:c.timeout||0,uri:function(e,t){let r="image"===t?"images":"files",n=e.resource;if(n){let{type:e,id:t}=n;switch(e){case"dataset":throw Error("Assets are not supported for dataset resources, yet. Configure the client with `{projectId: <projectId>, dataset: <datasetId>}` instead.");case"canvas":return`/canvases/${t}/assets/${r}`;case"media-library":return`/media-libraries/${t}/upload`;case"dashboard":return`/dashboards/${t}/assets/${r}`;default:throw Error(`Unsupported resource type: ${e.toString()}`)}}let s=eD(e);return`assets/${r}/${s}`}(u,r),headers:c.contentType?{"Content-Type":c.contentType}:{},query:m,body:n})}let tL=(0,N.v)(()=>r.e(1957).then(r.bind(r,41957))).pipe((0,K.T)(({default:e})=>e),(0,H.t)(1)),tV=new Set([408,429]);function tH(){return function(e){return e.pipe((0,W.W)((e,t)=>e instanceof e0&&("number"!=typeof e.status||e.status<400||e.status>=500||tV.has(e.status))?(0,B.x)((0,F.of)({type:"reconnect"}),(0,J.O)(1e3).pipe((0,z.Z)(()=>t))):(0,X.$)(()=>e)))}}let tW=["includePreviousRevision","includeResult","includeMutations","includeAllVersions","visibility","effectFormat","enableResume","tag"],tB={includeResult:!0};function tJ(e,t,r={}){let{url:n,token:s,withCredentials:i,requestTagPrefix:o,headers:a}=this.config(),u=r.tag&&o?[o,r.tag].join("."):r.tag,c={...Object.keys(tB).concat(Object.keys(r)).reduce((e,t)=>(e[t]=typeof r[t]>"u"?tB[t]:r[t],e),{}),tag:u},l=to({query:e,params:t,options:{tag:u,...tW.reduce((e,t)=>(typeof c[t]>"u"||(e[t]=c[t]),e),{})}}),h=`${n}${tq(this,"listen",l)}`;if(h.length>14800)return(0,X.$)(()=>Error("Query too large for listener"));let d=c.events?c.events:["mutation"],p={};return i&&(p.withCredentials=!0),(s||a)&&(p.headers={},s&&(p.headers.Authorization=`Bearer ${s}`),a&&Object.assign(p.headers,a)),e4(()=>(typeof EventSource>"u"||p.headers?tL:(0,F.of)(EventSource)).pipe((0,K.T)(e=>new e(h,p))),d).pipe(tH(),(0,el.p)(e=>d.includes(e.type)),(0,K.T)(e=>({type:e.type,..."data"in e?e.data:{}})))}let tX="2021-03-25";class tG{#a;constructor(e){this.#a=e}events({includeDrafts:e=!1,tag:t,waitFor:r}={}){var n,s,i,o,a;let{projectId:u,apiVersion:c,token:l,withCredentials:h,requestTagPrefix:d,headers:p}=this.#a.config(),f=c.replace(/^v/,"");if("X"!==f&&f<tX)throw Error(`The live events API requires API version ${tX} or later. The current API version is ${f}. Please update your API version to use this feature.`);if(e&&!l&&!h)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 y=tq(this.#a,"live/events"),g=new URL(this.#a.getUrl(y,!1)),v=t&&d?[d,t].join("."):t;v&&g.searchParams.set("tag",v),e&&g.searchParams.set("includeDrafts","true"),r&&g.searchParams.set("waitFor",r);let m={};e&&h&&(m.withCredentials=!0),(e&&l||p)&&(m.headers={},e&&l&&(m.headers.Authorization=`Bearer ${l}`),p&&Object.assign(m.headers,p));let b=`${g.href}::${JSON.stringify(m)}`,w=tY.get(b);if(w)return w;let _=e4(()=>(typeof EventSource>"u"||m.headers?tL:(0,F.of)(EventSource)).pipe((0,K.T)(e=>new e(g.href,m))),["message","restart","welcome","reconnect","goaway"]),x=(s=new URL(this.#a.getUrl("/check/cors",!1)),i=u,o=!0===m.withCredentials,new M.c(e=>{let t=new AbortController,{signal:r}=t;return fetch(s,{method:"GET",mode:"cors",credentials:"omit",signal:r}).then(e=>{if(!(r.aborted||!e.ok))return e.json()}).then(t=>{if(!r.aborted){if(o&&t?.result?.withCredentials===!1)return void e.error(new eS({projectId:i,credentials:!0}));if(t?.result?.allowed===!1)return void e.error(new eS({projectId:i,credentials:o}));e.next(),e.complete()}}).catch(()=>{r.aborted||e.closed||(e.next(),e.complete())}),()=>t.abort()})),E=_.pipe(tH(),(0,z.Z)(e=>"reconnect"===e.type?x.pipe((0,z.Z)(()=>(0,F.of)(e))):(0,F.of)(e)),(0,W.W)(e=>e instanceof eS?(0,X.$)(()=>e):x.pipe((0,z.Z)(()=>{throw e}))),(0,K.T)(e=>{if("message"===e.type){let{data:t,...r}=e;return{...r,tags:t.tags}}return e})).pipe((0,Y.j)(()=>tY.delete(b)),(a="function"==typeof(n={predicate:e=>"welcome"===e.type})?{predicate:n,...void 0}:n,e=>{let t,r=!1,{predicate:n,...s}=a,i=e.pipe((0,G.M)(e=>{a.predicate(e)&&(r=!0,t=e)}),(0,Y.j)(()=>{r=!1,t=void 0}),(0,Q.u)(s)),o=new M.c(e=>{r&&e.next(t),e.complete()});return(0,Z.h)(i,o)}));return tY.set(b,E),E}}let tY=new Map;class tQ{#a;#u;
16constructor(e,t){this.#a=e,this.#u=t}create(e,t){return t0(this.#a,this.#u,"PUT",e,t)}edit(e,t){return t0(this.#a,this.#u,"PATCH",e,t)}delete(e){return t0(this.#a,this.#u,"DELETE",e)}list(){eU("dataset",this.#a.config());let e=this.#a.config(),t=e.projectId,r="/datasets";return!1===e.useProjectHostname&&(r=`/projects/${t}/datasets`),tR(this.#a,this.#u,{uri:r,tag:null})}getEmbeddingsSettings(e){return eU("dataset",this.#a.config()),ej(e),tR(this.#a,this.#u,{uri:tK(this.#a,e),tag:null})}editEmbeddingsSettings(e,t){return eU("dataset",this.#a.config()),ej(e),tR(this.#a,this.#u,{method:"PUT",uri:tK(this.#a,e),body:t,tag:null})}}class tZ{#a;#u;constructor(e,t){this.#a=e,this.#u=t}create(e,t){return eU("dataset",this.#a.config()),(0,V.s)(t0(this.#a,this.#u,"PUT",e,t))}edit(e,t){return eU("dataset",this.#a.config()),(0,V.s)(t0(this.#a,this.#u,"PATCH",e,t))}delete(e){return eU("dataset",this.#a.config()),(0,V.s)(t0(this.#a,this.#u,"DELETE",e))}list(){eU("dataset",this.#a.config());let e=this.#a.config(),t=e.projectId,r="/datasets";return!1===e.useProjectHostname&&(r=`/projects/${t}/datasets`),(0,V.s)(tR(this.#a,this.#u,{uri:r,tag:null}))}getEmbeddingsSettings(e){return eU("dataset",this.#a.config()),ej(e),(0,V.s)(tR(this.#a,this.#u,{uri:tK(this.#a,e),tag:null}))}editEmbeddingsSettings(e,t){return eU("dataset",this.#a.config()),ej(e),(0,V.s)(tR(this.#a,this.#u,{method:"PUT",uri:tK(this.#a,e),body:t,tag:null}))}}function tK(e,t){let r=e.config();return!1===r.useProjectHostname?`/projects/${r.projectId}/datasets/${t}/settings/embeddings`:`/datasets/${t}/settings/embeddings`}function t0(e,t,r,n,s){return eU("dataset",e.config()),ej(n),tR(e,t,{method:r,uri:`/datasets/${n}`,body:s,tag:null})}class t1{#a;#u;constructor(e,t){this.#a=e,this.#u=t}getPlaybackInfo(e,t={}){var r,n;let s=this.#a.config(),i=(s.resource||s["~experimental_resource"])?.id,{instanceId:o,libraryId:a}=function(e){let t="object"==typeof e&&"_ref"in e?e._ref:e,r=t2.exec(t);if(r){let[,e,t]=r;return{libraryId:e,instanceId:t}}if("string"==typeof e&&e.startsWith("video-"))return{instanceId:e};throw Error(`Invalid video asset instance identifier "${t}": must be a valid video instance id or a Global Dataset Reference (GDR) to the video asset in the Media Library`)}(e),u=a||i;if(!u)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 c=(r=o,n=u,`/media-libraries/${n}/video/${r}/playback-info`),l=function(e){let t={};if(e.transformations){let{thumbnail:r,animated:n,storyboard:s}=e.transformations;r&&(r.width&&(t.thumbnailWidth=r.width),r.height&&(t.thumbnailHeight=r.height),void 0!==r.time&&(t.thumbnailTime=r.time),r.fit&&(t.thumbnailFit=r.fit),r.format&&(t.thumbnailFormat=r.format)),n&&(n.width&&(t.animatedWidth=n.width),n.height&&(t.animatedHeight=n.height),void 0!==n.start&&(t.animatedStart=n.start),void 0!==n.end&&(t.animatedEnd=n.end),n.fps&&(t.animatedFps=n.fps),n.format&&(t.animatedFormat=n.format)),s&&s.format&&(t.storyboardFormat=s.format)}return e.expiration&&(t.expiration=e.expiration),t}(t);return tR(this.#a,this.#u,{method:"GET",uri:c,query:l})}}class t3{#a;#u;constructor(e,t){this.#a=e,this.#u=t}getPlaybackInfo(e,t={}){return(0,V.s)(new t1(this.#a.observable,this.#u).getPlaybackInfo(e,t))}}let t2=/^media-library:(ml[^:]+):([^:]+)$/;class t6{#a;#u;constructor(e,t){this.#a=e,this.#u=t}list(e){let t={};return e?.includeMembers===!1&&(t.includeMembers="false"),e?.includeFeatures===!1&&(t.includeFeatures="false"),e?.organizationId&&(t.organizationId=e.organizationId),e?.onlyExplicitMembership&&(t.onlyExplicitMembership="true"),tR(this.#a,this.#u,{uri:"/projects",query:t})}getById(e){return tR(this.#a,this.#u,{uri:`/projects/${e}`})}}class t5{#a;#u;constructor(e,t){this.#a=e,this.#u=t}list(e){let t={};return e?.includeMembers===!1&&(t.includeMembers="false"),e?.includeFeatures===!1&&(t.includeFeatures="false"),e?.organizationId&&(t.organizationId=e.organizationId),e?.onlyExplicitMembership&&(t.onlyExplicitMembership="true"),(0,V.s)(tR(this.#a,this.#u,{uri:"/projects",query:t}))}getById(e){return(0,V.s)(tR(this.#a,this.#u,{uri:`/projects/${e}`}))}}let t4=(0,ef.d_)("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789",8),t9=(e,t)=>
16t?(0,ep.ct)(e,t):(0,ep.T4)(e);function t7(e,{releaseId:t,publishedId:r,document:n}){if(r&&n._id){let e=t9(r,t);return((e,t)=>{if(t._id&&t._id!==e)throw Error(`The provided document ID (\`${t._id}\`) does not match the generated version ID (\`${e}\`)`)})(e,n),e}if(n._id){let r=(0,ep.R8)(n._id),s=(0,ep.A_)(n._id);if(!r&&!s)throw Error(`\`${e}()\` requires a document with an \`_id\` that is a version or draft ID`);if(t){if(r)throw Error(`\`${e}()\` was called with a document ID (\`${n._id}\`) that is a draft ID, but a release ID (\`${t}\`) was also provided.`);let s=(0,ep._S)(n._id);if(s!==t)throw Error(`\`${e}()\` was called with a document ID (\`${n._id}\`) that is a version ID, but the release ID (\`${t}\`) does not match the document's version ID (\`${s}\`).`)}return n._id}if(r)return t9(r,t);throw Error(`\`${e}()\` requires either a publishedId or a document with an \`_id\``)}let t8=(e,t)=>{let[r,n,s]=((e,t)=>{if("object"==typeof e&&null!==e&&("releaseId"in e||"metadata"in e)){let{releaseId:r=t4(),metadata:n={}}=e;return[r,n,t]}return[t4(),{},e]})(e,t);return{action:{actionType:"sanity.action.release.create",releaseId:r,metadata:{...n,releaseType:n.releaseType||"undecided"}},options:s}};class re{#a;#u;constructor(e,t){this.#a=e,this.#u=t}get({releaseId:e},t){return tl(this.#a,this.#u,`_.releases.${e}`,t)}create(e,t){let{action:r,options:n}=t8(e,t),{releaseId:s,metadata:i}=r;return tE(this.#a,this.#u,r,n).pipe((0,K.T)(e=>({...e,releaseId:s,metadata:i})))}edit({releaseId:e,patch:t},r){return tE(this.#a,this.#u,{actionType:"sanity.action.release.edit",releaseId:e,patch:t},r)}publish({releaseId:e},t){return tE(this.#a,this.#u,{actionType:"sanity.action.release.publish",releaseId:e},t)}archive({releaseId:e},t){return tE(this.#a,this.#u,{actionType:"sanity.action.release.archive",releaseId:e},t)}unarchive({releaseId:e},t){return tE(this.#a,this.#u,{actionType:"sanity.action.release.unarchive",releaseId:e},t)}schedule({releaseId:e,publishAt:t},r){return tE(this.#a,this.#u,{actionType:"sanity.action.release.schedule",releaseId:e,publishAt:t},r)}unschedule({releaseId:e},t){return tE(this.#a,this.#u,{actionType:"sanity.action.release.unschedule",releaseId:e},t)}delete({releaseId:e},t){return tE(this.#a,this.#u,{actionType:"sanity.action.release.delete",releaseId:e},t)}fetchDocuments({releaseId:e},t){return tp(this.#a,this.#u,e,t)}}class rt{#a;#u;constructor(e,t){this.#a=e,this.#u=t}get({releaseId:e},t){return(0,V.s)(tl(this.#a,this.#u,`_.releases.${e}`,t))}async create(e,t){let{action:r,options:n}=t8(e,t),{releaseId:s,metadata:i}=r;return{...await (0,V.s)(tE(this.#a,this.#u,r,n)),releaseId:s,metadata:i}}edit({releaseId:e,patch:t},r){return(0,V.s)(tE(this.#a,this.#u,{actionType:"sanity.action.release.edit",releaseId:e,patch:t},r))}publish({releaseId:e},t){return(0,V.s)(tE(this.#a,this.#u,{actionType:"sanity.action.release.publish",releaseId:e},t))}archive({releaseId:e},t){return(0,V.s)(tE(this.#a,this.#u,{actionType:"sanity.action.release.archive",releaseId:e},t))}unarchive({releaseId:e},t){return(0,V.s)(tE(this.#a,this.#u,{actionType:"sanity.action.release.unarchive",releaseId:e},t))}schedule({releaseId:e,publishAt:t},r){return(0,V.s)(tE(this.#a,this.#u,{actionType:"sanity.action.release.schedule",releaseId:e,publishAt:t},r))}unschedule({releaseId:e},t){return(0,V.s)(tE(this.#a,this.#u,{actionType:"sanity.action.release.unschedule",releaseId:e},t))}delete({releaseId:e},t){return(0,V.s)(tE(this.#a,this.#u,{actionType:"sanity.action.release.delete",releaseId:e},t))}fetchDocuments({releaseId:e},t){return(0,V.s)(tp(this.#a,this.#u,e,t))}}class rr{#a;#u;constructor(e,t){this.#a=e,this.#u=t}getById(e){return tR(this.#a,this.#u,{uri:`/users/${e}`})}}class rn{#a;#u;constructor(e,t){this.#a=e,this.#u=t}getById(e){return(0,V.s)(tR(this.#a,this.#u,{uri:`/users/${e}`}))}}class rs{assets;datasets;live;mediaLibrary;projects;users;agent;releases;#c;#l;#u;listen=tJ;constructor(e,t=eY){this.config(t),this.#l=e;let r=t._requestHandler;this.#u=r?(()=>{let n;return(s,i)=>(n||(n=new ri(e,{...t,_requestHandler:void 0})),r(s,t=>e(t,i),n))})():e,this.assets=new tU(this,this.#u),this.datasets=new tQ(this,this.#u),this.live=new tG(this),this.mediaLibrary={video:new t1(this,this.#u)}
16,this.projects=new t6(this,this.#u),this.users=new rr(this,this.#u),this.agent={action:new tM(this,this.#u)},this.releases=new re(this,this.#u)}clone(){return new rs(this.#l,this.config())}config(e){if(void 0===e)return{...this.#c};if(this.#c&&!1===this.#c.allowReconfigure)throw Error("Existing client instance cannot be reconfigured - use `withConfig(newConfig)` to return a new client");return this.#c=eK(e,this.#c||{}),this}withConfig(e){let t=this.config();return new rs(this.#l,{...t,...e,stega:{...t.stega||{},..."boolean"==typeof e?.stega?{enabled:e.stega}:e?.stega||{}}})}fetch(e,t,r){return tc(this,this.#u,this.#c.stega,e,t,r)}getDocument(e,t){if(t?.includeAllVersions===!0)return tl(this,this.#u,e,{...t,includeAllVersions:!0});let r={signal:t?.signal,tag:t?.tag,releaseId:t?.releaseId,...t&&"includeAllVersions"in t?{includeAllVersions:!1}:{}};return tl(this,this.#u,e,r)}getDocuments(e,t){return th(this,this.#u,e,t)}documentsExists(e,t){return td(this,this.#u,e,t)}create(e,t){return tI(this,this.#u,e,"create",t)}createIfNotExists(e,t){return tf(this,this.#u,e,t)}createOrReplace(e,t){return ty(this,this.#u,e,t)}createVersion({document:e,publishedId:t,releaseId:r,baseId:n,ifBaseRevisionId:s},i){if(!e)return tv(this,this.#u,t,n,r,s,i);let o=t7("createVersion",{document:e,publishedId:t,releaseId:r}),a={...e,_id:o},u=t||(0,ep.IM)(e._id);return tg(this,this.#u,a,u,i)}delete(e,t){return tm(this,this.#u,e,t)}discardVersion({releaseId:e,publishedId:t},r,n){let s=t9(t,e);return tb(this,this.#u,s,r,n)}replaceVersion({document:e,publishedId:t,releaseId:r},n){let s=t7("replaceVersion",{document:e,publishedId:t,releaseId:r}),i={...e,_id:s};return tw(this,this.#u,i,n)}unpublishVersion({releaseId:e,publishedId:t},r){let n=(0,ep.ct)(t,e);return t_(this,this.#u,n,t,r)}mutate(e,t){return tx(this,this.#u,e,t)}patch(e,t){return new te(e,t,this)}transaction(e){return new ti(e,this)}action(e,t){return tE(this,this.#u,e,t)}request(e){return tR(this,this.#u,e)}getUrl(e,t){return tj(this,e,t)}getDataUrl(e,t){return tq(this,e,t)}}class ri{assets;datasets;live;mediaLibrary;projects;users;agent;releases;observable;#c;#l;#u;listen=tJ;constructor(e,t=eY){this.config(t),this.#l=e;let r=t._requestHandler;this.#u=r?(()=>{let n;return(s,i)=>(n||(n=new ri(e,{...t,_requestHandler:void 0})),r(s,t=>e(t,i),n))})():e,this.assets=new tF(this,this.#u),this.datasets=new tZ(this,this.#u),this.live=new tG(this),this.mediaLibrary={video:new t3(this,this.#u)},this.projects=new t5(this,this.#u),this.users=new rn(this,this.#u),this.agent={action:new tN(this,this.#u)},this.releases=new rt(this,this.#u),this.observable=new rs(e,t)}clone(){return new ri(this.#l,this.config())}config(e){if(void 0===e)return{...this.#c};if(this.#c&&!1===this.#c.allowReconfigure)throw Error("Existing client instance cannot be reconfigured - use `withConfig(newConfig)` to return a new client");return this.observable&&this.observable.config(e),this.#c=eK(e,this.#c||{}),this}withConfig(e){let t=this.config();return new ri(this.#l,{...t,...e,stega:{...t.stega||{},..."boolean"==typeof e?.stega?{enabled:e.stega}:e?.stega||{}}})}fetch(e,t,r){return(0,V.s)(tc(this,this.#u,this.#c.stega,e,t,r))}getDocument(e,t){if(t?.includeAllVersions===!0)return(0,V.s)(tl(this,this.#u,e,{...t,includeAllVersions:!0}));let r={signal:t?.signal,tag:t?.tag,releaseId:t?.releaseId,...t&&"includeAllVersions"in t?{includeAllVersions:!1}:{}};return(0,V.s)(tl(this,this.#u,e,r))}getDocuments(e,t){return(0,V.s)(th(this,this.#u,e,t))}documentsExists(e,t){return(0,V.s)(td(this,this.#u,e,t))}create(e,t){return(0,V.s)(tI(this,this.#u,e,"create",t))}createIfNotExists(e,t){return(0,V.s)(tf(this,this.#u,e,t))}createOrReplace(e,t){return(0,V.s)(ty(this,this.#u,e,t))}createVersion({document:e,publishedId:t,releaseId:r,baseId:n,ifBaseRevisionId:s},i){if(!e)return(0,ee._)(tv(this,this.#u,t,n,r,s,i));let o=t7("createVersion",{document:e,publishedId:t,releaseId:r}),a={...e,_id:o},u=t||(0,ep.IM)(e._id);return(0,ee._)(tg(this,this.#u,a,u,i))}delete(e,t){return(0,V.s)(tm(this,this.#u,e,t))}discardVersion({releaseId:e,publishedId:t},r,n){let s=t9(t,e);return(0,V.s)(tb(this,this.#u,s,r,n))}replaceVersion({document:e,publishedId:t,releaseId:r},n){let s=t7("replaceVersion",{document:e,publishedId:t,releaseId:r}),i={...e,_id:s};return(0,ee._)(tw(this,this.#u,i,n))}unpublishVersion({releaseId:e,publishedId:t},r){let n=(0,ep.ct)(t,e);return(0,V.s)(t_(this,this.#u,n,t,r))}mutate(e,t){return(0,V.s)(tx(this,this.#u,e,t))}patch(e,t){return new tt(e,t,this)}transaction(e){return new ts(e,this)}action(e,t){return(0,V.s)(tE(this,this.#u,e,t))}request(e){return(0,V.s)(tR(this,this.#u,e))}dataRequest(e,t,r){return(0,V.s)(tS(this,this.#u,e,t,r))}getUrl(e,t){return tj(this,e,t)}getDataUrl(e,t){return tq(this,e,t)}}let ro=function(e,t){return{requester:eT(e),createClient:r=>{let n=eT(e,{ignoreWarnings:r.ignoreWarnings});return new t((e,t)=>
16(t||n)({maxRedirects:0,maxRetries:r.maxRetries,retryDelay:r.retryDelay,lineage:r.lineage,...e}),r)}}}([],ri),ra=(ro.requester,ro.createClient)},67060:(e,t,r)=>{r.d(t,{Tg:()=>y});var n=r(60827),s=r(33071),i=r(31972),o=r(14511),a=r(58709),u=r(73495),c=r(3607),l=r(74041),h=r(86256),d=r(5251),p=r(49130),f=r(19710);function y(e){if(e instanceof o.c)return e;if(null!=e){var t,r,y,v,m;if((0,a.l)(e)){return t=e,new o.c(function(e){var r=t[f.s]();if((0,d.T)(r.subscribe))return r.subscribe(e);throw TypeError("Provided object does not correctly implement Symbol.observable")})}if((0,s.X)(e)){return r=e,new o.c(function(e){for(var t=0;t<r.length&&!e.closed;t++)e.next(r[t]);e.complete()})}if((0,i.y)(e)){return y=e,new o.c(function(e){y.then(function(t){e.closed||(e.next(t),e.complete())},function(t){return e.error(t)}).then(null,p.m)})}if((0,u.T)(e))return g(e);if((0,l.x)(e)){return v=e,new o.c(function(e){var t,r;try{for(var s=(0,n.Ju)(v),i=s.next();!i.done;i=s.next()){var o=i.value;if(e.next(o),e.closed)return}}catch(e){t={error:e}}finally{try{i&&!i.done&&(r=s.return)&&r.call(s)}finally{if(t)throw t.error}}e.complete()})}if((0,h.U)(e)){return m=e,g((0,h.C)(m))}}throw(0,c.L)(e)}function g(e){return new o.c(function(t){(function(e,t){var r,s,i,o;return(0,n.sH)(this,void 0,void 0,function(){var a;return(0,n.YH)(this,function(u){switch(u.label){case 0:u.trys.push([0,5,6,11]),r=(0,n.xN)(e),u.label=1;case 1:return[4,r.next()];case 2:if((s=u.sent()).done)return[3,4];if(a=s.value,t.next(a),t.closed)return[2];u.label=3;case 3:return[3,1];case 4:return[3,11];case 5:return i={error:u.sent()},[3,11];case 6:if(u.trys.push([6,,9,10]),!(s&&!s.done&&(o=r.return)))return[3,8];return[4,o.call(r)];case 7:u.sent(),u.label=8;case 8:return[3,10];case 9:if(i)throw i.error;return[7];case 10:return[7];case 11:return t.complete(),[2]}})})})(e,t).catch(function(e){return t.error(e)})})}},67374:(e,t,r)=>{r.d(t,{J:()=>o});var n=r(15703);let s=n.createContext(!0);function i(){throw Error("A function wrapped in useEffectEvent can't be called during rendering.")}function o(e){let t=n.useRef(i);return n.useInsertionEffect(()=>{t.current=e},[e]),(...e)=>((()=>{try{return n.use(s)}catch{return!1}})()&&i(),(0,t.current)(...e))}},69376:(e,t,r)=>{r.d(t,{h:()=>u});var n=r(97807),s=r(67060),i=r(22529),o=r(50274),a=r(17092);function u(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=(0,o.lI)(e),u=(0,o.R0)(e,1/0);return e.length?1===e.length?(0,s.Tg)(e[0]):(0,n.U)(u)((0,a.H)(e,r)):i.w}},70019:(e,t,r)=>{r.d(t,{F:()=>s,m:()=>i});var n=r(44385);function s(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return i(e)}function i(e){return 0===e.length?n.D:1===e.length?e[0]:function(t){return e.reduce(function(e,t){return t(e)},t)}}},70382:(e,t,r)=>{r.d(t,{h:()=>o});var n=r(67060),s=r(80759),i=r(85473);function o(e,t,r,o,a,u,c,l){var h=[],d=0,p=0,f=!1,y=function(){!f||h.length||d||t.complete()},g=function(e){return d<o?v(e):h.push(e)},v=function(e){u&&t.next(e),d++;var l=!1;(0,n.Tg)(r(e,p++)).subscribe((0,i._)(t,function(e){null==a||a(e),u?g(e):t.next(e)},function(){l=!0},void 0,function(){if(l)try{for(d--;h.length&&d<o;)!function(){var e=h.shift();c?(0,s.N)(t,c,function(){return v(e)}):v(e)}();y()}catch(e){t.error(e)}}))};return e.subscribe((0,i._)(t,g,function(){f=!0,y()})),function(){null==l||l()}}},70998:(e,t,r)=>{r.d(t,{Y:()=>i,l:()=>o});var n=r(9652),s=null;function i(e){if(n.$.useDeprecatedSynchronousErrorHandling){var t=!s;if(t&&(s={errorThrown:!1,error:null}),e(),t){var r=s,i=r.errorThrown,o=r.error;if(s=null,i)throw o}}else e()}function o(e){n.$.useDeprecatedSynchronousErrorHandling&&s&&(s.errorThrown=!0,s.error=e)}},71640:(e,t,r)=>{r.d(t,{x:()=>o});var n=r(80727),s=r(50274),i=r(17092);function o(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return(0,n.K)()((0,i.H)(e,(0,s.lI)(e)))}},73495:(e,t,r)=>{r.d(t,{T:()=>s});var n=r(5251);function s(e){return Symbol.asyncIterator&&(0,n.T)(null==e?void 0:e[Symbol.asyncIterator])}},74041:(e,t,r)=>{r.d(t,{x:()=>i});var n=r(22933),s=r(5251);function i(e){return(0,s.T)(null==e?void 0:e[n.l])}},75457:(e,t,r)=>{r.d(t,{Q:()=>o});var n=r(80759),s=r(8482),i=r(85473);function o(e,t){return void 0===t&&(t=0),(0,s.N)(function(r,s){r.subscribe((0,i._)(s,function(r){return(0,n.N)(s,e,function(){return s.next(r)},t)},function(){return(0,n.N)(s,e,function(){return s.complete()},t)},function(r){return(0,n.N)(s,e,function(){return s.error(r)},t)}
16))})}},75478:(e,t,r)=>{r.d(t,{T:()=>i});var n=r(8482),s=r(85473);function i(e,t){return(0,n.N)(function(r,n){var i=0;r.subscribe((0,s._)(n,function(r){n.next(e.call(t,r,i++))}))})}},79216:(e,t,r)=>{r.d(t,{a:()=>i});var n=r(30701);function s(e,t,r,s,{assignment:i}){if(!t.context)throw Error("Cannot assign to undefined `context`. Ensure that `context` is defined in the machine config.");let o={},a={context:t.context,event:r.event,spawn:function(e,{machine:t,context:r},s,i){return(o,a)=>{let u=((o,a)=>{if("string"!=typeof o)return(0,n.c)(o,{id:a?.id,parent:e.self,syncSnapshot:a?.syncSnapshot,input:a?.input,src:o,systemId:a?.systemId});{let u=(0,n.W)(t,o);if(!u)throw Error(`Actor logic '${o}' not implemented in machine '${t.id}'`);let c=(0,n.c)(u,{id:a?.id,parent:e.self,syncSnapshot:a?.syncSnapshot,input:"function"==typeof a?.input?a.input({context:r,event:s,self:e.self}):a?.input,src:o,systemId:a?.systemId});return i[c.id]=c,c}})(o,a);return i[u.id]=u,e.defer(()=>{u._processingStatus!==n._.Stopped&&u.start()}),u}}(e,t,r.event,o),self:e.self,system:e.system},u={};if("function"==typeof i)u=i(a,s);else for(let e of Object.keys(i)){let t=i[e];u[e]="function"==typeof t?t(a,s):t}let c=Object.assign({},t.context,u);return[(0,n.a0)(t,{context:c,children:Object.keys(o).length?{...t.children,...o}:t.children}),void 0,void 0]}function i(e){function t(e,t){}return t.type="xstate.assign",t.assignment=e,t.resolve=s,t}},80727:(e,t,r)=>{r.d(t,{K:()=>s});var n=r(97807);function s(){return(0,n.U)(1)}},80759:(e,t,r)=>{r.d(t,{N:()=>n});function n(e,t,r,n,s){void 0===n&&(n=0),void 0===s&&(s=!1);var i=t.schedule(function(){r(),s?e.add(this.schedule(null,n)):this.unsubscribe()},n);if(e.add(i),!s)return i}},83208:(e,t,r)=>{r.d(t,{R:()=>function e(t,r,f,y){if((0,u.T)(f)&&(y=f,f=void 0),y)return e(t,r,f).pipe((0,c.I)(y));var g,v,m,b=(0,n.zs)((g=t,(0,u.T)(g.addEventListener)&&(0,u.T)(g.removeEventListener))?h.map(function(e){return function(n){return t[e](r,n,f)}}):(v=t,(0,u.T)(v.addListener)&&(0,u.T)(v.removeListener))?l.map(p(t,r)):(m=t,(0,u.T)(m.on)&&(0,u.T)(m.off))?d.map(p(t,r)):[],2),w=b[0],_=b[1];if(!w&&(0,a.X)(t))return(0,o.Z)(function(t){return e(t,r,f)})((0,s.Tg)(t));if(!w)throw TypeError("Invalid event target");return new i.c(function(e){var t=function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];return e.next(1<t.length?t:t[0])};return w(t),function(){return _(t)}})}});var n=r(60827),s=r(67060),i=r(14511),o=r(11526),a=r(33071),u=r(5251),c=r(24490),l=["addListener","removeListener"],h=["addEventListener","removeEventListener"],d=["on","off"];function p(e,t){return function(r){return function(n){return e[r](t,n)}}}},85473:(e,t,r)=>{r.d(t,{H:()=>i,_:()=>s});var n=r(60827);function s(e,t,r,n,s){return new i(e,t,r,n,s)}var i=function(e){function t(t,r,n,s,i,o){var a=e.call(this,t)||this;return a.onFinalize=i,a.shouldUnsubscribe=o,a._next=r?function(e){try{r(e)}catch(e){t.error(e)}}:e.prototype._next,a._error=s?function(e){try{s(e)}catch(e){t.error(e)}finally{this.unsubscribe()}}:e.prototype._error,a._complete=n?function(){try{n()}catch(e){t.error(e)}finally{this.unsubscribe()}}:e.prototype._complete,a}return(0,n.C6)(t,e),t.prototype.unsubscribe=function(){var t;if(!this.shouldUnsubscribe||this.shouldUnsubscribe()){var r=this.closed;e.prototype.unsubscribe.call(this),r||null==(t=this.onFinalize)||t.call(this)}},t}(r(7654).vU)},86256:(e,t,r)=>{r.d(t,{C:()=>i,U:()=>o});var n=r(60827),s=r(5251);function i(e){return(0,n.AQ)(this,arguments,function(){var t,r,s;return(0,n.YH)(this,function(i){switch(i.label){case 0:t=e.getReader(),i.label=1;case 1:i.trys.push([1,,9,10]),i.label=2;case 2:return[4,(0,n.N3)(t.read())];case 3:if(s=(r=i.sent()).value,!r.done)return[3,5];return[4,(0,n.N3)(void 0)];case 4:return[2,i.sent()];case 5:return[4,(0,n.N3)(s)];case 6:return[4,i.sent()];case 7:return i.sent(),[3,2];case 8:return[3,10];case 9:return t.releaseLock(),[7];case 10:return[2]}})})}function o(e){return(0,s.T)(null==e?void 0:e.getReader)}},88816:(e,t,r)=>{r.d(t,{Ak:()=>i,d_:()=>s});let n=e=>crypto.getRandomValues(new Uint8Array(e)),s=(e,t=21)=>((e,t,r)=>{let n=(2<<Math.log(e.length-1)/Math.LN2)-1,s=-~(1.6*n*t/e.length);return (i=t)=>{if(i<=0)return"";let o="";for(;;){let t=r(s),a=0|s;for(;a--;)if((o+=e[t[a]&n]||"").length===i)return o}}})(e,t,n),i=(e=21)=>crypto.getRandomValues(new Uint8Array(e)).reduce((e,t)=>
16((t&=63)<36?e+=t.toString(36):t<62?e+=(t-26).toString(36).toUpperCase():t>62?e+="-":e+="_",e),"")},91766:(e,t,r)=>{r.d(t,{G:()=>n});var n=(0,r(46137).L)(function(e){return function(){e(this),this.name="EmptyError",this.message="no elements in sequence"}})},97807:(e,t,r)=>{r.d(t,{U:()=>i});var n=r(11526),s=r(44385);function i(e){return void 0===e&&(e=1/0),(0,n.Z)(s.D,e)}},99465:(e,t,r)=>{r.d(t,{D:()=>a});var n=Array.isArray,s=Object.getPrototypeOf,i=Object.prototype,o=Object.keys;function a(e){if(1===e.length){var t,r=e[0];if(n(r))return{args:r,keys:null};if((t=r)&&"object"==typeof t&&s(t)===i){var a=o(r);return{args:a.map(function(e){return r[e]}),keys:a}}}return{args:e,keys:null}}}}]);

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.