window._JUPYTERLAB=window._JUPYTERLAB||{},(self.webpackChunkjnotice=self.webpackChunkjnotice||[]).push([[607,179],{607:(e,t,n)=>{n.r(t),n.d(t,{default:()=>o});const o={id:"jnotice:plugin",autoStart:!0,activate:async e=>{const t=document.getElementById("jupyter-config-data"),n=t?.textContent??"",o=n?JSON.parse(n):{},a=o.jnotice??o.page_config_data?.jnotice??o.pageConfig?.jnotice??{},i=(o.baseUrl||location.pathname.match(/\/user\/[^/]+\/?/)?.[0]||"/").replace(/\/?$/,"/"),r="string"==typeof a.path&&a.path.trim()?a.path:".jnotice.txt",c=Number.isFinite(a.pollMs)?Number(a.pollMs):6e4,s=document.cookie.match(/(?:^|; )_xsrf=([^;]+)/)?.[1]||"",l=i+"files/"+r.replace(/^\/+/,"");let p="";async function d(){try{const e=await fetch(l+"?_="+Date.now(),{credentials:"same-origin",headers:s?{"X-XSRFToken":s}:{}});if(!e.ok)return;const t=(await e.text()).trim();t&&t!==p&&(p=t,function(e){const t=document.createElement("div");t.setAttribute("role","status"),t.setAttribute("aria-live","polite"),t.style.cssText=["position:fixed","right:20px","bottom:20px","background:#ffefc6","color:#222","padding:10px 14px","border-radius:10px","box-shadow:0 2px 8px rgba(0,0,0,.2)","z-index:9999","max-width:360px","display:flex","align-items:center","gap:8px"].join(";")+";";const n=document.createElement("span");n.textContent=e,n.style.cssText="line-height:1.4;",t.appendChild(n);const o=document.createElement("button");o.type="button",o.setAttribute("aria-label","close"),o.textContent="×",o.style.cssText=["border:none","background:transparent","font-size:16px","cursor:pointer","line-height:1","padding:4px","margin-left:auto","border-radius:6px"].join(";")+";",o.onmouseenter=()=>o.style.backgroundColor="rgba(0,0,0,.06)",o.onmouseleave=()=>o.style.backgroundColor="transparent",o.onclick=()=>t.remove(),t.appendChild(o),document.body.appendChild(t)}(t))}catch{}}setTimeout(()=>{d(),setInterval(d,c)},1e3),console.log(`[jnotice] plugin loaded; polling "${r}" every ${c} ms`)}}}}]);