1import{r as t,a as z,S as L,j as e,$ as N}from"./app-m2ZZUNZw.js";import{W as Y}from"./web-layout-C0kpAb3y.js";import{N as H}from"./note-card-DzRFdpYG.js";import{S as k}from"./search-DJqfjM5c.js";import{L as $}from"./loader-circle-DA0lCRqU.js";import{A as F}from"./arrow-right-X_MxY_Bd.js";import{C as J}from"./cpu-C8m6fRof.js";import{T as Q}from"./tag-BbQILWHS.js";import{S as K}from"./sparkles-D3zaZYDw.js";/* empty css */import"./sun-D0wdOhtN.js";import"./createLucideIcon-h_FJXIk9.js";import"./x-CPNFyxTU.js";import"./external-link-DcWPyGpL.js";import"./mail-DvU1hLxm.js";import"./utils--0HDzF2j.js";import"./index-B8X2HPx5.js";import"./bookmark-D9JbDyyI.js";import"./seo-url-DGziiG5d.js";import"./dialog-BzF37tBz.js";import"./index-lluC3nh6.js";import"./tooltip-DVBzVA2t.js";import"./floating-ui.react-dom-WW8yS3hh.js";import"./floating-ui.dom-B7cXm8BB.js";import"./dropdown-menu-Cvp4K3k2.js";import"./check-DDaIUxjw.js";import"./chevron-right-kLG2TwML.js";import"./link-2-B6qZZVUZ.js";import"./copy-BB8vCnWS.js";import"./download-CkFWaQHv.js";import"./trash-2-xkiXFygS.js";import"./heart-L8tnbVB_.js";import"./trending-up-SlZY4CiN.js";function Ie({initialSearch:x="",initialCategoryId:p=null,categories:q,platforms:W,tags:B,prompts:s}){const G="AI-Nots",[a,u]=t.useState(x),[l,h]=t.useState(p),[g,S]=t.useState((s==null?void 0:s.data)||[]),[C,E]=t.useState((s==null?void 0:s.current_page)||1),[n,f]=t.useState(s?s.current_page<s.last_page:!1),[i,I]=t.useState(!1),[A,T]=t.useState(!1),[_,M]=t.useState([]),[O,d]=t.useState(!1),b=t.useRef(null),y=t.useRef(null);t.useEffect(()=>{const o=((s==null?void 0:s.data)||[]).filter((c,m,j)=>m===j.findIndex(v=>v.id===c.id));S(o),E((s==null?void 0:s.current_page)||1),f(s?s.current_page<s.last_page:!1),T(!1)},[s]),t.useEffect(()=>{const r=setTimeout(async()=>{if(a.length>=2)try{const o=await z.get(route("api.search.suggestions"),{params:{q:a}});M(o.data),d(!0)}catch(o){console.error("Suggestions error",o)}else M([]),d(!1);(a!==x||l!==p)&&(T(!0),L.get(route("explore"),{search:a||void 0,category_id:l||void 0},{preserveState:!0,preserveScroll:!0,replace:!0,only:["prompts","initialSearch","initialCategoryId"]}))},500);return()=>clearTimeout(r)},[a,l,x,p]);const R=t.useCallback(async()=>{if(!(i||!n)){I(!0);try{const r=C+1,o=await z.get(route("explore"),{params:{search:a||void 0,category_id:l||void 0,page:r},headers:{Accept:"application/json"}}),c=o.data.data||[];c.length>0?(S(m=>{const j=new Set(m.map(w=>w.id)),v=c.filter(w=>!j.has(w.id));return[...m,...v]}),E(r),f(r<o.data.last_page)):f(!1)}catch(r){console.error("Error loading more prompts:",r)}finally{I(!1)}}},[C,n,i,a,l]);return t.useEffect(()=>{const r=new IntersectionObserver(o=>{o[0].isIntersecting&&n&&!i&&R()},{threshold:.5});return y.current&&r.observe(y.current),b.current=r,()=>{b.current&&b.current.disconnect()}},[R,n,i]),e.jsx(Y,{title:"Explore",description:"Browse the world's most organized AI prompt library. Find optimized prompts for ChatGPT, Claude, and Midjourney.",children:e.jsxs("div",{className:"bg-background dark:bg-[#030712] transition-colors min-h-screen relative overflow-hidden",children:[e.jsxs("section",{className:"relative border-b border-border/50",children:[e.jsxs("div",{className:"absolute inset-0 -z-10 pointer-events-none overflow-hidden",children:[e.jsx("div",{className:"absolute top-[-20%] left-[-10%] w-[60%] h-[60%] bg-primary/20 blur-[120px] rounded-full animate-float opacity-50 dark:opacity-30"}),e.jsx("div",{className:"absolute bottom-[-10%] right-[-10%] w-[50%] h-[50%] bg-blue-600/20 blur-[100px] rounded-full animate-pulse [animation-delay:2s] opacity-50 dark:opacity-20"})]}),e.jsxs("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-16 sm:py-24 relative text-center",children:[e.jsxs("div",{className:"animate-reveal",children:[e.jsxs("div",{className:"inline-flex items-center gap-2 px-4 py-2 rounded-full bg-primary/10 text-primary text-sm font-semibold mb-8 backdrop-blur-sm border border-primary/20 shadow-sm",children:[e.jsx(k,{className:"w-4 h-4"}),e.jsx("span",{children:"Discover Precision Prompts"})]}),e.jsxs("h1",{className:"text-5xl sm:text-6xl md:text-7xl font-black tracking-tight mb-8",children:[e.jsx("span",{className:"bg-gradient-to-b from-foreground to-foreground
1/70 bg-clip-text text-transparent",children:"Explore the"}),e.jsx("br",{}),e.jsx("span",{className:"bg-gradient-to-r from-primary via-blue-500 to-purple-600 bg-clip-text text-transparent italic drop-shadow-sm px-2 text-6xl md:text-8xl",children:"Library."})]})]}),e.jsx("div",{className:"max-w-3xl mx-auto animate-reveal [animation-delay:0.2s]",children:e.jsx("div",{className:"search-glow",children:e.jsxs("div",{className:"relative glass-card rounded-[2rem] p-1.5 shadow-2xl overflow-hidden border-white/20 dark:border-white/10",children:[e.jsx("div",{className:"absolute left-6 top-1/2 transform -translate-y-1/2 text-primary",children:A?e.jsx($,{className:"w-6 h-6 animate-spin"}):e.jsx(k,{className:"w-6 h-6"})}),e.jsx("input",{type:"text",value:a,onChange:r=>u(r.target.value),onFocus:()=>a.length>=2&&d(!0),onBlur:()=>setTimeout(()=>d(!1),200),placeholder:"Search by keyword, tag, or platform...",className:"w-full pl-16 pr-8 py-5 text-xl bg-transparent border-none focus:ring-0 outline-none transition-all text-foreground placeholder:text-muted-foreground/50 font-semibold"}),O&&_.length>0&&e.jsx("div",{className:"absolute left-0 right-0 top-full mt-2 glass-card rounded-2xl border border-white/20 dark:border-white/10 shadow-2xl z-50 overflow-hidden animate-reveal",children:_.map(r=>e.jsxs("button",{onClick:()=>L.visit(r.url),className:"w-full text-left px-6 py-4 hover:bg-primary/10 transition-colors flex items-center justify-between group border-b border-border/50 last:border-none",children:[e.jsx("span",{className:"font-bold text-foreground",children:r.title}),e.jsx(F,{className:"w-4 h-4 text-primary opacity-0 group-hover:opacity-100 transition-all"})]},r.id))})]})})})]})]}),e.jsx("section",{className:"sticky top-[64px] z-30 bg-background/80 backdrop-blur-md border-b border-border/50 py-4",children:e.jsx("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8",children:e.jsxs("div",{className:"flex items-center gap-2 overflow-x-auto pb-2 [&::-webkit-scrollbar]:hidden [-ms-overflow-style:none] [scrollbar-width:none]",children:[e.jsx("button",{onClick:()=>h(null),className:`flex-shrink-0 px-6 py-2.5 rounded-full text-sm font-bold transition-all ${l?"bg-background hover:bg-accent border border-border":"bg-primary text-primary-foreground shadow-lg shadow-primary/20"}`,children:"All Prompts"}),q.map(r=>e.jsx("button",{onClick:()=>h(r.id),className:`flex-shrink-0 px-6 py-2.5 rounded-full text-sm font-bold transition-all ${l===r.id?"bg-primary text-primary-foreground shadow-lg shadow-primary/20":"bg-background hover:bg-accent border border-border"}`,children:r.name},r.id))]})})}),e.jsxs("section",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-16",children:[e.jsx("div",{className:"flex items-baseline justify-between mb-12",children:e.jsxs("div",{children:[e.jsx("h2",{className:"text-3xl font-black italic tracking-tight text-foreground",children:a?"Search Results":"Curated Collection"}),e.jsxs("p",{className:"text-muted-foreground font-medium mt-1",children:["Showing ",a?"the best matches for your search":"curated high-performance AI prompts","."]})]})}),e.jsx("div",{className:`transition-opacity duration-300 ${A?"opacity-50 pointer-events-none":"opacity-100"}`,children:g.length>0?e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-8",children:g.map((r,o)=>e.jsx("div",{className:"animate-reveal",style:{animationDelay:`${o*.05}s`},children:e.jsx(H,{prompt:r,index:o})},r.id))}),n&&e.jsx("div",{ref:y,className:"py-12 flex justify-center mt-8",children:e.jsx($,{className:"w-8 h-8 animate-spin text-primary"})}),!n&&g.length>0&&e.jsx("div",{className:"text-center py-12 mt-8 text-muted-foreground font-medium",children:"You've reached the end of the collection."})]}):e.jsxs("div",{className:"text-center py-24 glass-card rounded-[3rem] border-dashed border-2",children:[e.jsx("div",{className:"p-6 bg-accent rounded-full w-fit mx-auto mb-6",children:e.jsx(k,{className:"w-12 h-12 text-muted-foreground"})}),e.jsx("h3",{className:"text-2xl font-black mb-2",children:"No Prompts Found"}),e.jsx("p",{className:"text-muted-foreground font-medium mb-8",children:"Try adjusting your filters or search keywords."}),e.jsx("div",{className:"flex flex-wrap justify-center gap-3 mb-8 max-w-md mx-auto",children:["SEO","ChatGPT","Marketing","Writing","Code","Blog"].map(r=>e.jsx("button",{onClick:()=>u(r),className:"px-4 py-2 rounded-xl bg-primary/5 border border-primary/20 text-primary text-sm font-bold hover:bg-primary hover:text-primary-foreground transition-all",children:r},r))}),e.jsx("button",{onClick:()=>{u(""),h(null)},className:"text-primary font-bold hover:underline",children:"Reset Search"})]})})]}),e.jsx("section",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-20 border-t border-border/50",children:e.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-16",children:[e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center gap-3 mb-8",children:[e.jsx(J,{className:"text-primary w-8 h-8"}),e.jsx("h2",{className:"text-3xl font-black tracking-tight italic",children:"Platforms"})]}),e.jsx("div",{className:"grid grid-cols-2 gap-4",children:W.map(r=>e.jsxs(N,{href:route("platform.show",r.slug),className:"p-5 glass-card rounded-2xl hover:border-primary/50 transition-all flex items-center justify-between group",children:[e.jsx("span",{className:"font-bold text-foreground",children:r.name}),e.jsx(F,{className:"w-4 h-4 opacity-0 group-hover:opacity-100 group-hover:translate-x-1 transition-all"})]},r.id))})]}),e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center gap-3 mb-8",children:[e.jsx(Q,{className:"text-primary w-8 h-8"}),e.jsx("h2",{className:"text-3xl font-black tracking-tight italic",children:"Popular Tags"})]}),e.jsx("div",{className:"flex flex-wrap gap-2",children:B.map(r=>e.jsxs(N,{href:route("tag.show",r.slug),className:"px-4 py-2 rounded-xl bg-accent/30 border border-border/50 hover:bg-primary hover:text-primary-foreground hover:scale-105 transition-all text-xs font-bold uppercase tracking-widest",children:["#",r.name]},r.id))})]})]})}),e.jsx("section",{className:"max-w-5xl mx-auto px-4 py-24",children:e.jsxs("div",{className:"glass-card rounded-[3rem] p-12 text-center border-primary/20 relative overflow-hidden group",children:[e.jsx("div",{className:"absolute inset-0 bg-primary/5 -z-10 group-hover:scale-110 transition-transform duration-700"}),e.jsx("h2",{className:"text-4xl font-black mb-6 italic tracking-tight",children:"Level up your AI game"}),e.jsxs("p",{className:"text-muted-foreground text-lg mb-10 max-w-xl mx-auto font-medium",children:["Join thousands of creators who are organizing their AI workflows with ",G,". Start your precision library today."]}),e.jsxs(N,{href:route("prompt.create"),className:"inline-flex items-center gap-3 bg-primary text-primary-foreground px-10 py-5 rounded-3xl font-black text-sm hover:scale-105 active:scale-95 transition-all shadow-xl shadow-primary/20",children:[e.jsx(K,{className:"w-5 h-5"}),"Launch Your First Prompt"]})]})})]})})}export{Ie 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.