import{b as v,D as r,i as m,I as h,w as f,o as c,g as x,l as b,e as d,n as y,f as e,v as g,E as w,G as k}from"./vendor-wgE37vvX.js";import{o as I,R as C}from"./index-_04Sks9N.js";import{_ as M}from"./BaseTransitionCollapse-dgRtN0e1.js";const N=a=>(w("data-v-abcb66fe"),a=a(),k(),a),B={class:"container"},T={class:"py-2 text-white"},V={class:"row no-gutters items-center"},R={class:"col"},S={class:"d-flex items-center justify-lg-center"},A=["innerHTML"],E={key:1,class:"m-0 text-sm font-bold"},H={class:"col-auto pl-2"},L=["aria-expanded"],O=N(()=>e("i",{class:"mi-times icon-20px"},null,-1)),$=[O],j={__name:"NoticeOnTop",setup(a){const _=v(),t=r(!0),o=r([]),i=r(),l=m(()=>o.value.length>=i.value?o.value[i.value]:[]),u=()=>{o.value.length>0&&(i.value=Math.floor(o.value.length*Math.random()))};return h(async()=>{var s;const{data:p}=await C.get("notices?severity=info&limit=6");for(const n of p.notices)n.text=(s=n.text.replaceAll(/<p[^>]*>/gu,""))==null?void 0:s.replace(/<\/?p[^>]*>/gu,""),o.value.push(n);u()}),f(()=>_.fullPath,()=>{u()}),(p,s)=>(c(),x(M,null,{default:b(()=>[t.value?(c(),d("div",{key:0,id:"notice-very-top",class:y(["notice-on-top",l.value.color])},[e("div",B,[e("div",T,[e("div",V,[e("div",R,[e("div",S,[l.value&&t.value?(c(),d("p",{key:0,class:"m-0 font-bold",innerHTML:l.value.text},null,8,A)):(c(),d("p",E))])]),e("div",H,[e("button",{type:"button",class:"btn p-1 rounded-pill text-white","aria-expanded":t.value,"aria-controls":"notice-very-top","aria-label":"Close notice",onClick:s[0]||(s[0]=n=>t.value=!t.value)},$,8,L)])])])])],2)):g("",!0)]),_:1}))}},P=I(j,[["__scopeId","data-v-abcb66fe"]]);export{P as default};