Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@sanity/preview-kit

Package Overview
Dependencies
Maintainers
51
Versions
242
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@sanity/preview-kit - npm Package Compare versions

Comparing version 5.0.53 to 5.0.54

2

dist/_chunks-es/LiveQueryProvider.js

@@ -1,1 +0,1 @@

var t=Object.defineProperty,e=(e,i,s)=>(((e,i,s)=>{i in e?t(e,i,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[i]=s})(e,"symbol"!=typeof i?i+"":i,s),s),i=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},s=(t,e,s)=>(i(t,e,"read from private field"),s?s.call(t):e.get(t)),n=(t,e,i)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,i)},o=(t,e,s,n)=>(i(t,e,"write to private field"),n?n.call(t,s):e.set(t,s),s),h=(t,e,i,n)=>({set _(s){o(t,e,s,i)},get _(){return s(t,e,n)}}),l=(t,e,s)=>(i(t,e,"access private method"),s);import{jsxs as r,jsx as a,Fragment as c}from"react/jsx-runtime";import{applySourceDocuments as u}from"@sanity/client/csm";import{useRevalidate as d,useDocumentsInUse as f}from"@sanity/preview-kit-compat";import{applyPatch as p}from"mendoza";import{memo as g,useState as v,useEffect as w,useCallback as S,startTransition as m,useMemo as b}from"react";import{d as y}from"./context.js";var _={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},O={0:8203,1:8204,2:8205,3:65279};new Array(4).fill(String.fromCodePoint(O[0])).join(""),Object.fromEntries(Object.entries(O).map((t=>t.reverse()))),Object.fromEntries(Object.entries(_).map((t=>t.reverse())));var W=`${Object.values(_).map((t=>`\\u{${t.toString(16)}}`)).join("")}`,A=new RegExp(`[${W}]{4,}`,"gu");function F(t){var e;return{cleaned:t.replace(A,""),encoded:(null==(e=t.match(A))?void 0:e[0])||""}}const k="object"==typeof performance&&performance&&"function"==typeof performance.now?performance:Date,E=new Set,M="object"==typeof process&&process?process:{},T=(t,e,i,s)=>{"function"==typeof M.emitWarning?M.emitWarning(t,e,i,s):console.error(`[${i}] ${e}: ${t}`)};let z=globalThis.AbortController,C=globalThis.AbortSignal;var x;if(typeof z>"u"){C=class{constructor(){e(this,"onabort"),e(this,"_onabort",[]),e(this,"reason"),e(this,"aborted",!1)}addEventListener(t,e){this._onabort.push(e)}},z=class{constructor(){e(this,"signal",new C),i()}abort(t){var e,i;if(!this.signal.aborted){this.signal.reason=t,this.signal.aborted=!0;for(const e of this.signal._onabort)e(t);null==(i=(e=this.signal).onabort)||i.call(e,t)}}};let t="1"!==(null==(x=M.env)?void 0:x.LRU_CACHE_IGNORE_AC_WARNING);const i=()=>{t&&(t=!1,T("AbortController is not defined. If using lru-cache in node 14, load an AbortController polyfill from the `node-abort-controller` package. A minimal polyfill is provided for use by LRUCache.fetch(), but it should not be relied upon in other contexts (eg, passing it to other APIs that use AbortController/AbortSignal might have undesirable effects). You may disable this with LRU_CACHE_IGNORE_AC_WARNING=1 in the env.","NO_ABORT_CONTROLLER","ENOTSUP",i))}}const R=t=>t&&t===Math.floor(t)&&t>0&&isFinite(t),j=t=>R(t)?t<=Math.pow(2,8)?Uint8Array:t<=Math.pow(2,16)?Uint16Array:t<=Math.pow(2,32)?Uint32Array:t<=Number.MAX_SAFE_INTEGER?D:null:null;class D extends Array{constructor(t){super(t),this.fill(0)}}var I;const L=class t{constructor(i,n){if(e(this,"heap"),e(this,"length"),!s(t,I))throw new TypeError("instantiate Stack using Stack.create(n)");this.heap=new n(i),this.length=0}static create(e){const i=j(e);if(!i)return[];o(t,I,!0);const s=new t(e,i);return o(t,I,!1),s}push(t){this.heap[this.length++]=t}pop(){return this.heap[--this.length]}};I=new WeakMap,n(L,I,!1);let G=L;var U,N,$,P,q,H,J,B,K,V,Q,X,Y,Z,tt,et,it,st,nt,ot,ht,lt,rt,at,ct,ut,dt,ft,pt,gt,vt,wt,St,mt,bt,yt,_t,Ot,Wt,At,Ft,kt,Et,Mt,Tt,zt,Ct,xt,Rt,jt;const Dt=class t{constructor(i){n(this,rt),n(this,pt),n(this,mt),n(this,yt),n(this,Ot),n(this,Ft),n(this,Et),n(this,Tt),n(this,Ct),n(this,Rt),n(this,U,void 0),n(this,N,void 0),n(this,$,void 0),n(this,P,void 0),n(this,q,void 0),e(this,"ttl"),e(this,"ttlResolution"),e(this,"ttlAutopurge"),e(this,"updateAgeOnGet"),e(this,"updateAgeOnHas"),e(this,"allowStale"),e(this,"noDisposeOnSet"),e(this,"noUpdateTTL"),e(this,"maxEntrySize"),e(this,"sizeCalculation"),e(this,"noDeleteOnFetchRejection"),e(this,"noDeleteOnStaleGet"),e(this,"allowStaleOnFetchAbort"),e(this,"allowStaleOnFetchRejection"),e(this,"ignoreFetchAbort"),n(this,H,void 0),n(this,J,void 0),n(this,B,void 0),n(this,K,void 0),n(this,V,void 0),n(this,Q,void 0),n(this,X,void 0),n(this,Y,void 0),n(this,Z,void 0),n(this,tt,void 0),n(this,et,void 0),n(this,it,void 0),n(this,st,void 0),n(this,nt,void 0),n(this,ot,void 0),n(this,ht,void 0),n(this,lt,void 0),n(this,ct,(()=>{})),n(this,ut,(()=>{})),n(this,dt,(()=>{})),n(this,ft,(()=>!1)),n(this,vt,(t=>{})),n(this,wt,((t,e,i)=>{})),n(this,St,((t,e,i,s)=>{if(i||s)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0})),e(this,At,"LRUCache");const{max:h=0,ttl:r,ttlResolution:a=1,ttlAutopurge:c,updateAgeOnGet:u,updateAgeOnHas:d,allowStale:f,dispose:p,disposeAfter:g,noDisposeOnSet:v,noUpdateTTL:w,maxSize:S=0,maxEntrySize:m=0,sizeCalculation:b,fetchMethod:y,noDeleteOnFetchRejection:_,noDeleteOnStaleGet:O,allowStaleOnFetchRejection:W,allowStaleOnFetchAbort:A,ignoreFetchAbort:F}=i;if(0!==h&&!R(h))throw new TypeError("max option must be a nonnegative integer");const k=h?j(h):Array;if(!k)throw new Error("invalid max value: "+h);if(o(this,U,h),o(this,N,S),this.maxEntrySize=m||s(this,N),this.sizeCalculation=b,this.sizeCalculation){if(!s(this,N)&&!this.maxEntrySize)throw new TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize");if("function"!=typeof this.sizeCalculation)throw new TypeError("sizeCalculation set to non-function")}if(void 0!==y&&"function"!=typeof y)throw new TypeError("fetchMethod must be a function if specified");if(o(this,q,y),o(this,ht,!!y),o(this,B,new Map),o(this,K,new Array(h).fill(void 0)),o(this,V,new Array(h).fill(void 0)),o(this,Q,new k(h)),o(this,X,new k(h)),o(this,Y,0),o(this,Z,0),o(this,tt,G.create(h)),o(this,H,0),o(this,J,0),"function"==typeof p&&o(this,$,p),"function"==typeof g?(o(this,P,g),o(this,et,[])):(o(this,P,void 0),o(this,et,void 0)),o(this,ot,!!s(this,$)),o(this,lt,!!s(this,P)),this.noDisposeOnSet=!!v,this.noUpdateTTL=!!w,this.noDeleteOnFetchRejection=!!_,this.allowStaleOnFetchRejection=!!W,this.allowStaleOnFetchAbort=!!A,this.ignoreFetchAbort=!!F,0!==this.maxEntrySize){if(0!==s(this,N)&&!R(s(this,N)))throw new TypeError("maxSize must be a positive integer if specified");if(!R(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");l(this,pt,gt).call(this)}if(this.allowStale=!!f,this.noDeleteOnStaleGet=!!O,this.updateAgeOnGet=!!u,this.updateAgeOnHas=!!d,this.ttlResolution=R(a)||0===a?a:1,this.ttlAutopurge=!!c,this.ttl=r||0,this.ttl){if(!R(this.ttl))throw new TypeError("ttl must be a positive integer if specified");l(this,rt,at).call(this)}if(0===s(this,U)&&0===this.ttl&&0===s(this,N))throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!s(this,U)&&!s(this,N)){const e="LRU_CACHE_UNBOUNDED";(t=>!E.has(t))(e)&&(E.add(e),T("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",e,t))}}static unsafeExposeInternals(t){return{starts:s(t,st),ttls:s(t,nt),sizes:s(t,it),keyMap:s(t,B),keyList:s(t,K),valList:s(t,V),next:s(t,Q),prev:s(t,X),get head(){return s(t,Y)},get tail(){return s(t,Z)},free:s(t,tt),isBackgroundFetch:e=>{var i;return l(i=t,Tt,zt).call(i,e)},backgroundFetch:(e,i,s,n)=>{var o;return l(o=t,Et,Mt).call(o,e,i,s,n)},moveToTail:e=>{var i;return l(i=t,Rt,jt).call(i,e)},indexes:e=>{var i;return l(i=t,mt,bt).call(i,e)},rindexes:e=>{var i;return l(i=t,yt,_t).call(i,e)},isStale:e=>{var i;return s(i=t,ft).call(i,e)}}}get max(){return s(this,U)}get maxSize(){return s(this,N)}get calculatedSize(){return s(this,J)}get size(){return s(this,H)}get fetchMethod(){return s(this,q)}get dispose(){return s(this,$)}get disposeAfter(){return s(this,P)}getRemainingTTL(t){return s(this,B).has(t)?1/0:0}*entries(){for(const t of l(this,mt,bt).call(this))void 0!==s(this,V)[t]&&void 0!==s(this,K)[t]&&!l(this,Tt,zt).call(this,s(this,V)[t])&&(yield[s(this,K)[t],s(this,V)[t]])}*rentries(){for(const t of l(this,yt,_t).call(this))void 0!==s(this,V)[t]&&void 0!==s(this,K)[t]&&!l(this,Tt,zt).call(this,s(this,V)[t])&&(yield[s(this,K)[t],s(this,V)[t]])}*keys(){for(const t of l(this,mt,bt).call(this)){const e=s(this,K)[t];void 0!==e&&!l(this,Tt,zt).call(this,s(this,V)[t])&&(yield e)}}*rkeys(){for(const t of l(this,yt,_t).call(this)){const e=s(this,K)[t];void 0!==e&&!l(this,Tt,zt).call(this,s(this,V)[t])&&(yield e)}}*values(){for(const t of l(this,mt,bt).call(this))void 0!==s(this,V)[t]&&!l(this,Tt,zt).call(this,s(this,V)[t])&&(yield s(this,V)[t])}*rvalues(){for(const t of l(this,yt,_t).call(this))void 0!==s(this,V)[t]&&!l(this,Tt,zt).call(this,s(this,V)[t])&&(yield s(this,V)[t])}[Symbol.iterator](){return this.entries()}find(t,e={}){for(const i of l(this,mt,bt).call(this)){const n=s(this,V)[i],o=l(this,Tt,zt).call(this,n)?n.__staleWhileFetching:n;if(void 0!==o&&t(o,s(this,K)[i],this))return this.get(s(this,K)[i],e)}}forEach(t,e=this){for(const i of l(this,mt,bt).call(this)){const n=s(this,V)[i],o=l(this,Tt,zt).call(this,n)?n.__staleWhileFetching:n;void 0!==o&&t.call(e,o,s(this,K)[i],this)}}rforEach(t,e=this){for(const i of l(this,yt,_t).call(this)){const n=s(this,V)[i],o=l(this,Tt,zt).call(this,n)?n.__staleWhileFetching:n;void 0!==o&&t.call(e,o,s(this,K)[i],this)}}purgeStale(){let t=!1;for(const e of l(this,yt,_t).call(this,{allowStale:!0}))s(this,ft).call(this,e)&&(this.delete(s(this,K)[e]),t=!0);return t}info(t){const e=s(this,B).get(t);if(void 0===e)return;const i=s(this,V)[e],n=l(this,Tt,zt).call(this,i)?i.__staleWhileFetching:i;if(void 0===n)return;const o={value:n};if(s(this,nt)&&s(this,st)){const t=s(this,nt)[e],i=s(this,st)[e];if(t&&i){const e=t-(k.now()-i);o.ttl=e,o.start=Date.now()}}return s(this,it)&&(o.size=s(this,it)[e]),o}dump(){const t=[];for(const e of l(this,mt,bt).call(this,{allowStale:!0})){const i=s(this,K)[e],n=s(this,V)[e],o=l(this,Tt,zt).call(this,n)?n.__staleWhileFetching:n;if(void 0===o||void 0===i)continue;const h={value:o};if(s(this,nt)&&s(this,st)){h.ttl=s(this,nt)[e];const t=k.now()-s(this,st)[e];h.start=Math.floor(Date.now()-t)}s(this,it)&&(h.size=s(this,it)[e]),t.unshift([i,h])}return t}load(t){this.clear();for(const[e,i]of t){if(i.start){const t=Date.now()-i.start;i.start=k.now()-t}this.set(e,i.value,i)}}set(t,e,i={}){var n,r,a,c,u;if(void 0===e)return this.delete(t),this;const{ttl:d=this.ttl,start:f,noDisposeOnSet:p=this.noDisposeOnSet,sizeCalculation:g=this.sizeCalculation,status:v}=i;let{noUpdateTTL:w=this.noUpdateTTL}=i;const S=s(this,St).call(this,t,e,i.size||0,g);if(this.maxEntrySize&&S>this.maxEntrySize)return v&&(v.set="miss",v.maxEntrySizeExceeded=!0),this.delete(t),this;let m=0===s(this,H)?void 0:s(this,B).get(t);if(void 0===m)m=0===s(this,H)?s(this,Z):0!==s(this,tt).length?s(this,tt).pop():s(this,H)===s(this,U)?l(this,Ft,kt).call(this,!1):s(this,H),s(this,K)[m]=t,s(this,V)[m]=e,s(this,B).set(t,m),s(this,Q)[s(this,Z)]=m,s(this,X)[m]=s(this,Z),o(this,Z,m),h(this,H)._++,s(this,wt).call(this,m,S,v),v&&(v.set="add"),w=!1;else{l(this,Rt,jt).call(this,m);const i=s(this,V)[m];if(e!==i){if(s(this,ht)&&l(this,Tt,zt).call(this,i)){i.__abortController.abort(new Error("replaced"));const{__staleWhileFetching:e}=i;void 0!==e&&!p&&(s(this,ot)&&(null==(n=s(this,$))||n.call(this,e,t,"set")),s(this,lt)&&(null==(r=s(this,et))||r.push([e,t,"set"])))}else p||(s(this,ot)&&(null==(a=s(this,$))||a.call(this,i,t,"set")),s(this,lt)&&(null==(c=s(this,et))||c.push([i,t,"set"])));if(s(this,vt).call(this,m),s(this,wt).call(this,m,S,v),s(this,V)[m]=e,v){v.set="replace";const t=i&&l(this,Tt,zt).call(this,i)?i.__staleWhileFetching:i;void 0!==t&&(v.oldValue=t)}}else v&&(v.set="update")}if(0!==d&&!s(this,nt)&&l(this,rt,at).call(this),s(this,nt)&&(w||s(this,dt).call(this,m,d,f),v&&s(this,ut).call(this,v,m)),!p&&s(this,lt)&&s(this,et)){const t=s(this,et);let e;for(;e=null==t?void 0:t.shift();)null==(u=s(this,P))||u.call(this,...e)}return this}pop(){var t;try{for(;s(this,H);){const t=s(this,V)[s(this,Y)];if(l(this,Ft,kt).call(this,!0),l(this,Tt,zt).call(this,t)){if(t.__staleWhileFetching)return t.__staleWhileFetching}else if(void 0!==t)return t}}finally{if(s(this,lt)&&s(this,et)){const e=s(this,et);let i;for(;i=null==e?void 0:e.shift();)null==(t=s(this,P))||t.call(this,...i)}}}has(t,e={}){const{updateAgeOnHas:i=this.updateAgeOnHas,status:n}=e,o=s(this,B).get(t);if(void 0!==o){const t=s(this,V)[o];if(l(this,Tt,zt).call(this,t)&&void 0===t.__staleWhileFetching)return!1;if(!s(this,ft).call(this,o))return i&&s(this,ct).call(this,o),n&&(n.has="hit",s(this,ut).call(this,n,o)),!0;n&&(n.has="stale",s(this,ut).call(this,n,o))}else n&&(n.has="miss");return!1}peek(t,e={}){const{allowStale:i=this.allowStale}=e,n=s(this,B).get(t);if(void 0===n||!i&&s(this,ft).call(this,n))return;const o=s(this,V)[n];return l(this,Tt,zt).call(this,o)?o.__staleWhileFetching:o}async fetch(t,e={}){const{allowStale:i=this.allowStale,updateAgeOnGet:n=this.updateAgeOnGet,noDeleteOnStaleGet:o=this.noDeleteOnStaleGet,ttl:h=this.ttl,noDisposeOnSet:r=this.noDisposeOnSet,size:a=0,sizeCalculation:c=this.sizeCalculation,noUpdateTTL:u=this.noUpdateTTL,noDeleteOnFetchRejection:d=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:f=this.allowStaleOnFetchRejection,ignoreFetchAbort:p=this.ignoreFetchAbort,allowStaleOnFetchAbort:g=this.allowStaleOnFetchAbort,context:v,forceRefresh:w=!1,status:S,signal:m}=e;if(!s(this,ht))return S&&(S.fetch="get"),this.get(t,{allowStale:i,updateAgeOnGet:n,noDeleteOnStaleGet:o,status:S});const b={allowStale:i,updateAgeOnGet:n,noDeleteOnStaleGet:o,ttl:h,noDisposeOnSet:r,size:a,sizeCalculation:c,noUpdateTTL:u,noDeleteOnFetchRejection:d,allowStaleOnFetchRejection:f,allowStaleOnFetchAbort:g,ignoreFetchAbort:p,status:S,signal:m};let y=s(this,B).get(t);if(void 0===y){S&&(S.fetch="miss");const e=l(this,Et,Mt).call(this,t,y,b,v);return e.__returned=e}{const e=s(this,V)[y];if(l(this,Tt,zt).call(this,e)){const t=i&&void 0!==e.__staleWhileFetching;return S&&(S.fetch="inflight",t&&(S.returnedStale=!0)),t?e.__staleWhileFetching:e.__returned=e}const o=s(this,ft).call(this,y);if(!w&&!o)return S&&(S.fetch="hit"),l(this,Rt,jt).call(this,y),n&&s(this,ct).call(this,y),S&&s(this,ut).call(this,S,y),e;const h=l(this,Et,Mt).call(this,t,y,b,v),r=void 0!==h.__staleWhileFetching&&i;return S&&(S.fetch=o?"stale":"refresh",r&&o&&(S.returnedStale=!0)),r?h.__staleWhileFetching:h.__returned=h}}get(t,e={}){const{allowStale:i=this.allowStale,updateAgeOnGet:n=this.updateAgeOnGet,noDeleteOnStaleGet:o=this.noDeleteOnStaleGet,status:h}=e,r=s(this,B).get(t);if(void 0!==r){const e=s(this,V)[r],a=l(this,Tt,zt).call(this,e);return h&&s(this,ut).call(this,h,r),s(this,ft).call(this,r)?(h&&(h.get="stale"),a?(h&&i&&void 0!==e.__staleWhileFetching&&(h.returnedStale=!0),i?e.__staleWhileFetching:void 0):(o||this.delete(t),h&&i&&(h.returnedStale=!0),i?e:void 0)):(h&&(h.get="hit"),a?e.__staleWhileFetching:(l(this,Rt,jt).call(this,r),n&&s(this,ct).call(this,r),e))}h&&(h.get="miss")}delete(t){var e,i,n,r;let a=!1;if(0!==s(this,H)){const n=s(this,B).get(t);if(void 0!==n)if(a=!0,1===s(this,H))this.clear();else{s(this,vt).call(this,n);const r=s(this,V)[n];if(l(this,Tt,zt).call(this,r)?r.__abortController.abort(new Error("deleted")):(s(this,ot)||s(this,lt))&&(s(this,ot)&&(null==(e=s(this,$))||e.call(this,r,t,"delete")),s(this,lt)&&(null==(i=s(this,et))||i.push([r,t,"delete"]))),s(this,B).delete(t),s(this,K)[n]=void 0,s(this,V)[n]=void 0,n===s(this,Z))o(this,Z,s(this,X)[n]);else if(n===s(this,Y))o(this,Y,s(this,Q)[n]);else{const t=s(this,X)[n];s(this,Q)[t]=s(this,Q)[n];const e=s(this,Q)[n];s(this,X)[e]=s(this,X)[n]}h(this,H)._--,s(this,tt).push(n)}}if(s(this,lt)&&null!=(n=s(this,et))&&n.length){const t=s(this,et);let e;for(;e=null==t?void 0:t.shift();)null==(r=s(this,P))||r.call(this,...e)}return a}clear(){var t,e,i;for(const i of l(this,yt,_t).call(this,{allowStale:!0})){const n=s(this,V)[i];if(l(this,Tt,zt).call(this,n))n.__abortController.abort(new Error("deleted"));else{const o=s(this,K)[i];s(this,ot)&&(null==(t=s(this,$))||t.call(this,n,o,"delete")),s(this,lt)&&(null==(e=s(this,et))||e.push([n,o,"delete"]))}}if(s(this,B).clear(),s(this,V).fill(void 0),s(this,K).fill(void 0),s(this,nt)&&s(this,st)&&(s(this,nt).fill(0),s(this,st).fill(0)),s(this,it)&&s(this,it).fill(0),o(this,Y,0),o(this,Z,0),s(this,tt).length=0,o(this,J,0),o(this,H,0),s(this,lt)&&s(this,et)){const t=s(this,et);let e;for(;e=null==t?void 0:t.shift();)null==(i=s(this,P))||i.call(this,...e)}}};At=Symbol.toStringTag,U=new WeakMap,N=new WeakMap,$=new WeakMap,P=new WeakMap,q=new WeakMap,H=new WeakMap,J=new WeakMap,B=new WeakMap,K=new WeakMap,V=new WeakMap,Q=new WeakMap,X=new WeakMap,Y=new WeakMap,Z=new WeakMap,tt=new WeakMap,et=new WeakMap,it=new WeakMap,st=new WeakMap,nt=new WeakMap,ot=new WeakMap,ht=new WeakMap,lt=new WeakMap,rt=new WeakSet,at=function(){const t=new D(s(this,U)),e=new D(s(this,U));o(this,nt,t),o(this,st,e),o(this,dt,((i,n,o=k.now())=>{if(e[i]=0!==n?o:0,t[i]=n,0!==n&&this.ttlAutopurge){const t=setTimeout((()=>{s(this,ft).call(this,i)&&this.delete(s(this,K)[i])}),n+1);t.unref&&t.unref()}})),o(this,ct,(i=>{e[i]=0!==t[i]?k.now():0})),o(this,ut,((s,o)=>{if(t[o]){const h=t[o],l=e[o];if(!h||!l)return;s.ttl=h,s.start=l,s.now=i||n();const r=s.now-l;s.remainingTTL=h-r}}));let i=0;const n=()=>{const t=k.now();if(this.ttlResolution>0){i=t;const e=setTimeout((()=>i=0),this.ttlResolution);e.unref&&e.unref()}return t};this.getRemainingTTL=o=>{const h=s(this,B).get(o);if(void 0===h)return 0;const l=t[h],r=e[h];if(!l||!r)return 1/0;return l-((i||n())-r)},o(this,ft,(s=>{const o=e[s],h=t[s];return!!h&&!!o&&(i||n())-o>h}))},ct=new WeakMap,ut=new WeakMap,dt=new WeakMap,ft=new WeakMap,pt=new WeakSet,gt=function(){const t=new D(s(this,U));o(this,J,0),o(this,it,t),o(this,vt,(e=>{o(this,J,s(this,J)-t[e]),t[e]=0})),o(this,St,((t,e,i,s)=>{if(l(this,Tt,zt).call(this,e))return 0;if(!R(i)){if(!s)throw new TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.");if("function"!=typeof s)throw new TypeError("sizeCalculation must be a function");if(i=s(e,t),!R(i))throw new TypeError("sizeCalculation return invalid (expect positive integer)")}return i})),o(this,wt,((e,i,n)=>{if(t[e]=i,s(this,N)){const i=s(this,N)-t[e];for(;s(this,J)>i;)l(this,Ft,kt).call(this,!0)}o(this,J,s(this,J)+t[e]),n&&(n.entrySize=i,n.totalCalculatedSize=s(this,J))}))},vt=new WeakMap,wt=new WeakMap,St=new WeakMap,mt=new WeakSet,bt=function*({allowStale:t=this.allowStale}={}){if(s(this,H))for(let e=s(this,Z);l(this,Ot,Wt).call(this,e)&&((t||!s(this,ft).call(this,e))&&(yield e),e!==s(this,Y));)e=s(this,X)[e]},yt=new WeakSet,_t=function*({allowStale:t=this.allowStale}={}){if(s(this,H))for(let e=s(this,Y);l(this,Ot,Wt).call(this,e)&&((t||!s(this,ft).call(this,e))&&(yield e),e!==s(this,Z));)e=s(this,Q)[e]},Ot=new WeakSet,Wt=function(t){return void 0!==t&&s(this,B).get(s(this,K)[t])===t},Ft=new WeakSet,kt=function(t){var e,i;const n=s(this,Y),r=s(this,K)[n],a=s(this,V)[n];return s(this,ht)&&l(this,Tt,zt).call(this,a)?a.__abortController.abort(new Error("evicted")):(s(this,ot)||s(this,lt))&&(s(this,ot)&&(null==(e=s(this,$))||e.call(this,a,r,"evict")),s(this,lt)&&(null==(i=s(this,et))||i.push([a,r,"evict"]))),s(this,vt).call(this,n),t&&(s(this,K)[n]=void 0,s(this,V)[n]=void 0,s(this,tt).push(n)),1===s(this,H)?(o(this,Y,o(this,Z,0)),s(this,tt).length=0):o(this,Y,s(this,Q)[n]),s(this,B).delete(r),h(this,H)._--,n},Et=new WeakSet,Mt=function(t,e,i,n){const o=void 0===e?void 0:s(this,V)[e];if(l(this,Tt,zt).call(this,o))return o;const h=new z,{signal:r}=i;null==r||r.addEventListener("abort",(()=>h.abort(r.reason)),{signal:h.signal});const a={signal:h.signal,options:i,context:n},c=(n,o=!1)=>{const{aborted:l}=h.signal,r=i.ignoreFetchAbort&&void 0!==n;if(i.status&&(l&&!o?(i.status.fetchAborted=!0,i.status.fetchError=h.signal.reason,r&&(i.status.fetchAbortIgnored=!0)):i.status.fetchResolved=!0),l&&!r&&!o)return u(h.signal.reason);const c=d;return s(this,V)[e]===d&&(void 0===n?c.__staleWhileFetching?s(this,V)[e]=c.__staleWhileFetching:this.delete(t):(i.status&&(i.status.fetchUpdated=!0),this.set(t,n,a.options))),n},u=n=>{const{aborted:o}=h.signal,l=o&&i.allowStaleOnFetchAbort,r=l||i.allowStaleOnFetchRejection,a=r||i.noDeleteOnFetchRejection,c=d;if(s(this,V)[e]===d&&(a&&void 0!==c.__staleWhileFetching?l||(s(this,V)[e]=c.__staleWhileFetching):this.delete(t)),r)return i.status&&void 0!==c.__staleWhileFetching&&(i.status.returnedStale=!0),c.__staleWhileFetching;if(c.__returned===c)throw n};i.status&&(i.status.fetchDispatched=!0);const d=new Promise(((e,n)=>{var l;const r=null==(l=s(this,q))?void 0:l.call(this,t,o,a);r&&r instanceof Promise&&r.then((t=>e(void 0===t?void 0:t)),n),h.signal.addEventListener("abort",(()=>{(!i.ignoreFetchAbort||i.allowStaleOnFetchAbort)&&(e(void 0),i.allowStaleOnFetchAbort&&(e=t=>c(t,!0)))}))})).then(c,(t=>(i.status&&(i.status.fetchRejected=!0,i.status.fetchError=t),u(t)))),f=Object.assign(d,{__abortController:h,__staleWhileFetching:o,__returned:void 0});return void 0===e?(this.set(t,f,{...a.options,status:void 0}),e=s(this,B).get(t)):s(this,V)[e]=f,f},Tt=new WeakSet,zt=function(t){if(!s(this,ht))return!1;const e=t;return!!e&&e instanceof Promise&&e.hasOwnProperty("__staleWhileFetching")&&e.__abortController instanceof z},Ct=new WeakSet,xt=function(t,e){s(this,X)[e]=t,s(this,Q)[t]=e},Rt=new WeakSet,jt=function(t){t!==s(this,Z)&&(t===s(this,Y)?o(this,Y,s(this,Q)[t]):l(this,Ct,xt).call(this,s(this,X)[t],s(this,Q)[t]),l(this,Ct,xt).call(this,s(this,Z),t),o(this,Z,t))};const It=new Dt({max:500}),Lt=g((function(t){const{children:e,refreshInterval:i=1e4,token:s}=t;if(!t.client)throw new Error("Missing a `client` prop with a configured Sanity client instance");const[n]=v((()=>{const{requestTagPrefix:e,resultSourceMap:i}=t.client.config();return t.client.withConfig({requestTagPrefix:e||"sanity.preview-kit",resultSourceMap:"withKeyArraySelector"!==i||"withKeyArraySelector",...s&&{token:s,useCdn:!1,perspective:"previewDrafts",ignoreBrowserTokenWarning:!0}})})),[o]=v((()=>t.logger));w((()=>{o&&o.log(`[@sanity/preview-kit]: With the current configuration you can expect that: Updates that can be traced using Content Source Maps will be applied in real-time. Other updates will be applied every ${i}ms.`)}),[o,i]);const[h,l]=v([]),[c]=v((()=>new Map)),u=function(t){const[e]=v((()=>new Map)),i=S(((i,s,n,o)=>{e.has(i)||(e.set(i,{query:s,params:n,listeners:new Set}),m((()=>t((t=>t.includes(i)?t:[...t,i])))));const h=e.get(i);if(!h||!h.listeners)throw new TypeError("Inconsistent cache for key: "+i);const{listeners:l}=h;return l.add(o),()=>{l.delete(o),0===l.size&&(e.delete(i),m((()=>t((t=>t.includes(i)?t.filter((t=>t!==i)):t)))))}}),[e,t]);return b((()=>({cache:e,subscribe:i})),[e,i])}(l),[d]=v((()=>function(t,e,i){const s=Ht(e,i);return c.has(s)||c.set(s,{result:t,resultSourceMap:{}}),{subscribe:t=>{const n=u.subscribe(s,e,i,t);return()=>n()},getSnapshot:()=>{var t;return null==(t=c.get(s))?void 0:t.result}}})),[f,p]=v([]),[g]=v((()=>new Map)),_=S((t=>{var e;const i=new Set;if(g.clear(),null!=(e=t.documents)&&e.length)for(const e of t.documents)i.add(e._id),g.set(e._id,e);m((()=>p((t=>{const e=Array.from(new Set([...t,...i]));return JSON.stringify(e.sort())===JSON.stringify(t.sort())?t:e}))))}),[g]);return r(y.Provider,{value:d,children:[e,a(Nt,{cache:u.cache,client:n,setTurboIds:p,snapshots:c,turboIds:f,docsInUse:g}),h.map((t=>{if(!u.cache.has(t))return null;const{query:e,params:s,listeners:o}=u.cache.get(t);return a(Gt,{client:n,listeners:o,params:s,query:e,refreshInterval:i,snapshots:c,turboIdsFromSourceMap:_},t)}))]})}));Lt.displayName="LiveStoreProvider";const Gt=g((function(t){const{client:e,refreshInterval:i,query:s,params:n,listeners:o,snapshots:h,turboIdsFromSourceMap:l}=t,{projectId:r,dataset:a}=b((()=>{const{projectId:t,dataset:i}=e.config();return{projectId:t,dataset:i}}),[e]),[c,u]=v(null);if(c)throw c;const[f,p]=d({refreshInterval:i}),g="refresh"===f||"inflight"===f;return w((()=>{if(!g)return;let t=!1;const i=new AbortController;const c=p();return async function(){const{signal:c}=i,{result:u,resultSourceMap:d}=await e.fetch(s,n,{signal:c,filterResponse:!1});if(!c.aborted){h.set(Ht(s,n),{result:qt(r,a,u,d),resultSourceMap:null!=d?d:{}}),d&&l(d);for(const t of o.values())t();t=!0}}().catch((t=>{"AbortError"!==t.name&&u(t)})).finally(c),()=>{t||i.abort()}}),[e,a,o,n,r,s,g,h,p,l]),null}));function Ut(t,e,i){return`${t}-${e}-${i}`}Gt.displayName="QuerySubscription";const Nt=g((function(t){const{client:e,snapshots:i,cache:s,turboIds:n,setTurboIds:o,docsInUse:h}=t,{projectId:l,dataset:r}=b((()=>{const{projectId:t,dataset:i}=e.config();return{projectId:t,dataset:i}}),[e]);w((()=>{var t,e;const l=new Set;h.clear();for(const{query:n,params:o}of s.values()){const s=Ht(n,o),r=i.get(s);if(r&&null!=(e=null==(t=r.resultSourceMap)?void 0:t.documents)&&e.length)for(const t of r.resultSourceMap.documents)l.add(t._id),h.set(t._id,t)}const r=[...l].sort();JSON.stringify(n)!==JSON.stringify(r)&&m((()=>o(r)))}),[s,o,i,n,h]),f(h,l,r);const[u,d]=v([]);w((()=>{const t=new Set(u.flat()),e=new Set;for(const i of n)!t.has(i)&&!It.has(Ut(l,r,i))&&e.add(i);const i=[...e].slice(0,100);0!==i.length&&m((()=>d((t=>[...t.slice(-100),i]))))}),[u,r,l,n]);const[g,S]=v();return w((()=>{const t=e.listen("*",{},{events:["mutation"],effectFormat:"mendoza",includePreviousRevision:!1,includeResult:!1,tag:"turbo"}).subscribe((t=>{var e,i;if("mutation"!==t.type||null==(i=null==(e=t.effects)?void 0:e.apply)||!i.length)return;const s=Ut(l,r,t.documentId),n=It.peek(s);if(n){const e={...n};delete e._rev;const i=p(e,t.effects.apply);It.set(s,i)}m((()=>S(t.documentId)))}));return()=>t.unsubscribe()}),[e,r,l]),w((()=>{var t,e,o;if(!g||!n.includes(g))return;const h=[];for(const[s,n]of i.entries())null!=(e=null==(t=n.resultSourceMap)?void 0:t.documents)&&e.length&&(n.result=qt(l,r,n.result,n.resultSourceMap),h.push(s));for(const t of h){const e=null==(o=s.get(t))?void 0:o.listeners;if(e)for(const t of e)t()}m((()=>S(void 0)))}),[s,r,g,l,i,n]),a(c,{children:u.map((t=>a($t,{client:e,projectId:l,dataset:r,ids:t},JSON.stringify(t))))})}));Nt.displayName="Turbo";const $t=g((function(t){const{client:e,projectId:i,dataset:s,ids:n}=t;return w((()=>{const t=n.filter((t=>!It.has(Ut(i,s,t))));0!==t.length&&e.getDocuments(t).then((t=>{for(const e of t)e&&null!=e&&e._id&&It.set(Ut(i,s,e._id),e)}),console.error)}),[e,s,n,i]),null}));$t.displayName="GetDocuments";let Pt=!1;function qt(t,e,i,s){return s?u(i,s,(i=>{if(!i._projectId)return It.get(Ut(t,e,i._id));Pt||(console.warn("Cross dataset references are not supported yet, ignoring source document",i),Pt=!0)}),((t,{previousValue:e})=>{if("string"==typeof t&&"string"==typeof e){const{encoded:i}=F(e),{cleaned:s}=F(t);return`${i}${s}`}return t}),"previewDrafts"):i}function Ht(t,e){return`${t}-${JSON.stringify(e)}`}export{Lt as default};//# sourceMappingURL=LiveQueryProvider.js.map
var t=Object.defineProperty,e=t=>{throw TypeError(t)},i=(e,i,s)=>((e,i,s)=>i in e?t(e,i,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[i]=s)(e,"symbol"!=typeof i?i+"":i,s),s=(t,i,s)=>i.has(t)||e("Cannot "+s),n=(t,e,i)=>(s(t,e,"read from private field"),i?i.call(t):e.get(t)),o=(t,i,s)=>i.has(t)?e("Cannot add the same private member more than once"):i instanceof WeakSet?i.add(t):i.set(t,s),h=(t,e,i,n)=>(s(t,e,"write to private field"),n?n.call(t,i):e.set(t,i),i),l=(t,e,i)=>(s(t,e,"access private method"),i),r=(t,e,i,s)=>({set _(s){h(t,e,s,i)},get _(){return n(t,e,s)}});import{jsxs as a,jsx as c,Fragment as u}from"react/jsx-runtime";import{applySourceDocuments as f}from"@sanity/client/csm";import{useRevalidate as d,useDocumentsInUse as p}from"@sanity/preview-kit-compat";import{applyPatch as g}from"mendoza";import{memo as w,useState as v,useEffect as m,useCallback as S,startTransition as b,useMemo as y}from"react";import{d as _}from"./context.js";var O={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},A={0:8203,1:8204,2:8205,3:65279};new Array(4).fill(String.fromCodePoint(A[0])).join(""),Object.fromEntries(Object.entries(A).map((t=>t.reverse()))),Object.fromEntries(Object.entries(O).map((t=>t.reverse())));var W=`${Object.values(O).map((t=>`\\u{${t.toString(16)}}`)).join("")}`,F=new RegExp(`[${W}]{4,}`,"gu");function E(t){var e;return{cleaned:t.replace(F,""),encoded:(null==(e=t.match(F))?void 0:e[0])||""}}const M="object"==typeof performance&&performance&&"function"==typeof performance.now?performance:Date,T=new Set,z="object"==typeof process&&process?process:{},k=(t,e,i,s)=>{"function"==typeof z.emitWarning?z.emitWarning(t,e,i,s):console.error(`[${i}] ${e}: ${t}`)};let C=globalThis.AbortController,x=globalThis.AbortSignal;var R;if(typeof C>"u"){x=class{constructor(){i(this,"onabort"),i(this,"_onabort",[]),i(this,"reason"),i(this,"aborted",!1)}addEventListener(t,e){this._onabort.push(e)}},C=class{constructor(){i(this,"signal",new x),e()}abort(t){var e,i;if(!this.signal.aborted){this.signal.reason=t,this.signal.aborted=!0;for(const e of this.signal._onabort)e(t);null==(i=(e=this.signal).onabort)||i.call(e,t)}}};let t="1"!==(null==(R=z.env)?void 0:R.LRU_CACHE_IGNORE_AC_WARNING);const e=()=>{t&&(t=!1,k("AbortController is not defined. If using lru-cache in node 14, load an AbortController polyfill from the `node-abort-controller` package. A minimal polyfill is provided for use by LRUCache.fetch(), but it should not be relied upon in other contexts (eg, passing it to other APIs that use AbortController/AbortSignal might have undesirable effects). You may disable this with LRU_CACHE_IGNORE_AC_WARNING=1 in the env.","NO_ABORT_CONTROLLER","ENOTSUP",e))}}const j=t=>t&&t===Math.floor(t)&&t>0&&isFinite(t),D=t=>j(t)?t<=Math.pow(2,8)?Uint8Array:t<=Math.pow(2,16)?Uint16Array:t<=Math.pow(2,32)?Uint32Array:t<=Number.MAX_SAFE_INTEGER?I:null:null;class I extends Array{constructor(t){super(t),this.fill(0)}}var L;const G=class t{constructor(e,s){if(i(this,"heap"),i(this,"length"),!n(t,L))throw new TypeError("instantiate Stack using Stack.create(n)");this.heap=new s(e),this.length=0}static create(e){const i=D(e);if(!i)return[];h(t,L,!0);const s=new t(e,i);return h(t,L,!1),s}push(t){this.heap[this.length++]=t}pop(){return this.heap[--this.length]}};L=new WeakMap,o(G,L,!1);let U=G;var N,$,P,q,H,J,B,K,V,Q,X,Y,Z,tt,et,it,st,nt,ot,ht,lt,rt,at,ct,ut,ft,dt,pt,gt,wt,vt,mt,St,bt,yt,_t,Ot,At,Wt,Ft,Et,Mt;const Tt=class t{constructor(e){o(this,ut),o(this,P),o(this,q),o(this,H),o(this,J),o(this,B),i(this,"ttl"),i(this,"ttlResolution"),i(this,"ttlAutopurge"),i(this,"updateAgeOnGet"),i(this,"updateAgeOnHas"),i(this,"allowStale"),i(this,"noDisposeOnSet"),i(this,"noUpdateTTL"),i(this,"maxEntrySize"),i(this,"sizeCalculation"),i(this,"noDeleteOnFetchRejection"),i(this,"noDeleteOnStaleGet"),i(this,"allowStaleOnFetchAbort"),i(this,"allowStaleOnFetchRejection"),i(this,"ignoreFetchAbort"),o(this,K),o(this,V),o(this,Q),o(this,X),o(this,Y),o(this,Z),o(this,tt),o(this,et),o(this,it),o(this,st),o(this,nt),o(this,ot),o(this,ht),o(this,lt),o(this,rt),o(this,at),o(this,ct),o(this,dt,(()=>{})),o(this,pt,(()=>{})),o(this,gt,(()=>{})),o(this,wt,(()=>!1)),o(this,mt,(t=>{})),o(this,St,((t,e,i)=>{})),o(this,bt,((t,e,i,s)=>{if(i||s)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0})),i(this,N,"LRUCache");const{max:s=0,ttl:r,ttlResolution:a=1,ttlAutopurge:c,updateAgeOnGet:u,updateAgeOnHas:f,allowStale:d,dispose:p,disposeAfter:g,noDisposeOnSet:w,noUpdateTTL:v,maxSize:m=0,maxEntrySize:S=0,sizeCalculation:b,fetchMethod:y,noDeleteOnFetchRejection:_,noDeleteOnStaleGet:O,allowStaleOnFetchRejection:A,allowStaleOnFetchAbort:W,ignoreFetchAbort:F}=e;if(0!==s&&!j(s))throw new TypeError("max option must be a nonnegative integer");const E=s?D(s):Array;if(!E)throw new Error("invalid max value: "+s);if(h(this,P,s),h(this,q,m),this.maxEntrySize=S||n(this,q),this.sizeCalculation=b,this.sizeCalculation){if(!n(this,q)&&!this.maxEntrySize)throw new TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize");if("function"!=typeof this.sizeCalculation)throw new TypeError("sizeCalculation set to non-function")}if(void 0!==y&&"function"!=typeof y)throw new TypeError("fetchMethod must be a function if specified");if(h(this,B,y),h(this,at,!!y),h(this,Q,new Map),h(this,X,new Array(s).fill(void 0)),h(this,Y,new Array(s).fill(void 0)),h(this,Z,new E(s)),h(this,tt,new E(s)),h(this,et,0),h(this,it,0),h(this,st,U.create(s)),h(this,K,0),h(this,V,0),"function"==typeof p&&h(this,H,p),"function"==typeof g?(h(this,J,g),h(this,nt,[])):(h(this,J,void 0),h(this,nt,void 0)),h(this,rt,!!n(this,H)),h(this,ct,!!n(this,J)),this.noDisposeOnSet=!!w,this.noUpdateTTL=!!v,this.noDeleteOnFetchRejection=!!_,this.allowStaleOnFetchRejection=!!A,this.allowStaleOnFetchAbort=!!W,this.ignoreFetchAbort=!!F,0!==this.maxEntrySize){if(0!==n(this,q)&&!j(n(this,q)))throw new TypeError("maxSize must be a positive integer if specified");if(!j(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");l(this,ut,vt).call(this)}if(this.allowStale=!!d,this.noDeleteOnStaleGet=!!O,this.updateAgeOnGet=!!u,this.updateAgeOnHas=!!f,this.ttlResolution=j(a)||0===a?a:1,this.ttlAutopurge=!!c,this.ttl=r||0,this.ttl){if(!j(this.ttl))throw new TypeError("ttl must be a positive integer if specified");l(this,ut,ft).call(this)}if(0===n(this,P)&&0===this.ttl&&0===n(this,q))throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!n(this,P)&&!n(this,q)){const e="LRU_CACHE_UNBOUNDED";(t=>!T.has(t))(e)&&(T.add(e),k("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",e,t))}}static unsafeExposeInternals(t){return{starts:n(t,ht),ttls:n(t,lt),sizes:n(t,ot),keyMap:n(t,Q),keyList:n(t,X),valList:n(t,Y),next:n(t,Z),prev:n(t,tt),get head(){return n(t,et)},get tail(){return n(t,it)},free:n(t,st),isBackgroundFetch:e=>{var i;return l(i=t,ut,Ft).call(i,e)},backgroundFetch:(e,i,s,n)=>{var o;return l(o=t,ut,Wt).call(o,e,i,s,n)},moveToTail:e=>{var i;return l(i=t,ut,Mt).call(i,e)},indexes:e=>{var i;return l(i=t,ut,yt).call(i,e)},rindexes:e=>{var i;return l(i=t,ut,_t).call(i,e)},isStale:e=>{var i;return n(i=t,wt).call(i,e)}}}get max(){return n(this,P)}get maxSize(){return n(this,q)}get calculatedSize(){return n(this,V)}get size(){return n(this,K)}get fetchMethod(){return n(this,B)}get dispose(){return n(this,H)}get disposeAfter(){return n(this,J)}getRemainingTTL(t){return n(this,Q).has(t)?1/0:0}*entries(){for(const t of l(this,ut,yt).call(this))void 0!==n(this,Y)[t]&&void 0!==n(this,X)[t]&&!l(this,ut,Ft).call(this,n(this,Y)[t])&&(yield[n(this,X)[t],n(this,Y)[t]])}*rentries(){for(const t of l(this,ut,_t).call(this))void 0!==n(this,Y)[t]&&void 0!==n(this,X)[t]&&!l(this,ut,Ft).call(this,n(this,Y)[t])&&(yield[n(this,X)[t],n(this,Y)[t]])}*keys(){for(const t of l(this,ut,yt).call(this)){const e=n(this,X)[t];void 0!==e&&!l(this,ut,Ft).call(this,n(this,Y)[t])&&(yield e)}}*rkeys(){for(const t of l(this,ut,_t).call(this)){const e=n(this,X)[t];void 0!==e&&!l(this,ut,Ft).call(this,n(this,Y)[t])&&(yield e)}}*values(){for(const t of l(this,ut,yt).call(this))void 0!==n(this,Y)[t]&&!l(this,ut,Ft).call(this,n(this,Y)[t])&&(yield n(this,Y)[t])}*rvalues(){for(const t of l(this,ut,_t).call(this))void 0!==n(this,Y)[t]&&!l(this,ut,Ft).call(this,n(this,Y)[t])&&(yield n(this,Y)[t])}[($=Symbol.iterator,N=Symbol.toStringTag,$)](){return this.entries()}find(t,e={}){for(const i of l(this,ut,yt).call(this)){const s=n(this,Y)[i],o=l(this,ut,Ft).call(this,s)?s.__staleWhileFetching:s;if(void 0!==o&&t(o,n(this,X)[i],this))return this.get(n(this,X)[i],e)}}forEach(t,e=this){for(const i of l(this,ut,yt).call(this)){const s=n(this,Y)[i],o=l(this,ut,Ft).call(this,s)?s.__staleWhileFetching:s;void 0!==o&&t.call(e,o,n(this,X)[i],this)}}rforEach(t,e=this){for(const i of l(this,ut,_t).call(this)){const s=n(this,Y)[i],o=l(this,ut,Ft).call(this,s)?s.__staleWhileFetching:s;void 0!==o&&t.call(e,o,n(this,X)[i],this)}}purgeStale(){let t=!1;for(const e of l(this,ut,_t).call(this,{allowStale:!0}))n(this,wt).call(this,e)&&(this.delete(n(this,X)[e]),t=!0);return t}info(t){const e=n(this,Q).get(t);if(void 0===e)return;const i=n(this,Y)[e],s=l(this,ut,Ft).call(this,i)?i.__staleWhileFetching:i;if(void 0===s)return;const o={value:s};if(n(this,lt)&&n(this,ht)){const t=n(this,lt)[e],i=n(this,ht)[e];if(t&&i){const e=t-(M.now()-i);o.ttl=e,o.start=Date.now()}}return n(this,ot)&&(o.size=n(this,ot)[e]),o}dump(){const t=[];for(const e of l(this,ut,yt).call(this,{allowStale:!0})){const i=n(this,X)[e],s=n(this,Y)[e],o=l(this,ut,Ft).call(this,s)?s.__staleWhileFetching:s;if(void 0===o||void 0===i)continue;const h={value:o};if(n(this,lt)&&n(this,ht)){h.ttl=n(this,lt)[e];const t=M.now()-n(this,ht)[e];h.start=Math.floor(Date.now()-t)}n(this,ot)&&(h.size=n(this,ot)[e]),t.unshift([i,h])}return t}load(t){this.clear();for(const[e,i]of t){if(i.start){const t=Date.now()-i.start;i.start=M.now()-t}this.set(e,i.value,i)}}set(t,e,i={}){var s,o,a,c,u;if(void 0===e)return this.delete(t),this;const{ttl:f=this.ttl,start:d,noDisposeOnSet:p=this.noDisposeOnSet,sizeCalculation:g=this.sizeCalculation,status:w}=i;let{noUpdateTTL:v=this.noUpdateTTL}=i;const m=n(this,bt).call(this,t,e,i.size||0,g);if(this.maxEntrySize&&m>this.maxEntrySize)return w&&(w.set="miss",w.maxEntrySizeExceeded=!0),this.delete(t),this;let S=0===n(this,K)?void 0:n(this,Q).get(t);if(void 0===S)S=0===n(this,K)?n(this,it):0!==n(this,st).length?n(this,st).pop():n(this,K)===n(this,P)?l(this,ut,At).call(this,!1):n(this,K),n(this,X)[S]=t,n(this,Y)[S]=e,n(this,Q).set(t,S),n(this,Z)[n(this,it)]=S,n(this,tt)[S]=n(this,it),h(this,it,S),r(this,K)._++,n(this,St).call(this,S,m,w),w&&(w.set="add"),v=!1;else{l(this,ut,Mt).call(this,S);const i=n(this,Y)[S];if(e!==i){if(n(this,at)&&l(this,ut,Ft).call(this,i)){i.__abortController.abort(new Error("replaced"));const{__staleWhileFetching:e}=i;void 0!==e&&!p&&(n(this,rt)&&(null==(s=n(this,H))||s.call(this,e,t,"set")),n(this,ct)&&(null==(o=n(this,nt))||o.push([e,t,"set"])))}else p||(n(this,rt)&&(null==(a=n(this,H))||a.call(this,i,t,"set")),n(this,ct)&&(null==(c=n(this,nt))||c.push([i,t,"set"])));if(n(this,mt).call(this,S),n(this,St).call(this,S,m,w),n(this,Y)[S]=e,w){w.set="replace";const t=i&&l(this,ut,Ft).call(this,i)?i.__staleWhileFetching:i;void 0!==t&&(w.oldValue=t)}}else w&&(w.set="update")}if(0!==f&&!n(this,lt)&&l(this,ut,ft).call(this),n(this,lt)&&(v||n(this,gt).call(this,S,f,d),w&&n(this,pt).call(this,w,S)),!p&&n(this,ct)&&n(this,nt)){const t=n(this,nt);let e;for(;e=null==t?void 0:t.shift();)null==(u=n(this,J))||u.call(this,...e)}return this}pop(){var t;try{for(;n(this,K);){const t=n(this,Y)[n(this,et)];if(l(this,ut,At).call(this,!0),l(this,ut,Ft).call(this,t)){if(t.__staleWhileFetching)return t.__staleWhileFetching}else if(void 0!==t)return t}}finally{if(n(this,ct)&&n(this,nt)){const e=n(this,nt);let i;for(;i=null==e?void 0:e.shift();)null==(t=n(this,J))||t.call(this,...i)}}}has(t,e={}){const{updateAgeOnHas:i=this.updateAgeOnHas,status:s}=e,o=n(this,Q).get(t);if(void 0!==o){const t=n(this,Y)[o];if(l(this,ut,Ft).call(this,t)&&void 0===t.__staleWhileFetching)return!1;if(!n(this,wt).call(this,o))return i&&n(this,dt).call(this,o),s&&(s.has="hit",n(this,pt).call(this,s,o)),!0;s&&(s.has="stale",n(this,pt).call(this,s,o))}else s&&(s.has="miss");return!1}peek(t,e={}){const{allowStale:i=this.allowStale}=e,s=n(this,Q).get(t);if(void 0===s||!i&&n(this,wt).call(this,s))return;const o=n(this,Y)[s];return l(this,ut,Ft).call(this,o)?o.__staleWhileFetching:o}async fetch(t,e={}){const{allowStale:i=this.allowStale,updateAgeOnGet:s=this.updateAgeOnGet,noDeleteOnStaleGet:o=this.noDeleteOnStaleGet,ttl:h=this.ttl,noDisposeOnSet:r=this.noDisposeOnSet,size:a=0,sizeCalculation:c=this.sizeCalculation,noUpdateTTL:u=this.noUpdateTTL,noDeleteOnFetchRejection:f=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:d=this.allowStaleOnFetchRejection,ignoreFetchAbort:p=this.ignoreFetchAbort,allowStaleOnFetchAbort:g=this.allowStaleOnFetchAbort,context:w,forceRefresh:v=!1,status:m,signal:S}=e;if(!n(this,at))return m&&(m.fetch="get"),this.get(t,{allowStale:i,updateAgeOnGet:s,noDeleteOnStaleGet:o,status:m});const b={allowStale:i,updateAgeOnGet:s,noDeleteOnStaleGet:o,ttl:h,noDisposeOnSet:r,size:a,sizeCalculation:c,noUpdateTTL:u,noDeleteOnFetchRejection:f,allowStaleOnFetchRejection:d,allowStaleOnFetchAbort:g,ignoreFetchAbort:p,status:m,signal:S};let y=n(this,Q).get(t);if(void 0===y){m&&(m.fetch="miss");const e=l(this,ut,Wt).call(this,t,y,b,w);return e.__returned=e}{const e=n(this,Y)[y];if(l(this,ut,Ft).call(this,e)){const t=i&&void 0!==e.__staleWhileFetching;return m&&(m.fetch="inflight",t&&(m.returnedStale=!0)),t?e.__staleWhileFetching:e.__returned=e}const o=n(this,wt).call(this,y);if(!v&&!o)return m&&(m.fetch="hit"),l(this,ut,Mt).call(this,y),s&&n(this,dt).call(this,y),m&&n(this,pt).call(this,m,y),e;const h=l(this,ut,Wt).call(this,t,y,b,w),r=void 0!==h.__staleWhileFetching&&i;return m&&(m.fetch=o?"stale":"refresh",r&&o&&(m.returnedStale=!0)),r?h.__staleWhileFetching:h.__returned=h}}get(t,e={}){const{allowStale:i=this.allowStale,updateAgeOnGet:s=this.updateAgeOnGet,noDeleteOnStaleGet:o=this.noDeleteOnStaleGet,status:h}=e,r=n(this,Q).get(t);if(void 0!==r){const e=n(this,Y)[r],a=l(this,ut,Ft).call(this,e);return h&&n(this,pt).call(this,h,r),n(this,wt).call(this,r)?(h&&(h.get="stale"),a?(h&&i&&void 0!==e.__staleWhileFetching&&(h.returnedStale=!0),i?e.__staleWhileFetching:void 0):(o||this.delete(t),h&&i&&(h.returnedStale=!0),i?e:void 0)):(h&&(h.get="hit"),a?e.__staleWhileFetching:(l(this,ut,Mt).call(this,r),s&&n(this,dt).call(this,r),e))}h&&(h.get="miss")}delete(t){var e,i,s,o;let a=!1;if(0!==n(this,K)){const s=n(this,Q).get(t);if(void 0!==s)if(a=!0,1===n(this,K))this.clear();else{n(this,mt).call(this,s);const o=n(this,Y)[s];if(l(this,ut,Ft).call(this,o)?o.__abortController.abort(new Error("deleted")):(n(this,rt)||n(this,ct))&&(n(this,rt)&&(null==(e=n(this,H))||e.call(this,o,t,"delete")),n(this,ct)&&(null==(i=n(this,nt))||i.push([o,t,"delete"]))),n(this,Q).delete(t),n(this,X)[s]=void 0,n(this,Y)[s]=void 0,s===n(this,it))h(this,it,n(this,tt)[s]);else if(s===n(this,et))h(this,et,n(this,Z)[s]);else{const t=n(this,tt)[s];n(this,Z)[t]=n(this,Z)[s];const e=n(this,Z)[s];n(this,tt)[e]=n(this,tt)[s]}r(this,K)._--,n(this,st).push(s)}}if(n(this,ct)&&null!=(s=n(this,nt))&&s.length){const t=n(this,nt);let e;for(;e=null==t?void 0:t.shift();)null==(o=n(this,J))||o.call(this,...e)}return a}clear(){var t,e,i;for(const i of l(this,ut,_t).call(this,{allowStale:!0})){const s=n(this,Y)[i];if(l(this,ut,Ft).call(this,s))s.__abortController.abort(new Error("deleted"));else{const o=n(this,X)[i];n(this,rt)&&(null==(t=n(this,H))||t.call(this,s,o,"delete")),n(this,ct)&&(null==(e=n(this,nt))||e.push([s,o,"delete"]))}}if(n(this,Q).clear(),n(this,Y).fill(void 0),n(this,X).fill(void 0),n(this,lt)&&n(this,ht)&&(n(this,lt).fill(0),n(this,ht).fill(0)),n(this,ot)&&n(this,ot).fill(0),h(this,et,0),h(this,it,0),n(this,st).length=0,h(this,V,0),h(this,K,0),n(this,ct)&&n(this,nt)){const t=n(this,nt);let e;for(;e=null==t?void 0:t.shift();)null==(i=n(this,J))||i.call(this,...e)}}};P=new WeakMap,q=new WeakMap,H=new WeakMap,J=new WeakMap,B=new WeakMap,K=new WeakMap,V=new WeakMap,Q=new WeakMap,X=new WeakMap,Y=new WeakMap,Z=new WeakMap,tt=new WeakMap,et=new WeakMap,it=new WeakMap,st=new WeakMap,nt=new WeakMap,ot=new WeakMap,ht=new WeakMap,lt=new WeakMap,rt=new WeakMap,at=new WeakMap,ct=new WeakMap,ut=new WeakSet,ft=function(){const t=new I(n(this,P)),e=new I(n(this,P));h(this,lt,t),h(this,ht,e),h(this,gt,((i,s,o=M.now())=>{if(e[i]=0!==s?o:0,t[i]=s,0!==s&&this.ttlAutopurge){const t=setTimeout((()=>{n(this,wt).call(this,i)&&this.delete(n(this,X)[i])}),s+1);t.unref&&t.unref()}})),h(this,dt,(i=>{e[i]=0!==t[i]?M.now():0})),h(this,pt,((n,o)=>{if(t[o]){const h=t[o],l=e[o];if(!h||!l)return;n.ttl=h,n.start=l,n.now=i||s();const r=n.now-l;n.remainingTTL=h-r}}));let i=0;const s=()=>{const t=M.now();if(this.ttlResolution>0){i=t;const e=setTimeout((()=>i=0),this.ttlResolution);e.unref&&e.unref()}return t};this.getRemainingTTL=o=>{const h=n(this,Q).get(o);if(void 0===h)return 0;const l=t[h],r=e[h];if(!l||!r)return 1/0;return l-((i||s())-r)},h(this,wt,(n=>{const o=e[n],h=t[n];return!!h&&!!o&&(i||s())-o>h}))},dt=new WeakMap,pt=new WeakMap,gt=new WeakMap,wt=new WeakMap,vt=function(){const t=new I(n(this,P));h(this,V,0),h(this,ot,t),h(this,mt,(e=>{h(this,V,n(this,V)-t[e]),t[e]=0})),h(this,bt,((t,e,i,s)=>{if(l(this,ut,Ft).call(this,e))return 0;if(!j(i)){if(!s)throw new TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.");if("function"!=typeof s)throw new TypeError("sizeCalculation must be a function");if(i=s(e,t),!j(i))throw new TypeError("sizeCalculation return invalid (expect positive integer)")}return i})),h(this,St,((e,i,s)=>{if(t[e]=i,n(this,q)){const i=n(this,q)-t[e];for(;n(this,V)>i;)l(this,ut,At).call(this,!0)}h(this,V,n(this,V)+t[e]),s&&(s.entrySize=i,s.totalCalculatedSize=n(this,V))}))},mt=new WeakMap,St=new WeakMap,bt=new WeakMap,yt=function*({allowStale:t=this.allowStale}={}){if(n(this,K))for(let e=n(this,it);l(this,ut,Ot).call(this,e)&&((t||!n(this,wt).call(this,e))&&(yield e),e!==n(this,et));)e=n(this,tt)[e]},_t=function*({allowStale:t=this.allowStale}={}){if(n(this,K))for(let e=n(this,et);l(this,ut,Ot).call(this,e)&&((t||!n(this,wt).call(this,e))&&(yield e),e!==n(this,it));)e=n(this,Z)[e]},Ot=function(t){return void 0!==t&&n(this,Q).get(n(this,X)[t])===t},At=function(t){var e,i;const s=n(this,et),o=n(this,X)[s],a=n(this,Y)[s];return n(this,at)&&l(this,ut,Ft).call(this,a)?a.__abortController.abort(new Error("evicted")):(n(this,rt)||n(this,ct))&&(n(this,rt)&&(null==(e=n(this,H))||e.call(this,a,o,"evict")),n(this,ct)&&(null==(i=n(this,nt))||i.push([a,o,"evict"]))),n(this,mt).call(this,s),t&&(n(this,X)[s]=void 0,n(this,Y)[s]=void 0,n(this,st).push(s)),1===n(this,K)?(h(this,et,h(this,it,0)),n(this,st).length=0):h(this,et,n(this,Z)[s]),n(this,Q).delete(o),r(this,K)._--,s},Wt=function(t,e,i,s){const o=void 0===e?void 0:n(this,Y)[e];if(l(this,ut,Ft).call(this,o))return o;const h=new C,{signal:r}=i;null==r||r.addEventListener("abort",(()=>h.abort(r.reason)),{signal:h.signal});const a={signal:h.signal,options:i,context:s},c=(s,o=!1)=>{const{aborted:l}=h.signal,r=i.ignoreFetchAbort&&void 0!==s;if(i.status&&(l&&!o?(i.status.fetchAborted=!0,i.status.fetchError=h.signal.reason,r&&(i.status.fetchAbortIgnored=!0)):i.status.fetchResolved=!0),l&&!r&&!o)return u(h.signal.reason);const c=f;return n(this,Y)[e]===f&&(void 0===s?c.__staleWhileFetching?n(this,Y)[e]=c.__staleWhileFetching:this.delete(t):(i.status&&(i.status.fetchUpdated=!0),this.set(t,s,a.options))),s},u=s=>{const{aborted:o}=h.signal,l=o&&i.allowStaleOnFetchAbort,r=l||i.allowStaleOnFetchRejection,a=r||i.noDeleteOnFetchRejection,c=f;if(n(this,Y)[e]===f&&(a&&void 0!==c.__staleWhileFetching?l||(n(this,Y)[e]=c.__staleWhileFetching):this.delete(t)),r)return i.status&&void 0!==c.__staleWhileFetching&&(i.status.returnedStale=!0),c.__staleWhileFetching;if(c.__returned===c)throw s};i.status&&(i.status.fetchDispatched=!0);const f=new Promise(((e,s)=>{var l;const r=null==(l=n(this,B))?void 0:l.call(this,t,o,a);r&&r instanceof Promise&&r.then((t=>e(void 0===t?void 0:t)),s),h.signal.addEventListener("abort",(()=>{(!i.ignoreFetchAbort||i.allowStaleOnFetchAbort)&&(e(void 0),i.allowStaleOnFetchAbort&&(e=t=>c(t,!0)))}))})).then(c,(t=>(i.status&&(i.status.fetchRejected=!0,i.status.fetchError=t),u(t)))),d=Object.assign(f,{__abortController:h,__staleWhileFetching:o,__returned:void 0});return void 0===e?(this.set(t,d,{...a.options,status:void 0}),e=n(this,Q).get(t)):n(this,Y)[e]=d,d},Ft=function(t){if(!n(this,at))return!1;const e=t;return!!e&&e instanceof Promise&&e.hasOwnProperty("__staleWhileFetching")&&e.__abortController instanceof C},Et=function(t,e){n(this,tt)[e]=t,n(this,Z)[t]=e},Mt=function(t){t!==n(this,it)&&(t===n(this,et)?h(this,et,n(this,Z)[t]):l(this,ut,Et).call(this,n(this,tt)[t],n(this,Z)[t]),l(this,ut,Et).call(this,n(this,it),t),h(this,it,t))};const zt=new Tt({max:500}),kt=w((function(t){const{children:e,refreshInterval:i=1e4,token:s}=t;if(!t.client)throw new Error("Missing a `client` prop with a configured Sanity client instance");const[n]=v((()=>{const{requestTagPrefix:e,resultSourceMap:i}=t.client.config();return t.client.withConfig({requestTagPrefix:e||"sanity.preview-kit",resultSourceMap:"withKeyArraySelector"!==i||"withKeyArraySelector",...s&&{token:s,useCdn:!1,perspective:"previewDrafts",ignoreBrowserTokenWarning:!0}})})),[o]=v((()=>t.logger));m((()=>{o&&o.log(`[@sanity/preview-kit]: With the current configuration you can expect that: Updates that can be traced using Content Source Maps will be applied in real-time. Other updates will be applied every ${i}ms.`)}),[o,i]);const[h,l]=v([]),[r]=v((()=>new Map)),u=function(t){const[e]=v((()=>new Map)),i=S(((i,s,n,o)=>{e.has(i)||(e.set(i,{query:s,params:n,listeners:new Set}),b((()=>t((t=>t.includes(i)?t:[...t,i])))));const h=e.get(i);if(!h||!h.listeners)throw new TypeError("Inconsistent cache for key: "+i);const{listeners:l}=h;return l.add(o),()=>{l.delete(o),0===l.size&&(e.delete(i),b((()=>t((t=>t.includes(i)?t.filter((t=>t!==i)):t)))))}}),[e,t]);return y((()=>({cache:e,subscribe:i})),[e,i])}(l),[f]=v((()=>function(t,e,i){const s=Lt(e,i);return r.has(s)||r.set(s,{result:t,resultSourceMap:{}}),{subscribe:t=>{const n=u.subscribe(s,e,i,t);return()=>n()},getSnapshot:()=>{var t;return null==(t=r.get(s))?void 0:t.result}}})),[d,p]=v([]),[g]=v((()=>new Map)),w=S((t=>{var e;const i=new Set;if(g.clear(),null!=(e=t.documents)&&e.length)for(const e of t.documents)i.add(e._id),g.set(e._id,e);b((()=>p((t=>{const e=Array.from(new Set([...t,...i]));return JSON.stringify(e.sort())===JSON.stringify(t.sort())?t:e}))))}),[g]);return a(_.Provider,{value:f,children:[e,c(Rt,{cache:u.cache,client:n,setTurboIds:p,snapshots:r,turboIds:d,docsInUse:g}),h.map((t=>{if(!u.cache.has(t))return null;const{query:e,params:s,listeners:o}=u.cache.get(t);return c(Ct,{client:n,listeners:o,params:s,query:e,refreshInterval:i,snapshots:r,turboIdsFromSourceMap:w},t)}))]})}));kt.displayName="LiveStoreProvider";const Ct=w((function(t){const{client:e,refreshInterval:i,query:s,params:n,listeners:o,snapshots:h,turboIdsFromSourceMap:l}=t,{projectId:r,dataset:a}=y((()=>{const{projectId:t,dataset:i}=e.config();return{projectId:t,dataset:i}}),[e]),[c,u]=v(null);if(c)throw c;const[f,p]=d({refreshInterval:i}),g="refresh"===f||"inflight"===f;return m((()=>{if(!g)return;let t=!1;const i=new AbortController;const c=p();return async function(){const{signal:c}=i,{result:u,resultSourceMap:f}=await e.fetch(s,n,{signal:c,filterResponse:!1});if(!c.aborted){h.set(Lt(s,n),{result:It(r,a,u,f),resultSourceMap:null!=f?f:{}}),f&&l(f);for(const t of o.values())t();t=!0}}().catch((t=>{"AbortError"!==t.name&&u(t)})).finally(c),()=>{t||i.abort()}}),[e,a,o,n,r,s,g,h,p,l]),null}));function xt(t,e,i){return`${t}-${e}-${i}`}Ct.displayName="QuerySubscription";const Rt=w((function(t){const{client:e,snapshots:i,cache:s,turboIds:n,setTurboIds:o,docsInUse:h}=t,{projectId:l,dataset:r}=y((()=>{const{projectId:t,dataset:i}=e.config();return{projectId:t,dataset:i}}),[e]);m((()=>{var t,e;const l=new Set;h.clear();for(const{query:n,params:o}of s.values()){const s=Lt(n,o),r=i.get(s);if(r&&null!=(e=null==(t=r.resultSourceMap)?void 0:t.documents)&&e.length)for(const t of r.resultSourceMap.documents)l.add(t._id),h.set(t._id,t)}const r=[...l].sort();JSON.stringify(n)!==JSON.stringify(r)&&b((()=>o(r)))}),[s,o,i,n,h]),p(h,l,r);const[a,f]=v([]);m((()=>{const t=new Set(a.flat()),e=new Set;for(const i of n)!t.has(i)&&!zt.has(xt(l,r,i))&&e.add(i);const i=[...e].slice(0,100);0!==i.length&&b((()=>f((t=>[...t.slice(-100),i]))))}),[a,r,l,n]);const[d,w]=v();return m((()=>{const t=e.listen("*",{},{events:["mutation"],effectFormat:"mendoza",includePreviousRevision:!1,includeResult:!1,tag:"turbo"}).subscribe((t=>{var e,i;if("mutation"!==t.type||null==(i=null==(e=t.effects)?void 0:e.apply)||!i.length)return;const s=xt(l,r,t.documentId),n=zt.peek(s);if(n){const e={...n};delete e._rev;const i=g(e,t.effects.apply);zt.set(s,i)}b((()=>w(t.documentId)))}));return()=>t.unsubscribe()}),[e,r,l]),m((()=>{var t,e,o;if(!d||!n.includes(d))return;const h=[];for(const[s,n]of i.entries())null!=(e=null==(t=n.resultSourceMap)?void 0:t.documents)&&e.length&&(n.result=It(l,r,n.result,n.resultSourceMap),h.push(s));for(const t of h){const e=null==(o=s.get(t))?void 0:o.listeners;if(e)for(const t of e)t()}b((()=>w(void 0)))}),[s,r,d,l,i,n]),c(u,{children:a.map((t=>c(jt,{client:e,projectId:l,dataset:r,ids:t},JSON.stringify(t))))})}));Rt.displayName="Turbo";const jt=w((function(t){const{client:e,projectId:i,dataset:s,ids:n}=t;return m((()=>{const t=n.filter((t=>!zt.has(xt(i,s,t))));0!==t.length&&e.getDocuments(t).then((t=>{for(const e of t)e&&null!=e&&e._id&&zt.set(xt(i,s,e._id),e)}),console.error)}),[e,s,n,i]),null}));jt.displayName="GetDocuments";let Dt=!1;function It(t,e,i,s){return s?f(i,s,(i=>{if(!i._projectId)return zt.get(xt(t,e,i._id));Dt||(console.warn("Cross dataset references are not supported yet, ignoring source document",i),Dt=!0)}),((t,{previousValue:e})=>{if("string"==typeof t&&"string"==typeof e){const{encoded:i}=E(e),{cleaned:s}=E(t);return`${i}${s}`}return t}),"previewDrafts"):i}function Lt(t,e){return`${t}-${JSON.stringify(e)}`}export{kt as default};//# sourceMappingURL=LiveQueryProvider.js.map
{
"name": "@sanity/preview-kit",
"version": "5.0.53",
"version": "5.0.54",
"description": "General purpose utils for live content and visual editing",

@@ -92,4 +92,4 @@ "keywords": [

"devDependencies": {
"@sanity/client": "^6.17.2",
"@sanity/pkg-utils": "6.8.11",
"@sanity/client": "^6.18.0",
"@sanity/pkg-utils": "6.8.13",
"@sanity/prettier-config": "^1.0.2",

@@ -124,3 +124,3 @@ "@sanity/semantic-release-preset": "^4.1.7",

"peerDependencies": {
"@sanity/client": "^6.17.2",
"@sanity/client": "^6.18.0",
"react": "^18.0.0"

@@ -127,0 +127,0 @@ },

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc