PageSourceSearch

https://herpowerapp.com/assets/PremiumLibrary-BXZlyA9l.js

js herpowerapp.com collected 2026-10-09 22:03:53 UTC 7,053 bytes, 1 lines download raw bytes

1import{b as D,u as T,g as V,r,s as A,j as e,a2 as b,aC as U,P as o,h as i,d as E,Q as R,R as z,U as c,a4 as B,V as F,C as v,a as N,_ as H,D as q,q as I,t as O,v as Q,w as W,aD as y,B as Y}from"./index-DO0ZNUzu.js";import{u as G}from"./usePremiumAccess-BYPsv9Ay.js";import{V as J}from"./video-D2PbMWS5.js";const $=()=>{const u=D(),{user:x}=T();V();const{isPremium:n,loading:d}=G(),[h,w]=r.useState([]),[_,g]=r.useState(!0),[a,p]=r.useState(null),[t,C]=r.useState("all"),[j,m]=r.useState(!1),[L,l]=r.useState(!0);r.useEffect(()=>{if(x){if(!d&&!n){u("/premium");return}n&&P()}},[x,n,d,u]);const P=async()=>{g(!0);const{data:s,error:k}=await A.from("community_media").select("*").eq("is_active",!0).order("created_at",{ascending:!1});!k&&s&&w(s),g(!1)},f=h.filter(s=>t==="all"?!0:t==="videos"?s.media_type==="video":t==="images"?s.media_type==="image":s.category===t),S=Array.from(new Set(h.map(s=>s.category)));return d||_?e.jsx(b,{}):n?e.jsxs(e.Fragment,{children:[e.jsxs(U,{children:[e.jsx("title",{children:"Premium Content Library - Her Power"}),e.jsx("meta",{name:"description",content:"Unlock exclusive affirmations, guided meditations, wellness resources, and curated inspiration designed by experts"})]}),e.jsx("div",{className:"min-h-screen bg-gradient-to-b from-background to-secondary/20",children:e.jsxs("div",{className:"container mx-auto px-4 py-8 max-w-7xl",children:[e.jsxs("div",{className:"mb-8",children:[e.jsxs("div",{className:"flex items-center gap-3 mb-4",children:[e.jsx("div",{className:"p-3 bg-gradient-primary rounded-full",children:e.jsx(o,{className:"h-6 w-6 text-white"})}),e.jsxs(i,{variant:"default",className:"bg-gradient-primary",children:[e.jsx(E,{className:"h-3 w-3 mr-1"}),"Premium Access"]})]}),e.jsx("h1",{className:"text-4xl font-bold mb-3 bg-gradient-to-r from-primary to-primary/60 bg-clip-text text-transparent",children:"Premium Content Library"}),e.jsx("p",{className:"text-muted-foreground text-lg max-w-3xl",children:"Unlock exclusive affirmations, guided meditations, wellness resources, and curated inspiration designed by experts."})]}),e.jsxs(R,{value:t,onValueChange:C,className:"mb-6",children:[e.jsxs(z,{className:"flex flex-wrap h-auto",children:[e.jsx(c,{value:"all",children:"All Content"}),e.jsxs(c,{value:"videos",children:[e.jsx(J,{className:"h-4 w-4 mr-2"}),"Videos"]}),e.jsxs(c,{value:"images",children:[e.jsx(B,{className:"h-4 w-4 mr-2"}),"Images"]}),S.map(s=>e.jsx(c,{value:s,className:"capitalize",children:s.replace("_"," ")},s))]}),e.jsx(F,{value:t,className:"mt-6",children:f.length===0?e.jsx(v,{children:e.jsxs(N,{className:"py-12 text-center space-y-4",children:[e.jsx(o,{className:"h-16 w-16 text-primary mx-auto opacity-50"}),e.jsx("p",{className:"text-muted-foreground text-lg",children:"No content available yet. Check back soon for new premium resources!"})]})}):e.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6",children:f.map(s=>e.jsxs(v,{className:"overflow-hidden cursor-pointer hover:shadow-lg transition-all hover:scale-[1.02]",onClick:()=>p(s),children:[e.jsxs("div",{className:"relative aspect-video bg-gradient-to-br from-primary/10 to-primary/5",children:[s.media_type==="image"?e.jsx("img",{src:s.media_url,alt:s.title,className:"w-full h-full object-cover"}):e.jsxs("div",{className:"w-full h-full flex items-center justify-center",children:[e.jsx("div",{className:"absolute inset-0 bg-gradient-to-br from-primary/20 to-primary/5"}),e.jsx(H,{className:"h-16 w-16 text-primary relative z-10 drop-shadow-lg"})]}),e.jsx(i,{variant:"secondary",className:"absolute top-2 right-2 capitalize",children:s.category.replace("_"," ")}),e.jsxs(i,{variant:"default",className:"absolute top-2 left-2 bg-gradient-primary",children:[e.jsx(o,{className:"h-3 w-3 mr-1"}),"Premium"]})]}),e.jsxs(N,{className:"p-4",children:[e.jsx("h3",{className:"font-semibold text-lg mb-1 line-clamp-1",children:s.title}),s.description&&e.jsx("p",{className:"text-sm text-muted-foreground line-clamp-2",children:s.description})]})]},s.id))})})]})]})}),e.jsx(q,{open:!!a,onOpenChange:()=>{p(null),m(!1),l(!0)},children:e.jsxs(I,{className:"max-w-4xl",children:[e.jsxs(O,{children:[e.jsx("div",{className:"flex items-center gap-2 mb-2",children:e.jsxs(i,{variant:"default",className:"bg-gradient-primary",children:[e.jsx(o,{className:"h-3 w-3 mr-1"}),"Premium Content"]})}),e.jsx(Q,{children:a==null?void 0:a.title}),(a==null?void 0:a.description)&&e.jsx(W,{children:a.description})]}),e.jsx("div",{className:"mt-4",children:(a==null?void 0:a.media_type)==="image"?e.jsx("img",{src:a.media_url,alt:a.title,className:"w-full rounded-lg"}):e.jsx("div",{className:"relative aspect-video",children:a!=null&&a.media_url.startsWith("placeholder-")?e.jsxs("div",{className:"bg-muted rounded-lg p-8 text-center space-y-4",children:[e.jsx(y,{className:"h-12 w-12 text-muted-foreground mx-auto"}),e.jsxs("div",{children:[e.jsx("h3",{className:"font-semibold mb-2",children:"Video Not Available"}),e.jsx("p",{className:"text-sm text-muted-foreground mb-2",children:"This content is using a placeholder URL and needs to be updated with an actual video."}),e.jsxs("p",{className:"text-xs text-muted-foreground break-all",children:["Current URL: ",a==null?void 0:a.media_url]})]}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Please contact an administrator to upload the actual video content."})]}):a!=null&&a.media_url.includes("youtube.com")||a!=null&&a.media_url.includes("youtu.be")?e.jsx("iframe",{src:a.media_url,title:a.title,className:"w-full h-full rounded-lg",allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture",allowFullScreen:!0}):e.jsxs(e.Fragment,{children:[L&&!j&&e.jsx("div",{className:"absolute inset-0 flex items-center justify-center bg-muted/50 rounded-lg z-10",children:e.jsx(b,{})}),j?e.jsxs("div",{className:"bg-muted rounded-lg p-8 text-center space-y-4",children:[e.jsx(y,{className:"h-12 w-12 text-destructive mx-auto"}),e.jsxs("div",{children:[e.jsx("h3",{className:"font-semibold mb-2",children:"Unable to Load Video"}),e.jsx("p",{className:"text-sm text-muted-foreground mb-4",children:"The video could not be loaded. Please check your connection or try again later."}),e.jsxs("p",{className:"text-xs text-muted-foreground break-all",children:["URL: ",a==null?void 0:a.media_url]})]}),e.jsx(Y,{variant:"outline",onClick:()=>{m(!1),l(!0)},children:"Retry"})]}):e.jsx("video",{src:a==null?void 0:a.media_url,controls:!0,controlsList:"nodownload",preload:"metadata",className:"w-full rounded-lg",onLoadedData:()=>l(!1),onError:()=>{m(!0),l(!1)},onLoadStart:()=>l(!0),children:"Your browser does not support the video tag."},a==null?void 0:a.media_url)]})})}),e.jsxs("div",{className:"flex justify-between items-center mt-4",children:[e.jsx(i,{className:"capitalize",children:a==null?void 0:a.category.replace("_"," ")}),e.jsx("span",{className:"text-sm text-muted-foreground",children:(a==null?void 0:a.created_at)&&new Date(a.created_at).toLocaleDateString()})]})]})})]}):null};export{$ 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.