import{h as se,W as Ne,g as l,q as we,E as Se,l as e,V as M,J as de,B as g,X as ke,G as Ce,Y as Te,Z as Ee,_ as _e,$ as oe,k as q,v as U,y as P,z as D,A as O,w as A,j as T,K as Me,N as Fe,O as Le,P as me,Q as Ue,U as Pe,M as De,F as Ae}from"./index-D66m2PHI.js";import{B as F}from"./badge-BFFxd6R-.js";import{S as te}from"./search-Bu47S7kr.js";import{K as Y}from"./key-dQvzE34L.js";import{U as $}from"./users-DFrTxgIf.js";import{I as C}from"./input-DVo6dB61.js";import{S as z,a as I,b as V,c as B,d as k}from"./select-GjUNKL77.js";import{D as W,d as re,a as J,b as Q,c as X,e as Z,f as ee}from"./dialog-JjY0UM9B.js";import{L as v}from"./label-BXpXr2pY.js";import{F as he}from"./filter-uteUAjSZ.js";import{P as xe}from"./plus-DH7HweWA.js";import{U as Oe}from"./user-plus-BJIllPW9.js";import{S as ue}from"./square-pen-CkiT29aV.js";import{T as pe}from"./trash-2-CwL5kjxd.js";import{u as Re}from"./index-Cz4nUXS5.js";import{T as ze}from"./textarea-Dn26dssW.js";import{C as Ie}from"./credit-card-D54UbsRS.js";import"./index-Bjjp-RQW.js";/**
 * @license lucide-react v0.462.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const ae=se("LayoutDashboard",[["rect",{width:"7",height:"9",x:"3",y:"3",rx:"1",key:"10lvy0"}],["rect",{width:"7",height:"5",x:"14",y:"3",rx:"1",key:"16une8"}],["rect",{width:"7",height:"9",x:"14",y:"12",rx:"1",key:"1hutg5"}],["rect",{width:"7",height:"5",x:"3",y:"16",rx:"1",key:"ldoo1y"}]]);/**
 * @license lucide-react v0.462.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const le=se("Package",[["path",{d:"M11 21.73a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73z",key:"1a0edw"}],["path",{d:"M12 22V12",key:"d0xqtd"}],["path",{d:"m3.3 7 7.703 4.734a2 2 0 0 0 1.994 0L20.7 7",key:"yx3hmr"}],["path",{d:"m7.5 4.27 9 5.15",key:"1c824w"}]]);/**
 * @license lucide-react v0.462.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Ve=se("Save",[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]]);/**
 * @license lucide-react v0.462.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Be=se("TestTube",[["path",{d:"M14.5 2v17.5c0 1.4-1.1 2.5-2.5 2.5c-1.4 0-2.5-1.1-2.5-2.5V2",key:"125lnx"}],["path",{d:"M8.5 2h7",key:"csnxdl"}],["path",{d:"M14.5 16h-5",key:"1ox875"}]]),ce=({children:a})=>{var m,x;const t=Ne(),[c,b]=l.useState(!t),[p,j]=l.useState(!1),{user:o,logout:f}=we(),d=Se();l.useEffect(()=>{b(!t)},[t]);const n=()=>{b(!c)},r=async()=>{await f(),d("/admin-login")},u=[{icon:ae,label:"Dashboard",path:"/admin"},{icon:Y,label:"Licenses",path:"/admin?tab=licenses"},{icon:$,label:"Users",path:"/admin?tab=users"},{icon:$,label:"Subscribers",path:"/admin?tab=subscribers"},{icon:ae,label:"Orders",path:"/admin?tab=orders"},{icon:ae,label:"Email Templates",path:"/admin?tab=templates"},{icon:oe,label:"SMTP Settings",path:"/admin?tab=settings"}];return e.jsxs("div",{className:"flex h-screen bg-gray-50 dark:bg-gray-900",children:[e.jsx("aside",{className:M("bg-white dark:bg-gray-800 shadow-lg transform transition-transform duration-300 ease-in-out z-30","fixed md:relative h-full border-r border-gray-200 dark:border-gray-700",c?"translate-x-0 w-64":"-translate-x-full md:translate-x-0 md:w-20"),children:e.jsxs("div",{className:"flex flex-col h-full",children:[e.jsxs("div",{className:"flex items-center justify-between p-4 border-b border-gray-200 dark:border-gray-700",children:[e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx("div",{className:"bg-gradient-to-r from-blue-600 to-purple-600 p-2 rounded-lg",children:e.jsx(de,{className:"h-6 w-6 text-white"})}),c&&e.jsx("h1",{className:"text-xl font-bold text-gray-800 dark:text-white",children:"Admin Panel"})]}),e.jsx(g,{variant:"ghost",size:"icon",className:"md:hidden",onClick:n,children:e.jsx(ke,{className:"h-5 w-5"})})]}),e.jsx("nav",{className:"flex-1 overflow-y-auto py-4",children:e.jsx("ul",{className:"space-y-1 px-2",children:u.map((h,w)=>{const E=h.icon,_=location.pathname===h.path.split("?")[0];return e.jsx("li",{children:e.jsx(Ce,{to:h.path,children:e.jsxs("div",{className:M("flex items-center p-3 rounded-lg transition-colors","hover:bg-gray-100 dark:hover:bg-gray-700",_?"bg-blue-50 text-blue-600 dark:bg-blue-900/30 dark:text-blue-400":"text-gray-700 dark:text-gray-300"),children:[e.jsx(E,{className:"h-5 w-5 flex-shrink-0"}),c&&e.jsx("span",{className:"ml-3 font-medium",children:h.label})]})})},w)})})}),e.jsx("div",{className:"p-4 border-t border-gray-200 dark:border-gray-700",children:e.jsxs("div",{className:"flex items-center justify-between",children:[c&&e.jsxs("div",{className:"flex items-center space-x-3",children:[e.jsx("div",{className:"bg-gray-200 dark:bg-gray-600 rounded-full w-8 h-8 flex items-center justify-center",children:e.jsx("span",{className:"text-xs font-medium text-gray-700 dark:text-gray-300",children:((m=o==null?void 0:o.email)==null?void 0:m.charAt(0).toUpperCase())||"A"})}),e.jsxs("div",{className:"hidden md:block",children:[e.jsx("p",{className:"text-sm font-medium text-gray-800 dark:text-white",children:"Admin"}),e.jsx("p",{className:"text-xs text-gray-500 dark:text-gray-400 truncate",children:o==null?void 0:o.email})]})]}),e.jsx(g,{variant:"ghost",size:"icon",onClick:r,className:"text-gray-500 hover:text-red-500 dark:text-gray-400 dark:hover:text-red-400",children:e.jsx(Te,{className:"h-5 w-5"})})]})})]})}),e.jsxs("div",{className:"flex-1 flex flex-col overflow-hidden",children:[e.jsx("header",{className:"bg-white dark:bg-gray-800 shadow-sm z-20",children:e.jsxs("div",{className:"flex items-center justify-between p-4",children:[e.jsxs("div",{className:"flex items-center",children:[e.jsx(g,{variant:"ghost",size:"icon",className:"md:hidden mr-2",onClick:n,children:e.jsx(Ee,{className:"h-6 w-6"})}),e.jsx("h1",{className:"text-xl font-bold text-gray-800 dark:text-white md:hidden",children:"Admin Panel"})]}),e.jsx("div",{className:"flex-1 max-w-md mx-4 hidden md:block",children:e.jsxs("div",{className:"relative",children:[e.jsx(te,{className:"absolute left-3 top-1/2 transform -translate-y-1/2 text-gray-400 h-4 w-4"}),e.jsx("input",{type:"text",placeholder:"Search...",className:"w-full pl-10 pr-4 py-2 bg-gray-100 dark:bg-gray-700 rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500 text-sm"})]})}),e.jsxs("div",{className:"flex items-center space-x-4",children:[e.jsxs(g,{variant:"ghost",size:"icon",className:"relative text-gray-500 hover:text-gray-700 dark:text-gray-400 dark:hover:text-gray-200",onClick:()=>j(!p),children:[e.jsx(_e,{className:"h-5 w-5"}),e.jsx("span",{className:"absolute top-0 right-0 block h-2 w-2 rounded-full bg-red-500"})]}),e.jsxs("div",{className:"hidden md:flex items-center space-x-2",children:[e.jsx("div",{className:"bg-gray-200 dark:bg-gray-600 rounded-full w-8 h-8 flex items-center justify-center",children:e.jsx("span",{className:"text-xs font-medium text-gray-700 dark:text-gray-300",children:((x=o==null?void 0:o.email)==null?void 0:x.charAt(0).toUpperCase())||"A"})}),e.jsxs("div",{className:"hidden lg:block",children:[e.jsx("p",{className:"text-sm font-medium text-gray-800 dark:text-white",children:"Admin"}),e.jsx("p",{className:"text-xs text-gray-500 dark:text-gray-400 truncate max-w-[120px]",children:o==null?void 0:o.email})]})]})]})]})}),e.jsx("main",{className:"flex-1 overflow-y-auto p-4 md:p-6 bg-gray-50 dark:bg-gray-900",children:e.jsx("div",{className:"max-w-7xl mx-auto",children:a})})]})]})},H=l.forwardRef(({className:a,...t},c)=>e.jsx("div",{className:"w-full overflow-auto",children:e.jsx("table",{ref:c,className:M("w-full caption-bottom text-sm",a),...t})}));H.displayName="Table";const K=l.forwardRef(({className:a,...t},c)=>e.jsx("thead",{ref:c,className:M("[&_tr]:border-b",a),...t}));K.displayName="TableHeader";const G=l.forwardRef(({className:a,...t},c)=>e.jsx("tbody",{ref:c,className:M("[&_tr:last-child]:border-0",a),...t}));G.displayName="TableBody";const qe=l.forwardRef(({className:a,...t},c)=>e.jsx("tfoot",{ref:c,className:M("bg-primary font-medium text-primary-foreground",a),...t}));qe.displayName="TableFooter";const L=l.forwardRef(({className:a,...t},c)=>e.jsx("tr",{ref:c,className:M("border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted",a),...t}));L.displayName="TableRow";const N=l.forwardRef(({className:a,...t},c)=>e.jsx("th",{ref:c,className:M("h-12 px-4 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0",a),...t}));N.displayName="TableHead";const y=l.forwardRef(({className:a,...t},c)=>e.jsx("td",{ref:c,className:M("p-4 align-middle [&:has([role=checkbox])]:pr-0",a),...t}));y.displayName="TableCell";const He=l.forwardRef(({className:a,...t},c)=>e.jsx("caption",{ref:c,className:M("mt-4 text-sm text-muted-foreground",a),...t}));He.displayName="TableCaption";const Ke=({licenses:a,onRefresh:t})=>{const[c,b]=l.useState(!1),[p,j]=l.useState({subscription_tier:"basic",quantity:1}),{toast:o}=q(),f=async()=>{try{const r=await T.adminManageLicenses("create",{subscription_tier:p.subscription_tier,quantity:p.quantity});if(r.error)throw new Error(r.error);o({title:"Success",description:`Created ${p.quantity} license key(s)`}),b(!1),j({subscription_tier:"basic",quantity:1}),t()}catch{o({title:"Error",description:"Failed to create license keys",variant:"destructive"})}},d=async(r,u)=>{try{const m=await T.adminManageLicenses("update",{id:r,status:u});if(m.error)throw new Error(m.error);o({title:"Success",description:"License status updated"}),t()}catch{o({title:"Error",description:"Failed to update license status",variant:"destructive"})}},n=r=>{switch(r.toLowerCase()){case"active":return"default";case"pending":return"secondary";case"expired":return"destructive";case"suspended":return"outline";default:return"secondary"}};return e.jsxs(U,{className:"border-0 shadow-lg",children:[e.jsx(P,{className:"bg-white dark:bg-gray-800 border-b border-gray-100 dark:border-gray-700",children:e.jsxs("div",{className:"flex flex-col md:flex-row md:items-center md:justify-between gap-4",children:[e.jsxs("div",{children:[e.jsxs(D,{className:"flex items-center gap-2",children:[e.jsx(Y,{className:"h-5 w-5 text-blue-500"}),"License Management"]}),e.jsx(O,{children:"Create and manage software license keys"})]}),e.jsxs("div",{className:"flex flex-col sm:flex-row gap-2",children:[e.jsxs("div",{className:"relative",children:[e.jsx(te,{className:"absolute left-3 top-1/2 transform -translate-y-1/2 h-4 w-4 text-gray-400"}),e.jsx(C,{placeholder:"Search licenses...",className:"pl-10 w-full md:w-64"})]}),e.jsxs(g,{variant:"outline",size:"sm",children:[e.jsx(he,{className:"h-4 w-4 mr-2"}),"Filter"]}),e.jsxs(W,{open:c,onOpenChange:b,children:[e.jsx(re,{asChild:!0,children:e.jsxs(g,{size:"sm",children:[e.jsx(xe,{className:"h-4 w-4 mr-2"}),"Create Licenses"]})}),e.jsxs(J,{children:[e.jsxs(Q,{children:[e.jsx(X,{children:"Create License Keys"}),e.jsx(Z,{children:"Generate new license keys for users"})]}),e.jsxs("div",{className:"grid gap-4 py-4",children:[e.jsxs("div",{className:"grid grid-cols-4 items-center gap-4",children:[e.jsx(v,{htmlFor:"tier",className:"text-right",children:"Tier"}),e.jsxs(z,{value:p.subscription_tier,onValueChange:r=>j({...p,subscription_tier:r}),children:[e.jsx(I,{className:"col-span-3",children:e.jsx(V,{})}),e.jsxs(B,{children:[e.jsx(k,{value:"basic",children:"Basic"}),e.jsx(k,{value:"pro",children:"Pro"}),e.jsx(k,{value:"enterprise",children:"Enterprise"})]})]})]}),e.jsxs("div",{className:"grid grid-cols-4 items-center gap-4",children:[e.jsx(v,{htmlFor:"quantity",className:"text-right",children:"Quantity"}),e.jsx(C,{id:"quantity",type:"number",min:"1",max:"100",value:p.quantity,onChange:r=>j({...p,quantity:parseInt(r.target.value)||1}),className:"col-span-3"})]})]}),e.jsxs(ee,{children:[e.jsx(g,{variant:"outline",onClick:()=>b(!1),children:"Cancel"}),e.jsx(g,{onClick:f,children:"Create Licenses"})]})]})]})]})]})}),e.jsx(A,{className:"p-0",children:e.jsxs(H,{children:[e.jsx(K,{children:e.jsxs(L,{className:"bg-gray-50 dark:bg-gray-700",children:[e.jsx(N,{className:"font-semibold",children:"License Key"}),e.jsx(N,{className:"font-semibold",children:"Tier"}),e.jsx(N,{className:"font-semibold",children:"Status"}),e.jsx(N,{className:"font-semibold",children:"Created"}),e.jsx(N,{className:"font-semibold text-right",children:"Actions"})]})}),e.jsx(G,{children:a.length===0?e.jsx(L,{children:e.jsx(y,{colSpan:5,className:"text-center py-8 text-gray-500",children:"No licenses found. Create your first license key to get started."})}):a.map(r=>e.jsxs(L,{className:"border-b border-gray-100 dark:border-gray-700 hover:bg-gray-50 dark:hover:bg-gray-800",children:[e.jsx(y,{className:"font-mono text-sm py-3",children:e.jsxs("div",{className:"flex items-center",children:[e.jsx(Y,{className:"h-4 w-4 mr-2 text-gray-400"}),r.key_value]})}),e.jsx(y,{className:"py-3",children:e.jsx(F,{variant:"secondary",className:"capitalize",children:r.subscription_tier})}),e.jsx(y,{className:"py-3",children:e.jsx(F,{variant:n(r.status),children:r.status})}),e.jsx(y,{className:"py-3 text-sm text-gray-500 dark:text-gray-400",children:new Date(r.created_at).toLocaleDateString()}),e.jsx(y,{className:"py-3 text-right",children:e.jsxs(z,{onValueChange:u=>d(r.id,u),children:[e.jsx(I,{className:"w-32 ml-auto",children:e.jsx(V,{placeholder:"Update Status"})}),e.jsxs(B,{children:[e.jsx(k,{value:"active",children:"Activate"}),e.jsx(k,{value:"suspended",children:"Suspend"}),e.jsx(k,{value:"expired",children:"Expire"})]})]})})]},r.id))})]})})]})},Ge=()=>{const[a,t]=l.useState([]),[c,b]=l.useState(!0),[p,j]=l.useState(!1),[o,f]=l.useState(!1),[d,n]=l.useState(null),[r,u]=l.useState({email:"",password:"",firstName:"",lastName:"",role:"user"}),{toast:m}=q();l.useEffect(()=>{x()},[]);const x=async()=>{var i;try{const S=await T.adminManageUsers("list");if(S.error)throw new Error(S.error);t(((i=S.data)==null?void 0:i.users)||[])}catch(S){console.error("Error fetching users:",S),m({title:"Error",description:"Failed to fetch users",variant:"destructive"})}finally{b(!1)}},h=async()=>{try{const i=await T.adminManageUsers("create",{userData:r});if(i.error)throw new Error(i.error);m({title:"Success",description:"User created successfully"}),j(!1),u({email:"",password:"",firstName:"",lastName:"",role:"user"}),x()}catch{m({title:"Error",description:"Failed to create user",variant:"destructive"})}},w=async()=>{if(d)try{const i=await T.adminManageUsers("update",{userId:d.id,userData:{role:d.role,firstName:d.first_name,lastName:d.last_name}});if(i.error)throw new Error(i.error);m({title:"Success",description:"User updated successfully"}),f(!1),n(null),x()}catch{m({title:"Error",description:"Failed to update user",variant:"destructive"})}},E=async i=>{try{const S=await T.adminManageUsers("delete",{userId:i});if(S.error)throw new Error(S.error);m({title:"Success",description:"User deleted successfully"}),x()}catch{m({title:"Error",description:"Failed to delete user",variant:"destructive"})}},_=i=>i==="admin"?"default":"secondary";return c?e.jsx("div",{className:"flex items-center justify-center p-8",children:e.jsx("div",{className:"w-8 h-8 border-4 border-blue-500 border-t-transparent rounded-full animate-spin"})}):e.jsxs(U,{className:"border-0 shadow-lg",children:[e.jsx(P,{className:"bg-white dark:bg-gray-800 border-b border-gray-100 dark:border-gray-700",children:e.jsxs("div",{className:"flex flex-col md:flex-row md:items-center md:justify-between gap-4",children:[e.jsxs("div",{children:[e.jsxs(D,{className:"flex items-center gap-2",children:[e.jsx($,{className:"h-5 w-5 text-blue-500"}),"User Management"]}),e.jsx(O,{children:"Manage all users in the system"})]}),e.jsxs("div",{className:"flex flex-col sm:flex-row gap-2",children:[e.jsxs("div",{className:"relative",children:[e.jsx(te,{className:"absolute left-3 top-1/2 transform -translate-y-1/2 h-4 w-4 text-gray-400"}),e.jsx(C,{placeholder:"Search users...",className:"pl-10 w-full md:w-64"})]}),e.jsxs(g,{variant:"outline",size:"sm",children:[e.jsx(he,{className:"h-4 w-4 mr-2"}),"Filter"]}),e.jsxs(W,{open:p,onOpenChange:j,children:[e.jsx(re,{asChild:!0,children:e.jsxs(g,{size:"sm",children:[e.jsx(Oe,{className:"w-4 h-4 mr-2"}),"Create User"]})}),e.jsxs(J,{children:[e.jsxs(Q,{children:[e.jsx(X,{children:"Create New User"}),e.jsx(Z,{children:"Add a new user to the system"})]}),e.jsxs("div",{className:"grid gap-4 py-4",children:[e.jsxs("div",{className:"grid grid-cols-4 items-center gap-4",children:[e.jsx(v,{htmlFor:"email",className:"text-right",children:"Email"}),e.jsx(C,{id:"email",type:"email",value:r.email,onChange:i=>u({...r,email:i.target.value}),className:"col-span-3"})]}),e.jsxs("div",{className:"grid grid-cols-4 items-center gap-4",children:[e.jsx(v,{htmlFor:"password",className:"text-right",children:"Password"}),e.jsx(C,{id:"password",type:"password",value:r.password,onChange:i=>u({...r,password:i.target.value}),className:"col-span-3"})]}),e.jsxs("div",{className:"grid grid-cols-4 items-center gap-4",children:[e.jsx(v,{htmlFor:"firstName",className:"text-right",children:"First Name"}),e.jsx(C,{id:"firstName",value:r.firstName,onChange:i=>u({...r,firstName:i.target.value}),className:"col-span-3"})]}),e.jsxs("div",{className:"grid grid-cols-4 items-center gap-4",children:[e.jsx(v,{htmlFor:"lastName",className:"text-right",children:"Last Name"}),e.jsx(C,{id:"lastName",value:r.lastName,onChange:i=>u({...r,lastName:i.target.value}),className:"col-span-3"})]}),e.jsxs("div",{className:"grid grid-cols-4 items-center gap-4",children:[e.jsx(v,{htmlFor:"role",className:"text-right",children:"Role"}),e.jsxs(z,{value:r.role,onValueChange:i=>u({...r,role:i}),children:[e.jsx(I,{className:"col-span-3",children:e.jsx(V,{})}),e.jsxs(B,{children:[e.jsx(k,{value:"user",children:"User"}),e.jsx(k,{value:"admin",children:"Admin"})]})]})]})]}),e.jsxs(ee,{children:[e.jsx(g,{variant:"outline",onClick:()=>j(!1),children:"Cancel"}),e.jsx(g,{onClick:h,children:"Create User"})]})]})]})]})]})}),e.jsx(A,{className:"p-0",children:e.jsxs(H,{children:[e.jsx(K,{children:e.jsxs(L,{className:"bg-gray-50 dark:bg-gray-700",children:[e.jsx(N,{className:"font-semibold",children:"User"}),e.jsx(N,{className:"font-semibold",children:"Email"}),e.jsx(N,{className:"font-semibold",children:"Role"}),e.jsx(N,{className:"font-semibold",children:"Joined"}),e.jsx(N,{className:"font-semibold text-right",children:"Actions"})]})}),e.jsx(G,{children:a.length===0?e.jsx(L,{children:e.jsx(y,{colSpan:5,className:"text-center py-8 text-gray-500",children:"No users found."})}):a.map(i=>{var S,s,R;return e.jsxs(L,{className:"border-b border-gray-100 dark:border-gray-700 hover:bg-gray-50 dark:hover:bg-gray-800",children:[e.jsx(y,{className:"py-3",children:e.jsxs("div",{className:"flex items-center",children:[e.jsx("div",{className:"bg-gray-200 dark:bg-gray-600 rounded-full w-8 h-8 flex items-center justify-center mr-3",children:e.jsx("span",{className:"text-xs font-medium text-gray-700 dark:text-gray-300",children:(((S=i.first_name)==null?void 0:S.charAt(0))||"")+(((s=i.last_name)==null?void 0:s.charAt(0))||((R=i.email)==null?void 0:R.charAt(0))||"U")})}),e.jsxs("div",{children:[e.jsxs("div",{className:"font-medium",children:[i.first_name," ",i.last_name]}),e.jsxs("div",{className:"text-sm text-gray-500 dark:text-gray-400",children:["@",i.username||"N/A"]})]})]})}),e.jsx(y,{className:"py-3",children:i.email}),e.jsx(y,{className:"py-3",children:e.jsx(F,{variant:_(i.role||"user"),children:i.role||"user"})}),e.jsx(y,{className:"py-3 text-sm text-gray-500 dark:text-gray-400",children:new Date(i.created_at).toLocaleDateString()}),e.jsx(y,{className:"py-3 text-right",children:e.jsxs("div",{className:"flex justify-end space-x-2",children:[e.jsx(g,{variant:"outline",size:"sm",onClick:()=>{n({...i,role:i.role||"user"}),f(!0)},children:e.jsx(ue,{className:"w-4 h-4"})}),e.jsx(g,{variant:"outline",size:"sm",onClick:()=>E(i.id),children:e.jsx(pe,{className:"w-4 h-4"})})]})})]},i.id)})})]})}),e.jsx(W,{open:o,onOpenChange:f,children:e.jsxs(J,{children:[e.jsxs(Q,{children:[e.jsx(X,{children:"Edit User"}),e.jsx(Z,{children:"Update user information"})]}),d&&e.jsxs("div",{className:"grid gap-4 py-4",children:[e.jsxs("div",{className:"grid grid-cols-4 items-center gap-4",children:[e.jsx(v,{htmlFor:"editFirstName",className:"text-right",children:"First Name"}),e.jsx(C,{id:"editFirstName",value:d.first_name||"",onChange:i=>n({...d,first_name:i.target.value}),className:"col-span-3"})]}),e.jsxs("div",{className:"grid grid-cols-4 items-center gap-4",children:[e.jsx(v,{htmlFor:"editLastName",className:"text-right",children:"Last Name"}),e.jsx(C,{id:"editLastName",value:d.last_name||"",onChange:i=>n({...d,last_name:i.target.value}),className:"col-span-3"})]}),e.jsxs("div",{className:"grid grid-cols-4 items-center gap-4",children:[e.jsx(v,{htmlFor:"editRole",className:"text-right",children:"Role"}),e.jsxs(z,{value:d.role||"user",onValueChange:i=>n({...d,role:i}),children:[e.jsx(I,{className:"col-span-3",children:e.jsx(V,{})}),e.jsxs(B,{children:[e.jsx(k,{value:"user",children:"User"}),e.jsx(k,{value:"admin",children:"Admin"})]})]})]})]}),e.jsxs(ee,{children:[e.jsx(g,{variant:"outline",onClick:()=>f(!1),children:"Cancel"}),e.jsx(g,{onClick:w,children:"Update User"})]})]})})]})},Ye=({subscribers:a})=>e.jsxs(U,{children:[e.jsxs(P,{children:[e.jsx(D,{children:"Subscribers"}),e.jsx(O,{children:"Current subscription status of all users"})]}),e.jsx(A,{children:e.jsxs(H,{children:[e.jsx(K,{children:e.jsxs(L,{children:[e.jsx(N,{children:"Email"}),e.jsx(N,{children:"Subscription"}),e.jsx(N,{children:"Tier"}),e.jsx(N,{children:"Expires"})]})}),e.jsx(G,{children:a.map(t=>e.jsxs(L,{children:[e.jsx(y,{children:t.email}),e.jsx(y,{children:e.jsx(F,{variant:t.subscribed?"default":"secondary",children:t.subscribed?"Active":"Inactive"})}),e.jsx(y,{children:t.subscription_tier||"None"}),e.jsx(y,{children:t.subscription_end?new Date(t.subscription_end).toLocaleDateString():"N/A"})]},t.id))})]})})]});var ie="Switch",[$e,vs]=Me(ie),[We,Je]=$e(ie),je=l.forwardRef((a,t)=>{const{__scopeSwitch:c,name:b,checked:p,defaultChecked:j,required:o,disabled:f,value:d="on",onCheckedChange:n,form:r,...u}=a,[m,x]=l.useState(null),h=Fe(t,S=>x(S)),w=l.useRef(!1),E=m?r||!!m.closest("form"):!0,[_=!1,i]=Le({prop:p,defaultProp:j,onChange:n});return e.jsxs(We,{scope:c,checked:_,disabled:f,children:[e.jsx(me.button,{type:"button",role:"switch","aria-checked":_,"aria-required":o,"data-state":ve(_),"data-disabled":f?"":void 0,disabled:f,value:d,...u,ref:h,onClick:Ue(a.onClick,S=>{i(s=>!s),E&&(w.current=S.isPropagationStopped(),w.current||S.stopPropagation())})}),E&&e.jsx(Qe,{control:m,bubbles:!w.current,name:b,value:d,checked:_,required:o,disabled:f,form:r,style:{transform:"translateX(-100%)"}})]})});je.displayName=ie;var ge="SwitchThumb",fe=l.forwardRef((a,t)=>{const{__scopeSwitch:c,...b}=a,p=Je(ge,c);return e.jsx(me.span,{"data-state":ve(p.checked),"data-disabled":p.disabled?"":void 0,...b,ref:t})});fe.displayName=ge;var Qe=a=>{const{control:t,checked:c,bubbles:b=!0,...p}=a,j=l.useRef(null),o=Re(c),f=Pe(t);return l.useEffect(()=>{const d=j.current,n=window.HTMLInputElement.prototype,u=Object.getOwnPropertyDescriptor(n,"checked").set;if(o!==c&&u){const m=new Event("click",{bubbles:b});u.call(d,c),d.dispatchEvent(m)}},[o,c,b]),e.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:c,...p,tabIndex:-1,ref:j,style:{...a.style,...f,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})};function ve(a){return a?"checked":"unchecked"}var ye=je,Xe=fe;const ne=l.forwardRef(({className:a,...t},c)=>e.jsx(ye,{className:M("peer inline-flex h-6 w-11 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input",a),...t,ref:c,children:e.jsx(Xe,{className:M("pointer-events-none block h-5 w-5 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-5 data-[state=unchecked]:translate-x-0")})}));ne.displayName=ye.displayName;const Ze=()=>{const[a,t]=l.useState({provider:"smtp",host:"",port:587,username:"",password:"",from_email:"",from_name:"",is_active:!1}),[c,b]=l.useState(!0),[p,j]=l.useState(!1),{toast:o}=q();l.useEffect(()=>{f()},[]);const f=async()=>{var m;try{const x=await T.adminManageSmtp("get");if(x.error)throw new Error(x.error);(m=x.data)!=null&&m.settings&&t(x.data.settings)}catch(x){console.error("Error fetching SMTP settings:",x),o({title:"Error",description:"Failed to fetch SMTP settings",variant:"destructive"})}finally{b(!1)}},d=async()=>{var m;j(!0);try{const x=await T.adminManageSmtp("save",{settings:a});if(x.error)throw new Error(x.error);(m=x.data)!=null&&m.settings&&(t(x.data.settings),o({title:"Success",description:"SMTP settings saved successfully"}))}catch(x){console.error("Error saving SMTP settings:",x),o({title:"Error",description:"Failed to save SMTP settings",variant:"destructive"})}finally{j(!1)}},n=m=>{const{name:x,value:h,type:w}=m.target,E=w==="number"?parseInt(h)||0:h;t(_=>({..._,[x]:E}))},r=m=>{t(x=>({...x,provider:m}))},u=m=>{t(x=>({...x,is_active:m}))};return c?e.jsx("div",{className:"flex items-center justify-center p-8",children:e.jsx("div",{className:"w-8 h-8 border-4 border-flashcore-purple border-t-transparent rounded-full animate-spin"})}):e.jsxs(U,{children:[e.jsxs(P,{children:[e.jsxs(D,{className:"flex items-center gap-2",children:[e.jsx(De,{className:"h-5 w-5"}),"SMTP Configuration"]}),e.jsx(O,{children:"Configure your email server settings for sending notifications and messages"})]}),e.jsxs(A,{className:"space-y-6",children:[e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(v,{htmlFor:"provider",children:"Provider"}),e.jsxs(z,{value:a.provider,onValueChange:r,children:[e.jsx(I,{children:e.jsx(V,{placeholder:"Select provider"})}),e.jsxs(B,{children:[e.jsx(k,{value:"smtp",children:"Generic SMTP"}),e.jsx(k,{value:"gmail",children:"Gmail"}),e.jsx(k,{value:"outlook",children:"Outlook/Hotmail"}),e.jsx(k,{value:"yahoo",children:"Yahoo Mail"})]})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(v,{htmlFor:"host",children:"Host"}),e.jsx(C,{id:"host",name:"host",value:a.host,onChange:n,placeholder:"smtp.example.com"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(v,{htmlFor:"port",children:"Port"}),e.jsx(C,{id:"port",name:"port",type:"number",value:a.port,onChange:n,placeholder:"587"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(v,{htmlFor:"username",children:"Username"}),e.jsx(C,{id:"username",name:"username",value:a.username,onChange:n,placeholder:"your-email@example.com"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(v,{htmlFor:"password",children:"Password"}),e.jsx(C,{id:"password",name:"password",type:"password",value:a.password,onChange:n,placeholder:"Your email password"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(v,{htmlFor:"from_email",children:"From Email"}),e.jsx(C,{id:"from_email",name:"from_email",type:"email",value:a.from_email,onChange:n,placeholder:"noreply@example.com"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(v,{htmlFor:"from_name",children:"From Name"}),e.jsx(C,{id:"from_name",name:"from_name",value:a.from_name,onChange:n,placeholder:"Your Company Name"})]})]}),e.jsxs("div",{className:"flex items-center justify-between pt-4 border-t",children:[e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx(ne,{id:"active",checked:a.is_active,onCheckedChange:u}),e.jsx(v,{htmlFor:"active",children:"Active"})]}),e.jsx(g,{onClick:d,disabled:p,children:p?e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"w-4 h-4 border-2 border-t-transparent border-white rounded-full animate-spin mr-2"}),"Saving..."]}):e.jsxs(e.Fragment,{children:[e.jsx(Ve,{className:"w-4 h-4 mr-2"}),"Save Settings"]})})]}),e.jsx("div",{className:"bg-blue-50 border border-blue-200 rounded-lg p-4",children:e.jsxs("div",{className:"flex items-start",children:[e.jsx(Be,{className:"w-5 h-5 text-blue-500 mt-0.5 mr-2 flex-shrink-0"}),e.jsxs("div",{children:[e.jsx("h4",{className:"font-medium text-blue-800",children:"Testing SMTP Settings"}),e.jsx("p",{className:"text-sm text-blue-700 mt-1",children:"After saving your settings, you can test the connection by sending a test email to verify everything is configured correctly."})]})]})})]})]})},es=()=>{const[a,t]=l.useState([]),[c,b]=l.useState(!0),[p,j]=l.useState(!1),[o,f]=l.useState(null),[d,n]=l.useState({name:"",subject:"",content:"",template_type:"welcome",is_active:!0}),{toast:r}=q();l.useEffect(()=>{u()},[]);const u=async()=>{try{const s=await T.adminManageEmailTemplates("list");if(s.error)throw new Error(s.error);t(s.data.templates||[])}catch(s){console.error("Error fetching email templates:",s),r({title:"Error",description:"Failed to fetch email templates",variant:"destructive"})}finally{b(!1)}},m=async()=>{try{const s=await T.adminManageEmailTemplates("create",{templateData:d});if(s.error)throw new Error(s.error);r({title:"Success",description:"Email template created successfully"}),j(!1),w(),u()}catch{r({title:"Error",description:"Failed to create email template",variant:"destructive"})}},x=async()=>{if(o)try{const s=await T.adminManageEmailTemplates("update",{id:o.id,templateData:d});if(s.error)throw new Error(s.error);r({title:"Success",description:"Email template updated successfully"}),j(!1),f(null),w(),u()}catch{r({title:"Error",description:"Failed to update email template",variant:"destructive"})}},h=async s=>{try{const R=await T.adminManageEmailTemplates("delete",{id:s});if(R.error)throw new Error(R.error);r({title:"Success",description:"Email template deleted successfully"}),u()}catch{r({title:"Error",description:"Failed to delete email template",variant:"destructive"})}},w=()=>{n({name:"",subject:"",content:"",template_type:"welcome",is_active:!0})},E=s=>{f(s),n({name:s.name,subject:s.subject,content:s.content,template_type:s.template_type,is_active:s.is_active}),j(!0)},_=()=>{o?x():m()},i=s=>{const be={welcome:"default",notification:"secondary",license_activation:"outline",receipt:"destructive"}[s]||"outline";return e.jsx(F,{variant:be,children:s})},S=s=>e.jsx(F,{variant:s?"default":"secondary",children:s?"Active":"Inactive"});return c?e.jsx("div",{className:"p-6",children:"Loading email templates..."}):e.jsxs(U,{children:[e.jsx(P,{children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx(D,{children:"Email Templates"}),e.jsx(O,{children:"Manage email templates for different types of communications"})]}),e.jsxs(W,{open:p,onOpenChange:s=>{j(s),s||(f(null),w())},children:[e.jsx(re,{asChild:!0,children:e.jsxs(g,{children:[e.jsx(xe,{className:"w-4 h-4 mr-2"}),"Create Template"]})}),e.jsxs(J,{className:"max-w-2xl",children:[e.jsxs(Q,{children:[e.jsx(X,{children:o?"Edit Email Template":"Create Email Template"}),e.jsx(Z,{children:o?"Edit the email template details":"Create a new email template"})]}),e.jsxs("div",{className:"grid gap-4 py-4",children:[e.jsxs("div",{className:"grid grid-cols-4 items-center gap-4",children:[e.jsx(v,{htmlFor:"name",className:"text-right",children:"Name"}),e.jsx(C,{id:"name",value:d.name,onChange:s=>n({...d,name:s.target.value}),className:"col-span-3"})]}),e.jsxs("div",{className:"grid grid-cols-4 items-center gap-4",children:[e.jsx(v,{htmlFor:"subject",className:"text-right",children:"Subject"}),e.jsx(C,{id:"subject",value:d.subject,onChange:s=>n({...d,subject:s.target.value}),className:"col-span-3"})]}),e.jsxs("div",{className:"grid grid-cols-4 items-center gap-4",children:[e.jsx(v,{htmlFor:"template_type",className:"text-right",children:"Type"}),e.jsxs(z,{value:d.template_type,onValueChange:s=>n({...d,template_type:s}),children:[e.jsx(I,{className:"col-span-3",children:e.jsx(V,{})}),e.jsxs(B,{children:[e.jsx(k,{value:"welcome",children:"Welcome"}),e.jsx(k,{value:"notification",children:"Notification"}),e.jsx(k,{value:"license_activation",children:"License Activation"}),e.jsx(k,{value:"receipt",children:"Receipt"}),e.jsx(k,{value:"other",children:"Other"})]})]})]}),e.jsxs("div",{className:"grid grid-cols-4 items-center gap-4",children:[e.jsx(v,{htmlFor:"is_active",className:"text-right",children:"Active"}),e.jsx("div",{className:"col-span-3",children:e.jsx(ne,{id:"is_active",checked:d.is_active,onCheckedChange:s=>n({...d,is_active:s})})})]}),e.jsxs("div",{className:"grid grid-cols-4 items-start gap-4",children:[e.jsx(v,{htmlFor:"content",className:"text-right pt-2",children:"Content"}),e.jsx(ze,{id:"content",value:d.content,onChange:s=>n({...d,content:s.target.value}),className:"col-span-3",rows:10})]})]}),e.jsx(ee,{children:e.jsx(g,{onClick:_,children:o?"Update Template":"Create Template"})})]})]})]})}),e.jsx(A,{children:e.jsxs(H,{children:[e.jsx(K,{children:e.jsxs(L,{children:[e.jsx(N,{children:"Name"}),e.jsx(N,{children:"Type"}),e.jsx(N,{children:"Subject"}),e.jsx(N,{children:"Status"}),e.jsx(N,{children:"Created By"}),e.jsx(N,{children:"Actions"})]})}),e.jsx(G,{children:a.map(s=>e.jsxs(L,{children:[e.jsx(y,{className:"font-medium",children:s.name}),e.jsx(y,{children:i(s.template_type)}),e.jsx(y,{children:s.subject}),e.jsx(y,{children:S(s.is_active)}),e.jsx(y,{children:s.created_by_email}),e.jsx(y,{children:e.jsxs("div",{className:"flex space-x-2",children:[e.jsx(g,{variant:"outline",size:"sm",onClick:()=>E(s),children:e.jsx(ue,{className:"w-4 h-4"})}),e.jsx(g,{variant:"outline",size:"sm",onClick:()=>h(s.id),children:e.jsx(pe,{className:"w-4 h-4"})})]})})]},s.id))})]})})]})},ys=()=>{const a=Ae(),[t,c]=l.useState([]),[b,p]=l.useState([]);l.useState([]);const[j,o]=l.useState(!0),{toast:f}=q(),d=()=>new URLSearchParams(a.search).get("tab")||"dashboard",[n,r]=l.useState(d());l.useEffect(()=>{r(d())},[a.search]);const u=async()=>{var h;try{o(!0);const w=await T.adminManageLicenses("list");(h=w.data)!=null&&h.licenses&&c(w.data.licenses)}catch(w){console.error("Error fetching data:",w),f({title:"Error",description:"Failed to fetch data",variant:"destructive"})}finally{o(!1)}};l.useEffect(()=>{u()},[]);const m=[{title:"Total Users",value:"1,245",description:"+12% from last month",icon:$,change:"+12%",changeType:"positive"},{title:"Active Licenses",value:"87",description:"+5% from last month",icon:Y,change:"+5%",changeType:"positive"},{title:"Revenue",value:"$24,500",description:"+18% from last month",icon:Ie,change:"+18%",changeType:"positive"},{title:"Subscribers",value:"3,280",description:"+8% from last month",icon:le,change:"+8%",changeType:"positive"}];if(j)return e.jsx(ce,{children:e.jsx("div",{className:"flex items-center justify-center h-64",children:e.jsx("div",{className:"w-8 h-8 border-4 border-blue-500 border-t-transparent rounded-full animate-spin"})})});const x=()=>{switch(n){case"licenses":return e.jsx(Ke,{licenses:t,onRefresh:u});case"users":return e.jsx(Ge,{});case"subscribers":return e.jsx(Ye,{subscribers:b});case"orders":return e.jsxs(U,{children:[e.jsxs(P,{children:[e.jsx(D,{children:"Orders Management"}),e.jsx(O,{children:"Manage customer orders and subscriptions"})]}),e.jsx(A,{children:e.jsxs("div",{className:"text-center py-12",children:[e.jsx(le,{className:"mx-auto h-12 w-12 text-gray-400"}),e.jsx("h3",{className:"mt-2 text-sm font-medium text-gray-900 dark:text-white",children:"Orders management coming soon"}),e.jsx("p",{className:"mt-1 text-sm text-gray-500 dark:text-gray-400",children:"This feature is currently under development."})]})})]});case"templates":return e.jsx(es,{});case"settings":return e.jsx(Ze,{});default:return e.jsxs("div",{className:"space-y-6",children:[e.jsx("div",{className:"grid gap-4 md:grid-cols-2 lg:grid-cols-4",children:m.map((h,w)=>{const E=h.icon;return e.jsxs(U,{children:[e.jsxs(P,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[e.jsx(D,{className:"text-sm font-medium",children:h.title}),e.jsx(E,{className:"h-4 w-4 text-muted-foreground"})]}),e.jsxs(A,{children:[e.jsx("div",{className:"text-2xl font-bold",children:h.value}),e.jsx("p",{className:"text-xs text-muted-foreground",children:h.description})]})]},w)})}),e.jsxs("div",{className:"grid gap-4 md:grid-cols-2",children:[e.jsxs(U,{children:[e.jsxs(P,{children:[e.jsx(D,{children:"Recent Licenses"}),e.jsx(O,{children:"Latest license activations"})]}),e.jsx(A,{children:e.jsx("div",{className:"space-y-4",children:t.slice(0,5).map(h=>e.jsxs("div",{className:"flex items-center",children:[e.jsxs("div",{className:"ml-4 space-y-1",children:[e.jsxs("p",{className:"text-sm font-medium leading-none",children:[h.key_value.substring(0,14),"..."]}),e.jsxs("p",{className:"text-sm text-muted-foreground",children:[h.subscription_tier," • ",new Date(h.created_at).toLocaleDateString()]})]}),e.jsx("div",{className:"ml-auto font-medium",children:e.jsx(F,{variant:h.status==="active"?"default":"secondary",children:h.status})})]},h.id))})})]}),e.jsxs(U,{children:[e.jsxs(P,{children:[e.jsx(D,{children:"System Status"}),e.jsx(O,{children:"Current system health"})]}),e.jsx(A,{children:e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("span",{className:"text-sm font-medium",children:"Database"}),e.jsx(F,{variant:"default",children:"Operational"})]}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("span",{className:"text-sm font-medium",children:"API"}),e.jsx(F,{variant:"default",children:"Operational"})]}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("span",{className:"text-sm font-medium",children:"Email Service"}),e.jsx(F,{variant:"default",children:"Operational"})]}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("span",{className:"text-sm font-medium",children:"Backup"}),e.jsx(F,{variant:"secondary",children:"Scheduled"})]})]})})]})]})]})}};return e.jsx(ce,{children:e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"flex flex-col md:flex-row md:items-center md:justify-between gap-4",children:[e.jsxs("div",{children:[e.jsx("h1",{className:"text-2xl md:text-3xl font-bold text-gray-900 dark:text-white",children:n==="dashboard"?"Admin Dashboard":n==="licenses"?"License Management":n==="users"?"User Management":n==="subscribers"?"Subscribers":n==="orders"?"Orders Management":n==="templates"?"Email Templates":n==="settings"?"SMTP Settings":"Admin Panel"}),e.jsx("p",{className:"text-gray-500 dark:text-gray-400",children:n==="dashboard"?"Overview of your system metrics and recent activity":n==="licenses"?"Manage license keys and subscriptions":n==="users"?"Manage user accounts and permissions":n==="subscribers"?"View and manage newsletter subscribers":n==="orders"?"Track customer orders and payments":n==="templates"?"Create and manage email templates":n==="settings"?"Configure SMTP and email settings":"Admin panel overview"})]}),e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsxs(g,{variant:"outline",size:"sm",children:[e.jsx(oe,{className:"h-4 w-4 mr-2"}),"Settings"]}),e.jsxs(g,{size:"sm",children:[e.jsx(de,{className:"h-4 w-4 mr-2"}),"Security"]})]})]}),e.jsx("div",{className:"md:hidden",children:e.jsx("div",{className:"flex space-x-2 overflow-x-auto pb-2",children:[{id:"dashboard",label:"Dashboard"},{id:"licenses",label:"Licenses"},{id:"users",label:"Users"},{id:"subscribers",label:"Subscribers"},{id:"orders",label:"Orders"},{id:"templates",label:"Templates"},{id:"settings",label:"Settings"}].map(h=>e.jsx(g,{variant:n===h.id?"default":"outline",size:"sm",onClick:()=>r(h.id),className:"whitespace-nowrap",children:h.label},h.id))})}),x()]})})};export{ys as default};
