1import{j as s}from"./jsx-runtime-esm-DgZK9P7c.js";import{F as _}from"./FilePreviewElement-OD3ZUSWh.js";import{F as S,i as j,d as M,S as F,X as D,n as $,M as k,g as w,o as R,p as P}from"./Icon-Ime4wSjK.js";import{u as L}from"./useAuthWrapper-CWXjgmIl.js";import{a as A}from"./tabs-CHHObJJW.js";import{k as T,l as C,m as d,I as O,j as V}from"./app-vP2jhQjT.js";import{a as g}from"./index-Dhy1axWM.js";import{R as B}from"./RecordEmptyState-9etA3du6.js";import"./index-CJZQOLKR.js";import"./user-avatar-Zw71S5uB.js";import"./index-AmsYr5ik.js";import"./_commonjsHelpers-CxYHiaSM.js";import"./normalizeDates-p6XmbZym.js";import"./isEqual-BiqEbpPg.js";import"./project-wd5IloI0.js";import"./react-redux-Bz8azxLH.js";import"./with-selector-Ce4EAgKw.js";import"./index-B8ov4xfp.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{};e.SENTRY_RELEASE={id:"967abcd"},e._sentryModuleMetadata=e._sentryModuleMetadata||{},e._sentryModuleMetadata[new e.Error().stack]=(function(u){for(var l=1;l<arguments.length;l++){var a=arguments[l];if(a!=null)for(var i in a)a.hasOwnProperty(i)&&(u[i]=a[i])}return u})({},e._sentryModuleMetadata[new e.Error().stack],{"_sentryBundlerPluginAppKey:noloco-ui":!0});var o=new e.Error().stack;o&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[o]="f7310071-a496-4937-883d-acbc4d30d164",e._sentryDebugIdIdentifier="sentry-dbid-f7310071-a496-4937-883d-acbc4d30d164")}catch{}})();const G=(e,o,u,l,a,i,p,b)=>{let c=l,m=o;if(p){const t=o.fields.getByName(p);if(t){c=w(l,[t.name]);const f=b.getByName(t.type);f&&(m=f)}}if(!c)return[];if(!e)return[];const n=m.fields.getByName(e);if(!n)return[];if(!R({dataType:m,field:n,permissionsEnabled:i,user:u}).read)return[];if(P(n))return w(c,[n.name,"edges"],[]).map(f=>w(f,"node"));const r=w(c,[n.name]);return r!==void 0?[r]:[]},ae=({record:e,size:o=F,showFileName:u,field:l,dataType:a,editorMode:i,rootField:p,hasBlockChrome:b})=>{const{dataTypes:c}=T(),{user:m}=L(),[n]=A(),v=C(S),r=g.useMemo(()=>G(l,a,m,e,null,v,p,c),[l,a,m,e,v,p,c]),[t,f]=g.useState(0),h=t>0&&r[t-1],x=t<r.length-1,I=g.useCallback(()=>{h&&f(t-1)},[t,h]),N=g.useCallback(()=>{x&&f(t+1)},[t,x]),y=g.useMemo(()=>r.length>0?r[t]:null,[t,r]);if((r.length===0||j(y))&&!i)return null;if((r.length===0||j(y))&&i)return s.jsx(B,{});const E=r.length>1;return s.jsx("div",{className:M("h-screen w-full overflow-hidden rounded-lg",{"max-h-screen-25":o===F,"max-h-screen-50":o===k,"max-h-screen-75":o===$,"max-h-screen":o===D}),children:s.jsxs("div",{className:M("relative flex h-screen max-h-full w-full flex-col overflow-hidden",{border:!b,[`${d.surfaces.elevation1} ${d.borders.two}`]:!b&&n,"border-stone-200 bg-white":!b&&!n}),children:[u&&s.jsx("div",{className:"pb-1 pl-2 pr-2 pt-1 text-lg font-medium",children:y?.name||""}),s.jsx("div",{className:"relative flex h-full w-full items-center justify-center overflow-hidden",children:s.jsx(_,{file:y})}),E&&h&&s.jsx("div",{className:"absolute bottom-0 left-4 top-0 z-50 flex items-center",children:s.jsx("button",{className:`rounded-full border p-1 shadow-lg ${n?`${d.surfaces.elevation2} ${d.text.secondary} ${d.borders.two}`:"border-stone-200 bg-white text-stone-700"}`,"data-testid":"file-gallery-previous-button",disabled:!h,onClick:I,children:s.jsx(O,{size:20})})}),E&&x&&s.jsx("div",{className:"absolute bottom-0 right-4 top-0 z-50 ml-auto flex items-center",children:s.jsx("button",{className:`rounded-full border p-1 shadow-lg ${n?`${d.surfaces.elevation2} ${d.text.secondary} ${d.borders.two}`:"border-stone-200 bg-white text-stone-700"}`,"data-testid":"file-gallery-next-button",disabled:!x,onClick:N,children:s.jsx(V,{size:20})})})]})})};export{ae as default,G as getFileValues};
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.