PageSourceSearch

https://www.liverpoolphil.com/dist/assets/notification-DAc9zwSC.js

js liverpoolphil.com collected 2026-10-02 03:44:37 UTC 2,923 bytes, 2 lines download raw bytes

1import{c as r}from"./cross-Boswb2Qh.js";import{b as d,c as f,d as u,o as h,a as n,i as m,n as p}from"./app-BZOzIUJT.js";import{_ as g}from"./_plugin-vue_export-helper-DlAUqK2U.js";const _={name:"v-notification",data:function(){return{isVisible:!1,heading:null,content:this.staticMessage,colour:null,updatedAt:null,interval:null}},components:{crossIcon:r},props:{staticMessage:{type:String,default:null}},computed:{colorClass(){return this.colour=="red"?"c-notification--error":this.colour=="green"?"c-notification--success":""}},mounted(){this.getNotification(),this.interval=setInterval((function(){this.getNotification()}).bind(this),3e4)},beforeUnmount(){clearInterval(this.interval)},methods:{getNotification:function(){this.$props.staticMessage?this.isVisible=!0:fetch("/notifications-endpoint",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({query:"\n							{\n								entries {\n									... on siteNotificationBlock_Entry {\n										id\n										enableNotification\n										notification\n										start\n										end\n										dateUpdated\n									}\n								}\n							}"})}).then(i=>i.json()).then(i=>{let e=i.data.entries,c=Math.round(+new Date/1e3),o;for(let t=0;t<e.length;t++)if(e[t].enableNotification){let s=Math.floor(new Date(e[t].start).getTime()/1e3),a=Math.floor(new Date(e[t].end).getTime()/1e3);if(!(s&&c<s)&&!(a&&c>a)){o=e[t];break}}if(o&&o.notification){let t=Math.floor(new Date(o.dateUpdated).getTime()/1e3);this.content=o.notification,this.updatedAt=t,this.showNotification()}else this.isVisible=!1}).catch(i=>{console.log(i)})},removePageStyle:function(){document.querySelector("#app").style.paddingTop="0px"},setVisited:function(){localStorage.setItem("sc-site-notification:closed",this.updatedAt)},getVisited:function(){return parseInt(localStorage.getItem("sc-site-notification:closed"))},removeVisited:function(){localStorage.removeItem("sc-site-notification:closed")},showNotification:function(){this.getVisited()?this.getVisited()!==this.updatedAt&&(this.removeVisited(),this.isVisible=!0):this.isVisible=!0},close:function(){this.setVisited(),this.removePageStyle(),this.isVisible=!1}}},b={class:"c-notification__container"},v=["innerHTML"],V={class:"c-notification__action"},N=n("span",{class:"h-accessibility"},"Close this notice.",-1),y={class:"icon i-close i-close--small","aria-hidden":"true"};function T(i,e,c,o,t,s){const a=d("crossIcon");return i.isVisible?(h(),f("section",{key:0,"aria-label":"Notification","aria-live":"assertive",class:p(["o-grid c-notification",s.colorClass])},[n("div",b,[n("div",{class:"c-notification__text",innerHTML:this.content},null,8,v)]),n("div",V,[n("button",{class:"c-notification__button js-notification-trigger",onClick:e[0]||(e[0]=(...l)=>s.close&&s.close(...l))},[N,n("span",y,[m(a)])])])],2)):u("",!0)}const D=g(_,[["render",T]]);export{D as default};
2//# sourceMappingURL=notification-DAc9zwSC.js.map

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.