1import{a as te,u as ve,j as e}from"./query-BfvAKYUz.js";import{r as c,L as h,u as ye}from"./react-vendor-BTIQH4FS.js";import{u as R,s as U,c as g,k as we,l as ke,t as G,L as Pe,T as H,m as q,n as Q,B as k}from"./index-DK8CeD3M.js";import{e as re,Q as ne,U as ie,W as Ce,X as oe,Y as le,Z as de,_ as ce,$ as me,a0 as ue,a1 as xe,a2 as Se,a3 as _e}from"./radix-DIIfJIjL.js";import{$ as Le,X as pe,ag as Me,f as Re,ah as Te,a as I,e as $,ac as E,ai as P,U as D,aj as C,a8 as X,h as W,T as Y,ak as J,d as Ae}from"./icons-B_WIxKAl.js";const Ie=8e3,$e=(s,a,r)=>new Promise((i,t)=>{const m=setTimeout(()=>t(new Error(`${r} timeout after ${a}ms`)),a);s.then(n=>{clearTimeout(m),i(n)},n=>{clearTimeout(m),t(n)})}),Ee=()=>{const{user:s}=R(),{data:a=!1,isLoading:r,error:i}=te({queryKey:["admin-check",s==null?void 0:s.id],queryFn:async()=>{if(!(s!=null&&s.id))return!1;const{data:m,error:n}=await $e((async()=>await U.rpc("has_role",{_user_id:s.id,_role:"admin"}))(),Ie,"has_role RPC");if(n)throw console.error("[useAdminCheck] has_role RPC failed:",n),n;return m===!0},enabled:!!(s!=null&&s.id),staleTime:5*60*1e3,gcTime:10*60*1e3,retry:1}),t=!!(s!=null&&s.id)&&r;return{isAdmin:a,loading:t,error:i}},S={remaining:5,limit:5,isPremium:!1,tier:null},De={remaining:-1,limit:-1,isPremium:!0,tier:null},Ue=()=>{const{user:s,subscription:a,checkingSubscription:r}=R(),i=ve(),t=a.isPremium,m=c.useRef(t);c.useEffect(()=>{m.current===!1&&t===!0&&i.invalidateQueries({queryKey:["story-usage",s==null?void 0:s.id]}),m.current=t},[t,s==null?void 0:s.id,i]);const{data:n,isLoading:l}=te({queryKey:["story-usage",s==null?void 0:s.id],queryFn:async()=>{try{const{data:d,error:x}=await U.functions.invoke("generate-story",{body:{action:"checkUsage"}});if(x)throw x;const f=(d==null?void 0:d.signup_tier)??null;return{remaining:typeof(d==null?void 0:d.remaining)=="number"?d.remaining:5,limit:typeof(d==null?void 0:d.limit)=="number"?d.limit:5,isPremium:(d==null?void 0:d.isPremium)??!1,tier:f}}catch(d){if(console.warn("[useStoryUsage] checkUsage failed, falling back to RPC",d),!(s!=null&&s.id))return S;const{data:x,error:f}=await U.rpc("check_premium_status",{p_user_id:s.id});if(f)return console.error("[useStoryUsage] check_premium_status RPC also failed",f),S;const b=Array.isArray(x)?x[0]:x;return(b==null?void 0:b.is_premium)===!0?{remaining:-1,limit:-1,isPremium:!0,tier:null}:S}},enabled:!!(s!=null&&s.id)&&!t,staleTime:30*1e3,gcTime:5*60*1e3,refetchOnWindowFocus:!0,refetchOnMount:"always"});return{usage:t?De:n??S,isLoading:t?!1:r||l&&!n,refreshUsage:()=>{i.invalidateQueries({queryKey:["story-usage",s==null?void 0:s.id]})}}},ze=we("inline-flex items-center gap-1 rounded-full border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground hover:bg-primary/90",secondary:"border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",destructive:"border-transparent bg-destructive text-destructive-foreground hover:bg-destructive/90",outline:"text-foreground",pro:"border-transparent bg-accent text-accent-foreground hover:bg-accent/90 shadow-soft",new:"border-transparent bg-destructive text-destructive-foreground hover:bg-destructive/90",info:"border-transparent bg-info text-info-foreground hover:bg-info/90",soft:"border-primary/15 bg-primary/8 text-primary hover:bg-primary/12"}},defaultVariants:{variant:"default"}});function _({className:s,variant:a,...r}){return e.jsx("div",{className:g(ze({variant:a}),s),...r})}function Ke(s,a=[]){let r=[];function i(m,n){const l=c.createContext(n),o=r.length;r=[...r,n];function p(d){const{scope:x,children:f,...b}=d,N=(x==null?void 0:x[s][o])||l,w=c.useMemo(()=>b,Object.values(b));return e.jsx(N.Provider,{value:w,children:f})}function j(d,x){const f=(x==null?void 0:x[s][o])||l,b=c.useContext(f);if(b)return b;if(n!==void 0)return n;throw new Error(`\`${d}\` must be used within \`${m}\``)}return p.displayName=m+"Provider",[p,j]}const t=()=>{const m=r.map(n=>c.createContext(n));return function(l){const o=(l==null?void 0:l[s])||m;return c.useMemo(()=>({[`__scope${s}`]:{...l,[s]:o}}),[l,o])}};return t.scopeName=s,[i,Be(t,...a)]}function Be(...s){const a=s[0];if(s.length===1)return a;const r=()=>{const i=s.map(t=>({useScope:t(),scopeName:t.scopeName}));
1return function(m){const n=i.reduce((l,{useScope:o,scopeName:p})=>{const d=o(m)[`__scope${p}`];return{...l,...d}},{});return c.useMemo(()=>({[`__scope${a.scopeName}`]:n}),[n])}};return r.scopeName=a.scopeName,r}var K="Progress",B=100,[Oe,ds]=Ke(K),[Fe,Ve]=Oe(K),fe=c.forwardRef((s,a)=>{const{__scopeProgress:r,value:i=null,max:t,getValueLabel:m=Ge,...n}=s;(t||t===0)&&!Z(t)&&console.error(He(`${t}`,"Progress"));const l=Z(t)?t:B;i!==null&&!ee(i,l)&&console.error(qe(`${i}`,"Progress"));const o=ee(i,l)?i:null,p=M(o)?m(o,l):void 0;return e.jsx(Fe,{scope:r,value:o,max:l,children:e.jsx(re.div,{"aria-valuemax":l,"aria-valuemin":0,"aria-valuenow":M(o)?o:void 0,"aria-valuetext":p,role:"progressbar","data-state":be(o,l),"data-value":o??void 0,"data-max":l,...n,ref:a})})});fe.displayName=K;var he="ProgressIndicator",ge=c.forwardRef((s,a)=>{const{__scopeProgress:r,...i}=s,t=Ve(he,r);return e.jsx(re.div,{"data-state":be(t.value,t.max),"data-value":t.value??void 0,"data-max":t.max,...i,ref:a})});ge.displayName=he;function Ge(s,a){return`${Math.round(s/a*100)}%`}function be(s,a){return s==null?"indeterminate":s===a?"complete":"loading"}function M(s){return typeof s=="number"}function Z(s){return M(s)&&!isNaN(s)&&s>0}function ee(s,a){return M(s)&&!isNaN(s)&&s<=a&&s>=0}function He(s,a){return`Invalid prop \`max\` of value \`${s}\` supplied to \`${a}\`. Only numbers greater than 0 are valid max values. Defaulting to \`${B}\`.`}function qe(s,a){return`Invalid prop \`value\` of value \`${s}\` supplied to \`${a}\`. The \`value\` prop must be: 2 - a positive number 3 - less than the value passed to \`max\` (or ${B} if no \`max\` prop is set) 4 - \`null\` or \`undefined\` if the progress is indeterminate. 5 6Defaulting to \`null\`.`}var je=fe,Qe=ge;const z=c.forwardRef(({className:s,value:a,...r},i)=>e.jsx(je,{ref:i,className:g("relative h-4 w-full overflow-hidden rounded-full bg-secondary",s),...r,children:e.jsx(Qe,{className:"h-full w-full flex-1 bg-primary transition-all",style:{transform:`translateX(-${100-(a||0)}%)`}})}));z.displayName=je.displayName;const v=c.forwardRef(({to:s,prefetch:a=!0,onMouseEnter:r,onFocus:i,children:t,...m},n)=>{const{handleLinkHover:l}=ke(),o=typeof s=="string"?s:s.pathname||"",p=c.useCallback(d=>{a&&l(o),r==null||r(d)},[a,o,l,r]),j=c.useCallback(d=>{a&&l(o),i==null||i(d)},[a,o,l,i]);return e.jsx(h,{ref:n,to:s,onMouseEnter:p,onFocus:j,...m,children:t})});v.displayName="PrefetchLink";const se="set-password-banner-dismissed",Xe=()=>{var x;const{user:s,subscription:a,resetPassword:r}=R(),[i,t]=c.useState(()=>typeof window<"u"&&sessionStorage.getItem(se)==="1"),[m,n]=c.useState(!1);if(!s||i||!a.isPremium)return null;const l=((x=s.app_metadata)==null?void 0:x.providers)||[],o=l.includes("google"),p=l.includes("email");if(!o||p||!s.email)return null;const j=async()=>{n(!0);const{error:f}=await r(s.email);if(n(!1),f){G({title:"Gagal menghantar email",description:f.message||"Sila cuba lagi.",variant:"destructive"});return}G({title:"Email dihantar! ð§",description:"Semak inbox anda untuk pautan tetapkan password."})},d=()=>{sessionStorage.setItem(se,"1"),t(!0)};return e.jsx("div",{className:"bg-cop text-paper border-b-2 border-ink/20",children:e.jsxs("div",{className:"container mx-auto px-4 py-2.5 flex items-center gap-3",children:[e.jsx(Le,{className:"w-5 h-5 shrink-0 hidden sm:block"}),e.jsxs("p",{className:"font-serif-display text-sm flex-1 leading-snug",children:[e.jsx("strong",{children:"Akaun anda belum ada password."})," ",e.jsx("span",{className:"hidden sm:inline",children:"Tetapkan sekarang sebelum log masuk Google ditutup."})]}),e.jsx("button",{onClick:j,disabled:m,className:"bg-paper text-ink font-serif-display font-bold text-xs sm:text-sm px-3 py-1.5 shadow-paper hover:bg-paper/90 disabled:opacity-60 shrink-0",style:{borderRadius:2},children:m?"Menghantar...":"Tetapkan Password"}),e.jsx("button",{onClick:d,"aria-label":"Tutup",className:"text-paper/80 hover:text-paper shrink-0",children:e.jsx(pe,{className:"w-4 h-4"})})]})})},We=Se,Ye=_e,Je=c.forwardRef(({className:s,inset:a,children:r,...i},t)=>e.jsxs(ne,{ref:t,className:g("flex cursor-default gap-2 select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",a&&"pl-8",s),...i,children:[r,e.jsx(Me,{className:"ml-auto"})]}));Je.displayName=ne.displayName;const Ze=c.forwardRef(({className:s,...a},r)=>e.jsx(ie,{ref:r,className:g("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:sli
6de-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",s),...a}));Ze.displayName=ie.displayName;const Ne=c.forwardRef(({className:s,sideOffset:a=4,...r},i)=>e.jsx(Ce,{children:e.jsx(oe,{ref:i,sideOffset:a,className:g("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md","data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",s),...r})}));Ne.displayName=oe.displayName;const y=c.forwardRef(({className:s,inset:a,...r},i)=>e.jsx(le,{ref:i,className:g("relative flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",a&&"pl-8",s),...r}));y.displayName=le.displayName;const es=c.forwardRef(({className:s,children:a,checked:r,...i},t)=>e.jsxs(de,{ref:t,className:g("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",s),checked:r,...i,children:[e.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:e.jsx(ce,{children:e.jsx(Re,{className:"h-4 w-4"})})}),a]}));es.displayName=de.displayName;const ss=c.forwardRef(({className:s,children:a,...r},i)=>e.jsxs(me,{ref:i,className:g("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",s),...r,children:[e.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:e.jsx(ce,{children:e.jsx(Te,{className:"h-2 w-2 fill-current"})})}),a]}));ss.displayName=me.displayName;const as=c.forwardRef(({className:s,inset:a,...r},i)=>e.jsx(ue,{ref:i,className:g("px-2 py-1.5 text-sm font-semibold",a&&"pl-8",s),...r}));as.displayName=ue.displayName;const L=c.forwardRef(({className:s,...a},r)=>e.jsx(xe,{ref:r,className:g("-mx-1 my-1 h-px bg-muted",s),...a}));L.displayName=xe.displayName;const ae=[{to:"/",label:"Utama"},{to:"/cari-cerita",label:"Cari Cerita"},{to:"/harga",label:"Harga"},{to:"/panduan",label:"Panduan"}],cs=()=>{var V;const[s,a]=c.useState(!1),{user:r,signOut:i,subscription:t}=R(),{isAdmin:m}=Ee(),{usage:n}=Ue(),l=ye(),o=n.tier,p=!t.isPremium&&(o==="silver"||o==="gold"),j=o==="gold"?"Gold":o==="silver"?"Silver":null,x=t.isPremium||p?ae.filter(u=>u.to!=="/harga"):ae,f=n.limit>0&&n.remaining>=0?Math.round((n.limit-n.remaining)/n.limit*100):0,b=async()=>{await i()},N=t.daysRemaining||0,w=t.isPremium&&N>0&&N<=7;let T="Premium",A="Premium Aktif";if(N>30){const u=Math.floor(N/30);T=`Premium · ${u} bln`,A=`Premium · ${u} bulan lagi`}else N>0&&(T=`Premium · ${N} hari`,A=`Premium · ${N} hari lagi`);const O=()=>{const u=t.accessUntil||t.subscriptionEnd;return u?new Date(u).toLocaleDateString("ms-MY",{day:"numeric",month:"long",year:"numeric"}):null},F=u=>u==="/"?l.pathname==="/":l.pathname.startsWith(u);return e.jsxs("header",{className:"sticky top-0 z-40 bg-background/85 backdrop-blur-md border-b border-border/70",children:[e.jsx(Xe,{}),e.jsxs("div",{className:"container mx-auto px-4",children:[e.jsxs("div",{className:"flex items-center justify-between h-16",children:[e.jsx(v,{to:"/",className:"flex items-center gap-2","aria-label":"CeritaNilam â Halaman Utama",children:e.jsx(Pe,{size:"sm"})}),e.jsx("nav",{className:"hidden md:flex items-center gap-1",children:x.map(u=>e.jsx(v,{to:u.to,className:g("px-3 py-2 rounded-xl text-sm font-medium transition-colors",F(u.to)?"text-primary bg-primary/8":"text-foreground/75 hover:text-foreground hover:bg-muted"),children:u.label},u.to))}),e.jsx("div",{className:"hidden md:flex items-center gap-2",children:r?e.jsxs(We,{children:[e.jsx(Ye,{asChild:!0,children:e.jsxs("button",{className:"inline-flex items-center gap-2 px-3 py-2 rounded-xl text-sm font-medium text-foreground hover:bg-muted transition-colors",children:[t.isPremium&&e.jsxs(H,{
6children:[e.jsx(q,{asChild:!0,children:e.jsxs(_,{variant:"pro",className:"gap-1",children:[e.jsx(I,{className:"w-3 h-3"}),T]})}),e.jsxs(Q,{side:"bottom",children:[e.jsx("p",{className:"text-xs",children:"Akses aktif sehingga"}),e.jsx("p",{className:"font-semibold",children:O()})]})]}),p&&e.jsxs(H,{children:[e.jsx(q,{asChild:!0,children:e.jsxs(_,{className:g("gap-1 border-transparent shadow-soft",o==="gold"?"bg-primary text-primary-foreground hover:bg-primary/90":"bg-muted text-foreground hover:bg-muted/80 border border-foreground/15"),children:[o==="gold"?e.jsx($,{className:"w-3 h-3 fill-current"}):e.jsx(E,{className:"w-3 h-3"}),j]})}),e.jsxs(Q,{side:"bottom",className:"max-w-[220px]",children:[e.jsx("p",{className:"text-xs",children:"Baki kredit cerita"}),e.jsx("p",{className:"font-semibold inline-flex items-center gap-1",children:n.limit===-1?e.jsxs(e.Fragment,{children:[e.jsx(P,{className:"w-3.5 h-3.5"})," Tanpa had"]}):e.jsxs(e.Fragment,{children:[n.remaining.toLocaleString()," / ",n.limit.toLocaleString()]})}),e.jsx("p",{className:"text-[10px] text-muted-foreground mt-1 leading-tight",children:"Kredit dikira setiap kali cerita dijana, termasuk jana semula."}),e.jsx("p",{className:"text-xs mt-1 underline",children:"Topup kredit"})]})]}),w&&e.jsx(v,{to:"/harga",onClick:u=>u.stopPropagation(),children:e.jsx(_,{variant:"new",children:"Sambung"})}),e.jsx("span",{className:"inline-flex size-7 items-center justify-center rounded-full bg-primary/10 text-primary",children:e.jsx(D,{className:"w-3.5 h-3.5"})}),e.jsx("span",{className:"max-w-[110px] truncate",children:(V=r.email)==null?void 0:V.split("@")[0]})]})}),e.jsxs(Ne,{align:"end",className:"w-64",children:[e.jsx("div",{className:"px-3 py-2.5",children:t.isPremium?e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"inline-flex size-7 items-center justify-center rounded-full bg-accent/20 text-accent",children:e.jsx(I,{className:"w-3.5 h-3.5"})}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("p",{className:"text-xs font-semibold text-foreground",children:"Pakej Premium"}),e.jsxs("p",{className:"text-xs text-muted-foreground inline-flex items-center gap-1",children:[e.jsx(P,{className:"w-3 h-3"}),"Akses tanpa had"]})]})]}):e.jsxs("div",{className:"space-y-1.5",children:[e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[e.jsxs("span",{className:"inline-flex items-center gap-1.5 text-xs font-semibold text-foreground",children:[o==="gold"&&e.jsx($,{className:"w-3.5 h-3.5 fill-current text-primary"}),o==="silver"&&e.jsx(E,{className:"w-3.5 h-3.5 text-foreground/70"}),!o&&e.jsx(C,{className:"w-3.5 h-3.5 text-muted-foreground"}),"Pakej ",j??"Percuma"]}),e.jsx("span",{className:"text-xs font-semibold text-foreground tabular-nums inline-flex items-center gap-1",children:n.limit===-1?e.jsxs(e.Fragment,{children:[e.jsx(P,{className:"w-3 h-3"})," Tanpa had"]}):e.jsxs(e.Fragment,{children:[n.remaining.toLocaleString()," / ",n.limit.toLocaleString()]})})]}),n.limit!==-1&&e.jsx(z,{value:f,className:"h-1.5"}),e.jsx("p",{className:"text-[11px] text-muted-foreground",children:n.limit===-1?"Jana cerita tanpa had":"Baki cerita untuk dijana"}),e.jsx("p",{className:"text-[10px] text-muted-foreground leading-tight",children:"Kredit dikira setiap kali cerita berjaya dijana, termasuk jana semula."})]})}),e.jsx(L,{}),m&&e.jsxs(e.Fragment,{children:[e.jsx(y,{asChild:!0,children:e.jsxs(h,{to:"/admin",className:"flex items-center w-full",children:[e.jsx(X,{className:"w-4 h-4 mr-2"}),"Admin Panel"]})}),e.jsx(L,{})]}),e.jsx(y,{asChild:!0,children:e.jsxs(h,{to:"/profil",className:"flex items-center w-full",children:[e.jsx(C,{className:"w-4 h-4 mr-2"}),"Statistik Saya"]})}),e.jsx(y,{asChild:!0,children:e.jsxs(h,{to:"/rekod-nilam",className:"flex items-center w-full",children:[e.jsx(W,{className:"w-4 h-4 mr-2"}),"Rekod NILAM"]})}),e.jsx(y,{asChild:!0,children:e.jsxs(h,{to:"/papan-pendahulu",className:"flex items-center w-full",children:[e.jsx(Y,{className:"w-4 h-4 mr-2"}),"Papan Pendahulu"]})}),e.jsx(y,{asChild:!0,children:e.jsxs(h,{to:"/profil/edit",className:"flex items-center w-full",children:[e.jsx(D,{className:"w-4 h-4 mr-2"}),"Kemaskini Profil"]})}),e.jsx(L,{}),e.jsxs(y,{onClick:b,className:"text-destructive focus:text-destructive",children:[e.jsx(J,{className:"w-4 h-4 mr-2"}),"Log Keluar"]})]})]}):e.jsxs(e.Fragment,{children:[e.jsx(k,{variant:"ghost",size:"sm",asChild:!0,children:e.jsx(h,{to:"/cari-cerita",children:"Log Masuk"})}),e.jsx(k,{variant:"accent",size:"sm",asChild:!0,children:e.jsx(h,{to:"/harga",children:"Lihat Harga"})})]})}),e.jsx("button",{onClick:()=>a(!s),className:"md:hidden inline-flex size-10 items-center justify-center rounded-xl text-foreground hover:bg-muted","aria-label":"Menu",children:s?e.jsx(pe,{className:"w-5 h-5"}):e.jsx(Ae,{className:"w-5 h-5"})})]}),s&&e.jsx("div",{className:"md:hidden py-4 border-t border-border/70",children:e.jsxs("nav",{className:"flex flex-col gap-1",children:[x.map(u=>e.jsx(v,{to:u.to,onClick:()=>a(!1),className:g("px-3 py-3 rounded-xl text-base font-medium",F(u.to)?"text-primary bg-primary/8":"text-foreground hover:bg-muted"),children:u.label},u.to)),e.jsx("div",{className:"h-px bg-border my-2"}),r?e.jsxs(e.Fragment,{children:[t.isPremium?e.jsxs("div",{className:"px-3 py-2",children:[e.jsxs(_,{variant:"pro",className:"gap-1",children:[e.jsx(I,{className:"w-3 h-3"}),A]}),(t.accessUntil||t.subscriptionEnd)&&e.jsxs("p",{className:"text-xs text-muted-foreground mt-1",children:["Sehingga ",O()]})]}):e.jsxs("div",{className:"mx-3 my-2 rounded-xl border border-border bg-card p-3 space-y-1.5",children:[e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[e.jsxs("span",{className:"inline-flex items-center gap-1.5 text-sm font-semibold text-foreground",children:[o==="gold"&&e.jsx($,{className:"w-4 h-4 fill-current text-primary"}
6),o==="silver"&&e.jsx(E,{className:"w-4 h-4 text-foreground/70"}),!o&&e.jsx(C,{className:"w-4 h-4 text-muted-foreground"}),"Pakej ",j??"Percuma"]}),e.jsx("span",{className:"text-sm font-semibold text-foreground tabular-nums inline-flex items-center gap-1",children:n.limit===-1?e.jsxs(e.Fragment,{children:[e.jsx(P,{className:"w-4 h-4"})," Tanpa had"]}):e.jsxs(e.Fragment,{children:[n.remaining.toLocaleString()," / ",n.limit.toLocaleString()]})})]}),n.limit!==-1&&e.jsx(z,{value:f,className:"h-1.5"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:n.limit===-1?"Jana cerita tanpa had":"Baki cerita untuk dijana"}),e.jsx("p",{className:"text-[10px] text-muted-foreground leading-tight",children:"Kredit dikira setiap kali cerita berjaya dijana, termasuk jana semula."})]}),w&&e.jsx(v,{to:"/harga",onClick:()=>a(!1),className:"px-3 py-3 rounded-xl text-base font-medium bg-accent text-accent-foreground",children:"Sambung Akses"}),m&&e.jsxs(v,{to:"/admin",onClick:()=>a(!1),className:"px-3 py-3 rounded-xl text-base font-medium text-foreground hover:bg-muted flex items-center gap-2",children:[e.jsx(X,{className:"w-4 h-4"}),"Admin Panel"]}),e.jsxs(v,{to:"/profil",onClick:()=>a(!1),className:"px-3 py-3 rounded-xl text-base font-medium text-foreground hover:bg-muted flex items-center gap-2",children:[e.jsx(C,{className:"w-4 h-4"}),"Statistik Saya"]}),e.jsxs(h,{to:"/rekod-nilam",onClick:()=>a(!1),className:"px-3 py-3 rounded-xl text-base font-medium text-foreground hover:bg-muted flex items-center gap-2",children:[e.jsx(W,{className:"w-4 h-4"}),"Rekod NILAM"]}),e.jsxs(h,{to:"/papan-pendahulu",onClick:()=>a(!1),className:"px-3 py-3 rounded-xl text-base font-medium text-foreground hover:bg-muted flex items-center gap-2",children:[e.jsx(Y,{className:"w-4 h-4"}),"Papan Pendahulu"]}),e.jsxs(h,{to:"/profil/edit",onClick:()=>a(!1),className:"px-3 py-3 rounded-xl text-base font-medium text-foreground hover:bg-muted flex items-center gap-2",children:[e.jsx(D,{className:"w-4 h-4"}),"Kemaskini Profil"]}),e.jsxs("button",{onClick:()=>{b(),a(!1)},className:"px-3 py-3 rounded-xl text-base font-medium text-destructive text-left flex items-center gap-2",children:[e.jsx(J,{className:"w-4 h-4"}),"Log Keluar"]})]}):e.jsxs("div",{className:"flex flex-col gap-2 pt-2",children:[e.jsx(k,{variant:"outline",size:"lg",asChild:!0,children:e.jsx(h,{to:"/cari-cerita",onClick:()=>a(!1),children:"Log Masuk"})}),e.jsx(k,{variant:"accent",size:"lg",asChild:!0,children:e.jsx(h,{to:"/harga",onClick:()=>a(!1),children:"Lihat Harga"})})]})]})})]})]})};export{_ as B,cs as H,Ee as a,Ue as u};
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.