1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1963],{1051:(e,t,r)=>{function i(e){return"object"==typeof e&&null!==e&&!Array.isArray(e)}r.d(t,{C:()=>a,Q:()=>l,u4:()=>i});var n={0:8203,1:8204,2:8205,3:8290,4:8291,5:8288,6:65279,7:8289,8:119155,9:119156,a:119157,b:119158,c:119159,d:119160,e:119161,f:119162},s={0:8203,1:8204,2:8205,3:65279},o=[,,,,].fill(String.fromCodePoint(s[0])).join("");function a(e,t,r="auto"){let i;return!0===r||"auto"===r&&(!(!Number.isNaN(Number(e))||/[a-z]/i.test(e)&&!/\d+(?:[-:\/]\d+){2}(?:T\d+(?:[-:\/]\d+){1,2}(\.\d+)?Z?)?/.test(e))&&Date.parse(e)||function(e){try{new URL(e,e.startsWith("/")?"https://acme.com":void 0)}catch{return!1}return!0}(e))?e:`${e}${i=JSON.stringify(t),`${o}${Array.from(i).map(e=>{let t=e.charCodeAt(0);if(t>255)throw Error(`Only ASCII edit info can be encoded. Error attempting to encode ${i} on character ${e} (${t})`);return Array.from(t.toString(4).padStart(4,"0")).map(e=>String.fromCodePoint(s[e])).join("")}).join("")}`}`}Object.fromEntries(Object.entries(s).map(e=>e.reverse())),Object.fromEntries(Object.entries(n).map(e=>e.reverse()));var u=`${Object.values(n).map(e=>`\\u{${e.toString(16)}}`).join("")}`,c=RegExp(`[${u}]{4,}`,"gu");function l(e){var t,r;return e&&JSON.parse({cleaned:(t=JSON.stringify(e)).replace(c,""),encoded:(null==(r=t.match(c))?void 0:r[0])||""}.cleaned)}},67277:(e,t,r)=>{r.r(t),r.d(t,{encodeIntoResult:()=>l,stegaEncodeSourceMap:()=>w,stegaEncodeSourceMap$1:()=>b});var i=r(1051);let n=/_key\s*==\s*['"](.*)['"]/;function s(e){if(!Array.isArray(e))throw Error("Path is not an array");return e.reduce((e,t,r)=>{let i=typeof t;if("number"===i)return`${e}[${t}]`;if("string"===i)return`${e}${0===r?"":"."}${t}`;if(("string"==typeof t?n.test(t.trim()):"object"==typeof t&&"_key"in t)&&t._key)return`${e}[_key=="${t._key}"]`;if(Array.isArray(t)){let[r,i]=t;return`${e}[${r}:${i}]`}throw Error(`Unsupported path segment \`${JSON.stringify(t)}\``)},"")}let o={"\f":"\\f","\n":"\\n","\r":"\\r"," ":"\\t","'":"\\'","\\":"\\\\"},a={"\\f":"\f","\\n":` 2`,"\\r":"\r","\\t":" ","\\'":"'","\\\\":"\\"};function u(e){let t,r=[],i=/\['(.*?)'\]|\[(\d+)\]|\[\?\(@\._key=='(.*?)'\)\]/g;for(;null!==(t=i.exec(e));){if(void 0!==t[1]){let e=t[1].replace(/\\(\\|f|n|r|t|')/g,e=>a[e]);r.push(e);continue}if(void 0!==t[2]){r.push(parseInt(t[2],10));continue}if(void 0!==t[3]){let e=t[3].replace(/\\(\\')/g,e=>a[e]);r.push({_key:e,_index:-1});continue}}return r}function c(e){return e.map(e=>{if("string"==typeof e||"number"==typeof e)return e;if(""!==e._key)return{_key:e._key};if(-1!==e._index)return e._index;throw Error(`invalid segment:${JSON.stringify(e)}`)})}function l(e,t,r){return function e(t,r,n=[]){if(null!==t&&Array.isArray(t))return t.map((t,s)=>{if((0,i.u4)(t)){let i=t._key;if("string"==typeof i)return e(t,r,n.concat({_key:i,_index:s}))}return e(t,r,n.concat(s))});if((0,i.u4)(t)){if("block"===t._type||"span"===t._type){let i={...t};return"block"===t._type?i.children=e(t.children,r,n.concat("children")):"span"===t._type&&(i.text=e(t.text,r,n.concat("text"))),i}return Object.fromEntries(Object.entries(t).map(([t,i])=>[t,e(i,r,n.concat(t))]))}return r(t,n)}(e,(e,i)=>{if("string"!=typeof e)return e;let n=function(e,t){var r;if(!t?.mappings)return;let i=(r=e.map(e=>{if("string"==typeof e||"number"==typeof e)return e;if(-1!==e._index)return e._index;throw Error(`invalid segment:${JSON.stringify(e)}`)}),`$${r.map(e=>"string"==typeof e?`['${e.replace(/[\f\n\r\t'\\]/g,e=>o[e])}']`:"number"==typeof e?`[${e}]`:""!==e._key?`[?(@._key=='${e._key.replace(/['\\]/g,e=>o[e])}')]`:`[${e._index}]`).join("")}`);if(void 0!==t.mappings[i])return{mapping:t.mappings[i],matchedPath:i,pathSuffix:""};let n=Object.entries(t.mappings).filter(([e])=>i.startsWith(e)).sort(([e],[t])=>t.length-e.length);if(0==n.length)return;let[s,a]=n[0],u=i.substring(s.length);return{mapping:a,matchedPath:s,pathSuffix:u}}(i,t);if(!n)return e;let{mapping:s,matchedPath:a}=n;if("value"!==s.type||"documentValue"!==s.source.type)return e;let c=t.documents[s.source.document],l=t.paths[s.source.path],h=u(a);return r({sourcePath:u(l).concat(i.slice(h.length)),sourceDocument:c,resultPath:i,value:e})})}let h="drafts.";function d(e){return e.startsWith(h)}function p(e){return e.startsWith("versions.")}let f=({sourcePath:e,resultPath:t,value:r})=>{if(function(e){return!!/^\d{4}-\d{2}-\d{2}/.test(e)&&!!Date.parse(e)}(r)||function(e){try{let{protocol:t}=new URL(e,e.startsWith("/")?"https://acme.com":void 0);return y.has(t)||t.startsWith("web+")}catch{return!1}}(r))return!1;let i=e.at(-1);return!("slug"===e.at(-2)&&"current"===i||"string"==typeof i&&(i.startsWith("_")||i.endsWith("Id"))||e.some(e=>"meta"===e||"metadata"===e||"openGraph"===e||"seo"===e)||m(e)||m(t)||"string"==typeof i&&g.has(i))},g=new Set(["color","colour","currency","email","format","gid","hex","href","hsl","hsla","icon","id","index","key","language","layout","link","linkAction","locale","lqip","page","path","ref","rgb","rgba","route","secret","slug","status","tag","template","theme","type","textTheme","unit","url","username","variant","website"]),y=new Set(["app:","data:","discord:","file:","ftp:","ftps:","geo:","http:","https:","imap:","javascript:","magnet:","mailto:","maps:","ms-excel:","ms-powerpoint:","ms-word:","slack:","sms:","spotify:","steam:","teams:","tel:","vscode:","zoom:"]);function m(e){return e.some(e=>"string"==typeof e&&null!==e.match(/type/i))}function w(e,t,r){let{filter:o,logger:a,enabled:u}=r;if(!u){let i="config.enabled must be true, don't call this function otherwise";throw a?.error?.(`[@sanity/client]: ${i}`,{result:e,resultSourceMap:t,config:r}),TypeError(i)}if(!t)return a?.error?.("[@sanity/client]: Missing Content Source Map from response body",{result:e,resultSourceMap:t,config:r}),e;if(!r.studioUrl){let i="config.studioUrl must be defined";throw a?.error?.(`[@sanity/client]: ${i}`,{result:e,resultSourceMap:t,config:r}),TypeError(i)}let g={encoded:[],skipped:[]},y=l(e,t,({sourcePath:e,sourceDocument:t,resultPath:n,value:u})=>{var l;let y;if(("function"==typeof o?o({sourcePath:e,resultPath:n,filterDefault:f,sourceDocument:t,value:u}):f({sourcePath:e,resultPath:n,value:u}))===!1)return a&&g.skipped.push({path:s(c(e)),value:`${u.slice(0,20)}${u.length>20?"...":""}`,length:u.length}),u;a&&g.encoded.push({path:s(c(e)),value:`${u.slice(0,20)}${u.length>20?"...":""}`,length:u.length});let{baseUrl:m,workspace:w,tool:b}=("/"!==(y="string"==typeof(l="function"==typeof r.studioUrl?r.studioUrl(t):r.studioUrl)?l:l.baseUrl)&&(y=y.replace(/\/$/,"")),"string"==typeof l?{baseUrl:y}:{...l,baseUrl:y});if(!m)return u;let{_id:v,_type:$,_projectId:q,_dataset:R}=t;return(0,i.C)(u,{origin:"sanity.io",href:function(e){let{baseUrl:t,workspace:r="default",tool:i="default",id:n,type:o,path:a,projectId:u,dataset:l}=e;if(!t)throw Error("baseUrl is required");if(!a)throw Error("path is required");if(!n)throw Error("id is required");if("/"!==t&&t.endsWith("/"))throw Error("baseUrl must not end with a slash");let f="default"===r?void 0:r,g="default"===i?void 0:i,y=p(n)?n.split(".").slice(2).join("."):d(n)?n.slice(h.length):n,m=Array.isArray(a)?s(c(a)):a,w=new URLSearchParams({baseUrl:t,id:y,type:o,path:m});if(f&&w.set("workspace",f),g&&w.set("tool",g),u&&w.set("projectId",u),l&&w.set("dataset",l),d(n)||p(n)){if(p(n)){let e=function(e){if(!p(e))return;let[t,r,...i]=e.split(".");return r}(n);w.set("perspective",e)}}else w.set("perspective","published");let b=["/"===t?"":t];f&&b.push(f);let v=["mode=presentation",`id=${y}`,`type=${o}`,`path=${encodeURIComponent(m)}`];return g&&v.push(`tool=${g}`),b.push("intent","edit",`${v.join(";")}?${w}`),b.join("/")}({baseUrl:m,workspace:w,tool:b,id:v,type:$,path:e,...!r.omitCrossDatasetReferenceData&&{dataset:R,projectId:q}})},!1)});if(a){let e=g.skipped.length,t=g.encoded.length;if((e||t)&&((a?.groupCollapsed||a.log)?.("[@sanity/client]: Encoding source map into result"),a.log?.(`[@sanity/client]: Paths encoded: ${g.encoded.length}, skipped: ${g.skipped.length}`)),g.encoded.length>0&&(a?.log?.("[@sanity/client]: Table of encoded paths"),(a?.table||a.log)?.(g.encoded)),g.skipped.length>0){let e=new Set;for(let{path:t}of g.skipped)e.add(t.replace(n,"0").replace(/\[\d+\]/g,"[]"));a?.log?.("[@sanity/client]: List of skipped paths",[...e.values()])}(e||t)&&a?.groupEnd?.()}return y}var b=Object.freeze({__proto__:null,stegaEncodeSourceMap:w})},79292:(e,t,r)=>{r.d(t,{A_:()=>y,C:()=>d,IM:()=>v,R8:()=>g,T4:()=>m,_S:()=>b,ct:()=>w,iz:()=>$});let i=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,n=/_key\s*==\s*['"](.*)['"]/,s=/^\d*:\d*$/;function o(e){return"number"==typeof e||"string"==typeof e&&/^\[\d+\]$/.test(e)}function a(e){return"string"==typeof e?n.test(e.trim()):"object"==typeof e&&"_key"in e}function u(e){if("string"==typeof e&&s.test(e))return!0;
2if(!Array.isArray(e)||2!==e.length)return!1;let[t,r]=e;return("number"==typeof t||""===t)&&("number"==typeof r||""===r)}function c(e){if(!Array.isArray(e))throw Error("Path is not an array");return e.reduce((e,t,r)=>{let i=typeof t;if("number"===i)return`${e}[${t}]`;if("string"===i)return`${e}${0===r?"":"."}${t}`;if(a(t)&&t._key)return`${e}[_key=="${t._key}"]`;if(Array.isArray(t)){let[r,i]=t;return`${e}[${r}:${i}]`}throw Error(`Unsupported path segment \`${JSON.stringify(t)}\``)},"")}function l(e){if("string"!=typeof e)throw Error("Path is not a string");let t=e.match(i);if(!t)throw Error("Invalid path string");return t.map(h)}function h(e){return o(e)?Number(e.replace(/[^\d]/g,"")):a(e)?{_key:e.match(n)[1]}:u(e)?function(e){let[t,r]=e.split(":").map(e=>""===e?e:Number(e));return[t,r]}(e):e}var d=Object.freeze({__proto__:null,fromString:l,get:function(e,t,r){let i="string"==typeof t?l(t):t;if(!Array.isArray(i))throw Error("Path must be an array or a string");let n=e;for(let e=0;e<i.length;e++){let t=i[e];if(o(t)){if(!Array.isArray(n))return r;n=n[t]}if(a(t)){if(!Array.isArray(n))return r;n=n.find(e=>e._key===t._key)}if("string"==typeof t&&(n="object"==typeof n&&null!==n?n[t]:void 0),typeof n>"u")return r}return n},isIndexSegment:o,isIndexTuple:u,isKeySegment:a,reKeySegment:n,toString:c});let p="drafts.",f="versions.";function g(e){return e.startsWith(p)}function y(e){return e.startsWith(f)}function m(e){return y(e)?p+v(e):g(e)?e:p+e}function w(e,t){if("drafts"===t||"published"===t)throw Error('Version can not be "published" or "drafts"');return`${f}${t}.${v(e)}`}function b(e){if(!y(e))return;let[t,r,...i]=e.split(".");return r}function v(e){return y(e)?e.split(".").slice(2).join("."):g(e)?e.slice(p.length):e}function $(e){let{baseUrl:t,workspace:r="default",tool:i="default",id:n,type:s,path:o,projectId:a,dataset:u}=e;if(!t)throw Error("baseUrl is required");if(!o)throw Error("path is required");if(!n)throw Error("id is required");if("/"!==t&&t.endsWith("/"))throw Error("baseUrl must not end with a slash");let l="default"===r?void 0:r,h="default"===i?void 0:i,d=v(n),p=Array.isArray(o)?c(o.map(e=>{if("string"==typeof e||"number"==typeof e)return e;if(""!==e._key)return{_key:e._key};if(-1!==e._index)return e._index;throw Error(`invalid segment:${JSON.stringify(e)}`)})):o,f=new URLSearchParams({baseUrl:t,id:d,type:s,path:p});if(l&&f.set("workspace",l),h&&f.set("tool",h),a&&f.set("projectId",a),u&&f.set("dataset",u),g(n)||y(n)){if(y(n)){let e=b(n);f.set("perspective",e)}}else f.set("perspective","published");let m=["/"===t?"":t];l&&m.push(l);let w=["mode=presentation",`id=${d}`,`type=${s}`,`path=${encodeURIComponent(p)}`];return h&&w.push(`tool=${h}`),m.push("intent","edit",`${w.join(";")}?${f}`),m.join("/")}},97837:(e,t,r)=>{r.d(t,{UU:()=>tz,u_:()=>P});var i=r(57533),n=r(51503),s=r(13882),o=r(77917),a=r(94865),u=r(16266),c=r(34718),l=r(20396),h=r(93808),d=r(82511),p=r(2910),f=r(77318),g=r(45191),y=r(39401),m=r(85698),w=r(74291),b=r(5812),v=r(48961),$=r(14913),q=r(25696),R=r(1051),E=r(82667),I=r(43815),_=r(79292),j=r(68464);let A=/\r\n|[\n\r\u2028\u2029]/;function T(e,t){let r=0;for(let i=0;i<t.length;i++){let n=t[i].length+1;if(r+n>e)return{line:i+1,column:e-r};r+=n}return{line:t.length,column:t[t.length-1]?.length??0}}class x extends Error{response;statusCode=400;responseBody;details;constructor(e,t){let r=S(e,t);super(r.message),Object.assign(this,r)}}class C extends Error{response;statusCode=500;responseBody;details;constructor(e){let t=S(e);super(t.message),Object.assign(this,t)}}function S(e,t){var r,i,n;let s=e.body,o={response:e,statusCode:e.statusCode,responseBody:(r=s,-1!==(e.headers["content-type"]||"").toLowerCase().indexOf("application/json")?JSON.stringify(r,null,2):r),message:"",details:void 0};if(!(0,R.u4)(s))return o.message=D(e,s),o;let a=s.error;if("string"==typeof a&&"string"==typeof s.message)return o.message=`${a} - ${s.message}`,o;if("object"!=typeof a||null===a)return"string"==typeof a?o.message=a:"string"==typeof s.message?o.message=s.message:o.message=D(e,s),o;if("type"in(i=a)&&"mutationError"===i.type&&"description"in i&&"string"==typeof i.description||"type"in(n=a)&&"actionError"===n.type&&"description"in n&&"string"==typeof n.description){let e=a.items||[],t=e.slice(0,5).map(e=>
2e.error?.description).filter(Boolean),r=t.length?`: 3- ${t.join(` 4- `)}`:"";return e.length>5&&(r+=` 5...and ${e.length-5} more`),o.message=`${a.description}${r}`,o.details=s.error,o}return O(a)?(o.message=k(a,t?.options?.query?.tag),o.details=s.error):"description"in a&&"string"==typeof a.description?(o.message=a.description,o.details=a):o.message=D(e,s),o}function O(e){return(0,R.u4)(e)&&"queryParseError"===e.type&&"string"==typeof e.query&&"number"==typeof e.start&&"number"==typeof e.end}function k(e,t){let{query:r,start:i,end:n,description:s}=e;if(!r||typeof i>"u")return`GROQ query parse error: ${s}`;let o=t?` 6 7Tag: ${t}`:"";return`GROQ query parse error: 8${function(e,t,r){let i=e.split(A),{start:n,end:s,markerLines:o}=function(e,t){let r={...e.start},i={...r,...e.end},n=r.line??-1,s=r.column??0,o=i.line,a=i.column,u=Math.max(n-3,0),c=Math.min(t.length,o+3);-1===n&&(u=0),-1===o&&(c=t.length);let l=o-n,h={};if(l)for(let e=0;e<=l;e++){let r=e+n;if(s)if(0===e){let e=t[r-1].length;h[r]=[s,e-s+1]}else if(e===l)h[r]=[0,a];else{let i=t[r-e].length;h[r]=[0,i]}else h[r]=!0}else s===a?s?h[n]=[s,0]:h[n]=!0:h[n]=[s,a-s];return{start:u,end:c,markerLines:h}}({start:T(t.start,i),end:t.end?T(t.end,i):void 0},i),a=`${s}`.length;return e.split(A,s).slice(n,s).map((e,t)=>{let i=n+1+t,s=` ${` ${i}`.slice(-a)} |`,u=o[i],c=!o[i+1];if(!u)return` ${s}${e.length>0?` ${e}`:""}`;let l="";if(Array.isArray(u)){let t=e.slice(0,Math.max(u[0]-1,0)).replace(/[^\t]/g," "),i=u[1]||1;l=[` 9 `,s.replace(/\d/g," ")," ",t,"^".repeat(i)].join(""),c&&r&&(l+=" "+r)}return[">",s,e.length>0?` ${e}`:"",l].join("")}).join(` 10`)}(r,{start:i,end:n},s)}${o}`}function D(e,t){var r,i;let n="string"==typeof t?` (${i=100,(r=t).length>100?`${r.slice(0,i)}\u2026`:r})`:"",s=e.statusMessage?` ${e.statusMessage}`:"";return`${e.method}-request to ${e.url} resulted in HTTP ${e.statusCode}${s}${n}`}class P extends Error{projectId;addOriginUrl;constructor({projectId:e}){super("CorsOriginError"),this.name="CorsOriginError",this.projectId=e;let t=new URL(`https://sanity.io/manage/project/${e}/api`);if("u">typeof location){let{origin:e}=location;t.searchParams.set("cors","add"),t.searchParams.set("origin",e),this.addOriginUrl=t,this.message=`The current origin is not allowed to connect to the Live Content API. Add it here: ${t}`}else this.message=`The current origin is not allowed to connect to the Live Content API. Change your configuration here: ${t}`}}let U={onResponse:(e,t)=>{if(e.statusCode>=500)throw new C(e);if(e.statusCode>=400)throw new x(e,t);return e}};function M(e,t={}){return(0,i.af)([(0,n.L5)({shouldRetry:V}),...e,function(e={}){let t={},r=t=>void 0!==e.ignoreWarnings&&(Array.isArray(e.ignoreWarnings)?e.ignoreWarnings:[e.ignoreWarnings]).some(e=>"string"==typeof e?t.includes(e):e instanceof RegExp&&e.test(t));return{onResponse:e=>{let i=e.headers["x-sanity-warning"];for(let e of Array.isArray(i)?i:[i])!e||t[e]||r(e)||(t[e]=!0,console.warn(e));return e}}}(t),(0,n.UX)(),(0,n.Yf)(),(0,n.qB)(),U,(0,n.sH)({implementation:s.c})])}function V(e,t,r){if(0===r.maxRetries)return!1;let i="GET"===r.method||"HEAD"===r.method,s=(r.uri||r.url).startsWith("/data/query"),o=e.response&&(429===e.response.statusCode||502===e.response.statusCode||503===e.response.statusCode);return(!!i||!!s)&&!!o||n.L5.shouldRetry(e,t,r)}function N(e){return"https://www.sanity.io/help/"+e}let L=["image","file"],z=["before","after","replace"],W=e=>{if(!/^(~[a-z0-9]{1}[-\w]{0,63}|[a-z0-9]{1}[-\w]{0,63})$/.test(e))throw Error("Datasets can only contain lowercase characters, numbers, underscores and dashes, and start with tilde, and be maximum 64 characters")},H=e=>{if(!/^[-a-z0-9]+$/i.test(e))throw Error("`projectId` can only contain only a-z, 0-9 and dashes")},G=e=>{if(-1===L.indexOf(e))throw Error(`Invalid asset type: ${e}. Must be one of ${L.join(", ")}`)},J=(e,t)=>{if(null===t||"object"!=typeof t||Array.isArray(t))throw Error(`${e}() takes an object of properties`)},B=(e,t)=>{if("string"!=typeof t||!/^[a-z0-9_][a-z0-9_.-]{0,127}$/i.test(t)||t.includes(".."))throw Error(`${e}(): "${t}" is not a valid document ID`)},F=(e,t)=>{if(!t._id)throw Error(`${e}() requires that the document contains an ID ("_id" property)`);B(e,t._id)},Q=(e,t)=>{if("string"!=typeof t)throw Error(`\`${e}()\`: \`${t}\` is not a valid document type`)},Y=(e,t)=>
10{if(!t._type)throw Error(`\`${e}()\` requires that the document contains a type (\`_type\` property)`);Q(e,t._type)},Z=(e,t)=>{if(t._id&&t._id!==e)throw Error(`The provided document ID (\`${t._id}\`) does not match the generated version ID (\`${e}\`)`)},X=(e,t,r)=>{let i="insert(at, selector, items)";if(-1===z.indexOf(e)){let e=z.map(e=>`"${e}"`).join(", ");throw Error(`${i} takes an "at"-argument which is one of: ${e}`)}if("string"!=typeof t)throw Error(`${i} takes a "selector"-argument which must be a string`);if(!Array.isArray(r))throw Error(`${i} takes an "items"-argument which must be an array`)},K=e=>{if(!e.dataset)throw Error("`dataset` must be provided to perform queries");return e.dataset||""},ee=e=>{if("string"!=typeof e||!/^[a-z0-9._-]{1,75}$/i.test(e))throw Error("Tag can only contain alphanumeric characters, underscores, dashes and dots, and be between one and 75 characters long.");return e},et=e=>{if(!e["~experimental_resource"])throw Error("`resource` must be provided to perform resource queries");let{type:t,id:r}=e["~experimental_resource"];switch(t){case"dataset":if(2!==r.split(".").length)throw Error('Dataset resource ID must be in the format "project.dataset"');return;case"dashboard":case"media-library":case"canvas":return;default:throw Error(`Unsupported resource type: ${t.toString()}`)}},er=(e,t)=>{if(t["~experimental_resource"])throw Error(`\`${e}\` does not support resource-based operations`)},ei=e=>(function(e){let t=!1,r;return(...i)=>(t||(r=e(...i),t=!0),r)})((...t)=>console.warn(e.join(" "),...t)),en=ei(["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"]),es=ei(["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."]),eo=ei(["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."]),ea=ei(["The `previewDrafts` perspective has been renamed to `drafts` and will be removed in a future API version"]),eu=ei(["You have configured Sanity client to use a token in the browser. This may cause unintentional security issues.",`See ${N("js-client-browser-token")} for more information and how to hide this warning.`]),ec=ei(["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`."]),el=ei(["Using the Sanity client without specifying an API version is deprecated.",`See ${N("js-client-api-version")}`]),eh=(ei(["The default export of @sanity/client has been deprecated. Use the named export `createClient` instead."]),ei(["You have called `createVersion()` with a defined `document`. The recommended approach is to provide a `baseId` and `releaseId` instead."])),ed={apiHost:"https://api.sanity.io",apiVersion:"1",useProjectHostname:!0,stega:{enabled:!1}},ep=["localhost","127.0.0.1","0.0.0.0"],ef=e=>-1!==ep.indexOf(e);function eg(e){if(Array.isArray(e)&&e.length>1&&e.includes("raw"))throw TypeError('Invalid API perspective value: "raw". The raw-perspective can not be combined with other perspectives')}let ey=(e,t)=>{let r={...t,...e,stega:{..."boolean"==typeof t.stega?{enabled:t.stega}:t.stega||ed.stega,..."boolean"==typeof e.stega?{enabled:e.stega}:e.stega||{}}};r.apiVersion||el();let i={...ed,...r},n=i.useProjectHostname&&!i["~experimental_resource"];if(typeof Promise>"u"){let e=N("js-client-promise-polyfill");throw Error(`No native Promise-implementation found, polyfill needed - see ${e}`)}if(n&&!i.projectId)throw Error("Configuration must contain `projectId`");if(i["~experimental_resource"]&&et(i),"u">typeof i.perspective&&eg(i.perspective),"encodeSourceMap"in i)throw Error("It looks like you're using options meant for '@sanity/preview-kit/client'. 'encodeSourceMap' is not supported in '@sanity/client'. Did you mean 'stega.enabled'?");if("encodeSourceMapAtPath"in i)throw Error("It looks like you're using options meant for '@sanity/preview-kit/client'. 'encodeSourceMapAtPath' is not supported in '@sanity/client'. Did you mean 'stega.filter'?");
10if("boolean"!=typeof i.stega.enabled)throw Error(`stega.enabled must be a boolean, received ${i.stega.enabled}`);if(i.stega.enabled&&void 0===i.stega.studioUrl)throw Error("stega.studioUrl must be defined when stega.enabled is true");if(i.stega.enabled&&"string"!=typeof i.stega.studioUrl&&"function"!=typeof i.stega.studioUrl)throw Error(`stega.studioUrl must be a string or a function, received ${i.stega.studioUrl}`);let s="u">typeof window&&window.location&&window.location.hostname,o=s&&ef(window.location.hostname),a=!!i.token;i.withCredentials&&a&&(ec(),i.withCredentials=!1),s&&o&&a&&!0!==i.ignoreBrowserTokenWarning?eu():typeof i.useCdn>"u"&&es(),n&&H(i.projectId),i.dataset&&W(i.dataset),"requestTagPrefix"in i&&(i.requestTagPrefix=i.requestTagPrefix?ee(i.requestTagPrefix).replace(/\.+$/,""):void 0),i.apiVersion=`${i.apiVersion}`.replace(/^v/,""),i.isDefaultApi=i.apiHost===ed.apiHost,!0===i.useCdn&&i.withCredentials&&en(),i.useCdn=!1!==i.useCdn&&!i.withCredentials,function(e){if("1"===e||"X"===e)return;let t=new Date(e);if(!(/^\d{4}-\d{2}-\d{2}$/.test(e)&&t instanceof Date&&t.getTime()>0))throw Error("Invalid API version string, expected `1` or date in format `YYYY-MM-DD`")}(i.apiVersion);let u=i.apiHost.split("://",2),c=u[0],l=u[1],h=i.isDefaultApi?"apicdn.sanity.io":l;return n?(i.url=`${c}://${i.projectId}.${l}/v${i.apiVersion}`,i.cdnUrl=`${c}://${i.projectId}.${h}/v${i.apiVersion}
10`):(i.url=`${i.apiHost}/v${i.apiVersion}`,i.cdnUrl=i.url),i};class em extends Error{name="ConnectionFailedError"}class ew extends Error{name="DisconnectError";reason;constructor(e,t,r={}){super(e,r),this.reason=t}}class eb extends Error{name="ChannelError";data;constructor(e,t){super(e),this.data=t}}class ev extends Error{name="MessageError";data;constructor(e,t,r={}){super(e,r),this.data=t}}class e$ extends Error{name="MessageParseError"}let eq=["channelError","disconnect"];function eR(e,t){return(0,o.v)(()=>{let t=e();return(0,a.A)(t)?t:(0,u.of)(t)}).pipe((0,c.Z)(e=>{var r,i;return r=e,i=t,new s.c(e=>{let t=i.includes("open"),n=i.includes("reconnect");function s(t){if("data"in t){let[r,i]=eE(t);e.error(r?new e$("Unable to parse EventSource error message",{cause:i}):new ev((i?.data).message,i));return}r.readyState===r.CLOSED?e.error(new em("EventSource connection failed")):n&&e.next({type:"reconnect"})}function o(){e.next({type:"open"})}function a(t){let[i,n]=eE(t);if(i)return void e.error(new e$("Unable to parse EventSource message",{cause:i}));if("channelError"===t.type){let t=new URL(r.url).searchParams.get("tag");e.error(new eb(function(e,t){let r=e.error;return r?O(r)?k(r,t):r.description?r.description:"string"==typeof r?r:JSON.stringify(r,null,2):e.message||"Unknown listener error"}(n?.data,t),n.data));return}if("disconnect"===t.type)return void e.error(new ew(`Server disconnected client: ${n.data?.reason||"unknown error"}`));e.next({type:t.type,id:t.lastEventId,...n.data?{data:n.data}:{}})}r.addEventListener("error",s),t&&r.addEventListener("open",o);let u=[...new Set([...eq,...i])].filter(e=>"error"!==e&&"open"!==e&&"reconnect"!==e);return u.forEach(e=>r.addEventListener(e,a)),()=>{r.removeEventListener("error",s),t&&r.removeEventListener("open",o),u.forEach(e=>r.removeEventListener(e,a)),r.close()}})}))}function eE(e){try{let t="string"==typeof e.data&&JSON.parse(e.data);return[null,{type:e.type,id:e.lastEventId,...!function(e){for(let t in e)return!1;return!0}(t)?{data:t}:{}}]}catch(e){return[e,null]}}function eI(e){if("string"==typeof e)return{id:e};if(Array.isArray(e))return{query:"*[_id in $ids]",params:{ids:e}};if("object"==typeof e&&null!==e&&"query"in e&&"string"==typeof e.query)return"params"in e&&"object"==typeof e.params&&null!==e.params?{query:e.query,params:e.params}:{query:e.query};let t=["* Document ID (<docId>)","* Array of document IDs","* Object containing `query`"].join(` 11`);throw Error(`Unknown selection - must be one of: 12 13${t}`)}class e_{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 J("diffMatchPatch",e),this._assign("diffMatchPatch",e)}unset(e){if(!Array.isArray(e))throw Error("unset(attrs) takes an array of attributes to unset, non-array given");return this.operations=Object.assign({},this.operations,{unset:e}),this}inc(e){return this._assign("inc",e)}dec(e){return this._assign("dec",e)}insert(e,t,r){return X(e,t,r),this._assign("insert",{[e]:t,items:r})}append(e,t){return this.insert("after",`${e}[-1]`,t)}prepend(e,t){return this.insert("before",`${e}[0]`,t)}splice(e,t,r,i){let n=t<0?t-1:t,s=typeof r>"u"||-1===r?-1:Math.max(0,t+r),o=`${e}[${n}:${n<0&&s>=0?"":s}]`;return this.insert("replace",o,i||[])}ifRevisionId(e){return this.operations.ifRevisionID=e,this}serialize(){return{...eI(this.selection),...this.operations}}toJSON(){return this.serialize()}reset(){return this.operations={},this}_assign(e,t,r=!0){return J(e,t),this.operations=Object.assign({},this.operations,{[e]:Object.assign({},r&&this.operations[e]||{},t)}),this}_set(e,t){return this._assign(e,t,!1)}}class ej extends e_{#e;constructor(e,t,r){super(e,t),this.#e=r}clone(){return new ej(this.selection,{...this.operations},this.#e)}commit(e){if(!this.#e)throw Error("No `client` passed to patch, either provide one or pass the patch to a clients `mutate()` method");let t=Object.assign({returnFirst:"string"==typeof this.selection,returnDocuments:!0},e);return this.#e.mutate({patch:this.serialize()},t)}}class eA extends e_{#e;constructor(e,t,r){super(e,t),this.#e=r}clone(){return new eA(this.selection,{...this.operations},this.#e)}commit(e){if(!this.#e)throw Error("No `client` passed to patch, either provide one or pass the patch to a clients `mutate()` method");let t=Object.assign({returnFirst:"string"==typeof this.selection,returnDocuments:!0},e);return this.#e.mutate({patch:this.serialize()},t)}}let eT={returnDocuments:!1};class ex{operations;trxId;constructor(e=[],t){this.operations=e,this.trxId=t}create(e){return J("create",e),this._add({create:e})}createIfNotExists(e){let t="createIfNotExists";return J(t,e),F(t,e),this._add({[t]:e})}createOrReplace(e){let t="createOrReplace";return J(t,e),F(t,e),this._add({[t]:e})}delete(e){return B("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 eC extends ex{#e;constructor(e,t,r){super(e,r),this.#e=t}clone(){return new eC([...this.operations],this.#e,this.trxId)}commit(e){if(!this.#e)throw 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},eT,e||{}))}patch(e,t){let r="function"==typeof t,i="string"!=typeof e&&e instanceof eA,n="object"==typeof e&&("query"in e||"id"in e);if(i)return this._add({patch:e.serialize()});if(r){let r=t(new eA(e,{},this.#e));if(!(r instanceof eA))throw Error("function passed to `patch()` must return the patch");return this._add({patch:r.serialize()})}if(n){let r=new eA(e,t||{},this.#e);return this._add({patch:r.serialize()})}return this._add({patch:{id:e,...t}})}}class eS extends ex{#e;constructor(e,t,r){super(e,r),this.#e=t}clone(){return new eS([...this.operations],this.#e,this.trxId)}commit(e){if(!this.#e)throw 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},eT,e||{}))}patch(e,t){let r="function"==typeof t;if("string"!=typeof e&&e instanceof ej)return this._add({patch:e.serialize()});if(r){let r=t(new ej(e,{},this.#e));if(!(r instanceof ej))throw Error("function passed to `patch()` must return the patch");return this._add({patch:r.serialize()})}return this._add({patch:{id:e,...t}})}}let eO=({query:e,params:t={},options:r={}})=>{let i=new URLSearchParams,{tag:n,includeMutations:s,returnQuery:o,...a}=r;for(let[r,s]of(n&&i.append("tag",n),i.append("query",e),Object.entries(t)))void 0!==s&&i.append(`$${r}`,JSON.stringify(s));for(let[e,t]of Object.entries(a))t&&i.append(e,`${t}`);return!1===o&&i.append("returnQuery","false"),!1===s&&i.append("includeMutations","fal
13se"),`?${i}`},ek=(e,t)=>!1===e?void 0:typeof e>"u"?t:e,eD=(e={})=>({dryRun:e.dryRun,returnIds:!0,returnDocuments:ek(e.returnDocuments,!0),visibility:e.visibility||"sync",autoGenerateArrayKeys:e.autoGenerateArrayKeys,skipCrossDatasetReferenceValidation:e.skipCrossDatasetReferenceValidation}),eP=e=>"response"===e.type,eU=e=>e.body,eM=(e,t)=>e.reduce((e,r)=>(e[t(r)]=r,e),Object.create(null));function eV(e,t,i,n,s={},o={}){let a="stega"in o?{...i||{},..."boolean"==typeof o.stega?{enabled:o.stega}:o.stega||{}}:i,u=a.enabled?(0,R.Q)(s):s,c=!1===o.filterResponse?e=>e:e=>e.result,{cache:h,next:d,...p}={useAbortSignal:"u">typeof o.signal,resultSourceMap:a.enabled?"withKeyArraySelector":o.resultSourceMap,...o,returnQuery:!1===o.filterResponse&&!1!==o.returnQuery},f=eK(e,t,"query",{query:n,params:u},"u">typeof h||"u">typeof d?{...p,fetch:{cache:h,next:d}}:p);return a.enabled?f.pipe((0,E.v)((0,l.H)(Promise.all([r.e(1541),r.e(4207),r.e(8201),r.e(533),r.e(547),r.e(4402),r.e(5942),r.e(7996),r.e(6493),r.e(3041),r.e(740),r.e(6598),r.e(2139),r.e(4954),r.e(1091),r.e(1512),r.e(3928),r.e(3289),r.e(1963),r.e(6931),r.e(5933),r.e(8883),r.e(3751),r.e(2976),r.e(6530),r.e(5066),r.e(2264)]).then(r.bind(r,67277)).then(function(e){return e.stegaEncodeSourceMap$1}).then(({stegaEncodeSourceMap:e})=>e))),(0,$.T)(([e,t])=>{let r=t(e.result,e.resultSourceMap,a);return c({...e,result:r})})):f.pipe((0,$.T)(c))}function eN(e,t,r,i={}){let n={uri:te(e,"doc",(()=>{if(!i.releaseId)return r;let e=(0,_._S)(r);if(!e){if((0,_.R8)(r))throw Error(`The document ID (\`${r}\`) is a draft, but \`options.releaseId\` is set as \`${i.releaseId}\``);return(0,_.ct)(r,i.releaseId)}if(e!==i.releaseId)throw Error(`The document ID (\`${r}\`) is already a version of \`${e}\` release, but this does not match the provided \`options.releaseId\` (\`${i.releaseId}\`)`);return r})()),json:!0,tag:i.tag,signal:i.signal,query:void 0!==i.includeAllVersions?{includeAllVersions:i.includeAllVersions}:void 0};return e6(e,t,n).pipe((0,I.p)(eP),(0,$.T)(e=>{let t=e.body.documents;return t?i.includeAllVersions?t:t[0]:i.includeAllVersions?[]:void 0}))}function eL(e,t,r,i={}){let n={uri:te(e,"doc",r.join(",")),json:!0,tag:i.tag,signal:i.signal};return e6(e,t,n).pipe((0,I.p)(eP),(0,$.T)(e=>{let t=eM(e.body.documents||[],e=>e._id);return r.map(e=>t[e]||null)}))}function ez(e,t,r,i={}){return eK(e,t,"query",{query:"*[sanity::partOfRelease($releaseId)]",params:{releaseId:r}},i)}function eW(e,t,r,i){return F("createIfNotExists",r),e0(e,t,r,"createIfNotExists",i)}function eH(e,t,r,i){return F("createOrReplace",r),e0(e,t,r,"createOrReplace",i)}function eG(e,t,r,i,n){return F("createVersion",r),Y("createVersion",r),eh(),eX(e,t,{actionType:"sanity.action.document.version.create",publishedId:i,document:r},n)}function eJ(e,t,r,i,n,s,o){if(!i)throw Error("`createVersion()` requires `baseId` when no `document` is provided");if(!r)throw Error("`createVersion()` requires `publishedId` when `baseId` is provided");return B("createVersion",i),B("createVersion",r),eX(e,t,{actionType:"sanity.action.document.version.create",publishedId:r,baseId:i,versionId:n?(0,_.ct)(r,n):(0,_.T4)(r),ifBaseRevisionId:s},o)}function eB(e,t,r,i){return eK(e,t,"mutate",{mutations:[{delete:eI(r)}]},i)}function eF(e,t,r,i=!1,n){return eX(e,t,{actionType:"sanity.action.document.version.discard",versionId:r,purge:i},n)}function eQ(e,t,r,i){return F("replaceVersion",r),Y("replaceVersion",r),eX(e,t,{actionType:"sanity.action.document.version.replace",document:r},i)}function eY(e,t,r,i,n){return eX(e,t,{actionType:"sanity.action.document.version.unpublish",versionId:r,publishedId:i},n)}function eZ(e,t,r,i){let n;return eK(e,t,"mutate",{mutations:Array.isArray(n=r instanceof eA||r instanceof ej?{patch:r.serialize()}:r instanceof eC||r instanceof eS?r.serialize():r)?n:[n],transactionId:i&&i.transactionId||void 0},i)}function eX(e,t,r,i){let n=Array.isArray(r)?r:[r],s=i&&i.transactionId||void 0;return eK(e,t,"actions",{actions:n,transactionId:s,skipCrossDatasetReferenceValidation:i&&i.skipCrossDatasetReferenceValidation||void 0,dryRun:i&&i.dryRun||void 0},i)}function eK(e,t,r,i,n={}){let s="mutate"===r,o="actions"===r,a=s||o?"":eO(i),u=!s&&!o&&a.length<11264,c=u?a:"",l=n.returnFirst,{timeout:h,token:d,tag:p,headers:f,returnQuery:g,lastLiveEventId:y,cacheMode:m}=n,w={method:u?"GET":"POST",uri:te(e,r,c),json:!0,body:u?void 0:i,query:s&&eD(n),timeout:h,headers:f,token:d,tag:p,returnQuery:g,perspective:n.perspective,resultSourceMap:n.resultSourceMap,lastLiveEventId:Array.isArray(y)?y[0]:y,cacheMode:m,canUseCdn:"query"===r,signal:n.signal,fetch:n.fetch,useAbortSignal:n.useAbortSignal,useCdn:n.useCdn};return e6(e,t,w).pipe((0,I.p)(eP),(0,$.T)(eU),(0,$.T)(e=>{if(!s)return e;let t=e.results||[];if(n.returnDocuments)return l?t[0]&&t[0].document:t.map(e=>e.document);let r=l?t[0]&&t[0].id:t.map(e=>e.id);return{transactionId:e.transactionId,results:t,[l?"documentId":"documentIds"]:r}}))}function e0(e,t,r,i,n={}){return eK(e,t,"mutate",{mutations:[{[i]:r}]},Object.assign({returnFirst:!0,returnDocuments:!0},n))}let e1=e=>void 0!==e.config().dataset&&void 0!==e.config().projectId||void 0!==e.config()["~experimental_resource"],e2=(e,t)=>e1(e)&&t.startsWith(te(e,"query")),e9=(e,t)=>
13e1(e)&&t.startsWith(te(e,"mutate")),e5=(e,t)=>e1(e)&&t.startsWith(te(e,"doc","")),e4=(e,t)=>e1(e)&&t.startsWith(te(e,"listen")),e8=(e,t)=>e1(e)&&t.startsWith(te(e,"history","")),e3=(e,t)=>t.startsWith("/data/")||e2(e,t)||e9(e,t)||e5(e,t)||e4(e,t)||e8(e,t);function e6(e,t,r){var i;let n=r.url||r.uri,o=e.config(),a=typeof r.canUseCdn>"u"?["GET","HEAD"].indexOf(r.method||"GET")>=0&&e3(e,n):r.canUseCdn,u=(r.useCdn??o.useCdn)&&a,c=r.tag&&o.requestTagPrefix?[o.requestTagPrefix,r.tag].join("."):r.tag||o.requestTagPrefix;if(c&&null!==r.tag&&(r.query={tag:ee(c),...r.query}),["GET","HEAD","POST"].indexOf(r.method||"GET")>=0&&e2(e,n)){let e=r.resultSourceMap??o.resultSourceMap;void 0!==e&&!1!==e&&(r.query={resultSourceMap:e,...r.query});let t=r.perspective||o.perspective;"u">typeof t&&("previewDrafts"===t&&ea(),eg(t),r.query={perspective:Array.isArray(t)?t.join(","):t,...r.query},(Array.isArray(t)&&t.length>0||"previewDrafts"===t||"drafts"===t)&&u&&(u=!1,eo())),r.lastLiveEventId&&(r.query={...r.query,lastLiveEventId:r.lastLiveEventId}),!1===r.returnQuery&&(r.query={returnQuery:"false",...r.query}),u&&"noStale"==r.cacheMode&&(r.query={cacheMode:"noStale",...r.query})}let l=function(e,t={}){let r={};e.headers&&Object.assign(r,e.headers);let i=t.token||e.token;i&&(r.Authorization=`Bearer ${i}`),t.useGlobalApi||e.useProjectHostname||!e.projectId||(r["X-Sanity-Project-ID"]=e.projectId);let n=!!(typeof t.withCredentials>"u"?e.withCredentials:t.withCredentials),s=typeof t.timeout>"u"?e.timeout:t.timeout;return Object.assign({},t,{headers:Object.assign({},r,t.headers||{}),timeout:typeof s>"u"?3e5:s,proxy:t.proxy||e.proxy,json:!0,withCredentials:n,fetch:"object"==typeof t.fetch&&"object"==typeof e.fetch?{...e.fetch,...t.fetch}:t.fetch||e.fetch})}(o,Object.assign({},r,{url:tt(e,n,u)})),h=new s.c(e=>t(l,o.requester).subscribe(e));return r.signal?h.pipe((i=r.signal,e=>new s.c(t=>{let r=()=>t.error(function(e){if(tr)return new DOMException(e?.reason??"The operation was aborted.","AbortError");let t=Error(e?.reason??"The operation was aborted.");return t.name="AbortError",t}(i));if(i&&i.aborted)return void r();let n=e.subscribe(t);return i.addEventListener("abort",r),()=>{i.removeEventListener("abort",r),n.unsubscribe()}}))):h}function e7(e,t,r){return e6(e,t,r).pipe((0,I.p)(e=>"response"===e.type),(0,$.T)(e=>e.body))}function te(e,t,r){let i=e.config();if(i["~experimental_resource"]){et(i);let e=ti(i),n=void 0!==r?`${t}/${r}`:t;return`${e}/${n}`.replace(/\/($|\?)/,"$1")}let n=K(i),s=`/${t}/${n}`;return`/data${void 0!==r?`${s}/${r}`:s}`.replace(/\/($|\?)/,"$1")}function tt(e,t,r=!1){let{url:i,cdnUrl:n}=e.config();return`${r?n:i}/${t.replace(/^\//,"")}`}let tr=!!globalThis.DOMException,ti=e=>{if(!e["~experimental_resource"])throw Error("`resource` must be provided to perform resource queries");let{type:t,id:r}=e["~experimental_resource"];switch(t){case"dataset":{let e=r.split(".");if(2!==e.length)throw Error('Dataset ID must be in the format "project.dataset"');return`/projects/${e[0]}/datasets/${e[1]}`}case"canvas":return`/canvases/${r}`;case"media-library":return`/media-libraries/${r}`;case"dashboard":return`/dashboards/${r}`;default:throw Error(`Unsupported resource type: ${t.toString()}`)}};function tn(e,t,r){let i=K(e.config());return e7(e,t,{method:"POST",uri:`/agent/action/generate/${i}`,body:r})}function ts(e,t,r){let i=K(e.config());return e7(e,t,{method:"POST",uri:`/agent/action/transform/${i}`,body:r})}function to(e,t,r){let i=K(e.config());return e7(e,t,{method:"POST",uri:`/agent/action/translate/${i}`,body:r})}class ta{#e;#t;constructor(e,t){this.#e=e,this.#t=t}generate(e){return tn(this.#e,this.#t,e)}transform(e){return ts(this.#e,this.#t,e)}translate(e){return to(this.#e,this.#t,e)}}class tu{#e;#t;constructor(e,t){this.#e=e,this.#t=t}generate(e){return(0,h.s)(tn(this.#e,this.#t,e))}transform(e){return(0,h.s)(ts(this.#e,this.#t,e))}translate(e){return(0,h.s)(to(this.#e,this.#t,e))}prompt(e){return(0,h.s)(function(e,t,r){let i=K(e.config());return e7(e,t,{method:"POST",uri:`/agent/action/prompt/${i}`,body:r})}(this.#e,this.#t,e))}patch(e){return(0,h.s)(function(e,t,r){let i=K(e.config());return e7(e,t,{method:"POST",uri:`/agent/action/patch/${i}`,body:r})}(this.#e,this.#t,e))}}class tc{#e;#t;constructor(e,t){this.#e=e,this.#t=t}upload(e,t,r){return th(this.#e,this.#t,e,t,r)}}class tl{#e;#t;constructor(e,t){this.#e=e,this.#t=t}upload(e,t,r){let i=th(this.#e,this.#t,e,t,r);return(0,h.s)(i.pipe((0,I.p)(e=>"response"===e.type),(0,$.T)(e=>e.body.document)))}}function th(e,t,r,i,n={}){var s,o;G(r);let a=n.extract||void 0;a&&!a.length&&(a=["none"]);let u=e.config(),c=(s=n,o=i,!(typeof File>"u")&&o instanceof File?Object.assign({filename:!1===s.preserveFilename?void 0:o.name,contentType:o.type},s):s),{tag:l,label:h,title:d,description:p,creditLine:f,filename:g,source:y}=c,m={label:h,title:d,description:p,filename:g,meta:a,creditLine:f};return y&&(m.sourceId=y.id,m.sourceName=y.name,m.sourceUrl=y.url),e6(e,t,{tag:l,method:"POST",timeout:c.timeout||0,uri:function(e,t){let r="image"===t?"images":"files";if(e["~experimental_resource"]){let{type:t,id:i}=e["~experimental_resource"];switch(t){case"dataset":throw Error("Assets are not supported for dataset resources, yet. Configure the client with `{projectId: <projectId>, dataset: <datasetId>}` instead.");case"canvas":return`/canvases/${i}/assets/${r}`;case"media-library":return`/media-libraries/${i}/upload`;case"dashboard":return`/dashboards/${i}/assets/${r}`;default:throw Error(`Unsupported resource type: ${t.toString()}`)}}let i=K(e);return`assets/${r}/${i}`}(u,r),headers:c.contentType?{"Content-Type":c.contentType}:{},query:m,body:i})}var td=(e,t)=>Object.keys(t).concat(Object.keys(e)).reduce((r,i)=>(r[i]=typeof e[i]>"u"?t[i]:e[i],r),{});let tp=(e,t)=>t.reduce((t,r)=>(typeof e[r]>"u"||(t[r]=e[r]),t),{}),tf=(0,o.v)(()=>r.e(6101).then(r.t.bind(r,6101,19))).pipe((0,$.T)(({default:e})=>e),(0,d.t)(1));function tg(){return function(e){return e.pipe((0,p.W)((e,t)=>e instanceof em?(0,f.x)((0,u.of)({type:"reconnect"}),(0,g.O)(1e3).pipe((0,c.Z)(()=>t))):(0,y.$)(()=>e)))}}let ty=["includePreviousRevision","includeResult","includeMutations","includeAllVersions","visibility","effectFormat","tag"],tm={includeResult:!0};function tw(e,t,r={}){let{url:i,token:n,withCredentials:s,requestTagPrefix:o,headers:a}=this.config(),c=r.tag&&o?[o,r.tag].join("."):r.tag,l={...td(r,tm),tag:c},h=eO({query:e,params:t,options:{tag:c,...tp(l,ty)}}),d=`${i}${te(this,"listen",h)}`;if(d.length>14800)return(0,y.$)(()=>Error("Query too large for listener"));let p=l.events?l.events:["mutation"],f={};return s&&(f.withCredentials=!0),(n||a)&&(f.headers={},n&&(f.headers.Authorization=`Bearer ${n}`),a&&Object.assign(f.headers,a)),eR(()=>(typeof EventSource>"u"||f.headers?tf:(0,u.of)(EventSource)).pipe((0,$.T)(e=>
13new e(d,f))),p).pipe(tg(),(0,I.p)(e=>p.includes(e.type)),(0,$.T)(e=>({type:e.type,..."data"in e?e.data:{}})))}let tb="2021-03-25";class tv{#e;constructor(e){this.#e=e}events({includeDrafts:e=!1,tag:t}={}){var r,i,n,o;er("live",this.#e.config());let{projectId:a,apiVersion:l,token:h,withCredentials:d,requestTagPrefix:f,headers:g}=this.#e.config(),y=l.replace(/^v/,"");if("X"!==y&&y<tb)throw Error(`The live events API requires API version ${tb} or later. The current API version is ${y}. Please update your API version to use this feature.`);if(e&&!h&&!d)throw Error("The live events API requires a token or withCredentials when 'includeDrafts: true'. Please update your client configuration. The token should have the lowest possible access role.");let q=te(this.#e,"live/events"),R=new URL(this.#e.getUrl(q,!1)),E=t&&f?[f,t].join("."):t;E&&R.searchParams.set("tag",E),e&&R.searchParams.set("includeDrafts","true");let I={};e&&d&&(I.withCredentials=!0),(e&&h||g)&&(I.headers={},e&&h&&(I.headers.Authorization=`Bearer ${h}`),g&&Object.assign(I.headers,g));let _=`${R.href}::${JSON.stringify(I)}`,j=t$.get(_);if(j)return j;let A=eR(()=>(typeof EventSource>"u"||I.headers?tf:(0,u.of)(EventSource)).pipe((0,$.T)(e=>
13new e(R.href,I))),["message","restart","welcome","reconnect","goaway"]),T=(i=R,n={method:"OPTIONS",mode:"cors",credentials:I.withCredentials?"include":"omit",headers:I.headers},new s.c(e=>{let t=new AbortController,r=t.signal;return fetch(i,{...n,signal:t.signal}).then(t=>{e.next(t),e.complete()},t=>{r.aborted||e.error(t)}),()=>t.abort()})).pipe((0,p.W)(()=>{throw new P({projectId:a})})),x=A.pipe(tg(),(0,c.Z)(e=>"reconnect"===e.type?T.pipe((0,c.Z)(()=>(0,u.of)(e))):(0,u.of)(e)),(0,p.W)(e=>T.pipe((0,c.Z)(()=>{throw e}))),(0,$.T)(e=>{if("message"===e.type){let{data:t,...r}=e;return{...r,tags:t.tags}}return e})).pipe((0,w.j)(()=>t$.delete(_)),(o="function"==typeof(r={predicate:e=>"welcome"===e.type})?{predicate:r,...void 0}:r,e=>{let t,r=!1,{predicate:i,...n}=o,a=e.pipe((0,m.M)(e=>{o.predicate(e)&&(r=!0,t=e)}),(0,w.j)(()=>{r=!1,t=void 0}),(0,b.u)(n)),u=new s.c(e=>{r&&e.next(t),e.complete()});return(0,v.h)(a,u)}));return t$.set(_,x),x}}let t$=new Map;class tq{#e;#t;constructor(e,t){this.#e=e,this.#t=t}create(e,t){return tE(this.#e,this.#t,"PUT",e,t)}edit(e,t){return tE(this.#e,this.#t,"PATCH",e,t)}delete(e){return tE(this.#e,this.#t,"DELETE",e)}list(){er("dataset",this.#e.config());let e=this.#e.config(),t=e.projectId,r="/datasets";return!1===e.useProjectHostname&&(r=`/projects/${t}/datasets`),e7(this.#e,this.#t,{uri:r,tag:null})}}class tR{#e;#t;constructor(e,t){this.#e=e,this.#t=t}create(e,t){return er("dataset",this.#e.config()),(0,h.s)(tE(this.#e,this.#t,"PUT",e,t))}edit(e,t){return er("dataset",this.#e.config()),(0,h.s)(tE(this.#e,this.#t,"PATCH",e,t))}delete(e){return er("dataset",this.#e.config()),(0,h.s)(tE(this.#e,this.#t,"DELETE",e))}list(){er("dataset",this.#e.config());let e=this.#e.config(),t=e.projectId,r="/datasets";return!1===e.useProjectHostname&&(r=`/projects/${t}/datasets`),(0,h.s)(e7(this.#e,this.#t,{uri:r,tag:null}))}}function tE(e,t,r,i,n){return er("dataset",e.config()),W(i),e7(e,t,{method:r,uri:`/datasets/${i}`,body:n,tag:null})}class tI{#e;#t;constructor(e,t){this.#e=e,this.#t=t}getPlaybackInfo(e,t={}){var r,i;let n=this.#e.config()["~experimental_resource"]?.id,{instanceId:s,library
13Id:o}=function(e){let t="object"==typeof e&&"_ref"in e?e._ref:e,r=tj.exec(t);if(r){let[,e,t]=r;return{libraryId:e,instanceId:t}}if("string"==typeof e&&e.startsWith("video-"))return{instanceId:e};throw Error(`Invalid video asset instance identifier "${t}": must be a valid video instance id or a Global Dataset Reference (GDR) to the video asset in the Media Library`)}(e),a=o||n;if(!a)throw Error("Could not determine Media Library ID - you need to provide a valid Media Library ID in the client config or a Media Library GDR");let u=(r=s,i=a,`/media-libraries/${i}/video/${r}/playback-info`),c=function(e){let t={};if(e.transformations){let{thumbnail:r,animated:i,storyboard:n}=e.transformations;r&&(r.width&&(t.thumbnailWidth=r.width),r.height&&(t.thumbnailHeight=r.height),void 0!==r.time&&(t.thumbnailTime=r.time),r.fit&&(t.thumbnailFit=r.fit),r.format&&(t.thumbnailFormat=r.format)),i&&(i.width&&(t.animatedWidth=i.width),i.height&&(t.animatedHeight=i.height),void 0!==i.start&&(t.animatedStart=i.start),void 0!==i.end&&(t.animatedEnd=i.end),i.fps&&(t.animatedFps=i.fps),i.format&&(t.animatedFormat=i.format)),n&&n.format&&(t.storyboardFormat=n.format)}return e.expiration&&(t.expiration=e.expiration),t}(t);return e7(this.#e,this.#t,{method:"GET",uri:u,query:c})}}class t_{#e;#t;constructor(e,t){this.#e=e,this.#t=t}getPlaybackInfo(e,t={}){return(0,h.s)(new tI(this.#e.observable,this.#t).getPlaybackInfo(e,t))}}let tj=/^media-library:(ml[^:]+):([^:]+)$/;class tA{#e;#t;constructor(e,t){this.#e=e,this.#t=t}list(e){let t={};return e?.includeMembers===!1&&(t.includeMembers="false"),e?.organizationId&&(t.organizationId=e.organizationId),e7(this.#e,this.#t,{uri:"/projects",query:t})}getById(e){return e7(this.#e,this.#t,{uri:`/projects/${e}`})}}class tT{#e;#t;constructor(e,t){this.#e=e,this.#t=t}list(e){let t={};return e?.includeMembers===!1&&(t.includeMembers="false"),e?.organizationId&&(t.organizationId=e.organizationId),(0,h.s)(e7(this.#e,this.#t,{uri:"/projects",query:t}))}getById(e){return(0,h.s)(e7(this.#e,this.#t,{uri:`/projects/${e}`}))}}let tx=(0,j.d_)("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789",8),tC=(e,t)=>t?(0,_.ct)(e,t):(0,_.T4)(e);function tS(e,{releaseId:t,publishedId:r,document:i}){if(r&&i._id){let e=tC(r,t);return Z(e,i),e}if(i._id){let r=(0,_.R8)(i._id),n=(0,_.A_)(i._id);if(!r&&!n)throw Error(`\`${e}()\` requires a document with an \`_id\` that is a version or draft ID`);if(t){if(r)throw Error(`\`${e}()\` was called with a document ID (\`${i._id}\`) that is a draft ID, but a release ID (\`${t}\`) was also provided.`);let n=(0,_._S)(i._id);if(n!==t)throw Error(`\`${e}()\` was called with a document ID (\`${i._id}\`) that is a version ID, but the release ID (\`${t}\`) does not match the document's version ID (\`${n}\`).`)}return i._id}if(r)return tC(r,t);throw Error(`\`${e}()\` requires either a publishedId or a document with an \`_id\``)}let tO=(e,t)=>{if("object"==typeof e&&null!==e&&("releaseId"in e||"metadata"in e)){let{releaseId:r=tx(),metadata:i={}}=e;return[r,i,t]}return[tx(),{},e]},tk=(e,t)=>{let[r,i,n]=tO(e,t);return{action:{actionType:"sanity.action.release.create",releaseId:r,metadata:{...i,releaseType:i.releaseType||"undecided"}},options:n}};class tD{#e;#t;constructor(e,t){this.#e=e,this.#t=t}get({releaseId:e},t){return eN(this.#e,this.#t,`_.releases.${e}`,t)}create(e,t){let{action:r,options:i}=tk(e,t),{releaseId:n,metadata:s}=r;return eX(this.#e,this.#t,r,i).pipe((0,$.T)(e=>({...e,releaseId:n,metadata:s})))}edit({releaseId:e,patch:t},r){return eX(this.#e,this.#t,{actionType:"sanity.action.release.edit",releaseId:e,patch:t},r)}publish({releaseId:e},t){return eX(this.#e,this.#t,{actionType:"sanity.action.release.publish",releaseId:e},t)}archive({releaseId:e},t){return eX(this.#e,this.#t,{actionType:"sanity.action.release.archive",releaseId:e},t)}unarchive({releaseId:e},t){return eX(this.#e,this.#t,{actionType:"sanity.action.release.unarchive",releaseId:e},t)}schedule({releaseId:e,publishAt:t},r){return eX(this.#e,this.#t,{actionType:"sanity.action.release.schedule",releaseId:e,publishAt:t},r)}unschedule({releaseId:e},t){return eX(this.#e,this.#t,{actionType:"sanity.action.release.unschedule",releaseId:e},t)}delete({releaseId:e},t){return eX(this.#e,this.#t,{actionType:"sanity.action.release.delete",releaseId:e},t)}fetchDocuments({releaseId:e},t){return ez(this.#e,this.#t,e,t)}}class tP{#e;#t;constructor(e,t){this.#e=e,this.#t=t}get({releaseId:e},t){return(0,h.s)(eN(this.#e,this.#t,`_.releases.${e}`,t))}async create(e,t){let{action:r,options:i}=tk(e,t),{releaseId:n,metadata:s}=r;return{...await (0,h.s)(eX(this.#e,this.#t,r,i)),releaseId:n,metadata:s}}edit({releaseId:e,patch:t},r){return(0,h.s)(eX(this.#e,this.#t,{actionType:"sanity.action.release.edit",releaseId:e,patch:t},r))}publish({releaseId:e},t){return(0,h.s)(eX(this.#e,this.#t,{actionType:"sanity.action.release.publish",releaseId:e},t))}archive({releaseId:e},t){return(0,h.s)(eX(this.#e,this.#t,{actionType:"sanity.action.release.archive",releaseId:e},t))}unarchive({releaseId:e},t){return(0,h.s)(eX(this.#e,this.#t,{actionType:"sanity.action.release.unarchive",releaseId:e},t))}schedule({releaseId:e,publishAt:t},r){return(0,h.s)(eX(this.#e,this.#t,{actionType:"sanity.action.release.schedule",releaseId:e,publishAt:t},r))}unschedule({releaseId:e},t){return(0,h.s)(eX(this.#e,this.#t,{actionType:"sanity.action.release.unschedule",releaseId:e},t))}delete({releaseId:e},t){return(0,h.s)(eX(this.#e,this.#t,{actionType:"sanity.action.release.delete",releaseId:e},t))}fetchDocuments({releaseId:e},t){return(0,h.s)(ez(this.#e,this.#t,e,t))}}class tU{#e;#t;constructor(e,t){this.#e=e,this.#t=t}getById(e){return e7(this.#e,this.#t,{uri:`/users/${e}`})}}class tM{#e;#t;constructor(e,t){this.#e=e,this.#t=t}getById(e){return(0,h.s)(e7(this.#e,this.#t,{uri:`/users/${e}`}))}}class tV{assets;datasets;live;mediaLibrary;projects;users;agent;releases;#r;#t;listen=tw;constructor(e,t=ed){this.config(t),this.#t=e,this.assets=new tc(this,this.#t),this.datasets=new tq(this,this.#t),this.live=new tv
13(this),this.mediaLibrary={video:new tI(this,this.#t)},this.projects=new tA(this,this.#t),this.users=new tU(this,this.#t),this.agent={action:new ta(this,this.#t)},this.releases=new tD(this,this.#t)}clone(){return new tV(this.#t,this.config())}config(e){if(void 0===e)return{...this.#r};if(this.#r&&!1===this.#r.allowReconfigure)throw Error("Existing client instance cannot be reconfigured - use `withConfig(newConfig)` to return a new client");return this.#r=ey(e,this.#r||{}),this}withConfig(e){let t=this.config();return new tV(this.#t,{...t,...e,stega:{...t.stega||{},..."boolean"==typeof e?.stega?{enabled:e.stega}:e?.stega||{}}})}fetch(e,t,r){return eV(this,this.#t,this.#r.stega,e,t,r)}getDocument(e,t){if(t?.includeAllVersions===!0)return eN(this,this.#t,e,{...t,includeAllVersions:!0});let r={signal:t?.signal,tag:t?.tag,releaseId:t?.releaseId,...t&&"includeAllVersions"in t?{includeAllVersions:!1}:{}};return eN(this,this.#t,e,r)}getDocuments(e,t){return eL(this,this.#t,e,t)}create(e,t){return e0(this,this.#t,e,"create",t)}createIfNotExists(e,t){return eW(this,this.#t,e,t)}createOrReplace(e,t){return eH(this,this.#t,e,t)}createVersion({document:e,publishedId:t,releaseId:r,baseId:i,ifBaseRevisionId:n},s){if(!e)return eJ(this,this.#t,t,i,r,n,s);let o=tS("createVersion",{document:e,publishedId:t,releaseId:r}),a={...e,_id:o},u=t||(0,_.IM)(e._id);return eG(this,this.#t,a,u,s)}delete(e,t){return eB(this,this.#t,e,t)}discardVersion({releaseId:e,publishedId:t},r,i){let n=tC(t,e);return eF(this,this.#t,n,r,i)}replaceVersion({document:e,publishedId:t,releaseId:r},i){let n=tS("replaceVersion",{document:e,publishedId:t,releaseId:r}),s={...e,_id:n};return eQ(this,this.#t,s,i)}unpublishVersion({releaseId:e,publishedId:t},r){let i=(0,_.ct)(t,e);return eY(this,this.#t,i,t,r)}mutate(e,t){return eZ(this,this.#t,e,t)}patch(e,t){return new ej(e,t,this)}transaction(e){return new eS(e,this)}action(e,t){return eX(this,this.#t,e,t)}request(e){return e7(this,this.#t,e)}getUrl(e,t){return tt(this,e,t)}getDataUrl(e,t){return te(this,e,t)}}class tN{assets;datasets;live;mediaLibrary;projects;users;agent;releases;observable;#r;#t;listen=tw;constructor(e,t=ed){this.config(t),this.#t=e,this.assets=new tl(this,this.#t),this.datasets=new tR(this,this.#t),this.live=new tv(this),this.mediaLibrary={video:new t_(this,this.#t)},this.projects=new tT(this,this.#t),this.users=new tM(this,this.#t),this.agent={action:new tu(this,this.#t)},this.releases=new tP(this,this.#t),this.observable=new tV(e,t)}clone(){return new tN(this.#t,this.config())}config(e){if(void 0===e)return{...this.#r};if(this.#r&&!1===this.#r.allowReconfigure)throw Error("Existing client instance cannot be reconfigured - use `withConfig(newConfig)` to return a new client");return this.observable&&this.observable.config(e),this.#r=ey(e,this.#r||{}),this}withConfig(e){let t=this.config();return new tN(this.#t,{...t,...e,stega:{...t.stega||{},..."boolean"==typeof e?.stega?{enabled:e.stega}:e?.stega||{}}})}fetch(e,t,r){return(0,h.s)(eV(this,this.#t,this.#r.stega,e,t,r))}getDocument(e,t){if(t?.includeAllVersions===!0)return(0,h.s)(eN(this,this.#t,e,{...t,includeAllVersions:!0}));let r={signal:t?.signal,tag:t?.tag,releaseId:t?.releaseId,...t&&"includeAllVersions"in t?{includeAllVersions:!1}:{}};return(0,h.s)(eN(this,this.#t,e,r))}getDocuments(e,t){return(0,h.s)(eL(this,this.#t,e,t))}create(e,t){return(0,h.s)(e0(this,this.#t,e,"create",t))}createIfNotExists(e,t){return(0,h.s)(eW(this,this.#t,e,t))}createOrReplace(e,t){return(0,h.s)(eH(this,this.#t,e,t))}createVersion({document:e,publishedId:t,releaseId:r,baseId:i,ifBaseRevisionId:n},s){if(!e)return(0,q._)(eJ(this,this.#t,t,i,r,n,s));let o=tS("createVersion",{document:e,publishedId:t,releaseId:r}),a={...e,_id:o},u=t||(0,_.IM)(e._id);return(0,q._)(eG(this,this.#t,a,u,s))}delete(e,t){return(0,h.s)(eB(this,this.#t,e,t))}discardVersion({releaseId:e,publishedId:t},r,i){let n=tC(t,e);return(0,h.s)(eF(this,this.#t,n,r,i))}replaceVersion({document:e,publishedId:t,releaseId:r},i){let n=tS("replaceVersion",{document:e,publishedId:t,releaseId:r}),s={...e,_id:n};return(0,q._)(eQ(this,this.#t,s,i))}unpublishVersion({releaseId:e,publishedId:t},r){let i=(0,_.ct)(t,e);return(0,h.s)(eY(this,this.#t,i,t,r))}mutate(e,t){return(0,h.s)(eZ(this,this.#t,e,t))}patch(e,t){return new eA(e,t,this)}transaction(e){return new eC(e,this)}action(e,t){return(0,h.s)(eX(this,this.#t,e,t))}request(e){return(0,h.s)(e7(this,this.#t,e))}dataRequest(e,t,r){return(0,h.s)(eK(this,this.#t,e,t,r))}getUrl(e,t){return tt(this,e,t)}getDataUrl(e,t){return te(this,e,t)}}let tL=function(e,t){return{requester:M(e),createClient:r=>{let i=M(e,{ignoreWarnings:r.ignoreWarnings});return new t((e,t)=>
13(t||i)({maxRedirects:0,maxRetries:r.maxRetries,retryDelay:r.retryDelay,...e}),r)}}}([],tN),tz=(tL.requester,tL.createClient)}}]);
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.