1const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/stegaEncodeSourceMap-CXnTKdKS.js","assets/index-CaUqsW3o.js","assets/tslib.es6-DCgJAGIv.js","assets/browser-Ppdm7yks.js"])))=>i.map(i=>d[i]); 2import{_ as Pt}from"./index-CaUqsW3o.js";import{c as ye,b as q,d as F,e as D,f as Zr,g as jt,h as Oe,i as Kr,j as en}from"./tslib.es6-DCgJAGIv.js";const qt=!(typeof navigator>"u")&&navigator.product==="ReactNative",Ft={timeout:qt?6e4:12e4},tn=function(r){const e={...Ft,...typeof r=="string"?{url:r}:r};if(e.timeout=Dt(e.timeout),e.query){const{url:t,searchParams:n}=(function(s){const i=s.indexOf("?");if(i===-1)return{url:s,searchParams:new URLSearchParams};const o=s.slice(0,i),a=s.slice(i+1);if(!qt)return{url:o,searchParams:new URLSearchParams(a)};if(typeof decodeURIComponent!="function")throw new Error("Broken `URLSearchParams` implementation, and `decodeURIComponent` is not defined");const u=new URLSearchParams;for(const c of a.split("&")){const[d,f]=c.split("=");d&&u.append(ot(d),ot(f||""))}return{url:o,searchParams:u}})(e.url);for(const[s,i]of Object.entries(e.query)){if(i!==void 0)if(Array.isArray(i))for(const a of i)n.append(s,a);else n.append(s,i);const o=n.toString();o&&(e.url=`${t}?${o}`)}}return e.method=e.body&&!e.method?"POST":(e.method||"GET").toUpperCase(),e};function ot(r){return decodeURIComponent(r.replace(/\+/g," "))}function Dt(r){if(r===!1||r===0)return!1;if(r.connect||r.socket)return r;const e=Number(r);return isNaN(e)?Dt(Ft.timeout):{connect:e,socket:e}}const rn=/^https?:\/\//i,nn=function(r){if(!rn.test(r.url))throw new Error(`"${r.url}" is not a valid URL`)};function Mt(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}const sn=["request","response","progress","error","abort"],at=["processOptions","validateOptions","interceptRequest","finalizeOptions","onRequest","onResponse","onError","onReturn","onHeaders"];function kt(r,e){const t=[],n=at.reduce((i,o)=>(i[o]=i[o]||[],i),{processOptions:[tn],validateOptions:[nn]});function s(i){const o=sn.reduce((h,p)=>(h[p]=(function(){const l=Object.create(null);let m=0;return{publish:function(w){for(const v in l)l[v](w)},subscribe:function(w){const v=m++;return l[v]=w,function(){delete l[v]}}}})(),h),{}),a=(h=>function(p,l,...m){const w=p==="onError";let v=l;for(let E=0;E<h[p].length&&(v=(0,h[p][E])(v,...m),!w||v);E++);return v})(n),u=a("processOptions",i);a("validateOptions",u);const c={options:u,channels:o,applyMiddleware:a};let d;const f=o.request.subscribe(h=>{d=e(h,(p,l)=>((m,w,v)=>{let E=m,b=w;if(!E)try{b=a("onResponse",w,v)}catch(_){b=null,E=_}E=E&&a("onError",E,v),E?o.error.publish(E):b&&o.response.publish(b)})(p,l,h))});o.abort.subscribe(()=>{f(),d&&d.abort()});const y=a("onReturn",o,c);return y===o&&o.request.publish(c),y}return s.use=function(i){if(!i)throw new Error("Tried to add middleware that resolved to falsey value");if(typeof i=="function")throw new Error("Tried to add middleware that was a function. It probably expects you to pass options to it.");if(i.onReturn&&n.onReturn.length>0)throw new Error("Tried to add new middleware with `onReturn` handler, but another handler has already been registered for this event");return at.forEach(o=>{i[o]&&n[o].push(i[o])}),t.push(i),s},s.clone=()=>kt(t,e),r.forEach(s.use),s}var ut,ct,on=Mt((function(){if(ct)return ut;ct=1;var r=function(t){return t.replace(/^\s+|\s+$/g,"")},e=function(t){return Object.prototype.toString.call(t)==="[object Array]"};return ut=function(t){if(!t)return{};for(var n=Object.create(null),s=r(t).split(` 3`),i=0;i<s.length;i++){var o=s[i],a=o.indexOf(":"),u=r(o.slice(0,a)).toLowerCase(),c=r(o.slice(a+1));typeof n[u]>"u"?n[u]=c:e(n[u])?n[u].push(c):n[u]=[n[u],c]}return n}})());let ke=class{onabort;onerror;onreadystatechange;ontimeout;readyState=0;response;responseText="";responseType="";status;statusText;withCredentials;#e;#t;#r;#s={};#n;#i={};#o;open(e,t,n){this.#e=e,this.#t=t,this.#r="",this.readyState=1,this.onreadystatechange?.(),this.#n=void 0}abort(){this.#n&&this.#n.abort()}getAllResponseHeaders(){return this.#r}setRequestHeader(e,t){this.#s[e]=t}setInit(e,t=!0){this.#i=e,this.#o=t}send(e){const t=this.responseType!=="arraybuffer",n={...this.#i,method:this.#e,headers:this.#s,body:e};typeof AbortController=="function"&&this.#o&&(this.#n=new AbortController,typeof EventTarget<"u"&&this.#n.signal instanceof EventTarget&&(n.signal=this.#n.signal)),typeof document<"u"&&(n.credentials=this.withCredentials?"include":"omit"),fetch(this.#t,n).then(s=>
3(s.headers.forEach((i,o)=>{this.#r+=`${o}: ${i}\r 4`}),this.status=s.status,this.statusText=s.statusText,this.readyState=3,this.onreadystatechange?.(),t?s.text():s.arrayBuffer())).then(s=>{typeof s=="string"?this.responseText=s:this.response=s,this.readyState=4,this.onreadystatechange?.()}).catch(s=>{s.name!=="AbortError"?this.onerror?.(s):this.onabort?.()})}};const me=typeof XMLHttpRequest=="function"?"xhr":"fetch",an=me==="xhr"?XMLHttpRequest:ke,un=(r,e)=>{const t=r.options,n=r.applyMiddleware("finalizeOptions",t),s={},i=r.applyMiddleware("interceptRequest",void 0,{adapter:me,context:r});if(i){const l=setTimeout(e,0,null,i);return{abort:()=>clearTimeout(l)}}let o=new an;o instanceof ke&&typeof n.fetch=="object"&&o.setInit(n.fetch,n.useAbortSignal??!0);const a=n.headers,u=n.timeout;let c=!1,d=!1,f=!1;if(o.onerror=l=>{p(o instanceof ke?l instanceof Error?l:new Error(`Request error while attempting to reach is ${n.url}`,{cause:l}):new Error(`Request error while attempting to reach is ${n.url}${l.lengthComputable?`(${l.loaded} of ${l.total} bytes transferred)`:""}`))},o.ontimeout=l=>{p(new Error(`Request timeout while attempting to reach ${n.url}${l.lengthComputable?`(${l.loaded} of ${l.total} bytes transferred)`:""}`))},o.onabort=()=>{h(!0),c=!0},o.onreadystatechange=function(){u&&(h(),s.socket=setTimeout(()=>y("ESOCKETTIMEDOUT"),u.socket)),!c&&o&&o.readyState===4&&o.status!==0&&(function(){if(!(c||d||f)){if(o.status===0)return void p(new Error("Unknown XHR error"));h(),d=!0,e(null,{body:o.response||(o.responseType===""||o.responseType==="text"?o.responseText:""),url:n.url,method:n.method,headers:on(o.getAllResponseHeaders()),statusCode:o.status,statusMessage:o.statusText})}})()},o.open(n.method,n.url,!0),o.withCredentials=!!n.withCredentials,a&&o.setRequestHeader)for(const l in a)a.hasOwnProperty(l)&&o.setRequestHeader(l,a[l]);return n.rawBody&&(o.responseType="arraybuffer"),r.applyMiddleware("onRequest",{options:n,adapter:me,request:o,context:r}),o.send(n.body||null),u&&(s.connect=setTimeout(()=>y("ETIMEDOUT"),u.connect)),{abort:function(){c=!0,o&&o.abort()}};function y(l){f=!0,o.abort();const m=new Error(l==="ESOCKETTIMEDOUT"?`Socket timed out on request to ${n.url}`:`Connection timed out on request to ${n.url}`);m.code=l,r.channels.error.publish(m)}function h(l){(l||c||o&&o.readyState>=2&&s.connect)&&clearTimeout(s.connect),s.socket&&clearTimeout(s.socket)}function p(l){if(d)return;h(!0),d=!0,o=null;const m=l||new Error(`Network error while attempting to reach ${n.url}`);m.isNetworkError=!0,m.request=n,e(m)}},cn=(r=[],e=un)=>kt(r,e);var ln={},lt,dt,ht,ft,pt,Re={exports:{}};pt||(pt=1,(function(r,e){e.formatArgs=function(n){if(n[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+n[0]+(this.useColors?"%c ":" ")+"+"+r.exports.humanize(this.diff),!this.useColors)return;const s="color: "+this.color;n.splice(1,0,s,"color: inherit");let i=0,o=0;n[0].replace(/%[a-zA-Z%]/g,a=>{a!=="%%"&&(i++,a==="%c"&&(o=i))}),n.splice(o,0,s)},e.save=function(n){try{n?e.storage.setItem("debug",n):e.storage.removeItem("debug")}catch{}},e.load=function(){let n;try{n=e.storage.getItem("debug")||e.storage.getItem("DEBUG")}catch{}return!n&&typeof process<"u"&&"env"in process&&(n=ln.DEBUG),n},e.useColors=function(){if(typeof window<"u"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs))return!0;if(typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;let n;return typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&navigator.userAgent&&(n=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(n[1],10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)},e.storage=(function(){try{return localStorage}catch{}})(),e.destroy=(()=>{let n=!1;return()=>{n||(n=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),e.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33
4CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"],e.log=console.debug||console.log||(()=>{}),r.exports=(ft?ht:(ft=1,ht=function(n){function s(a){let u,c,d,f=null;function y(...h){if(!y.enabled)return;const p=y,l=Number(new Date),m=l-(u||l);p.diff=m,p.prev=u,p.curr=l,u=l,h[0]=s.coerce(h[0]),typeof h[0]!="string"&&h.unshift("%O");let w=0;h[0]=h[0].replace(/%([a-zA-Z%])/g,(v,E)=>{if(v==="%%")return"%";w++;const b=s.formatters[E];if(typeof b=="function"){const _=h[w];v=b.call(p,_),h.splice(w,1),w--}return v}),s.formatArgs.call(p,h),(p.log||s.log).apply(p,h)}return y.namespace=a,y.useColors=s.useColors(),y.color=s.selectColor(a),y.extend=i,y.destroy=s.destroy,Object.defineProperty(y,"enabled",{enumerable:!0,configurable:!1,get:()=>f!==null?f:(c!==s.namespaces&&(c=s.namespaces,d=s.enabled(a)),d),set:h=>{f=h}}),typeof s.init=="function"&&s.init(y),y}function i(a,u){const c=s(this.namespace+(typeof u>"u"?":":u)+a);return c.log=this.log,c}function o(a,u){let c=0,d=0,f=-1,y=0;for(;c<a.length;)if(d<u.length&&(u[d]===a[c]||u[d]==="*"))u[d]==="*"?(f=d,y=c,d++):(c++,d++);else{if(f===-1)return!1;d=f+1,y++,c=y}for(;d<u.length&&u[d]==="*";)d++;return d===u.length}return s.debug=s,s.default=s,s.coerce=function(a){return a instanceof Error?a.stack||a.message:a},s.disable=function(){const a=[...s.names,...s.skips.map(u=>"-"+u)].join(",");return s.enable(""),a},s.enable=function(a){s.save(a),s.namespaces=a,s.names=[],s.skips=[];const u=(typeof a=="string"?a:"").trim().replace(/\s+/g,",").split(",").filter(Boolean);for(const c of u)c[0]==="-"?s.skips.push(c.slice(1)):s.names.push(c)},s.enabled=function(a){for(const u of s.skips)if(o(a,u))return!1;for(const u of s.names)if(o(a,u))return!0;return!1},s.humanize=(function(){if(dt)return lt;dt=1;var a=1e3,u=60*a,c=60*u,d=24*c,f=7*d;function y(h,p,l,m){var w=p>=1.5*l;return Math.round(h/l)+" "+m+(w?"s":"")}return lt=function(h,p){p=p||{};var l,m,w=typeof h;if(w==="string"&&h.length>0)return(function(v){if(!((v=String(v)).length>100)){var E=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(v);if(E){var b=parseFloat(E[1]);switch((E[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return 315576e5*b;case"weeks":case"week":case"w":return b*f;case"days":case"day":case"d":return b*d;case"hours":case"hour":case"hrs":case"hr":case"h":return b*c;case"minutes":case"minute":case"mins":case"min":case"m":return b*u;case"seconds":case"second":case"secs":case"sec":case"s":return b*a;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return b;default:return}}}})(h);if(w==="number"&&isFinite(h))return p.long?(l=h,(m=Math.abs(l))>=d?y(l,m,d,"day"):m>=c?y(l,m,c,"hour"):m>=u?y(l,m,u,"minute"):m>=a?y(l,m,a,"second"):l+" ms"):(function(v){var E=Math.abs(v);return E>=d?Math.round(v/d)+"d":E>=c?Math.round(v/c)+"h":E>=u?Math.round(v/u)+"m":E>=a?Math.round(v/a)+"s":v+"ms"})(h);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(h))}})(),s.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(n).forEach(a=>{s[a]=n[a]}),s.names=[],s.skips=[],s.formatters={},s.selectColor=function(a){let u=0;for(let c=0;c<a.length;c++)u=(u<<5)-u+a.charCodeAt(c),u|=0;return s.colors[Math.abs(u)%s.colors.length]},s.enable(s.load()),s}))(e);const{formatters:t}=r.exports;t.j=function(n){try{return JSON.stringify(n)}catch(s){return"[UnexpectedJSONParseError]: "+s.message}}})(Re,Re.exports)),Re.exports;const dn=typeof Buffer>"u"?()=>!1:r=>Buffer.isBuffer(r);function yt(r){return Object.prototype.toString.call(r)==="[object Object]"}function hn(r){if(yt(r)===!1)return!1;const e=r.constructor;if(e===void 0)return!0;const t=e.prototype;return!(yt(t)===!1||t.hasOwnProperty("isPrototypeOf")===!1)}const fn=["boolean","string","number"];function pn(){return{processOptions:r=>{const e=r.body;return!e||typeof e.pipe=="function"||dn(e)||fn.indexOf(typeof e)===-1&&!Array.isArray(e)&&!hn(e)?r:Object.assign({},r,{body:JSON.stringify(r.body),headers:Object.assign({},r.headers,{"Content-Type":"application/json"})})}}}function yn(r){return{onResponse:t=>{const n=t.headers["content-type"]||"",s=r&&r.force||n.indexOf("application/json")!==-1;return t.body&&n&&s?Object.assign({},t,{body:e(t.body)}):t},processOptions:t=>Object.assign({},t,{headers:Object.assign({Accept:"application/json"},t.headers)})};function e(t){try{return JSON.parse(t)}catch(n){throw n.message=`Failed to parsed response body as JSON: ${n.message}`,n}}}let ee={};typeof globalThis<"u"?ee=globalThis:typeof window<"u"?ee=window:typeof global<"u"?ee=global:typeof self<"u"&&(ee=self);var mn=ee;function gn(r={}){const e=r.implementation||mn.Observable;if(!e)throw new Error("`Observable` is not available in global scope, and n
4o implementation was passed");return{onReturn:(t,n)=>new e(s=>(t.error.subscribe(i=>s.error(i)),t.progress.subscribe(i=>s.next(Object.assign({type:"progress"},i))),t.response.subscribe(i=>{s.next(Object.assign({type:"response"},i)),s.complete()}),t.request.publish(n),()=>t.abort.publish()))}}function vn(){return{onRequest:r=>{if(r.adapter!=="xhr")return;const e=r.request,t=r.context;function n(s){return i=>{const o=i.lengthComputable?i.loaded/i.total*100:-1;t.channels.progress.publish({stage:s,percent:o,total:i.total,loaded:i.loaded,lengthComputable:i.lengthComputable})}}"upload"in e&&"onprogress"in e.upload&&(e.upload.onprogress=n("upload")),"onprogress"in e&&(e.onprogress=n("download"))}}}var Lt=(r,e,t)=>(t.method==="GET"||t.method==="HEAD")&&(r.isNetworkError||!1);function bn(r){return 100*Math.pow(2,r)+100*Math.random()}const Ve=(r={})=>(e=>{const t=e.maxRetries||5,n=e.retryDelay||bn,s=e.shouldRetry;return{onError:(i,o)=>{const a=o.options,u=a.maxRetries||t,c=a.retryDelay||n,d=a.shouldRetry||s,f=a.attemptNumber||0;if((y=a.body)!==null&&typeof y=="object"&&typeof y.pipe=="function"||!d(i,f,a)||f>=u)return i;var y;const h=Object.assign({},o,{options:Object.assign({},a,{attemptNumber:f+1})});return setTimeout(()=>o.channels.request.publish(h),c(f)),null}}})({shouldRetry:Lt,...r});Ve.shouldRetry=Lt;function C(r){return typeof r=="function"}function Ue(r){var e=function(n){Error.call(n),n.stack=new Error().stack},t=r(e);return t.prototype=Object.create(Error.prototype),t.prototype.constructor=t,t}var Pe=Ue(function(r){return function(t){r(this),this.message=t?t.length+` errors occurred during unsubscription: 5`+t.map(function(n,s){return s+1+") "+n.toString()}).join(` 6 `):"",this.name="UnsubscriptionError",this.errors=t}});function ge(r,e){if(r){var t=r.indexOf(e);0<=t&&r.splice(t,1)}}var oe=(function(){function r(e){this.initialTeardown=e,this.closed=!1,this._parentage=null,this._finalizers=null}return r.prototype.unsubscribe=function(){var e,t,n,s,i;if(!this.closed){this.closed=!0;var o=this._parentage;if(o)if(this._parentage=null,Array.isArray(o))try{for(var a=ye(o),u=a.next();!u.done;u=a.next()){var c=u.value;c.remove(this)}}catch(l){e={error:l}}finally{try{u&&!u.done&&(t=a.return)&&t.call(a)}finally{if(e)throw e.error}}else o.remove(this);var d=this.initialTeardown;if(C(d))try{d()}catch(l){i=l instanceof Pe?l.errors:[l]}var f=this._finalizers;if(f){this._finalizers=null;try{for(var y=ye(f),h=y.next();!h.done;h=y.next()){var p=h.value;try{mt(p)}catch(l){i=i??[],l instanceof Pe?i=q(q([],F(i)),F(l.errors)):i.push(l)}}}catch(l){n={error:l}}finally{try{h&&!h.done&&(s=y.return)&&s.call(y)}finally{if(n)throw n.error}}}if(i)throw new Pe(i)}},r.prototype.add=function(e){var t;if(e&&e!==this)if(this.closed)mt(e);else{if(e instanceof r){if(e.closed||e._hasParent(this))return;e._addParent(this)}(this._finalizers=(t=this._finalizers)!==null&&t!==void 0?t:[]).push(e)}},r.prototype._hasParent=function(e){var t=this._parentage;return t===e||Array.isArray(t)&&t.includes(e)},r.prototype._addParent=function(e){var t=this._parentage;this._parentage=Array.isArray(t)?(t.push(e),t):t?[t,e]:e},r.prototype._removeParent=function(e){var t=this._parentage;t===e?this._parentage=null:Array.isArray(t)&&ge(t,e)},r.prototype.remove=function(e){var t=this._finalizers;t&&ge(t,e),e instanceof r&&e._removeParent(this)},r.EMPTY=(function(){var e=new r;return e.closed=!0,e})(),r})(),Vt=oe.EMPTY;function Ut(r){return r instanceof oe||r&&"closed"in r&&C(r.remove)&&C(r.add)&&C(r.unsubscribe)}function mt(r){C(r)?r():r.unsubscribe()}var wn={Promise:void 0},En={setTimeout:function(r,e){for(var t=[],n=2;n<arguments.length;n++)t[n-2]=arguments[n];return setTimeout.apply(void 0,q([r,e],F(t)))},clearTimeout:function(r){return clearTimeout(r)},delegate:void 0};function Nt(r){En.setTimeout(function(){throw r})}function gt(){}function pe(r){r()}var Ne=(function(r){D(e,r);function e(t){var n=r.call(this)||this;return n.isStopped=!1,t?(n.destination=t,Ut(t)&&t.add(n)):n.destination=$n,n}return e.create=function(t,n,s){return new Q(t,n,s)},e.prototype.next=function(t){this.isStopped||this._next(t)},e.prototype.error=function(t){this.isStopped||(this.isStopped=!0,this._error(t))},e.prototype.complete=function(){this.isStopped||(this.isStopped=!0,this._complete())},e.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,r.prototype.unsubscribe.call(this),this.destination=null)},e.prototype._next=function(t){this.destination.next(t)},e.prototype._error=function(t){try{this.destination.error(t)}finally{this.unsubscribe()}},e.prototype._complete=function(){try{this.destination.complete()}finally{this.unsubscribe()}},e})(oe),Cn=(function(){function r(e){this.partialObserver=e}return r.prototype.next=function(e){var t=this.partialObserver;if(t.next)try{t.next(e)}catch(n){fe(n)}},r.prototype.error=function(e){var t=this.partialObserver;if(t.error)try{t.error(e)}catch(n){fe(n)}else fe(e)},r.prototype.complete=function(){var e=this.partialObserver;if(e.complete)try{e.complete()}catch(t){fe(t)}},r})(),Q=(function(r){D(e,r);function e(t,n,s){var i=r.call(this)||this,o;return C(t)||!t?o={next:t??void 0,error:n??void 0,complete:s??void 0}:o=t,i.destination=new Cn(o),i}return e})(Ne);function fe(r){Nt(r)}function In(r){throw r}var $n={closed:!0,next:gt,error:In,complete:gt},He=(function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"})();function $e(r){return r}function An(){for(var r=[],e=0;e<arguments.length;e++)r[e]=arguments[e];return Ht(r)}function Ht(r){return r.length===0?$e:r.length===1?r[0]:function(t){return r.reduce(function(n,s){return s(n)},t)}}var $=(function(){function r(e){e&&(this._subscribe=e)}return r.prototype.lift=function(e){var t=new r;return t.source=this,t.operator=e,t},r.prototype.subscribe=function(e,t,n){var s=this,i=_n(e)?e:new Q(e,t,n);return pe(function(){var o=s,a=o.operator,u=o.source;i.add(a?a.call(i,u):u?s._subscribe(i):s._trySubscribe(i))}),i},r.prototype._trySubscribe=function(e){try{return this._subscribe(e)}catch(t){e.error(t)}},r.prototype.forEach=function(e,t){var n=this;return t=vt(t),new t(function(s,i){var o=new Q({next:function(a){try{e(a)}catch(u){i(u),o.unsubscribe()}},error:i,complete:s});n.subscribe(o)})},r.prototype._subscribe=function(e){var t;return(t=this.source)===null||t===void 0?void 0:t.subscribe(e)},r.prototype[He]=function(){return this},r.prototype.pipe=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return Ht(e)(this)},r.prototype.toPromise=function(e){var t=this;return e=vt(e),new e(function(n,s){var i;t.subscribe(function(o){return i=o},function(o){return s(o)},function(){return n(i)})})},r.create=function(e){return new r(e)},r})();function vt(r){var e;return(e=r??wn.Promise)!==null&&e!==void 0?e:Promise}function Sn(r){return r&&C(r.next)&&C(r.error)&&C(r.complete)}function _n(r){return r&&r instanceof Ne||Sn(r)&&Ut(r)}function xn(r){return C(r?.lift)}function R(r){return function(e){if(xn(e))return e.lift(function(t){try{return r(t,this)}catch(n){this.error(n)}});throw new TypeError("Unable to lift unknown Observable type")}}function V(r,e,t,n,s){return new Tn(r,e,t,n,s)}var Tn=(function(r){D(e,r);function e(t,n,s,i,o,a){var u=r.call(this,t)||this;return u.onFinalize=o,u.shouldUnsubscribe=a,u._next=n?function(c){try{n(c)}catch(d){t.error(d)}}:r.prototype._next,u._error=i?function(c){try{i(c)}catch(d){t.error(d)}finally{this.unsubscribe()}}
6:r.prototype._error,u._complete=s?function(){try{s()}catch(c){t.error(c)}finally{this.unsubscribe()}}:r.prototype._complete,u}return e.prototype.unsubscribe=function(){var t;if(!this.shouldUnsubscribe||this.shouldUnsubscribe()){var n=this.closed;r.prototype.unsubscribe.call(this),!n&&((t=this.onFinalize)===null||t===void 0||t.call(this))}},e})(Ne),On=Ue(function(r){return function(){r(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"}}),We=(function(r){D(e,r);function e(){var t=r.call(this)||this;return t.closed=!1,t.currentObservers=null,t.observers=[],t.isStopped=!1,t.hasError=!1,t.thrownError=null,t}return e.prototype.lift=function(t){var n=new bt(this,this);return n.operator=t,n},e.prototype._throwIfClosed=function(){if(this.closed)throw new On},e.prototype.next=function(t){var n=this;pe(function(){var s,i;if(n._throwIfClosed(),!n.isStopped){n.currentObservers||(n.currentObservers=Array.from(n.observers));try{for(var o=ye(n.currentObservers),a=o.next();!a.done;a=o.next()){var u=a.value;u.next(t)}}catch(c){s={error:c}}finally{try{a&&!a.done&&(i=o.return)&&i.call(o)}finally{if(s)throw s.error}}}})},e.prototype.error=function(t){var n=this;pe(function(){if(n._throwIfClosed(),!n.isStopped){n.hasError=n.isStopped=!0,n.thrownError=t;for(var s=n.observers;s.length;)s.shift().error(t)}})},e.prototype.complete=function(){var t=this;pe(function(){if(t._throwIfClosed(),!t.isStopped){t.isStopped=!0;for(var n=t.observers;n.length;)n.shift().complete()}})},e.prototype.unsubscribe=function(){this.isStopped=this.closed=!0,this.observers=this.currentObservers=null},Object.defineProperty(e.prototype,"observed",{get:function(){var t;return((t=this.observers)===null||t===void 0?void 0:t.length)>0},enumerable:!1,configurable:!0}),e.prototype._trySubscribe=function(t){return this._throwIfClosed(),r.prototype._trySubscribe.call(this,t)},e.prototype._subscribe=function(t){return this._throwIfClosed(),this._checkFinalizedStatuses(t),this._innerSubscribe(t)},e.prototype._innerSubscribe=function(t){var n=this,s=this,i=s.hasError,o=s.isStopped,a=s.observers;return i||o?Vt:(this.currentObservers=null,a.push(t),new oe(function(){n.currentObservers=null,ge(a,t)}))},e.prototype._checkFinalizedStatuses=function(t){var n=this,s=n.hasError,i=n.thrownError,o=n.isStopped;s?t.error(i):o&&t.complete()},e.prototype.asObservable=function(){var t=new $;return t.source=this,t},e.create=function(t,n){return new bt(t,n)},e})($),bt=(function(r){D(e,r);function e(t,n){var s=r.call(this)||this;return s.destination=t,s.source=n,s}return e.prototype.next=function(t){var n,s;(s=(n=this.destination)===null||n===void 0?void 0:n.next)===null||s===void 0||s.call(n,t)},e.prototype.error=function(t){var n,s;(s=(n=this.destination)===null||n===void 0?void 0:n.error)===null||s===void 0||s.call(n,t)},e.prototype.complete=function(){var t,n;(n=(t=this.destination)===null||t===void 0?void 0:t.complete)===null||n===void 0||n.call(t)},e.prototype._subscribe=function(t){var n,s;return(s=(n=this.source)===null||n===void 0?void 0:n.subscribe(t))!==null&&s!==void 0?s:Vt},e})(We),ze={now:function(){return(ze.delegate||Date).now()},delegate:void 0},Rn=(function(r){D(e,r);function e(t,n,s){t===void 0&&(t=1/0),n===void 0&&(n=1/0),s===void 0&&(s=ze);var i=r.call(this)||this;return i._bufferSize=t,i._windowTime=n,i._timestampProvider=s,i._buffer=[],i._infiniteTimeWindow=!0,i._infiniteTimeWindow=n===1/0,i._bufferSize=Math.max(1,t),i._windowTime=Math.max(1,n),i}return e.prototype.next=function(t){var n=this,s=n.isStopped,i=n._buffer,o=n._infiniteTimeWindow,a=n._timestampProvider,u=n._windowTime;s||(i.push(t),!o&&i.push(a.now()+u)),this._trimBuffer(),r.prototype.next.call(this,t)},e.prototype._subscribe=function(t){this._throwIfClosed(),this._trimBuffer();for(var n=this._innerSubscribe(t),s=this,i=s._infiniteTimeWindow,o=s._buffer,a=o.slice(),u=0;u<a.length&&!t.closed;u+=i?1:2)t.next(a[u]);return this._checkFinalizedStatuses(t),n},e.prototype._trimBuffer=function(){var t=this,n=t._bufferSize,s=t._timestampProvider,i=t._buffer,o=t._infiniteTimeWindow,a=(o?1:2)*n;if(n<1/0&&a<i.length&&i.splice(0,i.length-a),!o){for(var u=s.now(),c=0,d=1;d<i.length&&i[d]<=u;d+=2)c=d;c&&i.splice(0,c+1)}},e})(We),Pn=(function(r){D(e,r);function e(t,n){return r.call(this)||this}return e.prototype.schedule=function(t,n){return this},e})(oe),wt={setInterval:function(r,e){for(var t=[],n=2;n<arguments.length;n++)t[n-2]=arguments[n];return setInterval.apply(void 0,q([r,e],F(t)))},clearInterval:function(r){return clearInterval(r)},delegate:void 0},jn=(function(r){D(e,r);function e(t,n){var s=r.call(this,t,n)||this;
vendor: 4,801 bytes, line 6
6return s.scheduler=t,s.work=n,s.pending=!1,s}return e.prototype.schedule=function(t,n){var s;if(n===void 0&&(n=0),this.closed)return this;this.state=t;var i=this.id,o=this.scheduler;return i!=null&&(this.id=this.recycleAsyncId(o,i,n)),this.pending=!0,this.delay=n,this.id=(s=this.id)!==null&&s!==void 0?s:this.requestAsyncId(o,this.id,n),this},e.prototype.requestAsyncId=function(t,n,s){return s===void 0&&(s=0),wt.setInterval(t.flush.bind(t,this),s)},e.prototype.recycleAsyncId=function(t,n,s){if(s===void 0&&(s=0),s!=null&&this.delay===s&&this.pending===!1)return n;n!=null&&wt.clearInterval(n)},e.prototype.execute=function(t,n){if(this.closed)return new Error("executing a cancelled action");this.pending=!1;var s=this._execute(t,n);if(s)return s;this.pending===!1&&this.id!=null&&(this.id=this.recycleAsyncId(this.scheduler,this.id,null))},e.prototype._execute=function(t,n){var s=!1,i;try{this.work(t)}catch(o){s=!0,i=o||new Error("Scheduled action threw falsy error")}if(s)return this.unsubscribe(),i},e.prototype.unsubscribe=function(){if(!this.closed){var t=this,n=t.id,s=t.scheduler,i=s.actions;this.work=this.state=this.scheduler=null,this.pending=!1,ge(i,this),n!=null&&(this.id=this.recycleAsyncId(s,n,null)),this.delay=null,r.prototype.unsubscribe.call(this)}},e})(Pn),Et=(function(){function r(e,t){t===void 0&&(t=r.now),this.schedulerActionCtor=e,this.now=t}return r.prototype.schedule=function(e,t,n){return t===void 0&&(t=0),new this.schedulerActionCtor(this,e).schedule(n,t)},r.now=ze.now,r})(),qn=(function(r){D(e,r);function e(t,n){n===void 0&&(n=Et.now);var s=r.call(this,t,n)||this;return s.actions=[],s._active=!1,s}return e.prototype.flush=function(t){var n=this.actions;if(this._active){n.push(t);return}var s;this._active=!0;do if(s=t.execute(t.state,t.delay))break;while(t=n.shift());if(this._active=!1,s){for(;t=n.shift();)t.unsubscribe();throw s}},e})(Et),Fn=new qn(jn),Dn=Fn,Mn=new $(function(r){return r.complete()});function kn(r){return r&&C(r.schedule)}function Be(r){return r[r.length-1]}function Ln(r){return C(Be(r))?r.pop():void 0}function Ge(r){return kn(Be(r))?r.pop():void 0}function Vn(r,e){return typeof Be(r)=="number"?r.pop():e}var Wt=(function(r){return r&&typeof r.length=="number"&&typeof r!="function"});function zt(r){return C(r?.then)}function Bt(r){return C(r[He])}function Gt(r){return Symbol.asyncIterator&&C(r?.[Symbol.asyncIterator])}function Qt(r){return new TypeError("You provided "+(r!==null&&typeof r=="object"?"an invalid object":"'"+r+"'")+" where a stream was expected. You can provide an Observable, Promise, ReadableStream, Array, AsyncIterable, or Iterable.")}function Un(){return typeof Symbol!="function"||!Symbol.iterator?"@@iterator":Symbol.iterator}var Jt=Un();function Yt(r){return C(r?.[Jt])}function Xt(r){return Zr(this,arguments,function(){var t,n,s,i;return jt(this,function(o){switch(o.label){case 0:t=r.getReader(),o.label=1;case 1:o.trys.push([1,,9,10]),o.label=2;case 2:return[4,Oe(t.read())];case 3:return n=o.sent(),s=n.value,i=n.done,i?[4,Oe(void 0)]:[3,5];case 4:return[2,o.sent()];case 5:return[4,Oe(s)];case 6:return[4,o.sent()];case 7:return o.sent(),[3,2];case 8:return[3,10];case 9:return t.releaseLock(),[7];case 10:return[2]}})})}function Zt(r){return C(r?.getReader)}function P(r){if(r instanceof $)return r;if(r!=null){if(Bt(r))return Nn(r);if(Wt(r))return Hn(r);if(zt(r))return Wn(r);if(Gt(r))return Kt(r);if(Yt(r))return zn(r);if(Zt(r))return Bn(r)}throw Qt(r)}function Nn(r){return new $(function(e){var t=r[He]();if(C(t.subscribe))return t.subscribe(e);throw new TypeError("Provided object does not correctly implement Symbol.observable")})}function Hn(r){return new $(function(e){for(var t=0;t<r.length&&!e.closed;t++)e.next(r[t]);e.complete()})}function Wn(r){return new $(function(e){r.then(function(t){e.closed||(e.next(t),e.complete())},function(t){return e.error(t)}).then(null,Nt)})}function zn(r){return new $(function(e){var t,n;try{for(var s=ye(r),i=s.next();!i.done;i=s.next()){var o=i.value;if(e.next(o),e.closed)return}}catch(a){t={error:a}}finally{try{i&&!i.done&&(n=s.return)&&n.call(s)}finally{if(t)throw t.error}}e.complete()})}function Kt(r){return new $(function(e){Gn(r,e).catch(function(t){return e.error(t)})})}function Bn(r){return Kt(Xt(r))}function Gn(r,e){var t,n,s,i;return Kr(this,void 0,void 0,function(){var o,a;return jt(this,function(u){switch(u.label){case 0:u.trys.push([0,5,6,11]),t=en(r),u.label=1;case 1:return[4,t.next()];case 2:if(n=u.sent(),!!n.done)return[3,4];if(o=n.value,e.next(o),e.closed)return[2];u.label=3;case 3:return[3,1];case 4:return[3,11];case 5:return a=u.sent(),s={error:a},[3,11];case 6:return u.trys.push([6,,9,10]),n&&!n.done&&(i=t.return)?[4,i.call(t)]:[3,8];case 7:u.sent(),u.label=8;case 8:return[3,10];case 9:if(s)throw s.error;return[7];
6case 10:return[7];case 11:return e.complete(),[2]}})})}function U(r,e,t,n,s){n===void 0&&(n=0),s===void 0&&(s=!1);var i=e.schedule(function(){t(),s?r.add(this.schedule(null,n)):this.unsubscribe()},n);if(r.add(i),!s)return i}function er(r,e){return e===void 0&&(e=0),R(function(t,n){t.subscribe(V(n,function(s){return U(n,r,function(){return n.next(s)},e)},function(){return U(n,r,function(){return n.complete()},e)},function(s){return U(n,r,function(){return n.error(s)},e)}))})}function tr(r,e){return e===void 0&&(e=0),R(function(t,n){n.add(r.schedule(function(){return t.subscribe(n)},e))})}function Qn(r,e){return P(r).pipe(tr(e),er(e))}function Jn(r,e){return P(r).pipe(tr(e),er(e))}function Yn(r,e){return new $(function(t){var n=0;return e.schedule(function(){n===r.length?t.complete():(t.next(r[n++]),t.closed||this.schedule())})})}function Xn(r,e){return new $(function(t){var n;return U(t,e,function(){n=r[Jt](),U(t,e,function(){var s,i,o;try{s=n.next(),i=s.value,o=s.done}catch(a){t.error(a);return}o?t.complete():t.next(i)},0,!0)}),function(){return C(n?.return)&&n.return()}})}function rr(r,e){if(!r)throw new Error("Iterable cannot be null");return new $(function(t){U(t,e,function(){var n=r[Symbol.asyncIterator]();U(t,e,function(){n.next().then(function(s){s.done?t.complete():t.next(s.value)})},0,!0)})})}function Zn(r,e){return rr(Xt(r),e)}function Kn(r,e){if(r!=null){if(Bt(r))return Qn(r,e);if(Wt(r))return Yn(r,e);if(zt(r))return Jn(r,e);if(Gt(r))return rr(r,e);if(Yt(r))return Xn(r,e);if(Zt(r))return Zn(r,e)}throw Qt(r)}function ae(r,e){return e?Kn(r,e):P(r)}function B(){for(var r=[],e=0;e<arguments.length;e++)r[e]=arguments[e];var t=Ge(r);return ae(r,t)}function Qe(r,e){var t=C(r)?r:function(){return r},n=function(s){return s.error(t())};return new $(n)}function es(r){return!!r&&(r instanceof $||C(r.lift)&&C(r.subscribe))}var nr=Ue(function(r){return function(){r(this),this.name="EmptyError",this.message="no elements in sequence"}});function g(r,e){return new Promise(function(t,n){var s=!1,i;r.subscribe({next:function(o){i=o,s=!0},error:n,complete:function(){s?t(i):n(new nr)}})})}function je(r,e){return new Promise(function(t,n){var s=new Q({next:function(i){t(i),s.unsubscribe()},error:n,complete:function(){n(new nr)}});r.subscribe(s)})}function ts(r){return r instanceof Date&&!isNaN(r)}function S(r,e){return R(function(t,n){var s=0;t.subscribe(V(n,function(i){n.next(r.call(e,i,s++))}))})}var rs=Array.isArray;function ns(r,e){return rs(e)?r.apply(void 0,q([],F(e))):r(e)}function ss(r){return S(function(e){return ns(r,e)})}function is(r,e,t){return t===void 0&&(t=$e),function(n){Ct(e,function(){for(var s=r.length,i=new Array(s),o=s,a=s,u=function(d){Ct(e,function(){var f=ae(r[d],e),y=!1;f.subscribe(V(n,function(h){i[d]=h,y||(y=!0,a--),a||n.next(t(i.slice()))},function(){--o||n.complete()}))},n)},c=0;c<s;c++)u(c)})}}function Ct(r,e,t){e()}function os(r,e,t,n,s,i,o,a){var u=[],c=0,d=0,f=!1,y=function(){f&&!u.length&&!c&&e.complete()},h=function(l){return c<n?p(l):u.push(l)},p=function(l){c++;var m=!1;P(t(l,d++)).subscribe(V(e,function(w){e.next(w)},function(){m=!0},void 0,function(){if(m)try{c--;for(var w=function(){var v=u.shift();o||p(v)};u.length&&c<n;)w();y()}catch(v){e.error(v)}}))};return r.subscribe(V(e,h,function(){f=!0,y()})),function(){}}function N(r,e,t){return t===void 0&&(t=1/0),C(e)?N(function(n,s){return S(function(i,o){return e(n,i,s,o)})(P(r(n,s)))},t):(typeof e=="number"&&(t=e),R(function(n,s){return os(n,s,r,t)}))}function sr(r){return r===void 0&&(r=1/0),N($e,r)}function as(){return sr(1)}function us(){for(var r=[],e=0;e<arguments.length;e++)r[e]=arguments[e];return as()(ae(r,Ge(r)))}function ir(r){return new $(function(e){P(r()).subscribe(e)})}function cs(r,e,t){return t===void 0&&(t=Dn),new $(function(n){var s=ts(r)?+r-t.now():r;s<0&&(s=0);var i=0;return t.schedule(function(){n.closed||(n.next(i++),n.complete())},s)})}function ls(){for(var r=[],e=0;e<arguments.length;e++)r[e]=arguments[e];var t=Ge(r),n=Vn(r,1/0),s=r;return s.length?s.length===1?P(s[0]):sr(n)(ae(s,t)):Mn}var ds=Array.isArray;function hs(r){return r.length===1&&ds(r[0])?r[0]:r}function K(r,e){return R(function(t,n){var s=0;t.subscribe(V(n,function(i){return r.call(e,i,s++)&&n.next(i)}))})}function Je(r){return R(function(e,t){var n=null,s=!1,i;n=e.subscribe(V(t,void 0,void 0,function(o){i=P(r(o,Je(r)(e))),n?(n.unsubscribe(),n=null,i.subscribe(t)):s=!0})),s&&(n.unsubscribe(),n=null,i.subscribe(t))})}function or(){for(var r=[],e=0;e<arguments.length;e++)r[e]=arguments[e];var t=Ln(r);return t?An(or.apply(void 0,q([],F(r))),ss(t)):R(function(n,s){is(q([n],F(hs(r))))(s)})}function fs(){for(var r=[],e=0;e<arguments.length;e++)r[e]=arguments[e];return or.apply(void 0,q([],F(r)))}function ar(r){return R(function(e,t){try{e.subscribe(t)}finally{t.add(r)}})}function ur(r){r===void 0&&(r={});var e=r.connector,t=e===void 0?function(){return new We}:e,n=r.resetOnError,s=n===void 0?!0:n,i=r.resetOnComplete,o=i===void 0?!0:i,a=r.resetOnRefCountZero,u=a===void 0?!0:a;return function(c){var d,f,y,h=0,p=!1,l=!1,m=function(){f?.unsubscribe(),f=void 0},w=function(){m(),d=y=void 0,p=l=!1},v=function(){var E=d;w(),E?.unsubscribe()};return R(function(E,b){h++,!l&&!p&&m();var _=y=y??t();b.add(function(){h--,h===0&&!l&&!p&&(f=qe(v,u))}),_.subscribe(b),!d&&h>0&&(d=new Q({next:function(x){return _.next(x)},error:function(x){l=!0,m(),f=qe(w,s,x),_.error(x)},complete:function(){p=!0,m(),f=qe(w,o),_.complete()}}),P(E).subscribe(d))})(c)}}function qe(r,e){for(var t=[],n=2;n<arguments.length;n++)t[n-2]=arguments[n];if(e===!0){r();return}if(e!==!1){var s=new Q({next:function(){s.unsubscribe(),r()}});return P(e.apply(void 0,q([],F(t)))).subscribe(s)}}function ps(r,e,t){var n,s=!1;return n=r,ur({connector:function(){return new Rn(n,e,t)},resetOnError:!0,resetOnComplete:!1,resetOnRefCountZero:s})}function ys(r,e,t){var n=C(r)||e||t?{next:r,error:e,complete:t}:r;return n?R(function(s,i){var o;(o=n.subscribe)===null||o===void 0||o.call(n);var a=!0;s.subscribe(V(i,function(u){var c;
6(c=n.next)===null||c===void 0||c.call(n,u),i.next(u)},function(){var u;a=!1,(u=n.complete)===null||u===void 0||u.call(n),i.complete()},function(u){var c;a=!1,(c=n.error)===null||c===void 0||c.call(n,u),i.error(u)},function(){var u,c;a&&((u=n.unsubscribe)===null||u===void 0||u.call(n)),(c=n.finalize)===null||c===void 0||c.call(n)}))}):$e}function cr(r){return typeof r=="object"&&r!==null&&!Array.isArray(r)}var lr={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},te={0:8203,1:8204,2:8205,3:65279},re={0:String.fromCodePoint(te[0]),1:String.fromCodePoint(te[1]),2:String.fromCodePoint(te[2]),3:String.fromCodePoint(te[3])},ms=new Array(4).fill(String.fromCodePoint(te[0])).join("");function gs(r){let e=JSON.stringify(r),t=new TextEncoder().encode(e),n="";for(let s=0;s<t.length;s++){let i=t[s];n+=re[i>>6&3]+re[i>>4&3]+re[i>>2&3]+re[i&3]}return ms+n}function vs(r){return!Number.isNaN(Number(r))||/[a-z]/i.test(r)&&!/\d+(?:[-:\/]\d+){2}(?:T\d+(?:[-:\/]\d+){1,2}(\.\d+)?Z?)?/.test(r)?!1:!!Date.parse(r)}function bs(r){try{new URL(r,r.startsWith("/")?"https://acme.com":void 0)}catch{return!1}return!0}function co(r,e,t="auto"){return t===!0||t==="auto"&&(vs(r)||bs(r))?r:`${r}${gs(e)}`}Object.fromEntries(Object.entries(re).map(r=>[r[1],+r[0]]));Object.fromEntries(Object.entries(lr).map(r=>r.reverse()));var ws=`${Object.values(lr).map(r=>`\\u{${r.toString(16)}}`).join("")}`,It=new RegExp(`[${ws}]{4,}`,"gu");function Es(r){var e;return{cleaned:r.replace(It,""),encoded:((e=r.match(It))==null?void 0:e[0])||""}}function Cs(r){return r&&JSON.parse(Es(JSON.stringify(r)).cleaned)}function Is(r){return Cs(r)}const $s="drafts",As="versions",J=".",ve=`${$s}${J}`,dr=`${As}${J}`;function Ae(r){return r.startsWith(ve)}function Se(r){return r.startsWith(dr)}function hr(r){if(Se(r)){const e=_e(r);return ve+e}return Ae(r)?r:ve+r}function ue(r,e){if(e==="drafts"||e==="published")throw new Error('Version can not be "published" or "drafts"');return`${dr}${e}${J}${_e(r)}`}function fr(r){if(!Se(r))return;const[e,t]=r.split(J);return t}function _e(r){return Se(r)?r.split(J).slice(2).join(J):Ae(r)?r.slice(ve.length):r}let Ss=r=>crypto.getRandomValues(new Uint8Array(r)),_s=(r,e,t)=>{let n=(2<<Math.log(r.length-1)/Math.LN2)-1,s=-~(1.6*n*e/r.length);return(i=e)=>{let o="";for(;;){let a=t(s),u=s|0;for(;u--;)if(o+=r[a[u]&n]||"",o.length===i)return o}}},xs=(r,e=21)=>_s(r,e,Ss);const $t=/\r\n|[\n\r\u2028\u2029]/;function Ts(r,e,t){const n=r.split($t),s={start:At(e.start,n),end:e.end?At(e.end,n):void 0},{start:i,end:o,markerLines:a}=Os(s,n),u=`${o}`.length;return r.split($t,o).slice(i,o).map((c,d)=>{const f=i+1+d,y=` ${` ${f}`.slice(-u)} |`,h=a[f],p=!a[f+1];if(!h)return` ${y}${c.length>0?` ${c}`:""}`;let l="";if(Array.isArray(h)){const m=c.slice(0,Math.max(h[0]-1,0)).replace(/[^\t]/g," "),w=h[1]||1;l=[` 7 `,y.replace(/\d/g," ")," ",m,"^".repeat(w)].join(""),p&&t&&(l+=" "+t)}return[">",y,c.length>0?` ${c}`:"",l].join("")}).join(` 8`)}function Os(r,e){const t={...r.start},n={...t,...r.end},s=2,i=3,o=t.line??-1,a=t.column??0,u=n.line,c=n.column;let d=Math.max(o-(s+1),0),f=Math.min(e.length,u+i);o===-1&&(d=0),u===-1&&(f=e.length);const y=u-o,h={};if(y)for(let p=0;p<=y;p++){const l=p+o;if(!a)h[l]=!0;else if(p===0){const m=e[l-1].length;h[l]=[a,m-a+1]}else if(p===y)h[l]=[0,c];else{const m=e[l-p].length;h[l]=[0,m]}}else a===c?a?h[o]=[a,0]:h[o]=!0:h[o]=[a,c-a];return{start:d,end:f,markerLines:h}}function At(r,e){let t=0;for(let n=0;n<e.length;n++){const s=e[n].length+1;if(t+s>r)return{line:n+1,column:r-t};t+=s}return{line:e.length,column:e[e.length-1]?.length??0}}const Fe=5;class pr extends Error{response;statusCode=400;responseBody;traceId;details;constructor(e,t){const n=mr(e,t);super(n.message),Object.assign(this,n)}}class yr extends Error{response;statusCode=500;responseBody;traceId;details;constructor(e){const t=mr(e);super(t.message),Object.assign(this,t)}}function mr(r,e){const t=r.body,n={response:r,statusCode:r.statusCode,responseBody:qs(t,r),traceId:js(r),message:"",details:void 0};if(!cr(t))return n.message=`${De(r,t)}${k(n.traceId)}`,n;const s=t.error;if(typeof s=="string"&&typeof t.message=="string")return n.message=`${s} - ${t.message}${k(n.traceId)}`,n;if(typeof s!="object"||s===null)return typeof s=="string"?n.message=`${s}${k(n.traceId)}`:typeof t.message=="string"?n.message=`${t.message}${k(n.traceId)}`:n.message=`${De(r,t)}${k(n.traceId)}`,n;if(Rs(s)||Ps(s)){const i=s.items||[],o=i.slice(0,Fe).map(u=>
8u.error?.description).filter(Boolean);let a=o.length?`: 9- ${o.join(` 10- `)}`:"";return i.length>Fe&&(a+=` 11...and ${i.length-Fe} more`),n.message=`${s.description}${k(n.traceId)}${a}`,n.details=t.error,n}if(Ye(s)){const i=e?.options?.query?.tag;return n.message=Xe(s,i,n.traceId),n.details=t.error,n}return"description"in s&&typeof s.description=="string"?(n.message=`${s.description}${k(n.traceId)}`,n.details=s,n):(n.message=`${De(r,t)}${k(n.traceId)}`,n)}function Rs(r){return"type"in r&&r.type==="mutationError"&&"description"in r&&typeof r.description=="string"}function Ps(r){return"type"in r&&r.type==="actionError"&&"description"in r&&typeof r.description=="string"}function Ye(r){return cr(r)&&r.type==="queryParseError"&&typeof r.query=="string"&&typeof r.start=="number"&&typeof r.end=="number"}function Xe(r,e,t){const{query:n,start:s,end:i,description:o}=r,a=t?` 12(traceId: ${t})`:"";if(!n||typeof s>"u")return`GROQ query parse error: ${o}${a}`;const u=e?` 13 14Tag: ${e}`:"";return`GROQ query parse error: 15${Ts(n,{start:s,end:i},o)}${u}${a}`}function De(r,e){const t=typeof e=="string"?` (${Fs(e,100)})`:"",n=r.statusMessage?` ${r.statusMessage}`:"";return`${r.method}-request to ${r.url} resulted in HTTP ${r.statusCode}${n}${t}`}function js(r){const e=r?.headers?.traceparent;if(e)return e.split("-")[1]}function qs(r,e){return(e.headers["content-type"]||"").toLowerCase().indexOf("application/json")!==-1?JSON.stringify(r,null,2):r}function k(r){return r?` (traceId: ${r})`:""}function Fs(r,e){return r.length>e?`${r.slice(0,e)}â¦`:r}class be extends Error{projectId;addOriginUrl;constructor({projectId:e,credentials:t}={}){if(super("CorsOriginError"),this.name="CorsOriginError",this.projectId=e,e&&typeof location<"u"){const n=new URL(`https://sanity.io/manage/project/${e}/api`),{origin:s}=location;n.searchParams.set("cors","add"),n.searchParams.set("origin",s),t&&n.searchParams.set("credentials",""),this.addOriginUrl=n,this.message=`The current origin is not allowed to connect to the Live Content API. Add it here: ${n}`}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."}}const Ds={onResponse:(r,e)=>{if(r.statusCode>=500)throw new yr(r);if(r.statusCode>=400)throw new pr(r,e);return r}};function Ms(r={}){const e={},t=n=>r.ignoreWarnings===void 0?!1:(Array.isArray(r.ignoreWarnings)?r.ignoreWarnings:[r.ignoreWarnings]).some(s=>typeof s=="string"?n.includes(s):s instanceof RegExp?s.test(n):!1);return{onResponse:n=>{const s=n.headers["x-sanity-warning"],i=Array.isArray(s)?s:[s];for(const o of i)!o||e[o]||t(o)||(e[o]=!0,console.warn(o));return n}}}function St(r,e={}){return cn([Ve({shouldRetry:ks}),...r,Ms(e),pn(),yn(),vn(),Ds,gn({implementation:$})])}function ks(r,e,t){if(t.maxRetries===0)return!1;const n=t.method==="GET"||t.method==="HEAD",s=(t.uri||t.url).startsWith("/data/query"),i=r.response&&(r.response.statusCode===429||r.response.statusCode===502||r.response.statusCode===503);return(n||s)&&i?!0:Ve.shouldRetry(r,e,t)}const Ls="https://www.sanity.io/help/";function Ze(r){return Ls+r}const _t=["image","file"],xt=["before","after","replace"],Y=r=>{if(!/^(~[a-z0-9]{1}[-\w]{0,63}|[a-z0-9]{1}[-\w]{0,63})$/.test(r))throw new Error("Datasets can only contain lowercase characters, numbers, underscores and dashes, and start with tilde, and be maximum 64 characters")},Vs=r=>{if(!/^[-a-z0-9]+$/i.test(r))throw new Error("`projectId` can only contain only a-z, 0-9 and dashes")},Us=r=>{if(_t.indexOf(r)===-1)throw new Error(`Invalid asset type: ${r}. Must be one of ${_t.join(", ")}`)},ne=(r,e)=>{if(e===null||typeof e!="object"||Array.isArray(e))throw new Error(`${r}() takes an object of properties`)},we=(r,e)=>{if(typeof e!="string"||!/^[a-z0-9_][a-z0-9_.-]{0,127}$/i.test(e)||e.includes(".."))throw new Error(`${r}(): "${e}" is not a valid document ID`)},X=(r,e)=>{if(!e._id)throw new Error(`${r}() requires that the document contains an ID ("_id" property)`);we(r,e._id)},Ns=(r,e)=>{if(typeof e!="string")throw new Error(`\`${r}()\`: \`${e}\` is not a valid document type`)},gr=(r,e)=>{if(!e._type)throw new Error(`\`${r}()\` requires that the document contains a type (\`_type\` property)`);Ns(r,e._type)},Hs=(r,e)=>{if(e._id&&e._id!==r)throw new Error(`The provided document ID (\`${e._id}
15\`) does not match the generated version ID (\`${r}\`)`)},Ws=(r,e,t)=>{const n="insert(at, selector, items)";if(xt.indexOf(r)===-1){const s=xt.map(i=>`"${i}"`).join(", ");throw new Error(`${n} takes an "at"-argument which is one of: ${s}`)}if(typeof e!="string")throw new Error(`${n} takes a "selector"-argument which must be a string`);if(!Array.isArray(t))throw new Error(`${n} takes an "items"-argument which must be an array`)},W=r=>{if(r.dataset)return r.dataset;const e=r.resource;if(e&&e.type==="dataset"){const t=e.id.split(".");if(t.length!==2)throw new Error('Dataset resource ID must be in the format "project.dataset"');return t[1]}throw new Error("`dataset` must be provided to perform queries")},vr=r=>{if(typeof r!="string"||!/^[a-z0-9._-]{1,75}$/i.test(r))throw new Error("Tag can only contain alphanumeric characters, underscores, dashes and dots, and be between one and 75 characters long.");return r},br=r=>{const e=r.resource;if(!e)throw new Error("`resource` must be provided to perform resource queries");const{type:t,id:n}=e;switch(t){case"dataset":{if(n.split(".").length!==2)throw new Error('Dataset resource ID must be in the format "project.dataset"');return}case"dashboard":case"media-library":case"canvas":return;default:throw new Error(`Unsupported resource type: ${t.toString()}`)}},O=(r,e)=>{if(e.resource)throw new Error(`\`${r}\` does not support resource-based operations`)};function zs(r){let e=!1,t;return(...n)=>(e||(t=r(...n),e=!0),t)}const M=r=>zs((...e)=>console.warn(r.join(" "),...e)),Bs=M(["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"]),Gs=M(["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."]),Qs=M(["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."]),Js=M(["The `previewDrafts` perspective has been renamed to `drafts` and will be removed in a future API version"]),Ys=M(["You have configured Sanity client to use a token in the browser. This may cause unintentional security issues.",`See ${Ze("js-client-browser-token")} for more information and how to hide this warning.`]),Xs=M(["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`."]),Zs=M(["Using the Sanity client without specifying an API version is deprecated.",`See ${Ze("js-client-api-version")}`]),Ks=M(["You have called `createVersion()` with a defined `document`. The recommended approach is to provide a `baseId` and `releaseId` instead."]),ei=M(["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."]),ti="apicdn.sanity.io",se={apiHost:"https://api.sanity.io",apiVersion:"1",useProjectHostname:!0,stega:{enabled:!1}},ri=["localhost","127.0.0.1","0.0.0.0"],ni=r=>ri.indexOf(r)!==-1;function si(r){if(r==="1"||r==="X")return;const e=new Date(r);if(!(/^\d{4}-\d{2}-\d{2}$/.test(r)&&e instanceof Date&&e.getTime()>0))throw new Error("Invalid API version string, expected `1` or date in format `YYYY-MM-DD`")}function Ke(r){if(Array.isArray(r)&&r.length>1&&r.includes("raw"))throw new TypeError('Invalid API perspective value: "raw". The raw-perspective can not be combined with other perspectives')}const wr=(r,e)=>{const t={...e,...r,stega:{...typeof e.stega=="boolean"?{enabled:e.stega}:e.stega||se.stega,...typeof r.stega=="boolean"?{enabled:r.stega}:r.stega||{}}};t.apiVersion||Zs();const n={...se,...t};n["~experimental_resource"]&&!n.resource&&(ei(),n.resource=n["~experimental_resource"]);const s=n.resource,i=n.useProjectHostname&&!s;if(typeof Promise>"u"){const h=Ze("js-client-promise-polyfill");throw new Error(`No native Promise-implementation found, polyfill needed - see ${h}`)}if(i&&!n.projectId)throw new Error("Configuration must contain `projectId`");if(s&&br(n),typeof n.perspective<"u"&&Ke(n.perspective),"encodeSourceMap"in n)throw new Error("It looks like you're using options meant for '@sanity/preview-kit/client'. 'encodeSourceMap' is not supported in '@sanity/client'. Did you mean 'stega.enabled'?");if("encodeSourceMapAtPath"in n)throw new 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'?");
15if(typeof n.stega.enabled!="boolean")throw new Error(`stega.enabled must be a boolean, received ${n.stega.enabled}`);if(n.stega.enabled&&n.stega.studioUrl===void 0)throw new Error("stega.studioUrl must be defined when stega.enabled is true");if(n.stega.enabled&&typeof n.stega.studioUrl!="string"&&typeof n.stega.studioUrl!="function")throw new Error(`stega.studioUrl must be a string or a function, received ${n.stega.studioUrl}`);const o=typeof window<"u"&&window.location&&window.location.hostname,a=o&&ni(window.location.hostname),u=!!n.token;n.withCredentials&&u&&(Xs(),n.withCredentials=!1),o&&a&&u&&n.ignoreBrowserTokenWarning!==!0?Ys():typeof n.useCdn>"u"&&Gs(),i&&Vs(n.projectId),n.dataset&&Y(n.dataset),"requestTagPrefix"in n&&(n.requestTagPrefix=n.requestTagPrefix?vr(n.requestTagPrefix).replace(/\.+$/,""):void 0),n.apiVersion=`${n.apiVersion}`.replace(/^v/,""),n.isDefaultApi=n.apiHost===se.apiHost,n.useCdn===!0&&n.withCredentials&&Bs(),n.useCdn=n.useCdn!==!1&&!n.withCredentials,si(n.apiVersion);const c=n.apiHost.split("://",2),d=c[0],f=c[1],y=n.isDefaultApi?ti:f;return i?(n.url=`${d}://${n.projectId}.${f}/v${n.apiVersion}`,n.cdnUrl=`${d}://${n.projectId}.${y}/v${n.apiVersion}`):(n.url=`${n.apiHost}/v${n.apiVersion}`,n.cdnUrl=n.url),n};class et extends Error{name="ConnectionFailedError"}class Er extends Error{name="DisconnectError";reason;constructor(e,t,n={}){super(e,n),this.reason=t}}class Cr extends Error{name="ChannelError";data;constructor(e,t){super(e),this.data=t}}class Ir extends Error{name="MessageError";data;constructor(e,t,n={}){super(e,n),this.data=t}}class Le extends Error{name="MessageParseError"}const ii=["channelError","disconnect"];function tt(r,e){return ir(()=>{const t=r();return es(t)?t:B(t)}).pipe(N(t=>oi(t,e)))}function oi(r,e){return new $(t=>{const n=e.includes("open"),s=e.includes("reconnect");function i(c){if("data"in c){const[d,f]=Tt(c);t.error(d?new Le("Unable to parse EventSource error message",{cause:f}):new Ir((f?.data).message,f));return}r.readyState===r.CLOSED?t.error(new et("EventSource connection failed")):s&&t.next({type:"reconnect"})}function o(){t.next({type:"open"})}function a(c){const[d,f]=Tt(c);if(d){t.error(new Le("Unable to parse EventSource message",{cause:d}));return}if(c.type==="channelError"){const y=new URL(r.url).searchParams.get("tag");t.error(new Cr(ai(f?.data,y),f.data));return}if(c.type==="disconnect"){t.error(new Er(`Server disconnected client: ${f.data?.reason||"unknown error"}`));return}t.next({type:c.type,id:c.lastEventId,...f.data?{data:f.data}:{}})}r.addEventListener("error",i),n&&r.addEventListener("open",o);const u=[...new Set([...ii,...e])].filter(c=>c!=="error"&&c!=="open"&&c!=="reconnect");return u.forEach(c=>r.addEventListener(c,a)),()=>{r.removeEventListener("error",i),n&&r.removeEventListener("open",o),u.forEach(c=>r.removeEventListener(c,a)),r.close()}})}function Tt(r){try{const e=typeof r.data=="string"&&JSON.parse(r.data);return[null,{type:r.type,id:r.lastEventId,...ui(e)?{}:{data:e}}]}catch(e){return[e,null]}}function ai(r,e){const t=r.error;return t?Ye(t)?Xe(t,e):t.description?t.description:typeof t=="string"?t:JSON.stringify(t,null,2):r.message||"Unknown listener error"}function ui(r){for(const e in r)return!1;return!0}function $r(r){if(typeof r=="string")return{id:r};if(Array.isArray(r))return{query:"*[_id in $ids]",params:{ids:r}};if(typeof r=="object"&&r!==null&&"query"in r&&typeof r.query=="string")return"params"in r&&typeof r.params=="object"&&r.params!==null?{query:r.query,params:r.params}:{query:r.query};const e=["* Document ID (<docId>)","* Array of document IDs","* Object containing `query`"].join(` 16`);throw new Error(`Unknown selection - must be one of: 17 18${e}`)}class rt{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 ne("diffMatchPatch",e),this._assign("diffMatchPatch",e)}unset(e){if(!Array.isArray(e))throw new 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,n){return Ws(e,t,n),this._assign("insert",{[e]:t,items:n})}append(e,t){return this.insert("after",`${e}[-1]`,t)}prepend(e,t){return this.insert("before",`${e}[0]`,t)}splice(e,t,n,s){const i=typeof n>"u"||n===-1,o=t<0?t-1:t,a=i?-1:Math.max(0,t+n),u=o<0&&a>=0?"":a,c=`${e}[${o}:${u}]`;return this.insert("replace",c,s||[])}ifRevisionId(e){return this.operations.ifRevisionID=e,this}serialize(){return{...$r(this.selection),...this.operations}}toJSON(){return this.serialize()}reset(){return this.operations={},this}_assign(e,t,n=!0){return ne(e,t),this.operations=Object.assign({},this.operations,{[e]:Object.assign({},n&&this.operations[e]||{},t)}),this}_set(e,t){return this._assign(e,t,!1)}}class L extends rt{#e;constructor(e,t,n){super(e,t),this.#e=n}clone(){return new L(this.selection,{...this.operations},this.#e)}commit(e){if(!this.#e)throw new Error("No `client` passed to patch, either provide one or pass the patch to a clients `mutate()` method");
18const t=typeof this.selection=="string",n=Object.assign({returnFirst:t,returnDocuments:!0},e);return this.#e.mutate({patch:this.serialize()},n)}}class j extends rt{#e;constructor(e,t,n){super(e,t),this.#e=n}clone(){return new j(this.selection,{...this.operations},this.#e)}commit(e){if(!this.#e)throw new Error("No `client` passed to patch, either provide one or pass the patch to a clients `mutate()` method");const t=typeof this.selection=="string",n=Object.assign({returnFirst:t,returnDocuments:!0},e);return this.#e.mutate({patch:this.serialize()},n)}}const Ar={returnDocuments:!1};class nt{operations;trxId;constructor(e=[],t){this.operations=e,this.trxId=t}create(e){return ne("create",e),this._add({create:e})}createIfNotExists(e){const t="createIfNotExists";return ne(t,e),X(t,e),this._add({[t]:e})}createOrReplace(e){const t="createOrReplace";return ne(t,e),X(t,e),this._add({[t]:e})}delete(e){return we("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 ce extends nt{#e;constructor(e,t,n){super(e,n),this.#e=t}clone(){return new ce([...this.operations],this.#e,this.trxId)}commit(e){if(!this.#e)throw new Error("No `client` passed to transaction, either provide one or pass the transaction to a clients `mutate()` method");return this.#e.mutate(this.serialize(),Object.assign({transactionId:this.trxId},Ar,e||{}))}patch(e,t){const n=typeof t=="function",s=typeof e!="string"&&e instanceof j,i=typeof e=="object"&&("query"in e||"id"in e);if(s)return this._add({patch:e.serialize()});if(n){const o=t(new j(e,{},this.#e));if(!(o instanceof j))throw new Error("function passed to `patch()` must return the patch");return this._add({patch:o.serialize()})}if(i){const o=new j(e,t||{},this.#e);return this._add({patch:o.serialize()})}return this._add({patch:{id:e,...t}})}}class le extends nt{#e;constructor(e,t,n){super(e,n),this.#e=t}clone(){return new le([...this.operations],this.#e,this.trxId)}commit(e){if(!this.#e)throw new Error("No `client` passed to transaction, either provide one or pass the transaction to a clients `mutate()` method");return this.#e.mutate(this.serialize(),Object.assign({transactionId:this.trxId},Ar,e||{}))}patch(e,t){const n=typeof t=="function";if(typeof e!="string"&&e instanceof L)return this._add({patch:e.serialize()});if(n){const s=t(new L(e,{},this.#e));if(!(s instanceof L))throw new Error("function passed to `patch()` must return the patch");return this._add({patch:s.serialize()})}return this._add({patch:{id:e,...t}})}}const ci="X-Sanity-Project-ID";function li(r,e={}){const t={};r.headers&&Object.assign(t,r.headers);const n=e.token||r.token;n&&(t.Authorization=`Bearer ${n}`),!e.useGlobalApi&&!r.useProjectHostname&&r.projectId&&(t[ci]=r.projectId);const s=!!(typeof e.withCredentials>"u"?r.withCredentials:e.withCredentials),i=typeof e.timeout>"u"?r.timeout:e.timeout;return Object.assign({},e,{headers:Object.assign({},t,e.headers||{}),timeout:typeof i>"u"?300*1e3:i,proxy:e.proxy||r.proxy,json:!0,withCredentials:s,fetch:typeof e.fetch=="object"&&typeof r.fetch=="object"?{...r.fetch,...e.fetch}:e.fetch||r.fetch})}const Sr=({query:r,params:e={},options:t={}})=>{const n=new URLSearchParams,{tag:s,includeMutations:i,returnQuery:o,...a}=t;s&&n.append("tag",s),n.append("query",r);for(const[u,c]of Object.entries(e))c!==void 0&&n.append(`$${u}`,JSON.stringify(c));for(const[u,c]of Object.entries(a))c&&n.append(u,`${c}`);return o===!1&&n.append("returnQuery","false"),i===!1&&n.append("includeMutations","false"),`?${n}`},di=(r,e)=>r===!1?void 0:typeof r>"u"?e:r,hi=(r={})=>({dryRun:r.dryRun,returnIds:!0,returnDocuments:di(r.returnDocuments,!0),visibility:r.visibility||"sync",autoGenerateArrayKeys:r.autoGenerateArrayKeys,skipCrossDatasetReferenceValidation:r.skipCrossDatasetReferenceValidation}),st=r=>r.type==="response",fi=r=>r.body,pi=(r,e)=>r.reduce((t,n)=>(t[e(n)]=n,t),Object.create(null)),yi=11264;function _r(r,e,t,n,s={},i={}){const o="stega"in i?{...t||{},...typeof i.stega=="boolean"?{enabled:i.stega}:i.stega||{}}:t,a=o.enabled?Is(s):s,u=i.filterResponse===!1?p=>p:p=>p.result,{cache:c,next:d,...f}={useAbortSignal:typeof i.signal<"u",resultSourceMap:o.enabled?"withKeyArraySelector":i.resultSourceMap,...i,returnQuery:i.filterResponse===!1&&i.returnQuery!==!1}
18,y=typeof c<"u"||typeof d<"u"?{...f,fetch:{cache:c,next:d}}:f,h=z(r,e,"query",{query:n,params:a},y);return o.enabled?h.pipe(fs(ae(Pt(()=>import("./stegaEncodeSourceMap-CXnTKdKS.js"),__vite__mapDeps([0,1,2])).then(function(p){return p.stegaEncodeSourceMap$1}).then(({stegaEncodeSourceMap:p})=>p))),S(([p,l])=>{const m=l(p.result,p.resultSourceMap,o);return u({...p,result:m})})):h.pipe(S(u))}function Z(r,e,t,n={}){const s=(()=>{if(!n.releaseId)return t;const o=fr(t);if(!o){if(Ae(t))throw new Error(`The document ID (\`${t}\`) is a draft, but \`options.releaseId\` is set as \`${n.releaseId}\``);return ue(t,n.releaseId)}if(o!==n.releaseId)throw new Error(`The document ID (\`${t}\`) is already a version of \`${o}\` release, but this does not match the provided \`options.releaseId\` (\`${n.releaseId}\`)`);return t})(),i={uri:T(r,"doc",s),json:!0,tag:n.tag,signal:n.signal,query:n.includeAllVersions!==void 0?{includeAllVersions:n.includeAllVersions}:void 0};return he(r,e,i).pipe(K(st),S(o=>{const a=o.body.documents;return a?n.includeAllVersions?a:a[0]:n.includeAllVersions?[]:void 0}))}function xr(r,e,t,n={}){const s={uri:T(r,"doc",t.join(",")),json:!0,tag:n.tag,signal:n.signal};return he(r,e,s).pipe(K(st),S(i=>{const o=pi(i.body.documents||[],a=>a._id);return t.map(a=>o[a]||null)}))}function Tr(r,e,t,n={}){return z(r,e,"query",{query:"*[sanity::partOfRelease($releaseId)]",params:{releaseId:t}},n)}function Or(r,e,t,n){return X("createIfNotExists",t),xe(r,e,t,"createIfNotExists",n)}function Rr(r,e,t,n){return X("createOrReplace",t),xe(r,e,t,"createOrReplace",n)}function Pr(r,e,t,n,s){return X("createVersion",t),gr("createVersion",t),Ks(),I(r,e,{actionType:"sanity.action.document.version.create",publishedId:n,document:t},s)}function jr(r,e,t,n,s,i,o){if(!n)throw new Error("`createVersion()` requires `baseId` when no `document` is provided");if(!t)throw new Error("`createVersion()` requires `publishedId` when `baseId` is provided");we("createVersion",n),we("createVersion",t);const a={actionType:"sanity.action.document.version.create",publishedId:t,baseId:n,versionId:s?ue(t,s):hr(t),ifBaseRevisionId:i};return I(r,e,a,o)}function qr(r,e,t,n){return z(r,e,"mutate",{mutations:[{delete:$r(t)}]},n)}function Fr(r,e,t,n=!1,s){return I(r,e,{actionType:"sanity.action.document.version.discard",versionId:t,purge:n},s)}function Dr(r,e,t,n){return X("replaceVersion",t),gr("replaceVersion",t),I(r,e,{actionType:"sanity.action.document.version.replace",document:t},n)}function Mr(r,e,t,n,s){return I(r,e,{actionType:"sanity.action.document.version.unpublish",versionId:t,publishedId:n},s)}function kr(r,e,t,n){let s;t instanceof j||t instanceof L?s={patch:t.serialize()}:t instanceof ce||t instanceof le?s=t.serialize():s=t;const i=Array.isArray(s)?s:[s],o=n&&n.transactionId||void 0;return z(r,e,"mutate",{mutations:i,transactionId:o},n)}function I(r,e,t,n){const s=Array.isArray(t)?t:[t],i=n&&n.transactionId||void 0,o=n&&n.skipCrossDatasetReferenceValidation||void 0,a=n&&n.dryRun||void 0;return z(r,e,"actions",{actions:s,transactionId:i,skipCrossDatasetReferenceValidation:o,dryRun:a},n)}function z(r,e,t,n,s={}){const i=t==="mutate",o=t==="actions",a=t==="query",u=i||o?"":Sr(n),c=!i&&!o&&u.length<yi,d=c?u:"",f=s.returnFirst,{timeout:y,token:h,tag:p,headers:l,returnQuery:m,lastLiveEventId:w,cacheMode:v}=s,E=T(r,t,d),b={method:c?"GET":"POST",uri:E,json:!0,body:c?void 0:n,query:i&&hi(s),timeout:y,headers:l,token:h,tag:p,returnQuery:m,perspective:s.perspective,resultSourceMap:s.resultSourceMap,lastLiveEventId:Array.isArray(w)?w[0]:w,cacheMode:v,canUseCdn:a,signal:s.signal,fetch:s.fetch,useAbortSignal:s.useAbortSignal,useCdn:s.useCdn};return he(r,e,b).pipe(K(st),S(fi),S(_=>{if(!i)return _;const x=_.results||[];if(s.returnDocuments)return f?x[0]&&x[0].document:x.map(Te=>Te.document);const Yr=f?"documentId":"documentIds",Xr=f?x[0]&&x[0].id:x.map(Te=>Te.id);return{transactionId:_.transactionId,results:x,[Yr]:Xr}}))}function xe(r,e,t,n,s={}){const i={[n]:t},o=Object.assign({returnFirst:!0,returnDocuments:!0},s);return z(r,e,"mutate",{mutations:[i]},o)}const de=r=>{const e=r.config();return e.dataset!==void 0&&e.projectId!==void 0||e.resource!==void 0},Lr=(r,e)=>de(r)&&e.startsWith(T(r,"query")),mi=(r,e)=>de(r)&&e.startsWith(T(r,"mutate")),gi=(r,e)=>de(r)&&e.startsWith(T(r,"doc","")),vi=(r,e)=>de(r)&&e.startsWith(T(r,"listen")),bi=(r,e)=>de(r)&&e.startsWith(T(r,"history","")),wi=(r,e)=>e.startsWith("/data/")||Lr(r,e)||mi(r,e)||gi(r,e)||vi(r,e)||bi(r,e);function he(r,e,t){const n=t.url||t.uri,s=r.config(),i=typeof t.canUseCdn>"u"?["GET","HEAD"].indexOf(t.method||"GET")>=0&&wi(r,n):t.canUseCdn;let o=(t.useCdn??s.useCdn)&&i;const a=t.tag&&s.requestTagPrefix?[s.requestTagPrefix,t.tag].join("."):t.tag||s.requestTagPrefix;if(a&&t.tag!==null&&(t.query={tag:vr(a),...t.query}),["GET","HEAD","POST"].indexOf(t.method||"GET")>=0&&Lr(r,n)){const d=t.resultSourceMap??s.resultSourceMap;d!==void 0&&d!==!1&&(t.query={resultSourceMap:d,...t.query});const f=t.perspective||s.perspective;typeof f<"u"&&(f==="previewDrafts"&&Js(),Ke(f),t.query={perspective:Array.isArray(f)?f.join(","):f,...t.query},(Array.isArray(f)&&f.length>0||f==="previewDrafts"||f==="drafts")&&o&&(o=!1,Qs())),t.lastLiveEventId&&(t.query={...t.query,lastLiveEventId:t.lastLiveEventId}),t.returnQuery===!1&&(t.query={returnQuery:"false",...t.query}),o&&t.cacheMode=="noStale"&&(t.query={cacheMode:"noStale",...t.query})}const u=li(s,Object.assign({},t,{url:it(r,n,o)})),c=new $(d=>e(u,s.requester).subscribe(d));return t.signal?c.pipe(Ei(t.signal)):c}function A(r,e,t){return he(r,e,t).pipe(K(n=>n.type==="response"),S(n=>n.body))}function T(r,e,t){const n=r.config();if(n.resource){br(n);const o=$i(n),a=t!==void 0?`${e}/${t}`:e;return`${o}/${a}`.replace(/\/($|\?)/,"$1")}const s=W(n),i=`/${e}/${s}`;return`/data${t!==void 0?`${i}/${t}`:i}`.replace(/\/($|\?)/,"$1")}function it(r,e,t=!1){const{url:n,cdnUrl:s}=r.config();return`${t?s:n}/${e.replace(/^\//,"")}`}function Ei(r){return e=>new $(t=>{const n=()=>t.error(Ii(r));if(r&&r.aborted){n();return}const s=e.subscribe(t);return r.addEventListener("abort",n),()=>{r.removeEventListener("abort",n),s.unsubscribe()}})}const Ci=!!globalThis.DOMException;function Ii(r){if(Ci)return new DOMException(r?.reason??"The operation was aborted.","AbortError");const e=new Error(r?.reason??"The operation was aborted.");return e.name="AbortError",e}const $i=r=>{const e=r.resource;if(!e)throw new Error("`resource` must be provided to perform resource queries");const{type:t,id:n}=e;switch(t){case"dataset":{const s=n.split(".");if(s.length!==2)throw new Error('Dataset ID must be in the format "project.dataset"');return`/projects/${s[0]}/datasets/${s[1]}`}case"canvas":return`/canvases/${n}`;case"media-library":return`/media-libraries/${n}`;case"dashboard":return`/dashboards/${n}`;default:throw new Error(`Unsupported resource type: ${t.toString()}`)}};function Vr(r,e,t){const n=W(r.config());return A(r,e,{method:"POST",uri:`/agent/action/generate/${n}`,body:t})}function Ai(r,e,t){const n=W(r.config());return A(r,e,{method:"POST",uri:`/agent/action/patch/${n}`,body:t})}function Si(r,e,t){const n=W(r.config());return A(r,e,{method:"POST",uri:`/agent/action/prompt/${n}`,body:t})}function Ur(r,e,t){const n=W(r.config());return A(r,e,{method:"POST",uri:`/agent/action/transform/${n}`,body:t})}function Nr(r,e,t){const n=W(r.config());return A(r,e,{method:"POST",uri:`/agent/action/translate/${n}`,body:t})}class _i{#e;#t;constructor(e,t){this.#e=e,this.#t=t}generate(e){return Vr(this.#e,this.#t,e)}transform(e){return Ur(this.#e,this.#t,e)}translate(e){return Nr(this.#e,this.#t,e)}}class xi{#e;#t;constructor(e,t){this.#e=e,this.#t=t}generate(e){return g(Vr(this.#e,this.#t,e))}transform(e){return g(Ur(this.#e,this.#t,e))}translate(e){return g(Nr(this.#e,this.#t,e))}prompt(e){return g(Si(this.#e,this.#t,e))}patch(e){return g(Ai(this.#e,this.#t,e))}}class Ti{#e;#t;constructor(e,t){this.#e=e,this.#t=t}upload(e,t,n){return Hr(this.#e,this.#t,e,t,n)}}class Oi{#e;#t;constructor(e,t){this.#e=e,this.#t=t}upload(e,t,n){const s=Hr(this.#e,this.#t,e,t,n);return g(s.pipe(K(i=>i.type==="response"),S(i=>i.body.document)))}}function Hr(r,e,t,n,s={}){Us(t);let i=s.extract||void 0;i&&!i.length&&(i=["none"]);const o=r.config(),a=Pi(s,n),{tag:u,label:c,title:d,description:f,creditLine:y,filename:h,source:p}=a,l=o.resource?.type==="media-library",m=l?{title:d,filename:h}:{label:c,title:d,description:f,filename:h,meta:i,creditLine:y};return p&&!l&&(m.sourceId=p.id,m.sourceName=p.name,m.sourceUrl=p.url),he(r,e,{tag:u,method:"POST",timeout:a.timeout||0,uri:Ri(o,t),headers:a.contentType?{"Content-Type":a.contentType}:{},query:m,body:n})}function Ri(r,e){const t=e==="image"?"images":"files",n=r.resource;if(n){const{type:i,id:o}=n;switch(i){case"dataset":throw new Error("Assets are not supported for dataset resources, yet. Configure the client with `{projectId: <projectId>, dataset: <datasetId>}` instead.");case"canvas":return`/canvases/${o}/assets/${t}`;case"media-library":return`/media-libraries/${o}/upload`;case"dashboard":return`/dashboards/${o}/assets/${t}`;default:throw new Error(`Unsupported resource type: ${i.toString()}`)}}const s=W(r);return`assets/${t}/${s}`}function Pi(r,e){return typeof File>"u"||!(e instanceof File)?r:Object.assign({filename:r.preserveFilename===!1?void 0:e.name,contentType:e.type},r)}var ji=(r,e)=>Object.keys(e).concat(Object.keys(r)).reduce((t,n)=>(t[n]=typeof r[n]>"u"?e[n]:r[n],t),{});const qi=(r,e)=>e.reduce((t,n)=>(typeof r[n]>"u"||(t[n]=r[n]),t),{}),Wr=ir(()=>Pt(()=>import("./browser-Ppdm7yks.js").then(r=>r.b),__vite__mapDeps([3,1]))).pipe(S(({default:r})=>r),ps(1));function zr(){return function(r){return r.pipe(Je((e,t)=>e instanceof et?us(B({type:"reconnect"}),cs(1e3).pipe(N(()=>t))):Qe(()=>e)))}}const Fi=14800,Di=["includePreviousRevision","includeResult","includeMutations","includeAllVersions","visibility","effectFormat","enableResume","tag"],Mi={includeResult:!0};function Br(r,e,t={}){const{url:n,token:s,withCredentials:i,requestTagPrefix:o,headers:a}=this.config(),u=t.tag&&o?[o,t.tag].join("."):t.tag,c={...ji(t,Mi),tag:u},d=qi(c,Di),f=Sr({query:r,params:e,options:{tag:u,...d}}),y=`${n}${T(this,"listen",f)}`;if(y.length>Fi)return Qe(()=>new Error("Query too large for listener"));const h=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)),tt(()=>(typeof EventSource>"u"||p.headers?Wr:B(EventSource)).pipe(S(l=>
18new l(y,p))),h).pipe(zr(),K(l=>h.includes(l.type)),S(l=>({type:l.type,..."data"in l?l.data:{}})))}function ki(r,e){return Li(typeof r=="function"?{predicate:r,...e}:r)}function Li(r){return e=>{let t,n=!1;const{predicate:s,...i}=r,o=e.pipe(ys(u=>{r.predicate(u)&&(n=!0,t=u)}),ar(()=>{n=!1,t=void 0}),ur(i)),a=new $(u=>{n&&u.next(t),u.complete()});return ls(o,a)}}const Ot="2021-03-25";class Gr{#e;constructor(e){this.#e=e}events({includeDrafts:e=!1,tag:t,waitFor:n}={}){const{projectId:s,apiVersion:i,token:o,withCredentials:a,requestTagPrefix:u,headers:c}=this.#e.config(),d=i.replace(/^v/,"");if(d!=="X"&&d<Ot)throw new Error(`The live events API requires API version ${Ot} or later. The current API version is ${d}. Please update your API version to use this feature.`);if(e&&!o&&!a)throw new 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.");const f=T(this.#e,"live/events"),y=new URL(this.#e.getUrl(f,!1)),h=t&&u?[u,t].join("."):t;h&&y.searchParams.set("tag",h),e&&y.searchParams.set("includeDrafts","true"),n&&y.searchParams.set("waitFor",n);const p={};e&&a&&(p.withCredentials=!0),(e&&o||c)&&(p.headers={},e&&o&&(p.headers.Authorization=`Bearer ${o}`),c&&Object.assign(p.headers,c));const l=`${y.href}::${JSON.stringify(p)}`,m=Me.get(l);if(m)return m;const w=tt(()=>(typeof EventSource>"u"||p.headers?Wr:B(EventSource)).pipe(S(b=>new b(y.href,p))),["message","restart","welcome","reconnect","goaway"]),v=Vi(new URL(this.#e.getUrl("/check/cors",!1)),s,p.withCredentials===!0),E=w.pipe(zr(),N(b=>b.type==="reconnect"?v.pipe(N(()=>B(b))):B(b)),Je(b=>b instanceof be?Qe(()=>b):v.pipe(N(()=>{throw b}))),S(b=>{if(b.type==="message"){const{data:_,...x}=b;return{...x,tags:_.tags}}return b})).pipe(ar(()=>Me.delete(l)),ki({predicate:b=>b.type==="welcome"}));return Me.set(l,E),E}}function Vi(r,e,t){return new $(n=>{const s=new AbortController,{signal:i}=s;return fetch(r,{method:"GET",mode:"cors",credentials:"omit",signal:i}).then(o=>{if(!(i.aborted||!o.ok))return o.json()}).then(o=>{if(!i.aborted){if(t&&o?.result?.withCredentials===!1){n.error(new be({projectId:e,credentials:!0}));return}if(o?.result?.allowed===!1){n.error(new be({projectId:e,credentials:t}));return}n.next(),n.complete()}}).catch(()=>{i.aborted||n.closed||(n.next(),n.complete())}),()=>s.abort()})}const Me=new Map;class Ui{#e;#t;constructor(e,t){this.#e=e,this.#t=t}create(e,t){return G(this.#e,this.#t,"PUT",e,t)}edit(e,t){return G(this.#e,this.#t,"PATCH",e,t)}delete(e){return G(this.#e,this.#t,"DELETE",e)}list(){O("dataset",this.#e.config());const e=this.#e.config(),t=e.projectId;let n="/datasets";return e.useProjectHostname===!1&&(n=`/projects/${t}/datasets`),A(this.#e,this.#t,{uri:n,tag:null})}getEmbeddingsSettings(e){return O("dataset",this.#e.config()),Y(e),A(this.#e,this.#t,{uri:Ee(this.#e,e),tag:null})}editEmbeddingsSettings(e,t){return O("dataset",this.#e.config()),Y(e),A(this.#e,this.#t,{method:"PUT",uri:Ee(this.#e,e),body:t,tag:null})}}class Ni{#e;#t;constructor(e,t){this.#e=e,this.#t=t}create(e,t){return O("dataset",this.#e.config()),g(G(this.#e,this.#t,"PUT",e,t))}edit(e,t){return O("dataset",this.#e.config()),g(G(this.#e,this.#t,"PATCH",e,t))}delete(e){return O("dataset",this.#e.config()),g(G(this.#e,this.#t,"DELETE",e))}list(){O("dataset",this.#e.config());const e=this.#e.config(),t=e.projectId;let n="/datasets";return e.useProjectHostname===!1&&(n=`/projects/${t}/datasets`),g(A(this.#e,this.#t,{uri:n,tag:null}))}getEmbeddingsSettings(e){return O("dataset",this.#e.config()),Y(e),g(A(this.#e,this.#t,{uri:Ee(this.#e,e),tag:null}))}editEmbeddingsSettings(e,t){return O("dataset",this.#e.config()),Y(e),g(A(this.#e,this.#t,{method:"PUT",uri:Ee(this.#e,e),body:t,tag:null}))}}function Ee(r,e){const t=r.config();return t.useProjectHostname===!1?`/projects/${t.projectId}/datasets/${e}/settings/embeddings`:`/datasets/${e}/settings/embeddings`}function G(r,e,t,n,s){return O("dataset",r.config()),Y(n),A(r,e,{method:t,uri:`/datasets/${n}`,body:s,tag:null})}class Qr{#e;#t;constructor(e,t){this.#e=e,this.#t=t}getPlaybackInfo(e,t={}){const n=this.#e.config(),s=(n.resource||n["~experimental_resource"])?.id,{instanceId:i,library
18Id:o}=Bi(e),a=o||s;if(!a)throw new 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");const u=Gi(i,a),c=Qi(t);return A(this.#e,this.#t,{method:"GET",uri:u,query:c})}}class Hi{#e;#t;constructor(e,t){this.#e=e,this.#t=t}getPlaybackInfo(e,t={}){return g(new Qr(this.#e.observable,this.#t).getPlaybackInfo(e,t))}}const Wi=/^media-library:(ml[^:]+):([^:]+)$/;function zi(r){return typeof r=="object"&&"_ref"in r}function Bi(r){const e=zi(r)?r._ref:r,t=Wi.exec(e);if(t){const[,n,s]=t;return{libraryId:n,instanceId:s}}if(typeof r=="string"&&r.startsWith("video-"))return{instanceId:r};throw new Error(`Invalid video asset instance identifier "${e}": must be a valid video instance id or a Global Dataset Reference (GDR) to the video asset in the Media Library`)}function Gi(r,e){return`/media-libraries/${e}/video/${r}/playback-info`}function Qi(r){const e={};if(r.transformations){const{thumbnail:t,animated:n,storyboard:s}=r.transformations;t&&(t.width&&(e.thumbnailWidth=t.width),t.height&&(e.thumbnailHeight=t.height),t.time!==void 0&&(e.thumbnailTime=t.time),t.fit&&(e.thumbnailFit=t.fit),t.format&&(e.thumbnailFormat=t.format)),n&&(n.width&&(e.animatedWidth=n.width),n.height&&(e.animatedHeight=n.height),n.start!==void 0&&(e.animatedStart=n.start),n.end!==void 0&&(e.animatedEnd=n.end),n.fps&&(e.animatedFps=n.fps),n.format&&(e.animatedFormat=n.format)),s&&s.format&&(e.storyboardFormat=s.format)}return r.expiration&&(e.expiration=r.expiration),e}class Ji{#e;#t;constructor(e,t){this.#e=e,this.#t=t}list(e){const t={},n="/projects";return e?.includeMembers===!1&&(t.includeMembers="false"),e?.includeFeatures===!1&&(t.includeFeatures="false"),e?.organizationId&&(t.organizationId=e.organizationId),e?.onlyExplicitMembership&&(t.onlyExplicitMembership="true"),A(this.#e,this.#t,{uri:n,query:t})}getById(e){return A(this.#e,this.#t,{uri:`/projects/${e}`})}}class Yi{#e;#t;constructor(e,t){this.#e=e,this.#t=t}list(e){const t={},n="/projects";return e?.includeMembers===!1&&(t.includeMembers="false"),e?.includeFeatures===!1&&(t.includeFeatures="false"),e?.organizationId&&(t.organizationId=e.organizationId),e?.onlyExplicitMembership&&(t.onlyExplicitMembership="true"),g(A(this.#e,this.#t,{uri:n,query:t}))}getById(e){return g(A(this.#e,this.#t,{uri:`/projects/${e}`}))}}const Rt=xs("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789",8),Ce=(r,e)=>e?ue(r,e):hr(r);function Ie(r,{releaseId:e,publishedId:t,document:n}){if(t&&n._id){const s=Ce(t,e);return Hs(s,n),s}if(n._id){const s=Ae(n._id),i=Se(n._id);if(!s&&!i)throw new Error(`\`${r}()\` requires a document with an \`_id\` that is a version or draft ID`);if(e){if(s)throw new Error(`\`${r}()\` was called with a document ID (\`${n._id}\`) that is a draft ID, but a release ID (\`${e}\`) was also provided.`);const o=fr(n._id);if(o!==e)throw new Error(`\`${r}()\` was called with a document ID (\`${n._id}\`) that is a version ID, but the release ID (\`${e}\`) does not match the document's version ID (\`${o}\`).`)}return n._id}if(t)return Ce(t,e);throw new Error(`\`${r}()\` requires either a publishedId or a document with an \`_id\``)}const Xi=(r,e)=>{if(typeof r=="object"&&r!==null&&("releaseId"in r||"metadata"in r)){const{releaseId:t=Rt(),metadata:n={}}=r;return[t,n,e]}return[Rt(),{},r]},Jr=(r,e)=>{const[t,n,s]=Xi(r,e),i={...n,releaseType:n.releaseType||"undecided"};return{action:{actionType:"sanity.action.release.create",releaseId:t,metadata:i},options:s}};class Zi{#e;#t;constructor(e,t){this.#e=e,this.#t=t}get({releaseId:e},t){return Z(this.#e,this.#t,`_.releases.${e}`,t)}create(e,t){const{action:n,options:s}=Jr(e,t),{releaseId:i,metadata:o}=n;return I(this.#e,this.#t,n,s).pipe(S(a=>({...a,releaseId:i,metadata:o})))}edit({releaseId:e,patch:t},n){const s={actionType:"sanity.action.release.edit",releaseId:e,patch:t};return I(this.#e,this.#t,s,n)}publish({releaseId:e},t){const n={actionType:"sanity.action.release.publish",releaseId:e};return I(this.#e,this.#t,n,t)}archive({releaseId:e},t){const n={actionType:"sanity.action.release.archive",releaseId:e};return I(this.#e,this.#t,n,t)}unarchive({releaseId:e},t){const n={actionType:"sanity.action.release.unarchive",releaseId:e};return I(this.#e,this.#t,n,t)}schedule({releaseId:e,publishAt:t},n){const s={actionType:"sanity.action.release.schedule",releaseId:e,publishAt:t};return I(this.#e,this.#t,s,n)}unschedule({releaseId:e},t){const n={actionType:"sanity.action.release.unschedule",releaseId:e};return I(this.#e,this.#t,n,t)}delete({releaseId:e},t){const n={actionType:"sanity.action.release.delete",releaseId:e};return I(this.#e,this.#t,n,t)}fetchDocuments({releaseId:e},t){return Tr(this.#e,this.#t,e,t)}}class Ki{#e;#t;constructor(e,t){this.#e=e,this.#t=t}get({releaseId:e},t){return g(Z(this.#e,this.#t,`_.releases.${e}`,t))}async create(e,t){const{action:n,options:s}=Jr(e,t),{releaseId:i,metadata:o}=n;return{...await g(I(this.#e,this.#t,n,s)),releaseId:i,metadata:o}}edit({releaseId:e,patch:t},n){const s={actionType:"sanity.action.release.edit",releaseId:e,patch:t};return g(I(this.#e,this.#t,s,n))}publish({releaseId:e},t){const n={actionType:"sanity.action.release.publish",releaseId:e};return g(I(this.#e,this.#t,n,t))}archive({releaseId:e},t){const n={actionType:"sanity.action.release.archive",releaseId:e};return g(I(this.#e,this.#t,n,t))}unarchive({releaseId:e},t){const n={actionType:"sanity.action.release.unarchive",releaseId:e};return g(I(this.#e,this.#t,n,t))}schedule({releaseId:e,publishAt:t},n){const s={actionType:"sanity.action.release.schedule",releaseId:e,publishAt:t};return g(I(this.#e,this.#t,s,n))}unschedule({releaseId:e},t){const n={actionType:"sanity.action.release.unschedule",releaseId:e};return g(I(this.#e,this.#t,n,t))}delete({releaseId:e},t){const n={actionType:"sanity.action.release.delete",releaseId:e};return g(I(this.#e,this.#t,n,t))}fetchDocuments({releaseId:e},t){return g(Tr(this.#e,this.#t,e,t))}}class eo{#e;#t;constructor(e,t){this.#e=e,this.#t=t}getById(e){return A(this.#e,this.#t,{uri:`/users/${e}`})}}class to{#e;#t;constructor(e,t){this.#e=e,this.#t=t}getById(e){return g(A(this.#e,this.#t,{uri:`/users/${e}`}))}}class ie{assets;datasets;live;mediaLibrary;projects;users;agent;releases;#e;#t;#r;listen=Br;constructor(e,t=se){this.config(t),this.#t=e;const n=t._requestHandler;this.#r=n?(()=>{let s;return(i,o)=>{const a=i;return s||(s=new H(e,{...t,_requestHandler:void 0})),n(a,u=>e(u,o),s)}})():e,this.assets=new Ti(this,this.#r),this.datasets=new Ui(this,this.#r),this.live=new Gr(this),this.mediaLibrary={video:new Qr(this,this.#r)},this.projects=new Ji(this,this.#r),this.users=new eo(this,this.#r),this.agent={action:new _i(this,this.#r)},this.releases=new Zi(this,this.#r)}clone(){return new ie(this.#t,this.config())}config(e){if(e===void 0)return{...this.#e};if(this.#e&&this.#e.allowReconfigure===!1)throw new Error("Existing client instance cannot be reconfigured - use `withConfig(newConfig)` to return a new client");return this.#e=wr(e,this.#e||{}),this}withConfig(e){const t=this.config();return new ie(this.#t,{...t,...e,stega:{...t.stega||{},...typeof e?.stega=="boolean"?{enabled:e.stega}:e?.stega||{}}})}
18fetch(e,t,n){return _r(this,this.#r,this.#e.stega,e,t,n)}getDocument(e,t){if(t?.includeAllVersions===!0)return Z(this,this.#r,e,{...t,includeAllVersions:!0});const n={signal:t?.signal,tag:t?.tag,releaseId:t?.releaseId,...t&&"includeAllVersions"in t?{includeAllVersions:!1}:{}};return Z(this,this.#r,e,n)}getDocuments(e,t){return xr(this,this.#r,e,t)}create(e,t){return xe(this,this.#r,e,"create",t)}createIfNotExists(e,t){return Or(this,this.#r,e,t)}createOrReplace(e,t){return Rr(this,this.#r,e,t)}createVersion({document:e,publishedId:t,releaseId:n,baseId:s,ifBaseRevisionId:i},o){if(!e)return jr(this,this.#r,t,s,n,i,o);const a=Ie("createVersion",{document:e,publishedId:t,releaseId:n}),u={...e,_id:a},c=t||_e(e._id);return Pr(this,this.#r,u,c,o)}delete(e,t){return qr(this,this.#r,e,t)}discardVersion({releaseId:e,publishedId:t},n,s){const i=Ce(t,e);return Fr(this,this.#r,i,n,s)}replaceVersion({document:e,publishedId:t,releaseId:n},s){const i=Ie("replaceVersion",{document:e,publishedId:t,releaseId:n}),o={...e,_id:i};return Dr(this,this.#r,o,s)}unpublishVersion({releaseId:e,publishedId:t},n){const s=ue(t,e);return Mr(this,this.#r,s,t,n)}mutate(e,t){return kr(this,this.#r,e,t)}patch(e,t){return new L(e,t,this)}transaction(e){return new le(e,this)}action(e,t){return I(this,this.#r,e,t)}request(e){return A(this,this.#r,e)}getUrl(e,t){return it(this,e,t)}getDataUrl(e,t){return T(this,e,t)}}class H{assets;datasets;live;mediaLibrary;projects;users;agent;releases;observable;#e;#t;#r;listen=Br;constructor(e,t=se){this.config(t),this.#t=e;const n=t._requestHandler;this.#r=n?(()=>{let s;return(i,o)=>{const a=i;return s||(s=new H(e,{...t,_requestHandler:void 0})),n(a,u=>e(u,o),s)}})():e,this.assets=new Oi(this,this.#r),this.datasets=new Ni(this,this.#r),this.live=new Gr(this),this.mediaLibrary={video:new Hi(this,this.#r)},this.projects=new Yi(this,this.#r),this.users=new to(this,this.#r),this.agent={action:new xi(this,this.#r)},this.releases=new Ki(this,this.#r),this.observable=new ie(e,t)}clone(){return new H(this.#t,this.config())}config(e){if(e===void 0)return{...this.#e};if(this.#e&&this.#e.allowReconfigure===!1)throw new Error("Existing client instance cannot be reconfigured - use `withConfig(newConfig)` to return a new client");return this.observable&&this.observable.config(e),this.#e=wr(e,this.#e||{}),this}withConfig(e){const t=this.config();return new H(this.#t,{...t,...e,stega:{...t.stega||{},...typeof e?.stega=="boolean"?{enabled:e.stega}:e?.stega||{}}})}fetch(e,t,n){return g(_r(this,this.#r,this.#e.stega,e,t,n))}getDocument(e,t){if(t?.includeAllVersions===!0)return g(Z(this,this.#r,e,{...t,includeAllVersions:!0}));const n={signal:t?.signal,tag:t?.tag,releaseId:t?.releaseId,...t&&"includeAllVersions"in t?{includeAllVersions:!1}:{}};return g(Z(this,this.#r,e,n))}getDocuments(e,t){return g(xr(this,this.#r,e,t))}create(e,t){return g(xe(this,this.#r,e,"create",t))}createIfNotExists(e,t){return g(Or(this,this.#r,e,t))}createOrReplace(e,t){return g(Rr(this,this.#r,e,t))}createVersion({document:e,publishedId:t,releaseId:n,baseId:s,ifBaseRevisionId:i},o){if(!e)return je(jr(this,this.#r,t,s,n,i,o));const a=Ie("createVersion",{document:e,publishedId:t,releaseId:n}),u={...e,_id:a},c=t||_e(e._id);return je(Pr(this,this.#r,u,c,o))}delete(e,t){return g(qr(this,this.#r,e,t))}discardVersion({releaseId:e,publishedId:t},n,s){const i=Ce(t,e);return g(Fr(this,this.#r,i,n,s))}replaceVersion({document:e,publishedId:t,releaseId:n},s){const i=Ie("replaceVersion",{document:e,publishedId:t,releaseId:n}),o={...e,_id:i};return je(Dr(this,this.#r,o,s))}unpublishVersion({releaseId:e,publishedId:t},n){const s=ue(t,e);return g(Mr(this,this.#r,s,t,n))}mutate(e,t){return g(kr(this,this.#r,e,t))}patch(e,t){return new j(e,t,this)}transaction(e){return new ce(e,this)}action(e,t){return g(I(this,this.#r,e,t))}request(e){return g(A(this,this.#r,e))}dataRequest(e,t,n){return g(z(this,this.#r,e,t,n))}getUrl(e,t){return it(this,e,t)}getDataUrl(e,t){return T(this,e,t)}}function ro(r,e){return{requester:St(r),createClient:t=>{const n=St(r,{ignoreWarnings:t.ignoreWarnings});return new e((s,i)=>(i||n)({maxRedirects:0,maxRetries:t.maxRetries,retryDelay:t.retryDelay,lineage:t.lineage,...s}),t)}}}var no=[];const so=ro(no,H),io=so.createClient,lo=Object.freeze(Object.defineProperty({__proto__:null,BasePatch:rt,BaseTransaction:nt,ChannelError:Cr,ClientError:pr,ConnectionFailedError:et,CorsOriginError:be,DisconnectError:Er,MessageError:Ir,MessageParseError:Le,ObservablePatch:L,ObservableSanityClient:ie,ObservableTransaction:le,Patch:j,SanityClient:H,ServerError:yr,Transaction:ce,connectEventSource:tt,createClient:io,formatQueryParseError:Xe,isQueryParseError:Ye,unstable__adapter:me,validateApiPerspective:Ke},Symbol.toStringTag,{value:"Module"}));
18export{lo as a,cr as i,co as y};
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.