vanilla-breeze 0.7.1 → 0.7.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (96) hide show
  1. package/custom-elements.json +422 -7
  2. package/dist/cdn/components/activity-feed.js +1 -1
  3. package/dist/cdn/components/data-table.js +1 -1
  4. package/dist/cdn/components/manifest.json +8 -4
  5. package/dist/cdn/components/settings-panel.js +1 -1
  6. package/dist/cdn/components/site-map.js +1 -1
  7. package/dist/cdn/components/social-feed.js +5 -0
  8. package/dist/cdn/components/theme-picker.js +14 -7
  9. package/dist/cdn/packs/manifest.json +2 -2
  10. package/dist/cdn/packs/ui.full.css +1 -1
  11. package/dist/cdn/packs/ui.full.js +15 -8
  12. package/dist/cdn/themes/8bit.tokens.json +1 -1
  13. package/dist/cdn/themes/alpha1999-dark.tokens.json +1 -1
  14. package/dist/cdn/themes/alpha1999.tokens.json +1 -1
  15. package/dist/cdn/themes/art-deco-dark.tokens.json +1 -1
  16. package/dist/cdn/themes/art-deco.tokens.json +1 -1
  17. package/dist/cdn/themes/bauhaus-dark.tokens.json +1 -1
  18. package/dist/cdn/themes/bauhaus.tokens.json +1 -1
  19. package/dist/cdn/themes/brutalist-dark.tokens.json +1 -1
  20. package/dist/cdn/themes/brutalist.tokens.json +1 -1
  21. package/dist/cdn/themes/catppuccin-frappe.tokens.json +1 -1
  22. package/dist/cdn/themes/catppuccin-latte-dark.tokens.json +1 -1
  23. package/dist/cdn/themes/catppuccin-latte.tokens.json +1 -1
  24. package/dist/cdn/themes/catppuccin-macchiato.tokens.json +1 -1
  25. package/dist/cdn/themes/catppuccin-mocha.tokens.json +1 -1
  26. package/dist/cdn/themes/classic-dark.tokens.json +1 -1
  27. package/dist/cdn/themes/classic.tokens.json +1 -1
  28. package/dist/cdn/themes/claymorphism-dark.tokens.json +1 -1
  29. package/dist/cdn/themes/claymorphism.tokens.json +1 -1
  30. package/dist/cdn/themes/clinical-dark.tokens.json +1 -1
  31. package/dist/cdn/themes/clinical.tokens.json +1 -1
  32. package/dist/cdn/themes/cottagecore-dark.tokens.json +1 -1
  33. package/dist/cdn/themes/cottagecore.tokens.json +1 -1
  34. package/dist/cdn/themes/cyber.tokens.json +1 -1
  35. package/dist/cdn/themes/dawn-dark.tokens.json +1 -1
  36. package/dist/cdn/themes/dawn.tokens.json +1 -1
  37. package/dist/cdn/themes/dracula.tokens.json +1 -1
  38. package/dist/cdn/themes/dusk.tokens.json +1 -1
  39. package/dist/cdn/themes/editorial-dark.tokens.json +1 -1
  40. package/dist/cdn/themes/editorial.tokens.json +1 -1
  41. package/dist/cdn/themes/financial-dark.tokens.json +1 -1
  42. package/dist/cdn/themes/financial.tokens.json +1 -1
  43. package/dist/cdn/themes/genai.tokens.json +1 -1
  44. package/dist/cdn/themes/glassmorphism-dark.tokens.json +1 -1
  45. package/dist/cdn/themes/glassmorphism.tokens.json +1 -1
  46. package/dist/cdn/themes/government-dark.tokens.json +1 -1
  47. package/dist/cdn/themes/government.tokens.json +1 -1
  48. package/dist/cdn/themes/gruvbox-dark.tokens.json +1 -1
  49. package/dist/cdn/themes/gruvbox.tokens.json +1 -1
  50. package/dist/cdn/themes/high-noon-dark.tokens.json +1 -1
  51. package/dist/cdn/themes/high-noon.tokens.json +1 -1
  52. package/dist/cdn/themes/journal-dark.tokens.json +1 -1
  53. package/dist/cdn/themes/journal.tokens.json +1 -1
  54. package/dist/cdn/themes/kawaii-dark.tokens.json +1 -1
  55. package/dist/cdn/themes/kawaii.tokens.json +1 -1
  56. package/dist/cdn/themes/magna-dark.tokens.json +1 -1
  57. package/dist/cdn/themes/magna.tokens.json +1 -1
  58. package/dist/cdn/themes/midnight.tokens.json +1 -1
  59. package/dist/cdn/themes/minimal-dark.tokens.json +1 -1
  60. package/dist/cdn/themes/minimal.tokens.json +1 -1
  61. package/dist/cdn/themes/modern-dark.tokens.json +1 -1
  62. package/dist/cdn/themes/modern.tokens.json +1 -1
  63. package/dist/cdn/themes/nes-dark.tokens.json +1 -1
  64. package/dist/cdn/themes/nes.tokens.json +1 -1
  65. package/dist/cdn/themes/neumorphism-dark.tokens.json +1 -1
  66. package/dist/cdn/themes/neumorphism.tokens.json +1 -1
  67. package/dist/cdn/themes/nord-dark.tokens.json +1 -1
  68. package/dist/cdn/themes/nord.tokens.json +1 -1
  69. package/dist/cdn/themes/organic-dark.tokens.json +1 -1
  70. package/dist/cdn/themes/organic.tokens.json +1 -1
  71. package/dist/cdn/themes/rose-pine-dark.tokens.json +1 -1
  72. package/dist/cdn/themes/rose-pine.tokens.json +1 -1
  73. package/dist/cdn/themes/rough-dark.tokens.json +1 -1
  74. package/dist/cdn/themes/rough.tokens.json +1 -1
  75. package/dist/cdn/themes/solarized-dark.tokens.json +1 -1
  76. package/dist/cdn/themes/solarized.tokens.json +1 -1
  77. package/dist/cdn/themes/startup-dark.tokens.json +1 -1
  78. package/dist/cdn/themes/startup.tokens.json +1 -1
  79. package/dist/cdn/themes/super2026-dark.tokens.json +1 -1
  80. package/dist/cdn/themes/super2026.tokens.json +1 -1
  81. package/dist/cdn/themes/swiss-dark.tokens.json +1 -1
  82. package/dist/cdn/themes/swiss.tokens.json +1 -1
  83. package/dist/cdn/themes/terminal.tokens.json +1 -1
  84. package/dist/cdn/themes/tokyo-night-dark.tokens.json +1 -1
  85. package/dist/cdn/themes/tokyo-night.tokens.json +1 -1
  86. package/dist/cdn/themes/vaporwave-dark.tokens.json +1 -1
  87. package/dist/cdn/themes/vaporwave.tokens.json +1 -1
  88. package/dist/cdn/themes/win9x-dark.tokens.json +1 -1
  89. package/dist/cdn/themes/win9x.tokens.json +1 -1
  90. package/dist/cdn/vanilla-breeze-autoload.js +52 -52
  91. package/dist/cdn/vanilla-breeze-core.css +1 -1
  92. package/dist/cdn/vanilla-breeze-core.js +44 -44
  93. package/dist/cdn/vanilla-breeze-extras.js +36 -33
  94. package/dist/cdn/vanilla-breeze.css +1 -1
  95. package/dist/cdn/vanilla-breeze.js +168 -158
  96. package/package.json +2 -2
@@ -1,5 +1,5 @@
1
- var rn=Object.defineProperty;var ce=(r,t)=>()=>(r&&(t=r(r=0)),t);var Ki=(r,t)=>{for(var e in t)rn(r,e,{get:t[e],enumerable:!0})};function ls(r,t,e){let i=256*Math.pow(2,e),s=r/i*360-180;return{lat:Math.atan(Math.sinh(Math.PI*(1-2*t/i)))*180/Math.PI,lng:s}}function nt(r,t,e){let i=256*Math.pow(2,e),s=r*Math.PI/180;return{x:(t+180)/360*i,y:(1-Math.log(Math.tan(s)+1/Math.cos(s))/Math.PI)/2*i}}function wn(r,t,e,i,s){let n=s??(typeof devicePixelRatio=="number"?devicePixelRatio:1),o="abc"[Math.abs(e+i)%3];return r.replaceAll("{z}",String(t)).replaceAll("{x}",String(e)).replaceAll("{y}",String(i)).replaceAll("{s}",o).replaceAll("{r}",n>1?"@2x":"")}function Pt(r,t,e,i,s){let n=s||(W[r]??W.osm).template;return wn(n,t,e,i)}var W,ge=ce(()=>{W={osm:{template:"https://tile.openstreetmap.org/{z}/{x}/{y}.png",origin:"https://tile.openstreetmap.org",credits:[{text:"\xA9 OpenStreetMap contributors",href:"https://www.openstreetmap.org/copyright"}]},"carto-light":{template:"https://basemaps.cartocdn.com/light_all/{z}/{x}/{y}{r}.png",origin:"https://basemaps.cartocdn.com",credits:[{text:"\xA9 OpenStreetMap contributors",href:"https://www.openstreetmap.org/copyright"},{text:"\xA9 CARTO",href:"https://carto.com/attributions"}]},"carto-dark":{template:"https://basemaps.cartocdn.com/dark_all/{z}/{x}/{y}{r}.png",origin:"https://basemaps.cartocdn.com",credits:[{text:"\xA9 OpenStreetMap contributors",href:"https://www.openstreetmap.org/copyright"},{text:"\xA9 CARTO",href:"https://carto.com/attributions"}]}}});var cs={};Ki(cs,{MapInteraction:()=>be});var be,hs=ce(()=>{ge();be=class{#t;#e;#i;#s;#r;#n;#a;#c;#h=0;#l=0;#o=15;#u=1;#p=19;#d=0;#f=0;#k=0;#v=0;#g=15;#y=0;#w=0;#m=new Map;#b=0;#C=0;#x=new Map;#L=0;#E=0;constructor({host:t,viewport:e,tiles:i,marker:s,lat:n,lng:o,zoom:a,provider:l,tileUrl:c,width:h,height:u,onDeactivate:p,onMove:d}){this.#c=t,this.#t=e,this.#e=i,this.#i=s,this.#s=l,this.#r=c||"",this.#n=p,this.#a=d||(()=>{}),this.#o=a,this.#k=this.#b=n,this.#v=this.#C=o,this.#g=a,this.#y=h,this.#w=u;let f=nt(n,o,a);this.#h=f.x,this.#l=f.y,this.#A(),this.#e.replaceChildren(),this.#e.style.transform="",this.#i&&this.#e.appendChild(this.#i),this.#t.addEventListener("pointerdown",this.#T),this.#t.addEventListener("pointermove",this.#S),this.#t.addEventListener("pointerup",this.#z),this.#t.addEventListener("pointercancel",this.#z),this.#t.addEventListener("wheel",this.#$,{passive:!1}),this.#t.addEventListener("keydown",this.#_),this.#D()}get zoom(){return this.#o}get minZoom(){return this.#u}get maxZoom(){return this.#p}get center(){let{lat:t,lng:e}=ls(this.#h,this.#l,this.#o);return{lat:+t.toFixed(6),lng:+e.toFixed(6),zoom:this.#o}}zoomBy(t){this.#M(this.#o+t,this.#y/2,this.#w/2)}recenter(){this.#o=this.#g;let t=nt(this.#k,this.#v,this.#o);this.#h=t.x,this.#l=t.y,this.#R(),this.#A(),this.#B(),this.#D(),this.#P()}panBy(t,e){this.#h+=t,this.#l+=e,this.#B(),this.#D()}resize(t,e){!t||!e||t===this.#y&&e===this.#w||(this.#y=t,this.#w=e,this.#B(),this.#D())}#A(){this.#d=Math.floor(this.#h/256)*256,this.#f=Math.floor(this.#l/256)*256}#T=t=>{if(!(t.pointerType==="mouse"&&t.button!==0)&&!t.target.closest?.("a, button")){t.preventDefault(),this.#t.focus({preventScroll:!0}),this.#x.set(t.pointerId,{x:t.clientX,y:t.clientY});try{this.#t.setPointerCapture(t.pointerId)}catch{}this.#x.size===1?(this.#L=0,this.#t.setAttribute("data-dragging","")):this.#x.size===2&&(this.#E=this.#I(),this.#L=1/0)}};#S=t=>{let e=this.#x.get(t.pointerId);if(!e)return;let i=t.clientX-e.x,s=t.clientY-e.y;if(e.x=t.clientX,e.y=t.clientY,this.#x.size===1){this.#L+=Math.abs(i)+Math.abs(s),this.panBy(-i,-s);return}if(this.#x.size===2){this.panBy(-i/2,-s/2);let n=this.#I();if(!this.#E){this.#E=n;return}let o=n/this.#E;if(o>=1.5||o<=1/1.5){let a=this.#N();this.#M(this.#o+(o>1?1:-1),a.x,a.y),this.#E=n}}};#z=t=>{if(!this.#x.has(t.pointerId))return;let e=this.#x.size===1;this.#x.delete(t.pointerId);try{this.#t.releasePointerCapture(t.pointerId)}catch{}if(this.#x.size<2&&(this.#E=0),!(this.#x.size>0)){if(this.#t.removeAttribute("data-dragging"),e&&t.type==="pointerup"&&this.#L<5){let i=this.#t.getBoundingClientRect();this.panBy(t.clientX-i.left-this.#y/2,t.clientY-i.top-this.#w/2)}this.#P()}};#I(){let[t,e]=[...this.#x.values()];return t&&e?Math.hypot(t.x-e.x,t.y-e.y):0}#N(){let[t,e]=[...this.#x.values()],i=this.#t.getBoundingClientRect();return{x:(t.x+e.x)/2-i.left,y:(t.y+e.y)/2-i.top}}#$=t=>{t.preventDefault();let e=t.ctrlKey?-t.deltaY*.01:-Math.sign(t.deltaY),i=Math.round(Math.max(this.#u,Math.min(this.#p,this.#o+e)));if(i===this.#o)return;let s=this.#t.getBoundingClientRect();this.#M(i,t.clientX-s.left,t.clientY-s.top)};#_=t=>{if(t.target!==this.#t)return;let e=80,i=null;switch(t.key){case"ArrowLeft":i=[-e,0];break;case"ArrowRight":i=[e,0];break;case"ArrowUp":i=[0,-e];break;case"ArrowDown":i=[0,e];break;case"+":case"=":t.preventDefault(),this.zoomBy(1);return;case"-":case"_":t.preventDefault(),this.zoomBy(-1);return;case"Home":case"0":t.preventDefault(),this.recenter();return;case"Escape":t.preventDefault(),this.#n();return;default:return}t.preventDefault(),this.panBy(i[0],i[1]),this.#P()};#M(t,e,i){if(t=Math.max(this.#u,Math.min(this.#p,t)),t===this.#o)return;let s=this.#h-this.#y/2+e,n=this.#l-this.#w/2+i,o=Math.pow(2,t-this.#o);this.#h=s*o-e+this.#y/2,this.#l=n*o-i+this.#w/2,this.#o=t,this.#R(),this.#B(),this.#A(),this.#D(),this.#P()}#B(){let t=256*Math.pow(2,this.#o),e=(this.#h%t+t)%t;e!==this.#h&&(this.#h=e,this.#R(),this.#A());let i=Math.min(this.#w/2,t/2);this.#l=Math.max(i,Math.min(t-i,this.#l))}#D(){let t=-(this.#h-this.#y/2-this.#d),e=-(this.#l-this.#w/2-this.#f);this.#e.style.transform=`translate(${Math.round(t)}px, ${Math.round(e)}px)`,this.#F(),this.#j(),this.#O()}#F(){let t=this.#o,e=Math.pow(2,t),i=this.#h-this.#y/2,s=this.#l-this.#w/2,n=Math.floor(i/256)-1,o=Math.max(0,Math.floor(s/256)-1),a=Math.ceil((i+this.#y)/256)+1,l=Math.min(e,Math.ceil((s+this.#w)/256)+1);for(let c=o;c<l;c++)for(let h=n;h<a;h++){let u=(h%e+e)%e,p=`${t}/${h}/${c}`;if(this.#m.has(p))continue;let d=document.createElement("img");d.src=Pt(this.#s,t,u,c,this.#r),d.alt="",d.draggable=!1,d.style.left=`${h*256-this.#d}px`,d.style.top=`${c*256-this.#f}px`,d._wx=h*256,d._wy=c*256,this.#m.set(p,d),this.#e.insertBefore(d,this.#i?.parentNode===this.#e?this.#i:null)}}#j(){let t=this.#h-this.#y/2,e=this.#l-this.#w/2,i=512;for(let[s,n]of this.#m){let o=n._wx??0,a=n._wy??0;(o+256<t-i||o>t+this.#y+i||a+256<e-i||a>e+this.#w+i)&&(n.remove(),this.#m.delete(s))}}#O(){if(!this.#i)return;let t=nt(this.#b,this.#C,this.#o),e=this.#i.offsetWidth||32,i=256*Math.pow(2,this.#o),s=t.x;for(;s-this.#h>i/2;)s-=i;for(;this.#h-s>i/2;)s+=i;this.#i.style.top=`${Math.round(t.y-this.#f-e)}px`,this.#i.style.left=`${Math.round(s-this.#d-e/2)}px`,this.#i.style.transform="none"}#P(){let t=this.center;this.#c.dispatchEvent(new CustomEvent("geo-map:move",{bubbles:!0,detail:t})),this.#a(t)}#R(){for(let t of this.#m.values())t.remove();this.#m.clear()}destroy(){this.#t.removeEventListener("pointerdown",this.#T),this.#t.removeEventListener("pointermove",this.#S),this.#t.removeEventListener("pointerup",this.#z),this.#t.removeEventListener("pointercancel",this.#z),this.#t.removeEventListener("wheel",this.#$),this.#t.removeEventListener("keydown",this.#_),this.#t.removeAttribute("data-dragging"),this.#x.clear(),this.#R()}}});var we={};Ki(we,{EMOJI_ALIASES:()=>ms,EMOJI_GROUPS:()=>En,EMOJI_GROUP_ICONS:()=>Cn,EMOJI_GROUP_LABELS:()=>Sn,EMOJI_MAP:()=>bt,EXTENDED_EVENT:()=>Tn,EXTENDED_REGISTRY:()=>gs,extendedCount:()=>Ln,getByGroup:()=>_n,resolveEmoji:()=>Mn,searchEmoji:()=>Rn});function It(){for(;fs<ps.length;){let r=ps[fs++];for(let[t,e,i,s]of r){if(bt.has(t))continue;let n={shortcode:t,emoji:e,name:i,keywords:[],group:s};bt.set(t,n),vt.push(n)}}}function Ln(){return It(),vt.length}function Mn(r){It();let t=bt.get(r);if(t)return t;let e=ms.get(r);return e&&bt.get(e)||null}function _n(r){It();let t=$t.filter(i=>i.group===r),e=vt.filter(i=>i.group===r);return e.length>0?t.concat(e):t}function Rn(r){It();let t=r.toLowerCase().trim(),e=vt.length>0?$t.concat(vt):$t;return t?e.filter(i=>i.shortcode.includes(t)||i.name.toLowerCase().includes(t)||i.keywords&&i.keywords.some(s=>s.includes(t))):e}var $t,bt,ms,En,Sn,Cn,gs,Tn,ps,fs,vt,ke=ce(()=>{$t=[{shortcode:"smile",emoji:"\u{1F604}",name:"Smiling Face with Open Mouth",keywords:["happy","joy","laugh"],group:"smileys"},{shortcode:"grinning",emoji:"\u{1F600}",name:"Grinning Face",keywords:["happy","smile"],group:"smileys"},{shortcode:"laughing",emoji:"\u{1F606}",name:"Grinning Squinting Face",keywords:["happy","laugh"],group:"smileys"},{shortcode:"sweat_smile",emoji:"\u{1F605}",name:"Grinning Face with Sweat",keywords:["hot","relief"],group:"smileys"},{shortcode:"rofl",emoji:"\u{1F923}",name:"Rolling on the Floor Laughing",keywords:["lol","funny"],group:"smileys"},{shortcode:"joy",emoji:"\u{1F602}",name:"Face with Tears of Joy",keywords:["happy","cry","laugh"],group:"smileys"},{shortcode:"slightly_smiling_face",emoji:"\u{1F642}",name:"Slightly Smiling Face",keywords:["smile"],group:"smileys"},{shortcode:"upside_down_face",emoji:"\u{1F643}",name:"Upside-Down Face",keywords:["sarcasm","silly"],group:"smileys"},{shortcode:"wink",emoji:"\u{1F609}",name:"Winking Face",keywords:["flirt","joke"],group:"smileys"},{shortcode:"blush",emoji:"\u{1F60A}",name:"Smiling Face with Smiling Eyes",keywords:["happy","shy"],group:"smileys"},{shortcode:"innocent",emoji:"\u{1F607}",name:"Smiling Face with Halo",keywords:["angel","good"],group:"smileys"},{shortcode:"heart_eyes",emoji:"\u{1F60D}",name:"Smiling Face with Heart-Eyes",keywords:["love","crush"],group:"smileys"},{shortcode:"star_struck",emoji:"\u{1F929}",name:"Star-Struck",keywords:["wow","amazing"],group:"smileys"},{shortcode:"kissing_heart",emoji:"\u{1F618}",name:"Face Blowing a Kiss",keywords:["love","kiss"],group:"smileys"},{shortcode:"yum",emoji:"\u{1F60B}",name:"Face Savoring Food",keywords:["delicious","tasty"],group:"smileys"},{shortcode:"stuck_out_tongue",emoji:"\u{1F61B}",name:"Face with Tongue",keywords:["playful","silly"],group:"smileys"},{shortcode:"stuck_out_tongue_winking_eye",emoji:"\u{1F61C}",name:"Winking Face with Tongue",keywords:["silly","playful"],group:"smileys"},{shortcode:"zany_face",emoji:"\u{1F92A}",name:"Zany Face",keywords:["crazy","wild"],group:"smileys"},{shortcode:"hugs",emoji:"\u{1F917}",name:"Hugging Face",keywords:["hug","warm"],group:"smileys"},{shortcode:"thinking",emoji:"\u{1F914}",name:"Thinking Face",keywords:["hmm","consider"],group:"smileys"},{shortcode:"shushing_face",emoji:"\u{1F92B}",name:"Shushing Face",keywords:["quiet","secret"],group:"smileys"},{shortcode:"smirk",emoji:"\u{1F60F}",name:"Smirking Face",keywords:["sly","suggestive"],group:"smileys"},{shortcode:"unamused",emoji:"\u{1F612}",name:"Unamused Face",keywords:["bored","unimpressed"],group:"smileys"},{shortcode:"roll_eyes",emoji:"\u{1F644}",name:"Face with Rolling Eyes",keywords:["annoyed","whatever"],group:"smileys"},{shortcode:"grimacing",emoji:"\u{1F62C}",name:"Grimacing Face",keywords:["awkward","nervous"],group:"smileys"},{shortcode:"relieved",emoji:"\u{1F60C}",name:"Relieved Face",keywords:["calm","peaceful"],group:"smileys"},{shortcode:"pensive",emoji:"\u{1F614}",name:"Pensive Face",keywords:["sad","thoughtful"],group:"smileys"},{shortcode:"sleepy",emoji:"\u{1F62A}",name:"Sleepy Face",keywords:["tired","sleep"],group:"smileys"},{shortcode:"sleeping",emoji:"\u{1F634}",name:"Sleeping Face",keywords:["zzz","sleep"],group:"smileys"},{shortcode:"mask",emoji:"\u{1F637}",name:"Face with Medical Mask",keywords:["sick","health"],group:"smileys"},{shortcode:"nerd_face",emoji:"\u{1F913}",name:"Nerd Face",keywords:["geek","smart"],group:"smileys"},{shortcode:"sunglasses",emoji:"\u{1F60E}",name:"Smiling Face with Sunglasses",keywords:["cool","chill"],group:"smileys"},{shortcode:"confused",emoji:"\u{1F615}",name:"Confused Face",keywords:["puzzled","unsure"],group:"smileys"},{shortcode:"worried",emoji:"\u{1F61F}",name:"Worried Face",keywords:["anxious","concern"],group:"smileys"},{shortcode:"cry",emoji:"\u{1F622}",name:"Crying Face",keywords:["sad","tear"],group:"smileys"},{shortcode:"sob",emoji:"\u{1F62D}",name:"Loudly Crying Face",keywords:["sad","cry"],group:"smileys"},{shortcode:"angry",emoji:"\u{1F620}",name:"Angry Face",keywords:["mad","annoyed"],group:"smileys"},{shortcode:"rage",emoji:"\u{1F92C}",name:"Face with Symbols on Mouth",keywords:["angry","swear"],group:"smileys"},{shortcode:"exploding_head",emoji:"\u{1F92F}",name:"Exploding Head",keywords:["mind blown","shocked"],group:"smileys"},{shortcode:"flushed",emoji:"\u{1F633}",name:"Flushed Face",keywords:["embarrassed","shocked"],group:"smileys"},{shortcode:"scream",emoji:"\u{1F631}",name:"Face Screaming in Fear",keywords:["scared","horror"],group:"smileys"},{shortcode:"skull",emoji:"\u{1F480}",name:"Skull",keywords:["dead","death"],group:"smileys"},{shortcode:"clown_face",emoji:"\u{1F921}",name:"Clown Face",keywords:["joke","funny"],group:"smileys"},{shortcode:"ghost",emoji:"\u{1F47B}",name:"Ghost",keywords:["halloween","spooky"],group:"smileys"},{shortcode:"wave",emoji:"\u{1F44B}",name:"Waving Hand",keywords:["hello","goodbye"],group:"people"},{shortcode:"raised_hand",emoji:"\u270B",name:"Raised Hand",keywords:["stop","high five"],group:"people"},{shortcode:"ok_hand",emoji:"\u{1F44C}",name:"OK Hand",keywords:["perfect","nice"],group:"people"},{shortcode:"thumbsup",emoji:"\u{1F44D}",name:"Thumbs Up",keywords:["approve","good","yes"],group:"people"},{shortcode:"thumbsdown",emoji:"\u{1F44E}",name:"Thumbs Down",keywords:["disapprove","bad","no"],group:"people"},{shortcode:"clap",emoji:"\u{1F44F}",name:"Clapping Hands",keywords:["applause","bravo"],group:"people"},{shortcode:"raised_hands",emoji:"\u{1F64C}",name:"Raising Hands",keywords:["celebration","hooray"],group:"people"},{shortcode:"pray",emoji:"\u{1F64F}",name:"Folded Hands",keywords:["thanks","please","hope"],group:"people"},{shortcode:"handshake",emoji:"\u{1F91D}",name:"Handshake",keywords:["deal","agreement"],group:"people"},{shortcode:"point_up",emoji:"\u261D\uFE0F",name:"Index Pointing Up",keywords:["attention","important"],group:"people"},{shortcode:"point_right",emoji:"\u{1F449}",name:"Backhand Index Pointing Right",keywords:["direction","this"],group:"people"},{shortcode:"point_left",emoji:"\u{1F448}",name:"Backhand Index Pointing Left",keywords:["direction","that"],group:"people"},{shortcode:"point_down",emoji:"\u{1F447}",name:"Backhand Index Pointing Down",keywords:["direction","below"],group:"people"},{shortcode:"v",emoji:"\u270C\uFE0F",name:"Victory Hand",keywords:["peace","two"],group:"people"},{shortcode:"crossed_fingers",emoji:"\u{1F91E}",name:"Crossed Fingers",keywords:["luck","hope"],group:"people"},{shortcode:"muscle",emoji:"\u{1F4AA}",name:"Flexed Biceps",keywords:["strong","power"],group:"people"},{shortcode:"writing_hand",emoji:"\u270D\uFE0F",name:"Writing Hand",keywords:["write","note"],group:"people"},{shortcode:"eyes",emoji:"\u{1F440}",name:"Eyes",keywords:["look","see","watch"],group:"people"},{shortcode:"brain",emoji:"\u{1F9E0}",name:"Brain",keywords:["smart","think","mind"],group:"people"},{shortcode:"speaking_head",emoji:"\u{1F5E3}\uFE0F",name:"Speaking Head",keywords:["talk","announce"],group:"people"},{shortcode:"baby",emoji:"\u{1F476}",name:"Baby",keywords:["child","newborn"],group:"people"},{shortcode:"person_shrugging",emoji:"\u{1F937}",name:"Person Shrugging",keywords:["dunno","whatever"],group:"people"},{shortcode:"person_facepalming",emoji:"\u{1F926}",name:"Person Facepalming",keywords:["frustration","disbelief"],group:"people"},{shortcode:"person_raising_hand",emoji:"\u{1F64B}",name:"Person Raising Hand",keywords:["question","volunteer"],group:"people"},{shortcode:"ninja",emoji:"\u{1F977}",name:"Ninja",keywords:["stealth","hidden"],group:"people"},{shortcode:"dog",emoji:"\u{1F436}",name:"Dog Face",keywords:["puppy","pet"],group:"animals"},{shortcode:"cat",emoji:"\u{1F431}",name:"Cat Face",keywords:["kitten","pet"],group:"animals"},{shortcode:"mouse",emoji:"\u{1F42D}",name:"Mouse Face",keywords:["rodent"],group:"animals"},{shortcode:"rabbit",emoji:"\u{1F430}",name:"Rabbit Face",keywords:["bunny","easter"],group:"animals"},{shortcode:"fox",emoji:"\u{1F98A}",name:"Fox",keywords:["clever","sly"],group:"animals"},{shortcode:"bear",emoji:"\u{1F43B}",name:"Bear",keywords:["teddy","nature"],group:"animals"},{shortcode:"unicorn",emoji:"\u{1F984}",name:"Unicorn",keywords:["magic","fantasy"],group:"animals"},{shortcode:"bee",emoji:"\u{1F41D}",name:"Honeybee",keywords:["honey","buzz"],group:"animals"},{shortcode:"butterfly",emoji:"\u{1F98B}",name:"Butterfly",keywords:["pretty","nature"],group:"animals"},{shortcode:"turtle",emoji:"\u{1F422}",name:"Turtle",keywords:["slow","shell"],group:"animals"},{shortcode:"snake",emoji:"\u{1F40D}",name:"Snake",keywords:["reptile"],group:"animals"},{shortcode:"whale",emoji:"\u{1F433}",name:"Spouting Whale",keywords:["ocean","sea"],group:"animals"},{shortcode:"dolphin",emoji:"\u{1F42C}",name:"Dolphin",keywords:["ocean","smart"],group:"animals"},{shortcode:"eagle",emoji:"\u{1F985}",name:"Eagle",keywords:["bird","freedom"],group:"animals"},{shortcode:"owl",emoji:"\u{1F989}",name:"Owl",keywords:["wise","night"],group:"animals"},{shortcode:"penguin",emoji:"\u{1F427}",name:"Penguin",keywords:["cold","linux"],group:"animals"},{shortcode:"octopus",emoji:"\u{1F419}",name:"Octopus",keywords:["ocean","tentacle"],group:"animals"},{shortcode:"seedling",emoji:"\u{1F331}",name:"Seedling",keywords:["plant","grow"],group:"animals"},{shortcode:"evergreen_tree",emoji:"\u{1F332}",name:"Evergreen Tree",keywords:["nature","pine"],group:"animals"},{shortcode:"sunflower",emoji:"\u{1F33B}",name:"Sunflower",keywords:["flower","yellow"],group:"animals"},{shortcode:"rose",emoji:"\u{1F339}",name:"Rose",keywords:["flower","love"],group:"animals"},{shortcode:"apple",emoji:"\u{1F34E}",name:"Red Apple",keywords:["fruit","healthy"],group:"food"},{shortcode:"banana",emoji:"\u{1F34C}",name:"Banana",keywords:["fruit","yellow"],group:"food"},{shortcode:"grapes",emoji:"\u{1F347}",name:"Grapes",keywords:["fruit","wine"],group:"food"},{shortcode:"watermelon",emoji:"\u{1F349}",name:"Watermelon",keywords:["fruit","summer"],group:"food"},{shortcode:"avocado",emoji:"\u{1F951}",name:"Avocado",keywords:["guacamole","healthy"],group:"food"},{shortcode:"pizza",emoji:"\u{1F355}",name:"Pizza",keywords:["food","italian"],group:"food"},{shortcode:"hamburger",emoji:"\u{1F354}",name:"Hamburger",keywords:["burger","fast food"],group:"food"},{shortcode:"taco",emoji:"\u{1F32E}",name:"Taco",keywords:["mexican","food"],group:"food"},{shortcode:"sushi",emoji:"\u{1F363}",name:"Sushi",keywords:["japanese","fish"],group:"food"},{shortcode:"cookie",emoji:"\u{1F36A}",name:"Cookie",keywords:["sweet","biscuit"],group:"food"},{shortcode:"cake",emoji:"\u{1F382}",name:"Birthday Cake",keywords:["birthday","celebration"],group:"food"},{shortcode:"ice_cream",emoji:"\u{1F366}",name:"Soft Ice Cream",keywords:["dessert","cold"],group:"food"},{shortcode:"chocolate_bar",emoji:"\u{1F36B}",name:"Chocolate Bar",keywords:["sweet","candy"],group:"food"},{shortcode:"popcorn",emoji:"\u{1F37F}",name:"Popcorn",keywords:["movie","snack"],group:"food"},{shortcode:"coffee",emoji:"\u2615",name:"Hot Beverage",keywords:["tea","drink","morning"],group:"food"},{shortcode:"beer",emoji:"\u{1F37A}",name:"Beer Mug",keywords:["drink","bar"],group:"food"},{shortcode:"wine_glass",emoji:"\u{1F377}",name:"Wine Glass",keywords:["drink","alcohol"],group:"food"},{shortcode:"cocktail",emoji:"\u{1F378}",name:"Cocktail Glass",keywords:["drink","martini"],group:"food"},{shortcode:"hot_pepper",emoji:"\u{1F336}\uFE0F",name:"Hot Pepper",keywords:["spicy","chili"],group:"food"},{shortcode:"egg",emoji:"\u{1F95A}",name:"Egg",keywords:["breakfast","food"],group:"food"},{shortcode:"earth_americas",emoji:"\u{1F30E}",name:"Globe Americas",keywords:["world","planet"],group:"travel"},{shortcode:"earth_europe",emoji:"\u{1F30D}",name:"Globe Europe-Africa",keywords:["world","planet"],group:"travel"},{shortcode:"sun",emoji:"\u2600\uFE0F",name:"Sun",keywords:["weather","bright","warm"],group:"travel"},{shortcode:"moon",emoji:"\u{1F319}",name:"Crescent Moon",keywords:["night","sleep"],group:"travel"},{shortcode:"star",emoji:"\u2B50",name:"Star",keywords:["favorite","rating"],group:"travel"},{shortcode:"star2",emoji:"\u{1F31F}",name:"Glowing Star",keywords:["sparkle","shine"],group:"travel"},{shortcode:"cloud",emoji:"\u2601\uFE0F",name:"Cloud",keywords:["weather","sky"],group:"travel"},{shortcode:"rainbow",emoji:"\u{1F308}",name:"Rainbow",keywords:["colorful","weather"],group:"travel"},{shortcode:"snowflake",emoji:"\u2744\uFE0F",name:"Snowflake",keywords:["cold","winter"],group:"travel"},{shortcode:"zap",emoji:"\u26A1",name:"High Voltage",keywords:["lightning","electric","fast"],group:"travel"},{shortcode:"fire",emoji:"\u{1F525}",name:"Fire",keywords:["hot","flame","lit"],group:"travel"},{shortcode:"ocean",emoji:"\u{1F30A}",name:"Water Wave",keywords:["sea","wave","surf"],group:"travel"},{shortcode:"airplane",emoji:"\u2708\uFE0F",name:"Airplane",keywords:["travel","flight"],group:"travel"},{shortcode:"rocket",emoji:"\u{1F680}",name:"Rocket",keywords:["launch","space","fast"],group:"travel"},{shortcode:"car",emoji:"\u{1F697}",name:"Automobile",keywords:["drive","vehicle"],group:"travel"},{shortcode:"house",emoji:"\u{1F3E0}",name:"House",keywords:["home","building"],group:"travel"},{shortcode:"tent",emoji:"\u26FA",name:"Tent",keywords:["camping","outdoor"],group:"travel"},{shortcode:"mountain",emoji:"\u26F0\uFE0F",name:"Mountain",keywords:["nature","hike"],group:"travel"},{shortcode:"desert_island",emoji:"\u{1F3DD}\uFE0F",name:"Desert Island",keywords:["beach","vacation"],group:"travel"},{shortcode:"volcano",emoji:"\u{1F30B}",name:"Volcano",keywords:["eruption","nature"],group:"travel"},{shortcode:"soccer",emoji:"\u26BD",name:"Soccer Ball",keywords:["football","sport"],group:"activities"},{shortcode:"basketball",emoji:"\u{1F3C0}",name:"Basketball",keywords:["sport","hoop"],group:"activities"},{shortcode:"tennis",emoji:"\u{1F3BE}",name:"Tennis",keywords:["sport","ball"],group:"activities"},{shortcode:"video_game",emoji:"\u{1F3AE}",name:"Video Game",keywords:["gaming","controller"],group:"activities"},{shortcode:"dart",emoji:"\u{1F3AF}",name:"Bullseye",keywords:["target","goal"],group:"activities"},{shortcode:"trophy",emoji:"\u{1F3C6}",name:"Trophy",keywords:["winner","champion"],group:"activities"},{shortcode:"medal",emoji:"\u{1F947}",name:"Gold Medal",keywords:["first","winner"],group:"activities"},{shortcode:"tada",emoji:"\u{1F389}",name:"Party Popper",keywords:["celebration","party"],group:"activities"},{shortcode:"confetti_ball",emoji:"\u{1F38A}",name:"Confetti Ball",keywords:["party","celebration"],group:"activities"},{shortcode:"balloon",emoji:"\u{1F388}",name:"Balloon",keywords:["party","birthday"],group:"activities"},{shortcode:"art",emoji:"\u{1F3A8}",name:"Artist Palette",keywords:["paint","creative"],group:"activities"},{shortcode:"musical_note",emoji:"\u{1F3B5}",name:"Musical Note",keywords:["music","song"],group:"activities"},{shortcode:"microphone",emoji:"\u{1F3A4}",name:"Microphone",keywords:["sing","karaoke"],group:"activities"},{shortcode:"guitar",emoji:"\u{1F3B8}",name:"Guitar",keywords:["music","rock"],group:"activities"},{shortcode:"dice",emoji:"\u{1F3B2}",name:"Game Die",keywords:["chance","random"],group:"activities"},{shortcode:"bulb",emoji:"\u{1F4A1}",name:"Light Bulb",keywords:["idea","bright"],group:"objects"},{shortcode:"computer",emoji:"\u{1F4BB}",name:"Laptop",keywords:["tech","work"],group:"objects"},{shortcode:"keyboard",emoji:"\u2328\uFE0F",name:"Keyboard",keywords:["type","computer"],group:"objects"},{shortcode:"phone",emoji:"\u{1F4F1}",name:"Mobile Phone",keywords:["cell","call"],group:"objects"},{shortcode:"camera",emoji:"\u{1F4F7}",name:"Camera",keywords:["photo","picture"],group:"objects"},{shortcode:"tv",emoji:"\u{1F4FA}",name:"Television",keywords:["watch","screen"],group:"objects"},{shortcode:"battery",emoji:"\u{1F50B}",name:"Battery",keywords:["charge","power"],group:"objects"},{shortcode:"electric_plug",emoji:"\u{1F50C}",name:"Electric Plug",keywords:["power","connect"],group:"objects"},{shortcode:"mag",emoji:"\u{1F50D}",name:"Magnifying Glass Left",keywords:["search","find"],group:"objects"},{shortcode:"lock",emoji:"\u{1F512}",name:"Locked",keywords:["security","private"],group:"objects"},{shortcode:"unlock",emoji:"\u{1F513}",name:"Unlocked",keywords:["open","access"],group:"objects"},{shortcode:"key",emoji:"\u{1F511}",name:"Key",keywords:["access","password"],group:"objects"},{shortcode:"hammer",emoji:"\u{1F528}",name:"Hammer",keywords:["tool","build"],group:"objects"},{shortcode:"wrench",emoji:"\u{1F527}",name:"Wrench",keywords:["tool","fix"],group:"objects"},{shortcode:"gear",emoji:"\u2699\uFE0F",name:"Gear",keywords:["settings","config"],group:"objects"},{shortcode:"link",emoji:"\u{1F517}",name:"Link",keywords:["chain","url"],group:"objects"},{shortcode:"paperclip",emoji:"\u{1F4CE}",name:"Paperclip",keywords:["attach","clip"],group:"objects"},{shortcode:"scissors",emoji:"\u2702\uFE0F",name:"Scissors",keywords:["cut","snip"],group:"objects"},{shortcode:"pen",emoji:"\u{1F58A}\uFE0F",name:"Pen",keywords:["write","sign"],group:"objects"},{shortcode:"pencil",emoji:"\u270F\uFE0F",name:"Pencil",keywords:["write","draw"],group:"objects"},{shortcode:"book",emoji:"\u{1F4D6}",name:"Open Book",keywords:["read","study"],group:"objects"},{shortcode:"memo",emoji:"\u{1F4DD}",name:"Memo",keywords:["note","write"],group:"objects"},{shortcode:"package",emoji:"\u{1F4E6}",name:"Package",keywords:["box","delivery"],group:"objects"},{shortcode:"mailbox",emoji:"\u{1F4EC}",name:"Open Mailbox with Raised Flag",keywords:["mail","letter"],group:"objects"},{shortcode:"bell",emoji:"\u{1F514}",name:"Bell",keywords:["notification","alert"],group:"objects"},{shortcode:"red_heart",emoji:"\u2764\uFE0F",name:"Red Heart",keywords:["love","valentine"],group:"symbols"},{shortcode:"orange_heart",emoji:"\u{1F9E1}",name:"Orange Heart",keywords:["love"],group:"symbols"},{shortcode:"yellow_heart",emoji:"\u{1F49B}",name:"Yellow Heart",keywords:["love","friendship"],group:"symbols"},{shortcode:"green_heart",emoji:"\u{1F49A}",name:"Green Heart",keywords:["love","nature"],group:"symbols"},{shortcode:"blue_heart",emoji:"\u{1F499}",name:"Blue Heart",keywords:["love","trust"],group:"symbols"},{shortcode:"purple_heart",emoji:"\u{1F49C}",name:"Purple Heart",keywords:["love"],group:"symbols"},{shortcode:"broken_heart",emoji:"\u{1F494}",name:"Broken Heart",keywords:["sad","breakup"],group:"symbols"},{shortcode:"sparkles",emoji:"\u2728",name:"Sparkles",keywords:["shine","magic","new"],group:"symbols"},{shortcode:"hundred",emoji:"\u{1F4AF}",name:"Hundred Points",keywords:["perfect","score"],group:"symbols"},{shortcode:"boom",emoji:"\u{1F4A5}",name:"Collision",keywords:["explosion","impact"],group:"symbols"},{shortcode:"speech_balloon",emoji:"\u{1F4AC}",name:"Speech Balloon",keywords:["talk","chat","message"],group:"symbols"},{shortcode:"thought_balloon",emoji:"\u{1F4AD}",name:"Thought Balloon",keywords:["think","dream"],group:"symbols"},{shortcode:"check_mark",emoji:"\u2705",name:"Check Mark Button",keywords:["done","yes","complete"],group:"symbols"},{shortcode:"x",emoji:"\u274C",name:"Cross Mark",keywords:["no","wrong","delete"],group:"symbols"},{shortcode:"warning",emoji:"\u26A0\uFE0F",name:"Warning",keywords:["caution","alert"],group:"symbols"},{shortcode:"no_entry",emoji:"\u26D4",name:"No Entry",keywords:["stop","forbidden"],group:"symbols"},{shortcode:"question",emoji:"\u2753",name:"Question Mark",keywords:["help","what"],group:"symbols"},{shortcode:"exclamation",emoji:"\u2757",name:"Exclamation Mark",keywords:["important","attention"],group:"symbols"},{shortcode:"arrow_right",emoji:"\u27A1\uFE0F",name:"Right Arrow",keywords:["next","forward"],group:"symbols"},{shortcode:"arrow_left",emoji:"\u2B05\uFE0F",name:"Left Arrow",keywords:["back","previous"],group:"symbols"},{shortcode:"arrow_up",emoji:"\u2B06\uFE0F",name:"Up Arrow",keywords:["above"],group:"symbols"},{shortcode:"arrow_down",emoji:"\u2B07\uFE0F",name:"Down Arrow",keywords:["below"],group:"symbols"},{shortcode:"recycle",emoji:"\u267B\uFE0F",name:"Recycling Symbol",keywords:["environment","green"],group:"symbols"},{shortcode:"infinity",emoji:"\u267E\uFE0F",name:"Infinity",keywords:["forever","loop"],group:"symbols"},{shortcode:"checkered_flag",emoji:"\u{1F3C1}",name:"Chequered Flag",keywords:["finish","race"],group:"flags"},{shortcode:"triangular_flag",emoji:"\u{1F6A9}",name:"Triangular Flag",keywords:["red flag","warning"],group:"flags"},{shortcode:"white_flag",emoji:"\u{1F3F3}\uFE0F",name:"White Flag",keywords:["surrender","peace"],group:"flags"},{shortcode:"rainbow_flag",emoji:"\u{1F3F3}\uFE0F\u200D\u{1F308}",name:"Rainbow Flag",keywords:["pride","lgbtq"],group:"flags"},{shortcode:"pirate_flag",emoji:"\u{1F3F4}\u200D\u2620\uFE0F",name:"Pirate Flag",keywords:["jolly roger","skull"],group:"flags"},{shortcode:"flag_us",emoji:"\u{1F1FA}\u{1F1F8}",name:"Flag: United States",keywords:["usa","america"],group:"flags"},{shortcode:"flag_gb",emoji:"\u{1F1EC}\u{1F1E7}",name:"Flag: United Kingdom",keywords:["uk","britain"],group:"flags"},{shortcode:"flag_fr",emoji:"\u{1F1EB}\u{1F1F7}",name:"Flag: France",keywords:["french"],group:"flags"},{shortcode:"flag_de",emoji:"\u{1F1E9}\u{1F1EA}",name:"Flag: Germany",keywords:["german"],group:"flags"},{shortcode:"flag_jp",emoji:"\u{1F1EF}\u{1F1F5}",name:"Flag: Japan",keywords:["japanese"],group:"flags"},{shortcode:"flag_kr",emoji:"\u{1F1F0}\u{1F1F7}",name:"Flag: South Korea",keywords:["korean"],group:"flags"},{shortcode:"flag_br",emoji:"\u{1F1E7}\u{1F1F7}",name:"Flag: Brazil",keywords:["brazilian"],group:"flags"},{shortcode:"flag_in",emoji:"\u{1F1EE}\u{1F1F3}",name:"Flag: India",keywords:["indian"],group:"flags"},{shortcode:"flag_ca",emoji:"\u{1F1E8}\u{1F1E6}",name:"Flag: Canada",keywords:["canadian","maple"],group:"flags"},{shortcode:"flag_au",emoji:"\u{1F1E6}\u{1F1FA}",name:"Flag: Australia",keywords:["australian"],group:"flags"}],bt=new Map($t.map(r=>[r.shortcode,r])),ms=new Map([["+1","thumbsup"],["-1","thumbsdown"],["heart","red_heart"],["thumbs_up","thumbsup"],["thumbs_down","thumbsdown"],["grin","grinning"],["laughing_crying","joy"],["lol","rofl"],["smiley","smile"],["cool","sunglasses"],["nerd","nerd_face"],["kiss","kissing_heart"],["hug","hugs"],["think","thinking"],["sad","cry"],["mad","angry"],["shrug","person_shrugging"],["facepalm","person_facepalming"],["pray_hands","pray"],["hi","wave"],["bye","wave"],["lightning","zap"],["flame","fire"],["hot","fire"],["bomb","boom"],["idea","bulb"],["laptop","computer"],["search","mag"],["party","tada"],["celebrate","tada"],["congrats","tada"],["check","check_mark"],["done","check_mark"],["yes","check_mark"],["no","x"],["wrong","x"],["love","red_heart"],["star_eyes","star_struck"],["mindblown","exploding_head"],["memo_pad","memo"],["notes","memo"],["coffee_cup","coffee"],["tea","coffee"]]),En=["smileys","people","animals","food","travel","activities","objects","symbols","flags"],Sn={smileys:"Smileys & Emotion",people:"People & Body",animals:"Animals & Nature",food:"Food & Drink",travel:"Travel & Places",activities:"Activities",objects:"Objects",symbols:"Symbols",flags:"Flags"},Cn={smileys:"\u{1F600}",people:"\u{1F44B}",animals:"\u{1F436}",food:"\u{1F355}",travel:"\u{1F30D}",activities:"\u{1F389}",objects:"\u{1F4A1}",symbols:"\u2764\uFE0F",flags:"\u{1F3C1}"},gs=Symbol.for("vanilla-breeze.emoji-extended"),Tn="vb:emoji-extended",ps=globalThis[gs]??=[],fs=0,vt=[]});var Ic=window.matchMedia("(prefers-reduced-motion: reduce)");var Xi=new Map;function g(r,t,e={}){let i=e.priority??10,s={impl:t,bundle:e.bundle,contract:e.contract,priority:i},n=Xi.get(r);if(customElements.get(r)){if(!n||n.priority>=i){n&&n.priority===i&&n.impl!==t&&console.warn(`[VB Bundle] Tag <${r}> already registered by "${n.bundle}" (priority ${n.priority}). Skipping "${e.bundle}".`);return}console.warn(`[VB Bundle] Tag <${r}> defined by "${n.bundle}" cannot be replaced (customElements.define is permanent). "${e.bundle}" has higher priority but arrived late.`);return}if(n&&n.priority>=i){n.priority===i&&console.warn(`[VB Bundle] Tag <${r}> already registered by "${n.bundle}". Skipping "${e.bundle}" (first wins at equal priority).`);return}Xi.set(r,s),customElements.define(r,t)}var v=class extends HTMLElement{#t=[];#e;constructor(){super(),this.hasAttribute("data-upgraded")&&this.removeAttribute("data-upgraded")}connectedCallback(){this.hasAttribute("data-upgraded")||this.setup()!==!1&&(this.setAttribute("data-upgraded",""),queueMicrotask(()=>{this.dispatchEvent(new CustomEvent(`${this.localName}:upgraded`,{bubbles:!0}))}))}disconnectedCallback(){for(let t of this.#t)t();this.#t=[],this.removeAttribute("data-upgraded"),this.teardown()}listen(t,e,i,s){t.addEventListener(e,i,s),this.#t.push(()=>t.removeEventListener(e,i,s))}_reinit(){for(let t of this.#t)t();this.#t=[],this.teardown(),this.removeAttribute("data-upgraded"),this.isConnected&&this.setup()!==!1&&this.setAttribute("data-upgraded","")}setup(){}teardown(){}setState(t,e){this.#e||(this.#e=this.attachInternals());let i=this.#e.states;try{e?i.add(t):i.delete(t)}catch{let s=`--${t}`;e?i.add(s):i.delete(s)}}_adoptInternals(t){this.#e||(this.#e=t)}#i(){return this.constructor.formAssociated&&this.#e?this.#e:null}get validity(){return this.#i()?.validity}get validationMessage(){return this.#i()?.validationMessage??""}get willValidate(){return this.#i()?.willValidate??!1}get form(){return this.#i()?.form??null}checkValidity(){return this.#i()?.checkValidity()??!0}reportValidity(){return this.#i()?.reportValidity()??!0}};function _t(r){return[...r.querySelectorAll("li")].filter(t=>t.querySelector("a[href]"))}function Yi(r){return r.querySelector("li[data-audio-active]")}function Ji(r,t,e){let i=e.querySelector("a[href]");return i?(t.querySelectorAll("li[data-audio-active]").forEach(s=>{s!==e&&s.removeAttribute("data-audio-active")}),e.setAttribute("data-audio-active",""),r.src=i.href,r.play()?.catch(()=>{}),{src:i.href,title:i.textContent?.trim()??""}):null}function Zi(r){let t=Yi(r);return t?.setAttribute("data-audio-played",""),t}function Qi(r,{loop:t=!1}={}){let e=_t(r);if(!e.length)return null;let i=Yi(r),s=i?e.indexOf(i):-1;return s+1<e.length?e[s+1]:t?e[0]:null}var nn='input:not([type="range"]), select, textarea, audio, [contenteditable]:not([contenteditable="false"])',on='button, summary, [role="button"]',an='input[type="range"], [role="slider"]',he=class extends v{static get observedAttributes(){return["loop","shuffle"]}#t=null;#e=null;#i=!1;#s=null;#r=null;#n=null;#a=null;#c=null;#h=null;#l=null;#o=null;#u=null;#p=null;#d=!1;#f=new Set;#k=null;#v=!1;setup(){if(this.#t=this.querySelector("audio"),!this.#t)return!1;this.#e=this.querySelector(".track-list"),this.#t.removeAttribute("controls");let t=!this.shadowRoot;this.#y(),t&&(this.#m(),this.#L(),this.#A()),this.#_(),this.#g(),this.#x();let e=this.#t;return(e.error||e.networkState===HTMLMediaElement.NETWORK_NO_SOURCE&&(e.hasAttribute("src")||e.querySelector("source")))&&this.#b(),e.readyState>=HTMLMediaElement.HAVE_METADATA&&(this.#$(),this.#I()),this.hasAttribute("autoplay")&&this.#t.play().catch(()=>{}),this.#k=()=>{let i=this.shadowRoot?.querySelector(".player");i&&(i.style.display="none",i.offsetHeight,i.style.display="")},this.listen(window,"vb:theme-change",this.#k),!0}teardown(){this.#t&&this.#t.setAttribute("controls","")}attributeChangedCallback(t){t==="loop"?this.#g():t==="shuffle"&&this.#f.clear()}#g(){this.#t&&(this.hasAttribute("loop")&&!this.#e?(this.#t.loop=!0,this.#v=!0):this.#v&&(this.#t.loop=!1,this.#v=!1))}get src(){return this.#t?.getAttribute("src")||this.#t?.currentSrc||""}set src(t){if(!this.#t)return;let e=t==null?"":String(t);this.#t.getAttribute("src")!==e&&(this.#t.setAttribute("src",e),this.#t.load?.(),this.#S(),this.#_(),this.dispatchEvent(new CustomEvent("audio-player:src-changed",{detail:{src:e,source:"property"},bubbles:!0})))}get currentTime(){return this.#t?.currentTime??0}set currentTime(t){this.#t&&(this.#t.currentTime=Number(t)||0)}#y(){if(this.shadowRoot)return;let t=this.attachShadow({mode:"open"});t.innerHTML=`
2
- <style>${this.#w()}</style>
1
+ var jn=Object.defineProperty;var ve=(r,t)=>()=>(r&&(t=r(r=0)),t);var fs=(r,t)=>{for(var e in t)jn(r,e,{get:t[e],enumerable:!0})};function Ms(r,t,e){let i=256*Math.pow(2,e),s=r/i*360-180;return{lat:Math.atan(Math.sinh(Math.PI*(1-2*t/i)))*180/Math.PI,lng:s}}function ct(r,t,e){let i=256*Math.pow(2,e),s=r*Math.PI/180;return{x:(t+180)/360*i,y:(1-Math.log(Math.tan(s)+1/Math.cos(s))/Math.PI)/2*i}}function io(r,t,e,i,s){let n=s??(typeof devicePixelRatio=="number"?devicePixelRatio:1),o="abc"[Math.abs(e+i)%3];return r.replaceAll("{z}",String(t)).replaceAll("{x}",String(e)).replaceAll("{y}",String(i)).replaceAll("{s}",o).replaceAll("{r}",n>1?"@2x":"")}function Ft(r,t,e,i,s){let n=s||(Y[r]??Y.osm).template;return io(n,t,e,i)}var Y,Ce=ve(()=>{Y={osm:{template:"https://tile.openstreetmap.org/{z}/{x}/{y}.png",origin:"https://tile.openstreetmap.org",credits:[{text:"\xA9 OpenStreetMap contributors",href:"https://www.openstreetmap.org/copyright"}]},"carto-light":{template:"https://basemaps.cartocdn.com/light_all/{z}/{x}/{y}{r}.png",origin:"https://basemaps.cartocdn.com",credits:[{text:"\xA9 OpenStreetMap contributors",href:"https://www.openstreetmap.org/copyright"},{text:"\xA9 CARTO",href:"https://carto.com/attributions"}]},"carto-dark":{template:"https://basemaps.cartocdn.com/dark_all/{z}/{x}/{y}{r}.png",origin:"https://basemaps.cartocdn.com",credits:[{text:"\xA9 OpenStreetMap contributors",href:"https://www.openstreetmap.org/copyright"},{text:"\xA9 CARTO",href:"https://carto.com/attributions"}]}}});var Ls={};fs(Ls,{MapInteraction:()=>Te});var Te,_s=ve(()=>{Ce();Te=class{#t;#e;#i;#s;#r;#n;#a;#c;#h=0;#l=0;#o=15;#u=1;#p=19;#d=0;#f=0;#v=0;#y=0;#g=15;#w=0;#A=0;#m=new Map;#b=0;#S=0;#x=new Map;#T=0;#E=0;constructor({host:t,viewport:e,tiles:i,marker:s,lat:n,lng:o,zoom:a,provider:l,tileUrl:c,width:h,height:u,onDeactivate:p,onMove:d}){this.#c=t,this.#t=e,this.#e=i,this.#i=s,this.#s=l,this.#r=c||"",this.#n=p,this.#a=d||(()=>{}),this.#o=a,this.#v=this.#b=n,this.#y=this.#S=o,this.#g=a,this.#w=h,this.#A=u;let f=ct(n,o,a);this.#h=f.x,this.#l=f.y,this.#k(),this.#e.replaceChildren(),this.#e.style.transform="",this.#i&&this.#e.appendChild(this.#i),this.#t.addEventListener("pointerdown",this.#M),this.#t.addEventListener("pointermove",this.#C),this.#t.addEventListener("pointerup",this.#O),this.#t.addEventListener("pointercancel",this.#O),this.#t.addEventListener("wheel",this.#P,{passive:!1}),this.#t.addEventListener("keydown",this.#_),this.#j()}get zoom(){return this.#o}get minZoom(){return this.#u}get maxZoom(){return this.#p}get center(){let{lat:t,lng:e}=Ms(this.#h,this.#l,this.#o);return{lat:+t.toFixed(6),lng:+e.toFixed(6),zoom:this.#o}}zoomBy(t){this.#L(this.#o+t,this.#w/2,this.#A/2)}recenter(){this.#o=this.#g;let t=ct(this.#v,this.#y,this.#o);this.#h=t.x,this.#l=t.y,this.#R(),this.#k(),this.#z(),this.#j(),this.#$()}panBy(t,e){this.#h+=t,this.#l+=e,this.#z(),this.#j()}resize(t,e){!t||!e||t===this.#w&&e===this.#A||(this.#w=t,this.#A=e,this.#z(),this.#j())}#k(){this.#d=Math.floor(this.#h/256)*256,this.#f=Math.floor(this.#l/256)*256}#M=t=>{if(!(t.pointerType==="mouse"&&t.button!==0)&&!t.target.closest?.("a, button")){t.preventDefault(),this.#t.focus({preventScroll:!0}),this.#x.set(t.pointerId,{x:t.clientX,y:t.clientY});try{this.#t.setPointerCapture(t.pointerId)}catch{}this.#x.size===1?(this.#T=0,this.#t.setAttribute("data-dragging","")):this.#x.size===2&&(this.#E=this.#I(),this.#T=1/0)}};#C=t=>{let e=this.#x.get(t.pointerId);if(!e)return;let i=t.clientX-e.x,s=t.clientY-e.y;if(e.x=t.clientX,e.y=t.clientY,this.#x.size===1){this.#T+=Math.abs(i)+Math.abs(s),this.panBy(-i,-s);return}if(this.#x.size===2){this.panBy(-i/2,-s/2);let n=this.#I();if(!this.#E){this.#E=n;return}let o=n/this.#E;if(o>=1.5||o<=1/1.5){let a=this.#N();this.#L(this.#o+(o>1?1:-1),a.x,a.y),this.#E=n}}};#O=t=>{if(!this.#x.has(t.pointerId))return;let e=this.#x.size===1;this.#x.delete(t.pointerId);try{this.#t.releasePointerCapture(t.pointerId)}catch{}if(this.#x.size<2&&(this.#E=0),!(this.#x.size>0)){if(this.#t.removeAttribute("data-dragging"),e&&t.type==="pointerup"&&this.#T<5){let i=this.#t.getBoundingClientRect();this.panBy(t.clientX-i.left-this.#w/2,t.clientY-i.top-this.#A/2)}this.#$()}};#I(){let[t,e]=[...this.#x.values()];return t&&e?Math.hypot(t.x-e.x,t.y-e.y):0}#N(){let[t,e]=[...this.#x.values()],i=this.#t.getBoundingClientRect();return{x:(t.x+e.x)/2-i.left,y:(t.y+e.y)/2-i.top}}#P=t=>{t.preventDefault();let e=t.ctrlKey?-t.deltaY*.01:-Math.sign(t.deltaY),i=Math.round(Math.max(this.#u,Math.min(this.#p,this.#o+e)));if(i===this.#o)return;let s=this.#t.getBoundingClientRect();this.#L(i,t.clientX-s.left,t.clientY-s.top)};#_=t=>{if(t.target!==this.#t)return;let e=80,i=null;switch(t.key){case"ArrowLeft":i=[-e,0];break;case"ArrowRight":i=[e,0];break;case"ArrowUp":i=[0,-e];break;case"ArrowDown":i=[0,e];break;case"+":case"=":t.preventDefault(),this.zoomBy(1);return;case"-":case"_":t.preventDefault(),this.zoomBy(-1);return;case"Home":case"0":t.preventDefault(),this.recenter();return;case"Escape":t.preventDefault(),this.#n();return;default:return}t.preventDefault(),this.panBy(i[0],i[1]),this.#$()};#L(t,e,i){if(t=Math.max(this.#u,Math.min(this.#p,t)),t===this.#o)return;let s=this.#h-this.#w/2+e,n=this.#l-this.#A/2+i,o=Math.pow(2,t-this.#o);this.#h=s*o-e+this.#w/2,this.#l=n*o-i+this.#A/2,this.#o=t,this.#R(),this.#z(),this.#k(),this.#j(),this.#$()}#z(){let t=256*Math.pow(2,this.#o),e=(this.#h%t+t)%t;e!==this.#h&&(this.#h=e,this.#R(),this.#k());let i=Math.min(this.#A/2,t/2);this.#l=Math.max(i,Math.min(t-i,this.#l))}#j(){let t=-(this.#h-this.#w/2-this.#d),e=-(this.#l-this.#A/2-this.#f);this.#e.style.transform=`translate(${Math.round(t)}px, ${Math.round(e)}px)`,this.#F(),this.#D(),this.#B()}#F(){let t=this.#o,e=Math.pow(2,t),i=this.#h-this.#w/2,s=this.#l-this.#A/2,n=Math.floor(i/256)-1,o=Math.max(0,Math.floor(s/256)-1),a=Math.ceil((i+this.#w)/256)+1,l=Math.min(e,Math.ceil((s+this.#A)/256)+1);for(let c=o;c<l;c++)for(let h=n;h<a;h++){let u=(h%e+e)%e,p=`${t}/${h}/${c}`;if(this.#m.has(p))continue;let d=document.createElement("img");d.src=Ft(this.#s,t,u,c,this.#r),d.alt="",d.draggable=!1,d.style.left=`${h*256-this.#d}px`,d.style.top=`${c*256-this.#f}px`,d._wx=h*256,d._wy=c*256,this.#m.set(p,d),this.#e.insertBefore(d,this.#i?.parentNode===this.#e?this.#i:null)}}#D(){let t=this.#h-this.#w/2,e=this.#l-this.#A/2,i=512;for(let[s,n]of this.#m){let o=n._wx??0,a=n._wy??0;(o+256<t-i||o>t+this.#w+i||a+256<e-i||a>e+this.#A+i)&&(n.remove(),this.#m.delete(s))}}#B(){if(!this.#i)return;let t=ct(this.#b,this.#S,this.#o),e=this.#i.offsetWidth||32,i=256*Math.pow(2,this.#o),s=t.x;for(;s-this.#h>i/2;)s-=i;for(;this.#h-s>i/2;)s+=i;this.#i.style.top=`${Math.round(t.y-this.#f-e)}px`,this.#i.style.left=`${Math.round(s-this.#d-e/2)}px`,this.#i.style.transform="none"}#$(){let t=this.center;this.#c.dispatchEvent(new CustomEvent("geo-map:move",{bubbles:!0,detail:t})),this.#a(t)}#R(){for(let t of this.#m.values())t.remove();this.#m.clear()}destroy(){this.#t.removeEventListener("pointerdown",this.#M),this.#t.removeEventListener("pointermove",this.#C),this.#t.removeEventListener("pointerup",this.#O),this.#t.removeEventListener("pointercancel",this.#O),this.#t.removeEventListener("wheel",this.#P),this.#t.removeEventListener("keydown",this.#_),this.#t.removeAttribute("data-dragging"),this.#x.clear(),this.#R()}}});var _e={};fs(_e,{EMOJI_ALIASES:()=>Is,EMOJI_GROUPS:()=>oo,EMOJI_GROUP_ICONS:()=>lo,EMOJI_GROUP_LABELS:()=>ao,EMOJI_MAP:()=>xt,EXTENDED_EVENT:()=>co,EXTENDED_REGISTRY:()=>Os,extendedCount:()=>ho,getByGroup:()=>po,resolveEmoji:()=>uo,searchEmoji:()=>fo});function Ht(){for(;Ps<$s.length;){let r=$s[Ps++];for(let[t,e,i,s]of r){if(xt.has(t))continue;let n={shortcode:t,emoji:e,name:i,keywords:[],group:s};xt.set(t,n),Et.push(n)}}}function ho(){return Ht(),Et.length}function uo(r){Ht();let t=xt.get(r);if(t)return t;let e=Is.get(r);return e&&xt.get(e)||null}function po(r){Ht();let t=qt.filter(i=>i.group===r),e=Et.filter(i=>i.group===r);return e.length>0?t.concat(e):t}function fo(r){Ht();let t=r.toLowerCase().trim(),e=Et.length>0?qt.concat(Et):qt;return t?e.filter(i=>i.shortcode.includes(t)||i.name.toLowerCase().includes(t)||i.keywords&&i.keywords.some(s=>s.includes(t))):e}var qt,xt,Is,oo,ao,lo,Os,co,$s,Ps,Et,Re=ve(()=>{qt=[{shortcode:"smile",emoji:"\u{1F604}",name:"Smiling Face with Open Mouth",keywords:["happy","joy","laugh"],group:"smileys"},{shortcode:"grinning",emoji:"\u{1F600}",name:"Grinning Face",keywords:["happy","smile"],group:"smileys"},{shortcode:"laughing",emoji:"\u{1F606}",name:"Grinning Squinting Face",keywords:["happy","laugh"],group:"smileys"},{shortcode:"sweat_smile",emoji:"\u{1F605}",name:"Grinning Face with Sweat",keywords:["hot","relief"],group:"smileys"},{shortcode:"rofl",emoji:"\u{1F923}",name:"Rolling on the Floor Laughing",keywords:["lol","funny"],group:"smileys"},{shortcode:"joy",emoji:"\u{1F602}",name:"Face with Tears of Joy",keywords:["happy","cry","laugh"],group:"smileys"},{shortcode:"slightly_smiling_face",emoji:"\u{1F642}",name:"Slightly Smiling Face",keywords:["smile"],group:"smileys"},{shortcode:"upside_down_face",emoji:"\u{1F643}",name:"Upside-Down Face",keywords:["sarcasm","silly"],group:"smileys"},{shortcode:"wink",emoji:"\u{1F609}",name:"Winking Face",keywords:["flirt","joke"],group:"smileys"},{shortcode:"blush",emoji:"\u{1F60A}",name:"Smiling Face with Smiling Eyes",keywords:["happy","shy"],group:"smileys"},{shortcode:"innocent",emoji:"\u{1F607}",name:"Smiling Face with Halo",keywords:["angel","good"],group:"smileys"},{shortcode:"heart_eyes",emoji:"\u{1F60D}",name:"Smiling Face with Heart-Eyes",keywords:["love","crush"],group:"smileys"},{shortcode:"star_struck",emoji:"\u{1F929}",name:"Star-Struck",keywords:["wow","amazing"],group:"smileys"},{shortcode:"kissing_heart",emoji:"\u{1F618}",name:"Face Blowing a Kiss",keywords:["love","kiss"],group:"smileys"},{shortcode:"yum",emoji:"\u{1F60B}",name:"Face Savoring Food",keywords:["delicious","tasty"],group:"smileys"},{shortcode:"stuck_out_tongue",emoji:"\u{1F61B}",name:"Face with Tongue",keywords:["playful","silly"],group:"smileys"},{shortcode:"stuck_out_tongue_winking_eye",emoji:"\u{1F61C}",name:"Winking Face with Tongue",keywords:["silly","playful"],group:"smileys"},{shortcode:"zany_face",emoji:"\u{1F92A}",name:"Zany Face",keywords:["crazy","wild"],group:"smileys"},{shortcode:"hugs",emoji:"\u{1F917}",name:"Hugging Face",keywords:["hug","warm"],group:"smileys"},{shortcode:"thinking",emoji:"\u{1F914}",name:"Thinking Face",keywords:["hmm","consider"],group:"smileys"},{shortcode:"shushing_face",emoji:"\u{1F92B}",name:"Shushing Face",keywords:["quiet","secret"],group:"smileys"},{shortcode:"smirk",emoji:"\u{1F60F}",name:"Smirking Face",keywords:["sly","suggestive"],group:"smileys"},{shortcode:"unamused",emoji:"\u{1F612}",name:"Unamused Face",keywords:["bored","unimpressed"],group:"smileys"},{shortcode:"roll_eyes",emoji:"\u{1F644}",name:"Face with Rolling Eyes",keywords:["annoyed","whatever"],group:"smileys"},{shortcode:"grimacing",emoji:"\u{1F62C}",name:"Grimacing Face",keywords:["awkward","nervous"],group:"smileys"},{shortcode:"relieved",emoji:"\u{1F60C}",name:"Relieved Face",keywords:["calm","peaceful"],group:"smileys"},{shortcode:"pensive",emoji:"\u{1F614}",name:"Pensive Face",keywords:["sad","thoughtful"],group:"smileys"},{shortcode:"sleepy",emoji:"\u{1F62A}",name:"Sleepy Face",keywords:["tired","sleep"],group:"smileys"},{shortcode:"sleeping",emoji:"\u{1F634}",name:"Sleeping Face",keywords:["zzz","sleep"],group:"smileys"},{shortcode:"mask",emoji:"\u{1F637}",name:"Face with Medical Mask",keywords:["sick","health"],group:"smileys"},{shortcode:"nerd_face",emoji:"\u{1F913}",name:"Nerd Face",keywords:["geek","smart"],group:"smileys"},{shortcode:"sunglasses",emoji:"\u{1F60E}",name:"Smiling Face with Sunglasses",keywords:["cool","chill"],group:"smileys"},{shortcode:"confused",emoji:"\u{1F615}",name:"Confused Face",keywords:["puzzled","unsure"],group:"smileys"},{shortcode:"worried",emoji:"\u{1F61F}",name:"Worried Face",keywords:["anxious","concern"],group:"smileys"},{shortcode:"cry",emoji:"\u{1F622}",name:"Crying Face",keywords:["sad","tear"],group:"smileys"},{shortcode:"sob",emoji:"\u{1F62D}",name:"Loudly Crying Face",keywords:["sad","cry"],group:"smileys"},{shortcode:"angry",emoji:"\u{1F620}",name:"Angry Face",keywords:["mad","annoyed"],group:"smileys"},{shortcode:"rage",emoji:"\u{1F92C}",name:"Face with Symbols on Mouth",keywords:["angry","swear"],group:"smileys"},{shortcode:"exploding_head",emoji:"\u{1F92F}",name:"Exploding Head",keywords:["mind blown","shocked"],group:"smileys"},{shortcode:"flushed",emoji:"\u{1F633}",name:"Flushed Face",keywords:["embarrassed","shocked"],group:"smileys"},{shortcode:"scream",emoji:"\u{1F631}",name:"Face Screaming in Fear",keywords:["scared","horror"],group:"smileys"},{shortcode:"skull",emoji:"\u{1F480}",name:"Skull",keywords:["dead","death"],group:"smileys"},{shortcode:"clown_face",emoji:"\u{1F921}",name:"Clown Face",keywords:["joke","funny"],group:"smileys"},{shortcode:"ghost",emoji:"\u{1F47B}",name:"Ghost",keywords:["halloween","spooky"],group:"smileys"},{shortcode:"wave",emoji:"\u{1F44B}",name:"Waving Hand",keywords:["hello","goodbye"],group:"people"},{shortcode:"raised_hand",emoji:"\u270B",name:"Raised Hand",keywords:["stop","high five"],group:"people"},{shortcode:"ok_hand",emoji:"\u{1F44C}",name:"OK Hand",keywords:["perfect","nice"],group:"people"},{shortcode:"thumbsup",emoji:"\u{1F44D}",name:"Thumbs Up",keywords:["approve","good","yes"],group:"people"},{shortcode:"thumbsdown",emoji:"\u{1F44E}",name:"Thumbs Down",keywords:["disapprove","bad","no"],group:"people"},{shortcode:"clap",emoji:"\u{1F44F}",name:"Clapping Hands",keywords:["applause","bravo"],group:"people"},{shortcode:"raised_hands",emoji:"\u{1F64C}",name:"Raising Hands",keywords:["celebration","hooray"],group:"people"},{shortcode:"pray",emoji:"\u{1F64F}",name:"Folded Hands",keywords:["thanks","please","hope"],group:"people"},{shortcode:"handshake",emoji:"\u{1F91D}",name:"Handshake",keywords:["deal","agreement"],group:"people"},{shortcode:"point_up",emoji:"\u261D\uFE0F",name:"Index Pointing Up",keywords:["attention","important"],group:"people"},{shortcode:"point_right",emoji:"\u{1F449}",name:"Backhand Index Pointing Right",keywords:["direction","this"],group:"people"},{shortcode:"point_left",emoji:"\u{1F448}",name:"Backhand Index Pointing Left",keywords:["direction","that"],group:"people"},{shortcode:"point_down",emoji:"\u{1F447}",name:"Backhand Index Pointing Down",keywords:["direction","below"],group:"people"},{shortcode:"v",emoji:"\u270C\uFE0F",name:"Victory Hand",keywords:["peace","two"],group:"people"},{shortcode:"crossed_fingers",emoji:"\u{1F91E}",name:"Crossed Fingers",keywords:["luck","hope"],group:"people"},{shortcode:"muscle",emoji:"\u{1F4AA}",name:"Flexed Biceps",keywords:["strong","power"],group:"people"},{shortcode:"writing_hand",emoji:"\u270D\uFE0F",name:"Writing Hand",keywords:["write","note"],group:"people"},{shortcode:"eyes",emoji:"\u{1F440}",name:"Eyes",keywords:["look","see","watch"],group:"people"},{shortcode:"brain",emoji:"\u{1F9E0}",name:"Brain",keywords:["smart","think","mind"],group:"people"},{shortcode:"speaking_head",emoji:"\u{1F5E3}\uFE0F",name:"Speaking Head",keywords:["talk","announce"],group:"people"},{shortcode:"baby",emoji:"\u{1F476}",name:"Baby",keywords:["child","newborn"],group:"people"},{shortcode:"person_shrugging",emoji:"\u{1F937}",name:"Person Shrugging",keywords:["dunno","whatever"],group:"people"},{shortcode:"person_facepalming",emoji:"\u{1F926}",name:"Person Facepalming",keywords:["frustration","disbelief"],group:"people"},{shortcode:"person_raising_hand",emoji:"\u{1F64B}",name:"Person Raising Hand",keywords:["question","volunteer"],group:"people"},{shortcode:"ninja",emoji:"\u{1F977}",name:"Ninja",keywords:["stealth","hidden"],group:"people"},{shortcode:"dog",emoji:"\u{1F436}",name:"Dog Face",keywords:["puppy","pet"],group:"animals"},{shortcode:"cat",emoji:"\u{1F431}",name:"Cat Face",keywords:["kitten","pet"],group:"animals"},{shortcode:"mouse",emoji:"\u{1F42D}",name:"Mouse Face",keywords:["rodent"],group:"animals"},{shortcode:"rabbit",emoji:"\u{1F430}",name:"Rabbit Face",keywords:["bunny","easter"],group:"animals"},{shortcode:"fox",emoji:"\u{1F98A}",name:"Fox",keywords:["clever","sly"],group:"animals"},{shortcode:"bear",emoji:"\u{1F43B}",name:"Bear",keywords:["teddy","nature"],group:"animals"},{shortcode:"unicorn",emoji:"\u{1F984}",name:"Unicorn",keywords:["magic","fantasy"],group:"animals"},{shortcode:"bee",emoji:"\u{1F41D}",name:"Honeybee",keywords:["honey","buzz"],group:"animals"},{shortcode:"butterfly",emoji:"\u{1F98B}",name:"Butterfly",keywords:["pretty","nature"],group:"animals"},{shortcode:"turtle",emoji:"\u{1F422}",name:"Turtle",keywords:["slow","shell"],group:"animals"},{shortcode:"snake",emoji:"\u{1F40D}",name:"Snake",keywords:["reptile"],group:"animals"},{shortcode:"whale",emoji:"\u{1F433}",name:"Spouting Whale",keywords:["ocean","sea"],group:"animals"},{shortcode:"dolphin",emoji:"\u{1F42C}",name:"Dolphin",keywords:["ocean","smart"],group:"animals"},{shortcode:"eagle",emoji:"\u{1F985}",name:"Eagle",keywords:["bird","freedom"],group:"animals"},{shortcode:"owl",emoji:"\u{1F989}",name:"Owl",keywords:["wise","night"],group:"animals"},{shortcode:"penguin",emoji:"\u{1F427}",name:"Penguin",keywords:["cold","linux"],group:"animals"},{shortcode:"octopus",emoji:"\u{1F419}",name:"Octopus",keywords:["ocean","tentacle"],group:"animals"},{shortcode:"seedling",emoji:"\u{1F331}",name:"Seedling",keywords:["plant","grow"],group:"animals"},{shortcode:"evergreen_tree",emoji:"\u{1F332}",name:"Evergreen Tree",keywords:["nature","pine"],group:"animals"},{shortcode:"sunflower",emoji:"\u{1F33B}",name:"Sunflower",keywords:["flower","yellow"],group:"animals"},{shortcode:"rose",emoji:"\u{1F339}",name:"Rose",keywords:["flower","love"],group:"animals"},{shortcode:"apple",emoji:"\u{1F34E}",name:"Red Apple",keywords:["fruit","healthy"],group:"food"},{shortcode:"banana",emoji:"\u{1F34C}",name:"Banana",keywords:["fruit","yellow"],group:"food"},{shortcode:"grapes",emoji:"\u{1F347}",name:"Grapes",keywords:["fruit","wine"],group:"food"},{shortcode:"watermelon",emoji:"\u{1F349}",name:"Watermelon",keywords:["fruit","summer"],group:"food"},{shortcode:"avocado",emoji:"\u{1F951}",name:"Avocado",keywords:["guacamole","healthy"],group:"food"},{shortcode:"pizza",emoji:"\u{1F355}",name:"Pizza",keywords:["food","italian"],group:"food"},{shortcode:"hamburger",emoji:"\u{1F354}",name:"Hamburger",keywords:["burger","fast food"],group:"food"},{shortcode:"taco",emoji:"\u{1F32E}",name:"Taco",keywords:["mexican","food"],group:"food"},{shortcode:"sushi",emoji:"\u{1F363}",name:"Sushi",keywords:["japanese","fish"],group:"food"},{shortcode:"cookie",emoji:"\u{1F36A}",name:"Cookie",keywords:["sweet","biscuit"],group:"food"},{shortcode:"cake",emoji:"\u{1F382}",name:"Birthday Cake",keywords:["birthday","celebration"],group:"food"},{shortcode:"ice_cream",emoji:"\u{1F366}",name:"Soft Ice Cream",keywords:["dessert","cold"],group:"food"},{shortcode:"chocolate_bar",emoji:"\u{1F36B}",name:"Chocolate Bar",keywords:["sweet","candy"],group:"food"},{shortcode:"popcorn",emoji:"\u{1F37F}",name:"Popcorn",keywords:["movie","snack"],group:"food"},{shortcode:"coffee",emoji:"\u2615",name:"Hot Beverage",keywords:["tea","drink","morning"],group:"food"},{shortcode:"beer",emoji:"\u{1F37A}",name:"Beer Mug",keywords:["drink","bar"],group:"food"},{shortcode:"wine_glass",emoji:"\u{1F377}",name:"Wine Glass",keywords:["drink","alcohol"],group:"food"},{shortcode:"cocktail",emoji:"\u{1F378}",name:"Cocktail Glass",keywords:["drink","martini"],group:"food"},{shortcode:"hot_pepper",emoji:"\u{1F336}\uFE0F",name:"Hot Pepper",keywords:["spicy","chili"],group:"food"},{shortcode:"egg",emoji:"\u{1F95A}",name:"Egg",keywords:["breakfast","food"],group:"food"},{shortcode:"earth_americas",emoji:"\u{1F30E}",name:"Globe Americas",keywords:["world","planet"],group:"travel"},{shortcode:"earth_europe",emoji:"\u{1F30D}",name:"Globe Europe-Africa",keywords:["world","planet"],group:"travel"},{shortcode:"sun",emoji:"\u2600\uFE0F",name:"Sun",keywords:["weather","bright","warm"],group:"travel"},{shortcode:"moon",emoji:"\u{1F319}",name:"Crescent Moon",keywords:["night","sleep"],group:"travel"},{shortcode:"star",emoji:"\u2B50",name:"Star",keywords:["favorite","rating"],group:"travel"},{shortcode:"star2",emoji:"\u{1F31F}",name:"Glowing Star",keywords:["sparkle","shine"],group:"travel"},{shortcode:"cloud",emoji:"\u2601\uFE0F",name:"Cloud",keywords:["weather","sky"],group:"travel"},{shortcode:"rainbow",emoji:"\u{1F308}",name:"Rainbow",keywords:["colorful","weather"],group:"travel"},{shortcode:"snowflake",emoji:"\u2744\uFE0F",name:"Snowflake",keywords:["cold","winter"],group:"travel"},{shortcode:"zap",emoji:"\u26A1",name:"High Voltage",keywords:["lightning","electric","fast"],group:"travel"},{shortcode:"fire",emoji:"\u{1F525}",name:"Fire",keywords:["hot","flame","lit"],group:"travel"},{shortcode:"ocean",emoji:"\u{1F30A}",name:"Water Wave",keywords:["sea","wave","surf"],group:"travel"},{shortcode:"airplane",emoji:"\u2708\uFE0F",name:"Airplane",keywords:["travel","flight"],group:"travel"},{shortcode:"rocket",emoji:"\u{1F680}",name:"Rocket",keywords:["launch","space","fast"],group:"travel"},{shortcode:"car",emoji:"\u{1F697}",name:"Automobile",keywords:["drive","vehicle"],group:"travel"},{shortcode:"house",emoji:"\u{1F3E0}",name:"House",keywords:["home","building"],group:"travel"},{shortcode:"tent",emoji:"\u26FA",name:"Tent",keywords:["camping","outdoor"],group:"travel"},{shortcode:"mountain",emoji:"\u26F0\uFE0F",name:"Mountain",keywords:["nature","hike"],group:"travel"},{shortcode:"desert_island",emoji:"\u{1F3DD}\uFE0F",name:"Desert Island",keywords:["beach","vacation"],group:"travel"},{shortcode:"volcano",emoji:"\u{1F30B}",name:"Volcano",keywords:["eruption","nature"],group:"travel"},{shortcode:"soccer",emoji:"\u26BD",name:"Soccer Ball",keywords:["football","sport"],group:"activities"},{shortcode:"basketball",emoji:"\u{1F3C0}",name:"Basketball",keywords:["sport","hoop"],group:"activities"},{shortcode:"tennis",emoji:"\u{1F3BE}",name:"Tennis",keywords:["sport","ball"],group:"activities"},{shortcode:"video_game",emoji:"\u{1F3AE}",name:"Video Game",keywords:["gaming","controller"],group:"activities"},{shortcode:"dart",emoji:"\u{1F3AF}",name:"Bullseye",keywords:["target","goal"],group:"activities"},{shortcode:"trophy",emoji:"\u{1F3C6}",name:"Trophy",keywords:["winner","champion"],group:"activities"},{shortcode:"medal",emoji:"\u{1F947}",name:"Gold Medal",keywords:["first","winner"],group:"activities"},{shortcode:"tada",emoji:"\u{1F389}",name:"Party Popper",keywords:["celebration","party"],group:"activities"},{shortcode:"confetti_ball",emoji:"\u{1F38A}",name:"Confetti Ball",keywords:["party","celebration"],group:"activities"},{shortcode:"balloon",emoji:"\u{1F388}",name:"Balloon",keywords:["party","birthday"],group:"activities"},{shortcode:"art",emoji:"\u{1F3A8}",name:"Artist Palette",keywords:["paint","creative"],group:"activities"},{shortcode:"musical_note",emoji:"\u{1F3B5}",name:"Musical Note",keywords:["music","song"],group:"activities"},{shortcode:"microphone",emoji:"\u{1F3A4}",name:"Microphone",keywords:["sing","karaoke"],group:"activities"},{shortcode:"guitar",emoji:"\u{1F3B8}",name:"Guitar",keywords:["music","rock"],group:"activities"},{shortcode:"dice",emoji:"\u{1F3B2}",name:"Game Die",keywords:["chance","random"],group:"activities"},{shortcode:"bulb",emoji:"\u{1F4A1}",name:"Light Bulb",keywords:["idea","bright"],group:"objects"},{shortcode:"computer",emoji:"\u{1F4BB}",name:"Laptop",keywords:["tech","work"],group:"objects"},{shortcode:"keyboard",emoji:"\u2328\uFE0F",name:"Keyboard",keywords:["type","computer"],group:"objects"},{shortcode:"phone",emoji:"\u{1F4F1}",name:"Mobile Phone",keywords:["cell","call"],group:"objects"},{shortcode:"camera",emoji:"\u{1F4F7}",name:"Camera",keywords:["photo","picture"],group:"objects"},{shortcode:"tv",emoji:"\u{1F4FA}",name:"Television",keywords:["watch","screen"],group:"objects"},{shortcode:"battery",emoji:"\u{1F50B}",name:"Battery",keywords:["charge","power"],group:"objects"},{shortcode:"electric_plug",emoji:"\u{1F50C}",name:"Electric Plug",keywords:["power","connect"],group:"objects"},{shortcode:"mag",emoji:"\u{1F50D}",name:"Magnifying Glass Left",keywords:["search","find"],group:"objects"},{shortcode:"lock",emoji:"\u{1F512}",name:"Locked",keywords:["security","private"],group:"objects"},{shortcode:"unlock",emoji:"\u{1F513}",name:"Unlocked",keywords:["open","access"],group:"objects"},{shortcode:"key",emoji:"\u{1F511}",name:"Key",keywords:["access","password"],group:"objects"},{shortcode:"hammer",emoji:"\u{1F528}",name:"Hammer",keywords:["tool","build"],group:"objects"},{shortcode:"wrench",emoji:"\u{1F527}",name:"Wrench",keywords:["tool","fix"],group:"objects"},{shortcode:"gear",emoji:"\u2699\uFE0F",name:"Gear",keywords:["settings","config"],group:"objects"},{shortcode:"link",emoji:"\u{1F517}",name:"Link",keywords:["chain","url"],group:"objects"},{shortcode:"paperclip",emoji:"\u{1F4CE}",name:"Paperclip",keywords:["attach","clip"],group:"objects"},{shortcode:"scissors",emoji:"\u2702\uFE0F",name:"Scissors",keywords:["cut","snip"],group:"objects"},{shortcode:"pen",emoji:"\u{1F58A}\uFE0F",name:"Pen",keywords:["write","sign"],group:"objects"},{shortcode:"pencil",emoji:"\u270F\uFE0F",name:"Pencil",keywords:["write","draw"],group:"objects"},{shortcode:"book",emoji:"\u{1F4D6}",name:"Open Book",keywords:["read","study"],group:"objects"},{shortcode:"memo",emoji:"\u{1F4DD}",name:"Memo",keywords:["note","write"],group:"objects"},{shortcode:"package",emoji:"\u{1F4E6}",name:"Package",keywords:["box","delivery"],group:"objects"},{shortcode:"mailbox",emoji:"\u{1F4EC}",name:"Open Mailbox with Raised Flag",keywords:["mail","letter"],group:"objects"},{shortcode:"bell",emoji:"\u{1F514}",name:"Bell",keywords:["notification","alert"],group:"objects"},{shortcode:"red_heart",emoji:"\u2764\uFE0F",name:"Red Heart",keywords:["love","valentine"],group:"symbols"},{shortcode:"orange_heart",emoji:"\u{1F9E1}",name:"Orange Heart",keywords:["love"],group:"symbols"},{shortcode:"yellow_heart",emoji:"\u{1F49B}",name:"Yellow Heart",keywords:["love","friendship"],group:"symbols"},{shortcode:"green_heart",emoji:"\u{1F49A}",name:"Green Heart",keywords:["love","nature"],group:"symbols"},{shortcode:"blue_heart",emoji:"\u{1F499}",name:"Blue Heart",keywords:["love","trust"],group:"symbols"},{shortcode:"purple_heart",emoji:"\u{1F49C}",name:"Purple Heart",keywords:["love"],group:"symbols"},{shortcode:"broken_heart",emoji:"\u{1F494}",name:"Broken Heart",keywords:["sad","breakup"],group:"symbols"},{shortcode:"sparkles",emoji:"\u2728",name:"Sparkles",keywords:["shine","magic","new"],group:"symbols"},{shortcode:"hundred",emoji:"\u{1F4AF}",name:"Hundred Points",keywords:["perfect","score"],group:"symbols"},{shortcode:"boom",emoji:"\u{1F4A5}",name:"Collision",keywords:["explosion","impact"],group:"symbols"},{shortcode:"speech_balloon",emoji:"\u{1F4AC}",name:"Speech Balloon",keywords:["talk","chat","message"],group:"symbols"},{shortcode:"thought_balloon",emoji:"\u{1F4AD}",name:"Thought Balloon",keywords:["think","dream"],group:"symbols"},{shortcode:"check_mark",emoji:"\u2705",name:"Check Mark Button",keywords:["done","yes","complete"],group:"symbols"},{shortcode:"x",emoji:"\u274C",name:"Cross Mark",keywords:["no","wrong","delete"],group:"symbols"},{shortcode:"warning",emoji:"\u26A0\uFE0F",name:"Warning",keywords:["caution","alert"],group:"symbols"},{shortcode:"no_entry",emoji:"\u26D4",name:"No Entry",keywords:["stop","forbidden"],group:"symbols"},{shortcode:"question",emoji:"\u2753",name:"Question Mark",keywords:["help","what"],group:"symbols"},{shortcode:"exclamation",emoji:"\u2757",name:"Exclamation Mark",keywords:["important","attention"],group:"symbols"},{shortcode:"arrow_right",emoji:"\u27A1\uFE0F",name:"Right Arrow",keywords:["next","forward"],group:"symbols"},{shortcode:"arrow_left",emoji:"\u2B05\uFE0F",name:"Left Arrow",keywords:["back","previous"],group:"symbols"},{shortcode:"arrow_up",emoji:"\u2B06\uFE0F",name:"Up Arrow",keywords:["above"],group:"symbols"},{shortcode:"arrow_down",emoji:"\u2B07\uFE0F",name:"Down Arrow",keywords:["below"],group:"symbols"},{shortcode:"recycle",emoji:"\u267B\uFE0F",name:"Recycling Symbol",keywords:["environment","green"],group:"symbols"},{shortcode:"infinity",emoji:"\u267E\uFE0F",name:"Infinity",keywords:["forever","loop"],group:"symbols"},{shortcode:"checkered_flag",emoji:"\u{1F3C1}",name:"Chequered Flag",keywords:["finish","race"],group:"flags"},{shortcode:"triangular_flag",emoji:"\u{1F6A9}",name:"Triangular Flag",keywords:["red flag","warning"],group:"flags"},{shortcode:"white_flag",emoji:"\u{1F3F3}\uFE0F",name:"White Flag",keywords:["surrender","peace"],group:"flags"},{shortcode:"rainbow_flag",emoji:"\u{1F3F3}\uFE0F\u200D\u{1F308}",name:"Rainbow Flag",keywords:["pride","lgbtq"],group:"flags"},{shortcode:"pirate_flag",emoji:"\u{1F3F4}\u200D\u2620\uFE0F",name:"Pirate Flag",keywords:["jolly roger","skull"],group:"flags"},{shortcode:"flag_us",emoji:"\u{1F1FA}\u{1F1F8}",name:"Flag: United States",keywords:["usa","america"],group:"flags"},{shortcode:"flag_gb",emoji:"\u{1F1EC}\u{1F1E7}",name:"Flag: United Kingdom",keywords:["uk","britain"],group:"flags"},{shortcode:"flag_fr",emoji:"\u{1F1EB}\u{1F1F7}",name:"Flag: France",keywords:["french"],group:"flags"},{shortcode:"flag_de",emoji:"\u{1F1E9}\u{1F1EA}",name:"Flag: Germany",keywords:["german"],group:"flags"},{shortcode:"flag_jp",emoji:"\u{1F1EF}\u{1F1F5}",name:"Flag: Japan",keywords:["japanese"],group:"flags"},{shortcode:"flag_kr",emoji:"\u{1F1F0}\u{1F1F7}",name:"Flag: South Korea",keywords:["korean"],group:"flags"},{shortcode:"flag_br",emoji:"\u{1F1E7}\u{1F1F7}",name:"Flag: Brazil",keywords:["brazilian"],group:"flags"},{shortcode:"flag_in",emoji:"\u{1F1EE}\u{1F1F3}",name:"Flag: India",keywords:["indian"],group:"flags"},{shortcode:"flag_ca",emoji:"\u{1F1E8}\u{1F1E6}",name:"Flag: Canada",keywords:["canadian","maple"],group:"flags"},{shortcode:"flag_au",emoji:"\u{1F1E6}\u{1F1FA}",name:"Flag: Australia",keywords:["australian"],group:"flags"}],xt=new Map(qt.map(r=>[r.shortcode,r])),Is=new Map([["+1","thumbsup"],["-1","thumbsdown"],["heart","red_heart"],["thumbs_up","thumbsup"],["thumbs_down","thumbsdown"],["grin","grinning"],["laughing_crying","joy"],["lol","rofl"],["smiley","smile"],["cool","sunglasses"],["nerd","nerd_face"],["kiss","kissing_heart"],["hug","hugs"],["think","thinking"],["sad","cry"],["mad","angry"],["shrug","person_shrugging"],["facepalm","person_facepalming"],["pray_hands","pray"],["hi","wave"],["bye","wave"],["lightning","zap"],["flame","fire"],["hot","fire"],["bomb","boom"],["idea","bulb"],["laptop","computer"],["search","mag"],["party","tada"],["celebrate","tada"],["congrats","tada"],["check","check_mark"],["done","check_mark"],["yes","check_mark"],["no","x"],["wrong","x"],["love","red_heart"],["star_eyes","star_struck"],["mindblown","exploding_head"],["memo_pad","memo"],["notes","memo"],["coffee_cup","coffee"],["tea","coffee"]]),oo=["smileys","people","animals","food","travel","activities","objects","symbols","flags"],ao={smileys:"Smileys & Emotion",people:"People & Body",animals:"Animals & Nature",food:"Food & Drink",travel:"Travel & Places",activities:"Activities",objects:"Objects",symbols:"Symbols",flags:"Flags"},lo={smileys:"\u{1F600}",people:"\u{1F44B}",animals:"\u{1F436}",food:"\u{1F355}",travel:"\u{1F30D}",activities:"\u{1F389}",objects:"\u{1F4A1}",symbols:"\u2764\uFE0F",flags:"\u{1F3C1}"},Os=Symbol.for("vanilla-breeze.emoji-extended"),co="vb:emoji-extended",$s=globalThis[Os]??=[],Ps=0,Et=[]});var Uh=window.matchMedia("(prefers-reduced-motion: reduce)");var ms=new Map;function g(r,t,e={}){let i=e.priority??10,s={impl:t,bundle:e.bundle,contract:e.contract,priority:i},n=ms.get(r);if(customElements.get(r)){if(!n||n.priority>=i){n&&n.priority===i&&n.impl!==t&&console.warn(`[VB Bundle] Tag <${r}> already registered by "${n.bundle}" (priority ${n.priority}). Skipping "${e.bundle}".`);return}console.warn(`[VB Bundle] Tag <${r}> defined by "${n.bundle}" cannot be replaced (customElements.define is permanent). "${e.bundle}" has higher priority but arrived late.`);return}if(n&&n.priority>=i){n.priority===i&&console.warn(`[VB Bundle] Tag <${r}> already registered by "${n.bundle}". Skipping "${e.bundle}" (first wins at equal priority).`);return}ms.set(r,s),customElements.define(r,t)}var b=class extends HTMLElement{#t=[];#e;constructor(){super(),this.hasAttribute("data-upgraded")&&this.removeAttribute("data-upgraded")}connectedCallback(){this.hasAttribute("data-upgraded")||this.setup()!==!1&&(this.setAttribute("data-upgraded",""),queueMicrotask(()=>{this.dispatchEvent(new CustomEvent(`${this.localName}:upgraded`,{bubbles:!0}))}))}disconnectedCallback(){for(let t of this.#t)t();this.#t=[],this.removeAttribute("data-upgraded"),this.teardown()}listen(t,e,i,s){t.addEventListener(e,i,s),this.#t.push(()=>t.removeEventListener(e,i,s))}_reinit(){for(let t of this.#t)t();this.#t=[],this.teardown(),this.removeAttribute("data-upgraded"),this.isConnected&&this.setup()!==!1&&this.setAttribute("data-upgraded","")}setup(){}teardown(){}setState(t,e){this.#e||(this.#e=this.attachInternals());let i=this.#e.states;try{e?i.add(t):i.delete(t)}catch{let s=`--${t}`;e?i.add(s):i.delete(s)}}_adoptInternals(t){this.#e||(this.#e=t)}#i(){return this.constructor.formAssociated&&this.#e?this.#e:null}get validity(){return this.#i()?.validity}get validationMessage(){return this.#i()?.validationMessage??""}get willValidate(){return this.#i()?.willValidate??!1}get form(){return this.#i()?.form??null}checkValidity(){return this.#i()?.checkValidity()??!0}reportValidity(){return this.#i()?.reportValidity()??!0}};function Bt(r){return[...r.querySelectorAll("li")].filter(t=>t.querySelector("a[href]"))}function gs(r){return r.querySelector("li[data-audio-active]")}function bs(r,t,e){let i=e.querySelector("a[href]");return i?(t.querySelectorAll("li[data-audio-active]").forEach(s=>{s!==e&&s.removeAttribute("data-audio-active")}),e.setAttribute("data-audio-active",""),r.src=i.href,r.play()?.catch(()=>{}),{src:i.href,title:i.textContent?.trim()??""}):null}function ys(r){let t=gs(r);return t?.setAttribute("data-audio-played",""),t}function vs(r,{loop:t=!1}={}){let e=Bt(r);if(!e.length)return null;let i=gs(r),s=i?e.indexOf(i):-1;return s+1<e.length?e[s+1]:t?e[0]:null}var Fn='input:not([type="range"]), select, textarea, audio, [contenteditable]:not([contenteditable="false"])',qn='button, summary, [role="button"]',Hn='input[type="range"], [role="slider"]',we=class extends b{static get observedAttributes(){return["loop","shuffle"]}#t=null;#e=null;#i=!1;#s=null;#r=null;#n=null;#a=null;#c=null;#h=null;#l=null;#o=null;#u=null;#p=null;#d=!1;#f=new Set;#v=null;#y=!1;setup(){if(this.#t=this.querySelector("audio"),!this.#t)return!1;this.#e=this.querySelector(".track-list"),this.#t.removeAttribute("controls");let t=!this.shadowRoot;this.#w(),t&&(this.#m(),this.#T(),this.#k()),this.#_(),this.#g(),this.#x();let e=this.#t;return(e.error||e.networkState===HTMLMediaElement.NETWORK_NO_SOURCE&&(e.hasAttribute("src")||e.querySelector("source")))&&this.#b(),e.readyState>=HTMLMediaElement.HAVE_METADATA&&(this.#P(),this.#I()),this.hasAttribute("autoplay")&&this.#t.play().catch(()=>{}),this.#v=()=>{let i=this.shadowRoot?.querySelector(".player");i&&(i.style.display="none",i.offsetHeight,i.style.display="")},this.listen(window,"vb:theme-change",this.#v),!0}teardown(){this.#t&&this.#t.setAttribute("controls","")}attributeChangedCallback(t){t==="loop"?this.#g():t==="shuffle"&&this.#f.clear()}#g(){this.#t&&(this.hasAttribute("loop")&&!this.#e?(this.#t.loop=!0,this.#y=!0):this.#y&&(this.#t.loop=!1,this.#y=!1))}get src(){return this.#t?.getAttribute("src")||this.#t?.currentSrc||""}set src(t){if(!this.#t)return;let e=t==null?"":String(t);this.#t.getAttribute("src")!==e&&(this.#t.setAttribute("src",e),this.#t.load?.(),this.#C(),this.#_(),this.dispatchEvent(new CustomEvent("audio-player:src-changed",{detail:{src:e,source:"property"},bubbles:!0})))}get currentTime(){return this.#t?.currentTime??0}set currentTime(t){this.#t&&(this.#t.currentTime=Number(t)||0)}#w(){if(this.shadowRoot)return;let t=this.attachShadow({mode:"open"});t.innerHTML=`
2
+ <style>${this.#A()}</style>
3
3
  <div part="player" class="player">
4
4
  <div part="controls" class="controls">
5
5
  <button part="play-button" class="play-btn" type="button" aria-label="Play">
@@ -43,7 +43,7 @@ var rn=Object.defineProperty;var ce=(r,t)=>()=>(r&&(t=r(r=0)),t);var Ki=(r,t)=>{
43
43
  <p part="error" class="error" role="status" hidden></p>
44
44
  <slot></slot>
45
45
  </div>
46
- `,this.#s=t.querySelector(".controls"),this.#r=t.querySelector(".play-btn"),this.#n=t.querySelector(".timeline"),this.#a=t.querySelector(".timeline-fill"),this.#c=t.querySelector(".volume"),this.#h=t.querySelector(".current-time"),this.#l=t.querySelector(".duration"),this.#o=t.querySelector(".track-title"),this.#u=t.querySelector(".mute-btn"),this.#p=t.querySelector(".error")}#w(){return`
46
+ `,this.#s=t.querySelector(".controls"),this.#r=t.querySelector(".play-btn"),this.#n=t.querySelector(".timeline"),this.#a=t.querySelector(".timeline-fill"),this.#c=t.querySelector(".volume"),this.#h=t.querySelector(".current-time"),this.#l=t.querySelector(".duration"),this.#o=t.querySelector(".track-title"),this.#u=t.querySelector(".mute-btn"),this.#p=t.querySelector(".error")}#A(){return`
47
47
  :host {
48
48
  display: block;
49
49
  --_accent: var(--audio-player-accent, var(--color-primary, oklch(55% 0.2 260)));
@@ -346,11 +346,11 @@ var rn=Object.defineProperty;var ce=(r,t)=>()=>(r&&(t=r(r=0)),t);var Ki=(r,t)=>{
346
346
  transform: none;
347
347
  }
348
348
  }
349
- `}#m(){this.#t.addEventListener("timeupdate",()=>this.#I()),this.#t.addEventListener("loadedmetadata",()=>{this.#C(),this.#$(),this.#I()}),this.#t.addEventListener("emptied",()=>{this.#$(),this.#I()}),this.#t.addEventListener("volumechange",()=>this.#x()),this.#t.addEventListener("error",t=>{let e=t.target;if(e!==this.#t){if(e.localName!=="source"||this.#t.hasAttribute("src"))return;let i=e.nextElementSibling;for(;i&&i.localName!=="source";)i=i.nextElementSibling;if(i)return}this.#b()},!0),this.#t.addEventListener("play",()=>{this.#i=!0,this.setAttribute("state","playing"),this.#r.setAttribute("aria-label","Pause"),this.#B("audio-player:play",{currentTime:this.#t.currentTime,src:this.#t.currentSrc})}),this.#t.addEventListener("pause",()=>{this.#i=!1,this.setAttribute("state","paused"),this.#r.setAttribute("aria-label","Play"),this.#B("audio-player:pause",{currentTime:this.#t.currentTime})}),this.#t.addEventListener("ended",()=>{this.#i=!1,this.setAttribute("state","ended"),this.#r.setAttribute("aria-label","Play"),this.#e&&(Zi(this.#e),this.#z()),this.#B("audio-player:ended",{src:this.#t.currentSrc})})}#b(){this.setAttribute("data-state","error"),this.#p.textContent=`Audio could not be loaded${this.#o.textContent?`: ${this.#o.textContent}`:""}.`,this.#p.hidden=!1}#C(){this.getAttribute("data-state")==="error"&&this.removeAttribute("data-state"),this.#p.hidden=!0,this.#p.textContent=""}#x(){if(!this.#t||!this.#u)return;let t=this.#t.muted;t?this.setAttribute("muted",""):this.removeAttribute("muted"),this.#u.setAttribute("aria-pressed",String(t)),this.#c.style.setProperty("--_vol",t?"0":this.#c.value)}#L(){this.#r.addEventListener("click",()=>{this.#i?this.#t.pause():this.#t.play().catch(()=>{})}),this.#n.addEventListener("input",()=>{let e=Number(this.#n.value);this.#a.style.width=`${e}%`,this.#t.duration&&(this.#t.currentTime=e/100*this.#t.duration,this.#N(this.#t.currentTime,this.#t.duration))}),this.#n.addEventListener("pointerdown",()=>{this.#d=!0,this.setState("scrub-active",!0)});let t=()=>{this.#d&&(this.#d=!1,this.setState("scrub-active",!1))};this.#n.addEventListener("pointerup",t),this.#n.addEventListener("pointercancel",t),this.#n.addEventListener("change",t),this.#c.addEventListener("input",()=>{this.#t.volume=Number(this.#c.value),this.#t.muted=!1,this.#x()}),this.#u.addEventListener("click",()=>{this.#t.muted=!this.#t.muted,this.#x()}),this.addEventListener("keydown",e=>{if(!(e.defaultPrevented||e.altKey||e.ctrlKey||e.metaKey)&&!this.#E(e))switch(e.key){case" ":e.preventDefault(),this.#i?this.#t.pause():this.#t.play().catch(()=>{});break;case"ArrowLeft":e.preventDefault(),this.#t.currentTime=Math.max(0,this.#t.currentTime-10);break;case"ArrowRight":e.preventDefault(),this.#t.currentTime=Math.min(this.#t.duration||0,this.#t.currentTime+10);break;case"m":case"M":this.#t.muted=!this.#t.muted,this.#x();break}}),this.hasAttribute("role")||this.setAttribute("role","group"),!this.hasAttribute("aria-label")&&!this.hasAttribute("aria-labelledby")&&this.setAttribute("aria-label","Audio player"),this.hasAttribute("aria-keyshortcuts")||this.setAttribute("aria-keyshortcuts","Space ArrowLeft ArrowRight M")}#E(t){let e=t.key==="ArrowLeft"||t.key==="ArrowRight";for(let i of t.composedPath()){if(i===this)return!1;if(i instanceof Element&&(i.matches(nn)||t.key===" "&&i.matches(on)||e&&i.matches(an)))return!0}return!1}#A(){this.#e&&this.#e.addEventListener("click",t=>{let i=t.target?.closest("a[href]"),s=i?.closest("li");!i||!s||(t.preventDefault(),this.#T(s))})}#T(t){if(!this.#e)return;let e=Ji(this.#t,this.#e,t);e&&(this.#f.add(t),this.#_(),this.#B("audio-player:track-change",e))}#S(){if(!this.#e)return;let t=this.#t.src,e=_t(this.#e).find(i=>i.querySelector("a[href]").href===t);this.#e.querySelectorAll("li[data-audio-active]").forEach(i=>{i!==e&&i.removeAttribute("data-audio-active")}),e?.setAttribute("data-audio-active","")}#z(){if(!this.#e)return;let t=this.hasAttribute("loop");if(!this.hasAttribute("shuffle")){let o=Qi(this.#e,{loop:t});o&&this.#T(o);return}let e=_t(this.#e),i=this.#e.querySelector("li[data-audio-active]");i&&this.#f.add(i);let s=e.filter(o=>!this.#f.has(o));if(!s.length){if(this.#f.clear(),!t)return;s=e.length>1?e.filter(o=>o!==i):e}let n=s[Math.floor(Math.random()*s.length)];n&&this.#T(n)}#I(){let t=this.#t.currentTime,e=this.#t.duration||0,i=e?t/e*100:0;this.#h.textContent=this.#M(t),this.#N(t,e),!this.#d&&(this.#n.value=String(i),this.#a.style.width=`${i}%`)}#N(t,e){this.#n.setAttribute("aria-valuetext",`${this.#M(t)} of ${this.#M(e)}`)}#$(){let t=this.#t.duration||0;this.#l.textContent=this.#M(t)}#_(){if(!this.#o)return;if(this.#e){let i=this.#e.querySelector("li[data-audio-active] a");if(i){this.#o.textContent=i.textContent;return}}let t=this.#t.src||this.#t.currentSrc||this.#t.querySelector("source")?.src||"",e=t?t.split("/").pop().split(/[?#]/)[0]:"";this.#o.textContent=e.replace(/\.[^.]+$/,"").replace(/[-_]/g," ")}#M(t){if(!Number.isFinite(t))return"0:00";let e=Math.floor(t/60),i=Math.floor(t%60).toString().padStart(2,"0");return`${e}:${i}`}#B(t,e){this.dispatchEvent(new CustomEvent(t,{bubbles:!0,composed:!0,detail:e}))}};g("audio-player",he);var ue=new Map;function ln(){if(!ue.has("default"))try{ue.set("default",new AudioContext)}catch{return null}return ue.get("default")}var Rt=new WeakMap;function cn(r,t){if(Rt.has(r))return Rt.get(r);let e=t.createMediaElementSource(r);return e.connect(t.destination),Rt.set(r,e),e}function ts(r){let t=Number.parseInt(r??"",10);if(!Number.isFinite(t)||t<=0)return 256;let e=2**Math.round(Math.log2(t));return Math.min(32768,Math.max(32,e))}function hn(r){if(r.crossOrigin!=null)return!1;let t=r.currentSrc||r.src||r.querySelector("source[src]")?.src||"";if(!t)return!1;try{let e=new URL(t,location.href);return e.protocol==="data:"||e.protocol==="blob:"?!1:e.origin!==location.origin}catch{return!1}}var es=new WeakSet,un=new Set(["bars","waveform","circle"]);function is(r){return r&&un.has(r)?r:"bars"}var de="oklch(55% 0.2 260)",dn=new Uint8Array(256).fill(128),pn=new Uint8Array(128),pe=class extends v{#t=null;#e=null;#i=null;#s=null;#r=null;#n=new Uint8Array(0);#a=new Uint8Array(0);#c=de;#h="";#l="bars";#o=null;#u=null;#p=null;#d=!0;#f=!1;#k=!1;#v=null;#g=()=>this.#C();static get observedAttributes(){return["for","data-mode","data-fft-size"]}setup(){if(this.#k=window.matchMedia("(prefers-reduced-motion: reduce)").matches,this.#l=is(this.getAttribute("data-mode")),this.#y(),this.#w(),this.#m(),this.#N(),this.#$(),this.#_(),this.#f&&this.#r&&this.#s){try{this.#r.connect(this.#s)}catch{}this.#L()}let t=()=>requestAnimationFrame(()=>{this.#w(),this.#o||this.#T()});this.listen(window,"vb:theme-change",t),this.listen(window.matchMedia("(prefers-color-scheme: dark)"),"change",t)}teardown(){this.#E(),this.#u?.disconnect(),this.#p?.disconnect(),this.#v?.removeEventListener("play",this.#g),this.#v=null,this.#b()}attributeChangedCallback(t,e,i){if(e!==i){if(t==="data-mode"){this.#l=is(i),this.isConnected&&!this.#o&&this.#T();return}this.isConnected&&(t==="for"?this.#m():t==="data-fft-size"&&this.#s&&(this.#s.fftSize=ts(i),this.#x(),this.#o||this.#T()))}}#y(){if(this.shadowRoot)return;let t=this.attachShadow({mode:"open"});t.innerHTML=`
349
+ `}#m(){this.#t.addEventListener("timeupdate",()=>this.#I()),this.#t.addEventListener("loadedmetadata",()=>{this.#S(),this.#P(),this.#I()}),this.#t.addEventListener("emptied",()=>{this.#P(),this.#I()}),this.#t.addEventListener("volumechange",()=>this.#x()),this.#t.addEventListener("error",t=>{let e=t.target;if(e!==this.#t){if(e.localName!=="source"||this.#t.hasAttribute("src"))return;let i=e.nextElementSibling;for(;i&&i.localName!=="source";)i=i.nextElementSibling;if(i)return}this.#b()},!0),this.#t.addEventListener("play",()=>{this.#i=!0,this.setAttribute("state","playing"),this.#r.setAttribute("aria-label","Pause"),this.#z("audio-player:play",{currentTime:this.#t.currentTime,src:this.#t.currentSrc})}),this.#t.addEventListener("pause",()=>{this.#i=!1,this.setAttribute("state","paused"),this.#r.setAttribute("aria-label","Play"),this.#z("audio-player:pause",{currentTime:this.#t.currentTime})}),this.#t.addEventListener("ended",()=>{this.#i=!1,this.setAttribute("state","ended"),this.#r.setAttribute("aria-label","Play"),this.#e&&(ys(this.#e),this.#O()),this.#z("audio-player:ended",{src:this.#t.currentSrc})})}#b(){this.setAttribute("data-state","error"),this.#p.textContent=`Audio could not be loaded${this.#o.textContent?`: ${this.#o.textContent}`:""}.`,this.#p.hidden=!1}#S(){this.getAttribute("data-state")==="error"&&this.removeAttribute("data-state"),this.#p.hidden=!0,this.#p.textContent=""}#x(){if(!this.#t||!this.#u)return;let t=this.#t.muted;t?this.setAttribute("muted",""):this.removeAttribute("muted"),this.#u.setAttribute("aria-pressed",String(t)),this.#c.style.setProperty("--_vol",t?"0":this.#c.value)}#T(){this.#r.addEventListener("click",()=>{this.#i?this.#t.pause():this.#t.play().catch(()=>{})}),this.#n.addEventListener("input",()=>{let e=Number(this.#n.value);this.#a.style.width=`${e}%`,this.#t.duration&&(this.#t.currentTime=e/100*this.#t.duration,this.#N(this.#t.currentTime,this.#t.duration))}),this.#n.addEventListener("pointerdown",()=>{this.#d=!0,this.setState("scrub-active",!0)});let t=()=>{this.#d&&(this.#d=!1,this.setState("scrub-active",!1))};this.#n.addEventListener("pointerup",t),this.#n.addEventListener("pointercancel",t),this.#n.addEventListener("change",t),this.#c.addEventListener("input",()=>{this.#t.volume=Number(this.#c.value),this.#t.muted=!1,this.#x()}),this.#u.addEventListener("click",()=>{this.#t.muted=!this.#t.muted,this.#x()}),this.addEventListener("keydown",e=>{if(!(e.defaultPrevented||e.altKey||e.ctrlKey||e.metaKey)&&!this.#E(e))switch(e.key){case" ":e.preventDefault(),this.#i?this.#t.pause():this.#t.play().catch(()=>{});break;case"ArrowLeft":e.preventDefault(),this.#t.currentTime=Math.max(0,this.#t.currentTime-10);break;case"ArrowRight":e.preventDefault(),this.#t.currentTime=Math.min(this.#t.duration||0,this.#t.currentTime+10);break;case"m":case"M":this.#t.muted=!this.#t.muted,this.#x();break}}),this.hasAttribute("role")||this.setAttribute("role","group"),!this.hasAttribute("aria-label")&&!this.hasAttribute("aria-labelledby")&&this.setAttribute("aria-label","Audio player"),this.hasAttribute("aria-keyshortcuts")||this.setAttribute("aria-keyshortcuts","Space ArrowLeft ArrowRight M")}#E(t){let e=t.key==="ArrowLeft"||t.key==="ArrowRight";for(let i of t.composedPath()){if(i===this)return!1;if(i instanceof Element&&(i.matches(Fn)||t.key===" "&&i.matches(qn)||e&&i.matches(Hn)))return!0}return!1}#k(){this.#e&&this.#e.addEventListener("click",t=>{let i=t.target?.closest("a[href]"),s=i?.closest("li");!i||!s||(t.preventDefault(),this.#M(s))})}#M(t){if(!this.#e)return;let e=bs(this.#t,this.#e,t);e&&(this.#f.add(t),this.#_(),this.#z("audio-player:track-change",e))}#C(){if(!this.#e)return;let t=this.#t.src,e=Bt(this.#e).find(i=>i.querySelector("a[href]").href===t);this.#e.querySelectorAll("li[data-audio-active]").forEach(i=>{i!==e&&i.removeAttribute("data-audio-active")}),e?.setAttribute("data-audio-active","")}#O(){if(!this.#e)return;let t=this.hasAttribute("loop");if(!this.hasAttribute("shuffle")){let o=vs(this.#e,{loop:t});o&&this.#M(o);return}let e=Bt(this.#e),i=this.#e.querySelector("li[data-audio-active]");i&&this.#f.add(i);let s=e.filter(o=>!this.#f.has(o));if(!s.length){if(this.#f.clear(),!t)return;s=e.length>1?e.filter(o=>o!==i):e}let n=s[Math.floor(Math.random()*s.length)];n&&this.#M(n)}#I(){let t=this.#t.currentTime,e=this.#t.duration||0,i=e?t/e*100:0;this.#h.textContent=this.#L(t),this.#N(t,e),!this.#d&&(this.#n.value=String(i),this.#a.style.width=`${i}%`)}#N(t,e){this.#n.setAttribute("aria-valuetext",`${this.#L(t)} of ${this.#L(e)}`)}#P(){let t=this.#t.duration||0;this.#l.textContent=this.#L(t)}#_(){if(!this.#o)return;if(this.#e){let i=this.#e.querySelector("li[data-audio-active] a");if(i){this.#o.textContent=i.textContent;return}}let t=this.#t.src||this.#t.currentSrc||this.#t.querySelector("source")?.src||"",e=t?t.split("/").pop().split(/[?#]/)[0]:"";this.#o.textContent=e.replace(/\.[^.]+$/,"").replace(/[-_]/g," ")}#L(t){if(!Number.isFinite(t))return"0:00";let e=Math.floor(t/60),i=Math.floor(t%60).toString().padStart(2,"0");return`${e}:${i}`}#z(t,e){this.dispatchEvent(new CustomEvent(t,{bubbles:!0,composed:!0,detail:e}))}};g("audio-player",we);var Ae=new Map;function Un(){if(!Ae.has("default"))try{Ae.set("default",new AudioContext)}catch{return null}return Ae.get("default")}var Dt=new WeakMap;function Vn(r,t){if(Dt.has(r))return Dt.get(r);let e=t.createMediaElementSource(r);return e.connect(t.destination),Dt.set(r,e),e}function ws(r){let t=Number.parseInt(r??"",10);if(!Number.isFinite(t)||t<=0)return 256;let e=2**Math.round(Math.log2(t));return Math.min(32768,Math.max(32,e))}function Wn(r){if(r.crossOrigin!=null)return!1;let t=r.currentSrc||r.src||r.querySelector("source[src]")?.src||"";if(!t)return!1;try{let e=new URL(t,location.href);return e.protocol==="data:"||e.protocol==="blob:"?!1:e.origin!==location.origin}catch{return!1}}var As=new WeakSet,Gn=new Set(["bars","waveform","circle"]);function ks(r){return r&&Gn.has(r)?r:"bars"}var ke="oklch(55% 0.2 260)",Kn=new Uint8Array(256).fill(128),Yn=new Uint8Array(128),xe=class extends b{#t=null;#e=null;#i=null;#s=null;#r=null;#n=new Uint8Array(0);#a=new Uint8Array(0);#c=ke;#h="";#l="bars";#o=null;#u=null;#p=null;#d=!0;#f=!1;#v=!1;#y=null;#g=()=>this.#S();static get observedAttributes(){return["for","data-mode","data-fft-size"]}setup(){if(this.#v=window.matchMedia("(prefers-reduced-motion: reduce)").matches,this.#l=ks(this.getAttribute("data-mode")),this.#w(),this.#A(),this.#m(),this.#N(),this.#P(),this.#_(),this.#f&&this.#r&&this.#s){try{this.#r.connect(this.#s)}catch{}this.#T()}let t=()=>requestAnimationFrame(()=>{this.#A(),this.#o||this.#M()});this.listen(window,"vb:theme-change",t),this.listen(window.matchMedia("(prefers-color-scheme: dark)"),"change",t)}teardown(){this.#E(),this.#u?.disconnect(),this.#p?.disconnect(),this.#y?.removeEventListener("play",this.#g),this.#y=null,this.#b()}attributeChangedCallback(t,e,i){if(e!==i){if(t==="data-mode"){this.#l=ks(i),this.isConnected&&!this.#o&&this.#M();return}this.isConnected&&(t==="for"?this.#m():t==="data-fft-size"&&this.#s&&(this.#s.fftSize=ws(i),this.#x(),this.#o||this.#M()))}}#w(){if(this.shadowRoot)return;let t=this.attachShadow({mode:"open"});t.innerHTML=`
350
350
  <style>
351
351
  :host {
352
352
  display: block;
353
- --_color: var(--audio-visualizer-color, var(--color-primary, ${de}));
353
+ --_color: var(--audio-visualizer-color, var(--color-primary, ${ke}));
354
354
  --_bg: var(--audio-visualizer-bg, var(--color-surface-sunken, transparent));
355
355
  --_height: var(--audio-visualizer-height, 80px);
356
356
  --_radius: var(--audio-visualizer-radius, var(--radius-m, 0.5rem));
@@ -364,8 +364,8 @@ var rn=Object.defineProperty;var ce=(r,t)=>()=>(r&&(t=r(r=0)),t);var Ki=(r,t)=>{
364
364
  }
365
365
  </style>
366
366
  <canvas aria-hidden="true"></canvas>
367
- `,this.#t=t.querySelector("canvas"),this.#e=this.#t.getContext("2d")}#w(){let t=getComputedStyle(this);this.#c=t.getPropertyValue("--_color").trim()||de,this.#h=t.getPropertyValue("--_bg").trim()}#m(){let t=this.getAttribute("for"),e=t?document.getElementById(t):null,i=e?.tagName==="AUDIO"?e:null;if(this.#i&&this.#i!==i&&(this.#E(),this.#b(),this.#s=null,this.#r=null,this.#f=!1,this.getAttribute("data-state")!==null&&this.removeAttribute("data-state"),this.#T()),this.#i=i,!i){this.#v?.removeEventListener("play",this.#g),this.#v=null;return}this.#f||(this.#v!==i&&(this.#v?.removeEventListener("play",this.#g),i.addEventListener("play",this.#g),this.#v=i),i.paused||this.#C())}#b(){if(this.#r&&this.#s)try{this.#r.disconnect(this.#s)}catch{}}#C(){if(this.#f||!this.#i)return;let t=this.#i;if(!Rt.has(t)&&hn(t)){this.setAttribute("data-state","cross-origin"),es.has(t)||(es.add(t),console.warn('<audio-visualizer>: not visualising a cross-origin <audio> without crossorigin="anonymous" and CORS headers \u2014 hooking it would mute playback.',t));return}let e=ln();if(!e)return;let i,s;try{i=e.createAnalyser(),i.fftSize=ts(this.getAttribute("data-fft-size")),i.smoothingTimeConstant=.8,s=cn(t,e),s.connect(i)}catch(n){this.setAttribute("data-state","error"),console.warn("<audio-visualizer>: could not connect to the audio element.",n);return}this.#s=i,this.#r=s,this.#x(),this.#f=!0,this.getAttribute("data-state")!==null&&this.removeAttribute("data-state"),this.#v?.removeEventListener("play",this.#g),this.#v=null,e.state==="suspended"&&e.resume().catch(()=>{}),this.#L()}#x(){this.#s&&(this.#n.length!==this.#s.frequencyBinCount&&(this.#n=new Uint8Array(this.#s.frequencyBinCount)),this.#a.length!==this.#s.fftSize&&(this.#a=new Uint8Array(this.#s.fftSize)))}#L(){if(this.#o)return;if(this.#k){this.#T();return}let t=()=>{if(!this.#d||this.#k){this.#o=null;return}this.#o=requestAnimationFrame(t),this.#T()};this.#o=requestAnimationFrame(t)}#E(){this.#o&&(cancelAnimationFrame(this.#o),this.#o=null)}#A(){let t=window.devicePixelRatio||1,e=Math.round(this.#t.clientWidth*t),i=Math.round(this.#t.clientHeight*t);this.#t.width!==e&&(this.#t.width=e),this.#t.height!==i&&(this.#t.height=i)}#T(){let t=this.#e;if(!t)return;let e=this.#t.width,i=this.#t.height;if(!e||!i)return;t.clearRect(0,0,e,i),this.#h&&this.#h!=="transparent"&&(t.fillStyle=this.#h,t.fillRect(0,0,e,i));let s=this.#f?this.#s:null,n=this.#l;if(n==="waveform"){s&&s.getByteTimeDomainData(this.#a),this.#z(t,e,i,this.#c,s?this.#a:dn);return}s&&s.getByteFrequencyData(this.#n);let o=s?this.#n:pn;n==="circle"?this.#I(t,e,i,this.#c,o):this.#S(t,e,i,this.#c,o)}#S(t,e,i,s,n){let o=Math.min(n.length,64),a=e/o,l=Math.max(1,a-1),c=Math.max(1,Math.round(i*.03));t.fillStyle=s;for(let h=0;h<o;h++){let u=Math.max(c,n[h]/255*i);t.fillRect(h*a,i-u,l,u)}}#z(t,e,i,s,n){let o=e/Math.max(1,n.length-1);t.strokeStyle=s,t.lineWidth=2*(window.devicePixelRatio||1),t.beginPath();for(let a=0;a<n.length;a++){let l=n[a]/255*i;a===0?t.moveTo(0,l):t.lineTo(a*o,l)}t.stroke()}#I(t,e,i,s,n){let o=e/2,a=i/2,l=Math.min(e,i)*.25,c=n.length;t.strokeStyle=s,t.lineWidth=2*(window.devicePixelRatio||1),t.beginPath();for(let h=0;h<c;h++){let u=h/c*Math.PI*2,p=n[h]/255*(l*.8),d=l+p,f=o+d*Math.cos(u),m=a+d*Math.sin(u);h===0?t.moveTo(f,m):t.lineTo(f,m)}t.closePath(),t.stroke()}#N(){this.#u??=new IntersectionObserver(([t])=>{this.#d=t.isIntersecting,this.#d&&this.#f&&!this.#o&&!this.#k&&this.#L()}),this.#u.observe(this)}#$(){this.#p??=new ResizeObserver(()=>{this.#A(),this.#o||this.#T()}),this.#p.observe(this.#t)}#_(){let t=window.matchMedia("(prefers-reduced-motion: reduce)");this.listen(t,"change",e=>{this.#k=e.matches,this.#k?(this.#E(),this.#T()):this.#f&&this.#d&&!this.#o&&this.#L()})}};g("audio-visualizer",pe);function ss(r){return fn(r&&r.closest("[lang]")?.lang||document.documentElement.lang||navigator.language||"en")}function fn(r,t="en-US"){try{if(r)return Intl.getCanonicalLocales(r),r}catch{}try{return Intl.getCanonicalLocales(t),t}catch{return"en-US"}}var mn=["position:absolute","inline-size:1px","block-size:1px","padding:0","margin:-1px","overflow:hidden","clip-path:inset(50%)","white-space:nowrap","border:0"].join(";"),rs=new WeakMap;function gn(r,t){let e=rs.get(t);e||rs.set(t,e=new Map);let i=e.get(r);if(!i||!i.region.isConnected){let n=(t.ownerDocument||document).createElement("span");n.setAttribute("data-vb-announcer",r),n.setAttribute("role",r==="assertive"?"alert":"status"),n.setAttribute("aria-live",r),n.setAttribute("aria-atomic","true"),n.style.cssText=mn,t.appendChild(n),i={region:n},e.set(r,i)}return i}function V(r,{politeness:t="polite",root:e}={}){let i=String(r??"").trim();if(!i||typeof document>"u")return null;let s=e||document.body;if(!s)return null;let o=gn(t==="assertive"?"assertive":"polite",s);return clearTimeout(o.write),clearTimeout(o.clear),o.region.textContent="",o.write=setTimeout(()=>{o.region.textContent=i,o.clear=setTimeout(()=>{o.region.textContent=""},7e3)},50),o.region}function D(r,t,e,i){let s=`data-label-${t}`,o=r?.closest?.(`[${s}]`)?.getAttribute(s)||e;return i?o.replace(/\{(\w+)\}/g,(a,l)=>l in i?String(i[l]):a):o}var fe=[.5,.75,1,1.25,1.5,2],ns=3e3,Nt=10,bn=5,vn='input, button, a[href], summary, select, textarea, video[controls], [contenteditable]:not([contenteditable="false"])',yn={player:"Video player",controls:"Video controls","play-video":"Play video",play:"Play",pause:"Pause",seek:"Seek","skip-back":"Skip back 10 seconds","skip-forward":"Skip forward 10 seconds",mute:"Mute",volume:"Volume",speed:"Playback speed {rate}",captions:"Captions",fullscreen:"Fullscreen","exit-fullscreen":"Exit fullscreen",playing:"Playing",paused:"Paused",ended:"Ended",buffering:"Buffering","time-of":"{current} of {duration}"},me=class extends v{#t=null;#e=null;#i=!1;#s=null;#r=null;#n=null;#a=null;#c=null;#h=null;#l=null;#o=null;#u=null;#p=null;#d=null;#f=null;#k=null;#v=null;#g=null;#y=2;#w=null;#m=null;#b=null;#C=!1;#x="en";#L=null;#E=null;setup(){if(this.#t=this.querySelector("video"),!this.#t)return!1;this.#e=this.querySelector(".track-list"),this.#t.removeAttribute("controls"),this.#A(),this.#z(),this.#_(),this.#B(),this.#G(),this.#j(),this.#I(),this.#T(),this.hasAttribute("muted")&&(this.#t.muted=!0),this.#X(),!this.#e&&this.hasAttribute("loop")&&(this.#t.loop=!0),this.#C||(this.#C=!0,globalThis.matchMedia?.("(prefers-reduced-motion: reduce)").matches?this.#t.autoplay&&(this.#t.autoplay=!1,this.#t.pause()):this.hasAttribute("autoplay")&&this.#t.play().catch(()=>{})),this.#P(),this.#w=()=>{let e=this.shadowRoot?.querySelector(".player");e&&(e.style.display="none",e.offsetHeight,e.style.display="")},this.listen(window,"vb:theme-change",this.#w),this.#m=()=>{let e=this.#Q();e!==this.hasAttribute("data-fullscreen")&&(this.#rt(e),this.#f.setAttribute("aria-label",this.#S(e?"exit-fullscreen":"fullscreen")),this.#V("video-player:fullscreen",{active:e}))},this.listen(document,"fullscreenchange",this.#m),this.#rt(this.#Q());let t=this.#tt();return t&&this.hasAttribute("captions")&&(t.mode="showing"),this.#st(),this.listen(this.#t.textTracks,"change",()=>this.#st()),this.#i=!this.#t.paused&&!this.#t.ended,this.#M(this.#t.ended?"ended":this.#i?"playing":this.#t.currentTime>0?"paused":"idle"),this.#r.setAttribute("aria-label",this.#S(this.#i?"pause":"play")),this.#Z(),this.#U(),!0}teardown(){this.#t&&this.#t.setAttribute("controls",""),this.#g!=null&&clearTimeout(this.#g),this.#g=null}get src(){return this.#t?.getAttribute("src")||this.#t?.currentSrc||""}set src(t){if(!this.#t)return;let e=t==null?"":String(t);this.#t.getAttribute("src")!==e&&(this.#t.setAttribute("src",e),this.#t.load?.(),this.#V("video-player:src-changed",{src:e,source:"property"}))}get currentTime(){return this.#t?.currentTime??0}set currentTime(t){this.#t&&(this.#t.currentTime=Number(t)||0)}#A(){if(this.shadowRoot)return;let t=this.attachShadow({mode:"open"});t.innerHTML=`
368
- <style>${this.#$()}</style>
367
+ `,this.#t=t.querySelector("canvas"),this.#e=this.#t.getContext("2d")}#A(){let t=getComputedStyle(this);this.#c=t.getPropertyValue("--_color").trim()||ke,this.#h=t.getPropertyValue("--_bg").trim()}#m(){let t=this.getAttribute("for"),e=t?document.getElementById(t):null,i=e?.tagName==="AUDIO"?e:null;if(this.#i&&this.#i!==i&&(this.#E(),this.#b(),this.#s=null,this.#r=null,this.#f=!1,this.getAttribute("data-state")!==null&&this.removeAttribute("data-state"),this.#M()),this.#i=i,!i){this.#y?.removeEventListener("play",this.#g),this.#y=null;return}this.#f||(this.#y!==i&&(this.#y?.removeEventListener("play",this.#g),i.addEventListener("play",this.#g),this.#y=i),i.paused||this.#S())}#b(){if(this.#r&&this.#s)try{this.#r.disconnect(this.#s)}catch{}}#S(){if(this.#f||!this.#i)return;let t=this.#i;if(!Dt.has(t)&&Wn(t)){this.setAttribute("data-state","cross-origin"),As.has(t)||(As.add(t),console.warn('<audio-visualizer>: not visualising a cross-origin <audio> without crossorigin="anonymous" and CORS headers \u2014 hooking it would mute playback.',t));return}let e=Un();if(!e)return;let i,s;try{i=e.createAnalyser(),i.fftSize=ws(this.getAttribute("data-fft-size")),i.smoothingTimeConstant=.8,s=Vn(t,e),s.connect(i)}catch(n){this.setAttribute("data-state","error"),console.warn("<audio-visualizer>: could not connect to the audio element.",n);return}this.#s=i,this.#r=s,this.#x(),this.#f=!0,this.getAttribute("data-state")!==null&&this.removeAttribute("data-state"),this.#y?.removeEventListener("play",this.#g),this.#y=null,e.state==="suspended"&&e.resume().catch(()=>{}),this.#T()}#x(){this.#s&&(this.#n.length!==this.#s.frequencyBinCount&&(this.#n=new Uint8Array(this.#s.frequencyBinCount)),this.#a.length!==this.#s.fftSize&&(this.#a=new Uint8Array(this.#s.fftSize)))}#T(){if(this.#o)return;if(this.#v){this.#M();return}let t=()=>{if(!this.#d||this.#v){this.#o=null;return}this.#o=requestAnimationFrame(t),this.#M()};this.#o=requestAnimationFrame(t)}#E(){this.#o&&(cancelAnimationFrame(this.#o),this.#o=null)}#k(){let t=window.devicePixelRatio||1,e=Math.round(this.#t.clientWidth*t),i=Math.round(this.#t.clientHeight*t);this.#t.width!==e&&(this.#t.width=e),this.#t.height!==i&&(this.#t.height=i)}#M(){let t=this.#e;if(!t)return;let e=this.#t.width,i=this.#t.height;if(!e||!i)return;t.clearRect(0,0,e,i),this.#h&&this.#h!=="transparent"&&(t.fillStyle=this.#h,t.fillRect(0,0,e,i));let s=this.#f?this.#s:null,n=this.#l;if(n==="waveform"){s&&s.getByteTimeDomainData(this.#a),this.#O(t,e,i,this.#c,s?this.#a:Kn);return}s&&s.getByteFrequencyData(this.#n);let o=s?this.#n:Yn;n==="circle"?this.#I(t,e,i,this.#c,o):this.#C(t,e,i,this.#c,o)}#C(t,e,i,s,n){let o=Math.min(n.length,64),a=e/o,l=Math.max(1,a-1),c=Math.max(1,Math.round(i*.03));t.fillStyle=s;for(let h=0;h<o;h++){let u=Math.max(c,n[h]/255*i);t.fillRect(h*a,i-u,l,u)}}#O(t,e,i,s,n){let o=e/Math.max(1,n.length-1);t.strokeStyle=s,t.lineWidth=2*(window.devicePixelRatio||1),t.beginPath();for(let a=0;a<n.length;a++){let l=n[a]/255*i;a===0?t.moveTo(0,l):t.lineTo(a*o,l)}t.stroke()}#I(t,e,i,s,n){let o=e/2,a=i/2,l=Math.min(e,i)*.25,c=n.length;t.strokeStyle=s,t.lineWidth=2*(window.devicePixelRatio||1),t.beginPath();for(let h=0;h<c;h++){let u=h/c*Math.PI*2,p=n[h]/255*(l*.8),d=l+p,f=o+d*Math.cos(u),m=a+d*Math.sin(u);h===0?t.moveTo(f,m):t.lineTo(f,m)}t.closePath(),t.stroke()}#N(){this.#u??=new IntersectionObserver(([t])=>{this.#d=t.isIntersecting,this.#d&&this.#f&&!this.#o&&!this.#v&&this.#T()}),this.#u.observe(this)}#P(){this.#p??=new ResizeObserver(()=>{this.#k(),this.#o||this.#M()}),this.#p.observe(this.#t)}#_(){let t=window.matchMedia("(prefers-reduced-motion: reduce)");this.listen(t,"change",e=>{this.#v=e.matches,this.#v?(this.#E(),this.#M()):this.#f&&this.#d&&!this.#o&&this.#T()})}};g("audio-visualizer",xe);function xs(r){return Xn(r&&r.closest("[lang]")?.lang||document.documentElement.lang||navigator.language||"en")}function Xn(r,t="en-US"){try{if(r)return Intl.getCanonicalLocales(r),r}catch{}try{return Intl.getCanonicalLocales(t),t}catch{return"en-US"}}var Jn=["position:absolute","inline-size:1px","block-size:1px","padding:0","margin:-1px","overflow:hidden","clip-path:inset(50%)","white-space:nowrap","border:0"].join(";"),Es=new WeakMap;function Zn(r,t){let e=Es.get(t);e||Es.set(t,e=new Map);let i=e.get(r);if(!i||!i.region.isConnected){let n=(t.ownerDocument||document).createElement("span");n.setAttribute("data-vb-announcer",r),n.setAttribute("role",r==="assertive"?"alert":"status"),n.setAttribute("aria-live",r),n.setAttribute("aria-atomic","true"),n.style.cssText=Jn,t.appendChild(n),i={region:n},e.set(r,i)}return i}function K(r,{politeness:t="polite",root:e}={}){let i=String(r??"").trim();if(!i||typeof document>"u")return null;let s=e||document.body;if(!s)return null;let o=Zn(t==="assertive"?"assertive":"polite",s);return clearTimeout(o.write),clearTimeout(o.clear),o.region.textContent="",o.write=setTimeout(()=>{o.region.textContent=i,o.clear=setTimeout(()=>{o.region.textContent=""},7e3)},50),o.region}function H(r,t,e,i){let s=`data-label-${t}`,o=r?.closest?.(`[${s}]`)?.getAttribute(s)||e;return i?o.replace(/\{(\w+)\}/g,(a,l)=>l in i?String(i[l]):a):o}var Ee=[.5,.75,1,1.25,1.5,2],Ss=3e3,jt=10,Qn=5,to='input, button, a[href], summary, select, textarea, video[controls], [contenteditable]:not([contenteditable="false"])',eo={player:"Video player",controls:"Video controls","play-video":"Play video",play:"Play",pause:"Pause",seek:"Seek","skip-back":"Skip back 10 seconds","skip-forward":"Skip forward 10 seconds",mute:"Mute",volume:"Volume",speed:"Playback speed {rate}",captions:"Captions",fullscreen:"Fullscreen","exit-fullscreen":"Exit fullscreen",playing:"Playing",paused:"Paused",ended:"Ended",buffering:"Buffering","time-of":"{current} of {duration}"},Se=class extends b{#t=null;#e=null;#i=!1;#s=null;#r=null;#n=null;#a=null;#c=null;#h=null;#l=null;#o=null;#u=null;#p=null;#d=null;#f=null;#v=null;#y=null;#g=null;#w=2;#A=null;#m=null;#b=null;#S=!1;#x="en";#T=null;#E=null;setup(){if(this.#t=this.querySelector("video"),!this.#t)return!1;this.#e=this.querySelector(".track-list"),this.#t.removeAttribute("controls"),this.#k(),this.#O(),this.#_(),this.#z(),this.#G(),this.#D(),this.#I(),this.#M(),this.hasAttribute("muted")&&(this.#t.muted=!0),this.#Y(),!this.#e&&this.hasAttribute("loop")&&(this.#t.loop=!0),this.#S||(this.#S=!0,globalThis.matchMedia?.("(prefers-reduced-motion: reduce)").matches?this.#t.autoplay&&(this.#t.autoplay=!1,this.#t.pause()):this.hasAttribute("autoplay")&&this.#t.play().catch(()=>{})),this.#$(),this.#A=()=>{let e=this.shadowRoot?.querySelector(".player");e&&(e.style.display="none",e.offsetHeight,e.style.display="")},this.listen(window,"vb:theme-change",this.#A),this.#m=()=>{let e=this.#Q();e!==this.hasAttribute("data-fullscreen")&&(this.#rt(e),this.#f.setAttribute("aria-label",this.#C(e?"exit-fullscreen":"fullscreen")),this.#V("video-player:fullscreen",{active:e}))},this.listen(document,"fullscreenchange",this.#m),this.#rt(this.#Q());let t=this.#tt();return t&&this.hasAttribute("captions")&&(t.mode="showing"),this.#st(),this.listen(this.#t.textTracks,"change",()=>this.#st()),this.#i=!this.#t.paused&&!this.#t.ended,this.#L(this.#t.ended?"ended":this.#i?"playing":this.#t.currentTime>0?"paused":"idle"),this.#r.setAttribute("aria-label",this.#C(this.#i?"pause":"play")),this.#Z(),this.#U(),!0}teardown(){this.#t&&this.#t.setAttribute("controls",""),this.#g!=null&&clearTimeout(this.#g),this.#g=null}get src(){return this.#t?.getAttribute("src")||this.#t?.currentSrc||""}set src(t){if(!this.#t)return;let e=t==null?"":String(t);this.#t.getAttribute("src")!==e&&(this.#t.setAttribute("src",e),this.#t.load?.(),this.#V("video-player:src-changed",{src:e,source:"property"}))}get currentTime(){return this.#t?.currentTime??0}set currentTime(t){this.#t&&(this.#t.currentTime=Number(t)||0)}#k(){if(this.shadowRoot)return;let t=this.attachShadow({mode:"open"});t.innerHTML=`
368
+ <style>${this.#P()}</style>
369
369
  <div part="player" class="player">
370
370
  <slot></slot>
371
371
  <button part="play-overlay" class="play-overlay" type="button" aria-label="Play video">
@@ -448,7 +448,7 @@ var rn=Object.defineProperty;var ce=(r,t)=>()=>(r&&(t=r(r=0)),t);var Ki=(r,t)=>{
448
448
  </div>
449
449
  <div class="sr-status" role="status" aria-live="polite"></div>
450
450
  </div>
451
- `,this.#s=t.querySelector(".controls"),this.#r=t.querySelector(".play-btn"),this.#n=t.querySelector(".play-overlay"),this.#a=t.querySelector(".timeline"),this.#c=t.querySelector(".timeline-fill"),this.#h=t.querySelector(".timeline-buffer"),this.#l=t.querySelector(".volume"),this.#o=t.querySelector(".current-time"),this.#u=t.querySelector(".duration"),this.#p=t.querySelector(".speed-btn"),this.#d=t.querySelector(".captions-btn"),this.#f=t.querySelector(".fullscreen-btn"),this.#k=t.querySelector(".buffer-indicator"),this.#v=t.querySelector(".sr-status"),this.#b=t.querySelector(".mute-btn")}#T(){let t=this.#t.querySelector('track[kind="captions"], track[kind="subtitles"]');this.#d.hidden=!t}#S(t,e={}){let i=this.getAttribute(`data-label-${t}`)??yn[t]??t;for(let[s,n]of Object.entries(e))i=i.replaceAll(`{${s}}`,n);return i}#z(){this.#x=ss(this);try{this.#L=new Intl.NumberFormat(this.#x,{useGrouping:!1})}catch{this.#L=new Intl.NumberFormat("en",{useGrouping:!1})}let t=Intl.DurationFormat;try{this.#E=t?new t(this.#x,{style:"digital",hoursDisplay:"auto"}):null}catch{this.#E=null}}#I(){let t=this.shadowRoot,e=(i,s)=>t.querySelector(i)?.setAttribute("aria-label",this.#S(s));e(".controls","controls"),e(".play-overlay","play-video"),e(".timeline","seek"),e(".skip-back-btn","skip-back"),e(".skip-forward-btn","skip-forward"),e(".mute-btn","mute"),e(".volume","volume"),e(".captions-btn","captions"),this.#f.setAttribute("aria-label",this.#S(this.#Q()?"exit-fullscreen":"fullscreen")),this.#N(),this.hasAttribute("tabindex")||this.setAttribute("tabindex","0"),this.hasAttribute("role")||this.setAttribute("role","group"),!this.hasAttribute("aria-label")&&!this.hasAttribute("aria-labelledby")&&this.setAttribute("aria-label",this.#S("player")),this.hasAttribute("aria-keyshortcuts")||this.setAttribute("aria-keyshortcuts","Space k ArrowLeft ArrowRight ArrowUp ArrowDown m f c")}#N(){let t=fe[this.#y],e=`${this.#L?.format(t)??t}x`,i=this.#p.querySelector("span");i.textContent=e,this.#p.setAttribute("aria-label",this.#S("speed",{rate:e}))}#$(){return`
451
+ `,this.#s=t.querySelector(".controls"),this.#r=t.querySelector(".play-btn"),this.#n=t.querySelector(".play-overlay"),this.#a=t.querySelector(".timeline"),this.#c=t.querySelector(".timeline-fill"),this.#h=t.querySelector(".timeline-buffer"),this.#l=t.querySelector(".volume"),this.#o=t.querySelector(".current-time"),this.#u=t.querySelector(".duration"),this.#p=t.querySelector(".speed-btn"),this.#d=t.querySelector(".captions-btn"),this.#f=t.querySelector(".fullscreen-btn"),this.#v=t.querySelector(".buffer-indicator"),this.#y=t.querySelector(".sr-status"),this.#b=t.querySelector(".mute-btn")}#M(){let t=this.#t.querySelector('track[kind="captions"], track[kind="subtitles"]');this.#d.hidden=!t}#C(t,e={}){let i=this.getAttribute(`data-label-${t}`)??eo[t]??t;for(let[s,n]of Object.entries(e))i=i.replaceAll(`{${s}}`,n);return i}#O(){this.#x=xs(this);try{this.#T=new Intl.NumberFormat(this.#x,{useGrouping:!1})}catch{this.#T=new Intl.NumberFormat("en",{useGrouping:!1})}let t=Intl.DurationFormat;try{this.#E=t?new t(this.#x,{style:"digital",hoursDisplay:"auto"}):null}catch{this.#E=null}}#I(){let t=this.shadowRoot,e=(i,s)=>t.querySelector(i)?.setAttribute("aria-label",this.#C(s));e(".controls","controls"),e(".play-overlay","play-video"),e(".timeline","seek"),e(".skip-back-btn","skip-back"),e(".skip-forward-btn","skip-forward"),e(".mute-btn","mute"),e(".volume","volume"),e(".captions-btn","captions"),this.#f.setAttribute("aria-label",this.#C(this.#Q()?"exit-fullscreen":"fullscreen")),this.#N(),this.hasAttribute("tabindex")||this.setAttribute("tabindex","0"),this.hasAttribute("role")||this.setAttribute("role","group"),!this.hasAttribute("aria-label")&&!this.hasAttribute("aria-labelledby")&&this.setAttribute("aria-label",this.#C("player")),this.hasAttribute("aria-keyshortcuts")||this.setAttribute("aria-keyshortcuts","Space k ArrowLeft ArrowRight ArrowUp ArrowDown m f c")}#N(){let t=Ee[this.#w],e=`${this.#T?.format(t)??t}x`,i=this.#p.querySelector("span");i.textContent=e,this.#p.setAttribute("aria-label",this.#C("speed",{rate:e}))}#P(){return`
452
452
  :host {
453
453
  display: block;
454
454
  --_accent: var(--video-player-accent, var(--color-primary, oklch(55% 0.2 260)));
@@ -932,7 +932,7 @@ var rn=Object.defineProperty;var ce=(r,t)=>()=>(r&&(t=r(r=0)),t);var Ki=(r,t)=>{
932
932
  cursor: auto;
933
933
  }
934
934
  }
935
- `}#_(){let t=this.#t;this.listen(t,"timeupdate",()=>this.#U()),this.listen(t,"loadedmetadata",()=>{this.#Z(),this.#U()}),this.listen(t,"durationchange",()=>this.#Z()),this.listen(t,"progress",()=>this.#et()),this.listen(t,"volumechange",()=>this.#X()),this.listen(t,"play",()=>{this.#i=!0,this.#M("playing"),this.#r.setAttribute("aria-label",this.#S("pause")),this.#Y(this.#S("playing")),this.#V("video-player:play",{currentTime:t.currentTime,src:t.currentSrc})}),this.listen(t,"pause",()=>{this.#i=!1,t.ended||this.#M("paused"),this.#r.setAttribute("aria-label",this.#S("play")),this.#P(),this.#Y(this.#S("paused")),this.#V("video-player:pause",{currentTime:t.currentTime})}),this.listen(t,"ended",()=>{this.#i=!1,this.#M("ended"),this.#r.setAttribute("aria-label",this.#S("play")),this.#P();let e=this.#e?.querySelector("li[data-video-active]");e&&e.setAttribute("data-video-played",""),this.#e&&this.#H(),this.#Y(this.#S("ended")),this.#V("video-player:ended",{src:t.currentSrc})}),this.listen(t,"waiting",()=>{this.#i&&(this.#M("buffering"),this.#Y(this.#S("buffering")))}),this.listen(t,"playing",()=>{this.getAttribute("state")==="buffering"&&this.#M("playing")})}#M(t){this.setAttribute("state",t),this.#n&&(this.#n.inert=!(t==="idle"||t==="ended"))}#B(){let t=this.shadowRoot,e=()=>{this.#i?this.#t.pause():this.#t.play().catch(()=>{})};this.listen(this.#n,"click",s=>{s.stopPropagation(),this.#t.play().catch(()=>{})});let i=t.querySelector(".player");this.listen(i,"click",s=>{let n=s.target;n.closest(".controls")||n.closest(".play-overlay")||n!==this.#t&&n!==i||e()}),this.listen(this.#r,"click",e),this.listen(this.#a,"input",()=>{this.#t.duration&&(this.#t.currentTime=Number(this.#a.value)/100*this.#t.duration,this.#W())}),this.listen(this.#a,"keydown",s=>{let n=s;if(n.altKey||n.ctrlKey||n.metaKey)return;let o={ArrowLeft:-1,ArrowDown:-1,ArrowRight:1,ArrowUp:1}[n.key];o&&(n.preventDefault(),this.#F(o*bn))}),this.listen(t.querySelector(".skip-back-btn"),"click",()=>this.#F(-Nt)),this.listen(t.querySelector(".skip-forward-btn"),"click",()=>this.#F(Nt)),this.listen(this.#l,"input",()=>{this.#t.volume=Number(this.#l.value),this.#t.muted=!1,this.#X()}),this.listen(this.#b,"click",()=>{this.#t.muted=!this.#t.muted,this.#X()}),this.listen(this.#p,"click",()=>{this.#y=(this.#y+1)%fe.length;let s=fe[this.#y];this.#t.playbackRate=s,this.#N(),V(this.#p.getAttribute("aria-label")||""),this.#V("video-player:speed",{rate:s})}),this.listen(this.#d,"click",()=>{let s=this.#tt();if(!s)return;let n=s.mode==="showing";s.mode=n?"hidden":"showing";let o=!n;this.toggleAttribute("captions",o),this.#d.setAttribute("aria-pressed",String(o)),this.#V("video-player:captions",{active:o,label:s.label})}),this.listen(this.#f,"click",()=>this.#it()),this.listen(this,"keydown",s=>this.#nt(s))}#D(t){for(let e of t.composedPath()){if(e===this)return!1;if(e instanceof Element&&e.matches(vn))return!0}return!1}#F(t){let e=this.#t.duration||0;this.#t.currentTime=Math.min(e,Math.max(0,this.#t.currentTime+t)),this.#P(),this.#U()}#j(){let t=this.shadowRoot?.querySelector(".player"),e=()=>{this.#P(),this.#O(ns)};this.listen(t,"mousemove",e),this.listen(t,"mouseenter",e),this.listen(t,"mouseleave",()=>this.#O(500)),this.listen(t,"touchstart",()=>{this.hasAttribute("controls")?this.#R():e()},{passive:!0}),this.listen(this.#s,"mouseenter",()=>{this.#g!=null&&clearTimeout(this.#g),this.#P()}),this.listen(this.#s,"focusin",()=>{this.#g!=null&&clearTimeout(this.#g),this.#P()}),this.listen(this.#s,"focusout",()=>this.#O(ns))}#O(t){this.#g!=null&&clearTimeout(this.#g),this.#g=null,this.#i&&(this.#g=setTimeout(()=>this.#R(),t))}#P(){this.setAttribute("controls","")}#R(){let t=this.shadowRoot?.activeElement;t&&this.#s?.contains(t)||this.removeAttribute("controls")}#G(){this.#e&&this.listen(this.#e,"click",t=>{let e=t.target.closest("a[href]");e&&(t.preventDefault(),this.#q(e.href,e.closest("li"),e))})}#q(t,e,i){this.#e.querySelectorAll("li").forEach(a=>a.removeAttribute("data-video-active")),e&&e.setAttribute("data-video-active",""),this.#t.src=t;let n=i?.getAttribute("data-poster");n&&(this.#t.poster=n);let o=i?.getAttribute("data-captions");this.#K(o),this.#t.play().catch(()=>{}),this.#V("video-player:track-change",{src:t,title:i?.textContent??""})}#K(t){if(this.#t.querySelectorAll("track[data-dynamic]").forEach(i=>i.remove()),t){let i=document.createElement("track");i.kind="captions",i.src=t,i.default=!0,i.setAttribute("data-dynamic",""),this.#t.appendChild(i),this.hasAttribute("captions")&&(i.track.mode="showing")}this.#T()}#H(){if(!this.#e)return;let t=[...this.#e.querySelectorAll("li")],e=t.findIndex(s=>s.hasAttribute("data-video-active"));if(this.hasAttribute("shuffle")){let s=t.filter((n,o)=>o!==e);if(s.length){let n=s[Math.floor(Math.random()*s.length)],o=n.querySelector("a[href]");o&&this.#q(o.href,n,o)}return}let i=e+1;if(i<t.length){let s=t[i].querySelector("a[href]");s&&this.#q(s.href,t[i],s)}else if(this.hasAttribute("loop")){let s=t[0]?.querySelector("a[href]");s&&this.#q(s.href,t[0],s)}}#U(){let t=this.#t.currentTime,e=this.#t.duration||0,i=e?t/e*100:0;this.#o.textContent=this.#J(t),this.#a.value=String(i),this.#W(),this.#c.style.width=`${i}%`}#W(){this.#a.setAttribute("aria-valuetext",this.#S("time-of",{current:this.#J(this.#t.currentTime),duration:this.#J(this.#t.duration||0)}))}#Z(){let t=this.#t.duration||0;this.#u.textContent=this.#J(t),this.#W()}#et(){let t=this.#t.buffered,e=this.#t.duration||0;if(t.length>0&&e){let i=t.end(t.length-1);this.#h.style.width=`${i/e*100}%`}}#Q(){let t=document.fullscreenElement;return!!t&&(t===this||t===this.#t)}#rt(t){t?this.setAttribute("data-fullscreen",""):this.removeAttribute("data-fullscreen")}#it(){this.#Q()?document.exitFullscreen().catch(()=>{}):this.requestFullscreen().catch(()=>{this.#t.requestFullscreen?.().catch(()=>{})})}#st(){let t=this.#tt();if(!t||!this.#d)return;let e=t.mode==="showing";this.toggleAttribute("captions",e),this.#d.setAttribute("aria-pressed",String(e))}#tt(){let t=this.#t.textTracks;for(let e=0;e<t.length;e++)if(t[e].kind==="captions"||t[e].kind==="subtitles")return t[e];return null}#nt(t){if(!(t.defaultPrevented||t.altKey||t.ctrlKey||t.metaKey)&&!this.#D(t))switch(t.key){case" ":case"k":case"K":t.preventDefault(),this.#i?this.#t.pause():this.#t.play().catch(()=>{});break;case"ArrowLeft":t.preventDefault(),this.#F(-Nt);break;case"ArrowRight":t.preventDefault(),this.#F(Nt);break;case"ArrowUp":t.preventDefault(),this.#t.volume=Math.min(1,this.#t.volume+.05),this.#X(),this.#P();break;case"ArrowDown":t.preventDefault(),this.#t.volume=Math.max(0,this.#t.volume-.05),this.#X(),this.#P();break;case"m":case"M":this.#t.muted=!this.#t.muted,this.#X();break;case"f":case"F":this.#it();break;case"c":case"C":this.#d.click();break}}#X(){if(!this.#t||!this.#b)return;let t=this.#t.muted;this.toggleAttribute("muted",t),this.#b.setAttribute("aria-pressed",String(t));let e=this.#t.volume;this.#l.value=String(e),this.#l.style.setProperty("--_vol",t?"0":String(e));let i;try{i=new Intl.NumberFormat(this.#x,{style:"percent"}).format(e)}catch{i=`${Math.round(e*100)}%`}this.#l.setAttribute("aria-valuetext",i)}#J(t){let e=Number.isFinite(t)&&t>0?Math.floor(t):0,i=Math.floor(e/3600),s=Math.floor(e%3600/60),n=e%60,o=this.#L??new Intl.NumberFormat("en",{useGrouping:!1});if(this.#E)try{let l=this.#E.formatToParts({hours:i,minutes:s,seconds:n}),c=!0;return l.map(h=>c&&h.type==="integer"?(c=!1,o.format(h.unit==="hour"?i:s)):h.value).join("")}catch{}let a=l=>o.format(l).padStart(2,o.format(0));return i>0?`${o.format(i)}:${a(s)}:${a(n)}`:`${o.format(s)}:${a(n)}`}#Y(t){this.#v&&(this.#v.textContent=t)}#V(t,e){this.dispatchEvent(new CustomEvent(t,{bubbles:!0,composed:!0,detail:e}))}};g("video-player",me);var os=`
935
+ `}#_(){let t=this.#t;this.listen(t,"timeupdate",()=>this.#U()),this.listen(t,"loadedmetadata",()=>{this.#Z(),this.#U()}),this.listen(t,"durationchange",()=>this.#Z()),this.listen(t,"progress",()=>this.#et()),this.listen(t,"volumechange",()=>this.#Y()),this.listen(t,"play",()=>{this.#i=!0,this.#L("playing"),this.#r.setAttribute("aria-label",this.#C("pause")),this.#X(this.#C("playing")),this.#V("video-player:play",{currentTime:t.currentTime,src:t.currentSrc})}),this.listen(t,"pause",()=>{this.#i=!1,t.ended||this.#L("paused"),this.#r.setAttribute("aria-label",this.#C("play")),this.#$(),this.#X(this.#C("paused")),this.#V("video-player:pause",{currentTime:t.currentTime})}),this.listen(t,"ended",()=>{this.#i=!1,this.#L("ended"),this.#r.setAttribute("aria-label",this.#C("play")),this.#$();let e=this.#e?.querySelector("li[data-video-active]");e&&e.setAttribute("data-video-played",""),this.#e&&this.#H(),this.#X(this.#C("ended")),this.#V("video-player:ended",{src:t.currentSrc})}),this.listen(t,"waiting",()=>{this.#i&&(this.#L("buffering"),this.#X(this.#C("buffering")))}),this.listen(t,"playing",()=>{this.getAttribute("state")==="buffering"&&this.#L("playing")})}#L(t){this.setAttribute("state",t),this.#n&&(this.#n.inert=!(t==="idle"||t==="ended"))}#z(){let t=this.shadowRoot,e=()=>{this.#i?this.#t.pause():this.#t.play().catch(()=>{})};this.listen(this.#n,"click",s=>{s.stopPropagation(),this.#t.play().catch(()=>{})});let i=t.querySelector(".player");this.listen(i,"click",s=>{let n=s.target;n.closest(".controls")||n.closest(".play-overlay")||n!==this.#t&&n!==i||e()}),this.listen(this.#r,"click",e),this.listen(this.#a,"input",()=>{this.#t.duration&&(this.#t.currentTime=Number(this.#a.value)/100*this.#t.duration,this.#W())}),this.listen(this.#a,"keydown",s=>{let n=s;if(n.altKey||n.ctrlKey||n.metaKey)return;let o={ArrowLeft:-1,ArrowDown:-1,ArrowRight:1,ArrowUp:1}[n.key];o&&(n.preventDefault(),this.#F(o*Qn))}),this.listen(t.querySelector(".skip-back-btn"),"click",()=>this.#F(-jt)),this.listen(t.querySelector(".skip-forward-btn"),"click",()=>this.#F(jt)),this.listen(this.#l,"input",()=>{this.#t.volume=Number(this.#l.value),this.#t.muted=!1,this.#Y()}),this.listen(this.#b,"click",()=>{this.#t.muted=!this.#t.muted,this.#Y()}),this.listen(this.#p,"click",()=>{this.#w=(this.#w+1)%Ee.length;let s=Ee[this.#w];this.#t.playbackRate=s,this.#N(),K(this.#p.getAttribute("aria-label")||""),this.#V("video-player:speed",{rate:s})}),this.listen(this.#d,"click",()=>{let s=this.#tt();if(!s)return;let n=s.mode==="showing";s.mode=n?"hidden":"showing";let o=!n;this.toggleAttribute("captions",o),this.#d.setAttribute("aria-pressed",String(o)),this.#V("video-player:captions",{active:o,label:s.label})}),this.listen(this.#f,"click",()=>this.#it()),this.listen(this,"keydown",s=>this.#nt(s))}#j(t){for(let e of t.composedPath()){if(e===this)return!1;if(e instanceof Element&&e.matches(to))return!0}return!1}#F(t){let e=this.#t.duration||0;this.#t.currentTime=Math.min(e,Math.max(0,this.#t.currentTime+t)),this.#$(),this.#U()}#D(){let t=this.shadowRoot?.querySelector(".player"),e=()=>{this.#$(),this.#B(Ss)};this.listen(t,"mousemove",e),this.listen(t,"mouseenter",e),this.listen(t,"mouseleave",()=>this.#B(500)),this.listen(t,"touchstart",()=>{this.hasAttribute("controls")?this.#R():e()},{passive:!0}),this.listen(this.#s,"mouseenter",()=>{this.#g!=null&&clearTimeout(this.#g),this.#$()}),this.listen(this.#s,"focusin",()=>{this.#g!=null&&clearTimeout(this.#g),this.#$()}),this.listen(this.#s,"focusout",()=>this.#B(Ss))}#B(t){this.#g!=null&&clearTimeout(this.#g),this.#g=null,this.#i&&(this.#g=setTimeout(()=>this.#R(),t))}#$(){this.setAttribute("controls","")}#R(){let t=this.shadowRoot?.activeElement;t&&this.#s?.contains(t)||this.removeAttribute("controls")}#G(){this.#e&&this.listen(this.#e,"click",t=>{let e=t.target.closest("a[href]");e&&(t.preventDefault(),this.#q(e.href,e.closest("li"),e))})}#q(t,e,i){this.#e.querySelectorAll("li").forEach(a=>a.removeAttribute("data-video-active")),e&&e.setAttribute("data-video-active",""),this.#t.src=t;let n=i?.getAttribute("data-poster");n&&(this.#t.poster=n);let o=i?.getAttribute("data-captions");this.#K(o),this.#t.play().catch(()=>{}),this.#V("video-player:track-change",{src:t,title:i?.textContent??""})}#K(t){if(this.#t.querySelectorAll("track[data-dynamic]").forEach(i=>i.remove()),t){let i=document.createElement("track");i.kind="captions",i.src=t,i.default=!0,i.setAttribute("data-dynamic",""),this.#t.appendChild(i),this.hasAttribute("captions")&&(i.track.mode="showing")}this.#M()}#H(){if(!this.#e)return;let t=[...this.#e.querySelectorAll("li")],e=t.findIndex(s=>s.hasAttribute("data-video-active"));if(this.hasAttribute("shuffle")){let s=t.filter((n,o)=>o!==e);if(s.length){let n=s[Math.floor(Math.random()*s.length)],o=n.querySelector("a[href]");o&&this.#q(o.href,n,o)}return}let i=e+1;if(i<t.length){let s=t[i].querySelector("a[href]");s&&this.#q(s.href,t[i],s)}else if(this.hasAttribute("loop")){let s=t[0]?.querySelector("a[href]");s&&this.#q(s.href,t[0],s)}}#U(){let t=this.#t.currentTime,e=this.#t.duration||0,i=e?t/e*100:0;this.#o.textContent=this.#J(t),this.#a.value=String(i),this.#W(),this.#c.style.width=`${i}%`}#W(){this.#a.setAttribute("aria-valuetext",this.#C("time-of",{current:this.#J(this.#t.currentTime),duration:this.#J(this.#t.duration||0)}))}#Z(){let t=this.#t.duration||0;this.#u.textContent=this.#J(t),this.#W()}#et(){let t=this.#t.buffered,e=this.#t.duration||0;if(t.length>0&&e){let i=t.end(t.length-1);this.#h.style.width=`${i/e*100}%`}}#Q(){let t=document.fullscreenElement;return!!t&&(t===this||t===this.#t)}#rt(t){t?this.setAttribute("data-fullscreen",""):this.removeAttribute("data-fullscreen")}#it(){this.#Q()?document.exitFullscreen().catch(()=>{}):this.requestFullscreen().catch(()=>{this.#t.requestFullscreen?.().catch(()=>{})})}#st(){let t=this.#tt();if(!t||!this.#d)return;let e=t.mode==="showing";this.toggleAttribute("captions",e),this.#d.setAttribute("aria-pressed",String(e))}#tt(){let t=this.#t.textTracks;for(let e=0;e<t.length;e++)if(t[e].kind==="captions"||t[e].kind==="subtitles")return t[e];return null}#nt(t){if(!(t.defaultPrevented||t.altKey||t.ctrlKey||t.metaKey)&&!this.#j(t))switch(t.key){case" ":case"k":case"K":t.preventDefault(),this.#i?this.#t.pause():this.#t.play().catch(()=>{});break;case"ArrowLeft":t.preventDefault(),this.#F(-jt);break;case"ArrowRight":t.preventDefault(),this.#F(jt);break;case"ArrowUp":t.preventDefault(),this.#t.volume=Math.min(1,this.#t.volume+.05),this.#Y(),this.#$();break;case"ArrowDown":t.preventDefault(),this.#t.volume=Math.max(0,this.#t.volume-.05),this.#Y(),this.#$();break;case"m":case"M":this.#t.muted=!this.#t.muted,this.#Y();break;case"f":case"F":this.#it();break;case"c":case"C":this.#d.click();break}}#Y(){if(!this.#t||!this.#b)return;let t=this.#t.muted;this.toggleAttribute("muted",t),this.#b.setAttribute("aria-pressed",String(t));let e=this.#t.volume;this.#l.value=String(e),this.#l.style.setProperty("--_vol",t?"0":String(e));let i;try{i=new Intl.NumberFormat(this.#x,{style:"percent"}).format(e)}catch{i=`${Math.round(e*100)}%`}this.#l.setAttribute("aria-valuetext",i)}#J(t){let e=Number.isFinite(t)&&t>0?Math.floor(t):0,i=Math.floor(e/3600),s=Math.floor(e%3600/60),n=e%60,o=this.#T??new Intl.NumberFormat("en",{useGrouping:!1});if(this.#E)try{let l=this.#E.formatToParts({hours:i,minutes:s,seconds:n}),c=!0;return l.map(h=>c&&h.type==="integer"?(c=!1,o.format(h.unit==="hour"?i:s)):h.value).join("")}catch{}let a=l=>o.format(l).padStart(2,o.format(0));return i>0?`${o.format(i)}:${a(s)}:${a(n)}`:`${o.format(s)}:${a(n)}`}#X(t){this.#y&&(this.#y.textContent=t)}#V(t,e){this.dispatchEvent(new CustomEvent(t,{bubbles:!0,composed:!0,detail:e}))}};g("video-player",Se);var Cs=`
936
936
  :host {
937
937
  display: block;
938
938
  position: relative;
@@ -1246,17 +1246,17 @@ var rn=Object.defineProperty;var ce=(r,t)=>()=>(r&&(t=r(r=0)),t);var Ki=(r,t)=>{
1246
1246
  border: 1px solid ButtonText;
1247
1247
  }
1248
1248
  }
1249
- `,gt=null;function as(r){if("adoptedStyleSheets"in r&&typeof CSSStyleSheet=="function"&&"replaceSync"in CSSStyleSheet.prototype)return gt||(gt=new CSSStyleSheet,gt.replaceSync(os)),r.adoptedStyleSheets.includes(gt)||(r.adoptedStyleSheets=[...r.adoptedStyleSheets,gt]),null;let t=document.createElement("style");return t.textContent=os,t}ge();var ve="http://www.w3.org/2000/svg",kn={map:"Map","map-of":"Map of {name}",activate:"Activate interactive map",consent:"Load map","consent-note":"Loads map images from {host}","zoom-in":"Zoom in","zoom-out":"Zoom out",recenter:"Recenter map",exit:"Exit map",controls:"Map controls",instructions:"Drag or use the arrow keys to pan. Click a point to centre on it. Pinch, scroll, or press plus and minus to zoom. Home recentres. Escape exits.",moved:"Map centred on {lat}, {lng}, zoom {zoom}","error-coords":"Map location unavailable","error-tiles":"Map images failed to load"},An=0;function xn(){let r=document.createElement("div");r.setAttribute("part","marker"),r.setAttribute("aria-hidden","true");let t=document.createElementNS(ve,"svg");t.setAttribute("viewBox","0 0 24 36"),t.setAttribute("focusable","false");let e=document.createElementNS(ve,"path");e.setAttribute("class","pin"),e.setAttribute("d","M12 0C5.373 0 0 5.373 0 12c0 9 12 24 12 24s12-15 12-24C24 5.373 18.627 0 12 0z");let i=document.createElementNS(ve,"circle");return i.setAttribute("class","dot"),i.setAttribute("cx","12"),i.setAttribute("cy","12"),i.setAttribute("r","5"),t.append(e,i),r.append(t),r}function S(r,t={},e){let i=document.createElement(r);for(let[s,n]of Object.entries(t))i.setAttribute(s,n);return e!=null&&(i.textContent=e),i}function us(r){return!r||typeof r!="string"?!1:typeof CSS<"u"&&CSS.supports("color",r)}var ye=class extends v{static get observedAttributes(){return["lat","lng","zoom","marker","marker-color","provider","tile-url","interactive","static-only","src","place","label","attribution","attribution-href","loading"]}#t=null;#e=null;#i=0;#s=!1;#r=!1;#n=!1;#a=!1;#c=!1;#h=`geo-map-${++An}`;#l=null;#o="";#u=new Map;#p="";#d=null;#f=0;#k=null;#v=null;#g=()=>this.#$();#y=0;#w="osm";constructor(){super(),this.attachShadow({mode:"open"})}get lat(){return parseFloat(this.getAttribute("lat")??"")}get lng(){return parseFloat(this.getAttribute("lng")??"")}get zoom(){let t=parseInt(this.getAttribute("zoom")??"",10);return t>=1&&t<=19?t:15}get showMarker(){return this.getAttribute("marker")!=="false"}get markerColor(){let t=this.getAttribute("marker-color");return us(t)?t:""}get provider(){let t=this.getAttribute("provider");return t&&(t in W||t==="carto-auto")?t:"osm"}get tileUrl(){return this.getAttribute("tile-url")||""}get interactive(){let t=this.getAttribute("interactive");return t==="eager"||t==="none"?t:"click"}get staticOnly(){return this.hasAttribute("static-only")}get loading(){let t=this.getAttribute("loading");return t==="eager"||t==="consent"?t:"lazy"}get active(){return this.#t!==null}#m(t,e={}){return(this.getAttribute(`data-label-${t}`)??kn[t]??"").replace(/\{(\w+)\}/g,(s,n)=>n in e?String(e[n]):s)}get#b(){return this.interactive!=="none"&&!this.staticOnly}get#C(){return this.loading==="consent"&&!this.#r}#x(){let t=this.provider;if(t!=="carto-auto")return t;let e=this.closest("[data-mode]")?.getAttribute("data-mode");return e==="dark"?"carto-dark":e==="light"?"carto-light":window.matchMedia?.("(prefers-color-scheme: dark)").matches?"carto-dark":"carto-light"}#L(){if(this.tileUrl)try{return new URL(this.tileUrl.replace(/\{s\}/g,"a"),location.href).origin}catch{return""}return(W[this.#w]??W.osm).origin}#E(){let t=parseFloat(this.getAttribute("lat")??""),e=parseFloat(this.getAttribute("lng")??"");if(!isNaN(t)&&!isNaN(e))return{lat:t,lng:e};let i=this.getAttribute("src");if(i){let a=this.#A(i);if(a)return a}let s=this.querySelector("address[data-lat][data-lng]");if(s){let a=parseFloat(s.dataset.lat??""),l=parseFloat(s.dataset.lng??"");if(!isNaN(a)&&!isNaN(l))return{lat:a,lng:l}}let n=this.getAttribute("place");if(n){let a=this.#T(n);if(a)return a}let o=document.querySelector('meta[name="geo.position"]');if(o){let l=(o.getAttribute("content")||"").split(";");if(l.length===2){let c=parseFloat(l[0]),h=parseFloat(l[1]);if(!isNaN(c)&&!isNaN(h))return{lat:c,lng:h}}}return null}#A(t){let e=document.getElementById(t);if(!e)return null;if(e.tagName==="ADDRESS"&&e.dataset.lat&&e.dataset.lng){let i=parseFloat(e.dataset.lat),s=parseFloat(e.dataset.lng);if(!isNaN(i)&&!isNaN(s))return{lat:i,lng:s}}return e.tagName==="SCRIPT"&&e.type==="application/ld+json"?this.#S(e):null}#T(t){let e=document.querySelectorAll('script[type="application/ld+json"]');for(let i of e)try{let s=JSON.parse(i.textContent);if(s.name===t){let n=s.geo;if(n){let o=parseFloat(n.latitude),a=parseFloat(n.longitude);if(!isNaN(o)&&!isNaN(a))return{lat:o,lng:a}}}}catch{}return null}#S(t){try{let i=JSON.parse(t.textContent).geo;if(i){let s=parseFloat(i.latitude),n=parseFloat(i.longitude);if(!isNaN(s)&&!isNaN(n))return{lat:s,lng:n}}}catch{}return null}#z(){let t=n=>(n||"").replace(/\s+/g," ").trim(),e=t(this.getAttribute("label"));if(e)return e;let i=t(this.querySelector("address")?.textContent),s=this.getAttribute("src");if(!i&&s){let n=document.getElementById(s);if(n?.tagName==="ADDRESS")i=t(n.textContent);else if(n?.tagName==="SCRIPT")try{i=t(JSON.parse(n.textContent||"").name)}catch{}}return i||(i=t(this.getAttribute("place"))),i?this.#m("map-of",{name:i}):this.#m("map")}setup(){if(this.#i++,this.#w=this.#x(),this.render(),this.#I(),this.#N(),this.#B(),this.interactive==="eager"&&!this.#n&&this.#b&&!this.#C&&this.#l){let t=this.#i;requestAnimationFrame(()=>{t===this.#i&&this.#O({focus:!1})})}}attributeChangedCallback(t,e,i){e===i||this.#s||!this.isConnected||!this.hasAttribute("data-upgraded")||this._reinit()}teardown(){this.#i++,this.#e=null,this.#t&&(this.#t.destroy(),this.#t=null,this.setState("active",!1)),this.#d?.disconnect(),this.#d=null,cancelAnimationFrame(this.#f),this.#k?.disconnect(),this.#k=null,this.#v?.removeEventListener("change",this.#g),this.#v=null,clearTimeout(this.#y)}#I(){typeof ResizeObserver=="function"&&(this.#d=new ResizeObserver(()=>{cancelAnimationFrame(this.#f),this.#f=requestAnimationFrame(()=>this.#B())}),this.#d.observe(this))}#N(){this.provider!=="carto-auto"||this.tileUrl||(this.#k=new MutationObserver(()=>this.#$()),this.#k.observe(document.documentElement,{attributes:!0,attributeFilter:["data-mode"]}),this.#v=window.matchMedia?.("(prefers-color-scheme: dark)")??null,this.#v?.addEventListener("change",this.#g))}#$(){this.#x()!==this.#w&&this._reinit()}get data(){return{lat:isNaN(this.lat)?void 0:this.lat,lng:isNaN(this.lng)?void 0:this.lng,zoom:this.zoom,marker:this.showMarker,markerColor:this.markerColor}}set data(t){if(!t||typeof t!="object")return;let e=this.data,i={...e};if(t.lat!=null&&!isNaN(Number(t.lat))&&(i.lat=Number(t.lat)),t.lng!=null&&!isNaN(Number(t.lng))&&(i.lng=Number(t.lng)),t.zoom!=null&&!isNaN(Number(t.zoom))&&(i.zoom=Number(t.zoom)),t.marker!=null&&(i.marker=!!t.marker),"markerColor"in t&&(us(t.markerColor)?i.markerColor=t.markerColor:t.markerColor||(i.markerColor="")),!(i.lat===e.lat&&i.lng===e.lng&&i.zoom===e.zoom&&i.marker===e.marker&&i.markerColor===e.markerColor)){this.#s=!0;try{i.lat!==e.lat&&this.setAttribute("lat",String(i.lat)),i.lng!==e.lng&&this.setAttribute("lng",String(i.lng)),i.zoom!==e.zoom&&this.setAttribute("zoom",String(i.zoom)),i.marker!==e.marker&&this.setAttribute("marker",i.marker?"true":"false"),i.markerColor!==e.markerColor&&(i.markerColor?this.setAttribute("marker-color",i.markerColor):this.removeAttribute("marker-color"))}finally{this.#s=!1}this.hasAttribute("data-upgraded")&&this._reinit(),this.dispatchEvent(new CustomEvent("geo-map:data-changed",{detail:{data:this.data,source:"property"},bubbles:!0,composed:!0}))}}get markers(){let t=this.#E();return t?[{lat:t.lat,lng:t.lng,color:this.markerColor}]:[]}render(){let t=this.shadowRoot,e=as(t);this.removeAttribute("data-ready"),this.#c=!1,this.#u=new Map,this.#p="",this.#l=this.#E(),this.#o=this.#z();let i=this.#l!==null,s=i&&this.#C,n=S("div",{part:"container"}),o=S("div",{part:"viewport",role:"img","aria-label":this.#o});if(o.append(S("div",{part:"tiles"})),this.showMarker&&i){let h=xn();this.markerColor&&h.style.setProperty("--_marker-color",this.markerColor),o.append(h)}if(n.append(o),s){n.setAttribute("data-consent","");let h=S("div",{part:"overlay"}),u=S("button",{part:"activate",type:"button"},this.#m("consent")),p=this.#L().replace(/^https?:\/\//,""),d=S("p",{part:"consent-note"},this.#m("consent-note",{host:p}));h.append(u,d),h.addEventListener("click",()=>this.#F());let f=()=>this.#j();h.addEventListener("pointerenter",f,{once:!0}),u.addEventListener("focus",f,{once:!0}),n.append(h)}else if(i&&this.#b){let h=S("div",{part:"overlay"});h.append(S("button",{part:"activate",type:"button"},this.#m("activate"))),h.addEventListener("click",()=>this.#O({focus:!0})),n.append(h)}if(i&&this.#b){let h=S("div",{part:"controls",role:"group","aria-label":this.#m("controls")}),u=[["zoom-in","+",this.#m("zoom-in"),()=>this.#t?.zoomBy(1)],["zoom-out","\u2212",this.#m("zoom-out"),()=>this.#t?.zoomBy(-1)],["recenter","\u2316",this.#m("recenter"),()=>this.#t?.recenter()],["exit","\u2715",this.#m("exit"),()=>this.#R()]];for(let[p,d,f,m]of u){let b=S("button",{part:`control ${p}`,type:"button","aria-label":f,title:f},d);b.addEventListener("click",m),h.append(b)}n.append(h)}let a=S("div",{part:"caption"}),l=S("slot");a.append(l),n.append(a);let c=()=>{let h=l.assignedNodes().some(u=>u.nodeType===1||(u.textContent||"").trim());n.toggleAttribute("data-caption",h)};l.addEventListener("slotchange",c),n.toggleAttribute("data-caption",[...this.childNodes].some(h=>h.nodeType===1&&!h.hasAttribute("slot")||h.nodeType===3&&(h.textContent||"").trim())),n.append(this.#_()),n.append(S("p",{part:"instructions",id:`${this.#h}-help`,hidden:""},this.#m("instructions"))),n.append(S("p",{part:"status",role:"status","aria-live":"polite"})),t.replaceChildren(...e?[e]:[],n),i||this.handleError("Missing or invalid lat/lng coordinates",this.#m("error-coords"))}#_(){let t=S("div",{part:"attribution"}),e=S("slot",{name:"attribution"}),i;if(this.tileUrl){let n=(this.getAttribute("attribution")||"").trim(),o=this.getAttribute("attribution-href")||"";i=n?[{text:n,href:o}]:[]}else i=(W[this.#w]??W.osm).credits;i.forEach((n,o)=>{o&&e.append(document.createTextNode(" "));let a="";if(n.href)try{let l=new URL(n.href,location.href);(l.protocol==="https:"||l.protocol==="http:")&&(a=l.href)}catch{}e.append(a?S("a",{href:a,target:"_blank",rel:"noopener noreferrer"},n.text):S("span",{},n.text))});let s=()=>{t.hidden=i.length===0&&e.assignedNodes().length===0};return e.addEventListener("slotchange",s),t.hidden=i.length===0&&!this.querySelector(':scope > [slot="attribution"]'),t.append(e),t}#M(){let t=this.shadowRoot;return{container:t.querySelector('[part="container"]'),viewport:t.querySelector('[part="viewport"]'),tiles:t.querySelector('[part="tiles"]'),marker:t.querySelector('[part="marker"]'),status:t.querySelector('[part="status"]')}}#B(){let t=this.clientWidth,e=this.clientHeight;if(this.#t){this.#t.resize(t,e);return}if(!this.#l||this.#C||!t||!e)return;let i=`${t}x${e}`;i!==this.#p&&(this.#p=i,this.loadTiles(t,e))}loadTiles(t=this.clientWidth,e=this.clientHeight){let{tiles:i}=this.#M();if(!i||!this.#l||!t||!e)return;let s=this.zoom,{lat:n,lng:o}=this.#l,a=nt(n,o,s),l=Math.pow(2,s),c=a.x-t/2,h=a.y-e/2,u=Math.floor(c/256),p=Math.floor((c+t-1)/256),d=Math.max(0,Math.floor(h/256)),f=Math.min(l-1,Math.floor((h+e-1)/256));i.style.transform=`translate(${Math.round(u*256-c)}px, ${Math.round(d*256-h)}px)`;let m=new Set;for(let b=d;b<=f;b++)for(let w=u;w<=p;w++){let k=`${w}/${b}`;m.add(k);let A=this.#u.get(k);if(!A){let T=(w%l+l)%l;A=document.createElement("img"),A.alt="",A.loading=this.loading==="eager"?"eager":"lazy",A.decoding="async",A.draggable=!1,A.addEventListener("load",()=>this.#D()),A.addEventListener("error",()=>this.#D()),A.src=Pt(this.#w,s,T,b,this.tileUrl),this.#u.set(k,A),i.append(A)}A.style.left=`${(w-u)*256}px`,A.style.top=`${(b-d)*256}px`}for(let[b,w]of this.#u)m.has(b)||(w.remove(),this.#u.delete(b));this.#D()}#D(){if(this.#c||this.#t||!this.#l||this.#u.size===0)return;let t=[...this.#u.values()];if(t.every(e=>e.complete)){if(this.#c=!0,t.every(e=>e.naturalWidth===0)){this.handleError("Failed to load map tiles",this.#m("error-tiles"));return}this.setAttribute("data-ready",""),this.dispatchEvent(new CustomEvent("geo-map:ready",{bubbles:!0,detail:{lat:this.#l.lat,lng:this.#l.lng,zoom:this.zoom}}))}}#F(){this.#r=!0,this._reinit(),this.#b&&this.#O({focus:!0})}#j(){if(this.#a)return;this.#a=!0;let t=this.#L();if(!t||t===location.origin||document.head.querySelector(`link[rel~="preconnect" i][href="${CSS.escape(t)}"]`))return;let e=document.createElement("link");e.rel="preconnect",e.href=t,document.head.appendChild(e)}#O({focus:t=!0}={}){if(this.#t)return Promise.resolve();if(this.#e)return this.#e;if(!this.#l||!this.#b||this.#C)return Promise.resolve();let e=this.#i,i=(async()=>{let{MapInteraction:s}=await Promise.resolve().then(()=>(hs(),cs));if(!this.isConnected||e!==this.#i||this.#t||!this.#l)return;let{container:n,viewport:o,tiles:a,marker:l}=this.#M();if(!n||!o||!a)return;for(let u of this.#u.values())u.remove();this.#u.clear(),n.setAttribute("data-active",""),o.setAttribute("role","region"),o.setAttribute("aria-roledescription","map"),o.setAttribute("aria-describedby",`${this.#h}-help`),o.setAttribute("tabindex","0"),this.setState("active",!0);let{lat:c,lng:h}=this.#l;this.#t=new s({host:this,viewport:o,tiles:a,marker:l,lat:c,lng:h,zoom:this.zoom,provider:this.#w,tileUrl:this.tileUrl,width:this.clientWidth,height:this.clientHeight,onDeactivate:()=>this.#R(),onMove:u=>this.#P(u)}),t&&o.focus({preventScroll:!0}),this.dispatchEvent(new CustomEvent("geo-map:activate",{bubbles:!0,detail:{lat:c,lng:h,zoom:this.zoom}}))})();return this.#e=i,i.finally(()=>{this.#e===i&&(this.#e=null)}),i}#P(t){clearTimeout(this.#y),this.#y=window.setTimeout(()=>{let{status:e}=this.#M();e&&(e.textContent=this.#m("moved",{lat:t.lat.toFixed(4),lng:t.lng.toFixed(4),zoom:t.zoom}))},400)}#R(){if(!this.#t)return;let t=!!this.shadowRoot?.activeElement;this.#n=!0,this._reinit(),t&&this.shadowRoot?.querySelector('[part="activate"]')?.focus()}handleError(t,e=t){let{container:i}=this.#M();i&&(i.setAttribute("data-state","error"),i.setAttribute("data-error",e)),this.dispatchEvent(new CustomEvent("geo-map:error",{bubbles:!0,detail:{message:t}}))}};g("geo-map",ye);var ds="popover"in HTMLElement.prototype;var bs=null;function Nn(){return bs??=Promise.resolve().then(()=>(ke(),we)),bs}var Pn=150,vs="vb-emoji-recent",ot=8,ys=4,$n=0,In={Trigger:"Open emoji picker",Dialog:"Emoji picker",Search:"Search emoji",Placeholder:"Search emoji\u2026",Categories:"Emoji categories",Emoji:"Emoji",Recent:"Recently used",Empty:"No emoji found",Results:"{count} emoji found"},Ae=class extends v{#t=null;#e;#i;#s;#r;#n;#a;#c;#h=new Map;#l=new WeakMap;#o=null;#u=!1;#p=!1;#d=!1;#f=!1;#k=-1;#v=0;#g=null;#y;#w=()=>{};#m=null;#b="";#C=null;#x=null;#L=new Set;#E=!1;#A=null;#T=null;constructor(){super(),this.#y=new Promise(t=>{this.#w=t})}get ready(){return this.#y}get isOpen(){return this.#u}setup(){if(this.#d)return!1;this.#d=!0,this.#I(),this.listen(this,"click",this.#rt),this.listen(this,"keydown",this.#nt),this.listen(this,"focusout",this.#st),this.listen(this,"focusin",this.#tt);let t=++this.#v;return Nn().then(e=>{if(t!==this.#v||!this.isConnected)return;this.#C=e,this.#p||this.#N(),this.listen(document,"click",this.#it),this.listen(document,e.EXTENDED_EVENT,this.#J),this.setAttribute("data-upgraded",""),this.#w(),queueMicrotask(()=>{this.dispatchEvent(new CustomEvent("emoji-picker:upgraded",{bubbles:!0}))});let i=this.#g;this.#g=null,i==="open"&&this.open()}).catch(e=>{console.error("[emoji-picker] failed to load emoji data",e)}),!1}teardown(){this.#v++,this.#d=!1,this.#g=null,this.#m&&(clearTimeout(this.#m),this.#m=null,this.setState("search-pending",!1)),this.#u&&this.close()}#S(t,e){return this.dataset[`label${t}`]||e||In[t]||""}#z(t){if(t==="recent")return this.#S("Recent");let e=t.charAt(0).toUpperCase()+t.slice(1);return this.#S(e,this.#C.EMOJI_GROUP_LABELS[t]||t)}#I(){let t=this.querySelector(":scope > [data-trigger]")||this.querySelector(":scope > button");t||(t=document.createElement("button"),t.type="button",t.textContent="\u{1F600}",t.setAttribute("data-trigger",""),this.prepend(t)),this.#t=t,t.setAttribute("aria-haspopup","dialog"),t.setAttribute("aria-expanded",String(this.#u)),!t.hasAttribute("aria-label")&&!/\p{L}/u.test(t.textContent||"")&&t.setAttribute("aria-label",this.#S("Trigger"))}#N(){let t=`emoji-picker-${++$n}`;this.#e=document.createElement("div"),this.#e.className="picker",this.#e.id=`${t}-panel`,this.#e.setAttribute("role","dialog"),this.#e.setAttribute("aria-label",this.#S("Dialog")),this.#e.hidden=!0,this.#E=ds,this.#E&&this.#e.setAttribute("popover","manual"),this.#t?.setAttribute("aria-controls",this.#e.id),this.#i=document.createElement("input"),this.#i.type="search",this.#i.placeholder=this.#S("Placeholder"),this.#i.autocomplete="off",this.#i.spellcheck=!1,this.#i.setAttribute("aria-label",this.#S("Search")),this.#i.setAttribute("aria-controls",`${t}-listbox`),this.#i.addEventListener("input",this.#X),this.#s=document.createElement("div"),this.#s.className="categories",this.#s.setAttribute("role","toolbar"),this.#s.setAttribute("aria-label",this.#S("Categories")),this.#C.EMOJI_GROUPS.forEach((e,i)=>{let s=document.createElement("button");s.type="button",s.dataset.group=e,s.tabIndex=i===0?0:-1,s.setAttribute("aria-label",this.#z(e)),s.title=this.#z(e),s.textContent=this.#C.EMOJI_GROUP_ICONS[e],this.#s.appendChild(s)}),this.#r=document.createElement("div"),this.#r.className="grid",this.#r.id=`${t}-listbox`,this.#r.setAttribute("role","listbox"),this.#r.setAttribute("aria-label",this.#S("Emoji")),this.#c=this.#$("recent"),this.#r.appendChild(this.#c);for(let e of this.#C.EMOJI_GROUPS){let i=this.#$(e);this.#h.set(e,i),this.#r.appendChild(i)}this.#n=document.createElement("p"),this.#n.className="no-results",this.#n.textContent=this.#S("Empty"),this.#n.hidden=!0,this.#a=document.createElement("p"),this.#a.className="status",this.#a.setAttribute("role","status"),this.#e.append(this.#i,this.#s,this.#r,this.#n,this.#a),this.appendChild(this.#e),this.#B(),this.#p=!0}#$(t){let e=document.createElement("div");return e.className="group",e.dataset.group=t,e.setAttribute("role","group"),e.setAttribute("aria-label",this.#z(t)),e}#_(t){let e=document.createElement("span");return e.className="group-label",e.setAttribute("aria-hidden","true"),e.textContent=this.#z(t),e}#M(t){let e=document.createElement("button");return e.type="button",e.setAttribute("role","option"),e.setAttribute("aria-selected","false"),e.tabIndex=-1,e.dataset.shortcode=t.shortcode,e.setAttribute("aria-label",t.name),e.title=`:${t.shortcode}:`,e.textContent=t.emoji,e}#B(){let t=new Map;for(let e of this.#C.EMOJI_GROUPS){let i=this.#h.get(e),s=[this.#_(e)];for(let n of this.#C.getByGroup(e)){let o=t.get(n.emoji);if(o){o.aliases.push(n.shortcode);continue}let a=this.#M(n),l={entry:n,aliases:[]};t.set(n.emoji,l),this.#l.set(a,l),s.push(a)}i.replaceChildren(...s)}this.#k=this.#C.extendedCount(),this.#R(null,!1)}#D(){let t=[];for(let e of this.#ct()){let i=this.#C.resolveEmoji(e);if(!i)continue;let s=this.#M(i);this.#l.set(s,{entry:i,aliases:[]}),t.push(s)}t.length&&t.unshift(this.#_("recent")),this.#c.replaceChildren(...t),this.#R(null,!1)}#F(t,e){let{entry:i,aliases:s}=t;return i.shortcode.includes(e)||i.name.toLowerCase().includes(e)||(i.keywords?.some(n=>n.includes(e))??!1)||s.some(n=>n.includes(e))}#j(){let t=this.#b.toLowerCase(),e=0;this.#c.hidden=!!t||this.#c.childElementCount===0;for(let i of this.#h.values()){let s=!1;for(let n of i.querySelectorAll('[role="option"]')){let o=this.#l.get(n),a=!t||(o?this.#F(o,t):!1);n.hidden=!a,a&&(s=!0,e++)}i.hidden=!s}this.#n.hidden=e>0,this.#a.textContent=t?e>0?this.#S("Results").replace("{count}",String(e)):this.#S("Empty"):"",(!this.#o||!this.#O(this.#o))&&this.#R(this.#P()[0]??null,!1)}#O(t){return t.isConnected&&!t.hidden&&!t.parentElement.hidden}#P(){return[...this.#r.querySelectorAll('[role="option"]')].filter(t=>this.#O(t))}#R(t,e){this.#o&&this.#o!==t&&(this.#o.tabIndex=-1,this.#o.setAttribute("aria-selected","false")),this.#o=t,t&&(t.tabIndex=0,t.setAttribute("aria-selected","true"),e&&(t.focus({preventScroll:!0}),t.scrollIntoView({block:"nearest"})))}#G(t,e){if(t){for(let i of this.#s.querySelectorAll("button"))i.tabIndex=i===t?0:-1;e&&t.focus()}}#q(t){let e;for(let i of this.#s.querySelectorAll("button"))i.dataset.group===t?(i.setAttribute("aria-current","true"),e=i):i.removeAttribute("aria-current");e&&!this.#s.contains(document.activeElement)&&this.#G(e,!1)}#K(){if(this.#x?.disconnect(),this.#L.clear(),!(typeof IntersectionObserver>"u")){this.#x=new IntersectionObserver(t=>{for(let i of t)i.isIntersecting?this.#L.add(i.target):this.#L.delete(i.target);let e=[...this.#r.children].find(i=>this.#L.has(i));this.#q(e?.dataset.group)},{root:this.#r,rootMargin:"-2px 0px -75% 0px"});for(let t of this.#r.children)this.#x.observe(t)}}#H(){return getComputedStyle(this).direction==="rtl"}#U(t,e,i){let s=t[e].getBoundingClientRect(),n=s.left+s.width/2,o=null,a=null,l=1/0;for(let c=e+i;c>=0&&c<t.length;c+=i){let h=t[c].getBoundingClientRect();if(o===null){if(Math.abs(h.top-s.top)<=ys)continue;o=h.top}else if(Math.abs(h.top-o)>ys)break;let u=Math.abs(h.left+h.width/2-n);u<l&&(l=u,a=t[c])}return a}#W(t,e){let i=this.#P(),s=i.indexOf(t);if(s<0)return!1;let n=this.#H(),o=null;switch(e){case"ArrowRight":o=i[n?s-1:s+1];break;case"ArrowLeft":o=i[n?s+1:s-1];break;case"ArrowDown":o=this.#U(i,s,1);break;case"ArrowUp":if(o=this.#U(i,s,-1),!o)return this.#i.focus(),!0;break;case"Home":o=i[0];break;case"End":o=i[i.length-1];break;case"PageDown":{o=i.slice(s+1).find(l=>l.parentElement!==t.parentElement)??i[i.length-1];break}case"PageUp":{let a=i.find(l=>l.parentElement===t.parentElement);if(a&&a!==t)o=a;else{let l=i[s-1]?.parentElement;o=l?i.find(c=>c.parentElement===l):i[0]}break}default:return!1}return o&&this.#R(o,!0),!0}#Z(t,e){let i=[...this.#s.querySelectorAll("button")],s=i.indexOf(t),n=this.#H(),o=-1;if(e==="ArrowRight")o=n?s-1:s+1;else if(e==="ArrowLeft")o=n?s+1:s-1;else if(e==="Home")o=0;else if(e==="End")o=i.length-1;else return!1;return o=(o+i.length)%i.length,this.#G(i[o],!0),!0}#et(){let t=this.getAttribute("for");return t?document.getElementById(t):null}#Q(){let t=this.#et();if(this.#A=null,this.#T=null,!!t){if(t instanceof HTMLInputElement||t instanceof HTMLTextAreaElement){let e=null,i=null;try{e=t.selectionStart,i=t.selectionEnd}catch{}e!==null&&i!==null&&(this.#A={start:e,end:i})}else if(t.isContentEditable){let e=window.getSelection();if(e&&e.rangeCount>0){let i=e.getRangeAt(0);t.contains(i.commonAncestorContainer)&&(this.#T=i.cloneRange())}}}}#rt=t=>{let e=t.target.closest?.("button");if(!(!e||!this.contains(e))){if(e===this.#t){this.toggle();return}this.#p&&(e.parentElement===this.#s?this.#Y(e):e.getAttribute("role")==="option"&&this.#V(e))}};#it=t=>{this.#u&&!this.contains(t.target)&&this.close()};#st=t=>{if(!this.#u||this.#f)return;let e=t.relatedTarget;e&&!this.contains(e)&&this.close()};#tt=t=>{let e=t.target;e.getAttribute?.("role")==="option"&&e!==this.#o&&this.#R(e,!1)};#nt=t=>{if(!this.#u)return;if(t.key==="Escape"){t.preventDefault(),t.stopPropagation(),this.close(),this.#t?.focus();return}let e=t.target;if(t.altKey||t.metaKey)return;let i=!1;if(e===this.#i){if(t.key==="ArrowDown"){let s=this.#o&&this.#O(this.#o)?this.#o:this.#P()[0];s&&this.#R(s,!0),i=!0}}else e.parentElement===this.#s?i=this.#Z(e,t.key):e.getAttribute("role")==="option"&&(i=this.#W(e,t.key));i&&t.preventDefault()};#X=()=>{this.#m&&clearTimeout(this.#m),this.setState("search-pending",!0),this.#m=setTimeout(()=>{this.#m=null,this.setState("search-pending",!1),this.#b=this.#i.value.trim(),this.#j(),this.#r.scrollTop=0},Pn)};#J=()=>{this.#u&&(this.#B(),this.#j(),this.#K())};#Y(t){let e=t.dataset.group||"";this.#b&&(this.#m&&(clearTimeout(this.#m),this.#m=null),this.setState("search-pending",!1),this.#i.value="",this.#b="",this.#j()),this.#G(t,!1),this.#q(e);let i=this.#h.get(e);if(!i)return;let s=matchMedia("(prefers-reduced-motion: reduce)").matches;this.#r.scrollTo({top:i.offsetTop,behavior:s?"auto":"smooth"});let n=i.querySelector('[role="option"]:not([hidden])');n&&this.#R(n,!1)}#V(t){let e=this.#l.get(t);if(!e)return;let{entry:i}=e;this.#R(t,!1),this.#f=!0;try{this.#ut(i.shortcode);let s=this.#at(i.emoji);this.dispatchEvent(new CustomEvent("emoji-picker:select",{bubbles:!0,detail:{shortcode:i.shortcode,emoji:i.emoji,name:i.name,keywords:i.keywords}})),this.close(),s||this.#t?.focus()}finally{this.#f=!1}}#at(t){let e=this.#et();if(!e)return!1;if(e instanceof HTMLInputElement||e instanceof HTMLTextAreaElement){e.focus();let i=this.#A;if(i)try{e.setSelectionRange(i.start,i.end)}catch{}if(!this.#lt(t)){let s=e.value.length;try{e.setRangeText(t,i?.start??s,i?.end??s,"end")}catch{e.value+=t}e.dispatchEvent(new InputEvent("input",{bubbles:!0,inputType:"insertText",data:t}))}try{let s=e.selectionEnd;this.#A=s===null?null:{start:s,end:s}}catch{this.#A=null}return!0}if(e.isContentEditable){e.focus();let i=window.getSelection();if(!i)return!0;let s=this.#T;if((!s||!e.contains(s.commonAncestorContainer))&&(s=document.createRange(),s.selectNodeContents(e),s.collapse(!1)),i.removeAllRanges(),i.addRange(s),!this.#lt(t)){let n=i.getRangeAt(0);n.deleteContents();let o=document.createTextNode(t);n.insertNode(o),n.setStartAfter(o),n.collapse(!0),i.removeAllRanges(),i.addRange(n),e.dispatchEvent(new InputEvent("input",{bubbles:!0,inputType:"insertText",data:t}))}return this.#T=i.rangeCount?i.getRangeAt(0).cloneRange():null,!0}return!1}#lt(t){try{return document.execCommand("insertText",!1,t)}catch{return!1}}#ct(){try{let t=JSON.parse(localStorage.getItem(vs)||"[]");return Array.isArray(t)?t:[]}catch{return[]}}#ut(t){let e=parseInt(this.getAttribute("recent-limit")??"24",10)||24,i=this.#ct();i=i.filter(s=>s!==t),i.unshift(t),i.length>e&&(i.length=e);try{localStorage.setItem(vs,JSON.stringify(i))}catch{}}#ht(){if(!this.#E||!this.#u||!this.#t)return;let t=this.#t.getBoundingClientRect(),e=this.#e.offsetWidth,i=this.#e.offsetHeight,s=document.documentElement.clientWidth,n=document.documentElement.clientHeight,o=this.#H()?t.right-e:t.left;o=Math.max(ot,Math.min(o,s-e-ot));let a=t.bottom+4;a+i>n-ot&&t.top-i-4>=ot&&(a=t.top-i-4),a=Math.max(ot,Math.min(a,n-i-ot)),this.#e.style.setProperty("--picker-top",`${Math.round(a)}px`),this.#e.style.setProperty("--picker-left",`${Math.round(o)}px`)}#ot=t=>{t.type==="scroll"&&this.#e.contains(t.target)||this.#ht()};open(){if(!this.#p){this.#g="open";return}if(!(this.#u||!this.isConnected)){if(this.#Q(),this.#C.extendedCount()!==this.#k&&this.#B(),this.#D(),this.#i.value="",this.#b="",this.#j(),this.#u=!0,this.setAttribute("open",""),this.#t?.setAttribute("aria-expanded","true"),this.#e.hidden=!1,this.#E){try{this.#e.showPopover()}catch{}this.#ht(),window.addEventListener("scroll",this.#ot,{capture:!0,passive:!0}),window.addEventListener("resize",this.#ot,{passive:!0})}this.#r.scrollTop=0,this.#K(),this.#i.focus(),this.dispatchEvent(new CustomEvent("emoji-picker:open",{bubbles:!0}))}}close(){if(!this.#p){this.#g=null;return}if(this.#u){if(this.#u=!1,this.removeAttribute("open"),this.#t?.setAttribute("aria-expanded","false"),this.#E){try{this.#e.hidePopover()}catch{}window.removeEventListener("scroll",this.#ot,{capture:!0}),window.removeEventListener("resize",this.#ot)}this.#e.hidden=!0,this.#x?.disconnect(),this.#x=null,this.dispatchEvent(new CustomEvent("emoji-picker:close",{bubbles:!0}))}}toggle(){if(!this.#p){this.#g=this.#g==="open"?null:"open";return}this.#u?this.close():this.open()}};g("emoji-picker",Ae);var at="data-drag-surface-controls",zn="data-drag-surface-live",F="data-drag-surface-description",Bn="Press Space or Enter to grab, then use the arrow keys to move",xe=class r extends v{static observedAttributes=["disabled","data-move-controls","orientation","group","aria-label","data-label-instructions"];#t=null;#e=null;#i=null;#s=null;#r=null;setup(){this.setAttribute("role","list"),r.#U.add(this),this.#l(),this.#u(),this.#w(),this.listen(this,"click",this.#I.bind(this)),this.#n(),this.#h(),this.#r=new MutationObserver(()=>this.#c()),this.#r.observe(this,{childList:!0}),r.#T()}teardown(){this.#r?.disconnect(),this.#r=null,this.#t&&(this.#t.remove(),this.#t=null),this.#e&&this.#A(this.#e,!1),this.#e=null,this.#i=null,this.removeAttribute("data-reorder-mode"),this.removeAttribute("data-drag-over"),this.#H(),this.#S();for(let t of this.querySelectorAll(`:scope > [${F}]`))t.removeAttribute("aria-description"),t.removeAttribute(F);r.#U.delete(this),r.#W?.source===this&&(r.#W=null),r.#T()}attributeChangedCallback(t,e,i){e===i||!this.hasAttribute("data-upgraded")||(t==="disabled"&&this.#h(),this.#n(),r.#T())}get draggableChildren(){return[...this.querySelectorAll(':scope > [draggable="true"]')]}get group(){return this.getAttribute("group")||null}get orientation(){return this.getAttribute("orientation")==="horizontal"?"horizontal":"vertical"}get disabled(){return this.hasAttribute("disabled")}set disabled(t){this.toggleAttribute("disabled",!!t)}get sortedOrder(){return this.draggableChildren.map(t=>t.dataset.id)}#n(){for(let t of this.draggableChildren)t.getAttribute("role")||t.setAttribute("role","listitem"),t.hasAttribute("tabindex")||t.setAttribute("tabindex","0"),t!==this.#e&&this.#a(t)}#a(t){let e=t.hasAttribute(F);if(!e&&(t.hasAttribute("aria-description")||t.hasAttribute("aria-describedby")))return;if(this.disabled){e&&(t.removeAttribute("aria-description"),t.removeAttribute(F));return}let i=this.dataset.labelInstructions||Bn;t.getAttribute("aria-description")!==i&&t.setAttribute("aria-description",i),e||t.setAttribute(F,"")}#c(){this.#n(),this.#e&&this.#e.parentElement!==this&&(this.#A(this.#e,!1),this.#e=null,this.#i=null,this.removeAttribute("data-reorder-mode")),r.#T()}#h(){this.disabled?(this.setAttribute("aria-disabled","true"),this.#e&&this.#E()):this.removeAttribute("aria-disabled")}#l(){let t=document.createElement("span");t.setAttribute(zn,""),t.setAttribute("role","status"),t.setAttribute("aria-live","polite"),t.setAttribute("aria-atomic","true"),this.after(t),this.#t=t}#o(t){let e=this.#t;e&&(e.textContent="",requestAnimationFrame(()=>{e.textContent=t}))}#u(){this.listen(this,"pointerdown",t=>{this.#s=t.target}),this.listen(this,"dragstart",this.#p.bind(this)),this.listen(this,"dragover",this.#f.bind(this)),this.listen(this,"dragleave",this.#k.bind(this)),this.listen(this,"drop",this.#v.bind(this)),this.listen(this,"dragend",this.#g.bind(this))}#p(t){let e=t.target.closest('[draggable="true"]');if(!e||e.parentElement!==this)return;if(this.disabled){t.preventDefault();return}let i=e.querySelector("[data-drag-handle]");if(i&&!i.contains(this.#s)){t.preventDefault();return}e.setAttribute("data-dragging",""),t.dataTransfer.effectAllowed="move",t.dataTransfer.setData("text/plain",e.dataset.id||""),t.dataTransfer.setData("application/x-drag-surface-group",this.group||"");let s=this.#O(e);r.#W={item:e,source:this,originalIndex:s},this.dispatchEvent(new CustomEvent("drag-surface:reorder-start",{bubbles:!0}))}#d(t){return this.disabled?!1:this.group||t.group?this.group===t.group:t===this}#f(t){let e=r.#W;!e||!this.#d(e.source)||(t.preventDefault(),t.dataTransfer.dropEffect="move",this.setAttribute("data-drag-over",""),this.#K(t.clientX,t.clientY))}#k(t){t.relatedTarget&&!this.contains(t.relatedTarget)&&(this.removeAttribute("data-drag-over"),this.#H())}#v(t){let e=r.#W;if(!e||!this.#d(e.source))return;t.preventDefault();let{item:i,source:s,originalIndex:n}=e,o=this.#q(t.clientX,t.clientY);r.#y(),s===this?(this.#P(i,o),this.#R(),this.#M(i),this.#$(i,n)):(this.#P(i,o),this.#R(),s.#R(),this.#M(i),this.#_(i,s))}#g(){let t=r.#W;r.#y(),r.#W=null,(t?.source??this).dispatchEvent(new CustomEvent("drag-surface:reorder-end",{bubbles:!0}))}static#y(){r.#W?.item.removeAttribute("data-dragging");for(let t of r.#U)t.removeAttribute("data-drag-over"),t.#H()}#w(){this.listen(this,"keydown",this.#b.bind(this)),this.listen(this,"focusout",this.#C.bind(this))}#m(t){let e=t.closest('[draggable="true"]');if(!e||e.parentElement!==this)return null;if(t===e)return e;let i=e.querySelector("[data-drag-handle]");return i&&i===t?e:null}#b(t){let e=this.#m(t.target);if(!e||this.disabled||t.altKey||t.ctrlKey||t.metaKey)return;let i=t.target,s=this.#e===e,n=this.orientation==="horizontal",o=this.#D(),a=n?o?"ArrowRight":"ArrowLeft":"ArrowUp",l=n?o?"ArrowLeft":"ArrowRight":"ArrowDown";if(t.key===" "||t.key==="Enter"){t.preventDefault(),s?this.#L(e):this.#x(e);return}if(t.key===a||t.key===l){t.preventDefault();let u=this.draggableChildren,p=u.indexOf(e),d=t.key===a?Math.max(0,p-1):Math.min(u.length-1,p+1);if(d===p)return;if(!s){u[d].focus();return}this.#P(e,d),i.focus(),this.#o(`Position ${d+1} of ${u.length}`);return}let c=n?"ArrowUp":"ArrowLeft",h=n?"ArrowDown":"ArrowRight";if(s&&(t.key===c||t.key===h)){t.preventDefault();let u=this.#B(t.key===h?1:-1);if(!u)return;this.#e=null,this.#i=null,this.removeAttribute("data-reorder-mode"),this.#N(u,e),i.focus(),u.#e=e,u.#i=u.#O(e),u.setAttribute("data-reorder-mode",""),u.#o(`Moved to ${u.#F()}`);return}t.key==="Escape"&&(t.preventDefault(),s?this.#E():e.blur())}#C(){setTimeout(()=>{let t=this.#e;t&&!t.contains(document.activeElement)&&this.#E()},0)}#x(t){this.#e&&this.#e!==t&&this.#E(),this.#i=this.#O(t),this.#e=t,this.#A(t,!0),this.setAttribute("data-reorder-mode","");let e=this.draggableChildren.length;this.#o(`${this.#j(t)}, grabbed. Position ${this.#i+1} of ${e}. Use arrow keys to move, Enter to drop, Escape to cancel.`),this.dispatchEvent(new CustomEvent("drag-surface:reorder-start",{bubbles:!0}))}#L(t){let e=this.#i;this.#e=null,this.#i=null,this.#A(t,!1),this.removeAttribute("data-reorder-mode"),this.#R(),this.#M(t);let i=this.#O(t);this.#o(`${this.#j(t)}, dropped at position ${i+1} of ${this.draggableChildren.length}`),this.#$(t,e),this.dispatchEvent(new CustomEvent("drag-surface:reorder-end",{bubbles:!0}))}#E(){let t=this.#e;if(!t)return;let e=this.#i;if(this.#e=null,this.#i=null,this.#A(t,!1),this.removeAttribute("data-reorder-mode"),e!=null&&t.parentElement===this&&this.#O(t)!==e){let i=t.contains(document.activeElement)?document.activeElement:null;this.#P(t,e),i?.focus()}this.#o("Reorder cancelled"),this.dispatchEvent(new CustomEvent("drag-surface:reorder-end",{bubbles:!0}))}#A(t,e){t.toggleAttribute("data-grabbed",e);let i=t.querySelector("[data-drag-handle]");if(i&&(i.localName==="button"||i.getAttribute("role")==="button")&&i.setAttribute("aria-pressed",String(e)),e)(t.hasAttribute(F)||!(t.hasAttribute("aria-description")||t.hasAttribute("aria-describedby")))&&(t.setAttribute("aria-description","Grabbed"),t.setAttribute(F,""));else{let s=t.parentElement;s instanceof r?s.#a(t):t.hasAttribute(F)&&(t.removeAttribute("aria-description"),t.removeAttribute(F))}}static#T(){for(let t of r.#U)t.#z()}#S(){for(let t of this.querySelectorAll(`:scope > [draggable="true"] > [${at}]`))t.remove()}#z(){if(!this.isConnected)return;if(!this.hasAttribute("data-move-controls")){this.#S();return}let t=this.draggableChildren,e=this.orientation==="horizontal",i=this.#D(),s=this.disabled,n=this.#B(-1),o=this.#B(1),a=e?i?"right":"left":"up",l=e?i?"left":"right":"down",c={up:"\u2191",down:"\u2193",left:"\u2190",right:"\u2192"},h=e?c.up:c.left,u=e?c.down:c.right;t.forEach((p,d)=>{let f=p.querySelector(`:scope > [${at}]`);if(!f){f=document.createElement("span"),f.setAttribute(at,"");for(let w of["prev","next","to-prev","to-next"]){let k=document.createElement("button");k.type="button",k.className="ghost small",k.dataset.move=w,f.append(k)}p.append(f)}let m=this.#j(p),b=(w,k,A,T,O=!1)=>{let _=f.querySelector(`[data-move="${w}"]`);_.textContent!==k&&(_.textContent=k),_.setAttribute("aria-label",A),_.setAttribute("aria-disabled",String(T)),_.hidden=O};b("prev",c[a],`Move ${m} ${a}`,s||d===0),b("next",c[l],`Move ${m} ${l}`,s||d===t.length-1),b("to-prev",h,n?`Move ${m} to ${n.#F()}`:"",s,!n),b("to-next",u,o?`Move ${m} to ${o.#F()}`:"",s,!o)})}#I(t){let e=t.target.closest(`[${at}] > button[data-move]`);if(!e)return;let i=e.closest('[draggable="true"]');if(!i||i.parentElement!==this||(t.preventDefault(),this.disabled||e.getAttribute("aria-disabled")==="true"))return;this.#e&&(this.#A(this.#e,!1),this.#e=null,this.#i=null,this.removeAttribute("data-reorder-mode"));let s=e.dataset.move,n=this;if(s==="prev"||s==="next"){let a=this.#O(i),l=a+(s==="prev"?-1:1);if(l<0||l>=this.draggableChildren.length)return;this.#P(i,l),this.#R(),this.#M(i),this.#o(`${this.#j(i)}, moved to position ${l+1} of ${this.draggableChildren.length}`),this.#$(i,a)}else{let a=this.#B(s==="to-next"?1:-1);if(!a)return;this.#N(a,i),a.#o(`${a.#j(i)}, moved to ${a.#F()}`),n=a}r.#T();let o=i.querySelector(`[${at}] > [data-move="${s}"]`);o&&!o.hidden?o.focus():n.isConnected&&i.focus()}#N(t,e){t.appendChild(e),t.#R(),this.#R(),t.#M(e),t.#_(e,this)}#$(t,e){this.dispatchEvent(new CustomEvent("drag-surface:reorder",{bubbles:!0,detail:{item:t,itemId:t.dataset.id,oldIndex:e,newIndex:this.#O(t),order:this.sortedOrder}}))}#_(t,e){this.dispatchEvent(new CustomEvent("drag-surface:transfer",{bubbles:!0,detail:{item:t,itemId:t.dataset.id,fromSurface:e,toSurface:this,newIndex:this.#O(t),fromOrder:e.sortedOrder,toOrder:this.sortedOrder}}))}#M(t){t.setAttribute("data-just-dropped",""),t.addEventListener("animationend",()=>{t.removeAttribute("data-just-dropped")},{once:!0}),setTimeout(()=>t.removeAttribute("data-just-dropped"),500)}#B(t){if(!this.group)return null;let e=[...r.#U].filter(n=>n===this||n.group===this.group&&n.isConnected&&!n.disabled);if(e.length<2)return null;let i=this.orientation==="horizontal",s=new Map(e.map(n=>[n,n.getBoundingClientRect()]));return e.sort((n,o)=>{let a=s.get(n),l=s.get(o);return i?a.top-l.top||a.left-l.left:a.left-l.left||a.top-l.top}),e[e.indexOf(this)+t]||null}#D(){return getComputedStyle(this).direction==="rtl"}#F(){let t=this.getAttribute("aria-label");if(t)return t;let e=this.getAttribute("aria-labelledby");if(e){let i=e.split(/\s+/).map(s=>document.getElementById(s)?.textContent.trim()).filter(Boolean).join(" ");if(i)return i}return"another list"}#j(t){let e=t.getAttribute("aria-label");if(e)return e;let i=t.cloneNode(!0);for(let n of i.querySelectorAll(`[${at}], [aria-hidden="true"], [data-drag-handle]:not(:has(*))`))n.remove();return i.textContent.replace(/\s+/g," ").trim().slice(0,40)||t.dataset.id||"Item"}#O(t){return this.draggableChildren.indexOf(t)}#P(t,e){let s=this.draggableChildren.filter(n=>n!==t)[e]||null;s?this.insertBefore(t,s):this.appendChild(t)}#R(){this.draggableChildren.forEach((t,e)=>{t.dataset.sortOrder=String(e+1)})}#G(t,e){let i=this.orientation==="horizontal",s=i&&this.#D(),n=this.draggableChildren.filter(o=>!o.hasAttribute("data-dragging"));for(let o=0;o<n.length;o++){let a=n[o].getBoundingClientRect(),l;if(i?s?l=t>a.left+a.width/2:l=t<a.left+a.width/2:l=e<a.top+a.height/2,l)return{index:o,children:n}}return{index:n.length,children:n}}#q(t,e){return this.#G(t,e).index}#K(t,e){this.#H();let{index:i,children:s}=this.#G(t,e);i<s.length?s[i].setAttribute("data-drop-target","before"):s.length>0&&s[s.length-1].setAttribute("data-drop-target","after")}#H(){for(let t of this.querySelectorAll("[data-drop-target]"))t.removeAttribute("data-drop-target")}static#U=new Set;static#W=null};g("drag-surface",xe);var q=/Mac|iPhone|iPad|iPod/.test(navigator.platform??""),ws={mac:{meta:"\u2318",cmd:"\u2318",alt:"\u2325",option:"\u2325",shift:"\u21E7",ctrl:"\u2303",control:"\u2303"},other:{meta:"Ctrl",cmd:"Ctrl",alt:"Alt",option:"Alt",shift:"Shift",ctrl:"Ctrl",control:"Ctrl"}},ks={mac:{meta:"Command",cmd:"Command",alt:"Option",option:"Option",shift:"Shift",ctrl:"Control",control:"Control"},other:{meta:"Control",cmd:"Control",alt:"Alt",option:"Alt",shift:"Shift",ctrl:"Control",control:"Control"}},On={escape:{label:"Esc",spoken:"Escape"},esc:{label:"Esc",spoken:"Escape"},enter:{label:"Enter",spoken:"Enter"},return:{label:"Enter",spoken:"Enter"},tab:{label:"Tab",spoken:"Tab"},space:{label:"Space",spoken:"Space"},backspace:{label:"Backspace",spoken:"Backspace"},delete:{label:"Del",spoken:"Delete"},del:{label:"Del",spoken:"Delete"},insert:{label:"Ins",spoken:"Insert"},home:{label:"Home",spoken:"Home"},end:{label:"End",spoken:"End"},pageup:{label:"PgUp",spoken:"Page up"},pagedown:{label:"PgDn",spoken:"Page down"},arrowup:{label:"\u2191",spoken:"Up arrow"},up:{label:"\u2191",spoken:"Up arrow"},arrowdown:{label:"\u2193",spoken:"Down arrow"},down:{label:"\u2193",spoken:"Down arrow"},arrowleft:{label:"\u2190",spoken:"Left arrow"},left:{label:"\u2190",spoken:"Left arrow"},arrowright:{label:"\u2192",spoken:"Right arrow"},right:{label:"\u2192",spoken:"Right arrow"},"+":{label:"+",spoken:"Plus"},plus:{label:"+",spoken:"Plus"}};function zt(r){return[...String(r??"").trim().toLowerCase().matchAll(/([^+]+|\+)(?:\+|$)/g)].map(e=>e[1].trim()).filter(Boolean).map(e=>e==="plus"?"+":e)}function Ee(r,t=q){let e=t?ws.mac:ws.other;if(r in e)return{label:e[r],spoken:(t?ks.mac:ks.other)[r],modifier:!0};let i=On[r];if(i)return{...i,modifier:!1};let s=r.toUpperCase();return{label:s,spoken:s,modifier:!1}}function Bt(r){return zt(r).map(t=>Ee(t).label).join(q?"":"+")}var jn={esc:"escape",return:"enter",del:"delete",ins:"insert",up:"arrowup",down:"arrowdown",left:"arrowleft",right:"arrowright",space:" ",spacebar:" ",plus:"+",pgup:"pageup",pgdn:"pagedown"};function Dn(r){let t=String(r??"").toLowerCase();return jn[t]??t}function yt(r){let t=zt(r);return{key:Dn(t.pop()??""),meta:t.includes("meta")||t.includes("cmd"),ctrl:t.includes("ctrl")||t.includes("control"),shift:t.includes("shift"),alt:t.includes("alt")||t.includes("option")}}function As(r){return r.length===1&&!/[a-z0-9 ]/.test(r)}function xs(r,t){let i=(r.key==="Spacebar"?" ":String(r.key??"").toLowerCase())===t.key;if(!i&&(r.altKey||r.shiftKey)&&/^[a-z0-9]$/.test(t.key)){let o=/\d/.test(t.key)?`Digit${t.key}`:`Key${t.key.toUpperCase()}`;i=r.code===o}if(!i)return!1;let s,n;return q?(s=t.meta,n=t.ctrl):(s=!1,n=t.meta||t.ctrl),!(s!==r.metaKey||n!==r.ctrlKey||!As(t.key)&&t.shift!==r.shiftKey||t.alt!==r.altKey)}function Ot(r){let t=typeof r=="string"?yt(r):r;return!t.meta&&!t.ctrl&&!t.alt&&t.key.length===1}function Es(r,t){let e=yt(r),i=yt(t),s=q?e.ctrl:e.ctrl||e.meta,n=q?i.ctrl:i.ctrl||i.meta,o=q&&e.meta,a=q&&i.meta,l=!As(e.key);return e.key===i.key&&s===n&&o===a&&e.alt===i.alt&&(!l||e.shift===i.shift)}var Se="data-char-shortcuts",Ss="vb:char-shortcuts-change",Fn="vb:settings:extensions";function wt(){return typeof document>"u"?!0:document.documentElement.getAttribute(Se)!=="off"}function qn(){try{let r=globalThis.localStorage?.getItem(Fn);if(!r)return null;let t=JSON.parse(r)?.data?.charShortcuts;return typeof t=="boolean"?t:null}catch{return null}}var Hn=!0;if(typeof document<"u"){let r=qn();r===null&&(Hn=wt()),r===!1?document.documentElement.setAttribute(Se,"off"):r===!0&&document.documentElement.removeAttribute(Se)}var Un=new Set(["INPUT","TEXTAREA","SELECT"]),kt=[],Cs=!1;function Vn(r){let t=r;return!t||!t.tagName?!1:Un.has(t.tagName)||t.isContentEditable}function Wn(r){if(r.repeat||r.isComposing||r.defaultPrevented)return;let t=Vn(r.target),e=!wt(),i=document.activeElement;for(let s of kt)if(!(t&&!s.global)&&!(s.scope&&!(s.scope.isConnected&&s.scope.contains(i)))&&!(e&&s.character&&!s.scope)&&!(s.enabled&&!s.enabled())&&xs(r,s.descriptor)){r.preventDefault(),s.callback(r);return}}function Gn(){Cs||(document.addEventListener("keydown",Wn),Cs=!0)}function Y(r,t,e={}){Gn();let i=yt(r),s={combo:r,descriptor:i,callback:t,global:e.global===!0,scope:e.scope??null,enabled:typeof e.enabled=="function"?e.enabled:null,character:Ot(i)},n=kt.find(o=>!o.scope&&!s.scope&&Es(o.combo,r));return n&&console.warn(`[hotkey-bind] Shortcut "${r}" is already bound as "${n.combo}". Last-bound wins.`),kt.unshift(s),function(){let a=kt.indexOf(s);a!==-1&&kt.splice(a,1)}}var Kn=0,Ce=class extends v{#t=null;#e;#i;#s=[];#r=-1;#n=[];#a=[];#c=[];#h="";#l=0;setup(){this.#h=`cmdp-${++Kn}`,this.#l=0,this.#o(),this.#p(),this.hasAttribute("discover")&&this.#y()}teardown(){this.#a.forEach(t=>t()),this.#a=[],this.#t?.remove(),this.#t=null,this.#s=[],this.#n=[],this.#c=[],this.#r=-1}get commands(){let t=[];for(let e of this.querySelectorAll("command-group")){let i=e.getAttribute("label")||"";for(let s of e.querySelectorAll("command-item"))t.push({value:s.getAttribute("value")||"",label:s.textContent.trim(),hotkey:s.getAttribute("data-hotkey")||void 0,group:i||void 0})}return t}set commands(t){let e=Array.isArray(t)?t:[],i=new Map;for(let s of e){let n=s.group||"";i.has(n)||i.set(n,[]),i.get(n).push(s)}for(let s of[...this.children])(s.tagName==="COMMAND-GROUP"||s.tagName==="COMMAND-ITEM")&&s.remove();for(let[s,n]of i){let o=document.createElement("command-group");s&&o.setAttribute("label",s);for(let a of n){let l=document.createElement("command-item");if(a.value&&l.setAttribute("value",a.value),a.hotkey&&l.setAttribute("data-hotkey",a.hotkey),a.icon){let c=document.createElement("span");c.setAttribute("slot","icon"),c.innerHTML=a.icon,l.appendChild(c)}l.appendChild(document.createTextNode(a.label||a.value||"")),o.appendChild(l)}this.appendChild(o)}this._reinit(),this.dispatchEvent(new CustomEvent("command-palette:commands-changed",{detail:{commands:e,source:"property"},bubbles:!0}))}#o(){this.#t=document.createElement("dialog"),this.#t.className="command-dialog",this.#t.setAttribute("aria-label",this.getAttribute("label")||"Command palette"),this.#t.addEventListener("click",i=>{i.target===this.#t&&this.close()}),this.#t.addEventListener("close",()=>{this.#e?.setAttribute("aria-expanded","false"),this.#e?.removeAttribute("aria-activedescendant"),this.dispatchEvent(new CustomEvent("command-palette:close",{bubbles:!0}))});let t=document.createElement("div");t.className="command-search",this.#i=document.createElement("div"),this.#i.className="command-list",this.#i.id=`${this.#h}-list`,this.#i.setAttribute("role","listbox"),this.#i.setAttribute("aria-label","Commands"),this.#e=document.createElement("input"),this.#e.type="search",this.#e.placeholder=this.getAttribute("placeholder")||"Type a command...",this.#e.setAttribute("aria-label","Search commands"),this.#e.autocomplete="off",this.#e.setAttribute("role","combobox"),this.#e.setAttribute("aria-autocomplete","list"),this.#e.setAttribute("aria-controls",this.#i.id),this.#e.setAttribute("aria-expanded","false"),this.#e.addEventListener("input",this.#d),this.#e.addEventListener("keydown",this.#f),t.appendChild(this.#e),this.#n=Array.from(this.querySelectorAll("command-group")),this.#n.forEach(i=>{let s=this.#u(i.getAttribute("label")||"");this.#i.appendChild(s),i.querySelectorAll("command-item").forEach(n=>{let o=n.querySelector('[slot="icon"]'),a=this.#b(n.textContent.trim(),o?o.cloneNode(!0):null,n.getAttribute("data-hotkey"));a.dataset.value=n.getAttribute("value")||"",a.addEventListener("click",()=>{this.#g(a.dataset.value)}),s.appendChild(a),this.#s.push({btn:a,group:s,source:n})})});let e=document.createElement("div");e.className="command-empty",e.textContent="No results found.",e.hidden=!0,this.#i.appendChild(e),this.#t.appendChild(t),this.#t.appendChild(this.#i),this.appendChild(this.#t)}#u(t){let e=document.createElement("div");e.className="command-group",e.setAttribute("role","group");let i=document.createElement("div");return i.className="command-group-header",i.id=`${this.#h}-g${++this.#l}`,i.setAttribute("aria-hidden","true"),i.textContent=t,t?e.setAttribute("aria-labelledby",i.id):i.hidden=!0,e.appendChild(i),e}#p(){let t=this.getAttribute("hotkey")||"meta+k";this.#a.push(Y(t,()=>{this.#t?.open?this.close():this.open()},{global:!0}));for(let{btn:e,source:i}of this.#s){let s=i?.getAttribute("data-hotkey");if(!s||s.toLowerCase()===t.toLowerCase())continue;let n=e.dataset.value;this.#a.push(Y(s,()=>this.#g(n)))}}#d=()=>{let t=this.#e.value.toLowerCase().trim(),e=0,i=new Set;this.#s.forEach(({btn:n,group:o})=>{let a=!t||(n.dataset.searchText??"").includes(t);n.hidden=!a,a&&(e++,i.add(o))}),this.#i.querySelectorAll(":scope > .command-group").forEach(n=>{n.hidden=!i.has(n)});let s=this.#i.querySelector(".command-empty");s&&(s.hidden=e>0),this.#r=-1,this.#s.forEach(({btn:n})=>{n.removeAttribute("data-active"),n.setAttribute("aria-selected","false")}),this.#e.removeAttribute("aria-activedescendant"),e>0&&this.#v(0)};#f=t=>{let e=this.#k();switch(t.key){case"ArrowDown":t.preventDefault(),this.#v(this.#r+1);break;case"ArrowUp":t.preventDefault(),this.#v(this.#r-1);break;case"Enter":t.preventDefault(),this.#r>=0&&e[this.#r]&&e[this.#r].btn.click();break;case"Escape":t.preventDefault(),this.close();break}};#k(){return this.#s.filter(({btn:t})=>!t.hidden)}#v(t){let e=this.#k();if(e.length===0)return;e.forEach(({btn:s})=>{s.removeAttribute("data-active"),s.setAttribute("aria-selected","false")}),t<0&&(t=e.length-1),t>=e.length&&(t=0),this.#r=t;let{btn:i}=e[t];i.setAttribute("data-active",""),i.setAttribute("aria-selected","true"),this.#e.setAttribute("aria-activedescendant",i.id),i.scrollIntoView({block:"nearest"})}#g(t){this.close(),this.dispatchEvent(new CustomEvent("command-palette:select",{bubbles:!0,detail:{value:t}}))}#y(){this.listen(document,"vb:command-registry-change",this.#w)}#w=()=>{this.#t?.open&&(this.#m(),this.#d())};#m(){if(!this.hasAttribute("discover"))return;let{getRegisteredCommands:t,scanAutoDiscoverable:e}=window.__commandRegistry||{};if(!t)return;this.#s=this.#s.filter(n=>!n.discovered),this.#c.forEach(n=>n.remove()),this.#c=[];let i=this.#i.querySelector(".command-empty"),s=t();for(let[n,o]of s){let a=this.#u(n);this.#i.insertBefore(a,i),this.#c.push(a);for(let l of o){if(this.contains(l.element))continue;let c=this.#b(l.label,l.icon,l.shortcut);c.dataset.value=`__discovered:${l.label}`,c.addEventListener("click",()=>{this.close(),l.element.click()}),a.appendChild(c),this.#s.push({btn:c,group:a,source:null,discovered:!0})}}if(this.getAttribute("discover")==="auto"&&e){let n=e(),o=new Map;for(let a of n){let l=o.get(a.group)||[];l.push(a),o.set(a.group,l)}for(let[a,l]of o){let c=this.#u(a);this.#i.insertBefore(c,i),this.#c.push(c);for(let h of l){if(this.contains(h.element))continue;let u=this.#b(h.label,h.icon,h.shortcut);u.dataset.value=`__auto:${h.label}`,u.dataset.auto="",u.addEventListener("click",()=>{this.close(),h.action?h.action():h.element.click()}),c.appendChild(u),this.#s.push({btn:u,group:c,source:null,discovered:!0})}}}}#b(t,e,i){let s=document.createElement("button");if(s.type="button",s.className="command-option",s.id=`${this.#h}-opt-${++this.#l}`,s.setAttribute("role","option"),s.setAttribute("aria-selected","false"),s.tabIndex=-1,s.dataset.searchText=t.toLowerCase(),e){let o=document.createElement("span");if(o.className="command-icon",typeof e=="string"){let a=document.createElement("icon-wc");a.setAttribute("name",e),o.appendChild(a)}else o.appendChild(e);s.appendChild(o)}let n=document.createElement("span");if(n.className="command-label",n.textContent=t,s.appendChild(n),i){let o=document.createElement("kbd");o.className="command-kbd",o.setAttribute("aria-hidden","true"),o.textContent=Bt(i),s.appendChild(o),s.setAttribute("aria-keyshortcuts",i)}return s}open(){!this.#t||this.#t.open||(this.#m(),this.#t.showModal(),this.#e.setAttribute("aria-expanded","true"),this.#e.value="",this.#d(),this.#e.focus(),this.dispatchEvent(new CustomEvent("command-palette:open",{bubbles:!0})))}close(){this.#t?.open&&this.#t.close()}get isOpen(){return this.#t?.open??!1}},Te=class extends HTMLElement{},Le=class extends HTMLElement{};g("command-palette",Ce);g("command-group",Te);g("command-item",Le);var Xn="shift+?",Yn={title:"Keyboard shortcuts",general:"General",self:"Show keyboard shortcuts",close:"Close"},Jn=0,Me=class extends v{static get observedAttributes(){return["hotkey"]}#t=null;#e=null;#i=null;#s=null;setup(){this.#a(),this.#n(),this.listen(window,Ss,()=>{this.#t?.open&&this.#l()})}teardown(){this.#i?.(),this.#i=null,this.#t?.remove(),this.#t=null,this.#e=null}attributeChangedCallback(t,e,i){t==="hotkey"&&e!==i&&this.hasAttribute("data-upgraded")&&this.#n()}show(){this.#t&&(this.#l(),this.#t.open||this.#t.showModal())}close(){this.#t?.open&&this.#t.close()}toggle(){this.#t?.open?this.close():this.show()}get open(){return!!this.#t?.open}get hotkey(){let t=(this.getAttribute("hotkey")??"").trim();return t.toLowerCase()==="none"?null:t||Xn}get shortcuts(){return this.#s}set shortcuts(t){this.#s=t&&typeof t=="object"?t:null,this.#t?.open&&this.#l(),this.dispatchEvent(new CustomEvent("short-cuts:shortcuts-changed",{detail:{shortcuts:this.#s,source:"property"},bubbles:!0}))}#r(t){return this.getAttribute(`data-label-${t}`)||Yn[t]}#n(){this.#i?.(),this.#i=null;let t=this.hotkey;t&&(this.#i=Y(t,()=>this.toggle()))}#a(){this.querySelector(":scope > dialog.shortcut-dialog")?.remove();let t=`short-cuts-title-${++Jn}`,e=document.createElement("dialog");e.className="shortcut-dialog",e.setAttribute("aria-labelledby",t);let i=document.createElement("header");i.className="shortcut-header";let s=document.createElement("h2");s.id=t,s.textContent=this.#r("title");let n=document.createElement("button");n.type="button",n.className="shortcut-close",n.setAttribute("aria-label",this.#r("close"));let o=document.createElement("icon-wc");o.setAttribute("name","x"),o.setAttribute("size","sm"),o.setAttribute("aria-hidden","true"),n.appendChild(o),n.addEventListener("click",()=>this.close()),i.append(s,n);let a=document.createElement("section");a.className="shortcut-body",e.append(i,a),e.addEventListener("click",l=>{l.target===e&&e.close()}),this.#t=e,this.#e=a,this.appendChild(e)}#c(){let t=new Map,e=!wt(),i=(l,c=!1)=>!(e&&!c&&Ot(l)),s=this.hotkey;s&&i(s)&&t.set(this.#r("general"),[{label:this.#r("self"),shortcut:s}]);let n=(l,c)=>{if(!c?.shortcut||!i(String(c.shortcut),!!c.scoped))return;let h=t.get(l)||[];h.push({label:String(c.label??""),shortcut:String(c.shortcut)}),t.set(l,h)};if(this.#s){for(let[l,c]of Object.entries(this.#s))Array.isArray(c)&&c.forEach(h=>n(l,h));return t}let{getRegisteredCommands:o}=window.__commandRegistry||{};if(o)for(let[l,c]of o())for(let h of c)n(l,h);let{getHotkeyActions:a}=window.__hotkeyActionRegistry||{};if(a)for(let[l,c]of a())for(let h of c)n(l,h);return t}#h(t){let e=document.createElement("kbd");e.className="shortcut-kbd";let i=document.createElement("span");i.setAttribute("aria-hidden","true"),i.textContent=Bt(t);let s=document.createElement("span");return s.className="visually-hidden",s.textContent=zt(t).map(n=>Ee(n,q).spoken).join(" "),e.append(i,s),e}#l(){if(this.#e){this.#e.replaceChildren();for(let[t,e]of this.#c()){if(!e.length)continue;let i=document.createElement("section");i.className="shortcut-group";let s=document.createElement("h3");s.className="shortcut-group-header",s.textContent=t;let n=document.createElement("dl");n.className="shortcut-list";for(let o of e){let a=document.createElement("div");a.className="shortcut-row";let l=document.createElement("dt");l.className="shortcut-label",l.textContent=o.label;let c=document.createElement("dd");c.appendChild(this.#h(o.shortcut)),a.append(l,c),n.appendChild(a)}i.append(s,n),this.#e.appendChild(i)}}}};g("short-cuts",Me);var Zn="Comparison slider";function _e(r){if(r===null||r.trim()==="")return 50;let t=Number(r);return Number.isNaN(t)?50:Math.min(100,Math.max(0,t))}var Re=class extends v{static observedAttributes=["position","label","aria-label","aria-labelledby"];#t=null;#e=!1;#i=!1;#s=50;#r=!1;setup(){let t=[...this.children].filter(e=>!e.classList.contains("comparison-divider"));return t.length<2?!1:(t.length>2&&console.warn("[compare-surface] Expected exactly 2 children; extra children are hidden."),this.#t=document.createElement("div"),this.#t.className="comparison-divider",this.#t.setAttribute("role","slider"),this.#t.setAttribute("aria-valuemin","0"),this.#t.setAttribute("aria-valuemax","100"),this.#t.setAttribute("aria-orientation","horizontal"),this.#t.setAttribute("tabindex","0"),this.#a(),this.#n(),this.appendChild(this.#t),this.#d(_e(this.getAttribute("position"))),this.listen(this.#t,"pointerdown",this.#h),this.listen(this.#t,"pointermove",this.#l),this.listen(this.#t,"pointerup",this.#o),this.listen(this.#t,"pointercancel",this.#o),this.listen(this.#t,"lostpointercapture",this.#o),this.listen(this.#t,"keydown",this.#u),!0)}teardown(){this.#t?.remove(),this.#t=null,this.#e=!1,this.#r&&this.removeAttribute("role"),this.#r=!1}attributeChangedCallback(t,e,i){if(!(!this.#t||e===i))if(t==="position"){if(this.#i)return;this.#d(_e(i))}else this.#a(),this.#n()}#n(){let t=this.hasAttribute("aria-label")||this.hasAttribute("aria-labelledby");t&&!this.hasAttribute("role")?(this.setAttribute("role","group"),this.#r=!0):!t&&this.#r&&(this.removeAttribute("role"),this.#r=!1)}#a(){if(!this.#t)return;let t=this.getAttribute("label")||this.getAttribute("aria-label")||Zn;this.#t.setAttribute("aria-label",t)}get#c(){return getComputedStyle(this).direction==="rtl"}#h=t=>{t.preventDefault(),this.#e=!0,this.#t?.setPointerCapture(t.pointerId)};#l=t=>{if(!this.#e)return;let e=this.getBoundingClientRect();if(!e.width)return;let i=this.#c?e.right-t.clientX:t.clientX-e.left;this.#p(i/e.width*100)};#o=t=>{this.#e&&(this.#e=!1,this.#t?.hasPointerCapture(t.pointerId)&&this.#t.releasePointerCapture(t.pointerId))};#u=t=>{let e=t.shiftKey?10:1,i=this.#c?-1:1,s=this.#s,n;switch(t.key){case"ArrowRight":n=s+e*i;break;case"ArrowLeft":n=s-e*i;break;case"ArrowUp":n=s+e;break;case"ArrowDown":n=s-e;break;case"PageUp":n=s+10;break;case"PageDown":n=s-10;break;case"Home":n=0;break;case"End":n=100;break;default:return}t.preventDefault(),this.#p(n)};#p(t){let e=this.#s;if(this.#d(Math.min(100,Math.max(0,t))),this.#s!==e){this.#i=!0;try{this.setAttribute("position",String(this.#s))}finally{this.#i=!1}this.dispatchEvent(new CustomEvent("compare-surface:change",{detail:{position:this.#s},bubbles:!0}))}}#d(t){this.#s=Math.round(t),this.style.setProperty("--_position",`${t}%`),this.#t&&(this.#t.setAttribute("aria-valuenow",String(this.#s)),this.#t.setAttribute("aria-valuetext",`${this.#s}%`))}get position(){return this.#t?this.#s:Math.round(_e(this.getAttribute("position")))}set position(t){let e=Number(t),i=Math.round(Math.min(100,Math.max(0,Number.isNaN(e)?0:e)));this.setAttribute("position",String(i))}};g("compare-surface",Re);function Qn(){let r=globalThis.localStorage;if(!r)throw new Error("VBStore: localStorage is not available in this environment");return{async getRaw(t){return r.getItem(t)},async setRaw(t,e){r.setItem(t,e)},async removeRaw(t){r.removeItem(t)},async keys(t){let e=[];for(let i=0;i<r.length;i++){let s=r.key(i);s&&s.startsWith(t)&&e.push(s)}return e}}}var jt="__vbStoreBackend",Dt=globalThis;function H(){return Dt[jt]||(Dt[jt]=Qn()),Dt[jt]}function Ne(r,t){if(typeof r!="string"||!r)throw new TypeError("VBStore: namespace must be a non-empty string");if(typeof t!="string"||!t)throw new TypeError("VBStore: key must be a non-empty string");return`vb:${r}:${t}`}function Ts(r){if(typeof r!="string"||!r)throw new TypeError("VBStore: namespace must be a non-empty string");return`vb:${r}:`}function Ls(r){try{let t=JSON.parse(r);if(t&&typeof t=="object"&&typeof t.timestamp=="number")return t}catch{}return null}var R={configure(r={}){Dt[jt]=r.backend??null},async set(r,t,e){let i={data:e,timestamp:Date.now()};await H().setRaw(Ne(r,t),JSON.stringify(i))},async get(r,t,e){let i=await H().getRaw(Ne(r,t));if(i==null)return null;let s=Ls(i);return!s||e?.maxAge!=null&&Date.now()-s.timestamp>e.maxAge?null:s.data},async remove(r,t){await H().removeRaw(Ne(r,t))},async list(r){let t=Ts(r),e=await H().keys(t),i=[];for(let s of e){let n=await H().getRaw(s);if(n==null)continue;let o=Ls(n);o&&i.push({key:s.slice(t.length),data:o.data,timestamp:o.timestamp})}return i},async clear(r){let t=Ts(r),e=await H().keys(t);for(let i of e)await H().removeRaw(i)},async clearAll(){let r=await H().keys("vb:");for(let t of r)await H().removeRaw(t)},async setMany(r,t){for(let[e,i]of t)await R.set(r,e,i)}};if(typeof window<"u"){let r=window.VB??(window.VB={});r.store??=R}var to=0;function Pe(r,t){if(r===null||r.trim()==="")return t;let e=Number(r);return Number.isFinite(e)?e:t}var $e=class extends v{static observedAttributes=["position","min","max","direction","collapsible","data-label-resize","data-label-collapsed"];#t=null;#e;#i;#s=50;#r=!1;#n=50;#a=!1;#c={};#h=0;get#l(){return this.getAttribute("direction")==="vertical"}get#o(){return getComputedStyle(this).direction==="rtl"}get#u(){return Pe(this.getAttribute("min"),10)}get#p(){return Pe(this.getAttribute("max"),90)}get#d(){return this.hasAttribute("collapsible")}get#f(){return Pe(this.getAttribute("position"),50)}get position(){return this.#t?this.#s:this.#c.position??this.#s}set position(t){let e=Number(t);if(Number.isFinite(e)){if(!this.#t){this.#c.position=e,delete this.#c.reset;return}this.#r&&this.#A(),this.#S(e,"api")}}get collapsed(){return this.#t?this.#r:this.#c.collapsed??this.#r}set collapsed(t){if(!this.#t){this.#c.collapsed=!!t;return}t?this.#L("api"):this.#T("api")}reset(){if(!this.#t){this.#c={reset:!0},this.#N();return}this.#r&&this.#A(),this.#S(this.#f,"api"),this.#N()}setup(){for(let e of this.querySelectorAll(":scope > .split-divider"))e.remove();let t=[...this.children].filter(e=>!e.classList.contains("split-divider"));return t.length<2?!1:(this.#e=t[0],this.#i=t[1],this.#k(++this.#h),!0)}async#k(t){let e=null;if(this.#a||(e=await this.#z()),t!==this.#h||!this.isConnected)return!1;let i=this.#e,s=document.createElement("div");s.className="split-divider",s.setAttribute("role","separator"),i.id||(i.id=`vb-split-panel-${++to}`),s.setAttribute("aria-controls",i.id),s.setAttribute("tabindex","0"),this.#t=s,this.#g(),this.insertBefore(s,this.#i),this.listen(s,"pointerdown",this.#w),this.listen(s,"keydown",this.#C),this.listen(s,"dblclick",this.#x);let n=this.#r?this.#n:this.#s,o=this.#r;this.#a||(n=e?.position??this.#f,o=!!e?.collapsed&&this.#d);let a=this.#c;return this.#c={},a.reset&&(n=this.#f,o=!1),a.position!==void 0&&(n=a.position,o=!1),a.collapsed!==void 0&&(o=a.collapsed),this.#a=!0,this.#A(),o?(this.#n=this.#v(n),this.#E()):this.#S(n,null),!0}teardown(){this.#h++,this.#t&&(this.#t.remove(),this.#t=null)}attributeChangedCallback(t,e,i){if(!(e===i||!this.#t)){if(t==="position"){this.#r?this.#n=this.#v(this.#f):this.#S(this.#f,"attribute");return}t==="collapsible"&&!this.#d&&this.#r&&this.#T("attribute"),this.#g(),!this.#r&&(t==="min"||t==="max")&&this.#S(this.#s,"attribute")}}#v(t){return Math.min(this.#p,Math.max(this.#u,t))}#g(){let t=this.#t;t&&(t.setAttribute("aria-orientation",this.#l?"horizontal":"vertical"),t.setAttribute("aria-valuemin",String(this.#d?0:this.#u)),t.setAttribute("aria-valuemax",String(this.#p)),t.setAttribute("aria-label",this.getAttribute("data-label-resize")||"Resize panels"),this.#y())}#y(){let t=this.#t;if(!t)return;let e=Math.round(this.#s);t.setAttribute("aria-valuenow",String(e)),t.setAttribute("aria-valuetext",this.#r?this.getAttribute("data-label-collapsed")||"Collapsed":`${e}%`)}#w=t=>{if(t.button!==0)return;t.preventDefault();let e=this.#t;this.setState("divider-dragging",!0);try{e.setPointerCapture(t.pointerId)}catch{}e.addEventListener("pointermove",this.#m),e.addEventListener("pointerup",this.#b),e.addEventListener("pointercancel",this.#b),e.addEventListener("lostpointercapture",this.#b)};#m=t=>{if(!this.matches(":state(divider-dragging)"))return;let e=this.getBoundingClientRect(),i;this.#l?i=(t.clientY-e.top)/e.height*100:i=(this.#o?e.right-t.clientX:t.clientX-e.left)/e.width*100,this.#r&&this.#A(),this.#S(i,"pointer")};#b=t=>{if(!this.#t)return;let e=this.matches(":state(divider-dragging)");this.setState("divider-dragging",!1),this.#t.hasPointerCapture(t.pointerId)&&this.#t.releasePointerCapture(t.pointerId),this.#t.removeEventListener("pointermove",this.#m),this.#t.removeEventListener("pointerup",this.#b),this.#t.removeEventListener("pointercancel",this.#b),this.#t.removeEventListener("lostpointercapture",this.#b),e&&this.#I()};#C=t=>{if(t.key==="Enter"){if(!this.#d)return;t.preventDefault(),this.#r?this.#T("keyboard"):this.#L("keyboard"),this.#I();return}let e=t.shiftKey?10:1,i=!this.#l&&this.#o,s=this.#l?"ArrowUp":i?"ArrowRight":"ArrowLeft",n=this.#l?"ArrowDown":i?"ArrowLeft":"ArrowRight",o=null;t.key===s?o=this.#s-e:t.key===n?o=this.#s+e:t.key==="Home"?o=this.#u:t.key==="End"&&(o=this.#p),o!==null&&(t.preventDefault(),this.#r&&(this.#A(),this.dispatchEvent(new CustomEvent("split-surface:collapse",{detail:{collapsed:!1,source:"keyboard"},bubbles:!0}))),this.#S(o,"keyboard"),this.#I())};#x=()=>{this.#d&&(this.#r?this.#T("pointer"):this.#L("pointer"),this.#I())};#L(t){this.#r||!this.#t||(this.#n=this.#s,this.#E(),this.dispatchEvent(new CustomEvent("split-surface:collapse",{detail:{collapsed:!0,source:t},bubbles:!0})))}#E(){let t=this.#e;this.#r=!0,this.#s=0,t.style.flexBasis="0%",t.style.flexGrow="0",t.style.flexShrink="0",t.style.overflow="hidden",t.inert=!0,this.setState("collapsed",!0),this.#y()}#A(){this.#r=!1,this.#e&&(this.#e.inert=!1),this.setState("collapsed",!1)}#T(t){!this.#r||!this.#t||(this.#A(),this.#S(this.#n,null),this.dispatchEvent(new CustomEvent("split-surface:collapse",{detail:{collapsed:!1,source:t},bubbles:!0})))}#S(t,e){if(!Number.isFinite(t)||!this.#e||!this.#i)return;let i=this.#v(t);this.#s=i,this.#e.style.flexBasis=`${i}%`,this.#e.style.flexGrow="0",this.#e.style.flexShrink="0",this.#e.style.overflow="auto",this.#i.style.flexGrow="1",this.#i.style.overflow="auto",this.#y(),e!==null&&this.dispatchEvent(new CustomEvent("split-surface:resize",{detail:{position:i,source:e},bubbles:!0}))}async#z(){let t=this.getAttribute("persist");if(!t)return null;try{let e=await R.get("layout",`split:${t}`);if(e&&typeof e=="object"&&typeof e.position=="number")return e}catch{}return null}#I(){let t=this.getAttribute("persist");if(!t)return;let e=this.#r?{position:Math.round(this.#n),collapsed:!0}:{position:Math.round(this.#s),collapsed:!1};R.set("layout",`split:${t}`,e).catch(()=>{})}#N(){let t=this.getAttribute("persist");t&&R.remove("layout",`split:${t}`).catch(()=>{})}};g("split-surface",$e);var ze=1500,eo="[data-copy], [data-copy-target], [data-paste-target]",J={copied:"Copied to clipboard",pasted:"Pasted from clipboard","copy-failed":"Copy failed","copy-failed-selected":"Copy failed. Text selected, press Ctrl+C to copy","paste-failed":"Paste failed"},Ie=new WeakMap;function io(r){if(typeof document.execCommand!="function"||!document.body)return!1;let t=document.activeElement,e=document.createElement("textarea");e.value=r,e.setAttribute("readonly",""),e.setAttribute("aria-hidden","true"),e.style.cssText="position:fixed;inset-block-start:0;inset-inline-start:0;opacity:0;pointer-events:none",document.body.appendChild(e),e.select();let i=!1;try{i=document.execCommand("copy")}catch{i=!1}return e.remove(),t?.focus?.({preventScroll:!0}),i}function so(r){if(!r)return!1;if(r instanceof HTMLInputElement||r instanceof HTMLTextAreaElement)return r.focus(),r.select(),!0;let t=window.getSelection?.();if(!t)return!1;let e=document.createRange();return e.selectNodeContents(r),t.removeAllRanges(),t.addRange(e),!t.isCollapsed}async function At(r,t={}){if(r==null||r==="")return!1;let{button:e,duration:i=ze}=t,s=!1,n=null;try{if(!navigator.clipboard?.writeText)throw new Error("Clipboard API unavailable");await navigator.clipboard.writeText(r),s=!0}catch(a){n=a,s=io(r)}if(s)return lt({button:e,duration:i,state:"copied",eventName:"copy:done",eventDetail:{text:r},message:t.announceMessage??D(e,"copied",J.copied)}),!0;let o=so(t.source);return lt({button:e,duration:i,state:"failed",eventName:"copy:error",eventDetail:{text:r,error:n},message:t.failureMessage??D(e,"copy-failed",o?J["copy-failed-selected"]:J["copy-failed"])}),!1}async function Ms(r,t={}){let{text:e,html:i,blob:s}=r??{};if(!e&&!i&&!s)return!1;let{button:n,duration:o=ze}=t;if(typeof ClipboardItem<"u"&&typeof navigator.clipboard?.write=="function"){let l={};e&&(l["text/plain"]=new Blob([e],{type:"text/plain"})),i&&(l["text/html"]=new Blob([i],{type:"text/html"})),s&&(l[s.type]=s);try{return await navigator.clipboard.write([new ClipboardItem(l)]),lt({button:n,duration:o,state:"copied",eventName:"copy:done",eventDetail:{payload:r},message:t.announceMessage??D(n,"copied",J.copied)}),!0}catch{}}return e?At(e,t):(lt({button:n,duration:o,state:"failed",eventName:"copy:error",eventDetail:{payload:r,error:null},message:t.failureMessage??D(n,"copy-failed",J["copy-failed"])}),!1)}function lt({button:r,duration:t,message:e,eventDetail:i,state:s,eventName:n}){if(r){r.dataset.state=s;let o=Ie.get(r);o&&clearTimeout(o),Ie.set(r,setTimeout(()=>{r.dataset.state===s&&delete r.dataset.state,Ie.delete(r)},t)),r.dispatchEvent(new CustomEvent(n,{bubbles:!0,detail:i}))}V(e,{politeness:s==="failed"?"assertive":"polite"})}async function ro(r,t={}){let{button:e,duration:i=ze}=t,s;try{if(!navigator.clipboard?.readText)throw new Error("Clipboard API unavailable");s=await navigator.clipboard.readText()}catch(n){return lt({button:e,duration:i,state:"failed",eventName:"paste:error",eventDetail:{target:r,error:n},message:t.failureMessage??D(e,"paste-failed",J["paste-failed"])}),null}return r&&(r instanceof HTMLInputElement||r instanceof HTMLTextAreaElement||r instanceof HTMLSelectElement?r.value=s:r.textContent=s,r.dispatchEvent(new Event("input",{bubbles:!0}))),lt({button:e,duration:i,state:"pasted",eventName:"paste:done",eventDetail:{text:s,target:r},message:t.announceMessage??D(e,"pasted",J.pasted)}),s}function _s(r){let t=r.dataset.copyTarget;if(!t)return null;try{return document.querySelector(t)}catch{return null}}function no(r){if(r.dataset.copy)return r.dataset.copy;let t=_s(r);if(!t)return"";let e=r.dataset.copyAttr;return e?t.getAttribute(e)??"":t instanceof HTMLInputElement||t instanceof HTMLTextAreaElement?t.value:t.textContent??""}function oo(r){let t=r.target?.closest?.(eo);if(!t||t.matches(':disabled, [aria-disabled="true"]'))return;if(t.dataset.pasteTarget){let i=null;try{i=document.querySelector(t.dataset.pasteTarget)}catch{}if(!i)return;ro(i,{button:t});return}let e=no(t);e&&At(e,{button:t,source:_s(t)??void 0})}typeof document<"u"&&!document.__vbCopyDelegated&&(document.__vbCopyDelegated=!0,document.addEventListener("click",oo));var G;(r=>{class t{constructor(a,l,c,h){if(this.version=a,this.errorCorrectionLevel=l,a<t.MIN_VERSION||a>t.MAX_VERSION)throw new RangeError("Version value out of range");if(h<-1||h>7)throw new RangeError("Mask value out of range");this.size=a*4+17;let u=[];for(let d=0;d<this.size;d++)u.push(!1);for(let d=0;d<this.size;d++)this.modules.push(u.slice()),this.isFunction.push(u.slice());this.drawFunctionPatterns();let p=this.addEccAndInterleave(c);if(this.drawCodewords(p),h==-1){let d=1e9;for(let f=0;f<8;f++){this.applyMask(f),this.drawFormatBits(f);let m=this.getPenaltyScore();m<d&&(h=f,d=m),this.applyMask(f)}}s(0<=h&&h<=7),this.mask=h,this.applyMask(h),this.drawFormatBits(h),this.isFunction=[]}version;errorCorrectionLevel;static encodeText(a,l){let c=r.QrSegment.makeSegments(a);return t.encodeSegments(c,l)}static encodeBinary(a,l){let c=r.QrSegment.makeBytes(a);return t.encodeSegments([c],l)}static encodeSegments(a,l,c=1,h=40,u=-1,p=!0){if(!(t.MIN_VERSION<=c&&c<=h&&h<=t.MAX_VERSION)||u<-1||u>7)throw new RangeError("Invalid value");let d,f;for(d=c;;d++){let k=t.getNumDataCodewords(d,l)*8,A=n.getTotalBits(a,d);if(A<=k){f=A;break}if(d>=h)throw new RangeError("Data too long")}for(let k of[t.Ecc.MEDIUM,t.Ecc.QUARTILE,t.Ecc.HIGH])p&&f<=t.getNumDataCodewords(d,k)*8&&(l=k);let m=[];for(let k of a){e(k.mode.modeBits,4,m),e(k.numChars,k.mode.numCharCountBits(d),m);for(let A of k.getData())m.push(A)}s(m.length==f);let b=t.getNumDataCodewords(d,l)*8;s(m.length<=b),e(0,Math.min(4,b-m.length),m),e(0,(8-m.length%8)%8,m),s(m.length%8==0);for(let k=236;m.length<b;k^=253)e(k,8,m);let w=[];for(;w.length*8<m.length;)w.push(0);return m.forEach((k,A)=>w[A>>>3]|=k<<7-(A&7)),new t(d,l,w,u)}size;mask;modules=[];isFunction=[];getModule(a,l){return 0<=a&&a<this.size&&0<=l&&l<this.size&&this.modules[l][a]}drawFunctionPatterns(){for(let c=0;c<this.size;c++)this.setFunctionModule(6,c,c%2==0),this.setFunctionModule(c,6,c%2==0);this.drawFinderPattern(3,3),this.drawFinderPattern(this.size-4,3),this.drawFinderPattern(3,this.size-4);let a=this.getAlignmentPatternPositions(),l=a.length;for(let c=0;c<l;c++)for(let h=0;h<l;h++)c==0&&h==0||c==0&&h==l-1||c==l-1&&h==0||this.drawAlignmentPattern(a[c],a[h]);this.drawFormatBits(0),this.drawVersion()}drawFormatBits(a){let l=this.errorCorrectionLevel.formatBits<<3|a,c=l;for(let u=0;u<10;u++)c=c<<1^(c>>>9)*1335;let h=(l<<10|c)^21522;s(h>>>15==0);for(let u=0;u<=5;u++)this.setFunctionModule(8,u,i(h,u));this.setFunctionModule(8,7,i(h,6)),this.setFunctionModule(8,8,i(h,7)),this.setFunctionModule(7,8,i(h,8));for(let u=9;u<15;u++)this.setFunctionModule(14-u,8,i(h,u));for(let u=0;u<8;u++)this.setFunctionModule(this.size-1-u,8,i(h,u));for(let u=8;u<15;u++)this.setFunctionModule(8,this.size-15+u,i(h,u));this.setFunctionModule(8,this.size-8,!0)}drawVersion(){if(this.version<7)return;let a=this.version;for(let c=0;c<12;c++)a=a<<1^(a>>>11)*7973;let l=this.version<<12|a;s(l>>>18==0);for(let c=0;c<18;c++){let h=i(l,c),u=this.size-11+c%3,p=Math.floor(c/3);this.setFunctionModule(u,p,h),this.setFunctionModule(p,u,h)}}drawFinderPattern(a,l){for(let c=-4;c<=4;c++)for(let h=-4;h<=4;h++){let u=Math.max(Math.abs(h),Math.abs(c)),p=a+h,d=l+c;0<=p&&p<this.size&&0<=d&&d<this.size&&this.setFunctionModule(p,d,u!=2&&u!=4)}}drawAlignmentPattern(a,l){for(let c=-2;c<=2;c++)for(let h=-2;h<=2;h++)this.setFunctionModule(a+h,l+c,Math.max(Math.abs(h),Math.abs(c))!=1)}setFunctionModule(a,l,c){this.modules[l][a]=c,this.isFunction[l][a]=!0}addEccAndInterleave(a){let l=this.version,c=this.errorCorrectionLevel;if(a.length!=t.getNumDataCodewords(l,c))throw new RangeError("Invalid argument");let h=t.NUM_ERROR_CORRECTION_BLOCKS[c.ordinal][l],u=t.ECC_CODEWORDS_PER_BLOCK[c.ordinal][l],p=Math.floor(t.getNumRawDataModules(l)/8),d=h-p%h,f=Math.floor(p/h),m=[],b=t.reedSolomonComputeDivisor(u);for(let k=0,A=0;k<h;k++){let T=a.slice(A,A+f-u+(k<d?0:1));A+=T.length;let O=t.reedSolomonComputeRemainder(T,b);k<d&&T.push(0),m.push(T.concat(O))}let w=[];for(let k=0;k<m[0].length;k++)m.forEach((A,T)=>{(k!=f-u||T>=d)&&w.push(A[k])});return s(w.length==p),w}drawCodewords(a){if(a.length!=Math.floor(t.getNumRawDataModules(this.version)/8))throw new RangeError("Invalid argument");let l=0;for(let c=this.size-1;c>=1;c-=2){c==6&&(c=5);for(let h=0;h<this.size;h++)for(let u=0;u<2;u++){let p=c-u,f=(c+1&2)==0?this.size-1-h:h;!this.isFunction[f][p]&&l<a.length*8&&(this.modules[f][p]=i(a[l>>>3],7-(l&7)),l++)}}s(l==a.length*8)}applyMask(a){if(a<0||a>7)throw new RangeError("Mask value out of range");for(let l=0;l<this.size;l++)for(let c=0;c<this.size;c++){let h;switch(a){case 0:h=(c+l)%2==0;break;case 1:h=l%2==0;break;case 2:h=c%3==0;break;case 3:h=(c+l)%3==0;break;case 4:h=(Math.floor(c/3)+Math.floor(l/2))%2==0;break;case 5:h=c*l%2+c*l%3==0;break;case 6:h=(c*l%2+c*l%3)%2==0;break;case 7:h=((c+l)%2+c*l%3)%2==0;break;default:throw new Error("Unreachable")}!this.isFunction[l][c]&&h&&(this.modules[l][c]=!this.modules[l][c])}}getPenaltyScore(){let a=0;for(let u=0;u<this.size;u++){let p=!1,d=0,f=[0,0,0,0,0,0,0];for(let m=0;m<this.size;m++)this.modules[u][m]==p?(d++,d==5?a+=t.PENALTY_N1:d>5&&a++):(this.finderPenaltyAddHistory(d,f),p||(a+=this.finderPenaltyCountPatterns(f)*t.PENALTY_N3),p=this.modules[u][m],d=1);a+=this.finderPenaltyTerminateAndCount(p,d,f)*t.PENALTY_N3}for(let u=0;u<this.size;u++){let p=!1,d=0,f=[0,0,0,0,0,0,0];for(let m=0;m<this.size;m++)this.modules[m][u]==p?(d++,d==5?a+=t.PENALTY_N1:d>5&&a++):(this.finderPenaltyAddHistory(d,f),p||(a+=this.finderPenaltyCountPatterns(f)*t.PENALTY_N3),p=this.modules[m][u],d=1);a+=this.finderPenaltyTerminateAndCount(p,d,f)*t.PENALTY_N3}for(let u=0;u<this.size-1;u++)for(let p=0;p<this.size-1;p++){let d=this.modules[u][p];d==this.modules[u][p+1]&&d==this.modules[u+1][p]&&d==this.modules[u+1][p+1]&&(a+=t.PENALTY_N2)}let l=0;for(let u of this.modules)l=u.reduce((p,d)=>p+(d?1:0),l);let c=this.size*this.size,h=Math.ceil(Math.abs(l*20-c*10)/c)-1;return s(0<=h&&h<=9),a+=h*t.PENALTY_N4,s(0<=a&&a<=2568888),a}getAlignmentPatternPositions(){if(this.version==1)return[];{let a=Math.floor(this.version/7)+2,l=Math.floor((this.version*8+a*3+5)/(a*4-4))*2,c=[6];for(let h=this.size-7;c.length<a;h-=l)c.splice(1,0,h);return c}}static getNumRawDataModules(a){if(a<t.MIN_VERSION||a>t.MAX_VERSION)throw new RangeError("Version number out of range");let l=(16*a+128)*a+64;if(a>=2){let c=Math.floor(a/7)+2;l-=(25*c-10)*c-55,a>=7&&(l-=36)}return s(208<=l&&l<=29648),l}static getNumDataCodewords(a,l){return Math.floor(t.getNumRawDataModules(a)/8)-t.ECC_CODEWORDS_PER_BLOCK[l.ordinal][a]*t.NUM_ERROR_CORRECTION_BLOCKS[l.ordinal][a]}static reedSolomonComputeDivisor(a){if(a<1||a>255)throw new RangeError("Degree out of range");let l=[];for(let h=0;h<a-1;h++)l.push(0);l.push(1);let c=1;for(let h=0;h<a;h++){for(let u=0;u<l.length;u++)l[u]=t.reedSolomonMultiply(l[u],c),u+1<l.length&&(l[u]^=l[u+1]);c=t.reedSolomonMultiply(c,2)}return l}static reedSolomonComputeRemainder(a,l){let c=l.map(h=>0);for(let h of a){let u=h^c.shift();c.push(0),l.forEach((p,d)=>c[d]^=t.reedSolomonMultiply(p,u))}return c}static reedSolomonMultiply(a,l){if(a>>>8||l>>>8)throw new RangeError("Byte out of range");let c=0;for(let h=7;h>=0;h--)c=c<<1^(c>>>7)*285,c^=(l>>>h&1)*a;return s(c>>>8==0),c}finderPenaltyCountPatterns(a){let l=a[1];s(l<=this.size*3);let c=l>0&&a[2]==l&&a[3]==l*3&&a[4]==l&&a[5]==l;return(c&&a[0]>=l*4&&a[6]>=l?1:0)+(c&&a[6]>=l*4&&a[0]>=l?1:0)}finderPenaltyTerminateAndCount(a,l,c){return a&&(this.finderPenaltyAddHistory(l,c),l=0),l+=this.size,this.finderPenaltyAddHistory(l,c),this.finderPenaltyCountPatterns(c)}finderPenaltyAddHistory(a,l){l[0]==0&&(a+=this.size),l.pop(),l.unshift(a)}static MIN_VERSION=1;static MAX_VERSION=40;static PENALTY_N1=3;static PENALTY_N2=3;static PENALTY_N3=40;static PENALTY_N4=10;static ECC_CODEWORDS_PER_BLOCK=[[-1,7,10,15,20,26,18,20,24,30,18,20,24,26,30,22,24,28,30,28,28,28,28,30,30,26,28,30,30,30,30,30,30,30,30,30,30,30,30,30,30],[-1,10,16,26,18,24,16,18,22,22,26,30,22,22,24,24,28,28,26,26,26,26,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28],[-1,13,22,18,26,18,24,18,22,20,24,28,26,24,20,30,24,28,28,26,30,28,30,30,30,30,28,30,30,30,30,30,30,30,30,30,30,30,30,30,30],[-1,17,28,22,16,22,28,26,26,24,28,24,28,22,24,24,30,28,28,26,28,30,24,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30]];static NUM_ERROR_CORRECTION_BLOCKS=[[-1,1,1,1,1,1,2,2,2,2,4,4,4,4,4,6,6,6,6,7,8,8,9,9,10,12,12,12,13,14,15,16,17,18,19,19,20,21,22,24,25],[-1,1,1,1,2,2,4,4,4,5,5,5,8,9,9,10,10,11,13,14,16,17,17,18,20,21,23,25,26,28,29,31,33,35,37,38,40,43,45,47,49],[-1,1,1,2,2,4,4,6,6,8,8,8,10,12,16,12,17,16,18,21,20,23,23,25,27,29,34,34,35,38,40,43,45,48,51,53,56,59,62,65,68],[-1,1,1,2,4,4,4,5,6,8,8,11,11,16,16,18,16,19,21,25,25,25,34,30,32,35,37,40,42,45,48,51,54,57,60,63,66,70,74,77,81]]}r.QrCode=t;function e(o,a,l){if(a<0||a>31||o>>>a)throw new RangeError("Value out of range");for(let c=a-1;c>=0;c--)l.push(o>>>c&1)}function i(o,a){return(o>>>a&1)!=0}function s(o){if(!o)throw new Error("Assertion error")}class n{constructor(a,l,c){if(this.mode=a,this.numChars=l,this.bitData=c,l<0)throw new RangeError("Invalid argument");this.bitData=c.slice()}mode;numChars;bitData;static makeBytes(a){let l=[];for(let c of a)e(c,8,l);return new n(n.Mode.BYTE,a.length,l)}static makeNumeric(a){if(!n.isNumeric(a))throw new RangeError("String contains non-numeric characters");let l=[];for(let c=0;c<a.length;){let h=Math.min(a.length-c,3);e(parseInt(a.substring(c,c+h),10),h*3+1,l),c+=h}return new n(n.Mode.NUMERIC,a.length,l)}static makeAlphanumeric(a){if(!n.isAlphanumeric(a))throw new RangeError("String contains unencodable characters in alphanumeric mode");let l=[],c;for(c=0;c+2<=a.length;c+=2){let h=n.ALPHANUMERIC_CHARSET.indexOf(a.charAt(c))*45;h+=n.ALPHANUMERIC_CHARSET.indexOf(a.charAt(c+1)),e(h,11,l)}return c<a.length&&e(n.ALPHANUMERIC_CHARSET.indexOf(a.charAt(c)),6,l),new n(n.Mode.ALPHANUMERIC,a.length,l)}static makeSegments(a){return a==""?[]:n.isNumeric(a)?[n.makeNumeric(a)]:n.isAlphanumeric(a)?[n.makeAlphanumeric(a)]:[n.makeBytes(n.toUtf8ByteArray(a))]}static makeEci(a){let l=[];if(a<0)throw new RangeError("ECI assignment value out of range");if(a<128)e(a,8,l);else if(a<16384)e(2,2,l),e(a,14,l);else if(a<1e6)e(6,3,l),e(a,21,l);else throw new RangeError("ECI assignment value out of range");return new n(n.Mode.ECI,0,l)}static isNumeric(a){return n.NUMERIC_REGEX.test(a)}static isAlphanumeric(a){return n.ALPHANUMERIC_REGEX.test(a)}getData(){return this.bitData.slice()}static getTotalBits(a,l){let c=0;for(let h of a){let u=h.mode.numCharCountBits(l);if(h.numChars>=1<<u)return 1/0;c+=4+u+h.bitData.length}return c}static toUtf8ByteArray(a){a=encodeURI(a);let l=[];for(let c=0;c<a.length;c++)a.charAt(c)!="%"?l.push(a.charCodeAt(c)):(l.push(parseInt(a.substring(c+1,c+3),16)),c+=2);return l}static NUMERIC_REGEX=/^[0-9]*$/;static ALPHANUMERIC_REGEX=/^[A-Z0-9 $%*+.\/:-]*$/;static ALPHANUMERIC_CHARSET="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:"}r.QrSegment=n})(G||(G={}));(r=>{let t;(e=>{class i{constructor(n,o){this.ordinal=n,this.formatBits=o}ordinal;formatBits;static LOW=new i(0,1);static MEDIUM=new i(1,0);static QUARTILE=new i(2,3);static HIGH=new i(3,2)}e.Ecc=i})(t=r.QrCode||(r.QrCode={}))})(G||(G={}));(r=>{let t;(e=>{class i{constructor(n,o){this.modeBits=n,this.numBitsCharCount=o}modeBits;numBitsCharCount;static NUMERIC=new i(1,[10,12,14]);static ALPHANUMERIC=new i(2,[9,11,13]);static BYTE=new i(4,[8,16,16]);static KANJI=new i(8,[8,10,12]);static ECI=new i(7,[0,0,0]);numCharCountBits(n){return this.numBitsCharCount[Math.floor((n+7)/17)]}}e.Mode=i})(t=r.QrSegment||(r.QrSegment={}))})(G||(G={}));var ct=G.QrCode,Rs=G.QrSegment;var ao=4,Oe=["L","M","Q","H"],Be=[ct.Ecc.LOW,ct.Ecc.MEDIUM,ct.Ecc.QUARTILE,ct.Ecc.HIGH];function Ps(r){if(r==null||r.trim()==="")return 1;let t=r.trim().toUpperCase(),e=Oe.indexOf(t);return e!==-1?e:/^[0-3]$/.test(t)?Number(t):null}function $s(r,t=1){let e=Be[t]??Be[1],i;try{i=ct.encodeSegments(Rs.makeSegments(r),e,1,40,-1,!1)}catch(n){let o=new RangeError(n instanceof Error?n.message:String(n));throw o.reason=/too long/i.test(o.message)?"capacity":"encoding",o}let s=[];for(let n=0;n<i.size;n++){let o=[];for(let a=0;a<i.size;a++)o.push(i.getModule(a,n));s.push(o)}return{version:i.version,size:i.size,ecl:Be.indexOf(e),modules:s}}function Is(r,t){let e=r+ao*2,i=Math.max(1,Math.floor(t/e)),s=Math.max(t,i*e),n=Math.floor((s-i*r)/2);return{cell:i,offset:n,edge:s}}function Ns([r,t,e]){let i=s=>{let n=s/255;return n<=.03928?n/12.92:((n+.055)/1.055)**2.4};return .2126*i(r)+.7152*i(t)+.0722*i(e)}function zs(r,t){let e=[];(t[3]??1)<1&&e.push("the background is not opaque, so the code takes on whatever is behind it"),(r[3]??1)<1&&e.push("the module colour is not opaque");let i=Ns(r),s=Ns(t);i>s&&e.push("modules are lighter than the background (inverted codes are rejected by many scanners)");let n=(Math.max(i,s)+.05)/(Math.min(i,s)+.05);return n<4&&e.push(`contrast is ${n.toFixed(2)}:1 (aim for at least 4:1)`),e}var lo=200,co="#000",ho="#fff",Bs=200,je=class extends v{#t=null;#e=null;#i="";#s=!1;#r="";#n="";static get observedAttributes(){return["value","size","color","background","error-correction","data-label-prefix"]}get value(){return this.getAttribute("value")||this.#i}set value(t){t==null||t===""?this.removeAttribute("value"):this.setAttribute("value",String(t))}setup(){if(!this.#e){this.#i=(this.textContent??"").trim();let t=document.createElement("span");t.setAttribute("data-qr-caption",""),t.append(...this.childNodes),!this.#i&&!t.children.length&&(t.textContent=this.value,this.#s=!0),this.#e=t}return this.#t||(this.#t=document.createElement("canvas"),this.#t.setAttribute("role","img")),this.#t.parentNode!==this&&this.prepend(this.#t),this.#e.parentNode!==this&&this.append(this.#e),this.#c(),this.#a(),!0}#a(){if(typeof window.matchMedia!="function")return;let t=window.matchMedia(`(resolution: ${window.devicePixelRatio||1}dppx)`);this.listen(t,"change",()=>{this.isConnected&&(this.#c(),this.#a())},{once:!0})}attributeChangedCallback(){!this.hasAttribute("data-upgraded")||!this.isConnected||this.#c()}#c(){this.#h(this.#l())}#h(t){let e=this.#t,i=this.#e,s=t?this.value:"",n=this.getAttribute("data-label-prefix"),o=s.length>Bs?`${s.slice(0,Bs)}\u2026`:s;e.setAttribute("aria-label",n||(s?`QR code: ${o}`:"QR code")),n&&s?e.setAttribute("aria-description",s):e.removeAttribute("aria-description"),!n&&!!s&&o===s&&!i.children.length&&(i.textContent??"").trim()===s?i.setAttribute("aria-hidden","true"):i.removeAttribute("aria-hidden")}#l(){let t=this.#t,e=this.value;if(this.#s&&this.#e&&this.#e.textContent!==e&&(this.#e.textContent=e),this.removeAttribute("data-error"),!e)return this.#o(),!1;let i=this.getAttribute("error-correction"),s=Ps(i);s===null&&(console.warn(`<qr-code>: error-correction="${i}" is not L, M, Q, H or 0-3; using M.`),s=1);let n;try{n=$s(e,s)}catch(f){let m=f.reason||"encoding";return this.#o(),this.setAttribute("data-error",m),this.dispatchEvent(new CustomEvent("qr-code:error",{bubbles:!0,detail:{reason:m,value:e,errorCorrection:Oe[s],message:f.message}})),!1}let o=Math.max(1,parseInt(this.getAttribute("size")??"",10)||lo),a=Math.max(1,window.devicePixelRatio||1),{cell:l,offset:c,edge:h}=Is(n.size,Math.round(o*a));t.hidden=!1,t.width=h,t.height=h,t.style.inlineSize=`${o}px`;let u=this.#u(this.getAttribute("color"),co),p=this.#u(this.getAttribute("background"),ho);this.#p(u,p);let d=t.getContext("2d");if(!d)return!1;d.clearRect(0,0,h,h),d.fillStyle=p.css,d.fillRect(0,0,h,h),d.fillStyle=u.css;for(let f=0;f<n.size;f++)for(let m=0;m<n.size;m++)n.modules[f][m]&&d.fillRect(c+m*l,c+f*l,l,l);return this.#r=e,!0}#o(){let t=this.#t;t.hidden=!0,t.width=0,t.height=0,this.#r=""}#u(t,e){let i=this.#t,s=t?.trim()||e,n=i.style.color;i.style.color="",i.style.color=s,i.style.color||(console.warn(`<qr-code>: "${s}" is not a valid colour; using ${e}.`),i.style.color=e);let o=getComputedStyle(i).color;i.style.color=n;let a=(o.match(/[\d.]+/g)||[]).map(Number),l=[a[0]??0,a[1]??0,a[2]??0,a[3]??1];return{css:o,rgba:l}}#p(t,e){if(!this.hasAttribute("color")&&!this.hasAttribute("background"))return;let i=`${t.css}|${e.css}`;if(i===this.#n)return;this.#n=i;let s=zs(t.rgba,e.rgba);s.length&&console.warn(`<qr-code>: color="${t.css}" on background="${e.css}" may not scan: ${s.join("; ")}.`,this)}toDataURL(t="image/png"){return!this.#t||!this.#r?"":this.#t.toDataURL(t)}async copy({button:t}={}){let e=this.#t;if(!e||!this.#r)return!1;let i=this.#r,s=await new Promise(n=>e.toBlob(n,"image/png"));return Ms({text:i,blob:s||void 0},{button:t,announceMessage:this.getAttribute("data-label-copied")||"QR code copied"})}};g("qr-code",je);var uo="Slide to confirm",po="Confirmed!",fo="Press Enter to confirm",Os=6,De=class extends v{static formAssociated=!0;static observedAttributes=["label","activated-label","data-label-hint","data-label-required","required","value"];#t;#e;#i;#s;#r;#n=!1;#a=0;#c=0;#h=0;#l=0;#o=!1;#u=!1;#p=!1;#d="";#f;constructor(){super(),this.#t=this.attachInternals(),this._adoptInternals(this.#t)}get activated(){return this.#o}get#k(){let t=this.getAttribute("threshold"),e=Number(t);return t!==null&&t.trim()!==""&&!isNaN(e)?Math.min(100,Math.max(0,e)):90}get#v(){return this.getAttribute("label")||this.#d||uo}get#g(){return this.getAttribute("activated-label")||po}get#y(){return getComputedStyle(this).direction==="rtl"}setup(){this.#p||(this.#w(),this.#p=!0),this.listen(this.#e,"pointerdown",this.#L),this.listen(this.#e,"keydown",this.#z),this.listen(this.#e,"transitionend",this.#I)}teardown(){this.#n&&this.#A(),clearTimeout(this.#f),this.removeAttribute("transitioning")}attributeChangedCallback(t,e,i){e===i||!this.#p||(this.#m(),(t==="required"||t==="value"||t==="data-label-required"||t==="label")&&this.#C())}#w(){this.#d=(this.textContent||"").replace(/\s+/g," ").trim(),this.#r=document.createElement("div"),this.#r.className="slide-track",this.#i=document.createElement("span"),this.#i.className="slide-label",this.#i.setAttribute("role","status"),this.#s=document.createElement("span"),this.#s.className="visually-hidden slide-hint",this.#s.id=`slide-hint-${Math.random().toString(36).slice(2,9)}`,this.#e=document.createElement("div"),this.#e.className="slide-handle",this.#e.setAttribute("role","slider"),this.#e.setAttribute("aria-valuemin","0"),this.#e.setAttribute("aria-valuemax","100"),this.#e.setAttribute("aria-describedby",this.#s.id),this.#e.setAttribute("tabindex","0"),this.#e.innerHTML='<icon-wc name="chevrons-right" size="sm"></icon-wc>',this.#r.append(this.#i,this.#e),this.textContent="",this.append(this.#r,this.#s),this.#m(),this.#_(0),this.#C()}#m(){let t=this.#v;this.#i.textContent=this.#o?this.#g:t,this.#e.setAttribute("aria-label",t),this.#s.textContent=this.getAttribute("data-label-hint")||fo,this.#b()}#b(){this.#e.setAttribute("aria-valuetext",this.#o?this.#g:`${Math.round(this.#a)}%`)}#C(){let t=this.getAttribute("value")||"on";if(this.#t.setFormValue(this.#o?t:null),this.hasAttribute("required")&&!this.#o){let e=(this.getAttribute("data-label-required")||"{label} to continue.").replace("{label}",this.#v);this.#t.setValidity({valueMissing:!0},e,this.#e)}else this.#t.setValidity({})}reset(){this.#o=!1,this.removeAttribute("data-activated"),this.#e.removeAttribute("aria-disabled"),this.#x(),this.#_(0),this.#m(),this.#C(),this.dispatchEvent(new CustomEvent("slide-accept:reset",{bubbles:!0}))}formResetCallback(){(this.#o||this.#a!==0)&&this.reset()}formDisabledCallback(t){this.#u=t,t&&this.#n&&(this.#A(),this.#$()),this.#x()}#x(){this.#e&&(this.#o||this.#u?this.#e.setAttribute("aria-disabled","true"):this.#e.removeAttribute("aria-disabled"))}#L=t=>{if(!(this.#o||this.#u)&&t.button===0){if(t.preventDefault(),this.#e.focus({preventScroll:!0}),this.hasAttribute("transitioning")){let e=this.#e.getBoundingClientRect(),i=this.#r.getBoundingClientRect(),s=parseFloat(getComputedStyle(this.#r).getPropertyValue("--_handle-inset")||"0"),n=this.#e.offsetWidth,o=i.width-n-s*2,a=this.#y?i.right-e.right-s:e.left-i.left-s;this.removeAttribute("transitioning"),clearTimeout(this.#f),this.#_(o>0?Math.max(0,Math.min(100,a/o*100)):0)}this.#n=!0,this.#c=t.clientX,this.#h=this.#a,this.#l=0;try{this.#e.setPointerCapture(t.pointerId)}catch{}this.setAttribute("data-dragging",""),this.#e.addEventListener("pointermove",this.#E),this.#e.addEventListener("pointerup",this.#T),this.#e.addEventListener("pointercancel",this.#S)}};#E=t=>{if(!this.#n)return;let e=this.#r.getBoundingClientRect().width-this.#e.offsetWidth;if(e<=0)return;let i=t.clientX-this.#c;this.#l=Math.max(this.#l,Math.abs(i));let n=(this.#y?-i:i)/e*100;this.#_(Math.min(100,Math.max(0,this.#h+n)))};#A(t){if(this.#n=!1,this.removeAttribute("data-dragging"),t)try{this.#e.releasePointerCapture(t.pointerId)}catch{}this.#e.removeEventListener("pointermove",this.#E),this.#e.removeEventListener("pointerup",this.#T),this.#e.removeEventListener("pointercancel",this.#S)}#T=t=>{if(!this.#n)return;let e=this.#l<Os&&Math.abs(t.clientX-this.#c)<Os;this.#A(t),e||this.#a>=this.#k?this.#N():this.#$()};#S=t=>{this.#n&&(this.#A(t),this.#$())};#z=t=>{if(this.#o||this.#u)return;let e=t.shiftKey?20:5,i=this.#y,s=i?"ArrowLeft":"ArrowRight",n=i?"ArrowRight":"ArrowLeft";t.key===s||t.key==="ArrowUp"?(t.preventDefault(),this.#_(Math.min(100,this.#a+e)),this.#a>=this.#k&&this.#N()):t.key===n||t.key==="ArrowDown"?(t.preventDefault(),this.#_(Math.max(0,this.#a-e))):t.key==="End"||t.key==="Enter"||t.key===" "?(t.preventDefault(),this.#N()):t.key==="Home"&&(t.preventDefault(),this.#_(0))};#I=()=>{this.removeAttribute("transitioning")};#N(){this.#o||(this.#o=!0,this.#_(100),this.setAttribute("data-activated",""),this.#x(),this.#m(),this.#C(),this.dispatchEvent(new CustomEvent("slide-accept:accept",{bubbles:!0})))}#$(){this.setAttribute("transitioning",""),this.#_(0),clearTimeout(this.#f),this.#f=setTimeout(()=>{this.removeAttribute("transitioning")},500)}#_(t){this.#a=t,this.style.setProperty("--_slide-position",String(t)),this.#e.setAttribute("aria-valuenow",String(Math.round(t))),this.#b()}};g("slide-accept",De);var Ft="banner",js=365,Ds=864e5;function Fs(r){if(r===0||r==="0"||r==="never")return;let t=r==null||r===""?js:Number.parseFloat(String(r));return Number.isFinite(t)?t>0?t*Ds:void 0:js*Ds}var mo=0,Fe=class extends v{#t=null;static get observedAttributes(){return["position"]}get#e(){return this.getAttribute("persist")||Ft}get#i(){return Fs(this.getAttribute("expires"))}get#s(){return this.getAttribute("position")==="center"}setup(){return this.#t=this.querySelector("dialog"),this.#t?(this.#r(),this.getAttribute("trigger")&&this.listen(document,"click",this.#u),this.listen(this,"click",this.#o),this.listen(this.#t,"cancel",this.#l),this.#n(),!0):!1}attributeChangedCallback(t,e,i){e===i||!this.#t?.open||(this.#t.close(),this.#a())}#r(){let t=this.#t;if(t.hasAttribute("aria-label")||t.hasAttribute("aria-labelledby"))return;let e=t.querySelector("h1, h2, h3, h4, h5, h6");e?(e.id||(e.id=`consent-banner-title-${++mo}`),t.setAttribute("aria-labelledby",e.id)):t.setAttribute("aria-label","Cookie consent")}async#n(){if(await this.#p()){this.getAttribute("trigger")?this.hidden=!0:this.remove();return}this.#c()}#a(){this.#s?this.#t.showModal():this.#t.show()}#c(){!this.isConnected||this.#t.open||this.#a()}#h(){this.#t.close(),this.getAttribute("trigger")?this.hidden=!0:this.remove()}#l=t=>{this.#s&&t.preventDefault()};#o=async t=>{if(!this.#t.open)return;let e=t.target.closest("button[value]");if(!e||!this.#t.contains(e))return;let i=e.value;if(!["accept","reject","save"].includes(i))return;let s=[...this.querySelectorAll('input[type="checkbox"]')],n={};i==="accept"?s.forEach(o=>{n[o.name]=!0}):i==="reject"?s.forEach(o=>{n[o.name]=!!o.disabled}):s.forEach(o=>{n[o.name]=o.checked}),await this.#d({preferences:n,action:i}),this.dispatchEvent(new CustomEvent("consent-banner:change",{bubbles:!0,detail:{preferences:n,action:i}})),this.#h()};#u=async t=>{let e=this.getAttribute("trigger");if(!e||!t.target.closest(e))return;t.preventDefault();let s=await this.#p();if(s?.preferences)for(let[n,o]of Object.entries(s.preferences)){let a=this.querySelector(`input[type="checkbox"][name="${CSS.escape(n)}"]`);a&&!a.disabled&&(a.checked=o)}this.hidden=!1,this.#c()};async#p(){let t=this.#i;try{return await R.get("consent",this.#e,t?{maxAge:t}:void 0)}catch{return null}}async#d(t){try{await R.set("consent",this.#e,t)}catch{}}static async reset(t=Ft){try{await R.remove("consent",t)}catch{}}static async getConsent(t=Ft,e={}){let i=e.expires;i===void 0&&typeof document<"u"&&(i=[...document.querySelectorAll("consent-banner")].find(o=>(o.getAttribute("persist")||Ft)===t)?.getAttribute("expires")??void 0);let s=Fs(i);try{return await R.get("consent",t,s?{maxAge:s}:void 0)}catch{return null}}};g("consent-banner",Fe);var go={play:"Play",pause:"Pause",stop:"Stop",reader:"Article reader",controls:"Reader controls",voice:"Voice","loading-voices":"Loading voices\u2026",speed:"Speed",slower:"Slower",faster:"Faster"},qs='[aria-hidden="true"], [hidden], script, style, template, text-reader',bo=()=>typeof HTMLElement<"u"&&Object.prototype.hasOwnProperty.call(HTMLElement.prototype,"popover"),qe=()=>typeof window<"u"&&"speechSynthesis"in window,xt=r=>(r||"").toLowerCase().split(/[-_]/)[0],He=class extends v{#t=null;#e=null;#i=[];#s="";#r=0;#n=null;#a=null;#c=null;#h=null;#l=!1;#o=!1;#u=0;#p=null;#d=null;#f=null;#k=null;#v=null;#g=null;#y=null;#w=!1;#m=null;#b=null;#C=[];#x=[];static get observedAttributes(){return["speed","voice","for"]}attributeChangedCallback(t,e,i){if(e!==i&&(t==="for"&&e!==null&&this.hasAttribute("data-upgraded")&&(this.#l&&this.stop(),this.#F(),this.#st(this.#x)),(t==="speed"||t==="voice")&&this.#l&&this.#q(),t==="speed")){let s=this.#Y(parseFloat(i)||1);this.#v&&(this.#v.value=String(s)),this.#g&&(this.#g.textContent=`${s}\xD7`)}}setup(){return qe()?(this.getAttribute("variant")==="icon"?this.#S():this.#L(),this.#F(),this.#U(),this.#h=this.#it(),this.#h.then(t=>{this.#x=t,this.#st(t)}),this.listen(window,"beforeunload",this.#at),!0):(this.style.display="none",!1)}teardown(){this.#l&&this.stop(),this.#W(),this.#y?.remove(),this.#b?.remove(),this.#m?.remove(),this.#y=null,this.#b=null,this.#m=null,this.#p=this.#d=this.#f=null,this.#k=null,this.#v=null,this.#g=null,this.#w=!1;for(let{icon:t,slot:e}of this.#C)t.setAttribute("slot",e),this.append(t);this.#C=[]}play(){if(qe()){if(this.#o){this.resume();return}this.#l||(this.#P(),this.#G(0))}}pause(){!this.#l||this.#o||(speechSynthesis.pause(),this.#o=!0,this.#X(!0),this.#V("text-reader:pause"))}resume(){this.#o&&(speechSynthesis.resume(),this.#o=!1,this.#X(!1),this.#V("text-reader:resume"))}stop(){!qe()||!this.#l||(this.#e=null,speechSynthesis.cancel(),this.#J(),this.#V("text-reader:stop"))}get voices(){return this.#h||this.#it()}get speaking(){return this.#l}get paused(){return this.#o}get progress(){return this.#s.length?Math.min(this.#r/this.#s.length,1):0}#L(){let t=document.createElement("div");t.setAttribute("part","controls"),t.setAttribute("role","group"),t.setAttribute("aria-label",this.#A("reader"));let e=this.#E("play",this.#A("play"),"\u25B6");e.addEventListener("click",()=>this.play());let i=this.#E("pause",this.#A("pause"),"\u23F8");i.hidden=!0,i.addEventListener("click",()=>this.pause());let s=this.#E("stop",this.#A("stop"),"\u23F9");s.disabled=!0,s.addEventListener("click",()=>this.stop());let n=document.createElement("select");n.setAttribute("aria-label",this.#A("voice"));let o=document.createElement("option");o.textContent=this.#A("loading-voices"),n.append(o),n.addEventListener("change",()=>{this.#l&&this.#q()});let a=document.createElement("label");a.setAttribute("data-speed-group","");let l=document.createElement("span");l.setAttribute("data-speed-value","");let c=this.#Y(parseFloat(this.getAttribute("speed")??"1")||1);l.textContent=`${c}\xD7`;let h=document.createElement("input");h.type="range",h.min="0.5",h.max="2",h.step="0.1",h.value=String(c),h.setAttribute("aria-label",this.#A("speed")),h.addEventListener("input",()=>{let u=parseFloat(h.value);l.textContent=`${u}\xD7`,this.#l&&this.#q()}),a.append(l,h),this.#T("icon-play",e),this.#T("icon-pause",i),this.#T("icon-stop",s),t.append(e,i,s,n,a),this.prepend(t),this.#y=t,this.#p=e,this.#d=i,this.#f=s,this.#k=n,this.#v=h,this.#g=l}#E(t,e,i){let s=document.createElement("button");return s.type="button",s.setAttribute("part",`button ${t}`),s.setAttribute("aria-label",e),s.textContent=i,s}#A(t){return this.getAttribute(`data-label-${t}`)||go[t]}#T(t,e){let i=this.querySelector(`:scope > [slot="${t}"]`);i&&(i.removeAttribute("slot"),e.textContent="",e.append(i),this.#C.push({icon:i,slot:t}))}#S(){this.#w=!0;for(let i of this.querySelectorAll(':scope > [part="trigger"]'))i.remove();let t=document.createElement("button");t.type="button",t.setAttribute("part","trigger"),t.setAttribute("aria-label",this.#A("reader")),t.setAttribute("aria-pressed","false");let e=this.querySelector(':scope > [slot="icon-trigger"]');if(e)e.removeAttribute("slot"),t.append(e),this.#C.push({icon:e,slot:"icon-trigger"});else{let i=document.createElement("icon-wc");i.setAttribute("name","volume-2"),i.setAttribute("aria-hidden","true"),t.append(i)}t.addEventListener("click",()=>this.#I()),this.append(t),this.#m=t,this.#z()}#z(){let t=document.createElement("div");t.setAttribute("data-text-reader-toolbar",""),t.setAttribute("role","group"),t.setAttribute("aria-label",this.#A("controls")),t.hidden=!0,bo()&&(t.popover="manual");let e=this.#E("play",this.#A("play"),"\u25B6");e.addEventListener("click",()=>this.play());let i=this.#E("pause",this.#A("pause"),"\u23F8");i.hidden=!0,i.addEventListener("click",()=>this.pause());let s=this.#E("stop",this.#A("stop"),"\u23F9");s.addEventListener("click",()=>this.stop());let n=this.#E("speed-down",this.#A("slower"),"\u2212");n.addEventListener("click",()=>this.#M(-.1));let o=document.createElement("span");o.setAttribute("data-speed-value","");let a=this.#Y(parseFloat(this.getAttribute("speed")??"1")||1);o.textContent=`${a}\xD7`;let l=this.#E("speed-up",this.#A("faster"),"+");l.addEventListener("click",()=>this.#M(.1)),this.#T("icon-play",e),this.#T("icon-pause",i),this.#T("icon-stop",s),t.append(e,i,s,n,o,l),this.append(t),this.#p=e,this.#d=i,this.#f=s,this.#g=o,this.#b=t,this.listen(document,"pointerdown",this.#B),this.listen(this,"keydown",this.#D)}#I(){if(!this.#l){this.play();return}this.#b?.hidden&&this.#N(),this.#o?this.resume():this.pause()}#N(){if(!this.#b||!this.#m)return;let t=this.#b;t.hidden=!1,t.popover&&!t.matches(":popover-open")&&t.showPopover(),t.style.visibility="hidden",requestAnimationFrame(()=>{this.#_(),t.style.visibility=""})}#$(){let t=this.#b;if(!t||t.hidden)return;let e=t.contains(document.activeElement);t.popover&&t.matches(":popover-open")&&t.hidePopover(),t.hidden=!0,e&&this.#m?.focus()}#_(){let t=this.#b,e=this.#m;if(!t||!e)return;let i=e.getBoundingClientRect(),s=t.offsetWidth,n=t.offsetHeight,o=8,a=8,l=i.top-n-o;l<a&&(l=i.bottom+o);let c=i.left+i.width/2-s/2,h=window.innerWidth-s-a;c=Math.max(a,Math.min(c,h)),t.style.top=`${l}px`,t.style.left=`${c}px`}#M(t){let e=parseFloat(this.getAttribute("speed")??"1")||1,i=this.#Y(e+t);this.setAttribute("speed",String(i))}#B=t=>{!this.#b||this.#b.hidden||this.#b.contains(t.target)||this.#m?.contains(t.target)||this.#$()};#D=t=>{t.key!=="Escape"||t.defaultPrevented||!this.#b||this.#b.hidden||this.contains(t.target)&&(t.preventDefault(),this.#$(),this.#m?.focus())};#F(){let t=this.getAttribute("for");if(!t){console.warn('<text-reader>: missing "for" attribute'),this.#j();return}if(this.#t=document.getElementById(t),!this.#t){console.warn(`<text-reader>: no element found with id="${t}"`),this.#j();return}this.#P(),this.#O()}#j(){this.#p&&(this.#p.disabled=!0),this.#f&&(this.#f.disabled=!0)}#O(){this.#p&&(this.#p.disabled=!1)}#P(){let t=this.#t;if(!t)return;let e=this.getAttribute("selectors")||"p,li",i=[...t.querySelectorAll(e)],s=o=>o.closest("pre")||o.closest("code")||o.closest(qs);this.#i=[];let n=0;for(let o of i){if(s(o))continue;let a=[],l="",c=document.createTreeWalker(o,NodeFilter.SHOW_TEXT,{acceptNode:h=>h.parentElement?.closest(qs)?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT});for(;c.nextNode();){let h=c.currentNode,u=h.data;u&&(a.push({node:h,start:l.length,end:l.length+u.length}),l+=u)}l.trim()&&(this.#i.push({element:o,text:l,speechStart:n,speechEnd:n+l.length,segments:a}),n+=l.length+1)}this.#s=this.#i.map(o=>o.text).join(" ")}#R(){return this.#t?.closest("[lang]")?.getAttribute("lang")||document.documentElement.lang||""}#G(t){if(!this.#s)return;let e=t>0?this.#s.slice(t):this.#s;if(!e.trim())return;let i=e.replace(/[<>]/g," "),s=new SpeechSynthesisUtterance(i),n=this.#R();n&&(s.lang=n),s.rate=this.#Y(parseFloat(this.#v?.value??this.getAttribute("speed")??"1")||1);let o=this.#k?.selectedOptions[0];if(o?.dataset.voiceUri){let a=speechSynthesis.getVoices().find(l=>l.voiceURI===o.dataset.voiceUri);a&&(s.voice=a)}else if(n){let a=xt(n),l=speechSynthesis.getVoices(),c=l.find(h=>h.lang.toLowerCase()===n.toLowerCase())||l.find(h=>xt(h.lang)===a&&h.default)||l.find(h=>xt(h.lang)===a);c&&(s.voice=c)}s.onboundary=a=>{if(this.#e!==s||a.name!=="word")return;let l=t+a.charIndex;this.#r=l;let c=a.charLength;if(!c){let u=this.#s.slice(l).match(/^\S+/);c=u?u[0].length:1}this.#Z(l,c),this.#V("text-reader:word",{word:this.#s.slice(l,l+c),charIndex:l,element:this.#Q(l)?.element})},s.onend=()=>{if(this.#e!==s)return;let a=Date.now()-this.#u;this.#J(),this.#V("text-reader:end",{duration:a})},s.onerror=a=>{if(this.#e===s){if(a.error==="interrupted"||a.error==="canceled"){this.#J(),this.#V("text-reader:stop");return}console.warn("<text-reader>: SpeechSynthesisUtterance error:",a.error),this.#J(),this.#V("text-reader:error",{error:a.error})}},this.#e=s,this.#l=!0,this.#o=!1,this.#u=Date.now(),this.#r=t,this.#nt(!0),speechSynthesis.cancel(),speechSynthesis.speak(s),this.#K(),this.#V("text-reader:play",{voice:s.voice?.name,speed:s.rate})}#q(){let t=this.#r;this.#e=null,speechSynthesis.cancel(),this.#H(),requestAnimationFrame(()=>this.#G(t))}#K(){this.#H(),this.#n=setInterval(()=>{if(!speechSynthesis.speaking){this.#H();return}speechSynthesis.pause(),speechSynthesis.resume()},1e4)}#H(){this.#n&&clearInterval(this.#n),this.#n=null}#U(){if(!CSS.highlights)return;let t=new CSSStyleSheet;t.replaceSync(`
1249
+ `,kt=null;function Ts(r){if("adoptedStyleSheets"in r&&typeof CSSStyleSheet=="function"&&"replaceSync"in CSSStyleSheet.prototype)return kt||(kt=new CSSStyleSheet,kt.replaceSync(Cs)),r.adoptedStyleSheets.includes(kt)||(r.adoptedStyleSheets=[...r.adoptedStyleSheets,kt]),null;let t=document.createElement("style");return t.textContent=Cs,t}Ce();var Me="http://www.w3.org/2000/svg",so={map:"Map","map-of":"Map of {name}",activate:"Activate interactive map",consent:"Load map","consent-note":"Loads map images from {host}","zoom-in":"Zoom in","zoom-out":"Zoom out",recenter:"Recenter map",exit:"Exit map",controls:"Map controls",instructions:"Drag or use the arrow keys to pan. Click a point to centre on it. Pinch, scroll, or press plus and minus to zoom. Home recentres. Escape exits.",moved:"Map centred on {lat}, {lng}, zoom {zoom}","error-coords":"Map location unavailable","error-tiles":"Map images failed to load"},ro=0;function no(){let r=document.createElement("div");r.setAttribute("part","marker"),r.setAttribute("aria-hidden","true");let t=document.createElementNS(Me,"svg");t.setAttribute("viewBox","0 0 24 36"),t.setAttribute("focusable","false");let e=document.createElementNS(Me,"path");e.setAttribute("class","pin"),e.setAttribute("d","M12 0C5.373 0 0 5.373 0 12c0 9 12 24 12 24s12-15 12-24C24 5.373 18.627 0 12 0z");let i=document.createElementNS(Me,"circle");return i.setAttribute("class","dot"),i.setAttribute("cx","12"),i.setAttribute("cy","12"),i.setAttribute("r","5"),t.append(e,i),r.append(t),r}function C(r,t={},e){let i=document.createElement(r);for(let[s,n]of Object.entries(t))i.setAttribute(s,n);return e!=null&&(i.textContent=e),i}function Rs(r){return!r||typeof r!="string"?!1:typeof CSS<"u"&&CSS.supports("color",r)}var Le=class extends b{static get observedAttributes(){return["lat","lng","zoom","marker","marker-color","provider","tile-url","interactive","static-only","src","place","label","attribution","attribution-href","loading"]}#t=null;#e=null;#i=0;#s=!1;#r=!1;#n=!1;#a=!1;#c=!1;#h=`geo-map-${++ro}`;#l=null;#o="";#u=new Map;#p="";#d=null;#f=0;#v=null;#y=null;#g=()=>this.#P();#w=0;#A="osm";constructor(){super(),this.attachShadow({mode:"open"})}get lat(){return parseFloat(this.getAttribute("lat")??"")}get lng(){return parseFloat(this.getAttribute("lng")??"")}get zoom(){let t=parseInt(this.getAttribute("zoom")??"",10);return t>=1&&t<=19?t:15}get showMarker(){return this.getAttribute("marker")!=="false"}get markerColor(){let t=this.getAttribute("marker-color");return Rs(t)?t:""}get provider(){let t=this.getAttribute("provider");return t&&(t in Y||t==="carto-auto")?t:"osm"}get tileUrl(){return this.getAttribute("tile-url")||""}get interactive(){let t=this.getAttribute("interactive");return t==="eager"||t==="none"?t:"click"}get staticOnly(){return this.hasAttribute("static-only")}get loading(){let t=this.getAttribute("loading");return t==="eager"||t==="consent"?t:"lazy"}get active(){return this.#t!==null}#m(t,e={}){return(this.getAttribute(`data-label-${t}`)??so[t]??"").replace(/\{(\w+)\}/g,(s,n)=>n in e?String(e[n]):s)}get#b(){return this.interactive!=="none"&&!this.staticOnly}get#S(){return this.loading==="consent"&&!this.#r}#x(){let t=this.provider;if(t!=="carto-auto")return t;let e=this.closest("[data-mode]")?.getAttribute("data-mode");return e==="dark"?"carto-dark":e==="light"?"carto-light":window.matchMedia?.("(prefers-color-scheme: dark)").matches?"carto-dark":"carto-light"}#T(){if(this.tileUrl)try{return new URL(this.tileUrl.replace(/\{s\}/g,"a"),location.href).origin}catch{return""}return(Y[this.#A]??Y.osm).origin}#E(){let t=parseFloat(this.getAttribute("lat")??""),e=parseFloat(this.getAttribute("lng")??"");if(!isNaN(t)&&!isNaN(e))return{lat:t,lng:e};let i=this.getAttribute("src");if(i){let a=this.#k(i);if(a)return a}let s=this.querySelector("address[data-lat][data-lng]");if(s){let a=parseFloat(s.dataset.lat??""),l=parseFloat(s.dataset.lng??"");if(!isNaN(a)&&!isNaN(l))return{lat:a,lng:l}}let n=this.getAttribute("place");if(n){let a=this.#M(n);if(a)return a}let o=document.querySelector('meta[name="geo.position"]');if(o){let l=(o.getAttribute("content")||"").split(";");if(l.length===2){let c=parseFloat(l[0]),h=parseFloat(l[1]);if(!isNaN(c)&&!isNaN(h))return{lat:c,lng:h}}}return null}#k(t){let e=document.getElementById(t);if(!e)return null;if(e.tagName==="ADDRESS"&&e.dataset.lat&&e.dataset.lng){let i=parseFloat(e.dataset.lat),s=parseFloat(e.dataset.lng);if(!isNaN(i)&&!isNaN(s))return{lat:i,lng:s}}return e.tagName==="SCRIPT"&&e.type==="application/ld+json"?this.#C(e):null}#M(t){let e=document.querySelectorAll('script[type="application/ld+json"]');for(let i of e)try{let s=JSON.parse(i.textContent);if(s.name===t){let n=s.geo;if(n){let o=parseFloat(n.latitude),a=parseFloat(n.longitude);if(!isNaN(o)&&!isNaN(a))return{lat:o,lng:a}}}}catch{}return null}#C(t){try{let i=JSON.parse(t.textContent).geo;if(i){let s=parseFloat(i.latitude),n=parseFloat(i.longitude);if(!isNaN(s)&&!isNaN(n))return{lat:s,lng:n}}}catch{}return null}#O(){let t=n=>(n||"").replace(/\s+/g," ").trim(),e=t(this.getAttribute("label"));if(e)return e;let i=t(this.querySelector("address")?.textContent),s=this.getAttribute("src");if(!i&&s){let n=document.getElementById(s);if(n?.tagName==="ADDRESS")i=t(n.textContent);else if(n?.tagName==="SCRIPT")try{i=t(JSON.parse(n.textContent||"").name)}catch{}}return i||(i=t(this.getAttribute("place"))),i?this.#m("map-of",{name:i}):this.#m("map")}setup(){if(this.#i++,this.#A=this.#x(),this.render(),this.#I(),this.#N(),this.#z(),this.interactive==="eager"&&!this.#n&&this.#b&&!this.#S&&this.#l){let t=this.#i;requestAnimationFrame(()=>{t===this.#i&&this.#B({focus:!1})})}}attributeChangedCallback(t,e,i){e===i||this.#s||!this.isConnected||!this.hasAttribute("data-upgraded")||this._reinit()}teardown(){this.#i++,this.#e=null,this.#t&&(this.#t.destroy(),this.#t=null,this.setState("active",!1)),this.#d?.disconnect(),this.#d=null,cancelAnimationFrame(this.#f),this.#v?.disconnect(),this.#v=null,this.#y?.removeEventListener("change",this.#g),this.#y=null,clearTimeout(this.#w)}#I(){typeof ResizeObserver=="function"&&(this.#d=new ResizeObserver(()=>{cancelAnimationFrame(this.#f),this.#f=requestAnimationFrame(()=>this.#z())}),this.#d.observe(this))}#N(){this.provider!=="carto-auto"||this.tileUrl||(this.#v=new MutationObserver(()=>this.#P()),this.#v.observe(document.documentElement,{attributes:!0,attributeFilter:["data-mode"]}),this.#y=window.matchMedia?.("(prefers-color-scheme: dark)")??null,this.#y?.addEventListener("change",this.#g))}#P(){this.#x()!==this.#A&&this._reinit()}get data(){return{lat:isNaN(this.lat)?void 0:this.lat,lng:isNaN(this.lng)?void 0:this.lng,zoom:this.zoom,marker:this.showMarker,markerColor:this.markerColor}}set data(t){if(!t||typeof t!="object")return;let e=this.data,i={...e};if(t.lat!=null&&!isNaN(Number(t.lat))&&(i.lat=Number(t.lat)),t.lng!=null&&!isNaN(Number(t.lng))&&(i.lng=Number(t.lng)),t.zoom!=null&&!isNaN(Number(t.zoom))&&(i.zoom=Number(t.zoom)),t.marker!=null&&(i.marker=!!t.marker),"markerColor"in t&&(Rs(t.markerColor)?i.markerColor=t.markerColor:t.markerColor||(i.markerColor="")),!(i.lat===e.lat&&i.lng===e.lng&&i.zoom===e.zoom&&i.marker===e.marker&&i.markerColor===e.markerColor)){this.#s=!0;try{i.lat!==e.lat&&this.setAttribute("lat",String(i.lat)),i.lng!==e.lng&&this.setAttribute("lng",String(i.lng)),i.zoom!==e.zoom&&this.setAttribute("zoom",String(i.zoom)),i.marker!==e.marker&&this.setAttribute("marker",i.marker?"true":"false"),i.markerColor!==e.markerColor&&(i.markerColor?this.setAttribute("marker-color",i.markerColor):this.removeAttribute("marker-color"))}finally{this.#s=!1}this.hasAttribute("data-upgraded")&&this._reinit(),this.dispatchEvent(new CustomEvent("geo-map:data-changed",{detail:{data:this.data,source:"property"},bubbles:!0,composed:!0}))}}get markers(){let t=this.#E();return t?[{lat:t.lat,lng:t.lng,color:this.markerColor}]:[]}render(){let t=this.shadowRoot,e=Ts(t);this.removeAttribute("data-ready"),this.#c=!1,this.#u=new Map,this.#p="",this.#l=this.#E(),this.#o=this.#O();let i=this.#l!==null,s=i&&this.#S,n=C("div",{part:"container"}),o=C("div",{part:"viewport",role:"img","aria-label":this.#o});if(o.append(C("div",{part:"tiles"})),this.showMarker&&i){let h=no();this.markerColor&&h.style.setProperty("--_marker-color",this.markerColor),o.append(h)}if(n.append(o),s){n.setAttribute("data-consent","");let h=C("div",{part:"overlay"}),u=C("button",{part:"activate",type:"button"},this.#m("consent")),p=this.#T().replace(/^https?:\/\//,""),d=C("p",{part:"consent-note"},this.#m("consent-note",{host:p}));h.append(u,d),h.addEventListener("click",()=>this.#F());let f=()=>this.#D();h.addEventListener("pointerenter",f,{once:!0}),u.addEventListener("focus",f,{once:!0}),n.append(h)}else if(i&&this.#b){let h=C("div",{part:"overlay"});h.append(C("button",{part:"activate",type:"button"},this.#m("activate"))),h.addEventListener("click",()=>this.#B({focus:!0})),n.append(h)}if(i&&this.#b){let h=C("div",{part:"controls",role:"group","aria-label":this.#m("controls")}),u=[["zoom-in","+",this.#m("zoom-in"),()=>this.#t?.zoomBy(1)],["zoom-out","\u2212",this.#m("zoom-out"),()=>this.#t?.zoomBy(-1)],["recenter","\u2316",this.#m("recenter"),()=>this.#t?.recenter()],["exit","\u2715",this.#m("exit"),()=>this.#R()]];for(let[p,d,f,m]of u){let y=C("button",{part:`control ${p}`,type:"button","aria-label":f,title:f},d);y.addEventListener("click",m),h.append(y)}n.append(h)}let a=C("div",{part:"caption"}),l=C("slot");a.append(l),n.append(a);let c=()=>{let h=l.assignedNodes().some(u=>u.nodeType===1||(u.textContent||"").trim());n.toggleAttribute("data-caption",h)};l.addEventListener("slotchange",c),n.toggleAttribute("data-caption",[...this.childNodes].some(h=>h.nodeType===1&&!h.hasAttribute("slot")||h.nodeType===3&&(h.textContent||"").trim())),n.append(this.#_()),n.append(C("p",{part:"instructions",id:`${this.#h}-help`,hidden:""},this.#m("instructions"))),n.append(C("p",{part:"status",role:"status","aria-live":"polite"})),t.replaceChildren(...e?[e]:[],n),i||this.handleError("Missing or invalid lat/lng coordinates",this.#m("error-coords"))}#_(){let t=C("div",{part:"attribution"}),e=C("slot",{name:"attribution"}),i;if(this.tileUrl){let n=(this.getAttribute("attribution")||"").trim(),o=this.getAttribute("attribution-href")||"";i=n?[{text:n,href:o}]:[]}else i=(Y[this.#A]??Y.osm).credits;i.forEach((n,o)=>{o&&e.append(document.createTextNode(" "));let a="";if(n.href)try{let l=new URL(n.href,location.href);(l.protocol==="https:"||l.protocol==="http:")&&(a=l.href)}catch{}e.append(a?C("a",{href:a,target:"_blank",rel:"noopener noreferrer"},n.text):C("span",{},n.text))});let s=()=>{t.hidden=i.length===0&&e.assignedNodes().length===0};return e.addEventListener("slotchange",s),t.hidden=i.length===0&&!this.querySelector(':scope > [slot="attribution"]'),t.append(e),t}#L(){let t=this.shadowRoot;return{container:t.querySelector('[part="container"]'),viewport:t.querySelector('[part="viewport"]'),tiles:t.querySelector('[part="tiles"]'),marker:t.querySelector('[part="marker"]'),status:t.querySelector('[part="status"]')}}#z(){let t=this.clientWidth,e=this.clientHeight;if(this.#t){this.#t.resize(t,e);return}if(!this.#l||this.#S||!t||!e)return;let i=`${t}x${e}`;i!==this.#p&&(this.#p=i,this.loadTiles(t,e))}loadTiles(t=this.clientWidth,e=this.clientHeight){let{tiles:i}=this.#L();if(!i||!this.#l||!t||!e)return;let s=this.zoom,{lat:n,lng:o}=this.#l,a=ct(n,o,s),l=Math.pow(2,s),c=a.x-t/2,h=a.y-e/2,u=Math.floor(c/256),p=Math.floor((c+t-1)/256),d=Math.max(0,Math.floor(h/256)),f=Math.min(l-1,Math.floor((h+e-1)/256));i.style.transform=`translate(${Math.round(u*256-c)}px, ${Math.round(d*256-h)}px)`;let m=new Set;for(let y=d;y<=f;y++)for(let w=u;w<=p;w++){let A=`${w}/${y}`;m.add(A);let k=this.#u.get(A);if(!k){let L=(w%l+l)%l;k=document.createElement("img"),k.alt="",k.loading=this.loading==="eager"?"eager":"lazy",k.decoding="async",k.draggable=!1,k.addEventListener("load",()=>this.#j()),k.addEventListener("error",()=>this.#j()),k.src=Ft(this.#A,s,L,y,this.tileUrl),this.#u.set(A,k),i.append(k)}k.style.left=`${(w-u)*256}px`,k.style.top=`${(y-d)*256}px`}for(let[y,w]of this.#u)m.has(y)||(w.remove(),this.#u.delete(y));this.#j()}#j(){if(this.#c||this.#t||!this.#l||this.#u.size===0)return;let t=[...this.#u.values()];if(t.every(e=>e.complete)){if(this.#c=!0,t.every(e=>e.naturalWidth===0)){this.handleError("Failed to load map tiles",this.#m("error-tiles"));return}this.setAttribute("data-ready",""),this.dispatchEvent(new CustomEvent("geo-map:ready",{bubbles:!0,detail:{lat:this.#l.lat,lng:this.#l.lng,zoom:this.zoom}}))}}#F(){this.#r=!0,this._reinit(),this.#b&&this.#B({focus:!0})}#D(){if(this.#a)return;this.#a=!0;let t=this.#T();if(!t||t===location.origin||document.head.querySelector(`link[rel~="preconnect" i][href="${CSS.escape(t)}"]`))return;let e=document.createElement("link");e.rel="preconnect",e.href=t,document.head.appendChild(e)}#B({focus:t=!0}={}){if(this.#t)return Promise.resolve();if(this.#e)return this.#e;if(!this.#l||!this.#b||this.#S)return Promise.resolve();let e=this.#i,i=(async()=>{let{MapInteraction:s}=await Promise.resolve().then(()=>(_s(),Ls));if(!this.isConnected||e!==this.#i||this.#t||!this.#l)return;let{container:n,viewport:o,tiles:a,marker:l}=this.#L();if(!n||!o||!a)return;for(let u of this.#u.values())u.remove();this.#u.clear(),n.setAttribute("data-active",""),o.setAttribute("role","region"),o.setAttribute("aria-roledescription","map"),o.setAttribute("aria-describedby",`${this.#h}-help`),o.setAttribute("tabindex","0"),this.setState("active",!0);let{lat:c,lng:h}=this.#l;this.#t=new s({host:this,viewport:o,tiles:a,marker:l,lat:c,lng:h,zoom:this.zoom,provider:this.#A,tileUrl:this.tileUrl,width:this.clientWidth,height:this.clientHeight,onDeactivate:()=>this.#R(),onMove:u=>this.#$(u)}),t&&o.focus({preventScroll:!0}),this.dispatchEvent(new CustomEvent("geo-map:activate",{bubbles:!0,detail:{lat:c,lng:h,zoom:this.zoom}}))})();return this.#e=i,i.finally(()=>{this.#e===i&&(this.#e=null)}),i}#$(t){clearTimeout(this.#w),this.#w=window.setTimeout(()=>{let{status:e}=this.#L();e&&(e.textContent=this.#m("moved",{lat:t.lat.toFixed(4),lng:t.lng.toFixed(4),zoom:t.zoom}))},400)}#R(){if(!this.#t)return;let t=!!this.shadowRoot?.activeElement;this.#n=!0,this._reinit(),t&&this.shadowRoot?.querySelector('[part="activate"]')?.focus()}handleError(t,e=t){let{container:i}=this.#L();i&&(i.setAttribute("data-state","error"),i.setAttribute("data-error",e)),this.dispatchEvent(new CustomEvent("geo-map:error",{bubbles:!0,detail:{message:t}}))}};g("geo-map",Le);var Ns="popover"in HTMLElement.prototype;var zs=null;function mo(){return zs??=Promise.resolve().then(()=>(Re(),_e)),zs}var go=150,Bs="vb-emoji-recent",ht=8,Ds=4,bo=0,yo={Trigger:"Open emoji picker",Dialog:"Emoji picker",Search:"Search emoji",Placeholder:"Search emoji\u2026",Categories:"Emoji categories",Emoji:"Emoji",Recent:"Recently used",Empty:"No emoji found",Results:"{count} emoji found"},Ne=class extends b{#t=null;#e;#i;#s;#r;#n;#a;#c;#h=new Map;#l=new WeakMap;#o=null;#u=!1;#p=!1;#d=!1;#f=!1;#v=-1;#y=0;#g=null;#w;#A=()=>{};#m=null;#b="";#S=null;#x=null;#T=new Set;#E=!1;#k=null;#M=null;constructor(){super(),this.#w=new Promise(t=>{this.#A=t})}get ready(){return this.#w}get isOpen(){return this.#u}setup(){if(this.#d)return!1;this.#d=!0,this.#I(),this.listen(this,"click",this.#rt),this.listen(this,"keydown",this.#nt),this.listen(this,"focusout",this.#st),this.listen(this,"focusin",this.#tt);let t=++this.#y;return mo().then(e=>{if(t!==this.#y||!this.isConnected)return;this.#S=e,this.#p||this.#N(),this.listen(document,"click",this.#it),this.listen(document,e.EXTENDED_EVENT,this.#J),this.setAttribute("data-upgraded",""),this.#A(),queueMicrotask(()=>{this.dispatchEvent(new CustomEvent("emoji-picker:upgraded",{bubbles:!0}))});let i=this.#g;this.#g=null,i==="open"&&this.open()}).catch(e=>{console.error("[emoji-picker] failed to load emoji data",e)}),!1}teardown(){this.#y++,this.#d=!1,this.#g=null,this.#m&&(clearTimeout(this.#m),this.#m=null,this.setState("search-pending",!1)),this.#u&&this.close()}#C(t,e){return this.dataset[`label${t}`]||e||yo[t]||""}#O(t){if(t==="recent")return this.#C("Recent");let e=t.charAt(0).toUpperCase()+t.slice(1);return this.#C(e,this.#S.EMOJI_GROUP_LABELS[t]||t)}#I(){let t=this.querySelector(":scope > [data-trigger]")||this.querySelector(":scope > button");t||(t=document.createElement("button"),t.type="button",t.textContent="\u{1F600}",t.setAttribute("data-trigger",""),this.prepend(t)),this.#t=t,t.setAttribute("aria-haspopup","dialog"),t.setAttribute("aria-expanded",String(this.#u)),!t.hasAttribute("aria-label")&&!/\p{L}/u.test(t.textContent||"")&&t.setAttribute("aria-label",this.#C("Trigger"))}#N(){let t=`emoji-picker-${++bo}`;this.#e=document.createElement("div"),this.#e.className="picker",this.#e.id=`${t}-panel`,this.#e.setAttribute("role","dialog"),this.#e.setAttribute("aria-label",this.#C("Dialog")),this.#e.hidden=!0,this.#E=Ns,this.#E&&this.#e.setAttribute("popover","manual"),this.#t?.setAttribute("aria-controls",this.#e.id),this.#i=document.createElement("input"),this.#i.type="search",this.#i.placeholder=this.#C("Placeholder"),this.#i.autocomplete="off",this.#i.spellcheck=!1,this.#i.setAttribute("aria-label",this.#C("Search")),this.#i.setAttribute("aria-controls",`${t}-listbox`),this.#i.addEventListener("input",this.#Y),this.#s=document.createElement("div"),this.#s.className="categories",this.#s.setAttribute("role","toolbar"),this.#s.setAttribute("aria-label",this.#C("Categories")),this.#S.EMOJI_GROUPS.forEach((e,i)=>{let s=document.createElement("button");s.type="button",s.dataset.group=e,s.tabIndex=i===0?0:-1,s.setAttribute("aria-label",this.#O(e)),s.title=this.#O(e),s.textContent=this.#S.EMOJI_GROUP_ICONS[e],this.#s.appendChild(s)}),this.#r=document.createElement("div"),this.#r.className="grid",this.#r.id=`${t}-listbox`,this.#r.setAttribute("role","listbox"),this.#r.setAttribute("aria-label",this.#C("Emoji")),this.#c=this.#P("recent"),this.#r.appendChild(this.#c);for(let e of this.#S.EMOJI_GROUPS){let i=this.#P(e);this.#h.set(e,i),this.#r.appendChild(i)}this.#n=document.createElement("p"),this.#n.className="no-results",this.#n.textContent=this.#C("Empty"),this.#n.hidden=!0,this.#a=document.createElement("p"),this.#a.className="status",this.#a.setAttribute("role","status"),this.#e.append(this.#i,this.#s,this.#r,this.#n,this.#a),this.appendChild(this.#e),this.#z(),this.#p=!0}#P(t){let e=document.createElement("div");return e.className="group",e.dataset.group=t,e.setAttribute("role","group"),e.setAttribute("aria-label",this.#O(t)),e}#_(t){let e=document.createElement("span");return e.className="group-label",e.setAttribute("aria-hidden","true"),e.textContent=this.#O(t),e}#L(t){let e=document.createElement("button");return e.type="button",e.setAttribute("role","option"),e.setAttribute("aria-selected","false"),e.tabIndex=-1,e.dataset.shortcode=t.shortcode,e.setAttribute("aria-label",t.name),e.title=`:${t.shortcode}:`,e.textContent=t.emoji,e}#z(){let t=new Map;for(let e of this.#S.EMOJI_GROUPS){let i=this.#h.get(e),s=[this.#_(e)];for(let n of this.#S.getByGroup(e)){let o=t.get(n.emoji);if(o){o.aliases.push(n.shortcode);continue}let a=this.#L(n),l={entry:n,aliases:[]};t.set(n.emoji,l),this.#l.set(a,l),s.push(a)}i.replaceChildren(...s)}this.#v=this.#S.extendedCount(),this.#R(null,!1)}#j(){let t=[];for(let e of this.#ct()){let i=this.#S.resolveEmoji(e);if(!i)continue;let s=this.#L(i);this.#l.set(s,{entry:i,aliases:[]}),t.push(s)}t.length&&t.unshift(this.#_("recent")),this.#c.replaceChildren(...t),this.#R(null,!1)}#F(t,e){let{entry:i,aliases:s}=t;return i.shortcode.includes(e)||i.name.toLowerCase().includes(e)||(i.keywords?.some(n=>n.includes(e))??!1)||s.some(n=>n.includes(e))}#D(){let t=this.#b.toLowerCase(),e=0;this.#c.hidden=!!t||this.#c.childElementCount===0;for(let i of this.#h.values()){let s=!1;for(let n of i.querySelectorAll('[role="option"]')){let o=this.#l.get(n),a=!t||(o?this.#F(o,t):!1);n.hidden=!a,a&&(s=!0,e++)}i.hidden=!s}this.#n.hidden=e>0,this.#a.textContent=t?e>0?this.#C("Results").replace("{count}",String(e)):this.#C("Empty"):"",(!this.#o||!this.#B(this.#o))&&this.#R(this.#$()[0]??null,!1)}#B(t){return t.isConnected&&!t.hidden&&!t.parentElement.hidden}#$(){return[...this.#r.querySelectorAll('[role="option"]')].filter(t=>this.#B(t))}#R(t,e){this.#o&&this.#o!==t&&(this.#o.tabIndex=-1,this.#o.setAttribute("aria-selected","false")),this.#o=t,t&&(t.tabIndex=0,t.setAttribute("aria-selected","true"),e&&(t.focus({preventScroll:!0}),t.scrollIntoView({block:"nearest"})))}#G(t,e){if(t){for(let i of this.#s.querySelectorAll("button"))i.tabIndex=i===t?0:-1;e&&t.focus()}}#q(t){let e;for(let i of this.#s.querySelectorAll("button"))i.dataset.group===t?(i.setAttribute("aria-current","true"),e=i):i.removeAttribute("aria-current");e&&!this.#s.contains(document.activeElement)&&this.#G(e,!1)}#K(){if(this.#x?.disconnect(),this.#T.clear(),!(typeof IntersectionObserver>"u")){this.#x=new IntersectionObserver(t=>{for(let i of t)i.isIntersecting?this.#T.add(i.target):this.#T.delete(i.target);let e=[...this.#r.children].find(i=>this.#T.has(i));this.#q(e?.dataset.group)},{root:this.#r,rootMargin:"-2px 0px -75% 0px"});for(let t of this.#r.children)this.#x.observe(t)}}#H(){return getComputedStyle(this).direction==="rtl"}#U(t,e,i){let s=t[e].getBoundingClientRect(),n=s.left+s.width/2,o=null,a=null,l=1/0;for(let c=e+i;c>=0&&c<t.length;c+=i){let h=t[c].getBoundingClientRect();if(o===null){if(Math.abs(h.top-s.top)<=Ds)continue;o=h.top}else if(Math.abs(h.top-o)>Ds)break;let u=Math.abs(h.left+h.width/2-n);u<l&&(l=u,a=t[c])}return a}#W(t,e){let i=this.#$(),s=i.indexOf(t);if(s<0)return!1;let n=this.#H(),o=null;switch(e){case"ArrowRight":o=i[n?s-1:s+1];break;case"ArrowLeft":o=i[n?s+1:s-1];break;case"ArrowDown":o=this.#U(i,s,1);break;case"ArrowUp":if(o=this.#U(i,s,-1),!o)return this.#i.focus(),!0;break;case"Home":o=i[0];break;case"End":o=i[i.length-1];break;case"PageDown":{o=i.slice(s+1).find(l=>l.parentElement!==t.parentElement)??i[i.length-1];break}case"PageUp":{let a=i.find(l=>l.parentElement===t.parentElement);if(a&&a!==t)o=a;else{let l=i[s-1]?.parentElement;o=l?i.find(c=>c.parentElement===l):i[0]}break}default:return!1}return o&&this.#R(o,!0),!0}#Z(t,e){let i=[...this.#s.querySelectorAll("button")],s=i.indexOf(t),n=this.#H(),o=-1;if(e==="ArrowRight")o=n?s-1:s+1;else if(e==="ArrowLeft")o=n?s+1:s-1;else if(e==="Home")o=0;else if(e==="End")o=i.length-1;else return!1;return o=(o+i.length)%i.length,this.#G(i[o],!0),!0}#et(){let t=this.getAttribute("for");return t?document.getElementById(t):null}#Q(){let t=this.#et();if(this.#k=null,this.#M=null,!!t){if(t instanceof HTMLInputElement||t instanceof HTMLTextAreaElement){let e=null,i=null;try{e=t.selectionStart,i=t.selectionEnd}catch{}e!==null&&i!==null&&(this.#k={start:e,end:i})}else if(t.isContentEditable){let e=window.getSelection();if(e&&e.rangeCount>0){let i=e.getRangeAt(0);t.contains(i.commonAncestorContainer)&&(this.#M=i.cloneRange())}}}}#rt=t=>{let e=t.target.closest?.("button");if(!(!e||!this.contains(e))){if(e===this.#t){this.toggle();return}this.#p&&(e.parentElement===this.#s?this.#X(e):e.getAttribute("role")==="option"&&this.#V(e))}};#it=t=>{this.#u&&!this.contains(t.target)&&this.close()};#st=t=>{if(!this.#u||this.#f)return;let e=t.relatedTarget;e&&!this.contains(e)&&this.close()};#tt=t=>{let e=t.target;e.getAttribute?.("role")==="option"&&e!==this.#o&&this.#R(e,!1)};#nt=t=>{if(!this.#u)return;if(t.key==="Escape"){t.preventDefault(),t.stopPropagation(),this.close(),this.#t?.focus();return}let e=t.target;if(t.altKey||t.metaKey)return;let i=!1;if(e===this.#i){if(t.key==="ArrowDown"){let s=this.#o&&this.#B(this.#o)?this.#o:this.#$()[0];s&&this.#R(s,!0),i=!0}}else e.parentElement===this.#s?i=this.#Z(e,t.key):e.getAttribute("role")==="option"&&(i=this.#W(e,t.key));i&&t.preventDefault()};#Y=()=>{this.#m&&clearTimeout(this.#m),this.setState("search-pending",!0),this.#m=setTimeout(()=>{this.#m=null,this.setState("search-pending",!1),this.#b=this.#i.value.trim(),this.#D(),this.#r.scrollTop=0},go)};#J=()=>{this.#u&&(this.#z(),this.#D(),this.#K())};#X(t){let e=t.dataset.group||"";this.#b&&(this.#m&&(clearTimeout(this.#m),this.#m=null),this.setState("search-pending",!1),this.#i.value="",this.#b="",this.#D()),this.#G(t,!1),this.#q(e);let i=this.#h.get(e);if(!i)return;let s=matchMedia("(prefers-reduced-motion: reduce)").matches;this.#r.scrollTo({top:i.offsetTop,behavior:s?"auto":"smooth"});let n=i.querySelector('[role="option"]:not([hidden])');n&&this.#R(n,!1)}#V(t){let e=this.#l.get(t);if(!e)return;let{entry:i}=e;this.#R(t,!1),this.#f=!0;try{this.#ut(i.shortcode);let s=this.#at(i.emoji);this.dispatchEvent(new CustomEvent("emoji-picker:select",{bubbles:!0,detail:{shortcode:i.shortcode,emoji:i.emoji,name:i.name,keywords:i.keywords}})),this.close(),s||this.#t?.focus()}finally{this.#f=!1}}#at(t){let e=this.#et();if(!e)return!1;if(e instanceof HTMLInputElement||e instanceof HTMLTextAreaElement){e.focus();let i=this.#k;if(i)try{e.setSelectionRange(i.start,i.end)}catch{}if(!this.#lt(t)){let s=e.value.length;try{e.setRangeText(t,i?.start??s,i?.end??s,"end")}catch{e.value+=t}e.dispatchEvent(new InputEvent("input",{bubbles:!0,inputType:"insertText",data:t}))}try{let s=e.selectionEnd;this.#k=s===null?null:{start:s,end:s}}catch{this.#k=null}return!0}if(e.isContentEditable){e.focus();let i=window.getSelection();if(!i)return!0;let s=this.#M;if((!s||!e.contains(s.commonAncestorContainer))&&(s=document.createRange(),s.selectNodeContents(e),s.collapse(!1)),i.removeAllRanges(),i.addRange(s),!this.#lt(t)){let n=i.getRangeAt(0);n.deleteContents();let o=document.createTextNode(t);n.insertNode(o),n.setStartAfter(o),n.collapse(!0),i.removeAllRanges(),i.addRange(n),e.dispatchEvent(new InputEvent("input",{bubbles:!0,inputType:"insertText",data:t}))}return this.#M=i.rangeCount?i.getRangeAt(0).cloneRange():null,!0}return!1}#lt(t){try{return document.execCommand("insertText",!1,t)}catch{return!1}}#ct(){try{let t=JSON.parse(localStorage.getItem(Bs)||"[]");return Array.isArray(t)?t:[]}catch{return[]}}#ut(t){let e=parseInt(this.getAttribute("recent-limit")??"24",10)||24,i=this.#ct();i=i.filter(s=>s!==t),i.unshift(t),i.length>e&&(i.length=e);try{localStorage.setItem(Bs,JSON.stringify(i))}catch{}}#ht(){if(!this.#E||!this.#u||!this.#t)return;let t=this.#t.getBoundingClientRect(),e=this.#e.offsetWidth,i=this.#e.offsetHeight,s=document.documentElement.clientWidth,n=document.documentElement.clientHeight,o=this.#H()?t.right-e:t.left;o=Math.max(ht,Math.min(o,s-e-ht));let a=t.bottom+4;a+i>n-ht&&t.top-i-4>=ht&&(a=t.top-i-4),a=Math.max(ht,Math.min(a,n-i-ht)),this.#e.style.setProperty("--picker-top",`${Math.round(a)}px`),this.#e.style.setProperty("--picker-left",`${Math.round(o)}px`)}#ot=t=>{t.type==="scroll"&&this.#e.contains(t.target)||this.#ht()};open(){if(!this.#p){this.#g="open";return}if(!(this.#u||!this.isConnected)){if(this.#Q(),this.#S.extendedCount()!==this.#v&&this.#z(),this.#j(),this.#i.value="",this.#b="",this.#D(),this.#u=!0,this.setAttribute("open",""),this.#t?.setAttribute("aria-expanded","true"),this.#e.hidden=!1,this.#E){try{this.#e.showPopover()}catch{}this.#ht(),window.addEventListener("scroll",this.#ot,{capture:!0,passive:!0}),window.addEventListener("resize",this.#ot,{passive:!0})}this.#r.scrollTop=0,this.#K(),this.#i.focus(),this.dispatchEvent(new CustomEvent("emoji-picker:open",{bubbles:!0}))}}close(){if(!this.#p){this.#g=null;return}if(this.#u){if(this.#u=!1,this.removeAttribute("open"),this.#t?.setAttribute("aria-expanded","false"),this.#E){try{this.#e.hidePopover()}catch{}window.removeEventListener("scroll",this.#ot,{capture:!0}),window.removeEventListener("resize",this.#ot)}this.#e.hidden=!0,this.#x?.disconnect(),this.#x=null,this.dispatchEvent(new CustomEvent("emoji-picker:close",{bubbles:!0}))}}toggle(){if(!this.#p){this.#g=this.#g==="open"?null:"open";return}this.#u?this.close():this.open()}};g("emoji-picker",Ne);var ut="data-drag-surface-controls",vo="data-drag-surface-live",U="data-drag-surface-description",wo="Press Space or Enter to grab, then use the arrow keys to move",$e=class r extends b{static observedAttributes=["disabled","data-move-controls","orientation","group","aria-label","data-label-instructions"];#t=null;#e=null;#i=null;#s=null;#r=null;setup(){this.setAttribute("role","list"),r.#U.add(this),this.#l(),this.#u(),this.#A(),this.listen(this,"click",this.#I.bind(this)),this.#n(),this.#h(),this.#r=new MutationObserver(()=>this.#c()),this.#r.observe(this,{childList:!0}),r.#M()}teardown(){this.#r?.disconnect(),this.#r=null,this.#t&&(this.#t.remove(),this.#t=null),this.#e&&this.#k(this.#e,!1),this.#e=null,this.#i=null,this.removeAttribute("data-reorder-mode"),this.removeAttribute("data-drag-over"),this.#H(),this.#C();for(let t of this.querySelectorAll(`:scope > [${U}]`))t.removeAttribute("aria-description"),t.removeAttribute(U);r.#U.delete(this),r.#W?.source===this&&(r.#W=null),r.#M()}attributeChangedCallback(t,e,i){e===i||!this.hasAttribute("data-upgraded")||(t==="disabled"&&this.#h(),this.#n(),r.#M())}get draggableChildren(){return[...this.querySelectorAll(':scope > [draggable="true"]')]}get group(){return this.getAttribute("group")||null}get orientation(){return this.getAttribute("orientation")==="horizontal"?"horizontal":"vertical"}get disabled(){return this.hasAttribute("disabled")}set disabled(t){this.toggleAttribute("disabled",!!t)}get sortedOrder(){return this.draggableChildren.map(t=>t.dataset.id)}#n(){for(let t of this.draggableChildren)t.getAttribute("role")||t.setAttribute("role","listitem"),t.hasAttribute("tabindex")||t.setAttribute("tabindex","0"),t!==this.#e&&this.#a(t)}#a(t){let e=t.hasAttribute(U);if(!e&&(t.hasAttribute("aria-description")||t.hasAttribute("aria-describedby")))return;if(this.disabled){e&&(t.removeAttribute("aria-description"),t.removeAttribute(U));return}let i=this.dataset.labelInstructions||wo;t.getAttribute("aria-description")!==i&&t.setAttribute("aria-description",i),e||t.setAttribute(U,"")}#c(){this.#n(),this.#e&&this.#e.parentElement!==this&&(this.#k(this.#e,!1),this.#e=null,this.#i=null,this.removeAttribute("data-reorder-mode")),r.#M()}#h(){this.disabled?(this.setAttribute("aria-disabled","true"),this.#e&&this.#E()):this.removeAttribute("aria-disabled")}#l(){let t=document.createElement("span");t.setAttribute(vo,""),t.setAttribute("role","status"),t.setAttribute("aria-live","polite"),t.setAttribute("aria-atomic","true"),this.after(t),this.#t=t}#o(t){let e=this.#t;e&&(e.textContent="",requestAnimationFrame(()=>{e.textContent=t}))}#u(){this.listen(this,"pointerdown",t=>{this.#s=t.target}),this.listen(this,"dragstart",this.#p.bind(this)),this.listen(this,"dragover",this.#f.bind(this)),this.listen(this,"dragleave",this.#v.bind(this)),this.listen(this,"drop",this.#y.bind(this)),this.listen(this,"dragend",this.#g.bind(this))}#p(t){let e=t.target.closest('[draggable="true"]');if(!e||e.parentElement!==this)return;if(this.disabled){t.preventDefault();return}let i=e.querySelector("[data-drag-handle]");if(i&&!i.contains(this.#s)){t.preventDefault();return}e.setAttribute("data-dragging",""),t.dataTransfer.effectAllowed="move",t.dataTransfer.setData("text/plain",e.dataset.id||""),t.dataTransfer.setData("application/x-drag-surface-group",this.group||"");let s=this.#B(e);r.#W={item:e,source:this,originalIndex:s},this.dispatchEvent(new CustomEvent("drag-surface:reorder-start",{bubbles:!0}))}#d(t){return this.disabled?!1:this.group||t.group?this.group===t.group:t===this}#f(t){let e=r.#W;!e||!this.#d(e.source)||(t.preventDefault(),t.dataTransfer.dropEffect="move",this.setAttribute("data-drag-over",""),this.#K(t.clientX,t.clientY))}#v(t){t.relatedTarget&&!this.contains(t.relatedTarget)&&(this.removeAttribute("data-drag-over"),this.#H())}#y(t){let e=r.#W;if(!e||!this.#d(e.source))return;t.preventDefault();let{item:i,source:s,originalIndex:n}=e,o=this.#q(t.clientX,t.clientY);r.#w(),s===this?(this.#$(i,o),this.#R(),this.#L(i),this.#P(i,n)):(this.#$(i,o),this.#R(),s.#R(),this.#L(i),this.#_(i,s))}#g(){let t=r.#W;r.#w(),r.#W=null,(t?.source??this).dispatchEvent(new CustomEvent("drag-surface:reorder-end",{bubbles:!0}))}static#w(){r.#W?.item.removeAttribute("data-dragging");for(let t of r.#U)t.removeAttribute("data-drag-over"),t.#H()}#A(){this.listen(this,"keydown",this.#b.bind(this)),this.listen(this,"focusout",this.#S.bind(this))}#m(t){let e=t.closest('[draggable="true"]');if(!e||e.parentElement!==this)return null;if(t===e)return e;let i=e.querySelector("[data-drag-handle]");return i&&i===t?e:null}#b(t){let e=this.#m(t.target);if(!e||this.disabled||t.altKey||t.ctrlKey||t.metaKey)return;let i=t.target,s=this.#e===e,n=this.orientation==="horizontal",o=this.#j(),a=n?o?"ArrowRight":"ArrowLeft":"ArrowUp",l=n?o?"ArrowLeft":"ArrowRight":"ArrowDown";if(t.key===" "||t.key==="Enter"){t.preventDefault(),s?this.#T(e):this.#x(e);return}if(t.key===a||t.key===l){t.preventDefault();let u=this.draggableChildren,p=u.indexOf(e),d=t.key===a?Math.max(0,p-1):Math.min(u.length-1,p+1);if(d===p)return;if(!s){u[d].focus();return}this.#$(e,d),i.focus(),this.#o(`Position ${d+1} of ${u.length}`);return}let c=n?"ArrowUp":"ArrowLeft",h=n?"ArrowDown":"ArrowRight";if(s&&(t.key===c||t.key===h)){t.preventDefault();let u=this.#z(t.key===h?1:-1);if(!u)return;this.#e=null,this.#i=null,this.removeAttribute("data-reorder-mode"),this.#N(u,e),i.focus(),u.#e=e,u.#i=u.#B(e),u.setAttribute("data-reorder-mode",""),u.#o(`Moved to ${u.#F()}`);return}t.key==="Escape"&&(t.preventDefault(),s?this.#E():e.blur())}#S(){setTimeout(()=>{let t=this.#e;t&&!t.contains(document.activeElement)&&this.#E()},0)}#x(t){this.#e&&this.#e!==t&&this.#E(),this.#i=this.#B(t),this.#e=t,this.#k(t,!0),this.setAttribute("data-reorder-mode","");let e=this.draggableChildren.length;this.#o(`${this.#D(t)}, grabbed. Position ${this.#i+1} of ${e}. Use arrow keys to move, Enter to drop, Escape to cancel.`),this.dispatchEvent(new CustomEvent("drag-surface:reorder-start",{bubbles:!0}))}#T(t){let e=this.#i;this.#e=null,this.#i=null,this.#k(t,!1),this.removeAttribute("data-reorder-mode"),this.#R(),this.#L(t);let i=this.#B(t);this.#o(`${this.#D(t)}, dropped at position ${i+1} of ${this.draggableChildren.length}`),this.#P(t,e),this.dispatchEvent(new CustomEvent("drag-surface:reorder-end",{bubbles:!0}))}#E(){let t=this.#e;if(!t)return;let e=this.#i;if(this.#e=null,this.#i=null,this.#k(t,!1),this.removeAttribute("data-reorder-mode"),e!=null&&t.parentElement===this&&this.#B(t)!==e){let i=t.contains(document.activeElement)?document.activeElement:null;this.#$(t,e),i?.focus()}this.#o("Reorder cancelled"),this.dispatchEvent(new CustomEvent("drag-surface:reorder-end",{bubbles:!0}))}#k(t,e){t.toggleAttribute("data-grabbed",e);let i=t.querySelector("[data-drag-handle]");if(i&&(i.localName==="button"||i.getAttribute("role")==="button")&&i.setAttribute("aria-pressed",String(e)),e)(t.hasAttribute(U)||!(t.hasAttribute("aria-description")||t.hasAttribute("aria-describedby")))&&(t.setAttribute("aria-description","Grabbed"),t.setAttribute(U,""));else{let s=t.parentElement;s instanceof r?s.#a(t):t.hasAttribute(U)&&(t.removeAttribute("aria-description"),t.removeAttribute(U))}}static#M(){for(let t of r.#U)t.#O()}#C(){for(let t of this.querySelectorAll(`:scope > [draggable="true"] > [${ut}]`))t.remove()}#O(){if(!this.isConnected)return;if(!this.hasAttribute("data-move-controls")){this.#C();return}let t=this.draggableChildren,e=this.orientation==="horizontal",i=this.#j(),s=this.disabled,n=this.#z(-1),o=this.#z(1),a=e?i?"right":"left":"up",l=e?i?"left":"right":"down",c={up:"\u2191",down:"\u2193",left:"\u2190",right:"\u2192"},h=e?c.up:c.left,u=e?c.down:c.right;t.forEach((p,d)=>{let f=p.querySelector(`:scope > [${ut}]`);if(!f){f=document.createElement("span"),f.setAttribute(ut,"");for(let w of["prev","next","to-prev","to-next"]){let A=document.createElement("button");A.type="button",A.className="ghost small",A.dataset.move=w,f.append(A)}p.append(f)}let m=this.#D(p),y=(w,A,k,L,j=!1)=>{let N=f.querySelector(`[data-move="${w}"]`);N.textContent!==A&&(N.textContent=A),N.setAttribute("aria-label",k),N.setAttribute("aria-disabled",String(L)),N.hidden=j};y("prev",c[a],`Move ${m} ${a}`,s||d===0),y("next",c[l],`Move ${m} ${l}`,s||d===t.length-1),y("to-prev",h,n?`Move ${m} to ${n.#F()}`:"",s,!n),y("to-next",u,o?`Move ${m} to ${o.#F()}`:"",s,!o)})}#I(t){let e=t.target.closest(`[${ut}] > button[data-move]`);if(!e)return;let i=e.closest('[draggable="true"]');if(!i||i.parentElement!==this||(t.preventDefault(),this.disabled||e.getAttribute("aria-disabled")==="true"))return;this.#e&&(this.#k(this.#e,!1),this.#e=null,this.#i=null,this.removeAttribute("data-reorder-mode"));let s=e.dataset.move,n=this;if(s==="prev"||s==="next"){let a=this.#B(i),l=a+(s==="prev"?-1:1);if(l<0||l>=this.draggableChildren.length)return;this.#$(i,l),this.#R(),this.#L(i),this.#o(`${this.#D(i)}, moved to position ${l+1} of ${this.draggableChildren.length}`),this.#P(i,a)}else{let a=this.#z(s==="to-next"?1:-1);if(!a)return;this.#N(a,i),a.#o(`${a.#D(i)}, moved to ${a.#F()}`),n=a}r.#M();let o=i.querySelector(`[${ut}] > [data-move="${s}"]`);o&&!o.hidden?o.focus():n.isConnected&&i.focus()}#N(t,e){t.appendChild(e),t.#R(),this.#R(),t.#L(e),t.#_(e,this)}#P(t,e){this.dispatchEvent(new CustomEvent("drag-surface:reorder",{bubbles:!0,detail:{item:t,itemId:t.dataset.id,oldIndex:e,newIndex:this.#B(t),order:this.sortedOrder}}))}#_(t,e){this.dispatchEvent(new CustomEvent("drag-surface:transfer",{bubbles:!0,detail:{item:t,itemId:t.dataset.id,fromSurface:e,toSurface:this,newIndex:this.#B(t),fromOrder:e.sortedOrder,toOrder:this.sortedOrder}}))}#L(t){t.setAttribute("data-just-dropped",""),t.addEventListener("animationend",()=>{t.removeAttribute("data-just-dropped")},{once:!0}),setTimeout(()=>t.removeAttribute("data-just-dropped"),500)}#z(t){if(!this.group)return null;let e=[...r.#U].filter(n=>n===this||n.group===this.group&&n.isConnected&&!n.disabled);if(e.length<2)return null;let i=this.orientation==="horizontal",s=new Map(e.map(n=>[n,n.getBoundingClientRect()]));return e.sort((n,o)=>{let a=s.get(n),l=s.get(o);return i?a.top-l.top||a.left-l.left:a.left-l.left||a.top-l.top}),e[e.indexOf(this)+t]||null}#j(){return getComputedStyle(this).direction==="rtl"}#F(){let t=this.getAttribute("aria-label");if(t)return t;let e=this.getAttribute("aria-labelledby");if(e){let i=e.split(/\s+/).map(s=>document.getElementById(s)?.textContent.trim()).filter(Boolean).join(" ");if(i)return i}return"another list"}#D(t){let e=t.getAttribute("aria-label");if(e)return e;let i=t.cloneNode(!0);for(let n of i.querySelectorAll(`[${ut}], [aria-hidden="true"], [data-drag-handle]:not(:has(*))`))n.remove();return i.textContent.replace(/\s+/g," ").trim().slice(0,40)||t.dataset.id||"Item"}#B(t){return this.draggableChildren.indexOf(t)}#$(t,e){let s=this.draggableChildren.filter(n=>n!==t)[e]||null;s?this.insertBefore(t,s):this.appendChild(t)}#R(){this.draggableChildren.forEach((t,e)=>{t.dataset.sortOrder=String(e+1)})}#G(t,e){let i=this.orientation==="horizontal",s=i&&this.#j(),n=this.draggableChildren.filter(o=>!o.hasAttribute("data-dragging"));for(let o=0;o<n.length;o++){let a=n[o].getBoundingClientRect(),l;if(i?s?l=t>a.left+a.width/2:l=t<a.left+a.width/2:l=e<a.top+a.height/2,l)return{index:o,children:n}}return{index:n.length,children:n}}#q(t,e){return this.#G(t,e).index}#K(t,e){this.#H();let{index:i,children:s}=this.#G(t,e);i<s.length?s[i].setAttribute("data-drop-target","before"):s.length>0&&s[s.length-1].setAttribute("data-drop-target","after")}#H(){for(let t of this.querySelectorAll("[data-drop-target]"))t.removeAttribute("data-drop-target")}static#U=new Set;static#W=null};g("drag-surface",$e);var V=/Mac|iPhone|iPad|iPod/.test(navigator.platform??""),js={mac:{meta:"\u2318",cmd:"\u2318",alt:"\u2325",option:"\u2325",shift:"\u21E7",ctrl:"\u2303",control:"\u2303"},other:{meta:"Ctrl",cmd:"Ctrl",alt:"Alt",option:"Alt",shift:"Shift",ctrl:"Ctrl",control:"Ctrl"}},Fs={mac:{meta:"Command",cmd:"Command",alt:"Option",option:"Option",shift:"Shift",ctrl:"Control",control:"Control"},other:{meta:"Control",cmd:"Control",alt:"Alt",option:"Alt",shift:"Shift",ctrl:"Control",control:"Control"}},Ao={escape:{label:"Esc",spoken:"Escape"},esc:{label:"Esc",spoken:"Escape"},enter:{label:"Enter",spoken:"Enter"},return:{label:"Enter",spoken:"Enter"},tab:{label:"Tab",spoken:"Tab"},space:{label:"Space",spoken:"Space"},backspace:{label:"Backspace",spoken:"Backspace"},delete:{label:"Del",spoken:"Delete"},del:{label:"Del",spoken:"Delete"},insert:{label:"Ins",spoken:"Insert"},home:{label:"Home",spoken:"Home"},end:{label:"End",spoken:"End"},pageup:{label:"PgUp",spoken:"Page up"},pagedown:{label:"PgDn",spoken:"Page down"},arrowup:{label:"\u2191",spoken:"Up arrow"},up:{label:"\u2191",spoken:"Up arrow"},arrowdown:{label:"\u2193",spoken:"Down arrow"},down:{label:"\u2193",spoken:"Down arrow"},arrowleft:{label:"\u2190",spoken:"Left arrow"},left:{label:"\u2190",spoken:"Left arrow"},arrowright:{label:"\u2192",spoken:"Right arrow"},right:{label:"\u2192",spoken:"Right arrow"},"+":{label:"+",spoken:"Plus"},plus:{label:"+",spoken:"Plus"}};function Ut(r){return[...String(r??"").trim().toLowerCase().matchAll(/([^+]+|\+)(?:\+|$)/g)].map(e=>e[1].trim()).filter(Boolean).map(e=>e==="plus"?"+":e)}function Pe(r,t=V){let e=t?js.mac:js.other;if(r in e)return{label:e[r],spoken:(t?Fs.mac:Fs.other)[r],modifier:!0};let i=Ao[r];if(i)return{...i,modifier:!1};let s=r.toUpperCase();return{label:s,spoken:s,modifier:!1}}function Vt(r){return Ut(r).map(t=>Pe(t).label).join(V?"":"+")}var ko={esc:"escape",return:"enter",del:"delete",ins:"insert",up:"arrowup",down:"arrowdown",left:"arrowleft",right:"arrowright",space:" ",spacebar:" ",plus:"+",pgup:"pageup",pgdn:"pagedown"};function xo(r){let t=String(r??"").toLowerCase();return ko[t]??t}function St(r){let t=Ut(r);return{key:xo(t.pop()??""),meta:t.includes("meta")||t.includes("cmd"),ctrl:t.includes("ctrl")||t.includes("control"),shift:t.includes("shift"),alt:t.includes("alt")||t.includes("option")}}function qs(r){return r.length===1&&!/[a-z0-9 ]/.test(r)}function Hs(r,t){let i=(r.key==="Spacebar"?" ":String(r.key??"").toLowerCase())===t.key;if(!i&&(r.altKey||r.shiftKey)&&/^[a-z0-9]$/.test(t.key)){let o=/\d/.test(t.key)?`Digit${t.key}`:`Key${t.key.toUpperCase()}`;i=r.code===o}if(!i)return!1;let s,n;return V?(s=t.meta,n=t.ctrl):(s=!1,n=t.meta||t.ctrl),!(s!==r.metaKey||n!==r.ctrlKey||!qs(t.key)&&t.shift!==r.shiftKey||t.alt!==r.altKey)}function Wt(r){let t=typeof r=="string"?St(r):r;return!t.meta&&!t.ctrl&&!t.alt&&t.key.length===1}function Us(r,t){let e=St(r),i=St(t),s=V?e.ctrl:e.ctrl||e.meta,n=V?i.ctrl:i.ctrl||i.meta,o=V&&e.meta,a=V&&i.meta,l=!qs(e.key);return e.key===i.key&&s===n&&o===a&&e.alt===i.alt&&(!l||e.shift===i.shift)}var Ie="data-char-shortcuts",Vs="vb:char-shortcuts-change",Eo="vb:settings:extensions";function Ct(){return typeof document>"u"?!0:document.documentElement.getAttribute(Ie)!=="off"}function So(){try{let r=globalThis.localStorage?.getItem(Eo);if(!r)return null;let t=JSON.parse(r)?.data?.charShortcuts;return typeof t=="boolean"?t:null}catch{return null}}var Co=!0;if(typeof document<"u"){let r=So();r===null&&(Co=Ct()),r===!1?document.documentElement.setAttribute(Ie,"off"):r===!0&&document.documentElement.removeAttribute(Ie)}var To=new Set(["INPUT","TEXTAREA","SELECT"]),Tt=[],Ws=!1;function Mo(r){let t=r;return!t||!t.tagName?!1:To.has(t.tagName)||t.isContentEditable}function Lo(r){if(r.repeat||r.isComposing||r.defaultPrevented)return;let t=Mo(r.target),e=!Ct(),i=document.activeElement;for(let s of Tt)if(!(t&&!s.global)&&!(s.scope&&!(s.scope.isConnected&&s.scope.contains(i)))&&!(e&&s.character&&!s.scope)&&!(s.enabled&&!s.enabled())&&Hs(r,s.descriptor)){r.preventDefault(),s.callback(r);return}}function _o(){Ws||(document.addEventListener("keydown",Lo),Ws=!0)}function Q(r,t,e={}){_o();let i=St(r),s={combo:r,descriptor:i,callback:t,global:e.global===!0,scope:e.scope??null,enabled:typeof e.enabled=="function"?e.enabled:null,character:Wt(i)},n=Tt.find(o=>!o.scope&&!s.scope&&Us(o.combo,r));return n&&console.warn(`[hotkey-bind] Shortcut "${r}" is already bound as "${n.combo}". Last-bound wins.`),Tt.unshift(s),function(){let a=Tt.indexOf(s);a!==-1&&Tt.splice(a,1)}}var Ro=0,Oe=class extends b{#t=null;#e;#i;#s=[];#r=-1;#n=[];#a=[];#c=[];#h="";#l=0;setup(){this.#h=`cmdp-${++Ro}`,this.#l=0,this.#o(),this.#p(),this.hasAttribute("discover")&&this.#w()}teardown(){this.#a.forEach(t=>t()),this.#a=[],this.#t?.remove(),this.#t=null,this.#s=[],this.#n=[],this.#c=[],this.#r=-1}get commands(){let t=[];for(let e of this.querySelectorAll("command-group")){let i=e.getAttribute("label")||"";for(let s of e.querySelectorAll("command-item"))t.push({value:s.getAttribute("value")||"",label:s.textContent.trim(),hotkey:s.getAttribute("data-hotkey")||void 0,group:i||void 0})}return t}set commands(t){let e=Array.isArray(t)?t:[],i=new Map;for(let s of e){let n=s.group||"";i.has(n)||i.set(n,[]),i.get(n).push(s)}for(let s of[...this.children])(s.tagName==="COMMAND-GROUP"||s.tagName==="COMMAND-ITEM")&&s.remove();for(let[s,n]of i){let o=document.createElement("command-group");s&&o.setAttribute("label",s);for(let a of n){let l=document.createElement("command-item");if(a.value&&l.setAttribute("value",a.value),a.hotkey&&l.setAttribute("data-hotkey",a.hotkey),a.icon){let c=document.createElement("span");c.setAttribute("slot","icon"),c.innerHTML=a.icon,l.appendChild(c)}l.appendChild(document.createTextNode(a.label||a.value||"")),o.appendChild(l)}this.appendChild(o)}this._reinit(),this.dispatchEvent(new CustomEvent("command-palette:commands-changed",{detail:{commands:e,source:"property"},bubbles:!0}))}#o(){this.#t=document.createElement("dialog"),this.#t.className="command-dialog",this.#t.setAttribute("aria-label",this.getAttribute("label")||"Command palette"),this.#t.addEventListener("click",i=>{i.target===this.#t&&this.close()}),this.#t.addEventListener("close",()=>{this.#e?.setAttribute("aria-expanded","false"),this.#e?.removeAttribute("aria-activedescendant"),this.dispatchEvent(new CustomEvent("command-palette:close",{bubbles:!0}))});let t=document.createElement("div");t.className="command-search",this.#i=document.createElement("div"),this.#i.className="command-list",this.#i.id=`${this.#h}-list`,this.#i.setAttribute("role","listbox"),this.#i.setAttribute("aria-label","Commands"),this.#e=document.createElement("input"),this.#e.type="search",this.#e.placeholder=this.getAttribute("placeholder")||"Type a command...",this.#e.setAttribute("aria-label","Search commands"),this.#e.autocomplete="off",this.#e.setAttribute("role","combobox"),this.#e.setAttribute("aria-autocomplete","list"),this.#e.setAttribute("aria-controls",this.#i.id),this.#e.setAttribute("aria-expanded","false"),this.#e.addEventListener("input",this.#d),this.#e.addEventListener("keydown",this.#f),t.appendChild(this.#e),this.#n=Array.from(this.querySelectorAll("command-group")),this.#n.forEach(i=>{let s=this.#u(i.getAttribute("label")||"");this.#i.appendChild(s),i.querySelectorAll("command-item").forEach(n=>{let o=n.querySelector('[slot="icon"]'),a=this.#b(n.textContent.trim(),o?o.cloneNode(!0):null,n.getAttribute("data-hotkey"));a.dataset.value=n.getAttribute("value")||"",a.addEventListener("click",()=>{this.#g(a.dataset.value)}),s.appendChild(a),this.#s.push({btn:a,group:s,source:n})})});let e=document.createElement("div");e.className="command-empty",e.textContent="No results found.",e.hidden=!0,this.#i.appendChild(e),this.#t.appendChild(t),this.#t.appendChild(this.#i),this.appendChild(this.#t)}#u(t){let e=document.createElement("div");e.className="command-group",e.setAttribute("role","group");let i=document.createElement("div");return i.className="command-group-header",i.id=`${this.#h}-g${++this.#l}`,i.setAttribute("aria-hidden","true"),i.textContent=t,t?e.setAttribute("aria-labelledby",i.id):i.hidden=!0,e.appendChild(i),e}#p(){let t=this.getAttribute("hotkey")||"meta+k";this.#a.push(Q(t,()=>{this.#t?.open?this.close():this.open()},{global:!0}));for(let{btn:e,source:i}of this.#s){let s=i?.getAttribute("data-hotkey");if(!s||s.toLowerCase()===t.toLowerCase())continue;let n=e.dataset.value;this.#a.push(Q(s,()=>this.#g(n)))}}#d=()=>{let t=this.#e.value.toLowerCase().trim(),e=0,i=new Set;this.#s.forEach(({btn:n,group:o})=>{let a=!t||(n.dataset.searchText??"").includes(t);n.hidden=!a,a&&(e++,i.add(o))}),this.#i.querySelectorAll(":scope > .command-group").forEach(n=>{n.hidden=!i.has(n)});let s=this.#i.querySelector(".command-empty");s&&(s.hidden=e>0),this.#r=-1,this.#s.forEach(({btn:n})=>{n.removeAttribute("data-active"),n.setAttribute("aria-selected","false")}),this.#e.removeAttribute("aria-activedescendant"),e>0&&this.#y(0)};#f=t=>{let e=this.#v();switch(t.key){case"ArrowDown":t.preventDefault(),this.#y(this.#r+1);break;case"ArrowUp":t.preventDefault(),this.#y(this.#r-1);break;case"Enter":t.preventDefault(),this.#r>=0&&e[this.#r]&&e[this.#r].btn.click();break;case"Escape":t.preventDefault(),this.close();break}};#v(){return this.#s.filter(({btn:t})=>!t.hidden)}#y(t){let e=this.#v();if(e.length===0)return;e.forEach(({btn:s})=>{s.removeAttribute("data-active"),s.setAttribute("aria-selected","false")}),t<0&&(t=e.length-1),t>=e.length&&(t=0),this.#r=t;let{btn:i}=e[t];i.setAttribute("data-active",""),i.setAttribute("aria-selected","true"),this.#e.setAttribute("aria-activedescendant",i.id),i.scrollIntoView({block:"nearest"})}#g(t){this.close(),this.dispatchEvent(new CustomEvent("command-palette:select",{bubbles:!0,detail:{value:t}}))}#w(){this.listen(document,"vb:command-registry-change",this.#A)}#A=()=>{this.#t?.open&&(this.#m(),this.#d())};#m(){if(!this.hasAttribute("discover"))return;let{getRegisteredCommands:t,scanAutoDiscoverable:e}=window.__commandRegistry||{};if(!t)return;this.#s=this.#s.filter(n=>!n.discovered),this.#c.forEach(n=>n.remove()),this.#c=[];let i=this.#i.querySelector(".command-empty"),s=t();for(let[n,o]of s){let a=this.#u(n);this.#i.insertBefore(a,i),this.#c.push(a);for(let l of o){if(this.contains(l.element))continue;let c=this.#b(l.label,l.icon,l.shortcut);c.dataset.value=`__discovered:${l.label}`,c.addEventListener("click",()=>{this.close(),l.element.click()}),a.appendChild(c),this.#s.push({btn:c,group:a,source:null,discovered:!0})}}if(this.getAttribute("discover")==="auto"&&e){let n=e(),o=new Map;for(let a of n){let l=o.get(a.group)||[];l.push(a),o.set(a.group,l)}for(let[a,l]of o){let c=this.#u(a);this.#i.insertBefore(c,i),this.#c.push(c);for(let h of l){if(this.contains(h.element))continue;let u=this.#b(h.label,h.icon,h.shortcut);u.dataset.value=`__auto:${h.label}`,u.dataset.auto="",u.addEventListener("click",()=>{this.close(),h.action?h.action():h.element.click()}),c.appendChild(u),this.#s.push({btn:u,group:c,source:null,discovered:!0})}}}}#b(t,e,i){let s=document.createElement("button");if(s.type="button",s.className="command-option",s.id=`${this.#h}-opt-${++this.#l}`,s.setAttribute("role","option"),s.setAttribute("aria-selected","false"),s.tabIndex=-1,s.dataset.searchText=t.toLowerCase(),e){let o=document.createElement("span");if(o.className="command-icon",typeof e=="string"){let a=document.createElement("icon-wc");a.setAttribute("name",e),o.appendChild(a)}else o.appendChild(e);s.appendChild(o)}let n=document.createElement("span");if(n.className="command-label",n.textContent=t,s.appendChild(n),i){let o=document.createElement("kbd");o.className="command-kbd",o.setAttribute("aria-hidden","true"),o.textContent=Vt(i),s.appendChild(o),s.setAttribute("aria-keyshortcuts",i)}return s}open(){!this.#t||this.#t.open||(this.#m(),this.#t.showModal(),this.#e.setAttribute("aria-expanded","true"),this.#e.value="",this.#d(),this.#e.focus(),this.dispatchEvent(new CustomEvent("command-palette:open",{bubbles:!0})))}close(){this.#t?.open&&this.#t.close()}get isOpen(){return this.#t?.open??!1}},ze=class extends HTMLElement{},Be=class extends HTMLElement{};g("command-palette",Oe);g("command-group",ze);g("command-item",Be);var No="shift+?",$o={title:"Keyboard shortcuts",general:"General",self:"Show keyboard shortcuts",close:"Close"},Po=0,De=class extends b{static get observedAttributes(){return["hotkey"]}#t=null;#e=null;#i=null;#s=null;setup(){this.#a(),this.#n(),this.listen(window,Vs,()=>{this.#t?.open&&this.#l()})}teardown(){this.#i?.(),this.#i=null,this.#t?.remove(),this.#t=null,this.#e=null}attributeChangedCallback(t,e,i){t==="hotkey"&&e!==i&&this.hasAttribute("data-upgraded")&&this.#n()}show(){this.#t&&(this.#l(),this.#t.open||this.#t.showModal())}close(){this.#t?.open&&this.#t.close()}toggle(){this.#t?.open?this.close():this.show()}get open(){return!!this.#t?.open}get hotkey(){let t=(this.getAttribute("hotkey")??"").trim();return t.toLowerCase()==="none"?null:t||No}get shortcuts(){return this.#s}set shortcuts(t){this.#s=t&&typeof t=="object"?t:null,this.#t?.open&&this.#l(),this.dispatchEvent(new CustomEvent("short-cuts:shortcuts-changed",{detail:{shortcuts:this.#s,source:"property"},bubbles:!0}))}#r(t){return this.getAttribute(`data-label-${t}`)||$o[t]}#n(){this.#i?.(),this.#i=null;let t=this.hotkey;t&&(this.#i=Q(t,()=>this.toggle()))}#a(){this.querySelector(":scope > dialog.shortcut-dialog")?.remove();let t=`short-cuts-title-${++Po}`,e=document.createElement("dialog");e.className="shortcut-dialog",e.setAttribute("aria-labelledby",t);let i=document.createElement("header");i.className="shortcut-header";let s=document.createElement("h2");s.id=t,s.textContent=this.#r("title");let n=document.createElement("button");n.type="button",n.className="shortcut-close",n.setAttribute("aria-label",this.#r("close"));let o=document.createElement("icon-wc");o.setAttribute("name","x"),o.setAttribute("size","sm"),o.setAttribute("aria-hidden","true"),n.appendChild(o),n.addEventListener("click",()=>this.close()),i.append(s,n);let a=document.createElement("section");a.className="shortcut-body",e.append(i,a),e.addEventListener("click",l=>{l.target===e&&e.close()}),this.#t=e,this.#e=a,this.appendChild(e)}#c(){let t=new Map,e=!Ct(),i=(l,c=!1)=>!(e&&!c&&Wt(l)),s=this.hotkey;s&&i(s)&&t.set(this.#r("general"),[{label:this.#r("self"),shortcut:s}]);let n=(l,c)=>{if(!c?.shortcut||!i(String(c.shortcut),!!c.scoped))return;let h=t.get(l)||[];h.push({label:String(c.label??""),shortcut:String(c.shortcut)}),t.set(l,h)};if(this.#s){for(let[l,c]of Object.entries(this.#s))Array.isArray(c)&&c.forEach(h=>n(l,h));return t}let{getRegisteredCommands:o}=window.__commandRegistry||{};if(o)for(let[l,c]of o())for(let h of c)n(l,h);let{getHotkeyActions:a}=window.__hotkeyActionRegistry||{};if(a)for(let[l,c]of a())for(let h of c)n(l,h);return t}#h(t){let e=document.createElement("kbd");e.className="shortcut-kbd";let i=document.createElement("span");i.setAttribute("aria-hidden","true"),i.textContent=Vt(t);let s=document.createElement("span");return s.className="visually-hidden",s.textContent=Ut(t).map(n=>Pe(n,V).spoken).join(" "),e.append(i,s),e}#l(){if(this.#e){this.#e.replaceChildren();for(let[t,e]of this.#c()){if(!e.length)continue;let i=document.createElement("section");i.className="shortcut-group";let s=document.createElement("h3");s.className="shortcut-group-header",s.textContent=t;let n=document.createElement("dl");n.className="shortcut-list";for(let o of e){let a=document.createElement("div");a.className="shortcut-row";let l=document.createElement("dt");l.className="shortcut-label",l.textContent=o.label;let c=document.createElement("dd");c.appendChild(this.#h(o.shortcut)),a.append(l,c),n.appendChild(a)}i.append(s,n),this.#e.appendChild(i)}}}};g("short-cuts",De);var Io="Comparison slider";function je(r){if(r===null||r.trim()==="")return 50;let t=Number(r);return Number.isNaN(t)?50:Math.min(100,Math.max(0,t))}var Fe=class extends b{static observedAttributes=["position","label","aria-label","aria-labelledby"];#t=null;#e=!1;#i=!1;#s=50;#r=!1;setup(){let t=[...this.children].filter(e=>!e.classList.contains("comparison-divider"));return t.length<2?!1:(t.length>2&&console.warn("[compare-surface] Expected exactly 2 children; extra children are hidden."),this.#t=document.createElement("div"),this.#t.className="comparison-divider",this.#t.setAttribute("role","slider"),this.#t.setAttribute("aria-valuemin","0"),this.#t.setAttribute("aria-valuemax","100"),this.#t.setAttribute("aria-orientation","horizontal"),this.#t.setAttribute("tabindex","0"),this.#a(),this.#n(),this.appendChild(this.#t),this.#d(je(this.getAttribute("position"))),this.listen(this.#t,"pointerdown",this.#h),this.listen(this.#t,"pointermove",this.#l),this.listen(this.#t,"pointerup",this.#o),this.listen(this.#t,"pointercancel",this.#o),this.listen(this.#t,"lostpointercapture",this.#o),this.listen(this.#t,"keydown",this.#u),!0)}teardown(){this.#t?.remove(),this.#t=null,this.#e=!1,this.#r&&this.removeAttribute("role"),this.#r=!1}attributeChangedCallback(t,e,i){if(!(!this.#t||e===i))if(t==="position"){if(this.#i)return;this.#d(je(i))}else this.#a(),this.#n()}#n(){let t=this.hasAttribute("aria-label")||this.hasAttribute("aria-labelledby");t&&!this.hasAttribute("role")?(this.setAttribute("role","group"),this.#r=!0):!t&&this.#r&&(this.removeAttribute("role"),this.#r=!1)}#a(){if(!this.#t)return;let t=this.getAttribute("label")||this.getAttribute("aria-label")||Io;this.#t.setAttribute("aria-label",t)}get#c(){return getComputedStyle(this).direction==="rtl"}#h=t=>{t.preventDefault(),this.#e=!0,this.#t?.setPointerCapture(t.pointerId)};#l=t=>{if(!this.#e)return;let e=this.getBoundingClientRect();if(!e.width)return;let i=this.#c?e.right-t.clientX:t.clientX-e.left;this.#p(i/e.width*100)};#o=t=>{this.#e&&(this.#e=!1,this.#t?.hasPointerCapture(t.pointerId)&&this.#t.releasePointerCapture(t.pointerId))};#u=t=>{let e=t.shiftKey?10:1,i=this.#c?-1:1,s=this.#s,n;switch(t.key){case"ArrowRight":n=s+e*i;break;case"ArrowLeft":n=s-e*i;break;case"ArrowUp":n=s+e;break;case"ArrowDown":n=s-e;break;case"PageUp":n=s+10;break;case"PageDown":n=s-10;break;case"Home":n=0;break;case"End":n=100;break;default:return}t.preventDefault(),this.#p(n)};#p(t){let e=this.#s;if(this.#d(Math.min(100,Math.max(0,t))),this.#s!==e){this.#i=!0;try{this.setAttribute("position",String(this.#s))}finally{this.#i=!1}this.dispatchEvent(new CustomEvent("compare-surface:change",{detail:{position:this.#s},bubbles:!0}))}}#d(t){this.#s=Math.round(t),this.style.setProperty("--_position",`${t}%`),this.#t&&(this.#t.setAttribute("aria-valuenow",String(this.#s)),this.#t.setAttribute("aria-valuetext",`${this.#s}%`))}get position(){return this.#t?this.#s:Math.round(je(this.getAttribute("position")))}set position(t){let e=Number(t),i=Math.round(Math.min(100,Math.max(0,Number.isNaN(e)?0:e)));this.setAttribute("position",String(i))}};g("compare-surface",Fe);function Oo(){let r=globalThis.localStorage;if(!r)throw new Error("VBStore: localStorage is not available in this environment");return{async getRaw(t){return r.getItem(t)},async setRaw(t,e){r.setItem(t,e)},async removeRaw(t){r.removeItem(t)},async keys(t){let e=[];for(let i=0;i<r.length;i++){let s=r.key(i);s&&s.startsWith(t)&&e.push(s)}return e}}}var Gt="__vbStoreBackend",Kt=globalThis;function W(){return Kt[Gt]||(Kt[Gt]=Oo()),Kt[Gt]}function qe(r,t){if(typeof r!="string"||!r)throw new TypeError("VBStore: namespace must be a non-empty string");if(typeof t!="string"||!t)throw new TypeError("VBStore: key must be a non-empty string");return`vb:${r}:${t}`}function Gs(r){if(typeof r!="string"||!r)throw new TypeError("VBStore: namespace must be a non-empty string");return`vb:${r}:`}function Ks(r){try{let t=JSON.parse(r);if(t&&typeof t=="object"&&typeof t.timestamp=="number")return t}catch{}return null}var $={configure(r={}){Kt[Gt]=r.backend??null},async set(r,t,e){let i={data:e,timestamp:Date.now()};await W().setRaw(qe(r,t),JSON.stringify(i))},async get(r,t,e){let i=await W().getRaw(qe(r,t));if(i==null)return null;let s=Ks(i);return!s||e?.maxAge!=null&&Date.now()-s.timestamp>e.maxAge?null:s.data},async remove(r,t){await W().removeRaw(qe(r,t))},async list(r){let t=Gs(r),e=await W().keys(t),i=[];for(let s of e){let n=await W().getRaw(s);if(n==null)continue;let o=Ks(n);o&&i.push({key:s.slice(t.length),data:o.data,timestamp:o.timestamp})}return i},async clear(r){let t=Gs(r),e=await W().keys(t);for(let i of e)await W().removeRaw(i)},async clearAll(){let r=await W().keys("vb:");for(let t of r)await W().removeRaw(t)},async setMany(r,t){for(let[e,i]of t)await $.set(r,e,i)}};if(typeof window<"u"){let r=window.VB??(window.VB={});r.store??=$}var zo=0;function He(r,t){if(r===null||r.trim()==="")return t;let e=Number(r);return Number.isFinite(e)?e:t}var Ue=class extends b{static observedAttributes=["position","min","max","direction","collapsible","data-label-resize","data-label-collapsed"];#t=null;#e;#i;#s=50;#r=!1;#n=50;#a=!1;#c={};#h=0;get#l(){return this.getAttribute("direction")==="vertical"}get#o(){return getComputedStyle(this).direction==="rtl"}get#u(){return He(this.getAttribute("min"),10)}get#p(){return He(this.getAttribute("max"),90)}get#d(){return this.hasAttribute("collapsible")}get#f(){return He(this.getAttribute("position"),50)}get position(){return this.#t?this.#s:this.#c.position??this.#s}set position(t){let e=Number(t);if(Number.isFinite(e)){if(!this.#t){this.#c.position=e,delete this.#c.reset;return}this.#r&&this.#k(),this.#C(e,"api")}}get collapsed(){return this.#t?this.#r:this.#c.collapsed??this.#r}set collapsed(t){if(!this.#t){this.#c.collapsed=!!t;return}t?this.#T("api"):this.#M("api")}reset(){if(!this.#t){this.#c={reset:!0},this.#N();return}this.#r&&this.#k(),this.#C(this.#f,"api"),this.#N()}setup(){for(let e of this.querySelectorAll(":scope > .split-divider"))e.remove();let t=[...this.children].filter(e=>!e.classList.contains("split-divider"));return t.length<2?!1:(this.#e=t[0],this.#i=t[1],this.#v(++this.#h),!0)}async#v(t){let e=null;if(this.#a||(e=await this.#O()),t!==this.#h||!this.isConnected)return!1;let i=this.#e,s=document.createElement("div");s.className="split-divider",s.setAttribute("role","separator"),i.id||(i.id=`vb-split-panel-${++zo}`),s.setAttribute("aria-controls",i.id),s.setAttribute("tabindex","0"),this.#t=s,this.#g(),this.insertBefore(s,this.#i),this.listen(s,"pointerdown",this.#A),this.listen(s,"keydown",this.#S),this.listen(s,"dblclick",this.#x);let n=this.#r?this.#n:this.#s,o=this.#r;this.#a||(n=e?.position??this.#f,o=!!e?.collapsed&&this.#d);let a=this.#c;return this.#c={},a.reset&&(n=this.#f,o=!1),a.position!==void 0&&(n=a.position,o=!1),a.collapsed!==void 0&&(o=a.collapsed),this.#a=!0,this.#k(),o?(this.#n=this.#y(n),this.#E()):this.#C(n,null),!0}teardown(){this.#h++,this.#t&&(this.#t.remove(),this.#t=null)}attributeChangedCallback(t,e,i){if(!(e===i||!this.#t)){if(t==="position"){this.#r?this.#n=this.#y(this.#f):this.#C(this.#f,"attribute");return}t==="collapsible"&&!this.#d&&this.#r&&this.#M("attribute"),this.#g(),!this.#r&&(t==="min"||t==="max")&&this.#C(this.#s,"attribute")}}#y(t){return Math.min(this.#p,Math.max(this.#u,t))}#g(){let t=this.#t;t&&(t.setAttribute("aria-orientation",this.#l?"horizontal":"vertical"),t.setAttribute("aria-valuemin",String(this.#d?0:this.#u)),t.setAttribute("aria-valuemax",String(this.#p)),t.setAttribute("aria-label",this.getAttribute("data-label-resize")||"Resize panels"),this.#w())}#w(){let t=this.#t;if(!t)return;let e=Math.round(this.#s);t.setAttribute("aria-valuenow",String(e)),t.setAttribute("aria-valuetext",this.#r?this.getAttribute("data-label-collapsed")||"Collapsed":`${e}%`)}#A=t=>{if(t.button!==0)return;t.preventDefault();let e=this.#t;this.setState("divider-dragging",!0);try{e.setPointerCapture(t.pointerId)}catch{}e.addEventListener("pointermove",this.#m),e.addEventListener("pointerup",this.#b),e.addEventListener("pointercancel",this.#b),e.addEventListener("lostpointercapture",this.#b)};#m=t=>{if(!this.matches(":state(divider-dragging)"))return;let e=this.getBoundingClientRect(),i;this.#l?i=(t.clientY-e.top)/e.height*100:i=(this.#o?e.right-t.clientX:t.clientX-e.left)/e.width*100,this.#r&&this.#k(),this.#C(i,"pointer")};#b=t=>{if(!this.#t)return;let e=this.matches(":state(divider-dragging)");this.setState("divider-dragging",!1),this.#t.hasPointerCapture(t.pointerId)&&this.#t.releasePointerCapture(t.pointerId),this.#t.removeEventListener("pointermove",this.#m),this.#t.removeEventListener("pointerup",this.#b),this.#t.removeEventListener("pointercancel",this.#b),this.#t.removeEventListener("lostpointercapture",this.#b),e&&this.#I()};#S=t=>{if(t.key==="Enter"){if(!this.#d)return;t.preventDefault(),this.#r?this.#M("keyboard"):this.#T("keyboard"),this.#I();return}let e=t.shiftKey?10:1,i=!this.#l&&this.#o,s=this.#l?"ArrowUp":i?"ArrowRight":"ArrowLeft",n=this.#l?"ArrowDown":i?"ArrowLeft":"ArrowRight",o=null;t.key===s?o=this.#s-e:t.key===n?o=this.#s+e:t.key==="Home"?o=this.#u:t.key==="End"&&(o=this.#p),o!==null&&(t.preventDefault(),this.#r&&(this.#k(),this.dispatchEvent(new CustomEvent("split-surface:collapse",{detail:{collapsed:!1,source:"keyboard"},bubbles:!0}))),this.#C(o,"keyboard"),this.#I())};#x=()=>{this.#d&&(this.#r?this.#M("pointer"):this.#T("pointer"),this.#I())};#T(t){this.#r||!this.#t||(this.#n=this.#s,this.#E(),this.dispatchEvent(new CustomEvent("split-surface:collapse",{detail:{collapsed:!0,source:t},bubbles:!0})))}#E(){let t=this.#e;this.#r=!0,this.#s=0,t.style.flexBasis="0%",t.style.flexGrow="0",t.style.flexShrink="0",t.style.overflow="hidden",t.inert=!0,this.setState("collapsed",!0),this.#w()}#k(){this.#r=!1,this.#e&&(this.#e.inert=!1),this.setState("collapsed",!1)}#M(t){!this.#r||!this.#t||(this.#k(),this.#C(this.#n,null),this.dispatchEvent(new CustomEvent("split-surface:collapse",{detail:{collapsed:!1,source:t},bubbles:!0})))}#C(t,e){if(!Number.isFinite(t)||!this.#e||!this.#i)return;let i=this.#y(t);this.#s=i,this.#e.style.flexBasis=`${i}%`,this.#e.style.flexGrow="0",this.#e.style.flexShrink="0",this.#e.style.overflow="auto",this.#i.style.flexGrow="1",this.#i.style.overflow="auto",this.#w(),e!==null&&this.dispatchEvent(new CustomEvent("split-surface:resize",{detail:{position:i,source:e},bubbles:!0}))}async#O(){let t=this.getAttribute("persist");if(!t)return null;try{let e=await $.get("layout",`split:${t}`);if(e&&typeof e=="object"&&typeof e.position=="number")return e}catch{}return null}#I(){let t=this.getAttribute("persist");if(!t)return;let e=this.#r?{position:Math.round(this.#n),collapsed:!0}:{position:Math.round(this.#s),collapsed:!1};$.set("layout",`split:${t}`,e).catch(()=>{})}#N(){let t=this.getAttribute("persist");t&&$.remove("layout",`split:${t}`).catch(()=>{})}};g("split-surface",Ue);var We=1500,Bo="[data-copy], [data-copy-target], [data-paste-target]",tt={copied:"Copied to clipboard",pasted:"Pasted from clipboard","copy-failed":"Copy failed","copy-failed-selected":"Copy failed. Text selected, press Ctrl+C to copy","paste-failed":"Paste failed"},Ve=new WeakMap;function Do(r){if(typeof document.execCommand!="function"||!document.body)return!1;let t=document.activeElement,e=document.createElement("textarea");e.value=r,e.setAttribute("readonly",""),e.setAttribute("aria-hidden","true"),e.style.cssText="position:fixed;inset-block-start:0;inset-inline-start:0;opacity:0;pointer-events:none",document.body.appendChild(e),e.select();let i=!1;try{i=document.execCommand("copy")}catch{i=!1}return e.remove(),t?.focus?.({preventScroll:!0}),i}function jo(r){if(!r)return!1;if(r instanceof HTMLInputElement||r instanceof HTMLTextAreaElement)return r.focus(),r.select(),!0;let t=window.getSelection?.();if(!t)return!1;let e=document.createRange();return e.selectNodeContents(r),t.removeAllRanges(),t.addRange(e),!t.isCollapsed}async function Mt(r,t={}){if(r==null||r==="")return!1;let{button:e,duration:i=We}=t,s=!1,n=null;try{if(!navigator.clipboard?.writeText)throw new Error("Clipboard API unavailable");await navigator.clipboard.writeText(r),s=!0}catch(a){n=a,s=Do(r)}if(s)return dt({button:e,duration:i,state:"copied",eventName:"copy:done",eventDetail:{text:r},message:t.announceMessage??H(e,"copied",tt.copied)}),!0;let o=jo(t.source);return dt({button:e,duration:i,state:"failed",eventName:"copy:error",eventDetail:{text:r,error:n},message:t.failureMessage??H(e,"copy-failed",o?tt["copy-failed-selected"]:tt["copy-failed"])}),!1}async function Ys(r,t={}){let{text:e,html:i,blob:s}=r??{};if(!e&&!i&&!s)return!1;let{button:n,duration:o=We}=t;if(typeof ClipboardItem<"u"&&typeof navigator.clipboard?.write=="function"){let l={};e&&(l["text/plain"]=new Blob([e],{type:"text/plain"})),i&&(l["text/html"]=new Blob([i],{type:"text/html"})),s&&(l[s.type]=s);try{return await navigator.clipboard.write([new ClipboardItem(l)]),dt({button:n,duration:o,state:"copied",eventName:"copy:done",eventDetail:{payload:r},message:t.announceMessage??H(n,"copied",tt.copied)}),!0}catch{}}return e?Mt(e,t):(dt({button:n,duration:o,state:"failed",eventName:"copy:error",eventDetail:{payload:r,error:null},message:t.failureMessage??H(n,"copy-failed",tt["copy-failed"])}),!1)}function dt({button:r,duration:t,message:e,eventDetail:i,state:s,eventName:n}){if(r){r.dataset.state=s;let o=Ve.get(r);o&&clearTimeout(o),Ve.set(r,setTimeout(()=>{r.dataset.state===s&&delete r.dataset.state,Ve.delete(r)},t)),r.dispatchEvent(new CustomEvent(n,{bubbles:!0,detail:i}))}K(e,{politeness:s==="failed"?"assertive":"polite"})}async function Fo(r,t={}){let{button:e,duration:i=We}=t,s;try{if(!navigator.clipboard?.readText)throw new Error("Clipboard API unavailable");s=await navigator.clipboard.readText()}catch(n){return dt({button:e,duration:i,state:"failed",eventName:"paste:error",eventDetail:{target:r,error:n},message:t.failureMessage??H(e,"paste-failed",tt["paste-failed"])}),null}return r&&(r instanceof HTMLInputElement||r instanceof HTMLTextAreaElement||r instanceof HTMLSelectElement?r.value=s:r.textContent=s,r.dispatchEvent(new Event("input",{bubbles:!0}))),dt({button:e,duration:i,state:"pasted",eventName:"paste:done",eventDetail:{text:s,target:r},message:t.announceMessage??H(e,"pasted",tt.pasted)}),s}function Xs(r){let t=r.dataset.copyTarget;if(!t)return null;try{return document.querySelector(t)}catch{return null}}function qo(r){if(r.dataset.copy)return r.dataset.copy;let t=Xs(r);if(!t)return"";let e=r.dataset.copyAttr;return e?t.getAttribute(e)??"":t instanceof HTMLInputElement||t instanceof HTMLTextAreaElement?t.value:t.textContent??""}function Ho(r){let t=r.target?.closest?.(Bo);if(!t||t.matches(':disabled, [aria-disabled="true"]'))return;if(t.dataset.pasteTarget){let i=null;try{i=document.querySelector(t.dataset.pasteTarget)}catch{}if(!i)return;Fo(i,{button:t});return}let e=qo(t);e&&Mt(e,{button:t,source:Xs(t)??void 0})}typeof document<"u"&&!document.__vbCopyDelegated&&(document.__vbCopyDelegated=!0,document.addEventListener("click",Ho));var X;(r=>{class t{constructor(a,l,c,h){if(this.version=a,this.errorCorrectionLevel=l,a<t.MIN_VERSION||a>t.MAX_VERSION)throw new RangeError("Version value out of range");if(h<-1||h>7)throw new RangeError("Mask value out of range");this.size=a*4+17;let u=[];for(let d=0;d<this.size;d++)u.push(!1);for(let d=0;d<this.size;d++)this.modules.push(u.slice()),this.isFunction.push(u.slice());this.drawFunctionPatterns();let p=this.addEccAndInterleave(c);if(this.drawCodewords(p),h==-1){let d=1e9;for(let f=0;f<8;f++){this.applyMask(f),this.drawFormatBits(f);let m=this.getPenaltyScore();m<d&&(h=f,d=m),this.applyMask(f)}}s(0<=h&&h<=7),this.mask=h,this.applyMask(h),this.drawFormatBits(h),this.isFunction=[]}version;errorCorrectionLevel;static encodeText(a,l){let c=r.QrSegment.makeSegments(a);return t.encodeSegments(c,l)}static encodeBinary(a,l){let c=r.QrSegment.makeBytes(a);return t.encodeSegments([c],l)}static encodeSegments(a,l,c=1,h=40,u=-1,p=!0){if(!(t.MIN_VERSION<=c&&c<=h&&h<=t.MAX_VERSION)||u<-1||u>7)throw new RangeError("Invalid value");let d,f;for(d=c;;d++){let A=t.getNumDataCodewords(d,l)*8,k=n.getTotalBits(a,d);if(k<=A){f=k;break}if(d>=h)throw new RangeError("Data too long")}for(let A of[t.Ecc.MEDIUM,t.Ecc.QUARTILE,t.Ecc.HIGH])p&&f<=t.getNumDataCodewords(d,A)*8&&(l=A);let m=[];for(let A of a){e(A.mode.modeBits,4,m),e(A.numChars,A.mode.numCharCountBits(d),m);for(let k of A.getData())m.push(k)}s(m.length==f);let y=t.getNumDataCodewords(d,l)*8;s(m.length<=y),e(0,Math.min(4,y-m.length),m),e(0,(8-m.length%8)%8,m),s(m.length%8==0);for(let A=236;m.length<y;A^=253)e(A,8,m);let w=[];for(;w.length*8<m.length;)w.push(0);return m.forEach((A,k)=>w[k>>>3]|=A<<7-(k&7)),new t(d,l,w,u)}size;mask;modules=[];isFunction=[];getModule(a,l){return 0<=a&&a<this.size&&0<=l&&l<this.size&&this.modules[l][a]}drawFunctionPatterns(){for(let c=0;c<this.size;c++)this.setFunctionModule(6,c,c%2==0),this.setFunctionModule(c,6,c%2==0);this.drawFinderPattern(3,3),this.drawFinderPattern(this.size-4,3),this.drawFinderPattern(3,this.size-4);let a=this.getAlignmentPatternPositions(),l=a.length;for(let c=0;c<l;c++)for(let h=0;h<l;h++)c==0&&h==0||c==0&&h==l-1||c==l-1&&h==0||this.drawAlignmentPattern(a[c],a[h]);this.drawFormatBits(0),this.drawVersion()}drawFormatBits(a){let l=this.errorCorrectionLevel.formatBits<<3|a,c=l;for(let u=0;u<10;u++)c=c<<1^(c>>>9)*1335;let h=(l<<10|c)^21522;s(h>>>15==0);for(let u=0;u<=5;u++)this.setFunctionModule(8,u,i(h,u));this.setFunctionModule(8,7,i(h,6)),this.setFunctionModule(8,8,i(h,7)),this.setFunctionModule(7,8,i(h,8));for(let u=9;u<15;u++)this.setFunctionModule(14-u,8,i(h,u));for(let u=0;u<8;u++)this.setFunctionModule(this.size-1-u,8,i(h,u));for(let u=8;u<15;u++)this.setFunctionModule(8,this.size-15+u,i(h,u));this.setFunctionModule(8,this.size-8,!0)}drawVersion(){if(this.version<7)return;let a=this.version;for(let c=0;c<12;c++)a=a<<1^(a>>>11)*7973;let l=this.version<<12|a;s(l>>>18==0);for(let c=0;c<18;c++){let h=i(l,c),u=this.size-11+c%3,p=Math.floor(c/3);this.setFunctionModule(u,p,h),this.setFunctionModule(p,u,h)}}drawFinderPattern(a,l){for(let c=-4;c<=4;c++)for(let h=-4;h<=4;h++){let u=Math.max(Math.abs(h),Math.abs(c)),p=a+h,d=l+c;0<=p&&p<this.size&&0<=d&&d<this.size&&this.setFunctionModule(p,d,u!=2&&u!=4)}}drawAlignmentPattern(a,l){for(let c=-2;c<=2;c++)for(let h=-2;h<=2;h++)this.setFunctionModule(a+h,l+c,Math.max(Math.abs(h),Math.abs(c))!=1)}setFunctionModule(a,l,c){this.modules[l][a]=c,this.isFunction[l][a]=!0}addEccAndInterleave(a){let l=this.version,c=this.errorCorrectionLevel;if(a.length!=t.getNumDataCodewords(l,c))throw new RangeError("Invalid argument");let h=t.NUM_ERROR_CORRECTION_BLOCKS[c.ordinal][l],u=t.ECC_CODEWORDS_PER_BLOCK[c.ordinal][l],p=Math.floor(t.getNumRawDataModules(l)/8),d=h-p%h,f=Math.floor(p/h),m=[],y=t.reedSolomonComputeDivisor(u);for(let A=0,k=0;A<h;A++){let L=a.slice(k,k+f-u+(A<d?0:1));k+=L.length;let j=t.reedSolomonComputeRemainder(L,y);A<d&&L.push(0),m.push(L.concat(j))}let w=[];for(let A=0;A<m[0].length;A++)m.forEach((k,L)=>{(A!=f-u||L>=d)&&w.push(k[A])});return s(w.length==p),w}drawCodewords(a){if(a.length!=Math.floor(t.getNumRawDataModules(this.version)/8))throw new RangeError("Invalid argument");let l=0;for(let c=this.size-1;c>=1;c-=2){c==6&&(c=5);for(let h=0;h<this.size;h++)for(let u=0;u<2;u++){let p=c-u,f=(c+1&2)==0?this.size-1-h:h;!this.isFunction[f][p]&&l<a.length*8&&(this.modules[f][p]=i(a[l>>>3],7-(l&7)),l++)}}s(l==a.length*8)}applyMask(a){if(a<0||a>7)throw new RangeError("Mask value out of range");for(let l=0;l<this.size;l++)for(let c=0;c<this.size;c++){let h;switch(a){case 0:h=(c+l)%2==0;break;case 1:h=l%2==0;break;case 2:h=c%3==0;break;case 3:h=(c+l)%3==0;break;case 4:h=(Math.floor(c/3)+Math.floor(l/2))%2==0;break;case 5:h=c*l%2+c*l%3==0;break;case 6:h=(c*l%2+c*l%3)%2==0;break;case 7:h=((c+l)%2+c*l%3)%2==0;break;default:throw new Error("Unreachable")}!this.isFunction[l][c]&&h&&(this.modules[l][c]=!this.modules[l][c])}}getPenaltyScore(){let a=0;for(let u=0;u<this.size;u++){let p=!1,d=0,f=[0,0,0,0,0,0,0];for(let m=0;m<this.size;m++)this.modules[u][m]==p?(d++,d==5?a+=t.PENALTY_N1:d>5&&a++):(this.finderPenaltyAddHistory(d,f),p||(a+=this.finderPenaltyCountPatterns(f)*t.PENALTY_N3),p=this.modules[u][m],d=1);a+=this.finderPenaltyTerminateAndCount(p,d,f)*t.PENALTY_N3}for(let u=0;u<this.size;u++){let p=!1,d=0,f=[0,0,0,0,0,0,0];for(let m=0;m<this.size;m++)this.modules[m][u]==p?(d++,d==5?a+=t.PENALTY_N1:d>5&&a++):(this.finderPenaltyAddHistory(d,f),p||(a+=this.finderPenaltyCountPatterns(f)*t.PENALTY_N3),p=this.modules[m][u],d=1);a+=this.finderPenaltyTerminateAndCount(p,d,f)*t.PENALTY_N3}for(let u=0;u<this.size-1;u++)for(let p=0;p<this.size-1;p++){let d=this.modules[u][p];d==this.modules[u][p+1]&&d==this.modules[u+1][p]&&d==this.modules[u+1][p+1]&&(a+=t.PENALTY_N2)}let l=0;for(let u of this.modules)l=u.reduce((p,d)=>p+(d?1:0),l);let c=this.size*this.size,h=Math.ceil(Math.abs(l*20-c*10)/c)-1;return s(0<=h&&h<=9),a+=h*t.PENALTY_N4,s(0<=a&&a<=2568888),a}getAlignmentPatternPositions(){if(this.version==1)return[];{let a=Math.floor(this.version/7)+2,l=Math.floor((this.version*8+a*3+5)/(a*4-4))*2,c=[6];for(let h=this.size-7;c.length<a;h-=l)c.splice(1,0,h);return c}}static getNumRawDataModules(a){if(a<t.MIN_VERSION||a>t.MAX_VERSION)throw new RangeError("Version number out of range");let l=(16*a+128)*a+64;if(a>=2){let c=Math.floor(a/7)+2;l-=(25*c-10)*c-55,a>=7&&(l-=36)}return s(208<=l&&l<=29648),l}static getNumDataCodewords(a,l){return Math.floor(t.getNumRawDataModules(a)/8)-t.ECC_CODEWORDS_PER_BLOCK[l.ordinal][a]*t.NUM_ERROR_CORRECTION_BLOCKS[l.ordinal][a]}static reedSolomonComputeDivisor(a){if(a<1||a>255)throw new RangeError("Degree out of range");let l=[];for(let h=0;h<a-1;h++)l.push(0);l.push(1);let c=1;for(let h=0;h<a;h++){for(let u=0;u<l.length;u++)l[u]=t.reedSolomonMultiply(l[u],c),u+1<l.length&&(l[u]^=l[u+1]);c=t.reedSolomonMultiply(c,2)}return l}static reedSolomonComputeRemainder(a,l){let c=l.map(h=>0);for(let h of a){let u=h^c.shift();c.push(0),l.forEach((p,d)=>c[d]^=t.reedSolomonMultiply(p,u))}return c}static reedSolomonMultiply(a,l){if(a>>>8||l>>>8)throw new RangeError("Byte out of range");let c=0;for(let h=7;h>=0;h--)c=c<<1^(c>>>7)*285,c^=(l>>>h&1)*a;return s(c>>>8==0),c}finderPenaltyCountPatterns(a){let l=a[1];s(l<=this.size*3);let c=l>0&&a[2]==l&&a[3]==l*3&&a[4]==l&&a[5]==l;return(c&&a[0]>=l*4&&a[6]>=l?1:0)+(c&&a[6]>=l*4&&a[0]>=l?1:0)}finderPenaltyTerminateAndCount(a,l,c){return a&&(this.finderPenaltyAddHistory(l,c),l=0),l+=this.size,this.finderPenaltyAddHistory(l,c),this.finderPenaltyCountPatterns(c)}finderPenaltyAddHistory(a,l){l[0]==0&&(a+=this.size),l.pop(),l.unshift(a)}static MIN_VERSION=1;static MAX_VERSION=40;static PENALTY_N1=3;static PENALTY_N2=3;static PENALTY_N3=40;static PENALTY_N4=10;static ECC_CODEWORDS_PER_BLOCK=[[-1,7,10,15,20,26,18,20,24,30,18,20,24,26,30,22,24,28,30,28,28,28,28,30,30,26,28,30,30,30,30,30,30,30,30,30,30,30,30,30,30],[-1,10,16,26,18,24,16,18,22,22,26,30,22,22,24,24,28,28,26,26,26,26,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28],[-1,13,22,18,26,18,24,18,22,20,24,28,26,24,20,30,24,28,28,26,30,28,30,30,30,30,28,30,30,30,30,30,30,30,30,30,30,30,30,30,30],[-1,17,28,22,16,22,28,26,26,24,28,24,28,22,24,24,30,28,28,26,28,30,24,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30]];static NUM_ERROR_CORRECTION_BLOCKS=[[-1,1,1,1,1,1,2,2,2,2,4,4,4,4,4,6,6,6,6,7,8,8,9,9,10,12,12,12,13,14,15,16,17,18,19,19,20,21,22,24,25],[-1,1,1,1,2,2,4,4,4,5,5,5,8,9,9,10,10,11,13,14,16,17,17,18,20,21,23,25,26,28,29,31,33,35,37,38,40,43,45,47,49],[-1,1,1,2,2,4,4,6,6,8,8,8,10,12,16,12,17,16,18,21,20,23,23,25,27,29,34,34,35,38,40,43,45,48,51,53,56,59,62,65,68],[-1,1,1,2,4,4,4,5,6,8,8,11,11,16,16,18,16,19,21,25,25,25,34,30,32,35,37,40,42,45,48,51,54,57,60,63,66,70,74,77,81]]}r.QrCode=t;function e(o,a,l){if(a<0||a>31||o>>>a)throw new RangeError("Value out of range");for(let c=a-1;c>=0;c--)l.push(o>>>c&1)}function i(o,a){return(o>>>a&1)!=0}function s(o){if(!o)throw new Error("Assertion error")}class n{constructor(a,l,c){if(this.mode=a,this.numChars=l,this.bitData=c,l<0)throw new RangeError("Invalid argument");this.bitData=c.slice()}mode;numChars;bitData;static makeBytes(a){let l=[];for(let c of a)e(c,8,l);return new n(n.Mode.BYTE,a.length,l)}static makeNumeric(a){if(!n.isNumeric(a))throw new RangeError("String contains non-numeric characters");let l=[];for(let c=0;c<a.length;){let h=Math.min(a.length-c,3);e(parseInt(a.substring(c,c+h),10),h*3+1,l),c+=h}return new n(n.Mode.NUMERIC,a.length,l)}static makeAlphanumeric(a){if(!n.isAlphanumeric(a))throw new RangeError("String contains unencodable characters in alphanumeric mode");let l=[],c;for(c=0;c+2<=a.length;c+=2){let h=n.ALPHANUMERIC_CHARSET.indexOf(a.charAt(c))*45;h+=n.ALPHANUMERIC_CHARSET.indexOf(a.charAt(c+1)),e(h,11,l)}return c<a.length&&e(n.ALPHANUMERIC_CHARSET.indexOf(a.charAt(c)),6,l),new n(n.Mode.ALPHANUMERIC,a.length,l)}static makeSegments(a){return a==""?[]:n.isNumeric(a)?[n.makeNumeric(a)]:n.isAlphanumeric(a)?[n.makeAlphanumeric(a)]:[n.makeBytes(n.toUtf8ByteArray(a))]}static makeEci(a){let l=[];if(a<0)throw new RangeError("ECI assignment value out of range");if(a<128)e(a,8,l);else if(a<16384)e(2,2,l),e(a,14,l);else if(a<1e6)e(6,3,l),e(a,21,l);else throw new RangeError("ECI assignment value out of range");return new n(n.Mode.ECI,0,l)}static isNumeric(a){return n.NUMERIC_REGEX.test(a)}static isAlphanumeric(a){return n.ALPHANUMERIC_REGEX.test(a)}getData(){return this.bitData.slice()}static getTotalBits(a,l){let c=0;for(let h of a){let u=h.mode.numCharCountBits(l);if(h.numChars>=1<<u)return 1/0;c+=4+u+h.bitData.length}return c}static toUtf8ByteArray(a){a=encodeURI(a);let l=[];for(let c=0;c<a.length;c++)a.charAt(c)!="%"?l.push(a.charCodeAt(c)):(l.push(parseInt(a.substring(c+1,c+3),16)),c+=2);return l}static NUMERIC_REGEX=/^[0-9]*$/;static ALPHANUMERIC_REGEX=/^[A-Z0-9 $%*+.\/:-]*$/;static ALPHANUMERIC_CHARSET="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:"}r.QrSegment=n})(X||(X={}));(r=>{let t;(e=>{class i{constructor(n,o){this.ordinal=n,this.formatBits=o}ordinal;formatBits;static LOW=new i(0,1);static MEDIUM=new i(1,0);static QUARTILE=new i(2,3);static HIGH=new i(3,2)}e.Ecc=i})(t=r.QrCode||(r.QrCode={}))})(X||(X={}));(r=>{let t;(e=>{class i{constructor(n,o){this.modeBits=n,this.numBitsCharCount=o}modeBits;numBitsCharCount;static NUMERIC=new i(1,[10,12,14]);static ALPHANUMERIC=new i(2,[9,11,13]);static BYTE=new i(4,[8,16,16]);static KANJI=new i(8,[8,10,12]);static ECI=new i(7,[0,0,0]);numCharCountBits(n){return this.numBitsCharCount[Math.floor((n+7)/17)]}}e.Mode=i})(t=r.QrSegment||(r.QrSegment={}))})(X||(X={}));var pt=X.QrCode,Js=X.QrSegment;var Uo=4,Ke=["L","M","Q","H"],Ge=[pt.Ecc.LOW,pt.Ecc.MEDIUM,pt.Ecc.QUARTILE,pt.Ecc.HIGH];function Qs(r){if(r==null||r.trim()==="")return 1;let t=r.trim().toUpperCase(),e=Ke.indexOf(t);return e!==-1?e:/^[0-3]$/.test(t)?Number(t):null}function tr(r,t=1){let e=Ge[t]??Ge[1],i;try{i=pt.encodeSegments(Js.makeSegments(r),e,1,40,-1,!1)}catch(n){let o=new RangeError(n instanceof Error?n.message:String(n));throw o.reason=/too long/i.test(o.message)?"capacity":"encoding",o}let s=[];for(let n=0;n<i.size;n++){let o=[];for(let a=0;a<i.size;a++)o.push(i.getModule(a,n));s.push(o)}return{version:i.version,size:i.size,ecl:Ge.indexOf(e),modules:s}}function er(r,t){let e=r+Uo*2,i=Math.max(1,Math.floor(t/e)),s=Math.max(t,i*e),n=Math.floor((s-i*r)/2);return{cell:i,offset:n,edge:s}}function Zs([r,t,e]){let i=s=>{let n=s/255;return n<=.03928?n/12.92:((n+.055)/1.055)**2.4};return .2126*i(r)+.7152*i(t)+.0722*i(e)}function ir(r,t){let e=[];(t[3]??1)<1&&e.push("the background is not opaque, so the code takes on whatever is behind it"),(r[3]??1)<1&&e.push("the module colour is not opaque");let i=Zs(r),s=Zs(t);i>s&&e.push("modules are lighter than the background (inverted codes are rejected by many scanners)");let n=(Math.max(i,s)+.05)/(Math.min(i,s)+.05);return n<4&&e.push(`contrast is ${n.toFixed(2)}:1 (aim for at least 4:1)`),e}var Vo=200,Wo="#000",Go="#fff",sr=200,Ye=class extends b{#t=null;#e=null;#i="";#s=!1;#r="";#n="";static get observedAttributes(){return["value","size","color","background","error-correction","data-label-prefix"]}get value(){return this.getAttribute("value")||this.#i}set value(t){t==null||t===""?this.removeAttribute("value"):this.setAttribute("value",String(t))}setup(){if(!this.#e){this.#i=(this.textContent??"").trim();let t=document.createElement("span");t.setAttribute("data-qr-caption",""),t.append(...this.childNodes),!this.#i&&!t.children.length&&(t.textContent=this.value,this.#s=!0),this.#e=t}return this.#t||(this.#t=document.createElement("canvas"),this.#t.setAttribute("role","img")),this.#t.parentNode!==this&&this.prepend(this.#t),this.#e.parentNode!==this&&this.append(this.#e),this.#c(),this.#a(),!0}#a(){if(typeof window.matchMedia!="function")return;let t=window.matchMedia(`(resolution: ${window.devicePixelRatio||1}dppx)`);this.listen(t,"change",()=>{this.isConnected&&(this.#c(),this.#a())},{once:!0})}attributeChangedCallback(){!this.hasAttribute("data-upgraded")||!this.isConnected||this.#c()}#c(){this.#h(this.#l())}#h(t){let e=this.#t,i=this.#e,s=t?this.value:"",n=this.getAttribute("data-label-prefix"),o=s.length>sr?`${s.slice(0,sr)}\u2026`:s;e.setAttribute("aria-label",n||(s?`QR code: ${o}`:"QR code")),n&&s?e.setAttribute("aria-description",s):e.removeAttribute("aria-description"),!n&&!!s&&o===s&&!i.children.length&&(i.textContent??"").trim()===s?i.setAttribute("aria-hidden","true"):i.removeAttribute("aria-hidden")}#l(){let t=this.#t,e=this.value;if(this.#s&&this.#e&&this.#e.textContent!==e&&(this.#e.textContent=e),this.removeAttribute("data-error"),!e)return this.#o(),!1;let i=this.getAttribute("error-correction"),s=Qs(i);s===null&&(console.warn(`<qr-code>: error-correction="${i}" is not L, M, Q, H or 0-3; using M.`),s=1);let n;try{n=tr(e,s)}catch(f){let m=f.reason||"encoding";return this.#o(),this.setAttribute("data-error",m),this.dispatchEvent(new CustomEvent("qr-code:error",{bubbles:!0,detail:{reason:m,value:e,errorCorrection:Ke[s],message:f.message}})),!1}let o=Math.max(1,parseInt(this.getAttribute("size")??"",10)||Vo),a=Math.max(1,window.devicePixelRatio||1),{cell:l,offset:c,edge:h}=er(n.size,Math.round(o*a));t.hidden=!1,t.width=h,t.height=h,t.style.inlineSize=`${o}px`;let u=this.#u(this.getAttribute("color"),Wo),p=this.#u(this.getAttribute("background"),Go);this.#p(u,p);let d=t.getContext("2d");if(!d)return!1;d.clearRect(0,0,h,h),d.fillStyle=p.css,d.fillRect(0,0,h,h),d.fillStyle=u.css;for(let f=0;f<n.size;f++)for(let m=0;m<n.size;m++)n.modules[f][m]&&d.fillRect(c+m*l,c+f*l,l,l);return this.#r=e,!0}#o(){let t=this.#t;t.hidden=!0,t.width=0,t.height=0,this.#r=""}#u(t,e){let i=this.#t,s=t?.trim()||e,n=i.style.color;i.style.color="",i.style.color=s,i.style.color||(console.warn(`<qr-code>: "${s}" is not a valid colour; using ${e}.`),i.style.color=e);let o=getComputedStyle(i).color;i.style.color=n;let a=(o.match(/[\d.]+/g)||[]).map(Number),l=[a[0]??0,a[1]??0,a[2]??0,a[3]??1];return{css:o,rgba:l}}#p(t,e){if(!this.hasAttribute("color")&&!this.hasAttribute("background"))return;let i=`${t.css}|${e.css}`;if(i===this.#n)return;this.#n=i;let s=ir(t.rgba,e.rgba);s.length&&console.warn(`<qr-code>: color="${t.css}" on background="${e.css}" may not scan: ${s.join("; ")}.`,this)}toDataURL(t="image/png"){return!this.#t||!this.#r?"":this.#t.toDataURL(t)}async copy({button:t}={}){let e=this.#t;if(!e||!this.#r)return!1;let i=this.#r,s=await new Promise(n=>e.toBlob(n,"image/png"));return Ys({text:i,blob:s||void 0},{button:t,announceMessage:this.getAttribute("data-label-copied")||"QR code copied"})}};g("qr-code",Ye);var Ko="Slide to confirm",Yo="Confirmed!",Xo="Press Enter to confirm",rr=6,Xe=class extends b{static formAssociated=!0;static observedAttributes=["label","activated-label","data-label-hint","data-label-required","required","value"];#t;#e;#i;#s;#r;#n=!1;#a=0;#c=0;#h=0;#l=0;#o=!1;#u=!1;#p=!1;#d="";#f;constructor(){super(),this.#t=this.attachInternals(),this._adoptInternals(this.#t)}get activated(){return this.#o}get#v(){let t=this.getAttribute("threshold"),e=Number(t);return t!==null&&t.trim()!==""&&!isNaN(e)?Math.min(100,Math.max(0,e)):90}get#y(){return this.getAttribute("label")||this.#d||Ko}get#g(){return this.getAttribute("activated-label")||Yo}get#w(){return getComputedStyle(this).direction==="rtl"}setup(){this.#p||(this.#A(),this.#p=!0),this.listen(this.#e,"pointerdown",this.#T),this.listen(this.#e,"keydown",this.#O),this.listen(this.#e,"transitionend",this.#I)}teardown(){this.#n&&this.#k(),clearTimeout(this.#f),this.removeAttribute("transitioning")}attributeChangedCallback(t,e,i){e===i||!this.#p||(this.#m(),(t==="required"||t==="value"||t==="data-label-required"||t==="label")&&this.#S())}#A(){this.#d=(this.textContent||"").replace(/\s+/g," ").trim(),this.#r=document.createElement("div"),this.#r.className="slide-track",this.#i=document.createElement("span"),this.#i.className="slide-label",this.#i.setAttribute("role","status"),this.#s=document.createElement("span"),this.#s.className="visually-hidden slide-hint",this.#s.id=`slide-hint-${Math.random().toString(36).slice(2,9)}`,this.#e=document.createElement("div"),this.#e.className="slide-handle",this.#e.setAttribute("role","slider"),this.#e.setAttribute("aria-valuemin","0"),this.#e.setAttribute("aria-valuemax","100"),this.#e.setAttribute("aria-describedby",this.#s.id),this.#e.setAttribute("tabindex","0"),this.#e.innerHTML='<icon-wc name="chevrons-right" size="sm"></icon-wc>',this.#r.append(this.#i,this.#e),this.textContent="",this.append(this.#r,this.#s),this.#m(),this.#_(0),this.#S()}#m(){let t=this.#y;this.#i.textContent=this.#o?this.#g:t,this.#e.setAttribute("aria-label",t),this.#s.textContent=this.getAttribute("data-label-hint")||Xo,this.#b()}#b(){this.#e.setAttribute("aria-valuetext",this.#o?this.#g:`${Math.round(this.#a)}%`)}#S(){let t=this.getAttribute("value")||"on";if(this.#t.setFormValue(this.#o?t:null),this.hasAttribute("required")&&!this.#o){let e=(this.getAttribute("data-label-required")||"{label} to continue.").replace("{label}",this.#y);this.#t.setValidity({valueMissing:!0},e,this.#e)}else this.#t.setValidity({})}reset(){this.#o=!1,this.removeAttribute("data-activated"),this.#e.removeAttribute("aria-disabled"),this.#x(),this.#_(0),this.#m(),this.#S(),this.dispatchEvent(new CustomEvent("slide-accept:reset",{bubbles:!0}))}formResetCallback(){(this.#o||this.#a!==0)&&this.reset()}formDisabledCallback(t){this.#u=t,t&&this.#n&&(this.#k(),this.#P()),this.#x()}#x(){this.#e&&(this.#o||this.#u?this.#e.setAttribute("aria-disabled","true"):this.#e.removeAttribute("aria-disabled"))}#T=t=>{if(!(this.#o||this.#u)&&t.button===0){if(t.preventDefault(),this.#e.focus({preventScroll:!0}),this.hasAttribute("transitioning")){let e=this.#e.getBoundingClientRect(),i=this.#r.getBoundingClientRect(),s=parseFloat(getComputedStyle(this.#r).getPropertyValue("--_handle-inset")||"0"),n=this.#e.offsetWidth,o=i.width-n-s*2,a=this.#w?i.right-e.right-s:e.left-i.left-s;this.removeAttribute("transitioning"),clearTimeout(this.#f),this.#_(o>0?Math.max(0,Math.min(100,a/o*100)):0)}this.#n=!0,this.#c=t.clientX,this.#h=this.#a,this.#l=0;try{this.#e.setPointerCapture(t.pointerId)}catch{}this.setAttribute("data-dragging",""),this.#e.addEventListener("pointermove",this.#E),this.#e.addEventListener("pointerup",this.#M),this.#e.addEventListener("pointercancel",this.#C)}};#E=t=>{if(!this.#n)return;let e=this.#r.getBoundingClientRect().width-this.#e.offsetWidth;if(e<=0)return;let i=t.clientX-this.#c;this.#l=Math.max(this.#l,Math.abs(i));let n=(this.#w?-i:i)/e*100;this.#_(Math.min(100,Math.max(0,this.#h+n)))};#k(t){if(this.#n=!1,this.removeAttribute("data-dragging"),t)try{this.#e.releasePointerCapture(t.pointerId)}catch{}this.#e.removeEventListener("pointermove",this.#E),this.#e.removeEventListener("pointerup",this.#M),this.#e.removeEventListener("pointercancel",this.#C)}#M=t=>{if(!this.#n)return;let e=this.#l<rr&&Math.abs(t.clientX-this.#c)<rr;this.#k(t),e||this.#a>=this.#v?this.#N():this.#P()};#C=t=>{this.#n&&(this.#k(t),this.#P())};#O=t=>{if(this.#o||this.#u)return;let e=t.shiftKey?20:5,i=this.#w,s=i?"ArrowLeft":"ArrowRight",n=i?"ArrowRight":"ArrowLeft";t.key===s||t.key==="ArrowUp"?(t.preventDefault(),this.#_(Math.min(100,this.#a+e)),this.#a>=this.#v&&this.#N()):t.key===n||t.key==="ArrowDown"?(t.preventDefault(),this.#_(Math.max(0,this.#a-e))):t.key==="End"||t.key==="Enter"||t.key===" "?(t.preventDefault(),this.#N()):t.key==="Home"&&(t.preventDefault(),this.#_(0))};#I=()=>{this.removeAttribute("transitioning")};#N(){this.#o||(this.#o=!0,this.#_(100),this.setAttribute("data-activated",""),this.#x(),this.#m(),this.#S(),this.dispatchEvent(new CustomEvent("slide-accept:accept",{bubbles:!0})))}#P(){this.setAttribute("transitioning",""),this.#_(0),clearTimeout(this.#f),this.#f=setTimeout(()=>{this.removeAttribute("transitioning")},500)}#_(t){this.#a=t,this.style.setProperty("--_slide-position",String(t)),this.#e.setAttribute("aria-valuenow",String(Math.round(t))),this.#b()}};g("slide-accept",Xe);var Yt="banner",nr=365,or=864e5;function ar(r){if(r===0||r==="0"||r==="never")return;let t=r==null||r===""?nr:Number.parseFloat(String(r));return Number.isFinite(t)?t>0?t*or:void 0:nr*or}var Jo=0,Je=class extends b{#t=null;static get observedAttributes(){return["position"]}get#e(){return this.getAttribute("persist")||Yt}get#i(){return ar(this.getAttribute("expires"))}get#s(){return this.getAttribute("position")==="center"}setup(){return this.#t=this.querySelector("dialog"),this.#t?(this.#r(),this.getAttribute("trigger")&&this.listen(document,"click",this.#u),this.listen(this,"click",this.#o),this.listen(this.#t,"cancel",this.#l),this.#n(),!0):!1}attributeChangedCallback(t,e,i){e===i||!this.#t?.open||(this.#t.close(),this.#a())}#r(){let t=this.#t;if(t.hasAttribute("aria-label")||t.hasAttribute("aria-labelledby"))return;let e=t.querySelector("h1, h2, h3, h4, h5, h6");e?(e.id||(e.id=`consent-banner-title-${++Jo}`),t.setAttribute("aria-labelledby",e.id)):t.setAttribute("aria-label","Cookie consent")}async#n(){if(await this.#p()){this.getAttribute("trigger")?this.hidden=!0:this.remove();return}this.#c()}#a(){this.#s?this.#t.showModal():this.#t.show()}#c(){!this.isConnected||this.#t.open||this.#a()}#h(){this.#t.close(),this.getAttribute("trigger")?this.hidden=!0:this.remove()}#l=t=>{this.#s&&t.preventDefault()};#o=async t=>{if(!this.#t.open)return;let e=t.target.closest("button[value]");if(!e||!this.#t.contains(e))return;let i=e.value;if(!["accept","reject","save"].includes(i))return;let s=[...this.querySelectorAll('input[type="checkbox"]')],n={};i==="accept"?s.forEach(o=>{n[o.name]=!0}):i==="reject"?s.forEach(o=>{n[o.name]=!!o.disabled}):s.forEach(o=>{n[o.name]=o.checked}),await this.#d({preferences:n,action:i}),this.dispatchEvent(new CustomEvent("consent-banner:change",{bubbles:!0,detail:{preferences:n,action:i}})),this.#h()};#u=async t=>{let e=this.getAttribute("trigger");if(!e||!t.target.closest(e))return;t.preventDefault();let s=await this.#p();if(s?.preferences)for(let[n,o]of Object.entries(s.preferences)){let a=this.querySelector(`input[type="checkbox"][name="${CSS.escape(n)}"]`);a&&!a.disabled&&(a.checked=o)}this.hidden=!1,this.#c()};async#p(){let t=this.#i;try{return await $.get("consent",this.#e,t?{maxAge:t}:void 0)}catch{return null}}async#d(t){try{await $.set("consent",this.#e,t)}catch{}}static async reset(t=Yt){try{await $.remove("consent",t)}catch{}}static async getConsent(t=Yt,e={}){let i=e.expires;i===void 0&&typeof document<"u"&&(i=[...document.querySelectorAll("consent-banner")].find(o=>(o.getAttribute("persist")||Yt)===t)?.getAttribute("expires")??void 0);let s=ar(i);try{return await $.get("consent",t,s?{maxAge:s}:void 0)}catch{return null}}};g("consent-banner",Je);var Zo={play:"Play",pause:"Pause",stop:"Stop",reader:"Article reader",controls:"Reader controls",voice:"Voice","loading-voices":"Loading voices\u2026",speed:"Speed",slower:"Slower",faster:"Faster"},lr='[aria-hidden="true"], [hidden], script, style, template, text-reader',Qo=()=>typeof HTMLElement<"u"&&Object.prototype.hasOwnProperty.call(HTMLElement.prototype,"popover"),Ze=()=>typeof window<"u"&&"speechSynthesis"in window,Lt=r=>(r||"").toLowerCase().split(/[-_]/)[0],Qe=class extends b{#t=null;#e=null;#i=[];#s="";#r=0;#n=null;#a=null;#c=null;#h=null;#l=!1;#o=!1;#u=0;#p=null;#d=null;#f=null;#v=null;#y=null;#g=null;#w=null;#A=!1;#m=null;#b=null;#S=[];#x=[];static get observedAttributes(){return["speed","voice","for"]}attributeChangedCallback(t,e,i){if(e!==i&&(t==="for"&&e!==null&&this.hasAttribute("data-upgraded")&&(this.#l&&this.stop(),this.#F(),this.#st(this.#x)),(t==="speed"||t==="voice")&&this.#l&&this.#q(),t==="speed")){let s=this.#X(parseFloat(i)||1);this.#y&&(this.#y.value=String(s)),this.#g&&(this.#g.textContent=`${s}\xD7`)}}setup(){return Ze()?(this.getAttribute("variant")==="icon"?this.#C():this.#T(),this.#F(),this.#U(),this.#h=this.#it(),this.#h.then(t=>{this.#x=t,this.#st(t)}),this.listen(window,"beforeunload",this.#at),!0):(this.style.display="none",!1)}teardown(){this.#l&&this.stop(),this.#W(),this.#w?.remove(),this.#b?.remove(),this.#m?.remove(),this.#w=null,this.#b=null,this.#m=null,this.#p=this.#d=this.#f=null,this.#v=null,this.#y=null,this.#g=null,this.#A=!1;for(let{icon:t,slot:e}of this.#S)t.setAttribute("slot",e),this.append(t);this.#S=[]}play(){if(Ze()){if(this.#o){this.resume();return}this.#l||(this.#$(),this.#G(0))}}pause(){!this.#l||this.#o||(speechSynthesis.pause(),this.#o=!0,this.#Y(!0),this.#V("text-reader:pause"))}resume(){this.#o&&(speechSynthesis.resume(),this.#o=!1,this.#Y(!1),this.#V("text-reader:resume"))}stop(){!Ze()||!this.#l||(this.#e=null,speechSynthesis.cancel(),this.#J(),this.#V("text-reader:stop"))}get voices(){return this.#h||this.#it()}get speaking(){return this.#l}get paused(){return this.#o}get progress(){return this.#s.length?Math.min(this.#r/this.#s.length,1):0}#T(){let t=document.createElement("div");t.setAttribute("part","controls"),t.setAttribute("role","group"),t.setAttribute("aria-label",this.#k("reader"));let e=this.#E("play",this.#k("play"),"\u25B6");e.addEventListener("click",()=>this.play());let i=this.#E("pause",this.#k("pause"),"\u23F8");i.hidden=!0,i.addEventListener("click",()=>this.pause());let s=this.#E("stop",this.#k("stop"),"\u23F9");s.disabled=!0,s.addEventListener("click",()=>this.stop());let n=document.createElement("select");n.setAttribute("aria-label",this.#k("voice"));let o=document.createElement("option");o.textContent=this.#k("loading-voices"),n.append(o),n.addEventListener("change",()=>{this.#l&&this.#q()});let a=document.createElement("label");a.setAttribute("data-speed-group","");let l=document.createElement("span");l.setAttribute("data-speed-value","");let c=this.#X(parseFloat(this.getAttribute("speed")??"1")||1);l.textContent=`${c}\xD7`;let h=document.createElement("input");h.type="range",h.min="0.5",h.max="2",h.step="0.1",h.value=String(c),h.setAttribute("aria-label",this.#k("speed")),h.addEventListener("input",()=>{let u=parseFloat(h.value);l.textContent=`${u}\xD7`,this.#l&&this.#q()}),a.append(l,h),this.#M("icon-play",e),this.#M("icon-pause",i),this.#M("icon-stop",s),t.append(e,i,s,n,a),this.prepend(t),this.#w=t,this.#p=e,this.#d=i,this.#f=s,this.#v=n,this.#y=h,this.#g=l}#E(t,e,i){let s=document.createElement("button");return s.type="button",s.setAttribute("part",`button ${t}`),s.setAttribute("aria-label",e),s.textContent=i,s}#k(t){return this.getAttribute(`data-label-${t}`)||Zo[t]}#M(t,e){let i=this.querySelector(`:scope > [slot="${t}"]`);i&&(i.removeAttribute("slot"),e.textContent="",e.append(i),this.#S.push({icon:i,slot:t}))}#C(){this.#A=!0;for(let i of this.querySelectorAll(':scope > [part="trigger"]'))i.remove();let t=document.createElement("button");t.type="button",t.setAttribute("part","trigger"),t.setAttribute("aria-label",this.#k("reader")),t.setAttribute("aria-pressed","false");let e=this.querySelector(':scope > [slot="icon-trigger"]');if(e)e.removeAttribute("slot"),t.append(e),this.#S.push({icon:e,slot:"icon-trigger"});else{let i=document.createElement("icon-wc");i.setAttribute("name","volume-2"),i.setAttribute("aria-hidden","true"),t.append(i)}t.addEventListener("click",()=>this.#I()),this.append(t),this.#m=t,this.#O()}#O(){let t=document.createElement("div");t.setAttribute("data-text-reader-toolbar",""),t.setAttribute("role","group"),t.setAttribute("aria-label",this.#k("controls")),t.hidden=!0,Qo()&&(t.popover="manual");let e=this.#E("play",this.#k("play"),"\u25B6");e.addEventListener("click",()=>this.play());let i=this.#E("pause",this.#k("pause"),"\u23F8");i.hidden=!0,i.addEventListener("click",()=>this.pause());let s=this.#E("stop",this.#k("stop"),"\u23F9");s.addEventListener("click",()=>this.stop());let n=this.#E("speed-down",this.#k("slower"),"\u2212");n.addEventListener("click",()=>this.#L(-.1));let o=document.createElement("span");o.setAttribute("data-speed-value","");let a=this.#X(parseFloat(this.getAttribute("speed")??"1")||1);o.textContent=`${a}\xD7`;let l=this.#E("speed-up",this.#k("faster"),"+");l.addEventListener("click",()=>this.#L(.1)),this.#M("icon-play",e),this.#M("icon-pause",i),this.#M("icon-stop",s),t.append(e,i,s,n,o,l),this.append(t),this.#p=e,this.#d=i,this.#f=s,this.#g=o,this.#b=t,this.listen(document,"pointerdown",this.#z),this.listen(this,"keydown",this.#j)}#I(){if(!this.#l){this.play();return}this.#b?.hidden&&this.#N(),this.#o?this.resume():this.pause()}#N(){if(!this.#b||!this.#m)return;let t=this.#b;t.hidden=!1,t.popover&&!t.matches(":popover-open")&&t.showPopover(),t.style.visibility="hidden",requestAnimationFrame(()=>{this.#_(),t.style.visibility=""})}#P(){let t=this.#b;if(!t||t.hidden)return;let e=t.contains(document.activeElement);t.popover&&t.matches(":popover-open")&&t.hidePopover(),t.hidden=!0,e&&this.#m?.focus()}#_(){let t=this.#b,e=this.#m;if(!t||!e)return;let i=e.getBoundingClientRect(),s=t.offsetWidth,n=t.offsetHeight,o=8,a=8,l=i.top-n-o;l<a&&(l=i.bottom+o);let c=i.left+i.width/2-s/2,h=window.innerWidth-s-a;c=Math.max(a,Math.min(c,h)),t.style.top=`${l}px`,t.style.left=`${c}px`}#L(t){let e=parseFloat(this.getAttribute("speed")??"1")||1,i=this.#X(e+t);this.setAttribute("speed",String(i))}#z=t=>{!this.#b||this.#b.hidden||this.#b.contains(t.target)||this.#m?.contains(t.target)||this.#P()};#j=t=>{t.key!=="Escape"||t.defaultPrevented||!this.#b||this.#b.hidden||this.contains(t.target)&&(t.preventDefault(),this.#P(),this.#m?.focus())};#F(){let t=this.getAttribute("for");if(!t){console.warn('<text-reader>: missing "for" attribute'),this.#D();return}if(this.#t=document.getElementById(t),!this.#t){console.warn(`<text-reader>: no element found with id="${t}"`),this.#D();return}this.#$(),this.#B()}#D(){this.#p&&(this.#p.disabled=!0),this.#f&&(this.#f.disabled=!0)}#B(){this.#p&&(this.#p.disabled=!1)}#$(){let t=this.#t;if(!t)return;let e=this.getAttribute("selectors")||"p,li",i=[...t.querySelectorAll(e)],s=o=>o.closest("pre")||o.closest("code")||o.closest(lr);this.#i=[];let n=0;for(let o of i){if(s(o))continue;let a=[],l="",c=document.createTreeWalker(o,NodeFilter.SHOW_TEXT,{acceptNode:h=>h.parentElement?.closest(lr)?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT});for(;c.nextNode();){let h=c.currentNode,u=h.data;u&&(a.push({node:h,start:l.length,end:l.length+u.length}),l+=u)}l.trim()&&(this.#i.push({element:o,text:l,speechStart:n,speechEnd:n+l.length,segments:a}),n+=l.length+1)}this.#s=this.#i.map(o=>o.text).join(" ")}#R(){return this.#t?.closest("[lang]")?.getAttribute("lang")||document.documentElement.lang||""}#G(t){if(!this.#s)return;let e=t>0?this.#s.slice(t):this.#s;if(!e.trim())return;let i=e.replace(/[<>]/g," "),s=new SpeechSynthesisUtterance(i),n=this.#R();n&&(s.lang=n),s.rate=this.#X(parseFloat(this.#y?.value??this.getAttribute("speed")??"1")||1);let o=this.#v?.selectedOptions[0];if(o?.dataset.voiceUri){let a=speechSynthesis.getVoices().find(l=>l.voiceURI===o.dataset.voiceUri);a&&(s.voice=a)}else if(n){let a=Lt(n),l=speechSynthesis.getVoices(),c=l.find(h=>h.lang.toLowerCase()===n.toLowerCase())||l.find(h=>Lt(h.lang)===a&&h.default)||l.find(h=>Lt(h.lang)===a);c&&(s.voice=c)}s.onboundary=a=>{if(this.#e!==s||a.name!=="word")return;let l=t+a.charIndex;this.#r=l;let c=a.charLength;if(!c){let u=this.#s.slice(l).match(/^\S+/);c=u?u[0].length:1}this.#Z(l,c),this.#V("text-reader:word",{word:this.#s.slice(l,l+c),charIndex:l,element:this.#Q(l)?.element})},s.onend=()=>{if(this.#e!==s)return;let a=Date.now()-this.#u;this.#J(),this.#V("text-reader:end",{duration:a})},s.onerror=a=>{if(this.#e===s){if(a.error==="interrupted"||a.error==="canceled"){this.#J(),this.#V("text-reader:stop");return}console.warn("<text-reader>: SpeechSynthesisUtterance error:",a.error),this.#J(),this.#V("text-reader:error",{error:a.error})}},this.#e=s,this.#l=!0,this.#o=!1,this.#u=Date.now(),this.#r=t,this.#nt(!0),speechSynthesis.cancel(),speechSynthesis.speak(s),this.#K(),this.#V("text-reader:play",{voice:s.voice?.name,speed:s.rate})}#q(){let t=this.#r;this.#e=null,speechSynthesis.cancel(),this.#H(),requestAnimationFrame(()=>this.#G(t))}#K(){this.#H(),this.#n=setInterval(()=>{if(!speechSynthesis.speaking){this.#H();return}speechSynthesis.pause(),speechSynthesis.resume()},1e4)}#H(){this.#n&&clearInterval(this.#n),this.#n=null}#U(){if(!CSS.highlights)return;let t=new CSSStyleSheet;t.replaceSync(`
1250
1250
  ::highlight(text-reader-word) {
1251
1251
  background-color: var(--text-reader-highlight, Mark);
1252
1252
  color: var(--text-reader-highlight-text, MarkText);
1253
1253
  }
1254
- `),this.#a=t,document.adoptedStyleSheets=[...document.adoptedStyleSheets,t]}#W(){let t=this.#a;t&&(document.adoptedStyleSheets=document.adoptedStyleSheets.filter(e=>e!==t),this.#a=null),this.#et()}#Z(t,e){if(!CSS.highlights||this.getAttribute("highlight")==="false")return;let i=this.#Q(t);if(!i)return;let s=t-i.speechStart,n=this.#rt(i,s,e);if(!n)return;let o=new Highlight(n);if(CSS.highlights.set("text-reader-word",o),this.#c=o,this.getAttribute("scroll")!=="false"){let a=n.getBoundingClientRect(),l=window.innerHeight;if(a.top<0||a.bottom>l){let c=window.matchMedia?.("(prefers-reduced-motion: reduce)").matches;i.element.scrollIntoView({behavior:c?"auto":"smooth",block:"nearest"})}}}#et(){CSS.highlights&&CSS.highlights.delete("text-reader-word"),this.#c=null}#Q(t){let e=this.#i,i=0,s=e.length-1;for(;i<=s;){let n=i+s>>>1,o=e[n];if(t<o.speechStart)s=n-1;else if(t>=o.speechEnd)i=n+1;else return o}return null}#rt(t,e,i){let s=t.segments,n=e+i,o=s.find(c=>e>=c.start&&e<c.end);if(!o||!o.node.isConnected)return null;let a=s.find(c=>n>c.start&&n<=c.end)||o,l=document.createRange();return l.setStart(o.node,e-o.start),a.node.isConnected&&a.start>=o.start?l.setEnd(a.node,Math.min(n-a.start,a.node.length)):l.setEnd(o.node,o.node.length),l}async#it(){let t=speechSynthesis.getVoices();return t.length>0?t:new Promise(e=>{let i=()=>{speechSynthesis.removeEventListener("voiceschanged",i),e(speechSynthesis.getVoices())};speechSynthesis.addEventListener("voiceschanged",i),setTimeout(()=>{speechSynthesis.removeEventListener("voiceschanged",i),e(speechSynthesis.getVoices())},3e3)})}#st(t){if(!this.#k||!t.length)return;let e=this.#k;e.innerHTML="";let i=xt(this.#R()||"en"),s=c=>xt(c.lang)===i,n=t.filter(s),o=t.filter(c=>!s(c)),a=[...n,...o],l=this.getAttribute("voice");for(let c of a){let h=document.createElement("option");h.textContent=`${c.name} (${c.lang})`,h.dataset.voiceUri=c.voiceURI,l&&c.voiceURI===l&&(h.selected=!0),e.append(h)}if(!l){let c=n.find(h=>h.default)||n[0];if(c){let h=[...e.options].find(u=>u.dataset.voiceUri===c.voiceURI);h&&(h.selected=!0)}}}#tt(t,e){let i=document.activeElement;t();for(let[s,n]of e)if(s&&n&&i===s&&!n.hidden&&!n.disabled){n.focus();return}}#nt(t){if(!this.#p||!this.#d||!this.#f)return;let e=this.#p,i=this.#d,s=this.#f;this.#tt(()=>{e.hidden=t,i.hidden=!t,s.disabled=!t},t?[[e,i]]:[[i,e],[s,e]]),this.#w&&(this.#m&&this.#m.setAttribute("aria-pressed",String(t)),t?this.#N():this.#$())}#X(t){if(!this.#p||!this.#d)return;let e=this.#p,i=this.#d;this.#tt(()=>{e.hidden=!t,i.hidden=t},t?[[i,e]]:[[e,i]])}#J(){this.#l=!1,this.#o=!1,this.#r=0,this.#e=null,this.#H(),this.#et(),this.#nt(!1)}#Y(t){return Math.round(Math.max(.5,Math.min(2,t))*10)/10}#V(t,e={}){this.dispatchEvent(new CustomEvent(t,{detail:e,bubbles:!0}))}#at=()=>{this.#l&&speechSynthesis.cancel()}};g("text-reader",He);var vo="http://www.w3.org/1999/xhtml",Ue="http://www.w3.org/2000/svg",yo="http://www.w3.org/1998/Math/MathML",wo=new Set([vo,Ue,yo]),Ve="user-content-",ko=new Set(["script","iframe","frame","frameset","object","embed","applet","portal","fencedframe","form","base","link","meta","noscript","foreignobject","style","xmp","noembed","noframes","plaintext","mglyph","malignmark","annotation-xml"]),Us=new Set(["title","desc"]),Ao=new Set(["animate","set","animatemotion","animatetransform"]),xo=new Set(["href","xlink:href","action","formaction","data","codebase","cite","background","longdesc","manifest","to","from","values","by"]),Eo=new Set(["src","poster","srcset"]),So=new Set(["srcdoc","form","formaction","formmethod","formtarget","formenctype","formnovalidate","action","method","ping"]),Co=new Set(["popovertarget","popovertargetaction","commandfor","command","interestfor","autofocus"]),To=new Set(["for","headers","list","aria-labelledby","aria-describedby","aria-controls","aria-owns","aria-flowto","aria-details","aria-errormessage","aria-activedescendant"]),Lo={"include-file":["trusted","allow-scripts","allow-cross-origin"],"markdown-viewer":["src","sanitize","ping","allow-cross-origin"]},Mo=new Set(["social-embed","youtube-player","geo-map"]),_o=["src","src-dark","data-src","url","endpoint","tile-url","data-versions"],Ro=new Set(["audio-player","video-player","image-map","brand-mark"]);function No(r){return String(r).replace(/[\u0000- \u007f-\u009f]/g,"").toLowerCase()}function Hs(r,t=!1){let e=No(r);return t?/(^|,)(javascript|vbscript|livescript):/.test(e)?!0:/(^|,)data:/.test(e)?e.split(/(?=data:)/).filter(s=>s.startsWith("data:")).some(s=>!/^data:(image|audio|video|font)\//.test(s)):!1:/^(javascript|vbscript|livescript|data):/.test(e)}function Vs(r){let t=String(r).replace(/\/\*[\s\S]*?\*\//g,"").replace(/\\/g,"").replace(/\s+/g,"").toLowerCase();return/expression\(|javascript:|vbscript:|-moz-binding|behavior:|@import|position:fixed/.test(t)}var Po=r=>String(r.localName||r.tagName||"").toLowerCase(),$o=r=>r.startsWith(Ve)?r:Ve+r;function Io(r,t){if(ko.has(t))return!0;let e=r.namespaceURI;return!!(e&&!wo.has(e)||t==="title"&&e!==Ue||Us.has(t)&&e===Ue&&r.children?.length||Ao.has(t)&&(r.getAttribute("attributeName")||r.getAttribute("attributename")||"").toLowerCase().includes("href"))}function zo(r,t){for(let e of[...r.attributes]){let i=e.name.toLowerCase();if(i.startsWith("on")||So.has(i)||!t.keepIds&&Co.has(i)){r.removeAttribute(e.name);continue}if(i==="style"){(!t.keepStyle||Vs(e.value))&&r.removeAttribute(e.name);continue}if((i==="id"||i==="name")&&!t.keepIds){let s=$o(e.value);i==="id"?t.ids.set(e.value,s):t.ids.set(`name:${e.value}`,s),r.setAttribute(e.name,s);continue}if(xo.has(i)||i.endsWith(":href")){Hs(e.value,!1)&&r.removeAttribute(e.name);continue}Eo.has(i)&&Hs(e.value,!0)&&r.removeAttribute(e.name)}}function Bo(r,t){let e=(r.getAttribute("type")||"").toLowerCase();t==="button"&&e!=="button"&&r.setAttribute("type","button"),t==="input"&&/^(submit|reset|image)$/.test(e)&&r.setAttribute("type","button")}function Oo(r,t){for(let e of r)for(let i of[...e.attributes]){let s=i.name.toLowerCase(),n=i.value;if((s==="href"||s.endsWith(":href"))&&n.startsWith("#")){let o=jo(n.slice(1));t.has(o)&&e.setAttribute(i.name,`#${t.get(o)}`)}else if(s==="usemap"&&n.startsWith("#")){let o=t.get(`name:${n.slice(1)}`);o?e.setAttribute(i.name,`#${o}`):e.removeAttribute(i.name)}else if(To.has(s)){let o=n.split(/\s+/).filter(Boolean).map(a=>t.get(a)||(a.startsWith(Ve)?a:null)).filter(Boolean);o.length?e.setAttribute(i.name,o.join(" ")):e.removeAttribute(i.name)}else n.includes("url(#")&&e.setAttribute(i.name,n.replace(/url\(#([^)]+)\)/g,(o,a)=>t.has(a)?`url(#${t.get(a)})`:o))}}function jo(r){try{return decodeURIComponent(r)}catch{return r}}function Ws(r){let t=r.childNodes;if(t)for(let e of[...t])e.nodeType===8?e.remove():(e.nodeType===1||e.nodeType===11)&&Ws(e)}function Gs(r,t){Ws(r);let e=[...r.querySelectorAll("*")];t.includeRoot&&e.unshift(r);let i=new Map,s=[],n={...t,ids:i};for(let o of e){if(!Fo(o,r))continue;let a=Po(o);if(t.svgOnly&&(Us.has(a)||a==="style")){if(a==="style"&&Vs(o.textContent||"")){o.remove();continue}}else if(Io(o,a)){o.remove();continue}if(!t.keepIds&&!t.svgOnly&&Mo.has(a)){Do(o);continue}if(a==="template"){let c=o.content;c&&Gs(c,{...t,includeRoot:!1})}zo(o,n),t.keepIds||Bo(o,a);let l=Lo[a];if(l)for(let c of l)o.removeAttribute(c);if(a==="include-file"&&!t.allowIncludeFile&&o.removeAttribute("src"),!t.keepIds&&!t.svgOnly&&a.includes("-")&&a!=="include-file"&&!Ro.has(a))for(let c of _o)o.removeAttribute(c);s.push(o)}!t.keepIds&&i.size&&Oo(s,i)}function Do(r){let t=r.parentNode;if(t){for(let e of[...r.childNodes])t.insertBefore(e,r);r.remove()}}function Fo(r,t){let e=r;for(;e;){if(e===t)return!0;e=e.parentNode??e.parent??null}return!1}function qt(r,t={}){let e=document.createElement("template");return r&&typeof r=="string"&&(e.innerHTML=r,Gs(e.content,{allowIncludeFile:!!t.allowIncludeFile,keepIds:!!t.keepIds,keepStyle:!!t.keepStyle})),e.content}function Ks({newItems:r,nodes:t,keyOf:e,renderItem:i,containerFor:s}){let n=[],o=[],a=[],l=new Set;for(let h of r)l.add(e(h));for(let[h,u]of[...t])l.has(h)||(u.remove(),t.delete(h),a.push(h));let c=new Map;for(let h of r){let u=e(h),p=t.get(u)||null,d=s(h,p);c.has(d)||c.set(d,[]),c.get(d)?.push({item:h,key:u,existing:p})}for(let[h,u]of c)for(let p=0;p<u.length;p++){let{item:d,key:f,existing:m}=u[p],b=m;b?(b.parentElement!==h||h.children[p]!==b)&&o.push(f):(b=i(d),t.set(f,b),n.push(f));let w=h.children[p];w!==b&&h.insertBefore(b,w||null)}return{added:n,moved:o,removed:a}}var We=class extends v{#t=null;#e=null;#i=null;#s=new Map;#r=null;#n=new Map;#a=new Set;setup(){this.#c(),this.#h(),this.#u(),this.#l(),this.#w(),this.#p()}teardown(){for(let t of this.#a)t.abort();this.#a.clear()}#c(){this.#t=this.querySelector(":scope > chat-thread"),this.#e=this.querySelector(":scope > chat-input"),this.#i=this.querySelector(":scope > header select[data-model-select]")}#h(){let t=this.querySelector(":scope > script[data-participants]");if(t)try{let e=JSON.parse(t.textContent);this.#s=new Map(Object.entries(e))}catch{console.warn("[chat-window] Invalid participant JSON")}}#l(){if(this.#t)for(let t of this.#t.querySelectorAll("chat-message[data-from]"))this.#o(t)}#o(t){let e=t.getAttribute("data-from");if(!e)return;let i=this.#s.get(e);i?.name?t.setAttribute("data-from-label",i.name):t.hasAttribute("data-from-label")||t.setAttribute("data-from-label",e)}#u(){if(!this.#i)return;let t=this.getAttribute("model");t?this.#i.value=t:this.#i.value&&this.setAttribute("model",this.#i.value)}#p(){this.listen(this,"chat-input:send",this.#d),this.#i&&this.listen(this.#i,"change",this.#f)}#d=async t=>{t.stopPropagation();let{message:e}=t.detail;if(!e||!this.#t)return;let i=this.#k("user",e,"user");this.#t.appendChild(i),this.#m(),this.#w();let s=this.#y(),n=this.#g(s);this.#t.appendChild(n),this.#m(),this.#e&&(this.#e.disabled=!0);let o=this.getAttribute("endpoint");if(o){let a=new AbortController;this.#a.add(a);try{let l=await this.#b(o,e,a.signal);this.resolveTyping(n,l)}catch(l){a.signal.aborted?n.remove():(this.resolveTyping(n,"<p>Sorry, something went wrong.</p>",{error:!0}),this.dispatchEvent(new CustomEvent("chat-window:error",{bubbles:!0,detail:{error:l.message,status:l.status??0}})))}finally{this.#a.delete(a)}}else this.dispatchEvent(new CustomEvent("chat-window:send",{bubbles:!0,detail:{message:e,typingElement:n}}));this.#e&&(this.#e.disabled=!1,this.isConnected&&this.#e.focus()),this.#m(),this.#w()};#f=()=>{let t=this.#i.value;this.setAttribute("model",t),this.dispatchEvent(new CustomEvent("chat-window:model-change",{bubbles:!0,detail:{model:t}}))};#k(t,e,i){let s=document.createElement("chat-message");s.setAttribute("data-role",t),i&&(s.setAttribute("data-from",i),this.#o(s));let n=document.createElement("chat-bubble");return this.#v(n,e,{asText:t==="user"}),s.appendChild(n),s}#v(t,e,{asText:i=!1}={}){let s=e==null?"":String(e);if(i||!s.includes("<")){let n=document.createElement("p");n.textContent=s,t.replaceChildren(n)}else t.replaceChildren(qt(s))}#g(t){let e=document.createElement("chat-message");e.setAttribute("data-role","agent"),e.setAttribute("data-status","typing");let i="Agent";t&&(e.setAttribute("data-from",t),this.#o(e),i=this.#s.get(t)?.name??t);let s=this.getAttribute("model");s&&e.setAttribute("data-model",s);let n=document.createElement("chat-bubble"),o=document.createElement("span");return o.className="visually-hidden",o.setAttribute("data-chat-typing",""),o.textContent=`${i} is typing`,n.appendChild(o),e.appendChild(n),e}#y(){for(let[t,e]of this.#s)if(e.role==="agent")return t;return null}#w(){if(!this.#t)return;if(this.#t.querySelector(":scope > chat-message")!==null){this.#r?.remove(),this.#r=null;return}this.#r||(this.#r=this.#t.querySelector(":scope > [data-chat-empty]")),this.#r||(this.#r=document.createElement("p"),this.#r.setAttribute("data-chat-empty",""),this.#r.textContent=this.getAttribute("empty-message")||"Send a message to start."),this.#r.parentNode!==this.#t&&this.#t.prepend(this.#r)}#m(){this.#t&&requestAnimationFrame(()=>{this.#t.scrollTop=this.#t.scrollHeight})}scrollToBottom(){this.#m()}async#b(t,e,i){let s={message:e,model:this.getAttribute("model")||void 0},n=await fetch(t,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(s),signal:i});if(!n.ok){let a=new Error(`Chat request failed: ${n.status}`);throw a.status=n.status,a}let o=await n.json();return o.html??o.message??o.content??""}get model(){return this.getAttribute("model")??""}set model(t){this.setAttribute("model",t),this.#i&&(this.#i.value=t)}get participants(){return this.#s}set participants(t){this.#s=t instanceof Map?t:new Map(Object.entries(t)),this.#l()}clearThread(){if(this.#t){for(;this.#t.firstChild;)this.#t.removeChild(this.#t.firstChild);this.#w()}}appendMessage(t,e,i){if(!this.#t)return;let s=this.#k(t,e,i);return this.#t.appendChild(s),this.#m(),this.#w(),s}resolveTyping(t,e,{error:i=!1}={}){if(!t)return;let s=t.querySelector(":scope > chat-bubble");s||(s=document.createElement("chat-bubble"),t.appendChild(s)),this.#v(s,e),i?t.setAttribute("data-status","error"):t.removeAttribute("data-status"),this.#m()}get messages(){return this.#t?[...this.#t.querySelectorAll(':scope > chat-message:not([data-status="typing"])')].map(t=>{let e=t.getAttribute("data-role")||"user",i=t.querySelector("chat-bubble");return{id:t.id||t.getAttribute("data-id")||void 0,role:e,content:(e==="user"?i?.textContent?.trim():i?.innerHTML)||"",from:t.getAttribute("data-from")||void 0}}):[]}set messages(t){if(!this.#t)return;let e=Array.isArray(t)?t:[];for(let[s,n]of this.#n)n.parentNode!==this.#t&&this.#n.delete(s);let i=new Set(this.#n.values());for(let s of[...this.#t.children])if(!i.has(s)){if(s.localName==="chat-message"&&s.id&&!s.matches('[data-status="typing"]')&&!this.#n.has(s.id)){this.#n.set(s.id,s);continue}s===this.#r&&(this.#r=null),s.remove()}Ks({newItems:e,nodes:this.#n,keyOf:s=>s.id??s.role+":"+s.content,renderItem:s=>{let n=this.#k(s.role||"user",s.content||"",s.from);return s.id&&(n.id=s.id),n},containerFor:()=>this.#t}),this.#w(),this.#m(),this.dispatchEvent(new CustomEvent("chat-window:messages-changed",{detail:{messages:e,source:"property"},bubbles:!0}))}};g("chat-window",We);var Ge=class extends v{static formAssociated=!0;#t;#e=null;#i=null;#s;#r=!1;constructor(){super(),this.#t=this.attachInternals(),this._adoptInternals(this.#t)}setup(){return this.#e=this.querySelector(":scope > textarea, :scope textarea[data-grow]"),this.#i=this.querySelector("[data-send]"),this.#e?(this.#n(),this.listen(this.#e,"keydown",this.#a),this.listen(this.#e,"input",this.#c),this.#i&&this.listen(this.#i,"click",this.#h),this.form&&this.listen(this.form,"submit",this.#l),this.#f(),this.#p(),this.#d(),this.hasAttribute("autofocus")&&requestAnimationFrame(()=>this.#e?.focus()),!0):!1}teardown(){clearTimeout(this.#s)}#n(){let t=this.#e;t&&(t.hasAttribute("aria-label")||t.hasAttribute("aria-labelledby")||t.labels&&t.labels.length||t.hasAttribute("title")||t.setAttribute("aria-label","Message"))}#a=t=>{if(!(t.isComposing||t.keyCode===229))switch(t.key){case"Enter":t.shiftKey||(t.preventDefault(),this.#u());break;case"Escape":t.preventDefault(),this.reset();break}};#c=()=>{this.#p(),this.#d(),clearTimeout(this.#s),this.#s=setTimeout(()=>{this.dispatchEvent(new CustomEvent("chat-input:input",{bubbles:!0,detail:{value:this.value,length:this.value.length}}))},100)};#h=t=>{let e=this.#i;this.form&&e?.type==="submit"&&e.form===this.form&&this.#o()||(t.preventDefault(),this.#u())};#l=t=>{setTimeout(()=>{t.defaultPrevented||this.reset()},0)};#o({report:t=!1}={}){if(this.matches(":disabled"))return!1;let e=this.value.trim(),i=parseInt(this.getAttribute("minlength")??"1",10)||1;return e.length<i?!1:this.#t.validity.valid?!0:(t&&this.#t.reportValidity(),!1)}#u(){if(!this.#o({report:!0}))return;let t=this.form;if(t){let e=this.#i,i=e?.type==="submit"&&e.form===t?e:null;t.requestSubmit(i);return}this.dispatchEvent(new CustomEvent("chat-input:send",{bubbles:!0,detail:{message:this.value.trim()}})),this.reset()}#p(){let t=this.value;this.#t.setFormValue(t||null)}#d(){let t=this.value,e=parseInt(this.getAttribute("maxlength")??"4000",10)||4e3;t.length>e&&this.#e?this.#t.setValidity({tooLong:!0},`Message exceeds ${e} characters`,this.#e):this.#t.setValidity({})}#f(){let t=this.hasAttribute("disabled")||this.#r;this.#e&&(this.#e.disabled=t),this.#i&&(this.#i.disabled=t)}formDisabledCallback(t){this.#r=t,this.#f()}formResetCallback(){this.reset()}formStateRestoreCallback(t){!t||!this.#e||(this.#e.value=t,this.#p(),this.#d())}get form(){return this.#t.form}get name(){return this.getAttribute("name")??""}get validity(){return this.#t.validity}get validationMessage(){return this.#t.validationMessage}checkValidity(){return this.#t.checkValidity()}reportValidity(){return this.#t.reportValidity()}get value(){return this.#e?.value??""}set value(t){if(!this.#e)return;let e=t==null?"":String(t);this.#e.value!==e&&(this.#e.value=e,this.#e.dispatchEvent(new Event("input",{bubbles:!0})),this.#p(),this.#d(),this.dispatchEvent(new CustomEvent("chat-input:change",{bubbles:!0,detail:{value:e,source:"api"}})))}get disabled(){return this.hasAttribute("disabled")}set disabled(t){this.toggleAttribute("disabled",!!t)}focus(){this.#e?.focus()}reset(){this.#e&&(this.#e.value="",this.#e.dispatchEvent(new Event("input",{bubbles:!0})),this.#p(),this.#d())}static get observedAttributes(){return["disabled"]}attributeChangedCallback(t){t==="disabled"&&this.#f()}};g("chat-input",Ge);function Xs(r,t,e){let i=r[t];if(!i)return-1;let s=i.x+i.width/2,n=i.y+i.height/2,o=e==="left"||e==="right",a=e==="left"||e==="up"?-1:1,l=-1,c=1/0;for(let h=0;h<r.length;h++){let u=r[h];if(h===t||!u)continue;let p=u.x+u.width/2-s,d=u.y+u.height/2-n,f=(o?p:d)*a;if(!(f>0))continue;let m=(o?d:p)*2,b=Math.hypot(f,m);b<c&&(c=b,l=h)}return l}var Ht="http://www.w3.org/2000/svg";function qo(r){return r.trim().split(/[\s,]+/).map(Number)}function Ho(r,t){let e=qo(t);switch(r){case"rect":{let[i,s,n,o]=e;return{type:"rect",x:i,y:s,width:n-i,height:o-s}}case"circle":{let[i,s,n]=e;return{type:"circle",cx:i,cy:s,r:n}}case"poly":{let i=[];for(let s=0;s<e.length;s+=2)i.push([e[s],e[s+1]]);return{type:"poly",points:i}}default:return null}}function Uo(r){if(!r)return null;switch(r.type){case"rect":{let t=document.createElementNS(Ht,"rect");return t.setAttribute("x",String(r.x)),t.setAttribute("y",String(r.y)),t.setAttribute("width",String(r.width)),t.setAttribute("height",String(r.height)),t}case"circle":{let t=document.createElementNS(Ht,"circle");return t.setAttribute("cx",String(r.cx)),t.setAttribute("cy",String(r.cy)),t.setAttribute("r",String(r.r)),t}case"poly":{let t=document.createElementNS(Ht,"polygon");return t.setAttribute("points",r.points.map(e=>e.join(",")).join(" ")),t}default:return null}}function Vo(r){if(!r)return{x:0,y:0,width:0,height:0};switch(r.type){case"rect":return{x:r.x,y:r.y,width:r.width,height:r.height};case"circle":return{x:r.cx-r.r,y:r.cy-r.r,width:r.r*2,height:r.r*2};case"poly":{let t=100,e=100,i=0,s=0;for(let[n,o]of r.points)n<t&&(t=n),o<e&&(e=o),n>i&&(i=n),o>s&&(s=o);return{x:t,y:e,width:i-t,height:s-e}}default:return{x:0,y:0,width:0,height:0}}}var Ys=0,Wo=300,Go={ArrowLeft:"left",ArrowRight:"right",ArrowUp:"up",ArrowDown:"down"},Ko='a[href], button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])';function Xo(r){return r==null||r===""?[]:r instanceof HTMLTemplateElement?[r.content.cloneNode(!0)]:r instanceof Node?[r.cloneNode(!0)]:[document.createTextNode(String(r))]}var Ke=class extends HTMLElement{get shape(){return this.getAttribute("shape")||"rect"}get coords(){return this.getAttribute("coords")||""}get label(){return this.getAttribute("label")||""}get href(){return this.getAttribute("href")}get target(){return this.getAttribute("target")||""}get tooltipMode(){return this.getAttribute("tooltip")||"hover"}get disabled(){return this.hasAttribute("disabled")}connectedCallback(){this.setAttribute("data-upgraded","")}disconnectedCallback(){this.removeAttribute("data-upgraded")}},Xe=class extends v{#t=null;#e=null;#i=null;#s=[];#r=[];#n=null;#a=null;#c=null;#h=0;#l=0;#o=[];setup(){if(this.#t=this.querySelector(":scope > img"),!this.#t){let t=this.getAttribute("src"),e=this.getAttribute("alt");if(t)this.#t=document.createElement("img"),this.#t.src=t,this.#t.alt=e||"",this.prepend(this.#t);else return!1}return this.#t.classList.add("image-map-img"),this.#t.complete?this.#u():this.listen(this.#t,"load",()=>this.#u(),{once:!0}),!0}teardown(){this.#a?.disconnect(),this.#a=null,this.#g(),clearTimeout(this.#h),cancelAnimationFrame(this.#l),this.#e?.remove(),this.#i?.remove();for(let t of this.#r)t.anchor?.remove();for(let t of this.#o)t.removeAttribute("id");this.#e=null,this.#i=null,this.#r=[],this.#s=[],this.#o=[],this.#c=null}get regions(){return[...this.querySelectorAll(":scope > map-area")].map(t=>{let e;if(t.children.length){let i=document.createDocumentFragment();i.append(...[...t.childNodes].map(s=>s.cloneNode(!0))),e=i}else e=t.textContent?.trim()||void 0;return{shape:t.getAttribute("shape")||void 0,coords:t.getAttribute("coords")||void 0,label:t.getAttribute("label")||t.textContent?.trim().replace(/\s+/g," ")||void 0,href:t.getAttribute("href")||void 0,target:t.getAttribute("target")||void 0,tooltip:t.getAttribute("tooltip")||void 0,disabled:t.hasAttribute("disabled")||void 0,content:e}})}set regions(t){let e=Array.isArray(t)?t:[];for(let i of[...this.querySelectorAll(":scope > map-area")])i.remove();for(let i of e){if(!i)continue;let s=document.createElement("map-area");i.shape&&s.setAttribute("shape",i.shape),i.coords&&s.setAttribute("coords",i.coords),i.label&&s.setAttribute("label",i.label),i.href&&s.setAttribute("href",i.href),i.target&&s.setAttribute("target",i.target),i.tooltip&&s.setAttribute("tooltip",i.tooltip),i.disabled&&s.setAttribute("disabled",""),s.append(...Xo(i.content)),this.appendChild(s)}this._reinit(),this.dispatchEvent(new CustomEvent("image-map:regions-changed",{detail:{regions:this.regions,source:"property"},bubbles:!0}))}#u(){if(!this.isConnected||this.#e)return;let t=[...this.querySelectorAll(":scope > map-area")];if(t.length===0)return;let e=document.createElementNS(Ht,"svg");e.setAttribute("viewBox","0 0 100 100"),e.setAttribute("preserveAspectRatio","none"),e.setAttribute("aria-hidden","true"),e.classList.add("image-map-overlay"),this.#e=e;let i=document.createElement("div");i.className="image-map-tooltip",i.id=`imap-tip-${++Ys}`,i.hidden=!0,this.#i=i;for(let s of t){let n=s,o=Ho(n.shape,n.coords),a=Uo(o);if(!a)continue;let l=Vo(o),c=s.getAttribute("href"),h=s.getAttribute("target")||"",u=s.getAttribute("tooltip")||"hover",p=s.hasAttribute("disabled"),d=s.textContent?.trim().replace(/\s+/g," ")||"",f=s.getAttribute("label")||d,m=c?document.createElement("a"):document.createElement("button");c?(m.href=c,h&&(m.target=h)):m.type="button",m.className="image-map-anchor",m.textContent=f;let b=u!=="none"&&(s.children.length>0||d&&d!==f);b&&(s.id||(s.id=`imap-area-${++Ys}`,this.#o.push(s)),u==="click"?(m.setAttribute("aria-expanded","false"),m.setAttribute("aria-controls",i.id)):m.setAttribute("aria-describedby",s.id)),m.style.left=`${l.x}%`,m.style.top=`${l.y}%`,m.style.width=`${l.width}%`,m.style.height=`${l.height}%`,p&&(a.setAttribute("data-disabled",""),m.setAttribute("tabindex","-1"),m.setAttribute("aria-disabled","true"));let w={area:s,parsed:o,bbox:l,disabled:p,svgShape:a,anchor:m,href:c,target:h,mode:u,hasContent:b,keyboardOpen:!1};p||this.#p(w),e.appendChild(a),this.#r.push(w),this.#s.push(m)}this.appendChild(e);for(let s of this.#s)this.appendChild(s);this.appendChild(i),this.listen(i,"pointerenter",()=>clearTimeout(this.#h)),this.listen(i,"pointerleave",()=>{this.#n?.mode==="hover"&&!this.#f()&&this.#k()}),this.listen(i,"focusout",s=>{let n=s.relatedTarget;n&&(i.contains(n)||n===this.#n?.anchor)||this.#g()}),this.listen(this,"keydown",this.#m),this.listen(document,"keydown",this.#b),this.listen(document,"pointerdown",this.#C),this.listen(window,"scroll",this.#y,{passive:!0,capture:!0}),this.#a=new ResizeObserver(this.#y),this.#a.observe(this.#t),this.setAttribute("role","group"),!this.hasAttribute("aria-label")&&!this.hasAttribute("aria-labelledby")&&this.setAttribute("aria-label",this.#t.alt||this.dataset.labelMap||"Image map")}#p(t){let{svgShape:e,anchor:i,area:s,mode:n}=t;this.listen(e,"pointerenter",()=>{clearTimeout(this.#h),n==="hover"&&this.#v(t),e.setAttribute("data-hover",""),this.#x("image-map:area-enter",s)}),this.listen(e,"pointerleave",()=>{n==="hover"&&this.#n===t&&!this.#f()&&this.#k(),document.activeElement!==i&&e.removeAttribute("data-hover"),this.#x("image-map:area-leave",s)}),this.listen(e,"click",()=>{let o=this.#d(t,!1);t.href&&n!=="click"&&!o.defaultPrevented&&(t.target==="_blank"?window.open(t.href,"_blank","noopener"):window.location.href=t.href)}),this.listen(e,"touchstart",o=>{n==="hover"&&(this.#c!==t?(o.preventDefault(),this.#c=t,this.#v(t)):this.#c=null)},{passive:!1}),this.listen(i,"click",o=>{let a=o.detail===0,l=this.#d(t,a);(n==="click"||l.defaultPrevented)&&o.preventDefault()}),t.href&&this.listen(i,"keydown",o=>{o.key===" "&&(o.preventDefault(),i.click())}),this.listen(i,"focus",()=>{clearTimeout(this.#h),n==="hover"&&this.#v(t),e.setAttribute("data-hover",""),this.#x("image-map:area-enter",s)}),this.listen(i,"blur",o=>{e.removeAttribute("data-hover"),this.#x("image-map:area-leave",s);let a=o.relatedTarget;this.#n===t&&!(a&&this.#i?.contains(a))&&this.#g()})}#d(t,e){if(t.mode==="click"&&t.hasContent){if(this.#n===t)this.#g();else if(this.#v(t),e){t.keyboardOpen=!0;let i=this.#i?.querySelector(Ko);i&&i.focus()}}return this.#x("image-map:area-activate",t.area,!0)}#f(){let t=document.activeElement;return!!(t&&this.#i?.contains(t))}#k(){clearTimeout(this.#h),this.#h=setTimeout(()=>this.#g(),Wo)}#v(t){let e=this.#i;!e||t.mode==="none"||!t.hasContent||(clearTimeout(this.#h),this.#n&&this.#n!==t&&this.#g(),this.#n=t,e.replaceChildren(...[...t.area.childNodes].map(i=>i.cloneNode(!0))),t.mode==="click"?(e.removeAttribute("role"),e.setAttribute("role","group"),e.setAttribute("aria-label",t.anchor.textContent||""),t.anchor.setAttribute("aria-expanded","true")):(e.setAttribute("role","tooltip"),e.removeAttribute("aria-label")),t.anchor.nextSibling!==e&&t.anchor.after(e),e.hidden=!1,e.setAttribute("data-state-visible",""),this.#w(t.svgShape))}#g({restoreFocus:t=!1}={}){clearTimeout(this.#h);let e=this.#n,i=this.#i;if(!i||!e)return;let s=this.#f();this.#n=null,e.keyboardOpen=!1,e.mode==="click"&&e.anchor.hasAttribute("aria-expanded")&&e.anchor.setAttribute("aria-expanded","false"),i.removeAttribute("data-state-visible"),i.hidden=!0,i.replaceChildren(),(t||s)&&e.anchor.focus()}#y=()=>{!this.#n||this.#l||(this.#l=requestAnimationFrame(()=>{this.#l=0,this.#n&&this.#w(this.#n.svgShape)}))};#w(t){if(!this.#i||!t)return;let e=t.getBoundingClientRect(),i=this.#i.getBoundingClientRect(),s=8,n=8,o=window.innerWidth,a=window.innerHeight,l,c,h=e.top-i.height-s;h>=n?(l=h,c=e.left+(e.width-i.width)/2):e.bottom+s+i.height<=a-n?(l=e.bottom+s,c=e.left+(e.width-i.width)/2):e.right+s+i.width<=o-n?(l=e.top+(e.height-i.height)/2,c=e.right+s):(l=e.top+(e.height-i.height)/2,c=e.left-i.width-s),c=Math.max(n,Math.min(c,o-i.width-n)),l=Math.max(n,Math.min(l,a-i.height-n)),this.#i.style.top=`${l}px`,this.#i.style.left=`${c}px`}#m=t=>{if(this.#i?.contains(t.target))return;let e=Go[t.key];if(!e)return;let i=this.#r.findIndex(o=>o.anchor===document.activeElement);if(i===-1)return;t.preventDefault();let s=this.#r.map(o=>o.disabled?null:o.bbox),n=Xs(s,i,e);n!==-1&&this.#r[n].anchor.focus()};#b=t=>{t.key==="Escape"&&(this.#c=null,this.#n&&(t.preventDefault(),this.#g()))};#C=t=>{if(!this.#n)return;let e=t.target;this.#i?.contains(e)||this.contains(e)&&e!==this&&e!==this.#t||(this.#c=null,this.#g())};#x(t,e,i=!1){let s=new CustomEvent(t,{detail:{area:e},bubbles:!0,cancelable:i});return this.dispatchEvent(s),s}};g("map-area",Ke);g("image-map",Xe);var Yo='<svg viewBox="0 0 68 48" width="68" height="48" aria-hidden="true" focusable="false"><path d="M66.52 7.74c-.78-2.93-2.49-5.41-5.42-6.19C55.79.13 34 0 34 0S12.21.13 6.9 1.55c-2.93.78-4.64 3.26-5.42 6.19C.06 13.05 0 24 0 24s.06 10.95 1.48 16.26c.78 2.93 2.49 5.41 5.42 6.19C12.21 47.87 34 48 34 48s21.79-.13 27.1-1.55c2.93-.78 4.64-3.26 5.42-6.19C67.94 34.95 68 24 68 24s-.06-10.95-1.48-16.26z" fill="var(--color-error, #f00)"/><path d="M45 24 27 14v20z" fill="#fff"/></svg>',Jo={hq:"hqdefault",mq:"mqdefault",sd:"sddefault",maxres:"maxresdefault"},Js="YouTube video",Zo="Play {title}",Qo=/^\d+$/;function Zs(r){return String(r).replace(/[&<>"']/g,t=>({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"})[t])}function ta(){return window.matchMedia("(prefers-reduced-motion: reduce)").matches||document.documentElement.hasAttribute("data-motion-reduced")}var Ye=class extends v{#t="";#e=Js;setup(){let t=this.getAttribute("video-id");return this.#e=this.getAttribute("title")||Js,t?/^[A-Za-z0-9_-]{6,20}$/.test(t)?(this.#t=t,this.hasAttribute("autoplay")&&!ta()?this.#c(!1):this.#a(),!0):(console.warn(`youtube-player: invalid video-id ${JSON.stringify(t)}`),!1):(console.warn("youtube-player: missing required video-id attribute"),!1)}#i(t){let e=this.getAttribute(t);return e===null||e===""?null:Qo.test(e.trim())?e.trim():(console.warn(`youtube-player: ${t} must be whole seconds, got ${JSON.stringify(e)}`),null)}#s(){let t=new URLSearchParams({autoplay:"1"}),e=this.#i("start");e&&t.set("start",e);let i=this.#i("end");i&&t.set("end",i);let s=this.getAttribute("list");s&&t.set("list",s);let n=this.getAttribute("params");return n&&new URLSearchParams(n).forEach((o,a)=>t.set(a,o)),`https://www.youtube-nocookie.com/embed/${this.#t}?${t}`}#r(t){return`https://i.ytimg.com/vi/${this.#t}/${Jo[t]??"hqdefault"}.jpg`}#n(){return(this.getAttribute("data-label-play")||Zo).replace(/\{title\}/g,this.#e)}#a(){this.setAttribute("state","ready");let t=document.createElement("img");t.alt="",t.loading="lazy",t.decoding="async";let e=this.getAttribute("poster");if(e)t.src=e;else{let s=this.getAttribute("thumbnail")??"hq";if(t.referrerPolicy="no-referrer",t.src=this.#r(s),s==="sd"||s==="maxres"){let n=()=>{t.src=this.#r("hq")};t.addEventListener("error",n,{once:!0}),t.addEventListener("load",()=>{t.naturalWidth<=120&&n()},{once:!0})}}let i=document.createElement("button");i.type="button",i.setAttribute("aria-label",this.#n()),i.innerHTML=Yo,i.addEventListener("click",()=>this.#c(!0),{once:!0}),this.replaceChildren(t,i)}#c(t){this.setAttribute("state","active"),this.innerHTML=`<iframe src="${Zs(this.#s())}" title="${Zs(this.#e)}" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerpolicy="strict-origin-when-cross-origin" allowfullscreen loading="lazy"></iframe>`,t&&this.querySelector("iframe")?.focus(),this.dispatchEvent(new CustomEvent("youtube-player:activate",{bubbles:!0,detail:{videoId:this.#t,fromUser:t}}))}};g("youtube-player",Ye);var Et=CSS.supports("anchor-name","--x")&&CSS.supports("position-area","bottom"),Qs=()=>window.matchMedia("(prefers-reduced-motion: reduce)").matches,ea="--tour-target",Je='button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])',ia='input, textarea, select, [contenteditable]:not([contenteditable="false"])',sa={title:"Page Tour",step:"Step {n} of {total}",skip:"Skip tour",close:"Close",prev:"Previous",next:"Next",finish:"Finish",nav:"Tour navigation",ready:"Done. Next is available."},ra=0,Ze=class extends HTMLElement{get target(){return this.dataset.target??""}get placement(){return this.dataset.placement??"auto"}get action(){return this.dataset.action??"none"}get actionHint(){return this.dataset.actionHint??null}get skippable(){return this.dataset.skippable!=="false"}get scrollBehavior(){return this.dataset.scroll??"smooth"}};function tr(r){if(!r?.target)return null;try{return document.querySelector(r.target)}catch{return null}}function L(r,t,e){let i=document.createElement(r);return t&&(i.className=t),e!=null&&(i.textContent=e),i}var Qe=class r extends v{#t=[];#e=0;#i=!1;#s=null;#r=null;#n=null;#a=null;#c=null;#h=null;#l="";#o=null;#u=null;#p=null;#d=null;#f=null;#k=null;#v=null;static#g=null;static observedAttributes=["data-step"];setup(){if(this.#t=[...this.querySelectorAll("tour-step")],this.#t.length===0)return!1;let t=this.querySelector(".page-tour-start-btn");if(t&&this.listen(t,"click",e=>{e.preventDefault(),this.start()}),this.id&&this.listen(document,"click",e=>{e.target?.closest?.(`[data-tour="${CSS.escape(this.id)}"]`)&&(e.preventDefault(),this.start())}),this.dataset.trigger==="auto"){let e=this.#W();e?.complete||e?.skipped?this.setAttribute("data-complete",""):this.#v=setTimeout(()=>{this.#v=null,this.isConnected&&this.start(e?.step??0)},400)}return!0}teardown(){this.#v&&(clearTimeout(this.#v),this.#v=null),this.#i&&this.stop()}attributeChangedCallback(t,e,i){if(t==="data-step"&&this.#i&&e!==null){let s=parseInt(i,10);!Number.isNaN(s)&&s!==this.#e&&this.goto(s)}}start(t=0){let e=Math.min(Math.max(0,Number(t)||0),this.#t.length-1);if(this.#i){this.goto(e);return}let i=this.#b(e,1,!0);if(i===-1&&(i=this.#b(e-1,-1,!0)),i===-1){console.warn("[page-tour] No step target found on the page; tour not started");return}r.#g&&r.#g!==this&&r.#g.stop(),this.#c=document.activeElement,this.#i=!0,r.#g=this,this.#C(),this.setAttribute("data-active",""),this.removeAttribute("data-complete"),this.#q("tour:start",{step:i}),this.#N(i,"next")}stop(){this.#i&&(this.#R(),this.#i=!1,this.removeAttribute("data-active"),r.#g===this&&(r.#g=null))}next(){if(!this.#i||this.#m())return;let t=this.#b(this.#e+1,1,!0);t===-1?this.#P():this.#N(t,"next")}prev(){if(!this.#i)return;let t=this.#b(this.#e-1,-1,!0);t!==-1&&this.#N(t,"prev")}goto(t){if(!this.#i)return;let e=Number(t);if(!Number.isInteger(e)||e<0||e>=this.#t.length)return;let i=e>=this.#e?"next":"prev",s=i==="next"?1:-1,n=this.#b(e,s,!0);n===-1&&(n=this.#b(e-s,s===1?-1:1,!0)),!(n===-1||n===this.#e)&&this.#N(n,i)}skip(){this.#i&&this.#w(this.#t[this.#e])&&(this.#q("tour:skip",{step:this.#e}),this.#U({skipped:!0}),this.stop(),this.setAttribute("data-complete",""))}reset(){this.#Z(),this.removeAttribute("data-complete"),this.dataset.step="0"}#y(t){return(t==="title"?this.dataset.title:this.getAttribute(`data-label-${t}`))??sa[t]}#w(t){return(this.dataset.mode??"passive")!=="forced"&&(t?.skippable??!0)}#m(){return!!this.#n?.querySelector(".page-tour-next[data-waiting]")}#b(t,e,i=!1){for(let s=t;s>=0&&s<this.#t.length;s+=e){if(tr(this.#t[s]))return s;i&&console.warn(`[page-tour] Target "${this.#t[s].target}" not found, skipping step ${s}`)}return-1}#C(){this.#s=L("div","page-tour-backdrop"),this.#s.setAttribute("aria-hidden","true"),this.#s.addEventListener("click",()=>this.skip()),this.#r=L("div","page-tour-spotlight"),this.#r.setAttribute("aria-hidden","true"),this.#n=L("div","page-tour-card"),this.#n.setAttribute("popover","manual"),this.#n.setAttribute("role","dialog"),this.#n.setAttribute("aria-label",this.#y("title")),this.#n.setAttribute("tabindex","-1"),this.#n.toggleAttribute("data-anchored",Et),this.#n.addEventListener("click",e=>this.#D(e));let t=parseFloat(this.dataset.spotlightPadding??"");if(Number.isFinite(t)&&t>=0)for(let e of[this.#r,this.#n])e.style.setProperty("--tour-spotlight-padding",`${t}px`);this.#a=L("div","visually-hidden"),this.#a.setAttribute("aria-live","polite"),this.#a.setAttribute("aria-atomic","true"),this.#a.id=`page-tour-announcer-${++ra}`,this.append(this.#s,this.#r,this.#n,this.#a),this.#n.showPopover(),this.#u=new AbortController,document.addEventListener("keydown",e=>this.#M(e),{signal:this.#u.signal}),requestAnimationFrame(()=>{this.#s?.setAttribute("data-state-visible","")})}#x(t){this.#h=t;let e=getComputedStyle(t).position==="static";t.setAttribute("data-tour-target",e?"raised":""),Et&&(this.#l=t.style.getPropertyValue("anchor-name"),t.style.setProperty("anchor-name",ea))}#L(){let t=this.#h;t&&(t.removeAttribute("data-tour-target"),Et&&(this.#l?t.style.setProperty("anchor-name",this.#l):t.style.removeProperty("anchor-name"),t.getAttribute("style")||t.removeAttribute("style")),this.#l="",this.#h=null)}#E(t){if(!this.#r)return;let e=t.getBoundingClientRect();Object.assign(this.#r.style,{top:`${e.top}px`,left:`${e.left}px`,width:`${e.width}px`,height:`${e.height}px`})}#A(t,e){let i=getComputedStyle(this).direction==="rtl";switch(e){case"top":case"bottom":return e;case"inline-start":return i?"right":"left";case"inline-end":return i?"left":"right";default:return this.#z(t)}}#T(t,e){if(!this.#n)return;let i=this.#A(t,e);this.#n.dataset.side=i,Et||this.#S(t,i)}#S(t,e){let i=this.#n;if(!i)return;let s=t.getBoundingClientRect(),n=12,o=8,a=this.#r&&parseFloat(getComputedStyle(this.#r).paddingTop)||0;i.style.visibility="hidden",i.style.top="0",i.style.left="0";let l=i.getBoundingClientRect();i.style.visibility="";let c=0,h=0;switch(e){case"bottom":c=s.bottom+a+n,h=s.left+(s.width-l.width)/2;break;case"top":c=s.top-a-n-l.height,h=s.left+(s.width-l.width)/2;break;case"right":c=s.top+(s.height-l.height)/2,h=s.right+a+n;break;case"left":c=s.top+(s.height-l.height)/2,h=s.left-a-n-l.width;break}h=Math.max(o,Math.min(h,window.innerWidth-l.width-o)),c=Math.max(o,Math.min(c,window.innerHeight-l.height-o)),i.style.top=`${c}px`,i.style.left=`${h}px`}#z(t){let e=t.getBoundingClientRect(),i=window.innerHeight-e.bottom,s=e.top,n=window.innerWidth-e.right,o=e.left,a=Math.max(i,s,n,o);return a===i?"bottom":a===s?"top":a===n?"right":"left"}#I(t,e){let i=this.#n;if(!i)return;let s=this.#t.length,n=this.#b(e+1,1)!==-1,o=this.#b(e-1,-1)!==-1,a=t.action!=="none",l=L("div","page-tour-progress");l.setAttribute("aria-hidden","true"),this.#t.forEach((m,b)=>{let w=L("span","page-tour-pip");b===e&&w.setAttribute("data-active",""),b<e&&w.setAttribute("data-visited",""),l.append(w)});let c=L("p","page-tour-meta");c.append(L("span","page-tour-step-count",this.#y("step").replace("{n}",String(e+1)).replace("{total}",String(s))));let h=L("div","page-tour-content");for(let m of t.childNodes)h.append(m.cloneNode(!0));let u=L("footer","page-tour-footer");if(this.#w(t)){let m=L("button","page-tour-skip",this.#y(n?"skip":"close"));m.type="button",m.dataset.action="skip",u.append(m)}let p=L("nav","page-tour-nav");if(p.setAttribute("aria-label",this.#y("nav")),o){let m=L("button","page-tour-prev",this.#y("prev"));m.type="button",m.dataset.action="prev",p.append(m)}let d=L("button","page-tour-next",this.#y(n?"next":"finish"));d.type="button",d.dataset.action="next",p.append(d),u.append(p);let f=[l,c,h];if(a&&(d.setAttribute("data-waiting",""),d.setAttribute("aria-disabled","true"),t.actionHint)){let m=L("p","page-tour-action-hint",t.actionHint);m.id=`${this.#a?.id??"page-tour"}-hint`,d.setAttribute("aria-describedby",m.id),f.push(m)}f.push(u),i.replaceChildren(...f),a?i.removeAttribute("aria-modal"):i.setAttribute("aria-modal","true")}#N(t,e="next"){let i=this.#t[t],s=tr(i);if(!i||!s)return;if(this.#d?.abort(),this.#d=null,this.#j(),this.#L(),this.#e=t,this.#x(s),i.scrollBehavior!=="none"){let l=Qs()?"instant":i.scrollBehavior;s.scrollIntoView({block:"nearest",behavior:l})}this.#I(i,t),this.#E(s),this.#T(s,i.placement);let n=this.#n;n?.focus(),requestAnimationFrame(()=>{if(this.#n!==n||this.#e!==t)return;let l=n?.querySelector(".page-tour-content :is(h2, h3, h4)")??null;l?(l.hasAttribute("tabindex")||l.setAttribute("tabindex","-1"),l.focus()):(n?.querySelector(".page-tour-next")??null)?.focus()});let o=i.querySelector("h2, h3, h4"),a=this.#y("step").replace("{n}",String(t+1)).replace("{total}",String(this.#t.length));this.#G(o?.textContent?`${a}: ${o.textContent.trim()}`:a),this.dataset.step=String(t),i.action!=="none"&&this.#$(i,s),this.#F(s),this.#U({step:t}),this.#q("tour:step",{step:t,target:s,direction:e})}#$(t,e){let i=new AbortController;this.#d=i;let n={click:"click",focus:"focus",input:"input",change:"change"}[t.action];n?e.addEventListener(n,()=>{i.abort(),this.#_(),this.#q("tour:action",{step:this.#e,action:t.action})},{signal:i.signal}):t.action==="custom"&&this.addEventListener("tour:action",()=>{i.abort(),this.#_()},{signal:i.signal})}#_(){let t=this.#n?.querySelector(".page-tour-next");t&&(t.removeAttribute("data-waiting"),t.removeAttribute("aria-disabled"),t.removeAttribute("aria-describedby"),this.#n?.querySelector(".page-tour-action-hint")?.remove(),this.#G(this.#y("ready")))}#M(t){if(!this.#i||t.defaultPrevented)return;let e=t.target instanceof Element?t.target:null,i=!!e&&(!!this.#n?.contains(e)||e===document.body),s=!!e?.closest(ia),n=!i||s||t.altKey||t.ctrlKey||t.metaKey,o=t.key;switch(getComputedStyle(document.documentElement).direction==="rtl"&&(o==="ArrowRight"?o="ArrowLeft":o==="ArrowLeft"&&(o="ArrowRight")),o){case"Escape":this.#w(this.#t[this.#e])&&(t.preventDefault(),this.skip());break;case"ArrowRight":case"ArrowDown":if(n)return;t.preventDefault(),this.next();break;case"ArrowLeft":case"ArrowUp":if(n)return;t.preventDefault(),this.prev();break;case"Home":if(n)return;t.preventDefault(),this.goto(0);break;case"End":if(n)return;t.preventDefault(),this.goto(this.#t.length-1);break;case"Tab":this.#B(t);break}}#B(t){if(!this.#n)return;let e=d=>!d.disabled&&(d.checkVisibility?.()??!0),i=[...this.#n.querySelectorAll(Je)].filter(e),s=[],n=this.#t[this.#e],o=this.#h;n&&n.action!=="none"&&o&&(s=(o.matches(Je)?[o]:[...o.querySelectorAll(Je)]).filter(e));let a=[...i,...s];if(a.length===0)return;let l=a[0],c=a[a.length-1],h=document.activeElement,u=!h||!a.includes(h),p=u?-1:a.indexOf(h);t.preventDefault(),t.shiftKey?(u||h===l?c:a[p-1]).focus():(u||h===c?l:a[p+1]).focus()}#D(t){let e=t.target.closest?.("[data-action]")??null;if(e)switch(e.dataset.action){case"next":this.next();break;case"prev":this.prev();break;case"skip":this.skip();break}}#F(t){let e=new AbortController;this.#p=e;let i=()=>this.#O();document.addEventListener("scroll",i,{capture:!0,passive:!0,signal:e.signal}),window.addEventListener("resize",i,{passive:!0,signal:e.signal}),this.#o=new ResizeObserver(i),this.#o.observe(t),this.#k=setTimeout(i,Qs()?0:300)}#j(){this.#p?.abort(),this.#p=null,this.#o?.disconnect(),this.#o=null,this.#k&&(clearTimeout(this.#k),this.#k=null),this.#f&&(cancelAnimationFrame(this.#f),this.#f=null)}#O(){this.#f||(this.#f=requestAnimationFrame(()=>{this.#f=null;let t=this.#h;!this.#i||!t||(this.#E(t),Et||this.#T(t,this.#t[this.#e].placement))}))}#P(){this.#q("tour:complete",{steps:this.#t.length}),this.#U({complete:!0}),this.stop(),this.setAttribute("data-complete","")}#R(){this.#u?.abort(),this.#u=null,this.#d?.abort(),this.#d=null,this.#j(),this.#L();let t=document.activeElement,e=!t||t===document.body||!!this.#n?.contains(t);this.#s?.remove(),this.#r?.remove(),this.#n?.matches(":popover-open")&&this.#n.hidePopover(),this.#n?.remove(),this.#a?.remove(),this.#s=null,this.#r=null,this.#n=null,this.#a=null;let i=this.#c;this.#c=null,e&&i?.isConnected&&typeof i.focus=="function"&&i.focus()}#G(t){let e=this.#a;e&&(e.textContent="",requestAnimationFrame(()=>{this.#a===e&&(e.textContent=t)}))}#q(t,e){let i=t!=="tour:skip";this.dispatchEvent(new CustomEvent(t,{bubbles:!0,cancelable:i,detail:e}))}#K(){let t=this.dataset.persist??"session";return t==="session"?sessionStorage:t==="local"?localStorage:null}#H(){return`vb-tour-${this.dataset.persistKey??window.location.pathname}`}#U(t){let e=this.#K();if(!e)return;let i=this.#H(),s={};try{s=JSON.parse(e.getItem(i)??"null")??{}}catch{}e.setItem(i,JSON.stringify({...s,...t}))}#W(){let t=this.#K();if(!t)return null;try{return JSON.parse(t.getItem(this.#H())??"null")}catch{return null}}#Z(){let t=this.#K();t&&t.removeItem(this.#H())}};g("page-tour",Qe);g("tour-step",Ze);function si(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var tt=si();function ar(r){tt=r}var Z={exec:()=>null};function x(r,t=""){let e=typeof r=="string"?r:r.source,i={replace:(s,n)=>{let o=typeof n=="string"?n:n.source;return o=o.replace(M.caret,"$1"),e=e.replace(s,o),i},getRegex:()=>new RegExp(e,t)};return i}var na=(()=>{try{return!!new RegExp("(?<=1)(?<!1)")}catch{return!1}})(),M={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] +\S/,listReplaceTask:/^\[[ xX]\] +/,listTaskCheckbox:/\[[ xX]\]/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:r=>new RegExp(`^( {0,3}${r})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:r=>new RegExp(`^ {0,${Math.min(3,r-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:r=>new RegExp(`^ {0,${Math.min(3,r-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:r=>new RegExp(`^ {0,${Math.min(3,r-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:r=>new RegExp(`^ {0,${Math.min(3,r-1)}}#`),htmlBeginRegex:r=>new RegExp(`^ {0,${Math.min(3,r-1)}}<(?:[a-z].*>|!--)`,"i"),blockquoteBeginRegex:r=>new RegExp(`^ {0,${Math.min(3,r-1)}}>`)},oa=/^(?:[ \t]*(?:\n|$))+/,aa=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,la=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,Lt=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,ca=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,ri=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,lr=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,cr=x(lr).replace(/bull/g,ri).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),ha=x(lr).replace(/bull/g,ri).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),ni=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,ua=/^[^\n]+/,oi=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,da=x(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",oi).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),pa=x(/^(bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,ri).getRegex(),Kt="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",ai=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,fa=x("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",ai).replace("tag",Kt).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),hr=x(ni).replace("hr",Lt).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Kt).getRegex(),ma=x(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",hr).getRegex(),li={blockquote:ma,code:aa,def:da,fences:la,heading:ca,hr:Lt,html:fa,lheading:cr,list:pa,newline:oa,paragraph:hr,table:Z,text:ua},er=x("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",Lt).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Kt).getRegex(),ga={...li,lheading:ha,table:er,paragraph:x(ni).replace("hr",Lt).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",er).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Kt).getRegex()},ba={...li,html:x(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",ai).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:Z,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:x(ni).replace("hr",Lt).replace("heading",` *#{1,6} *[^
1255
- ]`).replace("lheading",cr).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},va=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,ya=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,ur=/^( {2,}|\\)\n(?!\s*$)/,wa=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,ht=/[\p{P}\p{S}]/u,Xt=/[\s\p{P}\p{S}]/u,ci=/[^\s\p{P}\p{S}]/u,ka=x(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,Xt).getRegex(),dr=/(?!~)[\p{P}\p{S}]/u,Aa=/(?!~)[\s\p{P}\p{S}]/u,xa=/(?:[^\s\p{P}\p{S}]|~)/u,Ea=x(/link|precode-code|html/,"g").replace("link",/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",na?"(?<!`)()":"(^^|[^`])").replace("code",/(?<b>`+)[^`]+\k<b>(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),pr=/^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/,Sa=x(pr,"u").replace(/punct/g,ht).getRegex(),Ca=x(pr,"u").replace(/punct/g,dr).getRegex(),fr="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",Ta=x(fr,"gu").replace(/notPunctSpace/g,ci).replace(/punctSpace/g,Xt).replace(/punct/g,ht).getRegex(),La=x(fr,"gu").replace(/notPunctSpace/g,xa).replace(/punctSpace/g,Aa).replace(/punct/g,dr).getRegex(),Ma=x("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,ci).replace(/punctSpace/g,Xt).replace(/punct/g,ht).getRegex(),_a=x(/^~~?(?:((?!~)punct)|[^\s~])/,"u").replace(/punct/g,ht).getRegex(),Ra="^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)",Na=x(Ra,"gu").replace(/notPunctSpace/g,ci).replace(/punctSpace/g,Xt).replace(/punct/g,ht).getRegex(),Pa=x(/\\(punct)/,"gu").replace(/punct/g,ht).getRegex(),$a=x(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),Ia=x(ai).replace("(?:-->|$)","-->").getRegex(),za=x("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",Ia).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),Vt=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/,Ba=x(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?\s*\)/).replace("label",Vt).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),mr=x(/^!?\[(label)\]\[(ref)\]/).replace("label",Vt).replace("ref",oi).getRegex(),gr=x(/^!?\[(ref)\](?:\[\])?/).replace("ref",oi).getRegex(),Oa=x("reflink|nolink(?!\\()","g").replace("reflink",mr).replace("nolink",gr).getRegex(),ir=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,hi={_backpedal:Z,anyPunctuation:Pa,autolink:$a,blockSkip:Ea,br:ur,code:ya,del:Z,delLDelim:Z,delRDelim:Z,emStrongLDelim:Sa,emStrongRDelimAst:Ta,emStrongRDelimUnd:Ma,escape:va,link:Ba,nolink:gr,punctuation:ka,reflink:mr,reflinkSearch:Oa,tag:za,text:wa,url:Z},ja={...hi,link:x(/^!?\[(label)\]\((.*?)\)/).replace("label",Vt).getRegex(),reflink:x(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",Vt).getRegex()},ti={...hi,emStrongRDelimAst:La,emStrongLDelim:Ca,delLDelim:_a,delRDelim:Na,url:x(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol",ir).replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,text:x(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol",ir).getRegex()},Da={...ti,br:x(ur).replace("{2,}","*").getRegex(),text:x(ti.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},Ut={normal:li,gfm:ga,pedantic:ba},St={normal:hi,gfm:ti,breaks:Da,pedantic:ja},Fa={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},sr=r=>Fa[r];function j(r,t){if(t){if(M.escapeTest.test(r))return r.replace(M.escapeReplace,sr)}else if(M.escapeTestNoEncode.test(r))return r.replace(M.escapeReplaceNoEncode,sr);return r}function rr(r){try{r=encodeURI(r).replace(M.percentDecode,"%")}catch{return null}return r}function nr(r,t){let e=r.replace(M.findPipe,(n,o,a)=>{let l=!1,c=o;for(;--c>=0&&a[c]==="\\";)l=!l;return l?"|":" |"}),i=e.split(M.splitPipe),s=0;if(i[0].trim()||i.shift(),i.length>0&&!i.at(-1)?.trim()&&i.pop(),t)if(i.length>t)i.splice(t);else for(;i.length<t;)i.push("");for(;s<i.length;s++)i[s]=i[s].trim().replace(M.slashPipe,"|");return i}function Ct(r,t,e){let i=r.length;if(i===0)return"";let s=0;for(;s<i;){let n=r.charAt(i-s-1);if(n===t&&!e)s++;else if(n!==t&&e)s++;else break}return r.slice(0,i-s)}function qa(r,t){if(r.indexOf(t[1])===-1)return-1;let e=0;for(let i=0;i<r.length;i++)if(r[i]==="\\")i++;else if(r[i]===t[0])e++;else if(r[i]===t[1]&&(e--,e<0))return i;return e>0?-2:-1}function Ha(r,t=0){let e=t,i="";for(let s of r)if(s===" "){let n=4-e%4;i+=" ".repeat(n),e+=n}else i+=s,e++;return i}function or(r,t,e,i,s){let n=t.href,o=t.title||null,a=r[1].replace(s.other.outputLinkReplace,"$1");i.state.inLink=!0;let l={type:r[0].charAt(0)==="!"?"image":"link",raw:e,href:n,title:o,text:a,tokens:i.inlineTokens(a)};return i.state.inLink=!1,l}function Ua(r,t,e){let i=r.match(e.other.indentCodeCompensation);if(i===null)return t;let s=i[1];return t.split(`
1254
+ `),this.#a=t,document.adoptedStyleSheets=[...document.adoptedStyleSheets,t]}#W(){let t=this.#a;t&&(document.adoptedStyleSheets=document.adoptedStyleSheets.filter(e=>e!==t),this.#a=null),this.#et()}#Z(t,e){if(!CSS.highlights||this.getAttribute("highlight")==="false")return;let i=this.#Q(t);if(!i)return;let s=t-i.speechStart,n=this.#rt(i,s,e);if(!n)return;let o=new Highlight(n);if(CSS.highlights.set("text-reader-word",o),this.#c=o,this.getAttribute("scroll")!=="false"){let a=n.getBoundingClientRect(),l=window.innerHeight;if(a.top<0||a.bottom>l){let c=window.matchMedia?.("(prefers-reduced-motion: reduce)").matches;i.element.scrollIntoView({behavior:c?"auto":"smooth",block:"nearest"})}}}#et(){CSS.highlights&&CSS.highlights.delete("text-reader-word"),this.#c=null}#Q(t){let e=this.#i,i=0,s=e.length-1;for(;i<=s;){let n=i+s>>>1,o=e[n];if(t<o.speechStart)s=n-1;else if(t>=o.speechEnd)i=n+1;else return o}return null}#rt(t,e,i){let s=t.segments,n=e+i,o=s.find(c=>e>=c.start&&e<c.end);if(!o||!o.node.isConnected)return null;let a=s.find(c=>n>c.start&&n<=c.end)||o,l=document.createRange();return l.setStart(o.node,e-o.start),a.node.isConnected&&a.start>=o.start?l.setEnd(a.node,Math.min(n-a.start,a.node.length)):l.setEnd(o.node,o.node.length),l}async#it(){let t=speechSynthesis.getVoices();return t.length>0?t:new Promise(e=>{let i=()=>{speechSynthesis.removeEventListener("voiceschanged",i),e(speechSynthesis.getVoices())};speechSynthesis.addEventListener("voiceschanged",i),setTimeout(()=>{speechSynthesis.removeEventListener("voiceschanged",i),e(speechSynthesis.getVoices())},3e3)})}#st(t){if(!this.#v||!t.length)return;let e=this.#v;e.innerHTML="";let i=Lt(this.#R()||"en"),s=c=>Lt(c.lang)===i,n=t.filter(s),o=t.filter(c=>!s(c)),a=[...n,...o],l=this.getAttribute("voice");for(let c of a){let h=document.createElement("option");h.textContent=`${c.name} (${c.lang})`,h.dataset.voiceUri=c.voiceURI,l&&c.voiceURI===l&&(h.selected=!0),e.append(h)}if(!l){let c=n.find(h=>h.default)||n[0];if(c){let h=[...e.options].find(u=>u.dataset.voiceUri===c.voiceURI);h&&(h.selected=!0)}}}#tt(t,e){let i=document.activeElement;t();for(let[s,n]of e)if(s&&n&&i===s&&!n.hidden&&!n.disabled){n.focus();return}}#nt(t){if(!this.#p||!this.#d||!this.#f)return;let e=this.#p,i=this.#d,s=this.#f;this.#tt(()=>{e.hidden=t,i.hidden=!t,s.disabled=!t},t?[[e,i]]:[[i,e],[s,e]]),this.#A&&(this.#m&&this.#m.setAttribute("aria-pressed",String(t)),t?this.#N():this.#P())}#Y(t){if(!this.#p||!this.#d)return;let e=this.#p,i=this.#d;this.#tt(()=>{e.hidden=!t,i.hidden=t},t?[[i,e]]:[[e,i]])}#J(){this.#l=!1,this.#o=!1,this.#r=0,this.#e=null,this.#H(),this.#et(),this.#nt(!1)}#X(t){return Math.round(Math.max(.5,Math.min(2,t))*10)/10}#V(t,e={}){this.dispatchEvent(new CustomEvent(t,{detail:e,bubbles:!0}))}#at=()=>{this.#l&&speechSynthesis.cancel()}};g("text-reader",Qe);var ta="http://www.w3.org/1999/xhtml",ti="http://www.w3.org/2000/svg",ea="http://www.w3.org/1998/Math/MathML",ia=new Set([ta,ti,ea]),ei="user-content-",sa=new Set(["script","iframe","frame","frameset","object","embed","applet","portal","fencedframe","form","base","link","meta","noscript","foreignobject","style","xmp","noembed","noframes","plaintext","mglyph","malignmark","annotation-xml"]),hr=new Set(["title","desc"]),ra=new Set(["animate","set","animatemotion","animatetransform"]),na=new Set(["href","xlink:href","action","formaction","data","codebase","cite","background","longdesc","manifest","to","from","values","by"]),oa=new Set(["src","poster","srcset"]),aa=new Set(["srcdoc","form","formaction","formmethod","formtarget","formenctype","formnovalidate","action","method","ping"]),la=new Set(["popovertarget","popovertargetaction","commandfor","command","interestfor","autofocus"]),ca=new Set(["for","headers","list","aria-labelledby","aria-describedby","aria-controls","aria-owns","aria-flowto","aria-details","aria-errormessage","aria-activedescendant"]),ha={"include-file":["trusted","allow-scripts","allow-cross-origin"],"markdown-viewer":["src","sanitize","ping","allow-cross-origin"]},ua=new Set(["social-embed","youtube-player","geo-map"]),da=["src","src-dark","data-src","url","endpoint","tile-url","data-versions"],pa=new Set(["audio-player","video-player","image-map","brand-mark"]);function fa(r){return String(r).replace(/[\u0000- \u007f-\u009f]/g,"").toLowerCase()}function cr(r,t=!1){let e=fa(r);return t?/(^|,)(javascript|vbscript|livescript):/.test(e)?!0:/(^|,)data:/.test(e)?e.split(/(?=data:)/).filter(s=>s.startsWith("data:")).some(s=>!/^data:(image|audio|video|font)\//.test(s)):!1:/^(javascript|vbscript|livescript|data):/.test(e)}function ur(r){let t=String(r).replace(/\/\*[\s\S]*?\*\//g,"").replace(/\\/g,"").replace(/\s+/g,"").toLowerCase();return/expression\(|javascript:|vbscript:|-moz-binding|behavior:|@import|position:fixed/.test(t)}var ma=r=>String(r.localName||r.tagName||"").toLowerCase(),ga=r=>r.startsWith(ei)?r:ei+r;function ba(r,t){if(sa.has(t))return!0;let e=r.namespaceURI;return!!(e&&!ia.has(e)||t==="title"&&e!==ti||hr.has(t)&&e===ti&&r.children?.length||ra.has(t)&&(r.getAttribute("attributeName")||r.getAttribute("attributename")||"").toLowerCase().includes("href"))}function ya(r,t){for(let e of[...r.attributes]){let i=e.name.toLowerCase();if(i.startsWith("on")||aa.has(i)||!t.keepIds&&la.has(i)){r.removeAttribute(e.name);continue}if(i==="style"){(!t.keepStyle||ur(e.value))&&r.removeAttribute(e.name);continue}if((i==="id"||i==="name")&&!t.keepIds){let s=ga(e.value);i==="id"?t.ids.set(e.value,s):t.ids.set(`name:${e.value}`,s),r.setAttribute(e.name,s);continue}if(na.has(i)||i.endsWith(":href")){cr(e.value,!1)&&r.removeAttribute(e.name);continue}oa.has(i)&&cr(e.value,!0)&&r.removeAttribute(e.name)}}function va(r,t){let e=(r.getAttribute("type")||"").toLowerCase();t==="button"&&e!=="button"&&r.setAttribute("type","button"),t==="input"&&/^(submit|reset|image)$/.test(e)&&r.setAttribute("type","button")}function wa(r,t){for(let e of r)for(let i of[...e.attributes]){let s=i.name.toLowerCase(),n=i.value;if((s==="href"||s.endsWith(":href"))&&n.startsWith("#")){let o=Aa(n.slice(1));t.has(o)&&e.setAttribute(i.name,`#${t.get(o)}`)}else if(s==="usemap"&&n.startsWith("#")){let o=t.get(`name:${n.slice(1)}`);o?e.setAttribute(i.name,`#${o}`):e.removeAttribute(i.name)}else if(ca.has(s)){let o=n.split(/\s+/).filter(Boolean).map(a=>t.get(a)||(a.startsWith(ei)?a:null)).filter(Boolean);o.length?e.setAttribute(i.name,o.join(" ")):e.removeAttribute(i.name)}else n.includes("url(#")&&e.setAttribute(i.name,n.replace(/url\(#([^)]+)\)/g,(o,a)=>t.has(a)?`url(#${t.get(a)})`:o))}}function Aa(r){try{return decodeURIComponent(r)}catch{return r}}function dr(r){let t=r.childNodes;if(t)for(let e of[...t])e.nodeType===8?e.remove():(e.nodeType===1||e.nodeType===11)&&dr(e)}function pr(r,t){dr(r);let e=[...r.querySelectorAll("*")];t.includeRoot&&e.unshift(r);let i=new Map,s=[],n={...t,ids:i};for(let o of e){if(!xa(o,r))continue;let a=ma(o);if(t.svgOnly&&(hr.has(a)||a==="style")){if(a==="style"&&ur(o.textContent||"")){o.remove();continue}}else if(ba(o,a)){o.remove();continue}if(!t.keepIds&&!t.svgOnly&&ua.has(a)){ka(o);continue}if(a==="template"){let c=o.content;c&&pr(c,{...t,includeRoot:!1})}ya(o,n),t.keepIds||va(o,a);let l=ha[a];if(l)for(let c of l)o.removeAttribute(c);if(a==="include-file"&&!t.allowIncludeFile&&o.removeAttribute("src"),!t.keepIds&&!t.svgOnly&&a.includes("-")&&a!=="include-file"&&!pa.has(a))for(let c of da)o.removeAttribute(c);s.push(o)}!t.keepIds&&i.size&&wa(s,i)}function ka(r){let t=r.parentNode;if(t){for(let e of[...r.childNodes])t.insertBefore(e,r);r.remove()}}function xa(r,t){let e=r;for(;e;){if(e===t)return!0;e=e.parentNode??e.parent??null}return!1}function Xt(r,t={}){let e=document.createElement("template");return r&&typeof r=="string"&&(e.innerHTML=r,pr(e.content,{allowIncludeFile:!!t.allowIncludeFile,keepIds:!!t.keepIds,keepStyle:!!t.keepStyle})),e.content}function fr({newItems:r,nodes:t,keyOf:e,renderItem:i,containerFor:s}){let n=[],o=[],a=[],l=new Set;for(let h of r)l.add(e(h));for(let[h,u]of[...t])l.has(h)||(u.remove(),t.delete(h),a.push(h));let c=new Map;for(let h of r){let u=e(h),p=t.get(u)||null,d=s(h,p);c.has(d)||c.set(d,[]),c.get(d)?.push({item:h,key:u,existing:p})}for(let[h,u]of c)for(let p=0;p<u.length;p++){let{item:d,key:f,existing:m}=u[p],y=m;y?(y.parentElement!==h||h.children[p]!==y)&&o.push(f):(y=i(d),t.set(f,y),n.push(f));let w=h.children[p];w!==y&&h.insertBefore(y,w||null)}return{added:n,moved:o,removed:a}}var ii=class extends b{#t=null;#e=null;#i=null;#s=new Map;#r=null;#n=new Map;#a=new Set;setup(){this.#c(),this.#h(),this.#u(),this.#l(),this.#A(),this.#p()}teardown(){for(let t of this.#a)t.abort();this.#a.clear()}#c(){this.#t=this.querySelector(":scope > chat-thread"),this.#e=this.querySelector(":scope > chat-input"),this.#i=this.querySelector(":scope > header select[data-model-select]")}#h(){let t=this.querySelector(":scope > script[data-participants]");if(t)try{let e=JSON.parse(t.textContent);this.#s=new Map(Object.entries(e))}catch{console.warn("[chat-window] Invalid participant JSON")}}#l(){if(this.#t)for(let t of this.#t.querySelectorAll("chat-message[data-from]"))this.#o(t)}#o(t){let e=t.getAttribute("data-from");if(!e)return;let i=this.#s.get(e);i?.name?t.setAttribute("data-from-label",i.name):t.hasAttribute("data-from-label")||t.setAttribute("data-from-label",e)}#u(){if(!this.#i)return;let t=this.getAttribute("model");t?this.#i.value=t:this.#i.value&&this.setAttribute("model",this.#i.value)}#p(){this.listen(this,"chat-input:send",this.#d),this.#i&&this.listen(this.#i,"change",this.#f)}#d=async t=>{t.stopPropagation();let{message:e}=t.detail;if(!e||!this.#t)return;let i=this.#v("user",e,"user");this.#t.appendChild(i),this.#m(),this.#A();let s=this.#w(),n=this.#g(s);this.#t.appendChild(n),this.#m(),this.#e&&(this.#e.disabled=!0);let o=this.getAttribute("endpoint");if(o){let a=new AbortController;this.#a.add(a);try{let l=await this.#b(o,e,a.signal);this.resolveTyping(n,l)}catch(l){a.signal.aborted?n.remove():(this.resolveTyping(n,"<p>Sorry, something went wrong.</p>",{error:!0}),this.dispatchEvent(new CustomEvent("chat-window:error",{bubbles:!0,detail:{error:l.message,status:l.status??0}})))}finally{this.#a.delete(a)}}else this.dispatchEvent(new CustomEvent("chat-window:send",{bubbles:!0,detail:{message:e,typingElement:n}}));this.#e&&(this.#e.disabled=!1,this.isConnected&&this.#e.focus()),this.#m(),this.#A()};#f=()=>{let t=this.#i.value;this.setAttribute("model",t),this.dispatchEvent(new CustomEvent("chat-window:model-change",{bubbles:!0,detail:{model:t}}))};#v(t,e,i){let s=document.createElement("chat-message");s.setAttribute("data-role",t),i&&(s.setAttribute("data-from",i),this.#o(s));let n=document.createElement("chat-bubble");return this.#y(n,e,{asText:t==="user"}),s.appendChild(n),s}#y(t,e,{asText:i=!1}={}){let s=e==null?"":String(e);if(i||!s.includes("<")){let n=document.createElement("p");n.textContent=s,t.replaceChildren(n)}else t.replaceChildren(Xt(s))}#g(t){let e=document.createElement("chat-message");e.setAttribute("data-role","agent"),e.setAttribute("data-status","typing");let i="Agent";t&&(e.setAttribute("data-from",t),this.#o(e),i=this.#s.get(t)?.name??t);let s=this.getAttribute("model");s&&e.setAttribute("data-model",s);let n=document.createElement("chat-bubble"),o=document.createElement("span");return o.className="visually-hidden",o.setAttribute("data-chat-typing",""),o.textContent=`${i} is typing`,n.appendChild(o),e.appendChild(n),e}#w(){for(let[t,e]of this.#s)if(e.role==="agent")return t;return null}#A(){if(!this.#t)return;if(this.#t.querySelector(":scope > chat-message")!==null){this.#r?.remove(),this.#r=null;return}this.#r||(this.#r=this.#t.querySelector(":scope > [data-chat-empty]")),this.#r||(this.#r=document.createElement("p"),this.#r.setAttribute("data-chat-empty",""),this.#r.textContent=this.getAttribute("empty-message")||"Send a message to start."),this.#r.parentNode!==this.#t&&this.#t.prepend(this.#r)}#m(){this.#t&&requestAnimationFrame(()=>{this.#t.scrollTop=this.#t.scrollHeight})}scrollToBottom(){this.#m()}async#b(t,e,i){let s={message:e,model:this.getAttribute("model")||void 0},n=await fetch(t,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(s),signal:i});if(!n.ok){let a=new Error(`Chat request failed: ${n.status}`);throw a.status=n.status,a}let o=await n.json();return o.html??o.message??o.content??""}get model(){return this.getAttribute("model")??""}set model(t){this.setAttribute("model",t),this.#i&&(this.#i.value=t)}get participants(){return this.#s}set participants(t){this.#s=t instanceof Map?t:new Map(Object.entries(t)),this.#l()}clearThread(){if(this.#t){for(;this.#t.firstChild;)this.#t.removeChild(this.#t.firstChild);this.#A()}}appendMessage(t,e,i){if(!this.#t)return;let s=this.#v(t,e,i);return this.#t.appendChild(s),this.#m(),this.#A(),s}resolveTyping(t,e,{error:i=!1}={}){if(!t)return;let s=t.querySelector(":scope > chat-bubble");s||(s=document.createElement("chat-bubble"),t.appendChild(s)),this.#y(s,e),i?t.setAttribute("data-status","error"):t.removeAttribute("data-status"),this.#m()}get messages(){return this.#t?[...this.#t.querySelectorAll(':scope > chat-message:not([data-status="typing"])')].map(t=>{let e=t.getAttribute("data-role")||"user",i=t.querySelector("chat-bubble");return{id:t.id||t.getAttribute("data-id")||void 0,role:e,content:(e==="user"?i?.textContent?.trim():i?.innerHTML)||"",from:t.getAttribute("data-from")||void 0}}):[]}set messages(t){if(!this.#t)return;let e=Array.isArray(t)?t:[];for(let[s,n]of this.#n)n.parentNode!==this.#t&&this.#n.delete(s);let i=new Set(this.#n.values());for(let s of[...this.#t.children])if(!i.has(s)){if(s.localName==="chat-message"&&s.id&&!s.matches('[data-status="typing"]')&&!this.#n.has(s.id)){this.#n.set(s.id,s);continue}s===this.#r&&(this.#r=null),s.remove()}fr({newItems:e,nodes:this.#n,keyOf:s=>s.id??s.role+":"+s.content,renderItem:s=>{let n=this.#v(s.role||"user",s.content||"",s.from);return s.id&&(n.id=s.id),n},containerFor:()=>this.#t}),this.#A(),this.#m(),this.dispatchEvent(new CustomEvent("chat-window:messages-changed",{detail:{messages:e,source:"property"},bubbles:!0}))}};g("chat-window",ii);var si=class extends b{static formAssociated=!0;#t;#e=null;#i=null;#s;#r=!1;constructor(){super(),this.#t=this.attachInternals(),this._adoptInternals(this.#t)}setup(){return this.#e=this.querySelector(":scope > textarea, :scope textarea[data-grow]"),this.#i=this.querySelector("[data-send]"),this.#e?(this.#n(),this.listen(this.#e,"keydown",this.#a),this.listen(this.#e,"input",this.#c),this.#i&&this.listen(this.#i,"click",this.#h),this.form&&this.listen(this.form,"submit",this.#l),this.#f(),this.#p(),this.#d(),this.hasAttribute("autofocus")&&requestAnimationFrame(()=>this.#e?.focus()),!0):!1}teardown(){clearTimeout(this.#s)}#n(){let t=this.#e;t&&(t.hasAttribute("aria-label")||t.hasAttribute("aria-labelledby")||t.labels&&t.labels.length||t.hasAttribute("title")||t.setAttribute("aria-label","Message"))}#a=t=>{if(!(t.isComposing||t.keyCode===229))switch(t.key){case"Enter":t.shiftKey||(t.preventDefault(),this.#u());break;case"Escape":t.preventDefault(),this.reset();break}};#c=()=>{this.#p(),this.#d(),clearTimeout(this.#s),this.#s=setTimeout(()=>{this.dispatchEvent(new CustomEvent("chat-input:input",{bubbles:!0,detail:{value:this.value,length:this.value.length}}))},100)};#h=t=>{let e=this.#i;this.form&&e?.type==="submit"&&e.form===this.form&&this.#o()||(t.preventDefault(),this.#u())};#l=t=>{setTimeout(()=>{t.defaultPrevented||this.reset()},0)};#o({report:t=!1}={}){if(this.matches(":disabled"))return!1;let e=this.value.trim(),i=parseInt(this.getAttribute("minlength")??"1",10)||1;return e.length<i?!1:this.#t.validity.valid?!0:(t&&this.#t.reportValidity(),!1)}#u(){if(!this.#o({report:!0}))return;let t=this.form;if(t){let e=this.#i,i=e?.type==="submit"&&e.form===t?e:null;t.requestSubmit(i);return}this.dispatchEvent(new CustomEvent("chat-input:send",{bubbles:!0,detail:{message:this.value.trim()}})),this.reset()}#p(){let t=this.value;this.#t.setFormValue(t||null)}#d(){let t=this.value,e=parseInt(this.getAttribute("maxlength")??"4000",10)||4e3;t.length>e&&this.#e?this.#t.setValidity({tooLong:!0},`Message exceeds ${e} characters`,this.#e):this.#t.setValidity({})}#f(){let t=this.hasAttribute("disabled")||this.#r;this.#e&&(this.#e.disabled=t),this.#i&&(this.#i.disabled=t)}formDisabledCallback(t){this.#r=t,this.#f()}formResetCallback(){this.reset()}formStateRestoreCallback(t){!t||!this.#e||(this.#e.value=t,this.#p(),this.#d())}get form(){return this.#t.form}get name(){return this.getAttribute("name")??""}get validity(){return this.#t.validity}get validationMessage(){return this.#t.validationMessage}checkValidity(){return this.#t.checkValidity()}reportValidity(){return this.#t.reportValidity()}get value(){return this.#e?.value??""}set value(t){if(!this.#e)return;let e=t==null?"":String(t);this.#e.value!==e&&(this.#e.value=e,this.#e.dispatchEvent(new Event("input",{bubbles:!0})),this.#p(),this.#d(),this.dispatchEvent(new CustomEvent("chat-input:change",{bubbles:!0,detail:{value:e,source:"api"}})))}get disabled(){return this.hasAttribute("disabled")}set disabled(t){this.toggleAttribute("disabled",!!t)}focus(){this.#e?.focus()}reset(){this.#e&&(this.#e.value="",this.#e.dispatchEvent(new Event("input",{bubbles:!0})),this.#p(),this.#d())}static get observedAttributes(){return["disabled"]}attributeChangedCallback(t){t==="disabled"&&this.#f()}};g("chat-input",si);function mr(r,t,e){let i=r[t];if(!i)return-1;let s=i.x+i.width/2,n=i.y+i.height/2,o=e==="left"||e==="right",a=e==="left"||e==="up"?-1:1,l=-1,c=1/0;for(let h=0;h<r.length;h++){let u=r[h];if(h===t||!u)continue;let p=u.x+u.width/2-s,d=u.y+u.height/2-n,f=(o?p:d)*a;if(!(f>0))continue;let m=(o?d:p)*2,y=Math.hypot(f,m);y<c&&(c=y,l=h)}return l}var Jt="http://www.w3.org/2000/svg";function Ea(r){return r.trim().split(/[\s,]+/).map(Number)}function Sa(r,t){let e=Ea(t);switch(r){case"rect":{let[i,s,n,o]=e;return{type:"rect",x:i,y:s,width:n-i,height:o-s}}case"circle":{let[i,s,n]=e;return{type:"circle",cx:i,cy:s,r:n}}case"poly":{let i=[];for(let s=0;s<e.length;s+=2)i.push([e[s],e[s+1]]);return{type:"poly",points:i}}default:return null}}function Ca(r){if(!r)return null;switch(r.type){case"rect":{let t=document.createElementNS(Jt,"rect");return t.setAttribute("x",String(r.x)),t.setAttribute("y",String(r.y)),t.setAttribute("width",String(r.width)),t.setAttribute("height",String(r.height)),t}case"circle":{let t=document.createElementNS(Jt,"circle");return t.setAttribute("cx",String(r.cx)),t.setAttribute("cy",String(r.cy)),t.setAttribute("r",String(r.r)),t}case"poly":{let t=document.createElementNS(Jt,"polygon");return t.setAttribute("points",r.points.map(e=>e.join(",")).join(" ")),t}default:return null}}function Ta(r){if(!r)return{x:0,y:0,width:0,height:0};switch(r.type){case"rect":return{x:r.x,y:r.y,width:r.width,height:r.height};case"circle":return{x:r.cx-r.r,y:r.cy-r.r,width:r.r*2,height:r.r*2};case"poly":{let t=100,e=100,i=0,s=0;for(let[n,o]of r.points)n<t&&(t=n),o<e&&(e=o),n>i&&(i=n),o>s&&(s=o);return{x:t,y:e,width:i-t,height:s-e}}default:return{x:0,y:0,width:0,height:0}}}var gr=0,Ma=300,La={ArrowLeft:"left",ArrowRight:"right",ArrowUp:"up",ArrowDown:"down"},_a='a[href], button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])';function Ra(r){return r==null||r===""?[]:r instanceof HTMLTemplateElement?[r.content.cloneNode(!0)]:r instanceof Node?[r.cloneNode(!0)]:[document.createTextNode(String(r))]}var ri=class extends HTMLElement{get shape(){return this.getAttribute("shape")||"rect"}get coords(){return this.getAttribute("coords")||""}get label(){return this.getAttribute("label")||""}get href(){return this.getAttribute("href")}get target(){return this.getAttribute("target")||""}get tooltipMode(){return this.getAttribute("tooltip")||"hover"}get disabled(){return this.hasAttribute("disabled")}connectedCallback(){this.setAttribute("data-upgraded","")}disconnectedCallback(){this.removeAttribute("data-upgraded")}},ni=class extends b{#t=null;#e=null;#i=null;#s=[];#r=[];#n=null;#a=null;#c=null;#h=0;#l=0;#o=[];setup(){if(this.#t=this.querySelector(":scope > img"),!this.#t){let t=this.getAttribute("src"),e=this.getAttribute("alt");if(t)this.#t=document.createElement("img"),this.#t.src=t,this.#t.alt=e||"",this.prepend(this.#t);else return!1}return this.#t.classList.add("image-map-img"),this.#t.complete?this.#u():this.listen(this.#t,"load",()=>this.#u(),{once:!0}),!0}teardown(){this.#a?.disconnect(),this.#a=null,this.#g(),clearTimeout(this.#h),cancelAnimationFrame(this.#l),this.#e?.remove(),this.#i?.remove();for(let t of this.#r)t.anchor?.remove();for(let t of this.#o)t.removeAttribute("id");this.#e=null,this.#i=null,this.#r=[],this.#s=[],this.#o=[],this.#c=null}get regions(){return[...this.querySelectorAll(":scope > map-area")].map(t=>{let e;if(t.children.length){let i=document.createDocumentFragment();i.append(...[...t.childNodes].map(s=>s.cloneNode(!0))),e=i}else e=t.textContent?.trim()||void 0;return{shape:t.getAttribute("shape")||void 0,coords:t.getAttribute("coords")||void 0,label:t.getAttribute("label")||t.textContent?.trim().replace(/\s+/g," ")||void 0,href:t.getAttribute("href")||void 0,target:t.getAttribute("target")||void 0,tooltip:t.getAttribute("tooltip")||void 0,disabled:t.hasAttribute("disabled")||void 0,content:e}})}set regions(t){let e=Array.isArray(t)?t:[];for(let i of[...this.querySelectorAll(":scope > map-area")])i.remove();for(let i of e){if(!i)continue;let s=document.createElement("map-area");i.shape&&s.setAttribute("shape",i.shape),i.coords&&s.setAttribute("coords",i.coords),i.label&&s.setAttribute("label",i.label),i.href&&s.setAttribute("href",i.href),i.target&&s.setAttribute("target",i.target),i.tooltip&&s.setAttribute("tooltip",i.tooltip),i.disabled&&s.setAttribute("disabled",""),s.append(...Ra(i.content)),this.appendChild(s)}this._reinit(),this.dispatchEvent(new CustomEvent("image-map:regions-changed",{detail:{regions:this.regions,source:"property"},bubbles:!0}))}#u(){if(!this.isConnected||this.#e)return;let t=[...this.querySelectorAll(":scope > map-area")];if(t.length===0)return;let e=document.createElementNS(Jt,"svg");e.setAttribute("viewBox","0 0 100 100"),e.setAttribute("preserveAspectRatio","none"),e.setAttribute("aria-hidden","true"),e.classList.add("image-map-overlay"),this.#e=e;let i=document.createElement("div");i.className="image-map-tooltip",i.id=`imap-tip-${++gr}`,i.hidden=!0,this.#i=i;for(let s of t){let n=s,o=Sa(n.shape,n.coords),a=Ca(o);if(!a)continue;let l=Ta(o),c=s.getAttribute("href"),h=s.getAttribute("target")||"",u=s.getAttribute("tooltip")||"hover",p=s.hasAttribute("disabled"),d=s.textContent?.trim().replace(/\s+/g," ")||"",f=s.getAttribute("label")||d,m=c?document.createElement("a"):document.createElement("button");c?(m.href=c,h&&(m.target=h)):m.type="button",m.className="image-map-anchor",m.textContent=f;let y=u!=="none"&&(s.children.length>0||d&&d!==f);y&&(s.id||(s.id=`imap-area-${++gr}`,this.#o.push(s)),u==="click"?(m.setAttribute("aria-expanded","false"),m.setAttribute("aria-controls",i.id)):m.setAttribute("aria-describedby",s.id)),m.style.left=`${l.x}%`,m.style.top=`${l.y}%`,m.style.width=`${l.width}%`,m.style.height=`${l.height}%`,p&&(a.setAttribute("data-disabled",""),m.setAttribute("tabindex","-1"),m.setAttribute("aria-disabled","true"));let w={area:s,parsed:o,bbox:l,disabled:p,svgShape:a,anchor:m,href:c,target:h,mode:u,hasContent:y,keyboardOpen:!1};p||this.#p(w),e.appendChild(a),this.#r.push(w),this.#s.push(m)}this.appendChild(e);for(let s of this.#s)this.appendChild(s);this.appendChild(i),this.listen(i,"pointerenter",()=>clearTimeout(this.#h)),this.listen(i,"pointerleave",()=>{this.#n?.mode==="hover"&&!this.#f()&&this.#v()}),this.listen(i,"focusout",s=>{let n=s.relatedTarget;n&&(i.contains(n)||n===this.#n?.anchor)||this.#g()}),this.listen(this,"keydown",this.#m),this.listen(document,"keydown",this.#b),this.listen(document,"pointerdown",this.#S),this.listen(window,"scroll",this.#w,{passive:!0,capture:!0}),this.#a=new ResizeObserver(this.#w),this.#a.observe(this.#t),this.setAttribute("role","group"),!this.hasAttribute("aria-label")&&!this.hasAttribute("aria-labelledby")&&this.setAttribute("aria-label",this.#t.alt||this.dataset.labelMap||"Image map")}#p(t){let{svgShape:e,anchor:i,area:s,mode:n}=t;this.listen(e,"pointerenter",()=>{clearTimeout(this.#h),n==="hover"&&this.#y(t),e.setAttribute("data-hover",""),this.#x("image-map:area-enter",s)}),this.listen(e,"pointerleave",()=>{n==="hover"&&this.#n===t&&!this.#f()&&this.#v(),document.activeElement!==i&&e.removeAttribute("data-hover"),this.#x("image-map:area-leave",s)}),this.listen(e,"click",()=>{let o=this.#d(t,!1);t.href&&n!=="click"&&!o.defaultPrevented&&(t.target==="_blank"?window.open(t.href,"_blank","noopener"):window.location.href=t.href)}),this.listen(e,"touchstart",o=>{n==="hover"&&(this.#c!==t?(o.preventDefault(),this.#c=t,this.#y(t)):this.#c=null)},{passive:!1}),this.listen(i,"click",o=>{let a=o.detail===0,l=this.#d(t,a);(n==="click"||l.defaultPrevented)&&o.preventDefault()}),t.href&&this.listen(i,"keydown",o=>{o.key===" "&&(o.preventDefault(),i.click())}),this.listen(i,"focus",()=>{clearTimeout(this.#h),n==="hover"&&this.#y(t),e.setAttribute("data-hover",""),this.#x("image-map:area-enter",s)}),this.listen(i,"blur",o=>{e.removeAttribute("data-hover"),this.#x("image-map:area-leave",s);let a=o.relatedTarget;this.#n===t&&!(a&&this.#i?.contains(a))&&this.#g()})}#d(t,e){if(t.mode==="click"&&t.hasContent){if(this.#n===t)this.#g();else if(this.#y(t),e){t.keyboardOpen=!0;let i=this.#i?.querySelector(_a);i&&i.focus()}}return this.#x("image-map:area-activate",t.area,!0)}#f(){let t=document.activeElement;return!!(t&&this.#i?.contains(t))}#v(){clearTimeout(this.#h),this.#h=setTimeout(()=>this.#g(),Ma)}#y(t){let e=this.#i;!e||t.mode==="none"||!t.hasContent||(clearTimeout(this.#h),this.#n&&this.#n!==t&&this.#g(),this.#n=t,e.replaceChildren(...[...t.area.childNodes].map(i=>i.cloneNode(!0))),t.mode==="click"?(e.removeAttribute("role"),e.setAttribute("role","group"),e.setAttribute("aria-label",t.anchor.textContent||""),t.anchor.setAttribute("aria-expanded","true")):(e.setAttribute("role","tooltip"),e.removeAttribute("aria-label")),t.anchor.nextSibling!==e&&t.anchor.after(e),e.hidden=!1,e.setAttribute("data-state-visible",""),this.#A(t.svgShape))}#g({restoreFocus:t=!1}={}){clearTimeout(this.#h);let e=this.#n,i=this.#i;if(!i||!e)return;let s=this.#f();this.#n=null,e.keyboardOpen=!1,e.mode==="click"&&e.anchor.hasAttribute("aria-expanded")&&e.anchor.setAttribute("aria-expanded","false"),i.removeAttribute("data-state-visible"),i.hidden=!0,i.replaceChildren(),(t||s)&&e.anchor.focus()}#w=()=>{!this.#n||this.#l||(this.#l=requestAnimationFrame(()=>{this.#l=0,this.#n&&this.#A(this.#n.svgShape)}))};#A(t){if(!this.#i||!t)return;let e=t.getBoundingClientRect(),i=this.#i.getBoundingClientRect(),s=8,n=8,o=window.innerWidth,a=window.innerHeight,l,c,h=e.top-i.height-s;h>=n?(l=h,c=e.left+(e.width-i.width)/2):e.bottom+s+i.height<=a-n?(l=e.bottom+s,c=e.left+(e.width-i.width)/2):e.right+s+i.width<=o-n?(l=e.top+(e.height-i.height)/2,c=e.right+s):(l=e.top+(e.height-i.height)/2,c=e.left-i.width-s),c=Math.max(n,Math.min(c,o-i.width-n)),l=Math.max(n,Math.min(l,a-i.height-n)),this.#i.style.top=`${l}px`,this.#i.style.left=`${c}px`}#m=t=>{if(this.#i?.contains(t.target))return;let e=La[t.key];if(!e)return;let i=this.#r.findIndex(o=>o.anchor===document.activeElement);if(i===-1)return;t.preventDefault();let s=this.#r.map(o=>o.disabled?null:o.bbox),n=mr(s,i,e);n!==-1&&this.#r[n].anchor.focus()};#b=t=>{t.key==="Escape"&&(this.#c=null,this.#n&&(t.preventDefault(),this.#g()))};#S=t=>{if(!this.#n)return;let e=t.target;this.#i?.contains(e)||this.contains(e)&&e!==this&&e!==this.#t||(this.#c=null,this.#g())};#x(t,e,i=!1){let s=new CustomEvent(t,{detail:{area:e},bubbles:!0,cancelable:i});return this.dispatchEvent(s),s}};g("map-area",ri);g("image-map",ni);var Na='<svg viewBox="0 0 68 48" width="68" height="48" aria-hidden="true" focusable="false"><path d="M66.52 7.74c-.78-2.93-2.49-5.41-5.42-6.19C55.79.13 34 0 34 0S12.21.13 6.9 1.55c-2.93.78-4.64 3.26-5.42 6.19C.06 13.05 0 24 0 24s.06 10.95 1.48 16.26c.78 2.93 2.49 5.41 5.42 6.19C12.21 47.87 34 48 34 48s21.79-.13 27.1-1.55c2.93-.78 4.64-3.26 5.42-6.19C67.94 34.95 68 24 68 24s-.06-10.95-1.48-16.26z" fill="var(--color-error, #f00)"/><path d="M45 24 27 14v20z" fill="#fff"/></svg>',$a={hq:"hqdefault",mq:"mqdefault",sd:"sddefault",maxres:"maxresdefault"},br="YouTube video",Pa="Play {title}",Ia=/^\d+$/;function yr(r){return String(r).replace(/[&<>"']/g,t=>({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"})[t])}function Oa(){return window.matchMedia("(prefers-reduced-motion: reduce)").matches||document.documentElement.hasAttribute("data-motion-reduced")}var oi=class extends b{#t="";#e=br;setup(){let t=this.getAttribute("video-id");return this.#e=this.getAttribute("title")||br,t?/^[A-Za-z0-9_-]{6,20}$/.test(t)?(this.#t=t,this.hasAttribute("autoplay")&&!Oa()?this.#c(!1):this.#a(),!0):(console.warn(`youtube-player: invalid video-id ${JSON.stringify(t)}`),!1):(console.warn("youtube-player: missing required video-id attribute"),!1)}#i(t){let e=this.getAttribute(t);return e===null||e===""?null:Ia.test(e.trim())?e.trim():(console.warn(`youtube-player: ${t} must be whole seconds, got ${JSON.stringify(e)}`),null)}#s(){let t=new URLSearchParams({autoplay:"1"}),e=this.#i("start");e&&t.set("start",e);let i=this.#i("end");i&&t.set("end",i);let s=this.getAttribute("list");s&&t.set("list",s);let n=this.getAttribute("params");return n&&new URLSearchParams(n).forEach((o,a)=>t.set(a,o)),`https://www.youtube-nocookie.com/embed/${this.#t}?${t}`}#r(t){return`https://i.ytimg.com/vi/${this.#t}/${$a[t]??"hqdefault"}.jpg`}#n(){return(this.getAttribute("data-label-play")||Pa).replace(/\{title\}/g,this.#e)}#a(){this.setAttribute("state","ready");let t=document.createElement("img");t.alt="",t.loading="lazy",t.decoding="async";let e=this.getAttribute("poster");if(e)t.src=e;else{let s=this.getAttribute("thumbnail")??"hq";if(t.referrerPolicy="no-referrer",t.src=this.#r(s),s==="sd"||s==="maxres"){let n=()=>{t.src=this.#r("hq")};t.addEventListener("error",n,{once:!0}),t.addEventListener("load",()=>{t.naturalWidth<=120&&n()},{once:!0})}}let i=document.createElement("button");i.type="button",i.setAttribute("aria-label",this.#n()),i.innerHTML=Na,i.addEventListener("click",()=>this.#c(!0),{once:!0}),this.replaceChildren(t,i)}#c(t){this.setAttribute("state","active"),this.innerHTML=`<iframe src="${yr(this.#s())}" title="${yr(this.#e)}" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerpolicy="strict-origin-when-cross-origin" allowfullscreen loading="lazy"></iframe>`,t&&this.querySelector("iframe")?.focus(),this.dispatchEvent(new CustomEvent("youtube-player:activate",{bubbles:!0,detail:{videoId:this.#t,fromUser:t}}))}};g("youtube-player",oi);var _t=CSS.supports("anchor-name","--x")&&CSS.supports("position-area","bottom"),vr=()=>window.matchMedia("(prefers-reduced-motion: reduce)").matches,za="--tour-target",ai='button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])',Ba='input, textarea, select, [contenteditable]:not([contenteditable="false"])',Da={title:"Page Tour",step:"Step {n} of {total}",skip:"Skip tour",close:"Close",prev:"Previous",next:"Next",finish:"Finish",nav:"Tour navigation",ready:"Done. Next is available."},ja=0,li=class extends HTMLElement{get target(){return this.dataset.target??""}get placement(){return this.dataset.placement??"auto"}get action(){return this.dataset.action??"none"}get actionHint(){return this.dataset.actionHint??null}get skippable(){return this.dataset.skippable!=="false"}get scrollBehavior(){return this.dataset.scroll??"smooth"}};function wr(r){if(!r?.target)return null;try{return document.querySelector(r.target)}catch{return null}}function _(r,t,e){let i=document.createElement(r);return t&&(i.className=t),e!=null&&(i.textContent=e),i}var ci=class r extends b{#t=[];#e=0;#i=!1;#s=null;#r=null;#n=null;#a=null;#c=null;#h=null;#l="";#o=null;#u=null;#p=null;#d=null;#f=null;#v=null;#y=null;static#g=null;static observedAttributes=["data-step"];setup(){if(this.#t=[...this.querySelectorAll("tour-step")],this.#t.length===0)return!1;let t=this.querySelector(".page-tour-start-btn");if(t&&this.listen(t,"click",e=>{e.preventDefault(),this.start()}),this.id&&this.listen(document,"click",e=>{e.target?.closest?.(`[data-tour="${CSS.escape(this.id)}"]`)&&(e.preventDefault(),this.start())}),this.dataset.trigger==="auto"){let e=this.#W();e?.complete||e?.skipped?this.setAttribute("data-complete",""):this.#y=setTimeout(()=>{this.#y=null,this.isConnected&&this.start(e?.step??0)},400)}return!0}teardown(){this.#y&&(clearTimeout(this.#y),this.#y=null),this.#i&&this.stop()}attributeChangedCallback(t,e,i){if(t==="data-step"&&this.#i&&e!==null){let s=parseInt(i,10);!Number.isNaN(s)&&s!==this.#e&&this.goto(s)}}start(t=0){let e=Math.min(Math.max(0,Number(t)||0),this.#t.length-1);if(this.#i){this.goto(e);return}let i=this.#b(e,1,!0);if(i===-1&&(i=this.#b(e-1,-1,!0)),i===-1){console.warn("[page-tour] No step target found on the page; tour not started");return}r.#g&&r.#g!==this&&r.#g.stop(),this.#c=document.activeElement,this.#i=!0,r.#g=this,this.#S(),this.setAttribute("data-active",""),this.removeAttribute("data-complete"),this.#q("tour:start",{step:i}),this.#N(i,"next")}stop(){this.#i&&(this.#R(),this.#i=!1,this.removeAttribute("data-active"),r.#g===this&&(r.#g=null))}next(){if(!this.#i||this.#m())return;let t=this.#b(this.#e+1,1,!0);t===-1?this.#$():this.#N(t,"next")}prev(){if(!this.#i)return;let t=this.#b(this.#e-1,-1,!0);t!==-1&&this.#N(t,"prev")}goto(t){if(!this.#i)return;let e=Number(t);if(!Number.isInteger(e)||e<0||e>=this.#t.length)return;let i=e>=this.#e?"next":"prev",s=i==="next"?1:-1,n=this.#b(e,s,!0);n===-1&&(n=this.#b(e-s,s===1?-1:1,!0)),!(n===-1||n===this.#e)&&this.#N(n,i)}skip(){this.#i&&this.#A(this.#t[this.#e])&&(this.#q("tour:skip",{step:this.#e}),this.#U({skipped:!0}),this.stop(),this.setAttribute("data-complete",""))}reset(){this.#Z(),this.removeAttribute("data-complete"),this.dataset.step="0"}#w(t){return(t==="title"?this.dataset.title:this.getAttribute(`data-label-${t}`))??Da[t]}#A(t){return(this.dataset.mode??"passive")!=="forced"&&(t?.skippable??!0)}#m(){return!!this.#n?.querySelector(".page-tour-next[data-waiting]")}#b(t,e,i=!1){for(let s=t;s>=0&&s<this.#t.length;s+=e){if(wr(this.#t[s]))return s;i&&console.warn(`[page-tour] Target "${this.#t[s].target}" not found, skipping step ${s}`)}return-1}#S(){this.#s=_("div","page-tour-backdrop"),this.#s.setAttribute("aria-hidden","true"),this.#s.addEventListener("click",()=>this.skip()),this.#r=_("div","page-tour-spotlight"),this.#r.setAttribute("aria-hidden","true"),this.#n=_("div","page-tour-card"),this.#n.setAttribute("popover","manual"),this.#n.setAttribute("role","dialog"),this.#n.setAttribute("aria-label",this.#w("title")),this.#n.setAttribute("tabindex","-1"),this.#n.toggleAttribute("data-anchored",_t),this.#n.addEventListener("click",e=>this.#j(e));let t=parseFloat(this.dataset.spotlightPadding??"");if(Number.isFinite(t)&&t>=0)for(let e of[this.#r,this.#n])e.style.setProperty("--tour-spotlight-padding",`${t}px`);this.#a=_("div","visually-hidden"),this.#a.setAttribute("aria-live","polite"),this.#a.setAttribute("aria-atomic","true"),this.#a.id=`page-tour-announcer-${++ja}`,this.append(this.#s,this.#r,this.#n,this.#a),this.#n.showPopover(),this.#u=new AbortController,document.addEventListener("keydown",e=>this.#L(e),{signal:this.#u.signal}),requestAnimationFrame(()=>{this.#s?.setAttribute("data-state-visible","")})}#x(t){this.#h=t;let e=getComputedStyle(t).position==="static";t.setAttribute("data-tour-target",e?"raised":""),_t&&(this.#l=t.style.getPropertyValue("anchor-name"),t.style.setProperty("anchor-name",za))}#T(){let t=this.#h;t&&(t.removeAttribute("data-tour-target"),_t&&(this.#l?t.style.setProperty("anchor-name",this.#l):t.style.removeProperty("anchor-name"),t.getAttribute("style")||t.removeAttribute("style")),this.#l="",this.#h=null)}#E(t){if(!this.#r)return;let e=t.getBoundingClientRect();Object.assign(this.#r.style,{top:`${e.top}px`,left:`${e.left}px`,width:`${e.width}px`,height:`${e.height}px`})}#k(t,e){let i=getComputedStyle(this).direction==="rtl";switch(e){case"top":case"bottom":return e;case"inline-start":return i?"right":"left";case"inline-end":return i?"left":"right";default:return this.#O(t)}}#M(t,e){if(!this.#n)return;let i=this.#k(t,e);this.#n.dataset.side=i,_t||this.#C(t,i)}#C(t,e){let i=this.#n;if(!i)return;let s=t.getBoundingClientRect(),n=12,o=8,a=this.#r&&parseFloat(getComputedStyle(this.#r).paddingTop)||0;i.style.visibility="hidden",i.style.top="0",i.style.left="0";let l=i.getBoundingClientRect();i.style.visibility="";let c=0,h=0;switch(e){case"bottom":c=s.bottom+a+n,h=s.left+(s.width-l.width)/2;break;case"top":c=s.top-a-n-l.height,h=s.left+(s.width-l.width)/2;break;case"right":c=s.top+(s.height-l.height)/2,h=s.right+a+n;break;case"left":c=s.top+(s.height-l.height)/2,h=s.left-a-n-l.width;break}h=Math.max(o,Math.min(h,window.innerWidth-l.width-o)),c=Math.max(o,Math.min(c,window.innerHeight-l.height-o)),i.style.top=`${c}px`,i.style.left=`${h}px`}#O(t){let e=t.getBoundingClientRect(),i=window.innerHeight-e.bottom,s=e.top,n=window.innerWidth-e.right,o=e.left,a=Math.max(i,s,n,o);return a===i?"bottom":a===s?"top":a===n?"right":"left"}#I(t,e){let i=this.#n;if(!i)return;let s=this.#t.length,n=this.#b(e+1,1)!==-1,o=this.#b(e-1,-1)!==-1,a=t.action!=="none",l=_("div","page-tour-progress");l.setAttribute("aria-hidden","true"),this.#t.forEach((m,y)=>{let w=_("span","page-tour-pip");y===e&&w.setAttribute("data-active",""),y<e&&w.setAttribute("data-visited",""),l.append(w)});let c=_("p","page-tour-meta");c.append(_("span","page-tour-step-count",this.#w("step").replace("{n}",String(e+1)).replace("{total}",String(s))));let h=_("div","page-tour-content");for(let m of t.childNodes)h.append(m.cloneNode(!0));let u=_("footer","page-tour-footer");if(this.#A(t)){let m=_("button","page-tour-skip",this.#w(n?"skip":"close"));m.type="button",m.dataset.action="skip",u.append(m)}let p=_("nav","page-tour-nav");if(p.setAttribute("aria-label",this.#w("nav")),o){let m=_("button","page-tour-prev",this.#w("prev"));m.type="button",m.dataset.action="prev",p.append(m)}let d=_("button","page-tour-next",this.#w(n?"next":"finish"));d.type="button",d.dataset.action="next",p.append(d),u.append(p);let f=[l,c,h];if(a&&(d.setAttribute("data-waiting",""),d.setAttribute("aria-disabled","true"),t.actionHint)){let m=_("p","page-tour-action-hint",t.actionHint);m.id=`${this.#a?.id??"page-tour"}-hint`,d.setAttribute("aria-describedby",m.id),f.push(m)}f.push(u),i.replaceChildren(...f),a?i.removeAttribute("aria-modal"):i.setAttribute("aria-modal","true")}#N(t,e="next"){let i=this.#t[t],s=wr(i);if(!i||!s)return;if(this.#d?.abort(),this.#d=null,this.#D(),this.#T(),this.#e=t,this.#x(s),i.scrollBehavior!=="none"){let l=vr()?"instant":i.scrollBehavior;s.scrollIntoView({block:"nearest",behavior:l})}this.#I(i,t),this.#E(s),this.#M(s,i.placement);let n=this.#n;n?.focus(),requestAnimationFrame(()=>{if(this.#n!==n||this.#e!==t)return;let l=n?.querySelector(".page-tour-content :is(h2, h3, h4)")??null;l?(l.hasAttribute("tabindex")||l.setAttribute("tabindex","-1"),l.focus()):(n?.querySelector(".page-tour-next")??null)?.focus()});let o=i.querySelector("h2, h3, h4"),a=this.#w("step").replace("{n}",String(t+1)).replace("{total}",String(this.#t.length));this.#G(o?.textContent?`${a}: ${o.textContent.trim()}`:a),this.dataset.step=String(t),i.action!=="none"&&this.#P(i,s),this.#F(s),this.#U({step:t}),this.#q("tour:step",{step:t,target:s,direction:e})}#P(t,e){let i=new AbortController;this.#d=i;let n={click:"click",focus:"focus",input:"input",change:"change"}[t.action];n?e.addEventListener(n,()=>{i.abort(),this.#_(),this.#q("tour:action",{step:this.#e,action:t.action})},{signal:i.signal}):t.action==="custom"&&this.addEventListener("tour:action",()=>{i.abort(),this.#_()},{signal:i.signal})}#_(){let t=this.#n?.querySelector(".page-tour-next");t&&(t.removeAttribute("data-waiting"),t.removeAttribute("aria-disabled"),t.removeAttribute("aria-describedby"),this.#n?.querySelector(".page-tour-action-hint")?.remove(),this.#G(this.#w("ready")))}#L(t){if(!this.#i||t.defaultPrevented)return;let e=t.target instanceof Element?t.target:null,i=!!e&&(!!this.#n?.contains(e)||e===document.body),s=!!e?.closest(Ba),n=!i||s||t.altKey||t.ctrlKey||t.metaKey,o=t.key;switch(getComputedStyle(document.documentElement).direction==="rtl"&&(o==="ArrowRight"?o="ArrowLeft":o==="ArrowLeft"&&(o="ArrowRight")),o){case"Escape":this.#A(this.#t[this.#e])&&(t.preventDefault(),this.skip());break;case"ArrowRight":case"ArrowDown":if(n)return;t.preventDefault(),this.next();break;case"ArrowLeft":case"ArrowUp":if(n)return;t.preventDefault(),this.prev();break;case"Home":if(n)return;t.preventDefault(),this.goto(0);break;case"End":if(n)return;t.preventDefault(),this.goto(this.#t.length-1);break;case"Tab":this.#z(t);break}}#z(t){if(!this.#n)return;let e=d=>!d.disabled&&(d.checkVisibility?.()??!0),i=[...this.#n.querySelectorAll(ai)].filter(e),s=[],n=this.#t[this.#e],o=this.#h;n&&n.action!=="none"&&o&&(s=(o.matches(ai)?[o]:[...o.querySelectorAll(ai)]).filter(e));let a=[...i,...s];if(a.length===0)return;let l=a[0],c=a[a.length-1],h=document.activeElement,u=!h||!a.includes(h),p=u?-1:a.indexOf(h);t.preventDefault(),t.shiftKey?(u||h===l?c:a[p-1]).focus():(u||h===c?l:a[p+1]).focus()}#j(t){let e=t.target.closest?.("[data-action]")??null;if(e)switch(e.dataset.action){case"next":this.next();break;case"prev":this.prev();break;case"skip":this.skip();break}}#F(t){let e=new AbortController;this.#p=e;let i=()=>this.#B();document.addEventListener("scroll",i,{capture:!0,passive:!0,signal:e.signal}),window.addEventListener("resize",i,{passive:!0,signal:e.signal}),this.#o=new ResizeObserver(i),this.#o.observe(t),this.#v=setTimeout(i,vr()?0:300)}#D(){this.#p?.abort(),this.#p=null,this.#o?.disconnect(),this.#o=null,this.#v&&(clearTimeout(this.#v),this.#v=null),this.#f&&(cancelAnimationFrame(this.#f),this.#f=null)}#B(){this.#f||(this.#f=requestAnimationFrame(()=>{this.#f=null;let t=this.#h;!this.#i||!t||(this.#E(t),_t||this.#M(t,this.#t[this.#e].placement))}))}#$(){this.#q("tour:complete",{steps:this.#t.length}),this.#U({complete:!0}),this.stop(),this.setAttribute("data-complete","")}#R(){this.#u?.abort(),this.#u=null,this.#d?.abort(),this.#d=null,this.#D(),this.#T();let t=document.activeElement,e=!t||t===document.body||!!this.#n?.contains(t);this.#s?.remove(),this.#r?.remove(),this.#n?.matches(":popover-open")&&this.#n.hidePopover(),this.#n?.remove(),this.#a?.remove(),this.#s=null,this.#r=null,this.#n=null,this.#a=null;let i=this.#c;this.#c=null,e&&i?.isConnected&&typeof i.focus=="function"&&i.focus()}#G(t){let e=this.#a;e&&(e.textContent="",requestAnimationFrame(()=>{this.#a===e&&(e.textContent=t)}))}#q(t,e){let i=t!=="tour:skip";this.dispatchEvent(new CustomEvent(t,{bubbles:!0,cancelable:i,detail:e}))}#K(){let t=this.dataset.persist??"session";return t==="session"?sessionStorage:t==="local"?localStorage:null}#H(){return`vb-tour-${this.dataset.persistKey??window.location.pathname}`}#U(t){let e=this.#K();if(!e)return;let i=this.#H(),s={};try{s=JSON.parse(e.getItem(i)??"null")??{}}catch{}e.setItem(i,JSON.stringify({...s,...t}))}#W(){let t=this.#K();if(!t)return null;try{return JSON.parse(t.getItem(this.#H())??"null")}catch{return null}}#Z(){let t=this.#K();t&&t.removeItem(this.#H())}};g("page-tour",ci);g("tour-step",li);function pi(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var st=pi();function Tr(r){st=r}var et={exec:()=>null};function x(r,t=""){let e=typeof r=="string"?r:r.source,i={replace:(s,n)=>{let o=typeof n=="string"?n:n.source;return o=o.replace(R.caret,"$1"),e=e.replace(s,o),i},getRegex:()=>new RegExp(e,t)};return i}var Fa=(()=>{try{return!!new RegExp("(?<=1)(?<!1)")}catch{return!1}})(),R={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] +\S/,listReplaceTask:/^\[[ xX]\] +/,listTaskCheckbox:/\[[ xX]\]/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:r=>new RegExp(`^( {0,3}${r})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:r=>new RegExp(`^ {0,${Math.min(3,r-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:r=>new RegExp(`^ {0,${Math.min(3,r-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:r=>new RegExp(`^ {0,${Math.min(3,r-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:r=>new RegExp(`^ {0,${Math.min(3,r-1)}}#`),htmlBeginRegex:r=>new RegExp(`^ {0,${Math.min(3,r-1)}}<(?:[a-z].*>|!--)`,"i"),blockquoteBeginRegex:r=>new RegExp(`^ {0,${Math.min(3,r-1)}}>`)},qa=/^(?:[ \t]*(?:\n|$))+/,Ha=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,Ua=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,Pt=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,Va=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,fi=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,Mr=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,Lr=x(Mr).replace(/bull/g,fi).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),Wa=x(Mr).replace(/bull/g,fi).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),mi=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,Ga=/^[^\n]+/,gi=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,Ka=x(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",gi).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),Ya=x(/^(bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,fi).getRegex(),ie="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",bi=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,Xa=x("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",bi).replace("tag",ie).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),_r=x(mi).replace("hr",Pt).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",ie).getRegex(),Ja=x(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",_r).getRegex(),yi={blockquote:Ja,code:Ha,def:Ka,fences:Ua,heading:Va,hr:Pt,html:Xa,lheading:Lr,list:Ya,newline:qa,paragraph:_r,table:et,text:Ga},Ar=x("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",Pt).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",ie).getRegex(),Za={...yi,lheading:Wa,table:Ar,paragraph:x(mi).replace("hr",Pt).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",Ar).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",ie).getRegex()},Qa={...yi,html:x(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",bi).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:et,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:x(mi).replace("hr",Pt).replace("heading",` *#{1,6} *[^
1255
+ ]`).replace("lheading",Lr).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},tl=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,el=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,Rr=/^( {2,}|\\)\n(?!\s*$)/,il=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,ft=/[\p{P}\p{S}]/u,se=/[\s\p{P}\p{S}]/u,vi=/[^\s\p{P}\p{S}]/u,sl=x(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,se).getRegex(),Nr=/(?!~)[\p{P}\p{S}]/u,rl=/(?!~)[\s\p{P}\p{S}]/u,nl=/(?:[^\s\p{P}\p{S}]|~)/u,ol=x(/link|precode-code|html/,"g").replace("link",/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",Fa?"(?<!`)()":"(^^|[^`])").replace("code",/(?<b>`+)[^`]+\k<b>(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),$r=/^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/,al=x($r,"u").replace(/punct/g,ft).getRegex(),ll=x($r,"u").replace(/punct/g,Nr).getRegex(),Pr="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",cl=x(Pr,"gu").replace(/notPunctSpace/g,vi).replace(/punctSpace/g,se).replace(/punct/g,ft).getRegex(),hl=x(Pr,"gu").replace(/notPunctSpace/g,nl).replace(/punctSpace/g,rl).replace(/punct/g,Nr).getRegex(),ul=x("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,vi).replace(/punctSpace/g,se).replace(/punct/g,ft).getRegex(),dl=x(/^~~?(?:((?!~)punct)|[^\s~])/,"u").replace(/punct/g,ft).getRegex(),pl="^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)",fl=x(pl,"gu").replace(/notPunctSpace/g,vi).replace(/punctSpace/g,se).replace(/punct/g,ft).getRegex(),ml=x(/\\(punct)/,"gu").replace(/punct/g,ft).getRegex(),gl=x(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),bl=x(bi).replace("(?:-->|$)","-->").getRegex(),yl=x("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",bl).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),Qt=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/,vl=x(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?\s*\)/).replace("label",Qt).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),Ir=x(/^!?\[(label)\]\[(ref)\]/).replace("label",Qt).replace("ref",gi).getRegex(),Or=x(/^!?\[(ref)\](?:\[\])?/).replace("ref",gi).getRegex(),wl=x("reflink|nolink(?!\\()","g").replace("reflink",Ir).replace("nolink",Or).getRegex(),kr=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,wi={_backpedal:et,anyPunctuation:ml,autolink:gl,blockSkip:ol,br:Rr,code:el,del:et,delLDelim:et,delRDelim:et,emStrongLDelim:al,emStrongRDelimAst:cl,emStrongRDelimUnd:ul,escape:tl,link:vl,nolink:Or,punctuation:sl,reflink:Ir,reflinkSearch:wl,tag:yl,text:il,url:et},Al={...wi,link:x(/^!?\[(label)\]\((.*?)\)/).replace("label",Qt).getRegex(),reflink:x(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",Qt).getRegex()},hi={...wi,emStrongRDelimAst:hl,emStrongLDelim:ll,delLDelim:dl,delRDelim:fl,url:x(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol",kr).replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,text:x(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol",kr).getRegex()},kl={...hi,br:x(Rr).replace("{2,}","*").getRegex(),text:x(hi.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},Zt={normal:yi,gfm:Za,pedantic:Qa},Rt={normal:wi,gfm:hi,breaks:kl,pedantic:Al},xl={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},xr=r=>xl[r];function F(r,t){if(t){if(R.escapeTest.test(r))return r.replace(R.escapeReplace,xr)}else if(R.escapeTestNoEncode.test(r))return r.replace(R.escapeReplaceNoEncode,xr);return r}function Er(r){try{r=encodeURI(r).replace(R.percentDecode,"%")}catch{return null}return r}function Sr(r,t){let e=r.replace(R.findPipe,(n,o,a)=>{let l=!1,c=o;for(;--c>=0&&a[c]==="\\";)l=!l;return l?"|":" |"}),i=e.split(R.splitPipe),s=0;if(i[0].trim()||i.shift(),i.length>0&&!i.at(-1)?.trim()&&i.pop(),t)if(i.length>t)i.splice(t);else for(;i.length<t;)i.push("");for(;s<i.length;s++)i[s]=i[s].trim().replace(R.slashPipe,"|");return i}function Nt(r,t,e){let i=r.length;if(i===0)return"";let s=0;for(;s<i;){let n=r.charAt(i-s-1);if(n===t&&!e)s++;else if(n!==t&&e)s++;else break}return r.slice(0,i-s)}function El(r,t){if(r.indexOf(t[1])===-1)return-1;let e=0;for(let i=0;i<r.length;i++)if(r[i]==="\\")i++;else if(r[i]===t[0])e++;else if(r[i]===t[1]&&(e--,e<0))return i;return e>0?-2:-1}function Sl(r,t=0){let e=t,i="";for(let s of r)if(s===" "){let n=4-e%4;i+=" ".repeat(n),e+=n}else i+=s,e++;return i}function Cr(r,t,e,i,s){let n=t.href,o=t.title||null,a=r[1].replace(s.other.outputLinkReplace,"$1");i.state.inLink=!0;let l={type:r[0].charAt(0)==="!"?"image":"link",raw:e,href:n,title:o,text:a,tokens:i.inlineTokens(a)};return i.state.inLink=!1,l}function Cl(r,t,e){let i=r.match(e.other.indentCodeCompensation);if(i===null)return t;let s=i[1];return t.split(`
1256
1256
  `).map(n=>{let o=n.match(e.other.beginningSpace);if(o===null)return n;let[a]=o;return a.length>=s.length?n.slice(s.length):n}).join(`
1257
- `)}var Wt=class{options;rules;lexer;constructor(r){this.options=r||tt}space(r){let t=this.rules.block.newline.exec(r);if(t&&t[0].length>0)return{type:"space",raw:t[0]}}code(r){let t=this.rules.block.code.exec(r);if(t){let e=t[0].replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:t[0],codeBlockStyle:"indented",text:this.options.pedantic?e:Ct(e,`
1258
- `)}}}fences(r){let t=this.rules.block.fences.exec(r);if(t){let e=t[0],i=Ua(e,t[3]||"",this.rules);return{type:"code",raw:e,lang:t[2]?t[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):t[2],text:i}}}heading(r){let t=this.rules.block.heading.exec(r);if(t){let e=t[2].trim();if(this.rules.other.endingHash.test(e)){let i=Ct(e,"#");(this.options.pedantic||!i||this.rules.other.endingSpaceChar.test(i))&&(e=i.trim())}return{type:"heading",raw:t[0],depth:t[1].length,text:e,tokens:this.lexer.inline(e)}}}hr(r){let t=this.rules.block.hr.exec(r);if(t)return{type:"hr",raw:Ct(t[0],`
1259
- `)}}blockquote(r){let t=this.rules.block.blockquote.exec(r);if(t){let e=Ct(t[0],`
1257
+ `)}var te=class{options;rules;lexer;constructor(r){this.options=r||st}space(r){let t=this.rules.block.newline.exec(r);if(t&&t[0].length>0)return{type:"space",raw:t[0]}}code(r){let t=this.rules.block.code.exec(r);if(t){let e=t[0].replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:t[0],codeBlockStyle:"indented",text:this.options.pedantic?e:Nt(e,`
1258
+ `)}}}fences(r){let t=this.rules.block.fences.exec(r);if(t){let e=t[0],i=Cl(e,t[3]||"",this.rules);return{type:"code",raw:e,lang:t[2]?t[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):t[2],text:i}}}heading(r){let t=this.rules.block.heading.exec(r);if(t){let e=t[2].trim();if(this.rules.other.endingHash.test(e)){let i=Nt(e,"#");(this.options.pedantic||!i||this.rules.other.endingSpaceChar.test(i))&&(e=i.trim())}return{type:"heading",raw:t[0],depth:t[1].length,text:e,tokens:this.lexer.inline(e)}}}hr(r){let t=this.rules.block.hr.exec(r);if(t)return{type:"hr",raw:Nt(t[0],`
1259
+ `)}}blockquote(r){let t=this.rules.block.blockquote.exec(r);if(t){let e=Nt(t[0],`
1260
1260
  `).split(`
1261
1261
  `),i="",s="",n=[];for(;e.length>0;){let o=!1,a=[],l;for(l=0;l<e.length;l++)if(this.rules.other.blockquoteStart.test(e[l]))a.push(e[l]),o=!0;else if(!o)a.push(e[l]);else break;e=e.slice(l);let c=a.join(`
1262
1262
  `),h=c.replace(this.rules.other.blockquoteSetextReplace,`
@@ -1267,17 +1267,17 @@ ${h}`:h;let u=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTo
1267
1267
  `),m=this.blockquote(f);n[n.length-1]=m,i=i.substring(0,i.length-d.raw.length)+m.raw,s=s.substring(0,s.length-d.text.length)+m.text;break}else if(p?.type==="list"){let d=p,f=d.raw+`
1268
1268
  `+e.join(`
1269
1269
  `),m=this.list(f);n[n.length-1]=m,i=i.substring(0,i.length-p.raw.length)+m.raw,s=s.substring(0,s.length-d.raw.length)+m.raw,e=f.substring(n.at(-1).raw.length).split(`
1270
- `);continue}}return{type:"blockquote",raw:i,tokens:n,text:s}}}list(r){let t=this.rules.block.list.exec(r);if(t){let e=t[1].trim(),i=e.length>1,s={type:"list",raw:"",ordered:i,start:i?+e.slice(0,-1):"",loose:!1,items:[]};e=i?`\\d{1,9}\\${e.slice(-1)}`:`\\${e}`,this.options.pedantic&&(e=i?e:"[*+-]");let n=this.rules.other.listItemRegex(e),o=!1;for(;r;){let l=!1,c="",h="";if(!(t=n.exec(r))||this.rules.block.hr.test(r))break;c=t[0],r=r.substring(c.length);let u=Ha(t[2].split(`
1270
+ `);continue}}return{type:"blockquote",raw:i,tokens:n,text:s}}}list(r){let t=this.rules.block.list.exec(r);if(t){let e=t[1].trim(),i=e.length>1,s={type:"list",raw:"",ordered:i,start:i?+e.slice(0,-1):"",loose:!1,items:[]};e=i?`\\d{1,9}\\${e.slice(-1)}`:`\\${e}`,this.options.pedantic&&(e=i?e:"[*+-]");let n=this.rules.other.listItemRegex(e),o=!1;for(;r;){let l=!1,c="",h="";if(!(t=n.exec(r))||this.rules.block.hr.test(r))break;c=t[0],r=r.substring(c.length);let u=Sl(t[2].split(`
1271
1271
  `,1)[0],t[1].length),p=r.split(`
1272
1272
  `,1)[0],d=!u.trim(),f=0;if(this.options.pedantic?(f=2,h=u.trimStart()):d?f=t[1].length+1:(f=u.search(this.rules.other.nonSpaceChar),f=f>4?1:f,h=u.slice(f),f+=t[1].length),d&&this.rules.other.blankLine.test(p)&&(c+=p+`
1273
- `,r=r.substring(p.length+1),l=!0),!l){let m=this.rules.other.nextBulletRegex(f),b=this.rules.other.hrRegex(f),w=this.rules.other.fencesBeginRegex(f),k=this.rules.other.headingBeginRegex(f),A=this.rules.other.htmlBeginRegex(f),T=this.rules.other.blockquoteBeginRegex(f);for(;r;){let O=r.split(`
1274
- `,1)[0],_;if(p=O,this.options.pedantic?(p=p.replace(this.rules.other.listReplaceNesting," "),_=p):_=p.replace(this.rules.other.tabCharGlobal," "),w.test(p)||k.test(p)||A.test(p)||T.test(p)||m.test(p)||b.test(p))break;if(_.search(this.rules.other.nonSpaceChar)>=f||!p.trim())h+=`
1275
- `+_.slice(f);else{if(d||u.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||w.test(u)||k.test(u)||b.test(u))break;h+=`
1276
- `+p}d=!p.trim(),c+=O+`
1277
- `,r=r.substring(O.length+1),u=_.slice(f)}}s.loose||(o?s.loose=!0:this.rules.other.doubleBlankLine.test(c)&&(o=!0)),s.items.push({type:"list_item",raw:c,task:!!this.options.gfm&&this.rules.other.listIsTask.test(h),loose:!1,text:h,tokens:[]}),s.raw+=c}let a=s.items.at(-1);if(a)a.raw=a.raw.trimEnd(),a.text=a.text.trimEnd();else return;s.raw=s.raw.trimEnd();for(let l of s.items){if(this.lexer.state.top=!1,l.tokens=this.lexer.blockTokens(l.text,[]),l.task){if(l.text=l.text.replace(this.rules.other.listReplaceTask,""),l.tokens[0]?.type==="text"||l.tokens[0]?.type==="paragraph"){l.tokens[0].raw=l.tokens[0].raw.replace(this.rules.other.listReplaceTask,""),l.tokens[0].text=l.tokens[0].text.replace(this.rules.other.listReplaceTask,"");for(let h=this.lexer.inlineQueue.length-1;h>=0;h--)if(this.rules.other.listIsTask.test(this.lexer.inlineQueue[h].src)){this.lexer.inlineQueue[h].src=this.lexer.inlineQueue[h].src.replace(this.rules.other.listReplaceTask,"");break}}let c=this.rules.other.listTaskCheckbox.exec(l.raw);if(c){let h={type:"checkbox",raw:c[0]+" ",checked:c[0]!=="[ ]"};l.checked=h.checked,s.loose?l.tokens[0]&&["paragraph","text"].includes(l.tokens[0].type)&&"tokens"in l.tokens[0]&&l.tokens[0].tokens?(l.tokens[0].raw=h.raw+l.tokens[0].raw,l.tokens[0].text=h.raw+l.tokens[0].text,l.tokens[0].tokens.unshift(h)):l.tokens.unshift({type:"paragraph",raw:h.raw,text:h.raw,tokens:[h]}):l.tokens.unshift(h)}}if(!s.loose){let c=l.tokens.filter(u=>u.type==="space"),h=c.length>0&&c.some(u=>this.rules.other.anyLine.test(u.raw));s.loose=h}}if(s.loose)for(let l of s.items){l.loose=!0;for(let c of l.tokens)c.type==="text"&&(c.type="paragraph")}return s}}html(r){let t=this.rules.block.html.exec(r);if(t)return{type:"html",block:!0,raw:t[0],pre:t[1]==="pre"||t[1]==="script"||t[1]==="style",text:t[0]}}def(r){let t=this.rules.block.def.exec(r);if(t){let e=t[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal," "),i=t[2]?t[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",s=t[3]?t[3].substring(1,t[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):t[3];return{type:"def",tag:e,raw:t[0],href:i,title:s}}}table(r){let t=this.rules.block.table.exec(r);if(!t||!this.rules.other.tableDelimiter.test(t[2]))return;let e=nr(t[1]),i=t[2].replace(this.rules.other.tableAlignChars,"").split("|"),s=t[3]?.trim()?t[3].replace(this.rules.other.tableRowBlankLine,"").split(`
1278
- `):[],n={type:"table",raw:t[0],header:[],align:[],rows:[]};if(e.length===i.length){for(let o of i)this.rules.other.tableAlignRight.test(o)?n.align.push("right"):this.rules.other.tableAlignCenter.test(o)?n.align.push("center"):this.rules.other.tableAlignLeft.test(o)?n.align.push("left"):n.align.push(null);for(let o=0;o<e.length;o++)n.header.push({text:e[o],tokens:this.lexer.inline(e[o]),header:!0,align:n.align[o]});for(let o of s)n.rows.push(nr(o,n.header.length).map((a,l)=>({text:a,tokens:this.lexer.inline(a),header:!1,align:n.align[l]})));return n}}lheading(r){let t=this.rules.block.lheading.exec(r);if(t){let e=t[1].trim();return{type:"heading",raw:t[0],depth:t[2].charAt(0)==="="?1:2,text:e,tokens:this.lexer.inline(e)}}}paragraph(r){let t=this.rules.block.paragraph.exec(r);if(t){let e=t[1].charAt(t[1].length-1)===`
1279
- `?t[1].slice(0,-1):t[1];return{type:"paragraph",raw:t[0],text:e,tokens:this.lexer.inline(e)}}}text(r){let t=this.rules.block.text.exec(r);if(t)return{type:"text",raw:t[0],text:t[0],tokens:this.lexer.inline(t[0])}}escape(r){let t=this.rules.inline.escape.exec(r);if(t)return{type:"escape",raw:t[0],text:t[1]}}tag(r){let t=this.rules.inline.tag.exec(r);if(t)return!this.lexer.state.inLink&&this.rules.other.startATag.test(t[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(t[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(t[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(t[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:t[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:t[0]}}link(r){let t=this.rules.inline.link.exec(r);if(t){let e=t[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(e)){if(!this.rules.other.endAngleBracket.test(e))return;let n=Ct(e.slice(0,-1),"\\");if((e.length-n.length)%2===0)return}else{let n=qa(t[2],"()");if(n===-2)return;if(n>-1){let o=(t[0].indexOf("!")===0?5:4)+t[1].length+n;t[2]=t[2].substring(0,n),t[0]=t[0].substring(0,o).trim(),t[3]=""}}let i=t[2],s="";if(this.options.pedantic){let n=this.rules.other.pedanticHrefTitle.exec(i);n&&(i=n[1],s=n[3])}else s=t[3]?t[3].slice(1,-1):"";return i=i.trim(),this.rules.other.startAngleBracket.test(i)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(e)?i=i.slice(1):i=i.slice(1,-1)),or(t,{href:i&&i.replace(this.rules.inline.anyPunctuation,"$1"),title:s&&s.replace(this.rules.inline.anyPunctuation,"$1")},t[0],this.lexer,this.rules)}}reflink(r,t){let e;if((e=this.rules.inline.reflink.exec(r))||(e=this.rules.inline.nolink.exec(r))){let i=(e[2]||e[1]).replace(this.rules.other.multipleSpaceGlobal," "),s=t[i.toLowerCase()];if(!s){let n=e[0].charAt(0);return{type:"text",raw:n,text:n}}return or(e,s,e[0],this.lexer,this.rules)}}emStrong(r,t,e=""){let i=this.rules.inline.emStrongLDelim.exec(r);if(!(!i||!i[1]&&!i[2]&&!i[3]&&!i[4]||i[4]&&e.match(this.rules.other.unicodeAlphaNumeric))&&(!(i[1]||i[3])||!e||this.rules.inline.punctuation.exec(e))){let s=[...i[0]].length-1,n,o,a=s,l=0,c=i[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(c.lastIndex=0,t=t.slice(-1*r.length+s);(i=c.exec(t))!==null;){if(n=i[1]||i[2]||i[3]||i[4]||i[5]||i[6],!n)continue;if(o=[...n].length,i[3]||i[4]){a+=o;continue}else if((i[5]||i[6])&&s%3&&!((s+o)%3)){l+=o;continue}if(a-=o,a>0)continue;o=Math.min(o,o+a+l);let h=[...i[0]][0].length,u=r.slice(0,s+i.index+h+o);if(Math.min(s,o)%2){let d=u.slice(1,-1);return{type:"em",raw:u,text:d,tokens:this.lexer.inlineTokens(d)}}let p=u.slice(2,-2);return{type:"strong",raw:u,text:p,tokens:this.lexer.inlineTokens(p)}}}}codespan(r){let t=this.rules.inline.code.exec(r);if(t){let e=t[2].replace(this.rules.other.newLineCharGlobal," "),i=this.rules.other.nonSpaceChar.test(e),s=this.rules.other.startingSpaceChar.test(e)&&this.rules.other.endingSpaceChar.test(e);return i&&s&&(e=e.substring(1,e.length-1)),{type:"codespan",raw:t[0],text:e}}}br(r){let t=this.rules.inline.br.exec(r);if(t)return{type:"br",raw:t[0]}}del(r,t,e=""){let i=this.rules.inline.delLDelim.exec(r);if(i&&(!i[1]||!e||this.rules.inline.punctuation.exec(e))){let s=[...i[0]].length-1,n,o,a=s,l=this.rules.inline.delRDelim;for(l.lastIndex=0,t=t.slice(-1*r.length+s);(i=l.exec(t))!==null;){if(n=i[1]||i[2]||i[3]||i[4]||i[5]||i[6],!n||(o=[...n].length,o!==s))continue;if(i[3]||i[4]){a+=o;continue}if(a-=o,a>0)continue;o=Math.min(o,o+a);let c=[...i[0]][0].length,h=r.slice(0,s+i.index+c+o),u=h.slice(s,-s);return{type:"del",raw:h,text:u,tokens:this.lexer.inlineTokens(u)}}}}autolink(r){let t=this.rules.inline.autolink.exec(r);if(t){let e,i;return t[2]==="@"?(e=t[1],i="mailto:"+e):(e=t[1],i=e),{type:"link",raw:t[0],text:e,href:i,tokens:[{type:"text",raw:e,text:e}]}}}url(r){let t;if(t=this.rules.inline.url.exec(r)){let e,i;if(t[2]==="@")e=t[0],i="mailto:"+e;else{let s;do s=t[0],t[0]=this.rules.inline._backpedal.exec(t[0])?.[0]??"";while(s!==t[0]);e=t[0],t[1]==="www."?i="http://"+t[0]:i=t[0]}return{type:"link",raw:t[0],text:e,href:i,tokens:[{type:"text",raw:e,text:e}]}}}inlineText(r){let t=this.rules.inline.text.exec(r);if(t){let e=this.lexer.state.inRawBlock;return{type:"text",raw:t[0],text:t[0],escaped:e}}}},I=class ei{tokens;options;state;inlineQueue;tokenizer;constructor(t){this.tokens=[],this.tokens.links=Object.create(null),this.options=t||tt,this.options.tokenizer=this.options.tokenizer||new Wt,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};let e={other:M,block:Ut.normal,inline:St.normal};this.options.pedantic?(e.block=Ut.pedantic,e.inline=St.pedantic):this.options.gfm&&(e.block=Ut.gfm,this.options.breaks?e.inline=St.breaks:e.inline=St.gfm),this.tokenizer.rules=e}static get rules(){return{block:Ut,inline:St}}static lex(t,e){return new ei(e).lex(t)}static lexInline(t,e){return new ei(e).inlineTokens(t)}lex(t){t=t.replace(M.carriageReturn,`
1280
- `),this.blockTokens(t,this.tokens);for(let e=0;e<this.inlineQueue.length;e++){let i=this.inlineQueue[e];this.inlineTokens(i.src,i.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(t,e=[],i=!1){for(this.tokenizer.lexer=this,this.options.pedantic&&(t=t.replace(M.tabCharGlobal," ").replace(M.spaceLine,""));t;){let s;if(this.options.extensions?.block?.some(o=>(s=o.call({lexer:this},t,e))?(t=t.substring(s.raw.length),e.push(s),!0):!1))continue;if(s=this.tokenizer.space(t)){t=t.substring(s.raw.length);let o=e.at(-1);s.raw.length===1&&o!==void 0?o.raw+=`
1273
+ `,r=r.substring(p.length+1),l=!0),!l){let m=this.rules.other.nextBulletRegex(f),y=this.rules.other.hrRegex(f),w=this.rules.other.fencesBeginRegex(f),A=this.rules.other.headingBeginRegex(f),k=this.rules.other.htmlBeginRegex(f),L=this.rules.other.blockquoteBeginRegex(f);for(;r;){let j=r.split(`
1274
+ `,1)[0],N;if(p=j,this.options.pedantic?(p=p.replace(this.rules.other.listReplaceNesting," "),N=p):N=p.replace(this.rules.other.tabCharGlobal," "),w.test(p)||A.test(p)||k.test(p)||L.test(p)||m.test(p)||y.test(p))break;if(N.search(this.rules.other.nonSpaceChar)>=f||!p.trim())h+=`
1275
+ `+N.slice(f);else{if(d||u.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||w.test(u)||A.test(u)||y.test(u))break;h+=`
1276
+ `+p}d=!p.trim(),c+=j+`
1277
+ `,r=r.substring(j.length+1),u=N.slice(f)}}s.loose||(o?s.loose=!0:this.rules.other.doubleBlankLine.test(c)&&(o=!0)),s.items.push({type:"list_item",raw:c,task:!!this.options.gfm&&this.rules.other.listIsTask.test(h),loose:!1,text:h,tokens:[]}),s.raw+=c}let a=s.items.at(-1);if(a)a.raw=a.raw.trimEnd(),a.text=a.text.trimEnd();else return;s.raw=s.raw.trimEnd();for(let l of s.items){if(this.lexer.state.top=!1,l.tokens=this.lexer.blockTokens(l.text,[]),l.task){if(l.text=l.text.replace(this.rules.other.listReplaceTask,""),l.tokens[0]?.type==="text"||l.tokens[0]?.type==="paragraph"){l.tokens[0].raw=l.tokens[0].raw.replace(this.rules.other.listReplaceTask,""),l.tokens[0].text=l.tokens[0].text.replace(this.rules.other.listReplaceTask,"");for(let h=this.lexer.inlineQueue.length-1;h>=0;h--)if(this.rules.other.listIsTask.test(this.lexer.inlineQueue[h].src)){this.lexer.inlineQueue[h].src=this.lexer.inlineQueue[h].src.replace(this.rules.other.listReplaceTask,"");break}}let c=this.rules.other.listTaskCheckbox.exec(l.raw);if(c){let h={type:"checkbox",raw:c[0]+" ",checked:c[0]!=="[ ]"};l.checked=h.checked,s.loose?l.tokens[0]&&["paragraph","text"].includes(l.tokens[0].type)&&"tokens"in l.tokens[0]&&l.tokens[0].tokens?(l.tokens[0].raw=h.raw+l.tokens[0].raw,l.tokens[0].text=h.raw+l.tokens[0].text,l.tokens[0].tokens.unshift(h)):l.tokens.unshift({type:"paragraph",raw:h.raw,text:h.raw,tokens:[h]}):l.tokens.unshift(h)}}if(!s.loose){let c=l.tokens.filter(u=>u.type==="space"),h=c.length>0&&c.some(u=>this.rules.other.anyLine.test(u.raw));s.loose=h}}if(s.loose)for(let l of s.items){l.loose=!0;for(let c of l.tokens)c.type==="text"&&(c.type="paragraph")}return s}}html(r){let t=this.rules.block.html.exec(r);if(t)return{type:"html",block:!0,raw:t[0],pre:t[1]==="pre"||t[1]==="script"||t[1]==="style",text:t[0]}}def(r){let t=this.rules.block.def.exec(r);if(t){let e=t[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal," "),i=t[2]?t[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",s=t[3]?t[3].substring(1,t[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):t[3];return{type:"def",tag:e,raw:t[0],href:i,title:s}}}table(r){let t=this.rules.block.table.exec(r);if(!t||!this.rules.other.tableDelimiter.test(t[2]))return;let e=Sr(t[1]),i=t[2].replace(this.rules.other.tableAlignChars,"").split("|"),s=t[3]?.trim()?t[3].replace(this.rules.other.tableRowBlankLine,"").split(`
1278
+ `):[],n={type:"table",raw:t[0],header:[],align:[],rows:[]};if(e.length===i.length){for(let o of i)this.rules.other.tableAlignRight.test(o)?n.align.push("right"):this.rules.other.tableAlignCenter.test(o)?n.align.push("center"):this.rules.other.tableAlignLeft.test(o)?n.align.push("left"):n.align.push(null);for(let o=0;o<e.length;o++)n.header.push({text:e[o],tokens:this.lexer.inline(e[o]),header:!0,align:n.align[o]});for(let o of s)n.rows.push(Sr(o,n.header.length).map((a,l)=>({text:a,tokens:this.lexer.inline(a),header:!1,align:n.align[l]})));return n}}lheading(r){let t=this.rules.block.lheading.exec(r);if(t){let e=t[1].trim();return{type:"heading",raw:t[0],depth:t[2].charAt(0)==="="?1:2,text:e,tokens:this.lexer.inline(e)}}}paragraph(r){let t=this.rules.block.paragraph.exec(r);if(t){let e=t[1].charAt(t[1].length-1)===`
1279
+ `?t[1].slice(0,-1):t[1];return{type:"paragraph",raw:t[0],text:e,tokens:this.lexer.inline(e)}}}text(r){let t=this.rules.block.text.exec(r);if(t)return{type:"text",raw:t[0],text:t[0],tokens:this.lexer.inline(t[0])}}escape(r){let t=this.rules.inline.escape.exec(r);if(t)return{type:"escape",raw:t[0],text:t[1]}}tag(r){let t=this.rules.inline.tag.exec(r);if(t)return!this.lexer.state.inLink&&this.rules.other.startATag.test(t[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(t[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(t[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(t[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:t[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:t[0]}}link(r){let t=this.rules.inline.link.exec(r);if(t){let e=t[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(e)){if(!this.rules.other.endAngleBracket.test(e))return;let n=Nt(e.slice(0,-1),"\\");if((e.length-n.length)%2===0)return}else{let n=El(t[2],"()");if(n===-2)return;if(n>-1){let o=(t[0].indexOf("!")===0?5:4)+t[1].length+n;t[2]=t[2].substring(0,n),t[0]=t[0].substring(0,o).trim(),t[3]=""}}let i=t[2],s="";if(this.options.pedantic){let n=this.rules.other.pedanticHrefTitle.exec(i);n&&(i=n[1],s=n[3])}else s=t[3]?t[3].slice(1,-1):"";return i=i.trim(),this.rules.other.startAngleBracket.test(i)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(e)?i=i.slice(1):i=i.slice(1,-1)),Cr(t,{href:i&&i.replace(this.rules.inline.anyPunctuation,"$1"),title:s&&s.replace(this.rules.inline.anyPunctuation,"$1")},t[0],this.lexer,this.rules)}}reflink(r,t){let e;if((e=this.rules.inline.reflink.exec(r))||(e=this.rules.inline.nolink.exec(r))){let i=(e[2]||e[1]).replace(this.rules.other.multipleSpaceGlobal," "),s=t[i.toLowerCase()];if(!s){let n=e[0].charAt(0);return{type:"text",raw:n,text:n}}return Cr(e,s,e[0],this.lexer,this.rules)}}emStrong(r,t,e=""){let i=this.rules.inline.emStrongLDelim.exec(r);if(!(!i||!i[1]&&!i[2]&&!i[3]&&!i[4]||i[4]&&e.match(this.rules.other.unicodeAlphaNumeric))&&(!(i[1]||i[3])||!e||this.rules.inline.punctuation.exec(e))){let s=[...i[0]].length-1,n,o,a=s,l=0,c=i[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(c.lastIndex=0,t=t.slice(-1*r.length+s);(i=c.exec(t))!==null;){if(n=i[1]||i[2]||i[3]||i[4]||i[5]||i[6],!n)continue;if(o=[...n].length,i[3]||i[4]){a+=o;continue}else if((i[5]||i[6])&&s%3&&!((s+o)%3)){l+=o;continue}if(a-=o,a>0)continue;o=Math.min(o,o+a+l);let h=[...i[0]][0].length,u=r.slice(0,s+i.index+h+o);if(Math.min(s,o)%2){let d=u.slice(1,-1);return{type:"em",raw:u,text:d,tokens:this.lexer.inlineTokens(d)}}let p=u.slice(2,-2);return{type:"strong",raw:u,text:p,tokens:this.lexer.inlineTokens(p)}}}}codespan(r){let t=this.rules.inline.code.exec(r);if(t){let e=t[2].replace(this.rules.other.newLineCharGlobal," "),i=this.rules.other.nonSpaceChar.test(e),s=this.rules.other.startingSpaceChar.test(e)&&this.rules.other.endingSpaceChar.test(e);return i&&s&&(e=e.substring(1,e.length-1)),{type:"codespan",raw:t[0],text:e}}}br(r){let t=this.rules.inline.br.exec(r);if(t)return{type:"br",raw:t[0]}}del(r,t,e=""){let i=this.rules.inline.delLDelim.exec(r);if(i&&(!i[1]||!e||this.rules.inline.punctuation.exec(e))){let s=[...i[0]].length-1,n,o,a=s,l=this.rules.inline.delRDelim;for(l.lastIndex=0,t=t.slice(-1*r.length+s);(i=l.exec(t))!==null;){if(n=i[1]||i[2]||i[3]||i[4]||i[5]||i[6],!n||(o=[...n].length,o!==s))continue;if(i[3]||i[4]){a+=o;continue}if(a-=o,a>0)continue;o=Math.min(o,o+a);let c=[...i[0]][0].length,h=r.slice(0,s+i.index+c+o),u=h.slice(s,-s);return{type:"del",raw:h,text:u,tokens:this.lexer.inlineTokens(u)}}}}autolink(r){let t=this.rules.inline.autolink.exec(r);if(t){let e,i;return t[2]==="@"?(e=t[1],i="mailto:"+e):(e=t[1],i=e),{type:"link",raw:t[0],text:e,href:i,tokens:[{type:"text",raw:e,text:e}]}}}url(r){let t;if(t=this.rules.inline.url.exec(r)){let e,i;if(t[2]==="@")e=t[0],i="mailto:"+e;else{let s;do s=t[0],t[0]=this.rules.inline._backpedal.exec(t[0])?.[0]??"";while(s!==t[0]);e=t[0],t[1]==="www."?i="http://"+t[0]:i=t[0]}return{type:"link",raw:t[0],text:e,href:i,tokens:[{type:"text",raw:e,text:e}]}}}inlineText(r){let t=this.rules.inline.text.exec(r);if(t){let e=this.lexer.state.inRawBlock;return{type:"text",raw:t[0],text:t[0],escaped:e}}}},z=class ui{tokens;options;state;inlineQueue;tokenizer;constructor(t){this.tokens=[],this.tokens.links=Object.create(null),this.options=t||st,this.options.tokenizer=this.options.tokenizer||new te,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};let e={other:R,block:Zt.normal,inline:Rt.normal};this.options.pedantic?(e.block=Zt.pedantic,e.inline=Rt.pedantic):this.options.gfm&&(e.block=Zt.gfm,this.options.breaks?e.inline=Rt.breaks:e.inline=Rt.gfm),this.tokenizer.rules=e}static get rules(){return{block:Zt,inline:Rt}}static lex(t,e){return new ui(e).lex(t)}static lexInline(t,e){return new ui(e).inlineTokens(t)}lex(t){t=t.replace(R.carriageReturn,`
1280
+ `),this.blockTokens(t,this.tokens);for(let e=0;e<this.inlineQueue.length;e++){let i=this.inlineQueue[e];this.inlineTokens(i.src,i.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(t,e=[],i=!1){for(this.tokenizer.lexer=this,this.options.pedantic&&(t=t.replace(R.tabCharGlobal," ").replace(R.spaceLine,""));t;){let s;if(this.options.extensions?.block?.some(o=>(s=o.call({lexer:this},t,e))?(t=t.substring(s.raw.length),e.push(s),!0):!1))continue;if(s=this.tokenizer.space(t)){t=t.substring(s.raw.length);let o=e.at(-1);s.raw.length===1&&o!==void 0?o.raw+=`
1281
1281
  `:e.push(s);continue}if(s=this.tokenizer.code(t)){t=t.substring(s.raw.length);let o=e.at(-1);o?.type==="paragraph"||o?.type==="text"?(o.raw+=(o.raw.endsWith(`
1282
1282
  `)?"":`
1283
1283
  `)+s.raw,o.text+=`
@@ -1290,9 +1290,9 @@ ${h}`:h;let u=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTo
1290
1290
  `+s.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=o.text):e.push(s),i=n.length!==t.length,t=t.substring(s.raw.length);continue}if(s=this.tokenizer.text(t)){t=t.substring(s.raw.length);let o=e.at(-1);o?.type==="text"?(o.raw+=(o.raw.endsWith(`
1291
1291
  `)?"":`
1292
1292
  `)+s.raw,o.text+=`
1293
- `+s.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=o.text):e.push(s);continue}if(t){let o="Infinite loop on byte: "+t.charCodeAt(0);if(this.options.silent){console.error(o);break}else throw new Error(o)}}return this.state.top=!0,e}inline(t,e=[]){return this.inlineQueue.push({src:t,tokens:e}),e}inlineTokens(t,e=[]){this.tokenizer.lexer=this;let i=t,s=null;if(this.tokens.links){let l=Object.keys(this.tokens.links);if(l.length>0)for(;(s=this.tokenizer.rules.inline.reflinkSearch.exec(i))!==null;)l.includes(s[0].slice(s[0].lastIndexOf("[")+1,-1))&&(i=i.slice(0,s.index)+"["+"a".repeat(s[0].length-2)+"]"+i.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(s=this.tokenizer.rules.inline.anyPunctuation.exec(i))!==null;)i=i.slice(0,s.index)+"++"+i.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);let n;for(;(s=this.tokenizer.rules.inline.blockSkip.exec(i))!==null;)n=s[2]?s[2].length:0,i=i.slice(0,s.index+n)+"["+"a".repeat(s[0].length-n-2)+"]"+i.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);i=this.options.hooks?.emStrongMask?.call({lexer:this},i)??i;let o=!1,a="";for(;t;){o||(a=""),o=!1;let l;if(this.options.extensions?.inline?.some(h=>(l=h.call({lexer:this},t,e))?(t=t.substring(l.raw.length),e.push(l),!0):!1))continue;if(l=this.tokenizer.escape(t)){t=t.substring(l.raw.length),e.push(l);continue}if(l=this.tokenizer.tag(t)){t=t.substring(l.raw.length),e.push(l);continue}if(l=this.tokenizer.link(t)){t=t.substring(l.raw.length),e.push(l);continue}if(l=this.tokenizer.reflink(t,this.tokens.links)){t=t.substring(l.raw.length);let h=e.at(-1);l.type==="text"&&h?.type==="text"?(h.raw+=l.raw,h.text+=l.text):e.push(l);continue}if(l=this.tokenizer.emStrong(t,i,a)){t=t.substring(l.raw.length),e.push(l);continue}if(l=this.tokenizer.codespan(t)){t=t.substring(l.raw.length),e.push(l);continue}if(l=this.tokenizer.br(t)){t=t.substring(l.raw.length),e.push(l);continue}if(l=this.tokenizer.del(t,i,a)){t=t.substring(l.raw.length),e.push(l);continue}if(l=this.tokenizer.autolink(t)){t=t.substring(l.raw.length),e.push(l);continue}if(!this.state.inLink&&(l=this.tokenizer.url(t))){t=t.substring(l.raw.length),e.push(l);continue}let c=t;if(this.options.extensions?.startInline){let h=1/0,u=t.slice(1),p;this.options.extensions.startInline.forEach(d=>{p=d.call({lexer:this},u),typeof p=="number"&&p>=0&&(h=Math.min(h,p))}),h<1/0&&h>=0&&(c=t.substring(0,h+1))}if(l=this.tokenizer.inlineText(c)){t=t.substring(l.raw.length),l.raw.slice(-1)!=="_"&&(a=l.raw.slice(-1)),o=!0;let h=e.at(-1);h?.type==="text"?(h.raw+=l.raw,h.text+=l.text):e.push(l);continue}if(t){let h="Infinite loop on byte: "+t.charCodeAt(0);if(this.options.silent){console.error(h);break}else throw new Error(h)}}return e}},Gt=class{options;parser;constructor(r){this.options=r||tt}space(r){return""}code({text:r,lang:t,escaped:e}){let i=(t||"").match(M.notSpaceStart)?.[0],s=r.replace(M.endingNewline,"")+`
1294
- `;return i?'<pre><code class="language-'+j(i)+'">'+(e?s:j(s,!0))+`</code></pre>
1295
- `:"<pre><code>"+(e?s:j(s,!0))+`</code></pre>
1293
+ `+s.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=o.text):e.push(s);continue}if(t){let o="Infinite loop on byte: "+t.charCodeAt(0);if(this.options.silent){console.error(o);break}else throw new Error(o)}}return this.state.top=!0,e}inline(t,e=[]){return this.inlineQueue.push({src:t,tokens:e}),e}inlineTokens(t,e=[]){this.tokenizer.lexer=this;let i=t,s=null;if(this.tokens.links){let l=Object.keys(this.tokens.links);if(l.length>0)for(;(s=this.tokenizer.rules.inline.reflinkSearch.exec(i))!==null;)l.includes(s[0].slice(s[0].lastIndexOf("[")+1,-1))&&(i=i.slice(0,s.index)+"["+"a".repeat(s[0].length-2)+"]"+i.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(s=this.tokenizer.rules.inline.anyPunctuation.exec(i))!==null;)i=i.slice(0,s.index)+"++"+i.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);let n;for(;(s=this.tokenizer.rules.inline.blockSkip.exec(i))!==null;)n=s[2]?s[2].length:0,i=i.slice(0,s.index+n)+"["+"a".repeat(s[0].length-n-2)+"]"+i.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);i=this.options.hooks?.emStrongMask?.call({lexer:this},i)??i;let o=!1,a="";for(;t;){o||(a=""),o=!1;let l;if(this.options.extensions?.inline?.some(h=>(l=h.call({lexer:this},t,e))?(t=t.substring(l.raw.length),e.push(l),!0):!1))continue;if(l=this.tokenizer.escape(t)){t=t.substring(l.raw.length),e.push(l);continue}if(l=this.tokenizer.tag(t)){t=t.substring(l.raw.length),e.push(l);continue}if(l=this.tokenizer.link(t)){t=t.substring(l.raw.length),e.push(l);continue}if(l=this.tokenizer.reflink(t,this.tokens.links)){t=t.substring(l.raw.length);let h=e.at(-1);l.type==="text"&&h?.type==="text"?(h.raw+=l.raw,h.text+=l.text):e.push(l);continue}if(l=this.tokenizer.emStrong(t,i,a)){t=t.substring(l.raw.length),e.push(l);continue}if(l=this.tokenizer.codespan(t)){t=t.substring(l.raw.length),e.push(l);continue}if(l=this.tokenizer.br(t)){t=t.substring(l.raw.length),e.push(l);continue}if(l=this.tokenizer.del(t,i,a)){t=t.substring(l.raw.length),e.push(l);continue}if(l=this.tokenizer.autolink(t)){t=t.substring(l.raw.length),e.push(l);continue}if(!this.state.inLink&&(l=this.tokenizer.url(t))){t=t.substring(l.raw.length),e.push(l);continue}let c=t;if(this.options.extensions?.startInline){let h=1/0,u=t.slice(1),p;this.options.extensions.startInline.forEach(d=>{p=d.call({lexer:this},u),typeof p=="number"&&p>=0&&(h=Math.min(h,p))}),h<1/0&&h>=0&&(c=t.substring(0,h+1))}if(l=this.tokenizer.inlineText(c)){t=t.substring(l.raw.length),l.raw.slice(-1)!=="_"&&(a=l.raw.slice(-1)),o=!0;let h=e.at(-1);h?.type==="text"?(h.raw+=l.raw,h.text+=l.text):e.push(l);continue}if(t){let h="Infinite loop on byte: "+t.charCodeAt(0);if(this.options.silent){console.error(h);break}else throw new Error(h)}}return e}},ee=class{options;parser;constructor(r){this.options=r||st}space(r){return""}code({text:r,lang:t,escaped:e}){let i=(t||"").match(R.notSpaceStart)?.[0],s=r.replace(R.endingNewline,"")+`
1294
+ `;return i?'<pre><code class="language-'+F(i)+'">'+(e?s:F(s,!0))+`</code></pre>
1295
+ `:"<pre><code>"+(e?s:F(s,!0))+`</code></pre>
1296
1296
  `}blockquote({tokens:r}){return`<blockquote>
1297
1297
  ${this.parser.parse(r)}</blockquote>
1298
1298
  `}html({text:r}){return r}def(r){return""}heading({tokens:r,depth:t}){return`<h${t}>${this.parser.parseInline(r)}</h${t}>
@@ -1308,14 +1308,17 @@ ${this.parser.parse(r)}</blockquote>
1308
1308
  `}tablerow({text:r}){return`<tr>
1309
1309
  ${r}</tr>
1310
1310
  `}tablecell(r){let t=this.parser.parseInline(r.tokens),e=r.header?"th":"td";return(r.align?`<${e} align="${r.align}">`:`<${e}>`)+t+`</${e}>
1311
- `}strong({tokens:r}){return`<strong>${this.parser.parseInline(r)}</strong>`}em({tokens:r}){return`<em>${this.parser.parseInline(r)}</em>`}codespan({text:r}){return`<code>${j(r,!0)}</code>`}br(r){return"<br>"}del({tokens:r}){return`<del>${this.parser.parseInline(r)}</del>`}link({href:r,title:t,tokens:e}){let i=this.parser.parseInline(e),s=rr(r);if(s===null)return i;r=s;let n='<a href="'+r+'"';return t&&(n+=' title="'+j(t)+'"'),n+=">"+i+"</a>",n}image({href:r,title:t,text:e,tokens:i}){i&&(e=this.parser.parseInline(i,this.parser.textRenderer));let s=rr(r);if(s===null)return j(e);r=s;let n=`<img src="${r}" alt="${j(e)}"`;return t&&(n+=` title="${j(t)}"`),n+=">",n}text(r){return"tokens"in r&&r.tokens?this.parser.parseInline(r.tokens):"escaped"in r&&r.escaped?r.text:j(r.text)}},ui=class{strong({text:r}){return r}em({text:r}){return r}codespan({text:r}){return r}del({text:r}){return r}html({text:r}){return r}text({text:r}){return r}link({text:r}){return""+r}image({text:r}){return""+r}br(){return""}checkbox({raw:r}){return r}},z=class ii{options;renderer;textRenderer;constructor(t){this.options=t||tt,this.options.renderer=this.options.renderer||new Gt,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new ui}static parse(t,e){return new ii(e).parse(t)}static parseInline(t,e){return new ii(e).parseInline(t)}parse(t){this.renderer.parser=this;let e="";for(let i=0;i<t.length;i++){let s=t[i];if(this.options.extensions?.renderers?.[s.type]){let o=s,a=this.options.extensions.renderers[o.type].call({parser:this},o);if(a!==!1||!["space","hr","heading","code","table","blockquote","list","html","def","paragraph","text"].includes(o.type)){e+=a||"";continue}}let n=s;switch(n.type){case"space":{e+=this.renderer.space(n);break}case"hr":{e+=this.renderer.hr(n);break}case"heading":{e+=this.renderer.heading(n);break}case"code":{e+=this.renderer.code(n);break}case"table":{e+=this.renderer.table(n);break}case"blockquote":{e+=this.renderer.blockquote(n);break}case"list":{e+=this.renderer.list(n);break}case"checkbox":{e+=this.renderer.checkbox(n);break}case"html":{e+=this.renderer.html(n);break}case"def":{e+=this.renderer.def(n);break}case"paragraph":{e+=this.renderer.paragraph(n);break}case"text":{e+=this.renderer.text(n);break}default:{let o='Token with "'+n.type+'" type was not found.';if(this.options.silent)return console.error(o),"";throw new Error(o)}}}return e}parseInline(t,e=this.renderer){this.renderer.parser=this;let i="";for(let s=0;s<t.length;s++){let n=t[s];if(this.options.extensions?.renderers?.[n.type]){let a=this.options.extensions.renderers[n.type].call({parser:this},n);if(a!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(n.type)){i+=a||"";continue}}let o=n;switch(o.type){case"escape":{i+=e.text(o);break}case"html":{i+=e.html(o);break}case"link":{i+=e.link(o);break}case"image":{i+=e.image(o);break}case"checkbox":{i+=e.checkbox(o);break}case"strong":{i+=e.strong(o);break}case"em":{i+=e.em(o);break}case"codespan":{i+=e.codespan(o);break}case"br":{i+=e.br(o);break}case"del":{i+=e.del(o);break}case"text":{i+=e.text(o);break}default:{let a='Token with "'+o.type+'" type was not found.';if(this.options.silent)return console.error(a),"";throw new Error(a)}}}return i}},Tt=class{options;block;constructor(r){this.options=r||tt}static passThroughHooks=new Set(["preprocess","postprocess","processAllTokens","emStrongMask"]);static passThroughHooksRespectAsync=new Set(["preprocess","postprocess","processAllTokens"]);preprocess(r){return r}postprocess(r){return r}processAllTokens(r){return r}emStrongMask(r){return r}provideLexer(r=this.block){return r?I.lex:I.lexInline}provideParser(r=this.block){return r?z.parse:z.parseInline}},di=class{defaults=si();options=this.setOptions;parse=this.parseMarkdown(!0);parseInline=this.parseMarkdown(!1);Parser=z;Renderer=Gt;TextRenderer=ui;Lexer=I;Tokenizer=Wt;Hooks=Tt;constructor(...r){this.use(...r)}walkTokens(r,t){let e=[];for(let i of r)switch(e=e.concat(t.call(this,i)),i.type){case"table":{let s=i;for(let n of s.header)e=e.concat(this.walkTokens(n.tokens,t));for(let n of s.rows)for(let o of n)e=e.concat(this.walkTokens(o.tokens,t));break}case"list":{let s=i;e=e.concat(this.walkTokens(s.items,t));break}default:{let s=i;this.defaults.extensions?.childTokens?.[s.type]?this.defaults.extensions.childTokens[s.type].forEach(n=>{let o=s[n].flat(1/0);e=e.concat(this.walkTokens(o,t))}):s.tokens&&(e=e.concat(this.walkTokens(s.tokens,t)))}}return e}use(...r){let t=this.defaults.extensions||{renderers:{},childTokens:{}};return r.forEach(e=>{let i={...e};if(i.async=this.defaults.async||i.async||!1,e.extensions&&(e.extensions.forEach(s=>{if(!s.name)throw new Error("extension name required");if("renderer"in s){let n=t.renderers[s.name];n?t.renderers[s.name]=function(...o){let a=s.renderer.apply(this,o);return a===!1&&(a=n.apply(this,o)),a}:t.renderers[s.name]=s.renderer}if("tokenizer"in s){if(!s.level||s.level!=="block"&&s.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");let n=t[s.level];n?n.unshift(s.tokenizer):t[s.level]=[s.tokenizer],s.start&&(s.level==="block"?t.startBlock?t.startBlock.push(s.start):t.startBlock=[s.start]:s.level==="inline"&&(t.startInline?t.startInline.push(s.start):t.startInline=[s.start]))}"childTokens"in s&&s.childTokens&&(t.childTokens[s.name]=s.childTokens)}),i.extensions=t),e.renderer){let s=this.defaults.renderer||new Gt(this.defaults);for(let n in e.renderer){if(!(n in s))throw new Error(`renderer '${n}' does not exist`);if(["options","parser"].includes(n))continue;let o=n,a=e.renderer[o],l=s[o];s[o]=(...c)=>{let h=a.apply(s,c);return h===!1&&(h=l.apply(s,c)),h||""}}i.renderer=s}if(e.tokenizer){let s=this.defaults.tokenizer||new Wt(this.defaults);for(let n in e.tokenizer){if(!(n in s))throw new Error(`tokenizer '${n}' does not exist`);if(["options","rules","lexer"].includes(n))continue;let o=n,a=e.tokenizer[o],l=s[o];s[o]=(...c)=>{let h=a.apply(s,c);return h===!1&&(h=l.apply(s,c)),h}}i.tokenizer=s}if(e.hooks){let s=this.defaults.hooks||new Tt;for(let n in e.hooks){if(!(n in s))throw new Error(`hook '${n}' does not exist`);if(["options","block"].includes(n))continue;let o=n,a=e.hooks[o],l=s[o];Tt.passThroughHooks.has(n)?s[o]=c=>{if(this.defaults.async&&Tt.passThroughHooksRespectAsync.has(n))return(async()=>{let u=await a.call(s,c);return l.call(s,u)})();let h=a.call(s,c);return l.call(s,h)}:s[o]=(...c)=>{if(this.defaults.async)return(async()=>{let u=await a.apply(s,c);return u===!1&&(u=await l.apply(s,c)),u})();let h=a.apply(s,c);return h===!1&&(h=l.apply(s,c)),h}}i.hooks=s}if(e.walkTokens){let s=this.defaults.walkTokens,n=e.walkTokens;i.walkTokens=function(o){let a=[];return a.push(n.call(this,o)),s&&(a=a.concat(s.call(this,o))),a}}this.defaults={...this.defaults,...i}}),this}setOptions(r){return this.defaults={...this.defaults,...r},this}lexer(r,t){return I.lex(r,t??this.defaults)}parser(r,t){return z.parse(r,t??this.defaults)}parseMarkdown(r){return(t,e)=>{let i={...e},s={...this.defaults,...i},n=this.onError(!!s.silent,!!s.async);if(this.defaults.async===!0&&i.async===!1)return n(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(typeof t>"u"||t===null)return n(new Error("marked(): input parameter is undefined or null"));if(typeof t!="string")return n(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(t)+", string expected"));if(s.hooks&&(s.hooks.options=s,s.hooks.block=r),s.async)return(async()=>{let o=s.hooks?await s.hooks.preprocess(t):t,a=await(s.hooks?await s.hooks.provideLexer(r):r?I.lex:I.lexInline)(o,s),l=s.hooks?await s.hooks.processAllTokens(a):a;s.walkTokens&&await Promise.all(this.walkTokens(l,s.walkTokens));let c=await(s.hooks?await s.hooks.provideParser(r):r?z.parse:z.parseInline)(l,s);return s.hooks?await s.hooks.postprocess(c):c})().catch(n);try{s.hooks&&(t=s.hooks.preprocess(t));let o=(s.hooks?s.hooks.provideLexer(r):r?I.lex:I.lexInline)(t,s);s.hooks&&(o=s.hooks.processAllTokens(o)),s.walkTokens&&this.walkTokens(o,s.walkTokens);let a=(s.hooks?s.hooks.provideParser(r):r?z.parse:z.parseInline)(o,s);return s.hooks&&(a=s.hooks.postprocess(a)),a}catch(o){return n(o)}}}onError(r,t){return e=>{if(e.message+=`
1312
- Please report this to https://github.com/markedjs/marked.`,r){let i="<p>An error occurred:</p><pre>"+j(e.message+"",!0)+"</pre>";return t?Promise.resolve(i):i}if(t)return Promise.reject(e);throw e}}},Q=new di;function E(r,t){return Q.parse(r,t)}E.options=E.setOptions=function(r){return Q.setOptions(r),E.defaults=Q.defaults,ar(E.defaults),E};E.getDefaults=si;E.defaults=tt;E.use=function(...r){return Q.use(...r),E.defaults=Q.defaults,ar(E.defaults),E};E.walkTokens=function(r,t){return Q.walkTokens(r,t)};E.parseInline=Q.parseInline;E.Parser=z;E.parser=z.parse;E.Renderer=Gt;E.TextRenderer=ui;E.Lexer=I;E.lexer=I.lex;E.Tokenizer=Wt;E.Hooks=Tt;E.parse=E;var Cu=E.options,Tu=E.setOptions,Lu=E.use,Mu=E.walkTokens,_u=E.parseInline;var Ru=z.parse,Nu=I.lex;var Va="Failed to load markdown",Wa=/^:::[ \t]*(note|info|tip|warning|danger)(?:[ \t]+([^\n]*?))?[ \t]*\n([\s\S]*?)\n?^:::[ \t]*(?:\n+|$)/m,Ga=r=>r.replace(/[&<>"']/g,t=>`&#${t.charCodeAt(0)};`),Ka={name:"vbCallout",level:"block",start(r){return r.match(/^:::[ \t]*(?:note|info|tip|warning|danger)\b/m)?.index},tokenizer(r){let t=Wa.exec(r);if(!t||t.index!==0)return;let e=t[1],i=(t[2]||"").trim()||e[0].toUpperCase()+e.slice(1),s={type:"vbCallout",raw:t[0],kind:e,title:i,tokens:[]};return this.lexer.blockTokens(t[3],s.tokens),s},renderer(r){return`<aside data-callout="${r.kind}" role="note"><p data-callout-title><strong>${Ga(r.title)}</strong></p>${this.parser.parse(r.tokens)}</aside>
1313
- `}},Xa=new di({gfm:!0,extensions:[Ka]}),pi=class extends v{#t=null;#e=null;#i=null;#s=null;#r=null;#n=null;#a=0;static get observedAttributes(){return["src","sanitize","allow-cross-origin"]}setup(){this.#o()}teardown(){this.#e?.abort(),this.removeAttribute("data-rendered"),this.removeAttribute("data-loading")}attributeChangedCallback(t,e,i){e===i||!this.isConnected||!this.hasAttribute("data-upgraded")||this.#o()}get parser(){return this.#t}set parser(t){this.#t=typeof t=="function"?t:null}get markdown(){return this.#r??this.#n??""}set markdown(t){let e=t==null?null:String(t);this.#r!==e&&(this.#r=e,this.#o())}async render(){await this.#o()}async reload(){this.getAttribute("src")&&await this.#o()}#c(){let t=this.querySelector('script[type="text/markdown"]');if(t)return t.textContent;let e=this.querySelector("template[data-md]");if(e)return e.content.textContent;let i=this.querySelector(":scope > pre");return i?i.textContent:null}#h(t){let e;try{e=new URL(t,document.baseURI)}catch{throw new Error(`Invalid URL: ${t}`)}if(e.protocol!=="http:"&&e.protocol!=="https:")throw new Error(`Refused ${e.protocol} URL: only http(s) is allowed`);return this.#l(e.href),e.href}#l(t){if(!this.hasAttribute("allow-cross-origin")&&new URL(t).origin!==location.origin)throw new Error(`Refused cross-origin URL ${t} (add allow-cross-origin to permit)`)}async#o(){let t=++this.#a,e=this.getAttribute("src"),i;if(this.#e?.abort(),this.#e=null,this.removeAttribute("data-rendered"),this.removeAttribute("data-error"),this.removeAttribute("data-loading"),this.#s?.remove(),this.#s=null,e){let o=new AbortController;this.#e=o,this.setAttribute("data-loading",""),this.#k("markdown-viewer:fetch",{src:e});try{let a=this.#h(e),l=await fetch(a,{signal:o.signal});if(l.url&&this.#l(l.url),!l.ok)throw new Error(`HTTP ${l.status}: ${l.statusText}`);i=await l.text()}catch(a){if(a.name==="AbortError"||t!==this.#a)return;this.#u(a);return}if(t!==this.#a)return;this.removeAttribute("data-loading")}else this.#r!=null?i=this.#r:i=this.#c();if(i==null){this.#i?.replaceChildren();return}this.#n=i;let s;try{s=await(await this.#p())(i)}catch(o){if(t!==this.#a)return;this.#u(o);return}if(t!==this.#a)return;(!this.#i||this.#i.parentNode!==this)&&(this.#i=document.createElement("div"),this.#i.className="md-content",this.#i.setAttribute("part","content"),this.appendChild(this.#i)),this.hasAttribute("dir")?this.#i.removeAttribute("dir"):this.#i.setAttribute("dir","auto"),this.#d()?this.#i.replaceChildren(qt(String(s??""))):this.#i.innerHTML=String(s??""),this.#f(),this.setAttribute("data-rendered","");let n=this.getAttribute("ping");if(n&&navigator.sendBeacon?.(n,JSON.stringify({src:e||"inline"})),this.#k("markdown-viewer:rendered",{src:e,node:this.#i}),this.hasAttribute("highlight"))for(let o of this.#i.querySelectorAll('pre > code[class*="language-"]')){let a=o.className.match(/language-(\S+)/)?.[1]||"";this.#k("markdown-viewer:highlight",{node:o,language:a})}}#u(t){if(this.removeAttribute("data-loading"),this.setAttribute("data-error",""),this.#i?.replaceChildren(),!this.querySelector(":scope > pre")){let e=document.createElement("p");e.setAttribute("role","alert"),e.setAttribute("data-md-error",""),e.textContent=this.getAttribute("data-label-error")||Va,this.append(e),this.#s=e}this.#k("markdown-viewer:error",{error:t.message})}async#p(){return this.#t?this.#t:t=>Xa.parse(t)}#d(){let t=this.getAttribute("sanitize");return t==null?!0:!/^(off|false)$/i.test(t.trim())}#f(){if(!this.#i)return;let t=this.dataset.theme??this.closest("[data-theme]")?.dataset.theme;t&&(this.#i.dataset.theme=t)}#k(t,e){this.dispatchEvent(new CustomEvent(t,{detail:e,bubbles:!0,composed:!0}))}};g("markdown-viewer",pi);var br={source:"Markdown source",preview:"Rendered preview",tabHint:"Tab inserts spaces. Press Escape, then Tab, to move focus."},Ya=0,fi=class extends v{#t=null;#e=null;#i=null;#s=null;#r=null;#n="";#a=null;#c=null;#h=!1;#l={placeholder:null,rows:null};static get observedAttributes(){return["placeholder","rows","highlight","data-label-source","data-label-preview"]}setup(){this.#o()||this.#u(),this.#v(),this.#y()}teardown(){this.#c!==null&&clearTimeout(this.#c),this.#c=null,this.#h=!1,this.removeAttribute("data-editing")}attributeChangedCallback(t,e,i){!this.#t||e===i||(t==="placeholder"?this.#k(this.#t,"placeholder",i??this.#l.placeholder):t==="rows"?this.#p():t==="highlight"?this.#e?.toggleAttribute("highlight",i!=null):this.#d())}get value(){return this.#t?.value??this.#a??""}set value(t){let e=t==null?"":String(t);if(!this.#t){this.#a=e;return}this.#t.value!==e&&(this.#t.value=e,this.#n=e,this.#y(),this.#w("markdown-editor:change",{value:e,source:"api"}))}get textarea(){return this.#t}#o(){return!!(this.#t&&this.#i?.parentNode===this&&this.#s?.parentNode===this&&this.#i.contains(this.#t))}#u(){let t=this.#t&&this.contains(this.#t)?this.#t:this.querySelector("textarea"),e=[...this.childNodes];t||(t=document.createElement("textarea"),e.push(t)),this.#t=t,this.#l={placeholder:t.getAttribute("placeholder"),rows:t.getAttribute("rows")},this.hasAttribute("placeholder")&&(t.placeholder=this.getAttribute("placeholder")??""),this.#p(),t.hasAttribute("dir")||(t.dir="auto"),t.hasAttribute("spellcheck")||(t.spellcheck=!0),this.#i=document.createElement("section"),this.#i.className="md-editor-pane",this.#i.setAttribute("role","group"),this.#i.append(...e),this.#s=document.createElement("section"),this.#s.className="md-preview-pane",this.#s.setAttribute("role","group"),this.#e=document.createElement("markdown-viewer");let i=t.getAttribute("dir");i&&i!=="auto"&&(this.#s.dir=i),this.#e.dir=i||"auto",this.hasAttribute("highlight")&&this.#e.setAttribute("highlight","");let s=this.dataset.theme??this.closest("[data-theme]")?.dataset.theme;if(s&&(this.#e.dataset.theme=s),this.#s.append(this.#e),this.hasAttribute("data-tab-indent")){this.#r=document.createElement("span"),this.#r.className="visually-hidden",this.#r.id=`md-editor-tab-hint-${++Ya}`,this.#r.textContent=this.dataset.labelTabHint||br.tabHint,this.#i.append(this.#r);let n=t.getAttribute("aria-describedby");t.setAttribute("aria-describedby",n?`${n} ${this.#r.id}`:this.#r.id)}this.replaceChildren(this.#i,this.#s),this.#d(),!t.hasAttribute("aria-label")&&!t.hasAttribute("aria-labelledby")&&!t.labels?.length&&!t.title&&t.setAttribute("aria-label",this.#f("source")),this.#a!=null&&(t.value=this.#a,this.#a=null),this.#n=t.value}#p(){if(!this.#t)return;let t=this.getAttribute("rows")??this.#l.rows;this.#t.rows=parseInt(t??"",10)||10}#d(){this.#i?.setAttribute("aria-label",this.#f("source")),this.#s?.setAttribute("aria-label",this.#f("preview"))}#f(t){return(t==="source"?this.dataset.labelSource:this.dataset.labelPreview)||br[t]}#k(t,e,i){i==null?t.removeAttribute(e):t.setAttribute(e,i)}#v(){let t=this.#t;t&&(this.listen(t,"input",()=>{this.#w("markdown-editor:input",{value:t.value}),this.#g()}),this.listen(t,"focus",()=>{this.setAttribute("data-editing","")}),this.listen(t,"blur",()=>{this.removeAttribute("data-editing"),this.#h=!1,t.value!==this.#n&&(this.#n=t.value,this.#w("markdown-editor:change",{value:t.value,source:"user"}))}),this.listen(this.getRootNode(),"reset",e=>{!t.form||e.target!==t.form||queueMicrotask(()=>{this.#n=t.value,this.#y()})},{capture:!0}),this.hasAttribute("data-tab-indent")&&this.listen(t,"keydown",e=>{let i=e;if(i.key==="Escape"){this.#h=!0;return}if(i.key!=="Tab"||i.shiftKey||i.ctrlKey||i.metaKey||i.altKey){["Shift","Control","Alt","Meta"].includes(i.key)||(this.#h=!1);return}if(this.#h||t.readOnly||t.disabled){this.#h=!1;return}if(i.preventDefault(),!document.execCommand("insertText",!1," ")){let{selectionStart:s,selectionEnd:n}=t;t.setRangeText(" ",s,n,"end"),t.dispatchEvent(new Event("input",{bubbles:!0}))}}))}#g(){this.#c!==null&&clearTimeout(this.#c),this.#c=setTimeout(()=>this.#y(),150)}#y(){this.#c!==null&&clearTimeout(this.#c),this.#c=null,this.#e&&(this.#e.markdown=this.#t?.value??"")}#w(t,e){this.dispatchEvent(new CustomEvent(t,{detail:e,bubbles:!0,composed:!0}))}};g("markdown-editor",fi);var Ja=0,Za="button, a[href], input, select, textarea, [tabindex]",Qa='input:not([type="checkbox"]):not([type="radio"]):not([type="button"]), select, textarea, [contenteditable]',mi=class extends v{static get observedAttributes(){return["data-orientation","data-position"]}#t=null;#e=null;#i=null;#s=!1;#r=null;#n=!1;#a=0;#c=null;#h=!1;setup(){this.hasAttribute("role")||(this.setAttribute("role","toolbar"),this.#h=!0),this.getAttribute("aria-label")||this.setAttribute("aria-label","Page tools"),this.#l(),this.#g();let t=this.dataset.breakpoint||"48rem";this.#i=matchMedia(`(max-width: ${t})`),this.#w(this.#i),this.listen(this.#i,"change",e=>this.#w(e)),this.listen(this,"keydown",this.#v),this.listen(this,"focusin",this.#k),this.#r=new MutationObserver(e=>{for(let i of e)i.type==="childList"&&i.target===this&&this.#s&&this.#C();this.#d()}),this.#r.observe(this,{childList:!0,subtree:!0}),this.#d()}teardown(){this.#r?.disconnect(),this.#r=null,cancelAnimationFrame(this.#a),this.#a=0,this.#s&&this.#b(),this.#t?.remove(),this.#e?.remove(),this.#t=null,this.#e=null,this.#c=null}attributeChangedCallback(t,e,i){e===i||!this.hasAttribute("data-upgraded")||this.#l()}get tools(){let t=this.#s&&this.#e?this.#e:this;return Array.from(t.children).filter(e=>!e.hasAttribute("data-page-tools-internal"))}#l(){let t=this.dataset.orientation||"auto",e=this.dataset.position||"sticky",i=t==="horizontal"||t==="vertical"?t:e==="inline"?"horizontal":"vertical";this.setAttribute("data-resolved-orientation",i),this.#u()}#o(){return this.#s?"vertical":this.dataset.resolvedOrientation||"vertical"}#u(){if(this.#s&&this.#h){this.removeAttribute("role"),this.removeAttribute("aria-orientation"),this.#e?.setAttribute("role","toolbar"),this.#e?.setAttribute("aria-orientation",this.#o());return}this.#e?.removeAttribute("role"),this.#e?.removeAttribute("aria-orientation"),this.#h&&this.setAttribute("role","toolbar"),this.setAttribute("aria-orientation",this.#o())}#p(){return Array.from(this.querySelectorAll(Za)).filter(t=>!t.closest("[data-page-tools-internal]:not(.page-tools-popover)")&&!t.matches(":disabled")&&!t.closest("[inert]")&&t.checkVisibility())}#d(){this.#a||(this.#a=requestAnimationFrame(()=>{this.#a=0,this.#f()}))}#f(t=null){let e=this.#p();if(!e.length)return;let i=[t,this.#c].find(s=>s&&e.includes(s))||e[0];this.#c=i;for(let s of e)s.tabIndex=s===i?0:-1}#k=t=>{let e=t.target;e!==this.#t&&this.#p().includes(e)&&this.#f(e)};#v=t=>{if(t.altKey||t.ctrlKey||t.metaKey)return;let e=t.target;if(e===this.#t||e.matches(Qa))return;let i=this.#p(),s=i.indexOf(e);if(s===-1)return;let n=this.#o()==="horizontal",o=getComputedStyle(this).direction==="rtl",a=n?o?"ArrowRight":"ArrowLeft":"ArrowUp",l=n?o?"ArrowLeft":"ArrowRight":"ArrowDown",c=-1;t.key===l?c=(s+1)%i.length:t.key===a?c=(s-1+i.length)%i.length:t.key==="Home"?c=0:t.key==="End"&&(c=i.length-1),c!==-1&&(t.preventDefault(),this.#f(i[c]),i[c].focus())};#g(){let t=`pt-${++Ja}`,e=this.dataset.fabIcon||"ellipsis-vertical",i=this.dataset.fabLabel||"Page tools";this.#t=document.createElement("button"),this.#t.type="button",this.#t.className="page-tools-fab",this.#t.setAttribute("data-page-tools-internal",""),this.#t.setAttribute("popovertarget",t),this.#t.setAttribute("aria-label",i),this.#t.hidden=!0;let s=document.createElement("icon-wc");s.setAttribute("name",e),s.setAttribute("size","md"),s.setAttribute("aria-hidden","true"),this.#t.appendChild(s),this.#e=document.createElement("section"),this.#e.className="page-tools-popover",this.#e.setAttribute("data-page-tools-internal",""),this.#e.id=t,this.#e.setAttribute("popover",""),this.#e.setAttribute("aria-label",i),this.appendChild(this.#t),this.appendChild(this.#e),this.listen(this.#e,"beforetoggle",n=>{n.newState==="closed"?this.#n=!!this.#e?.contains(document.activeElement):this.#y()}),this.listen(this.#e,"toggle",n=>{if(n.newState==="open"){this.#f();return}let a=this.#n&&this.#s;if(this.#n=!1,!a)return;let l=document.activeElement;(!l||l===document.body||this.#e?.contains(l))&&this.#t?.focus()})}#y(){if(!this.#t||!this.#e)return;if(this.#t.parentElement===this){this.#e.style.removeProperty("--_fab-top"),this.#e.style.removeProperty("--_fab-end");return}let t=this.#t.getBoundingClientRect(),i=getComputedStyle(this.#t).direction==="rtl"?t.left:document.documentElement.clientWidth-t.right;this.#e.style.setProperty("--_fab-top",`${Math.round(window.innerHeight-t.top+8)}px`),this.#e.style.setProperty("--_fab-end",`${Math.max(8,Math.round(i))}px`)}#w(t){t.matches??t?this.#m():this.#b()}#m(){if(this.#s||!this.#t||!this.#e)return;let t=this.tools;for(let e of t)this.#e.appendChild(e);this.#s=!0,this.#t.hidden=!1,document.querySelector("fab-stack")?.append(this.#t),this.setAttribute("data-collapsed",""),this.#u()}#b(){if(!this.#s||!this.#t||!this.#e)return;this.#s=!1,this.#e.matches(":popover-open")&&this.#e.hidePopover?.(),this.#t.parentElement!==this&&this.insertBefore(this.#t,this.#e);let t=Array.from(this.#e.children);for(let e of t)this.insertBefore(e,this.#t);this.#t.hidden=!0,this.removeAttribute("data-collapsed"),this.#u(),this.#d()}#C(){if(!this.#e)return;let t=Array.from(this.children).filter(e=>!e.hasAttribute("data-page-tools-internal"));for(let e of t)this.#e.appendChild(e)}};g("page-tools",mi);var gi=class extends v{#t;#e;#i=null;setup(){this.#i===null&&(this.#i=this.getAttribute("label")||this.textContent.trim()||"Print this page");let t=this.#i,e=this.hasAttribute("raw-toggle");this.innerHTML="",e&&(this.setAttribute("role","group"),!this.hasAttribute("aria-label")&&!this.hasAttribute("aria-labelledby")&&this.setAttribute("aria-label",t));let i=this.getAttribute("variant")||"icon";this.#t=document.createElement("button"),this.#t.type="button",this.#t.className="print-trigger",this.#t.setAttribute("aria-label",t);let s=i!=="label",n=i!=="icon";if(s){let o=document.createElement("icon-wc");o.setAttribute("name","printer"),o.setAttribute("size","sm"),o.setAttribute("aria-hidden","true"),this.#t.appendChild(o)}if(n){let o=document.createElement("span");o.textContent=t,this.#t.appendChild(o)}if(this.listen(this.#t,"click",this.#s),this.append(this.#t),e){let o=document.createElement("label");this.#e=document.createElement("input"),this.#e.type="checkbox";let a=document.createElement("span");a.textContent=this.dataset.labelRaw||"Print without VB styles",o.append(this.#e,a),this.append(o)}}teardown(){this.#t=null,this.#e=null}#s=()=>{if(this.#e?.checked){document.documentElement.setAttribute("data-print-raw","");let e,i=()=>{document.documentElement.removeAttribute("data-print-raw"),window.removeEventListener("afterprint",i),clearTimeout(e)};window.addEventListener("afterprint",i,{once:!0}),e=setTimeout(i,5e3)}window.print()}};g("print-page",gi);var bi=new Map([["x",{label:"X",iconName:"twitter",buildUrl:({url:r,title:t})=>`https://x.com/intent/post?url=${N(r)}&text=${N(t)}`}],["twitter",{label:"X",iconName:"twitter",buildUrl:({url:r,title:t})=>`https://x.com/intent/post?url=${N(r)}&text=${N(t)}`}],["facebook",{label:"Facebook",iconName:"facebook",buildUrl:({url:r})=>`https://www.facebook.com/sharer/sharer.php?u=${N(r)}`}],["linkedin",{label:"LinkedIn",iconName:"linkedin",buildUrl:({url:r})=>`https://www.linkedin.com/sharing/share-offsite/?url=${N(r)}`}],["whatsapp",{label:"WhatsApp",iconName:"whatsapp",iconSet:"custom",buildUrl:({url:r,title:t})=>`https://wa.me/?text=${N(`${t} ${r}`)}`}],["telegram",{label:"Telegram",iconName:"telegram",iconSet:"custom",buildUrl:({url:r,title:t})=>`https://t.me/share/url?url=${N(r)}&text=${N(t)}`}],["bluesky",{label:"Bluesky",iconName:"bluesky",iconSet:"custom",buildUrl:({url:r,title:t})=>`https://bsky.app/intent/compose?text=${N(`${t} ${r}`)}`}],["mastodon",{label:"Mastodon",iconName:"mastodon",iconSet:"custom",buildUrl:({url:r,title:t},e="mastodon.social")=>`https://${e}/share?text=${N(`${t} ${r}`)}`}],["email",{label:"Email",iconName:"mail",buildUrl:({url:r,title:t,text:e})=>`mailto:?subject=${N(t)}&body=${N(`${e}
1314
-
1315
- ${r}`)}`}],["copy",{label:"Copy link",iconName:"link",buildUrl:()=>""}]]),vi="x,linkedin,bluesky,mastodon,whatsapp,email,copy";function N(r){return encodeURIComponent(r)}var tl={sharePage:"Share this page",shareOn:"Share on {platform}",copy:"Copy link",copied:"Copied!",linkCopied:"Link copied to clipboard",shareSelection:"Share selection",selectionCopied:"Selection copied"},el=/\{(url|title|text)\}/;function il(r,t){let e=n=>encodeURIComponent(n).replace(/-/g,"%2D"),i=t.replace(/\s+/g," ").trim().split(" "),s=i.length>10?`${e(i.slice(0,4).join(" "))},${e(i.slice(-4).join(" "))}`:e(i.join(" "));return`${r.split("#")[0]}#:~:text=${s}`}var yi=class extends v{#t;#e;#i;#s={};#r=new WeakMap;#n="";#a=null;#c=null;#h=!1;get url(){return this.#s.url??this.#t}set url(t){this.#l("url",t)}get shareTitle(){return this.#s.title??this.#e??""}set shareTitle(t){this.#l("title",t)}get text(){return this.#s.text??this.#i}set text(t){this.#l("text",t)}#l(t,e){e==null?delete this.#s[t]:this.#s[t]=String(e),this.hasAttribute("data-upgraded")&&(this.#u(),this.#b())}setup(){if(this.#u(),this.#d(),this.closest("selection-menu")){this.#v(),this.setAttribute("data-tier-resolved","selection");return}this.#n==="native"?this.#g():this.#n==="hidden"?this.style.display="none":this.children.length>0?this.#m():this.#y(),this.setAttribute("data-tier-resolved",this.#n)}teardown(){this.removeAttribute("data-tier-resolved"),this.#n==="hidden"&&this.style.removeProperty("display"),this.#a&&(clearTimeout(this.#a),this.#a=null);for(let t of this.querySelectorAll(".share-label[data-original]"))t.textContent=t.dataset.original??"",delete t.dataset.original;this.#c&&(this.#c.removeEventListener("click",this.#L),this.#h&&this.#c.remove(),this.#c=null,this.#h=!1),this.querySelector(":scope > .share-trigger")?.remove(),this.querySelector(":scope > .share-selection")?.remove()}async share(){return this.#n==="native"?this.#x():this.#E()}#o(t){let e=`data-label-${t.replace(/[A-Z]/g,i=>`-${i.toLowerCase()}`)}`;return this.getAttribute(e)||tl[t]}#u(){this.#t=this.#s.url||this.getAttribute("url")||document.querySelector('link[rel~="canonical" i]')?.href||location.href,this.#e=this.#s.title??(this.getAttribute("title")||document.querySelector('meta[property="og:title"]')?.getAttribute("content")||document.title),this.#i=this.#s.text??(this.getAttribute("text")||document.querySelector('meta[name="description"]')?.getAttribute("content")||document.querySelector('meta[property="og:description"]')?.getAttribute("content")||"")}#p(){return{url:this.#t||"",title:this.#e||"",text:this.#i||""}}#d(){let t=this.getAttribute("tier");if(t==="platforms"||t==="native"){t==="native"&&!navigator.share?this.#n="hidden":this.#n=t;return}if((this.getAttribute("platforms")||vi)==="native-only"){this.#n=typeof navigator.share=="function"?"native":"hidden";return}this.#n=typeof navigator.share=="function"?"native":"platforms"}#f(t){let e=document.createElement("span");return e.className="share-label",e.textContent=t,e}#k(t,e){let i=document.createElement("icon-wc");return i.setAttribute("name",t),i.setAttribute("size","sm"),e&&i.setAttribute("set",e),i.setAttribute("aria-hidden","true"),i}#v(){let t=document.createElement("button");t.type="button",t.className="share-selection",t.setAttribute("aria-label",this.#o("shareSelection")),t.appendChild(this.#k("share-2")),t.addEventListener("click",async()=>{let e=this.closest("selection-menu"),s=e?.getSelection?.()?.text||window.getSelection()?.toString().trim()||"";if(!s){e?.dismiss?.();return}let n=il(this.#t||location.href,s),o=`"${s}" \u2014 ${n}`,a=!1;if(typeof navigator.share=="function")try{await navigator.share({text:o}),a=!0}catch(l){l?.name==="AbortError"&&(a=!0)}a||await At(o,{announceMessage:this.#o("selectionCopied")}),e?.dismiss?.()}),this.appendChild(t)}#g(){let t=document.createElement("button");t.type="button",t.className="share-trigger",t.append(this.#k("share-2"),this.#f(this.getAttribute("label")||"Share")),t.addEventListener("click",this.#C),this.appendChild(t)}#y(){let t=(this.getAttribute("platforms")||vi).split(",").map(e=>e.trim()).filter(Boolean);this.#c=this.#w();for(let e of t){let i=bi.get(e);if(!i)continue;let s=document.createElement("button");s.type="button",s.dataset.platform=e,e==="copy"?s.append(this.#k(i.iconName,i.iconSet),this.#f(this.#o("copy"))):(s.setAttribute("aria-label",this.#o("shareOn").replace("{platform}",i.label)),s.append(this.#k(i.iconName,i.iconSet),this.#f(i.label))),this.#c.appendChild(s)}this.#c.addEventListener("click",this.#L),this.appendChild(this.#c),this.#h=!0}#w(){let t=document.createElement("div");return t.className="share-group",t.setAttribute("role","group"),t.setAttribute("aria-label",this.#o("sharePage")),t}#m(){let t=this.querySelector(".share-group, nav");if(t)this.#c=t;else{let e=this.#w();for(;this.firstChild;)e.appendChild(this.firstChild);this.appendChild(e),this.#c=e}this.#b(),this.#c.addEventListener("click",this.#L)}#b(){let{url:t,title:e,text:i}=this.#p();for(let s of this.querySelectorAll("a[data-platform]")){let n=this.#r.get(s);if(n==null){let o=s.getAttribute("href")||"";if(!el.test(o))continue;n=o,this.#r.set(s,n)}s.setAttribute("href",n.replace(/\{url\}/g,encodeURIComponent(t)).replace(/\{title\}/g,encodeURIComponent(e)).replace(/\{text\}/g,encodeURIComponent(i)))}}#C=async()=>{await this.#x()};async#x(){let t=this.#p();this.dispatchEvent(new CustomEvent("share-wc:open",{detail:{platform:"native"},bubbles:!0}));try{if(navigator.canShare&&!navigator.canShare(t))throw new Error("Payload not shareable");return await navigator.share(t),this.dispatchEvent(new CustomEvent("share-wc:success",{detail:{platform:"native"},bubbles:!0})),!0}catch(e){return e?.name==="AbortError"?!1:(this.dispatchEvent(new CustomEvent("share-wc:error",{detail:{platform:"native",error:e},bubbles:!0})),this.#E(this.querySelector(":scope > .share-trigger")))}}#L=t=>{let e=t.target.closest("[data-platform]");if(!e)return;let i=e.dataset.platform;if(i==="copy"){e.tagName==="A"&&t.preventDefault(),this.#E(e);return}if(e.tagName==="A"||!i)return;let s=bi.get(i);if(!s)return;this.dispatchEvent(new CustomEvent("share-wc:open",{detail:{platform:i},bubbles:!0}));let n=this.#p();if(i==="email")location.href=s.buildUrl(n);else if(i==="mastodon"){let o=this.getAttribute("mastodon-instance")||"mastodon.social",a=s.buildUrl(n,o);window.open(a,"_blank","noopener,noreferrer")}else window.open(s.buildUrl(n),"_blank","noopener,noreferrer");this.dispatchEvent(new CustomEvent("share-wc:success",{detail:{platform:i},bubbles:!0}))};async#E(t=null){let e=t?.isConnected?t:void 0;if(!await At(this.#t||"",{button:e,announceMessage:this.#o("linkCopied"),duration:2e3}))return this.dispatchEvent(new CustomEvent("share-wc:error",{detail:{platform:"copy"},bubbles:!0})),!1;this.dispatchEvent(new CustomEvent("share-wc:success",{detail:{platform:"copy"},bubbles:!0}));let s=e?.dataset.platform==="copy"?e.querySelector(".share-label"):null;if(!s)return!0;let n=s.dataset.original??s.textContent??"";return s.dataset.original=n,s.textContent=this.#o("copied"),this.#a&&clearTimeout(this.#a),this.#a=setTimeout(()=>{s.textContent=n,delete s.dataset.original,this.#a=null},2e3),!0}};g("share-wc",yi);var wi=class extends HTMLElement{static observedAttributes=["services","variant","color"]};g("social-links",wi);var sl="Home",rl="Show full path",ki=":scope > ol > li:not([data-crumb-toggle])",nl=4;function vr(r){try{return decodeURIComponent(r)}catch{return r}}var Ai=class extends v{#t={};#e=!1;#i=!1;static get observedAttributes(){return["data-collapsed"]}setup(){this.#s(),this.hasAttribute("data-from-pathname")?this.#r():this.#a(),this.#c(),this.#h(),this.#l(),this.listen(this,"click",t=>{let i=(t.target instanceof Element?t.target:null)?.closest("[data-crumb-toggle] > button");if(!i||!this.contains(i))return;let s=i.getAttribute("aria-expanded")!=="true";i.setAttribute("aria-expanded",String(s)),this.dispatchEvent(new CustomEvent("bread-crumb:toggle",{bubbles:!0,detail:{expanded:s}}))})}attributeChangedCallback(t,e,i){e===i||!this.hasAttribute("data-upgraded")||t==="data-collapsed"&&this.#h()}get labels(){return{...this.#t}}set labels(t){!t||typeof t!="object"||(this.#t={...t},this.isConnected&&this.hasAttribute("data-from-pathname")&&(this.#r(),this.#c(),this.#h(),this.#l()))}#s(){if(!!this.parentElement?.closest('nav, [role="navigation"]')){this.#e&&this.removeAttribute("role"),this.#i&&this.removeAttribute("aria-label"),this.#e=!1,this.#i=!1;return}this.hasAttribute("role")||(this.setAttribute("role","navigation"),this.#e=!0),!this.hasAttribute("aria-label")&&!this.hasAttribute("aria-labelledby")&&(this.setAttribute("aria-label","Breadcrumb"),this.#i=!0)}#r(){let e=window.location.pathname.split("/").filter(Boolean),i=document.createElement("ol"),s=document.createElement("li"),n=document.createElement("a");n.href="/",n.textContent=this.#t["/"]||this.#t.home||sl,s.appendChild(n),i.appendChild(s);let o=this.dataset.currentLabel,a="";e.forEach((c,h)=>{a+=`/${c}`;let u=h===e.length-1,p=document.createElement("li"),d=`${a}/`,f=vr(c),m=u&&o||this.#t[d]||this.#t[a]||this.#t[vr(d)]||this.#t[f]||this.#t[c]||this.#n(f);if(u){let b=document.createElement("span");b.setAttribute("aria-current","page"),b.textContent=m,p.appendChild(b)}else{let b=document.createElement("a");b.href=d,b.textContent=m,p.appendChild(b)}i.appendChild(p)});let l=this.querySelector(":scope > ol");l?l.replaceWith(i):this.prepend(i)}#n(t){return t.replace(/[-_]+/g," ").replace(/\S+/g,e=>e[0].toUpperCase()+e.slice(1))}#a(){if(this.querySelector(":scope > ol"))return;let e=Array.from(this.querySelectorAll(":scope > a, :scope > span"));if(e.length===0)return;let i=document.createElement("ol");e.forEach(s=>{let n=document.createElement("li");n.appendChild(s),i.appendChild(n)}),this.prepend(i)}#c(){let t=this.querySelectorAll(ki);t.length!==0&&t.forEach((e,i)=>{let s=i===t.length-1,n=e.querySelector("a, span");n&&(s?n.setAttribute("aria-current","page"):n.removeAttribute("aria-current"))})}#h(){let t=this.querySelector(":scope > ol"),e=t?.querySelector(":scope > li[data-crumb-toggle]"),i=this.querySelectorAll(ki);if(!(!!t&&this.hasAttribute("data-collapsed")&&i.length>=nl)){e?.remove();return}let n=e||document.createElement("li");if(!e){n.setAttribute("data-crumb-toggle","");let o=document.createElement("button");o.type="button",o.setAttribute("aria-expanded","false"),o.setAttribute("aria-label",rl),o.textContent="\u2026",n.appendChild(o)}i[0].nextElementSibling!==n&&i[0].after(n)}#l(){if(this.dataset.jsonld==="off")return;let t=Array.from(this.querySelectorAll(ki));if(t.length===0)return;let i={"@context":"https://schema.org","@type":"BreadcrumbList",itemListElement:t.map((n,o)=>{let a=n.querySelector("a, span"),l=a?.textContent?.trim()||"",c=a instanceof HTMLAnchorElement&&a.hasAttribute("href")?a.href:void 0;return{"@type":"ListItem",position:o+1,name:l,...c?{item:c}:{}}})},s=this.querySelector(':scope > script[type="application/ld+json"]');s||(s=document.createElement("script"),s.type="application/ld+json",this.appendChild(s)),s.textContent=JSON.stringify(i)}};g("bread-crumb",Ai);var yr=r=>r.replace(/\s+/g,""),ol=r=>r.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");function al(r,t){let e=0;for(;e<r.length&&e<t.length&&r[r.length-1-e]===t[t.length-1-e];)e++;return e}function ll(r,t){let e=0;for(;e<r.length&&e<t.length&&r[e]===t[e];)e++;return e}function Yt(r,t,e){return{prefix:r.slice(Math.max(0,t-32),t),suffix:r.slice(e,e+32)}}function wr(r,t){let e=yr(t.text??"");if(!e)return null;if(t.endOffset<=r.length&&yr(r.slice(t.startOffset,t.endOffset))===e)return{start:t.startOffset,end:t.endOffset};let i=new RegExp(t.text.trim().split(/\s+/).map(ol).join("\\s*"),"g"),s=t.prefix??"",n=t.suffix??"",o=null,a=-1,l=1/0;for(let c of r.matchAll(i)){let h=c.index,u=h+c[0].length,p=Yt(r,h,u),d=al(p.prefix,s)+ll(p.suffix,n),f=Math.abs(h-t.startOffset);(d>a||d===a&&f<l)&&(o={start:h,end:u},a=d,l=f)}return o}var Ei="[data-highlights]",Ar="highlights",cl=["yellow","green","blue","pink"];var hl=typeof CSS<"u"&&"highlights"in CSS,Qt=new WeakMap;function xr(r){let t=2166136261;for(let e=0;e<r.length;e++)t^=r.charCodeAt(e),t=Math.imul(t,16777619);return(t>>>0).toString(36)}function Lr(){return"hn-"+crypto.randomUUID().slice(0,8)}var ul=/^[a-z0-9_-]+$/i,Er=["solid","double","dotted","dashed","wavy"],dl={annotation:"You highlighted",added:"Highlight added",removed:"Highlight removed",noteSaved:"Note saved"};function Jt(r,t){let e="highlightsLabel"+t[0].toUpperCase()+t.slice(1);return r.dataset[e]||dl[t]}function pl(r,{textLength:t,colors:e}){if(!r||typeof r!="object")return null;let i=r,{startOffset:s,endOffset:n,color:o}=i;if(!Number.isInteger(s)||!Number.isInteger(n))return null;let a=s,l=n;return a<0||l<=a||l>t||!Si(o)||!e.includes(o)||i.id!=null&&(typeof i.id!="string"||!/^[\w-]{1,64}$/.test(i.id))||i.text!=null&&typeof i.text!="string"||i.note!=null&&typeof i.note!="string"||i.prefix!=null&&typeof i.prefix!="string"||i.suffix!=null&&typeof i.suffix!="string"?null:{id:i.id||Lr(),startOffset:a,endOffset:l,text:i.text??"",prefix:(i.prefix??"").slice(-32),suffix:(i.suffix??"").slice(0,32),color:o,note:i.note??"",created:Number.isFinite(i.created)?i.created:Date.now()}}function Si(r){return typeof r=="string"&&ul.test(r)}var et=null,it=new Map,Mt=new Map;function Mr(){if(it.size===0){et&&(document.adoptedStyleSheets=document.adoptedStyleSheets.filter(i=>i!==et),et=null);return}et||(et=new CSSStyleSheet,document.adoptedStyleSheets=[...document.adoptedStyleSheets,et]);let r=[...it.keys()],t=r.map(i=>`::highlight(hn-${i}) { background-color: var(--highlight-${i}); color: var(--highlight-${i}-ink, var(--highlight-ink, CanvasText)); text-decoration-line: underline; text-decoration-color: var(--highlight-${i}); text-underline-offset: 2px; }`),e=r.map((i,s)=>`::highlight(hn-${i}) { background-color: Mark; color: MarkText; text-decoration-line: underline; text-decoration-color: MarkText; text-decoration-style: ${Er[s%Er.length]}; text-decoration-thickness: 2px; }`);et.replaceSync(`${t.join(`
1311
+ `}strong({tokens:r}){return`<strong>${this.parser.parseInline(r)}</strong>`}em({tokens:r}){return`<em>${this.parser.parseInline(r)}</em>`}codespan({text:r}){return`<code>${F(r,!0)}</code>`}br(r){return"<br>"}del({tokens:r}){return`<del>${this.parser.parseInline(r)}</del>`}link({href:r,title:t,tokens:e}){let i=this.parser.parseInline(e),s=Er(r);if(s===null)return i;r=s;let n='<a href="'+r+'"';return t&&(n+=' title="'+F(t)+'"'),n+=">"+i+"</a>",n}image({href:r,title:t,text:e,tokens:i}){i&&(e=this.parser.parseInline(i,this.parser.textRenderer));let s=Er(r);if(s===null)return F(e);r=s;let n=`<img src="${r}" alt="${F(e)}"`;return t&&(n+=` title="${F(t)}"`),n+=">",n}text(r){return"tokens"in r&&r.tokens?this.parser.parseInline(r.tokens):"escaped"in r&&r.escaped?r.text:F(r.text)}},Ai=class{strong({text:r}){return r}em({text:r}){return r}codespan({text:r}){return r}del({text:r}){return r}html({text:r}){return r}text({text:r}){return r}link({text:r}){return""+r}image({text:r}){return""+r}br(){return""}checkbox({raw:r}){return r}},B=class di{options;renderer;textRenderer;constructor(t){this.options=t||st,this.options.renderer=this.options.renderer||new ee,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new Ai}static parse(t,e){return new di(e).parse(t)}static parseInline(t,e){return new di(e).parseInline(t)}parse(t){this.renderer.parser=this;let e="";for(let i=0;i<t.length;i++){let s=t[i];if(this.options.extensions?.renderers?.[s.type]){let o=s,a=this.options.extensions.renderers[o.type].call({parser:this},o);if(a!==!1||!["space","hr","heading","code","table","blockquote","list","html","def","paragraph","text"].includes(o.type)){e+=a||"";continue}}let n=s;switch(n.type){case"space":{e+=this.renderer.space(n);break}case"hr":{e+=this.renderer.hr(n);break}case"heading":{e+=this.renderer.heading(n);break}case"code":{e+=this.renderer.code(n);break}case"table":{e+=this.renderer.table(n);break}case"blockquote":{e+=this.renderer.blockquote(n);break}case"list":{e+=this.renderer.list(n);break}case"checkbox":{e+=this.renderer.checkbox(n);break}case"html":{e+=this.renderer.html(n);break}case"def":{e+=this.renderer.def(n);break}case"paragraph":{e+=this.renderer.paragraph(n);break}case"text":{e+=this.renderer.text(n);break}default:{let o='Token with "'+n.type+'" type was not found.';if(this.options.silent)return console.error(o),"";throw new Error(o)}}}return e}parseInline(t,e=this.renderer){this.renderer.parser=this;let i="";for(let s=0;s<t.length;s++){let n=t[s];if(this.options.extensions?.renderers?.[n.type]){let a=this.options.extensions.renderers[n.type].call({parser:this},n);if(a!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(n.type)){i+=a||"";continue}}let o=n;switch(o.type){case"escape":{i+=e.text(o);break}case"html":{i+=e.html(o);break}case"link":{i+=e.link(o);break}case"image":{i+=e.image(o);break}case"checkbox":{i+=e.checkbox(o);break}case"strong":{i+=e.strong(o);break}case"em":{i+=e.em(o);break}case"codespan":{i+=e.codespan(o);break}case"br":{i+=e.br(o);break}case"del":{i+=e.del(o);break}case"text":{i+=e.text(o);break}default:{let a='Token with "'+o.type+'" type was not found.';if(this.options.silent)return console.error(a),"";throw new Error(a)}}}return i}},$t=class{options;block;constructor(r){this.options=r||st}static passThroughHooks=new Set(["preprocess","postprocess","processAllTokens","emStrongMask"]);static passThroughHooksRespectAsync=new Set(["preprocess","postprocess","processAllTokens"]);preprocess(r){return r}postprocess(r){return r}processAllTokens(r){return r}emStrongMask(r){return r}provideLexer(r=this.block){return r?z.lex:z.lexInline}provideParser(r=this.block){return r?B.parse:B.parseInline}},ki=class{defaults=pi();options=this.setOptions;parse=this.parseMarkdown(!0);parseInline=this.parseMarkdown(!1);Parser=B;Renderer=ee;TextRenderer=Ai;Lexer=z;Tokenizer=te;Hooks=$t;constructor(...r){this.use(...r)}walkTokens(r,t){let e=[];for(let i of r)switch(e=e.concat(t.call(this,i)),i.type){case"table":{let s=i;for(let n of s.header)e=e.concat(this.walkTokens(n.tokens,t));for(let n of s.rows)for(let o of n)e=e.concat(this.walkTokens(o.tokens,t));break}case"list":{let s=i;e=e.concat(this.walkTokens(s.items,t));break}default:{let s=i;this.defaults.extensions?.childTokens?.[s.type]?this.defaults.extensions.childTokens[s.type].forEach(n=>{let o=s[n].flat(1/0);e=e.concat(this.walkTokens(o,t))}):s.tokens&&(e=e.concat(this.walkTokens(s.tokens,t)))}}return e}use(...r){let t=this.defaults.extensions||{renderers:{},childTokens:{}};return r.forEach(e=>{let i={...e};if(i.async=this.defaults.async||i.async||!1,e.extensions&&(e.extensions.forEach(s=>{if(!s.name)throw new Error("extension name required");if("renderer"in s){let n=t.renderers[s.name];n?t.renderers[s.name]=function(...o){let a=s.renderer.apply(this,o);return a===!1&&(a=n.apply(this,o)),a}:t.renderers[s.name]=s.renderer}if("tokenizer"in s){if(!s.level||s.level!=="block"&&s.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");let n=t[s.level];n?n.unshift(s.tokenizer):t[s.level]=[s.tokenizer],s.start&&(s.level==="block"?t.startBlock?t.startBlock.push(s.start):t.startBlock=[s.start]:s.level==="inline"&&(t.startInline?t.startInline.push(s.start):t.startInline=[s.start]))}"childTokens"in s&&s.childTokens&&(t.childTokens[s.name]=s.childTokens)}),i.extensions=t),e.renderer){let s=this.defaults.renderer||new ee(this.defaults);for(let n in e.renderer){if(!(n in s))throw new Error(`renderer '${n}' does not exist`);if(["options","parser"].includes(n))continue;let o=n,a=e.renderer[o],l=s[o];s[o]=(...c)=>{let h=a.apply(s,c);return h===!1&&(h=l.apply(s,c)),h||""}}i.renderer=s}if(e.tokenizer){let s=this.defaults.tokenizer||new te(this.defaults);for(let n in e.tokenizer){if(!(n in s))throw new Error(`tokenizer '${n}' does not exist`);if(["options","rules","lexer"].includes(n))continue;let o=n,a=e.tokenizer[o],l=s[o];s[o]=(...c)=>{let h=a.apply(s,c);return h===!1&&(h=l.apply(s,c)),h}}i.tokenizer=s}if(e.hooks){let s=this.defaults.hooks||new $t;for(let n in e.hooks){if(!(n in s))throw new Error(`hook '${n}' does not exist`);if(["options","block"].includes(n))continue;let o=n,a=e.hooks[o],l=s[o];$t.passThroughHooks.has(n)?s[o]=c=>{if(this.defaults.async&&$t.passThroughHooksRespectAsync.has(n))return(async()=>{let u=await a.call(s,c);return l.call(s,u)})();let h=a.call(s,c);return l.call(s,h)}:s[o]=(...c)=>{if(this.defaults.async)return(async()=>{let u=await a.apply(s,c);return u===!1&&(u=await l.apply(s,c)),u})();let h=a.apply(s,c);return h===!1&&(h=l.apply(s,c)),h}}i.hooks=s}if(e.walkTokens){let s=this.defaults.walkTokens,n=e.walkTokens;i.walkTokens=function(o){let a=[];return a.push(n.call(this,o)),s&&(a=a.concat(s.call(this,o))),a}}this.defaults={...this.defaults,...i}}),this}setOptions(r){return this.defaults={...this.defaults,...r},this}lexer(r,t){return z.lex(r,t??this.defaults)}parser(r,t){return B.parse(r,t??this.defaults)}parseMarkdown(r){return(t,e)=>{let i={...e},s={...this.defaults,...i},n=this.onError(!!s.silent,!!s.async);if(this.defaults.async===!0&&i.async===!1)return n(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(typeof t>"u"||t===null)return n(new Error("marked(): input parameter is undefined or null"));if(typeof t!="string")return n(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(t)+", string expected"));if(s.hooks&&(s.hooks.options=s,s.hooks.block=r),s.async)return(async()=>{let o=s.hooks?await s.hooks.preprocess(t):t,a=await(s.hooks?await s.hooks.provideLexer(r):r?z.lex:z.lexInline)(o,s),l=s.hooks?await s.hooks.processAllTokens(a):a;s.walkTokens&&await Promise.all(this.walkTokens(l,s.walkTokens));let c=await(s.hooks?await s.hooks.provideParser(r):r?B.parse:B.parseInline)(l,s);return s.hooks?await s.hooks.postprocess(c):c})().catch(n);try{s.hooks&&(t=s.hooks.preprocess(t));let o=(s.hooks?s.hooks.provideLexer(r):r?z.lex:z.lexInline)(t,s);s.hooks&&(o=s.hooks.processAllTokens(o)),s.walkTokens&&this.walkTokens(o,s.walkTokens);let a=(s.hooks?s.hooks.provideParser(r):r?B.parse:B.parseInline)(o,s);return s.hooks&&(a=s.hooks.postprocess(a)),a}catch(o){return n(o)}}}onError(r,t){return e=>{if(e.message+=`
1312
+ Please report this to https://github.com/markedjs/marked.`,r){let i="<p>An error occurred:</p><pre>"+F(e.message+"",!0)+"</pre>";return t?Promise.resolve(i):i}if(t)return Promise.reject(e);throw e}}},it=new ki;function S(r,t){return it.parse(r,t)}S.options=S.setOptions=function(r){return it.setOptions(r),S.defaults=it.defaults,Tr(S.defaults),S};S.getDefaults=pi;S.defaults=st;S.use=function(...r){return it.use(...r),S.defaults=it.defaults,Tr(S.defaults),S};S.walkTokens=function(r,t){return it.walkTokens(r,t)};S.parseInline=it.parseInline;S.Parser=B;S.parser=B.parse;S.Renderer=ee;S.TextRenderer=Ai;S.Lexer=z;S.lexer=z.lex;S.Tokenizer=te;S.Hooks=$t;S.parse=S;var Id=S.options,Od=S.setOptions,zd=S.use,Bd=S.walkTokens,Dd=S.parseInline;var jd=B.parse,Fd=z.lex;var Tl="Failed to load markdown",Ml=/^:::[ \t]*(note|info|tip|warning|danger)(?:[ \t]+([^\n]*?))?[ \t]*\n([\s\S]*?)\n?^:::[ \t]*(?:\n+|$)/m,Ll=r=>r.replace(/[&<>"']/g,t=>`&#${t.charCodeAt(0)};`),_l={name:"vbCallout",level:"block",start(r){return r.match(/^:::[ \t]*(?:note|info|tip|warning|danger)\b/m)?.index},tokenizer(r){let t=Ml.exec(r);if(!t||t.index!==0)return;let e=t[1],i=(t[2]||"").trim()||e[0].toUpperCase()+e.slice(1),s={type:"vbCallout",raw:t[0],kind:e,title:i,tokens:[]};return this.lexer.blockTokens(t[3],s.tokens),s},renderer(r){return`<aside data-callout="${r.kind}" role="note"><p data-callout-title><strong>${Ll(r.title)}</strong></p>${this.parser.parse(r.tokens)}</aside>
1313
+ `}},Rl=new ki({gfm:!0,extensions:[_l]}),xi=class extends b{#t=null;#e=null;#i=null;#s=null;#r=null;#n=null;#a=0;static get observedAttributes(){return["src","sanitize","allow-cross-origin"]}setup(){this.#o()}teardown(){this.#e?.abort(),this.removeAttribute("data-rendered"),this.removeAttribute("data-loading")}attributeChangedCallback(t,e,i){e===i||!this.isConnected||!this.hasAttribute("data-upgraded")||this.#o()}get parser(){return this.#t}set parser(t){this.#t=typeof t=="function"?t:null}get markdown(){return this.#r??this.#n??""}set markdown(t){let e=t==null?null:String(t);this.#r!==e&&(this.#r=e,this.#o())}async render(){await this.#o()}async reload(){this.getAttribute("src")&&await this.#o()}#c(){let t=this.querySelector('script[type="text/markdown"]');if(t)return t.textContent;let e=this.querySelector("template[data-md]");if(e)return e.content.textContent;let i=this.querySelector(":scope > pre");return i?i.textContent:null}#h(t){let e;try{e=new URL(t,document.baseURI)}catch{throw new Error(`Invalid URL: ${t}`)}if(e.protocol!=="http:"&&e.protocol!=="https:")throw new Error(`Refused ${e.protocol} URL: only http(s) is allowed`);return this.#l(e.href),e.href}#l(t){if(!this.hasAttribute("allow-cross-origin")&&new URL(t).origin!==location.origin)throw new Error(`Refused cross-origin URL ${t} (add allow-cross-origin to permit)`)}async#o(){let t=++this.#a,e=this.getAttribute("src"),i;if(this.#e?.abort(),this.#e=null,this.removeAttribute("data-rendered"),this.removeAttribute("data-error"),this.removeAttribute("data-loading"),this.#s?.remove(),this.#s=null,e){let o=new AbortController;this.#e=o,this.setAttribute("data-loading",""),this.#v("markdown-viewer:fetch",{src:e});try{let a=this.#h(e),l=await fetch(a,{signal:o.signal});if(l.url&&this.#l(l.url),!l.ok)throw new Error(`HTTP ${l.status}: ${l.statusText}`);i=await l.text()}catch(a){if(a.name==="AbortError"||t!==this.#a)return;this.#u(a);return}if(t!==this.#a)return;this.removeAttribute("data-loading")}else this.#r!=null?i=this.#r:i=this.#c();if(i==null){this.#i?.replaceChildren();return}this.#n=i;let s;try{s=await(await this.#p())(i)}catch(o){if(t!==this.#a)return;this.#u(o);return}if(t!==this.#a)return;(!this.#i||this.#i.parentNode!==this)&&(this.#i=document.createElement("div"),this.#i.className="md-content",this.#i.setAttribute("part","content"),this.appendChild(this.#i)),this.hasAttribute("dir")?this.#i.removeAttribute("dir"):this.#i.setAttribute("dir","auto"),this.#d()?this.#i.replaceChildren(Xt(String(s??""))):this.#i.innerHTML=String(s??""),this.#f(),this.setAttribute("data-rendered","");let n=this.getAttribute("ping");if(n&&navigator.sendBeacon?.(n,JSON.stringify({src:e||"inline"})),this.#v("markdown-viewer:rendered",{src:e,node:this.#i}),this.hasAttribute("highlight"))for(let o of this.#i.querySelectorAll('pre > code[class*="language-"]')){let a=o.className.match(/language-(\S+)/)?.[1]||"";this.#v("markdown-viewer:highlight",{node:o,language:a})}}#u(t){if(this.removeAttribute("data-loading"),this.setAttribute("data-error",""),this.#i?.replaceChildren(),!this.querySelector(":scope > pre")){let e=document.createElement("p");e.setAttribute("role","alert"),e.setAttribute("data-md-error",""),e.textContent=this.getAttribute("data-label-error")||Tl,this.append(e),this.#s=e}this.#v("markdown-viewer:error",{error:t.message})}async#p(){return this.#t?this.#t:t=>Rl.parse(t)}#d(){let t=this.getAttribute("sanitize");return t==null?!0:!/^(off|false)$/i.test(t.trim())}#f(){if(!this.#i)return;let t=this.dataset.theme??this.closest("[data-theme]")?.dataset.theme;t&&(this.#i.dataset.theme=t)}#v(t,e){this.dispatchEvent(new CustomEvent(t,{detail:e,bubbles:!0,composed:!0}))}};g("markdown-viewer",xi);var zr={source:"Markdown source",preview:"Rendered preview",tabHint:"Tab inserts spaces. Press Escape, then Tab, to move focus."},Nl=0,Ei=class extends b{#t=null;#e=null;#i=null;#s=null;#r=null;#n="";#a=null;#c=null;#h=!1;#l={placeholder:null,rows:null};static get observedAttributes(){return["placeholder","rows","highlight","data-label-source","data-label-preview"]}setup(){this.#o()||this.#u(),this.#y(),this.#w()}teardown(){this.#c!==null&&clearTimeout(this.#c),this.#c=null,this.#h=!1,this.removeAttribute("data-editing")}attributeChangedCallback(t,e,i){!this.#t||e===i||(t==="placeholder"?this.#v(this.#t,"placeholder",i??this.#l.placeholder):t==="rows"?this.#p():t==="highlight"?this.#e?.toggleAttribute("highlight",i!=null):this.#d())}get value(){return this.#t?.value??this.#a??""}set value(t){let e=t==null?"":String(t);if(!this.#t){this.#a=e;return}this.#t.value!==e&&(this.#t.value=e,this.#n=e,this.#w(),this.#A("markdown-editor:change",{value:e,source:"api"}))}get textarea(){return this.#t}#o(){return!!(this.#t&&this.#i?.parentNode===this&&this.#s?.parentNode===this&&this.#i.contains(this.#t))}#u(){let t=this.#t&&this.contains(this.#t)?this.#t:this.querySelector("textarea"),e=[...this.childNodes];t||(t=document.createElement("textarea"),e.push(t)),this.#t=t,this.#l={placeholder:t.getAttribute("placeholder"),rows:t.getAttribute("rows")},this.hasAttribute("placeholder")&&(t.placeholder=this.getAttribute("placeholder")??""),this.#p(),t.hasAttribute("dir")||(t.dir="auto"),t.hasAttribute("spellcheck")||(t.spellcheck=!0),this.#i=document.createElement("section"),this.#i.className="md-editor-pane",this.#i.setAttribute("role","group"),this.#i.append(...e),this.#s=document.createElement("section"),this.#s.className="md-preview-pane",this.#s.setAttribute("role","group"),this.#e=document.createElement("markdown-viewer");let i=t.getAttribute("dir");i&&i!=="auto"&&(this.#s.dir=i),this.#e.dir=i||"auto",this.hasAttribute("highlight")&&this.#e.setAttribute("highlight","");let s=this.dataset.theme??this.closest("[data-theme]")?.dataset.theme;if(s&&(this.#e.dataset.theme=s),this.#s.append(this.#e),this.hasAttribute("data-tab-indent")){this.#r=document.createElement("span"),this.#r.className="visually-hidden",this.#r.id=`md-editor-tab-hint-${++Nl}`,this.#r.textContent=this.dataset.labelTabHint||zr.tabHint,this.#i.append(this.#r);let n=t.getAttribute("aria-describedby");t.setAttribute("aria-describedby",n?`${n} ${this.#r.id}`:this.#r.id)}this.replaceChildren(this.#i,this.#s),this.#d(),!t.hasAttribute("aria-label")&&!t.hasAttribute("aria-labelledby")&&!t.labels?.length&&!t.title&&t.setAttribute("aria-label",this.#f("source")),this.#a!=null&&(t.value=this.#a,this.#a=null),this.#n=t.value}#p(){if(!this.#t)return;let t=this.getAttribute("rows")??this.#l.rows;this.#t.rows=parseInt(t??"",10)||10}#d(){this.#i?.setAttribute("aria-label",this.#f("source")),this.#s?.setAttribute("aria-label",this.#f("preview"))}#f(t){return(t==="source"?this.dataset.labelSource:this.dataset.labelPreview)||zr[t]}#v(t,e,i){i==null?t.removeAttribute(e):t.setAttribute(e,i)}#y(){let t=this.#t;t&&(this.listen(t,"input",()=>{this.#A("markdown-editor:input",{value:t.value}),this.#g()}),this.listen(t,"focus",()=>{this.setAttribute("data-editing","")}),this.listen(t,"blur",()=>{this.removeAttribute("data-editing"),this.#h=!1,t.value!==this.#n&&(this.#n=t.value,this.#A("markdown-editor:change",{value:t.value,source:"user"}))}),this.listen(this.getRootNode(),"reset",e=>{!t.form||e.target!==t.form||queueMicrotask(()=>{this.#n=t.value,this.#w()})},{capture:!0}),this.hasAttribute("data-tab-indent")&&this.listen(t,"keydown",e=>{let i=e;if(i.key==="Escape"){this.#h=!0;return}if(i.key!=="Tab"||i.shiftKey||i.ctrlKey||i.metaKey||i.altKey){["Shift","Control","Alt","Meta"].includes(i.key)||(this.#h=!1);return}if(this.#h||t.readOnly||t.disabled){this.#h=!1;return}if(i.preventDefault(),!document.execCommand("insertText",!1," ")){let{selectionStart:s,selectionEnd:n}=t;t.setRangeText(" ",s,n,"end"),t.dispatchEvent(new Event("input",{bubbles:!0}))}}))}#g(){this.#c!==null&&clearTimeout(this.#c),this.#c=setTimeout(()=>this.#w(),150)}#w(){this.#c!==null&&clearTimeout(this.#c),this.#c=null,this.#e&&(this.#e.markdown=this.#t?.value??"")}#A(t,e){this.dispatchEvent(new CustomEvent(t,{detail:e,bubbles:!0,composed:!0}))}};g("markdown-editor",Ei);var $l=0,Pl="button, a[href], input, select, textarea, [tabindex]",Il='input:not([type="checkbox"]):not([type="radio"]):not([type="button"]), select, textarea, [contenteditable]',Si=class extends b{static get observedAttributes(){return["data-orientation","data-position"]}#t=null;#e=null;#i=null;#s=!1;#r=null;#n=!1;#a=0;#c=null;#h=!1;setup(){this.hasAttribute("role")||(this.setAttribute("role","toolbar"),this.#h=!0),this.getAttribute("aria-label")||this.setAttribute("aria-label","Page tools"),this.#l(),this.#g();let t=this.dataset.breakpoint||"48rem";this.#i=matchMedia(`(max-width: ${t})`),this.#A(this.#i),this.listen(this.#i,"change",e=>this.#A(e)),this.listen(this,"keydown",this.#y),this.listen(this,"focusin",this.#v),this.#r=new MutationObserver(e=>{for(let i of e)i.type==="childList"&&i.target===this&&this.#s&&this.#S();this.#d()}),this.#r.observe(this,{childList:!0,subtree:!0}),this.#d()}teardown(){this.#r?.disconnect(),this.#r=null,cancelAnimationFrame(this.#a),this.#a=0,this.#s&&this.#b(),this.#t?.remove(),this.#e?.remove(),this.#t=null,this.#e=null,this.#c=null}attributeChangedCallback(t,e,i){e===i||!this.hasAttribute("data-upgraded")||this.#l()}get tools(){let t=this.#s&&this.#e?this.#e:this;return Array.from(t.children).filter(e=>!e.hasAttribute("data-page-tools-internal"))}#l(){let t=this.dataset.orientation||"auto",e=this.dataset.position||"sticky",i=t==="horizontal"||t==="vertical"?t:e==="inline"?"horizontal":"vertical";this.setAttribute("data-resolved-orientation",i),this.#u()}#o(){return this.#s?"vertical":this.dataset.resolvedOrientation||"vertical"}#u(){if(this.#s&&this.#h){this.removeAttribute("role"),this.removeAttribute("aria-orientation"),this.#e?.setAttribute("role","toolbar"),this.#e?.setAttribute("aria-orientation",this.#o());return}this.#e?.removeAttribute("role"),this.#e?.removeAttribute("aria-orientation"),this.#h&&this.setAttribute("role","toolbar"),this.setAttribute("aria-orientation",this.#o())}#p(){return Array.from(this.querySelectorAll(Pl)).filter(t=>!t.closest("[data-page-tools-internal]:not(.page-tools-popover)")&&!t.matches(":disabled")&&!t.closest("[inert]")&&t.checkVisibility())}#d(){this.#a||(this.#a=requestAnimationFrame(()=>{this.#a=0,this.#f()}))}#f(t=null){let e=this.#p();if(!e.length)return;let i=[t,this.#c].find(s=>s&&e.includes(s))||e[0];this.#c=i;for(let s of e)s.tabIndex=s===i?0:-1}#v=t=>{let e=t.target;e!==this.#t&&this.#p().includes(e)&&this.#f(e)};#y=t=>{if(t.altKey||t.ctrlKey||t.metaKey)return;let e=t.target;if(e===this.#t||e.matches(Il))return;let i=this.#p(),s=i.indexOf(e);if(s===-1)return;let n=this.#o()==="horizontal",o=getComputedStyle(this).direction==="rtl",a=n?o?"ArrowRight":"ArrowLeft":"ArrowUp",l=n?o?"ArrowLeft":"ArrowRight":"ArrowDown",c=-1;t.key===l?c=(s+1)%i.length:t.key===a?c=(s-1+i.length)%i.length:t.key==="Home"?c=0:t.key==="End"&&(c=i.length-1),c!==-1&&(t.preventDefault(),this.#f(i[c]),i[c].focus())};#g(){let t=`pt-${++$l}`,e=this.dataset.fabIcon||"ellipsis-vertical",i=this.dataset.fabLabel||"Page tools";this.#t=document.createElement("button"),this.#t.type="button",this.#t.className="page-tools-fab",this.#t.setAttribute("data-page-tools-internal",""),this.#t.setAttribute("popovertarget",t),this.#t.setAttribute("aria-label",i),this.#t.hidden=!0;let s=document.createElement("icon-wc");s.setAttribute("name",e),s.setAttribute("size","md"),s.setAttribute("aria-hidden","true"),this.#t.appendChild(s),this.#e=document.createElement("section"),this.#e.className="page-tools-popover",this.#e.setAttribute("data-page-tools-internal",""),this.#e.id=t,this.#e.setAttribute("popover",""),this.#e.setAttribute("aria-label",i),this.appendChild(this.#t),this.appendChild(this.#e),this.listen(this.#e,"beforetoggle",n=>{n.newState==="closed"?this.#n=!!this.#e?.contains(document.activeElement):this.#w()}),this.listen(this.#e,"toggle",n=>{if(n.newState==="open"){this.#f();return}let a=this.#n&&this.#s;if(this.#n=!1,!a)return;let l=document.activeElement;(!l||l===document.body||this.#e?.contains(l))&&this.#t?.focus()})}#w(){if(!this.#t||!this.#e)return;if(this.#t.parentElement===this){this.#e.style.removeProperty("--_fab-top"),this.#e.style.removeProperty("--_fab-end");return}let t=this.#t.getBoundingClientRect(),i=getComputedStyle(this.#t).direction==="rtl"?t.left:document.documentElement.clientWidth-t.right;this.#e.style.setProperty("--_fab-top",`${Math.round(window.innerHeight-t.top+8)}px`),this.#e.style.setProperty("--_fab-end",`${Math.max(8,Math.round(i))}px`)}#A(t){t.matches??t?this.#m():this.#b()}#m(){if(this.#s||!this.#t||!this.#e)return;let t=this.tools;for(let e of t)this.#e.appendChild(e);this.#s=!0,this.#t.hidden=!1,document.querySelector("fab-stack")?.append(this.#t),this.setAttribute("data-collapsed",""),this.#u()}#b(){if(!this.#s||!this.#t||!this.#e)return;this.#s=!1,this.#e.matches(":popover-open")&&this.#e.hidePopover?.(),this.#t.parentElement!==this&&this.insertBefore(this.#t,this.#e);let t=Array.from(this.#e.children);for(let e of t)this.insertBefore(e,this.#t);this.#t.hidden=!0,this.removeAttribute("data-collapsed"),this.#u(),this.#d()}#S(){if(!this.#e)return;let t=Array.from(this.children).filter(e=>!e.hasAttribute("data-page-tools-internal"));for(let e of t)this.#e.appendChild(e)}};g("page-tools",Si);var Ci=class extends b{#t;#e;#i=null;setup(){this.#i===null&&(this.#i=this.getAttribute("label")||this.textContent.trim()||"Print this page");let t=this.#i,e=this.hasAttribute("raw-toggle");this.innerHTML="",e&&(this.setAttribute("role","group"),!this.hasAttribute("aria-label")&&!this.hasAttribute("aria-labelledby")&&this.setAttribute("aria-label",t));let i=this.getAttribute("variant")||"icon";this.#t=document.createElement("button"),this.#t.type="button",this.#t.className="print-trigger",this.#t.setAttribute("aria-label",t);let s=i!=="label",n=i!=="icon";if(s){let o=document.createElement("icon-wc");o.setAttribute("name","printer"),o.setAttribute("size","sm"),o.setAttribute("aria-hidden","true"),this.#t.appendChild(o)}if(n){let o=document.createElement("span");o.textContent=t,this.#t.appendChild(o)}if(this.listen(this.#t,"click",this.#s),this.append(this.#t),e){let o=document.createElement("label");this.#e=document.createElement("input"),this.#e.type="checkbox";let a=document.createElement("span");a.textContent=this.dataset.labelRaw||"Print without VB styles",o.append(this.#e,a),this.append(o)}}teardown(){this.#t=null,this.#e=null}#s=()=>{if(this.#e?.checked){document.documentElement.setAttribute("data-print-raw","");let e,i=()=>{document.documentElement.removeAttribute("data-print-raw"),window.removeEventListener("afterprint",i),clearTimeout(e)};window.addEventListener("afterprint",i,{once:!0}),e=setTimeout(i,5e3)}window.print()}};g("print-page",Ci);var Ti=new Map([["x",{label:"X",iconName:"twitter",buildUrl:({url:r,title:t})=>`https://x.com/intent/post?url=${P(r)}&text=${P(t)}`}],["twitter",{label:"X",iconName:"twitter",buildUrl:({url:r,title:t})=>`https://x.com/intent/post?url=${P(r)}&text=${P(t)}`}],["facebook",{label:"Facebook",iconName:"facebook",buildUrl:({url:r})=>`https://www.facebook.com/sharer/sharer.php?u=${P(r)}`}],["linkedin",{label:"LinkedIn",iconName:"linkedin",buildUrl:({url:r})=>`https://www.linkedin.com/sharing/share-offsite/?url=${P(r)}`}],["whatsapp",{label:"WhatsApp",iconName:"whatsapp",iconSet:"custom",buildUrl:({url:r,title:t})=>`https://wa.me/?text=${P(`${t} ${r}`)}`}],["telegram",{label:"Telegram",iconName:"telegram",iconSet:"custom",buildUrl:({url:r,title:t})=>`https://t.me/share/url?url=${P(r)}&text=${P(t)}`}],["bluesky",{label:"Bluesky",iconName:"bluesky",iconSet:"custom",buildUrl:({url:r,title:t})=>`https://bsky.app/intent/compose?text=${P(`${t} ${r}`)}`}],["mastodon",{label:"Mastodon",iconName:"mastodon",iconSet:"custom",buildUrl:({url:r,title:t},e="mastodon.social")=>`https://${e}/share?text=${P(`${t} ${r}`)}`}],["email",{label:"Email",iconName:"mail",buildUrl:({url:r,title:t,text:e})=>`mailto:?subject=${P(t)}&body=${P(`${e}
1314
+
1315
+ ${r}`)}`}],["copy",{label:"Copy link",iconName:"link",buildUrl:()=>""}]]),Mi="x,linkedin,bluesky,mastodon,whatsapp,email,copy";function P(r){return encodeURIComponent(r)}var Ol={sharePage:"Share this page",shareOn:"Share on {platform}",copy:"Copy link",copied:"Copied!",linkCopied:"Link copied to clipboard",shareSelection:"Share selection",selectionCopied:"Selection copied"},zl=/\{(url|title|text)\}/;function Bl(r,t){let e=n=>encodeURIComponent(n).replace(/-/g,"%2D"),i=t.replace(/\s+/g," ").trim().split(" "),s=i.length>10?`${e(i.slice(0,4).join(" "))},${e(i.slice(-4).join(" "))}`:e(i.join(" "));return`${r.split("#")[0]}#:~:text=${s}`}var Li=class extends b{#t;#e;#i;#s={};#r=new WeakMap;#n="";#a=null;#c=null;#h=!1;get url(){return this.#s.url??this.#t}set url(t){this.#l("url",t)}get shareTitle(){return this.#s.title??this.#e??""}set shareTitle(t){this.#l("title",t)}get text(){return this.#s.text??this.#i}set text(t){this.#l("text",t)}#l(t,e){e==null?delete this.#s[t]:this.#s[t]=String(e),this.hasAttribute("data-upgraded")&&(this.#u(),this.#b())}setup(){if(this.#u(),this.#d(),this.closest("selection-menu")){this.#y(),this.setAttribute("data-tier-resolved","selection");return}this.#n==="native"?this.#g():this.#n==="hidden"?this.style.display="none":this.children.length>0?this.#m():this.#w(),this.setAttribute("data-tier-resolved",this.#n)}teardown(){this.removeAttribute("data-tier-resolved"),this.#n==="hidden"&&this.style.removeProperty("display"),this.#a&&(clearTimeout(this.#a),this.#a=null);for(let t of this.querySelectorAll(".share-label[data-original]"))t.textContent=t.dataset.original??"",delete t.dataset.original;this.#c&&(this.#c.removeEventListener("click",this.#T),this.#h&&this.#c.remove(),this.#c=null,this.#h=!1),this.querySelector(":scope > .share-trigger")?.remove(),this.querySelector(":scope > .share-selection")?.remove()}async share(){return this.#n==="native"?this.#x():this.#E()}#o(t){let e=`data-label-${t.replace(/[A-Z]/g,i=>`-${i.toLowerCase()}`)}`;return this.getAttribute(e)||Ol[t]}#u(){this.#t=this.#s.url||this.getAttribute("url")||document.querySelector('link[rel~="canonical" i]')?.href||location.href,this.#e=this.#s.title??(this.getAttribute("title")||document.querySelector('meta[property="og:title"]')?.getAttribute("content")||document.title),this.#i=this.#s.text??(this.getAttribute("text")||document.querySelector('meta[name="description"]')?.getAttribute("content")||document.querySelector('meta[property="og:description"]')?.getAttribute("content")||"")}#p(){return{url:this.#t||"",title:this.#e||"",text:this.#i||""}}#d(){let t=this.getAttribute("tier");if(t==="platforms"||t==="native"){t==="native"&&!navigator.share?this.#n="hidden":this.#n=t;return}if((this.getAttribute("platforms")||Mi)==="native-only"){this.#n=typeof navigator.share=="function"?"native":"hidden";return}this.#n=typeof navigator.share=="function"?"native":"platforms"}#f(t){let e=document.createElement("span");return e.className="share-label",e.textContent=t,e}#v(t,e){let i=document.createElement("icon-wc");return i.setAttribute("name",t),i.setAttribute("size","sm"),e&&i.setAttribute("set",e),i.setAttribute("aria-hidden","true"),i}#y(){let t=document.createElement("button");t.type="button",t.className="share-selection",t.setAttribute("aria-label",this.#o("shareSelection")),t.appendChild(this.#v("share-2")),t.addEventListener("click",async()=>{let e=this.closest("selection-menu"),s=e?.getSelection?.()?.text||window.getSelection()?.toString().trim()||"";if(!s){e?.dismiss?.();return}let n=Bl(this.#t||location.href,s),o=`"${s}" \u2014 ${n}`,a=!1;if(typeof navigator.share=="function")try{await navigator.share({text:o}),a=!0}catch(l){l?.name==="AbortError"&&(a=!0)}a||await Mt(o,{announceMessage:this.#o("selectionCopied")}),e?.dismiss?.()}),this.appendChild(t)}#g(){let t=document.createElement("button");t.type="button",t.className="share-trigger",t.append(this.#v("share-2"),this.#f(this.getAttribute("label")||"Share")),t.addEventListener("click",this.#S),this.appendChild(t)}#w(){let t=(this.getAttribute("platforms")||Mi).split(",").map(e=>e.trim()).filter(Boolean);this.#c=this.#A();for(let e of t){let i=Ti.get(e);if(!i)continue;let s=document.createElement("button");s.type="button",s.dataset.platform=e,e==="copy"?s.append(this.#v(i.iconName,i.iconSet),this.#f(this.#o("copy"))):(s.setAttribute("aria-label",this.#o("shareOn").replace("{platform}",i.label)),s.append(this.#v(i.iconName,i.iconSet),this.#f(i.label))),this.#c.appendChild(s)}this.#c.addEventListener("click",this.#T),this.appendChild(this.#c),this.#h=!0}#A(){let t=document.createElement("div");return t.className="share-group",t.setAttribute("role","group"),t.setAttribute("aria-label",this.#o("sharePage")),t}#m(){let t=this.querySelector(".share-group, nav");if(t)this.#c=t;else{let e=this.#A();for(;this.firstChild;)e.appendChild(this.firstChild);this.appendChild(e),this.#c=e}this.#b(),this.#c.addEventListener("click",this.#T)}#b(){let{url:t,title:e,text:i}=this.#p();for(let s of this.querySelectorAll("a[data-platform]")){let n=this.#r.get(s);if(n==null){let o=s.getAttribute("href")||"";if(!zl.test(o))continue;n=o,this.#r.set(s,n)}s.setAttribute("href",n.replace(/\{url\}/g,encodeURIComponent(t)).replace(/\{title\}/g,encodeURIComponent(e)).replace(/\{text\}/g,encodeURIComponent(i)))}}#S=async()=>{await this.#x()};async#x(){let t=this.#p();this.dispatchEvent(new CustomEvent("share-wc:open",{detail:{platform:"native"},bubbles:!0}));try{if(navigator.canShare&&!navigator.canShare(t))throw new Error("Payload not shareable");return await navigator.share(t),this.dispatchEvent(new CustomEvent("share-wc:success",{detail:{platform:"native"},bubbles:!0})),!0}catch(e){return e?.name==="AbortError"?!1:(this.dispatchEvent(new CustomEvent("share-wc:error",{detail:{platform:"native",error:e},bubbles:!0})),this.#E(this.querySelector(":scope > .share-trigger")))}}#T=t=>{let e=t.target.closest("[data-platform]");if(!e)return;let i=e.dataset.platform;if(i==="copy"){e.tagName==="A"&&t.preventDefault(),this.#E(e);return}if(e.tagName==="A"||!i)return;let s=Ti.get(i);if(!s)return;this.dispatchEvent(new CustomEvent("share-wc:open",{detail:{platform:i},bubbles:!0}));let n=this.#p();if(i==="email")location.href=s.buildUrl(n);else if(i==="mastodon"){let o=this.getAttribute("mastodon-instance")||"mastodon.social",a=s.buildUrl(n,o);window.open(a,"_blank","noopener,noreferrer")}else window.open(s.buildUrl(n),"_blank","noopener,noreferrer");this.dispatchEvent(new CustomEvent("share-wc:success",{detail:{platform:i},bubbles:!0}))};async#E(t=null){let e=t?.isConnected?t:void 0;if(!await Mt(this.#t||"",{button:e,announceMessage:this.#o("linkCopied"),duration:2e3}))return this.dispatchEvent(new CustomEvent("share-wc:error",{detail:{platform:"copy"},bubbles:!0})),!1;this.dispatchEvent(new CustomEvent("share-wc:success",{detail:{platform:"copy"},bubbles:!0}));let s=e?.dataset.platform==="copy"?e.querySelector(".share-label"):null;if(!s)return!0;let n=s.dataset.original??s.textContent??"";return s.dataset.original=n,s.textContent=this.#o("copied"),this.#a&&clearTimeout(this.#a),this.#a=setTimeout(()=>{s.textContent=n,delete s.dataset.original,this.#a=null},2e3),!0}};g("share-wc",Li);var _i=class extends HTMLElement{static observedAttributes=["services","variant","color"]};g("social-links",_i);function It(r){let t=(Date.now()-r.getTime())/1e3;if(Number.isNaN(t)||t<0)return null;if(t<60)return"just now";if(t<3600){let i=Math.floor(t/60);return`${i} minute${i!==1?"s":""} ago`}if(t<86400){let i=Math.floor(t/3600);return`${i} hour${i!==1?"s":""} ago`}if(t<2592e3){let i=Math.floor(t/86400);return`${i} day${i!==1?"s":""} ago`}if(t<31536e3){let i=Math.floor(t/2592e3);return`${i} month${i!==1?"s":""} ago`}let e=Math.floor(t/31536e3);return`${e} year${e!==1?"s":""} ago`}function Br(r=document){for(let t of r.querySelectorAll("time[data-relative]")){if(t.closest("page-info"))continue;let e=t.getAttribute("datetime");if(!e)continue;let i=new Date(e),s=t.closest("[lang]")?.getAttribute("lang")||"",n=s&&!/^en\b/i.test(s)?Dl(i,s):It(i);n&&(t.textContent=n)}}function Dl(r,t){let e=(Date.now()-r.getTime())/1e3;if(Number.isNaN(e)||e<0)return null;let i;try{i=new Intl.RelativeTimeFormat(t,{numeric:"auto"})}catch{return It(r)}return e<60?i.format(0,"second"):e<3600?i.format(-Math.floor(e/60),"minute"):e<86400?i.format(-Math.floor(e/3600),"hour"):e<2592e3?i.format(-Math.floor(e/86400),"day"):e<31536e3?i.format(-Math.floor(e/2592e3),"month"):i.format(-Math.floor(e/31536e3),"year")}var Ri=typeof document<"u"?document.documentElement:null,Dr;function jr(){Br(),Dr||(Dr=setInterval(()=>Br(),6e4))}Ri&&!Ri.hasAttribute("data-vb-time-relative-init")&&(Ri.setAttribute("data-vb-time-relative-init",""),document.readyState==="loading"?document.addEventListener("DOMContentLoaded",jr,{once:!0}):jr());function Ni(r){let t=new Date(r);return`${t.getFullYear()}-${String(t.getMonth()+1).padStart(2,"0")}-${String(t.getDate()).padStart(2,"0")}`}function jl(r){let t=new Date(r),e=(t.getDay()+6)%7,i=new Date(t);i.setDate(t.getDate()-e);let s=new Date(i);s.setDate(i.getDate()+3);let n=new Date(s.getFullYear(),0,1),o=Math.ceil(((s.getTime()-n.getTime())/864e5+1)/7);return`${s.getFullYear()}-W${String(o).padStart(2,"0")}`}function Fl(r){let t=Ni(new Date),e=Ni(new Date(Date.now()-864e5));if(r===t)return"Today";if(r===e)return"Yesterday";let[i,s,n]=r.split("-").map(Number);return new Date(i,s-1,n).toLocaleDateString(void 0,{weekday:"long",month:"short",day:"numeric"})}function Fr(r){return r.nodeType===1&&r.matches("article[data-activity]")}function ql(r){return`Week of ${r.replace("-W",", week ")}`}var Hl='a[href], area[href], button:not([disabled]), input:not([disabled]):not([type="hidden"]), select:not([disabled]), textarea:not([disabled]), summary, iframe, [contenteditable=""], [contenteditable="true"], [tabindex]:not([tabindex="-1"])',Ul=0,$i=class extends b{static observedAttributes=["data-infinite"];#t=null;#e=null;#i=null;#s=null;#r=null;#n=`activity-feed-${++Ul}`;#a=0;#c=!1;#h=0;#l=!0;setup(){let t=this.getAttribute("role");return this.#l=t===null||t==="feed"||t==="group",!this.hasAttribute("aria-label")&&!this.hasAttribute("aria-labelledby")&&this.setAttribute("aria-label","Recent activity"),this.#c=!1,this.setAttribute("aria-busy","false"),this.#o().forEach(e=>this.#u(e)),this.hasAttribute("data-infinite")&&this.#x(),this.#f(),this.#m(),this.#t=new MutationObserver(e=>{let i=!1,s=!1;for(let n of e){for(let o of n.addedNodes)Fr(o)&&(this.#u(o),i=!0,s=!0);for(let o of n.removedNodes)Fr(o)&&(i=!0)}i&&(this.#f(),this.#m()),s&&this.#c&&this.#k()}),this.#t.observe(this,{childList:!0}),this.#s=setInterval(()=>this.#p(),6e4),this.listen(this,"keydown",this.#b),this.listen(this,"focusin",this.#A),!0}teardown(){this.#s!==null&&clearInterval(this.#s),this.#s=null,this.#t?.disconnect(),this.#t=null,this.#T(),this.#c=!1,this.setAttribute("aria-busy","false")}attributeChangedCallback(t,e,i){!this.hasAttribute("data-upgraded")||e===null==(i===null)||t==="data-infinite"&&(i!==null?this.#x():(this.#T(),this.#c&&this.#k()),this.#f())}#o(){return[...this.querySelectorAll(":scope > article[data-activity]")]}#u(t){if(t.dataset.decorated==="")return;t.dataset.decorated="",t.setAttribute("tabindex","-1");let e=`${this.#n}-e${++this.#a}`,i=t.querySelector(":scope > time[datetime]");i?.remove();let s=t.dataset.time||i?.getAttribute("datetime")||"";s&&!t.dataset.time&&(t.dataset.time=s);let n=document.createElement("div");for(n.className="activity-body",n.id=`${e}-body`;t.firstChild;)n.appendChild(t.firstChild);t.appendChild(n),!t.hasAttribute("aria-label")&&!t.hasAttribute("aria-labelledby")&&t.setAttribute("aria-labelledby",n.id);let o=t.dataset.activityAvatar,a=t.dataset.activityIcon;if(o||a){let l=document.createElement("div");if(l.className="activity-rail",l.setAttribute("aria-hidden","true"),o){let c=document.createElement("user-avatar"),h=document.createElement("img");h.src=o,h.alt="",h.loading="lazy",h.decoding="async",c.appendChild(h),l.appendChild(c)}else{let c=document.createElement("icon-wc");c.setAttribute("name",a||""),l.appendChild(c)}t.prepend(l)}if(s){let l=i||document.createElement("time");l.classList.add("activity-time"),l.setAttribute("datetime",s),l.id||(l.id=`${e}-time`),l.setAttribute("title",this.#d(s)),l.textContent=It(new Date(s))||l.textContent||s,t.appendChild(l)}}#p(){for(let t of this.querySelectorAll(":scope > article[data-activity] > time.activity-time")){let e=t.getAttribute("datetime");if(!e)continue;let i=It(new Date(e));i&&(t.textContent=i)}}#d(t){try{return new Date(t).toLocaleString()}catch{return t}}#f(){this.querySelectorAll(":scope > [data-activity-heading]").forEach(n=>n.remove());let t=this.#o(),e=this.#e?"-1":String(t.length),i=this.getAttribute("data-group")||"none",s=null;t.forEach((n,o)=>{n.setAttribute("aria-posinset",String(o+1)),n.setAttribute("aria-setsize",e);let a=[];if(i!=="none"&&n.dataset.time){let c=i==="week"?jl(n.dataset.time):Ni(n.dataset.time);if(c!==s){let h=document.createElement("h3");h.setAttribute("data-activity-heading",""),h.setAttribute("aria-hidden","true"),h.id=`${this.#n}-g-${c}`,h.className="activity-heading",h.textContent=i==="week"?ql(c):Fl(c),this.insertBefore(h,n),a.push(h.id),s=c}}let l=n.querySelector(":scope > time.activity-time");l?.id&&a.push(l.id),a.length?n.setAttribute("aria-describedby",a.join(" ")):n.removeAttribute("aria-describedby")}),this.#y(),this.#v()}#v(){let t=this.#e;t&&t.parentNode===this&&this.lastElementChild!==t&&this.appendChild(t)}#y(){let t=this.#o(),e=t.find(i=>i.getAttribute("tabindex")==="0")||t[0];for(let i of t)i.setAttribute("tabindex",i===e?"0":"-1")}#g(t){for(let e of this.#o())e.setAttribute("tabindex",e===t?"0":"-1")}#w(t){let i=(t instanceof Element?t:null)?.closest("article[data-activity]")??null;return i&&i.parentElement===this?i:null}#A=t=>{let e=this.#w(t.target);e&&e.getAttribute("tabindex")!=="0"&&this.#g(e)};#m(){let t=this.#o().length;t===0?this.#r||(this.#r=document.createElement("p"),this.#r.className="activity-empty",this.#r.textContent=this.getAttribute("data-empty-text")||"No recent activity",this.appendChild(this.#r),this.#v()):(this.#r?.remove(),this.#r=null),this.#l&&this.setAttribute("role",t===0?"group":"feed")}#b=t=>{let e=t.target;if(e.isContentEditable||e.matches?.("input, textarea, select"))return;let i=this.#o(),s=this.#w(t.target),n=s?i.indexOf(s):-1;if(n===-1)return;if(t.ctrlKey&&(t.key==="Home"||t.key==="End")){let l=this.#S(t.key==="Home"?"before":"after");l&&(t.preventDefault(),l.focus());return}if(t.altKey||t.ctrlKey||t.metaKey)return;let o=n;switch(t.key){case"PageDown":o=Math.min(i.length-1,n+1);break;case"PageUp":o=Math.max(0,n-1);break;default:return}t.preventDefault();let a=i[o];a&&(this.#g(a),a.focus())};#S(t){let e=[...document.querySelectorAll(Hl)].filter(s=>!this.contains(s)&&(s.checkVisibility?.()??!0));return t==="after"?e.find(s=>this.compareDocumentPosition(s)&Node.DOCUMENT_POSITION_FOLLOWING)||null:e.filter(s=>this.compareDocumentPosition(s)&Node.DOCUMENT_POSITION_PRECEDING).at(-1)||null}#x(){this.#e||!("IntersectionObserver"in window)||(this.querySelectorAll(":scope > .activity-sentinel").forEach(t=>t.remove()),this.#e=document.createElement("div"),this.#e.className="activity-sentinel",this.#e.setAttribute("aria-hidden","true"),this.appendChild(this.#e),this.#i=new IntersectionObserver(t=>{t.some(e=>e.isIntersecting)&&this.#E()},{rootMargin:"200px"}),this.#i.observe(this.#e))}#T(){this.#i?.disconnect(),this.#i=null,this.#e?.remove(),this.#e=null}#E(){if(this.#c)return;this.#c=!0,this.setAttribute("aria-busy","true");let t=++this.#h,e=()=>{this.#c&&t===this.#h&&this.#k()};this.dispatchEvent(new CustomEvent("activity-feed:load-more",{bubbles:!0,detail:{done:e}}))}#k(){this.#c=!1,this.setAttribute("aria-busy","false"),this.#i&&this.#e&&(this.#i.unobserve(this.#e),this.#i.observe(this.#e))}addEntry(t,e={}){let i=document.createElement("article");if(i.setAttribute("data-activity",""),i.dataset.time=t.time,t.avatar&&(i.dataset.activityAvatar=t.avatar),t.icon&&(i.dataset.activityIcon=t.icon),i.innerHTML=t.html,e.prepend){let s=this.#o()[0];s?this.insertBefore(i,s):this.appendChild(i)}else this.#e?this.insertBefore(i,this.#e):this.appendChild(i);return i}removeEntry(t){t?.matches?.("article[data-activity]")&&t.remove()}clear(){this.#o().forEach(t=>t.remove())}get entries(){return this.#o()}get loading(){return this.#c}};g("activity-feed",$i);var E=r=>r!==null&&typeof r=="object"&&!Array.isArray(r),M=r=>r==null?"":String(r),Vl=r=>M(r).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;");function q(r){if(typeof r!="string"||!r)return null;try{let t=new URL(r);return t.protocol==="https:"?t.href:null}catch{return null}}function Pi(r){if(typeof r!="string"||!r)return null;let t=new Date(r);return Number.isNaN(t.getTime())?null:t.toISOString()}var Hr=r=>M(r).trim().replace(/^#+/,"").toLowerCase();function Ii(r){let t=[];for(let e of r){let i=Hr(e);i&&!t.includes(i)&&t.push(i)}return t}var rt=r=>Number.isFinite(Number(r))?Number(r):0;function Oi({name:r,handle:t,avatar:e,url:i}){let s={name:M(r||t),handle:M(t)},n=q(e);n&&(s.avatar=n);let o=q(i);return o&&(s.url=o),s}function re(r,t){let e=q(r);return e?{url:e,alt:M(t)}:void 0}function zi({id:r,service:t,source:e,url:i,date:s,text:n,tags:o,reposted:a,author:l,image:c,counts:h,release:u}){let p=q(i);if(!p||!s)return null;let d={id:r,service:t,source:e,url:p,date:s,text:M(n),tags:o,reposted:!!a,author:l};return c&&(d.image=c),h&&(d.counts=h),u&&(d.release=u),d}function Ur(r){if(!E(r))return;let t=M(r.$type);if(t.startsWith("app.bsky.embed.external#view")&&E(r.external))return re(r.external.thumb,r.external.title);if(t.startsWith("app.bsky.embed.images#view")&&Array.isArray(r.images)&&E(r.images[0]))return re(r.images[0].thumb||r.images[0].fullsize,r.images[0].alt);if(t.startsWith("app.bsky.embed.recordWithMedia#view"))return Ur(r.media)}function Vr(r,t){let e=E(r)&&Array.isArray(r.feed)?r.feed:[],i=[];for(let n of e){if(!E(n)||!E(n.post))continue;let{post:o}=n,a=E(o.record)?o.record:{},l=E(n.reason)&&n.reason.$type==="app.bsky.feed.defs#reasonRepost";if(!l&&(a.reply||n.reply))continue;let c=E(o.author)?o.author:{},h=M(c.handle||c.did),u=M(o.uri).split("/").pop();if(!h||!u)continue;let p=(Array.isArray(a.facets)?a.facets:[]).flatMap(f=>E(f)&&Array.isArray(f.features)?f.features:[]).filter(f=>E(f)&&f.$type==="app.bsky.richtext.facet#tag").map(f=>f.tag),d=zi({id:`bluesky:${o.uri}`,service:"bluesky",source:t.key,url:`https://bsky.app/profile/${encodeURIComponent(h)}/post/${encodeURIComponent(u)}`,date:Pi(l?n.reason.indexedAt:a.createdAt||o.indexedAt),text:a.text,tags:Ii([...p,...Array.isArray(a.tags)?a.tags:[]]),reposted:l,author:Oi({name:c.displayName,handle:`@${h}`,avatar:c.avatar,url:`https://bsky.app/profile/${encodeURIComponent(h)}`}),image:Ur(o.embed),counts:{replies:rt(o.replyCount),reposts:rt(o.repostCount),likes:rt(o.likeCount)}});d&&i.push(d)}let s=E(r)&&typeof r.cursor=="string"&&r.cursor?r.cursor:null;return{items:i,cursor:s}}var Wl={amp:"&",lt:"<",gt:">",quot:'"',apos:"'",nbsp:"\xA0"};function Gl(r){return r.replace(/&(#[xX][0-9a-fA-F]+|#[0-9]+|[a-zA-Z]+);/g,(t,e)=>{if(e[0]==="#"){let s=e[1]==="x"||e[1]==="X"?parseInt(e.slice(2),16):parseInt(e.slice(1),10);return s>0&&s<=1114111?String.fromCodePoint(s):t}let i=Wl[e.toLowerCase()];return i===void 0?t:i})}function Kl(r){let t=M(r).replace(/<br\s*\/?>/gi,`
1316
+ `).replace(/<\/p>\s*<p(?:\s[^>]*)?>/gi,`
1317
+ `).replace(/<[^<>]*>/g,"");return Gl(t).trim()}function Yl(r){try{return new URL(r).host}catch{return""}}function Xl(r){let t=M(r.acct||r.username);if(!t)return"";if(t.includes("@"))return`@${t}`;let e=Yl(r.url);return e?`@${t}@${e}`:`@${t}`}function Jl(r){let t=(Array.isArray(r.media_attachments)?r.media_attachments:[]).find(e=>E(e)&&(e.type==="image"||e.type==="gifv"));if(t)return re(t.preview_url||t.url,t.description);if(E(r.card))return re(r.card.image,r.card.title)}function Wr(r,t){let e=Array.isArray(r)?r:[],i=[];for(let o of e){if(!E(o))continue;let a=E(o.reblog),l=a?o.reblog:o;if(!a&&o.in_reply_to_id)continue;let c=E(l.account)?l.account:{},h=zi({id:`mastodon:${l.uri||l.id}`,service:"mastodon",source:t.key,url:l.url||l.uri,date:Pi(o.created_at),text:Kl(l.content),tags:Ii((Array.isArray(l.tags)?l.tags:[]).map(u=>E(u)?u.name:u)),reposted:a,author:Oi({name:c.display_name||c.username,handle:Xl(c),avatar:c.avatar,url:c.url}),image:Jl(l),counts:{replies:rt(l.replies_count),reposts:rt(l.reblogs_count),likes:rt(l.favourites_count)}});h&&i.push(h)}let s=e[e.length-1],n=E(s)&&s.id!==void 0&&s.id!==null?String(s.id):null;return{items:i,cursor:n}}function Gr(r,t,e){if(!E(r)||r.draft||r.prerelease||r.id===void 0||r.id===null)return null;let i=M(r.tag_name),s=M(t&&t.name),n=E(r.author)?r.author:{},o=M(n.login||e.handle),a={repo:s,tag:i},l=q(t&&t.html_url);return l&&(a.repoUrl=l),a.description=t&&t.description!=null?M(t.description):null,a.language=t&&t.language!=null?M(t.language):null,zi({id:`github:${r.id}`,service:"github",source:e.key,url:r.html_url,date:Pi(r.published_at),text:`Released ${s} ${i}`,tags:[],reposted:!1,author:Oi({name:o,handle:o,avatar:n.avatar_url,url:n.html_url||(o?`https://github.com/${encodeURIComponent(o)}`:null)}),release:a})}function Kr(r,t,e){return(Array.isArray(r)?r:[]).map(i=>Gr(i,t,e)).filter(Boolean)}function Yr(r,t){let e=[];for(let i of Array.isArray(r)?r:[]){if(!E(i)||i.type!=="ReleaseEvent"||!E(i.payload)||i.payload.action!=="published"||!E(i.payload.release))continue;let s=M(E(i.repo)?i.repo.name:"");if(!s)continue;let n=E(i.actor)?i.actor:{},o=E(i.payload.release.author)||!n.login?i.payload.release:{...i.payload.release,author:{login:n.login,avatar_url:n.avatar_url}},a={name:s.split("/").pop(),html_url:`https://github.com/${s.split("/").map(encodeURIComponent).join("/")}`,description:null,language:null},l=Gr(o,a,t);l&&e.push(l)}return e}function Bi(r,t){let e=Ii(Array.isArray(t)?t:[]);if(!e.length)return!0;let i=E(r)&&Array.isArray(r.tags)?r.tags.map(Hr):[];return e.some(s=>i.includes(s))}function Xr(r,{tags:t,limit:e}={}){let i=(Array.isArray(r)?r:[]).flatMap(o=>Array.isArray(o)?o:[]).filter(o=>E(o)&&q(o.url)&&Bi(o,t));i.sort((o,a)=>o.date!==a.date?o.date<a.date?1:-1:o.id<a.id?-1:o.id>a.id?1:0);let s=new Set,n=[];for(let o of i)s.has(o.id)||(s.add(o.id),n.push(o));return Number.isInteger(e)&&e>0?n.slice(0,e):n}var Zl=new Intl.DateTimeFormat("en",{dateStyle:"medium",timeZone:"UTC"});function Ql(r){let t=new Date(r);return Number.isNaN(t.getTime())?"":Zl.format(t)}var qr={mastodon:["replies","boosts","favourites"],default:["replies","reposts","likes"]};function tc(r){let t=qr[r.service]||qr.default,e=r.counts,i=[e.replies,e.reposts,e.likes];return`<ul class="social-feed-counts">${["\u21A9","\u27F2","\u2661"].map((o,a)=>`<li><span aria-hidden="true">${o}</span> ${rt(i[a])}<span class="visually-hidden"> ${t[a]}</span></li>`).join("")}</ul>`}function Jr(r,{hideCounts:t=!1,serviceName:e}={}){if(!E(r))return"";let i=q(r.url);if(!i)return"";let s=Vl,n=E(r.author)?r.author:{},o=[`<article data-activity data-id="${s(r.id)}" data-service="${s(r.service)}">`],a=q(n.avatar);a&&o.push(`<img class="social-feed-avatar" src="${s(a)}" alt="" width="40" height="40" loading="lazy">`),o.push(`<header class="social-feed-head"><b>${s(n.name||n.handle)}</b> <span class="social-feed-handle">${s(n.handle)}</span> <a class="social-feed-permalink" href="${s(i)}"><time datetime="${s(r.date)}">${s(Ql(r.date))}</time></a> <span class="social-feed-source">${s(e||r.service)}</span></header>`),r.reposted&&o.push('<p class="social-feed-reposted">Reposted</p>'),o.push(`<p class="social-feed-text">${s(r.text).replace(/\r?\n/g,"<br>")}</p>`);let l=E(r.image)?q(r.image.url):null;if(l&&o.push(`<a class="social-feed-image" href="${s(i)}"><img src="${s(l)}" alt="${s(r.image.alt)}" loading="lazy"></a>`),E(r.release)){let c=r.release,h=q(c.repoUrl),u=h?` href="${s(h)}"`:"";o.push(`<div class="social-feed-release"><a${u}>${s(c.repo)}</a> <span>${s(c.description)}</span> <span>${s(c.language)}</span></div>`)}return!t&&E(r.counts)&&o.push(tc(r)),o.push("</article>"),o.join(`
1318
+ `)}var ec=3,ic=10;async function mt(r,{fetch:t,timeoutMs:e=5e3,headers:i}){let s=new AbortController,n,o=new Promise((l,c)=>{n=setTimeout(()=>{s.abort(),c(new Error(`Timed out after ${e} ms: ${r}`))},e)}),a=(async()=>{let l;try{l=await t(r,{headers:i,signal:s.signal})}catch(c){throw new Error(`Request failed for ${r}: ${c&&c.message?c.message:c}`)}if(!l||!l.ok)throw new Error(`HTTP ${l?l.status:"error"} for ${r}`);try{return await l.json()}catch{throw new Error(`Bad JSON from ${r}`)}})();a.catch(()=>{});try{return await Promise.race([a,o])}finally{clearTimeout(n)}}var gt=(r,t)=>{if(!r)throw new Error(`Unexpected response shape from ${t}`)};function sc(r){let[t,e]=String(r).replace(/^@/,"").split("@");return{user:t,instance:e}}async function rc(r,t){let e=r.did||r.handle,i=`https://public.api.bsky.app/xrpc/app.bsky.feed.getAuthorFeed?actor=${encodeURIComponent(e)}&filter=posts_no_replies&limit=30`;t.cursor&&(i+=`&cursor=${encodeURIComponent(t.cursor)}`);let s=await mt(i,t);gt(s&&typeof s=="object"&&Array.isArray(s.feed),i);let{items:n,cursor:o}=Vr(s,r);return{items:n,cursor:o,done:!o}}async function nc(r,t){let{user:e,instance:i}=sc(r.handle);if(!e||!i)throw new Error(`Bad Mastodon handle: ${r.handle}`);if(!r.mastodonId){let l=`https://${i}/api/v1/accounts/lookup?acct=${encodeURIComponent(e)}`,c=await mt(l,t);gt(c&&c.id!==void 0&&c.id!==null&&c.id!=="",l),r.mastodonId=String(c.id)}let s=`https://${i}/api/v1/accounts/${encodeURIComponent(r.mastodonId)}/statuses?exclude_replies=true&limit=40`;t.cursor&&(s+=`&max_id=${encodeURIComponent(t.cursor)}`);let n=await mt(s,t);gt(Array.isArray(n),s);let{items:o,cursor:a}=Wr(n,r);return{items:o,cursor:a,done:!a}}async function oc(r,t){let e=encodeURIComponent(r.handle),i={...t.headers||{}};t.token&&t.mode!=="browser"&&(i.Authorization=`Bearer ${t.token}`);let s={...t,headers:i};if(t.mode==="browser"){let c=`https://api.github.com/users/${e}/events/public?per_page=30`,h=await mt(c,s);return gt(Array.isArray(h),c),{items:Yr(h,r),cursor:null,done:!0}}let n=`https://api.github.com/users/${e}/repos?sort=pushed&per_page=10`,o=await mt(n,s);gt(Array.isArray(o),n);let a=o.filter(c=>c&&typeof c=="object"&&!c.fork&&!c.archived&&c.name).slice(0,ic);return{items:(await Promise.all(a.map(async c=>{let h=`https://api.github.com/repos/${e}/${encodeURIComponent(c.name)}/releases?per_page=5`,u=await mt(h,s);return gt(Array.isArray(u),h),Kr(u,c,r)}))).flat(),cursor:null,done:!0}}async function Di(r,{fetch:t,cursor:e,timeoutMs:i=5e3,token:s,mode:n="build",headers:o}={}){if(typeof t!="function")throw new Error("fetchAccountPage needs a fetch function");let a={fetch:t,cursor:e,timeoutMs:i,token:s,mode:n,headers:o};switch(r.service){case"bluesky":return rc(r,a);case"mastodon":return nc(r,a);case"github":return oc(r,a);default:throw new Error(`No feed for service: ${r.service}`)}}async function Zr(r,{fetch:t,tags:e,want:i=12,token:s,mode:n="build",cursor:o=null,timeoutMs:a,headers:l}={}){let c=[],h=0,u=o,p=!1;for(let d=0;d<ec&&!p;d++){let f=await Di(r,{fetch:t,cursor:u,token:s,mode:n,timeoutMs:a,headers:l});if(c.push(...f.items),h+=f.items.filter(m=>Bi(m,e)).length,u=f.cursor,p=f.done,h>=i)break}return{items:c,cursor:u,done:p}}var ac={bluesky:"Bluesky",mastodon:"Mastodon",github:"GitHub"},lc=/^\d+(\.\d+)?(rem|em|px|vh)$/,cc=12,ne=r=>r!==null&&typeof r=="object"&&!Array.isArray(r),Ot=r=>typeof r=="string"&&Date.parse(r)||0,hc=(r,t)=>Ot(t.date)-Ot(r.date),Qr=(r,t)=>globalThis.fetch(r,t);function uc(r){let t=r.querySelector(":scope > script.social-feed-state");if(!t)return null;let e;try{e=JSON.parse(t.textContent||"")}catch{return null}if(!ne(e))return null;let i=(Array.isArray(e.accounts)?e.accounts:[]).filter(o=>ne(o)&&typeof o.key=="string"&&typeof o.service=="string"&&typeof o.handle=="string").map(o=>{let a={key:o.key,service:o.service,handle:o.handle,done:o.done===!0};return typeof o.did=="string"&&o.did&&(a.did=o.did),typeof o.cursor=="string"&&o.cursor&&(a.cursor=o.cursor),a}),s=(Array.isArray(e.tags)?e.tags:[]).filter(o=>typeof o=="string"),n=(Array.isArray(e.buffer)?e.buffer:[]).filter(o=>ne(o)&&typeof o.id=="string");return{accounts:i,tags:s,buffer:n}}var ji=class extends b{static observedAttributes=["accounts","tags","items","height","hide-counts"];#t=null;#e=Promise.resolve();#i=null;setup(){return document.readyState==="loading"&&!this.querySelector(":scope > script.social-feed-state")?this.listen(document,"DOMContentLoaded",()=>this.#s(),{once:!0}):this.#s(),this.listen(this,"activity-feed:load-more",this.#y),!0}teardown(){}attributeChangedCallback(t,e,i){t==="height"&&e!==i&&this.#r()}get refreshed(){return this.#i||Promise.resolve()}#s(){this.#r();let t=this.#n();t&&!t.hasAttribute("tabindex")&&t.setAttribute("tabindex","0"),this.#t||(this.#t=uc(this)),this.#t&&t&&!this.#i&&(this.#i=this.#c(()=>this.#v()))}#r(){let t=(this.getAttribute("height")||"").trim();lc.test(t)&&this.style.setProperty("--social-feed-height",t)}#n(){return this.querySelector(":scope > activity-feed")}#a(){let t=(this.getAttribute("items")||"").trim(),e=/^\d+$/.test(t)?Number(t):NaN;return e>=1&&e<=50?e:cc}#c(t){let e=this.#e.then(t).catch(()=>{});return this.#e=e,e}#h(){let t=new Map,e=this.#n();if(!e)return t;for(let i of e.querySelectorAll(":scope > article[data-activity][data-id]"))t.set(i.getAttribute("data-id"),i);return t}#l(t){return Ot(t.querySelector("time[datetime]")?.getAttribute("datetime"))}#o(t,e){let i=Jr(t,{hideCounts:e,serviceName:ac[t.service]||t.service});if(!i)return null;let s=document.createElement("template");return s.innerHTML=i,s.content.firstElementChild}#u(t){let e=this.#n(),i=e&&this.#o(t,this.hasAttribute("hide-counts"));if(!e||!i)return!1;let s=Ot(t.date),n=[...e.querySelectorAll(":scope > article[data-activity]")],o=n.find(a=>this.#l(a)<s);return o?e.insertBefore(i,o):n.length?n[n.length-1].after(i):e.prepend(i),!0}#p(t,e){if(this.hasAttribute("hide-counts")||!ne(e.counts))return;let i=this.#o(e,!1)?.querySelector(".social-feed-counts");if(!i)return;let s=t.querySelector(".social-feed-counts");s?s.replaceWith(i):(t.querySelector(":scope > .activity-body")||t).append(i)}#d(t,e){let i=this.#t?.tags||[];return Xr(t,{tags:i}).filter(s=>typeof s.id=="string"&&!e.has(s.id)).sort(hc)}#f(){let t=this.#n(),e=this.#t;if(!t||!e)return;let i=!!t.querySelector(":scope > article[data-activity]");i&&this.querySelector(":scope > .social-feed-empty")?.remove(),!(e.buffer.length>0||e.accounts.some(n=>!n.done))||!i?t.removeAttribute("data-infinite"):t.hasAttribute("data-infinite")||t.setAttribute("data-infinite","")}async#v(){let t=this.#t;if(!t)return;let e=await Promise.all(t.accounts.map(async c=>{try{let h=await Di(c,{fetch:Qr,mode:"browser"});return!c.cursor&&!c.done&&(h.cursor&&(c.cursor=h.cursor),c.done=h.done),h.items}catch{return c.done=!0,[]}})),i=this.#h();for(let c of e)for(let h of c){let u=i.get(h.id);u&&this.#p(u,h)}let s=this.#d(e,i),n=[...i.values()].map(c=>this.#l(c)),o=n.length?Math.min(...n):null,a=o===null?s.slice(0,this.#a()):s.filter(c=>Ot(c.date)>o),l=new Set(a.map(c=>c.id));for(let c of a)this.#u(c);t.buffer=this.#d([s.filter(c=>!l.has(c.id)),t.buffer],this.#h()),this.#f()}#y=t=>{let e=t.detail?.done;this.#c(()=>this.#g()).finally(()=>{typeof e=="function"&&e()})};async#g(){let t=this.#t;if(!t){this.#n()?.removeAttribute("data-infinite");return}let e=this.#a(),i=this.#d([t.buffer],this.#h()),s=i.slice(0,e);i=i.slice(e);let n=e-s.length;if(n>0){let o=t.tags,a=await Promise.all(t.accounts.filter(h=>!h.done).map(async h=>{try{let u=await Zr(h,{fetch:Qr,tags:o,want:n,mode:"browser",cursor:h.cursor||null});return u.cursor?h.cursor=u.cursor:delete h.cursor,h.done=u.done,u.items}catch{return h.done=!0,[]}})),l=new Set(s.map(h=>h.id)),c=this.#d([...a,i],this.#h()).filter(h=>!l.has(h.id));s.push(...c.slice(0,n)),i=c.slice(n)}for(let o of s)this.#u(o);t.buffer=i,this.#f()}};g("social-feed",ji);var dc="Home",pc="Show full path",Fi=":scope > ol > li:not([data-crumb-toggle])",fc=4;function tn(r){try{return decodeURIComponent(r)}catch{return r}}var qi=class extends b{#t={};#e=!1;#i=!1;static get observedAttributes(){return["data-collapsed"]}setup(){this.#s(),this.hasAttribute("data-from-pathname")?this.#r():this.#a(),this.#c(),this.#h(),this.#l(),this.listen(this,"click",t=>{let i=(t.target instanceof Element?t.target:null)?.closest("[data-crumb-toggle] > button");if(!i||!this.contains(i))return;let s=i.getAttribute("aria-expanded")!=="true";i.setAttribute("aria-expanded",String(s)),this.dispatchEvent(new CustomEvent("bread-crumb:toggle",{bubbles:!0,detail:{expanded:s}}))})}attributeChangedCallback(t,e,i){e===i||!this.hasAttribute("data-upgraded")||t==="data-collapsed"&&this.#h()}get labels(){return{...this.#t}}set labels(t){!t||typeof t!="object"||(this.#t={...t},this.isConnected&&this.hasAttribute("data-from-pathname")&&(this.#r(),this.#c(),this.#h(),this.#l()))}#s(){if(!!this.parentElement?.closest('nav, [role="navigation"]')){this.#e&&this.removeAttribute("role"),this.#i&&this.removeAttribute("aria-label"),this.#e=!1,this.#i=!1;return}this.hasAttribute("role")||(this.setAttribute("role","navigation"),this.#e=!0),!this.hasAttribute("aria-label")&&!this.hasAttribute("aria-labelledby")&&(this.setAttribute("aria-label","Breadcrumb"),this.#i=!0)}#r(){let e=window.location.pathname.split("/").filter(Boolean),i=document.createElement("ol"),s=document.createElement("li"),n=document.createElement("a");n.href="/",n.textContent=this.#t["/"]||this.#t.home||dc,s.appendChild(n),i.appendChild(s);let o=this.dataset.currentLabel,a="";e.forEach((c,h)=>{a+=`/${c}`;let u=h===e.length-1,p=document.createElement("li"),d=`${a}/`,f=tn(c),m=u&&o||this.#t[d]||this.#t[a]||this.#t[tn(d)]||this.#t[f]||this.#t[c]||this.#n(f);if(u){let y=document.createElement("span");y.setAttribute("aria-current","page"),y.textContent=m,p.appendChild(y)}else{let y=document.createElement("a");y.href=d,y.textContent=m,p.appendChild(y)}i.appendChild(p)});let l=this.querySelector(":scope > ol");l?l.replaceWith(i):this.prepend(i)}#n(t){return t.replace(/[-_]+/g," ").replace(/\S+/g,e=>e[0].toUpperCase()+e.slice(1))}#a(){if(this.querySelector(":scope > ol"))return;let e=Array.from(this.querySelectorAll(":scope > a, :scope > span"));if(e.length===0)return;let i=document.createElement("ol");e.forEach(s=>{let n=document.createElement("li");n.appendChild(s),i.appendChild(n)}),this.prepend(i)}#c(){let t=this.querySelectorAll(Fi);t.length!==0&&t.forEach((e,i)=>{let s=i===t.length-1,n=e.querySelector("a, span");n&&(s?n.setAttribute("aria-current","page"):n.removeAttribute("aria-current"))})}#h(){let t=this.querySelector(":scope > ol"),e=t?.querySelector(":scope > li[data-crumb-toggle]"),i=this.querySelectorAll(Fi);if(!(!!t&&this.hasAttribute("data-collapsed")&&i.length>=fc)){e?.remove();return}let n=e||document.createElement("li");if(!e){n.setAttribute("data-crumb-toggle","");let o=document.createElement("button");o.type="button",o.setAttribute("aria-expanded","false"),o.setAttribute("aria-label",pc),o.textContent="\u2026",n.appendChild(o)}i[0].nextElementSibling!==n&&i[0].after(n)}#l(){if(this.dataset.jsonld==="off")return;let t=Array.from(this.querySelectorAll(Fi));if(t.length===0)return;let i={"@context":"https://schema.org","@type":"BreadcrumbList",itemListElement:t.map((n,o)=>{let a=n.querySelector("a, span"),l=a?.textContent?.trim()||"",c=a instanceof HTMLAnchorElement&&a.hasAttribute("href")?a.href:void 0;return{"@type":"ListItem",position:o+1,name:l,...c?{item:c}:{}}})},s=this.querySelector(':scope > script[type="application/ld+json"]');s||(s=document.createElement("script"),s.type="application/ld+json",this.appendChild(s)),s.textContent=JSON.stringify(i)}};g("bread-crumb",qi);var en=r=>r.replace(/\s+/g,""),mc=r=>r.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");function gc(r,t){let e=0;for(;e<r.length&&e<t.length&&r[r.length-1-e]===t[t.length-1-e];)e++;return e}function bc(r,t){let e=0;for(;e<r.length&&e<t.length&&r[e]===t[e];)e++;return e}function oe(r,t,e){return{prefix:r.slice(Math.max(0,t-32),t),suffix:r.slice(e,e+32)}}function sn(r,t){let e=en(t.text??"");if(!e)return null;if(t.endOffset<=r.length&&en(r.slice(t.startOffset,t.endOffset))===e)return{start:t.startOffset,end:t.endOffset};let i=new RegExp(t.text.trim().split(/\s+/).map(mc).join("\\s*"),"g"),s=t.prefix??"",n=t.suffix??"",o=null,a=-1,l=1/0;for(let c of r.matchAll(i)){let h=c.index,u=h+c[0].length,p=oe(r,h,u),d=gc(p.prefix,s)+bc(p.suffix,n),f=Math.abs(h-t.startOffset);(d>a||d===a&&f<l)&&(o={start:h,end:u},a=d,l=f)}return o}var Ui="[data-highlights]",nn="highlights",yc=["yellow","green","blue","pink"];var vc=typeof CSS<"u"&&"highlights"in CSS,ce=new WeakMap;function on(r){let t=2166136261;for(let e=0;e<r.length;e++)t^=r.charCodeAt(e),t=Math.imul(t,16777619);return(t>>>0).toString(36)}function un(){return"hn-"+crypto.randomUUID().slice(0,8)}var wc=/^[a-z0-9_-]+$/i,an=["solid","double","dotted","dashed","wavy"],Ac={annotation:"You highlighted",added:"Highlight added",removed:"Highlight removed",noteSaved:"Note saved"};function ae(r,t){let e="highlightsLabel"+t[0].toUpperCase()+t.slice(1);return r.dataset[e]||Ac[t]}function kc(r,{textLength:t,colors:e}){if(!r||typeof r!="object")return null;let i=r,{startOffset:s,endOffset:n,color:o}=i;if(!Number.isInteger(s)||!Number.isInteger(n))return null;let a=s,l=n;return a<0||l<=a||l>t||!Vi(o)||!e.includes(o)||i.id!=null&&(typeof i.id!="string"||!/^[\w-]{1,64}$/.test(i.id))||i.text!=null&&typeof i.text!="string"||i.note!=null&&typeof i.note!="string"||i.prefix!=null&&typeof i.prefix!="string"||i.suffix!=null&&typeof i.suffix!="string"?null:{id:i.id||un(),startOffset:a,endOffset:l,text:i.text??"",prefix:(i.prefix??"").slice(-32),suffix:(i.suffix??"").slice(0,32),color:o,note:i.note??"",created:Number.isFinite(i.created)?i.created:Date.now()}}function Vi(r){return typeof r=="string"&&wc.test(r)}var nt=null,ot=new Map,zt=new Map;function dn(){if(ot.size===0){nt&&(document.adoptedStyleSheets=document.adoptedStyleSheets.filter(i=>i!==nt),nt=null);return}nt||(nt=new CSSStyleSheet,document.adoptedStyleSheets=[...document.adoptedStyleSheets,nt]);let r=[...ot.keys()],t=r.map(i=>`::highlight(hn-${i}) { background-color: var(--highlight-${i}); color: var(--highlight-${i}-ink, var(--highlight-ink, CanvasText)); text-decoration-line: underline; text-decoration-color: var(--highlight-${i}); text-underline-offset: 2px; }`),e=r.map((i,s)=>`::highlight(hn-${i}) { background-color: Mark; color: MarkText; text-decoration-line: underline; text-decoration-color: MarkText; text-decoration-style: ${an[s%an.length]}; text-decoration-thickness: 2px; }`);nt.replaceSync(`${t.join(`
1316
1319
  `)}
1317
1320
  @media (forced-colors: active) {
1318
1321
  ${e.join(`
1319
1322
  `)}
1320
- }`)}function fl(r){for(let t of r)it.set(t,(it.get(t)??0)+1);Mr()}function ml(r){for(let t of r){let e=(it.get(t)??0)-1;e>0?it.set(t,e):it.delete(t)}Mr()}function gl(r){let t=Mt.get(r),e=t?[...t.values()].flat():[];e.length===0?(CSS.highlights.delete(`hn-${r}`),Mt.delete(r)):CSS.highlights.set(`hn-${r}`,new Highlight(...e))}function Sr(r,t){let e=new Set(t.keys());for(let[i,s]of Mt)s.has(r)&&e.add(i);for(let i of e){let s=t.get(i)??[],n=Mt.get(i);s.length?(n||Mt.set(i,n=new Map),n.set(r,s)):n?.delete(r),gl(i)}}function Ti(r){return document.createTreeWalker(r,NodeFilter.SHOW_TEXT,t=>t.parentElement?.closest(".hn-margin-annotation")?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT)}function Zt(r){let t=Ti(r),e="";for(;t.nextNode();)e+=t.currentNode.textContent??"";return e}function Cr(r,t,e){let i=Ti(r),s=0;for(;i.nextNode();){if(i.currentNode===t)return s+e;s+=(i.currentNode.textContent??"").length}return-1}function xi(r,t,e){let i=Ti(r),s=0,n=null,o=0,a=null,l=0;for(;i.nextNode();){let c=i.currentNode,h=(c.textContent??"").length;if(!n&&s+h>t&&(n=c,o=t-s),s+h>=e){a=c,l=e-s;break}s+=h}if(!n||!a)return null;try{let c=document.createRange();return c.setStart(n,Math.min(o,(n.textContent??"").length)),c.setEnd(a,Math.min(l,(a.textContent??"").length)),c}catch{return null}}var Ci=class{#t;#e;#i;#s;#r=[];#n=[];#a=!hl;#c;#h;#l=!1;#o=[];#u=new Map;constructor(t){this.#t=t,this.#s=t.hasAttribute("data-highlights-readonly");let e=t.dataset.highlights;this.#e=e&&e!==""?e:location.pathname;let i=t.dataset.highlightsColors,s=i?i.split(",").map(n=>n.trim()).filter(Si):[...cl];this.#i=[...new Set(s)],this.#a||fl(this.#i),this.#b(),this.#s||(this.#c=this.#d.bind(this),this.#h=this.#f.bind(this),t.addEventListener("pointerup",this.#c),t.addEventListener("click",this.#h)),t.setAttribute("data-highlights-init",""),this.#y().then(()=>{this.#l||(this.#b(),this.#w())})}get colors(){return[...this.#i]}get destroyed(){return this.#l}get element(){return this.#t}getHighlights(){return this.#r.map(t=>({...t}))}getUnplaced(){return this.#n.map(t=>({...t}))}removeHighlight(t){let e=this.#r.findIndex(s=>s.id===t),i=this.#n.findIndex(s=>s.id===t);e<0&&i<0||(e>=0?this.#r.splice(e,1):this.#n.splice(i,1),this.#m(),this.#b(),this.#A("highlights:removed",{id:t}),V(Jt(this.#t,"removed")))}clearAll(){this.#r=[],this.#n=[],this.#m(),this.#b()}exportHighlights(){return JSON.stringify({version:1,highlights:this.#r})}importHighlights(t){let e;try{e=typeof t=="string"?JSON.parse(t):t}catch{return{imported:0,rejected:0}}if(!e||!Array.isArray(e.highlights))return{imported:0,rejected:0};let i=this.#p(e.highlights);return this.#r=i,this.#n=[],this.#m(),this.#b(),{imported:i.length,rejected:e.highlights.length-i.length}}#p(t,e=Zt(this.#t).length){let i={textLength:e,colors:this.#i},s=new Set,n=[];for(let o of t){let a=pl(o,i);!a||s.has(a.id)||(s.add(a.id),n.push(a))}return n}destroy(){this.#l||(this.#l=!0,this.#c&&this.#t.removeEventListener("pointerup",this.#c),this.#h&&this.#t.removeEventListener("click",this.#h),this.#a?this.#t.querySelectorAll("mark[data-hn-id]").forEach(t=>{let e=t.parentNode;for(;t.firstChild;)e.insertBefore(t.firstChild,t);e.removeChild(t),e.normalize()}):(Sr(this,new Map),ml(this.#i)),this.#L(),this.#u.clear(),this.#t.removeAttribute("data-highlights-init"),Qt.get(this.#t)===this&&Qt.delete(this.#t))}#d(){requestAnimationFrame(()=>{if(this.#l)return;let t=window.getSelection();if(!t||t.isCollapsed||!t.toString().trim())return;let e=t.getRangeAt(0);this.#t.contains(e.commonAncestorContainer)&&this.#A("highlights:selected",{text:t.toString().trim(),rect:e.getBoundingClientRect()})})}#f(t){let e=t.target.closest?.(".hn-margin-annotation");if(e){let s=e.dataset.hnId,n=this.#r.find(o=>o.id===s);if(n){this.#A("highlights:clicked",{id:s,highlight:{...n}}),this.#A("highlights:request-note",{id:s,highlight:{...n},controller:this});return}}let i=t.target.closest?.("mark[data-hn-id]");if(i){let s=i.dataset.hnId,n=this.#r.find(o=>o.id===s);if(n){this.#A("highlights:clicked",{id:s,highlight:{...n}});return}}if(!this.#a){let s=this.#g(t.clientX,t.clientY);s&&this.#A("highlights:clicked",{id:s.id,highlight:{...s}})}}findHighlightRect(t){let e=this.#r.find(n=>n.id===t);if(!e)return null;let i=this.#k(e);if(!i)return null;let s=i.getClientRects();return s.length?s[0]:null}#k(t){return this.#u.get(t.id)??xi(this.#t,t.startOffset,t.endOffset)}#v(){this.#u.clear();for(let t of this.#r){let e=xi(this.#t,t.startOffset,t.endOffset);e&&this.#u.set(t.id,e)}}#g(t,e){for(let i of this.#r){let s=this.#u.get(i.id);if(!s)continue;let n=s.getClientRects();for(let o of n)if(t>=o.left&&t<=o.right&&e>=o.top&&e<=o.bottom)return i}return null}_createFromSelection(t){let e=window.getSelection();if(!e||e.isCollapsed)return;let i=e.getRangeAt(0);if(!this.#t.contains(i.commonAncestorContainer))return;let s=Cr(this.#t,i.startContainer,i.startOffset),n=Cr(this.#t,i.endContainer,i.endOffset);if(s<0||n<0||s>=n)return;let o=e.toString().trim(),a={id:Lr(),startOffset:s,endOffset:n,text:o,...Yt(Zt(this.#t),s,n),color:t,note:"",created:Date.now()};this.#r.push(a),this.#m(),this.#b(),e.removeAllRanges(),this.#A("highlights:added",{id:a.id,text:o,color:t,note:""}),V(Jt(this.#t,"added"))}_changeColor(t,e){let i=this.#r.find(s=>s.id===t);i&&(i.color=e,this.#m(),this.#b())}_updateNote(t,e){let i=this.#r.find(s=>s.id===t);i&&(i.note=e,this.#m(),this.#E(),this.#A("highlights:note-changed",{id:t,note:e}),V(Jt(this.#t,"noteSaved")))}async#y(){let t=await R.get(Ar,this.#e);if(!t||!Array.isArray(t.highlights)||this.#l)return;let e=Array.isArray(t.unplaced)?t.unplaced:[],i=this.#p([...t.highlights,...e],1/0),s=Zt(this.#t);if(e.length===0&&t.contentHash===xr(s)){this.#r=i;return}this.#r=[],this.#n=[];for(let n of i){let o=wr(s,n);o?this.#r.push({...n,startOffset:o.start,endOffset:o.end,...Yt(s,o.start,o.end)}):this.#n.push(n)}this.#m()}#w(){this.#n.length!==0&&(console.warn(`[highlights] ${this.#n.length} stored highlight(s) could not be found in the current text. They are kept in storage.`,this.#t),this.#A("highlights:unplaced",{highlights:this.getUnplaced()}))}#m(){let t={version:1,contentHash:xr(Zt(this.#t)),highlights:this.#r,...this.#n.length?{unplaced:this.#n}:{}};R.set(Ar,this.#e,t).catch(()=>{})}#b(){this.#a?(this.#x(),this.#v()):(this.#v(),this.#C()),this.#E()}#C(){let t=new Map;for(let e of this.#i)t.set(e,[]);for(let e of this.#r){let i=this.#u.get(e.id);i&&t.has(e.color)&&t.get(e.color).push(i)}Sr(this,t)}#x(){this.#t.querySelectorAll("mark[data-hn-id]").forEach(e=>{let i=e.parentNode;for(;e.firstChild;)i.insertBefore(e.firstChild,e);i.removeChild(e)}),this.#t.normalize();let t=[...this.#r].sort((e,i)=>i.startOffset-e.startOffset);for(let e of t){let i=xi(this.#t,e.startOffset,e.endOffset);if(!i)continue;let s=document.createElement("mark");s.dataset.hnId=e.id,Si(e.color)&&(s.dataset.hnColor=e.color,s.style.setProperty("--_hn-color",`var(--highlight-${e.color})`),s.style.setProperty("--_hn-ink",`var(--highlight-${e.color}-ink, var(--highlight-ink))`));try{i.surroundContents(s)}catch{let n=i.extractContents();s.appendChild(n),i.insertNode(s)}}}#L(){for(let t of this.#o)t.remove();this.#o=[]}#E(){if(this.#L(),this.#r.length===0)return;getComputedStyle(this.#t).position==="static"&&(this.#t.style.position="relative");let e=this.#t.getBoundingClientRect(),i=Jt(this.#t,"annotation");for(let s of this.#r){let n=this.#u.get(s.id);if(!n)continue;let o=n.getClientRects();if(o.length===0)continue;let a=o[0].top-e.top,l=document.createElement("span");if(l.className="hn-margin-annotation",l.dataset.hnId=s.id,l.setAttribute("aria-hidden","true"),l.style.insetBlockStart=`${a}px`,s.note){let c=document.createElement("span");c.className="hn-note-indicator",c.textContent="*",l.append(c,` ${i}`),l.classList.add("hn-has-note")}else l.textContent=i;this.#t.appendChild(l),this.#o.push(l)}}#A(t,e={}){this.#t.dispatchEvent(new CustomEvent(t,{detail:e,bubbles:!0}))}};function U(r){let t=Qt.get(r);if(t&&!t.destroyed)return t;let e=new Ci(r);return Qt.set(r,e),e}function Tr(r=document){r.querySelectorAll(Ei).forEach(t=>{t.hasAttribute("data-highlights-init")||U(t)})}document.readyState==="loading"?document.addEventListener("DOMContentLoaded",()=>Tr()):Tr();var bl=new MutationObserver(r=>{for(let t of r)for(let e of t.addedNodes){if(e.nodeType!==Node.ELEMENT_NODE)continue;let i=e;i.matches(Ei)&&U(i),i.querySelectorAll(Ei).forEach(s=>{s.hasAttribute("data-highlights-init")||U(s)})}});bl.observe(document.documentElement,{childList:!0,subtree:!0});var vl=["yellow","green","blue","pink"],yl=/^[a-z0-9_-]+$/i,wl=["annotation","added","removed"],kl=0,Li=class extends v{#t=null;#e=null;#i="yellow";#s=null;#r=null;#n=!1;#a=null;setup(){this.#s=this.closest("selection-menu");let t=this.#v();t.includes(this.#i)||(this.#i=t[0]??"yellow"),this.#s?this.#c():this.#f()}teardown(){this.#t?.destroy(),this.#t=null,this.#a?.remove(),this.#a=null,this.#n?this.#r?.remove():this.#r?.removeAttribute("aria-expanded"),this.#r=null,this.#n=!1,this.#s=null}#c(){let t=this.hasAttribute("readonly");for(let n of this.#p())this.#d(n);if(t)return;let e=this.#v(),i=this.querySelector(":scope > button");if(this.#n=!i,!i){i=document.createElement("button"),i.type="button",i.setAttribute("aria-label",this.dataset.labelButton||"Highlight selection");let n=document.createElement("icon-wc");n.setAttribute("name","highlighter"),n.setAttribute("size","sm"),n.setAttribute("aria-hidden","true"),i.appendChild(n),this.appendChild(i)}this.#r=i;let s=document.createElement("div");s.className="highlight-color-dropdown",s.id=`highlight-palette-${++kl}`,s.setAttribute("role","group"),s.setAttribute("aria-label",this.dataset.labelPalette||"Highlight color"),s.hidden=!0;for(let n of e){let o=document.createElement("button");o.type="button",o.className="highlight-color-swatch",o.dataset.color=n,o.title=n,o.setAttribute("aria-label",n),o.setAttribute("aria-pressed",String(n===this.#i)),o.style.setProperty("--_swatch",`var(--highlight-${n})`),s.appendChild(o)}this.appendChild(s),this.#a=s,i.setAttribute("aria-expanded","false"),i.setAttribute("aria-controls",s.id),this.listen(i,"click",n=>{n.stopPropagation(),this.#h(s.hidden)}),this.listen(s,"click",n=>{let o=n.target.closest?.(".highlight-color-swatch");o&&(n.stopPropagation(),this.#o(o.dataset.color??this.#i),this.#h(!1),this.#u(this.#i))}),this.listen(this,"keydown",n=>{let o=n;o.key!=="Escape"||s.hidden||(o.stopPropagation(),this.#h(!1),i.focus())}),this.listen(document,"pointerdown",n=>{!s.hidden&&!this.contains(n.target)&&this.#h(!1)}),this.listen(this.#s,"selection-menu:dismiss",()=>this.#h(!1))}#h(t){!this.#a||!this.#r||(this.#a.hidden=!t,this.#r.setAttribute("aria-expanded",String(t)),t&&(this.#l(),(this.#a.querySelector('[aria-pressed="true"]')??this.#a.firstElementChild)?.focus({preventScroll:!0})))}#l(){let t=this.#a;if(!t)return;t.style.removeProperty("--_hn-shift");let{left:e,right:i}=t.getBoundingClientRect(),s=8,n=e<s?s-e:i>window.innerWidth-s?window.innerWidth-s-i:0;n&&t.style.setProperty("--_hn-shift",`${n}px`)}#o(t){this.#i=t,this.#a?.querySelectorAll(".highlight-color-swatch").forEach(e=>e.setAttribute("aria-pressed",String(e.dataset.color===t)))}#u(t){let e=this.#s,i=e?.getSelection?.();if(!i?.target)return;let s=this.#d(i.target);if(!s)return;let n=window.getSelection();n&&(n.isCollapsed||!n.rangeCount)&&i.range&&(n.removeAllRanges(),n.addRange(i.range)),s._createFromSelection(t),this.#e=i.target,e.dismiss?.()}#p(){let t=this.#s;if(!t)return[];let e=new Set,i=t.getAttribute("for"),s=i&&document.getElementById(i);return s&&e.add(s),t.id&&document.querySelectorAll(`[data-selection-menu="${CSS.escape(t.id)}"]`).forEach(n=>e.add(n)),[...e]}#d(t){t.hasAttribute("data-highlights-init")||(t.setAttribute("data-highlights",this.getAttribute("storage-key")||""),this.hasAttribute("colors")&&t.setAttribute("data-highlights-colors",this.getAttribute("colors")??""));for(let i of wl){let s=this.getAttribute(`data-label-${i}`);s&&t.setAttribute(`data-highlights-label-${i}`,s)}let e=U(t);return this.hasAttribute("readonly")&&!t.hasAttribute("data-highlights-readonly")&&(t.setAttribute("data-highlights-readonly",""),e.destroy(),e=U(t)),e}#f(){let t=this.#k();t&&(this.#t=this.#d(t))}#k(){let t=this.getAttribute("for");return t?document.getElementById(t):this.firstElementChild}#v(){let t=this.getAttribute("colors"),e=t?t.split(",").map(i=>i.trim()).filter(i=>yl.test(i)):[];return e.length?[...new Set(e)]:[...vl]}#g(){if(this.#t&&!this.#t.destroyed)return this.#t;let t=this.#e?.isConnected?this.#e:this.#p()[0];return t?this.#d(t):null}highlightSelection(t=this.#i){this.hasAttribute("readonly")||!this.#v().includes(t)||(this.#o(t),this.#s?this.#u(t):this.#t?._createFromSelection(t))}getHighlights(){return this.#g()?.getHighlights()??[]}removeHighlight(t){this.#g()?.removeHighlight(t)}clearAll(){this.#g()?.clearAll()}exportHighlights(){return this.#g()?.exportHighlights()??'{"version":1,"highlights":[]}'}importHighlights(t){return this.#g()?.importHighlights(t)??{imported:0,rejected:0}}};g("highlight-wc",Li);var te=CSS.supports("anchor-name","--x"),Al=CSS.supports("position-area","bottom"),xl=(()=>{let r=document.createElement("span");return r.setAttribute("popover","hint"),r.popover==="hint"})(),El=["auto","manual","hint"];function Sl(r){let t=El.includes(r||"")?r:"auto";return t==="hint"&&!xl?"auto":t}var Cl=["top","bottom","left","right","inset-inline-start","inset-inline-end"],Tl=["position","top","left","right","bottom","margin"],_r=8,Ll=0,Ml=0;function Rr(r){return!r||r==="none"?[]:r.split(",").map(t=>t.trim()).filter(Boolean)}var Mi=class extends v{static get observedAttributes(){return["data-mode","data-anchor","data-position"]}#t=null;#e=null;#i=`--pop-over-anchor-${++Ml}`;#s=!1;#r=!1;#n=!1;setup(){if(this.id||(this.id=`pop-over-${++Ll}`),(!this.hasAttribute("popover")||this.#s)&&this.#a(),this.#c(),this.#h(),this.listen(this,"beforetoggle",t=>{let e=t.newState==="open"?"show":"hide";this.dispatchEvent(new CustomEvent(`pop-over:${e}`,{detail:{state:t.newState},bubbles:!0,composed:!0})),!te&&t.newState==="open"&&this.#t&&queueMicrotask(()=>{this.matches(":popover-open")&&this.#u()})}),!te){let t=()=>{this.matches(":popover-open")&&this.#t&&this.#u()};this.listen(window,"resize",t),this.listen(window,"scroll",t,{capture:!0,passive:!0})}}teardown(){this.#l(),this.#r&&(Cl.forEach(t=>this.style.removeProperty(t)),this.#r=!1),this.#n&&(Tl.forEach(t=>this.style.removeProperty(t)),this.#n=!1),this.#t=null}attributeChangedCallback(t,e,i){if(e!==i){if(!this.hasAttribute("data-upgraded")){t==="data-mode"&&this.hasAttribute("popover")&&!this.isConnected&&(this.#s=!0);return}if(t==="data-mode"){this.#a();return}this._reinit()}}#a(){let t=Sl(this.dataset.mode);this.getAttribute("popover")!==t&&this.setAttribute("popover",t),this.#s=!0}show(){this.matches(":popover-open")||(this.showPopover(),!te&&this.#t&&this.matches(":popover-open")&&this.#u())}hide(){this.matches(":popover-open")&&this.hidePopover()}toggle(){this.matches(":popover-open")?this.hide():this.show()}get open(){return this.matches(":popover-open")}#c(){let t=this.dataset.anchor;if(t){let e=document.getElementById(t);if(!e)try{e=document.querySelector(t)}catch{e=null}this.#t=e}else this.#t=document.querySelector(`[popovertarget="${CSS.escape(this.id)}"]`)}#h(){if(!this.#t||!te)return;let t=this.#t,e=t.style.getPropertyValue("anchor-name"),i=Rr(e||getComputedStyle(t).getPropertyValue("anchor-name"));i.includes(this.#i)||i.push(this.#i),t.style.setProperty("anchor-name",i.join(", ")),this.#e=this.#i,this.style.setProperty("position-anchor",this.#i),this.setAttribute("data-anchor-name",this.#i),Al||this.#o(this.dataset.position||"bottom")}#l(){if(this.#t&&this.#e){let t=Rr(this.#t.style.getPropertyValue("anchor-name")).filter(e=>e!==this.#e);t.length?this.#t.style.setProperty("anchor-name",t.join(", ")):this.#t.style.removeProperty("anchor-name")}this.#e=null,this.style.getPropertyValue("position-anchor")&&this.style.removeProperty("position-anchor"),this.hasAttribute("data-anchor-name")&&this.removeAttribute("data-anchor-name")}#o(t){let e="var(--_pop-over-offset, var(--size-xs))",i=t.endsWith("-end")?{"inset-inline-end":"anchor(end)"}:{"inset-inline-start":"anchor(start)"},s={top:{bottom:`calc(anchor(top) + ${e})`,...i},bottom:{top:`calc(anchor(bottom) + ${e})`,...i},left:{right:`calc(anchor(left) + ${e})`,top:"anchor(top)"},right:{left:`calc(anchor(right) + ${e})`,top:"anchor(top)"}},n=t.split("-")[0],o=s[n]||s.bottom;Object.entries(o).forEach(([a,l])=>this.style.setProperty(a,l)),this.#r=!0}#u(){if(!this.#t)return;let t=this.#t.getBoundingClientRect(),e=this.dataset.position||"bottom",i=this.#p(),s=document.documentElement.clientWidth,n=document.documentElement.clientHeight;this.style.position="fixed",this.style.margin="0",this.style.right="auto",this.style.bottom="auto",this.#n=!0;let o=this.offsetWidth,a=this.offsetHeight,l=e.split("-")[0];["top","bottom","left","right"].includes(l)||(l="bottom");let c={top:t.top-i,bottom:n-t.bottom-i,left:t.left-i,right:s-t.right-i},h={top:"bottom",bottom:"top",left:"right",right:"left"},u=l==="top"||l==="bottom"?a:o;c[l]<u&&c[h[l]]>c[l]&&(l=h[l]);let p,d;switch(l){case"top":p=t.top-a-i,d=t.left;break;case"left":p=t.top,d=t.left-o-i;break;case"right":p=t.top,d=t.right+i;break;default:p=t.bottom+i,d=t.left;break}if(l==="top"||l==="bottom"){let m=getComputedStyle(this).direction==="rtl";d=e.endsWith("-end")!==m?t.right-o:t.left}else e.endsWith("-end")&&(p=t.bottom-a);let f=(m,b,w)=>Math.max(_r,Math.min(m,w-b-_r));d=f(d,o,s),p=f(p,a,n),this.style.top=`${Math.round(p)}px`,this.style.left=`${Math.round(d)}px`}#p(){let t={none:0,xs:4,s:8,m:16,l:24};return t[this.dataset.offset||""]??t.xs}};g("pop-over",Mi);var Nr=8,ee=8,_l=300,Rl="Text selection actions",Pr="F10",Nl='button:not([disabled]), a[href], [role="button"]:not([aria-disabled="true"])',Pl='[role="group"], [role="menu"], [role="listbox"], [role="radiogroup"], dialog, [popover]:not([data-selection-menu-host])',$l=0,_i=class extends v{#t=null;#e=new Set;#i=!1;#s;#r=null;#n=null;#a=null;#c=0;#h=!1;#l="mouse";#o="pointer";#u=!1;#p=new Set;setup(){let t=this.querySelector(":scope > pop-over[data-selection-menu-host]");if(t)this.#s=t;else{this.#s=document.createElement("pop-over"),this.#s.setAttribute("data-selection-menu-host",""),this.#s.dataset.mode="manual",this.#s.id=`selection-menu-${++$l}`;let e=[...this.children];for(let i of e)i!==this.#s&&this.#s.appendChild(i);this.appendChild(this.#s)}this.#s.setAttribute("role","toolbar"),this.#s.setAttribute("aria-orientation","horizontal"),this.#s.setAttribute("aria-label",this.dataset.label||Rl),this.#s.setAttribute("aria-keyshortcuts",`Alt+${Pr}`),this.hidden=!1,this.#d(),this.listen(document,"pointerup",this.#f),this.listen(document,"pointerdown",this.#C),this.listen(document,"keydown",this.#x),this.listen(document,"keyup",this.#k),this.listen(document,"selectionchange",this.#v),this.listen(window,"scroll",this.#m,{capture:!0,passive:!0}),this.listen(window,"resize",this.#m),this.listen(this.#s,"keydown",this.#T),this.id&&(this.#r=new MutationObserver(()=>this.#d()),this.#r.observe(document.body,{childList:!0,subtree:!0,attributeFilter:["data-selection-menu"]}))}teardown(){this.#r?.disconnect(),this.#r=null,this.#a&&clearTimeout(this.#a),this.#a=null,cancelAnimationFrame(this.#c),this.#n?.getAttribute("data-selection-menu")===this.id&&this.#n.removeAttribute("data-selection-menu"),this.#n=null;for(let t of this.#p)t.removeAttribute("tabindex");this.#p.clear(),this.#i=!1,this.#t=null,this.#h=!1}getSelection(){return this.#t?{...this.#t}:null}dismiss(){this.#i&&this.#b({restoreFocus:!0})}get actions(){return[...(this.#s||this).children].map(e=>({tag:e.tagName.toLowerCase(),attrs:Object.fromEntries([...e.attributes].map(i=>[i.name,i.value])),html:e.innerHTML||void 0}))}set actions(t){let e=Array.isArray(t)?t:[],i=this.#s||this;for(;i.firstChild;)i.firstChild.remove();this.#p.clear();for(let s of e){if(s instanceof Element){i.appendChild(s);continue}if(!s?.tag)continue;let n=document.createElement(s.tag);if(s.attrs)for(let[o,a]of Object.entries(s.attrs))a==null||a===!1||n.setAttribute(o,a===!0?"":String(a));s.html&&(n.innerHTML=s.html),i.appendChild(n)}this.dispatchEvent(new CustomEvent("selection-menu:actions-changed",{detail:{actions:this.actions,source:"property"},bubbles:!0}))}#d(){this.#e.clear();let t=this.getAttribute("for");if(t){let e=document.getElementById(t);e&&(this.#e.add(e),this.id&&!e.hasAttribute("data-selection-menu")&&(e.setAttribute("data-selection-menu",this.id),this.#n=e))}this.id&&document.querySelectorAll(`[data-selection-menu="${CSS.escape(this.id)}"]`).forEach(e=>{this.#e.add(e)})}#f=t=>{this.#h=!1,this.#l=t.pointerType||"mouse",requestAnimationFrame(()=>{this.isConnected&&this.#g()})};#k=t=>{!t.shiftKey&&t.key!=="Shift"||this.#s?.contains(document.activeElement)||(this.#l="keyboard",this.#g())};#v=()=>{this.#h||this.#u||(this.#a&&clearTimeout(this.#a),this.#a=setTimeout(()=>{if(this.#a=null,!this.isConnected||this.#h||this.#u||this.#s?.contains(document.activeElement))return;let t=window.getSelection();if(!t||t.isCollapsed||!t.toString().trim()){this.#i&&this.#o==="keyboard"&&this.#b({restoreFocus:!1});return}this.#o==="keyboard"&&(this.#l="keyboard"),this.#g()},_l))};#g(){let t=window.getSelection();if(!t||t.rangeCount===0||t.isCollapsed||!t.toString().trim())return!1;let e=t.getRangeAt(0),i=e.commonAncestorContainer,s=i.nodeType===Node.ELEMENT_NODE?i:i.parentElement,n=null;for(let c of this.#e)if(c.contains(s)){n=c;break}if(!n)return!1;let o=t.toString().trim(),a=this.#t,l=this.#i&&a&&a.target===n&&a.text===o&&a.range.compareBoundaryPoints(Range.START_TO_START,e)===0&&a.range.compareBoundaryPoints(Range.END_TO_END,e)===0;return this.#t={range:e.cloneRange(),text:o,target:n},l||this.dispatchEvent(new CustomEvent("selection-menu:select",{detail:{range:this.#t.range,text:o,target:n},bubbles:!0})),this.#y(),!0}#y(){this.#s&&(this.#s.show(),this.#i=!0,this.#E(),cancelAnimationFrame(this.#c),this.#c=requestAnimationFrame(()=>this.#w()))}#w(){if(!this.#i||!this.#t||!this.#s)return;let t=this.#t.range.getBoundingClientRect();if(t.bottom<0||t.top>window.innerHeight||t.width===0&&t.height===0){this.#b({restoreFocus:!0});return}let i=this.#s.getBoundingClientRect(),s=i.width||200,n=i.height||40,o=t.top-n-Nr,a=t.bottom+Nr,l;this.#l==="touch"?l=a+n+ee<=window.innerHeight?a:o:l=o<ee?a:o;let c=t.left+t.width/2-s/2,h=window.innerWidth-s-ee;c=Math.max(ee,Math.min(c,h)),this.#s.style.top=`${l}px`,this.#s.style.left=`${c}px`}#m=()=>{this.#i&&(cancelAnimationFrame(this.#c),this.#c=requestAnimationFrame(()=>this.#w()))};#b({restoreFocus:t=!1,restoreRange:e=!1}={}){let i=this.#t,s=!!this.#s?.contains(document.activeElement);if(this.#s&&this.#s.hide(),this.#i=!1,this.#t=null,cancelAnimationFrame(this.#c),this.#u=!0,this.dispatchEvent(new CustomEvent("selection-menu:dismiss",{bubbles:!0})),t&&s&&i?.target?.isConnected){let n=i.target;if(n.hasAttribute("tabindex")||(n.setAttribute("tabindex","-1"),n.addEventListener("blur",()=>{n.getAttribute("tabindex")==="-1"&&n.removeAttribute("tabindex")},{once:!0})),n.focus({preventScroll:!0}),e){let o=window.getSelection();o&&(o.removeAllRanges(),o.addRange(i.range))}}}#C=t=>{if(this.#h=!0,this.#o="pointer",this.#u=!1,!this.#i)return;let e=t.target;this.#s?.contains(e)||this.contains(e)||this.#b()};#x=t=>{if(["Shift","Alt","Control","Meta"].includes(t.key)||(this.#u=!1),this.#o="keyboard",!t.defaultPrevented){if(t.key==="Escape"&&this.#i){t.preventDefault(),this.#b({restoreFocus:!0,restoreRange:!0});return}if(t.key===Pr&&t.altKey&&!t.ctrlKey&&!t.metaKey){if(!this.#i&&(this.#l="keyboard",!this.#g()))return;t.preventDefault(),this.#A(0)}}};#L(){return this.#s?[...this.#s.querySelectorAll(Nl)].filter(t=>{let e=t.closest(Pl);if(e&&this.#s.contains(e))return!1;let i=t.closest("[hidden]");return!(i&&this.#s.contains(i))}):[]}#E(){let t=this.#L(),e=t.find(i=>i===document.activeElement)??t.find(i=>i.getAttribute("tabindex")==="0")??t[0];for(let i of t)i.setAttribute("tabindex",i===e?"0":"-1"),this.#p.add(i)}#A(t){this.#E();let e=this.#L();if(!e.length)return;let i=(t%e.length+e.length)%e.length;for(let s of e)s.setAttribute("tabindex",s===e[i]?"0":"-1");e[i].focus()}#T=t=>{let e=t.target;if(e.matches('input, textarea, select, [contenteditable]:not([contenteditable="false"])'))return;let i=this.#L(),s=i.indexOf(e);if(s===-1)return;let n=getComputedStyle(this.#s).direction==="rtl",o=n?"ArrowLeft":"ArrowRight",a=n?"ArrowRight":"ArrowLeft",l=-1;if(t.key===o)l=s+1;else if(t.key===a)l=s-1;else if(t.key==="Home")l=0;else if(t.key==="End")l=i.length-1;else return;t.preventDefault(),this.#A(l)}};g("selection-menu",_i);var Il={add:"Add private note",view:"View notes",dialog:"Private note",heading:"Private note",placeholder:"Add a note\u2026",textarea:"Note for highlighted text",save:"Save",cancel:"Cancel"},$r=!1,Ri=new Set;function Ir(r,t,e){if(!r.contains(t))return-1;let i=document.createRange();return i.setStart(r,0),i.setEnd(t,e),i.toString().length}var Ni=class extends v{#t=!1;#e=null;#i=null;#s=null;#r=null;#n=null;setup(){this.#t=!!this.closest("selection-menu");let t=this.hasAttribute("for");Ri.add(this),$r||($r=!0,document.addEventListener("highlights:request-note",zl));let e=this.querySelector(":scope > button[data-note-action]");if(!this.#t&&!t){e?.remove();return}if(!e){e=document.createElement("button"),e.type="button",e.setAttribute("data-note-action","");let i=document.createElement("icon-wc");i.setAttribute("name","sticky-note"),i.setAttribute("size","sm"),i.setAttribute("aria-hidden","true"),e.appendChild(i),this.appendChild(e)}e.setAttribute("aria-label",this.#a(this.#t?"add":"view")),this.listen(e,"click",this.#t?()=>this.#c():()=>this.#h())}teardown(){Ri.delete(this),this.#d()}#a(t){return this.getAttribute(`data-label-${t}`)??Il[t]??t}openFor(t,e,i){this.#l(t,e,i??document.activeElement)}#c(){let t=this.closest("selection-menu");if(!t)return;let e=t.getSelection();if(!e)return;let i=e.target,s=document.activeElement;i.hasAttribute("data-highlights-init")||i.setAttribute("data-highlights","");let n=U(i),o=e.range,a=Ir(i,o.startContainer,o.startOffset),l=Ir(i,o.endContainer,o.endOffset),c=null;if(a>=0&&l>a&&(c=n.getHighlights().find(h=>h.startOffset<=a&&h.endOffset>=l)??null),!c){let h=window.getSelection();h&&(h.isCollapsed||h.rangeCount===0)&&(h.removeAllRanges(),h.addRange(o)),n._createFromSelection("yellow");let u=n.getHighlights();c=u.find(p=>p.startOffset===a&&p.endOffset===l)??u[u.length-1]??null}t.dismiss(),c&&this.#l(c,n,s)}#h(){let t=this.getAttribute("for"),e=t?document.getElementById(t):null;if(!e)return;e.hasAttribute("data-highlights-init")||e.setAttribute("data-highlights","");let i=U(e),s=i.getHighlights(),n=s.find(o=>o.note)??s[0];n&&this.#l(n,i,document.activeElement)}#l(t,e,i){this.#d({restoreFocus:!1});let s=e.element;this.#i=i&&i!==document.body?i:null,this.#s=t,this.#r=e;let n=document.createElement("div");n.className="hn-note-panel",n.setAttribute("role","dialog"),n.setAttribute("aria-label",this.#a("dialog"));let o=document.createElement("header");o.className="hn-note-header";let a=document.createElement("small");a.textContent=this.#a("heading"),o.appendChild(a),n.appendChild(o);let l=document.createElement("blockquote");l.className="hn-note-quote",l.textContent=t.text.length>80?t.text.slice(0,80)+"\u2026":t.text,n.appendChild(l);let c=document.createElement("textarea");c.className="hn-note-textarea",c.placeholder=this.#a("placeholder"),c.value=t.note||"",c.rows=3,c.setAttribute("aria-label",this.#a("textarea")),n.appendChild(c);let h=document.createElement("footer");h.className="hn-note-actions";let u=()=>{e._updateNote(t.id,c.value.trim()),this.#d()},p=document.createElement("button");p.type="button",p.className="hn-action hn-action-save",p.textContent=this.#a("save"),p.addEventListener("click",u);let d=document.createElement("button");if(d.type="button",d.className="hn-action",d.textContent=this.#a("cancel"),d.addEventListener("click",()=>this.#d()),h.append(p,d),n.appendChild(h),n.addEventListener("keydown",f=>{f.defaultPrevented||(f.key==="Escape"?(f.preventDefault(),f.stopPropagation(),this.#d()):f.key==="Enter"&&(f.metaKey||f.ctrlKey)&&f.target===c&&(f.preventDefault(),u()))}),getComputedStyle(s).position==="static"&&(s.setAttribute("data-note-host",""),this.#n=s),s.appendChild(n),typeof e.findHighlightRect=="function"){let f=e.findHighlightRect(t.id);if(f){let m=s.getBoundingClientRect();n.style.top=`${f.top-m.top}px`}}this.#e=n,requestAnimationFrame(()=>{this.#e===n&&(c.focus(),document.addEventListener("pointerdown",this.#o))})}#o=t=>{if(!this.#e||this.#e.contains(t.target))return;this.#d({restoreFocus:!1});let e=this.#u;e&&document.addEventListener("pointerup",()=>{setTimeout(()=>{let i=document.activeElement;(!i||i===document.body)&&e?.()})},{once:!0,capture:!0})};#u=null;#p(){let t=this.#i,e=this.#r?.element,i=this.#s?.id;return()=>{if(t?.isConnected&&(typeof t.checkVisibility!="function"||t.checkVisibility())&&(t.focus({preventScroll:!0}),document.activeElement===t)||!e?.isConnected)return;let n=(i?e.querySelector(`mark[data-hn-id="${CSS.escape(i)}"]`):null)??e;n.tabIndex<0&&!n.hasAttribute("tabindex")&&(n.setAttribute("tabindex","-1"),n.addEventListener("blur",()=>n.removeAttribute("tabindex"),{once:!0})),n.focus({preventScroll:!0})}}#d({restoreFocus:t=!0}={}){if(!this.#e)return;let e=this.#e.contains(document.activeElement)?this.#p():null;document.removeEventListener("pointerdown",this.#o),this.#e.remove(),this.#e=null,this.#n?.removeAttribute("data-note-host"),this.#n=null,this.#u=e,this.#i=null,this.#s=null,this.#r=null,t&&e?.()}};function zl(r){let{highlight:t,controller:e}=r.detail||{};if(!t||!e)return;let i=Ri.values().next().value;i&&i.openFor(t,e)}g("note-wc",Ni);var Bl=0,Pi=class extends v{#t=null;#e=null;setup(){if(this.#t=this.querySelector(":scope > button"),this.#e=this.querySelector(":scope > .comment-wc-reason"),!this.#t){let e=document.createElement("button");e.type="button";let i=document.createElement("icon-wc");i.setAttribute("name","message-circle"),i.setAttribute("size","sm"),i.setAttribute("aria-hidden","true"),e.appendChild(i);let s=document.createElement("span");s.className="comment-wc-reason visually-hidden",s.id=`comment-wc-reason-${++Bl}`,s.textContent="Comments are unavailable: this content has no review surface.",this.append(e,s),this.#t=e,this.#e=s}this.#s(),this.listen(this,"click",this.#r);let t=this.closest("selection-menu");t&&this.listen(t,"toggle",()=>this.#s())}#i(){let t=this.closest("review-surface");if(t)return t;let e=this.closest("selection-menu")?.getAttribute("for");return e?document.querySelector(`review-surface[for="${CSS.escape(e)}"]`):null}#s(){let t=this.#t;if(!t)return;!!this.#i()?(t.removeAttribute("aria-disabled"),t.removeAttribute("aria-describedby"),t.setAttribute("aria-label","Add comment")):(t.setAttribute("aria-disabled","true"),t.setAttribute("aria-label","Add comment"),this.#e&&t.setAttribute("aria-describedby",this.#e.id))}#r=t=>{if(!this.#t?.contains(t.target))return;this.#s();let e=this.#i();if(!e)return;let i=this.closest("selection-menu");if(!i)return;let s=i.getSelection();if(!s)return;let n=s.range.getBoundingClientRect(),o=e.getBoundingClientRect(),a=(n.left+n.width/2-o.left)/o.width*100,l=(n.top-o.top)/o.height*100;typeof e.addPin=="function"&&e.addPin({x:a,y:l,text:s.text}),this.dispatchEvent(new CustomEvent("comment-wc:created",{detail:{text:s.text,x:a,y:l},bubbles:!0})),i.dismiss()}};g("comment-wc",Pi);var $i='track[kind="chapters"][data-chapter-list]';function zr(r=document){r.querySelectorAll($i).forEach(t=>Ii(t))}function Ii(r){if(r.hasAttribute("data-chapter-list-init"))return;r.setAttribute("data-chapter-list-init","");let t=r.parentElement;if(!t||t.tagName!=="VIDEO")return;let e=r.track;e.mode==="disabled"&&(e.mode="hidden"),r.readyState>=2?Br(t,e,r):r.addEventListener("load",()=>Br(t,e,r),{once:!0})}function Br(r,t,e){let i=t.cues;if(!i||i.length===0)return;let s=document.createElement("nav");s.setAttribute("aria-label",e.getAttribute("data-label")||"Video chapters"),s.classList.add("chapter-list");let n=document.createElement("ol");for(let a of i){let l=document.createElement("li"),c=document.createElement("button");c.type="button";let h=document.createElement("span");h.textContent=a.text;let u=document.createElement("time");u.textContent=Ol(a.startTime),u.setAttribute("datetime",jl(a.startTime)),c.appendChild(h),c.appendChild(u),c.addEventListener("click",()=>{r.currentTime=a.startTime,r.paused&&r.play()?.catch(()=>{})}),l.appendChild(c),n.appendChild(l)}s.appendChild(n),r.insertAdjacentElement("afterend",s);let o=null;r.addEventListener("timeupdate",()=>{let a=r.currentTime,l=-1;for(let h=0;h<i.length;h++)if(a>=i[h].startTime&&a<i[h].endTime){l=h;break}let c=l>=0?n.children[l]:null;c!==o&&(o&&(o.removeAttribute("data-active"),o.querySelector("button")?.removeAttribute("aria-current")),o=c,o&&(o.setAttribute("data-active",""),o.querySelector("button")?.setAttribute("aria-current","true")))})}function Ol(r){let t=Math.floor(r/3600),e=Math.floor(r%3600/60),i=Math.floor(r%60);return t>0?`${t}:${String(e).padStart(2,"0")}:${String(i).padStart(2,"0")}`:`${e}:${String(i).padStart(2,"0")}`}function jl(r){let t=Math.floor(r/3600),e=Math.floor(r%3600/60),i=Math.floor(r%60);return`PT${t?t+"H":""}${e?e+"M":""}${i}S`}document.readyState==="loading"?document.addEventListener("DOMContentLoaded",()=>zr()):zr();var Dl=new MutationObserver(r=>{for(let t of r)for(let e of t.addedNodes){if(e.nodeType!==Node.ELEMENT_NODE)continue;let i=e;i.matches?.($i)&&Ii(i),i.querySelectorAll?.($i).forEach(s=>Ii(s))}});Dl.observe(document.documentElement,{childList:!0,subtree:!0});var ut="[data-command], [commandfor]",Fl="Page Actions",B=new Map;function ie(r){if(B.has(r)||r.hasAttribute("data-command-init"))return;r.setAttribute("data-command-init","");let t=r.getAttribute("data-command")||r.textContent.trim();if(!t)return;let e=r.getAttribute("data-command-group")||Fl,i=r.getAttribute("data-command-icon")||null,s=r.getAttribute("data-shortcut")||null,n=null;s&&(n=Y(s,()=>r.click()));let o={element:r,label:t,group:e,icon:i,shortcut:s,unbind:n};B.set(r,o),document.dispatchEvent(new CustomEvent("vb:command-registry-change",{detail:{action:"add",entry:o}}))}function zi(r){let t=B.get(r);t&&(t.unbind?.(),B.delete(r),r.removeAttribute("data-command-init"),document.dispatchEvent(new CustomEvent("vb:command-registry-change",{detail:{action:"remove",element:r}})))}function ql(){let r=new Map;for(let t of B.values()){if(t.element.hidden||t.element.closest("[hidden]"))continue;let e=r.get(t.group)||[];e.push(t),r.set(t.group,e)}return r}function Or(r=document){r.querySelectorAll(ut).forEach(ie)}document.readyState==="loading"?document.addEventListener("DOMContentLoaded",()=>Or()):Or();var Hl=new MutationObserver(r=>{for(let t of r){for(let e of t.addedNodes){if(e.nodeType!==Node.ELEMENT_NODE)continue;let i=e;i.matches(ut)&&ie(i),i.querySelectorAll(ut).forEach(ie)}for(let e of t.removedNodes){if(e.nodeType!==Node.ELEMENT_NODE)continue;let i=e;B.has(i)&&zi(i),i.querySelectorAll(ut).forEach(s=>{B.has(s)&&zi(s)})}if(t.type==="attributes"&&t.target.nodeType===Node.ELEMENT_NODE){let e=t.target;e.matches(ut)&&!B.has(e)?ie(e):!e.matches(ut)&&B.has(e)&&zi(e)}}});Hl.observe(document.documentElement,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["data-command","commandfor"]});function Ul(){let r='footer, aside, dialog, [hidden], [aria-hidden="true"]',e=[];return document.querySelectorAll("nav a[href]").forEach(i=>{if(i.closest(r)||B.has(i))return;let s=i.textContent.trim();!s||e.length>=50||e.push({element:i,label:s,group:"Navigation",icon:null,shortcut:null,auto:!0,action:null})}),document.querySelectorAll("h2[id], h3[id]").forEach(i=>{if(i.closest(r)||B.has(i))return;let s=i.textContent.trim();!s||e.length>=50||e.push({element:i,label:`Jump to: ${s}`,group:"On This Page",icon:null,shortcut:null,auto:!0,action:()=>i.scrollIntoView({behavior:"smooth"})})}),e}window.__commandRegistry={getRegisteredCommands:ql,scanAutoDiscoverable:Ul};var Vl=window.matchMedia("(prefers-reduced-motion: reduce)");function Wl(){return Vl.matches||document.documentElement.hasAttribute("data-motion-reduced")}var jr=0,Gl=new Map([["vb-fade-in","entrance"],["vb-slide-up","entrance"],["vb-pop","entrance"],["vb-slide-in-ltr","entrance"],["vb-slide-in-rtl","entrance"],["vb-fade-slide-up","entrance"],["vb-shadow-lift","entrance"],["vb-fade-out","exit"],["vb-collapse","exit"],["vb-slide-out-ltr","exit"],["vb-slide-out-rtl","exit"],["vb-shake","attention"],["vb-pulse","attention"],["vb-bounce","attention"],["vb-blink","attention"],["vb-neon-pulse","decoration"],["vb-3d-shift","decoration"],["vb-outline-glow-pulse","decoration"],["vb-rainbow","decoration"],["vb-gradient-flow","decoration"],["vb-shimmer","decoration"],["vb-shimmer-gradient","decoration"],["vb-glow","decoration"],["vb-float","decoration"]]),Dr="__vbEffectsRuntime",Fr=globalThis,y=Fr[Dr]??{_effects:new Map,_triggers:new Map,_transitions:new Map,_instances:new WeakMap,_triggerCleanups:new WeakMap,_wiredTriggers:new WeakMap,_transitionCleanups:new WeakMap,_transitionFallback:new WeakSet,_processed:new WeakSet,_transitionProcessed:new WeakSet,_staggerTime:new WeakSet,_unresolved:new Set,_warnedTriggers:new Set,_unresolvedTimer:null,_keyframePhase:Gl,_observer:null,_animationEndHandler:null,_autoBooted:!1,effect(r,t){this._effects.set(r,t),document.querySelectorAll("[data-effect]").forEach(e=>{if(!(e.getAttribute("data-effect")||"").split(/\s+/).includes(r))return;let s=!this._instances.get(e)?.has(r);this._initEffect(e,r),s&&e.hasAttribute("data-effect-active")&&this._instances.get(e)?.get(r)?.activate?.()})},trigger(r,t){this._triggers.set(r,t),document.querySelectorAll("[data-effect][data-trigger]").forEach(e=>{if(!this._processed.has(e))return;let i=e.getAttribute("data-effect")?.split(/\s+/).filter(Boolean)||[];this._wireTrigger(e,i)})},transition(r,t){this._transitions.set(r,t),document.querySelectorAll("[data-transition]").forEach(e=>{if(!this._transitionProcessed.has(e)||!this._transitionFallback.has(e))return;let i=e.getAttribute("data-transition")||"",s=i.indexOf(":");if((s>-1?i.slice(0,s):i)!==r)return;this._transitionFallback.delete(e);let n=e;n.style.viewTransitionName="";let o=t(e,s>-1?i.slice(s+1):null);o&&this._transitionCleanups.set(e,o)})},uid(r){return r.id?r.id:(r._vbUid||(jr++,r._vbUid=`vb-${jr}`),r._vbUid)},theme(r,t){this._themes=this._themes||new Map,this._themes.set(r,t)},applyTheme(r,t=document.documentElement){let e=this._themes?.get(r);if(e)for(let[i,s]of Object.entries(e))t.style.setProperty(i,s)},swap(r){if(!document.startViewTransition){r(),queueMicrotask(()=>this._dispatchVtDone(document.body));return}let t=document.startViewTransition(r);return t.updateCallbackDone.then(()=>{this._dispatchVtDone(document.body)}).catch(()=>{}),t},_dispatchVtDone(r){r.querySelectorAll('[data-trigger~="vt"]').forEach(t=>{this.emit(t,"vb:vt-update-done",{})})},activate(r){this._activateEffects(r)},deactivate(r){r.hasAttribute("data-effect-active")&&(r.removeAttribute("data-effect-active"),this.emit(r,"vb:phase-change",{active:!1}))},onPhaseEnd(r,t,e){let i=s=>{s.detail?.phase===t&&e(s.detail)};return r.addEventListener("vb:effect-phase-end",i),()=>r.removeEventListener("vb:effect-phase-end",i)},registerKeyframe(r,t){this._keyframePhase.set(r,t)},observe(r=document){if(r.querySelectorAll("[data-effect]").forEach(e=>this._processElement(e)),r.querySelectorAll("[data-stagger]").forEach(e=>this._processStagger(e)),r.querySelectorAll("[data-transition]").forEach(e=>this._processTransition(e)),this._observer)return;this._observer=new MutationObserver(e=>{let i=new Set;for(let s of e){if(s.type==="childList"){let n=s.target;n.hasAttribute?.("data-stagger")&&i.add(n);for(let o of s.addedNodes)o.nodeType===Node.ELEMENT_NODE&&this._processTree(o);for(let o of s.removedNodes)o.nodeType===Node.ELEMENT_NODE&&(o.isConnected||this._cleanupTree(o))}if(s.type==="attributes"){let n=s.target;s.attributeName==="data-effect"&&this._reconcileEffects(n),s.attributeName==="data-trigger"&&this._reconcileTrigger(n),s.attributeName==="data-stagger"&&(n.hasAttribute("data-stagger")?i.add(n):this._cleanupStagger(n)),s.attributeName==="data-transition"&&this._reconcileTransition(n)}}for(let s of i)s.isConnected&&this._processStagger(s)});let t=r===document?document.body:r;this._observer.observe(t,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["data-effect","data-trigger","data-stagger","data-transition"]}),this._animationEndHandler||(this._animationEndHandler=e=>{let i=e.target;if(!(i instanceof Element)||!i.hasAttribute("data-effect"))return;let s=this._keyframePhase.get(e.animationName);s&&this.emit(i,"vb:effect-phase-end",{phase:s,animationName:e.animationName})},document.addEventListener("animationend",this._animationEndHandler))},disconnect(){this._observer&&(this._observer.disconnect(),this._observer=null),this._animationEndHandler&&(document.removeEventListener("animationend",this._animationEndHandler),this._animationEndHandler=null)},params(r){let t=getComputedStyle(r);return{get(e){return t.getPropertyValue(`--vb-${e}`).trim()},getNumber(e,i=0){let s=t.getPropertyValue(`--vb-${e}`).trim();return s?parseFloat(s):i},getTime(e,i=0){let s=t.getPropertyValue(`--vb-${e}`).trim();if(!s)return i;let n=parseFloat(s);return Number.isFinite(n)?/s\s*$/.test(s)&&!/ms\s*$/.test(s)?n*1e3:n:i},hasClass(e){return r.classList.contains(e)}}},emit(r,t,e={}){r.dispatchEvent(new CustomEvent(t,{bubbles:!0,detail:e}))},prefersReducedMotion:Wl,_processTree(r){r.hasAttribute?.("data-effect")&&this._processElement(r),r.hasAttribute?.("data-stagger")&&this._processStagger(r),r.hasAttribute?.("data-transition")&&this._processTransition(r),r.querySelectorAll?.("[data-effect]").forEach(t=>this._processElement(t)),r.querySelectorAll?.("[data-stagger]").forEach(t=>this._processStagger(t)),r.querySelectorAll?.("[data-transition]").forEach(t=>this._processTransition(t))},_cleanupTree(r){r.hasAttribute?.("data-effect")&&this._cleanupElement(r),r.hasAttribute?.("data-transition")&&this._cleanupTransition(r),r.querySelectorAll?.("[data-effect]").forEach(t=>this._cleanupElement(t)),r.querySelectorAll?.("[data-transition]").forEach(t=>this._cleanupTransition(t))},_processElement(r){if(this._processed.has(r))return;this._processed.add(r),r.removeAttribute("data-effect-processed"),r.removeAttribute("data-effect-armed");let t=r.getAttribute("data-effect")?.split(/\s+/).filter(Boolean)||[];for(let e of t)this._initEffect(r,e);this._wireTrigger(r,t)},_initEffect(r,t){let e=this._effects.get(t);if(!e)return;let i=this._instances.get(r);if(i?.has(t))return;let s=e(r);s&&(i||(i=new Map,this._instances.set(r,i)),typeof s=="function"?i.set(t,{cleanup:s}):i.set(t,s))},_parseTrigger(r){let t=r.indexOf(":");return t>-1?[r.slice(0,t),r.slice(t+1)]:[r,null]},_wireTrigger(r,t){let e=r.getAttribute("data-trigger");if(!e||!e.trim()){r.removeAttribute("data-effect-armed"),this._activateEffects(r);return}let i=e.split(/\s+/).filter(Boolean);this._wiredTriggers??=new WeakMap;let s=this._wiredTriggers.get(r);s||(s=new Set,this._wiredTriggers.set(r,s));let n=!1;for(let o of i){if(s.has(o))continue;let[a,l]=this._parseTrigger(o),c=this._triggers.get(a);if(!c){n=!0;continue}s.add(o);let h=c(r,()=>this._activateEffects(r),l);if(h){let u=this._triggerCleanups.get(r);if(u){let p=u;this._triggerCleanups.set(r,()=>{p(),h()})}else this._triggerCleanups.set(r,h)}}s.size&&r.setAttribute("data-effect-armed",""),n?(this._unresolved.add(r),this._scheduleUnresolvedCheck()):this._unresolved.delete(r)},_scheduleUnresolvedCheck(){if(this._unresolvedTimer)return;let r=()=>{this._unresolvedTimer=null,this._resolveUnknownTriggers()};typeof window>"u"||typeof window.addEventListener!="function"||(document.readyState==="complete"?this._unresolvedTimer=setTimeout(r,0):(this._unresolvedTimer=!0,window.addEventListener("load",()=>setTimeout(r,0),{once:!0})))},_resolveUnknownTriggers(){for(let r of[...this._unresolved]){if(this._unresolved.delete(r),!r.isConnected||!this._processed.has(r))continue;let e=(r.getAttribute("data-trigger")||"").split(/\s+/).filter(Boolean).filter(i=>!this._triggers.has(this._parseTrigger(i)[0]));if(e.length){for(let i of e){let s=this._parseTrigger(i)[0];this._warnedTriggers.has(s)||(this._warnedTriggers.add(s),console.warn(`[VB] data-trigger="${i}": no trigger named "${s}" is registered. The effect runs immediately instead. Register it with VB.trigger('${s}', \u2026) or check the spelling.`,r))}!r.hasAttribute("data-effect-armed")&&!r.hasAttribute("data-effect-active")&&this._activateEffects(r)}}},_activateEffects(r){r.setAttribute("data-effect-active",""),this.emit(r,"vb:phase-change",{active:!0});let t=this._instances.get(r);if(t)for(let[,e]of t)e.activate&&e.activate()},_cleanupElement(r){let t=this._instances.get(r);if(t){for(let[,i]of t)i.cleanup&&i.cleanup();this._instances.delete(r)}let e=this._triggerCleanups.get(r);e&&(e(),this._triggerCleanups.delete(r)),this._wiredTriggers?.delete(r),this._unresolved.delete(r),r.removeAttribute("data-effect-armed"),this._processed.delete(r)},_reconcileEffects(r){if(!r.hasAttribute("data-effect")){this._cleanupElement(r),r.removeAttribute("data-effect-active");return}let t=r.getAttribute("data-effect")?.split(/\s+/).filter(Boolean)||[],e=this._instances.get(r);if(e)for(let[i,s]of e)t.includes(i)||(s.cleanup&&s.cleanup(),e.delete(i));for(let i of t)e?.has(i)||this._initEffect(r,i);this._processed.has(r)||this._processElement(r)},_reconcileTrigger(r){if(!r.hasAttribute("data-effect"))return;let t=this._triggerCleanups.get(r);if(t&&(t(),this._triggerCleanups.delete(r)),this._wiredTriggers?.delete(r),this._unresolved.delete(r),r.removeAttribute("data-effect-armed"),!this._processed.has(r)){this._processElement(r);return}let e=r.getAttribute("data-effect")?.split(/\s+/).filter(Boolean)||[];this._wireTrigger(r,e)},_parseStagger(r){let t=(r||"").trim().split(/\s+/).filter(Boolean),e=t.find(s=>/^(\d+(\.\d+)?|\.\d+)(ms|s)$/i.test(s))||null;return{mode:t.find(s=>s==="reverse"||s==="random"||s==="grid")||"",time:e}},_processStagger(r){let{mode:t,time:e}=this._parseStagger(r.getAttribute("data-stagger"));e?(r.style.setProperty("--vb-stagger",e),this._staggerTime.add(r)):this._staggerTime.has(r)&&(r.style.removeProperty("--vb-stagger"),this._staggerTime.delete(r));let i=Array.from(r.children),s=i.length,n;if(t==="reverse")n=Array.from({length:s},(o,a)=>s-1-a);else if(t==="random"){let o=this._hashString(this.uid(r));n=Array.from({length:s},(l,c)=>c);let a=o;for(let l=s-1;l>0;l--){a^=a<<13,a^=a>>>17,a^=a<<5;let c=Math.abs(a)%(l+1);[n[l],n[c]]=[n[c],n[l]]}}else t==="grid"?n=this._gridStaggerIndices(r,i):n=Array.from({length:s},(o,a)=>a);for(let o=0;o<s;o++)i[o].style.setProperty("--vb-stagger-index",String(n[o]))},_gridStaggerIndices(r,t){let e=t.length,i=()=>Array.from({length:e},(c,h)=>h);if(!e)return[];let s=t.map(c=>{let h=getComputedStyle(c);return[parseInt(h.gridRowStart,10),parseInt(h.gridColumnStart,10)]});if(s.every(([c,h])=>Number.isFinite(c)&&Number.isFinite(h))){let c=Math.min(...s.map(([u])=>u)),h=Math.min(...s.map(([,u])=>u));return s.map(([u,p])=>u-c+(p-h))}let n=t.map(c=>c.getBoundingClientRect?.());if(!n.every(Boolean)||n.every(c=>c.width===0&&c.height===0))return i();let o=getComputedStyle(r).direction==="rtl",a=this._trackRanks(n.map(c=>[c.top,c.bottom])),l=this._trackRanks(n.map(c=>o?[-c.right,-c.left]:[c.left,c.right]));return a.map((c,h)=>c+l[h])},_trackRanks(r){let t=r.map((n,o)=>o).sort((n,o)=>r[n][0]-r[o][0]),e=new Array(r.length),i=-1,s=-1/0;for(let n of t){let[o,a]=r[n];o>=s-.5?(i++,s=a):s=Math.min(s,a),e[n]=i}return e},_cleanupStagger(r){this._staggerTime.has(r)&&(r.style.removeProperty("--vb-stagger"),this._staggerTime.delete(r));for(let t of Array.from(r.children))t.style?.removeProperty("--vb-stagger-index")},_hashString(r){let t=5381;for(let e=0;e<r.length;e++)t=(t<<5)+t^r.charCodeAt(e);return t|0},_vtIdent(r){let t=String(r).replace(/[^A-Za-z0-9_ -￿-]/g,"-");return(!t||/^(-?\d|--)/.test(t))&&(t=`vb-${t}`),t},_processTransition(r){if(this._transitionProcessed.has(r)||r.matches?.("[data-swap], content-swap"))return;let t=(r.getAttribute("data-transition")||"").trim();if(!t)return;this._transitionProcessed.add(r),r.removeAttribute("data-transition-processed");let[e,i]=this._parseTrigger(t),s=this._transitions.get(e);if(s){let n=s(r,i);n&&this._transitionCleanups.set(r,n)}else r.style.viewTransitionName=this._vtIdent(`${e}-${this.uid(r)}`),this._transitionFallback.add(r)},_cleanupTransition(r){if(!this._transitionProcessed.has(r))return;let t=this._transitionCleanups.get(r);t&&(t(),this._transitionCleanups.delete(r)),this._transitionFallback.has(r)&&(this._transitionFallback.delete(r),r.style.viewTransitionName=""),this._transitionProcessed.delete(r)},_reconcileTransition(r){this._cleanupTransition(r),r.hasAttribute("data-transition")&&this._processTransition(r)}};Fr[Dr]=y;if(typeof window<"u"){let r=window.VB;if(r&&r!==y)for(let t of Object.keys(r))t in y||(y[t]=r[t]);window.VB=y}typeof document<"u"&&!y._autoBooted&&(y._autoBooted=!0,document.body?y.observe():document.addEventListener("DOMContentLoaded",()=>y.observe(),{once:!0}));function se(r,t){y.deactivate(r),r.offsetWidth,t()}function Bi(r,t){if(y.prefersReducedMotion()){t();return}let e=new IntersectionObserver(([i])=>{i.isIntersecting&&(e.disconnect(),t())},{threshold:.1});return e.observe(r),()=>e.disconnect()}function Kl(r){let t=(r||"0").trim(),e=parseFloat(t);return!Number.isFinite(e)||e<0?0:/^[\d.]+s$/i.test(t)?e*1e3:e}y.trigger("scroll",(r,t)=>Bi(r,t));y.trigger("hover",(r,t)=>{let e=!1,i=!1;function s(h){let u=e||i;h==="hover"?e=!0:i=!0,u||se(r,t)}function n(){!e&&!i&&y.deactivate(r)}let o=()=>s("hover"),a=()=>{e=!1,n()},l=()=>s("focus"),c=h=>{h.relatedTarget instanceof Node&&r.contains(h.relatedTarget)||(i=!1,n())};return r.addEventListener("pointerenter",o),r.addEventListener("pointerleave",a),r.addEventListener("focusin",l),r.addEventListener("focusout",c),()=>{r.removeEventListener("pointerenter",o),r.removeEventListener("pointerleave",a),r.removeEventListener("focusin",l),r.removeEventListener("focusout",c)}});y.trigger("click",(r,t,e)=>{function i(){e==="replay"?se(r,t):r.hasAttribute("data-effect-active")?y.deactivate(r):t()}return r.addEventListener("click",i),()=>r.removeEventListener("click",i)});y.trigger("time",(r,t,e)=>{let i=setTimeout(t,Kl(e));return()=>clearTimeout(i)});y.trigger("intersect",(r,t,e)=>{if(y.prefersReducedMotion()){t();return}if((e||"once")==="toggle"){let s=new IntersectionObserver(([n])=>{n.isIntersecting?t():y.deactivate(r)},{threshold:.1});return s.observe(r),()=>s.disconnect()}return Bi(r,t)});y.trigger("media",(r,t,e)=>{if(!e)return;let i=window.matchMedia(e);function s(){i.matches?t():y.deactivate(r)}return i.addEventListener("change",s),s(),()=>i.removeEventListener("change",s)});y.trigger("event",(r,t,e)=>{if(!e)return;let i=()=>se(r,t);return r.addEventListener(e,i),()=>r.removeEventListener(e,i)});y.trigger("vt",(r,t)=>{let e=()=>se(r,t);return r.addEventListener("vb:vt-update-done",e),()=>r.removeEventListener("vb:vt-update-done",e)});var Xl=typeof CSS<"u"&&typeof CSS.supports=="function"&&CSS.supports("animation-timeline: view()");for(let r of["view-progress","scroll-progress"])y.trigger(r,(t,e)=>{if(!(Xl&&!y.prefersReducedMotion()))return Bi(t,e)});var Yl=12;function st(r,t,e){let i=y.uid(t),s=e===void 0?`${r}-${i}`:`${r}-${i}-${e}`;return typeof CSS<"u"&&CSS.escape?CSS.escape(s):s.replace(/[^\w-]/g,"_")}function dt(r,t,e){return r.style.viewTransitionName=t,e&&(r.style.viewTransitionClass=e),()=>{r.style.viewTransitionName="",e&&(r.style.viewTransitionClass="")}}y.transition("morph",r=>dt(r,st("morph",r)));function Jl(r,t){let e=(t||"forward").trim().toLowerCase();if(e==="left")return"slide-left";if(e==="right")return"slide-right";let s=!(getComputedStyle(r).direction==="rtl");return(e==="back"?!s:s)?"slide-left":"slide-right"}y.transition("slide",(r,t)=>dt(r,st("slide",r),Jl(r,t)));y.transition("fade",r=>dt(r,st("fade",r),"fade"));y.transition("scale",r=>dt(r,st("scale",r),"scale"));y.transition("none",r=>dt(r,st("none",r),"vt-none"));function Zl(r){let t=new Set,e=()=>{let s=Array.from(r.children);for(let n of t)n.parentElement!==r&&(n.style.viewTransitionName="",n.style.viewTransitionClass="",t.delete(n));s.forEach((n,o)=>{if(!(n instanceof HTMLElement))return;let a=Math.min(o,Yl-1);n.style.viewTransitionName=st("stagger",r,y.uid(n)),n.style.viewTransitionClass=`fade vt-stagger-${a}`,t.add(n)})};e();let i=new MutationObserver(e);return i.observe(r,{childList:!0}),()=>{i.disconnect();for(let s of t)s.style.viewTransitionName="",s.style.viewTransitionClass="";t.clear()}}y.transition("stagger",r=>Zl(r));y.transition("effect",(r,t)=>{let e=(t||"fade").trim();return dt(r,st("effect",r),/^-?[_a-zA-Z][\w-]*$/.test(e)?e:"fade")});var qr="data-effect-glitch-init";y.effect("glitch",r=>(r.setAttribute("data-glitch-text",(r.textContent||"").trim()),r.setAttribute(qr,""),{cleanup(){r.removeAttribute(qr),r.removeAttribute("data-glitch-text")}}));var re="vb-split-sr",Oi="vb-split";function Ql(r){return r.closest?.("[lang]")?.getAttribute("lang")||void 0}function pt(r,t){if(typeof Intl<"u"&&"Segmenter"in Intl)try{let e=new Intl.Segmenter(t,{granularity:"grapheme"});return Array.from(e.segment(r),i=>i.segment)}catch{}return Array.from(r)}function tc(r,t){let e=[],i;if(typeof Intl<"u"&&"Segmenter"in Intl)try{i=Array.from(new Intl.Segmenter(t,{granularity:"word"}).segment(r))}catch{i=null}if(!i){for(let n of r.split(/(\s+)/))n&&e.push({text:n,space:/^\s+$/.test(n)});return e}let s="";for(let n of i){if(/^\s+$/.test(n.segment)){s&&(e.push({text:s,space:!1}),s=""),e.push({text:n.segment,space:!0});continue}let o=e[e.length-1];if(!n.isWordLike){o&&!o.space?o.text+=n.segment:s+=n.segment;continue}e.push({text:s+n.segment,space:!1}),s=""}return s&&e.push({text:s,space:!1}),e}function P(r){for(let t of r.querySelectorAll(`.${re}`)){let e=t.nextElementSibling;e?.classList.contains(Oi)&&e.remove(),t.replaceWith(document.createTextNode(t.textContent||""))}r.normalize()}function Hr(r){let t=r.querySelectorAll(`.${re}`);return t.length?Array.from(t,e=>e.textContent).join(""):r.textContent||""}function ft(r,{unit:t="word",className:e="",locale:i}={}){P(r);let s=i||Ql(r),n=[],o=document.createTreeWalker(r,NodeFilter.SHOW_TEXT,{acceptNode(c){let h=c.parentElement;return h&&h.closest("script, style, template, svg, math")?NodeFilter.FILTER_REJECT:c.nodeValue&&c.nodeValue.trim()?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_REJECT}});for(;o.nextNode();)n.push(o.currentNode);let a=[],l=c=>{let h=document.createElement("span");return e&&(h.className=e),h.textContent=c,a.push(h),h};for(let c of n){let h=c.nodeValue||"",u=document.createElement("span");u.className=re,u.textContent=h;let p=document.createElement("span");if(p.className=Oi,p.setAttribute("aria-hidden","true"),t==="grapheme")for(let d of pt(h,s)){let f=l(d);/^\s+$/.test(d)&&f.setAttribute("data-space",""),p.append(f)}else for(let d of tc(h,s))p.append(d.space?document.createTextNode(d.text):l(d.text));c.replaceWith(u,p)}return a}function Ur(r,t){P(r);let e=document.createElement("span");e.className=re,e.textContent=t;let i=document.createElement("span");return i.className=Oi,i.setAttribute("aria-hidden","true"),r.replaceChildren(e,i),i}function ji(r){let t=0,e=null;for(let i of r){let s=i.getBoundingClientRect(),n=s.top;e!==null&&n-e>s.height/2&&t++,e=n,i.style.setProperty("--i",String(t))}return r.length?t+1:0}var Di="data-effect-blur-reveal-init";y.effect("blur-reveal",r=>{let t=r;if(P(t),t.removeAttribute(Di),y.prefersReducedMotion())return{cleanup(){}};t.style.setProperty("--blur-delay",y.params(t).get("blur-reveal-delay")||"80ms");let e=ft(t,{className:"vb-blur-chunk"});e.forEach((s,n)=>s.style.setProperty("--i",String(n))),t.setAttribute(Di,"");let i=null;if(t.classList.contains("line")){ji(e);let s=t.clientWidth;i=new ResizeObserver(()=>{t.clientWidth!==s&&(s=t.clientWidth,ji(e))}),i.observe(t)}return{activate(){t.setAttribute("data-effect-active","")},cleanup(){i?.disconnect(),P(t),t.removeAttribute(Di),t.style.removeProperty("--blur-delay")}}});var Fi="data-effect-typewriter-init",ec=2e3,ic=400,sc=200;y.effect("typewriter",r=>{let t=r;if(P(t),t.querySelectorAll(":scope > .vb-typewriter-cursor").forEach(u=>u.remove()),t.removeAttribute(Fi),y.prefersReducedMotion())return{cleanup(){}};let e=ft(t,{unit:"grapheme",className:"vb-typewriter-char"});t.setAttribute(Fi,"");let i=0,s=null,n=()=>{clearTimeout(i),i=0},o=()=>!!t.closest("[data-paused]"),a=(u,p)=>{i=window.setTimeout(function d(){if(o()){i=window.setTimeout(d,sc);return}u()},p)},l=u=>e.forEach((p,d)=>{p.hidden=d>=u}),c=(u,p)=>{let d=u+p;for(;d>0&&d<e.length&&e[d-1].hasAttribute("data-space");)d+=p;return d};function h(){n();let u=y.params(t),p=u.getTime("typewriter-speed",50),d=u.getTime("typewriter-delay",0),f=t.classList.contains("loop");!s&&!t.classList.contains("no-cursor")&&(s=document.createElement("span"),s.className="vb-typewriter-cursor",s.textContent="|",s.setAttribute("aria-hidden","true"),t.append(s));let m=0;l(0);let b=()=>{m<e.length?(m=c(m,1),l(m),a(b,p)):f&&a(w,ec)},w=()=>{m>0?(m=Math.max(0,c(m,-1)),l(m),a(w,p/2)):a(b,ic)};a(b,d)}return{activate(){h()},cleanup(){n(),s?.remove(),s=null,P(t),t.removeAttribute(Fi)}}});var qi="data-effect-scramble-init",rc="!<>-_\\/[]{}=+*^?#";function nc(r){let t=y.params(r).get("scramble-chars"),e=/^(['"])(.*)\1$/.exec(t);e&&(t=e[2]);let i=pt(t);return i.length?i:pt(rc)}var oc=r=>r[Math.floor(Math.random()*r.length)];y.effect("scramble",r=>{let t=r;if(P(t),t.removeAttribute(qi),y.prefersReducedMotion())return{cleanup(){}};let e=ft(t,{unit:"grapheme",className:"vb-scramble-char"}),i=e.map(c=>c.textContent||""),s=e.flatMap((c,h)=>c.hasAttribute("data-space")?[]:[h]);t.setAttribute(qi,"");let n=0,o=()=>{clearTimeout(n),n=0},a=()=>e.forEach((c,h)=>{c.textContent=i[h]});function l(){o();let c=y.params(t),h=c.getTime("scramble-duration",1500),u=Math.max(1,c.getTime("scramble-speed",30)),p=nc(t),d=Math.max(1,Math.ceil(h/u)),f=0,m=()=>{let b=Math.floor(f/d*s.length);s.forEach((w,k)=>{e[w].textContent=k<b?i[w]:oc(p)}),f++,f<=d?n=window.setTimeout(m,u):a()};m()}return{activate(){l()},cleanup(){o(),P(t),t.removeAttribute(qi)}}});var Vr="animate-image-wrapper";function ac(r){let t=(r.getAttribute("alt")||"").trim(),e=D(r,"animation-pause","Pause animation");return e.includes("{alt}")?e.replace("{alt}",t).trim():t?`${e}: ${t}`:e}y.effect("animate-image",r=>{let t=r;if(t.tagName!=="IMG"||!t.parentNode)return{cleanup(){}};t.removeAttribute("data-effect-animate-image-init"),t.hasAttribute("alt")||console.warn("[animate-image] Image has no alt text; describe what the animation shows.",t);let e=t.getAttribute("data-animate-image-src");if(e){t.src=e;let C=t.getAttribute("data-animate-image-srcset");C&&(t.srcset=C),t.removeAttribute("data-animate-image-src"),t.removeAttribute("data-animate-image-srcset")}let i=t.parentElement?.tagName==="PICTURE"?t.parentElement:null,s=i||t,n=i?[...i.querySelectorAll(":scope > source")]:[],o=s.parentElement?.classList.contains(Vr)?s.parentElement:null,a=o||document.createElement("span");o?a.querySelectorAll(":scope > .animate-image-toggle, :scope > .animate-image-placeholder").forEach(C=>C.remove()):(a.className=Vr,s.parentNode?.insertBefore(a,s),a.appendChild(s));let l=document.createElement("span");l.className="animate-image-placeholder",l.hidden=!0,a.appendChild(l);let c=document.createElement("button");c.type="button",c.className="animate-image-toggle",c.setAttribute("aria-pressed","false"),c.setAttribute("aria-label",ac(t)),a.appendChild(c);let h=t.hasAttribute("data-animate-image-paused"),u=t.getAttribute("data-poster"),p=!1,d=!1,f=null;function m(){if(u||!t.naturalWidth)return;let C=document.createElement("canvas");C.width=t.naturalWidth,C.height=t.naturalHeight;let $=C.getContext("2d");if($)try{$.drawImage(t,0,0),u=C.toDataURL("image/png")}catch{u=null}}function b(){c.setAttribute("aria-pressed",String(p)),c.classList.toggle("paused",p),t.toggleAttribute("data-animate-image-paused",p)}function w({auto:C=!1}={}){if(!p){if(m(),p=!0,d=C,f={src:t.currentSrc||t.src,srcset:t.getAttribute("srcset"),sizes:t.getAttribute("sizes"),sources:n.map($=>[$,$.getAttribute("srcset"),$.getAttribute("sizes")])},t.setAttribute("data-animate-image-src",t.getAttribute("src")||f.src),f.srcset&&t.setAttribute("data-animate-image-srcset",f.srcset),u){for(let[$]of f.sources)$.removeAttribute("srcset"),$.removeAttribute("sizes");t.removeAttribute("srcset"),t.removeAttribute("sizes"),t.src=u}else l.textContent=t.getAttribute("alt")||"",l.hidden=!1,a.setAttribute("data-animate-image-hidden","");b()}}function k(){if(p){if(p=!1,d=!1,f){for(let[C,$,Gi]of f.sources)$!=null&&C.setAttribute("srcset",$),Gi!=null&&C.setAttribute("sizes",Gi);f.sizes!=null&&t.setAttribute("sizes",f.sizes),f.srcset!=null&&t.setAttribute("srcset",f.srcset),t.src=t.getAttribute("data-animate-image-src")||f.src}f=null,t.removeAttribute("data-animate-image-src"),t.removeAttribute("data-animate-image-srcset"),l.hidden=!0,a.removeAttribute("data-animate-image-hidden"),b()}}c.addEventListener("click",()=>p?k():w());function A(C){t.complete&&t.naturalWidth?C():t.addEventListener("load",C,{once:!0})}A(m),h?A(()=>w()):y.prefersReducedMotion()&&A(()=>w({auto:!0}));let T=()=>{y.prefersReducedMotion()?A(()=>w({auto:!0})):d&&k()},O=window.matchMedia("(prefers-reduced-motion: reduce)");O.addEventListener("change",T);let _=new MutationObserver(T);return _.observe(document.documentElement,{attributes:!0,attributeFilter:["data-motion-reduced"]}),{cleanup(){O.removeEventListener("change",T),_.disconnect(),p&&k(),t.toggleAttribute("data-animate-image-paused",h),c.remove(),l.remove(),a.parentNode&&(a.parentNode.insertBefore(s,a),a.remove())}}});var Wr="vb-stamp-noise",mt="http://www.w3.org/2000/svg";function lc(){if(document.getElementById(Wr))return;let r=document.createElementNS(mt,"svg");r.setAttribute("aria-hidden","true"),r.setAttribute("focusable","false"),r.setAttribute("width","0"),r.setAttribute("height","0"),r.style.position="absolute",r.style.overflow="hidden";let t=document.createElementNS(mt,"filter");t.id=Wr;for(let[o,a]of Object.entries({x:"-5%",y:"-5%",width:"110%",height:"110%"}))t.setAttribute(o,a);let e=document.createElementNS(mt,"feTurbulence");for(let[o,a]of Object.entries({type:"fractalNoise",baseFrequency:"0.75",numOctaves:"4",stitchTiles:"stitch",result:"noise"}))e.setAttribute(o,a);let i=document.createElementNS(mt,"feColorMatrix");for(let[o,a]of Object.entries({type:"saturate",values:"0",in:"noise",result:"greyNoise"}))i.setAttribute(o,a);let s=document.createElementNS(mt,"feComposite");for(let[o,a]of Object.entries({in:"SourceGraphic",in2:"greyNoise",operator:"in"}))s.setAttribute(o,a);t.append(e,i,s);let n=document.createElementNS(mt,"defs");n.append(t),r.append(n),document.body.prepend(r)}y.effect("stamp",()=>(lc(),{cleanup(){}}));var Gr="data-effect-flipboard-init",ne=" ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789.,:!?/-",cc=60,hc=30,uc=80,K="\xA0",Kr=new WeakMap;function dc(){let r=document.createElement("span");r.className="vb-flap-char";for(let e of["top","bottom","flip-top","flip-bottom"]){let i=document.createElement("span");i.className=`vb-flap-${e}`;let s=document.createElement("span");s.className="vb-flap-text",s.textContent=K,i.append(s),r.append(i)}let t=document.createElement("span");return t.className="vb-flap-hinge",r.append(t),r}function Xr(r,t){for(let e of r.querySelectorAll(".vb-flap-text"))e.textContent=t||K}function oe(r,t){return new Promise(e=>{let i=window.setTimeout(()=>{r.timers.delete(i),e(void 0)},t);r.timers.add(i)})}async function pc(r,t,e,i,s){let n=t.querySelector(".vb-flap-top .vb-flap-text"),o=t.querySelector(".vb-flap-bottom .vb-flap-text"),a=t.querySelector(".vb-flap-flip-top"),l=t.querySelector(".vb-flap-flip-bottom");n.textContent=e||K,o.textContent=e||K,a.querySelector(".vb-flap-text").textContent=e||K,l.querySelector(".vb-flap-text").textContent=i||K,a.classList.add("vb-flap-flipping"),l.classList.add("vb-flap-flipping"),await oe(r,s/2),n.textContent=i||K,await oe(r,s/2),o.textContent=i||K,a.classList.remove("vb-flap-flipping"),l.classList.remove("vb-flap-flipping")}async function fc(r,t,e,i,s,n){for(let o=0;o<i;o++){if(r.generation!==s)return;let a=o===i-1,l=ne[o%ne.length],c=a?e:ne[(o+1)%ne.length];await pc(r,t,l,c,n),a||await oe(r,hc)}}function Yr(r){r.generation++;for(let t of r.timers)clearTimeout(t);r.timers.clear()}function mc(r,t){let e=Ur(r,t.original);return r.classList.add("vb-flap-board"),t.chars.map(()=>e.appendChild(dc()))}function gc(r,t){Yr(t);let e=r,i=y.params(e).getTime("flip-ms",cc);e.style.setProperty("--_vb-flip-duration",`${i}ms`);let s=mc(r,t),n=t.generation;if(y.prefersReducedMotion()){s.forEach((o,a)=>Xr(o,t.chars[a]));return}Promise.all(s.map(async(o,a)=>{if(await oe(t,a*uc),t.generation!==n)return;let l=4+Math.floor(Math.random()*7);await fc(t,o,t.chars[a],l,n,i)})).then(()=>{t.generation===n&&s.forEach((o,a)=>Xr(o,t.chars[a]))})}y.effect("flipboard",r=>{let t=Hr(r).trim();if(P(r),r.classList.remove("vb-flap-board"),!t)return{cleanup(){}};let e={original:t,chars:pt(t.toLocaleUpperCase(r.closest("[lang]")?.getAttribute("lang")||void 0)),generation:0,timers:new Set};return Kr.set(r,e),r.setAttribute(Gr,""),gc(r,e),{cleanup(){Yr(e),Kr.delete(r),r.textContent=e.original,r.classList.remove("vb-flap-board"),r.removeAttribute(Gr),r.style.removeProperty("--_vb-flip-duration")}}});var ae=new Map,Hi=null,le=!1;function bc(r){for(let[t,e]of ae)r.querySelectorAll(t).forEach(e)}function vc(r){if(r.nodeType!==Node.ELEMENT_NODE)return;let t=r;for(let[e,i]of ae)t.matches(e)&&i(t),t.querySelectorAll(e).forEach(i)}function yc(){Hi||(Hi=new MutationObserver(r=>{for(let t of r)for(let e of t.addedNodes)vc(e)}),Hi.observe(document.documentElement,{childList:!0,subtree:!0}))}function wc(){le||(le=!0,bc(document))}function Jr(r,t){ae.set(r,t),yc(),le||document.readyState!=="loading"?(le=!0,document.querySelectorAll(r).forEach(t)):ae.size===1&&document.addEventListener("DOMContentLoaded",wc)}var X=null;async function kc(){if(X)return;X=(await Promise.resolve().then(()=>(ke(),we))).resolveEmoji}var Qr="[data-emoji]",tn=/(?<![\p{L}\p{N}_]):([a-z0-9_+-]+):/gu,Ac=/[a-z]/,xc="script,style,code,pre,kbd,samp,var,textarea,code-block,[data-emoji-skip]",Ui=["alt","title","aria-label"],en=new Set(["INPUT","TEXTAREA"]),Ec=100,Sc=new Set(["insertFromPaste","insertFromDrop","insertReplacementText","insertFromYank"]),rt=new WeakMap;function Vi(r,t="keep"){if(!X||!r.includes(":"))return r;let e=X;return r.replace(tn,(i,s)=>{let n=e(s);return n?n.emoji:t==="strip"&&Ac.test(s)?"":i})}function Cc(r){return r.getAttribute("data-emoji-unknown")==="strip"?"strip":"keep"}function Tc(r){if(rt.has(r)||!r.hasAttribute("data-emoji"))return;if(r.removeAttribute("data-emoji-init"),en.has(r.tagName)){rt.set(r,Mc(r));return}if(Wi(r),r.getAttribute("data-emoji-scan")!=="observe"){rt.set(r,()=>{});return}let t=null,e=new MutationObserver(()=>{t&&clearTimeout(t),t=setTimeout(()=>{t=null,Wi(r)},Ec)});e.observe(r,{childList:!0,subtree:!0,characterData:!0,attributes:!0,attributeFilter:Ui}),rt.set(r,()=>{e.disconnect(),t&&clearTimeout(t)})}function Lc(r){let t=rt.get(r);t&&(t(),rt.delete(r))}function Mc(r){let t=!1,e=!1,i=()=>{t=!0},s=()=>{t=!1,o(!0)},n=a=>{let{isComposing:l,inputType:c}=a;t||l||c==="historyUndo"||c==="historyRedo"||o(!!c&&!Sc.has(c))};function o(a=!1){if(!e){e=!0;try{_c(r,a)}finally{e=!1}}}return r.addEventListener("compositionstart",i),r.addEventListener("compositionend",s),r.addEventListener("input",n),r.value&&o(),()=>{r.removeEventListener("compositionstart",i),r.removeEventListener("compositionend",s),r.removeEventListener("input",n)}}function _c(r,t=!1){if(!X)return;let e=r.value,i=r.selectionStart,s=[];for(let a of e.matchAll(tn)){let l=a.index??0,c=l+a[0].length;if(t&&i!==null&&c!==i)continue;let h=X(a[1]);h&&s.push({start:l,end:c,emoji:h.emoji})}if(s.length===0)return;if(r.selectionStart===null){r.value=Vi(e,"keep");return}let n=r.selectionStart??e.length,o=document.activeElement===r&&typeof document.execCommand=="function";for(let a=s.length-1;a>=0;a--){let{start:l,end:c,emoji:h}=s[a];n>=c?n-=c-l-h.length:n>l&&(n=l+h.length);let u=!1;if(o){r.setSelectionRange(l,c);try{u=document.execCommand("insertText",!1,h)&&r.value.slice(l,l+h.length)===h}catch{u=!1}}u||r.setRangeText(h,l,c)}r.setSelectionRange(n,n)}function Zr(r,t){if(r.isContentEditable)return!0;let e=r.closest(xc);return!!(e&&e!==t&&t.contains(e))}function Wi(r){if(!X)return;let t=Cc(r),e=document.createTreeWalker(r,NodeFilter.SHOW_TEXT,{acceptNode(o){let a=o.parentElement;return!a||Zr(a,r)?NodeFilter.FILTER_REJECT:(o.textContent??"").includes(":")?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}}),i=[];for(;e.nextNode();)i.push(e.currentNode);for(let o of i){let a=o.textContent??"",l=Vi(a,t);l!==a&&(o.textContent=l)}let s=Ui.map(o=>`[${o}*=":"]`).join(","),n=[r,...r.querySelectorAll(s)];for(let o of n)if(!(o!==r&&Zr(o,r)))for(let a of Ui){let l=o.getAttribute(a);if(!l)continue;let c=Vi(l,t);c!==l&&o.setAttribute(a,c)}}document.addEventListener("vb:emoji-extended",()=>{if(X)for(let r of document.querySelectorAll(Qr))!rt.has(r)||en.has(r.tagName)||Wi(r)});function sn(r){kc().then(()=>Tc(r))}Jr(Qr,sn);new MutationObserver(r=>{for(let{target:t}of r){let e=t;e.hasAttribute("data-emoji")?sn(e):Lc(e)}}).observe(document.documentElement,{attributes:!0,attributeFilter:["data-emoji"],subtree:!0});
1323
+ }`)}function xc(r){for(let t of r)ot.set(t,(ot.get(t)??0)+1);dn()}function Ec(r){for(let t of r){let e=(ot.get(t)??0)-1;e>0?ot.set(t,e):ot.delete(t)}dn()}function Sc(r){let t=zt.get(r),e=t?[...t.values()].flat():[];e.length===0?(CSS.highlights.delete(`hn-${r}`),zt.delete(r)):CSS.highlights.set(`hn-${r}`,new Highlight(...e))}function ln(r,t){let e=new Set(t.keys());for(let[i,s]of zt)s.has(r)&&e.add(i);for(let i of e){let s=t.get(i)??[],n=zt.get(i);s.length?(n||zt.set(i,n=new Map),n.set(r,s)):n?.delete(r),Sc(i)}}function Gi(r){return document.createTreeWalker(r,NodeFilter.SHOW_TEXT,t=>t.parentElement?.closest(".hn-margin-annotation")?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT)}function le(r){let t=Gi(r),e="";for(;t.nextNode();)e+=t.currentNode.textContent??"";return e}function cn(r,t,e){let i=Gi(r),s=0;for(;i.nextNode();){if(i.currentNode===t)return s+e;s+=(i.currentNode.textContent??"").length}return-1}function Hi(r,t,e){let i=Gi(r),s=0,n=null,o=0,a=null,l=0;for(;i.nextNode();){let c=i.currentNode,h=(c.textContent??"").length;if(!n&&s+h>t&&(n=c,o=t-s),s+h>=e){a=c,l=e-s;break}s+=h}if(!n||!a)return null;try{let c=document.createRange();return c.setStart(n,Math.min(o,(n.textContent??"").length)),c.setEnd(a,Math.min(l,(a.textContent??"").length)),c}catch{return null}}var Wi=class{#t;#e;#i;#s;#r=[];#n=[];#a=!vc;#c;#h;#l=!1;#o=[];#u=new Map;constructor(t){this.#t=t,this.#s=t.hasAttribute("data-highlights-readonly");let e=t.dataset.highlights;this.#e=e&&e!==""?e:location.pathname;let i=t.dataset.highlightsColors,s=i?i.split(",").map(n=>n.trim()).filter(Vi):[...yc];this.#i=[...new Set(s)],this.#a||xc(this.#i),this.#b(),this.#s||(this.#c=this.#d.bind(this),this.#h=this.#f.bind(this),t.addEventListener("pointerup",this.#c),t.addEventListener("click",this.#h)),t.setAttribute("data-highlights-init",""),this.#w().then(()=>{this.#l||(this.#b(),this.#A())})}get colors(){return[...this.#i]}get destroyed(){return this.#l}get element(){return this.#t}getHighlights(){return this.#r.map(t=>({...t}))}getUnplaced(){return this.#n.map(t=>({...t}))}removeHighlight(t){let e=this.#r.findIndex(s=>s.id===t),i=this.#n.findIndex(s=>s.id===t);e<0&&i<0||(e>=0?this.#r.splice(e,1):this.#n.splice(i,1),this.#m(),this.#b(),this.#k("highlights:removed",{id:t}),K(ae(this.#t,"removed")))}clearAll(){this.#r=[],this.#n=[],this.#m(),this.#b()}exportHighlights(){return JSON.stringify({version:1,highlights:this.#r})}importHighlights(t){let e;try{e=typeof t=="string"?JSON.parse(t):t}catch{return{imported:0,rejected:0}}if(!e||!Array.isArray(e.highlights))return{imported:0,rejected:0};let i=this.#p(e.highlights);return this.#r=i,this.#n=[],this.#m(),this.#b(),{imported:i.length,rejected:e.highlights.length-i.length}}#p(t,e=le(this.#t).length){let i={textLength:e,colors:this.#i},s=new Set,n=[];for(let o of t){let a=kc(o,i);!a||s.has(a.id)||(s.add(a.id),n.push(a))}return n}destroy(){this.#l||(this.#l=!0,this.#c&&this.#t.removeEventListener("pointerup",this.#c),this.#h&&this.#t.removeEventListener("click",this.#h),this.#a?this.#t.querySelectorAll("mark[data-hn-id]").forEach(t=>{let e=t.parentNode;for(;t.firstChild;)e.insertBefore(t.firstChild,t);e.removeChild(t),e.normalize()}):(ln(this,new Map),Ec(this.#i)),this.#T(),this.#u.clear(),this.#t.removeAttribute("data-highlights-init"),ce.get(this.#t)===this&&ce.delete(this.#t))}#d(){requestAnimationFrame(()=>{if(this.#l)return;let t=window.getSelection();if(!t||t.isCollapsed||!t.toString().trim())return;let e=t.getRangeAt(0);this.#t.contains(e.commonAncestorContainer)&&this.#k("highlights:selected",{text:t.toString().trim(),rect:e.getBoundingClientRect()})})}#f(t){let e=t.target.closest?.(".hn-margin-annotation");if(e){let s=e.dataset.hnId,n=this.#r.find(o=>o.id===s);if(n){this.#k("highlights:clicked",{id:s,highlight:{...n}}),this.#k("highlights:request-note",{id:s,highlight:{...n},controller:this});return}}let i=t.target.closest?.("mark[data-hn-id]");if(i){let s=i.dataset.hnId,n=this.#r.find(o=>o.id===s);if(n){this.#k("highlights:clicked",{id:s,highlight:{...n}});return}}if(!this.#a){let s=this.#g(t.clientX,t.clientY);s&&this.#k("highlights:clicked",{id:s.id,highlight:{...s}})}}findHighlightRect(t){let e=this.#r.find(n=>n.id===t);if(!e)return null;let i=this.#v(e);if(!i)return null;let s=i.getClientRects();return s.length?s[0]:null}#v(t){return this.#u.get(t.id)??Hi(this.#t,t.startOffset,t.endOffset)}#y(){this.#u.clear();for(let t of this.#r){let e=Hi(this.#t,t.startOffset,t.endOffset);e&&this.#u.set(t.id,e)}}#g(t,e){for(let i of this.#r){let s=this.#u.get(i.id);if(!s)continue;let n=s.getClientRects();for(let o of n)if(t>=o.left&&t<=o.right&&e>=o.top&&e<=o.bottom)return i}return null}_createFromSelection(t){let e=window.getSelection();if(!e||e.isCollapsed)return;let i=e.getRangeAt(0);if(!this.#t.contains(i.commonAncestorContainer))return;let s=cn(this.#t,i.startContainer,i.startOffset),n=cn(this.#t,i.endContainer,i.endOffset);if(s<0||n<0||s>=n)return;let o=e.toString().trim(),a={id:un(),startOffset:s,endOffset:n,text:o,...oe(le(this.#t),s,n),color:t,note:"",created:Date.now()};this.#r.push(a),this.#m(),this.#b(),e.removeAllRanges(),this.#k("highlights:added",{id:a.id,text:o,color:t,note:""}),K(ae(this.#t,"added"))}_changeColor(t,e){let i=this.#r.find(s=>s.id===t);i&&(i.color=e,this.#m(),this.#b())}_updateNote(t,e){let i=this.#r.find(s=>s.id===t);i&&(i.note=e,this.#m(),this.#E(),this.#k("highlights:note-changed",{id:t,note:e}),K(ae(this.#t,"noteSaved")))}async#w(){let t=await $.get(nn,this.#e);if(!t||!Array.isArray(t.highlights)||this.#l)return;let e=Array.isArray(t.unplaced)?t.unplaced:[],i=this.#p([...t.highlights,...e],1/0),s=le(this.#t);if(e.length===0&&t.contentHash===on(s)){this.#r=i;return}this.#r=[],this.#n=[];for(let n of i){let o=sn(s,n);o?this.#r.push({...n,startOffset:o.start,endOffset:o.end,...oe(s,o.start,o.end)}):this.#n.push(n)}this.#m()}#A(){this.#n.length!==0&&(console.warn(`[highlights] ${this.#n.length} stored highlight(s) could not be found in the current text. They are kept in storage.`,this.#t),this.#k("highlights:unplaced",{highlights:this.getUnplaced()}))}#m(){let t={version:1,contentHash:on(le(this.#t)),highlights:this.#r,...this.#n.length?{unplaced:this.#n}:{}};$.set(nn,this.#e,t).catch(()=>{})}#b(){this.#a?(this.#x(),this.#y()):(this.#y(),this.#S()),this.#E()}#S(){let t=new Map;for(let e of this.#i)t.set(e,[]);for(let e of this.#r){let i=this.#u.get(e.id);i&&t.has(e.color)&&t.get(e.color).push(i)}ln(this,t)}#x(){this.#t.querySelectorAll("mark[data-hn-id]").forEach(e=>{let i=e.parentNode;for(;e.firstChild;)i.insertBefore(e.firstChild,e);i.removeChild(e)}),this.#t.normalize();let t=[...this.#r].sort((e,i)=>i.startOffset-e.startOffset);for(let e of t){let i=Hi(this.#t,e.startOffset,e.endOffset);if(!i)continue;let s=document.createElement("mark");s.dataset.hnId=e.id,Vi(e.color)&&(s.dataset.hnColor=e.color,s.style.setProperty("--_hn-color",`var(--highlight-${e.color})`),s.style.setProperty("--_hn-ink",`var(--highlight-${e.color}-ink, var(--highlight-ink))`));try{i.surroundContents(s)}catch{let n=i.extractContents();s.appendChild(n),i.insertNode(s)}}}#T(){for(let t of this.#o)t.remove();this.#o=[]}#E(){if(this.#T(),this.#r.length===0)return;getComputedStyle(this.#t).position==="static"&&(this.#t.style.position="relative");let e=this.#t.getBoundingClientRect(),i=ae(this.#t,"annotation");for(let s of this.#r){let n=this.#u.get(s.id);if(!n)continue;let o=n.getClientRects();if(o.length===0)continue;let a=o[0].top-e.top,l=document.createElement("span");if(l.className="hn-margin-annotation",l.dataset.hnId=s.id,l.setAttribute("aria-hidden","true"),l.style.insetBlockStart=`${a}px`,s.note){let c=document.createElement("span");c.className="hn-note-indicator",c.textContent="*",l.append(c,` ${i}`),l.classList.add("hn-has-note")}else l.textContent=i;this.#t.appendChild(l),this.#o.push(l)}}#k(t,e={}){this.#t.dispatchEvent(new CustomEvent(t,{detail:e,bubbles:!0}))}};function G(r){let t=ce.get(r);if(t&&!t.destroyed)return t;let e=new Wi(r);return ce.set(r,e),e}function hn(r=document){r.querySelectorAll(Ui).forEach(t=>{t.hasAttribute("data-highlights-init")||G(t)})}document.readyState==="loading"?document.addEventListener("DOMContentLoaded",()=>hn()):hn();var Cc=new MutationObserver(r=>{for(let t of r)for(let e of t.addedNodes){if(e.nodeType!==Node.ELEMENT_NODE)continue;let i=e;i.matches(Ui)&&G(i),i.querySelectorAll(Ui).forEach(s=>{s.hasAttribute("data-highlights-init")||G(s)})}});Cc.observe(document.documentElement,{childList:!0,subtree:!0});var Tc=["yellow","green","blue","pink"],Mc=/^[a-z0-9_-]+$/i,Lc=["annotation","added","removed"],_c=0,Ki=class extends b{#t=null;#e=null;#i="yellow";#s=null;#r=null;#n=!1;#a=null;setup(){this.#s=this.closest("selection-menu");let t=this.#y();t.includes(this.#i)||(this.#i=t[0]??"yellow"),this.#s?this.#c():this.#f()}teardown(){this.#t?.destroy(),this.#t=null,this.#a?.remove(),this.#a=null,this.#n?this.#r?.remove():this.#r?.removeAttribute("aria-expanded"),this.#r=null,this.#n=!1,this.#s=null}#c(){let t=this.hasAttribute("readonly");for(let n of this.#p())this.#d(n);if(t)return;let e=this.#y(),i=this.querySelector(":scope > button");if(this.#n=!i,!i){i=document.createElement("button"),i.type="button",i.setAttribute("aria-label",this.dataset.labelButton||"Highlight selection");let n=document.createElement("icon-wc");n.setAttribute("name","highlighter"),n.setAttribute("size","sm"),n.setAttribute("aria-hidden","true"),i.appendChild(n),this.appendChild(i)}this.#r=i;let s=document.createElement("div");s.className="highlight-color-dropdown",s.id=`highlight-palette-${++_c}`,s.setAttribute("role","group"),s.setAttribute("aria-label",this.dataset.labelPalette||"Highlight color"),s.hidden=!0;for(let n of e){let o=document.createElement("button");o.type="button",o.className="highlight-color-swatch",o.dataset.color=n,o.title=n,o.setAttribute("aria-label",n),o.setAttribute("aria-pressed",String(n===this.#i)),o.style.setProperty("--_swatch",`var(--highlight-${n})`),s.appendChild(o)}this.appendChild(s),this.#a=s,i.setAttribute("aria-expanded","false"),i.setAttribute("aria-controls",s.id),this.listen(i,"click",n=>{n.stopPropagation(),this.#h(s.hidden)}),this.listen(s,"click",n=>{let o=n.target.closest?.(".highlight-color-swatch");o&&(n.stopPropagation(),this.#o(o.dataset.color??this.#i),this.#h(!1),this.#u(this.#i))}),this.listen(this,"keydown",n=>{let o=n;o.key!=="Escape"||s.hidden||(o.stopPropagation(),this.#h(!1),i.focus())}),this.listen(document,"pointerdown",n=>{!s.hidden&&!this.contains(n.target)&&this.#h(!1)}),this.listen(this.#s,"selection-menu:dismiss",()=>this.#h(!1))}#h(t){!this.#a||!this.#r||(this.#a.hidden=!t,this.#r.setAttribute("aria-expanded",String(t)),t&&(this.#l(),(this.#a.querySelector('[aria-pressed="true"]')??this.#a.firstElementChild)?.focus({preventScroll:!0})))}#l(){let t=this.#a;if(!t)return;t.style.removeProperty("--_hn-shift");let{left:e,right:i}=t.getBoundingClientRect(),s=8,n=e<s?s-e:i>window.innerWidth-s?window.innerWidth-s-i:0;n&&t.style.setProperty("--_hn-shift",`${n}px`)}#o(t){this.#i=t,this.#a?.querySelectorAll(".highlight-color-swatch").forEach(e=>e.setAttribute("aria-pressed",String(e.dataset.color===t)))}#u(t){let e=this.#s,i=e?.getSelection?.();if(!i?.target)return;let s=this.#d(i.target);if(!s)return;let n=window.getSelection();n&&(n.isCollapsed||!n.rangeCount)&&i.range&&(n.removeAllRanges(),n.addRange(i.range)),s._createFromSelection(t),this.#e=i.target,e.dismiss?.()}#p(){let t=this.#s;if(!t)return[];let e=new Set,i=t.getAttribute("for"),s=i&&document.getElementById(i);return s&&e.add(s),t.id&&document.querySelectorAll(`[data-selection-menu="${CSS.escape(t.id)}"]`).forEach(n=>e.add(n)),[...e]}#d(t){t.hasAttribute("data-highlights-init")||(t.setAttribute("data-highlights",this.getAttribute("storage-key")||""),this.hasAttribute("colors")&&t.setAttribute("data-highlights-colors",this.getAttribute("colors")??""));for(let i of Lc){let s=this.getAttribute(`data-label-${i}`);s&&t.setAttribute(`data-highlights-label-${i}`,s)}let e=G(t);return this.hasAttribute("readonly")&&!t.hasAttribute("data-highlights-readonly")&&(t.setAttribute("data-highlights-readonly",""),e.destroy(),e=G(t)),e}#f(){let t=this.#v();t&&(this.#t=this.#d(t))}#v(){let t=this.getAttribute("for");return t?document.getElementById(t):this.firstElementChild}#y(){let t=this.getAttribute("colors"),e=t?t.split(",").map(i=>i.trim()).filter(i=>Mc.test(i)):[];return e.length?[...new Set(e)]:[...Tc]}#g(){if(this.#t&&!this.#t.destroyed)return this.#t;let t=this.#e?.isConnected?this.#e:this.#p()[0];return t?this.#d(t):null}highlightSelection(t=this.#i){this.hasAttribute("readonly")||!this.#y().includes(t)||(this.#o(t),this.#s?this.#u(t):this.#t?._createFromSelection(t))}getHighlights(){return this.#g()?.getHighlights()??[]}removeHighlight(t){this.#g()?.removeHighlight(t)}clearAll(){this.#g()?.clearAll()}exportHighlights(){return this.#g()?.exportHighlights()??'{"version":1,"highlights":[]}'}importHighlights(t){return this.#g()?.importHighlights(t)??{imported:0,rejected:0}}};g("highlight-wc",Ki);var he=CSS.supports("anchor-name","--x"),Rc=CSS.supports("position-area","bottom"),Nc=(()=>{let r=document.createElement("span");return r.setAttribute("popover","hint"),r.popover==="hint"})(),$c=["auto","manual","hint"];function Pc(r){let t=$c.includes(r||"")?r:"auto";return t==="hint"&&!Nc?"auto":t}var Ic=["top","bottom","left","right","inset-inline-start","inset-inline-end"],Oc=["position","top","left","right","bottom","margin"],pn=8,zc=0,Bc=0;function fn(r){return!r||r==="none"?[]:r.split(",").map(t=>t.trim()).filter(Boolean)}var Yi=class extends b{static get observedAttributes(){return["data-mode","data-anchor","data-position"]}#t=null;#e=null;#i=`--pop-over-anchor-${++Bc}`;#s=!1;#r=!1;#n=!1;setup(){if(this.id||(this.id=`pop-over-${++zc}`),(!this.hasAttribute("popover")||this.#s)&&this.#a(),this.#c(),this.#h(),this.listen(this,"beforetoggle",t=>{let e=t.newState==="open"?"show":"hide";this.dispatchEvent(new CustomEvent(`pop-over:${e}`,{detail:{state:t.newState},bubbles:!0,composed:!0})),!he&&t.newState==="open"&&this.#t&&queueMicrotask(()=>{this.matches(":popover-open")&&this.#u()})}),!he){let t=()=>{this.matches(":popover-open")&&this.#t&&this.#u()};this.listen(window,"resize",t),this.listen(window,"scroll",t,{capture:!0,passive:!0})}}teardown(){this.#l(),this.#r&&(Ic.forEach(t=>this.style.removeProperty(t)),this.#r=!1),this.#n&&(Oc.forEach(t=>this.style.removeProperty(t)),this.#n=!1),this.#t=null}attributeChangedCallback(t,e,i){if(e!==i){if(!this.hasAttribute("data-upgraded")){t==="data-mode"&&this.hasAttribute("popover")&&!this.isConnected&&(this.#s=!0);return}if(t==="data-mode"){this.#a();return}this._reinit()}}#a(){let t=Pc(this.dataset.mode);this.getAttribute("popover")!==t&&this.setAttribute("popover",t),this.#s=!0}show(){this.matches(":popover-open")||(this.showPopover(),!he&&this.#t&&this.matches(":popover-open")&&this.#u())}hide(){this.matches(":popover-open")&&this.hidePopover()}toggle(){this.matches(":popover-open")?this.hide():this.show()}get open(){return this.matches(":popover-open")}#c(){let t=this.dataset.anchor;if(t){let e=document.getElementById(t);if(!e)try{e=document.querySelector(t)}catch{e=null}this.#t=e}else this.#t=document.querySelector(`[popovertarget="${CSS.escape(this.id)}"]`)}#h(){if(!this.#t||!he)return;let t=this.#t,e=t.style.getPropertyValue("anchor-name"),i=fn(e||getComputedStyle(t).getPropertyValue("anchor-name"));i.includes(this.#i)||i.push(this.#i),t.style.setProperty("anchor-name",i.join(", ")),this.#e=this.#i,this.style.setProperty("position-anchor",this.#i),this.setAttribute("data-anchor-name",this.#i),Rc||this.#o(this.dataset.position||"bottom")}#l(){if(this.#t&&this.#e){let t=fn(this.#t.style.getPropertyValue("anchor-name")).filter(e=>e!==this.#e);t.length?this.#t.style.setProperty("anchor-name",t.join(", ")):this.#t.style.removeProperty("anchor-name")}this.#e=null,this.style.getPropertyValue("position-anchor")&&this.style.removeProperty("position-anchor"),this.hasAttribute("data-anchor-name")&&this.removeAttribute("data-anchor-name")}#o(t){let e="var(--_pop-over-offset, var(--size-xs))",i=t.endsWith("-end")?{"inset-inline-end":"anchor(end)"}:{"inset-inline-start":"anchor(start)"},s={top:{bottom:`calc(anchor(top) + ${e})`,...i},bottom:{top:`calc(anchor(bottom) + ${e})`,...i},left:{right:`calc(anchor(left) + ${e})`,top:"anchor(top)"},right:{left:`calc(anchor(right) + ${e})`,top:"anchor(top)"}},n=t.split("-")[0],o=s[n]||s.bottom;Object.entries(o).forEach(([a,l])=>this.style.setProperty(a,l)),this.#r=!0}#u(){if(!this.#t)return;let t=this.#t.getBoundingClientRect(),e=this.dataset.position||"bottom",i=this.#p(),s=document.documentElement.clientWidth,n=document.documentElement.clientHeight;this.style.position="fixed",this.style.margin="0",this.style.right="auto",this.style.bottom="auto",this.#n=!0;let o=this.offsetWidth,a=this.offsetHeight,l=e.split("-")[0];["top","bottom","left","right"].includes(l)||(l="bottom");let c={top:t.top-i,bottom:n-t.bottom-i,left:t.left-i,right:s-t.right-i},h={top:"bottom",bottom:"top",left:"right",right:"left"},u=l==="top"||l==="bottom"?a:o;c[l]<u&&c[h[l]]>c[l]&&(l=h[l]);let p,d;switch(l){case"top":p=t.top-a-i,d=t.left;break;case"left":p=t.top,d=t.left-o-i;break;case"right":p=t.top,d=t.right+i;break;default:p=t.bottom+i,d=t.left;break}if(l==="top"||l==="bottom"){let m=getComputedStyle(this).direction==="rtl";d=e.endsWith("-end")!==m?t.right-o:t.left}else e.endsWith("-end")&&(p=t.bottom-a);let f=(m,y,w)=>Math.max(pn,Math.min(m,w-y-pn));d=f(d,o,s),p=f(p,a,n),this.style.top=`${Math.round(p)}px`,this.style.left=`${Math.round(d)}px`}#p(){let t={none:0,xs:4,s:8,m:16,l:24};return t[this.dataset.offset||""]??t.xs}};g("pop-over",Yi);var mn=8,ue=8,Dc=300,jc="Text selection actions",gn="F10",Fc='button:not([disabled]), a[href], [role="button"]:not([aria-disabled="true"])',qc='[role="group"], [role="menu"], [role="listbox"], [role="radiogroup"], dialog, [popover]:not([data-selection-menu-host])',Hc=0,Xi=class extends b{#t=null;#e=new Set;#i=!1;#s;#r=null;#n=null;#a=null;#c=0;#h=!1;#l="mouse";#o="pointer";#u=!1;#p=new Set;setup(){let t=this.querySelector(":scope > pop-over[data-selection-menu-host]");if(t)this.#s=t;else{this.#s=document.createElement("pop-over"),this.#s.setAttribute("data-selection-menu-host",""),this.#s.dataset.mode="manual",this.#s.id=`selection-menu-${++Hc}`;let e=[...this.children];for(let i of e)i!==this.#s&&this.#s.appendChild(i);this.appendChild(this.#s)}this.#s.setAttribute("role","toolbar"),this.#s.setAttribute("aria-orientation","horizontal"),this.#s.setAttribute("aria-label",this.dataset.label||jc),this.#s.setAttribute("aria-keyshortcuts",`Alt+${gn}`),this.hidden=!1,this.#d(),this.listen(document,"pointerup",this.#f),this.listen(document,"pointerdown",this.#S),this.listen(document,"keydown",this.#x),this.listen(document,"keyup",this.#v),this.listen(document,"selectionchange",this.#y),this.listen(window,"scroll",this.#m,{capture:!0,passive:!0}),this.listen(window,"resize",this.#m),this.listen(this.#s,"keydown",this.#M),this.id&&(this.#r=new MutationObserver(()=>this.#d()),this.#r.observe(document.body,{childList:!0,subtree:!0,attributeFilter:["data-selection-menu"]}))}teardown(){this.#r?.disconnect(),this.#r=null,this.#a&&clearTimeout(this.#a),this.#a=null,cancelAnimationFrame(this.#c),this.#n?.getAttribute("data-selection-menu")===this.id&&this.#n.removeAttribute("data-selection-menu"),this.#n=null;for(let t of this.#p)t.removeAttribute("tabindex");this.#p.clear(),this.#i=!1,this.#t=null,this.#h=!1}getSelection(){return this.#t?{...this.#t}:null}dismiss(){this.#i&&this.#b({restoreFocus:!0})}get actions(){return[...(this.#s||this).children].map(e=>({tag:e.tagName.toLowerCase(),attrs:Object.fromEntries([...e.attributes].map(i=>[i.name,i.value])),html:e.innerHTML||void 0}))}set actions(t){let e=Array.isArray(t)?t:[],i=this.#s||this;for(;i.firstChild;)i.firstChild.remove();this.#p.clear();for(let s of e){if(s instanceof Element){i.appendChild(s);continue}if(!s?.tag)continue;let n=document.createElement(s.tag);if(s.attrs)for(let[o,a]of Object.entries(s.attrs))a==null||a===!1||n.setAttribute(o,a===!0?"":String(a));s.html&&(n.innerHTML=s.html),i.appendChild(n)}this.dispatchEvent(new CustomEvent("selection-menu:actions-changed",{detail:{actions:this.actions,source:"property"},bubbles:!0}))}#d(){this.#e.clear();let t=this.getAttribute("for");if(t){let e=document.getElementById(t);e&&(this.#e.add(e),this.id&&!e.hasAttribute("data-selection-menu")&&(e.setAttribute("data-selection-menu",this.id),this.#n=e))}this.id&&document.querySelectorAll(`[data-selection-menu="${CSS.escape(this.id)}"]`).forEach(e=>{this.#e.add(e)})}#f=t=>{this.#h=!1,this.#l=t.pointerType||"mouse",requestAnimationFrame(()=>{this.isConnected&&this.#g()})};#v=t=>{!t.shiftKey&&t.key!=="Shift"||this.#s?.contains(document.activeElement)||(this.#l="keyboard",this.#g())};#y=()=>{this.#h||this.#u||(this.#a&&clearTimeout(this.#a),this.#a=setTimeout(()=>{if(this.#a=null,!this.isConnected||this.#h||this.#u||this.#s?.contains(document.activeElement))return;let t=window.getSelection();if(!t||t.isCollapsed||!t.toString().trim()){this.#i&&this.#o==="keyboard"&&this.#b({restoreFocus:!1});return}this.#o==="keyboard"&&(this.#l="keyboard"),this.#g()},Dc))};#g(){let t=window.getSelection();if(!t||t.rangeCount===0||t.isCollapsed||!t.toString().trim())return!1;let e=t.getRangeAt(0),i=e.commonAncestorContainer,s=i.nodeType===Node.ELEMENT_NODE?i:i.parentElement,n=null;for(let c of this.#e)if(c.contains(s)){n=c;break}if(!n)return!1;let o=t.toString().trim(),a=this.#t,l=this.#i&&a&&a.target===n&&a.text===o&&a.range.compareBoundaryPoints(Range.START_TO_START,e)===0&&a.range.compareBoundaryPoints(Range.END_TO_END,e)===0;return this.#t={range:e.cloneRange(),text:o,target:n},l||this.dispatchEvent(new CustomEvent("selection-menu:select",{detail:{range:this.#t.range,text:o,target:n},bubbles:!0})),this.#w(),!0}#w(){this.#s&&(this.#s.show(),this.#i=!0,this.#E(),cancelAnimationFrame(this.#c),this.#c=requestAnimationFrame(()=>this.#A()))}#A(){if(!this.#i||!this.#t||!this.#s)return;let t=this.#t.range.getBoundingClientRect();if(t.bottom<0||t.top>window.innerHeight||t.width===0&&t.height===0){this.#b({restoreFocus:!0});return}let i=this.#s.getBoundingClientRect(),s=i.width||200,n=i.height||40,o=t.top-n-mn,a=t.bottom+mn,l;this.#l==="touch"?l=a+n+ue<=window.innerHeight?a:o:l=o<ue?a:o;let c=t.left+t.width/2-s/2,h=window.innerWidth-s-ue;c=Math.max(ue,Math.min(c,h)),this.#s.style.top=`${l}px`,this.#s.style.left=`${c}px`}#m=()=>{this.#i&&(cancelAnimationFrame(this.#c),this.#c=requestAnimationFrame(()=>this.#A()))};#b({restoreFocus:t=!1,restoreRange:e=!1}={}){let i=this.#t,s=!!this.#s?.contains(document.activeElement);if(this.#s&&this.#s.hide(),this.#i=!1,this.#t=null,cancelAnimationFrame(this.#c),this.#u=!0,this.dispatchEvent(new CustomEvent("selection-menu:dismiss",{bubbles:!0})),t&&s&&i?.target?.isConnected){let n=i.target;if(n.hasAttribute("tabindex")||(n.setAttribute("tabindex","-1"),n.addEventListener("blur",()=>{n.getAttribute("tabindex")==="-1"&&n.removeAttribute("tabindex")},{once:!0})),n.focus({preventScroll:!0}),e){let o=window.getSelection();o&&(o.removeAllRanges(),o.addRange(i.range))}}}#S=t=>{if(this.#h=!0,this.#o="pointer",this.#u=!1,!this.#i)return;let e=t.target;this.#s?.contains(e)||this.contains(e)||this.#b()};#x=t=>{if(["Shift","Alt","Control","Meta"].includes(t.key)||(this.#u=!1),this.#o="keyboard",!t.defaultPrevented){if(t.key==="Escape"&&this.#i){t.preventDefault(),this.#b({restoreFocus:!0,restoreRange:!0});return}if(t.key===gn&&t.altKey&&!t.ctrlKey&&!t.metaKey){if(!this.#i&&(this.#l="keyboard",!this.#g()))return;t.preventDefault(),this.#k(0)}}};#T(){return this.#s?[...this.#s.querySelectorAll(Fc)].filter(t=>{let e=t.closest(qc);if(e&&this.#s.contains(e))return!1;let i=t.closest("[hidden]");return!(i&&this.#s.contains(i))}):[]}#E(){let t=this.#T(),e=t.find(i=>i===document.activeElement)??t.find(i=>i.getAttribute("tabindex")==="0")??t[0];for(let i of t)i.setAttribute("tabindex",i===e?"0":"-1"),this.#p.add(i)}#k(t){this.#E();let e=this.#T();if(!e.length)return;let i=(t%e.length+e.length)%e.length;for(let s of e)s.setAttribute("tabindex",s===e[i]?"0":"-1");e[i].focus()}#M=t=>{let e=t.target;if(e.matches('input, textarea, select, [contenteditable]:not([contenteditable="false"])'))return;let i=this.#T(),s=i.indexOf(e);if(s===-1)return;let n=getComputedStyle(this.#s).direction==="rtl",o=n?"ArrowLeft":"ArrowRight",a=n?"ArrowRight":"ArrowLeft",l=-1;if(t.key===o)l=s+1;else if(t.key===a)l=s-1;else if(t.key==="Home")l=0;else if(t.key==="End")l=i.length-1;else return;t.preventDefault(),this.#k(l)}};g("selection-menu",Xi);var Uc={add:"Add private note",view:"View notes",dialog:"Private note",heading:"Private note",placeholder:"Add a note\u2026",textarea:"Note for highlighted text",save:"Save",cancel:"Cancel"},bn=!1,Ji=new Set;function yn(r,t,e){if(!r.contains(t))return-1;let i=document.createRange();return i.setStart(r,0),i.setEnd(t,e),i.toString().length}var Zi=class extends b{#t=!1;#e=null;#i=null;#s=null;#r=null;#n=null;setup(){this.#t=!!this.closest("selection-menu");let t=this.hasAttribute("for");Ji.add(this),bn||(bn=!0,document.addEventListener("highlights:request-note",Vc));let e=this.querySelector(":scope > button[data-note-action]");if(!this.#t&&!t){e?.remove();return}if(!e){e=document.createElement("button"),e.type="button",e.setAttribute("data-note-action","");let i=document.createElement("icon-wc");i.setAttribute("name","sticky-note"),i.setAttribute("size","sm"),i.setAttribute("aria-hidden","true"),e.appendChild(i),this.appendChild(e)}e.setAttribute("aria-label",this.#a(this.#t?"add":"view")),this.listen(e,"click",this.#t?()=>this.#c():()=>this.#h())}teardown(){Ji.delete(this),this.#d()}#a(t){return this.getAttribute(`data-label-${t}`)??Uc[t]??t}openFor(t,e,i){this.#l(t,e,i??document.activeElement)}#c(){let t=this.closest("selection-menu");if(!t)return;let e=t.getSelection();if(!e)return;let i=e.target,s=document.activeElement;i.hasAttribute("data-highlights-init")||i.setAttribute("data-highlights","");let n=G(i),o=e.range,a=yn(i,o.startContainer,o.startOffset),l=yn(i,o.endContainer,o.endOffset),c=null;if(a>=0&&l>a&&(c=n.getHighlights().find(h=>h.startOffset<=a&&h.endOffset>=l)??null),!c){let h=window.getSelection();h&&(h.isCollapsed||h.rangeCount===0)&&(h.removeAllRanges(),h.addRange(o)),n._createFromSelection("yellow");let u=n.getHighlights();c=u.find(p=>p.startOffset===a&&p.endOffset===l)??u[u.length-1]??null}t.dismiss(),c&&this.#l(c,n,s)}#h(){let t=this.getAttribute("for"),e=t?document.getElementById(t):null;if(!e)return;e.hasAttribute("data-highlights-init")||e.setAttribute("data-highlights","");let i=G(e),s=i.getHighlights(),n=s.find(o=>o.note)??s[0];n&&this.#l(n,i,document.activeElement)}#l(t,e,i){this.#d({restoreFocus:!1});let s=e.element;this.#i=i&&i!==document.body?i:null,this.#s=t,this.#r=e;let n=document.createElement("div");n.className="hn-note-panel",n.setAttribute("role","dialog"),n.setAttribute("aria-label",this.#a("dialog"));let o=document.createElement("header");o.className="hn-note-header";let a=document.createElement("small");a.textContent=this.#a("heading"),o.appendChild(a),n.appendChild(o);let l=document.createElement("blockquote");l.className="hn-note-quote",l.textContent=t.text.length>80?t.text.slice(0,80)+"\u2026":t.text,n.appendChild(l);let c=document.createElement("textarea");c.className="hn-note-textarea",c.placeholder=this.#a("placeholder"),c.value=t.note||"",c.rows=3,c.setAttribute("aria-label",this.#a("textarea")),n.appendChild(c);let h=document.createElement("footer");h.className="hn-note-actions";let u=()=>{e._updateNote(t.id,c.value.trim()),this.#d()},p=document.createElement("button");p.type="button",p.className="hn-action hn-action-save",p.textContent=this.#a("save"),p.addEventListener("click",u);let d=document.createElement("button");if(d.type="button",d.className="hn-action",d.textContent=this.#a("cancel"),d.addEventListener("click",()=>this.#d()),h.append(p,d),n.appendChild(h),n.addEventListener("keydown",f=>{f.defaultPrevented||(f.key==="Escape"?(f.preventDefault(),f.stopPropagation(),this.#d()):f.key==="Enter"&&(f.metaKey||f.ctrlKey)&&f.target===c&&(f.preventDefault(),u()))}),getComputedStyle(s).position==="static"&&(s.setAttribute("data-note-host",""),this.#n=s),s.appendChild(n),typeof e.findHighlightRect=="function"){let f=e.findHighlightRect(t.id);if(f){let m=s.getBoundingClientRect();n.style.top=`${f.top-m.top}px`}}this.#e=n,requestAnimationFrame(()=>{this.#e===n&&(c.focus(),document.addEventListener("pointerdown",this.#o))})}#o=t=>{if(!this.#e||this.#e.contains(t.target))return;this.#d({restoreFocus:!1});let e=this.#u;e&&document.addEventListener("pointerup",()=>{setTimeout(()=>{let i=document.activeElement;(!i||i===document.body)&&e?.()})},{once:!0,capture:!0})};#u=null;#p(){let t=this.#i,e=this.#r?.element,i=this.#s?.id;return()=>{if(t?.isConnected&&(typeof t.checkVisibility!="function"||t.checkVisibility())&&(t.focus({preventScroll:!0}),document.activeElement===t)||!e?.isConnected)return;let n=(i?e.querySelector(`mark[data-hn-id="${CSS.escape(i)}"]`):null)??e;n.tabIndex<0&&!n.hasAttribute("tabindex")&&(n.setAttribute("tabindex","-1"),n.addEventListener("blur",()=>n.removeAttribute("tabindex"),{once:!0})),n.focus({preventScroll:!0})}}#d({restoreFocus:t=!0}={}){if(!this.#e)return;let e=this.#e.contains(document.activeElement)?this.#p():null;document.removeEventListener("pointerdown",this.#o),this.#e.remove(),this.#e=null,this.#n?.removeAttribute("data-note-host"),this.#n=null,this.#u=e,this.#i=null,this.#s=null,this.#r=null,t&&e?.()}};function Vc(r){let{highlight:t,controller:e}=r.detail||{};if(!t||!e)return;let i=Ji.values().next().value;i&&i.openFor(t,e)}g("note-wc",Zi);var Wc=0,Qi=class extends b{#t=null;#e=null;setup(){if(this.#t=this.querySelector(":scope > button"),this.#e=this.querySelector(":scope > .comment-wc-reason"),!this.#t){let e=document.createElement("button");e.type="button";let i=document.createElement("icon-wc");i.setAttribute("name","message-circle"),i.setAttribute("size","sm"),i.setAttribute("aria-hidden","true"),e.appendChild(i);let s=document.createElement("span");s.className="comment-wc-reason visually-hidden",s.id=`comment-wc-reason-${++Wc}`,s.textContent="Comments are unavailable: this content has no review surface.",this.append(e,s),this.#t=e,this.#e=s}this.#s(),this.listen(this,"click",this.#r);let t=this.closest("selection-menu");t&&this.listen(t,"toggle",()=>this.#s())}#i(){let t=this.closest("review-surface");if(t)return t;let e=this.closest("selection-menu")?.getAttribute("for");return e?document.querySelector(`review-surface[for="${CSS.escape(e)}"]`):null}#s(){let t=this.#t;if(!t)return;!!this.#i()?(t.removeAttribute("aria-disabled"),t.removeAttribute("aria-describedby"),t.setAttribute("aria-label","Add comment")):(t.setAttribute("aria-disabled","true"),t.setAttribute("aria-label","Add comment"),this.#e&&t.setAttribute("aria-describedby",this.#e.id))}#r=t=>{if(!this.#t?.contains(t.target))return;this.#s();let e=this.#i();if(!e)return;let i=this.closest("selection-menu");if(!i)return;let s=i.getSelection();if(!s)return;let n=s.range.getBoundingClientRect(),o=e.getBoundingClientRect(),a=(n.left+n.width/2-o.left)/o.width*100,l=(n.top-o.top)/o.height*100;typeof e.addPin=="function"&&e.addPin({x:a,y:l,text:s.text}),this.dispatchEvent(new CustomEvent("comment-wc:created",{detail:{text:s.text,x:a,y:l},bubbles:!0})),i.dismiss()}};g("comment-wc",Qi);var ts='track[kind="chapters"][data-chapter-list]';function vn(r=document){r.querySelectorAll(ts).forEach(t=>es(t))}function es(r){if(r.hasAttribute("data-chapter-list-init"))return;r.setAttribute("data-chapter-list-init","");let t=r.parentElement;if(!t||t.tagName!=="VIDEO")return;let e=r.track;e.mode==="disabled"&&(e.mode="hidden"),r.readyState>=2?wn(t,e,r):r.addEventListener("load",()=>wn(t,e,r),{once:!0})}function wn(r,t,e){let i=t.cues;if(!i||i.length===0)return;let s=document.createElement("nav");s.setAttribute("aria-label",e.getAttribute("data-label")||"Video chapters"),s.classList.add("chapter-list");let n=document.createElement("ol");for(let a of i){let l=document.createElement("li"),c=document.createElement("button");c.type="button";let h=document.createElement("span");h.textContent=a.text;let u=document.createElement("time");u.textContent=Gc(a.startTime),u.setAttribute("datetime",Kc(a.startTime)),c.appendChild(h),c.appendChild(u),c.addEventListener("click",()=>{r.currentTime=a.startTime,r.paused&&r.play()?.catch(()=>{})}),l.appendChild(c),n.appendChild(l)}s.appendChild(n),r.insertAdjacentElement("afterend",s);let o=null;r.addEventListener("timeupdate",()=>{let a=r.currentTime,l=-1;for(let h=0;h<i.length;h++)if(a>=i[h].startTime&&a<i[h].endTime){l=h;break}let c=l>=0?n.children[l]:null;c!==o&&(o&&(o.removeAttribute("data-active"),o.querySelector("button")?.removeAttribute("aria-current")),o=c,o&&(o.setAttribute("data-active",""),o.querySelector("button")?.setAttribute("aria-current","true")))})}function Gc(r){let t=Math.floor(r/3600),e=Math.floor(r%3600/60),i=Math.floor(r%60);return t>0?`${t}:${String(e).padStart(2,"0")}:${String(i).padStart(2,"0")}`:`${e}:${String(i).padStart(2,"0")}`}function Kc(r){let t=Math.floor(r/3600),e=Math.floor(r%3600/60),i=Math.floor(r%60);return`PT${t?t+"H":""}${e?e+"M":""}${i}S`}document.readyState==="loading"?document.addEventListener("DOMContentLoaded",()=>vn()):vn();var Yc=new MutationObserver(r=>{for(let t of r)for(let e of t.addedNodes){if(e.nodeType!==Node.ELEMENT_NODE)continue;let i=e;i.matches?.(ts)&&es(i),i.querySelectorAll?.(ts).forEach(s=>es(s))}});Yc.observe(document.documentElement,{childList:!0,subtree:!0});var bt="[data-command], [commandfor]",Xc="Page Actions",D=new Map;function de(r){if(D.has(r)||r.hasAttribute("data-command-init"))return;r.setAttribute("data-command-init","");let t=r.getAttribute("data-command")||r.textContent.trim();if(!t)return;let e=r.getAttribute("data-command-group")||Xc,i=r.getAttribute("data-command-icon")||null,s=r.getAttribute("data-shortcut")||null,n=null;s&&(n=Q(s,()=>r.click()));let o={element:r,label:t,group:e,icon:i,shortcut:s,unbind:n};D.set(r,o),document.dispatchEvent(new CustomEvent("vb:command-registry-change",{detail:{action:"add",entry:o}}))}function is(r){let t=D.get(r);t&&(t.unbind?.(),D.delete(r),r.removeAttribute("data-command-init"),document.dispatchEvent(new CustomEvent("vb:command-registry-change",{detail:{action:"remove",element:r}})))}function Jc(){let r=new Map;for(let t of D.values()){if(t.element.hidden||t.element.closest("[hidden]"))continue;let e=r.get(t.group)||[];e.push(t),r.set(t.group,e)}return r}function An(r=document){r.querySelectorAll(bt).forEach(de)}document.readyState==="loading"?document.addEventListener("DOMContentLoaded",()=>An()):An();var Zc=new MutationObserver(r=>{for(let t of r){for(let e of t.addedNodes){if(e.nodeType!==Node.ELEMENT_NODE)continue;let i=e;i.matches(bt)&&de(i),i.querySelectorAll(bt).forEach(de)}for(let e of t.removedNodes){if(e.nodeType!==Node.ELEMENT_NODE)continue;let i=e;D.has(i)&&is(i),i.querySelectorAll(bt).forEach(s=>{D.has(s)&&is(s)})}if(t.type==="attributes"&&t.target.nodeType===Node.ELEMENT_NODE){let e=t.target;e.matches(bt)&&!D.has(e)?de(e):!e.matches(bt)&&D.has(e)&&is(e)}}});Zc.observe(document.documentElement,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["data-command","commandfor"]});function Qc(){let r='footer, aside, dialog, [hidden], [aria-hidden="true"]',e=[];return document.querySelectorAll("nav a[href]").forEach(i=>{if(i.closest(r)||D.has(i))return;let s=i.textContent.trim();!s||e.length>=50||e.push({element:i,label:s,group:"Navigation",icon:null,shortcut:null,auto:!0,action:null})}),document.querySelectorAll("h2[id], h3[id]").forEach(i=>{if(i.closest(r)||D.has(i))return;let s=i.textContent.trim();!s||e.length>=50||e.push({element:i,label:`Jump to: ${s}`,group:"On This Page",icon:null,shortcut:null,auto:!0,action:()=>i.scrollIntoView({behavior:"smooth"})})}),e}window.__commandRegistry={getRegisteredCommands:Jc,scanAutoDiscoverable:Qc};var th=window.matchMedia("(prefers-reduced-motion: reduce)");function eh(){return th.matches||document.documentElement.hasAttribute("data-motion-reduced")}var kn=0,ih=new Map([["vb-fade-in","entrance"],["vb-slide-up","entrance"],["vb-pop","entrance"],["vb-slide-in-ltr","entrance"],["vb-slide-in-rtl","entrance"],["vb-fade-slide-up","entrance"],["vb-shadow-lift","entrance"],["vb-fade-out","exit"],["vb-collapse","exit"],["vb-slide-out-ltr","exit"],["vb-slide-out-rtl","exit"],["vb-shake","attention"],["vb-pulse","attention"],["vb-bounce","attention"],["vb-blink","attention"],["vb-neon-pulse","decoration"],["vb-3d-shift","decoration"],["vb-outline-glow-pulse","decoration"],["vb-rainbow","decoration"],["vb-gradient-flow","decoration"],["vb-shimmer","decoration"],["vb-shimmer-gradient","decoration"],["vb-glow","decoration"],["vb-float","decoration"]]),xn="__vbEffectsRuntime",En=globalThis,v=En[xn]??{_effects:new Map,_triggers:new Map,_transitions:new Map,_instances:new WeakMap,_triggerCleanups:new WeakMap,_wiredTriggers:new WeakMap,_transitionCleanups:new WeakMap,_transitionFallback:new WeakSet,_processed:new WeakSet,_transitionProcessed:new WeakSet,_staggerTime:new WeakSet,_unresolved:new Set,_warnedTriggers:new Set,_unresolvedTimer:null,_keyframePhase:ih,_observer:null,_animationEndHandler:null,_autoBooted:!1,effect(r,t){this._effects.set(r,t),document.querySelectorAll("[data-effect]").forEach(e=>{if(!(e.getAttribute("data-effect")||"").split(/\s+/).includes(r))return;let s=!this._instances.get(e)?.has(r);this._initEffect(e,r),s&&e.hasAttribute("data-effect-active")&&this._instances.get(e)?.get(r)?.activate?.()})},trigger(r,t){this._triggers.set(r,t),document.querySelectorAll("[data-effect][data-trigger]").forEach(e=>{if(!this._processed.has(e))return;let i=e.getAttribute("data-effect")?.split(/\s+/).filter(Boolean)||[];this._wireTrigger(e,i)})},transition(r,t){this._transitions.set(r,t),document.querySelectorAll("[data-transition]").forEach(e=>{if(!this._transitionProcessed.has(e)||!this._transitionFallback.has(e))return;let i=e.getAttribute("data-transition")||"",s=i.indexOf(":");if((s>-1?i.slice(0,s):i)!==r)return;this._transitionFallback.delete(e);let n=e;n.style.viewTransitionName="";let o=t(e,s>-1?i.slice(s+1):null);o&&this._transitionCleanups.set(e,o)})},uid(r){return r.id?r.id:(r._vbUid||(kn++,r._vbUid=`vb-${kn}`),r._vbUid)},theme(r,t){this._themes=this._themes||new Map,this._themes.set(r,t)},applyTheme(r,t=document.documentElement){let e=this._themes?.get(r);if(e)for(let[i,s]of Object.entries(e))t.style.setProperty(i,s)},swap(r){if(!document.startViewTransition){r(),queueMicrotask(()=>this._dispatchVtDone(document.body));return}let t=document.startViewTransition(r);return t.updateCallbackDone.then(()=>{this._dispatchVtDone(document.body)}).catch(()=>{}),t},_dispatchVtDone(r){r.querySelectorAll('[data-trigger~="vt"]').forEach(t=>{this.emit(t,"vb:vt-update-done",{})})},activate(r){this._activateEffects(r)},deactivate(r){r.hasAttribute("data-effect-active")&&(r.removeAttribute("data-effect-active"),this.emit(r,"vb:phase-change",{active:!1}))},onPhaseEnd(r,t,e){let i=s=>{s.detail?.phase===t&&e(s.detail)};return r.addEventListener("vb:effect-phase-end",i),()=>r.removeEventListener("vb:effect-phase-end",i)},registerKeyframe(r,t){this._keyframePhase.set(r,t)},observe(r=document){if(r.querySelectorAll("[data-effect]").forEach(e=>this._processElement(e)),r.querySelectorAll("[data-stagger]").forEach(e=>this._processStagger(e)),r.querySelectorAll("[data-transition]").forEach(e=>this._processTransition(e)),this._observer)return;this._observer=new MutationObserver(e=>{let i=new Set;for(let s of e){if(s.type==="childList"){let n=s.target;n.hasAttribute?.("data-stagger")&&i.add(n);for(let o of s.addedNodes)o.nodeType===Node.ELEMENT_NODE&&this._processTree(o);for(let o of s.removedNodes)o.nodeType===Node.ELEMENT_NODE&&(o.isConnected||this._cleanupTree(o))}if(s.type==="attributes"){let n=s.target;s.attributeName==="data-effect"&&this._reconcileEffects(n),s.attributeName==="data-trigger"&&this._reconcileTrigger(n),s.attributeName==="data-stagger"&&(n.hasAttribute("data-stagger")?i.add(n):this._cleanupStagger(n)),s.attributeName==="data-transition"&&this._reconcileTransition(n)}}for(let s of i)s.isConnected&&this._processStagger(s)});let t=r===document?document.body:r;this._observer.observe(t,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["data-effect","data-trigger","data-stagger","data-transition"]}),this._animationEndHandler||(this._animationEndHandler=e=>{let i=e.target;if(!(i instanceof Element)||!i.hasAttribute("data-effect"))return;let s=this._keyframePhase.get(e.animationName);s&&this.emit(i,"vb:effect-phase-end",{phase:s,animationName:e.animationName})},document.addEventListener("animationend",this._animationEndHandler))},disconnect(){this._observer&&(this._observer.disconnect(),this._observer=null),this._animationEndHandler&&(document.removeEventListener("animationend",this._animationEndHandler),this._animationEndHandler=null)},params(r){let t=getComputedStyle(r);return{get(e){return t.getPropertyValue(`--vb-${e}`).trim()},getNumber(e,i=0){let s=t.getPropertyValue(`--vb-${e}`).trim();return s?parseFloat(s):i},getTime(e,i=0){let s=t.getPropertyValue(`--vb-${e}`).trim();if(!s)return i;let n=parseFloat(s);return Number.isFinite(n)?/s\s*$/.test(s)&&!/ms\s*$/.test(s)?n*1e3:n:i},hasClass(e){return r.classList.contains(e)}}},emit(r,t,e={}){r.dispatchEvent(new CustomEvent(t,{bubbles:!0,detail:e}))},prefersReducedMotion:eh,_processTree(r){r.hasAttribute?.("data-effect")&&this._processElement(r),r.hasAttribute?.("data-stagger")&&this._processStagger(r),r.hasAttribute?.("data-transition")&&this._processTransition(r),r.querySelectorAll?.("[data-effect]").forEach(t=>this._processElement(t)),r.querySelectorAll?.("[data-stagger]").forEach(t=>this._processStagger(t)),r.querySelectorAll?.("[data-transition]").forEach(t=>this._processTransition(t))},_cleanupTree(r){r.hasAttribute?.("data-effect")&&this._cleanupElement(r),r.hasAttribute?.("data-transition")&&this._cleanupTransition(r),r.querySelectorAll?.("[data-effect]").forEach(t=>this._cleanupElement(t)),r.querySelectorAll?.("[data-transition]").forEach(t=>this._cleanupTransition(t))},_processElement(r){if(this._processed.has(r))return;this._processed.add(r),r.removeAttribute("data-effect-processed"),r.removeAttribute("data-effect-armed");let t=r.getAttribute("data-effect")?.split(/\s+/).filter(Boolean)||[];for(let e of t)this._initEffect(r,e);this._wireTrigger(r,t)},_initEffect(r,t){let e=this._effects.get(t);if(!e)return;let i=this._instances.get(r);if(i?.has(t))return;let s=e(r);s&&(i||(i=new Map,this._instances.set(r,i)),typeof s=="function"?i.set(t,{cleanup:s}):i.set(t,s))},_parseTrigger(r){let t=r.indexOf(":");return t>-1?[r.slice(0,t),r.slice(t+1)]:[r,null]},_wireTrigger(r,t){let e=r.getAttribute("data-trigger");if(!e||!e.trim()){r.removeAttribute("data-effect-armed"),this._activateEffects(r);return}let i=e.split(/\s+/).filter(Boolean);this._wiredTriggers??=new WeakMap;let s=this._wiredTriggers.get(r);s||(s=new Set,this._wiredTriggers.set(r,s));let n=!1;for(let o of i){if(s.has(o))continue;let[a,l]=this._parseTrigger(o),c=this._triggers.get(a);if(!c){n=!0;continue}s.add(o);let h=c(r,()=>this._activateEffects(r),l);if(h){let u=this._triggerCleanups.get(r);if(u){let p=u;this._triggerCleanups.set(r,()=>{p(),h()})}else this._triggerCleanups.set(r,h)}}s.size&&r.setAttribute("data-effect-armed",""),n?(this._unresolved.add(r),this._scheduleUnresolvedCheck()):this._unresolved.delete(r)},_scheduleUnresolvedCheck(){if(this._unresolvedTimer)return;let r=()=>{this._unresolvedTimer=null,this._resolveUnknownTriggers()};typeof window>"u"||typeof window.addEventListener!="function"||(document.readyState==="complete"?this._unresolvedTimer=setTimeout(r,0):(this._unresolvedTimer=!0,window.addEventListener("load",()=>setTimeout(r,0),{once:!0})))},_resolveUnknownTriggers(){for(let r of[...this._unresolved]){if(this._unresolved.delete(r),!r.isConnected||!this._processed.has(r))continue;let e=(r.getAttribute("data-trigger")||"").split(/\s+/).filter(Boolean).filter(i=>!this._triggers.has(this._parseTrigger(i)[0]));if(e.length){for(let i of e){let s=this._parseTrigger(i)[0];this._warnedTriggers.has(s)||(this._warnedTriggers.add(s),console.warn(`[VB] data-trigger="${i}": no trigger named "${s}" is registered. The effect runs immediately instead. Register it with VB.trigger('${s}', \u2026) or check the spelling.`,r))}!r.hasAttribute("data-effect-armed")&&!r.hasAttribute("data-effect-active")&&this._activateEffects(r)}}},_activateEffects(r){r.setAttribute("data-effect-active",""),this.emit(r,"vb:phase-change",{active:!0});let t=this._instances.get(r);if(t)for(let[,e]of t)e.activate&&e.activate()},_cleanupElement(r){let t=this._instances.get(r);if(t){for(let[,i]of t)i.cleanup&&i.cleanup();this._instances.delete(r)}let e=this._triggerCleanups.get(r);e&&(e(),this._triggerCleanups.delete(r)),this._wiredTriggers?.delete(r),this._unresolved.delete(r),r.removeAttribute("data-effect-armed"),this._processed.delete(r)},_reconcileEffects(r){if(!r.hasAttribute("data-effect")){this._cleanupElement(r),r.removeAttribute("data-effect-active");return}let t=r.getAttribute("data-effect")?.split(/\s+/).filter(Boolean)||[],e=this._instances.get(r);if(e)for(let[i,s]of e)t.includes(i)||(s.cleanup&&s.cleanup(),e.delete(i));for(let i of t)e?.has(i)||this._initEffect(r,i);this._processed.has(r)||this._processElement(r)},_reconcileTrigger(r){if(!r.hasAttribute("data-effect"))return;let t=this._triggerCleanups.get(r);if(t&&(t(),this._triggerCleanups.delete(r)),this._wiredTriggers?.delete(r),this._unresolved.delete(r),r.removeAttribute("data-effect-armed"),!this._processed.has(r)){this._processElement(r);return}let e=r.getAttribute("data-effect")?.split(/\s+/).filter(Boolean)||[];this._wireTrigger(r,e)},_parseStagger(r){let t=(r||"").trim().split(/\s+/).filter(Boolean),e=t.find(s=>/^(\d+(\.\d+)?|\.\d+)(ms|s)$/i.test(s))||null;return{mode:t.find(s=>s==="reverse"||s==="random"||s==="grid")||"",time:e}},_processStagger(r){let{mode:t,time:e}=this._parseStagger(r.getAttribute("data-stagger"));e?(r.style.setProperty("--vb-stagger",e),this._staggerTime.add(r)):this._staggerTime.has(r)&&(r.style.removeProperty("--vb-stagger"),this._staggerTime.delete(r));let i=Array.from(r.children),s=i.length,n;if(t==="reverse")n=Array.from({length:s},(o,a)=>s-1-a);else if(t==="random"){let o=this._hashString(this.uid(r));n=Array.from({length:s},(l,c)=>c);let a=o;for(let l=s-1;l>0;l--){a^=a<<13,a^=a>>>17,a^=a<<5;let c=Math.abs(a)%(l+1);[n[l],n[c]]=[n[c],n[l]]}}else t==="grid"?n=this._gridStaggerIndices(r,i):n=Array.from({length:s},(o,a)=>a);for(let o=0;o<s;o++)i[o].style.setProperty("--vb-stagger-index",String(n[o]))},_gridStaggerIndices(r,t){let e=t.length,i=()=>Array.from({length:e},(c,h)=>h);if(!e)return[];let s=t.map(c=>{let h=getComputedStyle(c);return[parseInt(h.gridRowStart,10),parseInt(h.gridColumnStart,10)]});if(s.every(([c,h])=>Number.isFinite(c)&&Number.isFinite(h))){let c=Math.min(...s.map(([u])=>u)),h=Math.min(...s.map(([,u])=>u));return s.map(([u,p])=>u-c+(p-h))}let n=t.map(c=>c.getBoundingClientRect?.());if(!n.every(Boolean)||n.every(c=>c.width===0&&c.height===0))return i();let o=getComputedStyle(r).direction==="rtl",a=this._trackRanks(n.map(c=>[c.top,c.bottom])),l=this._trackRanks(n.map(c=>o?[-c.right,-c.left]:[c.left,c.right]));return a.map((c,h)=>c+l[h])},_trackRanks(r){let t=r.map((n,o)=>o).sort((n,o)=>r[n][0]-r[o][0]),e=new Array(r.length),i=-1,s=-1/0;for(let n of t){let[o,a]=r[n];o>=s-.5?(i++,s=a):s=Math.min(s,a),e[n]=i}return e},_cleanupStagger(r){this._staggerTime.has(r)&&(r.style.removeProperty("--vb-stagger"),this._staggerTime.delete(r));for(let t of Array.from(r.children))t.style?.removeProperty("--vb-stagger-index")},_hashString(r){let t=5381;for(let e=0;e<r.length;e++)t=(t<<5)+t^r.charCodeAt(e);return t|0},_vtIdent(r){let t=String(r).replace(/[^A-Za-z0-9_ -￿-]/g,"-");return(!t||/^(-?\d|--)/.test(t))&&(t=`vb-${t}`),t},_processTransition(r){if(this._transitionProcessed.has(r)||r.matches?.("[data-swap], content-swap"))return;let t=(r.getAttribute("data-transition")||"").trim();if(!t)return;this._transitionProcessed.add(r),r.removeAttribute("data-transition-processed");let[e,i]=this._parseTrigger(t),s=this._transitions.get(e);if(s){let n=s(r,i);n&&this._transitionCleanups.set(r,n)}else r.style.viewTransitionName=this._vtIdent(`${e}-${this.uid(r)}`),this._transitionFallback.add(r)},_cleanupTransition(r){if(!this._transitionProcessed.has(r))return;let t=this._transitionCleanups.get(r);t&&(t(),this._transitionCleanups.delete(r)),this._transitionFallback.has(r)&&(this._transitionFallback.delete(r),r.style.viewTransitionName=""),this._transitionProcessed.delete(r)},_reconcileTransition(r){this._cleanupTransition(r),r.hasAttribute("data-transition")&&this._processTransition(r)}};En[xn]=v;if(typeof window<"u"){let r=window.VB;if(r&&r!==v)for(let t of Object.keys(r))t in v||(v[t]=r[t]);window.VB=v}typeof document<"u"&&!v._autoBooted&&(v._autoBooted=!0,document.body?v.observe():document.addEventListener("DOMContentLoaded",()=>v.observe(),{once:!0}));function pe(r,t){v.deactivate(r),r.offsetWidth,t()}function ss(r,t){if(v.prefersReducedMotion()){t();return}let e=new IntersectionObserver(([i])=>{i.isIntersecting&&(e.disconnect(),t())},{threshold:.1});return e.observe(r),()=>e.disconnect()}function sh(r){let t=(r||"0").trim(),e=parseFloat(t);return!Number.isFinite(e)||e<0?0:/^[\d.]+s$/i.test(t)?e*1e3:e}v.trigger("scroll",(r,t)=>ss(r,t));v.trigger("hover",(r,t)=>{let e=!1,i=!1;function s(h){let u=e||i;h==="hover"?e=!0:i=!0,u||pe(r,t)}function n(){!e&&!i&&v.deactivate(r)}let o=()=>s("hover"),a=()=>{e=!1,n()},l=()=>s("focus"),c=h=>{h.relatedTarget instanceof Node&&r.contains(h.relatedTarget)||(i=!1,n())};return r.addEventListener("pointerenter",o),r.addEventListener("pointerleave",a),r.addEventListener("focusin",l),r.addEventListener("focusout",c),()=>{r.removeEventListener("pointerenter",o),r.removeEventListener("pointerleave",a),r.removeEventListener("focusin",l),r.removeEventListener("focusout",c)}});v.trigger("click",(r,t,e)=>{function i(){e==="replay"?pe(r,t):r.hasAttribute("data-effect-active")?v.deactivate(r):t()}return r.addEventListener("click",i),()=>r.removeEventListener("click",i)});v.trigger("time",(r,t,e)=>{let i=setTimeout(t,sh(e));return()=>clearTimeout(i)});v.trigger("intersect",(r,t,e)=>{if(v.prefersReducedMotion()){t();return}if((e||"once")==="toggle"){let s=new IntersectionObserver(([n])=>{n.isIntersecting?t():v.deactivate(r)},{threshold:.1});return s.observe(r),()=>s.disconnect()}return ss(r,t)});v.trigger("media",(r,t,e)=>{if(!e)return;let i=window.matchMedia(e);function s(){i.matches?t():v.deactivate(r)}return i.addEventListener("change",s),s(),()=>i.removeEventListener("change",s)});v.trigger("event",(r,t,e)=>{if(!e)return;let i=()=>pe(r,t);return r.addEventListener(e,i),()=>r.removeEventListener(e,i)});v.trigger("vt",(r,t)=>{let e=()=>pe(r,t);return r.addEventListener("vb:vt-update-done",e),()=>r.removeEventListener("vb:vt-update-done",e)});var rh=typeof CSS<"u"&&typeof CSS.supports=="function"&&CSS.supports("animation-timeline: view()");for(let r of["view-progress","scroll-progress"])v.trigger(r,(t,e)=>{if(!(rh&&!v.prefersReducedMotion()))return ss(t,e)});var nh=12;function at(r,t,e){let i=v.uid(t),s=e===void 0?`${r}-${i}`:`${r}-${i}-${e}`;return typeof CSS<"u"&&CSS.escape?CSS.escape(s):s.replace(/[^\w-]/g,"_")}function yt(r,t,e){return r.style.viewTransitionName=t,e&&(r.style.viewTransitionClass=e),()=>{r.style.viewTransitionName="",e&&(r.style.viewTransitionClass="")}}v.transition("morph",r=>yt(r,at("morph",r)));function oh(r,t){let e=(t||"forward").trim().toLowerCase();if(e==="left")return"slide-left";if(e==="right")return"slide-right";let s=!(getComputedStyle(r).direction==="rtl");return(e==="back"?!s:s)?"slide-left":"slide-right"}v.transition("slide",(r,t)=>yt(r,at("slide",r),oh(r,t)));v.transition("fade",r=>yt(r,at("fade",r),"fade"));v.transition("scale",r=>yt(r,at("scale",r),"scale"));v.transition("none",r=>yt(r,at("none",r),"vt-none"));function ah(r){let t=new Set,e=()=>{let s=Array.from(r.children);for(let n of t)n.parentElement!==r&&(n.style.viewTransitionName="",n.style.viewTransitionClass="",t.delete(n));s.forEach((n,o)=>{if(!(n instanceof HTMLElement))return;let a=Math.min(o,nh-1);n.style.viewTransitionName=at("stagger",r,v.uid(n)),n.style.viewTransitionClass=`fade vt-stagger-${a}`,t.add(n)})};e();let i=new MutationObserver(e);return i.observe(r,{childList:!0}),()=>{i.disconnect();for(let s of t)s.style.viewTransitionName="",s.style.viewTransitionClass="";t.clear()}}v.transition("stagger",r=>ah(r));v.transition("effect",(r,t)=>{let e=(t||"fade").trim();return yt(r,at("effect",r),/^-?[_a-zA-Z][\w-]*$/.test(e)?e:"fade")});var Sn="data-effect-glitch-init";v.effect("glitch",r=>(r.setAttribute("data-glitch-text",(r.textContent||"").trim()),r.setAttribute(Sn,""),{cleanup(){r.removeAttribute(Sn),r.removeAttribute("data-glitch-text")}}));var fe="vb-split-sr",rs="vb-split";function lh(r){return r.closest?.("[lang]")?.getAttribute("lang")||void 0}function vt(r,t){if(typeof Intl<"u"&&"Segmenter"in Intl)try{let e=new Intl.Segmenter(t,{granularity:"grapheme"});return Array.from(e.segment(r),i=>i.segment)}catch{}return Array.from(r)}function ch(r,t){let e=[],i;if(typeof Intl<"u"&&"Segmenter"in Intl)try{i=Array.from(new Intl.Segmenter(t,{granularity:"word"}).segment(r))}catch{i=null}if(!i){for(let n of r.split(/(\s+)/))n&&e.push({text:n,space:/^\s+$/.test(n)});return e}let s="";for(let n of i){if(/^\s+$/.test(n.segment)){s&&(e.push({text:s,space:!1}),s=""),e.push({text:n.segment,space:!0});continue}let o=e[e.length-1];if(!n.isWordLike){o&&!o.space?o.text+=n.segment:s+=n.segment;continue}e.push({text:s+n.segment,space:!1}),s=""}return s&&e.push({text:s,space:!1}),e}function I(r){for(let t of r.querySelectorAll(`.${fe}`)){let e=t.nextElementSibling;e?.classList.contains(rs)&&e.remove(),t.replaceWith(document.createTextNode(t.textContent||""))}r.normalize()}function Cn(r){let t=r.querySelectorAll(`.${fe}`);return t.length?Array.from(t,e=>e.textContent).join(""):r.textContent||""}function wt(r,{unit:t="word",className:e="",locale:i}={}){I(r);let s=i||lh(r),n=[],o=document.createTreeWalker(r,NodeFilter.SHOW_TEXT,{acceptNode(c){let h=c.parentElement;return h&&h.closest("script, style, template, svg, math")?NodeFilter.FILTER_REJECT:c.nodeValue&&c.nodeValue.trim()?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_REJECT}});for(;o.nextNode();)n.push(o.currentNode);let a=[],l=c=>{let h=document.createElement("span");return e&&(h.className=e),h.textContent=c,a.push(h),h};for(let c of n){let h=c.nodeValue||"",u=document.createElement("span");u.className=fe,u.textContent=h;let p=document.createElement("span");if(p.className=rs,p.setAttribute("aria-hidden","true"),t==="grapheme")for(let d of vt(h,s)){let f=l(d);/^\s+$/.test(d)&&f.setAttribute("data-space",""),p.append(f)}else for(let d of ch(h,s))p.append(d.space?document.createTextNode(d.text):l(d.text));c.replaceWith(u,p)}return a}function Tn(r,t){I(r);let e=document.createElement("span");e.className=fe,e.textContent=t;let i=document.createElement("span");return i.className=rs,i.setAttribute("aria-hidden","true"),r.replaceChildren(e,i),i}function ns(r){let t=0,e=null;for(let i of r){let s=i.getBoundingClientRect(),n=s.top;e!==null&&n-e>s.height/2&&t++,e=n,i.style.setProperty("--i",String(t))}return r.length?t+1:0}var os="data-effect-blur-reveal-init";v.effect("blur-reveal",r=>{let t=r;if(I(t),t.removeAttribute(os),v.prefersReducedMotion())return{cleanup(){}};t.style.setProperty("--blur-delay",v.params(t).get("blur-reveal-delay")||"80ms");let e=wt(t,{className:"vb-blur-chunk"});e.forEach((s,n)=>s.style.setProperty("--i",String(n))),t.setAttribute(os,"");let i=null;if(t.classList.contains("line")){ns(e);let s=t.clientWidth;i=new ResizeObserver(()=>{t.clientWidth!==s&&(s=t.clientWidth,ns(e))}),i.observe(t)}return{activate(){t.setAttribute("data-effect-active","")},cleanup(){i?.disconnect(),I(t),t.removeAttribute(os),t.style.removeProperty("--blur-delay")}}});var as="data-effect-typewriter-init",hh=2e3,uh=400,dh=200;v.effect("typewriter",r=>{let t=r;if(I(t),t.querySelectorAll(":scope > .vb-typewriter-cursor").forEach(u=>u.remove()),t.removeAttribute(as),v.prefersReducedMotion())return{cleanup(){}};let e=wt(t,{unit:"grapheme",className:"vb-typewriter-char"});t.setAttribute(as,"");let i=0,s=null,n=()=>{clearTimeout(i),i=0},o=()=>!!t.closest("[data-paused]"),a=(u,p)=>{i=window.setTimeout(function d(){if(o()){i=window.setTimeout(d,dh);return}u()},p)},l=u=>e.forEach((p,d)=>{p.hidden=d>=u}),c=(u,p)=>{let d=u+p;for(;d>0&&d<e.length&&e[d-1].hasAttribute("data-space");)d+=p;return d};function h(){n();let u=v.params(t),p=u.getTime("typewriter-speed",50),d=u.getTime("typewriter-delay",0),f=t.classList.contains("loop");!s&&!t.classList.contains("no-cursor")&&(s=document.createElement("span"),s.className="vb-typewriter-cursor",s.textContent="|",s.setAttribute("aria-hidden","true"),t.append(s));let m=0;l(0);let y=()=>{m<e.length?(m=c(m,1),l(m),a(y,p)):f&&a(w,hh)},w=()=>{m>0?(m=Math.max(0,c(m,-1)),l(m),a(w,p/2)):a(y,uh)};a(y,d)}return{activate(){h()},cleanup(){n(),s?.remove(),s=null,I(t),t.removeAttribute(as)}}});var ls="data-effect-scramble-init",ph="!<>-_\\/[]{}=+*^?#";function fh(r){let t=v.params(r).get("scramble-chars"),e=/^(['"])(.*)\1$/.exec(t);e&&(t=e[2]);let i=vt(t);return i.length?i:vt(ph)}var mh=r=>r[Math.floor(Math.random()*r.length)];v.effect("scramble",r=>{let t=r;if(I(t),t.removeAttribute(ls),v.prefersReducedMotion())return{cleanup(){}};let e=wt(t,{unit:"grapheme",className:"vb-scramble-char"}),i=e.map(c=>c.textContent||""),s=e.flatMap((c,h)=>c.hasAttribute("data-space")?[]:[h]);t.setAttribute(ls,"");let n=0,o=()=>{clearTimeout(n),n=0},a=()=>e.forEach((c,h)=>{c.textContent=i[h]});function l(){o();let c=v.params(t),h=c.getTime("scramble-duration",1500),u=Math.max(1,c.getTime("scramble-speed",30)),p=fh(t),d=Math.max(1,Math.ceil(h/u)),f=0,m=()=>{let y=Math.floor(f/d*s.length);s.forEach((w,A)=>{e[w].textContent=A<y?i[w]:mh(p)}),f++,f<=d?n=window.setTimeout(m,u):a()};m()}return{activate(){l()},cleanup(){o(),I(t),t.removeAttribute(ls)}}});var Mn="animate-image-wrapper";function gh(r){let t=(r.getAttribute("alt")||"").trim(),e=H(r,"animation-pause","Pause animation");return e.includes("{alt}")?e.replace("{alt}",t).trim():t?`${e}: ${t}`:e}v.effect("animate-image",r=>{let t=r;if(t.tagName!=="IMG"||!t.parentNode)return{cleanup(){}};t.removeAttribute("data-effect-animate-image-init"),t.hasAttribute("alt")||console.warn("[animate-image] Image has no alt text; describe what the animation shows.",t);let e=t.getAttribute("data-animate-image-src");if(e){t.src=e;let T=t.getAttribute("data-animate-image-srcset");T&&(t.srcset=T),t.removeAttribute("data-animate-image-src"),t.removeAttribute("data-animate-image-srcset")}let i=t.parentElement?.tagName==="PICTURE"?t.parentElement:null,s=i||t,n=i?[...i.querySelectorAll(":scope > source")]:[],o=s.parentElement?.classList.contains(Mn)?s.parentElement:null,a=o||document.createElement("span");o?a.querySelectorAll(":scope > .animate-image-toggle, :scope > .animate-image-placeholder").forEach(T=>T.remove()):(a.className=Mn,s.parentNode?.insertBefore(a,s),a.appendChild(s));let l=document.createElement("span");l.className="animate-image-placeholder",l.hidden=!0,a.appendChild(l);let c=document.createElement("button");c.type="button",c.className="animate-image-toggle",c.setAttribute("aria-pressed","false"),c.setAttribute("aria-label",gh(t)),a.appendChild(c);let h=t.hasAttribute("data-animate-image-paused"),u=t.getAttribute("data-poster"),p=!1,d=!1,f=null;function m(){if(u||!t.naturalWidth)return;let T=document.createElement("canvas");T.width=t.naturalWidth,T.height=t.naturalHeight;let O=T.getContext("2d");if(O)try{O.drawImage(t,0,0),u=T.toDataURL("image/png")}catch{u=null}}function y(){c.setAttribute("aria-pressed",String(p)),c.classList.toggle("paused",p),t.toggleAttribute("data-animate-image-paused",p)}function w({auto:T=!1}={}){if(!p){if(m(),p=!0,d=T,f={src:t.currentSrc||t.src,srcset:t.getAttribute("srcset"),sizes:t.getAttribute("sizes"),sources:n.map(O=>[O,O.getAttribute("srcset"),O.getAttribute("sizes")])},t.setAttribute("data-animate-image-src",t.getAttribute("src")||f.src),f.srcset&&t.setAttribute("data-animate-image-srcset",f.srcset),u){for(let[O]of f.sources)O.removeAttribute("srcset"),O.removeAttribute("sizes");t.removeAttribute("srcset"),t.removeAttribute("sizes"),t.src=u}else l.textContent=t.getAttribute("alt")||"",l.hidden=!1,a.setAttribute("data-animate-image-hidden","");y()}}function A(){if(p){if(p=!1,d=!1,f){for(let[T,O,ps]of f.sources)O!=null&&T.setAttribute("srcset",O),ps!=null&&T.setAttribute("sizes",ps);f.sizes!=null&&t.setAttribute("sizes",f.sizes),f.srcset!=null&&t.setAttribute("srcset",f.srcset),t.src=t.getAttribute("data-animate-image-src")||f.src}f=null,t.removeAttribute("data-animate-image-src"),t.removeAttribute("data-animate-image-srcset"),l.hidden=!0,a.removeAttribute("data-animate-image-hidden"),y()}}c.addEventListener("click",()=>p?A():w());function k(T){t.complete&&t.naturalWidth?T():t.addEventListener("load",T,{once:!0})}k(m),h?k(()=>w()):v.prefersReducedMotion()&&k(()=>w({auto:!0}));let L=()=>{v.prefersReducedMotion()?k(()=>w({auto:!0})):d&&A()},j=window.matchMedia("(prefers-reduced-motion: reduce)");j.addEventListener("change",L);let N=new MutationObserver(L);return N.observe(document.documentElement,{attributes:!0,attributeFilter:["data-motion-reduced"]}),{cleanup(){j.removeEventListener("change",L),N.disconnect(),p&&A(),t.toggleAttribute("data-animate-image-paused",h),c.remove(),l.remove(),a.parentNode&&(a.parentNode.insertBefore(s,a),a.remove())}}});var Ln="vb-stamp-noise",At="http://www.w3.org/2000/svg";function bh(){if(document.getElementById(Ln))return;let r=document.createElementNS(At,"svg");r.setAttribute("aria-hidden","true"),r.setAttribute("focusable","false"),r.setAttribute("width","0"),r.setAttribute("height","0"),r.style.position="absolute",r.style.overflow="hidden";let t=document.createElementNS(At,"filter");t.id=Ln;for(let[o,a]of Object.entries({x:"-5%",y:"-5%",width:"110%",height:"110%"}))t.setAttribute(o,a);let e=document.createElementNS(At,"feTurbulence");for(let[o,a]of Object.entries({type:"fractalNoise",baseFrequency:"0.75",numOctaves:"4",stitchTiles:"stitch",result:"noise"}))e.setAttribute(o,a);let i=document.createElementNS(At,"feColorMatrix");for(let[o,a]of Object.entries({type:"saturate",values:"0",in:"noise",result:"greyNoise"}))i.setAttribute(o,a);let s=document.createElementNS(At,"feComposite");for(let[o,a]of Object.entries({in:"SourceGraphic",in2:"greyNoise",operator:"in"}))s.setAttribute(o,a);t.append(e,i,s);let n=document.createElementNS(At,"defs");n.append(t),r.append(n),document.body.prepend(r)}v.effect("stamp",()=>(bh(),{cleanup(){}}));var _n="data-effect-flipboard-init",me=" ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789.,:!?/-",yh=60,vh=30,wh=80,J="\xA0",Rn=new WeakMap;function Ah(){let r=document.createElement("span");r.className="vb-flap-char";for(let e of["top","bottom","flip-top","flip-bottom"]){let i=document.createElement("span");i.className=`vb-flap-${e}`;let s=document.createElement("span");s.className="vb-flap-text",s.textContent=J,i.append(s),r.append(i)}let t=document.createElement("span");return t.className="vb-flap-hinge",r.append(t),r}function Nn(r,t){for(let e of r.querySelectorAll(".vb-flap-text"))e.textContent=t||J}function ge(r,t){return new Promise(e=>{let i=window.setTimeout(()=>{r.timers.delete(i),e(void 0)},t);r.timers.add(i)})}async function kh(r,t,e,i,s){let n=t.querySelector(".vb-flap-top .vb-flap-text"),o=t.querySelector(".vb-flap-bottom .vb-flap-text"),a=t.querySelector(".vb-flap-flip-top"),l=t.querySelector(".vb-flap-flip-bottom");n.textContent=e||J,o.textContent=e||J,a.querySelector(".vb-flap-text").textContent=e||J,l.querySelector(".vb-flap-text").textContent=i||J,a.classList.add("vb-flap-flipping"),l.classList.add("vb-flap-flipping"),await ge(r,s/2),n.textContent=i||J,await ge(r,s/2),o.textContent=i||J,a.classList.remove("vb-flap-flipping"),l.classList.remove("vb-flap-flipping")}async function xh(r,t,e,i,s,n){for(let o=0;o<i;o++){if(r.generation!==s)return;let a=o===i-1,l=me[o%me.length],c=a?e:me[(o+1)%me.length];await kh(r,t,l,c,n),a||await ge(r,vh)}}function $n(r){r.generation++;for(let t of r.timers)clearTimeout(t);r.timers.clear()}function Eh(r,t){let e=Tn(r,t.original);return r.classList.add("vb-flap-board"),t.chars.map(()=>e.appendChild(Ah()))}function Sh(r,t){$n(t);let e=r,i=v.params(e).getTime("flip-ms",yh);e.style.setProperty("--_vb-flip-duration",`${i}ms`);let s=Eh(r,t),n=t.generation;if(v.prefersReducedMotion()){s.forEach((o,a)=>Nn(o,t.chars[a]));return}Promise.all(s.map(async(o,a)=>{if(await ge(t,a*wh),t.generation!==n)return;let l=4+Math.floor(Math.random()*7);await xh(t,o,t.chars[a],l,n,i)})).then(()=>{t.generation===n&&s.forEach((o,a)=>Nn(o,t.chars[a]))})}v.effect("flipboard",r=>{let t=Cn(r).trim();if(I(r),r.classList.remove("vb-flap-board"),!t)return{cleanup(){}};let e={original:t,chars:vt(t.toLocaleUpperCase(r.closest("[lang]")?.getAttribute("lang")||void 0)),generation:0,timers:new Set};return Rn.set(r,e),r.setAttribute(_n,""),Sh(r,e),{cleanup(){$n(e),Rn.delete(r),r.textContent=e.original,r.classList.remove("vb-flap-board"),r.removeAttribute(_n),r.style.removeProperty("--_vb-flip-duration")}}});var be=new Map,cs=null,ye=!1;function Ch(r){for(let[t,e]of be)r.querySelectorAll(t).forEach(e)}function Th(r){if(r.nodeType!==Node.ELEMENT_NODE)return;let t=r;for(let[e,i]of be)t.matches(e)&&i(t),t.querySelectorAll(e).forEach(i)}function Mh(){cs||(cs=new MutationObserver(r=>{for(let t of r)for(let e of t.addedNodes)Th(e)}),cs.observe(document.documentElement,{childList:!0,subtree:!0}))}function Lh(){ye||(ye=!0,Ch(document))}function Pn(r,t){be.set(r,t),Mh(),ye||document.readyState!=="loading"?(ye=!0,document.querySelectorAll(r).forEach(t)):be.size===1&&document.addEventListener("DOMContentLoaded",Lh)}var Z=null;async function _h(){if(Z)return;Z=(await Promise.resolve().then(()=>(Re(),_e))).resolveEmoji}var On="[data-emoji]",zn=/(?<![\p{L}\p{N}_]):([a-z0-9_+-]+):/gu,Rh=/[a-z]/,Nh="script,style,code,pre,kbd,samp,var,textarea,code-block,[data-emoji-skip]",hs=["alt","title","aria-label"],Bn=new Set(["INPUT","TEXTAREA"]),$h=100,Ph=new Set(["insertFromPaste","insertFromDrop","insertReplacementText","insertFromYank"]),lt=new WeakMap;function us(r,t="keep"){if(!Z||!r.includes(":"))return r;let e=Z;return r.replace(zn,(i,s)=>{let n=e(s);return n?n.emoji:t==="strip"&&Rh.test(s)?"":i})}function Ih(r){return r.getAttribute("data-emoji-unknown")==="strip"?"strip":"keep"}function Oh(r){if(lt.has(r)||!r.hasAttribute("data-emoji"))return;if(r.removeAttribute("data-emoji-init"),Bn.has(r.tagName)){lt.set(r,Bh(r));return}if(ds(r),r.getAttribute("data-emoji-scan")!=="observe"){lt.set(r,()=>{});return}let t=null,e=new MutationObserver(()=>{t&&clearTimeout(t),t=setTimeout(()=>{t=null,ds(r)},$h)});e.observe(r,{childList:!0,subtree:!0,characterData:!0,attributes:!0,attributeFilter:hs}),lt.set(r,()=>{e.disconnect(),t&&clearTimeout(t)})}function zh(r){let t=lt.get(r);t&&(t(),lt.delete(r))}function Bh(r){let t=!1,e=!1,i=()=>{t=!0},s=()=>{t=!1,o(!0)},n=a=>{let{isComposing:l,inputType:c}=a;t||l||c==="historyUndo"||c==="historyRedo"||o(!!c&&!Ph.has(c))};function o(a=!1){if(!e){e=!0;try{Dh(r,a)}finally{e=!1}}}return r.addEventListener("compositionstart",i),r.addEventListener("compositionend",s),r.addEventListener("input",n),r.value&&o(),()=>{r.removeEventListener("compositionstart",i),r.removeEventListener("compositionend",s),r.removeEventListener("input",n)}}function Dh(r,t=!1){if(!Z)return;let e=r.value,i=r.selectionStart,s=[];for(let a of e.matchAll(zn)){let l=a.index??0,c=l+a[0].length;if(t&&i!==null&&c!==i)continue;let h=Z(a[1]);h&&s.push({start:l,end:c,emoji:h.emoji})}if(s.length===0)return;if(r.selectionStart===null){r.value=us(e,"keep");return}let n=r.selectionStart??e.length,o=document.activeElement===r&&typeof document.execCommand=="function";for(let a=s.length-1;a>=0;a--){let{start:l,end:c,emoji:h}=s[a];n>=c?n-=c-l-h.length:n>l&&(n=l+h.length);let u=!1;if(o){r.setSelectionRange(l,c);try{u=document.execCommand("insertText",!1,h)&&r.value.slice(l,l+h.length)===h}catch{u=!1}}u||r.setRangeText(h,l,c)}r.setSelectionRange(n,n)}function In(r,t){if(r.isContentEditable)return!0;let e=r.closest(Nh);return!!(e&&e!==t&&t.contains(e))}function ds(r){if(!Z)return;let t=Ih(r),e=document.createTreeWalker(r,NodeFilter.SHOW_TEXT,{acceptNode(o){let a=o.parentElement;return!a||In(a,r)?NodeFilter.FILTER_REJECT:(o.textContent??"").includes(":")?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}}),i=[];for(;e.nextNode();)i.push(e.currentNode);for(let o of i){let a=o.textContent??"",l=us(a,t);l!==a&&(o.textContent=l)}let s=hs.map(o=>`[${o}*=":"]`).join(","),n=[r,...r.querySelectorAll(s)];for(let o of n)if(!(o!==r&&In(o,r)))for(let a of hs){let l=o.getAttribute(a);if(!l)continue;let c=us(l,t);c!==l&&o.setAttribute(a,c)}}document.addEventListener("vb:emoji-extended",()=>{if(Z)for(let r of document.querySelectorAll(On))!lt.has(r)||Bn.has(r.tagName)||ds(r)});function Dn(r){_h().then(()=>Oh(r))}Pn(On,Dn);new MutationObserver(r=>{for(let{target:t}of r){let e=t;e.hasAttribute("data-emoji")?Dn(e):zh(e)}}).observe(document.documentElement,{attributes:!0,attributeFilter:["data-emoji"],subtree:!0});
1321
1324
  //# sourceMappingURL=vanilla-breeze-extras.js.map