1!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},t=(new e.Error).stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="5bdc8aa4-ecbc-46b4-b2cc-f86ae093f0b8",e._sentryDebugIdIdentifier="sentry-dbid-5bdc8aa4-ecbc-46b4-b2cc-f86ae093f0b8")}catch(e){}}();"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7223],{1150:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"default",{enumerable:!0,get:function(){return u}});let s=r(95155),n=r(12115),i=r(24437);function a(e){return{default:e&&"default"in e?e.default:e}}r(36552);let o={loader:()=>Promise.resolve(a(()=>null)),loading:null,ssr:!0},u=function(e){let t={...o,...e},r=(0,n.lazy)(()=>t.loader().then(a)),u=t.loading;function c(e){let a=u?(0,s.jsx)(u,{isLoading:!0,pastDelay:!0,error:null}):null,o=!t.ssr||!!t.loading,c=o?n.Suspense:n.Fragment,l=t.ssr?(0,s.jsxs)(s.Fragment,{children:[null,(0,s.jsx)(r,{...e})]}):(0,s.jsx)(i.BailoutToCSR,{reason:"next/dynamic",children:(0,s.jsx)(r,{...e})});return(0,s.jsx)(c,{...o?{fallback:a}:{},children:l})}return c.displayName="LoadableComponent",c}},8567:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"workAsyncStorage",{enumerable:!0,get:function(){return s.workAsyncStorageInstance}});let s=r(17828)},13068:(e,t,r)=>{let s;r.d(t,{V2:()=>T,FS:()=>S,IM:()=>_,Tx:()=>x,Rr:()=>O,vd:()=>k,_K:()=>j,CC:()=>E,RM:()=>P,Uc:()=>D,tP:()=>C});let n={randomUUID:"undefined"!=typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)},i=new Uint8Array(16),a=[];for(let e=0;e<256;++e)a.push((e+256).toString(16).slice(1));let o=function(e,t,r){if(n.randomUUID&&!t&&!e)return n.randomUUID();let o=(e=e||{}).random??e.rng?.()??function(){if(!s){if("undefined"==typeof crypto||!crypto.getRandomValues)throw Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");s=crypto.getRandomValues.bind(crypto)}return s(i)}();if(o.length<16)throw Error("Random bytes length must be >= 16");if(o[6]=15&o[6]|64,o[8]=63&o[8]|128,t){if((r=r||0)<0||r+16>t.length)throw RangeError(`UUID byte range ${r}:${r+15} is out of buffer bounds`);for(let e=0;e<16;++e)t[r+e]=o[e];return t}return function(e,t=0){return(a[e[t+0]]+a[e[t+1]]+a[e[t+2]]+a[e[t+3]]+"-"+a[e[t+4]]+a[e[t+5]]+"-"+a[e[t+6]]+a[e[t+7]]+"-"+a[e[t+8]]+a[e[t+9]]+"-"+a[e[t+10]]+a[e[t+11]]+a[e[t+12]]+a[e[t+13]]+a[e[t+14]]+a[e[t+15]]).toLowerCase()}(o)};var u=r(40609),c=r(39139),l=r(17007),d=r(82448),h=r(68826),p=r(78242),f=r(34438),g=r(63704),y=r(89577),m=r(42764),b=r(82323),v=r(54560),w=r(16433),q=r(47211),R=r(43279);let I=e=>({context:t})=>{let{count:r,include:s,exclude:n,responseType:i="message.received"}=e;return{count:r,domain:t.domain,from:t.connectTo,include:s?Array.isArray(s)?s:[s]:[],exclude:n?Array.isArray(n)?n:[n]:[],responseType:i,target:t.target,to:t.name}},$=(0,p.v)(()=>(0,f.R)(window,"message")),E=e=>(0,u.OX)(({input:t})=>{let r;return $.pipe(e?(0,g.T)(e):(0,y.F)(),(0,m.p)((e=>t=>{let{data:r}=t;return(!e.include.length||e.include.includes(r.type))&&(!e.exclude.length||!e.exclude.includes(r.type))&&r.domain===e.domain&&r.from===e.from&&r.to===e.to&&(!e.target||t.source===e.target)})(t)),(0,g.T)((r=t.responseType,e=>({type:r,message:e}))),t.count?(0,y.F)((0,b.S)(t.count),(0,v.H)(e=>e),(0,w.s)(t.count)):(0,y.F)())}),T="sanity/comlink",j="comlink/response",k="comlink/heartbeat",S="comlink/disconnect",x="comlink/handshake/syn",O="comlink/handshake/syn-ack",_="comlink/handshake/ack",C=()=>(0,c.mj)({types:{},actors:{listen:(0,u.OX)(({input:e})=>{let t,r=e.signal?(0,f.R)(e.signal,"abort").pipe((t=`Request ${e.requestId} aborted`,e=>e.pipe((0,w.s)(1),(0,g.T)(()=>{throw Error(t)})))):q.w;return(0,f.R)(window,"message").pipe((0,m.p)(t=>t.data?.type===j&&t.data?.responseTo===e.requestId&&!!t.source&&e.sources.has(t.source)),(0,w.s)(e.sources.size),(0,R.Q)(r))})},actions:{"send message":({context:e},t)=>{let{sources:r,targetOrigin:s}=e,{message:n}=t;
1r.forEach(e=>{e.postMessage(n,{targetOrigin:s})})},"on success":(0,l.s)(({context:e})=>e.parentRef,({context:e,self:t})=>(e.response&&e.resolvable?.resolve(e.response),{type:"request.success",requestId:t.id,response:e.response,responseTo:e.responseTo})),"on fail":(0,l.s)(({context:e})=>e.parentRef,({context:e,self:t})=>(e.suppressWarnings||console.warn(`[@sanity/comlink] Received no response to message '${e.type}' on client '${e.from}' (ID: '${e.id}').`),e.resolvable?.reject(Error("No response received")),{type:"request.failed",requestId:t.id})),"on abort":(0,l.s)(({context:e})=>e.parentRef,({context:e,self:t})=>(e.resolvable?.reject(Error("Request aborted")),{type:"request.aborted",requestId:t.id}))},guards:{expectsResponse:({context:e})=>e.expectResponse},delays:{initialTimeout:0,responseTimeout:({context:e})=>e.responseTimeout??3e3}}).createMachine({context:({input:e})=>({channelId:e.channelId,data:e.data,domain:e.domain,expectResponse:e.expectResponse??!1,from:e.from,id:`msg-${o()}`,parentRef:e.parentRef,resolvable:e.resolvable,response:null,responseTimeout:e.responseTimeout,responseTo:e.responseTo,signal:e.signal,sources:e.sources instanceof Set?e.sources:new Set([e.sources]),suppressWarnings:e.suppressWarnings,targetOrigin:e.targetOrigin,to:e.to,type:e.type}),initial:"idle",on:{abort:".aborted"},states:{idle:{after:{initialTimeout:[{target:"sending"}]}},sending:{entry:{type:"send message",params:({context:e})=>{let{channelId:t,data:r,domain:s,from:n,id:i,responseTo:a,to:o,type:u}=e;return{message:{channelId:t,data:r,domain:s,from:n,id:i,to:o,type:u,responseTo:a}}}},always:[{guard:"expectsResponse",target:"awaiting"},"success"]},awaiting:{invoke:{id:"listen for response",src:"listen",input:({context:e})=>({requestId:e.id,sources:e.sources,signal:e.signal}),onError:"aborted"},after:{responseTimeout:"failed"},on:{message:{actions:(0,d.a)({response:({event:e})=>e.data.data,responseTo:({event:e})=>e.data.responseTo}),target:"success"}}},failed:{type:"final",entry:"on fail"},success:{type:"final",entry:"on success"},aborted:{type:"final",entry:"on abort"}},output:({context:e,self:t})=>({requestId:t.id,response:e.response,responseTo:e.responseTo})});(0,u.SP)(({sendBack:e,input:t})=>{let r=()=>{e(t.event)};t.immediate&&r();let s=setInterval(r,t.interval);return()=>{clearInterval(s)}});let D=()=>(0,c.mj)({types:{},actors:{requestMachine:C(),listen:E()},actions:{"buffer handshake":(0,d.a)({handshakeBuffer:({event:e,context:t})=>((0,c.DT)(e,"message.received"),[...t.handshakeBuffer,e])}),"buffer message":(0,l.e)(({enqueue:e})=>{e.assign({buffer:({event:e,context:t})=>((0,c.DT)(e,"post"),[...t.buffer,{data:e.data,resolvable:e.resolvable,options:e.options}])}),e.emit(({event:e})=>((0,c.DT)(e,"post"),{type:"buffer.added",message:e.data}))}),"create request":(0,d.a)({requests:({context:e,event:t,self:r,spawn:s})=>{(0,c.DT)(t,"request");let n=(Array.isArray(t.data)?t.data:[t.data]).map(t=>s("requestMachine",{id:`req-${o()}`,input:{channelId:e.channelId,data:t.data,domain:e.domain,expectResponse:t.expectResponse,from:e.name,parentRef:r,resolvable:t.resolvable,responseTimeout:t.options?.responseTimeout,responseTo:t.responseTo,signal:t.options?.signal,sources:e.target,suppressWarnings:t.options?.suppressWarnings,targetOrigin:e.targetOrigin,to:e.connectTo,type:t.type}}));return[...e.requests,...n]}}),"emit heartbeat":(0,l.a)(()=>({type:"heartbeat"})),"emit received message":(0,l.e)(({enqueue:e})=>{e.emit(({event:e})=>((0,c.DT)(e,"message.received"),{type:"message",message:e.message.data}))}),"emit status":(0,l.a)((e,t)=>({type:"status",status:t.status})),"post message":(0,h.r)(({event:e})=>((0,c.DT)(e,"post"),{type:"request",data:{data:e.data.data,expectResponse:!!e.resolvable,type:e.data.type,resolvable:e.resolvable,options:e.options}})),"process pending handshakes":(0,l.e)(({context:e,enqueue:t})=>{e.handshakeBuffer.forEach(e=>t.raise(e)),t.assign({handshakeBuffer:[]})}),"remove request":(0,l.e)(({context:e,enqueue:t,event:r})=>{(0,c.DT)(r,["request.success","request.failed","request.aborted"]),(0,h.s)(r.requestId),t.assign({requests:e.requests.filter(({id:e})=>e!==r.requestId)})}),"send response":(0,h.r)(({event:e})=>((0,c.DT)(e,["message.received","heartbeat.received"]),{type:"request",data:{type:j,responseTo:e.message.data.id,data:void 0}})),"send handshake syn ack":(0,h.r)({type:"request",data:{type:O}}),"send pending messages":(0,l.e)(({enqueue:e})=>{e.raise(({context:e})=>({type:"request",data:e.buffer.map(({data:e,resolvable:t,options:r})=>({data:e.data,type:e.type,expectResponse:!!t,resolvable:t,options:r}))})),e.emit(({context:e})=>({type:"buffer.flushed",messages:e.buffer.map(({data:e})=>e)}
1)),e.assign({buffer:[]})}),"set connection config":(0,d.a)({channelId:({event:e})=>((0,c.DT)(e,"handshake.syn"),e.message.data.channelId),target:({event:e})=>((0,c.DT)(e,"handshake.syn"),e.message.source||void 0),targetOrigin:({event:e})=>((0,c.DT)(e,"handshake.syn"),e.message.origin)})},guards:{hasSource:({context:e})=>null!==e.target}}).createMachine({id:"node",context:({input:e})=>({buffer:[],channelId:null,connectTo:e.connectTo,domain:e.domain??T,handshakeBuffer:[],name:e.name,requests:[],target:void 0,targetOrigin:null}),invoke:{id:"listen for handshake syn",src:"listen",input:I({include:x,responseType:"handshake.syn"})},on:{"request.success":{actions:"remove request"},"request.failed":{actions:"remove request"},"request.aborted":{actions:"remove request"},"handshake.syn":{actions:"set connection config",target:".handshaking"}},initial:"idle",states:{idle:{entry:[{type:"emit status",params:{status:"idle"}}],on:{post:{actions:"buffer message"}}},handshaking:{guard:"hasSource",entry:["send handshake syn ack",{type:"emit status",params:{status:"handshaking"}}],invoke:[{id:"listen for handshake ack",src:"listen",input:I({include:_,count:1,responseType:"handshake.complete"}),onDone:"connected"},{id:"listen for disconnect",src:"listen",input:I({include:S,count:1,responseType:"disconnect"})},{id:"listen for messages",src:"listen",input:I({exclude:[S,x,_,k,j]})}],on:{request:{actions:"create request"},post:{actions:"buffer message"},"message.received":{actions:"buffer handshake"},disconnect:{target:"idle"}}},connected:{entry:["process pending handshakes","send pending messages",{type:"emit status",params:{status:"connected"}}],invoke:[{id:"listen for messages",src:"listen",input:I({exclude:[S,x,_,k,j]})},{id:"listen for heartbeat",src:"listen",input:I({include:k,responseType:"heartbeat.received"})},{id:"listen for disconnect",src:"listen",input:I({include:S,count:1,responseType:"disconnect"})}],on:{request:{actions:"create request"},post:{actions:"post message"},disconnect:{target:"idle"},"message.received":{actions:["send response","emit received message"]},"heartbeat.received":{actions:["send response","emit heartbeat"]}}}}}),P=(e,t=D())=>{let r,s=(0,h.c)(t,{input:e}),n=new Map,i=new Map;s.on("message",({message:e})=>{let t=n.get(e.type);if(t)return void t.forEach(t=>t(e.data));let r=i.get(e.type);r?r.add(e):i.set(e.type,new Set([e]))});let a=()=>{s.stop()};return{actor:s,fetch:(e,t,r)=>{let{responseTimeout:n=1e4,signal:i,suppressWarnings:a}=r||{},o=function(){let e,t;return"function"==typeof Promise.withResolvers?Promise.withResolvers():{promise:new Promise((r,s)=>{e=r,t=s}),resolve:e,reject:t}}();return s.send({type:"post",data:{type:e,data:t},resolvable:o,options:{responseTimeout:n,signal:i,suppressWarnings:a}}),o.promise},machine:t,on:(e,t,r)=>{let s=n.get(e)||new Set;n.has(e)||n.set(e,s),s.add(t);let a=i.get(e);if(a){let s=r?.replay??1;Array.from(a).slice(-s).forEach(({data:e})=>t(e)),i.delete(e)}return()=>{s.delete(t)}},onStatus:(e,t)=>{let n=s.on("status",s=>{r=s.status,t&&s.status!==t||e(s.status)});return r&&e(r),()=>n.unsubscribe()},post:(e,t)=>{s.send({type:"post",data:{type:e,data:t}})},start:()=>(s.start(),a),stop:a}}},17828:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"workAsyncStorageInstance",{enumerable:!0,get:function(){return s}});let s=(0,r(64054).createAsyncLocalStorage)()},20063:(e,t,r)=>{r.r(t);var s=r(47260),n={};for(let e in s)"default"!==e&&(n[e]=()=>s[e]);r.d(t,n)},24437:(e,t,r)=>{function s(e){let{reason:t,children:r}=e;return r}Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"BailoutToCSR",{enumerable:!0,get:function(){return s}}),r(24553)},30926:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),!function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(t,{callServer:function(){return s.callServer},createServerReference:function(){return i.createServerReference},findSourceMapURL:function(){return n.findSourceMapURL}});let s=r(41209),n=r(85153),i=r(77197)},31269:(e,t,r)=>{r.d(t,{default:()=>tJ});var s=r(95155),n=r(48),i=r(14132),a=r(45037),o=r(78242),u=r(50384),c=r(85755),l=r(60732),d=r(86238),h=r(2098
11),p=r(34098),f=r(77133),g=r(61270),y=r(25259),m=r(40712),b=r(29279),v=r(29396),w=r(77241),q=r(32466),R=r(63704),I=r(28775),$=r(46990),E=r(6486),T=r(42764);let j="drafts.",k="versions.";function S(e){return e.startsWith(j)}function x(e){return e.startsWith(k)}function O(e){return x(e)?j+D(e):S(e)?e:j+e}function _(e,t){if("drafts"===t||"published"===t)throw Error('Version can not be "published" or "drafts"');return`${k}${t}.${D(e)}`}function C(e){if(!x(e))return;let[t,r]=e.split(".");return r}function D(e){return x(e)?e.split(".").slice(2).join("."):S(e)?e.slice(j.length):e}var P=r(54152);let A=/\r\n|[\n\r\u2028\u2029]/;function M(e,t){let r=0;for(let s=0;s<t.length;s++){let n=t[s].length+1;if(r+n>e)return{line:s+1,column:e-r};r+=n}return{line:t.length,column:t[t.length-1]?.length??0}}class U extends Error{response;statusCode=400;responseBody;traceId;details;constructor(e,t){let r=L(e,t);super(r.message),Object.assign(this,r)}}class V extends Error{response;statusCode=500;responseBody;traceId;details;constructor(e){let t=L(e);super(t.message),Object.assign(this,t)}}function L(e,t){var r,s,n;let i=e.body,a={response:e,statusCode:e.statusCode,responseBody:(r=i,-1!==(e.headers["content-type"]||"").toLowerCase().indexOf("application/json")?JSON.stringify(r,null,2):r),traceId:function(e){let t=e?.headers?.traceparent;if(t)return t.split("-")[1]}(e),message:"",details:void 0};if(!(0,$.u4)(i))return a.message=`${H(e,i)}${W(a.traceId)}`,a;let o=i.error;if("string"==typeof o&&"string"==typeof i.message)return a.message=`${o} - ${i.message}${W(a.traceId)}`,a;if("object"!=typeof o||null===o)return"string"==typeof o?a.message=`${o}${W(a.traceId)}`:"string"==typeof i.message?a.message=`${i.message}${W(a.traceId)}`:a.message=`${H(e,i)}${W(a.traceId)}`,a;if("type"in(s=o)&&"mutationError"===s.type&&"description"in s&&"string"==typeof s.description||"type"in(n=o)&&"actionError"===n.type&&"description"in n&&"string"==typeof n.description){let e=o.items||[],t=e.slice(0,5).map(e=>e.error?.description).filter(Boolean),r=t.length?`: 2- ${t.join(` 3- `)}`:"";return e.length>5&&(r+=` 4...and ${e.length-5} more`),a.message=`${o.description}${W(a.traceId)}${r}`,a.details=i.error,a}return N(o)?(a.message=z(o,t?.options?.query?.tag,a.traceId),a.details=i.error):"description"in o&&"string"==typeof o.description?(a.message=`${o.description}${W(a.traceId)}`,a.details=o):a.message=`${H(e,i)}${W(a.traceId)}`,a}function N(e){return(0,$.u4)(e)&&"queryParseError"===e.type&&"string"==typeof e.query&&"number"==typeof e.start&&"number"==typeof e.end}function z(e,t,r){let{query:s,start:n,end:i,description:a}=e,o=r?` 5(traceId: ${r})`:"";if(!s||typeof n>"u")return`GROQ query parse error: ${a}${o}`;let u=t?` 6 7Tag: ${t}`:"";return`GROQ query parse error: 8${function(e,t,r){let s=e.split(A),{start:n,end:i,markerLines:a}=function(e,t){let r={...e.start},s={...r,...e.end},n=r.line??-1,i=r.column??0,a=s.line,o=s.column,u=Math.max(n-3,0),c=Math.min(t.length,a+3);-1===n&&(u=0),-1===a&&(c=t.length);let l=a-n,d={};if(l)for(let e=0;e<=l;e++){let r=e+n;if(i)if(0===e){let e=t[r-1].length;d[r]=[i,e-i+1]}else if(e===l)d[r]=[0,o];else{let s=t[r-e].length;d[r]=[0,s]}else d[r]=!0}else i===o?i?d[n]=[i,0]:d[n]=!0:d[n]=[i,o-i];return{start:u,end:c,markerLines:d}}({start:M(t.start,s),end:t.end?M(t.end,s):void 0},s),o=`${i}`.length;return e.split(A,i).slice(n,i).map((e,t)=>{let s=n+1+t,i=` ${` ${s}`.slice(-o)} |`,u=a[s],c=!a[s+1];if(!u)return` ${i}${e.length>0?` ${e}`:""}`;let l="";if(Array.isArray(u)){let t=e.slice(0,Math.max(u[0]-1,0)).replace(/[^\t]/g," "),s=u[1]||1;l=` 9 `+i.replace(/\d/g," ")+" "+t+"^".repeat(s),c&&r&&(l+=" "+r)}return">"+i+(e.length>0?` ${e}`:"")+l}).join(` 10`)}(s,{start:n,end:i},a)}${u}${o}`}function H(e,t){var r,s;let n="string"==typeof t?` (${s=100,(r=t).length>100?`${r.slice(0,s)}\u2026`:r})`:"",i=e.statusMessage?` ${e.statusMessage}`:"";return`${e.method}-request to ${e.url} resulted in HTTP ${e.statusCode}${i}${n}`}function W(e){return e?` (traceId: ${e})`:""}class F 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
10is 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 B={onResponse:(e,t)=>{if(e.statusCode>=500)throw new V(e);if(e.statusCode>=400)throw new U(e,t);return e}};function G(e,t={}){return(0,n.af)([(0,i.L5)({shouldRetry:Q}),...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 s=e.headers["x-sanity-warning"];for(let e of Array.isArray(s)?s:[s])!e||t[e]||r(e)||(t[e]=!0,console.warn(e));return e}}}(t),(0,i.UX)(),(0,i.Yf)(),(0,i.qB)(),B,(0,i.sH)({implementation:a.c})])}function Q(e,t,r){if(0===r.maxRetries)return!1;let s="GET"===r.method||"HEAD"===r.method,n=(r.uri||r.url).startsWith("/data/query"),a=e.response&&(429===e.response.statusCode||502===e.response.statusCode||503===e.response.statusCode);return(!!s||!!n)&&!!a||i.L5.shouldRetry(e,t,r)}function Y(e){return"https://www.sanity.io/help/"+e}let J=["image","file"],X=["before","after","replace"],K=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")},Z=(e,t)=>{if(null===t||"object"!=typeof t||Array.isArray(t))throw Error(`${e}() takes an object of properties`)},ee=(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`)},et=(e,t)=>{if(!t._id)throw Error(`${e}() requires that the document contains an ID ("_id" property)`);ee(e,t._id)},er=(e,t)=>{if(!t._type)throw Error(`\`${e}()\` requires that the document contains a type (\`_type\` property)`);((e,t)=>
10{if("string"!=typeof t)throw Error(`\`${e}()\`: \`${t}\` is not a valid document type`)})(e,t._type)},es=e=>{if(e.dataset)return e.dataset;let t=e.resource;if(t&&"dataset"===t.type){let e=t.id.split(".");if(2!==e.length)throw Error('Dataset resource ID must be in the format "project.dataset"');return e[1]}throw Error("`dataset` must be provided to perform queries")},en=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},ei=e=>{let t=e.resource;if(!t)throw Error("`resource` must be provided to perform resource queries");let{type:r,id:s}=t;switch(r){case"dataset":if(2!==s.split(".").length)throw Error('Dataset resource ID must be in the format "project.dataset"');return;case"dashboard":case"media-library":case"canvas":return;default:throw Error(`Unsupported resource type: ${r.toString()}`)}},ea=(e,t)=>{if(t.resource)throw Error(`\`${e}\` does not support resource-based operations`)},eo=e=>(function(e){let t=!1,r;return(...s)=>(t||(r=e(...s),t=!0),r)})((...t)=>console.warn(e.join(" "),...t)),eu=eo(["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"]),ec=eo(["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."]),el=eo(["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."]),ed=eo(["The `previewDrafts` perspective has been renamed to `drafts` and will be removed in a future API version"]),eh=eo(["You have configured Sanity client to use a token in the browser. This may cause unintentional security issues.",`See ${Y("js-client-browser-token")} for more information and how to hide this warning.`]),ep=eo(["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`."]),ef=eo(["Using the Sanity client without specifying an API version is deprecated.",`See ${Y("js-client-api-version")}`]),eg=(eo(["The default export of @sanity/client has been deprecated. Use the named export `createClient` instead."]),eo(["You have called `createVersion()` with a defined `document`. The recommended approach is to provide a `baseId` and `releaseId` instead."])),ey=eo(["The `~experimental_resource` configuration property has been renamed to `resource`.","Please update your client configuration to use `resource` instead. Support for `~experimental_resource` will be removed in a future version."]),em={apiHost:"https://api.sanity.io",apiVersion:"1",useProjectHostname:!0,stega:{enabled:!1}},eb=["localhost","127.0.0.1","0.0.0.0"];function ev(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 ew=(e,t)=>{let r,s={...t,...e,stega:{..."boolean"==typeof t.stega?{enabled:t.stega}:t.stega||em.stega,..."boolean"==typeof e.stega?{enabled:e.stega}:e.stega||{}}};s.apiVersion||ef();let n={...em,...s};n["~experimental_resource"]&&!n.resource&&(ey(),n.resource=n["~experimental_resource"]);let i=n.resource,a=n.useProjectHostname&&!i;if(typeof Promise>"u"){let e=Y("js-client-promise-polyfill");throw Error(`No native Promise-implementation found, polyfill needed - see ${e}`)}if(a&&!n.projectId)throw Error("Configuration must contain `projectId`");if(i&&ei(n),"u">typeof n.perspective&&ev(n.perspective),"encodeSourceMap"in n)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 n)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 n.stega.enabled)throw Error(`stega.enabled must be a boolean, received ${n.stega.enabled}`);if(n.stega.enabled&&void 0===n.stega.studioUrl)throw Error("stega.studioUrl must be defined when stega.enabled is true");if(n.stega.enabled&&"string"!=typeof n.stega.studioUrl&&"function"!=typeof n.stega.studioUrl)throw Error(`stega.studioUrl must be a string or a function, received ${n.stega.studioUrl}`);let o="u">typeof window&&window.location&&window.location.hostname,u=o&&(r=window.location.hostname,-1!==eb.indexOf(r)),c=!!n.token;n.withCredentials&&c&&(ep(),n.withCredentials=!1),o&&u&&c&&!0!==n.ignoreBrowserTokenWarning?eh():typeof n.useCdn>"u"&&ec(),a&&(e=>{if(!/^[-a-z0-9]+$/i.test(e))throw Error("`projectId` can only contain only a-z, 0-9 and dashes")})(n.projectId),n.dataset&&K(n.dataset),"requestTagPrefix"in n&&(n.requestTagPrefix=n.requestTagPrefix?en(n.requestTagPrefix).replace(/\.+$/,""):void 0),n.apiVersion=`${n.apiVersion}`.replace(/^v/,""),n.isDefaultApi=n.apiHost===em.apiHost,!0===n.useCdn&&n.withCredentials&&eu(),n.useCdn=!1!==n.useCdn&&!n.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`")}(n.apiVersion);let l=n.apiHost.split("://",2),d=l[0],h=l[1],p=n.isDefaultApi?"apicdn.sanity.io":h;return a?(n.url=`${d}://${n.projectId}.${h}/v${n.apiVersion}`,n.cdnUrl=`${d}://${n.projectId}.${p}/v${n.apiVersion}`):(n.url=`${n.apiHost}/v${n.apiVersion}`,n.cdnUrl=n.url),n};class eq extends Error{name="ConnectionFailedError"}
10class eR extends Error{name="DisconnectError";reason;constructor(e,t,r={}){super(e,r),this.reason=t}}class eI extends Error{name="ChannelError";data;constructor(e,t){super(e),this.data=t}}class e$ extends Error{name="MessageError";data;constructor(e,t,r={}){super(e,r),this.data=t}}class eE extends Error{name="MessageParseError"}let eT=["channelError","disconnect"];function ej(e,t){return(0,o.v)(()=>{let t=e();return(0,u.A)(t)?t:(0,c.of)(t)}).pipe((0,l.Z)(e=>{var r,s;return r=e,s=t,new a.c(e=>{let t=s.includes("open"),n=s.includes("reconnect");function i(t){if("data"in t){let[r,s]=ek(t);e.error(r?new eE("Unable to parse EventSource error message",{cause:s}):new e$((s?.data).message,s));return}r.readyState===r.CLOSED?e.error(new eq("EventSource connection failed")):n&&e.next({type:"reconnect"})}function a(){e.next({type:"open"})}function o(t){let[s,n]=ek(t);if(s)return void e.error(new eE("Unable to parse EventSource message",{cause:s}));if("channelError"===t.type){let t=new URL(r.url).searchParams.get("tag");e.error(new eI(function(e,t){let r=e.error;return r?N(r)?z(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 eR(`Server disconnected client: ${n.data?.reason||"unknown error"}`));e.next({type:t.type,id:t.lastEventId,...n.data?{data:n.data}:{}})}r.addEventListener("error",i),t&&r.addEventListener("open",a);let u=[...new Set([...eT,...s])].filter(e=>"error"!==e&&"open"!==e&&"reconnect"!==e);return u.forEach(e=>r.addEventListener(e,o)),()=>{r.removeEventListener("error",i),t&&r.removeEventListener("open",a),u.forEach(e=>r.removeEventListener(e,o)),r.close()}})}))}function ek(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 eS(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 ex{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 Z("diffMatchPatch",e),this._assign("diffMatchPatch",e)}unset(e){if(!Array.isArray(e))throw Error("unset(attrs) takes an array of attributes to unset, non-array given");return this.operations=Object.assign({},this.operations,{unset:e}),this}inc(e){return this._assign("inc",e)}dec(e){return this._assign("dec",e)}insert(e,t,r){return((e,t,r)=>{let s="insert(at, selector, items)";if(-1===X.indexOf(e)){let e=X.map(e=>`"${e}"`).join(", ");throw Error(`${s} takes an "at"-argument which is one of: ${e}`)}if("string"!=typeof t)throw Error(`${s} takes a "selector"-argument which must be a string`);if(!Array.isArray(r))throw Error(`${s} takes an "items"-argument which must be an array`)})(e,t,r),this._assign("insert",{[e]:t,items:r})}append(e,t){return this.insert("after",`${e}[-1]`,t)}prepend(e,t){return this.insert("before",`${e}[0]`,t)}splice(e,t,r,s){let n=t<0?t-1:t,i=typeof r>"u"||-1===r?-1:Math.max(0,t+r),a=`${e}[${n}:${n<0&&i>=0?"":i}]`;return this.insert("replace",a,s||[])}ifRevisionId(e){return this.operations.ifRevisionID=e,this}serialize(){return{...eS(this.selection),...this.operations}}toJSON(){return this.serialize()}reset(){return this.operations={},this}_assign(e,t,r=!0){return Z(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 eO extends ex{#e;constructor(e,t,r){super(e,t),this.#e=r}clone(){return new eO(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 e_ extends ex{#e;constructor(e,t,r){super(e,t),this.#e=r}clone(){return new e_(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 eC={returnDocuments:!1};class eD{operations;trxId;constructor(e=[],t){this.operations=e,this.trxId=t}create(e){return Z("create",e),this._add({create:e})}createIfNotExists(e){let t="createIfNotExists";return Z(t,e),et(t,e),this._add({[t]:e})}createOrReplace(e){let t="createOrReplace";return Z(t,e),et(t,e),this._add({[t]:e})}delete(e){return ee("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 eP extends eD{#e;constructor(e,t,r){super(e,r),this.#e=t}clone(){return new eP([...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},eC,e||{}))}patch(e,t){let r="function"==typeof t,s="string"!=typeof e&&e instanceof e_,n="object"==typeof e&&("query"in e||"id"in e);if(s)return this._add({patch:e.serialize()});if(r){let r=t(new e_(e,{},this.#e));if(!(r instanceof e_))throw Error("function passed to `patch()` must return the patch");return this._add({patch:r.serialize()})}if(n){let r=new e_(e,t||{},this.#e);return this._add({patch:r.serialize()})}return this._add({patch:{id:e,...t}})}}class eA extends eD{#e;constructor(e,t,r){super(e,r),this.#e=t}clone(){return new eA([...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},eC,e||{}))}patch(e,t){let r="function"==typeof t;if("string"!=typeof e&&e instanceof eO)return this._add({patch:e.serialize()});if(r){let r=t(new eO(e,{},this.#e));if(!(r instanceof eO))throw Error("function passed to `patch()` must return the patch");return this._add({patch:r.serialize()})}return this._add({patch:{id:e,...t}})}}let eM=({query:e,params:t={},options:r={}})=>{let s=new URLSearchParams,{tag:n,includeMutations:i,returnQuery:a,...o}=r;for(let[r,i]of(n&&s.append("tag",n),s.append("query",e),Object.entries(t)))void 0!==i&&s.append(`$${r}`,JSON.stringify(i));for(let[e,t]of Object.entries(o))t&&s.append(e,`${t}`);return!1===a&&s.append("returnQuery","false"),!1===i&&s.append("includeMutations","fal
13se"),`?${s}`},eU=e=>"response"===e.type,eV=e=>e.body;function eL(e,t,s,n,i={},a={}){let o="stega"in a?{...s||{},..."boolean"==typeof a.stega?{enabled:a.stega}:a.stega||{}}:s,u=o.enabled?(0,$.Q)(i):i,c=!1===a.filterResponse?e=>e:e=>e.result,{cache:l,next:h,...p}={useAbortSignal:"u">typeof a.signal,resultSourceMap:o.enabled?"withKeyArraySelector":a.resultSourceMap,...a,returnQuery:!1===a.filterResponse&&!1!==a.returnQuery},f=e0(e,t,"query",{query:n,params:u},"u">typeof l||"u">typeof h?{...p,fetch:{cache:l,next:h}}:p);return o.enabled?f.pipe((0,E.v)((0,d.H)(r.e(4156).then(r.bind(r,64156)).then(function(e){return e.stegaEncodeSourceMap$1}).then(({stegaEncodeSourceMap:e})=>e))),(0,R.T)(([e,t])=>{let r=t(e.result,e.resultSourceMap,o);return c({...e,result:r})})):f.pipe((0,R.T)(c))}function eN(e,t,r,s={}){let n={uri:e8(e,"doc",(()=>{if(!s.releaseId)return r;let e=C(r);if(!e){if(S(r))throw Error(`The document ID (\`${r}\`) is a draft, but \`options.releaseId\` is set as \`${s.releaseId}\``);return _(r,s.releaseId)}if(e!==s.releaseId)throw Error(`The document ID (\`${r}\`) is already a version of \`${e}\` release, but this does not match the provided \`options.releaseId\` (\`${s.releaseId}\`)`);return r})()),json:!0,tag:s.tag,signal:s.signal,query:void 0!==s.includeAllVersions?{includeAllVersions:s.includeAllVersions}:void 0};return e6(e,t,n).pipe((0,T.p)(eU),(0,R.T)(e=>{let t=e.body.documents;return t?s.includeAllVersions?t:t[0]:s.includeAllVersions?[]:void 0}))}function ez(e,t,r,s={}){let n={uri:e8(e,"doc",r.join(",")),json:!0,tag:s.tag,signal:s.signal};return e6(e,t,n).pipe((0,T.p)(eU),(0,R.T)(e=>{let t,s,n=(t=e.body.documents||[],s=e=>e._id,t.reduce((e,t)=>(e[s(t)]=t,e),Object.create(null)));return r.map(e=>n[e]||null)}))}function eH(e,t,r,s={}){return e0(e,t,"query",{query:"*[sanity::partOfRelease($releaseId)]",params:{releaseId:r}},s)}function eW(e,t,r,s){return et("createIfNotExists",r),e1(e,t,r,"createIfNotExists",s)}function eF(e,t,r,s){return et("createOrReplace",r),e1(e,t,r,"createOrReplace",s)}function eB(e,t,r,s,n){return et("createVersion",r),er("createVersion",r),eg(),eZ(e,t,{actionType:"sanity.action.document.version.create",publishedId:s,document:r},n)}function eG(e,t,r,s,n,i,a){if(!s)throw Error("`createVersion()` requires `baseId` when no `document` is provided");if(!r)throw Error("`createVersion()` requires `publishedId` when `baseId` is provided");return ee("createVersion",s),ee("createVersion",r),eZ(e,t,{actionType:"sanity.action.document.version.create",publishedId:r,baseId:s,versionId:n?_(r,n):O(r),ifBaseRevisionId:i},a)}function eQ(e,t,r,s){return e0(e,t,"mutate",{mutations:[{delete:eS(r)}]},s)}function eY(e,t,r,s=!1,n){return eZ(e,t,{actionType:"sanity.action.document.version.discard",versionId:r,purge:s},n)}function eJ(e,t,r,s){return et("replaceVersion",r),er("replaceVersion",r),eZ(e,t,{actionType:"sanity.action.document.version.replace",document:r},s)}function eX(e,t,r,s,n){return eZ(e,t,{actionType:"sanity.action.document.version.unpublish",versionId:r,publishedId:s},n)}function eK(e,t,r,s){let n;return e0(e,t,"mutate",{mutations:Array.isArray(n=r instanceof e_||r instanceof eO?{patch:r.serialize()}:r instanceof eP||r instanceof eA?r.serialize():r)?n:[n],transactionId:s&&s.transactionId||void 0},s)}function eZ(e,t,r,s){let n=Array.isArray(r)?r:[r],i=s&&s.transactionId||void 0;return e0(e,t,"actions",{actions:n,transactionId:i,skipCrossDatasetReferenceValidation:s&&s.skipCrossDatasetReferenceValidation||void 0,dryRun:s&&s.dryRun||void 0},s)}function e0(e,t,r,s,n={}){let i="mutate"===r,a="actions"===r,o=i||a?"":eM(s),u=!i&&!a&&o.length<11264,c=u?o:"",l=n.returnFirst,{timeout:d,token:h,tag:p,headers:f,returnQuery:g,lastLiveEventId:y,cacheMode:m}=n,b={method:u?"GET":"POST",uri:e8(e,r,c),json:!0,body:u?void 0:s,query:i&&((e={})=>{let t,r;return{dryRun:e.dryRun,returnIds:!0,returnDocuments:(t=e.returnDocuments,r=!0,!1===t?void 0:typeof t>"u"?r:t),visibility:e.visibility||"sync",autoGenerateArrayKeys:e.autoGenerateArrayKeys,skipCrossDatasetReferenceValidation:e.skipCrossDatasetReferenceValidation}})(n),timeout:d,headers:f,token:h,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,b).pipe((0,T.p)(eU),(0,R.T)(eV),(0,R.T)(e=>{if(!i)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 e1(e,t,r,s,n={}){return e0(e,t,"mutate",{mutations:[{[s]:r}]},Object.assign({returnFirst:!0,returnDocuments:!0},n))}let e2=e=>{let t=e.config();return void 0!==t.dataset&&void 0!==t.projectId||void 0!==t.resource},e5=(e,t)=>e2(e)&&t.startsWith(e8(e,"query"));function e6(e,t,r){var s;let n=r.url||r.uri,i=e.config(),o=typeof r.canUseCdn>"u"?["GET","HEAD"].indexOf(r.method||"GET")>=0&&(n.startsWith("/data/")||e5(e,n)||e2(e)&&n.startsWith(e8(e,"mutate"))||e2(e)&&n.startsWith(e8(e,"doc",""))||e2(e)&&n.startsWith(e8(e,"listen"))||e2(e)&&n.startsWith(e8(e,"history",""))):r.canUseCdn,u=(r.useCdn??i.useCdn)&&o,c=r.tag&&i.requestTagPrefix?[i.requestTagPrefix,r.tag].join("."):r.tag||i.requestTagPrefix;if(c&&null!==r.tag&&(r.query={tag:en(c),...r.query}),["GET","HEAD","POST"].indexOf(r.method||"GET")>=0&&e5(e,n)){let e=r.resultSourceMap??i.resultSourceMap;void 0!==e&&!1!==e&&(r.query={resultSourceMap:e,...r.query});let t=r.perspective||i.perspective;"u">typeof t&&("previewDrafts"===t&&ed(),ev(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,el())),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 s=t.token||e.token;s&&(r.Authorization=`Bearer ${s}`),t.useGlobalApi||e.useProjectHostname||!e.projectId||(r["X-Sanity-Project-ID"]=e.projectId);let n=!!(typeof t.withCredentials>"u"?e.withCredentials:t.withCredentials),i=typeof t.timeout>"u"?e.timeout:t.timeout;return Object.assign({},t,{headers:Object.assign({},r,t.headers||{}),timeout:typeof i>"u"?3e5:i,proxy:t.proxy||e.proxy,json:!0,withCredentials:n,fetch:"object"==typeof t.fetch&&"object"==typeof e.fetch?{...e.fetch,...t.fetch}:t.fetch||e.fetch})}(i,Object.assign({},r,{url:e9(e,n,u)})),d=new a.c(e=>t(l,i.requester).subscribe(e));return r.signal?d.pipe((s=r.signal,e=>new a.c(t=>{let r=()=>t.error(function(e){if(e3)return new DOMException(e?.reason??"The operation was aborted.","AbortError");let t=Error(e?.reason??"The operation was aborted.");return t.name="AbortError",t}(s));if(s&&s.aborted)return void r();let n=e.subscribe(t);return s.addEventListener("abort",r),()=>{s.removeEventListener("abort",r),n.unsubscribe()}}))):d}function e4(e,t,r){return e6(e,t,r).pipe((0,T.p)(e=>"response"===e.type),(0,R.T)(e=>e.body))}function e8(e,t,r){let s=e.config();if(s.resource){ei(s);let e=e7(s),n=void 0!==r?`${t}/${r}`:t;return`${e}/${n}`.replace(/\/($|\?)/,"$1")}let n=es(s),i=`/${t}/${n}`;return`/data${void 0!==r?`${i}/${r}`:i}`.replace(/\/($|\?)/,"$1")}function e9(e,t,r=!1){let{url:s,cdnUrl:n}=e.config();return`${r?n:s}/${t.replace(/^\//,"")}`}let e3=!!globalThis.DOMException,e7=e=>{let t=e.resource;if(!t)throw Error("`resource` must be provided to perform resource queries");let{type:r,id:s}=t;switch(r){case"dataset":{let e=s.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/${s}`;case"media-library":return`/media-libraries/${s}`;case"dashboard":return`/dashboards/${s}`;default:throw Error(`Unsupported resource type: ${r.toString()}`)}};function te(e,t,r){let s=es(e.config());return e4(e,t,{method:"POST",uri:`/agent/action/generate/${s}`,body:r})}function tt(e,t,r){let s=es(e.config());return e4(e,t,{method:"POST",uri:`/agent/action/transform/${s}`,body:r})}function tr(e,t,r){let s=es(e.config());return e4(e,t,{method:"POST",uri:`/agent/action/translate/${s}`,body:r})}class ts{#e;#t;constructor(e,t){this.#e=e,this.#t=t}generate(e){return te(this.#e,this.#t,e)}transform(e){return tt(this.#e,this.#t,e)}translate(e){return tr(this.#e,this.#t,e)}}class tn{#e;#t;constructor(e,t){this.#e=e,this.#t=t}generate(e){return(0,h.s)(te(this.#e,this.#t,e))}transform(e){return(0,h.s)(tt(this.#e,this.#t,e))}translate(e){return(0,h.s)(tr(this.#e,this.#t,e))}prompt(e){return(0,h.s)(function(e,t,r){let s=es(e.config());return e4(e,t,{method:"POST",uri:`/agent/action/prompt/${s}`,body:r})}(this.#e,this.#t,e))}patch(e){return(0,h.s)(function(e,t,r){let s=es(e.config());return e4(e,t,{method:"POST",uri:`/agent/action/patch/${s}`,body:r})}(this.#e,this.#t,e))}}class ti{#e;#t;constructor(e,t){this.#e=e,this.#t=t}upload(e,t,r){return to(this.#e,this.#t,e,t,r)}}class ta{#e;#t;constructor(e,t){this.#e=e,this.#t=t}upload(e,t,r){let s=to(this.#e,this.#t,e,t,r);return(0,h.s)(s.pipe((0,T.p)(e=>"response"===e.type),(0,R.T)(e=>e.body.document)))}}function to(e,t,r,s,n={}){var i,a;if(-1===J.indexOf(r))throw Error(`Invalid asset type: ${r}. Must be one of ${J.join(", ")}`);let o=n.extract||void 0;o&&!o.length&&(o=["none"]);let u=e.config(),c=(i=n,a=s,!(typeof File>"u")&&a instanceof File?Object.assign({filename:!1===i.preserveFilename?void 0:a.name,contentType:a.type},i):i),{tag:l,label:d,title:h,description:p,creditLine:f,filename:g,source:y}=c,m=u.resource?.type==="media-library",b=m?{title:h,filename:g}:{label:d,title:h,description:p,filename:g,meta:o,creditLine:f};return y&&!m&&(b.sourceId=y.id,b.sourceName=y.name,b.sourceUrl=y.url),e6(e,t,{tag:l,method:"POST",timeout:c.timeout||0,uri:function(e,t){let r="image"===t?"images":"files",s=e.resource;if(s){let{type:e,id:t}=s;switch(e){case"dataset":throw Error("Assets are not supported for dataset resources, yet. Configure the client with `{projectId: <projectId>, dataset: <datasetId>}` instead.");case"canvas":return`/canvases/${t}/assets/${r}`;case"media-library":return`/media-libraries/${t}/upload`;case"dashboard":return`/dashboards/${t}/assets/${r}`;default:throw Error(`Unsupported resource type: ${e.toString()}`)}}let n=es(e);return`assets/${r}/${n}`}(u,r),headers:c.contentType?{"Content-Type":c.contentType}:{},query:b,body:s})}let tu=(0,o.v)(()=>r.e(8679).then(r.t.bind(r,88679,19))).pipe((0,R.T)(({default:e})=>e),(0,p.t)(1));function tc(){return function(e){return e.pipe((0,f.W)((e,t)=>e instanceof eq?(0,g.x)((0,c.of)({type:"reconnect"}),(0,y.O)(1e3).pipe((0,l.Z)(()=>t))):(0,m.$)(()=>e)))}}let tl=["includePreviousRevision","includeResult","includeMutations","includeAllVersions","visibility","effectFormat","enableResume","tag"],td={includeResult:!0};function th(e,t,r={}){let{url:s,token:n,withCredentials:i,requestTagPrefix:a,headers:o}=this.config(),u=r.tag&&a?[a,r.tag].join("."):r.tag,l={...Object.keys(td).concat(Object.keys(r)).reduce((e,t)=>
13(e[t]=typeof r[t]>"u"?td[t]:r[t],e),{}),tag:u},d=eM({query:e,params:t,options:{tag:u,...tl.reduce((e,t)=>(typeof l[t]>"u"||(e[t]=l[t]),e),{})}}),h=`${s}${e8(this,"listen",d)}`;if(h.length>14800)return(0,m.$)(()=>Error("Query too large for listener"));let p=l.events?l.events:["mutation"],f={};return i&&(f.withCredentials=!0),(n||o)&&(f.headers={},n&&(f.headers.Authorization=`Bearer ${n}`),o&&Object.assign(f.headers,o)),ej(()=>(typeof EventSource>"u"||f.headers?tu:(0,c.of)(EventSource)).pipe((0,R.T)(e=>new e(h,f))),p).pipe(tc(),(0,T.p)(e=>p.includes(e.type)),(0,R.T)(e=>({type:e.type,..."data"in e?e.data:{}})))}let tp="2021-03-25";class tf{#e;constructor(e){this.#e=e}events({includeDrafts:e=!1,tag:t,waitFor:r}={}){var s,n,i,o;let{projectId:u,apiVersion:d,token:h,withCredentials:p,requestTagPrefix:g,headers:y}=this.#e.config(),m=d.replace(/^v/,"");if("X"!==m&&m<tp)throw Error(`The live events API requires API version ${tp} or later. The current API version is ${m}. Please update your API version to use this feature.`);if(e&&!h&&!p)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 I=e8(this.#e,"live/events"),$=new URL(this.#e.getUrl(I,!1)),E=t&&g?[g,t].join("."):t;E&&$.searchParams.set("tag",E),e&&$.searchParams.set("includeDrafts","true"),r&&$.searchParams.set("waitFor",r);let T={};e&&p&&(T.withCredentials=!0),(e&&h||y)&&(T.headers={},e&&h&&(T.headers.Authorization=`Bearer ${h}`),y&&Object.assign(T.headers,y));let j=`${$.href}::${JSON.stringify(T)}`,k=tg.get(j);if(k)return k;let S=ej(()=>(typeof EventSource>"u"||T.headers?tu:(0,c.of)(EventSource)).pipe((0,R.T)(e=>new e($.href,T))),["message","restart","welcome","reconnect","goaway"]),x=(n=$,i={method:"OPTIONS",mode:"cors",credentials:T.withCredentials?"include":"omit",headers:T.headers},new a.c(e=>{let t=new AbortController,r=t.signal;return fetch(n,{...i,signal:t.signal}).then(t=>{e.next(t),e.complete()},t=>{r.aborted||e.error(t)}),()=>t.abort()})).pipe((0,f.W)(()=>{throw new F({projectId:u})})),O=S.pipe(tc(),(0,l.Z)(e=>"reconnect"===e.type?x.pipe((0,l.Z)(()=>(0,c.of)(e))):(0,c.of)(e)),(0,f.W)(e=>x.pipe((0,l.Z)(()=>{throw e}))),(0,R.T)(e=>{if("message"===e.type){let{data:t,...r}=e;return{...r,tags:t.tags}}return e})).pipe((0,v.j)(()=>tg.delete(j)),(o="function"==typeof(s={predicate:e=>"welcome"===e.type})?{predicate:s,...void 0}:s,e=>{let t,r=!1,{predicate:s,...n}=o,i=e.pipe((0,b.M)(e=>{o.predicate(e)&&(r=!0,t=e)}),(0,v.j)(()=>{r=!1,t=void 0}),(0,w.u)(n)),u=new a.c(e=>{r&&e.next(t),e.complete()});return(0,q.h)(i,u)}));return tg.set(j,O),O}}let tg=new Map;class ty{#e;#t;constructor(e,t){this.#e=e,this.#t=t}create(e,t){return tv(this.#e,this.#t,"PUT",e,t)}edit(e,t){return tv(this.#e,this.#t,"PATCH",e,t)}delete(e){return tv(this.#e,this.#t,"DELETE",e)}list(){ea("dataset",this.#e.config());let e=this.#e.config(),t=e.projectId,r="/datasets";return!1===e.useProjectHostname&&(r=`/projects/${t}/datasets`),e4(this.#e,this.#t,{uri:r,tag:null})}getEmbeddingsSettings(e){return ea("dataset",this.#e.config()),K(e),e4(this.#e,this.#t,{uri:tb(this.#e,e),tag:null})}editEmbeddingsSettings(e,t){return ea("dataset",this.#e.config()),K(e),e4(this.#e,this.#t,{method:"PUT",uri:tb(this.#e,e),body:t,tag:null})}}class tm{#e;#t;constructor(e,t){this.#e=e,this.#t=t}create(e,t){return ea("dataset",this.#e.config()),(0,h.s)(tv(this.#e,this.#t,"PUT",e,t))}edit(e,t){return ea("dataset",this.#e.config()),(0,h.s)(tv(this.#e,this.#t,"PATCH",e,t))}delete(e){return ea("dataset",this.#e.config()),(0,h.s)(tv(this.#e,this.#t,"DELETE",e))}list(){ea("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)(e4(this.#e,this.#t,{uri:r,tag:null}))}getEmbeddingsSettings(e){return ea("dataset",this.#e.config()),K(e),(0,h.s)(e4(this.#e,this.#t,{uri:tb(this.#e,e),tag:null}))}editEmbeddingsSettings(e,t){return ea("dataset",this.#e.config()),K(e),(0,h.s)(e4(this.#e,this.#t,{method:"PUT",uri:tb(this.#e,e),body:t,tag:null}))}}function tb(e,t){let r=e.config();return!1===r.useProjectHostname?`/projects/${r.projectId}/datasets/${t}/settings/embeddings`:`/datasets/${t}/settings/embeddings`}function tv(e,t,r,s,n){return ea("dataset",e.config()),K(s),e4(e,t,{method:r,uri:`/datasets/${s}`,body:n,tag:null})}class tw{#e;#t;constructor(e,t){this.#e=e,this.#t=t}getPlaybackInfo(e,t={}){var r,s;let n=this.#e.config(),i=(n.resource||n["~experimental_resource"])?.id,{instanceId:a,library
13Id:o}=function(e){let t="object"==typeof e&&"_ref"in e?e._ref:e,r=tR.exec(t);if(r){let[,e,t]=r;return{libraryId:e,instanceId:t}}if("string"==typeof e&&e.startsWith("video-"))return{instanceId:e};throw Error(`Invalid video asset instance identifier "${t}": must be a valid video instance id or a Global Dataset Reference (GDR) to the video asset in the Media Library`)}(e),u=o||i;if(!u)throw Error("Could not determine Media Library ID - you need to provide a valid Media Library ID in the client config or a Media Library GDR");let c=(r=a,s=u,`/media-libraries/${s}/video/${r}/playback-info`),l=function(e){let t={};if(e.transformations){let{thumbnail:r,animated:s,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)),s&&(s.width&&(t.animatedWidth=s.width),s.height&&(t.animatedHeight=s.height),void 0!==s.start&&(t.animatedStart=s.start),void 0!==s.end&&(t.animatedEnd=s.end),s.fps&&(t.animatedFps=s.fps),s.format&&(t.animatedFormat=s.format)),n&&n.format&&(t.storyboardFormat=n.format)}return e.expiration&&(t.expiration=e.expiration),t}(t);return e4(this.#e,this.#t,{method:"GET",uri:c,query:l})}}class tq{#e;#t;constructor(e,t){this.#e=e,this.#t=t}getPlaybackInfo(e,t={}){return(0,h.s)(new tw(this.#e.observable,this.#t).getPlaybackInfo(e,t))}}let tR=/^media-library:(ml[^:]+):([^:]+)$/;class tI{#e;#t;constructor(e,t){this.#e=e,this.#t=t}list(e){let t={};return e?.includeMembers===!1&&(t.includeMembers="false"),e?.includeFeatures===!1&&(t.includeFeatures="false"),e?.organizationId&&(t.organizationId=e.organizationId),e?.onlyExplicitMembership&&(t.onlyExplicitMembership="true"),e4(this.#e,this.#t,{uri:"/projects",query:t})}getById(e){return e4(this.#e,this.#t,{uri:`/projects/${e}`})}}class t${#e;#t;constructor(e,t){this.#e=e,this.#t=t}list(e){let t={};return e?.includeMembers===!1&&(t.includeMembers="false"),e?.includeFeatures===!1&&(t.includeFeatures="false"),e?.organizationId&&(t.organizationId=e.organizationId),e?.onlyExplicitMembership&&(t.onlyExplicitMembership="true"),(0,h.s)(e4(this.#e,this.#t,{uri:"/projects",query:t}))}getById(e){return(0,h.s)(e4(this.#e,this.#t,{uri:`/projects/${e}`}))}}let tE=(0,P.d_)("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789",8),tT=(e,t)=>t?_(e,t):O(e);function tj(e,{releaseId:t,publishedId:r,document:s}){if(r&&s._id){let e=tT(r,t);return((e,t)=>{if(t._id&&t._id!==e)throw Error(`The provided document ID (\`${t._id}\`) does not match the generated version ID (\`${e}\`)`)})(e,s),e}if(s._id){let r=S(s._id),n=x(s._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 (\`${s._id}\`) that is a draft ID, but a release ID (\`${t}\`) was also provided.`);let n=C(s._id);if(n!==t)throw Error(`\`${e}()\` was called with a document ID (\`${s._id}\`) that is a version ID, but the release ID (\`${t}\`) does not match the document's version ID (\`${n}\`).`)}return s._id}if(r)return tT(r,t);throw Error(`\`${e}()\` requires either a publishedId or a document with an \`_id\``)}let tk=(e,t)=>{let[r,s,n]=((e,t)=>{if("object"==typeof e&&null!==e&&("releaseId"in e||"metadata"in e)){let{releaseId:r=tE(),metadata:s={}}=e;return[r,s,t]}return[tE(),{},e]})(e,t);return{action:{actionType:"sanity.action.release.create",releaseId:r,metadata:{...s,releaseType:s.releaseType||"undecided"}},options:n}};class tS{#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:s}=tk(e,t),{releaseId:n,metadata:i}=r;return eZ(this.#e,this.#t,r,s).pipe((0,R.T)(e=>({...e,releaseId:n,metadata:i})))}edit({releaseId:e,patch:t},r){return eZ(this.#e,this.#t,{actionType:"sanity.action.release.edit",releaseId:e,patch:t},r)}publish({releaseId:e},t){return eZ(this.#e,this.#t,{actionType:"sanity.action.release.publish",releaseId:e},t)}archive({releaseId:e},t){return eZ(this.#e,this.#t,{actionType:"sanity.action.release.archive",releaseId:e},t)}unarchive({releaseId:e},t){return eZ(this.#e,this.#t,{actionType:"sanity.action.release.unarchive",releaseId:e},t)}schedule({releaseId:e,publishAt:t},r){return eZ(this.#e,this.#t,{actionType:"sanity.action.release.schedule",releaseId:e,publishAt:t},r)}unschedule({releaseId:e},t){return eZ(this.#e,this.#t,{actionType:"sanity.action.release.unschedule",releaseId:e},t)}delete({releaseId:e},t){return eZ(this.#e,this.#t,{actionType:"sanity.action.release.delete",releaseId:e},t)}fetchDocuments({releaseId:e},t){return eH(this.#e,this.#t,e,t)}}class tx{#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:s}=tk(e,t),{releaseId:n,metadata:i}=r;return{...await (0,h.s)(eZ(this.#e,this.#t,r,s)),releaseId:n,metadata:i}}edit({releaseId:e,patch:t},r){return(0,h.s)(eZ(this.#e,this.#t,{actionType:"sanity.action.release.edit",releaseId:e,patch:t},r))}publish({releaseId:e},t){return(0,h.s)(eZ(this.#e,this.#t,{actionType:"sanity.action.release.publish",releaseId:e},t))}archive({releaseId:e},t){return(0,h.s)(eZ(this.#e,this.#t,{actionType:"sanity.action.release.archive",releaseId:e},t))}unarchive({releaseId:e},t){return(0,h.s)(eZ(this.#e,this.#t,{actionType:"sanity.action.release.unarchive",releaseId:e},t))}schedule({releaseId:e,publishAt:t},r){return(0,h.s)(eZ(this.#e,this.#t,{actionType:"sanity.action.release.schedule",releaseId:e,publishAt:t},r))}unschedule({releaseId:e},t){return(0,h.s)(eZ(this.#e,this.#t,{actionType:"sanity.action.release.unschedule",releaseId:e},t))}delete({releaseId:e},t){return(0,h.s)(eZ(this.#e,this.#t,{actionType:"sanity.action.release.delete",releaseId:e},t))}fetchDocuments({releaseId:e},t){return(0,h.s)(eH(this.#e,this.#t,e,t))}}class tO{#e;#t;constructor(e,t){this.#e=e,this.#t=t}getById(e){return e4(this.#e,this.#t,{uri:`/users/${e}`})}}class t_{#e;#t;constructor(e,t){this.#e=e,this.#t=t}getById(e){return(0,h.s)(e4(this.#e,this.#t,{uri:`/users/${e}`}))}}class tC{assets;datasets;live;mediaLibrary;projects;users;agent;releases;#r;#s;#t;listen=th;constructor(e,t=em){this.config(t),this.#s=e;let r=t._requestHandler;this.#t=r?(()=>{let s;return(n,i)=>(s||(s=new tD(e,{...t,_requestHandler:void 0})),r(n,t=>e(t,i),s))})():e,this.assets=new ti(this,this.#t),this.datasets=new ty(this,this.#t),this.live=new tf(this),this.mediaLibrary={video:new tw(this,this.#t)},this.projects=new tI(this,this.#t),this.users=new tO(this,this.#t),this.agent={action:new ts(this,this.#t)},this.releases=new tS(this,this.#t)}clone(){return new tC(this.#s,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=ew(e,this.#r||{}),this}withConfig(e){let t=this.config();return new tC(this.#s,{...t,...e,stega:{...t.stega||{},..."boolean"==typeof e?.stega?{enabled:e.stega}:e?.stega||{}}})}fetch(e,t,r){return eL(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 ez(this,this.#t,e,t)}create(e,t){return e1(this,this.#t,e,"create",t)}createIfNotExists(e,t){return eW(this,this.#t,e,t)}createOrReplace(e,t){return eF(this,this.#t,e,t)}createVersion({document:e,publishedId:t,releaseId:r,baseId:s,ifBaseRevisionId:n},i){if(!e)return eG(this,this.#t,t,s,r,n,i);let a=tj("createVersion",{document:e,publishedId:t,releaseId:r}),o={...e,_id:a}
13,u=t||D(e._id);return eB(this,this.#t,o,u,i)}delete(e,t){return eQ(this,this.#t,e,t)}discardVersion({releaseId:e,publishedId:t},r,s){let n=tT(t,e);return eY(this,this.#t,n,r,s)}replaceVersion({document:e,publishedId:t,releaseId:r},s){let n=tj("replaceVersion",{document:e,publishedId:t,releaseId:r}),i={...e,_id:n};return eJ(this,this.#t,i,s)}unpublishVersion({releaseId:e,publishedId:t},r){let s=_(t,e);return eX(this,this.#t,s,t,r)}mutate(e,t){return eK(this,this.#t,e,t)}patch(e,t){return new eO(e,t,this)}transaction(e){return new eA(e,this)}action(e,t){return eZ(this,this.#t,e,t)}request(e){return e4(this,this.#t,e)}getUrl(e,t){return e9(this,e,t)}getDataUrl(e,t){return e8(this,e,t)}}class tD{assets;datasets;live;mediaLibrary;projects;users;agent;releases;observable;#r;#s;#t;listen=th;constructor(e,t=em){this.config(t),this.#s=e;let r=t._requestHandler;this.#t=r?(()=>{let s;return(n,i)=>(s||(s=new tD(e,{...t,_requestHandler:void 0})),r(n,t=>e(t,i),s))})():e,this.assets=new ta(this,this.#t),this.datasets=new tm(this,this.#t),this.live=new tf(this),this.mediaLibrary={video:new tq(this,this.#t)},this.projects=new t$(this,this.#t),this.users=new t_(this,this.#t),this.agent={action:new tn(this,this.#t)},this.releases=new tx(this,this.#t),this.observable=new tC(e,t)}clone(){return new tD(this.#s,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=ew(e,this.#r||{}),this}withConfig(e){let t=this.config();return new tD(this.#s,{...t,...e,stega:{...t.stega||{},..."boolean"==typeof e?.stega?{enabled:e.stega}:e?.stega||{}}})}fetch(e,t,r){return(0,h.s)(eL(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)(ez(this,this.#t,e,t))}create(e,t){return(0,h.s)(e1(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)(eF(this,this.#t,e,t))}createVersion({document:e,publishedId:t,releaseId:r,baseId:s,ifBaseRevisionId:n},i){if(!e)return(0,I._)(eG(this,this.#t,t,s,r,n,i));let a=tj("createVersion",{document:e,publishedId:t,releaseId:r}),o={...e,_id:a},u=t||D(e._id);return(0,I._)(eB(this,this.#t,o,u,i))}delete(e,t){return(0,h.s)(eQ(this,this.#t,e,t))}discardVersion({releaseId:e,publishedId:t},r,s){let n=tT(t,e);return(0,h.s)(eY(this,this.#t,n,r,s))}replaceVersion({document:e,publishedId:t,releaseId:r},s){let n=tj("replaceVersion",{document:e,publishedId:t,releaseId:r}),i={...e,_id:n};return(0,I._)(eJ(this,this.#t,i,s))}unpublishVersion({releaseId:e,publishedId:t},r){let s=_(t,e);return(0,h.s)(eX(this,this.#t,s,t,r))}mutate(e,t){return(0,h.s)(eK(this,this.#t,e,t))}patch(e,t){return new e_(e,t,this)}transaction(e){return new eP(e,this)}action(e,t){return(0,h.s)(eZ(this,this.#t,e,t))}request(e){return(0,h.s)(e4(this,this.#t,e))}dataRequest(e,t,r){return(0,h.s)(e0(this,this.#t,e,t,r))}getUrl(e,t){return e9(this,e,t)}getDataUrl(e,t){return e8(this,e,t)}}let tP=function(e,t){return{requester:G(e),createClient:r=>{let s=G(e,{ignoreWarnings:r.ignoreWarnings});return new t((e,t)=>(t||s)({maxRedirects:0,maxRetries:r.maxRetries,retryDelay:r.retryDelay,lineage:r.lineage,...e}),r)}}}([],tD),tA=(tP.requester,tP.createClient);var tM=r(84601),tU=r(77525),tV=r(67909),tL=r(20063),tN=r(12115),tz=r(88106),tH=r(99652);let tW=(0,tV.default)(()=>r.e(5895).then(r.bind(r,85895)),{loadableGenerated:{webpack:()=>[require.resolveWeak("../_chunks-es/PresentationComlink.js")]},ssr:!1}),tF=(0,tV.default)(()=>r.e(1598).then(r.bind(r,91598)),{loadableGenerated:{webpack:()=>[require.resolveWeak("../_chunks-es/RefreshOnMount.js")]},ssr:!1}),tB=(0,tV.default)(()=>r.e(1539).then(r.bind(r,91539)),{loadableGenerated:{webpack:()=>[require.resolveWeak("../_chunks-es/RefreshOnFocus.js")]},ssr:!1}),tG=(0,tV.default)(()=>r.e(7234).then(r.bind(r,17234)),{loadableGenerated:{webpack:()=>[require.resolveWeak("../_chunks-es/RefreshOnReconnect.js")]},ssr:!1});function tQ(e){var t;e instanceof F?console.warn("Sanity Live is unable to connect to the Sanity API as the current origin - ".concat(window.origin," - is not in the list of allowed CORS origins for this Sanity Project."),e.addOriginUrl&&"Add it here:",null==(t=e.addOriginUrl)?void 0:t.toString()):console.error(e)}
13function tY(e,t){t?console.warn("Sanity Live connection closed, switching to long polling set to a interval of",t/1e3,"seconds and the server gave this reason:",e.reason):console.error("Sanity Live connection closed, automatic revalidation is disabled, the server gave this reason:",e.reason)}function tJ(e){let{projectId:t,dataset:r,apiHost:n,apiVersion:i,useProjectHostname:a,token:o,requestTagPrefix:u,draftModeEnabled:c,draftModePerspective:l,refreshOnMount:d=!1,refreshOnFocus:h=!c&&(typeof window>"u"||window.self===window.top),refreshOnReconnect:p=!0,intervalOnGoAway:f=3e4,requestTag:g="next-loader.live",onError:y=tQ,onGoAway:m=tY,revalidateSyncTags:b=tM.Q}=e,v=(0,tN.useMemo)(()=>tA({projectId:t,dataset:r,apiHost:n,apiVersion:i,useProjectHostname:a,ignoreBrowserTokenWarning:!0,token:o,useCdn:!1,requestTagPrefix:u}),[n,i,r,t,u,o,a]),[w,q]=(0,tN.useState)(!1),R=(0,tL.useRouter)(),I=(0,tz.J)(e=>{"message"===e.type?b(e.tags):"restart"===e.type||"reconnect"===e.type?R.refresh():"goaway"===e.type&&(m(e,f),q(f))});(0,tN.useEffect)(()=>{let e=v.live.events({includeDrafts:!!o,tag:g}).subscribe({next:I,error:e=>{y(e)}});return()=>e.unsubscribe()},[v.live,y,g,o]),(0,tN.useEffect)(()=>{c&&l?(0,tH.NL)(l):(0,tH.NL)("unknown")},[c,l]);let[$,E]=(0,tN.useState)(!1);(0,tN.useEffect)(()=>{if(!(0,tU.vY)()){if(c&&o)return void(0,tH.kN)("live");if(c)return void(0,tH.kN)("static");(0,tH.kN)("unknown")}},[c,o]),(0,tN.useEffect)(()=>{if(!(0,tU.vY)())return;let e=new AbortController,t=setTimeout(()=>(0,tH.kN)("live"),3e3);return window.addEventListener("message",r=>{let{data:s}=r;s&&"object"==typeof s&&"domain"in s&&"sanity/channels"===s.domain&&"from"in s&&"presentation"===s.from&&(clearTimeout(t),(0,tH.kN)((0,tU.v$)()?"presentation-window":"presentation-iframe"),E(!0),e.abort())},{signal:e.signal}),()=>{clearTimeout(t),e.abort()}},[]);let T=(0,tN.useRef)(void 0);return(0,tN.useEffect)(()=>{if(c)return clearTimeout(T.current),()=>{T.current=setTimeout(()=>{console.warn("Sanity Live: Draft mode was enabled, but is now being disabled")})}},[c]),(0,tN.useEffect)(()=>{if(!w)return;let e=setInterval(()=>R.refresh(),w);return()=>clearInterval(e)},[w,R]),(0,s.jsxs)(s.Fragment,{children:[c&&$&&(0,s.jsx)(tW,{projectId:t,dataset:r,draftModeEnabled:c,draftModePerspective:l}),!c&&d&&(0,s.jsx)(tF,{}),!c&&h&&(0,s.jsx)(tB,{}),!c&&p&&(0,s.jsx)(tG,{})]})}tJ.displayName="SanityLive"},36552:(e,t,r)=>{function s(e){let{moduleIds:t}=e;return null}Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"PreloadChunks",{enumerable:!0,get:function(){return s}}),r(95155),r(47650),r(8567),r(77278)},45082:(e,t,r)=>{r.d(t,{default:()=>i});var s=r(95155);let n=(0,r(67909).default)(()=>r.e(4742).then(r.bind(r,64742)),{loadableGenerated:{webpack:()=>[require.resolveWeak("../_chunks-es/SanityLiveStream.js")]},ssr:!1});function i(e){return(0,s.jsx)(n,{...e})}},46990:(e,t,r)=>{function s(e){return"object"==typeof e&&null!==e&&!Array.isArray(e)}r.d(t,{Q:()=>d,u4:()=>s,y:()=>u});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},i={0:8203,1:8204,2:8205,3:65279},a={0:String.fromCodePoint(i[0]),1:String.fromCodePoint(i[1]),2:String.fromCodePoint(i[2]),3:String.fromCodePoint(i[3])},o=[,,,,].fill(String.fromCodePoint(i[0])).join("");function u(e,t,r="auto"){return!0===r||"auto"===r&&(!(!Number.isNaN(Number(e))||/[a-z]/i.test(e)&&!/\d+(?:[-:\/]\d+){2}(?:T\d+(?:[-:\/]\d+){1,2}(\.\d+)?Z?)?/.test(e))&&Date.parse(e)||function(e){try{new URL(e,e.startsWith("/")?"https://acme.com":void 0)}catch{return!1}return!0}(e))?e:`${e}${function(e){let t=JSON.stringify(e),r=new TextEncoder().encode(t),s="";for(let e=0;e<r.length;e++){let t=r[e];s+=a[t>>6&3]+a[t>>4&3]+a[t>>2&3]+a[3&t]}return o+s}(t)}`}Object.fromEntries(Object.entries(a).map(e=>[e[1],+e[0]])),Object.fromEntries(Object.entries(n).map(e=>e.reverse()));var c=`${Object.values(n).map(e=>`\\u{${e.toString(16)}}`).join("")}`,l=RegExp(`[${c}]{4,}`,"gu");function d(e){var t,r;return e&&JSON.parse({cleaned:(t=JSON.stringify(e)).replace(l,""),encoded:(null==(r=t.match(l))?void 0:r[0])||""}.cleaned)}},64054:(e,t)=>
13{Object.defineProperty(t,"__esModule",{value:!0}),!function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(t,{bindSnapshot:function(){return a},createAsyncLocalStorage:function(){return i},createSnapshot:function(){return o}});let r=Object.defineProperty(Error("Invariant: AsyncLocalStorage accessed in runtime where it is not available"),"__NEXT_ERROR_CODE",{value:"E504",enumerable:!1,configurable:!0});class s{disable(){throw r}getStore(){}run(){throw r}exit(){throw r}enterWith(){throw r}static bind(e){return e}}let n="undefined"!=typeof globalThis&&globalThis.AsyncLocalStorage;function i(){return n?new n:new s}function a(e){return n?n.bind(e):s.bind(e)}function o(){return n?n.snapshot():function(e,...t){return e(...t)}}},67909:(e,t,r)=>{r.d(t,{default:()=>n.a});var s=r(86278),n=r.n(s)},77525:(e,t,r)=>{r.d(t,{Fk:()=>c,jF:()=>u,v$:()=>l,vY:()=>d});var s=r(13068);let n={"handshake/syn":s.Tx,"handshake/syn-ack":s.Rr,"handshake/ack":s.IM,"channel/response":s._K,"channel/heartbeat":s.vd,"channel/disconnect":s.FS,"overlay/focus":"visual-editing/focus","overlay/navigate":"visual-editing/navigate","overlay/toggle":"visual-editing/toggle","presentation/toggleOverlay":"presentation/toggle-overlay"},i={[s.Tx]:"handshake/syn",[s.Rr]:"handshake/syn-ack",[s.IM]:"handshake/ack",[s._K]:"channel/response",[s.vd]:"channel/heartbeat",[s.FS]:"channel/disconnect","visual-editing/focus":"overlay/focus","visual-editing/navigate":"overlay/navigate","visual-editing/toggle":"overlay/toggle","presentation/toggle-overlay":"presentation/toggleOverlay"},a=e=>{let{data:t}=e;return t&&"object"==typeof t&&"domain"in t&&"type"in t&&"from"in t&&"to"in t&&("sanity/channels"===t.domain&&(t.domain=s.V2),"overlays"===t.to&&(t.to="visual-editing"),"overlays"===t.from&&(t.from="visual-editing"),t.channelId=t.connectionId,delete t.connectionId,t.type=n[t.type]??t.type),e},o=({context:e},t)=>{let{sources:r,targetOrigin:n}=e,a=(e=>{let{channelId:t,...r}=e,n={...r,connectionId:t};return n.domain===s.V2&&(n.domain="sanity/channels"),"visual-editing"===n.to&&(n.to="overlays"),"visual-editing"===n.from&&(n.from="overlays"),n.type=i[n.type]??n.type,"channel/response"===n.type&&n.responseTo&&!n.data&&(n.data={responseTo:n.responseTo}),("handshake/syn"===n.type||"handshake/syn-ack"===n.type||"handshake/ack"===n.type)&&(n.data={id:n.connectionId}),n})(t.message);r.forEach(e=>{e.postMessage(a,{targetOrigin:n})})},u=()=>({listen:(0,s.CC)(a),requestMachine:(0,s.tP)().provide({actions:{"send message":o}})});function c(){return window.self!==window.top}function l(){return!!window.opener}function d(){return c()||l()}},86278:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"default",{enumerable:!0,get:function(){return n}});let s=r(28140)._(r(1150));function n(e,t){var r;let n={};"function"==typeof e&&(n.loader=e);let i={...n,...t};return(0,s.default)({...i,modules:null==(r=i.loadableGenerated)?void 0:r.modules})}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},98061:(e,t,r)=>{r.d(t,{default:()=>a});var s=r(95155),n=r(12115);let i=(0,n.lazy)(()=>Promise.all([r.e(6678),r.e(6654),r.e(9910),r.e(9982),r.e(9452),r.e(3874),r.e(6271)]).then(r.bind(r,43874)));function a(e){return(0,s.jsx)(n.Suspense,{fallback:null,children:(0,s.jsx)(i,{...e})})}},99652:(e,t,r)=>{r.d(t,{El:()=>l,Hi:()=>u,NL:()=>i,kN:()=>o,lc:()=>d,sq:()=>c});let s=new Set,n="checking";function i(e){if(n!==e)for(let t of(n=e,s))t()}let a=new Set;function o(e){for(let e of a)e()}let u=new Set,c=null;function l(e){for(let t of(c=e,u))t()}function d(e,t){for(let e of u)e()}}}]);
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.