PageSourceSearch

https://pika.style/_next/static/chunks/9ba42ad4-6a2928b5c827ef85.js

js pika.style collected 2026-09-25 18:42:24 UTC 238,608 bytes, 33 lines download raw bytes

1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7614],{7985:(e,t,n)=>{let r;n.d(t,{$:()=>rY,A:()=>i9,E:()=>la,G:()=>am,J:()=>af,K:()=>ah,L:()=>iQ,Q:()=>rJ,R:()=>iY,X:()=>ay,Y:()=>au,Z:()=>r2,_:()=>l$,_t:()=>ns,a:()=>lG,b:()=>lj,bt:()=>t3,ct:()=>rp,dt:()=>re,et:()=>rZ,f:()=>lM,ft:()=>nR,g:()=>lq,gt:()=>nc,h:()=>lN,ht:()=>nu,i:()=>lQ,lt:()=>ro,m:()=>lF,mt:()=>nh,n:()=>l9,nt:()=>rX,o:()=>lW,p:()=>lz,q:()=>ad,r:()=>l0,t:()=>so,tt:()=>rQ,u:()=>lL,vt:()=>t6,w:()=>lw,x:()=>lk,yt:()=>t5});var a=n(47956),i=n(44580),o=n(8685),l=n(86085),s=n(71929),c=n(12915),d=n(59449),u=n(85240),m=n(49070),p=n(54421),f=n(41634),y=n(30788),h=n(8),g=n(906),b=n(48967),v=n(29344),x=n(60017),w=n(17173),_=n(69149),S=n(48902),k=n(77227),C=n(35670),j=n(66904),I=n(12200),T=n(80607),E=n(52980),$=n(18744),A=n(60253),q=n(57298),D=n(82130),N=n(71346),V=n(6873),F=n(11340),O=n(76430),z=n(16229),M=n(32037),L=n(61221),P=n(3240),R=n(57338),U=n(82998),K=n(10111),B=n(14391),W=n(61836),H=n(7069),G=n(91290),Z=n(88962),J=n(19170),Y=n(56417),Q=n(59793),X=n(69374),ee=n(56747),et=n(99223),en=n(76403),er=n(18539),ea=n(38292),ei=n(37685),eo=n(91419),el=n(48796),es=n(65344),ec=n(91115),ed=n(87479),eu=n(13470),em=n(75038),ep=n(31403),ef=n(76388),ey=n(79515),eh=n(79863),eg=n(37890),eb=n(47436),ev=n(80018),ex=n(68050),ew=n(15309),e_=n(12816),eS=n(71576),ek=n(11501),eC=n(64928),ej=n(3180),eI=n(82979),eT=n(92958),eE=n(34623),e$=n(65400),eA=n(2608),eq=n(4499),eD=n(2545),eN=n(39430),eV=n(27266),eF=n(92932),eO=n(76830),ez=n(52727),eM=n(62284),eL=n(60277),eP=n(80456),eR=n(19861),eU=n(55154),eK=n(15477),eB=n(75168),eW=n(49396),eH=n(85212),eG=n(62849),eZ=n(85309),eJ=n(49734),eY=n(98226),eQ=n(87927),eX=n(47951),e0=n(13776),e1=n(88297),e2=n(12398),e3=n(11148),e4=n(21967),e5=n(7981),e6=n(83309),e7=n(81494),e8=n(79397),e9=n(47347),te=n(98485),tt=n(57886),tn=n(57938),tr=n(72290),ta=n(46661),ti=n(66286),to=n(88117),tl=n(20256),ts=n(79308),tc=n(71930),td=n(26570),tu=n(84589),tm=n(60851),tp=n(43491),tf=n(16608),ty=n(1612),th=n(19564),tg=n(36272),tb=n(50020),tv=n(14592),tx=n(5988),tw=n(63595),t_=n(80917),tS=n(84806),tk=n(37103),tC=n(55589),tj=n(59506),tI=n(48693),tT=n(73002),tE=n(6871),t$=n(53370),tA=n(45619),tq=n(81970),tD=n(53152),tN=n(74676),tV=n(84189),tF=n(15492),tO=n(33832),tz=n(5191),tM=n(46030),tL=n(22284),tP=n(26759),tR=n(3343),tU=n(45166),tK=n(11756),tB=n(46269),tW=n(27913),tH=n(27330),tG=n(45778),tZ=n(47240),tJ=n(3944),tY=n(71430),tQ=n(29933),tX=n(24043),t0=n(45627),t1=n(56450),t2=n(66850);let t3={data:[],error:null,loading:!0},t4=(0,i.nt)((e,t,n)=>n.unstable_observeDocumentIdSet("sanity::versionOf($publishedId)",{publishedId:e}).pipe((0,z.T)(e=>e.documentIds)).pipe((0,M.n)(e=>n.unstable_observeDocumentIdSet('_type == "sanity.canvas.link" && studioDocumentId in $ids',{ids:e}))).pipe((0,z.T)(e=>e.documentIds),(0,t$.q)(e=>t.observable.fetch("*[_id == $id][0]{ _id, canvasDocumentId, studioDocumentId, isStudioDocumentEditable}",{id:e},{tag:"canvas.companion-docs"}).pipe((0,z.T)(e=>{if(!e?._id)throw Error("Companion doc not ready");return e}),(0,L.L)({count:2,delay:e=>{if(e instanceof Error&&"Companion doc not ready"===e.message)return(0,P.O)(1e3);throw e}}))),(0,z.T)(e=>({error:null,data:e,loading:!1})),(0,R.W)(e=>(0,U.of)({error:e,data:[],loading:!1})),(0,K.Z)(t3),(0,B.t)({bufferSize:1,refCount:!0})),(e,t)=>(0,i.et)([e,...(0,i.tt)(t)]));function t5(){let e=(0,eu.c)(5),t=(0,i.m)(),n=(0,u.c)(),r=(0,i.r)(),a=(0,u.i)(u.n),o;return e[0]!==r||e[1]!==t||e[2]!==a||e[3]!==n?(o=t.get({dependencies:[n,r],namespace:"CompanionDocsStore"})||function({client:e,previewStore:t}){return{getCompanionDocs:n=>t4((0,p.l)(n),e,t)}}({client:a,previewStore:r}),t.set({dependencies:[n,r],namespace:"CompanionDocsStore",value:o}),e[0]=r,e[1]=t,e[2]=a,e[3]=n,e[4]=o):o=e[4],o}let t6=e=>{let t=(0,eu.c)(15),n=t5(),r;t[0]===e?r=t[1]:(r=(0,p.l)(e),t[0]=e,t[1]=r);let a=r,i;t[2]!==n||t[3]!==a?(i=n.getCompanionDocs(a),t[2]=n,t[3]=a,t[4]=i):i=t[4];let o=(0,eD.J2)(i,t3),l;if(t[5]!==o.data||t[6]!==e){let n;t[8]===e?n=t[9]:(n=t=>t?.studioDocumentId===e,t[8]=e,t[9]=n),l=o.data.find(n),t[5]=o.data,t[6]=e,t[7]=l}else l=t[7];let s=l,c=!!s,d=!!s&&!s.isStudioDocumentEditable,u;return t[10]!==s||t[11]!==o.loading||t[12]!==c||t[13]!==d?(u={isLinked:c,isLockedByCanvas:d,companionDoc:s,loading:o.loading},t[10]=s,t[11]=o.loading,t[12]=c,t[13]=d,t[14]=u):u=t[14],u},t7="canvas",t8={locale:"en-US",namespace:t7,resources:()=>n.e(8336).then(n.bind(n,48336))},t9=(0,eK.g_)({name:"Canvas Link CTA Clicked",version:1,description:'The "Link to Canvas" button is clicked.'}),ne=(0,eK.g_)({name:"Canvas Link Redirected",version:1,description:"The user is redirected to the canvas studio-import page"}),nt=(0,eK.g_)({name:"Canvas Link Dialog Diffs Shown",version:1,description:"The diffs dialog is shown"}),nn=(0,eK.g_)({name:"Canvas Link Dialog Rejected",version:1,description:'User clicked "Cancel" in the "Link to Canvas" dialog after seeing the diffs'}),nr=(0,eK.g_)({name:"Canvas Unlink CTA Clicked",version:1,description:'User clicked "Unlink" action'}),na=(0,eK.g_)({name:"Canvas Unlink Approved",version:1,description:"User confirmed that they want the Studio document unlinked"}),ni=(0,eK.g_)({name:"Canvas Opened",version:1,description:'User clicked "Edit in Canvas"'}),no=e=>e.reduce((e,t)=>
1(e[t.type]=(e[t.type]||0)+1,e),{});function nl(){let e=(0,eu.c)(2),t=(0,eI.Jr)(),n;return e[0]===t?n=e[1]:(n={linkCtaClicked:()=>t.log(t9),linkRedirected:(e,n)=>t.log(ne,{origin:e,diffs:n?no(n):void 0}),linkDialogDiffsShown:()=>t.log(nt),linkDialogRejected:e=>t.log(nn,{diffs:no(e)}),unlinkCtaClicked:()=>t.log(nr),unlinkApproved:()=>t.log(na),canvasOpened:e=>t.log(ni,{origin:e,source:"studio"})},e[0]=t,e[1]=n),n}let ns=(e,t)=>{let n=(0,eu.c)(10),{value:r}=(0,v.O)(),a=(0,u.i)(u.n),{node:o}=(0,i.t)(),l=(0,v.D)()?.name==="coreUi",{canvasOpened:c}=nl(),d=(0,eT.dj)(),{t:m}=(0,s.t)(t7),p;return n[0]!==e||n[1]!==c||n[2]!==a||n[3]!==l||n[4]!==o||n[5]!==r||n[6]!==t||n[7]!==m||n[8]!==d?(p=()=>{if(e)if(c(t),l&&o){let t={type:"dashboard/v1/bridge/navigate-to-resource",data:{resourceId:"",resourceType:"canvas",path:`doc/${e}`}};o.post(t.type,t.data)}else{if(!r)return void d.push({status:"error",title:m("navigate-to-canvas-doc.error.missing-permissions")});let t="https://api.sanity.work"===a.config().apiHost;window.open(`https://www.sanity.${t?"work":"io"}/@${r}/canvas/doc/${e}`,"_blank")}},n[0]=e,n[1]=c,n[2]=a,n[3]=l,n[4]=o,n[5]=r,n[6]=t,n[7]=m,n[8]=d,n[9]=p):p=n[9],p};function nc(e){return e.version?e.version._id:e.liveEditSchemaType?(0,p.l)(e.id):e.draft?e.draft._id:(0,p.s)(e.id)}let nd=(e,t)=>e.draft===t.draft&&e.published===t.published&&e.version===t.version&&e.ready===t.ready&&e.transactionSyncLock===t.transactionSyncLock;function nu(e,t,n,r){let a=(0,eu.c)(11),o=void 0===n?"default":n;if("published"===r||"draft"===r)throw Error("Version cannot be published or draft");let l=(0,i.i)(),s=(0,i.Zt)(),c;if(a[0]!==t||a[1]!==l.pair||a[2]!==o||a[3]!==e||a[4]!==r){e:{let n=l.pair.editState(e,t,r);if("low"===o){let e=n.pipe((0,W.u)());c=(0,H.h)(e.pipe((0,G.s)(1)),e.pipe((0,Z.i)(1),(0,J.s)(nm))).pipe((0,Y.F)(nd),(0,B.t)({bufferSize:1,refCount:!0}));break e}c=n.pipe((0,Y.F)(nd),(0,B.t)({bufferSize:1,refCount:!0}))}a[0]=t,a[1]=l.pair,a[2]=o,a[3]=e,a[4]=r,a[5]=c}else c=a[5];let d=(0,eD.ut)(c,void 0),u;t:{let n;if(d){u=d;break t}a[6]!==t||a[7]!==e||a[8]!==s||a[9]!==r?(n=(0,i.B)(s,(0,p.c)(e,{version:r}),t),a[6]=t,a[7]=e,a[8]=s,a[9]=r,a[10]=n):n=a[10],u=n}return u}function nm(){return(0,P.O)(1e3)}let np=new ez.A({maxAge:3e5,maxSize:50}),nf={data:[],error:null,loading:!0};async function ny(e,t,n,r){return!r||(await Promise.all(t.map(async t=>{try{let{granted:a}=await (0,i.j)(e,[t],n,r);return a}catch{return!1}}))).some(Boolean)}function nh(e){let t=(0,eu.c)(18),{documentValue:n,permission:r}=e,a=(0,i.l)(),o=(0,i.d)(),l=(0,u.i)(u.n),s;if(t[0]!==a||t[1]!==o){let e=a.get().pipe((0,z.T)(n_)).pipe((0,B.t)(1)),n;t[3]===o?n=t[4]:(n=async e=>{let t=e.map(nw);return await o.getUsers(t)},t[3]=o,t[4]=n),s=e.pipe((0,M.n)(n),(0,z.T)(nv)),t[0]=a,t[1]=o,t[2]=s}else s=t[2];let c=s,d;t[5]===l.observable?d=t[6]:(d=function(e){let t=function(e){let{projectId:t,dataset:n}=e.config();return`${t}-${n}`}(e),n=np.get(t);if(n)return n;let r=(0,Q.v)(()=>e.fetch('*[_type == "system.group"]{members, grants}')).pipe((0,X.M)({error:()=>{np.delete(t)}}),(0,B.t)(1));return np.set(t,r),r}(l.observable),t[5]=l.observable,t[6]=d);let m=d,p;t[7]!==m||t[8]!==c?(p=[c,m],t[7]=m,t[8]=c,t[9]=p):p=t[9];let[f,y]=p,h;if(t[10]!==n||t[11]!==r||t[12]!==y||t[13]!==f){let e;t[15]!==n||t[16]!==r?(e=async e=>{let[t,a]=e,i=t?.map(async e=>{let t=[...a.map(t=>t.members?.includes(e.id)?t.grants:[])].flat(),i=await ny(e.id,t,r,n);return{...e,granted:i}});return await Promise.all(i||[])},t[15]=n,t[16]=r,t[17]=e):e=t[17];let a=(0,ee.p)([f,y]).pipe((0,et.Z)(e));h=(0,en.x)((0,U.of)(nf),a.pipe((0,z.T)(nb),(0,R.W)(ng))),t[10]=n,t[11]=r,t[12]=y,t[13]=f,t[14]=h}else h=t[14];return(0,eD.J2)(h,nf)}function ng(e){return(0,U.of)({data:[],error:e,loading:!1})}function nb(e){return{error:null,loading:!1,data:(0,eR.A)(e,"displayName")}}function nv(e){return e.map(nx)}function nx(e){return{displayName:e.displayName,id:e.id,sanityUserId:e.sanityUserId,granted:!1}}function nw(e){let{id:t}=e;return t}function n_(e){return e.members?.filter(nS)}function nS(e){return!e.isRobot}function nk(){return(0,u.o)().tools}let nC={original:null,snapshot:null};async function nj(e){let{activeTool:t,client:n,comment:r,currentUser:a,dataset:i,documentId:o,documentRevisionId:l,documentType:s,documentVersionId:c,getIntent:d,getNotificationValue:u,getThreadLength:m,onCreate:p,onCreateError:f,projectId:y,createAddonDataset:h,workspace:g}=e,b=r?.id||(0,tt.A)(),v=a.id,x=(m?.(r.threadId)||0)+1,w;if("task"===r.type&&(w={_id:b,_type:"comment",authorId:v,message:r.message,lastEditedAt:void 0,parentCommentId:r.parentCommentId,status:r.status,threadId:r.threadId,reactions:r.reactions,context:{payload:{workspace:g},notification:r.context.notification,tool:t?.name||""},target:{document:{_ref:o,_type:"reference",_weak:!0}
1,documentVersionId:c,documentType:s}}),"field"===r.type){let{documentTitle:e="",url:n="",workspaceTitle:a="",workspaceName:m=""}=u({commentId:b})||{},p=d?.({id:o,type:s,path:r.fieldPath}),f=function e(t){if(t&&"object"==typeof t&&t.hasOwnProperty("_ref"))return{...t,_weak:!0};if(Array.isArray(t))return t.map(t=>e(t));if(t&&"object"==typeof t){let n={};return Object.keys(t).forEach(r=>{let a=t[r];"object"==typeof a&&a?n[r]=e(a):n[r]=a}),n}return t}(r.contentSnapshot);w={_id:b,_type:"comment",authorId:v,message:r.message,lastEditedAt:void 0,parentCommentId:r.parentCommentId,status:r.status,threadId:r.threadId,reactions:r.reactions,context:{payload:{workspace:g},intent:p,notification:{currentThreadLength:x,documentTitle:e,url:n,workspaceTitle:a,workspaceName:m},tool:t?.name||""},contentSnapshot:f,target:{documentRevisionId:l||"",path:{field:r.fieldPath,selection:r.selection},document:{_dataset:i,_projectId:y,_ref:o,_type:"crossDatasetReference",_weak:!0},documentType:s,documentVersionId:c}}}if(w){if(p?.(w),!n){try{let e=await h();if(!e)throw Error("Failed to create addon dataset client");await e.create(w)}catch(e){throw f?.(w._id,e),e}return}try{await n.create(w)}catch(e){throw f?.(w._id,e),e}}}async function nI(e){var t,n;let{client:r,currentUser:a,id:i,reaction:o,getComment:l,onUpdate:s}=e,c=l?.(i)?.reactions||[],d=c.filter(e=>e.userId===a.id),u=(t=a.id,n=o.shortName,`${t}-${n}`),m=d.find(e=>e._key===u&&"removed"!==e._optimisticState);if(m){let e=c.map(e=>e._key===m._key?{...e,_optimisticState:"removed"}:e);s?.(i,{reactions:e}),await r.patch(i).unset([`reactions[_key=="${u}"]`]).commit();return}if(!m){let e={_key:u,addedAt:new Date().toISOString(),shortName:o.shortName,userId:a.id},t={...e,_optimisticState:"added"},n=c.concat(t).filter(t=>t._key!==e._key||"removed"!==t._optimisticState);s?.(i,{reactions:n}),await r.patch(i).setIfMissing({reactions:[]}).append("reactions",[e]).commit()}}async function nT(e){let{client:t,id:n,onRemove:r}=e;r?.(n),await Promise.all([t.delete({query:`*[_type == "comment" && parentCommentId == "${n}"]`}),t.delete(n)])}let nE={trailing:!0,leading:!1},n$=new Map;async function nA(e){let{client:t,id:n,comment:r,transactionId:a,onUpdate:i}=e,o=a||(0,tt.A)(),l=t?.patch(n).set(r),s=t.transaction().transactionId(o).patch(l);i?.(n,r),r.status?(await s.commit(),await t.patch({query:`*[_type == "comment" && parentCommentId == "${n}"]`}).set({status:r.status}).commit()):await s.commit(),n$.delete(n)}async function nq(e){let{id:t,comment:n,throttled:r}=e,a="message"in n,i={...n,lastEditedAt:new Date().toISOString()},o=a?i:n;r?await (function(e){if(!n$.has(e)){let t=(0,tD.A)(nA,1e3,nE);return n$.set(e,t),t}return n$.get(e)})(t)({...e,comment:o}):await nA({...e,comment:o})}function nD(e){return"string"==typeof e.tool?e.tool:void 0}function nN(e,t){switch(t.type){case"COMMENTS_SET":{let n=t.comments.reduce((e,t)=>({...e,[t._id]:t}),{});return{...e,comments:n}}case"COMMENT_ADDED":{let n=t.payload,r={[n._id]:{...e.comments[n._id],...n,_state:n._state||void 0,_createdAt:n._createdAt||new Date().toISOString()}};return{...e,comments:{...e.comments,...r}}}case"COMMENT_RECEIVED":{let n=t.payload;return{...e,comments:{...e.comments,[n._id]:n}}}case"COMMENT_DELETED":{let{[t.id]:n,...r}=e.comments;return Object.keys(r).forEach(e=>{r[e].parentCommentId===t.id&&delete r[e]}),{...e,comments:r}}case"COMMENT_UPDATED":{let n=t.payload,r=n._id,a=e.comments[r],i=function(e,t){let n={};for(let t of e)n[t._key]={...t};for(let e of t)n[e._key]={...n[e._key],...e};return Object.values(n)}(a?.reactions?.filter(e=>e?._optimisticState)||[],n.reactions||[]),o={...a,...n,reactions:i};return{...e,comments:{...e.comments,[r]:o}}}default:return e}}let nV={comments:{}},nF={events:["welcome","mutation","reconnect"],includeResult:!0,includeAllVersions:!0,visibility:"query",tag:"comments-store"},nO=['_type == "comment"',"target.document._ref == $documentId"],nz=[];function nM(e){let{comments:t,currentUser:n,documentValue:r,schemaType:i,type:l}=e,s=t?.filter(e=>!e.parentCommentId);return"task"===l?s.map(e=>{let n=t?.filter(t=>t.parentCommentId===e._id);return{commentsCount:[e,...n].length,parentComment:e,replies:n,threadId:e.threadId,hasReferencedValue:!1,breadcrumbs:nz,fieldPath:""}}):"field"===l?s.map(e=>{let l=function(e){let{currentUser:t,schemaType:n,fieldPath:r,documentValue:i}=e,l=ej.sH(r),s=[],c=n;return l.forEach((e,n)=>{let r=l.slice(0,n+1),d=l.slice(0,n),u=function e(t,n){let r=ej.sH(n),a=r[0];if(a&&(0,ef.$d)(t)){let n=t?.fields?.find(e=>e.name===a);if(n){let t=ej.dI(r.slice(1));return t?e(n.type,t):n}}}(c,ej.dI([e])),m=e.hasOwnProperty("_key"),p=(0,o.a)(i,d),f=(0,o.a)(i,r),y={document:i,currentUser:t,parent:p,value:f,path:r};if(m&&Array.isArray(p)){let t=function(e,t){if("number"==typeof t)return t;let n=(0,tn.A)(e,t);return -1!==n&&n}(p,e);s.push({invalid:!1===t,isArrayItem:!0,title:"number"==typeof t?`#${Number(t)+1}`:"Unknown array item"});return}if(u?.type){let e=(0,a.ya)(u.type.hidden,y);s.push({invalid:e,isArrayItem:!1,title:(0,a.Yt)(u.type)}),c=u.type;return}if((0,ef.zR)(c)){let t=(0,o.a)(i,d)?._type,n=c?.of?.find(e=>e.name===t),r=n?.fields?.find(t=>t.name===e);if(!t&&f){let t=c?.of?.map(e=>
1e?.fields).filter(Boolean).flat()?.find(t=>t?.name===e),n=(0,a.ya)(t?.type?.hidden,y);t&&(s.push({invalid:n,isArrayItem:!1,title:(0,a.Yt)(t?.type)}),c=t?.type);return}if(!r)return void s.push({invalid:!0,isArrayItem:!1,title:"Unknown field"});let l=(0,a.Yt)(r?.type),u=(0,a.ya)(n?.type?.hidden,y),m=(0,a.ya)(r?.type.hidden,y);return s.push({invalid:u||m,isArrayItem:!1,title:l}),void(c=r?.type)}s.push({invalid:!0,isArrayItem:!1,title:"Unknown field"})}),s}({currentUser:n,documentValue:r,fieldPath:e.target.path?.field||"",schemaType:i}),s=!1;if((0,x.f)(e)&&(s=!!(e.target.path?.selection&&e.target.path.selection.value.some(e=>e.text))),l.some(e=>e.invalid))return;let c=t?.filter(t=>t.parentCommentId===e._id),d=s;return{breadcrumbs:l,commentsCount:[e,...c].length,fieldPath:e.target.path?.field||"",parentComment:e,replies:c,threadId:e.threadId,hasReferencedValue:d}}).filter(Boolean):nz}let nL=[],nP={open:nL,resolved:nL},nR=(0,O.memo)(function(e){let t,n,r,o=(0,eu.c)(88),{children:l,documentId:s,documentType:c,isCommentsOpen:d,onCommentsOpen:m,sortOrder:y,type:h,getCommentLink:g,onClearSelectedComment:b,selectedCommentId:v,isConnecting:x,onPathOpen:S,releaseId:k,mentionsDisabled:C}=e,j=(0,_.t)(),[I,T]=(0,O.useState)("open"),{client:E,createAddonDataset:$,isCreatingDataset:A}=(0,w.t)(),q;o[0]===s?q=o[1]:(q=(0,p.l)(s),o[0]=s,o[1]=q);let D=q,N=nu(D,c,"low",k),V=(0,i.Zt)(),F;o[2]!==c||o[3]!==V?(F=V.get(c),o[2]=c,o[3]=V,o[4]=F):F=o[4];let z=F,M=(0,f.n)(),{name:L,dataset:P,projectId:K}=(0,u.c)(),B;e:{if(k){B=N.version;break e}B=N.draft||N.published}let W=B,H=W?._rev,[G]=(0,O.useState)(nU),Z;o[5]===G?Z=o[6]:(Z=e=>{G.delete(e)},o[5]=G,o[6]=Z);let J=Z,Y;o[7]!==E||o[8]!==s||o[9]!==J||o[10]!==k||o[11]!==G?(Y={documentId:s,releaseId:k,client:E,transactionsIdMap:G,onLatestTransactionIdReceived:J},o[7]=E,o[8]=s,o[9]=J,o[10]=k,o[11]=G,o[12]=Y):Y=o[12];let{dispatch:Q,data:X,error:ee,loading:et}=function(e){let t,n,r,a=(0,eu.c)(33),{client:i,documentId:o,onLatestTransactionIdReceived:l,transactionsIdMap:s,releaseId:c}=e,d=c?"target.documentVersionId==$documentVersionId":"!defined(target.documentVersionId)",u;a[0]===d?u=a[1]:(u=[...nO,d],a[0]=d,a[1]=u);let m=u.join(" && "),f=`*[${m}] {
2  _createdAt,
3  _id,
4  authorId,
5  contentSnapshot,
6  context,
7  lastEditedAt,
8  message,
9  parentCommentId,
10  reactions,
11  status,
12  target,
13  threadId
14} | order(_createdAt desc)`,[y,h]=(0,O.useReducer)(nN,nV),[g,b]=(0,O.useState)(null!==i),[v,x]=(0,O.useState)(null),w=(0,O.useRef)(!1),_;a[2]===o?_=a[3]:(_=(0,p.l)(o),a[2]=o,a[3]=_),a[4]===c?t=a[5]:(t=c?{documentVersionId:c}:{},a[4]=c,a[5]=t),a[6]!==_||a[7]!==t?(n={documentId:_,...t},a[6]=_,a[7]=t,a[8]=n):n=a[8];let S=n,k;a[9]!==i||a[10]!==S||a[11]!==f?(k=async()=>{if(!i)return void b(!1);try{let e=await i.fetch(f,S);h({type:"COMMENTS_SET",comments:e}),b(!1)}catch(e){x(e)}},a[9]=i,a[10]=S,a[11]=f,a[12]=k):k=a[12];let C=k,j;a[13]!==C||a[14]!==l||a[15]!==s?(j=async e=>{if("welcome"!==e.type||w.current||(b(!0),await C(),b(!1),w.current=!0),"reconnect"===e.type&&(b(!0),w.current=!1),"mutation"===e.type){if("appear"===e.transition){let t=e.result;t&&h({type:"COMMENT_RECEIVED",payload:t})}if("disappear"===e.transition&&h({type:"COMMENT_DELETED",id:e.documentId}),"update"===e.transition){let t=e.result,n=e.result?._id||"",r=e.transactionId,a=s.get(n),i=r===a;if(!i&&a)return;t&&(h({type:"COMMENT_UPDATED",payload:t}),i&&l(n))}}},a[13]=C,a[14]=l,a[15]=s,a[16]=j):j=a[16];let I=j,T;e:{let e;if(!i){let e;a[17]===Symbol.for("react.memo_cache_sentinel")?(e=(0,U.of)(),a[17]=e):e=a[17],T=e;break e}if(a[18]!==i.observable||a[19]!==m||a[20]!==S){let t;a[22]===Symbol.for("react.memo_cache_sentinel")?(t=e=>(x(e),(0,U.of)(e)),a[22]=t):t=a[22],e=i.observable.listen(`*[${m}]`,S,nF).pipe((0,R.W)(t)),a[18]=i.observable,a[19]=m,a[20]=S,a[21]=e}else e=a[21];T=e}let E=T,$,A;a[23]!==I||a[24]!==E?($=()=>{let e=E.subscribe(I);return()=>{e?.unsubscribe()}},A=[I,E],a[23]=I,a[24]=E,a[25]=$,a[26]=A):($=a[25],A=a[26]),(0,O.useEffect)($,A),a[27]===y.comments?r=a[28]:(r=Object.values(y.comments),a[27]=y.comments,a[28]=r);let q=r,D;return a[29]!==q||a[30]!==v||a[31]!==g?(D={data:q,dispatch:h,error:v,loading:g},a[29]=q,a[30]=v,a[31]=g,a[32]=D):D=a[32],D}(Y),en=void 0===X?nL:X,er;o[13]===G?er=o[14]:(er=(e,t)=>{G.set(e,t)},o[13]=G,o[14]=er);let ea=er,ei;o[15]===j?ei=o[16]:(ei=e=>"upsell"===j.mode&&"resolved"===e?null:T(e),o[15]=j,o[16]=ei);let eo=ei,el;o[17]===W?el=o[18]:(el={documentValue:W,permission:"read"},o[17]=W,o[18]=el);let es=nh(el),ec;if(o[19]!==M||o[20]!==en||o[21]!==W||o[22]!==z||o[23]!==y||o[24]!==h){t:{if(!M){ec=nP;break t}let e=(0,e5.A)(en,["_createdAt"],[y]),t;if("task"===h)t=nM({comments:e,currentUser:M,documentValue:W,type:h});else{if(!z){ec=nP;break t}t=nM({comments:e,currentUser:M,documentValue:W,schemaType:z,type:h})}ec={open:t.filter(nK),resolved:t.filter(nB)}}o[19]=M,o[20]=en,o[21]=W,o[22]=z,o[23]=y,o[24]=h,o[25]=ec}else ec=o[25];let ed=ec,ef;o[26]===ed.open?ef=o[27]:(ef=e=>ed.open.filter(t=>t.threadId===e).length,o[26]=ed.open,o[27]=ef);let ey=ef,eh;o[28]===en?eh=o[29]:(eh=e=>en?.find(t=>t._id===e),o[28]=en,o[29]=eh);let eg=eh,eb;o[30]!==en||o[31]!==Q?(eb=e=>{let t=en?.find(t=>t._id===e._id)?._state?.type==="createError";Q({type:"COMMENT_ADDED",payload:{...e,_state:t?{type:"createRetrying"}:void 0}})},o[30]=en,o[31]=Q,o[32]=eb):eb=o[32];let ev=eb,ex;o[33]===Q?ex=o[34]:(ex=(e,t)=>{Q({type:"COMMENT_UPDATED",payload:{_id:e,...t}})},o[33]=Q,o[34]=ex);let ew=ex,e_;o[35]===Q?e_=o[36]:(e_=(e,t)=>
14{Q({type:"COMMENT_UPDATED",payload:{_id:e,_state:{error:t,type:"createError"}}})},o[35]=Q,o[36]=e_);let eS=e_,ek;o[37]!==E||o[38]!==$||o[39]!==M||o[40]!==P||o[41]!==H||o[42]!==c||o[43]!==eg||o[44]!==g||o[45]!==ey||o[46]!==ev||o[47]!==eS||o[48]!==ea||o[49]!==ew||o[50]!==K||o[51]!==D||o[52]!==z||o[53]!==k||o[54]!==L?(ek={client:E,currentUser:M,dataset:P,documentId:D,documentVersionId:k,documentRevisionId:H,documentType:c,getComment:eg,getThreadLength:ey,projectId:K,schemaType:z,workspace:L,createAddonDataset:$,onCreate:ev,onCreateError:eS,onUpdate:ew,onTransactionStart:ea,getCommentLink:g},o[37]=E,o[38]=$,o[39]=M,o[40]=P,o[41]=H,o[42]=c,o[43]=eg,o[44]=g,o[45]=ey,o[46]=ev,o[47]=eS,o[48]=ea,o[49]=ew,o[50]=K,o[51]=D,o[52]=z,o[53]=k,o[54]=L,o[55]=ek):ek=o[55];let{operation:eC}=function(e){let t=(0,eu.c)(46),{client:n,currentUser:r,dataset:o,documentId:l,documentRevisionId:s,documentType:c,documentVersionId:d,getComment:m,getThreadLength:p,onCreate:f,onCreateError:y,onRemove:h,onTransactionStart:g,onUpdate:b,projectId:v,createAddonDataset:x,workspace:w,getCommentLink:_}=e,S=(0,O.useContext)(ep.io),k=(0,tr.ks)(nD),C=nk(),j;if(t[0]!==k||t[1]!==C){let e;t[3]===k?e=t[4]:(e=e=>e.name===k,t[3]=k,t[4]=e),j=C.find(e),t[0]=k,t[1]=C,t[2]=j}else j=t[2];let I=j,T;t[5]!==l||t[6]!==c||t[7]!==d||t[8]!==_?(T={documentId:l,documentType:c,getCommentLink:_,documentVersionId:d},t[5]=l,t[6]=c,t[7]=d,t[8]=_,t[9]=T):T=t[9];let{getNotificationValue:E}=function(e){let t=(0,eu.c)(18),n;t[0]===e?n=t[1]:(n=e||{},t[0]=e,t[1]=n);let{documentId:r,documentType:o,getCommentLink:l,documentVersionId:s}=n,c=(0,i.Zt)(),d;t[2]!==o||t[3]!==c?(d=c.get(o),t[2]=o,t[3]=c,t[4]=d):d=t[4];let m=d,{title:p,name:f}=(0,u.c)(),y=(0,i.r)(),h;e:{let e;if(!r||!m){let e;t[5]===Symbol.for("react.memo_cache_sentinel")?(e=(0,U.of)(nC),t[5]=e):e=t[5],h=e;break e}t[6]!==r||t[7]!==y||t[8]!==s||t[9]!==m?(e=(0,a.vn)(y,m,r,s?[s,"drafts"]:["drafts"]),t[6]=r,t[7]=y,t[8]=s,t[9]=m,t[10]=e):e=t[10],h=e}let{snapshot:g,original:b}=(0,eD.J2)(h,nC),v=g?.title||b?.title||"Sanity document",x;t[11]!==v||t[12]!==l||t[13]!==f||t[14]!==p?(x=e=>{let{commentId:t}=e;return{documentTitle:v,url:l?.(t),workspaceTitle:p,workspaceName:f}},t[11]=v,t[12]=l,t[13]=f,t[14]=p,t[15]=x):x=t[15];let w=x,_;return t[16]===w?_=t[17]:(_={getNotificationValue:w},t[16]=w,t[17]=_),_}(T),$;t[10]!==I||t[11]!==n||t[12]!==x||t[13]!==r||t[14]!==o||t[15]!==l||t[16]!==s||t[17]!==c||t[18]!==d||t[19]!==S||t[20]!==E||t[21]!==p||t[22]!==f||t[23]!==y||t[24]!==v||t[25]!==w?($=async e=>{r?.id&&await nj({activeTool:I,client:n,comment:e,currentUser:r,dataset:o,documentId:l,documentRevisionId:s,documentType:c,documentVersionId:d,getIntent:S,getNotificationValue:E,getThreadLength:p,onCreate:f,onCreateError:y,projectId:v,createAddonDataset:x,workspace:w})},t[10]=I,t[11]=n,t[12]=x,t[13]=r,t[14]=o,t[15]=l,t[16]=s,t[17]=c,t[18]=d,t[19]=S,t[20]=E,t[21]=p,t[22]=f,t[23]=y,t[24]=v,t[25]=w,t[26]=$):$=t[26];let A=$,q;t[27]!==n||t[28]!==h?(q=async e=>{n&&await nT({client:n,id:e,onRemove:h})},t[27]=n,t[28]=h,t[29]=q):q=t[29];let D=q,N;t[30]!==n||t[31]!==g||t[32]!==b?(N=async(e,t,r)=>{if(!n)return;let{throttled:a}=r||{},i=(0,tt.A)();g(e,i),await nq({client:n,comment:t,throttled:a,id:e,onUpdate:b,transactionId:i})},t[30]=n,t[31]=g,t[32]=b,t[33]=N):N=t[33];let V=N,F;t[34]!==n||t[35]!==r||t[36]!==m||t[37]!==b?(F=async(e,t)=>{n&&r?.id&&await nI({client:n,currentUser:r,id:e,reaction:t,getComment:m,onUpdate:b})},t[34]=n,t[35]=r,t[36]=m,t[37]=b,t[38]=F):F=t[38];let z=F,M;t[39]!==A||t[40]!==z||t[41]!==D||t[42]!==V?(M={create:A,react:z,remove:D,update:V},t[39]=A,t[40]=z,t[41]=D,t[42]=V,t[43]=M):M=t[43];let L=M,P;return t[44]===L?P=t[45]:(P={operation:L},t[44]=L,t[45]=P),P}(ek),ej=et||A||x||!1,eI;o[56]!==ee||o[57]!==ej||o[58]!==ed?(eI={data:ed,error:ee,loading:ej},o[56]=ee,o[57]=ej,o[58]=ed,o[59]=eI):eI=o[59],o[60]!==eC.create||o[61]!==eC.react||o[62]!==eC.remove||o[63]!==eC.update?(t={create:eC.create,react:eC.react,remove:eC.remove,update:eC.update},o[60]=eC.create,o[61]=eC.react,o[62]=eC.remove,o[63]=eC.update,o[64]=t):t=o[64],o[65]!==es||o[66]!==C?(n={...es,disabled:C},o[65]=es,o[66]=C,o[67]=n):n=o[67],o[68]!==s||o[69]!==c||o[70]!==eg||o[71]!==g||o[72]!==eo||o[73]!==d||o[74]!==x||o[75]!==A||o[76]!==b||o[77]!==m||o[78]!==S||o[79]!==v||o[80]!==I||o[81]!==eI||o[82]!==t||o[83]!==n?(r={documentId:s,documentType:c,isCreatingDataset:A,status:I,setStatus:eo,getComment:eg,getCommentLink:g,onClearSelectedComment:b,selectedCommentId:v,isCommentsOpen:d,onCommentsOpen:m,isConnecting:x,onPathOpen:S,comments:eI,operation:t,mentionOptions:n},o[68]=s,o[69]=c,o[70]=eg,o[71]=g,o[72]=eo,o[73]=d,o[74]=x,o[75]=A,o[76]=b,o[77]=m,o[78]=S,o[79]=v,o[80]=I,o[81]=eI,o[82]=t,o[83]=n,o[84]=r):r=o[84];let eT=r,eE;return o[85]!==l||o[86]!==eT?(eE=(0,em.jsx)(ep.eP.Provider,{value:eT,children:l}),o[85]=l,o[86]=eT,o[87]=eE):eE=o[87],eE});function nU(){return new Map}function nK(e){return"open"===e.parentComment.status}function nB(e){return"resolved"===e.parentComment.status}let nW={original:null,snapshot:null};async function nH(e){let{activeTool:t,client:n,comment:r,currentUser:a,versionId:i,documentRevisionId:o,documentType:l,getIntent:s,getNotificationValue:c,getThreadLength:d,onCreate:u,onCreateError:m,workspace:p}=e;if(!n||!r.message)return;let f=a.sanityUserId;if(!f)return;let y=r?.id||(0,tt.A)(),h=(d?.(r.threadId)||0)+1,g=n.collaboration.comments.getTargetDocumentRef(i),b=r.message.filter(ef.L4),v,x;if("task"===r.type&&(v={_id:y,_type:"sanity.comment",_system:{createdBy:f},message:r.message,lastEditedAt:void 0,parentCommentId:r.parentCommentId,status:r.status,threadId:r.threadId,reactions:r.reactions,context:{payload:{workspace:p},notification:r.context.notification,tool:t?.name||""},target:{document:{_ref:g,_type:"globalDocumentReference",_weak:!0}
14,sourceDocumentId:i,documentType:l}},x=r.parentCommentId?{_id:y,message:b,parentCommentId:r.parentCommentId,context:{...v.context}}:{_id:y,message:b,threadId:r.threadId,context:{...v.context},target:{documentId:i,documentType:l}}),"field"===r.type){let{documentTitle:e="",url:n="",workspaceTitle:a="",workspaceName:d=""}=c({commentId:y})||{},u=s?.({id:i,type:l,path:r.fieldPath}),m=function e(t){if(t&&"object"==typeof t&&t.hasOwnProperty("_ref"))return{...t,_weak:!0};if(Array.isArray(t))return t.map(t=>e(t));if(t&&"object"==typeof t){let n={};return Object.keys(t).forEach(r=>{let a=t[r];"object"==typeof a&&a?n[r]=e(a):n[r]=a}),n}return t}(r.contentSnapshot);v={_id:y,_type:"sanity.comment",_system:{createdBy:f},message:r.message,lastEditedAt:void 0,parentCommentId:r.parentCommentId,status:r.status,threadId:r.threadId,reactions:r.reactions,context:{payload:{workspace:p},intent:u,notification:{currentThreadLength:h,documentTitle:e,url:n,workspaceTitle:a,workspaceName:d},tool:t?.name||""},contentSnapshot:m,target:{documentRevisionId:o||"",path:{field:r.fieldPath,selection:r.selection},document:{_ref:g,_type:"globalDocumentReference",_weak:!0},documentType:l,sourceDocumentId:i}};let w={documentId:i,documentType:l,documentRevisionId:o,path:r.fieldPath};x=r.parentCommentId?{_id:y,message:b,parentCommentId:r.parentCommentId,context:{...v.context}}:{_id:y,message:b,threadId:r.threadId,context:{...v.context},target:r.range?{...w,range:r.range,fieldValue:r.fieldValue}:w}}if(v&&x){u?.(v);try{await n.collaboration.comments.create(x)}catch(e){throw m?.(v._id,e),e}}}async function nG(e){var t;let{client:n,currentUser:r,id:a,reaction:i,getComment:o,onUpdate:l}=e,s=r.sanityUserId;if(!s)return;let c=o?.(a)?.reactions||[],d=c.filter(e=>e.userId===s),u=(t=i.shortName,`${s}-${t}`),m=d.find(e=>e._key===u&&"removed"!==e._optimisticState);if(m){let e=c.map(e=>e._key===m._key?{...e,_optimisticState:"removed"}:e);l?.(a,{reactions:e}),await n.collaboration.comments.removeReaction(a,i.shortName);return}if(!m){let e={_key:u,addedAt:new Date().toISOString(),shortName:i.shortName,userId:s},t={...e,_optimisticState:"added"},r=c.concat(t).filter(t=>t._key!==e._key||"removed"!==t._optimisticState);l?.(a,{reactions:r}),await n.collaboration.comments.addReaction(a,i.shortName)}}async function nZ(e){let{client:t,id:n,onRemove:r}=e;r?.(n),await t.collaboration.comments.delete(n)}let nJ={trailing:!0,leading:!1},nY=new Map;async function nQ(e){let{client:t,id:n,comment:r,transactionId:a,onUpdate:i}=e,o=a||(0,tt.A)();i?.(n,r);let{message:l,status:s}=r;await t.collaboration.comments.update(n,{...l&&{message:l.filter(ef.L4)},...s&&{status:s}},{transactionId:o}),nY.delete(n)}async function nX(e){let{id:t,comment:n,throttled:r}=e,a="message"in n,i={...n,lastEditedAt:new Date().toISOString()},o=a?i:n;r?await (function(e){if(!nY.has(e)){let t=(0,tD.A)(nQ,1e3,nJ);return nY.set(e,t),t}return nY.get(e)})(t)({...e,comment:o}):await nQ({...e,comment:o})}async function n0({client:e,id:t,onUpdate:n,transactionId:r,optimisticUpdate:a,...i}){n?.(t,a),await e.collaboration.comments.update(t,null===i.range?{range:null}:{range:i.range,fieldValue:i.fieldValue},{transactionId:r})}function n1(e){return"string"==typeof e.tool?e.tool:void 0}let n2=['_type == "sanity.comment"',"target.document._ref == $gdr"];function n3(e,t){switch(t.type){case"COMMENTS_SET":{let n=t.comments.reduce((e,t)=>({...e,[t._id]:t}),{});return{...e,comments:n}}case"COMMENT_ADDED":{let n=t.payload,r={[n._id]:{...e.comments[n._id],...n,_state:n._state||void 0,_createdAt:n._createdAt||new Date().toISOString()}};return{...e,comments:{...e.comments,...r}}}case"COMMENT_RECEIVED":{let n=t.payload;return{...e,comments:{...e.comments,[n._id]:n}}}case"COMMENT_DELETED":{let{[t.id]:n,...r}=e.comments;return Object.keys(r).forEach(e=>{r[e].parentCommentId===t.id&&delete r[e]}),{...e,comments:r}}case"COMMENT_UPDATED":{let n=t.payload,r=n._id,a=e.comments[r],i=function(e,t){let n={};for(let t of e)n[t._key]={...t};for(let e of t)n[e._key]={...n[e._key],...e};return Object.values(n)}(a?.reactions?.filter(e=>e?._optimisticState)||[],n.reactions||[]),o={...a,...n,reactions:i};return{...e,comments:{...e.comments,[r]:o}}}default:return e}}let n4={comments:{}},n5={events:["welcome","mutation","reconnect"],includeResult:!0,includeAllVersions:!0,visibility:"query",tag:"comments-store"},n6=[];
14function n7(e){let{comments:t,currentUser:n,documentValue:r,schemaType:i,type:l}=e,s=t?.filter(e=>!e.parentCommentId);return"task"===l?s.map(e=>{let n=t?.filter(t=>t.parentCommentId===e._id);return{commentsCount:[e,...n].length,parentComment:e,replies:n,threadId:e.threadId,hasReferencedValue:!1,breadcrumbs:n6,fieldPath:""}}):"field"===l?s.map(e=>{let l=function(e){let{currentUser:t,schemaType:n,fieldPath:r,documentValue:i}=e,l=ej.sH(r),s=[],c=n;return l.forEach((e,n)=>{let r=l.slice(0,n+1),d=l.slice(0,n),u=function e(t,n){let r=ej.sH(n),a=r[0];if(a&&(0,ef.$d)(t)){let n=t?.fields?.find(e=>e.name===a);if(n){let t=ej.dI(r.slice(1));return t?e(n.type,t):n}}}(c,ej.dI([e])),m=e.hasOwnProperty("_key"),p=(0,o.a)(i,d),f=(0,o.a)(i,r),y={document:i,currentUser:t,parent:p,value:f,path:r};if(m&&Array.isArray(p)){let t=function(e,t){if("number"==typeof t)return t;let n=(0,tn.A)(e,t);return -1!==n&&n}(p,e);s.push({invalid:!1===t,isArrayItem:!0,title:"number"==typeof t?`#${Number(t)+1}`:"Unknown array item"});return}if(u?.type){let e=(0,a.ya)(u.type.hidden,y);s.push({invalid:e,isArrayItem:!1,title:(0,a.Yt)(u.type)}),c=u.type;return}if((0,ef.zR)(c)){let t=(0,o.a)(i,d)?._type,n=c?.of?.find(e=>e.name===t),r=n?.fields?.find(t=>t.name===e);if(!t&&f){let t=c?.of?.map(e=>e?.fields).filter(Boolean).flat()?.find(t=>t?.name===e),n=(0,a.ya)(t?.type?.hidden,y);t&&(s.push({invalid:n,isArrayItem:!1,title:(0,a.Yt)(t?.type)}),c=t?.type);return}if(!r)return void s.push({invalid:!0,isArrayItem:!1,title:"Unknown field"});let l=(0,a.Yt)(r?.type),u=(0,a.ya)(n?.type?.hidden,y),m=(0,a.ya)(r?.type.hidden,y);return s.push({invalid:u||m,isArrayItem:!1,title:l}),void(c=r?.type)}s.push({invalid:!0,isArrayItem:!1,title:"Unknown field"})}),s}({currentUser:n,documentValue:r,fieldPath:e.target.path?.field||"",schemaType:i}),s=!1;if((0,k.l)(e)&&(s=!!(e.target.path?.selection&&e.target.path.selection.value.some(e=>{var t;let n,r;return n=(t=e.text).indexOf(C.t[0]),r=t.indexOf(C.t[1]),-1===n||-1===r?!!t:r>n+1}))),l.some(e=>e.invalid))return;let c=t?.filter(t=>t.parentCommentId===e._id),d=s;return{breadcrumbs:l,commentsCount:[e,...c].length,fieldPath:e.target.path?.field||"",parentComment:e,replies:c,threadId:e.threadId,hasReferencedValue:d}}).filter(Boolean):n6}let n8=[],n9={open:n8,resolved:n8},re=(0,O.memo)(function(e){let t,n,r=(0,eu.c)(102),{children:o,groupId:l,versionId:s,documentType:c,isCommentsOpen:d,onCommentsOpen:y,sortOrder:h,type:g,getCommentLink:b,onClearSelectedComment:x,selectedCommentId:_,isConnecting:k,onPathOpen:C,mentionsDisabled:j}=e,I=(0,S.t)(),{selectedReleaseId:T,selectedVariantName:E}=(0,m.nt)(),[$,A]=(0,O.useState)("open"),q;r[0]===l?q=r[1]:(q=(0,p.l)(l),r[0]=l,r[1]=q);let D=q,N;r[2]===s?N=r[3]:(N=(0,p.y)(s)?(0,p.u)(s):void 0,r[2]=s,r[3]=N);let V=N,F=!!(T||E),z;r[4]!==F||r[5]!==g||r[6]!==s?(z="task"===g||!F||(0,p.y)(s),r[4]=F,r[5]=g,r[6]=s,r[7]=z):z=r[7];let M=z,L=nu(D,c,"low",V),P=(0,i.Zt)(),K;r[8]!==c||r[9]!==P?(K=P.get(c),r[8]=c,r[9]=P,r[10]=K):K=r[10];let B=K,W=(0,f.n)(),{name:H}=(0,u.c)(),G=(0,w.t)(),Z;r[11]===G.client?Z=r[12]:(Z=G.client?.config().dataset,r[11]=G.client,r[12]=Z);let J="task"===g?Z??null:void 0,Y="task"===g&&!G.ready,Q;r[13]!==J||r[14]!==Y?(Q={dataset:J,loading:Y},r[13]=J,r[14]=Y,r[15]=Q):Q=r[15];let{client:X,loading:ee}=function(e){let t=(0,eu.c)(10),n;t[0]===e?n=t[1]:(n=void 0===e?{}:e,t[0]=e,t[1]=n);let r=n,{projectId:a,dataset:i}=(0,u.c)(),o;t[2]===Symbol.for("react.memo_cache_sentinel")?(o={apiVersion:"vX"},t[2]=o):o=t[2];let l=(0,u.i)(o),{value:s,loading:c}=(0,v.O)(),d=void 0===r.dataset?i:r.dataset,m;e:{let e;if(!s||!a||!d){m=null;break e}t[3]!==d||t[4]!==s||t[5]!==l?(e=l.withConfig({collaboration:{organizationId:s},dataset:d}),t[3]=d,t[4]=s,t[5]=l,t[6]=e):e=t[6],m=e}let p=m,f=c||!!r.loading,y;return t[7]!==p||t[8]!==f?(y={client:p,loading:f},t[7]=p,t[8]=f,t[9]=y):y=t[9],y}(Q),et;e:{if(V){et=L.version;break e}et=L.draft||L.published}let en=et,er=en?._rev,[ea]=(0,O.useState)(rt),ei;r[16]===ea?ei=r[17]:(ei=e=>{ea.delete(e)},r[16]=ea,r[17]=ei);let eo=ei,el;r[18]!==X||r[19]!==M||r[20]!==l||r[21]!==eo||r[22]!==ea||r[23]!==s?(el={groupId:l,versionId:s,client:X,transactionsIdMap:ea,onLatestTransactionIdReceived:eo,ready:M},r[18]=X,r[19]=M,r[20]=l,r[21]=eo,r[22]=ea,r[23]=s,r[24]=el):el=r[24];let{dispatch:es,data:ec,error:ed,loading:ef}=function(e){let t,n,r=(0,eu.c)(34),{client:a,groupId:i,versionId:o,onLatestTransactionIdReceived:l,transactionsIdMap:s,ready:c}=e,d=void 0===c||c,[u,m]=(0,O.useReducer)(n3,n4),[f,y]=(0,O.useState)(null!==a&&d),[h,g]=(0,O.useState)(null),b=(0,O.useRef)(!1),v;r[0]!==a?.collaboration.comments||r[1]!==i?(v=a?.collaboration.comments.getTargetDocumentRef(i)??null,r[0]=a?.collaboration.comments,r[1]=i,r[2]=v):v=r[2];let x=v,w;
14r[3]!==x||r[4]!==o?(w=function(e){let{gdr:t,versionId:n}=e,r=function(e){if((0,p.h)(e)||(0,p.g)(e)){let t=(0,p.l)(e);return{filter:"target.sourceDocumentId in [$publishedDocumentId, $draftDocumentId]",params:{publishedDocumentId:t,draftDocumentId:(0,p.s)(t)}}}return{filter:"target.sourceDocumentId == $versionId",params:{versionId:e}}}(n);return{query:`*[${[...n2,r.filter].join(" && ")}] {
15  _createdAt,
16  _id,
17  _rev,
18  _type,
19  _system,
20  contentSnapshot,
21  context,
22  lastEditedAt,
23  message,
24  parentCommentId,
25  reactions,
26  status,
27  target,
28  threadId
29} | order(_createdAt desc)`,params:{gdr:t,...r.params}}}({gdr:x,versionId:o}),r[3]=x,r[4]=o,r[5]=w):w=r[5];let{query:_,params:S}=w,k;r[6]===S?k=r[7]:(k=JSON.stringify(S),r[6]=S,r[7]=k);let C=`${_}:${k}:${d}`,[j,I]=(0,O.useState)(C);j!==C&&(I(C),m({type:"COMMENTS_SET",comments:[]}),y(!!(a&&x&&d)),g(null)),r[8]!==a||r[9]!==x||r[10]!==S||r[11]!==_||r[12]!==d?(t=async()=>{if(!a||!x||!d)return void y(!1);try{let e=await a.collaboration.comments.fetch(_,S);m({type:"COMMENTS_SET",comments:e}),g(null),y(!1)}catch(e){g(e)}},r[8]=a,r[9]=x,r[10]=S,r[11]=_,r[12]=d,r[13]=t):t=r[13];let T=t,E;r[14]!==T||r[15]!==l||r[16]!==s?(E=async e=>{if("welcome"!==e.type||b.current||(y(!0),await T(),y(!1),b.current=!0),"reconnect"===e.type&&(y(!0),b.current=!1),"mutation"===e.type){if("appear"===e.transition){let t=e.result;if(!t)return;let n=s.get(t._id);if(n&&e.transactionId!==n)return;m({type:"COMMENT_RECEIVED",payload:t})}if("disappear"===e.transition&&m({type:"COMMENT_DELETED",id:e.documentId}),"update"===e.transition){let t=e.result,n=e.result?._id||"",r=e.transactionId,a=s.get(n),i=r===a;if(!i&&a)return;t&&(m({type:"COMMENT_UPDATED",payload:t}),i&&l(n))}}},r[14]=T,r[15]=l,r[16]=s,r[17]=E):E=r[17];let $=E,A;e:{let e;if(!a||!x||!d){let e;r[18]===Symbol.for("react.memo_cache_sentinel")?(e=(0,U.of)(),r[18]=e):e=r[18],A=e;break e}if(r[19]!==a.collaboration.comments||r[20]!==S||r[21]!==_){let t;r[23]===Symbol.for("react.memo_cache_sentinel")?(t=e=>(g(e),(0,U.of)()),r[23]=t):t=r[23],e=a.collaboration.comments.listen(_,S,n5).pipe((0,R.W)(t)),r[19]=a.collaboration.comments,r[20]=S,r[21]=_,r[22]=e}else e=r[22];A=e}let q=A,D,N;r[24]!==$||r[25]!==q?(D=()=>{b.current=!1;let e=q.subscribe($);return()=>{e?.unsubscribe()}},N=[$,q],r[24]=$,r[25]=q,r[26]=D,r[27]=N):(D=r[26],N=r[27]),(0,O.useEffect)(D,N),r[28]===u.comments?n=r[29]:(n=Object.values(u.comments),r[28]=u.comments,r[29]=n);let V=n,F;return r[30]!==V||r[31]!==h||r[32]!==f?(F={data:V,dispatch:m,error:h,loading:f},r[30]=V,r[31]=h,r[32]=f,r[33]=F):F=r[33],F}(el),ey=void 0===ec?n8:ec,eh;r[25]===ea?eh=r[26]:(eh=(e,t)=>{ea.set(e,t)},r[25]=ea,r[26]=eh);let eg=eh,eb;r[27]===I?eb=r[28]:(eb=e=>"upsell"===I.mode&&"resolved"===e?null:A(e),r[27]=I,r[28]=eb);let ev=eb,ex;r[29]===en?ex=r[30]:(ex={documentValue:en,permission:"read"},r[29]=en,r[30]=ex);let ew=nh(ex),e_;r[31]===ew.data?e_=r[32]:(e_=ew.data?.flatMap(rn),r[31]=ew.data,r[32]=e_);let eS=e_??null,ek;r[33]!==j||r[34]!==ew||r[35]!==eS?(ek={...ew,data:eS,disabled:j},r[33]=j,r[34]=ew,r[35]=eS,r[36]=ek):ek=r[36];let eC=ek,ej;if(r[37]!==W||r[38]!==ey||r[39]!==en||r[40]!==B||r[41]!==h||r[42]!==g){t:{if(!W){ej=n9;break t}let e=(0,e5.A)(ey,["_createdAt"],[h]),t;if("task"===g)t=n7({comments:e,currentUser:W,documentValue:en,type:g});else{if(!B){ej=n9;break t}t=n7({comments:e,currentUser:W,documentValue:en,schemaType:B,type:g})}ej={open:t.filter(rr),resolved:t.filter(ra)}}r[37]=W,r[38]=ey,r[39]=en,r[40]=B,r[41]=h,r[42]=g,r[43]=ej}else ej=r[43];let eI=ej,eT;r[44]===eI.open?eT=r[45]:(eT=e=>eI.open.filter(t=>t.threadId===e).length,r[44]=eI.open,r[45]=eT);let eE=eT,e$;r[46]===ey?e$=r[47]:(e$=e=>ey?.find(t=>t._id===e),r[46]=ey,r[47]=e$);let eA=e$,eq;r[48]!==ey||r[49]!==es?(eq=e=>{let t=ey?.find(t=>t._id===e._id)?._state?.type==="createError";es({type:"COMMENT_ADDED",payload:{...e,_state:t?{type:"createRetrying"}:void 0}})},r[48]=ey,r[49]=es,r[50]=eq):eq=r[50];let eN=eq,eV;r[51]===es?eV=r[52]:(eV=(e,t)=>{es({type:"COMMENT_UPDATED",payload:{_id:e,...t}})},r[51]=es,r[52]=eV);let eF=eV,eO;r[53]===es?eO=r[54]:(eO=(e,t)=>{es({type:"COMMENT_UPDATED",payload:{_id:e,_state:{error:t,type:"createError"}}})},r[53]=es,r[54]=eO);let ez=eO,eM;r[55]!==X||r[56]!==W||r[57]!==er||r[58]!==c||r[59]!==eA||r[60]!==b||r[61]!==eE||r[62]!==eN||r[63]!==ez||r[64]!==eg||r[65]!==eF||r[66]!==B||r[67]!==V||r[68]!==s||r[69]!==H?(eM={client:X,currentUser:W,ver
29sionId:s,documentVersionId:V,documentRevisionId:er,documentType:c,getComment:eA,getThreadLength:eE,schemaType:B,workspace:H,onCreate:eN,onCreateError:ez,onUpdate:eF,onTransactionStart:eg,getCommentLink:b},r[55]=X,r[56]=W,r[57]=er,r[58]=c,r[59]=eA,r[60]=b,r[61]=eE,r[62]=eN,r[63]=ez,r[64]=eg,r[65]=eF,r[66]=B,r[67]=V,r[68]=s,r[69]=H,r[70]=eM):eM=r[70];let{operation:eL}=function(e){let t=(0,eu.c)(47),{client:n,currentUser:r,versionId:o,documentRevisionId:l,documentType:s,documentVersionId:c,getComment:d,getThreadLength:m,onCreate:p,onCreateError:f,onRemove:y,onTransactionStart:h,onUpdate:g,workspace:b,getCommentLink:v}=e,x=(0,O.useContext)(ep.io),w=(0,tr.ks)(n1),_=nk(),S;if(t[0]!==w||t[1]!==_){let e;t[3]===w?e=t[4]:(e=e=>e.name===w,t[3]=w,t[4]=e),S=_.find(e),t[0]=w,t[1]=_,t[2]=S}else S=t[2];let k=S,C;t[5]!==s||t[6]!==c||t[7]!==v||t[8]!==o?(C={versionId:o,documentType:s,getCommentLink:v,documentVersionId:c},t[5]=s,t[6]=c,t[7]=v,t[8]=o,t[9]=C):C=t[9];let{getNotificationValue:j}=function(e){let t=(0,eu.c)(18),n;t[0]===e?n=t[1]:(n=e||{},t[0]=e,t[1]=n);let{versionId:r,documentType:o,getCommentLink:l,documentVersionId:s}=n,c=(0,i.Zt)(),d;t[2]!==o||t[3]!==c?(d=c.get(o),t[2]=o,t[3]=c,t[4]=d):d=t[4];let m=d,{title:p,name:f}=(0,u.c)(),y=(0,i.r)(),h;e:{let e;if(!r||!m){let e;t[5]===Symbol.for("react.memo_cache_sentinel")?(e=(0,U.of)(nW),t[5]=e):e=t[5],h=e;break e}t[6]!==y||t[7]!==s||t[8]!==m||t[9]!==r?(e=(0,a.vn)(y,m,r,s?[s,"drafts"]:["drafts"]),t[6]=y,t[7]=s,t[8]=m,t[9]=r,t[10]=e):e=t[10],h=e}let{snapshot:g,original:b}=(0,eD.J2)(h,nW),v=g?.title||b?.title||"Sanity document",x;t[11]!==v||t[12]!==l||t[13]!==f||t[14]!==p?(x=e=>{let{commentId:t}=e;return{documentTitle:v,url:l?.(t),workspaceTitle:p,workspaceName:f}},t[11]=v,t[12]=l,t[13]=f,t[14]=p,t[15]=x):x=t[15];let w=x,_;return t[16]===w?_=t[17]:(_={getNotificationValue:w},t[16]=w,t[17]=_),_}(C),I;t[10]!==k||t[11]!==n||t[12]!==r||t[13]!==l||t[14]!==s||t[15]!==x||t[16]!==j||t[17]!==m||t[18]!==p||t[19]!==f||t[20]!==o||t[21]!==b?(I=async e=>{r?.sanityUserId&&n&&await nH({activeTool:k,client:n,comment:e,currentUser:r,versionId:o,documentRevisionId:l,documentType:s,getIntent:x,getNotificationValue:j,getThreadLength:m,onCreate:p,onCreateError:f,workspace:b})},t[10]=k,t[11]=n,t[12]=r,t[13]=l,t[14]=s,t[15]=x,t[16]=j,t[17]=m,t[18]=p,t[19]=f,t[20]=o,t[21]=b,t[22]=I):I=t[22];let T=I,E;t[23]!==n||t[24]!==y?(E=async e=>{n&&await nZ({client:n,id:e,onRemove:y})},t[23]=n,t[24]=y,t[25]=E):E=t[25];let $=E,A;t[26]!==n||t[27]!==h||t[28]!==g?(A=async(e,t,r)=>{if(!n)return;let{throttled:a}=r||{},i=(0,tt.A)();h(e,i),await nX({client:n,comment:t,throttled:a,id:e,onUpdate:g,transactionId:i})},t[26]=n,t[27]=h,t[28]=g,t[29]=A):A=t[29];let q=A,D;t[30]!==n||t[31]!==h||t[32]!==g?(D=async(e,t)=>{if(!n)return;let r=(0,tt.A)();h(e,r),await n0({client:n,id:e,onUpdate:g,transactionId:r,...t})},t[30]=n,t[31]=h,t[32]=g,t[33]=D):D=t[33];let N=D,V;t[34]!==n||t[35]!==r||t[36]!==d||t[37]!==g?(V=async(e,t)=>{n&&r?.sanityUserId&&await nG({client:n,currentUser:r,id:e,reaction:t,getComment:d,onUpdate:g})},t[34]=n,t[35]=r,t[36]=d,t[37]=g,t[38]=V):V=t[38];let F=V,z;t[39]!==T||t[40]!==F||t[41]!==$||t[42]!==q||t[43]!==N?(z={create:T,react:F,remove:$,update:q,updateRange:N},t[39]=T,t[40]=F,t[41]=$,t[42]=q,t[43]=N,t[44]=z):z=t[44];let M=z,L;return t[45]===M?L=t[46]:(L={operation:M},t[45]=M,t[46]=L),L}(eM),eP=!X||!W?.sanityUserId||!M,eR=ef||ee||k||!1,eU;r[71]!==ed||r[72]!==eR||r[73]!==eI?(eU={data:eI,error:ed,loading:eR},r[71]=ed,r[72]=eR,r[73]=eI,r[74]=eU):eU=r[74],r[75]!==eL.create||r[76]!==eL.react||r[77]!==eL.remove||r[78]!==eL.update||r[79]!==eL.updateRange?(t={create:eL.create,react:eL.react,remove:eL.remove,update:eL.update,updateRange:eL.updateRange},r[75]=eL.create,r[76]=eL.react,r[77]=eL.remove,r[78]=eL.update,r[79]=eL.updateRange,r[80]=t):t=r[80],r[81]!==c||r[82]!==eA||r[83]!==b||r[84]!==l||r[85]!==ev||r[86]!==d||r[87]!==k||r[88]!==eC||r[89]!==x||r[90]!==y||r[91]!==C||r[92]!==eP||r[93]!==_||r[94]!==$||r[95]!==eU||r[96]!==t||r[97]!==s?(n={groupId:l,documentType:c,versionId:s,status:$,setStatus:ev,getComment:eA,getCommentLink:b,onClearSelectedComment:x,selectedCommentId:_,isCommentsOpen:d,onCommentsOpen:y,isConnecting:k,onPathOpen:C,comments:eU,operation:t,mentionOptions:eC,readOnly:eP}
29,r[81]=c,r[82]=eA,r[83]=b,r[84]=l,r[85]=ev,r[86]=d,r[87]=k,r[88]=eC,r[89]=x,r[90]=y,r[91]=C,r[92]=eP,r[93]=_,r[94]=$,r[95]=eU,r[96]=t,r[97]=s,r[98]=n):n=r[98];let eK=n,eB;return r[99]!==o||r[100]!==eK?(eB=(0,em.jsx)(ep.CL.Provider,{value:eK,children:o}),r[99]=o,r[100]=eK,r[101]=eB):eB=r[101],eB});function rt(){return new Map}function rn(e){return e.sanityUserId?[{...e,id:e.sanityUserId,projectUserId:e.id}]:[]}function rr(e){return"open"===e.parentComment.status}function ra(e){return"resolved"===e.parentComment.status}var ri=class extends Error{propertyName;path;cause;constructor({propertyName:e,path:t,cause:n}){let r=(0,i.on)(n)&&"string"==typeof n?.message?`: ${n.message}`:"";super(`An error occurred while resolving \`${e}\` from ${t.join(" > ")}${r}`),this.name="ConfigPropertyError",this.propertyName=e,this.cause=n,this.path=t}},ro=class extends Error{name;type;causes;constructor({causes:e,name:t,type:n}){let r=e.filter(Boolean).map(e=>(0,i.on)(e)&&"string"==typeof e?.message?e.message:String(e));super(`Could not resolve ${n}${t?` \`${t}\``:""}:
30${r.map(e=>`	- ${e}`).join("\n")}
31
32`),this.name=t,this.causes=e,this.type=n}};function rl(e){return Math.abs(16807*e.split("").reduce((e,t)=>(e<<5)-e+t.charCodeAt(0)|0,0)%0x7fffffff)/0x7fffffff}let rs=["300","400","500","600","700"];function rc(e){let t,n,r,a=(0,eu.c)(22),{title:i,subtitle:o}=e,l=(0,e_.DP)(),s=l.sanity.fonts.text.family,c=l.sanity.fonts.text.weights.medium,d=`${l.sanity.fonts.text.sizes[1].fontSize}px`,u;a[0]!==o||a[1]!==i?(u=()=>rl(`${i} ${o}`),a[0]=o,a[1]=i,a[2]=u):u=a[2];let[m]=(0,O.useState)(u),p=e8.Cv.filter(rm),f=p[Math.floor(m*p.length)],y;a[3]===m?y=a[4]:(y=()=>rl(m.toString()),a[3]=m,a[4]=y);let[h]=(0,O.useState)(y),g=rs[Math.floor(h*rs.length)],b=e8.OZ[f][g].hex,v;a[5]===i?v=a[6]:(v=i.split(/\s/g).map(ru).filter(Boolean).slice(0,2).map(rd),a[5]=i,a[6]=v);let x=v,w;if(a[7]!==b){let e=(0,tV.e$)(b,.4),t=(0,tV.a)(b,.4);w=(0,tV.Uv)(b,"readable",e)?(0,tV.Uv)(b,"readable",t)?(0,tV.W0)(b):t:e,a[7]=b,a[8]=w}else w=a[8];let _=w,S;return a[9]===b?S=a[10]:(S=(0,em.jsx)("rect",{width:32,height:32,rx:2,fill:b}),a[9]=b,a[10]=S),a[11]!==s||a[12]!==d||a[13]!==c?(t={fontFamily:s,fontWeight:c,fontSize:d,transform:"translateY(1px)"},a[11]=s,a[12]=d,a[13]=c,a[14]=t):t=a[14],a[15]!==x||a[16]!==t||a[17]!==_?(n=(0,em.jsx)("text",{x:"50%",y:"50%",textAnchor:"middle",alignmentBaseline:"middle",dominantBaseline:"middle",fill:_,style:t,children:x}),a[15]=x,a[16]=t,a[17]=_,a[18]=n):n=a[18],a[19]!==S||a[20]!==n?(r=(0,em.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",children:[S,n]}),a[19]=S,a[20]=n,a[21]=r):r=a[21],r}function rd(e){return[...e][0]?.toUpperCase()??""}function ru(e){return e.replace(/[^\p{L}\p{N}]/gu,"")}function rm(e){return"gray"!==e}function rp(e,t){return(0,em.jsx)(rc,{title:e,subtitle:t})}let rf=[{name:"copyField",useAction({path:e}){let t=(0,a.Ur)(),{onCopy:n}=(0,a.ha)(),{t:r}=(0,s.t)("copy-paste"),i=0===e.length,o=r("copy-paste.field-action-copy-button.document.title"),l=r("copy-paste.field-action-copy-button.field.title"),c=i?o:l,d=(0,O.useCallback)(()=>{n(e,t([]),{context:{source:i?"documentFieldAction":"fieldAction"}})},[e,i,n,t]);return{type:"action",icon:tm.CopyIcon,onAction:d,title:c}}},{name:"pasteField",useAction({path:e}){let{t}=(0,s.t)("copy-paste"),n=(0,a.Ur)(),r=0===e.length,i=t("copy-paste.field-action-paste-button.document.title"),o=t("copy-paste.field-action-paste-button.field.title"),l=r?i:o,{onPaste:c}=(0,a.ha)(),d=(0,O.useCallback)(()=>{c(e,n([]),{context:{source:r?"documentFieldAction":"fieldAction"}})},[n,c,e,r]);return{type:"action",icon:tF.ClipboardIcon,onAction:d,title:l}}}],ry=(e,{document:t},n)=>{let r=t?.unstable_fieldActions;if(!r)return e;if("function"==typeof r)return r(e,n);if(Array.isArray(r))return[...e,...r];throw Error(`Expected \`document.unstable_fieldActions\` to be an array or a function, but received ${typeof r}`)},rh=[],rg=[],rb=[],rv=(e,{schema:t},n)=>{let r=t?.types;if(!r)return e;if("function"==typeof r)return r(e,n);if(Array.isArray(r))return[...e,...r];throw Error(`Expected \`schema.types\` to be an array or a function, but received ${(0,a.Si)(r)}`)},rx=async(e,{document:t},n)=>{let r=t?.productionUrl;return r?await r(e,n):e},rw=(e,{tools:t},n)=>{if(!t)return e;if("function"==typeof t)return t(e,n);if(Array.isArray(t))return[...e,...t];throw Error(`Expected \`tools\` to be an array or a function, but received ${(0,a.Si)(t)}`)},r_=(e,{schema:t},n)=>{let r=t?.templates;if(!r)return e;if("function"==typeof r)return r(e,n);if(Array.isArray(r))return[...e,...r];throw Error(`Expected \`schema.templates\` to be an array or a function, but received ${(0,a.Si)(r)}`)},rS=(e,{i18n:t},n)=>{let r=t?.locales;if(!r)return e;if("function"==typeof r)return r(e,n);if(Array.isArray(r))return[...e,...r];throw Error(`Expected \`i18n.locales\` to be an array or a function, but received ${(0,a.Si)(r)}`)},rk=(e,{i18n:t},n)=>{let r=t?.bundles;if(!r)return e;if(Array.isArray(r))return[...e,...r];if("function"==typeof r)return r(e,n);throw Error(`Expected \`i18n.bundles\` to be an array or a function, but received ${typeof r}`)},rC=(e,{document:t},n)=>{let r=t?.badges;if(!r)return e;if("function"==typeof r)return r(e,n);if(Array.isArray(r))return[...e,...r];throw Error(`Expected \`document.badges\` to be an array or a function, but received ${(0,a.Si)(r)}`)},rj=(e,{document:t},n)=>{let r=t?.actions;if(!r)return e;if("function"==typeof r)return r(e,n);if(Array.isArray(r))return[...e,...r];throw Error(`Expected \`document.actions\` to be an array or a function, but received ${(0,a.Si)(r)}`)},rI=(e,{releases:t},n)=>{let r=t?.actions;if(!r)return e;if("function"==typeof r)return r(e,n);if(Array.isArray(r))return[...e,...r];throw Error(`Expected \`releases.actions\` to be an array or a function, but received ${(0,a.Si)(r)}`)},rT=(e,{document:t},n)=>{let r=t?.newDocumentOptions;if(!r)return e;if("function"!=typeof r)throw Error(`Expected \`document.resolveNewDocumentOptions\` to be a function, but received ${(0,a.Si)(r)}`);return r(e,n)},rE=(e,{form:t},n)=>{let r=t?.file?.assetSources;if(!r)return e;if("function"==typeof r)return r(e,n);if(Array.isArray(r))return[...e,...r];throw Error(`Expected \`form.file.assetSources\` to be an array or a function, but received ${(0,a.Si)(r)}`)},r$=e=>{let{config:t,schemaTypeName:n}=e;return(0,m.z)(t,[]).reduce((e,{config:t})=>{let r=t.form?.[n]?.directUploads;if(!r&&"boolean"!=typeof r)return e;if("boolean"==typeof r)return r;throw Error(`Expected \`form.${n}.directUploads\` to be a boolean, but received ${(0,a.Si)(r)}`)},!0)},rA=(e,{form:t},n)=>{let r=t?.image?.assetSources;if(!r)return e;if("function"==typeof r)return r(e,n);if(Array.isArray(r))return[...e,...r];throw Error(`Expected \`form.image.assetSources\` to be an array or a function, but received ${(0,a.Si)(r)}`)},rq=(e,{document:t},n)=>{let r=t?.unstable_languageFilter;if(!r)return e;if("function"==typeof r)return r(e,n);if(Array.isArray(r))return[...e,...r];throw Error(`Expected \`document.unstable_languageFilter\` to be an array or a function, but received ${(0,a.Si)(r)}`)},rD=(e,{document:t},n)=>{let r=t?.inspectors;if(!r)return e;if("function"==typeof r)return r(e,n);if(Array.isArray(r))return[...e,...r];throw Error(`Expected \`document.inspectors\` to be an array or a function, but received ${(0,a.Si)(r)}`)},rN=e=>{let{config:t,context:n,initialValue:r}=e;return(0,m.z)(t,[]).reduce((e,{config:t})=>{let r=t.document?.comments?.enabled??t.document?.unstable_comments?.enabled;if(!r&&"boolean"!=typeof r)return e;if("function"==typeof r)return r(n);if("boolean"==typeof r)return r;throw Error(`Expected \`document.comments.enabled\` to be a boolean or a function, but received ${(0,a.Si)(r)}`)},r)},rV=e=>{let{config:t,initialValue:n}=e;return(0,m.z)(t,[]).reduce((t,{config:n})=>{if(n.beta?.eventsAPI?.enabled)throw Error(`The \`beta.eventsAPI.enabled\` option has been removed. Use \`beta.eventsAPI.${e.key}\` instead.`);let r=n.beta?.eventsAPI?.[e.key];if(void 0===r)return t;if("boolean"==typeof r)return r;throw Error(`Expected \`beta.eventsAPI.${e.key}\` to be a boolean, but received ${(0,a.Si)(r)}`)},n)},rF=e=>{let{config:t,initialValue:n}=e;return(0,m.z)(t,[]).reduce((e,{config:t})=>{let n=t.mediaLibrary?.enabled;if(!n&&"boolean"!=typeof n)return e;if("boolean"==typeof n)return n;throw Error(`Expected \`mediaLibrary.enabled\` to be a boolean, but received ${(0,a.Si)(n)}`)},n)},rO=e=>{let{config:t,initialValue:n}=e;return(0,m.z)(t,[]).reduce((e,{config:t})=>{let n=t.mediaLibrary?.libraryId;if(!n&&"string"!=typeof n)return e;if("string"==typeof n)return n;
32throw Error(`Expected \`mediaLibrary.libraryId\` to be a string, but received ${(0,a.Si)(n)}`)},n)},rz=(e,{document:t})=>{if("boolean"==typeof t?.drafts?.enabled)return t?.drafts?.enabled;if(t?.drafts?.enabled!==void 0)throw Error(`Expected boolean, but received ${(0,a.Si)(t?.drafts?.enabled)}`);return e},rM=(e,{advancedVersionControl:t},n)=>{let r=t?.enabled;if("boolean"==typeof r)return r;if("function"==typeof r)return r(e,n);if(void 0!==r)throw Error(`Expected boolean, but received ${(0,a.Si)(r)}`);return e};function rL({config:e,context:t,initialValue:n,propertyName:r,...a}){let i=(0,m.z)(e,[]);if("reducer"in a)return i.reduce((e,{config:n,path:i})=>{try{return a.reducer(e,n,t)}catch(e){throw new ri({propertyName:r,path:i,cause:e})}},n);let o=a.asyncReducer;return(async()=>{let e=n;for(let{config:n,path:a}of i)try{e=await o(e,n,t)}catch(e){throw new ri({propertyName:r,path:a,cause:e})}return e})()}async function rP(e){let t=await Promise.all(e.map(async e=>({...e,resources:await rR(e)}))),n={};for(let e of t){let t=e.deep??!0,r=e.overwrite??!0;t?function e(t,n,r=!1){for(let a in n){if("__proto__"===a||"constructor"===a)continue;if(!(a in t)){t[a]=n[a];continue}let i=t[a],o=n[a],l=rU(i),s=rU(o);if((l||s)&&r){t[a]=n[a];continue}if(!(l||s)){if(Array.isArray(o)||Array.isArray(i)){r&&(t[a]=o);continue}e(i,o,r)}}return t}(n,e.resources,r):r?Object.assign(n,e.resources):Object.assign({},e.resources,n)}return n}async function rR(e){var t,n;return"function"==typeof e.resources?"default"in(n=t=await e.resources())&&"object"==typeof n.default&&(0,eq.A)(n.default)?t.default:t:e.resources}function rU(e){return"string"==typeof e||e instanceof String}let rK={ns:[a.pr],defaultNS:a.pr,partialBundledLanguages:!0,fallbackLng:a.c.id,lng:a.c.id,debug:s.n,load:"currentOnly",initAsync:!0,interpolation:{escapeValue:!1},react:{bindI18nStore:"added"}};function rB(e){let{bundles:t,...n}=e;return n}let rW=e=>"error"===e.severity,rH=tq.Sj.compile({name:"studio",types:ta.jN});function rG(e){return"object"==typeof e&&e?JSON.stringify(Object.fromEntries(Object.entries(e).sort(([e],[t])=>e.localeCompare(t,"en")).map(([e,t])=>[e,rG(t)]))):`${e}`}(0,eH.GA)(rH);let rZ={authenticated:!1},rJ={authenticated:!0},rY={apiVersion:"v2026-05-04",useCdn:!1,perspective:"raw",requestTagPrefix:"sanity.studio",allowReconfigure:!1,headers:u.t};function rQ(e){return`__studio_auth_token_${e}`}function rX(e){return`__studio_auth_cookie_state_${e}`}function r0(e){return`__studio_unclaimed_${e}`}function r1(){let e=Object.create(null);return{load:function(){return"value"in e?e.value:void 0},store:function(t){void 0===t?delete e.value:e.value=t}}}function r2(e,t,n=r1()){let r=typeof BroadcastChannel>"u"?{postMessage:()=>{},close:()=>{},onmessage:null}:new BroadcastChannel(e),a=new er.t(t?.(n.load()));return n.store(a.getValue()),r.onmessage=e=>{let t=JSON.parse(e.data);a.next(null===t?void 0:t)},{value:a.asObservable(),get:()=>a.getValue(),update(e){n.store(e);let t=JSON.stringify(void 0===e?null:e);r.postMessage(t),a.next(e)},dispose(){r.close(),a.complete()}}}let r3=e_.I4.svg.withConfig({displayName:"GithubRootSvg",componentId:"sc-qn2jck-0"})(({theme:e})=>{let{fg:t}=e.sanity.color.base;return(0,e_.AH)`fill:${t};`}),r4=e_.I4.img.withConfig({displayName:"CustomImage",componentId:"sc-qn2jck-1"})`height:19px;width:19px;object-fit:contain;`;function r5(e){let t=(0,eu.c)(3),{provider:n}=e,r;return t[0]!==n.logo||t[1]!==n.name?(r=n.logo?(0,em.jsx)(r4,{src:n.logo,alt:`Logo for ${n.name}`}):void 0,t[0]=n.logo,t[1]=n.name,t[2]=r):r=t[2],r}let r6={google:()=>{let e=(0,eu.c)(1),t;return e[0]===Symbol.for("react.memo_cache_sentinel")?(t=(0,em.jsxs)("svg",{width:"1em",height:"1em",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 48 48",children:[(0,em.jsx)("path",{d:"M11 24a13 13 0 0 1 .66-4.08l-7.4-5.66a22.18 22.18 0 0 0 0 19.49l7.4-5.67A13 13 0 0 1 11 24z",fill:"#fbbc05"}),(0,em.jsx)("path",{d:"M24 11a12.72 12.72 0 0 1 8.1 2.9l6.4-6.4a22 22 0 0 0-34.24 6.75l7.4 5.66A13 13 0 0 1 24 11z",fill:"#ea4335"}),(0,em.jsx)("path",{d:"M24 37a13 13 0 0 1-12.34-8.92l-7.4 5.66A21.93 21.93 0 0 0 24 46a21 21 0 0 0 14.33-5.48l-7-5.44A13.59 13.59 0 0 1 24 37zm-12.35-8.93l-7.4 5.67 7.4-5.66z",fill:"#34a853"}),(0,em.jsx)("path",{d:"M44.5 20H24v8.5h11.8a9.91 9.91 0 0 1-4.49 6.58l7 5.44C42.37 36.76 45 31.17 45 24a18.25 18.25 0 0 0-.5-4z",fill:"#4285f4"})]}),e[0]=t):t=e[0],t},github:()=>{let e=(0,eu.c)(1),t;return e[0]===Symbol.for("react.memo_cache_sentinel")?(t=(0,em.jsx)(r3,{width:"1em",height:"1em",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 438.55 438.55",children:(0,em.jsx)("path",{d:"M409.13 114.57a218.32 218.32 0 0 0-79.8-79.8Q278.94 5.36 219.27 5.36T109.21 34.77a218.29 218.29 0 0 0-79.8 79.8Q0 165 0 224.63q0 71.67 41.83 128.91t108.06 79.23q7.71 1.43 11.42-2a11.17 11.
3217 0 0 0 3.69-8.57q0-.86-.14-15.42t-.14-25.41l-6.57 1.14a83.77 83.77 0 0 1-15.85 1 120.73 120.73 0 0 1-19.84-2 44.34 44.34 0 0 1-19.11-8.51 36.23 36.23 0 0 1-12.56-17.6l-2.86-6.57a71.34 71.34 0 0 0-9-14.56q-6.14-8-12.42-10.85l-2-1.43a21 21 0 0 1-3.71-3.43 15.66 15.66 0 0 1-2.57-4q-.86-2 1.43-3.29C61.2 310.42 64 310 68 310l5.71.85q5.71 1.14 14.13 6.85a46.08 46.08 0 0 1 13.85 14.84q6.57 11.71 15.85 17.85t18.7 6.14a81.19 81.19 0 0 0 16.27-1.42 56.78 56.78 0 0 0 12.85-4.29q2.57-19.14 14-29.41a195.49 195.49 0 0 1-29.36-5.13 116.52 116.52 0 0 1-26.83-11.14 76.86 76.86 0 0 1-23-19.13q-9.14-11.42-15-30t-5.8-42.81q0-34.55 22.56-58.82-10.57-26 2-58.24 8.28-2.57 24.55 3.85t23.84 11q7.57 4.56 12.13 7.71a206.2 206.2 0 0 1 109.64 0l10.85-6.85a153.65 153.65 0 0 1 26.26-12.56q15.13-5.71 23.13-3.14 12.84 32.26 2.28 58.24 22.55 24.27 22.56 58.82 0 24.27-5.85 43t-15.12 30a79.82 79.82 0 0 1-23.13 19 116.74 116.74 0 0 1-26.84 11.14 195.29 195.29 0 0 1-29.23 5.07q14.8 12.84 14.81 40.58v60.2a11.37 11.37 0 0 0 3.57 8.56q3.57 3.42 11.28 2 66.24-22 108.07-79.23t41.83-128.91q-.03-59.62-29.43-110.05z"})}),e[0]=t):t=e[0],t}},r7="sanity:last_used_provider";async function r8({client:e,providers:t}){if(Array.isArray(t))return t;let{providers:n}=await e.withConfig({token:void 0,withCredentials:!1}).request({url:"/auth/providers"});return t?t(n):n}function r9({loginMethod:e="dual",projectId:t,url:n,redirectPath:r}){let a=new URLSearchParams;return a.set("origin",`${window.location.origin}${r}`),a.set("projectId",t),"token"===e?a.set("withSid","true"):a.set("type",e),`${n}?${a}`}function ae(e){let t,n,r,a,i=(0,eu.c)(7),o;return i[0]===Symbol.for("react.memo_cache_sentinel")?(o={width:"100%"},i[0]=o):o=i[0],i[1]===Symbol.for("react.memo_cache_sentinel")?(t=(0,em.jsx)(eg.Ex,{radius:2,tone:"primary",style:{alignSelf:"start",marginBottom:"8px"},children:"Last used"}),i[1]=t):t=i[1],i[2]===e?n=i[3]:(n=(0,em.jsx)(at,{autoFocus:!0,tone:"primary",...e}),i[2]=e,i[3]=n),i[4]===Symbol.for("react.memo_cache_sentinel")?(r=(0,em.jsx)(ey.n,{size:0,align:"center",style:{margin:"13px 0 13px 0"},children:"OR"}),i[4]=r):r=i[4],i[5]===n?a=i[6]:(a=(0,em.jsxs)(eS.so,{flexDirection:"column",style:o,children:[t,n,r]}),i[5]=n,i[6]=a),a}function at(e){let t,n,r=(0,eu.c)(15),{href:a,provider:i,tone:o,autoFocus:l}=e,s=void 0===o?"default":o,d=void 0!==l&&l,u;r[0]===d?u=r[1]:(u=e=>{d&&e?.focus()},r[0]=d,r[1]=u);let m=u,p;r[2]===i.name?p=r[3]:(p=()=>{localStorage.setItem(r7,i.name)},r[2]=i.name,r[3]=p);let f=p,y=r6[i.name]||r5,h;return r[4]===Symbol.for("react.memo_cache_sentinel")?(h={width:"100%"},r[4]=h):h=r[4],r[5]!==y||r[6]!==i?(t=(0,em.jsx)(y,{provider:i}),r[5]=y,r[6]=i,r[7]=t):t=r[7],r[8]!==m||r[9]!==f||r[10]!==a||r[11]!==i.title||r[12]!==t||r[13]!==s?(n=(0,em.jsx)(c.o,{ref:m,as:"a",href:a,mode:"ghost",size:"large",tone:s,style:h,text:i.title,icon:t,onClick:f}),r[8]=m,r[9]=f,r[10]=a,r[11]=i.title,r[12]=t,r[13]=s,r[14]=n):n=r[14],n}let an=new Set(["sanity.io","www.sanity.io","sanity.work","www.sanity.work"]),ar=e=>{try{let t=new URL(e),n=t.pathname.split("/").filter(Boolean);return"https:"===t.protocol&&an.has(t.hostname)&&n.length>=2&&"claim"===n[n.length-2]}catch{return!1}},aa=()=>{if(typeof window>"u"||"object"!=typeof window.location)return;let e=/token=([^&]{32,})&?/,[,t]=window.location.hash.match(e)||[];if(!t)return;let n=window.location.hash.replace(e,""),r=new URL(window.location.href);return r.hash=n.length>1?n:"",history.replaceState(null,"",r),t},ai=/sid=([^&]{20,})&?/;function ao(){if(typeof window>"u"||"object"!=typeof window.location)return;let e=window.location.hash,[,t]=e.match(ai)||[];if(!t)return;let n=e.replace(ai,""),r=new URL(window.location.href);return r.hash=n.length>1?n:"",history.replaceState(null,"",r),t}let al=ao(),as=()=>{let e=al;return e&&(al=void 0),e};function ac(e){return"string"==typeof e&&!Number.isNaN(new Date(e).getTime())}function ad(e){if(i.x)try{let t=localStorage.getItem(r0(e)),n=t?JSON.parse(t):void 0;return n&&"object"==typeof n&&"claimUrl"in n&&"string"==typeof n.claimUrl&&ar(n.claimUrl)?{claimUrl:n.claimUrl,..."expiresAt"in n&&ac(n.expiresAt)?{expiresAt:n.expiresAt}:{},..."lastLookupAt"in n&&ac(n.lastLookupAt)?{lastLookupAt:n.lastLookupAt}:{}}:void 0}catch{return}}function au(e,t){if(i.x)try{localStorage.setItem(r0(e),JSON.stringify(t))}catch{}}function am(e){if(i.x)try{localStorage.removeItem(r0(e))}catch{}}function ap(e){return`${r0(e)}_snooze`}function af(e){if(i.x)try{return localStorage.getItem(ap(e))??void 0}catch{return}}function ay(e,t){if(i.x)try{localStorage.setItem(ap(e),t)}catch{}}function ah(e){if(i.x)try{localStorage.removeItem(ap(e))}catch{}}function ag(e){return(0,i.on)(e)&&"state"in e&&(0,i.on)(e.state)&&"subscribe"in e.state&&"function"==typeof e.state.subscribe}function ab(e){return["dual","token"].includes(e)}function av(){return r??=(0,tM.c)()}function ax(){return av()?.subscribe("auth.token").pipe((0,R.W)(()=>(0,U.of)(null)))}function aw(){av()?.emit("auth.token.refresh").catch(()=>{})}function a_(e){return"function"==typeof e.withConfig?e.withConfig({requestHandler:void 0}):e}let aS=async(e,t,n,r)=>{let a=a_(e),o=()=>a.request({url:"/users/me",tag:`users.get-current${t?`.${t}`:""}`}).catch(async e=>{if(!(0,i.Xt)(e)){if(r){let t=await r.diagnose(e,a);if("unknown"!==t.type)return void r.onRequestFailure(t,a)}throw e}});try{let e=n?.(),t=e?await e.attempt(o,{retryable:!0}):await o();return"string"==typeof t?.id?t:void 0}catch(e){if((0,i.Wt)(e)&&!e.message){let t=e.request?.url;if(t)throw Error(`Unknown network error attempting to reach ${new URL(t).host}`,{cause:e})}throw e}},ak=e=>a_(e).request({url:"/auth/id",tag:"auth.check-id"}).then(e=>"string"==typeof e?.id?{authenticated:!0,id:e.id}:rZ,e=>{if(e instanceof eV.r&&401===e.statusCode)return rZ;throw e});async function aC(e,t){let{token:n}=await e.request({method:"GET",url:"/auth/fetch",query:{sid:t},tag:"auth.fetch-token"});return n}let aj=(0,eM.A)(e=>(function({clientFactory:e,projectId:t,dataset:n,apiHost:r,loginMethod:a="dual",getSessionId:o,consumeHashToken:l,observeWorkbenchToken:d=()=>void 0,refreshWorkbenchToken:u=()=>{},getRequestErrorHandler:m,getRequestFailureDiagnostics:p,...y}){var h;let g=()=>{let e=(()=>{let e;if(typeof window>"u"||"object"!=typeof window.location)return;let t=window.location.hash.replace(/^#/,"").split("&"),n=t.findIndex(e=>e.startsWith("claim="));if(-1===n)return;let r=t[n].slice(6);t.splice(n,1);let a=new URL(window.location.href);a.hash=t.filter(Boolean).join("&"),history.replaceState(null,"",a);try{e=decodeURIComponent(r)}catch{return}return ar(e)?e:void 0})();e&&ad(t)?.claimUrl!==e&&au(t,{claimUrl:e})},b=(h=rQ(t),r2(`${h}_broadcast`,e=>{ab(a),g();let t=l();return t?{token:t,authenticated:!0}:e},i.x?{load:function(){try{let e=localStorage.getItem(h);return null===e?void 0:JSON.parse(e)}catch(e){console.error(`Failed to parse localstorage value: ${e.message}`);return}},store:function(e){try{void 0===e?localStorage.removeItem(h):localStorage.setItem(h,JSON.stringify(e))}catch(e){console.error(`Failed to persist localstorage value: ${e.message}`)}}}:r1())),x=r2(rX(t),()=>({authenticated:"pending"})),w=e??eF.UU,_={};r?_.apiHost=r:v.C&&(_.apiHost="https://api.sanity.work");let S=w({...rY,..._,projectId:t,dataset:n,withCredentials:!0}),k=b.get(),C=w({...rY,..._,projectId:t,dataset:n,...k?.token?{token:k.token,ignoreBrowserTokenWarning:!0}:{}}),j=w({...rY,..._,projectId:t,dataset:n,...k?.token?{token:k.token,ignoreBrowserTokenWarning:!0}:{withCredentials:!0}}),I="dual"===a?j:"cookie"===a?S:C,T,E;function $(){return E&&performance.now()>E.expiresAt&&(E=void 0),E?.state}async function A(e,t){let n=await aS(e,t,m,p?.());return{client:e,authenticated:!!n?.id,currentUser:n||null}}let q=(0,Q.v)(async()=>{let e=await A(I,"initial");return("cookie"===a||"dual"===a)&&(T=e.authenticated,x.get()?.authenticated==="pending"&&x.update({authenticated:e.authenticated})),$()??e}),D=typeof window>"u"?ea.w:(0,ei.R)(window,"hashchange").pipe((0,X.M)(()=>{g();let e=l();e&&b.update({token:e})}),(0,M.n)(()=>ea.w)),N=(0,H.h)(D,b.value).pipe((0,z.T)(e=>w({...rY,..._,projectId:t,dataset:n,...e?.token?{token:e.token,ignoreBrowserTokenWarning:!0}:{}})),(0,B.t)({bufferSize:1,refCount:!0})),V=(0,H.h)(D,b.value).pipe((0,z.T)(e=>w({...rY,..._,projectId:t,dataset:n,...e?.token?{token:e.token,ignoreBrowserTokenWarning:!0}:{withCredentials:!0}})),(0,B.t)({bufferSize:1,refCount:!0})),F=x.value.pipe((0,eE.p)(e=>
32e?.authenticated!=="pending"),(0,Y.F)(eU.j)),L=F.pipe((0,z.T)(({authenticated:e})=>e?S:void 0)),R=("dual"===a?V:"cookie"===a?L:N).pipe((0,Y.F)()),K="dual"===a?F.pipe((0,Z.i)(1),(0,M.n)(()=>V)):ea.w,J=k?.token??null,ee=ab(a)?b.value.pipe((0,G.s)(1),(0,z.T)(e=>e?.token??null),(0,eE.p)(e=>"string"==typeof e&&e!==J),(0,M.n)(()=>("dual"===a?V:N).pipe((0,G.s)(1)))):ea.w,er="cookie"===a?F.pipe((0,G.s)(1),(0,eE.p)(({authenticated:e})=>e!==T),(0,z.T)(({authenticated:e})=>e?S:void 0)):ea.w,es=(0,en.x)(q,(0,H.h)(R.pipe((0,Z.i)(1)),K,ee,er).pipe((0,et.Z)(async e=>{if(!e)return E=void 0,{client:S,authenticated:!1,currentUser:null};let t=$();return t?(E=void 0,t):A(e,"update")}))),ec=d()?.pipe((0,B.t)({bufferSize:1,refCount:!0})),ed=(ec?ec.pipe((0,M.n)(e=>{if(!e)return(0,U.of)({client:S,authenticated:!1,currentUser:null});let r=w({...rY,..._,projectId:t,dataset:n,token:e,ignoreBrowserTokenWarning:!0});return(0,eo.H)(aS(r,"initial",m,p?.())).pipe((0,z.T)(e=>({client:r,authenticated:!!e?.id,currentUser:e||null})))})):es).pipe((0,W.u)({connector:()=>new el.m(1),resetOnRefCountZero:()=>(0,P.O)(1e3)}));function ep(e,t){let n,r=performance.now(),a=A(t,"callback");return E={state:a,expiresAt:r+1e4},e(),Promise.race([a,new Promise(e=>{n=setTimeout(()=>e(void 0),1e4)})]).finally(()=>clearTimeout(n)).then(e=>({stateSettleDurationMs:Math.round(performance.now()-r),stateSettleTimedOut:void 0===e}))}let ef=!1,eb;async function ev(){let e=performance.now(),t=o();if(ao(),!t)return eb||{loginMethod:a,flow:"already-authenticated",success:!0,durationMs:Math.round(performance.now()-e)};ef=!0;let n=ex(t,e).finally(()=>{ef=!1,eb===n&&(eb=void 0)});return eb=n,n}async function ex(e,r){let i=w({...rY,..._,projectId:t,dataset:n,withCredentials:!0}),o=performance.now(),l;try{l=await aC(i,e)}catch(e){return{loginMethod:a,flow:"exchange",success:!1,durationMs:Math.round(performance.now()-r),exchangeDurationMs:Math.round(performance.now()-o),failureReason:e instanceof Error?e.message:"exchange failed",error:{type:"auth-failed",message:"Failed to exchange session for credentials. Please try logging in again."}}}let s=Math.round(performance.now()-o);if("dual"===a){let e=l?ep(()=>b.update({token:l}),w({...rY,..._,projectId:t,dataset:n,token:l,ignoreBrowserTokenWarning:!0})):void 0;l||b.update({token:l}),e?.catch(()=>{});let o=performance.now(),c=await ak(i),d=Math.round(performance.now()-o),u=Math.round(performance.now()-r);x.update({authenticated:c.authenticated});let m=e?await e:void 0;return{flow:"exchange",loginMethod:a,success:!!l,durationMs:u,exchangeDurationMs:s,probeDurationMs:d,...m,authMethod:c.authenticated?"cookie":"token",failureReason:l?void 0:"token exchange returned empty token"}}if("cookie"===a){let e=performance.now(),t=await ak(i),n=Math.round(performance.now()-e),o=Math.round(performance.now()-r);return t.authenticated?{flow:"exchange",loginMethod:a,success:!0,durationMs:o,exchangeDurationMs:s,probeDurationMs:n,...await ep(()=>x.update({authenticated:!0}),S),authMethod:"cookie"}:(x.update({authenticated:!1}),{loginMethod:a,flow:"exchange",success:!1,durationMs:o,exchangeDurationMs:s,probeDurationMs:n,failureReason:"cookie probe failed in cookie-only mode",error:{type:"cookie-blocked",message:"Authentication could not be completed because this browser appears to block third-party cookies. This studio is configured to use cookie-based authentication only. Try using a different browser, disabling strict cookie blocking, or ask the studio administrator to enable token-based authentication."}})}let c=l?ep(()=>b.update({token:l}),w({...rY,..._,projectId:t,dataset:n,token:l,ignoreBrowserTokenWarning:!0})):void 0;l||b.update({token:l});let d=Math.round(performance.now()-r),u=c?await c:void 0;return{loginMethod:a,flow:"exchange",success:!!l,durationMs:d,exchangeDurationMs:s,...u,authMethod:"token",failureReason:l?void 0:"token exchange returned empty token"}}let ew=!1;async function e_(){ec?u():(ew=!0,E=void 0,await Promise.allSettled([a_(C).request({url:"/auth/logout",method:"POST"}),a_(S).request({url:"/auth/logout",method:"POST"})]),b.update(void 0),x.update({authenticated:!1}))}let ek=function({client$:e,loginMethod:t,redirectOnSingle:n,wasLogout:r,isHandlingCallback:a,...i}){function o(e){if(!e||e.length<=1)return;let t=localStorage.getItem(r7);return e?.find(e=>{let{name:n}=e;return n===t})}return function(l){let d,u,m=(0,eu.c)(47),p,y;m[0]===l?(p=m[1],y=m[2]):({projectId:p,...y}=l,m[0]=l,m[1]=p,m[2]=y);let{t:h}=(0,s.t)(),g=y.redirectPath||y.basePath||"/",b;m[3]===Symbol.for("react.memo_cache_sentinel")?(b={providers:[],isLoading:!0},m[3]=b):b=m[3];let[v,x]=(0,O.useState)(b),[w,_]=(0,O.useState)(null);if(w)throw w;let S=(0,eD.J2)(e,void 0),k;m[4]===S?k=m[5]:(k=async()=>{let e=[];
32if(!S)return[];try{e=await r8({client:S,...i})}catch(e){_(e)}return e},m[4]=S,m[5]=k);let C=k,j,I;m[6]!==S||m[7]!==C?(j=()=>{S&&(async()=>{let e=await C(),t=o(e);x({providers:e,lastUsedProvider:t,isLoading:!1})})()},I=[S,o,C],m[6]=S,m[7]=C,m[8]=j,m[9]=I):(j=m[8],I=m[9]),(0,O.useEffect)(j,I);let{providers:T,lastUsedProvider:E,isLoading:$}=v,A;m[10]!==p||m[11]!==T[0]||m[12]!==T.length||m[13]!==g?(A=n&&!r()&&!a()&&T?.length===1&&T?.[0]&&r9({loginMethod:t,projectId:p,url:T[0].url,redirectPath:g}),m[10]=p,m[11]=T[0],m[12]=T.length,m[13]=g,m[14]=A):A=m[14];let q=A,D=$||q,N;m[15]===E?.name?N=m[16]:(N=e=>{let{name:t}=e;return t!==E?.name},m[15]=E?.name,m[16]=N);let V=T.filter(N),F,z;if(m[17]===q?(F=m[18],z=m[19]):(F=()=>{q&&(window.location.href=q)},z=[q],m[17]=q,m[18]=F,m[19]=z),(0,O.useEffect)(F,z),D){let e;return m[20]===Symbol.for("react.memo_cache_sentinel")?(e=(0,em.jsx)(f.t,{showText:!0}),m[20]=e):e=m[20],e}if(0===T.length){let e,t,n,r,a,i,o;return m[21]===Symbol.for("react.memo_cache_sentinel")?(e=(0,em.jsx)(eS.az,{children:(0,em.jsx)(ey.n,{size:1,children:(0,em.jsx)(eC.WarningOutlineIcon,{})})}),m[21]=e):e=m[21],m[22]===Symbol.for("react.memo_cache_sentinel")?(t=(0,em.jsx)(ey.n,{as:"h1",size:1,weight:"medium",children:"No login providers available"}),m[22]=t):t=m[22],m[23]===Symbol.for("react.memo_cache_sentinel")?(n=(0,em.jsxs)(ey.n,{as:"p",muted:!0,size:1,children:["The ",(0,em.jsx)("code",{children:"auth.providers"})," setting in your Studio configuration resolved to an empty list. An empty array replaces the default providers with none rather than falling back to them."]}),m[23]=n):n=m[23],m[24]===Symbol.for("react.memo_cache_sentinel")?(r=(0,em.jsxs)(ey.n,{as:"p",muted:!0,size:1,children:["Remove ",(0,em.jsx)("code",{children:"auth.providers"})," to use the defaults, or set it to the providers you want."]}),m[24]=r):r=m[24],m[25]!==y.onChooseAnotherWorkspace||m[26]!==h?(a=y.onChooseAnotherWorkspace&&(0,em.jsx)(eS.so,{children:(0,em.jsx)(c.o,{icon:eY.ArrowLeftIcon,mode:"ghost",onClick:y.onChooseAnotherWorkspace,text:h("workspaces.action.choose-another-workspace")})}),m[25]=y.onChooseAnotherWorkspace,m[26]=h,m[27]=a):a=m[27],m[28]===Symbol.for("react.memo_cache_sentinel")?(i=(0,em.jsx)(ey.n,{as:"p",muted:!0,size:1,children:(0,em.jsx)("a",{href:"https://www.sanity.io/docs/configuration#dc516e8cb39e",rel:"noreferrer",target:"_blank",children:"Learn about auth configuration →"})}),m[28]=i):i=m[28],m[29]===a?o=m[30]:(o=(0,em.jsx)(eh.s,{padding:4,radius:2,shadow:1,tone:"caution",children:(0,em.jsxs)(eS.so,{children:[e,(0,em.jsxs)(ey.t,{flex:1,marginLeft:3,gap:4,children:[t,n,r,a,i]})]})}),m[29]=a,m[30]=o),o}let M=ey.t,L;m[31]===Symbol.for("react.memo_cache_sentinel")?(L=(0,em.jsx)(eg.DZ,{align:"center",size:1,children:"Choose login provider"}),m[31]=L):L=m[31];let P=ey.t,R;m[32]!==E||m[33]!==p||m[34]!==g?(R=E&&(0,em.jsx)(ae,{provider:E,href:r9({loginMethod:t,projectId:p,url:E.url,redirectPath:g})}),m[32]=E,m[33]=p,m[34]=g,m[35]=R):R=m[35];let U=ey.t,K=V?.map((e,n)=>(0,em.jsx)(at,{provider:e,href:r9({loginMethod:t,projectId:p,url:e.url,redirectPath:g})},`${e.url}_${n}`)),B;return m[36]!==U||m[37]!==K?(B=(0,em.jsx)(U,{gap:2,children:K}),m[36]=U,m[37]=K,m[38]=B):B=m[38],m[39]!==P||m[40]!==R||m[41]!==B?(d=(0,em.jsxs)(P,{children:[R,B]}),m[39]=P,m[40]=R,m[41]=B,m[42]=d):d=m[42],m[43]!==M||m[44]!==L||m[45]!==d?(u=(0,em.jsxs)(M,{gap:4,children:[L,d]}),m[43]=M,m[44]=L,m[45]=d,m[46]=u):u=m[46],u}}({...y,client$:ed.pipe((0,z.T)(e=>e.client)),loginMethod:a,wasLogout:()=>ew,isHandlingCallback:()=>ef});return{handleCallbackUrl:ev,state:ed,token:ec??b.value.pipe((0,z.T)(e=>e?.token||null)),LoginComponent:ek,logout:e_}})({...e,getSessionId:as,consumeHashToken:aa,observeWorkbenchToken:ax,refreshWorkbenchToken:aw}),({getRequestErrorHandler:e,getRequestFailureDiagnostics:t,...n})=>rG(n)),aI=[(0,v.x)({fieldPath:"_updatedAt",icon:e3.CalendarIcon,operators:[{name:"dateTimeLast",type:"item"},{type:"divider"},{name:"dateTimeRange",type:"item"},{name:"dateTimeAfter",type:"item"},{name:"dateTimeBefore",type:"item"},{type:"divider"},{name:"dateTimeEqual",type:"item"},{name:"dateTimeNotEqual",type:"item"}],title:"Edited at",name:"updatedAt",type:"pinned"}),(0,v.x)({fieldPath:"_createdAt",icon:e3.CalendarIcon,operators:[{name:"dateTimeLast",type:"item"},{type:"divider"},{name:"dateTimeRange",type:"item"},{name:"dateTimeAfter",type:"item"},{name:"dateTimeBefore",type:"item"},{type:"divider"},{name:"dateTimeEqual",type:"item"},{name:"dateTimeNotEqual",type:"item"}],title:"Created at",name:"createdAt",type:"pinned"}),(0,v.x)({icon:ti.LinkIcon,operators:[{name:"referencesDocument",type:"item"},{name:"referencesAssetImage",type:"item"},{name:"referencesAssetFile",type:"item"}],title:"Contains document, image or file",name:"references",type:"pinned"}),(0,v.x)({fieldType:"array",icon:tu.UlistIcon,name:"array",operators:[{name:"defined",type:"item"},{name:"notDefined",type:"item"},{type:"divider"},{name:"arrayCountEqual",type:"item"},{name:"arrayCountNotEqual",type:"item"},{type:"divider"},{name:"arrayCountGt",type:"item"},{name:"arrayCountGte",type:"item"},{name:"arrayCountLt",type:"item"},{name:"arrayCountLte",type:"item"},{type:"divider"},{name:"arrayCountRange",type:"item"}],type:"field"}),(0,v.x)({fieldType:"array",icon:tu.UlistIcon,name:"arrayList",operators:[{name:"arrayListIncludes",type:"item"},{name:"arrayListNotIncludes",type:"item"},{type:"divider"},{name:"defined",type:"item"},{name:"notDefined",type:"item"},{type:"divider"},{name:"arrayCountEqual",type:"item"},{name:"arrayCountNotEqual",type:"item"},{type:"divider"},{name:"arrayCountGt",type:"item"},{name:"arrayCountGte",type:"item"},{name:"arrayCountLt",type:"item"},{name:"arrayCountLte",type:"item"},{type:"divider"},{name:"arrayCountRange",type:"item"}],type:"field"}),(0,v.x)({fieldType:"array",icon:tu.UlistIcon,name:"arrayReferences",operators:[{name:"arrayReferenceIncludes",type:"item"},{name:"arrayReferenceNotIncludes",type:"item"},{type:"divider"},{name:"defined",type:"item"},{name:"notDefined",type:"item"},{type:"divider"},{name:"arrayCountEqual",type:"item"},{name:"arrayCountNotEqual",type:"item"},{type:"divider"},{name:"arrayCountGt",type:"item"},{name:"arrayCountGte",type:"item"},{name:"arrayCountLt",type:"item"},{name:"arrayCountLte",type:"item"},{type:"divider"},{name:"arrayCountRange",type:"item"}],type:"field"}),(0,v.x)({fieldType:"boolean",icon:tA.CheckmarkCircleIcon,name:"boolean",operators:[{name:"booleanEqual",type:"item"},{type:"divider"},{name:"notDefined",type:"item"}],type:"field"}),(0,v.x)({fieldType:"date",icon:e3.CalendarIcon,name:"date",operators:[{name:"dateLast",type:"item"},{type:"divider"},{name:"dateRange",type:"item"},{name:"dateAfter",type:"item"},{name:"dateBefore",type:"item"},{type:"divider"},{name:"dateEqual",type:"item"},{name:"dateNotEqual",type:"item"},{type:"divider"},{name:"defined",type:"item"},{name:"notDefined",type:"item"}],type:"field"}),(0,v.x)({fieldType:"datetime",icon:e3.CalendarIcon,name:"datetime",operators:[{name:"dateTimeLast",type:"item"},{type:"divider"},{name:"dateTimeRange",type:"item"},{name:"dateTimeAfter",type:"item"},{name:"dateTimeBefore",type:"item"},{type:"divider"},{name:"dateTimeEqual",type:"item"},{name:"dateTimeNotEqual",type:"item"},{type:"divider"},{name:"defined",type:"item"},{name:"notDefined",type:"item"}],type:"field"}),(0,v.x)({fieldType:"email",icon:tR.StringIcon,name:"email",operators:[{name:"stringMatches",type:"item"},{name:"stringNotMatches",type:"item"},{type:"divider"},{name:"stringEqual",type:"item"},{name:"stringNotEqual",type:"item"},{type:"divider"},{name:"defined",type:"item"},{name:"notDefined",type:"item"}],type:"field"}),(0,v.x)({fieldType:"file",icon:e4.DocumentIcon,name:"file",operators:[{name:"assetFileEqual",type:"item"},{name:"assetFileNotEqual",type:"item"},{type:"divider"},{name:"defined",type:"item"},{name:"notDefined",type:"item"}],type:"field"}),(0,v.x)({fieldType:"image",icon:e9.ImageIcon,name:"image",operators:[{name:"assetImageEqual",type:"item"},{name:"assetImageNotEqual",type:"item"},{type:"divider"},{name:"defined",type:"item"},{name:"notDefined",type:"item"}],type:"field"}),(0,v.x)({fieldType:"number",icon:tP.NumberIcon,name:"number",operators:[{name:"numberEqual",type:"item"},{name:"numberNotEqual",type:"item"},{type:"divider"},{name:"numberGt",type:"item"},{name:"numberGte",type:"item"},{name:"numberLt",type:"item"},{name:"numberLte",type:"item"},{type:"divider"},{name:"numberRange",type:"item"},{type:"divider"},{name:"defined",type:"item"},{name:"notDefined",type:"item"}],type:"field"}),(0,v.x)({fieldType:"array",icon:tL.BlockContentIcon,name:"portableText",operators:[{name:"portableTextMatches",type:"item"},{name:"portableTextNotMatches",type:"item"},{type:"divider"},{name:"portableTextEqual",type:"item"},{name:"portableTextNotEqual",type:"item"},{type:"divider"},{name:"defined",type:"item"},{name:"notDefined",type:"item"}],type:"field"}),(0,v.x)({fieldType:"reference",icon:ti.LinkIcon,name:"reference",operators:[{name:"referenceEqual",type:"item"},{name:"referenceNotEqual",type:"item"},{type:"divider"},{name:"defined",type:"item"},{name:"notDefined",type:"item"}],type:"field"}),(0,v.x)({fieldType:"slug",icon:tR.StringIcon,name:"slug",operators:[{name:"slugMatches",type:"item"},{name:"slugNotMatches",type:"item"},{type:"divider"},{name:"slugEqual",type:"item"},{name:"slugNotEqual",type:"item"},{type:"divider"},{name:"defined",type:"item"},{name:"notDefined",type:"item"}],type:"field"}),(0,v.x)({fieldType:"string",icon:tR.StringIcon,name:"string",operators:[{name:"stringMatches",type:"item"},{name:"stringNotMatches",type:"item"},{type:"divider"},{name:"stringEqual",type:"item"},{name:"stringNotEqual",type:"item"},{type:"divider"},{name:"defined",type:"item"},{name:"notDefined",type:"item"}],type:"field"}),(0,v.x)({fieldType:"string",icon:te.ChevronDownIcon,name:"stringList",operators:[{name:"stringListEqual",type:"item"},{name:"stringListNotEqual",type:"item"},{type:"divider"},{name:"stringMatches",type:"item"},{name:"stringNotMatches",type:"item"},{type:"divider"},{name:"defined",type:"item"},{name:"notDefined",type:"item"}],type:"field"}),(0,v.x)({fieldType:"text",icon:tR.StringIcon,name:"text",operators:[{name:"stringMatches",type:"item"},{name:"stringNotMatches",type:"item"},{type:"divider"},{name:"stringEqual",type:"item"},{name:"stringNotEqual",type:"item"},{type:"divider"},{name:"defined",type:"item"},{name:"notDefined",type:"item"}],type:"field"}),(0,v.x)({fieldType:"url",icon:tR.StringIcon,name:"url",operators:[{name:"stringMatches",type:"item"},{name:"stringNotMatches",type:"item"},{type:"divider"},{name:"stringEqual",type:"item"},{name:"stringNotEqual",type:"item"},{type:"divider"},{name:"defined",type:"item"},{name:"notDefined",type:"item"}],type:"field"})],aT={isLoading:!0,snapshot:null,original:null};function aE(e){let t,n,r=(0,eu.c)(11),{documentId:o,schemaType:l}=e,s=(0,i.r)(),c;r[0]!==o||r[1]!==s||r[2]!==l?(c=(0,a.vn)(s,l,o),r[0]=o,r[1]=s,r[2]=l,r[3]=c):c=r[3];let{snapshot:d,original:u,isLoading:m}=(0,eD.J2)(c,aT);if(m){let e;return r[4]===Symbol.for("react.memo_cache_sentinel")?(e=(0,em.jsx)(eg.EA,{animated:!0,marginLeft:1,radius:2,style:{width:"10ch",height:"1em"}}),r[4]=e):e=r[4],e}return r[5]!==o||r[6]!==u?.title||r[7]!==d?.title?(t=d?.title||u?.title||o.slice(0,8),r[5]=o,r[6]=u?.title,r[7]=d?.title,r[8]=t):t=r[8],r[9]===t?n=r[10]:(n=(0,em.jsx)(em.Fragment,{children:t}),r[9]=t,r[10]=n),n}function a$(e){let t,n=(0,eu.c)(8),{value:r}=e,i=r.includeTime?"short":void 0,o;n[0]===i?o=n[1]:(o={dateStyle:"medium",timeStyle:i},n[0]=i,n[1]=o);let l=(0,a.Pi)(o),s,c;if(n[2]!==l||n[3]!==r.date){c=Symbol.for("react.early_return_sentinel");e:{let e=r?.date?new Date(r.date):null;if(!e||!(0,e1.f)(e)){c=null;break e}s=l.format(e)}n[2]=l,n[3]=r.date,n[4]=s,n[5]=c}else s=n[4],c=n[5];return c!==Symbol.for("react.early_return_sentinel")?c:(n[6]===s?t=n[7]:(t=(0,em.jsx)(em.Fragment,{children:s}),n[6]=s,n[7]=t),t)}function aA(e){let t=(0,eu.c)(10),{value:n}=e,r=n.includeTime?"short":void 0,i;t[0]===r?i=t[1]:(i={dateStyle:"medium",timeStyle:r},t[0]=r,t[1]=i);let o=(0,a.Pi)(i),l,s,c;if(t[2]!==o||t[3]!==n.from||t[4]!==n.to){c=Symbol.for("react.early_return_sentinel");
32e:{let e=n?.from?new Date(n.from):null,t=n?.to?new Date(n.to):null;if(!t||!e||!(0,e1.f)(t)||!(0,e1.f)(e)){c=null;break e}l=o.format(e),s=o.format(t)}t[2]=o,t[3]=n.from,t[4]=n.to,t[5]=l,t[6]=s,t[7]=c}else l=t[5],s=t[6],c=t[7];if(c!==Symbol.for("react.early_return_sentinel"))return c;let d=`${l} → ${s}`,u;return t[8]===d?u=t[9]:(u=(0,em.jsx)(em.Fragment,{children:d}),t[8]=d,t[9]=u),u}function aq(e){let t,n=(0,eu.c)(6),{value:r}=e,a=(0,i.Zt)(),o=r._ref,l;n[0]!==a||n[1]!==r._type?(l=a.get(r._type),n[0]=a,n[1]=r._type,n[2]=l):l=n[2];let s=l;return s?(n[3]!==o||n[4]!==s?(t=(0,em.jsx)(aE,{documentId:o,schemaType:s}),n[3]=o,n[4]=s,n[5]=t):t=n[5],t):null}function aD(e){let t,n=(0,eu.c)(9),{value:r,onChange:a}=e,[i,o]=(0,O.useState)(r??""),{state:l}=(0,v.b)(),{fullscreen:c}=l,{t:d}=(0,s.t)(),u;n[0]===a?u=n[1]:(u=e=>{o(e.currentTarget.value);let t=parseFloat(e.currentTarget.value);a(Number.isFinite(t)?t:null)},n[0]=a,n[1]=u);let m=u,p=c?2:1,f;return n[2]===d?f=n[3]:(f=d("search.filter-number-value-placeholder"),n[2]=d,n[3]=f),n[4]!==m||n[5]!==p||n[6]!==f||n[7]!==i?(t=(0,em.jsx)(eb.t,{fontSize:p,onChange:m,placeholder:f,radius:2,step:"any",type:"number",value:i}),n[4]=m,n[5]=p,n[6]=f,n[7]=i,n[8]=t):t=n[8],t}function aN(e){let t,n,r,a=(0,eu.c)(23),{onChange:i,value:o}=e,[l,c]=(0,O.useState)(o?.to??""),[d,u]=(0,O.useState)(o?.from??""),{state:m}=(0,v.b)(),{fullscreen:p}=m,{t:f}=(0,s.t)(),y;a[0]!==i||a[1]!==o?.from?(y=e=>{c(e.currentTarget.value);let t=parseFloat(e.currentTarget.value);i({to:Number.isFinite(t)?t:null,from:o?.from??null})},a[0]=i,a[1]=o?.from,a[2]=y):y=a[2],o?.from;let h=y,g;a[3]!==i||a[4]!==o?.to?(g=e=>{u(e.currentTarget.value);let t=parseFloat(e.currentTarget.value);i({to:o?.to??null,from:Number.isFinite(t)?t:null})},a[3]=i,a[4]=o?.to,a[5]=g):g=a[5],o?.to;let b=g,x=p?2:1,w;a[6]===f?w=a[7]:(w=f("search.filter-number-min-value-placeholder"),a[6]=f,a[7]=w),a[8]!==d||a[9]!==b||a[10]!==x||a[11]!==w?(t=(0,em.jsx)(eS.az,{flexBasis:"0%",flexGrow:1,children:(0,em.jsx)(eb.t,{fontSize:x,onChange:b,placeholder:w,radius:2,step:"any",type:"number",value:d})}),a[8]=d,a[9]=b,a[10]=x,a[11]=w,a[12]=t):t=a[12];let _=p?2:1,S;return a[13]===f?S=a[14]:(S=f("search.filter-number-max-value-placeholder"),a[13]=f,a[14]=S),a[15]!==h||a[16]!==_||a[17]!==S||a[18]!==l?(n=(0,em.jsx)(eS.az,{flexBasis:"0%",flexGrow:1,children:(0,em.jsx)(eb.t,{fontSize:_,onChange:h,placeholder:S,radius:2,step:"any",type:"number",value:l})}),a[15]=h,a[16]=_,a[17]=S,a[18]=l,a[19]=n):n=a[19],a[20]!==t||a[21]!==n?(r=(0,em.jsxs)(eS.so,{gap:2,children:[t,n]}),a[20]=t,a[21]=n,a[22]=r):r=a[22],r}let aV=()=>!0,aF=(0,e_.I4)(ey.n).withConfig({displayName:"StyledText",componentId:"sc-lk4sqs-0"})`word-break:break-word;`;function aO(e){let t,n,r,a=(0,eu.c)(43),{ref:o,onSelect:l,types:c,value:u}=e,m;a[0]===c?m=a[1]:(m=void 0===c?[]:c,a[0]=c,a[1]=m);let f=m,y=(0,O.useRef)(null),h=(0,i.Zt)(),{state:b}=(0,v.b)(),{fullscreen:x}=b,{t:w}=(0,s.t)(),_=(0,O.useId)(),S;a[2]===Symbol.for("react.memo_cache_sentinel")?(S=[],a[2]=S):S=a[2];let[k,C]=(0,O.useState)(S),j;a[3]===Symbol.for("react.memo_cache_sentinel")?(j=[],a[3]=j):j=a[3],a[4]===f?t=a[5]:(t={hits:j,loading:!1,error:null,terms:{query:"",types:f}},a[4]=f,a[5]=t),a[6]===Symbol.for("react.memo_cache_sentinel")?(n=e=>{C(e.hits.map(aM))},a[6]=n):n=a[6],a[7]!==h||a[8]!==t?(r={allowEmptyQueries:!0,initialState:t,onComplete:n,schema:h},a[7]=h,a[8]=t,a[9]=r):r=a[9];let{handleSearch:I,searchState:T}=(0,v.f)(r),E;a[10]!==I||a[11]!==f?(E=()=>{I({debounceTime:0,options:{limit:100},terms:{query:"",types:f}})},a[10]=I,a[11]=f,a[12]=E):E=a[12];let $=E,A;a[13]!==I||a[14]!==f?(A=e=>{I(e?{options:{limit:100},terms:{query:e||"",types:f}}:{debounceTime:0,options:{limit:0},terms:{query:"",types:f}})},a[13]=I,a[14]=f,a[15]=A):A=a[15];let q=A,D;a[16]!==k||a[17]!==l?(D=e=>{let t=k.find(t=>t.value===e)?.hit;t&&l?.({_ref:(0,p.l)(t._id),_type:t._type})},a[16]=k,a[17]=l,a[18]=D):D=a[18];let N=D,V;e:{let e;if(0===f.length){let e;a[19]===w?e=a[20]:(e=w("search.action.search-all-types"),a[19]=w,a[20]=e),V=e;break e}if(a[21]!==w||a[22]!==f){let{remainingCount:t,types:n}=(0,v.d)({types:f});e=w(t>0?"search.action.search-specific-types-truncated":"search.action.search-specific-types",{count:t,types:n,formatParams:{types:{style:"short",type:"unit"}}}),a[21]=w,a[22]=f,a[23]=e}else e=a[23];V=e}let F=V,z;a[24]!==k||a[25]!==T.loading||a[26]!==T.terms.query||a[27]!==w?(z=(e,t)=>
32{let{content:n,hidden:r,onMouseEnter:a,onMouseLeave:i}=e,o=k&&k.length>0;return(0,em.jsx)(g.r,{constrainSize:!0,content:(0,em.jsx)("div",{ref:t,children:o?n:T.terms.query&&(0,em.jsx)(eS.az,{padding:4,children:(0,em.jsx)(eS.so,{alignItems:"center",height:"100%",justifyContent:"center",children:(0,em.jsx)(aF,{align:"center",muted:!0,children:(0,em.jsx)(d.t,{t:w,i18nKey:"new-document.no-results",values:{searchQuery:T.terms.query}})})})})}),fallbackPlacements:["bottom","bottom-end"],matchReferenceWidth:!0,onMouseEnter:a,onMouseLeave:i,open:!T.loading&&!r,overflow:"auto",placement:"bottom-start",radius:3,referenceElement:y.current})},a[24]=k,a[25]=T.loading,a[26]=T.terms.query,a[27]=w,a[28]=z):z=a[28];let M=z,L=x?2:1,P;a[29]===$?P=a[30]:(P={onClick:$},a[29]=$,a[30]=P);let R=u?._ref,U;return a[31]!==_||a[32]!==q||a[33]!==N||a[34]!==k||a[35]!==F||a[36]!==o||a[37]!==M||a[38]!==T.loading||a[39]!==L||a[40]!==P||a[41]!==R?(U=(0,em.jsx)("div",{ref:y,children:(0,em.jsx)(tc.j,{"aria-label":F,filterOption:aV,fontSize:L,id:_,loading:T.loading,openButton:P,options:k,onQueryChange:q,onSelect:N,placeholder:F,radius:2,ref:o,renderOption:az,renderPopover:M,value:R})}),a[31]=_,a[32]=q,a[33]=N,a[34]=k,a[35]=F,a[36]=o,a[37]=M,a[38]=T.loading,a[39]=L,a[40]=P,a[41]=R,a[42]=U):U=a[42],U}function az(e){return(0,em.jsx)(v.g,{disableIntentLink:!0,documentId:e.value,documentType:e.hit._type,layout:"compact"})}function aM(e){let{hit:t}=e;return{value:t._id,hit:t}}function aL(e){let t,n=(0,eu.c)(25),{fieldDefinition:r,onChange:a,value:o}=e,{onClose:l,state:d}=(0,v.b)(),{documentTypesNarrowed:u}=d,m=(0,i.Zt)(),{t:p}=(0,s.t)(),f;n[0]===a?f=n[1]:(f=e=>a(e),n[0]=a,n[1]=f);let y=f,h;e:{let e;if(!r){let e;n[2]===Symbol.for("react.memo_cache_sentinel")?(e=[],n[2]=e):e=n[2],h=e;break e}if(n[3]!==u||n[4]!==r.documentTypes||n[5]!==r.fieldPath||n[6]!==m){let t,a;n[8]===u?t=n[9]:(t=e=>u.includes(e),n[8]=u,n[9]=t),n[10]!==r.fieldPath||n[11]!==m?(a=e=>{let t=m.get(e);if(t){let e=(0,v.y)(t,r.fieldPath);if((0,ef.zR)(e?.type))return e?.type.of.filter(ef.do).flatMap(aR);if((0,ef.do)(e?.type))return e?.type.to}return[]},n[10]=r.fieldPath,n[11]=m,n[12]=a):a=n[12],e=r.documentTypes.filter(t).flatMap(a).reduce(aP,[]),n[3]=u,n[4]=r.documentTypes,n[5]=r.fieldPath,n[6]=m,n[7]=e}else e=n[7];h=e}let g=h,b;n[13]===y?b=n[14]:(b=()=>y(null),n[13]=y,n[14]=b);let x=b,w;n[15]===l?w=n[16]:(w=()=>{l?.()},n[15]=l,n[16]=w);let _=w,S;return n[17]===Symbol.for("react.memo_cache_sentinel")?(S={width:"min(calc(100vw - 40px), 420px)"},n[17]=S):S=n[17],n[18]!==y||n[19]!==x||n[20]!==_||n[21]!==g||n[22]!==p||n[23]!==o?(t=(0,em.jsx)(eS.az,{style:S,children:o?._ref&&o?._type?(0,em.jsxs)(ey.t,{gap:3,children:[(0,em.jsx)(eh.s,{padding:1,radius:1,shadow:1,children:(0,em.jsx)(v.g,{documentId:o._ref,documentType:o._type,layout:"compact",onClick:_})}),(0,em.jsx)(c.o,{mode:"ghost",onClick:x,text:p("search.filter-reference-clear"),tone:"critical"})]}):(0,em.jsx)(aO,{onSelect:y,types:g,value:o})}),n[18]=y,n[19]=x,n[20]=_,n[21]=g,n[22]=p,n[23]=o,n[24]=t):t=n[24],t}function aP(e,t){return 0>e.findIndex(e=>e.name===t?.name)&&e.push(t),e}function aR(e){return e.to}function aU(e){let t,n=(0,eu.c)(7),{onClick:r,selected:a,title:i,value:o}=e,l;n[0]!==r||n[1]!==o?(l=()=>r(o),n[0]=r,n[1]=o,n[2]=l):l=n[2];let s=l,d=`${i}`;return void 0!==o&&i!==o&&(d+=` (${o})`),n[3]!==s||n[4]!==d||n[5]!==a?(t=(0,em.jsx)(c.r,{onClick:s,pressed:a,tone:"default",text:d}),n[3]=s,n[4]=d,n[5]=a,n[6]=t):t=n[6],t}function aK(e){let t,n,r,a,o=(0,eu.c)(32),{fieldDefinition:l,onChange:d,value:u}=e,m=(0,O.useId)(),{state:f}=(0,v.b)(),{documentTypesNarrowed:y}=f,{t:h}=(0,s.t)(),g=(0,i.Zt)(),b;e:{let e;if(!l){let e;o[0]===Symbol.for("react.memo_cache_sentinel")?(e=[],o[0]=e):e=o[0],b=e;break e}if(o[1]!==y||o[2]!==l.documentTypes||o[3]!==l.fieldPath||o[4]!==g){let t,n;o[6]===y?t=o[7]:(t=e=>y.includes(e),o[6]=y,o[7]=t),o[8]!==l.fieldPath||o[9]!==g?(n=e=>{let t=g.get(e);return t?(0,v.y)(t,l.fieldPath)?.type.options:null},o[8]=l.fieldPath,o[9]=g,o[10]=n):n=o[10],e=l.documentTypes.filter(t).map(n).filter(p.C).map(aZ).flatMap(aH).filter(p.C).reduce(aB,[]),o[1]=y,o[2]=l.documentTypes,o[3]=l.fieldPath,o[4]=g,o[5]=e}else e=o[5];b=e}let x=b,w;o[11]===d?w=o[12]:(w=e=>{d(e)},o[11]=d,o[12]=w);let _=w,S;o[13]!==h||o[14]!==u?(S=u?String(u):h("search.filter-string-value-select-predefined-value"),o[13]=h,o[14]=u,o[15]=S):S=o[15],o[16]===S?t=o[17]:(t=(0,em.jsx)(c.o,{mode:"ghost",iconRight:te.ChevronDownIcon,text:S}),o[16]=S,o[17]=t);let k=m||"",C;if(o[18]!==_||o[19]!==x||o[20]!==u){let e;o[22]!==_||o[23]!==u?(e=(e,t)=>(0,em.jsx)(aU,{onClick:_,selected:e.value===u,title:e.title.join(", "),value:e.value||""},t),o[22]=_,o[23]=u,o[24]=e):e=o[24],C=x.map(e),o[18]=_,o[19]=x,o[20]=u,o[21]=C}else C=o[21];return o[25]===C?n=o[26]:(n=(0,em.jsx)(to.W1,{children:C}),o[25]=C,o[26]=n),o[27]===Symbol.for("react.memo_cache_sentinel")?(r={constrainSize:!0,placement:"bottom-start",portal:!1,radius:2},o[27]=r):r=o[27],o[28]!==t||o[29]!==k||o[30]!==n?(a=(0,em.jsx)(c.i,{button:t,id:k,menu:n,popover:r}),o[28]=t,o[29]=k,o[30]=n,o[31]=a):a=o[31],a}function aB(e,t){let n=e.findIndex(e=>e.value===t?.value);if(n>-1){let r=e[n];e[n]={...e[n],title:(0,eL.A)([...r.title,t.title]).sort(aW)}}else e.push({...t,title:[t.title]});return e}function aW(e,t){return"string"==typeof e&&"string"==typeof t?e.localeCompare(t):Number(e)-Number(t)}function aH(e){return e?.map(aG)}function aG(e){var t;return t=e,(0,ef.uC)(t)?t:{title:(0,tS.A)(`${t}`),value:t}}function aZ(e){return e.list}let aJ=()=>{let e=(0,eu.c)(1),t;return e[0]===Symbol.for("react.memo_cache_sentinel")?(t=(0,em.jsx)("svg",{width:"1em",height:"1em",viewBox:"0 0 25 25",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,em.jsx)("path",{d:"M7.04 19V17.512H17.36V19H7.04ZM7.04 15.328V13.624L12.08 11.872L15.32 10.816V10.72L12.08 9.664L7.04 7.912V6.208L17.36 9.88V11.656L7.04 15.328Z",fill:"currentColor"})}),e[0]=t):t=e[0],t},aY=()=>{let e=(0,eu.c)(1),t;return e[0]===Symbol.for("react.memo_cache_sentinel")?(t=(0,em.jsx)("svg",{width:"1em",height:"1em",viewBox:"0 0 25 25",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,em.jsx)("path",{d:"M7.568 18.848V16.952L14.792 12.08V11.984L7.568 7.112V5.216L16.52 11.288V12.776L7.568 18.848Z",fill:"currentColor"})}),e[0]=t):t=e[0],t},aQ=()=>{let e=(0,eu.c)(1),t;return e[0]===Symbol.for("react.memo_cache_sentinel")?(t=(0,em.jsx)("svg",{width:"1em",height:"1em",viewBox:"0 0 25 25",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,em.jsx)("path",{d:"M7.04 19V17.512H17.36V19H7.04ZM17.36 15.328L7.04 11.656V9.88L17.36 6.208V7.912L12.32 9.664L9.08 10.72V10.816L12.32 11.872L17.36 13.624V15.328Z",fill:"currentColor"})}),e[0]=t):t=e[0],t},aX=()=>{let e=(0,eu.c)(1),t;return e[0]===Symbol.for("react.memo_cache_sentinel")?(t=(0,em.jsx)("svg",{width:"1em",height:"1em",viewBox:"0 0 25 25",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,em.jsx)("path",{d:"M16.952 19.632L8 13.56V12.072L16.952 6V7.896L9.728 12.768V12.864L16.952 17.736V19.632Z",fill:"currentColor"})}),e[0]=t):t=e[0],t};function a0(e){return JSON.stringify(e)}function a1(e){let t,n,r,a,i,o,c,d,u=(0,eu.c)(20),{t:m}=(0,s.t)(),p;return u[0]===Symbol.for("react.memo_cache_sentinel")?(p=(0,em.jsx)(l.t,{tone:"caution",children:(0,em.jsx)(eC.WarningOutlineIcon,{})}
32),u[0]=p):p=u[0],u[1]===m?t=u[2]:(t=m("search.error.no-valid-asset-source-title"),u[1]=m,u[2]=t),u[3]===t?n=u[4]:(n=(0,em.jsx)(l.t,{size:1,tone:"caution",weight:"medium",children:t}),u[3]=t,u[4]=n),u[5]===m?r=u[6]:(r=m("search.error.no-valid-asset-source-only-default-description"),u[5]=m,u[6]=r),u[7]===r?a=u[8]:(a=(0,em.jsx)(l.t,{size:1,tone:"caution",children:r}),u[7]=r,u[8]=a),u[9]===m?i=u[10]:(i=m("search.error.no-valid-asset-source-check-config-description"),u[9]=m,u[10]=i),u[11]===i?o=u[12]:(o=(0,em.jsx)(l.t,{size:1,tone:"caution",children:i}),u[11]=i,u[12]=o),u[13]!==n||u[14]!==a||u[15]!==o?(c=(0,em.jsxs)(eS.so,{alignItems:"flex-start",gap:3,children:[p,(0,em.jsxs)(ey.t,{gap:4,children:[n,a,o]})]}),u[13]=n,u[14]=a,u[15]=o,u[16]=c):c=u[16],u[17]!==e||u[18]!==c?(d=(0,em.jsx)(eS.az,{...e,children:c}),u[17]=e,u[18]=c,u[19]=d):d=u[19],d}function a2(e){let t,n=(0,eu.c)(6),{reference:r}=e,o=(0,i.r)(),l;n[0]===o?l=n[1]:(l=e=>(0,a.Tr)(o,e),n[0]=o,n[1]=l);let s=l,c;return n[2]===Symbol.for("react.memo_cache_sentinel")?(c=(0,em.jsx)(a5,{}),n[2]=c):c=n[2],n[3]!==s||n[4]!==r?(t=(0,em.jsx)(a.z,{observeAsset:s,reference:r,waitPlaceholder:c,children:a3}),n[3]=s,n[4]=r,n[5]=t):t=n[5],t}function a3(e){return(0,em.jsx)(a4,{asset:e})}function a4(e){let t,n,r,i=(0,eu.c)(10),{asset:o}=e,l;i[0]===Symbol.for("react.memo_cache_sentinel")?(l=(0,em.jsx)(eh.s,{padding:3,radius:1,shadow:1,tone:"transparent",children:(0,em.jsx)(ey.n,{children:(0,em.jsx)(tj.BinaryDocumentIcon,{})})}),i[0]=l):l=i[0];let s=o?.originalFilename||o._id,c;return i[1]===s?c=i[2]:(c=(0,em.jsx)(ey.n,{muted:!0,size:1,textOverflow:"ellipsis",weight:"medium",children:s}),i[1]=s,i[2]=c),i[3]===o.size?t=i[4]:(t=(0,a.E)(o.size),i[3]=o.size,i[4]=t),i[5]===t?n=i[6]:(n=(0,em.jsx)(ey.n,{size:1,muted:!0,children:t}),i[5]=t,i[6]=n),i[7]!==c||i[8]!==n?(r=(0,em.jsx)(eh.s,{padding:2,shadow:1,children:(0,em.jsxs)(eS.so,{alignItems:"center",justifyContent:"space-between",flexWrap:"nowrap",children:[l,(0,em.jsxs)(ey.t,{flex:1,gap:2,marginLeft:3,children:[c,n]})]})}),i[7]=c,i[8]=n,i[9]=r):r=i[9],r}function a5(){let e,t,n=(0,eu.c)(3),r;return n[0]===Symbol.for("react.memo_cache_sentinel")?(r=(0,em.jsx)(eh.s,{padding:3,radius:1,shadow:1,tone:"transparent",children:(0,em.jsx)(ey.n,{children:(0,em.jsx)(tj.BinaryDocumentIcon,{})})}),n[0]=r):r=n[0],n[1]===Symbol.for("react.memo_cache_sentinel")?(e=(0,em.jsx)(eg.r5,{animated:!0,style:{width:"100%"},radius:1}),n[1]=e):e=n[1],n[2]===Symbol.for("react.memo_cache_sentinel")?(t=(0,em.jsx)(eh.s,{padding:2,shadow:1,children:(0,em.jsxs)(eS.so,{alignItems:"center",justifyContent:"flex-start",children:[r,(0,em.jsxs)(ey.t,{flex:1,gap:2,marginLeft:3,children:[e,(0,em.jsx)(eg.r5,{animated:!0,style:{width:"100%"},radius:1})]})]})}),n[2]=t):t=n[2],t}let a6=(0,e_.I4)(eh.s).withConfig({displayName:"Container",componentId:"sc-7ltxom-0"})`position:relative;padding-bottom:100%;`,a7=e_.I4.img.withConfig({displayName:"Image",componentId:"sc-7ltxom-1"})`position:absolute;top:0;left:0;width:100%;height:100%;display:block;object-fit:contain;`;function a8(e){let t=(0,eu.c)(5),{reference:n}=e,r=(0,i.r)(),o;t[0]===r?o=t[1]:(o=e=>(0,a.Er)(r,e),t[0]=r,t[1]=o);let l=o,s;return t[2]!==l||t[3]!==n?(s=(0,em.jsx)(a.z,{observeAsset:l,reference:n,children:a9}),t[2]=l,t[3]=n,t[4]=s):s=t[4],s}function a9(e){return(0,em.jsx)(ie,{asset:e})}function ie(e){let t,n,r=(0,eu.c)(8),{asset:a}=e,[i,o]=(0,O.useState)(!1),l=`${a.url}?h=800&fit=max`,s;r[0]===Symbol.for("react.memo_cache_sentinel")?(s=()=>o(!0),r[0]=s):s=r[0];let c=s,d;return r[1]===i?d=r[2]:(d=!i&&(0,em.jsx)(f.t,{fill:!0,showText:!0}),r[1]=i,r[2]=d),r[3]===l?t=r[4]:(t=(0,em.jsx)(a7,{onLoad:c,src:l}),r[3]=l,r[4]=t),r[5]!==d||r[6]!==t?(n=(0,em.jsxs)(a6,{__unstable_checkered:!0,border:!0,children:[d,t]}),r[5]=d,r[6]=t,r[7]=n):n=r[7],n}function it(e){let t=(0,eu.c)(4),{reference:n}=e;if(!n)return null;if(n._type.startsWith("sanity.fileAsset")){let e;return t[0]===n?e=t[1]:(e=(0,em.jsx)(a2,{reference:n}),t[0]=n,t[1]=e),e}if(n._type.startsWith("sanity.imageAsset")){let e;return t[2]===n?e=t[3]:(e=(0,em.jsx)(a8,{reference:n}),t[2]=n,t[3]=e),e}return null}let ir={file:"sanity.fileAsset",image:"sanity.imageAsset"},ia=(0,e_.I4)(eS.az).withConfig({displayName:"ContainerBox",componentId:"sc-mnyx0m-0"})`width:min(calc(100vw - 40px),320px);`;function ii(e){return function({onChange:t,value:n}){let[r,i]=(0,O.useState)(null),[o,l]=(0,O.useState)(null),{state:{fullscreen:d}}=(0,v.b)(),{file:m,image:p}=(0,u.o)().form,{t:f}=(0,s.t)(),y=(0,O.useMemo)(()=>{switch(e){case"file":return m.assetSources.filter(e=>e.name===a.in);case"image":return p.assetSources.filter(e=>e.name===a.in);default:throw Error("Unknown asset source found")}},[m.assetSources,p.assetSources]),h=(0,O.useId)(),g=(0,u.i)(u.n),b=(0,O.useCallback)(()=>{l(null),t(null)},[t]),x=(0,O.useCallback)(()=>{i(null)},[]),w=(0,O.useCallback)(e=>{l(e[0]),x()},[x]),_=(0,O.useCallback)(e=>i(e),[]);(0,O.useEffect)(()=>{o?.kind==="assetDocumentId"&&"string"==typeof o?.value&&e&&t({_ref:o.value,_type:ir[e]})},[g,t,o]);let S=r?.component,k=f(n?"search.filter-asset-change":"search.filter-asset-select",{context:e}),C=(0,eP.A)(e,"options.accept","image"===e?"image/*":"");return(0,em.jsx)(ia,{children:(0,em.jsxs)(ey.t,{gap:3,children:[r&&S&&(0,em.jsx)(ev.n,{children:(0,em.jsx)(S,{assetType:e,assetSource:r,dialogHeaderTitle:f("search.action.select-asset",{context:e}),onClose:x,onSelect:w,selectedAssets:[],selectionType:"single",accept:C})}),n&&(0,em.jsx)(it,{reference:n}),(0,em.jsxs)(eS.so,{gap:2,children:[0===y.length&&(0,em.jsx)(a1,{padding:2}),y.length>0&&(0,em.jsx)(em.Fragment,{children:y.length>1?(0,em.jsx)(c.i,{button:(0,em.jsx)(c.o,{icon:n?tN.UndoIcon:td.SearchIcon,iconRight:te.ChevronDownIcon,mode:"ghost",width:n?"fill":void 0,text:k}),id:h,menu:(0,em.jsx)(to.W1,{children:y.map(e=>(0,em.jsx)(c.r,{icon:e.icon||e9.ImageIcon,onClick:()=>_(e),text:(0,a.en)(e,f,{useStartCaseForName:!0})},e.name))}),popover:{constrainSize:!0,portal:!1,radius:2}}):(0,em.jsx)(c.o,{icon:n?tN.UndoIcon:td.SearchIcon,mode:"ghost",onClick:()=>_(y[0]),width:n?"fill":void 0,text:k})}),n&&(0,em.jsx)(c.o,{mode:"ghost",onClick:b,width:"fill",text:f("search.filter-asset-clear"),tone:"critical"})]})]})})}}let io={assetFileEqual:{nameKey:"search.operator.asset-file-equal.name",descriptionKey:"search.operator.asset-file-equal.description",buttonValueComponent:aq,groqFilter:({fieldPath:e,value:t})=>t?._ref&&e?`${e}.asset._ref == ${a0(t._ref)}`:null,initialValue:null,inputComponent:ii("file"),type:"assetFileEqual"},assetFileNotEqual:{nameKey:"search.operator.asset-file-not-equal.name",descriptionKey:"search.operator.asset-file-not-equal.description",buttonValueComponent:aq,groqFilter:({fieldPath:e,value:t})=>t?._ref&&e?`${e}.asset._ref != ${a0(t._ref)}`:null,initialValue:null,inputComponent:ii("file"),type:"assetFileNotEqual"},assetImageEqual:{nameKey:"search.operator.asset-image-equal.name",descriptionKey:"search.operator.asset-image-equal.description",buttonValueComponent:aq,groqFilter:({fieldPath:e,value:t})=>t?._ref&&e?`${e}.asset._ref == ${a0(t._ref)}`:null,initialValue:null,inputComponent:ii("image"),type:"assetImageEqual"},assetImageNotEqual:{nameKey:"search.operator.asset-image-not-equal.name",descriptionKey:"search.operator.asset-image-not-equal.description",buttonValueComponent:aq,groqFilter:({fieldPath:e,value:t})=>t?._ref&&e?`${e}.asset._ref != ${a0(t._ref)}`:null,initialValue:null,inputComponent:ii("image"),type:"assetImageNotEqual"}},il=(0,e_.I4)(ey.n).withConfig({displayName:"TimeLabelText",componentId:"sc-voere-0"})`cursor:default;`;function is(e){let t,n,r,a,i=(0,eu.c)(14),{onChange:o,value:l}=e,{t:c}=(0,s.t)(),d;return i[0]===c?d=i[1]:(d=c("calendar.action.include-time-label"),i[0]=c,i[1]=d),i[2]!==o||i[3]!==d?(t=(0,em.jsx)(ey.t,{children:(0,em.jsx)(il,{muted:!0,onClick:o,size:1,weight:"medium",children:d})}),i[2]=o,i[3]=d,i[4]=t):t=i[4],i[5]===c?n=i[6]:(n=c("calendar.action.include-time-label"),i[5]=c,i[6]=n),i[7]!==o||i[8]!==n||i[9]!==l?
32(r=(0,em.jsx)(eg.dO,{checked:l,label:n,onChange:o}),i[7]=o,i[8]=n,i[9]=l,i[10]=r):r=i[10],i[11]!==t||i[12]!==r?(a=(0,em.jsxs)(eS.so,{alignItems:"center",gap:2,justifyContent:"flex-end",marginTop:1,children:[t,r]}),i[11]=t,i[12]=r,i[13]=a):a=i[13],a}function ic(){let e=(0,O.useContext)(ep.Yi);if(void 0===e)throw Error("useCalendar must be used within an CalendarContext.Provider");return e}function id(e){let t,n,r,i,o,l,d,u,m,p,f,y,h=(0,eu.c)(39),{t:g}=(0,s.t)(),b;h[0]===Symbol.for("react.memo_cache_sentinel")?(b={month:"long",year:"numeric"},h[0]=b):b=h[0];let v=(0,a.Pi)(b),{focusedDate:x}=ic(),{moveFocusedDate:w,onNowClick:_}=e,S;h[1]===w?S=h[2]:(S=()=>w(-1),h[1]=w,h[2]=S);let k=S,C;h[3]===w?C=h[4]:(C=()=>w(1),h[3]=w,h[4]=C);let j=C,I;return h[5]!==x||h[6]!==v?(I=(0,tk.A)(v.format(x)),h[5]=x,h[6]=v,h[7]=I):I=h[7],h[8]===I?t=h[9]:(t=(0,em.jsx)(ex.r,{paddingLeft:2,gap:1,children:(0,em.jsx)(ey.n,{size:1,weight:"medium",children:I})}),h[8]=I,h[9]=t),h[10]===g?n=h[11]:(n=g("calendar.action.go-to-today-aria-label"),h[10]=g,h[11]=n),h[12]===g?r=h[13]:(r=g("calendar.action.go-to-today"),h[12]=g,h[13]=r),h[14]!==_||h[15]!==n||h[16]!==r?(i=(0,em.jsx)(c.o,{"aria-label":n,mode:"bleed",onClick:_,text:r}),h[14]=_,h[15]=n,h[16]=r,h[17]=i):i=h[17],h[18]===g?o=h[19]:(o=g("calendar.action.go-to-previous-month"),h[18]=g,h[19]=o),h[20]===o?l=h[21]:(l={content:o},h[20]=o,h[21]=l),h[22]!==k||h[23]!==l?(d=(0,em.jsx)(c.o,{icon:tf.ChevronLeftIcon,mode:"bleed",onClick:k,tooltipProps:l}),h[22]=k,h[23]=l,h[24]=d):d=h[24],h[25]===g?u=h[26]:(u=g("calendar.action.go-to-next-month"),h[25]=g,h[26]=u),h[27]===u?m=h[28]:(m={content:u},h[27]=u,h[28]=m),h[29]!==j||h[30]!==m?(p=(0,em.jsx)(c.o,{icon:e6.ChevronRightIcon,mode:"bleed",onClick:j,tooltipProps:m}),h[29]=j,h[30]=m,h[31]=p):p=h[31],h[32]!==d||h[33]!==p||h[34]!==i?(f=(0,em.jsxs)(eS.so,{alignItems:"center",children:[i,d,p]}),h[32]=d,h[33]=p,h[34]=i,h[35]=f):f=h[35],h[36]!==f||h[37]!==t?(y=(0,em.jsxs)(eS.so,{alignItems:"center",flexBasis:"0%",flexGrow:1,justifyContent:"space-between",children:[t,f]}),h[36]=f,h[37]=t,h[38]=y):y=h[38],y}let iu=e_.I4.svg.withConfig({displayName:"CircleSvg",componentId:"sc-2qpz9y-0"})(({theme:e})=>(0,e_.AH)`bottom:0;left:0;position:absolute;right:0;top:0;circle{stroke:${e.sanity.color.card.enabled.border};stroke-width:3;fill:none;}`),im=(0,e_.I4)(eh.s).withConfig({displayName:"CustomCard",componentId:"sc-2qpz9y-1"})`position:relative;&[data-focused='true']{z-index:1;}&[data-start-date='true']{border-top-right-radius:0;border-bottom-right-radius:0;}&[data-end-date='true']{border-top-left-radius:0;border-bottom-left-radius:0;}&[data-within-range='true']{border-radius:0;}`;function ip(e){let t,n,r=(0,eu.c)(41),{date:a,onSelect:i}=e,o;r[0]!==a||r[1]!==i?(o=()=>{i(a)},r[0]=a,r[1]=i,r[2]=o):o=r[2];let l=o,{date:s,endDate:c,focusedDate:d,selectRange:u}=ic(),m;r[3]!==a||r[4]!==s?(m=s&&(0,tg.r)(a,s),r[3]=a,r[4]=s,r[5]=m):m=r[5];let p=m,f;r[6]!==a||r[7]!==u||r[8]!==s?(f=u&&s&&(0,tg.r)(a,s),r[6]=a,r[7]=u,r[8]=s,r[9]=f):f=r[9];let y=f,h;r[10]!==a||r[11]!==u||r[12]!==c?(h=u&&c&&(0,tg.r)(a,c),r[10]=a,r[11]=u,r[12]=c,r[13]=h):h=r[13];let g=h,b;r[14]!==a||r[15]!==d?(b=(0,tb.t)(a,d),r[14]=a,r[15]=d,r[16]=b):b=r[16];let v=b,x=d&&(0,tg.r)(a,d),w;r[17]===a?w=r[18]:(w=(0,tg.r)(a,new Date),r[17]=a,r[18]=w);let _=w,S=s&&c&&!y&&!g&&(0,tT.d)(a,s)&&(0,tE.Y)(a,c),k;r[19]===a?k=r[20]:(k=a.toDateString(),r[19]=a,r[20]=k);let C=!!g||void 0,j=x?"true":"",I=!!y||void 0,T=!!S||void 0,E=p||y||g,$=S?"primary":"default",A;r[21]===_?A=r[22]:(A=_&&(0,em.jsx)(iu,{height:"100%",preserveAspectRatio:"xMidYMid meet",vectorEffect:"non-scaling-stroke",viewBox:"0 0 100 100",width:"100%",children:(0,em.jsx)("circle",{cx:"50",cy:"50",r:"40%"})}),r[21]=_,r[22]=A);let q=!p&&!v,D=v?"medium":"regular",N;return r[23]===a?N=r[24]:(N=a.getDate(),r[23]=a,r[24]=N),r[25]!==q||r[26]!==D||r[27]!==N?(t=(0,em.jsx)(ey.n,{align:"center",muted:q,size:1,weight:D,children:N}),r[25]=q,r[26]=D,r[27]=N,r[28]=t):t=r[28],r[29]!==l||r[30]!==p||r[31]!==I||r[32]!==T||r[33]!==E||r[34]!==$||r[35]!==A||r[36]!==t||r[37]!==k||r[38]!==C||r[39]!==j?(n=(0,em.jsxs)(im,{__unstable_focusRing:!0,"aria-label":k,"aria-pressed":p,"data-end-date":C,"data-focused":j,"data-ui":"CalendarDay","aria-selected":p,"data-start-date":I,"data-within-range":T,forwardedAs:"button",onClick:l,paddingX:3,paddingY:2,radius:2,role:"button",selected:E,tabIndex:-1,tone:$,children:[A,t]}
32),r[29]=l,r[30]=p,r[31]=I,r[32]=T,r[33]=E,r[34]=$,r[35]=A,r[36]=t,r[37]=k,r[38]=C,r[39]=j,r[40]=n):n=r[40],n}let iy=["calendar.weekday-names.short.monday","calendar.weekday-names.short.tuesday","calendar.weekday-names.short.wednesday","calendar.weekday-names.short.thursday","calendar.weekday-names.short.friday","calendar.weekday-names.short.saturday","calendar.weekday-names.short.sunday"],ih=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],ig=[1,2,3,4,5,6];function ib(e){return{number:(0,tx.N)(e[0]),days:e}}let iv={1:iy,6:[...iy.slice(5),...iy.slice(0,5)],7:[iy[6],...iy.slice(0,6)]},ix=(0,e_.I4)(eS.xA).withConfig({displayName:"CustomGrid",componentId:"sc-xkhypy-0"})`grid-template-columns:repeat(7,minmax(44px,auto));`;function iw(e){let t,n,r=(0,eu.c)(16),{hidden:a,onSelect:i}=e,{focusedDate:o,firstWeekDay:l}=ic(),{t:c}=(0,s.t)(),d=a||!1,u=iv[l],m;if(r[0]!==c||r[1]!==u){let e;r[3]===c?e=r[4]:(e=e=>(0,em.jsx)(eS.az,{paddingBottom:3,paddingTop:2,children:(0,em.jsx)(ey.n,{align:"center",size:1,weight:"medium",children:c(e)})},e),r[3]=c,r[4]=e),m=u.map(e),r[0]=c,r[1]=u,r[2]=m}else m=r[2];let p=(e=>{var t;let n,r=(0,eu.c)(3),{weekInfo:a}=(0,h.t)(),i;return r[0]!==e||r[1]!==a.firstDay?(i=(t=a.firstDay,n=(0,t_.w)(e),(0,tv.Y)({start:n,end:(0,tw.W)(n)},{weekStartsOn:7===t?0:t}).map(e=>[e,...ig.map(t=>(0,ty.f)(e,t))])).map(ib),r[0]=e,r[1]=a.firstDay,r[2]=i):i=r[2],i})(o),f;if(r[5]!==i||r[6]!==p){let e;r[8]===i?e=r[9]:(e=(e,t)=>e.days.map((e,n)=>(0,em.jsx)(ip,{date:e,onSelect:i},`${t}-${n}`)),r[8]=i,r[9]=e),f=p.map(e),r[5]=i,r[6]=p,r[7]=f}else f=r[7];return r[10]!==m||r[11]!==f?(t=(0,em.jsxs)(ix,{rowGap:1,children:[m,f]}),r[10]=m,r[11]=f,r[12]=t):t=r[12],r[13]!==d||r[14]!==t?(n=(0,em.jsx)(eS.az,{"aria-hidden":d,"data-ui":"CalendarMonth",children:t}),r[13]=d,r[14]=t,r[15]=n):n=r[15],n}let i_=(0,em.jsx)("span",{"data-preserve-focus":!0,style:{overflow:"hidden",position:"absolute",outline:"none"},tabIndex:-1});function iS(e){let t,n,r,a,i,o,l,s,c,d=(0,eu.c)(53),{date:u,endDate:m,onSelect:p,selectRange:f,selectTime:y}=e,[g,b]=(0,O.useState)(null),[v,x]=(0,O.useState)(!1),w;d[0]===u?w=d[1]:(w=u||new Date,d[0]=u,d[1]=w);let[_,S]=(0,O.useState)(w),k=(0,O.useRef)(u||null),C=(0,O.useRef)(m||null),{weekInfo:j}=(0,h.t)(),{firstDay:I}=j,T;d[2]===g?T=d[3]:(T=()=>{g?.querySelector('[data-focused="true"]')?.focus()},d[2]=g,d[3]=T);let E=T,$;d[4]!==u||d[5]!==m||d[6]!==p||d[7]!==v||d[8]!==f?($=e=>{let t=(0,tZ.h)(e,{hours:e.getHours(),minutes:e.getMinutes(),seconds:0,milliseconds:0}),n=u&&(0,tE.Y)(t,u),r=m&&(0,tT.d)(t,m);if(f){if(n||r)return void p({date:t,endDate:null});
32p(v?{date:u||null,endDate:t}:{date:t,endDate:u?null:m||null})}else p({date:t})},d[4]=u,d[5]=m,d[6]=p,d[7]=v,d[8]=f,d[9]=$):$=d[9];let A=$,q;d[10]!==p||d[11]!==f?(q=()=>{let e=new Date;f?S(e):p({date:e})},d[10]=p,d[11]=f,d[12]=q):q=d[12];let D=q,N;d[13]!==g||d[14]!==E||d[15]!==_?(N=e=>{if(ih.includes(e.key)){if(e.preventDefault(),e.target.hasAttribute("data-calendar-grid"))return void E();"ArrowUp"===e.key&&S((0,ty.f)(_,-7)),"ArrowDown"===e.key&&S((0,ty.f)(_,7)),"ArrowLeft"===e.key&&S((0,ty.f)(_,-1)),"ArrowRight"===e.key&&S((0,ty.f)(_,1)),g?.querySelector("[data-preserve-focus]")?.focus()}},d[13]=g,d[14]=E,d[15]=_,d[16]=N):N=d[16];let V=N,F;d[17]===_?F=d[18]:(F=e=>S((0,th.P)(_,e)),d[17]=_,d[18]=F);let z=F,M,L;d[19]===E?(M=d[20],L=d[21]):(M=()=>{E()},L=[E],d[19]=E,d[20]=M,d[21]=L),(0,O.useEffect)(M,L),d[22]===E?t=d[23]:(t=()=>{document.activeElement?.matches("[data-calendar-grid], [data-calendar-grid] [data-preserve-focus]")&&E()},d[22]=E,d[23]=t),d[24]!==E||d[25]!==_?(n=[E,_],d[24]=E,d[25]=_,d[26]=n):n=d[26],(0,O.useEffect)(t,n),d[27]!==u||d[28]!==m||d[29]!==p?(r=()=>{let e=u?.getTime()!==k.current?.getTime(),t=m?.getTime()!==C.current?.getTime(),n=u&&m&&(0,tT.d)(u,m);e&&!t&&(n&&(x(!0),p({date:u,endDate:null})),x(!!u),u&&S(u)),!e&&t&&(n&&(x(!0),p({date:m,endDate:null})),x(!!u&&!m),m&&S(m)),e&&t&&(x(!0),u&&S(u)),k.current=u||null,C.current=m||null},a=[u,m,p],d[27]=u,d[28]=m,d[29]=p,d[30]=r,d[31]=a):(r=d[30],a=d[31]),(0,O.useEffect)(r,a),d[32]!==u||d[33]!==m||d[34]!==I||d[35]!==_||d[36]!==f||d[37]!==y?(i={date:u,endDate:m,focusedDate:_,selectRange:f,selectTime:y,firstWeekDay:I},d[32]=u,d[33]=m,d[34]=I,d[35]=_,d[36]=f,d[37]=y,d[38]=i):i=d[38];let P=i,R;return d[39]!==D||d[40]!==z?(R=(0,em.jsx)(eS.so,{children:(0,em.jsx)(eS.az,{flexBasis:"0%",flexGrow:1,children:(0,em.jsx)(id,{moveFocusedDate:z,onNowClick:D})})}),d[39]=D,d[40]=z,d[41]=R):R=d[41],d[42]===A?o=d[43]:(o=(0,em.jsx)(iw,{onSelect:A}),d[42]=A,d[43]=o),d[44]!==V||d[45]!==o?(l=(0,em.jsxs)(eS.az,{"data-calendar-grid":!0,onKeyDown:V,marginTop:2,overflow:"hidden",tabIndex:0,children:[o,i_]}),d[44]=V,d[45]=o,d[46]=l):l=d[46],d[47]!==R||d[48]!==l?(s=(0,em.jsxs)(eS.az,{"data-ui":"Calendar",ref:b,children:[R,l]}),d[47]=R,d[48]=l,d[49]=s):s=d[49],d[50]!==s||d[51]!==P?(c=(0,em.jsx)(ep.Yi.Provider,{value:P,children:s}),d[50]=s,d[51]=P,d[52]=c):c=d[52],c}function ik(e){let t=(0,eu.c)(8),{date:n,endDate:r,onChange:a,selectRange:i,selectTime:o}=e,l;t[0]===a?l=t[1]:(l=e=>{a(e)},t[0]=a,t[1]=l);let s=l,c;return t[2]!==n||t[3]!==r||t[4]!==s||t[5]!==i||t[6]!==o?(c=(0,em.jsx)(iS,{date:n,endDate:r,onSelect:s,selectRange:i,selectTime:o}),t[2]=n,t[3]=r,t[4]=s,t[5]=i,t[6]=o,t[7]=c):c=t[7],c}function iC({date:e,dateOnly:t,roundDay:n}){let r;switch(n){case"end":r=(0,tU.D)(e);break;case"start":r=(0,tB.o)(e);break;default:r=e}return t?r.toISOString().split("T")[0]:r.toISOString()}let ij="Jan 1, 2000",iI="MMM d, yyyy",iT="Jan 1, 2000 12:00 AM",iE="MMM d, yyyy p";function i$(e){let t,n,r=(0,eu.c)(53),a,i,o,l,d,u;r[0]===e?(a=r[1],i=r[2],o=r[3],l=r[4],d=r[5],u=r[6]):({isDateTime:a,onChange:o,placeholderDate:l,isDateTimeFormat:i,value:u,...d}=e,r[0]=e,r[1]=a,r[2]=i,r[3]=o,r[4]=l,r[5]=d,r[6]=u);let{t:m}=(0,s.t)(),p=i?iE:iI,[f,y]=(0,O.useState)(void 0),h;r[7]!==p||r[8]!==u?(h=()=>{if(!u)return"";let e=new Date(u);return(0,tp.GP)(e,p)},r[7]=p,r[8]=u,r[9]=h):h=r[9];let[g,b]=(0,O.useState)(h),x;r[10]===l?x=r[11]:(x=l||new Date,r[10]=l,r[11]=x);let w=x,_;r[12]!==w||r[13]!==p?(_=(0,tp.GP)(w,p),r[12]=w,r[13]=p,r[14]=_):_=r[14];let S=_,k;r[15]!==p||r[16]!==a||r[17]!==o?(k=e=>{let{dateString:t,triggerOnChange:n}=e;if(!t)return;let r=(0,e2.qg)(t,p,new Date),i=(0,e1.f)(r);i&&(n&&o(iC({date:r,dateOnly:!a})),b((0,tp.GP)(r,p))),y(i?void 0:`Invalid ${a?"datetime":"date"}`)},r[15]=p,r[16]=a,r[17]=o,r[18]=k):k=r[18];let C=k,j;r[19]!==g||r[20]!==C?(j=()=>{C({dateString:g,triggerOnChange:!0})},r[19]=g,r[20]=C,r[21]=j):j=r[21];let I=j,T;r[22]===Symbol.for("react.memo_cache_sentinel")?(T=e=>{b(e.currentTarget.value)},r[22]=T):T=r[22];let E=T,$;r[23]===o?$=r[24]:($=()=>{o(null),y(void 0),b("")},r[23]=o,r[24]=$);let A=$,q;r[25]!==g||r[26]!==C?(q=e=>{"Enter"===e.key&&C({dateString:g,triggerOnChange:!0})},r[25]=g,r[26]=C,r[27]=q):q=r[27];let D=q,N;r[28]!==p||r[29]!==C||r[30]!==u?(N=()=>{let e=u&&new Date(u);e&&C({dateString:(0,tp.GP)(e,p),triggerOnChange:!1})},r[28]=p,r[29]=C,r[30]=u,r[31]=N):N=r[31],r[32]!==p||r[33]!==i||r[34]!==C||r[35]!==u?(t=[p,C,i,u],r[32]=p,r[33]=i,r[34]=C,r[35]=u,r[36]=t):t=r[36],(0,O.useEffect)(N,t);let V=i?iT:ij,F;r[37]!==m||r[38]!==V?(F=m("calendar.error.must-be-in-format",{exampleDate:V}),r[37]=m,r[38]=V,r[39]=F):F=r[39];let z=!f,M=!!g,L;return r[40]!==f||r[41]!==S||r[42]!==I||r[43]!==A||r[44]!==D||r[45]!==g||r[46]!==d||r[47]!==M?(L=(0,em.jsx)(v.u,{...d,clearButton:M,customValidity:f,onBlur:I,onChange:E,onClear:A,onKeyDown:D,placeholder:S,value:g}),r[40]=f,r[41]=S,r[42]=I,r[43]=A,r[44]=D,r[45]=g,r[46]=d,r[47]=M,r[48]=L):L=r[48],r[49]!==F||r[50]!==z||r[51]!==L?(n=(0,em.jsx)(c.s,{content:F,disabled:z,placement:"top",portal:!0,children:L}),r[49]=F,r[50]=z,r[51]=L,r[52]=n):n=r[52],n}function iA(e){let t,n,r,a,i=(0,eu.c)(36),{direction:o,isDateTime:l,onCh
32ange:c,value:d}=e,{state:u}=(0,v.b)(),{fullscreen:m}=u,{t:p}=(0,s.t)(),f;switch(o){case"after":f="end";break;case"before":f="start";break;default:f=void 0}let y=f,h;i[0]!==l||i[1]!==c||i[2]!==y||i[3]!==d?.includeTime?(h=e=>{let{date:t}=e,n=null;t&&(n=iC({date:t,dateOnly:!l,roundDay:d?.includeTime?void 0:y})),c({includeTime:d?.includeTime,date:n})},i[0]=l,i[1]=c,i[2]=y,i[3]=d?.includeTime,i[4]=h):h=i[4],d?.includeTime;let g=h,b;i[5]!==l||i[6]!==c||i[7]!==y||i[8]!==d?(b=()=>{let e=!d?.includeTime,t=d?.date?new Date(d.date):null,n=null;t&&(n=iC({date:t,dateOnly:!l,roundDay:e?"start":y})),c({includeTime:e,date:n})},i[5]=l,i[6]=c,i[7]=y,i[8]=d,i[9]=b):b=i[9];let x=b,w;i[10]!==c||i[11]!==d?.includeTime?(w=e=>{c({includeTime:d?.includeTime,date:e||null})},i[10]=c,i[11]=d?.includeTime,i[12]=w):w=i[12],d?.includeTime;let _=w,S;i[13]===p?S=i[14]:(S=p("search.filter-date-aria-label"),i[13]=p,i[14]=S);let k=m?2:1,C=l&&d?.includeTime,j=d?.date,I;return i[15]!==_||i[16]!==l||i[17]!==S||i[18]!==k||i[19]!==C||i[20]!==j?(I=(0,em.jsx)(i$,{"aria-label":S,fontSize:k,isDateTime:l,isDateTimeFormat:C,onChange:_,radius:2,value:j}),i[15]=_,i[16]=l,i[17]=S,i[18]=k,i[19]=C,i[20]=j,i[21]=I):I=i[21],i[22]===d?t=i[23]:(t=d?.date?new Date(d.date):void 0,i[22]=d,i[23]=t),i[24]!==g||i[25]!==l||i[26]!==t?(n=(0,em.jsx)(ik,{date:t,onChange:g,selectTime:l}),i[24]=g,i[25]=l,i[26]=t,i[27]=n):n=i[27],i[28]!==x||i[29]!==l||i[30]!==d?.includeTime?(r=l&&(0,em.jsx)(is,{onChange:x,value:!!d?.includeTime}),i[28]=x,i[29]=l,i[30]=d?.includeTime,i[31]=r):r=i[31],i[32]!==I||i[33]!==n||i[34]!==r?(a=(0,em.jsxs)(ey.t,{gap:3,children:[I,n,r]}),i[32]=I,i[33]=n,i[34]=r,i[35]=a):a=i[35],a}function iq(e){let t,n,r,a,i=(0,eu.c)(34),{isDateTime:o,onChange:l,value:c}=e,{state:d}=(0,v.b)(),{fullscreen:u}=d,{t:m}=(0,s.t)(),p;i[0]!==o||i[1]!==l||i[2]!==c?.includeTime?(p=e=>{let{date:t}=e;if(t){let e=iC({date:t,dateOnly:!o});l({includeTime:c?.includeTime,date:e})}else l(null)},i[0]=o,i[1]=l,i[2]=c?.includeTime,i[3]=p):p=i[3],c?.includeTime;let f=p,y;i[4]!==o||i[5]!==l||i[6]!==c?(y=()=>{let e=!c?.includeTime,t=c?.date?new Date(c.date):null,n=null;t&&(n=iC({date:t,dateOnly:!o})),l({includeTime:e,date:n})},i[4]=o,i[5]=l,i[6]=c,i[7]=y):y=i[7];let h=y,g;i[8]!==l||i[9]!==c?.includeTime?(g=e=>{l({includeTime:c?.includeTime,date:e||null})},i[8]=l,i[9]=c?.includeTime,i[10]=g):g=i[10],c?.includeTime;let b=g,x;i[11]===m?x=i[12]:(x=m("search.filter-date-aria-label"),i[11]=m,i[12]=x);let w=u?2:1,_=o&&c?.includeTime,S=c?.date,k;return i[13]!==b||i[14]!==o||i[15]!==x||i[16]!==w||i[17]!==_||i[18]!==S?(k=(0,em.jsx)(i$,{"aria-label":x,fontSize:w,isDateTime:o,isDateTimeFormat:_,onChange:b,radius:2,value:S}),i[13]=b,i[14]=o,i[15]=x,i[16]=w,i[17]=_,i[18]=S,i[19]=k):k=i[19],i[20]===c?t=i[21]:(t=c?.date?new Date(c.date):void 0,i[20]=c,i[21]=t),i[22]!==f||i[23]!==o||i[24]!==t?(n=(0,em.jsx)(ik,{date:t,onChange:f,selectTime:o}),i[22]=f,i[23]=o,i[24]=t,i[25]=n):n=i[25],i[26]!==h||i[27]!==o||i[28]!==c?.includeTime?(r=o&&(0,em.jsx)(is,{onChange:h,value:!!c?.includeTime}),i[26]=h,i[27]=o,i[28]=c?.includeTime,i[29]=r):r=i[29],i[30]!==n||i[31]!==r||i[32]!==k?(a=(0,em.jsxs)(ey.t,{gap:3,children:[k,n,r]}),i[30]=n,i[31]=r,i[32]=k,i[33]=a):a=i[33],a}function iD(e){let t=(0,eu.c)(2),n;return t[0]===e?n=t[1]:(n=(0,em.jsx)(iq,{...e,isDateTime:!1}),t[0]=e,t[1]=n),n}let iN=[{unit:"day",key:"search.filter-date-unit_days"},{unit:"month",key:"search.filter-date-unit_months"},{unit:"year",key:"search.filter-date-unit_years"}];function iV(e){let t,n,r,a=(0,eu.c)(26),{onChange:i,value:o}=e,[l,c]=(0,O.useState)(o?.unitValue||""),d=(0,O.useRef)("day"),u=(0,O.useRef)(o?.unitValue||null),{t:m}=(0,s.t)(),{state:p}=(0,v.b)(),{fullscreen:f}=p,y;a[0]===i?y=a[1]:(y=()=>{i({unit:d?.current,unitValue:u?.current})},a[0]=i,a[1]=y);let h=y,g;a[2]===h?g=a[3]:(g=e=>{d.current=e.currentTarget.value,h()},a[2]=h,a[3]=g);let b=g,x;a[4]===h?x=a[5]:(x=e=>{c(e.currentTarget.value);let t=parseFloat(e.currentTarget.value);u.current=Number.isFinite(t)?t:null,h()},a[4]=h,a[5]=x);let w=x,_;a[6]===m?_=a[7]:(_=m("search.filter-date-value-aria-label"),a[6]=m,a[7]=_);let S=f?2:1,k;a[8]!==w||a[9]!==_||a[10]!==S||a[11]!==l?(k=(0,em.jsx)(eS.az,{flexBasis:"0%",flexGrow:1,children:(0,em.jsx)(eb.t,{"aria-label":_,fontSize:S,onChange:w,pattern:"\\d*",radius:2,step:"1",type:"number",value:l})}),a[8]=w,a[9]=_,a[10]=S,a[11]=l,a[12]=k):k=a[12],a[13]===m?t=a[14]:(t=m("search.filter-date-unit-aria-label"),a[13]=m,a[14]=t);let C=f?2:1,j=o?.unit,I;return a[15]===m?I=a[16]:(I=iN.map(e=>(0,em.jsx)("option",{value:e.unit,children:m(e.key)},e.key)),a[15]=m,a[16]=I),a[17]!==b||a[18]!==j||a[19]!==I||a[20]!==t||a[21]!==C?(n=(0,em.jsx)(eS.az,{flexBasis:"0%",flexGrow:1,children:(0,em.jsx)(eg.l6,{"aria-label":t,fontSize:C,onChange:b,radius:2,value:j,children:I})}),a[17]=b,a[18]=j,a[19]=I,a[20]=t,a[21]=C,a[22]=n):n=a[22],a[23]!==n||a[24]!==k?(r=(0,em.jsxs)(eS.so,{gap:2,children:[k,n]}),a[23]=n,a[24]=k,a[25]=r):r=a[25],r}function iF(e){let t,n,r,a,i,o,l,c=(0,eu.c)(56),{isDateTime:d,onChange:u,value:m}=e,{t:p}=(0,s.t)(),{state:f}=(0,v.b)(),{fullscreen:y}=f,[h]=(0,O.useState)(iz),[g]=(0,O.useState)(iO),b;c[0]!==d||c[1]!==u||c[2]!==m?.includeTime?(b=e=>{let{date:t,endDate:n}=e;u(iM({date:t,endDate:n,includeTime:m?.includeTime,isDateTime:d}))},c[0]=d,c[1]=u,c[2]=m?.includeTime,c[3]=b):b=c[3],m?.includeTime;let x=b,w;c[4]!==d||c[5]!==u||c[6]!==m?(w=()=>{let e=!m?.includeTime;
32u(iM({date:m?.from?new Date(m.from):null,endDate:m?.to?new Date(m.to):null,includeTime:e,isDateTime:d}))},c[4]=d,c[5]=u,c[6]=m,c[7]=w):w=c[7];let _=w,S;c[8]!==u||c[9]!==m?.from||c[10]!==m?.includeTime?(S=e=>{u({includeTime:m?.includeTime,to:e||null,from:m?.from||null})},c[8]=u,c[9]=m?.from,c[10]=m?.includeTime,c[11]=S):S=c[11];let k=S,C;c[12]!==u||c[13]!==m?.includeTime||c[14]!==m?.to?(C=e=>{u({includeTime:m?.includeTime,to:m?.to||null,from:e||null})},c[12]=u,c[13]=m?.includeTime,c[14]=m?.to,c[15]=C):C=c[15];let j=C,I;c[16]===p?I=c[17]:(I=p("search.filter-date-range-start-date-aria-label"),c[16]=p,c[17]=I);let T=y?2:1,E=d&&m?.includeTime,$=m?.from,A;c[18]!==j||c[19]!==d||c[20]!==h||c[21]!==I||c[22]!==T||c[23]!==E||c[24]!==$?(A=(0,em.jsx)(i$,{"aria-label":I,fontSize:T,isDateTime:d,isDateTimeFormat:E,onChange:j,placeholderDate:h,radius:2,value:$}),c[18]=j,c[19]=d,c[20]=h,c[21]=I,c[22]=T,c[23]=E,c[24]=$,c[25]=A):A=c[25],c[26]===p?t=c[27]:(t=p("search.filter-date-range-end-date-aria-label"),c[26]=p,c[27]=t);let q=y?2:1,D=d&&m?.includeTime,N=m?.to,V;return c[28]!==k||c[29]!==d||c[30]!==g||c[31]!==t||c[32]!==q||c[33]!==D||c[34]!==N?(V=(0,em.jsx)(i$,{"aria-label":t,fontSize:q,isDateTime:d,isDateTimeFormat:D,onChange:k,placeholderDate:g,radius:2,value:N}),c[28]=k,c[29]=d,c[30]=g,c[31]=t,c[32]=q,c[33]=D,c[34]=N,c[35]=V):V=c[35],c[36]!==A||c[37]!==V?(n=(0,em.jsxs)(eS.so,{flexDirection:"column",gap:3,children:[A,V]}),c[36]=A,c[37]=V,c[38]=n):n=c[38],c[39]===m?r=c[40]:(r=m?.from?new Date(m.from):void 0,c[39]=m,c[40]=r),c[41]===m?a=c[42]:(a=m?.to?new Date(m.to):void 0,c[41]=m,c[42]=a),c[43]!==x||c[44]!==d||c[45]!==r||c[46]!==a?(i=(0,em.jsx)(ik,{date:r,endDate:a,onChange:x,selectRange:!0,selectTime:d}),c[43]=x,c[44]=d,c[45]=r,c[46]=a,c[47]=i):i=c[47],c[48]!==_||c[49]!==d||c[50]!==m?.includeTime?(o=d&&(0,em.jsx)(is,{onChange:_,value:!!m?.includeTime}),c[48]=_,c[49]=d,c[50]=m?.includeTime,c[51]=o):o=c[51],c[52]!==n||c[53]!==i||c[54]!==o?(l=(0,em.jsx)("div",{children:(0,em.jsxs)(ey.t,{gap:3,children:[n,i,o]})}),c[52]=n,c[53]=i,c[54]=o,c[55]=l):l=c[55],l}function iO(){return new Date}function iz(){return(0,ty.f)(new Date,-7)}function iM({date:e,endDate:t,includeTime:n,isDateTime:r}){return n?{includeTime:n,to:t?iC({date:t,dateOnly:!r,roundDay:"start"}):null,from:e?iC({date:e,dateOnly:!r,roundDay:"start"}):null}:{includeTime:n,to:t?iC({date:t,dateOnly:!r,roundDay:"end"}):null,from:e?iC({date:e,dateOnly:!r,roundDay:"start"}):null}}function iL(e){let t=(0,eu.c)(2),n;return t[0]===e?n=t[1]:(n=(0,em.jsx)(iq,{...e,isDateTime:!0}),t[0]=e,t[1]=n),n}let iP={buttonValueComponent:a$,initialValue:null},iR={buttonValueComponent:a$,initialValue:null},iU={buttonValueComponent:a$,initialValue:{date:null,includeTime:!1}},iK={buttonValueComponent:function(e){let t,n=(0,eu.c)(6),{value:r}=e,i=(0,a.Ci)(),o=Math.floor(r?.unitValue??0),l;return n[0]!==i||n[1]!==o||n[2]!==r.unit?(l=i(o,r.unit),n[0]=i,n[1]=o,n[2]=r.unit,n[3]=l):l=n[3],n[4]===l?t=n[5]:(t=(0,em.jsx)(em.Fragment,{children:l}),n[4]=l,n[5]=t),t}},iB={buttonValueComponent:a$,initialValue:{date:null,includeTime:!1}},iW={initialValue:null},iH={dateAfter:{...iP,nameKey:"search.operator.date-after.name",descriptionKey:"search.operator.date-after.description",groqFilter:({fieldPath:e,value:t})=>t?.date&&e?`${e} > ${a0(t?.date)}`:null,inputComponent:function(e){let t=(0,eu.c)(2),n;return t[0]===e?n=t[1]:(n=(0,em.jsx)(iA,{...e,direction:"after",isDateTime:!1}),t[0]=e,t[1]=n),n},type:"dateAfter"},dateBefore:{...iR,nameKey:"search.operator.date-before.name",descriptionKey:"search.operator.date-before.description",groqFilter:({fieldPath:e,value:t})=>t?.date&&e?`${e} < ${a0(t?.date)}`:null,inputComponent:function(e){let t=(0,eu.c)(2),n;return t[0]===e?n=t[1]:(n=(0,em.jsx)(iA,{...e,direction:"before",isDateTime:!1}),t[0]=e,t[1]=n),n},type:"dateBefore"},dateEqual:{...iU,nameKey:"search.operator.date-equal.name",descriptionKey:"search.operator.date-equal.description",groqFilter:({fieldPath:e,value:t})=>t?.date&&e?`${e} == ${a0(t.date)}`:null,inputComponent:iD,type:"dateEqual"},dateLast:{...iK,nameKey:"search.operator.date-last.name",descriptionKey:"search.operator.date-last.description",groqFilter:({fieldPath:e,value:t})=>{let n="number"==typeof t?.unitValue?Math.floor(t.unitValue):void 0,r=Number.isFinite(n)?(0,tG.j)(new Date,{days:t?.unit==="day"?n:0,months:t?.unit==="month"?n:0,years:t?.unit==="year"?n:0}
32).toISOString().split("T")[0]:null;return r&&e?`${e} > ${a0(r)}`:null},inputComponent:iV,initialValue:{unit:"day",unitValue:7},type:"dateLast"},dateNotEqual:{...iB,nameKey:"search.operator.date-not-equal.name",descriptionKey:"search.operator.date-not-equal.description",groqFilter:({fieldPath:e,value:t})=>t?.date&&e?`${e} != ${a0(t.date)}`:null,inputComponent:iD,type:"dateNotEqual"},dateRange:{...iW,nameKey:"search.operator.date-range.name",descriptionKey:"search.operator.date-range.description",buttonValueComponent:aA,groqFilter:({fieldPath:e,value:t})=>t?.to&&t?.from&&e?`${e} >= ${a0(t.from)} && ${e} <= ${a0(t.to)}`:null,initialValue:{includeTime:!1,to:(0,tH.R)().toISOString(),from:null},inputComponent:function(e){let t=(0,eu.c)(2),n;return t[0]===e?n=t[1]:(n=(0,em.jsx)(iF,{...e,isDateTime:!1}),t[0]=e,t[1]=n),n},type:"dateRange"},dateTimeAfter:{...iP,nameKey:"search.operator.date-time-after.name",descriptionKey:"search.operator.date-time-after.description",groqFilter:({fieldPath:e,value:t})=>t?.date&&e?`dateTime(${e}) > dateTime(${a0(t.date)})`:null,inputComponent:function(e){let t=(0,eu.c)(2),n;return t[0]===e?n=t[1]:(n=(0,em.jsx)(iA,{...e,direction:"after",isDateTime:!0}),t[0]=e,t[1]=n),n},type:"dateTimeAfter"},dateTimeBefore:{...iR,nameKey:"search.operator.date-time-before.name",descriptionKey:"search.operator.date-time-before.description",groqFilter:({fieldPath:e,value:t})=>t?.date&&e?`dateTime(${e}) < dateTime(${a0(t.date)})`:null,inputComponent:function(e){let t=(0,eu.c)(2),n;return t[0]===e?n=t[1]:(n=(0,em.jsx)(iA,{...e,direction:"before",isDateTime:!0}),t[0]=e,t[1]=n),n},type:"dateTimeBefore"},dateTimeEqual:{...iU,nameKey:"search.operator.date-time-equal.name",descriptionKey:"search.operator.date-time-equal.description",groqFilter:({fieldPath:e,value:t})=>{let n=t?.date&&new Date(t.date);if(!n||!(0,e1.f)(n)||!e)return null;let r=(t?.includeTime?(0,tW.c)(n):(0,tB.o)(n)).toISOString(),a=(t?.includeTime?(0,tK.V)(n):(0,tU.D)(n)).toISOString();return`dateTime(${e}) > dateTime(${a0(r)}) && dateTime(${e}) < dateTime(${a0(a)})`},inputComponent:iL,type:"dateTimeEqual"},dateTimeLast:{...iK,nameKey:"search.operator.date-time-last.name",descriptionKey:"search.operator.date-time-last.description",groqFilter:({fieldPath:e,value:t})=>{let n="number"==typeof t?.unitValue?Math.floor(t.unitValue):void 0,r=Number.isFinite(n)?(0,tG.j)(new Date,{days:t?.unit==="day"?n:0,months:t?.unit==="month"?n:0,years:t?.unit==="year"?n:0}).toISOString():null;return r&&e?`dateTime(${e}) > dateTime(${a0(r)})`:null},initialValue:{unit:"day",unitValue:7},inputComponent:iV,type:"dateTimeLast"},dateTimeNotEqual:{...iB,nameKey:"search.operator.date-time-not-equal.name",descriptionKey:"search.operator.date-time-not-equal.description",groqFilter:({fieldPath:e,value:t})=>{let n=t?.date&&new Date(t.date);if(!n||!(0,e1.f)(n)||!e)return null;let r=(t?.includeTime?(0,tW.c)(n):(0,tB.o)(n)).toISOString(),a=(t?.includeTime?(0,tK.V)(n):(0,tU.D)(n)).toISOString();return`dateTime(${e}) < dateTime(${a0(r)}) || dateTime(${e}) > dateTime(${a0(a)})`},inputComponent:iL,type:"dateTimeNotEqual"},dateTimeRange:{...iW,nameKey:"search.operator.date-time-range.name",descriptionKey:"search.operator.date-time-range.description",buttonValueComponent:aA,groqFilter:({fieldPath:e,value:t})=>t?.to&&t?.from&&e?`dateTime(${e}) >= dateTime(${a0(t.from)}) && dateTime(${e}) <= dateTime(${a0(t.to)})`:null,initialValue:{includeTime:!1,to:(0,tH.R)().toISOString(),from:null},inputComponent:function(e){let t=(0,eu.c)(2),n;return t[0]===e?n=t[1]:(n=(0,em.jsx)(iF,{...e,isDateTime:!0}),t[0]=e,t[1]=n),n},type:"dateTimeRange"}};function iG(e){let t=(0,eu.c)(9),{onChange:n,value:r}=e,{state:a}=(0,v.b)(),{fullscreen:i}=a,{t:o}=(0,s.t)(),l;t[0]===n?l=t[1]:(l=e=>n(e.currentTarget.value||null),t[0]=n,t[1]=l);let c=l,d=i?2:1,u;t[2]===o?u=t[3]:(u=o("search.filter-string-value-placeholder"),t[2]=o,t[3]=u);let m=r||"",p;return t[4]!==c||t[5]!==d||t[6]!==u||t[7]!==m?(p=(0,em.jsx)(eb.t,{fontSize:d,onChange:c,placeholder:u,radius:2,value:m}),t[4]=c,t[5]=d,t[6]=u,t[7]=m,t[8]=p):p=t[8],p}let iZ={referenceEqual:{nameKey:"search.operator.reference-equal.name",descriptionKey:"search.operator.reference-equal.description",buttonValueComponent:aq,groqFilter:({fieldPath:e,value:t})=>t?._ref&&e?`${e}._ref == ${a0(t._ref)}`:null,initialValue:null,inputComponent:aL,type:"referenceEqual"},referenceNotEqual:{nameKey:"search.operator.reference-not-equal.name",descriptionKey:"search.operator.reference-not-equal.description",buttonValueComponent:aq,groqFilter:({fieldPath:e,value:t})=>t?._ref&&e?`${e}._ref != ${a0(t._ref)}`:null,initialValue:null,inputComponent:aL,type:"referenceNotEqual"},referencesAssetFile:{nameKey:"search.operator.reference-asset-file.name",descriptionKey:"search.operator.reference-asset-file.de
32scription",buttonValueComponent:aq,groqFilter:({value:e})=>e?._ref?`references(${a0(e._ref)})`:null,initialValue:null,inputComponent:ii("file"),type:"referencesAssetFile"},referencesAssetImage:{nameKey:"search.operator.reference-asset-image.name",descriptionKey:"search.operator.reference-asset-image.description",buttonValueComponent:aq,groqFilter:({value:e})=>e?._ref?`references(${a0(e._ref)})`:null,initialValue:null,inputComponent:ii("image"),type:"referencesAssetImage"},referencesDocument:{nameKey:"search.operator.reference-document.name",descriptionKey:"search.operator.reference-document.description",buttonValueComponent:aq,groqFilter:({value:e})=>e?._ref?`references(${a0(e._ref)})`:null,initialValue:null,inputComponent:aL,type:"referencesDocument"}},iJ=Object.values({arrayCountEqual:{nameKey:"search.operator.array-count-equal.name",descriptionKey:"search.operator.array-count-equal.description",groqFilter:({fieldPath:e,value:t})=>Number.isFinite(t)&&e?`count(${e}) == ${a0(t)}`:null,initialValue:null,inputComponent:aD,type:"arrayCountEqual"},arrayCountGt:{nameKey:"search.operator.array-count-gt.name",descriptionKey:"search.operator.array-count-gt.description",groqFilter:({fieldPath:e,value:t})=>Number.isFinite(t)&&e?`count(${e}) > ${a0(t)}`:null,icon:aY,initialValue:null,inputComponent:aD,type:"arrayCountGt"},arrayCountGte:{nameKey:"search.operator.array-count-gte.name",descriptionKey:"search.operator.array-count-gte.description",groqFilter:({fieldPath:e,value:t})=>Number.isFinite(t)&&e?`count(${e}) >= ${a0(t)}`:null,icon:aJ,initialValue:null,inputComponent:aD,type:"arrayCountGte"},arrayCountLt:{nameKey:"search.operator.array-count-lt.name",descriptionKey:"search.operator.array-count-lt.description",groqFilter:({fieldPath:e,value:t})=>Number.isFinite(t)&&e?`count(${e}) < ${a0(t)}`:null,icon:aX,initialValue:null,inputComponent:aD,type:"arrayCountLt"},arrayCountLte:{nameKey:"search.operator.array-count-lte.name",descriptionKey:"search.operator.array-count-lte.description",groqFilter:({fieldPath:e,value:t})=>Number.isFinite(t)&&e?`count(${e}) <= ${a0(t)}`:null,icon:aQ,initialValue:null,inputComponent:aD,type:"arrayCountLte"},arrayCountNotEqual:{nameKey:"search.operator.array-count-not-equal.name",descriptionKey:"search.operator.array-count-not-equal.description",groqFilter:({fieldPath:e,value:t})=>Number.isFinite(t)&&e?`count(${e}) != ${a0(t)}`:null,initialValue:null,inputComponent:aD,type:"arrayCountNotEqual"},arrayCountRange:{nameKey:"search.operator.array-count-range.name",descriptionKey:"search.operator.array-count-range.description",groqFilter:({fieldPath:e,value:t})=>Number.isFinite(t?.to)&&Number.isFinite(t?.from)&&e?`count(${e}) > ${a0(t?.from)} && count(${e}) < ${a0(t?.to)}`:"",initialValue:null,inputComponent:aN,type:"arrayCountRange"},arrayListIncludes:{nameKey:"search.operator.array-list-includes.name",descriptionKey:"search.operator.array-list-includes.description",groqFilter:({fieldPath:e,value:t})=>t&&e?`${a0(t)} in ${e}`:null,initialValue:null,inputComponent:aK,type:"arrayListIncludes"},arrayListNotIncludes:{nameKey:"search.operator.array-list-not-includes.name",descriptionKey:"search.operator.array-list-not-includes.description",groqFilter:({fieldPath:e,value:t})=>t&&e?`!(${a0(t)} in ${e})`:null,initialValue:null,inputComponent:aK,type:"arrayListNotIncludes"},arrayReferenceIncludes:{nameKey:"search.operator.array-reference-includes.name",descriptionKey:"search.operator.array-reference-includes.description",buttonValueComponent:aq,groqFilter:({fieldPath:e,value:t})=>t?._ref&&e?`${a0(t._ref)} in ${e}[]._ref`:null,initialValue:null,inputComponent:aL,type:"arrayReferenceIncludes"},arrayReferenceNotIncludes:{nameKey:"search.operator.array-reference-not-includes.name",descriptionKey:"search.operator.array-reference-not-includes.description",buttonValueComponent:aq,groqFilter:({fieldPath:e,value:t})=>t?._ref&&e?`!(${a0(t._ref)} in ${e}[]._ref)`:null,initialValue:null,inputComponent:aL,type:"arrayReferenceNotIncludes"},...io,booleanEqual:{nameKey:"search.operator.boolean-equal.name",descriptionKey:"search.operator.boolean-equal.description",groqFilter:({fieldPath:e,value:t})=>void 0!==t&&e?`${e} == ${a0(t)}`:null,initialValue:!0,inputComponent:function(e){let t,n,r,a,i=(0,eu.c)(16),{onChange:o,value:l}=e,{state:c}=(0,v.b)(),{fullscreen:d}=c,{t:u}=(0,s.t)(),m;i[0]===o?m=i[1]:(m=e=>{o("true"===e.currentTarget.value)},i[0]=o,i[1]=m);let p=m,f=d?2:1,y=String(l??!0),h;return i[2]===u?h=i[3]:(h=u("search.filter-boolean-true"),i[2]=u,i[3]=h),i[4]===h?t=i[5]:(t=(0,em.jsx)("option",{value:"true",children:h}),i[4]=h,i[5]=t),i[6]===u?n=i[7]:(n=u("search.filter-boolean-false"),i[6]=u,i[7]=n),i[8]===n?r=i[9]:(r=(0,em.jsx)("option",{value:"false",children:n}),i[8]=n,i[9]=r),i[10]!==p||i[11]!==f||i[12]!==y||i[13]!==t||i[14]!==r?(a=(0,em.jsxs)(eg.l6,{fontSize:f,onChange:p,radius:2,value:y,children:[t,r]}),i[10]=p,i[11]=f,i[12]=y,i[13]=t,i[14]=r,i[15]=a):a=i[15],a},type:"booleanEqual"},...iH,defined:{nameKey:"search.operator.defined.name",descriptionKey:"search.operator.defined.description",groqFilter:({fieldPath:e})=>e?`defined(${e})`:null,type:"defined"},notDefined:{nameKey:"search.operator.not-defined.name",descriptionKey:"search.operator.not-defined.description",groqFilter:({fieldPath:e})=>e?`!defined(${e})`:null,type:"notDefined"},numberEqual:{nameKey:"search.operator.number-equal.name",descriptionKey:"search.operator.number-equal.description",groqFilter:({fieldPath:e,value:t})=>Number.isFinite(t)&&e?`${e} == ${a0(t)}`:null,initialValue:null,inputComponent:aD,type:"numberEqual"}
32,numberGt:{nameKey:"search.operator.number-gt.name",descriptionKey:"search.operator.number-gt.description",groqFilter:({fieldPath:e,value:t})=>Number.isFinite(t)&&e?`${e} > ${a0(t)}`:null,icon:aY,initialValue:null,inputComponent:aD,type:"numberGt"},numberGte:{nameKey:"search.operator.number-gte.name",descriptionKey:"search.operator.number-gte.description",groqFilter:({fieldPath:e,value:t})=>Number.isFinite(t)&&e?`${e} >= ${a0(t)}`:null,icon:aJ,initialValue:null,inputComponent:aD,type:"numberGte"},numberLt:{nameKey:"search.operator.number-lt.name",descriptionKey:"search.operator.number-lt.description",groqFilter:({fieldPath:e,value:t})=>Number.isFinite(t)&&e?`${e} < ${a0(t)}`:null,icon:aX,initialValue:null,inputComponent:aD,type:"numberLt"},numberLte:{nameKey:"search.operator.number-lte.name",descriptionKey:"search.operator.number-lte.description",groqFilter:({fieldPath:e,value:t})=>Number.isFinite(t)&&e?`${e} <= ${a0(t)}`:null,icon:aQ,initialValue:null,inputComponent:aD,type:"numberLte"},numberNotEqual:{nameKey:"search.operator.number-not-equal.name",descriptionKey:"search.operator.number-not-equal.description",groqFilter:({fieldPath:e,value:t})=>Number.isFinite(t)&&e?`${e} != ${a0(t)}`:null,initialValue:null,inputComponent:aD,type:"numberNotEqual"},numberRange:{nameKey:"search.operator.number-range.name",descriptionKey:"search.operator.number-range.description",groqFilter:({fieldPath:e,value:t})=>Number.isFinite(t?.to)&&Number.isFinite(t?.from)&&e?`${e} > ${a0(t?.from)} && ${e} < ${a0(t?.to)}`:"",initialValue:null,inputComponent:aN,type:"numberRange"},portableTextEqual:{nameKey:"search.operator.portable-text-equal.name",descriptionKey:"search.operator.portable-text-equal.description",groqFilter:({fieldPath:e,value:t})=>t&&e?`pt::text(${e}) == ${a0(t)}`:null,initialValue:null,inputComponent:iG,type:"portableTextEqual"},portableTextMatches:{nameKey:"search.operator.portable-text-contains.name",descriptionKey:"search.operator.portable-text-contains.description",groqFilter:({fieldPath:e,value:t})=>t&&e?`pt::text(${e}) match ${a0(t)}`:null,initialValue:null,inputComponent:iG,type:"portableTextMatches"},portableTextNotEqual:{nameKey:"search.operator.portable-text-not-equal.name",descriptionKey:"search.operator.portable-text-not-equal.description",groqFilter:({fieldPath:e,value:t})=>t&&e?`pt::text(${e}) != ${a0(t)}`:null,initialValue:null,inputComponent:iG,type:"portableTextNotEqual"},portableTextNotMatches:{nameKey:"search.operator.portable-text-not-contains.name",descriptionKey:"search.operator.portable-text-not-contains.description",groqFilter:({fieldPath:e,value:t})=>t&&e?`!(pt::text(${e}) match ${a0(t)})`:null,initialValue:null,inputComponent:iG,type:"portableTextNotMatches"},...iZ,slugEqual:{nameKey:"search.operator.slug-equal.name",descriptionKey:"search.operator.slug-equal.description",groqFilter:({fieldPath:e,value:t})=>t&&e?`${e}.current == ${a0(t)}`:null,initialValue:null,inputComponent:iG,type:"slugEqual"},slugMatches:{nameKey:"search.operator.slug-contains.name",descriptionKey:"search.operator.slug-contains.description",groqFilter:({fieldPath:e,value:t})=>t&&e?`${e}.current match ${a0(t)}`:null,initialValue:null,inputComponent:iG,type:"slugMatches"},slugNotEqual:{nameKey:"search.operator.slug-not-equal.name",descriptionKey:"search.operator.slug-not-equal.description",groqFilter:({fieldPath:e,value:t})=>t&&e?`${e}.current != ${a0(t)}`:null,initialValue:null,inputComponent:iG,type:"slugNotEqual"},slugNotMatches:{nameKey:"search.operator.slug-not-contains.name",descriptionKey:"search.operator.slug-not-contains.description",groqFilter:({fieldPath:e,value:t})=>t&&e?`!(${e}.current match ${a0(t)})`:null,initialValue:null,inputComponent:iG,type:"slugNotMatches"},stringEqual:{nameKey:"search.operator.string-equal.name",descriptionKey:"search.operator.string-equal.description",groqFilter:({fieldPath:e,value:t})=>t&&e?`${e} == ${a0(t)}`:null,initialValue:null,inputComponent:iG,type:"stringEqual"},stringListEqual:{nameKey:"search.operator.string-list-equal.name",descriptionKey:"search.operator.string-list-equal.description",groqFilter:({fieldPath:e,value:t})=>t&&e?`${e} == ${a0(t)}`:null,initialValue:null,inputComponent:aK,type:"stringListEqual"},stringListNotEqual:{nameKey:"search.operator.string-list-not-equal.name",descriptionKey:"search.operator.string-list-not-equal.description",groqFilter:({fieldPath:e,value:t})=>t&&e?`${e} != ${a0(t)}`:null,initialValue:null,inputComponent:aK,type:"stringListNotEqual"},stringMatches:{nameKey:"search.operator.string-contains.name",descriptionKey:"search.operator.string-contains.description",groqFilter:({fieldPath:e,value:t})=>t&&e?`${e} match "*${t}*"`:null,initialValue:null,inputComponent:iG,type:"stringMatches"},stringNotEqual:{nameKey:"search.operator.string-not-equal.name",descriptionKey:"search.operator.string-not-equal.description",groqFilter:({fieldPath:e,value:t})=>t&&e?`${e} != ${a0(t)}`:null,initialValue:null,inputComponent:iG,type:"stringNotEqual"},stringNotMatches:{nameKey:"search.operator.string-not-contains.name",descriptionKey:"search.operator.string-not-contains.description",groqFilter:({fieldPath:e,value:t})=>t&&e?`!(${e} match "*${t}*")`:null,initialValue:null,inputComponent:iG,type:"stringNotMatches"}});function iY(e){return!!e?.["sanity.project"]?.some(e=>e.grants.some(e=>"deployStudio"===e.name))}function iQ(e){return e.config().projectId?(0,es._)((0,i._)(e).pipe((0,R.W)(()=>(0,U.of)({})))).then(iY):Promise.resolve(!1)}let iX=new ta.UL,i0=(0,eW.Ud)("sanity:manifest"),i1=new Map;async function i2(e,t){let n=[],r=performance.now(),a=await iX.get(e,{pauseDurations:n}),o=performance.now(),l=(0,tY.A)(n)||0,s=(0,tJ.A)(n)||0,c=0===n.length?0:l/n.length,d=o-r;d>1e3&&console.warn(`Building schema for synchronization took more than 1 second (${d}ms)`),s>100&&console.warn(`Building schema for synchronization blocked UI for more than 100ms (${s}ms)`);let u=a.set.id,{projectId:m="?",dataset:p="?"}=t.config(),f=`dataset:${m}:${p}`;i.O&&(f+="#dev");let y=`${u}:${f}`,h=i1.get(y);if(h)return i0("Reusing cached claim promise for %s",y),h;let g=(async()=>{let e={descriptorId:u,contextKey:f},n=(await t.request({url:"/descriptors/claim",method:"POST",body:e,headers:{"Client-Timing":Object.entries({convertSchema:d,convertSchemaPauseTotal:l,convertSchemaPauseMax:s,convertSchemaPauseAvg:c}).map(([e,t])=>`${e};dur=${t}`).join(",")}})).synchronization;for(let e=0;e<5;e++){let e=(0,ta.hF)(a,n);if(null===e)return u;n=await t.request({url:"/descriptors/synchronize",method:"POST",body:e})}throw Error("Schema synchronization didn't succeed in 5 iterations")})();return i1.set(y,g),g.catch(()=>{i1.delete(y)}),g}function i3({name:e,title:t},n){return"string"==typeof e&&e.trim().length>0?e:i4(t,n)}function i4(e,t){return`at index ${t}${"string"==typeof e&&e.trim().length>0?` (titled "${e}")`:""}`}
32var i5=class extends Error{index;identifier;constructor(e,t){super(e),this.name="WorkspaceValidationError",this.index=t?.index,this.identifier=t?.workspace&&i3(t.workspace,t.index)}};function i6(e,t){let{name:n,basePath:r}=e;if(r&&"string"==typeof r)return!0;throw void 0===r?new i5(`If more than one workspace is defined, every workspace must have a \`basePath\` defined. Workspace \`${n}\` is missing a \`basePath\``,{workspace:e,index:t}):new i5(`If more than one workspace is defined, every workspace must have a \`basePath\` defined. Workspace \`${n}\` has an invalid \`basePath\` (must be a non-empty string)`,{workspace:e,index:t})}function i7(e,t){let{name:n,basePath:r}=e;if(r&&"/"!==r&&!/^\/[a-z0-9/_-]*[a-z0-9_-]+$/i.test(r))throw new i5(`All workspace \`basePath\`s must start with a leading \`/\`, consist of only URL safe characters, and cannot end with a trailing \`/\`. Workspace \`${n}\`'s basePath is \`${r}\``,{workspace:e,index:t})}let i8=[];function i9(){return i8}let oe="media-library";function ot(e){let t,n,r,a,i,o,l,d,u=(0,eu.c)(20),{onClearValue:m}=e,{t:p}=(0,s.t)(oe),f;return u[0]===Symbol.for("react.memo_cache_sentinel")?(f=(0,em.jsx)(eS.az,{children:(0,em.jsx)(ey.n,{size:1,children:(0,em.jsx)(eC.WarningOutlineIcon,{})})}),u[0]=f):f=u[0],u[1]===p?t=u[2]:(t=p("invalid-video-warning.title"),u[1]=p,u[2]=t),u[3]===t?n=u[4]:(n=(0,em.jsx)(ey.n,{size:1,weight:"medium",children:t}),u[3]=t,u[4]=n),u[5]===p?r=u[6]:(r=p("invalid-video-warning.description"),u[5]=p,u[6]=r),u[7]===r?a=u[8]:(a=(0,em.jsx)(ey.n,{size:1,children:r}),u[7]=r,u[8]=a),u[9]!==n||u[10]!==a?(i=(0,em.jsxs)(ew.t,{gap:4,marginBottom:4,children:[f,(0,em.jsxs)(ey.t,{gap:3,children:[n,a]})]}
32),u[9]=n,u[10]=a,u[11]=i):i=u[11],u[12]===p?o=u[13]:(o=p("invalid-video-warning.reset-button.text"),u[12]=p,u[13]=o),u[14]!==m||u[15]!==o?(l=(0,em.jsx)(c.o,{icon:tC.ResetIcon,mode:"ghost",onClick:m,text:o,width:"fill"}),u[14]=m,u[15]=o,u[16]=l):l=u[16],u[17]!==i||u[18]!==l?(d=(0,em.jsxs)(eh.s,{"data-testid":"invalid-video-warning",tone:"caution",padding:4,border:!0,radius:2,children:[i,l]}),u[17]=i,u[18]=l,u[19]=d):d=u[19],d}var on=class extends Error{constructor(e){super(e),this.name="AssetProcessingError"}};function or(e){if(e.startsWith("video-"))return e;let t=e.split(":");if(3!==t.length)throw Error(`Invalid asset reference format: expected 3 parts, got ${t.length}`);let[n,r,a]=t;if("media-library"!==n)throw Error(`Invalid resource type: expected "media-library", got "${n}"`);if(!a)throw Error("Missing asset instance ID in reference");return a}function oa(){return new ec.B}let oi=(0,e_.I4)(eh.s).withConfig({displayName:"RatioBox",componentId:"sc-aa6hsy-0"})`position:relative;display:flex;justify-content:center;align-items:center;width:100%;min-height:3.75rem;aspect-ratio:var(--aspect-ratio);${e=>e.$isPortrait?"max-height: 30dvh;":""}`;function oo(e){let t,n,r=(0,eu.c)(11),{error:a,retry:i,aspectRatio:o}=e,{t:l}=(0,s.t)(oe),d=o??1.7777777777777777,u=a?"critical":"transparent",m=d<.75,p;return r[0]===d?p=r[1]:(p={"--aspect-ratio":d},r[0]=d,r[1]=p),r[2]!==a||r[3]!==i||r[4]!==l?(t=a?(0,em.jsxs)(ew.t,{align:"center",justify:"center",direction:"column",gap:3,style:{position:"absolute",inset:0},padding:4,children:[(0,em.jsx)(ey.n,{size:1,muted:!0,children:a.message||l("video-error.description")}),i&&(0,em.jsx)(c.o,{icon:tC.ResetIcon,mode:"ghost",text:l("video-error.retry-button.text"),onClick:i})]}):(0,em.jsx)(eg.EA,{style:{position:"absolute",inset:0},radius:1,animated:!0}),r[2]=a,r[3]=i,r[4]=l,r[5]=t):t=r[5],r[6]!==u||r[7]!==m||r[8]!==p||r[9]!==t?(n=(0,em.jsx)(oi,{tone:u,$isPortrait:m,style:p,children:t}),r[6]=u,r[7]=m,r[8]=p,r[9]=t,r[10]=n):n=r[10],n}let ol=(0,O.lazy)(()=>Promise.all([n.e(6999),n.e(3977),n.e(2723),n.e(6065)]).then(n.bind(n,46065)).then(e=>({default:e.VideoPlayer})));function os(e){let t,n,r,i,o,l=(0,eu.c)(23),{customDomain:s,playbackId:c,tokens:d,children:u,aspectRatio:m,muted:p,disabled:f,onClick:y,isMenuOpen:h,onMenuOpen:g,menuButtonRef:b}=e,v=p||f?void 0:"button",x=void 0!==m&&m<.75,w;return l[0]===m?w=l[1]:(w={"--aspect-ratio":m},l[0]=m,l[1]=w),l[2]!==m||l[3]!==s||l[4]!==c||l[5]!==d?(t=c&&(0,em.jsx)(O.Suspense,{fallback:(0,em.jsx)(oo,{aspectRatio:m}),children:(0,em.jsx)(ol,{customDomain:s,playbackId:c,tokens:d,aspectRatio:m})}),l[2]=m,l[3]=s,l[4]=c,l[5]=d,l[6]=t):t=l[6],l[7]!==x||l[8]!==w||l[9]!==t?(n=(0,em.jsx)(oi,{tone:"transparent",$isPortrait:x,style:w,children:t}),l[7]=x,l[8]=w,l[9]=t,l[10]=n):n=l[10],l[11]!==y||l[12]!==v||l[13]!==n?(r=(0,em.jsx)(eh.s,{as:v,tone:"inherit",onClick:y,flex:1,children:n}),l[11]=y,l[12]=v,l[13]=n,l[14]=r):r=l[14],l[15]!==u||l[16]!==h||l[17]!==b||l[18]!==g?(i=(0,em.jsx)(a.C,{padding:2,children:(0,em.jsx)(a.T,{ariaLabelKey:"inputs.file.actions-menu.video-options.aria-label",id:"video-actions-menu",isMenuOpen:h,menuButtonRef:b,onMenuOpen:g,children:u})}),l[15]=u,l[16]=h,l[17]=b,l[18]=g,l[19]=i):i=l[19],l[20]!==r||l[21]!==i?(o=(0,em.jsxs)(eS.az,{children:[r,i]}),l[20]=r,l[21]=i,l[22]=o):o=l[22],o}function oc(e){if(!e?.startsWith("media-library:"))return null;let t=e.split(":");return 3===t.length&&t[2]?t[2]:null}function od(e){let t=oc(e);return t?{_id:e,_type:"sanity.videoAsset",source:{id:t,name:a.Ar}}:null}function ou(e){let t,n,r,i,o,l=(0,eu.c)(97),{assetSources:d,clearField:m,directUploads:p,menuButtonRef:f,observeAsset:y,onOpenInSource:h,onOpenSourceForUpload:g,onSelectAssetSourceForBrowse:b,onSelectFiles:v,readOnly:x,schemaType:w,setSelectedAssetSource:_,value:S}=e,{t:k}=(0,s.t)(),[C,j]=(0,O.useState)(!1),I=S?.asset,T=S?.media?._ref,E=w.options?.sources,$="sanity.video"===w.name?"video/*":"",A;l[0]!==w||l[1]!==$?(A=(0,eP.A)(w,"options.accept",$),l[0]=w,l[1]=$,l[2]=A):A=l[2];let q=A,D;l[3]===Symbol.for("react.memo_cache_sentinel")?(D={apiVersion:"vX"},l[3]=D):D=l[3];let N=(0,u.i)(D).config().apiHost.endsWith(".sanity.work"),V;e:{if(!I?._ref){let e;
32l[4]===Symbol.for("react.memo_cache_sentinel")?(e=[null,null],l[4]=e):e=l[4],V=e;break e}try{let e;l[5]===I._ref?e=l[6]:(e=function(e){let t=e.split(":");if(3!==t.length||"media-library"!==t[0]||!t[1])throw Error("Invalid asset reference");return t[1]}(I._ref),l[5]=I._ref,l[6]=e);let t=e,n;l[7]!==I||l[8]!==t?(n=[{mediaLibraryId:t,assetRef:I},null],l[7]=I,l[8]=t,l[9]=n):n=l[9],V=n}catch(t){let e;console.error("Failed to parse asset reference:",t),l[10]===Symbol.for("react.memo_cache_sentinel")?(e=[null,t instanceof Error?t:Error(String(t))],l[10]=e):e=l[10],V=e}}let[F,B]=V,W=function(e){let t=(0,eu.c)(11),n;t[0]===Symbol.for("react.memo_cache_sentinel")?(n={apiVersion:"vX"},t[0]=n):n=t[0];let r=(0,u.i)(n),[a]=(0,O.useState)(oa),i;t[1]===a?i=t[2]:(i=()=>{a.next()},t[1]=a,t[2]=i);let o=i,l;if(t[3]!==r||t[4]!==e||t[5]!==o||t[6]!==a){e:{let n={isLoading:!0,result:void 0,error:void 0,retry:o},i={isLoading:!1,result:void 0,error:void 0,retry:o};if(!e){l=[i,(0,U.of)(i)];break e}let{mediaLibraryId:s,assetRef:c}=e,d=a.pipe((0,K.Z)(void 0)).pipe((0,M.n)(()=>(0,Q.v)(()=>{let e=or(c._ref);return(0,eo.H)(r.request({url:`/media-libraries/${s}/video/${e}/playback-info`,tag:"media-library.video-playback-info"}))}).pipe((0,z.T)(e=>({isLoading:!1,result:e,error:void 0,retry:o})),(0,L.L)({delay:e=>{if(e?.statusCode!==404)throw e;let t=or(c._ref);return r.observable.request({method:"GET",url:`/media-libraries/${s}/doc/${t}`}).pipe((0,et.Z)(e=>{let n=e.documents?.[0];if(!n)throw Error(`Asset document ${t} not found, retrying...`);if("ready"===n.state)return(0,U.of)(n);throw"processing"===n.state?new on("Asset is processing"):Error(`Asset state is not "ready": ${n.state||"unknown"}`)}),(0,L.L)({delay:e=>{if(e instanceof on)return(0,P.O)(2e3);throw e}}),(0,e$.w)(12e4),(0,R.W)(e=>{throw"TimeoutError"===e.name?Error(`Asset ${t} was not ready processing after 2 minutes.`):e}))}}),(0,R.W)(e=>(console.error("Failed to fetch video playback info:",e),(0,U.of)({isLoading:!1,result:void 0,error:e,retry:o}))),(0,K.Z)(n)))),u;t[8]!==n||t[9]!==d?(u=[n,d],t[8]=n,t[9]=d,t[10]=u):u=t[10],l=u}t[3]=r,t[4]=e,t[5]=o,t[6]=a,t[7]=l}else l=t[7];let[s,c]=l;return(0,eD.ut)(c,s)}(F),H=N?"m.sanity-cdn.work":"m.sanity-cdn.com",G;l[11]===W.result?G=l[12]:(G=W?.result?function(e){if("token"in e.stream)return{animated:e.animated.token,playback:e.stream.token,thumbnail:e.thumbnail.token,storyboard:e.storyboard.token}}(W.result):void 0,l[11]=W.result,l[12]=G);let Z=G,J=W.result?.aspectRatio,Y=W.result?.id,X;l[13]!==H||l[14]!==C||l[15]!==f||l[16]!==J||l[17]!==Y?(X={aspectRatio:J,customDomain:H,playbackId:Y,onMenuOpen:j,isMenuOpen:C,menuButtonRef:f},l[13]=H,l[14]=C,l[15]=f,l[16]=J,l[17]=Y,l[18]=X):X=l[18];let ee=X,en;l[19]!==ee||l[20]!==Z?(en=Z?{...ee,tokens:Z}:ee,l[19]=ee,l[20]=Z,l[21]=en):en=l[21];let er=en,ei;l[22]===d?ei=l[23]:(ei=(0,a.tn)(d),l[22]=d,l[23]=ei);let el=ei,es=I?._ref,ec;l[24]!==es||l[25]!==y?(ec=es&&y?y(es):ea.w,l[24]=es,l[25]=y,l[26]=ec):ec=l[26];let ed=(0,eD.ut)(ec,void 0),ep;if(l[27]!==d||l[28]!==T||l[29]!==ed){t:{if(ed){let e;l[31]!==d||l[32]!==ed?(e=(0,a.O)(ed,d),l[31]=d,l[32]=ed,l[33]=e):e=l[33],ep=e;break t}if(T){let e=od(T);if(e){ep=(0,a.O)(e,d);break t}}ep=null}l[27]=d,l[28]=T,l[29]=ed,l[30]=ep}else ep=l[30];let ef=ep,ey;l[34]!==b||l[35]!==_?(ey=e=>{j(!1),(b??_)(e)},l[34]=b,l[35]=_,l[36]=ey):ey=l[36];let eh=ey,eg;l[37]!==T||l[38]!==h||l[39]!==ef||l[40]!==ed?(eg=()=>{if(!ef)return;j(!1);let{source:e,result:t}=ef;if("url"===t.type)window.open(t.url,t.target||"_blank");else if("component"===t.type){let t=T?oc(T):null,n=ed??(T?od(T):null),r=n?t&&n.source?{...n,source:{...n.source,id:t}}:n:null;r&&h?.(e,r)}},l[37]=T,l[38]=h,l[39]=ef,l[40]=ed,l[41]=eg):eg=l[41];let eb=eg,ev;l[42]===v?ev=l[43]:(ev=(e,t)=>{j(!1),v(e,t)},l[42]=v,l[43]=ev);let ex=ev,ew;l[44]!==el||l[45]!==ex?(ew=e=>{ex(el[0],e)},l[44]=el,l[45]=ex,l[46]=ew):ew=l[46];let e_=ew,eS;l[47]!==el||l[48]!==g?(eS=()=>{j(!1),g?.(el[0])},l[47]=el,l[48]=g,l[49]=eS):eS=l[49];let ek=eS,eC;l[50]===g?eC=l[51]:(eC=e=>{j(!1),g?.(e)},l[50]=g,l[51]=eC);let ej=eC,eI;l[52]===w?eI=l[53]:(eI=(0,a.I)(w),l[52]=w,l[53]=eI);let eT=eI,eE;l[54]!==d||l[55]!==eT||l[56]!==eh||l[57]!==x||l[58]!==E?.length||l[59]!==k?(eE=()=>E?.length===0||0===d.length?null:1===d.length?(0,em.jsx)(c.r,{icon:td.SearchIcon,text:k("asset-source.browse-button.text"),onClick:()=>eh(d[0]),disabled:x,"data-testid":`${eT}-browse-button-${d[0].name}`}):d.map(e=>(0,em.jsx)(c.r,{text:(0,a.en)(e,k,{useStartCaseForName:!0}),onClick:()=>eh(e),icon:e.icon||e9.ImageIcon,disabled:x,"data-testid":`${eT}-browse-button-${e.name}`},e.name)),l[54]=d,l[55]=eT,l[56]=eh,l[57]=x,l[58]=E?.length,l[59]=k,l[60]=eE):eE=l[60],E?.length,l[61]===eE?t=l[62]:(t=eE(),l[61]=e
32E,l[62]=t);let eA=t,eq=w.options?.disableNew===!0,eN;l[63]===Symbol.for("react.memo_cache_sentinel")?(eN=()=>j(!1),l[63]=eN):eN=l[63],l[64]===f?n=l[65]:(n=()=>f.current?.focus(),l[64]=f,l[65]=n),l[66]!==q||l[67]!==el||l[68]!==p||l[69]!==eq||l[70]!==ej||l[71]!==ek||l[72]!==ex||l[73]!==e_||l[74]!==x||l[75]!==n?(r={accept:q,assetSourcesWithUpload:el,directUploads:p,disableNew:eq,readOnly:x,onSelectFiles:ex,onOpenSourceForUpload:ej,onOpenSourceForUploadSingle:ek,onSelectFilesSingle:e_,getSingleButtonTestId:om,dropdownMenuTestId:"video-input-upload-drop-down-menu-button",onCloseParentMenu:eN,onFilePickerCancel:n},l[66]=q,l[67]=el,l[68]=p,l[69]=eq,l[70]=ej,l[71]=ek,l[72]=ex,l[73]=e_,l[74]=x,l[75]=n,l[76]=r):r=l[76];let eV=(0,a.D)(r);if(!I)return null;if(B){let e;return l[77]===B?e=l[78]:(e=(0,em.jsx)(oo,{error:B}),l[77]=B,l[78]=e),e}if(W.isLoading){let e;return l[79]===Symbol.for("react.memo_cache_sentinel")?(e=(0,em.jsx)(oo,{}),l[79]=e):e=l[79],e}if(W.error){let e;return l[80]!==W.error||l[81]!==W.retry?(e=(0,em.jsx)(oo,{error:W.error,retry:W.retry}),l[80]=W.error,l[81]=W.retry,l[82]=e):e=l[82],e}if(!W.result){let e;return l[83]===Symbol.for("react.memo_cache_sentinel")?(e=(0,em.jsx)(oo,{}),l[83]=e):e=l[83],e}let eF=ef?eb:void 0,eO;return l[84]!==ef||l[85]!==k?(eO=(0,a.k)(ef,k),l[84]=ef,l[85]=k,l[86]=eO):eO=l[86],l[87]!==eA||l[88]!==m||l[89]!==x||l[90]!==eF||l[91]!==eO||l[92]!==eV?(i=(0,em.jsx)(a.A,{browse:eA,upload:eV,onReset:m,openInSource:eF,openInSourceName:eO,readOnly:x}),l[87]=eA,l[88]=m,l[89]=x,l[90]=eF,l[91]=eO,l[92]=eV,l[93]=i):i=l[93],l[94]!==i||l[95]!==er?(o=(0,em.jsx)(os,{...er,children:i}),l[94]=i,l[95]=er,l[96]=o):o=l[96],o}function om(e){return`video-input-upload-button-${e}`}let op=["asset"];function of(e){let t,n,r,i=(0,eu.c)(40),{assetSources:o,changed:l,clearField:s,directUploads:c,elementProps:d,isStale:u,isUploading:m,onCancelUpload:p,onClearUploadStatus:f,onOpenSourceForUpload:y,onSelectAssets:h,onSelectFiles:g,onStale:b,path:v,readOnly:x,schemaType:w,setHoveringFiles:_,value:S}=e,k;i[0]===v?k=i[1]:(k=v.concat(op),i[0]=v,i[1]=k);let C=k,j;i[2]===d?j=i[3]:(j=e=>{e.currentTarget===e.target&&e.currentTarget===d.ref?.current&&d.onFocus(e)},i[2]=d,i[3]=j);let I=j,T;i[4]!==c||i[5]!==g||i[6]!==x?(T=(e,t)=>{c&&!x&&g(e,t)},i[4]=c,i[5]=g,i[6]=x,i[7]=T):T=i[7];let E=T,$;i[8]===E?$=i[9]:($=e=>{let{assetSource:t,file:n}=e;E(t,[n])},i[8]=E,i[9]=$);let A=$,q=!!(S?._upload||S?.asset);if(S&&void 0!==S.asset&&!S?._upload&&!function(e){if("object"!=typeof e||!e||!("asset"in e))return!1;let t=e.asset;if("object"!=typeof t||!t||!("_ref"in t))return!1;let n=t._ref;return"string"==typeof n&&n.startsWith("media-library:")}(S)){let e;return i[10]===s?e=i[11]:(e=(0,em.jsx)(ot,{onClearValue:s}),i[10]=s,i[11]=e),e}i[12]!==u||i[13]!==f?(t=u&&(0,em.jsx)(eS.az,{marginBottom:2,children:(0,em.jsx)(a.j,{onClearStale:f})}),i[12]=u,i[13]=f,i[14]=t):t=i[14];let D=!!e.focused,N;return i[15]!==o||i[16]!==d||i[17]!==I||i[18]!==A||i[19]!==E||i[20]!==q||i[21]!==m||i[22]!==p||i[23]!==y||i[24]!==h||i[25]!==b||i[26]!==e||i[27]!==x||i[28]!==w||i[29]!==_||i[30]!==S?(N=S?._upload?(0,em.jsx)(a.M,{uploadState:S._upload,onCancel:m&&p?p:void 0,onStale:b}):(0,em.jsx)(a.Zt,{...d,$border:q,isReadOnly:x,onFocus:I,onOpenSourceForUpload:y,onSelectFile:A,onSetHoveringFiles:_,radius:2,assetSources:o,sizing:"border",style:{padding:1},tabIndex:0,types:[w],children:(0,em.jsxs)("div",{style:{position:"relative"},children:[!S?.asset&&(0,em.jsx)(oy,{...e,onSelectFiles:E}),!S?._upload&&S?.asset&&(0,em.jsx)(ou,{...e,onSelectAssets:h})]})}),i[15]=o,i[16]=d,i[17]=I,i[18]=A,i[19]=E,i[20]=q,i[21]=m,i[22]=p,i[23]=y,i[24]=h,i[25]=b,i[26]=e,i[27]=x,i[28]=w,i[29]=_,i[30]=S,i[31]=N):N=i[31],i[32]!==C||i[33]!==l||i[34]!==D||i[35]!==N?(n=(0,em.jsx)(a.sr,{path:C,hasFocus:D,isChanged:l,children:N}),i[32]=C,i[33]=l,i[34]=D,i[35]=N,i[36]=n):n=i[36],i[37]!==t||i[38]!==n?(r=(0,em.jsxs)(em.Fragment,{children:[t,n]}),i[37]=t,i[38]=n,i[39]=r):r=i[39],r}function oy(e){let t,n,r,i=(0,eu.c)(24),{assetSources:o,directUploads:l,hoveringFiles:s,onOpenSourceForUpload:c,onSelectFiles:d,onSelectAssetSourceForBrowse:u,readOnly:m,schemaType:p,setIsBrowseMenuOpen:f,setSelectedAssetSource:y}=e,h;i[0]!==u||i[1]!==f||i[2]!==y?(h=e=>{f(!1),(u??y)(e)},i[0]=u,i[1]=f,i[2]=y,i[3]=h):h=i[3],i[4]!==o||i[5]!==m||i[6]!==p||i[7]!==h?(t=(0,em.jsx)(a.F,{assetSources:o,readOnly:m,schemaType:p,onSelectAssetSource:h}),i[4]=o,i[5]=m,i[6]=p,i[7]=h,i[8]=t):t=i[8];let g=t,b=m?"transparent":"inherit",v;return i[9]===s.length?v=i[10]:(v=0===s.length?{borderStyle:"dashed"}:{borderStyle:"dashed",borderColor:"transparent"},i[9]=s.length,i[10]=v),i[11]!==o||i[12]!==g||i[13]!==l||i[14]!==s||i[15]!==c||i[16]!==d||i[17]!==m||i[18]!==p?(n=(0,em.jsx)(a.N,{assetSources:o,browse:g,directUploads:l,hoveringFiles:s,onOpenSourceForUpload:c,onUpload:d,readOnly:m,schemaType:p,type:"file"}),i[11]=o,i[12]=g,i[13]=l,i[14]=s,i[15]=c,i[16]=d,i[17]=m,i[18]=p,i[19]=n):n=i[19],i[20]!==b||i[21]!==v||i[22]!==n?(r=(0,em.jsx)(em.Fragment,{children:(0,em.jsx)(eh.s,{tone:b,border:!0,paddingX:3,paddingY:2,radius:2,style:v,children:n})}),i[20]=b,i[21]=v,i[22]=n,i[23]=r):r=i[23],r}function oh({children:e}){return e}function og(e){let t,n,r=(0,eu.c)(74),{client:i,members:o,observeAsset:l,onChange:c,renderAnnotation:d,renderBlock:u,renderField:m,renderInlineBlock:p,renderInput:f,renderItem:y,renderPreview:h,schemaType:g,value:b}=e,{t:v}=(0,s.t)(),x=(0,a.wt)(g,o),w;r[0]===Symbol.for("react.memo_cache_sentinel")?(w=[],r[0]=w):w=r[0];let[_,S]=(0,O.useState)(w),[k,C]=(0,O.useState)(!1),j;r[1]!==i||r[2]!==c||r[3]!==g?(j={client:i,onChange:c,schemaType:g},r[1]=i,r[2]=c,r[3]=g,r[4]=j):j=r[4];let{action:I,selectedAssetSource:T,openInSourceAsset:E,openForBrowse:$,openForUpload:A,openInSource:q,changeAction:D,clearUploadStatus:N,close:V,menuButtonRef:F,resetOnComplete:z,setSelectedAssetSource:M,uploadWith:L,isUploading:P,setIsUploading:R,isStale:U,setIsStale:K,onStale:B,assetSourceUploader:W,handleSelectFilesToUpload:H}=(0,a.L)(j),G;r[5]!==N||r[6]!==K||r[7]!==b?._upload?(G=()=>{b?._upload&&(N(),K(!1))},r[5]=N,r[6]=K,r[7]=b?._upload,r[8]=G):G=r[8],b?._upload;let Z=G,J;r[9]===c?J=r[10]:(J=()=>{c([(0,a.ka)(["asset"]),(0,a.ka)(["media"])])},r[9]=c,r[10]=J);let Y=J,Q;r[11]!==z||r[12]!==c||r[13]!==g||r[14]!==L?(Q=e=>{(0,a.Fr)({assetsFromSource:e,onChange:c,type:g,resolveUploader:a.wr,uploadWith:L}),z()},r[11]=z,r[12]=c,r[13]=g,r[14]=L,r[15]=Q):Q=r[15];let X=Q,ee;r[16]===W?.uploader?ee=r[17]:(ee=()=>{W?.uploader?.abort()},r[16]=W?.uploader,r[17]=ee);let et=ee,en;r[18]!==et||r[19]!==Y||r[20]!==Z||r[21]!==q||r[22]!==A||r[23]!==$||r[24]!==X||r[25]!==H||r[26]!==B||r[27]!==_||r[28]!==k||r[29]!==U||r[30]!==P||r[31]!==F||r[32]!==e||r[33]!==T||r[34]!==R||r[35]!==M?(en=()=>(0,em.jsx)(of,{...e,menuButtonRef:F,clearField:Y,hoveringFiles:_,isBrowseMenuOpen:k,isStale:U,isUploading:P,onCancelUpload:et,onClearUploadStatus:Z,onOpenInSource:q,onOpenSourceForUpload:A,onSelectAssetSourceForBrowse:$,onSelectAssets:X,onSelectFiles:H,onStale:B,selectedAssetSource:T,setHoveringFiles:S,setIsBrowseMenuOpen:C,setIsUploading:R,setSelectedAssetSource:M}),r[18]=et,r[19]=Y,r[20]=Z,r[21]=q,r[22]=A,r[23]=$,r[24]=X,r[25]=H,r[26]=B,r[27]=_,r[28]=k,r[29]=U,r[30]=P,r[31]=F,r[32]=e,r[33]=T,r[34]=R,r[35]=M,r[36]=en):en=r[36];let er=en,ea;
32if(r[37]!==d||r[38]!==er||r[39]!==u||r[40]!==m||r[41]!==p||r[42]!==f||r[43]!==y||r[44]!==h||r[45]!==x||r[46]!==g||r[47]!==v){let e;r[49]!==d||r[50]!==er||r[51]!==u||r[52]!==m||r[53]!==p||r[54]!==f||r[55]!==y||r[56]!==h||r[57]!==g||r[58]!==v?(e=e=>"field"===e.kind?(0,em.jsx)(a.vr,{member:e,renderAnnotation:d,renderBlock:u,renderField:"asset"===e.name?oh:m,renderInlineBlock:p,renderInput:"asset"===e.name?er:f,renderItem:y,renderPreview:h},e.key):"fieldSet"===e.kind?(0,em.jsx)(a.Ot,{member:e,renderAnnotation:d,renderBlock:u,renderField:m,renderInlineBlock:p,renderInput:f,renderItem:y,renderPreview:h,schemaType:g},e.key):"decoration"===e.kind?(0,em.jsx)(a.At,{member:e},e.key):"error"===e.kind?(0,em.jsx)(a.kt,{member:e},e.key):(0,em.jsx)(O.Fragment,{children:v("inputs.file.error.unknown-member-kind",{kind:e.kind})},e.key),r[49]=d,r[50]=er,r[51]=u,r[52]=m,r[53]=p,r[54]=f,r[55]=y,r[56]=h,r[57]=g,r[58]=v,r[59]=e):e=r[59],ea=x.map(e),r[37]=d,r[38]=er,r[39]=u,r[40]=m,r[41]=p,r[42]=f,r[43]=y,r[44]=h,r[45]=x,r[46]=g,r[47]=v,r[48]=ea}else ea=r[48];return r[60]!==I||r[61]!==W?.uploader||r[62]!==D||r[63]!==V||r[64]!==X||r[65]!==l||r[66]!==E||r[67]!==e.schemaType||r[68]!==e.value||r[69]!==T?(t=T&&I&&(0,em.jsx)(a.R,{action:I,assetType:"sanity.video",observeAsset:l,onClose:V,onChangeAction:D,onSelect:X,openInSourceAsset:E,schemaType:e.schemaType,selectedAssetSource:T,uploader:W?.uploader,value:e.value,waitPlaceholder:(0,em.jsx)(oo,{})}),r[60]=I,r[61]=W?.uploader,r[62]=D,r[63]=V,r[64]=X,r[65]=l,r[66]=E,r[67]=e.schemaType,r[68]=e.value,r[69]=T,r[70]=t):t=r[70],r[71]!==ea||r[72]!==t?(n=(0,em.jsxs)(em.Fragment,{children:[ea,t]}),r[71]=ea,r[72]=t,r[73]=n):n=r[73],n}function ob(e){return"sanity-media-library"===e.name}let ov=(0,ef.U8)({name:"sanity.video",title:"Video",type:"object",components:{input:function(e){let t=(0,eu.c)(14),n=e.schemaType.options?.sources,r=(0,i.r)(),{file:o}=(0,a.Cr)().__internal,l=(0,u.i)(u.n),s;t[0]===o.directUploads?s=t[1]:(s=(e,t)=>o.directUploads?(0,a.wr)(e,t):null,t[0]=o.directUploads,t[1]=s);let c=s,d=n||o.assetSources,m;t[2]===d?m=t[3]:(m=d.filter(ob),t[2]=d,t[3]=m);let p=m,f;t[4]!==l||t[5]!==r?(f=e=>(0,a.Dr)(r,e,l),t[4]=l,t[5]=r,t[6]=f):f=t[6];let y=f,h;return t[7]!==l||t[8]!==o.directUploads||t[9]!==p||t[10]!==y||t[11]!==e||t[12]!==c?(h=(0,em.jsx)(og,{...e,client:l,assetSources:p,directUploads:o.directUploads,observeAsset:y,resolveUploader:c}),t[7]=l,t[8]=o.directUploads,t[9]=p,t[10]=y,t[11]=e,t[12]=c,t[13]=h):h=t[13],h},field:e=>e.renderDefault({...e,level:e.level-1})},fields:[{name:"asset",type:"globalDocumentReference",to:[{type:"sanity.videoAsset",preview:{select:{title:"_id"}}}],resourceType:"media-library",resourceId:"_"},{name:"media",type:"globalDocumentReference",hidden:!0,to:[{type:"sanity.asset",preview:{select:{title:"_id"}}}],resourceType:"media-library",resourceId:"_"}]}),ox=(0,ef.U8)({name:"sanity.videoAsset",title:"Video",type:"document",fieldsets:[{name:"system",title:"System fields",description:"These fields are managed by the system and not editable"}],fields:[{name:"originalFilename",type:"string",title:"Original file name",readOnly:!0},{name:"label",type:"string",title:"Label"},{name:"title",type:"string",title:"Title"},{name:"description",type:"string",title:"Description"},{name:"altText",type:"string",title:"Alternative text"},{name:"creditLine",type:"string",title:"Credit line"},{name:"metadata",type:"sanity.videoMetadata",title:"Video metadata",readOnly:!0,fieldset:"system"},{name:"sha1hash",type:"string",title:"SHA1 hash",readOnly:!0,fieldset:"system"},{name:"extension",type:"string",title:"File extension",readOnly:!0,fieldset:"system"},{name:"mimeType",type:"string",title:"Mime type",readOnly:!0,fieldset:"system"},{name:"size",type:"number",title:"File size in bytes",readOnly:!0,fieldset:"system"},{name:"assetId",type:"string",title:"Asset ID",readOnly:!0,fieldset:"system"},{name:"uploadId",type:"string",readOnly:!0,hidden:!0,fieldset:"system"},{name:"path",type:"string",title:"Path",readOnly:!0,fieldset:"system"},{name:"url",type:"string",title:"Url",readOnly:!0,fieldset:"system"}],preview:{select:{title:"originalFilename",path:"path",mimeType:"mimeType",size:"size",duration:"metadata.duration"},prepare(e){let t=e.duration?`${Math.floor(e.duration/60)}:${String(Math.floor(e.duration%60)).padStart(2,"0")}`:"";return{title:e.title||e.path.split("/").slice(-1)[0],subtitle:`${e.mimeType} (${(e.size/1024/1024).toFixed(2)} MB)${t?` - ${t}`:""}`}}},orderings:[{title:"File size",name:"fileSizeDesc",by:[{field:"size",direction:"desc"}]},{title:"Duration",name:"durationDesc",by:[{field:"metadata.duration",direction:"desc"}]}]}
32),ow=(0,ef.U8)({name:"sanity.videoMetadata.playback",title:"Playback",type:"object",fields:[{name:"policy",type:"string"}]}),o_=[ov,ox,(0,ef.U8)({name:"sanity.videoMetadata",title:"Video metadata",type:"object",fieldsets:[{name:"extra",title:"Extra metadata…",options:{collapsible:!0}}],fields:[{name:"duration",title:"Duration (seconds)",type:"number",readOnly:!0},{name:"framerate",title:"Frame Rate",type:"number",readOnly:!0},{name:"aspectRatio",title:"Aspect Ratio",type:"number",readOnly:!0},{name:"hasAudio",title:"Has audio",type:"boolean",readOnly:!0},{name:"codec",title:"Codec",type:"string",readOnly:!0,fieldset:"extra"},{name:"bitrate",title:"Bitrate",type:"number",readOnly:!0,fieldset:"extra"}]}),ow],oS=(0,m.V)({name:"sanity/media-library",schema:{types:o_},i18n:{bundles:[{locale:"en-US",namespace:oe,resources:()=>n.e(3722).then(n.bind(n,13722))}]}}),ok=e=>{let t,n,r=(0,eu.c)(7),{t:a}=(0,s.t)(t7),i;r[0]===e?i=r[1]:(i=nc(e),r[0]=e,r[1]=i);let{isLinked:o,companionDoc:l,loading:c}=t6(i),d=ns(l?.canvasDocumentId,"action");return!o||c?null:(r[2]===a?t=r[3]:(t=a("action.edit-document"),r[2]=a,r[3]=t),r[4]!==d||r[5]!==t?(n={icon:tI.ComposeSparklesIcon,label:t,onHandle:d},r[4]=d,r[5]=t,r[6]=n):n=r[6],n)};ok.action="editInCanvas",ok.displayName="EditInCanvasAction";let oC=e=>{let{_id:t,_rev:n,_createdAt:r,_updatedAt:a,...i}=JSON.parse(JSON.stringify(e));return i};function oj(e){let t,n,r,o,l=(0,eu.c)(22),{baseDocument:s,document:c}=e,d=(0,i.Zt)(),m;l[0]!==c._type||l[1]!==d?(m=d.get(c._type),l[0]=c._type,l[1]=d,l[2]=m):m=l[2];let f=m,{currentUser:y}=(0,u.o)();if(y?.id,l[3]!==s||l[4]!==y?.id||l[5]!==c){let e;l[7]===s?e=l[8]:(e=s??{},l[7]=s,l[8]=e),t=(0,eG.g)((0,eG.L)(oC(e),{author:y?.id}),(0,eG.L)(oC(c),{author:y?.id})),l[3]=s,l[4]=y?.id,l[5]=c,l[6]=t}else t=l[6];let h=t,g;return l[9]===c._id?g=l[10]:(g=(0,p.l)(c._id),l[9]=c._id,l[10]=g),l[11]!==c||l[12]!==h||l[13]!==f||l[14]!==g?(n={documentId:g,schemaType:f,rootDiff:h,isComparingCurrent:!1,FieldWrapper:oI,value:c,showFromValue:!0},l[11]=c,l[12]=h,l[13]=f,l[14]=g,l[15]=n):n=l[15],l[16]!==h||l[17]!==f?(r=(0,em.jsx)(a.ti,{diff:h,schemaType:f}),l[16]=h,l[17]=f,l[18]=r):r=l[18],l[19]!==n||l[20]!==r?(o=(0,em.jsx)(ep.HU.Provider,{value:n,children:r}),l[19]=n,l[20]=r,l[21]=o):o=l[21],o}function oI(e){return e.children}let oT=(0,e_.I4)(eh.s).withConfig({displayName:"ChipCard",componentId:"sc-ep6rkl-0"})(e=>{let{color:t}=(0,e0.t)(e.theme);return(0,e_.AH)`--card-fg-color:${t.button.ghost[e.tone].enabled.fg};`}),oE=e=>{let t,n,r,a,o=(0,eu.c)(13),{id:l,showSparkles:s}=e,c=(0,i.vt)(l),d="published"===c?"Published":"Draft",u="published"===c?"positive":"caution",m="published"===c?"positive":"caution",p;return o[0]===m?p=o[1]:(p=(0,em.jsx)(ey.n,{size:1,children:(0,em.jsx)(y.n,{tone:m})}),o[0]=m,o[1]=p),o[2]===d?t=o[3]:(t=(0,em.jsx)(ey.n,{size:1,weight:"medium",children:d}),o[2]=d,o[3]=t),o[4]===s?n=o[5]:(n=s&&(0,em.jsx)(ey.n,{size:1,children:(0,em.jsx)(tI.ComposeSparklesIcon,{})}),o[4]=s,o[5]=n),o[6]!==p||o[7]!==t||o[8]!==n?(r=(0,em.jsxs)(eS.so,{gap:2,alignItems:"center",children:[p,t,n]}),o[6]=p,o[7]=t,o[8]=n,o[9]=r):r=o[9],o[10]!==u||o[11]!==r?(a=(0,em.jsx)(oT,{tone:u,padding:2,paddingRight:3,radius:"full",children:r}),o[10]=u,o[11]=r,o[12]=a):a=o[12],a};function o$(e){let t,n,r,a,i,o,l,c,d,u,m,p,f=(0,eu.c)(34),{originalDocument:y,mappedDocument:h}=e,{t:g}=(0,s.t)(t7),b,v,x,w;f[0]===Symbol.for("react.memo_cache_sentinel")?(b={opacity:0},v={opacity:1},x={opacity:0},w={duration:.3},f[0]=b,f[1]=v,f[2]=x,f[3]=w):(b=f[0],v=f[1],x=f[2],w=f[3]),f[4]===Symbol.for("react.memo_cache_sentinel")?(t=(0,em.jsx)(eS.az,{padding:1,children:(0,em.jsx)(ey.n,{size:2,children:(0,em.jsx)(eC.WarningOutlineIcon,{})})}),f[4]=t):t=f[4],f[5]===g?n=f[6]:(n=g("dialog.confirm-document-changes.title"),f[5]=g,f[6]=n),f[7]===n?r=f[8]:(r=(0,em.jsx)(eS.az,{padding:1,children:(0,em.jsx)(ey.n,{size:1,weight:"semibold",children:n})}),f[7]=n,f[8]=r),f[9]===g?a=f[10]:(a=g("dialog.confirm-document-changes.description"),f[9]=g,f[10]=a),f[11]===a?i=f[12]:(i=(0,em.jsx)(eS.az,{padding:1,children:(0,em.jsx)(ey.n,{size:1,weight:"medium",children:a})}),f[11]=a,f[12]=i),f[13]!==r||f[14]!==i?(o=(0,em.jsx)(eh.s,{tone:"critical",padding:2,radius:3,children:(0,em.jsxs)(eS.so,{gap:2,alignItems:"flex-start",children:[t,(0,em.jsxs)(ey.t,{gap:2,children:[r,i]})]})}),f[13]=r,f[14]=i,f[15]=o):o=f[15];let _=y?._id||"",S;f[16]===_?S=f[17]:(S=(0,em.jsx)(oE,{id:_}),f[16]=_,f[17]=S),f[18]===Symbol.for("react.memo_cache_sentinel")?(l=(0,em.jsx)(ey.n,{size:2,children:(0,em.jsx)(eQ.ArrowRightIcon,{})}),f[18]=l):l=f[18];let k=h?._id||"",C;return f[19]===k?C=f[20]:(C=(0,em.jsx)(oE,{id:k,showSparkles:!0}),f[19]=k,f[20]=C),f[21]!==S||f[22]!==C?(c=(0,em.jsx)(eS.az,{padding:3,children:(0,em.jsxs)(eS.so,{gap:2,alignItems:"center",children:[S,l,C]})}),f[21]=S,f[22]=C,f[23]=c):c=f[23],f[24]===Symbol.for("react.memo_cache_sentinel")?(d=(0,em.jsx)(eh.s,{borderBottom:!0}),f[24]=d):d=f[24],f[25]!==h||f[26]!==y?(u=y&&h&&(0,em.jsx)(eS.az,{padding:3,children:(0,em.jsx)(oj,{baseDocument:y,document:h})}),f[25]=h,f[26]=y,f[27]=u):u=f[27],f[28]!==c||f[29]!==u?(m=(0,em.jsxs)(eh.s,{radius:3,border:!0,marginTop:3,children:[c,d,u]}),f[28]=c,f[29]=u,f[30]=m):m=f[30],f[31]!==o||f[32]!==m?(p=(0,em.jsxs)(eZ.PY1.div,{initial:b,animate:v,exit:x,transition:w,children:[o,m]}),f[31]=o,f[32]=m,f[33]=p):p=f[33],p}
32let oA=Intl.DateTimeFormat().resolvedOptions(),oq={status:"validating"},oD={apiVersion:"v2025-04-29"};function oN(e){return(0,U.of)({status:"error",error:e.message})}function oV(){}let oF=e=>{let t,n,r,a,o,l,c=(0,eu.c)(35),{document:d,onClose:m}=e,{t:p}=(0,s.t)(t7),y=(0,O.useId)(),h;c[0]===d?h=c[1]:(h={document:d},c[0]=d,c[1]=h);let{status:b,error:x,navigateToCanvas:w,response:_}=function(e){let t,n,r,a,o=(0,eu.c)(25),{document:l}=e,s=(0,u.c)(),c=(0,i.l)(),d=(0,v.D)(),{node:m}=(0,i.t)(),p=d?.name==="coreUi",{linkRedirected:f,linkDialogDiffsShown:y}=nl(),h=s.apps?.canvas?.fallbackStudioOrigin,g;o[0]===h?g=o[1]:(g={enabled:!0,fallbackStudioOrigin:h},o[0]=h,o[1]=g);let{studioApp:b,loading:x}=(0,v.c)(g),w=(t=(0,eu.c)(2),n=(0,u.c)().name||"default",t[0]===n?r=t[1]:(r=(0,ta.qn)({workspaceName:n}),t[0]=n,t[1]=r),r.safeBaseId),_=(0,u.i)(oD);b?.appId;e:{let e;if(x){let e;o[2]===Symbol.for("react.memo_cache_sentinel")?(e=(0,U.of)({status:"validating"}),o[2]=e):e=o[2],a=e;break e}if(!b?.appId){let e;o[3]===Symbol.for("react.memo_cache_sentinel")?(e=(0,U.of)({status:"error",error:"Studio app not found, try deploying it or set the fallbackStudioOrigin"}),o[3]=e):e=o[3],a=e;break e}if(!l?._id){let e;o[4]===Symbol.for("react.memo_cache_sentinel")?(e=(0,U.of)({status:"missing-document-id",error:"Missing document ID"}),o[4]=e):e=o[4],a=e;break e}o[5]!==_||o[6]!==l._id||o[7]!==l._type||o[8]!==p||o[9]!==m||o[10]!==c||o[11]!==b?.appId||o[12]!==s.name?(e=()=>{let e=_.config().dataset||"",t=_.config().projectId||"",n=`studio-import?${new URLSearchParams({projectId:t,dataset:e,documentType:l._type,documentId:l._id,workspaceName:s.name,applicationId:b?.appId||""}).toString()}`;if(p&&m){let e={resourceId:"",resourceType:"canvas",path:n};return(0,U.of)(()=>m.post("dashboard/v1/bridge/navigate-to-resource",e))}return c.getOrganizationId().pipe((0,z.T)(e=>{if(!e)return oV;let t=`https://www.sanity.${"https://api.sanity.work"===_.config().apiHost?"work":"io"}/@${e}/canvas/${n}`;return()=>window.open(t,"_blank")}))},o[5]=_,o[6]=l._id,o[7]=l._type,o[8]=p,o[9]=m,o[10]=c,o[11]=b?.appId,o[12]=s.name,o[13]=e):e=o[13];let t=e,n;if(o[14]!==_||o[15]!==l||o[16]!==t||o[17]!==y||o[18]!==f||o[19]!==w){let e,r;o[21]===f?e=o[22]:(e=e=>{let[t,n]=e;if(!t.error){let e=t.diff?.length?"diff":"redirecting";return{status:e,error:null,response:t,navigateToCanvas:()=>{f("diff"===e?"diff-dialog":"redirect",t.diff),n()}}}return{status:"error",error:t.error,response:t,redirectUrl:void 0}},o[21]=f,o[22]=e),o[23]===y?r=o[24]:(r=e=>{let{status:t,navigateToCanvas:n}=e;"redirecting"===t&&setTimeout(()=>{n()},1e3),"diff"===t&&y()},o[23]=y,o[24]=r),n=(0,ed.z)([(({client:e,document:t,schemaId:n})=>{let r=e.config().dataset;return e.observable.request({url:`/assist/studio-to-canvas/${r}`,tag:"sanity.canvas",method:"POST",body:{document:t,schemaId:n,localeSettings:{locale:oA.locale,timeZone:oA.timeZone}}})})({client:_,document:l,schemaId:w}),t()]).pipe((0,z.T)(e),(0,X.M)(r),(0,R.W)(oN)),o[14]=_,o[15]=l,o[16]=t,o[17]=y,o[18]=f,o[19]=w,o[20]=n}else n=o[20];a=n}return(0,eD.J2)(a,oq)}(h),{linkDialogRejected:S}=nl(),k;c[2]!==S||c[3]!==m||c[4]!==_?.diff||c[5]!==b?(k=()=>{m(),"diff"===b&&S(_?.diff||[])},c[2]=S,c[3]=m,c[4]=_?.diff,c[5]=b,c[6]=k):k=c[6],_?.diff;let C=k,j=`dialog-link-to-canvas-${y}`,I;return c[7]===p?I=c[8]:(I=p("dialog.link-to-canvas.title"),c[7]=p,c[8]=I),c[9]!==w||c[10]!==m||c[11]!==b||c[12]!==p?(t="diff"===b?{description:p("dialog.confirm-document-changes.footer-description"),confirmButton:{text:p("dialog.confirm-document-changes.confirm"),icon:tI.ComposeSparklesIcon,tone:"default",onClick:w,space:2},cancelButton:{text:p("dialog.confirm-document-changes.cancel"),onClick:m}}:void 0,c[9]=w,c[10]=m,c[11]=b,c[12]=p,c[13]=t):t=c[13],c[14]!==b||c[15]!==p?(n=("validating"===b||"redirecting"===b)&&(0,em.jsx)(eS.az,{paddingY:5,children:(0,em.jsx)(f.t,{title:p("validating"===b?"dialog.link-to-canvas.validating":"dialog.link-to-canvas.redirecting"),showText:!0})}),c[14]=b,c[15]=p,c[16]=n):n=c[16],c[17]!==x||c[18]!==b||c[19]!==p?(r=("error"===b||"missing-document-id"===b)&&(0,em.jsx)(eZ.PY1.div,{initial:{opacity:0}
32,animate:{opacity:1},exit:{opacity:0},transition:{duration:.3},children:(0,em.jsx)(eh.s,{border:!0,tone:"critical",padding:4,radius:3,children:(0,em.jsx)(ey.n,{size:1,weight:"medium",children:x||p("dialog.link-to-canvas.error")})})}),c[17]=x,c[18]=b,c[19]=p,c[20]=r):r=c[20],c[21]!==d||c[22]!==_||c[23]!==b?(a="diff"===b&&_&&(0,em.jsx)(o$,{originalDocument:d,mappedDocument:_.mappedDocument}),c[21]=d,c[22]=_,c[23]=b,c[24]=a):a=c[24],c[25]!==n||c[26]!==r||c[27]!==a?(o=(0,em.jsxs)(eS.az,{padding:3,children:[n,r,a]}),c[25]=n,c[26]=r,c[27]=a,c[28]=o):o=c[28],c[29]!==C||c[30]!==j||c[31]!==I||c[32]!==t||c[33]!==o?(l=(0,em.jsx)(g.n,{id:j,header:I,onClose:C,width:1,bodyHeight:"stretch",padding:!1,footer:t,children:o}),c[29]=C,c[30]=j,c[31]=I,c[32]=t,c[33]=o,c[34]=l):l=c[34],l},oO=e=>{var t;let n,r,o,l,c,d=(0,eu.c)(38),{t:u}=(0,s.t)(t7),[f,y]=(0,O.useState)(!1),{selectedPerspective:h}=(0,m.nt)(),g;d[0]===e?g=d[1]:(g=nc(e),d[0]=e,d[1]=g);let{isLinked:b,loading:x}=t6(g),{value:w}=(0,v.O)(),{linkCtaClicked:_}=nl(),S=(t=e.type,n=(0,eu.c)(3),r=(0,i.Zt)(),n[0]!==r||n[1]!==t?(o=r.get(t)?.options?.sanityCreate?.exclude,n[0]=r,n[1]=t,n[2]=o):o=n[2],o),k;d[2]===Symbol.for("react.memo_cache_sentinel")?(k=()=>y(!1),d[2]=k):k=d[2];let C=k,j=(0,v.D)()?.name==="coreUi",I=!!e.release,T=(0,a.Ur)(),[E,$]=(0,O.useState)(),A;d[3]!==T||d[4]!==_||d[5]!==e.liveEditSchemaType?(A=()=>{_();let t=T([]);$({...t,_id:e.liveEditSchemaType?(0,p.l)(t._id):(0,p.s)(t._id)}),y(!0)},d[3]=T,d[4]=_,d[5]=e.liveEditSchemaType,d[6]=A):A=d[6];let q=A,D;e:{let t;if(!w){let e,t;d[7]===u?e=d[8]:(e=u("action.link-document-disabled.missing-permissions"),d[7]=u,d[8]=e),d[9]===e?t=d[10]:(t={disabled:!0,reason:e},d[9]=e,d[10]=t),D=t;break e}if(!j){let e,t;d[11]===u?e=d[12]:(e=u("action.link-document-disabled.not-in-dashboard"),d[11]=u,d[12]=e),d[13]===e?t=d[14]:(t={disabled:!0,reason:e},d[13]=e,d[14]=t),D=t;break e}if(I){let e,t;d[15]===u?e=d[16]:(e=u("action.link-document-disabled.version-document"),d[15]=u,d[16]=e),d[17]===e?t=d[18]:(t={disabled:!0,reason:e},d[17]=e,d[18]=t),D=t;break e}if(!e.initialValueResolved){let e,t;d[19]===u?e=d[20]:(e=u("action.link-document-disabled.initial-value-not-resolved"),d[19]=u,d[20]=e),d[21]===e?t=d[22]:(t={disabled:!0,reason:e},d[21]=e,d[22]=t),D=t;break e}d[23]===Symbol.for("react.memo_cache_sentinel")?(t={disabled:!1,reason:void 0},d[23]=t):t=d[23],D=t}let N=D,V,F;if(d[24]===b?(V=d[25],F=d[26]):(V=()=>{b&&C()},F=[b,C],d[24]=b,d[25]=V,d[26]=F),(0,O.useEffect)(V,F),b||x||S||"published"===h&&!e.liveEditSchemaType||(0,m.St)(h)||!j)return null;let z=N.disabled,M;return d[27]!==E||d[28]!==f?(M=f&&E?{type:"custom",component:(0,em.jsx)(oF,{onClose:C,document:E})}:void 0,d[27]=E,d[28]=f,d[29]=M):M=d[29],d[30]===u?l=d[31]:(l=u("action.link-document"),d[30]=u,d[31]=l),d[32]!==N.disabled||d[33]!==N.reason||d[34]!==q||d[35]!==M||d[36]!==l?(c={disabled:z,icon:tI.ComposeSparklesIcon,dialog:M,label:l,title:N.reason,onHandle:q},d[32]=N.disabled,d[33]=N.reason,d[34]=q,d[35]=M,d[36]=l,d[37]=c):c=d[37],c};oO.action="linkToCanvas",oO.displayName="LinkToCanvasAction";let oz=e=>{let t,n,r,a,o,l,c,u,p,f,y,h,b=(0,eu.c)(50),{document:v,onClose:x,status:w,error:_,handleUnlink:S}=e,{t:k}=(0,s.t)(t7),{t:C}=(0,s.t)(),j;b[0]===v?j=b[1]:(j={document:v},b[0]=v,b[1]=j);let{title:I}=(e=>{let t=(0,eu.c)(11),{document:n}=e,r=(0,i.Zt)(),a;t[0]!==n._type||t[1]!==r?(a=r.get(n._type),t[0]=n._type,t[1]=r,t[2]=a):a=t[2];let o=a,l=!!n,s;t[3]!==n||t[4]!==o||t[5]!==l?(s={enabled:l,schemaType:o,value:n},t[3]=n,t[4]=o,t[5]=l,t[6]=s):s=t[6];let{error:c,value:d}=(0,m.a)(s);if(!o){let e;return t[7]===Symbol.for("react.memo_cache_sentinel")?(e={error:"Schema type not found"},t[7]=e):e=t[7],e}let u=d?.title,p;return t[8]!==c||t[9]!==u?(p={error:c,title:u},t[8]=c,t[9]=u,t[10]=p):p=t[10],p})(j),T=`dialog-unlink-from-canvas-${(0,O.useId)()}`,E;b[2]===k?E=b[3]:(E=k("dialog.unlink-from-canvas.title"),b[2]=k,b[3]=E);let $="loading"===w?void 0:x,A;b[4]===k?A=b[5]:(A=k("dialog.unlink-from-canvas.cancel"),b[4]=k,b[5]=A);let q="idle"!=w,D;b[6]!==x||b[7]!==A||b[8]!==q?(D={text:A,onClick:x,disabled:q}
32,b[6]=x,b[7]=A,b[8]=q,b[9]=D):D=b[9],b[10]===k?t=b[11]:(t=k("dialog.unlink-from-canvas.unlink-action"),b[10]=k,b[11]=t);let N="loading"===w,V="idle"!=w,F;return b[12]!==S||b[13]!==V||b[14]!==t||b[15]!==N?(F={text:t,onClick:S,tone:"default",loading:N,disabled:V},b[12]=S,b[13]=V,b[14]=t,b[15]=N,b[16]=F):F=b[16],b[17]!==F||b[18]!==D?(n={cancelButton:D,confirmButton:F},b[17]=F,b[18]=D,b[19]=n):n=b[19],b[20]!==C||b[21]!==I?(r=I||C("preview.default.title-fallback"),b[20]=C,b[21]=I,b[22]=r):r=b[22],b[23]===r?a=b[24]:(a={documentTitle:r},b[23]=r,b[24]=a),b[25]!==k||b[26]!==a?(o=(0,em.jsx)(eS.az,{paddingBottom:2,children:(0,em.jsx)(ey.n,{size:1,muted:!0,children:(0,em.jsx)(d.t,{t:k,i18nKey:"dialog.unlink-from-canvas.unlinking",values:a})})}),b[25]=k,b[26]=a,b[27]=o):o=b[27],b[28]===k?l=b[29]:(l=k("dialog.unlink-from-canvas.description"),b[28]=k,b[29]=l),b[30]===l?c=b[31]:(c=(0,em.jsx)(eS.az,{children:(0,em.jsx)(ey.n,{size:1,muted:!0,children:l})}),b[30]=l,b[31]=c),b[32]!==o||b[33]!==c?(u=(0,em.jsxs)(ey.t,{gap:3,children:[o,c]}),b[32]=o,b[33]=c,b[34]=u):u=b[34],b[35]!==_||b[36]!==w||b[37]!==k?(p="error"===w&&(0,em.jsx)(eZ.PY1.div,{initial:{opacity:0,scale:.9},animate:{opacity:1,scale:1},children:(0,em.jsx)(eh.s,{tone:"critical",padding:2,radius:3,children:(0,em.jsx)(ey.n,{size:1,weight:"medium",children:_||k("dialog.unlink-from-canvas.error")})})},"error"),b[35]=_,b[36]=w,b[37]=k,b[38]=p):p=b[38],b[39]===p?f=b[40]:(f=(0,em.jsx)(eJ.N,{children:p}),b[39]=p,b[40]=f),b[41]!==u||b[42]!==f?(y=(0,em.jsxs)(ey.t,{gap:3,children:[u,f]}),b[41]=u,b[42]=f,b[43]=y):y=b[43],b[44]!==n||b[45]!==T||b[46]!==y||b[47]!==E||b[48]!==$?(h=(0,em.jsx)(g.n,{id:T,header:E,onClose:$,bodyHeight:"stretch",footer:n,children:y}),b[44]=n,b[45]=T,b[46]=y,b[47]=E,b[48]=$,b[49]=h):h=b[49],h},oM=e=>{let t,n,r,a=(0,eu.c)(23),{t:i}=(0,s.t)(t7),o;a[0]===e?o=a[1]:(o=nc(e),a[0]=e,a[1]=o);let{isLinked:l,companionDoc:c,loading:d}=t6(o),m=(0,u.i)(u.n),{unlinkCtaClicked:p,unlinkApproved:f}=nl(),y=(0,eT.dj)(),[h,g]=(0,O.useState)(!1),[b,v]=(0,O.useState)("idle"),[x,w]=(0,O.useState)(null),_;a[2]===Symbol.for("react.memo_cache_sentinel")?(_=()=>g(!1),a[2]=_):_=a[2];let S=_,k;a[3]===p?k=a[4]:(k=()=>{p(),g(!0)},a[3]=p,a[4]=k);let C=k,j;a[5]!==m||a[6]!==c?._id||a[7]!==i||a[8]!==y||a[9]!==f?(j=async()=>{let e=async()=>{if(!c?._id)throw Error("Companion doc not found");v("loading"),f(),await m.delete(c?._id),v("idle"),S(),y.push({status:"success",title:i("dialog.unlink-from-canvas.success")})};try{await e()}catch(e){console.error(e),w(e.message),v("error")}},a[5]=m,a[6]=c?._id,a[7]=i,a[8]=y,a[9]=f,a[10]=j):j=a[10],c?._id;let I=j,T=e.version||e.draft||e.published;return T&&l&&!d?(a[11]!==T||a[12]!==x||a[13]!==I||a[14]!==h||a[15]!==b?(t=h?{type:"custom",component:(0,em.jsx)(oz,{onClose:S,document:T,status:b,error:x,handleUnlink:I})}:void 0,a[11]=T,a[12]=x,a[13]=I,a[14]=h,a[15]=b,a[16]=t):t=a[16],a[17]===i?n=a[18]:(n=i("action.unlink-document"),a[17]=i,a[18]=n),a[19]!==C||a[20]!==t||a[21]!==n?(r={icon:tQ.UnlinkIcon,dialog:t,label:n,onHandle:C},a[19]=C,a[20]=t,a[21]=n,a[22]=r):r=a[22],r):null};oM.action="unlinkFromCanvas",oM.displayName="UnlinkFromCanvasAction";let oL=(0,m.V)(()=>({name:"sanity/canvas-integration",i18n:{bundles:[t8]},document:{actions:(e,t)=>{if("draft"===t.versionType||"version"===t.versionType){let t=["delete","discardVersion"],n=e.filter(e=>t.includes(e.action));return[...e.filter(e=>!t.includes(e.action)),oO,oM,ok,...n]}return e}}})),oP=(0,O.lazy)(()=>Promise.all([n.e(576),n.e(332),n.e(1224)]).then(n.bind(n,71224)).then(e=>({default:e.CommentsInspector}))),oR={name:k.n,component:oP,useMenuItem:function(){let e,t=(0,eu.c)(5),{t:n}=(0,s.t)(k.a),{enabled:r}=(0,S.t)(),a=!r,i;return t[0]===n?i=t[1]:(i=n("feature-name"),t[0]=n,t[1]=i),t[2]!==a||t[3]!==i?(e={hidden:a,icon:tX.CommentIcon,showAsAction:!0,title:i},t[2]=a,t[3]=i,t[4]=e):e=t[4],e}},oU=(0,O.lazy)(()=>n.e(5053).then(n.bind(n,85053)).then(e=>({default:e.CommentsDocumentLayout}))),oK=(0,O.lazy)(()=>Promise.all([n.e(576),n.e(9066)]).then(n.bind(n,9066)).then(e=>({default:e.CommentsField}))),oB=(0,O.lazy)(()=>Promise.all([n.e(576),n.e(6347)]).then(n.bind(n,6347)).then(e=>({default:e.CommentsInput}))),oW=(0,O.lazy)(()=>n.e(3463).then(n.bind(n,75844)).then(e=>({default:e.CommentsStudioLayout}))),oH=(0,m.V)({name:"sanity/comments",document:{inspectors:[oR],components:{unstable_layout:oU}},form:{components:{field:oK,input:oB}},studio:{components:{layout:oW}},i18n:{bundles:[k.o]}}),oG=(0,O.lazy)(()=>n.e(3846).then(n.bind(n,63846)).then(e=>({default:e.CommentsInspector}))),oZ={name:x.r,component:oG,useMenuItem:function(){let e,t=(0,eu.c)(5),{t:n}=(0,s.t)(x.b),{enabled:r}=(0,_.t)(),a=!r,i;return t[0]===n?i=t[1]:(i=n("feature-name"),t[0]=n,t[1]=i),t[2]!==a||t[3]!==i?(e={hidden:a,icon:tX.CommentIcon,showAsAction:!0,title:i},t[2]=a,t[3]=i,t[4]=e):e=t[4],e}},oJ=(0,O.lazy)(()=>n.e(1274).then(n.bind(n,61274)).then(e=>({default:e.CommentsDocumentLayout}))),oY=(0,O.lazy)(()=>n.e(5675).then(n.bind(n,55675)).then(e=>({default:e.CommentsField}))),oQ=(0,O.lazy)(()=>n.e(8171).then(n.bind(n,28171)).then(e=>({default:e.CommentsInput}))),oX=(0,O.lazy)(()=>n.e(5754).then(n.bind(n,15754)).then(e=>({default:e.CommentsStudioLayout}))),o0=(0,m.V)({name:"sanity/comments",document:{inspectors:[oZ],components:{unstable_layout:oJ}},form:{components:{field:oY,input:oQ}},studio:{components:{layout:oX}},i18n:{bundles:[x.x]}}),o1=e=>{let t,n,r=(0,eu.c)(11),{buttonText:a,disabled:i,icon:o,onAction:l,onComplete:s,tone:d}=e,u=void 0===a?"Action":a,m=void 0===d?"positive":d,p;return r[0]===s?p=r[1]:(p=(0,em.jsx)(c.o,{mode:"bleed",onClick:s,text:"Cancel"}),r[0]=s,r[1]=p),r[2]!==u||r[3]!==i||r[4]!==o||r[5]!==l||r[6]!==m?(t=l&&(0,em.jsx)(c.o,{disabled:i,icon:o,onClick:l,text:u,tone:m}),r[2]=u,r[3]=i,r[4]=o,r[5]=l,r[6]=m,r[7]=t):t=r[7],r[8]!==p||r[9]!==t?(n=(0,em.jsxs)(eS.so,{gap:3,justifyContent:"flex-end",children:[p,t]}),r[8]=p,r[9]=t,r[10]=n):n=r[10],n};function o2(e){let t,n=(0,eu.c)(5),{id:r,schemaType:a}=e,i,o;return n[0]===Symbol.for("react.memo_cache_sentinel")?(i=(0,em.jsxs)(ey.n,{size:1,children:["Schedule this document to be published at any time in the future.",(0,em.jsx)("br",{}),"Any edits in the meantime will be added to the scheduled document."]}),o=(0,em.jsx)(ey.n,{size:1,children:"Visit the Schedules page to get an overview of all schedules."}),n[0]=i,n[1]=o):(i=n[0],o=n[1]),n[2]!==r||n[3]!==a?(t=(0,em.jsxs)(ey.t,{gap:4,children:[i,o,(0,em.jsx)(o3,{id:r,type:a})]}),n[2]=r,n[3]=a,n[4]=t):t=n[4],t}function o3(e){let t,n,r,a=(0,eu.c)(11),{id:i,type:o}=e,l=(0,$.n)(o),s;a[0]===i?s=a[1]:(s=(0,p.s)(i),a[0]=i,a[1]=s);let c=s,d;a[2]===i?d=a[3]:(d=(0,p.l)(i),a[2]=i,a[3]=d);let u=d,m=(0,q.s)(c,o,!0),{hasError:f}=(0,T.n)(m.validation);return f?(a[4]!==u||a[5]!==l||a[6]!==m.validation?(t=(0,em.jsx)($.r,{markers:m.validation,type:l,documentId:u}),a[4]=u,a[5]=l,a[6]=m.validation,a[7]=t):t=a[7],a[8]===Symbol.for("react.memo_cache_sentinel")?(n=(0,em.jsx)(ey.n,{size:1,children:T.c}),a[8]=n):n=a[8],a[9]===t?r=a[10]:(r=(0,em.jsx)(eh.s,{padding:2,radius:1,shadow:1,tone:"critical",children:(0,em.jsxs)(eS.so,{gap:1,alignItems:"center",children:[t,n]})}),a[9]=t,a[10]=r),r):null}let o4=e=>{let t=(0,eu.c)(2),{schedules:n}=e,r;return t[0]===n?r=t[1]:(r=(0,em.jsx)(ey.t,{gap:4,children:0===n.length?(0,em.jsx)(eS.az,{children:(0,em.jsx)(ey.n,{size:1,children:"No schedules"})}):(0,em.jsx)(ey.t,{gap:2,children:n.map(o5)})}),t[0]=n,t[1]=r),r};function o5(e){return(0,em.jsx)($.t,{schedule:e,type:"document"},e.id)}let o6=(0,b.n)("ScheduleAction"),o7=e=>{let t,n,r,i,o,l=(0,eu.c)(47),{draft:s,id:c,liveEdit:d,onComplete:u,published:p,type:y}=e,h=(0,f.n)(),g;l[0]!==c||l[1]!==y?(g={id:c,type:y,permission:"publish"},l[0]=c,l[1]=y,l[2]=g):g=l[2];let[b,v]=(0,m.U)(g),{createSchedule:x}=(0,T.a)(),{enabled:w,mode:_}=(0,E.n)(),{handleOpenDialog:S}=(0,A.n)(),{selectedVariantName:k}=(0,m.nt)(),C=!!k,[j,I]=(0,O.useState)(!1),{formData:q,onFormChange:D}=(0,$.i)(),N;l[3]===c?N=l[4]:(N={documentId:c,state:"scheduled"},l[3]=c,l[4]=N);let{error:V,isInitialLoading:F,schedules:z}=(0,T.i)(N);o6("schedules",z);let M=z&&z.length>0,L=null!==s||null!==p,P=!v&&!b?.granted,R;
32l[5]!==S||l[6]!==_?(R=()=>{"upsell"===_?S("document_action"):I(!0)},l[5]=S,l[6]=_,l[7]=R):R=l[7];let U=R,K;l[8]!==x||l[9]!==q||l[10]!==c||l[11]!==u?(K=()=>{q?.date&&x({date:q.date,documentId:c}).then(u)},l[8]=x,l[9]=q,l[10]=c,l[11]=u,l[12]=K):K=l[12];let B=K,W=M?"Edit Schedule":"Schedule";if(P){let e,t;return l[13]===h?e=l[14]:(e=(0,em.jsx)(a.Nn,{currentUser:h,context:"edit-schedules"}),l[13]=h,l[14]=e),l[15]!==e||l[16]!==W?(t={disabled:!0,icon:e3.CalendarIcon,label:W,title:e},l[15]=e,l[16]=W,l[17]=t):t=l[17],t}let H="This document doesn't exist yet";L&&(H=null),F&&(H="Loading schedules"),d&&(H="Live Edit is enabled for this content type and publishing happens automatically as you make changes"),C&&(H="Legacy scheduled publishing is not available for variants, use scheduled drafts instead"),l[18]!==V||l[19]!==q||l[20]!==M||l[21]!==c||l[22]!==D||l[23]!==e||l[24]!==z||l[25]!==y?(t=V?(0,em.jsx)($.o,{description:"More information in the developer console.",title:"Something went wrong, unable to retrieve schedules."}):(0,em.jsx)($.a,{value:e,children:M?(0,em.jsx)(o4,{schedules:z}):(0,em.jsx)($.s,{onChange:D,value:q,children:(0,em.jsx)(o2,{id:c,schemaType:y})})}),l[18]=V,l[19]=q,l[20]=M,l[21]=c,l[22]=D,l[23]=e,l[24]=z,l[25]=y,l[26]=t):t=l[26],l[27]!==q?.date||l[28]!==B||l[29]!==M||l[30]!==u?(n=!M&&(0,em.jsx)(o1,{buttonText:"Schedule",disabled:!q?.date,icon:ts.ClockIcon,onAction:B,onComplete:u,tone:"primary"}),l[27]=q?.date,l[28]=B,l[29]=M,l[30]=u,l[31]=n):n=l[31],l[32]===W?r=l[33]:(r=(0,em.jsx)($.c,{timeZoneScope:T.d,title:W}),l[32]=W,l[33]=r),l[34]!==u||l[35]!==t||l[36]!==n||l[37]!==r?(i={content:t,footer:n,header:r,onClose:u,type:"dialog"},l[34]=u,l[35]=t,l[36]=n,l[37]=r,l[38]=i):i=l[38];let G=i;if(!w)return null;let Z=j&&G,J=F||!L||d||C,Y;return l[39]===H?Y=l[40]:(Y=H&&(0,em.jsx)(eS.az,{style:{maxWidth:"315px"},children:(0,em.jsx)(ey.n,{size:1,children:H})}),l[39]=H,l[40]=Y),l[41]!==U||l[42]!==Y||l[43]!==Z||l[44]!==J||l[45]!==W?(o={dialog:Z,disabled:J,label:W,icon:e3.CalendarIcon,onHandle:U,title:Y},l[41]=U,l[42]=Y,l[43]=Z,l[44]=J,l[45]=W,l[46]=o):o=l[46],o};o7.action="schedule",o7.displayName="ScheduleAction";let o8=(0,b.n)("ScheduledBadge"),o9=e=>{let t,n=(0,eu.c)(7),r;n[0]===e.id?r=n[1]:(r={documentId:e.id,state:"scheduled"},n[0]=e.id,n[1]=r);let{schedules:a}=(0,T.i)(r);o8("schedules",a);let i=a?.[0];if(!i||!i.executeAt||!i.action)return null;n[2]===i.executeAt?t=n[3]:(t=(0,tp.GP)(new Date(i.executeAt),b.r.LARGE),n[2]=i.executeAt,n[3]=t);let o=t,l=T.p[i.action],s=`${T.p[i.action].actionName} on ${o} (local time)`,c;return n[4]!==l.badgeColor||n[5]!==s?(c={color:l.badgeColor,label:"Scheduled",title:s},n[4]=l.badgeColor,n[5]=s,n[6]=c):c=n[6],c};o9.displayName="ScheduledBadge";let le=(0,O.lazy)(()=>n.e(8283).then(n.bind(n,18283))),lt=(0,O.lazy)(()=>n.e(634).then(n.bind(n,40634)).then(e=>({default:e.DocumentBannerInput}))),ln=(0,O.lazy)(()=>n.e(7705).then(n.bind(n,77705)).then(e=>({default:e.SchedulePublishingStudioLayout}))),lr=(0,m.V)({name:"sanity/scheduled-publishing",document:{actions:(e,t)=>"published"===t.versionType?e:0>e.findIndex(e=>"publish"===e.action)?[o7,...e]:e.flatMap(e=>"publish"===e.action?[e,o7]:e),badges:e=>[...e,o9]},form:{components:{input:lt}},studio:{components:{layout:ln}},tools:e=>[...e,{name:T.f,title:T._,icon:e3.CalendarIcon,component:le,router:tr.wE.create("/",[tr.wE.create("/state/:state"),tr.wE.create("/date/:date")]),__internalApplicationType:"sanity/scheduled-publishing"}]});function la(){return(0,O.useContext)(ep.b_)||li}let li={upsellData:null,handleOpenDialog:()=>null,handleClose:()=>null,upsellDialogOpen:!1,telemetryLogs:{dialogSecondaryClicked:()=>null,dialogPrimaryClicked:()=>null,panelViewed:()=>null,panelDismissed:()=>null,panelPrimaryClicked:()=>null,panelSecondaryClicked:()=>null}};function lo(){let e=(0,eu.c)(14),{handleOpenTasks:t,setViewMode:n}=(0,N.t)(),{enabled:r,mode:a}=(0,V.t)(),{handleOpenDialog:i}=la(),o;e[0]!==i||e[1]!==t||e[2]!==a||e[3]!==n?(o=()=>{"upsell"===a?i("document_action"):(t(),n({type:"create"}))},e[0]=i,e[1]=t,e[2]=a,e[3]=n,e[4]=o):o=e[4];let l=o,{t:c}=(0,s.t)(N.n),d;e:{let t,n,a,i;if(!r){d=null;break e}e[5]===c?t=e[6]:(t=c("actions.create.text"),e[5]=c,e[6]=t),e[7]===c?n=e[8]:(n=c("actions.create.text"),e[7]=c,e[8]=n),e[9]===Symbol.for("react.memo_cache_sentinel")?(a=["paneActions"],e[9]=a):a=e[9],e[10]!==l||e[11]!==t||e[12]!==n?(i={icon:t0.TaskIcon,label:t,title:n,group:a,onHandle:l},e[10]=l,e[11]=t,e[12]=n,e[13]=i):i=e[13],d=i}return d}let ll=(0,O.lazy)(()=>n.e(6923).then(n.bind(n,36923)).then(e=>({default:e.TasksDocumentInputLayout}))),ls=(0,O.lazy)(()=>n.e(5767).then(n.bind(n,85767)).then(e=>({default:e.TasksFooterOpenTasks}))),lc=(0,O.lazy)(()=>Promise.all([n.e(576),n.e(332),n.e(9185)]).then(n.bind(n,29185)).then(e=>({default:e.TasksStudioActiveToolLayout}))),ld=(0,O.lazy)(()=>n.e(8896).then(n.bind(n,28896)).then(e=>({default:e.TasksStudioLayout}))),lu=(0,O.lazy)(()=>n.e(4019).then(n.bind(n,34019)).then(e=>({default:e.TasksStudioNavbar}))),lm=(0,m.V)({name:"sanity/tasks",__internal_tasks:{footerAction:(0,em.jsx)(function(){let e=(0,eu.c)(1),t;return e[0]===Symbol.for("react.memo_cache_sentinel")?(t=(0,em.jsx)(O.Suspense,{fallback:null,children:(0,em.jsx)(ls,{})}),e[0]=t):t=e[0],t},{})},document:{actions:e=>
32[...e,lo].filter(Boolean)},studio:{components:{layout:ld,navbar:lu,activeToolLayout:lc}},form:{components:{input:e=>"root"===e.id&&e.schemaType.type?.name==="document"?(0,em.jsx)(ll,{...e}):e.renderDefault(e)}},i18n:{bundles:[N.r]}}),lp=(0,eW.Ud)("sanity:config"),lf=e=>"error"===e.severity,ly=new WeakMap,lh=!1,lg=new Set,lb=new WeakMap,lv=1;function lx(e){let t=lb.get(e);return void 0===t&&(t=lv++,lb.set(e,t)),t}function lw(e,t){if(!Array.isArray(e)&&"missingConfigFile"in e)throw new ro({name:"",type:"configuration file",causes:["No `sanity.config.ts` file found","No `sanity.config.js` file found"]});let n=function(e){let t=e||"";if("string"!=typeof t||t.length>0&&!t.startsWith("/"))throw new ro({name:"",type:"options",causes:["basePath must be a string, and must start with a slash"]});return"/"===t?"":t}(t?.basePath),r=Array.isArray(e)?e:[{...e,name:e.name??"default"}];try{!function({workspaces:e}){var t;let n,r;if(0===e.length)throw new i5("At least one workspace is required.");t=e,n=1===t.length,r=new Map,t.forEach((e,t)=>{let{name:a,title:i}=e,o=i4(i,t);if(!a&&!n)throw new i5(`All workspaces must have a \`name\`, unless only a single workspace is defined. Workspace ${o} did not define a \`name\`.`,{workspace:e,index:t});let l=n&&void 0===a?"default":a;if("string"!=typeof l)throw new i5(`Workspace at index ${t} defined an invalid \`name\` - must be a string.`,{workspace:e,index:t});let s=l.toLowerCase(),c=r.get(s);if(c)throw new i5(`\`name\`s must be unique. Workspace ${i4(c.workspace.title,c.index)} and workspace ${o} both have the \`name\` \`${l}\``,{workspace:e,index:t});if(r.set(s,{index:t,workspace:e}),!/^[a-z0-9][a-z0-9_-]*$/i.test(l))throw new i5(`All workspace \`name\`s must consist of only a-z, 0-9, underscore and dashes, and cannot begin with an underscore or dash. Workspace ${o} has the invalid name \`${l}\``,{workspace:e,index:t})}),function(e){e.length>1&&e.every(i6),e.every(i7);let[t,...n]=e,r=(t.basePath||"/").slice(1).split("/").filter(Boolean).length;n.forEach((e,n)=>{let a=(e.basePath||"/").slice(1).split("/").length;if(r!==a)throw new i5(`All workspace \`basePath\`s must have the same amount of segments. Workspace \`${i3(t,n)}\` had ${r} segment${1===r?"":"s"} \`${t.basePath}\` but workspace \`${i3(e,n)}\` had ${a} segment${1===a?"":"s"} \`${e.basePath}\``,{workspace:e,index:n})});let a=new Map;e.forEach((e,t)=>{let n=(e.basePath||"").toLowerCase(),r=a.get(n);if(r)throw new i5(`\`basePath\`s must be unique. Workspaces \`${r}\` and \`${i3(e,t)}\` both have the \`basePath\` \`${n}\``,{workspace:e,index:t});a.set(n,i3(e,t))})}(e)}({workspaces:r})}catch(e){throw new ro({name:"",type:"workspace",causes:[e.message]})}return function(e){let t=new Map;for(let n of e){let{projectId:e,auth:r,name:a}=n;if(!e||void 0===r)continue;let i=t.get(e)??[];i.push({name:a??"default",auth:r}),t.set(e,i)}for(let[e,r]of t){var n;if(r.length<2)continue;let t=new Map;for(let{name:e,auth:n}of r){let r=function(e){if("object"!=typeof e||!e)return String(e);if(ag(e))return`AuthStore@${lx(e)}`;try{return`AuthConfig:${rG(e)}`}catch{return`unserializable@${lx(e)}`}}(n),a=t.get(r)??[];a.push(e),t.set(r,a)}if(t.size<2)continue;let a=`${e}:${[...t.keys()].sort().join("|")}`;if(lg.has(a))continue;lg.add(a);let i=[...t.values()],o=`Workspaces for project "${e}" declare different \`auth\` configurations. Auth is project-scoped: workspaces for the same project share cookies and tokens. Only the first-initialized workspace's \`auth\` config takes effect; others are silent no-ops. Consolidate these to a single shared config:
33${i.map(e=>`  • ${e.map(e=>`"${e}"`).join(", ")}`).join("\n")}`;console.warn(`[sanity] ${o}`),n={type:"project-auth-divergence",projectId:e,groups:i,message:o},i8.push(n)}}(r),{type:"prepared-config",workspaces:r.map(e=>{var r,o;if(ly.has(e))return ly.get(e);let l={comments:{v2:!1,...e.beta?.comments},tasks:{enabled:!0,...e.unstable_tasks,...e.tasks},scheduledPublishing:{enabled:!0,inputDateTimeFormat:"dd/MM/yyyy HH:mm",...e.scheduledPublishing,__internal__workspaceEnabled:e.scheduledPublishing?.enabled??!1},releases:{...e.releases,enabled:e.releases?.enabled??!0},apps:{canvas:{enabled:!0,...e.apps?.canvas}},mediaLibrary:e?.mediaLibrary,scheduledDrafts:e.scheduledDrafts??{enabled:!0},variants:{enabled:!1,...e.beta?.variants}},{unstable_sources:c=[],...d}=e,f=[d,...c].map(({plugins:e,...t})=>({...t,plugins:[...e??[],...[(0,F.r)(),l.comments.v2?oH():o0(),lm(),lr(),(0,I.r)(),oL(),oS(),(0,D.r)(l),(0,q.r)()].filter(t=>"sanity/variants"===t.name?l.variants.enabled:"sanity/scheduled-publishing"===t.name?l.scheduledPublishing.enabled&&!!e?.length:"sanity/tasks"===t.name?l.tasks.enabled:"sanity/releases"===t.name?l.releases.enabled:"sanity/canvas-integration"===t.name?l.apps?.canvas?.enabled??!1:"sanity/media-library"===t.name?l.mediaLibrary?.enabled:"sanity/schedules"===t.name?l.releases.enabled||l.scheduledDrafts?.enabled:"sanity/singleDocRelease"!==t.name||l.scheduledDrafts?.enabled)].filter(e=>{let t="@sanity/assist"!==e.name||e.handlesGDR;return t||console.warn("Found an incompatible version of @sanity/assist plugin. It has been disabled.\nTo re-enable the plugin, please upgrade to https://github.com/sanity-io/assist/releases/tag/v3.2.2 or later."),t})})).map(e=>{var n;let r,o,l,c,{projectId:d,dataset:f}=e,y;try{y=function({config:e,context:t}){return rL({propertyName:"schema.types",config:e,context:t,initialValue:[],reducer:rv})}({config:e,context:{projectId:d,dataset:f}})}catch(t){throw new ro({name:e.name,type:"source",causes:[t]})}let h=(n={name:e.name,types:y},r=(0,ta.i6)(n.types).getTypes(),l=(o=(0,ta.Uh)(r)).some(e=>e.problems.some(rW)),(c=tq.Sj.compile({name:n.name,types:l?[]:n.types.filter(
33Boolean),parent:rH}))._validation=o,(0,eH.GA)(c)),g=h._validation,b=g?.filter(e=>e.problems.some(lf));if(g&&b?.length)throw new a.v(h);let v=function(e,{createStudioRequestHandler:t,requestErrorChannel:n,requestFailureDiagnostics:r}){if(ag(e.auth))return e.auth;let a=e.unstable_clientFactory??eF.UU,{projectId:i,dataset:o,apiHost:l}=e;return aj({apiHost:l,...e.auth,clientFactory:e=>{let n;return n=a({...e,...t?{requestHandler:t(()=>n)}:{}})},getRequestErrorHandler:()=>n,getRequestFailureDiagnostics:()=>r,dataset:o,projectId:i})}(e,{createStudioRequestHandler:t?.createStudioRequestHandler,requestErrorChannel:t?.requestErrorChannel,requestFailureDiagnostics:t?.requestFailureDiagnostics}),x=function(e){let{projectId:t,dataset:n,name:r}=e,i={projectId:t,dataset:n},o=rL({config:e,context:i,propertyName:"i18n.locales",reducer:rS,initialValue:[a.c]});return function({locales:e,bundles:t,projectId:n,sourceName:r}){var i,o,l,c;let d,u,m,p,f=(i=n,o=r,l=e,c=new Set(t.map(e=>e.namespace)),d=(0,a.s)(i,o),u=l.find(e=>e.id===d),m=l[l.length-1],p=u?.id??m.id??rK.lng,{...rK,ns:Array.from(c),lng:p,supportedLngs:l.map(e=>e.id)}),y=(0,tz.Q_)().use(function(e){let{bundles:t}=e;return{type:"backend",init:function(){},read:function(e,n,r){let a=t.filter(t=>t.locale===e&&t.namespace===n);0===a.length?r(`No translations found for namespace "${n}", language "${e}"`,void 0):rP(a).then(e=>r(null,e)).catch(e=>r(e,!0))}}}({bundles:t})).use(ek.r9);y.init(f).catch(e=>{console.error("Failed to initialize i18n backend: %s",e)});let h=e.map(rB);return{source:{get currentLocale(){return h.find(e=>e.id===y.language)??a.c},loadNamespaces(e){let t=e.filter(e=>!y.hasLoadedNamespace(e));return 0===t.length?Promise.resolve():y.loadNamespaces(t)},locales:h,t:(0,s.r)(y.t)},i18next:y}}({locales:o,bundles:rL({config:e,context:i,propertyName:"i18n.bundles",reducer:rk,initialValue:function(e){let t=[];for(let n of e){if(n.bundles&&!Array.isArray(n.bundles))throw Error(`Resource bundle for locale ${n.id} is not an array`);if(n.bundles)for(let e of n.bundles){if("locale"in e&&e.locale!==n.id)throw Error(`Resource bundle inside locale ${n.id} has mismatching locale id`);if(!e.namespace)throw Error(`Resource bundle for locale ${n.id} is missing namespace`);t.push("locale"in e?e:{...e,locale:n.id})}}return t}(o)}),projectId:t,sourceName:r})}(e),w=v.state.pipe((0,z.T)(({client:t,authenticated:n,currentUser:r})=>(function({config:e,client:t,currentUser:n,schema:r,authenticated:o,auth:l,i18n:s}){let c,d,{dataset:f,projectId:y}=e,h=function(e,t){let{dataset:n,url:r,requestTagPrefix:a="sanity.studio"}=e.withConfig({apiVersion:"2022-06-30"}).config(),i=`${`${r.replace(/\/+$/,"")}/socket/${n}`.replace(/^http/,"ws")}?tag=${a}`,o=t.token?{token$:t.token}:{};return(0,tO.uz)(i,o)}(t,l),g=[],b={},v=e=>{if(!e||!e.apiVersion)throw Error("Missing required `apiVersion` option");return b[e.apiVersion]||(b[e.apiVersion]=t.withConfig(e)),b[e.apiVersion]},x={client:t,getClient:v,currentUser:n,dataset:f,projectId:y,schema:r,i18n:s.source};x.client=[...Object.keys(t),...Object.keys(t.__proto__)].reduce((e,n)=>{let r=Object.hasOwnProperty.call(t,n)?t[n]:t.__proto__[n];return Object.defineProperty(e,n,{get:()=>(lh||(lh=!0,console.warn('`configContext.client` is deprecated and will be removed in the next release! Use `context.getClient({apiVersion: "2021-06-07"})` instead')),r)})},{});let w={fileSource:(0,a.nn)({client:t,title:e.title||e.name}),imageSource:(0,a.rn)({client:t,title:e.title||e.name})},_=(c=rO({config:e,initialValue:void 0}),rF({config:e,initialValue:!1})?{fileSource:(0,a.Or)({libraryId:c||null}),imageSource:(0,a.kr)({libraryId:c||null})}:{fileSource:null,imageSource:null}),S;try{S=rL({config:e,context:x,propertyName:"schema.templates",reducer:r_,initialValue:r.getTypeNames().filter(e=>!e.startsWith("sanity.")).map(e=>r.get(e)).filter(p.C).filter(e=>e.type?.name==="document").map(e=>({id:e.name,schemaType:e.name,title:e.title||e.name,icon:e.icon,value:e.initialValue||{_type:e.name}}))})}catch(t){throw new ro({name:e.name,type:"source",causes:[t]})}try{d=rL({config:e,context:x,initialValue:[],propertyName:"tools",reducer:rw})}catch(t){throw new ro({name:e.name,type:"source",causes:[t]})}if(d.some(({name:e})=>"tool"===e))throw Error('A tool cannot have the name "tool". Please enter a different name.');let k=S.filter(e=>!e.parameters?.length).map(e=>({templateId:e.id,description:e.description,icon:e.icon,title:e.title})),C=S.reduce((e,t)=>
33(e.set(t.id,t),e),new Map),j=t=>{let{schemaType:n}=t,a=rL({config:e,context:{...x,creationContext:t},initialValue:k,propertyName:"document.resolveNewDocumentOptions",reducer:rT}),i=[];if(i.length)throw new ro({name:e.name,type:"source",causes:i});return a.map((e,t)=>{let n=C.get(e.templateId);if(!n)throw Error(`Could not find template with ID \`${e.templateId}\``);let a=r.get(n.schemaType);if(!a)throw Error(`Could not find matching schema type \`${n.schemaType}\` for template \`${n.id}\``);let i=e.title||n.title,o=a?.title===i?void 0:a?.title;return{id:`${e.templateId}-${t}`,templateId:e.templateId,type:"initialValueTemplateItem",title:i,i18n:e.i18n||n.i18n,subtitle:e.subtitle||o,description:e.description||n.description,icon:e.icon||n.icon||a?.icon,initialDocumentId:e.initialDocumentId,parameters:e.parameters,schemaType:n.schemaType}}).filter(e=>!n||"document"===t.type||n===C.get(e.templateId)?.schemaType)},I;try{I=j({type:"global"})}catch(e){g.push(e)}if(g.length)throw new ro({name:e.name,type:"source",causes:g});let T=(e=>{let{config:t,initialValue:n}=e;return(0,m.z)(t,[]).reduce((e,{config:t})=>{let n=t.beta?.comments;if(void 0===n)return e;if(!(0,i.on)(n))throw Error(`Expected \`beta.comments\` to be an object, but received ${(0,a.Si)(n)}`);let r=n.v2;if(void 0===r)return e;if("boolean"==typeof r)return r;throw Error(`Expected \`beta.comments.v2\` to be a boolean, but received ${(0,a.Si)(r)}`)},n)})({config:e,initialValue:!1}),E=(e=>{let{config:t,initialValue:n}=e;return(0,m.z)(t,[]).reduce((e,{config:t})=>{let n=t.beta?.variants;if(void 0===n)return e;if(!(0,i.on)(n))throw Error(`Expected \`beta.variants\` to be an object, but received ${(0,a.Si)(n)}`);let r=n.enabled;if(void 0===r)return e;if("boolean"==typeof r)return r;throw Error(`Expected \`beta.variants.enabled\` to be a boolean, but received ${(0,a.Si)(r)}`)},n)})({config:e,initialValue:!1}),$=o?(async()=>{let e=v(u.n);return await iQ(e)?i2(r,e):void lp("Skipping schema upload: user lacks the deployStudio grant")})().catch(e=>{lp("Uploading schema failed",{err:e})}):Promise.resolve(void 0);return{type:"source",name:e.name,title:e.title||(0,tl.A)(e.name),schema:r,getClient:v,dataset:f,projectId:y,tools:d,currentUser:n,authenticated:o,templates:S,auth:l,i18n:s.source,__internal_tasks:(e=>{let{config:t}=e;return(0,m.z)(t,[]).reduce((e,{config:t})=>{let n=t.__internal_tasks;if(!n)return e;if("object"==typeof n&&n.footerAction)return n;throw Error(`Expected \`__internal__tasks\` to be an object with footerAction, but received ${(0,a.Si)(n)}`)},void 0)})({config:e}),document:{actions:t=>rL({config:e,context:{...x,...t},initialValue:rg,propertyName:"document.actions",reducer:rj}),badges:t=>rL({config:e,context:{...x,...t},initialValue:rh,propertyName:"document.badges",reducer:rC}),drafts:{enabled:rL({config:e,context:x,reducer:rz,propertyName:"document.drafts.enabled",initialValue:!0})},unstable_fieldActions:t=>rL({config:e,context:{...x,...t},initialValue:rf,propertyName:"document.unstable_fieldActions",reducer:ry}),inspectors:t=>rL({config:e,context:{...x,...t},initialValue:a.Nr,propertyName:"document.inspectors",reducer:rD}),resolveProductionUrl:t=>rL({config:e,context:{...x,...t},initialValue:void 0,propertyName:"resolveProductionUrl",asyncReducer:rx}),resolveNewDocumentOptions:j,unstable_languageFilter:t=>rL({config:e,context:{...x,...t},initialValue:rb,propertyName:"document.unstable_languageFilter",reducer:rq}),unstable_comments:{enabled:t=>rN({context:t,config:e,initialValue:!0})},comments:{enabled:t=>rN({context:t,config:e,initialValue:!0})},askToEdit:{enabled:t=>(e=>{let{config:t,context:n,initialValue:r}=e;return(0,m.z)(t,[]).reduce((e,{config:t})=>{let r=t.document?.askToEdit?.enabled;if(!r&&"boolean"!=typeof r)return e;if("function"==typeof r)return r(n);if("boolean"==typeof r)return r;throw Error(`Expected \`document.askToEdit.enabled\` to be a boolean or a function, but received ${(0,a.Si)(r)}`)},r)})({context:t,config:e,initialValue:!0})}},form:{file:{assetSources:rL({config:e,context:x,initialValue:_.fileSource?[_.fileSource,w.fileSource]:[w.fileSource],propertyName:"formBuilder.file.assetSources",reducer:rE}
33),directUploads:r$({config:e,schemaTypeName:"file"})},image:{assetSources:rL({config:e,context:x,initialValue:_.imageSource?[_.imageSource,w.imageSource]:[w.imageSource],propertyName:"formBuilder.image.assetSources",reducer:rA}),directUploads:r$({config:e,schemaTypeName:"image"})}},search:{filters:aI,operators:iJ,unstable_partialIndexing:{enabled:(e=>{let{config:t,initialValue:n}=e;return(0,m.z)(t,[]).reduce((e,{config:t})=>{let n=t.search?.unstable_partialIndexing?.enabled;if(!n&&"boolean"!=typeof n)return e;if("boolean"==typeof n)return n;throw Error(`Expected \`search.unstable_partialIndexing.enabled\` to be a boolean, but received ${(0,a.Si)(n)}`)},n)})({config:e,initialValue:e.search?.unstable_partialIndexing?.enabled??!1})},strategy:(({config:e,initialValue:t})=>(0,m.z)(e,[]).reduce((e,t)=>{let{strategy:n}=t.config.search??{};if(void 0!==n){if(!(0,ef.GC)(n)){let e=new Intl.ListFormat("en-US",{type:"disjunction"}).format(ef.IB.map(e=>`"${e}"`)),t="string"==typeof n?`"${n}"`:(0,a.Si)(n);throw Error(`Expected \`search.strategy\` to be ${e}, but received ${t}`)}return n}return e},t))({config:e,initialValue:"groq2024"})},__internal:{bifur:h,i18next:s.i18next,staticInitialValueTemplateItems:I,options:e,schemaDescriptorId:$},onUncaughtError:(t,n)=>(e=>{let{config:t,context:n}=e;(0,m.z)(t,[]).forEach(({config:e})=>{let t=e.onUncaughtError;if("function"==typeof t)return t(n.error,n.errorInfo);if(t)throw Error(`Expected \`document.onUncaughtError\` to be a a function, but received ${(0,a.Si)(t)}`)})})({config:e,context:{error:t,errorInfo:n}}),beta:{comments:{v2:T},eventsAPI:{documents:rV({config:e,initialValue:!0,key:"documents"}),releases:rV({config:e,initialValue:!1,key:"releases"})},variants:{enabled:E},documentGroupInventory:{enabled:(({config:e,initialValue:t})=>(0,m.z)(e,[]).reduce((e,{config:t})=>{let n=t.beta?.documentGroupInventory;if(void 0===n)return e;if(!(0,i.on)(n))throw Error(`Expected \`beta.documentGroupInventory\` to be an object, but received ${(0,a.Si)(n)}`);let r=n.enabled;if(void 0===r)return e;if("boolean"==typeof r)return r;throw Error(`Expected \`beta.documentGroupInventory.enabled\` to be a boolean, but received ${(0,a.Si)(r)}`)},t))({config:e,initialValue:!1})||E}},announcements:{enabled:(e=>{let{config:t,initialValue:n}=e;return(0,m.z)(t,[]).reduce((e,{config:t})=>{let n=t.announcements?.enabled;if(!n&&"boolean"!=typeof n)return e;if("boolean"==typeof n)return n;throw Error(`Expected \`announcements.enabled\` to be a boolean, but received ${(0,a.Si)(n)}`)},n)})({config:e,initialValue:!0})},mediaLibrary:{enabled:rF({config:e,initialValue:!1}),libraryId:rO({config:e,initialValue:void 0}),__internal:{frontendHost:(e=>{let{config:t,initialValue:n}=e;return(0,m.z)(t,[]).reduce((e,{config:t})=>{let n=t.mediaLibrary?.__internal?.frontendHost;if(!n&&"string"!=typeof n)return e;if("string"==typeof n)return n;throw Error(`Expected \`mediaLibrary.__internal.frontendHost\` to be a string, but received ${(0,a.Si)(n)}`)},n)})({config:e,initialValue:void 0})}},advancedVersionControl:{enabled:rL({config:e,context:x,reducer:rM,propertyName:"advancedVersionControl.enabled",initialValue:!1})},scheduledDrafts:{enabled:(e=>{let{config:t,initialValue:n}=e;return(0,m.z)(t,[]).reduce((e,{config:t})=>{let n=t.scheduledDrafts?.enabled;if(void 0===n)return e;if("boolean"==typeof n)return n;throw Error(`Expected a boolean, but received ${(0,a.Si)(n)}`)},n)})({config:e,initialValue:!0})},releases:e.releases?{enabled:e.releases.enabled??!0,limit:e.releases.limit,actions:t=>rL({config:e,context:{...x,...t},initialValue:[],propertyName:"releases.actions",reducer:rI})}:{enabled:!0}}})({config:e,client:t,currentUser:r,schema:h,authenticated:n,auth:v,i18n:x})),(0,B.t)(1));return{name:e.name,projectId:e.projectId,dataset:e.dataset,title:e.title||(0,tl.A)(e.name),auth:v,schema:h,i18n:x.source,source:w}}),y=d.title||(0,tl.A)(d.name),h={type:"workspace-summary",auth:f[0].auth,basePath:(r=n,o=d.basePath,`/${[r,o||""].map(e=>e.replace(/^\/+/g,"").replace(/\/+$/g,"")).filter(Boolean).join("/")}`),dataset:d.dataset,apiHost:d.apiHost,schema:f[0].schema,i18n:f[0].i18n,customIcon:!!d.icon,icon:function(e,t,n=""){return(0,e7.isValidElementType)(e)?(0,em.jsx)(e,{}):(0,O.isValidElement)(e)?e:rp(t,n)}(d.icon,y,`${d.projectId} ${d.dataset}`),name:d.name||"default",projectId:d.projectId,theme:d.theme||eg.Qx,title:y,subtitle:d.subtitle,hidden:d.hidden,__internal:{sources:f},...l};return ly.set(e,h),h})}}let l_="connecting";function lS(e,t,n,r){return e.pair.documentEvents(t,n,r).pipe((0,z.T)(e=>e.type),(0,z.T)(e=>"reconnect"!==e),(0,M.n)(e=>e?(0,U.of)("connected"):(0,P.O)(200).pipe((0,eA.u)("reconnecting"))),(0,K.Z)(l_),(0,Y.F)())}function lk(e){let t=(0,eu.c)(22),{displayed:n,documentId:r,strict:a,historyVersion:o}=e,{selectedReleaseId:l}=(0,m.nt)(),{data:s}=(0,m.t)(),{data:c}=(0,j.y)(),d;t[0]===r?d=t[1]:(d={documentId:r},t[0]=r,t[1]=d);let{data:u}=(0,m.et)(d),f=n?._id??"",y=!(!n||n._createdAt),h=!u,g,b;if(t[2]!==c||t[3]!==f||t[4]!==u||t[5]!==o||t[6]!==y||t[7]!==s||t[8]!==l||t[9]!==a||t[10]!==h){b=Symbol.for("react.early_return_sentinel");e:{if(h){b={notCurrentReleases:[],currentReleases:[],inCreation:null};break e}if(t[13]!==c||t[14]!==f||t[15]!==u||t[16]!==o||t[17]!==y||t[18]!==s||t[19]!==l||t[20]!==a){let e=u.map(lC);if(g=s.reduce((t,n)=>{let r=e.includes((0,i.U)(n._id)),o=(0,i.U)(n._id);return y&&o===(0,p.u)(f)&&o===l?t.inCreation=n:r?a?((0,m.lt)(f,(0,i.U)(n._id))||"scheduled"===n.metadata.releaseType)&&t.currentReleases.push(n):t.currentReleases.push(n):t.notCurrentReleases.push(n),t},{notCurrentReleases:[],currentReleases:[],inCreation:null}
33),!o){b=g;break e}let n=c.find(e=>(0,i.U)(e._id)===o);n?.state==="archived"&&g.currentReleases.push(n),t[13]=c,t[14]=f,t[15]=u,t[16]=o,t[17]=y,t[18]=s,t[19]=l,t[20]=a,t[21]=g}else g=t[21]}t[2]=c,t[3]=f,t[4]=u,t[5]=o,t[6]=y,t[7]=s,t[8]=l,t[9]=a,t[10]=h,t[11]=g,t[12]=b}else g=t[11],b=t[12];return b===Symbol.for("react.early_return_sentinel")?g:b}function lC(e){return(0,p.u)(e)}function lj(e){let t,n=(0,eu.c)(28),{displayed:r,documentId:a,editState:o,strict:l}=e,{document:s}=(0,u.c)(),{drafts:c}=s,{enabled:d}=c,m;n[0]!==r||n[1]!==a||n[2]!==l?(m={displayed:r,documentId:a,strict:l},n[0]=r,n[1]=a,n[2]=l,n[3]=m):m=n[3];let f=lk(m),y=r?._id,h=o?.id,g=o?.published?._id,b=o?.draft?._id,v=o?.version!==null,x;n[4]!==y||n[5]!==d||n[6]!==l?(x=d&&(!l||(0,p.h)(y??"")),n[4]=y,n[5]=d,n[6]=l,n[7]=x):x=n[7];let w=x,_;if(n[8]!==b||n[9]!==w?(_=w?b:[],n[8]=b,n[9]=w,n[10]=_):_=n[10],n[11]!==y||n[12]!==h||n[13]!==f.currentReleases||n[14]!==v||n[15]!==g||n[16]!==l||n[17]!==_){let e=[g,_].flat(),r;n[19]===h?r=n[20]:(r=e=>h&&(0,p.d)(h,(0,i.U)(e._id)),n[19]=h,n[20]=r);let a=f.currentReleases.map(r),o=v&&!a.includes(y),s=o?[y]:[];t=e.concat(!o||!l?a:[]).concat(s).filter(lI),n[11]=y,n[12]=h,n[13]=f.currentReleases,n[14]=v,n[15]=g,n[16]=l,n[17]=_,n[18]=t}else t=n[18];let S=t,k;n[21]===y?k=n[22]:(k=e=>e===y,n[21]=y,n[22]=k);let C=S.findIndex(k),j=S[C-1]??void 0,I=S[C+1]??void 0,T;return n[23]!==I||n[24]!==C||n[25]!==j||n[26]!==S?(T={position:C,previousId:j,nextId:I,stack:S},n[23]=I,n[24]=C,n[25]=j,n[26]=S,n[27]=T):T=n[27],T}function lI(e){return"string"==typeof e}let lT="synced";function lE(e){return void 0!==e}function l$(e){let t=(0,eu.c)(8),n=(0,eT.dj)(),[r,a]=(0,O.useState)(),i,o;t[0]===e.enabled?(i=t[1],o=t[2]):(i=()=>{(0,O.startTransition)(()=>a(t=>e.enabled?t||new Date:void 0))},o=[e.enabled],t[0]=e.enabled,t[1]=i,t[2]=o),(0,O.useEffect)(i,o);let l=function(e){let t=(0,eu.c)(4),[n,r]=(0,O.useState)(lA),a,i;return t[0]!==e||1e3!==t[1]?(a=()=>{if(!e)return;let t=setInterval(()=>{(0,O.startTransition)(()=>r(new Date))},1e3);return()=>clearInterval(t)},i=[1e3,e],t[0]=e,t[1]=1e3,t[2]=a,t[3]=i):(a=t[2],i=t[3]),(0,O.useEffect)(a,i),n}(!!e.enabled),s=r&&e.enabled&&l.getTime()-r.getTime()>(e?.delay??0),c,d;t[3]!==s||t[4]!==e||t[5]!==n?(c=()=>{if(s)return n.push({...e,duration:1/0}),()=>{n.push({...e,duration:.01})}},d=[e,n,s],t[3]=s,t[4]=e,t[5]=n,t[6]=c,t[7]=d):(c=t[6],d=t[7]),(0,O.useEffect)(c,d)}function lA(){return new Date}let lq=e=>{let t,n=(0,eu.c)(5),{t:r}=(0,s.t)(),a;n[0]===r?a=n[1]:(a=r("common.reconnecting.toast.title"),n[0]=r,n[1]=a),n[2]!==e||n[3]!==a?(t={enabled:e,delay:2e3,id:"sanity/reconnecting",status:"warning",title:a},n[2]=e,n[3]=a,n[4]=t):t=n[4],l$(t)},lD=["asap","scheduled","undecided"],lN=e=>{let t=(0,eu.c)(9),{documentId:n}=e,{data:r}=(0,m.t)(),a;t[0]===n?a=t[1]:(a={documentId:n},t[0]=n,t[1]=a);let{data:o}=(0,m.et)(a),l;if(t[2]!==o||t[3]!==r){let e;t[5]===o?e=t[6]:(e=e=>{let{_id:t}=e;return o.some(e=>(0,p.u)(e)===(0,i.U)(t))},t[5]=o,t[6]=e),l=r.filter(e).sort(lV),t[2]=o,t[3]=r,t[4]=l}else l=t[4];let s=l,c;return t[7]===s?c=t[8]:(c={sortedDocumentList:s},t[7]=s,t[8]=c),c};function lV(e,t){if("scheduled"===e.metadata.releaseType&&"scheduled"===t.metadata.releaseType){let n=e.publishAt||e.metadata.intendedPublishAt;if(!n)return -1;let r=t.publishAt||t.metadata.intendedPublishAt;return r?new Date(n).getTime()-new Date(r).getTime():1}return lD.indexOf(e.metadata.releaseType)-lD.indexOf(t.metadata.releaseType)}let lF=e=>{let t=(0,eu.c)(4),{documentId:n}=e,r;t[0]===n?r=t[1]:(r={documentId:n},t[0]=n,t[1]=r);let{data:a}=(0,m.et)(r),i;return t[2]===a?i=t[3]:(i=a&&a.length>0&&!a.some(lO),t[2]=a,t[3]=i),i};function lO(e){return!(0,p.y)(e)}function lz(e){let t=(0,eu.c)(14),{documentId:n,selectedPerspectiveName:r}=e,a;t[0]===n?a=t[1]:(a={documentId:n},t[0]=n,t[1]=a);let{data:o}=(0,m.et)(a),{selectedVariantName:l}=(0,m.nt)(),s=(0,m.Y)(n),c;t[2]===n?c=t[3]:(c={documentId:n},t[2]=n,t[3]=c);let d=lF(c),u;t[4]===n?u=t[5]:(u={documentId:n},t[4]=n,t[5]=u);let{sortedDocumentList:f}=lN(u),y;t[6]!==o||t[7]!==f[0]||t[8]!==f.length?(y=f.length>0?o.find(e=>(0,p.u)(e)===(0,i.U)(f[0]._id)):void 0,t[6]=o,t[7]=f[0],t[8]=f.length,t[9]=y):y=t[9];let h=y,g;
33e:{if(l){let e;t[10]===s?e=t[11]:(e=(0,m.q)(s),t[10]=s,t[11]=e),g=e;break e}if((0,p._)(r)){g=void 0;break e}if(o.some(e=>(0,p.u)(e)===r)||r&&(!o.length||!d)){g=r;break e}let e=h??"",n;t[12]===e?n=t[13]:(n=(0,p.u)(e),t[12]=e,t[13]=n),g=n}return g}function lM(e){if(e?.ready)return[e.draft,e.published,e.version].every(e=>null===e)}function lL({grantsStore:e,document:t,permission:n}){let{checkDocumentPermission:r}=e;return r(n,t)}let lP=[void 0,!0];function lR(e,t){let[n,r]=e;switch(t.type){case"loading":return[n,!0];case"value":return!r&&(0,eU.j)(t.value,n)?e:[t.value,!1];case"error":throw t.error;default:throw Error(`Invalid action type: ${t}`)}}function lU(e,t){return(0,eU.j)(e,t)}let lK=/^\d+$/;function lB(e){return(function(e){let t=[],n="",r=!1,a=null;for(let i=0;i<e.length;i++){let o=e[i];if(('"'===o||"'"===o)&&!a){a=o,n+=o;continue}if(o===a){a=null,n+=o;continue}if(a){n+=o;continue}if("["===o){n&&=(t.push(n),""),r=!0;continue}if("]"===o){n&&=(t.push(n),""),r=!1;continue}if("."===o&&!r){n&&=(t.push(n),"");continue}n+=o}return n&&t.push(n),t})(e).filter(Boolean).map(e=>e.includes("==")?function(e){let[t,n]=e.split("==");return{[t]:n.replace(/^['"]/,"").replace(/['"]$/,"")}}(e):lK.test(e)?Number(e):e)}function lW(e,t){return(0,eO.A)(t.map(t=>{var n,r;let a;return n=e,r=t,(0,eO.A)(Object.keys(r).filter((a=["id","ifRevisionID","query"],e=>!a.includes(e))).map(e=>{if("unset"===e)return r.unset.map(e=>({type:"unset",path:lB(e),origin:n}));if("insert"===e){let e="before"in r.insert?"before":"after";return{type:"insert",position:e,path:lB(r.insert[e]),items:r.insert.items,origin:n}}return Object.keys(r[e]).map(t=>"set"===e?{type:"set",path:lB(t),value:r[e][t],origin:n}:"inc"===e||"dec"===e?{type:e,path:lB(t),value:r[e][t],origin:n}:"setIfMissing"===e?{type:"setIfMissing",path:lB(t),value:r[e][t],origin:n}:"diffMatchPatch"===e?{type:e,path:lB(t),value:r[e][t],origin:n}:(console.warn(Error(`Unsupported patch type: ${e}`)),null)).filter(Boolean)}))}))}function lH(e){if(e.patchType!==a.xa&&e.type)throw Error(`Patch is missing "patchType" - import and use "${e.type}()" from "sanity/form"`);if(e.patchType!==a.xa)throw Error('Patch is missing "patchType" - import and use the patch method helpers from "sanity/form"');let t=(0,eB.jN)(e.path||[]);if("insert"===e.type){let{position:n,items:r}=e;return{insert:{[n]:t,items:r}}}if("unset"===e.type)return{unset:[t]};if(!e.type)throw Error(`Missing patch type in patch ${JSON.stringify(e)}`);return t?{[e.type]:{[t]:e.value}}:{[e.type]:e.value}}function lG(e){var t,n,r;let o,l,s,c,d,u,f,y,h,g,b,v,x,w,_,S,k,C,j=(0,eu.c)(186),{documentType:I,getFormDocumentValue:T,documentId:E,initialValue:$,changesOpen:A,comparisonValue:D,releaseId:N,initialFocusPath:V,selectedPerspectiveName:F,readOnly:L,onFocusPath:R,displayInlineChanges:B,isOlderRevision:W}=e,H=void 0!==A&&A,G=(0,i.Zt)(),Z=(0,i.c)(),{data:J}=(0,m.t)(),Q;j[0]===E?Q=j[1]:(Q={documentId:E},j[0]=E,j[1]=Q);let{versions:X,loading:ee}=(0,m.et)(Q),{selectedVariantName:et,bundle:en}=(0,m.nt)(),er=(0,m.Y)(E),ea;j[2]===er?ea=j[3]:(ea=(0,m.G)(er),j[2]=er,j[3]=ea);let ei=ea,eo=!!(ei&&$?.value),el="ready"===er.status&&void 0!==er.variant,es;j[4]!==I||j[5]!==G?(es=G.get(I),j[4]=I,j[5]=G,j[6]=es):es=j[6];let ec=es;if(!ec)throw Error(`Schema type for '${I}' not found`);let em=!!ec.liveEdit,ep=(0,eI.Jr)(),ef;j[7]===E?ef=j[8]:(ef={documentId:E},j[7]=E,j[8]=ef);let ey=lF(ef),eh;j[9]!==E||j[10]!==F?(eh={documentId:E,selectedPerspectiveName:F},j[9]=E,j[10]=F,j[11]=eh):eh=j[11];let eg=lz(eh),eb=nu(E,I,"default",eg),ev=(o=(0,eu.c)(5),l=(0,i.i)(),o[0]!==I||o[1]!==l||o[2]!==E||o[3]!==eg?(s=lS(l,E,I,eg),o[0]=I,o[1]=l,o[2]=E,o[3]=eg,o[4]=s):s=o[4],(0,eD.ut)(s,l_));lq("reconnecting"===ev);let ex=(c=(0,eu.c)(5),d=(0,i.i)(),c[0]!==I||c[1]!==d||c[2]!==E||c[3]!==eg?(t=d.pair.consistencyStatus(E,I,eg),n=lS(d,E,I,eg),r=d.pair.commitErrorStatus(E,I,eg).pipe((0,z.T)(lE)),f=t.pipe((0,M.n)(e=>e?(0,U.of)("synced"):(0,P.O)(1e4,2e4).pipe((0,z.T)(e=>0===e?"pending":"stalled"),(0,K.Z)("synced"))),(0,Y.F)()),y=n.pipe((0,z.T)(e=>"connected"===e),(0,Y.F)()),u=(0,ed.z)([f,y,r.pipe((0,Y.F)())]).pipe((0,z.T)(([e,t,n])=>"synced"===e?"synced":t?n?"retrying":"synced":"pending"===e?"disconnected-pending":"disconnected-stalled"),(0,Y.F)(),(0,M.n)(e=>"synced"===e?(0,U.of)("synced"):"disconnected-pending"===e?(0,U.of)("pending"):"disconnected-stalled"===e?(0,U.of)("stalled"):(0,P.O)(5500).pipe((0,M.n)(()=>(0,P.O)(1e4).pipe((0,z.T)(()=>"stalled"),(0,K.Z)("recovering"))))),(0,K.Z)(lT),(0,Y.F)()),c[0]=I,c[1]=d,c[2]=E,c[3]=eg,c[4]=u):u=c[4],(0,eD.ut)(u,lT)),[ew,e_]=(0,O.useState)(V||a.Nr),eS;e:{let e;j[12]!==E||j[13]!==I||j[14]!==$?.value?(e=$?.value||{_id:E,_type:I},j[12]=E,j[13]=I,j[14]=$?.value,j[15]=e):e=j[15];let t=e;if(el||ei){eS=eb.version||t;break e}if(N&&!(0,p._)(N)){if(eb.version&&(0,i.X)(eb.version)){eS=eb.published||t;break e}eS=eb.version||eb.draft||eb.published||t;break e}if(F&&(0,m.mt)(F)){let e;j[16]!==t||j[17]!==E||j[18]!==I||j[19]!==eb.published||j[20]!==em?(e=eb.published||(em?t:{_id:E,_type:I}),j[16]=t,j[17]=E,j[18]=I,j[19]=eb.published,j[20]=em,j[21]=e):e=j[21],eS=e;break e}if(F||ey){eS=eb.version||eb.draft||eb.published||t;break e}eS=eb?.draft||eb?.published||t}let ek=eS,{validation:eC}
33=(0,q.s)(ek._id,I,!N),eT=(0,a.Na)(W?a.Nr:eC),eE;j[22]!==E||j[23]!==eb||j[24]!==ek?(eE={strict:!0,displayed:ek,documentId:E,editState:eb},j[22]=E,j[23]=eb,j[24]=ek,j[25]=eE):eE=j[25];let{previousId:e$}=lj(eE),eA=e$??"",eq;j[26]===eA?eq=j[27]:(eq=(0,p.u)(eA),j[26]=eA,j[27]=eq);let eN=nu(E,I,"default",eq),eV=el&&!W,eF;j[28]!==en||j[29]!==X||j[30]!==eV?(eF=eV?(0,m.Q)({bundle:en,variant:void 0,documentVersions:X}):void 0,j[28]=en,j[29]=X,j[30]=eV,j[31]=eF):eF=j[31];let eO=eF,ez=nu(E,I,"default",eV?eO?._system.scopeId:eg),eM;t:{if("function"==typeof D){let e;j[32]!==D||j[33]!==eN?(e=D(eN),j[32]=D,j[33]=eN,j[34]=e):e=j[34],eM=e;break t}eM=D}let eL=eM,eP=eO?._id,eR;j[35]!==ez||j[36]!==eP?(eR=function(e,t){if(!t)return null;let n=[e.version,e.draft,e.published].find(e=>e?._id===t);return!n||n._system?.variant?null:n}(ez,eP),j[35]=ez,j[36]=eP,j[37]=eR):eR=j[37];let eU=eR,eK;j[38]!==Z||j[39]!==ek._id?(eK=Z.documentPresence(ek._id,{excludeVersions:!0}).pipe((0,Y.F)(lY)),j[38]=Z,j[39]=ek._id,j[40]=eK):eK=j[40];let eB=eK,eW;j[41]===Symbol.for("react.memo_cache_sentinel")?(eW=[],j[41]=eW):eW=j[41];let eH=(0,eD.ut)(eB,eW),[eG,eZ]=(0,O.useState)(V||a.Nr),eJ=(0,O.useRef)(eG),[eY,eQ]=(0,O.useState)(),[e0,e1]=(0,O.useState)(),[e2,e3]=(0,O.useState)(),e4;j[42]===Symbol.for("react.memo_cache_sentinel")?(e4=(e,t)=>{e1(n=>(0,a.mr)(n,e,t))},j[42]=e4):e4=j[42];let e5=e4,e6;j[43]===Symbol.for("react.memo_cache_sentinel")?(e6=(e,t)=>{e3(n=>(0,a.mr)(n,e,t))},j[43]=e6):e6=j[43];let e7=e6,e8;j[44]===Symbol.for("react.memo_cache_sentinel")?(e8=(e,t)=>eQ(n=>(0,a.mr)(n,e,t)),j[44]=e8):e8=j[44];let e9=e8,te=ek._createdAt?"update":"create";eb.draft?._id;n:{let e;if("ready"===er.status&&er.targetDocument){h=er.targetDocument._id;break n}if(ei){h=ei.id;break n}if("published"===en){let e;j[45]===E?e=j[46]:(e=(0,p.l)(E),j[45]=E,j[46]=e),h=e;break n}if("drafts"===en){let e;if(em){let e;j[47]!==E||j[48]!==eb.draft?._id?(e=eb.draft?._id||(0,p.l)(E),j[47]=E,j[48]=eb.draft?._id,j[49]=e):e=j[49],h=e;break n}j[50]===E?e=j[51]:(e=(0,p.s)(E),j[50]=E,j[51]=e),h=e;break n}j[52]!==en||j[53]!==E?(e=(0,p.d)((0,p.l)(E),en),j[52]=en,j[53]=E,j[54]=e):e=j[54],h=e}let tt=h,tn;j[55]!==tt||j[56]!==ek?(tn={...ek,_id:tt},j[55]=tt,j[56]=ek,j[57]=tn):tn=j[57];let tr=tn,ti;j[58]!==tr||j[59]!==te?(ti={document:tr,permission:te},j[58]=tr,j[59]=te,j[60]=ti):ti=j[60];let[to,tl]=function(e){let t=(0,eu.c)(5),{document:n,permission:r,grantsStore:a}=e,o=(0,i.a)(),l=a||o,[s,c]=(0,O.useReducer)(lR,lP),d=(0,O.useRef)(null),u=(0,O.useRef)(!1),m,p;return t[0]!==n||t[1]!==l||t[2]!==r?(m=()=>(u.current||(u.current=!0,c({type:"loading"})),d.current&&d.current.unsubscribe(),d.current=lL({grantsStore:l,document:n,permission:r}).pipe((0,Y.F)(lU)).subscribe({next:e=>c({type:"value",value:e}),error:e=>c({type:"error",error:e})}),()=>{d.current&&=(d.current.unsubscribe(),null)}),p=[l,n,r],t[0]=n,t[1]=l,t[2]=r,t[3]=m,t[4]=p):(m=t[3],p=t[4]),(0,O.useEffect)(m,p),s}(ti),ts=!ek?._id,tc="connected"===ev&&eb.ready&&!$?.loading&&!ee,td;j[61]!==J||j[62]!==F?(td=(0,a.r)(F,J),j[61]=J,j[62]=F,j[63]=td):td=j[63];let tu=td,tm;j[64]===tu?tm=j[65]:(tm=!!(0,m.St)(tu)&&(0,m.ht)(tu),j[64]=tu,j[65]=tm);let tp=tm,{isLockedByCanvas:tf}=t6(ek._id),ty;j[66]!==eo||j[67]!==ev||j[68]!==eb||j[69]!==tf||j[70]!==ts||j[71]!==tl||j[72]!==tp||j[73]!==el||j[74]!==em||j[75]!==ey||j[76]!==to?.granted||j[77]!==L||j[78]!==tc||j[79]!==N||j[80]!==ec||j[81]!==F||j[82]!==et||j[83]!==ex||j[84]!==er||j[85]!==ek?(ty=()=>{let e=!tl&&!to?.granted,t=!(0,ta.Yh)(ec,"update"),n=ts&&!(0,ta.Yh)(ec,"create"),r="reconnecting"===ev,a=eb.transactionSyncLock?.enabled,o="stalled"===ex||"recovering"===ex,l=!!ek&&(0,i.X)(ek);return!!(et&&"ready"!==er.status&&!eo||!el&&!eo&&(eb.version&&!eb.draft&&!eb.published&&ey&&F!==(0,p.u)(eb.version._id)&&!1===lM(eb)||!em&&"published"===F||N&&(0,p.u)(ek._id)!==N&&!1===lM(eb))||em&&(0,m.J)(er)?.draft)||!tc||!!tf||!!e||!!t||!!n||!!r||!!a||!!o||!!l||!!tp||("function"==typeof L?L(eb):!!L)},j[66]=eo,j[67]=ev,j[68]=eb,j[69]=tf,j[70]=ts,j[71]=tl,j[72]=tp,j[73]=el,j[74]=em,j[75]=ey,j[76]=to?.granted,j[77]=L,j[78]=tc,j[79]=N,j[80]=ec,j[81]=F,j[82]=et,j[83]=ex,j[84]=er,j[85]=ek,j[86]=ty):ty=j[86],to?.granted,j[87]===ty?g=j[88]:(g=ty(),j[87]=ty,j[88]=g);let th=g,tg;j[89]!==et||j[90]!==er||j[91]!==eg?(tg=et?(0,m.K)(er):eg,j[89]=et,j[90]=er,j[91]=eg,j[92]=tg):tg=j[92];let{patch:tb}=(0,m.kt)(E,I,tg),tv=(0,O.useRef)(lJ),tx;j[93]===Symbol.for("react.memo_cache_sentinel")?(tx=e=>tv.current(e),j[93]=tx):tx=j[93];let tw=tx,t_;j[94]!==eb.draft||j[95]!==eb.published||j[96]!==$?.value||j[97]!==tb||j[98]!==th||j[99]!==ep?(t_=()=>{th?tv.current=lZ:tb.disabled?tv.current=()=>{throw Error(`Attempted to patch a document with a disabled patch operation (${tb.disabled})`)}:tv.current=e=>{eb.draft||eb.published||ep.log(a.xt),tb.execute(e.patches.map(lH),$?.value)}},j[94]=eb.draft,j[95]=eb.published,j[96]=$?.value,j[97]=tb,j[98]=th,j[99]=ep,j[100]=t_):t_=j[100],j[101]!==eb.draft||j[102]!==eb.published||j[103]!==$||j[104]!==tb||j[105]!==th||j[106]!==ep?(b=[eb.draft,eb.published,$,tb,ep,th],j[101]=eb.draft,j[102]=eb.published,j[103]=$,j[104]=tb,j[105]=th,j[106]=ep,j[107]=b):b=j[107],(0,O.useInsertionEffect)(t_,b);r:{if(T){let e;
33j[108]!==T||j[109]!==ek?(e=T(ek),j[108]=T,j[109]=ek,j[110]=e):e=j[110],v=e;break r}v=ek}let tS=v,tk;j[111]===eN?tk=j[112]:(tk=(0,a.fa)(eN),j[111]=eN,j[112]=tk);let tC=null!==tk,tj=null!==eU,tI=eL||ek,tT=eU??void 0,tE;j[113]!==H||j[114]!==e2||j[115]!==e0||j[116]!==B||j[117]!==eY||j[118]!==ew||j[119]!==tS||j[120]!==tj||j[121]!==tC||j[122]!==eG||j[123]!==eH||j[124]!==th||j[125]!==ec||j[126]!==tu||j[127]!==tI||j[128]!==tT||j[129]!==eT?(tE={schemaType:ec,documentValue:tS,readOnly:th,comparisonValue:tI,baseVariantValue:tT,hasBaseVariant:tj,focusPath:ew,openPath:eG,perspective:tu,collapsedPaths:e0,presence:eH,validation:eT,collapsedFieldSets:e2,fieldGroupState:eY,changesOpen:H,hasUpstreamVersion:tC,displayInlineChanges:B},j[113]=H,j[114]=e2,j[115]=e0,j[116]=B,j[117]=eY,j[118]=ew,j[119]=tS,j[120]=tj,j[121]=tC,j[122]=eG,j[123]=eH,j[124]=th,j[125]=ec,j[126]=tu,j[127]=tI,j[128]=tT,j[129]=eT,j[130]=tE):tE=j[130];let t$=(0,a.ur)(tE),tA=(0,O.useRef)(t$),tq,tN;j[131]===t$?(tq=j[132],tN=j[133]):(tq=()=>{tA.current=t$},tN=[t$],j[131]=t$,j[132]=tq,j[133]=tN),(0,O.useEffect)(tq,tN),j[134]===eb?x=j[135]:(x={editState:eb},j[134]=eb,j[135]=x),function(e){let t=(0,eu.c)(18),{editState:n}=e,r=(0,i.u)(),a=(0,eD.ut)(r.capabilities,r.getCapabilities),{activeWorkspace:o}=(0,m.jt)(),l=n.version??n.draft??n.published,s=l?._id??n.id,c=n.type,d;t[0]!==o.dataset||t[1]!==o.projectId?(d=[o.projectId,o.dataset],t[0]=o.dataset,t[1]=o.projectId,t[2]=d):d=t[2];let u=d.join("."),p;t[3]!==o.name||t[4]!==n.type||t[5]!==s||t[6]!==u?(p={resourceType:"studio",documentId:s,documentType:c,resourceId:u,schemaName:o.name},t[3]=o.name,t[4]=n.type,t[5]=s,t[6]=u,t[7]=p):p=t[7];let{recordEvent:f}=(0,m.At)(p),y=(0,O.useRef)(!1),h;t[8]!==a?.comlink||t[9]!==l||t[10]!==n.ready||t[11]!==f?(h=()=>{let e=n.ready&&null!==l;a?.comlink&&e&&!y.current&&(y.current=!0,f("viewed"))},t[8]=a?.comlink,t[9]=l,t[10]=n.ready,t[11]=f,t[12]=h):h=t[12];let g=a?.comlink,b;t[13]!==l||t[14]!==n.ready||t[15]!==f||t[16]!==g?(b=[g,l,n.ready,f],t[13]=l,t[14]=n.ready,t[15]=f,t[16]=g,t[17]=b):b=t[17],(0,O.useEffect)(h,b)}(x),j[136]===Symbol.for("react.memo_cache_sentinel")?(w=e=>{tA.current&&((0,a.lr)(tA.current,e).forEach(e=>{"expandPath"===e.type&&e1(t=>(0,a.mr)(t,e.path,!1)),"expandFieldSet"===e.type&&e3(t=>(0,a.mr)(t,e.path,!1)),"setSelectedGroup"===e.type&&eQ(t=>(0,a.mr)(t,e.path,e.groupName))}),eJ.current=e,eZ(e))},j[136]=w):w=j[136];let tV=w,tF;j[137]!==Z||j[138]!==ek._id?(tF=(e,t)=>{Z.setLocation([{type:"document",documentId:ek._id,path:e,lastActiveAt:new Date().toISOString(),selection:t?.selection}])},j[137]=Z,j[138]=ek._id,j[139]=tF):tF=j[139];let tO=tF,tz,tM;j[140]===tO?(tz=j[141],tM=j[142]):(tz=()=>{tO(a.Nr)},tM=[tO],j[140]=tO,j[141]=tz,j[142]=tM),(0,O.useEffect)(tz,tM),j[143]===tO?_=j[144]:(_=(0,tD.A)(tO,1e3,{leading:!0,trailing:!0}),j[143]=tO,j[144]=_);let tL=_,tP,tR;j[145]===tL?(tP=j[146],tR=j[147]):(tP=()=>()=>{tL.cancel()},tR=[tL],j[145]=tL,j[146]=tP,j[147]=tR),(0,O.useEffect)(tP,tR),j[148]===Symbol.for("react.memo_cache_sentinel")?(S=[],j[148]=S):S=j[148];let tU=(0,O.useRef)(S),tK;j[149]!==R||j[150]!==tL?(tK=(e,t)=>{let n=(0,ej.p0)(e);n!==tU.current&&(e_((0,ej.p0)(n)),(0,ej.n4)(eJ.current,n)||tV((0,ej.p0)(n.slice(0,-1))),tU.current=n,R?.(n)),tL(n,t)},j[149]=R,j[150]=tL,j[151]=tK):tK=j[151];let tB=tK,tW;j[152]!==R||j[153]!==tL?(tW=e=>{e_(a.Nr),tU.current!==a.Nr&&(tU.current=a.Nr,R?.(a.Nr)),tL(a.Nr)},j[152]=R,j[153]=tL,j[154]=tW):tW=j[154];let tH=tW,tG;j[155]===R?tG=j[156]:(tG=e=>{(0,ej.n4)(tU.current,e)||(e_(e),tV(e),R?.(e),tU.current=e)},j[155]=R,j[156]=tG);let tZ=tG,tJ;j[157]!==V||j[158]!==R?(tJ=()=>{if(!V||0===V.length)return;let e=(0,ej.Y7)(tA.current?.value,V);e_(e),tV(e),R?.(e),tU.current=e},j[157]=V,j[158]=R,j[159]=tJ):tJ=j[159];let tY=(0,eX.J)(tJ),tQ=(0,O.useRef)(!1),tX;return j[160]!==tY||j[161]!==tc?(tX=()=>{tc&&!tQ.current&&(tQ.current=!0,tY())},j[160]=tY,j[161]=tc,j[162]=tX):tX=j[162],j[163]===tc?k=j[164]:(k=[tc],j[163]=tc,j[164]=k),(0,O.useEffect)(tX,k),j[165]!==e2||j[166]!==e0||j[167]!==ev||j[168]!==eb||j[169]!==ew||j[170]!==t$||j[171]!==tH||j[172]!==tB||j[173]!==tZ||j[174]!==tj||j[175]!==tC||j[176]!==tl||j[177]!==eG||j[178]!==to||j[179]!==tc||j[180]!==ec||j[181]!==ex||j[182]!==eN||j[183]!==eT||j[184]!==ek?(C={editState:eb,upstreamEditState:eN,connectionState:ev,syncState:ex,focusPath:ew,validation:eT,ready:tc,value:ek,formState:t$,permissions:to,isPermissionsLoading:tl,formStateRef:tA,hasUpstreamVersion:tC,hasBaseVariant:tj,collapsedFieldSets:e2,collapsedPaths:e0,openPath:eG,schemaType:ec,onChange:tw,onPathOpen:tV,onProgrammaticFocus:tZ,onBlur:tH,onFocus:tB,onSetActiveFieldGroup:e9,onSetCollapsedPath:e5,onSetCollapsedFieldSet:e7},j[165]=e2,j[166]=e0,j[167]=ev,j[168]=eb,j[169]=ew,j[170]=t$,j[171]=tH,j[172]=tB,j[173]=tZ,j[174]=tj,j[175]=tC,j[176]=tl,j[177]=eG,j[178]=to,j[179]=tc,j[180]=ec,j[181]=ex,j[182]=eN,j[183]=eT,j[184]=ek,j[185]=C):C=j[185],C}function lZ(){throw Error("Attempted to patch a read-only document")}function lJ(){throw Error("Attempted to patch the Sanity document during initial render or in an `useInsertionEffect`. Input components should only call `onChange()` in a useEffect or an event handler.")}function lY(e,t){return e.length===t.length&&e.every((e,n)=>e.sessionId===t[n].sessionId&&e.lastActiveAt===t[n].lastActiveAt&&e.path===t[n].path)}function lQ(e){let t=(0,eu.c)(3),{children:n,history:r}=e,a;return t[0]!==n||t[1]!==r?(a=(0,em.jsx)(ep.Nv.Provider,{value:r,children:n}),t[0]=n,t[1]=r,t[2]=a):a=t[2],a}let lX=["sanity/schedules"];function l0(e){return!e.__internalApplicationType||!lX.includes(e.__internalApplicationType)}function l1(e){let t={},n=t.order||[],r=t.hidden||[];if(!n.length&&!r.length)return e;let a=e.reduce((e,t)=>
33{let r=t.title||"<unknown>";if(!t.name)return console.warn(`Tool "${r}" does not have the required "name" property`),e;if(e[t.name]){let n=e[t.name].tool.title;return console.warn(`Tools with duplicate name "${t.name}" found ("${r}" and "${n}")`),e}let a=n.indexOf(t.name);return e[t.name]={tool:t,index:-1===a?1/0:a},e},{}),i=e.filter(e=>-1===r.indexOf(e.name));return i.sort((e,t)=>{let n=a[e.name],r=a[t.name],i=n?n.index:1/0,o=r?r.index:1/0;return i===o?0:i-o}),i}let l2=["mode","template"],l3=["mode"];function l4(e){var t,n,r;let a,i,o,l,s,d,u,m,p,f,y,h,g,b,v,x,w,_,S,k,C,j,I,T,E,$,A,q=(0,eu.c)(10),{children:D,LoadingComponent:N,workspace:V}=e,{basePath:F,tools:z}=V,M=function(){let e=(0,O.useContext)(ep.Nv);if(!e)throw Error("Could not find `RouterHistoryProvider` context");return e}(),L;q[0]!==F||q[1]!==z?(L=function(e){let{basePath:t="/",tools:n}=e,r=tr.wE.create("/:tool",e=>{let t=n.find(t=>t.name===e.tool);return t||"desk"!==e.tool||(t=n.find(e=>"structure"===e.name)),t?tr.wE.scope(t.name,"/",t.router):tr.wE.create("/")});return tr.wE.create(t,[tr.wE.intents("/intent"),r])}({basePath:F,tools:z}),q[0]=F,q[1]=z,q[2]=L):L=q[2];let P=L,[R,U]=(t=M,n=P,r=z,(d=(0,eu.c)(45))[0]===n?(u=d[1],m=d[2],p=d[3]):(u=n.getBasePath(),p=RegExp,m=(0,t2.A)(u),d[0]=n,d[1]=u,d[2]=m,d[3]=p),f=`^${m}(\\/|\\?|$)`,d[4]!==p||d[5]!==f?(y=new p(f,"i"),d[4]=p,d[5]=f,d[6]=y):y=d[6],h=y,d[7]!==u||d[8]!==h?(g=e=>"/"===u||h.test(e),d[7]=u,d[8]=h,d[9]=g):g=d[9],b=g,d[10]===t?(v=d[11],x=d[12]):(v=e=>t.listen(e),x=()=>`${t.location.pathname}${t.location.search||""}`,d[10]=t,d[11]=v,d[12]=x),d[13]!==n||d[14]!==b?(a=e=>"string"==typeof e&&b(e)?{type:"state",state:n.decode(e)||{},isNotFound:n.isNotFound(e)}:null,d[13]=n,d[14]=b,d[15]=a):a=d[15],d[16]!==v||d[17]!==x||d[18]!==a?(i={subscribe:v,getSnapshot:x,getServerSnapshot:l6,selector:a},d[16]=v,d[17]=x,d[18]=a,d[19]=i):i=d[19],w=i,_=(0,t1.useSyncExternalStoreWithSelector)(w.subscribe,w.getSnapshot,w.getServerSnapshot,w.selector,eU.j),S=(0,O.useRef)(_),d[20]!==_||d[21]!==t||d[22]!==n||d[23]!==r?(k=()=>{if(_?.type==="state"&&!_.state?.intent){var e,a;let i,o=(e=_.state,a=e&&(l1(r).find(t=>t.name===e.space)?{...e,tool:e.space,space:void 0}:e),i=l1(r).find(l0),a&&!a.tool&&i?Object.assign({},a,{tool:i.name}):a);o&&o!==_.state&&t.replace(n.encode(o))}},d[20]=_,d[21]=t,d[22]=n,d[23]=r,d[24]=k):k=d[24],C=_?.state,j=_?.type,d[25]!==t||d[26]!==n||d[27]!==C||d[28]!==j||d[29]!==r?(I=[C,j,t,n,r],d[25]=t,d[26]=n,d[27]=C,d[28]=j,d[29]=r,d[30]=I):I=d[30],(0,O.useEffect)(k,I),d[31]!==_||d[32]!==t||d[33]!==n||d[34]!==r?(o=()=>{let e=l7(_,n,r,S);e?t.replace(e):S.current=_},l=[_,t,n,r],d[31]=_,d[32]=t,d[33]=n,d[34]=r,d[35]=o,d[36]=l):(o=d[35],l=d[36]),(0,O.useEffect)(o,l),d[37]!==t||d[38]!==n||d[39]!==w||d[40]!==r?(s=e=>{let{path:a,replace:i}=e,o=l7(w.selector(a),n,r,S),l="string"==typeof o?o:a;i?t.replace(l):t.push(l)},d[37]=t,d[38]=n,d[39]=w,d[40]=r,d[41]=s):s=d[41],T=s,E=_?.state??null,d[42]!==T||d[43]!==E?($=[E,T],d[42]=T,d[43]=E,d[44]=$):$=d[44],$);if(!R){let e;return q[3]===N?e=q[4]:(e=(0,em.jsx)(N,{}),q[3]=N,q[4]=e),e}return q[5]!==D||q[6]!==U||q[7]!==P||q[8]!==R?(A=(0,em.jsx)(c.a,{onCatch:l5,children:(0,em.jsx)(tr.pg,{onNavigate:U,router:P,state:R,children:D})}),q[5]=D,q[6]=U,q[7]=P,q[8]=R,q[9]=A):A=q[9],A}function l5(e){let{error:t}=e;throw t}function l6(){return null}function l7(e,t,n,r){if(e?.type==="state"&&e.state?.intent){let a=function(e,t,n){let{intent:r,params:a,payload:o}=n;if("string"!=typeof r)throw Error("intent must be a string");if(!(0,i.on)(a))throw Error("intent params must be a string");let l=l1(e),s=t?.tool?l.find(e=>e.name===t.tool):null,c=s?l.filter(e=>e!==s):l,d=[];"create"===r?d=l2:"edit"===r&&(d=l3);let{tool:u}=(s?[s,...c]:l).reduce((e,n)=>{if(!n||"function"!=typeof n.canHandleIntent)return e;let o=n.canHandleIntent(r,a,t&&t[n.name]);if("boolean"==typeof o)return o&&e.score<0?{score:0,tool:n}:e;if(!(0,i.on)(o))return e;let l=d.reduce((e,t)=>t in a&&o[t]?e+1:e,0);return l>e.score?{score:l,tool:n}:e},{score:-1,tool:null});if(u?.getIntentState){let{_searchParams:e,...i}=u.getIntentState(r,a,t&&t[u.name],o),l={...t,_searchParams:n._searchParams,tool:u.name,[u.name]:i};return u.router?.__unsafe_disableScopedSearchParams?l._searchParams=[...n._searchParams?.filter(([e])=>tr.VK.includes(e))||[],...Array.isArray(e)?e:[]]:i._searchParams=e,{type:"state",isNotFound:!1,state:l}}return{type:"intent",isNotFound:!0,intent:{name:r,params:a}}}(n,r.current?.type==="state"?r.current.state:{},e.state);if(a?.type==="state")return t.encode(a.state)}return null}let l8={type:"value",value:null};function l9(e){let t=(0,eu.c)(4),n;if(t[0]!==e){let r;t[2]===e.name?r=t[3]:(r=t=>{let n=t.filter(sn);if(n.length)throw new ro({name:e.name,causes:n,type:"workspace"});return t},t[2]=e.name,t[3]=r),n=(0,ed.z)(e.__internal.sources.map(sr)).pipe((0,z.T)(r),(0,z.T)(t=>{let[n,...r]=t,{releases:a,...i}=e;return{...i,...n,unstable_sources:[n,...r],type:"workspace"}}),(0,z.T)(st),(0,R.W)(se)),t[0]=e,t[1]=n}else n=t[1];let r=(0,eD.ut)(n,l8);if("error"===r.type)throw r.error;return r.value}function se(e){return(0,U.of)({type:"error",error:e})}function st(e){return{type:"value",value:e}}function sn(e){return e instanceof ro}function sr(e){let{source:t}=e;return t.pipe((0,R.W)(sa))}function sa(e){if(e instanceof ro)return(0,U.of)(e);throw e}function si(e){let t,n,r,a,i,o,l,s,c=(0,eu.c)(29),{children:d,LoadingComponent:p}=e,{activeWorkspace:f}=(0,m.jt)(),y=l9(f);if(!y){let e;return c[0]===p?e=c[1]:(e=(0,em.jsx)(p,{}),c[0]=p,c[1]=e),e}
33return c[2]===y.apiHost?t=c[3]:(t=y.apiHost||v.C?{apiHost:y.apiHost??"https://api.sanity.work"}:void 0,c[2]=y.apiHost,c[3]=t),c[4]===y.auth.token?n=c[5]:(n=y.auth.token?{token:y.auth.token}:void 0,c[4]=y.auth.token,c[5]=n),c[6]!==n||c[7]!==y.authenticated?(r={authenticated:y.authenticated,auth:n},c[6]=n,c[7]=y.authenticated,c[8]=r):r=c[8],c[9]===p?a=c[10]:(a=(0,em.jsx)(p,{}),c[9]=p,c[10]=a),c[11]!==p||c[12]!==d||c[13]!==y?(i=(0,em.jsx)(l4,{LoadingComponent:p,workspace:y,children:d}),c[11]=p,c[12]=d,c[13]=y,c[14]=i):i=c[14],c[15]!==i||c[16]!==y.unstable_sources[0]?(o=(0,em.jsx)(u.a,{source:y.unstable_sources[0],children:i}),c[15]=i,c[16]=y.unstable_sources[0],c[17]=o):o=c[17],c[18]!==t||c[19]!==r||c[20]!==a||c[21]!==o||c[22]!==y.dataset||c[23]!==y.name||c[24]!==y.projectId?(l=(0,em.jsx)(eN.M1,{projectId:y.projectId,dataset:y.dataset,auth:t,studio:r,fallback:a,children:o},y.name),c[18]=t,c[19]=r,c[20]=a,c[21]=o,c[22]=y.dataset,c[23]=y.name,c[24]=y.projectId,c[25]=l):l=c[25],c[26]!==l||c[27]!==y?(s=(0,em.jsx)(u.s,{workspace:y,children:l}),c[26]=l,c[27]=y,c[28]=s):s=c[28],s}function so(e){let t,n,r=(0,eu.c)(5),a;if(r[0]!==e){let{ConfigErrorsComponent:t,...n}=e;a=n,r[0]=e,r[1]=a}else a=r[1];r[2]===Symbol.for("react.memo_cache_sentinel")?(t={error:null},r[2]=t):t=r[2];let[i,o]=(0,O.useState)(t),{error:l}=i;if(l)throw l;return r[3]===a?n=r[4]:(n=(0,em.jsx)(c.a,{onCatch:o,children:(0,em.jsx)(si,{...a})}),r[3]=a,r[4]=n),n}}}]);

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.