1import{_ as F}from"./DORtTwy0.js";import{_ as S}from"./M_isy2y5.js";import{r as U,V as q,W as A,x as D,a7 as E,o as n,c as w,A as e,a as N,t as R,a4 as b,af as V,a8 as I,z as d,w as j,B as p,F as z,q as O,R as _,I as m,e as T,p as M,aY as W,aw as Y}from"./E4wIjeAY.js";import{d as G}from"./CEp89hE0.js";import{u as H}from"./DxyaNNSA.js";import{u as J,g as K}from"./CmwXoQr8.js";import"./Bc-0F0ao.js";import"./Dx8Jabvz.js";import"./Bp8qykg5.js";import"./CeT11JyB.js";const Q={key:0,class:"flex items-center gap-2 py-1 pr-1"},X=["title"],ce=U({__name:"RecordFieldPreview",props:{name:{type:String,required:!0},value:{type:Number},options:{type:Object,required:!0},canUpdate:{type:Boolean,default:!1},record:{type:Object},language:{type:String}},emits:["refresh"],async setup(t){let h,y;const o=t,x=H(),$=O(),g=J(),s=_(()=>x.value.collections[o.options.collection]),v=_(()=>{var a;return((a=g.value)==null?void 0:a.isAdmin)||K(g.value)[`collection-${s.value.name}-update`]}),f=_(()=>{var a;return((a=Y(o.options.recordLabel))==null?void 0:a[0])??s.value.dashboard.overviewTable.searchLabel[0]}),i=m(!1),c=m(!1),r=m(""),l=m(null),C=G.StringFieldPreview();return[h,y]=q(()=>A("pruvious-dashboard")),await h,y(),D(()=>o.value,async()=>{if(o.value){c.value=!0;const a=await M(`collections/${o.options.collection}/${o.value}`,{query:{select:f.value},dispatchEvents:!1});if(a.success){const u=W(a.data[f.value]);i.value=!u,r.value=u||s.value.fields[f.value].additional.emptyLabel,l.value=a.data}else i.value=!1,r.value="",l.value=null;c.value=!1}else i.value=!1,r.value="",l.value=null},{immediate:!0}),(a,u)=>{const P=F,k=S,L=T,B=E("pruvious-tooltip");return n(),w(z,null,[e(l)&&!e(c)?(n(),w("div",Q,[N("span",{title:e(i)?void 0:e(r),class:V(["truncate",{"text-gray-400":e(i)}])},R(e(b)("pruvious-dashboard",e(r))),11,X),I((n(),d(L,{to:`/${e($).public.pruvious.dashboardPrefix}/collections/${e(s).name}/${t.value}`,class:"button button-white button-square-xs"},{default:j(()=>[e(v)?(n(),d(P,{key:0,class:"h-4 w-4"})):p("",!0),e(v)?p("",!0):(n(),d(k,{key:1,class:"h-4 w-4"}))]),_:1},8,["to"])),[[B,e(v)?e(b)("pruvious-dashboard","Edit $item",{item:e(s).label.record.singular}):e(b)("pruvious-dashboard","View $item",{item:e(s).label.record.singular})]])])):p("",!0),!e(l)&&!e(c)?(n(),d(e(C),{key:1,canUpdate:t.canUpdate,name:t.name,options:t.options,value:t.value,onRefresh:u[0]||(u[0]=Z=>a.$emit("refresh"))},null,8,["canUpdate","name","options","value"])):p("",!0)],64)}}});export{ce as default};
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.