var at=t=>{throw TypeError(t)};var V=(t,e,s)=>e.has(t)||at("Cannot "+s);var i=(t,e,s)=>(V(t,e,"read from private field"),s?s.call(t):e.get(t)),m=(t,e,s)=>e.has(t)?at("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,s),u=(t,e,s,n)=>(V(t,e,"write to private field"),n?n.call(t,s):e.set(t,s),s),f=(t,e,s)=>(V(t,e,"access private method"),s);import{a0 as Ct,J as zt,a1 as wt,a2 as Lt,a3 as S,a4 as W,a5 as N,a6 as Dt,a7 as ct,a8 as lt,a9 as Pt,aa as j,ab as Et,ac as At,ad as ut,ae as It,af as Tt,A as Qt,z as _,ag as $t,ah as Bt,h as Mt,ai as Nt,aj as ht,ak as dt,al as Ft,am as xt}from"./index-D6fBX2R3.js";import{f as K,r as Ut,a as H,b as jt}from"./format-C4dVnwMh.js";function _t(t=""){if(!Ct())throw new Error("vue-query hooks can only be used inside setup() function or functions that support injection context.");const e=wt(t),s=zt(e);if(!s)throw new Error("No 'queryClient' found in Vue context, use 'VueQueryPlugin' to properly initialize the library.");return s}var y,o,F,v,L,I,C,x,T,Q,D,P,w,$,c,M,Z,Y,J,X,q,tt,et,yt,bt,Kt=(bt=class extends Lt{constructor(e,s){super();m(this,c);m(this,y);m(this,o);m(this,F);m(this,v);m(this,L);m(this,I);m(this,C);m(this,x);m(this,T);m(this,Q);m(this,D);m(this,P);m(this,w);m(this,$,new Set);this.options=s,u(this,y,e),u(this,C,null),this.bindMethods(),this.setOptions(s)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(i(this,o).addObserver(this),ft(i(this,o),this.options)?f(this,c,M).call(this):this.updateResult(),f(this,c,X).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return st(i(this,o),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return st(i(this,o),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,f(this,c,q).call(this),f(this,c,tt).call(this),i(this,o).removeObserver(this)}setOptions(e){const s=this.options,n=i(this,o);if(this.options=i(this,y).defaultQueryOptions(e),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof S(this.options.enabled,i(this,o))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");f(this,c,et).call(this),i(this,o).setOptions(this.options),s._defaulted&&!W(this.options,s)&&i(this,y).getQueryCache().notify({type:"observerOptionsUpdated",query:i(this,o),observer:this});const a=this.hasListeners();a&&pt(i(this,o),n,this.options,s)&&f(this,c,M).call(this),this.updateResult(),a&&(i(this,o)!==n||S(this.options.enabled,i(this,o))!==S(s.enabled,i(this,o))||N(this.options.staleTime,i(this,o))!==N(s.staleTime,i(this,o)))&&f(this,c,Z).call(this);const r=f(this,c,Y).call(this);a&&(i(this,o)!==n||S(this.options.enabled,i(this,o))!==S(s.enabled,i(this,o))||r!==i(this,w))&&f(this,c,J).call(this,r)}getOptimisticResult(e){const s=i(this,y).getQueryCache().build(i(this,y),e),n=this.createResult(s,e);return Vt(this,n)&&(u(this,v,n),u(this,I,this.options),u(this,L,i(this,o).state)),n}getCurrentResult(){return i(this,v)}trackResult(e,s){return new Proxy(e,{get:(n,a)=>(this.trackProp(a),s==null||s(a),Reflect.get(n,a))})}trackProp(e){i(this,$).add(e)}getCurrentQuery(){return i(this,o)}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){const s=i(this,y).defaultQueryOptions(e),n=i(this,y).getQueryCache().build(i(this,y),s);let a=()=>{},r;const h=new Promise(b=>{r=b,a=i(this,y).getQueryCache().subscribe(g=>{g.type==="updated"&&g.query.queryHash===n.queryHash&&n.state.data!==void 0&&(a(),b(this.createResult(n,s)))})});return Promise.race([n.fetch().then(()=>{const b=this.createResult(n,s);return r==null||r(b),b}).finally(()=>{a()}),h])}fetch(e){return f(this,c,M).call(this,{...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),i(this,v)))}createResult(e,s){var ot;const n=i(this,o),a=this.options,r=i(this,v),h=i(this,L),b=i(this,I),g=e!==n?e.state:i(this,F),{state:U}=e;let p={...U},B=!1,d;if(s._optimisticResults){const O=this.hasListeners(),Rt=!O&&ft(e,s),Ot=O&&pt(e,n,s,a);(Rt||Ot)&&(p={...p,...At(U.data,e.options)}),s._optimisticResults==="isRestoring"&&(p.fetchStatus="idle")}let{error:l,errorUpdatedAt:R,status:k}=p;d=p.data;let z=!1;if(s.placeholderData!==void 0&&d===void 0&&k==="pending"){let O;r!=null&&r.isPlaceholderData&&s.placeholderData===(b==null?void 0:b.placeholderData)?(O=r.data,z=!0):O=typeof s.placeholderData=="function"?s.placeholderData((ot=i(this,Q))==null?void 0:ot.state.data,i(this,Q)):s.placeholderData,O!==void 0&&(k="success",d=ut(r==null?void 0:r.data,O,s),B=!0)}if(s.select&&d!==void 0&&!z)if(r&&d===(h==null?void 0:h.data)&&s.select===i(this,x))d=i(this,T);else try{u(this,x,s.select),d=s.select(d),d=ut(r==null?void 0:r.data,d,s),u(this,T,d),u(this,C,null)}catch(O){u(this,C,O)}else d===void 0&&u(this,C,null);i(this,C)&&(l=i(this,C),d=i(this,T),R=Date.now(),k="error",B=!1);const E=p.fetchStatus==="fetching",A=k==="pending",G=k==="error",nt=A&&E,rt=d!==void 0;return{status:k,fetchStatus:p.fetchStatus,isPending:A,isSuccess:k==="success",isError:G,isInitialLoading:nt,isLoading:nt,data:d,dataUpdatedAt:p.dataUpdatedAt,error:l,errorUpdatedAt:R,failureCount:p.fetchFailureCount,failureReason:p.fetchFailureReason,errorUpdateCount:p.errorUpdateCount,isFetched:e.isFetched(),isFetchedAfterMount:p.dataUpdateCount>g.dataUpdateCount||p.errorUpdateCount>g.errorUpdateCount,isFetching:E,isRefetching:E&&!A,isLoadingError:G&&!rt,isPaused:p.fetchStatus==="paused",isPlaceholderData:B,isRefetchError:G&&rt,isStale:it(e,s),refetch:this.refetch,isEnabled:S(s.enabled,e)!==!1}}updateResult(){const e=i(this,v),s=this.createResult(i(this,o),this.options);if(u(this,L,i(this,o).state),u(this,I,this.options),i(this,L).data!==void 0&&u(this,Q,i(this,o)),W(s,e))return;u(this,v,s);const n=()=>{if(!e)return!0;const{notifyOnChangeProps:a}=this.options,r=typeof a=="function"?a():a;if(r==="all"||!r&&!i(this,$).size)return!0;const h=new Set(r??i(this,$));return this.options.throwOnError&&h.add("error"),Object.keys(i(this,v)).some(b=>{const g=b;return i(this,v)[g]!==e[g]&&h.has(g)})};f(this,c,yt).call(this,{listeners:n()})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&f(this,c,X).call(this)}},y=new WeakMap,o=new WeakMap,F=new WeakMap,v=new WeakMap,L=new WeakMap,I=new WeakMap,C=new WeakMap,x=new WeakMap,T=new WeakMap,Q=new WeakMap,D=new WeakMap,P=new WeakMap,w=new WeakMap,$=new WeakMap,c=new WeakSet,M=function(e){f(this,c,et).call(this);let s=i(this,o).fetch(this.options,e);return e!=null&&e.throwOnError||(s=s.catch(Dt)),s},Z=function(){f(this,c,q).call(this);const e=N(this.options.staleTime,i(this,o));if(ct.isServer()||i(this,v).isStale||!lt(e))return;const s=Pt(i(this,v).dataUpdatedAt,e)+1;u(this,D,j.setTimeout(()=>{i(this,v).isStale||this.updateResult()},s))},Y=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(i(this,o)):this.options.refetchInterval)??!1},J=function(e){f(this,c,tt).call(this),u(this,w,e),!(ct.isServer()||S(this.options.enabled,i(this,o))===!1||!lt(i(this,w))||i(this,w)===0)&&u(this,P,j.setInterval(()=>{(this.options.refetchIntervalInBackground||Et.isFocused())&&f(this,c,M).call(this)},i(this,w)))},X=function(){f(this,c,Z).call(this),f(this,c,J).call(this,f(this,c,Y).call(this))},q=function(){i(this,D)!==void 0&&(j.clearTimeout(i(this,D)),u(this,D,void 0))},tt=function(){i(this,P)!==void 0&&(j.clearInterval(i(this,P)),u(this,P,void 0))},et=function(){const e=i(this,y).getQueryCache().build(i(this,y),this.options);if(e===i(this,o))return;const s=i(this,o);u(this,o,e),u(this,F,e.state),this.hasListeners()&&(s==null||s.removeObserver(this),e.addObserver(this))},yt=function(e){It.batch(()=>{e.listeners&&this.listeners.forEach(s=>{s(i(this,v))}),i(this,y).getQueryCache().notify({query:i(this,o),type:"observerResultsUpdated"})})},bt);function Gt(t,e){return S(e.enabled,t)!==!1&&t.state.data===void 0&&!(t.state.status==="error"&&S(e.retryOnMount,t)===!1)}function ft(t,e){return Gt(t,e)||t.state.data!==void 0&&st(t,e,e.refetchOnMount)}function st(t,e,s){if(S(e.enabled,t)!==!1&&N(e.staleTime,t)!=="static"){const n=typeof s=="function"?s(t):s;return n==="always"||n!==!1&&it(t,e)}return!1}function pt(t,e,s,n){return(t!==e||S(n.enabled,t)===!1)&&(!s.suspense||t.state.status!=="error")&&it(t,s)}function it(t,e){return S(e.enabled,t)!==!1&&t.isStaleByTime(N(e.staleTime,t))}function Vt(t,e){return!W(t.getCurrentResult(),e)}function Wt(t,e,s){const n=_t(),a=Mt(()=>{var z;let l=e;typeof l=="function"&&(l=l());const R=Ft(l);typeof R.enabled=="function"&&(R.enabled=R.enabled());const k=n.defaultQueryOptions(R);return k._optimisticResults=(z=n.isRestoring)!=null&&z.value?"isRestoring":"optimistic",k}),r=new t(n,a.value),h=a.value.shallow?Tt(r.getCurrentResult()):Qt(r.getCurrentResult());let b=()=>{};n.isRestoring&&_(n.isRestoring,l=>{l||(b(),b=r.subscribe(R=>{dt(h,R)}))},{immediate:!0});const g=()=>{r.setOptions(a.value),dt(h,r.getCurrentResult())};_(a,g),xt(()=>{b()});const U=(...l)=>(g(),h.refetch(...l)),p=()=>new Promise((l,R)=>{let k=()=>{};const z=()=>{if(a.value.enabled!==!1){r.setOptions(a.value);const E=r.getOptimisticResult(a.value);E.isStale?(k(),r.fetchOptimistic(a.value).then(l,A=>{ht(a.value.throwOnError,[A,r.getCurrentQuery()])?R(A):l(r.getCurrentResult())})):(k(),l(E))}};z(),k=_(a,z)});_(()=>h.error,l=>{if(h.isError&&!h.isFetching&&ht(a.value.throwOnError,[l,r.getCurrentQuery()]))throw l});const B=a.value.shallow?$t(h):Bt(h),d=Nt(B);for(const l in h)typeof h[l]=="function"&&(d[l]=h[l]);return d.suspense=p,d.refetch=U,d}function ye(t,e){return Wt(Kt,t)}const Ht={byt:"Byt","rodinny-dum":"Rodinný dům",pozemek:"Pozemek","stavebni-pozemek":"Stavební pozemek",rekreacni:"Rekreační objekt",garaz:"Garáž",komercni:"Komerční",prumyslovy:"Průmyslový",zemedelsky:"Zemědělský","bytovy-dum":"Bytový dům","druzstevni-podil":"Družstevní podíl",jiny:"Ostatní"},Zt={byt:"Byt","rodinny-dum":"Dům",pozemek:"Pozemek","stavebni-pozemek":"Stav. pozemek",rekreacni:"Rekreační",garaz:"Garáž",komercni:"Komerční",prumyslovy:"Průmyslový",zemedelsky:"Zemědělská","bytovy-dum":"Bytový dům","druzstevni-podil":"Družst. podíl",jiny:"Ostatní"},Yt={execution:"Exekuční",voluntary:"Dobrovolná",insolvency:"Insolvenční"},Jt={portaldrazeb:"portaldrazeb.cz",exdrazby:"exdrazby.cz",okdrazby:"okdrazby.cz"},Xt=t=>Ht[t]??t,vt=t=>Zt[t]??Xt(t),qt=t=>Yt[t]??t,te=t=>Jt[t]??t,ee={bezrealitky:"bezrealitky.cz",sreality:"sreality.cz",idnes:"reality.idnes.cz",realitymix:"realitymix.cz",ceskereality:"ceskereality.cz",bazos:"bazos.cz"},se={osobni:"Osobní",druzstevni:"Družstevní",obecni:"Obecní / státní",ostatni:"Ostatní"},ie={novostavba:"Novostavba","velmi-dobry":"Velmi dobrý",dobry:"Dobrý",spatny:"Špatný","po-rekonstrukci":"Po rekonstrukci","pred-rekonstrukci":"Před rekonstrukcí","v-rekonstrukci":"V rekonstrukci",projekt:"Projekt","ve-vystavbe":"Ve výstavbě","k-demolici":"K demolici"},ne={cihla:"Cihlová",panel:"Panelová",drevostavba:"Dřevostavba",kamen:"Kamenná",smisena:"Smíšená",ostatni:"Ostatní"},re={soukromnik:"Soukromý prodejce",realitka:"Realitní kancelář",developer:"Developer"},ve=["1+kk","1+1","2+kk","2+1","3+kk","3+1","4+kk","4+1","5+kk","5+1","6+kk","6+1","garsoniera","atypicky"],oe=t=>t==="garsoniera"?"Garsoniéra":t==="atypicky"?"Atypický":t,mt=t=>ee[t]??t,ae=t=>se[t]??t,ke=t=>ie[t]??t,ge=t=>ne[t]??t,ce=t=>re[t]??t,kt=t=>t.toLowerCase().normalize("NFD").replace(/[̀-ͯ]/g,"").replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"").slice(0,60),le=t=>`/drazba/${t.id}/${kt(t.title||"drazba")}`,ue=t=>`/nemovitost/${t.id}/${kt(t.title||"nemovitost")}`,he=48*36e5,de=72*36e5;function gt(t){return t==null?"–":t>=1e6?`${(t/1e6).toFixed(t>=1e7?1:2).replace(".",",").replace(/,?0+$/,"")} mil.`:t>=1e3?`${Math.round(t/1e3)} tis.`:K(t)}function St(...t){const e=new Set;return t.map(s=>(s??"").trim()).filter(s=>s&&!e.has(s)&&e.add(s)).join(" · ")}function fe(t){const s=new Date(t).toLocaleTimeString("cs-CZ",{hour:"2-digit",minute:"2-digit"});return`${jt(t)} · ${s}`}function Se(t){const e=t.firstSeenAt&&Date.now()-new Date(t.publishedAt??t.firstSeenAt).getTime()<he,s=t.discount!=null&&t.discount>0,n=t.floorAreaM2??t.landAreaM2,a=[n?`${K(n)} m²`:"",t.disposition?oe(t.disposition):vt(t.category),t.ownership?ae(t.ownership):"",t.floor!=null?`${t.floor}. patro`:""].filter(Boolean);return{kind:"sale",id:t.id,href:ue(t),title:t.title,location:St(t.city,t.cityPart,t.district),image:t.image,photos:t.imageCount||(t.image?1:0),status:s?"Cena snížena":"Na prodej",badge:s?"reduced":"sale",second:e&&!s?"Nové":void 0,price:t.price!=null?H(t.price):t.priceNote||"Cena na vyžádání",priceNote:t.pricePerM2?`${K(t.pricePerM2)} Kč/m²`:void 0,meta:a,source:t.sourceCount>1?`${mt(t.source)} +${t.sourceCount-1}`:mt(t.source),seller:t.sellerType?ce(t.sellerType):void 0,lat:t.lat,lon:t.lon,mapPrice:gt(t.price)}}function Re(t){const e=t.startsAt?new Date(t.startsAt).getTime():null,s=e!=null&&e>Date.now()&&e-Date.now()<de,n=t.round+1,a=[t.areaM2?`${K(t.areaM2)} m²`:"",vt(t.category),t.share==null?"":t.share?"Spoluvlastnický podíl":"Celá nemovitost 1/1"].filter(Boolean),r=Ut(t.startsAt);return{kind:"auction",id:t.id,href:le(t),title:t.title,location:St(t.city||t.cadastralArea,t.district,t.region),image:t.image,photos:t.image?1:0,status:s?"Končí brzy":"Dražba",badge:s?"ending":"auction",second:n>1?`${n}. kolo`:void 0,price:t.minBid!=null?H(t.minBid):"Podání neuvedeno",discount:t.discount!=null&&t.discount>0?`−${Math.round(t.discount*100)} % vs. odhad`:void 0,priceNote:t.estimatedPrice?`odhad ${H(t.estimatedPrice)}`:void 0,meta:a,auctionDate:t.startsAt?`${fe(t.startsAt)}${r?` · ${r}`:""}`:"Termín neuveden",auctionTail:n>1?`${n}. kolo`:qt(t.kind),source:te(t.portal),seller:t.executorName||void 0,lat:t.lat,lon:t.lon,mapPrice:gt(t.minBid)}}export{ie as C,ve as D,se as O,Re as a,mt as b,Xt as c,oe as d,ue as e,le as f,gt as g,vt as h,ke as i,ge as j,ce as k,qt as l,ae as o,te as p,Se as s,ye as u};