39246-vm/frontend/out/_next/static/chunks/aeda6b21c208c173.js
2026-03-14 17:32:05 +03:00

3 lines
28 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,88143,(e,t,r)=>{"use strict";function n({widthInt:e,heightInt:t,blurWidth:r,blurHeight:n,blurDataURL:s,objectFit:a}){let i=r?40*r:e,l=n?40*n:t,o=i&&l?`viewBox='0 0 ${i} ${l}'`:"";return`%3Csvg xmlns='http://www.w3.org/2000/svg' ${o}%3E%3Cfilter id='b' color-interpolation-filters='sRGB'%3E%3CfeGaussianBlur stdDeviation='20'/%3E%3CfeColorMatrix values='1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 100 -1' result='s'/%3E%3CfeFlood x='0' y='0' width='100%25' height='100%25'/%3E%3CfeComposite operator='out' in='s'/%3E%3CfeComposite in2='SourceGraphic'/%3E%3CfeGaussianBlur stdDeviation='20'/%3E%3C/filter%3E%3Cimage width='100%25' height='100%25' x='0' y='0' preserveAspectRatio='${o?"none":"contain"===a?"xMidYMid":"cover"===a?"xMidYMid slice":"none"}' style='filter: url(%23b);' href='${s}'/%3E%3C/svg%3E`}Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"getImageBlurSvg",{enumerable:!0,get:function(){return n}})},87690,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n={VALID_LOADERS:function(){return a},imageConfigDefault:function(){return i}};for(var s in n)Object.defineProperty(r,s,{enumerable:!0,get:n[s]});let a=["default","imgix","cloudinary","akamai","custom"],i={deviceSizes:[640,750,828,1080,1200,1920,2048,3840],imageSizes:[32,48,64,96,128,256,384],path:"/_next/image",loader:"default",loaderFile:"",domains:[],disableStaticImages:!1,minimumCacheTTL:14400,formats:["image/webp"],maximumRedirects:3,maximumResponseBody:5e7,dangerouslyAllowLocalIP:!1,dangerouslyAllowSVG:!1,contentSecurityPolicy:"script-src 'none'; frame-src 'none'; sandbox;",contentDispositionType:"attachment",localPatterns:void 0,remotePatterns:[],qualities:[75],unoptimized:!1}},8927,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"getImgProps",{enumerable:!0,get:function(){return c}}),e.r(33525);let n=e.r(43369),s=e.r(88143),a=e.r(87690),i=["-moz-initial","fill","none","scale-down",void 0];function l(e){return void 0!==e.default}function o(e){return void 0===e?e:"number"==typeof e?Number.isFinite(e)?e:NaN:"string"==typeof e&&/^[0-9]+$/.test(e)?parseInt(e,10):NaN}function c({src:e,sizes:t,unoptimized:r=!1,priority:c=!1,preload:d=!1,loading:u,className:g,quality:m,width:f,height:x,fill:h=!1,style:p,overrideSrc:b,onLoad:j,onLoadingComplete:y,placeholder:v="empty",blurDataURL:w,fetchPriority:N,decoding:_="async",layout:C,objectFit:P,objectPosition:E,lazyBoundary:S,lazyRoot:k,...O},R){var I;let M,z,$,{imgConf:A,showAltText:L,blurComplete:D,defaultLoader:T}=R,F=A||a.imageConfigDefault;if("allSizes"in F)M=F;else{let e=[...F.deviceSizes,...F.imageSizes].sort((e,t)=>e-t),t=F.deviceSizes.sort((e,t)=>e-t),r=F.qualities?.sort((e,t)=>e-t);M={...F,allSizes:e,deviceSizes:t,qualities:r}}if(void 0===T)throw Object.defineProperty(Error("images.loaderFile detected but the file is missing default export.\nRead more: https://nextjs.org/docs/messages/invalid-images-config"),"__NEXT_ERROR_CODE",{value:"E163",enumerable:!1,configurable:!0});let U=O.loader||T;delete O.loader,delete O.srcSet;let q="__next_img_default"in U;if(q){if("custom"===M.loader)throw Object.defineProperty(Error(`Image with src "${e}" is missing "loader" prop.
Read more: https://nextjs.org/docs/messages/next-image-missing-loader`),"__NEXT_ERROR_CODE",{value:"E252",enumerable:!1,configurable:!0})}else{let e=U;U=t=>{let{config:r,...n}=t;return e(n)}}if(C){"fill"===C&&(h=!0);let e={intrinsic:{maxWidth:"100%",height:"auto"},responsive:{width:"100%",height:"auto"}}[C];e&&(p={...p,...e});let r={responsive:"100vw",fill:"100vw"}[C];r&&!t&&(t=r)}let B="",G=o(f),W=o(x);if((I=e)&&"object"==typeof I&&(l(I)||void 0!==I.src)){let t=l(e)?e.default:e;if(!t.src)throw Object.defineProperty(Error(`An object should only be passed to the image component src parameter if it comes from a static image import. It must include src. Received ${JSON.stringify(t)}`),"__NEXT_ERROR_CODE",{value:"E460",enumerable:!1,configurable:!0});if(!t.height||!t.width)throw Object.defineProperty(Error(`An object should only be passed to the image component src parameter if it comes from a static image import. It must include height and width. Received ${JSON.stringify(t)}`),"__NEXT_ERROR_CODE",{value:"E48",enumerable:!1,configurable:!0});if(z=t.blurWidth,$=t.blurHeight,w=w||t.blurDataURL,B=t.src,!h)if(G||W){if(G&&!W){let e=G/t.width;W=Math.round(t.height*e)}else if(!G&&W){let e=W/t.height;G=Math.round(t.width*e)}}else G=t.width,W=t.height}let V=!c&&!d&&("lazy"===u||void 0===u);(!(e="string"==typeof e?e:B)||e.startsWith("data:")||e.startsWith("blob:"))&&(r=!0,V=!1),M.unoptimized&&(r=!0),q&&!M.dangerouslyAllowSVG&&e.split("?",1)[0].endsWith(".svg")&&(r=!0);let X=o(m),K=Object.assign(h?{position:"absolute",height:"100%",width:"100%",left:0,top:0,right:0,bottom:0,objectFit:P,objectPosition:E}:{},L?{}:{color:"transparent"},p),Q=D||"empty"===v?null:"blur"===v?`url("data:image/svg+xml;charset=utf-8,${(0,s.getImageBlurSvg)({widthInt:G,heightInt:W,blurWidth:z,blurHeight:$,blurDataURL:w||"",objectFit:K.objectFit})}")`:`url("${v}")`,H=i.includes(K.objectFit)?"fill"===K.objectFit?"100% 100%":"cover":K.objectFit,J=Q?{backgroundSize:H,backgroundPosition:K.objectPosition||"50% 50%",backgroundRepeat:"no-repeat",backgroundImage:Q}:{},Y=function({config:e,src:t,unoptimized:r,width:s,quality:a,sizes:i,loader:l}){if(r){let e=(0,n.getDeploymentId)();if(t.startsWith("/")&&!t.startsWith("//")&&e){let r=t.includes("?")?"&":"?";t=`${t}${r}dpl=${e}`}return{src:t,srcSet:void 0,sizes:void 0}}let{widths:o,kind:c}=function({deviceSizes:e,allSizes:t},r,n){if(n){let r=/(^|\s)(1?\d?\d)vw/g,s=[];for(let e;e=r.exec(n);)s.push(parseInt(e[2]));if(s.length){let r=.01*Math.min(...s);return{widths:t.filter(t=>t>=e[0]*r),kind:"w"}}return{widths:t,kind:"w"}}return"number"!=typeof r?{widths:e,kind:"w"}:{widths:[...new Set([r,2*r].map(e=>t.find(t=>t>=e)||t[t.length-1]))],kind:"x"}}(e,s,i),d=o.length-1;return{sizes:i||"w"!==c?i:"100vw",srcSet:o.map((r,n)=>`${l({config:e,src:t,quality:a,width:r})} ${"w"===c?r:n+1}${c}`).join(", "),src:l({config:e,src:t,quality:a,width:o[d]})}}({config:M,src:e,unoptimized:r,width:G,quality:X,sizes:t,loader:U}),Z=V?"lazy":u;return{props:{...O,loading:Z,fetchPriority:N,width:G,height:W,decoding:_,className:g,style:{...K,...J},sizes:Y.sizes,srcSet:Y.srcSet,src:b||Y.src},meta:{unoptimized:r,preload:d||c,placeholder:v,fill:h}}}},98879,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"default",{enumerable:!0,get:function(){return l}});let n=e.r(71645),s="u"<typeof window,a=s?()=>{}:n.useLayoutEffect,i=s?()=>{}:n.useEffect;function l(e){let{headManager:t,reduceComponentsToState:r}=e;function l(){if(t&&t.mountedInstances){let e=n.Children.toArray(Array.from(t.mountedInstances).filter(Boolean));t.updateHead(r(e))}}return s&&(t?.mountedInstances?.add(e.children),l()),a(()=>(t?.mountedInstances?.add(e.children),()=>{t?.mountedInstances?.delete(e.children)})),a(()=>(t&&(t._pendingUpdate=l),()=>{t&&(t._pendingUpdate=l)})),i(()=>(t&&t._pendingUpdate&&(t._pendingUpdate(),t._pendingUpdate=null),()=>{t&&t._pendingUpdate&&(t._pendingUpdate(),t._pendingUpdate=null)})),null}},25633,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n={default:function(){return x},defaultHead:function(){return u}};for(var s in n)Object.defineProperty(r,s,{enumerable:!0,get:n[s]});let a=e.r(55682),i=e.r(90809),l=e.r(43476),o=i._(e.r(71645)),c=a._(e.r(98879)),d=e.r(42732);function u(){return[(0,l.jsx)("meta",{charSet:"utf-8"},"charset"),(0,l.jsx)("meta",{name:"viewport",content:"width=device-width"},"viewport")]}function g(e,t){return"string"==typeof t||"number"==typeof t?e:t.type===o.default.Fragment?e.concat(o.default.Children.toArray(t.props.children).reduce((e,t)=>"string"==typeof t||"number"==typeof t?e:e.concat(t),[])):e.concat(t)}e.r(33525);let m=["name","httpEquiv","charSet","itemProp"];function f(e){let t,r,n,s;return e.reduce(g,[]).reverse().concat(u().reverse()).filter((t=new Set,r=new Set,n=new Set,s={},e=>{let a=!0,i=!1;if(e.key&&"number"!=typeof e.key&&e.key.indexOf("$")>0){i=!0;let r=e.key.slice(e.key.indexOf("$")+1);t.has(r)?a=!1:t.add(r)}switch(e.type){case"title":case"base":r.has(e.type)?a=!1:r.add(e.type);break;case"meta":for(let t=0,r=m.length;t<r;t++){let r=m[t];if(e.props.hasOwnProperty(r))if("charSet"===r)n.has(r)?a=!1:n.add(r);else{let t=e.props[r],n=s[r]||new Set;("name"!==r||!i)&&n.has(t)?a=!1:(n.add(t),s[r]=n)}}}return a})).reverse().map((e,t)=>{let r=e.key||t;return o.default.cloneElement(e,{key:r})})}let x=function({children:e}){let t=(0,o.useContext)(d.HeadManagerContext);return(0,l.jsx)(c.default,{reduceComponentsToState:f,headManager:t,children:e})};("function"==typeof r.default||"object"==typeof r.default&&null!==r.default)&&void 0===r.default.__esModule&&(Object.defineProperty(r.default,"__esModule",{value:!0}),Object.assign(r.default,r),t.exports=r.default)},18556,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"ImageConfigContext",{enumerable:!0,get:function(){return a}});let n=e.r(55682)._(e.r(71645)),s=e.r(87690),a=n.default.createContext(s.imageConfigDefault)},65856,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"RouterContext",{enumerable:!0,get:function(){return n}});let n=e.r(55682)._(e.r(71645)).default.createContext(null)},70965,(e,t,r)=>{"use strict";function n(e,t){let r=e||75;return t?.qualities?.length?t.qualities.reduce((e,t)=>Math.abs(t-r)<Math.abs(e-r)?t:e,0):r}Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"findClosestQuality",{enumerable:!0,get:function(){return n}})},1948,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"default",{enumerable:!0,get:function(){return i}});let n=e.r(70965),s=e.r(43369);function a({config:e,src:t,width:r,quality:a}){if(t.startsWith("/")&&t.includes("?")&&e.localPatterns?.length===1&&"**"===e.localPatterns[0].pathname&&""===e.localPatterns[0].search)throw Object.defineProperty(Error(`Image with src "${t}" is using a query string which is not configured in images.localPatterns.
Read more: https://nextjs.org/docs/messages/next-image-unconfigured-localpatterns`),"__NEXT_ERROR_CODE",{value:"E871",enumerable:!1,configurable:!0});let i=(0,n.findClosestQuality)(a,e),l=(0,s.getDeploymentId)();return`${e.path}?url=${encodeURIComponent(t)}&w=${r}&q=${i}${t.startsWith("/")&&l?`&dpl=${l}`:""}`}a.__next_img_default=!0;let i=a},85437,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"Image",{enumerable:!0,get:function(){return y}});let n=e.r(55682),s=e.r(90809),a=e.r(43476),i=s._(e.r(71645)),l=n._(e.r(74080)),o=n._(e.r(25633)),c=e.r(8927),d=e.r(87690),u=e.r(18556);e.r(33525);let g=e.r(65856),m=n._(e.r(1948)),f=e.r(18581),x={deviceSizes:[640,750,828,1080,1200,1920,2048,3840],imageSizes:[32,48,64,96,128,256,384],qualities:[75],path:"/_next/image",loader:"default",dangerouslyAllowSVG:!1,unoptimized:!0};function h(e,t,r,n,s,a,i){let l=e?.src;e&&e["data-loaded-src"]!==l&&(e["data-loaded-src"]=l,("decode"in e?e.decode():Promise.resolve()).catch(()=>{}).then(()=>{if(e.parentElement&&e.isConnected){if("empty"!==t&&s(!0),r?.current){let t=new Event("load");Object.defineProperty(t,"target",{writable:!1,value:e});let n=!1,s=!1;r.current({...t,nativeEvent:t,currentTarget:e,target:e,isDefaultPrevented:()=>n,isPropagationStopped:()=>s,persist:()=>{},preventDefault:()=>{n=!0,t.preventDefault()},stopPropagation:()=>{s=!0,t.stopPropagation()}})}n?.current&&n.current(e)}}))}function p(e){return i.use?{fetchPriority:e}:{fetchpriority:e}}"u"<typeof window&&(globalThis.__NEXT_IMAGE_IMPORTED=!0);let b=(0,i.forwardRef)(({src:e,srcSet:t,sizes:r,height:n,width:s,decoding:l,className:o,style:c,fetchPriority:d,placeholder:u,loading:g,unoptimized:m,fill:x,onLoadRef:b,onLoadingCompleteRef:j,setBlurComplete:y,setShowAltText:v,sizesInput:w,onLoad:N,onError:_,...C},P)=>{let E=(0,i.useCallback)(e=>{e&&(_&&(e.src=e.src),e.complete&&h(e,u,b,j,y,m,w))},[e,u,b,j,y,_,m,w]),S=(0,f.useMergedRef)(P,E);return(0,a.jsx)("img",{...C,...p(d),loading:g,width:s,height:n,decoding:l,"data-nimg":x?"fill":"1",className:o,style:c,sizes:r,srcSet:t,src:e,ref:S,onLoad:e=>{h(e.currentTarget,u,b,j,y,m,w)},onError:e=>{v(!0),"empty"!==u&&y(!0),_&&_(e)}})});function j({isAppRouter:e,imgAttributes:t}){let r={as:"image",imageSrcSet:t.srcSet,imageSizes:t.sizes,crossOrigin:t.crossOrigin,referrerPolicy:t.referrerPolicy,...p(t.fetchPriority)};return e&&l.default.preload?(l.default.preload(t.src,r),null):(0,a.jsx)(o.default,{children:(0,a.jsx)("link",{rel:"preload",href:t.srcSet?void 0:t.src,...r},"__nimg-"+t.src+t.srcSet+t.sizes)})}let y=(0,i.forwardRef)((e,t)=>{let r=(0,i.useContext)(g.RouterContext),n=(0,i.useContext)(u.ImageConfigContext),s=(0,i.useMemo)(()=>{let e=x||n||d.imageConfigDefault,t=[...e.deviceSizes,...e.imageSizes].sort((e,t)=>e-t),r=e.deviceSizes.sort((e,t)=>e-t),s=e.qualities?.sort((e,t)=>e-t);return{...e,allSizes:t,deviceSizes:r,qualities:s,localPatterns:"u"<typeof window?n?.localPatterns:e.localPatterns}},[n]),{onLoad:l,onLoadingComplete:o}=e,f=(0,i.useRef)(l);(0,i.useEffect)(()=>{f.current=l},[l]);let h=(0,i.useRef)(o);(0,i.useEffect)(()=>{h.current=o},[o]);let[p,y]=(0,i.useState)(!1),[v,w]=(0,i.useState)(!1),{props:N,meta:_}=(0,c.getImgProps)(e,{defaultLoader:m.default,imgConf:s,blurComplete:p,showAltText:v});return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(b,{...N,unoptimized:_.unoptimized,placeholder:_.placeholder,fill:_.fill,onLoadRef:f,onLoadingCompleteRef:h,setBlurComplete:y,setShowAltText:w,sizesInput:e.sizes,ref:t}),_.preload?(0,a.jsx)(j,{isAppRouter:!r,imgAttributes:N}):null]})});("function"==typeof r.default||"object"==typeof r.default&&null!==r.default)&&void 0===r.default.__esModule&&(Object.defineProperty(r.default,"__esModule",{value:!0}),Object.assign(r.default,r),t.exports=r.default)},94909,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n={default:function(){return d},getImageProps:function(){return c}};for(var s in n)Object.defineProperty(r,s,{enumerable:!0,get:n[s]});let a=e.r(55682),i=e.r(8927),l=e.r(85437),o=a._(e.r(1948));function c(e){let{props:t}=(0,i.getImgProps)(e,{defaultLoader:o.default,imgConf:{deviceSizes:[640,750,828,1080,1200,1920,2048,3840],imageSizes:[32,48,64,96,128,256,384],qualities:[75],path:"/_next/image",loader:"default",dangerouslyAllowSVG:!1,unoptimized:!0}});for(let[e,r]of Object.entries(t))void 0===r&&delete t[e];return{props:t}}let d=l.Image},57688,(e,t,r)=>{t.exports=e.r(94909)},89663,e=>{"use strict";var t=e.i(43476),r=e.i(46932),n=e.i(71645),s=e.i(57688),a=e.i(8225),i=e.i(47163);let l=({match:e})=>1===e?(0,t.jsxs)("span",{title:"AI match",className:"g-badge g-badge-green",children:[(0,t.jsx)("span",{className:"w-1 h-1 rounded-full bg-g-green shadow-[0_0_4px_rgba(0,232,123,0.6)]"}),"Match"]}):0===e?(0,t.jsxs)("span",{title:"AI rejected",className:"g-badge g-badge-red",children:[(0,t.jsx)("span",{className:"w-1 h-1 rounded-full bg-g-red"}),"Skip"]}):(0,t.jsx)("span",{className:"text-g-faint text-xs",children:"—"});function o({listing:e,onSelect:o}){let c=(function(){let e=(0,n.useRef)({}),t=(0,n.useRef)(Date.now()),[,r]=(0,n.useState)(0);return(0,n.useEffect)(()=>{let n=async()=>{try{(await (0,a.fetchCountdownSync)()).forEach(({id:t,time_left_mins:r})=>{e.current[t]=r}),t.current=Date.now()}catch{}};n();let s=setInterval(n,6e4),i=setInterval(()=>r(e=>e+1),1e3);return()=>{clearInterval(s),clearInterval(i)}},[]),(0,n.useCallback)(r=>{if(!(r in e.current))return null;let n=(Date.now()-t.current)/6e4;return Math.max(0,e.current[r]-n)},[])})()(e.id)??e.time_left_mins,d=null!==c&&c<60;return(0,t.jsxs)(r.motion.tr,{initial:{opacity:1,y:-6},animate:{opacity:1,y:0},transition:{duration:.3},className:(0,i.cn)("transition-all duration-200",0===e.ai_match&&"opacity-40"),children:[(0,t.jsx)("td",{className:"w-16",children:e.images[0]?(0,t.jsx)("div",{className:"relative w-11 h-11 rounded-xl overflow-hidden bg-g-raised ring-1 ring-g-border/50 group/img",children:(0,t.jsx)(s.default,{src:e.images[0],alt:e.title,width:44,height:44,className:"object-cover w-full h-full transition-transform duration-300 group-hover/img:scale-110",onError:e=>{e.currentTarget.style.display="none"}})}):(0,t.jsx)("div",{className:"w-11 h-11 bg-gradient-to-br from-g-raised to-g-panel rounded-xl ring-1 ring-g-border/30 flex items-center justify-center",children:(0,t.jsx)("span",{className:"text-g-faint/30 text-xs",children:"—"})})}),(0,t.jsxs)("td",{children:[(0,t.jsx)("button",{onClick:()=>o(e),className:"text-left text-g-text hover:text-g-green transition-all duration-200 block text-sm font-medium leading-snug group/title",children:(0,t.jsx)("span",{className:"group-hover/title:underline decoration-g-green/30 underline-offset-2",children:e.title.length>64?e.title.slice(0,64)+"…":e.title})}),(0,t.jsxs)("div",{className:"flex items-center gap-1.5 mt-1",children:[e.location&&(0,t.jsx)("span",{className:"text-[11px] text-g-faint/60",children:e.location}),e.location&&(0,t.jsx)("span",{className:"text-g-faint/20 text-[8px]",children:"·"}),(0,t.jsx)("span",{className:"text-[11px] text-g-faint/60",children:e.site_name})]})]}),(0,t.jsx)("td",{children:(0,t.jsx)("span",{className:"font-mono text-sm font-semibold tabular-nums text-g-amber",children:e.price_raw||"—"})}),(0,t.jsx)("td",{children:(0,t.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,t.jsx)("span",{className:(0,i.cn)("font-mono text-sm tabular-nums",d?"text-g-red font-bold":"text-g-muted"),children:function(e){if(null===e)return"—";if(e<1)return"<1m";let t=Math.floor(e/1440),r=Math.floor(e%1440/60),n=Math.floor(e%60);return[t&&`${t}d`,r&&`${r}h`,`${n}m`].filter(Boolean).join(" ")}(c)}),d&&(0,t.jsx)("span",{className:"g-badge g-badge-red text-[10px] py-0 animate-pulse",children:"Live"})]})}),(0,t.jsx)("td",{className:"text-center",children:(0,t.jsx)("span",{className:(0,i.cn)("font-mono text-sm font-bold tabular-nums",e.score>=20?"text-g-green":e.score>=10?"text-g-amber":"text-g-muted"),children:e.score})}),(0,t.jsx)("td",{children:(0,t.jsx)("span",{className:"g-badge g-badge-blue text-[11px]",children:e.keyword})}),(0,t.jsx)("td",{className:"text-center",children:(0,t.jsx)(l,{match:e.ai_match})})]})}var c=e.i(88653),d=e.i(74080);function u({images:e}){let[r,a]=(0,n.useState)(0),[i,l]=(0,n.useState)(null),[o,c]=(0,n.useState)(!1);if((0,n.useEffect)(()=>{c(!0)},[]),(0,n.useEffect)(()=>{if(null===i)return;let t=t=>{"ArrowLeft"===t.key&&u((i-1+e.length)%e.length),"ArrowRight"===t.key&&u((i+1)%e.length),"Escape"===t.key&&l(null)};return window.addEventListener("keydown",t),()=>window.removeEventListener("keydown",t)},[i,e.length]),!e.length)return null;let u=e=>{l(e),a(e)},g=null!==i&&o?(0,d.createPortal)((0,t.jsx)("div",{className:"fixed inset-0 z-[100] flex items-stretch justify-end",style:{background:"rgba(0,0,0,0.5)"},onClick:()=>l(null),children:(0,t.jsxs)("div",{className:"h-full w-96 border-l border-ghost-accent flex flex-col",style:{background:"var(--color-ghost-bg)"},onClick:e=>e.stopPropagation(),children:[(0,t.jsxs)("div",{className:"flex items-center justify-between px-4 py-3 border-b border-ghost-border shrink-0",children:[(0,t.jsxs)("span",{className:"font-mono text-ghost-dim text-xs tracking-widest",children:["IMAGE ",i+1," / ",e.length]}),(0,t.jsx)("button",{onClick:()=>l(null),className:"text-ghost-dim hover:text-ghost-danger font-mono text-xs transition-colors",children:"✕ CLOSE"})]}),(0,t.jsx)("div",{className:"flex-1 flex items-center justify-center p-4 overflow-hidden",children:(0,t.jsx)("img",{src:e[i],alt:`Lot image ${i+1}`,className:"max-w-full max-h-full object-contain rounded"})}),e.length>1&&(0,t.jsxs)("div",{className:"flex items-center justify-between px-4 py-3 border-t border-ghost-border shrink-0",children:[(0,t.jsx)("button",{onClick:t=>{t.stopPropagation(),null!==i&&u((i-1+e.length)%e.length)},className:"font-mono text-ghost-accent hover:text-ghost-text text-sm transition-colors px-2 py-1",children:" PREV"}),(0,t.jsx)("div",{className:"flex gap-1.5 items-center",children:e.map((e,r)=>(0,t.jsx)("button",{onClick:()=>u(r),className:`rounded-full transition-all ${r===i?"w-3 h-3 bg-ghost-accent":"w-2 h-2 bg-ghost-border hover:bg-ghost-dim"}`},r))}),(0,t.jsx)("button",{onClick:t=>{t.stopPropagation(),null!==i&&u((i+1)%e.length)},className:"font-mono text-ghost-accent hover:text-ghost-text text-sm transition-colors px-2 py-1",children:"NEXT "})]})]})}),document.body):null;return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("div",{className:"text-ghost-dim text-xs font-mono mb-2",children:"LOT IMAGES"}),(0,t.jsxs)("div",{className:"flex items-center gap-1",children:[e.length>1&&(0,t.jsx)("button",{onClick:t=>{t.stopPropagation(),a(t=>(t-1+e.length)%e.length)},title:"Previous image",className:"text-ghost-dim hover:text-ghost-accent font-mono text-xl leading-none px-0.5 shrink-0 transition-colors",children:""}),(0,t.jsx)("div",{className:"flex gap-2 overflow-x-auto flex-1 pb-1",children:e.map((e,n)=>(0,t.jsx)("button",{onClick:()=>{a(n),l(n)},title:`Open image ${n+1}`,className:`shrink-0 rounded transition-all border-2 ${n===r?"border-ghost-accent scale-105":"border-ghost-border hover:border-ghost-dim"}`,children:(0,t.jsx)(s.default,{src:e,alt:`Lot image ${n+1}`,width:100,height:80,className:"object-cover rounded",onError:e=>{let t=e.currentTarget.parentElement;t&&(t.style.display="none")}})},n))}),e.length>1&&(0,t.jsx)("button",{onClick:t=>{t.stopPropagation(),a(t=>(t+1)%e.length)},title:"Next image",className:"text-ghost-dim hover:text-ghost-accent font-mono text-xl leading-none px-0.5 shrink-0 transition-colors",children:""})]})]}),g]})}function g({listing:e,onClose:n}){return(0,t.jsx)(c.AnimatePresence,{children:e&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(r.motion.div,{initial:{opacity:1},animate:{opacity:1},exit:{opacity:0},onClick:n,className:"fixed inset-0 bg-black/60 backdrop-blur-md z-40"}),(0,t.jsxs)(r.motion.div,{initial:{x:"100%",opacity:0},animate:{x:0,opacity:1},exit:{x:"100%",opacity:0},transition:{type:"spring",damping:30,stiffness:260},className:"fixed right-0 top-0 h-full w-[32rem] glass-strong z-50 overflow-y-auto shadow-2xl shadow-black/60",children:[(0,t.jsx)("div",{className:"h-px bg-gradient-to-r from-g-green/50 via-g-cyan/40 to-transparent"}),(0,t.jsxs)("div",{className:"sticky top-0 flex items-center justify-between px-6 py-4 border-b border-g-border/30 glass-strong z-10",children:[(0,t.jsx)("span",{className:"text-[10px] font-bold text-g-faint uppercase tracking-[0.15em]",children:"Lot Detail"}),(0,t.jsx)("button",{onClick:n,className:"g-btn h-7 px-3 text-xs",children:"✕ Close"})]}),(0,t.jsxs)("div",{className:"p-6 space-y-6",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("h2",{className:"text-g-text font-bold text-base leading-snug",children:e.title}),(0,t.jsxs)("div",{className:"flex items-center gap-2 mt-3 flex-wrap",children:[(0,t.jsx)("span",{className:"g-badge g-badge-neutral",children:e.site_name}),(0,t.jsx)("span",{className:"g-badge g-badge-blue",children:e.keyword}),1===e.ai_match&&(0,t.jsx)("span",{className:"g-badge g-badge-green",children:"AI Match"}),0===e.ai_match&&(0,t.jsx)("span",{className:"g-badge g-badge-red",children:"AI Rejected"})]})]}),(0,t.jsxs)("div",{className:"grid grid-cols-2 gap-3",children:[(0,t.jsxs)("div",{className:"g-card-glow p-4",children:[(0,t.jsx)("p",{className:"text-[10px] uppercase tracking-[0.12em] text-g-faint mb-2",children:"Price"}),(0,t.jsx)("p",{className:"font-mono text-xl font-extrabold text-g-amber",children:e.price_raw||"—"})]}),(0,t.jsxs)("div",{className:"g-card-glow p-4",children:[(0,t.jsx)("p",{className:"text-[10px] uppercase tracking-[0.12em] text-g-faint mb-2",children:"Score"}),(0,t.jsx)("p",{className:"font-mono text-xl font-extrabold text-g-text",children:e.score})]})]}),(0,t.jsxs)("div",{className:"g-card divide-y divide-g-border/30",children:[(0,t.jsx)(m,{label:"Location",value:e.location||"—"}),(0,t.jsx)(m,{label:"Captured",value:new Date(e.timestamp).toLocaleString()}),e.ai_reason&&(0,t.jsx)(m,{label:"AI reason",value:e.ai_reason,valueClass:1===e.ai_match?"text-g-green":"text-g-red"})]}),e.images?.length>0&&(0,t.jsxs)("div",{children:[(0,t.jsx)("p",{className:"text-[10px] uppercase tracking-[0.12em] text-g-faint mb-3",children:"Images"}),(0,t.jsx)(u,{images:e.images})]}),(0,t.jsx)("a",{href:e.link,target:"_blank",rel:"noopener noreferrer",className:"g-btn-primary w-full justify-center text-sm py-3 !rounded-xl font-semibold",children:"Open lot →"})]})]})]})})}function m({label:e,value:r,valueClass:n="text-g-muted"}){return(0,t.jsxs)("div",{className:"flex gap-4 px-4 py-3",children:[(0,t.jsx)("span",{className:"text-xs text-g-faint/60 w-20 flex-shrink-0",children:e}),(0,t.jsx)("span",{className:`text-xs leading-relaxed ${n}`,children:r})]})}var f=e.i(66027),x=e.i(54616),h=e.i(12598);function p(){let e,{data:s,isLoading:i,isError:l}=function(e=100){return(0,f.useQuery)({queryKey:["listings",e],queryFn:()=>(0,a.fetchListings)(e),refetchInterval:1e4})}(),c=(e=(0,h.useQueryClient)(),(0,x.useMutation)({mutationFn:a.deleteAllListings,onSuccess:()=>e.invalidateQueries({queryKey:["listings"]})})),[d,u]=(0,n.useState)(null),[m,p]=(0,n.useState)("");if(i)return(0,t.jsx)(b,{});if(l)return(0,t.jsx)(j,{});let y=m?(s??[]).filter(e=>e.title.toLowerCase().includes(m.toLowerCase())||e.keyword.toLowerCase().includes(m.toLowerCase())):s??[];return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)(r.motion.div,{initial:{opacity:1,y:-12},animate:{opacity:1,y:0},transition:{duration:.4},className:"g-card",children:[(0,t.jsxs)("div",{className:"flex gap-3 items-center flex-wrap px-5 py-4 border-b border-g-border/40",children:[(0,t.jsxs)("div",{className:"relative",children:[(0,t.jsx)("span",{className:"absolute left-3 top-1/2 -translate-y-1/2 text-g-faint/40 text-xs",children:"⌕"}),(0,t.jsx)("input",{value:m,onChange:e=>p(e.target.value),placeholder:"Search listings…",className:"g-input pl-7 w-56 h-9 text-sm"})]}),(0,t.jsxs)("span",{className:"text-xs text-g-faint tabular-nums",children:[y.length," ",(0,t.jsx)("span",{className:"text-g-faint/50",children:"lots"})]}),(0,t.jsxs)("div",{className:"ml-auto flex gap-2",children:[(0,t.jsx)("button",{onClick:()=>window.open((0,a.getExportUrl)("csv")),className:"g-btn text-xs",children:"Export CSV"}),(0,t.jsx)("button",{onClick:()=>window.open((0,a.getExportUrl)("json")),className:"g-btn text-xs",children:"Export JSON"}),(0,t.jsx)("button",{onClick:()=>{confirm("Clear all?")&&c.mutate()},className:"g-btn-danger text-xs",children:"Clear all"})]})]}),(0,t.jsxs)("div",{className:"overflow-x-auto",children:[(0,t.jsxs)("table",{className:"g-table",children:[(0,t.jsx)("thead",{children:(0,t.jsxs)("tr",{children:[(0,t.jsx)("th",{className:"w-16"}),(0,t.jsx)("th",{children:"Title"}),(0,t.jsx)("th",{children:"Price"}),(0,t.jsx)("th",{children:"Time left"}),(0,t.jsx)("th",{className:"text-center",children:"Score"}),(0,t.jsx)("th",{children:"Keyword"}),(0,t.jsx)("th",{className:"text-center",children:"AI"})]})}),(0,t.jsx)("tbody",{children:y.map(e=>(0,t.jsx)(o,{listing:e,onSelect:u},e.id))})]}),!y.length&&(0,t.jsxs)("div",{className:"flex flex-col items-center justify-center py-20 text-g-faint gap-3",children:[(0,t.jsx)("div",{className:"w-16 h-16 rounded-2xl bg-gradient-to-br from-g-raised to-g-panel flex items-center justify-center border border-g-border/30",children:(0,t.jsx)("span",{className:"text-2xl opacity-30",children:"≡"})}),(0,t.jsx)("p",{className:"text-sm font-medium",children:"No listings captured yet"}),(0,t.jsx)("p",{className:"text-xs text-g-faint/50",children:"Start the engine and add target sites"})]})]})]}),(0,t.jsx)(g,{listing:d,onClose:()=>u(null)})]})}let b=()=>(0,t.jsx)("div",{className:"g-card p-5 space-y-3",children:Array.from({length:6}).map((e,r)=>(0,t.jsx)("div",{style:{opacity:1-.15*r,animationDelay:`${.1*r}s`},className:"h-14 bg-gradient-to-r from-g-raised/60 to-g-panel/30 rounded-xl animate-pulse"},r))}),j=()=>(0,t.jsxs)("div",{className:"g-card border-g-red/20 p-5 text-g-red text-sm flex items-center gap-2",children:[(0,t.jsx)("span",{className:"w-2 h-2 rounded-full bg-g-red animate-pulse"}),"Engine offline — cannot reach server"]});function y(){return(0,t.jsxs)("div",{className:"space-y-5",children:[(0,t.jsxs)(r.motion.div,{initial:{opacity:1,y:-8},animate:{opacity:1,y:0},transition:{duration:.4},children:[(0,t.jsx)("h1",{className:"g-page-title",children:"Listings"}),(0,t.jsx)("p",{className:"g-page-sub",children:"Captured lots from all target sites"})]}),(0,t.jsx)(p,{})]})}e.s(["default",()=>y],89663)}]);