1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[817],{22847:function(e,n,t){t.r(n),t.d(n,{DocumentPane:function(){return dt},index:function(){return gt},useDeskToolSetting:function(){return Xe}});var i=t(85893),o=t(67294),s=t(11636),a=t(51776),r=t(57557),l=t.n(r),c=t(9141),d=t(40052),u=t(32817),p=t(18084),h=t(65044);function x(e,n){var t="object"===typeof n;return new Promise((function(i,o){var s=new h.Hp({next:function(e){i(e),s.unsubscribe()},error:o,complete:function(){t?i(n.defaultValue):o(new p.K)}});e.subscribe(s)}))}var f=t(69243),m=t(9653),g=t(70003),j=t(23071),v=t(53416),y=t(40148),b=t(30218),w=t(34978),_=t(29127),P=t(98430),I=t(96798),C=t(2566);var k,S,z,E,M,L,T,R,O,W,F,B,K,N,Z=t(56542),D=t(53741),A=t(93833),U=t(46297),V=t(42965),H=t(42006),X=t(32932),q=t(38063),$=t(18446),Y=t.n($),J=t(933),G=t(25934),Q=t(14141),ee=t(40168),ne=(t(68929),t(989),t(44908),t(21804),t(35937),t(13311),t(73955),t(59864)),te=(t(18029),t(18156)),ie=t(66996),oe=(t(81763),t(47037),t(28440)),se=t(34391),ae=t.n(se),re=t(70248),le=t.n(re),ce=t(35516);function de(e,n){return n||(n=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(n)}}))}const ue=e=>{const{actions:n,children:t,actionProps:o,onActionComplete:s}=e;return(0,i.jsx)(X.duV,{onReset:s,hooks:n,args:o,children:t})},pe=e=>{const{badges:n,children:t,badgeProps:o,...s}=e;return(0,i.jsx)(X.duV,{...s,hooks:n,args:o,children:t})},he=[];function xe(e){const{children:n,flatIndex:t,index:s,params:r,payload:c,siblingIndex:d}=e,{navigate:u,navigateIntent:p}=(0,J.tv)(),h=(0,J.z)(),x=(0,o.useMemo)((()=>(null==h?void 0:h.panes)||he),[null==h?void 0:h.panes]),f=s-1,m=(0,o.useCallback)((e=>{const n=x[f]||[],t=e(n,n[d]),i=[...x.slice(0,f),t,...x.slice(f+1)],o={...h||{},panes:i};return setTimeout((()=>u(o)),0),o}),[f,u,x,h,d]),g=(0,o.useCallback)((e=>{m(((n,t)=>[...n.slice(0,d),{...t,payload:e},...n.slice(d+1)]))}),[m,d]),j=(0,o.useCallback)((e=>{m(((n,t)=>[...n.slice(0,d),{...t,params:e},...n.slice(d+1)]))}),[m,d]),v=(0,o.useCallback)((e=>{let{id:n,parentRefPath:t,type:i,template:o}=e;u({panes:[...x.slice(0,f+1),[{id:n,params:{template:o.id,parentRefPath:(0,ie.BB)(t),type:i},payload:o.params}]]})}),[f,u,x]),y=(0,o.useMemo)((()=>({index:t,groupIndex:f,siblingIndex:d,payload:c,params:r,hasGroupSiblings:!!x[f]&&x[f].length>1,groupLength:x[f]?x[f].length:0,routerPanesState:x,ChildLink:a.aL,BackLink:a.hb,ReferenceChildLink:a.HZ,handleEditReference:v,ParameterizedLink:a.V$,replaceCurrent:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};m((()=>[{id:e.id||"",payload:e.payload,params:e.params||{}}]))},closeCurrent:()=>{m(((e,n)=>e.length>1?e.filter((e=>e!==n)):e))},duplicateCurrent:e=>{m(((n,t)=>{const i={...t,payload:(null==e?void 0:e.payload)||t.payload,params:(null==e?void 0:e.params)||t.params};return[...n.slice(0,d),i,...n.slice(d)]}))},setView:e=>{const n=l()(r,"view");return j(e?{...n,view:e}:n)},setParams:j,setPayload:g,navigateIntent:p})),[t,f,v,m,p,r,c,x,j,g,d]);return(0,i.jsx)(a.ud.Provider,{value:y,children:n})}function fe(e,n){const t=[];let i=n;for(;i!==e;){const n=i.parentElement;if(!n)return t;const o=Array.from(n.childNodes).indexOf(i);if(t.unshift(o),n===e)return t;i=n}return t}const me=[];function ge(){const e=[],n=[],t=new WeakMap,i=new Set,o={};let s=null,r=0,l=null,c=new Map,d=!1;function u(e){i.delete(e),l=e,p()}return{collapse:function(e){i.add(e),l===e&&(l=null),p()},expand:u,mount:function(e,i){return t.set(e,{...i,original:i}),n.push(e),s&&function(e,n){const t=new WeakMap;for(const i of n)t.set(i,fe(e,i));n.sort(((e,n)=>{const i=t.get(e)||me,o=t.get(n)||me,s=Math.max(i.length,o.length);for(let t=0;t<s;t+=1){const e=i[t]||-1,n=o[t]||-1;if(e!==n)return e-n}return 0}))}(s,n),u(e),()=>{const i=n.indexOf(e);i>-1&&n.splice(i,1),t.delete(e),p()}},resize:function(e,i,s){var r,l,u,h;const x=n.indexOf(i),f=t.get(i);if(!f)return;const m=n[x+1],g=t.get(m);if(g){if("start"===e&&(d=!0,o.left={element:i,flex:f.flex||1,width:i.offsetWidth},o.right={element:m,flex:g.flex||1,width:m.offsetWidth},p()),"move"===e&&o.left&&o.right){c=new Map;const{leftW:e,rightW:n,leftFlex:t,rightFlex:r}=function(e,n,t,i){var o,s;const r=e.left.flex+e.right.flex,l=e.left.width+e.right.width,c=null!=(o=n.minWidth)?o:a.nR,d=null!=(s=t.minWidth)?s:a.nR,u=Math.min(n.maxWidth||1/0,l-d),p=Math.min(t.maxWidth||1/0,l-c);let h=c-e.left.width;const x=e.right.width-p;h<x&&(h=x);let f=e.right.width-d;const m=u-e.left.width;f>m&&(f=m);const g=Math.min(Math.max(i,h),f),j=e.left.width+g,v=e.right.width-g;return{leftFlex:j/l*r,leftW:j,rightFlex:v/l*r,rightW:v}}(o,f,g,s);c.set(i,{flex:t,width:e}),c.set(m,{flex:r,width:n}),p()}if("end"===e){d=!1;const e=c.get(i),n=c.get(m);t.set(i,{...f,currentMinWidth:0,currentMaxWidth:null!=(r=f.maxWidth)?r:1/0,flex:null!=(l=null==e?void 0:e.flex)?l:f.flex}),t.set(m,{...g,currentMinWidth:0,currentMaxWidth:null!=(u=f.maxWidth)?u:1/0,flex:null!=(h=null==n?void 0:n.flex)?h:g.flex}),c=new Map,delete o.left,delete o.right,p()}}},setRootElement:function(e){s=e},setRootWidth:function(e){r=e,p()},subscribe:function(n){return e.push(n),()=>{const t=e.push(n);t>-1&&e.splice(t,1)}}};function p(){var o,s,u,p;if(!r)return;const h=[];for(const e of n)e!==l&&h.unshift(e);l&&h.unshift(l);const x=new WeakMap,f=h.length,m=h[0],g=(f-1)*a.AA;let j=r-g;for(const e of h){const n=t.get(e);if(!n)continue;const r=n.currentMinWidth||n.minWidth||a.nR,l=e===m,d=i.has(e),h=r>j,f=!l&&(d||h),g=c.get(e);x.set(e,{element:e,collapsed:f,currentMinWidth:null!=(o=null==g?void 0:g.width)?o:n.currentMinWidth,currentMaxWidth:null!=(s=null==g?void 0:g.width)?s:n.currentMaxWidth,flex:null!=(p=null!=(u=null==g?void 0:g.flex)?u:n.flex)?p:1}),j-=f?a.AA:r-a.AA}const v=[];for(const e of n){const n=x.get(e);n&&v.push(n)}for(const t of e)t({expandedElement:l||n[n.length-1]||null,panes:v,resizing:d})}}function je(e){const{documentId:n,documentType:t,flex:r}
1=e,{collapsed:l}=(0,a.ec)(),{closeInspector:c,inspector:d}=(0,a.Z3)(),{features:u}=(0,a.xu)(),p=(0,o.useCallback)((()=>{d&&c(d.name)}),[c,d]);if(l||!d)return null;const h=(0,o.createElement)(d.component,{onClose:p,documentId:n,documentType:t});return u.resizablePanes?(0,i.jsx)(a.ez,{as:"aside","data-ui":"DocumentInspectorPanel",flex:r,maxWidth:a.zY,minWidth:a.VQ,children:h}):(0,i.jsx)(s.xu,{as:"aside","data-ui":"DocumentInspectorPanel",flex:r,children:h})}var ve=Object.defineProperty,ye=(e,n,t)=>(((e,n,t)=>{n in e?ve(e,n,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[n]=t})(e,"symbol"!==typeof n?n+"":n,t),t);class be extends Error{constructor(e){let{message:n,context:t,helpId:i,cause:o}=e;super(n),ye(this,"cause"),ye(this,"context"),ye(this,"helpId"),this.context=t,this.helpId=i,this.cause=o}}const we=new WeakMap;function _e(e){const n=we.get(e);if(n)return n;const t=(0,v.x0)();return we.set(e,t),t}const Pe=new WeakMap;function Ie(e,n){const t=Pe.get(e)||new Map;if(t){const e=t.get(n);if(e)return e}const i=e[n];if("function"!==typeof i)throw new Error("Expected property `".concat(n,"` to be a function but got ").concat(typeof i," instead."));const o=i.bind(e);return t.set(n,o),Pe.set(e,t),o}function Ce(e){const n=(e=>(n,t,i)=>{try{return e(n,t,i)}catch(o){if(o instanceof be)throw o;throw new be({message:"string"===typeof(null==o?void 0:o.message)?o.message:"",context:t,cause:o})}})((t=e(((e,t,i)=>{if(!e)throw new be({message:"Pane returned no child",context:t,helpId:"structure-item-returned-no-child"});return(o=e)&&"function"===typeof(null==o?void 0:o.then)||(0,c.b)(e)?(0,d.D)(e).pipe((0,w.w)((e=>n(e,t,i)))):(e=>!!(0,X.Uy$)(e)&&"function"===typeof e.serialize)(e)?n(e.serialize(t),t,i):"function"===typeof e?n(e(t.id,t),t,i):(0,u.of)(e);var o})),function(){return t(...arguments).pipe((0,y._)(1),(0,b.x)())}));var t;return n}const ke=(e,n)=>{const t=e.replace(/^__edit__/,""),{params:i,payload:o,structureContext:{resolveDocumentNode:s}}=n,{type:a,template:r}=i;if(!a)throw new Error("Document type for document with ID ".concat(t," was not provided in the router params."));let l=s({schemaType:a,documentId:t});return l=l.id("editor").title("Editor"),r&&(l=l.initialValueTemplate(r,o)),l.serialize()};const Se=e=>{const n={type:e.type,id:e.routerPaneSibling.id,params:e.routerPaneSibling.params||{},payload:e.routerPaneSibling.payload||null,flatIndex:e.flatIndex,groupIndex:e.groupIndex,siblingIndex:e.siblingIndex,path:e.path,paneNode:"resolvedMeta"===e.type?_e(e.paneNode):null};return"metaHash(".concat(JSON.stringify(n),")")};function ze(e){let{unresolvedPane:n,flattenedRouterPanes:t,parent:i,path:o,resolvePane:s,structureContext:a}=e;const[r,...l]=t,c=l[0],d={id:r.routerPaneSibling.id,splitIndex:r.siblingIndex,parent:i,path:[...o,r.routerPaneSibling.id],index:r.flatIndex,params:r.routerPaneSibling.params||{},payload:r.routerPaneSibling.payload,structureContext:a};try{return s(n,d,r.flatIndex).pipe((0,w.w)((e=>{const t={type:"resolvedMeta",...r,paneNode:e,path:d.path},p=l.map(((e,n)=>({type:"loading",path:[...d.path,...l.slice(n).map(((n,t)=>"[".concat(e.flatIndex+t,"]")))],paneNode:null,...e})));if(!l.length)return(0,u.of)([t]);let h;return h=(null==c?void 0:c.routerPaneSibling.id.startsWith("__edit__"))?ze({unresolvedPane:ke,flattenedRouterPanes:l,parent:i,path:d.path,resolvePane:s,structureContext:a}):r.groupIndex===(null==c?void 0:c.groupIndex)?ze({unresolvedPane:n,flattenedRouterPanes:l,parent:i,path:o,resolvePane:s,structureContext:a}):ze({unresolvedPane:"function"===typeof e.child?Ie(e,"child"):e.child,flattenedRouterPanes:l,parent:e,path:d.path,resolvePane:s,structureContext:a}),(0,f.z)((0,u.of)([t,...p]),h.pipe((0,_.U)((e=>[t,...e]))))})))}catch(p){if(p instanceof be&&(p.context&&console.warn("Pane resolution error at index ".concat(p.context.index).concat(p.context.splitIndex>0?" for split pane index ".concat(p.context.splitIndex):"",": ").concat(p.message).concat(p.helpId?" - see ".concat((0,q.h)(p.helpId)):""),p),"structure-item-returned-no-child"===p.helpId))return(0,u.of)([]);throw p}}function Ee(e){let{routerPanesStream:n,rootPaneNode:t,initialCacheState:i={cacheKeysByFlatIndex:[],flattenedRouterPanes:[],resolvedPaneCache:new Map,resolvePane:()=>m.C},structureContext:o}=e;const s=n.pipe((0,_.U)((e=>[[{id:"root"}],...e])),(0,_.U)((e=>{const n=e.flatMap(((e,n)=>e.map(((e,t)=>({routerPaneSibling:e,groupIndex:n,siblingIndex:t}))))).map(((e,n)=>({...e,flatIndex:n})));return n})),(0,P.O)([]),(0,I.e)((function(e,n){var t,i=!1;e.subscribe((0,C.x)(n,(function(e){var o=t;t=e,i&&n.next([o,e]),i=!0})))})),(0,_.U)((e=>{let[n,t]=e;for(let i=0;i<t.length;i++){const e=n[i],o=t[i];if(!Y()(e,o))return{flattenedRouterPanes:t,diffIndex:i}}return{flattenedRouterPanes:t,diffIndex:t.length}})),(0,Z.R)(((e,n)=>{const{cacheKeysByFlatIndex:t,resolvedPaneCache:i}=e,{flattenedRouterPanes:o,diffIndex:s}=n,a=t.slice(0,s+1),r=t.slice(s+1),l=new Set(a.flatMap((e=>Array.from(e)))),c=r.flatMap((e=>Array.from(e))).filter((e=>!l.has(e)));
1for(const d of c)i.delete(d);return{flattenedRouterPanes:o,cacheKeysByFlatIndex:t,resolvedPaneCache:i,resolvePane:Ce((e=>(n,o,s)=>{const a=n&&"".concat(_e(n),"-").concat(function(e){var n,t;return"contextHash(".concat(JSON.stringify({id:e.id,parentId:parent&&_e(parent),path:e.path,index:e.index,splitIndex:e.splitIndex,serializeOptionsIndex:null==(n=e.serializeOptions)?void 0:n.index,serializeOptionsPath:null==(t=e.serializeOptions)?void 0:t.path}),")")}(o)),r=a&&i.get(a);if(r)return r;const l=e(n,o,s);if(!a)return l;const c=t[s]||new Set;return c.add(a),t[s]=c,i.set(a,l),l}))}}),i),(0,w.w)((e=>{let{flattenedRouterPanes:n,resolvePane:i}=e;return ze({unresolvedPane:t,flattenedRouterPanes:n,parent:null,path:[],resolvePane:i,structureContext:o})})));return s.pipe((0,Z.R)(((e,n)=>n.map(((n,t)=>{const i=e[t];return i?"loading"!==n.type?n:i.routerPaneSibling.id===n.routerPaneSibling.id?i:n:n}))),[]),(0,D.x)(((e,n)=>{if(e.length!==n.length)return!1;for(let t=0;t<n.length;t++){const i=e[t],o=n[t];if(Se(i)!==Se(o))return!1}return!0})))}function Me(){const[e,n]=(0,o.useState)();if(e)throw e;const{structureContext:t,rootPaneNode:i}
1=(0,a.xu)(),[s,r]=(0,o.useState)({paneDataItems:[],resolvedPanes:[],routerPanes:[]}),l=function(){const e=(0,o.useMemo)((()=>new g.t(1)),[]),n=(0,o.useMemo)((()=>e.asObservable().pipe((0,_.U)((e=>(null==e?void 0:e.panes)||[])))),[e]),{state:t}=(0,J.tv)();return(0,o.useEffect)((()=>{e.next(t)}),[t,e]),n}();return(0,o.useEffect)((()=>{const e=Ee({rootPaneNode:i,routerPanesStream:l,structureContext:t}).pipe((0,_.U)((e=>{const n=e.reduce(((e,n)=>{const t=e[n.groupIndex]||[];return t[n.siblingIndex]=n.routerPaneSibling,e[n.groupIndex]=t,e}),[]),t=n.length,i=e.map((i=>{var o;const{groupIndex:s,flatIndex:r,siblingIndex:l,routerPaneSibling:c,path:d}=i,u=c.id,p=n[s+1];return{active:s===t-2,childItemId:null!=(o=null==p?void 0:p[0].id)?o:null,index:r,itemId:c.id,groupIndex:s,key:"".concat("loading"===i.type?"unknown":i.paneNode.id,"-").concat(u,"-").concat(l),pane:"loading"===i.type?a.PF:i.paneNode,params:c.params||{},path:d.join(";"),payload:c.payload,selected:r===e.length-1,siblingIndex:l}}));return{paneDataItems:i,routerPanes:n,resolvedPanes:i.map((e=>e.pane))}}))).subscribe({next:e=>r(e),error:e=>n(e)});return()=>e.unsubscribe()}),[i,l,t]),s}const Le={},Te=(0,o.memo)((function(){const{navigate:e}=(0,J.tv)(),n=(0,J.z)((0,o.useCallback)((e=>{const n="string"===typeof e.intent?e.intent:void 0;return n?{intent:n,params:(0,X.Uy$)(e.params)?e.params:Le,payload:e.payload}:void 0}),[])),{rootPaneNode:t,structureContext:i}=(0,a.xu)(),s=(0,X.H__)(),[r,c]=(0,o.useState)(null);if(r)throw r;return(0,o.useEffect)((()=>{if(n){const{intent:o,params:a,payload:r}=n;let d=!1;async function u(){const{id:n,type:c}=await async function(e,n,t){if(n&&t)return{id:n,type:t};if(!n&&t)return{id:(0,G.Z)(),type:t};if(n&&!t)return{id:n,type:await x(e.resolveTypeForDocument(n))};throw new be({message:"Neither document `id` or `type` was provided when trying to resolve intent."})}(s,"string"===typeof a.id?a.id:void 0,"string"===typeof a.type?a.type:void 0);if(d)return;const u=await async function(e){const n=new Map,t=Ce((e=>(t,i,o)=>{const s=t&&"".concat(_e(t),"-").concat(i.path.join("__")),a=s&&n.get(s);if(a)return a;const r=e(t,i,o);return s&&n.set(s,r),r})),i=[[{id:"__edit__".concat(e.params.id),params:{...l()(e.params,["id"]),type:e.params.type},payload:e.payload}]],o=await async function e(n){let{currentId:i,flatIndex:o,intent:s,params:a,parent:r,path:l,payload:c,unresolvedPane:d,levelIndex:u,structureContext:p}=n;var h;if(!d)return[];const{id:f,type:m,...g}=a,j={id:i,splitIndex:0,parent:r,path:l,index:o,params:{},payload:void 0,structureContext:p},v=await x(t(d,j,o));return"document"===v.type&&v.id===f?[{panes:[...l.slice(0,l.length-1).map((e=>[{id:e}])),[{id:f,params:g,payload:c}]],depthIndex:l.length,levelIndex:u}]:(null==(h=v.canHandleIntent)?void 0:h.call(v,s,a,{pane:v,index:o}))||"documentList"===v.type&&v.schemaTypeName===m&&"_type == $type"===v.options.filter?[{panes:[...l.map((e=>[{id:e}])),[{id:a.id,params:g,payload:c}]],depthIndex:l.length,levelIndex:u}]:"list"===v.type&&v.child&&v.items?(await Promise.all(v.items.map(((n,t)=>"divider"===n.type?Promise.resolve([]):e({currentId:n._id||n.id,flatIndex:o+1,intent:s,params:a,parent:v,path:[...l,n.id],payload:c,unresolvedPane:"function"===typeof v.child?Ie(v,"child"):v.child,levelIndex:t,structureContext:p}))))).flat():[]}({currentId:"root",flatIndex:0,levelIndex:0,intent:e.intent,params:e.params,parent:null,path:[],payload:e.payload,unresolvedPane:e.rootPaneNode,structureContext:e.structureContext}),s=o.sort(((e,n)=>e.depthIndex===n.depthIndex?e.levelIndex-n.levelIndex:e.depthIndex-n.depthIndex))[0];return s?s.panes:i}({intent:o,params:{...a,id:n,type:c},payload:r,rootPaneNode:t,structureContext:i});d||e({panes:u},{replace:!0})}return u().catch(c),()=>{d=!0}}}),[s,n,e,t,i]),null})),Re=Q.ZP.span(k||(k=de(["\n &:not(:last-child)::after {\n content: ' \u279d ';\n opacity: 0.5;\n }\n"])));function Oe(e){return e.replace(/\(\.\.\.\)\./g,"(...)\n .").replace(/__WEBPACK_IMPORTED_MODULE_\d+_+/g,"").replace(/___default\./g,".").replace(new RegExp(" \\(https?:\\/\\/".concat(window.location.host),"g")," (")}function We(e){let{error:n}=e;if(!(n instanceof be))throw n;const{cause:t}=n,r=(null==t?void 0:t.stack)||n.stack,l=r&&!(t instanceof a.zc)&&!n.message.includes("Module build failed:"),c=t instanceof a.zc?t.path:[],d=t instanceof a.zc&&t.helpId||n.helpId,u=(0,o.useCallback)((()=>{window.location.reload()}),[]);return(0,i.jsx)(s.Zb,{height:"fill",overflow:"auto",padding:4,sizing:"border",tone:"critical",children:(0,i.jsxs)(s.W2,{children:[(0,i.jsx)(s.X6,{as:"h2",children:"Encountered an error while reading structure"}),(0,i.jsxs)(s.Zb,{marginTop:4,padding:4,radius:2,overflow:"auto",shadow:1,tone:"inherit",children:[c.length>0&&(0,i.jsxs)(s.Kq,{space:2,children:[(0,i.jsx)(s.__,{children:"Structure path"}),(0,i.jsx)(s.EK,{children:c.slice(1).map(((e,n)=>(0,i.jsx)(Re,{children:e},"".concat(e,"-").concat(n))))})]}),(0,i.jsxs)(s.Kq,{marginTop:4,space:2,children:[(0,i.jsx)(s.__,{children:"Error"}),(0,i.jsx)(s.EK,{children:l?Oe(r):n.message})]}),d&&(0,i.jsx)(s.xu,{marginTop:4,children:(0,i.jsx)(s.xv,{children:(0,i.jsx)("a",{href:(0,q.h)(d),rel:"noopener noreferrer",target:"_blank",children:"View documentation"})})}),(0,i.jsx)(s.xu,{marginTop:4,children:(0,i.jsx)(s.zx,{text:"Reload",icon:ee.b
1nu,tone:"primary",onClick:u})})]})]})})}function Fe(e){const{isSelected:n,pane:t,paneKey:o}=e,r=(0,X.Uy$)(t)&&t.type||null;return(0,i.jsxs)(a.X6,{id:o,selected:n,children:[(0,i.jsx)(a.hX,{title:"Unknown pane type"}),(0,i.jsx)(a.Bh,{children:(0,i.jsx)(s.xu,{padding:4,children:"string"===typeof r?(0,i.jsxs)(s.xv,{as:"p",muted:!0,children:["Structure item of type ",(0,i.jsx)("code",{children:r})," is not a known entity."]}):(0,i.jsxs)(s.xv,{as:"p",muted:!0,children:["Structure item is missing required ",(0,i.jsx)("code",{children:"type"})," property."]})})})]})}function Be(e){const n=[{ms:300,message:"Loading\u2026"},{ms:5e3,message:"Still loading\u2026"}];if(X.r8Q){const t=["Check console for errors?","Is your observable/promise resolving?",e.length>0?"Structure path: ".concat(e.join(" \u279d ")):""];n.push({ms:1e4,message:t.join("\n")})}const t=(0,u.of)(null);return(0,j.T)(...n.map((e=>{let{ms:n,message:i}=e;return t.pipe((0,A.h)(i),(0,U.g)(n))})))}const Ke=(0,Q.ZP)(s.kC)(S||(S=de(["\n opacity: 0;\n transition: opacity 200ms;\n\n &[data-mounted] {\n opacity: 1;\n }\n"]))),Ne=(0,o.memo)((e=>{const{delay:n=300,flex:t,message:r=Be,minWidth:l,paneKey:c,path:d,selected:u,title:p,tone:h}=e,x=(0,o.useMemo)((()=>"function"===typeof r?r(d?d.split(";"):[]):r),[r,d]),[f,m]=(0,o.useState)((()=>"string"===typeof x?x:"Loading\u2026"));(0,o.useEffect)((()=>{if("object"!==typeof x)return;if("function"===typeof x.subscribe)return;const e=x.subscribe(m);return()=>e.unsubscribe()}),[x]);const[g,j]=(0,o.useState)(null),[v,y]=(0,o.useState)(!1);(0,o.useEffect)((()=>{if(g)return(0,s.RE)((()=>y(!0)))}),[g]);const b=(0,i.jsxs)(Ke,{align:"center","data-mounted":v?"":void 0,direction:"column",height:"fill",justify:"center",ref:j,children:[(0,i.jsx)(s.$j,{muted:!0}),(p||f)&&(0,i.jsx)(s.xu,{marginTop:3,children:(0,i.jsx)(s.xv,{align:"center",muted:!0,size:1,children:p||f})})]});return(0,i.jsx)(a.X6,{flex:t,id:c,minWidth:l,selected:u,tone:h,children:(0,i.jsx)(a.Bh,{children:b})})}));Ne.displayName="LoadingPane";const Ze={component:(0,o.lazy)((()=>t.e(194).then(t.bind(t,91194)))),document:(0,o.lazy)((()=>t.e(354).then(t.bind(t,24354)))),documentList:(0,o.lazy)((()=>t.e(877).then(t.bind(t,22877)))),list:(0,o.lazy)((()=>t.e(792).then(t.bind(t,24792))))},De=(0,o.memo)((function(e){const{active:n,childItemId:t,groupIndex:s,index:a,itemId:r,pane:l,paneKey:c,params:d,payload:u,path:p,selected:h,siblingIndex:x}=e,f=Ze[l.type]||Fe;return(0,i.jsx)(xe,{flatIndex:a,index:s,params:d,payload:u,siblingIndex:x,children:(0,i.jsx)(o.Suspense,{fallback:(0,i.jsx)(Ne,{paneKey:c,path:p,selected:h}),children:(0,i.jsx)(f,{childItemId:t||"",index:a,itemId:r,isActive:n,isSelected:h,paneKey:c,pane:l})})})}),((e,n)=>{let{params:t={},payload:i=null,...o}=e,{params:s={},payload:a=null,...r}=n;if(!Y()(t,s))return!1;if(!Y()(i,a))return!1;const l=new Set([...Object.keys(o),...Object.keys(r)]);for(const c of l)if(o[c]!==r[c])return!1;return!0}));function Ae(e){const{children:n,currentMinWidth:t,flex:o,minWidth:r,paneKey:l,title:c="Error",tone:d="critical"}=e;return(0,i.jsxs)(a.X6,{currentMinWidth:t,flex:o,id:l,minWidth:r,tone:d,children:[(0,i.jsx)(a.hX,{title:c}),(0,i.jsx)(a.Bh,{overflow:"auto",children:(0,i.jsx)(s.xu,{paddingX:4,paddingY:5,children:n})})]})}function Ue(e){return"publish"===e?"The document was published":"unpublish"===e?"The document was unpublished. A draft has been created from the latest published version.":"discardChanges"===e?"All changes since last publish has now been discarded. The discarded draft can still be recovered from history":"delete"===e?"The document was successfully deleted":"Successfully performed ".concat(e," on document")}const Ve=["patch","commit"],He=(0,o.memo)((function(){const{push:e}=(0,s.pm)(),{documentId:n,documentType:t}=(0,a.Z3)(),r=(0,X.E6V)(n,t),l=(0,o.useRef)(r);return(0,o.useEffect)((()=>{var n;r&&r!==l.current&&("error"===r.type&&e({closable:!0,duration:3e4,status:"error",title:(n=r.op,"delete"===n?"An error occurred while attempting to delete this document.\n This usually means that there are other documents that refers to it.":"unpublish"===n?"An error occurred while attempting to unpublish this document.\n This usually means that there are other documents that refers to it.":"An error occurred during ".concat(n)),description:(0,i.jsxs)("details",{children:[(0,i.jsx)("summary",{children:"Details"}),r.error.message]})}),"success"!==r.type||Ve.includes(r.op)||e({closable:!0,status:"success",title:Ue(r.op)}),l.current=r)}),[r,e]),null}));function Xe(e,n,t){const i=(0,X.F2f)(),[s,a]=(0,o.useState)(t),r=(0,o.useMemo)((()=>i.forNamespace("desk-tool")),[i]),l=(0,o.useMemo)((()=>e?r.forNamespace(e).forKey(n):r.forKey(n)),[r,e,n]);(0,o.useEffect)((()=>{const e=l.listen(t).subscribe({next:a});return()=>null==e?void 0:e.unsubscribe()}),[t,n,e,l]);const c=(0,o.useCallback)((e=>{a(e),l.set(e)}),[l]);return(0,o.useMemo)((()=>[s,c]),[c,s])}const qe={id:"parsed",title:"Parsed"},$e={id:"raw",title:"Raw JSON"},Ye=[qe,$e],Je=le()(1e3);function Ge(e,n){const t=Je.get(e);return void 0===t?(Je.set(e,Array.isArray(n)||(0,X.Uy$)(n)),Ge(e,n)):t}function Qe(e){const{path:n}=e,t=Je.get(n);void 0!==t&&Je.set(n,!t)}function en(e){const n=window.getSelection();if(n){const t=document.createRange();n.removeAllRanges(),t.selectNodeContents(e),n.addRange(t)}
1}function nn(e){en(e.currentTarget)}function tn(e){65===e.keyCode&&(e.metaKey||e.ctrlKey)&&(e.preventDefault(),en(e.currentTarget))}function on(e){return(0,X.Uy$)(e)&&(0,X.HD0)(e._id)&&(0,X.HD0)(e._type)}const sn=Q.ZP.div((e=>{let{theme:n}=e;const{color:t,fonts:i,space:o}=n.sanity;return(0,Q.iv)(z||(z=de(["\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: '\u25b8 ';\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: '\u25be ';\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: '\u2194';\n }\n\n & .json-inspector .json-inspector__show-original:hover::after {\n content: ' expand';\n }\n "])),i.code.family,i.code.sizes[2].fontSize,i.code.sizes[2].lineHeight,(0,s.hO)(o[4]),(0,s.hO)(o[3]),(0,s.hO)(o[4]),i.code.sizes[2].fontSize,i.code.sizes[2].lineHeight,i.code.sizes[2].fontSize,i.code.sizes[2].lineHeight,(0,s.hO)(o[4]/2),t.syntax.property,t.syntax.constant,(0,s.hO)(o[3]),t.syntax.string,t.syntax.boolean,t.syntax.number)}));function an(e){const{onChange:n,query:t}=e,a=(0,o.useCallback)((e=>n(e.target.value)),[n]);return(0,i.jsx)(s.oi,{icon:ee.W1M,onChange:a,placeholder:"Search",radius:2,value:t||""})}function rn(e){const{value:n}=e,{onInspectClose:t,paneKey:r}=(0,a.Z3)(),l="".concat(r,"_inspect_"),[c,d]=Xe("desk-tool","inspect-view-preferred-view-mode-".concat(r),"parsed"),u=Ye.find((e=>e.id===c)),p=(0,o.useCallback)((()=>{d(qe.id)}),[d]),h=(0,o.useCallback)((()=>{d($e.id)}),[d]);return(0,i.jsx)(s.Vq,{id:"".concat(l,"dialog"),header:on(n)?(0,i.jsxs)(i.Fragment,{children:["Inspecting"," ",(0,i.jsx)("em",{children:(0,i.jsx)(a.lU,{document:n})})]}):(0,i.jsx)("em",{children:"No value"}),onClose:t,onClickOutside:t,width:3,children:(0,i.jsxs)(s.kC,{direction:"column",height:"fill",children:[(0,i.jsx)(s.Zb,{padding:3,shadow:1,style:{position:"sticky",bottom:0,zIndex:3},children:(0,i.jsxs)(s.td,{space:1,children:[(0,i.jsx)(s.OK,{"aria-controls":"".concat(l,"tabpanel"),fontSize:1,id:"".concat(l,"tab-").concat(qe.id),label:qe.title,onClick:p,selected:u===qe}),(0,i.jsx)(s.OK,{"aria-controls":"".concat(l,"tabpanel"),fontSize:1,id:"".concat(l,"tab-").concat($e.id),label:$e.title,onClick:h,selected:u===$e})]})}),(0,i.jsxs)(s.x4,{"aria-labelledby":"".concat(l,"tab-").concat(c),flex:1,id:"".concat(l,"tabpanel"),overflow:"auto",padding:4,style:{outline:"none"},children:[u===qe&&(0,i.jsx)(sn,{children:(0,i.jsx)(ae(),{data:n,isExpanded:Ge,onClick:Qe,search:an})}),u===$e&&(0,i.jsx)(s.EK,{language:"json",tabIndex:0,onKeyDown:tn,onDoubleClick:nn,onFocus:nn,children:JSON.stringify(n,null,2)})]})]})})}const ln=(0,Q.ZP)(s.Zb)(E||(E=de(["\n position: relative;\n z-index: 50;\n"]))),cn=(0,Q.ZP)(s.xv)(M||(M=de(["\n & > * {\n overflow: hidden;\n overflow: clip;\n white-space: nowrap;\n text-overflow: ellipsis;\n }\n"]))),dn=(0,o.memo)((()=>{var e,n,t,r,l,c;const d=(0,X.rq_)(),{params:p,groupIndex:h,routerPanesState:x,replaceCurrent:m,BackLink:g}=(0,a.RL)(),j=null==(e=x[h])?void 0:e[0].id,v=x[h-1],y=null==v?void 0:v[0],b=null==y?void 0:y.id,w=Boolean(null==(n=null==y?void 0:y.params)?void 0:n.rev),P=(0,o.useMemo)((()=>(null==p?void 0:p.parentRefPath)&&(0,ie.mL)(p.parentRefPath)||null),[null==p?void 0:p.parentRefPath]),I=(0,oe.m2)((()=>{const e=null==P?void 0:P[0];if(!b||!e||!P)return(0,u.of)({loading:!1});const n=(0,X.vsM)(b),t=(0,ie.mL)(e),i=t.findIndex((e=>"object"==typeof e&&"_key"in e));return(0,f.z)((0,u.of)({loading:!0}),d.unstable_observePathsDocumentPair(n,-1===i?t:t.slice(0,i)).pipe((0,V.b)(750),(0,_.U)((e=>{let{draft:n,published:t}=e;var i;return{loading:!1,result:{availability:{draft:n.availability,published:t.availability},refValue:null==(i=(0,ie.U2)(n.snapshot||t.snapshot,P))?void 0:i._ref}}}))))}),[d,b,P],{loading:!0}),C=(0,o.useCallback)((()=>{var e;I.loading||(null==(e=I.result)?void 0:e.refValue)&&m({id:I.result.refValue,params:p})}),[I.loading,I.result,m,p]);return!b||!P||w||I.loading||!(null==(t=I.result)?void 0:t.availability.draft.available)&&!(null==(r=I.result)?void 0:r.availability.published.available)||(null==(l=I.result)?void 0:l.refValue)===j?null:(0,i.jsx)(ln,{shadow:1,tone:"caution","data-testid":"reference-changed-banner",children:(0,i.jsx)(s.W2,{paddingX:4,paddingY:2,sizing:"border",width:1,children:(0,i.jsxs)(s.kC,{align:"center",children:[(0,i.jsx)(s.xv,{size:1,children:(0,i.jsx)(ee.foC,{})}),(null==(c=I.result)?void 0:c.refValue)?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(s.xu,{flex:1,marginLeft:3,children:(0,i.jsx)(cn,{title:"This reference has changed since you opened it.",size:1,children:"This reference has changed since you opened it."})}),(0,i.jsx)(s.xu,{marginLeft:3,children:(0,i.jsx)(s.zx,{onClick:C,icon:ee.b
1nu,fontSize:1,mode:"ghost",padding:2,space:2,text:"Reload reference"})})]}):(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(s.xu,{flex:1,marginLeft:3,children:(0,i.jsx)(cn,{title:"This reference has been removed since you opened it.",size:1,children:"This reference has been removed since you opened it."})}),(0,i.jsx)(s.xu,{marginLeft:3,children:(0,i.jsx)(s.zx,{as:g,icon:ee.Two,fontSize:1,mode:"ghost",padding:2,space:2,text:"Close reference"})})]})]})})})}));dn.displayName="ReferenceChangedBanner";const un=(0,Q.ZP)(s.Zb)(L||(L=de(["\n position: relative;\n z-index: 50;\n"])));function pn(e){let{granted:n,requiredPermission:t}=e;var o,a;const r=(0,X.xJ)(),l=1!==(null==(o=null==r?void 0:r.roles)?void 0:o.length),c=(d=(null==(a=null==r?void 0:r.roles)?void 0:a.map((e=>(0,i.jsx)("code",{children:e.title},e.name))))||[],u=", ",d.reduce(((e,n)=>null===e?[n]:e.concat([u,n])),null));var d,u;return n?null:(0,i.jsx)(un,{"data-testid":"permission-check-banner",shadow:1,tone:"transparent",children:(0,i.jsx)(s.W2,{paddingX:4,paddingY:3,sizing:"border",width:1,children:(0,i.jsxs)(s.kC,{align:"flex-start",children:[(0,i.jsx)(s.xv,{size:1,children:(0,i.jsx)(ee.CPA,{})}),(0,i.jsx)(s.xu,{flex:1,marginLeft:3,children:(0,i.jsxs)(s.xv,{size:1,children:["Your role",l&&"s"," ",c," ",l?"do":"does"," not have permissions to"," ",t," this document."]})})]})})})}function hn(e){const n=(0,s.pm)(),t=function(e){const n=(0,o.useRef)();return(0,o.useEffect)((()=>{n.current=e}),[e]),n.current}(e.enabled);(0,o.useEffect)((()=>{!t&&e.enabled&&n.push({...e,duration:20736e5}),t&&!e.enabled&&n.push({...e,duration:.01})}),[e,n,t])}const xn=e=>e.preventDefault();function fn(e){var n;const{hidden:t,margins:r}=e,{collapsedFieldSets:l,collapsedPaths:c,displayed:d,editState:u,documentId:p,documentType:h,fieldActions:x,onChange:f,validation:m,ready:g,formState:j,onFocus:v,onBlur:y,onSetCollapsedPath:b,onPathOpen:w,onSetCollapsedFieldSet:_,onSetActiveFieldGroup:P}=(0,a.Z3)(),I=(0,X.H__)(),C=(0,X.Dqo)(p),k=(0,o.useMemo)((()=>(0,X.fm0)()),[]),S=null==(n=null==u?void 0:u.transactionSyncLock)?void 0:n.enabled;hn({id:"sync-lock-".concat(p),status:"warning",enabled:S,title:"Syncing document\u2026",description:"Please hold tight while the document is synced. This usually happens right after the document has been published, and it shouldn't take more than a few seconds"}),(0,o.useEffect)((()=>{const e=I.pair.documentEvents(p,h).pipe((0,H.b)((e=>{"mutation"===e.type&&k.publish(function(e){const n=e.mutations.map((e=>e.patch)).filter(Boolean);return{type:"mutation",snapshot:e.document,patches:(0,X.Sis)(e.origin,n)}}(e)),"rebase"===e.type&&k.publish(function(e){const n=e.remoteMutations.map((e=>e.patch)).filter(Boolean),t=e.localMutations.map((e=>e.patch)).filter(Boolean);return{type:"rebase",snapshot:e.document,patches:(0,X.Sis)("remote",n).concat((0,X.Sis)("local",t))}}(e))}))).subscribe();return()=>{e.unsubscribe()}}),[p,I,h,k]);const z=Boolean(null==d?void 0:d._rev);(0,o.useEffect)((()=>{z&&k.publish({type:"mutation",patches:[],snapshot:d})}),[z]);const E=(0,o.useRef)(null);return(0,o.useEffect)((()=>{g&&!(null==j?void 0:j.focusPath.length)&&(0,s.fo)(E.current)}),[g]),(0,i.jsx)(s.W2,{hidden:t,paddingX:4,paddingTop:5,paddingBottom:9,sizing:"border",width:1,children:(0,i.jsx)(X.$rW,{margins:r,children:(0,i.jsx)(s.xu,{as:"form",onSubmit:xn,ref:E,children:g?null===j?(0,i.jsx)(s.xu,{padding:2,children:(0,i.jsx)(s.xv,{children:"This form is hidden"})}):(0,i.jsx)(X.quP,{__internal_fieldActions:x,__internal_patchChannel:k,collapsedFieldSets:l,collapsedPaths:c,focusPath:j.focusPath,changed:j.changed,focused:j.focused,groups:j.groups,id:"root",members:j.members,onChange:f,onFieldGroupSelect:P,onPathBlur:y,onPathFocus:v,onPathOpen:w,onSetFieldSetCollapsed:_,onSetPathCollapsed:b,presence:C,readOnly:j.readOnly,schemaType:j.schemaType,validation:m,value:j.value}):(0,i.jsx)(a.cN,{ms:300,children:(0,i.jsxs)(s.kC,{align:"center",direction:"column",height:"fill",justify:"center",children:[(0,i.jsx)(s.$j,{muted:!0}),(0,i.jsx)(s.xu,{marginTop:3,children:(0,i.jsx)(s.xv,{align:"center",muted:!0,size:1,children:"Loading document"})})]})})})})})}function mn(){const{activeViewId:e,paneKey:n,views:t}=(0,a.Z3)(),o="".concat(n,"tabpanel");return(0,i.jsx)(s.td,{space:1,children:t.map(((t,s)=>{var a;return(0,i.jsx)(gn,{icon:t.icon,id:"".concat(n,"tab-").concat(t.id),isActive:e===t.id,label:(0,i.jsx)(i.Fragment,{children:t.title}),tabPanelId:o,viewId:0===s?null:null!=(a=t.id)?a:null},t.id)}))})}function gn(e){const{isActive:n,tabPanelId:t,viewId:r}=e,{ready:l}=(0,a.Z3)(),{setView:c}=(0,a.RL)(),d=(0,o.useCallback)((()=>c(r)),[c,r]);return(0,i.jsx)(s.OK,{...e,"aria-controls":t,disabled:!l,fontSize:1,selected:n,onClick:d})}function jn(){const{connectionState:e,schemaType:n,title:t,value:o}=(0,a.Z3)(),s=Boolean(o)&&"connected"===e,{error:r,value:l}=(0,X._2T)({enabled:s,schemaType:n,value:o});return"connected"!==e?(0,i.jsx)(i.Fragment,{}):t?(0,i.jsx)(i.Fragment,{children:t}):o?r?(0,i.jsxs)(i.Fragment,{children:["Error: ",r.message]}):(0,i.jsx)(i.Fragment,{children:(null==l?void 0:l.title)||(0,i.jsx)("span",{style:{color:"var(--card-muted-fg-color)"},children:"Untitled"})}):(0,i.jsxs)(i.Fragment,{children:["New ",(null==n?void 0:n.title)||(null==n?void 0:n.name)]})}const vn=(0,o.memo)((0,o.forwardRef)((function(e,n){const{onMenuAction:t,onPaneClose:r,onPaneSplit:l,menuItems:c,menuItemGroups:d,schemaType:u,timelineStore:p,ready:h,views:x,unstable_languageFilter:f}=(0,a.Z3)(),{features:m}=(0,a.xu)(),{index:g,BackLink:j,hasGroupSiblings:v}=(0,a.RL)(),{actions:y}=(0,X.qGk)(),b=(0,o.useMemo)((()=>(0,a.k$)({actionHandler:t,fieldActions:y,menuItems:c,menuItemGroups:d})),[t,y,d,c]),w=(0,o.useMemo)((()=>b.filter(a.Ie)),[b]),_=(0,o.useMemo)((()=>b.filter(a.c9)),[b]),P=x.length>1,I=(0,X.P08)(p,(e=>e.revTime)),{collapsed:C,isLast:k}=(0,a.ec)(),S=k&&!C?-1:0,z=m.splitViews&&l&&x.length>1,E=z&&v,M=!E&&!m.backButton;return(0,i.jsx)(a.hX,{ref:n,loading:!h,title:(0,i.jsx)(jn,{}),tabs:P&&(0,i.jsx)(mn,{}),tabIndex:S,backButton:m.backButton&&g>0&&(0,i.jsx)(s.zx,{as:j,"data-as":"a",icon:ee.Y4O,mode:"bleed",padding:2}),subActions:(0,i.jsx)(a.Hj,{chunk:I,mode:"rev",placement:"bottom-end"}),actions:(0,i.jsxs)(s.kC,{align:"center",gap:1,children:[f.length>0&&(0,i.jsx)(i.Fragment,{children:f.map(((e,n)=>(0,o.createElement)(e,{key:"language-filter-".concat(n),schemaType:u})))}),w.map((e=>(0,i.jsx)(a.mE,{node:e},e.key))),(0,i.jsx)(a.eu,{nodes:_},"context-menu"),z&&(0,i.jsx)(s.u,{content:(0,i.jsx)(s.xv,{size:1,style:{whiteSpace:"nowrap"},children:"Split pane right"}),padding:2,placement:"bottom",portal:!0,children:(0,i.jsx)(s.zx,{"aria-label":"Split pane right",icon:ee.iro,mode:"bleed",onClick:l},"split-pane-button")}),E&&(0,i.jsx)(s.zx,{icon:ee.Two,mode:"bleed",onClick:r,title:"Close split pane"},"close-view-button"),M&&(0,i.jsx)(s.zx,{icon:ee.Two,mode:"bleed",title:"Close pane group",as:j},"close-view-button")]})})}))),yn=(0,Q.ZP)(s.xu)({position:"relative"}),bn=(0,Q.ZP)(X.l$t)((e=>{let{$disabled:n}=e;return n?{height:"100%"}:(0,Q.iv)(T||(T=de(["\n height: 100%;\n overflow: auto;\n position: relative;\n scroll-behavior: smooth;\n outline: none;\n "])))})),wn=function(e){const{footerHeight:n,isInspectOpen:t,rootElement:r,setDocumentPanelPortalElement:l}=e,{activeViewId:c,displayed:d,documentId:u,editState:p,inspector:h,value:x,views:f,ready:m,schemaType:g,permissions:j,isPermissionsLoading:v}=(0,a.Z3)(),{collapsed:y}=(0,a.Cc)(),{collapsed:b}=(0,a.ec)(),w=(0,s.vI)(),{features:_}=(0,a.xu)(),[P,I]=(0,o.useState)(null),C=(0,s.XL)(P),k=(0,o.useRef)(null),[S,z]=(0,o.useState)(null),E=x._createdAt?"update":"create",M=(0,o.useMemo)((()=>f.find((e=>e.id===c))||f[0]||{type:"form"}),[c,f]),L=_.splitPanes&&k.current||w.element,T=(0,o.useMemo)((()=>y?[(null==C?void 0:C.height)||0,0,n?n+2:2,0]:[0,0,2,0]),[y,n,C]),R="form"!==M.type,O=(0,o.useMemo)((()=>"component"===M.type&&M.component&&(0,o.createElement)(M.component,{document:{draft:(null==p?void 0:p.draft)||null,displayed:d||x,historical:d,published:(null==p?void 0:p.published)||null},documentId:u,options:M.options,schemaType:g})),[M,d,u,null==p?void 0:p.draft,null==p?void 0:p.published,g,x]);(0,o.useEffect)((()=>{(null==S?void 0:S.scrollTo)&&S.scrollTo(0,0)}),[u,S]),(0,o.useEffect)((()=>{L&&l(L)}),[L,l]);const W=(0,o.useMemo)((()=>t?(0,i.jsx)(rn,{value:d||x}):null),[t,d,x]),F=Boolean(!b&&h);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(vn,{ref:I}),(0,i.jsx)(a.Bh,{children:(0,i.jsxs)(s.kC,{height:"fill",children:[(_.resizablePanes||!F)&&(0,i.jsx)(yn,{flex:2,overflow:"hidden",children:(0,i.jsx)(s.Xp,{element:L,__unstable_elements:{documentScrollElement:S},children:(0,i.jsx)(s.NM,{element:S,children:(0,i.jsxs)(X.Ahg,{scrollElement:S,children:["form"===M.type&&!v&&m&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(pn,{granted:Boolean(null==j?void 0:j.granted),requiredPermission:E}),(0,i.jsx)(dn,{})]}),(0,i.jsxs)(bn,{$disabled:y||!1,"data-testid":"document-panel-scroller",ref:z,children:[(0,i.jsx)(fn,{hidden:R,margins:T}
1,u+(m?"_ready":"_pending")),O]}),W,(0,i.jsx)("div",{"data-testid":"document-panel-portal",ref:k})]})})})}),F&&(0,i.jsx)(s.NM,{element:r,children:(0,i.jsx)(je,{documentId:u,documentType:g.name,flex:1})})]})})]})},_n=["left","bottom"],Pn={small:0,medium:1,large:2,full:"auto"};function In(e){const{dialog:n,referenceElement:t}=e;return(0,i.jsx)(s.J2,{content:(0,i.jsx)(Cn,{dialog:n}),fallbackPlacements:_n,open:!0,placement:"top",portal:!0,preventOverflow:!0,referenceElement:t})}function Cn(e){const{dialog:n}=e,{cancelButtonIcon:t,cancelButtonText:a,confirmButtonIcon:r,confirmButtonText:l,message:c,onCancel:d,onConfirm:u,tone:p}=n,{isTopLayer:h}=(0,s.sJ)(),[x,f]=(0,o.useState)(null),m=(0,o.useCallback)((()=>{h&&d()}),[h,d]),g=(0,o.useCallback)((e=>{"Escape"===e.key&&h&&d()}),[h,d]);return(0,s.O8)(m,[x]),(0,s.qh)(g),(0,i.jsxs)(s.kC,{direction:"column",ref:f,style:{minWidth:304,maxWidth:400},children:[(0,i.jsx)(s.xu,{flex:1,overflow:"auto",padding:4,children:(0,i.jsx)(s.xv,{children:c})}),(0,i.jsx)(s.xu,{paddingX:4,paddingY:3,style:{borderTop:"1px solid var(--card-border-color)"},children:(0,i.jsxs)(s.rj,{columns:2,gap:2,children:[(0,i.jsx)(s.zx,{icon:t,onClick:d,mode:"ghost",text:a||"Cancel"}),(0,i.jsx)(s.zx,{icon:r,onClick:u,text:l||"Confirm",tone:p})]})})]})}function kn(e){const{dialog:n}=e,t=(0,o.useId)(),a=n.footer&&(0,i.jsx)(s.xu,{paddingX:4,paddingY:3,children:n.footer});return(0,i.jsx)(X.jr5,{zOffset:"fullscreen",children:(0,i.jsx)(s.Vq,{__unstable_hideCloseButton:!1===n.showCloseButton,footer:a,header:n.header,id:t,onClose:n.onClose,onClickOutside:n.onClose,width:void 0===n.width?1:Pn[n.width],children:(0,i.jsx)(s.xu,{padding:4,children:n.content})})})}function Sn(e){const{dialog:n,referenceElement:t}=e;return(0,i.jsx)(s.J2,{content:(0,i.jsx)(zn,{dialog:n}),fallbackPlacements:_n,open:!0,placement:"top",portal:!0,preventOverflow:!0,referenceElement:t})}function zn(e){const{dialog:n}=e,{content:t,onClose:a}=n,{isTopLayer:r}=(0,s.sJ)(),[l,c]=(0,o.useState)(null),d=(0,o.useCallback)((()=>{r&&a()}),[r,a]),u=(0,o.useCallback)((e=>{"Escape"===e.key&&r&&a()}),[r,a]);return(0,s.O8)(d,[l]),(0,s.qh)(u),(0,i.jsx)("div",{ref:c,children:t})}function En(e){const{children:n}=e,{element:t,elements:o}=(0,s.vI)(),r=(null==o?void 0:o[a.BP])||t;return(0,i.jsx)(s.Xp,{element:r,children:n})}function Mn(e){const{dialog:n,referenceElement:t=null}=e,a=(0,o.useId)();if("confirm"===n.type)return(0,i.jsx)(In,{dialog:n,referenceElement:t});if("popover"===n.type)return(0,i.jsx)(Sn,{dialog:n,referenceElement:t});if("dialog"===n.type||!n.type)return(0,i.jsx)(En,{children:(0,i.jsx)(kn,{dialog:n})});if("custom"===n.type)return(0,i.jsx)(En,{children:null==n?void 0:n.component});const r=n;return console.warn("Unsupported modal type ".concat(r.type)),(0,i.jsx)(s.Vq,{id:a,onClose:r.onClose,onClickOutside:r.onClose,width:2,children:(0,i.jsx)(s.xu,{padding:4,children:r.content||(0,i.jsxs)(i.Fragment,{children:["Unexpected modal type (",(0,i.jsx)("code",{children:r.type}),")"]})})})}function Ln(e){const{actionStates:n,disabled:t}=e,a=(0,o.useId)(),r=(0,o.useRef)(null),[l,c]=(0,o.useState)(-1),[d,u]=(0,o.useState)(null),p=(0,o.useCallback)((e=>{c(e)}),[]),h=(0,o.useMemo)((()=>({placement:"top-end",portal:!0,preventOverflow:!0})),[]),x=n[l];return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(s.j2,{id:"".concat(a,"-action-menu"),button:(0,i.jsx)(s.zx,{"data-testid":"action-menu-button","aria-label":"Open document actions",disabled:t,icon:ee.v4q,mode:"ghost",ref:r}),menu:(0,i.jsx)(s.v2,{padding:1,children:n.map(((e,n)=>(0,i.jsx)(Tn,{actionState:e,disabled:t,index:n,onAction:p},n)))}),popover:h,ref:u}),x&&x.dialog&&(0,i.jsx)(X.jr5,{zOffset:"paneFooter",children:(0,i.jsx)(Mn,{dialog:x.dialog,referenceElement:d})})]})}function Tn(e){const{actionState:n,disabled:t,index:a,onAction:r}=e,{onHandle:l}=n,c=(0,o.useCallback)((()=>{r(a),l&&l()}),[a,r,l]),d=n.title&&(0,i.jsx)(s.xu,{padding:2,children:(0,i.jsx)(s.xv,{size:1,children:n.title})});return(0,i.jsx)(s.sN,{"data-testid":"action-".concat(n.label.replace(" ","")),disabled:t||Boolean(n.disabled),onClick:c,padding:0,tone:n.tone,children:(0,i.jsx)(s.u,{content:d,disabled:!d,fallbackPlacements:["left","bottom"],placement:"top",portal:!0,children:(0,i.jsxs)(s.kC,{align:"center",paddingX:3,children:[(0,i.jsxs)(s.kC,{flex:1,paddingY:3,children:[n.icon&&(0,i.jsx)(s.xu,{marginRight:3,children:(0,i.jsxs)(s.xv,{children:[(0,o.isValidElement)(n.icon)&&n.icon,(0,ne.isValidElementType)(n.icon)&&(0,o.createElement)(n.icon)]})}),(0,i.jsx)(s.xv,{children:n.label})]}),n.shortcut&&(0,i.jsx)(s.xu,{marginLeft:3,children:(0,i.jsx)(s.p8,{keys:String(n.shortcut).split("+").map((e=>e.slice(0,1).toUpperCase()+e.slice(1)))})})]})})})}function Rn(e){const{disabled:n,showMenu:t,states:a}=e,[r,...l]=a,[c,d]=(0,o.useState)(null),u=(0,o.useMemo)((()=>r&&(r.title||r.shortcut)?(0,i.jsxs)(s.kC,{padding:2,style:{maxWidth:300},align:"center",children:[(0,i.jsx)(s.xv,{size:1,children:r.title}),r.shortcut&&(0,i.jsx)(s.xu,{marginLeft:r.title?2:0,children:(0,i.jsx)(s.p8,{keys:String(r.shortcut).split("+").map((e=>e.slice(0,1).toUpperCase()+e.slice(1).toLowerCase()))})})]}):null),[r]);return(0,i.jsxs)(s.kC,{children:[r&&(0,i.jsx)(s.li,{zOffset:200,children:(0,i.jsx)(s.u,{disabled:!u,content:u,portal:!0,placement:"top",children:(0,i.jsx)(s.Kq,{flex:1,children:(0,i.jsx)(s.zx,{"data-testid":"action-".concat(r.label),disabled:n||Boolean(r.disabled),icon:r.icon,onClick:r.onHandle,ref:d,text:r.label,tone:r.tone||"primary"})})})}),t&&l.length>0&&(0,i.jsx)(s.xu,{marginLeft:1,children:(0,i.jsx)(Ln,{actionStates:l,disabled:n})}),r&&r.dialog&&(0,i.jsx)(Mn,{dialog:r.dialog,referenceElement:c})]})}
1const On=(0,o.memo)((function(){const{actions:e,connectionState:n,documentId:t,editState:o}=(0,a.Z3)();return e&&o?(0,i.jsx)(ue,{actions:e,actionProps:o,children:o=>{let{states:s}=o;return(0,i.jsx)(Rn,{disabled:"connected"!==n,showMenu:e.length>1,states:s},t)}}):null})),Wn=(0,o.memo)((function(){const{connectionState:e,editState:n,timelineStore:t}=(0,a.Z3)(),s=(0,X.P08)(t,(e=>e.revTime)),r=(null==s?void 0:s.id)||"",l=((null==n?void 0:n.draft)||(null==n?void 0:n.published)||{})._rev===r,c=(0,o.useMemo)((()=>({...n||{},revision:r})),[n,r]),d=(0,o.useMemo)((()=>[a.Ty]),[]);return(0,i.jsx)(ue,{actions:d,actionProps:c,children:n=>{let{states:t}=n;return(0,i.jsx)(Rn,{disabled:"connected"!==e||Boolean(l),showMenu:!1,states:t})}})})),Fn={primary:"primary",success:"positive",warning:"caution",danger:"critical"};function Bn(e){let{states:n}=e;return(0,i.jsx)(s.gF,{space:1,children:n.map(((e,n)=>(0,i.jsx)(s.u,{content:e.title&&(0,i.jsx)(s.xu,{padding:2,children:(0,i.jsx)(s.xv,{size:1,children:e.title})}),disabled:!e.title,placement:"top",portal:!0,children:(0,i.jsx)(s.Ct,{fontSize:1,mode:"outline",paddingX:2,paddingY:1,radius:4,tone:e.color?Fn[e.color]:void 0,style:{whiteSpace:"nowrap"},children:e.label})},String(n))))})}function Kn(){const{badges:e,editState:n}=(0,a.Z3)();return n&&e?(0,i.jsx)(pe,{badges:e,badgeProps:n,children:e=>{let{states:n}=e;return(0,i.jsx)(Bn,{states:n})}}):null}const Nn=(0,Q.ZP)(s.kC)(R||(R=de(["\n cursor: default;\n"])));function Zn(e){const{collapsed:n,disabled:t,lastPublished:o,lastUpdated:a,liveEdit:r}=e,l=(0,X.INm)(o||"",{minimal:!0,agoSuffix:!0}),c=(0,X.INm)(o||"",{minimal:!0}),d=(0,X.INm)(a||"",{minimal:!0,agoSuffix:!0}),u=(0,X.INm)(a||"",{minimal:!0});return(0,i.jsx)(Nn,{align:"center","data-ui":"SessionLayout",sizing:"border",children:(0,i.jsx)(s.u,{placement:"top",portal:!0,content:(0,i.jsx)(s.Kq,{padding:3,space:3,children:(0,i.jsx)(s.xv,{size:1,muted:!0,children:r?(0,i.jsxs)(i.Fragment,{children:["Last updated ",a?d:l]}):(0,i.jsxs)(i.Fragment,{children:["Last published ",l]})})}),children:(0,i.jsx)(s.zx,{mode:"bleed",tone:r?"critical":"positive",tabIndex:-1,disabled:t,children:(0,i.jsxs)(s.kC,{align:"center",children:[(0,i.jsx)(s.xu,{marginRight:n?0:3,children:(0,i.jsx)(s.xv,{size:2,children:r?(0,i.jsx)(ee.o1U,{}):(0,i.jsx)(ee.EI4,{})})}),!n&&(0,i.jsx)(s.xv,{size:1,weight:"medium",children:r?(0,i.jsx)(i.Fragment,{children:a?u:c}):c})]})})})})}const Dn=(0,Q.ZP)(ce.E.path)(O||(O=de(["\n transform-origin: center;
1\n"]))),An=e=>(0,i.jsx)(ce.E.circle,{fill:"none",r:"8",cx:"12.5",cy:"12.5",strokeWidth:"1.2",...e}),Un=e=>(0,i.jsx)(Dn,{fill:"none",d:"M14 17.5619L11.5 20.5L14.5 23.0619M11 7.43811L13.5 4.50001L10.5 1.93811",...e}),Vn=e=>(0,i.jsx)(ce.E.path,{d:"M9.5 12.1316L11.7414 14.5L16 10",...e}),Hn=e=>(0,i.jsx)(ce.E.path,{d:"M15 7L18 10M6 19L7 15L17 5L20 8L10 18L6 19Z",...e}),Xn=(0,Q.F4)(W||(W=de(["\n 0% {\n transform: rotate(0);\n }\n 100% {\n transform: rotate(360deg);\n }\n"]))),qn=Q.ZP.g(F||(F=de(["\n transform-origin: center;\n\n &[data-rotate] {\n animation: "," 1s ease-in-out infinite;\n }\n"])),Xn),$n={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}}},Yn={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}}},Jn={syncing:{opacity:1,transition:{duration:0}},saved:{opacity:0,transition:{duration:.2}},changes:{opacity:0}},Gn={syncing:{pathLength:0,transition:{duration:0}},saved:{pathLength:1,transition:{delay:.4,duration:.3}},changes:{pathLength:0,transition:{duration:.2}}},Qn={syncing:{pathLength:0,transition:{duration:0}},saved:{pathLength:0,transition:{duration:0}},changes:{pathLength:1,transition:{duration:.4,delay:.5}}};function et(e){const{status:n}=e;return n?(0,i.jsx)("svg",{width:"1em",height:"1em",viewBox:"0 0 25 25",fill:"none",stroke:"currentColor",strokeWidth:"1.2","data-sanity-icon":"",children:(0,i.jsxs)(ce.E.g,{variants:$n,initial:n,animate:n,children:[(0,i.jsxs)(qn,{"data-rotate":"changes"===n?void 0:"",children:[(0,i.jsx)(Un,{variants:Jn,initial:n,animate:n}),(0,i.jsx)(An,{variants:Yn,initial:n,animate:n})]}),(0,i.jsx)(Vn,{variants:Gn,initial:n,animate:n}),(0,i.jsx)(Hn,{variants:Qn,initial:n,animate:n})]})}):null}const nt=o.forwardRef((function(e,n){const{collapsed:t,status:a,lastUpdated:r,...l}=e,c=(0,X.INm)(r||"",{minimal:!0}),d=(0,X.INm)(r||"",{minimal:!0,agoSuffix:!0}),u=(0,o.useMemo)((()=>"syncing"===a?{text:"Saving...",tone:void 0}:"changes"===a?{text:c,tone:"caution"}:"saved"===a?{text:"Saved!",tone:"positive"}:{}),[a,c]);return a?(0,i.jsx)(s.u,{placement:"top",portal:!0,disabled:"changes"!==a,content:(0,i.jsxs)(s.Kq,{padding:3,space:3,children:[(0,i.jsx)(s.xv,{size:1,weight:"semibold",children:"Review changes"}),(0,i.jsxs)(s.xv,{size:1,muted:!0,children:["Changes saved ",d]})]}),children:(0,i.jsx)(s.zx,{mode:"bleed",justify:"flex-start",tone:null==u?void 0:u.tone,...l,"data-testid":"review-changes-button",ref:n,children:(0,i.jsxs)(s.kC,{align:"center",children:[(0,i.jsx)(s.xu,{marginRight:t?0:3,children:(0,i.jsx)(s.xv,{children:(0,i.jsx)(et,{status:a})})}),!t&&(0,i.jsx)(s.xv,{size:1,weight:"medium",children:null==u?void 0:u.text})]})})}):null})),tt=o.memo(nt),it=(0,o.memo)((function(){var e;const{changesOpen:n,documentId:t,documentType:r,editState:l,onHistoryClose:c,onHistoryOpen:d,timelineStore:u,value:p}=(0,a.Z3)(),h=(0,X.nuD)(t,r),x=null==p?void 0:p._updatedAt,f=null==(e=null==l?void 0:l.published)?void 0:e._updatedAt,m=Boolean(null==l?void 0:l.liveEdit),g=Boolean(null==l?void 0:l.published),j=Boolean(null==l?void 0:l.draft),[v,y]=(0,o.useState)(null),b=(0,s.XL)(v),w=!b||(null==b?void 0:b.width)<300,[_,P]=(0,o.useState)(null),I=(0,X.P08)(u,(e=>e.onOlderRevision));(0,o.useEffect)((()=>{if("syncing"===_&&!h.isSyncing){const e=setTimeout((()=>P("saved")),1e3);return()=>clearTimeout(e)}if("saved"===_){const e=setTimeout((()=>P(null)),3e3);return()=>clearTimeout(e)}}),[_,x,h.isSyncing]),(0,o.useLayoutEffect)((()=>{P(null)}),[t]),(0,o.useLayoutEffect)((()=>{h.isSyncing&&P("syncing")}),[h.isSyncing,x]);const C=(0,o.useMemo)((()=>(0,i.jsx)(tt,{lastUpdated:x,status:_||(j?"changes":void 0),onClick:n?c:d,disabled:I,selected:n,collapsed:w})),[j,n,c,d,x,I,_,w]),k=(0,o.useMemo)((()=>(m||g)&&(0,i.jsx)(s.xu,{marginRight:1,children:(0,i.jsx)(Zn,{disabled:I,lastPublished:f,lastUpdated:x,liveEdit:m,collapsed:w})})),[w,f,x,m,g,I]);return(0,i.jsxs)(s.kC,{align:"center","data-ui":"DocumentSparkline",ref:y,children:[k,(0,i.jsxs)(s.kC,{align:"center",flex:1,children:[C,!w&&(0,i.jsx)(s.xu,{marginLeft:3,children:(0,i.jsx)(Kn,{})})]})]})})),ot=(0,Q.ZP)(s.xu)(B||(B=de(["\n min-width: 10em;\n max-width: 16em;\n"])));function st(e){const{actionsBoxRef:n}=e,{badges:t,timelineStore:r}=(0,a.Z3)(),l=(0,X.P08)(r,(e=>e.onOlderRevision));return(0,o.useMemo)((()=>(0,i.jsx)(s.xu,{paddingLeft:2,paddingRight:[2,3],paddingY:2,children:(0,i.jsxs)(s.kC,{align:"center",children:[(0,i.jsx)(s.xu,{flex:[1,2],children:t&&(0,i.jsx)(it,{})}),(0,i.jsx)(ot,{flex:1,marginLeft:[1,3],ref:n,children:l?(0,i.jsx)(Wn,{}):(0,i.jsx)(On,{})})]})})),[n,t,l])}function at(e){const{actionsBoxElement:n,activeIndex:t,as:s="div",children:a,id:r,onActionStart:l,onKeyDown:c,rootRef:d,states:u,...p}=e,h=u[t],x=(0,o.useCallback)((e=>{const n=u.filter((n=>n.shortcut&&(0,te.ZP)(n.shortcut,e))),t=n[0];if(n.length>1&&console.warn('Keyboard shortcut conflict: More than one document action matches the shortcut "'.concat(t.shortcut,'"')),t&&!t.disabled&&t.onHandle)return e.preventDefault(),t.onHandle(),void l(u.indexOf(t));c&&c(e)}),[l,c,u]);return(0,o.createElement)(s,{id:r,onKeyDown:x,tabIndex:-1,...p,ref:d},[a,h&&h.dialog&&(0,i.jsx)(X.jr5,{zOffset:"paneFooter",children:(0,i.jsx)(Mn,{dialog:h.dialog,referenceElement:n})})])}const rt=o.memo((e=>{const{actionsBoxElement:n,as:t="div",children:s,...r}=e,{actions:l,editState:c}=(0,a.Z3)(),[d,u]=(0,o.useState)(-1),p=(0,o.useCallback)((e=>{u(e)}),[]),h=(0,o.useMemo)((()=>c&&{...c,onComplete:()=>{},revision:void 0}),[c]);return h&&l?(0,i.jsx)(ue,{actionProps:h,actions:l,children:e=>{let{states:o}=e;return(0,i.jsx)(at,{...r,activeIndex:d,actionsBoxElement:n,as:t,onActionStart:p,states:o,children:s})}}):null}));rt.displayName="DocumentActionShortcuts";const lt=["fixed","absolute"],ct=(0,Q.ZP)(X.jbM)(K||(K=de(["\n flex: 1;\n display: flex;\n flex-direction: column;\n min-height: 0;\n min-width: 0;\n"]))),dt=(0,o.memo)((function(e){const{name:n}=(0,X.Lky)();return(0,i.jsx)(X.cWh,{name:e.pane.source||n,children:(0,i.jsx)(ut,{...e})})}));function ut(e){var n;const{pane:t,paneKey:r}=e,{resolveNewDocumentOptions:l}=(0,X.Lky)().document,c=(0,a.RL)(),d=function(e){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const t=(0,X.zEW)();return(0,o.useMemo)((()=>
1{if(e.type&&"*"!==e.type)return e;const i=e.template||n.template,o=i?t.find((e=>e.id===i)):void 0,s=null==o?void 0:o.schemaType;return s?{...e,type:s}:e}),[e,n.template,t])}(t.options,c.params),{documentType:u,isLoaded:p}=(0,X.Hdz)(d.id,d.type),h=(0,o.useMemo)((()=>l({type:"global"})),[l]),[x,f]=(0,X.UMU)({templateItems:h}),m=p&&!f,g=(0,o.useMemo)((()=>m&&u&&d.type!==u?function(e,n,t){return{...e,pane:{...e.pane,options:{...n,type:t}}}}(e,d,u):e),[e,u,m,d]),{ReferenceChildLink:j,handleEditReference:v,groupIndex:y,routerPanesState:b}=c,w=(null==(n=b[y+1])?void 0:n[0].params)||{},_=b.length,{parentRefPath:P}=w,I=(0,o.useMemo)((()=>P?{path:(0,ie.mL)(P),state:y>=_-1?"none":y>=_-2?"selected":"pressed"}:{path:[],state:"none"}),[P,y,_]);return"*"!==d.type||m?u?(0,i.jsx)(a.oK,{...g,children:(0,i.jsx)(X.euX,{EditReferenceLinkComponent:j,onEditReference:v,initialValueTemplateItems:x,activePath:I,children:(0,i.jsx)(pt,{})})},"".concat(u,"-").concat(d.id)):(0,i.jsx)(Ae,{flex:2.5,minWidth:320,paneKey:r,title:(0,i.jsx)(i.Fragment,{children:"The document was not found"}),children:(0,i.jsx)(s.Kq,{space:4,children:(0,i.jsxs)(s.xv,{as:"p",children:["The document type is not defined, and a document with the ",(0,i.jsx)("code",{children:d.id})," ","identifier could not be found."]})})}):(0,i.jsx)(Ne,{flex:2.5,minWidth:320,paneKey:r,title:"Loading document\u2026"})}function pt(){const{changesOpen:e,documentType:n,inspector:t,inspectOpen:r,onFocus:l,onPathOpen:c,onHistoryOpen:d,onKeyUp:u,paneKey:p,schemaType:h,value:x}=(0,a.Z3)(),{collapsed:f}=(0,a.Cc)(),m=(0,X.Cnp)(),[g,j]=(0,o.useState)(null),[v,y]=(0,o.useState)(null),[b,w]=(0,o.useState)(null),[_,P]=(0,o.useState)(null),I=(0,s.XL)(v),C=null==I?void 0:I.height,k=(0,o.useCallback)((e=>{c(e),l(e)}),[c,l]),S=a.jE+(t?a.VQ:0),z=a.nK+(t?a.VQ:0);return h?(0,i.jsxs)(rt,{actionsBoxElement:b,as:a.X6,currentMinWidth:S,"data-testid":"document-pane",flex:2.5,id:p,minWidth:z,onKeyUp:u,rootRef:j,children:[(0,i.jsx)(s.Tu,{position:lt,zOffset:m.portal,children:(0,i.jsx)(s.kC,{direction:"column",flex:1,height:f?void 0:"fill",children:(0,i.jsx)(ct,{"data-testid":"change-connector-root",isReviewChangesOpen:e,onOpenReviewChanges:d,onSetFocus:k,children:(0,i.jsx)(wn,{footerHeight:C||null,isInspectOpen:r,rootElement:g,setDocumentPanelPortalElement:P})})})}),(0,i.jsx)(s.Xp,{__unstable_elements:{[a.BP]:_},children:(0,i.jsx)(s.Tu,{position:lt,zOffset:m.portal,children:(0,i.jsx)(a.PV,{ref:y,children:(0,i.jsx)(st,{actionsBoxRef:w})})})}),(0,i.jsx)(He,{})]}):(0,i.jsx)(Ae,{currentMinWidth:S,flex:2.5,minWidth:z,paneKey:p,title:(0,i.jsxs)(i.Fragment,{children:["Unknown document type: ",(0,i.jsx)("code",{children:n})]}),tone:"caution",children:(0,i.jsxs)(s.Kq,{space:4,children:[n&&(0,i.jsxs)(s.xv,{as:"p",children:["This document has the schema type ",(0,i.jsx)("code",{children:n}),", which is not defined as a type in the local content studio schema."]}),!n&&(0,i.jsx)(s.xv,{as:"p",children:"This document does not exist, and no schema type was specified for it."}),X.r8Q&&x&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(s.xv,{as:"p",children:"Here is the JSON representation of the document:"}),(0,i.jsx)(s.Zb,{padding:3,overflow:"auto",radius:2,shadow:1,tone:"inherit",children:(0,i.jsx)(s.EK,{language:"json",size:[1,1,2],children:JSON.stringify(x,null,2)})})]})]})})}function ht(){return(0,i.jsx)(s.Zb,{height:"fill",children:(0,i.jsx)(s.kC,{align:"center",height:"fill",justify:"center",padding:4,sizing:"border",children:(0,i.jsx)(s.W2,{width:0,children:(0,i.jsx)(s.Zb,{padding:4,radius:2,shadow:1,tone:"caution",children:(0,i.jsxs)(s.kC,{children:[(0,i.jsx)(s.xu,{children:(0,i.jsx)(s.xv,{size:1,children:(0,i.jsx)(ee.foC,{})})}),(0,i.jsxs)(s.Kq,{flex:1,marginLeft:3,space:3,children:[(0,i.jsx)(s.xv,{as:"h1",size:1,weight:"bold",children:"No document types"}),(0,i.jsx)(s.xv,{as:"p",muted:!0,size:1,children:"Please define at least one document type in your schema."}),(0,i.jsx)(s.xv,{as:"p",muted:!0,size:1,children:(0,i.jsx)("a",{href:"https://www.sanity.io/docs/create-a-schema-and-configure-sanity-studio",target:"_blank",rel:"noreferrer",children:"Learn how to add a document type \u2192"})})]})]})})})})})}const xt=(0,Q.ZP)((function(e){const{children:n,minWidth:t,onCollapse:r,onExpand:l,...c}=e,d=(0,o.useMemo)((()=>ge()),[]),[u,p]=(0,o.useState)(null),h=(0,s.XL)(u),x=(null==h?void 0:h.width)||0,f=void 0!==x&&t?x<t:void 0,[m,g]=(0,o.useState)({expandedElement:null,panes:[],resizing:!1});(0,o.useEffect)((()=>d.setRootElement(u)),[d,u]),(0,o.useEffect)((()=>d.setRootWidth(x)),[d,x]),(0,o.useEffect)((()=>d.subscribe(g)),[d]),(0,o.useEffect)((()=>{void 0!==f&&(f&&r&&r(),!f&&l&&l())}),[f,r,l]);const j=(0,o.useMemo)((()=>({collapse:d.collapse,collapsed:f,expand:d.expand,expandedElement:m.expandedElement,mount:d.mount,panes:m.panes,resize:d.resize,resizing:m.resizing})),[f,d,m.expandedElement,m.panes,m.resizing]);return(0,i.jsx)(a.yq.Provider,{value:j,children:(0,i.jsx)(a.fC,{"data-ui":"PaneLayout",...c,"data-collapsed":f?"":void 0,"data-resizing":m.resizing?"":void 0,"data-mounted":x?"":void 0,ref:p,children:n})})}))(N||(N=de(["\n min-height: 100%;\n min-width: 320px;\n"]))),ft=(0,te.ZP)("mod+s"),mt=(0,o.memo)((function(e){let{onPaneChange:n}=e;var t;const{push:r}=(0,s.pm)(),l=(0,X.I_y)(),{layoutCollapsed:c,setLayoutCollapsed:d}=(0,a.xu)(),{paneDataItems:u,resolvedPanes:p}=Me(),h=(0,J.z)((0,o.useCallback)((e=>"string"===typeof e.intent),[])),[x,f]=(0,o.useState)(null),m=(0,o.useCallback)((()=>d(!0)),[d]),g=(0,o.useCallback)((()=>d(!1)),[d]);(0,o.useEffect)((()=>{p.length&&n(p)}),[n,p]),(0,o.useEffect)((()=>{const e=e=>{ft(e)&&(e.preventDefault(),r({closable:!0,id:"auto-save-message",status:"info",title:"Your work is automatically saved!",duration:4e3}))};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)}),[r]);return(null==(t=l._original)?void 0:t.types.some(X.mPO))?(0,i.jsxs)(s.Xp,{element:x||null,children:[(0,i.jsxs)(xt,{flex:1,height:c?void 0:"fill",minWidth:512,onCollapse:m,onExpand:g,children:[u.map((e=>{let{active:n,childItemId:t,groupIndex:s,itemId:r,key:l,pane:c,index:d,params:u,path:p,payload:h,siblingIndex:x,selected:f}=e;return(0,i.jsx)(o.Fragment,{children:c===a.PF?(0,i.jsx)(Ne,{paneKey:l,path:p,selected:f}):(0,i.jsx)(De,{active:n,groupIndex:s,index:d,pane:c,childItemId:t,itemId:r,paneKey:l,params:u,payload:h,path:p,selected:f,siblingIndex:x})},"".concat(c===a.PF?"loading":c.type,"-").concat(d))}
1)),u.length<=1&&h&&(0,i.jsx)(Ne,{paneKey:"intent-resolver"})]}),(0,i.jsx)("div",{"data-portal":"",ref:f})]}):(0,i.jsx)(ht,{})}));var gt=Object.freeze({__proto__:null,default:function(e){let{tool:{options:n}}=e;const{unstable_sources:t}=(0,X.cFj)(),[r]=t,{source:l,defaultDocumentNode:c,structure:d}=n||{};(0,o.useEffect)((()=>((0,a.aR)([]),()=>(0,a.aR)([]))),[]);const[{error:u},p]=(0,o.useState)({error:null});return u?(0,i.jsx)(We,{error:u}):(0,i.jsx)(s.SV,{onCatch:p,children:(0,i.jsx)(X.cWh,{name:l||r.name,children:(0,i.jsxs)(a.Sg,{defaultDocumentNode:c,structure:d,children:[(0,i.jsx)(mt,{onPaneChange:a.aR}),(0,i.jsx)(Te,{})]})})})}})}}]);
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.