1import{j as e}from"./jsx-runtime-0DLF9kdB.js";import{G as b}from"./GlassCard-QGEypy6d.js";import{P as D}from"./PageTransition-d4Dnod-f.js";import{u as A,r as i}from"./index-DM-Ysix_.js";import"./i18n-context-DuXOzqEp.js";import{u as T}from"./hooks-ktRWiHiM.js";import{c as y}from"./cn-fNskMoFt.js";import{u as R,a as z,F as d}from"./components-C61DWoh4.js";import{A as h}from"./index-Dc83_iFP.js";import{m as n}from"./proxy-TcOPxGtH.js";import"./use-combine-values-xozz9E_C.js";function P(r){if(r.isActive)return"ACTIVE";switch(r.latestAuditAction){case"STORE_CREATED_PENDING":return"PENDING";case"STORE_REJECTED":return"REJECTED";case"STORE_DISABLED":return"DISABLED";default:return"INACTIVE"}}function K(){const{stores:r,members:N,agents:v}=R(),w=A();z(),T();const[k,o]=i.useState(!1),[c,u]=i.useState("all"),[p,x]=i.useState(null),[E,j]=i.useState(""),[g,m]=i.useState(null),[S,f]=i.useState(""),a=w.state==="submitting",l=i.useMemo(()=>{const t=r.map(s=>({...s,status:P(s)}));return{all:t,pending:t.filter(s=>s.status==="PENDING"),active:t.filter(s=>s.status==="ACTIVE"),inactive:t.filter(s=>s.status!=="PENDING"&&s.status!=="ACTIVE"),rejected:t.filter(s=>s.status==="REJECTED")}},[r]),C=c==="all"?l.all:c==="pending"?l.pending:c==="active"?l.active:l.inactive,I=t=>{switch(t){case"PENDING":return e.jsx("span",{className:"text-[10px] px-2 py-0.5 rounded-full bg-amber-500/20 text-amber-400 border border-amber-500/30",children:"å¾
åç¨"});case"ACTIVE":return e.jsx("span",{className:"text-[10px] px-2 py-0.5 rounded-full bg-green-500/20 text-green-400 border border-green-500/30",children:"å·²åç¨"});case"DISABLED":return e.jsx("span",{className:"text-[10px] px-2 py-0.5 rounded-full bg-zinc-500/20 text-zinc-300 border border-zinc-500/30",children:"å·²åç¨"});case"REJECTED":return e.jsx("span",{className:"text-[10px] px-2 py-0.5 rounded-full bg-red-500/20 text-red-400 border border-red-500/30",children:"å·²æçµ"});case"INACTIVE":return e.jsx("span",{className:"text-[10px] px-2 py-0.5 rounded-full bg-zinc-500/20 text-zinc-300 border border-zinc-500/30",children:"æªåç¨"})}};return e.jsxs(D,{children:[e.jsxs("div",{className:"mb-8 flex justify-between items-end",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"text-sm font-bold text-gray-500 uppercase tracking-widest",children:"B2B Management"}),e.jsx("h1",{className:"text-3xl font-black italic tracking-tighter text-white",children:"åºå®¶ç®¡ç"})]}),e.jsxs("button",{onClick:()=>o(!0),className:"bg-white text-black px-6 py-3 rounded-xl font-bold text-sm hover:bg-gray-200 transition-all shadow-lg shadow-white/5 flex items-center gap-2",children:[e.jsx("span",{children:"+"})," æ°å¢åºå®¶"]})]}),l.pending.length>0&&e.jsxs("div",{className:"mb-6 p-4 bg-amber-500/10 border border-amber-500/30 rounded-xl flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("span",{className:"text-2xl",children:"â³"}),e.jsxs("div",{children:[e.jsxs("p",{className:"text-amber-400 font-bold",children:["æ ",l.pending.length," éåºå®¶å¾
å¯©æ ¸"]}),e.jsx("p",{className:"text-xs text-amber-500/80",children:"æ°å»ºåºå®¶é è¨å¾
åç¨ï¼æ ¸å徿å¯ä½¿ç¨åºå®¶å¾å°"})]})]}),e.jsx("button",{onClick:()=>u("pending"),className:"px-4 py-2 bg-amber-500 text-black rounded-lg font-bold text-sm hover:bg-amber-400 transition-all",children:"ç«å³å¯©æ ¸"})]}),e.jsx("div",{className:"flex gap-2 mb-6",children:[{key:"all",label:"å
¨é¨",count:l.all.length},{key:"pending",label:"å¾
åç¨",count:l.pending.length},{key:"active",label:"å·²åç¨",count:l.active.length},{key:"inactive",label:"åç¨ / æçµ",count:l.inactive.length}].map(t=>e.jsxs("button",{onClick:()=>u(t.key),className:y("px-4 py-2 rounded-lg text-sm font-bold transition-all",c===t.key?"bg-white text-black":"bg-white/5 text-gray-400 hover:bg-white/10"),children:[t.label," (",t.count,")"]},t.key))}),e.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6",children:C.map(t=>e.jsxs(b,{className:y("p-6 group relative overflow-hidden",t.status==="PENDING"&&"border-amber-500/30"),intensity:"low",children:[e.jsx("div",{className:"absolute top-0 right-0 p-4 opacity-50 group-hover:opacity-100 transition-opacity",children:e.jsx("span",{className:"text-4xl",children:"ðª"})}),e.jsxs("div",{className:"relative z-10 space-y-4",children:[e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[I(t.status),e.jsx("span",{className:"text-xs font-mono text-gray-500",children:t.code})]}),e.jsx("h3",{className:"text-xl font-bold text-white",children:t.name})]}),e.jsxs("div",{className:"space-y-2 text-sm text-gray-400",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{children:"ð¤"}),e.jsx("span",{className:"text-white",children:t.owner.name})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{children:"ð"}),e.jsx("span",{className:"truncate",children:t.address})]}),t.recruiter&&e.jsxs("div",{className:"flex items-center gap-2 text-blue-400",children:[e.jsx("span",{children:"ð¤"}),e.jsxs("span",{children:["éç¼æ¥å: ",t.recruiter.name]})]})]}),e.jsxs("div",{className:"pt-4 border-t border-white/5",children:[e.jsx("div",{className:"flex justify-between items-center mb-3",children:e.jsxs("div",{className:"text-xs",children:[e.jsx("span",{className:"text-gray-500",children:"æ½å·¥è²»ç"}),e.jsxs("span",{className:"ml-2 font-mono text-white",children:[t.serviceFeeRate,"%"]})]})}),t.status==="PENDING"?e.jsxs("div",{className:"flex gap-2",children:[e.jsxs(d,{method:"post",className:"flex-1",children:[e.jsx("input",{type:"hidden",name:"intent",value:"approve-store"}),e.jsx("input",{type:"hidden",name:"storeId",value:t.id}),e.jsx("button",{disabled:a,className:"w-full py-2 rounded-lg bg-green-600 hover:bg-green-500 text-white text-xs font-bold transition-all disabled:opacity-50",children:"â åç¨"})]}),e.jsx("button",{onClick:()=>{x(t.id),j("")},disabled:a,className:"flex-1 py-2 rounded-lg bg-red-600/20 hover:bg-red-600/40 text-red-400 text-xs font-bold transition-all border border-red-500/30 disabled:opacity-50",children:"â æçµ"})]}):t.isActive?e.jsx("button",{onClick:()=>{m(t.id),f("")},disabled:a,className:"w-full py-2 text-[10px] font-bold rounded-lg border border-red-500/30 text-red-400 hover:bg-red-500/10 transition-colors disabled:opacity-50",children:"åç¨åºå®¶"}):e.jsxs(d,{method:"post",children:[e.jsx("input",{type:"hidden",name:"intent",value:"activate-store"}),e.jsx("input",{type:"hidden",name:"storeId",value:t.id}),e.jsx("button",{disabled:a,className:"w-full py-2 text-[10px] font-bold rounded-lg border border-green-500/30 text-green-400 hover:bg-green-500/10 transition-colors disabled:opacity-50",children:"éæ°åç¨"})]})]})]})]},t.id))}),e.jsx(h,{children:p&&e.jsxs("div",{className:"fixed inset-0 z-[100] flex items-center justify-center p-4",children:[e.jsx(n.div,{initial:{opacity:0}
1,animate:{opacity:1},exit:{opacity:0},onClick:()=>x(null),className:"absolute inset-0 bg-black/80 backdrop-blur-sm"}),e.jsx(n.div,{initial:{scale:.95,opacity:0,y:20},animate:{scale:1,opacity:1,y:0},exit:{scale:.95,opacity:0,y:20},className:"relative w-full max-w-md z-10",children:e.jsxs(b,{className:"p-8 border-red-500/30 shadow-2xl",intensity:"high",children:[e.jsxs("h2",{className:"text-xl font-bold mb-4 text-white flex items-center gap-2",children:[e.jsx("span",{className:"text-red-400",children:"â ï¸"})," æçµåºå®¶ç³è«"]}),e.jsxs(d,{method:"post",onSubmit:()=>x(null),children:[e.jsx("input",{type:"hidden",name:"intent",value:"reject-store"}),e.jsx("input",{type:"hidden",name:"storeId",value:p}),e.jsxs("div",{className:"mb-4",children:[e.jsx("label",{className:"block text-xs font-bold text-gray-500 mb-2",children:"æçµåå "}),e.jsx("textarea",{name:"reason",required:!0,value:E,onChange:t=>j(t.target.value),placeholder:"è«å¡«å¯«æçµåå ï¼æéç¥çµ¦åºå®¶ï¼",className:"w-full bg-white/5 border border-white/10 rounded-xl px-4 py-3 text-white text-sm focus:border-red-500/50 outline-none resize-none h-24"})]}),e.jsxs("div",{className:"flex gap-3",children:[e.jsx("button",{type:"button",onClick:()=>x(null),className:"flex-1 py-3 rounded-xl border border-white/10 text-sm font-bold hover:bg-white/5",children:"åæ¶"}),e.jsx("button",{type:"submit",disabled:a,className:"flex-1 py-3 rounded-xl bg-red-600 hover:bg-red-500 text-white text-sm font-bold",children:"ç¢ºèªæçµ"})]})]})]})})]})}),e.jsx(h,{children:g&&e.jsxs("div",{className:"fixed inset-0 z-[100] flex items-center justify-center p-4",children:[e.jsx(n.div,{initial:{opacity:0}
1,animate:{opacity:1},exit:{opacity:0},onClick:()=>m(null),className:"absolute inset-0 bg-black/80 backdrop-blur-sm"}),e.jsx(n.div,{initial:{scale:.95,opacity:0,y:20},animate:{scale:1,opacity:1,y:0},exit:{scale:.95,opacity:0,y:20},className:"relative w-full max-w-md z-10",children:e.jsxs(b,{className:"p-8 border-red-500/30 shadow-2xl",intensity:"high",children:[e.jsxs("h2",{className:"text-xl font-bold mb-4 text-white flex items-center gap-2",children:[e.jsx("span",{className:"text-red-400",children:"â ï¸"})," åç¨åºå®¶"]}),e.jsxs(d,{method:"post",onSubmit:()=>m(null),children:[e.jsx("input",{type:"hidden",name:"intent",value:"deactivate-store"}),e.jsx("input",{type:"hidden",name:"storeId",value:g}),e.jsxs("div",{className:"mb-4",children:[e.jsx("label",{className:"block text-xs font-bold text-gray-500 mb-2",children:"åç¨åå "}),e.jsx("textarea",{name:"reason",required:!0,value:S,onChange:t=>f(t.target.value),placeholder:"è«å¡«å¯«åç¨åå ï¼æéç¥çµ¦åºå®¶ï¼",className:"w-full bg-white/5 border border-white/10 rounded-xl px-4 py-3 text-white text-sm focus:border-red-500/50 outline-none resize-none h-24"})]}),e.jsxs("div",{className:"flex gap-3",children:[e.jsx("button",{type:"button",onClick:()=>m(null),className:"flex-1 py-3 rounded-xl border border-white/10 text-sm font-bold hover:bg-white/5",children:"åæ¶"}),e.jsx("button",{type:"submit",disabled:a,className:"flex-1 py-3 rounded-xl bg-red-600 hover:bg-red-500 text-white text-sm font-bold",children:"確èªåç¨"})]})]})]})})]})}),e.jsx(h,{children:k&&e.jsxs("div",{className:"fixed inset-0 z-[100] flex items-center justify-center p-4",children:[e.jsx(n.div,{initial:{opacity:0}
1,animate:{opacity:1},exit:{opacity:0},onClick:()=>o(!1),className:"absolute inset-0 bg-black/80 backdrop-blur-sm"}),e.jsx(n.div,{initial:{scale:.95,opacity:0,y:20},animate:{scale:1,opacity:1,y:0},exit:{scale:.95,opacity:0,y:20},className:"relative w-full max-w-lg z-10",children:e.jsxs(b,{className:"p-8 border-white/20 shadow-2xl",intensity:"high",children:[e.jsx("h2",{className:"text-xl font-bold mb-6 text-white",children:"æ°å¢å çåºå®¶"}),e.jsxs(d,{method:"post",className:"space-y-4",onSubmit:()=>o(!1),children:[e.jsx("input",{type:"hidden",name:"intent",value:"create-store"}),e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{children:[e.jsx("label",{className:"block text-xs font-bold text-gray-500 mb-1",children:"åºå®¶å稱"}),e.jsx("input",{name:"name",required:!0,className:"w-full bg-white/5 border border-white/10 rounded-xl px-4 py-2 text-sm text-white focus:border-white/30 outline-none",placeholder:"å°åæè¦åº"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-xs font-bold text-gray-500 mb-1",children:"åºå®¶ä»£ç¢¼"}),e.jsx("input",{name:"code",required:!0,className:"w-full bg-white/5 border border-white/10 rounded-xl px-4 py-2 text-sm text-white focus:border-white/30 outline-none",placeholder:"TPE001"})]})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-xs font-bold text-gray-500 mb-1",children:"åºå®¶è² 責人 (ç¶å®æå¡)"}),e.jsxs("select",{name:"ownerMemberId",required:!0,className:"w-full bg-white/5 border border-white/10 rounded-xl px-4 py-2 text-sm text-white focus:border-white/30 outline-none [&>option]:text-black",children:[e.jsx("option",{value:"",children:"鏿æå¡..."}),N.map(t=>e.jsxs("option",{value:t.id,children:[t.name," (",t.phone,")"]},t.id))]}),e.jsx("p",{className:"text-[10px] text-gray-500 mt-1",children:"* 建ç«å¾çºå¾
åç¨ï¼ç¸½é¨æ ¸å徿å¯ä½¿ç¨åºå®¶å¾å°"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-xs font-bold text-gray-500 mb-1",children:"éç¼æ¥å (B2Bæ¸å )"}),e.jsxs("select",{name:"recruitedById",className:"w-full bg-white/5 border border-white/10 rounded-xl px-4 py-2 text-sm text-white focus:border-white/30 outline-none [&>option]:text-black",children:[e.jsx("option",{value:"",children:"ç¡ (å
¬å¸ç´ç)"}),v.map(t=>e.jsxs("option",{value:t.id,children:[t.name," (",t.code,")"]},t.id))]})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{children:[e.jsx("label",{className:"block text-xs font-bold text-gray-500 mb-1",children:"è¯çµ¡é»è©±"}),e.jsx("input",{name:"phone",required:!0,className:"w-full bg-white/5 border border-white/10 rounded-xl px-4 py-2 text-sm text-white focus:border-white/30 outline-none"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-xs font-bold text-gray-500 mb-1",children:"æ½å·¥è²»ç (%)"}),e.jsx("input",{type:"number",name:"serviceFeeRate",defaultValue:"10",className:"w-full bg-white/5 border border-white/10 rounded-xl px-4 py-2 text-sm text-white focus:border-white/30 outline-none"})]})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-xs font-bold text-gray-500 mb-1",children:"å°å"}),e.jsx("input",{name:"address",required:!0,className:"w-full bg-white/5 border border-white/10 rounded-xl px-4 py-2 text-sm text-white focus:border-white/30 outline-none",placeholder:"å°åå¸..."})]}),e.jsxs("div",{className:"pt-4 flex gap-3",children:[e.jsx("button",{type:"button",onClick:()=>o(!1),className:"flex-1 py-3 rounded-xl border border-white/10 text-sm font-bold hover:bg-white/5",children:"åæ¶"}),e.jsx("button",{type:"submit",disabled:a,className:"flex-1 py-3 rounded-xl bg-white text-black text-sm font-bold hover:bg-gray-200",children:a?"èçä¸...":"確èªå»ºç«"})]})]})]})})]})})]})}export{K 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.