import{r as e}from"./rolldown-runtime-Z1f0ZVYe.js";import"./posthog-js-P19JMAcQ.js";import{C as t,I as n,M as r,P as i,Q as a,R as o,S as s,T as c,W as l,b as u,d,et as f,g as p,h as m,it as h,ot as g,v as _,w as v,y}from"./element-plus-D99A5MMY.js";import{m as b}from"./vue-BxO6XIpA.js";import"./main-D027d2Op.js";import{n as x,t as S}from"./usePopup-D1kkDbGu.js";import{s as C}from"../index.js";import{n as w,r as T,t as E}from"./match-s30QP-MK.js";import{i as D,r as O}from"./components-CfUrF7Oa.js";import{t as k}from"./header-MAmzC49O.js";var A={class:`popup-header__group`},j={class:`popup-content__container popup-content__container-normal`},M=[`title`],N=[`title`],P=c({__name:`index`,setup(e){let{t:c}=b(),P=x(),{gotoMatchEditPage:F}=S(),I=f(``),L=a([]),R=_(()=>I.value?L.value.filter(e=>e.name.toLowerCase().includes(I.value.toLowerCase())):L.value),z=f(``);function B(){chrome.storage?chrome.storage.local.get([`currentURL`],e=>{z.value=e.currentURL,V(e.currentURL)}):V(globalThis.location.href)}function V(e){if(!e)throw TypeError(`currentURL is empty`);L.value.push(...E(e,P.enabledCollectionList))}return r(()=>{B()}),(e,r)=>{let a=o(`icon-font`),f=d;return i(),s(p,null,[v(h(k),null,{left:l(()=>[y(`section`,A,[v(h(C),{modelValue:I.value,"onUpdate:modelValue":r[0]||=e=>I.value=e,type:`text`,class:`popup-header__search`,placeholder:h(c)(`pages.list.placeholder.search`)},null,8,[`modelValue`,`placeholder`])])]),_:1}),h(P).collectionListData.length?h(P).collectionListData.length&&!L.value.length?(i(),u(h(D),{key:1,state:`noMatch`})):(i(),u(f,{key:2,class:`popup-content_scroll`,"max-height":`var(--popup-actual-height)`},{default:l(()=>[y(`section`,j,[(i(!0),s(p,null,n(R.value,e=>(i(),u(O,{key:e.id,title:h(c)(`match.info.title`),name:h(w)(e.target),onClick:t=>h(T)({sourceURL:z.value,targetURL:e.target,strictPort:e.strictPort})},{target:l(()=>[y(`span`,{title:h(c)(`collection.info.name`)},g(e.collectionName),9,M),r[1]||=t(` / `,-1),y(`span`,{title:h(c)(`match.info.name`)},g(e.name),9,N)]),default:l(()=>[v(a,{name:`arrowRight`,title:h(c)(`match.op.edit`),"class-name":`popup-content__arrow`,onClick:m(t=>h(F)({collectionId:e.collectionId,matchId:e.id}),[`stop`])},null,8,[`title`,`onClick`])]),_:2},1032,[`title`,`name`,`onClick`]))),128))])]),_:1})):(i(),u(h(D),{key:0,state:`empty`}))],64)}}});export{P as default};
//# sourceMappingURL=match-GPg3gKae.js.map