var D=Object.defineProperty;var G=(e,t,n)=>t in e?D(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var C=(e,t,n)=>(G(e,typeof t!="symbol"?t+"":t,n),n);import{l as h,d as M,c as F,e as j,k as W,f as Q,g as T,S as y,o as U}from"./vendor-5350ab81.js";import{P as m,T as K}from"./index-f7321891.js";import{a as X,s as Y}from"./secure-cookie-7b8f2436.js";const x=()=>new DOMException("The request is not allowed","NotAllowedError"),J=async e=>{if(!navigator.clipboard)throw x();return navigator.clipboard.writeText(e)},Z=async e=>{const t=document.createElement("span");t.textContent=e,t.style.whiteSpace="pre",t.style.userSelect="all",document.body.appendChild(t);const n=window.getSelection(),a=window.document.createRange();n.removeAllRanges(),a.selectNode(t),n.addRange(a);let i=!1;try{i=window.document.execCommand("copy")}finally{n.removeAllRanges(),window.document.body.removeChild(t)}if(!i)throw x()},z=async e=>{try{await J(e),h.debug("Async: Copying to clipboard was successful!")}catch(t){try{await Z(e),h.debug("Fallback: Copying to clipboard was successful!")}catch(n){throw h.debug("Fallback: Unable to copy to clipboard."),t||n||x()}}};class tt{constructor(t,n){C(this,"overflowSlotTmpl",`
...
`);C(this,"getNumSlotTmpl",(t,n,a)=>`
${n}
`);var a,i,o,c,l,r,s;this.nav=document.querySelector(t),this.section=(a=this.nav)==null?void 0:a.closest("section"),this.pages=(i=this.section)==null?void 0:i.querySelectorAll(n),this.slots=(o=this.nav)==null?void 0:o.querySelectorAll("li.usa-pagination__item:not(.usa-pagination__arrow)"),this.prevItemLink=(c=this.nav)==null?void 0:c.querySelector("a.usa-pagination__previous-page"),this.nextItemLink=(l=this.nav)==null?void 0:l.querySelector("a.usa-pagination__next-page"),this.prevItem=(r=this.prevItemLink)==null?void 0:r.parentNode,this.nextItem=(s=this.nextItemLink)==null?void 0:s.parentNode,this.fisrtSlot=[],this.lastSlot=[]}getLabel(t){var n,a,i;return((i=(a=(n=this.pages)==null?void 0:n[t-1])==null?void 0:a.querySelector("img"))==null?void 0:i.getAttribute("alt"))||`${t}`}init(){var a,i,o,c;if(h.debug("pagination init"),!((a=this.pages)!=null&&a.length)||!((i=this.slots)!=null&&i.length))return;h.debug(`pagination init with ${this.pages.length} pages`),h.debug(`pagination init with ${this.slots.length} slots`);const t=(o=this.pages)==null?void 0:o.length,n=(c=this.slots)==null?void 0:c.length;this.fisrtSlot=[1,this.getLabel(1)],this.lastSlot=[t,this.getLabel(t)],this.nav.querySelectorAll("li.usa-pagination__item").forEach(l=>{l.addEventListener("click",r=>{if(r.preventDefault(),!("page"in l.dataset))return;const s=parseInt(this.nav.dataset.currentPage,10)||1,u=parseInt(l.dataset.page,10);u===s||u<1||u>t||this.updateNav(u,s,t,n)})})}updateSearchParam(t){const n=new URL(window.location.href);n.searchParams.set("page",t),window.history.replaceState({path:n.href},"",n.href)}updateNav(t,n,a,i){this.nav.dataset.currentPage=`${t}`,this.updateSearchParam(t),this.pages[t-1].hidden=!1,this.pages[n-1].hidden=!0,this.prevItem.dataset.page=`${t-1}`,this.prevItemLink.hidden=t-1<1,this.nextItem.dataset.page=`${t+1}`,this.nextItemLink.hidden=t+1>a;const o=Array(i).fill([]),c=Math.floor(i/2),l=i-c-1;let r=t-c;r<1||a<=i?r=1:t+l>a&&(r=a-i+1);for(let s=0;s=7&&(o[0]=this.fisrtSlot,o[i-1]=this.lastSlot,o[1]=o[1][0]>2?[]:o[1],o[i-2]=o[i-2][0]{const[d,b]=o[u];if(!d){s.innerHTML=this.overflowSlotTmpl,s.setAttribute("aria-label","ellipsis indicating non-visible pages"),s.classList.add("usa-pagination__overflow"),s.classList.remove("usa-pagination__page-no"),delete s.dataset.page;return}const p=d===t;s.innerHTML=this.getNumSlotTmpl(d,b.trim(),p),s.dataset.page=`${d}`,s.classList.remove("usa-pagination__overflow"),s.classList.add("usa-pagination__page-no"),s.setAttribute("aria-label","")})}}class et{constructor(){this.switcher=document.querySelector("div.lang-switcher"),this.languageNames=new Intl.DisplayNames(["en"],{type:"language"})}handelClick(t){var c,l;t.preventDefault();const n=t.target,a=(l=(c=this.switcher.querySelector('button[aria-expanded="true"]'))==null?void 0:c.dataset)==null?void 0:l.lang,i=n.dataset.lang;h.debug(`switching to ${i}`);const o=this.switcher.querySelector('button[aria-expanded="true"]');o==null||o.setAttribute("aria-expanded","false"),o.disabled=!1,n.setAttribute("aria-expanded","true"),n.disabled=!0,document.querySelectorAll(`.trans[lang="${a}"]`).forEach(r=>{r.hidden=!0}),document.querySelectorAll(`.trans[lang="${i}"]`).forEach(r=>{r.hidden=!1})}init(){this.switcher&&this.switcher.querySelectorAll("button").forEach(t=>{const n=t.dataset.lang;t.innerText=this.languageNames.of(n),t.addEventListener("click",this.handelClick.bind(this))})}}class nt{constructor(){this.buttons=null}init(){this.buttons=document.querySelectorAll(".d-button[aria-expanded][aria-controls]").forEach(t=>{new it(t)})}}class it{constructor(t){this.$button=t,this.expanded=t.getAttribute("aria-expanded"),this.controls=t.getAttribute("aria-controls"),this.$controlled=document.getElementById(this.controls),this.expanded!=="true"&&this.expanded!=="false"&&(this.expanded="false",t.setAttribute("aria-expanded",this.expanded)),this.displayPanel(),this.$button.addEventListener("click",this.onClick.bind(this))}displayPanel(){this.$controlled&&(this.$controlled.style.display=this.expanded==="true"?"revert":"none")}togglePanel(){this.expanded=this.expanded==="true"?"false":"true",this.$button.setAttribute("aria-expanded",this.expanded),this.displayPanel()}onClick(t){t.preventDefault(),this.togglePanel()}}const L="pmc-resources",at=`