import{u as o,a as x,j as e,H as m}from"./app-CyJEXGyv.js";import{B as p}from"./button-COEJSQkW.js";import{I as u}from"./input-De4RhZu7.js";import{B as b}from"./badge-BSEA-Kjk.js";import"./utils-D3rN0LeJ.js";const h=()=>{const{current:s,licenseError:a}=o().props,{data:t,setData:i,post:n,processing:d,errors:l}=x({license_key:(s==null?void 0:s.license_key)??""}),c=r=>{r.preventDefault(),n(route("licenses.activate"))};return e.jsxs(e.Fragment,{children:[e.jsx(m,{title:"Pengaturan Lisensi"}),e.jsx("div",{className:"min-h-screen flex items-center justify-center bg-gradient-to-br from-slate-900 via-slate-950 to-slate-900 text-foreground px-4",children:e.jsxs("div",{className:"w-full max-w-md",children:[e.jsxs("div",{className:"text-center mb-6",children:[e.jsx("h1",{className:"text-xl font-semibold text-slate-50",children:"Aktivasi Lisensi"}),e.jsx("p",{className:"text-xs text-slate-300 mt-1",children:"Masukkan license key yang Anda dapatkan saat pembelian untuk mengaktifkan aplikasi."})]}),e.jsxs("div",{className:"border border-slate-700/80 bg-slate-900/70 backdrop-blur-sm text-card-foreground shadow-xl rounded-2xl p-5 space-y-4",children:[s&&e.jsxs("div",{className:"rounded-lg border border-slate-700 bg-slate-900/80 px-3 py-3 text-xs space-y-1",children:[e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[e.jsx("span",{className:"text-slate-300",children:"Status saat ini:"}),e.jsx(f,{status:s.status})]}),s.message&&e.jsx("div",{className:"text-slate-300",children:s.message}),e.jsxs("div",{className:"flex flex-col gap-1 text-[11px] text-slate-400",children:[s.domain&&e.jsxs("span",{children:["Domain terdaftar:"," ",e.jsx("span",{className:"font-mono text-slate-200",children:s.domain})]}),s.activated_at&&e.jsxs("span",{children:["Diaktivasi:"," ",new Date(s.activated_at).toLocaleString("id-ID")]}),s.last_verified_at&&e.jsxs("span",{children:["Terakhir dicek:"," ",new Date(s.last_verified_at).toLocaleString("id-ID")]})]})]}),a&&e.jsx("div",{className:"rounded-lg border border-red-500/60 bg-red-500/10 px-3 py-2 text-xs text-red-100",children:a}),e.jsxs("form",{onSubmit:c,className:"space-y-4",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsx("label",{className:"text-sm font-medium text-slate-100",children:"License Key"}),e.jsx(u,{value:t.license_key,onChange:r=>i("license_key",r.target.value),placeholder:"Contoh: WIOOS-XXXX-XXXX-XXXX",className:"font-mono text-xs bg-slate-900/80 border-slate-700 text-slate-100 placeholder:text-slate-500"}),l.license_key&&e.jsx("p",{className:"text-xs text-red-300 mt-1",children:l.license_key})]}),e.jsx(p,{type:"submit",disabled:d,className:"w-full",children:s?"Update Lisensi":"Aktifkan Lisensi"}),e.jsx("p",{className:"text-[10px] text-slate-500 text-center",children:"Lisensi ini hanya berlaku untuk satu instalasi. Jika terjadi masalah aktivasi, silakan hubungi support Anda."})]})]})]})})]})},f=({status:s})=>{const a=(s||"inactive").toLowerCase();let t="";return a==="active"?t="bg-emerald-500/15 text-emerald-300 border border-emerald-500/40":a==="disabled"?t="bg-slate-500/15 text-slate-200 border border-slate-500/40":a==="expired"?t="bg-red-500/15 text-red-200 border border-red-500/40":t="bg-amber-500/15 text-amber-200 border border-amber-500/40",e.jsx(b,{className:`text-[11px] font-semibold px-2 py-0.5 ${t}`,children:a.toUpperCase()})};h.layout=s=>s;export{h as default};
