1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[877],{4775:function(e,t,n){n.d(t,{O:function(){return m}});var r=n(85893),i=n(40168),s=n(42930),o=n(11636),a=n(67294),l=n(32932),u=n(51776);n(57557),n(66996),n(933);function c(e){const{layout:t,value:n}=e;return(0,r.jsx)(l.ogX,{...(s=n._id,o=n._type,{title:(0,r.jsxs)("em",{children:["No schema found for type ",(0,r.jsx)("code",{children:o})]}),subtitle:(0,r.jsxs)("em",{children:["Document: ",(0,r.jsx)("code",{children:s})]}),media:()=>(0,r.jsx)(i.foC,{})}),layout:t});var s,o}function d(e,t,n){return!1!==e&&(e||t&&t.icon||n||!1)}function m(e){const{icon:t,id:n,layout:m="default",pressed:p,schemaType:f,selected:h,title:y,value:x,margin:g,marginBottom:j,marginTop:v}=e,b=(0,l.I_y)(),I=(0,l.rq_)(),{ChildLink:C}=(0,u.RL)(),L=(0,l.Dqo)(n),S=Boolean(f&&f.name&&b.get(f.name)),[k,w]=(0,a.useState)(!1),_=(0,a.useMemo)((()=>x&&(0,s.Si)(x)?f&&S?(0,r.jsx)(u.iJ,{documentPreviewStore:I,icon:d(t,f,i.$lS),layout:m,schemaType:f,value:x,presence:L}):(0,r.jsx)(c,{value:x}):(0,r.jsx)(l.ogX,{status:(0,r.jsx)(o.xv,{muted:!0,children:(0,r.jsx)(i.XCv,{})}),icon:d(t,f,i.ROc),layout:m,title:y})),[I,S,t,m,f,y,x,L]),R=(0,a.useMemo)((()=>function(e){return(0,r.jsx)(C,{...e,childId:n})}),[C,n]),T=(0,a.useCallback)((e=>{e.metaKey?w(!1):w(!0)}),[]);return(0,a.useEffect)((()=>w(!1)),[h]),(0,r.jsx)(l.oUE,{__unstable_focusRing:!0,as:R,"data-as":"a","data-ui":"PaneItem",margin:g,marginBottom:j,marginTop:v,onClick:T,padding:2,pressed:p,radius:2,selected:h||k,sizing:"border",tabIndex:-1,tone:"inherit",children:_})}},22877:function(e,t,n){n.r(t),n.d(t,{default:function(){return pe}});var r,i,s,o,a,l=n(85893),u=n(67294),c=n(11636),d=n(38993),m=n.n(d),p=n(18446),f=n.n(p),h=n(40168),y=n(14141),x=n(19917),g=n(5014),j=n(83610),v=n(32817),b=n(65583),I=n(30743),C=n(23071),L=n(74727),S=n(9132),k=n(37991),w=n(82649),_=n(69243),R=n(22401),T=n(29127),M=n(42006),O=n(92574),E=n(6222),z=n(28440),P=n(32932),B=(n(933),n(51776)),q=n(22847),D=n(66996),W=n(42930),X=n(4775),A=(n(57557),n(81763),n(47037),n(98430)),N=n(79878),$=n(56542),V=n(85092);function K(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}const Q=2e3,Y={by:[{field:"_updatedAt",direction:"desc"}]},Z={};const F=/\b_type\s*==\s*(['"].*?['"]|\$.*?(?:\s|$))|\B(['"].*?['"]|\$.*?(?:\s|$))\s*==\s*_type\b/;function G(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const n=e.match(F);if(!n)return null;const r=(n[1]||n[2]).trim().replace(/^["']|["']$/g,"");if("$"===r[0]){const e=t[r.slice(1)];return"string"===typeof e?e:null}return r}function H(e,t){const n=e.by.map((e=>{if(e.mapWith)return e;const n=function(e,t){const n=D.mL(t);let r=e;for(const i of n){if(!r)return;if("string"===typeof i){r=U(r,i);continue}if(!((0,W.Fd)(i)||(0,W.dw)(i))||"array"!==r.jsonType)return;const[e,t]=r.of||[];if(t||!e)return;if(!(0,W.dD)(e)){r=e;continue}const[n,s]=e.to||[];if(s||!n)return;r=n}return r}(t,e.field);return n?function(e,t){let n=e.type;for(;n;){if(n.name===t)return!0;if(!n.type&&n.jsonType===t)return!0;n=n.type}return!1}(n,"datetime")?{...e,mapWith:"dateTime"}:"string"===n.jsonType?{...e,mapWith:"lower"}:e:e}));return n.every(((t,n)=>t===e.by[n]))?e:{...e,by:n}}function U(e,t){if(!("fields"in e))return;const n=e.fields.find((e=>e.name===t));return n?n.type:void 0}const J=(0,y.ZP)(c.xu)(r||(r=K(["\n position: relative;\n"]))),ee=(0,y.ZP)(c.xu)(i||(i=K(["\n position: absolute;\n left: 0;\n right: 0;\n top: 0;\n bottom: 0;\n"]))),te=[...Array(30).keys()];function ne(e){const{layout:t}=e;return(0,l.jsx)(c.Kq,{padding:2,space:1,children:te.map((e=>(0,l.jsx)(c.Zb,{padding:2,children:(0,l.jsx)(P.ogX,{isPlaceholder:!0,layout:t})},e)))})}function re(e){const{childItemId:t,error:n,filterIsSimpleTypeConstraint:r,hasMaxItems:i,hasSearchQuery:s,isActive:o,isLazyLoading:a,isLoading:d,items:m,layout:p,loadingVariant:f,onListChange:y,onRetry:x,paneTitle:g,searchInputElement:j,showIcons:v}=e,b=(0,P.I_y)(),{collapsed:I}=(0,B.Cc)(),{collapsed:C,index:L}=(0,B.ec)(),[S,k]=(0,u.useState)(!1),w=(0,u.useCallback)((()=>{d||a||!S||y()}),[a,d,y,S]);(0,u.useEffect)((()=>
1{if(C)return;const e=setTimeout((()=>{k(!0)}),0);return()=>{clearTimeout(e)}}),[C,m]);const _=(0,u.useCallback)(((e,n)=>{let{activeIndex:r}=n;const s=(0,P.vsM)(e._id),u=t===s,d=!o&&u,f=o&&u,h=r===m.length-1,y=h&&a,x=h&&i;return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(X.O,{icon:!1!==v&&void 0,id:s,layout:p,marginBottom:1,pressed:d,schemaType:b.get(e._type),selected:f,value:e}),y&&(0,l.jsx)(c.kC,{align:"center",justify:"center",padding:4,children:(0,l.jsx)(c.$j,{muted:!0})}),x&&(0,l.jsx)(c.xu,{marginY:1,paddingX:3,paddingY:4,children:(0,l.jsxs)(c.xv,{align:"center",muted:!0,size:1,children:["Displaying a maximum of ",Q," documents"]})})]})}),[t,o,m.length,p,b,v,i,a]),R=(0,u.useMemo)((()=>s?(0,l.jsx)(c.kC,{align:"center",direction:"column",height:"fill",justify:"center",children:(0,l.jsx)(c.W2,{width:1,children:(0,l.jsx)(c.xu,{paddingX:4,paddingY:5,children:(0,l.jsx)(c.xv,{align:"center",muted:!0,children:"No results found"})})})}):(0,l.jsx)(c.kC,{align:"center",direction:"column",height:"fill",justify:"center",children:(0,l.jsx)(c.W2,{width:1,children:(0,l.jsx)(c.xu,{paddingX:4,paddingY:5,children:(0,l.jsx)(c.xv,{align:"center",muted:!0,children:r?"No documents of this type":"No matching documents"})})})})),[r,s]),T=(0,u.useMemo)((()=>{if(!S)return null;if(n)return(0,l.jsx)(c.kC,{align:"center",direction:"column",height:"fill",justify:"center",children:(0,l.jsx)(c.W2,{width:1,children:(0,l.jsxs)(c.Kq,{paddingX:4,paddingY:5,space:4,children:[(0,l.jsx)(c.X6,{as:"h3",children:"Could not fetch list items"}),(0,l.jsxs)(c.xv,{as:"p",children:["Error: ",(0,l.jsx)("code",{children:n.message})]}),x&&(0,l.jsx)(c.xu,{children:(0,l.jsx)(c.zx,{icon:h.bnu,onClick:x,text:"Retry",tone:"primary"})})]})})});if(!d&&0===m.length)return R;if("initial"===f&&d)return(0,l.jsx)(B.cN,{ms:300,children:(0,l.jsx)(ne,{layout:p})});if("spinner"===f&&d)return null;const e="".concat(L,"-").concat(C);return(0,l.jsx)(J,{overflow:"hidden",height:"fill",children:(0,l.jsx)(ee,{children:(0,l.jsx)(P.e8h,{activeItemDataAttr:"data-hovered",ariaLabel:g,canReceiveFocus:!0,focusRingOffset:-3,inputElement:j,itemHeight:51,items:m,onEndReached:w,onlyShowSelectionWhenActive:!0,overscan:10,padding:2,paddingBottom:1,renderItem:_,wrapAround:!1},e)})})}),[C,n,w,L,d,m,p,f,x,_,j,S]);return(0,l.jsx)(B.Bh,{overflow:I||"initial"===f?"hidden":"auto",children:T})}const ie=(0,u.memo)((e=>{let{contentAfter:t,index:n,initialValueTemplates:r=[],menuItemGroups:i=[],menuItems:s=[],setLayout:o,setSortOrder:a,title:d}=e;const{features:m}=(0,B.xu)(),{collapsed:p,isLast:f}=(0,B.ec)(),y=f&&!p?-1:0,x=(0,u.useMemo)((()=>({setLayout:e=>{let{layout:t}=e;o(t)},setSortOrder:e=>{a(e)}})),[o,a]);return(0,l.jsx)(B.hX,{actions:(0,l.jsx)(B.cp,{initialValueTemplateItems:r,actionHandlers:x,menuItemGroups:i,menuItems:s}),backButton:m.backButton&&n>0&&(0,l.jsx)(c.zx,{as:B.hb,"data-as":"a",icon:h.Y4O,mode:"bleed"}),contentAfter:t,tabIndex:y,title:d})}));
1ie.displayName="DocumentListPaneHeader";const se=[],oe={error:null,onRetry:void 0,result:null},ae={result:null,error:null};function le(e){const{filter:t,params:n,sortOrder:r,searchQuery:i}=e,s=(0,P.m85)(P.Dr7),o=(0,P.I_y)(),[a,l]=(0,u.useState)(oe),{onRetry:c,error:d,result:m}=a,p=null==m?void 0:m.documents,f=(0,u.useMemo)((()=>p?function(e){return(0,P.RgL)(e).map((e=>({...e.draft||e.published,hasPublished:!!e.published,hasDraft:!!e.draft})))}(p):se),[p]),[h,y]=(0,u.useState)(!1),[M,O]=(0,u.useState)(!1),[E,z]=(0,u.useState)(!1),B=(0,u.useMemo)((()=>G(t,n)),[t,n]),q=null===m&&!d,D=(null==p?void 0:p.length)===Q,W=(0,u.useCallback)((()=>{q||M||E||z(!0)}),[q,M,E]),X=(0,u.useCallback)((e=>{var t,n;if(e.error)return void l(e);const r=(null==(n=null==(t=e.result)?void 0:t.documents)?void 0:n.length)||0;!e.error&&null===(null==e?void 0:e.result)&&E?y(!0):(r<100&&0!==r&&!E&&O(!0),null!==(null==e?void 0:e.result)?(y(!1),l(e)):l((t=>({...t.error?e:t}))))}),[E]),K=(0,u.useMemo)((()=>{const e=new w.x,a=()=>e.next();return function(e){const{client:t,schema:n,sort:r,limit:i,params:s,filter:o,searchQuery:a,staticTypeNames:l}=e,u=r.by,c=null==r?void 0:r.extendedProjection,d=(0,x.P)((()=>t.listen("*[".concat(o,"]"),s,{events:["welcome","mutation","reconnect"],includeResult:!1,visibility:"query"}))).pipe((0,g.z)(((e,t)=>0===t&&"welcome"!==e.type?(0,j._)((()=>new Error("reconnect"===e.type?"Could not establish EventSource connection":'Received unexpected type of first event "'.concat(e.type,'"')))):(0,v.of)(e))),(0,b.B)()),[m,p]=(0,I.u)(d,(e=>"welcome"===e.type));return(0,C.T)(m.pipe((0,L.q)(1)),p.pipe((0,S.p)(1e3,k.z,{leading:!0,trailing:!0}))).pipe((0,V.q)((()=>(l?(0,v.of)(l):t.observable.fetch("array::unique(*[".concat(o,"][]._type)"),s)).pipe((0,g.z)((e=>{const r=e.flatMap((e=>n.get(e)||[])),l={filter:o,query:a||"",types:r},d={__unstable_extendedProjection:c,comments:["findability-source: ".concat(a?"list-query":"list")],limit:i,params:s,sort:u},{query:m,params:p}=(0,P.kqP)(l,d);return t.observable.fetch(m,p)}))))))}({client:s,filter:t,limit:E?Q:100,params:n,schema:o,searchQuery:i||"",sort:r||Y,staticTypeNames:B?[B]:void 0}).pipe((0,T.U)((e=>({result:{documents:e},error:null}))),(0,A.O)(ae),(0,N.K)((e=>e instanceof ProgressEvent?(0,j._)((()=>new Error("Request error"))):(0,j._)((()=>e)))),(0,N.K)(((t,n)=>(0,_.z)((0,v.of)({result:null,error:t}),(0,C.T)((0,R.R)(window,"online"),e).pipe((0,L.q)(1),(0,g.z)((()=>n)))))),(0,$.R)(((e,t)=>({...e,...t,onRetry:a}))))}),[s,t,n,o,i,E,r,B]);(0,u.useEffect)((()=>{const e=K.subscribe(X);return()=>{e.unsubscribe()}}),[X,K]);const Z=(0,u.useCallback)((()=>
1{O(!1),y(!1),l(oe),z(!1)}),[]);return(0,u.useEffect)((()=>{Z()}),[Z,t,n,r,i]),{error:d,hasMaxItems:D,isLazyLoading:h,isLoading:q,isSearchReady:!d,items:f,onListChange:W,onRetry:c}}const ue=[],ce=(0,y.F4)(s||(s=K(["\n from {\n transform: rotate(0deg);\n }\n to {\n transform: rotate(360deg);\n }\n"]))),de=(0,y.ZP)(h.L4p)(o||(o=K(["\n animation: "," 500ms linear infinite;\n"])),ce),me=(0,y.ZP)(c.Zb)(a||(a=K(["\n [data-ui='TextInput'] {\n border-radius: inherit;\n }\n"])));const pe=(0,u.memo)((function(e){const{childItemId:t,index:n,isActive:r,isSelected:i,pane:s,paneKey:o}=e,a=(0,P.I_y)(),{name:d}=(0,P.Lky)(),{defaultLayout:p="default",displayOptions:y,initialValueTemplates:x=ue,menuItemGroups:g,menuItems:j,options:b,title:I}=s,{apiVersion:C,defaultOrdering:L=ue,filter:S}=b,k=function(e){const t=(0,u.useRef)(e);return m()(t.current,e)||(t.current=e),t.current}(b.params||Z),w=s.source,_=(0,u.useMemo)((()=>G(S,k)),[S,k]),R=!1!==(null==y?void 0:y.showIcons),[D,W]=(0,q.useDeskToolSetting)(_,"layout",p),[X,A]=(0,u.useState)(""),[N,$]=(0,u.useState)(""),[V,K]=(0,u.useState)(null),Q=(0,u.useRef)(!1),F=(0,u.useMemo)((()=>(null==L?void 0:L.length)>0?{by:L}:Y),[L]),[U,J]=(0,q.useDeskToolSetting)(_,"sortOrder",F),ee=_&&U?H(U,a.get(_)):U,te=(0,P.BoV)(ee),ne=function(e){return/^_type\s*==\s*['"$]\w+['"]?\s*$/.test(e.trim())}(S),{error:se,hasMaxItems:oe,isLazyLoading:ae,isLoading:ce,isSearchReady:pe,items:fe,onListChange:he,onRetry:ye}=le({apiVersion:C,filter:S,params:k,searchQuery:null==X?void 0:X.trim(),sortOrder:te}),xe=(0,u.useMemo)((()=>(e=>{const{menuItems:t,sortOrderRaw:n,layout:r}=e;return null==t?void 0:t.map((e=>{var t,i,s,o;return(null==(t=e.params)?void 0:t.layout)?{...e,selected:r===(null==(i=e.params)?void 0:i.layout)}:(null==(s=null==e?void 0:e.params)?void 0:s.by)?{...e,selected:f()(null==n?void 0:n.by,(null==(o=null==e?void 0:e.params)?void 0:o.by)||ue)}:{...e,selected:!1}}))})({menuItems:j,sortOrderRaw:U,layout:D})),[D,j,U]),ge=(0,z.W2)((e=>e.pipe((0,T.U)((e=>e.target.value)),(0,M.b)($),(0,O.D)((e=>""===e?(0,v.of)(""):(0,E.H)(300))),(0,M.b)(A))),[]),je=(0,u.useCallback)((()=>{A(""),$("")}),[]),ve=(0,u.useCallback)((e=>{"Escape"===e.key&&je()}),[je]);(0,u.useEffect)((()=>(!1!==Q.current||ce||(Q.current=!0),()=>{Q.current=!1})),[ce]),(0,u.useEffect)((()=>{je(),Q.current=!1}),[o,je]);const be=(0,u.useMemo)((()=>ce&&0===fe.length&&Q.current?"spinner":"initial"),[ce,fe.length]),Ie=(0,l.jsx)(c.xu,{paddingX:2,paddingBottom:2,children:(0,l.jsx)(me,{radius:4,tone:"transparent",children:(0,l.jsx)(c.oi,{"aria-label":"Search list",autoComplete:"off",border:!1,clearButton:Boolean(X),disabled:!pe,fontSize:[2,2,1],icon:"spinner"===be?de:h.W1M,onChange:ge,onClear:je,onKeyDown:ve,placeholder:"Search list",radius:2,ref:K,spellCheck:!1,value:N})})});return(0,l.jsx)(P.cWh,{name:w||d,children:(0,l.jsxs)(B.X6,{currentMaxWidth:350,"data-ui":"DocumentListPane",id:o,maxWidth:640,minWidth:320,selected:i,children:[B.Oo,(0,l.jsx)(ie,{contentAfter:Ie,index:n,initialValueTemplates:x,menuItemGroups:g,menuItems:xe,setLayout:W,setSortOrder:J,title:I}),(0,l.jsx)(re,{childItemId:t,error:se,filterIsSimpleTypeConstraint:ne,hasMaxItems:oe,hasSearchQuery:Boolean(X),isActive:r,isLazyLoading:ae,isLoading:ce,items:fe,layout:D,loadingVariant:be,onListChange:he,onRetry:ye,paneTitle:I,searchInputElement:V,showIcons:R},o)]})})}))}}]);
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.