1(function(){try{var e=typeof window<`u`?window:typeof global<`u`?global:typeof globalThis<`u`?globalThis:typeof self<`u`?self:{};e.SENTRY_RELEASE={id:`4763faefd9a87fcb2d168f67d064a8733bf7bec5`};var t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]=`9ca4f307-d638-4e9d-aefb-e89bdbb8d3f2`,e._sentryDebugIdIdentifier=`sentry-dbid-9ca4f307-d638-4e9d-aefb-e89bdbb8d3f2`)}catch{}})();import{ht as e,u as t}from"./Dz96g0jP.js";import{f as n,u as r}from"./DYLgzEpi.js";import{a as i,n as a}from"./B0TV0iZ8.js";import{n as o}from"./D_aFfZWE.js";import{i as s,n as c,o as l,r as u}from"./CDsKSN0W.js";import{t as d}from"./BC0JGgrx.js";import{a as f,i as p,o as m,r as h,s as g,t as _}from"./DBJBGx2D.js";import{t as v}from"./B4UAYV03.js";var y=`app_install_popup_dismissed_at`,b=`install_popup`,x=2592e6,S=4e3,C=500,w=3e4,T=e(!1);function E(){try{return new URLSearchParams(window.location.search).has(`simplified`)}catch{return!1}}function D(){return!!document.querySelector(`[role="dialog"][aria-modal="true"]`)}function O(){try{let e=localStorage.getItem(y);if(!e)return!1;let t=Number(e);return Number.isFinite(t)?Date.now()-t<x:!1}catch{return!1}}function k(){return!(T.value||!m()||E()||O()||D())}function A(){let e=s(),n=t(()=>f()),r=t(()=>p()),i=t(()=>r.value?g(b,e.campaignReferrerParams()):h);function a(){setTimeout(()=>{let e=0,t=()=>{if(k()){T.value=!0;return}e>=w||!D()||(e+=C,setTimeout(t,C))};t()},S)}function o(e){e&&k()&&(T.value=!0)}function c(){T.value=!1;try{localStorage.setItem(y,String(Date.now()))}catch{}}function l(){_(b),window.open(i.value,`_blank`),c()}return{isOpen:T,isIOS:n,isAndroid:r,triggerPostBid:a,triggerReturning:o,dismiss:c,openAppStore:l}}var j=0,M=n(`auction`,()=>{let n=o(),s=v(),f=r(),{triggerPostBid:p}=A(),m=e([]),h=e([]),g=e(null),_=e([]),y=e(null),b=e(!0),x=e(!1),S=e(!1),C=e(!1),w=e(!1),T=e(!1),E=e(!1),D=e(!1),O=e({}),k=e(!1),M=e(null),N=e(1),P=e(!1),F=e(!0),I=e(null),L=e(null),R=e(!0),z=e(null),ee=t(()=>y.value?.status===i.DRAFT),V=t(()=>y.value?.status===i.PENDING_REVIEW),H=t(()=>y.value?.status===i.DECLINED),U=t(()=>y.value?.status===i.CANCELLED),W=t(()=>y.value?.status===i.FINISHED_WON||y.value?.status===i.FINISHED_VOID);async function G(){if(!m.value.length){R.value=!0;try{let e=r(),t=new URLSearchParams;e.companyId&&t.append(`companyId`,e.companyId);let n=t.toString()?`/auction-categories?${t.toString()}`:`/auction-categories`,{categories:i,error:a}=await u(n);if(a)return d.error(a.message);m.value=i}finally{R.value=!1}}}function K(e){m.value=e,R.value=!1}async function q(){if(!h.value.length)try{let{categories:e,error:t}=await c(`/auction-categories?all=true`);if(t)return d.error(t.message);h.value=e}catch(e){d.error(`Failed to fetch all categories:`,e)}}async function J(){try{let{categories:e,error:t}=await c(`/auction-categories?withPrices=true`);return t?(d.error(t.message),[]):e}catch(e){return d.error(`Failed to fetch categories with prices:`,e),[]}}async function te(e=1,t={}){let n=++j,i=e===1&&!t.silent;i&&(b.value=!0);try{let i=r(),a=g.value,o=[];a&&(o=[a.id]),a&&a.children&&(o=[...o,...a.children.map(e=>e.id)]);let s=new URLSearchParams;o.length&&s.append(`categories`,o.join(`,`)),s.append(`page`,e.toString()),t.perPage&&s.append(`perPage`,t.perPage.toString()),i.companyId&&s.append(`companyId`,i.companyId),L.value&&s.append(`sort`,L.value);let{auctions:l,error:u}=await c(`/auctions?${s.toString()}`);if(n!==j)return{auctions:[],hasMore:F.value,failed:!1};let f=l?.length?l:[];if(u)return u.type!==`network`&&d.error(u.message),t.silent||(F.value=!1),{auctions:[],hasMore:!1,failed:!0};let p=t.perPage??20,m=f.length===p;return F.value=m,N.value=e===1?Math.ceil(p/20):e,I.value=a?.id??null,e===1?_.value=f:_.value=[..._.value,...f],{auctions:f,hasMore:m,failed:!1}}finally{i&&n===j&&(b.value=!1)}}function Y(e){z.value!=null&&e.bidderNumber===z.value&&(e.isOwnBid=!0)}function X(e,t){if(!y.value)return;let n=z.value===null;z.value=e.bidderNumber,n&&y.value.actionLogs.forEach(e=>Y(e));let r=y.value.bids.findIndex(t=>t.id===e.id);r===-1?$(e,t??y.value.minimumBid,null):y.value.bids[r]=e}async function Z(e,t){let n=r(),i=new URLSearchParams;n.companyId&&i.append(`companyId`,n.companyId);let a=i.toString()?`/auctions/${e}?${i.toString()}`:`/auctions/${e}`,{auction:o,error:s}=await c(a,{eventId:t});if(s)return s.status===404?void 0:d.error(s.message);y.value=o,z.value=o?.bids?.find(e=>e.isOwnBid)?.bidderNumber??null}async function ne(e,t,n){if(e)try{k.value=!0;let{values:r,error:i}=await c(`/auctions/filters/${e}/values`,{params:{search:t,parent_value_id:n}});if(i){d.error(`Failed to fetch filter values:`,i);return}return O.value[e]=r,r}catch(e){return d.error(`Failed to fetch filter values:`,e),[]}finally{k.value=!1}}async function re(e){if(y.value&&!S.value)try{S.value=!0;let t=l(),{bid:n,minimumBid:r,error:i}=await c(`/auctions/${y.value.id}/bid`,{method:`POST`,body:{amount:e,companyId:f.companyId??null},eventId:t});if(i)throw Error(i.message);n&&X(n,r),window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:`bid_placed`,event_id:t,auctionId:y.value.id,bidAmount:e,isAuto:!1}),p()}catch(e){d.error(`Failed to place bid`,e)}
1finally{S.value=!1}}async function ie(e){if(y.value&&!S.value)try{S.value=!0;let t=l(),{autoBid:n,bid:r,minimumBid:i,error:a}=await c(`/auctions/${y.value.id}/auto-bid`,{method:`POST`,body:{maxAmount:e,companyId:f.companyId??null},eventId:t});if(a)throw Error(a.message);return y.value&&(y.value.myAutoBid=n),r&&X(r,i),window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:`bid_placed`,event_id:t,auctionId:y.value.id,bidAmount:e,isAuto:!0}),r&&p(),n}catch(e){d.error(`Failed to setup auto bid:`,e)}finally{S.value=!1}}async function ae(){if(y.value&&!S.value)try{S.value=!0;let{error:e}=await c(`/auctions/${y.value.id}/auto-bid`,{method:`DELETE`});if(e)throw Error(e.message);y.value&&(y.value.myAutoBid=null)}catch(e){d.error(`Failed to cancel auto bid:`,e)}finally{S.value=!1}}async function oe(e=null){if(y.value&&!C.value)try{C.value=!0;let{error:t}=await c(`/auctions/${y.value.id}/cancel`,{method:`POST`,body:e?{reason:e}:void 0});if(t)throw Error(t.message);y.value&&(y.value.status=i.CANCELLED,y.value.canEdit=!1,y.value.canCancel=!1,y.value.canRelist=(y.value.bids?.length??0)===0),s.showAlert({type:`success`,duration:4e3,message:n.t(`Auction has been cancelled`)})}catch(e){d.error(`Failed to cancel auction:`,e),s.showAlert({type:`error`,duration:4e3,message:n.t(`Failed to cancel auction`)})}finally{C.value=!1}}async function se(){if(y.value&&!w.value)try{w.value=!0;let{error:e}=await c(`/auctions/${y.value.id}/remove-reserve-price`,{method:`POST`});if(e)throw Error(e.message);s.showAlert({type:`success`,duration:4e3,message:n.t(`Reserve price removed`)})}catch(e){d.error(`Failed to remove reserve price:`,e),s.showAlert({type:`error`,duration:4e3,message:n.t(`Failed to remove reserve price`)})}finally{w.value=!1}}function Q(e,t){let n=B();[_.value,n.auctions].forEach(n=>{let r=n.find(t=>t.id===e);r&&t(r)})}function ce(e){let t=B();[_.value,t.auctions].forEach(t=>{let n=t.findIndex(t=>t.id===e);n!==-1&&t.splice(n,1)})}function le(e,t){let n=B(),r=_.value.findIndex(t=>t.id===e);r!==-1&&_.value.splice(r,1);let i=n.auctions.find(t=>t.id===e);i&&(i.status=t)}function ue(e){y.value&&(y.value.endsAt=e,Q(y.value.id,t=>{t.endsAt=e}))}function de(e){y.value&&(Y(e),y.value.actionLogs=[e,...y.value.actionLogs])}function $(e,t,r){if(y.value){if(y.value.bids.some(t=>t.id===e.id))return;Q(y.value.id,t=>{t.currentPrice=e.amount,t.bidsCount+=1,r!=null&&(t.isReservePriceMet=r)}),Y(e),y.value.bids.unshift(e),y.value.minimumBid=t;let i=``;r!=null&&(y.value.isReservePriceMet=r,i=r?`${n.t(`Your bid has been placed!`)} ${n.t(`Reserve met!`)}`:`${n.t(`Your bid has been placed!`)} ${n.t(`Reserve not yet met. Bid higher to meet the reserve.`)}`),e.isOwnBid&&s.showAlert({type:`success`,duration:4e3,message:r===null?n.t(`Your bid has been placed!`):i})}}async function fe(e,t){if(!e&&y.value&&(e=y.value.id),!e)return;let n=[_.value.find(t=>t.id===e),t?.id===e?t:void 0,y.value?.id===e?y.value:void 0].filter(e=>!!e);if(!n.length||x.value)return;let r=n[0].isLiked,i=n[0].likesCount;try{x.value=!0,M.value=e;for(let e of n)e.isLiked=!r,e.likesCount=i+(r?-1:1);let t=l(),{liked:a,likesCount:o,error:s}=await c(`/auctions/${e}/like`,{method:`POST`,eventId:t});if(s)throw Error(s.message);for(let e of n)e.isLiked=a,e.likesCount=o;a&&(window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:`auction_like`,event_id:t,auctionId:e}))}catch(e){for(let e of n)e.isLiked=r,e.likesCount=i;d.error(`Failed to toggle auction like:`,e)}finally{x.value=!1,M.value=null}}function pe(e){if(y.value&&!x.value){D.value=!0,y.value.likesCount=e.likesCount;let t=_.value.find(e=>e.id===y.value?.id);t&&(t.likesCount=e.likesCount),setTimeout(()=>{D.value=!1},450)}}function me(e){y.value?.id===e.auctionId&&y.value.myAutoBid&&(y.value.myAutoBid.isActive=!1)}function he(e,t){Q(e,e=>{e.status=t}),y.value?.id===e&&(y.value.status=t,y.value.canCancel=!0)}function ge(e,t,n){ce(e),y.value?.id===e&&(y.value.status=t,y.value.canEdit=!1,y.value.canCancel=!1,y.value.canRelist=n)}function _e(e,t,n,r){le(e,t),y.value?.id===e&&(y.value.winningBid=n,y.value.status=t,y.value.canRelist=!n,y.value.isWinner=!!n?.isOwnBid,r&&(y.value.conversationId=r))}function ve(e){y.value&&e.offer&&(y.value.activeOffer=e.offer,e.offer.status===a.ACCEPTED&&(y.value.status=i.FINISHED_WON,y.value.canRelist=!1,y.value.canOfferNextBidder=!1),(e.offer.status===a.DECLINED||e.offer.status===a.EXPIRED)&&(y.value.canRelist=!0,y.value.id&&Z(y.value.slug||y.value.id)))}async function ye(){if(!y.value?.id)return;let{threads:e,error:t}=await c(`/auctions/${y.value.id}/threads`);if(t){d.error(`Failed to refresh threads:`,t);return}y.value&&(y.value.threads=e)}return{categories:m,allCategories:h,currentCategory:g,currentSort:L,auctions:_,auction:y,isLoading:b,filterValues:O,isActiveRequest:x,isBidProcessing:S,isCancelProcessing:C,isRemoveReserveProcessing:w,showRemoveReserveModal:T,isLocked:E,isPulsing:D,isDraftAuction:ee,isPendingReview:V,isDeclined:H,isCancelled:U,isFinished:W,isLoadingFilterValues:k,activeRequestAuctionId:M,currentPage:N,isLoadingMore:P,hasMoreItems:F,listedCategoryId:I,areCategoriesLoading:R,getCategories:G,setCategories:K,getAllCategories:q,getCategoriesWithPrices:J,getAuctions:te,getAuction:Z,placeBid:re,setupAutoBid:ie,cancelAutoBid:ae,cancelAuction:oe,removeReservePrice:se,addNewBid:$,addActionLog:de,toggleAuctionLike:fe,updateAuctionEndTime:ue,handleAutoBidMaxReached:me,refreshThreads:ye,handleLikeUpdate:pe,handleAuctionStarted:he,handleAuctionCancelled:ge,handleAuctionFinished:_e,handleOfferUpdated:ve,getFilterValues:ne,myBidderNumber:z,enrichOwnBid:Y}}),N=0,P=0,F=null,I=2e3,L=20,R=2;function z(e){return F&&F.query===e&&Date.now()-F.at<I?!1:(F={query:e,at:Date.now()},!0)}var B=n(`search`,()=>{let t=e(null),n=e(null),i=e([]),a=e([]),o=e([]),s=e([]),l=e(null),u=e(null),f=e(1),p=e(1),m=e(0),h=e(!1),g=e(!1),_=e(!1),v=e(!1);async function y(e,n={}){if(!e||e.length<2){i.value=[],m.value=0;return}t.value=e,await Promise.all([b({page:1,committed:n.committed}),C(e)])}
1async function b({suggestionId:e,page:i=1,committed:a=!1,perPage:o=L,silent:v=!1}={}){let y=++N,b=!v;b&&(i===1?g.value=!0:_.value=!0);try{let g=r(),_=M(),v={page:i,perPage:o};e||n.value?.id?v.suggestionId=e||n.value?.id:t.value&&(v.query=t.value,_.currentCategory&&(v.categories=[_.currentCategory.id,..._.currentCategory.children?.map(e=>e.id)??[]].join(`,`))),_.currentSort&&(v.sort=_.currentSort),g.companyId&&(v.companyId=g.companyId),a&&v.query&&z(v.query)&&(v.committed=1);let b=await c(`/search`,{params:v});if(y!==N)return{total:0,failed:!1};let{auctions:x,category:S,filterValues:C,suggestion:w,partialMatch:T,pagination:E,error:D}=b;if(D)return d.error(D.message),{total:0,failed:!0};l.value=S,u.value=C,v.suggestionId?n.value=w??n.value:n.value=w??null;let{currentPage:O,lastPage:k,total:A}=E,j=o/L;return f.value=j===1?O:O*j,p.value=j===1?k:Math.max(1,Math.ceil(A/L)),m.value=A,h.value=T===!0,i===1?s.value=x:s.value=[...s.value,...x],{total:A,failed:!1}}catch(e){return y===N&&d.error(`Failed to search auctions:`,e),{total:0,failed:!0}}finally{b&&(i>1?_.value=!1:y===N&&(g.value=!1))}}async function x(){if(!v.value||!s.value.length)return!0;let{failed:e}=await b({page:1,perPage:Math.max(1,Math.min(f.value,R))*L,silent:!0});return!e}function S(e){let t=e.trim();t.length<2||!z(t)||c(`/search`,{params:{query:t,committed:1,limit:1}}).catch(()=>{})}async function C(e){if(!e||e.length<2){i.value=[],a.value=[];return}let t=++P;try{let{suggestions:n,followable:r}=await c(`/search/suggestions`,{params:{query:e,followable:1}});if(t!==P)return;i.value=n,a.value=r??[]}catch(e){if(t!==P)return;d.error(`Failed to fetch suggestions:`,e),i.value=[],a.value=[]}}async function w(){try{let{suggestions:e}=await c(`/search/suggestions/popular`);o.value=e??[]}catch(e){d.error(`Failed to fetch popular suggestions:`,e),o.value=[]}}function T(e){n.value=e}function E(){n.value=null}function D(){t.value=null,n.value=null,i.value=[],a.value=[],s.value=[],l.value=null,u.value=null,f.value=1,p.value=1,m.value=0,h.value=!1}return{searchQuery:t,selectedSuggestion:n,suggestions:i,followableSuggestions:a,popularSuggestions:o,auctions:s,category:l,filterValues:u,currentPage:f,lastPage:p,total:m,isPartialMatch:h,isLoading:g,isLoadingMore:_,isSearchActive:v,performSearch:y,searchAuctions:b,refreshLoadedAuctions:x,logCommittedSearch:S,getSuggestions:C,getPopularSuggestions:w,setSelectedSuggestion:T,clearSelectedSuggestion:E,reset:D}});export{M as n,A as r,B as t};
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.