@l10nmonster/server 3.0.0-alpha.15 → 3.0.0-alpha.17

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.
@@ -11,9 +11,9 @@
11
11
  />
12
12
  <link rel="manifest" href="/manifest.json" />
13
13
  <title>L10n Monster</title>
14
- <script type="module" crossorigin src="/assets/index-HzbF4bPY.js"></script>
15
- <link rel="modulepreload" crossorigin href="/assets/vendor-BVSmEsOp.js">
16
- <link rel="modulepreload" crossorigin href="/assets/index-Dl1WS_Lc.js">
14
+ <script type="module" crossorigin src="/assets/index-a-xKpg48.js"></script>
15
+ <link rel="modulepreload" crossorigin href="/assets/vendor-BAKw9_tP.js">
16
+ <link rel="modulepreload" crossorigin href="/assets/index-CuIl8QRT.js">
17
17
  <link rel="stylesheet" crossorigin href="/assets/index-CIfVvUo9.css">
18
18
  </head>
19
19
  <body>
@@ -1 +0,0 @@
1
- import{a8 as C,r as F,i as R,j as e,B as n,S as L,T as r,A as T,V as x,F as c,$ as w,g as f,v as D,a6 as N,a7 as U}from"./vendor-BVSmEsOp.js";import{f as B}from"./index-Dl1WS_Lc.js";function W(i){return i.map(a=>typeof a=="string"?a:`{{${a.t}}}`).join("")}function u(i){return new Date(i).toLocaleString("en-US",{year:"numeric",month:"short",day:"numeric",hour:"2-digit",minute:"2-digit",second:"2-digit"})}function J(i){return i===0?"Free":i==null?"Unknown":`$${i.toFixed(2)}`}function G(i){if(!i)return null;const a=/(https:\/\/[^\s]+)/g;return i.split(a).map((s,j)=>s.match(a)?e.jsx(r,{as:"a",href:s,target:"_blank",rel:"noopener noreferrer",color:"blue.600",textDecoration:"underline",_hover:{color:"blue.800"},children:s},j):s)}const $=()=>{const{jobGuid:i}=C(),[a,p]=F.useState({}),{data:s,isLoading:j,error:S}=R({queryKey:["job",i],queryFn:()=>B(`/api/tm/job/${i}`),retry:(t,o)=>o?.status===404?!1:t<3});if(j)return e.jsx(n,{display:"flex",justifyContent:"center",mt:10,children:e.jsx(L,{size:"xl"})});if(S)return e.jsx(n,{mt:5,px:6,children:e.jsxs(n,{p:4,bg:"red.subtle",borderRadius:"md",borderWidth:"1px",borderColor:"red.muted",children:[e.jsx(r,{fontWeight:"bold",color:"red.600",mb:2,children:"Error"}),e.jsx(r,{color:"red.600",children:S?.message||"Failed to fetch job data"})]})});if(!s)return e.jsx(n,{mt:5,px:6,children:e.jsx(T,{status:"warning",children:e.jsxs(n,{children:[e.jsx(r,{fontWeight:"bold",children:"Job Not Found"}),e.jsxs(r,{children:["Job with GUID ",i," was not found."]})]})})});const P=t=>{switch(t?.toLowerCase()){case"done":case"completed":return"green";case"failed":case"error":return"red";case"in-progress":case"running":return"orange";default:return"gray"}},A=(t,o)=>{const h=new Set(["jobGuid","guid","rid","sid","nsrc","ntgt","notes","q","prj"]),b=Object.entries(t).filter(([l])=>!h.has(l)),y=t.guid||o,m=a[y]||!1;return e.jsx(n,{p:4,borderWidth:"1px",borderRadius:"lg",bg:"white",shadow:"sm",mb:4,children:e.jsxs(x,{gap:3,align:"stretch",children:[e.jsx(c,{justify:"space-between",align:"start",wrap:"wrap",children:e.jsxs(x,{gap:1,align:"stretch",children:[e.jsxs(c,{align:"center",gap:2,children:[e.jsx(r,{fontSize:"xs",fontWeight:"bold",color:"fg.muted",children:"GUID:"}),e.jsx(r,{fontSize:"xs",fontFamily:"mono",color:"blue.600",wordBreak:"break-all",children:t.guid})]}),t.rid&&e.jsxs(c,{align:"center",gap:2,children:[e.jsx(r,{fontSize:"xs",fontWeight:"bold",color:"fg.muted",children:"RID:"}),e.jsx(r,{fontSize:"xs",fontFamily:"mono",color:"blue.600",wordBreak:"break-all",children:t.rid})]}),t.sid&&e.jsxs(c,{align:"center",gap:2,children:[e.jsx(r,{fontSize:"xs",fontWeight:"bold",color:"fg.muted",children:"SID:"}),e.jsx(r,{fontSize:"xs",fontFamily:"mono",color:"blue.600",children:t.sid})]})]})}),e.jsxs(n,{children:[e.jsx(r,{fontSize:"xs",fontWeight:"bold",color:"fg.muted",children:"Source:"}),e.jsx(r,{fontSize:"sm",p:2,bg:"blue.subtle",borderRadius:"md",dir:s.sourceLang?.startsWith("he")||s.sourceLang?.startsWith("ar")?"rtl":"ltr",children:Array.isArray(t.nsrc)?W(t.nsrc):t.nsrc})]}),e.jsxs(n,{children:[e.jsx(r,{fontSize:"xs",fontWeight:"bold",color:"fg.muted",children:"Target:"}),e.jsx(r,{fontSize:"sm",p:2,bg:"green.subtle",borderRadius:"md",dir:s.targetLang?.startsWith("he")||s.targetLang?.startsWith("ar")?"rtl":"ltr",children:Array.isArray(t.ntgt)?W(t.ntgt):t.ntgt})]}),t.notes&&e.jsxs(n,{children:[e.jsx(r,{fontSize:"xs",fontWeight:"bold",color:"fg.muted",children:"Notes:"}),e.jsxs(n,{p:2,bg:"yellow.subtle",borderRadius:"md",children:[t.notes.desc&&e.jsx(r,{fontSize:"xs",mb:2,whiteSpace:"pre-wrap",children:t.notes.desc}),t.notes.ph&&e.jsxs(n,{children:[e.jsx(r,{fontSize:"xs",fontWeight:"bold",mb:1,children:"Placeholders:"}),Object.entries(t.notes.ph).map(([l,d])=>e.jsxs(n,{mb:1,children:[e.jsx(r,{fontSize:"xs",fontFamily:"mono",color:"blue.600",children:l}),e.jsxs(r,{fontSize:"xs",color:"gray.600",children:[d.desc," (e.g., ",d.sample,")"]})]},l))]})]})]}),b.length>0&&e.jsxs(n,{children:[e.jsxs(c,{align:"center",justify:"space-between",mb:2,children:[e.jsx(D,{size:"xs",variant:"ghost",onClick:()=>p(l=>({...l,[y]:!m})),p:1,children:e.jsx(r,{fontSize:"xs",color:"blue.600",children:m?"Hide additional properties":`Show ${b.length} additional properties`})}),e.jsxs(w,{gap:2,children:[t.prj&&e.jsx(f,{size:"sm",colorPalette:"purple",children:t.prj}),t.q&&e.jsxs(f,{size:"sm",colorPalette:"blue",children:["Q: ",t.q]})]})]}),e.jsx(N,{open:m,children:e.jsx(U,{children:e.jsx(n,{p:3,bg:"gray.subtle",borderRadius:"md",children:b.map(([l,d])=>{let g=d;return l==="ts"&&typeof d=="number"?g=u(d):typeof d=="object"?g=JSON.stringify(d,null,2):g=String(d),e.jsxs(c,{align:"start",mb:2,gap:2,children:[e.jsxs(r,{fontSize:"xs",fontWeight:"bold",color:"gray.600",minW:"fit-content",children:[l,":"]}),e.jsx(r,{fontSize:"xs",fontFamily:"mono",color:"blue.600",flex:"1",wordBreak:"break-all",children:g})]},l)})})})})]})]})},t.guid||o)},k=new Set(["jobGuid","sourceLang","targetLang","translationProvider","updatedAt","taskName","inflight","status","statusDescription","tus","estimatedCost"]),z=Object.entries(s).filter(([t])=>!k.has(t));return e.jsxs(n,{p:6,minH:"100vh",bg:"gray.50",children:[e.jsxs(r,{fontSize:"3xl",fontWeight:"bold",mb:6,color:"fg.default",children:["Job ",s.jobGuid]}),e.jsxs(x,{gap:6,align:"stretch",maxW:"6xl",mx:"auto",children:[e.jsx(n,{p:6,bg:"white",borderRadius:"lg",shadow:"sm",children:e.jsxs(x,{gap:4,align:"stretch",children:[e.jsxs(c,{justify:"space-between",align:"center",wrap:"wrap",children:[e.jsxs(w,{gap:6,wrap:"wrap",align:"center",children:[e.jsxs(n,{children:[e.jsx(r,{fontSize:"sm",fontWeight:"bold",color:"fg.muted",children:"Language Pair:"}),e.jsxs(r,{fontSize:"sm",children:[s.sourceLang," → ",s.targetLang]})]}),e.jsxs(n,{children:[e.jsx(r,{fontSize:"sm",fontWeight:"bold",color:"fg.muted",children:"Provider:"}),e.jsx(r,{fontSize:"sm",children:s.translationProvider})]}),s.updatedAt&&e.jsxs(n,{children:[e.jsx(r,{fontSize:"sm",fontWeight:"bold",color:"fg.muted",children:"Updated:"}),e.jsx(r,{fontSize:"sm",children:u(new Date(s.updatedAt).getTime())})]}),s.taskName&&e.jsxs(n,{children:[e.jsx(r,{fontSize:"sm",fontWeight:"bold",color:"fg.muted",children:"Task:"}),e.jsx(r,{fontSize:"sm",children:s.taskName})]}),s.estimatedCost!==void 0&&e.jsxs(n,{children:[e.jsx(r,{fontSize:"sm",fontWeight:"bold",color:"fg.muted",children:"Estimated Cost:"}),e.jsx(r,{fontSize:"sm",children:J(s.estimatedCost)})]}),s.inflight?.length>0&&e.jsxs(f,{colorPalette:"orange",size:"sm",children:[s.inflight.length," TUs In Flight"]})]}),e.jsxs(n,{textAlign:"right",children:[e.jsx(f,{size:"lg",colorPalette:P(s.status),children:s.status?.toUpperCase()}),s.statusDescription&&e.jsx(r,{fontSize:"xs",color:"fg.muted",mt:1,children:G(s.statusDescription)})]})]}),z.length>0&&e.jsxs(n,{mt:4,pt:4,borderTop:"1px",borderColor:"border.default",children:[e.jsx(r,{fontSize:"sm",fontWeight:"bold",color:"fg.muted",mb:3,children:"Additional Properties"}),e.jsx(n,{bg:"gray.subtle",p:3,borderRadius:"md",children:z.map(([t,o])=>{let h=o;return t==="ts"&&typeof o=="number"?h=u(o):typeof o=="object"?h=JSON.stringify(o,null,2):h=String(o),e.jsxs(c,{align:"start",mb:2,gap:2,children:[e.jsxs(r,{fontSize:"xs",fontWeight:"bold",color:"gray.600",minW:"fit-content",children:[t,":"]}),e.jsx(r,{fontSize:"xs",fontFamily:"mono",color:"blue.600",flex:"1",wordBreak:"break-all",children:h})]},t)})})]})]})}),s.inflight?.length>0&&e.jsxs(n,{p:4,bg:"orange.subtle",borderRadius:"lg",borderWidth:"1px",borderColor:"orange.muted",children:[e.jsx(r,{fontSize:"sm",fontWeight:"bold",color:"orange.700",mb:2,children:"Translation In Progress"}),e.jsxs(r,{fontSize:"sm",color:"orange.600",children:[s.inflight.length," translation unit",s.inflight.length===1?"":"s"," ",s.inflight.length===1?"is":"are"," still being translated."]})]}),e.jsxs(n,{children:[e.jsxs(r,{fontSize:"xl",fontWeight:"bold",mb:4,children:["Translation Units (",s.tus?.length||0,")"]}),s.tus?.length>0?s.tus.map((t,o)=>A(t,o)):e.jsx(n,{p:6,bg:"white",borderRadius:"lg",textAlign:"center",children:e.jsx(r,{color:"fg.muted",children:"No translation units found."})})]})]})]})};export{$ as default};
@@ -1 +0,0 @@
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};
@@ -1 +0,0 @@
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};
@@ -1 +0,0 @@
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};
@@ -1,2 +0,0 @@
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,{})})})}));