1import{d as H,c as J,j as Y,V as K,i as Z,l as i,m as b,w as c,p as a,a5 as tt,ai as et,z as st,q as t,aV as ot,J as u,D as at,r as k,s as f,F as nt,B as lt,n,C as rt,x as it,y,t as d,A as ct,ah as ut,a6 as dt,E as w,X as wt,aW as _t,aT as pt,aH as mt,cG as ht,G as ft}from"./BzxC8KJp.js";import{u as xt}from"./BtgP3dOy.js";const gt={class:"tw-flex tw-flex-row tw-items-center tw-justify-between tw-gap-4 tw-mb-2"},vt={class:"tw-flex tw-flex-row tw-items-center tw-gap-4 tw-w-full"},St={class:"tw-group tw-relative tw-block tw-h-16 tw-aspect-video tw-shrink-0 tw-self-start tw-overflow-hidden tw-rounded-lg tw-bg-gray-100 tw-shadow-md"},bt={class:"tw-flex tw-flex-col tw-gap-2 tw-overflow-hidden"},kt={class:"tw-text-xl tw-font-bold tw-text-gray-800 dark:tw-text-white tw-break-words"},yt={class:"tw-text-sm tw-text-subtle dark:tw-text-subtle-dark tw-break-words"},Ut={class:"tw-text-sm tw-text-subtle dark:tw-text-subtle-dark tw-break-words"},Ct={class:"tw-text-very-subtle dark:tw-text-very-subtle-dark"},Pt={key:0,class:"tw-min-w-20 XXXtw-w-12"},Nt=H({name:"InternalSearchModal",__name:"InternalSearchModal",props:{showSelectBtn:{type:Boolean,default:!0}},emits:["selected"],setup(U,{emit:C}){const P=U,x=ht("dialogRef"),N=J(),{getNormalisedSubject:B,getPlainTextFromContent:V,getPostAuthor:A}=Y(),o=w(null),r=ft(null),g=w(0),R=w(1),$=w(100),I=()=>wt.appendQueries("/api/services/app/SportseeAdmin/GetPostsForAdmin",{siteId:N.currentSite?.id,page:R.value,take:$.value,status:_t.All,searchStr:o.value}),{data:_,fetchStatus:O,fetchError:p,refresh:j,loading:m}=xt(I,!0,"EXTERNAL");K(O,(e,l)=>{l!==e&&e==="success"&&!p.value&&_.value?.items&&(r.value=_.value.items,g.value=_.value?.totalCount)});const h=Z(()=>!r.value||r.value.length===0||u.isNullOrWhitespace(o.value)?[]:r.value),D=()=>{o.value=null,r.value=null,g.value=0},E=()=>{u.isNullOrWhitespace(o.value)||j()},M=e=>e.isPublished===!1?"(Not Yet Published)":pt.toMediumDate(e.publishDate),W=e=>{F("selected",e),x.value.hide()},F=C;return(e,l)=>{const X=et,v=tt,L=ot,T=at,q=rt,S=it,z=ct,G=dt,Q=mt;return i(),b(Q,{ref_key:"dialogRef",ref:x,title:"Search Posts",showCardActions:!1,width:"560px",onBeforeShow:D},{default:c(()=>[a(v,null,{default:c(()=>[a(X,{modelValue:t(o),"onUpdate:modelValue":[l[0]||(l[0]=s=>st(o)?o.value=s:null),E],placeholder:"Search for post",explicit:"",autofocus:"",class:"tw-w-full"},null,8,["modelValue"])]),_:1}),a(v,{class:"tw-max-h-[60vh] tw-h-[60vh] md:tw-max-h-[500x] md:tw-h-[500px] tw-my-2 tw-ml-2 scroll",padding:"0 2px"},{default:c(()=>[a(L,{loading:t(m),text:"Searching...",error:t(p)},null,8,["loading","error"]),!t(m)&&!t(p)&&!("strUtils"in e?e.strUtils:t(u)).isNullOrWhitespace(t(o))&&t(h).length===0?(i(),b(T,{key:0,text:"No Posts"})):k("",!0),!t(m)&&!("strUtils"in e?e.strUtils:t(u)).isNullOrWhitespace(t(o))&&t(h).length>0?(i(!0),f(nt,{key:1},lt(t(h),(s,Bt)=>(i(),f("div",{key:s.id,class:"tw-my-2 tw-mx-0 sm:tw-mx-1.5"},[n("article",gt,[n("div",vt,[n("div",St,[a(q,{fit:"cover",src:s.heroImageUrl,ratio:16/9,loading:"lazy",class:"tw-aspect-video tw-absolute tw-inset-0 tw-h-full tw-w-full tw-object-cover tw-object-center tw-transition tw-duration-200 group-hover:tw-scale-110"},null,8,["src"])]),n("div",bt,[n("h2",kt,[a(S,{to:`/post/${s.guid}`,class:"tw-transition tw-duration-100"},{default:c(()=>[y(d(t(B)(s)),1)]),_:2},1032,["to"])]),n("span",yt,d(t(A)(s).name),1),n("span",Ut,d(M(s)),1),n("p",Ct,d(("strUtils"in e?e.strUtils:t(u)).truncateStringWithPostfix(t(V)(s.content),100,"...")),1),n("div",null,[a(S,{to:`/post/${s.guid}`,class:"tw-font-semibold tw-text-rose-500 tw-transition tw-duration-100 hover:tw-text-rose-600 active:tw-text-rose-700"},{default:c(()=>[...l[1]||(l[1]=[y("View â",-1)])]),_:1},8,["to"])])])]),P.showSelectBtn?(i(),f("div",Pt,[a(z,{label:"Select",dense:"","icon-right":"arrow_forward_ios",onClick:Vt=>W(s)},null,8,["onClick"])])):ut(e.$slots,"actions",{key:1,post:s})]),a(G)]))),128)):k("",!0)]),_:3})]),_:3},512)}}}),$t=Object.assign(Nt,{__name:"SearchInternalSearchModal"});export{$t 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.