@sanity/client 6.27.3-canary.2 → 6.28.0-instruct.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -19,11 +19,11 @@
19
19
  return Object.freeze(n);
20
20
  }
21
21
 
22
- const e=!(typeof navigator>"u")&&"ReactNative"===navigator.product,t={timeout:e?6e4:12e4},r=function(r){const a={...t,..."string"==typeof r?{url:r}:r};if(a.timeout=n$1(a.timeout),a.query){const{url:t,searchParams:r}=function(t){const r=t.indexOf("?");if(-1===r)return {url:t,searchParams:new URLSearchParams};const n=t.slice(0,r),a=t.slice(r+1);if(!e)return {url:n,searchParams:new URLSearchParams(a)};if("function"!=typeof decodeURIComponent)throw new Error("Broken `URLSearchParams` implementation, and `decodeURIComponent` is not defined");const s=new URLSearchParams;for(const e of a.split("&")){const[t,r]=e.split("=");t&&s.append(o$1(t),o$1(r||""));}return {url:n,searchParams:s}}(a.url);for(const[e,o]of Object.entries(a.query)){if(undefined!==o)if(Array.isArray(o))for(const t of o)r.append(e,t);else r.append(e,o);const n=r.toString();n&&(a.url=`${t}?${n}`);}}return a.method=a.body&&!a.method?"POST":(a.method||"GET").toUpperCase(),a};function o$1(e){return decodeURIComponent(e.replace(/\+/g," "))}function n$1(e){if(false===e||0===e)return false;if(e.connect||e.socket)return e;const r=Number(e);return isNaN(r)?n$1(t.timeout):{connect:r,socket:r}}const a$2=/^https?:\/\//i,s$2=function(e){if(!a$2.test(e.url))throw new Error(`"${e.url}" is not a valid URL`)};function c$3(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}
22
+ const e=!(typeof navigator>"u")&&"ReactNative"===navigator.product,t={timeout:e?6e4:12e4},r=function(r){const a={...t,..."string"==typeof r?{url:r}:r};if(a.timeout=n$1(a.timeout),a.query){const{url:t,searchParams:r}=function(t){const r=t.indexOf("?");if(-1===r)return {url:t,searchParams:new URLSearchParams};const n=t.slice(0,r),a=t.slice(r+1);if(!e)return {url:n,searchParams:new URLSearchParams(a)};if("function"!=typeof decodeURIComponent)throw new Error("Broken `URLSearchParams` implementation, and `decodeURIComponent` is not defined");const s=new URLSearchParams;for(const e of a.split("&")){const[t,r]=e.split("=");t&&s.append(o$1(t),o$1(r||""));}return {url:n,searchParams:s}}(a.url);for(const[e,o]of Object.entries(a.query)){if(void 0!==o)if(Array.isArray(o))for(const t of o)r.append(e,t);else r.append(e,o);const n=r.toString();n&&(a.url=`${t}?${n}`);}}return a.method=a.body&&!a.method?"POST":(a.method||"GET").toUpperCase(),a};function o$1(e){return decodeURIComponent(e.replace(/\+/g," "))}function n$1(e){if(false===e||0===e)return false;if(e.connect||e.socket)return e;const r=Number(e);return isNaN(r)?n$1(t.timeout):{connect:r,socket:r}}const a$2=/^https?:\/\//i,s$2=function(e){if(!a$2.test(e.url))throw new Error(`"${e.url}" is not a valid URL`)};function c$3(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}
23
23
 
24
- const o=["request","response","progress","error","abort"],s$1=["processOptions","validateOptions","interceptRequest","finalizeOptions","onRequest","onResponse","onError","onReturn","onHeaders"];function n(r$1,a){const i=[],u=s$1.reduce(((e,t)=>(e[t]=e[t]||[],e)),{processOptions:[r],validateOptions:[s$2]});function l(e){const t=o.reduce(((e,t)=>(e[t]=function(){const e=/* @__PURE__ */Object.create(null);let t=0;return {publish:function(t){for(const r in e)e[r](t);},subscribe:function(r){const o=t++;return e[o]=r,function(){delete e[o];}}}}(),e)),{}),r=(e=>function(t,r,...o){const s="onError"===t;let n=r;for(let r=0;r<e[t].length&&(n=(0, e[t][r])(n,...o),!s||n);r++);return n})(u),s=r("processOptions",e);r("validateOptions",s);const n={options:s,channels:t,applyMiddleware:r};let i;const l=t.request.subscribe((e=>{i=a(e,((o,s)=>((e,o,s)=>{let n=e,a=o;if(!n)try{a=r("onResponse",o,s);}catch(e){a=null,n=e;}n=n&&r("onError",n,s),n?t.error.publish(n):a&&t.response.publish(a);})(o,s,e)));}));t.abort.subscribe((()=>{l(),i&&i.abort();}));const c=r("onReturn",t,n);return c===t&&t.request.publish(n),c}return l.use=function(e){if(!e)throw new Error("Tried to add middleware that resolved to falsey value");if("function"==typeof e)throw new Error("Tried to add middleware that was a function. It probably expects you to pass options to it.");if(e.onReturn&&u.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 s$1.forEach((t=>{e[t]&&u[t].push(e[t]);})),i.push(e),l},l.clone=()=>n(i,a),r$1.forEach(l.use),l}var a$1,i,u$2=/* @__PURE__ */c$3(function(){if(i)return a$1;i=1;var e=function(e){return e.replace(/^\s+|\s+$/g,"")};return a$1=function(t){if(!t)return {};for(var r={},o=e(t).split("\n"),s=0;s<o.length;s++){var n=o[s],a=n.indexOf(":"),i=e(n.slice(0,a)).toLowerCase(),u=e(n.slice(a+1));typeof r[i]>"u"?r[i]=u:(l=r[i],"[object Array]"===Object.prototype.toString.call(l)?r[i].push(u):r[i]=[r[i],u]);}var l;return r}}());let l$1 = class l{onabort;onerror;onreadystatechange;ontimeout;readyState=0;response;responseText="";responseType="";status;statusText;withCredentials;#e;#t;#r;#o={};#s;#n={};#a;open(e,t,r){this.#e=e,this.#t=t,this.#r="",this.readyState=1,this.onreadystatechange?.(),this.#s=undefined;}abort(){this.#s&&this.#s.abort();}getAllResponseHeaders(){return this.#r}setRequestHeader(e,t){this.#o[e]=t;}setInit(e,t=true){this.#n=e,this.#a=t;}send(e){const t="arraybuffer"!==this.responseType,r={...this.#n,method:this.#e,headers:this.#o,body:e};"function"==typeof AbortController&&this.#a&&(this.#s=new AbortController,typeof EventTarget<"u"&&this.#s.signal instanceof EventTarget&&(r.signal=this.#s.signal)),typeof document<"u"&&(r.credentials=this.withCredentials?"include":"omit"),fetch(this.#t,r).then((e=>(e.headers.forEach(((e,t)=>{this.#r+=`${t}: ${e}\r\n`;})),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?.();}));}};const c$2="function"==typeof XMLHttpRequest?"xhr":"fetch",h="xhr"===c$2?XMLHttpRequest:l$1,d$1=(e,t)=>{const r=e.options,o=e.applyMiddleware("finalizeOptions",r),s={},n=e.applyMiddleware("interceptRequest",undefined,{adapter:c$2,context:e});if(n){const e=setTimeout(t,0,null,n);return {abort:()=>clearTimeout(e)}}let a=new h;a instanceof l$1&&"object"==typeof o.fetch&&a.setInit(o.fetch,o.useAbortSignal??true);const i=o.headers,d=o.timeout;let p=false,f=false,b=false;if(a.onerror=e=>{m(a instanceof l$1?e instanceof Error?e:new Error(`Request error while attempting to reach is ${o.url}`,{cause:e}):new Error(`Request error while attempting to reach is ${o.url}${e.lengthComputable?`(${e.loaded} of ${e.total} bytes transferred)`:""}`));},a.ontimeout=e=>{m(new Error(`Request timeout while attempting to reach ${o.url}${e.lengthComputable?`(${e.loaded} of ${e.total} bytes transferred)`:""}`));},a.onabort=()=>{w(true),p=true;},a.onreadystatechange=()=>{d&&(w(),s.socket=setTimeout((()=>y("ESOCKETTIMEDOUT")),d.socket)),!p&&4===a.readyState&&0!==a.status&&function(){if(!(p||f||b)){if(0===a.status)return void m(new Error("Unknown XHR error"));w(),f=true,t(null,{body:a.response||(""===a.responseType||"text"===a.responseType?a.responseText:""),url:o.url,method:o.method,headers:u$2(a.getAllResponseHeaders()),statusCode:a.status,statusMessage:a.statusText});}}();},a.open(o.method,o.url,true),a.withCredentials=!!o.withCredentials,i&&a.setRequestHeader)for(const e in i)i.hasOwnProperty(e)&&a.setRequestHeader(e,i[e]);return o.rawBody&&(a.responseType="arraybuffer"),e.applyMiddleware("onRequest",{options:o,adapter:c$2,request:a,context:e}),a.send(o.body||null),d&&(s.connect=setTimeout((()=>y("ETIMEDOUT")),d.connect)),{abort:function(){p=true,a&&a.abort();}};function y(t){b=true,a.abort();const r=new Error("ESOCKETTIMEDOUT"===t?`Socket timed out on request to ${o.url}`:`Connection timed out on request to ${o.url}`);r.code=t,e.channels.error.publish(r);}function w(e){(e||p||a.readyState>=2&&s.connect)&&clearTimeout(s.connect),s.socket&&clearTimeout(s.socket);}function m(e){if(f)return;w(true),f=true,a=null;const r=e||new Error(`Network error while attempting to reach ${o.url}`);r.isNetworkError=true,r.request=o,t(r);}},p$1=(e=[],t=d$1)=>n(e,t),f$1="browser";
24
+ const o=["request","response","progress","error","abort"],s$1=["processOptions","validateOptions","interceptRequest","finalizeOptions","onRequest","onResponse","onError","onReturn","onHeaders"];function n(r$1,a){const i=[],u=s$1.reduce(((e,t)=>(e[t]=e[t]||[],e)),{processOptions:[r],validateOptions:[s$2]});function l(e){const t=o.reduce(((e,t)=>(e[t]=function(){const e=/* @__PURE__ */Object.create(null);let t=0;return {publish:function(t){for(const r in e)e[r](t);},subscribe:function(r){const o=t++;return e[o]=r,function(){delete e[o];}}}}(),e)),{}),r=(e=>function(t,r,...o){const s="onError"===t;let n=r;for(let r=0;r<e[t].length&&(n=(0, e[t][r])(n,...o),!s||n);r++);return n})(u),s=r("processOptions",e);r("validateOptions",s);const n={options:s,channels:t,applyMiddleware:r};let i;const l=t.request.subscribe((e=>{i=a(e,((o,s)=>((e,o,s)=>{let n=e,a=o;if(!n)try{a=r("onResponse",o,s);}catch(e){a=null,n=e;}n=n&&r("onError",n,s),n?t.error.publish(n):a&&t.response.publish(a);})(o,s,e)));}));t.abort.subscribe((()=>{l(),i&&i.abort();}));const c=r("onReturn",t,n);return c===t&&t.request.publish(n),c}return l.use=function(e){if(!e)throw new Error("Tried to add middleware that resolved to falsey value");if("function"==typeof e)throw new Error("Tried to add middleware that was a function. It probably expects you to pass options to it.");if(e.onReturn&&u.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 s$1.forEach((t=>{e[t]&&u[t].push(e[t]);})),i.push(e),l},l.clone=()=>n(i,a),r$1.forEach(l.use),l}var a$1,i,u$2=/* @__PURE__ */c$3(function(){if(i)return a$1;i=1;var e=function(e){return e.replace(/^\s+|\s+$/g,"")};return a$1=function(t){if(!t)return {};for(var r={},o=e(t).split("\n"),s=0;s<o.length;s++){var n=o[s],a=n.indexOf(":"),i=e(n.slice(0,a)).toLowerCase(),u=e(n.slice(a+1));typeof r[i]>"u"?r[i]=u:(l=r[i],"[object Array]"===Object.prototype.toString.call(l)?r[i].push(u):r[i]=[r[i],u]);}var l;return r}}());let l$1 = class l{onabort;onerror;onreadystatechange;ontimeout;readyState=0;response;responseText="";responseType="";status;statusText;withCredentials;#e;#t;#r;#o={};#s;#n={};#a;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.#o[e]=t;}setInit(e,t=true){this.#n=e,this.#a=t;}send(e){const t="arraybuffer"!==this.responseType,r={...this.#n,method:this.#e,headers:this.#o,body:e};"function"==typeof AbortController&&this.#a&&(this.#s=new AbortController,typeof EventTarget<"u"&&this.#s.signal instanceof EventTarget&&(r.signal=this.#s.signal)),typeof document<"u"&&(r.credentials=this.withCredentials?"include":"omit"),fetch(this.#t,r).then((e=>(e.headers.forEach(((e,t)=>{this.#r+=`${t}: ${e}\r\n`;})),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?.();}));}};const c$2="function"==typeof XMLHttpRequest?"xhr":"fetch",h="xhr"===c$2?XMLHttpRequest:l$1,d$1=(e,t)=>{const r=e.options,o=e.applyMiddleware("finalizeOptions",r),s={},n=e.applyMiddleware("interceptRequest",void 0,{adapter:c$2,context:e});if(n){const e=setTimeout(t,0,null,n);return {abort:()=>clearTimeout(e)}}let a=new h;a instanceof l$1&&"object"==typeof o.fetch&&a.setInit(o.fetch,o.useAbortSignal??true);const i=o.headers,d=o.timeout;let p=false,f=false,b=false;if(a.onerror=e=>{m(a instanceof l$1?e instanceof Error?e:new Error(`Request error while attempting to reach is ${o.url}`,{cause:e}):new Error(`Request error while attempting to reach is ${o.url}${e.lengthComputable?`(${e.loaded} of ${e.total} bytes transferred)`:""}`));},a.ontimeout=e=>{m(new Error(`Request timeout while attempting to reach ${o.url}${e.lengthComputable?`(${e.loaded} of ${e.total} bytes transferred)`:""}`));},a.onabort=()=>{w(true),p=true;},a.onreadystatechange=()=>{d&&(w(),s.socket=setTimeout((()=>y("ESOCKETTIMEDOUT")),d.socket)),!p&&4===a.readyState&&0!==a.status&&function(){if(!(p||f||b)){if(0===a.status)return void m(new Error("Unknown XHR error"));w(),f=true,t(null,{body:a.response||(""===a.responseType||"text"===a.responseType?a.responseText:""),url:o.url,method:o.method,headers:u$2(a.getAllResponseHeaders()),statusCode:a.status,statusMessage:a.statusText});}}();},a.open(o.method,o.url,true),a.withCredentials=!!o.withCredentials,i&&a.setRequestHeader)for(const e in i)i.hasOwnProperty(e)&&a.setRequestHeader(e,i[e]);return o.rawBody&&(a.responseType="arraybuffer"),e.applyMiddleware("onRequest",{options:o,adapter:c$2,request:a,context:e}),a.send(o.body||null),d&&(s.connect=setTimeout((()=>y("ETIMEDOUT")),d.connect)),{abort:function(){p=true,a&&a.abort();}};function y(t){b=true,a.abort();const r=new Error("ESOCKETTIMEDOUT"===t?`Socket timed out on request to ${o.url}`:`Connection timed out on request to ${o.url}`);r.code=t,e.channels.error.publish(r);}function w(e){(e||p||a.readyState>=2&&s.connect)&&clearTimeout(s.connect),s.socket&&clearTimeout(s.socket);}function m(e){if(f)return;w(true),f=true,a=null;const r=e||new Error(`Network error while attempting to reach ${o.url}`);r.isNetworkError=true,r.request=o,t(r);}},p$1=(e=[],t=d$1)=>n(e,t),f$1="browser";
25
25
 
26
- var a,c$1,u$1,l,p,d={exports:{}};/* @__PURE__ */c$3((p||(p=1,function(e,t){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;const s="color: "+this.color;t.splice(1,0,s,"color: inherit");let n=0,r=0;t[0].replace(/%[a-zA-Z%]/g,(e=>{"%%"!==e&&(n++,"%c"===e&&(r=n));})),t.splice(r,0,s);},t.save=function(e){try{e?t.storage.setItem("debug",e):t.storage.removeItem("debug");}catch{}},t.load=function(){let e;try{e=t.storage.getItem("debug");}catch{}return !e&&typeof process<"u"&&"env"in process&&(e=process.env.DEBUG),e},t.useColors=function(){if(typeof window<"u"&&window.process&&("renderer"===window.process.type||window.process.__nwjs))return true;if(typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return false;let e;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&&(e=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(e[1],10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)},t.storage=function(){try{return localStorage}catch{}}(),t.destroy=/* @__PURE__ */(()=>{let e=false;return ()=>{e||(e=true,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=(l?u$1:(l=1,u$1=function(e){function t(e){let n,r,o,i=null;function a(...e){if(!a.enabled)return;const s=a,r=Number(/* @__PURE__ */new Date),o=r-(n||r);s.diff=o,s.prev=n,s.curr=r,n=r,e[0]=t.coerce(e[0]),"string"!=typeof e[0]&&e.unshift("%O");let i=0;e[0]=e[0].replace(/%([a-zA-Z%])/g,((n,r)=>{if("%%"===n)return "%";i++;const o=t.formatters[r];if("function"==typeof o){const t=e[i];n=o.call(s,t),e.splice(i,1),i--;}return n})),t.formatArgs.call(s,e),(s.log||t.log).apply(s,e);}return a.namespace=e,a.useColors=t.useColors(),a.color=t.selectColor(e),a.extend=s,a.destroy=t.destroy,Object.defineProperty(a,"enabled",{enumerable:true,configurable:false,get:()=>null!==i?i:(r!==t.namespaces&&(r=t.namespaces,o=t.enabled(e)),o),set:e=>{i=e;}}),"function"==typeof t.init&&t.init(a),a}function s(e,s){const n=t(this.namespace+(typeof s>"u"?":":s)+e);return n.log=this.log,n}function n(e,t){let s=0,n=0,r=-1,o=0;for(;s<e.length;)if(n<t.length&&(t[n]===e[s]||"*"===t[n]))"*"===t[n]?(r=n,o=s,n++):(s++,n++);else {if(-1===r)return false;n=r+1,o++,s=o;}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(){const e=[...t.names,...t.skips.map((e=>"-"+e))].join(",");return t.enable(""),e},t.enable=function(e){t.save(e),t.namespaces=e,t.names=[],t.skips=[];const s=("string"==typeof e?e:"").trim().replace(" ",",").split(",").filter(Boolean);for(const e of s)"-"===e[0]?t.skips.push(e.slice(1)):t.names.push(e);},t.enabled=function(e){for(const s of t.skips)if(n(e,s))return false;for(const s of t.names)if(n(e,s))return true;return false},t.humanize=function(){if(c$1)return a;c$1=1;var e=1e3,t=60*e,s=60*t,n=24*s,r=7*n;function o(e,t,s,n){var r=t>=1.5*s;return Math.round(e/s)+" "+n+(r?"s":"")}return a=function(i,a){a=a||{};var c,u,l=typeof i;if("string"===l&&i.length>0)return function(o){if(!((o=String(o)).length>100)){var i=/^(-?(?:\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(i){var a=parseFloat(i[1]);switch((i[2]||"ms").toLowerCase()){case "years":case "year":case "yrs":case "yr":case "y":return 315576e5*a;case "weeks":case "week":case "w":return a*r;case "days":case "day":case "d":return a*n;case "hours":case "hour":case "hrs":case "hr":case "h":return a*s;case "minutes":case "minute":case "mins":case "min":case "m":return a*t;case "seconds":case "second":case "secs":case "sec":case "s":return a*e;case "milliseconds":case "millisecond":case "msecs":case "msec":case "ms":return a;default:return}}}}(i);if("number"===l&&isFinite(i))return a.long?(c=i,(u=Math.abs(c))>=n?o(c,u,n,"day"):u>=s?o(c,u,s,"hour"):u>=t?o(c,u,t,"minute"):u>=e?o(c,u,e,"second"):c+" ms"):function(r){var o=Math.abs(r);return o>=n?Math.round(r/n)+"d":o>=s?Math.round(r/s)+"h":o>=t?Math.round(r/t)+"m":o>=e?Math.round(r/e)+"s":r+"ms"}(i);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(i))}}(),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((s=>{t[s]=e[s];})),t.names=[],t.skips=[],t.formatters={},t.selectColor=function(e){let s=0;for(let t=0;t<e.length;t++)s=(s<<5)-s+e.charCodeAt(t),s|=0;return t.colors[Math.abs(s)%t.colors.length]},t.enable(t.load()),t}))(t);const{formatters:s}=e.exports;s.j=function(e){try{return JSON.stringify(e)}catch(e){return "[UnexpectedJSONParseError]: "+e.message}};}(d,d.exports)),d.exports));const F=typeof Buffer>"u"?()=>false:e=>Buffer.isBuffer(e);function O$1(e){return "[object Object]"===Object.prototype.toString.call(e)}function j(e){if(false===O$1(e))return false;const t=e.constructor;if(undefined===t)return true;const s=t.prototype;return !(false===O$1(s)||false===s.hasOwnProperty("isPrototypeOf"))}const v=["boolean","string","number"];function x(){return {processOptions:e=>{const t=e.body;return !t||"function"==typeof t.pipe||F(t)||-1===v.indexOf(typeof t)&&!Array.isArray(t)&&!j(t)?e:Object.assign({},e,{body:JSON.stringify(e.body),headers:Object.assign({},e.headers,{"Content-Type":"application/json"})})}}}function E$1(e){return {onResponse:s=>{const n=s.headers["content-type"]||"",r=e&&e.force||-1!==n.indexOf("application/json");return s.body&&n&&r?Object.assign({},s,{body:t(s.body)}):s},processOptions:e=>Object.assign({},e,{headers:Object.assign({Accept:"application/json"},e.headers)})};function t(e){try{return JSON.parse(e)}catch(e){throw e.message=`Failed to parsed response body as JSON: ${e.message}`,e}}}let R={};typeof globalThis<"u"?R=globalThis:typeof window<"u"?R=window:typeof global<"u"?R=global:typeof self<"u"&&(R=self);var q=R;function A(e={}){const t=e.implementation||q.Observable;if(!t)throw new Error("`Observable` is not available in global scope, and no implementation was passed");return {onReturn:(e,s)=>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(s),()=>e.abort.publish())))}}function S$1(){return {onRequest:e=>{if("xhr"!==e.adapter)return;const t=e.request,s=e.context;function n(e){return t=>{const n=t.lengthComputable?t.loaded/t.total*100:-1;s.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"));}}}var $=(e,t,s)=>("GET"===s.method||"HEAD"===s.method)&&(e.isNetworkError||false);function _$1(e){return 100*Math.pow(2,e)+100*Math.random()}const P=(e={})=>(e=>{const t=e.maxRetries||5,s=e.retryDelay||_$1,n=e.shouldRetry;return {onError:(e,r)=>{const o=r.options,i=o.maxRetries||t,a=o.retryDelay||s,c=o.shouldRetry||n,u=o.attemptNumber||0;if(null!==(l=o.body)&&"object"==typeof l&&"function"==typeof l.pipe||!c(e,u,o)||u>=i)return e;var l;const p=Object.assign({},r,{options:Object.assign({},o,{attemptNumber:u+1})});return setTimeout((()=>r.channels.request.publish(p)),a(u)),null}}})({shouldRetry:$,...e});P.shouldRetry=$;
26
+ var a,c$1,u$1,l,p,d={exports:{}};/* @__PURE__ */c$3((p||(p=1,function(e,t){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;const s="color: "+this.color;t.splice(1,0,s,"color: inherit");let n=0,r=0;t[0].replace(/%[a-zA-Z%]/g,(e=>{"%%"!==e&&(n++,"%c"===e&&(r=n));})),t.splice(r,0,s);},t.save=function(e){try{e?t.storage.setItem("debug",e):t.storage.removeItem("debug");}catch{}},t.load=function(){let e;try{e=t.storage.getItem("debug");}catch{}return !e&&typeof process<"u"&&"env"in process&&(e=process.env.DEBUG),e},t.useColors=function(){if(typeof window<"u"&&window.process&&("renderer"===window.process.type||window.process.__nwjs))return true;if(typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return false;let e;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&&(e=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(e[1],10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)},t.storage=function(){try{return localStorage}catch{}}(),t.destroy=/* @__PURE__ */(()=>{let e=false;return ()=>{e||(e=true,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=(l?u$1:(l=1,u$1=function(e){function t(e){let n,r,o,i=null;function a(...e){if(!a.enabled)return;const s=a,r=Number(/* @__PURE__ */new Date),o=r-(n||r);s.diff=o,s.prev=n,s.curr=r,n=r,e[0]=t.coerce(e[0]),"string"!=typeof e[0]&&e.unshift("%O");let i=0;e[0]=e[0].replace(/%([a-zA-Z%])/g,((n,r)=>{if("%%"===n)return "%";i++;const o=t.formatters[r];if("function"==typeof o){const t=e[i];n=o.call(s,t),e.splice(i,1),i--;}return n})),t.formatArgs.call(s,e),(s.log||t.log).apply(s,e);}return a.namespace=e,a.useColors=t.useColors(),a.color=t.selectColor(e),a.extend=s,a.destroy=t.destroy,Object.defineProperty(a,"enabled",{enumerable:true,configurable:false,get:()=>null!==i?i:(r!==t.namespaces&&(r=t.namespaces,o=t.enabled(e)),o),set:e=>{i=e;}}),"function"==typeof t.init&&t.init(a),a}function s(e,s){const n=t(this.namespace+(typeof s>"u"?":":s)+e);return n.log=this.log,n}function n(e,t){let s=0,n=0,r=-1,o=0;for(;s<e.length;)if(n<t.length&&(t[n]===e[s]||"*"===t[n]))"*"===t[n]?(r=n,o=s,n++):(s++,n++);else {if(-1===r)return false;n=r+1,o++,s=o;}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(){const e=[...t.names,...t.skips.map((e=>"-"+e))].join(",");return t.enable(""),e},t.enable=function(e){t.save(e),t.namespaces=e,t.names=[],t.skips=[];const s=("string"==typeof e?e:"").trim().replace(" ",",").split(",").filter(Boolean);for(const e of s)"-"===e[0]?t.skips.push(e.slice(1)):t.names.push(e);},t.enabled=function(e){for(const s of t.skips)if(n(e,s))return false;for(const s of t.names)if(n(e,s))return true;return false},t.humanize=function(){if(c$1)return a;c$1=1;var e=1e3,t=60*e,s=60*t,n=24*s,r=7*n;function o(e,t,s,n){var r=t>=1.5*s;return Math.round(e/s)+" "+n+(r?"s":"")}return a=function(i,a){a=a||{};var c,u,l=typeof i;if("string"===l&&i.length>0)return function(o){if(!((o=String(o)).length>100)){var i=/^(-?(?:\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(i){var a=parseFloat(i[1]);switch((i[2]||"ms").toLowerCase()){case "years":case "year":case "yrs":case "yr":case "y":return 315576e5*a;case "weeks":case "week":case "w":return a*r;case "days":case "day":case "d":return a*n;case "hours":case "hour":case "hrs":case "hr":case "h":return a*s;case "minutes":case "minute":case "mins":case "min":case "m":return a*t;case "seconds":case "second":case "secs":case "sec":case "s":return a*e;case "milliseconds":case "millisecond":case "msecs":case "msec":case "ms":return a;default:return}}}}(i);if("number"===l&&isFinite(i))return a.long?(c=i,(u=Math.abs(c))>=n?o(c,u,n,"day"):u>=s?o(c,u,s,"hour"):u>=t?o(c,u,t,"minute"):u>=e?o(c,u,e,"second"):c+" ms"):function(r){var o=Math.abs(r);return o>=n?Math.round(r/n)+"d":o>=s?Math.round(r/s)+"h":o>=t?Math.round(r/t)+"m":o>=e?Math.round(r/e)+"s":r+"ms"}(i);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(i))}}(),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((s=>{t[s]=e[s];})),t.names=[],t.skips=[],t.formatters={},t.selectColor=function(e){let s=0;for(let t=0;t<e.length;t++)s=(s<<5)-s+e.charCodeAt(t),s|=0;return t.colors[Math.abs(s)%t.colors.length]},t.enable(t.load()),t}))(t);const{formatters:s}=e.exports;s.j=function(e){try{return JSON.stringify(e)}catch(e){return "[UnexpectedJSONParseError]: "+e.message}};}(d,d.exports)),d.exports));const F=typeof Buffer>"u"?()=>false:e=>Buffer.isBuffer(e);function O$1(e){return "[object Object]"===Object.prototype.toString.call(e)}function j(e){if(false===O$1(e))return false;const t=e.constructor;if(void 0===t)return true;const s=t.prototype;return !(false===O$1(s)||false===s.hasOwnProperty("isPrototypeOf"))}const v=["boolean","string","number"];function x(){return {processOptions:e=>{const t=e.body;return !t||"function"==typeof t.pipe||F(t)||-1===v.indexOf(typeof t)&&!Array.isArray(t)&&!j(t)?e:Object.assign({},e,{body:JSON.stringify(e.body),headers:Object.assign({},e.headers,{"Content-Type":"application/json"})})}}}function E$1(e){return {onResponse:s=>{const n=s.headers["content-type"]||"",r=e&&e.force||-1!==n.indexOf("application/json");return s.body&&n&&r?Object.assign({},s,{body:t(s.body)}):s},processOptions:e=>Object.assign({},e,{headers:Object.assign({Accept:"application/json"},e.headers)})};function t(e){try{return JSON.parse(e)}catch(e){throw e.message=`Failed to parsed response body as JSON: ${e.message}`,e}}}let R={};typeof globalThis<"u"?R=globalThis:typeof window<"u"?R=window:typeof global<"u"?R=global:typeof self<"u"&&(R=self);var q=R;function A(e={}){const t=e.implementation||q.Observable;if(!t)throw new Error("`Observable` is not available in global scope, and no implementation was passed");return {onReturn:(e,s)=>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(s),()=>e.abort.publish())))}}function S$1(){return {onRequest:e=>{if("xhr"!==e.adapter)return;const t=e.request,s=e.context;function n(e){return t=>{const n=t.lengthComputable?t.loaded/t.total*100:-1;s.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"));}}}var $=(e,t,s)=>("GET"===s.method||"HEAD"===s.method)&&(e.isNetworkError||false);function _$1(e){return 100*Math.pow(2,e)+100*Math.random()}const P=(e={})=>(e=>{const t=e.maxRetries||5,s=e.retryDelay||_$1,n=e.shouldRetry;return {onError:(e,r)=>{const o=r.options,i=o.maxRetries||t,a=o.retryDelay||s,c=o.shouldRetry||n,u=o.attemptNumber||0;if(null!==(l=o.body)&&"object"==typeof l&&"function"==typeof l.pipe||!c(e,u,o)||u>=i)return e;var l;const p=Object.assign({},r,{options:Object.assign({},o,{attemptNumber:u+1})});return setTimeout((()=>r.channels.request.publish(p)),a(u)),null}}})({shouldRetry:$,...e});P.shouldRetry=$;
27
27
 
28
28
  /******************************************************************************
29
29
  Copyright (c) Microsoft Corporation.
@@ -90,7 +90,7 @@
90
90
  }
91
91
  op = body.call(thisArg, _);
92
92
  } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
93
- if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : undefined, done: true };
93
+ if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
94
94
  }
95
95
  }
96
96
 
@@ -99,7 +99,7 @@
99
99
  if (m) return m.call(o);
100
100
  if (o && typeof o.length === "number") return {
101
101
  next: function () {
102
- if (o && i >= o.length) o = undefined;
102
+ if (o && i >= o.length) o = void 0;
103
103
  return { value: o && o[i++], done: !o };
104
104
  }
105
105
  };
@@ -285,7 +285,7 @@
285
285
  }
286
286
  teardown._addParent(this);
287
287
  }
288
- (this._finalizers = (_a = this._finalizers) !== null && _a !== undefined ? _a : []).push(teardown);
288
+ (this._finalizers = (_a = this._finalizers) !== null && _a !== void 0 ? _a : []).push(teardown);
289
289
  }
290
290
  }
291
291
  };
@@ -335,12 +335,7 @@
335
335
  }
336
336
 
337
337
  var config = {
338
- onUnhandledError: null,
339
- onStoppedNotification: null,
340
- Promise: undefined,
341
- useDeprecatedSynchronousErrorHandling: false,
342
- useDeprecatedNextContext: false,
343
- };
338
+ Promise: undefined};
344
339
 
345
340
  var timeoutProvider = {
346
341
  setTimeout: function (handler, timeout) {
@@ -348,11 +343,10 @@
348
343
  for (var _i = 2; _i < arguments.length; _i++) {
349
344
  args[_i - 2] = arguments[_i];
350
345
  }
351
- return setTimeout.apply(undefined, __spreadArray([handler, timeout], __read(args)));
346
+ return setTimeout.apply(void 0, __spreadArray([handler, timeout], __read(args)));
352
347
  },
353
348
  clearTimeout: function (handle) {
354
- var delegate = timeoutProvider.delegate;
355
- return ((delegate === null || delegate === undefined ? undefined : delegate.clearTimeout) || clearTimeout)(handle);
349
+ return (clearTimeout)(handle);
356
350
  },
357
351
  delegate: undefined,
358
352
  };
@@ -489,9 +483,9 @@
489
483
  var partialObserver;
490
484
  if (isFunction(observerOrNext) || !observerOrNext) {
491
485
  partialObserver = {
492
- next: (observerOrNext !== null && observerOrNext !== undefined ? observerOrNext : undefined),
493
- error: error !== null && error !== undefined ? error : undefined,
494
- complete: complete !== null && complete !== undefined ? complete : undefined,
486
+ next: (observerOrNext !== null && observerOrNext !== void 0 ? observerOrNext : undefined),
487
+ error: error !== null && error !== void 0 ? error : undefined,
488
+ complete: complete !== null && complete !== void 0 ? complete : undefined,
495
489
  };
496
490
  }
497
491
  else {
@@ -602,7 +596,7 @@
602
596
  };
603
597
  Observable.prototype._subscribe = function (subscriber) {
604
598
  var _a;
605
- return (_a = this.source) === null || _a === undefined ? undefined : _a.subscribe(subscriber);
599
+ return (_a = this.source) === null || _a === void 0 ? void 0 : _a.subscribe(subscriber);
606
600
  };
607
601
  Observable.prototype[observable] = function () {
608
602
  return this;
@@ -629,7 +623,7 @@
629
623
  }());
630
624
  function getPromiseCtor(promiseCtor) {
631
625
  var _a;
632
- return (_a = promiseCtor !== null && promiseCtor !== undefined ? promiseCtor : config.Promise) !== null && _a !== undefined ? _a : Promise;
626
+ return (_a = promiseCtor !== null && promiseCtor !== void 0 ? promiseCtor : config.Promise) !== null && _a !== void 0 ? _a : Promise;
633
627
  }
634
628
  function isObserver(value) {
635
629
  return value && isFunction(value.next) && isFunction(value.error) && isFunction(value.complete);
@@ -639,7 +633,7 @@
639
633
  }
640
634
 
641
635
  function hasLift(source) {
642
- return isFunction(source === null || source === undefined ? undefined : source.lift);
636
+ return isFunction(source === null || source === void 0 ? void 0 : source.lift);
643
637
  }
644
638
  function operate(init) {
645
639
  return function (source) {
@@ -709,7 +703,7 @@
709
703
  if (!this.shouldUnsubscribe || this.shouldUnsubscribe()) {
710
704
  var closed_1 = this.closed;
711
705
  _super.prototype.unsubscribe.call(this);
712
- !closed_1 && ((_a = this.onFinalize) === null || _a === undefined ? undefined : _a.call(this));
706
+ !closed_1 && ((_a = this.onFinalize) === null || _a === void 0 ? void 0 : _a.call(this));
713
707
  }
714
708
  };
715
709
  return OperatorSubscriber;
@@ -804,7 +798,7 @@
804
798
  Object.defineProperty(Subject.prototype, "observed", {
805
799
  get: function () {
806
800
  var _a;
807
- return ((_a = this.observers) === null || _a === undefined ? undefined : _a.length) > 0;
801
+ return ((_a = this.observers) === null || _a === void 0 ? void 0 : _a.length) > 0;
808
802
  },
809
803
  enumerable: false,
810
804
  configurable: true
@@ -860,19 +854,19 @@
860
854
  }
861
855
  AnonymousSubject.prototype.next = function (value) {
862
856
  var _a, _b;
863
- (_b = (_a = this.destination) === null || _a === undefined ? undefined : _a.next) === null || _b === undefined ? undefined : _b.call(_a, value);
857
+ (_b = (_a = this.destination) === null || _a === void 0 ? void 0 : _a.next) === null || _b === void 0 ? void 0 : _b.call(_a, value);
864
858
  };
865
859
  AnonymousSubject.prototype.error = function (err) {
866
860
  var _a, _b;
867
- (_b = (_a = this.destination) === null || _a === undefined ? undefined : _a.error) === null || _b === undefined ? undefined : _b.call(_a, err);
861
+ (_b = (_a = this.destination) === null || _a === void 0 ? void 0 : _a.error) === null || _b === void 0 ? void 0 : _b.call(_a, err);
868
862
  };
869
863
  AnonymousSubject.prototype.complete = function () {
870
864
  var _a, _b;
871
- (_b = (_a = this.destination) === null || _a === undefined ? undefined : _a.complete) === null || _b === undefined ? undefined : _b.call(_a);
865
+ (_b = (_a = this.destination) === null || _a === void 0 ? void 0 : _a.complete) === null || _b === void 0 ? void 0 : _b.call(_a);
872
866
  };
873
867
  AnonymousSubject.prototype._subscribe = function (subscriber) {
874
868
  var _a, _b;
875
- return (_b = (_a = this.source) === null || _a === undefined ? undefined : _a.subscribe(subscriber)) !== null && _b !== undefined ? _b : EMPTY_SUBSCRIPTION;
869
+ return (_b = (_a = this.source) === null || _a === void 0 ? void 0 : _a.subscribe(subscriber)) !== null && _b !== void 0 ? _b : EMPTY_SUBSCRIPTION;
876
870
  };
877
871
  return AnonymousSubject;
878
872
  }(Subject));
@@ -887,9 +881,9 @@
887
881
  var ReplaySubject = (function (_super) {
888
882
  __extends(ReplaySubject, _super);
889
883
  function ReplaySubject(_bufferSize, _windowTime, _timestampProvider) {
890
- if (_bufferSize === undefined) { _bufferSize = Infinity; }
891
- if (_windowTime === undefined) { _windowTime = Infinity; }
892
- if (_timestampProvider === undefined) { _timestampProvider = dateTimestampProvider; }
884
+ if (_bufferSize === void 0) { _bufferSize = Infinity; }
885
+ if (_windowTime === void 0) { _windowTime = Infinity; }
886
+ if (_timestampProvider === void 0) { _timestampProvider = dateTimestampProvider; }
893
887
  var _this = _super.call(this) || this;
894
888
  _this._bufferSize = _bufferSize;
895
889
  _this._windowTime = _windowTime;
@@ -955,7 +949,7 @@
955
949
  for (var _i = 2; _i < arguments.length; _i++) {
956
950
  args[_i - 2] = arguments[_i];
957
951
  }
958
- return setInterval.apply(undefined, __spreadArray([handler, timeout], __read(args)));
952
+ return setInterval.apply(void 0, __spreadArray([handler, timeout], __read(args)));
959
953
  },
960
954
  clearInterval: function (handle) {
961
955
  return (clearInterval)(handle);
@@ -974,7 +968,7 @@
974
968
  }
975
969
  AsyncAction.prototype.schedule = function (state, delay) {
976
970
  var _a;
977
- if (delay === undefined) { delay = 0; }
971
+ if (delay === void 0) { delay = 0; }
978
972
  if (this.closed) {
979
973
  return this;
980
974
  }
@@ -986,15 +980,15 @@
986
980
  }
987
981
  this.pending = true;
988
982
  this.delay = delay;
989
- this.id = (_a = this.id) !== null && _a !== undefined ? _a : this.requestAsyncId(scheduler, this.id, delay);
983
+ this.id = (_a = this.id) !== null && _a !== void 0 ? _a : this.requestAsyncId(scheduler, this.id, delay);
990
984
  return this;
991
985
  };
992
986
  AsyncAction.prototype.requestAsyncId = function (scheduler, _id, delay) {
993
- if (delay === undefined) { delay = 0; }
987
+ if (delay === void 0) { delay = 0; }
994
988
  return intervalProvider.setInterval(scheduler.flush.bind(scheduler, this), delay);
995
989
  };
996
990
  AsyncAction.prototype.recycleAsyncId = function (_scheduler, id, delay) {
997
- if (delay === undefined) { delay = 0; }
991
+ if (delay === void 0) { delay = 0; }
998
992
  if (delay != null && this.delay === delay && this.pending === false) {
999
993
  return id;
1000
994
  }
@@ -1050,12 +1044,12 @@
1050
1044
 
1051
1045
  var Scheduler = (function () {
1052
1046
  function Scheduler(schedulerActionCtor, now) {
1053
- if (now === undefined) { now = Scheduler.now; }
1047
+ if (now === void 0) { now = Scheduler.now; }
1054
1048
  this.schedulerActionCtor = schedulerActionCtor;
1055
1049
  this.now = now;
1056
1050
  }
1057
1051
  Scheduler.prototype.schedule = function (work, delay, state) {
1058
- if (delay === undefined) { delay = 0; }
1052
+ if (delay === void 0) { delay = 0; }
1059
1053
  return new this.schedulerActionCtor(this, work).schedule(state, delay);
1060
1054
  };
1061
1055
  Scheduler.now = dateTimestampProvider.now;
@@ -1065,7 +1059,7 @@
1065
1059
  var AsyncScheduler = (function (_super) {
1066
1060
  __extends(AsyncScheduler, _super);
1067
1061
  function AsyncScheduler(SchedulerAction, now) {
1068
- if (now === undefined) { now = Scheduler.now; }
1062
+ if (now === void 0) { now = Scheduler.now; }
1069
1063
  var _this = _super.call(this, SchedulerAction, now) || this;
1070
1064
  _this.actions = [];
1071
1065
  _this._active = false;
@@ -1120,7 +1114,7 @@
1120
1114
  var isArrayLike = (function (x) { return x && typeof x.length === 'number' && typeof x !== 'function'; });
1121
1115
 
1122
1116
  function isPromise(value) {
1123
- return isFunction(value === null || value === undefined ? undefined : value.then);
1117
+ return isFunction(value === null || value === void 0 ? void 0 : value.then);
1124
1118
  }
1125
1119
 
1126
1120
  function isInteropObservable(input) {
@@ -1128,7 +1122,7 @@
1128
1122
  }
1129
1123
 
1130
1124
  function isAsyncIterable(obj) {
1131
- return Symbol.asyncIterator && isFunction(obj === null || obj === undefined ? undefined : obj[Symbol.asyncIterator]);
1125
+ return Symbol.asyncIterator && isFunction(obj === null || obj === void 0 ? void 0 : obj[Symbol.asyncIterator]);
1132
1126
  }
1133
1127
 
1134
1128
  function createInvalidObservableTypeError(input) {
@@ -1144,7 +1138,7 @@
1144
1138
  var iterator = getSymbolIterator();
1145
1139
 
1146
1140
  function isIterable(input) {
1147
- return isFunction(input === null || input === undefined ? undefined : input[iterator]);
1141
+ return isFunction(input === null || input === void 0 ? void 0 : input[iterator]);
1148
1142
  }
1149
1143
 
1150
1144
  function readableStreamLikeToAsyncGenerator(readableStream) {
@@ -1163,7 +1157,7 @@
1163
1157
  case 3:
1164
1158
  _a = _b.sent(), value = _a.value, done = _a.done;
1165
1159
  if (!done) return [3, 5];
1166
- return [4, __await(undefined)];
1160
+ return [4, __await(void 0)];
1167
1161
  case 4: return [2, _b.sent()];
1168
1162
  case 5: return [4, __await(value)];
1169
1163
  case 6: return [4, _b.sent()];
@@ -1180,7 +1174,7 @@
1180
1174
  });
1181
1175
  }
1182
1176
  function isReadableStreamLike(obj) {
1183
- return isFunction(obj === null || obj === undefined ? undefined : obj.getReader);
1177
+ return isFunction(obj === null || obj === void 0 ? void 0 : obj.getReader);
1184
1178
  }
1185
1179
 
1186
1180
  function innerFrom(input) {
@@ -1271,7 +1265,7 @@
1271
1265
  function process$1(asyncIterable, subscriber) {
1272
1266
  var asyncIterable_1, asyncIterable_1_1;
1273
1267
  var e_2, _a;
1274
- return __awaiter(this, undefined, undefined, function () {
1268
+ return __awaiter(this, void 0, void 0, function () {
1275
1269
  var value, e_2_1;
1276
1270
  return __generator(this, function (_b) {
1277
1271
  switch (_b.label) {
@@ -1315,8 +1309,8 @@
1315
1309
  }
1316
1310
 
1317
1311
  function executeSchedule(parentSubscription, scheduler, work, delay, repeat) {
1318
- if (delay === undefined) { delay = 0; }
1319
- if (repeat === undefined) { repeat = false; }
1312
+ if (delay === void 0) { delay = 0; }
1313
+ if (repeat === void 0) { repeat = false; }
1320
1314
  var scheduleSubscription = scheduler.schedule(function () {
1321
1315
  work();
1322
1316
  if (repeat) {
@@ -1333,14 +1327,14 @@
1333
1327
  }
1334
1328
 
1335
1329
  function observeOn(scheduler, delay) {
1336
- if (delay === undefined) { delay = 0; }
1330
+ if (delay === void 0) { delay = 0; }
1337
1331
  return operate(function (source, subscriber) {
1338
1332
  source.subscribe(createOperatorSubscriber(subscriber, function (value) { return executeSchedule(subscriber, scheduler, function () { return subscriber.next(value); }, delay); }, function () { return executeSchedule(subscriber, scheduler, function () { return subscriber.complete(); }, delay); }, function (err) { return executeSchedule(subscriber, scheduler, function () { return subscriber.error(err); }, delay); }));
1339
1333
  });
1340
1334
  }
1341
1335
 
1342
1336
  function subscribeOn(scheduler, delay) {
1343
- if (delay === undefined) { delay = 0; }
1337
+ if (delay === void 0) { delay = 0; }
1344
1338
  return operate(function (source, subscriber) {
1345
1339
  subscriber.add(scheduler.schedule(function () { return source.subscribe(subscriber); }, delay));
1346
1340
  });
@@ -1395,7 +1389,7 @@
1395
1389
  }
1396
1390
  }, 0, true);
1397
1391
  });
1398
- return function () { return isFunction(iterator$1 === null || iterator$1 === undefined ? undefined : iterator$1.return) && iterator$1.return(); };
1392
+ return function () { return isFunction(iterator$1 === null || iterator$1 === void 0 ? void 0 : iterator$1.return) && iterator$1.return(); };
1399
1393
  });
1400
1394
  }
1401
1395
 
@@ -1514,14 +1508,14 @@
1514
1508
 
1515
1509
  var isArray$2 = Array.isArray;
1516
1510
  function callOrApply(fn, args) {
1517
- return isArray$2(args) ? fn.apply(undefined, __spreadArray([], __read(args))) : fn(args);
1511
+ return isArray$2(args) ? fn.apply(void 0, __spreadArray([], __read(args))) : fn(args);
1518
1512
  }
1519
1513
  function mapOneOrManyArgs(fn) {
1520
1514
  return map(function (args) { return callOrApply(fn, args); });
1521
1515
  }
1522
1516
 
1523
1517
  function combineLatestInit(observables, scheduler, valueTransform) {
1524
- if (valueTransform === undefined) { valueTransform = identity; }
1518
+ if (valueTransform === void 0) { valueTransform = identity; }
1525
1519
  return function (subscriber) {
1526
1520
  maybeSchedule(scheduler, function () {
1527
1521
  var length = observables.length;
@@ -1611,7 +1605,7 @@
1611
1605
  }
1612
1606
 
1613
1607
  function mergeMap(project, resultSelector, concurrent) {
1614
- if (concurrent === undefined) { concurrent = Infinity; }
1608
+ if (concurrent === void 0) { concurrent = Infinity; }
1615
1609
  if (isFunction(resultSelector)) {
1616
1610
  return mergeMap(function (a, i) { return map(function (b, ii) { return resultSelector(a, b, i, ii); })(innerFrom(project(a, i))); }, concurrent);
1617
1611
  }
@@ -1622,7 +1616,7 @@
1622
1616
  }
1623
1617
 
1624
1618
  function mergeAll(concurrent) {
1625
- if (concurrent === undefined) { concurrent = Infinity; }
1619
+ if (concurrent === void 0) { concurrent = Infinity; }
1626
1620
  return mergeMap(identity, concurrent);
1627
1621
  }
1628
1622
 
@@ -1645,7 +1639,7 @@
1645
1639
  }
1646
1640
 
1647
1641
  function timer(dueTime, intervalOrScheduler, scheduler) {
1648
- if (scheduler === undefined) { scheduler = async; }
1642
+ if (scheduler === void 0) { scheduler = async; }
1649
1643
  return new Observable(function (subscriber) {
1650
1644
  var due = isValidDate$1(dueTime) ? 1e3 - scheduler.now() : dueTime;
1651
1645
  if (due < 0) {
@@ -1724,7 +1718,7 @@
1724
1718
  }
1725
1719
  var resultSelector = popResultSelector(args);
1726
1720
  return resultSelector
1727
- ? pipe(combineLatest.apply(undefined, __spreadArray([], __read(args))), mapOneOrManyArgs(resultSelector))
1721
+ ? pipe(combineLatest.apply(void 0, __spreadArray([], __read(args))), mapOneOrManyArgs(resultSelector))
1728
1722
  : operate(function (source, subscriber) {
1729
1723
  combineLatestInit(__spreadArray([source], __read(argsOrArgArray(args))))(subscriber);
1730
1724
  });
@@ -1735,7 +1729,7 @@
1735
1729
  for (var _i = 0; _i < arguments.length; _i++) {
1736
1730
  otherSources[_i] = arguments[_i];
1737
1731
  }
1738
- return combineLatest.apply(undefined, __spreadArray([], __read(otherSources)));
1732
+ return combineLatest.apply(void 0, __spreadArray([], __read(otherSources)));
1739
1733
  }
1740
1734
 
1741
1735
  function finalize(callback) {
@@ -1750,8 +1744,8 @@
1750
1744
  }
1751
1745
 
1752
1746
  function share(options) {
1753
- if (options === undefined) { options = {}; }
1754
- var _a = options.connector, connector = _a === undefined ? function () { return new Subject(); } : _a, _b = options.resetOnError, resetOnError = _b === undefined ? true : _b, _c = options.resetOnComplete, resetOnComplete = _c === undefined ? true : _c, _d = options.resetOnRefCountZero, resetOnRefCountZero = _d === undefined ? true : _d;
1747
+ if (options === void 0) { options = {}; }
1748
+ var _a = options.connector, connector = _a === void 0 ? function () { return new Subject(); } : _a, _b = options.resetOnError, resetOnError = _b === void 0 ? true : _b, _c = options.resetOnComplete, resetOnComplete = _c === void 0 ? true : _c, _d = options.resetOnRefCountZero, resetOnRefCountZero = _d === void 0 ? true : _d;
1755
1749
  return function (wrapperSource) {
1756
1750
  var connection;
1757
1751
  var resetConnection;
@@ -1760,7 +1754,7 @@
1760
1754
  var hasCompleted = false;
1761
1755
  var hasErrored = false;
1762
1756
  var cancelReset = function () {
1763
- resetConnection === null || resetConnection === undefined ? undefined : resetConnection.unsubscribe();
1757
+ resetConnection === null || resetConnection === void 0 ? void 0 : resetConnection.unsubscribe();
1764
1758
  resetConnection = undefined;
1765
1759
  };
1766
1760
  var reset = function () {
@@ -1771,7 +1765,7 @@
1771
1765
  var resetAndUnsubscribe = function () {
1772
1766
  var conn = connection;
1773
1767
  reset();
1774
- conn === null || conn === undefined ? undefined : conn.unsubscribe();
1768
+ conn === null || conn === void 0 ? void 0 : conn.unsubscribe();
1775
1769
  };
1776
1770
  return operate(function (source, subscriber) {
1777
1771
  refCount++;
@@ -1826,7 +1820,7 @@
1826
1820
  reset();
1827
1821
  },
1828
1822
  });
1829
- return innerFrom(on.apply(undefined, __spreadArray([], __read(args)))).subscribe(onSubscriber);
1823
+ return innerFrom(on.apply(void 0, __spreadArray([], __read(args)))).subscribe(onSubscriber);
1830
1824
  }
1831
1825
 
1832
1826
  function shareReplay(configOrBufferSize, windowTime, scheduler) {
@@ -1907,7 +1901,7 @@
1907
1901
  var S = `${Object.values(s).map((t) => `\\u{${t.toString(16)}}`).join("")}`, f = new RegExp(`[${S}]{4,}`, "gu");
1908
1902
  function _(t) {
1909
1903
  var e;
1910
- return { cleaned: t.replace(f, ""), encoded: ((e = t.match(f)) == null ? undefined : e[0]) || "" };
1904
+ return { cleaned: t.replace(f, ""), encoded: ((e = t.match(f)) == null ? void 0 : e[0]) || "" };
1911
1905
  }
1912
1906
  function O(t) {
1913
1907
  return t && JSON.parse(_(JSON.stringify(t)).cleaned);
@@ -1942,7 +1936,7 @@
1942
1936
  statusCode: res.statusCode,
1943
1937
  responseBody: stringifyBody(body, res),
1944
1938
  message: "",
1945
- details: undefined
1939
+ details: void 0
1946
1940
  };
1947
1941
  if (body.error && body.message)
1948
1942
  return props.message = `${body.error} - ${body.message}`, props;
@@ -2083,8 +2077,10 @@
2083
2077
  "global, edge-cached API-CDN. If you wish to have content delivered faster, set",
2084
2078
  "`useCdn: false` to use the Live API. Note: You may incur higher costs using the live API."
2085
2079
  ]), printCdnPreviewDraftsWarning = createWarningPrinter([
2086
- "The Sanity client is configured with the `perspective` set to `previewDrafts`, which doesn't support the API-CDN.",
2080
+ "The Sanity client is configured with the `perspective` set to `drafts` or `previewDrafts`, which doesn't support the API-CDN.",
2087
2081
  "The Live API will be used instead. Set `useCdn: false` in your configuration to hide this warning."
2082
+ ]), printPreviewDraftsDeprecationWarning = createWarningPrinter([
2083
+ "The `previewDrafts` perspective has been renamed to `drafts` and will be removed in a future API version"
2088
2084
  ]), printBrowserTokenWarning = createWarningPrinter([
2089
2085
  "You have configured Sanity client to use a token in the browser. This may cause unintentional security issues.",
2090
2086
  `See ${generateHelpUrl(
@@ -2154,14 +2150,14 @@
2154
2150
  );
2155
2151
  if (typeof newConfig.stega.enabled != "boolean")
2156
2152
  throw new Error(`stega.enabled must be a boolean, received ${newConfig.stega.enabled}`);
2157
- if (newConfig.stega.enabled && newConfig.stega.studioUrl === undefined)
2153
+ if (newConfig.stega.enabled && newConfig.stega.studioUrl === void 0)
2158
2154
  throw new Error("stega.studioUrl must be defined when stega.enabled is true");
2159
2155
  if (newConfig.stega.enabled && typeof newConfig.stega.studioUrl != "string" && typeof newConfig.stega.studioUrl != "function")
2160
2156
  throw new Error(
2161
2157
  `stega.studioUrl must be a string or a function, received ${newConfig.stega.studioUrl}`
2162
2158
  );
2163
2159
  const isBrowser = typeof window < "u" && window.location && window.location.hostname, isLocalhost = isBrowser && isLocal(window.location.hostname);
2164
- isBrowser && isLocalhost && newConfig.token && newConfig.ignoreBrowserTokenWarning !== true ? printBrowserTokenWarning() : typeof newConfig.useCdn > "u" && printCdnWarning(), projectBased && projectId(newConfig.projectId), newConfig.dataset && dataset(newConfig.dataset), "requestTagPrefix" in newConfig && (newConfig.requestTagPrefix = newConfig.requestTagPrefix ? requestTag(newConfig.requestTagPrefix).replace(/\.+$/, "") : undefined), newConfig.apiVersion = `${newConfig.apiVersion}`.replace(/^v/, ""), newConfig.isDefaultApi = newConfig.apiHost === defaultConfig.apiHost, newConfig.useCdn === true && newConfig.withCredentials && printCdnAndWithCredentialsWarning(), newConfig.useCdn = newConfig.useCdn !== false && !newConfig.withCredentials, validateApiVersion(newConfig.apiVersion);
2160
+ isBrowser && isLocalhost && newConfig.token && newConfig.ignoreBrowserTokenWarning !== true ? printBrowserTokenWarning() : typeof newConfig.useCdn > "u" && printCdnWarning(), projectBased && projectId(newConfig.projectId), newConfig.dataset && dataset(newConfig.dataset), "requestTagPrefix" in newConfig && (newConfig.requestTagPrefix = newConfig.requestTagPrefix ? requestTag(newConfig.requestTagPrefix).replace(/\.+$/, "") : void 0), newConfig.apiVersion = `${newConfig.apiVersion}`.replace(/^v/, ""), newConfig.isDefaultApi = newConfig.apiHost === defaultConfig.apiHost, newConfig.useCdn === true && newConfig.withCredentials && printCdnAndWithCredentialsWarning(), newConfig.useCdn = newConfig.useCdn !== false && !newConfig.withCredentials, validateApiVersion(newConfig.apiVersion);
2165
2161
  const hostParts = newConfig.apiHost.split("://", 2), protocol = hostParts[0], host = hostParts[1], cdnHost = newConfig.isDefaultApi ? defaultCdnHost : host;
2166
2162
  return newConfig.useProjectHostname ? (newConfig.url = `${protocol}://${newConfig.projectId}.${host}/v${newConfig.apiVersion}`, newConfig.cdnUrl = `${protocol}://${newConfig.projectId}.${cdnHost}/v${newConfig.apiVersion}`) : (newConfig.url = `${newConfig.apiHost}/v${newConfig.apiVersion}`, newConfig.cdnUrl = newConfig.url), newConfig;
2167
2163
  };
@@ -2631,7 +2627,7 @@ ${selectionOpts}`);
2631
2627
  for (const [key, value] of Object.entries(opts))
2632
2628
  value && searchParams.append(key, `${value}`);
2633
2629
  return returnQuery === false && searchParams.append("returnQuery", "false"), includeMutations === false && searchParams.append("includeMutations", "false"), `?${searchParams}`;
2634
- }, excludeFalsey = (param, defValue) => param === false ? undefined : typeof param > "u" ? defValue : param, getMutationQuery = (options = {}) => ({
2630
+ }, excludeFalsey = (param, defValue) => param === false ? void 0 : typeof param > "u" ? defValue : param, getMutationQuery = (options = {}) => ({
2635
2631
  dryRun: options.dryRun,
2636
2632
  returnIds: true,
2637
2633
  returnDocuments: excludeFalsey(options.returnDocuments, true),
@@ -2717,11 +2713,11 @@ ${selectionOpts}`);
2717
2713
  function _mutate(client, httpRequest, mutations, options) {
2718
2714
  let mut;
2719
2715
  mutations instanceof Patch || mutations instanceof ObservablePatch ? mut = { patch: mutations.serialize() } : mutations instanceof Transaction || mutations instanceof ObservableTransaction ? mut = mutations.serialize() : mut = mutations;
2720
- const muts = Array.isArray(mut) ? mut : [mut], transactionId = options && options.transactionId || undefined;
2716
+ const muts = Array.isArray(mut) ? mut : [mut], transactionId = options && options.transactionId || void 0;
2721
2717
  return _dataRequest(client, httpRequest, "mutate", { mutations: muts, transactionId }, options);
2722
2718
  }
2723
2719
  function _action(client, httpRequest, actions, options) {
2724
- const acts = Array.isArray(actions) ? actions : [actions], transactionId = options && options.transactionId || undefined, skipCrossDatasetReferenceValidation = options && options.skipCrossDatasetReferenceValidation || undefined, dryRun = options && options.dryRun || undefined;
2720
+ const acts = Array.isArray(actions) ? actions : [actions], transactionId = options && options.transactionId || void 0, skipCrossDatasetReferenceValidation = options && options.skipCrossDatasetReferenceValidation || void 0, dryRun = options && options.dryRun || void 0;
2725
2721
  return _dataRequest(
2726
2722
  client,
2727
2723
  httpRequest,
@@ -2735,7 +2731,7 @@ ${selectionOpts}`);
2735
2731
  method: useGet ? "GET" : "POST",
2736
2732
  uri,
2737
2733
  json: true,
2738
- body: useGet ? undefined : body,
2734
+ body: useGet ? void 0 : body,
2739
2735
  query: isMutation && getMutationQuery(options),
2740
2736
  timeout,
2741
2737
  headers,
@@ -2780,12 +2776,13 @@ ${selectionOpts}`);
2780
2776
  const tag = options.tag && config.requestTagPrefix ? [config.requestTagPrefix, options.tag].join(".") : options.tag || config.requestTagPrefix;
2781
2777
  if (tag && options.tag !== null && (options.query = { tag: requestTag(tag), ...options.query }), ["GET", "HEAD", "POST"].indexOf(options.method || "GET") >= 0 && uri.indexOf("/data/query/") === 0) {
2782
2778
  const resultSourceMap = options.resultSourceMap ?? config.resultSourceMap;
2783
- resultSourceMap !== undefined && resultSourceMap !== false && (options.query = { resultSourceMap, ...options.query });
2779
+ resultSourceMap !== void 0 && resultSourceMap !== false && (options.query = { resultSourceMap, ...options.query });
2784
2780
  const perspectiveOption = options.perspective || config.perspective;
2785
- typeof perspectiveOption < "u" && (validateApiPerspective(perspectiveOption), options.query = {
2781
+ typeof perspectiveOption < "u" && (perspectiveOption === "previewDrafts" && printPreviewDraftsDeprecationWarning(), validateApiPerspective(perspectiveOption), options.query = {
2786
2782
  perspective: Array.isArray(perspectiveOption) ? perspectiveOption.join(",") : perspectiveOption,
2787
2783
  ...options.query
2788
- }, perspectiveOption === "previewDrafts" && useCdn && (useCdn = false, printCdnPreviewDraftsWarning())), options.lastLiveEventId && (options.query = { ...options.query, lastLiveEventId: options.lastLiveEventId }), options.returnQuery === false && (options.query = { returnQuery: "false", ...options.query }), useCdn && options.cacheMode == "noStale" && (options.query = { cacheMode: "noStale", ...options.query });
2784
+ }, (Array.isArray(perspectiveOption) && perspectiveOption.length > 0 || // previewDrafts was renamed to drafts, but keep for backwards compat
2785
+ perspectiveOption === "previewDrafts" || perspectiveOption === "drafts") && useCdn && (useCdn = false, printCdnPreviewDraftsWarning())), options.lastLiveEventId && (options.query = { ...options.query, lastLiveEventId: options.lastLiveEventId }), options.returnQuery === false && (options.query = { returnQuery: "false", ...options.query }), useCdn && options.cacheMode == "noStale" && (options.query = { cacheMode: "noStale", ...options.query });
2789
2786
  }
2790
2787
  const reqOptions = requestOptions(
2791
2788
  config,
@@ -2861,7 +2858,7 @@ ${selectionOpts}`);
2861
2858
  }
2862
2859
  function _upload(client, httpRequest, assetType, body, opts = {}) {
2863
2860
  validateAssetType(assetType);
2864
- let meta = opts.extract || undefined;
2861
+ let meta = opts.extract || void 0;
2865
2862
  meta && !meta.length && (meta = ["none"]);
2866
2863
  const dataset2 = hasDataset(client.config()), assetEndpoint = assetType === "image" ? "images" : "files", options = optionsFromFile(opts, body), { tag, label, title, description, creditLine, filename, source } = options, query = {
2867
2864
  label,
@@ -2884,12 +2881,48 @@ ${selectionOpts}`);
2884
2881
  function optionsFromFile(opts, file) {
2885
2882
  return typeof File > "u" || !(file instanceof File) ? opts : Object.assign(
2886
2883
  {
2887
- filename: opts.preserveFilename === false ? undefined : file.name,
2884
+ filename: opts.preserveFilename === false ? void 0 : file.name,
2888
2885
  contentType: file.type
2889
2886
  },
2890
2887
  opts
2891
2888
  );
2892
2889
  }
2890
+ function _instruct(client, httpRequest, request) {
2891
+ const dataset2 = hasDataset(client.config());
2892
+ return _request(client, httpRequest, {
2893
+ method: "POST",
2894
+ uri: `/assist/tasks/instruct/${dataset2}`,
2895
+ body: request
2896
+ });
2897
+ }
2898
+ class ObservableAssistClient {
2899
+ #client;
2900
+ #httpRequest;
2901
+ constructor(client, httpRequest) {
2902
+ this.#client = client, this.#httpRequest = httpRequest;
2903
+ }
2904
+ /**
2905
+ * Run an ad-hoc instruction for a target document.
2906
+ * @param request instruction request
2907
+ */
2908
+ instruct(request) {
2909
+ return _instruct(this.#client, this.#httpRequest, request);
2910
+ }
2911
+ }
2912
+ class AssistClient {
2913
+ #client;
2914
+ #httpRequest;
2915
+ constructor(client, httpRequest) {
2916
+ this.#client = client, this.#httpRequest = httpRequest;
2917
+ }
2918
+ /**
2919
+ * Run an ad-hoc instruction for a target document.
2920
+ * @param request instruction request
2921
+ */
2922
+ instruct(request) {
2923
+ return lastValueFrom(_instruct(this.#client, this.#httpRequest, request));
2924
+ }
2925
+ }
2893
2926
  var defaults = (obj, defaults2) => Object.keys(defaults2).concat(Object.keys(obj)).reduce((target, prop) => (target[prop] = typeof obj[prop] > "u" ? defaults2[prop] : obj[prop], target), {});
2894
2927
  const pick = (obj, props) => props.reduce((selection, prop) => (typeof obj[prop] > "u" || (selection[prop] = obj[prop]), selection), {}), eventSourcePolyfill = defer(() => Promise.resolve().then(function () { return browser$1; })).pipe(
2895
2928
  map(({ default: EventSource2 }) => EventSource2),
@@ -2947,7 +2980,7 @@ ${selectionOpts}`);
2947
2980
  config.predicate(value) && (emitted = true, latest = value);
2948
2981
  }),
2949
2982
  finalize(() => {
2950
- emitted = false, latest = undefined;
2983
+ emitted = false, latest = void 0;
2951
2984
  }),
2952
2985
  share(shareConfig)
2953
2986
  ), emitLatest = new Observable((subscriber) => {
@@ -3222,6 +3255,7 @@ ${selectionOpts}`);
3222
3255
  live;
3223
3256
  projects;
3224
3257
  users;
3258
+ assist;
3225
3259
  /**
3226
3260
  * Private properties
3227
3261
  */
@@ -3232,7 +3266,7 @@ ${selectionOpts}`);
3232
3266
  */
3233
3267
  listen = _listen;
3234
3268
  constructor(httpRequest, config = defaultConfig) {
3235
- this.config(config), this.#httpRequest = httpRequest, this.assets = new ObservableAssetsClient(this, this.#httpRequest), this.datasets = new ObservableDatasetsClient(this, this.#httpRequest), this.live = new LiveClient(this), this.projects = new ObservableProjectsClient(this, this.#httpRequest), this.users = new ObservableUsersClient(this, this.#httpRequest);
3269
+ this.config(config), this.#httpRequest = httpRequest, this.assets = new ObservableAssetsClient(this, this.#httpRequest), this.datasets = new ObservableDatasetsClient(this, this.#httpRequest), this.live = new LiveClient(this), this.projects = new ObservableProjectsClient(this, this.#httpRequest), this.users = new ObservableUsersClient(this, this.#httpRequest), this.assist = new ObservableAssistClient(this, this.#httpRequest);
3236
3270
  }
3237
3271
  /**
3238
3272
  * Clone the client - returns a new instance
@@ -3241,7 +3275,7 @@ ${selectionOpts}`);
3241
3275
  return new ObservableSanityClient(this.#httpRequest, this.config());
3242
3276
  }
3243
3277
  config(newConfig) {
3244
- if (newConfig === undefined)
3278
+ if (newConfig === void 0)
3245
3279
  return { ...this.#clientConfig };
3246
3280
  if (this.#clientConfig && this.#clientConfig.allowReconfigure === false)
3247
3281
  throw new Error(
@@ -3371,6 +3405,7 @@ ${selectionOpts}`);
3371
3405
  live;
3372
3406
  projects;
3373
3407
  users;
3408
+ assist;
3374
3409
  /**
3375
3410
  * Observable version of the Sanity client, with the same configuration as the promise-based one
3376
3411
  */
@@ -3385,7 +3420,7 @@ ${selectionOpts}`);
3385
3420
  */
3386
3421
  listen = _listen;
3387
3422
  constructor(httpRequest, config = defaultConfig) {
3388
- this.config(config), this.#httpRequest = httpRequest, this.assets = new AssetsClient(this, this.#httpRequest), this.datasets = new DatasetsClient(this, this.#httpRequest), this.live = new LiveClient(this), this.projects = new ProjectsClient(this, this.#httpRequest), this.users = new UsersClient(this, this.#httpRequest), this.observable = new ObservableSanityClient(httpRequest, config);
3423
+ this.config(config), this.#httpRequest = httpRequest, this.assets = new AssetsClient(this, this.#httpRequest), this.datasets = new DatasetsClient(this, this.#httpRequest), this.live = new LiveClient(this), this.projects = new ProjectsClient(this, this.#httpRequest), this.users = new UsersClient(this, this.#httpRequest), this.assist = new AssistClient(this, this.#httpRequest), this.observable = new ObservableSanityClient(httpRequest, config);
3389
3424
  }
3390
3425
  /**
3391
3426
  * Clone the client - returns a new instance
@@ -3394,7 +3429,7 @@ ${selectionOpts}`);
3394
3429
  return new SanityClient(this.#httpRequest, this.config());
3395
3430
  }
3396
3431
  config(newConfig) {
3397
- if (newConfig === undefined)
3432
+ if (newConfig === void 0)
3398
3433
  return { ...this.#clientConfig };
3399
3434
  if (this.#clientConfig && this.#clientConfig.allowReconfigure === false)
3400
3435
  throw new Error(
@@ -3609,16 +3644,16 @@ ${selectionOpts}`);
3609
3644
  const parsed = [], parseRe = /\['(.*?)'\]|\[(\d+)\]|\[\?\(@\._key=='(.*?)'\)\]/g;
3610
3645
  let match;
3611
3646
  for (; (match = parseRe.exec(path)) !== null; ) {
3612
- if (match[1] !== undefined) {
3647
+ if (match[1] !== void 0) {
3613
3648
  const key = match[1].replace(/\\(\\|f|n|r|t|')/g, (m) => UNESCAPE[m]);
3614
3649
  parsed.push(key);
3615
3650
  continue;
3616
3651
  }
3617
- if (match[2] !== undefined) {
3652
+ if (match[2] !== void 0) {
3618
3653
  parsed.push(parseInt(match[2], 10));
3619
3654
  continue;
3620
3655
  }
3621
- if (match[3] !== undefined) {
3656
+ if (match[3] !== void 0) {
3622
3657
  const _key = match[3].replace(/\\(\\')/g, (m) => UNESCAPE[m]);
3623
3658
  parsed.push({
3624
3659
  _key,
@@ -3653,7 +3688,7 @@ ${selectionOpts}`);
3653
3688
  if (!csm?.mappings)
3654
3689
  return;
3655
3690
  const resultMappingPath = jsonPath(jsonPathToMappingPath(resultPath));
3656
- if (csm.mappings[resultMappingPath] !== undefined)
3691
+ if (csm.mappings[resultMappingPath] !== void 0)
3657
3692
  return {
3658
3693
  mapping: csm.mappings[resultMappingPath],
3659
3694
  matchedPath: resultMappingPath,
@@ -3748,7 +3783,7 @@ ${selectionOpts}`);
3748
3783
  throw new Error("id is required");
3749
3784
  if (baseUrl !== "/" && baseUrl.endsWith("/"))
3750
3785
  throw new Error("baseUrl must not end with a slash");
3751
- const workspace = _workspace === "default" ? undefined : _workspace, tool = _tool === "default" ? undefined : _tool, id = getPublishedId(_id), stringifiedPath = Array.isArray(path) ? toString(jsonPathToStudioPath(path)) : path, searchParams = new URLSearchParams({
3786
+ const workspace = _workspace === "default" ? void 0 : _workspace, tool = _tool === "default" ? void 0 : _tool, id = getPublishedId(_id), stringifiedPath = Array.isArray(path) ? toString(jsonPathToStudioPath(path)) : path, searchParams = new URLSearchParams({
3752
3787
  baseUrl,
3753
3788
  id,
3754
3789
  type,
@@ -3860,7 +3895,7 @@ ${selectionOpts}`);
3860
3895
  result,
3861
3896
  resultSourceMap,
3862
3897
  ({ sourcePath, sourceDocument, resultPath, value }) => {
3863
- if ((typeof filter == "function" ? filter({ sourcePath, resultPath, filterDefault, sourceDocument, value }) : filterDefault({ sourcePath, resultPath, filterDefault, sourceDocument, value })) === false)
3898
+ if ((typeof filter == "function" ? filter({ sourcePath, resultPath, filterDefault, sourceDocument, value }) : filterDefault({ sourcePath, resultPath, value })) === false)
3864
3899
  return logger && report.skipped.push({
3865
3900
  path: prettyPathForLogging(sourcePath),
3866
3901
  value: `${value.slice(0, TRUNCATE_LENGTH)}${value.length > TRUNCATE_LENGTH ? "..." : ""}`,