1import{j as e}from"./vendor-Dw1-o7kh.js";import{r as s}from"./react-BpC26T6t.js";import{u as a}from"./useGatedContent-BtEQomte.js";import{G as t}from"./GatedContentForm-B_UqpVCj.js";import{b as r,d as l,g as i,U as c,n as d,E as n,C as o}from"./index-BTs3I-_Y.js";import{D as x}from"./download-C9as-u-O.js";import"./supabase-H1x_w4VC.js";function m(){const{settings:m}=r(),{resources:h,loading:g,error:p}=a(),[u,j]=s.useState(null),[N,b]=s.useState(!1);l({title:`Gated Content | ${(null==m?void 0:m.company_name)||"LiteLinx"}`,description:"Access exclusive content, whitepapers, guides, and resources to help you optimize your fiber optic network infrastructure.",keywords:"gated content, whitepapers, guides, fiber optics, network resources, downloads",ogType:"website",structuredData:{"@context":"https://schema.org","@type":"WebPage",name:"Gated Content",description:"Exclusive content and resources for fiber optic network optimization",url:window.location.href}});const f=s=>{switch(s.toLowerCase()){case"pdf":return e.jsx(i,{className:"h-8 w-8 text-red-500"});case"doc":case"docx":return e.jsx(i,{className:"h-8 w-8 text-blue-500"});case"video":return e.jsx(i,{className:"h-8 w-8 text-purple-500"});default:return e.jsx(i,{className:"h-8 w-8 text-gray-500"})}},w=e=>{if(!e)return"Unknown size";const s=e/1048576;return s>=1?`${s.toFixed(1)} MB`:`${Math.round(e/1024)} KB`};return g?e.jsx("div",{className:"min-h-screen bg-gray-50",children:e.jsx("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-12",children:e.jsxs("div",{className:"text-center",children:[e.jsx("div",{className:"animate-spin rounded-full h-12 w-12 border-b-2 border-primary mx-auto"}),e.jsx("p",{className:"mt-4 text-gray-600",children:"Loading content..."})]})})}):p?e.jsx("div",{className:"min-h-screen bg-gray-50",children:e.jsx("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-12",children:e.jsxs("div",{className:"text-center",children:[e.jsx("div",{className:"text-red-600 text-lg font-medium",children:"Error loading content"}),e.jsx("p",{className:"mt-2 text-gray-600",children:p.message})]})})}):e.jsxs("div",{className:"min-h-screen bg-gray-50",children:[e.jsx("div",{className:"bg-white border-b border-gray-200",children:e.jsx("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-12",children:e.jsxs("div",{className:"text-center",children:[e.jsx("h1",{className:"text-4xl font-bold text-gray-900 mb-4",children:"Exclusive Content & Resources"}),e.jsx("p",{className:"text-xl text-gray-600 max-w-3xl mx-auto",children:"Access our premium content library featuring whitepapers, guides, and resources to help you optimize your fiber optic network infrastructure."})]})})}),e.jsx("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-12",children:N&&u?e.jsxs("div",{className:"max-w-2xl mx-auto",children:[e.jsxs("button",{onClick:()=>b(!1),className:"mb-6 text-gray-600 hover:text-gray-900 flex items-center space-x-2",children:[e.jsx("span",{children:"â"}),e.jsx("span",{children:"Back to all resources"})]}),e.jsx(t,{resource:u,onSuccess:e=>{const s=document.createElement("a");s.href=e,s.download=(null==u?void 0:u.title)||"download",document.body.appendChild(s),s.click(),document.body.removeChild(s),b(!1),j(null)},onError:e=>{}})]}):e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-6 mb-12",children:[e.jsx("div",{className:"bg-white rounded-lg p-6 shadow-sm border border-gray-200",children:e.jsxs("div",{className:"flex items-center",children:[e.jsx("div",{className:"flex-shrink-0",children:e.jsx(i,{className:"h-8 w-8 text-primary"})}),e.jsxs("div",{className:"ml-4",children:[e.jsx("p",{className:"text-sm font-medium text-gray-500",children:"Total Resources"}),e.jsx("p",{className:"text-2xl font-bold text-gray-900",children:h.length})]})]})}),e.jsx("div",{className:"bg-white rounded-lg p-6 shadow-sm border border-gray-200",children:e.jsxs("div",{className:"flex items-center",children:[e.jsx("div",{className:"flex-shrink-0",children:e.jsx(x,{className:"h-8 w-8 text-green-500"})}),e.jsxs("div",{className:"ml-4",children:[e.jsx("p",{className:"text-sm font-medium text-gray-500",children:"Total Downloads"}),e.jsx("p",{className:"text-2xl font-bold text-gray-900",children:h.reduce((e,s)=>e+s.download_count,0)})]})]})}),e.jsx("div",{className:"bg-white rounded-lg p-6 shadow-sm border border-gray-200",children:e.jsxs("div",{className:"flex items-center",children:[e.jsx("div",{className:"flex-shrink-0",children:e.jsx(c,{className:"h-8 w-8 text-blue-500"})}),e.jsxs("div",{className:"ml-4",children:[e.jsx("p",{className:"text-sm font-medium text-gray-500",children:"Active Resources"}),e.jsx("p",{className:"text-2xl font-bold text-gray-900",children:h.filter(e=>e.is_active).length})]})]})})]}),h.filter(e=>e.slug).length>0&&e.jsxs("div",{className:"mb-12",children:[e.jsx("h2",{className:"text-2xl font-bold text-gray-900 mb-6",children:"Featured Resources"}),e.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6",children:h.filter(e=>e.slug).slice(0,3).map(s=>e.jsxs("div",{className:"bg-white rounded-lg shadow-sm border border-gray-200 overflow-hidden hover:shadow-md transition-shadow duration-200",children:[s.hero_image_url&&e.jsx("div",{className:"h-48 bg-cover bg-center",style:{backgroundImage:`url(${d(s.hero_image_url)})`}}),e.jsxs("div",{className:"p-6",children:[e.jsx("h3",{className:"text-lg font-semibold text-gray-900 mb-2",children:s.title}),s.subtitle&&e.jsx("p",{className:"text-gray-600 text-sm mb-3",children:s.subtitle}
1),s.benefits&&s.benefits.length>0&&e.jsxs("div",{className:"mb-4",children:[e.jsx("p",{className:"text-xs font-medium text-gray-500 mb-2",children:"What you'll get:"}),e.jsx("ul",{className:"text-xs text-gray-600 space-y-1",children:s.benefits.slice(0,3).map((s,a)=>e.jsxs("li",{className:"flex items-center space-x-2",children:[e.jsx("span",{className:"w-1 h-1 bg-primary rounded-full"}),e.jsx("span",{children:s})]},a))})]}),e.jsxs("a",{href:`/download/${s.slug}`,className:"w-full bg-primary text-white py-2 px-4 rounded-md hover:bg-primary-dark transition-colors duration-200 flex items-center justify-center space-x-2",children:[e.jsx(n,{className:"h-4 w-4"}),e.jsx("span",{children:"View Landing Page"})]})]})]},s.id))})]}),e.jsx("div",{className:"mb-8",children:e.jsx("h2",{className:"text-2xl font-bold text-gray-900 mb-6",children:"All Resources"})}),e.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6",children:h.map(s=>e.jsx("div",{className:"bg-white rounded-lg shadow-sm border border-gray-200 overflow-hidden hover:shadow-md transition-shadow duration-200",children:e.jsxs("div",{className:"p-6",children:[e.jsxs("div",{className:"flex items-start space-x-4 mb-4",children:[f(s.file_type),e.jsxs("div",{className:"flex-1",children:[e.jsx("h3",{className:"text-lg font-semibold text-gray-900 mb-2",children:s.title}),s.description&&e.jsx("p",{className:"text-gray-600 text-sm mb-3",children:s.description}),e.jsxs("div",{className:"flex items-center space-x-4 text-xs text-gray-500",children:[e.jsx("span",{className:"capitalize",children:s.file_type}),e.jsx("span",{children:w(s.file_size)})]})]})]}),e.jsxs("div",{className:"flex items-center justify-between text-sm text-gray-500 mb-4",children:[e.jsxs("div",{className:"flex items-center space-x-1",children:[e.jsx(x,{className:"h-4 w-4"}),e.jsxs("span",{children:[s.download_count," downloads"]})]}),e.jsxs("div",{className:"flex items-center space-x-1",children:[e.jsx(o,{className:"h-4 w-4"}),e.jsx("span",{children:new Date(s.created_at).toLocaleDateString()})]})]}),e.jsxs("div",{className:"space-y-2",children:[s.slug&&e.jsxs("a",{href:`/download/${s.slug}`,className:"w-full bg-gray-100 text-gray-700 py-2 px-4 rounded-md hover:bg-gray-200 transition-colors duration-200 flex items-center justify-center space-x-2",children:[e.jsx(n,{className:"h-4 w-4"}),e.jsx("span",{children:"View Landing Page"})]}),e.jsxs("button",{onClick:()=>(e=>{j(e),b(!0)})(s),className:"w-full bg-primary text-white py-2 px-4 rounded-md hover:bg-primary-dark transition-colors duration-200 flex items-center justify-center space-x-2",children:[e.jsx(x,{className:"h-4 w-4"}),e.jsx("span",{children:"Download Now"})]})]})]})},s.id))}),0===h.length&&e.jsxs("div",{className:"text-center py-12",children:[e.jsx(i,{className:"h-12 w-12 text-gray-400 mx-auto mb-4"}),e.jsx("h3",{className:"text-lg font-medium text-gray-900 mb-2",children:"No content available"}),e.jsx("p",{className:"text-gray-600",children:"Check back soon for new resources and content."})]})]})})]})}export{m as GatedContentPage};
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.