(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,37727,e=>{"use strict";var t=e.i(41947);e.s(["X",()=>t.default])},88511,e=>{"use strict";let t=(0,e.i(75254).default)("square-pen",[["path",{d:"M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7",key:"1m0v6g"}],["path",{d:"M18.375 2.625a1 1 0 0 1 3 3l-9.013 9.014a2 2 0 0 1-.853.505l-2.873.84a.5.5 0 0 1-.62-.62l.84-2.873a2 2 0 0 1 .506-.852z",key:"ohrbg2"}]]);e.s(["Edit",()=>t],88511)},56909,e=>{"use strict";let t=(0,e.i(75254).default)("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"}]]);e.s(["Save",()=>t],56909)},14319,e=>{"use strict";var t=e.i(43476),a=e.i(71645),s=e.i(19455),r=e.i(46696),l=e.i(95187);let d=(0,l.createServerReference)("60919f7cd93396bfd97e7c2267e520b8af20889892",l.callServer,void 0,l.findSourceMapURL,"updateUserQuota");var i=e.i(88511),n=e.i(56909),c=e.i(37727),o=e.i(93479);function u({initialData:e}){let[l,u]=(0,a.useState)(e),[h,m]=(0,a.useState)(null),[x,p]=(0,a.useState)(0),[v,b]=(0,a.useState)(!1),g=()=>{m(null)},j=async e=>{b(!0);try{let t=await d(e,x);t.success?(r.toast.success(t.message),u(l.map(t=>t.id===e?{...t,shortlink_quota:x}:t)),m(null)):r.toast.error(t.message)}catch(e){r.toast.error("Gagal memperbarui kuota",{description:e.message})}finally{b(!1)}},f=l.filter(e=>"admin"!==e.username);return(0,t.jsx)("div",{className:"space-y-4",children:(0,t.jsx)("div",{className:"border border-border/50 rounded-xl overflow-hidden bg-background",children:(0,t.jsx)("div",{className:"overflow-x-auto",children:(0,t.jsxs)("table",{className:"w-full text-sm text-left",children:[(0,t.jsx)("thead",{className:"bg-muted/50 text-muted-foreground font-medium border-b border-border/50",children:(0,t.jsxs)("tr",{children:[(0,t.jsx)("th",{className:"px-4 py-3",children:"Nama Akun (Bidang)"}),(0,t.jsx)("th",{className:"px-4 py-3",children:"Username"}),(0,t.jsx)("th",{className:"px-4 py-3 text-center",children:"Kuota LASER"}),(0,t.jsx)("th",{className:"px-4 py-3 text-right",children:"Aksi"})]})}),(0,t.jsx)("tbody",{className:"divide-y divide-border/50",children:f.length>0?f.map(e=>(0,t.jsxs)("tr",{className:"hover:bg-muted/30 transition-colors",children:[(0,t.jsx)("td",{className:"px-4 py-3 font-medium text-foreground",children:e.name}),(0,t.jsxs)("td",{className:"px-4 py-3 text-muted-foreground font-mono text-xs",children:["@",e.username]}),(0,t.jsx)("td",{className:"px-4 py-3 text-center",children:h===e.id?(0,t.jsx)(o.Input,{type:"number",min:"0",value:x,onChange:e=>p(parseInt(e.target.value)||0),className:"w-20 text-center mx-auto h-8"}):(0,t.jsx)("span",{className:"font-bold text-lg",children:e.shortlink_quota??5})}),(0,t.jsx)("td",{className:"px-4 py-3 text-right",children:(0,t.jsx)("div",{className:"flex justify-end gap-1",children:h===e.id?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(s.Button,{variant:"ghost",size:"icon",className:"h-8 w-8 text-emerald-600 hover:text-emerald-700 hover:bg-emerald-50",onClick:()=>j(e.id),disabled:v,children:(0,t.jsx)(n.Save,{className:"h-4 w-4"})}),(0,t.jsx)(s.Button,{variant:"ghost",size:"icon",className:"h-8 w-8 text-neutral-500 hover:bg-neutral-100",onClick:g,disabled:v,children:(0,t.jsx)(c.X,{className:"h-4 w-4"})})]}):(0,t.jsx)(s.Button,{variant:"ghost",size:"icon",className:"h-8 w-8 text-blue-600 hover:text-blue-700 hover:bg-blue-50",onClick:()=>{m(e.id),p(e.shortlink_quota||0)},children:(0,t.jsx)(i.Edit,{className:"h-4 w-4"})})})})]},e.id)):(0,t.jsx)("tr",{children:(0,t.jsx)("td",{colSpan:4,className:"p-10 text-center text-muted-foreground",children:"Belum ada data akun bidang."})})})]})})})})}e.s(["default",()=>u],14319)}]);