1const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./BDHN2OsX.js","./CMWYLu75.js","./DDBFNsVF.js","./entry.B3TACKOb.css"])))=>i.map(i=>d[i]); 2import{W as zr,$ as _i,a0 as Si,h as Ci,a1 as Ai,O as Ht,a2 as Ti,l as Dt,a3 as Ii,a4 as Ri,r as Oi,a5 as Kt,a6 as $i,a7 as xi,j as Br,a8 as Di,a9 as Pi,aa as Wt,Q as Mi,J as ji,ab as Pt}from"./DDBFNsVF.js";const Li={trailing:!0};function qi(r,e=25,t={}){if(t={...Li,...t},!Number.isFinite(e))throw new TypeError("Expected `wait` to be a finite number");let n,i,s=[],o,a;const c=(d,m)=>(o=Fi(r,d,m),o.finally(()=>{if(o=null,t.trailing&&a&&!i){const y=c(d,a);return a=null,y}}),o),u=function(...d){return t.trailing&&(a=d),o||new Promise(m=>{const y=!i&&t.leading;clearTimeout(i),i=setTimeout(()=>{i=null;const f=t.leading?n:c(this,d);a=null;for(const g of s)g(f);s=[]},e),y?(n=c(this,d),m(n)):s.push(m)})},l=d=>{d&&(clearTimeout(d),i=null)};return u.isPending=()=>!!i,u.cancel=()=>{l(i),s=[],a=null},u.flush=()=>{if(l(i),!a||o)return;const d=a;return a=null,c(this,d)},u}async function Fi(r,e,t){return await r.apply(e,t)}const Vi=Symbol.for("nuxt:client-only");function wc(...r){const e=typeof r[r.length-1]=="string"?r.pop():void 0;Ui(r[0],r[1])&&r.unshift(e);let[t,n,i={}]=r,s=!1;const o=Dt(()=>Pi(t));if(typeof o.value!="string")throw new TypeError("[nuxt] [useAsyncData] key must be a string.");if(typeof n!="function")throw new TypeError("[nuxt] [useAsyncData] handler must be a function.");const a=zr();i.server??=!0,i.default??=Ni,i.getCachedData??=Kr,i.lazy??=!1,i.immediate??=!0,i.deep??=_i.deep,i.dedupe??="cancel",i._functionName,a._asyncData[o.value];function c(){const f={cause:"initial",dedupe:i.dedupe};return a._asyncData[o.value]?._init||(f.cachedData=i.getCachedData(o.value,a,{cause:"initial"}),a._asyncData[o.value]=Gt(a,o.value,n,i,f.cachedData)),()=>a._asyncData[o.value].execute(f)}const u=c(),l=a._asyncData[o.value];l._deps++;const d=i.server!==!1&&a.payload.serverRendered;{let f=function(b){const _=a._asyncData[b];_?._deps&&(_._deps--,_._deps===0&&_?._off())};const g=Ii();if(g&&d&&i.immediate&&!g.sp&&(g.sp=[]),g&&!g._nuxtOnBeforeMountCbs){g._nuxtOnBeforeMountCbs=[];const b=g._nuxtOnBeforeMountCbs;Si(()=>{b.forEach(_=>{_()}),b.splice(0,b.length)}),Ci(()=>b.splice(0,b.length))}const w=g&&(g._nuxtClientOnly||Ai(Vi,!1));d&&a.isHydrating&&(l.error.value||l.data.value!==void 0)?l.status.value=l.error.value?"error":"success":g&&(!w&&a.payload.serverRendered&&a.isHydrating||i.lazy)&&i.immediate?g._nuxtOnBeforeMountCbs.push(u):i.immediate&&l.status.value!=="success"&&u();const p=Ri(),h=Ht(o,(b,_)=>{if((b||_)&&b!==_){s=!0;const S=a._asyncData[_]?.data.value!==void 0,x=a._asyncDataPromises[_]!==void 0,$={cause:"initial",dedupe:i.dedupe};if(!a._asyncData[b]?._init){let T;_&&S?T=a._asyncData[_].data.value:(T=i.getCachedData(b,a,{cause:"initial"}),$.cachedData=T),a._asyncData[b]=Gt(a,b,n,i,T)}a._asyncData[b]._deps++,_&&f(_),(i.immediate||S||x)&&a._asyncData[b].execute($),Wt(()=>{s=!1})}},{flush:"sync"}),v=i.watch?Ht(i.watch,()=>{s||(a._asyncData[o.value]?._execute.isPending()&&Wt(()=>{a._asyncData[o.value]?._execute.flush()}),a._asyncData[o.value]?._execute({cause:"watch",dedupe:i.dedupe}))}):()=>{};p&&Ti(()=>{h(),v(),f(o.value)})}const m={data:Fe(()=>a._asyncData[o.value]?.data),pending:Fe(()=>a._asyncData[o.value]?.pending),status:Fe(()=>a._asyncData[o.value]?.status),error:Fe(()=>a._asyncData[o.value]?.error),refresh:(...f)=>a._asyncData[o.value]?._init?a._asyncData[o.value].execute(...f):c()(),execute:(...f)=>m.refresh(...f),clear:()=>{const f=a._asyncData[o.value];if(f?._abortController)try{f._abortController.abort(new DOMException("AsyncData aborted by user.","AbortError"))}finally{f._abortController=void 0}Hr(a,o.value)}},y=Promise.resolve(a._asyncDataPromises[o.value]).then(()=>m);return Object.assign(y,m),y}function Fe(r){return Dt({get(){return r()?.value},set(e){const t=r();t&&(t.value=e)}})}function Ui(r,e){return!(typeof r=="string"||typeof r=="object"&&r!==null||typeof r=="function"&&typeof e=="function")}function Hr(r,e){e in r.payload.data&&(r.payload.data[e]=void 0),e in r.payload._errors&&(r.payload._errors[e]=void 0),r._asyncData[e]&&(r._asyncData[e].data.value=Br(r._asyncData[e]._default()),r._asyncData[e].error.value=void 0,r._asyncData[e].status.value="idle"),e in r._asyncDataPromises&&(r._asyncDataPromises[e]=void 0)}function ki(r,e){const t={};for(const n of e)t[n]=r[n];return t}function Gt(r,e,t,n,i){r.payload._errors[e]??=void 0;const s=n.getCachedData!==Kr,o=t,a=n.deep?Oi:Kt,c=i!==void 0,u=r.hook("app:data:refresh",async d=>{(!d||d.includes(e))&&await l.execute({cause:"refresh:hook"})}),l={data:a(c?i:n.default()),pending:Dt(()=>l.status.value==="pending"),error:Di(r.payload._errors,e),status:Kt("idle"),execute:(...d)=>{const[m,y=void 0]=d,f=m&&y===void 0&&typeof m=="object"?m:{};if(r._asyncDataPromises[e]&&(f.dedupe??n.dedupe)==="defer")return r._asyncDataPromises[e];
2{const p="cachedData"in f?f.cachedData:n.getCachedData(e,r,{cause:f.cause??"refresh:manual"});if(p!==void 0)return r.payload.data[e]=l.data.value=p,l.error.value=void 0,l.status.value="success",Promise.resolve(p)}l._abortController&&l._abortController.abort(new DOMException("AsyncData request cancelled by deduplication","AbortError")),l._abortController=new AbortController,l.status.value="pending";const g=new AbortController,w=new Promise((p,h)=>{try{const v=f.timeout??n.timeout,b=zi([l._abortController?.signal,f?.signal],g.signal,v);if(b.aborted){const _=b.reason;h(_ instanceof Error?_:new DOMException(String(_??"Aborted"),"AbortError"));return}return b.addEventListener("abort",()=>{const _=b.reason;h(_ instanceof Error?_:new DOMException(String(_??"Aborted"),"AbortError"))},{once:!0,signal:g.signal}),Promise.resolve(o(r,{signal:b})).then(p,h)}catch(v){h(v)}}).then(async p=>{let h=p;n.transform&&(h=await n.transform(p)),n.pick&&(h=ki(h,n.pick)),r.payload.data[e]=h,l.data.value=h,l.error.value=void 0,l.status.value="success"}).catch(p=>{if(r._asyncDataPromises[e]&&r._asyncDataPromises[e]!==w||l._abortController?.signal.aborted)return r._asyncDataPromises[e];if(typeof DOMException<"u"&&p instanceof DOMException&&p.name==="AbortError")return l.status.value="idle",r._asyncDataPromises[e];l.error.value=xi(p),l.data.value=Br(n.default()),l.status.value="error"}).finally(()=>{g.abort(),delete r._asyncDataPromises[e]});return r._asyncDataPromises[e]=w,r._asyncDataPromises[e]},_execute:qi((...d)=>l.execute(...d),0,{leading:!0}),_default:n.default,_deps:0,_init:!0,_hash:void 0,_off:()=>{u(),r._asyncData[e]?._init&&(r._asyncData[e]._init=!1),s||$i(()=>{r._asyncData[e]?._init||(Hr(r,e),l.execute=()=>Promise.resolve())})}};return l}const Ni=()=>{},Kr=(r,e,t)=>{if(e.isHydrating)return e.payload.data[r];if(t.cause!=="refresh:manual"&&t.cause!=="refresh:hook")return e.static.data[r]};function zi(r,e,t){const n=r.filter(o=>!!o);if(typeof t=="number"&&t>=0){const o=AbortSignal.timeout?.(t);o&&n.push(o)}if(AbortSignal.any)return AbortSignal.any(n);const i=new AbortController;for(const o of n)if(o.aborted){const a=o.reason??new DOMException("Aborted","AbortError");try{i.abort(a)}catch{i.abort()}return i.signal}const s=()=>{const a=n.find(c=>c.aborted)?.reason??new DOMException("Aborted","AbortError");try{i.abort(a)}catch{i.abort()}};for(const o of n)o.addEventListener?.("abort",s,{once:!0,signal:e});return i.signal}const Bi={publication:"https://placehold.co/400x600/008ca9/ffffff?text=Publicación"},Ve=`( 3 coalesce(language, "es") == $locale || 4 (coalesce(language, "es") == "es" && $locale != "es" 5 && !defined(*[_type == "translation.metadata" && references(^._id)][0].translations[_
5key == $locale][0].value->_id)) 6)`,Ec={allNews:`*[_type == "newsArticle" && ${Ve}] | order(publishedAt desc) { 7 "id": _id, 8 "slug": slug.current, 9 title, 10 subtitle, 11 excerpt, 12 body, 13 "image": image.asset->url, 14 "imageOrientation": coalesce(imageOrientation, "horizontal"), 15 "imageCrop": coalesce(imageCrop, "crop"), 16 category, 17 publishedAt, 18 author, 19 links, 20 "pdfs": pdfs[] { label, "url": file.asset->url }, 21 "relatedPageSlugs": relatedPages[]->slug.current, 22 "relatedEventSlugs": relatedEvents[]->slug.current 23 }`,allPages:`*[_type == "page" && ${Ve}] | order(order asc) { 24 "id": _id, 25 "slug": slug.current, 26 title, 27 description, 28 body, 29 "image": image.asset->url, 30 scope, 31 order, 32 tags, 33 "pdfs": pdfs[] { label, "url": file.asset->url } 34 }`,allPublications:`*[_type == "publication" && ${Ve}] | order(year desc) { 35 "id": _id, 36 "slug": slug.current, 37 title, 38 description, 39 "coverImage": coalesce(coverImage.asset->url, "${Bi.publication}"), 40 type, 41 year, 42 downloadUrl, 43 externalUrl, 44 author, 45 illustrator, 46 publisher, 47 pages, 48 isbn, 49 ageRange, 50 language, 51 featured 52 }`,allDestacadosLij:`*[_type == "destacadoLij"] | order(order desc) { 53 "id": _id, 54 title, 55 "image": image.asset->url, 56 "pdfUrl": pdf.asset->url, 57 order 58 }`,allMemorias:`*[_type == "memoria"] | order(order desc) { 59 "id": _id, 60 title, 61 "pdfUrl": pdf.asset->url, 62 order 63 }`,allResources:`*[_type == "resource" && ${Ve}] { 64 "id": _id, 65 title, 66 description, 67 type, 68 url, 69 category 70 }`,navigation:`*[_type == "navigation" && (language == $locale || language == null)][0] { 71 items[] { 72 label, 73 "to": route, 74 children[] { 75 label, 76 "to": route, 77 external, 78 children[] { 79 label, 80 "to": route, 81 external 82 } 83 } 84 } 85 }`},Wr=()=>{const r=ji();return Mi({},r.public.sanity)},Hi=r=>{if(!r)return;const e=new Map;return{notify(t,n){e.forEach(i=>{const s=()=>{i.lastLiveEventId=n};i.callback(t,s)})},subscribe(t,n){return e.set(t,{lastLiveEventId:void 0,callback:n}),{getLastLiveEventId:()=>e.get(t)?.lastLiveEventId,unsubscribe:()=>{e.delete(t)}}}}};var ct={},Jt,Qt;function Ki(){return Qt||(Qt=1,Jt={kValues:Symbol("values"),kStorage:Symbol("kStorage"),kStorages:Symbol("kStorages"),kTransfromer:Symbol("kTransformer"),kTTL:Symbol("kTTL"),kOnDedupe:Symbol("kOnDedupe"),kOnError:Symbol("kOnError"),kOnHit:Symbol("kOnHit"),kOnMiss:Symbol("kOnMiss"),kStale:Symbol("kStale")}),Jt}var ut={exports:{}},Yt;function Gr(){return Yt||(Yt=1,(function(r,e){const{hasOwnProperty:t}=Object.prototype,n=p();n.configure=p,n.stringify=n,n.default=n,e.stringify=n,e.configure=p,r.exports=n;const i=/[\u0000-\u001f\u0022\u005c\ud800-\udfff]/;function s(h){return h.length<5e3&&!i.test(h)?`"${h}"`:JSON.stringify(h)}function o(h,v){if(h.length>200||v)return h.sort(v);for(let b=1;b<h.length;b++){const _=h[b];let S=b;for(;S!==0&&h[S-1]>_;)h[S]=h[S-1],S--;h[S]=_}return h}const a=Object.getOwnPropertyDescriptor(Object.getPrototypeOf(Object.getPrototypeOf(new Int8Array)),Symbol.toStringTag).get;function c(h){return a.call(h)!==void 0&&h.length!==0}function u(h,v,b){h.length<b&&(b=h.length);const _=v===","?"":" ";let S=`"0":${_}${h[0]}`;for(let x=1;x<b;x++)S+=`${v}"${x}":${_}${h[x]}`;return S}function l(h){if(t.call(h,"circularValue")){const v=h.circularValue;if(typeof v=="string")return`"${v}"`;if(v==null)return v;if(v===Error||v===TypeError)return{toString(){throw new TypeError("Converting circular structure to JSON")}};throw new TypeError('The "circularValue" argument must be of type string or the value null or undefined')}return'"[Circular]"'}function d(h){let v;if(t.call(h,"deterministic")&&(v=h.deterministic,typeof v!="boolean"&&typeof v!="function"))throw new TypeError('The "deterministic" argument must be of type boolean or comparator function');return v===void 0?!0:v}function m(h,v){let b;if(t.call(h,v)&&(b=h[v],typeof b!="boolean"))throw new TypeError(`The "${v}" argument must be of type boolean`);return b===void 0?!0:b}function y(h,v){let b;if(t.call(h,v)){if(b=h[v],typeof b!="number")throw new TypeError(`The "${v}" argument must be of type number`);if(!Number.isInteger(b))throw new TypeError(`The "${v}" argument must be an integer`);if(b<1)throw new RangeError(`The "${v}" argument must be >= 1`)}return b===void 0?1/0:b}function f(h){return h===1?"1 item":`${h} items`}function g(h){const v=new Set;for(const b of h)(typeof b=="string"||typeof b=="number")&&v.add(String(b));return v}function w(h){if(t.call(h,"strict")){const v=h.strict;if(typeof v!="boolean")throw new TypeError('The "strict" argument must be of type boolean');if(v)return b=>{let _=`Object can not safely be stringified. Received type ${typeof b}`;throw typeof b!="function"&&(_+=` (${b.toString()})`),new Error(_)}}}function p(h){h={...h};const v=w(h);v&&(h.bigint===void 0&&(h.bigint=!1),"circularValue"in h||(h.circularValue=Error));const b=l(h),_=m(h,"bigint"),S=d(h),x=typeof S=="function"?S:void 0,$=y(h,"maximumDepth"),T=y(h,"maximumBreadth");function G(D,E,C,I,O,M){let A=E[D];switch(typeof A=="object"&&A!==null&&typeof A.toJSON=="function"&&(A=A.toJSON(D)),A=I.call(E,D,A),typeof A){case"string":return s(A);case"object":{if(A===null)return"null";if(C.indexOf(A)!==-1)return b;let P="",k=",";const N=M;if(Array.isArray(A)){if(A.length===0)return"[]";
85if($<C.length+1)return'"[Array]"';C.push(A),O!==""&&(M+=O,P+=` 86${M}`,k=`, 87${M}`);const W=Math.min(A.length,T);let te=0;for(;te<W-1;te++){const qe=G(String(te),A,C,I,O,M);P+=qe!==void 0?qe:"null",P+=k}const re=G(String(te),A,C,I,O,M);if(P+=re!==void 0?re:"null",A.length-1>T){const qe=A.length-T-1;P+=`${k}"... ${f(qe)} not stringified"`}return O!==""&&(P+=` 88${N}`),C.pop(),`[${P}]`}let L=Object.keys(A);const z=L.length;if(z===0)return"{}";if($<C.length+1)return'"[Object]"';let j="",K="";O!==""&&(M+=O,k=`, 89${M}`,j=" ");const Q=Math.min(z,T);S&&!c(A)&&(L=o(L,x)),C.push(A);for(let W=0;W<Q;W++){const te=L[W],re=G(te,A,C,I,O,M);re!==void 0&&(P+=`${K}${s(te)}:${j}${re}`,K=k)}if(z>T){const W=z-T;P+=`${K}"...":${j}"${f(W)} not stringified"`,K=k}return O!==""&&K.length>1&&(P=` 90${M}${P} 91${N}`),C.pop(),`{${P}}`}case"number":return isFinite(A)?String(A):v?v(A):"null";case"boolean":return A===!0?"true":"false";case"undefined":return;case"bigint":if(_)return String(A);default:return v?v(A):void 0}}function X(D,E,C,I,O,M){switch(typeof E=="object"&&E!==null&&typeof E.toJSON=="function"&&(E=E.toJSON(D)),typeof E){case"string":return s(E);case"object":{if(E===null)return"null";if(C.indexOf(E)!==-1)return b;const A=M;let P="",k=",";if(Array.isArray(E)){if(E.length===0)return"[]";if($<C.length+1)return'"[Array]"';C.push(E),O!==""&&(M+=O,P+=` 92${M}`,k=`, 93${M}`);const z=Math.min(E.length,T);let j=0;for(;j<z-1;j++){const Q=X(String(j),E[j],C,I,O,M);P+=Q!==void 0?Q:"null",P+=k}const K=X(String(j),E[j],C,I,O,M);if(P+=K!==void 0?K:"null",E.length-1>T){const Q=E.length-T-1;P+=`${k}"... ${f(Q)} not stringified"`}return O!==""&&(P+=` 94${A}`),C.pop(),`[${P}]`}C.push(E);let N="";O!==""&&(M+=O,k=`, 95${M}`,N=" ");let L="";for(const z of I){const j=X(z,E[z],C,I,O,M);j!==void 0&&(P+=`${L}${s(z)}:${N}${j}`,L=k)}return O!==""&&L.length>1&&(P=` 96${M}${P} 97${A}`),C.pop(),`{${P}}`}case"number":return isFinite(E)?String(E):v?v(E):"null";case"boolean":return E===!0?"true":"false";case"undefined":return;case"bigint":if(_)return String(E);default:return v?v(E):void 0}}function B(D,E,C,I,O){switch(typeof E){case"string":return s(E);case"object":{if(E===null)return"null";if(typeof E.toJSON=="function"){if(E=E.toJSON(D),typeof E!="object")return B(D,E,C,I,O);if(E===null)return"null"}if(C.indexOf(E)!==-1)return b;const M=O;if(Array.isArray(E)){if(E.length===0)return"[]";if($<C.length+1)return'"[Array]"';C.push(E),O+=I;let j=` 98${O}`;const K=`, 99${O}`,Q=Math.min(E.length,T);let W=0;for(;W<Q-1;W++){const re=B(String(W),E[W],C,I,O);j+=re!==void 0?re:"null",j+=K}const te=B(String(W),E[W],C,I,O);if(j+=te!==void 0?te:"null",E.length-1>T){const re=E.length-T-1;j+=`${K}"... ${f(re)} not stringified"`}return j+=` 100${M}`,C.pop(),`[${j}]`}let A=Object.keys(E);const P=A.length;if(P===0)return"{}";if($<C.length+1)return'"[Object]"';O+=I;const k=`, 101${O}`;let N="",L="",z=Math.min(P,T);c(E)&&(N+=u(E,k,T),A=A.slice(E.length),z-=E.length,L=k),S&&(A=o(A,x)),C.push(E);for(let j=0;j<z;j++){const K=A[j],Q=B(K,E[K],C,I,O);Q!==void 0&&(N+=`${L}${s(K)}: ${Q}`,L=k)}if(P>T){const j=P-T;N+=`${L}"...": "${f(j)} not stringified"`,L=k}return L!==""&&(N=` 102${O}${N} 103${M}`),C.pop(),`{${N}}`}case"number":return isFinite(E)?String(E):v?v(E):"null";case"boolean":return E===!0?"true":"false";case"undefined":return;case"bigint":if(_)return String(E);default:return v?v(E):void 0}}function Z(D,E,C){switch(typeof E){case"string":return s(E);case"object":{if(E===null)return"null";if(typeof E.toJSON=="function"){if(E=E.toJSON(D),typeof E!="object")return Z(D,E,C);if(E===null)return"null"}if(C.indexOf(E)!==-1)return b;let I="";const O=E.length!==void 0;if(O&&Array.isArray(E)){if(E.length===0)return"[]";if($<C.length+1)return'"[Array]"';C.push(E);const N=Math.min(E.length,T);let L=0;for(;L<N-1;L++){const j=Z(String(L),E[L],C);I+=j!==void 0?j:"null",I+=","}const z=Z(String(L),E[L],C);if(I+=z!==void 0?z:"null",E.length-1>T){const j=E.length-T-1;I+=`,"... ${f(j)} not stringified"`}return C.pop(),`[${I}]`}let M=Object.keys(E);const A=M.length;if(A===0)return"{}";if($<C.length+1)return'"[Object]"';let P="",k=Math.min(A,T);O&&c(E)&&(I+=u(E,",",T),M=M.slice(E.length),k-=E.length,P=","),S&&(M=o(M,x)),C.push(E);for(let N=0;N<k;N++){const L=M[N],z=Z(L,E[L],C);z!==void 0&&(I+=`${P}${s(L)}:${z}`,P=",")}if(A>T){const N=A-T;I+=`${P}"...":"${f(N)} not stringified"`}return C.pop(),`{${I}}`}case"number":return isFinite(E)?String(E):v?v(E):"null";case"boolean":return E===!0?"true":"false";case"undefined":return;case"bigint":if(_)return String(E);default:return v?v(E):void 0}}function ee(D,E,C){if(arguments.length>1){let I="";if(typeof C=="number"?I=" ".repeat(Math.min(C,10)):typeof C=="string"&&(I=C.slice(0,10)),E!=null){if(typeof E=="function")return G("",{"":D},[],E,I,"");if(Array.isArray(E))return X("",D,[],g(E),I,"")}if(I.length!==0)return B("",D,[],I,"")}return Z("",D,[])}return ee}})(ut,ut.exports)),ut.exports}var lt,Xt;function He(){if(Xt)return lt;Xt=1;function r(c,u){const l=[];let d=0;for(let m=0;m<c.length;m++)for(let y=d;y<u.length;y++)c[m]===u[y]&&(l.push(y),d=y+1);return l}function e(c,u){const l=[];let d=0;for(let m=0;m<c.length;m++)for(let y=d;y<u.length;y++)c[m]!==u[y]&&(l.push(u[y]),d=y+1);return l}function t(c,u){let l=0,d=c.length-1;for(;l<=d;){const m=(l+d)/2|0;if(c[m]===u)return m;c[m]<u?l=m+1:d=m-1}return-1}function n(c){return c*Math.random()|0}function i(c,u){return c=Math.floor(c),u=Math.floor(u),c+n(1+u-c)}function s(c,u){if(c.length<1||u<1)return[];const l=Math.min(c.length,u),d=i(1,l),m=new Set;for(let f=0;f<d;f++)m.add(n(c.length));const y=[];for(const f of m)y.push(c[f]);return y}function o(c,u){if(c==="*"||c.length===u.length&&c===u)return!0;let l=0,d=0;for(;l<c.length&&d<u.length;){if(c[l]===u[d]){l++,d++;continue}if(c[l]==="*"){if(c[l+1]===u[d]){l++;continue}d++;continue}return!1}return l>=c.length-1}function a(){const c=()=>{};return{fatal:c,error:c,warn:c,info:c,debug:c,trace:c}}
103return lt={findNotMatching:e,findMatchingIndexes:r,bsearchIndex:t,wildcardMatch:o,randomSubset:s,abstractLogging:a,isServerSide:typeof window>"u"},lt}var ft,Zt;function Jr(){if(Zt)return ft;Zt=1;class r{constructor(t){this.options=t}async get(t){throw new Error("storage get method not implemented")}async set(t,n,i,s){throw new Error("storage set method not implemented")}async remove(t){throw new Error("storage remove method not implemented")}async invalidate(t){throw new Error("storage invalidate method not implemented")}async clear(t){throw new Error("storage clear method not implemented")}async refresh(){throw new Error("storage refresh method not implemented")}}return ft=r,ft}var ht,er;function Wi(){if(er)return ht;er=1;const r=Gr(),e=Jr(),{findNotMatching:t,randomSubset:n,abstractLogging:i}=He(),s=64,o=64,a=60;class c extends e{constructor(l={}){if(!l.client||typeof l.client!="object")throw new Error("Redis client is required");if(super(l),l.invalidation&&l.invalidation.referencesTTL&&(typeof l.invalidation.referencesTTL!="number"||l.invalidation.referencesTTL<1))throw new Error("invalidation.referencesTTL must be a positive integer greater than 1");this.log=l.log||i(),this.store=l.client,this.invalidation=!!l.invalidation,this.referencesTTL=l.invalidation&&l.invalidation.referencesTTL||a}getReferenceKeyLabel(l){return`r:${l}`}getKeyReferenceLabel(l){return`k:${l}`}async get(l){this.log.debug({msg:"acd/storage/redis.get",key:l});try{const d=await this.store.get(l);if(!d){if(!this.invalidation)return;this.clearReferences(l);return}return JSON.parse(d)}catch(d){this.log.error({msg:"acd/storage/redis.get error",err:d,key:l})}}async getTTL(l){this.log.debug({msg:"acd/storage/memory.getTTL",key:l});let d=await this.store.pttl(l);return d<0?0:(d=Math.ceil(d/1e3),d)}async set(l,d,m,y){if(this.log.debug({msg:"acd/storage/redis.set key",key:l,value:d,ttl:m,references:y}),m=Number(m),!(!m||m<0))try{if(await this.store.set(l,r(d),"EX",m),!y||y.length<1)return;if(!this.invalidation){this.log.warn({msg:"acd/storage/redis.set, invalidation is disabled, references are useless",key:l,references:y});return}const f=[],g=await this.store.smembers(this.getKeyReferenceLabel(l));if(this.log.debug({msg:"acd/storage/redis.set current references",key:l,currentReferences:g}),g.length>1){g.sort(),y.sort();const h=t(y,g);for(const v of h)f.push(["srem",this.getReferenceKeyLabel(v),l]);f.push(["del",this.getKeyReferenceLabel(l)])}const w=g.length>1?t(g,y):y;this.log.debug({msg:"acd/storage/redis.set references to add",key:l,referencesToAdd:w});for(let h=0;h<w.length;h++){const v=w[h],b=this.getReferenceKeyLabel(v);f.push(["sadd",b,l]),f.push(["expire",b,this.referencesTTL])}const p=this.getKeyReferenceLabel(l);f.push(["sadd",p,y]),f.push(["expire",p,m]),this.log.debug({msg:"acd/storage/redis.set references writes",writes:f}),await this.store.pipeline(f).exec()}catch(f){this.log.error({msg:"acd/storage/redis.set error",err:f,key:l,ttl:m,references:y})}}async remove(l){this.log.debug({msg:"acd/storage/redis.remove",key:l});try{const d=await this.store.del(l)>0;return d&&this.invalidation&&await this.clearReferences(l),d}catch(d){this.log.error({msg:"acd/storage/redis.remove error",err:d,key:l})}}async invalidate(l){if(!this.invalidation)return this.log.warn({msg:"acd/storage/redis.invalidate, exit due invalidation is disabled"}),[];this.log.debug({msg:"acd/storage/redis.invalidate",references:l});try{return Array.isArray(l)?await this._invalidateReferences(l):await this._invalidateReference(l)}catch(d){return this.log.error({msg:"acd/storage/redis.invalidate error",err:d,references:l}),[]}}async _invalidateReferences(l,d=!0){const m=l.map(w=>["smembers",d?this.getReferenceKeyLabel(w):w]),y=await this.store.pipeline(m).exec();this.log.debug({msg:"acd/storage/redis._invalidateReferences keys",keys:y});const f=[],g=[];for(let w=0;w<y.length;w++){const p=y[w][1];if(p){this.log.debug({msg:"acd/storage/redis._invalidateReferences got keys to be invalidated",keys:p});for(let h=0;h<p.length;h++){const v=p[h];this.log.debug({msg:"acd/storage/redis._invalidateReferences del key"+v}),g.push(v),f.push(["del",v])}}}return await this.store.pipeline(f).exec(),await this.clearReferences(g),g}async _invalidateReference(l){let d;if(l.includes("*")){const f=await this.store.keys(this.getReferenceKeyLabel(l));return this._invalidateReferences(f,!1)}else d=await this.store.smembers(this.getReferenceKeyLabel(l));this.log.debug({msg:"acd/storage/redis._invalidateReference keys",keys:d});const m=[],y=[];for(let f=0;f<d.length;f++){const g=d[f];this.log.debug({msg:"acd/storage/redis._invalidateReference del key"+g}),y.push(g),m.push(["del",g])}return await this.store.pipeline(m).exec(),await this.clearReferences(y),y}async clear(l){this.log.debug({msg:"acd/storage/redis.clear",name:l});try{if(!l){await this.store.flushall();return}const d=await this.store.keys(`${l}*`);this.log.debug({msg:"acd/storage/redis.clear keys",keys:d});const m=d.map(y=>["del",y]);if(await this.store.pipeline(m).exec(),!this.invalidation)return;await this.clearReferences(d)}catch(d){this.log.error({msg:"acd/storage/redis.clear error",err:d,name:l})}}async refresh(){try{await this.store.flushall()}catch(l){this.log.error({msg:"acd/storage/redis.refresh error",err:l})}}async clearReferences(l){try{if(!l){this.log.warn({msg:"acd/storage/redis.clearReferences invalid call due to empty key"});return}Array.isArray(l)||(l=[l]);const d=l.map(f=>["smembers",this.getKeyReferenceLabel(f)]),m=await this.store.pipeline(d).exec();this.log.debug({msg:"acd/storage/redis.clearReferences references",keys:l,referencesKeys:m});const y={};for(let f=0;f<l.length;f++){for(let w=0;w<m[f][1].length;w++){const p=this.getReferenceKeyLabel(m[f][1][w]);
103y[p]||(y[p]=["srem",p,l])}const g=this.getKeyReferenceLabel(l[f]);y[g]=["del",g]}this.log.debug({msg:"acd/storage/redis.clearReferences writes pipeline",writes:y}),await this.store.pipeline(Object.values(y)).exec()}catch(d){this.log.error({msg:"acd/storage/redis.clearReferences error",err:d})}}async gc(l="lazy",d={}){if(this.log.debug({msg:"acd/storage/redis.gc",mode:l,options:d}),!this.invalidation){this.log.warn({msg:"acd/storage/redis.gc does not run due to invalidation is disabled"});return}l!=="strict"&&l!=="lazy"&&(l="lazy");const m={references:{scanned:[],removed:[]},keys:{scanned:new Set,removed:new Set},loops:0,cursor:0,error:null};try{let y=0,f=o;if(d.chunk&&(typeof d.chunk!="number"||d.chunk<1))return m.error=new Error("chunk must be a positive integer greater than 1"),m;if(d.lazy){if(d.lazy.chunk){if(typeof d.lazy.chunk!="number"||d.lazy.chunk<1)return m.error=new Error("lazy.chunk must be a positive integer greater than 1"),m;f=d.lazy.chunk}if(d.lazy.cursor){if(typeof d.lazy.cursor!="number"||d.lazy.cursor<0)return m.error=new Error("lazy.cursor must be a positive integer greater than 0"),m;y=d.lazy.cursor}}const g=d.chunk||s,w=Math.min(f,g),p=y;let h=-1,v=-1;do{m.loops++;const b=await this.store.scan(y,"match","r:*","count",w);y=Number(b[0]),h=b[1].length;const _=l==="lazy"?n(b[1],f):b[1];m.references.scanned=m.references.scanned.concat(_);let S=[];for(let D=0;D<_.length;D++){const E=_[D];S.push(["smembers",E])}const x=await this.store.pipeline(S).exec(),$={},T={};for(let D=0;D<x.length;D++){const E=x[D],C=_[D];T[C]=E[1];for(let I=0;I<E[1].length;I++){const O=E[1][I];$[O]?$[O].push(C):$[O]=[C],m.keys.scanned.add(O)}}const G=Object.keys($);S=G.map(D=>["exists",D]);const X=await this.store.pipeline(S).exec(),B={};for(let D=0;D<G.length;D++){const E=G[D];if(X[D][1]!==1)for(let C=0;C<$[E].length;C++){const I=$[E][C];B[I]?B[I].push(E):B[I]=[E],m.keys.removed.add(E)}}const Z=Object.keys(B),ee=[];for(let D=0;D<Z.length;D++){const E=Z[D];T[E].length===B[E].length?(ee.push(["del",E]),m.references.removed.push(E)):ee.push(["srem",E,B[E]])}if(await this.store.pipeline(ee).exec(),v=ee.length,l==="lazy"&&m.references.scanned.length>=f)break}while(p!==y&&h>0&&v>0);m.cursor=y,m.keys.scanned=Array.from(m.keys.scanned),m.keys.removed=Array.from(m.keys.removed)}catch(y){this.log.error({msg:"acd/storage/redis.gc error",err:y}),m.error=y}return m}}return ht=c,ht}var dt,tr;function Gi(){if(tr)return dt;tr=1;function r(e){if(typeof e!="function")throw new Error("obliterator/iterator: expecting a function!");this.next=e}return typeof Symbol<"u"&&(r.prototype[Symbol.iterator]=function(){return this}),r.of=function(){var e=arguments,t=e.length,n=0;return new r(function(){return n>=t?{done:!0}:{done:!1,value:e[n++]}})},r.empty=function(){var e=new r(function(){return{done:!0}});return e},r.fromSequence=function(e){var t=0,n=e.length;return new r(function(){return t>=n?{done:!0}:{done:!1,value:e[t++]}})},r.is=function(e){return e instanceof r?!0:typeof e=="object"&&e!==null&&typeof e.next=="function"},dt=r,dt}var gt={},rr;function Ji(){return rr||(rr=1,gt.ARRAY_BUFFER_SUPPORT=typeof ArrayBuffer<"u",gt.SYMBOL_SUPPORT=typeof Symbol<"u"),gt}var pt,nr;function Qr(){if(nr)return pt;nr=1;var r=Ji(),e=r.ARRAY_BUFFER_SUPPORT,t=r.SYMBOL_SUPPORT;return pt=function(n,i){var s,o,a,c,u;if(!n)throw new Error("obliterator/forEach: invalid iterable.");if(typeof i!="function")throw new Error("obliterator/forEach: expecting a callback.");if(Array.isArray(n)||e&&ArrayBuffer.isView(n)||typeof n=="string"||n.toString()==="[object Arguments]"){for(a=0,c=n.length;a<c;a++)i(n[a],a);return}if(typeof n.forEach=="function"){n.forEach(i);return}if(t&&Symbol.iterator in n&&typeof n.next!="function"&&(n=n[Symbol.iterator]()),typeof n.next=="function"){for(s=n,a=0;u=s.next(),u.done!==!0;)i(u.value,a),a++;return}for(o in n)n.hasOwnProperty(o)&&i(n[o],o)},pt}var ir={},sr;function Yr(){return sr||(sr=1,(function(r){var e=Math.pow(2,8)-1,t=Math.pow(2,16)-1,n=Math.pow(2,32)-1,i=Math.pow(2,7)-1,s=Math.pow(2,15)-1,o=Math.pow(2,31)-1;r.getPointerArray=function(c){var u=c-1;if(u<=e)return Uint8Array;
103if(u<=t)return Uint16Array;if(u<=n)return Uint32Array;throw new Error("mnemonist: Pointer Array of size > 4294967295 is not supported.")},r.getSignedPointerArray=function(c){var u=c-1;return u<=i?Int8Array:u<=s?Int16Array:u<=o?Int32Array:Float64Array},r.getNumberType=function(c){return c===(c|0)?Math.sign(c)===-1?c<=127&&c>=-128?Int8Array:c<=32767&&c>=-32768?Int16Array:Int32Array:c<=255?Uint8Array:c<=65535?Uint16Array:Uint32Array:Float64Array};var a={Uint8Array:1,Int8Array:2,Uint16Array:3,Int16Array:4,Uint32Array:5,Int32Array:6,Float32Array:7,Float64Array:8};r.getMinimalRepresentation=function(c,u){var l=null,d=0,m,y,f,g,w;for(g=0,w=c.length;g<w;g++)f=u?u(c[g]):c[g],y=r.getNumberType(f),m=a[y.name],m>d&&(d=m,l=y);return l},r.isTypedArray=function(c){return typeof ArrayBuffer<"u"&&ArrayBuffer.isView(c)},r.concat=function(){var c=0,u,l,d;for(u=0,d=arguments.length;u<d;u++)c+=arguments[u].length;var m=new arguments[0].constructor(c);for(u=0,l=0;u<d;u++)m.set(arguments[u],l),l+=arguments[u].length;return m},r.indices=function(c){for(var u=r.getPointerArray(c),l=new u(c),d=0;d<c;d++)l[d]=d;return l}})(ir)),ir}var ve={},or;function Qi(){if(or)return ve;or=1;var r=Qr(),e=Yr();function t(o){return Array.isArray(o)||e.isTypedArray(o)}function n(o){if(typeof o.length=="number")return o.length;if(typeof o.size=="number")return o.size}function i(o){var a=n(o),c=typeof a=="number"?new Array(a):[],u=0;return r(o,function(l){c[u++]=l}),c}function s(o){var a=n(o),c=typeof a=="number"?e.getPointerArray(a):Array,u=typeof a=="number"?new Array(a):[],l=typeof a=="number"?new c(a):[],d=0;return r(o,function(m){u[d]=m,l[d]=d++}),[u,l]}return ve.isArrayLike=t,ve.guessLength=n,ve.toArray=i,ve.toArrayWithIndices=s,ve}var yt,ar;function Yi(){if(ar)return yt;ar=1;var r=Gi(),e=Qr(),t=Yr(),n=Qi();function i(s,o,a){if(arguments.length<2&&(a=s,s=null,o=null),this.capacity=a,typeof this.capacity!="number"||this.capacity<=0)throw new Error("mnemonist/lru-cache: capacity should be positive number.");if(!isFinite(this.capacity)||Math.floor(this.capacity)!==this.capacity)throw new Error("mnemonist/lru-cache: capacity should be a finite positive integer.");var c=t.getPointerArray(a);this.forward=new c(a),this.backward=new c(a),this.K=typeof s=="function"?new s(a):new Array(a),this.V=typeof o=="function"?new o(a):new Array(a),this.size=0,this.head=0,this.tail=0,this.items={}}return i.prototype.clear=function(){this.size=0,this.head=0,this.tail=0,this.items={}},i.prototype.splayOnTop=function(s){var o=this.head;if(this.head===s)return this;var a=this.backward[s],c=this.forward[s];return this.tail===s?this.tail=a:this.backward[c]=a,this.forward[a]=c,this.backward[o]=s,this.head=s,this.forward[s]=o,this},i.prototype.set=function(s,o){var a=this.items[s];if(typeof a<"u"){this.splayOnTop(a),this.V[a]=o;return}this.size<this.capacity?a=this.size++:(a=this.tail,this.tail=this.backward[a],delete this.items[this.K[a]]),this.items[s]=a,this.K[a]=s,this.V[a]=o,this.forward[a]=this.head,this.backward[this.head]=a,this.head=a},i.prototype.setpop=function(s,o){var a=null,c=null,u=this.items[s];return typeof u<"u"?(this.splayOnTop(u),a=this.V[u],this.V[u]=o,{evicted:!1,key:s,value:a}):(this.size<this.capacity?u=this.size++:(u=this.tail,this.tail=this.backward[u],a=this.V[u],c=this.K[u],delete this.items[c]),this.items[s]=u,this.K[u]=s,this.V[u]=o,this.forward[u]=this.head,this.backward[this.head]=u,this.head=u,c?{evicted:!0,key:c,value:a}:null)},i.prototype.has=function(s){return s in this.items},i.prototype.get=function(s){var o=this.items[s];if(!(typeof o>"u"))return this.splayOnTop(o),this.V[o]},i.prototype.peek=function(s){var o=this.items[s];if(!(typeof o>"u"))return this.V[o]},i.prototype.forEach=function(s,o){o=arguments.length>1?o:this;for(var a=0,c=this.size,u=this.head,l=this.K,d=this.V,m=this.forward;a<c;)s.call(o,d[u],l[u],this),u=m[u],a++},i.prototype.keys=function(){var s=0,o=this.size,a=this.head,c=this.K,u=this.forward;return new r(function(){if(s>=o)return{done:!0};var l=c[a];return s++,s<o&&(a=u[a]),{done:!1,value:l}})},i.prototype.values=function(){var s=0,o=this.size,a=this.head,c=this.V,u=this.forward;return new r(function(){if(s>=o)return{done:!0};var l=c[a];return s++,s<o&&(a=u[a]),{done:!1,value:l}})},i.prototype.entries=function(){var s=0,o=this.size,a=this.head,c=this.K,u=this.V,l=this.forward;return new r(function(){if(s>=o)return{done:!0};var d=c[a],m=u[a];return s++,s<o&&(a=l[a]),{done:!1,value:[d,m]}})},typeof Symbol<"u"&&(i.prototype[Symbol.iterator]=i.prototype.entries),i.prototype.inspect=function(){for(var s=new Map,o=this.entries(),a;a=o.next(),!a.done;)s.set(a.value[0],a.value[1]);return Object.defineProperty(s,"constructor",{value:i,enumerable:!1}),s},typeof Symbol<"u"&&(i.prototype[Symbol.for("nodejs.util.inspect.custom")]=i.prototype.inspect),i.from=function(s,o,a,c){if(arguments.length<2){if(c=n.guessLength(s),typeof c!="number")throw new Error("mnemonist/lru-cache.from: could not guess iterable length. Please provide desired capacity as last argument.")}else arguments.length===2&&(c=o,o=null,a=null);var u=new i(o,a,c);return e(s,function(l,d){u.set(d,l)}),u},yt=i,yt}var mt,cr;function Xi(){if(cr)return mt;cr=1;const r=Yi(),{abstractLogging:e}=He(),t=Jr(),{findMatchingIndexes:n,findNotMatching:i,bsearchIndex:s,wildcardMatch:o}=He(),a=typeof globalThis.setImmediate<"u"?globalThis.setImmediate:(y,...f)=>setTimeout(y,0,...f),c=1024;class u extends t{constructor(f={}){if(f.size&&(typeof f.size!="number"||f.size<1))throw new Error("size must be a positive integer greater than 0");super(f),this.size=f.size||c,this.log=f.log||e(),this.invalidation=f.invali
103dation||!1,this.init()}init(){this.store=new r(this.size),this.invalidation&&(this.keysReferences=new Map,this.referencesKeys=new Map)}get(f){this.log.debug({msg:"acd/storage/memory.get",key:f});const g=this.store.get(f);if(g){if(this.log.debug({msg:"acd/storage/memory.get, entry",entry:g,now:d()}),g.start+g.ttl>d())return this.log.debug({msg:"acd/storage/memory.get, key is NOT expired",key:f,entry:g}),g.value;this.log.debug({msg:"acd/storage/memory.get, key is EXPIRED",key:f,entry:g}),a(()=>this.remove(f))}}getTTL(f){this.log.debug({msg:"acd/storage/memory.getTTL",key:f});const g=this.store.peek(f);let w=0;return g&&(w=g.start+g.ttl-d(),w<0&&(w=0)),w}set(f,g,w,p){if(this.log.debug({msg:"acd/storage/memory.set",key:f,value:g,ttl:w,references:p}),w=Number(w),!w||w<0)return;const h=this.store.has(f),v=this.store.setpop(f,{value:g,ttl:w,start:d()});if(this.log.debug({msg:"acd/storage/memory.set, evicted",removed:v}),v&&v.evicted&&(this.log.debug({msg:"acd/storage/memory.set, remove evicted key",key:v.key}),this._removeReferences([v.key])),!p||p.length<1)return;if(!this.invalidation){this.log.warn({msg:"acd/storage/memory.set, invalidation is disabled, references are useless"});return}p=[...new Set(p)];let b;if(h&&(b=this.keysReferences.get(f),this.log.debug({msg:"acd/storage/memory.set, current keys-references",key:f,references:b}),b)){b.sort(),p.sort();const S=i(p,b);for(const x of S){const $=this.referencesKeys.get(x);if(!$)continue;const T=s($,f);if(!(T<0)){if($.splice(T,1),$.length<1){this.referencesKeys.delete(x);continue}this.referencesKeys.set(x,$)}}}const _=b?i(b,p):p;for(let S=0;S<_.length;S++){const x=_[S];let $=this.referencesKeys.get(x);$?(this.log.debug({msg:"acd/storage/memory.set, add reference-key",key:f,reference:x}),$.push(f)):$=[f],this.log.debug({msg:"acd/storage/memory.set, set reference-keys",keys:$,reference:x}),this.referencesKeys.set(x,$)}this.keysReferences.set(f,p)}remove(f){this.log.debug({msg:"acd/storage/memory.remove",key:f});const g=this._removeKey(f);return this._removeReferences([f]),g}_removeKey(f){return this.log.debug({msg:"acd/storage/memory._removeKey",key:f}),this.store.has(f)?(this.store.set(f,void 0),!0):!1}_removeReferences(f){if(!this.invalidation)return;this.log.debug({msg:"acd/storage/memory._removeReferences",keys:f});const g=new Set;for(let w=0;w<f.length;w++){const p=f[w],h=this.keysReferences.get(p);if(h){for(let v=0;v<h.length;v++)g.add(h[v]);this.log.debug({msg:"acd/storage/memory._removeReferences, delete key-references",key:p}),this.keysReferences.delete(p)}}this._removeReferencesKeys([...g],f)}_removeReferencesKeys(f,g){g.sort(),this.log.debug({msg:"acd/storage/memory._removeReferencesKeys",references:f,keys:g});for(let w=0;w<f.length;w++){const p=f[w],h=this.referencesKeys.get(p);if(this.log.debug({msg:"acd/storage/memory._removeReferencesKeys, get reference-key",reference:p,keys:g,referencesKeys:h}),!h)continue;const v=n(g,h);if(this.log.debug({msg:"acd/storage/memory._removeReferencesKeys, removing",reference:p,referencesToRemove:v,referencesKeys:h}),v.length===h.length){this.log.debug({msg:"acd/storage/memory._removeReferencesKeys, delete",reference:p}),this.referencesKeys.delete(p);continue}for(let b=v.length-1;b>=0;b--)this.log.debug({msg:"acd/storage/memory._removeReferencesKeys, remove",reference:p,referencesKeys:h,at:v[b]}),h.splice(v[b],1)}}invalidate(f){return this.invalidation?(this.log.debug({msg:"acd/storage/memory.invalidate",references:f}),Array.isArray(f)?this._invalidateReferences(f):this._invalidateReference(f)):(this.log.warn({msg:"acd/storage/memory.invalidate, exit due invalidation is disabled"}),[])}_invalidateReferences(f){const g=[];for(let w=0;w<f.length;w++){const p=f[w],h=this.referencesKeys.get(p);if(this.log.debug({msg:"acd/storage/memory._invalidateReferences, remove keys on reference",reference:p,keys:h}),!!h){for(let v=0;v<h.length;v++){const b=h[v];this.log.debug({msg:"acd/storage/memory._invalidateReferences, remove key on reference",reference:p,key:b}),this._removeKey(b)&&g.push(b)}this.log.debug({msg:"acd/storage/memory._invalidateReferences, remove references of",reference:p,keys:h}),this._removeReferences([...h])}}return g}
103_invalidateReference(f){if(f.includes("*")){const p=[];for(const h of this.referencesKeys.keys())o(f,h)&&p.push(h);return this._invalidateReferences(p)}const g=this.referencesKeys.get(f),w=[];if(this.log.debug({msg:"acd/storage/memory._invalidateReference, remove keys on reference",reference:f,keys:g}),!g)return w;for(let p=0;p<g.length;p++){const h=g[p];this.log.debug({msg:"acd/storage/memory._invalidateReference, remove key on reference",reference:f,key:h}),this._removeKey(h)&&w.push(h)}return this.log.debug({msg:"acd/storage/memory._invalidateReference, remove references of",reference:f,keys:g}),this._removeReferences([...g]),w}clear(f){if(this.log.debug({msg:"acd/storage/memory.clear",name:f}),!f){if(this.store.clear(),!this.invalidation)return;this.referencesKeys.clear(),this.keysReferences.clear();return}const g=[];this.store.forEach((p,h)=>{this.log.debug({msg:"acd/storage/memory.clear, iterate key",key:h}),h.indexOf(f)===0&&(this.log.debug({msg:"acd/storage/memory.clear, remove key",key:h}),g.push(h))});const w=[];for(let p=0;p<g.length;p++)this._removeKey(g[p])&&w.push(g[p]);return this._removeReferences(w),w}refresh(){this.log.debug({msg:"acd/storage/memory.refresh"}),this.init()}}let l;function d(){if(l!==void 0)return l;l=Math.floor(Date.now()/1e3);const y=setTimeout(m,1e3);return typeof y.unref=="function"&&y.unref(),l}function m(){l=void 0}return mt=u,mt}var vt,ur;function Xr(){if(ur)return vt;ur=1;const{isServerSide:r}=He();let e;r&&(e=Wi());const t=Xi(),n={redis:"redis"};function i(s,o){if(!r&&s===n.redis)throw new Error("Redis storage is not supported in the browser");return s===n.redis?new e(o):new t(o)}return vt=i,vt}var lr;function Zi(){if(lr)return ct;lr=1;const{kValues:r,kStorage:e,kStorages:t,kTransfromer:n,kTTL:i,kOnDedupe:s,kOnError:o,kOnHit:a,kOnMiss:c,kStale:u}=Ki(),l=Gr(),d=Xr();class m{constructor(p={}){if(!p.storage)throw new Error("storage is required");if(p.ttl&&typeof p.ttl=="number"&&(p.ttl<0||!Number.isInteger(p.ttl)))throw new Error("ttl must be a positive integer greater than 0");if(p.onDedupe&&typeof p.onDedupe!="function")throw new Error("onDedupe must be a function");if(p.onError&&typeof p.onError!="function")throw new Error("onError must be a function");if(p.onHit&&typeof p.onHit!="function")throw new Error("onHit must be a function");if(p.onMiss&&typeof p.onMiss!="function")throw new Error("onMiss must be a function");if(typeof p.stale=="number"&&!(Math.floor(p.stale)===p.stale&&p.stale>=0))throw new Error("stale must be an integer greater or equal to 0");this[r]={},this[e]=p.storage,this[t]=new Map,this[t].set("_default",p.storage),this[n]=p.transformer,this[i]=p.ttl||0,this[s]=p.onDedupe||g,this[o]=p.onError||g,this[a]=p.onHit||g,this[c]=p.onMiss||g,this[u]=p.stale||0}define(p,h,v){if(typeof h=="function"&&(v=h,h={}),p&&this[p])throw new Error(`${p} is already defined in the cache or it is a forbidden name`);if(h=h||{},typeof v!="function")throw new TypeError(`Missing the function parameter for '${p}'`);const b=h.serialize;if(b&&typeof b!="function")throw new TypeError("serialize must be a function");const _=h.references;if(_&&typeof _!="function")throw new TypeError("references must be a function");if(typeof h.ttl!="function"&&h.ttl&&(typeof h.ttl!="number"||h.ttl<0||!Number.isInteger(h.ttl)))throw new Error("ttl must be a positive integer greater than 0");let S;h.storage?(S=d(h.storage.type,h.storage.options),this[t].set(p,S)):S=this[e];const x=h.ttl!==void 0?h.ttl:this[i],$=h.stale!==void 0?h.stale:this[u],T=h.onDedupe||this[s],G=h.onError||this[o],X=h.onHit||this[a],B=h.onMiss||this[c],Z=h.transformer||this[n],ee=new y(v,p,b,_,S,Z,x,T,G,X,B,$);return this[r][p]=ee,this[p]=ee.add.bind(ee),this}async clear(p,h){if(p){if(!this[r][p])throw new Error(`${p} is not defined in the cache`);await this[r][p].clear(h);return}const v=[];for(const b of Object.values(this[r]))v.push(b.clear());await Promise.all(v)}async get(p,h){if(!this[r][p])throw new Error(`${p} is not defined in the cache`);return this[r][p].get(h)}async set(p,h,v,b,_){if(!this[r][p])throw new Error(`${p} is not defined in the cache`);return this[r][p].set(h,v,b,_)}
103async invalidate(p,h){if(!this[r][p])throw new Error(`${p} is not defined in the cache`);return this[r][p].invalidate(h)}async invalidateAll(p,h="_default"){if(!this[t].has(h))throw new Error(`${h} storage is not defined in the cache`);await this[t].get(h).invalidate(p)}}class y{constructor(p,h,v,b,_,S,x,$,T,G,X,B){this.dedupes=new Map,this.func=p,this.name=h,this.serialize=v,this.references=b,this.storage=_,this.transformer=S,this.ttl=x,this.onDedupe=$,this.onError=T,this.onHit=G,this.onMiss=X,this.stale=B}getKey(p){const h=this.serialize?this.serialize(p):p;return typeof h=="string"?h:l(h)}getStorageKey(p){return`${this.name}~${p}`}getStorageName(){return`${this.name}~`}add(p){try{const h=this.getKey(p);let v=this.dedupes.get(h);return v?this.onDedupe(h):(v=new f,this.buildPromise(v,p,h),this.dedupes.set(h,v)),v.promise}catch(h){this.onError(h)}}async wrapFunction(p,h){const v=this.getStorageKey(h);if(this.ttl>0||typeof this.ttl=="function"){const b=await this.get(v);if(b!==void 0){this.onHit(h);const _=typeof this.stale=="function"?this.stale(b):this.stale;return _>0&&await this.storage.getTTL(v)<=_&&this._wrapFunction(v,p,h).catch(g),b}else this.onMiss(h)}return this._wrapFunction(v,p,h)}async _wrapFunction(p,h,v){const b=await this.func(h,v),_=typeof this.stale=="function"?this.stale(b):this.stale;let S=typeof this.ttl=="function"?this.ttl(b):this.ttl;if(S==null||typeof S!="number"||!Number.isInteger(S))return this.onError(new Error("ttl must be an integer")),b;if(S+=_,S<1)return b;if(!this.references)return await this.set(p,b,S),b;try{let x=this.references(h,v,b),$=b;x&&typeof x.then=="function"&&(x=await x),this.transformer&&($=this.transformer.serialize(b)),await this.storage.set(p,$,S,x)}catch(x){this.onError(x)}return b}buildPromise(p,h,v){p.promise=this.wrapFunction(h,v),p.promise.then(b=>(this.dedupes.delete(v),b)).catch(b=>{this.onError(b),this.dedupes.delete(v);const _=this.storage.remove(this.getStorageKey(v));_&&typeof _.catch=="function"&&_.catch(g)})}async clear(p){if(p){const h=this.getKey(p);this.dedupes.delete(h),await this.storage.remove(this.getStorageKey(h));return}await this.storage.clear(this.getStorageName()),this.dedupes.clear()}async get(p){const h=await this.storage.get(p);return this.transformer&&h?await this.transformer.deserialize(h):h}async set(p,h,v,b){return this.transformer&&(h=this.transformer.serialize(h)),this.storage.set(p,h,v,b)}async invalidate(p){return this.storage.invalidate(p)}}class f{constructor(){this.promise=null}}function g(){}return ct.Cache=m,ct}var bt,fr;function es(){if(fr)return bt;fr=1;const{Cache:r}=Zi(),e=Xr();function t(n){n?n.storage||(n.storage={type:"memory"}):n={storage:{type:"memory"}};const i=e(n.storage.type,n.storage.options);return new r({...n,storage:i})}return bt={Cache:r,createCache:t,createStorage:e},bt}var ts=es();let wt=0,hr=[];function rs(){return wt+=1,()=>{if(wt-=1,wt===0){let r=hr;hr=[];for(let e of r)e()}}}let Y=[],le=0;const Ue=4;let Zr=r=>{let e=[],t={get(){return t.lc||t.listen(()=>{})(),t.value},lc:0,listen(n){return t.lc=e.push(n),()=>{for(let s=le+Ue;s<Y.length;)Y[s]===n?Y.splice(s,Ue):s+=Ue;let i=e.indexOf(n);~i&&(e.splice(i,1),--t.lc||t.off())}},notify(n,i){let s=!Y.length;for(let o of e)Y.push(o,t.value,n,i);if(s){for(le=0;le<Y.length;le+=Ue)Y[le](Y[le+1],Y[le+2],Y[le+3]);Y.length=0}},off(){},set(n){let i=t.value;i!==n&&(t.value=n,t.notify(i))},subscribe(n){let i=t.listen(n);return n(t.value),i},value:r};return t};const ns=5,ke=6,Ne=10;let is=(r,e,t,n)=>(r.events=r.events||{},r.events[t+Ne]||(r.events[t+Ne]=n(i=>{r.events[t].reduceRight((s,o)=>(o(s),s),{shared:{},...i})})),r.events[t]=r.events[t]||[],r.events[t].push(e),()=>{let i=r.events[t],s=i.indexOf(e);i.splice(s,1),i.length||(delete r.events[t],r.events[t+Ne](),delete r.events[t+Ne])}),ss=1e3,os=(r,e)=>is(r,t=>{let n=e(t);n&&r.events[ke].push(n)},ns,t=>{let n=r.listen;r.listen=(...s)=>(!r.lc&&!r.active&&(r.active=!0,t()),n(...s));let i=r.off;return r.events[ke]=[],r.off=()=>{i(),setTimeout(()=>{if(r.active&&!r.lc){r.active=!1;for(let s of r.events[ke])s();r.events[ke]=[]}},ss)},()=>{r.listen=n,r.off=i}}),as=(r={})=>{let e=Zr(r);return e.setKey=function(t,n){let i=e.value;typeof n>"u"&&t in e.value?(e.value={...e.value},delete e.value[t],e.notify(i,t)):e.value[t]!==n&&(e.value={...e.value,[t]:n},e.notify(i,t))},e};const Rt=typeof document>
103"u"?"server":"browser",cs=r=>{const{ssr:e,setFetcher:t}=r;return n=>{if(Rt==="server")throw new Error("Live mode is not supported in server environments");if(e&&!n.client)throw new Error("The `client` option in `enableLiveMode` is required");const i=n.client||r.client||void 0,s=new AbortController;let o;return Pt(async()=>{const{enableLiveMode:a}=await import("./BDHN2OsX.js");return{enableLiveMode:a}},__vite__mapDeps([0,1,2,3]),import.meta.url).then(({enableLiveMode:a})=>{s.signal.aborted||(o=a({...n,client:i,setFetcher:t,ssr:e}))}),()=>{s.abort(),o?.()}}};function dr(r){return r.withConfig({allowReconfigure:!1})}const us=r=>{const{ssr:e=!1,tag:t="core-loader"}=r;if(e&&r.client)throw new TypeError("`client` option is not allowed when `ssr: true`, use `setServerClient` from your server entry point instead");if(!e&&r.client===!1)throw new TypeError("You must set `ssr: true` when `client: false` is used");if(!e&&!r.client)throw new TypeError("`client` is required");let n=e?void 0:dr(r.client);function i(d){return ts.createCache().define("fetch",async m=>{if(!d)throw new Error("You have to set the Sanity client with `setServerClient` before any data fetching is done");const{query:y,params:f={},perspective:g,useCdn:w,stega:p}=JSON.parse(m),{result:h,resultSourceMap:v}=await d.fetch(y,f,{tag:t,filterResponse:!1,perspective:g,useCdn:w,stega:p});return{result:h,resultSourceMap:v}})}function s(){const d=n?.config().perspective||"published";return o.instance=i(n),{hydrate:(m,y,f)=>({loading:f?.data===void 0||f?.sourceMap===void 0,error:void 0,data:f?.data,sourceMap:f?.sourceMap,perspective:d}),fetch:(m,y,f,g)=>{if(g.signal.aborted)return;const w=rs();f.setKey("loading",!0),f.setKey("error",void 0),o.instance.fetch(JSON.stringify({query:m,params:y})).then(p=>{g.signal.aborted||(f.setKey("data",p.result),f.setKey("sourceMap",p.resultSourceMap),f.setKey("perspective",d))}).catch(p=>{f.setKey("error",p)}).finally(()=>{f.setKey("loading",!1),w()})}}}const o={instance:i(n)},a=Zr(n?s():void 0),c=cs({client:n||void 0,ssr:e,setFetcher:d=>{const m=a.get();return a.set(d),()=>a.set(m)}}),u=(d,m={},y)=>{const f=a.get(),g=as(f?f.hydrate(d,m,y):{loading:!1,error:typeof y?.data>"u"?new Error("The `initial` option is required when `ssr: true`"):void 0,data:y?.data,sourceMap:y?.sourceMap,perspective:y?.perspective});return os(g,()=>{let w=new AbortController;const p=a.subscribe(h=>{!h||w.signal.aborted||(w.abort(),w=new AbortController,h.fetch(d,m,g,w))});return()=>{w.abort(),p()}}),g},l={instance:void 0,canPreviewDrafts:!1};return{createFetcherStore:u,enableLiveMode:c,setServerClient:d=>{if(Rt!=="server")throw new Error("`setServerClient` can only be called in server environments, detected: "+JSON.stringify(Rt));if(!e)throw new Error("`setServerClient` can only be called when `ssr: true`");l.instance=n=dr(d),l.canPreviewDrafts=!!n.config().token,a.set(s())},unstable__cache:o,unstable__serverClient:l}},gr=(r,e,t)=>r?us({tag:"nuxt-loader",client:!1,ssr:!0}):void 0,en=!(typeof navigator>"u")&&navigator.product==="ReactNative",tn={timeout:en?6e4:12e4},ls=function(r){const e={...tn,...typeof r=="string"?{url:r}:r};if(e.timeout=rn(e.timeout),e.query){const{url:t,searchParams:n}=(function(i){const s=i.indexOf("?");if(s===-1)return{url:i,searchParams:new URLSearchParams};const o=i.slice(0,s),a=i.slice(s+1);if(!en)return{url:o,searchParams:new URLSearchParams(a)};if(typeof decodeURIComponent!="function")throw new Error("Broken `URLSearchParams` implementation, and `decodeURIComponent` is not defined");const c=new URLSearchParams;for(const u of a.split("&")){const[l,d]=u.split("=");l&&c.append(pr(l),pr(d||""))}return{url:o,searchParams:c}})(e.url);for(const[i,s]of Object.entries(e.query)){if(s!==void 0)if(Array.isArray(s))for(const a of s)n.append(i,a);else n.append(i,s);const o=n.toString();o&&(e.url=`${t}?${o}`)}}return e.method=e.body&&!e.method?"POST":(e.method||"GET").toUpperCase(),e};function pr(r){return decodeURIComponent(r.replace(/\+/g," "))}function rn(r){if(r===!1||r===0)return!1;if(r.connect||r.socket)return r;const e=Number(r);return isNaN(e)?rn(tn.timeout):{connect:e,socket:e}}const fs=/^https?:\/\//i,hs=function(r){if(!fs.test(r.url))throw new Error(`"${r.url}" is not a valid URL`)};function nn(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}const ds=["request","response","progress","error","abort"],yr=["processOptions","validateOptions","interceptRequest","finalizeOptions","onRequest","onResponse","onError","onReturn","onHeaders"];function sn(r,e){const t=[],n=yr.reduce((s,o)=>(s[o]=s[o]||[],s),{processOptions:[ls],validateOptions:[hs]});function i(s){const o=ds.reduce((y,f)=>(y[f]=(function(){const g=Object.create(null);let w=0;return{publish:function(p){for(const h in g)g[h](p)},subscribe:function(p){const h=w++;return g[h]=p,function(){delete g[h]}}}})(),y),{}),a=(y=>function(f,g,...w){const p=f==="onError";let h=g;for(let v=0;v<y[f].length&&(h=(0,y[f][v])(h,...w),!p||h);v++);return h})(n),c=a("processOptions",s);a("validateOptions",c);const u={options:c,channels:o,applyMiddleware:a};let l;const d=o.request.subscribe(y=>{l=e(y,(f,g)=>
103((w,p,h)=>{let v=w,b=p;if(!v)try{b=a("onResponse",p,h)}catch(_){b=null,v=_}v=v&&a("onError",v,h),v?o.error.publish(v):b&&o.response.publish(b)})(f,g,y))});o.abort.subscribe(()=>{d(),l&&l.abort()});const m=a("onReturn",o,u);return m===o&&o.request.publish(u),m}return i.use=function(s){if(!s)throw new Error("Tried to add middleware that resolved to falsey value");if(typeof s=="function")throw new Error("Tried to add middleware that was a function. It probably expects you to pass options to it.");if(s.onReturn&&n.onReturn.length>0)throw new Error("Tried to add new middleware with `onReturn` handler, but another handler has already been registered for this event");return yr.forEach(o=>{s[o]&&n[o].push(s[o])}),t.push(s),i},i.clone=()=>sn(t,e),r.forEach(i.use),i}var mr,vr,gs=nn((function(){if(vr)return mr;vr=1;var r=function(t){return t.replace(/^\s+|\s+$/g,"")},e=function(t){return Object.prototype.toString.call(t)==="[object Array]"};return mr=function(t){if(!t)return{};for(var n=Object.create(null),i=r(t).split(` 104`),s=0;s<i.length;s++){var o=i[s],a=o.indexOf(":"),c=r(o.slice(0,a)).toLowerCase(),u=r(o.slice(a+1));typeof n[c]>"u"?n[c]=u:e(n[c])?n[c].push(u):n[c]=[n[c],u]}return n}})());let Ot=class{onabort;onerror;onreadystatechange;ontimeout;readyState=0;response;responseText="";responseType="";status;statusText;withCredentials;#e;#t;#n;#i={};#r;#s={};#o;open(e,t,n){this.#e=e,this.#t=t,this.#n="",this.readyState=1,this.onreadystatechange?.(),this.#r=void 0}abort(){this.#r&&this.#r.abort()}getAllResponseHeaders(){return this.#n}setRequestHeader(e,t){this.#i[e]=t}setInit(e,t=!0){this.#s=e,this.#o=t}send(e){const t=this.responseType!=="arraybuffer",n={...this.#s,method:this.#e,headers:this.#i,body:e};typeof AbortController=="function"&&this.#o&&(this.#r=new AbortController,typeof EventTarget<"u"&&this.#r.signal instanceof EventTarget&&(n.signal=this.#r.signal)),typeof document<"u"&&(n.credentials=this.withCredentials?"include":"omit"),fetch(this.#t,n).then(i=>(i.headers.forEach((s,o)=>{this.#n+=`${o}: ${s}\r 105`}),this.status=i.status,this.statusText=i.statusText,this.readyState=3,this.onreadystatechange?.(),t?i.text():i.arrayBuffer())).then(i=>{typeof i=="string"?this.responseText=i:this.response=i,this.readyState=4,this.onreadystatechange?.()}).catch(i=>{i.name!=="AbortError"?this.onerror?.(i):this.onabort?.()})}};const $t=typeof XMLHttpRequest=="function"?"xhr":"fetch",ps=$t==="xhr"?XMLHttpRequest:Ot,ys=(r,e)=>{const t=r.options,n=r.applyMiddleware("finalizeOptions",t),i={},s=r.applyMiddleware("interceptRequest",void 0,{adapter:$t,context:r});if(s){const g=setTimeout(e,0,null,s);return{abort:()=>clearTimeout(g)}}let o=new ps;o instanceof Ot&&typeof n.fetch=="object"&&o.setInit(n.fetch,n.useAbortSignal??!0);const a=n.headers,c=n.timeout;let u=!1,l=!1,d=!1;if(o.onerror=g=>{f(o instanceof Ot?g instanceof Error?g:new Error(`Request error while attempting to reach is ${n.url}`,{cause:g}):new Error(`Request error while attempting to reach is ${n.url}${g.lengthComputable?`(${g.loaded} of ${g.total} bytes transferred)`:""}`))},o.ontimeout=g=>{f(new Error(`Request timeout while attempting to reach ${n.url}${g.lengthComputable?`(${g.loaded} of ${g.total} bytes transferred)`:""}`))},o.onabort=()=>{y(!0),u=!0},o.onreadystatechange=function(){c&&(y(),i.socket=setTimeout(()=>m("ESOCKETTIMEDOUT"),c.socket)),!u&&o&&o.readyState===4&&o.status!==0&&(function(){if(!(u||l||d)){if(o.status===0)return void f(new Error("Unknown XHR error"));y(),l=!0,e(null,{body:o.response||(o.responseType===""||o.responseType==="text"?o.responseText:""),url:n.url,method:n.method,headers:gs(o.getAllResponseHeaders()),statusCode:o.status,statusMessage:o.statusText})}})()},o.open(n.method,n.url,!0),o.withCredentials=!!n.withCredentials,a&&o.setRequestHeader)for(const g in a)a.hasOwnProperty(g)&&o.setRequestHeader(g,a[g]);return n.rawBody&&(o.responseType="arraybuffer"),r.applyMiddleware("onRequest",{options:n,adapter:$t,request:o,context:r}),o.send(n.body||null),c&&(i.connect=setTimeout(()=>m("ETIMEDOUT"),c.connect)),{abort:function(){u=!0,o&&o.abort()}};function m(g){d=!0,o.abort();const w=new Error(g==="ESOCKETTIMEDOUT"?`Socket timed out on request to ${n.url}`:`Connection timed out on request to ${n.url}`);w.code=g,r.channels.error.publish(w)}function y(g){(g||u||o&&o.readyState>=2&&i.connect)&&clearTimeout(i.connect),i.socket&&clearTimeout(i.socket)}function f(g){if(l)return;y(!0),l=!0,o=null;const w=g||new Error(`Network error while attempting to reach ${n.url}`);w.isNetworkError=!0,w.request=n,e(w)}},ms=(r=[],e=ys)=>sn(r,e);var vs={},br,wr,Er,_r,Sr,Et={exports:{}};Sr||(Sr=1,(function(r,e){e.formatArgs=function(n){if(n[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+n[0]+(this.useColors?"%c ":" ")+"+"+r.exports.humanize(this.diff),!this.useColors)return;const i="color: "+this.color;n.splice(1,0,i,"color: inherit");let s=0,o=0;n[0].replace(/%[a-zA-Z%]/g,a=>{a!=="%%"&&(s++,a==="%c"&&(o=s))}),n.splice(o,0,i)},e.save=function(n){try{n?e.storage.setItem("debug",n):e.storage.removeItem("debug")}catch{}},e.load=function(){let n;try{n=e.storage.getItem("debug")||e.storage.getItem("DEBUG")}catch{}return!n&&typeof process<"u"&&"env"in process&&(n=vs.DEBUG),n},e.useColors=function(){if(typeof window<"u"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs))return!0;
105if(typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;let n;return typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&navigator.userAgent&&(n=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(n[1],10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)},e.storage=(function(){try{return localStorage}catch{}})(),e.destroy=(()=>{let n=!1;return()=>{n||(n=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),e.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"],e.log=console.debug||console.log||(()=>{}),r.exports=(_r?Er:(_r=1,Er=function(n){function i(a){let c,u,l,d=null;function m(...y){if(!m.enabled)return;const f=m,g=Number(new Date),w=g-(c||g);f.diff=w,f.prev=c,f.curr=g,c=g,y[0]=i.coerce(y[0]),typeof y[0]!="string"&&y.unshift("%O");let p=0;y[0]=y[0].replace(/%([a-zA-Z%])/g,(h,v)=>{if(h==="%%")return"%";p++;const b=i.formatters[v];if(typeof b=="function"){const _=y[p];h=b.call(f,_),y.splice(p,1),p--}return h}),i.formatArgs.call(f,y),(f.log||i.log).apply(f,y)}return m.namespace=a,m.useColors=i.useColors(),m.color=i.selectColor(a),m.extend=s,m.destroy=i.destroy,Object.defineProperty(m,"enabled",{enumerable:!0,configurable:!1,get:()=>d!==null?d:(u!==i.namespaces&&(u=i.namespaces,l=i.enabled(a)),l),set:y=>{d=y}}),typeof i.init=="function"&&i.init(m),m}function s(a,c){const u=i(this.namespace+(typeof c>"u"?":":c)+a);return u.log=this.log,u}function o(a,c){let u=0,l=0,d=-1,m=0;for(;u<a.length;)if(l<c.length&&(c[l]===a[u]||c[l]==="*"))c[l]==="*"?(d=l,m=u,l++):(u++,l++);else{if(d===-1)return!1;l=d+1,m++,u=m}for(;l<c.length&&c[l]==="*";)l++;return l===c.length}return i.debug=i,i.default=i,i.coerce=function(a){return a instanceof Error?a.stack||a.message:a},i.disable=function(){const a=[...i.names,...i.skips.map(c=>"-"+c)].join(",");return i.enable(""),a},i.enable=function(a){i.save(a),i.namespaces=a,i.names=[],i.skips=[];const c=(typeof a=="string"?a:"").trim().replace(/\s+/g,",").split(",").filter(Boolean);for(const u of c)u[0]==="-"?i.skips.push(u.slice(1)):i.names.push(u)},i.enabled=function(a){for(const c of i.skips)if(o(a,c))return!1;for(const c of i.names)if(o(a,c))return!0;return!1},i.humanize=(function(){if(wr)return br;wr=1;var a=1e3,c=60*a,u=60*c,l=24*u,d=7*l;function m(y,f,g,w){var p=f>=1.5*g;return Math.round(y/g)+" "+w+(p?"s":"")}return br=function(y,f){f=f||{};var g,w,p=typeof y;if(p==="string"&&y.length>0)return(function(h){if(!((h=String(h)).length>100)){var v=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(h);if(v){var b=parseFloat(v[1]);switch((v[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return 315576e5*b;case"weeks":case"week":case"w":return b*d;case"days":case"day":case"d":return b*l;case"hours":case"hour":case"hrs":case"hr":case"h":return b*u;case"minutes":case"minute":case"mins":case"min":case"m":return b*c;case"seconds":case"second":case"secs":case"sec":case"s":return b*a;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return b;default:return}}}})(y);if(p==="number"&&isFinite(y))return f.long?(g=y,(w=Math.abs(g))>=l?m(g,w,l,"day"):w>=u?m(g,w,u,"hour"):w>=c?m(g,w,c,"minute"):w>=a?m(g,w,a,"second"):g+" ms"):(function(h){var v=Math.abs(h);return v>=l?Math.round(h/l)+"d":v>=u?Math.round(h/u)+"h":v>=c?Math.round(h/c)+"m":v>=a?Math.round(h/a)+"s":h+"ms"})(y);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(y))}})(),i.destroy=function(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}
105,Object.keys(n).forEach(a=>{i[a]=n[a]}),i.names=[],i.skips=[],i.formatters={},i.selectColor=function(a){let c=0;for(let u=0;u<a.length;u++)c=(c<<5)-c+a.charCodeAt(u),c|=0;return i.colors[Math.abs(c)%i.colors.length]},i.enable(i.load()),i}))(e);const{formatters:t}=r.exports;t.j=function(n){try{return JSON.stringify(n)}catch(i){return"[UnexpectedJSONParseError]: "+i.message}}})(Et,Et.exports)),Et.exports;const bs=typeof Buffer>"u"?()=>!1:r=>Buffer.isBuffer(r);function Cr(r){return Object.prototype.toString.call(r)==="[object Object]"}function ws(r){if(Cr(r)===!1)return!1;const e=r.constructor;if(e===void 0)return!0;const t=e.prototype;return!(Cr(t)===!1||t.hasOwnProperty("isPrototypeOf")===!1)}const Es=["boolean","string","number"];function _s(){return{processOptions:r=>{const e=r.body;return!e||typeof e.pipe=="function"||bs(e)||Es.indexOf(typeof e)===-1&&!Array.isArray(e)&&!ws(e)?r:Object.assign({},r,{body:JSON.stringify(r.body),headers:Object.assign({},r.headers,{"Content-Type":"application/json"})})}}}function Ss(r){return{onResponse:t=>{const n=t.headers["content-type"]||"",i=r&&r.force||n.indexOf("application/json")!==-1;return t.body&&n&&i?Object.assign({},t,{body:e(t.body)}):t},processOptions:t=>Object.assign({},t,{headers:Object.assign({Accept:"application/json"},t.headers)})};function e(t){try{return JSON.parse(t)}catch(n){throw n.message=`Failed to parsed response body as JSON: ${n.message}`,n}}}let Oe={};typeof globalThis<"u"?Oe=globalThis:typeof window<"u"?Oe=window:typeof global<"u"?Oe=global:typeof self<"u"&&(Oe=self);var Cs=Oe;function As(r={}){const e=r.implementation||Cs.Observable;if(!e)throw new Error("`Observable` is not available in global scope, and no implementation was passed");return{onReturn:(t,n)=>new e(i=>(t.error.subscribe(s=>i.error(s)),t.progress.subscribe(s=>i.next(Object.assign({type:"progress"},s))),t.response.subscribe(s=>{i.next(Object.assign({type:"response"},s)),i.complete()}),t.request.publish(n),()=>t.abort.publish()))}}function Ts(){return{onRequest:r=>{if(r.adapter!=="xhr")return;const e=r.request,t=r.context;function n(i){return s=>{const o=s.lengthComputable?s.loaded/s.total*100:-1;t.channels.progress.publish({stage:i,percent:o,total:s.total,loaded:s.loaded,lengthComputable:s.lengthComputable})}}"upload"in e&&"onprogress"in e.upload&&(e.upload.onprogress=n("upload")),"onprogress"in e&&(e.onprogress=n("download"))}}}var on=(r,e,t)=>(t.method==="GET"||t.method==="HEAD")&&(r.isNetworkError||!1);function Is(r){return 100*Math.pow(2,r)+100*Math.random()}const Mt=(r={})=>(e=>{const t=e.maxRetries||5,n=e.retryDelay||Is,i=e.shouldRetry;return{onError:(s,o)=>{const a=o.options,c=a.maxRetries||t,u=a.retryDelay||n,l=a.shouldRetry||i,d=a.attemptNumber||0;if((m=a.body)!==null&&typeof m=="object"&&typeof m.pipe=="function"||!l(s,d,a)||d>=c)return s;var m;const y=Object.assign({},o,{options:Object.assign({},a,{attemptNumber:d+1})});return setTimeout(()=>o.channels.request.publish(y),u(d)),null}}})({shouldRetry:on,...r});Mt.shouldRetry=on;var xt=function(r,e){return xt=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])},xt(r,e)};function ce(r,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");xt(r,e);function t(){this.constructor=r}r.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}function Rs(r,e,t,n){function i(s){return s instanceof t?s:new t(function(o){o(s)})}return new(t||(t=Promise))(function(s,o){function a(l){try{u(n.next(l))}catch(d){o(d)}}function c(l){try{u(n.throw(l))}catch(d){o(d)}}function u(l){l.done?s(l.value):i(l.value).then(a,c)}u((n=n.apply(r,e||[])).next())})}function an(r,e){var t={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},n,i,s,o=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return o.next=a(0),o.throw=a(1),o.return=a(2),typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function a(u){return function(l){return c([u,l])}}function c(u){if(n)throw new TypeError("Generator is already executing.");for(;o&&(o=0,u[0]&&(t=0)),t;)try{if(n=1,i&&(s=u[0]&2?i.return:u[0]?i.throw||((s=i.return)&&s.call(i),0):i.next)&&!(s=s.call(i,u[1])).done)return s;switch(i=0,s&&(u=[u[0]&2,s.value]),u[0]){case 0:case 1:s=u;break;case 4:return t.label++,{value:u[1],done:!1};case 5:t.label++,i=u[1],u=[0];continue;case 7:u=t.ops.pop(),t.trys.pop();continue;default:if(s=t.trys,!(s=s.length>0&&s[s.length-1])&&(u[0]===6||u[0]===2)){t=0;continue}if(u[0]===3&&(!s||u[1]>s[0]&&u[1]<s[3])){t.label=u[1];break}if(u[0]===6&&t.label<s[1]){t.label=s[1],s=u;break}if(s&&t.label<s[2]){t.label=s[2],t.ops.push(u);break}s[2]&&t.ops.pop(),t.trys.pop();continue}u=e.call(r,t)}catch(l){u=[6,l],i=0}finally{n=s=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}}function _e(r){var e=typeof Symbol=="function"&&Symbol.iterator,t=e&&r[e],n=0;if(t)return t.call(r);if(r&&typeof r.length=="number")return{next:function(){return r&&n>=r.length&&(r=void 0),{value:r&&r[n++],done:!r}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function oe(r,e){var t=typeof Symbol=="function"&&r[Symbol.iterator];if(!t)return r;var n=t.call(r),i,s=[],o;try{for(;(e===void 0||e-- >0)&&!(i=n.next()).done;)s.push(i.value)}catch(a){o={error:a}}finally{try{i&&!i.done&&(t=n.return)&&t.call(n)}finally{if(o)throw o.error}}return s}function ae(r,e,t){if(t||arguments.length===2)for(var n=0,i=e.length,s;n<i;n++)(s||!(n in e))&&(s||(s=Array.prototype.slice.call(e,0,n)),s[n]=e[n]);return r.concat(s||Array.prototype.slice.call(e))}function be(r){return this instanceof be?(this.v=r,this):new be(r)}function Os(r,e,t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n=t.apply(r,e||[]),i,s=[];return i=Object.create((typeof AsyncIterator=="function"?AsyncIterator:Object).prototype),a("next"),a("throw"),a("return",o),i[Symbol.asyncIterator]=function(){return this},i;function o(y){return function(f){return Promise.resolve(f).then(y,d)}}function a(y,f){n[y]&&(i[y]=function(g){return new Promise(function(w,p){s.push([y,g,w,p])>1||c(y,g)})},f&&(i[y]=f(i[y])))}function c(y,f){try{u(n[y](f))}catch(g){m(s[0][3],g)}}function u(y){y.value instanceof be?Promise.resolve(y.value.v).then(l,d):m(s[0][2],y)}function l(y){c("next",y)}function d(y){c("throw",y)}function m(y,f){y(f),s.shift(),s.length&&c(s[0][0],s[0][1])}}function $s(r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=r[Symbol.asyncIterator],t;return e?e.call(r):(r=typeof _e=="function"?_e(r):r[Symbol.iterator](),t={},n("next"),n("throw"),n("return"),t[Symbol.asyncIterator]=function(){return this},t);function n(s){t[s]=r[s]&&function(o){return new Promise(function(a,c){o=r[s](o),i(a,c,o.done,o.value)})}}function i(s,o,a,c){Promise.resolve(c).then(function(u){s({value:u,done:a})},o)}}function q(r){return typeof r=="function"}function jt(r){var e=function(n){Error.call(n),n.stack=new Error().stack},t=r(e);return t.prototype=Object.create(Error.prototype),t.prototype.constructor=t,t}var _t=jt(function(r){return function(t){r(this),this.message=t?t.length+` errors occurred during unsubscription: 106`+t.map(function(n,i){return i+1+") "+n.toString()}).join(` 107 `):"",this.name="UnsubscriptionError",this.errors=t}});function Ke(r,e){if(r){var t=r.indexOf(e);0<=t&&r.splice(t,1)}}var De=(function(){function r(e){this.initialTeardown=e,this.closed=!1,this._parentage=null,this._finalizers=null}return r.prototype.unsubscribe=function(){var e,t,n,i,s;if(!this.closed){this.closed=!0;var o=this._parentage;if(o)if(this._parentage=null,Array.isArray(o))try{for(var a=_e(o),c=a.next();!c.done;c=a.next()){var u=c.value;u.remove(this)}}catch(g){e={error:g}}finally{try{c&&!c.done&&(t=a.return)&&t.call(a)}finally{if(e)throw e.error}}else o.remove(this);var l=this.initialTeardown;
vendor: 6,875 bytes, line 107
107if(q(l))try{l()}catch(g){s=g instanceof _t?g.errors:[g]}var d=this._finalizers;if(d){this._finalizers=null;try{for(var m=_e(d),y=m.next();!y.done;y=m.next()){var f=y.value;try{Ar(f)}catch(g){s=s??[],g instanceof _t?s=ae(ae([],oe(s)),oe(g.errors)):s.push(g)}}}catch(g){n={error:g}}finally{try{y&&!y.done&&(i=m.return)&&i.call(m)}finally{if(n)throw n.error}}}if(s)throw new _t(s)}},r.prototype.add=function(e){var t;if(e&&e!==this)if(this.closed)Ar(e);else{if(e instanceof r){if(e.closed||e._hasParent(this))return;e._addParent(this)}(this._finalizers=(t=this._finalizers)!==null&&t!==void 0?t:[]).push(e)}},r.prototype._hasParent=function(e){var t=this._parentage;return t===e||Array.isArray(t)&&t.includes(e)},r.prototype._addParent=function(e){var t=this._parentage;this._parentage=Array.isArray(t)?(t.push(e),t):t?[t,e]:e},r.prototype._removeParent=function(e){var t=this._parentage;t===e?this._parentage=null:Array.isArray(t)&&Ke(t,e)},r.prototype.remove=function(e){var t=this._finalizers;t&&Ke(t,e),e instanceof r&&e._removeParent(this)},r.EMPTY=(function(){var e=new r;return e.closed=!0,e})(),r})(),cn=De.EMPTY;function un(r){return r instanceof De||r&&"closed"in r&&q(r.remove)&&q(r.add)&&q(r.unsubscribe)}function Ar(r){q(r)?r():r.unsubscribe()}var xs={Promise:void 0},Ds={setTimeout:function(r,e){for(var t=[],n=2;n<arguments.length;n++)t[n-2]=arguments[n];return setTimeout.apply(void 0,ae([r,e],oe(t)))},clearTimeout:function(r){return clearTimeout(r)},delegate:void 0};function ln(r){Ds.setTimeout(function(){throw r})}function Tr(){}function Be(r){r()}var Lt=(function(r){ce(e,r);function e(t){var n=r.call(this)||this;return n.isStopped=!1,t?(n.destination=t,un(t)&&t.add(n)):n.destination=js,n}return e.create=function(t,n,i){return new Se(t,n,i)},e.prototype.next=function(t){this.isStopped||this._next(t)},e.prototype.error=function(t){this.isStopped||(this.isStopped=!0,this._error(t))},e.prototype.complete=function(){this.isStopped||(this.isStopped=!0,this._complete())},e.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,r.prototype.unsubscribe.call(this),this.destination=null)},e.prototype._next=function(t){this.destination.next(t)},e.prototype._error=function(t){try{this.destination.error(t)}finally{this.unsubscribe()}},e.prototype._complete=function(){try{this.destination.complete()}finally{this.unsubscribe()}},e})(De),Ps=(function(){function r(e){this.partialObserver=e}return r.prototype.next=function(e){var t=this.partialObserver;if(t.next)try{t.next(e)}catch(n){ze(n)}},r.prototype.error=function(e){var t=this.partialObserver;if(t.error)try{t.error(e)}catch(n){ze(n)}else ze(e)},r.prototype.complete=function(){var e=this.partialObserver;if(e.complete)try{e.complete()}catch(t){ze(t)}},r})(),Se=(function(r){ce(e,r);function e(t,n,i){var s=r.call(this)||this,o;return q(t)||!t?o={next:t??void 0,error:n??void 0,complete:i??void 0}:o=t,s.destination=new Ps(o),s}return e})(Lt);function ze(r){ln(r)}function Ms(r){throw r}var js={closed:!0,next:Tr,error:Ms,complete:Tr},qt=(function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"})();function tt(r){return r}function Ls(){for(var r=[],e=0;e<arguments.length;e++)r[e]=arguments[e];return fn(r)}function fn(r){return r.length===0?tt:r.length===1?r[0]:function(t){return r.reduce(function(n,i){return i(n)},t)}}var V=(function(){function r(e){e&&(this._subscribe=e)}return r.prototype.lift=function(e){var t=new r;return t.source=this,t.operator=e,t},r.prototype.subscribe=function(e,t,n){var i=this,s=Fs(e)?e:new Se(e,t,n);return Be(function(){var o=i,a=o.operator,c=o.source;s.add(a?a.call(s,c):c?i._subscribe(s):i._trySubscribe(s))}),s},r.prototype._trySubscribe=function(e){try{return this._subscribe(e)}catch(t){e.error(t)}},r.prototype.forEach=function(e,t){var n=this;return t=Ir(t),new t(function(i,s){var o=new Se({next:function(a){try{e(a)}catch(c){s(c),o.unsubscribe()}},error:s,complete:i});n.subscribe(o)})},r.prototype._subscribe=function(e){var t;return(t=this.source)===null||t===void 0?void 0:t.subscribe(e)},r.prototype[qt]=function(){return this},r.prototype.pipe=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return fn(e)(this)},r.prototype.toPromise=function(e){var t=this;return e=Ir(e),new e(function(n,i){var s;t.subscribe(function(o){return s=o},function(o){return i(o)},function(){return n(s)})})},r.create=function(e){return new r(e)},r})();function Ir(r){var e;return(e=r??xs.Promise)!==null&&e!==void 0?e:Promise}function qs(r){return r&&q(r.next)&&q(r.error)&&q(r.complete)}function Fs(r){return r&&r instanceof Lt||qs(r)&&un(r)}function Vs(r){return q(r?.lift)}function ie(r){return function(e){if(Vs(e))return e.lift(function(t){try{return r(t,this)}catch(n){this.error(n)}});throw new TypeError("Unable to lift unknown Observable type")}}function he(r,e,t,n,i){return new Us(r,e,t,n,i)}var Us=(function(r){ce(e,r);function e(t,n,i,s,o,a){var c=r.call(this,t)||this;return c.onFinalize=o,c.shouldUnsubscribe=a,c._next=n?function(u){try{n(u)}catch(l){t.error(l)}}:r.prototype._next,c._error=s?function(u){try{s(u)}catch(l){t.error(l)}finally{this.unsubscribe()}}:r.prototype._error,c._complete=i?function(){try{i()}catch(u){t.error(u)}finally{this.unsubscribe()}}:r.prototype._complete,c}return e.prototype.unsubscribe=function(){var t;if(!this.shouldUnsubscribe||this.shouldUnsubscribe()){var n=this.closed;r.prototype.unsubscribe.call(this),!n&&((t=this.onFinalize)===null||t===void 0||t.call(this))}},e})(Lt),ks=jt(function(r){return function(){r(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"}}),Ft=(function(r){ce(e,r);function e(){var t=r.call(this)||this;return t.closed=!1,t.currentObservers=null,t.observers=[],t.isStopped=!1,t.hasError=!1,t.thrownError=null,t}return e.prototype.lift=function(t){var n=new Rr(this,this);return n.operator=t,n},e.prototype._throwIfClosed=function(){if(this.closed)throw new ks},e.prototype.next=function(t){var n=this;Be(function(){var i,s;if(n._throwIfClosed(),!n.isStopped){n.currentObservers||(n.currentObservers=Array.from(n.observers));try{for(var o=_e(n.currentObservers),a=o.next();!a.done;a=o.next()){var c=a.value;c.next(t)}}catch(u){i={error:u}}finally{try{a&&!a.done&&(s=o.return)&&s.call(o)}finally{if(i)throw i.error}}}})},e.prototype.error=function(t){var n=this;Be(function(){if(n._throwIfClosed(),!n.isStopped){n.hasError=n.isStopped=!0,n.thrownError=t;for(var i=n.observers;i.length;)i.shift().error(t)}})},e.prototype.complete=function(){var t=this;Be(function(){if(t._throwIfClosed(),!t.isStopped){t.isStopped=!0;for(var n=t.observers;n.length;)n.shift().complete()}})},e.prototype.unsubscribe=function(){this.isStopped=this.closed=!0,this.observers=this.currentObservers=null},Object.defineProperty(e.prototype,"observed",{get:function(){var t;return((t=this.observers)===null||t===void 0?void 0:t.length)>0}
107,enumerable:!1,configurable:!0}),e.prototype._trySubscribe=function(t){return this._throwIfClosed(),r.prototype._trySubscribe.call(this,t)},e.prototype._subscribe=function(t){return this._throwIfClosed(),this._checkFinalizedStatuses(t),this._innerSubscribe(t)},e.prototype._innerSubscribe=function(t){var n=this,i=this,s=i.hasError,o=i.isStopped,a=i.observers;return s||o?cn:(this.currentObservers=null,a.push(t),new De(function(){n.currentObservers=null,Ke(a,t)}))},e.prototype._checkFinalizedStatuses=function(t){var n=this,i=n.hasError,s=n.thrownError,o=n.isStopped;i?t.error(s):o&&t.complete()},e.prototype.asObservable=function(){var t=new V;return t.source=this,t},e.create=function(t,n){return new Rr(t,n)},e})(V),Rr=(function(r){ce(e,r);function e(t,n){var i=r.call(this)||this;return i.destination=t,i.source=n,i}return e.prototype.next=function(t){var n,i;(i=(n=this.destination)===null||n===void 0?void 0:n.next)===null||i===void 0||i.call(n,t)},e.prototype.error=function(t){var n,i;(i=(n=this.destination)===null||n===void 0?void 0:n.error)===null||i===void 0||i.call(n,t)},e.prototype.complete=function(){var t,n;(n=(t=this.destination)===null||t===void 0?void 0:t.complete)===null||n===void 0||n.call(t)},e.prototype._subscribe=function(t){var n,i;return(i=(n=this.source)===null||n===void 0?void 0:n.subscribe(t))!==null&&i!==void 0?i:cn},e})(Ft),Vt={now:function(){return(Vt.delegate||Date).now()},delegate:void 0},Ns=(function(r){ce(e,r);function e(t,n,i){t===void 0&&(t=1/0),n===void 0&&(n=1/0),i===void 0&&(i=Vt);var s=r.call(this)||this;return s._bufferSize=t,s._windowTime=n,s._timestampProvider=i,s._buffer=[],s._infiniteTimeWindow=!0,s._infiniteTimeWindow=n===1/0,s._bufferSize=Math.max(1,t),s._windowTime=Math.max(1,n),s}return e.prototype.next=function(t){var n=this,i=n.isStopped,s=n._buffer,o=n._infiniteTimeWindow,a=n._timestampProvider,c=n._windowTime;i||(s.push(t),!o&&s.push(a.now()+c)),this._trimBuffer(),r.prototype.next.call(this,t)},e.prototype._subscribe=function(t){this._throwIfClosed(),this._trimBuffer();for(var n=this._innerSubscribe(t),i=this,s=i._infiniteTimeWindow,o=i._buffer,a=o.slice(),c=0;c<a.length&&!t.closed;c+=s?1:2)t.next(a[c]);return this._checkFinalizedStatuses(t),n},e.prototype._trimBuffer=function(){var t=this,n=t._bufferSize,i=t._timestampProvider,s=t._buffer,o=t._infiniteTimeWindow,a=(o?1:2)*n;if(n<1/0&&a<s.length&&s.splice(0,s.length-a),!o){for(var c=i.now(),u=0,l=1;l<s.length&&s[l]<=c;l+=2)u=l;u&&s.splice(0,u+1)}},e})(Ft),zs=(function(r){ce(e,r);function e(t,n){return r.call(this)||this}return e.prototype.schedule=function(t,n){return this},e})(De),Or={setInterval:function(r,e){for(var t=[],n=2;n<arguments.length;n++)t[n-2]=arguments[n];return setInterval.apply(void 0,ae([r,e],oe(t)))},clearInterval:function(r){return clearInterval(r)},delegate:void 0},Bs=(function(r){ce(e,r);function e(t,n){var i=r.call(this,t,n)||this;
vendor: 4,803 bytes, line 107
107return i.scheduler=t,i.work=n,i.pending=!1,i}return e.prototype.schedule=function(t,n){var i;if(n===void 0&&(n=0),this.closed)return this;this.state=t;var s=this.id,o=this.scheduler;return s!=null&&(this.id=this.recycleAsyncId(o,s,n)),this.pending=!0,this.delay=n,this.id=(i=this.id)!==null&&i!==void 0?i:this.requestAsyncId(o,this.id,n),this},e.prototype.requestAsyncId=function(t,n,i){return i===void 0&&(i=0),Or.setInterval(t.flush.bind(t,this),i)},e.prototype.recycleAsyncId=function(t,n,i){if(i===void 0&&(i=0),i!=null&&this.delay===i&&this.pending===!1)return n;n!=null&&Or.clearInterval(n)},e.prototype.execute=function(t,n){if(this.closed)return new Error("executing a cancelled action");this.pending=!1;var i=this._execute(t,n);if(i)return i;this.pending===!1&&this.id!=null&&(this.id=this.recycleAsyncId(this.scheduler,this.id,null))},e.prototype._execute=function(t,n){var i=!1,s;try{this.work(t)}catch(o){i=!0,s=o||new Error("Scheduled action threw falsy error")}if(i)return this.unsubscribe(),s},e.prototype.unsubscribe=function(){if(!this.closed){var t=this,n=t.id,i=t.scheduler,s=i.actions;this.work=this.state=this.scheduler=null,this.pending=!1,Ke(s,this),n!=null&&(this.id=this.recycleAsyncId(i,n,null)),this.delay=null,r.prototype.unsubscribe.call(this)}},e})(zs),$r=(function(){function r(e,t){t===void 0&&(t=r.now),this.schedulerActionCtor=e,this.now=t}return r.prototype.schedule=function(e,t,n){return t===void 0&&(t=0),new this.schedulerActionCtor(this,e).schedule(n,t)},r.now=Vt.now,r})(),Hs=(function(r){ce(e,r);function e(t,n){n===void 0&&(n=$r.now);var i=r.call(this,t,n)||this;return i.actions=[],i._active=!1,i}return e.prototype.flush=function(t){var n=this.actions;if(this._active){n.push(t);return}var i;this._active=!0;do if(i=t.execute(t.state,t.delay))break;while(t=n.shift());if(this._active=!1,i){for(;t=n.shift();)t.unsubscribe();throw i}},e})($r),Ks=new Hs(Bs),Ws=Ks,Gs=new V(function(r){return r.complete()});function Js(r){return r&&q(r.schedule)}function Ut(r){return r[r.length-1]}function Qs(r){return q(Ut(r))?r.pop():void 0}function kt(r){return Js(Ut(r))?r.pop():void 0}function Ys(r,e){return typeof Ut(r)=="number"?r.pop():e}var hn=(function(r){return r&&typeof r.length=="number"&&typeof r!="function"});function dn(r){return q(r?.then)}function gn(r){return q(r[qt])}function pn(r){return Symbol.asyncIterator&&q(r?.[Symbol.asyncIterator])}function yn(r){return new TypeError("You provided "+(r!==null&&typeof r=="object"?"an invalid object":"'"+r+"'")+" where a stream was expected. You can provide an Observable, Promise, ReadableStream, Array, AsyncIterable, or Iterable.")}function Xs(){return typeof Symbol!="function"||!Symbol.iterator?"@@iterator":Symbol.iterator}var mn=Xs();function vn(r){return q(r?.[mn])}function bn(r){return Os(this,arguments,function(){var t,n,i,s;return an(this,function(o){switch(o.label){case 0:t=r.getReader(),o.label=1;case 1:o.trys.push([1,,9,10]),o.label=2;case 2:return[4,be(t.read())];case 3:return n=o.sent(),i=n.value,s=n.done,s?[4,be(void 0)]:[3,5];case 4:return[2,o.sent()];case 5:return[4,be(i)];case 6:return[4,o.sent()];case 7:return o.sent(),[3,2];case 8:return[3,10];case 9:return t.releaseLock(),[7];case 10:return[2]}})})}function wn(r){return q(r?.getReader)}function se(r){if(r instanceof V)return r;if(r!=null){if(gn(r))return Zs(r);if(hn(r))return eo(r);if(dn(r))return to(r);if(pn(r))return En(r);if(vn(r))return ro(r);if(wn(r))return no(r)}throw yn(r)}function Zs(r){return new V(function(e){var t=r[qt]();if(q(t.subscribe))return t.subscribe(e);throw new TypeError("Provided object does not correctly implement Symbol.observable")})}function eo(r){return new V(function(e){for(var t=0;t<r.length&&!e.closed;t++)e.next(r[t]);e.complete()})}function to(r){return new V(function(e){r.then(function(t){e.closed||(e.next(t),e.complete())},function(t){return e.error(t)}).then(null,ln)})}function ro(r){return new V(function(e){var t,n;try{for(var i=_e(r),s=i.next();!s.done;s=i.next()){var o=s.value;if(e.next(o),e.closed)return}}catch(a){t={error:a}}finally{try{s&&!s.done&&(n=i.return)&&n.call(i)}finally{if(t)throw t.error}}e.complete()})}function En(r){return new V(function(e){io(r,e).catch(function(t){return e.error(t)})})}function no(r){return En(bn(r))}function io(r,e){var t,n,i,s;return Rs(this,void 0,void 0,function(){var o,a;return an(this,function(c){switch(c.label){case 0:c.trys.push([0,5,6,11]),t=$s(r),c.label=1;case 1:return[4,t.next()];case 2:if(n=c.sent(),!!n.done)return[3,4];if(o=n.value,e.next(o),e.closed)return[2];c.label=3;case 3:return[3,1];case 4:return[3,11];case 5:return a=c.sent(),i={error:a},[3,11];case 6:return c.trys.push([6,,9,10]),n&&!n.done&&(s=t.return)?[4,s.call(t)]:[3,8];case 7:c.sent(),c.label=8;case 8:return[3,10];case 9:if(i)throw i.error;return[7];
107case 10:return[7];case 11:return e.complete(),[2]}})})}function de(r,e,t,n,i){n===void 0&&(n=0),i===void 0&&(i=!1);var s=e.schedule(function(){t(),i?r.add(this.schedule(null,n)):this.unsubscribe()},n);if(r.add(s),!i)return s}function _n(r,e){return e===void 0&&(e=0),ie(function(t,n){t.subscribe(he(n,function(i){return de(n,r,function(){return n.next(i)},e)},function(){return de(n,r,function(){return n.complete()},e)},function(i){return de(n,r,function(){return n.error(i)},e)}))})}function Sn(r,e){return e===void 0&&(e=0),ie(function(t,n){n.add(r.schedule(function(){return t.subscribe(n)},e))})}function so(r,e){return se(r).pipe(Sn(e),_n(e))}function oo(r,e){return se(r).pipe(Sn(e),_n(e))}function ao(r,e){return new V(function(t){var n=0;return e.schedule(function(){n===r.length?t.complete():(t.next(r[n++]),t.closed||this.schedule())})})}function co(r,e){return new V(function(t){var n;return de(t,e,function(){n=r[mn](),de(t,e,function(){var i,s,o;try{i=n.next(),s=i.value,o=i.done}catch(a){t.error(a);return}o?t.complete():t.next(s)},0,!0)}),function(){return q(n?.return)&&n.return()}})}function Cn(r,e){if(!r)throw new Error("Iterable cannot be null");return new V(function(t){de(t,e,function(){var n=r[Symbol.asyncIterator]();de(t,e,function(){n.next().then(function(i){i.done?t.complete():t.next(i.value)})},0,!0)})})}function uo(r,e){return Cn(bn(r),e)}function lo(r,e){if(r!=null){if(gn(r))return so(r,e);if(hn(r))return ao(r,e);if(dn(r))return oo(r,e);if(pn(r))return Cn(r,e);if(vn(r))return co(r,e);if(wn(r))return uo(r,e)}throw yn(r)}function Pe(r,e){return e?lo(r,e):se(r)}function we(){for(var r=[],e=0;e<arguments.length;e++)r[e]=arguments[e];var t=kt(r);return Pe(r,t)}function An(r,e){var t=q(r)?r:function(){return r},n=function(i){return i.error(t())};return new V(n)}function fo(r){return!!r&&(r instanceof V||q(r.lift)&&q(r.subscribe))}var Tn=jt(function(r){return function(){r(this),this.name="EmptyError",this.message="no elements in sequence"}});function R(r,e){return new Promise(function(t,n){var i=!1,s;r.subscribe({next:function(o){s=o,i=!0},error:n,complete:function(){i?t(s):n(new Tn)}})})}function St(r,e){return new Promise(function(t,n){var i=new Se({next:function(s){t(s),i.unsubscribe()},error:n,complete:function(){n(new Tn)}});r.subscribe(i)})}function ho(r){return r instanceof Date&&!isNaN(r)}function H(r,e){return ie(function(t,n){var i=0;t.subscribe(he(n,function(s){n.next(r.call(e,s,i++))}))})}var go=Array.isArray;function po(r,e){return go(e)?r.apply(void 0,ae([],oe(e))):r(e)}function yo(r){return H(function(e){return po(r,e)})}function mo(r,e,t){return t===void 0&&(t=tt),function(n){xr(e,function(){for(var i=r.length,s=new Array(i),o=i,a=i,c=function(l){xr(e,function(){var d=Pe(r[l],e),m=!1;d.subscribe(he(n,function(y){s[l]=y,m||(m=!0,a--),a||n.next(t(s.slice()))},function(){--o||n.complete()}))},n)},u=0;u<i;u++)c(u)})}}function xr(r,e,t){e()}function vo(r,e,t,n,i,s,o,a){var c=[],u=0,l=0,d=!1,m=function(){d&&!c.length&&!u&&e.complete()},y=function(g){return u<n?f(g):c.push(g)},f=function(g){u++;var w=!1;se(t(g,l++)).subscribe(he(e,function(p){e.next(p)},function(){w=!0},void 0,function(){if(w)try{u--;for(var p=function(){var h=c.shift();o||f(h)};c.length&&u<n;)p();m()}catch(h){e.error(h)}}))};return r.subscribe(he(e,y,function(){d=!0,m()})),function(){}}function ge(r,e,t){return t===void 0&&(t=1/0),q(e)?ge(function(n,i){return H(function(s,o){return e(n,s,i,o)})(se(r(n,i)))},t):(typeof e=="number"&&(t=e),ie(function(n,i){return vo(n,i,r,t)}))}function In(r){return r===void 0&&(r=1/0),ge(tt,r)}function bo(){return In(1)}function wo(){for(var r=[],e=0;e<arguments.length;e++)r[e]=arguments[e];return bo()(Pe(r,kt(r)))}function Rn(r){return new V(function(e){se(r()).subscribe(e)})}function Eo(r,e,t){return t===void 0&&(t=Ws),new V(function(n){var i=ho(r)?+r-t.now():r;i<0&&(i=0);var s=0;return t.schedule(function(){n.closed||(n.next(s++),n.complete())},i)})}function _o(){for(var r=[],e=0;e<arguments.length;e++)r[e]=arguments[e];var t=kt(r),n=Ys(r,1/0),i=r;return i.length?i.length===1?se(i[0]):In(n)(Pe(i,t)):Gs}var So=Array.isArray;function Co(r){return r.length===1&&So(r[0])?r[0]:r}function Re(r,e){return ie(function(t,n){var i=0;t.subscribe(he(n,function(s){return r.call(e,s,i++)&&n.next(s)}))})}function We(r){return ie(function(e,t){var n=null,i=!1,s;n=e.subscribe(he(t,void 0,void 0,function(o){s=se(r(o,We(r)(e))),n?(n.unsubscribe(),n=null,s.subscribe(t)):i=!0})),i&&(n.unsubscribe(),n=null,s.subscribe(t))})}function On(){for(var r=[],e=0;e<arguments.length;e++)r[e]=arguments[e];var t=Qs(r);return t?Ls(On.apply(void 0,ae([],oe(r))),yo(t)):ie(function(n,i){mo(ae([n],oe(Co(r))))(i)})}function Ao(){for(var r=[],e=0;e<arguments.length;e++)r[e]=arguments[e];return On.apply(void 0,ae([],oe(r)))}function $n(r){return ie(function(e,t){try{e.subscribe(t)}finally{t.add(r)}})}function xn(r){r===void 0&&(r={});var e=r.connector,t=e===void 0?function(){return new Ft}:e,n=r.resetOnError,i=n===void 0?!0:n,s=r.resetOnComplete,o=s===void 0?!0:s,a=r.resetOnRefCountZero,c=a===void 0?!0:a;return function(u){var l,d,m,y=0,f=!1,g=!1,w=function(){d?.unsubscribe(),d=void 0},p=function(){w(),l=m=void 0,f=g=!1},h=function(){var v=l;p(),v?.unsubscribe()};return ie(function(v,b){y++,!g&&!f&&w();var _=m=m??t();b.add(function(){y--,y===0&&!g&&!f&&(d=Ct(h,c))}),_.subscribe(b),!l&&y>0&&(l=new Se({next:function(S){return _.next(S)},error:function(S){g=!0,w(),d=Ct(p,i,S),_.error(S)},complete:function(){f=!0,w(),d=Ct(p,o),_.complete()}}),se(v).subscribe(l))})(u)}}function Ct(r,e){for(var t=[],n=2;n<arguments.length;n++)t[n-2]=arguments[n];if(e===!0){r();return}if(e!==!1){var i=new Se({next:function(){i.unsubscribe(),r()}});return se(e.apply(void 0,ae([],oe(t)))).subscribe(i)}}function To(r,e,t){var n,i=!1;return n=r,xn({connector:function(){return new Ns(n,e,t)},resetOnError:!0,resetOnComplete:!1,resetOnRefCountZero:i})}function Io(r,e,t){var n=q(r)||e||t?{next:r,error:e,complete:t}:r;return n?ie(function(i,s){var o;(o=n.subscribe)===null||o===void 0||o.call(n);var a=!0;i.subscribe(he(s,function(c){var u;(u=n.next)===null||u===void 0||u.call(n,c),s.next(c)},function(){var c;
107a=!1,(c=n.complete)===null||c===void 0||c.call(n),s.complete()},function(c){var u;a=!1,(u=n.error)===null||u===void 0||u.call(n,c),s.error(c)},function(){var c,u;a&&((c=n.unsubscribe)===null||c===void 0||c.call(n)),(u=n.finalize)===null||u===void 0||u.call(n)}))}):tt}function Dn(r){return typeof r=="object"&&r!==null&&!Array.isArray(r)}var Pn={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},Mn={0:8203,1:8204,2:8205,3:65279};new Array(4).fill(String.fromCodePoint(Mn[0])).join("");Object.fromEntries(Object.entries(Mn).map(r=>r.reverse()));Object.fromEntries(Object.entries(Pn).map(r=>r.reverse()));var Ro=`${Object.values(Pn).map(r=>`\\u{${r.toString(16)}}`).join("")}`,Dr=new RegExp(`[${Ro}]{4,}`,"gu");function Oo(r){var e;return{cleaned:r.replace(Dr,""),encoded:((e=r.match(Dr))==null?void 0:e[0])||""}}function $o(r){return r&&JSON.parse(Oo(JSON.stringify(r)).cleaned)}function xo(r){return $o(r)}const Do="drafts",Po="versions",Ce=".",Ge=`${Do}${Ce}`,jn=`${Po}${Ce}`;function rt(r){return r.startsWith(Ge)}function nt(r){return r.startsWith(jn)}function Ln(r){if(nt(r)){const e=it(r);return Ge+e}return rt(r)?r:Ge+r}function Me(r,e){if(e==="drafts"||e==="published")throw new Error('Version can not be "published" or "drafts"');return`${jn}${e}${Ce}${it(r)}`}function qn(r){if(!nt(r))return;const[e,t]=r.split(Ce);return t}function it(r){return nt(r)?r.split(Ce).slice(2).join(Ce):rt(r)?r.slice(Ge.length):r}let Mo=r=>crypto.getRandomValues(new Uint8Array(r)),jo=(r,e,t)=>{let n=(2<<Math.log(r.length-1)/Math.LN2)-1,i=-~(1.6*n*e/r.length);return(s=e)=>{let o="";for(;;){let a=t(i),c=i|0;for(;c--;)if(o+=r[a[c]&n]||"",o.length===s)return o}}},Lo=(r,e=21)=>jo(r,e,Mo);const Pr=/\r\n|[\n\r\u2028\u2029]/;function qo(r,e,t){const n=r.split(Pr),i={start:Mr(e.start,n),end:e.end?Mr(e.end,n):void 0},{start:s,end:o,markerLines:a}=Fo(i,n),c=`${o}`.length;return r.split(Pr,o).slice(s,o).map((u,l)=>{const d=s+1+l,m=` ${` ${d}`.slice(-c)} |`,y=a[d],f=!a[d+1];if(!y)return` ${m}${u.length>0?` ${u}`:""}`;let g="";if(Array.isArray(y)){const w=u.slice(0,Math.max(y[0]-1,0)).replace(/[^\t]/g," "),p=y[1]||1;g=[` 108 `,m.replace(/\d/g," ")," ",w,"^".repeat(p)].join(""),f&&t&&(g+=" "+t)}return[">",m,u.length>0?` ${u}`:"",g].join("")}).join(` 109`)}function Fo(r,e){const t={...r.start},n={...t,...r.end},i=2,s=3,o=t.line??-1,a=t.column??0,c=n.line,u=n.column;let l=Math.max(o-(i+1),0),d=Math.min(e.length,c+s);o===-1&&(l=0),c===-1&&(d=e.length);const m=c-o,y={};if(m)for(let f=0;f<=m;f++){const g=f+o;if(!a)y[g]=!0;else if(f===0){const w=e[g-1].length;y[g]=[a,w-a+1]}else if(f===m)y[g]=[0,u];else{const w=e[g-f].length;y[g]=[0,w]}}else a===u?a?y[o]=[a,0]:y[o]=!0:y[o]=[a,u-a];return{start:l,end:d,markerLines:y}}function Mr(r,e){let t=0;for(let n=0;n<e.length;n++){const i=e[n].length+1;if(t+i>r)return{line:n+1,column:r-t};t+=i}return{line:e.length,column:e[e.length-1]?.length??0}}const At=5;class Vo extends Error{response;statusCode=400;responseBody;details;constructor(e,t){const n=Fn(e,t);super(n.message),Object.assign(this,n)}}class Uo extends Error{response;statusCode=500;responseBody;details;constructor(e){const t=Fn(e);super(t.message),Object.assign(this,t)}}function Fn(r,e){const t=r.body,n={response:r,statusCode:r.statusCode,responseBody:zo(t,r),message:"",details:void 0};if(!Dn(t))return n.message=Tt(r,t),n;const i=t.error;if(typeof i=="string"&&typeof t.message=="string")return n.message=`${i} - ${t.message}`,n;if(typeof i!="object"||i===null)return typeof i=="string"?n.message=i:typeof t.message=="string"?n.message=t.message:n.message=Tt(r,t),n;if(ko(i)||No(i)){const s=i.items||[],o=s.slice(0,At).map(c=>c.error?.description).filter(Boolean);let a=o.length?`: 110- ${o.join(` 111- `)}`:"";return s.length>At&&(a+=` 112...and ${s.length-At} more`),n.message=`${i.description}${a}`,n.details=t.error,n}if(Vn(i)){const s=e?.options?.query?.tag;return n.message=Un(i,s),n.details=t.error,n}return"description"in i&&typeof i.description=="string"?(n.message=i.description,n.details=i,n):(n.message=Tt(r,t),n)}function ko(r){return"type"in r&&r.type==="mutationError"&&"description"in r&&typeof r.description=="str
112ing"}function No(r){return"type"in r&&r.type==="actionError"&&"description"in r&&typeof r.description=="string"}function Vn(r){return Dn(r)&&r.type==="queryParseError"&&typeof r.query=="string"&&typeof r.start=="number"&&typeof r.end=="number"}function Un(r,e){const{query:t,start:n,end:i,description:s}=r;if(!t||typeof n>"u")return`GROQ query parse error: ${s}`;const o=e?` 113 114Tag: ${e}`:"";return`GROQ query parse error: 115${qo(t,{start:n,end:i},s)}${o}`}function Tt(r,e){const t=typeof e=="string"?` (${Bo(e,100)})`:"",n=r.statusMessage?` ${r.statusMessage}`:"";return`${r.method}-request to ${r.url} resulted in HTTP ${r.statusCode}${n}${t}`}function zo(r,e){return(e.headers["content-type"]||"").toLowerCase().indexOf("application/json")!==-1?JSON.stringify(r,null,2):r}function Bo(r,e){return r.length>e?`${r.slice(0,e)}â¦`:r}class Ho extends Error{projectId;addOriginUrl;constructor({projectId:e}){super("CorsOriginError"),this.name="CorsOriginError",this.projectId=e;const t=new URL(`https://sanity.io/manage/project/${e}/api`);if(typeof location<"u"){const{origin:n}=location;t.searchParams.set("cors","add"),t.searchParams.set("origin",n),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}`}}const Ko={onResponse:(r,e)=>{if(r.statusCode>=500)throw new Uo(r);if(r.statusCode>=400)throw new Vo(r,e);return r}};function Wo(r={}){const e={},t=n=>r.ignoreWarnings===void 0?!1:(Array.isArray(r.ignoreWarnings)?r.ignoreWarnings:[r.ignoreWarnings]).some(i=>typeof i=="string"?n.includes(i):i instanceof RegExp?i.test(n):!1);return{onResponse:n=>{const i=n.headers["x-sanity-warning"],s=Array.isArray(i)?i:[i];for(const o of s)!o||e[o]||t(o)||(e[o]=!0,console.warn(o));return n}}}function jr(r,e={}){return ms([Mt({shouldRetry:Go}),...r,Wo(e),_s(),Ss(),Ts(),Ko,As({implementation:V})])}function Go(r,e,t){if(t.maxRetries===0)return!1;const n=t.method==="GET"||t.method==="HEAD",i=(t.uri||t.url).startsWith("/data/query"),s=r.response&&(r.response.statusCode===429||r.response.statusCode===502||r.response.statusCode===503);return(n||i)&&s?!0:Mt.shouldRetry(r,e,t)}const Jo="https://www.sanity.io/help/";function Nt(r){return Jo+r}const Lr=["image","file"],qr=["before","after","replace"],Ae=r=>{if(!/^(~[a-z0-9]{1}[-\w]{0,63}|[a-z0-9]{1}[-\w]{0,63})$/.test(r))throw new Error("Datasets can only contain lowercase characters, numbers, underscores and dashes, and start with tilde, and be maximum 64 characters")},Qo=r=>{if(!/^[-a-z0-9]+$/i.test(r))throw new Error("`projectId` can only contain only a-z, 0-9 and dashes")},Yo=r=>{if(Lr.indexOf(r)===-1)throw new Error(`Invalid asset type: ${r}. Must be one of ${Lr.join(", ")}`)},$e=(r,e)=>{if(e===null||typeof e!="object"||Array.isArray(e))throw new Error(`${r}() takes an object of properties`)},Je=(r,e)=>{if(typeof e!="string"||!/^[a-z0-9_][a-z0-9_.-]{0,127}$/i.test(e)||e.includes(".."))throw new Error(`${r}(): "${e}" is not a valid document ID`)},Te=(r,e)=>{if(!e._id)throw new Error(`${r}() requires that the document contains an ID ("_id" property)`);Je(r,e._id)},Xo=(r,e)=>{if(typeof e!="string")throw new Error(`\`${r}()\`: \`${e}\` is not a valid document type`)},kn=(r,e)=>{if(!e._type)throw new Error(`\`${r}()\` requires that the document contains a type (\`_type\` property)`);Xo(r,e._type)},Zo=(r,e)=>{if(e._id&&e._id!==r)throw new Error(`The provided document ID (\`${e._id}\`) does not match the generated version ID (\`${r}\`)`)},ea=(r,e,t)=>{const n="insert(at, selector, items)";if(qr.indexOf(r)===-1){const i=qr.map(s=>`"${s}"`).join(", ");throw new Error(`${n} takes an "at"-argument which is one of: ${i}`)}if(typeof e!="string")throw new Error(`${n} takes a "selector"-argument which must be a string`);if(!Array.isArray(t))throw new Error(`${n} takes an "items"-argument which must be an array`)},ye=r=>{if(r.dataset)return r.dataset;const e=r.resource;if(e&&e.type==="dataset"){const t=e.id.split(".");if(t.length!==2)throw new Error('Dataset resource ID must be in the format "project.dataset"');return t[1]}throw new Error("`dataset` must be provided to perform queries")},Nn=r=>{if(typeof r!="string"||!/^[a-z0-9._-]{1,75}$/i.test(r))throw new Error("Tag can only contain alphanumeric characters, underscores, dashes and dots, and be between one and 75 characters long.");return r},zn=r=>{const e=r.resource;if(!e)throw new Error("`resource` must be provided to perform resource queries");const{type:t,id:n}=e;switch(t){case"dataset":{if(n.split(".").length!==2)throw new Error('Dataset resource ID must be in the format "project.dataset"');return}case"dashboard":case"media-library":case"canvas":return;default:throw new Error(`Unsupported resource type: ${t.toString()}`)}},ne=(r,e)=>{if(e.resource)throw new Error(`\`${r}\` does not support resource-based operations`)};function ta(r){let e=!1,t;return(...n)=>(e||(t=r(...n),e=!0),t)}const ue=r=>ta((...e)=>console.warn(r.join(" "),...e)),ra=ue(["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"]),na=ue(["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."]),ia=ue(["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."]),sa=ue(["The `previewDrafts` perspective has been renamed to `drafts` and will be removed in a future API version"]),oa=ue(["You have configured Sanity client to use a token in the browser. This may cause unintentional security issues.",`See ${Nt("js-client-browser-token")} for more information and how to hide this warning.`]),aa=ue(["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`."]),ca=ue(["Using the Sanity client without specifying an API version is deprecated.",`See ${Nt("js-client-api-version")}`]),ua=ue(["You have called `createVersion()` with a defined `document`. The recommended approach is to provide a `baseId` and `releaseId` instead."]),la=ue(["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."]),fa="apicdn.sanity.io",xe={apiHost:"https://api.sanity.io",apiVersion:"1",useProjectHostname:!0,stega:{enabled:!1}},ha=["localhost","127.0.0.1","0.0.0.0"],da=r=>ha.indexOf(r)!==-1;
115function ga(r){if(r==="1"||r==="X")return;const e=new Date(r);if(!(/^\d{4}-\d{2}-\d{2}$/.test(r)&&e instanceof Date&&e.getTime()>0))throw new Error("Invalid API version string, expected `1` or date in format `YYYY-MM-DD`")}function Bn(r){if(Array.isArray(r)&&r.length>1&&r.includes("raw"))throw new TypeError('Invalid API perspective value: "raw". The raw-perspective can not be combined with other perspectives')}const Hn=(r,e)=>{const t={...e,...r,stega:{...typeof e.stega=="boolean"?{enabled:e.stega}:e.stega||xe.stega,...typeof r.stega=="boolean"?{enabled:r.stega}:r.stega||{}}};t.apiVersion||ca();const n={...xe,...t};n["~experimental_resource"]&&!n.resource&&(la(),n.resource=n["~experimental_resource"]);const i=n.resource,s=n.useProjectHostname&&!i;if(typeof Promise>"u"){const y=Nt("js-client-promise-polyfill");throw new Error(`No native Promise-implementation found, polyfill needed - see ${y}`)}if(s&&!n.projectId)throw new Error("Configuration must contain `projectId`");if(i&&zn(n),typeof n.perspective<"u"&&Bn(n.perspective),"encodeSourceMap"in n)throw new Error("It looks like you're using options meant for '@sanity/preview-kit/client'. 'encodeSourceMap' is not supported in '@sanity/client'. Did you mean 'stega.enabled'?");if("encodeSourceMapAtPath"in n)throw new Error("It looks like you're using options meant for '@sanity/preview-kit/client'. 'encodeSourceMapAtPath' is not supported in '@sanity/client'. Did you mean 'stega.filter'?");if(typeof n.stega.enabled!="boolean")throw new Error(`stega.enabled must be a boolean, received ${n.stega.enabled}`);if(n.stega.enabled&&n.stega.studioUrl===void 0)throw new Error("stega.studioUrl must be defined when stega.enabled is true");if(n.stega.enabled&&typeof n.stega.studioUrl!="string"&&typeof n.stega.studioUrl!="function")throw new Error(`stega.studioUrl must be a string or a function, received ${n.stega.studioUrl}`);const o=typeof window<"u"&&window.location&&window.location.hostname,a=o&&da(window.location.hostname),c=!!n.token;n.withCredentials&&c&&(aa(),n.withCredentials=!1),o&&a&&c&&n.ignoreBrowserTokenWarning!==!0?oa():typeof n.useCdn>"u"&&na(),s&&Qo(n.projectId),n.dataset&&Ae(n.dataset),"requestTagPrefix"in n&&(n.requestTagPrefix=n.requestTagPrefix?Nn(n.requestTagPrefix).replace(/\.+$/,""):void 0),n.apiVersion=`${n.apiVersion}`.replace(/^v/,""),n.isDefaultApi=n.apiHost===xe.apiHost,n.useCdn===!0&&n.withCredentials&&ra(),n.useCdn=n.useCdn!==!1&&!n.withCredentials,ga(n.apiVersion);const u=n.apiHost.split("://",2),l=u[0],d=u[1],m=n.isDefaultApi?fa:d;return s?(n.url=`${l}://${n.projectId}.${d}/v${n.apiVersion}`,n.cdnUrl=`${l}://${n.projectId}.${m}/v${n.apiVersion}`):(n.url=`${n.apiHost}/v${n.apiVersion}`,n.cdnUrl=n.url),n};
115class Kn extends Error{name="ConnectionFailedError"}class pa extends Error{name="DisconnectError";reason;constructor(e,t,n={}){super(e,n),this.reason=t}}class ya extends Error{name="ChannelError";data;constructor(e,t){super(e),this.data=t}}class ma extends Error{name="MessageError";data;constructor(e,t,n={}){super(e,n),this.data=t}}class Fr extends Error{name="MessageParseError"}const va=["channelError","disconnect"];function Wn(r,e){return Rn(()=>{const t=r();return fo(t)?t:we(t)}).pipe(ge(t=>ba(t,e)))}function ba(r,e){return new V(t=>{const n=e.includes("open"),i=e.includes("reconnect");function s(u){if("data"in u){const[l,d]=Vr(u);t.error(l?new Fr("Unable to parse EventSource error message",{cause:d}):new ma((d?.data).message,d));return}r.readyState===r.CLOSED?t.error(new Kn("EventSource connection failed")):i&&t.next({type:"reconnect"})}function o(){t.next({type:"open"})}function a(u){const[l,d]=Vr(u);if(l){t.error(new Fr("Unable to parse EventSource message",{cause:l}));return}if(u.type==="channelError"){const m=new URL(r.url).searchParams.get("tag");t.error(new ya(wa(d?.data,m),d.data));return}if(u.type==="disconnect"){t.error(new pa(`Server disconnected client: ${d.data?.reason||"unknown error"}`));return}t.next({type:u.type,id:u.lastEventId,...d.data?{data:d.data}:{}})}r.addEventListener("error",s),n&&r.addEventListener("open",o);const c=[...new Set([...va,...e])].filter(u=>u!=="error"&&u!=="open"&&u!=="reconnect");return c.forEach(u=>r.addEventListener(u,a)),()=>{r.removeEventListener("error",s),n&&r.removeEventListener("open",o),c.forEach(u=>r.removeEventListener(u,a)),r.close()}})}function Vr(r){try{const e=typeof r.data=="string"&&JSON.parse(r.data);return[null,{type:r.type,id:r.lastEventId,...Ea(e)?{}:{data:e}}]}catch(e){return[e,null]}}function wa(r,e){const t=r.error;return t?Vn(t)?Un(t,e):t.description?t.description:typeof t=="string"?t:JSON.stringify(t,null,2):r.message||"Unknown listener error"}function Ea(r){for(const e in r)return!1;return!0}function Gn(r){if(typeof r=="string")return{id:r};if(Array.isArray(r))return{query:"*[_id in $ids]",params:{ids:r}};if(typeof r=="object"&&r!==null&&"query"in r&&typeof r.query=="string")return"params"in r&&typeof r.params=="object"&&r.params!==null?{query:r.query,params:r.params}:{query:r.query};const e=["* Document ID (<docId>)","* Array of document IDs","* Object containing `query`"].join(` 116`);throw new Error(`Unknown selection - must be one of: 117 118${e}`)}class Jn{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 $e("diffMatchPatch",e),this._assign("diffMatchPatch",e)}unset(e){if(!Array.isArray(e))throw new Error("unset(attrs) takes an array of attributes to unset, non-array given");return this.operations=Object.assign({},this.operations,{unset:e}),this}inc(e){return this._assign("inc",e)}dec(e){return this._assign("dec",e)}insert(e,t,n){return ea(e,t,n),this._assign("insert",{[e]:t,items:n})}append(e,t){return this.insert("after",`${e}[-1]`,t)}prepend(e,t){return this.insert("before",`${e}[0]`,t)}splice(e,t,n,i){const s=typeof n>"u"||n===-1,o=t<0?t-1:t,a=s?-1:Math.max(0,t+n),c=o<0&&a>=0?"":a,u=`${e}[${o}:${c}]`;return this.insert("replace",u,i||[])}ifRevisionId(e){return this.operations.ifRevisionID=e,this}serialize(){return{...Gn(this.selection),...this.operations}}toJSON(){return this.serialize()}reset(){return this.operations={},this}_assign(e,t,n=!0){return $e(e,t),this.operations=Object.assign({},this.operations,{[e]:Object.assign({},n&&this.operations[e]||{},t)}),this}_set(e,t){return this._assign(e,t,!1)}}class pe extends Jn{#e;constructor(e,t,n){super(e,t),this.#e=n}clone(){return new pe(this.selection,{...this.operations},this.#e)}commit(e){if(!this.#e)throw new Error("No `client` passed to patch, either provide one or pass the patch to a clients `mutate()` method");const t=typeof this.selection=="string",n=Object.assign({returnFirst:t,returnDocuments:!0},e);return this.#e.mutate({patch:this.serialize()},n)}}class fe extends Jn{#e;constructor(e,t,n){super(e,t),this.#e=n}clone(){return new fe(this.selection,{...this.operations},this.#e)}commit(e){if(!this.#e)throw new Error("No `client` passed to patch, either provide one or pass the patch to a clients `mutate()` method");
118const t=typeof this.selection=="string",n=Object.assign({returnFirst:t,returnDocuments:!0},e);return this.#e.mutate({patch:this.serialize()},n)}}const Qn={returnDocuments:!1};class Yn{operations;trxId;constructor(e=[],t){this.operations=e,this.trxId=t}create(e){return $e("create",e),this._add({create:e})}createIfNotExists(e){const t="createIfNotExists";return $e(t,e),Te(t,e),this._add({[t]:e})}createOrReplace(e){const t="createOrReplace";return $e(t,e),Te(t,e),this._add({[t]:e})}delete(e){return Je("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 st extends Yn{#e;constructor(e,t,n){super(e,n),this.#e=t}clone(){return new st([...this.operations],this.#e,this.trxId)}commit(e){if(!this.#e)throw new Error("No `client` passed to transaction, either provide one or pass the transaction to a clients `mutate()` method");return this.#e.mutate(this.serialize(),Object.assign({transactionId:this.trxId},Qn,e||{}))}patch(e,t){const n=typeof t=="function",i=typeof e!="string"&&e instanceof fe,s=typeof e=="object"&&("query"in e||"id"in e);if(i)return this._add({patch:e.serialize()});if(n){const o=t(new fe(e,{},this.#e));if(!(o instanceof fe))throw new Error("function passed to `patch()` must return the patch");return this._add({patch:o.serialize()})}if(s){const o=new fe(e,t||{},this.#e);return this._add({patch:o.serialize()})}return this._add({patch:{id:e,...t}})}}class ot extends Yn{#e;constructor(e,t,n){super(e,n),this.#e=t}clone(){return new ot([...this.operations],this.#e,this.trxId)}commit(e){if(!this.#e)throw new Error("No `client` passed to transaction, either provide one or pass the transaction to a clients `mutate()` method");return this.#e.mutate(this.serialize(),Object.assign({transactionId:this.trxId},Qn,e||{}))}patch(e,t){const n=typeof t=="function";if(typeof e!="string"&&e instanceof pe)return this._add({patch:e.serialize()});if(n){const i=t(new pe(e,{},this.#e));if(!(i instanceof pe))throw new Error("function passed to `patch()` must return the patch");return this._add({patch:i.serialize()})}return this._add({patch:{id:e,...t}})}}const _a="X-Sanity-Project-ID";function Sa(r,e={}){const t={};r.headers&&Object.assign(t,r.headers);const n=e.token||r.token;n&&(t.Authorization=`Bearer ${n}`),!e.useGlobalApi&&!r.useProjectHostname&&r.projectId&&(t[_a]=r.projectId);const i=!!(typeof e.withCredentials>"u"?r.withCredentials:e.withCredentials),s=typeof e.timeout>"u"?r.timeout:e.timeout;return Object.assign({},e,{headers:Object.assign({},t,e.headers||{}),timeout:typeof s>"u"?300*1e3:s,proxy:e.proxy||r.proxy,json:!0,withCredentials:i,fetch:typeof e.fetch=="object"&&typeof r.fetch=="object"?{...r.fetch,...e.fetch}:e.fetch||r.fetch})}const Xn=({query:r,params:e={},options:t={}})=>{const n=new URLSearchParams,{tag:i,includeMutations:s,returnQuery:o,...a}=t;i&&n.append("tag",i),n.append("query",r);for(const[c,u]of Object.entries(e))u!==void 0&&n.append(`$${c}`,JSON.stringify(u));for(const[c,u]of Object.entries(a))u&&n.append(c,`${u}`);return o===!1&&n.append("returnQuery","false"),s===!1&&n.append("includeMutations","false"),`?${n}`},Ca=(r,e)=>r===!1?void 0:typeof r>"u"?e:r,Aa=(r={})=>({dryRun:r.dryRun,returnIds:!0,returnDocuments:Ca(r.returnDocuments,!0),visibility:r.visibility||"sync",autoGenerateArrayKeys:r.autoGenerateArrayKeys,skipCrossDatasetReferenceValidation:r.skipCrossDatasetReferenceValidation}),zt=r=>r.type==="response",Ta=r=>r.body,Ia=(r,e)=>r.reduce((t,n)=>(t[e(n)]=n,t),Object.create(null)),Ra=11264;function Zn(r,e,t,n,i={},s={}){const o="stega"in s?{...t||{},...typeof s.stega=="boolean"?{enabled:s.stega}:s.stega||{}}:t,a=o.enabled?xo(i):i,c=s.filterResponse===!1?f=>f:f=>f.result,{cache:u,next:l,...d}={useAbortSignal:typeof s.signal<"u",resultSourceMap:o.enabled?"withKeyArraySelector":s.resultSourceMap,...s,returnQuery:s.filterResponse===!1&&s.returnQuery!==!1},m=typeof u<"u"||typeof l<"u"?{...d,fetch:{cache:u,next:l}}:d,y=me(r,e,"query",{query:n,params:a},m);return o.enabled?y.pipe(Ao(Pe(Pt(()=>import("./CMWYLu75.js"),__vite__mapDeps([1,2,3]),import.meta.url).then(function(f){return f.stegaEncodeSourceMap$1}).then(({stegaEncodeSourceMap:f})=>f))),H(([f,g])=>{const w=g(f.result,f.resultSourceMap,o);return c({...f,result:w})})):y.pipe(H(c))}function Ie(r,e,t,n={}){const i=(()=>
118{if(!n.releaseId)return t;const o=qn(t);if(!o){if(rt(t))throw new Error(`The document ID (\`${t}\`) is a draft, but \`options.releaseId\` is set as \`${n.releaseId}\``);return Me(t,n.releaseId)}if(o!==n.releaseId)throw new Error(`The document ID (\`${t}\`) is already a version of \`${o}\` release, but this does not match the provided \`options.releaseId\` (\`${n.releaseId}\`)`);return t})(),s={uri:J(r,"doc",i),json:!0,tag:n.tag,signal:n.signal,query:n.includeAllVersions!==void 0?{includeAllVersions:n.includeAllVersions}:void 0};return Le(r,e,s).pipe(Re(zt),H(o=>{const a=o.body.documents;return a?n.includeAllVersions?a:a[0]:n.includeAllVersions?[]:void 0}))}function ei(r,e,t,n={}){const i={uri:J(r,"doc",t.join(",")),json:!0,tag:n.tag,signal:n.signal};return Le(r,e,i).pipe(Re(zt),H(s=>{const o=Ia(s.body.documents||[],a=>a._id);return t.map(a=>o[a]||null)}))}function ti(r,e,t,n={}){return me(r,e,"query",{query:"*[sanity::partOfRelease($releaseId)]",params:{releaseId:t}},n)}function ri(r,e,t,n){return Te("createIfNotExists",t),at(r,e,t,"createIfNotExists",n)}function ni(r,e,t,n){return Te("createOrReplace",t),at(r,e,t,"createOrReplace",n)}function ii(r,e,t,n,i){return Te("createVersion",t),kn("createVersion",t),ua(),F(r,e,{actionType:"sanity.action.document.version.create",publishedId:n,document:t},i)}function si(r,e,t,n,i,s,o){if(!n)throw new Error("`createVersion()` requires `baseId` when no `document` is provided");if(!t)throw new Error("`createVersion()` requires `publishedId` when `baseId` is provided");Je("createVersion",n),Je("createVersion",t);const a={actionType:"sanity.action.document.version.create",publishedId:t,baseId:n,versionId:i?Me(t,i):Ln(t),ifBaseRevisionId:s};return F(r,e,a,o)}function oi(r,e,t,n){return me(r,e,"mutate",{mutations:[{delete:Gn(t)}]},n)}function ai(r,e,t,n=!1,i){return F(r,e,{actionType:"sanity.action.document.version.discard",versionId:t,purge:n},i)}function ci(r,e,t,n){return Te("replaceVersion",t),kn("replaceVersion",t),F(r,e,{actionType:"sanity.action.document.version.replace",document:t},n)}function ui(r,e,t,n,i){return F(r,e,{actionType:"sanity.action.document.version.unpublish",versionId:t,publishedId:n},i)}function li(r,e,t,n){let i;t instanceof fe||t instanceof pe?i={patch:t.serialize()}:t instanceof st||t instanceof ot?i=t.serialize():i=t;const s=Array.isArray(i)?i:[i],o=n&&n.transactionId||void 0;return me(r,e,"mutate",{mutations:s,transactionId:o},n)}function F(r,e,t,n){const i=Array.isArray(t)?t:[t],s=n&&n.transactionId||void 0,o=n&&n.skipCrossDatasetReferenceValidation||void 0,a=n&&n.dryRun||void 0;return me(r,e,"actions",{actions:i,transactionId:s,skipCrossDatasetReferenceValidation:o,dryRun:a},n)}function me(r,e,t,n,i={}){const s=t==="mutate",o=t==="actions",a=t==="query",c=s||o?"":Xn(n),u=!s&&!o&&c.length<Ra,l=u?c:"",d=i.returnFirst,{timeout:m,token:y,tag:f,headers:g,returnQuery:w,lastLiveEventId:p,cacheMode:h}=i,v=J(r,t,l),b={method:u?"GET":"POST",uri:v,json:!0,body:u?void 0:n,query:s&&Aa(i),timeout:m,headers:g,token:y,tag:f,returnQuery:w,perspective:i.perspective,resultSourceMap:i.resultSourceMap,lastLiveEventId:Array.isArray(p)?p[0]:p,cacheMode:h,canUseCdn:a,signal:i.signal,fetch:i.fetch,useAbortSignal:i.useAbortSignal,useCdn:i.useCdn};return Le(r,e,b).pipe(Re(zt),H(Ta),H(_=>{if(!s)return _;const S=_.results||[];if(i.returnDocuments)return d?S[0]&&S[0].document:S.map(T=>T.document);const x=d?"documentId":"documentIds",$=d?S[0]&&S[0].id:S.map(T=>T.id);return{transactionId:_.transactionId,results:S,[x]:$}}))}function at(r,e,t,n,i={}){const s={[n]:t},o=Object.assign({returnFirst:!0,returnDocuments:!0},i);return me(r,e,"mutate",{mutations:[s]},o)}const je=r=>{const e=r.config();return e.dataset!==void 0&&e.projectId!==void 0||e.resource!==void 0},fi=(r,e)=>je(r)&&e.startsWith(J(r,"query")),Oa=(r,e)=>je(r)&&e.startsWith(J(r,"mutate")),$a=(r,e)=>je(r)&&e.startsWith(J(r,"doc","")),xa=(r,e)=>je(r)&&e.startsWith(J(r,"listen")),Da=(r,e)=>je(r)&&e.startsWith(J(r,"history","")),Pa=(r,e)=>e.startsWith("/data/")||fi(r,e)||Oa(r,e)||$a(r,e)||xa(r,e)||Da(r,e);function Le(r,e,t){const n=t.url||t.uri,i=r.config(),s=typeof t.canUseCdn>"u"?["GET","HEAD"].indexOf(t.method||"GET")>=0&&Pa(r,n):t.canUseCdn;let o=(t.useCdn??i.useCdn)&&s;const a=t.tag&&i.requestTagPrefix?[i.requestTagPrefix,t.tag].join("."):t.tag||i.requestTagPrefix;if(a&&t.tag!==null&&(t.query={tag:Nn(a),...t.query}),["GET","HEAD","POST"].indexOf(t.method||"GET")>=0&&fi(r,n)){const l=t.resultSourceMap??i.resultSourceMap;l!==void 0&&l!==!1&&(t.query={resultSourceMap:l,...t.query});const d=t.perspective||i.perspective;typeof d<"u"&&(d==="previewDrafts"&&sa(),Bn(d),t.query={perspective:Array.isArray(d)?d.join(","):d,...t.query},(Array.isArray(d)&&d.length>0||d==="previewDrafts"||d==="drafts")&&o&&(o=!1,ia())),t.lastLiveEventId&&(t.query={...t.query,lastLiveEventId:t.lastLiveEventId}),t.returnQuery===!1&&(t.query={returnQuery:"false",...t.query}),o&&t.cacheMode=="noStale"&&(t.query={cacheMode:"noStale",...t.query})}const c=Sa(i,Object.assign({},t,{url:Bt(r,n,o)})),u=new V(l=>e(c,i.requester).subscribe(l));return t.signal?u.pipe(Ma(t.signal)):u}function U(r,e,t){return Le(r,e,t).pipe(Re(n=>n.type==="response"),H(n=>n.body))}function J(r,e,t){const n=r.config();if(n.resource){zn(n);const o=qa(n),a=t!==void 0?`${e}/${t}`:e;return`${o}/${a}`.replace(/\/($|\?)/,"$1")}const i=ye(n),s=`/${e}/${i}`;return`/data${t!==void 0?`${s}/${t}`:s}`.replace(/\/($|\?)/,"$1")}function Bt(r,e,t=!1){const{url:n,cdnUrl:i}=r.config();return`${t?i:n}/${e.replace(/^\//,"")}`}function Ma(r){return e=>new V(t=>{const n=()=>t.error(La(r));if(r&&r.aborted){n();return}const i=e.subscribe(t);return r.addEventListener("abort",n),()=>{r.removeEventListener("abort",n),i.unsubscribe()}})}const ja=!!globalThis.DOMException;function La(r){if(ja)return new DOMException(r?.reason??"The operation was aborted.","AbortError");const e=new Error(r?.reason??"The operation was aborted.");return e.name="AbortError",e}const qa=r=>{const e=r.resource;if(!e)throw new Error("`resource` must be provided to perform resource queries");const{type:t,id:n}=e;switch(t){case"dataset":{const i=n.split(".");if(i.length!==2)throw new Error('Dataset ID must be in the format "project.dataset"');return`/projects/${i[0]}/datasets/${i[1]}`}case"canvas":return`/canvases/${n}`;case"media-library":return`/media-libraries/${n}`;case"dashboard":return`/dashboards/${n}`;default:throw new Error(`Unsupported resource type: ${t.toString()}`)}};function hi(r,e,t){const n=ye(r.config());return U(r,e,{method:"POST",uri:`/agent/action/generate/${n}`,body:t})}function Fa(r,e,t){const n=ye(r.config());return U(r,e,{method:"POST",uri:`/agent/action/patch/${n}`,body:t})}function Va(r,e,t){const n=ye(r.config());return U(r,e,{method:"POST",uri:`/agent/action/prompt/${n}`,body:t})}function di(r,e,t){const n=ye(r.config());return U(r,e,{method:"POST",uri:`/agent/action/transform/${n}`,body:t})}function gi(r,e,t){const n=ye(r.config());return U(r,e,{method:"POST",uri:`/agent/action/translate/${n}`,body:t})}class Ua{#e;#t;constructor(e,t){this.#e=e,this.#t=t}generate(e){return hi(this.#e,this.#t,e)}transform(e){return di(this.#e,this.#t,e)}translate(e){return gi(this.#e,this.#t,e)}}class ka{#e;#t;constructor(e,t){this.#e=e,this.#t=t}generate(e){return R(hi(this.#e,this.#t,e))}transform(e){return R(di(this.#e,this.#t,e))}translate(e){return R(gi(this.#e,this.#t,e))}prompt(e){return R(Va(this.#e,this.#t,e))}patch(e){return R(Fa(this.#e,this.#t,e))}}class Na{#e;#t;constructor(e,t){this.#e=e,this.#t=t}upload(e,t,n){return pi(this.#e,this.#t,e,t,n)}}class za{#e;#t;constructor(e,t){this.#e=e,this.#t=t}upload(e,t,n){const i=pi(this.#e,this.#t,e,t,n);return R(i.pipe(Re(s=>s.type==="response"),H(s=>s.body.document)))}}function pi(r,e,t,n,i={}){Yo(t);let s=i.extract||void 0;s&&!s.length&&(s=["none"]);const o=r.config(),a=Ha(i,n),{tag:c,label:u,title:l,description:d,creditLine:m,filename:y,source:f}=a,g=o.resource?.type==="media-library",w=g?{title:l,filename:y}:{label:u,title:l,description:d,filename:y,meta:s,creditLine:m};return f&&!g&&(w.sourceId=f.id,w.sourceName=f.name,w.sourceUrl=f.url),Le(r,e,{tag:c,method:"POST",timeout:a.timeout||0,uri:Ba(o,t),headers:a.contentType?{"Content-Type":a.contentType}:{},query:w,body:n})}function Ba(r,e){const t=e==="image"?"images":"files",n=r.resource;if(n){const{type:s,id:o}=n;switch(s){case"dataset":throw new Error("Assets are not supported for dataset resources, yet. Configure the client with `{projectId: <projectId>, dataset: <datasetId>}` instead.");case"canvas":return`/canvases/${o}/assets/${t}`;case"media-library":return`/media-libraries/${o}/upload`;case"dashboard":return`/dashboards/${o}/assets/${t}`;default:throw new Error(`Unsupported resource type: ${s.toString()}`)}}const i=ye(r);return`assets/${t}/${i}`}function Ha(r,e){return typeof File>"u"||!(e instanceof File)?r:Object.assign({filename:r.preserveFilename===!1?void 0:e.name,contentType:e.type},r)}var Ka=(r,e)=>Object.keys(e).concat(Object.keys(r)).reduce((t,n)=>(t[n]=typeof r[n]>"u"?e[n]:r[n],t),{});const Wa=(r,e)=>e.reduce((t,n)=>(typeof r[n]>"u"||(t[n]=r[n]),t),{}),yi=Rn(()=>Pt(()=>import("./CzmLdOMZ.js").then(r=>r.b),[],import.meta.url)).pipe(H(({default:r})=>r),To(1));function mi(){return function(r){return r.pipe(We((e,t)=>
118e instanceof Kn?wo(we({type:"reconnect"}),Eo(1e3).pipe(ge(()=>t))):An(()=>e)))}}const Ga=14800,Ja=["includePreviousRevision","includeResult","includeMutations","includeAllVersions","visibility","effectFormat","enableResume","tag"],Qa={includeResult:!0};function vi(r,e,t={}){const{url:n,token:i,withCredentials:s,requestTagPrefix:o,headers:a}=this.config(),c=t.tag&&o?[o,t.tag].join("."):t.tag,u={...Ka(t,Qa),tag:c},l=Wa(u,Ja),d=Xn({query:r,params:e,options:{tag:c,...l}}),m=`${n}${J(this,"listen",d)}`;if(m.length>Ga)return An(()=>new Error("Query too large for listener"));const y=u.events?u.events:["mutation"],f={};return s&&(f.withCredentials=!0),(i||a)&&(f.headers={},i&&(f.headers.Authorization=`Bearer ${i}`),a&&Object.assign(f.headers,a)),Wn(()=>(typeof EventSource>"u"||f.headers?yi:we(EventSource)).pipe(H(g=>new g(m,f))),y).pipe(mi(),Re(g=>y.includes(g.type)),H(g=>({type:g.type,..."data"in g?g.data:{}})))}function Ya(r,e){return Xa(typeof r=="function"?{predicate:r,...e}:r)}function Xa(r){return e=>{let t,n=!1;const{predicate:i,...s}=r,o=e.pipe(Io(c=>{r.predicate(c)&&(n=!0,t=c)}),$n(()=>{n=!1,t=void 0}),xn(s)),a=new V(c=>{n&&c.next(t),c.complete()});return _o(o,a)}}const Ur="2021-03-25";class bi{#e;constructor(e){this.#e=e}events({includeDrafts:e=!1,tag:t}={}){const{projectId:n,apiVersion:i,token:s,withCredentials:o,requestTagPrefix:a,headers:c}=this.#e.config(),u=i.replace(/^v/,"");if(u!=="X"&&u<Ur)throw new Error(`The live events API requires API version ${Ur} or later. The current API version is ${u}. Please update your API version to use this feature.`);if(e&&!s&&!o)throw new Error("The live events API requires a token or withCredentials when 'includeDrafts: true'. Please update your client configuration. The token should have the lowest possible access role.");const l=J(this.#e,"live/events"),d=new URL(this.#e.getUrl(l,!1)),m=t&&a?[a,t].join("."):t;m&&d.searchParams.set("tag",m),e&&d.searchParams.set("includeDrafts","true");const y={};e&&o&&(y.withCredentials=!0),(e&&s||c)&&(y.headers={},e&&s&&(y.headers.Authorization=`Bearer ${s}`),c&&Object.assign(y.headers,c));const f=`${d.href}::${JSON.stringify(y)}`,g=It.get(f);if(g)return g;const w=Wn(()=>(typeof EventSource>"u"||y.headers?yi:we(EventSource)).pipe(H(v=>new v(d.href,y))),["message","restart","welcome","reconnect","goaway"]),p=Za(d,{method:"OPTIONS",mode:"cors",credentials:y.withCredentials?"include":"omit",headers:y.headers}).pipe(We(()=>{throw new Ho({projectId:n})})),h=w.pipe(mi(),ge(v=>v.type==="reconnect"?p.pipe(ge(()=>we(v))):we(v)),We(v=>p.pipe(ge(()=>{throw v}))),H(v=>{if(v.type==="message"){const{data:b,..._}=v;return{..._,tags:b.tags}}return v})).pipe($n(()=>It.delete(f)),Ya({predicate:v=>v.type==="welcome"}));return It.set(f,h),h}}function Za(r,e){return new V(t=>{const n=new AbortController,i=n.signal;return fetch(r,{...e,signal:n.signal}).then(s=>{t.next(s),t.complete()},s=>{i.aborted||t.error(s)}),()=>n.abort()})}const It=new Map;class ec{#e;#t;constructor(e,t){this.#e=e,this.#t=t}create(e,t){return Ee(this.#e,this.#t,"PUT",e,t)}edit(e,t){return Ee(this.#e,this.#t,"PATCH",e,t)}delete(e){return Ee(this.#e,this.#t,"DELETE",e)}list(){ne("dataset",this.#e.config());const e=this.#e.config(),t=e.projectId;let n="/datasets";return e.useProjectHostname===!1&&(n=`/projects/${t}/datasets`),U(this.#e,this.#t,{uri:n,tag:null})}getEmbeddingsSettings(e){return ne("dataset",this.#e.config()),Ae(e),U(this.#e,this.#t,{uri:Qe(this.#e,e),tag:null})}editEmbeddingsSettings(e,t){return ne("dataset",this.#e.config()),Ae(e),U(this.#e,this.#t,{method:"PUT",uri:Qe(this.#e,e),body:t,tag:null})}}class tc{#e;#t;constructor(e,t){this.#e=e,this.#t=t}create(e,t){return ne("dataset",this.#e.config()),R(Ee(this.#e,this.#t,"PUT",e,t))}edit(e,t){return ne("dataset",this.#e.config()),R(Ee(this.#e,this.#t,"PATCH",e,t))}delete(e){return ne("dataset",this.#e.config()),R(Ee(this.#e,this.#t,"DELETE",e))}list(){ne("dataset",this.#e.config());const e=this.#e.config(),t=e.projectId;let n="/datasets";return e.useProjectHostname===!1&&(n=`/projects/${t}/datasets`),R(U(this.#e,this.#t,{uri:n,tag:null}))}getEmbeddingsSettings(e){return ne("dataset",this.#e.config()),Ae(e),R(U(this.#e,this.#t,{uri:Qe(this.#e,e),tag:null}))}editEmbeddingsSettings(e,t){return ne("dataset",this.#e.config()),Ae(e),R(U(this.#e,this.#t,{method:"PUT",uri:Qe(this.#e,e),body:t,tag:null}))}}function Qe(r,e){const t=r.config();return t.useProjectHostname===!1?`/projects/${t.projectId}/datasets/${e}/settings/embeddings`:`/datasets/${e}/settings/embeddings`}function Ee(r,e,t,n,i){return ne("dataset",r.config()),Ae(n),U(r,e,{method:t,uri:`/datasets/${n}`,body:i,tag:null})}class wi{#e;#t;constructor(e,t){this.#e=e,this.#t=t}getPlaybackInfo(e,t={}){const n=this.#e.config(),i=(n.resource||n["~experimental_resource"])?.id,{instanceId:s,library
118Id:o}=sc(e),a=o||i;if(!a)throw new Error("Could not determine Media Library ID - you need to provide a valid Media Library ID in the client config or a Media Library GDR");const c=oc(s,a),u=ac(t);return U(this.#e,this.#t,{method:"GET",uri:c,query:u})}}class rc{#e;#t;constructor(e,t){this.#e=e,this.#t=t}getPlaybackInfo(e,t={}){return R(new wi(this.#e.observable,this.#t).getPlaybackInfo(e,t))}}const nc=/^media-library:(ml[^:]+):([^:]+)$/;function ic(r){return typeof r=="object"&&"_ref"in r}function sc(r){const e=ic(r)?r._ref:r,t=nc.exec(e);if(t){const[,n,i]=t;return{libraryId:n,instanceId:i}}if(typeof r=="string"&&r.startsWith("video-"))return{instanceId:r};throw new Error(`Invalid video asset instance identifier "${e}": must be a valid video instance id or a Global Dataset Reference (GDR) to the video asset in the Media Library`)}function oc(r,e){return`/media-libraries/${e}/video/${r}/playback-info`}function ac(r){const e={};if(r.transformations){const{thumbnail:t,animated:n,storyboard:i}=r.transformations;t&&(t.width&&(e.thumbnailWidth=t.width),t.height&&(e.thumbnailHeight=t.height),t.time!==void 0&&(e.thumbnailTime=t.time),t.fit&&(e.thumbnailFit=t.fit),t.format&&(e.thumbnailFormat=t.format)),n&&(n.width&&(e.animatedWidth=n.width),n.height&&(e.animatedHeight=n.height),n.start!==void 0&&(e.animatedStart=n.start),n.end!==void 0&&(e.animatedEnd=n.end),n.fps&&(e.animatedFps=n.fps),n.format&&(e.animatedFormat=n.format)),i&&i.format&&(e.storyboardFormat=i.format)}return r.expiration&&(e.expiration=r.expiration),e}class cc{#e;#t;constructor(e,t){this.#e=e,this.#t=t}list(e){const t={},n="/projects";return e?.includeMembers===!1&&(t.includeMembers="false"),e?.organizationId&&(t.organizationId=e.organizationId),e?.onlyExplicitMembership===!0&&(t.onlyExplicitMembership="true"),U(this.#e,this.#t,{uri:n,query:t})}getById(e){return U(this.#e,this.#t,{uri:`/projects/${e}`})}}class uc{#e;#t;constructor(e,t){this.#e=e,this.#t=t}list(e){const t={},n="/projects";return e?.includeMembers===!1&&(t.includeMembers="false"),e?.organizationId&&(t.organizationId=e.organizationId),e?.onlyExplicitMembership===!0&&(t.onlyExplicitMembership="true"),R(U(this.#e,this.#t,{uri:n,query:t}))}getById(e){return R(U(this.#e,this.#t,{uri:`/projects/${e}`}))}}const kr=Lo("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789",8),Ye=(r,e)=>e?Me(r,e):Ln(r);function Xe(r,{releaseId:e,publishedId:t,document:n}){if(t&&n._id){const i=Ye(t,e);return Zo(i,n),i}if(n._id){const i=rt(n._id),s=nt(n._id);if(!i&&!s)throw new Error(`\`${r}()\` requires a document with an \`_id\` that is a version or draft ID`);if(e){if(i)throw new Error(`\`${r}()\` was called with a document ID (\`${n._id}\`) that is a draft ID, but a release ID (\`${e}\`) was also provided.`);const o=qn(n._id);if(o!==e)throw new Error(`\`${r}()\` was called with a document ID (\`${n._id}\`) that is a version ID, but the release ID (\`${e}\`) does not match the document's version ID (\`${o}\`).`)}return n._id}if(t)return Ye(t,e);throw new Error(`\`${r}()\` requires either a publishedId or a document with an \`_id\``)}const lc=(r,e)=>{if(typeof r=="object"&&r!==null&&("releaseId"in r||"metadata"in r)){const{releaseId:t=kr(),metadata:n={}}=r;return[t,n,e]}return[kr(),{},r]},Ei=(r,e)=>{const[t,n,i]=lc(r,e),s={...n,releaseType:n.releaseType||"undecided"};return{action:{actionType:"sanity.action.release.create",releaseId:t,metadata:s},options:i}};class fc{#e;#t;constructor(e,t){this.#e=e,this.#t=t}get({releaseId:e},t){return Ie(this.#e,this.#t,`_.releases.${e}`,t)}create(e,t){const{action:n,options:i}=Ei(e,t),{releaseId:s,metadata:o}=n;return F(this.#e,this.#t,n,i).pipe(H(a=>({...a,releaseId:s,metadata:o})))}edit({releaseId:e,patch:t},n){const i={actionType:"sanity.action.release.edit",releaseId:e,patch:t};return F(this.#e,this.#t,i,n)}publish({releaseId:e},t){const n={actionType:"sanity.action.release.publish",releaseId:e};return F(this.#e,this.#t,n,t)}archive({releaseId:e},t){const n={actionType:"sanity.action.release.archive",releaseId:e};return F(this.#e,this.#t,n,t)}unarchive({releaseId:e},t){const n={actionType:"sanity.action.release.unarchive",releaseId:e};return F(this.#e,this.#t,n,t)}schedule({releaseId:e,publishAt:t},n){const i={actionType:"sanity.action.release.schedule",releaseId:e,publishAt:t};return F(this.#e,this.#t,i,n)}unschedule({releaseId:e},t){const n={actionType:"sanity.action.release.unschedule",releaseId:e};return F(this.#e,this.#t,n,t)}delete({releaseId:e},t){const n={actionType:"sanity.action.release.delete",releaseId:e};return F(this.#e,this.#t,n,t)}fetchDocuments({releaseId:e},t){return ti(this.#e,this.#t,e,t)}}class hc{#e;#t;constructor(e,t){this.#e=e,this.#t=t}get({releaseId:e},t){return R(Ie(this.#e,this.#t,`_.releases.${e}`,t))}async create(e,t){const{action:n,options:i}=Ei(e,t),{releaseId:s,metadata:o}=n;return{...await R(F(this.#e,this.#t,n,i)),releaseId:s,metadata:o}}edit({releaseId:e,patch:t},n){const i={actionType:"sanity.action.release.edit",releaseId:e,patch:t};return R(F(this.#e,this.#t,i,n))}publish({releaseId:e},t){const n={actionType:"sanity.action.release.publish",releaseId:e};return R(F(this.#e,this.#t,n,t))}archive({releaseId:e},t){const n={actionType:"sanity.action.release.archive",releaseId:e};return R(F(this.#e,this.#t,n,t))}unarchive({releaseId:e},t){const n={actionType:"sanity.action.release.unarchive",releaseId:e};return R(F(this.#e,this.#t,n,t))}schedule({releaseId:e,publishAt:t},n){const i={actionType:"sanity.action.release.schedule",releaseId:e,publishAt:t};return R(F(this.#e,this.#t,i,n))}unschedule({releaseId:e},t){const n={actionType:"sanity.action.release.unschedule",releaseId:e};return R(F(this.#e,this.#t,n,t))}delete({releaseId:e},t){const n={actionType:"sanity.action.release.delete",releaseId:e};return R(F(this.#e,this.#t,n,t))}fetchDocuments({releaseId:e},t){return R(ti(this.#e,this.#t,e,t))}}class dc{#e;#t;constructor(e,t){this.#e=e,this.#t=t}getById(e){return U(this.#e,this.#t,{uri:`/users/${e}`})}}class gc{#e;#t;constructor(e,t){this.#e=e,this.#t=t}getById(e){return R(U(this.#e,this.#t,{uri:`/users/${e}`}))}}class Ze{assets;datasets;live;mediaLibrary;projects;users;agent;releases;#e;#t;listen=vi;constructor(e,t=xe){this.config(t),this.#t=e,this.assets=new Na(this,this.#t),this.datasets=new ec(this,this.#t),this.live=new bi(this),this.mediaLibrary={video:new wi(this,this.#t)},this.projects=new cc(this,this.#t),this.users=new dc(this,this.#t),this.agent={action:new Ua(this,this.#t)},this.releases=new fc(this,this.#t)}clone(){return new Ze(this.#t,this.config())}config(e){if(e===void 0)return{...this.#e};if(this.#e&&this.#e.allowReconfigure===!1)throw new Error("Existing client instance cannot be reconfigured - use `withConfig(newConfig)` to return a new client");return this.#e=Hn(e,this.#e||{}),this}withConfig(e){const t=this.config();return new Ze(this.#t,{...t,...e,stega:{...t.stega||{},...typeof e?.stega=="boolean"?{enabled:e.stega}:e?.stega||{}}})}
118fetch(e,t,n){return Zn(this,this.#t,this.#e.stega,e,t,n)}getDocument(e,t){if(t?.includeAllVersions===!0)return Ie(this,this.#t,e,{...t,includeAllVersions:!0});const n={signal:t?.signal,tag:t?.tag,releaseId:t?.releaseId,...t&&"includeAllVersions"in t?{includeAllVersions:!1}:{}};return Ie(this,this.#t,e,n)}getDocuments(e,t){return ei(this,this.#t,e,t)}create(e,t){return at(this,this.#t,e,"create",t)}createIfNotExists(e,t){return ri(this,this.#t,e,t)}createOrReplace(e,t){return ni(this,this.#t,e,t)}createVersion({document:e,publishedId:t,releaseId:n,baseId:i,ifBaseRevisionId:s},o){if(!e)return si(this,this.#t,t,i,n,s,o);const a=Xe("createVersion",{document:e,publishedId:t,releaseId:n}),c={...e,_id:a},u=t||it(e._id);return ii(this,this.#t,c,u,o)}delete(e,t){return oi(this,this.#t,e,t)}discardVersion({releaseId:e,publishedId:t},n,i){const s=Ye(t,e);return ai(this,this.#t,s,n,i)}replaceVersion({document:e,publishedId:t,releaseId:n},i){const s=Xe("replaceVersion",{document:e,publishedId:t,releaseId:n}),o={...e,_id:s};return ci(this,this.#t,o,i)}unpublishVersion({releaseId:e,publishedId:t},n){const i=Me(t,e);return ui(this,this.#t,i,t,n)}mutate(e,t){return li(this,this.#t,e,t)}patch(e,t){return new pe(e,t,this)}transaction(e){return new ot(e,this)}action(e,t){return F(this,this.#t,e,t)}request(e){return U(this,this.#t,e)}getUrl(e,t){return Bt(this,e,t)}getDataUrl(e,t){return J(this,e,t)}}class et{assets;datasets;live;mediaLibrary;projects;users;agent;releases;observable;#e;#t;listen=vi;constructor(e,t=xe){this.config(t),this.#t=e,this.assets=new za(this,this.#t),this.datasets=new tc(this,this.#t),this.live=new bi(this),this.mediaLibrary={video:new rc(this,this.#t)},this.projects=new uc(this,this.#t),this.users=new gc(this,this.#t),this.agent={action:new ka(this,this.#t)},this.releases=new hc(this,this.#t),this.observable=new Ze(e,t)}clone(){return new et(this.#t,this.config())}config(e){if(e===void 0)return{...this.#e};if(this.#e&&this.#e.allowReconfigure===!1)throw new Error("Existing client instance cannot be reconfigured - use `withConfig(newConfig)` to return a new client");return this.observable&&this.observable.config(e),this.#e=Hn(e,this.#e||{}),this}withConfig(e){const t=this.config();return new et(this.#t,{...t,...e,stega:{...t.stega||{},...typeof e?.stega=="boolean"?{enabled:e.stega}:e?.stega||{}}})}fetch(e,t,n){return R(Zn(this,this.#t,this.#e.stega,e,t,n))}getDocument(e,t){if(t?.includeAllVersions===!0)return R(Ie(this,this.#t,e,{...t,includeAllVersions:!0}));const n={signal:t?.signal,tag:t?.tag,releaseId:t?.releaseId,...t&&"includeAllVersions"in t?{includeAllVersions:!1}:{}};return R(Ie(this,this.#t,e,n))}getDocuments(e,t){return R(ei(this,this.#t,e,t))}create(e,t){return R(at(this,this.#t,e,"create",t))}createIfNotExists(e,t){return R(ri(this,this.#t,e,t))}createOrReplace(e,t){return R(ni(this,this.#t,e,t))}createVersion({document:e,publishedId:t,releaseId:n,baseId:i,ifBaseRevisionId:s},o){if(!e)return St(si(this,this.#t,t,i,n,s,o));const a=Xe("createVersion",{document:e,publishedId:t,releaseId:n}),c={...e,_id:a},u=t||it(e._id);return St(ii(this,this.#t,c,u,o))}delete(e,t){return R(oi(this,this.#t,e,t))}discardVersion({releaseId:e,publishedId:t},n,i){const s=Ye(t,e);return R(ai(this,this.#t,s,n,i))}replaceVersion({document:e,publishedId:t,releaseId:n},i){const s=Xe("replaceVersion",{document:e,publishedId:t,releaseId:n}),o={...e,_id:s};return St(ci(this,this.#t,o,i))}unpublishVersion({releaseId:e,publishedId:t},n){const i=Me(t,e);return R(ui(this,this.#t,i,t,n))}mutate(e,t){return R(li(this,this.#t,e,t))}patch(e,t){return new fe(e,t,this)}transaction(e){return new st(e,this)}action(e,t){return R(F(this,this.#t,e,t))}request(e){return R(U(this,this.#t,e))}dataRequest(e,t,n){return R(me(this,this.#t,e,t,n))}getUrl(e,t){return Bt(this,e,t)}getDataUrl(e,t){return J(this,e,t)}}function pc(r,e){return{requester:jr(r),createClient:t=>{const n=jr(r,{ignoreWarnings:t.ignoreWarnings});return new e((i,s)=>(s||n)({maxRedirects:0,maxRetries:t.maxRetries,retryDelay:t.retryDelay,lineage:t.lineage,...i}),t)}}}var yc=[];const mc=pc(yc,et),Nr=mc.createClient,vc=r=>{const e=Wr(),t={...r};let n=Nr(t),i=gr(e.visualEditing);const s=Hi(e.liveContent);return{client:n,config:t,fetch:(...o)=>n.fetch(...o),liveStore:s,queryStore:i,setToken(o){t.token=o,n=Nr(t),i&&e.visualEditing&&(i=gr(e.visualEditing))}}};function Sc(r,e){const t="default",n=zr();if(n._sanity?.[t])return n._sanity[t];n._sanity=n._sanity||{};const i=Wr(),{additionalClients:s={},liveContent:o,visualEditing:a,...c}=i;return!c.disableSmartCdn&&n.$preview?c.useCdn=!1:!c.useCdn&&!c.token&&(c.useCdn=!0),n._sanity.default=vc(c),n._sanity.default}export{Gs as E,V as O,oe as _,wc as a,ge as b,se as c,q as d,he as e,_e as f,Ke as g,H as h,hn as i,Re as j,Rn as k,Zr as l,yo as m,Tr as n,ie as o,Ls as p,Ec as q,Dn as r,Sc as u,Bn as v};
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.