import{u as S}from"./widget-qjKd4HCd.js";import{M as I}from"./MkContainer-6laePfDX.js";import{Q as M,n as C}from"./app-JmgyQoR0.js";import{b as B,a as m,w as P,D as j,h as s,i as _,j as c,K as D,u as n,z as r,t as d,F as L,G as z,E,y as F,I as H,J as N}from"./vue-y3KLWBaS.js";const b=e=>(H("data-v-17333eb6"),e=e(),N(),e),V=b(()=>n("i",{class:"ph-rss ph-bold ph-lg"},null,-1)),$=b(()=>n("i",{class:"ph-gear-six ph-bold ph-lg"},null,-1)),G=[$],J={class:"ekmkgxbj"},K={key:1,class:"feed"},Q=["href","title"],g="rss",R=B({__name:"rss",props:{widget:{}},emits:["updateProps"],setup(e,{expose:w,emit:k}){const v={url:{type:"string",default:"http://feeds.afpbb.com/rss/afpbb/afpbbnews"},height:{type:"number",default:300},showHeader:{type:"boolean",default:!0}},l=e,y=k,{widgetProps:o,configure:i}=S(g,v,l,y),p=m([]),u=m(!0),h=()=>{fetch(`/api/fetch-rss?url=${o.url}`,{}).then(f=>{f.json().then(a=>{p.value=a.items,u.value=!1})})};return P(()=>o.url,h),M(h,6e4,{immediate:!0,afterMounted:!0}),w({name:g,configure:i,id:l.widget?l.widget.id:null}),(f,a)=>{const x=j("MkLoading");return s(),_(I,{"show-header":r(o).showHeader,class:"mkw-rss",scrollable:!0,style:F(`height: ${r(o).height}px;`)},{header:c(()=>[V,D("RSS")]),func:c(()=>[n("button",{class:"_button",onClick:a[0]||(a[0]=(...t)=>r(i)&&r(i)(...t))},G)]),default:c(()=>[n("div",J,[u.value?(s(),_(x,{key:0})):(s(),d("div",K,[(s(!0),d(L,null,z(p.value,t=>(s(),d("a",{class:"item",href:t.link,rel:"nofollow noopener",target:"_blank",title:t.title},E(t.title),9,Q))),256))]))])]),_:1},8,["show-header","style"])}}}),O=C(R,[["__scopeId","data-v-17333eb6"]]);export{O as default};
