vanilla-breeze 0.1.1 → 0.1.3

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 (134) hide show
  1. package/dist/cdn/components/accordion-wc.js +1 -1
  2. package/dist/cdn/components/analytics-panel.js +34 -0
  3. package/dist/cdn/components/audio-player.js +1 -1
  4. package/dist/cdn/components/audio-visualizer.js +2 -2
  5. package/dist/cdn/components/author-index.js +3 -0
  6. package/dist/cdn/components/brand-mark.js +2 -0
  7. package/dist/cdn/components/calendar-wc.js +2 -2
  8. package/dist/cdn/components/card-list.js +1 -1
  9. package/dist/cdn/components/carousel-wc.js +1 -1
  10. package/dist/cdn/components/change-set.js +1 -1
  11. package/dist/cdn/components/chart-wc.js +11 -11
  12. package/dist/cdn/components/chat-input.js +1 -1
  13. package/dist/cdn/components/chat-window.js +1 -1
  14. package/dist/cdn/components/color-palette.js +13 -7
  15. package/dist/cdn/components/color-picker.js +1 -1
  16. package/dist/cdn/components/combo-box.js +1 -1
  17. package/dist/cdn/components/command-palette.js +1 -1
  18. package/dist/cdn/components/comment-wc.js +2 -0
  19. package/dist/cdn/components/compare-surface.js +1 -1
  20. package/dist/cdn/components/component-sampler.js +4 -4
  21. package/dist/cdn/components/consent-banner.js +1 -1
  22. package/dist/cdn/components/content-lens.js +2 -0
  23. package/dist/cdn/components/content-swap.js +1 -1
  24. package/dist/cdn/components/context-menu.js +1 -1
  25. package/dist/cdn/components/data-table.js +1 -1
  26. package/dist/cdn/components/date-picker.js +1 -1
  27. package/dist/cdn/components/day-view.js +1 -1
  28. package/dist/cdn/components/drag-surface.js +1 -1
  29. package/dist/cdn/components/drop-down.js +1 -1
  30. package/dist/cdn/components/emoji-picker.js +1 -1
  31. package/dist/cdn/components/flow-diagram.js +1 -1
  32. package/dist/cdn/components/font-pairer.js +108 -0
  33. package/dist/cdn/components/foot-notes.js +1 -1
  34. package/dist/cdn/components/form-field.js +1 -1
  35. package/dist/cdn/components/gantt-chart.js +1 -1
  36. package/dist/cdn/components/geo-map.js +7 -7
  37. package/dist/cdn/components/glossary-index.js +1 -1
  38. package/dist/cdn/components/glossary-wc.js +1 -1
  39. package/dist/cdn/components/gradient-builder.js +52 -0
  40. package/dist/cdn/components/heading-links.js +1 -1
  41. package/dist/cdn/components/highlight-wc.js +3 -0
  42. package/dist/cdn/components/image-gallery.js +1 -1
  43. package/dist/cdn/components/image-map.js +1 -1
  44. package/dist/cdn/components/impact-effort.js +1 -1
  45. package/dist/cdn/components/include-file.js +1 -1
  46. package/dist/cdn/components/kanban-board.js +1 -1
  47. package/dist/cdn/components/manifest.json +153 -81
  48. package/dist/cdn/components/markdown-editor.js +1 -1
  49. package/dist/cdn/components/markdown-viewer.js +4 -4
  50. package/dist/cdn/components/motion-specimen.js +21 -0
  51. package/dist/cdn/components/note-wc.js +3 -0
  52. package/dist/cdn/components/notification-wc.js +37 -0
  53. package/dist/cdn/components/page-info.js +55 -24
  54. package/dist/cdn/components/page-stats.js +1 -1
  55. package/dist/cdn/components/page-toc.js +1 -1
  56. package/dist/cdn/components/page-tools.js +1 -1
  57. package/dist/cdn/components/page-tour.js +2 -2
  58. package/dist/cdn/components/palette-generator.js +1 -1
  59. package/dist/cdn/components/popularity-index.js +9 -0
  60. package/dist/cdn/components/print-page.js +1 -1
  61. package/dist/cdn/components/qr-code.js +1 -1
  62. package/dist/cdn/components/reader-view.js +2 -2
  63. package/dist/cdn/components/recently-visited.js +27 -0
  64. package/dist/cdn/components/review-surface.js +11 -11
  65. package/dist/cdn/components/selection-menu.js +2 -0
  66. package/dist/cdn/components/semantic-palette.js +30 -0
  67. package/dist/cdn/components/settings-panel.js +55 -51
  68. package/dist/cdn/components/share-wc.js +2 -2
  69. package/dist/cdn/components/short-cuts.js +1 -1
  70. package/dist/cdn/components/site-index.js +1 -1
  71. package/dist/cdn/components/site-map-wc.js +1 -1
  72. package/dist/cdn/components/site-map.js +1 -1
  73. package/dist/cdn/components/site-search.js +3 -3
  74. package/dist/cdn/components/slide-accept.js +1 -1
  75. package/dist/cdn/components/social-embed.js +1 -1
  76. package/dist/cdn/components/spacing-specimen.js +5 -5
  77. package/dist/cdn/components/split-surface.js +1 -1
  78. package/dist/cdn/components/star-rating.js +1 -1
  79. package/dist/cdn/components/story-map.js +1 -1
  80. package/dist/cdn/components/tab-set.js +1 -1
  81. package/dist/cdn/components/text-reader.js +2 -2
  82. package/dist/cdn/components/theme-export.js +18 -0
  83. package/dist/cdn/components/theme-picker.js +59 -59
  84. package/dist/cdn/components/time-index.js +1 -1
  85. package/dist/cdn/components/time-picker.js +1 -1
  86. package/dist/cdn/components/toast-msg.js +1 -1
  87. package/dist/cdn/components/token-specimen.js +25 -20
  88. package/dist/cdn/components/tool-tip.js +1 -1
  89. package/dist/cdn/components/topic-map.js +4 -0
  90. package/dist/cdn/components/trust-filter.js +4 -0
  91. package/dist/cdn/components/type-specimen.js +16 -13
  92. package/dist/cdn/components/user-story.js +8 -8
  93. package/dist/cdn/components/video-player.js +4 -4
  94. package/dist/cdn/components/watch-wc.js +3 -0
  95. package/dist/cdn/components/week-view.js +1 -1
  96. package/dist/cdn/components/work-item.js +14 -14
  97. package/dist/cdn/components/youtube-player.js +1 -1
  98. package/dist/cdn/packs/design-system.full.js +124 -47
  99. package/dist/cdn/packs/effects.full.js +1 -1
  100. package/dist/cdn/packs/kawaii.full.css +1 -1
  101. package/dist/cdn/packs/kawaii.full.js +1 -1
  102. package/dist/cdn/packs/kawaii.theme.css +1 -1
  103. package/dist/cdn/packs/manifest.json +8 -38
  104. package/dist/cdn/packs/ui.full.css +1 -1
  105. package/dist/cdn/packs/ui.full.js +51 -51
  106. package/dist/cdn/packs/ux-planning.full.js +122 -122
  107. package/dist/cdn/themes/alpha1999.css +1 -1
  108. package/dist/cdn/themes/brutalist.css +1 -1
  109. package/dist/cdn/themes/claymorphism.css +1 -1
  110. package/dist/cdn/themes/genai.css +1 -1
  111. package/dist/cdn/themes/kawaii.css +1 -1
  112. package/dist/cdn/themes/magna.css +1 -1
  113. package/dist/cdn/themes/manifest.json +12 -12
  114. package/dist/cdn/themes/nes.css +1 -1
  115. package/dist/cdn/themes/neumorphism.css +1 -1
  116. package/dist/cdn/themes/rough.css +1 -1
  117. package/dist/cdn/themes/startup.css +1 -1
  118. package/dist/cdn/themes/super2026.css +1 -1
  119. package/dist/cdn/themes/win9x.css +1 -1
  120. package/dist/cdn/vanilla-breeze-charts.css +1 -1
  121. package/dist/cdn/vanilla-breeze-charts.js +11 -11
  122. package/dist/cdn/vanilla-breeze-core.css +1 -1
  123. package/dist/cdn/vanilla-breeze-core.js +119 -47
  124. package/dist/cdn/vanilla-breeze-extras.js +154 -74
  125. package/dist/cdn/vanilla-breeze.css +1 -1
  126. package/dist/cdn/vanilla-breeze.js +629 -248
  127. package/package.json +12 -7
  128. package/dist/cdn/packs/retro.bundle.js +0 -2
  129. package/dist/cdn/packs/retro.components.js +0 -1
  130. package/dist/cdn/packs/retro.effects.css +0 -2
  131. package/dist/cdn/packs/retro.effects.js +0 -16
  132. package/dist/cdn/packs/retro.full.css +0 -5
  133. package/dist/cdn/packs/retro.full.js +0 -16
  134. package/dist/cdn/packs/retro.theme.css +0 -2
@@ -1,2 +1,2 @@
1
- function o(i){return document.startViewTransition?document.startViewTransition(i):i()}var p=window.matchMedia("(prefers-reduced-motion: reduce)");var u=new Map;function d(i,e,r={}){let n=r.priority??10,t={impl:e,bundle:r.bundle,contract:r.contract,priority:n},s=u.get(i);if(customElements.get(i)){if(!s||s.priority>=n){s&&s.priority===n&&s.impl!==e&&console.warn(`[VB Bundle] Tag <${i}> already registered by "${s.bundle}" (priority ${s.priority}). Skipping "${r.bundle}".`);return}console.warn(`[VB Bundle] Tag <${i}> defined by "${s.bundle}" cannot be replaced (customElements.define is permanent). "${r.bundle}" has higher priority but arrived late.`);return}if(s&&s.priority>=n){s.priority===n&&console.warn(`[VB Bundle] Tag <${i}> already registered by "${s.bundle}". Skipping "${r.bundle}" (first wins at equal priority).`);return}u.set(i,t),customElements.define(i,e)}var a=class extends HTMLElement{#e=[];connectedCallback(){this.hasAttribute("data-upgraded")||this.setup()!==!1&&this.setAttribute("data-upgraded","")}disconnectedCallback(){for(let e of this.#e)e();this.#e=[],this.removeAttribute("data-upgraded"),this.teardown()}listen(e,r,n,t){e.addEventListener(r,n,t),this.#e.push(()=>e.removeEventListener(r,n,t))}setup(){}teardown(){}};var h=0,c=class extends a{#e=[];#t=[];#n=[];#r=!1;setup(){if(this.#e=[...this.querySelectorAll(":scope > details")],this.#t=this.#e.map(e=>e.querySelector("summary")),this.#e.length===0)return!1;this.#i(),this.#a(),this.#o()}teardown(){this.#e=[],this.#t=[],this.#n=[],this.#r=!1}#i(){this.#n=this.#e.map(e=>{let r=e.querySelector("summary");if(!r)return null;let n=[...e.children].filter(t=>t!==r);if(n.length===1)return n[0];if(n.length>1){let t=document.createElement("div");for(let s of n)t.appendChild(s);return e.appendChild(t),t}return null})}#o(){if(!this.hasAttribute("transition")||!document.startViewTransition)return;this.#r=!0;let e=++h,r=this.getAttribute("transition")||"fade",n=r==="slide"?"vt-accordion-slide":r==="scale"?"vt-accordion-scale":"vt-accordion";this.#n.forEach((t,s)=>{t&&(t.style.viewTransitionName=`accordion-${e}-${s}`,t.style.viewTransitionClass=n)})}#s(e){o(()=>{e.open=!e.open})}#a(){this.#e.forEach((e,r)=>{let n=this.#t[r],t=this.#n[r];if(n){if(t){let s=n.id||`accordion-heading-${crypto.randomUUID().slice(0,8)}`,l=t.id||`accordion-panel-${crypto.randomUUID().slice(0,8)}`;n.id=s,t.id=l,n.setAttribute("aria-expanded",e.open?"true":"false"),n.setAttribute("aria-controls",l),t.setAttribute("aria-labelledby",s),t.setAttribute("role","region")}else n.setAttribute("aria-expanded",e.open?"true":"false");this.listen(n,"click",s=>{this.#r&&(s.preventDefault(),this.#s(e))}),this.listen(n,"keydown",s=>this.#l(s,r)),this.listen(e,"toggle",()=>this.#c(e,r))}})}#c(e,r){this.#t[r].setAttribute("aria-expanded",e.open?"true":"false"),this.hasAttribute("single")&&e.open&&this.#e.forEach((t,s)=>{s!==r&&t.open&&(t.open=!1,this.#t[s].setAttribute("aria-expanded","false"))}),this.dispatchEvent(new CustomEvent("accordion-wc:toggle",{detail:{index:r,open:e.open},bubbles:!0}))}#l(e,r){let{key:n}=e,t;switch(n){case"ArrowDown":t=(r+1)%this.#e.length;break;case"ArrowUp":t=(r-1+this.#e.length)%this.#e.length;break;case"Home":t=0;break;case"End":t=this.#e.length-1;break;default:return}e.preventDefault(),this.#t[t].focus()}open(e){e<0||e>=this.#e.length||(this.#r&&!this.#e[e].open?o(()=>{this.#e[e].open=!0}):this.#e[e].open=!0)}close(e){e<0||e>=this.#e.length||(this.#r&&this.#e[e].open?o(()=>{this.#e[e].open=!1}):this.#e[e].open=!1)}toggle(e){e<0||e>=this.#e.length||(this.#r?this.#s(this.#e[e]):this.#e[e].open=!this.#e[e].open)}openAll(){this.hasAttribute("single")||this.#e.forEach(e=>{e.open=!0})}closeAll(){this.#e.forEach(e=>{e.open=!1})}};d("accordion-wc",c);export{c as AccordionWc};
1
+ function o(i){return document.startViewTransition?document.startViewTransition(i):i()}var p=window.matchMedia("(prefers-reduced-motion: reduce)");var u=new Map;function d(i,e,r={}){let s=r.priority??10,t={impl:e,bundle:r.bundle,contract:r.contract,priority:s},n=u.get(i);if(customElements.get(i)){if(!n||n.priority>=s){n&&n.priority===s&&n.impl!==e&&console.warn(`[VB Bundle] Tag <${i}> already registered by "${n.bundle}" (priority ${n.priority}). Skipping "${r.bundle}".`);return}console.warn(`[VB Bundle] Tag <${i}> defined by "${n.bundle}" cannot be replaced (customElements.define is permanent). "${r.bundle}" has higher priority but arrived late.`);return}if(n&&n.priority>=s){n.priority===s&&console.warn(`[VB Bundle] Tag <${i}> already registered by "${n.bundle}". Skipping "${r.bundle}" (first wins at equal priority).`);return}u.set(i,t),customElements.define(i,e)}var a=class extends HTMLElement{#e=[];connectedCallback(){this.hasAttribute("data-upgraded")||this.setup()!==!1&&(this.setAttribute("data-upgraded",""),this.dispatchEvent(new CustomEvent(`${this.localName}:upgraded`,{bubbles:!0})))}disconnectedCallback(){for(let e of this.#e)e();this.#e=[],this.removeAttribute("data-upgraded"),this.teardown()}listen(e,r,s,t){e.addEventListener(r,s,t),this.#e.push(()=>e.removeEventListener(r,s,t))}setup(){}teardown(){}};var h=0,c=class extends a{#e=[];#t=[];#s=[];#r=!1;setup(){if(this.#e=[...this.querySelectorAll(":scope > details")],this.#t=this.#e.map(e=>e.querySelector("summary")),this.#e.length===0)return!1;this.#i(),this.#a(),this.#o()}teardown(){this.#e=[],this.#t=[],this.#s=[],this.#r=!1}#i(){this.#s=this.#e.map(e=>{let r=e.querySelector("summary");if(!r)return null;let s=[...e.children].filter(t=>t!==r);if(s.length===1)return s[0];if(s.length>1){let t=document.createElement("div");for(let n of s)t.appendChild(n);return e.appendChild(t),t}return null})}#o(){if(!this.hasAttribute("transition")||!document.startViewTransition)return;this.#r=!0;let e=++h,r=this.getAttribute("transition")||"fade",s=r==="slide"?"vt-accordion-slide":r==="scale"?"vt-accordion-scale":"vt-accordion";this.#s.forEach((t,n)=>{t&&(t.style.viewTransitionName=`accordion-${e}-${n}`,t.style.viewTransitionClass=s)})}#n(e){o(()=>{e.open=!e.open})}#a(){this.#e.forEach((e,r)=>{let s=this.#t[r],t=this.#s[r];if(s){if(t){let n=s.id||`accordion-heading-${crypto.randomUUID().slice(0,8)}`,l=t.id||`accordion-panel-${crypto.randomUUID().slice(0,8)}`;s.id=n,t.id=l,s.setAttribute("aria-expanded",e.open?"true":"false"),s.setAttribute("aria-controls",l),t.setAttribute("aria-labelledby",n),t.setAttribute("role","region")}else s.setAttribute("aria-expanded",e.open?"true":"false");this.listen(s,"click",n=>{this.#r&&(n.preventDefault(),this.#n(e))}),this.listen(s,"keydown",n=>this.#l(n,r)),this.listen(e,"toggle",()=>this.#c(e,r))}})}#c(e,r){this.#t[r].setAttribute("aria-expanded",e.open?"true":"false"),this.hasAttribute("single")&&e.open&&this.#e.forEach((t,n)=>{n!==r&&t.open&&(t.open=!1,this.#t[n].setAttribute("aria-expanded","false"))}),this.dispatchEvent(new CustomEvent("accordion-wc:toggle",{detail:{index:r,open:e.open},bubbles:!0}))}#l(e,r){let{key:s}=e,t;switch(s){case"ArrowDown":t=(r+1)%this.#e.length;break;case"ArrowUp":t=(r-1+this.#e.length)%this.#e.length;break;case"Home":t=0;break;case"End":t=this.#e.length-1;break;default:return}e.preventDefault(),this.#t[t].focus()}open(e){e<0||e>=this.#e.length||(this.#r&&!this.#e[e].open?o(()=>{this.#e[e].open=!0}):this.#e[e].open=!0)}close(e){e<0||e>=this.#e.length||(this.#r&&this.#e[e].open?o(()=>{this.#e[e].open=!1}):this.#e[e].open=!1)}toggle(e){e<0||e>=this.#e.length||(this.#r?this.#n(this.#e[e]):this.#e[e].open=!this.#e[e].open)}openAll(){this.hasAttribute("single")||this.#e.forEach(e=>{e.open=!0})}closeAll(){this.#e.forEach(e=>{e.open=!1})}};d("accordion-wc",c);export{c as AccordionWc};
2
2
  //# sourceMappingURL=accordion-wc.js.map
@@ -0,0 +1,34 @@
1
+ var y=window.matchMedia("(prefers-reduced-motion: reduce)");var u=new Map;function p(s,t,e={}){let n=e.priority??10,a={impl:t,bundle:e.bundle,contract:e.contract,priority:n},o=u.get(s);if(customElements.get(s)){if(!o||o.priority>=n){o&&o.priority===n&&o.impl!==t&&console.warn(`[VB Bundle] Tag <${s}> already registered by "${o.bundle}" (priority ${o.priority}). Skipping "${e.bundle}".`);return}console.warn(`[VB Bundle] Tag <${s}> defined by "${o.bundle}" cannot be replaced (customElements.define is permanent). "${e.bundle}" has higher priority but arrived late.`);return}if(o&&o.priority>=n){o.priority===n&&console.warn(`[VB Bundle] Tag <${s}> already registered by "${o.bundle}". Skipping "${e.bundle}" (first wins at equal priority).`);return}u.set(s,a),customElements.define(s,t)}var l=class extends HTMLElement{#t=[];connectedCallback(){this.hasAttribute("data-upgraded")||this.setup()!==!1&&(this.setAttribute("data-upgraded",""),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,n,a){t.addEventListener(e,n,a),this.#t.push(()=>t.removeEventListener(e,n,a))}setup(){}teardown(){}};var i={optout:"vb_optout",sessionCount:"vb_sc",eventQueue:"vb_q"};function h(s){return String(s).replace(/[&<>"']/g,t=>({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"})[t])}function f(s){return typeof s!="number"||s<=0?"\u2014":s<6e4?`${Math.round(s/1e3)}s`:`${Math.floor(s/6e4)}m ${Math.round(s%6e4/1e3)}s`}var d=class extends l{setup(){this.#e(),this.listen(this,"click",this.#t)}get isOptedOut(){try{return sessionStorage.getItem(i.optout)==="1"}catch{return!1}}get sessionCounter(){try{let t=sessionStorage.getItem(i.sessionCount);return t?JSON.parse(t):null}catch{return null}}get queuedEvents(){try{let t=sessionStorage.getItem(i.eventQueue);return t?JSON.parse(t):[]}catch{return[]}}get hasSessionData(){return this.sessionCounter!=null||this.queuedEvents.length>0}#t=t=>{let e=t.target?.closest?.("[data-analytics-action]");if(!e||!this.contains(e))return;let n=e.dataset.analyticsAction;n==="clear"&&this.#s(),n==="optout"&&this.#n(),n==="refresh"&&this.#e()};#s(){try{sessionStorage.removeItem(i.sessionCount),sessionStorage.removeItem(i.eventQueue)}catch{}this.dispatchEvent(new CustomEvent("analytics-panel:cleared",{bubbles:!0,composed:!0})),this.#e()}#n(){let t=!this.isOptedOut;try{t?sessionStorage.setItem(i.optout,"1"):sessionStorage.removeItem(i.optout)}catch{}this.dispatchEvent(new CustomEvent(t?"analytics-panel:optout":"analytics-panel:optin",{bubbles:!0,composed:!0})),t?this.#s():this.#e()}#e(){let t=this.getAttribute("title")||"Analytics data",e=this.isOptedOut,n=this.hasSessionData;this.innerHTML=`
2
+ <header class="analytics-panel__header">
3
+ <h3>${h(t)}</h3>
4
+ <p class="analytics-panel__status" role="status">
5
+ <span class="analytics-panel__dot analytics-panel__dot--${e?"paused":"active"}" aria-hidden="true"></span>
6
+ ${e?"Analytics paused for this tab. No data is being collected.":"Analytics active. Only aggregate, device-scoped data is collected."}
7
+ </p>
8
+ </header>
9
+
10
+ <section class="analytics-panel__body">
11
+ <h4>Stored on this device (this session only)</h4>
12
+ ${this.#o()}
13
+ </section>
14
+
15
+ <footer class="analytics-panel__actions">
16
+ ${n?`
17
+ <button type="button" data-analytics-action="clear" class="analytics-panel__action analytics-panel__action--danger">
18
+ Clear my data
19
+ </button>
20
+ `:""}
21
+ <button type="button" data-analytics-action="optout" class="analytics-panel__action analytics-panel__action--toggle">
22
+ ${e?"Resume analytics":"Pause analytics"}
23
+ </button>
24
+ <button type="button" data-analytics-action="refresh" class="analytics-panel__action">
25
+ Refresh
26
+ </button>
27
+ </footer>
28
+
29
+ <p class="analytics-panel__note">
30
+ No cookies, no cross-site identifiers, no IP address stored.
31
+ Data is cleared automatically when you close this tab.
32
+ </p>
33
+ `}#o(){if(!this.hasSessionData)return'<p class="analytics-panel__empty">No data stored on this device in this session.</p>';let t=this.sessionCounter,e=this.queuedEvents,n=e.find(c=>c?.id==="__scroll"),a=e.find(c=>c?.id==="__attention"),o=e.filter(c=>!c?.id?.startsWith?.("__")).length,r=[];return t?.v!=null&&r.push(`<dt>Pages this session</dt><dd>${t.v}</dd>`),n&&r.push(`<dt>Max scroll depth</dt><dd>${n.params?.depth??"?"}%</dd>`),a&&r.push(`<dt>Active reading time</dt><dd>${f(a.params?.ms)}</dd>`),o>0&&r.push(`<dt>Queued events</dt><dd>${o}</dd>`),`<dl class="analytics-panel__data">${r.join("")}</dl>`}};p("analytics-panel",d);
34
+ //# sourceMappingURL=analytics-panel.js.map
@@ -1,4 +1,4 @@
1
- var c=window.matchMedia("(prefers-reduced-motion: reduce)");var u=new Map;function d(s,e,t={}){let r=t.priority??10,i={impl:e,bundle:t.bundle,contract:t.contract,priority:r},a=u.get(s);if(customElements.get(s)){if(!a||a.priority>=r){a&&a.priority===r&&a.impl!==e&&console.warn(`[VB Bundle] Tag <${s}> already registered by "${a.bundle}" (priority ${a.priority}). Skipping "${t.bundle}".`);return}console.warn(`[VB Bundle] Tag <${s}> defined by "${a.bundle}" cannot be replaced (customElements.define is permanent). "${t.bundle}" has higher priority but arrived late.`);return}if(a&&a.priority>=r){a.priority===r&&console.warn(`[VB Bundle] Tag <${s}> already registered by "${a.bundle}". Skipping "${t.bundle}" (first wins at equal priority).`);return}u.set(s,i),customElements.define(s,e)}var n=class extends HTMLElement{#e=[];connectedCallback(){this.hasAttribute("data-upgraded")||this.setup()!==!1&&this.setAttribute("data-upgraded","")}disconnectedCallback(){for(let e of this.#e)e();this.#e=[],this.removeAttribute("data-upgraded"),this.teardown()}listen(e,t,r,i){e.addEventListener(t,r,i),this.#e.push(()=>e.removeEventListener(t,r,i))}setup(){}teardown(){}};var l=class extends n{#e=null;#t=null;#i=!1;#v=null;#a=null;#s=null;#u=null;#r=null;#d=null;#c=null;#o=null;#h=null;setup(){if(this.#e=this.querySelector("audio"),!this.#e)return!1;this.#t=this.querySelector(".track-list"),this.#e.removeAttribute("controls");let e=!this.shadowRoot;this.#f(),e&&(this.#y(),this.#g(),this.#x()),this.#p(),this.hasAttribute("autoplay")&&this.#e.play().catch(()=>{}),this.#h=()=>{let t=this.shadowRoot?.querySelector(".player");t&&(t.style.display="none",t.offsetHeight,t.style.display="")},this.listen(window,"vb:theme-change",this.#h)}teardown(){this.#e&&this.#e.setAttribute("controls","")}#f(){if(this.shadowRoot)return;let e=this.attachShadow({mode:"open"});e.innerHTML=`
1
+ var c=window.matchMedia("(prefers-reduced-motion: reduce)");var u=new Map;function d(s,e,t={}){let r=t.priority??10,i={impl:e,bundle:t.bundle,contract:t.contract,priority:r},a=u.get(s);if(customElements.get(s)){if(!a||a.priority>=r){a&&a.priority===r&&a.impl!==e&&console.warn(`[VB Bundle] Tag <${s}> already registered by "${a.bundle}" (priority ${a.priority}). Skipping "${t.bundle}".`);return}console.warn(`[VB Bundle] Tag <${s}> defined by "${a.bundle}" cannot be replaced (customElements.define is permanent). "${t.bundle}" has higher priority but arrived late.`);return}if(a&&a.priority>=r){a.priority===r&&console.warn(`[VB Bundle] Tag <${s}> already registered by "${a.bundle}". Skipping "${t.bundle}" (first wins at equal priority).`);return}u.set(s,i),customElements.define(s,e)}var n=class extends HTMLElement{#e=[];connectedCallback(){this.hasAttribute("data-upgraded")||this.setup()!==!1&&(this.setAttribute("data-upgraded",""),this.dispatchEvent(new CustomEvent(`${this.localName}:upgraded`,{bubbles:!0})))}disconnectedCallback(){for(let e of this.#e)e();this.#e=[],this.removeAttribute("data-upgraded"),this.teardown()}listen(e,t,r,i){e.addEventListener(t,r,i),this.#e.push(()=>e.removeEventListener(t,r,i))}setup(){}teardown(){}};var l=class extends n{#e=null;#t=null;#i=!1;#v=null;#a=null;#s=null;#u=null;#r=null;#d=null;#c=null;#o=null;#h=null;setup(){if(this.#e=this.querySelector("audio"),!this.#e)return!1;this.#t=this.querySelector(".track-list"),this.#e.removeAttribute("controls");let e=!this.shadowRoot;this.#f(),e&&(this.#y(),this.#g(),this.#x()),this.#p(),this.hasAttribute("autoplay")&&this.#e.play().catch(()=>{}),this.#h=()=>{let t=this.shadowRoot?.querySelector(".player");t&&(t.style.display="none",t.offsetHeight,t.style.display="")},this.listen(window,"vb:theme-change",this.#h)}teardown(){this.#e&&this.#e.setAttribute("controls","")}#f(){if(this.shadowRoot)return;let e=this.attachShadow({mode:"open"});e.innerHTML=`
2
2
  <style>${this.#b()}</style>
3
3
  <div part="player" class="player">
4
4
  <div part="controls" class="controls" role="group" aria-label="Audio controls">
@@ -1,4 +1,4 @@
1
- var S=window.matchMedia("(prefers-reduced-motion: reduce)");var v=new Map;function w(o,e,t={}){let n=t.priority??10,s={impl:e,bundle:t.bundle,contract:t.contract,priority:n},i=v.get(o);if(customElements.get(o)){if(!i||i.priority>=n){i&&i.priority===n&&i.impl!==e&&console.warn(`[VB Bundle] Tag <${o}> already registered by "${i.bundle}" (priority ${i.priority}). Skipping "${t.bundle}".`);return}console.warn(`[VB Bundle] Tag <${o}> defined by "${i.bundle}" cannot be replaced (customElements.define is permanent). "${t.bundle}" has higher priority but arrived late.`);return}if(i&&i.priority>=n){i.priority===n&&console.warn(`[VB Bundle] Tag <${o}> already registered by "${i.bundle}". Skipping "${t.bundle}" (first wins at equal priority).`);return}v.set(o,s),customElements.define(o,e)}var u=class extends HTMLElement{#n=[];connectedCallback(){this.hasAttribute("data-upgraded")||this.setup()!==!1&&this.setAttribute("data-upgraded","")}disconnectedCallback(){for(let e of this.#n)e();this.#n=[],this.removeAttribute("data-upgraded"),this.teardown()}listen(e,t,n,s){e.addEventListener(t,n,s),this.#n.push(()=>e.removeEventListener(t,n,s))}setup(){}teardown(){}};var f=new Map;function E(){if(!f.has("default"))try{f.set("default",new AudioContext)}catch{return null}return f.get("default")}var m=new WeakMap;function k(o,e){if(m.has(o))return m.get(o);let t=e.createMediaElementSource(o);return m.set(o,t),t}var y=class extends u{#n=null;#E=null;#s=null;#t=null;#e=null;#l=null;#i=null;#c=null;#a=!0;#r=!1;#o=!1;#h=null;static get observedAttributes(){return["for","data-mode","data-fft-size"]}setup(){this.#o=window.matchMedia("(prefers-reduced-motion: reduce)").matches;let e=!this.shadowRoot;this.#m(),this.#u(),e&&(this.#w(),this.#M()),this.#h=()=>{let t=this.shadowRoot?.querySelector("canvas");t&&(t.style.display="none",t.offsetHeight,t.style.display="")},this.listen(window,"vb:theme-change",this.#h)}teardown(){this.#f(),this.#c?.disconnect()}attributeChangedCallback(e){e==="for"&&this.#u()}#m(){if(this.shadowRoot)return;let e=this.attachShadow({mode:"open"});e.innerHTML=`
1
+ var S=window.matchMedia("(prefers-reduced-motion: reduce)");var v=new Map;function w(o,e,t={}){let s=t.priority??10,n={impl:e,bundle:t.bundle,contract:t.contract,priority:s},i=v.get(o);if(customElements.get(o)){if(!i||i.priority>=s){i&&i.priority===s&&i.impl!==e&&console.warn(`[VB Bundle] Tag <${o}> already registered by "${i.bundle}" (priority ${i.priority}). Skipping "${t.bundle}".`);return}console.warn(`[VB Bundle] Tag <${o}> defined by "${i.bundle}" cannot be replaced (customElements.define is permanent). "${t.bundle}" has higher priority but arrived late.`);return}if(i&&i.priority>=s){i.priority===s&&console.warn(`[VB Bundle] Tag <${o}> already registered by "${i.bundle}". Skipping "${t.bundle}" (first wins at equal priority).`);return}v.set(o,n),customElements.define(o,e)}var u=class extends HTMLElement{#s=[];connectedCallback(){this.hasAttribute("data-upgraded")||this.setup()!==!1&&(this.setAttribute("data-upgraded",""),this.dispatchEvent(new CustomEvent(`${this.localName}:upgraded`,{bubbles:!0})))}disconnectedCallback(){for(let e of this.#s)e();this.#s=[],this.removeAttribute("data-upgraded"),this.teardown()}listen(e,t,s,n){e.addEventListener(t,s,n),this.#s.push(()=>e.removeEventListener(t,s,n))}setup(){}teardown(){}};var f=new Map;function M(){if(!f.has("default"))try{f.set("default",new AudioContext)}catch{return null}return f.get("default")}var m=new WeakMap;function k(o,e){if(m.has(o))return m.get(o);let t=e.createMediaElementSource(o);return m.set(o,t),t}var y=class extends u{#s=null;#M=null;#n=null;#t=null;#e=null;#l=null;#i=null;#c=null;#a=!0;#r=!1;#o=!1;#h=null;static get observedAttributes(){return["for","data-mode","data-fft-size"]}setup(){this.#o=window.matchMedia("(prefers-reduced-motion: reduce)").matches;let e=!this.shadowRoot;this.#m(),this.#u(),e&&(this.#w(),this.#E()),this.#h=()=>{let t=this.shadowRoot?.querySelector("canvas");t&&(t.style.display="none",t.offsetHeight,t.style.display="")},this.listen(window,"vb:theme-change",this.#h)}teardown(){this.#f(),this.#c?.disconnect()}attributeChangedCallback(e){e==="for"&&this.#u()}#m(){if(this.shadowRoot)return;let e=this.attachShadow({mode:"open"});e.innerHTML=`
2
2
  <style>
3
3
  :host {
4
4
  display: block;
@@ -16,5 +16,5 @@ var S=window.matchMedia("(prefers-reduced-motion: reduce)");var v=new Map;functi
16
16
  }
17
17
  </style>
18
18
  <canvas aria-hidden="true"></canvas>
19
- `,this.#n=e.querySelector("canvas")}#u(){let e=this.getAttribute("for");e&&(this.#s=document.getElementById(e),!(!this.#s||this.#s.tagName!=="AUDIO")&&(this.#r||this.#s.addEventListener("play",()=>this.#y(),{once:!0})))}#y(){if(this.#r||(this.#r=!0,this.#t=E(),!this.#t))return;this.#t.state==="suspended"&&this.#t.resume();let e=parseInt(this.getAttribute("data-fft-size")||"256",10);this.#e=this.#t.createAnalyser(),this.#e.fftSize=e,this.#e.smoothingTimeConstant=.8,this.#l=k(this.#s,this.#t),this.#l.connect(this.#e),this.#e.connect(this.#t.destination),this.#d()}#d(){if(this.#o)return;let e=()=>{if(!this.#a||this.#o){this.#i=null;return}this.#i=requestAnimationFrame(e),this.#b()};this.#i=requestAnimationFrame(e)}#f(){this.#i&&(cancelAnimationFrame(this.#i),this.#i=null)}#b(){let e=this.#n,t=e.getContext("2d");if(!t)return;let n=e.width=e.offsetWidth*(window.devicePixelRatio||1),s=e.height=e.offsetHeight*(window.devicePixelRatio||1),i=getComputedStyle(this),c=i.getPropertyValue("--_color").trim()||"oklch(55% 0.2 260)",a=i.getPropertyValue("--_bg").trim();if(t.clearRect(0,0,n,s),a&&a!=="transparent"&&(t.fillStyle=a,t.fillRect(0,0,n,s)),!this.#e)return;let d=this.getAttribute("data-mode")||"bars",l=this.#e.frequencyBinCount,r=new Uint8Array(l);d==="waveform"?(this.#e.getByteTimeDomainData(r),this.#g(t,n,s,c,r)):d==="circle"?(this.#e.getByteFrequencyData(r),this.#v(t,n,s,c,r)):(this.#e.getByteFrequencyData(r),this.#p(t,n,s,c,r))}#p(e,t,n,s,i){let c=Math.min(i.length,64),a=t/c-1;e.fillStyle=s;for(let d=0;d<c;d++){let r=i[d]/255*n,h=d*(t/c);e.fillRect(h,n-r,a,r)}}#g(e,t,n,s,i){let c=t/i.length;e.strokeStyle=s,e.lineWidth=2,e.beginPath();for(let a=0;a<i.length;a++){let l=i[a]/128*n/2;a===0?e.moveTo(0,l):e.lineTo(a*c,l)}e.stroke()}#v(e,t,n,s,i){let c=t/2,a=n/2,d=Math.min(t,n)*.25,l=i.length;e.strokeStyle=s,e.lineWidth=2,e.beginPath();for(let r=0;r<l;r++){let h=r/l*Math.PI*2,M=i[r]/255*(d*.8),b=d+M,p=c+b*Math.cos(h),g=a+b*Math.sin(h);r===0?e.moveTo(p,g):e.lineTo(p,g)}e.closePath(),e.stroke()}#w(){this.#c=new IntersectionObserver(([e])=>{this.#a=e.isIntersecting,this.#a&&this.#r&&!this.#i&&!this.#o&&this.#d()}),this.#c.observe(this)}#M(){window.matchMedia("(prefers-reduced-motion: reduce)").addEventListener("change",e=>{this.#o=e.matches,e.matches?this.#f():this.#r&&this.#a&&this.#d()})}};w("audio-visualizer",y);export{y as AudioVisualizerElement};
19
+ `,this.#s=e.querySelector("canvas")}#u(){let e=this.getAttribute("for");e&&(this.#n=document.getElementById(e),!(!this.#n||this.#n.tagName!=="AUDIO")&&(this.#r||this.#n.addEventListener("play",()=>this.#y(),{once:!0})))}#y(){if(this.#r||(this.#r=!0,this.#t=M(),!this.#t))return;this.#t.state==="suspended"&&this.#t.resume();let e=parseInt(this.getAttribute("data-fft-size")||"256",10);this.#e=this.#t.createAnalyser(),this.#e.fftSize=e,this.#e.smoothingTimeConstant=.8,this.#l=k(this.#n,this.#t),this.#l.connect(this.#e),this.#e.connect(this.#t.destination),this.#d()}#d(){if(this.#o)return;let e=()=>{if(!this.#a||this.#o){this.#i=null;return}this.#i=requestAnimationFrame(e),this.#b()};this.#i=requestAnimationFrame(e)}#f(){this.#i&&(cancelAnimationFrame(this.#i),this.#i=null)}#b(){let e=this.#s,t=e.getContext("2d");if(!t)return;let s=e.width=e.offsetWidth*(window.devicePixelRatio||1),n=e.height=e.offsetHeight*(window.devicePixelRatio||1),i=getComputedStyle(this),c=i.getPropertyValue("--_color").trim()||"oklch(55% 0.2 260)",a=i.getPropertyValue("--_bg").trim();if(t.clearRect(0,0,s,n),a&&a!=="transparent"&&(t.fillStyle=a,t.fillRect(0,0,s,n)),!this.#e)return;let d=this.getAttribute("data-mode")||"bars",l=this.#e.frequencyBinCount,r=new Uint8Array(l);d==="waveform"?(this.#e.getByteTimeDomainData(r),this.#g(t,s,n,c,r)):d==="circle"?(this.#e.getByteFrequencyData(r),this.#v(t,s,n,c,r)):(this.#e.getByteFrequencyData(r),this.#p(t,s,n,c,r))}#p(e,t,s,n,i){let c=Math.min(i.length,64),a=t/c-1;e.fillStyle=n;for(let d=0;d<c;d++){let r=i[d]/255*s,h=d*(t/c);e.fillRect(h,s-r,a,r)}}#g(e,t,s,n,i){let c=t/i.length;e.strokeStyle=n,e.lineWidth=2,e.beginPath();for(let a=0;a<i.length;a++){let l=i[a]/128*s/2;a===0?e.moveTo(0,l):e.lineTo(a*c,l)}e.stroke()}#v(e,t,s,n,i){let c=t/2,a=s/2,d=Math.min(t,s)*.25,l=i.length;e.strokeStyle=n,e.lineWidth=2,e.beginPath();for(let r=0;r<l;r++){let h=r/l*Math.PI*2,E=i[r]/255*(d*.8),b=d+E,p=c+b*Math.cos(h),g=a+b*Math.sin(h);r===0?e.moveTo(p,g):e.lineTo(p,g)}e.closePath(),e.stroke()}#w(){this.#c=new IntersectionObserver(([e])=>{this.#a=e.isIntersecting,this.#a&&this.#r&&!this.#i&&!this.#o&&this.#d()}),this.#c.observe(this)}#E(){window.matchMedia("(prefers-reduced-motion: reduce)").addEventListener("change",e=>{this.#o=e.matches,e.matches?this.#f():this.#r&&this.#a&&this.#d()})}};w("audio-visualizer",y);export{y as AudioVisualizerElement};
20
20
  //# sourceMappingURL=audio-visualizer.js.map
@@ -0,0 +1,3 @@
1
+ var y=window.matchMedia("(prefers-reduced-motion: reduce)");var g=new Map;function b(s,t,e={}){let n=e.priority??10,o={impl:t,bundle:e.bundle,contract:e.contract,priority:n},r=g.get(s);if(customElements.get(s)){if(!r||r.priority>=n){r&&r.priority===n&&r.impl!==t&&console.warn(`[VB Bundle] Tag <${s}> already registered by "${r.bundle}" (priority ${r.priority}). Skipping "${e.bundle}".`);return}console.warn(`[VB Bundle] Tag <${s}> defined by "${r.bundle}" cannot be replaced (customElements.define is permanent). "${e.bundle}" has higher priority but arrived late.`);return}if(r&&r.priority>=n){r.priority===n&&console.warn(`[VB Bundle] Tag <${s}> already registered by "${r.bundle}". Skipping "${e.bundle}" (first wins at equal priority).`);return}g.set(s,o),customElements.define(s,t)}var d=class extends HTMLElement{#e=[];connectedCallback(){this.hasAttribute("data-upgraded")||this.setup()!==!1&&(this.setAttribute("data-upgraded",""),this.dispatchEvent(new CustomEvent(`${this.localName}:upgraded`,{bubbles:!0})))}disconnectedCallback(){for(let t of this.#e)t();this.#e=[],this.removeAttribute("data-upgraded"),this.teardown()}listen(t,e,n,o){t.addEventListener(e,n,o),this.#e.push(()=>t.removeEventListener(e,n,o))}setup(){}teardown(){}};var f=class extends d{setup(){let t=this.getAttribute("data-lens-src")||this.getAttribute("src");t?this.#e(t).catch(()=>{}):this.#t()}async#e(t){let e;try{let o=await fetch(t);if(!o.ok)throw new Error(`status ${o.status}`);e=await o.json()}catch(o){this.#n(`Could not load ${t}: ${o.message}`);return}let n=Array.isArray(e)?e:e.pages||[];this.#r(n),this.#t()}#r(t){let e=new Map;for(let c of t){let a=c.author?.trim()||"Unknown";e.has(a)||e.set(a,[]),e.get(a).push(c)}let n=this.getAttribute("sort")||"alpha",o=[...e.entries()].sort(([c,a],[u,p])=>n==="count"?p.length-a.length:c.localeCompare(u)),r=[`<h2 class="author-index-heading">Authors <small>(${o.length})</small></h2>`];for(let[c,a]of o){let u=a[0],p=c.toLowerCase().replace(/[^a-z0-9]+/g,"-");r.push(`<details data-author-group id="author-${p}">`),r.push(`<summary><span class="author-name">${l(c)}</span><span class="author-count" aria-label="${a.length} ${a.length===1?"page":"pages"}">(${a.length})</span></summary>`),u.authorUrl&&r.push(`<p class="author-link"><a href="${h(u.authorUrl)}" rel="author">View ${l(c)}'s profile</a></p>`),r.push('<ul class="author-pages">');for(let i of a){let m=[i.modified?`<time datetime="${h(i.modified)}">${l(i.modified)}</time>`:"",i.provenance?`<span class="author-prov" data-provenance="${h(i.provenance)}">${l(i.provenance)}</span>`:"",i.signed?'<span class="author-signed" title="Cryptographically signed">signed</span>':""].filter(Boolean).join(" \xB7 ");r.push(`<li><a href="${h(i.url)}">${l(i.title||i.url)}</a>${m?`<small>${m}</small>`:""}</li>`)}r.push("</ul></details>")}this.innerHTML=r.join(`
2
+ `)}#n(t){if(this.children.length>0)return;let e=document.createElement("p");e.setAttribute("data-author-index-error",""),e.textContent=t,this.append(e)}#t(){if(!this.querySelector("[data-author-index-search]")){let t=this.getAttribute("placeholder")||"Filter authors\u2026",e=document.createElement("input");e.type="search",e.placeholder=t,e.setAttribute("data-author-index-search",""),e.setAttribute("aria-label",t),e.addEventListener("input",()=>this.#o(e.value)),this.prepend(e)}}#o(t){let e=t.trim().toLowerCase();for(let n of this.querySelectorAll("[data-author-group]")){let o=n.textContent.toLowerCase();n.hidden=e&&!o.includes(e)}}};function l(s){return String(s??"").replace(/[&<>]/g,t=>({"&":"&amp;","<":"&lt;",">":"&gt;"})[t])}function h(s){return String(s??"").replace(/[&<>"]/g,t=>({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;"})[t])}b("author-index",f);export{f as AuthorIndex};
3
+ //# sourceMappingURL=author-index.js.map
@@ -0,0 +1,2 @@
1
+ var c=class extends HTMLElement{#e=[];connectedCallback(){this.hasAttribute("data-upgraded")||this.setup()!==!1&&(this.setAttribute("data-upgraded",""),this.dispatchEvent(new CustomEvent(`${this.localName}:upgraded`,{bubbles:!0})))}disconnectedCallback(){for(let t of this.#e)t();this.#e=[],this.removeAttribute("data-upgraded"),this.teardown()}listen(t,e,n,s){t.addEventListener(e,n,s),this.#e.push(()=>t.removeEventListener(e,n,s))}setup(){}teardown(){}};var p=window.matchMedia("(prefers-reduced-motion: reduce)");var h=new Map;function f(i,t,e={}){let n=e.priority??10,s={impl:t,bundle:e.bundle,contract:e.contract,priority:n},r=h.get(i);if(customElements.get(i)){if(!r||r.priority>=n){r&&r.priority===n&&r.impl!==t&&console.warn(`[VB Bundle] Tag <${i}> already registered by "${r.bundle}" (priority ${r.priority}). Skipping "${e.bundle}".`);return}console.warn(`[VB Bundle] Tag <${i}> defined by "${r.bundle}" cannot be replaced (customElements.define is permanent). "${e.bundle}" has higher priority but arrived late.`);return}if(r&&r.priority>=n){r.priority===n&&console.warn(`[VB Bundle] Tag <${i}> already registered by "${r.bundle}". Skipping "${e.bundle}" (first wins at equal priority).`);return}h.set(i,s),customElements.define(i,t)}var l=class extends c{static observedAttributes=["src","src-dark","src-compact","alt","wordmark","height"];#e="";#t=null;#r=null;setup(){this.#e=this.#a(),this.hasAttribute("src-dark")&&this.#s(),this.#i()}teardown(){this.#t?.removeEventListener("change",this.#n),this.#t=null,this.#r?.disconnect(),this.#r=null}attributeChangedCallback(t,e,n){e!==n&&(!this.isConnected||!this.hasAttribute("data-upgraded")||(t==="src-dark"&&(n?this.#s():(this.#t?.removeEventListener("change",this.#n),this.#r?.disconnect())),this.#i()))}#o(){let t=document.documentElement.getAttribute("data-mode");return t==="dark"?!0:t==="light"?!1:this.#t?.matches??!1}#s(){this.#t||(this.#t=matchMedia("(prefers-color-scheme: dark)"),this.#t.addEventListener("change",this.#n)),this.#r||(this.#r=new MutationObserver(this.#n),this.#r.observe(document.documentElement,{attributes:!0,attributeFilter:["data-mode"]}))}#n=()=>{this.isConnected&&this.#i()};#i(){let t=this.getAttribute("src"),e=this.getAttribute("src-dark"),n=e&&this.#o()?e:t;if(!n){this.#e&&this.querySelector("img")&&(this.replaceChildren(document.createTextNode(this.#e)),this.removeAttribute("aria-label"));return}let s=this.#e||this.getAttribute("alt")||"",r=this.hasAttribute("wordmark"),u=this.getAttribute("height");if(this.querySelector("img")?.getAttribute("src")===n){let o=this.querySelector(".brand-mark-wordmark");if(r&&!o){let d=document.createElement("span");d.className="brand-mark-wordmark",d.textContent=s,this.appendChild(d)}else!r&&o&&o.remove();return}let a=document.createElement("img");if(a.src=n,a.alt=r?"":s,a.decoding="async",u&&(a.height=parseInt(u,10)),r){let o=document.createElement("span");o.className="brand-mark-wordmark",o.textContent=s,this.replaceChildren(a,o)}else this.replaceChildren(a),this.getAttribute("alt")||this.setAttribute("aria-label",s)}#a(){let t="";for(let e of this.childNodes)(e.nodeType===Node.TEXT_NODE||e.nodeType===Node.ELEMENT_NODE&&e.tagName!=="IMG")&&(t+=e.textContent);return t.trim()}};f("brand-mark",l);
2
+ //# sourceMappingURL=brand-mark.js.map
@@ -1,3 +1,3 @@
1
- var G=window.matchMedia("(prefers-reduced-motion: reduce)");var V=new Map;function z(a,t,e={}){let i=e.priority??10,n={impl:t,bundle:e.bundle,contract:e.contract,priority:i},s=V.get(a);if(customElements.get(a)){if(!s||s.priority>=i){s&&s.priority===i&&s.impl!==t&&console.warn(`[VB Bundle] Tag <${a}> already registered by "${s.bundle}" (priority ${s.priority}). Skipping "${e.bundle}".`);return}console.warn(`[VB Bundle] Tag <${a}> defined by "${s.bundle}" cannot be replaced (customElements.define is permanent). "${e.bundle}" has higher priority but arrived late.`);return}if(s&&s.priority>=i){s.priority===i&&console.warn(`[VB Bundle] Tag <${a}> already registered by "${s.bundle}". Skipping "${e.bundle}" (first wins at equal priority).`);return}V.set(a,n),customElements.define(a,t)}var Y=class extends HTMLElement{#h=[];connectedCallback(){this.hasAttribute("data-upgraded")||this.setup()!==!1&&this.setAttribute("data-upgraded","")}disconnectedCallback(){for(let t of this.#h)t();this.#h=[],this.removeAttribute("data-upgraded"),this.teardown()}listen(t,e,i,n){t.addEventListener(e,i,n),this.#h.push(()=>t.removeEventListener(e,i,n))}setup(){}teardown(){}};function M(a){let t=a.getFullYear(),e=String(a.getMonth()+1).padStart(2,"0"),i=String(a.getDate()).padStart(2,"0");return`${t}-${e}-${i}`}function k(a){if(!a)return null;let[t,e,i]=a.split("-").map(Number);return new Date(t,e-1,i)}function _(a,t){return new Date(a,t+1,0).getDate()}function w(a,t){return a&&t&&a.getFullYear()===t.getFullYear()&&a.getMonth()===t.getMonth()&&a.getDate()===t.getDate()}function J(){try{let a=new Intl.Locale(navigator.language);if(a.weekInfo)return a.weekInfo.firstDay%7}catch{}return 0}function j(a){return a?typeof a=="string"?[{label:a}]:Array.isArray(a)?a:typeof a=="object"?[a]:[]:[]}var O=new Map;function H(a,t="short"){let e=`${a}:${t}`;if(O.has(e))return O.get(e);let i=new Intl.DateTimeFormat(a,{weekday:t}),n=Array.from({length:7},(s,r)=>i.format(new Date(2026,0,4+r)));return O.set(e,n),n}var B=class extends Y{static formAssociated=!0;#h;#b;#e;#t;#x;#S={};#r=null;#o=null;#F=new Set;#M=new Map;#g=null;#l=new Set;#n=null;#a=null;#y=null;#s="none";#I="default";#N=1;#Y=null;get isDateDisallowed(){return this.#Y}set isDateDisallowed(t){this.#Y=t,this.#w&&this.#p()}#L=null;get getDayParts(){return this.#L}set getDayParts(t){this.#L=t,this.#w&&this.#p()}#w=!1;#k;#A;#u;#c;#d;#q;#i;#m;#f;#D=null;constructor(){super(),typeof this.attachInternals=="function"&&(this.#h=this.attachInternals())}setup(){this.#b=this.closest("[lang]")?.lang||navigator.language;let t=new Date;this.#e=parseInt(this.getAttribute("data-month"),10)-1,isNaN(this.#e)&&(this.#e=t.getMonth()),this.#t=parseInt(this.getAttribute("data-year"),10),isNaN(this.#t)&&(this.#t=t.getFullYear()),this.#x=J(),this.#s=this.getAttribute("data-selection")||"none",this.#I=this.getAttribute("data-size")||"default",this.#N=Math.max(1,Math.min(12,parseInt(this.dataset.months,10)||1));let e=this.getAttribute("data-events");if(e)try{this.#S=JSON.parse(e)}catch{}this.#r=k(this.dataset.minDate),this.#o=k(this.dataset.maxDate);let i=this.getAttribute("data-disabled-dates");i&&i.split(",").forEach(s=>this.#F.add(s.trim()));let n=this.getAttribute("data-highlight-dates");n&&n.split(",").forEach(s=>{let[r,c]=s.trim().split(":");this.#M.set(r,c||null)}),this.#P(),this.#p(),this.#w=!0}refresh(){this.#w&&this.#p()}#P(){this.#k=document.createElement("header"),this.#m=document.createElement("button"),this.#m.type="button",this.#m.setAttribute("aria-label","Previous month"),this.#m.textContent="\u2039",this.listen(this.#m,"click",()=>this.#T(-1)),this.#A=document.createElement("span"),this.#A.className="calendar-title",this.#A.setAttribute("aria-live","polite"),this.#u=document.createElement("span"),this.#u.className="calendar-month",this.#c=document.createElement("select"),this.#c.className="calendar-year",this.#c.setAttribute("aria-label","Year"),this.listen(this.#c,"change",()=>{this.#t=parseInt(this.#c.value,10),this.#p(),this.dispatchEvent(new CustomEvent("calendar:navigate",{bubbles:!0,detail:{year:this.#t,month:this.#e+1}}))}),this.#d=document.createElement("span"),this.#d.className="calendar-year-wrap",this.#d.appendChild(this.#c),this.#A.append(this.#u," ",this.#d),this.#f=document.createElement("button"),this.#f.type="button",this.#f.setAttribute("aria-label","Next month"),this.#f.textContent="\u203A",this.listen(this.#f,"click",()=>this.#T(1)),this.#k.append(this.#m,this.#A,this.#f),this.appendChild(this.#k);let t=document.createElement("div");t.className="calendar-banner",t.setAttribute("aria-hidden","true"),this.appendChild(t),this.#i=document.createElement("div"),this.#i.className="cal-months",this.appendChild(this.#i),this.listen(this.#i,"click",e=>{let i=e.target.closest("button[data-date]");if(!i||i.disabled)return;let n=i.getAttribute("data-date");if(this.#s!=="none")this.#O(n);else{let s=j(this.#S[n]);s.length&&this.#z(n,s)}}),this.listen(this.#i,"keydown",e=>this.#_(e)),this.#s==="range"&&this.listen(this.#i,"mouseover",e=>{let i=e.target.closest("button[data-date]");i&&this.#n&&!this.#a&&(this.#y=k(i.getAttribute("data-date")),this.#C())})}#V(){this.#c.innerHTML="";let t=new Date().getFullYear(),e=this.#r?this.#r.getFullYear():t-10,i=this.#o?this.#o.getFullYear():t+10;for(let n=e;n<=i;n++){let s=document.createElement("option");s.value=n,s.textContent=n,n===this.#t&&(s.selected=!0),this.#c.appendChild(s)}}#T(t){this.#e+=t,this.#e<0&&(this.#e=11,this.#t--),this.#e>11&&(this.#e=0,this.#t++),this.#p(),this.dispatchEvent(new CustomEvent("calendar:navigate",{bubbles:!0,detail:{year:this.#t,month:this.#e+1}}))}#O(t){if(this.#s==="none")return;let e=k(t);if(this.#s==="single")this.#g=e,this.#C(),this.#$(),this.dispatchEvent(new CustomEvent("calendar:select",{bubbles:!0,detail:{value:t,date:e}}));else if(this.#s==="range"){if(!this.#n||this.#a)this.#n=e,this.#a=null,this.#y=null,this.dataset.tentative=M(this.#n);else{this.#a=e,this.#n>this.#a&&([this.#n,this.#a]=[this.#a,this.#n]),this.#y=null,delete this.dataset.tentative;let i=M(this.#n),n=M(this.#a);this.dispatchEvent(new CustomEvent("calendar:select",{bubbles:!0,detail:{value:`${i}/${n}`,start:i,end:n,startDate:this.#n,endDate:this.#a}}))}this.#C(),this.#$()}else if(this.#s==="multi"){this.#l.has(t)?this.#l.delete(t):this.#l.add(t),this.#C(),this.#$();let i=[...this.#l].sort();this.dispatchEvent(new CustomEvent("calendar:select",{bubbles:!0,detail:{values:i,dates:i.map(k)}}))}}#$(){this.#h&&this.getAttribute("name")&&this.#h.setFormValue(this.value)}get value(){switch(this.#s){case"single":return this.#g?M(this.#g):null;case"range":return this.#n&&this.#a?`${M(this.#n)}/${M(this.#a)}`:this.#n?M(this.#n):null;case"multi":return this.#l.size?[...this.#l].sort().join(" "):null;default:return null}}#C(){if(!this.#i)return;let t=this.#n,e=this.#a||this.#y;for(let i of this.#i.querySelectorAll("td")){let n=i.querySelector("button[data-date]");if(!n)continue;let s=n.getAttribute("data-date"),r=k(s);if(i.removeAttribute("data-selected"),i.removeAttribute("data-range-start"),i.removeAttribute("data-range-end"),i.removeAttribute("data-in-range"),n.removeAttribute("aria-selected"),this.#s==="single"&&w(r,this.#g)&&(i.setAttribute("data-selected",""),n.setAttribute("aria-selected","true")),this.#s==="multi"&&this.#l.has(s)&&(i.setAttribute("data-selected",""),n.setAttribute("aria-selected","true")),this.#s==="range"&&t)if(e){let c=t<e?t:e,b=t<e?e:t;w(r,c)&&i.setAttribute("data-range-start",""),w(r,b)&&i.setAttribute("data-range-end",""),r>=c&&r<=b&&i.setAttribute("data-in-range","")}else w(r,t)&&i.setAttribute("data-range-start","")}}#v(t){let e=new Date(this.#t,this.#e+t,1);return{year:e.getFullYear(),month:e.getMonth()}}#p(){let t=this.#N,e=new Intl.DateTimeFormat(this.#b,{month:"long"}),i=new Intl.DateTimeFormat(this.#b,{month:"long",year:"numeric"});try{let s=new Date(this.#t,this.#e,1);if(t===1)this.#u.textContent=e.format(s),this.#d&&(this.#d.style.display="");else{let r=this.#v(t-1);s.getFullYear()===r.year?this.#u.textContent=String(this.#t):this.#u.textContent=`${s.getFullYear()} \u2013 ${r.year}`,this.#d&&(this.#d.style.display="none")}}catch{this.#u.textContent=String(this.#e+1)}this.#V(),this.#m.disabled=!!(this.#r&&(this.#t<this.#r.getFullYear()||this.#t===this.#r.getFullYear()&&this.#e<=this.#r.getMonth()));let n=this.#v(t-1);this.#f.disabled=!!(this.#o&&(n.year>this.#o.getFullYear()||n.year===this.#o.getFullYear()&&n.month>=this.#o.getMonth())),this.setAttribute("data-month",String(this.#e+1)),this.setAttribute("data-year",String(this.#t)),this.#i.innerHTML="";for(let s=0;s<t;s++){let{year:r,month:c}=this.#v(s);if(t>1){let b=document.createElement("div");b.className="cal-month-column";let D=document.createElement("h4");D.className="cal-month-title",D.textContent=i.format(new Date(r,c,1)),b.appendChild(D);let N=this.#B(r,c);b.appendChild(N),this.#i.appendChild(b)}else{let b=this.#B(r,c);this.#i.appendChild(b)}}this.#q=this.#i.querySelector("table")}#B(t,e){let i=new Date,n=_(t,e),s=this.#I==="large",r=document.createElement("table");r.setAttribute("role","grid");try{let u=new Date(t,e,1),o=new Intl.DateTimeFormat(void 0,{month:"long"}).format(u);r.setAttribute("aria-label",`${o} ${t}`)}catch{}let c=document.createElement("thead"),b=document.createElement("tr"),D=H(this.#b,"short"),N=H(this.#b,"long");for(let u=0;u<7;u++){let o=(this.#x+u)%7,m=document.createElement("th");m.setAttribute("scope","col"),m.setAttribute("abbr",N[o]),m.textContent=D[o],b.appendChild(m)}c.appendChild(b),r.appendChild(c);let d=document.createElement("tbody"),A=1,h=document.createElement("tr");h.setAttribute("data-week",String(A));let f=(new Date(t,e,1).getDay()-this.#x+7)%7,$=_(t,e-1);for(let u=0;u<f;u++){let o=$-f+1+u,m=document.createElement("td");m.setAttribute("data-outside-month","");let l=document.createElement("button");l.type="button",l.disabled=!0,l.setAttribute("tabindex","-1"),l.setAttribute("data-day",String(o));let p=document.createElement("span");p.className="day-number",p.textContent=String(o),l.appendChild(p),m.appendChild(l),h.appendChild(m)}let E=this.#n,F=this.#a||this.#y;for(let u=1;u<=n;u++){let o=new Date(t,e,u),m=M(o),l=document.createElement("td"),p=document.createElement("button");p.type="button",p.setAttribute("data-date",m);let L=document.createElement("span");if(L.className="day-number",L.textContent=String(u),p.appendChild(L),p.setAttribute("data-day",String(u)),w(o,i)&&(p.setAttribute("aria-current","date"),l.setAttribute("data-today","")),this.#s==="single"&&w(o,this.#g)&&(p.setAttribute("aria-selected","true"),l.setAttribute("data-selected","")),this.#s==="multi"&&this.#l.has(m)&&(p.setAttribute("aria-selected","true"),l.setAttribute("data-selected","")),this.#s==="range"&&E&&F){let x=E<F?E:F,g=E<F?F:E;w(o,x)&&l.setAttribute("data-range-start",""),w(o,g)&&l.setAttribute("data-range-end",""),o>=x&&o<=g&&l.setAttribute("data-in-range","")}else this.#s==="range"&&E&&w(o,E)&&l.setAttribute("data-range-start","");let W=this.#r&&o<this.#r,K=this.#o&&o>this.#o,R=typeof this.isDateDisallowed=="function"&&this.isDateDisallowed(o);if((this.#F.has(m)||W||K||R)&&(p.setAttribute("aria-disabled","true"),p.disabled=!0),this.#M.has(m)&&p.setAttribute("data-highlight",this.#M.get(m)||""),typeof this.getDayParts=="function"){let x=this.getDayParts(o);x!=null&&(l.dataset.dayPart=Array.isArray(x)?x.join(" "):x)}let v=j(this.#S[m]);if(v.length){if(l.setAttribute("data-events",""),l.setAttribute("data-event-count",String(v.length)),s){let g=document.createElement("span");g.className="event-list";let I=2;if(v.slice(0,I).forEach(y=>{let S=document.createElement("span");if(S.className="event-item",y.color&&S.style.setProperty("--event-color",y.color),y.icon){let T=document.createElement("icon-wc");T.setAttribute("name",y.icon),T.setAttribute("size","xs"),S.appendChild(T)}let P=document.createElement("span");P.textContent=y.time?`${y.time} ${y.label}`:y.label,S.appendChild(P),g.appendChild(S)}),v.length>I){let y=document.createElement("span");y.className="event-more",y.textContent=`+${v.length-I} more`,g.appendChild(y)}p.appendChild(g)}else{let g=document.createElement("span");g.className="event-dots",g.setAttribute("aria-hidden","true");let I=Math.min(v.length,3);for(let y=0;y<I;y++){let S=document.createElement("span");S.setAttribute("data-event-dot",""),v[y].color&&S.style.setProperty("--event-color",v[y].color),g.appendChild(S)}l.appendChild(g)}let x=v.map(g=>g.time?`${g.time} \u2014 ${g.label}`:g.label);p.setAttribute("title",x.join(`
2
- `))}let U=u===1||w(o,i);p.setAttribute("tabindex",U?"0":"-1"),l.insertBefore(p,l.firstChild),h.appendChild(l),(f+u)%7===0&&(d.appendChild(h),A++,h=document.createElement("tr"),h.setAttribute("data-week",String(A)))}let q=(f+n)%7;if(q>0){for(let u=1;u<=7-q;u++){let o=document.createElement("td");o.setAttribute("data-outside-month","");let m=document.createElement("button");m.type="button",m.disabled=!0,m.setAttribute("tabindex","-1"),m.setAttribute("data-day",String(u));let l=document.createElement("span");l.className="day-number",l.textContent=String(u),m.appendChild(l),o.appendChild(m),h.appendChild(o)}d.appendChild(h)}return r.appendChild(d),r}#z(t,e){this.#E();let i=k(t),n=document.createElement("div");n.className="day-detail",n.setAttribute("role","dialog"),n.setAttribute("aria-label",`Events for ${t}`);let s=document.createElement("header"),r=document.createElement("h3");try{r.textContent=new Intl.DateTimeFormat(void 0,{weekday:"long",month:"long",day:"numeric",year:"numeric"}).format(i)}catch{r.textContent=t}let c=document.createElement("button");if(c.type="button",c.setAttribute("aria-label","Close"),c.textContent="\xD7",c.addEventListener("click",()=>this.#E()),s.append(r,c),n.appendChild(s),e.some(d=>d.time)){let d=document.createElement("day-view");d.dataset.date=t,d.dataset.startHour="auto",d.dataset.compact="";let A=new Intl.DateTimeFormat(this.#b,{hour:"numeric",minute:"2-digit"});e.forEach(h=>{let C=document.createElement("calendar-event");if(h.color&&C.style.setProperty("--event-color",h.color),h.icon){let f=document.createElement("icon-wc");f.setAttribute("name",h.icon),f.setAttribute("size","sm"),C.appendChild(f)}if(h.time){let f=document.createElement("time");f.setAttribute("datetime",h.time);try{let[$,E]=h.time.split(":"),F=new Date(2026,0,1,parseInt($,10),parseInt(E,10));f.textContent=A.format(F)}catch{f.textContent=h.time}C.appendChild(f)}C.append(h.label||""),d.appendChild(C)}),n.appendChild(d)}else{let d=document.createElement("ul");d.className="detail-list",e.forEach(A=>{let h=document.createElement("li");A.color&&h.style.setProperty("--event-color",A.color);let C=document.createElement("span");C.className="detail-dot";let f=document.createElement("span");if(f.className="detail-content",A.icon){let E=document.createElement("icon-wc");E.setAttribute("name",A.icon),E.setAttribute("size","sm"),f.appendChild(E)}let $=document.createElement("span");$.className="detail-label",$.textContent=A.label||"",f.append($),h.append(C,f),d.appendChild(h)}),n.appendChild(d)}this.appendChild(n),this.#D=n;let D=d=>{d.key==="Escape"&&this.#E()},N=d=>{n.contains(d.target)||this.#E()};this._detailCleanup=()=>{document.removeEventListener("keydown",D),document.removeEventListener("mousedown",N)},document.addEventListener("keydown",D),requestAnimationFrame(()=>{document.addEventListener("mousedown",N)}),this.dispatchEvent(new CustomEvent("calendar:day-open",{bubbles:!0,detail:{date:t,events:e}}))}#E(){this.#D&&(this._detailCleanup?.(),this._detailCleanup=null,this.#D.remove(),this.#D=null)}teardown(){delete this.dataset.tentative,this.#E()}#_(t){let e=this.#i.querySelector('button[tabindex="0"]');if(!e)return;let i=e.getAttribute("data-date"),n=k(i);if(!n)return;let s;switch(t.key){case"ArrowRight":s=new Date(n),s.setDate(n.getDate()+1);break;case"ArrowLeft":s=new Date(n),s.setDate(n.getDate()-1);break;case"ArrowDown":s=new Date(n),s.setDate(n.getDate()+7);break;case"ArrowUp":s=new Date(n),s.setDate(n.getDate()-7);break;case"Enter":case" ":t.preventDefault(),e.disabled||this.#O(i);return;default:return}if(t.preventDefault(),this.#r&&s<this.#r||this.#o&&s>this.#o)return;let r=s.getMonth(),c=s.getFullYear(),b=this.#v(this.#N-1);(c>this.#t||c===this.#t&&r>=this.#e)&&(c<b.year||c===b.year&&r<=b.month)||(this.#e=r,this.#t=c,this.#p());let N=M(s),d=this.#i.querySelector(`button[data-date="${N}"]`);d&&(this.#i.querySelectorAll('button[tabindex="0"]').forEach(A=>A.setAttribute("tabindex","-1")),d.setAttribute("tabindex","0"),d.focus())}};z("calendar-wc",B);export{B as CalendarWc};
1
+ var G=window.matchMedia("(prefers-reduced-motion: reduce)");var V=new Map;function z(a,t,e={}){let i=e.priority??10,n={impl:t,bundle:e.bundle,contract:e.contract,priority:i},s=V.get(a);if(customElements.get(a)){if(!s||s.priority>=i){s&&s.priority===i&&s.impl!==t&&console.warn(`[VB Bundle] Tag <${a}> already registered by "${s.bundle}" (priority ${s.priority}). Skipping "${e.bundle}".`);return}console.warn(`[VB Bundle] Tag <${a}> defined by "${s.bundle}" cannot be replaced (customElements.define is permanent). "${e.bundle}" has higher priority but arrived late.`);return}if(s&&s.priority>=i){s.priority===i&&console.warn(`[VB Bundle] Tag <${a}> already registered by "${s.bundle}". Skipping "${e.bundle}" (first wins at equal priority).`);return}V.set(a,n),customElements.define(a,t)}var Y=class extends HTMLElement{#h=[];connectedCallback(){this.hasAttribute("data-upgraded")||this.setup()!==!1&&(this.setAttribute("data-upgraded",""),this.dispatchEvent(new CustomEvent(`${this.localName}:upgraded`,{bubbles:!0})))}disconnectedCallback(){for(let t of this.#h)t();this.#h=[],this.removeAttribute("data-upgraded"),this.teardown()}listen(t,e,i,n){t.addEventListener(e,i,n),this.#h.push(()=>t.removeEventListener(e,i,n))}setup(){}teardown(){}};function M(a){let t=a.getFullYear(),e=String(a.getMonth()+1).padStart(2,"0"),i=String(a.getDate()).padStart(2,"0");return`${t}-${e}-${i}`}function $(a){if(!a)return null;let[t,e,i]=a.split("-").map(Number);return new Date(t,e-1,i)}function _(a,t){return new Date(a,t+1,0).getDate()}function w(a,t){return a&&t&&a.getFullYear()===t.getFullYear()&&a.getMonth()===t.getMonth()&&a.getDate()===t.getDate()}function J(){try{let a=new Intl.Locale(navigator.language);if(a.weekInfo)return a.weekInfo.firstDay%7}catch{}return 0}function j(a){return a?typeof a=="string"?[{label:a}]:Array.isArray(a)?a:typeof a=="object"?[a]:[]:[]}var O=new Map;function H(a,t="short"){let e=`${a}:${t}`;if(O.has(e))return O.get(e);let i=new Intl.DateTimeFormat(a,{weekday:t}),n=Array.from({length:7},(s,r)=>i.format(new Date(2026,0,4+r)));return O.set(e,n),n}var B=class extends Y{static formAssociated=!0;#h;#b;#e;#t;#x;#S={};#r=null;#o=null;#F=new Set;#M=new Map;#g=null;#l=new Set;#n=null;#a=null;#y=null;#s="none";#I="default";#N=1;#Y=null;get isDateDisallowed(){return this.#Y}set isDateDisallowed(t){this.#Y=t,this.#w&&this.#p()}#L=null;get getDayParts(){return this.#L}set getDayParts(t){this.#L=t,this.#w&&this.#p()}#w=!1;#$;#E;#u;#c;#d;#q;#i;#m;#f;#D=null;constructor(){super(),typeof this.attachInternals=="function"&&(this.#h=this.attachInternals())}setup(){this.#b=this.closest("[lang]")?.lang||navigator.language;let t=new Date;this.#e=parseInt(this.getAttribute("data-month"),10)-1,isNaN(this.#e)&&(this.#e=t.getMonth()),this.#t=parseInt(this.getAttribute("data-year"),10),isNaN(this.#t)&&(this.#t=t.getFullYear()),this.#x=J(),this.#s=this.getAttribute("data-selection")||"none",this.#I=this.getAttribute("data-size")||"default",this.#N=Math.max(1,Math.min(12,parseInt(this.dataset.months,10)||1));let e=this.getAttribute("data-events");if(e)try{this.#S=JSON.parse(e)}catch{}this.#r=$(this.dataset.minDate),this.#o=$(this.dataset.maxDate);let i=this.getAttribute("data-disabled-dates");i&&i.split(",").forEach(s=>this.#F.add(s.trim()));let n=this.getAttribute("data-highlight-dates");n&&n.split(",").forEach(s=>{let[r,c]=s.trim().split(":");this.#M.set(r,c||null)}),this.#P(),this.#p(),this.#w=!0}refresh(){this.#w&&this.#p()}#P(){this.#$=document.createElement("header"),this.#m=document.createElement("button"),this.#m.type="button",this.#m.setAttribute("aria-label","Previous month"),this.#m.textContent="\u2039",this.listen(this.#m,"click",()=>this.#T(-1)),this.#E=document.createElement("span"),this.#E.className="calendar-title",this.#E.setAttribute("aria-live","polite"),this.#u=document.createElement("span"),this.#u.className="calendar-month",this.#c=document.createElement("select"),this.#c.className="calendar-year",this.#c.setAttribute("aria-label","Year"),this.listen(this.#c,"change",()=>{this.#t=parseInt(this.#c.value,10),this.#p(),this.dispatchEvent(new CustomEvent("calendar:navigate",{bubbles:!0,detail:{year:this.#t,month:this.#e+1}}))}),this.#d=document.createElement("span"),this.#d.className="calendar-year-wrap",this.#d.appendChild(this.#c),this.#E.append(this.#u," ",this.#d),this.#f=document.createElement("button"),this.#f.type="button",this.#f.setAttribute("aria-label","Next month"),this.#f.textContent="\u203A",this.listen(this.#f,"click",()=>this.#T(1)),this.#$.append(this.#m,this.#E,this.#f),this.appendChild(this.#$);let t=document.createElement("div");t.className="calendar-banner",t.setAttribute("aria-hidden","true"),this.appendChild(t),this.#i=document.createElement("div"),this.#i.className="cal-months",this.appendChild(this.#i),this.listen(this.#i,"click",e=>{let i=e.target.closest("button[data-date]");if(!i||i.disabled)return;let n=i.getAttribute("data-date");if(this.#s!=="none")this.#O(n);else{let s=j(this.#S[n]);s.length&&this.#z(n,s)}}),this.listen(this.#i,"keydown",e=>this.#_(e)),this.#s==="range"&&this.listen(this.#i,"mouseover",e=>{let i=e.target.closest("button[data-date]");i&&this.#n&&!this.#a&&(this.#y=$(i.getAttribute("data-date")),this.#C())})}#V(){this.#c.innerHTML="";let t=new Date().getFullYear(),e=this.#r?this.#r.getFullYear():t-10,i=this.#o?this.#o.getFullYear():t+10;for(let n=e;n<=i;n++){let s=document.createElement("option");s.value=n,s.textContent=n,n===this.#t&&(s.selected=!0),this.#c.appendChild(s)}}#T(t){this.#e+=t,this.#e<0&&(this.#e=11,this.#t--),this.#e>11&&(this.#e=0,this.#t++),this.#p(),this.dispatchEvent(new CustomEvent("calendar:navigate",{bubbles:!0,detail:{year:this.#t,month:this.#e+1}}))}#O(t){if(this.#s==="none")return;let e=$(t);if(this.#s==="single")this.#g=e,this.#C(),this.#k(),this.dispatchEvent(new CustomEvent("calendar:select",{bubbles:!0,detail:{value:t,date:e}}));else if(this.#s==="range"){if(!this.#n||this.#a)this.#n=e,this.#a=null,this.#y=null,this.dataset.tentative=M(this.#n);else{this.#a=e,this.#n>this.#a&&([this.#n,this.#a]=[this.#a,this.#n]),this.#y=null,delete this.dataset.tentative;let i=M(this.#n),n=M(this.#a);this.dispatchEvent(new CustomEvent("calendar:select",{bubbles:!0,detail:{value:`${i}/${n}`,start:i,end:n,startDate:this.#n,endDate:this.#a}}))}this.#C(),this.#k()}else if(this.#s==="multi"){this.#l.has(t)?this.#l.delete(t):this.#l.add(t),this.#C(),this.#k();let i=[...this.#l].sort();this.dispatchEvent(new CustomEvent("calendar:select",{bubbles:!0,detail:{values:i,dates:i.map($)}}))}}#k(){this.#h&&this.getAttribute("name")&&this.#h.setFormValue(this.value)}get value(){switch(this.#s){case"single":return this.#g?M(this.#g):null;case"range":return this.#n&&this.#a?`${M(this.#n)}/${M(this.#a)}`:this.#n?M(this.#n):null;case"multi":return this.#l.size?[...this.#l].sort().join(" "):null;default:return null}}#C(){if(!this.#i)return;let t=this.#n,e=this.#a||this.#y;for(let i of this.#i.querySelectorAll("td")){let n=i.querySelector("button[data-date]");if(!n)continue;let s=n.getAttribute("data-date"),r=$(s);if(i.removeAttribute("data-selected"),i.removeAttribute("data-range-start"),i.removeAttribute("data-range-end"),i.removeAttribute("data-in-range"),n.removeAttribute("aria-selected"),this.#s==="single"&&w(r,this.#g)&&(i.setAttribute("data-selected",""),n.setAttribute("aria-selected","true")),this.#s==="multi"&&this.#l.has(s)&&(i.setAttribute("data-selected",""),n.setAttribute("aria-selected","true")),this.#s==="range"&&t)if(e){let c=t<e?t:e,b=t<e?e:t;w(r,c)&&i.setAttribute("data-range-start",""),w(r,b)&&i.setAttribute("data-range-end",""),r>=c&&r<=b&&i.setAttribute("data-in-range","")}else w(r,t)&&i.setAttribute("data-range-start","")}}#v(t){let e=new Date(this.#t,this.#e+t,1);return{year:e.getFullYear(),month:e.getMonth()}}#p(){let t=this.#N,e=new Intl.DateTimeFormat(this.#b,{month:"long"}),i=new Intl.DateTimeFormat(this.#b,{month:"long",year:"numeric"});try{let s=new Date(this.#t,this.#e,1);if(t===1)this.#u.textContent=e.format(s),this.#d&&(this.#d.style.display="");else{let r=this.#v(t-1);s.getFullYear()===r.year?this.#u.textContent=String(this.#t):this.#u.textContent=`${s.getFullYear()} \u2013 ${r.year}`,this.#d&&(this.#d.style.display="none")}}catch{this.#u.textContent=String(this.#e+1)}this.#V(),this.#m.disabled=!!(this.#r&&(this.#t<this.#r.getFullYear()||this.#t===this.#r.getFullYear()&&this.#e<=this.#r.getMonth()));let n=this.#v(t-1);this.#f.disabled=!!(this.#o&&(n.year>this.#o.getFullYear()||n.year===this.#o.getFullYear()&&n.month>=this.#o.getMonth())),this.setAttribute("data-month",String(this.#e+1)),this.setAttribute("data-year",String(this.#t)),this.#i.innerHTML="";for(let s=0;s<t;s++){let{year:r,month:c}=this.#v(s);if(t>1){let b=document.createElement("div");b.className="cal-month-column";let D=document.createElement("h4");D.className="cal-month-title",D.textContent=i.format(new Date(r,c,1)),b.appendChild(D);let N=this.#B(r,c);b.appendChild(N),this.#i.appendChild(b)}else{let b=this.#B(r,c);this.#i.appendChild(b)}}this.#q=this.#i.querySelector("table")}#B(t,e){let i=new Date,n=_(t,e),s=this.#I==="large",r=document.createElement("table");r.setAttribute("role","grid");try{let u=new Date(t,e,1),o=new Intl.DateTimeFormat(void 0,{month:"long"}).format(u);r.setAttribute("aria-label",`${o} ${t}`)}catch{}let c=document.createElement("thead"),b=document.createElement("tr"),D=H(this.#b,"short"),N=H(this.#b,"long");for(let u=0;u<7;u++){let o=(this.#x+u)%7,m=document.createElement("th");m.setAttribute("scope","col"),m.setAttribute("abbr",N[o]),m.textContent=D[o],b.appendChild(m)}c.appendChild(b),r.appendChild(c);let d=document.createElement("tbody"),E=1,h=document.createElement("tr");h.setAttribute("data-week",String(E));let f=(new Date(t,e,1).getDay()-this.#x+7)%7,k=_(t,e-1);for(let u=0;u<f;u++){let o=k-f+1+u,m=document.createElement("td");m.setAttribute("data-outside-month","");let l=document.createElement("button");l.type="button",l.disabled=!0,l.setAttribute("tabindex","-1"),l.setAttribute("data-day",String(o));let p=document.createElement("span");p.className="day-number",p.textContent=String(o),l.appendChild(p),m.appendChild(l),h.appendChild(m)}let A=this.#n,F=this.#a||this.#y;for(let u=1;u<=n;u++){let o=new Date(t,e,u),m=M(o),l=document.createElement("td"),p=document.createElement("button");p.type="button",p.setAttribute("data-date",m);let L=document.createElement("span");if(L.className="day-number",L.textContent=String(u),p.appendChild(L),p.setAttribute("data-day",String(u)),w(o,i)&&(p.setAttribute("aria-current","date"),l.setAttribute("data-today","")),this.#s==="single"&&w(o,this.#g)&&(p.setAttribute("aria-selected","true"),l.setAttribute("data-selected","")),this.#s==="multi"&&this.#l.has(m)&&(p.setAttribute("aria-selected","true"),l.setAttribute("data-selected","")),this.#s==="range"&&A&&F){let x=A<F?A:F,g=A<F?F:A;w(o,x)&&l.setAttribute("data-range-start",""),w(o,g)&&l.setAttribute("data-range-end",""),o>=x&&o<=g&&l.setAttribute("data-in-range","")}else this.#s==="range"&&A&&w(o,A)&&l.setAttribute("data-range-start","");let W=this.#r&&o<this.#r,K=this.#o&&o>this.#o,R=typeof this.isDateDisallowed=="function"&&this.isDateDisallowed(o);if((this.#F.has(m)||W||K||R)&&(p.setAttribute("aria-disabled","true"),p.disabled=!0),this.#M.has(m)&&p.setAttribute("data-highlight",this.#M.get(m)||""),typeof this.getDayParts=="function"){let x=this.getDayParts(o);x!=null&&(l.dataset.dayPart=Array.isArray(x)?x.join(" "):x)}let v=j(this.#S[m]);if(v.length){if(l.setAttribute("data-events",""),l.setAttribute("data-event-count",String(v.length)),s){let g=document.createElement("span");g.className="event-list";let I=2;if(v.slice(0,I).forEach(y=>{let S=document.createElement("span");if(S.className="event-item",y.color&&S.style.setProperty("--event-color",y.color),y.icon){let T=document.createElement("icon-wc");T.setAttribute("name",y.icon),T.setAttribute("size","xs"),S.appendChild(T)}let P=document.createElement("span");P.textContent=y.time?`${y.time} ${y.label}`:y.label,S.appendChild(P),g.appendChild(S)}),v.length>I){let y=document.createElement("span");y.className="event-more",y.textContent=`+${v.length-I} more`,g.appendChild(y)}p.appendChild(g)}else{let g=document.createElement("span");g.className="event-dots",g.setAttribute("aria-hidden","true");let I=Math.min(v.length,3);for(let y=0;y<I;y++){let S=document.createElement("span");S.setAttribute("data-event-dot",""),v[y].color&&S.style.setProperty("--event-color",v[y].color),g.appendChild(S)}l.appendChild(g)}let x=v.map(g=>g.time?`${g.time} \u2014 ${g.label}`:g.label);p.setAttribute("title",x.join(`
2
+ `))}let U=u===1||w(o,i);p.setAttribute("tabindex",U?"0":"-1"),l.insertBefore(p,l.firstChild),h.appendChild(l),(f+u)%7===0&&(d.appendChild(h),E++,h=document.createElement("tr"),h.setAttribute("data-week",String(E)))}let q=(f+n)%7;if(q>0){for(let u=1;u<=7-q;u++){let o=document.createElement("td");o.setAttribute("data-outside-month","");let m=document.createElement("button");m.type="button",m.disabled=!0,m.setAttribute("tabindex","-1"),m.setAttribute("data-day",String(u));let l=document.createElement("span");l.className="day-number",l.textContent=String(u),m.appendChild(l),o.appendChild(m),h.appendChild(o)}d.appendChild(h)}return r.appendChild(d),r}#z(t,e){this.#A();let i=$(t),n=document.createElement("div");n.className="day-detail",n.setAttribute("role","dialog"),n.setAttribute("aria-label",`Events for ${t}`);let s=document.createElement("header"),r=document.createElement("h3");try{r.textContent=new Intl.DateTimeFormat(void 0,{weekday:"long",month:"long",day:"numeric",year:"numeric"}).format(i)}catch{r.textContent=t}let c=document.createElement("button");if(c.type="button",c.setAttribute("aria-label","Close"),c.textContent="\xD7",c.addEventListener("click",()=>this.#A()),s.append(r,c),n.appendChild(s),e.some(d=>d.time)){let d=document.createElement("day-view");d.dataset.date=t,d.dataset.startHour="auto",d.dataset.compact="";let E=new Intl.DateTimeFormat(this.#b,{hour:"numeric",minute:"2-digit"});e.forEach(h=>{let C=document.createElement("calendar-event");if(h.color&&C.style.setProperty("--event-color",h.color),h.icon){let f=document.createElement("icon-wc");f.setAttribute("name",h.icon),f.setAttribute("size","sm"),C.appendChild(f)}if(h.time){let f=document.createElement("time");f.setAttribute("datetime",h.time);try{let[k,A]=h.time.split(":"),F=new Date(2026,0,1,parseInt(k,10),parseInt(A,10));f.textContent=E.format(F)}catch{f.textContent=h.time}C.appendChild(f)}C.append(h.label||""),d.appendChild(C)}),n.appendChild(d)}else{let d=document.createElement("ul");d.className="detail-list",e.forEach(E=>{let h=document.createElement("li");E.color&&h.style.setProperty("--event-color",E.color);let C=document.createElement("span");C.className="detail-dot";let f=document.createElement("span");if(f.className="detail-content",E.icon){let A=document.createElement("icon-wc");A.setAttribute("name",E.icon),A.setAttribute("size","sm"),f.appendChild(A)}let k=document.createElement("span");k.className="detail-label",k.textContent=E.label||"",f.append(k),h.append(C,f),d.appendChild(h)}),n.appendChild(d)}this.appendChild(n),this.#D=n;let D=d=>{d.key==="Escape"&&this.#A()},N=d=>{n.contains(d.target)||this.#A()};this._detailCleanup=()=>{document.removeEventListener("keydown",D),document.removeEventListener("mousedown",N)},document.addEventListener("keydown",D),requestAnimationFrame(()=>{document.addEventListener("mousedown",N)}),this.dispatchEvent(new CustomEvent("calendar:day-open",{bubbles:!0,detail:{date:t,events:e}}))}#A(){this.#D&&(this._detailCleanup?.(),this._detailCleanup=null,this.#D.remove(),this.#D=null)}teardown(){delete this.dataset.tentative,this.#A()}#_(t){let e=this.#i.querySelector('button[tabindex="0"]');if(!e)return;let i=e.getAttribute("data-date"),n=$(i);if(!n)return;let s;switch(t.key){case"ArrowRight":s=new Date(n),s.setDate(n.getDate()+1);break;case"ArrowLeft":s=new Date(n),s.setDate(n.getDate()-1);break;case"ArrowDown":s=new Date(n),s.setDate(n.getDate()+7);break;case"ArrowUp":s=new Date(n),s.setDate(n.getDate()-7);break;case"Enter":case" ":t.preventDefault(),e.disabled||this.#O(i);return;default:return}if(t.preventDefault(),this.#r&&s<this.#r||this.#o&&s>this.#o)return;let r=s.getMonth(),c=s.getFullYear(),b=this.#v(this.#N-1);(c>this.#t||c===this.#t&&r>=this.#e)&&(c<b.year||c===b.year&&r<=b.month)||(this.#e=r,this.#t=c,this.#p());let N=M(s),d=this.#i.querySelector(`button[data-date="${N}"]`);d&&(this.#i.querySelectorAll('button[tabindex="0"]').forEach(E=>E.setAttribute("tabindex","-1")),d.setAttribute("tabindex","0"),d.focus())}};z("calendar-wc",B);export{B as CalendarWc};
3
3
  //# sourceMappingURL=calendar-wc.js.map
@@ -1,2 +1,2 @@
1
- function l(o){if(!o||typeof o!="string")return"";let e=document.createElement("template");return e.innerHTML=o,e.content.querySelectorAll("script, iframe, object, embed, form, base, link, meta, noscript").forEach(n=>n.remove()),e.content.querySelectorAll("*").forEach(n=>{for(let i of[...n.attributes]){if(i.name.startsWith("on")){n.removeAttribute(i.name);continue}if(["href","src","action","formaction","xlink:href"].includes(i.name)){let a=i.value.trim().toLowerCase();(a.startsWith("javascript:")||a.startsWith("data:text/html"))&&n.removeAttribute(i.name);continue}(i.name==="srcdoc"||i.name==="data"&&n.tagName==="OBJECT")&&n.removeAttribute(i.name)}}),e.innerHTML}var A=window.matchMedia("(prefers-reduced-motion: reduce)");var f=new Map;function h(o,e,r={}){let t=r.priority??10,n={impl:e,bundle:r.bundle,contract:r.contract,priority:t},i=f.get(o);if(customElements.get(o)){if(!i||i.priority>=t){i&&i.priority===t&&i.impl!==e&&console.warn(`[VB Bundle] Tag <${o}> already registered by "${i.bundle}" (priority ${i.priority}). Skipping "${r.bundle}".`);return}console.warn(`[VB Bundle] Tag <${o}> defined by "${i.bundle}" cannot be replaced (customElements.define is permanent). "${r.bundle}" has higher priority but arrived late.`);return}if(i&&i.priority>=t){i.priority===t&&console.warn(`[VB Bundle] Tag <${o}> already registered by "${i.bundle}". Skipping "${r.bundle}" (first wins at equal priority).`);return}f.set(o,n),customElements.define(o,e)}var c=class extends HTMLElement{#t=[];connectedCallback(){this.hasAttribute("data-upgraded")||this.setup()!==!1&&this.setAttribute("data-upgraded","")}disconnectedCallback(){for(let e of this.#t)e();this.#t=[],this.removeAttribute("data-upgraded"),this.teardown()}listen(e,r,t,n){e.addEventListener(r,t,n),this.#t.push(()=>e.removeEventListener(r,t,n))}setup(){}teardown(){}};var p=/^[a-zA-Z_$][a-zA-Z0-9_$]*(\.[a-zA-Z_$][a-zA-Z0-9_$]*|\[\d+\])*$/;function m(o){return!o||typeof o!="string"?!1:p.test(o.trim())}function s(o,e){if(!m(e)){console.warn(`[card-list] Unsafe property path rejected: "${e}"`);return}let t=e.replace(/\[(\d+)\]/g,".$1").split("."),n=o;for(let i of t){if(n==null)return;n=n[i]}return n}function b(o){return o?o.split(",").map(e=>{let[r,t]=e.split(":").map(n=>n.trim());return{attr:r,path:t}}).filter(({attr:e,path:r})=>e&&r):[]}var d=class extends c{#t=null;#e=[];#n="id";static get observedAttributes(){return["src","data-items","data-key"]}setup(){if(this.#t=this.querySelector("template"),!this.#t)return console.warn("[card-list] No template found"),!1;this.#n=this.getAttribute("data-key")||"id";let e=this.getAttribute("data-items");if(e){try{this.#e=JSON.parse(e),this.#r()}catch(t){console.error("[card-list] Invalid JSON in data-items:",t)}return}let r=this.getAttribute("src");r&&this.#i(r)}attributeChangedCallback(e,r,t){if(r!==t)if(e==="data-items"&&t)try{this.#e=JSON.parse(t),this.#r()}catch(n){console.error("[card-list] Invalid JSON in data-items:",n)}else e==="src"&&t?this.#i(t):e==="data-key"&&(this.#n=t||"id",this.#r())}async#i(e){try{this.setAttribute("data-loading","");let r=await fetch(e);if(!r.ok)throw new Error(`HTTP ${r.status}`);let t=await r.json();this.#e=Array.isArray(t)?t:t.items||t.data||[],this.#r()}catch(r){console.error("[card-list] Fetch error:",r),this.setAttribute("data-error",r.message)}finally{this.removeAttribute("data-loading")}}#r(){if(!this.#t)return;this.querySelectorAll(":scope > :not(template)").forEach(t=>t.remove());let r=document.createDocumentFragment();for(let t of this.#e){let n=this.#t.content.cloneNode(!0);this.#o(n,t),r.appendChild(n)}this.appendChild(r),this.dispatchEvent(new CustomEvent("card-list:rendered",{detail:{count:this.#e.length},bubbles:!0}))}#o(e,r){e.querySelectorAll("[data-field]").forEach(t=>{let n=t.getAttribute("data-field"),i=s(r,n);t.textContent=i??""}),e.querySelectorAll("[data-field-attr]").forEach(t=>{let n=b(t.getAttribute("data-field-attr"));for(let{attr:i,path:a}of n){if(!m(a))continue;let u=s(r,a);u!=null&&t.setAttribute(i,u)}}),e.querySelectorAll("[data-field-html]").forEach(t=>{let n=t.getAttribute("data-field-html"),i=s(r,n);t.innerHTML=l(i)}),e.querySelectorAll("[data-field-if]").forEach(t=>{let n=t.getAttribute("data-field-if");s(r,n)||t.remove()}),e.querySelectorAll("[data-field-unless]").forEach(t=>{let n=t.getAttribute("data-field-unless");s(r,n)&&t.remove()})}setItems(e){this.#e=Array.isArray(e)?e:[],this.#r()}getItems(){return[...this.#e]}};h("card-list",d);export{d as CardList,s as getValueByPath,m as isValidPath,l as sanitizeHTML};
1
+ function l(o){if(!o||typeof o!="string")return"";let e=document.createElement("template");return e.innerHTML=o,e.content.querySelectorAll("script, iframe, object, embed, form, base, link, meta, noscript").forEach(n=>n.remove()),e.content.querySelectorAll("*").forEach(n=>{for(let i of[...n.attributes]){if(i.name.startsWith("on")){n.removeAttribute(i.name);continue}if(["href","src","action","formaction","xlink:href"].includes(i.name)){let a=i.value.trim().toLowerCase();(a.startsWith("javascript:")||a.startsWith("data:text/html"))&&n.removeAttribute(i.name);continue}(i.name==="srcdoc"||i.name==="data"&&n.tagName==="OBJECT")&&n.removeAttribute(i.name)}}),e.innerHTML}var E=window.matchMedia("(prefers-reduced-motion: reduce)");var f=new Map;function h(o,e,r={}){let t=r.priority??10,n={impl:e,bundle:r.bundle,contract:r.contract,priority:t},i=f.get(o);if(customElements.get(o)){if(!i||i.priority>=t){i&&i.priority===t&&i.impl!==e&&console.warn(`[VB Bundle] Tag <${o}> already registered by "${i.bundle}" (priority ${i.priority}). Skipping "${r.bundle}".`);return}console.warn(`[VB Bundle] Tag <${o}> defined by "${i.bundle}" cannot be replaced (customElements.define is permanent). "${r.bundle}" has higher priority but arrived late.`);return}if(i&&i.priority>=t){i.priority===t&&console.warn(`[VB Bundle] Tag <${o}> already registered by "${i.bundle}". Skipping "${r.bundle}" (first wins at equal priority).`);return}f.set(o,n),customElements.define(o,e)}var c=class extends HTMLElement{#t=[];connectedCallback(){this.hasAttribute("data-upgraded")||this.setup()!==!1&&(this.setAttribute("data-upgraded",""),this.dispatchEvent(new CustomEvent(`${this.localName}:upgraded`,{bubbles:!0})))}disconnectedCallback(){for(let e of this.#t)e();this.#t=[],this.removeAttribute("data-upgraded"),this.teardown()}listen(e,r,t,n){e.addEventListener(r,t,n),this.#t.push(()=>e.removeEventListener(r,t,n))}setup(){}teardown(){}};var p=/^[a-zA-Z_$][a-zA-Z0-9_$]*(\.[a-zA-Z_$][a-zA-Z0-9_$]*|\[\d+\])*$/;function m(o){return!o||typeof o!="string"?!1:p.test(o.trim())}function s(o,e){if(!m(e)){console.warn(`[card-list] Unsafe property path rejected: "${e}"`);return}let t=e.replace(/\[(\d+)\]/g,".$1").split("."),n=o;for(let i of t){if(n==null)return;n=n[i]}return n}function b(o){return o?o.split(",").map(e=>{let[r,t]=e.split(":").map(n=>n.trim());return{attr:r,path:t}}).filter(({attr:e,path:r})=>e&&r):[]}var d=class extends c{#t=null;#e=[];#n="id";static get observedAttributes(){return["src","data-items","data-key"]}setup(){if(this.#t=this.querySelector("template"),!this.#t)return console.warn("[card-list] No template found"),!1;this.#n=this.getAttribute("data-key")||"id";let e=this.getAttribute("data-items");if(e){try{this.#e=JSON.parse(e),this.#r()}catch(t){console.error("[card-list] Invalid JSON in data-items:",t)}return}let r=this.getAttribute("src");r&&this.#i(r)}attributeChangedCallback(e,r,t){if(r!==t)if(e==="data-items"&&t)try{this.#e=JSON.parse(t),this.#r()}catch(n){console.error("[card-list] Invalid JSON in data-items:",n)}else e==="src"&&t?this.#i(t):e==="data-key"&&(this.#n=t||"id",this.#r())}async#i(e){try{this.setAttribute("data-loading","");let r=await fetch(e);if(!r.ok)throw new Error(`HTTP ${r.status}`);let t=await r.json();this.#e=Array.isArray(t)?t:t.items||t.data||[],this.#r()}catch(r){console.error("[card-list] Fetch error:",r),this.setAttribute("data-error",r.message)}finally{this.removeAttribute("data-loading")}}#r(){if(!this.#t)return;this.querySelectorAll(":scope > :not(template)").forEach(t=>t.remove());let r=document.createDocumentFragment();for(let t of this.#e){let n=this.#t.content.cloneNode(!0);this.#o(n,t),r.appendChild(n)}this.appendChild(r),this.dispatchEvent(new CustomEvent("card-list:rendered",{detail:{count:this.#e.length},bubbles:!0}))}#o(e,r){e.querySelectorAll("[data-field]").forEach(t=>{let n=t.getAttribute("data-field"),i=s(r,n);t.textContent=i??""}),e.querySelectorAll("[data-field-attr]").forEach(t=>{let n=b(t.getAttribute("data-field-attr"));for(let{attr:i,path:a}of n){if(!m(a))continue;let u=s(r,a);u!=null&&t.setAttribute(i,u)}}),e.querySelectorAll("[data-field-html]").forEach(t=>{let n=t.getAttribute("data-field-html"),i=s(r,n);t.innerHTML=l(i)}),e.querySelectorAll("[data-field-if]").forEach(t=>{let n=t.getAttribute("data-field-if");s(r,n)||t.remove()}),e.querySelectorAll("[data-field-unless]").forEach(t=>{let n=t.getAttribute("data-field-unless");s(r,n)&&t.remove()})}setItems(e){this.#e=Array.isArray(e)?e:[],this.#r()}getItems(){return[...this.#e]}};h("card-list",d);export{d as CardList,s as getValueByPath,m as isValidPath,l as sanitizeHTML};
2
2
  //# sourceMappingURL=card-list.js.map
@@ -1,2 +1,2 @@
1
- var I=Object.defineProperty;var N=(t,e)=>()=>(t&&(e=t(t=0)),e);var Y=(t,e)=>{for(var i in e)I(t,i,{get:e[i],enumerable:!0})};var S={};Y(S,{addDialogDismiss:()=>P,addLongPress:()=>$,addPullToRefresh:()=>B,addSwipeListener:()=>k,haptic:()=>E,initGestures:()=>C,makeSwipeable:()=>M});function k(t,e={}){let i=e.threshold??50,r=e.restraint??100,n=e.timeout??300,s,o,a;function c(h){h.isPrimary&&(s=h.clientX,o=h.clientY,a=Date.now())}function p(h){if(!h.isPrimary)return;let f=h.clientX-s,l=h.clientY-o,v=Date.now()-a;if(v>n)return;let m=Math.abs(f),u=Math.abs(l),d;if(m>=i&&u<=r?d=f<0?"left":"right":u>=i&&m<=r&&(d=l<0?"up":"down"),d){let b=d==="left"||d==="right"?m:u;t.dispatchEvent(new CustomEvent(`swipe-${d}`,{bubbles:!0,detail:{distance:b,duration:v}}))}}return t.addEventListener("pointerdown",c,{passive:!0}),t.addEventListener("pointerup",p,{passive:!0}),()=>{t.removeEventListener("pointerdown",c),t.removeEventListener("pointerup",p)}}function M(t,e={}){let i=e.threshold??100,r=e.direction??"horizontal",n=e.removeOnDismiss??!0,s=r==="horizontal",o=0,a=0,c=!1;function p(u){!u.isPrimary||t.hasAttribute("data-dismissed")||(u.preventDefault(),c=!0,o=s?u.clientX:u.clientY,a=0,t.setPointerCapture(u.pointerId),t.setAttribute("data-swiping",""))}function h(u){if(!c||!u.isPrimary)return;a=(s?u.clientX:u.clientY)-o;let b=1-Math.min(Math.abs(a)/i,1)*.5;s?t.style.transform=`translateX(${a}px)`:t.style.transform=`translateY(${a}px)`,t.style.opacity=String(b)}function f(u){!c||!u.isPrimary||(c=!1,t.releasePointerCapture(u.pointerId),t.removeAttribute("data-swiping"),Math.abs(a)>=i?v(a>0?"right":"left"):m())}function l(u){!c||!u.isPrimary||(c=!1,t.releasePointerCapture(u.pointerId),t.removeAttribute("data-swiping"),m())}function v(u){let d=u==="right"?"100%":"-100%";t.style.transition="transform 0.2s ease-out, opacity 0.2s ease-out",t.style.transform=s?`translateX(${d})`:`translateY(${d})`,t.style.opacity="0",t.setAttribute("data-dismissed",""),E.dismiss(),t.dispatchEvent(new CustomEvent("swipe-dismiss",{bubbles:!0,detail:{direction:u,distance:Math.abs(a)}})),n&&t.addEventListener("transitionend",()=>t.remove(),{once:!0})}function m(){t.style.transition="transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.3s ease",t.style.transform="",t.style.opacity="",t.addEventListener("transitionend",()=>{t.style.transition=""},{once:!0})}return t.addEventListener("pointerdown",p),t.addEventListener("pointermove",h),t.addEventListener("pointerup",f),t.addEventListener("pointercancel",l),()=>{t.removeEventListener("pointerdown",p),t.removeEventListener("pointermove",h),t.removeEventListener("pointerup",f),t.removeEventListener("pointercancel",l)}}function B(t,e,i={}){let r=i.threshold??70,n=i.maxPull??120,s=document.createElement("div");s.setAttribute("data-pull-indicator",""),s.setAttribute("aria-hidden","true");let o=document.createElement("div");o.setAttribute("data-pull-spinner",""),s.appendChild(o),t.prepend(s);let a=0,c=!1,p=!1;function h(d){!d.isPrimary||p||t.scrollTop<=0&&(a=d.clientY,c=!0)}function f(d){if(!c||!d.isPrimary||p)return;let b=d.clientY-a;if(b<=0){s.style.transform="",s.style.opacity="";return}let g=Math.min(b,n),A=g/r;s.style.transform=`translateY(${g}px)`,s.style.opacity=String(Math.min(A,1)),A>=1?s.setAttribute("data-pull-ready",""):s.removeAttribute("data-pull-ready")}function l(d){!c||!d.isPrimary||(c=!1,s.hasAttribute("data-pull-ready")&&!p?m():u())}function v(d){!c||!d.isPrimary||(c=!1,u())}async function m(){p=!0,s.removeAttribute("data-pull-ready"),s.setAttribute("data-pull-loading",""),s.style.transform=`translateY(${r}px)`,s.style.opacity="1";try{await e()}finally{p=!1,s.removeAttribute("data-pull-loading"),u()}}function u(){s.style.transition="transform 0.3s ease, opacity 0.3s ease",s.style.transform="",s.style.opacity="",s.removeAttribute("data-pull-ready"),s.addEventListener("transitionend",()=>{s.style.transition=""},{once:!0})}return t.addEventListener("pointerdown",h,{passive:!0}),t.addEventListener("pointermove",f,{passive:!0}),t.addEventListener("pointerup",l,{passive:!0}),t.addEventListener("pointercancel",v,{passive:!0}),()=>{t.removeEventListener("pointerdown",h),t.removeEventListener("pointermove",f),t.removeEventListener("pointerup",l),t.removeEventListener("pointercancel",v),s.remove()}}function $(t,e,i={}){let r=i.duration??500,n=i.hapticFeedback??!0,s=i.blockContextMenu??!0,o=null;function a(h){h.isPrimary&&(o=setTimeout(()=>{n&&E.tap(),e(h),o=null},r))}function c(){o&&(clearTimeout(o),o=null)}function p(h){s&&h.preventDefault()}return t.addEventListener("pointerdown",a,{passive:!0}),t.addEventListener("pointermove",c,{passive:!0}),t.addEventListener("pointerup",c,{passive:!0}),t.addEventListener("pointercancel",c,{passive:!0}),t.addEventListener("contextmenu",p),()=>{c(),t.removeEventListener("pointerdown",a),t.removeEventListener("pointermove",c),t.removeEventListener("pointerup",c),t.removeEventListener("pointercancel",c),t.removeEventListener("contextmenu",p)}}function P(t,e={}){let i=e.threshold??80,r=0,n=0,s=!1;function o(l){if(!l.isPrimary||!t.open)return;let v=l.target;v.closest("a, button, input, select, textarea, [contenteditable]")&&!v.closest("header")||(s=!0,r=l.clientY,n=0,t.setPointerCapture(l.pointerId),t.style.transition="none")}function a(l){if(!s||!l.isPrimary)return;if(n=l.clientY-r,n<=0){t.style.transform="",t.style.opacity="";return}let m=1-Math.min(n/i,1)*.4;t.style.transform=`translateY(${n}px)`,t.style.opacity=String(m)}function c(l){!s||!l.isPrimary||(s=!1,t.releasePointerCapture(l.pointerId),n>=i?h():f())}function p(l){!s||!l.isPrimary||(s=!1,t.releasePointerCapture(l.pointerId),f())}function h(){t.style.transition="transform 0.2s ease-out, opacity 0.2s ease-out",t.style.transform="translateY(100%)",t.style.opacity="0",E.dismiss(),t.addEventListener("transitionend",()=>{t.style.transition="",t.style.transform="",t.style.opacity="",t.close("dismiss")},{once:!0})}function f(){t.style.transition="transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.3s ease",t.style.transform="",t.style.opacity="",t.addEventListener("transitionend",()=>{t.style.transition=""},{once:!0})}return t.addEventListener("pointerdown",o),t.addEventListener("pointermove",a),t.addEventListener("pointerup",c),t.addEventListener("pointercancel",p),()=>{t.removeEventListener("pointerdown",o),t.removeEventListener("pointermove",a),t.removeEventListener("pointerup",c),t.removeEventListener("pointercancel",p)}}function C(t=document){let e=[];for(let i of t.querySelectorAll('[data-gesture="swipe"]'))e.push(k(i));for(let i of t.querySelectorAll('[data-gesture="dismiss"]'))e.push(M(i));for(let i of t.querySelectorAll('[data-gesture="long-press"]'))e.push($(i,()=>{i.dispatchEvent(new CustomEvent("long-press",{bubbles:!0}))}));for(let i of t.querySelectorAll('dialog[data-gesture="dismiss-down"]'))e.push(P(i));return()=>e.forEach(i=>i())}var E,D=N(()=>{E={tap:()=>navigator.vibrate?.(8),confirm:()=>navigator.vibrate?.([8,40,8]),error:()=>navigator.vibrate?.([30,60,30]),dismiss:()=>navigator.vibrate?.(15)};C()});var X=window.matchMedia("(prefers-reduced-motion: reduce)");var L=new Map;function x(t,e,i={}){let r=i.priority??10,n={impl:e,bundle:i.bundle,contract:i.contract,priority:r},s=L.get(t);if(customElements.get(t)){if(!s||s.priority>=r){s&&s.priority===r&&s.impl!==e&&console.warn(`[VB Bundle] Tag <${t}> already registered by "${s.bundle}" (priority ${s.priority}). Skipping "${i.bundle}".`);return}console.warn(`[VB Bundle] Tag <${t}> defined by "${s.bundle}" cannot be replaced (customElements.define is permanent). "${i.bundle}" has higher priority but arrived late.`);return}if(s&&s.priority>=r){s.priority===r&&console.warn(`[VB Bundle] Tag <${t}> already registered by "${s.bundle}". Skipping "${i.bundle}" (first wins at equal priority).`);return}L.set(t,n),customElements.define(t,e)}var y=class extends HTMLElement{#t=[];connectedCallback(){this.hasAttribute("data-upgraded")||this.setup()!==!1&&this.setAttribute("data-upgraded","")}disconnectedCallback(){for(let e of this.#t)e();this.#t=[],this.removeAttribute("data-upgraded"),this.teardown()}listen(e,i,r,n){e.addEventListener(i,r,n),this.#t.push(()=>e.removeEventListener(i,r,n))}setup(){}teardown(){}};function T(t){return document.startViewTransition?document.startViewTransition(t):t()}var q=0,w=class extends y{#t;#e=[];#i;#r;#n;#o;#u;#c=null;#s=0;#l=!1;#a=!1;#h=null;get currentIndex(){return this.#s}get slideCount(){return this.#e.length}get playing(){return this.#c!==null}setup(){let e=[...this.children];if(e.length===0)return!1;if(this.#l=window.matchMedia("(prefers-reduced-motion: reduce)").matches,this.#a=this.hasAttribute("transition")&&!!document.startViewTransition,this.setAttribute("role","region"),this.setAttribute("aria-roledescription","carousel"),this.hasAttribute("aria-label")||this.setAttribute("aria-label","Carousel"),this.#t=document.createElement("div"),this.#t.className="carousel-track",this.#t.setAttribute("tabindex","0"),this.#t.setAttribute("aria-label","Slides"),e.forEach((s,o)=>{s.setAttribute("role","group"),s.setAttribute("aria-roledescription","slide"),s.setAttribute("aria-label",`${o+1} of ${e.length}`),this.#t.appendChild(s)}),this.#e=[...this.#t.children],this.#i=document.createElement("button"),this.#i.className="carousel-prev",this.#i.setAttribute("aria-label","Previous slide"),this.#i.innerHTML='<icon-wc name="chevron-left" size="sm"></icon-wc>',this.#r=document.createElement("button"),this.#r.className="carousel-next",this.#r.setAttribute("aria-label","Next slide"),this.#r.innerHTML='<icon-wc name="chevron-right" size="sm"></icon-wc>',this.getAttribute("indicators")!=="false"&&(this.#n=document.createElement("div"),this.#n.className="carousel-indicators",this.#n.setAttribute("aria-label","Slide indicators"),this.#e.forEach((s,o)=>{let a=document.createElement("button");a.className="carousel-dot",a.setAttribute("aria-label",`Go to slide ${o+1}`),a.setAttribute("aria-current",o===0?"true":"false"),this.listen(a,"click",()=>this.goTo(o)),this.#n.appendChild(a)})),this.#o=document.createElement("div"),this.#o.className="carousel-live",this.#o.setAttribute("aria-live","polite"),this.#o.setAttribute("aria-atomic","true"),this.appendChild(this.#i),this.appendChild(this.#t),this.appendChild(this.#r),this.#n&&this.appendChild(this.#n),this.appendChild(this.#o),this.listen(this.#i,"click",()=>this.prev()),this.listen(this.#r,"click",()=>this.next()),this.listen(this.#t,"keydown",this.#m),this.#a){let s=++q,o=this.getAttribute("transition")||"fade",a=o==="slide"?"vt-carousel-slide":o==="scale"?"vt-carousel-scale":"vt-carousel";this.#t.style.viewTransitionName=`carousel-${s}`,this.#t.style.viewTransitionClass=a}this.#a&&Promise.resolve().then(()=>(D(),S)).then(({addSwipeListener:s})=>{this.#h=s(this.#t,{threshold:40}),this.listen(this.#t,"swipe-left",()=>this.next()),this.listen(this.#t,"swipe-right",()=>this.prev())}),this.#a||(this.#u=new IntersectionObserver(this.#v,{root:this.#t,threshold:.5}),this.#e.forEach(s=>this.#u.observe(s)));let n=this.#y()??(Number(this.getAttribute("start"))||0);if(this.#a){let s=n>0&&n<this.#e.length?n:0;this.#e.forEach((o,a)=>{o.hidden=a!==s}),this.#d(s)}else n>0&&n<this.#e.length&&this.goTo(n,!1);this.#f(),this.hasAttribute("autoplay")&&!this.#l&&this.#b()}teardown(){this.pause(),this.#u&&(this.#u.disconnect(),this.#u=null),this.#h&&(this.#h(),this.#h=null),this.#e=[],this.#a=!1}next(){let e=this.hasAttribute("loop");this.#s<this.#e.length-1?this.goTo(this.#s+1):e&&this.goTo(0)}prev(){let e=this.hasAttribute("loop");this.#s>0?this.goTo(this.#s-1):e&&this.goTo(this.#e.length-1)}goTo(e,i=!0){if(!(e<0||e>=this.#e.length)){if(this.#a)if(i&&e!==this.#s){let r=e>this.#s?"forward":"backward";document.documentElement.dataset.vtDirection=r,T(()=>{this.#p(e)}).finished?.then(()=>{delete document.documentElement.dataset.vtDirection})}else this.#p(e);else{let r=this.#e[e].offsetLeft-this.#t.offsetLeft,n=i&&!this.#l?"smooth":"instant";this.#t.scrollTo({left:r,behavior:n})}this.#d(e)}}#p(e){this.#e.forEach((i,r)=>{i.hidden=r!==e})}play(){if(this.#c||this.#l)return;let e=Number(this.getAttribute("autoplay-delay"))||5e3;this.#c=setInterval(()=>this.next(),e),this.dispatchEvent(new CustomEvent("carousel-wc:play",{bubbles:!0}))}pause(){this.#c&&(clearInterval(this.#c),this.#c=null,this.dispatchEvent(new CustomEvent("carousel-wc:pause",{bubbles:!0})))}reset(){let e=Number(this.getAttribute("start"))||0;this.goTo(e,!1),this.#w()}#d(e){this.#s=e,this.#f(),this.#E(),this.#o&&(this.#o.textContent=`Slide ${e+1} of ${this.#e.length}`),this.dispatchEvent(new CustomEvent("carousel-wc:change",{detail:{index:e,slide:this.#e[e]},bubbles:!0}))}#f(){let e=this.hasAttribute("loop"),i=this.#s===0,r=this.#s===this.#e.length-1;if(this.#i&&(this.#i.disabled=!e&&i),this.#r&&(this.#r.disabled=!e&&r),this.#n){let n=this.#n.children;for(let s=0;s<n.length;s++){let o=s===this.#s;n[s].setAttribute("aria-current",o?"true":"false"),o?n[s].setAttribute("data-active",""):n[s].removeAttribute("data-active")}}}#v=e=>{for(let i of e)if(i.isIntersecting){let r=this.#e.indexOf(i.target);r!==-1&&r!==this.#s&&this.#d(r)}};#m=e=>{switch(e.key){case"ArrowLeft":e.preventDefault(),this.prev();break;case"ArrowRight":e.preventDefault(),this.next();break;case"Home":e.preventDefault(),this.goTo(0);break;case"End":e.preventDefault(),this.goTo(this.#e.length-1);break}};#b(){this.play(),this.listen(this,"mouseenter",()=>this.pause()),this.listen(this,"mouseleave",()=>{this.hasAttribute("autoplay")&&this.play()}),this.listen(this,"focusin",()=>this.pause()),this.listen(this,"focusout",e=>{!this.contains(e.relatedTarget)&&this.hasAttribute("autoplay")&&this.play()}),this.listen(this,"touchstart",()=>this.pause(),{passive:!0})}#y(){let e=this.getAttribute("persist");if(!e)return null;try{let i=localStorage.getItem(`carousel:${e}`);return i!==null?Number(i):null}catch{return null}}#E(){let e=this.getAttribute("persist");if(e)try{localStorage.setItem(`carousel:${e}`,String(this.#s))}catch{}}#w(){let e=this.getAttribute("persist");if(e)try{localStorage.removeItem(`carousel:${e}`)}catch{}}};x("carousel-wc",w);export{w as CarouselWc};
1
+ var I=Object.defineProperty;var N=(t,e)=>()=>(t&&(e=t(t=0)),e);var Y=(t,e)=>{for(var i in e)I(t,i,{get:e[i],enumerable:!0})};var S={};Y(S,{addDialogDismiss:()=>C,addLongPress:()=>M,addPullToRefresh:()=>B,addSwipeListener:()=>$,haptic:()=>E,initGestures:()=>P,makeSwipeable:()=>k});function $(t,e={}){let i=e.threshold??50,r=e.restraint??100,n=e.timeout??300,s,o,a;function c(h){h.isPrimary&&(s=h.clientX,o=h.clientY,a=Date.now())}function p(h){if(!h.isPrimary)return;let f=h.clientX-s,l=h.clientY-o,v=Date.now()-a;if(v>n)return;let m=Math.abs(f),u=Math.abs(l),d;if(m>=i&&u<=r?d=f<0?"left":"right":u>=i&&m<=r&&(d=l<0?"up":"down"),d){let b=d==="left"||d==="right"?m:u;t.dispatchEvent(new CustomEvent(`swipe-${d}`,{bubbles:!0,detail:{distance:b,duration:v}}))}}return t.addEventListener("pointerdown",c,{passive:!0}),t.addEventListener("pointerup",p,{passive:!0}),()=>{t.removeEventListener("pointerdown",c),t.removeEventListener("pointerup",p)}}function k(t,e={}){let i=e.threshold??100,r=e.direction??"horizontal",n=e.removeOnDismiss??!0,s=r==="horizontal",o=0,a=0,c=!1;function p(u){!u.isPrimary||t.hasAttribute("data-dismissed")||(u.preventDefault(),c=!0,o=s?u.clientX:u.clientY,a=0,t.setPointerCapture(u.pointerId),t.setAttribute("data-swiping",""))}function h(u){if(!c||!u.isPrimary)return;a=(s?u.clientX:u.clientY)-o;let b=1-Math.min(Math.abs(a)/i,1)*.5;s?t.style.transform=`translateX(${a}px)`:t.style.transform=`translateY(${a}px)`,t.style.opacity=String(b)}function f(u){!c||!u.isPrimary||(c=!1,t.releasePointerCapture(u.pointerId),t.removeAttribute("data-swiping"),Math.abs(a)>=i?v(a>0?"right":"left"):m())}function l(u){!c||!u.isPrimary||(c=!1,t.releasePointerCapture(u.pointerId),t.removeAttribute("data-swiping"),m())}function v(u){let d=u==="right"?"100%":"-100%";t.style.transition="transform 0.2s ease-out, opacity 0.2s ease-out",t.style.transform=s?`translateX(${d})`:`translateY(${d})`,t.style.opacity="0",t.setAttribute("data-dismissed",""),E.dismiss(),t.dispatchEvent(new CustomEvent("swipe-dismiss",{bubbles:!0,detail:{direction:u,distance:Math.abs(a)}})),n&&t.addEventListener("transitionend",()=>t.remove(),{once:!0})}function m(){t.style.transition="transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.3s ease",t.style.transform="",t.style.opacity="",t.addEventListener("transitionend",()=>{t.style.transition=""},{once:!0})}return t.addEventListener("pointerdown",p),t.addEventListener("pointermove",h),t.addEventListener("pointerup",f),t.addEventListener("pointercancel",l),()=>{t.removeEventListener("pointerdown",p),t.removeEventListener("pointermove",h),t.removeEventListener("pointerup",f),t.removeEventListener("pointercancel",l)}}function B(t,e,i={}){let r=i.threshold??70,n=i.maxPull??120,s=document.createElement("div");s.setAttribute("data-pull-indicator",""),s.setAttribute("aria-hidden","true");let o=document.createElement("div");o.setAttribute("data-pull-spinner",""),s.appendChild(o),t.prepend(s);let a=0,c=!1,p=!1;function h(d){!d.isPrimary||p||t.scrollTop<=0&&(a=d.clientY,c=!0)}function f(d){if(!c||!d.isPrimary||p)return;let b=d.clientY-a;if(b<=0){s.style.transform="",s.style.opacity="";return}let g=Math.min(b,n),A=g/r;s.style.transform=`translateY(${g}px)`,s.style.opacity=String(Math.min(A,1)),A>=1?s.setAttribute("data-pull-ready",""):s.removeAttribute("data-pull-ready")}function l(d){!c||!d.isPrimary||(c=!1,s.hasAttribute("data-pull-ready")&&!p?m():u())}function v(d){!c||!d.isPrimary||(c=!1,u())}async function m(){p=!0,s.removeAttribute("data-pull-ready"),s.setAttribute("data-pull-loading",""),s.style.transform=`translateY(${r}px)`,s.style.opacity="1";try{await e()}finally{p=!1,s.removeAttribute("data-pull-loading"),u()}}function u(){s.style.transition="transform 0.3s ease, opacity 0.3s ease",s.style.transform="",s.style.opacity="",s.removeAttribute("data-pull-ready"),s.addEventListener("transitionend",()=>{s.style.transition=""},{once:!0})}return t.addEventListener("pointerdown",h,{passive:!0}),t.addEventListener("pointermove",f,{passive:!0}),t.addEventListener("pointerup",l,{passive:!0}),t.addEventListener("pointercancel",v,{passive:!0}),()=>{t.removeEventListener("pointerdown",h),t.removeEventListener("pointermove",f),t.removeEventListener("pointerup",l),t.removeEventListener("pointercancel",v),s.remove()}}function M(t,e,i={}){let r=i.duration??500,n=i.hapticFeedback??!0,s=i.blockContextMenu??!0,o=null;function a(h){h.isPrimary&&(o=setTimeout(()=>{n&&E.tap(),e(h),o=null},r))}function c(){o&&(clearTimeout(o),o=null)}function p(h){s&&h.preventDefault()}return t.addEventListener("pointerdown",a,{passive:!0}),t.addEventListener("pointermove",c,{passive:!0}),t.addEventListener("pointerup",c,{passive:!0}),t.addEventListener("pointercancel",c,{passive:!0}),t.addEventListener("contextmenu",p),()=>{c(),t.removeEventListener("pointerdown",a),t.removeEventListener("pointermove",c),t.removeEventListener("pointerup",c),t.removeEventListener("pointercancel",c),t.removeEventListener("contextmenu",p)}}function C(t,e={}){let i=e.threshold??80,r=0,n=0,s=!1;function o(l){if(!l.isPrimary||!t.open)return;let v=l.target;v.closest("a, button, input, select, textarea, [contenteditable]")&&!v.closest("header")||(s=!0,r=l.clientY,n=0,t.setPointerCapture(l.pointerId),t.style.transition="none")}function a(l){if(!s||!l.isPrimary)return;if(n=l.clientY-r,n<=0){t.style.transform="",t.style.opacity="";return}let m=1-Math.min(n/i,1)*.4;t.style.transform=`translateY(${n}px)`,t.style.opacity=String(m)}function c(l){!s||!l.isPrimary||(s=!1,t.releasePointerCapture(l.pointerId),n>=i?h():f())}function p(l){!s||!l.isPrimary||(s=!1,t.releasePointerCapture(l.pointerId),f())}function h(){t.style.transition="transform 0.2s ease-out, opacity 0.2s ease-out",t.style.transform="translateY(100%)",t.style.opacity="0",E.dismiss(),t.addEventListener("transitionend",()=>{t.style.transition="",t.style.transform="",t.style.opacity="",t.close("dismiss")},{once:!0})}function f(){t.style.transition="transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.3s ease",t.style.transform="",t.style.opacity="",t.addEventListener("transitionend",()=>{t.style.transition=""},{once:!0})}return t.addEventListener("pointerdown",o),t.addEventListener("pointermove",a),t.addEventListener("pointerup",c),t.addEventListener("pointercancel",p),()=>{t.removeEventListener("pointerdown",o),t.removeEventListener("pointermove",a),t.removeEventListener("pointerup",c),t.removeEventListener("pointercancel",p)}}function P(t=document){let e=[];for(let i of t.querySelectorAll('[data-gesture="swipe"]'))e.push($(i));for(let i of t.querySelectorAll('[data-gesture="dismiss"]'))e.push(k(i));for(let i of t.querySelectorAll('[data-gesture="long-press"]'))e.push(M(i,()=>{i.dispatchEvent(new CustomEvent("long-press",{bubbles:!0}))}));for(let i of t.querySelectorAll('dialog[data-gesture="dismiss-down"]'))e.push(C(i));return()=>e.forEach(i=>i())}var E,D=N(()=>{E={tap:()=>navigator.vibrate?.(8),confirm:()=>navigator.vibrate?.([8,40,8]),error:()=>navigator.vibrate?.([30,60,30]),dismiss:()=>navigator.vibrate?.(15)};P()});var X=window.matchMedia("(prefers-reduced-motion: reduce)");var L=new Map;function x(t,e,i={}){let r=i.priority??10,n={impl:e,bundle:i.bundle,contract:i.contract,priority:r},s=L.get(t);if(customElements.get(t)){if(!s||s.priority>=r){s&&s.priority===r&&s.impl!==e&&console.warn(`[VB Bundle] Tag <${t}> already registered by "${s.bundle}" (priority ${s.priority}). Skipping "${i.bundle}".`);return}console.warn(`[VB Bundle] Tag <${t}> defined by "${s.bundle}" cannot be replaced (customElements.define is permanent). "${i.bundle}" has higher priority but arrived late.`);return}if(s&&s.priority>=r){s.priority===r&&console.warn(`[VB Bundle] Tag <${t}> already registered by "${s.bundle}". Skipping "${i.bundle}" (first wins at equal priority).`);return}L.set(t,n),customElements.define(t,e)}var y=class extends HTMLElement{#t=[];connectedCallback(){this.hasAttribute("data-upgraded")||this.setup()!==!1&&(this.setAttribute("data-upgraded",""),this.dispatchEvent(new CustomEvent(`${this.localName}:upgraded`,{bubbles:!0})))}disconnectedCallback(){for(let e of this.#t)e();this.#t=[],this.removeAttribute("data-upgraded"),this.teardown()}listen(e,i,r,n){e.addEventListener(i,r,n),this.#t.push(()=>e.removeEventListener(i,r,n))}setup(){}teardown(){}};function T(t){return document.startViewTransition?document.startViewTransition(t):t()}var q=0,w=class extends y{#t;#e=[];#i;#r;#n;#a;#u;#c=null;#s=0;#l=!1;#o=!1;#h=null;get currentIndex(){return this.#s}get slideCount(){return this.#e.length}get playing(){return this.#c!==null}setup(){let e=[...this.children];if(e.length===0)return!1;if(this.#l=window.matchMedia("(prefers-reduced-motion: reduce)").matches,this.#o=this.hasAttribute("transition")&&!!document.startViewTransition,this.hasAttribute("transition")&&!this.#o&&this.removeAttribute("transition"),this.setAttribute("role","region"),this.setAttribute("aria-roledescription","carousel"),this.hasAttribute("aria-label")||this.setAttribute("aria-label","Carousel"),this.#t=document.createElement("div"),this.#t.className="carousel-track",this.#t.setAttribute("tabindex","0"),this.#t.setAttribute("aria-label","Slides"),e.forEach((s,o)=>{s.setAttribute("role","group"),s.setAttribute("aria-roledescription","slide"),s.setAttribute("aria-label",`${o+1} of ${e.length}`),this.#t.appendChild(s)}),this.#e=[...this.#t.children],this.#i=document.createElement("button"),this.#i.className="carousel-prev",this.#i.setAttribute("aria-label","Previous slide"),this.#i.innerHTML='<icon-wc name="chevron-left" size="sm"></icon-wc>',this.#r=document.createElement("button"),this.#r.className="carousel-next",this.#r.setAttribute("aria-label","Next slide"),this.#r.innerHTML='<icon-wc name="chevron-right" size="sm"></icon-wc>',this.getAttribute("indicators")!=="false"&&(this.#n=document.createElement("div"),this.#n.className="carousel-indicators",this.#n.setAttribute("aria-label","Slide indicators"),this.#e.forEach((s,o)=>{let a=document.createElement("button");a.className="carousel-dot",a.setAttribute("aria-label",`Go to slide ${o+1}`),a.setAttribute("aria-current",o===0?"true":"false"),this.listen(a,"click",()=>this.goTo(o)),this.#n.appendChild(a)})),this.#a=document.createElement("div"),this.#a.className="carousel-live",this.#a.setAttribute("aria-live","polite"),this.#a.setAttribute("aria-atomic","true"),this.appendChild(this.#i),this.appendChild(this.#t),this.appendChild(this.#r),this.#n&&this.appendChild(this.#n),this.appendChild(this.#a),this.listen(this.#i,"click",()=>this.prev()),this.listen(this.#r,"click",()=>this.next()),this.listen(this.#t,"keydown",this.#m),this.#o){let s=++q,o=this.getAttribute("transition")||"fade",a=o==="slide"?"vt-carousel-slide":o==="scale"?"vt-carousel-scale":"vt-carousel";this.#t.style.viewTransitionName=`carousel-${s}`,this.#t.style.viewTransitionClass=a}this.#o&&Promise.resolve().then(()=>(D(),S)).then(({addSwipeListener:s})=>{this.#h=s(this.#t,{threshold:40}),this.listen(this.#t,"swipe-left",()=>this.next()),this.listen(this.#t,"swipe-right",()=>this.prev())}),this.#o||(this.#u=new IntersectionObserver(this.#v,{root:this.#t,threshold:.5}),this.#e.forEach(s=>this.#u.observe(s)));let n=this.#y()??(Number(this.getAttribute("start"))||0);if(this.#o){let s=n>0&&n<this.#e.length?n:0;this.#e.forEach((o,a)=>{o.hidden=a!==s}),this.#d(s)}else n>0&&n<this.#e.length&&this.goTo(n,!1);this.#f(),this.hasAttribute("autoplay")&&!this.#l&&this.#b()}teardown(){this.pause(),this.#u&&(this.#u.disconnect(),this.#u=null),this.#h&&(this.#h(),this.#h=null),this.#e=[],this.#o=!1}next(){let e=this.hasAttribute("loop");this.#s<this.#e.length-1?this.goTo(this.#s+1):e&&this.goTo(0)}prev(){let e=this.hasAttribute("loop");this.#s>0?this.goTo(this.#s-1):e&&this.goTo(this.#e.length-1)}goTo(e,i=!0){if(!(e<0||e>=this.#e.length)){if(this.#o)if(i&&e!==this.#s){let r=e>this.#s?"forward":"backward";document.documentElement.dataset.vtDirection=r,T(()=>{this.#p(e)}).finished?.then(()=>{delete document.documentElement.dataset.vtDirection})}else this.#p(e);else{let r=this.#e[e].offsetLeft-this.#t.offsetLeft,n=i&&!this.#l?"smooth":"instant";this.#t.scrollTo({left:r,behavior:n})}this.#d(e)}}#p(e){this.#e.forEach((i,r)=>{i.hidden=r!==e})}play(){if(this.#c||this.#l)return;let e=Number(this.getAttribute("autoplay-delay"))||5e3;this.#c=setInterval(()=>this.next(),e),this.dispatchEvent(new CustomEvent("carousel-wc:play",{bubbles:!0}))}pause(){this.#c&&(clearInterval(this.#c),this.#c=null,this.dispatchEvent(new CustomEvent("carousel-wc:pause",{bubbles:!0})))}reset(){let e=Number(this.getAttribute("start"))||0;this.goTo(e,!1),this.#w()}#d(e){this.#s=e,this.#f(),this.#E(),this.#a&&(this.#a.textContent=`Slide ${e+1} of ${this.#e.length}`),this.dispatchEvent(new CustomEvent("carousel-wc:change",{detail:{index:e,slide:this.#e[e]},bubbles:!0}))}#f(){let e=this.hasAttribute("loop"),i=this.#s===0,r=this.#s===this.#e.length-1;if(this.#i&&(this.#i.disabled=!e&&i),this.#r&&(this.#r.disabled=!e&&r),this.#n){let n=this.#n.children;for(let s=0;s<n.length;s++){let o=s===this.#s;n[s].setAttribute("aria-current",o?"true":"false"),o?n[s].setAttribute("data-active",""):n[s].removeAttribute("data-active")}}}#v=e=>{for(let i of e)if(i.isIntersecting){let r=this.#e.indexOf(i.target);r!==-1&&r!==this.#s&&this.#d(r)}};#m=e=>{switch(e.key){case"ArrowLeft":e.preventDefault(),this.prev();break;case"ArrowRight":e.preventDefault(),this.next();break;case"Home":e.preventDefault(),this.goTo(0);break;case"End":e.preventDefault(),this.goTo(this.#e.length-1);break}};#b(){this.play(),this.listen(this,"mouseenter",()=>this.pause()),this.listen(this,"mouseleave",()=>{this.hasAttribute("autoplay")&&this.play()}),this.listen(this,"focusin",()=>this.pause()),this.listen(this,"focusout",e=>{!this.contains(e.relatedTarget)&&this.hasAttribute("autoplay")&&this.play()}),this.listen(this,"touchstart",()=>this.pause(),{passive:!0})}#y(){let e=this.getAttribute("persist");if(!e)return null;try{let i=localStorage.getItem(`carousel:${e}`);return i!==null?Number(i):null}catch{return null}}#E(){let e=this.getAttribute("persist");if(e)try{localStorage.setItem(`carousel:${e}`,String(this.#s))}catch{}}#w(){let e=this.getAttribute("persist");if(e)try{localStorage.removeItem(`carousel:${e}`)}catch{}}};x("carousel-wc",w);export{w as CarouselWc};
2
2
  //# sourceMappingURL=carousel-wc.js.map
@@ -1,4 +1,4 @@
1
- var u=window.matchMedia("(prefers-reduced-motion: reduce)");var c=new Map;function d(o,e,n={}){let i=n.priority??10,r={impl:e,bundle:n.bundle,contract:n.contract,priority:i},t=c.get(o);if(customElements.get(o)){if(!t||t.priority>=i){t&&t.priority===i&&t.impl!==e&&console.warn(`[VB Bundle] Tag <${o}> already registered by "${t.bundle}" (priority ${t.priority}). Skipping "${n.bundle}".`);return}console.warn(`[VB Bundle] Tag <${o}> defined by "${t.bundle}" cannot be replaced (customElements.define is permanent). "${n.bundle}" has higher priority but arrived late.`);return}if(t&&t.priority>=i){t.priority===i&&console.warn(`[VB Bundle] Tag <${o}> already registered by "${t.bundle}". Skipping "${n.bundle}" (first wins at equal priority).`);return}c.set(o,r),customElements.define(o,e)}var s=class extends HTMLElement{#e=[];connectedCallback(){this.hasAttribute("data-upgraded")||this.setup()!==!1&&this.setAttribute("data-upgraded","")}disconnectedCallback(){for(let e of this.#e)e();this.#e=[],this.removeAttribute("data-upgraded"),this.teardown()}listen(e,n,i,r){e.addEventListener(n,i,r),this.#e.push(()=>e.removeEventListener(n,i,r))}setup(){}teardown(){}};var a=class extends s{setup(){this.querySelector("[data-controls]")||this.#e()}#e(){let e=document.createElement("nav");e.setAttribute("data-controls",""),e.setAttribute("aria-label","Change view controls"),e.innerHTML=`
1
+ var u=window.matchMedia("(prefers-reduced-motion: reduce)");var c=new Map;function d(o,e,n={}){let i=n.priority??10,r={impl:e,bundle:n.bundle,contract:n.contract,priority:i},t=c.get(o);if(customElements.get(o)){if(!t||t.priority>=i){t&&t.priority===i&&t.impl!==e&&console.warn(`[VB Bundle] Tag <${o}> already registered by "${t.bundle}" (priority ${t.priority}). Skipping "${n.bundle}".`);return}console.warn(`[VB Bundle] Tag <${o}> defined by "${t.bundle}" cannot be replaced (customElements.define is permanent). "${n.bundle}" has higher priority but arrived late.`);return}if(t&&t.priority>=i){t.priority===i&&console.warn(`[VB Bundle] Tag <${o}> already registered by "${t.bundle}". Skipping "${n.bundle}" (first wins at equal priority).`);return}c.set(o,r),customElements.define(o,e)}var s=class extends HTMLElement{#e=[];connectedCallback(){this.hasAttribute("data-upgraded")||this.setup()!==!1&&(this.setAttribute("data-upgraded",""),this.dispatchEvent(new CustomEvent(`${this.localName}:upgraded`,{bubbles:!0})))}disconnectedCallback(){for(let e of this.#e)e();this.#e=[],this.removeAttribute("data-upgraded"),this.teardown()}listen(e,n,i,r){e.addEventListener(n,i,r),this.#e.push(()=>e.removeEventListener(n,i,r))}setup(){}teardown(){}};var a=class extends s{setup(){this.querySelector("[data-controls]")||this.#e()}#e(){let e=document.createElement("nav");e.setAttribute("data-controls",""),e.setAttribute("aria-label","Change view controls"),e.innerHTML=`
2
2
  <button type="button" data-action="tracking" aria-pressed="true">
3
3
  Tracking
4
4
  </button>