1import{b as I,a as l,c as g,w as _,A as R,g as a,h as x,i as r,L as H,q as o,j as L,u as n,l as i,B as w,F as P,D as q,T as D,H as X}from"./D_cVYeUC.js";import{u as A}from"./jluKImfe.js";import{M as N}from"./8dpexkDk.js";import{M as V}from"./CrkrcxWK.js";import{s as W}from"./BmwXbyma.js";import{aD as j,aC as F}from"./app-MtcOvzNd.js";import"./btd5gxW8.js";const $=o("i",{class:"ti ti-rss"},null,-1),U=o("i",{class:"ti ti-settings"},null,-1),G=[U],J={key:1},K=["href","title"],y="rssTicker",re=I({__name:"WidgetRssTicker",props:{widget:{}},emits:["updateProps"],setup(b,{expose:M,emit:C}){const z={url:{type:"string",default:"http://feeds.afpbb.com/rss/afpbb/afpbbnews"},shuffle:{type:"boolean",default:!0},refreshIntervalSec:{type:"number",default:60},maxEntries:{type:"number",default:15},duration:{type:"range",default:70,step:1,min:5,max:200},reverse:{type:"boolean",default:!1},showHeader:{type:"boolean",default:!1},transparent:{type:"boolean",default:!1}},c=b,B=C,{widgetProps:t,configure:u}=A(y,z,c,B),d=l([]),S=g(()=>{const e=d.value.slice(0,t.maxEntries);return t.shuffle&&W(e),e}),p=l(!0),m=g(()=>{const e=new URL("/api/fetch-rss",j);return e.searchParams.set("url",t.url),e}),f=l(),h=l(0),v=()=>{document.visibilityState==="hidden"&&d.value.length!==0||window.fetch(m.value,{}).then(e=>e.json()).then(e=>{d.value=e.items??[],p.value=!1,h.value++})};return _(()=>m,v),_(()=>t.refreshIntervalSec,()=>{f.value&&f.value(),f.value=F(v,Math.max(1e4,t.refreshIntervalSec*1e3),{immediate:!0,afterMounted:!0})},{immediate:!0}),M({name:y,configure:u,id:c.widget?c.widget.id:null}),(e,k)=>{const T=R("MkEllipsis");return a(),x(V,{naked:n(t).transparent,showHeader:n(t).showHeader,class:"mkw-rss-ticker"},{icon:r(()=>[$]),header:r(()=>[H("RSS")]),func:r(({buttonStyleClass:s})=>[o("button",{class:L(["_button",s]),onClick:k[0]||(k[0]=(...E)=>n(u)&&n(u)(...E))},G,2)]),default:r(()=>[o("div",{class:"xqXRz"},[p.value?(a(),i("div",{key:0,class:"xcA1y"},[w(T)],2)):(a(),i("div",J,[w(D,{name:"xsfLM",mode:"default",appear:""},{default:r(()=>[(a(),x(N,{key:h.value,duration:n(t).duration,reverse:n(t).reverse},{default:r(()=>[(a(!0),i(P,null,q(S.value,s=>(a(),i("span",{key:s.link,class:"xzB1l"},[o("a",{href:s.link,rel:"nofollow noopener",target:"_blank",title:s.title},X(s.title),9,K),o("span",{class:"xtXzk"},null,2)],2))),128))]),_:1},8,["duration","reverse"]))]),_:1},8,["name"])]))],2)]),_:1},8,["naked","showHeader"])}}});export{re 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.