1import{j as e}from"./vendor-motion-CnFAAAIE.js";import{f as t,r as s,R as l}from"./vendor-react-BCghNb5z.js";import{u as a}from"./index-BNnIcVqH.js";import{L as i,K as r,Y as o,n,X as d,c,P as x,o as u,F as m,p as g,aP as p,z as b,by as h,ag as f,V as v,bA as j,bl as y,a0 as w,B as N,bz as k}from"./vendor-icons-BMJDTczB.js";const z=/\.(svg|png|jpg|jpeg|webp|gif|avif)(\?|$)/i,C=e=>!!e&&z.test(e),S={presentations:{label:"Presentation",filterKey:"presentation",studio:"professional",mediaType:"slide"},templates:{label:"Presentation",filterKey:"presentation",studio:"professional",mediaType:"slide"},spreadsheets:{label:"Spreadsheet",filterKey:"spreadsheet",studio:"professional",mediaType:"spreadsheet"},documents:{label:"Document",filterKey:"document",studio:"professional",mediaType:"document"},logicFlows:{label:"Process Flow",filterKey:"processflow",studio:"professional",mediaType:"processflow"},images:{label:"Image",filterKey:"image",studio:"creative",mediaType:"slide"},videos:{label:"Video",filterKey:"video",studio:"creative",mediaType:"video"},music:{label:"Music",filterKey:"music",studio:"creative",mediaType:"music"}};function T(e){const t=(e??"").toLowerCase().replace(/[_\s-]/g,"");return t.includes("presentation")||t.includes("ppt")||t.includes("slide")||t.includes("presentation")||t.includes("ppt")||t.includes("slide")?{label:"Presentation",filterKey:"presentation",studio:"professional",mediaType:"slide"}:t.includes("spreadsheet")||t.includes("sheet")||t.includes("excel")||t.includes("csv")?{label:"Spreadsheet",filterKey:"spreadsheet",studio:"professional",mediaType:"spreadsheet"}:t.includes("document")||t.includes("doc")||t.includes("pdf")?{label:"Document",filterKey:"document",studio:"professional",mediaType:"document"}:t.includes("flow")||t.includes("process")||t.includes("logic")?{label:"Process Flow",filterKey:"processflow",studio:"professional",mediaType:"processflow"}:t.includes("whiteboard")?{label:"Whiteboard",filterKey:"whiteboard",studio:"professional",mediaType:"slide"}:t.includes("diagram")||t.includes("3d")?{label:"3D Diagrams",filterKey:"diagram",studio:"professional",mediaType:"slide"}:t.includes("notebook")?{label:"Notebook",filterKey:"notebook",studio:"professional",mediaType:"slide"}:t.includes("image")||t.includes("img")||t.includes("photo")||t.includes("svg")||t.includes("png")?{label:"Image",filterKey:"image",studio:"creative",mediaType:"slide"}:t.includes("aivideo")||t.includes("ai_video")||t.includes("ai")&&t.includes("video")?{label:"AI Video",filterKey:"aivideo",studio:"creative",mediaType:"video"}:t.includes("video")||t.includes("mp4")?{label:"Video",filterKey:"video",studio:"creative",mediaType:"video"}:t.includes("screenrecording")||t.includes("screen")?{label:"Screen Recording",filterKey:"screen-recording",studio:"creative",mediaType:"video"}:t.includes("music")||t.includes("audio")||t.includes("mp3")||t.includes("sound")?{label:"Music",filterKey:"music",studio:"creative",mediaType:"music"}:null}const P=[{id:"all",label:"All",icon:e.jsx(i,{size:20}
1),color:"text-violet-600",bg:"bg-violet-100",studio:"all"},{id:"presentation",label:"PPT",icon:e.jsx(c,{size:20}),color:"text-orange-500",bg:"bg-orange-100",studio:"professional"},{id:"spreadsheet",label:"Spreadsheet",icon:e.jsx(u,{size:20}),color:"text-green-600",bg:"bg-green-100",studio:"professional"},{id:"document",label:"Document",icon:e.jsx(m,{size:20}),color:"text-blue-600",bg:"bg-blue-100",studio:"professional"},{id:"processflow",label:"Process Flow",icon:e.jsx(g,{size:20}),color:"text-purple-600",bg:"bg-purple-100",studio:"professional"},{id:"whiteboard",label:"Whiteboard",icon:e.jsx(p,{size:20}),color:"text-red-500",bg:"bg-red-100",studio:"professional"},{id:"notebook",label:"Notebook",icon:e.jsx(b,{size:20}),color:"text-indigo-500",bg:"bg-indigo-100",studio:"professional"},{id:"diagram",label:"3D Diagrams",icon:e.jsx(h,{size:20}),color:"text-cyan-600",bg:"bg-cyan-100",studio:"creative"},{id:"image",label:"Image Studio",icon:e.jsx(f,{size:20}),color:"text-pink-500",bg:"bg-pink-100",studio:"creative"},{id:"video",label:"Video Studio",icon:e.jsx(v,{size:20}),color:"text-orange-500",bg:"bg-orange-100",studio:"creative"},{id:"screen-recording",label:"Screen Recording",icon:e.jsx(j,{size:20}),color:"text-yellow-500",bg:"bg-yellow-100",studio:"creative"},{id:"music",label:"Music",icon:e.jsx(y,{size:20}),color:"text-teal-500",bg:"bg-teal-100",studio:"creative"},{id:"audio",label:"Audio Studio",icon:e.jsx(w,{size:20}),color:"text-rose-500",bg:"bg-rose-100",studio:"creative"}],K={All:"all",PPT:"presentationShort",Presentation:"presentation",Spreadsheet:"spreadsheet",Document:"document","Process Flow":"processflow",Whiteboard:"whiteboard",Notebook:"notebook","3D Diagrams":"diagram3d",Image:"image","Image Studio":"imageStudio",Video:"video","Video Studio":"videoStudio","AI Video":"aiVideo","Screen Recording":"screenRecording",Music:"music","Audio Studio":"audioStudio",Template:"template"},M=()=>{const{tKey:e}=a();return t=>{const s=K[t];return s?e(`templatesPage.types.${s}`):t}},$={Presentation:{grad:"from-violet-600 to-indigo-500",icon:e.jsx(c,{size:32})},Image:{grad:"from-pink-500 to-rose-400",icon:e.jsx(f,{size:32})},Spreadsheet:{grad:"from-emerald-500 to-teal-400",icon:e.jsx(u,{size:32})},"Process Flow":{grad:"from-sky-500 to-cyan-400",icon:e.jsx(g,{size:32})},Document:{grad:"from-orange-500 to-amber-400",icon:e.jsx(m,{size:32})},Video:{grad:"from-red-600 to-rose-500",icon:e.jsx(v,{size:32})},Music:{grad:"from-fuchsia-600 to-purple-500",icon:e.jsx(y,{size:32})}},V={grad:"from-slate-500 to-slate-400",icon:e.jsx(i,{size:32})},D=()=>{const{t:t}=a(),s=t.templatesPage.heroCards;return e.jsxs("div",{className:"relative h-[320px] w-full select-none pointer-events-none",children:[e.jsx("div",{className:"absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 w-72 h-72 bg-violet-200/50 rounded-full blur-3xl"}),e.jsxs("div",{className:"absolute top-0 left-10 w-52 rounded-2xl p-4 shadow-2xl rotate-[-4deg] z-10",style:{background:"linear-gradient(135deg, #3B6FE8 0%, #5B4FE9 100%)"},children:[e.jsxs("div",{className:"flex items-center gap-1.5 mb-2",children:[e.jsx("div",{className:"w-5 h-5 bg-white/20 rounded-md flex items-center justify-center",children:e.jsx(c,{size:10,className:"text-white"})}),e.jsx("span",{className:"text-white/60 text-[10px]",children:s.presentation})]}),e.jsx("div",{className:"text-white font-bold text-sm mb-3",children:s.businessStrategy}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsx("div",{className:"h-1 bg-white/25 rounded-full"}),e.jsx("div",{className:"h-1 bg-white/15 rounded-full w-4/5"}),e.jsx("div",{className:"h-9 bg-white/10 rounded-lg mt-2 relative overflow-hidden flex items-end justify-around px-2 pb-1 gap-1",children:[50,70,45,80,60].map((t,s)=>e.jsx("div",{className:"flex-1 rounded-sm",style:{height:`${t}%`,background:1===s?"#F59E0B":"rgba(255,255,255,0.3)"}},s))})]})]}),e.jsxs("div",{className:"absolute top-2 right-0 w-44 bg-white rounded-2xl p-3 shadow-xl rotate-[4deg] z-20",children:[e.jsx("div",{className:"text-gray-400 text-[9px] font-semibold mb-2",children:s.q1Financial}),e.jsx("div",{className:"flex items-end gap-0.5 h-10 mb-2",children:[40,65,45,80,55,90,70].map((t,s)=>e.jsx("div",{className:"flex-1 bg-emerald-400 rounded-sm",style:{height:`${t}%`,opacity:.85}},s))}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("span",{className:"text-[9px] text-gray-400",children:s.revenue}),e.jsxs("div",{className:"relative w-9 h-9",children:[e.jsxs("svg",{viewBox:"0 0 36 36",className:"w-9 h-9 -rotate-90",children:[e.jsx("circle",{cx:"18",cy:"18",r:"13",fill:"none",stroke:"#e5e7eb",strokeWidth:"4"}),e.jsx("circle",{cx:"18",cy:"18",r:"13",fill:"none",stroke:"#10b981",strokeWidth:"4",strokeDasharray:"51 82",strokeLinecap:"round"})]}),e.jsx("span",{className:"absolute inset-0 flex items-center justify-center text-[8px] font-bold text-gray-700",children:"62%"})]})]})]}
1),e.jsxs("div",{className:"absolute top-36 left-0 w-50 bg-white rounded-2xl p-3 shadow-lg rotate-[-2deg] z-30",children:[e.jsx("div",{className:"text-gray-700 text-[10px] font-semibold mb-2.5",children:s.projectRoadmap}),e.jsx("div",{className:"space-y-2",children:[{label:s.design,color:"bg-blue-400",w:"75%"},{label:s.dev,color:"bg-orange-400",w:"55%"},{label:s.qa,color:"bg-emerald-400",w:"65%"}].map((t,s)=>e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"text-[8px] text-gray-400 w-9 shrink-0",children:t.label}),e.jsx("div",{className:"flex-1 h-1.5 bg-gray-100 rounded-full",children:e.jsx("div",{className:`h-1.5 ${t.color} rounded-full`,style:{width:t.w}})})]},s))})]}),e.jsxs("div",{className:"absolute bottom-6 right-2 w-44 h-28 rounded-2xl shadow-xl rotate-[2deg] z-20 flex items-center justify-center overflow-hidden",style:{background:"linear-gradient(135deg, #3B6FE8 0%, #5B4FE9 100%)"},children:[e.jsx("div",{className:"w-11 h-11 bg-white/25 backdrop-blur rounded-full flex items-center justify-center",children:e.jsx(x,{size:18,className:"text-white ml-0.5"})}),e.jsx("span",{className:"absolute bottom-2.5 right-3 text-white/70 text-[10px] font-bold",children:"02:45"})]})]})},A=/\.svg(\?|$)/i,B={presentation:{label:"PPT",textColor:"text-orange-500 dark:text-orange-400",bgColor:"bg-orange-100 dark:bg-orange-900/30",icon:e.jsx(c,{size:14})},spreadsheet:{label:"Spreadsheet",textColor:"text-green-600 dark:text-green-400",bgColor:"bg-green-100 dark:bg-green-900/30",icon:e.jsx(u,{size:14})},processflow:{label:"Process Flow",textColor:"text-blue-600 dark:text-blue-400",bgColor:"bg-blue-100 dark:bg-blue-900/30",icon:e.jsx(g,{size:14})},document:{label:"Document",textColor:"text-purple-600 dark:text-purple-400",bgColor:"bg-purple-100 dark:bg-purple-900/30",icon:e.jsx(m,{size:14})},whiteboard:{label:"Whiteboard",textColor:"text-red-500 dark:text-red-400",bgColor:"bg-red-100 dark:bg-red-900/30",icon:e.jsx(p,{size:14})},diagram:{label:"3D Diagrams",textColor:"text-cyan-600 dark:text-cyan-400",bgColor:"bg-cyan-100 dark:bg-cyan-900/30",icon:e.jsx(h,{size:14})},notebook:{label:"Notebook",textColor:"text-indigo-500 dark:text-indigo-400",bgColor:"bg-indigo-100 dark:bg-indigo-900/30",icon:e.jsx(b,{size:14})},image:{label:"Image Studio",textColor:"text-pink-500 dark:text-pink-400",bgColor:"bg-pink-100 dark:bg-pink-900/30",icon:e.jsx(f,{size:14})},video:{label:"Video Studio",textColor:"text-orange-500 dark:text-orange-400",bgColor:"bg-orange-100 dark:bg-orange-900/30",icon:e.jsx(v,{size:14})},aivideo:{label:"AI Video",textColor:"text-indigo-500 dark:text-indigo-400",bgColor:"bg-indigo-100 dark:bg-indigo-900/30",icon:e.jsx(k,{size:14})},"screen-recording":{label:"Screen Recording",textColor:"text-yellow-600 dark:text-yellow-400",bgColor:"bg-yellow-100 dark:bg-yellow-900/30",icon:e.jsx(j,{size:14})},music:{label:"Music",textColor:"text-teal-500 dark:text-teal-400",bgColor:"bg-teal-100 dark:bg-teal-900/30",icon:e.jsx(y,{size:14})},audio:{label:"Audio Studio",textColor:"text-rose-500 dark:text-rose-400",bgColor:"bg-rose-100 dark:bg-rose-900/30",icon:e.jsx(w,{size:14})}},E=({template:t,thumbnail:s})=>{const l=M(),a=B[t.filterKey]??{label:"Template",textColor:"text-violet-600",bgColor:"bg-violet-100",icon:e.jsx(i,{size:14})};return e.jsxs("article",{className:"bg-white dark:bg-slate-900 rounded-2xl border border-slate-200 dark:border-slate-700 shadow-sm hover:shadow-lg dark:hover:shadow-slate-900/50 hover:-translate-y-0.5 transition-all duration-200 overflow-hidden cursor-pointer group flex flex-col",children:[e.jsxs("div",{className:"flex items-center gap-2 px-4 pt-3.5 pb-2.5",children:[e.jsx("div",{className:`w-7 h-7 rounded-lg flex items-center justify-center shrink-0 ${a.bgColor}`,children:e.jsx("span",{className:a.textColor,children:a.icon})}),e.jsx("span",{className:`text-[13px] font-bold ${a.textColor}`,children:l(a.label)})]}),e.jsx("div",{className:"mx-3 rounded-xl overflow-hidden bg-slate-100 shrink-0 h-44",children:s}),e.jsxs("div",{className:"px-4 pt-3 pb-4 flex flex-col flex-1",children:[e.jsx("h3",{className:"font-bold text-slate-900 dark:text-white text-[13px] leading-snug mb-1.5 line-clamp-1 group-hover:text-violet-600 dar
1k:group-hover:text-violet-400 transition-colors",children:t.title}),t.description&&e.jsx("p",{className:"text-[11px] text-slate-500 leading-relaxed line-clamp-2 flex-1 mb-3",children:t.description}),e.jsxs("div",{className:"flex items-center justify-between mt-auto pt-1",children:[e.jsx("div",{className:"flex flex-wrap gap-1.5",children:t.tags.slice(0,2).map(t=>e.jsx("span",{className:"px-2.5 py-0.5 rounded-full bg-slate-100 text-[10px] font-semibold text-slate-500",children:t},t))}),e.jsx("button",{onClick:e=>e.stopPropagation(),className:"text-slate-300 hover:text-violet-500 transition-colors ml-2 shrink-0",children:e.jsx(N,{size:15})})]})]})]})},F=({template:t})=>{const[l,a]=s.useState(!1),i=$[t.category]??V,r=A.test(t.image??"");return t.image&&!l?e.jsx("img",{src:t.image,alt:t.title,onError:()=>a(!0),className:"w-full h-full "+(r?"object-contain bg-white p-4":"object-cover"),loading:"lazy",decoding:"async"}):e.jsxs("div",{className:`w-full h-full bg-linear-to-br ${i.grad} flex items-center justify-center relative`,children:[e.jsx("div",{className:"absolute inset-0 opacity-20",style:{backgroundImage:"radial-gradient(circle at 70% 30%, white 0%, transparent 60%)"}}),e.jsx("div",{className:"text-white/40 relative z-10",children:i.icon})]})},I=({template:t})=>{const[l,a]=s.useState(!1),i=A.test(t.image??"");return t.image&&!l?e.jsx("img",{src:t.image,alt:t.title,onError:()=>a(!0),className:"w-full h-full "+(i?"object-contain bg-white p-4":"object-cover"),loading:"lazy",decoding:"async"}):e.jsx("div",{className:"w-full h-full bg-linear-to-br from-pink-500 to-rose-400 flex items-center justify-center",children:e.jsx(f,{size:36,className:"text-white/40"})})},L=({template:t})=>{const[a,i]=s.useState(!1),r=l.useRef(null);return e.jsxs("div",{className:"relative w-full h-full bg-slate-900",onMouseEnter:()=>{var e;i(!0),null==(e=r.current)||e.play().catch(()=>{})},onMouseLeave:()=>{i(!1);const e=r.current;e&&(e.pause(),e.currentTime=0)},children:[t.mediaUrl?e.jsx("video",{ref:r,src:t.mediaUrl,className:"w-full h-full object-cover opacity-90",muted:!0,playsInline:!0,loop:!0}):e.jsx("div",{className:"w-full h-full bg-linear-to-br from-slate-700 to-slate-900"}),e.jsx("div",{className:"absolute inset-0 flex items-center justify-center transition-opacity duration-300 "+(a?"opacity-0":"opacity-100"),children:e.jsx("div",{className:"w-11 h-11 rounded-full bg-white/90 flex items-center justify-center shadow-lg",children:e.jsx(x,{size:16,className:"text-slate-900 ml-0.5"})})})]})},U=e=>`${String(Math.floor(e/60)).padStart(2,"0")}:${String(Math.floor(e%60)).padStart(2,"0")}`,R=({template:t})=>{const[a,i]=s.useState(!1),[r,o]=s.useState(0),[n,d]=s.useState(0),[c,x]=s.useState(!1),u=l.useRef(null),m=e=>{e.stopPropagation();const s=u.current;s&&t.mediaUrl&&(s.paused?s.play().catch(()=>{}):s.pause())},g=n>0?r/n*100:0;return e.jsxs("div",{className:"group w-full h-full flex flex-col bg-zinc-950 px-3 pt-2.5 pb-2 overflow-hidden",children:[e.jsxs("div",{className:"flex items-center justify-between mb-2 shrink-0",children:[e.jsx("h3",{className:"font-semibold text-[12px] text-white truncate flex-1 leading-tight",children:t.title}),n>0&&e.jsxs("span",{className:"text-[10px] text-white/60 font-medium tabular-nums ml-2 shrink-0 flex items-center gap-0.5",children:[e.jsx("svg",{className:"w-2.5 h-2.5",fill:"currentColor",viewBox:"0 0 20 20",children:e.jsx("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm1-12a1 1 0 10-2 0v4a1 1 0 00.293.707l2.828 2.829a1 1 0 101.415-1.415L11 9.586V6z",clipRule:"evenodd"})}),U(n)]})]}),e.jsx("div",{className:"relative flex-1 flex items-center justify-center mb-2",onMouseEnter:()=>x(!0),onMouseLeave:()=>x(!1),children:e.jsxs("div",{className:"relative w-24 h-24",children:[e.jsxs("div",{className:"w-full h-full rounded-full bg-zinc-700 overflow-hidden shadow-lg relative",children:[t.image?e.jsx("img",{src:t.image,alt:t.title,className:"w-full h-full object-cover rounded-full "+(a?"animate-spin":""),style:{animationDuration:"15s"},loading:"lazy",decoding:"async"}):e.jsx("div",{className:"w-full h-full flex items-center justify-center text-2xl",children:"ðµ"}),e.jsx("div",{className:"absolute inset-0 rounded-full pointer-events-none",style:{background:"repeating-conic-gradient(from 0deg, transparent 0deg 1deg, rgba(0,0,0,0.1) 1deg 2deg)",opacity:.3}}),e.jsx("div",{className:"absolute inset-3 rounded-full border border-black/20 pointer-events-none"}),e.jsx("div",{className:"absolute inset-0 flex items-center justify-center pointer-events-none",children:e.jsx("div",{className:"w-9 h-9 bg-zinc-900/90 rounded-full border-2 border-zinc-600 flex items-center justify-center",children:e.jsx("div",{className:"w-2 h-2 bg-zinc-800 rounded-full border border-zinc-700"})})})]}),t.mediaUrl&&e.jsx("div",{onClick:m,className:"absolute inset-0 rounded-full flex items-center justify-center cursor-pointer transition-opacity duration-200 bg-black/30 "+(c?"opacity-100":"opacity-0"),children:e.jsxs("div",{className:"w-12 h-12 bg-zinc-800/90 rounded-full border border-zinc-600/50 flex items-center justify-center shadow-xl pointer-events-none",children:[e.jsx("div",{className:"absolute inset-1.5 rounded-full border border-zinc-500/30"}),a?e.jsx("svg",{className:"w-4 h-4 text-white/90",fill:"currentColor",viewBox:"0 0 24 24",children:e.jsx("path",{d:"M6 4h4v16H6V4zm8 0h4v16h-4V4z"})}):e.jsx("svg",{className:"w-5 h-5 ml-0.5 text-white/90",fill:"currentColor",viewBox:"0 0 24 24",children:e.jsx("path",{d:"M8 5v14l11-7z"})})]})})]})}),t.authorName&&e.jsxs("div",{className:"flex items-center gap-1.5 mb-1.5 shrink-0",children:[e.jsx("div",{className:"w-4 h-4 rounded-full bg-zinc-700 flex items-center justify-center shrink-0",children:e.jsx("svg",{className:"w-2.5 h-2.5 text-zinc-400",fill:"currentColor",viewBox:"0 0 24 24",children:e.jsx("path",{d:"M12 12c2.7 0 4.8-2.1 4.8-4.8S14.7 2.4 12 2.4 7.2 4.5 7.2 7.2 9.3 12 12 12zm0 2.4c-3.2 0-9.6 1.6-9.6 4.8v2.4h19.2v-2.4c0-3.2-6.4-4.8-9.6-4.8z"})})}),e.jsx("span",{className:"text-[10px] text-zinc-400 truncate",children:t.authorName})]}),t.mediaUrl&&e.jsxs("div",{className:"shrink-0",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[e.jsx("button",{onClick:m,className:"w-5 h-5 rounded-full bg-zinc-800 border border-zinc-700 text-zinc-200 hover:text-white hover:border-zinc-500 transition flex items-center justify-center shrink-0",children:a?e.jsx("svg",{className:"w-2.5 h-2.5",fill:"currentColor",viewBox:"0 0 24 24",children:e.jsx("path",{d:"M6 4h4v16H6V4zm8 0h4v16h-4V4z"})}):e.jsx("svg",{className:"w-2.5 h-2.5 ml-px",fill:"currentColor",viewBox:"0 0 24 24",children:e.jsx("path",{d:"M8 5v14l11-7z"})})}),e.jsxs("span",{className:"text-[10px] text-zinc-400 tabular-nums",children:[U(r)," /"," ",n>0?U(n):"--:--"]})]}),e.jsx("input",{type:"range",min:0,max:100,step:.5,value:g,onChange:e=>{e.stopPropagation();const t=u.current;t&&n&&(t.currentTime=Number(e.target.value)/100*n)},onClick:e=>e.stopPropagation(),className:"w-full h-1.5 accent-zinc-300 cursor-pointer"})]}),e.jsx("audio",{ref:u,src:t.mediaUrl??"",preload:"none",onPlay:()=>i(!0),onPause:()=>i(!1),onEnded:()=>{i(!1),o(0)},onTimeUpdate:()=>{var e;return o((null==(e=u.current)?void 0:e.currentTime)??0)},onLoadedMetadata:()=>{var e;return d((null==(e=u.current)?void 0:e.duration)??0)}})]})},W=({template:t})=>{const[l,a]=s.useState(!1);return e.jsxs("div",{className:"w-full h-full bg-white flex flex-col justify-center gap-3 px-4 py-3",children:[e.jsx("div",{className:"font-semibold text-slate-700 text-[12px] line-clamp-1",children:t.title}),e.jsx("div",{className:"flex items-center gap-[2px] h-12",children:Array.from({length:55}).map((t,s)=>{const a=38*Math.abs(Math.sin(.4*s+1)*Math.cos(.15*s))+4;return e.jsx("div",{className:"flex-1 rounded-full "+(l?"bg-red-300":"bg-slate-200"),style:{height:`${a}px`}},s)})}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("span",{className:"text-[13px] font-bold text-slate-700 tabular-nums",children:"00:32"}),e.jsx("button",{onClick:e=>{e.stopPropagation(),a(e=>!e)},className:"w-8 h-8 rounded-full flex items-center justify-center shadow-sm transition-colors "+(l?"bg-red-600":"bg-red-500 hover:bg-red-600"),children:e.jsx("div",{className:"bg-white rounded-sm transition-all "+(l?"w-3 h-3":"w-3 h-3 rounded-full")})})]})]})},q=({template:t})=>{let s;switch(t.filterKey){case"image":s=e.jsx(I,{template:t});break;case"video":case"aivideo":case"screen-recording":s=e.jsx(L,{template:t});break;case"music":s=e.jsx(R,{template:t});break;case"audio":s=e.jsx(W,{template:t});break;default:s=e.jsx(F,{template:t})}return e.jsx(E,{template:t,thumbnail:s})},H=({query:t})=>{const{t:s,tKey:l}=a();return e.jsxs("div",{className:"flex flex-col items-center justify-center py-24 px-6 text-center",children:[e.jsx("div",{className:"w-14 h-14 bg-slate-100 rounded-2xl flex items-center justify-center text-slate-300 mb-4",children:e.jsx(n,{size:24})}),e.jsx("h3",{className:"text-base font-bold text-slate-900 mb-1.5",children:t?l("templatesPage.emptyTitleQuery",{query:t}):s.templatesPage.emptyTitle}),e.jsx("p",{className:"text-sm text-slate-400 max-w-xs",children:s.templatesPage.emptyBody})]})},_=()=>e.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 gap-4",children:Array.from({length:8}).map((t,s)=>e.jsxs("div",{className:"rounded-2xl bg-white border border-slate-200 overflow-hidden",children:[e.jsx("div",{className:"h-44 bg-slate-100 animate-pulse"}),e.jsxs("div",{className:"p-4 space-y-2",children:[e.jsx("div",{className:"h-3 w-3/4 bg-slate-100 rounded animate-pulse"}),e.jsx("div",{className:"h-2.5 w-full bg-slate-100 rounded animate-pulse"}),e.jsx("div",{className:"h-2.5 w-2/3 bg-slate-100 rounded animate-pulse"})]})]},s))});const O=()=>{const{t:l}=a(),c=l.templatesPage,x=M(),[u]=t(),m=u.get("studio")??"all",g=u.get("filter")??"all",[p,b]=s.useState(m),[h,f]=s.useState(g),[v,j]=s.useState(""),[y,w]=s.useState("All"),[N,k]=s.useState([]),[z,K]=s.useState(!0);s.useEffect(()=>
1{const e=u.get("studio")??"all",t=u.get("filter")??"all";b(e),f(t)},[u]),s.useEffect(()=>{fetch("https://api.slideon.app/api/community/public").then(e=>{if(!e.ok)throw new Error(`HTTP ${e.status}`);return e.json()}).then(e=>k(function(e){const t=[...e];for(let s=t.length-1;s>0;s--){const e=Math.floor(Math.random()*(s+1));[t[s],t[e]]=[t[e],t[s]]}return t}(function(e,t){const s=[],l=new Set;for(const[a,i]of Object.entries(e)){if(!(null==i?void 0:i.length))continue;const e=S[a]??{label:"Template",filterKey:"presentation",studio:"professional",mediaType:"slide"};for(const r of i){if(l.has(r.id))continue;l.add(r.id);const i=(r.type?T(r.type):null)??e,o="images"===("image"===i.filterKey?"images":a)?r.thumbnailUrl||r.url||"":C(r.thumbnailUrl)?r.thumbnailUrl:C(r.url)?r.url:"";s.push({id:`api-${r.id}`,title:r.title||t,description:r.description||"",image:o,mediaUrl:"video"===i.mediaType?r.url||r.thumbnailUrl||void 0:"music"===i.mediaType&&r.url||void 0,tags:r.tags??[],category:i.label,filterKey:i.filterKey,studio:i.studio,mediaType:i.mediaType,authorName:r.authorName,likesCount:r.likesCount,useCount:r.useCount})}}return s}(e.data??{},c.untitled)))).catch(()=>k([])).finally(()=>K(!1))},[c.untitled]);const $=s.useMemo(()=>{let e=N;"professional"===p&&(e=e.filter(e=>"professional"===e.studio)),"creative"===p&&(e=e.filter(e=>"creative"===e.studio));const t=v.toLowerCase().trim();return e.filter(e=>{if("all"!==h&&e.filterKey!==h)return!1;if("spreadsheet"===e.filterKey&&"All"!==y&&!e.tags.some(e=>e===y)&&e.category!==y)return!1;if(t){if(!(e.title.toLowerCase().includes(t)||e.description.toLowerCase().includes(t)||e.tags.some(e=>e.toLowerCase().includes(t))||e.category.toLowerCase().includes(t)))return!1}return!0})},[N,p,h,v,y]),V=[{id:"all",label:c.studioTabs.all,icon:e.jsx(i,{size:14})},{id:"professional",label:c.studioTabs.professional,icon:e.jsx(r,{size:14})},{id:"creative",label:c.studioTabs.creative,icon:e.jsx(o,{size:14})}];return e.jsxs("div",{className:"min-h-screen bg-[#f5f4ff] dark:bg-slate-950 mt-20",children:[e.jsx("div",{className:"bg-[#f5f4ff] dark:bg-slate-950 relative overflow-hidden",children:e.jsxs("div",{className:"max-w-7xl mx-auto px-6 md:px-10 py-14 grid grid-cols-1 lg:grid-cols-2 gap-10 items-center",children:[e.jsxs("div",{children:[e.jsxs("h1",{className:"text-[2.75rem] sm:text-5xl md:text-6xl font-black tracking-tight leading-[1.1] text-slate-900 dark:text-slate-100 mb-4",children:[c.headline,e.jsx("br",{}),e.jsx("span",{className:"bg-linear-to-r from-violet-600 to-purple-500 bg-clip-text text-transparent",children:c.headlineEmphasis})]}),e.jsx("p",{className:"text-slate-500 dark:text-slate-400 text-[15px] leading-relaxed mb-8",children:c.subhead}),e.jsxs("div",{className:"relative max-w-[520px]",children:[e.jsx(n,{size:17,className:"absolute left-4 top-1/2 -translate-y-1/2 text-slate-400 dark:text-slate-500 pointer-events-none"}),e.jsx("input",{type:"text",placeholder:c.searchPlaceholder,value:v,onChange:e=>j(e.target.value),className:"w-full pl-11 pr-10 py-4 rounded-2xl bg-white dark:bg-slate-950 border border-slate-200 dark:border-slate-800 shadow-sm focus:border-violet-400 focus:ring-2 focus:ring-violet-100 outline-none text-sm text-slate-700 dark:text-slate-100 placeholder:text-slate-400 dark:placeholder:text-slate-500 transition-all"}),v&&e.jsx("button",{onClick:()=>j(""),className:"absolute right-4 top-1/2 -translate-y-1/2 text-slate-400 dark:text-slate-300 hover:text-slate-600 dark:hover:text-slate-100 transition-colors",children:e.jsx(d,{size:15})})]})]}),e.jsx("div",{className:"hidden lg:block",children:e.jsx(D,{})})]})}),e.jsxs("div",{className:"sticky top-0 z-30 bg-[#f5f4ff] dark:bg-slate-950",children:[e.jsx("div",{className:"max-w-7xl mx-auto px-6 md:px-10 pt-3 pb-1 flex items-center justify-between gap-4 mb-4",children:e.jsx("div",{className:"flex items-center gap-1.5",children:V.map(t=>e.jsxs("button",{onClick:()=>{return e=t.id,b(e),f("all"),void w("All");var e},className:"flex items-center gap-1.5 px-4 py-2 rounded-full text-sm font-semibold transition-all duration-150 "+(p===t.id?"bg-violet-600 text-white shadow-md shadow-violet-300 dark:shadow-violet-900/60":"text-slate-500 dark:text-slate-400 hover:bg-slate-100 dar
1k:hover:bg-slate-800"),children:[t.icon,t.label]},t.id))})}),e.jsx("div",{className:"max-w-7xl mx-auto px-6 md:px-10 pt-1 pb-3 bg-white dark:bg-slate-900 border-b border-slate-200 dark:border-slate-800 shadow-sm dark:shadow-white/5 rounded-2xl",children:e.jsx("div",{className:"flex items-stretch gap-0.5 overflow-x-auto no-scrollbar",children:P.filter(e=>"all"===e.id||"all"===p||e.studio===p).map(t=>{const s=h===t.id;return e.jsxs("button",{onClick:()=>{return e=t.id,f(e),void w("All");var e},className:"relative flex flex-col items-center gap-1.5 px-4 py-2 min-w-[76px] rounded-xl transition-all duration-150 group "+(s?"":"hover:bg-slate-50 dark:hover:bg-slate-800"),children:[e.jsx("div",{className:"w-10 h-10 rounded-xl flex items-center justify-center transition-all "+(s?`${t.bg} ${t.color}`:"bg-slate-100 text-slate-500 dark:bg-slate-800 dark:text-slate-400 group-hover:bg-slate-200 dark:group-hover:bg-slate-700"),children:t.icon}),e.jsx("span",{className:"text-[11px] font-semibold whitespace-nowrap transition-colors "+(s?"text-violet-600":"text-slate-500 dark:text-slate-400 group-hover:text-slate-700 dark:group-hover:text-slate-200"),children:x(t.label)}),s&&e.jsx("span",{className:"absolute bottom-0 left-1/2 -translate-x-1/2 w-8 h-[2.5px] bg-violet-600 rounded-full"})]},t.id)})})})]}),e.jsx("div",{className:"max-w-7xl mx-auto px-6 md:px-10 py-8",children:z?e.jsx(_,{}):0===$.length?e.jsx(H,{query:v}):e.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 gap-4",children:$.map(t=>e.jsx(q,{template:t},t.id))},`${p}-${h}`)}),e.jsx("style",{children:"\n .no-scrollbar::-webkit-scrollbar { display: none; }\n .no-scrollbar { -ms-overflow-style: none; scrollbar-width: none; }\n "})]})};export{O 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.