vendor: 9,635 bytes, lines 1-11
1import{c as Re,r as l,at as z,al as $e,j as e,as as J,aq as oe,ao as Be,au as I,ak as M,a_ as qe,a$ as Je,Y as Ee,e as Ke,a9 as Qe,g as Ge,u as Ze,f as ce,O as K,C as O,z as X,D as Y,G as $,a as k,Z as T,I as Q,B as G,R as de,o as et,n as we,a2 as tt}from"./index-CHCCGYt6.js";import{P as Se}from"./progress-fvjPL315.js";import{S as me}from"./separator-DIHYOHdv.js";import{A as Z,a as ee}from"./alert-CVvcd7ZF.js";import{T as Ne,a as Pe,b as B,c as q}from"./tabs-DZCWld45.js";import{U as st,R as F,T as te,F as se,I as ye}from"./upload-CEA_c1Rj.js";import{C as re}from"./circle-check-big-COJVkrsF.js";/** 2 * @license lucide-react v0.453.0 - ISC 3 * 4 * This source code is licensed under the ISC license. 5 * See the LICENSE file in the root directory of this source tree. 6 */const Ce=Re("Play",[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]]);/** 7 * @license lucide-react v0.453.0 - ISC 8 * 9 * This source code is licensed under the ISC license. 10 * See the LICENSE file in the root directory of this source tree. 11 */const rt=Re("RotateCcw",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]]);function at(t,n){return l.useReducer((s,o)=>n[s][o]??s,t)}var xe="ScrollArea",[Te]=Be(xe),[nt,S]=Te(xe),Fe=l.forwardRef((t,n)=>{const{__scopeScrollArea:s,type:o="hover",dir:r,scrollHideDelay:i=600,...c}=t,[m,u]=l.useState(null),[x,d]=l.useState(null),[p,h]=l.useState(null),[f,b]=l.useState(null),[L,U]=l.useState(null),[N,_]=l.useState(0),[C,A]=l.useState(0),[R,y]=l.useState(!1),[D,W]=l.useState(!1),v=z(n,E=>u(E)),w=$e(r);return e.jsx(nt,{scope:s,type:o,dir:w,scrollHideDelay:i,scrollArea:m,viewport:x,onViewportChange:d,content:p,onContentChange:h,scrollbarX:f,onScrollbarXChange:b,scrollbarXEnabled:R,onScrollbarXEnabledChange:y,scrollbarY:L,onScrollbarYChange:U,scrollbarYEnabled:D,onScrollbarYEnabledChange:W,onCornerWidthChange:_,onCornerHeightChange:A,children:e.jsx(J.div,{dir:w,...c,ref:v,style:{position:"relative","--radix-scroll-area-corner-width":N+"px","--radix-scroll-area-corner-height":C+"px",...t.style}})})});Fe.displayName=xe;var Le="ScrollAreaViewport",Me=l.forwardRef((t,n)=>{const{__scopeScrollArea:s,children:o,nonce:r,...i}=t,c=S(Le,s),m=l.useRef(null),u=z(n,m,c.onViewportChange);return e.jsxs(e.Fragment,{children:[e.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}"},nonce:r}),e.jsx(J.div,{"data-radix-scroll-area-viewport":"",...i,ref:u,style:{overflowX:c.scrollbarXEnabled?"scroll":"hidden",overflowY:c.scrollbarYEnabled?"scroll":"hidden",...t.style},children:e.jsx("div",{ref:c.onContentChange,style:{minWidth:"100%",display:"table"},children:o})})]})});Me.displayName=Le;var P="ScrollAreaScrollbar",pe=l.forwardRef((t,n)=>{const{forceMount:s,...o}=t,r=S(P,t.__scopeScrollArea),{onScrollbarXEnabledChange:i,onScrollbarYEnabledChange:c}=r,m=t.orientation==="horizontal";return l.useEffect(()=>(m?i(!0):c(!0),()=>{m?i(!1):c(!1)}),[m,i,c]),r.type==="hover"?e.jsx(ot,{...o,ref:n,forceMount:s}):r.type==="scroll"?e.jsx(it,{...o,ref:n,forceMount:s}):r.type==="auto"?e.jsx(Ie,{...o,ref:n,forceMount:s}):r.type==="always"?e.jsx(ge,{...o,ref:n}):null});pe.displayName=P;var ot=l.forwardRef((t,n)=>{const{forceMount:s,...o}=t,r=S(P,t.__scopeScrollArea),[i,c]=l.useState(!1);return l.useEffect(()=>{const m=r.scrollArea;let u=0;if(m){const x=()=>{window.clearTimeout(u),c(!0)},d=()=>{u=window.setTimeout(()=>c(!1),r.scrollHideDelay)};return m.addEventListener("pointerenter",x),m.addEventListener("pointerleave",d),()=>{window.clearTimeout(u),m.removeEventListener("pointerenter",x),m.removeEventListener("pointerleave",d)}}},[r.scrollArea,r.scrollHideDelay]),e.jsx(oe,{present:s||i,children:e.jsx(Ie,{"data-state":i?"visible":"hidden",...o,ref:n})})}),it=l.forwardRef((t,n)=>{const{forceMount:s,...o}=t,r=S(P,t.__scopeScrollArea),i=t.orientation==="horizontal",c=le(()=>u("SCROLL_END"),100),[m,u]=at("hidden",{hidden:{SCROLL:"scrolling"},scrolling:{SCROLL_END:"idle",POINTER_ENTER:"interacting"},interacting:{SCROLL:"interacting",POINTER_LEAVE:"idle"},idle:{HIDE:"hidden",SCROLL:"scrolling",POINTER_ENTER:"interacting"}});return l.useEffect(()=>{if(m==="idle"){const x=window.setTimeout(()=>u("HIDE"),r.scrollHideDelay);return()=>window.clearTimeout(x)}},[m,r.scrollHideDelay,u]),l.useEffect(()=>{const x=r.viewport,d=i?"scrollLeft":"scrollTop";if(x){let p=x[d];const h=()=>{const f=x[d];p!==f&&(u("SCROLL"),c()),p=f};return x.addEventListener("scroll",h),()=>x.removeEventListener("scroll",h)}},[r.viewport,i,u,c]),e.jsx(oe,{present:s||m!=="hidden",children:e.jsx(ge,{"data-state":m==="hidden"?"hidden":"visible",...o,ref:n,onPointerEnter:I(t.onPointerEnter,()=>u("POINTER_ENTER")),onPointerLeave:I(t.onPointerLeave,()=>u("POINTER_LEAVE"))})})}),Ie=l.forwardRef((t,n)=>{const s=S(P,t.__scopeScrollArea),{forceMount:o,...r}=t,[i,c]=l.useState(!1),m=t.orientation==="horizontal",u=le(()=>{if(s.viewport){const x=s.viewport.offsetWidth<s.viewport.scrollWidth,d=s.viewport.offsetHeight<s.viewport.scrollHeight;c(m?x:d)}},10);return H(s.viewport,u),H(s.content,u),e.jsx(oe,{present:o||i,children:e.jsx(ge,{"data-state":i?"visible":"hidden",...r,ref:n})})}),ge=l.forwardRef((t,n)=>{const{orientation:s="vertical",...o}=t,r=S(P,t.__scopeScrollArea),i=l.useRef(null),c=l.useRef(0),[m,u]=l.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),x=ke(m.viewport,m.content),d={...o,sizes:m,onSizesChange:u,hasThumb:x>0&&x<1,onThumbChange:h=>i.current=h,onThumbPointerUp:()=>c.current=0,onThumbPointerDown:h=>c.current=h};function p(h,f){return ht(h,c.current,m,f)}return s==="horizontal"?e.jsx(lt,{...d,ref:n,onThumbPositionChange:()=>{if(r.viewport&&i.current){const h=r.viewport.scrollLeft,f=Ae(h,m,r.dir);i.current.style.transform=`translate3d(${f}px, 0, 0)`}},onWheelScroll:h=>{r.viewport&&(r.viewport.scrollLeft=h)},onDragScroll:h=>{r.viewport&&(r.viewport.scrollLeft=p(h,r.dir))}}):s==="vertical"?e.jsx(ct,{...d,ref:n,onThumbPositionChange:()=>{if(r.viewport&&i.current){const h=r.viewport.scrollTop,f=Ae(h,m);i.current.style.transform=`translate3d(0, ${f}px, 0)`}},onWheelScroll:h=>{r.viewport&&(r.viewport.scrollTop=h)},onDragScroll:h=>{r.viewport&&(r.viewport.scrollTop=p(h))}}):null}),lt=l.forwardRef((t,n)=>{const{sizes:s,onSizesChange:o,...r}=t,i=S(P,t.__scopeScrollArea),[c,m]=l.useState(),u=l.useRef(null),x=z(n,u,i.onScrollbarXChange);return l.useEffect(()=>{u.current&&m(getComputedStyle(u.current))},[u]),e.jsx(De,{"data-orientation":"horizontal",...r,ref:x,sizes:s,style:{bottom:0,left:i.dir==="rtl"?"var(--radix-scroll-area-corner-width)":0,right:i.dir==="ltr"?"var(--radix-scroll-area-corner-width)":0,"--radix-scroll-area-thumb-width":ie(s)+"px",...t.style},onThumbPointerDown:d=>t.onThumbPointerDown(d.x),onDragScroll:d=>t.onDragScroll(d.x),onWheelScroll:(d,p)=>{if(i.viewport){const h=i.viewport.scrollLeft+d.deltaX;t.onWheelScroll(h),ze(h,p)&&d.preventDefault()}},onResize:()=>{u.current&&i.viewport&&c&&o({content:i.viewport.scrollWidth,viewport:i.viewport.offsetWidth,scrollbar:{size:u.current.clientWidth,paddingStart:ne(c.paddingLeft),paddingEnd:ne(c.paddingRight)}})}})}),ct=l.forwardRef((t,n)=>{const{sizes:s,onSizesChange:o,...r}=t,i=S(P,t.__scopeScrollArea),[c,m]=l.useState(),u=l.useRef(null),x=z(n,u,i.onScrollbarYChange);return l.useEffect(()=>{u.current&&m(getComputedStyle(u.current))},[u]),e.jsx(De,{"data-orientation":"vertical",...r,ref:x,sizes:s,style:{top:0,right:i.dir==="ltr"?0:void 0,left:i.dir==="rtl"?0:void 0,bottom:"var(--radix-scroll-area-corner-height)","--radix-scroll-area-thumb-height":ie(s)+"px",...t.style},onThumbPointerDown:d=>t.onThumbPointerDown(d.y),onDragScroll:d=>t.onDragScroll(d.y),onWheelScroll:(d,p)=>{if(i.viewport){const h=i.viewport.scrollTop+d.deltaY;t.onWheelScroll(h),ze(h,p)&&d.preventDefault()}},onResize:()=>{u.current&&i.viewport&&c&&o({content:i.viewport.scrollHeight,viewport:i.viewport.offsetHeight,scrollbar:{size:u.current.clientHeight,paddingStart:ne(c.paddingTop),paddingEnd:ne(c.paddingBottom)}})}})}),[dt,_e]=Te(P),De=l.forwardRef((t,n)=>{const{__scopeScrollArea:s,sizes:o,hasThumb:r,onThumbChange:i,onThumbPointerUp:c,onThumbPointerDown:m,onThumbPositionChange:u,onDragScroll:x,onWheelScroll:d,onResize:p,...h}=t,f=S(P,s),[b,L]=l.useState(null),U=z(n,v=>L(v)),N=l.useRef(null),_=l.useRef(""),C=f.viewport,A=o.content-o.viewport,R=M(d),y=M(u),D=le(p,10);function W(v){if(N.current){const w=v.clientX-N.current.left,E=v.clientY-N.current.top;x({x:w,y:E})}}return l.useEffect(()=>{const v=w=>{const E=w.target;(b==null?void 0:b.contains(E))&&R(w,A)};return document.addEventListener("wheel",v,{passive:!1}),()=>document.removeEventListener("wheel",v,{passive:!1})},[C,b,A,R]),l.useEffect(y,[o,y]),H(b,D),H(f.content,D),e.jsx(dt,{scope:s,scrollbar:b,hasThumb:r,onThumbChange:M(i),onThumbPointerUp:M(c),onThumbPositionChange:y,onThumbPointerDown:M(m),children:e.jsx(J.div,{...h,ref:U,style:{position:"absolute",...h.style},onPointerDown:I(t.onPointerDown,v=>{v.button===0&&(v.target.setPointerCapture(v.pointerId),N.current=b.getBoundingClientRect(),_.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",f.viewport&&(f.viewport.style.scrollBehavior="auto"),W(v))}),onPointerMove:I(t.onPointerMove,W),onPointerUp:I(t.onPointerUp,v=>{const w=v.target;w.hasPointerCapture(v.pointerId)&&w.releasePointerCapture(v.pointerId),document.body.style.webkitUserSelect=_.current,f.viewport&&(f.viewport.style.scrollBehavior=""),N.current=null})})})}
vendor: 4,142 bytes, line 11
11),ae="ScrollAreaThumb",We=l.forwardRef((t,n)=>{const{forceMount:s,...o}=t,r=_e(ae,t.__scopeScrollArea);return e.jsx(oe,{present:s||r.hasThumb,children:e.jsx(mt,{ref:n,...o})})}),mt=l.forwardRef((t,n)=>{const{__scopeScrollArea:s,style:o,...r}=t,i=S(ae,s),c=_e(ae,s),{onThumbPositionChange:m}=c,u=z(n,p=>c.onThumbChange(p)),x=l.useRef(void 0),d=le(()=>{x.current&&(x.current(),x.current=void 0)},100);return l.useEffect(()=>{const p=i.viewport;if(p){const h=()=>{if(d(),!x.current){const f=xt(p,m);x.current=f,m()}};return m(),p.addEventListener("scroll",h),()=>p.removeEventListener("scroll",h)}},[i.viewport,d,m]),e.jsx(J.div,{"data-state":c.hasThumb?"visible":"hidden",...r,ref:u,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...o},onPointerDownCapture:I(t.onPointerDownCapture,p=>{const f=p.target.getBoundingClientRect(),b=p.clientX-f.left,L=p.clientY-f.top;c.onThumbPointerDown({x:b,y:L})}),onPointerUp:I(t.onPointerUp,c.onThumbPointerUp)})});We.displayName=ae;var fe="ScrollAreaCorner",Oe=l.forwardRef((t,n)=>{const s=S(fe,t.__scopeScrollArea),o=!!(s.scrollbarX&&s.scrollbarY);return s.type!=="scroll"&&o?e.jsx(ut,{...t,ref:n}):null});Oe.displayName=fe;var ut=l.forwardRef((t,n)=>{const{__scopeScrollArea:s,...o}=t,r=S(fe,s),[i,c]=l.useState(0),[m,u]=l.useState(0),x=!!(i&&m);return H(r.scrollbarX,()=>{var p;const d=((p=r.scrollbarX)==null?void 0:p.offsetHeight)||0;r.onCornerHeightChange(d),u(d)}),H(r.scrollbarY,()=>{var p;const d=((p=r.scrollbarY)==null?void 0:p.offsetWidth)||0;r.onCornerWidthChange(d),c(d)}),x?e.jsx(J.div,{...o,ref:n,style:{width:i,height:m,position:"absolute",right:r.dir==="ltr"?0:void 0,left:r.dir==="rtl"?0:void 0,bottom:0,...t.style}}):null});function ne(t){return t?parseInt(t,10):0}function ke(t,n){const s=t/n;return isNaN(s)?0:s}function ie(t){const n=ke(t.viewport,t.content),s=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,o=(t.scrollbar.size-s)*n;return Math.max(o,18)}function ht(t,n,s,o="ltr"){const r=ie(s),i=r/2,c=n||i,m=r-c,u=s.scrollbar.paddingStart+c,x=s.scrollbar.size-s.scrollbar.paddingEnd-m,d=s.content-s.viewport,p=o==="ltr"?[0,d]:[d*-1,0];return He([u,x],p)(t)}function Ae(t,n,s="ltr"){const o=ie(n),r=n.scrollbar.paddingStart+n.scrollbar.paddingEnd,i=n.scrollbar.size-r,c=n.content-n.viewport,m=i-o,u=s==="ltr"?[0,c]:[c*-1,0],x=Je(t,u);return He([0,c],[0,m])(x)}function He(t,n){return s=>{if(t[0]===t[1]||n[0]===n[1])return n[0];const o=(n[1]-n[0])/(t[1]-t[0]);return n[0]+o*(s-t[0])}}function ze(t,n){return t>0&&t<n}var xt=(t,n=()=>{})=>{let s={left:t.scrollLeft,top:t.scrollTop},o=0;return function r(){const i={left:t.scrollLeft,top:t.scrollTop},c=s.left!==i.left,m=s.top!==i.top;(c||m)&&n(),s=i,o=window.requestAnimationFrame(r)}(),()=>window.cancelAnimationFrame(o)};function le(t,n){const s=M(t),o=l.useRef(0);return l.useEffect(()=>()=>window.clearTimeout(o.current),[]),l.useCallback(()=>{window.clearTimeout(o.current),o.current=window.setTimeout(s,n)},[s,n])}function H(t,n){const s=M(n);qe(()=>{let o=0;if(t){const r=new ResizeObserver(()=>{cancelAnimationFrame(o),o=window.requestAnimationFrame(s)});return r.observe(t),()=>{window.cancelAnimationFrame(o),r.unobserve(t)}}},[t,s])}var Ue=Fe,pt=Me,gt=Oe;const he=l.forwardRef(({className:t,children:n,...s},o)=>e.jsxs(Ue,{ref:o,className:Ee("relative overflow-hidden",t),...s,children:[e.jsx(pt,{className:"h-full w-full rounded-[inherit]",children:n}),e.jsx(Ve,{}),e.jsx(gt,{})]}));he.displayName=Ue.displayName;const Ve=l.forwardRef(({className:t,orientation:n="vertical",...s},o)=>e.jsx(pe,{ref:o,orientation:n,className:Ee("flex touch-none select-none transition-colors",n==="vertical"&&"h-full w-2.5 border-l border-l-transparent p-[1px]",n==="horizontal"&&"h-2.5 flex-col border-t border-t-transparent p-[1px]",t),...s,children:e.jsx(We,{className:"relative flex-1 rounded-full bg-border"})}));Ve.displayName=pe.displayName;function ft(t){switch(t){case"completed":return e.jsx(re,{className:"h-4 w-4 text-green-600"});case"failed":return e.jsx(tt,{className:"h-4 w-4 text-red-600"});case"running":return e.jsx(F,{className:"h-4 w-4 text-blue-600 animate-spin"});
11case"pending":return e.jsx(we,{className:"h-4 w-4 text-yellow-600"});default:return e.jsx(we,{className:"h-4 w-4 text-gray-600"})}}function ue(t){const n={completed:"default",failed:"destructive",running:"default",pending:"secondary",paused:"outline"}[t]||"outline";return e.jsxs(et,{variant:n,className:"flex items-center gap-1",children:[ft(t),t.charAt(0).toUpperCase()+t.slice(1)]})}function yt(){const[t,n]=l.useState(null),[s,o]=l.useState(null),[r,i]=l.useState({siteUrl:"https://sariverwalk.com",username:"",applicationPassword:""}),[c,m]=l.useState("idle"),[u,x]=l.useState(""),{toast:d}=Ke(),p=Qe();l.useEffect(()=>{const a=Ge("adminMigration",{path:"/admin/migration"});Ze(a)},[]);const{data:h,isLoading:f,refetch:b}=ce({queryKey:["/api/admin/wp-migration/jobs"],refetchInterval:5e3}),{data:L,isLoading:U}=ce({queryKey:["/api/admin/wp-migration/progress",s],enabled:!!s,refetchInterval:s?2e3:!1}),{data:N,isLoading:_}=ce({queryKey:["/api/admin/wp-migration",s,"items"],enabled:!!s}),C=K({mutationFn:async a=>{const j=new FormData;j.append("csvFile",a);const V=await fetch("/api/admin/wp-migration/start",{method:"POST",body:j});if(!V.ok)throw new Error("Failed to start migration");return V.json()},onSuccess:a=>{d({title:"Migration Started",description:`Migration job ${a.jobId} started successfully`}),o(a.jobId),b(),n(null)},onError:a=>{d({title:"Migration Failed to Start",description:a.message||"Failed to start migration",variant:"destructive"})}}),A=K({mutationFn:async a=>(await de("POST",`/api/admin/wp-migration/${a}/resume`,{})).json(),onSuccess:a=>{d({title:"Migration Resumed",description:a.message||"Migration resumed successfully"}),b(),p.invalidateQueries({queryKey:["/api/admin/wp-migration/progress",s]})},onError:a=>{d({title:"Failed to Resume Migration",description:a.message||"Failed to resume migration",variant:"destructive"})}}),R=K({mutationFn:async()=>(await de("POST","/api/admin/wp/test-connection",r)).json(),onMutate:()=>{m("testing"),x("")},onSuccess:a=>{var j;m("success"),x(a.message||"Connection successful"),d({title:"WordPress Connection Successful",description:`Connected as ${((j=a.userInfo)==null?void 0:j.name)||"user"}. Found ${a.totalPosts||0} posts.`})},onError:a=>{m("error"),x(a.message||"Connection failed"),d({title:"WordPress Connection Failed",description:a.message||"Failed to connect to WordPress",variant:"destructive"})}}),y=K({mutationFn:async a=>(await de("POST","/api/admin/wp/migration/start",{...r,...a})).json(),onSuccess:a=>{d({title:"WordPress API Migration Started",description:a.message||"Migration started successfully"}),b(),o(a.jobId)},onError:a=>{d({title:"Failed to Start API Migration",description:a.message||"Failed to start migration",variant:"destructive"})}}),D=a=>{var V;const j=(V=a.target.files)==null?void 0:V[0];if(j){if(j.type!=="text/csv"){d({title:"Invalid File Type",description:"Please select a CSV file",variant:"destructive"});return}n(j)}},W=()=>{t&&C.mutate(t)},v=a=>{A.mutate(a)},w=a=>{o(a)},E=()=>{if(!r.username||!r.applicationPassword){d({title:"Missing Credentials",description:"Please enter WordPress username and application password",variant:"destructive"});return}R.mutate()},ve=()=>{if(c!=="success"){d({title:"Connection Required",description:"Please test the WordPress connection first",variant:"destructive"});return}y.mutate({statusFilters:["publish","draft"]})},je=(h==null?void 0:h.jobs)||[],g=L,be=(N==null?void 0:N.items)||[],Xe=g?g.processedArticles/g.totalArticles*100:0,Ye=g&&g.totalImages>0?g.processedImages/g.totalImages*100:0;return e.jsxs("div",{className:"container mx-auto p-6 max-w-7xl","data-testid":"admin-migration-page",children:[e.jsxs("div",{className:"mb-8",children:[e.jsx("h1",{className:"text-3xl font-bold","data-testid":"text-page-title",children:"WordPress Migration Manager"}),e.jsx("p",{className:"text-muted-foreground mt-2",children:"Migrate WordPress articles, images, and content to the new platform"})]}),e.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-6",children:[e.jsxs("div",{className:"lg:col-span-1",children:[e.jsxs(O,{"data-testid":"card-start-migration",children:[e.jsxs(X,{children:[e.jsxs(Y,{className:"flex items-center gap-2",children:[e.jsx(st,{className:"h-5 w-5"}),"Start New Migration"]}),e.jsx($,{children:"Choose your migration method and begin content migration"})]}),e.jsx(k,{children:e.jsxs(Ne,{defaultValue:"csv",className:"space-y-4",children:[e.jsxs(Pe,{className:"grid w-full grid-cols-2","data-testid":"tabs-migration-method",children:[e.jsx(B,{value:"csv","data-testid":"tab-csv",children:"CSV Upload"}),e.jsx(B,{value:"api","data-testid":"tab-wordpress-api",children:"WordPress API"})]}),e.jsxs(q,{value:"csv",className:"space-y-4",children:[e.jsxs("div",{children:[e.jsx(T,{htmlFor:"csv-file","data-testid":"label-csv-upload",children:"CSV File"}),e.jsx(Q,{id:"csv-file",type:"file",accept:".csv",onChange:D,className:"mt-1","data-testid":"input-csv-file"}),t&&e.jsxs("p",{className:"text-sm text-muted-foreground mt-2","data-testid":"text-selected-file",children:["Selected: ",t.name]})]}),e.jsx(G,{onClick:W,disabled:!t||C.isPending,className:"w-full","data-testid":"button-start-migration",children:C.isPending?e.jsxs(e.Fragment,{children:[e.jsx(F,{className:"mr-2 h-4 w-4 animate-spin"}),"Starting..."]}):e.jsxs(e.Fragment,{children:[e.jsx(Ce,{className:"mr-2 h-4 w-4"}),"Start Migration"]})}),C.isError&&e.jsxs(Z,{variant:"destructive","data-testid":"alert-start-error",children:[e.jsx(te,{className:"h-4 w-4"}),e.jsx(ee,{children:"Failed to start migration. Please try again."})]})]}),e.jsxs(q,{value:"api",className:"space-y-4",children:[e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{children:[e.jsx(T,{htmlFor:"wp-site-url","data-testid":"label-wp-site-url",children:"WordPress Site URL"}),e.jsx(Q,{id:"wp-site-url",type:"url",value:r.siteUrl,onChange:a=>i(j=>({...j,siteUrl:a.target.value})),placeholder:"https://sariverwalk.com",className:"mt-1","data-testid":"input-wp-site-url"})]}),e.jsxs("div",{children:[e.jsx(T,{htmlFor:"wp-username","data-testid":"label-wp-username",children:"WordPress Username"}),e.jsx(Q,{id:"wp-username",type:"text",value:r.username,onChange:a=>i(j=>({...j,username:a.target.value})),placeholder:"[email protected]",className:"mt-1","data-testid":"input-wp-u
11sername"})]}),e.jsxs("div",{children:[e.jsx(T,{htmlFor:"wp-password","data-testid":"label-wp-password",children:"Application Password"}),e.jsx(Q,{id:"wp-password",type:"password",value:r.applicationPassword,onChange:a=>i(j=>({...j,applicationPassword:a.target.value})),placeholder:"xxxx xxxx xxxx xxxx",className:"mt-1","data-testid":"input-wp-password"})]})]}),u&&e.jsxs(Z,{variant:c==="success"?"default":"destructive","data-testid":"alert-connection-status",children:[c==="success"?e.jsx(re,{className:"h-4 w-4"}):e.jsx(te,{className:"h-4 w-4"}),e.jsx(ee,{children:u})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(G,{onClick:E,disabled:R.isPending||!r.username||!r.applicationPassword,className:"w-full",variant:"outline","data-testid":"button-test-connection",children:R.isPending?e.jsxs(e.Fragment,{children:[e.jsx(F,{className:"mr-2 h-4 w-4 animate-spin"}),"Testing..."]}):e.jsxs(e.Fragment,{children:[e.jsx(re,{className:"mr-2 h-4 w-4"}),"Test Connection"]})}),e.jsx(G,{onClick:ve,disabled:c!=="success"||y.isPending,className:"w-full","data-testid":"button-start-api-migration",children:y.isPending?e.jsxs(e.Fragment,{children:[e.jsx(F,{className:"mr-2 h-4 w-4 animate-spin"}),"Starting..."]}):e.jsxs(e.Fragment,{children:[e.jsx(Ce,{className:"mr-2 h-4 w-4"}),"Start WordPress API Migration"]})})]})]})]})})]}),e.jsxs(O,{className:"mt-6","data-testid":"card-migration-jobs",children:[e.jsxs(X,{children:[e.jsx(Y,{children:"Recent Migration Jobs"}),e.jsx($,{children:"Click on a job to view detailed progress"})]}),e.jsx(k,{children:e.jsx(he,{className:"h-64",children:f?e.jsx("div",{className:"flex items-center justify-center py-8","data-testid":"loading-jobs",children:e.jsx(F,{className:"h-6 w-6 animate-spin"})}):je.length===0?e.jsx("p",{className:"text-center text-muted-foreground py-8","data-testid":"text-no-jobs",children:"No migration jobs found"}):e.jsx("div",{className:"space-y-2",children:je.map(a=>e.jsxs("div",{className:`p-3 border rounded-lg cursor-pointer transition-colors ${s===a.id?"bg-primary/10 border-primary":"hover:bg-muted"}`,onClick:()=>w(a.id),"data-testid":`job-item-${a.id}`,children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs("span",{className:"font-medium","data-testid":`job-id-${a.id}`,children:["Job #",a.id]}),ue(a.status)]}),e.jsxs("span",{className:"text-sm text-muted-foreground","data-testid":`job-progress-${a.id}`,children:[a.processedArticles,"/",a.totalArticles]})]}),a.csvFilename&&e.jsx("p",{className:"text-xs text-muted-foreground mt-1","data-testid":`job-filename-${a.id}`,children:a.csvFilename})]},a.id))})})})]})]}),e.jsx("div",{className:"lg:col-span-2",children:s?e.jsxs(Ne,{defaultValue:"progress",className:"space-y-4",children:[e.jsxs(Pe,{className:"grid w-full grid-cols-3","data-testid":"tabs-job-details",children:[e.jsx(B,{value:"progress","data-testid":"tab-progress",children:"Progress"}),e.jsx(B,{value:"items","data-testid":"tab-items",children:"Articles"}),e.jsx(B,{value:"media","data-testid":"tab-media",children:"Media"})]}),e.jsx(q,{value:"progress",className:"space-y-4",children:e.jsxs(O,{"data-testid":"card-job-progress",children:[e.jsx(X,{children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsxs(Y,{className:"flex items-center gap-2",children:[e.jsx(se,{className:"h-5 w-5"}),"Migration Job #",s]}),e.jsx($,{children:"Current migration progress and statistics"})]}),(g==null?void 0:g.status)&&e.jsxs("div",{className:"flex items-center gap-2",children:[ue(g.status),(g.status==="failed"||g.status==="paused")&&e.jsx(G,{onClick:()=>v(s),disabled:A.isPending,size:"sm","data-testid":"button-resume-job",children:A.isPending?e.jsx(F,{className:"h-4 w-4 animate-spin"}):e.jsxs(e.Fragment,{children:[e.jsx(rt,{className:"mr-2 h-4 w-4"}),"Resume"]})})]})]})}),e.jsx(k,{className:"space-y-6",children:U?e.jsx("div",{className:"flex items-center justify-center py-8","data-testid":"loading-progress",children:e.jsx(F,{className:"h-6 w-6 animate-spin"})}):g?e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx(T,{className:"text-sm font-medium","data-testid":"label-articles-progress",children:"Articles Progress"}),e.jsxs("span",{className:"text-sm text-muted-foreground","data-testid":"text-articles-stats",children:[g.processedArticles," / ",g.totalArticles]})]}),e.jsx(Se,{value:Xe,className:"h-2","data-testid":"progress-articles"}),e.jsxs("div",{className:"grid grid-cols-3 gap-4 text-sm",children:[e.jsxs("div",{className:"text-center","data-testid":"stat-successful-articles",children:[e.jsx("div",{className:"font-medium text-green-600",children:g.successfulArticles}),e.jsx("div",{className:"text-muted-foreground",children:"Successful"})]}),e.jsxs("div",{className:"text-center","data-testid":"stat-failed-articles",children:[e.jsx("div",{className:"font-medium text-red-600",children:g.failedArticles}),e.jsx("div",{className:"text-muted-foreground",children:"Failed"})]}),e.jsxs("div",{className:"text-center","data-testid":"stat-pending-articles",children:[e.jsx("div",{className:"font-medium text-yellow-600",children:g.totalArticles-g.processedArticles}),e.jsx("div",{className:"text-muted-foreground",children:"Pending"})]})]})]}),e.jsx(me,{}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx(T,{className:"text-sm font-medium","data-testid":"label-images-progress",children:"Images Progress"}),e.jsxs("span",{className:"text-sm text-muted-foreground","data-testid":"text-images-stats",children:[g.processedImages," / ",g.totalImages]})]}),e.jsx(Se,{value:Ye,className:"h-2","data-testid":"progress-images"}),e.jsxs("div",{className:"grid grid-cols-3 gap-4 text-sm",children:[e.jsxs("div",{className:"text-center","data-testid":"stat-successful-images",children:[e.jsx("div",{className:"font-medium text-green-600",children:g.successfulImages}),e.jsx("div",{className:"text-muted-foreground",children:"Successful"})]}),e.jsxs("div",{className:"text-center","data-testid":"stat-failed-images",children:[e.jsx("div",{className:"font-medium text-red-600",children:g.failedImages}),e.jsx("div",{className:"text-muted-foreground",children:"Failed"})]}),e.jsxs("div",{className:"text-center","data-testid":"stat-pending-images",children:[e.jsx("div",{className:"font-medium text-yellow-600",children:g.totalImages-g.processedImages}),e.jsx("div",{className:"text-muted-foreground",children:"Pending"})]})]})]}),g.currentArticle&&e.jsxs(e.Fragment,{children:[e.jsx(me,{}),e.jsxs("div",{"data-testid":"current-article",children:[e.jsx(T,{className:"text-sm font-medium",children:"Currently Processing"}),e.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:g.currentArticle})]})]}),g.errors.length>0&&e.jsxs(e.Fragment,{children:[e.jsx(me,{}),e.jsxs("div",{"data-testid":"progress-errors",children:[e.jsx(T,{className:"text-sm font-medium text-red-600",children:"Recent Errors"}),e.jsx("div",{className:"mt-2 space-y-1",children:g.errors.slice(0,3).map((a,j)=>e.jsxs(Z,{variant:"destructive",className:"py-2",children:[e.jsx(te,{className:"h-4 w-4"}),e.jsx(ee,{className:"text-sm",children:a})]},j))})]})]})]}):e.jsx("p",{className:"text-center text-muted-foreground py-8","data-testid":"text-no-progress",children:"No progress data available"})})]})}),e.jsx(q,{value:"items",className:"space-y-4",children:e.jsxs(O,{"data-testid":"card-migration-items",children:[e.jsxs(X,{children:[e.jsxs(Y,{className:"flex items-center gap-2",children:[e.jsx(se,{className:"h-5 w-5"}),"Migration Articles"]}),e.jsx($,{children:"Individual article processing status"})]}),e.jsx(k,{children:e.jsx(he,{className:"h-96",children:_?e.jsx("div",{className:"flex items-center justify-center py-8","data-testid":"loading-items",children:e.jsx(F,{className:"h-6 w-6 animate-spin"})}):be.length===0?e.jsx("p",{className:"text-center text-muted-foreground py-8","data-testid":"text-no-items",children:"No articles found for this job"}):e.jsx("div",{className:"space-y-2",children:be.map(a=>e.jsxs("div",{className:"p-3 border rounded-lg","data-testid":`migration-item-${a.id}`,children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"font-medium","data-testid":`item-title-${a.id}`,children:a.title||`Post #${a.wpPostId}`}),ue(a.status)]}),e.jsxs("p",{className:"text-sm text-muted-foreground","data-testid":`item-slug-${a.id}`,children:["/",a.slug]})]}),e.jsxs("div",{className:"text-right text-sm",children:[e.jsxs("div",{className:"flex items-center gap-1","data-testid":`item-progress-${a.id}`,children:[a.featuredImageProcessed&&e.jsx(re,{className:"h-3 w-3 text-green-600"}),a.inlineImagesProcessed&&e.jsx(ye,{className:"h-3 w-3 text-green-600"}),a.bodyUpdated&&e.jsx(se,{className:"h-3 w-3 text-green-600"})]}),e.jsxs("div",{className:"text-muted-foreground",children:["Attempts: ",a.attemptCount]})]})]}),a.lastError&&e.jsxs(Z,{variant:"destructive",className:"mt-2 py-2","data-testid":`item-error-${a.id}`,children:[e.jsx(te,{className:"h-3 w-3"}),e.jsx(ee,{className:"text-xs",children:a.lastError})]})]},a.id))})})})]})}),e.jsx(q,{value:"media",className:"space-y-4",children:e.jsxs(O,{"data-testid":"card-migration-media",children:[e.jsxs(X,{children:[e.jsxs(Y,{className:"flex items-center gap-2",children:[e.jsx(ye,{className:"h-5 w-5"}),"Migration Media"]}),e.jsx($,{children:"Image and media file processing status"})]}),e.jsx(k,{children:e.jsx("div",{className:"text-center text-muted-foreground py-8","data-testid":"media-placeholder",children:"Media tracking coming soon..."})})]})})]}):e.jsx(O,{"data-testid":"card-no-job-selected",children:e.jsxs(k,{className:"text-center py-12",children:[e.jsx(se,{className:"h-12 w-12 text-muted-foreground mx-auto mb-4"}),e.jsx("h3",{className:"text-lg font-medium mb-2",children:"No Migration Job Selected"}),e.jsx("p",{className:"text-muted-foreground",children:"Select a migration job from the left panel to view detailed progress and manage the migration process."})]})})})]})]})}export{yt as default};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.