vanilla-breeze 0.1.3 → 0.1.4

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 (268) hide show
  1. package/dist/cdn/components/accessibility-specimen.js +11 -0
  2. package/dist/cdn/components/accordion-wc.js +1 -1
  3. package/dist/cdn/components/activity-feed.js +2 -0
  4. package/dist/cdn/components/adr-wc.js +17 -17
  5. package/dist/cdn/components/ai-chat.js +28 -0
  6. package/dist/cdn/components/ai-summary.js +10 -0
  7. package/dist/cdn/components/analytics-panel.js +5 -5
  8. package/dist/cdn/components/audio-player.js +3 -3
  9. package/dist/cdn/components/audio-visualizer.js +2 -2
  10. package/dist/cdn/components/author-index.js +2 -2
  11. package/dist/cdn/components/brand-mark.js +1 -1
  12. package/dist/cdn/components/bread-crumb.js +2 -0
  13. package/dist/cdn/components/breakpoint-specimen.js +26 -0
  14. package/dist/cdn/components/burndown-chart.js +2 -0
  15. package/dist/cdn/components/calendar-wc.js +2 -2
  16. package/dist/cdn/components/capacity-plan.js +25 -0
  17. package/dist/cdn/components/card-list.js +1 -1
  18. package/dist/cdn/components/carousel-wc.js +1 -1
  19. package/dist/cdn/components/change-set.js +2 -2
  20. package/dist/cdn/components/chart-wc.js +58 -36
  21. package/dist/cdn/components/chat-input.js +1 -1
  22. package/dist/cdn/components/chat-window.js +1 -1
  23. package/dist/cdn/components/color-palette.js +9 -9
  24. package/dist/cdn/components/color-picker.js +1 -1
  25. package/dist/cdn/components/combo-box.js +1 -1
  26. package/dist/cdn/components/command-palette.js +1 -1
  27. package/dist/cdn/components/comment-box.js +60 -0
  28. package/dist/cdn/components/comment-thread.js +60 -0
  29. package/dist/cdn/components/comment-wc.js +1 -1
  30. package/dist/cdn/components/compare-surface.js +1 -1
  31. package/dist/cdn/components/component-sampler.js +2 -2
  32. package/dist/cdn/components/consent-banner.js +1 -1
  33. package/dist/cdn/components/content-lens.js +1 -1
  34. package/dist/cdn/components/content-swap.js +1 -1
  35. package/dist/cdn/components/context-menu.js +1 -1
  36. package/dist/cdn/components/data-table.js +1 -1
  37. package/dist/cdn/components/date-picker.js +1 -1
  38. package/dist/cdn/components/day-view.js +1 -1
  39. package/dist/cdn/components/diagram-wc.js +3 -0
  40. package/dist/cdn/components/drag-surface.js +1 -1
  41. package/dist/cdn/components/drop-down.js +1 -1
  42. package/dist/cdn/components/emoji-picker.js +1 -1
  43. package/dist/cdn/components/empathy-map.js +41 -43
  44. package/dist/cdn/components/flow-diagram.js +1 -1
  45. package/dist/cdn/components/font-pairer.js +81 -81
  46. package/dist/cdn/components/foot-notes.js +1 -1
  47. package/dist/cdn/components/form-field.js +1 -1
  48. package/dist/cdn/components/gantt-chart.js +1 -1
  49. package/dist/cdn/components/geo-map.js +25 -23
  50. package/dist/cdn/components/glossary-index.js +1 -1
  51. package/dist/cdn/components/glossary-wc.js +1 -1
  52. package/dist/cdn/components/gradient-builder.js +29 -29
  53. package/dist/cdn/components/heading-links.js +1 -1
  54. package/dist/cdn/components/highlight-wc.js +2 -2
  55. package/dist/cdn/components/image-gallery.js +1 -1
  56. package/dist/cdn/components/image-map.js +1 -1
  57. package/dist/cdn/components/impact-effort.js +1 -1
  58. package/dist/cdn/components/include-file.js +1 -1
  59. package/dist/cdn/components/iron-triangle.js +2 -0
  60. package/dist/cdn/components/kanban-board.js +1 -1
  61. package/dist/cdn/components/layout-specimen.js +35 -0
  62. package/dist/cdn/components/manifest.json +228 -100
  63. package/dist/cdn/components/markdown-editor.js +1 -1
  64. package/dist/cdn/components/markdown-viewer.js +12 -12
  65. package/dist/cdn/components/motion-specimen.js +12 -12
  66. package/dist/cdn/components/nav-bar.js +2 -0
  67. package/dist/cdn/components/note-wc.js +2 -2
  68. package/dist/cdn/components/notification-wc.js +4 -4
  69. package/dist/cdn/components/page-info.js +4 -4
  70. package/dist/cdn/components/page-stats.js +1 -1
  71. package/dist/cdn/components/page-toc.js +1 -1
  72. package/dist/cdn/components/page-tools.js +1 -1
  73. package/dist/cdn/components/page-tour.js +6 -6
  74. package/dist/cdn/components/pager-wc.js +2 -0
  75. package/dist/cdn/components/palette-generator.js +11 -11
  76. package/dist/cdn/components/poll-wc.js +2 -0
  77. package/dist/cdn/components/pop-over.js +2 -0
  78. package/dist/cdn/components/popularity-index.js +2 -2
  79. package/dist/cdn/components/print-page.js +1 -1
  80. package/dist/cdn/components/product-roadmap.js +3 -0
  81. package/dist/cdn/components/progress-tracker.js +2 -0
  82. package/dist/cdn/components/qr-code.js +1 -1
  83. package/dist/cdn/components/quadrant-grid.js +3 -0
  84. package/dist/cdn/components/quality-target.js +12 -0
  85. package/dist/cdn/components/reaction-bar.js +2 -0
  86. package/dist/cdn/components/reader-view.js +3 -3
  87. package/dist/cdn/components/reading-progress.js +2 -0
  88. package/dist/cdn/components/recently-visited.js +10 -10
  89. package/dist/cdn/components/requirement-card.js +122 -0
  90. package/dist/cdn/components/review-surface.js +34 -40
  91. package/dist/cdn/components/risk-register.js +25 -0
  92. package/dist/cdn/components/roadmap.js +3 -0
  93. package/dist/cdn/components/score-card.js +197 -0
  94. package/dist/cdn/components/selection-menu.js +1 -1
  95. package/dist/cdn/components/semantic-palette.js +15 -15
  96. package/dist/cdn/components/settings-panel.js +12 -12
  97. package/dist/cdn/components/share-wc.js +2 -2
  98. package/dist/cdn/components/short-cuts.js +1 -1
  99. package/dist/cdn/components/site-index.js +4 -4
  100. package/dist/cdn/components/site-map-wc.js +1 -1
  101. package/dist/cdn/components/site-map.js +1 -1
  102. package/dist/cdn/components/site-search.js +9 -9
  103. package/dist/cdn/components/slide-accept.js +1 -1
  104. package/dist/cdn/components/social-embed.js +1 -1
  105. package/dist/cdn/components/spacing-specimen.js +5 -5
  106. package/dist/cdn/components/split-surface.js +1 -1
  107. package/dist/cdn/components/star-rating.js +1 -1
  108. package/dist/cdn/components/status-wc.js +2 -0
  109. package/dist/cdn/components/stepper-wc.js +2 -0
  110. package/dist/cdn/components/story-map.js +1 -1
  111. package/dist/cdn/components/tab-set.js +1 -1
  112. package/dist/cdn/components/text-reader.js +2 -2
  113. package/dist/cdn/components/theme-catalog.js +28 -0
  114. package/dist/cdn/components/theme-export.js +20 -12
  115. package/dist/cdn/components/theme-import.js +44 -0
  116. package/dist/cdn/components/theme-picker.js +29 -26
  117. package/dist/cdn/components/time-index.js +2 -2
  118. package/dist/cdn/components/time-picker.js +1 -1
  119. package/dist/cdn/components/toast-msg.js +3 -3
  120. package/dist/cdn/components/token-specimen.js +14 -14
  121. package/dist/cdn/components/tool-tip.js +1 -1
  122. package/dist/cdn/components/topic-map.js +3 -3
  123. package/dist/cdn/components/traceability-matrix.js +3 -0
  124. package/dist/cdn/components/trust-filter.js +3 -3
  125. package/dist/cdn/components/type-specimen.js +15 -15
  126. package/dist/cdn/components/user-journey.js +63 -70
  127. package/dist/cdn/components/user-persona.js +75 -13
  128. package/dist/cdn/components/user-story.js +9 -8
  129. package/dist/cdn/components/version-switcher.js +17 -0
  130. package/dist/cdn/components/video-player.js +3 -3
  131. package/dist/cdn/components/watch-wc.js +2 -2
  132. package/dist/cdn/components/week-view.js +1 -1
  133. package/dist/cdn/components/work-item.js +29 -28
  134. package/dist/cdn/components/youtube-player.js +1 -1
  135. package/dist/cdn/packs/design-system.full.js +59 -51
  136. package/dist/cdn/packs/effects.full.js +1 -1
  137. package/dist/cdn/packs/icons.effects.js +1 -1
  138. package/dist/cdn/packs/icons.full.js +1 -1
  139. package/dist/cdn/packs/kawaii.full.css +1 -1
  140. package/dist/cdn/packs/kawaii.full.js +6 -6
  141. package/dist/cdn/packs/kawaii.theme.css +1 -1
  142. package/dist/cdn/packs/manifest.json +11 -11
  143. package/dist/cdn/packs/ui.full.css +1 -1
  144. package/dist/cdn/packs/ui.full.js +54 -51
  145. package/dist/cdn/packs/ux-planning.full.css +1 -1
  146. package/dist/cdn/packs/ux-planning.full.js +317 -241
  147. package/dist/cdn/themes/8bit.css +1 -1
  148. package/dist/cdn/themes/8bit.tokens.json +662 -0
  149. package/dist/cdn/themes/alpha1999-dark.tokens.json +693 -0
  150. package/dist/cdn/themes/alpha1999.css +1 -1
  151. package/dist/cdn/themes/alpha1999.tokens.json +869 -0
  152. package/dist/cdn/themes/anthropic.css +2 -0
  153. package/dist/cdn/themes/anthropic.tokens.json +564 -0
  154. package/dist/cdn/themes/art-deco-dark.tokens.json +407 -0
  155. package/dist/cdn/themes/art-deco.css +1 -1
  156. package/dist/cdn/themes/art-deco.tokens.json +581 -0
  157. package/dist/cdn/themes/bauhaus-dark.tokens.json +260 -0
  158. package/dist/cdn/themes/bauhaus.css +1 -1
  159. package/dist/cdn/themes/bauhaus.tokens.json +589 -0
  160. package/dist/cdn/themes/brutalist-dark.tokens.json +503 -0
  161. package/dist/cdn/themes/brutalist.tokens.json +677 -0
  162. package/dist/cdn/themes/catalog/atlassian.tokens.json +303 -0
  163. package/dist/cdn/themes/catalog/bootstrap.tokens.json +304 -0
  164. package/dist/cdn/themes/catalog/carbon.tokens.json +301 -0
  165. package/dist/cdn/themes/catalog/catppuccin-mocha.tokens.json +301 -0
  166. package/dist/cdn/themes/catalog/govuk.tokens.json +301 -0
  167. package/dist/cdn/themes/catalog/manifest.json +132 -0
  168. package/dist/cdn/themes/catalog/material.tokens.json +289 -0
  169. package/dist/cdn/themes/catalog/salesforce.tokens.json +301 -0
  170. package/dist/cdn/themes/catalog/tailwind.tokens.json +302 -0
  171. package/dist/cdn/themes/catppuccin-frappe.css +1 -1
  172. package/dist/cdn/themes/catppuccin-frappe.tokens.json +608 -0
  173. package/dist/cdn/themes/catppuccin-latte-dark.tokens.json +472 -0
  174. package/dist/cdn/themes/catppuccin-latte.css +1 -1
  175. package/dist/cdn/themes/catppuccin-latte.tokens.json +608 -0
  176. package/dist/cdn/themes/catppuccin-macchiato.css +1 -1
  177. package/dist/cdn/themes/catppuccin-macchiato.tokens.json +608 -0
  178. package/dist/cdn/themes/catppuccin-mocha.tokens.json +608 -0
  179. package/dist/cdn/themes/classic-dark.tokens.json +503 -0
  180. package/dist/cdn/themes/classic.tokens.json +640 -0
  181. package/dist/cdn/themes/claymorphism-dark.tokens.json +493 -0
  182. package/dist/cdn/themes/claymorphism.css +1 -1
  183. package/dist/cdn/themes/claymorphism.tokens.json +626 -0
  184. package/dist/cdn/themes/clinical-dark.tokens.json +472 -0
  185. package/dist/cdn/themes/clinical.tokens.json +608 -0
  186. package/dist/cdn/themes/cottagecore-dark.tokens.json +412 -0
  187. package/dist/cdn/themes/cottagecore.css +1 -1
  188. package/dist/cdn/themes/cottagecore.tokens.json +544 -0
  189. package/dist/cdn/themes/cyber.tokens.json +668 -0
  190. package/dist/cdn/themes/dawn-dark.tokens.json +472 -0
  191. package/dist/cdn/themes/dawn.css +1 -1
  192. package/dist/cdn/themes/dawn.tokens.json +608 -0
  193. package/dist/cdn/themes/dracula.tokens.json +534 -0
  194. package/dist/cdn/themes/dusk.tokens.json +533 -0
  195. package/dist/cdn/themes/editorial-dark.tokens.json +400 -0
  196. package/dist/cdn/themes/editorial.tokens.json +690 -0
  197. package/dist/cdn/themes/financial-dark.tokens.json +472 -0
  198. package/dist/cdn/themes/financial.css +1 -1
  199. package/dist/cdn/themes/financial.tokens.json +607 -0
  200. package/dist/cdn/themes/genai.tokens.json +534 -0
  201. package/dist/cdn/themes/glassmorphism-dark.tokens.json +489 -0
  202. package/dist/cdn/themes/glassmorphism.css +1 -1
  203. package/dist/cdn/themes/glassmorphism.tokens.json +632 -0
  204. package/dist/cdn/themes/government-dark.tokens.json +472 -0
  205. package/dist/cdn/themes/government.tokens.json +608 -0
  206. package/dist/cdn/themes/gruvbox-dark.tokens.json +472 -0
  207. package/dist/cdn/themes/gruvbox.tokens.json +608 -0
  208. package/dist/cdn/themes/high-noon-dark.tokens.json +397 -0
  209. package/dist/cdn/themes/high-noon.tokens.json +533 -0
  210. package/dist/cdn/themes/ibm.css +2 -0
  211. package/dist/cdn/themes/ibm.tokens.json +568 -0
  212. package/dist/cdn/themes/kawaii-dark.tokens.json +549 -0
  213. package/dist/cdn/themes/kawaii.css +1 -1
  214. package/dist/cdn/themes/kawaii.tokens.json +641 -0
  215. package/dist/cdn/themes/magna-dark.tokens.json +482 -0
  216. package/dist/cdn/themes/magna.css +1 -1
  217. package/dist/cdn/themes/magna.tokens.json +632 -0
  218. package/dist/cdn/themes/manifest.json +162 -62
  219. package/dist/cdn/themes/mcdonalds.css +2 -0
  220. package/dist/cdn/themes/mcdonalds.tokens.json +533 -0
  221. package/dist/cdn/themes/midnight.tokens.json +534 -0
  222. package/dist/cdn/themes/minimal-dark.tokens.json +294 -0
  223. package/dist/cdn/themes/minimal.tokens.json +494 -0
  224. package/dist/cdn/themes/modern-dark.tokens.json +490 -0
  225. package/dist/cdn/themes/modern.tokens.json +573 -0
  226. package/dist/cdn/themes/nes-dark.tokens.json +564 -0
  227. package/dist/cdn/themes/nes.css +1 -1
  228. package/dist/cdn/themes/nes.tokens.json +687 -0
  229. package/dist/cdn/themes/neumorphism-dark.tokens.json +471 -0
  230. package/dist/cdn/themes/neumorphism.css +1 -1
  231. package/dist/cdn/themes/neumorphism.tokens.json +589 -0
  232. package/dist/cdn/themes/nord-dark.tokens.json +484 -0
  233. package/dist/cdn/themes/nord.tokens.json +619 -0
  234. package/dist/cdn/themes/organic-dark.tokens.json +532 -0
  235. package/dist/cdn/themes/organic.tokens.json +685 -0
  236. package/dist/cdn/themes/rose-pine-dark.tokens.json +472 -0
  237. package/dist/cdn/themes/rose-pine.tokens.json +608 -0
  238. package/dist/cdn/themes/rough-dark.tokens.json +515 -0
  239. package/dist/cdn/themes/rough.css +1 -1
  240. package/dist/cdn/themes/rough.tokens.json +650 -0
  241. package/dist/cdn/themes/solarized-dark.tokens.json +397 -0
  242. package/dist/cdn/themes/solarized.tokens.json +532 -0
  243. package/dist/cdn/themes/starbucks.css +2 -0
  244. package/dist/cdn/themes/starbucks.tokens.json +593 -0
  245. package/dist/cdn/themes/startup-dark.tokens.json +522 -0
  246. package/dist/cdn/themes/startup.css +1 -1
  247. package/dist/cdn/themes/startup.tokens.json +607 -0
  248. package/dist/cdn/themes/super2026-dark.tokens.json +667 -0
  249. package/dist/cdn/themes/super2026.tokens.json +863 -0
  250. package/dist/cdn/themes/swiss-dark.tokens.json +390 -0
  251. package/dist/cdn/themes/swiss.tokens.json +750 -0
  252. package/dist/cdn/themes/terminal.css +1 -1
  253. package/dist/cdn/themes/terminal.tokens.json +689 -0
  254. package/dist/cdn/themes/tokyo-night-dark.tokens.json +472 -0
  255. package/dist/cdn/themes/tokyo-night.tokens.json +608 -0
  256. package/dist/cdn/themes/vaporwave-dark.tokens.json +413 -0
  257. package/dist/cdn/themes/vaporwave.tokens.json +549 -0
  258. package/dist/cdn/themes/win9x-dark.tokens.json +563 -0
  259. package/dist/cdn/themes/win9x.tokens.json +700 -0
  260. package/dist/cdn/vanilla-breeze-charts.css +1 -1
  261. package/dist/cdn/vanilla-breeze-charts.js +58 -36
  262. package/dist/cdn/vanilla-breeze-core.css +1 -1
  263. package/dist/cdn/vanilla-breeze-core.js +246 -51
  264. package/dist/cdn/vanilla-breeze-dev.js +1 -1
  265. package/dist/cdn/vanilla-breeze-extras.js +90 -80
  266. package/dist/cdn/vanilla-breeze.css +1 -1
  267. package/dist/cdn/vanilla-breeze.js +1363 -398
  268. package/package.json +10 -3
@@ -1,11 +1,11 @@
1
- var x=window.matchMedia("(prefers-reduced-motion: reduce)");var y=new Map;function S(u,e,t={}){let n=t.priority??10,o={impl:e,bundle:t.bundle,contract:t.contract,priority:n},r=y.get(u);if(customElements.get(u)){if(!r||r.priority>=n){r&&r.priority===n&&r.impl!==e&&console.warn(`[VB Bundle] Tag <${u}> already registered by "${r.bundle}" (priority ${r.priority}). Skipping "${t.bundle}".`);return}console.warn(`[VB Bundle] Tag <${u}> defined by "${r.bundle}" cannot be replaced (customElements.define is permanent). "${t.bundle}" has higher priority but arrived late.`);return}if(r&&r.priority>=n){r.priority===n&&console.warn(`[VB Bundle] Tag <${u}> already registered by "${r.bundle}". Skipping "${t.bundle}" (first wins at equal priority).`);return}y.set(u,o),customElements.define(u,e)}var h=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,n,o){e.addEventListener(t,n,o),this.#e.push(()=>e.removeEventListener(t,n,o))}setup(){}teardown(){}};var m=class extends h{#e=null;#t=[];#n=null;setup(){let e=this.getAttribute("src");e?this.#p(e).then(()=>this.#o()):this.#o()}teardown(){this.#e?.disconnect()}#o(){this.#s(),this.#c(),this.#l();let e=this.getAttribute("letters")||"entries";e!=="none"&&this.#a(e==="all"),this.#u()}#s(){let e=this.querySelector('nav[aria-label="Site index"]');e&&(this.#t=[...e.querySelectorAll(":scope > section")])}#c(){let e=this.querySelectorAll('nav[aria-label="Site index"] > section');for(let t of e){let n=t.querySelectorAll(":scope > ul > li"),o=0;for(let s of n){let c=s.querySelectorAll(".index-refs > li").length;o+=c;let l=s.querySelector(".index-term");if(l&&c>0&&!l.querySelector(".index-count")){let d=document.createElement("span");d.className="index-count",d.textContent=`(${c})`,l.after(d)}}let r=t.querySelector("h2");if(r&&o>0&&!r.querySelector(".index-count")){let s=document.createElement("span");s.className="index-count",s.textContent=`(${o})`,r.append(s)}}}#l(){let e=document.createElement("nav");e.setAttribute("data-index-controls",""),e.setAttribute("aria-label","Index controls");let t=this.getAttribute("placeholder")||"Filter index\u2026",n=document.createElement("input");n.type="search",n.placeholder=t,n.setAttribute("aria-label",t),n.setAttribute("data-index-search",""),n.addEventListener("input",()=>this.#r(n.value)),e.append(n);let o=document.createElement("select");o.setAttribute("aria-label","Search scope"),o.innerHTML=`
1
+ var x=window.matchMedia("(prefers-reduced-motion: reduce)");var y=new Map;function S(u,e,t={}){let n=t.priority??10,o={impl:e,bundle:t.bundle,contract:t.contract,priority:n},r=y.get(u);if(customElements.get(u)){if(!r||r.priority>=n){r&&r.priority===n&&r.impl!==e&&console.warn(`[VB Bundle] Tag <${u}> already registered by "${r.bundle}" (priority ${r.priority}). Skipping "${t.bundle}".`);return}console.warn(`[VB Bundle] Tag <${u}> defined by "${r.bundle}" cannot be replaced (customElements.define is permanent). "${t.bundle}" has higher priority but arrived late.`);return}if(r&&r.priority>=n){r.priority===n&&console.warn(`[VB Bundle] Tag <${u}> already registered by "${r.bundle}". Skipping "${t.bundle}" (first wins at equal priority).`);return}y.set(u,o),customElements.define(u,e)}var h=class extends HTMLElement{#t=[];#e;connectedCallback(){this.hasAttribute("data-upgraded")||this.setup()!==!1&&(this.setAttribute("data-upgraded",""),queueMicrotask(()=>{this.dispatchEvent(new CustomEvent(`${this.localName}:upgraded`,{bubbles:!0}))}))}disconnectedCallback(){for(let e of this.#t)e();this.#t=[],this.removeAttribute("data-upgraded"),this.teardown()}listen(e,t,n,o){e.addEventListener(t,n,o),this.#t.push(()=>e.removeEventListener(t,n,o))}setup(){}teardown(){}setState(e,t){this.#e||(this.#e=this.attachInternals());let n=this.#e.states;try{t?n.add(e):n.delete(e)}catch{let o=`--${e}`;t?n.add(o):n.delete(o)}}_adoptInternals(e){this.#e||(this.#e=e)}};var m=class extends h{#t=null;#e=[];#n=null;setup(){let e=this.getAttribute("src");e?this.#p(e).then(()=>this.#o()):this.#o()}teardown(){this.#t?.disconnect()}#o(){this.#i(),this.#c(),this.#l();let e=this.getAttribute("letters")||"entries";e!=="none"&&this.#a(e==="all"),this.#u()}#i(){let e=this.querySelector('nav[aria-label="Site index"]');e&&(this.#e=[...e.querySelectorAll(":scope > section")])}#c(){let e=this.querySelectorAll('nav[aria-label="Site index"] > section');for(let t of e){let n=t.querySelectorAll(":scope > ul > li"),o=0;for(let i of n){let c=i.querySelectorAll(".index-refs > li").length;o+=c;let l=i.querySelector(".index-term");if(l&&c>0&&!l.querySelector(".index-count")){let d=document.createElement("span");d.className="index-count",d.textContent=`(${c})`,l.after(d)}}let r=t.querySelector("h2");if(r&&o>0&&!r.querySelector(".index-count")){let i=document.createElement("span");i.className="index-count",i.textContent=`(${o})`,r.append(i)}}}#l(){let e=document.createElement("nav");e.setAttribute("data-index-controls",""),e.setAttribute("aria-label","Index controls");let t=this.getAttribute("placeholder")||"Filter index\u2026",n=document.createElement("input");n.type="search",n.placeholder=t,n.setAttribute("aria-label",t),n.setAttribute("data-index-search",""),n.addEventListener("input",()=>this.#r(n.value)),e.append(n);let o=document.createElement("select");o.setAttribute("aria-label","Search scope"),o.innerHTML=`
2
2
  <option value="topic">By Topic</option>
3
3
  <option value="all">All</option>
4
- `,this.getAttribute("filter")==="all"&&(o.value="all"),o.addEventListener("change",()=>this.#r(n.value)),this.#n=o,e.append(o);let s=document.createElement("select");s.setAttribute("aria-label","Sort order"),s.innerHTML=`
4
+ `,this.getAttribute("filter")==="all"&&(o.value="all"),o.addEventListener("change",()=>this.#r(n.value)),this.#n=o,e.append(o);let i=document.createElement("select");i.setAttribute("aria-label","Sort order"),i.innerHTML=`
5
5
  <option value="alpha">Alphabetical</option>
6
6
  <option value="count">Most entries</option>
7
- `;let i=this.getAttribute("sort");i==="count"&&(s.value="count"),s.addEventListener("change",()=>this.#i(s.value)),e.append(s);let c=this.querySelector('nav[aria-label="Site index"]');c?c.before(e):this.prepend(e),i==="count"&&this.#i("count")}#a(e){let t=this.querySelector(".index-jump");t&&t.remove();let n=this.querySelectorAll('nav[aria-label="Site index"] > section'),o=new Set;for(let a of n){let f=a.id?.replace("index-","").toUpperCase();f&&o.add(f)}if(o.size===0)return;let r="ABCDEFGHIJKLMNOPQRSTUVWXYZ".split(""),s=e?r:[...o].sort(),i=document.createElement("nav");i.className="index-jump",i.setAttribute("aria-label","Jump to letter");let c=document.createElement("ol");c.className="inline";for(let a of s){let f=document.createElement("li");if(o.has(a)){let p=document.createElement("a");p.href=`#index-${a.toLowerCase()}`,p.textContent=a,f.append(p)}else{let p=document.createElement("span");p.textContent=a,p.setAttribute("aria-disabled","true"),f.append(p)}c.append(f)}i.append(c);let l=this.querySelector("[data-index-controls]"),d=this.querySelector('nav[aria-label="Site index"]');l?l.after(i):d?d.before(i):this.prepend(i),this.#d(i)}#d(e){let t=e.querySelectorAll("a");if(!t.length)return;let n=this.querySelectorAll('nav[aria-label="Site index"] > section');if(n.length){this.#e=new IntersectionObserver(o=>{for(let r of o)if(r.isIntersecting){let s=r.target.id;for(let i of t){let c=i.getAttribute("href")===`#${s}`;i.setAttribute("aria-current",c?"true":"false")}}},{rootMargin:"-20% 0px -60% 0px"});for(let o of n)this.#e.observe(o)}}#u(){let e=this.getAttribute("limit");if(!e)return;let t=parseInt(e,10);if(!t||t<1)return;let n=this.querySelectorAll('nav[aria-label="Site index"] > section');for(let o of n){let r=[...o.querySelectorAll(":scope > ul > li")];if(r.length<=t)continue;let s=r.slice(t);for(let l of s)l.hidden=!0,l.setAttribute("data-index-overflow","");let i=document.createElement("button");i.type="button",i.setAttribute("data-index-expand",""),i.setAttribute("aria-expanded","false"),i.textContent=`Show ${s.length} more`,i.addEventListener("click",()=>{let l=i.getAttribute("aria-expanded")==="true";for(let d of s)d.hidden=l;i.setAttribute("aria-expanded",!l),i.textContent=l?`Show ${s.length} more`:"Show less"});let c=o.querySelector(":scope > ul");c&&c.after(i)}}#r(e){let t=e.toLowerCase().trim(),n=this.#n?.value||"topic",o=this.querySelectorAll('nav[aria-label="Site index"] > section');for(let r of o){let s=r.querySelectorAll(":scope > ul > li"),i=!1;for(let c of s){let d=c.querySelector(".index-term")?.textContent?.toLowerCase()||"",a=!t||d.includes(t);if(!a&&n==="all"){let f=c.querySelectorAll(".index-refs a");for(let b of f)if(b.textContent.toLowerCase().includes(t)){a=!0;break}}c.hidden=!a,a&&(i=!0)}r.hidden=!i}this.#f()}#f(){let e=this.querySelector(".index-jump");if(!e)return;let t=this.querySelectorAll('nav[aria-label="Site index"] > section');for(let n of t){let o=n.id?.replace("index-","").toUpperCase();if(!o)continue;let r=e.querySelector(`a[href="#index-${o.toLowerCase()}"]`);r&&(r.style.opacity=n.hidden?"0.3":"")}}#i(e){let t=this.querySelector('nav[aria-label="Site index"]');if(t){if(e==="alpha")for(let n of this.#t)t.append(n);else if(e==="count"){let n=[...t.querySelectorAll(":scope > section")];n.sort((o,r)=>{let s=o.querySelectorAll(".index-refs > li").length;return r.querySelectorAll(".index-refs > li").length-s});for(let o of n)t.append(o)}}}async#p(e){try{let t=await fetch(e);if(!t.ok)return;let n=await t.json();this.#h(n)}catch{}}#h(e){if(!Array.isArray(e))return;let t={};for(let r of e){let s=(r.term||"")[0]?.toUpperCase()||"#";t[s]||(t[s]=[]),t[s].push(r)}let n=document.createElement("nav");n.setAttribute("aria-label","Site index");for(let[r,s]of Object.entries(t).sort(([i],[c])=>i.localeCompare(c))){let i=document.createElement("section");i.id=`index-${r.toLowerCase()}`,i.innerHTML=`<h2>${r}</h2>`;let c=document.createElement("ul");for(let l of s){let d=document.createElement("li");d.innerHTML=`
7
+ `;let s=this.getAttribute("sort");s==="count"&&(i.value="count"),i.addEventListener("change",()=>this.#s(i.value)),e.append(i);let c=this.querySelector('nav[aria-label="Site index"]');c?c.before(e):this.prepend(e),s==="count"&&this.#s("count")}#a(e){let t=this.querySelector(".index-jump");t&&t.remove();let n=this.querySelectorAll('nav[aria-label="Site index"] > section'),o=new Set;for(let a of n){let f=a.id?.replace("index-","").toUpperCase();f&&o.add(f)}if(o.size===0)return;let r="ABCDEFGHIJKLMNOPQRSTUVWXYZ".split(""),i=e?r:[...o].sort(),s=document.createElement("nav");s.className="index-jump",s.setAttribute("aria-label","Jump to letter");let c=document.createElement("ol");c.className="inline";for(let a of i){let f=document.createElement("li");if(o.has(a)){let p=document.createElement("a");p.href=`#index-${a.toLowerCase()}`,p.textContent=a,f.append(p)}else{let p=document.createElement("span");p.textContent=a,p.setAttribute("aria-disabled","true"),f.append(p)}c.append(f)}s.append(c);let l=this.querySelector("[data-index-controls]"),d=this.querySelector('nav[aria-label="Site index"]');l?l.after(s):d?d.before(s):this.prepend(s),this.#d(s)}#d(e){let t=e.querySelectorAll("a");if(!t.length)return;let n=this.querySelectorAll('nav[aria-label="Site index"] > section');if(n.length){this.#t=new IntersectionObserver(o=>{for(let r of o)if(r.isIntersecting){let i=r.target.id;for(let s of t){let c=s.getAttribute("href")===`#${i}`;s.setAttribute("aria-current",c?"true":"false")}}},{rootMargin:"-20% 0px -60% 0px"});for(let o of n)this.#t.observe(o)}}#u(){let e=this.getAttribute("limit");if(!e)return;let t=parseInt(e,10);if(!t||t<1)return;let n=this.querySelectorAll('nav[aria-label="Site index"] > section');for(let o of n){let r=[...o.querySelectorAll(":scope > ul > li")];if(r.length<=t)continue;let i=r.slice(t);for(let l of i)l.hidden=!0,l.setAttribute("data-index-overflow","");let s=document.createElement("button");s.type="button",s.setAttribute("data-index-expand",""),s.setAttribute("aria-expanded","false"),s.textContent=`Show ${i.length} more`,s.addEventListener("click",()=>{let l=s.getAttribute("aria-expanded")==="true";for(let d of i)d.hidden=l;s.setAttribute("aria-expanded",String(!l)),s.textContent=l?`Show ${i.length} more`:"Show less"});let c=o.querySelector(":scope > ul");c&&c.after(s)}}#r(e){let t=e.toLowerCase().trim(),n=this.#n?.value||"topic",o=this.querySelectorAll('nav[aria-label="Site index"] > section');for(let r of o){let i=r.querySelectorAll(":scope > ul > li"),s=!1;for(let c of i){let d=c.querySelector(".index-term")?.textContent?.toLowerCase()||"",a=!t||d.includes(t);if(!a&&n==="all"){let f=c.querySelectorAll(".index-refs a");for(let b of f)if((b.textContent||"").toLowerCase().includes(t)){a=!0;break}}c.hidden=!a,a&&(s=!0)}r.hidden=!s}this.#f()}#f(){let e=this.querySelector(".index-jump");if(!e)return;let t=this.querySelectorAll('nav[aria-label="Site index"] > section');for(let n of t){let o=n.id?.replace("index-","").toUpperCase();if(!o)continue;let r=e.querySelector(`a[href="#index-${o.toLowerCase()}"]`);r&&(r.style.opacity=n.hidden?"0.3":"")}}#s(e){let t=this.querySelector('nav[aria-label="Site index"]');if(t){if(e==="alpha")for(let n of this.#e)t.append(n);else if(e==="count"){let n=[...t.querySelectorAll(":scope > section")];n.sort((o,r)=>{let i=o.querySelectorAll(".index-refs > li").length;return r.querySelectorAll(".index-refs > li").length-i});for(let o of n)t.append(o)}}}async#p(e){try{let t=await fetch(e);if(!t.ok)return;let n=await t.json();this.#h(n)}catch{}}#h(e){if(!Array.isArray(e))return;let t={};for(let r of e){let i=(r.term||"")[0]?.toUpperCase()||"#";t[i]||(t[i]=[]),t[i].push(r)}let n=document.createElement("nav");n.setAttribute("aria-label","Site index");for(let[r,i]of Object.entries(t).sort(([s],[c])=>s.localeCompare(c))){let s=document.createElement("section");s.id=`index-${r.toLowerCase()}`,s.innerHTML=`<h2>${r}</h2>`;let c=document.createElement("ul");for(let l of i){let d=document.createElement("li");d.innerHTML=`
8
8
  <span class="index-term">${l.term}</span>
9
9
  ${l.refs?`<ul class="index-refs">${l.refs.map(a=>`<li><a href="${a.href}">${a.label}</a>${a.type?` <small>${a.type}</small>`:""}</li>`).join("")}</ul>`:""}
10
- `,c.append(d)}i.append(c),n.append(i)}let o=this.querySelector('nav[aria-label="Site index"]');o?o.replaceWith(n):this.append(n)}};S("site-index",m);export{m as SiteIndex};
10
+ `,c.append(d)}s.append(c),n.append(s)}let o=this.querySelector('nav[aria-label="Site index"]');o?o.replaceWith(n):this.append(n)}};S("site-index",m);export{m as SiteIndex};
11
11
  //# sourceMappingURL=site-index.js.map
@@ -1,2 +1,2 @@
1
- var E=window.matchMedia("(prefers-reduced-motion: reduce)");var v=new Map;function C(c,i,e={}){let s=e.priority??10,t={impl:i,bundle:e.bundle,contract:e.contract,priority:s},r=v.get(c);if(customElements.get(c)){if(!r||r.priority>=s){r&&r.priority===s&&r.impl!==i&&console.warn(`[VB Bundle] Tag <${c}> already registered by "${r.bundle}" (priority ${r.priority}). Skipping "${e.bundle}".`);return}console.warn(`[VB Bundle] Tag <${c}> defined by "${r.bundle}" cannot be replaced (customElements.define is permanent). "${e.bundle}" has higher priority but arrived late.`);return}if(r&&r.priority>=s){r.priority===s&&console.warn(`[VB Bundle] Tag <${c}> already registered by "${r.bundle}". Skipping "${e.bundle}" (first wins at equal priority).`);return}v.set(c,t),customElements.define(c,i)}var A=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 i of this.#h)i();this.#h=[],this.removeAttribute("data-upgraded"),this.teardown()}listen(i,e,s,t){i.addEventListener(e,s,t),this.#h.push(()=>i.removeEventListener(e,s,t))}setup(){}teardown(){}};var y={layout:{label:"Layout",cssClass:"sm-badge--layout"},section:{label:"Section",cssClass:"sm-badge--section"},dashboard:{label:"Dashboard",cssClass:"sm-badge--dashboard"},page:{label:"Page",cssClass:"sm-badge--page"},modal:{label:"Modal",cssClass:"sm-badge--modal"},redirect:{label:"Redirect",cssClass:"sm-badge--redirect"}},x={draft:{label:"Draft",cssClass:"sm-status--draft"},ready:{label:"Ready",cssClass:"sm-status--ready"},live:{label:"Live",cssClass:"sm-status--live"},deprecated:{label:"Deprecated",cssClass:"sm-status--deprecated"}},S=class c extends A{static get observedAttributes(){return["src","collapsed","compact","title","data-view","data-orientation","data-detail"]}static#h=0;#u=null;#s=null;#t=null;#f=null;#r=0;#n=0;setup(){c.#h++;let i=this.getAttribute("src");if(i&&!this.querySelector("nav")){this._loadSrc(i);return}let e=this.querySelector(":scope > nav");if(e){if(this.#r=0,this.#n=0,this.#w(e.querySelector("ul"),0),this.dataset.view==="visual"){this.#N(),this.#J(e),this.dispatchEvent(new CustomEvent("site-map-wc:ready",{bubbles:!0,detail:{nodeCount:this.#r,depth:this.#n}}));return}this.#k(e.querySelector("ul"),0),this.#N(),e.classList.add("sm-tree"),e.setAttribute("role","tree"),e.setAttribute("aria-label",this.getAttribute("title")||"Site map"),this.#u=e,this.hasAttribute("collapsed")&&this.#q(),this.listen(e,"keydown",s=>this.#X(s)),this.listen(e,"click",s=>this.#R(s)),this.dispatchEvent(new CustomEvent("site-map-wc:ready",{bubbles:!0,detail:{nodeCount:this.#r,depth:this.#n}}))}}teardown(){if(this.#t){this.#t.remove(),this.#t=null;let i=this.querySelector("nav");i&&(i.style.display="",i.removeAttribute("aria-hidden"))}this.#s&&(this.#s.remove(),this.#s=null),this.#u&&(this.#u.classList.remove("sm-tree"),this.#u.removeAttribute("role"),this.#u.removeAttribute("aria-label")),this.querySelectorAll(".sm-node-content, .sm-toggle").forEach(i=>i.remove()),this.querySelectorAll('li[role="treeitem"]').forEach(i=>{i.removeAttribute("role"),i.removeAttribute("aria-expanded"),i.removeAttribute("tabindex")}),this.querySelectorAll('ul[role="group"]').forEach(i=>{i.removeAttribute("role"),i.classList.remove("sm-subtree","sm-collapsed")}),this.#u=null,this.#f=null,this.#r=0,this.#n=0}attributeChangedCallback(i,e,s){e===s||!this.isConnected||i==="src"&&this._loadSrc(s)}#w(i,e){if(!i)return;let s=i.querySelectorAll(":scope > li");for(let t of s){this.#r++;let r=e+1;r>this.#n&&(this.#n=r);let o=t.querySelector(":scope > ul");o&&this.#w(o,r)}}#k(i,e){if(!i)return;e>0&&(i.setAttribute("role","group"),i.classList.add("sm-subtree"));let s=[...i.querySelectorAll(":scope > li")];for(let t of s){let r=!!t.querySelector(":scope > ul"),o=t.querySelector(":scope > a"),a=t.getAttribute("data-page-type")||"page",h=t.getAttribute("data-template")||"",l=t.getAttribute("data-status")||"";t.setAttribute("role","treeitem"),t.setAttribute("tabindex","-1");let n=document.createElement("span");if(n.className="sm-node-content",r){t.setAttribute("aria-expanded","true");let u=document.createElement("button");u.className="sm-toggle",u.setAttribute("type","button"),u.setAttribute("aria-hidden","true"),u.setAttribute("tabindex","-1"),u.textContent="\u25BE",n.appendChild(u)}else{let u=document.createElement("span");u.className="sm-leaf-marker",u.setAttribute("aria-hidden","true"),n.appendChild(u)}if(l&&x[l]){let u=document.createElement("span");u.className=`sm-status-dot ${x[l].cssClass}`,u.setAttribute("title",x[l].label),u.setAttribute("aria-label",x[l].label),n.appendChild(u)}if(o&&n.appendChild(o),y[a]){let u=document.createElement("span");u.className=`sm-badge ${y[a].cssClass}`,u.textContent=y[a].label,n.appendChild(u)}if(h){let u=document.createElement("span");u.className="sm-badge sm-badge--template",u.textContent=h,n.appendChild(u)}t.insertBefore(n,t.firstChild);let b=t.querySelector(":scope > ul");b&&this.#k(b,e+1)}}#N(){let i=this.getAttribute("title");if(!i&&this.#r===0)return;if(this.#s=document.createElement("div"),this.#s.className="sm-header",i){let t=document.createElement("h2");t.className="sm-title",t.textContent=i,this.#s.appendChild(t)}let e=document.createElement("span");e.className="sm-summary",e.textContent=`${this.#r} pages \xB7 ${this.#n} levels deep`,this.#s.appendChild(e);let s=document.createElement("button");s.className="sm-toggle-all",s.setAttribute("type","button"),s.textContent="Collapse all",s.addEventListener("click",()=>{this.querySelectorAll('li[aria-expanded="true"]').length>0?(this.#q(),s.textContent="Expand all"):(this.#G(),s.textContent="Collapse all")}),this.#s.appendChild(s),this.insertBefore(this.#s,this.firstChild)}#q(){let i=this.querySelectorAll("li[aria-expanded]");for(let e of i){e.setAttribute("aria-expanded","false");let s=e.querySelector(":scope > ul");s&&s.classList.add("sm-collapsed");let t=e.querySelector(":scope > .sm-node-content > .sm-toggle");t&&(t.textContent="\u25B8")}}#G(){let i=this.querySelectorAll("li[aria-expanded]");for(let e of i){e.setAttribute("aria-expanded","true");let s=e.querySelector(":scope > ul");s&&s.classList.remove("sm-collapsed");let t=e.querySelector(":scope > .sm-node-content > .sm-toggle");t&&(t.textContent="\u25BE")}}#b(i){let e=i.getAttribute("aria-expanded")==="true";i.setAttribute("aria-expanded",e?"false":"true");let s=i.querySelector(":scope > ul");s&&s.classList.toggle("sm-collapsed",e);let t=i.querySelector(":scope > .sm-node-content > .sm-toggle");t&&(t.textContent=e?"\u25B8":"\u25BE")}#R(i){let e=i.target;if(e.closest(".sm-toggle")){i.preventDefault();let r=e.closest('li[role="treeitem"]');r&&this.#b(r);return}let s=e.closest('li[role="treeitem"]');if(!s)return;this.#a(s);let t=e.closest("a");t&&this.dispatchEvent(new CustomEvent("site-map-wc:select",{bubbles:!0,detail:{href:t.getAttribute("href")||"",pageType:s.getAttribute("data-page-type")||"page",template:s.getAttribute("data-template")||""}}))}#X(i){let e=i.target.closest('li[role="treeitem"]');if(!e)return;let s=i.key,t=!1;switch(s){case"ArrowDown":t=!0,this.#j(e);break;case"ArrowUp":t=!0,this.#K(e);break;case"ArrowRight":if(t=!0,e.getAttribute("aria-expanded")==="false")this.#b(e);else if(e.getAttribute("aria-expanded")==="true"){let r=e.querySelector(':scope > ul > li[role="treeitem"]');r&&this.#a(r)}break;case"ArrowLeft":if(t=!0,e.getAttribute("aria-expanded")==="true")this.#b(e);else{let r=e.parentElement?.closest('li[role="treeitem"]');r&&this.#a(r)}break;case"Enter":t=!0,e.hasAttribute("aria-expanded")&&this.#b(e);break;case" ":t=!0;{let r=e.querySelector(":scope > .sm-node-content > a");r&&r.click()}break;case"Home":t=!0;{let r=this.querySelector('li[role="treeitem"]');r&&this.#a(r)}break;case"End":t=!0;{let r=this.#x();r.length&&this.#a(r[r.length-1])}break}t&&(i.preventDefault(),i.stopPropagation())}#x(){let i=[],e=t=>{if(!t)return;let r=[...t.querySelectorAll(':scope > li[role="treeitem"]')];for(let o of r)if(i.push(o),o.getAttribute("aria-expanded")==="true"){let a=o.querySelector(":scope > ul");a&&e(a)}},s=this.querySelector("nav > ul");return e(s),i}#j(i){let e=this.#x(),s=e.indexOf(i);s>=0&&s<e.length-1&&this.#a(e[s+1])}#K(i){let e=this.#x(),s=e.indexOf(i);s>0&&this.#a(e[s-1])}#a(i){this.#f&&this.#f.setAttribute("tabindex","-1"),i.setAttribute("tabindex","0"),i.focus(),this.#f=i}static#m="http://www.w3.org/2000/svg";static#l=150;static#c=70;static#$=30;static#S=50;static#Z=20;static#L={layout:{stroke:"#8b5cf6",fill:"#f5f3ff",text:"#6d28d9"},section:{stroke:"#3b82f6",fill:"#eff6ff",text:"#1d4ed8"},dashboard:{stroke:"#22c55e",fill:"#f0fdf4",text:"#15803d"},page:{stroke:"#94a3b8",fill:"#f8fafc",text:"#475569"},modal:{stroke:"#f59e0b",fill:"#fffbeb",text:"#b45309"},redirect:{stroke:"#ef4444",fill:"#fef2f2",text:"#b91c1c"}};static#T={draft:"#94a3b8",ready:"#f59e0b",live:"#22c55e",deprecated:"#ef4444"};#M(i){let e=[];for(let s of i.querySelectorAll(":scope > li")){let t=s.querySelector(":scope > a"),r=s.querySelector(":scope > ul");e.push({label:t?.textContent?.trim()||s.firstChild?.textContent?.trim()||"",href:t?.getAttribute("href")||"",pageType:s.getAttribute("data-page-type")||"page",template:s.getAttribute("data-template")||"",status:s.getAttribute("data-status")||"",children:r?this.#M(r):[],x:0,y:0,subtreeWidth:0,collapsed:!1,childCount:0})}return e}#B(i,e=0){let s=c.#l,t=c.#c,r=c.#$,o=c.#S;for(let a of i)a.childCount=this.#z(a),a.children.length>0&&!a.collapsed?(this.#B(a.children,e+1),a.subtreeWidth=a.children.reduce((h,l)=>h+l.subtreeWidth,0)+r*(a.children.length-1)):a.subtreeWidth=s,a.subtreeWidth=Math.max(a.subtreeWidth,s)}#z(i){let e=0;for(let s of i.children)e+=1+this.#z(s);return e}#D(i,e,s){let t=c.#l,r=c.#c,o=c.#$,a=c.#S,h=e;for(let l of i)l.x=h+(l.subtreeWidth-t)/2,l.y=s,l.children.length>0&&!l.collapsed&&this.#D(l.children,h,s+r+a),h+=l.subtreeWidth+o}#J(i){i.style.display="none",i.setAttribute("aria-hidden","true");let e=i.querySelector("ul");e&&(this.#e=this.#M(e),this.#d())}#e=null;#i=1;get#v(){return this.dataset.orientation==="horizontal"?"horizontal":"vertical"}get#H(){return Math.min(4,Math.max(0,parseInt(this.dataset.detail||"2",10)))}static#g={zoomIn:'<circle cx="11" cy="11" r="8"/><line x1="21" x2="16.65" y1="21" y2="16.65"/><line x1="11" x2="11" y1="8" y2="14"/><line x1="8" x2="14" y1="11" y2="11"/>',zoomOut:'<circle cx="11" cy="11" r="8"/><line x1="21" x2="16.65" y1="21" y2="16.65"/><line x1="8" x2="14" y1="11" y2="11"/>',reset:'<path d="M15 3h6v6"/><path d="m21 3-7 7"/><path d="m3 21 7-7"/><path d="M9 21H3v-6"/>',flip:'<path d="M21 8V5a2 2 0 0 0-2-2H5a2 2 0 0 0-2 2v3"/><path d="M21 16v3a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-3"/><path d="M4 12H2"/><path d="M10 12H8"/><path d="M16 12h-2"/><path d="M22 12h-2"/>'};static#P=["Shape","Shape + Title","Full","Full + Status","Wireframe"];#d(){if(!this.#e)return;this.#t&&this.#t.remove();let i=c.#m,e=c.#l,s=c.#c,t=c.#Z,r=this.#v==="horizontal";this.#B(this.#e),this.#D(this.#e,t,t);let o=this.#V(this.#e),a=o.maxX+e+t,h=o.maxY+s+t;r&&([a,h]=[h,a]),this.#t=document.createElement("div"),this.#t.className="sm-visual",this.#t.setAttribute("tabindex","-1"),this.#t.appendChild(this.#Q());let l=document.createElementNS(i,"svg");l.setAttribute("viewBox",`0 0 ${a} ${h}`),l.setAttribute("width",String(a)),l.setAttribute("height",String(h)),l.setAttribute("role","img"),l.setAttribute("aria-label",`Site map${this.getAttribute("title")?": "+this.getAttribute("title"):""}`);let n=document.createElement("div");if(n.className="sm-visual-zoom",n.style.width=`${Math.round(a*this.#i)}px`,n.style.height=`${Math.round(h*this.#i)}px`,l.style.transform=`scale(${this.#i})`,l.style.transformOrigin="0 0",r){let f=document.createElementNS(i,"g");f.setAttribute("transform",`rotate(90 0 0) translate(0 -${h})`),this.#C(f,this.#e),this.#E(f,this.#e),l.appendChild(f)}else this.#C(l,this.#e),this.#E(l,this.#e);n.appendChild(l),this.#t.appendChild(n);let b=document.createElement("div");b.className="sm-visual-summary";let u=Math.round(this.#i*100);b.textContent=`${this.#r} pages \xB7 ${this.#n} levels \xB7 ${u}%`,this.#t.appendChild(b),this.appendChild(this.#t),this.#st(this.#t,l),this.listen(l,"click",f=>{let m=f.target,d=m.closest("[data-toggle]");if(d){let g=d.getAttribute("data-toggle");this.#U(g);return}let p=m.closest("[data-node-id]");p&&(this.#o(p.getAttribute("data-node-id")),this.dispatchEvent(new CustomEvent("site-map-wc:select",{bubbles:!0,detail:{href:p.getAttribute("data-href")||"",pageType:p.getAttribute("data-page-type")||"page",template:p.getAttribute("data-template")||""}})))}),l.setAttribute("tabindex","0"),l.setAttribute("role","tree"),l.setAttribute("aria-label",`Site map${this.getAttribute("title")?": "+this.getAttribute("title"):""} \u2014 use arrow keys to navigate`),l.addEventListener("keydown",f=>this.#tt(f)),requestAnimationFrame(()=>{let f=l.querySelector("[data-node-id]");f&&this.#F(f)})}#Q(){let i=document.createElement("div");i.className="sm-vtoolbar",i.setAttribute("role","toolbar"),i.setAttribute("aria-label","Site map controls");let e=f=>`<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">${f}</svg>`,s=this.#A(e(c.#g.zoomIn),"Zoom in",()=>{this.#i=Math.min(3,this.#i+.25),this.#d()});i.appendChild(s);let t=this.#A(e(c.#g.zoomOut),"Zoom out",()=>{this.#i=Math.max(.25,this.#i-.25),this.#d()});i.appendChild(t);let r=this.#A(e(c.#g.reset),"Reset zoom",()=>{this.#i=1,this.#d()});i.appendChild(r);let o=document.createElement("span");o.className="sm-vtoolbar-sep",i.appendChild(o);let a=this.#v==="horizontal"?"Vertical":"Horizontal",h=this.#A(e(c.#g.flip),a,()=>{this.dataset.orientation=this.#v==="horizontal"?"vertical":"horizontal",this.#d()});i.appendChild(h),i.appendChild(o.cloneNode());let l=this.#H,n=document.createElement("label");n.className="sm-vtoolbar-detail",n.textContent="Detail ";let b=document.createElement("input");b.type="range",b.min="0",b.max="4",b.value=String(l),b.setAttribute("aria-label","Detail level"),b.className="sm-vtoolbar-slider",n.appendChild(b);let u=document.createElement("span");return u.className="sm-vtoolbar-detail-label",u.textContent=c.#P[l],n.appendChild(u),b.addEventListener("input",()=>{this.dataset.detail=b.value,u.textContent=c.#P[parseInt(b.value,10)],this.#d()}),i.appendChild(n),i}#A(i,e,s){let t=document.createElement("button");return t.type="button",t.className="sm-vtoolbar-btn",t.innerHTML=i,t.setAttribute("aria-label",e),t.setAttribute("title",e),t.addEventListener("click",s),t}#y=null;#O(i,e=""){let s=[];for(let t=0;t<i.length;t++){let r=i[t],o=e?`${e}-${t}`:String(t);s.push(o),r.children.length>0&&!r.collapsed&&s.push(...this.#O(r.children,o))}return s}#_(i){let e=i.lastIndexOf("-");return e>0?i.slice(0,e):null}#it(i){let e=this.#p(i,this.#e);return!e||e.collapsed||e.children.length===0?null:`${i}-0`}#o(i){if(!i||!this.#t)return;let e=this.#t.querySelector('svg[role="tree"]');if(!e)return;let s=e.querySelector(`[data-node-id="${i}"]`);if(!s)return;this.#F(s),this.#y=i;let t=s.querySelector("rect");if(t&&this.#t){let r=t.getBoundingClientRect(),o=this.#t.getBoundingClientRect();(r.left<o.left||r.right>o.right||r.top<o.top||r.bottom>o.bottom)&&t.scrollIntoView({behavior:"smooth",block:"nearest",inline:"nearest"})}}#F(i){let e=i.closest("svg");if(!e)return;e.querySelectorAll(".sm-vfocus-ring").forEach(r=>r.remove()),e.querySelectorAll("[data-node-id]").forEach(r=>r.removeAttribute("aria-current"));let s=c.#m,t=i.querySelector("rect");if(t){let r=document.createElementNS(s,"rect");r.setAttribute("x",String(parseFloat(t.getAttribute("x"))-3)),r.setAttribute("y",String(parseFloat(t.getAttribute("y"))-3)),r.setAttribute("width",String(parseFloat(t.getAttribute("width"))+6)),r.setAttribute("height",String(parseFloat(t.getAttribute("height"))+6)),r.setAttribute("rx","11"),r.setAttribute("fill","none"),r.setAttribute("stroke","#3b82f6"),r.setAttribute("stroke-width","2"),r.setAttribute("class","sm-vfocus-ring"),i.parentNode.insertBefore(r,i)}i.setAttribute("aria-current","true"),this.#y=i.getAttribute("data-node-id")}#tt(i){if(!this.#e)return;let e=this.#y||"0",s=!1;switch(i.key){case"ArrowDown":{s=!0;let t=this.#p(e,this.#e);t&&t.children.length>0&&!t.collapsed&&this.#o(`${e}-0`);break}case"ArrowUp":{s=!0;let t=this.#_(e);t&&this.#o(t);break}case"ArrowRight":{s=!0;let t=this.#W(e,1);t&&this.#o(t);break}case"ArrowLeft":{s=!0;let t=this.#W(e,-1);t&&this.#o(t);break}case"Enter":case" ":{s=!0;let t=this.#p(e,this.#e);t&&t.children.length>0&&this.#U(e);break}case"Home":{s=!0,this.#o("0");break}case"End":{s=!0;let t=this.#O(this.#e);t.length&&this.#o(t[t.length-1]);break}}s&&(i.preventDefault(),i.stopPropagation())}#W(i,e){let s=i.split("-").map(Number),t=s[s.length-1]+e;if(t<0)return null;let r=s.length>1?s.slice(0,-1).join("-"):null,o=r?this.#p(r,this.#e):null,a=o?o.children:this.#e;if(!a||t>=a.length)return null;let h=[...s];return h[h.length-1]=t,h.join("-")}#I=!1;#et={dragging:!1,startX:0,startY:0,scrollLeft:0,scrollTop:0,moved:!1};#st(i,e){if(e.style.cursor="grab",this.#I)return;this.#I=!0;let s=this.#et;this.listen(this,"pointerdown",t=>{if(t.target.closest("button, [data-toggle], .sm-vtoolbar, input"))return;let r=this.querySelector(".sm-visual");if(!r)return;s.dragging=!0,s.moved=!1,s.startX=t.clientX,s.startY=t.clientY,s.scrollLeft=r.scrollLeft,s.scrollTop=r.scrollTop;let o=this.querySelector('svg[role="tree"]');o&&(o.style.cursor="grabbing")}),this.listen(window,"pointermove",t=>{if(!s.dragging)return;let r=t.clientX-s.startX,o=t.clientY-s.startY;(Math.abs(r)>3||Math.abs(o)>3)&&(s.moved=!0);let a=this.querySelector(".sm-visual");a&&(a.scrollLeft=s.scrollLeft-r,a.scrollTop=s.scrollTop-o)}),this.listen(window,"pointerup",()=>{if(!s.dragging)return;s.dragging=!1;let t=this.querySelector('svg[role="tree"]');t&&(t.style.cursor="grab")}),this.listen(this,"click",t=>{s.moved&&(t.stopPropagation(),s.moved=!1)},{capture:!0})}#V(i){let e=0,s=0;for(let t of i)if(t.x+c.#l>e&&(e=t.x+c.#l),t.y+c.#c>s&&(s=t.y+c.#c),t.children.length>0&&!t.collapsed){let r=this.#V(t.children);r.maxX>e&&(e=r.maxX),r.maxY>s&&(s=r.maxY)}return{maxX:e,maxY:s}}#C(i,e){let s=c.#m,t=c.#l,r=c.#c,o=c.#S;for(let a of e){if(a.children.length===0||a.collapsed)continue;let h=a.x+t/2,l=a.y+r,n=l+o/2;for(let b of a.children){let u=b.x+t/2,f=b.y,m=document.createElementNS(s,"path");m.setAttribute("d",`M ${h} ${l} L ${h} ${n} L ${u} ${n} L ${u} ${f}`),m.setAttribute("fill","none"),m.setAttribute("stroke","#cbd5e1"),m.setAttribute("stroke-width","1.5"),i.appendChild(m)}this.#C(i,a.children)}}#E(i,e,s=""){let t=c.#m,r=c.#l,o=c.#c,a=this.#H,h=a>=4;for(let l=0;l<e.length;l++){let n=e[l],b=s?`${s}-${l}`:String(l),u=h?{stroke:"#94a3b8",fill:"#ffffff",text:"#475569"}:c.#L[n.pageType]||c.#L.page,f=document.createElementNS(t,"g");f.setAttribute("data-node-id",b),f.setAttribute("data-href",n.href),f.setAttribute("data-page-type",n.pageType),f.setAttribute("data-template",n.template),f.style.cursor="pointer";let m=document.createElementNS(t,"rect");if(m.setAttribute("x",String(n.x)),m.setAttribute("y",String(n.y)),m.setAttribute("width",String(r)),m.setAttribute("height",String(o)),m.setAttribute("rx","8"),m.setAttribute("fill",u.fill),m.setAttribute("stroke",u.stroke),m.setAttribute("stroke-width",h?"1":"2"),(h||n.pageType==="modal")&&m.setAttribute("stroke-dasharray","6 3"),f.appendChild(m),a>=1){let d=document.createElementNS(t,"text");d.setAttribute("x",String(n.x+r/2)),d.setAttribute("y",String(a===1?n.y+o/2+5:n.y+24)),d.setAttribute("text-anchor","middle"),d.setAttribute("font-size","13"),d.setAttribute("font-weight","600"),d.setAttribute("fill",u.text),d.setAttribute("font-family","system-ui, sans-serif"),d.textContent=n.label.length>18?n.label.slice(0,17)+"\u2026":n.label,f.appendChild(d)}if(a>=2){let d=document.createElementNS(t,"text");if(d.setAttribute("x",String(n.x+r/2)),d.setAttribute("y",String(n.y+40)),d.setAttribute("text-anchor","middle"),d.setAttribute("font-size","9"),d.setAttribute("font-weight","700"),d.setAttribute("fill",u.stroke),d.setAttribute("font-family","system-ui, sans-serif"),d.textContent=(y[n.pageType]?.label||n.pageType).toUpperCase(),f.appendChild(d),n.template){let p=document.createElementNS(t,"text");p.setAttribute("x",String(n.x+r/2)),p.setAttribute("y",String(n.y+54)),p.setAttribute("text-anchor","middle"),p.setAttribute("font-size","9"),p.setAttribute("fill","#94a3b8"),p.setAttribute("font-family","system-ui, sans-serif"),p.textContent=n.template,f.appendChild(p)}}if(a>=3&&n.status&&c.#T[n.status]){let d=document.createElementNS(t,"circle");d.setAttribute("cx",String(n.x+r/2)),d.setAttribute("cy",String(n.y+o-8)),d.setAttribute("r","4"),d.setAttribute("fill",h?"#94a3b8":c.#T[n.status]),f.appendChild(d)}if(h)for(let d=0;d<2;d++){let p=document.createElementNS(t,"line");p.setAttribute("x1",String(n.x+12)),p.setAttribute("x2",String(n.x+r-12)),p.setAttribute("y1",String(n.y+o-22+d*8)),p.setAttribute("y2",String(n.y+o-22+d*8)),p.setAttribute("stroke","#cbd5e1"),p.setAttribute("stroke-width","1"),p.setAttribute("stroke-dasharray","3 2"),f.appendChild(p)}if(n.children.length>0){let d=document.createElementNS(t,"g");d.setAttribute("data-toggle",b),d.style.cursor="pointer";let p=document.createElementNS(t,"circle");p.setAttribute("cx",String(n.x+r/2)),p.setAttribute("cy",String(n.y+o+10)),p.setAttribute("r","10"),p.setAttribute("fill",h?"#fff":"#f1f5f9"),p.setAttribute("stroke","#cbd5e1"),p.setAttribute("stroke-width","1"),d.appendChild(p);let g=document.createElementNS(t,"text");g.setAttribute("x",String(n.x+r/2)),g.setAttribute("y",String(n.y+o+14)),g.setAttribute("text-anchor","middle"),g.setAttribute("font-size","11"),g.setAttribute("font-weight","700"),g.setAttribute("fill","#64748b"),g.setAttribute("font-family","system-ui, sans-serif"),g.textContent=n.collapsed?`+${n.childCount}`:"\u2212",d.appendChild(g),f.appendChild(d)}i.appendChild(f),n.children.length>0&&!n.collapsed&&this.#E(i,n.children,b)}}#U(i){let e=this.#p(i,this.#e);if(!e)return;e.collapsed=!e.collapsed;let s=this.#y||i;this.#d(),requestAnimationFrame(()=>{this.#o(s);let t=this.#t?.querySelector('svg[role="tree"]');t&&t.focus({preventScroll:!0})})}#p(i,e){if(!e)return null;let s=i.split("-").map(Number),t=e,r=null;for(let o of s){if(!t||o>=t.length)return null;r=t[o],t=r.children}return r}async _loadSrc(i){if(i)try{let e=await fetch(i);if(!e.ok)throw new Error(`HTTP ${e.status}`);let s=await e.json();for(;this.firstChild;)this.firstChild.remove();s.title&&!this.getAttribute("title")&&this.setAttribute("title",s.title);let t=document.createElement("nav"),r=document.createElement("ul");this.#Y(r,s.pages||[]),t.appendChild(r),this.appendChild(t),this.teardown(),this.removeAttribute("data-upgraded"),this.setup()}catch(e){console.warn(`[site-map-wc] Failed to load src="${i}":`,e)}}#Y(i,e){for(let s of e){let t=document.createElement("li");s.pageType&&t.setAttribute("data-page-type",s.pageType),s.template&&t.setAttribute("data-template",s.template),s.status&&t.setAttribute("data-status",s.status);let r=document.createElement("a");if(r.href=s.href||"#",r.textContent=s.label||"",t.appendChild(r),s.children&&s.children.length>0){let o=document.createElement("ul");this.#Y(o,s.children),t.appendChild(o)}i.appendChild(t)}}};C("site-map-wc",S);export{S as SiteMapWc};
1
+ var T=window.matchMedia("(prefers-reduced-motion: reduce)");var q=new Map;function $(a,i,t={}){let e=t.priority??10,s={impl:i,bundle:t.bundle,contract:t.contract,priority:e},r=q.get(a);if(customElements.get(a)){if(!r||r.priority>=e){r&&r.priority===e&&r.impl!==i&&console.warn(`[VB Bundle] Tag <${a}> already registered by "${r.bundle}" (priority ${r.priority}). Skipping "${t.bundle}".`);return}console.warn(`[VB Bundle] Tag <${a}> defined by "${r.bundle}" cannot be replaced (customElements.define is permanent). "${t.bundle}" has higher priority but arrived late.`);return}if(r&&r.priority>=e){r.priority===e&&console.warn(`[VB Bundle] Tag <${a}> already registered by "${r.bundle}". Skipping "${t.bundle}" (first wins at equal priority).`);return}q.set(a,s),customElements.define(a,i)}var v=class extends HTMLElement{#p=[];#s;connectedCallback(){this.hasAttribute("data-upgraded")||this.setup()!==!1&&(this.setAttribute("data-upgraded",""),queueMicrotask(()=>{this.dispatchEvent(new CustomEvent(`${this.localName}:upgraded`,{bubbles:!0}))}))}disconnectedCallback(){for(let i of this.#p)i();this.#p=[],this.removeAttribute("data-upgraded"),this.teardown()}listen(i,t,e,s){i.addEventListener(t,e,s),this.#p.push(()=>i.removeEventListener(t,e,s))}setup(){}teardown(){}setState(i,t){this.#s||(this.#s=this.attachInternals());let e=this.#s.states;try{t?e.add(i):e.delete(i)}catch{let s=`--${i}`;t?e.add(s):e.delete(s)}}_adoptInternals(i){this.#s||(this.#s=i)}};var C={layout:{label:"Layout",cssClass:"sm-badge--layout"},section:{label:"Section",cssClass:"sm-badge--section"},dashboard:{label:"Dashboard",cssClass:"sm-badge--dashboard"},page:{label:"Page",cssClass:"sm-badge--page"},modal:{label:"Modal",cssClass:"sm-badge--modal"},redirect:{label:"Redirect",cssClass:"sm-badge--redirect"}},E={draft:{label:"Draft",cssClass:"sm-status--draft"},ready:{label:"Ready",cssClass:"sm-status--ready"},live:{label:"Live",cssClass:"sm-status--live"},deprecated:{label:"Deprecated",cssClass:"sm-status--deprecated"}},w=class a extends v{static get observedAttributes(){return["src","collapsed","compact","title","data-view","data-orientation","data-detail"]}static#p=0;#s=null;#i=null;#t=null;#b=null;#n=0;#o=0;setup(){a.#p++;let i=this.getAttribute("src");if(i&&!this.querySelector("nav")){this._loadSrc(i);return}let t=this.querySelector(":scope > nav");if(t){if(this.#n=0,this.#o=0,this.#w(t.querySelector("ul"),0),this.dataset.view==="visual"){this.#N(),this.#_(t),this.dispatchEvent(new CustomEvent("site-map-wc:ready",{bubbles:!0,detail:{nodeCount:this.#n,depth:this.#o}}));return}this.#k(t.querySelector("ul"),0),this.#N(),t.classList.add("sm-tree"),t.setAttribute("role","tree"),t.setAttribute("aria-label",this.getAttribute("title")||"Site map"),this.#s=t,this.hasAttribute("collapsed")&&this.#q(),this.listen(t,"keydown",e=>this.#J(e)),this.listen(t,"click",e=>this.#j(e)),this.dispatchEvent(new CustomEvent("site-map-wc:ready",{bubbles:!0,detail:{nodeCount:this.#n,depth:this.#o}}))}}teardown(){if(this.#t){this.#t.remove(),this.#t=null;let i=this.querySelector("nav");i&&(i.style.display="",i.removeAttribute("aria-hidden"))}this.#i&&(this.#i.remove(),this.#i=null),this.#s&&(this.#s.classList.remove("sm-tree"),this.#s.removeAttribute("role"),this.#s.removeAttribute("aria-label")),this.querySelectorAll(".sm-node-content, .sm-toggle").forEach(i=>i.remove()),this.querySelectorAll('li[role="treeitem"]').forEach(i=>{i.removeAttribute("role"),i.removeAttribute("aria-expanded"),i.removeAttribute("tabindex")}),this.querySelectorAll('ul[role="group"]').forEach(i=>{i.removeAttribute("role"),i.classList.remove("sm-subtree","sm-collapsed")}),this.#s=null,this.#b=null,this.#n=0,this.#o=0}attributeChangedCallback(i,t,e){t===e||!this.isConnected||i==="src"&&this._loadSrc(e)}#w(i,t){if(!i)return;let e=i.querySelectorAll(":scope > li");for(let s of e){this.#n++;let r=t+1;r>this.#o&&(this.#o=r);let l=s.querySelector(":scope > ul");l&&this.#w(l,r)}}#k(i,t){if(!i)return;t>0&&(i.setAttribute("role","group"),i.classList.add("sm-subtree"));let e=[...i.querySelectorAll(":scope > li")];for(let s of e){let r=!!s.querySelector(":scope > ul"),l=s.querySelector(":scope > a"),o=s.getAttribute("data-page-type")||"page",u=s.getAttribute("data-template")||"",p=s.getAttribute("data-status")||"";s.setAttribute("role","treeitem"),s.setAttribute("tabindex","-1");let n=document.createElement("span");if(n.className="sm-node-content",r){s.setAttribute("aria-expanded","true");let c=document.createElement("button");c.className="sm-toggle",c.setAttribute("type","button"),c.setAttribute("aria-hidden","true"),c.setAttribute("tabindex","-1"),c.textContent="\u25BE",n.appendChild(c)}else{let c=document.createElement("span");c.className="sm-leaf-marker",c.setAttribute("aria-hidden","true"),n.appendChild(c)}if(p&&E[p]){let c=document.createElement("span");c.className=`sm-status-dot ${E[p].cssClass}`,c.setAttribute("title",E[p].label),c.setAttribute("aria-label",E[p].label),n.appendChild(c)}if(l&&n.appendChild(l),C[o]){let c=document.createElement("span");c.className=`sm-badge ${C[o].cssClass}`,c.textContent=C[o].label,n.appendChild(c)}if(u){let c=document.createElement("span");c.className="sm-badge sm-badge--template",c.textContent=u,n.appendChild(c)}s.insertBefore(n,s.firstChild);let f=s.querySelector(":scope > ul");f&&this.#k(f,t+1)}}#N(){let i=this.getAttribute("title");if(!i&&this.#n===0)return;if(this.#i=document.createElement("div"),this.#i.className="sm-header",i){let s=document.createElement("h2");s.className="sm-title",s.textContent=i,this.#i.appendChild(s)}let t=document.createElement("span");t.className="sm-summary",t.textContent=`${this.#n} pages \xB7 ${this.#o} levels deep`,this.#i.appendChild(t);let e=document.createElement("button");e.className="sm-toggle-all",e.setAttribute("type","button"),e.textContent="Collapse all",e.addEventListener("click",()=>{this.querySelectorAll('li[aria-expanded="true"]').length>0?(this.#q(),e.textContent="Expand all"):(this.#X(),e.textContent="Collapse all")}),this.#i.appendChild(e),this.insertBefore(this.#i,this.firstChild)}#q(){let i=this.querySelectorAll("li[aria-expanded]");for(let t of i){t.setAttribute("aria-expanded","false");let e=t.querySelector(":scope > ul");e&&e.classList.add("sm-collapsed");let s=t.querySelector(":scope > .sm-node-content > .sm-toggle");s&&(s.textContent="\u25B8")}}#X(){let i=this.querySelectorAll("li[aria-expanded]");for(let t of i){t.setAttribute("aria-expanded","true");let e=t.querySelector(":scope > ul");e&&e.classList.remove("sm-collapsed");let s=t.querySelector(":scope > .sm-node-content > .sm-toggle");s&&(s.textContent="\u25BE")}}#m(i){let t=i.getAttribute("aria-expanded")==="true";i.setAttribute("aria-expanded",t?"false":"true");let e=i.querySelector(":scope > ul");e&&e.classList.toggle("sm-collapsed",t);let s=i.querySelector(":scope > .sm-node-content > .sm-toggle");s&&(s.textContent=t?"\u25B8":"\u25BE")}#j(i){let t=i.target;if(t.closest(".sm-toggle")){i.preventDefault();let r=t.closest('li[role="treeitem"]');r&&this.#m(r);return}let e=t.closest('li[role="treeitem"]');if(!e)return;this.#a(e);let s=t.closest("a");s&&this.dispatchEvent(new CustomEvent("site-map-wc:select",{bubbles:!0,detail:{href:s.getAttribute("href")||"",pageType:e.getAttribute("data-page-type")||"page",template:e.getAttribute("data-template")||""}}))}#J(i){let t=i.target.closest('li[role="treeitem"]');if(!t)return;let e=i.key,s=!1;switch(e){case"ArrowDown":s=!0,this.#K(t);break;case"ArrowUp":s=!0,this.#Z(t);break;case"ArrowRight":if(s=!0,t.getAttribute("aria-expanded")==="false")this.#m(t);else if(t.getAttribute("aria-expanded")==="true"){let r=t.querySelector(':scope > ul > li[role="treeitem"]');r&&this.#a(r)}break;case"ArrowLeft":if(s=!0,t.getAttribute("aria-expanded")==="true")this.#m(t);else{let r=t.parentElement?.closest('li[role="treeitem"]');r&&this.#a(r)}break;case"Enter":s=!0,t.hasAttribute("aria-expanded")&&this.#m(t);break;case" ":s=!0;{let r=t.querySelector(":scope > .sm-node-content > a");r&&r.click()}break;case"Home":s=!0;{let r=this.querySelector('li[role="treeitem"]');r&&this.#a(r)}break;case"End":s=!0;{let r=this.#x();r.length&&this.#a(r[r.length-1])}break}s&&(i.preventDefault(),i.stopPropagation())}#x(){let i=[],t=s=>{if(!s)return;let r=[...s.querySelectorAll(':scope > li[role="treeitem"]')];for(let l of r)if(i.push(l),l.getAttribute("aria-expanded")==="true"){let o=l.querySelector(":scope > ul");o&&t(o)}},e=this.querySelector("nav > ul");return t(e),i}#K(i){let t=this.#x(),e=t.indexOf(i);e>=0&&e<t.length-1&&this.#a(t[e+1])}#Z(i){let t=this.#x(),e=t.indexOf(i);e>0&&this.#a(t[e-1])}#a(i){this.#b&&this.#b.setAttribute("tabindex","-1"),i.setAttribute("tabindex","0"),i.focus(),this.#b=i}static#g="http://www.w3.org/2000/svg";static#c=150;static#d=70;static#$=30;static#S=50;static#Q=20;static#T={layout:{stroke:"#8b5cf6",fill:"#f5f3ff",text:"#6d28d9"},section:{stroke:"#3b82f6",fill:"#eff6ff",text:"#1d4ed8"},dashboard:{stroke:"#22c55e",fill:"#f0fdf4",text:"#15803d"},page:{stroke:"#94a3b8",fill:"#f8fafc",text:"#475569"},modal:{stroke:"#f59e0b",fill:"#fffbeb",text:"#b45309"},redirect:{stroke:"#ef4444",fill:"#fef2f2",text:"#b91c1c"}};static#L={draft:"#94a3b8",ready:"#f59e0b",live:"#22c55e",deprecated:"#ef4444"};#M(i){let t=[];for(let e of i.querySelectorAll(":scope > li")){let s=e.querySelector(":scope > a"),r=e.querySelector(":scope > ul");t.push({label:s?.textContent?.trim()||e.firstChild?.textContent?.trim()||"",href:s?.getAttribute("href")||"",pageType:e.getAttribute("data-page-type")||"page",template:e.getAttribute("data-template")||"",status:e.getAttribute("data-status")||"",children:r?this.#M(r):[],x:0,y:0,subtreeWidth:0,collapsed:!1,childCount:0})}return t}#B(i,t=0){let e=a.#c,s=a.#d,r=a.#$,l=a.#S;for(let o of i)o.childCount=this.#I(o),o.children.length>0&&!o.collapsed?(this.#B(o.children,t+1),o.subtreeWidth=o.children.reduce((u,p)=>u+p.subtreeWidth,0)+r*(o.children.length-1)):o.subtreeWidth=e,o.subtreeWidth=Math.max(o.subtreeWidth,e)}#I(i){let t=0;for(let e of i.children)t+=1+this.#I(e);return t}#z(i,t,e){let s=a.#c,r=a.#d,l=a.#$,o=a.#S,u=t;for(let p of i)p.x=u+(p.subtreeWidth-s)/2,p.y=e,p.children.length>0&&!p.collapsed&&this.#z(p.children,u,e+r+o),u+=p.subtreeWidth+l}#_(i){i.style.display="none",i.setAttribute("aria-hidden","true");let t=i.querySelector("ul");t&&(this.#e=this.#M(t),this.#u())}#e=null;#r=1;get#v(){return this.dataset.orientation==="horizontal"?"horizontal":"vertical"}get#D(){return Math.min(4,Math.max(0,parseInt(this.dataset.detail||"2",10)))}static#y={zoomIn:'<circle cx="11" cy="11" r="8"/><line x1="21" x2="16.65" y1="21" y2="16.65"/><line x1="11" x2="11" y1="8" y2="14"/><line x1="8" x2="14" y1="11" y2="11"/>',zoomOut:'<circle cx="11" cy="11" r="8"/><line x1="21" x2="16.65" y1="21" y2="16.65"/><line x1="8" x2="14" y1="11" y2="11"/>',reset:'<path d="M15 3h6v6"/><path d="m21 3-7 7"/><path d="m3 21 7-7"/><path d="M9 21H3v-6"/>',flip:'<path d="M21 8V5a2 2 0 0 0-2-2H5a2 2 0 0 0-2 2v3"/><path d="M21 16v3a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-3"/><path d="M4 12H2"/><path d="M10 12H8"/><path d="M16 12h-2"/><path d="M22 12h-2"/>'};static#H=["Shape","Shape + Title","Full","Full + Status","Wireframe"];static#tt=0;#et(i){let t=this.#t?.querySelector(".sm-visual-scroll"),e=this.#t?.querySelector('svg[role="tree"]'),s={nodeId:null,rectTop:0,rectLeft:0,focusId:this.#h};if(!t||!e)return s;let r=i||this.#h;if(!r)return s;let o=e.querySelector(`[data-node-id="${r}"]`)?.querySelector("rect");if(!o)return s;let u=o.getBoundingClientRect(),p=t.getBoundingClientRect();return s.nodeId=r,s.rectTop=u.top-p.top,s.rectLeft=u.left-p.left,s}#P(i){let t=this.#t?.querySelector(".sm-visual-scroll"),e=this.#t?.querySelector('svg[role="tree"]');if(!(!t||!e)){if(i.nodeId){let r=e.querySelector(`[data-node-id="${i.nodeId}"]`)?.querySelector("rect");if(r){let l=r.getBoundingClientRect(),o=t.getBoundingClientRect(),u=l.top-o.top-i.rectTop,p=l.left-o.left-i.rectLeft;t.scrollTop+=u,t.scrollLeft+=p}}i.focusId&&(this.#l(i.focusId),e.focus({preventScroll:!0}))}}#u(i={}){if(!this.#e)return;let t=this.#et(i.anchorId||null),e=this.#t,s=a.#g,r=a.#c,l=a.#d,o=a.#Q,u=this.#v==="horizontal";this.#B(this.#e),this.#z(this.#e,o,o);let p=this.#R(this.#e),n=p.maxX+r+o,f=p.maxY+l+o;u&&([n,f]=[f,n]),this.#t=document.createElement("div"),this.#t.className="sm-visual",this.#t.setAttribute("tabindex","-1"),this.#t.appendChild(this.#st());let c=document.createElement("div");c.className="sm-visual-scroll";let h=document.createElementNS(s,"svg");h.setAttribute("viewBox",`0 0 ${n} ${f}`),h.setAttribute("width",String(n)),h.setAttribute("height",String(f)),h.setAttribute("role","img"),h.setAttribute("aria-label",`Site map${this.getAttribute("title")?": "+this.getAttribute("title"):""}`);let m=document.createElement("div");if(m.className="sm-visual-zoom",m.style.width=`${Math.round(n*this.#r)}px`,m.style.height=`${Math.round(f*this.#r)}px`,h.style.transform=`scale(${this.#r})`,h.style.transformOrigin="0 0",u){let y=document.createElementNS(s,"g");y.setAttribute("transform",`rotate(90 0 0) translate(0 -${f})`),this.#C(y,this.#e),this.#E(y,this.#e),h.appendChild(y)}else this.#C(h,this.#e),this.#E(h,this.#e);m.appendChild(h),c.appendChild(m),this.#t.appendChild(c);let d=document.createElement("div");d.className="sm-visual-summary";let b=Math.round(this.#r*100);d.textContent=`${this.#n} pages \xB7 ${this.#o} levels \xB7 ${b}%`,this.#t.appendChild(d);let g=this.#t,k=()=>{e&&e.isConnected?e.replaceWith(g):this.appendChild(g)};if(e?.isConnected&&"startViewTransition"in document&&!matchMedia("(prefers-reduced-motion: reduce)").matches){let y=`sm-vt-${++a.#tt}`;e.style.viewTransitionName=y,g.style.viewTransitionName=y;let A=document.startViewTransition(k);A.finished.finally(()=>{g.style.viewTransitionName=""}),A.updateCallbackDone.then(()=>this.#P(t))}else k(),this.#P(t);this.#ot(this.#t,h),this.listen(h,"click",y=>{let A=y.target,N=A.closest("[data-toggle]");if(N){let S=N.getAttribute("data-toggle");S&&this.#U(S);return}let x=A.closest("[data-node-id]");if(x){let S=x.getAttribute("data-node-id");S&&this.#l(S),this.dispatchEvent(new CustomEvent("site-map-wc:select",{bubbles:!0,detail:{href:x.getAttribute("data-href")||"",pageType:x.getAttribute("data-page-type")||"page",template:x.getAttribute("data-template")||""}}))}}),h.setAttribute("tabindex","0"),h.setAttribute("role","tree"),h.setAttribute("aria-label",`Site map${this.getAttribute("title")?": "+this.getAttribute("title"):""} \u2014 use arrow keys to navigate`),h.addEventListener("keydown",y=>this.#rt(y)),requestAnimationFrame(()=>{let y=h.querySelector("[data-node-id]");y&&this.#W(y)})}#st(){let i=document.createElement("div");i.className="sm-vtoolbar",i.setAttribute("role","toolbar"),i.setAttribute("aria-label","Site map controls");let t=h=>`<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">${h}</svg>`,e=this.#A(t(a.#y.zoomIn),"Zoom in",()=>{this.#r=Math.min(3,this.#r+.25),this.#u()});i.appendChild(e);let s=this.#A(t(a.#y.zoomOut),"Zoom out",()=>{this.#r=Math.max(.25,this.#r-.25),this.#u()});i.appendChild(s);let r=this.#A(t(a.#y.reset),"Reset zoom",()=>{this.#r=1,this.#u()});i.appendChild(r);let l=document.createElement("span");l.className="sm-vtoolbar-sep",i.appendChild(l);let o=this.#v==="horizontal"?"Vertical":"Horizontal",u=this.#A(t(a.#y.flip),o,()=>{this.dataset.orientation=this.#v==="horizontal"?"vertical":"horizontal",this.#u()});i.appendChild(u),i.appendChild(l.cloneNode());let p=this.#D,n=document.createElement("label");n.className="sm-vtoolbar-detail",n.textContent="Detail ";let f=document.createElement("input");f.type="range",f.min="0",f.max="4",f.value=String(p),f.setAttribute("aria-label","Detail level"),f.className="sm-vtoolbar-slider",n.appendChild(f);let c=document.createElement("span");return c.className="sm-vtoolbar-detail-label",c.textContent=a.#H[p],n.appendChild(c),f.addEventListener("input",()=>{this.dataset.detail=f.value,c.textContent=a.#H[parseInt(f.value,10)],this.#u()}),i.appendChild(n),i}#A(i,t,e){let s=document.createElement("button");return s.type="button",s.className="sm-vtoolbar-btn",s.innerHTML=i,s.setAttribute("aria-label",t),s.setAttribute("title",t),s.addEventListener("click",e),s}#h=null;#O(i,t=""){let e=[];for(let s=0;s<i.length;s++){let r=i[s],l=t?`${t}-${s}`:String(s);e.push(l),r.children.length>0&&!r.collapsed&&e.push(...this.#O(r.children,l))}return e}#it(i){let t=i.lastIndexOf("-");return t>0?i.slice(0,t):null}#lt(i){let t=this.#f(i,this.#e);return!t||t.collapsed||t.children.length===0?null:`${i}-0`}#l(i){if(!i||!this.#t)return;let t=this.#t.querySelector('svg[role="tree"]');if(!t)return;let e=t.querySelector(`[data-node-id="${i}"]`);if(!e)return;this.#W(e),this.#h=i;let s=e.querySelector("rect"),r=this.#t?.querySelector(".sm-visual-scroll");if(s&&r){let l=s.getBoundingClientRect(),o=r.getBoundingClientRect();(l.left<o.left||l.right>o.right||l.top<o.top||l.bottom>o.bottom)&&s.scrollIntoView({behavior:"smooth",block:"nearest",inline:"nearest"})}}#W(i){let t=i.closest("svg");if(!t)return;t.querySelectorAll(".sm-vfocus-ring").forEach(r=>r.remove()),t.querySelectorAll("[data-node-id]").forEach(r=>r.removeAttribute("aria-current"));let e=a.#g,s=i.querySelector("rect");if(s){let r=document.createElementNS(e,"rect");r.setAttribute("x",String(parseFloat(s.getAttribute("x")??"0")-3)),r.setAttribute("y",String(parseFloat(s.getAttribute("y")??"0")-3)),r.setAttribute("width",String(parseFloat(s.getAttribute("width")??"0")+6)),r.setAttribute("height",String(parseFloat(s.getAttribute("height")??"0")+6)),r.setAttribute("rx","11"),r.setAttribute("fill","none"),r.setAttribute("stroke","#3b82f6"),r.setAttribute("stroke-width","2"),r.setAttribute("class","sm-vfocus-ring"),i.parentNode?.insertBefore(r,i)}i.setAttribute("aria-current","true"),this.#h=i.getAttribute("data-node-id")}#rt(i){if(!this.#e)return;let t=this.#h||"0",e=!1;switch(i.key){case"ArrowDown":{e=!0;let s=this.#f(t,this.#e);s&&s.children.length>0&&!s.collapsed&&this.#l(`${t}-0`);break}case"ArrowUp":{e=!0;let s=this.#it(t);s&&this.#l(s);break}case"ArrowRight":{e=!0;let s=this.#F(t,1);s&&this.#l(s);break}case"ArrowLeft":{e=!0;let s=this.#F(t,-1);s&&this.#l(s);break}case"Enter":case" ":{e=!0;let s=this.#f(t,this.#e);s&&s.children.length>0&&this.#U(t);break}case"Home":{e=!0,this.#l("0");break}case"End":{e=!0;let s=this.#O(this.#e);s.length&&this.#l(s[s.length-1]);break}}e&&(i.preventDefault(),i.stopPropagation())}#F(i,t){let e=i.split("-").map(Number),s=e[e.length-1]+t;if(s<0)return null;let r=e.length>1?e.slice(0,-1).join("-"):null,l=r?this.#f(r,this.#e):null,o=l?l.children:this.#e;if(!o||s>=o.length)return null;let u=[...e];return u[u.length-1]=s,u.join("-")}#V=!1;#nt={dragging:!1,startX:0,startY:0,scrollLeft:0,scrollTop:0,moved:!1};#ot(i,t){if(t.style.cursor="grab",this.#V)return;this.#V=!0;let e=this.#nt;this.listen(this,"pointerdown",s=>{let r=s;if(r.target.closest("button, [data-toggle], .sm-vtoolbar, input"))return;let l=this.querySelector(".sm-visual-scroll");if(!l)return;e.dragging=!0,e.moved=!1,e.startX=r.clientX,e.startY=r.clientY,e.scrollLeft=l.scrollLeft,e.scrollTop=l.scrollTop;let o=this.querySelector('svg[role="tree"]');o&&(o.style.cursor="grabbing")}),this.listen(window,"pointermove",s=>{if(!e.dragging)return;let r=s,l=r.clientX-e.startX,o=r.clientY-e.startY;(Math.abs(l)>3||Math.abs(o)>3)&&(e.moved=!0);let u=this.querySelector(".sm-visual-scroll");u&&(u.scrollLeft=e.scrollLeft-l,u.scrollTop=e.scrollTop-o)}),this.listen(window,"pointerup",()=>{if(!e.dragging)return;e.dragging=!1;let s=this.querySelector('svg[role="tree"]');s&&(s.style.cursor="grab")}),this.listen(this,"click",s=>{e.moved&&(s.stopPropagation(),e.moved=!1)},{capture:!0})}#R(i){let t=0,e=0;for(let s of i)if(s.x+a.#c>t&&(t=s.x+a.#c),s.y+a.#d>e&&(e=s.y+a.#d),s.children.length>0&&!s.collapsed){let r=this.#R(s.children);r.maxX>t&&(t=r.maxX),r.maxY>e&&(e=r.maxY)}return{maxX:t,maxY:e}}#C(i,t){let e=a.#g,s=a.#c,r=a.#d,l=a.#S;for(let o of t){if(o.children.length===0||o.collapsed)continue;let u=o.x+s/2,p=o.y+r,n=p+l/2;for(let f of o.children){let c=f.x+s/2,h=f.y,m=document.createElementNS(e,"path");m.setAttribute("d",`M ${u} ${p} L ${u} ${n} L ${c} ${n} L ${c} ${h}`),m.setAttribute("fill","none"),m.setAttribute("stroke","#cbd5e1"),m.setAttribute("stroke-width","1.5"),i.appendChild(m)}this.#C(i,o.children)}}#E(i,t,e=""){let s=a.#g,r=a.#c,l=a.#d,o=this.#D,u=o>=4;for(let p=0;p<t.length;p++){let n=t[p],f=e?`${e}-${p}`:String(p),c=u?{stroke:"#94a3b8",fill:"#ffffff",text:"#475569"}:a.#T[n.pageType]||a.#T.page,h=document.createElementNS(s,"g");h.setAttribute("data-node-id",f),h.setAttribute("data-href",n.href),h.setAttribute("data-page-type",n.pageType),h.setAttribute("data-template",n.template),h.style.cursor="pointer";let m=document.createElementNS(s,"rect");if(m.setAttribute("x",String(n.x)),m.setAttribute("y",String(n.y)),m.setAttribute("width",String(r)),m.setAttribute("height",String(l)),m.setAttribute("rx","8"),m.setAttribute("fill",c.fill),m.setAttribute("stroke",c.stroke),m.setAttribute("stroke-width",u?"1":"2"),(u||n.pageType==="modal")&&m.setAttribute("stroke-dasharray","6 3"),h.appendChild(m),o>=1){let d=document.createElementNS(s,"text");d.setAttribute("x",String(n.x+r/2)),d.setAttribute("y",String(o===1?n.y+l/2+5:n.y+24)),d.setAttribute("text-anchor","middle"),d.setAttribute("font-size","13"),d.setAttribute("font-weight","600"),d.setAttribute("fill",c.text),d.setAttribute("font-family","system-ui, sans-serif"),d.textContent=n.label.length>18?n.label.slice(0,17)+"\u2026":n.label,h.appendChild(d)}if(o>=2){let d=document.createElementNS(s,"text");if(d.setAttribute("x",String(n.x+r/2)),d.setAttribute("y",String(n.y+40)),d.setAttribute("text-anchor","middle"),d.setAttribute("font-size","9"),d.setAttribute("font-weight","700"),d.setAttribute("fill",c.stroke),d.setAttribute("font-family","system-ui, sans-serif"),d.textContent=(C[n.pageType]?.label||n.pageType).toUpperCase(),h.appendChild(d),n.template){let b=document.createElementNS(s,"text");b.setAttribute("x",String(n.x+r/2)),b.setAttribute("y",String(n.y+54)),b.setAttribute("text-anchor","middle"),b.setAttribute("font-size","9"),b.setAttribute("fill","#94a3b8"),b.setAttribute("font-family","system-ui, sans-serif"),b.textContent=n.template,h.appendChild(b)}}if(o>=3&&n.status&&a.#L[n.status]){let d=document.createElementNS(s,"circle");d.setAttribute("cx",String(n.x+r/2)),d.setAttribute("cy",String(n.y+l-8)),d.setAttribute("r","4"),d.setAttribute("fill",u?"#94a3b8":a.#L[n.status]),h.appendChild(d)}if(u)for(let d=0;d<2;d++){let b=document.createElementNS(s,"line");b.setAttribute("x1",String(n.x+12)),b.setAttribute("x2",String(n.x+r-12)),b.setAttribute("y1",String(n.y+l-22+d*8)),b.setAttribute("y2",String(n.y+l-22+d*8)),b.setAttribute("stroke","#cbd5e1"),b.setAttribute("stroke-width","1"),b.setAttribute("stroke-dasharray","3 2"),h.appendChild(b)}if(n.children.length>0){let d=document.createElementNS(s,"g");d.setAttribute("data-toggle",f),d.style.cursor="pointer";let b=document.createElementNS(s,"circle");b.setAttribute("cx",String(n.x+r/2)),b.setAttribute("cy",String(n.y+l+10)),b.setAttribute("r","10"),b.setAttribute("fill",u?"#fff":"#f1f5f9"),b.setAttribute("stroke","#cbd5e1"),b.setAttribute("stroke-width","1"),d.appendChild(b);let g=document.createElementNS(s,"text");g.setAttribute("x",String(n.x+r/2)),g.setAttribute("y",String(n.y+l+14)),g.setAttribute("text-anchor","middle"),g.setAttribute("font-size","11"),g.setAttribute("font-weight","700"),g.setAttribute("fill","#64748b"),g.setAttribute("font-family","system-ui, sans-serif"),g.textContent=n.collapsed?`+${n.childCount}`:"\u2212",d.appendChild(g),h.appendChild(d)}i.appendChild(h),n.children.length>0&&!n.collapsed&&this.#E(i,n.children,f)}}#U(i){let t=this.#f(i,this.#e);t&&(t.collapsed=!t.collapsed,this.#h||(this.#h=i),this.#u({anchorId:i}))}#f(i,t){if(!t)return null;let e=i.split("-").map(Number),s=t,r=null;for(let l of e){if(!s||l>=s.length)return null;r=s[l],s=r.children}return r}async _loadSrc(i){if(i)try{let t=await fetch(i);if(!t.ok)throw new Error(`HTTP ${t.status}`);let e=await t.json();e.title&&!this.getAttribute("title")&&this.setAttribute("title",e.title),this._setPages(e.pages||[])}catch(t){console.warn(`[site-map-wc] Failed to load src="${i}":`,t)}}get pages(){let t=this.querySelector(":scope > nav")?.querySelector("ul");return t?this.#Y(t):[]}set pages(i){this._setPages(Array.isArray(i)?i:[]),this.dispatchEvent(new CustomEvent("site-map-wc:pages-changed",{detail:{pages:this.pages,source:"property"},bubbles:!0}))}_setPages(i){for(;this.firstChild;)this.firstChild.remove();let t=document.createElement("nav"),e=document.createElement("ul");this.#G(e,i),t.appendChild(e),this.appendChild(t),this.teardown(),this.removeAttribute("data-upgraded"),this.setup()}#Y(i){let t=[];for(let e of i.querySelectorAll(":scope > li")){let s=e.querySelector(":scope > a"),r=e.querySelector(":scope > ul"),l={label:s?.textContent?.trim()||"",href:s?.getAttribute("href")||void 0,pageType:e.getAttribute("data-page-type")||void 0,template:e.getAttribute("data-template")||void 0,status:e.getAttribute("data-status")||void 0};r&&(l.children=this.#Y(r)),t.push(l)}return t}#G(i,t){for(let e of t){let s=document.createElement("li");e.pageType&&s.setAttribute("data-page-type",e.pageType),e.template&&s.setAttribute("data-template",e.template),e.status&&s.setAttribute("data-status",e.status);let r=document.createElement("a");if(r.href=e.href||"#",r.textContent=e.label||"",s.appendChild(r),e.children&&e.children.length>0){let l=document.createElement("ul");this.#G(l,e.children),s.appendChild(l)}i.appendChild(s)}}};$("site-map-wc",w);export{w as SiteMapWc};
2
2
  //# sourceMappingURL=site-map-wc.js.map
@@ -1,2 +1,2 @@
1
- var u=window.matchMedia("(prefers-reduced-motion: reduce)");var l=new Map;function d(i,n,e={}){let t=e.priority??10,o={impl:n,bundle:e.bundle,contract:e.contract,priority:t},r=l.get(i);if(customElements.get(i)){if(!r||r.priority>=t){r&&r.priority===t&&r.impl!==n&&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>=t){r.priority===t&&console.warn(`[VB Bundle] Tag <${i}> already registered by "${r.bundle}". Skipping "${e.bundle}" (first wins at equal priority).`);return}l.set(i,o),customElements.define(i,n)}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 n of this.#e)n();this.#e=[],this.removeAttribute("data-upgraded"),this.teardown()}listen(n,e,t,o){n.addEventListener(e,t,o),this.#e.push(()=>n.removeEventListener(e,t,o))}setup(){}teardown(){}};var c=class extends s{setup(){this.#e(),this.#t(),this.#r(),this.getAttribute("src")&&this.#o()}#e(){let n=this.getAttribute("current")||window.location.pathname,e=this.querySelectorAll("a");for(let t of e)new URL(t.href,window.location.origin).pathname===n&&t.setAttribute("aria-current","page")}#t(){let n=this.querySelector('[aria-current="page"]');if(!n)return;let e=n.parentElement;for(;e&&e!==this;)e.tagName==="DETAILS"&&(e.open=!0),e=e.parentElement}#r(){let n=this.querySelectorAll("details");if(!n.length)return;let e=document.createElement("nav");e.setAttribute("data-sitemap-controls",""),e.setAttribute("aria-label","Sitemap controls");let t=document.createElement("button");t.type="button",t.textContent="Expand all",t.addEventListener("click",()=>{for(let r of n)r.open=!0});let o=document.createElement("button");o.type="button",o.textContent="Collapse all",o.addEventListener("click",()=>{for(let r of n)r.open=!1;this.#t()}),e.append(t,o),this.prepend(e)}async#o(){let n=this.getAttribute("src");if(n)try{let e=await fetch(n);if(!e.ok)return;let t=await e.json();this.#i(t)}catch{}}#i(n){if(!n||!Array.isArray(n.children))return;let e=document.createElement("nav");e.setAttribute("aria-label","Full site map"),e.append(this.#n(n.children));let t=this.querySelector("nav");t?t.replaceWith(e):this.append(e),this.#e(),this.#t()}#n(n){let e=document.createElement("ul");for(let t of n){let o=document.createElement("li");if(t.children?.length){let r=document.createElement("details"),a=document.createElement("summary");a.textContent=t.title,r.append(a),r.append(this.#n(t.children)),o.append(r)}else{let r=document.createElement("a");r.href=t.href||t.path,r.textContent=t.title,o.append(r)}e.append(o)}return e}};d("site-map",c);export{c as SiteMap};
1
+ var u=window.matchMedia("(prefers-reduced-motion: reduce)");var l=new Map;function d(i,n,e={}){let t=e.priority??10,o={impl:n,bundle:e.bundle,contract:e.contract,priority:t},r=l.get(i);if(customElements.get(i)){if(!r||r.priority>=t){r&&r.priority===t&&r.impl!==n&&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>=t){r.priority===t&&console.warn(`[VB Bundle] Tag <${i}> already registered by "${r.bundle}". Skipping "${e.bundle}" (first wins at equal priority).`);return}l.set(i,o),customElements.define(i,n)}var s=class extends HTMLElement{#t=[];#e;connectedCallback(){this.hasAttribute("data-upgraded")||this.setup()!==!1&&(this.setAttribute("data-upgraded",""),queueMicrotask(()=>{this.dispatchEvent(new CustomEvent(`${this.localName}:upgraded`,{bubbles:!0}))}))}disconnectedCallback(){for(let n of this.#t)n();this.#t=[],this.removeAttribute("data-upgraded"),this.teardown()}listen(n,e,t,o){n.addEventListener(e,t,o),this.#t.push(()=>n.removeEventListener(e,t,o))}setup(){}teardown(){}setState(n,e){this.#e||(this.#e=this.attachInternals());let t=this.#e.states;try{e?t.add(n):t.delete(n)}catch{let o=`--${n}`;e?t.add(o):t.delete(o)}}_adoptInternals(n){this.#e||(this.#e=n)}};var c=class extends s{setup(){this.#t(),this.#e(),this.#r(),this.getAttribute("src")&&this.#o()}#t(){let n=this.getAttribute("current")||window.location.pathname,e=this.querySelectorAll("a");for(let t of e)new URL(t.href,window.location.origin).pathname===n&&t.setAttribute("aria-current","page")}#e(){let n=this.querySelector('[aria-current="page"]');if(!n)return;let e=n.parentElement;for(;e&&e!==this;)e.tagName==="DETAILS"&&(e.open=!0),e=e.parentElement}#r(){let n=this.querySelectorAll("details");if(!n.length)return;let e=document.createElement("nav");e.setAttribute("data-sitemap-controls",""),e.setAttribute("aria-label","Sitemap controls");let t=document.createElement("button");t.type="button",t.textContent="Expand all",t.addEventListener("click",()=>{for(let r of n)r.open=!0});let o=document.createElement("button");o.type="button",o.textContent="Collapse all",o.addEventListener("click",()=>{for(let r of n)r.open=!1;this.#e()}),e.append(t,o),this.prepend(e)}async#o(){let n=this.getAttribute("src");if(n)try{let e=await fetch(n);if(!e.ok)return;let t=await e.json();this.#i(t)}catch{}}#i(n){if(!n||!Array.isArray(n.children))return;let e=document.createElement("nav");e.setAttribute("aria-label","Full site map"),e.append(this.#n(n.children));let t=this.querySelector("nav");t?t.replaceWith(e):this.append(e),this.#t(),this.#e()}#n(n){let e=document.createElement("ul");for(let t of n){let o=document.createElement("li");if(t.children?.length){let r=document.createElement("details"),a=document.createElement("summary");a.textContent=t.title,r.append(a),r.append(this.#n(t.children)),o.append(r)}else{let r=document.createElement("a");r.href=t.href||t.path,r.textContent=t.title,o.append(r)}e.append(o)}return e}};d("site-map",c);export{c as SiteMap};
2
2
  //# sourceMappingURL=site-map.js.map
@@ -1,6 +1,6 @@
1
- var v=/Mac|iPhone|iPad|iPod/.test(navigator.platform??"");function u(i){let e=i.toLowerCase().split("+").map(s=>s.trim());return{key:e.pop()??"",meta:e.includes("meta")||e.includes("cmd"),ctrl:e.includes("ctrl"),shift:e.includes("shift"),alt:e.includes("alt")}}function h(i,e){if(i.key.toLowerCase()!==e.key)return!1;let t,s;return v?(t=e.meta,s=e.ctrl):(t=!1,s=e.meta||e.ctrl),!(t!==i.metaKey||s!==i.ctrlKey||e.shift!==i.shiftKey||e.alt!==i.altKey)}var g=new Set(["INPUT","TEXTAREA","SELECT"]),a=[],f=!1;function k(i){let e=g.has(i.target.tagName)||i.target.isContentEditable;for(let t of a)if(!(e&&!t.global)&&h(i,t.descriptor)){i.preventDefault(),t.callback(i);return}}function w(){f||(document.addEventListener("keydown",k),f=!0)}function p(i,e,t={}){w();let s=u(i),n={combo:i,descriptor:s,callback:e,global:t.global===!0};return a.find(l=>l.combo===i)&&console.warn(`[hotkey-bind] Shortcut "${i}" already bound. Last-connected-wins.`),a.unshift(n),function(){let d=a.indexOf(n);d!==-1&&a.splice(d,1)}}function b(){return a.map(i=>i.combo)}var A=window.matchMedia("(prefers-reduced-motion: reduce)");var m=new Map;function y(i,e,t={}){let s=t.priority??10,n={impl:e,bundle:t.bundle,contract:t.contract,priority:s},r=m.get(i);if(customElements.get(i)){if(!r||r.priority>=s){r&&r.priority===s&&r.impl!==e&&console.warn(`[VB Bundle] Tag <${i}> already registered by "${r.bundle}" (priority ${r.priority}). Skipping "${t.bundle}".`);return}console.warn(`[VB Bundle] Tag <${i}> defined by "${r.bundle}" cannot be replaced (customElements.define is permanent). "${t.bundle}" has higher priority but arrived late.`);return}if(r&&r.priority>=s){r.priority===s&&console.warn(`[VB Bundle] Tag <${i}> already registered by "${r.bundle}". Skipping "${t.bundle}" (first wins at equal priority).`);return}m.set(i,n),customElements.define(i,e)}var o=class extends HTMLElement{#c=[];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.#c)e();this.#c=[],this.removeAttribute("data-upgraded"),this.teardown()}listen(e,t,s,n){e.addEventListener(t,s,n),this.#c.push(()=>e.removeEventListener(t,s,n))}setup(){}teardown(){}};var c=class i extends o{static#c=150;static#m=8;#e=null;#t=null;#i=null;#s=null;#r=[];#a=-1;#n=!1;#o=null;#l=null;#u=null;setup(){this.#y(),this.#v()}teardown(){this.#n&&(document.body.style.overflow="",this.removeAttribute("open"),this.#n=!1),this.#u?.(),this.#d()}#y(){this.#e=this.querySelector(":scope > [data-trigger]"),this.#e||(this.#e=this.querySelector(":scope > button")),this.#e||(this.#e=document.createElement("button"),this.#e.setAttribute("data-trigger",""),this.#e.innerHTML=`
1
+ var v=/Mac|iPhone|iPad|iPod/.test(navigator.platform??"");function d(s){let t=s.toLowerCase().split("+").map(i=>i.trim());return{key:t.pop()??"",meta:t.includes("meta")||t.includes("cmd"),ctrl:t.includes("ctrl"),shift:t.includes("shift"),alt:t.includes("alt")}}function h(s,t){if(s.key.toLowerCase()!==t.key)return!1;let e,i;return v?(e=t.meta,i=t.ctrl):(e=!1,i=t.meta||t.ctrl),!(e!==s.metaKey||i!==s.ctrlKey||t.shift!==s.shiftKey||t.alt!==s.altKey)}var g=new Set(["INPUT","TEXTAREA","SELECT"]),a=[],f=!1;function k(s){let t=g.has(s.target.tagName)||s.target.isContentEditable;for(let e of a)if(!(t&&!e.global)&&h(s,e.descriptor)){s.preventDefault(),e.callback(s);return}}function E(){f||(document.addEventListener("keydown",k),f=!0)}function p(s,t,e={}){E();let i=d(s),r={combo:s,descriptor:i,callback:t,global:e.global===!0};return a.find(l=>l.combo===s)&&console.warn(`[hotkey-bind] Shortcut "${s}" already bound. Last-connected-wins.`),a.unshift(r),function(){let u=a.indexOf(r);u!==-1&&a.splice(u,1)}}function b(){return a.map(s=>s.combo)}var A=window.matchMedia("(prefers-reduced-motion: reduce)");var m=new Map;function y(s,t,e={}){let i=e.priority??10,r={impl:t,bundle:e.bundle,contract:e.contract,priority:i},n=m.get(s);if(customElements.get(s)){if(!n||n.priority>=i){n&&n.priority===i&&n.impl!==t&&console.warn(`[VB Bundle] Tag <${s}> already registered by "${n.bundle}" (priority ${n.priority}). Skipping "${e.bundle}".`);return}console.warn(`[VB Bundle] Tag <${s}> defined by "${n.bundle}" cannot be replaced (customElements.define is permanent). "${e.bundle}" has higher priority but arrived late.`);return}if(n&&n.priority>=i){n.priority===i&&console.warn(`[VB Bundle] Tag <${s}> already registered by "${n.bundle}". Skipping "${e.bundle}" (first wins at equal priority).`);return}m.set(s,r),customElements.define(s,t)}var o=class extends HTMLElement{#l=[];#o;connectedCallback(){this.hasAttribute("data-upgraded")||this.setup()!==!1&&(this.setAttribute("data-upgraded",""),queueMicrotask(()=>{this.dispatchEvent(new CustomEvent(`${this.localName}:upgraded`,{bubbles:!0}))}))}disconnectedCallback(){for(let t of this.#l)t();this.#l=[],this.removeAttribute("data-upgraded"),this.teardown()}listen(t,e,i,r){t.addEventListener(e,i,r),this.#l.push(()=>t.removeEventListener(e,i,r))}setup(){}teardown(){}setState(t,e){this.#o||(this.#o=this.attachInternals());let i=this.#o.states;try{e?i.add(t):i.delete(t)}catch{let r=`--${t}`;e?i.add(r):i.delete(r)}}_adoptInternals(t){this.#o||(this.#o=t)}};var c=class s extends o{static#l=150;static#o=8;#e=null;#i=null;#t=null;#s=null;#n=[];#a=-1;#r=!1;#c=null;#u=null;#h=null;setup(){this.#y(),this.#v()}teardown(){this.#r&&(document.body.style.overflow="",this.removeAttribute("open"),this.#r=!1),this.#h?.(),this.#d()}get value(){return this.#t?.value??""}set value(t){if(!this.#t)return;let e=t==null?"":String(t);this.#t.value!==e&&(this.#t.value=e,this.#t.dispatchEvent(new Event("input",{bubbles:!0})),this.dispatchEvent(new CustomEvent("site-search:change",{detail:{value:e,source:"api"},bubbles:!0})))}get results(){return[...this.#n]}#y(){this.#e=this.querySelector(":scope > [data-trigger]"),this.#e||(this.#e=this.querySelector(":scope > button")),this.#e||(this.#e=document.createElement("button"),this.#e.setAttribute("data-trigger",""),this.#e.innerHTML=`
2
2
  <icon-wc name="search" label="Search"></icon-wc>
3
- `,this.prepend(this.#e)),this.#e.setAttribute("aria-haspopup","dialog"),this.#e.setAttribute("aria-expanded","false"),this.#t=document.createElement("div"),this.#t.className="dialog",this.#t.setAttribute("role","dialog"),this.#t.setAttribute("aria-label","Site search"),this.#t.id=`search-dialog-${crypto.randomUUID().slice(0,8)}`,this.#e.setAttribute("aria-controls",this.#t.id),this.#t.innerHTML=`
3
+ `,this.prepend(this.#e)),this.#e.setAttribute("aria-haspopup","dialog"),this.#e.setAttribute("aria-expanded","false"),this.#i=document.createElement("div"),this.#i.className="dialog",this.#i.setAttribute("role","dialog"),this.#i.setAttribute("aria-label","Site search"),this.#i.id=`search-dialog-${crypto.randomUUID().slice(0,8)}`,this.#e.setAttribute("aria-controls",this.#i.id),this.#i.innerHTML=`
4
4
  <div class="backdrop"></div>
5
5
  <div class="panel">
6
6
  <div class="input-wrapper">
@@ -31,22 +31,22 @@ var v=/Mac|iPhone|iPad|iPod/.test(navigator.platform??"");function u(i){let e=i.
31
31
  </span>
32
32
  </div>
33
33
  </div>
34
- `,this.appendChild(this.#t),this.#i=this.#t.querySelector(".input"),this.#s=this.#t.querySelector(".results")}#v(){this.#e.addEventListener("click",this.#g),b().includes("meta+k")||(this.#u=p("meta+k",()=>{this.#n?this.close():this.open()},{global:!0})),this.listen(document,"keydown",this.#k),this.#t.querySelector(".backdrop")?.addEventListener("click",()=>this.close()),this.#i.addEventListener("input",this.#w),this.#i.addEventListener("keydown",this.#E),this.#s.addEventListener("click",this.#S)}#g=e=>{e.stopPropagation(),this.open()};#k=e=>{e.key==="Escape"&&this.#n&&(e.preventDefault(),this.close())};#w=()=>{this.#d(),this.#l=setTimeout(()=>{this.#L(this.#i.value)},i.#c)};#E=e=>{switch(e.key){case"ArrowDown":e.preventDefault(),this.#p(this.#a+1);break;case"ArrowUp":e.preventDefault(),this.#p(this.#a-1);break;case"Enter":e.preventDefault(),this.#a>=0&&this.#r[this.#a]&&this.#b(this.#r[this.#a]);break}};#S=e=>{let t=e.target.closest("[data-result-index]");if(t){let s=parseInt(t.dataset.resultIndex,10);this.#r[s]&&this.#b(this.#r[s])}};async#h(){if(!this.#o)try{this.#o=await import("/pagefind/pagefind.js"),await this.#o.options({excerptLength:20})}catch{console.warn("Pagefind not available. Run `npm run search:index` to build the search index."),this.#o=null}}async#L(e){if(!e.trim()){this.#f([]);return}if(await this.#h(),!this.#o){this.#A();return}try{this.#s.innerHTML='<div class="loading">Searching...</div>';let t=await this.#o.search(e),s=await Promise.all(t.results.slice(0,i.#m).map(n=>n.data()));this.#r=s,this.#f(s)}catch(t){console.error("Search error:",t),this.#s.innerHTML='<div class="error">Search error. Please try again.</div>'}}#f(e){if(this.#a=-1,e.length===0){this.#i.value.trim()?this.#s.innerHTML='<div class="empty">No results found</div>':this.#s.innerHTML="";return}this.#s.innerHTML=e.map((t,s)=>`
34
+ `,this.appendChild(this.#i),this.#t=this.#i.querySelector(".input"),this.#s=this.#i.querySelector(".results")}#v(){this.#e.addEventListener("click",this.#g),b().includes("meta+k")||(this.#h=p("meta+k",()=>{this.#r?this.close():this.open()},{global:!0})),this.listen(document,"keydown",this.#k),this.#i.querySelector(".backdrop")?.addEventListener("click",()=>this.close()),this.#t.addEventListener("input",this.#E),this.#t.addEventListener("keydown",this.#w),this.#s.addEventListener("click",this.#S)}#g=t=>{t.stopPropagation(),this.open()};#k=t=>{t.key==="Escape"&&this.#r&&(t.preventDefault(),this.close())};#E=()=>{this.#d(),this.setState("input-debounce-pending",!0),this.#u=setTimeout(()=>{this.setState("input-debounce-pending",!1),this.#L(this.#t.value)},s.#l)};#w=t=>{switch(t.key){case"ArrowDown":t.preventDefault(),this.#b(this.#a+1);break;case"ArrowUp":t.preventDefault(),this.#b(this.#a-1);break;case"Enter":t.preventDefault(),this.#a>=0&&this.#n[this.#a]&&this.#m(this.#n[this.#a]);break}};#S=t=>{let e=t.target.closest("[data-result-index]");if(e){let i=parseInt(e.dataset.resultIndex,10);this.#n[i]&&this.#m(this.#n[i])}};async#f(){if(!this.#c)try{this.#c=await import("/pagefind/pagefind.js"),await this.#c.options({excerptLength:20})}catch{console.warn("Pagefind not available. Run `npm run search:index` to build the search index."),this.#c=null}}async#L(t){if(!t.trim()){this.#p([]);return}if(await this.#f(),!this.#c){this.#A();return}try{this.#s.innerHTML='<div class="loading">Searching...</div>';let e=await this.#c.search(t),i=await Promise.all(e.results.slice(0,s.#o).map(r=>r.data()));this.#n=i,this.#p(i)}catch(e){console.error("Search error:",e),this.#s.innerHTML='<div class="error">Search error. Please try again.</div>'}}#p(t){if(this.#a=-1,t.length===0){this.#t.value.trim()?this.#s.innerHTML='<div class="empty">No results found</div>':this.#s.innerHTML="";return}this.#s.innerHTML=t.map((e,i)=>`
35
35
  <a
36
- id="search-result-${s}"
37
- href="${t.url}"
36
+ id="search-result-${i}"
37
+ href="${e.url}"
38
38
  class="result"
39
39
  role="option"
40
- data-result-index="${s}"
40
+ data-result-index="${i}"
41
41
  tabindex="-1"
42
42
  >
43
- <span class="result-title">${t.meta?.title||"Untitled"}</span>
44
- <span class="result-excerpt">${t.excerpt||""}</span>
43
+ <span class="result-title">${e.meta?.title||"Untitled"}</span>
44
+ <span class="result-excerpt">${e.excerpt||""}</span>
45
45
  </a>
46
46
  `).join("")}#A(){this.#s.innerHTML=`
47
47
  <div class="error">
48
48
  Search index not found.<br>
49
49
  Run <code>npm run search:index</code> after building.
50
50
  </div>
51
- `}#p(e){if(this.#r.length===0)return;e<0&&(e=this.#r.length-1),e>=this.#r.length&&(e=0);let t=this.#s.querySelector("[data-active]");t&&t.removeAttribute("data-active"),this.#i?.removeAttribute("aria-activedescendant"),this.#a=e;let s=this.#s.querySelector(`[data-result-index="${e}"]`);s&&(s.setAttribute("data-active",""),this.#i?.setAttribute("aria-activedescendant",s.id),s.scrollIntoView({block:"nearest"}))}#b(e){e.url&&(this.close(),window.location.href=e.url)}#d(){this.#l&&(clearTimeout(this.#l),this.#l=null)}open(){this.#n||(this.#n=!0,this.setAttribute("open",""),this.#e?.setAttribute("aria-expanded","true"),document.body.style.overflow="hidden",requestAnimationFrame(()=>{this.#i?.focus(),this.#i?.select()}),this.#h(),this.dispatchEvent(new CustomEvent("site-search:open",{bubbles:!0})))}close(){this.#n&&(this.#n=!1,this.removeAttribute("open"),this.#e?.setAttribute("aria-expanded","false"),document.body.style.overflow="",this.#d(),this.#i.value="",this.#i?.removeAttribute("aria-activedescendant"),this.#r=[],this.#a=-1,this.#s.innerHTML="",this.#e?.focus(),this.dispatchEvent(new CustomEvent("site-search:close",{bubbles:!0})))}get isOpen(){return this.#n}};y("site-search",c);export{c as SiteSearch};
51
+ `}#b(t){if(this.#n.length===0)return;t<0&&(t=this.#n.length-1),t>=this.#n.length&&(t=0);let e=this.#s.querySelector("[data-active]");e&&e.removeAttribute("data-active"),this.#t?.removeAttribute("aria-activedescendant"),this.#a=t;let i=this.#s.querySelector(`[data-result-index="${t}"]`);i&&(i.setAttribute("data-active",""),this.#t?.setAttribute("aria-activedescendant",i.id),i.scrollIntoView({block:"nearest"}))}#m(t){t.url&&(this.close(),window.location.href=t.url)}#d(){this.#u&&(clearTimeout(this.#u),this.#u=null,this.setState("input-debounce-pending",!1))}open(){this.#r||(this.#r=!0,this.setAttribute("open",""),this.#e?.setAttribute("aria-expanded","true"),document.body.style.overflow="hidden",requestAnimationFrame(()=>{this.#t?.focus(),this.#t?.select()}),this.#f(),this.dispatchEvent(new CustomEvent("site-search:open",{bubbles:!0})))}close(){this.#r&&(this.#r=!1,this.removeAttribute("open"),this.#e?.setAttribute("aria-expanded","false"),document.body.style.overflow="",this.#d(),this.#t.value="",this.#t?.removeAttribute("aria-activedescendant"),this.#n=[],this.#a=-1,this.#s.innerHTML="",this.#e?.focus(),this.dispatchEvent(new CustomEvent("site-search:close",{bubbles:!0})))}get isOpen(){return this.#r}};y("site-search",c);export{c as SiteSearch};
52
52
  //# sourceMappingURL=site-search.js.map
@@ -1,2 +1,2 @@
1
- var u=window.matchMedia("(prefers-reduced-motion: reduce)");var d=new Map;function l(n,t,e={}){let s=e.priority??10,r={impl:t,bundle:e.bundle,contract:e.contract,priority:s},i=d.get(n);if(customElements.get(n)){if(!i||i.priority>=s){i&&i.priority===s&&i.impl!==t&&console.warn(`[VB Bundle] Tag <${n}> already registered by "${i.bundle}" (priority ${i.priority}). Skipping "${e.bundle}".`);return}console.warn(`[VB Bundle] Tag <${n}> defined by "${i.bundle}" cannot be replaced (customElements.define is permanent). "${e.bundle}" has higher priority but arrived late.`);return}if(i&&i.priority>=s){i.priority===s&&console.warn(`[VB Bundle] Tag <${n}> already registered by "${i.bundle}". Skipping "${e.bundle}" (first wins at equal priority).`);return}d.set(n,r),customElements.define(n,t)}var o=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,s,r){t.addEventListener(e,s,r),this.#t.push(()=>t.removeEventListener(e,s,r))}setup(){}teardown(){}};var a=class extends o{#t;#n;#s;#o=!1;#i=0;#d=0;#l=0;#r=!1;#c=!1;get activated(){return this.#r}get#u(){let t=this.getAttribute("threshold"),e=Number(t);return t!==null&&!isNaN(e)?Math.min(100,Math.max(0,e)):90}setup(){this.#c||(this.#m(),this.#c=!0),this.listen(this.#t,"pointerdown",this.#b),this.listen(this.#t,"keydown",this.#p),this.listen(this.#t,"transitionend",this.#v)}#m(){this.#s=document.createElement("div"),this.#s.className="slide-track",this.#n=document.createElement("span"),this.#n.className="slide-label",this.#n.textContent=this.getAttribute("label")||"Slide to confirm",this.#t=document.createElement("div"),this.#t.className="slide-handle",this.#t.setAttribute("role","slider"),this.#t.setAttribute("aria-valuemin","0"),this.#t.setAttribute("aria-valuemax","100"),this.#t.setAttribute("aria-valuenow","0"),this.#t.setAttribute("aria-label",this.getAttribute("label")||"Slide to confirm"),this.#t.setAttribute("tabindex","0"),this.#t.innerHTML='<icon-wc name="chevrons-right" size="sm"></icon-wc>',this.#s.append(this.#n,this.#t),this.textContent="",this.appendChild(this.#s),this.#e(0)}reset(){this.#r=!1,this.removeAttribute("data-activated"),this.#n.textContent=this.getAttribute("label")||"Slide to confirm",this.#t.removeAttribute("aria-disabled"),this.#t.setAttribute("tabindex","0"),this.#e(0),this.dispatchEvent(new CustomEvent("slide-accept:reset",{bubbles:!0}))}#b=t=>{if(!this.#r){if(t.preventDefault(),this.hasAttribute("transitioning")){let e=this.#t.getBoundingClientRect(),s=this.#s.getBoundingClientRect(),r=parseFloat(getComputedStyle(this.#s).getPropertyValue("--_handle-inset")||"0"),i=this.#t.offsetWidth,h=s.width-i-r*2,c=e.left-s.left-r;this.removeAttribute("transitioning"),this.#i=h>0?Math.max(0,Math.min(100,c/h*100)):0,this.#e(this.#i)}this.#o=!0,this.#d=t.clientX,this.#l=this.#i,this.#t.setPointerCapture(t.pointerId),this.setAttribute("data-dragging",""),this.#t.addEventListener("pointermove",this.#f),this.#t.addEventListener("pointerup",this.#a),this.#t.addEventListener("pointercancel",this.#a)}};#f=t=>{if(!this.#o)return;let e=this.#s.getBoundingClientRect().width-this.#t.offsetWidth;if(e<=0)return;let r=(t.clientX-this.#d)/e*100,i=Math.min(100,Math.max(0,this.#l+r));this.#e(i)};#a=t=>{this.#o&&(this.#o=!1,this.removeAttribute("data-dragging"),this.#t.releasePointerCapture(t.pointerId),this.#t.removeEventListener("pointermove",this.#f),this.#t.removeEventListener("pointerup",this.#a),this.#t.removeEventListener("pointercancel",this.#a),this.#i>=this.#u?this.#h():this.#g())};#p=t=>{if(this.#r)return;let e=t.shiftKey?20:5;t.key==="ArrowRight"?(t.preventDefault(),this.#e(Math.min(100,this.#i+e))):t.key==="ArrowLeft"?(t.preventDefault(),this.#e(Math.max(0,this.#i-e))):t.key==="End"?(t.preventDefault(),this.#h()):t.key==="Home"&&(t.preventDefault(),this.#e(0)),t.key==="ArrowRight"&&this.#i>=this.#u&&this.#h()};#v=()=>{this.removeAttribute("transitioning")};#h(){this.#r=!0,this.#e(100),this.setAttribute("data-activated",""),this.#n.textContent=this.getAttribute("activated-label")||"Confirmed!",this.#t.setAttribute("aria-disabled","true"),this.#t.removeAttribute("tabindex"),this.dispatchEvent(new CustomEvent("slide-accept:accept",{bubbles:!0}))}#g(){this.setAttribute("transitioning",""),this.#e(0),setTimeout(()=>{this.hasAttribute("transitioning")&&this.removeAttribute("transitioning")},500)}#e(t){this.#i=t,this.style.setProperty("--_slide-position",String(t)),this.#t.setAttribute("aria-valuenow",String(Math.round(t)))}};l("slide-accept",a);export{a as SlideAccept};
1
+ var u=window.matchMedia("(prefers-reduced-motion: reduce)");var d=new Map;function l(r,t,e={}){let i=e.priority??10,n={impl:t,bundle:e.bundle,contract:e.contract,priority:i},s=d.get(r);if(customElements.get(r)){if(!s||s.priority>=i){s&&s.priority===i&&s.impl!==t&&console.warn(`[VB Bundle] Tag <${r}> already registered by "${s.bundle}" (priority ${s.priority}). Skipping "${e.bundle}".`);return}console.warn(`[VB Bundle] Tag <${r}> 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 <${r}> already registered by "${s.bundle}". Skipping "${e.bundle}" (first wins at equal priority).`);return}d.set(r,n),customElements.define(r,t)}var o=class extends HTMLElement{#t=[];#e;connectedCallback(){this.hasAttribute("data-upgraded")||this.setup()!==!1&&(this.setAttribute("data-upgraded",""),queueMicrotask(()=>{this.dispatchEvent(new CustomEvent(`${this.localName}:upgraded`,{bubbles:!0}))}))}disconnectedCallback(){for(let t of this.#t)t();this.#t=[],this.removeAttribute("data-upgraded"),this.teardown()}listen(t,e,i,n){t.addEventListener(e,i,n),this.#t.push(()=>t.removeEventListener(e,i,n))}setup(){}teardown(){}setState(t,e){this.#e||(this.#e=this.attachInternals());let i=this.#e.states;try{e?i.add(t):i.delete(t)}catch{let n=`--${t}`;e?i.add(n):i.delete(n)}}_adoptInternals(t){this.#e||(this.#e=t)}};var a=class extends o{#t;#e;#n;#o=!1;#s=0;#d=0;#l=0;#r=!1;#c=!1;get activated(){return this.#r}get#u(){let t=this.getAttribute("threshold"),e=Number(t);return t!==null&&!isNaN(e)?Math.min(100,Math.max(0,e)):90}setup(){this.#c||(this.#b(),this.#c=!0),this.listen(this.#t,"pointerdown",this.#m),this.listen(this.#t,"keydown",this.#p),this.listen(this.#t,"transitionend",this.#v)}#b(){this.#n=document.createElement("div"),this.#n.className="slide-track",this.#e=document.createElement("span"),this.#e.className="slide-label",this.#e.textContent=this.getAttribute("label")||"Slide to confirm",this.#t=document.createElement("div"),this.#t.className="slide-handle",this.#t.setAttribute("role","slider"),this.#t.setAttribute("aria-valuemin","0"),this.#t.setAttribute("aria-valuemax","100"),this.#t.setAttribute("aria-valuenow","0"),this.#t.setAttribute("aria-label",this.getAttribute("label")||"Slide to confirm"),this.#t.setAttribute("tabindex","0"),this.#t.innerHTML='<icon-wc name="chevrons-right" size="sm"></icon-wc>',this.#n.append(this.#e,this.#t),this.textContent="",this.appendChild(this.#n),this.#i(0)}reset(){this.#r=!1,this.removeAttribute("data-activated"),this.#e.textContent=this.getAttribute("label")||"Slide to confirm",this.#t.removeAttribute("aria-disabled"),this.#t.setAttribute("tabindex","0"),this.#i(0),this.dispatchEvent(new CustomEvent("slide-accept:reset",{bubbles:!0}))}#m=t=>{if(!this.#r){if(t.preventDefault(),this.hasAttribute("transitioning")){let e=this.#t.getBoundingClientRect(),i=this.#n.getBoundingClientRect(),n=parseFloat(getComputedStyle(this.#n).getPropertyValue("--_handle-inset")||"0"),s=this.#t.offsetWidth,h=i.width-s-n*2,c=e.left-i.left-n;this.removeAttribute("transitioning"),this.#s=h>0?Math.max(0,Math.min(100,c/h*100)):0,this.#i(this.#s)}this.#o=!0,this.#d=t.clientX,this.#l=this.#s,this.#t.setPointerCapture(t.pointerId),this.setAttribute("data-dragging",""),this.#t.addEventListener("pointermove",this.#f),this.#t.addEventListener("pointerup",this.#a),this.#t.addEventListener("pointercancel",this.#a)}};#f=t=>{if(!this.#o)return;let e=this.#n.getBoundingClientRect().width-this.#t.offsetWidth;if(e<=0)return;let n=(t.clientX-this.#d)/e*100,s=Math.min(100,Math.max(0,this.#l+n));this.#i(s)};#a=t=>{this.#o&&(this.#o=!1,this.removeAttribute("data-dragging"),this.#t.releasePointerCapture(t.pointerId),this.#t.removeEventListener("pointermove",this.#f),this.#t.removeEventListener("pointerup",this.#a),this.#t.removeEventListener("pointercancel",this.#a),this.#s>=this.#u?this.#h():this.#g())};#p=t=>{if(this.#r)return;let e=t.shiftKey?20:5;t.key==="ArrowRight"?(t.preventDefault(),this.#i(Math.min(100,this.#s+e))):t.key==="ArrowLeft"?(t.preventDefault(),this.#i(Math.max(0,this.#s-e))):t.key==="End"?(t.preventDefault(),this.#h()):t.key==="Home"&&(t.preventDefault(),this.#i(0)),t.key==="ArrowRight"&&this.#s>=this.#u&&this.#h()};#v=()=>{this.removeAttribute("transitioning")};#h(){this.#r=!0,this.#i(100),this.setAttribute("data-activated",""),this.#e.textContent=this.getAttribute("activated-label")||"Confirmed!",this.#t.setAttribute("aria-disabled","true"),this.#t.removeAttribute("tabindex"),this.dispatchEvent(new CustomEvent("slide-accept:accept",{bubbles:!0}))}#g(){this.setAttribute("transitioning",""),this.#i(0),setTimeout(()=>{this.hasAttribute("transitioning")&&this.removeAttribute("transitioning")},500)}#i(t){this.#s=t,this.style.setProperty("--_slide-position",String(t)),this.#t.setAttribute("aria-valuenow",String(Math.round(t)))}};l("slide-accept",a);export{a as SlideAccept};
2
2
  //# sourceMappingURL=slide-accept.js.map
@@ -1,2 +1,2 @@
1
- var b=window.matchMedia("(prefers-reduced-motion: reduce)");var l=new Map;function u(i,t,e={}){let r=e.priority??10,s={impl:t,bundle:e.bundle,contract:e.contract,priority:r},n=l.get(i);if(customElements.get(i)){if(!n||n.priority>=r){n&&n.priority===r&&n.impl!==t&&console.warn(`[VB Bundle] Tag <${i}> already registered by "${n.bundle}" (priority ${n.priority}). Skipping "${e.bundle}".`);return}console.warn(`[VB Bundle] Tag <${i}> defined by "${n.bundle}" cannot be replaced (customElements.define is permanent). "${e.bundle}" has higher priority but arrived late.`);return}if(n&&n.priority>=r){n.priority===r&&console.warn(`[VB Bundle] Tag <${i}> already registered by "${n.bundle}". Skipping "${e.bundle}" (first wins at equal priority).`);return}l.set(i,s),customElements.define(i,t)}var o=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,r,s){t.addEventListener(e,r,s),this.#e.push(()=>t.removeEventListener(e,r,s))}setup(){}teardown(){}};var a=new Map,c=new Map;function E(i){if(c.has(i))return c.get(i);let t=new Promise((e,r)=>{let s=document.createElement("script");s.src=i,s.async=!0,s.onload=()=>e(),s.onerror=()=>r(new Error(`Failed to load script: ${i}`)),document.head.appendChild(s)});return c.set(i,t),t}async function w(i,t,e={}){let r=new URLSearchParams({url:t,format:"json",...e}),s=await fetch(`${i}?${r}`);if(!s.ok)throw new Error(`oEmbed error ${s.status}`);return s.json()}function h(i){return i==="light"?"light":i==="dark"||window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}var f="position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0",d=class extends o{static register(t,e){a.set(t,e)}#e=null;#i="";#t=null;setup(){this.#i||(this.#i=this.innerHTML);let t=this.getAttribute("url");if(!t)return console.warn("social-embed: missing required url attribute"),!1;let e=this.getAttribute("provider"),r=e?a.get(e):[...a.values()].find(n=>n.canHandle?.(t));if(!r){this.setAttribute("state","unsupported");return}if(r.delegatesActivation){this.#r(r);return}this.setAttribute("state","idle");let s=this.getAttribute("activate")??"click";s==="eager"?this.#r(r):s==="visible"?(this.#e=new IntersectionObserver(n=>{n[0].isIntersecting&&(this.#e?.disconnect(),this.#r(r))},{rootMargin:"200px"}),this.#e.observe(this)):(this.#t=n=>{n.preventDefault(),this.#r(r)},this.addEventListener("click",this.#t,{once:!0}),this.addEventListener("keydown",this.#n),this.setAttribute("tabindex","0"),this.setAttribute("role","button"),this.setAttribute("aria-label","Load embed"))}teardown(){this.#e?.disconnect(),this.#t&&(this.removeEventListener("click",this.#t),this.#t=null),this.removeEventListener("keydown",this.#n)}#n=t=>{(t.key==="Enter"||t.key===" ")&&(t.preventDefault(),this.click())};async#r(t){this.removeAttribute("tabindex"),this.removeAttribute("role"),this.removeAttribute("aria-label"),this.#t&&(this.removeEventListener("click",this.#t),this.#t=null),this.removeEventListener("keydown",this.#n);let e=this.getAttribute("url");this.setAttribute("state","loading"),this.#s("Loading embed\u2026");try{let r=h(this.getAttribute("theme")??"auto");await t.render(this,e,{theme:r}),this.setAttribute("state","loaded")}catch(r){console.warn("[social-embed] render failed:",r),this.innerHTML=this.#i,this.setAttribute("state","error"),this.#s("Embed failed to load.")}}#s(t){let e=this.querySelector("[data-embed-live]");e||(e=document.createElement("span"),e.setAttribute("data-embed-live",""),e.setAttribute("role","status"),e.setAttribute("aria-live","polite"),e.setAttribute("style",f),this.prepend(e)),e.textContent=t}};u("social-embed",d);export{a as PROVIDERS,d as SocialEmbed,w as fetchOEmbed,E as loadScript};
1
+ var b=window.matchMedia("(prefers-reduced-motion: reduce)");var l=new Map;function u(n,e,t={}){let i=t.priority??10,r={impl:e,bundle:t.bundle,contract:t.contract,priority:i},s=l.get(n);if(customElements.get(n)){if(!s||s.priority>=i){s&&s.priority===i&&s.impl!==e&&console.warn(`[VB Bundle] Tag <${n}> already registered by "${s.bundle}" (priority ${s.priority}). Skipping "${t.bundle}".`);return}console.warn(`[VB Bundle] Tag <${n}> defined by "${s.bundle}" cannot be replaced (customElements.define is permanent). "${t.bundle}" has higher priority but arrived late.`);return}if(s&&s.priority>=i){s.priority===i&&console.warn(`[VB Bundle] Tag <${n}> already registered by "${s.bundle}". Skipping "${t.bundle}" (first wins at equal priority).`);return}l.set(n,r),customElements.define(n,e)}var o=class extends HTMLElement{#t=[];#e;connectedCallback(){this.hasAttribute("data-upgraded")||this.setup()!==!1&&(this.setAttribute("data-upgraded",""),queueMicrotask(()=>{this.dispatchEvent(new CustomEvent(`${this.localName}:upgraded`,{bubbles:!0}))}))}disconnectedCallback(){for(let e of this.#t)e();this.#t=[],this.removeAttribute("data-upgraded"),this.teardown()}listen(e,t,i,r){e.addEventListener(t,i,r),this.#t.push(()=>e.removeEventListener(t,i,r))}setup(){}teardown(){}setState(e,t){this.#e||(this.#e=this.attachInternals());let i=this.#e.states;try{t?i.add(e):i.delete(e)}catch{let r=`--${e}`;t?i.add(r):i.delete(r)}}_adoptInternals(e){this.#e||(this.#e=e)}};var a=new Map,c=new Map;function E(n){if(c.has(n))return c.get(n);let e=new Promise((t,i)=>{let r=document.createElement("script");r.src=n,r.async=!0,r.onload=()=>t(void 0),r.onerror=()=>i(new Error(`Failed to load script: ${n}`)),document.head.appendChild(r)});return c.set(n,e),e}async function g(n,e,t={}){let i=new URLSearchParams({url:e,format:"json",...t}),r=await fetch(`${n}?${i}`);if(!r.ok)throw new Error(`oEmbed error ${r.status}`);return r.json()}function h(n,e){if(n==="light")return"light";if(n==="dark")return"dark";let t=e||document.documentElement,i=getComputedStyle(t).colorScheme||"";if(/\bdark\b/.test(i)&&!/\blight\b/.test(i))return"dark";if(/\blight\b/.test(i)&&!/\bdark\b/.test(i))return"light";let r=document.documentElement.dataset.mode;return r==="dark"?"dark":r==="light"?"light":window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}var f="position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0",d=class extends o{static register(e,t){a.set(e,t)}#t=null;#e="";#i=null;#s=null;#r=null;setup(){this.#e||(this.#e=this.innerHTML),this.listen(window,"vb:theme-change",()=>{this.#r&&clearTimeout(this.#r),this.#r=setTimeout(()=>{this.#s&&this.getAttribute("state")==="loaded"&&this.#n(this.#s)},100)});let e=this.getAttribute("url");if(!e)return console.warn("social-embed: missing required url attribute"),!1;let t=this.getAttribute("provider"),i=t?a.get(t):[...a.values()].find(s=>s.canHandle?.(e));if(!i){this.setAttribute("state","unsupported");return}if(i.delegatesActivation){this.#n(i);return}this.setAttribute("state","idle");let r=this.getAttribute("activate")??"click";return r==="eager"?this.#n(i):r==="visible"?(this.#t=new IntersectionObserver(s=>{s[0].isIntersecting&&(this.#t?.disconnect(),this.#n(i))},{rootMargin:"200px"}),this.#t.observe(this)):(this.#i=s=>{s.preventDefault(),this.#n(i)},this.addEventListener("click",this.#i,{once:!0}),this.addEventListener("keydown",this.#o),this.setAttribute("tabindex","0"),this.setAttribute("role","button"),this.setAttribute("aria-label","Load embed")),!0}teardown(){this.#t?.disconnect(),this.#r&&(clearTimeout(this.#r),this.#r=null),this.#s=null,this.#i&&(this.removeEventListener("click",this.#i),this.#i=null),this.removeEventListener("keydown",this.#o)}#o=e=>{(e.key==="Enter"||e.key===" ")&&(e.preventDefault(),this.click())};async#n(e){this.#s=e,this.removeAttribute("tabindex"),this.removeAttribute("role"),this.removeAttribute("aria-label"),this.#i&&(this.removeEventListener("click",this.#i),this.#i=null),this.removeEventListener("keydown",this.#o);let t=this.getAttribute("url");this.setAttribute("state","loading"),this.#a("Loading embed\u2026");try{let i=h(this.getAttribute("theme")??"auto",this);await e.render(this,t,{theme:i}),this.setAttribute("state","loaded")}catch(i){console.warn("[social-embed] render failed:",i),this.innerHTML=this.#e,this.setAttribute("state","error"),this.#a("Embed failed to load.")}}#a(e){let t=this.querySelector("[data-embed-live]");t||(t=document.createElement("span"),t.setAttribute("data-embed-live",""),t.setAttribute("role","status"),t.setAttribute("aria-live","polite"),t.setAttribute("style",f),this.prepend(t)),t.textContent=e}};u("social-embed",d);export{a as PROVIDERS,d as SocialEmbed,g as fetchOEmbed,E as loadScript};
2
2
  //# sourceMappingURL=social-embed.js.map
@@ -1,6 +1,6 @@
1
- var p=window.matchMedia("(prefers-reduced-motion: reduce)");var f=new Map;function h(s,e,t={}){let n=t.priority??10,o={impl:e,bundle:t.bundle,contract:t.contract,priority:n},r=f.get(s);if(customElements.get(s)){if(!r||r.priority>=n){r&&r.priority===n&&r.impl!==e&&console.warn(`[VB Bundle] Tag <${s}> already registered by "${r.bundle}" (priority ${r.priority}). Skipping "${t.bundle}".`);return}console.warn(`[VB Bundle] Tag <${s}> defined by "${r.bundle}" cannot be replaced (customElements.define is permanent). "${t.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 "${t.bundle}" (first wins at equal priority).`);return}f.set(s,o),customElements.define(s,e)}var u=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,n,o){e.addEventListener(t,n,o),this.#e.push(()=>e.removeEventListener(t,n,o))}setup(){}teardown(){}};var m=class extends u{static observedAttributes=["tokens","prefix","show-values","label","editable","target"];setup(){this.#e(),this.#t()}attributeChangedCallback(){this.isConnected&&(this.#e(),this.#t())}#e(){let e=this.getAttribute("tokens")||"3xs,2xs,xs,s,m,l,xl,2xl,3xl",t=this.getAttribute("prefix")||"--size-",n=this.getAttribute("show-values")!=="false",o=this.getAttribute("label")||"",r=this.hasAttribute("editable"),d=e.split(",").map(i=>i.trim()),c="";o&&(c+=`<div style="font-size:0.75rem;font-weight:700;text-transform:uppercase;letter-spacing:0.08em;color:var(--color-text-muted,#666);margin-block-end:0.75rem;font-family:var(--font-sans,system-ui)">${o}</div>`),c+=`<div role="list" aria-label="${o||"Spacing scale"}" style="display:flex;flex-direction:column;gap:0.25rem">`;for(let i of d){let a=`${t}${i}`,l=r?`<input type="text" class="scale-edit" data-token="${i}" aria-label="${i} value" style="font-family:var(--font-mono,monospace);font-size:0.75rem;padding:0.125rem 0.375rem;border:1px solid var(--color-border,#ccc);border-radius:var(--radius-s,0.25rem);background:var(--color-surface,#fff);color:var(--color-text,#222);inline-size:6rem;text-align:end">`:n?'<span class="scale-value" style="font-family:var(--font-mono,monospace);font-size:0.75rem;color:var(--color-text-muted,#666);font-variant-numeric:tabular-nums;min-inline-size:3.5rem;text-align:end"></span>':"";c+=`<div role="listitem" style="display:grid;grid-template-columns:3rem 1fr auto;align-items:center;gap:0.75rem;min-block-size:1.75rem">
2
- <span style="font-family:var(--font-mono,monospace);font-size:0.875rem;color:var(--color-text-muted,#666);text-align:end">${i}</span>
3
- <div class="scale-bar" style="display:block;block-size:var(--size-m,1rem);min-inline-size:2px;inline-size:var(${a});background:var(--color-interactive,oklch(55% 0.2 260));border-radius:var(--radius-s,0.25rem)" aria-hidden="true"></div>
4
- ${l}
5
- </div>`}c+="</div>",this.innerHTML=c,requestAnimationFrame(()=>{if(r){let i=getComputedStyle(this);this.querySelectorAll(".scale-edit").forEach(a=>{let l=a.getAttribute("data-token"),b=i.getPropertyValue(`${t}${l}`).trim();a.value=b||""})}else n&&this.querySelectorAll(".scale-bar").forEach(i=>{let a=i.getBoundingClientRect().width,l=i.nextElementSibling;l&&(l.textContent=`${Math.round(a*100)/100}px`)})})}#t(){if(!this.hasAttribute("editable"))return;let e=this.getAttribute("prefix")||"--size-";this.querySelectorAll(".scale-edit").forEach(t=>{this.listen(t,"change",()=>this.#r(t,e)),this.listen(t,"keydown",n=>{n.key==="Enter"&&this.#r(t,e)})})}#r(e,t){let n=e.getAttribute("data-token"),o=e.value.trim();if(!n||!o)return;let r=this.#n(),d=`${t}${n}`;r&&r.style.setProperty(d,o),this.dispatchEvent(new CustomEvent("spacing-specimen:change",{bubbles:!0,detail:{name:n,value:o,token:d,target:this.getAttribute("target")||":root"}}))}#n(){let e=this.getAttribute("target")||":root";try{return e===":root"?document.documentElement:document.querySelector(e)}catch{return document.documentElement}}};h("spacing-specimen",m);
1
+ var y=window.matchMedia("(prefers-reduced-motion: reduce)");var m=new Map;function h(s,e,t={}){let r=t.priority??10,i={impl:e,bundle:t.bundle,contract:t.contract,priority:r},n=m.get(s);if(customElements.get(s)){if(!n||n.priority>=r){n&&n.priority===r&&n.impl!==e&&console.warn(`[VB Bundle] Tag <${s}> already registered by "${n.bundle}" (priority ${n.priority}). Skipping "${t.bundle}".`);return}console.warn(`[VB Bundle] Tag <${s}> defined by "${n.bundle}" cannot be replaced (customElements.define is permanent). "${t.bundle}" has higher priority but arrived late.`);return}if(n&&n.priority>=r){n.priority===r&&console.warn(`[VB Bundle] Tag <${s}> already registered by "${n.bundle}". Skipping "${t.bundle}" (first wins at equal priority).`);return}m.set(s,i),customElements.define(s,e)}var u=class extends HTMLElement{#t=[];#e;connectedCallback(){this.hasAttribute("data-upgraded")||this.setup()!==!1&&(this.setAttribute("data-upgraded",""),queueMicrotask(()=>{this.dispatchEvent(new CustomEvent(`${this.localName}:upgraded`,{bubbles:!0}))}))}disconnectedCallback(){for(let e of this.#t)e();this.#t=[],this.removeAttribute("data-upgraded"),this.teardown()}listen(e,t,r,i){e.addEventListener(t,r,i),this.#t.push(()=>e.removeEventListener(t,r,i))}setup(){}teardown(){}setState(e,t){this.#e||(this.#e=this.attachInternals());let r=this.#e.states;try{t?r.add(e):r.delete(e)}catch{let i=`--${e}`;t?r.add(i):r.delete(i)}}_adoptInternals(e){this.#e||(this.#e=e)}};var f=class extends u{static observedAttributes=["tokens","prefix","show-values","label","editable","target"];setup(){this.#t(),this.#e()}attributeChangedCallback(){this.isConnected&&(this.#t(),this.#e())}#t(){let e=this.getAttribute("tokens")||"3xs,2xs,xs,s,m,l,xl,2xl,3xl",t=this.getAttribute("prefix")||"--size-",r=this.getAttribute("show-values")!=="false",i=this.getAttribute("label")||"",n=this.hasAttribute("editable"),d=e.split(",").map(o=>o.trim()),l="";i&&(l+=`<div style="font-size:0.75rem;font-weight:700;text-transform:uppercase;letter-spacing:0.08em;color:var(--color-text-muted,#666);margin-block-end:0.75rem;font-family:var(--font-sans,system-ui)">${i}</div>`),l+=`<div role="list" aria-label="${i||"Spacing scale"}" style="display:flex;flex-direction:column;gap:0.25rem">`;for(let o of d){let c=`${t}${o}`,a=n?`<input type="text" class="scale-edit" data-token="${o}" aria-label="${o} value" style="font-family:var(--font-mono,monospace);font-size:0.75rem;padding:0.125rem 0.375rem;border:1px solid var(--color-border,#ccc);border-radius:var(--radius-s,0.25rem);background:var(--color-surface,#fff);color:var(--color-text,#222);inline-size:6rem;text-align:end">`:r?'<span class="scale-value" style="font-family:var(--font-mono,monospace);font-size:0.75rem;color:var(--color-text-muted,#666);font-variant-numeric:tabular-nums;min-inline-size:3.5rem;text-align:end"></span>':"";l+=`<div role="listitem" style="display:grid;grid-template-columns:3rem 1fr auto;align-items:center;gap:0.75rem;min-block-size:1.75rem">
2
+ <span style="font-family:var(--font-mono,monospace);font-size:0.875rem;color:var(--color-text-muted,#666);text-align:end">${o}</span>
3
+ <div class="scale-bar" style="display:block;block-size:var(--size-m,1rem);min-inline-size:2px;inline-size:var(${c});background:var(--color-interactive,oklch(55% 0.2 260));border-radius:var(--radius-s,0.25rem)" aria-hidden="true"></div>
4
+ ${a}
5
+ </div>`}l+="</div>",this.innerHTML=l,requestAnimationFrame(()=>{if(n){let o=getComputedStyle(this);this.querySelectorAll(".scale-edit").forEach(c=>{let a=c,b=a.getAttribute("data-token"),p=o.getPropertyValue(`${t}${b}`).trim();a.value=p||""})}else r&&this.querySelectorAll(".scale-bar").forEach(o=>{let c=o.getBoundingClientRect().width,a=o.nextElementSibling;a&&(a.textContent=`${Math.round(c*100)/100}px`)})})}#e(){if(!this.hasAttribute("editable"))return;let e=this.getAttribute("prefix")||"--size-";this.querySelectorAll(".scale-edit").forEach(t=>{this.listen(t,"change",()=>this.#r(t,e)),this.listen(t,"keydown",r=>{r.key==="Enter"&&this.#r(t,e)})})}#r(e,t){let r=e.getAttribute("data-token"),i=e.value.trim();if(!r||!i)return;let n=this.#n(),d=`${t}${r}`;n&&n.style.setProperty(d,i),this.dispatchEvent(new CustomEvent("spacing-specimen:change",{bubbles:!0,detail:{name:r,value:i,token:d,target:this.getAttribute("target")||":root"}}))}#n(){let e=this.getAttribute("target")||":root";try{return e===":root"?document.documentElement:document.querySelector(e)}catch{return document.documentElement}}};h("spacing-specimen",f);
6
6
  //# sourceMappingURL=spacing-specimen.js.map
@@ -1,2 +1,2 @@
1
- var v=window.matchMedia("(prefers-reduced-motion: reduce)");var f=new Map;function p(s,t,e={}){let i=e.priority??10,n={impl:t,bundle:e.bundle,contract:e.contract,priority:i},r=f.get(s);if(customElements.get(s)){if(!r||r.priority>=i){r&&r.priority===i&&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>=i){r.priority===i&&console.warn(`[VB Bundle] Tag <${s}> already registered by "${r.bundle}". Skipping "${e.bundle}" (first wins at equal priority).`);return}f.set(s,n),customElements.define(s,t)}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 t of this.#t)t();this.#t=[],this.removeAttribute("data-upgraded"),this.teardown()}listen(t,e,i,n){t.addEventListener(e,i,n),this.#t.push(()=>t.removeEventListener(e,i,n))}setup(){}teardown(){}};function w(){let s=globalThis.localStorage;if(!s)throw new Error("VBStore: localStorage is not available in this environment");return{async getRaw(t){return s.getItem(t)},async setRaw(t,e){s.setItem(t,e)},async removeRaw(t){s.removeItem(t)},async keys(t){let e=[];for(let i=0;i<s.length;i++){let n=s.key(i);n&&n.startsWith(t)&&e.push(n)}return e}}}var u=null;function o(){return u||(u=w()),u}function h(s,t){if(typeof s!="string"||!s)throw new TypeError("VBStore: namespace must be a non-empty string");if(typeof t!="string"||!t)throw new TypeError("VBStore: key must be a non-empty string");return`vb:${s}:${t}`}function m(s){if(typeof s!="string"||!s)throw new TypeError("VBStore: namespace must be a non-empty string");return`vb:${s}:`}function y(s){try{let t=JSON.parse(s);if(t&&typeof t=="object"&&typeof t.timestamp=="number")return t}catch{}return null}var l={configure(s={}){u=s.backend??null},async set(s,t,e){let i={data:e,timestamp:Date.now()};await o().setRaw(h(s,t),JSON.stringify(i))},async get(s,t,e){let i=await o().getRaw(h(s,t));if(i==null)return null;let n=y(i);return!n||e?.maxAge!=null&&Date.now()-n.timestamp>e.maxAge?null:n.data},async remove(s,t){await o().removeRaw(h(s,t))},async list(s){let t=m(s),e=await o().keys(t),i=[];for(let n of e){let r=await o().getRaw(n);if(r==null)continue;let a=y(r);a&&i.push({key:n.slice(t.length),data:a.data,timestamp:a.timestamp})}return i},async clear(s){let t=m(s),e=await o().keys(t);for(let i of e)await o().removeRaw(i)},async clearAll(){let s=await o().keys("vb:");for(let t of s)await o().removeRaw(t)},async setMany(s,t){for(let[e,i]of t)await l.set(s,e,i)}};var d=class extends c{#t;#s;#o;#l=!1;#n=50;#i=!1;#h=50;get#a(){return this.getAttribute("direction")==="vertical"}get#c(){let t=this.getAttribute("min"),e=Number(t);return t!==null&&!isNaN(e)?e:10}get#u(){let t=this.getAttribute("max"),e=Number(t);return t!==null&&!isNaN(e)?e:90}get position(){return this.#n}set position(t){this.#e(Number(t))}get collapsed(){return this.#i}set collapsed(t){t?this.#p():this.#m()}reset(){let t=this.getAttribute("position"),e=Number(t),i=t!==null&&!isNaN(e)?e:50;this.#i=!1,this.#e(i),this.#g()}async setup(){let t=[...this.children].filter(b=>!b.classList.contains("split-divider"));if(t.length<2)return!1;this.#s=t[0],this.#o=t[1];let e=this.getAttribute("position"),i=Number(e),n=e!==null&&!isNaN(i)?i:null,r=await this.#v(),a=n??r??50;this.#t=document.createElement("div"),this.#t.className="split-divider",this.#t.setAttribute("role","separator"),this.#t.setAttribute("aria-orientation",this.#a?"vertical":"horizontal"),this.#t.setAttribute("aria-valuenow",String(Math.round(a))),this.#t.setAttribute("aria-valuemin",String(this.#c)),this.#t.setAttribute("aria-valuemax",String(this.#u)),this.#t.setAttribute("aria-label","Resize panels"),this.#t.setAttribute("tabindex","0"),this.insertBefore(this.#t,this.#o),this.#e(a),this.listen(this.#t,"pointerdown",this.#y),this.listen(this.#t,"keydown",this.#b),this.hasAttribute("collapsible")&&this.listen(this.#t,"dblclick",this.#w)}teardown(){this.#t&&(this.#t.remove(),this.#t=null)}#y=t=>{t.preventDefault(),this.#l=!0,this.#t.setPointerCapture(t.pointerId),this.style.userSelect="none",this.#t.addEventListener("pointermove",this.#d),this.#t.addEventListener("pointerup",this.#f)};#d=t=>{if(!this.#l)return;let e=this.getBoundingClientRect(),i;this.#a?i=(t.clientY-e.top)/e.height*100:i=(t.clientX-e.left)/e.width*100,this.#i&&(this.#i=!1),this.#e(i)};#f=t=>{this.#l=!1,this.#t.releasePointerCapture(t.pointerId),this.style.userSelect="",this.#t.removeEventListener("pointermove",this.#d),this.#t.removeEventListener("pointerup",this.#f),this.#r()};#b=t=>{let e=t.shiftKey?10:1,i=this.#n,n=this.#a?["ArrowUp"]:["ArrowLeft"],r=this.#a?["ArrowDown"]:["ArrowRight"];n.includes(t.key)?(t.preventDefault(),this.#e(i-e),this.#r()):r.includes(t.key)?(t.preventDefault(),this.#e(i+e),this.#r()):t.key==="Home"?(t.preventDefault(),this.#e(this.#c),this.#r()):t.key==="End"&&(t.preventDefault(),this.#e(this.#u),this.#r())};#w=()=>{this.#i?this.#m():this.#p(),this.#r()};#p(){this.#h=this.#n,this.#i=!0,this.#s.style.flexBasis="0%",this.#s.style.overflow="hidden",this.#t.setAttribute("aria-valuenow","0"),this.#n=0,this.dispatchEvent(new CustomEvent("split-surface:collapse",{detail:{collapsed:!0},bubbles:!0}))}#m(){this.#i=!1,this.#s.style.overflow="auto",this.#e(this.#h),this.dispatchEvent(new CustomEvent("split-surface:collapse",{detail:{collapsed:!1},bubbles:!0}))}#e(t){let e=this.#i?0:Math.min(this.#u,Math.max(this.#c,t));this.#n=e,this.#s.style.flexBasis=`${e}%`,this.#s.style.flexGrow="0",this.#s.style.flexShrink="0",this.#s.style.overflow="auto",this.#o.style.flexGrow="1",this.#o.style.overflow="auto",this.#t.setAttribute("aria-valuenow",String(Math.round(e))),this.dispatchEvent(new CustomEvent("split-surface:resize",{detail:{position:e},bubbles:!0}))}async#v(){let t=this.getAttribute("persist");if(!t)return null;let e=await l.get("layout",`split:${t}`);return typeof e=="number"?e:null}#r(){let t=this.getAttribute("persist");t&&l.set("layout",`split:${t}`,Math.round(this.#n)).catch(()=>{})}#g(){let t=this.getAttribute("persist");t&&l.remove("layout",`split:${t}`).catch(()=>{})}};p("split-surface",d);export{d as SplitSurface};
1
+ var w=window.matchMedia("(prefers-reduced-motion: reduce)");var f=new Map;function p(s,t,e={}){let i=e.priority??10,n={impl:t,bundle:e.bundle,contract:e.contract,priority:i},r=f.get(s);if(customElements.get(s)){if(!r||r.priority>=i){r&&r.priority===i&&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>=i){r.priority===i&&console.warn(`[VB Bundle] Tag <${s}> already registered by "${r.bundle}". Skipping "${e.bundle}" (first wins at equal priority).`);return}f.set(s,n),customElements.define(s,t)}var l=class extends HTMLElement{#t=[];#e;connectedCallback(){this.hasAttribute("data-upgraded")||this.setup()!==!1&&(this.setAttribute("data-upgraded",""),queueMicrotask(()=>{this.dispatchEvent(new CustomEvent(`${this.localName}:upgraded`,{bubbles:!0}))}))}disconnectedCallback(){for(let t of this.#t)t();this.#t=[],this.removeAttribute("data-upgraded"),this.teardown()}listen(t,e,i,n){t.addEventListener(e,i,n),this.#t.push(()=>t.removeEventListener(e,i,n))}setup(){}teardown(){}setState(t,e){this.#e||(this.#e=this.attachInternals());let i=this.#e.states;try{e?i.add(t):i.delete(t)}catch{let n=`--${t}`;e?i.add(n):i.delete(n)}}_adoptInternals(t){this.#e||(this.#e=t)}};function b(){let s=globalThis.localStorage;if(!s)throw new Error("VBStore: localStorage is not available in this environment");return{async getRaw(t){return s.getItem(t)},async setRaw(t,e){s.setItem(t,e)},async removeRaw(t){s.removeItem(t)},async keys(t){let e=[];for(let i=0;i<s.length;i++){let n=s.key(i);n&&n.startsWith(t)&&e.push(n)}return e}}}var c=null;function o(){return c||(c=b()),c}function h(s,t){if(typeof s!="string"||!s)throw new TypeError("VBStore: namespace must be a non-empty string");if(typeof t!="string"||!t)throw new TypeError("VBStore: key must be a non-empty string");return`vb:${s}:${t}`}function m(s){if(typeof s!="string"||!s)throw new TypeError("VBStore: namespace must be a non-empty string");return`vb:${s}:`}function y(s){try{let t=JSON.parse(s);if(t&&typeof t=="object"&&typeof t.timestamp=="number")return t}catch{}return null}var a={configure(s={}){c=s.backend??null},async set(s,t,e){let i={data:e,timestamp:Date.now()};await o().setRaw(h(s,t),JSON.stringify(i))},async get(s,t,e){let i=await o().getRaw(h(s,t));if(i==null)return null;let n=y(i);return!n||e?.maxAge!=null&&Date.now()-n.timestamp>e.maxAge?null:n.data},async remove(s,t){await o().removeRaw(h(s,t))},async list(s){let t=m(s),e=await o().keys(t),i=[];for(let n of e){let r=await o().getRaw(n);if(r==null)continue;let u=y(r);u&&i.push({key:n.slice(t.length),data:u.data,timestamp:u.timestamp})}return i},async clear(s){let t=m(s),e=await o().keys(t);for(let i of e)await o().removeRaw(i)},async clearAll(){let s=await o().keys("vb:");for(let t of s)await o().removeRaw(t)},async setMany(s,t){for(let[e,i]of t)await a.set(s,e,i)}};var d=class extends l{#t;#e;#o;#n=50;#i=!1;#u=50;get#a(){return this.getAttribute("direction")==="vertical"}get#l(){let t=this.getAttribute("min"),e=Number(t);return t!==null&&!isNaN(e)?e:10}get#c(){let t=this.getAttribute("max"),e=Number(t);return t!==null&&!isNaN(e)?e:90}get position(){return this.#n}set position(t){this.#s(Number(t))}get collapsed(){return this.#i}set collapsed(t){t?this.#f():this.#p()}reset(){let t=this.getAttribute("position"),e=Number(t),i=t!==null&&!isNaN(e)?e:50;this.#i=!1,this.#s(i),this.#g()}setup(){let t=[...this.children].filter(e=>!e.classList.contains("split-divider"));return t.length<2?!1:(this.#e=t[0],this.#o=t[1],this.#m(),!0)}async#m(){let t=this.getAttribute("position"),e=Number(t),i=t!==null&&!isNaN(e)?e:null,n=await this.#v(),r=i??n??50;return this.#t=document.createElement("div"),this.#t.className="split-divider",this.#t.setAttribute("role","separator"),this.#t.setAttribute("aria-orientation",this.#a?"vertical":"horizontal"),this.#t.setAttribute("aria-valuenow",String(Math.round(r))),this.#t.setAttribute("aria-valuemin",String(this.#l)),this.#t.setAttribute("aria-valuemax",String(this.#c)),this.#t.setAttribute("aria-label","Resize panels"),this.#t.setAttribute("tabindex","0"),this.insertBefore(this.#t,this.#o),this.#s(r),this.listen(this.#t,"pointerdown",this.#y),this.listen(this.#t,"keydown",this.#b),this.hasAttribute("collapsible")&&this.listen(this.#t,"dblclick",this.#w),!0}teardown(){this.#t&&(this.#t.remove(),this.#t=null)}#y=t=>{t.preventDefault(),this.setState("divider-dragging",!0),this.#t.setPointerCapture(t.pointerId),this.#t.addEventListener("pointermove",this.#h),this.#t.addEventListener("pointerup",this.#d)};#h=t=>{if(!this.matches(":state(divider-dragging)"))return;let e=this.getBoundingClientRect(),i;this.#a?i=(t.clientY-e.top)/e.height*100:i=(t.clientX-e.left)/e.width*100,this.#i&&(this.#i=!1),this.#s(i)};#d=t=>{this.setState("divider-dragging",!1),this.#t.releasePointerCapture(t.pointerId),this.#t.removeEventListener("pointermove",this.#h),this.#t.removeEventListener("pointerup",this.#d),this.#r()};#b=t=>{let e=t.shiftKey?10:1,i=this.#n,n=this.#a?["ArrowUp"]:["ArrowLeft"],r=this.#a?["ArrowDown"]:["ArrowRight"];n.includes(t.key)?(t.preventDefault(),this.#s(i-e),this.#r()):r.includes(t.key)?(t.preventDefault(),this.#s(i+e),this.#r()):t.key==="Home"?(t.preventDefault(),this.#s(this.#l),this.#r()):t.key==="End"&&(t.preventDefault(),this.#s(this.#c),this.#r())};#w=()=>{this.#i?this.#p():this.#f(),this.#r()};#f(){this.#u=this.#n,this.#i=!0,this.#e.style.flexBasis="0%",this.#e.style.overflow="hidden",this.#t.setAttribute("aria-valuenow","0"),this.#n=0,this.dispatchEvent(new CustomEvent("split-surface:collapse",{detail:{collapsed:!0},bubbles:!0}))}#p(){this.#i=!1,this.#e.style.overflow="auto",this.#s(this.#u),this.dispatchEvent(new CustomEvent("split-surface:collapse",{detail:{collapsed:!1},bubbles:!0}))}#s(t){let e=this.#i?0:Math.min(this.#c,Math.max(this.#l,t));this.#n=e,this.#e.style.flexBasis=`${e}%`,this.#e.style.flexGrow="0",this.#e.style.flexShrink="0",this.#e.style.overflow="auto",this.#o.style.flexGrow="1",this.#o.style.overflow="auto",this.#t.setAttribute("aria-valuenow",String(Math.round(e))),this.dispatchEvent(new CustomEvent("split-surface:resize",{detail:{position:e},bubbles:!0}))}async#v(){let t=this.getAttribute("persist");if(!t)return null;let e=await a.get("layout",`split:${t}`);return typeof e=="number"?e:null}#r(){let t=this.getAttribute("persist");t&&a.set("layout",`split:${t}`,Math.round(this.#n)).catch(()=>{})}#g(){let t=this.getAttribute("persist");t&&a.remove("layout",`split:${t}`).catch(()=>{})}};p("split-surface",d);export{d as SplitSurface};
2
2
  //# sourceMappingURL=split-surface.js.map
@@ -1,2 +1,2 @@
1
- var E=window.matchMedia("(prefers-reduced-motion: reduce)");var y=new Map;function g(l,e,t={}){let n=t.priority??10,c={impl:e,bundle:t.bundle,contract:t.contract,priority:n},i=y.get(l);if(customElements.get(l)){if(!i||i.priority>=n){i&&i.priority===n&&i.impl!==e&&console.warn(`[VB Bundle] Tag <${l}> already registered by "${i.bundle}" (priority ${i.priority}). Skipping "${t.bundle}".`);return}console.warn(`[VB Bundle] Tag <${l}> 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 <${l}> already registered by "${i.bundle}". Skipping "${t.bundle}" (first wins at equal priority).`);return}y.set(l,c),customElements.define(l,e)}var m=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,t,n,c){e.addEventListener(t,n,c),this.#t.push(()=>e.removeEventListener(t,n,c))}setup(){}teardown(){}};var b=class extends m{static formAssociated=!0;#t;#s;#e;constructor(){super(),this.#t=this.attachInternals()}setup(){this.#a()}#a(){if(this.querySelector("fieldset"))return;let e=Number(this.getAttribute("value")||0);this.#s=e;let t=Number(this.getAttribute("max")||5),n=this.getAttribute("label")||"Rating",c=this.hasAttribute("allow-half"),i=this.hasAttribute("readonly"),d=this.getAttribute("icon"),u=`_sr_${this.getAttribute("name")||`star-rating-${crypto.randomUUID().slice(0,8)}`}`;i?this.#c(e,t,n,d):this.#o(e,t,n,u,c,d),this.#i(e),this.#r()}#o(e,t,n,c,i,d){let a=document.createElement("fieldset");a.setAttribute("data-rating",""),i&&a.setAttribute("data-rating-half",""),a.setAttribute("data-effect","rating");let u=document.createElement("legend");if(u.textContent=n,a.appendChild(u),i)for(let r=1;r<=t;r++){let s=r-.5,o=document.createElement("label");o.setAttribute("data-half","left");let h=document.createElement("input");h.type="radio",h.name=c,h.value=String(s),h.setAttribute("aria-label",`${s} ${s===1?"star":"stars"}`),e===s&&(h.checked=!0),o.appendChild(h),o.append(this.#n(d)),a.appendChild(o);let p=document.createElement("label");p.setAttribute("data-half","right");let f=document.createElement("input");f.type="radio",f.name=c,f.value=String(r),f.setAttribute("aria-label",`${r} ${r===1?"star":"stars"}`),e===r&&(f.checked=!0),p.appendChild(f),p.append(this.#n(d)),a.appendChild(p)}else for(let r=1;r<=t;r++){let s=document.createElement("label"),o=document.createElement("input");o.type="radio",o.name=c,o.value=String(r),o.setAttribute("aria-label",`${r} ${r===1?"star":"stars"}`),e===r&&(o.checked=!0),s.appendChild(o),s.append(this.#n(d)),a.appendChild(s)}this.appendChild(a),this.#e=a,a.addEventListener("rating:change",r=>{this.#i(r.detail.value),this.#r()}),a.addEventListener("change",r=>{let s=r.target;s.type==="radio"&&s.checked&&(this.#i(Number(s.value)),this.#r())})}#c(e,t,n,c){let i=document.createElement("fieldset");i.setAttribute("data-rating",""),i.setAttribute("data-rating-readonly",""),i.setAttribute("role","img"),i.setAttribute("aria-label",`${n}: ${e} out of ${t}`);let d=document.createElement("legend");d.textContent=n,i.appendChild(d);let a=Math.floor(e),u=e-a;for(let r=1;r<=t;r++){let s=document.createElement("span");if(s.setAttribute("aria-hidden","true"),r<=a)s.classList.add("star-filled");else if(r===a+1&&u>0){s.classList.add("star-partial"),s.style.setProperty("--_star-fill",`${u*100}%`);let o=document.createElement("span");o.classList.add("star-partial-fill"),o.append(this.#n(c)),s.appendChild(o)}else s.classList.add("star-empty");s.append(this.#n(c)),i.appendChild(s)}this.appendChild(i),this.#e=i}#n(e){if(e){let t=document.createElement("icon-wc");return t.setAttribute("name",e),t}return document.createTextNode("\u2605")}#i(e){let t=Number(e);t>0?this.#t.setFormValue(String(t)):this.#t.setFormValue(null)}#r(){this.hasAttribute("required")?this.#e?.querySelector('input[type="radio"]:checked')?this.#t.setValidity({}):this.#t.setValidity({valueMissing:!0},"Please select a rating",this.#e||this):this.#t.setValidity({})}formResetCallback(){if(this.#e){if(this.#e.querySelectorAll('input[type="radio"]').forEach(e=>{e.checked=!1}),this.#s>0){let e=this.#e.querySelector(`input[value="${this.#s}"]`);e&&(e.checked=!0)}this.#i(this.#s),this.#r()}}formStateRestoreCallback(e){if(!e||!this.#e)return;let t=this.#e.querySelector(`input[value="${e}"]`);t&&(t.checked=!0,this.#i(Number(e)),this.#r())}get value(){if(!this.#e)return Number(this.getAttribute("value")||0);let e=this.#e.querySelector('input[type="radio"]:checked');return e?Number(e.value):0}set value(e){if(!this.#e)return;this.#e.querySelectorAll('input[type="radio"]').forEach(n=>{n.checked=!1});let t=Number(e);if(t>0){let n=this.#e.querySelector(`input[value="${t}"]`);n&&(n.checked=!0)}this.#i(t),this.#r()}};g("star-rating",b);export{b as StarRating};
1
+ var E=window.matchMedia("(prefers-reduced-motion: reduce)");var y=new Map;function g(l,e,t={}){let r=t.priority??10,a={impl:e,bundle:t.bundle,contract:t.contract,priority:r},i=y.get(l);if(customElements.get(l)){if(!i||i.priority>=r){i&&i.priority===r&&i.impl!==e&&console.warn(`[VB Bundle] Tag <${l}> already registered by "${i.bundle}" (priority ${i.priority}). Skipping "${t.bundle}".`);return}console.warn(`[VB Bundle] Tag <${l}> defined by "${i.bundle}" cannot be replaced (customElements.define is permanent). "${t.bundle}" has higher priority but arrived late.`);return}if(i&&i.priority>=r){i.priority===r&&console.warn(`[VB Bundle] Tag <${l}> already registered by "${i.bundle}". Skipping "${t.bundle}" (first wins at equal priority).`);return}y.set(l,a),customElements.define(l,e)}var m=class extends HTMLElement{#t=[];#i;connectedCallback(){this.hasAttribute("data-upgraded")||this.setup()!==!1&&(this.setAttribute("data-upgraded",""),queueMicrotask(()=>{this.dispatchEvent(new CustomEvent(`${this.localName}:upgraded`,{bubbles:!0}))}))}disconnectedCallback(){for(let e of this.#t)e();this.#t=[],this.removeAttribute("data-upgraded"),this.teardown()}listen(e,t,r,a){e.addEventListener(t,r,a),this.#t.push(()=>e.removeEventListener(t,r,a))}setup(){}teardown(){}setState(e,t){this.#i||(this.#i=this.attachInternals());let r=this.#i.states;try{t?r.add(e):r.delete(e)}catch{let a=`--${e}`;t?r.add(a):r.delete(a)}}_adoptInternals(e){this.#i||(this.#i=e)}};var b=class extends m{static formAssociated=!0;#t;#i;#e;constructor(){super(),this.#t=this.attachInternals(),this._adoptInternals(this.#t)}setup(){this.#a()}#a(){if(this.querySelector("fieldset"))return;let e=Number(this.getAttribute("value")||0);this.#i=e;let t=Number(this.getAttribute("max")||5),r=this.getAttribute("label")||"Rating",a=this.hasAttribute("allow-half"),i=this.hasAttribute("readonly"),d=this.getAttribute("icon"),u=`_sr_${this.getAttribute("name")||`star-rating-${crypto.randomUUID().slice(0,8)}`}`;i?this.#c(e,t,r,d):this.#o(e,t,r,u,a,d),this.#r(e),this.#s()}#o(e,t,r,a,i,d){let o=document.createElement("fieldset");o.setAttribute("data-rating",""),i&&o.setAttribute("data-rating-half",""),o.setAttribute("data-effect","rating");let u=document.createElement("legend");if(u.textContent=r,o.appendChild(u),i)for(let s=1;s<=t;s++){let n=s-.5,c=document.createElement("label");c.setAttribute("data-half","left");let h=document.createElement("input");h.type="radio",h.name=a,h.value=String(n),h.setAttribute("aria-label",`${n} ${n===1?"star":"stars"}`),e===n&&(h.checked=!0),c.appendChild(h),c.append(this.#n(d)),o.appendChild(c);let p=document.createElement("label");p.setAttribute("data-half","right");let f=document.createElement("input");f.type="radio",f.name=a,f.value=String(s),f.setAttribute("aria-label",`${s} ${s===1?"star":"stars"}`),e===s&&(f.checked=!0),p.appendChild(f),p.append(this.#n(d)),o.appendChild(p)}else for(let s=1;s<=t;s++){let n=document.createElement("label"),c=document.createElement("input");c.type="radio",c.name=a,c.value=String(s),c.setAttribute("aria-label",`${s} ${s===1?"star":"stars"}`),e===s&&(c.checked=!0),n.appendChild(c),n.append(this.#n(d)),o.appendChild(n)}this.appendChild(o),this.#e=o,o.addEventListener("rating:change",s=>{this.#r(s.detail.value),this.#s()}),o.addEventListener("change",s=>{let n=s.target;n.type==="radio"&&n.checked&&(this.#r(Number(n.value)),this.#s())})}#c(e,t,r,a){let i=document.createElement("fieldset");i.setAttribute("data-rating",""),i.setAttribute("data-rating-readonly",""),i.setAttribute("role","img"),i.setAttribute("aria-label",`${r}: ${e} out of ${t}`);let d=document.createElement("legend");d.textContent=r,i.appendChild(d);let o=Math.floor(e),u=e-o;for(let s=1;s<=t;s++){let n=document.createElement("span");if(n.setAttribute("aria-hidden","true"),s<=o)n.classList.add("star-filled");else if(s===o+1&&u>0){n.classList.add("star-partial"),n.style.setProperty("--_star-fill",`${u*100}%`);let c=document.createElement("span");c.classList.add("star-partial-fill"),c.append(this.#n(a)),n.appendChild(c)}else n.classList.add("star-empty");n.append(this.#n(a)),i.appendChild(n)}this.appendChild(i),this.#e=i}#n(e){if(e){let t=document.createElement("icon-wc");return t.setAttribute("name",e),t}return document.createTextNode("\u2605")}#r(e){let t=Number(e);t>0?this.#t.setFormValue(String(t)):this.#t.setFormValue(null)}#s(){this.hasAttribute("required")?this.#e?.querySelector('input[type="radio"]:checked')?this.#t.setValidity({}):this.#t.setValidity({valueMissing:!0},"Please select a rating",this.#e||this):this.#t.setValidity({})}formResetCallback(){if(this.#e){if(this.#e.querySelectorAll('input[type="radio"]').forEach(e=>{e.checked=!1}),this.#i>0){let e=this.#e.querySelector(`input[value="${this.#i}"]`);e&&(e.checked=!0)}this.#r(this.#i),this.#s()}}formStateRestoreCallback(e){if(!e||!this.#e)return;let t=this.#e.querySelector(`input[value="${e}"]`);t&&(t.checked=!0,this.#r(Number(e)),this.#s())}get value(){if(!this.#e)return Number(this.getAttribute("value")||0);let e=this.#e.querySelector('input[type="radio"]:checked');return e?Number(e.value):0}set value(e){if(!this.#e)return;let t=Number(e),r=this.#e.querySelector('input[type="radio"]:checked');if((r?Number(r.value):0)!==t){if(this.#e.querySelectorAll('input[type="radio"]').forEach(i=>{i.checked=!1}),t>0){let i=this.#e.querySelector(`input[value="${t}"]`);i&&(i.checked=!0)}this.#r(t),this.#s()}}};g("star-rating",b);export{b as StarRating};
2
2
  //# sourceMappingURL=star-rating.js.map
@@ -0,0 +1,2 @@
1
+ var u=window.matchMedia("(prefers-reduced-motion: reduce)");var c=new Map;function d(s,t,e={}){let i=e.priority??10,a={impl:t,bundle:e.bundle,contract:e.contract,priority:i},r=c.get(s);if(customElements.get(s)){if(!r||r.priority>=i){r&&r.priority===i&&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>=i){r.priority===i&&console.warn(`[VB Bundle] Tag <${s}> already registered by "${r.bundle}". Skipping "${e.bundle}" (first wins at equal priority).`);return}c.set(s,a),customElements.define(s,t)}var n=class extends HTMLElement{#t=[];#e;connectedCallback(){this.hasAttribute("data-upgraded")||this.setup()!==!1&&(this.setAttribute("data-upgraded",""),queueMicrotask(()=>{this.dispatchEvent(new CustomEvent(`${this.localName}:upgraded`,{bubbles:!0}))}))}disconnectedCallback(){for(let t of this.#t)t();this.#t=[],this.removeAttribute("data-upgraded"),this.teardown()}listen(t,e,i,a){t.addEventListener(e,i,a),this.#t.push(()=>t.removeEventListener(e,i,a))}setup(){}teardown(){}setState(t,e){this.#e||(this.#e=this.attachInternals());let i=this.#e.states;try{e?i.add(t):i.delete(t)}catch{let a=`--${t}`;e?i.add(a):i.delete(a)}}_adoptInternals(t){this.#e||(this.#e=t)}};var l=new Set(["live","recording","streaming","error","online","running","away","paused","busy","offline","stopped"]),o=class extends n{static observedAttributes=["data-variant","data-live"];#t;setup(){let t=document.createElement("span");for(t.className="status-dot",t.setAttribute("aria-hidden","true"),this.#t=document.createElement("span"),this.#t.className="status-label";this.firstChild;)this.#t.appendChild(this.firstChild);this.appendChild(t),this.appendChild(this.#t),this.#e(),this.#i(),this.#s()}attributeChangedCallback(t,e,i){!this.isConnected||e===i||(t==="data-variant"?(this.#i(),this.dispatchEvent(new CustomEvent("status-wc:change",{bubbles:!0,detail:{variant:i,previousVariant:e}}))):t==="data-live"&&this.#e())}#e(){this.getAttribute("data-live")==="off"?(this.removeAttribute("role"),this.removeAttribute("aria-live")):(this.hasAttribute("role")||this.setAttribute("role","status"),this.hasAttribute("aria-live")||this.setAttribute("aria-live","polite"))}#i(){let t=this.getAttribute("data-variant");t&&(l.has(t)||this.#r(t)||console.info(`[status-wc] data-variant="${t}" is not a built-in; add a CSS rule (status-wc[data-variant="${t}"] { --status-dot-color: \u2026; }) or use a built-in.`))}#r(t){let e=this.querySelector(".status-dot");if(!e)return!0;let i=getComputedStyle(e).getPropertyValue("--status-dot-color").trim();return i&&i!==""}#s(){let t=this.#t?.textContent.trim(),e=this.hasAttribute("aria-label");!t&&!e&&console.warn("[status-wc] needs slot text or aria-label for accessibility.")}get variant(){return this.getAttribute("data-variant")}set variant(t){t?this.setAttribute("data-variant",t):this.removeAttribute("data-variant")}};d("status-wc",o);export{o as StatusWc};
2
+ //# sourceMappingURL=status-wc.js.map
@@ -0,0 +1,2 @@
1
+ var k=window.matchMedia("(prefers-reduced-motion: reduce)");var m=new Map;function b(r,t,e={}){let i=e.priority??10,s={impl:t,bundle:e.bundle,contract:e.contract,priority:i},n=m.get(r);if(customElements.get(r)){if(!n||n.priority>=i){n&&n.priority===i&&n.impl!==t&&console.warn(`[VB Bundle] Tag <${r}> already registered by "${n.bundle}" (priority ${n.priority}). Skipping "${e.bundle}".`);return}console.warn(`[VB Bundle] Tag <${r}> defined by "${n.bundle}" cannot be replaced (customElements.define is permanent). "${e.bundle}" has higher priority but arrived late.`);return}if(n&&n.priority>=i){n.priority===i&&console.warn(`[VB Bundle] Tag <${r}> already registered by "${n.bundle}". Skipping "${e.bundle}" (first wins at equal priority).`);return}m.set(r,s),customElements.define(r,t)}var l=class extends HTMLElement{#r=[];#t;connectedCallback(){this.hasAttribute("data-upgraded")||this.setup()!==!1&&(this.setAttribute("data-upgraded",""),queueMicrotask(()=>{this.dispatchEvent(new CustomEvent(`${this.localName}:upgraded`,{bubbles:!0}))}))}disconnectedCallback(){for(let t of this.#r)t();this.#r=[],this.removeAttribute("data-upgraded"),this.teardown()}listen(t,e,i,s){t.addEventListener(e,i,s),this.#r.push(()=>t.removeEventListener(e,i,s))}setup(){}teardown(){}setState(t,e){this.#t||(this.#t=this.attachInternals());let i=this.#t.states;try{e?i.add(t):i.delete(t)}catch{let s=`--${t}`;e?i.add(s):i.delete(s)}}_adoptInternals(t){this.#t||(this.#t=t)}};var g='<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" aria-hidden="true"><line x1="5" y1="12" x2="19" y2="12"/></svg>',v='<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" aria-hidden="true"><line x1="12" y1="5" x2="12" y2="19"/><line x1="5" y1="12" x2="19" y2="12"/></svg>';function y(r){if(!r)return[];let t=r.trim();if(t.startsWith("["))try{return JSON.parse(t).map(i=>({value:String(i.value),label:String(i.label??i.value)}))}catch{return[]}return t.split(",").map(e=>{let i=e.trim();return{value:i,label:i}})}function x(r){return r?r.split(",").map(t=>t.trim()).filter(Boolean):[]}function A(r){let t=Math.max(0,Math.round(r)),e=Math.floor(t/3600),i=Math.floor(t%3600/60),s=t%60,n=a=>String(a).padStart(2,"0");return e>0?`${e}:${n(i)}:${n(s)}`:`${i}:${n(s)}`}function S(r,t){let e=Number(r)||0,i=["B","KB","MB","GB","TB","PB"],s=0,n=Math.abs(e);for(;n>=1e3&&s<i.length-1;)n/=1e3,s+=1;let a=new Intl.NumberFormat(t,{minimumFractionDigits:s===0?0:1,maximumFractionDigits:s===0?0:2});return`${e<0?"-":""}${a.format(n)} ${i[s]}`}function w(){return document.documentElement.lang||void 0}function d(r){let t=String(r),e=t.indexOf(".");return e<0?0:t.length-e-1}var f=class extends l{static formAssociated=!0;static observedAttributes=["value","disabled","readonly"];#r;#t;#n=-1/0;#a=1/0;#b=1;#h=[];#s=[];#o;#M;#d="";#$=!1;#C=!1;#p;#i;#F;#e;#g;#y;#u;#l;#w;#x=0;#v=0;#k=!1;#N=!1;constructor(){super(),this.#r=this.attachInternals(),this._adoptInternals(this.#r)}setup(){this.#O(),this.#q(),this.#H();let t=this.getAttribute("value");this.#F=t,this.#c(t??this.#A(),"init")}attributeChangedCallback(t,e,i){!this.isConnected||!this.#e||(t==="value"?this.#c(i??this.#A(),"attr"):(t==="disabled"||t==="readonly")&&this.#B())}#O(){this.hasAttribute("data-options")?this.#t="enum":this.hasAttribute("data-values")?this.#t="token":this.hasAttribute("data-format")||this.hasAttribute("data-suffix")?this.#t="formatted":(this.#t="numeric",console.info('[stepper-wc] No mode attribute set. Plain numeric stepping is better served by `<input type="number" data-stepper>`. See /docs/concepts/numeric-inputs/'))}#q(){this.#n=this.hasAttribute("data-min")?Number(this.getAttribute("data-min")):-1/0,this.#a=this.hasAttribute("data-max")?Number(this.getAttribute("data-max")):1/0,this.#b=Number(this.getAttribute("data-step"))||1,this.#h=x(this.getAttribute("data-values")),this.#s=y(this.getAttribute("data-options")),this.#o=this.getAttribute("data-format")||(this.hasAttribute("data-suffix")?"number":null),this.#M=this.getAttribute("data-currency")||"USD",this.#d=this.getAttribute("data-suffix")||"",this.#$=this.hasAttribute("data-show-label"),this.#C=this.hasAttribute("data-accelerate"),this.#p=w(),this.#w=this.#P()}#P(){if(!this.#o)return null;let t=d(this.#b);return this.#o==="number"?new Intl.NumberFormat(this.#p,{minimumFractionDigits:t,maximumFractionDigits:t}):this.#o==="currency"?new Intl.NumberFormat(this.#p,{style:"currency",currency:this.#M}):this.#o==="percent"?new Intl.NumberFormat(this.#p,{style:"percent",minimumFractionDigits:t,maximumFractionDigits:t}):null}#A(){return this.#t==="enum"?this.#s[0]?.value??"":this.#t==="token"?this.#h[0]??"":"0"}#H(){this.replaceChildren(),this.#u=document.createElement("button"),this.#u.type="button",this.#u.className="stepper-dec",this.#u.setAttribute("aria-label","Decrease"),this.#u.setAttribute("tabindex","-1"),this.#u.innerHTML=g,this.#l=document.createElement("button"),this.#l.type="button",this.#l.className="stepper-inc",this.#l.setAttribute("aria-label","Increase"),this.#l.setAttribute("tabindex","-1"),this.#l.innerHTML=v,this.#e=document.createElement("span"),this.#e.className="stepper-value",this.#e.setAttribute("role","spinbutton"),this.#e.setAttribute("tabindex","0"),this.#g=document.createElement("span"),this.#g.className="stepper-value-display",this.#e.appendChild(this.#g),this.#y=new Set;for(let t of this.#V())this.#I(t);this.appendChild(this.#u),this.appendChild(this.#e),this.appendChild(this.#l),this.#D(this.#u,-1),this.#D(this.#l,1),this.listen(this.#e,"keydown",this.#R),this.#B()}#D(t,e){if(this.listen(t,"click",s=>{if(this.#N){this.#N=!1,s.preventDefault();return}this.#f(e,1)}),!this.#C)return;this.listen(t,"pointerdown",s=>{let n=s;n.pointerType==="mouse"&&n.button!==0||this.#E()||(this.#k=!1,this.#x=window.setTimeout(()=>{this.#k=!0,this.#v=window.setInterval(()=>this.#f(e,1),100),this.#x=window.setTimeout(()=>{window.clearInterval(this.#v),this.#v=window.setInterval(()=>this.#f(e,5),50)},1e3)},500))});let i=()=>{window.clearTimeout(this.#x),window.clearInterval(this.#v),this.#x=0,this.#v=0,this.#k&&(this.#N=!0)};this.listen(t,"pointerup",i),this.listen(t,"pointerleave",i),this.listen(t,"pointercancel",i)}#R=t=>{if(!this.#E())switch(t.key){case"ArrowUp":case"ArrowRight":t.preventDefault(),this.#f(1,1);break;case"ArrowDown":case"ArrowLeft":t.preventDefault(),this.#f(-1,1);break;case"PageUp":t.preventDefault(),this.#f(1,10);break;case"PageDown":t.preventDefault(),this.#f(-1,10);break;case"Home":t.preventDefault(),this.#T("min");break;case"End":t.preventDefault(),this.#T("max");break;default:}};#E(){return this.hasAttribute("disabled")||this.hasAttribute("readonly")}#B(){let t=this.hasAttribute("disabled");this.#u.disabled=t,this.#l.disabled=t,this.#e.setAttribute("aria-disabled",String(t)),t?this.#e.removeAttribute("tabindex"):this.#e.setAttribute("tabindex","0")}#f(t,e){if(this.#E())return;let i=this.#U(t,e);i===null||i===this.#i||this.#c(i,"step")}#T(t){if(this.#t==="enum"){let i=t==="min"?0:this.#s.length-1;this.#c(this.#s[i]?.value,"step");return}if(this.#t==="token"){let i=t==="min"?0:this.#h.length-1;this.#c(this.#h[i],"step");return}let e=t==="min"?this.#n===-1/0?this.#i:this.#n:this.#a===1/0?this.#i:this.#a;this.#c(String(e),"step")}#U(t,e){if(this.#t==="enum"){let h=this.#s.findIndex(p=>p.value===this.#i),o=h===-1?0:h,c=Math.min(this.#s.length-1,Math.max(0,o+t*e));return this.#s[c]?.value}if(this.#t==="token"){let o=this.#S(this.#i);o===-1&&(o=this.#j(this.#i));let c=Math.min(this.#h.length-1,Math.max(0,o+t*e));return this.#h[c]}let i=Number(this.#i)||0,s=d(this.#b),n=i+t*this.#b*e,a=Number(n.toFixed(s)),u=Math.min(this.#a,Math.max(this.#n,a));return String(u)}#S(t){if(t==null)return-1;let e=this.#h.indexOf(String(t));if(e!==-1)return e;let i=Number(t);if(Number.isFinite(i)){let s=this.#h.findIndex(n=>Number(n)===i);if(s!==-1)return s}return-1}#j(t){let e=Number(t);if(!Number.isFinite(e))return 0;let i=0,s=1/0;return this.#h.forEach((n,a)=>{let u=Number(n);if(!Number.isFinite(u))return;let h=Math.abs(u-e);h<s&&(s=h,i=a)}),i}#c(t,e){let i=this.#G(t),s=i!==this.#i;this.#i=i,this.getAttribute("value")!==String(i)&&this.setAttribute("value",String(i)),this.#z(),this.#K(),this.#J(),this.#W(),this.#Q(),s&&e!=="init"&&(this.dispatchEvent(new Event("input",{bubbles:!0})),this.dispatchEvent(new Event("change",{bubbles:!0})))}#G(t){if(t==null)return this.#A();if(this.#t==="enum"){let s=String(t);return this.#s.find(a=>a.value===s)?s:this.#s[0]?.value??""}if(this.#t==="token")return String(t);let e=Number(t);if(!Number.isFinite(e))return String(this.#n===-1/0?0:this.#n);let i=d(this.#b);return String(Number(Math.min(this.#a,Math.max(this.#n,e)).toFixed(i)))}#z(){let t=this.#m();this.#g.textContent=t,this.#I(t)}#m(t=this.#i){if(this.#t==="enum")return this.#s.find(i=>i.value===t)?.label??t??"";if(this.#t==="token"){let e=this.#$?String(t).replace(/^--/,""):String(t);return this.#d?`${e}${this.#d}`:e}if(this.#t==="formatted"){let e=Number(t)||0;if(this.#o==="duration")return A(e);if(this.#o==="bytes")return S(e,this.#p);if(this.#w){let i=this.#o==="percent"?e/100:e,s=this.#w.format(i);return this.#d&&this.#o==="number"?`${s}${this.#d}`:s}return this.#d?`${e}${this.#d}`:String(e)}return String(t??"")}#V(){if(this.#t==="enum")return this.#s.map(i=>this.#m(i.value));if(this.#t==="token")return this.#h.map(i=>this.#m(i));let t=new Set,e=i=>{Number.isFinite(i)&&t.add(i)};if(this.#n!==-1/0&&e(this.#n),this.#a!==1/0&&e(this.#a),e(Number(this.getAttribute("value"))||0),this.#a===1/0){let i=[10,100,1e3,1e4];for(let s of i)e(s);if(this.#o==="bytes")for(let s of[999,999e3,999e6,999e9])e(s)}return[...t].map(i=>this.#m(String(i)))}#I(t){let e=String(t??"");if(!e||this.#y.has(e))return;this.#y.add(e);let i=document.createElement("span");i.className="stepper-value-reserve",i.setAttribute("aria-hidden","true"),i.textContent=e,this.#e.appendChild(i)}recomputeWidth(){if(this.#e){this.#e.querySelectorAll(".stepper-value-reserve").forEach(t=>t.remove()),this.#y=new Set;for(let t of this.#V())this.#I(t)}}#K(){if(this.#t==="enum"){let e=this.#s.findIndex(i=>i.value===this.#i);this.#e.setAttribute("aria-valuemin","1"),this.#e.setAttribute("aria-valuemax",String(this.#s.length)),this.#e.setAttribute("aria-valuenow",String((e===-1?0:e)+1)),this.#e.setAttribute("aria-valuetext",this.#m());return}if(this.#t==="token"){let e=this.#S(this.#i);this.#e.setAttribute("aria-valuemin","1"),this.#e.setAttribute("aria-valuemax",String(this.#h.length)),this.#e.setAttribute("aria-valuenow",String((e===-1?0:e)+1)),this.#e.setAttribute("aria-valuetext",this.#m());return}let t=Number(this.#i)||0;this.#n!==-1/0?this.#e.setAttribute("aria-valuemin",String(this.#n)):this.#e.removeAttribute("aria-valuemin"),this.#a!==1/0?this.#e.setAttribute("aria-valuemax",String(this.#a)):this.#e.removeAttribute("aria-valuemax"),this.#e.setAttribute("aria-valuenow",String(t)),this.#e.setAttribute("aria-valuetext",this.#m())}#J(){let t=this.#L(),e=this.#_();this.#u.disabled=t||this.hasAttribute("disabled"),this.#l.disabled=e||this.hasAttribute("disabled")}#L(){return this.#t==="enum"?this.#i===this.#s[0]?.value:this.#t==="token"?this.#S(this.#i)===0:this.#n!==-1/0&&Number(this.#i)<=this.#n}#_(){return this.#t==="enum"?this.#i===this.#s[this.#s.length-1]?.value:this.#t==="token"?this.#S(this.#i)===this.#h.length-1:this.#a!==1/0&&Number(this.#i)>=this.#a}#W(){this.#r.setFormValue(String(this.#i??""))}#Q(){this.setState("at-min",this.#L()),this.setState("at-max",this.#_())}formResetCallback(){this.#c(this.#F??this.#A(),"reset")}formStateRestoreCallback(t){t!=null&&this.#c(t,"restore")}get displayText(){return this.#g?.textContent??""}get value(){return this.#i==null?"":String(this.#i)}set value(t){String(t)!==String(this.#i)&&this.#c(t,"api")}get form(){return this.#r.form}get name(){return this.getAttribute("name")}get type(){return this.localName}get validity(){return this.#r.validity}get validationMessage(){return this.#r.validationMessage}checkValidity(){return this.#r.checkValidity()}reportValidity(){return this.#r.reportValidity()}};b("stepper-wc",f);export{f as StepperWc};
2
+ //# sourceMappingURL=stepper-wc.js.map