import{d as y,s as v,r as x,y as B,c as r,o as a,b as l,a as s,e as w,i as C,F as u,g as N,w as m,l as z,u as i,h as L,t as _,n as D,N as S,E as p}from"./app-Do7K7VDV.js";import{_ as T}from"./UserLayout-B1erUghk.js";import{_ as V}from"./NoDataFound-oJx-Mfyi.js";import{_ as $}from"./FilterDropdown-HyKaUaTA.js";import"./AssetModal-C18ToIEK.js";import"./_plugin-vue_export-helper-DlAUqK2U.js";import"./InputFieldError-0BmYlL24.js";import"./ToastrContainer-CtYDvNPN.js";import"./SpinnerBtn-C-rqKjUt.js";const E={class:"mt-8 grid grid-cols-1 gap-8 lg:grid-cols-3"},j={class:"flex items-center justify-start gap-4 border-b border-primary-600 pb-8"},F={alt:"image",class:"h-full w-full rounded-full"},H={class:"text-sm capitalize text-gray-500"},M=["onClick"],O=["innerHTML"],A=y({layout:T}),X=Object.assign(A,{__name:"Index",props:["templates","credits","bookmarked","segments"],setup(n){const{textExcerpt:c,uiAvatar:f,trim:k}=v(),b=(t,o)=>{S.post(route("user.ai-tools.bookmark"),{ai_template_id:t},{onSuccess:()=>{o==1?p.danger("Bookmarked Removed Successfully"):p.success("Bookmarked Successfully")}})},h=[{label:"Title",value:"title"},{label:"Description",value:"description"}];return(t,o)=>{const d=x("Link"),g=B("lazy");return a(),r(u,null,[l($,{options:h}),s("div",E,[(a(!0),r(u,null,N(n.templates,e=>(a(),r("div",{key:e.id,class:"card card-body"},[s("div",j,[l(d,{href:t.route("user.ai-tools.show",e.uuid),class:"logo h-16 min-w-[4rem]"},{default:m(()=>[z(s("img",F,null,512),[[g,i(f)(e.title,e.icon)]])]),_:2},1032,["href"]),s("div",null,[l(d,{href:t.route("user.ai-tools.show",e.uuid),class:"font-semibold capitalize"},{default:m(()=>[L(_(i(c)(e.title,65)),1)]),_:2},1032,["href"]),s("p",H,_(i(k)(e.prompt_type)),1)]),s("button",{onClick:I=>b(e.id,e.isBookmarked),type:"button",class:D(["btn ml-auto h-10 w-10 rounded-full",{"btn-primary":e.isBookmarked==1,"btn-outline-primary":e.isBookmarked==0}])},o[0]||(o[0]=[s("i",{class:"bx bx-bookmark-alt-minus text-xl"},null,-1)]),10,M)]),s("div",{innerHTML:i(c)(e.description,100),class:"pt-5"},null,8,O)]))),128))]),n.templates.length<1?(a(),w(V,{key:0})):C("",!0)],64)}}});export{X as default};
