1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1535],{38989:(e,t,n)=>{let i;n.r(t),n.d(t,{BackLink:()=>t$,ChildLink:()=>tQ,ConfirmDeleteDialogContainer:()=>nr,DocumentInspectorHeader:()=>iW,DocumentPane:()=>oF,DocumentPaneProviderWrapper:()=>oZ,LOADING_PANE:()=>lJ,LoadingPane:()=>iT,Pane:()=>nc,PaneContainer:()=>aP,PaneContent:()=>nm,PaneHeader:()=>nP,PaneHeaderActions:()=>nq,PaneItem:()=>n2,PaneLayout:()=>nO,ParameterizedLink:()=>tq,ReferenceChildLink:()=>tX,_DEBUG:()=>lK,pane:()=>sj,pane$1:()=>sy,setActivePanes:()=>aD,structureTool:()=>sb,useDocumentPane:()=>iP,useDocumentTitle:()=>iN,usePane:()=>np,usePaneLayout:()=>tG,usePaneOptions:()=>oJ,usePaneRouter:()=>t0,useStructureTool:()=>iB});var l=n(28888),r=n(37309),o=n(22491),a=n(37876),s=n(78296),d=n(35617),c=n(21996),u=n(14232),p=n(68439),m=n(97629),h=n(64006),f=n(27278),x=n(91423),v=n(5646),g=n(22902),b=n(24827),j=n(75784),y=n(75308),_=n(31183),w=n(74023),S=n(9443),k=n(73148),C=n(84757),E=n(89449),I=n(67413),z=n(80662),T=n(42164),P=n(67742),A=n(23038),R=n(13028),D=n(34920),M=n(41715),B=n(74060),Y=n(51629),L=n(78264),O=n(5568),H=n(396),V=n(238),N=n(18422),Z=n(94179),F=n(50541),K=n(2529),W=n(91804),J=n(92886),U=n(77733),$=n(48615),G=n(36375),Q=n(51532),q=n(62941),X=n(57410),ee=n(51161),et=n(41366),en=n(19376),ei=n(40655),el=n(19675),er=n(64246),eo=n(99817),ea=n(72407),es=n(97699),ed=n(39341),ec=n(58465),eu=n(440),ep=n(24088),em=n(17230),eh=n(72927),ef=n(17766),ex=n(59642),ev=n(41301),eg=n(69773),eb=n(89630),ej=n(30139),ey=n(41946),e_=n(89561),ew=n(25702),eS=n(22644),ek=n(25237),eC=n(231),eE=n(47829),eI=n(98527),ez=n(94098),eT=n(27459),eP=n(32653);function eA(){let e=(0,l._)(["\n margin-left: auto;\n"]);return eA=function(){return e},e}function eR(){let e=(0,l._)(["\n flex: none;\n\n &[open] "," {\n transform: rotate(180deg);\n }\n"]);return eR=function(){return e},e}function eD(){let e=(0,l._)(["\n list-style: none;\n\n &::-webkit-details-marker {\n display: none;\n }\n"]);return eD=function(){return e},e}function eM(){let e=(0,l._)(["\n width: 100%;\n text-align: left;\n padding: 0 ",";\n border-collapse: collapse;\n\n th {\n padding: ",";\n }\n\n td {\n padding: 0 ",";\n }\n\n tr > *:last-child {\n text-align: right;\n }\n"]);return eM=function(){return e},e}function eB(){let e=(0,l._)(["\n min-height: 33px;\n"]);return eB=function(){return e},e}function eY(){let e=(0,l._)(["\n box-sizing: border-box;\n"]);return eY=function(){return e},e}function eL(){let e=(0,l._)(["\n height: 110px;\n"]);return eL=function(){return e},e}function eO(){let e=(0,l._)(["\n position: relative;\n width: 1px;\n min-width: 1px;\n\n &:before {\n content: '';\n display: block;\n position: absolute;\n top: 0;\n left: 0;\n bottom: 0;\n width: 1px;\n background-color: var(--card-border-color);\n }\n\n &:not([data-disabled]) {\n cursor: ew-resize;\n width: 9px;\n min-width: 9px;\n margin: 0 -4px;\n\n &:before {\n left: 4px;\n }\n\n &:after {\n content: '';\n display: block;\n position: absolute;\n top: 0;\n left: 0;\n width: 9px;\n bottom: 0;\n background-color: var(--card-border-color);\n opacity: 0;\n transition: opacity 150ms;\n }\n\n &[data-dragging]:after,\n &:hover:after {\n opacity: 0.2;\n }\n }\n"]);return eO=function(){return e},e}function eH(){let e=(0,l._)(["\n outline: none;\n\n // NOTE: This will render a border to the right side of each pane\n // without taking up physical space.\n box-shadow: 1px 0 0 var(--card-border-color);\n"]);return eH=function(){return e},e}function eV(){let e=(0,l._)(["\n position: relative;\n outline: none;\n"]);return eV=function(){return e},e}function eN(){let e=(0,l._)(["\n position: sticky;\n bottom: 0;\n"]);return eN=function(){return e},e}function eZ(){let e=(0,l._)(["\n padding-bottom: env(safe-area-inset-bottom);\n"]);return eZ=function(){return e},e}function eF(){let e=(0,l._)(["\n line-height: 0;\n position: sticky;\n top: 0;\n\n &:not([data-collapsed]):after {\n content: '';\n display: block;\n position: absolute;\n left: 0;\n right: 0;\n bottom: -1px;\n border-bottom: 1px solid ",";\n opacity: 1;\n }\n "]);return eF=function(){return e},e}function eK(){let e=(0,l._)(["\n transform-origin: calc(51px / 2);\n\n [data-collapsed] > div > & {\n transform: rotate(90deg);\n }\n"]);return eK=function(){return e},e}function eW(){let e=(0,l._)(["\n background-color: ",";\n\n [data-ui='Text'] {\n color: ",";\n }\n "]);return eW=function(){return e},e}function eJ(){let e=(0,l._)(["\n width: 66%;\n max-width: 175px;\n"]);return eJ=function(){return e},e}function eU(){let e=(0,l._)(["\n cursor: default;\n outline: none;\n"]);return eU=function(){return e},e}function e$(){let e=(0,l._)(["\n transition: opacity 200ms;\n position: relative;\n z-index: 1;\n padding-left: env(safe-area-inset-left);\n padding-right: env(safe-area-inset-right);\n opacity: 0;\n\n &:not([hidden]) {\n display: flex;\n }\n\n &:not([data-collapsed]) {\n overflow: auto;\n }\n\n &[data-mounted] {\n opacity: 1;\n }\n\n &[data-resizing] {\n pointer-events: none;\n }\n"]);return e$=function(){return e},e}function eG(){let e=(0,l._)(["\n display: grid;\n grid-area: header;\n grid-template-columns: 1fr min-content 1fr;\n border-block-end: 1px solid var(--card-border-color);\n"]);return eG=function(){return e},e}function eQ(){let e=(0,l._)(["\n display: flex;\n justify-content: space-between;\n align-items: center;\n"]);return eQ=function(){return e},e}function eq(){let e=(0,l._)(["\n --offset-block: 40px;\n display: grid;\n height: calc(100vh - var(--offset-block));\n min-height: 0;\n overflow: hidden;\n grid-template-areas:\n 'header header'\n 'previous-document next-document';\n grid-template-columns: 1fr 1fr;\n grid-template-rows: min-content minmax(0, 1fr);\n"]);return eq=function(){return e},e}function eX(){let e=(0,l._)(["\n position: relative;\n height: 100%;\n overflow: auto;\n scroll-behavior: smooth;\n scrollbar-width: var(--scrollbar-width);\n overscroll-behavior: contain;\n will-change: scroll-position;\n"]);return eX=function(){return e},e}function e0(){let e=(0,l._)(["\n position: relative;\n grid-area: var(--grid-area);\n"]);return e0=function(){return e},e}function e1(){let e=(0,l._)(["\n width: auto;\n"]);return e1=function(){return e},e}function e2(){let e=(0,l._)(["\n flex: 1;\n text-decoration: none;\n color: inherit;\n"]);return e2=function(){return e},e}function e3(){let e=(0,l._)(["\n opacity: 0;\n transition: opacity 200ms;\n\n &[data-mounted] {\n opacity: 1;\n }\n"]);return e3=function(){return e},e}function e4(){let e=(0,l._)(["\n & .json-inspector,\n & .json-inspector .json-inspector__selection {\n font-family: ",";\n font-size: ","px;\n line-height: ","px;\n color: var(--card-code-fg-color);\n }\n\n & .json-inspector .json-inspector__leaf {\n padding-left: ",";\n }\n\n & .json-inspector .json-inspector__leaf.json-inspector__leaf_root {\n padding-top: ",";\n padding-left: 0;\n }\n\n & .json-inspector > .json-inspector__leaf_root > .json-inspector__line > .json-inspector__key {\n display: none;\n }\n\n & .json-inspector .json-inspector__line {\n display: block;\n position: relative;\n cursor: default;\n }\n\n & .json-inspector .json-inspector__line::after {\n content: '';\n position: absolute;\n top: 0;\n left: -200px;\n right: -50px;\n bottom: 0;\n z-index: -1;\n pointer-events: none;\n }\n\n & .json-inspector .json-inspector__line:hover::after {\n background: var(--card-code-bg-color);\n }\n\n & .json-inspector .json-inspector__leaf_composite > .json-inspector__line {\n cursor: pointer;\n }\n\n & .json-inspector .json-inspector__leaf_composite > .json-inspector__line::before {\n content: '⸠';\n margin-left: calc(0 - "," + 3px);\n font-size: ","px;\n line-height: ","px;\n }\n\n &\n .json-inspector\n .json-inspector__leaf_expanded.json-inspector__leaf_composite\n > .json-inspector__line::before {\n content: 'â¾ ';\n font-size: ","px;\n line-height: ","px;\n }\n\n & .json-inspector .json-inspector__radio,\n & .json-inspector .json-inspector__flatpath {\n display: none;\n }\n\n & .json-inspector .json-inspector__value {\n margin-left: ",";\n }\n\n &\n .json-inspector\n > .json-inspector__leaf_root\n > .json-inspector__line\n > .json-inspector__key\n + .json-inspector__value {\n margin: 0;\n }\n\n & .json-inspector .json-inspector__key {\n color: ",";\n }\n\n & .json-inspector .json-inspector__value_helper,\n & .json-inspector .json-inspector__value_null {\n color: ",";\n }\n\n & .json-inspector .json-inspector__not-found {\n padding-top: ",";\n }\n\n & .json-inspector .json-inspector__value_string {\n color: ",";\n }\n\n & .json-inspector .json-inspector__value_boolean {\n color: ",";\n }\n\n & .json-inspector .json-inspector__value_number {\n color: ",";\n }\n\n & .json-inspector .json-inspector__show-original {\n display: inline-block;\n padding: 0 6px;\n cursor: pointer;\n }\n\n & .json-inspector .json-inspector__show-original:hover {\n color: inherit;\n }\n\n & .json-inspector .json-inspector__show-original::before {\n content: 'â';\n }\n\n & .json-inspector .json-inspector__show-original:hover::after {\n content: ' expand';\n }\n "]);return e4=function(){return e},e}function e5(){let e=(0,l._)(["\n box-sizing: border-box;\n"]);return e5=function(){return e},e}function e6(){let e=(0,l._)(["\n height: 110px;\n"]);return e6=function(){return e},e}function e7(){let e=(0,l._)(["\n object-fit: cover;\n width: 100%;\n height: 100%;\n height: 180px;\n display: flex;\n"]);return e7=function(){return e},e}function e8(){let e=(0,l._)(["\n @supports not (container-type: inline-size) {\n display: none !important;\n }\n\n container-type: inline-size;\n\n [data-heading] {\n font-size: ","px;\n line-height: ","px;\n overflow-wrap: break-word;\n text-wrap: pretty;\n }\n\n @container (max-width: 560px) {\n [data-heading] {\n font-size: ","px;\n line-height: ","px;\n }\n }\n\n @container (max-width: 420px) {\n [data-heading] {\n font-size: ","px;\n line-height: ","px;\n }\n }\n "]);return e8=function(){return e},e}function e9(){let e=(0,l._)(["\n ","\n"]);return e9=function(){return e},e}function te(){let e=(0,l._)(["\n height: 100%;\n overflow: auto;\n position: relative;\n scroll-behavior: smooth;\n outline: none;\n "]);return te=function(){return e},e}function tt(){let e=(0,l._)(["\n &::after {\n content: '';\n display: block;\n position: absolute;\n top: 0;\n right: 0;\n bottom: 0;\n width: 150px;\n background: linear-gradient(to right, ",", var(--card-bg-color));\n transition: 'opacity 300ms ease-out';\n pointer-events: none;\n }\n "]);return tt=function(){return e},e}function tn(){let e=(0,l._)(["\n scrollbar-width: none;\n z-index: 1;\n flex: 1;\n position: relative;\n > div {\n &::-webkit-scrollbar {\n width: 0;\n height: 0;\n }\n }\n\n ","\n "]);return tn=function(){return e},e}function ti(){let e=(0,l._)(["\n transition: transform 200ms;\n &[data-expanded='true'] {\n transform: rotate(-90deg);\n }\n"]);return ti=function(){return e},e}function tl(){let e=(0,l._)(["\n max-width: 200px;\n"]);return tl=function(){return e},e}function tr(){let e=(0,l._)(["\n max-height: ",";\n min-width: 244px;\n"]);return tr=function(){return e},e}function to(){let e=(0,l._)(["\n opacity: 1;\n pointer-events: auto;\n "]);return to=function(){return e},e}function ta(){let e=(0,l._)(["\n opacity: 0;\n pointer-events: none;\n transition: opacity 0.2s;\n\n ","\n "]);return ta=function(){return e},e}function ts(){let e=(0,l._)(["\n --card-icon-color: ",";\n background-color: ",";\n box-shadow: 0 0 0 1px var(--card-bg-color);\n\n position: absolute;\n width: ","px;\n height: ","px;\n right: -3px;\n bottom: -3px;\n border-radius: 50%;\n "]);return ts=function(){return e},e}function td(){let e=(0,l._)(["\n width: 6ch;\n height: ","px;\n "]);return td=function(){return e},e}function tc(){let e=(0,l._)(["\n overflow: hidden;\n overflow: clip;\n"]);return tc=function(){return e},e}function tu(){let e=(0,l._)(["\n transform-origin: center;\n"]);return tu=function(){return e},e}function tp(){let e=(0,l._)(["\n 0% {\n transform: rotate(0);\n }\n 100% {\n transform: rotate(360deg);\n }\n"]);return tp=function(){return e},e}function tm(){let e=(0,l._)(["\n transform-origin: center;\n\n &[data-rotate] {\n animation: "," 1s ease-in-out infinite;\n }\n"]);return tm=function(){return e},e}function th(){let e=(0,l._)(["\n color: var(--card-muted-fg-color);\n\n em {\n color: var(--card-fg-color);\n font-weight: 500;\n font-style: normal;\n }\n"]);return th=function(){return e},e}function tf(){let e=(0,l._)(["\n flex: 1;\n display: flex;\n flex-direction: column;\n min-height: 0;\n min-width: 0;\n"]);return tf=function(){return e},e}function tx(){let e=(0,l._)(["\n position: relative;\n opacity: ",";\n transition: opacity 0.4s;\n"]);return tx=function(){return e},e}function tv(){let e=(0,l._)(["\n position: absolute;\n left: 0;\n right: 0;\n top: 0;\n bottom: 0;\n"]);return tv=function(){return e},e}function tg(){let e=(0,l._)(["\n from {\n transform: rotate(0deg);\n }\n to {\n transform: rotate(360deg);\n }\n"]);return tg=function(){return e},e}function tb(){let e=(0,l._)(["\n 0% {\n opacity: 0;\n }\n 50% {\n opacity: 0.1;\n }\n 100% {\n opacity: 0.4;\n }\n"]);return tb=function(){return e},e}function tj(){let e=(0,l._)(["\n animation: "," 500ms linear infinite;\n"]);return tj=function(){return e},e}function ty(){let e=(0,l._)(["\n animation: "," 1500ms linear infinite;\n opacity: 0.4;\n"]);return ty=function(){return e},e}function t_(){let e=(0,l._)(["\n animation:\n "," 1500ms linear infinite,\n "," 1000ms linear;\n opacity: 0.4;\n"]);return t_=function(){return e},e}function tw(){let e=(0,l._)(["\n display: flex;\n overflow: hidden;\n box-sizing: border-box;\n width: ","px;\n border-top: 1px solid var(--card-border-color);\n background-color: var(--card-bg-color);\n"]);return tw=function(){return e},e}function tS(){let e=(0,l._)(["\n position: sticky;\n z-index: 2;\n"]);return tS=function(){return e},e}function tk(){let e=(0,l._)(["\n flex-shrink: 0;\n"]);return tk=function(){return e},e}function tC(){let e=(0,l._)(["\n margin: 16px;\n z-index: 1;\n padding: 22px 0px;\n border-top: 1px solid var(--card-border-color);\n background-color: var(--card-badge-default-bg-color);\n box-sizing: border-box;\n text-align: left;\n width: ","px;\n max-width: ","px;\n"]);return tC=function(){return e},e}function tE(){let e=(0,l._)(["\n position: sticky;\n z-index: 2;\n"]);return tE=function(){return e},e}function tI(){let e=(0,l._)(["\n visibility: hidden;\n\n ",":hover & {\n visibility: visible;\n }\n"]);return tI=function(){return e},e}function tz(){let e=(0,l._)(["\n height: 100%;\n"]);return tz=function(){return e},e}function tT(){let e=(0,l._)(["\n overflow: auto; //our scrollable table container\n position: relative; //needed for sticky header\n"]);return tT=function(){return e},e}function tP(){let e=(0,l._)(["\n border-collapse: separate;\n border-spacing: 0;\n font-family: arial, sans-serif;\n white-space: nowrap;\n width: 100%;\n border: 1px solid lightgray;\n\n thead {\n display: grid;\n position: sticky;\n top: 0;\n z-index: 10;\n }\n tr {\n padding: 0;\n }\n tr:last-child {\n border-bottom: none;\n }\n"]);return tP=function(){ret
1urn e},e}function tA(){let e=(0,l._)(["\n height: 100%;\n overflow: auto;\n position: relative;\n scroll-behavior: smooth;\n"]);return tA=function(){return e},e}function tR(){let e=(0,l._)(["\n &:not([hidden]) {\n display: grid;\n }\n grid-template-columns: 48px 1fr;\n align-items: center;\n gap: 0.25em;\n"]);return tR=function(){return e},e}function tD(){let e=(0,l._)(["\n overflow: hidden;\n overflow: clip;\n"]);return tD=function(){return e},e}function tM(){let e=(0,l._)(["\n height: 100%;\n overflow: auto;\n position: relative;\n scroll-behavior: smooth;\n"]);return tM=function(){return e},e}function tB(){let e=(0,l._)(["\n &:not([hidden]) {\n display: grid;\n }\n grid-template-columns: 48px 1fr;\n align-items: center;\n gap: 0.25em;\n"]);return tB=function(){return e},e}function tY(){let e=(0,l._)(["\n width: 100%;\n position: absolute;\n bottom: -4px;\n"]);return tY=function(){return e},e}function tL(){let e=(0,l._)(["\n height: 100%;\n overflow: auto;\n position: relative;\n scroll-behavior: smooth;\n"]);return tL=function(){return e},e}function tO(){let e=(0,l._)(["\n height: 100%;\n overflow: auto;\n position: relative;\n scroll-behavior: smooth;\n"]);return tO=function(){return e},e}function tH(){let e=(0,l._)(["\n opacity: 0;\n transition: opacity 200ms;\n &[data-ready] {\n opacity: 1;\n }\n"]);return tH=function(){return e},e}function tV(e){let t,n,i,l,o=(0,s.c)(21),{document:d}=e,c=(0,h.pDY)();o[0]!==d._type||o[1]!==c?(t=c.get(d._type),o[0]=d._type,o[1]=c,o[2]=t):t=o[2];let u=t,{t:p}=(0,h.Bdt)(r.Z7);o[3]!==d||o[4]!==u?(n={schemaType:u,value:d},o[3]=d,o[4]=u,o[5]=n):n=o[5];let{error:m,value:f}=(0,h.MOl)(n);if(!u){let e,t;return o[6]!==d._type||o[7]!==p?(e=p("doc-title.unknown-schema-type.text",{schemaType:d._type}),o[6]=d._type,o[7]=p,o[8]=e):e=o[8],o[9]!==e?(t=(0,a.jsx)("code",{children:e}),o[9]=e,o[10]=t):t=o[10],t}if(m){let e,t;return o[11]!==m.message||o[12]!==p?(e=p("doc-title.error.text",{errorMessage:m.message}),o[11]=m.message,o[12]=p,o[13]=e):e=o[13],o[14]!==e?(t=(0,a.jsx)(a.Fragment,{children:e}),o[14]=e,o[15]=t):t=o[15],t}return o[16]!==p||o[17]!==(null==f?void 0:f.title)?(i=(null==f?void 0:f.title)||(0,a.jsx)("span",{style:{color:"var(--card-muted-fg-color)"},children:p("doc-title.fallback.text")}),o[16]=p,o[17]=null==f?void 0:f.title,o[18]=i):i=o[18],o[19]!==i?(l=(0,a.jsx)(a.Fragment,{children:i}),o[19]=i,o[20]=l):l=o[20],l}let tN=(0,v.I4)(d.az)(eA()),tZ=v.I4.details(eR(),tN),tF=v.I4.summary(eD()),tK=v.I4.table(eM(),e=>{let{theme:t}=e;return(0,d.D0)(t.sanity.space[2])},e=>{let{theme:t}=e;return(0,d.D0)(t.sanity.space[1])},e=>{let{theme:t}=e;return(0,d.D0)(t.sanity.space[1])}),tW=(0,v.I4)(d.so)(eB()),tJ=e=>{let t,n,i,l,c,u,p=(0,s.c)(13),{t:f}=(0,h.Bdt)(r.Z7),x=e.totalCount-e.references.length;return x?(p[0]!==x||p[1]!==f?(t=f("confirm-delete-dialog.other-reference-count.title",{count:x}),p[0]=x,p[1]=f,p[2]=t):t=p[2],p[3]!==t?(n=(0,a.jsx)(d.EY,{size:1,muted:!0,children:t}),p[3]=t,p[4]=n):n=p[4],p[5]!==f?(i=f("confirm-delete-dialog.other-reference-count.tooltip"),p[5]=f,p[6]=i):i=p[6],p[7]===Symbol.for("react.memo_cache_sentinel")?(l=(0,a.jsx)(d.EY,{size:1,muted:!0,children:(0,a.jsx)(m.YzR,{})}),p[7]=l):l=p[7],p[8]!==i?(c=(0,a.jsx)(o.m_,{portal:!0,placement:"top",content:i,children:l}),p[8]=i,p[9]=c):c=p[9],p[10]!==n||p[11]!==c?(u=(0,a.jsx)(d.az,{padding:2,children:(0,a.jsxs)(d.cV,{space:2,children:[n,c]})}),p[10]=n,p[11]=c,p[12]=u):u=p[12],u):null};function tU(e){let t,n,i,l,r,c,u,p=(0,s.c)(27),{icon:m,layout:f,presence:x,schemaType:v,value:g}=e,b=(0,h.r0j)(g._id),{perspectiveStack:j}=(0,h.QO2)();p[0]!==j||p[1]!==e.documentPreviewStore||p[2]!==v||p[3]!==g._id?(n=(0,h.TU6)(e.documentPreviewStore,v,g._id,j),p[0]=j,p[1]=e.documentPreviewStore,p[2]=v,p[3]=g._id,p[4]=n):n=p[4],t=n,p[5]===Symbol.for("react.memo_cache_sentinel")?(i={snapshot:null,isLoading:!0,original:null},p[5]=i):i=p[5];let{snapshot:_,original:w,isLoading:S}=(0,y.J)(t,i);p[6]!==S||p[7]!==x||p[8]!==b.draft||p[9]!==b.published||p[10]!==b.versions?(l=S?null:(0,a.jsx)(o.vE,{children:(0,a.jsxs)(d.so,{align:"center",gap:3,children:[x&&x.length>0&&(0,a.jsx)(h.JEU,{presence:x}),(0,a.jsx)(h.ZDR,{draft:b.draft,published:b.published,versions:b.ver
1sions})]})}),p[6]=S,p[7]=x,p[8]=b.draft,p[9]=b.published,p[10]=b.versions,p[11]=l):l=p[11];let k=l;p[12]!==b.draft||p[13]!==b.published||p[14]!==b.versions?(r=(0,a.jsx)(h.Aii,{draft:b.draft,published:b.published,versions:b.versions}),p[12]=b.draft,p[13]=b.published,p[14]=b.versions,p[15]=r):r=p[15];let C=r;return p[16]!==w||p[17]!==_||p[18]!==g?(c=(0,h.ADU)({snapshot:_,original:w,fallback:g}),p[16]=w,p[17]=_,p[18]=g,p[19]=c):c=p[19],p[20]!==m||p[21]!==S||p[22]!==f||p[23]!==k||p[24]!==c||p[25]!==C?(u=(0,a.jsx)(h.m6P,{...c,isPlaceholder:S,icon:m,layout:f,status:k,tooltip:C}),p[20]=m,p[21]=S,p[22]=f,p[23]=k,p[24]=c,p[25]=C,p[26]=u):u=p[26],u}let t$=(0,u.forwardRef)(function(e,t){let n,i,l,r,o,d=(0,s.c)(9),{routerPanesState:c,groupIndex:m}=(0,u.useContext)(p.l4);return d[0]!==m||d[1]!==c?(i=c.slice(0,m),d[0]=m,d[1]=c,d[2]=i):i=d[2],n=i,d[3]!==n?(r={panes:n},d[3]=n,d[4]=r):r=d[4],l=r,d[5]!==e||d[6]!==t||d[7]!==l?(o=(0,a.jsx)(_.s8,{...e,ref:t,state:l}),d[5]=e,d[6]=t,d[7]=l,d[8]=o):o=d[8],o});function tG(){let e=(0,u.useContext)(p._U);if(!e)throw Error("PaneLayout: missing context value");return e}let tQ=(0,u.forwardRef)(function(e,t){let n,i,l,r,o,d,c=(0,s.c)(19);c[0]!==e?({childId:n,childPayload:l,childParameters:i,...r}=e,c[0]=e,c[1]=n,c[2]=i,c[3]=l,c[4]=r):(n=c[1],i=c[2],l=c[3],r=c[4]);let{routerPanesState:m,groupIndex:h}=(0,u.useContext)(p.l4);if(c[5]!==n||c[6]!==i||c[7]!==l||c[8]!==h||c[9]!==m){let e;c[11]!==n||c[12]!==i||c[13]!==l?(e=[{id:n,params:i,payload:l}],c[11]=n,c[12]=i,c[13]=l,c[14]=e):e=c[14],o={panes:[...m.slice(0,h+1),e]},c[5]=n,c[6]=i,c[7]=l,c[8]=h,c[9]=m,c[10]=o}else o=c[10];return c[15]!==t||c[16]!==r||c[17]!==o?(d=(0,a.jsx)(_.s8,{...r,ref:t,state:o}),c[15]=t,c[16]=r,c[17]=o,c[18]=d):d=c[18],d}),tq=(0,u.forwardRef)(function(e,t){let n,i,l,r,o,d,c,m,f,x=(0,s.c)(22),{routerPanesState:v,groupIndex:g,siblingIndex:b}=(0,u.useContext)(p.l4);x[0]!==e?({params:n,payload:i,...l}=e,x[0]=e,x[1]=n,x[2]=i,x[3]=l):(n=x[1],i=x[2],l=x[3]);let j=(0,h.$6H)(n),y=(0,h.$6H)(i),w=v[g],S=w[b],k=null!=j?j:S.params,C=null!=y?y:S.payload;x[4]!==S||x[5]!==k||x[6]!==C?(o={...S,params:k,payload:C},x[4]=S,x[5]=k,x[6]=C,x[7]=o):o=x[7];let E=o;x[8]!==w||x[9]!==E||x[10]!==b?(d=[...w.slice(0,b),E,...w.slice(b+1)],x[8]=w,x[9]=E,x[10]=b,x[11]=d):d=x[11];let I=d;x[12]!==v||x[13]!==g||x[14]!==I?(c=[...v.slice(0,g),I,...v.slice(g+1)],x[12]=v,x[13]=g,x[14]=I,x[15]=c):c=x[15];let z=c;return x[16]!==z?(m={panes:z},x[16]=z,x[17]=m):m=x[17],r=m,x[18]!==r||x[19]!==t||x[20]!==l?(f=(0,a.jsx)(_.s8,{ref:t,...l,state:r}),x[18]=r,x[19]=t,x[20]=l,x[21]=f):f=x[21],f}),tX=(0,u.forwardRef)(function(e,t){let n,i,l,r,o,d,c,u,p,m,h=(0,s.c)(22);h[0]!==e?({documentId:i,documentType:l,parentRefPath:r,children:n,template:d,...o}=e,h[0]=e,h[1]=n,h[2]=i,h[3]=l,h[4]=r,h[5]=o,h[6]=d):(n=h[1],i=h[2],l=h[3],r=h[4],o=h[5],d=h[6]);let f=null==d?void 0:d.params;return h[7]!==r?(c=(0,S.dI)(r),h[7]=r,h[8]=c):c=h[8],h[9]!==d?(u=d&&{template:null==d?void 0:d.id},h[9]=d,h[10]=u):u=h[10],h[11]!==l||h[12]!==c||h[13]!==u?(p={type:l,parentRefPath:c,...u},h[11]=l,h[12]=c,h[13]=u,h[14]=p):p=h[14],h[15]!==n||h[16]!==i||h[17]!==t||h[18]!==o||h[19]!==f||h[20]!==p?(m=(0,a.jsx)(tQ,{...o,ref:t,childId:i,childPayload:f,childParameters:p,children:n}),h[15]=n,h[16]=i,h[17]=t,h[18]=o,h[19]=f,h[20]=p,h[21]=m):m=h[21],m});function t0(){return(0,u.useContext)(p.l4)}let t1=[];function t2(e){let t,n,i,l,r=(0,s.c)(16),{onClick:o,type:d,value:c}=e,u=null==c?void 0:c._id;r[0]!==u?(t=(0,h.IMx)(u),r[0]=u,r[1]=t):t=r[1];let p=(0,h.cVB)(t),m=(0,h.yKO)(),{ReferenceChildLink:f}=t0();r[2]!==f||r[3]!==(null==d?void 0:d.name)||r[4]!==(null==c?void 0:c._id)?(n=function(e){return(0,a.jsx)(f,{documentId:null==c?void 0:c._id,documentType:null==d?void 0:d.name,parentRefPath:t1,...e})},r[2]=f,r[3]=null==d?void 0:d.name,r[4]=null==c?void 0:c._id,r[5]=n):n=r[5];let x=n,v=null==d?void 0:d.icon,g=(null==p?void 0:p.length)>0?p:t1;return r[6]!==m||r[7]!==v||r[8]!==g||r[9]!==d||r[10]!==c?(i=(0,a.jsx)(tU,{documentPreviewStore:m,icon:v,layout:"compact",presence:g,schemaType:d,value:c}),r[6]=m,r[7]=v,r[8]=g,r[9]=d,r[10]=c,r[11]=i):i=r[11],r[12]!==o||r[13]!==x||r[14]!==i?(l=(0,a.jsx)(h.Ns2,{__unstable_focusRing:!0,as:x,"data-as":"a",onClick:o,radius:2,children:i}),r[12]=o,r[13]=x,r[14]=i,r[15]=l):l=r[15],l}function t3(e){let t,n,i,l,u,p,f,x,v,g,b,j,y,_,w,S,k,C,E,I,z=(0,s.c)(78),{crossDatasetReferences:T,internalReferences:P,documentTitle:A,totalCount:R,action:D,datasetNames:M,hasUnknownDatasetN
1ames:B,onReferenceLinkClick:Y}=e,L=(0,h.pDY)(),O=(0,c.dj)(),{t:H}=(0,h.Bdt)(r.Z7);z[0]!==Y||z[1]!==L||z[2]!==H?(t=e=>{let t=L.get(e._type);return t?(0,a.jsx)(t2,{type:t,value:e,onClick:Y}):(0,a.jsx)(d.az,{padding:2,children:(0,a.jsx)(h.m6P,{icon:m.KSC,title:H("confirm-delete-dialog.preview-item.preview-unavailable.title"),subtitle:H("confirm-delete-dialog.preview-item.preview-unavailable.subtitle",{documentId:e._id}),layout:"default"})})},z[0]=Y,z[1]=L,z[2]=H,z[3]=t):t=z[3];let V=t;if((null==P?void 0:P.totalCount)===0&&(null==T?void 0:T.totalCount)===0){let e,t;return z[4]!==A?(e={DocumentTitle:()=>(0,a.jsx)("strong",{children:A})},z[4]=A,z[5]=e):e=z[5],z[6]!==D||z[7]!==H||z[8]!==e?(t=(0,a.jsx)(d.EY,{as:"p",size:1,children:(0,a.jsx)(h.HTc,{t:H,i18nKey:"confirm-delete-dialog.confirmation.text",context:D,components:e})}),z[6]=D,z[7]=H,z[8]=e,z[9]=t):t=z[9],t}if(z[10]!==D||z[11]!==T||z[12]!==M||z[13]!==A||z[14]!==B||z[15]!==P||z[16]!==V||z[17]!==H||z[18]!==O||z[19]!==R){let e,t,r,s,c=[...M,...B?["unavailable"]:[]],S=H("confirm-delete-dialog.cdr-summary.subtitle",{count:c.length,datasets:c.join(", "),context:B&&c.length?"unavailable":""});l=d.so,w="column",u=4,z[34]===Symbol.for("react.memo_cache_sentinel")?(e=(0,a.jsx)(d.EY,{"aria-hidden":"true",size:1,children:(0,a.jsx)(m.sAQ,{})}),z[34]=e):e=z[34],z[35]!==A?(t={DocumentTitle:()=>A},z[35]=A,z[36]=t):t=z[36],z[37]!==R?(r={count:R},z[37]=R,z[38]=r):r=z[38],z[39]!==H||z[40]!==t||z[41]!==r?(p=(0,a.jsx)(d.Zp,{padding:3,radius:2,tone:"caution",flex:"none",children:(0,a.jsxs)(d.so,{children:[e,(0,a.jsx)(d.az,{flex:1,marginLeft:3,children:(0,a.jsx)(d.EY,{size:1,children:(0,a.jsx)(h.HTc,{i18nKey:"confirm-delete-dialog.referring-document-count.text",components:t,t:H,values:r})})})]})}),z[39]=H,z[40]=t,z[41]=r,z[42]=p):p=z[42],z[43]!==A?(s={DocumentTitle:()=>A},z[43]=A,z[44]=s):s=z[44],z[45]!==D||z[46]!==H||z[47]!==s?(f=(0,a.jsx)(d.az,{flex:"none",children:(0,a.jsx)(d.EY,{size:1,children:(0,a.jsx)(h.HTc,{i18nKey:"confirm-delete-dialog.referring-documents-descriptor.text",t:H,context:D,components:s})})}),z[45]=D,z[46]=H,z[47]=s,z[48]=f):f=z[48],i=d.Zp,b=2,j=1,y="auto",_=2,n=d.so,x="column",z[49]!==P||z[50]!==V?(v=P.totalCount>0&&(0,a.jsxs)(d.BJ,{as:"ul",marginBottom:2,space:2,"data-testid":"internal-references",children:[null==P?void 0:P.references.map(e=>(0,a.jsx)(d.az,{as:"li",children:V(e)},e._id)),P.totalCount>P.references.length&&(0,a.jsx)(d.az,{as:"li",padding:3,children:(0,a.jsx)(tJ,{...P})})]}),z[49]=P,z[50]=V,z[51]=v):v=z[51],g=T.totalCount>0&&(0,a.jsxs)(tZ,{"data-testid":"cross-dataset-references",style:{borderTop:P.totalCount>0?"1px solid var(--card-shadow-outline-color)":void 0},children:[(0,a.jsx)(tF,{children:(0,a.jsx)(d.Zp,{as:"a",marginTop:2*(P.totalCount>0),radius:2,shadow:1,paddingY:1,children:(0,a.jsxs)(d.so,{align:"center",gap:3,paddingX:3,paddingY:1,children:[(0,a.jsx)(d.EY,{size:1,children:(0,a.jsx)(m.So9,{})}),(0,a.jsxs)(d.BJ,{space:2,children:[(0,a.jsx)(d.EY,{textOverflow:"ellipsis",size:1,children:H("confirm-delete-dialog.cdr-summary.title",{count:c.length,documentCount:H("confirm-delete-dialog.cdr-summary.document-count",{count:T.totalCount})})}),(0,a.jsx)(d.EY,{title:S,textOverflow:"ellipsis",size:1,muted:!0,children:S})]}),(0,a.jsx)(tN,{children:(0,a.jsx)(d.EY,{muted:!0,size:1,children:(0,a.jsx)(m.D3D,{})})})]})})}),(0,a.jsxs)(d.az,{overflow:"auto",paddingTop:2,children:[(0,a.jsxs)(tK,{children:[(0,a.jsx)("thead",{children:(0,a.jsxs)("tr",{children:[(0,a.jsx)("th",{children:(0,a.jsx)(d.EY,{muted:!0,size:1,style:{minWidth:"5rem"},weight:"medium",children:H("confirm-delete-dialog.cdr-table.project-id.label")})}),(0,a.jsx)("th",{children:(0,a.jsx)(d.EY,{muted:!0,size:1,weight:"medium",children:H("confirm-delete-dialog.cdr-table.dataset.label")})}),(0,a.jsx)("th",{children:(0,a.jsx)(d.EY,{muted:!0,size:1,weight:"medium",children:H("confirm-delete-dialog.cdr-table.document-id.label")})})]})}),(0,a.jsx)("tbody",{children:T.references.filter(t4).map((e,t)=>{let{projectId:n,datasetName:i,documentId:l}=e;return(0,a.jsxs)("tr",{children:[(0,a.jsx)("td",{children:(0,a.jsx)(d.EY,{size:1,children:n})}),(0,a.jsx)("td",{children:(0,a.jsx)(d.EY,{size:1,children:i||"unavailable"})}),(0,a.jsx)("td",{children:(0,a.jsxs)(tW,{align:"center",gap:2,justify:"flex-end",children:[(0,a.jsx)(d.EY,{textOverflow:"ellipsis",size:1,children:l||"unavailable"}),l&&(0,a.jsx)(o.$n,{mode:"bleed",icon:m.TdU,tooltipProps:{content:H("confirm-delete-dialog.cdr-table.copy-id-button.tooltip")},onClick:()=>{navigator.clipboard.writeText(l).catch(()=>{O.push({status:"error",title:H("confirm-delete-dialog.cdr-table.id-copied-toast.t
1itle-failed")})})}})]})})]},"".concat(l,"-").concat(t))})})]}),(0,a.jsx)(tJ,{...T})]})]}),z[10]=D,z[11]=T,z[12]=M,z[13]=A,z[14]=B,z[15]=P,z[16]=V,z[17]=H,z[18]=O,z[19]=R,z[20]=n,z[21]=i,z[22]=l,z[23]=u,z[24]=p,z[25]=f,z[26]=x,z[27]=v,z[28]=g,z[29]=b,z[30]=j,z[31]=y,z[32]=_,z[33]=w}else n=z[20],i=z[21],l=z[22],u=z[23],p=z[24],f=z[25],x=z[26],v=z[27],g=z[28],b=z[29],j=z[30],y=z[31],_=z[32],w=z[33];return z[52]!==n||z[53]!==x||z[54]!==v||z[55]!==g?(S=(0,a.jsxs)(n,{direction:x,children:[v,g]}),z[52]=n,z[53]=x,z[54]=v,z[55]=g,z[56]=S):S=z[56],z[57]!==i||z[58]!==S||z[59]!==b||z[60]!==j||z[61]!==y||z[62]!==_?(k=(0,a.jsx)(i,{radius:b,shadow:j,flex:y,padding:_,children:S}),z[57]=i,z[58]=S,z[59]=b,z[60]=j,z[61]=y,z[62]=_,z[63]=k):k=z[63],z[64]!==A?(C={DocumentTitle:()=>A},z[64]=A,z[65]=C):C=z[65],z[66]!==D||z[67]!==H||z[68]!==C?(E=(0,a.jsx)(d.az,{flex:"none",children:(0,a.jsx)(d.EY,{size:1,children:(0,a.jsx)(h.HTc,{i18nKey:"confirm-delete-dialog.referential-integrity-disclaimer.text",t:H,context:D,components:C})})}),z[66]=D,z[67]=H,z[68]=C,z[69]=E):E=z[69],z[70]!==l||z[71]!==u||z[72]!==p||z[73]!==f||z[74]!==k||z[75]!==E||z[76]!==w?(I=(0,a.jsxs)(l,{direction:w,gap:u,children:[p,f,k,E]}),z[70]=l,z[71]=u,z[72]=p,z[73]=f,z[74]=k,z[75]=E,z[76]=w,z[77]=I):I=z[77],I}function t4(e){return"projectId"in e}let t5=()=>(i||(i=(0,k.R)(document,"visibilitychange").pipe((0,D.Z)(null),(0,A.T)(()=>"visible"===document.visibilityState),(0,T.F)(),(0,et.n)(e=>e?(0,C.O)(0,5e3):E.w),(0,en.t)({refCount:!0,bufferSize:1}))),i),t6=(0,h.R11)(e=>{let[t,n]=e;return n.listenQuery({fetch:'{"references":*[references($documentId)][0...100]{_id,_type},"totalCount":count(*[references($documentId)])}',listen:"*[references($documentId)]"},{documentId:t},{tag:"use-referring-documents",transitions:["appear","disappear"],throttleTime:5e3})}),t7=(0,h.R11)(e=>{let[t,n]=e;return t5().pipe((0,et.n)(()=>(function(e,t){let{versionedClient:n}=t;return t5().pipe((0,et.n)(()=>(function(e,t){let{versionedClient:n}=t,i=(0,h.T4)(e),l=(0,h.IMx)(e),r={uri:n.getDataUrl("doc","".concat(i,",").concat(l)),json:!0,query:{excludeContent:"true"},tag:"use-referring-documents.document-existence"};return n.observable.request(r).pipe((0,A.T)(e=>{let{omitted:t}=e,n=t.filter(e=>"existence"===e.reason);if(2!==n.length)return 0===n.length||n.some(e=>e.id===i)?l:i}))})(e,t)),(0,et.n)(e=>{if(!e)return(0,I.of)({totalCount:0,references:[]});let t=n.config().dataset;return n.observable.request({url:"/data/references/".concat(t,"/documents/").concat(e,"/to?excludeInternalReferences=true&excludePaths=true"),tag:"use-referring-documents.external"}).pipe((0,M.W)(e=>{if("object"==typeof e&&e&&"statusCode"in e&&"response"in e&&404===e.statusCode)return(0,I.of)({totalCount:0,references:[]});throw e}))}))})(t,{versionedClient:n})))});function t8(e){return"string"!=typeof e.datasetName}function t9(e){return!!e&&""!==e}function ne(e){return(null==e?void 0:e.datasetName)||""}function nt(e){return e.projectId}let nn=(0,v.I4)(d.az)(eY()),ni=(0,v.I4)(d.so).attrs({align:"center",direction:"column",justify:"center"})(eL());function nl(e){let t,n,i,l,d,c,p,m,f,x,v=(0,s.c)(40),{id:g,type:b,action:j,onCancel:y,onConfirm:_}=e,w=void 0===j?"delete":j,{t:S}=(0,h.Bdt)(r.Z7),k="deletion-confirmation-".concat((0,u.useId)()),{internalReferences:C,crossDatasetReferences:E,isLoading:I,totalCount:z,projectIds:T,datasetNames:P,hasUnknownDatasetNames:A}=function(e){let t,n,i,l,r,o,a,d,c,u=(0,s.c)(24),p=(0,h.tH7)(h.miu),m=(0,h.q3J)();u[0]!==e?(t=(0,h.IMx)(e),u[0]=e,u[1]=t):t=u[1];let f=t;u[2]!==m||u[3]!==f?(n=[f,m],u[2]=m,u[3]=f,u[4]=n):n=u[4];let[x,v]=t6(n);u[5]!==f||u[6]!==p?(i=[f,p],u[5]=f,u[6]=p,u[7]=i):i=u[7];let[g,b]=t7(i);u[8]!==(null==g?void 0:g.references)?(l=()=>Array.from(new Set(null==g?void 0:g.references.map(nt).filter(Boolean))).sort(),u[8]=null==g?void 0:g.references,u[9]=l):l=u[9],u[10]!==l?(r=l(),u[10]=l,u[11]=r):r=u[11];let j=r;u[12]!==(null==g?void 0:g.references)?(a=Array.from(new Set(null==g?void 0:g.references.map(ne).filter(t9))).sort(),u[12]=null==g?void 0:g.references,u[13]=a):a=u[13],o=a,u[14]!==(null==g?void 0:g.references)?(d=()=>!!(null==g?void 0:g.references.some(t8)),u[14]=null==g?void 0:g.references,u[15]=d):d=u[15];let y=d(),_=((null==x?void 0:x.totalCount)||0)+((null==g?void 0:g.totalCount)||0),w=v||b;return u[16]!==g||u[17]!==o||u[18]!==y||u[19]!==x||u[20]!==j||u[21]!==_||u[22]!==w?(c={totalCount:_,projectIds:j,datasetNames:o,hasUnknownDatasetN
1ames:y,internalReferences:x,crossDatasetReferences:g,isLoading:w},u[16]=g,u[17]=o,u[18]=y,u[19]=x,u[20]=j,u[21]=_,u[22]=w,u[23]=c):c=u[23],c}(g);v[0]!==g||v[1]!==b?(n={_id:g,_type:b},v[0]=g,v[1]=b,v[2]=n):n=v[2],t=n,v[3]!==t?(i=(0,a.jsx)(tV,{document:t}),v[3]=t,v[4]=i):i=v[4];let R=i,D=!I;return v[5]!==w||v[6]!==S?(l=S("confirm-delete-dialog.header.text",{context:w}),v[5]=w,v[6]=S,v[7]=l):l=v[7],v[8]!==S?(d=S("confirm-delete-dialog.cancel-button.text"),v[8]=S,v[9]=d):d=v[9],v[10]!==y||v[11]!==d?(c={onClick:y,text:d},v[10]=y,v[11]=d,v[12]=c):c=v[12],v[13]!==w||v[14]!==_||v[15]!==D||v[16]!==S||v[17]!==z?(p=D?{text:S(z>0?"confirm-delete-dialog.confirm-anyway-button.text":"confirm-delete-dialog.confirm-button.text",{context:w}),onClick:_}:void 0,v[13]=w,v[14]=_,v[15]=D,v[16]=S,v[17]=z,v[18]=p):p=v[18],v[19]!==c||v[20]!==p?(m={cancelButton:c,confirmButton:p},v[19]=c,v[20]=p,v[21]=m):m=v[21],v[22]!==w||v[23]!==E||v[24]!==P||v[25]!==R||v[26]!==A||v[27]!==C||v[28]!==I||v[29]!==y||v[30]!==T||v[31]!==S||v[32]!==z?(f=(0,a.jsx)(nn,{children:E&&C&&!I?(0,a.jsx)(t3,{crossDatasetReferences:E,internalReferences:C,documentTitle:R,isLoading:I,totalCount:z,action:w,projectIds:T,datasetNames:P,hasUnknownDatasetNames:A,onReferenceLinkClick:y}):(0,a.jsx)(ni,{"data-testid":"loading-container",children:(0,a.jsx)(h.gd4,{showText:!0,title:S("confirm-delete-dialog.loading.text")})})}),v[22]=w,v[23]=E,v[24]=P,v[25]=R,v[26]=A,v[27]=C,v[28]=I,v[29]=y,v[30]=T,v[31]=S,v[32]=z,v[33]=f):f=v[33],v[34]!==k||v[35]!==y||v[36]!==f||v[37]!==l||v[38]!==m?(x=(0,a.jsx)(o.lG,{width:1,id:k,header:l,footer:m,onClose:y,onClickOutside:y,children:f}),v[34]=k,v[35]=y,v[36]=f,v[37]=l,v[38]=m,v[39]=x):x=v[39],x}function nr(e){let t,n,i=(0,s.c)(6),{t:l}=(0,h.Bdt)(r.Z7),c=(0,u.useId)(),[p,m]=(0,u.useState)(null);i[0]===Symbol.for("react.memo_cache_sentinel")?(t=()=>m(null),i[0]=t):t=i[0];let f=t;return i[1]!==p||i[2]!==c||i[3]!==e||i[4]!==l?(n=p?(0,a.jsx)(o.lG,{id:"dialog-error-".concat(c),"data-testid":"confirm-delete-error-dialog",header:l("confirm-delete-dialog.error.title.text"),footer:{confirmButton:{text:l("confirm-delete-dialog.error.retry-button.text"),onClick:f,tone:"default"}},onClose:e.onCancel,children:(0,a.jsx)(d.az,{padding:4,children:(0,a.jsx)(d.EY,{size:1,children:l("confirm-delete-dialog.error.message.text")})})}):(0,a.jsx)(o.tH,{onCatch:m,children:(0,a.jsx)(nl,{...e})}),i[1]=p,i[2]=c,i[3]=e,i[4]=l,i[5]=n):n=i[5],n}function no(e){let t,n,i,l=(0,s.c)(6),{children:r,ms:o}=e,d=void 0===o?0:o,[c,p]=(0,u.useState)(d<=0);if(l[0]!==d?(t=()=>{if(d<=0)return;let e=setTimeout(()=>p(!0),d);return()=>{clearTimeout(e)}},n=[d],l[0]=d,l[1]=t,l[2]=n):(t=l[1],n=l[2]),(0,u.useEffect)(t,n),!c||!r){let e;return l[3]===Symbol.for("react.memo_cache_sentinel")?(e=(0,a.jsx)(a.Fragment,{}),l[3]=e):e=l[3],e}return l[4]!==r?(i="function"==typeof r?r():r,l[4]=r,l[5]=i):i=l[5],i}let na=(0,v.I4)(d.Wd)(eO());function ns(e){let t,n,i=(0,s.c)(7),{disabled:l,element:r}=e,{resize:o}=tG(),[d,c]=(0,u.useState)(!1);i[0]!==r||i[1]!==o?(t=e=>{if(!r)return;c(!0),e.preventDefault();let t=e.pageX;o("start",r,0);let n=e=>{e.preventDefault(),o("move",r,e.pageX-t)},i=e=>{e.preventDefault(),c(!1),window.removeEventListener("mousemove",n),window.removeEventListener("mouseup",i),o("end",r,0)};window.addEventListener("mousemove",n),window.addEventListener("mouseup",i)},i[0]=r,i[1]=o,i[2]=t):t=i[2];let p=t,m=l?"":void 0,h=d?"":void 0;return i[3]!==p||i[4]!==m||i[5]!==h?(n=(0,a.jsx)(na,{"data-disabled":m,"data-dragging":h,onMouseDown:p}),i[3]=p,i[4]=m,i[5]=h,i[6]=n):n=i[6],n}let nd=(0,v.I4)(d.Zp)(eH()),nc=(0,u.forwardRef)(function(e,t){var n,i,l;let r,o,c,m,f,x,v,g,b,j,y,_,w,S,k,C,E,I,z,T,P,A,R,D,M,B,Y,L,O,H,V,N,Z=(0,s.c)(86);Z[0]!==e?({children:r,currentMinWidth:c,currentMaxWidth:o,flex:g,id:m,minWidth:x,maxWidth:f,selected:b,...v}=e,Z[0]=e,Z[1]=r,Z[2]=o,Z[3]=c,Z[4]=m,Z[5]=f,Z[6]=x,Z[7]=v,Z[8]=g,Z[9]=b):(r=Z[1],o=Z[2],c=Z[3],m=Z[4],f=Z[5],x=Z[6],v=Z[7],g=Z[8],b=Z[9]);let F=void 0===g?1:g,K=void 0!==b&&b,[W,J]=(0,u.useState)(null),{collapse:U,collapsed:$,expand:G,expandedElement:Q,mount:q,panes:X}=tG();if(Z[10]!==X||Z[11]!==W){let e;Z[14]!==W?(e=e=>e.element===W,Z[14]=W,Z[15]=e):e=Z[15],y=(j=X.find(e))&&X.indexOf(j),Z[10]=X,Z[11]=W,Z[12]=j,Z[13]=y}else j=Z[12],y=Z[13];let ee=y,et="number"==typeof ee?X[ee+1]:void 0,en=ee===X.length-1,ei=Q===W,el=!$&&((null==j?void 0:j.collapsed)||!1),er=(null==et?void 0:et.collapsed)||!1,eo=(0,u.useRef)(null),ea=null!=(n=null==j?void 0:j.flex)?n:F,es=null!=(i=null==j?void 0:j.currentMinWidth)?i:c,ed=null!=(l=null==j?void 0:j.currentMaxWidth)?l:o;Z[16]===Symbol.for("react.memo_cache_sentinel")?(_=()=>eo.current,Z[16]=_):_=Z[16],(0,u.useImperativeHandle)(t,_),Z[17]===Symbol.for("react.memo_cache_sentinel")?(w=e=>{J(e),eo.current=e},Z[17]=w):w=Z[17];let ec=w;Z[18]!==o||Z[19]!==c||Z[20]!==F||Z[21]!==m||Z[22]!==f||Z[23]!==x||Z[24]!==q||Z[25]!==W?(S=()=>
1{if(W)return q(W,{currentMinWidth:c,currentMaxWidth:o,flex:F,id:m,minWidth:x,maxWidth:f})},k=[c,o,F,m,x,f,q,W],Z[18]=o,Z[19]=c,Z[20]=F,Z[21]=m,Z[22]=f,Z[23]=x,Z[24]=q,Z[25]=W,Z[26]=S,Z[27]=k):(S=Z[26],k=Z[27]),(0,u.useLayoutEffect)(S,k),Z[28]!==U||Z[29]!==W?(C=()=>{W&&U(W)},Z[28]=U,Z[29]=W,Z[30]=C):C=Z[30];let eu=C;Z[31]!==G||Z[32]!==W?(E=()=>{W&&G(W)},Z[31]=G,Z[32]=W,Z[33]=E):E=Z[33];let ep=E,em=!$&⪙Z[34]!==eu||Z[35]!==ep||Z[36]!==en||Z[37]!==ee||Z[38]!==W||Z[39]!==em?(z={collapse:eu,collapsed:em,expand:ep,index:ee,isLast:en,rootElement:W},Z[34]=eu,Z[35]=ep,Z[36]=en,Z[37]=ee,Z[38]=W,Z[39]=em,Z[40]=z):z=Z[40],I=z;e:{if($){T=void 0;break e}if(el){T=51;break e}if(0===es||en){T=x||204;break e}T=es||x||204}let eh=T;t:{if(el){P=51;break t}if($&&en){P=void 0;break t}if(en){if(f){P=null!=ed?ed:f;break t}P=void 0;break t}P=null!=ed?ed:f}let ef=P,ex=$&&!en;Z[41]!==el||Z[42]!==en||Z[43]!==$||Z[44]!==er||Z[45]!==W?(R=!en&&!$&&(0,a.jsx)(h.wG1,{zOffset:"paneResizer",children:(0,a.jsx)(ns,{disabled:el||er,element:W})}),Z[41]=el,Z[42]=en,Z[43]=$,Z[44]=er,Z[45]=W,Z[46]=R):R=Z[46],A=R;let ev=ef===1/0?void 0:ef;Z[47]!==ea||Z[48]!==eh||Z[49]!==ev?(M={flex:ea,minWidth:eh,maxWidth:ev},Z[47]=ea,Z[48]=eh,Z[49]=ev,Z[50]=M):M=Z[50],D=M;let eg=$?void 0:"hidden",eb=el?"":void 0,ej=K?"":void 0;return Z[51]!==el||Z[52]!==ed||Z[53]!==es||Z[54]!==ei||Z[55]!==ea||Z[56]!==ef||Z[57]!==eh||Z[58]!==ee?(B=!1,Z[51]=el,Z[52]=ed,Z[53]=es,Z[54]=ei,Z[55]=ea,Z[56]=ef,Z[57]=eh,Z[58]=ee,Z[59]=B):B=Z[59],Z[60]!==r||Z[61]!==ex?(Y=!ex&&(0,a.jsx)(d.so,{direction:"column",height:"fill",children:r}),Z[60]=r,Z[61]=ex,Z[62]=Y):Y=Z[62],Z[63]!==W||Z[64]!==Y?(L=(0,a.jsx)(d.EZ,{element:W,children:Y}),Z[63]=W,Z[64]=Y,Z[65]=L):L=Z[65],Z[66]!==ex||Z[67]!==m||Z[68]!==ee||Z[69]!==v||Z[70]!==D||Z[71]!==eg||Z[72]!==eb||Z[73]!==ej||Z[74]!==B||Z[75]!==L?(O=(0,a.jsxs)(nd,{"data-testid":"pane","data-ui":"Pane",tone
1:"inherit",hidden:ex,id:m,overflow:eg,...v,"data-pane-collapsed":eb,"data-pane-index":ee,"data-pane-selected":ej,ref:ec,style:D,children:[B,L]}),Z[66]=ex,Z[67]=m,Z[68]=ee,Z[69]=v,Z[70]=D,Z[71]=eg,Z[72]=eb,Z[73]=ej,Z[74]=B,Z[75]=L,Z[76]=O):O=Z[76],Z[77]!==en||Z[78]!==O?(H=(0,a.jsx)(h.mLG,{isLastPane:en,children:O}),Z[77]=en,Z[78]=O,Z[79]=H):H=Z[79],Z[80]!==I||Z[81]!==H?(V=(0,a.jsx)(h.wG1,{zOffset:"pane",children:(0,a.jsx)(p.OD.Provider,{value:I,children:H})}),Z[80]=I,Z[81]=H,Z[82]=V):V=Z[82],Z[83]!==A||Z[84]!==V?(N=(0,a.jsxs)(a.Fragment,{children:[V,A]}),Z[83]=A,Z[84]=V,Z[85]=N):N=Z[85],N}),nu=(0,v.I4)(d.Zp)(eV());function np(){let e=(0,u.useContext)(p.OD);if(!e)throw Error("Pane: missing context value");return e}nu.displayName="PaneContent__root";let nm=(0,u.forwardRef)(function(e,t){let n,i,l,r,o,d,c=(0,s.c)(14);c[0]!==e?({as:n,children:i,overflow:l,padding:r,...o}=e,c[0]=e,c[1]=n,c[2]=i,c[3]=l,c[4]=r,c[5]=o):(n=c[1],i=c[2],l=c[3],r=c[4],o=c[5]);let{collapsed:u}=np(),{collapsed:p}=tG(),m=p?void 0:l;return c[6]!==n||c[7]!==i||c[8]!==u||c[9]!==r||c[10]!==t||c[11]!==o||c[12]!==m?(d=(0,a.jsx)(nu,{"data-testid":"pane-content",forwardedAs:n,...o,flex:1,hidden:u,overflow:m,padding:r,ref:t,tone:"inherit",children:i}),c[6]=n,c[7]=i,c[8]=u,c[9]=r,c[10]=t,c[11]=o,c[12]=m,c[13]=d):d=c[13],d});function nh(e){return e?e.toLocaleLowerCase().replaceAll(" ",""):""}let nf={constrainSize:!0,placement:"left-start",portal:!0};function nx(e){let t,n,i,l,r=(0,s.c)(35),{disabled:o,isAfterGroup:c,node:u}=e,p=(0,h.Bvg)("i18n"in u?u:void 0);if("divider"===u.type){let e;return r[0]===Symbol.for("react.memo_cache_sentinel")?(e=(0,a.jsx)(d.Nj,{}),r[0]=e):e=r[0],e}r[1]!==p||r[2]!==u?(t=p(u),r[1]=p,r[2]=u,r[3]=t):t=r[3];let{title:m}=t;if("group"===u.type){let e,t,n,i;if(0===u.children.length)return null;if(u.expanded){let e,t,n;return r[4]!==c?(e=c&&(0,a.jsx)(d.Nj,{}
1),r[4]=c,r[5]=e):e=r[5],r[6]!==o||r[7]!==u.children||r[8]!==u.disabled?(t=u.children.map((e,t)=>{var n;return(0,a.jsx)(nx,{disabled:o||!!u.disabled,isAfterGroup:(null==(n=u.children[t-1])?void 0:n.type)==="group",node:e},e.key)}),r[6]=o,r[7]=u.children,r[8]=u.disabled,r[9]=t):t=r[9],r[10]!==e||r[11]!==t?(n=(0,a.jsxs)(a.Fragment,{children:[e,t]}),r[10]=e,r[11]=t,r[12]=n):n=r[12],n}r[13]!==c?(e=c&&(0,a.jsx)(d.Nj,{}),r[13]=c,r[14]=e):e=r[14];let l=u.icon;return r[15]!==o||r[16]!==u.children||r[17]!==u.disabled?(t=u.children.map((e,t)=>{var n;return(0,a.jsx)(nx,{disabled:o||!!u.disabled,isAfterGroup:(null==(n=u.children[t-1])?void 0:n.type)==="group",node:e},e.key)}),r[15]=o,r[16]=u.children,r[17]=u.disabled,r[18]=t):t=r[18],r[19]!==o||r[20]!==u.icon||r[21]!==t||r[22]!==m?(n=(0,a.jsx)(ek.r,{disabled:o,icon:l,popover:nf,text:m,children:t}),r[19]=o,r[20]=u.icon,r[21]=t,r[22]=m,r[23]=n):n=r[23],r[24]!==e||r[25]!==n?(i=(0,a.jsxs)(a.Fragment,{children:[e,n]}),r[24]=e,r[25]=n,r[26]=i):i=r[26],i}return r[27]!==c?(n=c&&(0,a.jsx)(d.Nj,{}),r[27]=c,r[28]=n):n=r[28],r[29]!==o||r[30]!==u?(i=(0,a.jsx)(nv,{disabled:o,node:u}),r[29]=o,r[30]=u,r[31]=i):i=r[31],r[32]!==n||r[33]!==i?(l=(0,a.jsxs)(a.Fragment,{children:[n,i]}),r[32]=n,r[33]=i,r[34]=l):l=r[34],l}function nv(e){let t,n=(0,s.c)(5),{node:i}=e;if(i.intent){let t;return n[0]!==i.intent||n[1]!==e?(t=(0,a.jsx)(nb,{...e,intent:i.intent}),n[0]=i.intent,n[1]=e,n[2]=t):t=n[2],t}return n[3]!==e?(t=(0,a.jsx)(ng,{...e}),n[3]=e,n[4]=t):t=n[4],t}function ng(e){var t;let n,i,l,r,c=(0,s.c)(17),{disabled:u,node:p}=e;c[0]!==p.disabled?(n="object"==typeof p.disabled&&(0,a.jsx)(d.EY,{size:1,children:p.disabled.reason}),c[0]=p.disabled,c[1]=n):n=c[1];let f=n,{title:x}=(0,h.FP1)(p),v=u||!!p.disabled;c[2]!==p.hotkey?(i=null==(t=p.hotkey)?void 0:t.split("+"),c[2]=p.hotkey,c[3]=i):i=c[3];let g=p.iconRight||p.selected&&m.Nrt,b="action-".concat(nh(p.title));return c[4]!==p.icon||c[5]!==p.onAction||c[6]!==p.selected||c[7]!==p.tone||c[8]!==v||c[9]!==i||c[10]!==g||c[11]!==b||c[12]!==x?(l=(0,a.jsx)(o.Dr,{disabled:v,hotkeys:i,icon:p.icon,iconRight:g,onClick:p.onAction,pressed:p.selected,text:x,tone:p.tone,"data-testid":b}),c[4]=p.icon,c[5]=p.onAction,c[6]=p.selected,c[7]=p.tone,c[8]=v,c[9]=i,c[10]=g,c[11]=b,c[12]=x,c[13]=l):l=c[13],c[14]!==l||c[15]!==f?(r=(0,a.jsx)(h.FUn,{content:f,placement:"left",children:l}),c[14]=l,c[15]=f,c[16]=r):r=c[16],r}function nb(e){var t;let n,i,l,r,c,u,p=(0,s.c)(23),{disabled:f,intent:x,node:v}=e;p[0]!==v.disabled?(n="object"==typeof v.disabled&&(0,a.jsx)(d.EY,{size:1,children:v.disabled.reason}),p[0]=v.disabled,p[1]=n):n=p[1];let g=n;p[2]!==x.params||p[3]!==x.type?(i={intent:x.type,params:x.params},p[2]=x.params,p[3]=x.type,p[4]=i):i=p[4];let b=(0,_.cQ)(i);p[5]!==b||p[6]!==v?(l=e=>{b.onClick(e),v.onAction()},p[5]=b,p[6]=v,p[7]=l):l=p[7];let j=l,{title:y}=(0,h.FP1)(v),w=f||!!v.disabled;p[8]!==v.hotkey?(r=null==(t=v.hotkey)?void 0:t.split("+"),p[8]=v.hotkey,p[9]=r):r=p[9];let S=v.selected?m.Nrt:void 0;return p[10]!==j||p[11]!==b.href||p[12]!==v.icon||p[13]!==v.selected||p[14]!==v.tone||p[15]!==w||p[16]!==r||p[17]!==S||p[18]!==y?(c=(0,a.jsx)(o.Dr,{as:"a",disabled:w,hotkeys:r,href:b.href,icon:v.icon,iconRight:S,onClick:j,pressed:v.selected,text:y,tone:v.tone}),p[10]=j,p[11]=b.href,p[12]=v.icon,p[13]=v.selected,p[14]=v.tone,p[15]=w,p[16]=r,p[17]=S,p[18]=y,p[19]=c):c=p[19],p[20]!==c||p[21]!==g?(u=(0,a.jsx)(h.FUn,{content:g,placement:"left",children:c}),p[20]=c,p[21]=g,p[22]=u):u=p[22],u}let nj={constrainSize:!0,placement:"bottom",portal:!0};function ny(e,t){return e.some(e=>"item"===e.type&&e.tone===t||"group"===e.type&&ny(e.children,t))}function n_(e){let t,n,i,l,r,c=(0,s.c)(13),{nodes:p,actionsNodes:m}=e,f=(0,u.useId)(),x=ny(p,"critical"),v=ny(p,"caution"),g=x?"critical":v?"caution":void 0;return c[0]!==g?(t=(0,a.jsx)(h.VJU,{tone:g,"data-testid":"pane-context-menu-button"}),c[0]=g,c[1]=t):t=c[1],c[2]!==m?(n=m&&(0,a.jsxs)(a.Fragment,{children:[m,(0,a.jsx)(d.Nj,{})]}),c[2]=m,c[3]=n):n=c[3],c[4]!==p?(i=p.map((e,t)=>{var n;let i=(null==(n=p[t-1])?void 0:n.type)==="group";return(0,a.jsx)(nx,{isAfterGroup:i,node:e},e.key)}),c[4]=p,c[5]=i):i=c[5],c[6]!==n||c[7]!==i?(l=(0,a.jsxs)(d.W1,{children:[n,i]}
1),c[6]=n,c[7]=i,c[8]=l):l=c[8],c[9]!==f||c[10]!==t||c[11]!==l?(r=(0,a.jsx)(o.IU,{button:t,id:f,menu:l,popover:nj}),c[9]=f,c[10]=t,c[11]=l,c[12]=r):r=c[12],r}let nw=(0,v.I4)(d.Wd)(eN()),nS=(0,v.I4)(d.Zp)(eZ()),nk=(0,u.forwardRef)(function(e,t){let n,i,l=(0,s.c)(7),{children:r,padding:o}=e,{collapsed:c}=np();return l[0]!==r||l[1]!==o?(n=(0,a.jsx)(nS,{tone:"inherit",children:(0,a.jsx)(d.az,{padding:o,children:r})}),l[0]=r,l[1]=o,l[2]=n):n=l[2],l[3]!==c||l[4]!==t||l[5]!==n?(i=(0,a.jsx)(h.wG1,{zOffset:"paneFooter",children:(0,a.jsx)(nw,{"data-testid":"pane-footer",hidden:c,ref:t,children:n})}),l[3]=c,l[4]=t,l[5]=n,l[6]=i):i=l[6],i}),nC=(0,v.I4)(d.Wd)(e=>{let{$border:t}=e;return(0,v.AH)(eF(),t?"var(--card-border-color)":"transparent")}),nE=(0,v.I4)(d.so)(eK()),nI=(0,v.I4)(d.Zp)(e=>{let{theme:t}=e,{fg:n,bg:i}=t.sanity.color.card.enabled;return(0,v.AH)(eW(),i,n)}),nz=(0,v.I4)(c.r5)(eJ()),nT=(0,v.I4)(d.EY)(eU()),nP=(0,u.forwardRef)(function(e,t){let n,i,l,r,o,u,p,m,f,x,v,g,b,j,y=(0,s.c)(48),{actions:_,backButton:w,border:S,contentAfter:k,loading:C,subActions:E,tabs:I,tabIndex:z,title:T,appendTitle:P}=e,{collapse:A,collapsed:R,expand:D,rootElement:M}=np(),B=(0,c.sQ)(M||null),Y=R?(null==B?void 0:B.height)||window.innerHeight:void 0;y[0]!==Y?(i={width:Y},y[0]=Y,y[1]=i):i=y[1],n=i,y[2]!==A||y[3]!==R?(l=()=>{R||A()},y[2]=A,y[3]=R,y[4]=l):l=y[4];let L=l;y[5]!==R||y[6]!==D?(r=()=>{R&&D()},y[5]=R,y[6]=D,y[7]=r):r=y[7];let O=r,H=!!(!R&&(I||E)),V=R?"":void 0,N=R?"":void 0;y[8]!==w?(o=w&&(0,a.jsx)(d.az,{flex:"none",children:w}),y[8]=w,y[9]=o):o=y[9];let Z=w?1:2;y[10]!==C?(u=C&&(0,a.jsx)(d.az,{children:(0,a.jsx)(nz,{animated:!0,radius:1,size:1})}),y[10]=C,y[11]=u):u=y[11],y[12]!==P||y[13]!==C||y[14]!==T?(p=!C&&(0,a.jsxs)(d.so,{align:"center",gap:1,children:[(0,a.jsx)(nT,{size:1,textOverflow:"ellipsis",weight:"semibold",children:T}),P]}),y[12]=P,y[13]=C,y[14]=T,y[15]=p):p=y[15],y[16]!==L||y[17]!==p||y[18]!==Z||y[19]!==u||y[20]!==z?(m=(0,a.jsxs)(nI,{__unstable_focusRing:!0,flex:1,onClick:L,paddingLeft:Z,padding:2,tabIndex:z,children:[u,p]}),y[16]=L,y[17]=p,y[18]=Z,y[19]=u,y[20]=z,y[21]=m):m=y[21],y[22]!==_||y[23]!==R?(f=_&&(0,a.jsx)(d.az,{hidden:R,children:(0,a.jsx)(h.wG1,{zOffset:"paneHeader",children:_})}),y[22]=_,y[23]=R,y[24]=f):f=y[24],y[25]!==m||y[26]!==f||y[27]!==o?(x=(0,a.jsxs)(d.so,{align:"flex-start",gap:3,children:[o,m,f]}),y[25]=m,y[26]=f,y[27]=o,y[28]=x):x=y[28],y[29]!==R||y[30]!==H||y[31]!==E||y[32]!==I?(v=H&&(0,a.jsxs)(d.so,{align:"center",hidden:R,overflow:"auto",children:[(0,a.jsx)(d.az,{flex:1,marginRight:3*!!E,children:I}),E]}),y[29]=R,y[30]=H,y[31]=E,y[32]=I,y[33]=v):v=y[33],y[34]!==O||y[35]!==n||y[36]!==x||y[37]!==v?(g=(0,a.jsxs)(nE,{direction:"column",gap:3,onClick:O,padding:3,sizing:"border",style:n,children:[x,v]}),y[34]=O,y[35]=n,y[36]=x,y[37]=v,y[38]=g):g=y[38];let F=!R&&k;return y[39]!==g||y[40]!==F||y[41]!==N?(b=(0,a.jsx)(h.wG1,{zOffset:"paneHeader",children:(0,a.jsxs)(d.Zp,{"data-collapsed":N,tone:"inherit",children:[g,F]})}),y[39]=g,y[40]=F,y[41]=N,y[42]=b):b=y[42],y[43]!==S||y[44]!==t||y[45]!==b||y[46]!==V?(j=(0,a.jsx)(d.XS,{zOffset:100,children:(0,a.jsx)(nC,{$border:S,"data-collapsed":V,"data-testid":"pane-header",ref:t,children:b})}),y[43]=S,y[44]=t,y[45]=b,y[46]=V,y[47]=j):j=y[47],j});function nA(e){var t;return e.disabled?{disabledReason:"object"==typeof e.disabled?e.disabled.reason:void 0,ariaLabel:"object"==typeof e.disabled&&"string"==typeof(null==(t=e.disabled)?void 0:t.reason)?e.disabled.reason:"This is disabled",isDisabled:!!e.disabled}:{disabledReason:void 0,ariaLabel:void 0,isDisabled:!1}}function nR(e){let t=(0,s.c)(4),{node:n}=e;if("item"===n.type){let e;return t[0]!==n?(e=(0,a.jsx)(nD,{node:n}),t[0]=n,t[1]=e):e=t[1],e}if("group"===n.type){let e;return t[2]!==n?(e=(0,a.jsx)(nB,{node:n}),t[2]=n,t[3]=e):e=t[3],e}return console.warn('unknown menu node (expected `type: "item" | "group"`):',n),null}function nD(e){let t,n,i,l,r,o=(0,s.c)(23),{node:d}=e,{title:c}=(0,h.FP1)(d),{t:u}=(0,h.Bdt)();if(d.intent){let t;return o[0]!==d.intent||o[1]!==e?(t=(0,a.jsx)(nM,{...e,intent:d.intent}),o[0]=d.intent,o[1]=e,o[2]=t):t=o[2],t}o[3]!==d?(t=nA(d),o[3]=d,o[4]=t):t=o[4];let{disabledReason:p,ariaLabel:m,isDisabled:f}=t;o[5]!==m||o[6]!==u||o[7]!==c?(n=m||c||u("status-button.aria-label"),o[5]=m,o[6]=u,o[7]=c,o[8]=n):n=o[8],o[9]!==f||o[10]!==d.hotkey?(i=!f&&d.hotkey?d.hotkey.split("+"):void 0,o[9]=f,o[10]=d.hotkey,o[11]=i):i=o[11];let x=f?p:c;return o[12]!==i||o[13]!==x?(l={hotkeys:i,content:x},o[12]=i,o[13]=x,o[14]=l):l=o[14],o[15]!==f||o[16]!==d.icon||o[17]!==d.onAction||o[18]!==d.selected||o[19]!==d.tone||o[20]!==n||o[21]!==l?(r=(0,a.jsx)(h.pfD,{disabled:f,icon:d.icon,onClick:d.onAction,selected:d.selected,tone:d.tone,"aria-label":n,tooltipProps:l}),o[15]=f,o[16]=d.icon,o[17]=d.onAction,o[18]=d.selected,o[19]=d.tone,o[20]=n,o[21]=l,o[22]=r):r=o[22],r}function nM(e){let t,n,i,l,r,o,d,c=(0,s.c)(27),{intent:u,node:p}=e;c[0]!==u.params||c[1]!==u.type?(t={intent:u.type,params:u.params},c[0]=u.params,c[1]=u.type,c[2]=t):t=c[2];let m=(0,_.cQ)(t),{t:f}=(0,h.Bdt)();c[3]!==m||c[4]!==p?(n=e=>{m.onClick(e),p.onAction()},c[3]=m,c[4]=p,c[5]=n):n=c[5];let x=n;c[6]!==p?(i=nA(p),c[6]=p,c[7]=i):i=c[7];let{disabledReason:v,ariaLabel:g,isDisabled:b}=i;c[8]!==g||c[9]!==p.title||c[10]!==f?(l=g||p.title||f("status-button.aria-label"),c[8]=g,c[9]=p.title,c[10]=f,c[11]=l):l=c[11],c[12]!==b||c[13]!==p.hotkey?(r=!b&&p.hotkey?p.hotkey.split("+"):void 0,c[12]=b,c[13]=p.hotkey,c[14]=r):r=c[14];let j=b?v:p.title;return c[15]!==r||c[16]!==j?(o={hotkeys:r,content:j,placement:"bottom",portal:!0},c[15]=r,c[16]=j,c[17]=o):o=c[17],c[18]!==x||c[19]!==m.href||c[20]!==b||c[21]!==p.icon||c[22]!==p.selected||c[23]!==p.tone||c[24]!==l||c[25]!==o?(d=(0,a.jsx)(h.pfD,{forwardedAs:"a",disabled:b,href:m.href,icon:p.icon,onClick:x,selected:p.selected,tone:p.tone,"aria-label":l,tooltipProps:o}),c[18]=x,c[19]=m.href,c[20]=b,c[21]=p.icon,c[22]=p.selected,c[23]=p.tone,c[24]=l,c[25]=o,c[26]=d):d=c[26],d}function nB(e){var t;let n,i,l,r,c,p=(0,s.c)(16),{node:f}=e,{title:x}=(0,h.FP1)(f),v=!!f.disabled,g=null!=(t=f.icon)?t:m.KSC;
1p[0]!==f.title?(n={content:f.title,portal:!0},p[0]=f.title,p[1]=n):n=p[1],p[2]!==v||p[3]!==g||p[4]!==n||p[5]!==x?(i=(0,a.jsx)(o.$n,{disabled:v,icon:g,label:x,mode:"bleed",tooltipProps:n}),p[2]=v,p[3]=g,p[4]=n,p[5]=x,p[6]=i):i=p[6];let b=(0,u.useId)();return p[7]!==f.children||p[8]!==f.disabled?(l=f.children.map((e,t)=>{var n;return(0,a.jsx)(nx,{disabled:!!f.disabled,isAfterGroup:(null==(n=f.children[t-1])?void 0:n.type)==="group",node:e},e.key)}),p[7]=f.children,p[8]=f.disabled,p[9]=l):l=p[9],p[10]!==l?(r=(0,a.jsx)(d.W1,{children:l}),p[10]=l,p[11]=r):r=p[11],p[12]!==i||p[13]!==b||p[14]!==r?(c=(0,a.jsx)(o.IU,{button:i,id:b,menu:r}),p[12]=i,p[13]=b,p[14]=r,p[15]=c):c=p[15],c}let nY=(0,v.I4)(d.Zp)(e$()),nL=[];function nO(e){var t;let n,i,l,r,o,d,m,h,f,x,v,g,b,j,y,_,w,S,k=(0,s.c)(41);k[0]!==e?({children:n,minWidth:i,onCollapse:l,onExpand:r,...o}=e,k[0]=e,k[1]=n,k[2]=i,k[3]=l,k[4]=r,k[5]=o):(n=k[1],i=k[2],l=k[3],r=k[4],o=k[5]);let[C]=(0,u.useState)(nH),[E,I]=(0,u.useState)(null),z=(null==(t=(0,c.sQ)(E))?void 0:t.width)||0,T=void 0!==z&&i?z<i:void 0;k[6]===Symbol.for("react.memo_cache_sentinel")?(d={expandedElement:null,panes:[],resizing:!1},k[6]=d):d=k[6];let[P,A]=(0,u.useState)(d);k[7]!==C||k[8]!==E?(m=()=>C.setRootElement(E),h=[C,E],k[7]=C,k[8]=E,k[9]=m,k[10]=h):(m=k[9],h=k[10]),(0,u.useEffect)(m,h),k[11]!==C||k[12]!==z?(f=()=>C.setRootWidth(z),x=[C,z],k[11]=C,k[12]=z,k[13]=f,k[14]=x):(f=k[13],x=k[14]),(0,u.useEffect)(f,x),k[15]!==C?(v=()=>C.subscribe(A),g=[C],k[15]=C,k[16]=v,k[17]=g):(v=k[16],g=k[17]),(0,u.useEffect)(v,g),k[18]!==T||k[19]!==l||k[20]!==r?(b=()=>{void 0!==T&&(T&&l&&l(),!T&&r&&r())},j=[T,l,r],k[18]=T,k[19]=l,k[20]=r,k[21]=b,k[22]=j):(b=k[21],j=k[22]),(0,u.useEffect)(b,j),k[23]!==T||k[24]!==C.collapse||k[25]!==C.expand||k[26]!==C.mount||k[27]!==C.resize||k[28]!==P.expandedElement||k[29]!==P.panes||k[30]!==P.resizing?(_={collapse:C.collapse,collapsed:T,expand:C.expand,expandedElement:P.expandedElement,mount:C.mount,panes:P.panes,resize:C.resize,resizing:P.resizing},k[23]=T,k[24]=C.collapse,k[25]=C.expand,k[26]=C.mount,k[27]=C.resize,k[28]=P.expandedElement,k[29]=P.panes,k[30]=P.resizing,k[31]=_):_=k[31],y=_;let R=T?"":void 0,D=P.resizing?"":void 0,M=z?"":void 0;return k[32]!==n||k[33]!==o||k[34]!==R||k[35]!==D||k[36]!==M?(w=(0,a.jsx)(nY,{"data-ui":"PaneLayout",...o,"data-collapsed":R,"data-resizing":D,"data-mounted":M,ref:I,children:n}),k[32]=n,k[33]=o,k[34]=R,k[35]=D,k[36]=M,k[37]=w):w=k[37],k[38]!==y||k[39]!==w?(S=(0,a.jsx)(p._U.Provider,{value:y,children:w}),k[38]=y,k[39]=w,k[40]=S):S=k[40],S}function nH(){return function(){let e=[],t=[],n=new WeakMap,i=new Set,l={},r=null,o=0,a=null,s=new Map,d=!1;function c(e){i.delete(e),a=e,u()}return{collapse:function(e){i.add(e),a===e&&(a=null),u()},expand:c,mount:function(e,i){return n.set(e,{...i,original:i}),t.push(e),r&&function(e,t){let n=new WeakMap;for(let i of t)n.set(i,function(e,t){let n=[],i=t;for(;i!==e;){let t=i.parentElement;if(!t)break;let l=Array.from(t.childNodes).indexOf(i);if(n.unshift(l),t===e)break;i=t}return n}(e,i));t.sort((e,t)=>{let i=n.get(e)||nL,l=n.get(t)||nL,r=Math.max(i.length,l.length);for(let e=0;e<r;e+=1){let t=i[e]||-1,n=l[e]||-1;if(t!==n)return t-n}return 0})}(r,t),c(e),()=>{let i=t.indexOf(e);i>-1&&t.splice(i,1),n.delete(e),u()}},resize:function(e,i,r){let o=t.indexOf(i),a=n.get(i);if(!a)return;let c=t[o+1],p=n.get(c);if(p){if("start"===e&&(d=!0,l.left={element:i,flex:a.flex||1,width:i.offsetWidth},l.right={element:c,flex:p.flex||1,width:c.offsetWidth},u()),"move"===e&&l.left&&l.right){s=new Map;let{leftW:e,rightW:t,leftFlex:n,rightFlex:o}=function(e,t,n,i){var l,r;let o={flex:e.left.flex+e.right.flex,width:e.left.width+e.right.width},a=null!=(l=t.minWidth)?l:204,s=null!=(r=n.minWidth)?r:204,d=Math.min(t.maxWidth||1/0,o.width-s),c=Math.min(n.maxWidth||1/0,o.width-a),u=a-e.left.width,p=e.right.width-c;u<p&&(u=p);let m=e.right.width-s,h=d-e.left.width;m>h&&(m=h);let f=Math.min(Math.max(i,u),m),x=e.left.width+f,v=e.right.width-f;return{leftFlex:x/o.width*o.flex,leftW:x,rightFlex:v/o.width*o.flex,rightW:v}}(l,a,p,r);s.set(i,{flex:n,width:e}),s.set(c,{flex:o,width:t}),u()}if("end"===e){var m,h,f,x;d=!1;let e=s.get(i),t=s.get(c);n.set(i,{...a,currentMinWidth:0,currentMaxWidth:null!=(m=a.maxWidth)?m:1/0,flex:null!=(h=null==e?void 0:e.flex)?h:a.flex}),n.set(c,{...p,currentMinWidth:0,currentMaxWidth:null!=(f=a.maxWidth)?f:1/0,flex:null!=(x=null==t?void 0:t.flex)?x:p.flex}),s=new Map,delete l.left,delete l.right,u()}}},setRootElement:function(e){r=e},setRootWidth:function(e){o=e,u()},subscribe:function(t){return e.push(t),()=>{let n=e.push(t);n>-1&&e.splice(n,1)}}};function u(){if(!o)return;let l=[];for(let e of t)e!==a&&l.unshift(e);a&&l.unshift(a);let r=new WeakMap,c=l.length,u=l[0],p=o-(c-1)*51;for(let e of l){var m,h,f,x;let t=n.get(e);if(!t)continue;let l=t.currentMinWidth||t.minWidth||204,o=e===u,a=i.has(e),d=l>p,c=!o&&(a||d),v=s.get(e);r.set(e,{element:e,collapsed:c,currentMinWidth:null!=(m=null==v?void 0:v.width)?m:t.currentMinWidth,currentMaxWidth:null!=(h=null==v?void 0:v.width)?h:t.currentMaxWidth,flex:null!=(x=null!=(f=null==v?void 0:v.flex)?f:t.flex)?x:1}),c?p-=51:p-=l-51}let v=[];for(let e of t){let t=r.get(e);t&&v.push(t)}for(let n of e)n({expandedElement:a||t[t.length-1]||null,panes:v,resizing:d})}}()}function nV(e){return("item"===e.type||"group"===e.type)&&e.renderAsButton}let nN=eS(nV);function nZ(e){let{fieldActions:t=[],menuItems:n,menuItemGroups:i}=e,l=[],r=0;for(let e=0;e<t.length;e+=1){let n=t[e];l.push(function e(t,n){var i,l,r;return"divider"===t.type?{type:"divider",key:n}:"group"===t.type?{type:"group",key:n,children:t.children.map((t,i)=>e(t,"".concat(n,"-").concat(i,"-").concat(t.type))),disabled:t.disabled,expanded:null==(i=t.expanded)||i,icon:t.icon,title:t.title,i18n:t.i18n,renderAsButton:null!=(l=t.renderAsButton)&&l}:{type:"item",key:n,intent:t.intent,disabled:t.disabled,icon:t.icon,iconRight:t.iconRight,onAction:t.onAction,renderAsButton:null!=(r=t.renderAsButton)&&r,selected:t.selected,title:t.title,i18n:t.i18n,tone:t.tone}}(n,"".concat(e,"-").concat(n.type)))}r+=l.length;let o=[];for(let e of i)o.find(t=>t.key===e.id)||o.push({type:"group",key:e.id,children:[],expanded:!0,renderAsButton:!1,title:e.title,i18n:e.i18n});let a=[];for(let t=0;t<n.length;t+=1){var s,d;let i=n[t],l=i.group&&o.find(e=>e.key===i.group),c="string"==typeof i.disabled?{reason:i.disabled}:i.disabled;i.group&&!l&&(l={type:"group",key:i.group,disabled:c,expanded:!0,icon:i.icon,title:i.group,children:[],renderAsButton:!1},o.push(l)),l?l.children.push({type:"item",key:"".concat(r+t,"-item"),hotkey:i.shortcut,icon:i.icon,intent:i.intent,disabled:c,onAction:()=>e.actionHandler(i),renderAsButton:null!=(s=i.showAsAction)&&s,selected:i.selected,title:i.title,i18n:i.i18n,tone:i.tone}):a.push({type:"item",key:"".concat(r+t,"-item"),hotkey:i.shortcut,icon:i.icon,intent:i.intent,disabled:c,onAction:()=>e.actionHandler(i),renderAsButton:null!=(d=i.showAsAction)&&d,selected:i.selected,title:i.title,i18n:i.i18n,tone:i.tone})}return[...a,...o,...l]}let nF=(0,u.forwardRef)(function(e,t){let n,i,l,r,d,c=(0,s.c)(10);return c[0]!==e?({intent:n,...i}=e,c[0]=e,c[1]=n,c[2]=i):(n=c[1],i=c[2]),c[3]!==n?(r=(0,u.forwardRef)(function(e,t){return(0,a.jsx)(_.RZ,{...e,intent:n.type,params:n.params,ref:t,searchParams:n.searchParams})}),c[3]=n,c[4]=r):r=c[4],l=r,c[5]!==l||c[6]!==e.disabled||c[7]!==t||c[8]!==i?(d=e.disabled?(0,a.jsx)(o.$n,{...i,as:"a",role:"link","aria-disabled":"true"}):(0,a.jsx)(o.$n,{...i,as:l,"data-as":"a",ref:t}),c[5]=l,c[6]=e.disabled,c[7]=t,c[8]=i,c[9]=d):d=c[9],d});function nK(e){let t,n,i,l=(0,s.c)(12),{reveal:d,context:c,loading:u,children:p}=e,m=(0,h.iZK)(),{t:f}=(0,h.Bdt)(r.Z7);if(!d){let e;return l[0]!==p?(e=(0,a.jsx)(a.Fragment,{children:p}),l[0]=p,l[1]=e):e=l[1],e}return l[2]!==c||l[3]!==m||l[4]!==u||l[5]!==f?(t=u?f("insufficient-permissions-message-tooltip.loading-text"):(0,a.jsx)(h.TLO,{context:c,currentUser:m}
1),l[2]=c,l[3]=m,l[4]=u,l[5]=f,l[6]=t):t=l[6],l[7]!==p?(n=(0,a.jsx)("div",{children:p}),l[7]=p,l[8]=n):n=l[8],l[9]!==t||l[10]!==n?(i=(0,a.jsx)(o.m_,{content:t,portal:!0,children:n}),l[9]=t,l[10]=n,l[11]=i):i=l[11],i}let nW={constrainSize:!0,placement:"bottom",portal:!0},nJ=(e,t,n)=>{var i;let l=null==(i=e.find(e=>e.id===t.templateId))?void 0:i.schemaType;if(!l)return null;let r={template:t.templateId,type:l,version:n,id:t.initialDocumentId};return{type:"create",params:t.parameters?[r,t.parameters]:r,searchParams:n?[["perspective",n]]:void 0}};function nU(e){let t,n,i,l,c,p,f,x,v,g=(0,s.c)(60),{templateItems:b}=e,j=(0,h.bgA)(),{selectedReleaseId:y}=(0,h.QO2)(),{t:w}=(0,h.Bdt)(r.Z7);g[0]!==b||g[1]!==j?(t=[...b,...j],g[0]=b,g[1]=j,g[2]=t):t=g[2];let S=(0,h.Bvg)(t);g[3]!==b?(n={templateItems:b},g[3]=b,g[4]=n):n=g[4];let[k,C]=(0,h.CzS)(n);i=!C&&(null==k?void 0:k.length)!==0&&(null==k?void 0:k.every(nG));e:{let e;if(!k){let e;g[5]===Symbol.for("react.memo_cache_sentinel")?(e={},g[5]=e):e=g[5],l=e;break e}g[6]!==k?(e=k.reduce(n$,{}),g[6]=k,g[7]=e):e=g[7],l=e}let E=l;if(0===b.length)return null;if(i){let e,t,n;return g[8]!==w?(e=w("pane-header.disabled-created-button.aria-label"),g[8]=w,g[9]=e):e=g[9],g[10]!==e?(t=(0,a.jsx)(o.$n,{"aria-label":e,icon:m.REV,"data-testid":"action-intent-button",disabled:!0,mode:"bleed",tooltipProps:null}),g[10]=e,g[11]=t):t=g[11],g[12]!==C||g[13]!==t?(n=(0,a.jsx)(nK,{context:"create-document-type",reveal:!0,loading:C,children:t}),g[12]=C,g[13]=t,g[14]=n):n=g[14],n}if(1===b.length){var I;let e,t,n,i,l,r,o=b[0],s=!(null==(I=E[o.id])?void 0:I.granted);g[15]!==o||g[16]!==y||g[17]!==j?(e=nJ(j,o,y),g[15]=o,g[16]=y,g[17]=j,g[18]=e):e=g[18];let d=e;if(!d)return null;g[19]!==o||g[20]!==S?(t=S(o),g[19]=o,g[20]=S,g[21]=t):t=g[21];let c=t.title,u=o.icon||m.REV;return g[22]!==w?(n=w("pane-header.create-new-button.tooltip"),g[22]=w,g[23]=n):n=g[23],g[24]!==n?(i={content:n},g[24]=n,g[25]=i):i=g[25],g[26]!==s||g[27]!==d||g[28]!==i||g[29]!==t.title||g[30]!==u?(l=(0,a.jsx)(nF,{"aria-label":c,icon:u,intent:d,mode:"bleed",disabled:s,"data-testid":"action-intent-button",tooltipProps:i}),g[26]=s,g[27]=d,g[28]=i,g[29]=t.title,g[30]=u,g[31]=l):l=g[31],g[32]!==s||g[33]!==C||g[34]!==l?(r=(0,a.jsx)(nK,{reveal:s,loading:C,context:"create-document-type",children:l}),g[32]=s,g[33]=C,g[34]=l,g[35]=r):r=g[35],r}if(g[36]!==w?(c=w("pane-header.create-new-button.tooltip"),g[36]=w,g[37]=c):c=g[37],g[38]!==c?(p=(0,a.jsx)(o.$n,{icon:m.REV,mode:"bleed","data-testid":"multi-action-intent-button",tooltipProps:{content:c}}),g[38]=c,g[39]=p):p=g[39],g[40]!==S||g[41]!==C||g[42]!==E||g[43]!==y||g[44]!==w||g[45]!==b||g[46]!==j){let e;g[48]!==S||g[49]!==C||g[50]!==E||g[51]!==y||g[52]!==w||g[53]!==j?(e=(e,t)=>{var n;let i=!(null==(n=E[e.id])?void 0:n.granted),l=nJ(j,e,y),r=j.find(t=>t.id===e.templateId);if(!r||!l)return null;let s=(0,u.forwardRef)((e,t)=>i?(0,a.jsx)("button",{type:"button",disabled:!0,...e,ref:t}):(0,a.jsx)(_.RZ,{...e,intent:l.type,params:l.params,searchParams:l.searchParams,ref:t}));s.displayName="Link";let{title:d}=S({...e,title:e.title||S(r).title});return(0,a.jsx)(nK,{context:"create-document-type",reveal:i,loading:C,children:(0,a.jsx)(o.Dr,{as:s,"data-as":i?"button":"a",text:d,"aria-label":i?w("pane-header.disabled-created-button.aria-label"):d,disabled:i,"data-testid":"action-intent-button-".concat(t)})},e.id)},g[48]=S,g[49]=C,g[50]=E,g[51]=y,g[52]=w,g[53]=j,g[54]=e):e=g[54],f=b.map(e),g[40]=S,g[41]=C,g[42]=E,g[43]=y,g[44]=w,g[45]=b,g[46]=j,g[47]=f}else f=g[47];return g[55]!==f?(x=(0,a.jsx)(d.W1,{children:f}),g[55]=f,g[56]=x):x=g[56],g[57]!==p||g[58]!==x?(v=(0,a.jsx)(o.IU,{button:p,id:"create-menu",menu:x,popover:nW}),g[57]=p,g[58]=x,g[59]=v):v=g[59],v}function n$(e,t){return e[t.id]=t,e}function nG(e){return!e.granted}function nQ(e){return null!=e}let nq=(0,u.memo)(function(e){let{initialValueTemplateItems:t=h.Mlv,menuItems:n=h.Mlv,menuItemGroups:i=h.Mlv,actionHandlers:l=h.MlF}=e,r=(0,h.bgA)(),o=(0,u.useCallback)(e=>{if("string"==typeof e.action&&!(e.action in l))return console.warn("No handler for action:",e.action),!1;let t="function"==typeof e.action?e.action:"string"==typeof e.action?l[e.action]:null;return!!t&&(t(e.params),!0)},[l]),s=(0,u.useMemo)(()=>nZ({actionHandler:o,menuItemGroups:i,menuItems:n.filter(e=>{var t;return(null==(t=e.intent)?void 0:t.type)!=="create"})}),[o,i,n]),c=(0,u.useMemo)(()=>s.filter(nV),[s]),p=(0,u.useMemo)(()=>s.filter(nN),[s]),m=(0,u.useMemo)(()=>n.map((e,t)=>{var n;if((null==(n=e.intent)?void 0:n.type)!=="create")return null;let{params:i}=e.intent;if(!i)return null;let l=Array.isArray(i)?i[0]:i,o=Array.isArray(i)?i[1]:void 0,a=l.template||l.type;if(!a)return null;let s=r.find(e=>e.id===a);return s?{item:e,template:s,templateParams:o,menuItemIndex:t,initialDocumentId:l.id}:null}).filter(nQ).map(e=>{let{initialDocumentId:t,item:n,template:i,menuItemIndex:l,templateParams:r}=e;return{id:"menuItem".concat(l),initialDocumentId:t,templateId:i.id,type:"initialValueTemplateItem",title:n.title||i.title,i18n:n.i18n||i.i18n,icon:n.icon,description:i.description,parameters:r,schemaType:i.schemaType}}),[n,r]),f=(0,u.useMemo)(()=>ew([...m,...t],e=>(e=>{let t=e=>"object"==typeof e&&e?Array.isArray(e)?e.map(t):Object.entries(e).sort((e,t)=>
1{let[n]=e,[i]=t;return n.localeCompare(i,"en")}):e;return JSON.stringify(t(JSON.parse(JSON.stringify(e))))})([e.initialDocumentId,e.templateId,e.parameters])),[m,t]);return(0,a.jsxs)(d.so,{gap:1,children:[(0,a.jsx)(nU,{templateItems:f}),c.map(e=>(0,a.jsx)(nR,{node:e},e.key)),p.length>0&&(0,a.jsx)(n_,{nodes:p})]})});function nX(e){let t,n,i,l,o,d,c,u=(0,s.c)(16),{t:p}=(0,h.Bdt)(r.Z7),{layout:m,value:f}=e;return u[0]===Symbol.for("react.memo_cache_sentinel")?(t={Code:"code"},u[0]=t):t=u[0],u[1]!==f._type?(n={documentType:f._type},u[1]=f._type,u[2]=n):n=u[2],u[3]!==p||u[4]!==n?(i=(0,a.jsx)("em",{children:(0,a.jsx)(h.HTc,{t:p,i18nKey:"pane-item.missing-schema-type.title",components:t,values:n})}),u[3]=p,u[4]=n,u[5]=i):i=u[5],u[6]===Symbol.for("react.memo_cache_sentinel")?(l={Code:"code"},u[6]=l):l=u[6],u[7]!==f._id?(o={documentId:f._id},u[7]=f._id,u[8]=o):o=u[8],u[9]!==p||u[10]!==o?(d=(0,a.jsx)(h.HTc,{t:p,i18nKey:"pane-item.missing-schema-type.subtitle",components:l,values:o}),u[9]=p,u[10]=o,u[11]=d):d=u[11],u[12]!==m||u[13]!==i||u[14]!==d?(c=(0,a.jsx)(h.m6P,{title:i,subtitle:d,media:n0,layout:m}),u[12]=m,u[13]=i,u[14]=d,u[15]=c):c=u[15],c}function n0(){return(0,a.jsx)(m.sAQ,{})}function n1(e,t,n){return!1!==e&&(e||t&&t.icon||n||!1)}function n2(e){let t,n,i,l,r,o,c,p,x=(0,s.c)(42),{icon:v,id:g,layout:b,pressed:j,schemaType:y,selected:_,title:w,value:S,margin:k,marginBottom:C,marginTop:E}=e,I=void 0===b?"default":b,z=(0,h.pDY)(),T=(0,h.yKO)(),{ChildLink:P}=t0(),A=(0,h.cVB)(g),R=!!(y&&y.name&&z.get(y.name)),[D,M]=(0,u.useState)(!1);e:{let e,n,i,l;if(S&&(0,f.ME)(S)){let e,n;if(!y||!R){let e;x[0]!==S?(e=(0,a.jsx)(nX,{value:S}),x[0]=S,x[1]=e):e=x[1],t=e;break e}x[2]!==v||x[3]!==y?(e=n1(v,y,m.pyG),x[2]=v,x[3]=y,x[4]=e):e=x[4],x[5]!==A||x[6]!==T||x[7]!==I||x[8]!==y||x[9]!==e||x[10]!==S?(n=(0,a.jsx)(tU,{documentPreviewStore:T,icon:e,layout:I,schemaType:y,value:S,presence:A}),x[5]=A,x[6]=T,x[7]=I,x[8]=y,x[9]=e,x[10]=S,x[11]=n):n=x[11],t=n;break e}x[12]===Symbol.for("react.memo_cache_sentinel")?(e={opacity:.5},x[12]=e):e=x[12],x[13]===Symbol.for("react.memo_cache_sentinel")?(n=(0,a.jsx)(d.az,{style:e,children:(0,a.jsx)(d.EY,{muted:!0,size:1,children:(0,a.jsx)(m.vKP,{})})}),x[13]=n):n=x[13],x[14]!==v||x[15]!==y?(i=n1(v,y,m.sjq),x[14]=v,x[15]=y,x[16]=i):i=x[16],x[17]!==i||x[18]!==w?(l=(0,a.jsx)(h.m6P,{status:n,icon:i,layout:"compact",title:w}),x[17]=i,x[18]=w,x[19]=l):l=x[19],t=l}let B=t;x[20]===Symbol.for("react.memo_cache_sentinel")?(n=e=>{if(e.metaKey)return void M(!1);M(!0)},x[20]=n):n=x[20];let Y=n;x[21]===Symbol.for("react.memo_cache_sentinel")?(i=()=>M(!1),x[21]=i):i=x[21],x[22]!==_?(l=[_],x[22]=_,x[23]=l):l=x[23],(0,u.useEffect)(i,l);let[L,O]=(0,u.useState)(!1),H=(0,u.useRef)(null);x[24]===Symbol.for("react.memo_cache_sentinel")?(r=()=>{H.current=setTimeout(()=>(0,u.startTransition)(()=>O(!0)),400)},x[24]=r):r=x[24];let V=r;x[25]===Symbol.for("react.memo_cache_sentinel")?(o=()=>{H.current&&clearTimeout(H.current),(0,u.startTransition)(()=>O(!1))},x[25]=o):o=x[25];let N=o,Z="pane-item-".concat(w),F=_||D;return x[26]!==g||x[27]!==L||x[28]!==y||x[29]!==S?(c=L&&(null==y?void 0:y.name)&&S&&(0,f.ME)(S)&&(0,a.jsx)(n3,{documentId:g,documentType:y.name}),x[26]=g,x[27]=L,x[28]=y,x[29]=S,x[30]=c):c=x[30],x[31]!==g||x[32]!==k||x[33]!==C||x[34]!==E||x[35]!==j||x[36]!==B||x[37]!==c||x[38]!==Z||x[39]!==P||x[40]!==F?(p=(0,a.jsxs)(h.Ns2,{"data-testid":Z,__unstable_focusRing:!0,as:P,childId:g,"data-as":"a",margin:k,marginBottom:C,marginTop:E,onClick:Y,onMouseEnter:V,onMouseLeave:N,pressed:j,radius:2,selected:F,sizing:"border",tabIndex:-1,tone:"inherit",children:[B,c]}),x[31]=g,x[32]=k,x[33]=C,x[34]=E,x[35]=j,x[36]=B,x[37]=c,x[38]=Z,x[39]=P,x[40]=F,x[41]=p):p=x[41],p}function n3(e){let t,n=(0,s.c)(2),{documentId:i,documentType:l}=e;return n[0]!==i?(t=(0,h.IMx)(i),n[0]=i,n[1]=t):t=n[1],(0,h.zX2)(t,l),null}n3.displayName="PreloadDocumentPane";let n4=(0,u.memo)(e=>{let t,n,i=(0,s.c)(10),{actions:l,children:r,actionProps:o,onActionComplete:d,group:c}=e;return i[0]!==o.id||i[1]!==o.liveEditSchemaType||i[2]!==r?(t=e=>{let{states:t}=e;return(0,a.jsx)(n6,{states:t,documentId:o.liveEditSchemaType?(0,h.IMx)(o.id):(0,h.T4)(o.id),children:r})},i[0]=o.id,i[1]=o.liveEditSchemaType,i[2]=r,i[3]=t):t=i[3],i[4]!==o||i[5]!==l||i[6]!==c||i[7]!==d||i[8]!==t?(n=(0,a.jsx)(h.N6R,{onReset:d,hooks:l,args:o,group:c,children:t}),i[4]=o,i[5]=l,i[6]=c,i[7]=d,i[8]=t,i[9]=n):n=i[9],n});n4.displayName="Memo(RenderActionCollectionState)";let n5=["delete","duplicate","publish","unpublish","unlinkFromCanvas","editInCanvas","linkToCanvas","schedule"],n6=e=>{let t,n=(0,s.c)(9),{states:i,children:l,documentId:o}
1=e,{t:a}=(0,h.Bdt)(r.Z7),{isLinked:d}=(0,h.G2c)(o);e:{let e;if(d){let e;if(n[0]!==l||n[1]!==i||n[2]!==a){let t;n[4]!==a?(t=e=>e.action&&n5.includes(e.action)?e:{...e,disabled:!0,title:a("action.disabled-by-canvas.tooltip")},n[4]=a,n[5]=t):t=n[5],e=l({states:i.map(t)}),n[0]=l,n[1]=i,n[2]=a,n[3]=e}else e=n[3];t=e;break e}n[6]!==l||n[7]!==i?(e=l({states:i}),n[6]=l,n[7]=i,n[8]=e):e=n[8],t=e}return t},n7=(0,u.memo)(e=>{let t,n=(0,s.c)(4),{badges:i,children:l,badgeProps:r}=e;return n[0]!==r||n[1]!==i||n[2]!==l?(t=(0,a.jsx)(h.N6R,{hooks:i,args:r,children:l}),n[0]=r,n[1]=i,n[2]=l,n[3]=t):t=n[3],t});n7.displayName="Memo(RenderBadgeCollectionState)";let n8="diffView",n9="previousDocument",ie="nextDocument";function it(){let e,t,n,i=(0,s.c)(9),{navigate:l,state:r}=(0,_.rd)();i[0]!==l||i[1]!==r?(e=e=>{let{mode:t,previousDocument:n,nextDocument:i}=e,o={...G(r._searchParams),...t?{[n8]:t}:{},...n?{[n9]:[n.type,n.id].join(",")}:{},...i?{[ie]:[i.type,i.id].join(",")}:{}};l({...r,_searchParams:Q(o)})},i[0]=l,i[1]=r,i[2]=e):e=i[2];let o=e;i[3]!==l||i[4]!==r?(t=()=>{var e;l({...r,_searchParams:(null!=(e=r._searchParams)?e:[]).filter(ii)})},i[3]=l,i[4]=r,i[5]=t):t=i[5];let a=t;return i[6]!==a||i[7]!==o?(n={navigateDiffView:o,exitDiffView:a},i[6]=a,i[7]=o,i[8]=n):n=i[8],n}function ii(e){let[t]=e;return![n8,n9,ie].includes(t)}let il=["version"];function ir(){let{onParamsError:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{state:t}=(0,_.rd)(),n=new URLSearchParams(t._searchParams),i=n.get(n9),l=n.get(ie),r=n.get(n8),o=[i,l,r].some(e=>null!==e),a=(0,u.useMemo)(()=>(function(e){let{previousDocument:t,nextDocument:n,mode:i}=e,l=[],[r,o]=t.split(",").filter(Boolean),[a,s]=n.split(",").filter(Boolean);return il.includes(i)||l.push(["invalidModeParam",i]),(typeof r>"u"||typeof o>"u")&&l.push(["invalidPreviousDocumentParam",t]),(typeof a>"u"||typeof s>"u")&&l.push(["invalidNextDocumentParam",n]),0!==l.length?{result:"error",errors:l}:{result:"success",params:{mode:i,documents:{previous:{type:r,id:o},next:{type:a,id:s}}}}})({previousDocument:null!=i?i:"",nextDocument:null!=l?l:"",mode:null!=r?r:""}),[r,l,i]);return(0,u.useEffect)(()=>{"error"===a.result&&o&&(null==e||e(a.errors))},[o,e,a]),"error"===a.result?{isActive:!1}:{state:"ready",isActive:!0,...a.params}}function io(e){return null!==e}let ia=v.I4.header(eG()),is=v.I4.div(eQ()),id=e=>{let{documentId:t,state:n}=e,{t:i}=(0,h.Bdt)(r.Z7),{data:l}=(0,h.gn8)({documentId:t}),{exitDiffView:o,navigateDiffView:s}=it(),{documents:c}=ir(),p=(0,h.K0D)(),f=l.flatMap(e=>{var t;return null!=(t=(0,h._Sr)(e))?t:[]}),x=(0,u.useMemo)(()=>p.data.filter(e=>{let t=(0,h._hI)(e._id);return"u">typeof t&&f.includes(t)}),[p.data,f]),v=(0,u.useCallback)(e=>{"u">typeof(null==c?void 0:c.previous)&&s({previousDocument:{...c.previous,id:e}})},[null==c?void 0:c.previous,s]),g=(0,u.useCallback)(e=>{"u">typeof(null==c?void 0:c.next)&&s({nextDocument:{...c.next,id:e}})},[null==c?void 0:c.next,s]);return(0,a.jsxs)(ia,{children:[(0,a.jsxs)(is,{children:[(0,a.jsx)(d.az,{padding:4,children:(0,a.jsx)(d.EY,{as:"h1",size:1,muted:!0,children:i("compare-versions.title")})}),"u">typeof(null==c?void 0:c.previous)&&(0,a.jsx)(ic,{releases:x,onSelectRelease:v,role:"previous",documentId:t,state:n,document:c.previous})]}),(0,a.jsx)(d.so,{align:"center",paddingX:3,children:(0,a.jsx)(d.EY,{size:1,children:(0,a.jsx)(m.ppF,{})})}),(0,a.jsxs)(is,{children:["u">typeof(null==c?void 0:c.next)&&(0,a.jsx)(ic,{releases:x,onSelectRelease:g,role:"next",documentId:t,state:n,document:c.next}),(0,a.jsx)(d.az,{padding:3,style:{justifySelf:"end"},children:(0,a.jsx)(d.$n,{icon:m.USm,mode:"bleed",onClick:o,padding:2})})]})]})},ic=e=>{let{releases:t=[],onSelectRelease:n,role:i,documentId:l,document:s}=e,{published:c,draft:p}=(0,h.zX2)((0,h.IMx)(s.id),s.type),f=(0,u.useMemo)(()=>(function(e,t){return(0,h._4P)(e)?"published":(0,h.R8D)(e)?"draft":t.find(t=>{let{_id:n}=t;return(0,h._hI)(n)===(0,h._Sr)(e)})})(s.id,t),[s.id,t]),{t:x}=(0,h.Bdt)(r.Z7),{t:v}=(0,h.Bdt)(),{document:{drafts:{enabled:g}}}=(0,h.hA9)();return(0,a.jsx)(o.IU,{id:i,button:(0,a.jsx)(d.$n,{type:"button",mode:"bleed",padding:2,paddingRight:3,radius:"full",selected:!0,...function(e){let{selected:t,tCore:n,t
1Structure:i}=e;if(typeof t>"u")return{text:n("common.loading"),tone:"neutral",disabled:!0};if((0,h.Jrl)(t)){let e=t?(0,h.Y73)(t):"neutral";return{text:(null==t?void 0:t.metadata.title)||n("release.placeholder-untitled-release"),icon:(0,a.jsx)(h.Rdi,{padding:1,tone:e}),iconRight:t&&(0,h.KJ$)(t)?(0,a.jsx)(m.XAi,{}):void 0,tone:e}}let l="published"===t?"positive":"caution";return{text:i(["compare-versions.status",t].join(".")),icon:(0,a.jsx)(h.Rdi,{padding:1,tone:l}),tone:l}}({selected:f,tCore:v,tStructure:x})}),menu:(0,a.jsxs)(d.W1,{children:[c&&(0,a.jsx)(iu,{type:"published",onSelect:n,isSelected:"published"===f,documentId:l}),g&&p&&(0,a.jsx)(iu,{type:"draft",onSelect:n,isSelected:"draft"===f,documentId:l}),t.map(e=>(0,a.jsx)(iu,{release:e,onSelect:n,isSelected:"string"!=typeof f&&(null==f?void 0:f._id)===e._id,documentId:l},e._id))]})})},iu=e=>{let{type:t,release:n,onSelect:i,isSelected:l,documentId:o}=e,{t:s}=(0,h.Bdt)(),{t:c}=(0,h.Bdt)(r.Z7),p=(0,u.useCallback)(()=>"draft"===t?void i((0,h.T4)(o)):"published"===t?void i((0,h.IMx)(o)):void("u">typeof(null==n?void 0:n._id)&&i((0,h.ctg)(o,(0,h._hI)(n._id)))),[t,i,o,null==n?void 0:n._id]);if(t)return(0,a.jsx)(d.Dr,{padding:1,paddingRight:3,onClick:p,pressed:l,children:(0,a.jsxs)(d.so,{gap:1,children:[(0,a.jsx)(h.Rdi,{padding:2,tone:"published"===t?"positive":"caution"}),(0,a.jsx)(d.az,{paddingY:2,children:(0,a.jsx)(d.EY,{size:1,weight:"medium",children:c(["compare-versions.status",t].join("."))})})]})});let f=n?(0,h.Y73)(n):"neutral";return(0,a.jsx)(d.Dr,{padding:1,paddingRight:3,onClick:p,pressed:l,children:(0,a.jsxs)(d.so,{gap:1,children:[(0,a.jsx)(h.Rdi,{padding:2,tone:f}),(0,a.jsxs)(d.BJ,{flex:1,paddingY:2,paddingRight:2,space:2,children:[(0,a.jsx)(d.EY,{size:1,weight:"medium",children:n.metadata.title||s("release.placeholder-untitled-release")}),["asap","undecided"].includes(n.metadata.releaseType)&&(0,a.jsx)(d.EY,{muted:!0,size:1,children:s("release.type.".concat(n.metadata.releaseType))}),"scheduled"===n.metadata.releaseType&&(0,a.jsx)(d.EY,{muted:!0,size:1,children:(0,h.drb)(n)})]}),(0,a.jsx)(d.so,{flex:"none",children:(0,h.KJ$)(n)&&(0,a.jsx)(d.az,{padding:2,children:(0,a.jsx)(d.EY,{size:1,children:(0,a.jsx)(m.XAi,{})})})})]})})},ip=v.I4.div(eq());function im(e){var t,n;return null==(n=e.document)||null==(t=n.components)?void 0:t.unstable_layout}function ih(e){return e.path}function ix(e,t){return ee(e.path,t.path)}let iv=v.I4.div(eX()),ig=(0,v.I4)(d.Zp)(e0()),ib=(0,v.I4)(d.mc)(e1()),ij=(0,u.forwardRef)(function(e,t){let n,i,l,r,o,m,f,x,v,g,b,j,y=(0,s.c)(36),{role:_,documentType:w,documentId:S,scrollElement:k,syncChannel:C,compareDocument:E}=e,I=(0,u.useRef)(null),[z,T]=(0,u.useState)(null),[P,A]=(0,u.useState)(null);y[0]!==E||y[1]!==S||y[2]!==w||y[3]!==_||y[4]!==k||y[5]!==C?(n=()=>(0,a.jsx)(iy,{compareDocument:E,documentId:S,documentType:w,role:_,scrollElement:k,syncChannel:C}),y[0]=E,y[1]=S,y[2]=w,y[3]=_,y[4]=k,y[5]=C,y[6]=n):n=y[6];let R=n;y[7]!==R?(i={pick:im,defaultComponent:R},y[7]=R,y[8]=i):i=y[8];let D=(0,h.A1m)(i);y[9]===Symbol.for("react.memo_cache_sentinel")?(l={isInteractive:!1,onOpenReviewChanges:X,onSetFocus:X,isReviewChangesOpen:!1},y[9]=l):l=y[9];let M="".concat(_,"-document");y[10]!==M?(r={"--grid-area":M},y[10]=M,y[11]=r):r=y[11];let B=r,Y="next"===_,L="next"!==_&&"none";y[12]!==L?(o={"--scrollbar-width":L},y[12]=L,y[13]=o):o=y[13];let O=o;return y[14]!==D||y[15]!==S||y[16]!==w?(m=(0,a.jsx)(c.Co,{position:"absolute",children:(0,a.jsx)(ib,{ref:I,padding:4,width:1,children:(0,a.jsx)(D,{documentId:S,documentType:w})})}),y[14]=D,y[15]=S,y[16]=w,y[17]=m):m=y[17],y[18]!==z||y[19]!==m?(f=(0,a.jsx)(d.GD,{element:z,children:m}),y[18]=z,y[19]=m,y[20]=f):f=y[20],y[21]!==t||y[22]!==O||y[23]!==f?(x=(0,a.jsx)(iv,{ref:t,style:O,children:f}),y[21]=t,y[22]=O,y[23]=f,y[24]=x):x=y[24],y[25]===Symbol.for("react.memo_cache_sentinel")?(v=(0,a.jsx)("div",{"data-testid":"diffView-document-panel-portal",ref:T}),y[25]=v):v=y[25],y[26]!==x||y[27]!==B||y[28]!==Y?(g=(0,a.jsxs)(ig,{ref:A,style:B,borderLeft:Y,children:[x,v]}),y[26]=x,y[27]=B,y[28]=Y,y[29]=g):g=y[29],y[30]!==P||y[31]!==g?(b=(0,a.jsx)(d.EZ,{element:P,children:g}),y[30]=P,y[31]=g,y[32]=b):b=y[32],y[33]!==k||y[34]!==b?(j=(0,a.jsx)(p.HJ.Provider,{value:l,children:(0,a.jsx)(h.tmD,{children:(0,a.jsx)(h.jsZ,{scrollElement:k,containerElement:I,children:b})})}),y[33]=k,y[34]=b,y[35]=j):j=y[35],j}),iy=e=>{let t,n,i,l,r,o,d,c,m,f,x,v,g,b,j,y,_,w,S,k,C,E,I,z,R=(0,s.c)(56),{role:D,documentType:M,documentId:B,syncChannel:Y,compareDocument:L}=e;R[0]!==L?(t={compareDocument:L},R[0]=L,R[1]=t):t=R[1];let O=function(e){let t,n,i,l=(0,s.c)(4),{compareDocument:r}=e;l[0]!==r.id?(t=(0,h.IMx)(r.id),l[0]=r.id,l[1]=t):t=l[1];let o=r.type;l[2]!==r.id?(n=(0,h._Sr)(r.id),l[2]=r.id,l[3]=n):n=l[3];let a=(0,h.zX2)(t,o,"low",n);e:{var d,c,u;if((0,h.A_X)(r.id)){i=null!=(d=a.version)?d:void 0;break e}if((0,h.R8D)(r.id)){i=null!=(c=a.draft)?c:void 0;break e}if((0,h._4P)(r.id)){i=null!=(u=a.published)?u:void 0;break e}i=void 0}return i}(t),[H]=(0,u.useState)(i_);R[2]!==B?(n=(0,h.IMx)(B),R[2]=B,R[3]=n):n=R[3],R[4]!==B?(i=function(e){return(0,h.A_X)(e)?(0,h._Sr)(e):(0,h._4P)(e)?"published":void 0}(B),R[4]=B,R[5]=i):i=R[5],R[6]!==B?(l=(0,h._Sr)(B),R[6]=B,R[7]=l):l=R[7],R[8]!==O||R[9]!==M||R[10]!==n||R[11]!==i||R[12]!==l?
1(r={documentId:n,documentType:M,selectedPerspectiveName:i,releaseId:l,comparisonValue:O},R[8]=O,R[9]=M,R[10]=n,R[11]=i,R[12]=l,R[13]=r):r=R[13];let V=(0,h.Lay)(r);R[14]!==V?({formState:m,onChange:x,onFocus:v,onBlur:f,onSetActiveFieldGroup:b,onSetCollapsedFieldSet:j,onSetCollapsedPath:y,collapsedFieldSets:o,ready:_,collapsedPaths:d,schemaType:w,value:S,onProgrammaticFocus:g,...c}=V,R[14]=V,R[15]=o,R[16]=d,R[17]=c,R[18]=m,R[19]=f,R[20]=x,R[21]=v,R[22]=g,R[23]=b,R[24]=j,R[25]=y,R[26]=_,R[27]=w,R[28]=S):(o=R[15],d=R[16],c=R[17],m=R[18],f=R[19],x=R[20],v=R[21],g=R[22],b=R[23],j=R[24],y=R[25],_=R[26],w=R[27],S=R[28]);let N=null===m||!_;R[29]!==D||R[30]!==Y?(k={id:D,syncChannel:Y},R[29]=D,R[30]=Y,R[31]=k):k=R[31];let Z=function(e){let t,n,i,l,r=(0,s.c)(11),{syncChannel:o,id:a}=e;r[0]!==a||r[1]!==o?(t=e=>o.next({...e,source:a}),r[0]=a,r[1]=o,r[2]=t):t=r[2];let d=t;if(r[3]!==a||r[4]!==o){let e;r[6]!==a?(e=e=>{let{source:t}=e;return t!==a},r[6]=a,r[7]=e):e=r[7],i=o.pipe((0,T.F)(ix),(0,P.p)(e),(0,A.T)(ih)),r[3]=a,r[4]=o,r[5]=i}else i=r[5];return n=i,r[8]!==n||r[9]!==d?(l={path:n,push:d},r[8]=n,r[9]=d,r[10]=l):l=r[10],l}(k);R[32]!==c||R[33]!==Z||R[34]!==D?(C=e=>{c.onPathOpen(e),Z.push({source:D,path:e})},R[32]=c,R[33]=Z,R[34]=D,R[35]=C):C=R[35];let F=C;return R[36]!==g||R[37]!==Z.path?(I=()=>{let e=Z.path.subscribe(g);return()=>e.unsubscribe()},E=[g,Z.path],R[36]=g,R[37]=Z.path,R[38]=E,R[39]=I):(E=R[38],I=R[39]),(0,u.useEffect)(I,E),R[40]!==o||R[41]!==d||R[42]!==m||R[43]!==N||R[44]!==f||R[45]!==x||R[46]!==v||R[47]!==F||R[48]!==b||R[49]!==j||R[50]!==y||R[51]!==H||R[52]!==D||R[53]!==w||R[54]!==S?(z=N?(0,a.jsx)(h.gd4,{showText:!0}):(0,a.jsx)(p.pn.Provider,{value:{enabled:!1,mode:null},children:(0,a.jsx)(h.okx,{__internal_patchChannel:H,id:"diffView-pane-".concat(D),onChange:x,onPathFocus:v,onPathOpen:F,onPathBlur:f,onFieldGroupSelect:b,onSetFieldSetCollapsed:j,onSetPathCollapsed:y,collapsedPaths:d,collapsedFieldSets:o,focusPath:m.focusPath,changed:m.changed,focused:m.focused,groups:m.groups,validation:m.validation,members:m.members,presence:m.presence,schemaType:w,value:S})}),R[40]=o,R[41]=d,R[42]=m,R[43]=N,R[44]=f,R[45]=x,R[46]=v,R[47]=F,R[48]=b,R[49]=j,R[50]=y,R[51]=H,R[52]=D,R[53]=w,R[54]=S,R[55]=z):z=R[55],z};function i_(){return(0,h.Ijd)()}let iw=v.I4.a(e2()),iS=e=>{let t,n,i=(0,s.c)(6),{children:l,documentId:r,documentType:o}=e;i[0]!==r||i[1]!==o?(t={intent:"edit",params:{id:r,type:o}},i[0]=r,i[1]=o,i[2]=t):t=i[2];let{href:d}=(0,_.cQ)(t);return i[3]!==l||i[4]!==d?(n=(0,a.jsx)(iw,{href:d,target:"_blank",rel:"noopener noreferrer",children:l}),i[3]=l,i[4]=d,i[5]=n):n=i[5],n},ik=e=>{let t,n,i,l,r,d,c,m,h=(0,s.c)(24),{documentId:f}=e,{documents:x,state:v,mode:g}=ir(),{exitDiffView:b}=it(),j=function(){let e,t=(0,s.c)(1);return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=new z.B,t[0]=e):e=t[0],e}(),[y,_]=(0,u.useState)(null),[w,S]=(0,u.useState)(null),k=(0,u.useContext)(p.DA);return h[0]!==k?(n={...k,disableNew:!0,EditReferenceLinkComponent:iS},h[0]=k,h[1]=n):n=h[1],t=n,h[2]!==w||h[3]!==y?(i=[y,w],h[2]=w,h[3]=y,h[4]=i):i=h[4],function(e){let t,n,i=(0,s.c)(3);i[0]!==e?(t=()=>{let t=e.filter(io);if(0===t.length)return;let n=new q.Ay(t);return()=>n.destroy()},n=[e],i[0]=e,i[1]=t,i[2]=n):(t=i[1],n=i[2]),(0,u.useEffect)(t,n)}(i),h[5]!==f||h[6]!==g||h[7]!==v?(l="version"===g&&(0,a.jsx)(id,{documentId:f,state:v}),h[5]=f,h[6]=g,h[7]=v,h[8]=l):l=h[8],h[9]!==x||h[10]!==w||h[11]!==y||h[12]!==v||h[13]!==j?(r="ready"===v&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(ij,{documentType:x.previous.type,documentId:x.previous.id,role:"previous",ref:_,scrollElement:y,syncChannel:j,compareDocument:x.previous}),(0,a.jsx)(ij,{documentType:x.next.type,documentId:x.next.id,role:"next",ref:S,scrollElement:w,syncChannel:j,compareDocument:x.previous})]}),h[9]=x,h[10]=w,h[11]=y,h[12]=v,h[13]=j,h[14]=r):r=h[14],h[15]!==l||h[16]!==r?(d=(0,a.jsxs)(ip,{children:[l,r]}),h[15]=l,h[16]=r,h[17]=d):d=h[17],h[18]!==b||h[19]!==d?(c=(0,a.jsx)(o.lG,{id:"diffView",width:"auto",onClose:b,padding:!1,__unstable_hideCloseButton:!0,children:d}),h[18]=b,h[19]=d,h[20]=c):c=h[20],h[21]!==t||h[22]!==c?(m=(0,a.jsx)(p.DA.Provider,{value:t,children:c}),h[21]=t,h[22]=c,h[23]=m):m=h[23],m},iC=e=>{let t,n,i,l=(0,s.c)(9),{children:o,documentId:d}=e,u=(0,c.dj)(),{t:p}=(0,h.Bdt)(r.Z7);l[0]!==p||l[1]!==u?(t={onParamsError:e=>{u.push({id:"diffViewParamsParsingError",status:"error",title:p("compare-version.error.invali
1dParams.title"),description:(0,a.jsx)("ul",{children:e.map(e=>{let[t,n]=e;return(0,a.jsx)("li",{children:p("compare-version.error.".concat(t),{input:n})},t)})})})}},l[0]=p,l[1]=u,l[2]=t):t=l[2];let{isActive:m}=ir(t);return l[3]!==d||l[4]!==m?(n=m&&(0,a.jsx)(ik,{documentId:d}),l[3]=d,l[4]=m,l[5]=n):n=l[5],l[6]!==o||l[7]!==n?(i=(0,a.jsxs)(a.Fragment,{children:[o,n]}),l[6]=o,l[7]=n,l[8]=i):i=l[8],i};function iE(e){let t,n,i,l=(0,s.c)(12),{children:r,currentMinWidth:o,flex:c,minWidth:u,paneKey:p,title:m,tone:h}=e,f=void 0===m?"Error":m,x=void 0===h?"critical":h;return l[0]!==f?(t=(0,a.jsx)(nP,{title:f}),l[0]=f,l[1]=t):t=l[1],l[2]!==r?(n=(0,a.jsx)(nm,{overflow:"auto",children:(0,a.jsx)(d.az,{paddingX:4,paddingY:5,children:r})}),l[2]=r,l[3]=n):n=l[3],l[4]!==o||l[5]!==c||l[6]!==u||l[7]!==p||l[8]!==t||l[9]!==n||l[10]!==x?(i=(0,a.jsxs)(nc,{currentMinWidth:o,flex:c,id:p,minWidth:u,tone:x,children:[t,n]}),l[4]=o,l[5]=c,l[6]=u,l[7]=p,l[8]=t,l[9]=n,l[10]=x,l[11]=i):i=l[11],i}function iI(e){let t=[{ms:300,messageKey:"panes.resolving.default-message"},{ms:5e3,messageKey:"panes.resolving.slow-resolve-message"}];if(h.Cu5){let n=["Check console for errors?","Is your observable/promise resolving?",e.length>0?"Structure path: ".concat(e.join(" â ")):""];t.push({ms:1e4,message:n.join("\n")})}let n=(0,I.of)(null);return(0,R.h)(...t.map(e=>n.pipe((0,ei.u)("messageKey"in e?{messageKey:e.messageKey}:{message:e.message}),(0,el.c)(e.ms))))}let iz=(0,v.I4)(d.so)(e3()),iT=(0,u.memo)(e=>{let t,n,i,l,o,d,p,m,f,x,v=(0,s.c)(28),{delay:g,flex:b,message:j,minWidth:y,paneKey:_,path:w,selected:S,title:k,tone:C}=e,E=void 0===g?300:g,I=void 0===j?iI:j,{t:z}=(0,h.Bdt)(r.Z7);e:{if("function"==typeof I){let e;v[0]!==I||v[1]!==w?(e=I(w?w.split(";"):[]),v[0]=I,v[1]=w,v[2]=e):e=v[2],t=e;break e}t=I}let T=t;v[3]!==T||v[4]!==z?(n=()=>"string"==typeof T?T:z("panes.resolving.default-message"),v[3]=T,v[4]=z,v[5]=n):n=v[5];let[P,A]=(0,u.useState)(n);v[6]!==T||v[7]!==z?(i=()=>{if("object"!=typeof T||"function"!=typeof T.subscribe)return;let e=T.subscribe(e=>{A("messageKey"in e?z(e.messageKey):e.message)});return()=>e.unsubscribe()},l=[T,z],v[6]=T,v[7]=z,v[8]=i,v[9]=l):(i=v[8],l=v[9]),(0,u.useEffect)(i,l);let[R,D]=(0,u.useState)(null),[M,B]=(0,u.useState)(!1);v[10]!==R?(o=()=>{if(R)return(0,c.X)(()=>B(!0))},d=[R],v[10]=R,v[11]=o,v[12]=d):(o=v[11],d=v[12]),(0,u.useEffect)(o,d);let Y=M?"":void 0,L=k||P;v[13]!==L?(p=(0,a.jsx)(h.gd4,{showText:!0,title:L}),v[13]=L,v[14]=p):p=v[14],v[15]!==p||v[16]!==Y?(m=(0,a.jsx)(iz,{align:"center","data-mounted":Y,direction:"column",height:"fill",justify:"center",ref:D,children:p}),v[15]=p,v[16]=Y,v[17]=m):m=v[17];let O=m;return v[18]!==O||v[19]!==E?(f=(0,a.jsx)(nm,{children:O}),v[18]=O,v[19]=E,v[20]=f):f=v[20],v[21]!==b||v[22]!==y||v[23]!==_||v[24]!==S||v[25]!==f||v[26]!==C?(x=(0,a.jsx)(nc,{flex:b,id:_,minWidth:y,selected:S,tone:C,children:f}),v[21]=b,v[22]=y,v[23]=_,v[24]=S,v[25]=f,v[26]=C,v[27]=x):x=v[27],x});function iP(){let e=(0,u.useContext)(p.Fi);if(!e)throw Error("DocumentPane: missing context value");return e}function iA(e){let t,n,i=(0,s.c)(8),{children:l,documentId:r,documentType:o}=e;return i[0]!==l||i[1]!==r||i[2]!==o?(t=(0,a.jsx)(iR,{documentId:r,documentType:o,children:l}),i[0]=l,i[1]=r,i[2]=o,i[3]=t):t=i[3],i[4]!==r||i[5]!==o||i[6]!==t?(n=(0,a.jsx)(h.ByQ,{documentId:r,documentType:o,children:t}),i[4]=r,i[5]=o,i[6]=t,i[7]=n):n=i[7],n}function iR(e){let t,n,i,l,r,o,d=(0,s.c)(25),{children:c,documentId:p,documentType:m}=e,{enabled:f}=(0,h.Dsj)(),{connectionState:x,onPathOpen:v,inspector:g,openInspector:b}=iP(),{selectedReleaseId:j}=(0,h.QO2)(),{params:y,setParams:_,createPathWithParams:w}=t0(),{studioUrl:S}=(0,h.HuN)(window.location.origin),k=null==y?void 0:y.comment,C=(0,u.useRef)(y);d[0]!==y?(t=()=>{C.current=y},n=[y],d[0]=y,d[1]=t,d[2]=n):(t=d[1],n=d[2]),(0,u.useLayoutEffect)(t,n),d[3]!==w||d[4]!==S?(i=e=>{let t=w({...C.current,comment:e,inspect:h.nHq});return"".concat(S).concat(t)},d[3]=w,d[4]=S,d[5]=i):i=d[5];let E=i;d[6]!==_?(l=()=>{_({...C.current,comment:void 0})},d[6]=_,d[7]=l):l=d[7];let I=l;d[8]!==(null==g?void 0:g.name)||d[9]!==b?(r=()=>{(null==g?void 0:g.name)!==h.nHq&&b(h.nHq)},d[8]=null==g?void 0:g.name,d[9]=b,d[10]=r):r=d[10];let z=r;if(!f){let e;return d[11]!==c?(e=(0,a.jsx)(a.Fragment,{children:c}),d[11]=c,d[12]=e):e=d[12],e}let T=(null==g?void 0:g.name)===h.nHq,P="connecting"===x;return d[13]!==c||d[14]!==p||d[15]!==m||d[16]!==E||d[17]!==I||d[18]!==z||d[19]!==v||d[20]!==k||d[21]!==j||d[22]!==T||d[23]!==P?(o=(0,a.jsx)(h.ixz,{documentId:p,documentType:m,getCommentLink:E,isCommentsOpen:T,isConnecting:P,onClearSelectedComment:I,onCommentsOpen:z,onPathOpen:v,selectedCommentId:k,sortOrder:"desc",type:"field",releaseId:j,children:c}),d[13]=c,d[14]=p,d[15]=m,d[16]=E,d[17]=I,d[18]=z,d[19]=v,d[20]=k,d[21]=j,d[22]=T,d[23]=P,d[24]=o):o=d[24],o}function iD(e){let{displayed:t,documentId:n}=e,{selectedReleaseId:i}=(0,h.QO2)(),{data:l}=(0,h.K0D)(),{data:r}=(0,h.gJZ)(),{data:o}=(0,h.gn8)({documentId:n}),a=t&&!t._createdAt,{params:s}=t0();return(0,u.useMemo)(()=>
1{if(!o)return{notCurrentReleases:[],currentReleases:[],inCreation:null};let e=o.map(e=>(0,h._Sr)(e)),n=l.reduce((n,l)=>{let r=e.includes((0,h._hI)(l._id)),o=(0,h._hI)(l._id);return a&&o===(0,h._Sr)(t._id||"")&&o===i?n.inCreation=l:r?n.currentReleases.push(l):n.notCurrentReleases.push(l),n},{notCurrentReleases:[],currentReleases:[],inCreation:null});if(!(null==s?void 0:s.historyVersion))return n;let d=r.find(e=>(0,h._hI)(e._id)===(null==s?void 0:s.historyVersion));return(null==d?void 0:d.state)==="archived"&&n.currentReleases.push(d),n},[r,a,null==t?void 0:t._id,o,null==s?void 0:s.historyVersion,l,i])}function iM(e){var t,n;let{displayed:i,documentId:l,editState:r}=e,{document:{drafts:{enabled:o}}}=(0,h.hA9)(),a=iD({displayed:i,documentId:l}),s=[null==r||null==(t=r.published)?void 0:t._id,o?null==r||null==(n=r.draft)?void 0:n._id:[]].flat(),d=a.currentReleases.map(e=>(null==r?void 0:r.id)&&(0,h.ctg)(r.id,(0,h._hI)(e._id))),c=s.concat(d).filter(e=>"string"==typeof e),p=(0,u.useMemo)(()=>c.findIndex(e=>e===(null==i?void 0:i._id)),[null==i?void 0:i._id,c]),m=(0,u.useMemo)(()=>{var e;return null!=(e=c[p-1])?e:void 0},[p,c]),f=(0,u.useMemo)(()=>{var e;return null!=(e=c[p+1])?e:void 0},[p,c]);return{position:p,previousId:m,nextId:f,stack:c}}function iB(){let e=(0,u.useContext)(p.DI);if(!e)throw Error("StructureTool: missing context value");return e}iT.displayName="Memo(LoadingPane)";let iY={},iL="inspect:",iO=[{id:"inspectors"},{id:"links"}],iH="sanity/structure/history";function iV(e){let{documentId:t,documentType:n,inspectors:i,onMenuItems:l}=e,r=i.length,[o,d]=(0,u.useState)(()=>Array.from(Array(r)));(0,u.useEffect)(()=>{if(o.length!==r){let e=Array.from(Array(r));for(let t=0;t<r;t++)e[t]=o[t];d(e)}},[r,o]);let c=(0,u.useCallback)((e,t)=>{d(n=>{let i=[...n];return i[e]=t,i})},[]);(0,u.useEffect)(()=>
1{l(o.filter(Boolean))},[o,l]);let p=(0,u.useMemo)(()=>i.map((e,i)=>e.useMenuItem?[function(e){let{documentId:t,documentType:n,index:i,setMenuItem:l,useMenuItem:r}=e;return(0,u.memo)(function(){let e,o,a,d=(0,s.c)(4);d[0]===Symbol.for("react.memo_cache_sentinel")?(e={documentId:t,documentType:n},d[0]=e):e=d[0];let c=r(e),p=(0,h.$6H)(c);return d[1]!==p?(o=()=>{l(i,p)},a=[p],d[1]=p,d[2]=o,d[3]=a):(o=d[2],a=d[3]),(0,u.useEffect)(o,a),null})}({documentId:t,documentType:n,index:i,setMenuItem:c,useMenuItem:e.useMenuItem}),e.name]:[()=>null,""]),[t,n,i,c]);return(0,a.jsx)(a.Fragment,{children:p.map(e=>{let[t,n]=e;return n&&(0,a.jsx)(t,{},n)})})}function iN(){let e,t,n=(0,s.c)(19),{connectionState:i,schemaType:l,title:o,displayed:a}=iP(),{t:d}=(0,h.Bdt)(r.Z7),c=!!a;n[0]!==a||n[1]!==l||n[2]!==c?(e={enabled:c,schemaType:l,value:a},n[0]=a,n[1]=l,n[2]=c,n[3]=e):e=n[3];let{error:u,value:p}=(0,h.MOl)(e);if("connecting"===i&&!c){let e;return n[4]===Symbol.for("react.memo_cache_sentinel")?(e={error:void 0,title:void 0},n[4]=e):e=n[4],e}if(o){let e;return n[5]!==o?(e={error:void 0,title:o},n[5]=o,n[6]=e):e=n[6],e}if(!a){let e,t,i=(null==l?void 0:l.title)||(null==l?void 0:l.name);return n[7]!==d||n[8]!==i?(e=d("panes.document-header-title.new.text",{schemaType:i}),n[7]=d,n[8]=i,n[9]=e):e=n[9],n[10]!==e?(t={error:void 0,title:e},n[10]=e,n[11]=t):t=n[11],t}if(u){let e,t;return n[12]!==u.message||n[13]!==d?(e=d("panes.document-list-pane.error.text",{error:u.message}),n[12]=u.message,n[13]=d,n[14]=e):e=n[14],n[15]!==e?(t={error:e,title:void 0},n[15]=e,n[16]=t):t=n[16],t}let m=null==p?void 0:p.title;return n[17]!==m?(t={error:void 0,title:m},n[17]=m,n[18]=t):t=n[18],t}iV.displayName="DocumentInspectorMenuItemsResolver";let iZ=["patch","commit"],iF=(0,u.memo)(function(){let e,t,n,i,l,o=(0,s.c)(12),{push:d}=(0,c.dj)(),{documentId:p,documentType:m,value:f}=iP(),x=iN(),v=x.error,g=(0,h.cUp)(p,m),b=(0,u.useRef)(g),j=t0(),{t:y}=(0,h.Bdt)(r.Z7);e:{if(!x.title&&!v&&!iZ.includes(null==g?void 0:g.op)&&"string"==typeof f.title&&(null==g?void 0:g.type)==="success"){e=f.title;break e}e=x.title}let _=e;o[0]!==y||o[1]!==_?(t=_||y("panes.document-operation-results.operation-undefined-title"),o[0]=y,o[1]=_,o[2]=t):t=o[2];let w=t;o[3]!==w?(n=w.length>25?"".concat(w.slice(0,25),"..."):w,o[3]=w,o[4]=n):n=o[4];let S=n;return o[5]!==S||o[6]!==g||o[7]!==j||o[8]!==d||o[9]!==y?(i=()=>{let e;if(g&&g!==b.current)return"error"===g.type&&d({closable:!0,duration:3e4,status:"error",title:y("panes.document-operation-results.operation-error",{context:g.op}),description:(0,a.jsxs)("details",{children:[(0,a.jsx)("summary",{children:y("panes.document-operation-results.error.summary.title")}),g.error.message]})}),"success"!==g.type||iZ.includes(g.op)||d({closable:!0,status:"success",title:(0,a.jsx)(h.HTc,{context:g.op,i18nKey:"panes.document-operation-results.operation-success",t:y,values:{op:g.op,title:S},components:{Strong:"strong"}})}),"success"===g.type&&"delete"===g.op&&(e=setTimeout(()=>j.closeCurrentAndAfter(),0)),b.current=g,()=>clearTimeout(e)},l=[g,j,d,y,S],o[5]=S,o[6]=g,o[7]=j,o[8]=d,o[9]=y,o[10]=i,o[11]=l):(i=o[10],l=o[11]),(0,u.useEffect)(i,l),null}),iK=(0,v.I4)(d.Zp)({position:"relative",zIndex:1,lineHeight:0});function iW(e){let t,n,i,l,c,u,p,f,x,v,g,b,j=(0,s.c)(25);j[0]!==e?({as:i,children:t,closeButtonLabel:n,onClose:l,title:u,...c}=e,j[0]=e,j[1]=t,j[2]=n,j[3]=i,j[4]=l,j[5]=c,j[6]=u):(t=j[1],n=j[2],i=j[3],l=j[4],c=j[5],u=j[6]);let{t:y}=(0,h.Bdt)(r.Z7);return j[7]!==u?(p=(0,a.jsx)(d.az,{flex:1,padding:3,children:(0,a.jsx)(d.EY,{as:"h1",size:1,weight:"medium",children:u})}),j[7]=u,j[8]=p):p=j[8],j[9]!==y?(f=y("document-inspector.close-button.tooltip"),j[9]=y,j[10]=f):f=j[10],j[11]!==f?(x={content:f},j[11]=f,j[12]=x):x=j[12],j[13]!==n||j[14]!==l||j[15]!==x?(v=(0,a.jsx)(d.az,{flex:"none",padding:1,children:(0,a.jsx)(o.$n,{"aria-label":n,icon:m.USm,mode:"bleed",onClick:l,tooltipProps:x})}),j[13]=n,j[14]=l,j[15]=x,j[16]=v):v=j[16],j[17]!==p||j[18]!==v?(g=(0,a.jsxs)(d.so,{padding:2,children:[p,v]}),j[17]=p,j[18]=v,j[19]=g):g=j[19],j[20]!==t||j[21]!==i||j[22]!==c||j[23]!==g?(b=(0,a.jsxs)(iK,{...c,as:i,children:[g,t]}),j[20]=t,j[21]=i,j[22]=c,j[23]=g,j[24]=b):b=j[24],b}function iJ(e){let t,n,i,l=(0,s.c)(14),{documentId:r,documentType:o,flex:c}=e,{collapsed:u}=np(),{closeInspector:p,inspector:m}=iP(),{features:f}=iB();l[0]!==p||l[1]!==m?(t=()=>{m&&p(m.name)},l[0]=p,l[1]=m,l[2]=t):t=l[2];let x=t;if(u||!m)return null;let v=m.component;l[3]!==v||l[4]!==r||l[5]!==o||l[6]!==x?(n=(0,a.jsx)(v,{onClose:x,documentId:r,documentType:o}),l[3]=v,l[4]=r,l[5]=o,l[6]=x,l[7]=n):n=l[7];let g=n;if(f.resizablePanes){let e;return l[8]!==g||l[9]!==c?(e=(0,a.jsx)(h.cMO,{as:"aside","data-ui":"DocumentInspectorPanel",flex:c,resizerPosition:"left",maxWidth:540,minWidth:320,children:g}),l[8]=g,l[9]=c,l[10]=e):e=l[10],e}return l[11]!==g||l[12]!==c?(i=(0,a.jsx)(d.az,{as:"aside","data-ui":"DocumentInspectorPanel",flex:c,children:g}),l[11]=g,l[12]=c,l[13]=i):i=l[13],i}function iU(e,t,n){let i,l,r,o,a,d=(0,s.c)(16),c=(0,h.P$5)();
1d[0]!==t||d[1]!==e?(i=["studio.structure-tool",e,t].filter(Boolean),d[0]=t,d[1]=e,d[2]=i):i=d[2];let u=i.join(".");if(d[3]!==n||d[4]!==c||d[5]!==u){let e;d[7]!==n?(e=e=>null===e?n:e,d[7]=n,d[8]=e):e=d[8],r=c.getKey(u).pipe((0,A.T)(e)),d[3]=n,d[4]=c,d[5]=u,d[6]=r}else r=d[6];l=r;let p=(0,y.J)(l,n);d[9]!==c||d[10]!==u||d[11]!==p?(o=e=>{e!==p&&c.setKey(u,e)},d[9]=c,d[10]=u,d[11]=p,d[12]=o):o=d[12];let m=o;return d[13]!==m||d[14]!==p?(a=[p,m],d[13]=m,d[14]=p,d[15]=a):a=d[15],a}let i$={id:"parsed",title:"document-inspector.view-mode.parsed"},iG={id:"raw",title:"document-inspector.view-mode.raw-json"},iQ=[i$,iG],iq=new ep({maxSize:1e3});function iX(e){let{path:t}=e,n=iq.get(t);void 0!==n&&iq.set(t,!n)}function i0(e){let t=window.getSelection();if(t){let n=document.createRange();t.removeAllRanges(),n.selectNodeContents(e),t.addRange(n)}}function i1(e){i0(e.currentTarget)}function i2(e){65===e.keyCode&&(e.metaKey||e.ctrlKey)&&(e.preventDefault(),i0(e.currentTarget))}let i3=v.I4.div(e=>{let{theme:t}=e,{color:n,fonts:i,space:l}=t.sanity;return(0,v.AH)(e4(),i.code.family,i.code.sizes[1].fontSize,i.code.sizes[1].lineHeight,(0,d.D0)(l[4]),(0,d.D0)(l[3]),(0,d.D0)(l[4]),i.code.sizes[1].fontSize,i.code.sizes[1].lineHeight,i.code.sizes[1].fontSize,i.code.sizes[1].lineHeight,(0,d.D0)(l[4]/2),n.syntax.property,n.syntax.constant,(0,d.D0)(l[3]),n.syntax.string,n.syntax.boolean,n.syntax.number)});function i4(e){let t,n,i,l=(0,s.c)(8),{onChange:o,query:c}=e;l[0]!==o?(t=e=>o(e.target.value),l[0]=o,l[1]=t):t=l[1];let u=t,{t:p}=(0,h.Bdt)(r.Z7);l[2]!==p?(n=p("document-inspector.search.placeholder"),l[2]=p,l[3]=n):n=l[3];let f=c||"";return l[4]!==u||l[5]!==n||l[6]!==f?(i=(0,a.jsx)(d.ks,{icon:m.WIv,onChange:u,placeholder:n,radius:2,value:f}),l[4]=u,l[5]=n,l[6]=f,l[7]=i):i=l[7],i}function i5(e){let t,n,i,l,u,p,m,f,x,v,g,b,j,y,_,w,S=(0,s.c)(49),{value:k}=e,{onInspectClose:C,paneKey:E}=iP(),I="".concat(E,"_inspect_"),[z,T]=iU("inspect-view-mode",null,"parsed");S[0]!==z?(t=iQ.find(e=>e.id===z),S[0]=z,S[1]=t):t=S[1];let P=t;S[2]!==T?(n=()=>{T(i$.id)},S[2]=T,S[3]=n):n=S[3];let A=n;S[4]!==T?(i=()=>{T(iG.id)},S[4]=T,S[5]=i):i=S[5];let R=i,{t:D}=(0,h.Bdt)(r.Z7),M="".concat(I,"dialog");S[6]!==D||S[7]!==k?(l=(0,h.u4i)(k)&&(0,h.KgX)(k._id)&&(0,h.KgX)(k._type)?(0,a.jsx)(h.HTc,{t:D,i18nKey:"document-inspector.dialog.title",components:{DocumentTitle:()=>(0,a.jsx)("em",{children:(0,a.jsx)(tV,{document:k})})}}):(0,a.jsx)("em",{children:D("document-inspector.dialog.title-no-value")}),S[6]=D,S[7]=k,S[8]=l):l=S[8],S[9]===Symbol.for("react.memo_cache_sentinel")?(u={position:"sticky",bottom:0,zIndex:3},S[9]=u):u=S[9];let B="".concat(I,"tabpanel"),Y="".concat(I,"tab-").concat(i$.id);S[10]!==D?(p=D(i$.title),S[10]=D,S[11]=p):p=S[11];let L=P===i$;S[12]!==A||S[13]!==B||S[14]!==Y||S[15]!==p||S[16]!==L?(m=(0,a.jsx)(o.oz,{"aria-controls":B,id:Y,label:p,onClick:A,selected:L}),S[12]=A,S[13]=B,S[14]=Y,S[15]=p,S[16]=L,S[17]=m):m=S[17];let O="".concat(I,"tabpanel"),H="".concat(I,"tab-").concat(iG.id);S[18]!==D?(f=D(iG.title),S[18]=D,S[19]=f):f=S[19];let V=P===iG;S[20]!==R||S[21]!==O||S[22]!==H||S[23]!==f||S[24]!==V?(x=(0,a.jsx)(o.oz,{"aria-controls":O,id:H,label:f,onClick:R,selected:V}),S[20]=R,S[21]=O,S[22]=H,S[23]=f,S[24]=V,S[25]=x):x=S[25],S[26]!==m||S[27]!==x?(v=(0,a.jsx)(d.Zp,{padding:3,paddingTop:0,shadow:1,style:u,children:(0,a.jsxs)(d.wb,{space:1,children:[m,x]})}),S[26]=m,S[27]=x,S[28]=v):v=S[28];let N="".concat(I,"tab-").concat(z),Z="".concat(I,"tabpanel");return S[29]===Symbol.for("react.memo_cache_sentinel")?(g={outline:"none"},S[29]=g):g=S[29],S[30]!==k||S[31]!==P?(b=P===i$&&(0,a.jsx)(i3,{children:(0,a.jsx)(eu.A,{data:k,isExpanded:function e(t,n){let i=iq.get(t);return void 0===i?(iq.set(t,Array.isArray(n)||(0,h.u4i)(n)),e(t,n)):i},onClick:iX,search:i4,filterOptions:{ignoreCase:!0}})}),S[30]=k,S[31]=P,S[32]=b):b=S[32],S[33]!==k||S[34]!==P?(j=P===iG&&(0,a.jsx)(d.Cy,{language:"json",tabIndex:0,onKeyDown:i2,onDoubleClick:i1,onFocus:i1,size:1,children:JSON.stringify(k,null,2)}),S[33]=k,S[34]=P,S[35]=j):j=S[35],S[36]!==N||S[37]!==Z||S[38]!==b||S[39]!==j?(y=(0,a.jsxs)(c.Kp,{"aria-labelledby":N,flex:1,id:Z,overflow:"auto",padding:4,style:g,children:[b,j]}),S[36]=N,S[37]=Z,S[38]=b,S[39]=j,S[40]=y):y=S[40],S[41]!==v||S[42]!==y?(_=(0,a.jsxs)(d.so,{direction:"column",height:"fill",children:[v,y]}),S[41]=v,S[42]=y,S[43]=_):_=S[43],S[44]!==C||S[45]!==_||S[46]!==M||S[47]!==l?(w=(0,a.jsx)(o.lG,{bodyHeight:"fill",id:M,header:l,onClose:C,onClickOutside:C,padding:!1,width:2,children:_}),S[44]=C,S[45]=_,S[46]=M,S[47]=l,S[48]=w):w=S[48],w}function i6(e){let t,n,i,l,r,c,u,p,m,h,f,x=(0,s.c)(22);x[0]!==e?({action:n,content:i,icon:t,tone:r,paddingY:c,...l}=e,x[0]=e,x[1]=t,x[2]=n,x[3]=i,x[4]=l,x[5]=r,x[6]=c):(t=x[1],n=x[2],i=x[3],l=x[4],r=x[5],c=x[6]);let v=void 0===r?"transparent":r,g=void 0===c?2:c;return x[7]!==t?(u=t&&(0,a.jsx)(d.EY,{size:0,children:(0,a.jsx)(t,{})}),x[7]=t,x[8]=u):u=x[8],x[9]!==i?(p=(0,a.jsx)(d.so,{align:"center",flex:1,gap:2,paddingY:2,children:i}),x[9]=i,x[10]=p):p=x[10],x[11]!==n?(m=n&&(0,a.jsx)(o.$n,{...n,mode:n.mode||"ghost",tone:n.tone||"default"}),x[11]=n,x[12]=m):m=x[12],x[13]!==u||x[14]!==p||x[15]!==m?(h=(0,a.jsxs)(d.so,{align:"center",gap:3,paddingX:2,children:[u,p,m]}),x[13]=u,x[14]=p,x[15]=m,x[16]=h):h=x[16],x[17]!==g||x[18]!==l||x[19]!==h||x[20]!==v?(f=(0,a.jsx)(d.az,{padding:1,children:(0,a.jsx)(d.Zp,{radius:3,paddingX:2,paddingY:g,tone:v,...l,children:h})}),x[17]=g,x[18]=l,x[19]=h,x[20]=v,x[21]=f):f=x[21],f}function i7(){let e=(0,s.c)(3),{isDeleted:t,isDeleting:n,ready:i}=iP(),{selectedPerspective:l}=(0,h.QO2)();if(!i)return null;if(!(0,h.xo4)(l)&&!(0,h.o2j)(l)&&"archived"===l.state){let t;return e[0]!==l?(t=(0,a.jsx)(i9,{release:l}),e[0]=l,e[1]=t):t=e[1],t}if(t&&!n){let t;return e[2]===Symbol.for("react.memo_cache_sentinel")?(t=(0,a.jsx)(i8,{}),e[2]=t):t=e[2],t}}function i8(){let e,t,n,i,l,o,c=(0,s.c)(17),{documentId:u,documentType:p}=iP(),{restore:f}=(0,h.QSs)(u,p),{navigateIntent:x}=(0,_.rd)();c[0]!==u||c[1]!==p||c[2]!==x||c[3]!==f?(e=()=>{f.execute("lastRevision"),x("edit",{id:u,type:p})},c[0]=u,c[1]=p,c[2]=x,c[3]=f,c[4]=e):e=c[4];let v=e,{t:g}=(0,h.Bdt)(r.Z7);return c[5]!==g?(t=g("banners.deleted-document-banner.restore-button.text"),c[5]=g,c[6]=t):t=c[6],c[7]!==v||c[8]!==t?(n={onClick:v,text:t},c[7]=v,c[8]=t,c[9]=n):n=c[9],c[10]!==g?(i=g("banners.deleted-document-banner.text"),c[10]=g,c[11]=i):i=c[11],c[12]!==i?(l=(0,a.jsx)(d.EY,{size:1,weight:"medium",children:i}),c[12]=i,c[13]=l):l=c[13],c[14]!==n||c[15]!==l?(o=(0,a.jsx)(i6,{action:n,content:l,"data-testid":"deleted-document-banner",icon:m.Eoh}),c[14]=n,c[15]=l,c[16]=o):o=c[16],o}let i9=e=>{var t,n,i;let l,r,o,c=(0,s.c)(8),{release:u}=e,{t:p}=(0,h.Bdt)();
1return c[0]!==(null==(t=u.metadata)?void 0:t.title)||c[1]!==p?(l=(null==(n=u.metadata)?void 0:n.title)||p("release.placeholder-untitled-release"),c[0]=null==(i=u.metadata)?void 0:i.title,c[1]=p,c[2]=l):l=c[2],c[3]!==l?(r={title:l},c[3]=l,c[4]=r):r=c[4],c[5]!==p||c[6]!==r?(o=(0,a.jsx)(i6,{tone:"caution",content:(0,a.jsx)(d.EY,{size:1,weight:"medium",children:(0,a.jsx)(h.HTc,{t:p,i18nKey:"banners.deleted-release-banner.text",values:r})}),"data-testid":"deleted-release-banner",icon:m.tkA}),c[5]=p,c[6]=r,c[7]=o):o=c[7],o};function le(){let e,t,n=(0,s.c)(5),{schemaType:i}=iP(),{t:l}=(0,h.Bdt)(r.Z7);return(0,f.fq)(i)?(n[0]!==l?(e=(0,a.jsx)(h.HTc,{t:l,i18nKey:"banners.deprecated-document-type-banner.text"}),n[0]=l,n[1]=e):e=n[1],n[2]!==i.deprecated.reason||n[3]!==e?(t=(0,a.jsx)(i6,{content:(0,a.jsxs)(d.EY,{size:1,weight:"medium",children:[e," ",i.deprecated.reason]}),"data-testid":"deprecated-document-type-banner",icon:m.YZv}),n[2]=i.deprecated.reason,n[3]=e,n[4]=t):t=n[4],t):null}let lt=(0,eh.g_)({name:"Ask To Edit Dialog Opened",version:1,description:'User clicked the "Ask to edit" button in the document permissions banner'}),ln=(0,eh.g_)({name:"Ask To Edit Request Sent",version:1,description:"User sent a role change request from the dialog"}),li=(0,v.I4)(d.az)(e5());function ll(e){let t,n,i,l,p,m,f,x,v,g,b,j,_,w,S,k=(0,s.c)(56),{onClose:C,onRequestSubmitted:E}=e,{t:z}=(0,h.Bdt)(r.Z7),T=(0,em.Jr)(),P="request-permissions-".concat((0,u.useId)()),R=(0,h.M91)();k[0]===Symbol.for("react.memo_cache_sentinel")?(t={apiVersion:"2024-09-26"},k[0]=t):t=k[0];let B=(0,h.tH7)(t),Y=(0,c.dj)(),L=(0,h.YKH)(),[O,H]=(0,u.useState)(!1),[V,N]=(0,u.useState)(""),[Z,F]=(0,u.useState)(),[K,W]=(0,u.useState)(!1),[J,U]=(0,u.useState)(!1);e:{let e,t="administrator";if(!R||!B){let e;k[1]===Symbol.for("react.memo_cache_sentinel")?(e=(0,I.of)(t),k[1]=e):e=k[1],n=e;break e}if(k[2]!==B.observable||k[3]!==R){let n,i;k[5]===Symbol.for("react.memo_cache_sentinel")?(n=e=>e.filter(lo).find(lr)?"editor":t,k[5]=n):n=k[5],k[6]===Symbol.for("react.memo_cache_sentinel")?(i=()=>(0,I.of)(t),k[6]=i):i=k[6],e=B.observable.request({url:"/projects/".concat(R,"/roles")}).pipe((0,A.T)(n),(0,D.Z)(t),(0,M.W)(i)),k[2]=B.observable,k[3]=R,k[4]=e}else e=k[4];n=e}let $=(0,y.J)(n);k[7]!==B||k[8]!==V||k[9]!==E||k[10]!==R||k[11]!==$||k[12]!==T||k[13]!==Y?(i=()=>{var e;H(!0),B.request({url:"/access/project/".concat(R,"/requests"),method:"post",body:{note:V,requestUrl:null==(e=window)?void 0:e.location.href,requestedRole:$,type:"role"}}).then(e=>{e&&(E&&E(),T.log(ln),Y.push({title:"Edit access requested"}))}).catch(e=>{var t,n,i;let l=null==e||null==(t=e.response)?void 0:t.statusCode,r=null==e||null==(i=e.response)||null==(n=i.body)?void 0:n.message;
1429===l&&(W(!0),F(r)),409===l?(U(!0),F(r)):Y.push({title:"There was a problem submitting your request.",status:"error"})}).finally(()=>{H(!1)})},k[7]=B,k[8]=V,k[9]=E,k[10]=R,k[11]=$,k[12]=T,k[13]=Y,k[14]=i):i=k[14];let G=i,Q=L.fullscreen;k[15]!==z?(l=z("request-permission-dialog.header.text"),k[15]=z,k[16]=l):l=k[16],k[17]!==z?(p=z("confirm-dialog.cancel-button.fallback-text"),k[17]=z,k[18]=p):p=k[18],k[19]!==C||k[20]!==p?(m={onClick:C,text:p},k[19]=C,k[20]=p,k[21]=m):m=k[21];let q=K||J;return k[22]!==z?(f=z("request-permission-dialog.confirm-button.text"),k[22]=z,k[23]=f):f=k[23],k[24]!==O||k[25]!==G||k[26]!==q||k[27]!==f?(x={onClick:G,loading:O,disabled:q,text:f,tone:"primary",type:"submit"},k[24]=O,k[25]=G,k[26]=q,k[27]=f,k[28]=x):x=k[28],k[29]!==x||k[30]!==m?(v={cancelButton:m,confirmButton:x},k[29]=x,k[30]=m,k[31]=v):v=k[31],k[32]!==z?(g=z("request-permission-dialog.description.text"),k[32]=z,k[33]=g):g=k[33],k[34]!==g?(b=(0,a.jsx)(d.EY,{children:g}),k[34]=g,k[35]=b):b=k[35],k[36]!==J||k[37]!==K||k[38]!==O||k[39]!==Z||k[40]!==V||k[41]!==G||k[42]!==z?(j=K||J?(0,a.jsx)(d.Zp,{tone:"caution",padding:3,radius:2,shadow:1,children:(0,a.jsxs)(d.EY,{size:1,children:[K&&(0,a.jsx)(a.Fragment,{children:null!=Z?Z:z("request-permission-dialog.warning.limit-reached.text")}),J&&(0,a.jsx)(a.Fragment,{children:null!=Z?Z:z("request-permission-dialog.warning.denied.text")})]})}):(0,a.jsxs)(d.BJ,{space:3,paddingBottom:0,children:[(0,a.jsx)(d.ks,{placeholder:z("request-permission-dialog.note-input.placeholder.text"),disabled:O,onKeyDown:e=>{"Enter"===e.key&&G()},maxLength:150,value:V,onChange:e=>{N(e.currentTarget.value)}}),(0,a.jsx)(d.EY,{align:"right",muted:!0,size:1,children:"".concat(V.length,"/").concat(150)})]}),k[36]=J,k[37]=K,k[38]=O,k[39]=Z,k[40]=V,k[41]=G,k[42]=z,k[43]=j):j=k[43],k[44]!==b||k[45]!==j?(_=(0,a.jsx)(li,{children:(0,a.jsxs)(d.BJ,{space:4,children:[b,j]})}),k[44]=b,k[45]=j,k[46]=_):_=k[46],k[47]!==P||k[48]!==C||k[49]!==v||k[50]!==_||k[51]!==l?(w=(0,a.jsx)(o.lG,{width:1,id:P,header:l,footer:v,onClose:C,onClickOutside:C,children:_}),k[47]=P,k[48]=C,k[49]=v,k[50]=_,k[51]=l,k[52]=w):w=k[52],k[53]!==w||k[54]!==L.fullscreen?(S=(0,a.jsx)(c.Co,{position:"fixed",zOffset:Q,children:w}),k[53]=w,k[54]=L.fullscreen,k[55]=S):S=k[55],S}function lr(e){return"editor"===e.name}function lo(e){return null==e?void 0:e.appliesToUsers}(0,v.I4)(d.so).attrs({align:"center",direction:"column",justify:"center"})(e6());let la={loading:!0,error:!1,status:void 0},ls={loading:!1,error:!1,status:"none"},ld={loading:!1,error:!1,status:"declined"},lc={loading:!1,error:!1,status:"pending"},lu={loading:!1,error:!1,status:"expired"};function lp(e){let t,n,i,l,o,c,p,f,x,v,g,b,j=(0,s.c)(33),{requiredPermission:_}=e,w=(0,h.iZK)(),{data:S,loading:k,error:C}=(()=>{let e,t,n,i=(0,s.c)(9);i[0]===Symbol.for("react.memo_cache_sentinel")?(e={apiVersion:"2024-07-01"},i[0]=e):e=i[0];let l=(0,h.tH7)(e),r=(0,h.M91)();e:{var o,a;let e;if(!l||!r){let e;i[1]===Symbol.for("react.memo_cache_sentinel")?(e=(0,I.of)(ls),i[1]=e):e=i[1],t=e;break e}i[2]!==l||i[3]!==r?(o=l,a=r,e=o.observable.request({url:"/access/requests/me",tag:"use-role-requests-status"}).pipe((0,A.T)(e=>{if(!e||0===e.length)return ls;let t=e.filter(e=>e.resourceId===a&&"role"===e.type),n=t.find(e=>"declined"===e.status);return n&&(0,ef.A)((0,ex.A)(new Date(n.createdAt),2),new Date)?ld:t.find(e=>"pending"===e.status&&(0,ef.A)((0,ex.A)(new Date(e.createdAt),2),new Date))?lc:t.find(e=>"pending"===e.status&&(0,ev.A)((0,ex.A)(new Date(e.createdAt),2),new Date))?lu:ls}),(0,M.W)(e=>(console.error("Failed to fetch access requests",e),(0,I.of)({loading:!1,error:!0,status:void 0}))),(0,D.Z)(la)),i[2]=l,i[3]=r,i[4]=e):e=i[4],t=e}let d=t,{loading:c,error:u,status:p}=(0,y.J)(d,la);return i[5]!==u||i[6]!==c||i[7]!==p?(n={data:p,loading:c,error:u},i[5]=u,i[6]=c,i[7]=p,i[8]=n):n=i[8],n})(),[E,z]=(0,u.useState)(!1);t="pending"===S||"declined"===S||E,j[0]!==(null==w?void 0:w.roles)?(n=(null==w?void 0:w.roles)||[],j[0]=null==w?void 0:w.roles,j[1]=n):n=j[1];let T=n,P=1===T.length&&"viewer"===T[0].name,[R,B]=(0,u.useState)(!1);j[2]===Symbol.for("react.memo_cache_sentinel")?(i={style:"short"},j[2]=i):i=j[2];let Y=(0,h.FfM)(i),{t:L}=(0,h.Bdt)(r.Z7),O=(0,em.Jr)();j[3]!==T||j[4]!==Y?(l=T.map(lh),o=Y.formatToParts(l).map(lm),j[3]=T,j[4]=Y,j[5]=l,j[6]=o):(l=j[5],o=j[6]);let H=o;return j[7]!==H?(c={Roles:()=>(0,a.jsx)(a.Fragment,{children:H})},j[7]=H,j[8]=c):c=j[8],j[9]!==l||j[10]!==H.length?(p={count:H.length,roles:l},j[9]=l,j[10]=H.length,j[11]=p):p=j[11],j[12]!==_||j[13]!==L||j[14]!==c||j[15]!==p?(f=(0,a.jsx)(d.EY,{size:1,weight:"medium",children:(0,a.jsx)(h.HTc,{t:L,i18nKey:"banners.permission-check-banner.missing-permission",components:c,values:p,context:_})}),j[12]=_,j[13]=L,j[14]=c,j[15]=p,j[16]=f):f=j[16],j[17]!==P||j[18]!==t||j[19]!==C||j[20]!==k||j[21]!==S||j[22]!==L||j[23]!==O?(x=P&&S&&!C&&!k?{onClick:t?void 0:()=>{B(!0),O.log(lt)},text:L(t?"banners.permission-check-banner.request-permission-button.sent":"banners.permission-check-banner.request-permission-button.text"),tone:t?"default":"primary",disabled:t,mode:t?"bleed":void 0}:void 0,j[17]=P,j[18]=t,j[19]=C,j[20]=k,j[21]=S,j[22]=L,j[23]=O,j[24]=x):x=j[24],j[25]!==f||j[26]!==x?(v=(0,a.jsx)(i6,{content:f,action:x,"data-testid":"permission-check-banner",icon:m.Eoh}),j[25]=f,j[26]=x,j[27]=v):v=j[27],j[28]!==R?(g=R&&(0,a.jsx)(ll,{onClose:()=>B(!1),onRequestSubmitted:()=>{z(!0),B(!1)}}),j[28]=R,j[29]=g):g=j[29],j[30]!==g||j[31]!==v?(b=(0,a.jsxs)(a.Fragment,{children:[v,g]}),j[30]=g,j[31]=v,j[32]=b):b=j[32],b}function lm(e){return"element"===e.type?(0,a.jsx)("code",{children:e.value},e.value):e.value}function lh(e){return e.title}let lf=(0,u.memo)(()=>{var e,t,n,i,l,o,s,c;let p=(0,h.yKO)(),{selectedReleaseId:f}=(0,h.QO2)(),{params:x,groupIndex:v,routerPanesState:g,replaceCurrent:b,BackLink:j}=t0(),_=null==(e=g[v])?void 0:e[0].id,w=null==(t=g[v-1])?void 0:t[0],k=null==w?void 0:w.id,C=!!(null==w||null==(n=w.params)?void 0:n.rev),E=(0,u.useMemo)(()=>(null==x?void 0:x.parentRefPath)&&(0,S.sH)(x.parentRefPath)||null,[null==x?void 0:x.parentRefPath]),{t:z}=(0,h.Bdt)(r.Z7),T=(0,u.useMemo)(()=>{let e=null==E?void 0:E[0];if(!k||!e||!E)return(0,I.of)({loading:!1});let t=(0,h.IMx)(k),n=(0,S.sH)(e),i=n.findIndex(e=>"object"==typeof e&&"_key"in e);return(0,B.x)((0,I.of)({loading:!0}),p.unstable_observePathsDocumentPair(t,-1===i?n:n.slice(0,i),{version:f}).pipe((0,er.B)(750),(0,A.T)(e=>{var t;let{draft:n,published:i,version:l}=e;return{loading:!1,result:{availability:{draft:n.availability,published:i.availability,...(null==l?void 0:l.availability)?{version:l.availability}:{}},refValue:null==(t=(0,S.Jt)((null==l?void 0:l.snapshot)||n.snapshot||i.snapshot,E))?void 0:t._ref}}})))},[f,p,k,E]),P=(0,y.J)(T,{loading:!0}),R=(0,u.useCallback)(()=>{var e;P.loading||(null==(e=P.result)?void 0:e.refValue)&&b({id:P.result.refValue,params:x})},[P.loading,P.result,b,x]);return k&&E&&!C&&!P.loading&&((null==(i=P.result)?void 0:i.availability.draft.available)||(null==(l=P.result)?void 0:l.availability.published.available))&&(null==(o=P.result)?void 0:o.refValue)!==_?(0,a.jsx)(i6,{action:(null==(s=P.result)?void 0:s.refValue)?{onClick:R,icon:m.Fjq,text:z("banners.reference-changed-banner.reason-changed.reload-button.text")}:{as:j,icon:m.USm,text:z("banners.reference-changed-banner.reason-removed.close-button.text")},"data-testid":"reference-changed-banner",content:(0,a.jsx)(d.EY,{size:1,weight:"medium",children:z((null==(c=P.result)?void 0:c.refValue)?"banners.reference-changed-banner.reason-changed.text":"banners.reference-changed-banner.reason-removed.text")}),icon:m.sAQ,tone:"caution"}):null});function lx(){let{t:e}=(0,h.Bdt)(r.Z7),{t:t}=(0,h.Bdt)(),{data:n}=(0,h.gJZ)(),{params:i,setParams:l}=t0(),o=(0,u.useMemo)(()=>n.find(e=>(0,h._hI)(e._id)===(null==i?void 0:i.historyVersion)),[n,null==i?void 0:i.historyVersion]),s=(null==o?void 0:o.state)==="published"?"banners.published-release.description":"banners.archived-release.description",c=(null==o?void 0:o.metadata.title)||t("release.placeholder-untitled-release");return(0,a.jsx)(i6,{tone:"caution",content:(0,a.jsx)(d.EY,{size:1,children:(0,a.jsx)(h.HTc,{t:e,i18nKey:s,values:{title:c},components:{VersionBadge:(0,h.bSq)(o)}})}),action:(null==i?void 0:i.archivedRelease)?void 0:{text:"Go back to published version",onClick:()=>{l({...i,rev:(null==i?void 0:i.historyEvent)||void 0,since:void 0,historyVersion:void 0})}}})}lf.displayName="Memo(ReferenceChangedBanner)";let lv=v.I4.img(e7()),lg=e=>{let t,n,i,l,c,p,f,x,v,g,b,j,y=(0,s.c)(22),{onClose:_}=e,{t:w}=(0,h.Bdt)(r.Z7),S=(0,u.useRef)(null);
1return y[0]===Symbol.for("react.memo_cache_sentinel")?(t=()=>[S.current],y[0]=t):t=y[0],(0,d.PR)(_,t),y[1]===Symbol.for("react.memo_cache_sentinel")?(n=(0,a.jsx)(lv,{src:"https://cdn.sanity.io/images/pyrmmpch/production/b47224e2f3a7d1747e43b9da1ac31739250e628b-632x376.png",alt:"Canvas"}),y[1]=n):n=y[1],y[2]===Symbol.for("react.memo_cache_sentinel")?(i=(0,a.jsx)(d.EY,{size:1,weight:"semibold",children:"Canvas"}),y[2]=i):i=y[2],y[3]===Symbol.for("react.memo_cache_sentinel")?(l=(0,a.jsxs)(d.so,{paddingY:1,gap:2,children:[i,(0,a.jsx)(d.EY,{size:1,muted:!0,children:(0,a.jsx)(m.v5M,{})})]}),y[3]=l):l=y[3],y[4]!==w?(c=w("canvas.banner.popover-heading"),y[4]=w,y[5]=c):c=y[5],y[6]!==c?(p=(0,a.jsx)(d.az,{paddingTop:3,children:(0,a.jsx)(d.DZ,{size:1,children:c})}),y[6]=c,y[7]=p):p=y[7],y[8]!==w?(f=w("canvas.banner.popover-description"),y[8]=w,y[9]=f):f=y[9],y[10]!==f?(x=(0,a.jsx)(d.az,{paddingTop:4,children:(0,a.jsx)(d.EY,{size:1,children:f})}),y[10]=f,y[11]=x):x=y[11],y[12]!==p||y[13]!==x?(v=(0,a.jsxs)(d.so,{paddingX:4,paddingBottom:4,paddingTop:3,direction:"column",children:[l,p,x]}),y[12]=p,y[13]=x,y[14]=v):v=y[14],y[15]!==w?(g=w("canvas.banner.popover-button-text"),y[15]=w,y[16]=g):g=y[16],y[17]!==g?(b=(0,a.jsx)(d.so,{width:"full",gap:3,justify:"flex-end",paddingX:4,paddingBottom:4,children:(0,a.jsx)(o.$n,{mode:"bleed",text:g,autoFocus:!0,tone:"primary",href:"https://snty.link/canvas-docs",target:"_blank",rel:"noopener noreferrer",as:"a",iconRight:m.ZPM})}),y[17]=g,y[18]=b):b=y[18],y[19]!==b||y[20]!==v?(j=(0,a.jsx)(d.Zp,{radius:3,overflow:"hidden",width:0,ref:S,children:(0,a.jsxs)(d.mc,{width:0,children:[n,v,b]})}),y[19]=b,y[20]=v,y[21]=j):j=y[21],j},lb=e=>{let t,n,i,l,c,p,f,x,v=(0,s.c)(17),{documentId:g}=e,{t:b}=(0,h.Bdt)(r.Z7),[j,y]=(0,u.useState)(!1),_=(0,h.tfA)(g);e:{let e;if("published"===_){let e;v[0]!==b?(e=b("canvas.banner.linked-text.published"),v[0]=b,v[1]=e):e=v[1],t=e;break e}if("draft"===_){let e;v[2]!==b?(e=b("canvas.banner.linked-text.draft"),v[2]=b,v[3]=e):e=v[3],t=e;break e}v[4]!==b?(e=b("canvas.banner.linked-text.version"),v[4]=b,v[5]=e):e=v[5],t=e}let w=t;v[6]===Symbol.for("react.memo_cache_sentinel")?(n=()=>y(ly),v[6]=n):n=v[6];let S=n;v[7]===Symbol.for("react.memo_cache_sentinel")?(i=()=>y(!1),v[7]=i):i=v[7];let k=i;return v[8]!==w?(l=(0,a.jsx)(d.EY,{size:1,weight:"medium",children:w}),v[8]=w,v[9]=l):l=v[9],v[10]===Symbol.for("react.memo_cache_sentinel")?(c=(0,a.jsx)(lg,{onClose:k}),p=(0,a.jsx)(o.$n,{tooltipProps:null,mode:"bleed",tone:"default",icon:m.YzR,onClick:S}),v[10]=c,v[11]=p):(c=v[10],p=v[11]),v[12]!==j?(f=(0,a.jsx)(o.AM,{open:j,size:0,tone:"default",portal:!0,placement:"bottom-start",content:c,children:p}),v[12]=j,v[13]=f):f=v[13],v[14]!==l||v[15]!==f?(x=(0,a.jsxs)(d.so,{align:"center",gap:2,children:[l,f]}),v[14]=l,v[15]=f,v[16]=x):x=v[16],x};function lj(){let e,t,n,i,l=(0,s.c)(10),{documentId:o,displayed:d}=iP(),{t:c}=(0,h.Bdt)(r.Z7),u=(null==d?void 0:d._id)||o,{companionDoc:p}=(0,h.G2c)(u),m=(0,h.aqr)(null==p?void 0:p.canvasDocumentId,"banner");return p?(l[0]!==u?(e=(0,a.jsx)(lb,{documentId:u}),l[0]=u,l[1]=e):e=l[1],l[2]!==c?(t=c("canvas.banner.edit-in-canvas-action"),l[2]=c,l[3]=t):t=l[3],l[4]!==m||l[5]!==t?(n={mode:"ghost",text:t,onClick:m},l[4]=m,l[5]=t,l[6]=n):n=l[6],l[7]!==e||l[8]!==n?(i=(0,a.jsx)(i6,{tone:"neutral","data-test-id":"canvas-linked-banner",paddingY:0,content:e,action:n}),l[7]=e,l[8]=n,l[9]=i):i=l[9],i):null}function ly(e){return!e}let l_=e=>{let t,n,i,l,o,c,u,p,f,x=(0,s.c)(27),{schemaType:v,selectedPerspective:g,reason:b}=e,{t:j}=(0,h.Bdt)(r.Z7),{document:y}=(0,h.hA9)(),{drafts:_}=y,{enabled:w}=_;x[0]!==w||x[1]!==v?(t=e=>{let{perspective:t}=e;return{disabled:!(0,h.CW3)({selectedPerspective:t,isDraftModelEnabled:w,schemaType:v}).result}},x[0]=w,x[1]=v,x[2]=t):t=x[2];let S=t;return x[3]!==b||x[4]!==j?(n="PUBLISHED_NOT_WRITEABLE"===b&&j("banners.choose-new-document-destination.cannot-create-published-document"),x[3]=b,x[4]=j,x[5]=n):n=x[5],x[6]!==b||x[7]!==j?(i="DRAFTS_NOT_WRITEABLE"===b&&j("banners.choose-new-document-destination.cannot-create-draft-document"),x[6]=b,x[7]=j,x[8]=i):i=x[8],x[9]!==b||x[10]!==g||x[11]!==j?(l="RELEASE_NOT_ACTIVE"===b&&(0,h.Jrl)(g)&&(0,a.jsx)(h.HTc,{t:j,i18nKey:"banners.choose-new-document-destination.release-inactive",values:{title:g.metadata.title},components:{VersionBadge:(0,h.bSq)(g)}}),x[9]=b,x[10]=g,x[11]=j,x[12]=l):l=x[12],x[13]!==j?(o=j("banners.choose-new-document-destination.choose-destination"),x[13]=j,x[14]=o):o=x[14],x[15]!==o?(c=(0,a.jsxs)(a.Fragment,{children:[" ",o]}),x[15]=o,x[16]=c):c=x[16],x[17]!==n||x[18]!==i||x[19]!==l||x[20]!==c?(u=(0,a.jsxs)(d.EY,{size:1,children:[n,i,l,c]}),x[17]=n,x[18]=i,x[19]=l,x[20]=c,x[21]=u):u=x[21],x[22]!==S?(p=(0,a.jsx)(h.GCV,{menuItemProps:S}),x[22]=S,x[23]=p):p=x[23],x[24]!==p||x[25]!==u?(f=(0,a.jsx)(i6,{tone:"caution",icon:m.sAQ,content:(0,a.jsxs)(d.so,{align:"center",gap:2,children:[u,p]})}),x[24]=p,x[25]=u,x[26]=f):f=x[26],f};function lw(){var e;let t,n,i=(0,s.c)(5),{value:l}=iP(),{documentLinkedBannerContent:r}=null!=(e=(0,h.eaL)().components)?e:{};
1i[0]!==l?(t=(0,h.G_3)(l),i[0]=l,i[1]=t):t=i[1];let o=t;return r&&o?(i[2]!==r||i[3]!==o?(n=(0,a.jsx)(i6,{tone:"transparent","data-test-id":"sanity-create-read-only-banner",content:(0,a.jsx)(r,{metadata:o})}),i[2]=r,i[3]=o,i[4]=n):n=i[4],n):null}function lS(e){var t;let{documentId:n,currentRelease:i,value:l,isScheduledRelease:o}=e,p=(0,h.Y73)(null!=i?i:h.k0f),{t:m}=(0,h.Bdt)(r.Z7),{t:f}=(0,h.Bdt)(),{createVersion:x}=(0,h.wI4)(),[v,g]=(0,u.useState)(),b=(0,c.dj)(),j=(0,u.useCallback)(async()=>{if(i._id){g({status:"creating",lastUpdate:new Date});try{await x((0,h._hI)(i._id),n,l),g({status:"created",lastUpdate:new Date})}catch(e){b.push({status:"error",closable:!0,title:m("banners.release.error.title"),description:m("banners.release.error.description",{message:e.message})}),g(void 0)}}},[x,i._id,n,m,b,l]),y=function(e){let t,n,i,l=(0,s.c)(4);l[0]===Symbol.for("react.memo_cache_sentinel")?(t=new Date,l[0]=t):t=l[0];let[r,o]=(0,u.useState)(t);return 200!==l[1]?(n=()=>{let t=setInterval(()=>{o(new Date)},e);return()=>clearInterval(t)},i=[e],l[1]=e,l[2]=n,l[3]=i):(n=l[2],i=l[3]),(0,u.useEffect)(n,i),r}(200);return(0,h.B1J)({status:"info",id:"add-document-to-release",enabled:(null==v?void 0:v.status)==="created"&&y.getTime()-v.lastUpdate.getTime()>1e3,closable:!0,title:m("banners.release.waiting.title"),description:m("banners.release.waiting.description")}),(0,a.jsx)(i6,{tone:p,content:(0,a.jsx)(d.EY,{size:1,children:(0,a.jsx)(h.HTc,{i18nKey:"banners.release.not-in-release",t:m,values:{title:(null==i||null==(t=i.metadata)?void 0:t.title)||f("release.placeholder-untitled-release")},components:{VersionBadge:(0,h.bSq)(i)}})}),action:o?void 0:{text:m("banners.release.action.add-to-release"),tone:p,disabled:!!v,onClick:j,mode:"default"}})}let lk=(0,eh.g_)({name:"LiveEdit Draft Resolved",version:1,description:"User resolved a draft of a live edit document to continue editing"}),lC=e=>{let t,n,i,l,c,p,f,x,v,g,b,j,y,_,w,S=(0,s.c)(47),{displayed:k,documentId:C,schemaType:E,i18nKey:I,isEditBlocking:z}=e,{t:T}=(0,h.Bdt)(r.Z7),[P,A]=(0,u.useState)(!1),[R,D]=(0,u.useState)(!1),M=(0,em.Jr)(),{publish:B,discardChanges:Y}=(0,h.QSs)(C,(null==k?void 0:k._type)||"");S[0]!==B||S[1]!==M?(t=()=>{B.execute(),A(!0),M.log(lk,{liveEditResolveType:"publish"})},S[0]=B,S[1]=M,S[2]=t):t=S[2];let L=t;S[3]!==Y||S[4]!==M?(n=()=>{Y.execute(),D(!0),M.log(lk,{liveEditResolveType:"discard"})},S[3]=Y,S[4]=M,S[5]=n):n=S[5];let O=n;S[6]===Symbol.for("react.memo_cache_sentinel")?(i=()=>()=>{A(!1),D(!1)},S[6]=i):i=S[6],(0,u.useEffect)(i);let H=it();S[7]!==H||S[8]!==(null==k?void 0:k._id)||S[9]!==E.name?(l=()=>{typeof(null==k?void 0:k._id)>"u"||H.navigateDiffView({mode:"version",previousDocument:{type:E.name,id:(0,h.IMx)(null==k?void 0:k._id)},nextDocument:{type:E.name,id:(0,h.T4)(null==k?void 0:k._id)}})},S[7]=H,S[8]=null==k?void 0:k._id,S[9]=E.name,S[10]=l):l=S[10];let V=l;return S[11]!==E.title?(c={schemaType:E.title},S[11]=E.title,S[12]=c):c=S[12],S[13]!==I||S[14]!==T||S[15]!==c?(p=(0,a.jsx)(d.EY,{size:1,weight:"medium",children:(0,a.jsx)(h.HTc,{t:T,i18nKey:I,values:c})}),S[13]=I,S[14]=T,S[15]=c,S[16]=p):p=S[16],S[17]!==T?(f=T("banners.obsolete-draft.actions.compare-draft.text"),S[17]=T,S[18]=f):f=S[18],S[19]!==V||S[20]!==f?(x=(0,a.jsx)(o.$n,{text:f,mode:"ghost",onClick:V}),S[19]=V,S[20]=f,S[21]=x):x=S[21],S[22]!==T?(v=T("banners.obsolete-draft.actions.publish-draft.text"),S[22]=T,S[23]=v):v=S[23],S[24]!==z||S[25]!==T?(g=z?{content:T("banners.live-edit-draft-banner.publish.tooltip")}:{},S[24]=z,S[25]=T,S[26]=g):g=S[26],S[27]!==L||S[28]!==P||S[29]!==g||S[30]!==v?(b=(0,a.jsx)(o.$n,{onClick:L,text:v,tooltipProps:g,loading:P,tone:"positive"}),S[27]=L,S[28]=P,S[29]=g,S[30]=v,S[31]=b):b=S[31],S[32]!==T?(j=T("banners.obsolete-draft.actions.discard-draft.text"),S[32]=T,S[33]=j):j=S[33],S[34]!==z||S[35]!==T?(y=z?{content:T("banners.live-edit-draft-banner.discard.tooltip")}:{},S[34]=z,S[35]=T,S[36]=y):y=S[36],S[37]!==O||S[38]!==R||S[39]!==j||S[40]!==y?(_=(0,a.jsx)(o.$n,{onClick:O,text:j,tooltipProps:y,loading:R,tone:"caution"}),S[37]=O,S[38]=R,S[39]=j,S[40]=y,S[41]=_):_=S[41],S[42]!==b||S[43]!==_||S[44]!==p||S[45]!==x?(w=(0,a.jsx)(i6,{content:(0,a.jsxs)(d.so,{align:"center",justify:"space-between",gap:2,children:[p,x,b,_]}),"data-testid":"live-edit-type-banner",icon:m.YZv}),S[42]=b,S[43]=_,S[44]=p,S[45]=x,S[46]=w):w=S[46],w};function lE(e){let t,n,i=(0,s.c)(4),{documentId:l,isPinnedDraftOrPublished:r}=e;i[0]!==l?(t={documentId:l},i[0]=l,i[1]=t):t=i[1];let o=(0,h.Jr6)(t);return(0,h.A_X)(l)&&o&&r?(i[2]!==l?(n=(0,a.jsx)(lI,{documentId:l}),i[2]=l,i[3]=n):n=i[3],n):null}function lI(e){var t;let{documentId:n}=e,{data:i}=(0,h.K0D)(),l=(0,h._T7)(),s=null!=(t=(0,h._Sr)(n))?t:"",c=(0,u.useMemo)(()=>i.find(e=>e._id.includes(s)),[i,s]),{t:p}=(0,h.Bdt)(),{data:m}=(0,h.gn8)({documentId:n}),f=(0,u.useMemo)(()=>i.filter(e=>m.find(t=>{var n;let i=null!=(n=(0,h._Sr)(t))?n:"";return(0,h._hI)(e._id)===i})).map(e=>e.metadata.title||p("release.placeholder-untitled-release")),[i,m,p]),x=c&&(0,h.Y73)(c),{t:v}=(0,h.Bdt)(r.Z7),g=(0,u.useCallback)(async()=>
1{l(s)},[s,l]);return(0,a.jsx)(i6,{tone:x,paddingY:0,"data-testid":"open-release-to-edit-banner",content:(0,a.jsxs)(d.so,{direction:"row",align:"center",justify:"space-between",flex:1,children:[(0,a.jsx)(d.EY,{size:1,children:(0,a.jsx)(d.so,{direction:"row",gap:1,children:f.length>1?(0,a.jsx)(h.HTc,{t:v,i18nKey:"banners.release.navigate-to-edit-description-multiple",components:{VersionBadge:()=>(0,a.jsxs)(h.RwK,{children:[" ",f[0]]})},values:{count:f.length-1}}):(0,a.jsx)(h.HTc,{t:v,i18nKey:"banners.release.navigate-to-edit-description-single",components:{VersionBadge:()=>(0,a.jsxs)(h.RwK,{children:[" ",f[0]]})}})})}),(0,a.jsx)(o.$n,{text:v("banners.release.action.open-to-edit"),tone:x,onClick:g})]})})}function lz(){let e,t,n=(0,s.c)(4),{revisionNotFound:i}=iP(),{t:l}=(0,h.Bdt)(r.Z7);return i?(n[0]!==l?(e=l("banners.revision-not-found.description"),n[0]=l,n[1]=e):e=n[1],n[2]!==e?(t=(0,a.jsx)(i6,{tone:"caution","data-test-id":"revision-not-found-banner",icon:m.sAQ,content:(0,a.jsx)(d.EY,{size:1,children:e})}),n[2]=e,n[3]=t):t=n[3],t):null}function lT(e){let t,n,i,l,r,o=(0,s.c)(12),{currentRelease:c}=e,u=null!=c?c:h.k0f;o[0]!==u?(t=(0,h.Y73)(u),o[0]=u,o[1]=t):t=o[1];let p=t,{t:f}=(0,h.Bdt)();return o[2]!==c?(n=(0,h.drb)(c),o[2]=c,o[3]=n):n=o[3],o[4]!==n?(i={date:n},o[4]=n,o[5]=i):i=o[5],o[6]!==i||o[7]!==f?(l=(0,a.jsx)(d.EY,{size:1,children:(0,a.jsx)(h.HTc,{t:f,i18nKey:"release.banner.scheduled-for-publishing-on",values:i})}),o[6]=i,o[7]=f,o[8]=l):l=o[8],o[9]!==l||o[10]!==p?(r=(0,a.jsx)(i6,{tone:p,icon:m.XAi,content:l}),o[9]=l,o[10]=p,o[11]=r):r=o[11],r}function lP(){let e=(0,s.c)(13),{value:t}=iP(),{selectedPerspective:n}=(0,h.QO2)(),i=(0,h.YW1)(t),{t:l}=(0,h.Bdt)(r.Z7),{t:o}=(0,h.Bdt)();if((0,h.Jrl)(n)&&i){var c,u,p;let t,i,r,s,f;e[0]!==(null==(c=n.metadata)?void 0:c.title)||e[1]!==o?(t=(null==(u=n.metadata)?void 0:u.title)||o("release.placeholder-untitled-release"),e[0]=null==(p=n.metadata)?void 0:p.title,e[1]=o,e[2]=t):t=e[2];let x=t;return e[3]!==x?(i={title:x},e[3]=x,e[4]=i):i=e[4],e[5]!==n?(r=(0,h.bSq)(n),e[5]=n,e[6]=r):r=e[6],e[7]!==r?(s={VersionBadge:r},e[7]=r,e[8]=s):s=e[8],e[9]!==l||e[10]!==i||e[11]!==s?(f=(0,a.jsx)(i6,{tone:"critical",content:(0,a.jsx)(d.EY,{size:1,children:(0,a.jsx)(h.HTc,{t:l,i18nKey:"banners.unpublished-release-banner.text",values:i,components:s})}),icon:m.wvk}),e[9]=l,e[10]=i,e[11]=s,e[12]=f):f=e[12],f}return null}let lA=(0,v.I4)(d.BJ)(e9(),e=>{let{theme:t}=e;return(0,v.AH)(e8(),t.sanity.fonts.heading.sizes[4].fontSize,t.sanity.fonts.heading.sizes[4].lineHeight,t.sanity.fonts.heading.sizes[3].fontSize,t.sanity.fonts.heading.sizes[3].lineHeight,t.sanity.fonts.heading.sizes[2].fontSize,t.sanity.fonts.heading.sizes[2].lineHeight)}),lR=e=>{var t;let n,i,l,c,u=(0,s.c)(14),{documentId:p,schemaType:f,title:x}=e,v=p===f.name,g=f.description,{t:b}=(0,h.Bdt)(r.Z7);if(!1===f.__experimental_formPreviewTitle)return null;u[0]!==g||u[1]!==v||u[2]!==f.name||u[3]!==f.title?(n=!v&&(0,a.jsxs)(d.cV,{space:1,children:[(0,a.jsx)(d.EY,{muted:!0,size:1,children:null!=(t=f.title)?t:f.name}),g&&(0,a.jsx)(o.m_,{content:g,placement:"right",children:(0,a.jsx)(m.YzR,{"data-testid":"schema-description-icon"})})]}),u[0]=g,u[1]=v,u[2]=f.name,u[3]=f.title,u[4]=n):n=u[4];let j=!x;return u[5]!==b||u[6]!==x?(i=null!=x?x:b("document-view.form-view.form-title-fallback"),u[5]=b,u[6]=x,u[7]=i):i=u[7],u[8]!==j||u[9]!==i?(l=(0,a.jsx)(d.DZ,{as:"h2","data-heading":!0,muted:j,"data-testid":"document-panel-document-title",children:i}),u[8]=j,u[9]=i,u[10]=l):l=u[10],u[11]!==n||u[12]!==l?(c=(0,a.jsxs)(lA,{marginBottom:6,space:4,children:[n,l]}),u[11]=n,u[12]=l,u[13]=c):c=u[13],c},lD=e=>e.preventDefault(),lM=(0,u.forwardRef)(function(e,t){var n;let i,l,o,p,m,f,x,v,g,b,j,y,_,w,S,k,C=(0,s.c)(74),{hidden:E,margins:I}=e,{collapsedFieldSets:z,collapsedPaths:T,displayed:P,editState:A,documentId:R,documentType:D,fieldActions:M,onChange:B,validation:Y,ready:L,formState:O,onFocus:H,connectionState:V,onBlur:N,onSetCollapsedPath:Z,onPathOpen:F,onSetCollapsedFieldSet:K,onSetActiveFieldGroup:W,openPath:J}=iP(),{selectedReleaseId:$}=(0,h.QO2)(),G=(0,h.q3J)(),Q=(0,h.cVB)(R),{title:q}=iN(),[X]=(0,u.useState)(lB),ee=null==A||null==(n=A.transactionSyncLock)?void 0:n.enabled,{t:et}=(0,h.Bdt)(r.Z7);
1C[0]!==et?(l=et("document-view.form-view.sync-lock-toast.title"),C[0]=et,C[1]=l):l=C[1],C[2]!==et?(o=et("document-view.form-view.sync-lock-toast.description"),C[2]=et,C[3]=o):o=C[3],C[4]!==ee||C[5]!==l||C[6]!==o?(p={id:"sync-lock",status:"warning",enabled:ee,title:l,description:o,closable:!0},C[4]=ee,C[5]=l,C[6]=o,C[7]=p):p=C[7],i=p,(0,h.B1J)(i),C[8]!==R||C[9]!==G.pair||C[10]!==D||C[11]!==X||C[12]!==$?(m=()=>{let e=G.pair.documentEvents(R,D,$).pipe((0,U.M)(e=>{"mutation"===e.type&&X.publish(function(e){let t=e.mutations.map(e=>e.patch).filter(Boolean);return{type:"mutation",snapshot:e.document,patches:(0,h.i6N)(e.origin,t)}}(e)),"rebase"===e.type&&X.publish(function(e){let t=e.remoteMutations.map(e=>e.patch).filter(Boolean),n=e.localMutations.map(e=>e.patch).filter(Boolean);return{type:"rebase",snapshot:e.document,patches:(0,h.i6N)("remote",t).concat((0,h.i6N)("local",n))}}(e))})).subscribe();return()=>{e.unsubscribe()}},C[8]=R,C[9]=G.pair,C[10]=D,C[11]=X,C[12]=$,C[13]=m):m=C[13],C[14]!==R||C[15]!==G||C[16]!==D||C[17]!==X||C[18]!==$?(f=[R,G,D,X,$],C[14]=R,C[15]=G,C[16]=D,C[17]=X,C[18]=$,C[19]=f):f=C[19],(0,u.useEffect)(m,f);let en=!!(null==P?void 0:P._rev);C[20]!==X||C[21]!==P?(x=()=>{X.publish({type:"mutation",patches:[],snapshot:P})},C[20]=X,C[21]=P,C[22]=x):x=C[22];let ei=(0,eb.J)(x);C[23]!==ei||C[24]!==en?(v=()=>{en&&ei()},C[23]=ei,C[24]=en,C[25]=v):v=C[25],C[26]!==en?(g=[en],C[26]=en,C[27]=g):g=C[27],(0,u.useEffect)(v,g);let[el,er]=(0,u.useState)(null),[eo,ea]=(0,u.useState)(!1);C[28]!==eo||C[29]!==el||C[30]!==(null==O?void 0:O.focusPath.length)||C[31]!==L?(b=()=>{eo||!L||(null==O?void 0:O.focusPath.length)||!el||(ea(!0),(0,c.s5)(el))},C[28]=eo,C[29]=el,C[30]=null==O?void 0:O.focusPath.length,C[31]=L,C[32]=b):b=C[32];let es=null==O?void 0:O.focusPath.length;C[33]!==eo||C[34]!==el||C[35]!==L||C[36]!==es?(j=[eo,el,es,L],C[33]=eo,C[34]=el,C[35]=L,C[36]=es,C[37]=j):j=C[37],(0,u.useEffect)(b,j),C[38]!==t?(y=e=>{er(e),"function"==typeof t?t(e):t&&(t.current=e)},C[38]=t,C[39]=y):y=C[39];let ed=y,ec="reconnecting"===V||(null==O?void 0:O.readOnly)||!(null==A?void 0:A.ready),eu=ec?"true":void 0;return C[40]!==z||C[41]!==T||C[42]!==V||C[43]!==R||C[44]!==(null==A?void 0:A.draft)||C[45]!==(null==A?void 0:A.published)||C[46]!==M||C[47]!==O||C[48]!==E||C[49]!==ec||C[50]!==N||C[51]!==B||C[52]!==H||C[53]!==F||C[54]!==W||C[55]!==K||C[56]!==Z||C[57]!==J||C[58]!==X||C[59]!==Q||C[60]!==et||C[61]!==q||C[62]!==Y?(_="connecting"!==V||(null==A?void 0:A.draft)||(null==A?void 0:A.published)?null===O||E?(0,a.jsx)(d.az,{padding:2,children:(0,a.jsx)(d.EY,{children:et("document-view.form-view.form-hidden")})}):(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(lR,{documentId:R,schemaType:O.schemaType,title:q}),(0,a.jsx)(h.okx,{__internal_fieldActions:M,__internal_patchChannel:X,changed:O.changed,collapsedFieldSets:z,collapsedPaths:T,focused:O.focused,focusPath:O.focusPath,groups:O.groups,id:"root",members:O.members,onChange:B,onFieldGroupSelect:W,onPathBlur:N,onPathFocus:H,onPathOpen:F,onSetFieldSetCollapsed:K,onSetPathCollapsed:Z,openPath:J,presence:Q,readOnly:ec,schemaType:O.schemaType,validation:Y,value:O.value})]}):(0,a.jsx)(no,{ms:300,children:(0,a.jsxs)(d.so,{align:"center",direction:"column",height:"fill",justify:"center",children:[(0,a.jsx)(d.y$,{muted:!0}),(0,a.jsx)(d.az,{marginTop:3,children:(0,a.jsx)(d.EY,{align:"center",muted:!0,size:1,children:et("document-view.form-view.loading")})})]})}),C[40]=z,C[41]=T,C[42]=V,C[43]=R,C[44]=null==A?void 0:A.draft,C[45]=null==A?void 0:A.published,C[46]=M,C[47]=O,C[48]=E,C[49]=ec,C[50]=N,C[51]=B,C[52]=H,C[53]=F,C[54]=W,C[55]=K,C[56]=Z,C[57]=J,C[58]=X,C[59]=Q,C[60]=et,C[61]=q,C[62]=Y,C[63]=_):_=C[63],C[64]!==ed||C[65]!==eu||C[66]!==_?(w=(0,a.jsx)(d.az,{as:"form",onSubmit:lD,ref:ed,"data-testid":"form-view","data-read-only":eu,children:_}),C[64]=ed,C[65]=eu,C[66]=_,C[67]=w):w=C[67],C[68]!==I||C[69]!==w?(S=(0,a.jsx)(h.MLZ,{margins:I,children:w}),C[68]=I,C[69]=w,C[70]=S):S=C[70],C[71]!==E||C[72]!==S?(k=(0,a.jsx)(d.mc,{hidden:E,paddingX:4,paddingTop:5,paddingBottom:9,sizing:"border",width:1,children:S}),C[71]=E,C[72]=S,C[73]=k):k=C[73],k});function lB(){return(0,h.Ijd)()}function lY(){let e,t,n=(0,s.c)(11),{activeViewId:i,paneKey:l,views:r}
1=iP(),o="".concat(l,"tabpanel");if(n[0]!==i||n[1]!==l||n[2]!==o||n[3]!==r){let t;n[5]!==i||n[6]!==l||n[7]!==o?(t=(e,t)=>{var n;return(0,a.jsx)(lL,{icon:e.icon,id:"".concat(l,"tab-").concat(e.id),isActive:i===e.id,label:e.title,tabPanelId:o,viewId:0===t?null:null!=(n=e.id)?n:null},e.id)},n[5]=i,n[6]=l,n[7]=o,n[8]=t):t=n[8],e=r.map(t),n[0]=i,n[1]=l,n[2]=o,n[3]=r,n[4]=e}else e=n[4];return n[9]!==e?(t=(0,a.jsx)(d.wb,{space:1,children:e}),n[9]=e,n[10]=t):t=n[10],t}function lL(e){let t,n,i,l,r,d,c,u,p,m=(0,s.c)(20);m[0]!==e?({icon:t,id:n,isActive:i,label:l,tabPanelId:d,viewId:c,...r}=e,m[0]=e,m[1]=t,m[2]=n,m[3]=i,m[4]=l,m[5]=r,m[6]=d,m[7]=c):(t=m[1],n=m[2],i=m[3],l=m[4],r=m[5],d=m[6],c=m[7]);let{ready:h,editState:f}=iP(),{setView:x}=t0();m[8]!==x||m[9]!==c?(u=()=>x(c),m[8]=x,m[9]=c,m[10]=u):u=m[10];let v=u,g=!h&&!(null==f?void 0:f.draft)&&!(null==f?void 0:f.published);return m[11]!==v||m[12]!==t||m[13]!==n||m[14]!==i||m[15]!==l||m[16]!==r||m[17]!==g||m[18]!==d?(p=(0,a.jsx)(o.oz,{...r,"aria-controls":d,disabled:g,icon:t,id:n,label:l,onClick:v,selected:i}),m[11]=v,m[12]=t,m[13]=n,m[14]=i,m[15]=l,m[16]=r,m[17]=g,m[18]=d,m[19]=p):p=m[19],p}function lO(){let e,t,n,i=(0,s.c)(22),{connectionState:l,schemaType:o,title:d,value:c}=iP(),u=!!c;i[0]!==c||i[1]!==o||i[2]!==u?(e={enabled:u,schemaType:o,value:c},i[0]=c,i[1]=o,i[2]=u,i[3]=e):e=i[3];let{error:p,value:m}=(0,h.MOl)(e),{t:f}=(0,h.Bdt)(r.Z7);if("connecting"===l&&!u){let e;return i[4]===Symbol.for("react.memo_cache_sentinel")?(e=(0,a.jsx)(a.Fragment,{}),i[4]=e):e=i[4],e}if(d){let e;return i[5]!==d?(e=(0,a.jsx)(a.Fragment,{children:d}),i[5]=d,i[6]=e):e=i[6],e}if(!c){let e,t,n=(null==o?void 0:o.title)||(null==o?void 0:o.name);return i[7]!==f||i[8]!==n?(e=f("panes.document-header-title.new.text",{schemaType:n}),i[7]=f,i[8]=n,i[9]=e):e=i[9],i[10]!==e?(t=(0,a.jsx)(a.Fragment,{children:e}),i[10]=e,i[11]=t):t=i[11],t}if(p){let e,t;return i[12]!==p.message||i[13]!==f?(e=f("panes.document-header-title.error.text",{error:p.message}),i[12]=p.message,i[13]=f,i[14]=e):e=i[14],i[15]!==e?(t=(0,a.jsx)(a.Fragment,{children:e}),i[15]=e,i[16]=t):t=i[16],t}return i[17]!==f||i[18]!==(null==m?void 0:m.title)?(t=(null==m?void 0:m.title)||(0,a.jsx)("span",{style:{color:"var(--card-muted-fg-color)"},children:f("panes.document-header-title.untitled.text")}),i[17]=f,i[18]=null==m?void 0:m.title,i[19]=t):t=i[19],i[20]!==t?(n=(0,a.jsx)(a.Fragment,{children:t}),i[20]=t,i[21]=n):n=i[21],n}let lH=e=>{let t,n,i,l,c,u,p=(0,s.c)(16);p[0]!==e?({documentExists:t,...n}=e,p[0]=e,p[1]=t,p[2]=n):(t=p[1],n=p[2]);let{isFavorited:f,isReady:x,favorite:v,unfavorite:g}=(0,h.$_6)(n),{t:b}=(0,h.Bdt)(r.Z7),j=f?"document.favorites.remove-from-favorites":"document.favorites.add-to-favorites";p[3]!==b||p[4]!==j?(i=b(j),p[3]=b,p[4]=j,p[5]=i):i=p[5];let y=i,_=f?g:v,w=!x||!t;return p[6]!==y?(l={content:(0,a.jsx)(d.EY,{size:1,children:y}),placement:"right"},p[6]=y,p[7]=l):l=p[7],p[8]!==f?(c=(0,a.jsx)(d.EY,{size:1,children:f?(0,a.jsx)(m.WmX,{}):(0,a.jsx)(m.Gg5,{})}),p[8]=f,p[9]=c):c=p[9],p[10]!==y||p[11]!==_||p[12]!==w||p[13]!==l||p[14]!==c?(u=(0,a.jsx)(o.$n,{mode:"bleed",onClick:_,disabled:w,"aria-label":y,"aria-live":"assertive",tooltipProps:l,children:c}),p[10]=y,p[11]=_,p[12]=w,p[13]=l,p[14]=c,p[15]=u):u=p[15],u},lV=(0,u.memo)(function(){var e,t,n,i;let l,d,c,u,p,f,x,v,g,b,j=(0,s.c)(26),{editState:y,connectionState:_,views:w,documentId:S,displayed:k}=iP(),{features:C}=iB(),{index:E,BackLink:I}=t0(),{activeWorkspace:z}=(0,h.VrO)();j[0]!==S?(l=(0,h.IMx)(S),j[0]=S,j[1]=l):l=j[1];let T=l,P=w.length>1,{collapsed:A,isLast:R}=np(),D=R&&!A?-1:0,M=C.backButton&&E>0,{t:B}=(0,h.Bdt)(r.Z7);j[2]===Symbol.for("react.memo_cache_sentinel")?(c=(0,a.jsx)(lO,{}),j[2]=c):c=j[2],d=c,j[3]!==P?(p=P&&(0,a.jsx)(lY,{}),j[3]=P,j[4]=p):p=j[4],u=p,j[5]!==I||j[6]!==M||j[7]!==B?(x=M&&(0,a.jsx)(o.$n,{as:I,"data-as":"a",icon:m.A60,mode:"bleed",tooltipProps:{content:B("pane-header.back-button.text")}}),j[5]=I,j[6]=M,j[7]=B,j[8]=x):x=j[8],f=x;let Y=null!=(e=null==k?void 0:k._type)?e:"";j[9]!==z.dataset||j[10]!==z.projectId?(v=[z.projectId,z.dataset],j[9]=z.dataset,j[10]=z.projectId,j[11]=v):v=j[11];let L=v.join("."),O=null!=(i=(null==y?void 0:y.ready)&&(null!=(n=null!=(t=y.version)?t:y.draft)?n:y.published)!==null)&&i;j[12]!==z.dataset||j[13]!==z.name||j[14]!==z.projectId||j[15]!==T||j[16]!==O||j[17]!==Y||j[18]!==L?(g=(0,a.jsx)(h.m2r,{capability:"comlink",condition:"available",children:(0,a.jsx)(lH,{resourceType:"studio",documentId:T,documentType:Y,resourceId:L,schemaName:z.name,projectId:z.projectId,dataset:z.dataset,documentExists:O})}),j[12]=z.dataset,j[13]=z.name,j[14]=z.projectId,j[15]=T,j[16]=O,j[17]=Y,j[18]=L,j[19]=g):g=j[19];let H=g,V="connecting"===_&&!(null==y?void 0:y.draft)&&!(null==y?void 0:y.published);return j[20]!==f||j[21]!==H||j[22]!==V||j[23]!==D||j[24]!==u?(b=(0,a.jsx)(nP,{loading:V,title:d,tabs:u,tabIndex:D,backButton:f,appendTitle:H}),j[20]=f,j[21]=H,j[22]=V,j[23]=D,j[24]=u,j[25]=b):b=j[25],b}),lN=(0,v.I4)(d.az)({position:"relative"}),lZ=(0,v.I4)(h.PaW)(e=>{let{$disabled:t}=e;return t?{height:"100%"}:(0,v.AH)(te())}),lF=function(e){let t,n,i,l,r,o,c,p,m,f,x,v,g,b,j,y,_=(0,s.c)(102),{footerHeight:w,headerHeight:S,isInspectOpen:k,rootElement:C,setDocumentPanelPortalElement:E,footer:I}=e,{activeViewId:z,displayed:T,documentId:P,editState:A,inspector:R,value:D,views:M,ready:B,schemaType:Y,permissions:L,isPermissionsLoading:O}=iP();if(_[0]!==D){let e=(0,h.G_3)(D);t=(0,h.Y07)(e),_[0]=D,_[1]=t}else t=_[1];let H=t,{params:V}=t0(),{collapsed:N}=tG(),{collapsed:Z}=np(),F=(0,d.WP)(),{features:K}=iB(),[W,J]=(0,u.useState)(null),[U,$]=(0,u.useState)(null),G=(0,u.useRef)(null),Q=(0,h.hA9)(),q=D._createdAt?"update":"create";_[2]!==z||_[3]!==M?(i=M.find(e=>e.id===z)||M[0]||{type:"form"},_[2]=z,_[3]=M,_[4]=i):i=_[4],n=i;let X=K.splitPanes&&W||F.element;e:{let e;if(N){let e,t=S||0,n=w?w+2:2;
1_[5]!==t||_[6]!==n?(e=[t,0,n,0],_[5]=t,_[6]=n,_[7]=e):e=_[7],l=e;break e}_[8]===Symbol.for("react.memo_cache_sentinel")?(e=[0,0,2,0],_[8]=e):e=_[8],l=e}let ee=l,et="form"!==n.type;_[9]!==n.component||_[10]!==n.options||_[11]!==n.type||_[12]!==T||_[13]!==P||_[14]!==(null==A?void 0:A.draft)||_[15]!==(null==A?void 0:A.published)||_[16]!==Y||_[17]!==D?(r=()=>{if("component"===n.type&&n.component){let e=n.component;return(0,a.jsx)(e,{document:{draft:(null==A?void 0:A.draft)||null,displayed:T||D,historical:T,published:(null==A?void 0:A.published)||null},documentId:P,options:n.options,schemaType:Y})}return!1},_[9]=n.component,_[10]=n.options,_[11]=n.type,_[12]=T,_[13]=P,_[14]=null==A?void 0:A.draft,_[15]=null==A?void 0:A.published,_[16]=Y,_[17]=D,_[18]=r):r=_[18],_[19]!==r?(o=r(),_[19]=r,_[20]=o):o=_[20];let en=o;_[21]!==U?(c=()=>{(null==U?void 0:U.scrollTo)&&U.scrollTo(0,0)},_[21]=U,_[22]=c):c=_[22],_[23]!==P||_[24]!==U?(p=[P,U],_[23]=P,_[24]=U,_[25]=p):p=_[25],(0,u.useEffect)(c,p),_[26]!==X||_[27]!==E?(m=()=>{X&&E(X)},f=[X,E],_[26]=X,_[27]=E,_[28]=m,_[29]=f):(m=_[28],f=_[29]),(0,u.useEffect)(m,f),_[30]!==T||_[31]!==k||_[32]!==D?(v=k?(0,a.jsx)(i5,{value:T||D}):null,_[30]=T,_[31]=k,_[32]=D,_[33]=v):v=_[33],x=v;let ei=!!(!Z&&R),{selectedPerspective:el,selectedReleaseId:er}=(0,h.QO2)();t:{var eo;let e,t,i,l,r,o,s,d,c,u,p,m,f,x;if(null==V?void 0:V.historyVersion){let e;_[34]===Symbol.for("react.memo_cache_sentinel")?(e=(0,a.jsx)(lx,{}),_[34]=e):e=_[34],g=e;break t}_[35]!==el?(e=(0,h.Jrl)(el)&&(0,h.KJ$)(el),_[35]=el,_[36]=e):e=_[36];let v=e,b=!!(v&&(null==T?void 0:T._id)&&(0,h._Sr)(null==T?void 0:T._id)===er);if(_[37]!==A||_[38]!==Y||_[39]!==el||_[40]!==Q.document.drafts.enabled?(i=function(e){let{isSelectedPerspectiveWriteable:t,editState:n}=e;return(0,h.cX9)(n)&&!t.result}({isSelectedPerspectiveWriteable:t=(0,h.CW3)({selectedPerspective:el,isDraftModelEnabled:Q.document.drafts.enabled,schemaType:Y}),editState:A}),_[37]=A,_[38]=Y,_[39]=el,_[40]=Q.document.drafts.enabled,_[41]=t,_[42]=i):(t=_[41],i=_[42]),i){let e;_[43]!==t.reason||_[44]!==t.result||_[45]!==Y||_[46]!==el?(e=!t.result&&(0,a.jsx)(l_,{schemaType:Y,selectedPerspective:el,reason:t.reason}),_[43]=t.reason,_[44]=t.result,_[45]=Y,_[46]=el,_[47]=e):e=_[47],g=e;break t}if(b){let e;_[48]!==el?(e=(0,a.jsx)(lT,{currentRelease:el}),_[48]=el,_[49]=e):e=_[49],g=e;break t}_[50]!==el?(l=(0,h.sBy)(el),_[50]=el,_[51]=l):l=_[51];let j=l;if((null==T?void 0:T._id)&&(0,h._Sr)(T._id)!==er&&B&&!j&&!1===(0,h.cX9)(A)){let e,t=T||void 0;_[52]!==v||_[53]!==el||_[54]!==t||_[55]!==D._id?(e=(0,a.jsx)(lS,{documentId:D._id,currentRelease:el,value:t,isScheduledRelease:v}),_[52]=v,_[53]=el,_[54]=t,_[55]=D._id,_[56]=e):e=_[56],g=e;break t}let y=function(e){let{editState:t,workspace:n,schemaType:i}=e;if(!(null==t?void 0:t.ready))return{result:void 0};let l=null!==t.draft,{document:{drafts:{enabled:r}}}=n;return!1===l?{result:!1}:r?!0===i.liveEdit?{result:!0,reason:"LIVE_EDIT_ACTIVE"}:{result:!1}:{result:!0,reason:"DRAFT_MODEL_INACTIVE"}}({editState:A,workspace:Q,schemaType:Y});if("form"===n.type&&!er&&y.result){if("DRAFT_MODEL_INACTIVE"===y.reason){let e;_[57]!==T||_[58]!==P||_[59]!==Y?(e=(0,a.jsx)(lC,{displayed:T,documentId:P,schemaType:Y,i18nKey:"banners.obsolete-draft.draft-model-inactive.text"}),_[57]=T,_[58]=P,_[59]=Y,_[60]=e):e=_[60],g=e;break t}if("LIVE_EDIT_ACTIVE"===y.reason){let e;_[61]!==T||_[62]!==P||_[63]!==Y?(e=(0,a.jsx)(lC,{displayed:T,documentId:P,schemaType:Y,i18nKey:"banners.live-edit-draft-banner.text",isEditBlocking:!0}),_[61]=T,_[62]=P,_[63]=Y,_[64]=e):e=_[64],g=e;break t}}if("form"!==n.type||O){g=null;break t}_[65]!==H?(r=H&&(0,a.jsx)(lw,{}),_[65]=H,_[66]=r):r=_[66],_[67]!==(null==L?void 0:L.granted)||_[68]!==q?(o=!(null==L?void 0:L.granted)&&(0,a.jsx)(lp,{requiredPermission:q}),_[67]=null==L?void 0:L.granted,_[68]=q,_[69]=o):o=_[69],_[70]===Symbol.for("react.memo_cache_sentinel")?(s=(0,a.jsx)(lz,{}),d=(0,a.jsx)(lf,{}),c=(0,a.jsx)(le,{}),u=(0,a.jsx)(lj,{}),p=(0,a.jsx)(i7,{}),m=(0,a.jsx)(lP,{}),_[70]=s,_[71]=d,_[72]=c,_[73]=u,_[74]=p,_[75]=m):(s=_[70],d=_[71],c=_[72],u=_[73],p=_[74],m=_[75]);let w=null!=(eo=null==T?void 0:T._id)?eo:P;_[76]!==j||_[77]!==w?(f=(0,a.jsx)(lE,{documentId:w,isPinnedDraftOrPublished:j}),_[76]=j,_[77]=w,_[78]=f):f=_[78],_[79]!==r||_[80]!==o||_[81]!==f?(x=(0,a.jsxs)(a.Fragment,{children:[r,o,s,d,c,u,p,m,f]}),_[79]=r,_[80]=o,_[81]=f,_[82]=x):x=_[82],g=x}let ea=g,es=K.resizablePanes||!ei;
1return _[83]!==en||_[84]!==ea||_[85]!==U||_[86]!==I||_[87]!==et||_[88]!==x||_[89]!==N||_[90]!==ee||_[91]!==X||_[92]!==es?(b=es&&(0,a.jsxs)(d.so,{height:"fill",direction:"column",width:"fill",flex:2,children:[(0,a.jsxs)(h.wG1,{zOffset:"paneHeader",children:[ea,(0,a.jsx)(lV,{})]}),(0,a.jsx)(lN,{flex:2,overflow:"hidden",children:(0,a.jsx)(d.GD,{element:X,__unstable_elements:{documentScrollElement:U},children:(0,a.jsx)(d.EZ,{element:U,children:(0,a.jsxs)(h.jsZ,{scrollElement:U,containerElement:G,children:[(0,a.jsxs)(lZ,{$disabled:N||!1,"data-testid":"document-panel-scroller",ref:$,children:[(0,a.jsx)(lM,{hidden:et,margins:ee,ref:G}),en]}),x,(0,a.jsx)("div",{"data-testid":"document-panel-portal",ref:J})]})})})}),I]}),_[83]=en,_[84]=ea,_[85]=U,_[86]=I,_[87]=et,_[88]=x,_[89]=N,_[90]=ee,_[91]=X,_[92]=es,_[93]=b):b=_[93],_[94]!==P||_[95]!==C||_[96]!==Y||_[97]!==ei?(j=ei&&(0,a.jsx)(d.EZ,{element:C,children:(0,a.jsx)(iJ,{documentId:P,documentType:Y.name,flex:1})}),_[94]=P,_[95]=C,_[96]=Y,_[97]=ei,_[98]=j):j=_[98],_[99]!==b||_[100]!==j?(y=(0,a.jsx)(nm,{children:(0,a.jsxs)(d.so,{height:"fill",children:[b,j]})}),_[99]=b,_[100]=j,_[101]=y):y=_[101],y};lF.displayName="DocumentPanel";let lK=!1,lW=Object.freeze({}),lJ=Symbol("LOADING_PANE"),lU="documentPanelPortalElement",l$=["left","bottom"],lG={small:0,medium:1,large:2,full:"auto"};function lQ(e){let t,n,i=(0,s.c)(5),{dialog:l,referenceElement:r}=e;return i[0]!==l?(t=(0,a.jsx)(lq,{dialog:l}),i[0]=l,i[1]=t):t=i[1],i[2]!==r||i[3]!==t?(n=(0,a.jsx)(d.AM,{content:t,fallbackPlacements:l$,open:!0,placement:"top",portal:!0,preventOverflow:!0,referenceElement:r}),i[2]=r,i[3]=t,i[4]=n):n=i[4],n}function lq(e){let t,n,i,l,o,c,p,m,f,x,v,g=(0,s.c)(29),{dialog:b}=e,{cancelButtonIcon:j,cancelButtonText:y,confirmButtonIcon:_,confirmButtonText:w,message:S,onCancel:k,onConfirm:C,tone:E}=b,{t:I}=(0,h.Bdt)(r.Z7),{isTopLayer:z}=(0,d.Z4)(),T=(0,u.useRef)(null);return g[0]!==z||g[1]!==k?(t=e=>{"Escape"===e.key&&z&&k()},g[0]=z,g[1]=k,g[2]=t):t=g[2],(0,d.Pm)(t),g[3]===Symbol.for("react.memo_cache_sentinel")?(n=()=>[T.current],g[3]=n):n=g[3],(0,d.PR)(z&&k,n),g[4]===Symbol.for("react.memo_cache_sentinel")?(i={minWidth:304,maxWidth:400},g[4]=i):i=g[4],g[5]!==S?(l=(0,a.jsx)(d.az,{flex:1,overflow:"auto",padding:4,children:(0,a.jsx)(d.EY,{children:S})}),g[5]=S,g[6]=l):l=g[6],g[7]===Symbol.for("react.memo_cache_sentinel")?(o={borderTop:"1px solid var(--card-border-color)"},g[7]=o):o=g[7],g[8]!==y||g[9]!==I?(c=y||I("confirm-dialog.cancel-button.fallback-text"),g[8]=y,g[9]=I,g[10]=c):c=g[10],g[11]!==j||g[12]!==k||g[13]!==c?(p=(0,a.jsx)(d.$n,{"data-testid":"confirm-dialog-cancel-button",icon:j,onClick:k,mode:"ghost",text:c}),g[11]=j,g[12]=k,g[13]=c,g[14]=p):p=g[14],g[15]!==w||g[16]!==I?(m=w||I("confirm-dialog.confirm-button.fallback-text"),g[15]=w,g[16]=I,g[17]=m):m=g[17],g[18]!==_||g[19]!==C||g[20]!==m||g[21]!==E?(f=(0,a.jsx)(d.$n,{"data-testid":"confirm-dialog-confirm-button",icon:_,onClick:C,text:m,tone:E}),g[18]=_,g[19]=C,g[20]=m,g[21]=E,g[22]=f):f=g[22],g[23]!==p||g[24]!==f?(x=(0,a.jsx)(d.az,{paddingX:4,paddingY:3,style:o,children:(0,a.jsxs)(d.xA,{columns:2,gap:2,children:[p,f]})}),g[23]=p,g[24]=f,g[25]=x):x=g[25],g[26]!==l||g[27]!==x?(v=(0,a.jsxs)(d.so,{direction:"column",ref:T,style:i,children:[l,x]}),g[26]=l,g[27]=x,g[28]=v):v=g[28],v}function lX(e){let t,n,i,l=(0,s.c)(12),{dialog:r}=e,o=(0,u.useId)();l[0]!==r.footer?(t=r.footer&&(0,a.jsx)(d.az,{paddingX:4,paddingY:3,children:r.footer}),l[0]=r.footer,l[1]=t):t=l[1];let p=t,m=!1===r.showCloseButton,f=void 0===r.width?1:lG[r.width];return l[2]!==r.content?(n=(0,a.jsx)(d.az,{padding:4,children:r.content}),l[2]=r.content,l[3]=n):n=l[3],l[4]!==r.header||l[5]!==r.onClose||l[6]!==o||l[7]!==p||l[8]!==m||l[9]!==f||l[10]!==n?(i=(0,a.jsx)(h.wG1,{zOffset:"fullscreen",children:(0,a.jsx)(c.lG,{animate:!0,__unstable_hideCloseButton:m,footer:p,header:r.header,id:o,onClose:r.onClose,onClickOutside:r.onClose,width:f,children:n})}),l[4]=r.header,l[5]=r.onClose,l[6]=o,l[7]=p,l[8]=m,l[9]=f,l[10]=n,l[11]=i):i=l[11],i}function l0(e){let t,n,i=(0,s.c)(5),{dialog:l,referenceElement:r}=e;return i[0]!==l?(t=(0,a.jsx)(l1,{dialog:l}),i[0]=l,i[1]=t):t=i[1],i[2]!==r||i[3]!==t?(n=(0,a.jsx)(d.AM,{content:t,fallbackPlacements:l$,open:!0,placement:"top",portal:!0,preventOverflow:!0,referenceElement:r}),i[2]=r,i[3]=t,i[4]=n):n=i[4],n}function l1(e){let t,n,i,l=(0,s.c)(6),{dialog:r}=e,{content:o,onClose:c}=r,{isTopLayer:p}=(0,d.Z4)(),m=(0,u.useRef)(null);return l[0]!==p||l[1]!==c?(t=e=>{"Escape"===e.key&&p&&c()},l[0]=p,l[1]=c,l[2]=t):t=l[2],(0,d.Pm)(t),l[3]===Symbol.for("react.memo_cache_sentinel")?(n=()=>[m.current],l[3]=n):n=l[3],(0,d.PR)(p&&c,n),l[4]!==o?(i=(0,a.jsx)("div",{ref:m,children:o}),l[4]=o,l[5]=i):i=l[5],i}function l2(e){let t,n=(0,s.c)(3),{children:i}=e,{element:l,elements:r}=(0,d.WP)(),o=(null==r?void 0:r[lU])||l;return n[0]!==i||n[1]!==o?(t=(0,a.jsx)(d.GD,{element:o,children:i}),n[0]=i,n[1]=o,n[2]=t):t=n[2],t}function l3(e){let t,n,i=(0,s.c)(17),{dialog:l,referenceElement:r}=e,c=void 0===r?null:r,p=(0,u.useId)();if("confirm"===l.type){let e;return i[0]!==l||i[1]!==c?(e=(0,a.jsx)(lQ,{dialog:l,referenceElement:c}),i[0]=l,i[1]=c,i[2]=e):e=i[2],e}if("popover"===l.type){let e;return i[3]!==l||i[4]!==c?(e=(0,a.jsx)(l0,{dialog:l,referenceElement:c}),i[3]=l,i[4]=c,i[5]=e):e=i[5],e}if("dialog"===l.type||!l.type){let e;return i[6]!==l?(e=(0,a.jsx)(l2,{children:(0,a.jsx)(lX,{dialog:l})}),i[6]=l,i[7]=e):e=i[7],e}if("custom"===l.type){let e,t=null==l?void 0:l.component;return i[8]!==t?(e=(0,a.jsx)(l2,{children:t}),i[8]=t,i[9]=e):e=i[9],e}return console.warn("Unsupported modal type ".concat(l.type)),i[10]!==l.content||i[11]!==l.type?(t=l.content||(0,a.jsxs)(d.EY,{size:1,children:["Unexpected modal type (",(0,a.jsx)("code",{children:l.type}),")"]}),i[10]=l.content,i[11]=l.type,i[12]=t):t=i[12],i[13]!==p||i[14]!==t||i[15]!==l.onClose?
1(n=(0,a.jsx)(o.lG,{id:p,onClose:l.onClose,onClickOutside:l.onClose,width:1,children:t}),i[13]=p,i[14]=t,i[15]=l.onClose,i[16]=n):n=i[16],n}let l4=(0,u.memo)(function(e){let t,n,i,l,r,o,d=(0,s.c)(9),{actionStates:c,children:p,referenceElement:m}=e,[f,x]=(0,u.useState)(-1);t=c[f],d[0]===Symbol.for("react.memo_cache_sentinel")?(n=e=>{x(e)},d[0]=n):n=d[0];let v=n;return d[1]!==p?(l=p({handleAction:v}),d[1]=p,d[2]=l):l=d[2],i=l,d[3]!==t||d[4]!==m?(r=t&&t.dialog&&(0,a.jsx)(h.wG1,{zOffset:"paneFooter",children:(0,a.jsx)(l3,{dialog:t.dialog,referenceElement:m})}),d[3]=t,d[4]=m,d[5]=r):r=d[5],d[6]!==i||d[7]!==r?(o=(0,a.jsxs)(a.Fragment,{children:[r,i]}),d[6]=i,d[7]=r,d[8]=o):o=d[8],o});function l5(e){let t,n,i,l,c=(0,s.c)(10),{actionStates:p,disabled:m}=e,f=(0,u.useId)(),[x,v]=(0,u.useState)(null);c[0]===Symbol.for("react.memo_cache_sentinel")?(n={placement:"top-end",portal:!0,preventOverflow:!0},c[0]=n):n=c[0],t=n;let{t:g}=(0,h.Bdt)(r.Z7);c[1]!==p||c[2]!==m||c[3]!==f||c[4]!==g?(i=e=>{let{handleAction:n}=e;return(0,a.jsx)(o.IU,{id:"".concat(f,"-action-menu"),button:(0,a.jsx)(h.VJU,{"aria-label":g("buttons.action-menu-button.aria-label"),disabled:m,"data-testid":"action-menu-button",tooltipProps:{content:g("buttons.action-menu-button.tooltip")}}),menu:(0,a.jsx)(d.W1,{padding:1,children:p.map((e,t)=>(0,a.jsx)(l6,{actionState:e,disabled:m,index:t,onAction:n},t))}),popover:t,ref:v})},c[1]=p,c[2]=m,c[3]=f,c[4]=g,c[5]=i):i=c[5];let b=i;return c[6]!==p||c[7]!==x||c[8]!==b?(l=(0,a.jsx)(l4,{actionStates:p,referenceElement:x,children:b}),c[6]=p,c[7]=x,c[8]=b,c[9]=l):l=c[9],l}function l6(e){let t,n,i,l,r,d=(0,s.c)(18),{actionState:c,disabled:u,index:p,onAction:m}=e,{onHandle:h}=c;d[0]!==p||d[1]!==m||d[2]!==h?(t=()=>{m(p),h&&h()},d[0]=p,d[1]=m,d[2]=h,d[3]=t):t=d[3];let f=t;d[4]!==c.shortcut?(i=c.shortcut?String(c.shortcut).split("+").map(l7):void 0,d[4]=c.shortcut,d[5]=i):i=d[5],n=i;let x="action-".concat(c.label.replace(" ","")),v=u||!!c.disabled;return d[6]!==c.disabled||d[7]!==c.title?(l=c.disabled&&{tooltipProps:{content:c.title}},d[6]=c.disabled,d[7]=c.title,d[8]=l):l=d[8],d[9]!==c.icon||d[10]!==c.label||d[11]!==c.tone||d[12]!==f||d[13]!==n||d[14]!==x||d[15]!==v||d[16]!==l?(r=(0,a.jsx)(o.Dr,{"data-testid":x,disabled:v,hotkeys:n,icon:c.icon,onClick:f,text:c.label,tone:c.tone,...l}),d[9]=c.icon,d[10]=c.label,d[11]=c.tone,d[12]=f,d[13]=n,d[14]=x,d[15]=v,d[16]=l,d[17]=r):r=d[17],r}function l7(e){return e.slice(0,1).toUpperCase()+e.slice(1)}let l8={NOTHING_TO_DELETE:"action.delete.disabled.nothing-to-delete",NOT_READY:"action.delete.disabled.not-ready"},l9=e=>{let t,n,i,l,o,d=(0,s.c)(36),{id:c,type:p,draft:f,onComplete:x,release:v}=e,{setIsDeleting:g}=iP(),{delete:b}=(0,h.QSs)(c,p,v),[j,y]=(0,u.useState)(!1),[_,w]=(0,u.useState)(!1),{t:S}=(0,h.Bdt)(r.Z7);d[0]!==x?(t=()=>{w(!1),x()},d[0]=x,d[1]=t):t=d[1];let k=t;d[2]!==b||d[3]!==x||d[4]!==g?(n=()=>{y(!0),w(!1),g(!0),b.execute(),x()},d[2]=b,d[3]=x,d[4]=g,d[5]=n):n=d[5];let C=n;d[6]===Symbol.for("react.memo_cache_sentinel")?(i=()=>{w(!0)},d[6]=i):i=d[6];let E=i;d[7]!==c||d[8]!==v||d[9]!==p?(l={id:c,type:p,version:v,permission:"delete"},d[7]=c,d[8]=v,d[9]=p,d[10]=l):l=d[10];let[I,z]=(0,h.LyQ)(l),T=(0,h.iZK)();e:{let e,t,n,i;if(!z&&!(null==I?void 0:I.granted)){let e,t,n;d[11]!==S?(e=S("action.delete.label"),d[11]=S,d[12]=e):e=d[12],d[13]!==T?(t=(0,a.jsx)(h.TLO,{context:"delete-document",currentUser:T}),d[13]=T,d[14]=t):t=d[14],d[15]!==e||d[16]!==t?(n={tone:"critical",icon:m.ucK,disabled:!0,label:e,title:t},d[15]=e,d[16]=t,d[17]=n):n=d[17],o=n;break e}let l=j||!!b.disabled||z;d[18]!==b.disabled||d[19]!==S?(e=b.disabled&&S(l8[b.disabled])||"",d[18]=b.disabled,d[19]=S,d[20]=e):e=d[20],d[21]!==j||d[22]!==S?(t=S(j?"action.delete.running.label":"action.delete.label"),d[21]=j,d[22]=S,d[23]=t):t=d[23],d[24]!==(null==f?void 0:f._id)||d[25]!==k||d[26]!==C||d[27]!==c||d[28]!==_||d[29]!==p?(n=_&&{type:"custom",component:(0,a.jsx)(nr,{action:"delete",id:(null==f?void 0:f._id)||c,type:p,onCancel:k,onConfirm:C})},d[24]=null==f?void 0:f._id,d[25]=k,d[26]=C,d[27]=c,d[28]=_,d[29]=p,d[30]=n):n=d[30],d[31]!==l||d[32]!==e||d[33]!==t||d[34]!==n?(i={tone:"critical",icon:m.ucK,disabled:l,title:e,label:t,shortcut:"Ctrl+Alt+D",onHandle:E,dialog:n},d[31]=l,d[32]=e,d[33]=t,d[34]=n,d[35]=i):i=d[35],o=i}return o};l9.action="delete",l9.displayName="DeleteAction";let re={NO_CHANGES:"action.discard-changes.disabled.no-change",NOT_PUBLISHED:"action.discard-changes.disabled.not-published",NOT_READY:"action.discard-changes.disabled.not-ready"},rt=e=>{let{id:t,type:n,published:i,liveEdit:l,onComplete:o,release:s}=e,{discardChanges:d}=(0,h.QSs)(t,n,s),[c,p]=(0,u.useState)(!1),[f,x]=(0,h.LyQ)({id:t,type:n,version:s,permission:"discardDraft"}),v=(0,h.iZK)(),{displayed:g}=iP(),{t:b}=(0,h.Bdt)(r.Z7),j=(null==g?void 0:g._id)&&(0,h._4P)(null==g?void 0:g._id),y=(0,u.useCallback)(()=>{d.execute(),o()},[d,o]),_=(0,u.useCallback)(()=>{p(!0)},[]),w=(0,u.useMemo)(()=>c&&{type:"confirm",tone:"critical",onCancel:o,onConfirm:y,message:b("action.discard-changes.confirm-dialog.confirm-discard-changes")}
1,[y,c,o,b]);return(0,u.useMemo)(()=>!i||l||j?null:x||(null==f?void 0:f.granted)?{tone:"critical",icon:m.NAP,disabled:!!d.disabled||x,title:b(d.disabled&&re[d.disabled]||""),label:b("action.discard-changes.label"),onHandle:_,dialog:w}:{tone:"critical",icon:m.NAP,disabled:!0,label:b("action.discard-changes.label"),title:(0,a.jsx)(h.TLO,{context:"discard-changes",currentUser:v})},[v,w,d.disabled,_,x,j,l,null==f?void 0:f.granted,i,b])};rt.action="discardChanges",rt.displayName="DiscardChangesAction";let rn={NOTHING_TO_DUPLICATE:"action.duplicate.disabled.nothing-to-duplicate",NOT_READY:"action.duplicate.disabled.not-ready"},ri=e=>{let{id:t,type:n,onComplete:i,release:l,mapDocument:o}=e,s=(0,h.q3J)(),{duplicate:d}=(0,h.QSs)(t,n,l),{navigateIntent:c}=(0,_.rd)(),[p,f]=(0,u.useState)(!1),[v,g]=(0,h.LyQ)({id:t,type:n,version:l,permission:"duplicate"}),{t:b}=(0,h.Bdt)(r.Z7),j=(0,h.iZK)(),y=(0,u.useCallback)(async()=>{let e=(0,x.A)();f(!0);let l=(0,Y._)(s.pair.operationEvents(t,n).pipe((0,P.p)(e=>"duplicate"===e.op&&"success"===e.type)));d.execute(e,{mapDocument:o}),await l,c("edit",{id:e,type:n}),i()},[s.pair,d,t,o,c,i,n]);return(0,u.useMemo)(()=>g||(null==v?void 0:v.granted)?{icon:m.TdU,disabled:p||!!d.disabled||g,label:b(p?"action.duplicate.running.label":"action.duplicate.label"),title:d.disabled?b(rn[d.disabled]):"",onHandle:y}:{icon:m.TdU,disabled:!0,label:b("action.duplicate.label"),title:(0,a.jsx)(h.TLO,{context:"duplicate-document",currentUser:j})},[j,d.disabled,y,p,g,null==v?void 0:v.granted,b])};ri.action="duplicate",ri.displayName="DuplicateAction";let rl=e=>{let t,n,i,l,o,a,d=(0,s.c)(27),{id:c,type:p,revision:f,onComplete:x,release:v}=e,{restore:g}=(0,h.QSs)(c,p,v),{revisionNotFound:b}=iP(),j=(0,h.cUp)(c,p),{navigateIntent:y}=(0,_.rd)(),w=(0,u.useRef)(j),[S,k]=(0,u.useState)(!1),{t:C}=(0,h.Bdt)(r.Z7);d[0]!==x||d[1]!==g||d[2]!==f?(t=()=>{g.execute(f),x()},d[0]=x,d[1]=g,d[2]=f,d[3]=t):t=d[3];let E=t;d[4]!==j||d[5]!==c||d[6]!==y||d[7]!==p?(n=()=>{j&&j!==w.current&&("success"===j.type&&"restore"===j.op&&y("edit",{id:c,type:p}),w.current=j)},i=[j,c,y,p],d[4]=j,d[5]=c,d[6]=y,d[7]=p,d[8]=n,d[9]=i):(n=d[8],i=d[9]),(0,u.useEffect)(n,i),d[10]===Symbol.for("react.memo_cache_sentinel")?(l=()=>{k(!0)},d[10]=l):l=d[10];let I=l;e:{if(S){let e,t;d[11]!==C?(e=C("action.restore.confirm.message"),d[11]=C,d[12]=e):e=d[12],d[13]!==E||d[14]!==x||d[15]!==e?(t={type:"confirm",tone:"critical",onCancel:x,onConfirm:E,message:e},d[13]=E,d[14]=x,d[15]=e,d[16]=t):t=d[16],o=t;break e}o=null}let z=o,T="@initial"===f,P=void 0===f;t:{let e,t,n;if(P||b){a=null;break t}d[17]!==C?(e=C("action.restore.label"),d[17]=C,d[18]=e):e=d[18];let i=T?"action.restore.disabled.cannot-restore-initial":"action.restore.tooltip";d[19]!==C||d[20]!==i?(t=C(i),d[19]=C,d[20]=i,d[21]=t):t=d[21],d[22]!==z||d[23]!==T||d[24]!==e||d[25]!==t?(n={label:e,tone:"caution",onHandle:I,title:t,icon:m.AAk,dialog:z,disabled:T},d[22]=z,d[23]=T,d[24]=e,d[25]=t,d[26]=n):n=d[26],a=n}return a};rl.action="restore",rl.displayName="HistoryRestoreAction";let rr=(0,eh.g_)({name:"Document Published",version:1,description:'User clicked the "Publish" button in the document pane'}),ro={LIVE_EDIT_ENABLED:"action.publish.live-edit.publish-disabled",ALREADY_PUBLISHED:"action.publish.already-published.no-time-ago.tooltip",NO_CHANGES:"action.publish.no-changes.tooltip",NOT_READY:"action.publish.disabled.not-ready"};function ra(e,t,n){return"ALREADY_PUBLISHED"===e&&t?(0,a.jsx)(rs,{publishedAt:t}):n(ro[e])}function rs(e){let t,n,i,l=(0,s.c)(6),{publishedAt:o}=e,{t:d}=(0,h.Bdt)(r.Z7);l[0]===Symbol.for("react.memo_cache_sentinel")?(t={useTemporalPhrase:!0},l[0]=t):t=l[0];let c=(0,h.Vq9)(o,t);return l[1]!==d||l[2]!==c?(n=d("action.publish.already-published.tooltip",{timeSincePublished:c}),l[1]=d,l[2]=c,l[3]=n):n=l[3],l[4]!==n?(i=(0,a.jsx)("span",{children:n}),l[4]=n,l[5]=i):i=l[5],i}let rd=e=>{let t,n,i,l,o,d,c,p,x,v,g,b=(0,s.c)(78),{id:j,type:y,liveEdit:_,draft:w,published:S,release:k}=e,[C,E]=(0,u.useState)(null),{publish:I}=(0,h.QSs)(j,y),z=(0,h.dWw)(j,y),T=(0,h.M7h)(j,y),{changesOpen:P,documentId:A,documentType:R,value:D}=iP(),M=(0,h.zX2)(A,R),{t:B}=(0,h.Bdt)(r.Z7);b[0]!==(null==M?void 0:M.draft)||b[1]!==(null==M?void 0:M.published)?(t=(null==M?void 0:M.draft)||(null==M?void 0:M.published)||{},b[0]=null==M?void 0:M.draft,b[1]=null==M?void 0:M.published,b[2]=t):t=b[2];let Y=t._rev;b[3]!==z.validation?(n=z.validation.some(f.Uw),b[3]=z.validation,b[4]=n):n=b[4];let L=n,[O,H]=(0,u.useState)(!1),V=T.isSyncing,N=z.isValidating;b[5]!==j||b[6]!==y?(i={id:j,type:y,permission:"publish"},b[5]=j,b[6]=y,b[7]=i):i=b[7];let[Z,F]=(0,h.LyQ)(i),K=(0,h.iZK)();b[8]!==L||b[9]!==I.disabled||b[10]!==S||b[11]!==B?(l=I.disabled?ra(I.disabled,(S||{})._updatedAt,B)||"":L?B("action.publish.validation-issues.tooltip"):"",b[8]=L,b[9]=I.disabled,b[10]=S,b[11]=B,b[12]=l):l=b[12];let W=l,J=!!w;b[13]!==I?(o=()=>{I.execute(),E("publishing")},b[13]=I,b[14]=o):o=b[14];let U=o;
1b[15]!==U||b[16]!==L||b[17]!==V||b[18]!==O||b[19]!==Y||b[20]!==z.isValidating||b[21]!==z.revision?(d=()=>{let e=!1===z.isValidating&&z.revision!==Y;O&&!V&&e&&(L||U(),H(!1))},b[15]=U,b[16]=L,b[17]=V,b[18]=O,b[19]=Y,b[20]=z.isValidating,b[21]=z.revision,b[22]=d):d=b[22],b[23]!==U||b[24]!==L||b[25]!==V||b[26]!==N||b[27]!==O||b[28]!==Y||b[29]!==z.isValidating||b[30]!==z.revision?(c=[V,U,L,O,z.revision,Y,N,z.isValidating],b[23]=U,b[24]=L,b[25]=V,b[26]=N,b[27]=O,b[28]=Y,b[29]=z.isValidating,b[30]=z.revision,b[31]=c):c=b[31],(0,u.useEffect)(d,c),b[32]!==J||b[33]!==C?(p=()=>{let e="publishing"===C&&!J,t=e?"published":null,n=setTimeout(()=>{E(t)},e?200:4e3);return()=>clearTimeout(n)},b[32]=J,b[33]=C,b[34]=p):p=b[34],b[35]!==P||b[36]!==J||b[37]!==C?(x=[P,C,J],b[35]=P,b[36]=J,b[37]=C,b[38]=x):x=b[38],(0,u.useEffect)(p,x);let $=(0,em.Jr)();b[39]!==U||b[40]!==(null==w?void 0:w._createdAt)||b[41]!==S||b[42]!==Y||b[43]!==T.isSyncing||b[44]!==$||b[45]!==z.isValidating||b[46]!==z.revision?(v=()=>{$.log(rr,{publishedImmediately:!(null==w?void 0:w._createdAt),previouslyPublished:!!S}),T.isSyncing||z.isValidating||z.revision!==Y?H(!0):U()},b[39]=U,b[40]=null==w?void 0:w._createdAt,b[41]=S,b[42]=Y,b[43]=T.isSyncing,b[44]=$,b[45]=z.isValidating,b[46]=z.revision,b[47]=v):v=b[47];let G=v;e:{var Q;let e,t,n;if(k||_){g=null;break e}if((0,h._4P)(D._id)&&null!==w){let e,t,n;b[48]!==B?(e=B("action.publish.label"),b[48]=B,b[49]=e):e=b[49];let i=null==S?void 0:S._updatedAt;b[50]!==B||b[51]!==i?(t=ra("ALREADY_PUBLISHED",i,B),b[50]=B,b[51]=i,b[52]=t):t=b[52],b[53]!==e||b[54]!==t?(n={tone:"default",icon:m.VQ$,label:e,title:t,disabled:!0},b[53]=e,b[54]=t,b[55]=n):n=b[55],g=n;break e}if(!F&&!(null==Z?void 0:Z.granted)){let e,t,n;b[56]!==B?(e=B("action.publish.label"),b[56]=B,b[57]=e):e=b[57],b[58]!==K?(t=(0,a.jsx)(h.TLO,{context:"publish-document",currentUser:K}),b[58]=K,b[59]=t):t=b[59],b[60]!==e||b[61]!==t?(n={tone:"default",icon:m.VQ$,label:e,title:t,disabled:!0},b[60]=e,b[61]=t,b[62]=n):n=b[62],g=n;break e}let i=!!(O||(null==M||null==(Q=M.transactionSyncLock)?void 0:Q.enabled)||"publishing"===C||"published"===C||L||I.disabled),l=i||F;b[63]!==O||b[64]!==C||b[65]!==B?(e=B("published"===C?"action.publish.published.label":O||"publishing"===C?"action.publish.running.label":"action.publish.draft.label"),b[63]=O,b[64]=C,b[65]=B,b[66]=e):e=b[66],b[67]!==O||b[68]!==C||b[69]!==B||b[70]!==W?(t=O?B("action.publish.waiting"):"published"===C||"publishing"===C?null:W,b[67]=O,b[68]=C,b[69]=B,b[70]=W,b[71]=t):t=b[71];let r=i||O?null:"Ctrl+Alt+P";b[72]!==G||b[73]!==l||b[74]!==e||b[75]!==t||b[76]!==r?(n={disabled:l,tone:"default",label:e,icon:m.VQ$,title:t,shortcut:r,onHandle:G},b[72]=G,b[73]=l,b[74]=e,b[75]=t,b[76]=r,b[77]=n):n=b[77],g=n}return g};rd.action="publish",rd.displayName="PublishAction";let rc={NOT_PUBLISHED:"action.unpublish.disabled.not-published",NOT_READY:"action.unpublish.disabled.not-ready",LIVE_EDIT_ENABLED:"action.unpublish.disabled.live-edit-enabled"},ru=e=>{let{id:t,type:n,draft:i,onComplete:l,liveEdit:o,release:s}=e,{unpublish:d}=(0,h.QSs)(t,n),[c,p]=(0,u.useState)(!1),[f,x]=(0,h.LyQ)({id:t,type:n,permission:"unpublish"}),v=(0,h.iZK)(),{displayed:g}=iP(),{t:b}=(0,h.Bdt)(r.Z7),j=(null==g?void 0:g._id)&&(0,h.R8D)(null==g?void 0:g._id),y=(0,u.useCallback)(()=>{p(!1),l()},[l]),_=(0,u.useCallback)(()=>{p(!1),d.execute(),l()},[l,d]),w=(0,u.useMemo)(()=>c?{type:"dialog",onClose:l,content:(0,a.jsx)(nr,{id:(null==i?void 0:i._id)||t,type:n,action:"unpublish",onCancel:y,onConfirm:_})}:null,[i,t,y,_,c,l,n]);return(0,u.useMemo)(()=>s||j||o?null:x||(null==f?void 0:f.granted)?{tone:"critical",icon:m.wvk,disabled:!!d.disabled||x,label:b("action.unpublish.label"),title:d.disabled?b(rc[d.disabled]):"",onHandle:()=>p(!0),dialog:w}:{tone:"critical",icon:m.wvk,label:"Unpublish",title:(0,a.jsx)(h.TLO,{context:"unpublish-document",currentUser:v}),disabled:!0},[s,j,o,x,null==f?void 0:f.granted,d.disabled,b,w,v])};ru.action="unpublish",ru.displayName="UnpublishAction";let rp=(0,u.memo)(function(e){let t,n,i,l,r,c,p,m,f,x=(0,s.c)(33),{disabled:v,showMenu:g,states:b}=e,{__internal_tasks:j}=(0,h.For)(),{editState:y}=iP(),{selectedReleaseId:_}=(0,h.QO2)();x[0]!==b?([t,...n]=b,x[0]=b,x[1]=t,x[2]=n):(t=x[1],n=x[2]);let[w,S]=(0,u.useState)(null);e:{let e,n,l,r;if(!t||!t.title&&!t.shortcut){i=null;break e}x[3]===Symbol.for("react.memo_cache_sentinel")?(e={maxWidth:300},x[3]=e):e=x[3],x[4]!==t.title?(n=t.title&&(0,a.jsx)(d.EY,{size:1,children:t.title}),x[4]=t.title,x[5]=n):n=x[5],x[6]!==t.shortcut?(l=t.shortcut&&(0,a.jsx)(o.qW,{"data-testid":"document-status-bar-hotkeys",fontSize:1,style:{marginTop:-4,marginBottom:-4},keys:String(t.shortcut).split("+").map(rx)}
1),x[6]=t.shortcut,x[7]=l):l=x[7],x[8]!==n||x[9]!==l?(r=(0,a.jsxs)(d.so,{style:e,align:"center",gap:3,children:[n,l]}),x[8]=n,x[9]=l,x[10]=r):r=x[10],i=r}let k=i,C=_?t&&!(0,h.UYh)(t):t&&!(null==y?void 0:y.liveEdit);x[11]!==t||x[12]!==n||x[13]!==C?(r=C?n:[t,...n],x[11]=t,x[12]=n,x[13]=C,x[14]=r):r=x[14],l=r;let E=j&&j.footerAction;return x[15]!==v||x[16]!==t||x[17]!==C||x[18]!==k?(c=C&&(0,a.jsx)(d.XS,{zOffset:200,children:(0,a.jsx)(o.m_,{disabled:!k,content:k,placement:"top",children:(0,a.jsx)(d.BJ,{children:(0,a.jsx)(o.$n,{"data-testid":"action-".concat(nh(t.label)),disabled:v||!!t.disabled,icon:t.icon,onClick:t.onHandle,ref:S,text:t.label,tone:t.tone||"primary"})})})}),x[15]=v,x[16]=t,x[17]=C,x[18]=k,x[19]=c):c=x[19],x[20]!==v||x[21]!==n||x[22]!==g||x[23]!==l?(p=g&&n.length>0&&(0,a.jsx)(l5,{actionStates:l,disabled:v}),x[20]=v,x[21]=n,x[22]=g,x[23]=l,x[24]=p):p=x[24],x[25]!==w||x[26]!==t?(m=t&&t.dialog&&(0,a.jsx)(l3,{dialog:t.dialog,referenceElement:w}),x[25]=w,x[26]=t,x[27]=m):m=x[27],x[28]!==E||x[29]!==c||x[30]!==p||x[31]!==m?(f=(0,a.jsxs)(d.so,{align:"center",gap:1,children:[E,c,p,m]}),x[28]=E,x[29]=c,x[30]=p,x[31]=m,x[32]=f):f=x[32],f}),rm=(0,u.memo)(function(){let e,t,n,i,l,r,o,d=(0,s.c)(15),{actions:c,connectionState:u,documentId:p,editState:m,isInitialValueLoading:h}=iP();d[0]!==c?(t=null!=c?c:[],d[0]=c,d[1]=t):t=d[1],d[2]!==t?(n=t.filter(rv),d[2]=t,d[3]=n):n=d[3],e=n,d[4]!==m||d[5]!==h?(l=m?{...m,initialValueResolved:!h}:null,d[4]=m,d[5]=h,d[6]=l):l=d[6],i=l,d[7]!==e.length||d[8]!==u||d[9]!==p?(r=t=>{let{states:n}=t;return(0,a.jsx)(rp,{disabled:"connected"!==u,showMenu:e.length>1,states:n},p)},d[7]=e.length,d[8]=u,d[9]=p,d[10]=r):r=d[10];let f=r;return 0!==e.length&&i?(d[11]!==i||d[12]!==e||d[13]!==f?(o=(0,a.jsx)(n4,{actions:e,actionProps:i,group:"default",children:f}),d[11]=i,d[12]=e,d[13]=f,d[14]=o):o=d[14],o):null}),rh=(0,u.memo)(function(){let e,t,n,i,l,r,o,d=(0,s.c)(15),{actions:c,connectionState:u,editState:p,revisionId:m,isInitialValueLoading:h}=iP(),f=((null==p?void 0:p.draft)||(null==p?void 0:p.published)||{})._rev===m;d[0]!==p||d[1]!==h||d[2]!==m?(t=p?{...p,revision:m||void 0,initialValueResolved:!h}:null,d[0]=p,d[1]=h,d[2]=m,d[3]=t):t=d[3],e=t,d[4]!==c?(i=null!=c?c:[],d[4]=c,d[5]=i):i=d[5],d[6]!==i?(l=i.filter(rf).slice(-1),d[6]=i,d[7]=l):l=d[7],n=l,d[8]!==u||d[9]!==f?(r=e=>{let{states:t}=e;return(0,a.jsx)(rp,{disabled:"connected"!==u||!!f,showMenu:!1,states:t})},d[8]=u,d[9]=f,d[10]=r):r=d[10];let x=r;return e?(d[11]!==e||d[12]!==n||d[13]!==x?(o=(0,a.jsx)(n4,{actions:n,actionProps:e,group:"default",children:x}),d[11]=e,d[12]=n,d[13]=x,d[14]=o):o=d[14],o):null});function rf(e){return e.action===rl.action}function rx(e){return e.slice(0,1).toUpperCase()+e.slice(1).toLowerCase()}function rv(e){return!rf(e)}let rg=e=>{let t=(0,s.c)(16),{release:n}=e,{t:i}=(0,h.Bdt)();if("archived"===n.state){let e,n;return t[0]!==i?(e=i("release.chip.tooltip.archived"),t[0]=i,t[1]=e):e=t[1],t[2]!==e?(n=(0,a.jsx)(d.EY,{size:1,children:e}),t[2]=e,t[3]=n):n=t[3],n}if("asap"===n.metadata.releaseType){let e,n;return t[4]!==i?(e=i("release.type.asap"),t[4]=i,t[5]=e):e=t[5],t[6]!==e?(n=(0,a.jsx)(d.EY,{size:1,children:e}),t[6]=e,t[7]=n):n=t[7],n}if("scheduled"===n.metadata.releaseType){let e,l="active"===n.state;return t[8]!==l||t[9]!==n||t[10]!==i?(e=n.metadata.intendedPublishAt&&(0,a.jsx)(d.EY,{size:1,children:l?(0,a.jsx)(h.HTc,{t:i,i18nKey:"release.chip.tooltip.intended-for-date",values:{date:(0,h.drb)(n)}}):(0,a.jsx)(h.HTc,{t:i,i18nKey:"release.chip.tooltip.scheduled-for-date",values:{date:(0,h.drb)(n)}})}),t[8]=l,t[9]=n,t[10]=i,t[11]=e):e=t[11],e}if("undecided"===n.metadata.releaseType){let e,n;return t[12]!==i?(e=i("release.type.undecided"),t[12]=i,t[13]=e):e=t[13],t[14]!==e?(n=(0,a.jsx)(d.EY,{size:1,children:e}),t[14]=e,t[15]=n):n=t[15],n}return null},rb={dateStyle:"medium",timeStyle:"short"},rj=(0,u.memo)(function(){var e,t,n,i,l,r,o,s,c,p;let{selectedReleaseId:m,selectedPerspectiveName:f}=(0,h.QO2)(),{t:x}=(0,h.Bdt)(),v=(0,h._T7)(),{params:g,setParams:b}=t0(),j=(0,h.ixk)(rb),{loading:y}=(0,h.K0D)(),_=(0,h.pDY)(),{editState:w,displayed:S,documentType:k,documentId:C}=iP(),E=S&&!S._createdAt,I=iD({displayed:S,documentId:C}),z=(0,h.Jr6)({documentId:C}),T=(0,h.hA9)(),P=(0,u.useCallback)(e=>()=>{"published"===e&&(null==g?void 0:g.historyVersion)&&b({...g,rev:(null==g?void 0:g.historyEvent)||void 0,since:void 0,historyVersion:void 0}),v(e)},[v,b,g]),A=_.get(k),R=!!A&&!0===A.liveEdit,D=(0,u.useMemo)(()=>(!R||!!m)&&!(null==w?void 0:w.published),[R,m,null==w?void 0:w.published]),M=(0,u.useCallback)(e=>{if(!(null==g?void 0:g.historyVersion))return{selected:(0,h._hI)(e._id)===(0,h._Sr)((null==S?void 0:S._id)||"")};let t=(0,h._hI)(e._id)===g.historyVersion;return{selected:t,disabled:t}},[null==S?void 0:S._id,null==g?void 0:g.historyVersion]),B=(0,u.useMemo)(()=>{var e;return!!(R&&!(null==w||null==(e=w.draft)?void 0:e._id)&&!m||(0,h._4P)((null==S?void 0:S._id)||"")&&(0,h.xo4)(f||""))},[null==S?void 0:S._id,null==w||null==(e=w.draft)?void 0:e._id,R,f,m]),Y=(0,u.useMemo)(()=>{let e=(null==S?void 0:S._id)||"";return!(B||(null==g?void 0:g.historyVersion)||f||(0,h.A_X)(e))&&(!!(0,h.R8D)(e)||!((0,h._4P)(e)&&(null==w?void 0:w.published)&&(0,h.xo4)(f||"")))},[null==S?void 0:S._id,null==w?void 0:w.published,B,null==g?void 0:g.historyVersion,f]),L=(0,u.useMemo)(()=>!!z||!!E&&!!m||(!!(null==w?void 0:w.draft)||!!R)&&!!(E&&m||R),[null==w?void 0:w.draft,E,R,z,m]),O=null==(t=T.document.drafts)?void 0:t.enabled;return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(h.FCT,{tooltipContent:(0,a.jsx)(d.EY,{size:1,children:(null==w?void 0:w.published)&&(null==w||null==(n=w.published)?void 0:n._updatedAt)?(0,a.jsx)(h.HTc,{t:x,i18nKey:"release.chip.tooltip.published-date",values:{date:j.format(new Date(null==w?void 0:w.published._updatedAt))}}):(0,a.jsx)(a.Fragment,{children:x("release.chip.tooltip.not-published")})}),disabled:D,onClick:P("published"),selected:B,text:x("release.chip.published"),tone:"positive",contextValues:{documentId:(null==w||null==(i=w.published)?void 0:i._id)||(null==w?void 0:w.id)||"",menuReleaseId:(null==w||null==(l=w.published)?void 0:l._id)||(null==w?void 0:w.id)||"",releases:I.notCurrentReleases,releasesLoading:y,documentType:k,fromRelease:"published",isVersion:!1,disabled:!(null==w?void 0:w.published)}}),O&&(0,a.jsx)(h.FCT,{tooltipContent:(0,a.jsx)(d.EY,{size:1,children:(null==w?void 0:w.draft)?(0,a.jsx)(a.Fragment,{children:(null==w?void 0:w.draft._updatedAt)?(0,a.jsx)(h.HTc,{t:x,i18nKey:"release.chip.tooltip.edited-date",values:{date:j.format(new Date(null==w?void 0:w.draft._updatedAt))}}):(0,a.jsx)(h.HTc,{t:x,i18nKey:"release.chip.tooltip.created-date",values:{date:j.format(new Date(null==w?void 0:w.draft._createdAt))}})}):(0,a.jsx)(a.Fragment,{children:x(R?"release.chip.tooltip.draft-disabled.live-edit":"release.chip.tooltip.no-edits")})}
1),selected:Y,disabled:L,text:x("release.chip.draft"),tone:(null==w?void 0:w.draft)?"caution":"neutral",onClick:P("drafts"),contextValues:{documentId:(null==w||null==(r=w.draft)?void 0:r._id)||(null==w||null==(o=w.published)?void 0:o._id)||(null==w?void 0:w.id)||"",menuReleaseId:(null==w||null==(s=w.draft)?void 0:s._id)||(null==w||null==(c=w.published)?void 0:c._id)||(null==w?void 0:w.id)||"",releases:I.notCurrentReleases,releasesLoading:y,documentType:k,fromRelease:"draft",isVersion:!1,disabled:!(null==w?void 0:w.draft)}}),I.inCreation&&(0,a.jsx)(h.FCT,{tooltipContent:(0,a.jsx)(rg,{release:I.inCreation}),selected:!0,onClick:()=>{},locked:!1,tone:(0,h.Y73)(I.inCreation),text:I.inCreation.metadata.title||x("release.placeholder-untitled-release"),contextValues:{disabled:!0,documentId:(null==S?void 0:S._id)||"",menuReleaseId:I.inCreation._id,releases:I.notCurrentReleases,releasesLoading:y,documentType:k,fromRelease:(0,h._hI)(I.inCreation._id),releaseState:I.inCreation.state,isVersion:!0}}),S&&(null==(p=I.currentReleases)?void 0:p.map(e=>(0,a.jsx)(h.FCT,{tooltipContent:(0,a.jsx)(rg,{release:e}),...M(e),onClick:P((0,h._hI)(e._id)),text:e.metadata.title||x("release.placeholder-untitled-release"),tone:(0,h.Y73)(e),locked:(0,h.KJ$)(e),contextValues:{documentId:(null==S?void 0:S._id)||"",menuReleaseId:e._id,releases:I.notCurrentReleases,releasesLoading:y,documentType:k,fromRelease:(0,h._hI)(e._id),releaseState:e.state,isVersion:!0}},e._id)))]})}),ry=(0,v.I4)(d.Zp)(e=>{let t=(0,ej.JW)(e.theme);return(0,v.AH)(tn(),e.$showGradient&&(0,v.AH)(tt(),(0,ej.B3)(t.color.bg,0)))}),r_=(0,u.memo)((0,u.forwardRef)(function(e,t){let{menuItems:n}=e,{actions:i,editState:l,onMenuAction:c,isInitialValueLoading:p,onPaneClose:f,onPaneSplit:x,menuItemGroups:v,schemaType:g,connectionState:b,views:j,unstable_languageFilter:y}=iP(),{features:_}=iB(),{index:w,BackLink:S,hasGroupSiblings:k}=t0(),{actions:C}=(0,h.vM8)(),[E,I]=(0,u.useState)(null),z=(0,u.useRef)(null),T=function(e){let t,n,i=(0,s.c)(4),[l,r]=(0,u.useState)(!1);return i[0]!==e.current?(t=()=>{let t=()=>{let t=e.current;if(!t)return;let{scrollWidth:n,clientWidth:i}=t;if(!(n>i))return void r(!1);let{scrollLeft:l}=t;r(!(l+i>=n))},{intersectionObserver:n,mutationObserver:i}=function(){t();let n=e.current;if(!n)return{intersectionObserver:null,mutationObserver:null};let i=new IntersectionObserver(e=>{let t=e[0];t&&r(!t.isIntersecting)}),l=()=>{i.disconnect();let e=n.children[n.children.length-1];i.observe(e)};l();let o=new MutationObserver(()=>{l(),t()});return o.observe(n,{childList:!0,subtree:!1}),{intersectionObserver:i,mutationObserver:o}}();return()=>{null==n||n.disconnect(),null==i||i.disconnect()}},i[0]=e.current,i[1]=t):t=i[1],i[2]!==e?(n=[e],i[2]=e,i[3]=n):n=i[3],(0,u.useEffect)(t,n),l}(z),P=(0,u.useMemo)(()=>(null!=i?i:[]).filter(e=>!rf(e)),[i]),A=(0,u.useMemo)(()=>nZ({actionHandler:c,fieldActions:C,menuItems:n,menuItemGroups:v}),[c,C,v,n]),R=(0,u.useMemo)(()=>A.filter(nV),[A]),D=(0,u.useMemo)(()=>A.filter(nN),[A]),{collapsed:M,isLast:B}=np(),Y=_.splitViews&&x&&j.length>1,L=Y&&k,O=_.backButton&&w>0,H=!L&&!O&&!!S,{t:V}=(0,h.Bdt)(r.Z7),N=(0,u.useCallback)(e=>{let{states:t}=e;return(0,a.jsx)(rw,{contextMenuNodes:D,setReferenceElement:I,referenceElement:E,states:t})},[D,E]),Z=(0,u.useMemo)(()=>(0,a.jsx)(lO,{}),[]),F=(0,u.useMemo)(()=>O&&(0,a.jsx)(o.$n,{as:S,"data-as":"a",icon:m.A60,mode:"bleed",tooltipProps:{content:V("pane-header.back-button.text")}}),[S,O,V]),K=(0,u.useMemo)(()=>(0,a.jsxs)(d.so,{align:"center",gap:1,children:[y.length>0&&(0,a.jsx)(a.Fragment,{children:y.map((e,t)=>(0,a.jsx)(e,{schemaType:g},"language-filter-".concat(t)))}),R.map(e=>(0,a.jsx)(nR,{node:e},e.key)),l&&(0,a.jsx)(n4,{actions:P,actionProps:{...l,initialValueResolved:!p},group:"paneActions",children:N}),Y&&(0,a.jsx)(o.$n,{"aria-label":V("buttons.split-pane-button.aria-label"),icon:m.CwM,mode:"bleed",onClick:x,tooltipProps:{content:V("buttons.split-pane-button.tooltip")}},"split-pane-button"),L&&(0,a.jsx)(o.$n,{icon:m.USm,mode:"bleed",onClick:f,tooltipProps:{content:V("buttons.split-pane-close-button.title")}},"close-view-button"),H&&(0,a.jsx)(o.$n,{icon:m.USm,mode:"bleed",tooltipProps:{content:V("buttons.split-pane-close-group-button.title")},as:S},"close-view-button")]}),[S,P,l,p,R,f,x,N,g,H,Y,L,V,y]);return(0,a.jsx)(o.vE,{children:M?(0,a.jsx)(nP,{border:!0,ref:t,loading:"connecting"===b&&!(null==l?void 0:l.draft)&&!(null==l?void 0:l.published),title:Z,tabIndex:B&&!M?-1:0,backButton:F}):(0,a.jsx)(d.Zp,{hidden:M,style:{lineHeight:0},borderBottom:!0,children:(0,a.jsxs)(d.so,{gap:3,paddingY:3,children:[(0,a.jsx)(ry,{$showGradient:T,children:(0,a.jsx)(d.so,{flex:1,gap:1,overflow:"auto",paddingX:3,"data-testid":"document-perspective-list",ref:z,children:(0,a.jsx)(rj,{})})}),(0,a.jsx)(d.az,{flex:"none",paddingRight:3,children:K})]})})})})),rw=(0,u.memo)(function(e){let t,n=(0,s.c)(5),{setReferenceElement:i,referenceElement:l,contextMenuNodes:r}=e,o=(0,u.useDeferredValue)(e.states);return n[0]!==r||n[1]!==l||n[2]!==i||n[3]!==o?(t=(0,a.jsx)(rS,{setReferenceElement:i,referenceElement:l,contextMenuNodes:r,states:o}),n[0]=r,n[1]=l,n[2]=i,n[3]=o,n[4]=t):t=n[4],t}),rS=(0,u.memo)(function(e){let t,n,i=(0,s.c)(8),{states:l,setReferenceElement:r,contextMenuNodes:o,referenceElement:d}=e;i[0]!==o||i[1]!==r||i[2]!==l?(t=e=>{let{handleAction:t}=e;return(0,a.jsx)("div",{ref:r,children:(0,a.jsx)(n_,{nodes:o,actionsNodes:l.length>0?l.map((e,n)=>(0,a.jsx)(l6,{actionState:e,disabled:!!e.disabled,index:n,onAction:t},e.label)):void 0},"context-menu")})},i[0]=o,i[1]=r,i[2]=l,i[3]=t):t=i[3];let c=t;return i[4]!==d||i[5]!==c||i[6]!==l?(n=(0,a.jsx)(l4,{actionStates:l,referenceElement:d,children:c}),i[4]=d,i[5]=c,i[6]=l,i[7]=n):n=i[7],n});function rk(e){let t,n,i=(0,s.c)(3),{size:l}=e;return i[0]===Symbol.for("react.memo_cache_sentinel")?(t={pointerEvents:"none",visibility:"hidden",
1width:0},i[0]=t):t=i[0],i[1]!==l?(n=(0,a.jsx)(o.$n,{"aria-hidden":!0,disabled:!0,size:l,style:t,text:"-"}),i[1]=l,i[2]=n):n=i[2],n}let rC={primary:"primary",success:"positive",warning:"caution",danger:"critical"},rE=(0,u.memo)(function(e){let t,n,i=(0,s.c)(4),{states:l}=e;return 0===l.length?null:(i[0]!==l?(t=l.map(rP),i[0]=l,i[1]=t):t=i[1],i[2]!==t?(n=(0,a.jsx)(d.cV,{space:1,children:t}),i[2]=t,i[3]=n):n=i[3],n)}),rI=(0,u.memo)(function(e){let t,n=(0,s.c)(2),i=(0,u.useDeferredValue)(e.states);return n[0]!==i?(t=(0,a.jsx)(rE,{states:i}),n[0]=i,n[1]=t):t=n[1],t});function rz(){let e,t=(0,s.c)(3),{badges:n,editState:i}=iP();return i&&n?(t[0]!==n||t[1]!==i?(e=(0,a.jsx)(n7,{badges:n,badgeProps:i,children:rT}),t[0]=n,t[1]=i,t[2]=e):e=t[2],e):null}function rT(e){let{states:t}=e;return(0,a.jsx)(rI,{states:t})}function rP(e,t){return(0,a.jsx)(o.m_,{content:e.title,disabled:!e.title,placement:"top",portal:!0,children:(0,a.jsx)(d.Ex,{fontSize:1,mode:"outline",paddingX:2,paddingY:1,radius:4,tone:e.color?rC[e.color]:void 0,style:{whiteSpace:"nowrap"},children:e.label})},"".concat(e.label,"-").concat(t))}let rA={create:m.REV,delete:m.ucK,discardDraft:m.USm,initial:m.REV,editDraft:m.qUP,editLive:m.qUP,publish:m.VQ$,unpublish:m.wvk},rR=(0,v.I4)(m.YJP)(ti());function rD(e){let t,n,i,l,d,c=(0,s.c)(14),{isExpanded:u,onExpand:p}=e,{t:m}=(0,h.Bdt)(r.Z7);c[0]!==u||c[1]!==p?(t=e=>{e.stopPropagation(),function(e){if(e)return;let t=document.getElementById(rG);if(t){let e=t.children[0];if(!(e.scrollHeight>e.clientHeight)){let t=getComputedStyle(e).overflowY;e.style.overflowY="hidden",setTimeout(()=>{e.style.overflowY=t},0)}}}(u),p()},c[0]=u,c[1]=p,c[2]=t):t=c[2];let f=t;return c[3]!==u?(n=(0,a.jsx)(rR,{"data-expanded":u}),c[3]=u,c[4]=n):n=c[4],c[5]!==u||c[6]!==m?(i=m(u?"timeline-item.menu.action-collapse":"timeline-item.menu.action-expand"),c[5]=u,c[6]=m,c[7]=i):i=c[7],c[8]!==i?(l={content:i},c[8]=i,c[9]=l):l=c[9],c[10]!==f||c[11]!==n||c[12]!==l?(d=(0,a.jsx)(o.$n,{mode:"bleed",icon:n,tooltipProps:l,onClick:f}),c[10]=f,c[11]=n,c[12]=l,c[13]=d):d=c[13],d}let rM=(0,v.I4)(d.BJ)(tl()),rB=(0,v.I4)(d.so)(tr(),e=>e.$maxHeight),rY=(0,v.I4)(d.az)(e=>{let{$visible:t}=e;return(0,v.AH)(ta(),t&&(0,v.AH)(to()))}),rL={initial:"timeline.operation.created-initial",create:"timeline.operation.created",publish:"timeline.operation.published",editLive:"timeline.operation.edited-live",editDraft:"timeline.operation.edited-draft",unpublish:"timeline.operation.unpublished",discardDraft:"timeline.operation.draft-discarded",delete:"timeline.operation.deleted"};function rO(e){let t,n,i=(0,s.c)(9),{maxLength:l,userIds:r,size:o,withTooltip:c}=e,u=void 0===c||c;if(i[0]!==r||i[1]!==u){let e;i[3]!==u?(e=e=>(0,a.jsx)(h.H8m,{user:e,withTooltip:u},e),i[3]=u,i[4]=e):e=i[4],t=r.map(e),i[0]=r,i[1]=u,i[2]=t}else t=i[2];return i[5]!==l||i[6]!==o||i[7]!==t?(n=(0,a.jsx)(d.GE,{maxLength:l,size:o,children:t}),i[5]=l,i[6]=o,i[7]=t,i[8]=n):n=i[8],n}let rH=(0,v.I4)(d.so)(e=>{let t=(0,ej.JW)(e.theme),n=e.$color;return(0,v.AH)(ts(),t.color.avatar[n].fg,t.color.avatar[n].bg,t.avatar.sizes[0].size,t.avatar.sizes[0].size)}),rV={initial:"blue",create:"blue",publish:"green",editLive:"green",editDraft:"yellow",unpublish:"orange",discardDraft:"orange",delete:"red",withinSelection:"magenta"},rN={minimal:!0,useTemporalPhrase:!0},rZ=(0,v.I4)(c.EA)(e=>{let t=(0,ej.JW)(e.theme);return(0,v.AH)(td(),t.font.text.sizes[0].lineHeight)}),rF=e=>{let t,n,i,l=(0,s.c)(10),{userId:r}=e,[o,c]=(0,h.Jd3)(r);return l[0]!==c||l[1]!==o?(t=(0,a.jsx)(d.az,{children:c||!o?(0,a.jsx)(h.LIN,{animated:!0}):(0,a.jsx)(h.H8m,{user:o})}),l[0]=c,l[1]=o,l[2]=t):t=l[2],l[3]!==c||l[4]!==o?(n=(0,a.jsx)(d.az,{children:!c&&(null==o?void 0:o.displayName)?(0,a.jsx)(d.EY,{muted:!0,size:1,children:o.displayName}):(0,a.jsx)(d.EY,{size:1,children:(0,a.jsx)(rZ,{animated:!0})})}),l[3]=c,l[4]=o,l[5]=n):n=l[5],l[6]!==t||l[7]!==n||l[8]!==r?(i=(0,a.jsxs)(d.so,{align:"center",gap:2,padding:1,children:[t,n]},r),l[6]=t,l[7]=n,l[8]=r,l[9]=i):i=l[9],i},rK=e=>{let t,n,i,l,r=(0,s.c)(9),{collaborators:o}=e,{t:c}=(0,h.Bdt)("studio");return r[0]!==c?(t=c("timeline.changes.title"),r[0]=c,r[1]=t):t=r[1],r[2]!==t?(n=(0,a.jsx)(d.az,{padding:1,paddingBottom:2,children:(0,a.jsx)(d.EY,{size:1,weight:"medium",children:t})}),r[2]=t,r[3]=n):n=r[3],r[4]!==o?(i=o.map(rJ),r[4]=o,r[5]=i):i=r[5],r[6]!==n||r[7]!==i?(l=(0,a.jsxs)(d.BJ,{paddingBottom:1,children:[n,i]}),r[6]=n,r[7]=i,r[8]=l):l=r[8],l};function rW(e){let t,n,i,l,r,c,u,p,m,f,x,v,g,b,j,y,_,w,S,k,C,E,I=(0,s.c)(55),{chunk:z,isSelected:T,onSelect:P,collaborators:A,optionsMenu:R}=e,{t:D}=(0,h.Bdt)("studio"),{type:M,endTimestamp:B}=z;I[0]!==M?(t=rA[M],I[0]=M,I[1]=t):t=I[1];let Y=t;I[2]!==z.authors?(n=Array.from(z.authors),I[2]=z.authors,I[3]=n):n=I[3];let L=n;I[4]!==A?(i=A?Array.from(A):[],I[4]=A,I[5]=i):i=I[5];let O=i,H="delete"!==M;I[6]===Symbol.for("react.memo_cache_sentinel")?(l={dateStyle:"medium",timeStyle:"short"},I[6]=l):l=I[6];let V=(0,h.ixk)(l);I[7]!==B?(r=new Date(B),I[7]=B,I[8]=r):r=I[8];let N=(0,h.Vq9)(r||"",rN);if(I[9]!==V||I[10]!==B){let e=new Date(B);u=V.format(e),I[9]=V,I[10]=B,I[11]=u}else u=I[11];c=u,I[12]!==z||I[13]!==H||I[14]!==P?(p=e=>{e.preventDefault(),e.stopPropagation(),H&&P(z)},I[12]=z,I[13]=H,I[14]=P,I[15]=p):p=I[15];let Z=p;I[16]===Symbol.for("react.memo_cache_sentinel")?(m={position:"relative"},I[16]=m):m=I[16],I[17]!==L?(f=(0,a.jsx)(rO,{maxLength:3,userIds:L,size:2}),I[17]=L,I[18]=f):f=I[18];let F=rV[M];return I[19]!==Y?(x=Y&&(0,a.jsx)(Y,{}),I[19]=Y,I[20]=x):x=I[20],I[21]!==x?(v=(0,a.jsx)(d.EY,{size:0,children:x}),I[21]=x,I[22]=v):v=I[22],I[23]!==F||I[24]!==v?(g=(0,a.jsx)(rH,{align:"center",justify:"center",$color:F,children:v}),I[23]=F,I[24]=v,I[25]=g):g=I[25],I[26]!==f||I[27]!==g?(b=(0,a.jsxs)("div",{style:m,children:[f,g]}),I[26]=f,I[27]=g,I[28]=b):b=I[28],I[29]!==D||I[30]!==M?(j=D(rL[M])||(0,a.jsx)("code",{children:M}),I[29]=D,I[30]=M,I[31]=j):j=I[31],I[32]!==j?(y=(0,a.jsx)(d.EY,{size:1,weight:"medium",children:j}),I[32]=j,I[33]=y):y=I[33],I[34]!==c||I[35]!==B||I[36]!==N?(_=(0,a.jsx)(d.EY,{as:"time",size:1,muted:!0,dateTime:B,title:c,children:N}),I[34]=c,I[35]=B,I[36]=N,I[37]=_):_=I[37],I[38]!==y||I[39]!==_?(w=(0,a.jsxs)(d.BJ,{space:2,children:[y,_]}),I[38]=y,I[39]=_,I[40]=w):w=I[40],I[41]!==O?(S=O.length>0&&(0,a.jsx)(d.so,{flex:1,justify:"flex-end",align:"center",children:(0,a.jsx)(o.m_,{placement:"top",content:(0,a.jsx)(rK,{collaborators:O}),portal:!0,children:(0,a.jsx)(d.az,{paddingLeft:2,paddingY:2,children:(0,a.jsx)(rO,{maxLength:3,userIds:O,size:0,withTooltip:!1})})})}),I[41]=O,I[42]=S):S=I[42],I[43]!==b||I[44]!==w||I[45]!==S?(k=(0,a.jsxs)(d.so,{align:"center",gap:3,children:[b,w,S]}),I[43]=b,I[44]=w,I[45]=S,I[46]=k):k=I[46],I[47]!==z.id||I[48]!==Z||I[49]!==T||I[50]!==k?(C=(0,a.jsx)(d.Zp,{as:"button",onClick:Z,padding:2,pressed:T,radiu
1s:2,"data-ui":"timelineItem","data-testid":"timeline-item-button","data-chunk-id":z.id,children:k}),I[47]=z.id,I[48]=Z,I[49]=T,I[50]=k,I[51]=C):C=I[51],I[52]!==R||I[53]!==C?(E=(0,a.jsxs)(d.so,{align:"center",gap:1,children:[C,R]}),I[52]=R,I[53]=C,I[54]=E):E=I[54],E}function rJ(e){return(0,a.jsx)(rF,{userId:e},e)}let rU=e=>"publish"!==e.type,r$=e=>"publish"===e.type,rG="timeline-list-wrapper",rQ=e=>{let{chunks:t,hasMoreChunks:n,lastChunk:i,onLoadMore:l,onSelect:r,listMaxHeight:o="calc(100vh - 280px)"}=e,[s,c]=(0,u.useState)(!1),{t:p}=(0,h.Bdt)("studio"),m=null==i?void 0:i.id,f=(0,u.useMemo)(()=>(function(e){let t=[];for(let n of e){if(r$(n)){t.push({...n,type:"publish",children:[],collaborators:new Set});continue}if(rU(n)){let e=function(e){let t=null;for(let n=e.length-1;n>=0;n--){let i=e[n];if(r$(i)){t=i;break}if("editDraft"!==i.type)break}return t}(t);if("editDraft"===n.type&&(null==e?void 0:e.type)==="publish"){Array.from(n.authors).forEach(t=>{e.collaborators.add(t)}),e.children.push(n.id),t.push({...n,parentId:e.id});continue}}rU(n)&&t.push(n)}return t})(t),[t]),[x,v]=(0,u.useState)(()=>{if(m){let e=f.find(e=>e.id===m);if(e&&rU(e)&&e.parentId)return new Set([e.parentId])}return new Set});(0,u.useEffect)(()=>{if(m){let e=f.find(e=>e.id===m);if(e&&rU(e)&&e.parentId){let t=e.parentId;v(e=>{if(e.has(t))return e;let n=new Set(e);return n.add(t),n})}}},[f,m]);let g=(0,u.useMemo)(()=>f.filter(e=>!!r$(e)||!e.parentId||x.has(e.parentId)),[f,x]);(0,u.useEffect)(()=>{g.length<16&&n&&l()},[g,n,l]);let b=(0,u.useCallback)(e=>()=>v(t=>{let n=new Set(t);return t.has(e)?n.delete(e):n.add(e),n}),[]),j=(0,u.useMemo)(()=>m?g.findIndex(e=>e.id===m):-1,[m,g]),y=(0,u.useCallback)(e=>{let n=t.find(t=>t.id===e.id);n?r(n):(console.error("TimelineItem: chunk not found"),r(e))},[t,r]),_=(0,u.useCallback)((e,t)=>{let{activeIndex:i}=t;return(0,a.jsxs)(d.az,{paddingBottom:1,paddingTop:+(0===i),paddingRight:1,paddingLeft:rU(e)&&e.parentId?4:1,children:[(0,a.jsx)(rW,{chunk:e,isSelected:m===e.id,onSelect:y,collaborators:r$(e)?e.collaborators:void 0,optionsMenu:r$(e)&&e.children.length>0?(0,a.jsx)(rD,{isExpanded:x.has(e.id),onExpand:b(e.id)}):null}),i===g.length-1&&n&&(0,a.jsx)(h.gd4,{})]})},[x,g.length,b,y,n,m]);return(0,u.useEffect)(()=>c(!0),[]),(0,a.jsxs)(rY,{$visible:!j||s,"data-ui":"timeline",children:[0===g.length&&(0,a.jsxs)(rM,{padding:3,space:3,children:[(0,a.jsx)(d.EY,{size:1,weight:"medium",children:p("timeline.error.no-document-history-title")}),(0,a.jsx)(d.EY,{muted:!0,size:1,children:p("timeline.error.no-document-history-description")})]}),g.length>0&&(0,a.jsx)(rB,{direction:"column",$maxHeight:o,id:rG,children:(0,a.jsx)(h.oIj,{activeItemDataAttr:"data-hovered",ariaLabel:p("timeline.list.aria-label"),autoFocus:"list",initialIndex:j,initialScrollAlign:"center",itemHeight:57,items:g,onEndReached:l,onEndReachedIndexOffset:20,overscan:5,renderItem:_,wrapAround:!1})})]})};function rq(e){let t,n,i,l,r,o,c=(0,s.c)(14),{versionError:u}=e,{t:p}=(0,h.Bdt)("studio");return c[0]===Symbol.for("react.memo_cache_sentinel")?(t=(0,a.jsx)(h.SxK,{tone:"critical",children:(0,a.jsx)(m.YZv,{})}),c[0]=t):t=c[0],c[1]!==p||c[2]!==u?(n=p(u?"timeline.error.load-document-changes-version-title":"timeline.error.load-document-changes-title"),c[1]=p,c[2]=u,c[3]=n):n=c[3],c[4]!==n?(i=(0,a.jsx)(h.SxK,{size:1,tone:"critical",weight:"medium",children:n}),c[4]=n,c[5]=i):i=c[5],c[6]!==p||c[7]!==u?(l=p(u?"timeline.error.load-document-changes-version-description":"timeline.error.load-document-changes-description"),c[6]=p,c[7]=u,c[8]=l):l=c[8],c[9]!==l?(r=(0,a.jsx)(h.SxK,{size:1,tone:"critical",children:l}),c[9]=l,c[10]=r):r=c[10],c[11]!==i||c[12]!==r?(o=(0,a.jsxs)(d.so,{align:"flex-start",gap:3,padding:4,children:[t,(0,a.jsxs)(d.BJ,{space:4,children:[i,r]})]}),c[11]=i,c[12]=r,c[13]=o):o=c[13],o}rQ.displayName="Timeline";let rX=(0,v.I4)(o.AM)(tc()),r0="timeline-menu";function r1(e){let{chunk:t,mode:n,placement:i}=e,{setTimelineRange:l,timelineError:r,ready:s,timelineStore:p}=iP(),[f,x]=(0,u.useState)(!1),[v,g]=(0,u.useState)(null),[b,j]=(0,u.useState)(null),y=(0,c.dj)(),_=(0,h.SfM)(p,e=>e.chunks),w=(0,h.SfM)(p,e=>e.isLoading),S=(0,h.SfM)(p,e=>e.hasMoreChunks),k=(0,h.SfM)(p,e=>e.realRevChunk),C=(0,h.SfM)(p,e=>e.sinceTime),{t:E}=(0,h.Bdt)("studio"),I=(0,u.useCallback)(()=>{x(!0)},[]),z=(0,u.useCallback)(()=>{x(!1)},[]),T=(0,u.useCallback)(e=>
1{f&&("Escape"===e.key||"Tab"===e.key)&&(z(),null==v||v.focus())},[v,z,f]);(0,d.Pm)(T),(0,d.PR)(f&&z,()=>[v,b]);let P=(0,u.useCallback)(e=>{try{let[t,n]=(null==p?void 0:p.findRangeForRev(e))||[null,null];l(t,n)}catch(e){y.push({closable:!0,description:e.message,status:"error",title:E("timeline.error.unable-to-load-revision")})}},[l,E,p,y]),A=(0,u.useCallback)(e=>{try{let[t,n]=(null==p?void 0:p.findRangeForSince(e))||[null,null];l(t,n)}catch(e){y.push({closable:!0,description:e.message,status:"error",title:E("timeline.error.unable-to-load-revision")})}},[l,E,p,y]),R=(0,u.useCallback)(()=>{w||null==p||p.loadMore()},[w,p]),D=(0,u.useMemo)(()=>{if(r)return(0,a.jsx)(rq,{});if("rev"===n)return(0,a.jsx)(rQ,{chunks:_,hasMoreChunks:S,lastChunk:k,onLoadMore:R,onSelect:P});let e=k?_.filter(e=>e.index<k.index):_;return(0,a.jsx)(rQ,{chunks:e,hasMoreChunks:S,lastChunk:C,onLoadMore:R,onSelect:A})},[_,R,S,n,k,P,A,C,r]),M={timestamp:{dateStyle:"medium",timeStyle:"short"}},B=t?E(rL[t.type],{context:"timestamp",timestamp:new Date(null==t?void 0:t.endTimestamp),formatParams:M}):E("timeline.latest-revision"),Y=t?E("timeline.since",{timestamp:new Date(null==t?void 0:t.endTimestamp),formatParams:M}):E("timeline.since-version-missing"),L="rev"===n?B:Y;return(0,a.jsx)(d.GD,{__unstable_elements:{[r0]:b},children:(0,a.jsx)(rX,{"data-testid":"timeline-menu",constrainSize:!0,content:f&&D,"data-ui":"versionMenu",open:f,placement:i,matchReferenceWidth:!0,portal:!0,ref:j,children:(0,a.jsx)(d.so,{width:"fill",children:(0,a.jsx)(o.$n,{"data-testid":f?"timeline-menu-close-button":"timeline-menu-open-button",disabled:!s,mode:"ghost",onClick:f?z:I,ref:g,selected:f,width:"fill",tooltipProps:null,justify:"space-between",style:{maxWidth:"100%"},iconRight:m.D3D,text:s?L:E("timeline.loading-history")})})})})}let r2=(0,v.I4)(b.P.path)(tu()),r3=e=>{let t,n=(0,s.c)(2);return n[0]!==e?(t=(0,a.jsx)(b.P.circle,{fill:"none",r:"8",cx:"12.5",cy:"12.5",strokeWidth:"1.2",...e}),n[0]=e,n[1]=t):t=n[1],t},r4=e=>{let t,n=(0,s.c)(2);return n[0]!==e?(t=(0,a.jsx)(r2,{fill:"none",d:"M14 17.5619L11.5 20.5L14.5 23.0619M11 7.43811L13.5 4.50001L10.5 1.93811",...e}),n[0]=e,n[1]=t):t=n[1],t},r5=e=>{let t,n=(0,s.c)(2);return n[0]!==e?(t=(0,a.jsx)(b.P.path,{d:"M9.5 12.1316L11.7414 14.5L16 10",...e}),n[0]=e,n[1]=t):t=n[1],t},r6=(0,v.i7)(tp()),r7=v.I4.g(tm(),r6),r8={syncing:{scale:1,transition:{duration:0}},saved:{scale:[1,.8,1.2,.9,1.1,.95,1.05,.99,1],transition:{duration:.5,delay:.2}},changes:{transition:{duration:0}}},r9={syncing:{strokeDasharray:"0, 0, 23, 3, 23, 3",strokeDashoffset:10,opacity:1,transition:{duration:0}},saved:{strokeDasharray:"0, 0, 23, 0, 23, 0",strokeDashoffset:10,opacity:1,transition:{duration:.2}},changes:{strokeDasharray:"0, 60, 23, 0, 23, 0",strokeDashoffset:0,opacity:0,transition:{duration:.5}}},oe={syncing:{opacity:1,transition:{duration:0}},saved:{opacity:0,transition:{duration:.2}},changes:{opacity:0}},ot={syncing:{pathLength:0,transition:{duration:0}},saved:{pathLength:1,transition:{delay:.4,duration:.3}},changes:{pathLength:0,transition:{duration:.2}}};function on(e){let t,n,i,l,r,o=(0,s.c)(13),{status:d}=e;if(!d)return null;let c="changes"===d?void 0:"";return o[0]!==d?(t=(0,a.jsx)(r4,{variants:oe,initial:d,animate:d}),n=(0,a.jsx)(r3,{variants:r9,initial:d,animate:d}),o[0]=d,o[1]=t,o[2]=n):(t=o[1],n=o[2]),o[3]!==c||o[4]!==t||o[5]!==n?(i=(0,a.jsxs)(r7,{"data-rotate":c,children:[t,n]}),o[3]=c,o[4]=t,o[5]=n,o[6]=i):i=o[6],o[7]!==d?(l=(0,a.jsx)(r5,{variants:ot,initial:d,animate:d}),o[7]=d,o[8]=l):l=o[8],o[9]!==d||o[10]!==i||o[11]!==l?(r=(0,a.jsx)("svg",{width:"1em",height:"1em",viewBox:"0 0 25 25",fill:"none",stroke:"currentColor",strokeWidth:"1.2","data-sanity-icon":"animated-status-icon",children:(0,a.jsxs)(b.P.g,{variants:r8,initial:d,animate:d,children:[i,l]})}),o[9]=d,o[10]=i,o[11]=l,o[12]=r):r=o[12],r}let oi={saved:{i18nKey:"status-bar.document-status-pulse.status.saved.text",tone:"positive"},syncing:{i18nKey:"status-bar.document-status-pulse.status.syncing.text",tone:"default"}},ol=e=>{let t,n,i,l,o,c=(0,s.c)(13),{status:u}=e,{t:p}=(0,h.Bdt)(r.Z7);if("saved"!==u&&"syncing"!==u)return null;let m=oi[u];return c[0]!==u?(t=(0,a.jsx)(on,{status:u}),c[0]=u,c[1]=t):t=c[1],c[2]!==m.tone||c[3]!==t?(n=(0,a.jsx)(h.SxK,{size:1,tone:m.tone,children:t}),c[2]=m.tone,c[3]=t,c[4]=n):n=c[4],c[5]!==m.i18nKey||c[6]!==p?(i=p(m.i18nKey),c[5]=m.i18nKey,c[6]=p,c[7]=i):i=c[7],c[8]!==i?(l=(0,a.jsx)(d.EY,{muted:!0,size:1,children:i}),c[8]=i,c[9]=l):l=c[9],c[10]!==n||c[11]!==l?(o=(0,a.jsxs)(d.so,{align:"center",gap:2,"data-testid":"pane-footer-document-status-pulse",children:[n,l]}),c[10]=n,c[11]=l,c[12]=o):o=c[12],o},or={minimal:!0,useTemporalPhrase:!0},oo=b.P.create(d.$n),oa=b.P.create(d.az),os=()=>{let e,t,n=(0,s.c)(2);return n[0]===Symbol.for("react.memo_cache_sentinel")?(e=(0,a.jsx)("div",{style:{margin:-5},children:(0,a.jsx)(h.LIN,{$size:0,animated:!0})}),n[0]=e):e=n[0],n[1]===Symbol.for("react.memo_cache_sentinel")?(t=(0,a.jsxs)(d.so,{align:"center",gap:3,paddingLeft:1,paddingRight:2,paddingY:2,children:[e,(0,a.jsx)(c.EA,{animated:!0,style:{width:"80px",height:"15px"},radius:2})]}),n[1]=t):t=n[1],t},od=e=>{let t,n,i,l,r,o,c,u,p=(0,s.c)(17),{author:m,translationKey:f,timestamp:x}
1=e,{onHistoryOpen:v,inspector:g,onHistoryClose:b}=iP(),{t:j}=(0,h.Bdt)(),y=(0,h.Vq9)(void 0===x?"":x,or);p[0]===Symbol.for("react.memo_cache_sentinel")?(t={opacity:1},n={opacity:0},i={opacity:0},p[0]=t,p[1]=n,p[2]=i):(t=p[0],n=p[1],i=p[2]);let _=(null==g?void 0:g.name)===iH?b:v;return p[3]!==m?(l=m&&(0,a.jsx)("div",{style:{margin:-5},children:(0,a.jsx)(h.H8m,{user:m,size:0})}),p[3]=m,p[4]=l):l=p[4],p[5]!==j||p[6]!==f?(r=j(f),p[5]=j,p[6]=f,p[7]=r):r=p[7],p[8]!==y||p[9]!==r?(o=(0,a.jsxs)(d.EY,{muted:!0,size:1,children:[r," ",y]}),p[8]=y,p[9]=r,p[10]=o):o=p[10],p[11]!==l||p[12]!==o?(c=(0,a.jsxs)(d.so,{align:"center",flex:"none",gap:3,children:[l,o]}),p[11]=l,p[12]=o,p[13]=c):c=p[13],p[14]!==_||p[15]!==c?(u=(0,a.jsx)(oo,{"data-testid":"pane-footer-document-status",animate:t,initial:n,exit:i,mode:"bleed",onClick:_,padding:2,muted:!0,children:c}),p[14]=_,p[15]=c,p[16]=u):u=p[16],u},oc=()=>{var e,t,n,i,l;let{editState:r}=iP(),{selectedPerspective:o}=(0,h.QO2)(),s=(0,u.useMemo)(()=>{var e,t,n,i,l,a,s;return(0,h.xo4)(o)&&(null==r||null==(e=r.published)?void 0:e._updatedAt)?{translationKey:h.uMx.published.createDocumentVersion,timestamp:r.published._updatedAt}:(null==r||null==(t=r.version)?void 0:t._updatedAt)?{translationKey:(null==r||null==(n=r.version)?void 0:n._updatedAt)===(null==r||null==(i=r.version)?void 0:i._createdAt)?h.uMx.version.createDocumentVersion:h.uMx.version.editDocumentVersion,timestamp:r.version._updatedAt}:(null==r||null==(l=r.draft)?void 0:l._updatedAt)?{translationKey:(null==r||null==(a=r.draft)?void 0:a._updatedAt)===(null==r||null==(s=r.draft)?void 0:s._createdAt)?h.uMx.draft.createDocumentVersion:h.uMx.draft.editDocumentVersion,timestamp:r.draft._updatedAt}:null},[o,null==r||null==(e=r.published)?void 0:e._updatedAt,null==r||null==(t=r.version)?void 0:t._updatedAt,null==r||null==(n=r.version)?void 0:n._createdAt,null==r||null==(i=r.draft)?void 0:i._updatedAt,null==r||null==(l=r.draft)?void 0:l._createdAt]);return s?(0,a.jsx)(od,{author:"",translationKey:s.translationKey,timestamp:s.timestamp}):null},ou=()=>{let e,t=(0,s.c)(6),{events:n,loading:i}=(0,h.LJN)(),l=null==n?void 0:n[0];if(!l&&i){let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=(0,a.jsx)(os,{}),t[0]=e):e=t[0],e}if(!l){let e;return t[1]===Symbol.for("react.memo_cache_sentinel")?(e=(0,a.jsx)(oc,{}),t[1]=e):e=t[1],e}let r=h.uMx[l.documentVariantType][l.type];return t[2]!==l.author||t[3]!==l.timestamp||t[4]!==r?(e=(0,a.jsx)(od,{author:l.author,translationKey:r,timestamp:l.timestamp}),t[2]=l.author,t[3]=l.timestamp,t[4]=r,t[5]=e):e=t[5],e},op=()=>{let e,t,n=(0,s.c)(8),{timelineStore:i}=iP(),l=(0,h.SfM)(i,oh),r=(0,h.SfM)(i,of),o=null==l?void 0:l[0];if(!o&&r){let e;return n[0]===Symbol.for("react.memo_cache_sentinel")?(e=(0,a.jsx)(os,{}),n[0]=e):e=n[0],e}if(!o){let e;return n[1]===Symbol.for("react.memo_cache_sentinel")?(e=(0,a.jsx)(oc,{}),n[1]=e):e=n[1],e}n[2]!==o.authors?(e=Array.from(o.authors),n[2]=o.authors,n[3]=e):e=n[3];let d=e[0],c=rL[o.type];return n[4]!==d||n[5]!==o.endTimestamp||n[6]!==c?(t=(0,a.jsx)(od,{author:d,translationKey:c,timestamp:o.endTimestamp}),n[4]=d,n[5]=o.endTimestamp,n[6]=c,n[7]=t):t=n[7],t};function om(){var e,t;let n,i,l,r,o,d,c,p=(0,s.c)(18),{documentId:m,documentType:f,editState:x,value:v}=iP(),[g,b]=(0,u.useState)(null),y=null==(t=(0,h.For)().beta)||null==(e=t.eventsAPI)?void 0:e.documents,_=(0,h.M7h)(m,f,null==x?void 0:x.release),w=null==v?void 0:v._updatedAt;return p[0]!==g||p[1]!==_.isSyncing?(n=()=>{if("syncing"===g&&!_.isSyncing){let e=setTimeout(()=>b("saved"),1e3);return()=>clearTimeout(e)}if("saved"===g){let e=setTimeout(()=>b(null),3e3);return()=>clearTimeout(e)}},p[0]=g,p[1]=_.isSyncing,p[2]=n):n=p[2],p[3]!==w||p[4]!==g||p[5]!==_.isSyncing?(i=[g,w,_.isSyncing],p[3]=w,p[4]=g,p[5]=_.isSyncing,p[6]=i):i=p[6],(0,u.useEffect)(n,i),p[7]===Symbol.for("react.memo_cache_sentinel")?(l=()=>{b(null)},p[7]=l):l=p[7],p[8]!==m?(r=[m],p[8]=m,p[9]=r):r=p[9],(0,u.useLayoutEffect)(l,r),p[10]!==_.isSyncing?(o=()=>{_.isSyncing&&b("syncing")},p[10]=_.isSyncing,p[11]=o):o=p[11],p[12]!==w||p[13]!==_.isSyncing?(d=[_.isSyncing,w],p[12]=w,p[13]=_.isSyncing,p[14]=d):d=p[14],(0,u.useLayoutEffect)(o,d),p[15]!==y||p[16]!==g?(c=(0,a.jsx)(j.N,{children:g?(0,a.jsx)(oa,{paddingLeft:2,animate:{o
1pacity:1},initial:{opacity:0},exit:{opacity:0},children:(0,a.jsx)(ol,{status:g||void 0})}):(0,a.jsx)(a.Fragment,{children:y?(0,a.jsx)(ou,{}):(0,a.jsx)(op,{})})}),p[15]=y,p[16]=g,p[17]=c):c=p[17],c}function oh(e){return e.chunks}function of(e){return e.isLoading}let ox=(0,v.I4)(d.EY)(th());function ov(){let e,t,n,i,l,r=(0,s.c)(12),{displayed:o,revisionNotFound:c}=iP(),{t:u}=(0,h.Bdt)(),p=(null==o?void 0:o._updatedAt)||(null==o?void 0:o._createdAt);r[0]!==p||r[1]!==u?(e=p?(0,a.jsx)(h.HTc,{t:u,i18nKey:"document-status.revision-from",values:{date:(0,eg.A)(new Date(p),"MMM d, yyyy '@' pp")}}):null,r[0]=p,r[1]=u,r[2]=e):e=r[2],r[3]!==e?(t={name:"revision",text:e,tone:"caution"},r[3]=e,r[4]=t):t=r[4];let f=t;return r[5]===Symbol.for("react.memo_cache_sentinel")?(n=(0,a.jsx)(d.az,{flex:"none",children:(0,a.jsx)(d.EY,{size:1,children:(0,a.jsx)(m.G2W,{})})}),r[5]=n):n=r[5],r[6]!==f||r[7]!==c||r[8]!==u?(i=c?(0,a.jsx)(h.HTc,{t:u,i18nKey:"document-status.revision-not-found"}):f.text,r[6]=f,r[7]=c,r[8]=u,r[9]=i):i=r[9],r[10]!==i?(l=(0,a.jsx)(a.Fragment,{children:(0,a.jsxs)(d.so,{flex:1,gap:3,padding:2,children:[n,(0,a.jsx)(d.az,{flex:1,children:(0,a.jsx)(ox,{size:1,textOverflow:"ellipsis",children:i})})]})}),r[10]=i,r[11]=l):l=r[11],l}let og=b.P.create(d.Zp);function ob(e){var t;let n,i,l,r,o,c,p,m,f=(0,s.c)(22),{actionsBoxRef:x,createLinkMetadata:v}=e,{editState:g,onChange:b,revisionNotFound:j}=iP(),{params:y}=t0(),_=void 0===y?iY:y,{selectedPerspective:w}=(0,h.QO2)(),{title:S}=iN(),k=null==(t=(0,h.eaL)().components)?void 0:t.documentLinkedActions,C=!!_.rev,[E,I]=(0,u.useState)(null),[z,T]=(0,u.useState)(null);f[0]===Symbol.for("react.memo_cache_sentinel")?(n=e=>{I(e.contentRect.width<480)},f[0]=n):n=f[0];let P=n;f[1]!==z?(i={element:z,onResize:P},f[1]=z,f[2]=i):i=f[2],function(e){let t,n,i=(0,s.c)(4),{element:l,onResize:r}=e;i[0]!==l||i[1]!==r?(t=()=>(l&&h.bCC.observe(l,r),()=>{l&&h.bCC.unobserve(l)}),n=[l,r],i[0]=l,i[1]=r,i[2]=t,i[3]=n):(t=i[2],n=i[3]),(0,u.useLayoutEffect)(t,n)}(i);e:{let e=!!((null==g?void 0:g.ready)&&"boolean"==typeof E);if(w){if((0,h.xo4)(w)){l=e&&!!(null==g?void 0:g.published);break e}if((0,h.Jrl)(w)){l=e&&!!(null==g?void 0:g.version);break e}}l=e}let A=l;if(v&&(0,h.Y07)(v)&&k){let e;f[3]!==k||f[4]!==v||f[5]!==b||f[6]!==S?(e=(0,a.jsx)(k,{metadata:v,panelPortalElementId:lU,onDocumentChange:b,documentTitle:S}),f[3]=k,f[4]=v,f[5]=b,f[6]=S,f[7]=e):e=f[7],r=e}else if(C){let e;f[8]===Symbol.for("react.memo_cache_sentinel")?(e=(0,a.jsx)(rh,{}),f[8]=e):e=f[8],r=e}else{let e;f[9]===Symbol.for("react.memo_cache_sentinel")?(e=(0,a.jsx)(rm,{}),f[9]=e):e=f[9],r=e}if(C&&j)return null;let R=C?"revision":"published";f[10]===Symbol.for("react.memo_cache_sentinel")?(o={opacity:.2},f[10]=o):o=f[10],f[11]===Symbol.for("react.memo_cache_sentinel")?(c={opacity:1,transition:{duration:.3}},f[11]=c):c=f[11];let D=C?"caution":void 0;return f[12]!==r||f[13]!==x||f[14]!==E||f[15]!==A||f[16]!==C?(p=A&&(0,a.jsxs)(d.so,{align:"stretch",gap:1,justify:"space-between",paddingLeft:+!C,paddingRight:+!C,children:[(0,a.jsxs)(d.so,{align:"center",flex:1,gap:E?2:3,wrap:"wrap",paddingRight:3,children:[(0,a.jsxs)(d.so,{align:"center",children:[C?(0,a.jsx)(ov,{}):(0,a.jsx)(om,{}),(0,a.jsx)(rk,{})]}),(0,a.jsx)(rz,{})]}),(0,a.jsxs)(d.so,{align:"flex-start",justify:"flex-end",ref:x,style:{flexShrink:0,marginLeft:"auto"},children:[(0,a.jsx)(rk,{}),r]})]}),f[12]=r,f[13]=x,f[14]=E,f[15]=A,f[16]=C,f[17]=p):p=f[17],f[18]!==R||f[19]!==D||f[20]!==p?(m=(0,a.jsx)(og,{initial:o,animate:c,tone:D,radius:3,ref:T,sizing:"border",padding:2,children:p},R),f[18]=R,f[19]=D,f[20]=p,f[21]=m):m=f[21],m}let oj=(0,u.memo)(function(e){let t,n,i,l,r,o,d,c,u,p,m,f,x,v=(0,s.c)(26);v[0]!==e?({actionsBoxElement:t,activeIndex:n,as:p,children:i,id:l,onActionStart:r,onKeyDown:o,rootRef:c,states:u,...d}=e,v[0]=e,v[1]=t,v[2]=n,v[3]=i,v[4]=l,v[5]=r,v[6]=o,v[7]=d,v[8]=c,v[9]=u,v[10]=p):(t=v[1],n=v[2],i=v[3],l=v[4],r=v[5],o=v[6],d=v[7],c=v[8],u=v[9],p=v[10]);let g=void 0===p?"div":p,b=u[n];v[11]!==r||v[12]!==o||v[13]!==u?(m=e=>{let t=u.filter(t=>t.shortcut&&(0,ec.v_)(t.shortcut,e)),n=t[0];if(t.length>1&&console.warn('Keyboard shortcut conflict: More than one document action matches the shortcut "'.concat(n.shortcut,'"')),n&&!n.disabled&&n.onHandle){e.preventDefault(),n.onHandle(),r(u.indexOf(n));return}o&&o(e)},v[11]=r,v[12]=o,v[13]=u,v[14]=m):m=v[14];let j=m;return v[15]!==t||v[16]!==b?(f=b&&b.dialog&&(0,a.jsx)(h.wG1,{zOffset:"paneFooter",children:(0,a.jsx)(l3,{dialog:b.dialog,referenceElement:t})}),v[15]=t,v[16]=b,v[17]=f):f=v[17],v[18]!==g||v[19]!==i||v[20]!==j||v[21]!==l||v[22]!==d||v[23]!==c||v[24]!==f?(x=(0,a.jsxs)(g,{id:l,onKeyDown:j,tabIndex:-1,...d,ref:c,children:[i,f]}),v[18]=g,v[19]=i,v[20]=j,v[21]=l,v[22]=d,v[23]=c,v[24]=f,v[25]=x):x=v[25],x}),oy=(0,u.memo)(e=>{let t,n,i,l,r,o,d,c,p,m=(0,s.c)(20);m[0]!==e?({actionsBoxElement:t,as:l,children:n,...i}=e,m[0]=e,m[1]=t,m[2]=n,m[3]=i,m[4]=l):(t=m[1],n=m[2],i=m[3],l=m[4]);let h=void 0===l?"div":l,{actions:f,editState:x,isInitialValueLo
1ading:v,revisionId:g}=iP(),[b,j]=(0,u.useState)(-1);m[5]===Symbol.for("react.memo_cache_sentinel")?(r=e=>{j(e)},m[5]=r):r=m[5];let y=r;m[6]!==x||m[7]!==v||m[8]!==g?(d=x&&{...x,onComplete:o_,revision:g||void 0,initialValueResolved:!v},m[6]=x,m[7]=v,m[8]=g,m[9]=d):d=m[9],o=d,m[10]!==t||m[11]!==b||m[12]!==h||m[13]!==n||m[14]!==i?(c=e=>{let{states:l}=e;return(0,a.jsx)(oj,{...i,activeIndex:b,actionsBoxElement:t,as:h,onActionStart:y,states:l,children:n})},m[10]=t,m[11]=b,m[12]=h,m[13]=n,m[14]=i,m[15]=c):c=m[15];let _=c;return o&&f?(m[16]!==o||m[17]!==f||m[18]!==_?(p=(0,a.jsx)(n4,{actionProps:o,actions:f,children:_}),m[16]=o,m[17]=f,m[18]=_,m[19]=p):p=m[19],p):null});function o_(){}function ow(e){let t,n,i,l,r,o,c,u=(0,s.c)(23),{documentType:p,value:m,currentMinWidth:f,paneKey:x,minWidth:v}=e,{t:g}=(0,h.Bdt)();return u[0]!==p?(t={documentType:p},u[0]=p,u[1]=t):t=u[1],u[2]!==g||u[3]!==t?(n=(0,a.jsx)(h.HTc,{t:g,i18nKey:"panes.document-pane.document-unknown-type.title",values:t}),u[2]=g,u[3]=t,u[4]=n):n=u[4],u[5]!==p||u[6]!==g?(i=p&&(0,a.jsx)(d.EY,{as:"p",children:(0,a.jsx)(h.HTc,{t:g,i18nKey:"panes.document-pane.document-unknown-type.text",values:{documentType:p}})}),u[5]=p,u[6]=g,u[7]=i):i=u[7],u[8]!==p||u[9]!==g?(l=!p&&(0,a.jsx)(d.EY,{as:"p",children:g("panes.document-pane.document-unknown-type.without-schema.text")}),u[8]=p,u[9]=g,u[10]=l):l=u[10],u[11]!==m?(r=h.Cu5&&m&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(d.EY,{as:"p",children:"Here is the JSON representation of the document:"}),(0,a.jsx)(d.Zp,{padding:3,overflow:"auto",radius:2,shadow:1,tone:"inherit",children:(0,a.jsx)(d.Cy,{language:"json",size:[1,1,2],children:JSON.stringify(m,null,2)})})]}),u[11]=m,u[12]=r):r=u[12],u[13]!==i||u[14]!==l||u[15]!==r?(o=(0,a.jsxs)(d.BJ,{space:4,children:[i,l,r]}),u[13]=i,u[14]=l,u[15]=r,u[16]=o):o=u[16],u[17]!==f||u[18]!==v||u[19]!==x||u[20]!==n||u[21]!==o?(c=(0,a.jsx)(iE,{currentMinWidth:f,flex:2.5,minWidth:v,paneKey:x,title:n,tone:"caution",children:o}),u[17]=f,u[18]=v,u[19]=x,u[20]=n,u[21]=o,u[22]=c):c=u[22],c}oy.displayName="Memo(DocumentActionShortcuts)";let oS=["fixed","fixed","absolute"];function ok(e){let t,n,i,l,r,u,p,m=(0,s.c)(16),{documentPanelPortalElement:f,setFooterElement:x,setActionsBoxElement:v}=e,g=(0,h.YKH)(),{value:b}=iP();m[0]!==f?(n={[lU]:f},m[0]=f,m[1]=n):n=m[1],t=n,m[2]!==b?(i=(0,h.G_3)(b),m[2]=b,m[3]=i):i=m[3];let j=i;return m[4]!==j||m[5]!==v?(l=(0,a.jsx)(o.vE,{children:(0,a.jsx)(ob,{actionsBoxRef:v,createLinkMetadata:j})}),m[4]=j,m[5]=v,m[6]=l):l=m[6],m[7]!==x||m[8]!==l?(r=(0,a.jsx)(nk,{ref:x,padding:1,children:l}),m[7]=x,m[8]=l,m[9]=r):r=m[9],m[10]!==r||m[11]!==g.portal?(u=(0,a.jsx)(c.Co,{position:oS,zOffset:g.portal,children:r}),m[10]=r,m[11]=g.portal,m[12]=u):u=m[12],m[13]!==t||m[14]!==u?(p=(0,a.jsx)(d.GD,{__unstable_elements:t,children:u}),m[13]=t,m[14]=u,m[15]=p):p=m[15],p}let oC=[],oE=["fixed","fixed","absolute"],oI=(0,v.I4)(h.olN)(tf());function oz(){let{changesOpen:e,displayed:t,documentId:n,documentType:i,editState:l,fieldActions:o,focusPath:s,inspectOpen:p,inspector:f,inspectors:x,onFocus:v,onHistoryOpen:g,onMenuAction:b,onPathOpen:j,paneKey:y,schemaType:_,value:w,previewUrl:S}=iP(),{params:k}=t0(),{features:C}=iB(),{t:E}=(0,h.Bdt)(r.Z7),{collapsed:I}=tG(),z=(0,h.YKH)(),[T,P]=(0,u.useState)(null),[A,R]=(0,u.useState)(null),[D,M]=(0,u.useState)(null),[B,Y]=(0,u.useState)(null),[L,O]=(0,u.useState)(null);(0,h.ti5)({element:T,focusPath:s,value:w});let[H,V]=(0,u.useState)([]),[N,Z]=(0,u.useState)([]),F=(0,c.sQ)(A),K=(0,c.sQ)(D),W=null==F?void 0:F.height,J=null==K?void 0:K.height,U=600+320*!!f,$=320+320*!!f,G=(0,u.useMemo)(()=>null==x?void 0:x.find(e=>e.name===(null==f?void 0:f.name)),[x,null==f?void 0:f.name]),Q=iM({displayed:t,documentId:n,editState:l}),q=!!w,X=(0,u.useMemo)(()=>(function(e){let t=function(e){let{currentInspector:t,hasValue:n,inspectors:i,inspectorMenuItems:l}=e;return i.map((e,i)=>{var r;let o=l[i];return!o||o.hidden?null:{action:"".concat(iL).concat(e.name),group:o.showAsAction?void 0:"inspectors",icon:o.icon,disabled:!n,selected:(null==t?void 0:t.name)===e.name,shortcut:null==(r=o.hotkeys)?void 0:r.join("+"),showAsAction:o.showAsAction,title:o.title,tone:o.tone}}
1).filter(Boolean)}(e),n=[function(e){let{previewUrl:t,t:n}=e;return t?{action:"production-preview",group:"links",title:n("production-preview.menu-item.title"),icon:m.Pe7,shortcut:"Ctrl+Alt+O"}:null}(e),function(e){let{documentIdStack:t,t:n}=e,i=typeof(null==t?void 0:t.previousId)>"u"&&{reason:n("compare-versions.menu-item.disabled-reason")};return{action:"compareVersions",group:"inspectors",title:n("compare-versions.menu-item.title"),icon:m.ppF,disabled:i}}(e)].filter(Boolean);return[{action:"copy-document-url",showAsAction:!0,title:e.t("action.copy-document-url.label"),icon:m.qYV},...t,function(e){let{hasValue:t,t:n}=e;return{action:"inspect",group:"inspectors",title:n("document-inspector.menu-item.title"),icon:m.qzt,disabled:!t,shortcut:"Ctrl+Alt+I"}}(e),...n]})({currentInspector:G,features:C,hasValue:q,inspectorMenuItems:H,inspectors:x,previewUrl:S,documentIdStack:Q,t:E}),[G,Q,C,q,H,x,S,E]),ee=(0,u.useCallback)(e=>{for(let t of X)if(t.shortcut&&(0,ec.v_)(t.shortcut,e)){e.preventDefault(),e.stopPropagation(),b(t);return}},[b,X]),et=(0,u.useCallback)(e=>{j(e),v(e)},[j,v]);return _?(0,a.jsxs)(h.niW,{value:w,children:[x.length>0&&(0,a.jsx)(iV,{documentId:n,documentType:i,inspectors:x,onMenuItems:V}),o.length>0&&_&&(0,a.jsx)(h.yW8,{actions:o,documentId:n,documentType:i,onActions:Z,path:oC,schemaType:_}),(0,a.jsx)(h.tdH,{actions:N,path:oC,children:(0,a.jsxs)(oy,{actionsBoxElement:B,as:nc,currentMinWidth:U,"data-testid":"document-pane",flex:2.5,id:y,minWidth:$,onKeyUp:ee,rootRef:P,children:[(0,a.jsx)(r_,{ref:M,menuItems:X}),(0,a.jsx)(c.Co,{position:oE,zOffset:z.paneDialog,children:(0,a.jsx)(d.so,{direction:"column",flex:1,height:I?void 0:"fill",children:(0,a.jsx)(oI,{"data-testid":"change-connector-root",isReviewChangesOpen:e&&(null==k?void 0:k.changesInspectorTab)==="review",onOpenReviewChanges:g,onSetFocus:et,children:(0,a.jsx)(lF,{footerHeight:W||null,headerHeight:J||null,isInspectOpen:p,rootElement:T,setDocumentPanelPortalElement:O,footer:(0,a.jsx)(ok,{documentPanelPortalElement:L,setFooterElement:R,setActionsBoxElement:Y})})})})}),(0,a.jsx)(iF,{})]})})]}):(0,a.jsx)(ow,{currentMinWidth:U,documentType:i,minWidth:$,paneKey:y,value:w})}let oT=(0,eh.g_)({name:"DocumentURLCopied",version:1,description:"User copied document URL to clipboard"});function oP(e){let t=(0,h.u4i)(e)&&"string"==typeof e.message?e.message:"Unknown error";throw Error("An error was thrown while trying to get your preview url: ".concat(t))}let oA=(0,u.memo)(e=>{let{children:t,index:n,pane:i,paneKey:l,onFocusPath:o,forcedVersion:d,historyStore:m}=e,{store:f,error:x,ready:v,revisionDocument:g,onOlderRevision:b,sinceDocument:j,isPristine:_,revisionId:k,lastNonDeletedRevId:C}=m,E=(0,h.pDY)(),{setDocumentMeta:z}=(0,h.e8q)(),{document:{actions:P,badges:A,unstable_fieldActions:R,unstable_languageFilter:D,drafts:{enabled:B}}}=(0,h.For)(),Y=(0,em.Jr)(),H=t0(),V=H.setParams,{push:N}=(0,c.dj)(),{options:Z,menuItemGroups:F=iO,title:K=null,views:W=[]}=i,J=(0,h.$6H)(Z),U=J.id,$=(0,h.IMx)(U),G=Z.type,Q=(0,h.$6H)(H.params)||iY,{buildStudioUrl:q}=(0,h.HuN)(),X=(0,h.QO2)(),{document:{drafts:{enabled:ee}}}=(0,h.hA9)(),{selectedReleaseId:en,selectedPerspectiveName:ei}=(0,u.useMemo)(()=>d||{selectedPerspectiveName:X.selectedPerspectiveName,selectedReleaseId:X.selectedReleaseId},[d,X.selectedPerspectiveName,X.selectedReleaseId]),el=it(),eo=(e=>{let t,n,i=(0,s.c)(13),{paneOptions:l,documentType:r,documentId:o,params:a}=e,d=(0,h.bgA)(),c=t0(),u=(0,h.$6H)(c.payload);i[0]!==r||i[1]!==l.template||i[2]!==l.templateParameters||i[3]!==u||i[4]!==a.template||i[5]!==d?(t=function(e,t){let n=t.panePayload||{},i=t.templateName;t.urlTemplate&&i&&i!==t.urlTemplate&&console.warn('Conflicting templates: URL says "'.concat(t.urlTemplate,'", structure node says "').concat(i,'". Using "').concat(i,'".'));let l=i||t.urlTemplate,r=e.filter(e=>e.schemaType===t.documentType),o={...t.templateParams,..."object"==typeof n&&n||{}},a=l;return l||1!==r.length||(a=r[0].id),{templateName:a,templateParams:o}}(d,{documentType:r,templateName:l.template,templateParams:l.templateParameters,panePayload:u,urlTemplate:a.template}),i[0]=r,i[1]=l.template,i[2]=l.templateParameters,i[3]=u,i[4]=a.template,i[5]=d,i[6]=t):t=i[6];let{templateName:p,templateParams:m}=t;i[7]!==o||i[8]!==r||i[9]!==a.version||i[10]!==p||i[11]!==m?(n={documentId:o,documentType:r,templateName:p,templateParams:m,version:a.version},i[7]=o,i[8]=r,i[9]=a.version,i[10]=p,i[11]=m,i[12]=n):n=i[12];let f=(0,h.nfZ)(n);return(0,h.$6H)(f)})({paneOptions:J,documentId:$,documentType:G,params:Q}),ea=eo.loading,{changesOpen:es,currentInspector:ed,inspectors:ec,closeInspector:eu,openInspector:ep,handleHistoryClose
1:eh,handleHistoryOpen:ef,handleInspectorAction:ex,inspectOpen:ev,handleLegacyInspectClose:eg}=function(e){let{documentId:t,documentType:n,params:i,setParams:l}=e,{features:r}=iB(),o=(0,h.For)().document.inspectors,a=(0,u.useMemo)(()=>o({documentId:t,documentType:n}),[t,n,o]),[s,d]=(0,u.useState)(()=>i.inspect||null),c=(0,u.useRef)(i.inspect);(0,u.useEffect)(()=>{c.current!==i.inspect&&(c.current=i.inspect,d(i.inspect||null))},[i.inspect]);let p=(0,u.useMemo)(()=>null==a?void 0:a.find(e=>e.name===s),[a,s]),m=(0,u.useMemo)(()=>a.find(e=>e.name===iH),[a]),f=(null==p?void 0:p.name)===iH,x=(0,u.useCallback)(e=>{let t=e&&a.find(t=>t.name===e);if(e&&!t)return void console.warn('No inspector named "'.concat(e,'"'));if(p){var n,r,o,s;if(t){let e=null!=(r=null==(n=t.onClose)?void 0:n.call(t,{params:i}))?r:{params:i};d(null),c.current=void 0,l({...e.params,inspect:void 0});return}if(p){let e=null!=(s=null==(o=p.onClose)?void 0:o.call(p,{params:i}))?s:{params:i};d(null),c.current=void 0,l({...e.params,inspect:void 0})}}},[p,a,i,l]),v=(0,u.useCallback)((e,t)=>{var n,r,o,s;let u=a.find(t=>t.name===e);if(!u)return void console.warn('No inspector named "'.concat(e,'"'));if((null==p?void 0:p.name)===u.name)return void l({...i,...t,inspect:u.name});let m=i;p&&(m=(null!=(o=null==(n=u.onClose)?void 0:n.call(u,{params:m}))?o:{params:m}).params);let h=null!=(s=null==(r=u.onOpen)?void 0:r.call(u,{params:m}))?s:{params:m};d(u.name),c.current=u.name,l({...h.params,...t,inspect:u.name})},[p,a,i,l]),g=(0,u.useCallback)(()=>{m&&x(m.name)},[x,m]),b=(0,u.useCallback)(()=>{r.reviewChanges&&m&&v(m.name,{changesInspectorTab:"review"})},[r.reviewChanges,v,m]),j="on"===i.inspect,y=(0,u.useCallback)(function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:!j;l(e?{...i,inspect:"on"}:w(i,"inspect"))},[j,i,l]),_=(0,u.useCallback)(()=>y(!1),[y]),S=(0,u.useCallback)(e=>{if("inspect"===e.action)return y(!0),!0;if("string"!=typeof e.action)return!1;let t=e.action.slice(iL.length),n=a.find(e=>e.name===t);return!!n&&(n.name===s?x(n.name):v(n.name),!0)},[x,s,a,v,y]);return{changesOpen:f,currentInspector:p,inspectors:a,closeInspector:x,openInspector:v,handleHistoryClose:g,handleHistoryOpen:b,handleInspectorAction:S,handleLegacyInspectClose:_,inspectOpen:j}}({documentId:$,documentType:G,params:Q,setParams:V}),[eb,ej]=(0,u.useState)(!1),ey=(0,u.useCallback)(e=>!!v&&!(null==e?void 0:e.draft)&&!(null==e?void 0:e.published)&&!(null==e?void 0:e.version)&&!_,[v,_]),e_=(0,u.useCallback)(e=>es?j||(null==e?void 0:e.published):(null==e?void 0:e.published)||null,[es,j]),ew=E.get(G),eS=(0,u.useCallback)(e=>{let t=ey(e);return!!Q.rev||eb||t||!(0,h.CW3)({selectedPerspective:X.selectedPerspective,isDraftModelEnabled:ee,schemaType:ew}).result},[ey,eb,ee,Q.rev,X.selectedPerspective,ew]),ek=(0,u.useCallback)(e=>b?g||{_id:e._id,_type:e._type}:e,[b,g]),{editState:eC,connectionState:eE,focusPath:eI,onChange:ez,validation:eT,ready:eP,value:eA,formState:eR,permissions:eD,onPathOpen:eM,isPermissionsLoading:eB,formStateRef:eY,onProgrammaticFocus:eL,collapsedFieldSets:eO,collapsedPaths:eH,onBlur:eV,onFocus:eN,onSetActiveFieldGroup:eZ,onSetCollapsedPath:eF,onSetCollapsedFieldSet:eK,openPath:eW}=(0,h.Lay)({documentType:G,documentId:$,initialValue:eo,comparisonValue:e_,releaseId:en,selectedPerspectiveName:ei,initialFocusPath:Q.path?(0,S.sH)(Q.path):h.Mlv,readOnly:eS,onFocusPath:o,getFormDocumentValue:ek}),eJ=(0,u.useCallback)(()=>{let e;switch(!0){case!!Q.rev:e="revision";break;case en&&(0,h.A_X)(eA._id):e="version";break;case"published"===ei:e="published";break;case B:e="draft";break;default:e="published"}return e},[Q.rev,en,eA._id,ei,B]),eU=(0,u.useMemo)(()=>eJ(),[eJ]),e$=(0,u.useMemo)(()=>({schemaType:G,documentId:$,versionType:eU,releaseId:en}),[G,$,eU,en]),eG=(0,u.useMemo)(()=>P(e$),[P,e$]),eQ=(0,u.useMemo)(()=>A({schemaType:G,documentId:$}),[A,$,G]),eq=(0,u.useMemo)(()=>D({schemaType:G,documentId:$}),[$,G,D]),eX=(0,h.$6H)(W),e0=Q.view||eX[0]&&eX[0].id||null,e1=function(e){let t,n,i,l,r,o,a=(0,s.c)(6),{resolveProductionUrl:d}=(0,h.For)().document;return a[0]===Symbol.for("react.memo_cache_sentinel")?(n=new L.t(void 0),a[0]=n):n=a[0],t=n,a[1]!==e?(i=()=>{t.next(e)},l=[t,e],a[1]=e,a[2]=i,a[3]=l):(i=a[2],l=a[3]),(0,u.useEffect)(i,l),a[4]!==d?(o=t.asObservable().pipe((0,T.F)(),(0,er.B)(500),(0,et.n)(e=>(0,h.u4i)(e)&&"string"==typeof e._id&&"string"==typeof e._type?(0,O.H)(d({document:e})):(0,I.of)(void 0)),(0,T.F)(),(0,M.W)(oP)),a[4]=d,a[5]=o):o=a[5],r=o,(0,y.J)(r)}(eA),{t:e2}=(0,h.Bdt)(r.Z7),e3=(0,u.useMemo)(()=>ew?R({documentId:$,documentType:G,schemaType:ew}):[],[$,G,R,ew]),e4=eP&&(!Q.rev||v||!!x),e5=(0,u.useMemo)(()=>ek(eA),[ek,eA]),{previousId:e6}=iM({displayed:e5,documentId:$,editState:eC}),e7=(0,u.useCallback)((e,t)=>{V({...Q,since:e,rev:t||void 0})},[Q,V]),e8=(0,u.useCallback)(()=>H.closeCurrent(),[H]),e9=(0,u.useCallback)(()=>H.duplicateCurrent(),[H]),te=(0,u.useCallback)(async e=>{if("production-preview"===e.action&&e1)return window.open(e1),!0;if("copy-document-url"===e.action&&navigator){Y.log(oT);let e=q({coreUi:e=>"".concat(e,"/intent/edit/id=").concat($,";type=").concat(G)});return await navigator.clipboard.writeText(e),N({id:"copy-document-url",status:"info",title:e2("panes.document-operation-results.operation-success_copy-url")}),!0}return"reviewChanges"===e.action?(ef(),!0):(("inspect"===e.action||"string"==typeof e.action&&e.action.startsWith(iL))&&ex(e),"compareVersions"===e.action&&"u">typeof e6&&(el.navigateDiffView({mode:"version",previousDocument:{type:G,id:e6},nextDocument:{type:G,id:eA._id}}),!0))},[e1,e6,Y,q,N,e2,$,G,ef,ex,el,eA._id]);(0,u.useEffect)(()=>{z({documentId:$,documentType:G,schemaType:ew,onChange:ez})},[$,G,ew,ez,z]);let tt=(0,u.useMemo)(()=>e_(eC),[eC,e_]),tn=(0,u.useMemo)(()=>ey(eC),[eC,ey]),ti=b&&!g,tl=(0,u.useMemo)(()=>({actions:eG,activeViewId:e0,badges:eQ,changesOpen:es,closeInspector:eu,collapsedFieldSets:eO,collapsedPaths:eH,compareValue:tt,connectionState:eE,displayed:e5,documentId:$,documentIdRaw:U,documentType:G,editState:eC,fieldActions:e3,focusPath:eI,inspector:ed||null,inspectors:ec,onBlur:eV,onChange:ez,onFocus:eN,onPathOpen:eM,onHistoryClose
1:eh,onHistoryOpen:ef,onInspectClose:eg,onMenuAction:te,onPaneClose:e8,onPaneSplit:e9,onSetActiveFieldGroup:eZ,onSetCollapsedPath:eF,onSetCollapsedFieldSet:eK,openInspector:ep,openPath:eW,index:n,inspectOpen:ev,validation:eT,menuItemGroups:F||[],paneKey:l,previewUrl:e1,ready:e4,schemaType:ew,isPermissionsLoading:eB,isInitialValueLoading:ea,permissions:eD,setTimelineRange:e7,setIsDeleting:ej,isDeleting:eb,isDeleted:tn,timelineError:x,timelineStore:f,title:K,value:eA,selectedReleaseId:en,views:eX,formState:eR,unstable_languageFilter:eq,revisionId:k,revisionNotFound:ti,lastNonDeletedRevId:C}),[eG,e0,eQ,es,eu,eO,eH,tt,eE,e5,$,U,G,eC,e3,eI,ed,ec,eV,ez,eN,eM,eh,ef,eg,te,e8,e9,eZ,eF,eK,ep,eW,n,ev,eT,F,l,e1,e4,ew,eB,ea,eD,e7,eb,tn,x,f,K,eA,en,eX,eR,eq,k,ti,C]);return(0,u.useEffect)(()=>{if(e4&&Q.path){var e;let{path:t,...n}=Q;eL((0,S.Y7)(null==(e=eY.current)?void 0:e.value,(0,S.sH)(t))),H.setParams(n)}},[eY,eL,H,Q,e4]),(0,a.jsx)(p.Fi.Provider,{value:tl,children:t})});oA.displayName="Memo(DocumentPaneProvider)";let oR=e=>{var t,n,i,l,r,o;let d,c,u,p,m,f,x,v,g=(0,s.c)(37),{params:b}=t0(),j=void 0===b?iY:b,y=oJ(e.pane.options,j),_=(0,h.pDY)(),w=y.type,S=!!(null==(t=_.get(y.type))?void 0:t.liveEdit),{selectedPerspectiveName:k,selectedReleaseId:C,selectedPerspective:E}=(0,h.QO2)(),{data:I}=(0,h.gJZ)();g[0]!==y.id?(d=(0,h.IMx)(y.id),g[0]=y.id,g[1]=d):d=g[1];let z=(0,h.zX2)(d,w,"default",C),T=S&&"drafts"===E&&!(null==z?void 0:z.draft),{rev:P,since:A}=j,R=j.historyVersion;e:{if(T){let e;g[2]!==y.id?(e=(0,h.IMx)(y.id),g[2]=y.id,g[3]=e):e=g[3],c=e;break e}if(R&&I.some(e=>(0,h._hI)(e._id)===R)){let e;g[4]!==R||g[5]!==y.id?(e=(0,h.ctg)(y.id,R),g[4]=R,g[5]=y.id,g[6]=e):e=g[6],c=e;break e}if(typeof k>"u"){let e;g[7]!==y.id?(e=(0,h.T4)(y.id),g[7]=y.id,g[8]=e):e=g[8],c=e;break e}if("published"===k){let e;g[9]!==y.id?(e=(0,h.IMx)(y.id),g[9]=y.id,g[10]=e):e=g[10],c=e;break e}if(C){let e;g[11]!==y.id||g[12]!==k?(e=(0,h.ctg)(y.id,k),g[11]=y.id,g[12]=k,g[13]=e):e=g[13],c=e;break e}c=y.id}let D=c;g[14]!==D||g[15]!==y.type||g[16]!==P||g[17]!==A?(u={documentId:D,documentType:y.type,rev:P,since:A},g[14]=D,g[15]=y.type,g[16]=P,g[17]=A,g[18]=u):u=g[18];let M=(0,h.Sjd)(u),B=M.error,Y=(null==(n=M.revision)?void 0:n.revisionId)||null,L=!!(P&&!(null==(i=M.revision)?void 0:i.loading)),O=(null==(l=M.revision)?void 0:l.document)||null,H=(null==(r=M.sinceRevision)?void 0:r.document)||null,V=!M.loading,N=0===M.events.length;return g[19]!==M.events?(m=(null==(o=M.events.find(oD))?void 0:o.id)||null,g[19]=M.events,g[20]=m):m=g[20],g[21]!==M.error||g[22]!==V||g[23]!==N||g[24]!==m||g[25]!==Y||g[26]!==L||g[27]!==O||g[28]!==H?(f={error:B,revisionId:Y,onOlderRevision:L,revisionDocument:O,sinceDocument:H,ready:V,isPristine:N,lastNonDeletedRevId:m},g[21]=M.error,g[22]=V,g[23]=N,g[24]=m,g[25]=Y,g[26]=L,g[27]=O,g[28]=H,g[29]=f):f=g[29],p=f,g[30]!==p||g[31]!==R||g[32]!==e?(x=R?(0,a.jsx)(h.g19,{selectedPerspectiveName:R,excludedPerspectives:h.Mlv,children:(0,a.jsx)(oA,{...e,historyStore:p})}):(0,a.jsx)(oA,{...e,historyStore:p}),g[30]=p,g[31]=R,g[32]=e,g[33]=x):x=g[33],g[34]!==x||g[35]!==M?(v=(0,a.jsx)(h.tGd,{value:M,children:x}),g[34]=x,g[35]=M,g[36]=v):v=g[36],v};function oD(e){return!(0,h.GDb)(e)&&!(0,h.zOx)(e)}let oM=e=>{let t,n,i,l,r,o=(0,s.c)(20),{pane:d}=e,c=t0(),p=oJ(d.options,c.params),m=c.params||iY,[f,x]=(0,u.useState)(null);o[0]!==p.id?(t=(0,h.IMx)(p.id),o[0]=p.id,o[1]=t):t=o[1],o[2]!==p.type||o[3]!==m.rev||o[4]!==m.since||o[5]!==t?(n={documentId:t,documentType:p.type,onError:x,rev:m.rev,since:m.since},o[2]=p.type,o[3]=m.rev,o[4]=m.since,o[5]=t,o[6]=n):n=o[6];let v=(0,h.Az$)(n),g=(0,h.SfM)(v,oB),b=(0,h.SfM)(v,oY),j=(0,h.SfM)(v,oL),y=(0,h.SfM)(v,oO),_=(0,h.SfM)(v,oH),w=(0,h.SfM)(v,oV),S=(0,h.SfM)(v,oN),k=(null==b?void 0:b.id)||null,C=!!w;return o[7]!==S||o[8]!==g||o[9]!==v||o[10]!==k||o[11]!==y||o[12]!==j||o[13]!==C||o[14]!==f||o[15]!==_?(l={store:v,error:f,revisionId:k,onOlderRevision:g,revisionDocument:y,sinceDocument:j,ready:_,isPristine:C,lastNonDeletedRevId:S},o[7]=S,o[8]=g,o[9]=v,o[10]=k,o[11]=y,o[12]=j,o[13]=C,o[14]=f,o[15]=_,o[16]=l):l=o[16],i=l,o[17]!==i||o[18]!==e?(r=(0,a.jsx)(oA,{...e,historyStore:i}),o[17]=i,o[18]=e,o[19]=r):r=o[19],r};function oB(e){return e.onOlderRevision}function oY(e){return e.revTime}function oL(e){return e.sinceAttributes}function oO(e){return e.timelineDisplayed}function oH(e){return e.timelineReady}function oV(e){return e.isPristine}function oN(e){return e.lastNonDeletedRevId}let oZ=(0,u.memo)(e=>{var t,n;let i,l=(0,s.c)(4);if(null==(n=(0,h.For)().beta)||null==(t=n.eventsAPI)?void 0:t.documents){let t;return l[0]!==e?(t=(0,a.jsx)(oR,{...e}),l[0]=e,l[1]=t):t=l[1],t}return l[2]!==e?(i=(0,a.jsx)(oM,{...e}),l[2]=e,l[3]=i):i=l[3],i});oZ.displayName="Memo(DocumentPaneProviderWrapper)";let oF=(0,u.memo)(function(e){let t,n,i=(0,s.c)(5),{name:l}=(0,h.For)(),r=e.pane.source||l;return i[0]!==e?(t=(0,a.jsx)(h.K1$,{children:(0,a.jsx)(oK,{...e})}),i[0]=e,i[1]=t):t=i[1],i[2]!==r||i[3]!==t?(n=(0,a.jsx)(h.NeO,{name:r,children:t}),i[2]=r,i[3]=t,i[4]=n):n=i[4],n});function oK(e){var t,n,i,l;let o,c,p,m,f,x,v,g,b,j,y,_,w,k=(0,s.c)(57),{pane:C,paneKey:E}=e,{resolveNewDocumentOptions:I}=(0,h.For)().document,{selectedPerspectiveName:z}=(0,h.QO2)(),T=t0(),P=oJ(C.options,T.params),{documentType:A,isLoaded:R}=(0,h.fRg)(P.id,P.type);!function(){let e,t,n,i,l,r=(0,s.c)(10),{params:o,setParams:a}=t0(),d=void 0===o?iY:o,{selectedPerspectiveName:c}=(0,h.QO2)(),p=(0,u.useRef)(!1);r[0]!==d||r[1]!==a?(e=e=>{["since","historyVersion","rev","preserveRev"].some(e=>d[e])&&a({...d,rev:"true"===d.preserveRev?d.rev:void 0,preserveRev:void 0,since:void 0,historyVersion:void 0})},r[0]=d,r[1]=a,r[2]=e):e=r[2];let m=(0,eb.J)(e);r[3]!==c||r[4]!==m?(t=()=>{p.current&&m(c)},r[3]=c,r[4]=m,r[5]=t):t=r[5],r[6]!==c?(n=[c],r[6]=c,r[7]=n):n=r[7],(0,u.useEffect)(t,n),r[8]===Symbol.for("react.memo_cache_sentinel")?(i=()=>(p.current=!0,()=>{p.current=!1}),l=[],r[8]=i,r[9]=l):(i=r[8],l=r[9]),(0,u.useEffect)(i,l)}();let D=function(){let e,t=(0,s.c)(1);return t[0]===Symbol.for("react.memo_cache_sentinel")?(e={pick:im,defaultComponent:oz},t[0]=e):e=t[0],(0,h.A1m)(e)}();k[0]!==P.id||k[1]!==P.type||k[2]!==I?(c=I({type:"document",documentId:P.id,schemaType:P.type}),k[0]=P.id,k[1]=P.type,k[2]=I,k[3]=c):c=k[3],o=c,k[4]!==o?(p={templateItems:o},k[4]=o,k[5]=p):p=k[5];let[M,B]=(0,h.CzS)(p),Y=R&&!B;k[6]!==A||k[7]!==Y||k[8]!==P||k[9]!==e?(f=Y&&A&&P.type!==A?(n=e,i=P,l=A,{...n,pane:{...n.pane,options:{...i,type:l}}}):e,k[6]=A,k[7]=Y,k[8]=P,k[9]=e,k[10]=f):f=k[10],m=f;let{ReferenceChildLink:L,handleEditReference:O,groupIndex:H,routerPanesState:V}=T;
1k[11]!==H||k[12]!==V?(x=(null==(t=V[H+1])?void 0:t[0].params)||{},k[11]=H,k[12]=V,k[13]=x):x=k[13];let N=x,Z=V.length,{parentRefPath:F}=N;k[14]!==H||k[15]!==F||k[16]!==Z?(g=F?{path:(0,S.sH)(F),state:H>=Z-1?"none":H>=Z-2?"selected":"pressed"}:{path:[],state:"none"},k[14]=H,k[15]=F,k[16]=Z,k[17]=g):g=k[17],v=g;let{t:K}=(0,h.Bdt)(r.Z7);if("*"===P.type&&!Y){let e,t;return k[18]!==K?(e=K("panes.document-pane.document-not-found.loading"),k[18]=K,k[19]=e):e=k[19],k[20]!==E||k[21]!==e?(t=(0,a.jsx)(iT,{flex:2.5,minWidth:320,paneKey:E,title:e}),k[20]=E,k[21]=e,k[22]=t):t=k[22],t}if(!A){let e,t,n,i,l;return k[23]!==K?(e=K("panes.document-pane.document-not-found.title"),k[23]=K,k[24]=e):e=k[24],k[25]!==P.id?(t={id:P.id},k[25]=P.id,k[26]=t):t=k[26],k[27]===Symbol.for("react.memo_cache_sentinel")?(n={Code:oW},k[27]=n):n=k[27],k[28]!==K||k[29]!==t?(i=(0,a.jsx)(d.BJ,{space:4,children:(0,a.jsx)(d.EY,{as:"p",children:(0,a.jsx)(h.HTc,{t:K,i18nKey:"panes.document-pane.document-not-found.text",values:t,components:n})})}),k[28]=K,k[29]=t,k[30]=i):i=k[30],k[31]!==E||k[32]!==i||k[33]!==e?(l=(0,a.jsx)(iE,{flex:2.5,minWidth:320,paneKey:E,title:e,children:i}),k[31]=E,k[32]=i,k[33]=e,k[34]=l):l=k[34],l}let W="".concat(A,"-").concat(P.id,"-").concat(z||"");return k[35]!==D||k[36]!==P.id||k[37]!==P.type?(b=(0,a.jsx)(D,{documentId:P.id,documentType:P.type}),k[35]=D,k[36]=P.id,k[37]=P.type,k[38]=b):b=k[38],k[39]!==P.id||k[40]!==P.type||k[41]!==b?(j=(0,a.jsx)(iA,{documentId:P.id,documentType:P.type,children:b}),k[39]=P.id,k[40]=P.type,k[41]=b,k[42]=j):j=k[42],k[43]!==P.id||k[44]!==P.type||k[45]!==j?(y=(0,a.jsx)(iC,{documentId:P.id,documentType:P.type,children:j}),k[43]=P.id,k[44]=P.type,k[45]=j,k[46]=y):y=k[46],k[47]!==L||k[48]!==v||k[49]!==O||k[50]!==y||k[51]!==M?(_=(0,a.jsx)(h.NO5,{EditReferenceLinkComponent:L,onEditReference:O,initialValueTemplateItems:M,activePath:v,children:y}),k[47]=L,k[48]=v,k[49]=O,k[50]=y,k[51]=M,k[52]=_):_=k[52],k[53]!==m||k[54]!==_||k[55]!==W?(w=(0,a.jsx)(oZ,{...m,children:_},W),k[53]=m,k[54]=_,k[55]=W,k[56]=w):w=k[56],w}function oW(e){let{children:t}=e;return(0,a.jsx)("code",{children:t})}function oJ(e,t){let n,i,l=(0,s.c)(8);l[0]!==t?(n=void 0===t?{}:t,l[0]=t,l[1]=n):n=l[1];let r=n,o=(0,h.bgA)();e:{let t,n;if(e.type&&"*"!==e.type){i=e;break e}let a=e.template||r.template;l[2]!==a||l[3]!==o?(t=a?o.find(e=>e.id===a):void 0,l[2]=a,l[3]=o,l[4]=t):t=l[4];let s=null==t?void 0:t.schemaType;if(!s){i=e;break e}l[5]!==s||l[6]!==e?(n={...e,type:s},l[5]=s,l[6]=e,l[7]=n):n=l[7],i=n}return i}let oU={by:[{field:"_updatedAt",direction:"desc"}]},o$={},oG=(0,v.I4)(d.az)(tx(),e=>e.$opacity||1),oQ=(0,v.I4)(d.az)(tv()),oq=[...Array(30).keys()];function oX(e){let t,n,i=(0,s.c)(4),{layout:l}=e;return i[0]!==l?(t=oq.map(e=>(0,a.jsx)(h.m6P,{isPlaceholder:!0,layout:l},e)),i[0]=l,i[1]=t):t=i[1],i[2]!==t?(n=(0,a.jsx)(d.BJ,{paddingX:3,paddingY:2,paddingTop:0,space:1,children:t}),i[2]=t,i[3]=n):n=i[3],n}function o0(e){let t,n,i,l,o,c,p,m=(0,s.c)(66),{childItemId:f,error:x,isRetrying:v,autoRetry:g,filterIsSimpleTypeConstraint:b,hasMaxItems:j,hasSearchQuery:y,isActive:_,isLazyLoading:w,muted:S,isLoading:k,isConnected:C,retryCount:E,canRetry:I,items:z,layout:T,loadingVariant:P,onEndReached:A,onRetry:R,paneTitle:D,searchInputElement:M,showIcons:B}=e,Y=(0,h.pDY)(),{collapsed:L}=tG(),{collapsed:O,index:H}=np(),[V,N]=(0,u.useState)(!O),{t:Z}=(0,h.Bdt)(r.Z7);m[0]!==A||m[1]!==V?(t=()=>{V&&A()},m[0]=A,m[1]=V,m[2]=t):t=m[2];let F=t;m[3]!==O?(n=()=>{if(O)return;let e=setTimeout(()=>{N(!0)},0);return()=>{clearTimeout(e)}},m[3]=O,m[4]=n):n=m[4],m[5]!==O||m[6]!==z?(i=[O,z],m[5]=O,m[6]=z,m[7]=i):i=m[7],(0,u.useEffect)(n,i),m[8]!==f||m[9]!==j||m[10]!==_||m[11]!==w||m[12]!==z.length||m[13]!==T||m[14]!==Y||m[15]!==B||m[16]!==Z?(l=(e,t)=>{let{activeIndex:n}=t,i=(0,h.IMx)(e._id),l=f===i,r=!_&&l,o=_&&l,s=n===z.length-1,c=s&&w,u=s&&j;return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(n2,{icon:!1!==B&&void 0,id:i,layout:T,marginBottom:1,pressed:r,schemaType:Y.get(e._type),selected:o,value:e}),c&&(0,a.jsx)(h.gd4,{}),u&&(0,a.jsx)(d.az,{marginY:1,paddingX:3,paddingY:4,children:(0,a.jsx)(d.EY,{align:"center",muted:!0,size:1,children:Z("panes.document-list-pane.max-items.text",{limit:2e3})})})]})},m[8]=f,m[9]=j,m[10]=_,m[11]=w,m[12]=z.length,m[13]=T,m[14]=Y,m[15]=B,m[16]=Z,m[17]=l):l=m[17];let K=l;e:{let e,t;if(y){let e,t;m[18]!==Z?(e=Z("panes.document-list-pane.no-documents.text"),m[18]=Z,m[19]=e):e=m[19],m[20]!==e?(t=(0,a.jsx)(d.so,{align:"center",direction:"column",height:"fill",justify:"center",children:(0,a.jsx)(d.mc,{width:1,children:(0,a.jsx)(d.az,{paddingX:4,paddingY:5,children:(0,a.jsx)(d.EY,{align:"center",muted:!0,children:e})})})}),m[20]=e,m[21]=t):t=m[21],o=t;break e}m[22]!==b||m[23]!==Z?(e=Z(b?"panes.document-list-pane.no-documents-of-type.text":"panes.document-list-pane.no-matching-documents.text"),m[22]=b,m[23]=Z,m[24]=e):e=m[24],m[25]!==e?
1(t=(0,a.jsx)(d.so,{align:"center",direction:"column",height:"fill",justify:"center",children:(0,a.jsx)(d.mc,{width:1,children:(0,a.jsx)(d.az,{paddingX:4,paddingY:5,children:(0,a.jsx)(d.EY,{align:"center",muted:!0,children:e})})})}),m[25]=e,m[26]=t):t=m[26],o=t}let W=o;t:{let e,t;if(!V){c=null;break t}let n=window.navigator.onLine;if(x){let e,t,i,l,r,o,s;m[27]!==Z?(e=Z("panes.document-list-pane.error.title"),m[27]=Z,m[28]=e):e=m[28],m[29]!==e?(t=(0,a.jsx)(d.DZ,{as:"h3",children:e}),m[29]=e,m[30]=t):t=m[30],m[31]!==x||m[32]!==Z?(i=h.Cu5?(0,a.jsx)(h.HTc,{t:Z,i18nKey:"panes.document-list-pane.error.text.dev",values:{error:x.message},components:{Code:o1}}):Z(n?"panes.document-list-pane.error.text":"panes.document-list-pane.error.text.offline"),m[31]=x,m[32]=Z,m[33]=i):i=m[33],m[34]!==i?(l=(0,a.jsx)(d.EY,{as:"p",children:i}),m[34]=i,m[35]=l):l=m[35];let u=n&&I?R:void 0;m[36]!==x||m[37]!==v||m[38]!==u?(r=(0,a.jsx)(h.kbS,{error:x,eventId:null,onRetry:u,isRetrying:v}),m[36]=x,m[37]=v,m[38]=u,m[39]=r):r=m[39],m[40]!==g||m[41]!==I||m[42]!==v||m[43]!==E||m[44]!==Z?(o=I?(0,a.jsx)(d.EY,{as:"p",muted:!0,size:1,children:v?Z("panes.document-list-pane.error.retrying",{count:E}):g?Z("panes.document-list-pane.error.will-retry-automatically",{count:E}):Z("panes.document-list-pane.error.max-retries-attempted",{count:E})}):null,m[40]=g,m[41]=I,m[42]=v,m[43]=E,m[44]=Z,m[45]=o):o=m[45],m[46]!==r||m[47]!==o||m[48]!==t||m[49]!==l?(s=(0,a.jsx)(d.so,{align:"center",direction:"column",height:"fill",justify:"center",children:(0,a.jsx)(d.mc,{width:1,children:(0,a.jsxs)(d.BJ,{paddingX:4,paddingY:5,space:4,children:[t,l,r,o]})})}),m[46]=r,m[47]=o,m[48]=t,m[49]=l,m[50]=s):s=m[50],c=s;break t}if(C&&!k&&0===z.length){c=W;break t}if("initial"===P&&k){let e;m[51]!==T?(e=(0,a.jsx)(no,{ms:300,children:(0,a.jsx)(oX,{layout:T})}),m[51]=T,m[52]=e):e=m[52],c=e;break t}if("spinner"===P&&k){c=null;break t}let i="".concat(H,"-").concat(O),l=S?.8:1;m[53]!==F||m[54]!==z||m[55]!==i||m[56]!==D||m[57]!==K||m[58]!==M?(e=(0,a.jsx)(oQ,{children:(0,a.jsx)(h.oIj,{activeItemDataAttr:"data-hovered",ariaLabel:D,canReceiveFocus:!0,inputElement:M,itemHeight:51,items:z,onEndReached:F,onlyShowSelectionWhenActive:!0,overscan:10,paddingBottom:1,paddingX:3,renderItem:K,wrapAround:!1},i)}),m[53]=F,m[54]=z,m[55]=i,m[56]=D,m[57]=K,m[58]=M,m[59]=e):e=m[59],m[60]!==l||m[61]!==e?(t=(0,a.jsx)(oG,{overflow:"hidden",height:"fill",$opacity:l,children:e}),m[60]=l,m[61]=e,m[62]=t):t=m[62],c=t}let J=c,U=L||"initial"===P?"hidden":"auto";return m[63]!==J||m[64]!==U?(p=(0,a.jsx)(nm,{"data-testid":"document-list-pane",overflow:U,children:J}),m[63]=J,m[64]=U,m[65]=p):p=m[65],p}function o1(e){let{children:t}=e;return(0,a.jsx)("code",{children:t})}function o2(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};try{let n=function e(t){switch(t.type){case"OpCall":{let{left:e,right:n}=t;switch(t.op){case"==":return"AccessAttribute"!==e.type||"_type"!==e.name||e.base?"AccessAttribute"!==n.type||"_type"!==n.name||n.base||"Value"!==e.type||"string"!=typeof e.value?null:new Set([e.value]):"Value"!==n.type||"string"!=typeof n.value?null:new Set([n.value]);case"in":{if("AccessAttribute"!==e.type||"_type"!==e.name||e.base||"Array"!==n.type)return null;let t=new Set;for(let e of n.elements){if(e.isSplat||"Value"!==e.value.type||"string"!=typeof e.value.value)return null;t.add(e.value.value)}return t.size?t:null}default:return null}}case"Group":return e(t.base);case"Or":{let n=e(t.left);if(!n)return null;let i=e(t.right);return i?new Set([...n,...i]):null}case"And":{let n=e(t.left),i=e(t.right);return n||i?new Set([...n||[],...i||[]]):null}default:return null}}((0,eC.qg)(e,{params:t}));return n?Array.from(n).sort():null}catch(e){return null}}let o3=(0,h.pTS)({maxSize:100});function o4(e){let{client:t,schema:n,sort:i,perspective:l,limit:o,params:a,filter:s,searchQuery:d,staticTypeNames:c,maxFieldDepth:u,searchStrategy:p}=e,m=i.by,f=null==i?void 0:i.extendedProjection,x=(0,H.v)(()=>t.listen("*[".concat(s,"]"),a,{events:["welcome","mutation","reconnect"],includeAllVersions:!0,includeResult:!1,visibility:"query",tag:"listen-search-query"})).pipe((0,V.Z)((e,t)=>{let n=0===t;return n&&"reconnect"===e.type?(0,N.$)(()=>Error("Failed to establish EventSource connection")):n&&"welcome"!==e.type?(0,N.$)(()=>Error('Received unexpected type of first event "'.concat(e.type,'"'))):(0,I.of)(e)}),(0,Z.u)()),[v,g]=(0,F.j)(x,e=>"welcome"===e.type),b=JSON.stringify({fiilter:s,limit:o,params:a,searchQuery:d,perspective:l,sort:i,staticTypeNames:c});return(0,R.h)(v,g.pipe((0,K.c)(1e3,W.E,{leading:!0,trailing:!0}
1))).pipe((0,ez.L)(e=>(c?(0,I.of)(c):t.observable.fetch("array::unique(*[".concat(s,"][]._type)"),a)).pipe((0,V.Z)(x=>{let v=(0,h._oG)(n,c||[]).filter(e=>!!x.includes(e.name)&&((0,r.Mq)(e,i.by,!0),!0)),g=(0,h.XZv)(v,t,{filter:s,params:a,strategy:p,maxDepth:u}),b=()=>g({query:d||"",types:v},{__unstable_extendedProjection:f,comments:["findability-source: ".concat(d?"list-query":"list")],limit:o,skipSortByScore:!0,sort:m,perspective:l}).pipe((0,A.T)(e=>e.hits.map(e=>{let{hit:t}=e;return t})),(0,A.T)(e=>({type:"result",documents:e})));return"mutation"===e.type&&"query"!==e.visibility?(0,C.O)(1200).pipe((0,V.Z)(b)):"reconnect"===e.type?(0,I.of)(e):b()}))),(0,eo.S)((e,t)=>({connected:"reconnect"!==t.type,documents:"result"===t.type?t.documents:(null==e?void 0:e.documents)||[]}),null),(0,P.p)(e=>null!==e),o3(b),(0,A.T)(e=>{let{fromCache:t,value:n}=e;return{fromCache:t,...n}}))}let o5={error:null,isRetrying:!1,retryCount:0,autoRetry:!1,canRetry:!1,isLoading:!0,isLoadingFullList:!1,fromCache:!1,items:[]},o6="[WARNING: This was thrown as a non-error. Only Error instances should be thrown]",o7=(0,v.i7)(tg()),o8=(0,v.i7)(tb()),o9=(0,v.I4)(m.Nl1)(tj(),o7),ae=(0,v.I4)(m.Nl1)(ty(),o7),at=(0,v.I4)(m.Nl1)(t_(),o7,o8),an=(0,u.memo)(function(e){let{childItemId:t,isActive:n,pane:i,paneKey:l,sortOrder:o,layout:s}=e,c=(0,h.pDY)(),p=(0,h.K0D)(),{perspectiveStack:x}=(0,h.QO2)(),{displayOptions:v,options:g}=i,{apiVersion:b,filter:j}=g,_=aT(g.params||o$),w=(0,u.useMemo)(()=>{let e=o2(j,_);return(null==e?void 0:e.length)===1?e[0]:null},[j,_]),E=(null==v?void 0:v.showIcons)!==!1,{t:z}=(0,h.Bdt)(r.Z7),{title:T}=(0,h.FP1)(i),[D,M]=(0,u.useState)(""),[Y,L]=(0,u.useState)(""),[O,H]=(0,u.useState)(null),N=w&&o?function(e,t){let n=e.by.map(e=>{if(e.mapWith)return e;let n=function(e,t){let n=S.sH(t),i=e;for(let e of n){if(!i)return;if("string"==typeof e){i=function(e,t){if(!("fields"in e))return;let n=e.fields.find(e=>e.name===t);return n?n.type:void 0}(i,e);continue}if(!((0,f.tA)(e)||(0,f.wr)(e))||"array"!==i.jsonType)return;let[t,n]=i.of||[];if(n||!t)return;if(!(0,f.do)(t)){i=t;continue}let[l,r]=t.to||[];if(r||!l)return;i=l}return i}(t,e.field);return n?!function(e,t){let n=e.type;for(;n;){if(n.name===t||!n.type&&n.jsonType===t)return!0;n=n.type}return!1}(n,"datetime")?"string"===n.jsonType?{...e,mapWith:"lower"}:e:{...e,mapWith:"dateTime"}:e});return n.every((t,n)=>t===e.by[n])?e:{...e,by:n}}(o,c.get(w)):o,F=(0,h.$6H)(N),{error:K,isLoadingFullList:W,isLoading:G,items:Q,fromCache:q,isRetrying:X,autoRetry:ee,canRetry:ei,retryCount:el,connected:er,onLoadFullList:ec,onRetry:eu}=function(e){let{filter:t,params:n,sortOrder:i,searchQuery:l,perspective:r,apiVersion:o}=e,a=(0,h.tH7)({...h.miu,apiVersion:o||h.miu.apiVersion}),{strategy:s}=(0,h.hA9)().search,d=(0,h.pDY)(),c=(0,h.xx_)(),p=(0,u.useMemo)(()=>o2(t,n),[t,n]),[[m,f]]=(0,u.useState)(()=>(0,eI.t)()),[[x,v]]=(0,u.useState)(()=>(0,eI.t)()),g=(0,u.useMemo)(()=>{let e={client:a,filter:t,limit:100,params:n,schema:d,perspective:r,searchQuery:l||"",sort:i||oU,staticTypeNames:p,maxFieldDepth:c,searchStrategy:s},o=o4(e).pipe((0,en.t)({refCount:!0,bufferSize:1})),u=x.pipe((0,ea.E)(o),(0,P.p)(e=>{let[,t]=e;return(null==t?void 0:t.documents.length)===100}),(0,es.s)(1),(0,V.Z)(()=>(0,B.x)((0,I.of)({type:"loadFullList"}),o4({...e,limit:2e3}).pipe((0,A.T)(e=>({type:"result",result:e}))))),(0,Z.u)());return(0,R.h)(o.pipe((0,A.T)(e=>({type:"result",result:e})),(0,ed.Q)(u)),u).pipe((0,h.TMz)((e,t,n)=>{var i,l;let r=(l=e)instanceof Error?l:"object"==typeof l&&null!==l&&"message"in l&&"string"==typeof l.message?Error("".concat(l.message," ").concat(o6)):Error("".concat(String(l)," ").concat(o6)),o=window.navigator.onLine,a=o&&!((i=e)instanceof eE.Q6)&&(i instanceof eE.gP||!(i instanceof eE.MZ)||403===i.statusCode),s=t<10,d=(0,R.h)(o?m:(0,k.R)(window,"online"),o&&s?(0,C.O)(1e3*t):J.t).pipe((0,es.s)(1),(0,et.n)(()=>(0,R.h)((0,I.of)({type:"error",error:r,retrying:!0,autoRetry:s,canRetry:a,retryCount:t}),n)));return(0,B.x)((0,I.of)({type:"error",error:r,retrying:!1,autoRetry:s,canRetry:a,retryCount:t}),d)}),(0,eo.S)((e,t)=>{if("error"===t.type)return{...e,error:t.error,retryCount:t.retryCount,isRetrying:t.retrying,autoRetry:t.autoRetry,canRetry:t.canRetry};if("result"===t.type){var n;return{...e,error:null,isRetrying:!1,fromCache:t.result.fromCache,connected:t.result.connected,isLoading:!1,items:(n=t.result.documents,(0,h.Zck)(n).map(e=>{let t=e.draft||e.published||e.versions[0],n=!!e.draft;return{...t,hasPublished:!!e.published,hasDraft:n}})),isLoadingFullList:!1}}if("loadFullList"===t.type)return{...e,error:null,isLoadingFullList:!0};throw Error("Unexpected event type: ".concat(t.type))},o5))},[a,t,n,d,r,l,i,p,c,s,x,m]),{error:b,items:j,isLoading:_,fromCache:w,connected:S,canRetry:E,isLoadingFullList:z,isRetrying:T,autoRetry:D,retryCount:M}=(0,y.J)(g,o5);return{error:b,onRetry:f,isLoading:_,items:j,isRetrying:T,canRetry:E,retryCount:M,autoRetry:D,connected:S,fromCache:w,onLoadFullList:v,isLoadingFullList:z}}({apiVersion:b,filter:j,perspective:x,params:_,searchQuery:null==D?void 0:D.trim(),sortOrder:F}),ep=G||p.loading,em=(0,y.N)(e=>e.pipe((0,A.T)(e=>
1e.target.value),(0,U.M)(L),(0,$.s)(e=>""===e?(0,I.of)(""):(0,C.O)(300)),(0,U.M)(M))),eh=(0,u.useCallback)(()=>{M(""),L("")},[]),ef=(0,u.useCallback)(e=>{"Escape"===e.key&&eh()},[eh]),[ex,ev]=(0,u.useState)();(0,u.useEffect)(()=>{ex||ep||ev(l)},[ex,ep,l]),(0,u.useEffect)(()=>{eh(),ev()},[l,eh]);let eg=(0,u.useMemo)(()=>er&&ep&&ex===l?"spinner":er&&q?"subtle":"initial",[er,ex,q,ep,l]),eb=(0,u.useMemo)(()=>"spinner"===eg?o9:Y&&"subtle"===eg?ae:m.WIv,[eg,Y]);return(0,h.mnZ)(!er),(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(d.az,{paddingX:3,paddingBottom:3,children:(0,a.jsx)(d.ks,{"aria-label":z("panes.document-list-pane.search-input.aria-label"),autoComplete:"off",border:!1,clearButton:!!D,fontSize:[2,2,1],icon:eb,iconRight:er&&("subtle"!==eg||Y)?null:at,onChange:em,onClear:eh,onKeyDown:ef,padding:2,placeholder:z("panes.document-list-pane.search-input.placeholder"),radius:2,ref:H,spellCheck:!1,value:Y})}),(0,a.jsx)(o0,{childItemId:t,error:K,filterIsSimpleTypeConstraint:!!w,hasMaxItems:2e3===Q.length,hasSearchQuery:!!D,isActive:n,isLazyLoading:W,isLoading:ep,autoRetry:ee,canRetry:ei,retryCount:el,isRetrying:X,isConnected:er,items:Q,layout:s,muted:"subtle"===eg,loadingVariant:eg,onEndReached:ec,onRetry:eu,paneTitle:T,searchInputElement:O,showIcons:E},l)]})}),ai=(0,u.memo)(e=>{let t,n,i,l,r,d,c,u,p,h,f=(0,s.c)(27),{contentAfter:x,index:v,initialValueTemplates:g,menuItemGroups:b,menuItems:j,setLayout:y,setSortOrder:_,title:w}=e;f[0]!==g?(t=void 0===g?[]:g,f[0]=g,f[1]=t):t=f[1];let S=t;f[2]!==b?(n=void 0===b?[]:b,f[2]=b,f[3]=n):n=f[3];let k=n;f[4]!==j?(i=void 0===j?[]:j,f[4]=j,f[5]=i):i=f[5];let C=i,{features:E}=iB(),{collapsed:I,isLast:z}=np(),T=z&&!I?-1:0;return f[6]!==y?(r=e=>{let{layout:t}=e;y(t)},f[6]=y,f[7]=r):r=f[7],f[8]!==_?(d=e=>{_(e)},f[8]=_,f[9]=d):d=f[9],f[10]!==r||f[11]!==d?(c={setLayout:r,setSortOrder:d},f[10]=r,f[11]=d,f[12]=c):c=f[12],l=c,f[13]!==l||f[14]!==S||f[15]!==k||f[16]!==C?(u=(0,a.jsx)(nq,{initialValueTemplateItems:S,actionHandlers:l,menuItemGroups:k,menuItems:C}),f[13]=l,f[14]=S,f[15]=k,f[16]=C,f[17]=u):u=f[17],f[18]!==E.backButton||f[19]!==v?(p=E.backButton&&v>0&&(0,a.jsx)(o.$n,{as:t$,"data-as":"a",icon:m.A60,mode:"bleed",tooltipProps:{content:"Back"}}),f[18]=E.backButton,f[19]=v,f[20]=p):p=f[20],f[21]!==x||f[22]!==u||f[23]!==p||f[24]!==T||f[25]!==w?(h=(0,a.jsx)(o.vE,{children:(0,a.jsx)(nP,{actions:u,backButton:p,contentAfter:x,tabIndex:T,title:w})}),f[21]=x,f[22]=u,f[23]=p,f[24]=T,f[25]=w,f[26]=h):h=f[26],h});function al(e){let{row:t,table:n}=e,{selectedAnchor:i,setSelectedAnchor:l}=n.options.meta||{},r=(0,u.useCallback)(e=>{if(e.shiftKey&&null!=i){let e=t.index,l=e<i?e:i,r=e<i?i:e,o=n.getRowModel().flatRows.slice(l,r+1).map(e=>{let{id:t}=e;return t}),a=n.getSelectedRowModel().rows.map(e=>{let{id:t}=e;return t});n.setRowSelection(()=>[...o,...a].reduce((e,t)=>({...e,[t]:!0}),{}))}else l&&(l(t.getIsSelected()?null:t.index),t.toggleSelected())},[i,t,l,n]);return(0,a.jsx)(d.Sc,{style:{paddingLeft:4},checked:e.row.getIsSelected(),disabled:!e.row.getCanSelect(),onChange:()=>null,onClick:r})}function ar(e){let{children:t,table:n}=e,[i,l]=(0,u.useState)(null),[r,o]=(0,u.useState)([]),s=(0,u.useCallback)(function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;(null==i?void 0:i.state)==="focused"&&document.activeElement instanceof HTMLElement&&document.activeElement.blur(),l(e),o([])},[i]),d=(0,u.useCallback)(()=>s(),[s]),c=(0,u.useCallback)(e=>{if(!i)return;let t=n.getVisibleLeafColumns(),l=t.findIndex(e=>e.id===i.colId)+("left"===e?-1:1);l<0||l>=t.length||s({colId:t[l].id,rowIndex:i.rowIndex,state:"selected"})},[s,i,n]),m=(0,u.useCallback)(e=>{i&&o(t=>{let{rowIndex:n}=i,l=t=>t+("down"===e?1:-1);if(!t.length){let e=l(n);return e<0?[]:[e]}let r=l(t[t.length-1]);return r<0?t:r===n?[]:t.includes(r)?t.slice(0,-1):[...t,r]})},[i]),h=(0,u.useCallback)((e,t)=>{s({colId:e,rowIndex:t,state:"selected"})},[s]),f=(0,u.useCallback)(()=>{i&&(r.length?o([]):s("selected"===i.state?null:{...i,state:"selected"}))},[s,i,r.length]),x=(0,u.useCallback)((e,t)=>{if(!i)return;let n="ArrowDown"===t?"down":"up",l="down"===n?1:-1;if(e)m(n);else{let e=i.rowIndex+l;if(e<0)return;h(i.colId,e)}},[m,i,h]),v=(0,u.useCallback)(e=>{if(!i)return;let{key:t,shiftKey:n}=e;switch(t){case"Shift":break;case"Escape":f();break;case"ArrowDown":case"ArrowUp":e.preventDefault(),x(n,t);break;case"ArrowLeft":case"ArrowRight":"selected"===i.state&&(e.preventDefault(),c("ArrowLeft"===t?"left":"right"))}},[i,f,x,c]),g=(0,u.useCallback)(e=>{var t;i&&((null==(t=document.getElementById("cell-".concat(i.colId,"-").concat(i.rowIndex)))?void 0:t.contains(e.target))||d())},[d,i]);(0,u.useEffect)(()=>(i&&(document.addEventListener("keydown",v),document.addEventListener("click",g)),()=>{i&&(document.removeEventListener("keydown",v),document.removeEventListener("click",g))}),[g,v,i]);let b=(0,u.useCallback)(()=>l(e=>e?{...e,state:"focused"}:null),[]),j=(0,u.useCallback)((e,t)=>(null==i?void 0:i.colId)!==e?null:i.rowIndex===t?"focused"===i.state?"focused":"selectedAnchor":r.includes(t)?"selectedRange":null,[i,r]),y=(0,u.useCallback)(()=>{i&&s({colId:i.colId,rowIndex:i.rowIndex+1,state:"selected"})},[s,i]),_=(0,u.useMemo)(()=>
1({focusAnchorCell:b,resetFocusSelection:d,setSelectedAnchorCell:h,getStateByCellId:j,submitFocusedCell:y}),[b,d,h,j,y]);return(0,a.jsx)(p.YW.Provider,{value:_,children:t})}ai.displayName="Memo(PaneHeader)";let ao=v.I4.td(tw(),e=>{let{width:t}=e;return t}),aa=(0,v.I4)(ao)(tS());function as(e){let{getValue:t,column:n,row:i,fieldType:l}=e,r="cell-".concat(n.id,"-").concat(i.index),[o,s]=(0,u.useState)(t()),[c,m]=(0,u.useState)(!1),h=(0,u.useRef)(null),{focusAnchorCell:f,resetFocusSelection:x,setSelectedAnchorCell:v,getStateByCellId:g,submitFocusedCell:b}=(()=>{let e=(0,u.useContext)(p.YW);if(void 0===e)throw Error("useDocumentSheetListContext must be used within an DocumentSheetListProvider");return e})(),j=g(n.id,i.index),y=(0,u.useCallback)(()=>{v(n.id,i.index),f()},[n.id,f,i.index,v]),{patchDocument:_}=e.table.options.meta||{},w=()=>{var e;null==(e=h.current)||e.focus(),h.current instanceof HTMLInputElement&&h.current.select()},S=(0,u.useCallback)(e=>{let{key:t}=e;"Enter"===t&&("selectedAnchor"===j&&w(),"focused"===j&&b())},[j,b]),k=(0,u.useCallback)(e=>{var t;let l=null==(t=e.clipboardData)?void 0:t.getData("Text");("string"==typeof l||"number"==typeof l)&&(s(l),null==_||_(i.id,n.id,l))},[n.id,_,i.id]),C=(0,u.useCallback)(()=>{navigator.clipboard.writeText(o.toString())},[o]);(0,u.useEffect)(()=>(("selectedAnchor"===j||"focused"===j)&&document.addEventListener("keydown",S),("selectedAnchor"===j||"selectedRange"===j)&&document.addEventListener("paste",k),"selectedAnchor"===j&&document.addEventListener("copy",C),()=>{("selectedAnchor"===j||"focused"===j)&&document.removeEventListener("keydown",S),("selectedAnchor"===j||"selectedRange"===j)&&document.removeEventListener("paste",k),"selectedAnchor"===j&&document.removeEventListener("copy",C)}),[r,j,n.id,g,C,S,k,i.index]);let E=()=>"focused"===j?"2px solid blue":"selectedRange"===j?"1px solid green":"selectedAnchor"===j?"1px solid blue":"1px solid transparent",I={onFocus:y,onBlur:()=>{c&&(null==_||_(i.id,n.id,o),m(!1)),x()},onMouseDown:e=>{2===e.detail?w():(e.preventDefault(),v(n.id,i.index))},"aria-selected":!!j,"data-testid":r,id:r,ref:e=>{h.current=e}};return"boolean"===l.name?(0,a.jsxs)(d.l6,{...I,onChange:()=>null,radius:0,style:{boxShadow:"none",border:E(),padding:0},value:JSON.stringify(o),children:[(0,a.jsx)("option",{value:"True",children:"True"}),(0,a.jsx)("option",{value:"False",children:"False"})]}):(0,a.jsx)(d.ks,{...I,size:0,radius:0,border:!1,style:{border:E(),padding:"22px 16px"},value:"string"==typeof o||"number"==typeof o?o:JSON.stringify(o),onChange:e=>{m(!0),s(e.target.value)}})}function ad(e){var t,n;let i=e.column.getIsPinned(),l=i&&e.column.getIsLastColumn("left")?2:1;return(0,a.jsx)(i?aa:ao,{style:{left:null!=(n=e.column.getStart("left"))?n:void 0,borderRight:"".concat(l,"px solid var(--card-border-color)")},width:e.column.getSize(),children:(0,eT.Kv)(e.column.columnDef.cell,null==(t=e.getContext)?void 0:t.call(e))},e.row.original._id+e.id)}let ac=e=>{var t;let{documentPreviewStore:n,row:i,schemaType:l}=e,r=(0,u.useMemo)(()=>(0,h.TU6)(n,l,i.original._id),[n,i.original._id,l]),o=(0,h.r0j)(i.original._id),{snapshot:s,isLoading:c}=(0,y.J)(r,{snapshot:null,isLoading:!0});if(c)return(0,a.jsx)(d.EY,{size:1,muted:!0,children:"Loading..."});let p=null!=(t=null==s?void 0:s.title)?t:"Untitled";return(0,a.jsxs)(d.so,{align:"center",gap:3,children:[(0,a.jsx)(h.ZDR,{draft:o.draft,published:o.published,versions:void 0}),(0,a.jsx)(d.EY,{size:1,children:p})]})},au=(0,eP.FB)(),ap=["string","number","boolean"],am=(e,t)=>e.fields.reduce((e,n)=>{let{type:i,name:l}=n;return ap.includes(i.name)?[...e,au.accessor(t?"".concat(t,".").concat(n.name):n.name,{id:t?"".concat(t,"_").concat(n.name):n.name,header:n.type.title,enableHiding:!0,cell:e=>(0,a.jsx)(as,{...e,fieldType:i})})]:"object"===i.name&&(0,f.$d)(i)&&!t?[...e,au.group({header:l,columns:am(i,n.name)})]:e},[]),ah=e=>e.flatMap(e=>"accessorKey"in e?e:"columns"in e&&e.columns?ah(e.columns):[]);function af(e){let{table:t}=e,{t:n}=(0,h.Bdt)(),i=t.getVisibleLeafColumns().filter(e=>e.getCanHide()).length>=5,l=(0,u.useCallback)(()=>{t.resetColumnVisibility()},[t]);return(0,a.jsx)(o.IU,{button:(0,a.jsx)(o.$n,{mode:"bleed",text:n("sheet-list.edit-columns")}),id:"columns-control",menu:(0,a.jsx)(d.W1,{padding:3,paddingTop:4,style:{width:240},children:(0,a.jsxs)(d.so,{direction:"column",height:"fill",gap:3,children:[(0,a.jsx)(d.EY,{weight:"semibold",size:1,children:n("sheet-list.select-fields")}),(0,a.jsx)(d.so,{style:{flex:"1 1 auto",maxHeight:320,overflowY:"scroll"},children:(0,a.jsx)(d.BJ,{children:t.getAllLeafColumns().filter(e=>e.getCanHide()).map(e=>{var n;return(0,a.jsxs)(d.so,{marginY:2,align:"center",children:[(0,a.jsx)(d.Sc,{readOnly:(e=>{let n=e.getIsVisible(),l=1===t.getVisibleLeafColumns().filter(e=>e.getCanHide()).length;return i&&!n||l&&n})(e),checked:e.getIsVisible(),onChange:()=>{e.toggleVisibility()},id:"col-visibility-".concat(e.id),style:{display:"block"}}),(0,a.jsx)(d.az,{flex:1,paddingLeft:3,children:(0,a.jsx)(d.EY,{size:1,children:(0,a.jsx)("label",{htmlFor:"col-visibility-".concat(e.id),children:null==(n=e.columnDef.header)?void 0:n.toString()})})})]},e.id)})})}),(0,a.jsx)(o.$n,{width:"fill",mode:"ghost",text:n("sheet-list.reset-columns"),onClick:l})]})}),placement:"bottom",popover:{portal:!0}})}let ax=(0,v.I4)(d.so)(tk());function av(){let e,t,n,i=(0,s.c)(5),{state:l}=(0,h.Z_W)(),{filtersVisible:r}=l;return i[0]===Symbol.for("react.memo_cache_sentinel")?(e=(0,a.jsx)(h.w1_,{}),i[0]=e):e=i[0],i[1]!==r?(t=r&&(0,a.jsx)(h.CuW,{showTypeFilter:!1}),i[1]=r,i[2]=t):t=i[2],i[3]!==t?(n=(0,a.jsxs)(ax,{children:[e,t]}),i[3]=t,i[4]=n):n=i[4],n}let ag=v.I4.th(tC(),e=>{let{width:t}=e;return t},e=>{let{width:t}=e;return t}),ab=(0,v.I4)(ag)(tE()),aj=v.I4.div(tI(),ag);function ay(e){var t;let{header:n,headerGroup:i}=e,{t:l}=(0,h.Bdt)(),r=n.column.getIsPinned(),s=i.depth>0&&!n.column.parent?null:(0,a.jsx)(d.EY,{size:1,weight:"semibold",textOverflow:"ellipsis",children:(0,eT.Kv)(n.column.columnDef.header,n.getContext())}),c=r?ab:ag,u=n.column.getCanHide()&&(0===i.depth?!n.column.columns.length:n.column.parent),p=r&&n.column.getIsLastColumn("left")?2:1;return(0,a.jsx)(c,{style:{left:null!=(t=n.column.getStart("left"))?t:void 0,borderRight:"".concat(p,"px s
1olid var(--card-border-color)")},"data-testid":"header-".concat(n.id),width:n.getSize(),children:(0,a.jsxs)(d.so,{justify:"space-between",marginX:2,align:"baseline",children:[(0,a.jsx)(o.m_,{delay:500,content:s,children:(0,a.jsx)(d.az,{style:{boxSizing:"border-box"},marginLeft:3,marginRight:3,children:s})}),u&&(0,a.jsx)(aj,{children:(0,a.jsx)(o.IU,{button:(0,a.jsx)(o.$n,{tooltipProps:{content:"Open field menu"},mode:"bleed",icon:m.riS,"data-testid":"field-menu-button"}),id:"field menu",popover:{placement:"bottom-end"},menu:(0,a.jsx)(d.W1,{children:(0,a.jsx)(o.Dr,{text:l("sheet-list.hide-field"),icon:m.USm,onClick:()=>n.column.toggleVisibility()})})})})]})},n.id)}function a_(e){let{table:t}=e;return(0,a.jsx)(o.vE,{children:(0,a.jsxs)(d.so,{gap:3,align:"center",children:[(0,a.jsx)(o.$n,{onClick:()=>t.setPageIndex(0),disabled:!t.getCanPreviousPage(),icon:m.Zxx,tooltipProps:{content:"Go to first page"}}),(0,a.jsx)(o.$n,{onClick:()=>t.previousPage(),disabled:!t.getCanPreviousPage(),icon:m.YJP,tooltipProps:{content:"Go to previous page"}}),(0,a.jsxs)(d.EY,{style:{whiteSpace:"nowrap"},children:[t.getState().pagination.pageIndex+1," of ",t.getPageCount()]}),(0,a.jsx)(o.$n,{onClick:()=>t.nextPage(),disabled:!t.getCanNextPage(),icon:m.vKP,tooltipProps:{content:"Go to next page"}}),(0,a.jsx)(o.$n,{onClick:()=>t.setPageIndex(t.getPageCount()-1),disabled:!t.getCanNextPage(),icon:m.yBO,tooltipProps:{content:"Go to last page"}}),(0,a.jsx)("select",{value:t.getState().pagination.pageSize,onChange:e=>{t.setPageSize(Number(e.target.value))},children:[25,50,100].map(e=>(0,a.jsx)("option",{value:e,children:e},e))})]})})}function aw(e,t){switch(t.type){case"DOCUMENTS_SET":{let n=t.documents.reduce((e,t)=>({...e,[t._id]:t}),{});return{...e,documents:n}}case"DOCUMENT_RECEIVED":{let n=t.payload;return{...e,documents:{...e.documents,[n._id]:n}}}case"DOCUMENT_DELETED":{let{[t.id]:n,...i}=e.documents;return{...e,documents:i}}case"DOCUMENT_UPDATED":{let n=t.payload,i=n._id,l={...e.documents[i],...n};return{...e,documents:{...e.documents,[i]:l}}}default:return e}}let aS={events:["welcome","mutation","reconnect"],includeResult:!0,visibility:"query",includeAllVersions:!0,tag:"document-sheet-list-store"},ak=(0,v.I4)(d.so)(tz()),aC=v.I4.div(tT()),aE=v.I4.table(tP());function aI(e){let{documentSchemaType:t}=e,{dispatch:n,state:i}=(0,h.Z_W)(),{columns:l,initialColumnsVisibility:r}=function(e){let t=(0,h.yKO)(),n=(0,u.useMemo)(()=>e?[au.display({id:"selected",enableHiding:!1,header:e=>(0,a.jsxs)(d.az,{children:[(0,a.jsx)(d.Sc,{style:{paddingLeft:4},indeterminate:e.table.getIsSomeRowsSelected(),onChange:e.table.getToggleAllPageRowsSelectedHandler()}),e.table.getSelectedRowModel().rows.length," selected"]}),cell:al}),au.accessor("Preview",{enableHiding:!1,id:"Preview",cell:n=>(0,a.jsx)(ac,{...n,documentPreviewStore:t,schemaType:e})}),...am(e)]:[],[t,e]),[i]=(0,u.useMemo)(()=>ah(n).reduce((e,t)=>{let[n,i]=e;if(!t.id)throw Error("Column must have an id");let l=t.id;return t.enableHiding?5===i?[{...n,[l]:!1},i]:[{...n,[l]:!0},i+1]:[{...n,[l]:!0},i]},[{},0]),[n]);return{columns:n,initialColumnsVisibility:i}}(t),{data:o}=function(e){let t,n,i,l,r,o,a=(0,s.c)(12),{typeName:d}=e,{state:c}=(0,h.Z_W)();a[0]!==c.result.hits?(n=new Map,c.result.hits.forEach(e=>n.set((0,h.IMx)(e.hit._id),e.hit)),a[0]=c.result.hits,a[1]=n):n=a[1],t=n;let p='_type == "'.concat(d,'"');a[2]!==p?(i={filter:p},a[2]=p,a[3]=i):i=a[3];let{data:m,isLoading:f}=function(e){let t,n,i,l,r,o,a,d,c,p,m=(0,s.c)(25),{filter:f,params:x,apiVersion:v}=e,g="*[".concat(f,"][0...2000]"),b=v||h.miu.apiVersion;m[0]!==b?(t={...h.miu,apiVersion:b},m[0]=b,m[1]=t):t=m[1];let j=(0,h.tH7)(t);m[2]===Symbol.for("react.memo_cache_sentinel")?(n={documents:{}},m[2]=n):n=m[2];let[y,_]=(0,u.useReducer)(aw,n),[w,S]=(0,u.useState)(null!==j),[k,C]=(0,u.useState)(null);m[3]!==g||m[4]!==j||m[5]!==x?(i=async()=>{if(!j)return void S(!1);try{let e=await j.fetch(g,x);_({type:"DOCUMENTS_SET",documents:e}),S(!1)}catch(e){C(e)}},m[3]=g,m[4]=j,m[5]=x,m[6]=i):i=m[6];let E=i;m[7]!==E?(l=async e=>{if("welcome"===e.type&&(S(!0),await E(),S(!1)),"reconnect"===e.type&&S(!0),"mutation"===e.type){if("appear"===e.transition){let t=e.result;t&&_({type:"DOCUMENT_RECEIVED",payload:t})}if("disappear"===e.transition&&_({type:"DOCUMENT_DELETED",id:e.documentId}),"update"===e.transition){let t=e.result;t&&_({type:"DOCUMENT_UPDATED",payload:t})}}},m[7]=E,m[8]=l):l=m[8];let z=l;e:{let e;if(!j){let e;m[9]===Symbol.for("react.memo_cache_sentinel")?(e=(0,I.of)(),m[9]=e):e=m[9],r=e;break e}if(m[10]!==g||m[11]!==j.observable||m[12]!==x){let t;m[14]===Symbol.for("react.memo_cache_sentinel")?(t=e=>(C(e),(0,I.of)(e)),m[14]=t):t=m[14],e=j.observable.listen(g,x,aS).pipe((0,M.W)(t)),m[10
1]=g,m[11]=j.observable,m[12]=x,m[13]=e}else e=m[13];r=e}let T=r;return m[15]!==z||m[16]!==T?(o=()=>{let e=T.subscribe(z);return()=>{null==e||e.unsubscribe()}},a=[z,T],m[15]=z,m[16]=T,m[17]=o,m[18]=a):(o=m[17],a=m[18]),(0,u.useEffect)(o,a),m[19]!==y.documents?(c=Object.values(Object.keys(y.documents).reduce((e,t)=>{let n=y.documents[t],i=n._id===(0,h.T4)(n._id),l=i?n._id:(0,h.T4)(n._id);return e[l]&&!i||(e[l]=n),e},{})),m[19]=y.documents,m[20]=c):c=m[20],d=c,m[21]!==d||m[22]!==k||m[23]!==w?(p={data:d,isLoading:w,error:k},m[21]=d,m[22]=k,m[23]=w,m[24]=p):p=m[24],p}(i);if(a[4]!==m||a[5]!==t){let e;a[7]!==t?(e=e=>t.has((0,h.IMx)(e._id)),a[7]=t,a[8]=e):e=a[8],r=m.filter(e),a[4]=m,a[5]=t,a[6]=r}else r=a[6];return l=r,a[9]!==l||a[10]!==f?(o={data:l,isLoading:f},a[9]=l,a[10]=f,a[11]=o):o=a[11],o}({typeName:t.name}),[c,p]=(0,u.useState)(null),m=i.result.hits.length,f=(0,eT.N4)({data:o,columns:l,getCoreRowModel:(0,eP.HT)(),getFilteredRowModel:(0,eP.hM)(),getPaginationRowModel:(0,eP.kW)(),autoResetPageIndex:!1,initialState:{columnPinning:{left:["selected","Preview"]},pagination:{pageSize:25},columnVisibility:r},getRowId:e=>e._id,meta:{selectedAnchor:c,setSelectedAnchor:p,patchDocument:(e,t,n)=>null}}),{rows:x}=f.getRowModel();(0,u.useEffect)(()=>(n({type:"TERMS_TYPE_ADD",schemaType:t}),()=>{n({type:"TERMS_TYPE_REMOVE",schemaType:t})}),[t,n]);let v=(0,u.useCallback)(e=>(0,a.jsx)(d.az,{as:"tr",paddingY:2,style:{display:"flex",width:"100%"},children:e.getVisibleCells().map(t=>(0,u.createElement)(ad,{...t,key:e.original._id+t.id}))},e.original._id+e.id),[]),g="Total: ".concat(m," rows, showing ").concat(x.length," rows");return(0,a.jsxs)(ak,{direction:"column",paddingX:3,"data-testid":"document-sheet-list-pane",children:[(0,a.jsxs)(d.so,{direction:"row",align:"center",paddingY:3,paddingX:1,justify:"space-between",children:[(0,a.jsxs)(d.so,{direction:"row",align:"center",children:[(0,a.jsx)(av,{}),(0,a.jsx)(d.EY,{size:0,muted:!0,children:g})]}),(0,a.jsx)(af,{table:f})]}),(0,a.jsx)(aC,{children:(0,a.jsx)(ar,{table:f,children:(0,a.jsxs)(aE,{children:[(0,a.jsx)("thead",{children:f.getHeaderGroups().map(e=>(0,a.jsx)(d.az,{as:"tr",children:e.headers.map(t=>(0,a.jsx)(ay,{header:t,headerGroup:e},t.id))},e.id))}),(0,a.jsx)("tbody",{children:f.getRowModel().rows.map(v)})]})})}),(0,a.jsx)(d.so,{justify:"flex-end",padding:3,gap:4,paddingY:5,children:(0,a.jsx)(a_,{table:f})})]})}function az(e){let t=(0,h.pDY)(),n=e.pane.schemaTypeName,i=t.get(n);if(!i||!(0,f.JR)(i))throw Error('Schema type "'.concat(n,'" not found or not a document schema'));return(0,a.jsx)(h.YLU,{children:(0,a.jsx)(aI,{...e,documentSchemaType:i})})}function aT(e){let[t,n]=(0,u.useState)(e);return e_(t,e)?t:(n(e),e)}let aP=(0,u.memo)(function(e){let t,n,i,l,r,o,d,c,p,m,f,x=(0,s.c)(36),{index:v,isSelected:g,pane:b,paneKey:j}=e,{name:y}=(0,h.For)(),{defaultLayout:_,initialValueTemplates:w,menuItemGroups:S,menuItems:k,options:C}=b,E=void 0===w?h.Mlv:w,{defaultOrdering:I,filter:z}=C,T=void 0===I?h.Mlv:I,P=aT(C.params||o$),A=b.source;e:{let e;x[0]!==z||x[1]!==P?(e=o2(z,P),x[0]=z,x[1]=P,x[2]=e):e=x[2];let n=e;if((null==n?void 0:n.length)===1){t=n[0];break e}t=null}let R=t,[D,M]=iU("layout",null!=R?R:b.id,void 0===_?"default":_),{title:B}=(0,h.FP1)(b);x[3]!==T?(i=(null==T?void 0:T.length)>0?{by:T}:oU,x[3]=T,x[4]=i):i=x[4],n=i;let[Y,L]=iU("sort-order",null!=R?R:b.id,n);x[5]!==D||x[6]!==k||x[7]!==Y?(r=(e=>{let{menuItems:t,sortOrderRaw:n,layout:i}=e;return null==t?void 0:t.map(e=>{var t,l,r,o;return(null==(t=e.params)?void 0:t.layout)?{...e,selected:i===(null==(l=e.params)?void 0:l.layout)}:(null==e||null==(r=e.params)?void 0:r.by)?{...e,selected:ey(null==n?void 0:n.by,(null==e||null==(o=e.params)?void 0:o.by)||h.Mlv)}:{...e,selected:!1}})})({menuItems:k,sortOrderRaw:Y,layout:D}),x[5]=D,x[6]=k,x[7]=Y,x[8]=r):r=x[8],l=r;let O="sheetList"===D;x[9]!==O||x[10]!==D||x[11]!==e||x[12]!==Y?(o=O?(0,u.createElement)(az,{...e,key:e.pane.id}):(0,a.jsx)(an,{...e,sortOrder:Y,layout:D}),x[9]=O,x[10]=D,x[11]=e,x[12]=Y,x[13]=o):o=x[13];let H=o,V=A||y;return x[14]!==O?(d=O?{}:{currentMaxWidth:350,maxWidth:640},x[14]=O,x[15]=d):d=x[15],x[16]!==b.source?(c=lK,x[16]=b.source,x[17]=c):c=x[17],x[18]!==v||x[19]!==E||x[20]!==S||x[21]!==l||x[22]!==M||x[23]!==L||x[24]!==B?(p=(0,a.jsx)(ai,{index:v,initialValueTemplates:E,menuItemGroups:S,menuItems:l,setLayout:M,setSortOrder:L,title:B}),x[18]=v,x[19]=E,x[20]=S,x[21]=l,x[22]=M,x[23]=L,x[24]=B,x[25]=p):p=x[25],x[26]!==g||x[27]!==j||x[28]!==H||x[29]!==d||x[30]!==c||x[31]!==p?(m=(0,a.jsxs)(nc,{"data-ui":"DocumentListPane",id:j,minWidth:320,...d,selected:g,children:[c,p,H]}),x[26]=g,x[27]=j,x[28]=H,x[29]=d,x[30]=c,x[31]=p,x[32]=m):m=x[32],x[33]!==m||x[34]!==V?(f=(0,a.jsx)(h.NeO,{name:V,children:m}),x[33]=m,x[34]=V,x[35]=f):f=x[35],f});aP.displayName="Memo(PaneContainer)";let aA=e=>{let{liveEditSchemaType:t,version:n}=e;return t&&!n?{label:"Live",color:"danger"}:null};aA.displayName="LiveEditBadge";let aR={activePanes:[]};function aD(e){aR.activePanes=e}function aM(e,t,n,i){let l=(null==n?void 0:n.panes)||[],r=aR.activePanes||[],o=t.id||(0,x.A)();for(let n=r.length-1;n>=0;n--){var a;let s=r[n];if("object"==typeof s&&((null==(a=s.canHandleIntent)?void 0:a.call(s,e,t,{pane:s,index:n}))||"documentList"===s.type&&s.schemaTypeName===t.type&&"_type == $type"===s.options.filter)){let r=function(e,t){let{template:n,version:i}=t;return"create"!==e?lW:n&&i?{template:n,version:i}:n?{template:n}:i?{version:i}:lW}(e,t);return{panes:l.slice(0,n).concat([[{id:o,params:r,payload:i}]])}}}return{intent:e,params:t,payload:i}}let aB=(0,v.I4)(h.PaW)(tA()),aY=(0,v.I4)(d.az)(tR());function aL(e){let t,n,i,l,o,c,p,m,f,x,v,g,b,j=(0,s.c)(39),{showChanges:y}=e,{documentId:_,schemaType:w,timelineError:S,timelineStore:k,value:C}=iP(),{selectedReleaseId:E}=(0,h.QO2)(),[I,z]=(0,u.useState)(null),T=(0,h.SfM)(k,aF),P=(0,h.SfM)(k,aZ),A=(0,h.SfM)(k,aN),R=(0,h.SfM)(k,aV),D=(0,h.SfM)(k,aH),M="loading"===R,B=!A,{t:Y}=(0,h.Bdt)(r.Z7);if(j[0]!==P||j[1]!==_||j[2]!==B||j[3]!==w||j[4]!==C?(n={documentId:_,schemaType:w,FieldWrapper:aO,rootDiff:P,isComparingCurrent:B,value:C,showFromValue:!0},j[0]=P,j[1]=_,j[2]=B,j[3]=w,j[4]=C,j[5]=n):n=j[5],t=n,E){let e;return j[6]===Symbol.for("react.memo_cache_sentinel")?(e=(0,a.jsx)(d.so,{"data-testid":"review-changes-pane",direction:"column",height:"fill",children:(0,a.jsx)(d.Zp,{flex:1,padding:2,paddingTop:0,children:(0,a.jsx)(rq,{versionError:!0})})}),j[6]=e):e=j[6],e}return j[7]!==Y?(i=Y("changes.from.label"),j[7]=Y,j[8]=i):i=j[8],j[9]!==i?(l=(0,a.jsx)(d.EY,{size:1,muted:!0,children:i}),j[9]=i,j[10]=l):l=j[10],j[11]!==D?(o=(0,a.jsx)(r1,{mode:"since",chunk:D,placement:"bottom-start"}),j[11]=D,j[12]=o):o=j[12],j[13]!==Y?(c=Y("changes.to.label"),j[13]=Y,j[14]=c):c=j[14],j[15]!==c?(p=(0,a.jsx)(d.EY,{size:1,muted:!0,children:c}),j[15]=c,j[16]=p):p=j[16],j[17]!==T?(m=(0,a.jsx)(r1,{chunk:T,mode:"rev",placement:"bottom-end"}),j[17]=T,j[18]=m):m=j[18],j[19]!==l||j[20]!==o||j[21]!==p||j[22]!==m?(f=(0,a.jsx)(d.az,{padding:3,children:(0,a.jsxs)(aY,{paddingX:2,paddingBottom:2,children:[l,o,p,m]})}),j[19]=l,j[20]=o,j[21]=p,j[22]=m,j[23]=f):f=j[23],j[24]!==P||j[25]!==t||j[26]!==M||j[27]!==w||j[28]!==y||j[29]!==S?(x=y&&(0,a.jsx)(aK,{diff:P,documentContext:t,error:S,loading:M,schemaType:w}),j[24]=P,j[25]=t,j[26]=M,j[27]=w,j[28]=y,j[29]=S,j[30]=x):x=j[30],j[31]!==x?(v=(0,a.jsx)(aB,{"data-ui":"Scroller",ref:z,children:(0,a.jsx)(d.az,{flex:1,paddingX:3,height:"fill",children:x})}),j[31]=x,j[32]=v):v=j[32],j[33]!==I||j[34]!==v?(g=(0,a.jsx)(d.Zp,{flex:1,paddingX:2,paddingY:2,children:(0,a.jsx)(d.EZ,{element:I,children:v})}),j[33]=I,j[34]=v,j[35]=g):g=j[35],j[36]!==g||j[37]!==f?(b=(0,a.jsxs)(d.so,{"data-testid":"review-changes-pane",direction:"column",height:"fill",overflow:"hidden",children:[f,g]}),j[36]=g,j[37]=f,j[38]=b):b=j[38],b}function aO(e){return(0,a.jsx)(h.uD1,{...e,hasRevertHover:!1})}function aH(e){return e.sinceTime}function aV(e){return e.selectionState}function aN(e){return e.onOlderRevision}function aZ(e){return e.diff}function aF(e){return e.revTime}function aK(e){let t,n,i=(0,s.c)(9),{error:l,diff:r,documentContext:o,loading:d,schemaType:c}=e;if(l){let e;return i[0]===Symbol.for("react.memo_cache_sentinel")?(e=(0,a.jsx)(h.J7,{}),i[0]=e):e=i[0],e}if(d){let e;return i[1]===Symbol.for("react.memo_cache_sentinel")?(e=(0,a.jsx)(h.gd4,{showText:!0}),i[1]=e):e=i[1],e}if(!r){let e;return i[2]===Symbol.for("react.memo_cache_sentinel")?(e=(0,a.jsx)(h.J7,{}),i[2]=e):e=i[2],e}return i[3]!==r||i[4]!==c?(t=(0,a.jsx)(h.Vki,{diff:r,schemaType:c}),i[3]=r,i[4]=c,i[5]=t):t=i[5],i[6]!==o||i[7]!==t?(n=(0,a.jsx)(p.HU.Provider,{value:o,children:t}),i[6]=o,i[7]=t,i[8]=n):n=i[8],n}function aW(e){let t,n,i,l,r,c,u,p,m=(0,s.c)(27),{event:f,isSelected:x,onSelect:v,optionsMenu:g}=e,{t:b}=(0,h.Bdt)("studio");m[0]!==f?(t=!(0,h.zOx)(f)&&!(0,h.GDb)(f)&&!(0,h.ayN)(f)&&!(0,h.Bkf)(f)&&!(0,h.azN)(f),m[0]=f,m[1]=t):t=m[1];let j=t;m[2]!==f||m[3]!==j||m[4]!==v?(n=e=>{e.preventDefault(),e.stopPropagation(),j&&v(f)},m[2]=f,m[3]=j,m[4]=v,m[5]=n):n=m[5];let y=n;m[6]!==j||m[7]!==b?(i=j?"":b("changes.not-selectable"),m[6]=j,m[7]=b,m[8]=i):i=m[8];let _=j?"button":"div",w=j?"pointer":"default";return m[9]!==w?(l={cursor:w,width:"100%"},m[9]=w,m[10]=l):l=m[10],m[11]!==f?(r=(0,a.jsx)(h.JhA,{event:f,showChangesBy:"tooltip"}),m[11]=f,m[12]=r):r=m[12],m[13]!==f.timestamp||m[14]!==y||m[15]!==x||m[16]!==_||m[17]!==l||m[18]!==r?(c=(0,a.jsx)(d.Zp,{as:_,onClick:y,padding:2,pressed:x,radius:2,"data-ui":"timelineItem","data-testid":"timeline-item-button","data-chunk-timestamp":f.timestamp,style:l,children:r}),m[13]=f.timestamp,m[14]=y,m[15]=x,m[16]=_,m[17]=l,m[18]=r,m[19]=c):c=m[19],m[20]!==j||m[21]!==i||m[22]!==c?(u=(0,a.jsx)(o.m_,{content:i,disabled:j,children:c}),m[20]=j,m[21]=i,m[22]=c,m[23]=u):u=m[23],m[24]!==g||m[25]!==u?(p=(0,a.jsxs)(d.so,{gap:1,children:[u,g]}),m[24]=g,m[25]=u,m[26]=p):p=m[26],p}function aJ(e){var t,n,i,l;let c,u,p,m,f,x,v,g,b,j,y,w=(0,s.c)(41),{event:S}=e,{t:k}=(0,h.Bdt)(r.Z7),{t:C}=(0,h.Bdt)(),E=(0,d.WP)(),{params:I,setParams:z}=t0(),T=(0,h._T7)();w[0]!==S.id||w[1]!==S.versionId||w[2]!==S.versionRevisionId||w[3]!==I||w[4]!==z?(c=()=>{z({...I,rev:S.versionRevisionId||"@lastPublished",since:void 0,historyEvent:S.id,historyVersion:(0,h._Sr)(S.versionId)})},w[0]=S.id,w[1]=S.versionId,w[2]=S.versionRevisionId,w[3]=I,w[4]=z,w[5]=c):c=w[5];let P=c;w[6]!==S.versionRevisionId||w[7]!==I||w[8]!==z||w[9]!==T?(u=()=>{z({...I,rev:S.versionRevisionId,preserveRev:"true",since:void 0}),setTimeout(()=>{T("drafts")},100)},w[6]=S.versionRevisionId,w[7]=I,w[8]=z,w[9]=T,w[10]=u):u=w[10];let A=u;w[11]!==S.release?(p=e=>{let{children:t}=e;return(0,a.jsx)(h.RwK,{$tone:S.release?(0,h.Jrl)(S.release)?(0,h.Y73)(S.release):"default":void 0,children:t})},w[11]=S.release,w[12]=p):p=w[12];let R=p,D=S.release&&!(0,h.Jrl)(S.release),M="timeline-item-menu-button-".concat(S.versionId);w[13]!==k?(m=k("timeline-item.menu-button.aria-label"),w[13]=k,w[14]=m):m=w[14],w[15]!==S.release||w[16]!==D||w[17]!==k?(f=D?k("timeline-item.not-found-release.tooltip",{releaseId:(null==(t=S.release)?void 0:t._id)?(0,h._hI)(S.release._id):void 0}):k("timeline-item.menu-button.tooltip"),w[15]=S.release,w[16]=D,w[17]=k,w[18]=f):f=w[18],w[19]!==f?(x={content:f},w[19]=f,w[20]=x):x=w[20],w[21]!==D||w[22]!==m||w[23]!==x?(v=(0,a.jsx)(h.VJU,{"aria-label":m,tooltipProps:x,disabled:D}),w[21]=D,w[22]=m,w[23]=x,w[24]=v):v=w[24],w[25]!==R||w[26]!==S.release||w[27]!==S.versionRevisionId||w[28]!==A||w[29]!==P||w[30]!==k||w[31]!==C?(g=(0,a.jsx)(d.W1,{padding:1,children:S.release?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(_.RZ,{intent:h.wwz,params:{id:(0,h._hI)(S.release._id)},style:{textDecoration:"none"},children:(0,a.jsx)(d.Dr,{padding:3,children:(0,a.jsx)(d.so,{align:"center",justify:"flex-start",children:(0,a.jsx)(d.EY,{size:1,style:{textDecoration:"none"},children:(0,a.jsx)(h.HTc,{components:{VersionBadge:e=>{let{children:t}=e;return(0,a.jsx)(R,{children:t})}},i18nKey:"events.open.release",values:{releaseTitle:(null==(n=S.release.metadata)?void 0:n.title)||C("release.placeholder-untitled-release")},t:k})})})})}),(0,a.jsx)(d.Dr,{onClick:P,children:(0,a.jsx)(d.so,{align:"center",justify:"flex-start",children:(0,a.jsx)(d.EY,{size:1,children:(0,a.jsx)(h.HTc,{components:{VersionBadge:e=>{let{children:t}=e;return(0,a.jsx)(R,{children:t})}},i18nKey:"events.inspect.release",values:{releaseTitle:(null==(i=S.release.metadata)?void 0:i.title)||C("release.placeholder-untitled-release")},t:k})})})})]}):(0,a.jsx)(d.Dr,{onClick:A,disabled:!S.versionRevisionId,children:(0,a.jsx)(d.so,{align:"center",children:(0,a.jsx)(d.EY,{size:1,children:(0,a.jsx)(h.HTc,{components:{VersionBadge:aU},i18nKey:"events.open.draft",t:k})})})})}),w[25]=R,w[26]=S.release,w[27]=S.versionRevisionId,w[28]=A,w[29]=P,w[30]=k,w[31]=C,w[32]=g):g=w[32];let B=null==(l=E.elements)||!l[r0]||r0;return w[33]===Symbol.for("react.memo_cache_sentinel")?(b=["bottom-end","bottom-start"],w[33]=b):b=w[33],w[34]!==B?(j={portal:B,placement:"bottom",fallbackPlacements:b},w[34]=B,w[35]=j):j=w[35],w[36]!==j||w[37]!==M||w[38]!==v||w[39]!==g?(y=(0,a.jsx)(o.IU,{id:M,button:v,menu:g,popover:j}),w[36]=j,w[37]=M,w[38]=v,w[39]=g,w[40]=y):y=w[40],y}function aU(e){let{children:t}=e;return(0,a.jsx)(h.RwK,{$tone:"caution",children:t})}let a$=b.P.create(d.az),aG={initial:{opacity:0}
1,animate:{opacity:1},exit:{opacity:0}},aQ=e=>{let{events:t,hasMoreEvents:n,selectedEventId:i,onLoadMore:l,onSelect:r,listMaxHeight:o="calc(100vh - 280px)",fetchEventChildren:s}=e,[c,p]=(0,u.useState)(!1),{t:m}=(0,h.Bdt)("studio"),[f,x]=(0,u.useState)(()=>{if(i){let e=t.find(e=>e.id===i);if(e&&"parentId"in e&&e.parentId)return new Set([e.parentId])}return new Set}),[v,g]=(0,u.useState)(new Set),b=(0,u.useMemo)(()=>t.filter(e=>(0,h.y4b)(e)&&e.parentId?t[t.length-1].id===e.id||f.has(e.parentId):!(0,h.WUV)(e)||!e.parentId||f.has(e.parentId)),[f,t]),j=(0,u.useCallback)(e=>async()=>{let t=e.id,n=!1;x(e=>{let i=new Set(e);return e.has(t)?i.delete(t):(n=!0,i.add(t)),i}),n&&(g(e=>{let n=new Set(e);return n.add(t),n}),await s(e),g(e=>{let n=new Set(e);return n.delete(t),n}))},[s,g]),y=(0,u.useCallback)(e=>{r(e)},[r]),_=(0,u.useCallback)(e=>{let t=(0,h.tfA)(e.documentId);return(0,h.BaK)(e)&&"published"===t?(0,a.jsx)(aJ,{event:e}):(0,h.BaK)(e)&&"draft"===t&&e.creationEvent||(0,h.zOx)(e)&&e.creationEvent?(0,a.jsx)(rD,{isExpanded:f.has(e.id),onExpand:j(e)}):null},[f,j]),w=(0,u.useCallback)((e,t)=>{let{activeIndex:l}=t,r=(0,h.y4b)(e)&&e.parentId&&v.has(e.parentId),o=l===b.length-1;return r?(0,a.jsx)(a$,{animate:{opacity:1},initial:{opacity:0}
1,transition:{duration:.2,delay:.2},children:(0,a.jsx)(d.so,{align:"center",justify:"center",style:{height:57},children:(0,a.jsx)(d.y$,{})})}):(0,a.jsxs)(a$,{paddingBottom:1,paddingRight:1,animate:"animate",exit:"exit",initial:"initial",variants:"parentId"in e?aG:void 0,paddingLeft:((0,h.WUV)(e)||(0,h.y4b)(e))&&e.parentId&&!o?4:1,children:[(0,a.jsx)(aW,{event:e,isSelected:e.id===i,onSelect:y,optionsMenu:_(e)}),o&&n&&(0,a.jsx)(h.gd4,{})]},e.timestamp)},[v,i,y,_,b.length,n]);(0,u.useEffect)(()=>p(!0),[]);let S=b.findIndex(e=>e.id===i);return(0,a.jsx)(rY,{$visible:!S||c,"data-ui":"timeline",children:b.length>0?(0,a.jsx)(rB,{direction:"column",$maxHeight:o,id:"timeline-list-wrapper",children:(0,a.jsx)(h.oIj,{activeItemDataAttr:"data-hovered",ariaLabel:m("timeline.list.aria-label"),autoFocus:"list",initialIndex:S,initialScrollAlign:"center",itemHeight:57,items:b,onEndReached:l,onEndReachedIndexOffset:20,overscan:5,renderItem:w,wrapAround:!1})}):(0,a.jsxs)(d.BJ,{padding:3,space:3,children:[(0,a.jsx)(d.EY,{size:1,weight:"medium",children:m("timeline.error.no-document-history-title")}),(0,a.jsx)(d.EY,{muted:!0,size:1,children:m("timeline.error.no-document-history-description")})]})})};aQ.displayName="EventsTimeline";let aq=(0,v.I4)(o.AM)(tD()),aX={timestamp:{dateStyle:"medium",timeStyle:"short"}};function a0(e){let{event:t,events:n,mode:i,placement:l}=e,{setTimelineRange:r}=iP(),[s,p]=(0,u.useState)(!1),[f,x]=(0,u.useState)(null),[v,g]=(0,u.useState)(null),b=(0,c.dj)(),{nextCursor:j,loading:y,error:_,findRangeForRevision:w,findRangeForSince:S,loadMoreEvents:k,expandEvent:C}=(0,h.LJN)(),{t:E}=(0,h.Bdt)("studio"),I=(0,u.useCallback)(()=>{p(!0)},[]),z=(0,u.useCallback)(()=>{p(!1)},[]),T=(0,u.useCallback)(e=>{s&&("Escape"===e.key||"Tab"===e.key)&&(z(),null==f||f.focus())},[f,z,s]);(0,d.Pm)(T),(0,d.PR)(s&&z,()=>[f,v]);let P=(0,u.useCallback)(e=>{try{if((0,h.zOx)(e)||(0,h.GDb)(e)||(0,h.ayN)(e)||(0,h.Bkf)(e)||(0,h.azN)(e))return void console.error("Event is not selectable");let[t,n]=w(null==e?void 0:e.id);r(t,n),z()}catch(e){b.push({closable:!0,description:e.message,status:"error",title:E("timeline.error.unable-to-load-revision")})}},[E,b,r,w,z]),A=(0,u.useCallback)(e=>{try{let[t,n]=S(e.id);r(t,n),z()}catch(e){b.push({closable:!0,description:e.message,status:"error",title:E("timeline.error.unable-to-load-revision")})}},[S,r,b,E,z]),R=(0,u.useCallback)(()=>{!y&&j&&k()},[y,k,j]),D=(0,u.useMemo)(()=>_?(0,a.jsx)(rq,{}):(0,a.jsx)(aQ,{events:n,fetchEventChildren:C,hasMoreEvents:!!j,selectedEventId:null==t?void 0:t.id,onLoadMore:R,onSelect:"rev"===i?P:A}),[_,i,C,n,j,null==t?void 0:t.id,R,A,P]),M=t?E(h.uMx[t.documentVariantType][t.type],{context:"timestamp",timestamp:new Date(t.timestamp),formatParams:aX}):E("timeline.latest-revision"),B=t?E(h.uMx[t.documentVariantType][t.type],{context:"timestamp",timestamp:new Date(t.timestamp),formatParams:aX}):n.length>0?E("timeline.since-version-missing"):E("timeline.no-previous-events"),Y="rev"===i?M:B;return(0,a.jsx)(d.GD,{__unstable_elements:{"timeline-menu":v},children:(0,a.jsx)(aq,{"data-testid":"timeline-menu",constrainSize:!0,content:s&&D,"data-ui":"versionMenu",open:s,placement:l,matchReferenceWidth:!0,portal:!0,ref:g,children:(0,a.jsx)(d.so,{width:"fill",children:(0,a.jsx)(o.$n,{"data-testid":s?"timeline-menu-close-button":"timeline-menu-open-button",disabled:y||!n.length,mode:"ghost",onClick:s?z:I,ref:x,selected:s,width:"fill",tooltipProps:null,justify:"space-between",style:{maxWidth:"100%"},iconRight:m.D3D,text:y?E("timeline.loading-history"):Y})})})})}let a1=(0,v.I4)(h.PaW)(tM()),a2=(0,v.I4)(d.az)(tB()),a3=(0,v.I4)(d.so)(tY()),a4={diff:null,loading:!0,error:null},a5=()=>{var e,t;let n,i,l,o,c,u,m,f,x,v,b,j,y,_=(0,s.c)(35),{documentId:w,schemaType:S,editState:k,displayed:C}=iP(),{selectedPerspective:E,selectedPerspectiveName:I,selectedReleaseId:z}=(0,h.QO2)(),{t:T}=(0,h.Bdt)(r.Z7);if(_[0]!==(null==k?void 0:k.published)?(i=null!=(t=null==k?void 0:k.published)?t:{},_[0]=null==k?void 0:k.published,_[1]=i):i=_[1],_[2]!==C||_[3]!==i){let e;_[5]!==C?(e=null!=C?C:{},_[5]=C,_[6]=e):e=_[6],l=(0,g.g)((0,g.L)(i,{author:""}),(0,g.L)(e,{author:""})),_[2]=C,_[3]=i,_[4]=l}else l=_[4];return(n=l,(!z||(null==k?void 0:k.version))&&("drafts"!==E||(null==k?void 0:k.draft))&&"published"!==I&&(null==C?void 0:C._rev))?(_[7]!==T?(o=T("events.compare-with-published.title"),_[7]=T,_[8]=o):o=_[8],_[9]!==o?(c=(0,a.jsx)(d.EY,{size:1,weight:"medium",children:o}),_[9]=o,_[10]=c):c=_[10],_[11]!==E?(u=(0,h.Jrl)(E)?null==(e=E.metadata)?void 0:e.title:"draft",_[11]=E,_[12]=u):u=_[12],_[13]!==u?(m={version:u},_[13]=u,_[14]=m):m=_[14],_[15]!==T||_[16]!==m?(f=(0,a.jsx)(d.EY,{size:1,muted:!0,children:(0,a.jsx)(h.HTc,{i18nKey:"events.compare-with-published.description",t:T,values:m})}),_[15]=T,_[16]=m,_[17]=f):f=_[17],_[18]!==c||_[19]!==f?(x=(0,a.jsx)(d.Zp,{borderBottom:!0,paddingBottom:3,children:(0,a.jsxs)(d.BJ,{space:3,paddingTop:1,children:[c,f]})}),_[18]=c,_[19]=f,_[20]=x):x=_[20],_[21]!==C||_[22]!==w||_[23]!==n||_[24]!==S?(v={documentId:w,schemaType:S,rootDiff:n,isComparingCurrent:!0,FieldWrapper:a9,value:C,showFromValue:!0},_[21]=C,_[22]=w,_[23]=n,_[24]=S,_[25]=v):v=_[25],_[26]!==n||_[27]!==S?(b=(0,a.jsx)(d.az,{paddingY:1,children:(0,a.jsx)(h.Vki,{diff:n,schemaType:S})}),_[26]=n,_[27]=S,_[28]=b):b=_[28],_[29]!==b||_[30]!==v?(j=(0,a.jsx)(p.HU.Provider,{value:v,children:b}),_[29]=b,_[30]=v,_[31]=j):j=_[31],_[32]!==j||_[33]!==x?(y=(0,a.jsxs)(d.BJ,{space:2,marginBottom:3,children:[x,j]}),_[32]=j,_[33]=x,_[34]=y):y=_[34],y):null};function a6(e){let{showChanges:t}=e,{documentId:n,schemaType:i,timelineError:l,value:r,formState:o}=iP(),[s,c]=(0,u.useState)(null),{events:p,revision:m,sinceRevision:f,getChangesList:x}=(0,h.LJN)(),v=!(null==m?void 0:m.revisionId),g=(0,u.useMemo)(()=>x(),[x]),{diff:j,loading:_,error:w}=(0,y.J)(g,a4),{t:S}=(0,h.Bdt)("studio"),k=(0,u.useMemo)(()=>({documentId:n,schemaType:i,FieldWrapper:e=>e.path.length>0?(0,a.jsx)(h.uD1,{...e}):e.children,rootDiff:j,isComparingCurrent:v&&!(null==o?void 0:o.readOnly),value:r,showFromValue:!0}),[j,n,v,null==o?void 0:o.readOnly,i,r]),[C,E]=(0,u.useMemo)(()=>p?[p.find(e=>e.id===(null==f?void 0:f.revisionId))||null,p.find(e=>e.id===(null==m?void 0:m.revisionId))||p[0]]:[null,null],[p,null==m?void 0:m.revisionId,null==f?void 0:f.revisionId]),I=(0,u.useMemo)(()=>E?p.slice(p.indexOf(E)+1).map(e=>"parentId"in E&&"parentId"in e&&e.parentId===E.parentId||"parentId"in e&&E.id===e.parentId?{...e,parentId:void 0}:e):p.slice(1),[p,E]);return p.length?(0,a.jsxs)(d.so,{"data-testid":"review-changes-pane",direction:"column",height:"fill",overflow:"hidden",children:[(0,a.jsxs)(d.az,{padding:3,style:{position:"relative"},children:[(0,a.jsxs)(a2,{paddingX:2,paddingBottom:2,children:[(0,a.jsx)(d.EY,{size:1,muted:!0,children:S("changes.inspector.from-label")}),(0,a.jsx)(a0,{event:C||null,events:I,mode:"since",placement:"bottom-start"}),(0,a.jsx)(d.EY,{size:1,muted:!0,children:S("changes.inspector.to-label")}),(0,a.jsx)(a0,{event:E||null,events:p,mode:"rev",placement:"bottom-end"})]}
1),_&&(0,a.jsx)(b.P.div,{animate:{opacity:1},initial:{opacity:0},transition:{delay:.2,duration:.2},children:(0,a.jsxs)(a3,{justify:"center",align:"center",gap:2,children:[(0,a.jsx)(d.EY,{muted:!0,size:0,children:S("changes.loading-changes")}),(0,a.jsx)(d.y$,{size:0})]})})]}),(0,a.jsx)(d.Zp,{flex:1,paddingX:2,paddingY:2,children:(0,a.jsx)(d.EZ,{element:s,children:(0,a.jsx)(a1,{"data-ui":"Scroller",ref:c,children:(0,a.jsx)(d.az,{flex:1,paddingX:3,height:"fill",children:t&&(0,a.jsx)(a7,{documentContext:k,error:l||w,loading:(null==m?void 0:m.loading)||(null==f?void 0:f.loading)||!1,schemaType:i,sameRevisionSelected:(null==C?void 0:C.id)===(null==E?void 0:E.id),sinceEvent:C})})})})})]}):(0,a.jsx)(d.az,{paddingX:2,children:(0,a.jsxs)(d.BJ,{padding:3,space:3,children:[(0,a.jsx)(d.EY,{size:1,weight:"medium",children:S("timeline.error.no-document-history-title")}),(0,a.jsx)(d.EY,{muted:!0,size:1,children:S("timeline.error.no-document-history-description")})]})})}function a7(e){let t,n,i=(0,s.c)(15),{error:l,documentContext:r,loading:o,schemaType:c,sameRevisionSelected:u,sinceEvent:m}=e;if(l){let e,t,n;return i[0]===Symbol.for("react.memo_cache_sentinel")?(e=(0,a.jsx)(a5,{}),i[0]=e):e=i[0],i[1]!==l||i[2]!==(null==m?void 0:m.type)?(t=(null==m?void 0:m.type)!=="historyCleared"&&(0,a.jsx)(h.isY,{error:l}),i[1]=l,i[2]=null==m?void 0:m.type,i[3]=t):t=i[3],i[4]!==t?(n=(0,a.jsxs)(a.Fragment,{children:[e,t]}),i[4]=t,i[5]=n):n=i[5],n}if(o){let e;return i[6]===Symbol.for("react.memo_cache_sentinel")?(e=(0,a.jsx)(h.gd4,{showText:!0}),i[6]=e):e=i[6],e}if(u){let e;return i[7]===Symbol.for("react.memo_cache_sentinel")?(e=(0,a.jsx)(a8,{}),i[7]=e):e=i[7],e}if(!r.rootDiff){let e;return i[8]===Symbol.for("react.memo_cache_sentinel")?(e=(0,a.jsx)(b.P.div,{animate:{opacity:1},initial:{opacity:0}
1,transition:{delay:.2,duration:.2},children:(0,a.jsx)(h.J7,{})}),i[8]=e):e=i[8],e}return i[9]!==r.rootDiff||i[10]!==c?(t=(0,a.jsx)(d.az,{paddingY:1,children:(0,a.jsx)(h.Vki,{diff:r.rootDiff,schemaType:c})}),i[9]=r.rootDiff,i[10]=c,i[11]=t):t=i[11],i[12]!==r||i[13]!==t?(n=(0,a.jsx)(p.HU.Provider,{value:r,children:t}),i[12]=r,i[13]=t,i[14]=n):n=i[14],n}function a8(){let e,t,n,i,l,r,o,c=(0,s.c)(12),{t:u}=(0,h.Bdt)("");return c[0]===Symbol.for("react.memo_cache_sentinel")?(e={opacity:1},t={opacity:0},n={delay:.2,duration:.2},c[0]=e,c[1]=t,c[2]=n):(e=c[0],t=c[1],n=c[2]),c[3]!==u?(i=u("changes.same-revision-selected-title"),c[3]=u,c[4]=i):i=c[4],c[5]!==i?(l=(0,a.jsx)(d.EY,{size:1,weight:"medium",as:"h3",children:i}),c[5]=i,c[6]=l):l=c[6],c[7]!==u?(r=(0,a.jsx)(d.EY,{as:"p",size:1,muted:!0,children:(0,a.jsx)(h.HTc,{i18nKey:"changes.same-revision-selected-description",t:u})}),c[7]=u,c[8]=r):r=c[8],c[9]!==l||c[10]!==r?(o=(0,a.jsx)(b.P.div,{animate:e,initial:t,transition:n,children:(0,a.jsxs)(d.BJ,{space:3,paddingTop:2,children:[l,r]})}),c[9]=l,c[10]=r,c[11]=o):o=c[11],o}function a9(e){return e.children}let se=(0,v.I4)(h.PaW)(tL());function st(e){var t;let{showList:n}=e,[i,l]=(0,u.useState)(null),[r,o]=(0,u.useState)(0),{setTimelineRange:s}=iP(),p=(0,u.useCallback)(e=>{!r&&e&&(o(e.clientHeight?e.clientHeight-1:0),l(e))},[r]),{events:m,nextCursor:f,loading:x,error:v,revision:g,loadMoreEvents:b,findRangeForRevision:j,expandEvent:y}=(0,h.LJN)(),{t:_}=(0,h.Bdt)("studio"),w=(0,c.dj)(),S=(0,u.useCallback)(e=>{try{if((0,h.zOx)(e)||(0,h.GDb)(e)||(0,h.ayN)(e)||(0,h.Bkf)(e)||(0,h.azN)(e))return void console.error("Event is not selectable");let[t,n]=j(e.id);s(t,n)}catch(e){w.push({closable:!0,description:e.message,status:"error",title:_("timeline.error.unable-to-load-revision")})}},[_,w,s,j]),k=x&&!m.length;return(0,a.jsx)(d.so,{"data-testid":"review-changes-pane",direction:"column",height:"fill",children:(0,a.jsx)(d.Zp,{flex:1,padding:2,paddingTop:0,children:v?(0,a.jsx)(rq,{}):(0,a.jsx)(d.EZ,{element:i,children:(0,a.jsxs)(se,{"data-ui":"Scroller",ref:p,children:[r&&n&&!k?(0,a.jsx)(aQ,{events:m,fetchEventChildren:y,hasMoreEvents:!!f,selectedEventId:(null==g?void 0:g.revisionId)||(null==(t=m[0])?void 0:t.id),onLoadMore:b,onSelect:S,listMaxHeight:"".concat(r,"px")}):null,x&&(0,a.jsx)(h.gd4,{})]})})})})}let sn=(0,v.I4)(h.PaW)(tO());function si(e){let{showList:t}=e,{timelineError:n,setTimelineRange:i,timelineStore:l}=iP(),{selectedReleaseId:r}=(0,h.QO2)(),[o,s]=(0,u.useState)(null),[p,m]=(0,u.useState)(0),f=(0,u.useCallback)(e=>{(null==e?void 0:e.clientHeight)&&(m(e.clientHeight-1),s(e))},[]),x=(0,h.SfM)(l,e=>e.chunks),v=(0,h.SfM)(l,e=>e.realRevChunk),g=(0,h.SfM)(l,e=>e.hasMoreChunks),b=(0,h.SfM)(l,e=>e.isLoading),{t:j}=(0,h.Bdt)("studio"),y=(0,c.dj)(),_=(0,u.useCallback)(e=>{try{let[t,n]=(null==l?void 0:l.findRangeForRev(e))||[null,null];i(t,n)}catch(e){y.push({closable:!0,description:e.message,status:"error",title:j("timeline.error.unable-to-load-revision")})}},[i,j,l,y]),w=(0,u.useCallback)(()=>{b||null==l||l.loadMore()},[b,l]);return(0,a.jsx)(d.so,{"data-testid":"review-changes-pane",direction:"column",height:"fill",children:(0,a.jsx)(d.Zp,{flex:1,padding:2,paddingTop:0,children:n||r?(0,a.jsx)(rq,{versionError:!!r}):(0,a.jsx)(d.EZ,{element:o,children:(0,a.jsx)(sn,{"data-ui":"Scroller",ref:f,children:p&&t?(0,a.jsx)(rQ,{chunks:x,hasMoreChunks:g,lastChunk:v,onLoadMore:w,onSelect:_,listMaxHeight:"".concat(p,"px")}):null})})})})}let sl=(0,v.I4)(d.so)(tH()),sr=["history","review"],so={error:m.YZv,warning:m.sAQ,info:m.YzR},sa={error:"critical",warning:"caution",info:"primary"};function ss(e){let t,n,i,l,r=(0,s.c)(17),{marker:c,onOpen:p,schemaType:m,value:h}=e;r[0]!==c.path||r[1]!==p?(t=()=>p(c.path),r[0]=c.path,r[1]=p,r[2]=t):t=r[2];let f=t,[x,v]=(0,u.useState)(null),g=so[c.level];return r[3]!==x?(n=x&&(0,a.jsx)(d.Zp,{padding:3,radius:2,tone:"critical",children:(0,a.jsx)(d.EY,{size:1,children:x.error.message})}),r[3]=x,r[4]=n):n=r[4],r[5]!==g||r[6]!==x||r[7]!==f||r[8]!==c.level||r[9]!==c.message||r[10]!==c.path||r[11]!==m||r[12]!==h?(i=!x&&(0,a.jsx)(d.Zp,{__unstable_focusRing:!0,as:"button",onClick:f,padding:3,radius:2,tone:sa[c.level],children:(0,a.jsxs)(d.so,{align:"flex-start",ga
1p:3,children:[(0,a.jsx)(d.az,{flex:"none",children:(0,a.jsx)(d.EY,{size:1,children:(0,a.jsx)(g,{})})}),(0,a.jsxs)(d.BJ,{flex:1,space:2,children:[(0,a.jsx)(sd,{path:c.path,schemaType:m,value:h}),(0,a.jsx)(d.EY,{muted:!0,size:1,children:c.message})]})]})}),r[5]=g,r[6]=x,r[7]=f,r[8]=c.level,r[9]=c.message,r[10]=c.path,r[11]=m,r[12]=h,r[13]=i):i=r[13],r[14]!==n||r[15]!==i?(l=(0,a.jsxs)(o.tH,{onCatch:v,children:[n,i]}),r[14]=n,r[15]=i,r[16]=l):l=r[16],l}function sd(e){let{path:t,schemaType:n,value:i}=e,l=(0,u.useMemo)(()=>{try{return function(e){let{path:t,schemaType:n,value:i}=e,l=[],r=n,o=i;for(let e of t){if("string"==typeof e){if(!(0,h.u4i)(o)&&void 0!==o)throw Error("Parent value is not an object, cannot get path segment: .".concat(e));if("object"!==r.jsonType)throw Error("Parent type is not an object schema type, cannot get path segment: .".concat(e));o=null==o?void 0:o[e];let t=r.fields.find(t=>t.name===e);if(!t)return l.push({name:e}),l;r=t.type,l.push(r);continue}if("number"==typeof e){if(!(0,h.cyL)(o)&&void 0!==o)throw Error("Parent value is not an array, cannot get path segment: [".concat(e,"]"));if("array"!==r.jsonType)throw Error("Parent type is not an array schema type, cannot get path segment: [".concat(e,"]"));o=null==o?void 0:o[e];let t=r.of.find(e=>"string"==typeof o?"string"===e.jsonType:"number"==typeof o?"number"===e.jsonType:"boolean"==typeof o?"boolean"===e.jsonType:!!(0,h.u4i)(o)&&e.name===(null==o?void 0:o._type));if(!t)throw Error("Item type not found: [".concat(e,"]"));r=t,l.push(r);continue}if((0,h.u4i)(e)&&e._key){if(!(0,h.cyL)(o))throw Error("Parent value is not an array, cannot get path segment: [_key == ".concat(e,"]"));if("array"!==r.jsonType)throw Error("Parent type is not an array schema type, cannot get path segment: .".concat(e));if(o=(null!=o?o:[]).find(t=>(0,h.u4i)(t)&&t._key===e._key),!(0,h.u4i)(o))throw Error("Array item not found: [_key == ".concat(e._key,"]"));let t=r.of.find(e=>(0,h.u4i)(o)&&e.name===(null==o?void 0:o._type));if(!t)throw Error("Array item type not found: .".concat(null==o?void 0:o._type));r=t,l.push(r);continue}throw Error("Invalid path segment: ".concat(JSON.stringify(e)))}return l}({path:t,schemaType:n,value:i})}catch(e){console.error(e)}return null},[t,n,i]);return(null==l?void 0:l.length)?(0,a.jsx)(d.EY,{size:1,children:l.map((e,t)=>(0,a.jsxs)(u.Fragment,{children:[t>0&&(0,a.jsx)("span",{style:{color:"var(--card-muted-fg-color)",opacity:.5},children:" / "}),(0,a.jsx)("span",{style:{fontWeight:500},children:e.title||e.name})]},t))}):null}let sc={},su=_.wE.create("/",[_.wE.intents("/intent"),_.wE.create("/edit/:type/:editDocumentId",[_.wE.create({path:"/:params",transform:{params:{toState:function(e){try{return JSON.parse(decodeURIComponent(e))}catch(e){return console.warn("Failed to parse JSON parameters"),{}}},toPath:function(e){return JSON.stringify(e)}}}})]),_.wE.create({path:"/:panes",children:[_.wE.create("/:action",_.wE.create("/:legacyEditDocumentId"))],transform:{panes:{toState:function(e){var t;return -1!==(t=decodeURIComponent(e)).indexOf(",{")?function(e){let t=[],n=e;for(;n.length;){let[e,i,l]=n.match(sp)||[];if(!e){n=n.slice(1);continue}let r=l&&function(e){try{return JSON.parse(e)}catch(e){console.warn("Failed to parse parameters: ".concat(e.message));return}}(l);t.push({id:i,payload:r}),n=n.slice(e.length)}return[t]}(t):t.split(";").map(e=>{let[t,...n]=e.split("|").map(e=>{let[t,...n]=e.split(","),i={id:t,params:sc,payload:void 0};return n.reduce((e,t)=>{if(/^[a-z0-9]+=[^=]+/i.test(t)){let n=t.slice(0,t.indexOf("=")),i=t.slice(n.length+1);e.params={...e.params,[decodeURIComponent(n)]:decodeURIComponent(i)}}else/^[A-Za-z0-9\-_]+(?:={0,2})$/.test(t)?e.payload=function(e){try{return e?(0,_.fA)(e):void 0}catch(e){console.warn("Failed to parse parameters: ".concat(e.message));return}}(t):console.warn("Unknown pane segment: %s - skipping",t);return e},i)});return[t,...n.map(e=>({...t,...e,id:e.id||t.id,params:{...w(t.params,sm),...e.params},payload:e.payload||t.payload}))]}).filter(e=>e.length>0)},toPath:function(e){return(e||[]).map(e=>
1e.map(sf).join("|")).map(encodeURIComponent).join(";")}}}})]),sp=/^([.a-z0-9_-]+),?({.*?})?(?:(;|$))/i,sm=["view","since","rev","inspect","comment"],sh=Boolean;function sf(e,t,n){let{payload:i,params:l={},id:r}=e,[o]=n,a=e===o,s=0!==t&&r===o.id,d=typeof i>"u"?void 0:(0,_.nk)(i),c=Object.entries(l).filter(e=>{var t;let[n,i]=e;return!!i&&(!!a||!(i===(null==(t=o.params)?void 0:t[n])&&!sm.includes(n)))}).map(e=>{let[t,n]=e;return"".concat(encodeURIComponent(t),"=").concat(encodeURIComponent(n))});return[s?"":r].concat([c.length>0&&c,d].filter(sh).flat()).join(",")||","}let sx=[rd,ru,rt,ri,l9,rl],sv=[aA],sg=[{name:"sanity/structure/validation",component:function(e){let t,n,i,l,r,o,c,u=(0,s.c)(23),{onClose:p}=e,{onFocus:m,onPathOpen:f,schemaType:x,validation:v,value:g,editState:b}=iP(),{t:j}=(0,h.Bdt)("validation");u[0]!==m||u[1]!==f?(t=e=>{f(e),m(e)},u[0]=m,u[1]=f,u[2]=t):t=u[2];let y=t;u[3]!==b?(n=b&&b.version&&(0,h.YW1)(b.version),u[3]=b,u[4]=n):n=u[4];let _=n;return u[5]!==j?(i=j("panel.close-button-aria-label"),u[5]=j,u[6]=i):i=u[6],u[7]!==j?(l=j("panel.title"),u[7]=j,u[8]=l):l=u[8],u[9]!==p||u[10]!==i||u[11]!==l?(r=(0,a.jsx)(iW,{as:"header",closeButtonLabel:i,flex:"none",onClose:p,title:l}),u[9]=p,u[10]=i,u[11]=l,u[12]=r):r=u[12],u[13]!==y||u[14]!==_||u[15]!==x||u[16]!==j||u[17]!==v||u[18]!==g?(o=(0,a.jsx)(d.Zp,{flex:1,overflow:"auto",padding:3,children:_?(0,a.jsx)(d.az,{padding:2,children:(0,a.jsx)(d.EY,{muted:!0,size:1,children:j("panel.unpublish-message")})}):(0,a.jsxs)(a.Fragment,{children:[0===v.length&&(0,a.jsx)(d.az,{padding:2,children:(0,a.jsx)(d.EY,{muted:!0,size:1,children:j("panel.no-errors-message")})}),v.length>0&&(0,a.jsx)(d.BJ,{space:2,children:v.map((e,t)=>(0,a.jsx)(ss,{marker:e,onOpen:y,schemaType:x,value:g},t))})]})}),u[13]=y,u[14]=_,u[15]=x,u[16]=j,u[17]=v,u[18]=g,u[19]=o):o=u[19],u[20]!==r||u[21]!==o?(c=(0,a.jsxs)(d.so,{direction:"column",height:"fill",overflow:"hidden",children:[r,o]}),u[20]=r,u[21]=o,u[22]=c):c=u[22],c},useMenuItem:function(e){let{documentId:t,documentType:n}=e,{t:i}=(0,h.Bdt)("validation"),{selectedReleaseId:l}=(0,h.QO2)(),{validation:r}=(0,h.dWw)(t,n,l),{value:o}=iP(),a=(0,u.useMemo)(()=>r.map(e=>({level:e.level,message:e.message,path:e.path})),[r]),s=a.some(f.Ah),d=a.some(f.ci),c=(0,h.YW1)(o),p=(0,u.useMemo)(()=>s?m.YZv:d?m.sAQ:m.Dee,[s,d]),x=(0,u.useMemo)(()=>s?"critical":d?"caution":"positive",[s,d]);return{hidden:0===a.length||c,icon:p,title:i("panel.title"),tone:x,showAsAction:!0}}},{name:iH,useMenuItem:()=>{let{features:e}=iB(),{t}=(0,h.Bdt)();return{hidden:!e.reviewChanges,icon:m.G2W,title:t("changes.title")}},component:function(e){var t,n,i,l,p,f,x,v,g,b,j,y;let _,w,S,k,C,E,I,z,T,P,A,R,D,M,B,Y,L,O,H,V,N,Z,F,K,W,J,U,$=(0,s.c)(72),{params:G,setParams:Q}=t0(),q=(0,h.For)(),[X,ee]=(0,u.useState)(null),{t:et}=(0,h.Bdt)(r.Z7),en=(null==G?void 0:G.inspect)===iH,{selectedPerspective:ei}=(0,h.QO2)();$[0]!==G?(_=(U=null==G?void 0:G.changesInspectorTab)&&sr.includes(U)?G.changesInspectorTab:sr[0],$[0]=G,$[1]=_):_=$[1];let el=_;$[2]!==G||$[3]!==Q?(w=e=>Q({...G,changesInspectorTab:e,since:"history"===e||null==G?void 0:G.since}),$[2]=G,$[3]=Q,$[4]=w):w=$[4];let er=w;$[5]!==ei||$[6]!==et?(S=(0,h.Jrl)(ei)?ei.metadata.title:et("drafts"===ei?"compare-versions.status.draft":"compare-versions.status.published"),$[5]=ei,$[6]=et,$[7]=S):S=$[7];let eo=S,ea=en?"":void 0;$[8]!==et?(k=et("changes.tab.history"),$[8]=et,$[9]=k):k=$[9],$[10]!==er?(C=()=>er("history"),$[10]=er,$[11]=C):C=$[11];let es="history"===el;$[12]!==k||$[13]!==C||$[14]!==es?(E=(0,a.jsx)(o.oz,{"aria-controls":"history-panel",id:"history-tab",label:k,onClick:C,selected:es}),$[12]=k,$[13]=C,$[14]=es,$[15]=E):E=$[15],$[16]!==et?(I=et("changes.tab.review-changes"),$[16]=et,$[17]=I):I=$[17],$[18]!==er?(z=()=>er("review"),$[18]=er,$[19]=z):z=$[19];let ed="review"===el;$[20]!==ed||$[21]!==I||$[22]!==z?(T=(0,a.jsx)(o.oz,{"aria-controls":"review-changes-panel",id:"changes-tab",label:I,onClick:z,selected:ed}),$[20]=ed,$[21]=I,$[22]=z,$[23]=T):T=$[23],$[24]!==T||$[25]!==E?(P=(0,a.jsxs)(d.wb,{space:1,flex:1,children:[E,T]}),$[24]=T,$[25]=E,$[26]=P):P=$[26],$[27]!==et?(A=et("changes.action.close-label"),$[27]=et,$[28]=A):A=$[28];let ec=e.onClose;$[29]!==et?(R=et("document-inspector.close-button.tooltip"),$[29]=et,$[30]=R):R=$[30],$[31]!==R?(D={content:R},$[31]=R,$[32]=D):D=$[32],$[33]!==e.onClose||$[34]!==A||$[35]!==D?(M=(0,a.jsx)(o.$n,{"aria-label":A,icon:m.USm,mode:"bleed",onClick:ec,tooltipProps:D}),$[33]=e.onClose,$[34]=A,$[35]=D,$[36]=M):M=$[36],$[37]!==P||$[38]!==M?(B=(0,a.jsx)(d.Zp,{paddingBottom:1,children:(0,a.jsxs)(d.so,{align:"center",padding:3,gap:2,children:[P,M]})}),$[37]=P,$[38]=M,$[39]=B):B=$[39],$[40]!==et?(Y=(0,a.jsx)(d.az,{flex:1,padding:1,children:(0,a.jsx)(d.EY,{size:1,children:(0,a.jsx)(h.HTc,{t:et,i18nKey:"changes.banner.tooltip"})})}),$[40]=et,$[41]=Y):Y=$[41],$[42]===Symbol.for("react.memo_cache_sentinel")?(L=(0,a.jsx)(d.EY,{size:0,muted:!0,children:(0,a.jsx)(m.YzR,{fontSize:1})}),$[42]=L):L=$[42],$[43]!==X||$[44]!==Y?(O=(0,a.jsx)(o.m_,{portal:!0,placement:"bottom-end",boundaryElement:X,content:Y,children:L}),$[43]=X,$[44]=Y,$[45]=O):O=$[45],$[46]!==eo?(H={perspective:eo},$[46]=eo,$[47]=H):H=$[47],$[48]!==et||$[49]!==H?(V=(0,a.jsx)(d.EY,{size:0,muted:!0,children:(0,a.jsx)(h.HTc,{t:et,values:H,i18nKey:"changes.banner.description"})}),$[48]=et,$[49]=H,$[50]=V):V=$[50],$[51]!==O||$[52]!==V?(N=(0,a.jsx)(d.Zp,{padding:2,marginBottom:3,marginX:3,tone
1:"neutral",border:!0,radius:3,children:(0,a.jsxs)(d.so,{gap:2,align:"flex-start",children:[O,V]})}),$[51]=O,$[52]=V,$[53]=N):N=$[53];let eu="history"!==el;$[54]!==el||$[55]!==(null==(n=q.beta)||null==(t=n.eventsAPI)?void 0:t.documents)?(Z=(null==(l=q.beta)||null==(i=l.eventsAPI)?void 0:i.documents)?(0,a.jsx)(st,{showList:"history"===el}):(0,a.jsx)(si,{showList:"history"===el}),$[54]=el,$[55]=null==(f=q.beta)||null==(p=f.eventsAPI)?void 0:p.documents,$[56]=Z):Z=$[56],$[57]!==eu||$[58]!==Z?(F=(0,a.jsx)(c.Kp,{"aria-labelledby":"history-tab",height:"fill",hidden:eu,id:"history-panel",children:Z}),$[57]=eu,$[58]=Z,$[59]=F):F=$[59];let ep="review"!==el;return $[60]!==el||$[61]!==(null==(v=q.beta)||null==(x=v.eventsAPI)?void 0:x.documents)?(K=(null==(b=q.beta)||null==(g=b.eventsAPI)?void 0:g.documents)?(0,a.jsx)(a.Fragment,{children:"review"===el?(0,a.jsx)(a6,{showChanges:"review"===el}):null}):(0,a.jsx)(aL,{showChanges:"review"===el}),$[60]=el,$[61]=null==(y=q.beta)||null==(j=y.eventsAPI)?void 0:j.documents,$[62]=K):K=$[62],$[63]!==ep||$[64]!==K?(W=(0,a.jsx)(c.Kp,{"aria-labelledby":"review-tab",hidden:ep,id:"review-panel",height:"fill",children:K}),$[63]=ep,$[64]=K,$[65]=W):W=$[65],$[66]!==B||$[67]!==N||$[68]!==F||$[69]!==ea||$[70]!==W?(J=(0,a.jsxs)(sl,{direction:"column",padding:0,height:"fill","data-ready":ea,ref:ee,children:[B,N,F,W]}),$[66]=B,$[67]=N,$[68]=F,$[69]=ea,$[70]=W,$[71]=J):J=$[71],J},onClose:e=>{let{params:t}=e;return{params:{...t,since:void 0,rev:void 0,changesInspectorTab:void 0,historyVersion:void 0}}},onOpen:e=>{let{params:t}=e;return{params:{...t,since:"@lastPublished"}}}}],sb=(0,h.bzQ)(e=>{let t=(null==e?void 0:e.icon)||m.tN2;return{name:"sanity/structure",document:{actions:e=>Array.from(new Set([...e,...sx])),badges:e=>Array.from(new Set([...e,...sv])),inspectors:e=>Array.from(new Set([...e,...sg]))},tools:[{name:(null==e?void 0:e.name)||"structure",title:(null==e?void 0:e.title)||"Structure",icon:t,component:(0,u.lazy)(()=>n.e(5272).then(n.bind(n,65272))),canHandleIntent:(e,t)=>"create"===e?function(e){return"type"in e&&(!("template"in e)||{template:!0})}(t):"edit"===e&&function(e){return"id"in e&&(!("mode"in e)||{mode:"structure"===e.mode})}(t),getIntentState:aM,controlsDocumentTitle:!0,options:e,router:su,__internalApplicationType:"sanity/structure"}],i18n:{bundles:[r.uQ]}}});var sj=Object.freeze({__proto__:null,default:oF}),sy=Object.freeze({__proto__:null,default:aP})}}]);
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.