1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[4151],{14151:(e,t,n)=>{n.r(t),n.d(t,{default:()=>tz});var r=n(47425),i=n(8890),o=n(97898),a=n(4487),s=n(39158),c=n(51893),l=n(69733),u=n(95968),d=n(50189),p=n(49065),f=n(29404),m=n(96571),h=n(32849),v=n(22332),x=n(29634),g=n(81612),y=n(30285),b=n(65451),w=n(8907),j=n(64861),_=n(49047),S=n(64993),E=n(95655),P=n(80286),k=n(85625),C=n(68519),R=n(7962);function z(e){let{children:t,isValidProp:n,...i}=e;n&&(0,C.D)(n),(i={...(0,l.useContext)(k.Q),...i}).isStatic=(0,R.M)(()=>i.isStatic);let o=(0,l.useMemo)(()=>i,[JSON.stringify(i.transition),i.transformPagePoint,i.reducedMotion]);return(0,r.jsx)(k.Q.Provider,{value:o,children:t})}var $=n(86472),A=n(8099);function I(){if("u">typeof crypto){let e=new Uint8Array(16);crypto.getRandomValues(e);let t="";for(let n=0;n<e.length;n++)t+=e[n].toString(16).padStart(2,"0");return btoa(t).replace(/\+/g,"-").replace(/\//g,"_").replace(/[=]+$/,"")}return Math.random().toString(36).slice(2)}async function T(e,t,n,r){let i=e.withConfig({apiVersion:o.XV}),a=I(),s=i.patch(o.YL).set({secret:a,studioUrl:n,userId:r});return await i.transaction().createIfNotExists({_id:o.YL,_type:o.dR,source:t,studioUrl:n,userId:r}).patch(s).commit({tag:o.Tc}),{secret:a}}async function M(e,t,n,r){let i=e.withConfig({apiVersion:o.XV}),a=i.patch(o.YL).set({secret:null,studioUrl:n,userId:r});await i.transaction().createIfNotExists({_id:o.YL,_type:o.dR,source:t,studioUrl:n,userId:r}).patch(a).commit({tag:o.Tc})}var L=n(67769),O=n(53002);function U(e){return e.replace(/([.+*?=^!:${}()[\]|/\\])/g,"\\$1")}function Y(e){return e&&e.sensitive?"":"i"}var B=n(79903);async function N(e,t,n,r,i=(0,c.A)()){let a=e.withConfig({apiVersion:o.XV});try{let e=new Date(Date.now()+1e3*o.eZ),s=`drafts.${i}`,c=I(),l=a.patch(s).set({secret:c,source:t,studioUrl:n,userId:r});return await a.transaction().createOrReplace({_id:s,_type:o.uf}).patch(l).commit({tag:o.Tc}),{secret:c,expiresAt:e}}finally{try{await a.delete({query:o.W_})}catch(e){console.error("Failed to delete expired secrets",e)}}}var W=n(63618),D=(0,l.memo)(e=>{let t,n,r=(0,i.c)(3),{comlink:o}=e;return r[0]!==o?(t=()=>o.on("visual-editing/features",F),n=[o],r[0]=o,r[1]=t,r[2]=n):(t=r[1],n=r[2]),(0,l.useEffect)(t,n),null});function F(){return{features:{optimistic:!0}}}function Z(e,t){let n;return(...r)=>{clearTimeout(n),n=setTimeout(()=>{e.apply(e,r)},t)}}let V=function(e){let t,n,o,a,s,c,u,d,p=(0,i.c)(14),{comlink:f,children:m}=e;p[0]===Symbol.for("react.memo_cache_sentinel")?(t={},p[0]=t):t=p[0];let h=(0,l.useRef)(t);p[1]!==f?(n=()=>f?.on("visual-editing/shared-state",()=>({state:h.current})),o=[f],p[1]=f,p[2]=n,p[3]=o):(n=p[2],o=p[3]),(0,l.useEffect)(n,o),p[4]!==f?(a=(e,t)=>{h.current[e]=t,f?.post("presentation/shared-state",{key:e,value:t})},p[4]=f,p[5]=a):a=p[5];let v=a;p[6]!==f?(s=e=>{f?.post("presentation/shared-state",{key:e}),delete h.current[e]},p[6]=f,p[7]=s):s=p[7];let x=s;return p[8]!==x||p[9]!==v?(u={removeValue:x,setValue:v},p[8]=x,p[9]=v,p[10]=u):u=p[10],c=u,p[11]!==m||p[12]!==c?(d=(0,r.jsx)(g.En.Provider,{value:c,children:m}),p[11]=m,p[12]=c,p[13]=d):d=p[13],d},H=v.I4.div` 2 overflow: hidden; 3 flex-basis: 0; 4 flex-shrink: 1; 5`,J=function(e){let t,n,o,a,s=(0,i.c)(15),{children:c,defaultSize:u,id:d,minWidth:p,maxWidth:f,order:m}=e,h=void 0===u?null:u,v=void 0===m?0:m,x=(0,l.useContext)(g.Tf);if(null===x)throw Error("Panel components must be rendered within a PanelGroup container");let{getPanelStyle:y,registerElement:b,unregisterElement:w}=x;s[0]!==y||s[1]!==d?(t=y(d),s[0]=y,s[1]=d,s[2]=t):t=s[2];let j=t;return s[3]!==h||s[4]!==d||s[5]!==f||s[6]!==p||s[7]!==v||s[8]!==b||s[9]!==w?(n=()=>(b(d,{id:d,type:"panel",defaultSize:h,maxWidth:f??null,minWidth:p??0,order:v}),()=>{w(d)}),o=[d,h,v,f,p,b,w],s[3]=h,s[4]=d,s[5]=f,s[6]=p,s[7]=v,s[8]=b,s[9]=w,s[10]=n,s[11]=o):(n=s[10],o=s[11]),(0,l.useLayoutEffect)(n,o),s[12]!==c||s[13]!==j?(a=(0,r.jsx)(H,{style:j,children:c}),s[12]=c,s[13]=j,s[14]=a):a=s[14],a},K="presentation/panels",q=()=>JSON.parse(localStorage.getItem(K)||"{}"),Q=e=>e.map(e=>[e.id,e.order].join(":")).join(",");function X(e,t){var n;let r=q(),i=Q(e);n={...r,[i]:t},localStorage.setItem(K,JSON.stringify(n))}function G(e){let t=q(),n=Q(e);return Array.isArray(t[n])&&t[n].some(ee)?void 0:t[n]}function ee(e){return null===e}function et(e,t,n){let{maxWidth:r,minWidth:i}=e;return Math.min(null==r?100:r/n*100,Math.max(i/n*100,t))}function en(e,t,n=0,r=null){return e.clientX-(r||t.getBoundingClientRect()).left-n}function er(e){return"panel"===e.type}function ei(e){return"resizer"===e.type}function eo(e){return Array.from(e.values()).sort(({order:e},{order:t})=>null==e&&null==t?0:null==e?-1:null==t?1:e-t)}function ea(e,t,n){let r=t.reduce((e,t)=>
5e+t,0),i=[...t].map(e=>e/r*100),o=0;for(let t=0;t<e.length;t++){let r=e[t],a=i[t],s=et(r,a,n);a!=s&&(o+=a-s,i[t]=s)}if("0.000"!==o.toFixed(3))for(let t=0;t<e.length;t++){let{maxWidth:r,minWidth:a}=e[t];a=a/n*100,null!=r&&(r=r/n*100);let s=Math.min(r??100,Math.max(a,i[t]+o));if(s!==i[t]&&(o-=s-i[t],i[t]=s,"0.000"===Math.abs(o).toFixed(3)))break}return i}let es=v.I4.div` 6 display: flex; 7 flex-direction: row; 8 height: 100%; 9 overflow: hidden; 10 width: 100%; 11`,ec=function(e){let t,n,o,a,s,c,u,d,p,f,m,h,v,x,y,b,w,j,_,S,E,P,k,C,R=(0,i.c)(46),{children:z}=e,$=(0,l.useRef)(null);R[0]===Symbol.for("react.memo_cache_sentinel")?(t=new Map,R[0]=t):t=R[0];let[A,I]=(0,l.useState)(t);R[1]!==A?(o=eo(A).filter(er),R[1]=A,R[2]=o):o=R[2],n=o,R[3]===Symbol.for("react.memo_cache_sentinel")?(a=[],R[3]=a):a=R[3];let[T,M]=(0,l.useState)(a),[L,O]=(0,l.useState)(null);R[4]!==A||R[5]!==n||R[6]!==T?(s={elements:A,panels:n,widths:T},R[4]=A,R[5]=n,R[6]=T,R[7]=s):s=R[7];let U=(0,l.useRef)(s);R[8]!==L||R[9]!==n||R[10]!==T?(c=e=>({flexGrow:function(e,t,n){if(1===e.length)return"100";let r=n[e.findIndex(e=>e.id===t)];return null==r?"0":r.toPrecision(10)}(n,e,T),pointerEvents:null===L?void 0:"none"}),R[8]=L,R[9]=n,R[10]=T,R[11]=c):c=R[11];let Y=c;R[12]===Symbol.for("react.memo_cache_sentinel")?(u=(e,t)=>{I(n=>{if(n.has(e))return n;let r=new Map(n);return r.set(e,t),r})},R[12]=u):u=R[12];let B=u;R[13]===Symbol.for("react.memo_cache_sentinel")?(d=e=>{I(t=>{if(!t.has(e))return t;let n=new Map(t);return n.delete(e),n})},R[13]=d):d=R[13];let N=d;R[14]===Symbol.for("react.memo_cache_sentinel")?(p={containerWidth:window.innerWidth,dragOffset:0,panelAfter:null,panelBefore:null,resizerIndex:-1,resizerRect:null,startX:0,widths:[]},R[14]=p):p=R[14];let W=(0,l.useRef)(p);R[15]!==A?(f=(e,t)=>{let n=eo(A),r=n.findIndex(t=>t.id===e),i=A.get(e);if(!i||!ei(i))return;let o=i.el.current;o&&(W.current={resizerIndex:r,panelBefore:n.reduce((e,t,n)=>er(t)&&n<r?t:e,null),panelAfter:n.reduce((e,t,n)=>null===e&&er(t)&&n>r?t:e,null),containerWidth:window.innerWidth,startX:t.pageX,dragOffset:en(t,o),resizerRect:o.getBoundingClientRect(),widths:U.current.widths},O(e))},R[15]=A,R[16]=f):f=R[16];let D=f;R[17]===Symbol.for("react.memo_cache_sentinel")?(m=()=>{O(null)},R[17]=m):m=R[17];let F=m;R[18]!==A?(h=(e,t)=>{t.preventDefault(),t.stopPropagation();let{containerWidth:n,dragOffset:r,panelBefore:i,panelAfter:o,resizerRect:a}=W.current;if(null==i||null==o)return;let s=A.get(e);if(!s||!ei(s))return;let c=s.el.current;if(!c)return;let l=en(t,c,r,a);if(0===l)return;let{widths:u}=U.current,d=function(e,t,n,r,i,o){let{panels:a,widths:s}=i,{widths:c}=o,l=c||s,u=[...l];{let i=e<0?r:n,o=l[a.findIndex(e=>e.id===i.id)],s=et(i,o+Math.abs(e),t);if(o===s)return l;e=e<0?o-s:s-o}let d=0,p=e<0?n:r,f=a.findIndex(e=>e.id===p.id);for(;;){let n=a[f],r=l[f],i=et(n,r-(Math.abs(e)-Math.abs(d)),t);if(r!==i&&(d+=r-i,u[f]=i,d.toPrecision(10).localeCompare(Math.abs(e).toPrecision(10),void 0,{numeric:!0})>=0))break;if(e<0){if(--f<0)break}else if(++f>=a.length)break}return 0===d?l:(p=e<0?r:n,u[f=a.findIndex(e=>e.id===p.id)]=l[f]+d,u)}(l/$.current.getBoundingClientRect().width*100,n,i,o,U.current,W.current);u.some((e,t)=>e!==d[t])&&M(d)},R[18]=A,R[19]=h):h=R[19];let V=h;R[20]!==A||R[21]!==n||R[22]!==T?(v=()=>{U.current.elements=A,U.current.panels=n,U.current.widths=T},x=[A,n,T],R[20]=A,R[21]=n,R[22]=T,R[23]=v,R[24]=x):(v=R[23],x=R[24]),(0,l.useLayoutEffect)(v,x);let H=function(){let e,t=(0,i.c)(1);return t[0]===Symbol.for("react.memo_cache_sentinel")?(e={get:G,set:X,setDebounced:Z(X,100)},t[0]=e):e=t[0],e}();return R[25]!==n||R[26]!==H?(y=()=>{let{widths:e}=U.current;if(e.length===n.length)return;let t=H.get(n);if(t)return void M(ea(n,t,window.innerWidth));M(function(e){let t=e.length,n=100,r=e.map(e=>e.defaultSize?(n-=e.defaultSize,t-=1,e.defaultSize):null),i=n/t;return r.map(e=>null===e?i:e)}(n))},b=[H,n],R[25]=n,R[26]=H,R[27]=y,R[28]=b):(y=R[27],b=R[28]),(0,l.useLayoutEffect)(y,b),R[29]!==n||R[30]!==H||R[31]!==T?(w=()=>{T.length&&H.setDebounced(n,T)},j=[H,n,T],R[29]=n,R[30]=H,R[31]=T,R[32]=w,R[33]=j):(w=R[32],j=R[33]),(0,l.useEffect)(w,j),R[34]===Symbol.for("react.memo_cache_sentinel")?(_=()=>{let e=new ResizeObserver(()=>{let{panels:e,widths:t}=U.current,n=ea(e,t,window.innerWidth);t.some((e,t)=>e!==n[t])&&M(n)});return e.observe($.current),()=>{e.disconnect()}},S=[],R[34]=_,R[35]=S):(_=R[34],S=R[35]),(0,l.useLayoutEffect)(_,S),R[36]!==L||R[37]!==V||R[38]!==Y||R[39]!==D?(P={activeResizer:L,drag:V,getPanelStyle:Y,registerElement:B,startDragging:D,stopDragging:F,unregisterElement:N},R[36]=L,R[37]=V,R[38]=Y,R[39]=D,R[40]=P):P=R[40],E=P,R[41]!==z?(k=(0,r.jsx)(es,{ref:$,children:z}),R[41]=z,R[42]=k):k=R[42],R[43]!==E||R[44]!==k?(C=(0,r.jsx)(g.Tf.Provider,{value:E,children:k}),R[43]=E,R[44]=k,R[45]=C):C=R[45],C};function el(e){let t,n,o,s,c,l,p,f,m,h,v,x,g,y,b,w,_=(0,i.c)(37);_[0]!==e?({children:t,message:n,onRetry:s,onContinueAnyway:o,...c}=e,_[0]=e,_[1]=t,_[2]=n,_[3]=o,_[4]=s,_[5]=c):(t=_[1],n=_[2],o=_[3],s=_[4],c=_[5]);let{t:S}=(0,u.Bdt)(d.Yi);_[6]!==S?(l=S("error-card.retry-button.text"),_[6]=S,_[7]=l):l=_[7],_[8]!==s||_[9]!==l?(p=(0,r.jsx)(j.$n,{mode:"ghost",onClick:s,text:l}),_[8]=s,_[9]=l,_[10]=p):p=_[10];let E=p;_[11]!==S?(f=S("error-card.continue-button.text"),_[11]=S,_[12]=f):f=_[12],_[13]!==o||_[14]!==f?(m=(0,r.jsx)(j.$n,{mode:"ghost",tone:"critical",onClick:o,text:f}),_[13]=o,_[14]=f,_[15]=m):m=_[15];let P=m;return _[16]!==S?(h=S("error-card.title"),_[16]=S,_[17]=h):h=_[17],_[18]!==h?(v=(0,r.jsx)(a.EY,{size:1,weight:"semibold",children:h}),_[18]=h,_[19]=v):v=_[19],_[20]!==n?(x=(0,r.jsx)(a.EY,{muted:!0,size:1,children:n}),_[20]=n,_[21]=x):x=_[21],_[22]!==v||_[23]!==x?(g=(0,r.jsxs)(a.BJ,{space:3,children:[v,x]}),_[22]=v,_[23]=x,_[24]=g):g=_[24],_[25]!==P||_[26]!==o||_[27]!==s||_[28]!==E?(y=s&&o?(0,r.jsxs)(a.cV,{space:2,children:[E,P]}):s?(0,r.jsx)(a.az,{children:E}):o?(0,r.jsx)(a.az,{children:P}):null,_[25]=P,_[26]=o,_[27]=s,_[28]=E,_[29]=y):y=_[29],_[30]!==t||_[31]!==g||_[32]!==y?(b=(0,r.jsx)(a.so,{align:"center",height:"fill",justify:"center",children:(0,r.jsx)(a.mc,{padding:4,sizing:"border",width:0,children:(0,r.jsxs)(a.BJ,{space:4,children:[g,t,y]})})}),_[30]=t,_[31]=g,_[32]=y,_[33]=b):b=_[33],_[34]!==c||_[35]!==b?(w=(0,r.jsx)(a.Zp,{height:"fill",...c,children:b}),_[34]=c,_[35]=b,_[36]=w):w=_[36],w}let eu=(0,l.forwardRef)(function(e,t){let n,o,a,s,c,l=(0,i.c)(11);return l[0]!==e?({searchParams:o,...n}=e,l[0]=e,l[1]=n,l[2]=o):(n=l[1],o=l[2]),l[3]!==o?(a=Object.entries(o),l[3]=o,l[4]=a):a=l[4],l[5]!==a?(s={type:void 0,_searchParams:a},l[5]=a,l[6]=s):s=l[6],l[7]!==t||l[8]!==n||l[9]!==s?(c=(0,r.jsx)(h.s8,{...n,ref:t,state:s,title:void 0}),l[7]=t,l[8]=n,l[9]=s,l[10]=c):c=l[10],c}),ed=(0,l.forwardRef)(function(e,t){let n,o,a,s,c,l,u,d=(0,i.c)(15);if(d[0]!==e){let{documentId:t,documentType:r,parentRefPath:i,template:c,searchParams:l,...u}=e;n=t,o=r,s=l,a=u,d[0]=e,d[1]=n,d[2]=o,d[3]=a,d[4]=s}else n=d[1],o=d[2],a=d[3],s=d[4];return d[5]!==s?(c=Object.entries(s),d[5]=s,d[6]=c):c=d[6],d[7]!==n||d[8]!==o||d[9]!==c?(l={id:n,type:o,_searchParams:c},d[7]=n,d[8]=o,d[9]=c,d[10]=l):l=d[10],d[11]!==t||d[12]!==a||d[13]!==l?(u=(0,r.jsx)(h.s8,{...a,ref:t,state:l,title:void 0}),d[11]=t,d[12]=a,d[13]=l,d[14]=u):u=d[14],u});function ep(e){let t,n,o,a,s,c,l,d,p,f,m,v=(0,i.c)(26),{children:x,onStructureParam
11s:y,structureParams:b,searchParams:w,refs:j}=e,{state:_,resolvePathFromState:S}=(0,h.rd)();v[0]!==_._searchParams?(t=Object.fromEntries(_._searchParams||[]),v[0]=_._searchParams,v[1]=t):t=v[1];let E=(0,u.$6H)(t);v[2]!==S||v[3]!==E||v[4]!==_?(n=e=>{let t=S(_),n=function(e){let t=["comment","inspect","instruction","pathKey","rev","since","template","view"];return function(e={}){let t=Object.entries(e).map(([e,t])=>`${e}=${t}`).join("&");return t.length?`?${t}`:""}(Object.entries(e).filter(([e])=>t.includes(e)).reduce((e,[t,n])=>null==n?e:{...e,[t]:n},{}))}({...E,...e});return`${t}${n}`},v[2]=S,v[3]=E,v[4]=_,v[5]=n):n=v[5];let P=n;return v[6]===Symbol.for("react.memo_cache_sentinel")?(a={},v[6]=a):a=v[6],v[7]===Symbol.for("react.memo_cache_sentinel")?(s=[],v[7]=s):s=v[7],v[8]!==j||v[9]!==w?(c=e=>{let{childId:t,...n}=e,i=j?.find(e=>e._id===t||(0,u.IMx)(e._id)===t);return i?(0,r.jsx)(h.s8,{...n,state:{id:t,type:i._type,_searchParams:Object.entries(w)}}):(0,r.jsx)("div",{...n})},v[8]=j,v[9]=w,v[10]=c):c=v[10],v[11]!==w?(l=e=>(0,r.jsx)(eu,{...e,searchParams:w}),d=e=>(0,r.jsx)(ed,{...e,searchParams:w}),v[11]=w,v[12]=l,v[13]=d):(l=v[12],d=v[13]),v[14]!==y?(p=e=>{y({...e,inspect:e.inspect??void 0})},v[14]=y,v[15]=p):p=v[15],v[16]!==P||v[17]!==b||v[18]!==c||v[19]!==l||v[20]!==d||v[21]!==p?(f={index:0,groupIndex:0,siblingIndex:0,payload:a,params:b,hasGroupSiblings:!1,groupLength:1,routerPanesState:s,ChildLink:c,BackLink:l,ReferenceChildLink:d,ParameterizedLink:ew,closeCurrentAndAfter:eb,handleEditReference:ey,replaceCurrent:eg,closeCurrent:ex,duplicateCurrent:ev,setView:eh,setParams:p,setPayload:em,navigateIntent:ef,createPathWithParams:P},v[16]=P,v[17]=b,v[18]=c,v[19]=l,v[20]=d,v[21]=p,v[22]=f):f=v[22],o=f,v[23]!==x||v[24]!==o?(m=(0,r.jsx)(g.l4.Provider,{value:o,children:x}),v[23]=x,v[24]=o,v[25]=m):m=v[25],m}function ef(e,t,n){console.warn("navigateIntent",e,t,n)}function em(e){console.warn("setPayload",e)}function eh(e){console.warn("setView",e)}function ev(e){console.warn("duplicateCurrent",e)}function ex(){console.warn("closeCurrent")}function eg(e){console.warn("replaceCurrent",e)}function ey(e){console.warn("handleEditReference",e)}function eb(){console.warn("closeCurrentAndAfter")}function ew(){throw Error("ParameterizedLink not implemented")}let ej=(0,v.I4)(b.PaneLayout)` 12 height: 100%; 13`,e_=(0,v.I4)(a.so)` 14 & > div { 15 min-width: none !important; 16 max-width: none !important; 17 } 18`,eS=(0,v.I4)(a.Cy)` 19 white-space: pre-wrap; 20`;function eE(e){let t,n,o,s,c,p,f,m,h,v,x,g=(0,i.c)(33),{mainDocumentState:y,onStructureParams:_,searchParams:S,refs:E}=e,{t:P}=(0,u.Bdt)(d.Yi),{devMode:k}=(0,d.Qe)();if(g[0]!==y?.document?._id||g[1]!==E){let e;g[3]!==y?.document?._id?(e=e=>(0,u.IMx)(e._id)!==y?.document?._id,g[3]=y?.document?._id,g[4]=e):e=g[4],n=E.filter(e).map(ek),g[0]=y?.document?._id,g[1]=E,g[2]=n}else n=g[2];t=n,g[5]!==t?(s={filter:"_id in $ids",params:{ids:t}},g[5]=t,g[6]=s):s=g[6],g[7]!==P?(c=P("document-list-pane.document-list.title"),g[7]=P,g[8]=c):c=g[8],g[9]!==s||g[10]!==c?(p={id:"$root",options:s,schemaTypeName:"",title:c,type:"documentList"},g[9]=s,g[10]=c,g[11]=p):p=g[11],o=p;let[C,R]=(0,l.useState)(null);g[12]===Symbol.for("react.memo_cache_sentinel")?(f=()=>R(null),g[12]=f):f=g[12];let z=f,[$]=(0,l.useState)(eP);if(g[13]===Symbol.for("react.memo_cache_sentinel")?(m=()=>R(null),g[13]=m):m=g[13],g[14]!==E?(h=[E],g[14]=E,g[15]=h):h=g[15],(0,l.useEffect)(m,h),C){let e,t,n;return g[16]!==P?(e=P("document-list-pane.error.text"),g[16]=P,g[17]=e):e=g[17],g[18]!==k||g[19]!==C||g[20]!==P?(t=k&&(0,r.jsx)(a.Zp,{overflow:"auto",padding:3,radius:2,tone:"critical",children:(0,r.jsxs)(a.BJ,{space:3,children:[(0,r.jsx)(a.JU,{muted:!0,size:0,children:P("presentation-error.label")}),(0,r.jsx)(eS,{size:1,children:C.error.message})]})}),g[18]=k,g[19]=C,g[20]=P,g[21]=t):t=g[21],g[22]!==t||g[23]!==e?(n=(0,r.jsx)(el,{flex:1,message:e,onRetry:z,children:t}),g[22]=t,g[23]=e,g[24]=n):n=g[24],n}return g[25]!==o?(v=(0,r.jsx)(e_,{direction:"column",flex:1,children:(0,r.jsx)(b.PaneContainer,{index:0,itemId:"$root",pane:o,paneKey:"$root"})}),g[25]=o,g[26]=v):v=g[26],g[27]!==_||g[28]!==E||g[29]!==S||g[30]!==$||g[31]!==v?(x=(0,r.jsx)(j.tH,{onCatch:R,children:(0,r.jsx)(ej,{children:(0,r.jsx)(w.$l,{children:(0,r.jsx)(ep,{onStructureParam
20s:_,structureParams:$,searchParams:S,refs:E,children:v})})})}),g[27]=_,g[28]=E,g[29]=S,g[30]=$,g[31]=v,g[32]=x):x=g[32],x}function eP(){return{}}function ek(e){return(0,u.IMx)(e._id)}let eC=(0,v.I4)(a.Cy)` 21 white-space: pre-wrap; 22`;function eR(e){let t,n,o,s,c,p,f,m,v,x,g,y=(0,i.c)(35),{documentId:w,documentType:_,onFocusPath:S,onStructureParams:E,searchParams:P,structureParams:k}=e,{template:C,templateParams:R}=k,{t:z}=(0,u.Bdt)(d.Yi),{devMode:$}=(0,d.Qe)();y[0]!==R?(n=(0,h.fA)(R),y[0]=R,y[1]=n):n=y[1],y[2]!==w||y[3]!==_||y[4]!==n||y[5]!==C?(o={id:w,type:_,template:C,templateParameters:n},y[2]=w,y[3]=_,y[4]=n,y[5]=C,y[6]=o):o=y[6],y[7]!==w||y[8]!==o?(s={id:w,options:o,title:"",type:"document"},y[7]=w,y[8]=o,y[9]=s):s=y[9],t=s;let[A,I]=(0,l.useState)(null);y[10]===Symbol.for("react.memo_cache_sentinel")?(c=()=>I(null),y[10]=c):c=y[10];let T=c;if(y[11]===Symbol.for("react.memo_cache_sentinel")?(p=()=>{I(null)},y[11]=p):p=y[11],y[12]!==w||y[13]!==_||y[14]!==k?(f=[w,_,k],y[12]=w,y[13]=_,y[14]=k,y[15]=f):f=y[15],(0,l.useEffect)(p,f),A){let e,t,n;return y[16]!==z?(e=z("document-pane.error.text"),y[16]=z,y[17]=e):e=y[17],y[18]!==$||y[19]!==A||y[20]!==z?(t=$&&(0,r.jsx)(a.Zp,{overflow:"auto",padding:3,radius:2,tone:"critical",children:(0,r.jsxs)(a.BJ,{space:3,children:[(0,r.jsx)(a.JU,{muted:!0,size:0,children:z("presentation-error.label")}),(0,r.jsx)(eC,{size:1,children:A.error.message})]})}),y[18]=$,y[19]=A,y[20]=z,y[21]=t):t=y[21],y[22]!==e||y[23]!==t?(n=(0,r.jsx)(el,{flex:1,message:e,onRetry:T,children:t}),y[22]=e,y[23]=t,y[24]=n):n=y[24],n}return y[25]===Symbol.for("react.memo_cache_sentinel")?(m={height:"100%"},y[25]=m):m=y[25],y[26]===Symbol.for("react.memo_cache_sentinel")?(v=(0,r.jsx)(d.gu,{}),y[26]=v):v=y[26],y[27]!==S||y[28]!==t?(x=(0,r.jsx)(l.Suspense,{fallback:v,children:(0,r.jsx)(b.DocumentPane,{paneKey:"document",index:1,itemId:"document",pane:t,onFocusPath:S})}),y[27]=S,y[28]=t,y[29]=x):x=y[29],y[30]!==E||y[31]!==P||y[32]!==k||y[33]!==x?(g=(0,r.jsx)(j.tH,{onCatch:I,children:(0,r.jsx)(b.PaneLayout,{style:m,children:(0,r.jsx)(ep,{searchParams:P,onStructureParams:E,structureParams:k,children:x})})}),y[30]=E,y[31]=P,y[32]=k,y[33]=x,y[34]=g):g=y[34],g}function ez(e){let t,n=(0,i.c)(7),{documentId:o,documentType:a,onFocusPath:s,onStructureParams:c,searchParams:l,structureParams:u}=e;return n[0]!==o||n[1]!==a||n[2]!==s||n[3]!==c||n[4]!==l||n[5]!==u?(t=(0,r.jsx)(w.$l,{children:(0,r.jsx)(eR,{documentId:o,documentType:a,onFocusPath:s,onStructureParams:c,searchParams:l,structureParams:u})}),n[0]=o,n[1]=a,n[2]=s,n[3]=c,n[4]=l,n[5]=u,n[6]=t):t=n[6],t}function e$(e){let t,n,o,s,c,p,f,m=(0,i.c)(38),{documentId:v,documentType:x,mainDocumentState:g,onFocusPath:b,onStructureParams:w,refs:j,searchParams:_,structureParams:S}=e,{t:E}=(0,u.Bdt)(d.Yi),P=(0,u.pDY)();m[0]!==g?.document?._id||m[1]!==g?.document?._type||m[2]!==_?(t=e=>(0,r.jsx)(h.s8,{...e,state:{id:g?.document?._id,type:g?.document?._type,_searchParams:Object.entries(_)}}),m[0]=g?.document?._id,m[1]=g?.document?._type,m[2]=_,m[3]=t):t=m[3];let k=t;m[4]!==g?.document?._type||m[5]!==P?(o=P.get(g?.document?._type||"shoe"),m[4]=g?.document?._type,m[5]=P,m[6]=o):o=m[6],n=o;let C=function(e,t){let n,r,o,a=(0,i.c)(7),s=(0,u.yKO)();a[0]===Symbol.for("react.memo_cache_sentinel")?(n={},a[0]=n):n=a[0];let[c,d]=(0,l.useState)(n),{perspectiveStack:p}=(0,u.QO2)();return a[1]!==e||a[2]!==s||a[3]!==p||a[4]!==t?(r=()=>{if(!t)return;let n=(0,u.TU6)(s,t,e,p).subscribe(e=>{d(e)});return()=>{n?.unsubscribe()}},o=[s,t,e,p],a[1]=e,a[2]=s,a[3]=p,a[4]=t,a[5]=r,a[6]=o):(r=a[5],o=a[6]),(0,l.useEffect)(r,o),c}(g?.document?._id||"",n);e:{let e,t,i,o;if(!g?.document){s=null;break e}m[7]!==g.document||m[8]!==C.snapshot?(e=(0,u.ADU)({snapshot:C.snapshot,fallback:g.document}),m[7]=g.document,m[8]=C.snapshot,m[9]=e):e=m[9],m[10]!==E?(t=E("main-document.label"),m[10]=E,m[11]=t):t=m[11],m[12]!==t?(i=(0,r.jsx)(a.Zp,{padding:1,radius:2,shadow:1,children:(0,r.jsx)(a.EY,{muted:!0,size:0,weight:"medium",children:t})}),m[12]=t,m[13]=i):i=m[13],m[14]!==n||m[15]!==e||m[16]!==i?(o=(0,r.jsx)(u.m6P,{...e,schemaType:n,status:i}),m[14]=n,m[15]=e,m[16]=i,m[17]=o):o=m[17],s=o}let R=s;if(v&&x){let e;return m[18]!==v||m[19]!==x||m[20]!==b||m[21]!==w||m[22]!==_||m[23]!==S?(e=(0,r.jsx)(ez,{documentId:v,documentType:x,onFocusPath:b,onStructureParam
22s:w,searchParams:_,structureParams:S}),m[18]=v,m[19]=x,m[20]=b,m[21]=w,m[22]=_,m[23]=S,m[24]=e):e=m[24],e}return m[25]!==k||m[26]!==g||m[27]!==R||m[28]!==E?(c=g&&(0,r.jsx)(a.Zp,{padding:3,tone:g.document?"inherit":"caution",children:g.document?(0,r.jsx)(u.Ns2,{__unstable_focusRing:!0,as:k,"data-as":"a",radius:2,sizing:"border",tone:"inherit",children:R}):(0,r.jsx)(a.Zp,{padding:2,radius:2,tone:"inherit",children:(0,r.jsxs)(a.so,{gap:3,children:[(0,r.jsx)(a.az,{flex:"none",children:(0,r.jsx)(a.EY,{size:1,children:(0,r.jsx)(y.sAQ,{})})}),(0,r.jsx)(a.az,{flex:1,children:(0,r.jsx)(a.EY,{size:1,children:(0,r.jsx)(u.HTc,{t:E,i18nKey:"main-document.missing.text",components:{Code:"code"},values:{path:g.path}})})})]})})}),m[25]=k,m[26]=g,m[27]=R,m[28]=E,m[29]=c):c=m[29],m[30]!==g||m[31]!==w||m[32]!==j||m[33]!==_?(p=(0,r.jsx)(eE,{mainDocumentState:g,onStructureParams:w,searchParams:_,refs:j}),m[30]=g,m[31]=w,m[32]=j,m[33]=_,m[34]=p):p=m[34],m[35]!==c||m[36]!==p?(f=(0,r.jsxs)(a.so,{direction:"column",flex:1,height:"fill",children:[c,p]}),m[35]=c,m[36]=p,m[37]=f):f=m[37],f}let eA=v.I4.div` 23 position: relative; 24`,eI=v.I4.div` 25 position: absolute; 26 top: 0; 27 bottom: 0; 28 left: -5px; 29 width: 9px; 30 z-index: 10; 31 cursor: ${({$disabled:e})=>e?"auto":"ew-resize"}; 32 33 /* Border */ 34 & > span:nth-child(1) { 35 display: block; 36 border-left: 1px solid var(--card-border-color); 37 position: absolute; 38 top: 0; 39 left: 4px; 40 bottom: 0; 41 transition: opacity 200ms; 42 } 43 44 ${({$disabled:e})=>!e&&` 45 /* Hover effect */ 46 & > span:nth-child(2) { 47 display: block; 48 position: absolute; 49 top: 0; 50 left: 0; 51 width: 9px; 52 bottom: 0; 53 background-color: var(--card-border-color); 54 opacity: 0; 55 transition: opacity 150ms; 56 } 57 58 @media (hover: hover) { 59 &:hover > span:nth-child(2) { 60 opacity: 0.2; 61 } 62 } 63 `} 64`,eT=function(e){let t,n,o,a,s,c,u,d,p,f,m,h=(0,i.c)(27),{id:v,order:x,disabled:y}=e,b=void 0!==y&&y,w=(0,l.useRef)(null),j=(0,l.useContext)(g.Tf);if(null===j)throw Error("Panel components must be rendered within a PanelGroup container");let _=function(e){let t,n=(0,i.c)(2);n[0]!==e?(t=()=>e||(0,S.A)(),n[0]=e,n[1]=t):t=n[1];let[r]=(0,l.useState)(t);return r}(v),{activeResizer:E,drag:P,startDragging:k,stopDragging:C,registerElement:R,unregisterElement:z}=j,$=E===_;if(null===j)throw Error("Panel components must be rendered within a PanelGroup container");h[0]!==_||h[1]!==k?(t=e=>{k(_,e.nativeEvent)},h[0]=_,h[1]=k,h[2]=t):t=h[2];let A=t;h[3]!==P||h[4]!==_?(n=e=>{P(_,e)},h[3]=P,h[4]=_,h[5]=n):n=h[5];let I=n;h[6]!==C?(o=()=>{w.current.blur(),C()},h[6]=C,h[7]=o):o=h[7];let T=o;return h[8]!==b||h[9]!==$||h[10]!==I||h[11]!==T?(a=()=>{if(!$||b)return;let e=function(){let e=document.body.style,t=document.documentElement.style,{cursor:n}=t,{userSelect:r}=e;return t.cursor="ew-resize",e.userSelect="none",()=>{n?t.cursor=n:t.removeProperty("cursor"),r?e.userSelect=r:e.removeProperty("user-select")}}();return window.addEventListener("mousemove",I),window.addEventListener("mouseup",T),window.addEventListener("contextmenu",T),()=>{e(),window.removeEventListener("mousemove",I),window.removeEventListener("mouseup",T),window.removeEventListener("contextmenu",T)}},s=[b,$,I,T],h[8]=b,h[9]=$,h[10]=I,h[11]=T,h[12]=a,h[13]=s):(a=h[12],s=h[13]),(0,l.useEffect)(a,s),h[14]!==_||h[15]!==x||h[16]!==R||h[17]!==z?(c=()=>(R(_,{id:_,order:x,type:"resizer",el:w}),()=>{z(_)}),u=[_,x,R,z],h[14]=_,h[15]=x,h[16]=R,h[17]=z,h[18]=c,h[19]=u):(c=h[18],u=h[19]),(0,l.useLayoutEffect)(c,u),h[20]===Symbol.for("react.memo_cache_sentinel")?(p=(0,r.jsx)("span",{}),d=(0,r.jsx)("span",{}),h[20]=d,h[21]=p):(d=h[20],p=h[21]),h[22]!==b?(f=(0,r.jsxs)(eI,{$disabled:b,children:[p,d]}),h[22]=b,h[23]=f):f=h[23],h[24]!==A||h[25]!==f?(m=(0,r.jsx)(eA,{onMouseDown:A,ref:w,children:f}),h[24]=A,h[25]=f,h[26]=m):m=h[26],m},eM=e=>{let t,n,o,a=(0,i.c)(8),{documentId:s,setDisplayedDocument:c,getCommentIntent:l}=e;return a[0]===Symbol.for("react.memo_cache_sentinel")?(t=(0,r.jsx)(eT,{order:4}),a[0]=t):t=a[0],a[1]!==l||a[2]!==e.children?(n=(0,r.jsx)(u.S4U,{getIntent:l,children:e.children}),a[1]=l,a[2]=e.children,a[3]=n):n=a[3],a[4]!==s||a[5]!==c||a[6]!==n?(o=(0,r.jsxs)(r.Fragment,{children:[t,(0,r.jsx)(J,{id:"content",minWidth:325,order:5,children:(0,r.jsx)(_.C,{documentId:s,setDisplayedDocument:c,children:n})})]}),a[4]=s,a[5]=c,a[6]=n,a[7]=o):o=a[7],o},eL=e=>{let t,n,o=(0,i.c)(14),{documentId:a,documentsOnPage:s,documentType:c,getCommentIntent:l,mainDocumentState:u,onFocusPath:d,onStructureParam
64s:p,searchParams:f,setDisplayedDocument:m,structureParams:h}=e;return o[0]!==a||o[1]!==c||o[2]!==s||o[3]!==u||o[4]!==d||o[5]!==p||o[6]!==f||o[7]!==h?(t=(0,r.jsx)(e$,{documentId:a,documentType:c,mainDocumentState:u,onFocusPath:d,onStructureParams:p,refs:s,searchParams:f,structureParams:h}),o[0]=a,o[1]=c,o[2]=s,o[3]=u,o[4]=d,o[5]=p,o[6]=f,o[7]=h,o[8]=t):t=o[8],o[9]!==a||o[10]!==l||o[11]!==m||o[12]!==t?(n=(0,r.jsx)(eM,{documentId:a,getCommentIntent:l,setDisplayedDocument:m,children:t}),o[9]=a,o[10]=l,o[11]=m,o[12]=t,o[13]=n):n=o[13],n},eO=function(e){let t,n,o=(0,i.c)(5),{children:a,navigate:s}=e;o[0]!==s?(t=(e,t)=>{s((void 0===t?void 0:t)||{},e?{preview:e}:{})},o[0]=s,o[1]=t):t=o[1];let c=t;return o[2]!==a||o[3]!==c?(n=(0,r.jsx)(g.iY.Provider,{value:c,children:a}),o[2]=a,o[3]=c,o[4]=n):n=o[4],n};function eU(e){return!e}let eY=(0,l.memo)(function(e){let t,n,o,a,s=(0,i.c)(11),{minWidth:c,maxWidth:l,component:u}=e,d=null!=c&&null!=l&&c===l;return s[0]!==u?(t=(0,r.jsx)(u,{}),s[0]=u,s[1]=t):t=s[1],s[2]!==l||s[3]!==c||s[4]!==t?(n=(0,r.jsx)(J,{id:"navigator",minWidth:c,maxWidth:l,order:1,children:t}),s[2]=l,s[3]=c,s[4]=t,s[5]=n):n=s[5],s[6]!==d?(o=(0,r.jsx)(eT,{order:2,disabled:d}),s[6]=d,s[7]=o):o=s[7],s[8]!==n||s[9]!==o?(a=(0,r.jsxs)(r.Fragment,{children:[n,o]}),s[8]=n,s[9]=o,s[10]=a):a=s[10],a}),eB=function(e){let t,n=(0,i.c)(3),{children:o,params:a}=e;return n[0]!==o||n[1]!==a?(t=(0,r.jsx)(g.ix.Provider,{value:a,children:o}),n[0]=o,n[1]=a,n[2]=t):t=n[2],t},eN=function(e){let t,n,o,a=(0,i.c)(10),{children:s,devMode:c,name:l,navigate:u,params:d,searchParams:p,structureParams:f}=e;return a[0]!==c||a[1]!==l||a[2]!==u||a[3]!==d||a[4]!==p||a[5]!==f?(n={devMode:c,name:l,navigate:u,params:d,searchParams:p,structureParams:f},a[0]=c,a[1]=l,a[2]=u,a[3]=d,a[4]=p,a[5]=f,a[6]=n):n=a[6],t=n,a[7]!==s||a[8]!==t?(o=(0,r.jsx)(g.SM.Provider,{value:t,children:s}),a[7]=s,a[8]=t,a[9]=o):o=a[9],o};function eW(e){return Array.isArray(e)?e.join(","):e}let eD=E.P.create(v.I4.iframe` 65 box-shadow: 0 0 0 1px var(--card-border-color); 66 border: 0; 67 max-height: 100%; 68 width: 100%; 69 view-transition-class: presentation-tool-iframe; 70`),eF=(0,v.I4)(a.az)` 71 position: absolute; 72 inset: 0; 73 background: transparent; 74`,eZ=(0,l.forwardRef)(function(e,t){let n,o,a,s,c=(0,i.c)(16),{animate:u,initial:d,onLoad:p,preventClick:f,src:m,variants:h,style:v}=e,x=`presentation-tool-iframe-${(0,l.useId)().replace(/[^a-zA-Z0-9-_]/g,"_")}`;return c[0]!==v||c[1]!==x?(n={...v,viewTransitionName:x},c[0]=v,c[1]=x,c[2]=n):n=c[2],c[3]!==u||c[4]!==d||c[5]!==p||c[6]!==t||c[7]!==m||c[8]!==n||c[9]!==h?(o=(0,r.jsx)(eD,{style:n,animate:u,initial:d,onLoad:p,ref:t,src:m,variants:h}),c[3]=u,c[4]=d,c[5]=p,c[6]=t,c[7]=m,c[8]=n,c[9]=h,c[10]=o):o=c[10],c[11]!==f?(a=f&&(0,r.jsx)(eF,{}),c[11]=f,c[12]=a):a=c[12],c[13]!==o||c[14]!==a?(s=(0,r.jsxs)(r.Fragment,{children:[o,a]}),c[13]=o,c[14]=a,c[15]=s):s=c[15],s});function eV(e){let t,n,s,c,l,p,f,m,h=(0,i.c)(16),{openPopup:v,previewLocationOrigin:x,previewLocationRoute:g,perspective:b,targetOrigin:w}=e,_=new URL(g,x||w);_.searchParams.set(o.Pd,eW(b));let{pathname:S,search:E}=_;t=`${x}${S}${E}`;let{t:P}=(0,u.Bdt)(d.Yi);h[0]!==v?(n=e=>{e.preventDefault(),v(e.currentTarget.href)},h[0]=v,h[1]=n):n=h[1];let k=n;return h[2]!==P?(s=P("share-url.menu-item.open.text"),h[2]=P,h[3]=s):s=h[3],h[4]!==s?(c=(0,r.jsx)(a.EY,{size:1,children:s}),h[4]=s,h[5]=c):c=h[5],h[6]===Symbol.for("react.memo_cache_sentinel")?(l=["bottom-start"],h[6]=l):l=h[6],h[7]!==P?(p=P("share-url.menu-item.open.text"),h[7]=P,h[8]=p):p=h[8],h[9]!==k||h[10]!==t||h[11]!==p?(f=(0,r.jsx)(j.$n,{as:"a","aria-label":p,icon:y.ZPM,mode:"bleed",href:t,rel:"opener",target:"_blank",tooltipProps:null,onClick:k}),h[9]=k,h[10]=t,h[11]=p,h[12]=f):f=h[12],h[13]!==c||h[14]!==f?(m=(0,r.jsx)(j.m_,{animate:!0,content:c,fallbackPlacements:l,placement:"bottom",portal:!0,children:f}),h[13]=c,h[14]=f,h[15]=m):m=h[15],m}let eH=function(e){let t,n,o,s,c,p,f,m,h,v,x=(0,i.c)(27),{fontSize:g,onChange:b,origin:w,padding:j,prefix:_,suffix:S,value:E}=e,P=void 0===g?1:g,k=void 0===j?3:j,{t:C}=(0,u.Bdt)(d.Yi),{basePath:R}=(0,u.VrO)()?.activeWorkspace||{},z=void 0===R?"/":R,$=(0,l.useRef)(null),[A,I]=(0,l.useState)(void 0),[T,M]=(0,l.useState)(void 0);x[0]===Symbol.for("react.memo_cache_sentinel")?(t=e=>{I(e.currentTarget.value)},x[0]=t):t=x[0];let L=t;x[1]!==z||x[2]!==b||x[3]!==w||x[4]!==A||x[5]!==C?(n=e=>{if("Enter"===e.key){if(void 0===A)return;let e=A.startsWith("/")||""===A?`${w}${A}`:A;if(!e.startsWith(`${w}/`)&&e!==w)return void M(C("preview-location-input.error",{origin:w,context:"missing-origin"}));if(!w&&(e.startsWith(`${z}/`)||e===z))return void M(C("preview-location-input.error",{basePath:z,context:"same-base-path"}));let t=e===w?`${w}/`:e;
74M(void 0),I(void 0),b(t.slice(w.length)),$.current?.blur()}"Escape"===e.key&&(M(void 0),I(void 0))},x[1]=z,x[2]=b,x[3]=w,x[4]=A,x[5]=C,x[6]=n):n=x[6];let O=n;x[7]===Symbol.for("react.memo_cache_sentinel")?(o=()=>{M(void 0),I(void 0)},x[7]=o):o=x[7];let U=o;x[8]===Symbol.for("react.memo_cache_sentinel")?(s=()=>{M(void 0),I(void 0)},x[8]=s):s=x[8],x[9]!==w||x[10]!==E?(c=[w,E],x[9]=w,x[10]=E,x[11]=c):c=x[11],(0,l.useEffect)(s,c),x[12]===Symbol.for("react.memo_cache_sentinel")?(f={icon:y.NAP},x[12]=f):f=x[12],p=f;let Y=T?p:void 0;x[13]!==w||x[14]!==E?(m=()=>{M(void 0),I(w+E)},x[13]=w,x[14]=E,x[15]=m):m=x[15],x[16]===Symbol.for("react.memo_cache_sentinel")?(h={zIndex:1},x[16]=h):h=x[16];let B=void 0===A?`${w}${E}`:A;return x[17]!==T||x[18]!==P||x[19]!==O||x[20]!==k||x[21]!==_||x[22]!==S||x[23]!==Y||x[24]!==m||x[25]!==B?(v=(0,r.jsx)(r.Fragment,{children:(0,r.jsx)(a.ks,{clearButton:Y,customValidity:T,fontSize:P,onBlur:U,onClear:m,onChange:L,onKeyDownCapture:O,padding:k,prefix:_,style:h,radius:2,ref:$,space:k,suffix:S,value:B})}),x[17]=T,x[18]=P,x[19]=O,x[20]=k,x[21]=_,x[22]=S,x[23]=Y,x[24]=m,x[25]=B,x[26]=v):v=x[26],v},eJ=(0,l.lazy)(()=>n.e(3589).then(n.bind(n,33589))),eK=(0,v.I4)(A.jM)` 75 position: absolute; 76 top: 50%; 77 left: 50%; 78 transform: translate(-50%, -50%); 79 height: ${24}px; 80 width: ${24}px; 81`,eq=E.P.create(a.y$),eQ=E.P.create(a.EY),eX=E.P.create(eK),eG=(0,l.memo)(function(e){let{canToggleSharePreviewAccess:t,canUseSharedPreviewAccess:n,initialUrl:i,previewLocationRoute:c,perspective:p}=e,{t:f}=(0,u.Bdt)(d.Yi),{push:m}=(0,s.dj)(),h=(0,u.tH7)({apiVersion:d.mG}),v=(0,u.iZK)(),[x,g]=(0,l.useState)(!0),[b,w]=(0,l.useState)(!1),[_,S]=(0,l.useState)(!1),[E,k]=(0,l.useState)(null),C=b||_||x,R=(0,l.useMemo)(()=>E?function(e,t,n,r){let i=new URL(e),{searchParams:a}=i;return t&&(a.set(o.Vm,t),a.set(o.Zm,n)),a.set(o.Pd,r),i}(i,E,c,eW(p)):null,[i,p,c,E]),[z,$]=(0,l.useState)(null);if(z)throw z;let A=(0,l.useCallback)(()=>{m({closable:!0,status:"warning",title:f("share-preview-menu.error_toggle-sharing",{context:"toggle-sharing"})})},[m,f]),I=(0,l.useCallback)(async()=>{try{S(!0),await M(h,"@sanity/presentation",typeof window>"u"?"":location.href,v?.id),k(null)}catch(e){$(e)}finally{S(!1)}},[h,v?.id]),L=(0,l.useCallback)(async()=>{try{w(!0);let e=await T(h,"@sanity/presentation",typeof window>"u"?"":location.href,v?.id);k(e.secret)}catch(e){$(e)}finally{w(!1)}},[h,v?.id]),O=(0,l.useCallback)(()=>{try{if(!R)throw Error("No URL to copy");navigator.clipboard.writeText(R.toString()),m({closable:!0,status:"success",title:f("share-url.clipboard.status",{context:"success"})})}catch(e){$(e)}},[m,f,R]);return(0,l.useEffect)(()=>{let e=new AbortController,t=[];async function n(e,n){let{result:r,syncTags:i}=await h.fetch(o._g,{},{filterResponse:!1,lastLiveEventId:e,tag:"presentation.fetch-shared-access-secret"});Array.isArray(i)&&(t=i),n.aborted||k(r)}let r=h.live.events().subscribe({next:r=>{"message"===r.type&&(e.abort(),e=new AbortController,r.tags.some(e=>t.includes(e))&&n(r.id,e.signal))},error:$});return n(null,e.signal).finally(()=>g(!1)),()=>{r.unsubscribe(),e.abort()}},[h]),(0,r.jsx)(j.IU,{button:(0,r.jsx)(j.$n,{"aria-label":f("preview-frame.share-button.aria-label"),icon:y.liv,mode:"bleed",tooltipProps:null}),id:"share-menu",menu:(0,r.jsx)(a.W1,{style:{maxWidth:248},padding:n?void 0:0,children:n?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("label",{style:{cursor:"pointer"},children:(0,r.jsxs)(a.xA,{columns:2,rows:2,gapX:3,gapY:1,style:{justifyContent:"center",alignItems:"center",gridTemplateColumns:"min-content 1fr",gridTemplateRows:"min-content"},paddingTop:3,paddingX:3,children:[(0,r.jsx)(j.m_,{animate:!0,content:(0,r.jsx)(a.EY,{size:1,children:f("share-preview-menu.toggle-button.tooltip",{context:R?"disable":"enable"})}),fallbackPlacements:["bottom-start"],placement:"bottom",portal:!0,children:(0,r.jsx)(a.dO,{checked:b||null!==R&&!_,readOnly:b||_,indeterminate:x,onChange:t?R?I:L:A})}),(0,r.jsx)(a.EY,{size:1,weight:"medium",children:f("share-preview-menu.toggle-button.label",{context:"first-line"})}),(0,r.jsx)("span",{}),(0,r.jsx)(a.EY,{muted:!0,size:1,children:f("share-preview-menu.toggle-button.label",{context:"second-line"})})]})}),(0,r.jsx)(a.az,{padding:3,paddingTop:2,children:(0,r.jsxs)(a.BJ,{space:3,children:[(0,r.jsx)(a.Zp,{tone:C||!R?"transparent":void 0,style:{position:"relative",aspectRatio:"1 / 1",display:"flex",alignItems:"center",justifyContent:"center"},children:(0,r.jsx)(P.N,{children:C?(0,r.jsx)(eq,{muted:!0,initial:{opacity:0}
81,animate:{opacity:1},exit:{opacity:0}}):R?(0,r.jsx)(r.Fragment,{children:(0,r.jsxs)(l.Suspense,{fallback:(0,r.jsx)(a.y$,{}),children:[(0,r.jsx)(eJ,{title:f("share-preview-menu.qr-code.title",{url:R.toString()}),value:R.toString(),size:224,color:"var(--card-fg-color)",logoSize:40}),(0,r.jsx)(eX,{initial:{opacity:-.5},animate:{opacity:1.5},exit:{opacity:0}})]})}):(0,r.jsx)(eQ,{muted:!0,size:1,style:{maxWidth:"100px",textWrap:"pretty",textAlign:"center"},initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},children:f("share-preview-menu.qr-code.placeholder")})})}),(0,r.jsx)(a.EY,{muted:!0,size:1,children:f("share-preview-menu.qr-code.instructions")})]})}),(0,r.jsx)(a.Nj,{}),(0,r.jsx)(j.Dr,{disabled:!R||_,icon:y.TdU,onClick:O,text:f("share-preview-menu.copy-url.text")})]}):(0,r.jsx)(a.Zp,{padding:2,tone:"caution",radius:3,children:(0,r.jsx)(a.EY,{style:{textWrap:"pretty"},children:f("share-preview-menu.error",{context:"missing-grants"})})})}),popover:{constrainSize:!0,placement:"bottom",portal:!0}})});eG.displayName="Memo(SharePreviewMenu)";let e0=e=>{let t,n,s,c,l,p,f,m,h,v,x,g,b,w,_,S,E,P,k,C,R,z,$,A,I,T,M,L,O,U,Y,B,N,W,D,F,Z=(0,i.c)(100),{canSharePreviewAccess:V,canToggleSharePreviewAccess:H,canUseSharedPreviewAccess:J,dispatch:K,iframe:q,iframeRef:Q,initialUrl:X,navigatorEnabled:G,onPathChange:ee,onRefresh:et,openPopup:en,overlaysConnection:er,perspective:ei,previewUrl:eo,setViewport:ea,targetOrigin:es,toggleNavigator:ec,toggleOverlay:el,viewport:eu,visualEditing:ed}=e,{overlaysEnabled:ep}=ed,{t:ef}=(0,u.Bdt)(d.Yi);Z[0]!==ea||Z[1]!==eu?(t=()=>ea("desktop"===eu?"mobile":"desktop"),Z[0]=ea,Z[1]=eu,Z[2]=t):t=Z[2];let em=t;n=es===location.origin?"":es,Z[3]!==K||Z[4]!==Q||Z[5]!==et||Z[6]!==eo||Z[7]!==es?(s=()=>{et(()=>{Q.current&&(K({type:d.my}),Object.assign(Q.current,{src:`${es}${eo||"/"}`}))})},Z[3]=K,Z[4]=Q,Z[5]=et,Z[6]=eo,Z[7]=es,Z[8]=s):s=Z[8];let eh=s,{pathname:ev,search:ex}=function(e){let t=new URL(e),{searchParams:n}=t;return n.delete(o.Zm),n.delete(o.Vm),n.delete(o.Pd),n.delete(o.tt),n.delete(o.c4),t}(new URL(eo||"/",es));c=`${ev}${ex}`,Z[9]===Symbol.for("react.memo_cache_sentinel")?(l={width:"100%"},Z[9]=l):l=Z[9],Z[10]!==G||Z[11]!==ef||Z[12]!==ec?(p=ec&&(0,r.jsx)(j.$n,{"aria-label":ef("preview-frame.navigator.toggle-button.aria-label"),icon:y.lC2,mode:"bleed",onClick:ec,selected:G,tooltipProps:{content:(0,r.jsx)(a.EY,{size:1,children:ef("preview-frame.navigator.toggle-button.tooltip")}),fallbackPlacements:["bottom-start"],placement:"bottom"}}),Z[10]=G,Z[11]=ef,Z[12]=ec,Z[13]=p):p=Z[13],Z[14]===Symbol.for("react.memo_cache_sentinel")?(f={whiteSpace:"nowrap"},Z[14]=f):f=Z[14];let eg=ep?"disable":"enable";Z[15]!==ef||Z[16]!==eg?(m=ef("preview-frame.overlay.toggle-button.tooltip",{context:eg}),Z[15]=ef,Z[16]=eg,Z[17]=m):m=Z[17],Z[18]!==m?(h=(0,r.jsx)(a.az,{padding:1,children:(0,r.jsx)(a.EY,{size:1,children:m})}),Z[18]=m,Z[19]=h):h=Z[19],Z[20]===Symbol.for("react.memo_cache_sentinel")?(v=(0,r.jsx)(a.az,{paddingY:1,children:(0,r.jsx)(a.qW,{keys:["Alt"],style:{marginTop:-4,marginBottom:-4}})}),Z[20]=v):v=Z[20],Z[21]!==h?(x=(0,r.jsxs)(a.so,{align:"center",style:f,children:[h,v]}),Z[21]=h,Z[22]=x):x=Z[22],Z[23]===Symbol.for("react.memo_cache_sentinel")?(g=["bottom-start"],Z[23]=g):g=Z[23],Z[24]===Symbol.for("react.memo_cache_sentinel")?(b={lineHeight:0,borderRadius:999,userSelect:"none"},Z[24]=b):b=Z[24];let ey=ep?"transparent":void 0;Z[25]===Symbol.for("react.memo_cache_sentinel")?(w={margin:-4},Z[25]=w):w=Z[25];let eb="loading"===q.status||"connected"!==er;Z[26]!==ep||Z[27]!==eb||Z[28]!==el?(_=(0,r.jsx)("div",{style:w,children:(0,r.jsx)(a.dO,{checked:ep,onChange:el,disabled:eb})}),Z[26]=ep,Z[27]=eb,Z[28]=el,Z[29]=_):_=Z[29];let ew=!ep;Z[30]!==ef?(S=ef("preview-frame.overlay.toggle-button.text"),Z[30]=ef,Z[31]=S):S=Z[31],Z[32]!==ew||Z[33]!==S?(E=(0,r.jsx)(a.az,{children:(0,r.jsx)(a.EY,{muted:ew,size:1,weight:"medium",children:S})}),Z[32]=ew,Z[33]=S,Z[34]=E):E=Z[34],Z[35]!==_||Z[36]!==E?(P=(0,r.jsxs)(a.so,{align:"center",gap:3,children:[_,E]}),Z[35]=_,Z[36]=E,Z[37]=P):P=Z[37],Z[38]!==ey||Z[39]!==P?(k=(0,r.jsx)(a.Zp,{as:"label",flex:"none",padding:3,marginX:1,style:b,tone:ey,children:P}),Z[38]=ey,Z[39]=P,Z[40]=k):k=Z[40],Z[41]!==x||Z[42]!==k?(C=(0,r.jsx)(j.m_,{animate:!0,content:x,fallbackPlacements:g,placement:"bottom",portal:!0,children:k}),Z[41]=x,Z[42]=k,Z[43]=C):C=Z[43],Z[44]!==q.status||Z[45]!==ef?(R="loaded"===q.status?ef("preview-frame.refresh-button.tooltip"):ef("preview-frame.status",{context:q.status}),Z[44]=q.status,Z[45]=ef,Z[46]=R):R=Z[46],Z[47]!==R?(z=(0,r.jsx)(a.EY,{size:1,children:R}),Z[47]=R,Z[48]=z):z=Z[48],Z[49]===Symbol.for("react.memo_cache_sentinel")?($=["bottom-end"],Z[49]=$):$=Z[49],Z[50]!==ef?(A=ef("preview-frame.refresh-button.aria-label"),Z[50]=ef,Z[51]=A):A=Z[51];let ej="reloading"===q.status||"refreshing"===q.status;Z[52]!==eh||Z[53]!==A||Z[54]!==ej?(I=(0,r.jsx)(j.$n,{"aria-label":A,icon:y.fNY,mode:"bleed",loading:ej,onClick:eh,tooltipProps:null}),Z[52]=eh,Z[53]=A,Z[54]=ej,Z[55]=I):I=Z[55],Z[56]!==z||Z[57]!==I?(T=(0,r.jsx)(a.az,{padding:1,children:(0,r.jsx)(j.m_,{animate:!0,content:z,fallbackPlacements:$,placement:"bottom",portal:!0,children:I})}),Z[56]=z,Z[57]=I,Z[58]=T):T=Z[58],Z[59]!==en||Z[60]!==ei||Z[61]!==n||Z[62]!==c||Z[63]!==es?(M=(0,r.jsx)(a.az,{padding:1,children:(0,r.jsx)(eV,{openPopup:en,previewLocationOrigin:n,previewLocationRoute:c,perspective:ei,targetOrigin:es})}),Z[59]=en,Z[60]=ei,Z[61]=n,Z[62]=c,Z[63]=es,Z[64]=M):M=Z[64],Z[65]!==ee||Z[66]!==n||Z[67]!==c||Z[68]!==T||Z[69]!==M?(L=(0,r.jsx)(a.az,{flex:1,children:(0,r.jsx)(eH,{prefix:T,onChange:ee,origin:n,suffix:M,value:c})}),Z[65]=ee,Z[66]=n,Z[67]=c,Z[68]=T,Z[69]=M,Z[70]=L):L=Z[70];let e_="desktop"===eu?"narrow":"full";Z[71]!==ef||Z[72]!==e_?(O=ef("preview-frame.viewport-button.tooltip",{context:e_}),Z[71]=ef,Z[72]=e_,Z[73]=O):O=Z[73],Z[74]!==O?(U=(0,r.jsx)(a.EY,{size:1,children:O}),Z[74]=O,Z[75]=U):U=Z[75],Z[76]===Symbol.for("react.memo_cache_sentinel")?(Y=["bottom-start"],Z[76]=Y):Y=Z[76],Z[77]!==ef?(B=ef("preview-frame.viewport-button.aria-label"),Z[77]=ef,Z[78]=B):B=Z[78];let eS="desktop"===eu?y.Ck_:y.eZO;return Z[79]!==B||Z[80]!==eS||Z[81]!==em||Z[82]!==eu?(N=(0,r.jsx)(j.$n,{"data-testid":"preview-viewport-toggle","data-viewport":eu,"aria-label":B,icon:eS,mode:"bleed",onClick:em,tooltipProps:null}),Z[79]=B,Z[80]=eS,Z[81]=em,Z[82]=eu,Z[83]=N):N=Z[83],Z[84]!==U||Z[85]!==N?(W=(0,r.jsx)(a.so,{align:"center",flex:"none",gap:1,children:(0,r.jsx)(j.m_,{animate:!0,content:U,fallbackPlacements:Y,placement:"bottom",portal:!0,children:N})}),Z[84]=U,Z[85]=N,Z[86]=W):W=Z[86],Z[87]!==V||Z[88]!==H||Z[89]!==J||Z[90]!==X||Z[91]!==ei||Z[92]!==c?(D=V&&(0,r.jsx)(a.so,{align:"center",flex:"none",gap:1,children:(0,r.jsx)(eG,{canToggleSharePreviewAccess:H,canUseSharedPreviewAccess:J,previewLocationRoute:c,initialUrl:X,perspective:ei})}),Z[87]=V,Z[88]=H,Z[89]=J,Z[90]=X,Z[91]=ei,Z[92]=c,Z[93]=D):D=Z[93],Z[94]!==C||Z[95]!==L||Z[96]!==W||Z[97]!==D||Z[98]!==p?(F=(0,r.jsxs)(a.so,{align:"center",gap:1,paddingX:1,style:l,children:[p,C,L,W,D]}),Z[94]=C,Z[95]=L,Z[96]=W,Z[97]=D,Z[98]=p,Z[99]=F):F=Z[99],F};
81function e1(e){let t,n,o,s,c=(0,i.c)(7),l=e2,u=e.options?.component;c[0]!==u||c[1]!==e?(t=u?(0,r.jsx)(u,{...e,renderDefault:l}):l(e),c[0]=u,c[1]=e,c[2]=t):t=c[2];let d=t;return c[3]===Symbol.for("react.memo_cache_sentinel")?(n={position:"relative"},c[3]=n):n=c[3],c[4]===Symbol.for("react.memo_cache_sentinel")?(o={minHeight:0},c[4]=o):o=c[4],c[5]!==d?(s=(0,r.jsx)(a.Zp,{flex:"none",padding:2,borderBottom:!0,style:n,children:(0,r.jsx)(a.so,{align:"center",style:o,children:d})}),c[5]=d,c[6]=s):s=c[6],s}function e2(e){return(0,r.jsx)(e0,{...e})}let e3=E.P.create(a.so),e4=(0,l.memo)((0,l.forwardRef)(function(e,t){let{dispatch:n,iframe:i,header:s,initialUrl:c,loadersConnection:p,overlaysConnection:f,perspective:m,viewport:h,vercelProtectionBypass:v}=e,[x,g]=(0,l.useState)(null),y=eW(null===x?m:x),b=(0,l.useMemo)(()=>{let e=new URL(c);return e.searchParams.get(o.Pd)||e.searchParams.set(o.Pd,y),(v||e.searchParams.get(o.tt))&&e.searchParams.set(o.c4,"samesitenone"),v&&!e.searchParams.get(o.tt)&&e.searchParams.set(o.tt,v),e},[c,y,v]);(0,l.useEffect)(()=>{"connected"===p&&g(e=>null===e?m:e)},[p,m]);let{t:w}=(0,u.Bdt)(d.Yi),{devMode:_}=(0,d.Qe)(),S=(0,a.jt)(),E=(0,l.useRef)(null),k=(0,r.jsx)(e1,{...e,iframeRef:E,options:s});(0,l.useImperativeHandle)(t,()=>E.current);let C="loading"===i.status||"reloading"===i.status,[R,A]=(0,l.useState)(!1),I="refreshing"===i.status,[T,M]=(0,l.useState)(!1),L=C||I||"connecting"===f,O=(0,l.useCallback)(()=>{E.current&&(E.current.src=b.toString(),n({type:d.my}))},[n,b]),U=(0,l.useCallback)(()=>{B(!0)},[]),[Y,B]=(0,l.useState)(!1),[N,W]=(0,l.useState)(!1);(0,l.useEffect)(()=>{if(!(C||I)&&("connecting"===f||"reconnecting"===f)){let e=setTimeout(()=>{W(!0)},5e3);return()=>clearTimeout(e)}},[f,C,I]),(0,l.useEffect)(()=>{if(!(C||I||!N)){if("connected"===f&&(M(!1),W(!1),A(!1),B(!1)),"connecting"===f){let e=setTimeout(()=>{A(!0),console.error("Unable to connect to visual editing. Make sure you've setup '@sanity/visual-editing' correctly")},d.Cw);return()=>clearTimeout(e)}if("reconnecting"===f){let e=setTimeout(()=>{A(!0),M(!0)},d.Cw);return()=>clearTimeout(e)}}},[C,f,I,N]);let D=(0,l.useCallback)(()=>{n({type:d.cr})},[n]);(0,l.useEffect)(()=>{if(!E.current)return;let e=E.current;function t(){e===document.activeElement&&e.dispatchEvent(new MouseEvent("mousedown",{bubbles:!0,cancelable:!0}))}return window.addEventListener("blur",t),()=>{window.removeEventListener("blur",t)}},[]);let F=(0,l.useMemo)(()=>(C||"connecting"===f&&"refreshing"!==i.status)&&!Y,[Y,i.status,C,f]),Z=(0,l.useSyncExternalStore)((0,l.useCallback)(()=>()=>{},[]),()=>CSS.supports("(view-transition-name: test)")),V=(0,l.useMemo)(()=>[F?"background":"active",C?"reloading":"idle",Z?"":h,N&&!Y?"timedOut":""],[Z,Y,C,F,N,h]),[H,J]=(0,l.useState)(h),[K,q]=(0,l.useState)(e8[h]);return(0,l.useEffect)(()=>{if(Z&&h!==H){let e=()=>{J(h),q(e8[h])};!S&&"startViewTransition"in document&&"function"==typeof document.startViewTransition?document.startViewTransition(()=>(0,$.flushSync)(()=>e())):e()}},[Z,S,H,h]),(0,r.jsx)(z,{transition:S?{duration:0}:void 0,children:(0,r.jsxs)(j.vE,{children:[k,(0,r.jsx)(a.Zp,{flex:1,tone:"transparent",children:(0,r.jsxs)(a.so,{align:"center",height:"fill",justify:"center",padding:2*((Z?H:h)!=="desktop"),sizing:"border",style:{position:"relative",cursor:L?"wait":void 0},children:[(0,r.jsx)(P.N,{children:T||C||I||!N||Y?(C||"connecting"===f&&"refreshing"!==i.status)&&!Y?(0,r.jsx)(e3,{initial:"initial",animate:"animate",exit:"exit",variants:e6,justify:"center",align:"center",style:{inset:"0",position:"absolute"},children:(0,r.jsxs)(a.so,{style:{...e5[h]},justify:"center",align:"center",direction:"column",gap:4,children:[(0,r.jsx)(a.y$,{muted:!0}),(0,r.jsx)(a.EY,{muted:!0,size:1,children:w("preview-frame.status",{context:"loading"})})]})}):T&&!Y?(0,r.jsx)(e3,{initial:"initial",animate:"animate",exit:"exit",variants:e9,justify:"center",align:"center",style:{background:"var(--card-bg-color)",inset:"0",position:"absolute"},children:(0,r.jsx)(el,{flex:1,message:w("preview-frame.connection.error.text"),onRetry:O,onContinueAnyway:U,children:_&&(0,r.jsxs)(r.Fragment,{children:["connected"!==f&&(0,r.jsx)(a.Zp,{padding:3,radius:2,tone:"critical",children:(0,r.jsxs)(a.BJ,{space:3,children:[(0,r.jsx)(a.JU,{muted:!0,size:0,children:w("preview-frame.overlay.connection-status.label")}),(0,r.jsx)(a.Cy,{size:1,children:w("channel.status",{context:f})})]})}),"connected"!==p&&(0,r.jsx)(a.Zp,{padding:3,radius:2,tone:"critical",children:(0,r.jsxs)(a.BJ,{space:3,children:[(0,r.jsx)(a.JU,{muted:!0,size:0,children:w("preview-frame.loader.connection-status.label")}),(0,r.jsx)(a.Cy,{size:1,children:w("channel.status",{context:p})})]})})]})})}):null:(0,r.jsx)(e3,{initial:"initial",animate:"animate",exit:"exit",variants:e6,justify:"center",align:"center",style:{inset:"0",position:"absolute",backdropFilter:R?"blur(16px) saturate(0.5) grayscale(0.5)":"blur(2px)",transition:"backdrop-filter 0.2s ease-in-out",WebkitBackdropFilter:R?"blur(16px) saturate(0.5) grayscale(0.5)":"blur(2px)",WebkitTransition:"-webkit-backdrop-filter 0.2s ease-in-out",zIndex:1},children:(0,r.jsxs)(a.so,{style:{...e5[h]},justify:"center",align:"center",direction:"column",gap:4,children:[R&&(0,r.jsx)(j.$n,{disabled:!0,mode:"ghost",text:w("preview-frame.continue-button.text"),style:{opacity:0}
81}),(0,r.jsx)(a.Zp,{radius:2,tone:R?"caution":"inherit",padding:4,shadow:1,children:(0,r.jsxs)(a.so,{justify:"center",align:"center",direction:"column",gap:4,children:[(0,r.jsx)(a.y$,{muted:!0}),(0,r.jsx)(a.EY,{muted:!0,size:1,children:w("preview-frame.status",R?{context:"timeout"}:{context:"connecting"})})]})}),R&&(0,r.jsx)(j.$n,{tone:"critical",onClick:U,text:w("preview-frame.continue-button.text")})]})})}),(0,r.jsx)(eZ,{animate:V,initial:["background"],onLoad:D,preventClick:F,ref:E,src:b.toString(),style:K,variants:e8})]})})]})})}));e4.displayName="Memo(ForwardRef(Preview))";let e5={desktop:{width:"100%",height:"100%"},mobile:{width:375,height:650}},e6={initial:{opacity:1},animate:{opacity:[0,0,1]},exit:{opacity:[1,0,0]}},e9={initial:{opacity:1},animate:{opacity:[0,0,1]},exit:{opacity:[1,0,0]}},e8={desktop:{...e5.desktop,boxShadow:"0 0 0 0px var(--card-border-color)"},mobile:{...e5.mobile,boxShadow:"0 0 0 1px var(--card-border-color)"},background:{opacity:0,scale:1},idle:{scale:1},reloading:{scale:[1,1,1,.98]},active:{opacity:[0,0,1],scale:1},timedOut:{opacity:[0,0,1]}},e7=function(){let e=!1;return(...t)=>{e||(console.warn(...t),e=!0)}}();function te(e,t){return Object.values(t).forEach(t=>{e[t._id]=t}),e}function tt(e){return"_projectId"in e&&e._projectId?(e7("Cross dataset references are not supported yet, ignoring source document",e),!1):e}function tn(e,t){return e instanceof Function?e(t):e}function tr(e){let[t]=e;return"preview"===t}let ti=(0,B.FsL)((0,B.YjP)(),(0,B.BpQ)(1)),to=(0,B.lqM)(ti);(0,B.Ikc)({baseUrl:ti,dataset:to,id:ti,path:ti,projectId:to,tool:to,type:to,workspace:to});let ta=/^([\w-]+):(0|[1-9][0-9]*)$/,ts=/^([\w-]+):([0-9]+),([0-9]+)$/,tc=/^([\w-]+):([\w-]+)$/,tl=(0,B.FsL)((0,B.YjP)(),(0,B.BpQ)(1));function tu(e){return Object.fromEntries(Object.entries(e).filter(([,e])=>void 0!==e&&""!==e&&null!==e))}function td(){return new Set}function tp(e){return e()}(0,B.Ikc)({origin:tl,href:tl,data:(0,B.lqM)((0,B.g1P)((0,B.YjP)(),(0,B.L5J)()))});let tf=Symbol("sanity/presentation/resolveUUID");function tm(){let e,t,n,r,o=(0,i.c)(4);o[0]===Symbol.for("react.memo_cache_sentinel")?(e=new Map,o[0]=e):e=o[0];let[a,s]=(0,l.useState)(e);e:{let e=Array.from(a.values());if(e.find(tx)){t="connected";break e}let n=e.filter(tv);if(n.length){t=n.some(th)?"connecting":"reconnecting";break e}t="idle"}let c=t;o[1]===Symbol.for("react.memo_cache_sentinel")?(n=e=>{s(t=>{let n=new Map(t);if("disconnected"===e.status)n.delete(e.connection);else{let t=n.get(e.connection)?.hasConnected||"connected"===e.status,r="handshaking"===e.status?"connecting":e.status;n.set(e.connection,{status:r,hasConnected:t})}return n})},o[1]=n):n=o[1];let u=n;return o[2]!==c?(r=[c,u],o[2]=c,o[3]=r):r=o[3],r}function th(e){let{hasConnected:t}=e;return!t}function tv(e){let{status:t}=e;return"connecting"===t}function tx(e){let{status:t}=e;return"connected"===t}let tg=(0,l.lazy)(()=>n.e(2681).then(n.bind(n,12681))),ty=(0,l.lazy)(()=>n.e(2762).then(n.bind(n,52762))),tb=(0,l.lazy)(()=>n.e(729).then(n.bind(n,20729))),tw=(0,l.lazy)(()=>n.e(4290).then(n.bind(n,84290))),tj=(0,l.lazy)(()=>n.e(8439).then(n.bind(n,58439))),t_=(0,l.lazy)(()=>n.e(8043).then(n.bind(n,18043))),tS=(0,l.lazy)(()=>n.e(7885).then(n.bind(n,27885))),tE=(0,v.I4)(a.so)` 82 overflow-x: auto; 83`;function tP(e){let{canCreateUrlPreviewSecrets:t,canToggleSharePreviewAccess:n,canUseSharedPreviewAccess:s,tool:c,vercelProtectionBypass:v}=e,g=c.options?.components,y=c.options?.previewUrl,b=c.name||d.P5,{unstable_navigator:w,unstable_header:j}=g||{},{navigate:_,state:S}=(0,h.rd)(),E=(0,u.$6H)(Object.fromEntries(S._searchParams||[])),{perspectiveStack:P,selectedPerspectiveName:k="drafts",selectedReleaseId:C}=(0,u.QO2)(),R=C?P:k,z=function(e,t,n,r,a){let s,c,p,f=(0,i.c)(12);f[0]===Symbol.for("react.memo_cache_sentinel")?(s={apiVersion:d.mG},f[0]=s):s=f[0];let m=(0,u.tH7)(s),h=(0,u.VrO)(),v=h?.activeWorkspace?.basePath||"/",x=function(e,t,n,r){let o,a,s,c,d=(0,i.c)(12);d[0]!==r?(o=()=>r||"",d[0]=r,d[1]=o):o=d[1];let[p,f]=(0,l.useState)(o),m=(0,l.useRef)(0);d[2]!==p||d[3]!==r?(a=()=>{if(p&&r)return window.clearTimeout(m.current),()=>{m.current=window.setTimeout(()=>{f("")},100)}},s=[p,r],d[2]=p,d[3]=r,d[4]=a,d[5]=s):(a=d[4],s=d[5]),(0,l.useEffect)(a,s);let h=(0,u.iZK)(),v=h?.id;return d[6]!==t||d[7]!==p||d[8]!==v||d[9]!==e||d[10]!==n?(c=["sanity/presentation",t,n,e,v,tf,p],d[6]=t,d[7]=p,d[8]=v,d[9]=e,d[10]=n,d[11]=c):c=d[11],c}(t,v,h?.activeWorkspace?.name||"default",r),g=function(e,t){let n,r,o,a,s=(0,i.c)(10);s[0]===Symbol.for("react.memo_cache_sentinel")?(n={apiVersion:d.mG},s[0]=n):n=s[0];let c=(0,u.tH7)(n),p=(0,u.iZK)(),[f,m]=(0,l.useState)("");s[1]!==c||s[2]!==p?.id||s[3]!==t||s[4]!==e||s[5]!==f?(r=e?(0,W.DY)(async()=>await N(c,"@sanity/presentation",typeof window>"u"?"":location.href,p?.id),[...t,f]):null,s[1]=c,s[2]=p?.id,s[3]=t,s[4]=e,s[5]=f,s[6]=r):r=s[6];let h=r;return s[7]!==h?(o=()=>
83{if(!h)return;let e=setTimeout(()=>{(0,l.startTransition)(()=>m(h.expiresAt.toString()))},h.expiresAt.getTime()-Date.now());return()=>clearTimeout(e)},a=[h],s[7]=h,s[8]=o,s[9]=a):(o=s[8],a=s[9]),(0,l.useEffect)(o,a),h?.secret||null}(a&&"object"==typeof e||"function"==typeof e,x);return f[1]!==v||f[2]!==m||f[3]!==r||f[4]!==e||f[5]!==g||f[6]!==n?(c=async()=>{if("string"==typeof e){let t=new URL(e,location.origin),n=t;try{if(r){let e=new URL(r,t);e.origin===t.origin&&(n=e)}}catch{}return location.origin===n.origin&&(n.pathname.startsWith(`${v}/`)||n.pathname===v)?t:n}let t=await ("object"==typeof e?function(e){let{draftMode:t,previewMode:n,origin:r=typeof location>"u"?"https://localhost":location.origin}=e,i=n?.enable||t?.enable,{preview:a="/"}=e,s=new URL(a,r),c=i?new URL(i,r):void 0;return async t=>{try{if(t.previewSearchParam){let e=new URL(t.previewSearchParam,s);e.origin===s.origin&&(a=`${e.pathname}${e.search}`)}}catch{}"u">typeof location&&location.origin===s.origin&&t.studioBasePath&&(a.startsWith(`${t.studioBasePath}/`)||a===t.studioBasePath)&&(a=e.preview||"/");let n=new URL(a,s);if(c){let e=new URL(c),{searchParams:r}=e;return r.set(o.Vm,t.previewUrlSecret),r.set(o.Pd,t.studioPreviewPerspective),n.pathname!==e.pathname&&r.set(o.Zm,`${n.pathname}${n.search}`),e.toString()}return n.toString()}}(e):e)({client:m,previewUrlSecret:g,studioPreviewPerspective:eW(n),previewSearchParam:r,studioBasePath:v});return new URL(t,location.origin)},f[1]=v,f[2]=m,f[3]=r,f[4]=e,f[5]=g,f[6]=n,f[7]=c):c=f[7],f[8]!==x||f[9]!==g||f[10]!==c?(p=(0,W.DY)(c,[...x,g]),f[8]=x,f[9]=g,f[10]=c,f[11]=p):p=f[11],p}(y||"/",b,R,E.preview||null,t),$=(0,l.useMemo)(()=>y&&"object"==typeof y&&"draftMode"in y&&y.draftMode?(console.warn("previewUrl.draftMode is deprecated, use previewUrl.previewMode instead"),!1!==y.draftMode.shareAccess):!!y&&"object"==typeof y&&"previewMode"in y&&!!y.previewMode&&!1!==y.previewMode.shareAccess,[y]),[A]=(0,l.useState)(()=>{let e=c.options?.devMode;return"function"==typeof e?e():"boolean"==typeof e?e:"u">typeof window&&"localhost"===window.location.hostname}),I=(0,l.useMemo)(()=>z.origin,[z.origin]),T=(0,l.useRef)(null),[M,B]=(0,l.useState)(),[F,H]=(0,l.useState)(null),K=(0,l.useRef)({title:void 0,url:void 0}),{navigate:q,navigationHistory:Q,params:X,searchParams:G,structureParams:ee}=function({initialPreviewUrl:e,routerNavigate:t,routerState:n,routerSearchParams:r,frameStateRef:i}){let o=(0,l.useMemo)(()=>{let{id:t,path:i,type:o}={id:function(e){if(void 0===e)return;let t=decodeURIComponent(e)?.split(".");return"drafts"===t[0]&&t.shift(),t.join(".")}(n.id),path:function(e){if(void 0!==e)return p.C.toString(function(e){let t=[];for(let n of e.split(".")){let e=ta.exec(n);if(e){t.push(e[1],Number(e[2]));continue}let r=ts.exec(n);if(r){t.push(r[1],[Number(r[2]),Number(r[3])]);continue}let i=tc.exec(n);if(i){t.push(i[1],{_key:i[2]});continue}t.push(n)}return t}(decodeURIComponent(e)))}(n.path),type:n.type};return{id:t,type:o,path:i,preview:r.preview||`${e.pathname}${e.search}`,perspective:r.perspective,viewport:r.viewport,inspect:r.inspect,rev:r.rev,since:r.since,template:r.template,templateParams:r.templateParams,view:r.view,pathKey:r.pathKey,instruction:r.instruction,comment:r.comment,changesInspectorTab:r.changesInspectorTab}},[n,r,e]),a=(0,l.useMemo)(()=>tu({inspect:o.inspect,path:o.path,rev:o.rev,since:o.since,template:o.template,templateParams:o.templateParams,view:o.view,pathKey:o.pathKey,instruction:o.instruction,comment:o.comment,changesInspectorTab:o.changesInspectorTab}),[o.changesInspectorTab,o.comment,o.inspect,o.instruction,o.path,o.pathKey,o.rev,o.since,o.template,o.templateParams,o.view]),s=(0,l.useMemo)(()=>tu({perspective:o.perspective,preview:o.preview,viewport:o.viewport}),[o.perspective,o.preview,o.viewport]),c=(0,l.useRef)(n);(0,l.useEffect)(()=>{c.current=n},[n]);let[d,f]=(0,l.useState)([n]);return{navigate:(0,l.useCallback)((e,n={},r)=>{e.id&&(e.id=(0,u.IMx)(e.id));let{_searchParams:o,...a}=c.current,s=(o||[]).reduce((e,[t,n])=>(e[t]=n,e),{}),l=tu({...a,...e}),d=tu({...s,...n});a.id!==l.id&&(delete d.template,delete d.templateParams),l._searchParams=Object.entries(d).reduce((e,[t,n])=>[...e,[t,n]],[]);let p=r??d.preview===i.current.url;f(e=>[...e,l]),t(l,{replace:p})},[t,i]),navigationHistory:d,params:o,searchParams:s,structureParam
83s:a}}({initialPreviewUrl:z,routerNavigate:_,routerState:S,routerSearchParams:E,frameStateRef:K}),et=(0,l.useMemo)(()=>Z(q,50),[q]),[en,er]=(0,l.useReducer)(d.dL,{},d.xe),ei=(0,l.useMemo)(()=>X.viewport?"mobile":"desktop",[X.viewport]),[eo,ea]=function(e,t){let n,r,o,a,s,c,u=(0,i.c)(9);(0,L.x_)(e),u[0]===Symbol.for("react.memo_cache_sentinel")?(n={},u[0]=n):n=u[0];let[d,p]=(0,l.useState)(n);u[1]===Symbol.for("react.memo_cache_sentinel")?(r={},u[1]=r):r=u[1];let[f,m]=(0,l.useState)(r),h=(0,l.useRef)("");u[2]!==t?(o=(e,n,r)=>{let i=(void 0===r?[]:r).filter(tt);("published"===n?p:m)(n=>{let r={};for(let e of i)r[e._id]=e;return h.current!==t.current.url?(h.current=t.current.url,{[e]:r}):O(n[e],r)?n:{...n,[e]:r}})},u[2]=t,u[3]=o):o=u[3];let v=o,x="published"===e?d:f;return u[4]!==x?(s=Object.values(Object.values(x).reduce(te,{})),u[4]=x,u[5]=s):s=u[5],a=s,u[6]!==a||u[7]!==v?(c=[a,v],u[6]=a,u[7]=v,u[8]=c):c=u[8],c}(R,K),es=(0,u.M91)(),el=(0,u.EL1)(),eu=function(e){let t,n,r,o,a,s,c=(0,i.c)(22),{navigate:p,navigationHistory:f,path:m,previewUrl:v,resolvers:g}=e;c[0]!==g?(t=void 0===g?[]:g,c[0]=g,c[1]=t):t=c[1];let y=t,{state:b}=(0,h.rd)(),{perspectiveStack:w}=(0,u.QO2)();c[2]===Symbol.for("react.memo_cache_sentinel")?(n={apiVersion:d.mG},c[2]=n):n=c[2];let j=(0,u.tH7)(n);c[3]!==m||c[4]!==b?(r=m||b._searchParams?.find(tr)?.[1]||"",c[3]=m,c[4]=b,c[5]=r):r=c[5];let _=r,[S,E]=(0,l.useState)(void 0),P=(0,l.useRef)(void 0);c[6]!==p||c[7]!==f?(o=(e,t)=>{e&&P.current===e._id||(E({document:e,path:t.pathname}),P.current=e?._id,f.at(-1)?.id===f.at(-2)?.id&&p?.({id:e?._id,type:e?._type}))},c[6]=p,c[7]=f,c[8]=o):o=c[8];let k=(0,x.J)(o);return c[9]!==j||c[10]!==k||c[11]!==w||c[12]!==v||c[13]!==_||c[14]!==y?(a=()=>{let e=new URL(_,"string"==typeof v?v:"object"==typeof v&&v?.origin||location.origin);if(y.length){let r;for(let t of y){let n=function(e,t){for(e of Array.isArray(e)?e:[e]){let n,r=e;if("string"==typeof e)try{let t=new URL(e);n=t.origin,r=t.pathname}catch{}if(!(n&&t.origin!==n))try{let e=(function(e,t){var n=[];return function(e,t,n){void 0===n&&(n={});var r=n.decode,i=void 0===r?function(e){return e}:r;return function(n){var r=e.exec(n);if(!r)return!1;for(var o=r[0],a=r.index,s=Object.create(null),c=1;c<r.length;c++)!function(e){if(void 0!==r[e]){var n=t[e-1];"*"===n.modifier||"+"===n.modifier?s[n.name]=r[e].split(n.prefix+n.suffix).map(function(e){return i(e,n)}):s[n.name]=i(r[e],n)}}(c);return{path:o,index:a,params:s}}}(function e(t,n,r){if(t instanceof RegExp){var i;if(!n)return t;for(var o=/\((?:\?<(.*?)>)?(?!\?)/g,a=0,s=o.exec(t.source);s;)n.push({name:s[1]||a++,prefix:"",suffix:"",modifier:"",pattern:""}),s=o.exec(t.source);return t}return Array.isArray(t)?(i=t.map(function(t){return e(t,n,r).source}),new RegExp("(?:".concat(i.join("|"),")"),Y(r))):function(e,t,n){void 0===n&&(n={});for(var r=n.strict,i=void 0!==r&&r,o=n.start,a=n.end,s=n.encode,c=void 0===s?function(e){return e}:s,l=n.delimiter,u=n.endsWith,d="[".concat(U(void 0===u?"":u),"]|$"),p="[".concat(U(void 0===l?"/#?":l),"]"),f=void 0===o||o?"^":"",m=0;m<e.length;m++){var h=e[m];if("string"==typeof h)f+=U(c(h));else{var v=U(c(h.prefix)),x=U(c(h.suffix));if(h.pattern)if(t&&t.push(h),v||x)if("+"===h.modifier||"*"===h.modifier){var g="*"===h.modifier?"?":"";f+="(?:".concat(v,"((?:").concat(h.pattern,")(?:").concat(x).concat(v,"(?:").concat(h.pattern,"))*)").concat(x,")").concat(g)}else f+="(?:".concat(v,"(").concat(h.pattern,")").concat(x,")").concat(h.modifier);else{if("+"===h.modifier||"*"===h.modifier)throw TypeError('Can not repeat "'.concat(h.name,'" without a prefix and suffix'));f+="(".concat(h.pattern,")").concat(h.modifier)}else f+="(?:".concat(v).concat(x,")").concat(h.modifier)}}if(void 0===a||a)i||(f+="".concat(p,"?")),f+=n.endsWith?"(?=".concat(d,")"):"$";else{var y=e[e.length-1],b="string"==typeof y?p.indexOf(y[y.length-1])>-1:void 0===y;i||(f+="(?:".concat(p,"(?=").concat(d,"))?")),b||(f+="(?=".concat(p,"|").concat(d,")"))}return new RegExp(f,Y(n))}(function(e,t){void 0===t&&(t={});for(var n=function(e){for(var t=[],n=0;n<e.length;){var r=e[n];if("*"===r||"+"===r||"?"===r){t.push({type:"MODIFIER",index:n,value:e[n++]});continue}if("\\"===r){t.push({type:"ESCAPED_CHAR",index:n++,value:e[n++]});continue}if("{"===r){t.push({type:"OPEN",index:n,value:e[n++]});continue}if("}"===r){t.push({type:"CLOSE",index:n,value:e[n++]});continue}if(":"===r){for(var i="",o=n+1;o<e.length;){var a=e.charCodeAt(o);if(a>=48&&a<=57||a>=65&&a<=90||a>=97&&a<=122||95===a){i+=e[o++];continue}break}if(!i)throw TypeError("Missing parameter name at ".concat(n));t.push({type:"NAME",index:n,value:i}),n=o;continue}if("("===r){var s=1,c="",o=n+1;if("?"===e[o])throw TypeError('Pattern cannot start with "?" at '.concat(o));for(;o<e.length;){if("\\"===e[o]){c+=e[o++]+e[o++];continue}if(")"===e[o]){if(0==--s){o++;break}}else if("("===e[o]&&(s++,"?"!==e[o+1]))throw TypeError("Capturing groups are not allowed at ".concat(o));c+=e[o++]}if(s)throw TypeError("Unbalanced pattern at ".concat(n));if(!c)throw TypeError("Missing pattern at ".concat(n));t.push({type:"PATTERN",index:n,value:c}),n=o;continue}t.push({type:"CHAR",index:n,value:e[n++]})}return t.push({type:"END",index:n,value:""}),t}(e),r=t.prefixes,i=void 0===r?"./":r,o=t.delimiter,a=void 0===o?"/#?":o,s=[],c=0,l=0,u="",d=function(e){if(l<n.length&&n[l].type===e)return n[l++].value},p=function(e){var t=d(e);if(void 0!==t)return t;var r=n[l],i=r.type,o=r.index;throw TypeError("Unexpected ".concat(i," at ").concat(o,", expected ").concat(e))},f=function(){for(var e,t="";e=d("CHAR")||d("ESCAPED_CHAR");)t+=e;return t},m=function(e){for(var t=0;t<a.length;t++){var n=a[t];if(e.indexOf(n)>-1)return!0}return!1},h=function(e){var t=s[s.length-1],n=e||(t&&"string"==typeof t?t:"");
83if(t&&!n)throw TypeError('Must have text between two parameters, missing text after "'.concat(t.name,'"'));return!n||m(n)?"[^".concat(U(a),"]+?"):"(?:(?!".concat(U(n),")[^").concat(U(a),"])+?")};l<n.length;){var v=d("CHAR"),x=d("NAME"),g=d("PATTERN");if(x||g){var y=v||"";-1===i.indexOf(y)&&(u+=y,y=""),u&&(s.push(u),u=""),s.push({name:x||c++,prefix:y,suffix:"",pattern:g||h(y),modifier:d("MODIFIER")||""});continue}var b=v||d("ESCAPED_CHAR");if(b){u+=b;continue}if(u&&(s.push(u),u=""),d("OPEN")){var y=f(),w=d("NAME")||"",j=d("PATTERN")||"",_=f();p("CLOSE"),s.push({name:w||(j?c++:""),pattern:w&&!j?h(y):j,prefix:y,suffix:_,modifier:d("MODIFIER")||""});continue}p("END")}return s}(t,r),n,r)}(e,n,t),n,t)})(r,{decode:decodeURIComponent})(t.pathname);if(e){let{params:t,path:r}=e;return{origin:n,params:t,path:r}}}catch{throw Error(`"${e}" is not a valid route pattern`)}}}(t.route,e);if(n){r={context:n,resolver:t};break}}if(r){var t,n;let i=function(e,t){if(e.resolve){let n=e.resolve(t)?.filter;return n?`// groq 84*[${n}][0]{_id, _type}`:void 0}return"type"in e?`// groq 85*[_type == "${e.type}"][0]{_id, _type}`:`// groq 86*[${tn(e.filter,t)}][0]{_id, _type}`}(r.resolver,r.context),o=(t=r.resolver,n=r.context,t.resolve?t.resolve(n)?.params??n.params:"type"in t?{}:tn(t.params,n)??n.params);if(i){let t=new AbortController,n={perspective:w,signal:t.signal,tag:"use-main-document"};return j.fetch(i,o,n).then(t=>k(t,e)).catch(t=>{t instanceof Error&&"AbortError"===t.name||(E({document:void 0,path:e.pathname}),P.current=void 0)}),()=>{t.abort()}}}}E(void 0),P.current=void 0},c[9]=j,c[10]=k,c[11]=w,c[12]=v,c[13]=_,c[14]=y,c[15]=a):a=c[15],c[16]!==j||c[17]!==w||c[18]!==v||c[19]!==_||c[20]!==y?(s=[j,v,_,y,w],c[16]=j,c[17]=w,c[18]=v,c[19]=_,c[20]=y,c[21]=s):s=c[21],(0,l.useEffect)(a,s),S}({navigate:q,navigationHistory:Q,path:X.preview,previewUrl:c.options?.previewUrl,resolvers:c.options?.resolve?.mainDocuments}),[ed,ep]=tm(),[ef,em]=tm(),[eh,ev]=tm(),{open:ex}=(e=>{let t,n,r,o,a,s,c=(0,i.c)(10),[u,p]=(0,l.useState)(td);c[0]===Symbol.for("react.memo_cache_sentinel")?(t=e=>{let t=window.open(e,"_blank");t&&p(e=>new Set(e).add(t))},c[0]=t):t=c[0];let f=t;return c[1]!==e||c[2]!==u?(n=()=>{let t=[];if(u.size&&e)for(let n of u)n&&"closed"in n&&!n.closed&&t.push(e.addTarget(n));return()=>{t.forEach(tp)}},r=[e,u],c[1]=e,c[2]=u,c[3]=n,c[4]=r):(n=c[3],r=c[4]),(0,l.useEffect)(n,r),c[5]!==u?(o=()=>{if(u.size){let e=setInterval(()=>{let e=new Set;for(let t of u)t&&"closed"in t&&t.closed&&e.add(t);e.size&&p(t=>{let n=new Set(t);for(let t of e)n.delete(t);return n})},d.M);return()=>{clearInterval(e)}}},a=[u],c[5]=u,c[6]=o,c[7]=a):(o=c[6],a=c[7]),(0,l.useEffect)(o,a),c[8]!==u?(s={popups:u,open:f},c[8]=u,c[9]=s):s=c[9],s})(M),eg="loading"===en.iframe.status;(0,l.useEffect)(()=>{let e=T.current?.contentWindow;if(!e||eg)return;let t=(0,f.dK)({targetOrigin:I});return t.addTarget(e),B(t),()=>{t.destroy(),B(void 0)}},[I,eg]);let ey=(0,x.J)((e,t,n)=>et(e,t,n));(0,l.useEffect)(()=>{if(!M)return;let e=M.createChannel({name:"presentation",heartbeat:!0,connectTo:"visual-editing"},(0,f.e3)().provide({actors:(0,m.jF)()}));e.on("visual-editing/focus",e=>{"id"in e&&ey({type:e.type,id:e.id,path:e.path})}),e.on("visual-editing/navigate",e=>{let{title:t,url:n}=e;if(K.current.url!==n)try{let[e,t]=n.split("?"),r=new URLSearchParams(t);r.delete(o.tt),r.delete(o.c4),ey({},{preview:`${e}${r.size>0?"?":""}${r}`})}catch{ey({},{preview:n})}K.current={title:t,url:n}}),e.on("visual-editing/meta",e=>{K.current.title=e.title}),e.on("visual-editing/toggle",e=>{er({type:d.u5,enabled:e.enabled})}),e.on("visual-editing/documents",e=>{ea("visual-editing",e.perspective,e.documents)}),e.on("visual-editing/refreshing",e=>{"manual"===e.source?clearTimeout(e$.current):"mutation"===e.source&&er({type:d.iY})}),e.on("visual-editing/refreshed",()=>{er({type:d.cr})}),e.onStatus(ep);let t=e.start();return H(e),()=>{t(),H(null)}},[M,ea,ep,I]),(0,l.useEffect)(()=>{if(!M)return;let e=M.createChannel({name:"presentation",connectTo:"preview-kit",heartbeat:!0},(0,f.e3)().provide({actors:(0,m.jF)()}));return e.onStatus(ev),e.on("preview-kit/documents",e=>{e.projectId===es&&e.dataset===el&&ea("preview-kit",e.perspective,e.documents)}),e.start()},[M,el,es,ea,ev,I]);let eb=(0,l.useCallback)(e=>{et({path:p.C.toString(e)},{},!0)},[et]),ew=(0,l.useCallback)(e=>{let t=new URL(e,z.origin),n=t.pathname+t.search;t.origin===z.origin&&n!==X.preview&&et({},{preview:n})},[z,X,et]),ej=(0,l.useCallback)(e=>{et({},e)},[et]);(0,l.useEffect)(()=>{X.id&&X.path?F?.post("presentation/focus",{id:X.id,path:X.path}):F?.post("presentation/blur")},[X.id,X.path,F]),(0,l.useEffect)(()=>{K.current.url&&X.preview&&K.current.url!==X.preview&&(K.current.url=X.preview,"connected"!==ed&&T.current?T.current.src=`${I}${X.preview}`:F?.post("presentation/navigate",{url:X.preview,type:"replace"}))},[ed,I,X.preview,F]);let e_=(0,l.useCallback)(()=>F?.post("presentation/toggle-overlay"),[F]),[eS,eE]=(0,l.useState)(null);(0,l.useEffect)(()=>{let e=e=>{tk(e)&&e_()},t=e=>{var t,n;tk(e)&&e_(),t=["mod","\\"],n=e,t.every(e=>tC[e]?n[tC[e]]:n.key===e.toUpperCase())&&e_()};return window.addEventListener("keydown",t),window.addEventListener("keyup",e),()=>{window.removeEventListener("keydown",t),window.removeEventListener("keyup",e)}},[e_]);let[eP,ek]=(0,l.useState)(null),[{navigatorEnabled:eC,toggleNavigator:eR},ez]=function(e){let t,n,o,a,s=(0,i.c)(11),{unstable_navigator:c}=e,u=!!c?.component,[d,p]=function(e,t){let n,r,o,a,s=(0,i.c)(9);s[0]!==t||s[1]!==e?(n=()=>JSON.parse(localStorage.getItem(e)??JSON.stringify(t)),s[0]=t,s[1]=e,s[2]=n):n=s[2];let[c,u]=(0,l.useState)(n);return s[3]!==e||s[4]!==c?(r=()=>{localStorage.setItem(e,JSON.stringify(c))},o=[e,c],s[3]=e,s[4]=c,s[5]=r,s[6]=o):(r=s[5],o=s[6]),(0,l.useEffect)(r,o),s[7]!==c?(a=[c,u],s[7]=c,s[8]=a):a=s[8],a}("presentation/navigator",u),f=!!u&&d;e:{let e;if(!u){t=void 0;break e}s[0]!==p?(e=()=>p(eU),s[0]=p,s[1]=e):e=s[1],t=e}let m=t;s[2]!==f||s[3]!==c?(n=function(){return(0,r.jsx)(r.Fragment,{children:f&&(0,r.jsx)(eY,{...c})})},s[2]=f,s[3]=c,s[4]=n):n=s[4];let h=n;return s[5]!==f||s[6]!==m?(o={navigatorEnabled:f,toggleNavigator:m},s[5]=f,s[6]=m,s[7]=o):o=s[7],s[8]!==h||s[9]!==o?(a=[o,h],s[8]=h,s[9]=o,s[10]=a):a=s[10],a}({unstable_navigator:w}),e$=(0,l.useRef)(void 0),eA=(0,l.useCallback)(e=>{if(er({type:d.iY}
86),F){e$.current=window.setTimeout(e,300),F.post("presentation/refresh",{source:"manual",livePreviewEnabled:"connected"===eh||"connected"===ef});return}e()},[ef,eh,F]),eI=(0,u.hA9)(),eT=(0,l.useCallback)(({id:e,type:t,path:n})=>{if(K.current.url)return{title:K.current.title||K.current.url,name:"edit",params:{id:e,path:n,type:t,inspect:u.nHq,workspace:eI.name,mode:d.cc,preview:X.preview}}},[X.preview,eI.name]),eM=(0,l.useCallback)(e=>{et({},{viewport:"desktop"===e?void 0:"mobile"},!0)},[et]);return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(eN,{devMode:A,name:b,navigate:et,params:X,searchParams:G,structureParams:ee,children:(0,r.jsx)(eO,{navigate:et,children:(0,r.jsx)(eB,{params:X,children:(0,r.jsx)(V,{comlink:F,children:(0,r.jsx)(tE,{"data-testid":"presentation-root",height:"fill",children:(0,r.jsxs)(ec,{children:[(0,r.jsx)(ez,{}),(0,r.jsx)(J,{id:"preview",minWidth:325,defaultSize:eC?50:75,order:3,children:(0,r.jsx)(a.so,{direction:"column",flex:1,height:"fill",ref:ek,children:(0,r.jsx)(a.EZ,{element:eP,children:(0,r.jsx)(e4,{canSharePreviewAccess:$,canToggleSharePreviewAccess:n,canUseSharedPreviewAccess:s,dispatch:er,header:j,iframe:en.iframe,initialUrl:z,loadersConnection:ef,navigatorEnabled:eC,onPathChange:ew,onRefresh:eA,openPopup:ex,overlaysConnection:ed,previewUrl:X.preview,perspective:R,ref:T,setViewport:eM,targetOrigin:I,toggleNavigator:eR,toggleOverlay:e_,viewport:ei,visualEditing:en.visualEditing,vercelProtectionBypass:v},I)})})}),(0,r.jsx)(eL,{documentId:X.id,documentsOnPage:eo,documentType:X.type,getCommentIntent:eT,mainDocumentState:eu,onFocusPath:eb,onStructureParams:ej,searchParams:G,setDisplayedDocument:eE,structureParams:ee})]})})})})})}),(0,r.jsxs)(l.Suspense,{children:[M&&(0,r.jsx)(tg,{controller:M,perspective:R,liveDocument:eS,onDocumentsOnPage:ea,onLoadersConnection:em}),F&&X.id&&X.type&&(0,r.jsx)(tb,{comlink:F,id:X.id,type:X.type,loadersConnection:ef,previewKitConnection:eh}),F&&(0,r.jsx)(t_,{comlink:F,perspective:R}),F&&eo.length>0&&(0,r.jsx)(tj,{comlink:F,perspective:R,refs:eo}),F&&(0,r.jsx)(ty,{comlink:F,perspective:R}),F&&(0,r.jsx)(D,{comlink:F}),F&&(0,r.jsx)(tw,{comlink:F,perspective:R}),F&&(0,r.jsx)(tS,{comlink:F})]})]})}function tk(e){return"Alt"===e.key}let tC={alt:"altKey",ctrl:"ctrlKey",mod:"u">typeof window&&/Mac|iPod|iPhone|iPad/.test(window.navigator.platform)?"metaKey":"ctrlKey",shift:"shiftKey"};function tR(){return"ready"}function tz(e){let t,n,a,p,f,m=(0,i.c)(17),{t:h}=(0,u.Bdt)(d.Yi),{previewUrl:v}=e.tool.options??{},{push:x}=(0,s.dj)(),g="object"==typeof v||"function"==typeof v,y=(0,u.E9)(),[b,w]=(0,l.useState)(null),[j,_]=(0,l.useState)(null),[S,E]=(0,l.useState)(null),[P,k]=(0,l.useState)(null);m[0]!==y||m[1]!==g?(t=()=>{if(!g)return;let e=y.checkDocumentPermission("create",{_id:o.YL,_type:o.dR}).subscribe(w),t=y.checkDocumentPermission("update",{_id:o.YL,_type:o.dR}).subscribe(_),n=y.checkDocumentPermission("read",{_id:o.YL,_type:o.dR}).subscribe(E),r=y.checkDocumentPermission("create",{_id:`drafts.${(0,c.A)()}`,_type:o.uf}).subscribe(k);return()=>{e.unsubscribe(),t.unsubscribe(),n.unsubscribe(),r.unsubscribe()}},n=[y,g],m[0]=y,m[1]=g,m[2]=t,m[3]=n):(t=m[2],n=m[3]),(0,l.useEffect)(t,n);let C=P?.granted;m[4]!==C||m[5]!==x||m[6]!==h||m[7]!==g?(a=()=>{if(!g||!1!==C)return;let e=requestAnimationFrame(()=>x({closable:!0,status:"error",duration:3e4,title:h("preview-url-secret.missing-grants")}));return()=>cancelAnimationFrame(e)},p=[C,x,h,g],m[4]=C,m[5]=x,m[6]=h,m[7]=g,m[8]=a,m[9]=p):(a=m[8],p=m[9]),(0,l.useEffect)(a,p);let[R,z]=function(){let e,t,n,r,a=(0,i.c)(7);a[0]===Symbol.for("react.memo_cache_sentinel")?(e={apiVersion:d.mG},a[0]=e):e=a[0];let s=(0,u.tH7)(e),[c,p]=(0,l.useReducer)(tR,"loading"),[f,m]=(0,l.useState)(null);return a[1]!==s?(t=()=>{let e=function(e,t){let n=new AbortController,r=[];async function i(n,i){let{result:a,syncTags:s}=await e.fetch(o.lj,{},{filterResponse:!1,lastLiveEventId:n,tag:"preview-url-secret.fetch-vercel-bypass-protection-secret"});Array.isArray(s)&&(r=s),i.aborted||t(a)}let a=e.live.events().subscribe({next:e=>{"message"===e.type&&(n.abort(),n=new AbortController,e.tags.some(e=>r.includes(e))&&i(e.id,n.signal))},error:e=>console.error(e)});return i(null,n.signal),()=>{a.unsubscribe(),n.abort()}}(s,e=>{m(e),p()});return()=>e()},n=[s],a[1]=s,a[2]=t,a[3]=n):(t=a[2],n=a[3]),(0,l.useEffect)(t,n),a[4]!==c||a[5]!==f?(r=[f,c],a[4]=c,a[5]=f,a[6]=r):r=a[6],r}();if("loading"===z||g&&(!b||typeof b.granted>"u"||!j||typeof j.granted>"u"||!P||!S||typeof S.granted>"u"||typeof P.granted>"u")){let e;return m[10]===Symbol.for("react.memo_cache_sentinel")?(e=(0,r.jsx)(d.gu,{}),m[10]=e):e=m[10],e}let $=!0===C,A=b?.granted===!0&&j?.granted===!0,I=S?.granted===!0;return m[11]!==e||m[12]!==$||m[13]!==A||m[14]!==I||m[15]!==R?(f=(0,r.jsx)(tP,{...e,vercelProtectionBypass:R,canCreateUrlPreviewSecrets:$,canToggleSharePreviewAccess:A,canUseSharedPreviewAccess:I}
86),m[11]=e,m[12]=$,m[13]=A,m[14]=I,m[15]=R,m[16]=f):f=m[16],f}},49047:(e,t,n)=>{n.d(t,{C:()=>c,w:()=>l});var r=n(47425),i=n(8890),o=n(53002),a=n(69733),s=n(81612);function c(e){let t,n,c,l,u=(0,i.c)(9),{children:d,setDisplayedDocument:p,documentId:f}=e;u[0]!==p?(t=e=>p(t=>o(t,e)?t:e),u[0]=p,u[1]=t):t=u[1];let m=t;return u[2]!==f||u[3]!==p?(n=()=>{if(f)return;let e=setTimeout(()=>p(null));return()=>clearTimeout(e)},c=[f,p],u[2]=f,u[3]=p,u[4]=n,u[5]=c):(n=u[4],c=u[5]),(0,a.useEffect)(n,c),u[6]!==d||u[7]!==m?(l=(0,r.jsx)(s.Af.Provider,{value:m,children:d}),u[6]=d,u[7]=m,u[8]=l):l=u[8],l}function l(){return(0,a.useContext)(s.Af)}},53002:e=>{e.exports=function e(t,n){if(t===n)return!0;if(t&&n&&"object"==typeof t&&"object"==typeof n){if(t.constructor!==n.constructor)return!1;if(Array.isArray(t)){if((r=t.length)!=n.length)return!1;for(i=r;0!=i--;)if(!e(t[i],n[i]))return!1;return!0}if(t.constructor===RegExp)return t.source===n.source&&t.flags===n.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===n.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===n.toString();if((r=(o=Object.keys(t)).length)!==Object.keys(n).length)return!1;for(i=r;0!=i--;)if(!Object.prototype.hasOwnProperty.call(n,o[i]))return!1;for(i=r;0!=i--;){var r,i,o,a=o[i];if(!e(t[a],n[a]))return!1}return!0}return t!=t&&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.