@l10nmonster/server 3.0.0-alpha.11 → 3.0.0-alpha.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CLAUDE.md +81 -13
- package/index.js +19 -2
- package/package.json +1 -1
- package/routes/dispatcher.js +17 -7
- package/routes/info.js +17 -16
- package/routes/providers.js +7 -9
- package/routes/sources.js +47 -9
- package/routes/status.js +12 -11
- package/routes/tm.js +89 -26
- package/ui/dist/assets/Cart-B_Zkvuz_.js +1 -0
- package/ui/dist/assets/Job-B2D10u5q.js +1 -0
- package/ui/dist/assets/Providers-UAlXnJQI.js +1 -0
- package/ui/dist/assets/Sources-DcwZBkaA.js +1 -0
- package/ui/dist/assets/SourcesDetail-11v96V44.js +1 -0
- package/ui/dist/assets/SourcesResource-CPGv3HQ8.js +1 -0
- package/ui/dist/assets/Status-C_qyyf2l.js +1 -0
- package/ui/dist/assets/StatusDetail-CXE95RTb.js +1 -0
- package/ui/dist/assets/TM-DIDYSCIe.js +1 -0
- package/ui/dist/assets/TMDetail-BmHvlsJe.js +1 -0
- package/ui/dist/assets/Welcome-Bd1y86xQ.js +1 -0
- package/ui/dist/assets/index-Dl1WS_Lc.js +1 -0
- package/ui/dist/assets/index-HzbF4bPY.js +2 -0
- package/ui/dist/assets/vendor-BVSmEsOp.js +75 -0
- package/ui/dist/index.html +3 -1
- package/ui/dist/assets/Cart-jHOAGjwC.js +0 -1
- package/ui/dist/assets/Job-vnJpBXcp.js +0 -1
- package/ui/dist/assets/Providers-DUp_y6mi.js +0 -1
- package/ui/dist/assets/Sources-CC5dBiir.js +0 -1
- package/ui/dist/assets/Status-SRPm28Cg.js +0 -1
- package/ui/dist/assets/StatusDetail-DqXzi16U.js +0 -1
- package/ui/dist/assets/TM-CUqywRKC.js +0 -1
- package/ui/dist/assets/TMDetail-Bl4xHL_X.js +0 -1
- package/ui/dist/assets/Welcome-D33rOKBc.js +0 -1
- package/ui/dist/assets/api-CQ_emPlI.js +0 -1
- package/ui/dist/assets/badge-D0XxOmqE.js +0 -1
- package/ui/dist/assets/grid-c9ySqPWI.js +0 -1
- package/ui/dist/assets/index-BHll-Wur.js +0 -1
- package/ui/dist/assets/index-CE6JgXwC.js +0 -76
- package/ui/dist/assets/input-C_b-hL0i.js +0 -1
- package/ui/dist/assets/link-BJrTt4Ej.js +0 -1
- package/ui/dist/assets/namespace-DqVzlNZ0.js +0 -1
- package/ui/dist/assets/select-B7OxVhQ5.js +0 -1
- package/ui/dist/assets/tooltip-DsbPmc5I.js +0 -1
- package/ui/dist/assets/use-field-context-DPgnX2eS.js +0 -1
- package/ui/dist/assets/use-presence-context-w7qGDwCc.js +0 -1
- package/ui/dist/assets/useQuery-DJATtsyt.js +0 -1
- package/ui/dist/assets/v-stack-BLV93Nj6.js +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a8 as K,u as V,a0 as _,r as x,i as R,j as e,B as t,A as B,T as o,S as Q,F as p,g as f,ae as X,af as Z,ag as I,ah as F,l as J,m as Y,n as ee,o as re,p as te,q as oe,s as se,t as le,v as ne,a9 as A,aa as W,ab as D}from"./vendor-BVSmEsOp.js";import{a as ie,r as P,b as ae,f as O}from"./index-Dl1WS_Lc.js";function de(m){return m.map((u,j)=>{if(typeof u=="string")return u;if(u.v){const g=u.t==="x"?"purple.600":"orange.600";return e.jsx(o,{as:"span",fontFamily:"mono",color:g,fontWeight:"bold",children:u.v},j)}else return`{{${u.t}}}`})}const xe=()=>{const{channelId:m}=K(),u=V(),[j]=_(),g=j.get("rid"),S=j.get("guid"),[k,M]=x.useState("segments"),w=x.useRef(null),[c,y]=x.useState(new Set),[b,L]=x.useState(""),{data:l,isLoading:G,error:v}=R({queryKey:["resource",m,g],queryFn:()=>O(`/api/resource/${m}?rid=${encodeURIComponent(g)}`),enabled:!!g}),{data:ce={}}=R({queryKey:["info"],queryFn:()=>O("/api/info")}),{defaultGroup:z,defaultFormat:C,segments:d}=x.useMemo(()=>{if(!l?.segments)return{defaultGroup:null,defaultFormat:null,segments:[]};const r={},i={};l.segments.forEach(a=>{const h=a.group||"(no group)",T=a.mf||"text";r[h]=(r[h]||0)+1,i[T]=(i[T]||0)+1});const s=Object.keys(r).reduce((a,h)=>r[a]>r[h]?a:h,Object.keys(r)[0]),n=Object.keys(i).reduce((a,h)=>i[a]>i[h]?a:h,Object.keys(i)[0]);return{defaultGroup:s,defaultFormat:n,segments:l.segments}},[l?.segments]),N=(r,i)=>{const s=new Set(c);i?s.add(r):s.delete(r),y(s)},E=r=>{if(r){const i=new Set(d.map((s,n)=>n));y(i)}else y(new Set)},U=()=>{if(!b){alert("Please select a target language first");return}const i=Array.from(c).map(s=>d[s]).map(s=>({guid:s.guid,rid:l.id,sid:s.sid,nsrc:s.nstr,notes:s.notes}));ae(l.sourceLang,b,m,i),y(new Set),L("")},q=d.length>0&&c.size===d.length,$=c.size>0&&c.size<d.length,H=x.useMemo(()=>l?.targetLangs?l.targetLangs.filter(r=>r!==l.sourceLang):[],[l?.targetLangs,l?.sourceLang]);return x.useEffect(()=>{S&&d.length>0&&w.current&&setTimeout(()=>{w.current&&w.current.scrollIntoView({behavior:"smooth",block:"center",inline:"nearest"})},100)},[S,d,k]),g?G?e.jsx(t,{display:"flex",justifyContent:"center",mt:10,children:e.jsx(Q,{size:"xl"})}):v?e.jsx(t,{mt:5,px:6,children:e.jsx(B,{status:"error",children:e.jsxs(t,{children:[e.jsx(o,{fontWeight:"bold",children:"Error"}),e.jsx(o,{children:v?.message||"Failed to fetch resource data"})]})})}):e.jsxs(t,{py:6,px:6,h:"100vh",display:"flex",flexDirection:"column",children:[e.jsx(ie,{channelId:l.channel,project:l.prj,resource:l.id,onBackClick:()=>u(`/sources/${m}/${l.prj}`),backLabel:"Back to project",extraContent:e.jsxs(p,{gap:4,align:"center",wrap:"wrap",children:[e.jsxs(t,{children:[e.jsx(o,{fontSize:"sm",color:"fg.muted",mb:1,children:"Source Language"}),e.jsx(f,{colorPalette:"blue",size:"sm",children:l.sourceLang})]}),e.jsxs(t,{children:[e.jsx(o,{fontSize:"sm",color:"fg.muted",mb:1,children:"Resource Format"}),e.jsx(f,{colorPalette:"purple",size:"sm",children:l.resourceFormat})]}),z&&e.jsxs(t,{children:[e.jsx(o,{fontSize:"sm",color:"fg.muted",mb:1,children:"Default Group"}),e.jsx(f,{colorPalette:"gray",size:"sm",children:z})]}),C&&e.jsxs(t,{children:[e.jsx(o,{fontSize:"sm",color:"fg.muted",mb:1,children:"Default Format"}),e.jsx(f,{colorPalette:"cyan",size:"sm",children:C})]}),e.jsxs(t,{children:[e.jsxs(o,{fontSize:"sm",color:"fg.muted",mb:1,children:["Target Languages (",l.targetLangs.length,")"]}),e.jsx(p,{wrap:"wrap",gap:1,children:l.targetLangs.map(r=>e.jsx(f,{colorPalette:"orange",size:"sm",children:r},r))})]}),l.modified&&e.jsxs(t,{children:[e.jsx(o,{fontSize:"sm",color:"fg.muted",mb:1,children:"Last Modified"}),e.jsx(o,{fontSize:"sm",color:"fg.default",title:new Date(l.modified).toLocaleString("en-US",{weekday:"long",year:"numeric",month:"long",day:"numeric",hour:"2-digit",minute:"2-digit",second:"2-digit",timeZoneName:"short"}),children:(()=>{const r=new Date,i=new Date(l.modified),s=Math.floor((r-i)/1e3),n=new Intl.RelativeTimeFormat("en",{numeric:"auto",style:"short"});return s<60?n.format(-s,"second"):s<3600?n.format(-Math.floor(s/60),"minute"):s<86400?n.format(-Math.floor(s/3600),"hour"):s<2592e3?n.format(-Math.floor(s/86400),"day"):s<31536e3?n.format(-Math.floor(s/2592e3),"month"):n.format(-Math.floor(s/31536e3),"year")})()})]})]})}),e.jsx(t,{flex:"1",display:"flex",flexDirection:"column",children:e.jsxs(X,{value:k,onValueChange:r=>M(r.value),children:[e.jsxs(Z,{mb:4,children:[e.jsxs(I,{value:"segments",children:["Segments (",d.length,")"]}),e.jsx(I,{value:"raw",children:"Raw Content"})]}),e.jsxs(F,{value:"segments",flex:"1",display:"flex",flexDirection:"column",children:[c.size>0&&e.jsx(t,{bg:"blue.subtle",borderBottom:"1px",borderColor:"blue.muted",shadow:"md",borderLeft:"4px",borderLeftColor:"blue.500",px:6,py:4,mb:4,borderRadius:"md",children:e.jsxs(p,{align:"center",justify:"space-between",children:[e.jsxs(o,{fontSize:"md",fontWeight:"semibold",color:"blue.700",children:[c.size," ",c.size===1?"segment":"segments"," selected"]}),e.jsxs(p,{align:"center",gap:3,children:[e.jsx(o,{fontSize:"sm",color:"blue.600",children:"Target Language:"}),e.jsxs(J,{size:"sm",width:"200px",value:b?[b]:[],positioning:{strategy:"absolute",placement:"bottom-start",flip:!0,gutter:4},children:[e.jsxs(Y,{children:[e.jsx(o,{fontSize:"sm",flex:"1",textAlign:"left",children:b||"Select target language"}),e.jsx(ee,{})]}),e.jsx(re,{children:e.jsx(te,{zIndex:1e3,bg:"white",borderWidth:"1px",borderColor:"border.default",borderRadius:"md",shadow:"lg",maxH:"200px",overflow:"auto",children:H.map(r=>e.jsxs(oe,{item:r,value:r,onClick:()=>L(r),children:[e.jsx(se,{children:r}),e.jsx(le,{})]},r))})})]}),e.jsx(ne,{colorPalette:"blue",onClick:U,disabled:!b,size:"sm",children:"Add to Cart"})]})]})}),e.jsxs(t,{flex:"1",bg:"white",borderRadius:"lg",shadow:"sm",overflow:"auto",children:[e.jsxs(t,{as:"table",w:"100%",fontSize:"sm",tableLayout:"fixed",children:[e.jsx(t,{as:"thead",position:"sticky",top:0,bg:"blue.subtle",zIndex:1,borderBottom:"2px",borderColor:"blue.muted",shadow:"sm",children:e.jsxs(t,{as:"tr",children:[e.jsx(t,{as:"th",p:3,borderBottom:"1px",borderColor:"border.default",minW:"60px",textAlign:"center",children:e.jsxs(A,{checked:q,onCheckedChange:r=>E(r.checked),children:[e.jsx(W,{ref:r=>{r&&(r.indeterminate=$)}}),e.jsx(D,{})]})}),e.jsx(t,{as:"th",p:3,textAlign:"left",borderBottom:"1px",borderColor:"border.default",w:"12%",children:e.jsx(o,{fontSize:"sm",fontWeight:"bold",color:"blue.600",children:"GUID"})}),e.jsx(t,{as:"th",p:3,textAlign:"left",borderBottom:"1px",borderColor:"border.default",w:"8%",children:e.jsx(o,{fontSize:"sm",fontWeight:"bold",color:"blue.600",children:"NID"})}),e.jsx(t,{as:"th",p:3,textAlign:"left",borderBottom:"1px",borderColor:"border.default",w:"20%",children:e.jsx(o,{fontSize:"sm",fontWeight:"bold",color:"blue.600",children:"STRING ID"})}),e.jsx(t,{as:"th",p:3,textAlign:"left",borderBottom:"1px",borderColor:"border.default",w:"35%",children:e.jsx(o,{fontSize:"sm",fontWeight:"bold",color:"blue.600",children:"SOURCE TEXT"})}),e.jsx(t,{as:"th",p:3,textAlign:"left",borderBottom:"1px",borderColor:"border.default",w:"20%",children:e.jsx(o,{fontSize:"sm",fontWeight:"bold",color:"blue.600",children:"NOTES"})})]})}),e.jsx(t,{as:"tbody",children:d.map((r,i)=>{const s=S&&r.guid===S;return e.jsxs(t,{as:"tr",ref:s?w:null,bg:s?"yellow.subtle":"transparent",_hover:{bg:s?"yellow.muted":"gray.subtle"},borderLeft:s?"4px":"0",borderLeftColor:s?"yellow.solid":"transparent",children:[e.jsx(t,{as:"td",p:3,borderBottom:"1px",borderColor:"border.subtle",textAlign:"center",children:e.jsxs(A,{checked:c.has(i),onCheckedChange:n=>N(i,n.checked),children:[e.jsx(W,{}),e.jsx(D,{})]})}),e.jsx(t,{as:"td",p:3,borderBottom:"1px",borderColor:"border.subtle",children:e.jsx(o,{fontSize:"xs",fontFamily:"mono",color:"orange.600",userSelect:"all",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",maxW:"100px",title:r.guid,children:r.guid})}),e.jsx(t,{as:"td",p:3,borderBottom:"1px",borderColor:"border.subtle",children:e.jsx(o,{fontSize:"xs",fontFamily:"mono",color:"orange.600",userSelect:"all",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",maxW:"100px",title:r.nid||"",children:r.nid||""})}),e.jsx(t,{as:"td",p:3,borderBottom:"1px",borderColor:"border.subtle",children:e.jsx(o,{fontSize:"xs",fontFamily:"mono",color:"purple.600",wordBreak:"break-all",children:r.sid})}),e.jsxs(t,{as:"td",p:3,borderBottom:"1px",borderColor:"border.subtle",children:[e.jsx(o,{fontSize:"xs",noOfLines:3,children:de(r.nstr)}),(()=>{const n=r.group||"(no group)";return n!==z?e.jsxs(o,{fontSize:"xs",color:"gray.600",fontStyle:"italic",mt:1,children:["Group:",e.jsx(f,{colorPalette:"gray",size:"sm",ml:1,children:n})]}):null})(),(()=>{const n=r.mf||"text";return n!==C?e.jsxs(o,{fontSize:"xs",color:"gray.600",fontStyle:"italic",mt:1,children:["Format:",e.jsx(f,{colorPalette:"cyan",size:"sm",ml:1,children:n})]}):null})()]}),e.jsxs(t,{as:"td",p:3,borderBottom:"1px",borderColor:"border.subtle",children:[r.notes?.desc&&e.jsx(o,{fontSize:"xs",color:"gray.600",fontStyle:"italic",children:P(r.notes.desc)}),r.notes?.ph&&Object.keys(r.notes.ph).length>0&&e.jsxs(t,{mt:r.notes?.desc?2:0,children:[e.jsx(o,{fontSize:"xs",color:"gray.600",fontWeight:"semibold",mb:1,children:"Placeholders:"}),Object.entries(r.notes.ph).map(([n,a])=>e.jsxs(o,{fontSize:"xs",color:"gray.600",mb:1,children:[e.jsx(o,{as:"span",fontFamily:"mono",color:"purple.600",fontWeight:"bold",children:n}),": ",P(a.desc),a.sample&&e.jsxs(o,{as:"span",color:"gray.500",children:[" ",'(e.g., "',a.sample,'")']})]},n))]})]})]},r.guid)})})]}),d.length===0&&e.jsx(p,{justify:"center",p:8,children:e.jsx(o,{color:"fg.muted",children:"No segments found in this resource"})})]})]}),e.jsx(F,{value:"raw",flex:"1",display:"flex",flexDirection:"column",children:e.jsx(t,{flex:"1",bg:"white",borderRadius:"lg",shadow:"sm",overflow:"auto",p:4,children:e.jsx(t,{as:"pre",fontSize:"xs",fontFamily:"mono",bg:"gray.50",p:4,borderRadius:"md",overflow:"auto",whiteSpace:"pre-wrap",wordBreak:"break-word",border:"1px",borderColor:"border.default",children:l.raw||"No raw content available"})})})]})})]}):e.jsx(t,{mt:5,px:6,children:e.jsx(B,{status:"error",children:e.jsxs(t,{children:[e.jsx(o,{fontWeight:"bold",children:"Missing Resource ID"}),e.jsx(o,{children:"No resource ID specified in the URL."})]})})})};export{xe as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{u as z,a0 as R,r as c,i as k,j as e,B as n,S as P,A as $,T as s,F as L,a1 as q,a2 as T,a3 as B,a4 as F,a5 as I,I as M,a6 as A,a7 as H,L as G,h as K,G as N}from"./vendor-BVSmEsOp.js";import{P as U,f as v}from"./index-Dl1WS_Lc.js";const D=({channelId:o,hideComplete:h,calculateCompletionPercentage:u,hasIncompleteContent:m})=>{const[g,b]=c.useState(!1),[d,y]=c.useState(!0),f=c.useRef(null);c.useEffect(()=>{const r=new IntersectionObserver(i=>{i.forEach(l=>{l.isIntersecting&&(b(!0),r.disconnect())})},{rootMargin:"200px",threshold:0});return f.current&&r.observe(f.current),()=>r.disconnect()},[]);const{data:a,isLoading:C,error:S}=k({queryKey:["status",o],queryFn:()=>v(`/api/status/${o}`),enabled:g}),t=c.useMemo(()=>{if(!a||!h)return a;const r={};return Object.entries(a).forEach(([i,l])=>{const j={};Object.entries(l).forEach(([O,p])=>{const w={};Object.entries(p).forEach(([W,E])=>{m(E.pairSummaryByStatus)&&(w[W]=E)}),Object.keys(w).length>0&&(j[O]=w)}),Object.keys(j).length>0&&(r[i]=j)}),Object.keys(r).length>0?r:null},[a,h,m]),x=c.useMemo(()=>t?Object.values(t).reduce((r,i)=>r+Object.keys(i).length,0):0,[t]);return h&&!t&&a!==void 0?null:e.jsxs(n,{ref:f,mb:8,p:6,borderWidth:"2px",borderRadius:"lg",bg:"white",borderColor:"green.200",children:[e.jsxs(n,{display:"flex",alignItems:"center",gap:3,flexWrap:"wrap",mb:6,pb:4,borderBottom:"2px",borderColor:"green.100",children:[e.jsx(M,{"aria-label":d?"Collapse channel":"Expand channel",onClick:()=>y(!d),variant:"ghost",size:"sm",children:d?"▼":"▶"}),e.jsxs(n,{children:[e.jsx(s,{fontSize:"sm",color:"fg.muted",mb:1,children:"Channel"}),e.jsx(s,{fontSize:"lg",fontWeight:"bold",color:"green.600",children:o})]}),C&&e.jsx(P,{size:"md"})]}),e.jsx(A,{open:d,children:e.jsx(H,{children:S?e.jsx($,{status:"error",children:e.jsxs(n,{children:[e.jsxs(s,{fontWeight:"bold",children:["Error loading channel ",o]}),e.jsx(s,{children:S.message||"Unknown error"})]})}):C?e.jsx(n,{display:"flex",justifyContent:"center",py:8,children:e.jsx(s,{color:"fg.muted",children:"Loading channel data..."})}):t&&Object.keys(t).length>0?Object.entries(t).map(([r,i])=>Object.entries(i).map(([l,j])=>e.jsxs(n,{mb:6,p:4,borderWidth:"1px",borderRadius:"md",bg:"gray.50",borderColor:"border.default",children:[e.jsx(n,{display:"flex",alignItems:"center",gap:3,flexWrap:"wrap",mb:4,children:e.jsxs(G,{as:K,to:`/status/${o}/${r}/${l}`,fontSize:"lg",fontWeight:"semibold",color:"blue.600",_hover:{textDecoration:"underline"},children:[r," → ",l]})}),e.jsx(N,{templateColumns:"repeat(auto-fit, minmax(300px, 1fr))",gap:4,children:Object.entries(j).map(([O,p])=>e.jsx(U,{project:{translationStatus:p.details||[],pairSummary:p.pairSummary,pairSummaryByStatus:p.pairSummaryByStatus,projectName:O}},`${o}-${r}-${l}-${O}`))})]},`${r}-${l}`))):a&&Object.keys(a).length===0?e.jsx(n,{display:"flex",justifyContent:"center",py:8,children:e.jsx(s,{color:"fg.muted",children:"This channel has no projects"})}):g?e.jsx(n,{display:"flex",justifyContent:"center",py:8,children:e.jsx(s,{color:"fg.muted",children:"No content available for this channel"})}):e.jsx(n,{display:"flex",justifyContent:"center",py:8,children:e.jsx(s,{color:"fg.muted",children:"Scroll down to load content..."})})})}),!d&&t&&e.jsx(n,{display:"flex",justifyContent:"center",py:4,children:e.jsxs(s,{fontSize:"sm",color:"gray.600",fontStyle:"italic",children:[x," language pair",x!==1?"s":""," (collapsed)"]})})]})},J=()=>{z();const[o,h]=R(),[u,m]=c.useState(()=>o.get("hideComplete")==="true"),{data:g,isLoading:b,error:d}=k({queryKey:["info"],queryFn:()=>v("/api/info")}),y=g?.channels?.map(t=>t.id)||[],f=b,a=d;c.useEffect(()=>{const t=new URLSearchParams(o);u?t.set("hideComplete","true"):t.delete("hideComplete"),h(t,{replace:!0})},[u,o,h]);const C=t=>{const x=Object.values(t).reduce((r,i)=>r+i,0);return x===0?100:Math.round((t.translated||0)/x*100)},S=t=>(t.untranslated||0)>0||(t["in flight"]||0)>0||(t["low quality"]||0)>0;return b?e.jsx(n,{display:"flex",justifyContent:"center",mt:5,children:e.jsx(P,{size:"xl"})}):a?e.jsx(n,{mt:5,px:6,children:e.jsx($,{status:"error",children:e.jsxs(n,{children:[e.jsx(s,{fontWeight:"bold",children:"Error"}),e.jsx(s,{children:a})]})})}):e.jsxs(n,{py:6,px:6,children:[e.jsx(L,{align:"center",gap:3,mb:6,children:e.jsxs(q,{checked:u,onCheckedChange:t=>m(t.checked),children:[e.jsx(T,{}),e.jsx(B,{children:e.jsx(F,{})}),e.jsx(I,{children:e.jsx(s,{fontSize:"md",fontWeight:"medium",children:"Hide complete"})})]})}),y.map(t=>e.jsx(D,{channelId:t,hideComplete:u,calculateCompletionPercentage:C,hasIncompleteContent:S},t)),y.length===0&&!f&&e.jsx(s,{mt:4,color:"fg.muted",children:"No channels found."})]})};export{J as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a8 as G,u as J,r as a,i as _,j as e,B as t,S as v,A as q,T as o,F,v as H,a9 as k,aa as A,ab as R,V as f,ac as b,L as K,h as M,b as Q,c as X,d as Y,e as Z,f as ee}from"./vendor-BVSmEsOp.js";import{f as re}from"./index-Dl1WS_Lc.js";function B(j){return j.map(l=>typeof l=="string"?l:`{{${l.t}}}`).join("")}const ne=()=>{const{channelId:j,sourceLang:l,targetLang:m}=G();J();const[d,S]=a.useState(new Set),[W,I]=a.useState({guid:"",channel:"",prj:"",rid:"",sid:"",nsrc:"",group:""}),[u,T]=a.useState({guid:"",channel:"",prj:"",rid:"",sid:"",nsrc:"",group:""}),w=a.useRef(),C=a.useRef(null),c=a.useRef({}),{data:z=[],isLoading:y,isError:L,error:D}=_({queryKey:["statusDetail",j,l,m],queryFn:()=>re(`/api/status/${j}/${l}/${m}`)}),h=a.useMemo(()=>z.length?z.filter(r=>Object.entries(W).every(([s,n])=>{if(!n.trim())return!0;const i=r[s];return i==null?!1:s==="nsrc"&&Array.isArray(i)?B(i).toLowerCase().includes(n.toLowerCase()):String(i).toLowerCase().includes(n.toLowerCase())})):[],[z,W]),x=a.useCallback(r=>{C.current=r},[]),p=a.useCallback(()=>{C.current=null},[]),g=a.useCallback((r,s)=>{T(n=>({...n,[r]:s})),S(new Set),clearTimeout(w.current),w.current=setTimeout(()=>{I(n=>({...n,[r]:s}))},300)},[]),O=(r,s)=>{const n=new Set(d);s?n.add(r):n.delete(r),S(n)},$=r=>{if(r){const s=new Set(h.map((n,i)=>i));S(s)}else S(new Set)},E=()=>{const r=sessionStorage.getItem("statusCart");return r?JSON.parse(r):{}},N=r=>{sessionStorage.setItem("statusCart",JSON.stringify(r))},P=()=>{const r=E(),s=`${l}|${m}`;r[s]||(r[s]={sourceLang:l,targetLang:m,tus:[]});const n=Array.from(d).map(i=>h[i]);r[s].tus.push(...n),N(r),S(new Set),window.dispatchEvent(new Event("cartUpdated"))},U=h.length>0&&d.size===h.length,V=d.size>0&&d.size<h.length;return a.useEffect(()=>{if(C.current&&c.current[C.current]){const r=c.current[C.current];setTimeout(()=>{if(r&&document.contains(r)){r.focus();const s=r.value.length;r.setSelectionRange(s,s)}},10)}},[h]),a.useEffect(()=>()=>{w.current&&clearTimeout(w.current)},[]),y?e.jsx(t,{display:"flex",justifyContent:"center",mt:10,children:e.jsx(v,{size:"xl"})}):L?e.jsx(t,{mt:5,px:6,children:e.jsx(q,{status:"error",children:e.jsxs(t,{children:[e.jsx(o,{fontWeight:"bold",children:"Error"}),e.jsx(o,{children:D?.message||"Failed to fetch status data"})]})})}):e.jsx(t,{py:6,px:6,children:e.jsxs(t,{p:6,borderWidth:"2px",borderRadius:"lg",bg:"white",borderColor:"green.200",children:[e.jsxs(t,{display:"flex",alignItems:"center",gap:6,flexWrap:"wrap",mb:6,pb:4,borderBottom:"2px",borderColor:"green.100",children:[e.jsxs(t,{children:[e.jsx(o,{fontSize:"sm",color:"fg.muted",mb:1,children:"Channel"}),e.jsx(o,{fontSize:"lg",fontWeight:"bold",color:"green.600",children:j})]}),e.jsxs(t,{children:[e.jsx(o,{fontSize:"sm",color:"fg.muted",mb:1,children:"Language Pair"}),e.jsxs(F,{align:"center",gap:2,children:[e.jsxs(o,{fontSize:"lg",fontWeight:"semibold",color:"blue.600",children:[l," → ",m]}),y&&e.jsx(v,{size:"sm"})]})]}),e.jsxs(t,{children:[e.jsx(o,{fontSize:"sm",color:"fg.muted",mb:1,children:"Translation Units"}),e.jsxs(o,{fontSize:"lg",fontWeight:"medium",children:[h.length," of ",z.length," shown"]})]}),e.jsx(t,{ml:"auto",children:d.size>0&&e.jsxs(H,{colorPalette:"blue",onClick:P,children:["Add to Cart (",d.size," ",d.size===1?"TU":"TUs",")"]})})]}),e.jsxs(t,{bg:"white",borderRadius:"lg",shadow:"sm",overflow:"auto",h:"calc(100vh - 250px)",children:[e.jsxs(t,{as:"table",w:"100%",fontSize:"sm",children:[e.jsx(t,{as:"thead",position:"sticky",top:0,bg:"orange.subtle",zIndex:1,borderBottom:"2px",borderColor:"orange.muted",shadow:"sm",children:e.jsxs(t,{as:"tr",children:[e.jsx(t,{as:"th",p:3,borderBottom:"1px",borderColor:"border.default",minW:"60px",textAlign:"center",children:e.jsxs(k,{checked:U,onCheckedChange:r=>$(r.checked),children:[e.jsx(A,{ref:r=>{r&&(r.indeterminate=V)}}),e.jsx(R,{})]})}),e.jsx(t,{as:"th",p:3,borderBottom:"1px",borderColor:"border.default",minW:"120px",textAlign:"left",children:e.jsxs(f,{gap:2,align:"stretch",children:[e.jsx(o,{fontSize:"sm",fontWeight:"bold",color:"orange.600",children:"GUID"}),e.jsx(b,{size:"xs",placeholder:"Filter GUID...",value:u.guid,onChange:r=>g("guid",r.target.value),onFocus:()=>x("guid"),onBlur:p,ref:r=>{r&&(c.current.guid=r)},bg:"yellow.subtle"},"guid-input")]})}),e.jsx(t,{as:"th",p:3,borderBottom:"1px",borderColor:"border.default",minW:"120px",textAlign:"left",children:e.jsxs(f,{gap:2,align:"stretch",children:[e.jsx(o,{fontSize:"sm",fontWeight:"bold",color:"orange.600",children:"CHANNEL"}),e.jsx(b,{size:"xs",placeholder:"Filter channel...",value:u.channel,onChange:r=>g("channel",r.target.value),onFocus:()=>x("channel"),onBlur:p,ref:r=>{r&&(c.current.channel=r)},bg:"yellow.subtle"},"channel-input")]})}),e.jsx(t,{as:"th",p:3,borderBottom:"1px",borderColor:"border.default",minW:"120px",textAlign:"left",children:e.jsxs(f,{gap:2,align:"stretch",children:[e.jsx(o,{fontSize:"sm",fontWeight:"bold",color:"orange.600",children:"PRJ"}),e.jsx(b,{size:"xs",placeholder:"Filter project...",value:u.prj,onChange:r=>g("prj",r.target.value),onFocus:()=>x("prj"),onBlur:p,ref:r=>{r&&(c.current.prj=r)},bg:"yellow.subtle"},"prj-input")]})}),e.jsx(t,{as:"th",p:3,borderBottom:"1px",borderColor:"border.default",minW:"150px",textAlign:"left",children:e.jsxs(f,{gap:2,align:"stretch",children:[e.jsx(o,{fontSize:"sm",fontWeight:"bold",color:"orange.600",children:"RID"}),e.jsx(b,{size:"xs",placeholder:"Filter RID...",value:u.rid,onChange:r=>g("rid",r.target.value),onFocus:()=>x("rid"),onBlur:p,ref:r=>{r&&(c.current.rid=r)},bg:"yellow.subtle"},"rid-input")]})}),e.jsx(t,{as:"th",p:3,borderBottom:"1px",borderColor:"border.default",minW:"150px",textAlign:"left",children:e.jsxs(f,{gap:2,align:"stretch",children:[e.jsx(o,{fontSize:"sm",fontWeight:"bold",color:"orange.600",children:"SID"}),e.jsx(b,{size:"xs",placeholder:"Filter SID...",value:u.sid,onChange:r=>g("sid",r.target.value),onFocus:()=>x("sid"),onBlur:p,ref:r=>{r&&(c.current.sid=r)},bg:"yellow.subtle"},"sid-input")]})}),e.jsx(t,{as:"th",p:3,borderBottom:"1px",borderColor:"border.default",minW:"350px",textAlign:"left",children:e.jsxs(f,{gap:2,align:"stretch",children:[e.jsx(o,{fontSize:"sm",fontWeight:"bold",color:"orange.600",children:"NSRC"}),e.jsx(b,{size:"xs",placeholder:"Filter source...",value:u.nsrc,onChange:r=>g("nsrc",r.target.value),onFocus:()=>x("nsrc"),onBlur:p,ref:r=>{r&&(c.current.nsrc=r)},bg:"yellow.subtle",dir:l?.startsWith("he")||l?.startsWith("ar")?"rtl":"ltr"},"nsrc-input")]})}),e.jsx(t,{as:"th",p:3,borderBottom:"1px",borderColor:"border.default",minW:"120px",textAlign:"left",children:e.jsxs(f,{gap:2,align:"stretch",children:[e.jsx(o,{fontSize:"sm",fontWeight:"bold",color:"orange.600",children:"GROUP"}),e.jsx(b,{size:"xs",placeholder:"Filter group...",value:u.group,onChange:r=>g("group",r.target.value),onFocus:()=>x("group"),onBlur:p,ref:r=>{r&&(c.current.group=r)},bg:"yellow.subtle"},"group-input")]})})]})}),e.jsx(t,{as:"tbody",children:h.map((r,s)=>e.jsxs(t,{as:"tr",_hover:{bg:"gray.subtle"},children:[e.jsx(t,{as:"td",p:3,borderBottom:"1px",borderColor:"border.subtle",textAlign:"center",children:e.jsxs(k,{checked:d.has(s),onCheckedChange:n=>O(s,n.checked),children:[e.jsx(A,{}),e.jsx(R,{})]})}),e.jsx(t,{as:"td",p:3,borderBottom:"1px",borderColor:"border.subtle",children:e.jsx(o,{fontSize:"xs",fontFamily:"mono",color:"orange.600",userSelect:"all",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",maxW:"100px",children:r.guid})}),e.jsx(t,{as:"td",p:3,borderBottom:"1px",borderColor:"border.subtle",children:e.jsx(o,{fontSize:"xs",children:r.channel})}),e.jsx(t,{as:"td",p:3,borderBottom:"1px",borderColor:"border.subtle",children:e.jsx(o,{fontSize:"xs",children:r.prj})}),e.jsx(t,{as:"td",p:3,borderBottom:"1px",borderColor:"border.subtle",children:e.jsx(K,{as:M,to:`/sources/${r.channel}?rid=${encodeURIComponent(r.rid)}`,fontSize:"xs",fontFamily:"mono",color:"blue.600",wordBreak:"break-all",whiteSpace:"normal",_hover:{textDecoration:"underline"},children:r.rid})}),e.jsx(t,{as:"td",p:3,borderBottom:"1px",borderColor:"border.subtle",children:e.jsx(o,{fontSize:"xs",wordBreak:"break-all",whiteSpace:"normal",children:r.sid})}),e.jsx(t,{as:"td",p:3,borderBottom:"1px",borderColor:"border.subtle",children:r.notes&&(r.notes.desc?.trim()||r.notes.ph&&Object.keys(r.notes.ph).length>0)?e.jsxs(Q,{children:[e.jsx(X,{asChild:!0,children:e.jsx(o,{fontSize:"xs",noOfLines:2,cursor:"help",dir:l?.startsWith("he")||l?.startsWith("ar")?"rtl":"ltr",children:B(r.nsrc)})}),e.jsx(Y,{children:e.jsxs(Z,{maxW:"400px",bg:"yellow.100",borderWidth:"1px",borderColor:"yellow.300",shadow:"lg",children:[e.jsx(ee,{}),e.jsxs(t,{children:[r.notes.desc?.trim()&&e.jsx(o,{fontSize:"sm",mb:2,whiteSpace:"pre-wrap",color:"black",children:r.notes.desc}),r.notes.ph&&Object.keys(r.notes.ph).length>0&&e.jsxs(t,{children:[e.jsx(o,{fontSize:"xs",fontWeight:"bold",color:"gray.600",mb:1,children:"Placeholders:"}),Object.entries(r.notes.ph).map(([n,i])=>e.jsxs(t,{mb:1,children:[e.jsx(o,{fontSize:"xs",fontFamily:"mono",color:"blue.600",children:n}),e.jsxs(o,{fontSize:"xs",color:"gray.600",children:[i.desc," (e.g., ",i.sample,")"]})]},n))]})]})]})})]}):e.jsx(o,{fontSize:"xs",noOfLines:2,dir:l?.startsWith("he")||l?.startsWith("ar")?"rtl":"ltr",children:B(r.nsrc)})}),e.jsx(t,{as:"td",p:3,borderBottom:"1px",borderColor:"border.subtle",children:e.jsx(o,{fontSize:"xs",children:r.group})})]},`${r.guid}-${s}`))})]}),h.length===0&&!y&&e.jsx(F,{justify:"center",p:8,children:e.jsx(o,{color:"fg.muted",children:"No untranslated content found for the current filters"})})]})]})})};export{ne as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{u as g,r as x,i as m,j as e,B as t,S as f,A as C,T as a,a6 as v,ai as w,v as c,F as y,g as S,a7 as z,aj as $,V as h}from"./vendor-BVSmEsOp.js";import{L as B,f as L}from"./index-Dl1WS_Lc.js";const M=()=>e.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"currentColor",children:e.jsx("path",{d:"M7.41 8.59L12 13.17l4.59-4.58L18 10l-6 6-6-6 1.41-1.41z"})}),P=()=>e.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"currentColor",children:e.jsx("path",{d:"M7.41 15.41L12 10.83l4.59 4.58L18 14l-6-6-6 6z"})}),W=()=>{const u=g(),[o,p]=x.useState(!1),{data:i=[],isLoading:b,error:d}=m({queryKey:["tmStats"],queryFn:()=>L("/api/tm/stats")}),n=x.useMemo(()=>i.map(([r,l])=>({value:`${r}|${l}`,label:`${r} → ${l}`,sourceLang:r,targetLang:l})).sort((r,l)=>r.label.localeCompare(l.label)),[i]),j=s=>{if(s){const[r,l]=s.split("|");u(`/tm/${r}/${l}`)}};return b?e.jsx(t,{display:"flex",justifyContent:"center",mt:10,children:e.jsx(f,{size:"xl"})}):d?e.jsx(t,{mt:5,px:6,children:e.jsx(C,{status:"error",children:e.jsxs(t,{children:[e.jsx(a,{fontWeight:"bold",children:"Error"}),e.jsx(a,{children:d})]})})}):e.jsxs(t,{children:[n.length>0&&e.jsx(t,{bg:"blue.subtle",borderBottom:"1px",borderColor:"blue.muted",shadow:"md",borderLeft:"4px",borderLeftColor:"blue.500",children:e.jsxs(v,{open:o,onOpenChange:s=>p(s.open),children:[e.jsx(t,{px:6,py:4,children:e.jsxs(w,{as:c,variant:"ghost",size:"md",width:"full",justifyContent:"space-between",_hover:{bg:"blue.muted"},bg:"transparent",children:[e.jsxs(y,{align:"center",gap:3,children:[e.jsx(a,{fontSize:"md",fontWeight:"semibold",color:"blue.700",children:"Language Pairs"}),e.jsx(S,{colorPalette:"blue",variant:"subtle",size:"sm",children:n.length})]}),e.jsx(t,{color:"blue.600",children:o?e.jsx(P,{}):e.jsx(M,{})})]})}),e.jsx(z,{children:e.jsx(t,{px:6,pb:4,children:e.jsx($,{columns:{base:1,sm:2,md:3,lg:4,xl:5},gap:2,children:n.map(s=>e.jsx(c,{variant:"outline",size:"sm",onClick:()=>j(s.value),_hover:{bg:"blue.100",borderColor:"blue.400"},justifyContent:"flex-start",bg:"white",borderColor:"blue.200",children:e.jsx(a,{fontSize:"xs",color:"blue.700",children:s.label})},s.value))})})})]})}),e.jsx(t,{py:6,px:6,children:e.jsx(h,{gap:6,align:"stretch",children:n.length===0?e.jsx(t,{p:6,borderWidth:"1px",borderRadius:"md",bg:"white",textAlign:"center",children:e.jsx(a,{color:"fg.muted",children:"No translation memory data found."})}):e.jsx(h,{gap:6,align:"stretch",maxW:"800px",mx:"auto",w:"100%",children:n.map(({sourceLang:s,targetLang:r})=>e.jsx(B,{sourceLang:s,targetLang:r},`${s}-${r}`))})})})]})};export{W as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a8 as Fe,u as Pe,a0 as Ae,r as l,ad as Ie,i as Oe,j as e,B as n,S as Z,A as Re,T as r,F as B,a9 as O,aa as R,ab as $,v as ee,V as f,ac as W,ak as $e,al as De,am as Le,an as Ne,ao as qe,ap as Ge,aq as Ee,$ as Me,L as Ue,h as _e,b as se,c as le,d as ie,e as ae,f as ce,l as Ye,m as Ve,n as He,o as Qe,p as Ke,q as de,s as he,t as ue}from"./vendor-BVSmEsOp.js";import{c as Je,f as xe}from"./index-Dl1WS_Lc.js";function te(d){return d.map(h=>typeof h=="string"?h:`{{${h.t}}}`).join("")}const Y=({columnName:d,label:h,value:s,onChange:I,onFocus:j,onBlur:S,inputRef:i,lowCardinalityOptions:P,placeholder:u})=>P&&P.length>0?e.jsxs(Ye,{value:s?[s]:[],onValueChange:a=>{},positioning:{strategy:"absolute",placement:"bottom-start",flip:!0,gutter:4},children:[e.jsxs(Ve,{size:"xs",bg:"yellow.subtle",onFocus:j,onBlur:S,ref:i,children:[e.jsx(r,{fontSize:"xs",flex:"1",textAlign:"left",color:s?"fg.default":"fg.muted",children:s||u}),e.jsx(He,{})]}),e.jsx(Qe,{children:e.jsxs(Ke,{zIndex:1e3,bg:"white",borderWidth:"1px",borderColor:"border.default",borderRadius:"md",shadow:"lg",maxH:"200px",overflow:"auto",children:[s&&e.jsxs(de,{item:"",value:"",onClick:()=>I(""),children:[e.jsx(he,{children:"---"}),e.jsx(ue,{})]}),P.slice().sort((a,V)=>a.localeCompare(V)).map(a=>e.jsxs(de,{item:a,value:a,onClick:()=>I(a),children:[e.jsx(he,{children:a}),e.jsx(ue,{})]},a))]})})]}):e.jsx(W,{size:"xs",placeholder:u,value:s,onChange:a=>I(a.target.value),onFocus:j,onBlur:S,ref:i,bg:"yellow.subtle"}),et=()=>{const{sourceLang:d,targetLang:h}=Fe();Pe();const[s,I]=Ae(),[j,S]=l.useState(new Set),[i,P]=l.useState(()=>({guid:s.get("guid")||"",nid:s.get("nid")||"",rid:s.get("rid")||"",sid:s.get("sid")||"",nsrc:s.get("nsrc")||"",ntgt:s.get("ntgt")||"",tconf:s.get("tconf")||"",q:s.get("q")||"",translationProvider:s.get("translationProvider")||"",jobGuid:s.get("jobGuid")||"",channel:s.get("channel")||"",minTS:s.get("minTS")||"",maxTS:s.get("maxTS")||""})),[u,re]=l.useState(()=>{const t=s.get("active");return t!==null?t==="1":!0}),[a,V]=l.useState(()=>s.get("showTechnicalColumns")==="1"),[b,ge]=l.useState(()=>s.get("showTNotes")==="1"),[g,pe]=l.useState(()=>s.get("showOnlyLeveraged")==="1"),[x,H]=l.useState(()=>({guid:s.get("guid")||"",nid:s.get("nid")||"",rid:s.get("rid")||"",sid:s.get("sid")||"",nsrc:s.get("nsrc")||"",ntgt:s.get("ntgt")||"",tconf:s.get("tconf")||"",q:s.get("q")||"",translationProvider:s.get("translationProvider")||"",jobGuid:s.get("jobGuid")||"",channel:s.get("channel")||"",minTS:s.get("minTS")||"",maxTS:s.get("maxTS")||""})),q=l.useRef(),k=l.useRef(),F=l.useRef(),D=l.useRef(null),m=l.useRef({}),[G,E]=l.useState(""),[M,U]=l.useState(""),[be,Q]=l.useState(!1),fe=l.useMemo(()=>["tmSearch",d,h,i,u,b,g],[d,h,i,u,b,g]),{data:K,isLoading:L,isError:me,error:je,fetchNextPage:ne,hasNextPage:J,isFetchingNextPage:X}=Ie({queryKey:fe,queryFn:async({pageParam:t=1})=>{const o=new URLSearchParams({sourceLang:d,targetLang:h,page:t.toString(),limit:"100",...Object.fromEntries(Object.entries(i).filter(([p,A])=>A.trim()!=="")),...u&&{active:"1"},...b&&{onlyTNotes:"1"}});if(i.minTS&&/^\d{1,2}\/\d{1,2}$/.test(i.minTS)){const p=new Date().getFullYear(),[A,w]=i.minTS.split("/"),N=new Date(`${p}-${A.padStart(2,"0")}-${w.padStart(2,"0")}T00:00:00`);o.set("minTS",N.getTime().toString())}if(i.maxTS&&/^\d{1,2}\/\d{1,2}$/.test(i.maxTS)){const p=new Date().getFullYear(),[A,w]=i.maxTS.split("/"),N=new Date(`${p}-${A.padStart(2,"0")}-${w.padStart(2,"0")}T23:59:59.999`);o.set("maxTS",N.getTime().toString())}return await xe(`/api/tm/search?${o}`)},getNextPageParam:(t,o)=>t.data.length===parseInt(t.limit)?o.length+1:void 0,staleTime:3e4,refetchOnWindowFocus:!1,placeholderData:t=>t}),{data:_={}}=Oe({queryKey:["lowCardinalityColumns",d,h],queryFn:()=>xe(`/api/tm/lowCardinalityColumns/${d}/${h}`),staleTime:300*1e3}),T=l.useMemo(()=>{let t=K?.pages.flatMap(o=>o.data)||[];return g&&(t=t.filter(o=>o.channel!==null&&o.channel!==void 0&&o.channel!=="")),t},[K,g]),Se=l.useCallback(t=>{L||X||(q.current&&q.current.disconnect(),q.current=new IntersectionObserver(o=>{o[0].isIntersecting&&J&&ne()}),t&&q.current.observe(t))},[L,X,J,ne]),v=l.useCallback(t=>{D.current=t},[]),y=l.useCallback(()=>{D.current=null},[]),C=l.useCallback((t,o,c,p,A)=>{const w=new URLSearchParams;Object.entries(t).forEach(([N,oe])=>{oe.trim()!==""&&w.set(N,oe)}),o?Object.keys(Object.fromEntries(w)).length>0&&w.set("active","1"):w.set("active","0"),c&&w.set("showTechnicalColumns","1"),p&&w.set("showTNotes","1"),A&&w.set("showOnlyLeveraged","1"),I(w,{replace:!0})},[I]),z=l.useCallback((t,o)=>{H(c=>({...c,[t]:o})),S(new Set),clearTimeout(k.current),k.current=setTimeout(()=>{const c={...i,[t]:o};P(c),clearTimeout(F.current),F.current=setTimeout(()=>{C(c,u,a,b,g)},200)},300)},[i,u,a,b,g,C]),Ce=(t,o)=>{const c=new Set(j);o?c.add(t):c.delete(t),S(c)},we=t=>{if(t){const o=new Set(T.map((c,p)=>p));S(o)}else S(new Set)},Te=()=>{const t=Array.from(j).map(o=>T[o]);Je(d,h,t),S(new Set)},ve=T.length>0&&j.size===T.length,ye=j.size>0&&j.size<T.length;l.useEffect(()=>{if(D.current&&m.current[D.current]){const t=m.current[D.current];setTimeout(()=>{if(t&&document.contains(t)&&(t.focus(),typeof t.setSelectionRange=="function"&&t.value)){const o=t.value.length;t.setSelectionRange(o,o)}},10)}},[T]);const ze=l.useCallback(t=>{re(t),C(i,t,a,b,g)},[i,a,b,g,C]),We=l.useCallback(t=>{ge(t),S(new Set),C(i,u,a,t,g)},[i,u,a,g,C]),Be=l.useCallback(t=>{pe(t),S(new Set),C(i,u,a,b,t)},[i,u,a,b,C]),ke=l.useCallback(t=>{V(t),C(i,u,t,b,g)},[i,u,b,g,C]);return l.useEffect(()=>()=>{k.current&&clearTimeout(k.current),F.current&&clearTimeout(F.current)},[]),L&&T.length===0&&!K?e.jsx(n,{display:"flex",justifyContent:"center",mt:10,children:e.jsx(Z,{size:"xl"})}):me?e.jsx(n,{mt:5,px:6,children:e.jsx(Re,{status:"error",children:e.jsxs(n,{children:[e.jsx(r,{fontWeight:"bold",children:"Error"}),e.jsx(r,{children:je?.message||"Failed to fetch translation memory data"})]})})}):e.jsxs(n,{children:[e.jsx(n,{bg:"blue.subtle",borderBottom:"1px",borderColor:"blue.muted",shadow:"md",borderLeft:"4px",borderLeftColor:"blue.500",px:6,py:4,mb:6,children:e.jsxs(B,{align:"center",justify:"space-between",children:[e.jsxs(B,{align:"center",gap:3,children:[e.jsxs(r,{fontSize:"md",fontWeight:"semibold",color:"blue.700",children:[d," → ",h]}),L&&e.jsx(Z,{size:"sm"})]}),e.jsxs(B,{align:"center",gap:3,children:[e.jsxs(B,{align:"center",gap:2,children:[e.jsx(r,{fontSize:"sm",color:"blue.600",children:"Show Technical IDs"}),e.jsxs(O,{checked:a,onCheckedChange:t=>ke(t.checked),size:"sm",children:[e.jsx(R,{}),e.jsx($,{})]})]}),e.jsxs(B,{align:"center",gap:2,children:[e.jsx(r,{fontSize:"sm",color:"blue.600",children:"Only Leveraged"}),e.jsxs(O,{checked:g,onCheckedChange:t=>Be(t.checked),size:"sm",children:[e.jsx(R,{}),e.jsx($,{})]})]}),e.jsxs(B,{align:"center",gap:2,children:[e.jsx(r,{fontSize:"sm",color:"blue.600",children:"Only TNotes"}),e.jsxs(O,{checked:b,onCheckedChange:t=>We(t.checked),size:"sm",children:[e.jsx(R,{}),e.jsx($,{})]})]}),j.size>0&&e.jsxs(ee,{colorPalette:"blue",onClick:Te,children:["Add to Cart (",j.size," ",j.size===1?"TU":"TUs",")"]})]})]})}),e.jsxs(n,{mx:6,h:"calc(100vh - 180px)",bg:"white",borderRadius:"lg",shadow:"sm",overflow:"auto",children:[e.jsxs(n,{as:"table",w:"100%",fontSize:"sm",children:[e.jsx(n,{as:"thead",position:"sticky",top:0,bg:"blue.subtle",zIndex:1,borderBottom:"2px",borderColor:"blue.muted",shadow:"sm",children:e.jsxs(n,{as:"tr",children:[e.jsx(n,{as:"th",p:3,borderBottom:"1px",borderColor:"border.default",minW:"60px",textAlign:"center",children:e.jsxs(O,{checked:ve,onCheckedChange:t=>we(t.checked),children:[e.jsx(R,{ref:t=>{t&&(t.indeterminate=ye)}}),e.jsx($,{})]})}),a&&e.jsxs(e.Fragment,{children:[e.jsx(n,{as:"th",p:3,borderBottom:"1px",borderColor:"border.default",minW:"120px",textAlign:"left",children:e.jsxs(f,{gap:2,align:"stretch",children:[e.jsx(r,{fontSize:"sm",fontWeight:"bold",color:"blue.600",children:"guid"}),e.jsx(W,{size:"xs",placeholder:"Filter GUID...",value:x.guid,onChange:t=>z("guid",t.target.value),onFocus:()=>v("guid"),onBlur:y,ref:t=>{t&&(m.current.guid=t)},bg:"yellow.subtle"},"guid-input")]})}),e.jsx(n,{as:"th",p:3,borderBottom:"1px",borderColor:"border.default",minW:"120px",textAlign:"left",children:e.jsxs(f,{gap:2,align:"stretch",children:[e.jsx(r,{fontSize:"sm",fontWeight:"bold",color:"blue.600",children:"nid"}),e.jsx(W,{size:"xs",placeholder:"Filter NID...",value:x.nid,onChange:t=>z("nid",t.target.value),onFocus:()=>v("nid"),onBlur:y,ref:t=>{t&&(m.current.nid=t)},bg:"yellow.subtle"},"nid-input")]})}),e.jsx(n,{as:"th",p:3,borderBottom:"1px",borderColor:"border.default",minW:"120px",textAlign:"left",children:e.jsxs(f,{gap:2,align:"stretch",children:[e.jsx(r,{fontSize:"sm",fontWeight:"bold",color:"blue.600",children:"jobGuid"}),e.jsx(W,{size:"xs",placeholder:"Filter Job GUID...",value:x.jobGuid,onChange:t=>z("jobGuid",t.target.value),onFocus:()=>v("jobGuid"),onBlur:y,ref:t=>{t&&(m.current.jobGuid=t)},bg:"yellow.subtle"},"jobGuid-input")]})}),e.jsx(n,{as:"th",p:3,borderBottom:"1px",borderColor:"border.default",minW:"150px",textAlign:"left",children:e.jsxs(f,{gap:2,align:"stretch",children:[e.jsx(r,{fontSize:"sm",fontWeight:"bold",color:"blue.600",children:"rid"}),e.jsx(W,{size:"xs",placeholder:"Filter RID...",value:x.rid,onChange:t=>z("rid",t.target.value),onFocus:()=>v("rid"),onBlur:y,ref:t=>{t&&(m.current.rid=t)},bg:"yellow.subtle"},"rid-input")]})}),e.jsx(n,{as:"th",p:3,borderBottom:"1px",borderColor:"border.default",minW:"150px",textAlign:"left",children:e.jsxs(f,{gap:2,align:"stretch",children:[e.jsx(r,{fontSize:"sm",fontWeight:"bold",color:"blue.600",children:"sid"}),e.jsx(W,{size:"xs",placeholder:"Filter SID...",value:x.sid,onChange:t=>z("sid",t.target.value),onFocus:()=>v("sid"),onBlur:y,ref:t=>{t&&(m.current.sid=t)},bg:"yellow.subtle"},"sid-input")]})})]}),e.jsx(n,{as:"th",p:3,borderBottom:"1px",borderColor:"border.default",minW:"120px",textAlign:"left",children:e.jsxs(f,{gap:2,align:"stretch",children:[e.jsx(r,{fontSize:"sm",fontWeight:"bold",color:"blue.600",children:"Channel"}),e.jsx(Y,{columnName:"channel",label:"Channel",value:x.channel,onChange:t=>z("channel",t),onFocus:()=>v("channel"),onBlur:y,inputRef:t=>{t&&(m.current.channel=t)},lowCardinalityOptions:_.channel,placeholder:"Channel..."})]})}),e.jsx(n,{as:"th",p:3,borderBottom:"1px",borderColor:"border.default",minW:"350px",textAlign:"left",children:e.jsxs(f,{gap:2,align:"stretch",children:[e.jsx(r,{fontSize:"sm",fontWeight:"bold",color:"blue.600",textAlign:d?.startsWith("he")||d?.startsWith("ar")?"right":"left",children:"Source"}),e.jsx(W,{size:"xs",placeholder:"Filter source...",value:x.nsrc,onChange:t=>z("nsrc",t.target.value),onFocus:()=>v("nsrc"),onBlur:y,ref:t=>{t&&(m.current.nsrc=t)},bg:"yellow.subtle",dir:d?.startsWith("he")||d?.startsWith("ar")?"rtl":"ltr"},"nsrc-input")]})}),e.jsx(n,{as:"th",p:3,borderBottom:"1px",borderColor:"border.default",minW:"350px",textAlign:"left",children:e.jsxs(f,{gap:2,align:"stretch",children:[e.jsx(r,{fontSize:"sm",fontWeight:"bold",color:"blue.600",textAlign:h?.startsWith("he")||h?.startsWith("ar")?"right":"left",children:"Target"}),e.jsx(W,{size:"xs",placeholder:"Filter target...",value:x.ntgt,onChange:t=>z("ntgt",t.target.value),onFocus:()=>v("ntgt"),onBlur:y,ref:t=>{t&&(m.current.ntgt=t)},bg:"yellow.subtle",dir:h?.startsWith("he")||h?.startsWith("ar")?"rtl":"ltr"},"ntgt-input")]})}),e.jsx(n,{as:"th",p:3,borderBottom:"1px",borderColor:"border.default",minW:"60px",textAlign:"center",children:e.jsxs(f,{gap:2,align:"stretch",children:[e.jsx(r,{fontSize:"sm",fontWeight:"bold",color:"blue.600",children:"TConf"}),e.jsx(Y,{columnName:"tconf",label:"TConf",value:x.tconf,onChange:t=>z("tconf",t),onFocus:()=>v("tconf"),onBlur:y,inputRef:t=>{t&&(m.current.tconf=t)},lowCardinalityOptions:_.tconf,placeholder:"TConf..."})]})}),e.jsx(n,{as:"th",p:3,borderBottom:"1px",borderColor:"border.default",minW:"40px",textAlign:"center",children:e.jsxs(f,{gap:2,align:"stretch",children:[e.jsx(r,{fontSize:"sm",fontWeight:"bold",color:"blue.600",children:"q"}),e.jsx(Y,{columnName:"q",label:"Quality",value:x.q,onChange:t=>z("q",t),onFocus:()=>v("q"),onBlur:y,inputRef:t=>{t&&(m.current.q=t)},lowCardinalityOptions:_.q,placeholder:"Quality..."})]})}),e.jsx(n,{as:"th",p:3,borderBottom:"1px",borderColor:"border.default",minW:"120px",textAlign:"left",children:e.jsxs(f,{gap:2,align:"stretch",children:[e.jsx(r,{fontSize:"sm",fontWeight:"bold",color:"blue.600",children:"Provider"}),e.jsx(Y,{columnName:"translationProvider",label:"Provider",value:x.translationProvider,onChange:t=>z("translationProvider",t),onFocus:()=>v("translationProvider"),onBlur:y,inputRef:t=>{t&&(m.current.translationProvider=t)},lowCardinalityOptions:_.translationProvider,placeholder:"Provider..."})]})}),e.jsx(n,{as:"th",p:3,borderBottom:"1px",borderColor:"border.default",minW:"80px",textAlign:"center",children:e.jsxs(f,{gap:2,align:"center",children:[e.jsx(r,{fontSize:"sm",fontWeight:"bold",color:"blue.600",children:"Active"}),e.jsxs(O,{checked:u,onCheckedChange:t=>ze(t.checked),size:"sm",children:[e.jsx(R,{}),e.jsx($,{})]})]})}),e.jsx(n,{as:"th",p:3,borderBottom:"1px",borderColor:"border.default",minW:"120px",textAlign:"center",children:e.jsxs(f,{gap:2,align:"stretch",children:[e.jsx(r,{fontSize:"sm",fontWeight:"bold",color:"blue.600",children:"Timestamp"}),e.jsxs($e,{open:be,onOpenChange:t=>{Q(t.open),t.open&&(E(x.minTS),U(x.maxTS))},children:[e.jsx(De,{asChild:!0,children:e.jsx(r,{fontSize:"xs",cursor:"pointer",color:"blue.600",textDecoration:"underline",_hover:{color:"blue.700"},px:2,py:1,children:x.minTS||x.maxTS?`${x.minTS||"start"} → ${x.maxTS||"end"}`:"Filter dates..."})}),e.jsx(Le,{children:e.jsxs(Ne,{children:[e.jsx(qe,{}),e.jsx(Ge,{children:e.jsx(r,{fontSize:"sm",fontWeight:"semibold",children:"Date Range Filter"})}),e.jsx(Ee,{children:e.jsxs(f,{gap:3,align:"stretch",children:[e.jsxs(n,{children:[e.jsx(r,{fontSize:"xs",mb:1,color:"fg.muted",children:"From"}),e.jsx(W,{type:"date",size:"sm",value:G?(()=>{const[t,o]=G.split("/");return`${new Date().getFullYear()}-${t?.padStart(2,"0")}-${o?.padStart(2,"0")}`})():"",onChange:t=>{if(t.target.value){const[o,c,p]=t.target.value.split("-");E(`${parseInt(c,10)}/${parseInt(p,10)}`),setTimeout(()=>t.target.blur(),0)}else E("")}})]}),e.jsxs(n,{children:[e.jsx(r,{fontSize:"xs",mb:1,color:"fg.muted",children:"To"}),e.jsx(W,{type:"date",size:"sm",value:M?(()=>{const[t,o]=M.split("/");return`${new Date().getFullYear()}-${t?.padStart(2,"0")}-${o?.padStart(2,"0")}`})():"",onChange:t=>{if(t.target.value){const[o,c,p]=t.target.value.split("-");U(`${parseInt(c,10)}/${parseInt(p,10)}`),setTimeout(()=>t.target.blur(),0)}else U("")}})]}),e.jsxs(Me,{gap:2,children:[e.jsx(ee,{size:"sm",variant:"outline",flex:1,onClick:()=>{H(t=>({...t,minTS:"",maxTS:""})),S(new Set),clearTimeout(k.current),k.current=setTimeout(()=>{const t={...i,minTS:"",maxTS:""};P(t),clearTimeout(F.current),F.current=setTimeout(()=>{C(t,u,a,b,g)},200)},300),E(""),U(""),Q(!1)},children:"Clear"}),e.jsx(ee,{size:"sm",colorPalette:"blue",flex:1,onClick:()=>{H(t=>({...t,minTS:G,maxTS:M})),S(new Set),clearTimeout(k.current),k.current=setTimeout(()=>{const t={...i,minTS:G,maxTS:M};P(t),clearTimeout(F.current),F.current=setTimeout(()=>{C(t,u,a,b,g)},200)},300),Q(!1)},children:"Apply"})]})]})})]})})]})]})})]})}),e.jsx(n,{as:"tbody",children:T.map((t,o)=>e.jsxs(n,{as:"tr",ref:o===T.length-20?Se:null,_hover:{bg:"gray.subtle"},children:[e.jsx(n,{as:"td",p:3,borderBottom:"1px",borderColor:"border.subtle",textAlign:"center",children:e.jsxs(O,{checked:j.has(o),onCheckedChange:c=>Ce(o,c.checked),children:[e.jsx(R,{}),e.jsx($,{})]})}),a&&e.jsxs(e.Fragment,{children:[e.jsx(n,{as:"td",p:3,borderBottom:"1px",borderColor:"border.subtle",children:e.jsx(r,{fontSize:"xs",fontFamily:"mono",color:"blue.600",userSelect:"all",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",maxW:"100px",children:t.guid})}),e.jsx(n,{as:"td",p:3,borderBottom:"1px",borderColor:"border.subtle",children:e.jsx(r,{fontSize:"xs",fontFamily:"mono",color:"purple.600",userSelect:"all",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",maxW:"100px",children:t.nid||""})}),e.jsx(n,{as:"td",p:3,borderBottom:"1px",borderColor:"border.subtle",children:e.jsx(r,{fontSize:"xs",fontFamily:"mono",color:"green.600",userSelect:"all",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",maxW:"100px",cursor:"pointer",_hover:{textDecoration:"underline"},onClick:c=>{c.preventDefault(),window.open(`/job/${t.jobGuid}`,"_blank")},children:t.jobGuid})}),e.jsx(n,{as:"td",p:3,borderBottom:"1px",borderColor:"border.subtle",children:e.jsx(r,{fontSize:"xs",wordBreak:"break-all",whiteSpace:"normal",children:t.rid})}),e.jsx(n,{as:"td",p:3,borderBottom:"1px",borderColor:"border.subtle",children:e.jsx(r,{fontSize:"xs",wordBreak:"break-all",whiteSpace:"normal",children:t.sid})})]}),e.jsx(n,{as:"td",p:3,borderBottom:"1px",borderColor:"border.subtle",children:t.channel?e.jsx(Ue,{as:_e,to:`/sources/${t.channel}?rid=${encodeURIComponent(t.rid)}&guid=${encodeURIComponent(t.guid)}`,fontSize:"xs",color:"blue.600",_hover:{textDecoration:"underline"},children:t.channel}):e.jsx(r,{fontSize:"xs",children:t.channel})}),e.jsx(n,{as:"td",p:3,borderBottom:"1px",borderColor:"border.subtle",children:t.notes?e.jsxs(se,{children:[e.jsx(le,{asChild:!0,children:e.jsx(r,{fontSize:"xs",noOfLines:2,cursor:"help",dir:d?.startsWith("he")||d?.startsWith("ar")?"rtl":"ltr",children:te(t.nsrc)})}),e.jsx(ie,{children:e.jsxs(ae,{maxW:"400px",bg:"yellow.100",borderWidth:"1px",borderColor:"yellow.300",shadow:"lg",children:[e.jsx(ce,{}),e.jsxs(n,{children:[t.notes.desc&&e.jsx(r,{fontSize:"sm",mb:2,whiteSpace:"pre-wrap",color:"black",children:t.notes.desc}),t.notes.ph&&e.jsxs(n,{children:[e.jsx(r,{fontSize:"xs",fontWeight:"bold",color:"gray.600",mb:1,children:"Placeholders:"}),Object.entries(t.notes.ph).map(([c,p])=>e.jsxs(n,{mb:1,children:[e.jsx(r,{fontSize:"xs",fontFamily:"mono",color:"blue.600",children:c}),e.jsxs(r,{fontSize:"xs",color:"gray.600",children:[p.desc," (e.g., ",p.sample,")"]})]},c))]})]})]})})]}):e.jsx(r,{fontSize:"xs",noOfLines:2,dir:d?.startsWith("he")||d?.startsWith("ar")?"rtl":"ltr",children:te(t.nsrc)})}),e.jsx(n,{as:"td",p:3,borderBottom:"1px",borderColor:"border.subtle",children:e.jsx(r,{fontSize:"xs",noOfLines:2,dir:h?.startsWith("he")||h?.startsWith("ar")?"rtl":"ltr",children:te(t.ntgt)})}),e.jsx(n,{as:"td",p:3,borderBottom:"1px",borderColor:"border.subtle",textAlign:"center",children:t.tnotes?e.jsxs(se,{children:[e.jsx(le,{asChild:!0,children:e.jsx(r,{fontSize:"xs",fontWeight:"bold",cursor:"help",children:t.tconf||""})}),e.jsx(ie,{children:e.jsxs(ae,{maxW:"400px",bg:"yellow.100",borderWidth:"1px",borderColor:"yellow.300",shadow:"lg",children:[e.jsx(ce,{}),e.jsx(r,{fontSize:"sm",whiteSpace:"pre-wrap",color:"black",children:t.tnotes})]})})]}):e.jsx(r,{fontSize:"xs",children:t.tconf||""})}),e.jsx(n,{as:"td",p:3,borderBottom:"1px",borderColor:"border.subtle",textAlign:"center",children:e.jsx(r,{fontSize:"xs",children:t.q})}),e.jsx(n,{as:"td",p:3,borderBottom:"1px",borderColor:"border.subtle",children:e.jsx(r,{fontSize:"xs",children:t.translationProvider})}),e.jsx(n,{as:"td",p:3,borderBottom:"1px",borderColor:"border.subtle",textAlign:"center",children:t.active===1&&e.jsx(r,{fontSize:"lg",color:"green.500",children:"✓"})}),e.jsx(n,{as:"td",p:3,borderBottom:"1px",borderColor:"border.subtle",textAlign:"center",children:e.jsx(r,{fontSize:"xs",color:"fg.muted",children:t.ts?new Date(t.ts).toLocaleString("en-US",{year:"numeric",month:"short",day:"numeric",hour:"2-digit",minute:"2-digit",second:"2-digit"}):""})})]},`${o}-${t.guid||t.nid||o}`))})]}),X&&e.jsx(B,{justify:"center",p:4,children:e.jsx(Z,{size:"md"})}),!J&&T.length>0&&e.jsx(B,{justify:"center",p:4,children:e.jsx(r,{color:"fg.muted",fontSize:"sm",children:"No more results"})}),T.length===0&&!L&&e.jsx(B,{justify:"center",p:8,children:e.jsx(r,{color:"fg.muted",children:"No translation units found for the current filters"})})]})]})};export{et as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{i as p,j as e,B as t,S as m,A as u,T as r,V as a,F as l,G as j,g as n,$ as x}from"./vendor-BVSmEsOp.js";import{f as S}from"./index-Dl1WS_Lc.js";const w=()=>{const{data:s,isLoading:g,error:c}=p({queryKey:["info"],queryFn:()=>S("/api/info")});return g?e.jsx(t,{display:"flex",justifyContent:"center",mt:20,children:e.jsx(m,{size:"xl"})}):c?e.jsx(t,{mt:10,px:6,children:e.jsx(u,{status:"error",children:e.jsxs(t,{children:[e.jsx(r,{fontWeight:"bold",children:"Error"}),e.jsx(r,{children:c})]})})}):e.jsx(t,{py:8,px:6,children:e.jsxs(a,{gap:8,align:"stretch",maxW:"6xl",mx:"auto",children:[s&&e.jsx(t,{p:8,borderWidth:"1px",borderRadius:"xl",bg:"white",shadow:"lg",width:"100%",maxW:"500px",mx:"auto",position:"relative",background:"linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%)",borderColor:"border.default",children:e.jsxs(l,{direction:"column",gap:4,children:[e.jsxs(l,{align:"center",gap:4,children:[e.jsx("img",{src:"/logo.svg",alt:"L10n Monster",width:"60",height:"60"}),e.jsx(t,{children:e.jsx(r,{fontSize:"xl",fontWeight:"bold",color:"fg.default",lineHeight:"1.2",children:s.description})})]}),e.jsxs(a,{gap:3,align:"stretch",children:[e.jsxs(t,{children:[e.jsx(r,{fontSize:"xs",color:"fg.muted",textTransform:"uppercase",letterSpacing:"wide",mb:1,children:"Version"}),e.jsx(r,{fontSize:"lg",fontWeight:"semibold",color:"blue.600",children:s.version})]}),e.jsxs(t,{children:[e.jsx(r,{fontSize:"xs",color:"fg.muted",textTransform:"uppercase",letterSpacing:"wide",mb:1,children:"Project Directory"}),e.jsx(r,{fontSize:"xs",fontFamily:"mono",color:"fg.muted",wordBreak:"break-all",lineHeight:"1.3",children:s.baseDir})]})]}),e.jsx(t,{position:"absolute",top:"-10px",right:"-10px",width:"80px",height:"80px",bg:"blue.subtle",borderRadius:"full",opacity:"0.5",zIndex:"-1"})]})}),s&&e.jsxs(j,{templateColumns:{base:"1fr",md:"repeat(2, 1fr)"},gap:6,children:[e.jsxs(t,{p:6,borderWidth:"1px",borderRadius:"lg",bg:"white",shadow:"sm",borderColor:"border.default",children:[e.jsxs(r,{fontSize:"lg",fontWeight:"bold",mb:4,color:"fg.default",children:["Channels (",s.channels?.length||0,")"]}),e.jsxs(a,{gap:3,align:"stretch",maxH:"500px",overflow:"auto",children:[s.channels?.map((o,d)=>e.jsxs(t,{p:4,borderWidth:"1px",borderRadius:"md",borderColor:"border.subtle",bg:"bg.subtle",children:[e.jsxs(l,{justify:"space-between",align:"center",mb:3,children:[e.jsx(r,{fontSize:"sm",fontWeight:"semibold",color:"fg.default",children:o.id}),e.jsxs(n,{variant:"subtle",colorPalette:"purple",fontSize:"xs",children:[o.translationPolicies," ",o.translationPolicies===1?"policy":"policies"]})]}),e.jsxs(x,{gap:4,mb:3,flexWrap:"wrap",children:[e.jsxs(t,{children:[e.jsx(r,{fontSize:"xs",color:"fg.muted",mb:1,children:"Source"}),e.jsx(n,{variant:"subtle",colorPalette:"blue",fontSize:"xs",children:o.source})]}),e.jsxs(t,{children:[e.jsx(r,{fontSize:"xs",color:"fg.muted",mb:1,children:"Target"}),e.jsx(n,{variant:"subtle",colorPalette:"green",fontSize:"xs",children:o.target})]})]}),o.formatHandlers&&o.formatHandlers.length>0&&e.jsxs(t,{children:[e.jsx(r,{fontSize:"xs",color:"fg.muted",mb:2,children:"Format Handlers"}),e.jsx(a,{gap:2,align:"stretch",children:o.formatHandlers.map((i,h)=>e.jsxs(t,{p:2,bg:"white",borderRadius:"sm",borderWidth:"1px",children:[e.jsxs(l,{justify:"space-between",align:"center",mb:1,children:[e.jsxs(r,{fontSize:"xs",fontWeight:"medium",children:[i.id,i.resourceFilter&&` (${i.resourceFilter})`]}),i.defaultMessageFormat&&e.jsx(n,{variant:"outline",colorPalette:"orange",size:"sm",children:i.defaultMessageFormat})]}),i.messageFormats&&i.messageFormats.length>0&&e.jsx(x,{gap:1,flexWrap:"wrap",children:i.messageFormats.map((f,b)=>e.jsx(n,{variant:"subtle",colorPalette:"gray",size:"sm",children:f},b))})]},h))})]})]},d)),(!s.channels||s.channels.length===0)&&e.jsx(r,{fontSize:"sm",color:"fg.muted",children:"No channels configured"})]})]}),e.jsxs(t,{p:6,borderWidth:"1px",borderRadius:"lg",bg:"white",shadow:"sm",borderColor:"border.default",children:[e.jsxs(r,{fontSize:"lg",fontWeight:"bold",mb:4,color:"fg.default",children:["TM Stores (",s.tmStores?.length||0,")"]}),e.jsxs(a,{gap:3,align:"stretch",overflow:"auto",children:[s.tmStores?.map((o,d)=>e.jsxs(t,{p:3,borderWidth:"1px",borderRadius:"md",borderColor:"border.subtle",bg:"bg.subtle",children:[e.jsxs(l,{justify:"space-between",align:"center",mb:2,children:[e.jsx(r,{fontSize:"sm",fontWeight:"semibold",color:"fg.default",children:o.id}),e.jsx(n,{variant:"subtle",colorPalette:"gray",fontSize:"xs",children:o.type})]}),e.jsxs(l,{gap:4,flexWrap:"wrap",fontSize:"xs",color:"fg.muted",children:[e.jsxs(r,{children:[e.jsx(r,{as:"span",fontWeight:"medium",children:"Access:"})," ",o.access]}),e.jsxs(r,{children:[e.jsx(r,{as:"span",fontWeight:"medium",children:"Partitioning:"})," ",o.partitioning]})]})]},d)),(!s.tmStores||s.tmStores.length===0)&&e.jsx(r,{fontSize:"sm",color:"fg.muted",children:"No TM stores configured"})]})]}),e.jsxs(t,{p:6,borderWidth:"1px",borderRadius:"lg",bg:"white",shadow:"sm",borderColor:"border.default",children:[e.jsxs(r,{fontSize:"lg",fontWeight:"bold",mb:4,color:"fg.default",children:["Providers (",s.providers?.length||0,")"]}),e.jsxs(a,{gap:3,align:"stretch",maxH:"300px",overflow:"auto",children:[s.providers?.map((o,d)=>e.jsx(t,{p:3,borderWidth:"1px",borderRadius:"md",borderColor:"border.subtle",bg:"bg.subtle",children:e.jsxs(l,{justify:"space-between",align:"center",children:[e.jsx(r,{fontSize:"sm",fontWeight:"semibold",color:"fg.default",children:o.id}),e.jsx(n,{variant:"subtle",colorPalette:"green",fontSize:"xs",children:o.type})]})},d)),(!s.providers||s.providers.length===0)&&e.jsx(r,{fontSize:"sm",color:"fg.muted",children:"No providers configured"})]})]}),e.jsxs(t,{p:6,borderWidth:"1px",borderRadius:"lg",bg:"white",shadow:"sm",borderColor:"border.default",children:[e.jsxs(r,{fontSize:"lg",fontWeight:"bold",mb:4,color:"fg.default",children:["Snap Stores (",s.snapStores?.length||0,")"]}),e.jsxs(a,{gap:3,align:"stretch",maxH:"300px",overflow:"auto",children:[s.snapStores?.map((o,d)=>e.jsx(t,{p:3,borderWidth:"1px",borderRadius:"md",borderColor:"border.subtle",bg:"bg.subtle",children:e.jsxs(l,{justify:"space-between",align:"center",children:[e.jsx(r,{fontSize:"sm",fontWeight:"semibold",color:"fg.default",children:o.id}),e.jsx(n,{variant:"subtle",colorPalette:"orange",fontSize:"xs",children:o.type})]})},d)),(!s.snapStores||s.snapStores.length===0)&&e.jsx(r,{fontSize:"sm",color:"fg.muted",children:"No snap stores configured"})]})]})]})]})})};export{w as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{j as e,C as pe,a as Se,T as r,B as t,F as S,b as oe,c as ne,d as ie,e as le,f as de,g as z,G as _,L as q,h as H,I as ye,u as we,V as w,r as y,i as G,A as ae,S as Q,k as re,l as ze,m as Ce,n as We,o as Te,p as Ae,q as ve,s as Pe,t as Re,v as L,D,w as I,x as k,y as B,z as F,E,H as U,J as N,K as Le}from"./vendor-BVSmEsOp.js";function ke({children:s}){return e.jsx(e.Fragment,{children:s})}async function V(s,l={}){try{const a=await fetch(s,l);if(!a.ok){let i;try{i=await a.json()}catch{}const n=i?.message||`HTTP error! status: ${a.status}`,c=new Error(n);throw c.status=a.status,c.response=a,c}return await a.json()}catch(a){if(console.error("API Fetch Error:",a),a.status||a.response)throw a;const i=new Error(a.message||"Network error");throw i.originalError=a,i}}const Be=({project:s})=>{const{projectName:l,pairSummary:a,pairSummaryByStatus:i,translationStatus:n}=s,c={translated:i?.translated||0,"in flight":i?.["in flight"]||0,"low quality":i?.["low quality"]||0,untranslated:i?.untranslated||0},h=Object.values(c).reduce((u,j)=>u+j,0),g=h>0?Math.round(c.translated/h*100):0,x=h>0?Math.round(c["in flight"]/h*100):0,d=h>0?Math.round(c["low quality"]/h*100):0,b=h>0?Math.round(c.untranslated/h*100):0;return e.jsx(pe,{variant:"outline",bg:"yellow.subtle",children:e.jsxs(Se,{children:[e.jsx(r,{fontSize:"sm",fontWeight:"semibold",mb:2,children:l}),e.jsx(t,{mb:3,children:e.jsxs(S,{align:"center",gap:2,mb:1,children:[e.jsxs(oe,{children:[e.jsx(ne,{asChild:!0,children:e.jsxs(t,{flex:"1",bg:"bg.muted",rounded:"full",height:"10px",cursor:"help",position:"relative",overflow:"hidden",children:[e.jsx(t,{position:"absolute",top:"0",left:"0",height:"100%",width:`${g}%`,bg:"green.solid",transition:"width 0.3s ease"}),e.jsx(t,{position:"absolute",top:"0",left:`${g}%`,height:"100%",width:`${x}%`,bg:"blue.solid",transition:"width 0.3s ease"}),e.jsx(t,{position:"absolute",top:"0",left:`${g+x}%`,height:"100%",width:`${d}%`,bg:"yellow.solid",transition:"width 0.3s ease"}),e.jsx(t,{position:"absolute",top:"0",left:`${g+x+d}%`,height:"100%",width:`${b}%`,bg:"red.solid",transition:"width 0.3s ease"})]})}),e.jsx(ie,{children:e.jsxs(le,{maxW:"300px",bg:"bg.default",borderWidth:"1px",borderColor:"border.default",shadow:"lg",zIndex:1e3,children:[e.jsx(de,{}),e.jsxs(t,{p:2,children:[e.jsx(r,{fontSize:"sm",fontWeight:"bold",mb:2,color:"fg.default",children:"Translation Status Details"}),n&&n.length>0?e.jsx(t,{children:n.map((u,j)=>{const C=u.q===null?"untranslated":u.q===0?"in flight":u.q>=u.minQ?"translated":"low quality",W=C==="translated"?"green.solid":C==="in flight"?"blue.solid":C==="low quality"?"yellow.solid":"red.solid";return e.jsxs(S,{align:"center",gap:2,mb:1,children:[e.jsx(t,{w:"8px",h:"8px",bg:W,borderRadius:"full"}),e.jsxs(r,{fontSize:"xs",color:"fg.default",children:["Q: ",u.q||"null"," | Segs: ",u.seg," | Words: ",u.words," | Chars: ",u.chars]})]},j)})}):e.jsxs(t,{children:[e.jsxs(S,{align:"center",gap:2,mb:1,children:[e.jsx(t,{w:"8px",h:"8px",bg:"green.solid",borderRadius:"full"}),e.jsxs(r,{fontSize:"xs",color:"fg.default",children:["Translated: ",c.translated]})]}),e.jsxs(S,{align:"center",gap:2,mb:1,children:[e.jsx(t,{w:"8px",h:"8px",bg:"blue.solid",borderRadius:"full"}),e.jsxs(r,{fontSize:"xs",color:"fg.default",children:["In Flight: ",c["in flight"]]})]}),e.jsxs(S,{align:"center",gap:2,mb:1,children:[e.jsx(t,{w:"8px",h:"8px",bg:"yellow.solid",borderRadius:"full"}),e.jsxs(r,{fontSize:"xs",color:"fg.default",children:["Low Quality: ",c["low quality"]]})]}),e.jsxs(S,{align:"center",gap:2,children:[e.jsx(t,{w:"8px",h:"8px",bg:"red.solid",borderRadius:"full"}),e.jsxs(r,{fontSize:"xs",color:"fg.default",children:["Untranslated: ",c.untranslated]})]})]})]})]})})]}),e.jsxs(r,{fontSize:"sm",color:"fg.muted",minW:"45px",children:[g,"%"]})]})}),e.jsxs(S,{gap:2,flexWrap:"wrap",align:"center",children:[e.jsxs(z,{variant:"subtle",colorPalette:"blue",children:["Segments: ",a?.segs?.toLocaleString()||"0"]}),e.jsxs(z,{variant:"subtle",colorPalette:"green",children:["Words: ",a?.words?.toLocaleString()||"0"]}),e.jsxs(z,{variant:"subtle",colorPalette:"purple",children:["Chars: ",a?.chars?.toLocaleString()||"0"]}),c.untranslated>0&&e.jsxs(z,{variant:"solid",colorPalette:"red",children:["Untranslated: ",c.untranslated.toLocaleString()]}),c["low quality"]>0&&e.jsxs(z,{variant:"solid",colorPalette:"orange",children:["Low Quality: ",c["low quality"].toLocaleString()]})]})]})})},Fe=({item:s,channelId:l})=>{const a=n=>{const c=new Date,h=new Date(n),g=c-h,x=Math.floor(g/1e3),d=new Intl.RelativeTimeFormat("en",{numeric:"auto",style:"short"});return x<60?d.format(-x,"second"):x<3600?d.format(-Math.floor(x/60),"minute"):x<86400?d.format(-Math.floor(x/3600),"hour"):x<2592e3?d.format(-Math.floor(x/86400),"day"):x<31536e3?d.format(-Math.floor(x/2592e3),"month"):d.format(-Math.floor(x/31536e3),"year")},i=n=>new Date(n).toLocaleString("en-US",{weekday:"long",year:"numeric",month:"long",day:"numeric",hour:"2-digit",minute:"2-digit",second:"2-digit",timeZoneName:"short"});return e.jsx(t,{p:3,borderWidth:"1px",borderRadius:"md",borderColor:"border.default",bg:"yellow.subtle",w:"100%",children:e.jsxs(_,{templateColumns:"2fr 80px 3fr 80px 80px 100px",gap:4,alignItems:"center",children:[e.jsxs(t,{children:[e.jsx(r,{fontSize:"xs",color:"fg.muted",mb:1,children:"Project"}),e.jsx(q,{as:H,to:`/sources/${l}/${s.prj??"default"}`,fontSize:"sm",fontWeight:"semibold",color:"blue.600",_hover:{textDecoration:"underline"},children:s.prj??"default"})]}),e.jsxs(t,{children:[e.jsx(r,{fontSize:"xs",color:"fg.muted",mb:1,children:"Source"}),e.jsx(z,{colorPalette:"blue",size:"sm",children:s.sourceLang})]}),e.jsxs(t,{children:[e.jsxs(r,{fontSize:"xs",color:"fg.muted",mb:1,children:["Targets (",s.targetLangs.length,")"]}),e.jsx(S,{wrap:"wrap",gap:1,children:s.targetLangs.map(n=>e.jsx(z,{colorPalette:"green",size:"sm",children:n},n))})]}),e.jsxs(t,{textAlign:"center",children:[e.jsx(r,{fontSize:"xs",color:"fg.muted",mb:1,children:"Resources"}),e.jsx(r,{fontSize:"sm",fontWeight:"bold",color:"orange.600",children:s.resCount.toLocaleString()})]}),e.jsxs(t,{textAlign:"center",children:[e.jsx(r,{fontSize:"xs",color:"fg.muted",mb:1,children:"Segments"}),e.jsx(r,{fontSize:"sm",fontWeight:"bold",color:"purple.600",children:s.segmentCount.toLocaleString()})]}),e.jsxs(t,{textAlign:"center",children:[e.jsx(r,{fontSize:"xs",color:"fg.muted",mb:1,children:"Modified"}),e.jsxs(oe,{children:[e.jsx(ne,{asChild:!0,children:e.jsx(r,{fontSize:"xs",color:"fg.muted",cursor:"help",children:a(s.lastModified)})}),e.jsx(ie,{children:e.jsxs(le,{children:[e.jsx(de,{}),e.jsx(r,{fontSize:"sm",children:i(s.lastModified)})]})})]})]})]})})},$e=(s,l)=>s?{snapText:`Snapped on ${new Date(s).toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"})}`,importText:l?{text:"Imported from snap store ",store:l}:null}:{snapText:"Never snapped",importText:null},Ee=({channelId:s,project:l,resource:a,onBackClick:i,backLabel:n="Back",snapTimestamp:c,snapStore:h,showSnapInfo:g=!1,extraContent:x=null})=>e.jsxs(t,{p:6,borderWidth:"2px",borderRadius:"lg",bg:"white",borderColor:"green.200",mb:6,children:[e.jsxs(t,{display:"flex",alignItems:"center",gap:3,flexWrap:"wrap",pb:4,borderBottom:"2px",borderColor:"green.100",children:[i&&e.jsx(ye,{"aria-label":n,onClick:i,variant:"ghost",size:"sm",children:"←"}),e.jsxs(t,{children:[e.jsx(r,{fontSize:"sm",color:"fg.muted",mb:1,children:"Channel"}),e.jsx(r,{fontSize:"lg",fontWeight:"bold",color:"green.600",children:s})]}),l&&e.jsxs(t,{children:[e.jsx(r,{fontSize:"sm",color:"fg.muted",mb:1,children:"Project"}),e.jsx(r,{fontSize:"lg",fontWeight:"semibold",color:"blue.600",children:l})]}),a&&e.jsxs(t,{flex:"1",children:[e.jsx(r,{fontSize:"sm",color:"fg.muted",mb:1,children:"Resource"}),e.jsx(r,{fontSize:"lg",fontWeight:"semibold",color:"purple.600",wordBreak:"break-all",children:a})]}),g&&!l&&!a&&e.jsx(t,{flex:"1",textAlign:"right",children:(()=>{const{snapText:d,importText:b}=$e(c,h);return e.jsxs(e.Fragment,{children:[e.jsx(r,{fontSize:"sm",color:"fg.muted",children:d}),b&&e.jsxs(r,{fontSize:"sm",color:"fg.muted",children:[b.text,e.jsx(r,{as:"span",fontWeight:"bold",color:"blue.600",children:b.store})]})]})})()})]}),x&&e.jsx(t,{mt:6,children:x})]});function se(s){if(!s)return null;const l=/(https:\/\/[^\s]+)/g;return s.split(l).map((i,n)=>i.match(l)?e.jsx(r,{as:"a",href:i,target:"_blank",rel:"noopener noreferrer",color:"blue.600",textDecoration:"underline",_hover:{color:"blue.800"},children:i},`link-${n}`):i)}const ce="tmCart",Me=()=>{const s=sessionStorage.getItem(ce);return s?JSON.parse(s):{}},Je=s=>{sessionStorage.setItem(ce,JSON.stringify(s)),window.dispatchEvent(new Event("cartUpdated"))},Oe=(s,l,a,i=null)=>({guid:s.guid,channel:i||s.channel,sourceLang:l,targetLang:a,nsrc:s.nsrc,ntgt:s.ntgt}),he=(s,l,a,i=null)=>{const n=Me(),c=`${s}|${l}`;n[c]||(n[c]={sourceLang:s,targetLang:l,tus:[]});const h=a.map(g=>Oe(g,s,l,i));n[c].tus.push(...h),Je(n)},Ue=he,Ne=(s,l,a,i)=>{he(s,l,i,a)},De=({sourceLang:s,targetLang:l,providers:a})=>{we();const i=n=>{switch(n){case"done":return"green";case"pending":return"yellow";case"error":return"red";default:return"gray"}};return e.jsx(t,{p:6,borderWidth:"1px",borderRadius:"lg",bg:"white",shadow:"sm",w:"100%",children:e.jsxs(w,{gap:4,align:"stretch",children:[e.jsx(t,{children:e.jsx(t,{mb:2,children:e.jsxs(q,{as:H,to:`/tm/${s}/${l}`,fontSize:"lg",fontWeight:"semibold",color:"blue.600",_hover:{textDecoration:"underline"},children:[s," → ",l]})})}),e.jsx(w,{gap:3,align:"stretch",children:a.map((n,c)=>e.jsx(t,{p:3,borderWidth:"1px",borderRadius:"md",borderColor:"border.default",bg:"yellow.subtle",children:e.jsxs(_,{templateColumns:{base:"minmax(0, 2fr) 1fr 1fr 1fr 1fr",md:"minmax(0, 3fr) 1fr 1fr 1fr 1fr"},gap:{base:1,md:2},alignItems:"center",overflow:"hidden",minWidth:"0",children:[e.jsxs(t,{minWidth:"0",overflow:"hidden",children:[e.jsx(r,{fontSize:"xs",color:"fg.muted",mb:1,children:"Provider"}),e.jsx(q,{as:H,to:`/tm/${s}/${l}?translationProvider=${encodeURIComponent(n.translationProvider)}`,fontSize:"sm",fontWeight:"semibold",color:"blue.600",_hover:{textDecoration:"underline",color:"blue.700"},noOfLines:1,title:n.translationProvider,children:n.translationProvider})]}),e.jsxs(t,{textAlign:"center",children:[e.jsx(r,{fontSize:"xs",color:"fg.muted",mb:1,children:"Status"}),e.jsx(z,{colorPalette:i(n.status),size:"sm",children:n.status})]}),e.jsxs(t,{textAlign:"center",children:[e.jsx(r,{fontSize:"xs",color:"fg.muted",mb:1,children:"TUs"}),e.jsx(r,{fontSize:"sm",fontWeight:"bold",color:"purple.600",children:n.tuCount.toLocaleString()})]}),e.jsxs(t,{textAlign:"center",children:[e.jsx(r,{fontSize:"xs",color:"fg.muted",mb:1,children:"Unique"}),e.jsx(r,{fontSize:"sm",fontWeight:"bold",color:"orange.600",children:n.distinctGuids.toLocaleString()})]}),e.jsxs(t,{textAlign:"center",children:[e.jsx(r,{fontSize:"xs",color:"fg.muted",mb:1,children:"Jobs"}),e.jsx(r,{fontSize:"sm",fontWeight:"bold",color:"teal.600",children:n.jobCount.toLocaleString()})]})]})},c))})]})})},qe=({sourceLang:s,targetLang:l})=>{const[a,i]=y.useState(!1),n=y.useRef(null);y.useEffect(()=>{const x=new IntersectionObserver(d=>{d.forEach(b=>{b.isIntersecting&&(i(!0),x.disconnect())})},{rootMargin:"200px",threshold:0});return n.current&&x.observe(n.current),()=>x.disconnect()},[]);const{data:c,isLoading:h,error:g}=G({queryKey:["tmStats",s,l],queryFn:()=>V(`/api/tm/stats/${s}/${l}`),enabled:a});return e.jsx(t,{ref:n,minH:"200px",children:g?e.jsx(ae,{status:"error",children:e.jsxs(t,{children:[e.jsxs(r,{fontWeight:"bold",children:["Error loading ",s," → ",l]}),e.jsx(r,{children:g.message||"Unknown error"})]})}):h?e.jsx(t,{display:"flex",justifyContent:"center",alignItems:"center",minH:"200px",p:6,borderWidth:"1px",borderRadius:"lg",bg:"white",shadow:"sm",children:e.jsx(Q,{size:"md"})}):c?e.jsx(De,{sourceLang:s,targetLang:l,providers:c}):a?e.jsx(t,{display:"flex",justifyContent:"center",alignItems:"center",minH:"200px",p:6,borderWidth:"1px",borderRadius:"lg",bg:"white",shadow:"sm",children:e.jsx(r,{color:"fg.muted",children:"No data available"})}):e.jsx(t,{display:"flex",justifyContent:"center",alignItems:"center",minH:"200px",p:6,borderWidth:"1px",borderRadius:"lg",bg:"gray.50",shadow:"sm",children:e.jsx(r,{color:"fg.muted",fontSize:"sm",children:"Scroll down to load..."})})})},He=({providers:s,selectedProvider:l,onProviderSelect:a})=>{const i=Array.isArray(s)?s:[];return e.jsxs(t,{width:"25%",flexShrink:0,borderRight:"1px",borderColor:"border.default",p:4,bg:"yellow.subtle",minH:"70vh",children:[e.jsx(r,{fontSize:"lg",fontWeight:"bold",mb:4,children:"Providers"}),e.jsxs(w,{gap:2,align:"stretch",children:[i.map(n=>{const c=typeof n=="object"&&n?.id?n.id:n,h=typeof n=="object"&&n?.id?n.id:n,g=typeof n=="object"&&n?.type?n.type:null;return e.jsxs(t,{p:3,borderRadius:"md",cursor:"pointer",bg:l===h?"blue.subtle":"white",borderWidth:"1px",borderColor:l===h?"blue.600":"border.default",_hover:{bg:l===h?"blue.subtle":"gray.subtle"},onClick:()=>a(h),children:[e.jsx(r,{fontSize:"sm",fontWeight:"medium",noOfLines:2,children:c}),g&&e.jsx(r,{fontSize:"xs",color:"fg.muted",mt:1,children:g})]},h)}),i.length===0&&e.jsx(r,{color:"fg.muted",fontSize:"sm",textAlign:"center",mt:4,children:"No providers found"})]})]})},_e=({providerId:s})=>{const{data:l,isLoading:a,error:i}=G({queryKey:["provider",s],queryFn:()=>V(`/api/providers/${s}`),enabled:!!s});if(!s)return e.jsx(t,{width:"75%",p:6,textAlign:"center",children:e.jsx(r,{color:"fg.muted",children:"Select a provider to view details"})});if(a)return e.jsx(t,{width:"75%",p:6,display:"flex",justifyContent:"center",alignItems:"center",children:e.jsx(Q,{size:"lg"})});if(i)return e.jsx(t,{width:"75%",p:6,children:e.jsx(ae,{status:"error",children:e.jsxs(t,{children:[e.jsx(r,{fontWeight:"bold",children:"Error"}),e.jsx(r,{children:i?.message||"Failed to fetch provider details"})]})})});if(!l)return e.jsx(t,{width:"75%",p:6,textAlign:"center",children:e.jsx(r,{color:"fg.muted",children:"Provider not found"})});const{info:n,properties:c}=l,h=d=>{if(!d)return d;const b={31:"#ef4444",32:"#22c55e",33:"#eab308",34:"#3b82f6",35:"#a855f7",36:"#06b6d4",39:"inherit"},u=[];let j=0,C="inherit";const W=/\u001B\[([0-9;]*)m/g;let p;for(;(p=W.exec(d))!==null;){if(p.index>j){const J=d.slice(j,p.index);u.push(e.jsx("span",{style:{color:C},children:J},`${j}-text`))}const T=p[1];b[T]&&(C=b[T]),j=p.index+p[0].length}if(j<d.length){const T=d.slice(j);u.push(e.jsx("span",{style:{color:C},children:T},`${j}-text`))}return u.length>0?u:d},g=d=>Array.isArray(d)?d.map((b,u)=>e.jsxs(t,{display:"flex",alignItems:"flex-start",gap:2,children:[e.jsx(r,{fontSize:"sm",color:"fg.muted",mt:"1px",children:"•"}),e.jsx(r,{fontSize:"sm",flex:"1",children:h(b)})]},u)):e.jsx(r,{fontSize:"sm",children:h(d)}),x=d=>typeof d=="object"&&d!==null?!Array.isArray(d)&&Object.values(d).every(u=>typeof u=="string")&&Object.keys(d).length>0?e.jsx(t,{borderWidth:"1px",borderRadius:"md",overflow:"hidden",bg:"white",shadow:"sm",children:e.jsxs(t,{as:"table",w:"100%",fontSize:"sm",children:[e.jsx(t,{as:"thead",bg:"blue.subtle",borderBottom:"1px",borderColor:"border.default",children:e.jsxs(t,{as:"tr",children:[e.jsx(t,{as:"th",p:2,textAlign:"left",fontWeight:"semibold",color:"blue.600",children:"Key"}),e.jsx(t,{as:"th",p:2,textAlign:"left",fontWeight:"semibold",color:"blue.600",children:"Value"})]})}),e.jsx(t,{as:"tbody",children:Object.entries(d).sort(([u],[j])=>u.localeCompare(j)).map(([u,j])=>e.jsxs(t,{as:"tr",_hover:{bg:"gray.subtle"},children:[e.jsx(t,{as:"td",p:2,borderBottom:"1px",borderColor:"border.subtle",fontFamily:"mono",fontSize:"xs",children:u}),e.jsx(t,{as:"td",p:2,borderBottom:"1px",borderColor:"border.subtle",fontSize:"xs",children:j})]},u))})]})}):e.jsx(t,{as:"pre",fontSize:"xs",bg:"bg.muted",p:2,borderRadius:"md",overflow:"auto",maxH:"200px",children:JSON.stringify(d,null,2)}):e.jsx(r,{fontSize:"sm",children:String(d)});return e.jsx(t,{width:"75%",p:6,overflow:"auto",children:e.jsxs(w,{gap:6,align:"stretch",children:[e.jsx(t,{children:e.jsx(r,{fontSize:"2xl",fontWeight:"bold",mb:2,children:s})}),e.jsxs(t,{p:4,borderWidth:"1px",borderRadius:"lg",bg:"white",shadow:"sm",children:[e.jsx(r,{fontSize:"lg",fontWeight:"semibold",mb:4,children:"Properties"}),Object.keys(c).length===0?e.jsx(r,{color:"fg.muted",fontSize:"sm",children:"No properties available"}):e.jsx(w,{gap:4,align:"stretch",children:Object.entries(c).sort(([d],[b])=>d.localeCompare(b)).map(([d,b])=>e.jsxs(t,{children:[e.jsxs(r,{fontSize:"sm",fontWeight:"bold",color:"blue.600",mb:2,children:[d,":"]}),e.jsx(t,{pl:4,children:x(b)})]},d))})]}),e.jsxs(t,{p:4,borderWidth:"1px",borderRadius:"lg",bg:"white",shadow:"sm",children:[e.jsx(r,{fontSize:"lg",fontWeight:"semibold",mb:4,children:"Information"}),e.jsxs(_,{templateColumns:"auto 1fr",gap:3,alignItems:"start",children:[e.jsx(r,{fontSize:"sm",fontWeight:"bold",color:"blue.600",children:"Type:"}),e.jsx(z,{colorPalette:"blue",size:"sm",children:n.type}),e.jsx(r,{fontSize:"sm",fontWeight:"bold",color:"blue.600",children:"Cost per Word:"}),e.jsx(r,{fontSize:"sm",children:n.costPerWord}),e.jsx(r,{fontSize:"sm",fontWeight:"bold",color:"blue.600",children:"Cost per MChar:"}),e.jsx(r,{fontSize:"sm",children:n.costPerMChar}),n.description&&e.jsxs(e.Fragment,{children:[e.jsx(r,{fontSize:"sm",fontWeight:"bold",color:"blue.600",children:"Description:"}),e.jsx(t,{children:g(n.description)})]})]})]})]})})},Ge=({langPairKey:s,tus:l,onRemoveTU:a})=>{const[i,n]=y.useState(""),[c,h]=y.useState(!1),[g,x]=y.useState(!1),[d,b]=y.useState(null),[u,j]=y.useState(""),[C,W]=y.useState(""),[p,T]=y.useState(null),[J,K]=y.useState(!1),{data:xe={},isLoading:ue}=G({queryKey:["info"],queryFn:()=>V("/api/info")}),fe=xe.providers||[],Y=re({mutationFn:async({sourceLang:o,targetLang:f,tus:m,providerList:v})=>{const P=await fetch("/api/dispatcher/createJobs",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({sourceLang:o,targetLang:f,tus:m,providerList:v})});if(!P.ok){const R=await P.json();throw new Error(R.message||"Failed to create jobs")}return P.json()}}),O=re({mutationFn:async({jobs:o,instructions:f})=>{const m=await fetch("/api/dispatcher/startJobs",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({jobs:o,instructions:f})});if(!m.ok){const v=await m.json();throw new Error(v.message||"Failed to start jobs")}return m.json()}});function Z(o){return o.map(f=>typeof f=="string"?f:`{{${f.t}}}`).join("")}const ge=async()=>{if(!i){alert("Please select a provider first");return}const o=Array.isArray(l)?l:l.tus,f=typeof i=="object"&&i?.id?i.id:i;try{const m=o.map(R=>({channel:R.channel,guid:R.guid})),P=(await Y.mutateAsync({sourceLang:$,targetLang:M,tus:m,providerList:[f]})).find(R=>R.translationProvider===f);P?(b(P),j(""),h(!0)):(W(`Provider "${f}" did not accept any of the selected translation units.`),x(!0))}catch(m){W(`Failed to create job: ${m.message}`),x(!0)}},be=o=>{n(o)},je=async()=>{if(d)try{const o=await O.mutateAsync({jobs:[d],instructions:u||void 0}),f=o.find(m=>m.jobGuid===d.jobGuid)||o[0];T(f),h(!1),K(!0)}catch(o){W(`Failed to start job: ${o.message}`),x(!0)}},X=()=>{if(K(!1),T(null),b(null),j(""),d&&d.tus){const o=new Set(d.tus.map(m=>m.guid)),f=Array.isArray(l)?l:l.tus;for(let m=f.length-1;m>=0;m--)o.has(f[m].guid)&&a(s,m)}},me=o=>o===0?"Free":o==null?"Unknown":`$${o.toFixed(2)}`,A=Array.isArray(l)?l:l.tus,$=Array.isArray(l)?s.split("|")[0]||s.split("→")[0]:l.sourceLang,M=Array.isArray(l)?s.split("|")[1]||s.split("→").slice(1).join("→"):l.targetLang,ee=A.some(o=>o.ntgt!==void 0),te=A.some(o=>o.channel!==void 0);return e.jsxs(t,{p:6,borderWidth:"1px",borderRadius:"lg",bg:"white",shadow:"sm",children:[e.jsxs(w,{gap:4,align:"stretch",children:[e.jsx(t,{children:e.jsxs(S,{align:"center",justify:"space-between",mb:2,children:[e.jsxs(S,{align:"center",gap:3,children:[e.jsx(z,{colorPalette:"blue",size:"sm",children:$}),e.jsx(r,{color:"fg.muted",fontSize:"lg",children:"→"}),e.jsx(z,{colorPalette:"green",size:"sm",children:M}),e.jsxs(S,{align:"center",gap:3,ml:4,children:[e.jsxs(ze,{size:"sm",width:"250px",value:i?[i]:[],onValueChange:o=>{},positioning:{strategy:"absolute",placement:"bottom-start",flip:!0,gutter:4},children:[e.jsxs(Ce,{children:[e.jsx(r,{fontSize:"sm",flex:"1",textAlign:"left",children:typeof i=="object"&&i?.id?i.id:i||"Select Provider"}),e.jsx(We,{})]}),e.jsx(Te,{children:e.jsx(Ae,{zIndex:1e3,bg:"white",borderWidth:"1px",borderColor:"border.default",borderRadius:"md",shadow:"lg",minW:"250px",maxH:"200px",overflow:"auto",children:ue?e.jsxs(t,{p:3,textAlign:"center",children:[e.jsx(Q,{size:"sm"}),e.jsx(r,{fontSize:"sm",color:"fg.muted",mt:2,children:"Loading providers..."})]}):fe.slice().sort((o,f)=>{const m=typeof o=="object"&&o?.id?o.id:o,v=typeof f=="object"&&f?.id?f.id:f;return m.localeCompare(v)}).map((o,f)=>e.jsxs(ve,{item:o,value:o,onClick:()=>be(o),children:[e.jsx(Pe,{children:typeof o=="object"&&o?.id?o.id:o}),e.jsx(Re,{})]},`provider-${f}-${typeof o=="string"?o:JSON.stringify(o)}`))})})]}),e.jsx(L,{size:"sm",colorPalette:"blue",onClick:ge,disabled:!i,loading:Y.isPending,children:"Create Job"})]})]}),e.jsxs(r,{fontSize:"sm",color:"fg.muted",children:[A.length," ",A.length===1?"TU":"TUs"]})]})}),e.jsx(t,{bg:"white",borderRadius:"md",overflow:"auto",children:e.jsxs(t,{as:"table",w:"100%",fontSize:"sm",children:[e.jsx(t,{as:"thead",bg:"blue.subtle",borderBottom:"2px",borderColor:"blue.muted",shadow:"sm",children:e.jsxs(t,{as:"tr",children:[e.jsx(t,{as:"th",p:3,borderBottom:"1px",borderColor:"border.default",textAlign:"left",minW:"120px",children:e.jsx(r,{fontSize:"sm",fontWeight:"bold",color:"blue.600",children:"GUID"})}),te&&e.jsx(t,{as:"th",p:3,borderBottom:"1px",borderColor:"border.default",textAlign:"left",minW:"120px",children:e.jsx(r,{fontSize:"sm",fontWeight:"bold",color:"blue.600",children:"CHANNEL"})}),e.jsx(t,{as:"th",p:3,borderBottom:"1px",borderColor:"border.default",textAlign:"left",minW:"350px",children:e.jsx(r,{fontSize:"sm",fontWeight:"bold",color:"blue.600",children:"SOURCE"})}),ee&&e.jsx(t,{as:"th",p:3,borderBottom:"1px",borderColor:"border.default",textAlign:"left",minW:"350px",children:e.jsx(r,{fontSize:"sm",fontWeight:"bold",color:"blue.600",children:"TARGET"})}),e.jsx(t,{as:"th",p:3,borderBottom:"1px",borderColor:"border.default",textAlign:"center",minW:"100px",children:e.jsx(r,{fontSize:"sm",fontWeight:"bold",color:"blue.600",children:"ACTION"})})]})}),e.jsx(t,{as:"tbody",children:A.map((o,f)=>e.jsxs(t,{as:"tr",_hover:{bg:"gray.subtle"},children:[e.jsx(t,{as:"td",p:3,borderBottom:"1px",borderColor:"border.subtle",children:e.jsx(r,{fontSize:"xs",fontFamily:"mono",color:"blue.600",userSelect:"all",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",maxW:"100px",children:o.guid})}),te&&e.jsx(t,{as:"td",p:3,borderBottom:"1px",borderColor:"border.subtle",children:e.jsx(r,{fontSize:"xs",children:o.channel||""})}),e.jsx(t,{as:"td",p:3,borderBottom:"1px",borderColor:"border.subtle",children:e.jsx(r,{fontSize:"xs",noOfLines:2,dir:$?.startsWith("he")||$?.startsWith("ar")?"rtl":"ltr",children:Array.isArray(o.nsrc)?Z(o.nsrc):o.nsrc})}),ee&&e.jsx(t,{as:"td",p:3,borderBottom:"1px",borderColor:"border.subtle",children:e.jsx(r,{fontSize:"xs",noOfLines:2,dir:M?.startsWith("he")||M?.startsWith("ar")?"rtl":"ltr",children:Array.isArray(o.ntgt)?Z(o.ntgt):o.ntgt||""})}),e.jsx(t,{as:"td",p:3,borderBottom:"1px",borderColor:"border.subtle",textAlign:"center",children:e.jsx(L,{size:"xs",colorPalette:"red",variant:"outline",onClick:()=>a(s,f),children:"Remove"})})]},`cart-tu-${f}-${typeof o.guid=="string"?o.guid:o.nid||f}`))})]})})]}),e.jsxs(D,{open:c,onOpenChange:o=>h(o.open),children:[e.jsx(I,{}),e.jsx(k,{children:e.jsxs(B,{maxW:"500px",children:[e.jsxs(F,{children:[e.jsx(E,{children:"Job Created Successfully"}),e.jsx(U,{})]}),e.jsx(N,{children:d&&e.jsxs(w,{gap:4,align:"stretch",children:[e.jsxs(t,{children:[e.jsxs(r,{fontSize:"lg",fontWeight:"bold",color:"green.600",mb:3,children:[d.tus?.length||0," TUs accepted out of ",A.length," sent"]}),e.jsxs(w,{gap:2,align:"stretch",children:[e.jsxs(t,{children:[e.jsx(r,{fontSize:"sm",fontWeight:"semibold",color:"fg.default",display:"inline",children:"Provider: "}),e.jsx(r,{fontSize:"sm",color:"blue.600",fontFamily:"mono",display:"inline",children:typeof i=="object"&&i?.id?i.id:i})]}),e.jsxs(t,{children:[e.jsx(r,{fontSize:"sm",fontWeight:"semibold",color:"fg.default",display:"inline",children:"Estimated Cost: "}),e.jsx(r,{fontSize:"sm",color:"green.600",fontWeight:"medium",display:"inline",children:me(d.estimatedCost)})]}),d.statusDescription&&e.jsxs(t,{children:[e.jsx(r,{fontSize:"sm",fontWeight:"semibold",color:"fg.default",display:"inline",children:"Status: "}),e.jsx(r,{fontSize:"sm",color:"fg.muted",display:"inline",children:se(d.statusDescription)})]})]})]}),e.jsxs(t,{children:[e.jsx(r,{fontSize:"sm",fontWeight:"bold",mb:2,children:"Job Instructions (optional):"}),e.jsx(Le,{placeholder:"Enter any specific instructions for this translation job...",value:u,onChange:o=>j(o.target.value),rows:3})]}),e.jsxs(S,{gap:3,children:[e.jsx(L,{colorPalette:"gray",variant:"outline",onClick:()=>{h(!1),b(null),j("")},flex:"1",disabled:O.isPending,children:"Cancel"}),e.jsx(L,{colorPalette:"green",onClick:je,loading:O.isPending,flex:"1",children:"Push Job"})]})]})})]})})]}),e.jsxs(D,{open:g,onOpenChange:o=>x(o.open),children:[e.jsx(I,{}),e.jsx(k,{children:e.jsxs(B,{maxW:"400px",children:[e.jsxs(F,{children:[e.jsx(E,{children:"Job Creation Failed"}),e.jsx(U,{})]}),e.jsx(N,{children:e.jsxs(w,{gap:4,align:"stretch",children:[e.jsx(r,{color:"red.600",children:C}),e.jsx(L,{colorPalette:"red",onClick:()=>x(!1),w:"100%",children:"Close"})]})})]})})]}),e.jsxs(D,{open:J,onOpenChange:o=>{o.open||X()},children:[e.jsx(I,{}),e.jsx(k,{children:e.jsxs(B,{maxW:"400px",children:[e.jsxs(F,{children:[e.jsx(E,{children:"Job Started Successfully"}),e.jsx(U,{})]}),e.jsx(N,{children:p&&e.jsxs(w,{gap:4,align:"stretch",children:[e.jsx(t,{children:e.jsxs(w,{gap:2,align:"stretch",children:[e.jsxs(t,{children:[e.jsx(r,{fontSize:"sm",fontWeight:"semibold",color:"fg.default",display:"inline",children:"Job ID: "}),e.jsx(r,{fontSize:"sm",fontFamily:"mono",color:"blue.600",cursor:"pointer",_hover:{textDecoration:"underline"},onClick:o=>{o.preventDefault(),window.open(`/job/${p.jobGuid}`,"_blank")},display:"inline",children:p.jobGuid})]}),e.jsxs(t,{children:[e.jsx(r,{fontSize:"sm",fontWeight:"semibold",color:"fg.default",display:"inline",children:"Provider: "}),e.jsx(r,{fontSize:"sm",color:"blue.600",fontFamily:"mono",display:"inline",children:p.translationProvider})]}),e.jsxs(t,{children:[e.jsx(r,{fontSize:"sm",fontWeight:"semibold",color:"fg.default",display:"inline",children:"Language Pair: "}),e.jsxs(r,{fontSize:"sm",color:"purple.600",fontWeight:"medium",display:"inline",children:[p.sourceLang," → ",p.targetLang]})]}),e.jsxs(t,{children:[e.jsx(r,{fontSize:"sm",fontWeight:"semibold",color:"fg.default",display:"inline",children:"Status: "}),e.jsx(r,{fontSize:"sm",fontWeight:"bold",color:p.status==="completed"?"green.600":"orange.600",display:"inline",children:p.status.toUpperCase()})]}),p.statusDescription&&e.jsxs(t,{children:[e.jsx(r,{fontSize:"sm",fontWeight:"semibold",color:"fg.default",mb:1,children:"Description:"}),e.jsx(r,{fontSize:"sm",color:"fg.muted",pl:2,borderLeft:"2px",borderColor:"blue.200",children:se(p.statusDescription)})]})]})}),e.jsx(t,{children:e.jsx(L,{colorPalette:"blue",onClick:X,w:"100%",children:"Close & Remove TUs from Cart"})})]})})]})})]})]})};export{ke as C,qe as L,Be as P,Fe as S,Ee as a,Ne as b,Ue as c,He as d,_e as e,V as f,Ge as g,se as r};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/Welcome-Bd1y86xQ.js","assets/vendor-BVSmEsOp.js","assets/index-Dl1WS_Lc.js","assets/Status-C_qyyf2l.js","assets/StatusDetail-CXE95RTb.js","assets/Sources-DcwZBkaA.js","assets/SourcesDetail-11v96V44.js","assets/SourcesResource-CPGv3HQ8.js","assets/TM-DIDYSCIe.js","assets/TMDetail-BmHvlsJe.js","assets/Providers-UAlXnJQI.js","assets/Cart-B_Zkvuz_.js","assets/Job-B2D10u5q.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{j as e,M as P,T as m,v as R,h as f,r as n,Q as z,N as C,O,R as T,P as l,B as c,S as E,u as w,U as A,F as _,W as D,X as I,Y as W,Z as M,_ as N}from"./vendor-BVSmEsOp.js";import{C as V}from"./index-Dl1WS_Lc.js";(function(){const x=document.createElement("link").relList;if(x&&x.supports&&x.supports("modulepreload"))return;for(const r of document.querySelectorAll('link[rel="modulepreload"]'))j(r);new MutationObserver(r=>{for(const t of r)if(t.type==="childList")for(const s of t.addedNodes)s.tagName==="LINK"&&s.rel==="modulepreload"&&j(s)}).observe(document,{childList:!0,subtree:!0});function h(r){const t={};return r.integrity&&(t.integrity=r.integrity),r.referrerPolicy&&(t.referrerPolicy=r.referrerPolicy),r.crossOrigin==="use-credentials"?t.credentials="include":r.crossOrigin==="anonymous"?t.credentials="omit":t.credentials="same-origin",t}function j(r){if(r.ep)return;r.ep=!0;const t=h(r);fetch(r.href,t)}})();const U="modulepreload",B=function(g){return"/"+g},v={},d=function(x,h,j){let r=Promise.resolve();if(h&&h.length>0){let y=function(i){return Promise.all(i.map(a=>Promise.resolve(a).then(b=>({status:"fulfilled",value:b}),b=>({status:"rejected",reason:b}))))};document.getElementsByTagName("link");const s=document.querySelector("meta[property=csp-nonce]"),o=s?.nonce||s?.getAttribute("nonce");r=y(h.map(i=>{if(i=B(i),i in v)return;v[i]=!0;const a=i.endsWith(".css"),b=a?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${i}"]${b}`))return;const p=document.createElement("link");if(p.rel=a?"stylesheet":U,a||(p.as="script"),p.crossOrigin="",p.href=i,o&&p.setAttribute("nonce",o),document.head.appendChild(p),a)return new Promise((S,L)=>{p.addEventListener("load",S),p.addEventListener("error",()=>L(new Error(`Unable to preload CSS for ${i}`)))})}))}function t(s){const o=new Event("vite:preloadError",{cancelable:!0});if(o.payload=s,window.dispatchEvent(o),!o.defaultPrevented)throw s}return r.then(s=>{for(const o of s||[])o.status==="rejected"&&t(o.reason);return x().catch(t)})},q=()=>e.jsxs(P,{maxWidth:"sm",textAlign:"center",mt:20,children:[e.jsx(m,{fontSize:"6xl",fontWeight:"bold",mb:4,children:"404"}),e.jsx(m,{fontSize:"2xl",fontWeight:"medium",mb:2,children:"Page Not Found"}),e.jsx(m,{color:"fg.muted",mb:8,children:"Sorry, the page you are looking for does not exist."}),e.jsx(R,{asChild:!0,colorPalette:"brand",size:"lg",children:e.jsx(f,{to:"/",children:"Go to Home"})})]}),F=n.lazy(()=>d(()=>import("./Welcome-Bd1y86xQ.js"),__vite__mapDeps([0,1,2]))),H=n.lazy(()=>d(()=>import("./Status-C_qyyf2l.js"),__vite__mapDeps([3,1,2]))),k=n.lazy(()=>d(()=>import("./StatusDetail-CXE95RTb.js"),__vite__mapDeps([4,1,2]))),Q=n.lazy(()=>d(()=>import("./Sources-DcwZBkaA.js"),__vite__mapDeps([5,1,2]))),$=n.lazy(()=>d(()=>import("./SourcesDetail-11v96V44.js"),__vite__mapDeps([6,1,2]))),G=n.lazy(()=>d(()=>import("./SourcesResource-CPGv3HQ8.js"),__vite__mapDeps([7,1,2]))),J=n.lazy(()=>d(()=>import("./TM-DIDYSCIe.js"),__vite__mapDeps([8,1,2]))),K=n.lazy(()=>d(()=>import("./TMDetail-BmHvlsJe.js"),__vite__mapDeps([9,1,2]))),X=n.lazy(()=>d(()=>import("./Providers-UAlXnJQI.js"),__vite__mapDeps([10,1,2]))),Y=n.lazy(()=>d(()=>import("./Cart-B_Zkvuz_.js"),__vite__mapDeps([11,1,2]))),Z=n.lazy(()=>d(()=>import("./Job-B2D10u5q.js"),__vite__mapDeps([12,1,2])));function u({children:g}){w();const x=A(),[h,j]=n.useState(0),r=()=>{try{const s=sessionStorage.getItem("tmCart");if(s){const o=JSON.parse(s),y=Object.values(o).reduce((i,a)=>Array.isArray(a)?i+a.length:i+(a.tus?a.tus.length:0),0);j(y)}else j(0)}catch{j(0)}};n.useEffect(()=>{r();const s=()=>r(),o=()=>r();return window.addEventListener("storage",s),window.addEventListener("cartUpdated",o),()=>{window.removeEventListener("storage",s),window.removeEventListener("cartUpdated",o)}},[]);const t=s=>s==="/"?x.pathname==="/":x.pathname.startsWith(s);return e.jsxs(c,{minH:"100vh",bg:"bg.muted",children:[e.jsx(c,{bg:"white",borderBottom:"1px",borderColor:"border.default",children:e.jsx(c,{px:6,py:3,children:e.jsxs(_,{align:"center",justify:"space-between",children:[e.jsxs(_,{align:"center",gap:3,children:[e.jsx("img",{src:"/logo.svg",alt:"L10n Monster",width:"32",height:"32"}),e.jsx(D,{size:"lg",color:"fg.default",children:"L10n Monster"})]}),e.jsxs(_,{align:"center",gap:4,css:{"& a":{textDecoration:"none",color:"inherit"}},children:[e.jsx(f,{to:"/",children:e.jsx(c,{cursor:"pointer",px:3,py:1,borderRadius:"md",bg:t("/")?"blue.subtle":"transparent",_hover:{bg:t("/")?"blue.subtle":"gray.subtle"},children:e.jsx(m,{fontSize:"md",fontWeight:"medium",children:"Home"})})}),e.jsx(f,{to:"/status",children:e.jsx(c,{cursor:"pointer",px:3,py:1,borderRadius:"md",bg:t("/status")?"blue.subtle":"transparent",_hover:{bg:t("/status")?"blue.subtle":"gray.subtle"},children:e.jsx(m,{fontSize:"md",fontWeight:"medium",children:"Status"})})}),e.jsx(f,{to:"/sources",children:e.jsx(c,{cursor:"pointer",px:3,py:1,borderRadius:"md",bg:t("/sources")?"blue.subtle":"transparent",_hover:{bg:t("/sources")?"blue.subtle":"gray.subtle"},children:e.jsx(m,{fontSize:"md",fontWeight:"medium",children:"Sources"})})}),e.jsx(f,{to:"/tm",children:e.jsx(c,{cursor:"pointer",px:3,py:1,borderRadius:"md",bg:t("/tm")?"blue.subtle":"transparent",_hover:{bg:t("/tm")?"blue.subtle":"gray.subtle"},children:e.jsx(m,{fontSize:"md",fontWeight:"medium",children:"TM"})})}),e.jsx(f,{to:"/providers",children:e.jsx(c,{cursor:"pointer",px:3,py:1,borderRadius:"md",bg:t("/providers")?"blue.subtle":"transparent",_hover:{bg:t("/providers")?"blue.subtle":"gray.subtle"},children:e.jsx(m,{fontSize:"md",fontWeight:"medium",children:"Providers"})})})]}),e.jsx(f,{to:"/cart",css:{textDecoration:"none",color:"inherit"},children:e.jsxs(_,{align:"center",gap:2,px:3,py:1,bg:t("/cart")?"blue.subtle":h>0?"blue.muted":"gray.muted",borderRadius:"md",cursor:"pointer",_hover:{bg:"blue.subtle"},children:[e.jsx(c,{fontSize:"lg",children:"🛒"}),e.jsxs(m,{fontSize:"md",fontWeight:"medium",children:[h," ",h===1?"TU":"TUs"]})]})})]})})}),e.jsx(n.Suspense,{fallback:e.jsx(c,{display:"flex",justifyContent:"center",mt:10,children:e.jsx(E,{size:"xl"})}),children:g})]})}const ee=new z({defaultOptions:{queries:{staleTime:300*1e3,gcTime:600*1e3}}});function te(){return e.jsx(C,{client:ee,children:e.jsx(O,{children:e.jsx(n.Suspense,{fallback:e.jsx(c,{display:"flex",justifyContent:"center",alignItems:"center",minH:"100vh",children:e.jsx(E,{size:"xl"})}),children:e.jsxs(T,{children:[e.jsx(l,{path:"/job/:jobGuid",element:e.jsx(Z,{})}),e.jsx(l,{path:"/",element:e.jsx(u,{children:e.jsx(F,{})})}),e.jsx(l,{path:"/status",element:e.jsx(u,{children:e.jsx(H,{})})}),e.jsx(l,{path:"/status/:channelId/:sourceLang/:targetLang",element:e.jsx(u,{children:e.jsx(k,{})})}),e.jsx(l,{path:"/sources",element:e.jsx(u,{children:e.jsx(Q,{})})}),e.jsx(l,{path:"/sources/:channelId/:prj",element:e.jsx(u,{children:e.jsx($,{})})}),e.jsx(l,{path:"/sources/:channelId",element:e.jsx(u,{children:e.jsx(G,{})})}),e.jsx(l,{path:"/tm",element:e.jsx(u,{children:e.jsx(J,{})})}),e.jsx(l,{path:"/tm/:sourceLang/:targetLang",element:e.jsx(u,{children:e.jsx(K,{})})}),e.jsx(l,{path:"/providers",element:e.jsx(u,{children:e.jsx(X,{})})}),e.jsx(l,{path:"/cart",element:e.jsx(u,{children:e.jsx(Y,{})})}),e.jsx(l,{path:"*",element:e.jsx(q,{})})]})})})})}const re=I.createRoot(document.getElementById("root"));re.render(e.jsx(W.StrictMode,{children:e.jsx(M,{value:N,children:e.jsx(V,{children:e.jsx(te,{})})})}));
|