1import{r as e,j as s,aI as t,X as a,ae as r,aR as l,aH as i,aS as n}from"./react-vendor-20261004_155452-CMD9Mu4L.js";import{ap as d}from"./vendor-20261004_155452-C99PGm5B.js";import{a8 as o}from"./app-services-20261004_155452-CqhrjBLd.js";import{u as c}from"./useSocketQuery-20261004_155452-DyRT4qvF.js";import{T as m,b as x,c as j,d as h,e as u,f}from"./table-20261004_155452-Vc2gl7aJ.js";import{z as p,E as g,B as N,ak as b,p as v,G as w,O as y,Q as S,R as F}from"./index-20261004_155452-i5YY-Rmq.js";import{f as P}from"./dateFormatJST-20261004_155452-BO36cawP.js";import{A as _}from"./AdminPagination-20261004_155452-DMfSgrVO.js";import"./date-utils-20261004_155452-BABpr51X.js";import"./socket-manager-20261004_155452-ZWL0JEUH.js";import"./socket-io-20261004_155452-CfF5R5HA.js";import"./auth-20261004_155452-HLcqn2jx.js";import"./tanstack-20261004_155452-DKr4WzMb.js";import"./firebase-20261004_155452-bkCdcoUk.js";import"./ui-components-20261004_155452-DP5C5l_T.js";function T({logs:e}){const t=e=>{const t=(e=>{switch(e){case"delivered":return{label:"éä¿¡åä»",variant:"default",className:"bg-green-600"};case"pending":return{label:"éä¿¡å¾
æ©",variant:"secondary"};case"failed":return{label:"é信失æ",variant:"destructive"};default:return{label:"䏿",variant:"outline"}}})(e);return s.jsx(p,{variant:t.variant,className:t.className,children:t.label})};return s.jsx("div",{className:"rounded-md border",children:s.jsxs(m,{children:[s.jsx(x,{children:s.jsxs(j,{children:[s.jsx(h,{children:"éä¿¡æ¥æ"}),s.jsx(h,{children:"ã¦ã¼ã¶ã¼æ°å"}),s.jsx(h,{children:"é»è©±çªå·"}),s.jsx(h,{children:"é
ä¿¡ã¹ãã¼ã¿ã¹"}),s.jsx(h,{children:"MessageID"}),s.jsx(h,{children:"失æçç±"})]})}),s.jsx(u,{children:0===e.length?s.jsx(j,{children:s.jsxs(f,{colSpan:6,className:"text-center text-muted-foreground py-6",children:[s.jsx("div",{children:"æªæ¤è¨¼ã® OTP è¨é²ã¯ããã¾ãã"}),s.jsx("div",{className:"text-xs mt-1",children:"æ¤è¨¼ã«ä½¿ããã OTP ã¯è¨è¨ä¸ãã®å ´ã§åé¤ããã¾ã (ä½¿ç¨æ¸ OTP ã®æ°¸ç¶è¨é²ãªã)"})]})}):e.map(e=>s.jsxs(j,{children:[s.jsx(f,{className:"font-mono text-sm whitespace-nowrap",children:P(e.createdAt,"datetime")}),s.jsx(f,{className:"whitespace-nowrap",children:e.userName||"-"}),s.jsx(f,{className:"font-mono whitespace-nowrap",children:e.phoneNumber}),s.jsx(f,{className:"whitespace-nowrap",children:t(e.deliveryStatus)}),s.jsx(f,{className:"font-mono text-xs max-w-xs truncate",children:e.snsMessageId||"-"}),s.jsx(f,{className:"min-w-[12rem] max-w-md",children:e.deliveryFailedReason?s.jsx("span",{className:"text-sm text-red-600",children:e.deliveryFailedReason}):"-"})]},e.id))})]})})}function k({filters:e,onFiltersChange:r,onReset:l}){return s.jsxs("div",{className:"flex flex-wrap gap-4 mb-6 p-4 bg-muted/50 rounded-lg",children:[s.jsxs("div",{className:"flex-1 min-w-[200px]",children:[s.jsx("label",{htmlFor:"sms-filter-phone",className:"text-sm font-medium mb-2 block",children:"é»è©±çªå·"}),s.jsxs("div",{className:"relative",children:[s.jsx(t,{className:"absolute left-3 top-1/2 transform -translate-y-1/2 h-4 w-4 text-muted-foreground"}),s.jsx(g,{id:"sms-filter-phone",type:"text",placeholder:"080-1234-5678",value:e.phoneNumber,onChange:s=>r({...e,phoneNumber:s.target.value}),className:"pl-9"})]})]}),s.jsxs("div",{className:"flex-1 min-w-[150px]",children:[s.jsx("label",{htmlFor:"sms-filter-date-from",className:"text-sm font-medium mb-2 block",children:"éå§æ¥"}),s.jsx(g,{id:"sms-filter-date-from",type:"date",value:e.dateFrom,onChange:s=>r({...e,dateFrom:s.target.value})})]}),s.jsxs("div",{className:"flex-1 min-w-[150px]",children:[s.jsx("label",{htmlFor:"sms-filter-date-to",className:"text-sm font-medium mb-2 block",children:"çµäºæ¥"}),s.jsx(g,{id:"sms-filter-date-to",type:"date",value:e.dateTo,onChange:s=>r({...e,dateTo:s.target.value})})]}),s.jsx("div",{className:"flex items-end",children:s.jsxs(N,{variant:"outline",onClick:l,children:[s.jsx(a,{className:"mr-2 h-4 w-4"}),"ãªã»ãã"]})})]})}function L(){const{logs:t,pagination:a,stats:m,isLoading:x,isLoadingStats:j,page:h,setPage:u,filters:f,setFilters:p}=function(){const[s,t]=e.useState(1),[a,r]=e.useState({phoneNumber:"",dateFrom:"",dateTo:""}),{data:l,isLoading:i,error:n,refetch:d}=c({queryKey:["sms-delivery-logs",s,a],queryFn:()=>o.getLogs({page:s,limit:50,...a}),socketEvents:"sms:log_added",subscribe:{event:"sms-logs:subscribe"},unsubscribe:{event:"sms-logs:unsubscribe"}}),{data:m,isLoading:x}=c({queryKey:["sms-delivery-stats"],queryFn:()=>o.getStats(),socketEvents:"sms:log_added"});return{logs:l?.logs||[],pagination:l?.pagination,stats:m,isLoading:i,isLoadingStats:x,error:n,page:s,setPage:t,filters:a,setFilters:r,refetch:d}}();return s.jsxs(s.Fragment,{children:[s.jsx(d,{children:s.jsx("title",{children:"SMS / OTP é
ä¿¡ã¹ãã¼ã¿ã¹ | 管ç"})}
1),s.jsx(b,{header:{title:"SMS / OTP é
ä¿¡ã¹ãã¼ã¿ã¹",subtitle:"SMS èªè¨¼ OTP ã®é
ä¿¡ç¶æ³ãæ¤è¨¼æåãã OTP ã¯è¨è¨ä¸å³æåé¤ããããããä¿çä¸ã»é
信失æã® OTP ã®ã¿è¡¨ç¤ºããã¾ãã"},useCard:!1,children:s.jsxs("div",{className:"space-y-6",children:[j||!m?s.jsx(v,{size:"sm"}):s.jsxs("div",{children:[s.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-4",children:[s.jsxs(w,{children:[s.jsxs(y,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[s.jsx(S,{className:"text-sm font-medium",children:"æ®åOTPè¨é²"}),s.jsx(r,{className:"h-4 w-4 text-muted-foreground"})]}),s.jsx(F,{children:s.jsx("div",{className:"text-2xl font-bold",children:m.total.toLocaleString()})})]}),s.jsxs(w,{children:[s.jsxs(y,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[s.jsx(S,{className:"text-sm font-medium",children:"éä¿¡æåã»æªæ¤è¨¼"}),s.jsx(l,{className:"h-4 w-4 text-green-600"})]}),s.jsx(F,{children:s.jsx("div",{className:"text-2xl font-bold text-green-600",children:m.delivered.toLocaleString()})})]}),s.jsxs(w,{children:[s.jsxs(y,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[s.jsx(S,{className:"text-sm font-medium",children:"é
ä¿¡å¾
æ©ã®è¨é²"}),s.jsx(i,{className:"h-4 w-4 text-yellow-600"})]}),s.jsx(F,{children:s.jsx("div",{className:"text-2xl font-bold text-yellow-600",children:m.pending.toLocaleString()})})]}),s.jsxs(w,{children:[s.jsxs(y,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[s.jsx(S,{className:"text-sm font-medium",children:"é信失æã®è¨é²"}),s.jsx(n,{className:"h-4 w-4 text-red-600"})]}),s.jsx(F,{children:s.jsx("div",{className:"text-2xl font-bold text-red-600",children:m.failed.toLocaleString()})})]})]}),s.jsx("p",{className:"text-xs text-muted-foreground mt-2",children:"â» æåçã¯è¡¨ç¤ºãã¾ãããæ¤è¨¼æåãã OTP ã¯è¨é²ãã¨åé¤ãããé信失æãå¤ãã¯è¨é²åã« ã¨ã©ã¼å¿çã¨ãªããããæ®åè¨é²ããç®åºããæåçã¯å®æ
ã表ããªãããã§ãã"})]}),s.jsx(k,{filters:f,onFiltersChange:p,onReset:()=>{p({phoneNumber:"",dateFrom:"",dateTo:""}),u(1)}}),x?s.jsx(v,{size:"sm"}):s.jsxs(s.Fragment,{children:[s.jsx(T,{logs:t}),a&&s.jsx(_,{total:a.total,currentPage:h,totalPages:a.totalPages,pageSize:a.limit,onPrevious:()=>u(h-1),onNext:()=>u(h+1)})]})]})})]})}export{L 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.