1import{d as B,c as r,o as a,g as x,a as v,j as e,q,t as g,w as $,i as L,k as T,h as V,W as A,a6 as F,ao as R,r as i,e as I,au as M,f as N,av as j,N as b,a4 as D}from"./eUuGUOoT.js";import{_ as G}from"./D3Y31-ut.js";import{_ as W}from"./DxgyrZ4s.js";import{_ as H}from"./DCWUfD_5.js";import"./yk2p3wx6.js";import"./BtEjLz4E.js";const J={class:"search-item"},K={class:"search-item__content"},O=["href"],Q=["href"],U=B({__name:"SearchItem",props:{item:{}},emits:["delete"],setup(n,{emit:u}){const y=u;function P(){y("delete",n.item.id)}return(E,c)=>{const l=W,_=T,f=V;return a(),r("div",J,[x(l,{datetime:e(q)(n.item.createdAt),year:"numeric",month:"numeric",day:"numeric",locale:"fr-FR",class:"search-item__date"},null,8,["datetime"]),v("div",K,[v("a",{class:"search-item__title h4",href:n.item.url},g(n.item.titlePage),9,O),v("a",{class:"search-item__text",href:n.item.url},g(n.item.title),9,Q),x(f,{"as-link":"",color:"white",class:"search-item__delete",onClick:P},{icon:$(()=>[x(_,{id:"ic_x"})]),default:$(()=>[c[0]||(c[0]=L(" УдалиÑÑ Ð¿Ð¾Ð¸Ñк ",-1))]),_:1})])])}}}),X={class:"profile-searches"},Y={key:0,class:"profile-searches__count"},Z={key:1,class:"profile-searches__empty"},z={key:2,class:"profile-searches__list"},ee={key:3,class:"profile-searches__list"},S="СоÑ
ÑанÑннÑе поиÑки",te="СоÑ
ÑанÑннÑе поиÑки",se=10,ie=B({__name:"searches",async setup(n){let u,y;const P=A([{title:"ÐÑоÑилÑ",url:"/profile/"},{title:S,url:""}]),E=F(),{data:c}=([u,y]=R(()=>M("/api/profile/filters",{query:E.query},"$7ScEmxmvdP")),u=await u,y(),u),l=i(c.value?.elements||[]),_=i(c.value?.totalPages||1),f=i(c.value?.currentPage||1),m=i(c.value?.total||0),k=i(!1);async function C(p){if(!(!l.value||k.value)){k.value=!0;try{if((await $fetch(`/api/profile/filters/${p}`,{method:"DELETE"})).status==="success"){const s=l.value.findIndex(t=>t.id===p);s>-1&&l.value.splice(s,1),_.value>1?await w(f.value,!1,!0):(k.value=!1,m.value-=1)}}catch(o){console.error("Error deleting saved search:",o);return}}}const d=i(!1),h=i(!1);async function w(p,o=!1,s=!1){d.value=!0,h.value=o||s;try{const t=await $fetch("/api/profile/filters",{query:{page:p.toString(),update:s?"1":""}});s?l.value.push(...t.elements):o?l.value=l.value.concat(t.elements):l.value=t.elements,m.value=t.total||0,f.value=t.currentPage?t.currentPage:1,_.value=t.totalPages?t.totalPages:1,d.value=!1,h.value=!1,k.value=!1}catch(t){console.error("Error fetching saved searches:",t);return}}return(p,o)=>(a(),I(G,{title:S,description:te,breadcrumbs:e(P)},{default:$(()=>[v("div",X,[e(m)>0?(a(),r("span",Y,g(e(m)>1?"СоÑ
Ñанено":"СоÑ
Ñанен")+" "+g(e(m))+" "+g(e(j)(e(m),["поиÑк","поиÑка","поиÑков"]))+": ",1)):(a(),r("h3",Z," У Ð²Ð°Ñ Ð½ÐµÑ ÑоÑ
ÑанÑннÑÑ
поиÑков ")),!e(d)||e(h)?(a(),r("ul",z,[(a(!0),r(b,null,D(e(l),s=>(a(),r("li",{key:s.id,class:"profile-searches__item"},[x(U,{item:s,onDelete:C},null,8,["item"])]))),128))])):e(d)?(a(),r("ul",ee,[(a(!0),r(b,null,D(e(h)?2:se,s=>(a(),r("li",{key:s,class:"profile-searches__item profile-searches__item--skeleton"},[...o[0]||(o[0]=[v("span",{class:"skeleton"},null,-1)])]))),128))])):N("",!0),e(_)>1?(a(),I(H,{key:4,page:e(f),"total-pages":e(_),"is-loading":e(d)||e(h),class:"listing-page__pagination",onLoadNewPage:w},null,8,["page","total-pages","is-loading"])):N("",!0)])]),_:1},8,["breadcrumbs"]))}});export{ie 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.