contour-ds 1.9.0 → 1.10.0

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 (130) hide show
  1. package/README.md +4 -4
  2. package/dist/build-manifest.json +205 -204
  3. package/dist/contour-wc-content.esm.js +1 -1
  4. package/dist/contour-wc-content.esm.min.js +1 -1
  5. package/dist/contour-wc-core.esm.js +712 -45
  6. package/dist/contour-wc-core.esm.min.js +1 -1
  7. package/dist/contour-wc-dashboard.esm.js +596 -90
  8. package/dist/contour-wc-dashboard.esm.min.js +1 -1
  9. package/dist/contour-wc-data.esm.js +467 -70
  10. package/dist/contour-wc-data.esm.min.js +1 -1
  11. package/dist/contour-wc-docs.esm.js +1 -1
  12. package/dist/contour-wc-docs.esm.min.js +1 -1
  13. package/dist/contour-wc-feedback.esm.js +260 -29
  14. package/dist/contour-wc-feedback.esm.min.js +1 -1
  15. package/dist/contour-wc-forms.esm.js +133 -40
  16. package/dist/contour-wc-forms.esm.min.js +1 -1
  17. package/dist/contour-wc-interaction.esm.js +64 -5
  18. package/dist/contour-wc-interaction.esm.min.js +1 -1
  19. package/dist/contour-wc-layout.esm.js +72 -10
  20. package/dist/contour-wc-layout.esm.min.js +1 -1
  21. package/dist/contour-wc-map.esm.js +69 -9
  22. package/dist/contour-wc-map.esm.min.js +1 -1
  23. package/dist/contour-wc-misc.esm.js +1 -1
  24. package/dist/contour-wc-misc.esm.min.js +1 -1
  25. package/dist/contour-wc-navigation.esm.js +136 -20
  26. package/dist/contour-wc-navigation.esm.min.js +1 -1
  27. package/dist/contour-wc-ui.esm.js +505 -80
  28. package/dist/contour-wc-ui.esm.min.js +1 -1
  29. package/dist/contour-wc.esm.js +2539 -320
  30. package/dist/contour-wc.esm.min.js +1 -1
  31. package/dist/contour-wc.js +2539 -320
  32. package/dist/contour-wc.min.js +1 -1
  33. package/dist/contour.code-snippets +44 -0
  34. package/dist/contour.components.json +12064 -135
  35. package/dist/contour.css +1368 -451
  36. package/dist/contour.d.ts +42 -21
  37. package/dist/contour.esm.js +138 -21
  38. package/dist/contour.esm.min.js +1 -1
  39. package/dist/contour.html-data.json +249 -9
  40. package/dist/contour.js +138 -21
  41. package/dist/contour.min.css +1 -1
  42. package/dist/contour.min.js +1 -1
  43. package/dist/contour.react.d.ts +5 -1
  44. package/dist/contour.single.html +2 -2
  45. package/dist/contour.single.min.css +1 -1
  46. package/dist/contour.tokens.json +36 -1
  47. package/dist/contour.vue.d.ts +5 -1
  48. package/dist/contour.web-types.json +241 -9
  49. package/dist/custom-elements.json +1225 -55
  50. package/dist/docs/actions.md +1 -1
  51. package/dist/docs/affordances.md +1 -1
  52. package/dist/docs/apireference.md +1 -1
  53. package/dist/docs/colour.md +1 -1
  54. package/dist/docs/componentindex.md +1 -1
  55. package/dist/docs/data.md +6 -2
  56. package/dist/docs/docs.md +1 -1
  57. package/dist/docs/feedback.md +1 -1
  58. package/dist/docs/field.md +1 -1
  59. package/dist/docs/forms.md +1 -1
  60. package/dist/docs/index.json +8 -8
  61. package/dist/docs/install.md +1 -1
  62. package/dist/docs/landing.md +1 -1
  63. package/dist/docs/mapengine.md +1 -1
  64. package/dist/docs/motion.md +1 -1
  65. package/dist/docs/navigation.md +1 -1
  66. package/dist/docs/overlays.md +1 -1
  67. package/dist/docs/overview.md +1 -1
  68. package/dist/docs/patterns.md +1 -1
  69. package/dist/docs/playground.md +1 -1
  70. package/dist/docs/principles.md +1 -1
  71. package/dist/docs/recipes.md +1 -1
  72. package/dist/docs/space.md +1 -1
  73. package/dist/docs/status.md +1 -1
  74. package/dist/docs/surfaces.md +1 -1
  75. package/dist/docs/theming.md +5 -2
  76. package/dist/docs/type.md +1 -1
  77. package/dist/docs/webcomponents.md +1 -1
  78. package/dist/hljs.css +34 -17
  79. package/dist/map-chrome-contract.json +26 -0
  80. package/dist/map-chrome.mapbox.css +121 -0
  81. package/dist/map-chrome.maplibre.css +121 -0
  82. package/dist/registry/items/contour-core.json +2 -2
  83. package/dist/registry/items/contour-data.json +2 -2
  84. package/dist/registry/items/contour-docs.json +2 -2
  85. package/dist/registry/items/contour-landing.json +2 -2
  86. package/dist/registry/registry.json +8 -8
  87. package/dist/surfaces/contour-core.min.css +1 -1
  88. package/dist/surfaces/contour-data.min.css +1 -1
  89. package/dist/surfaces/contour-docs.min.css +1 -1
  90. package/dist/surfaces/contour-landing.min.css +1 -1
  91. package/dist/wc/behaviours.mjs +11 -3
  92. package/dist/wc/core.mjs +307 -32
  93. package/dist/wc/dashboard.mjs +129 -20
  94. package/dist/wc/data-chart.mjs +170 -22
  95. package/dist/wc/data-export.mjs +150 -29
  96. package/dist/wc/data-gauge.mjs +11 -4
  97. package/dist/wc/data-geo.mjs +1 -1
  98. package/dist/wc/data-legend.mjs +15 -2
  99. package/dist/wc/data-readout.mjs +12 -1
  100. package/dist/wc/data-series.mjs +73 -5
  101. package/dist/wc/data-table.mjs +37 -8
  102. package/dist/wc/feedback.mjs +259 -28
  103. package/dist/wc/forms-controls.mjs +44 -16
  104. package/dist/wc/forms-field.mjs +46 -4
  105. package/dist/wc/forms-groups.mjs +31 -8
  106. package/dist/wc/forms-input.mjs +11 -11
  107. package/dist/wc/index.mjs +1 -1
  108. package/dist/wc/interaction.mjs +63 -4
  109. package/dist/wc/layout.mjs +72 -10
  110. package/dist/wc/map.mjs +68 -8
  111. package/dist/wc/navigation-menu.mjs +43 -9
  112. package/dist/wc/navigation-shell.mjs +39 -6
  113. package/dist/wc/navigation-tree.mjs +53 -4
  114. package/dist/wc/states.mjs +350 -9
  115. package/dist/wc/svg.mjs +43 -0
  116. package/dist/wc/ui-data.mjs +268 -28
  117. package/dist/wc/ui-feedback.mjs +36 -11
  118. package/dist/wc/ui-inputs.mjs +63 -25
  119. package/dist/wc/ui-overlays.mjs +138 -16
  120. package/integrations/ai/v0-prompt.md +1 -1
  121. package/integrations/frameworks/fixtures/authored/sample.jsx +15 -0
  122. package/integrations/frameworks/fixtures/authored/sample.vue +15 -0
  123. package/integrations/frameworks/fixtures/dist/rendered.html +32 -0
  124. package/integrations/libreship/contract.json +1025 -0
  125. package/integrations/native/README.md +24 -4
  126. package/integrations/native/build/android/colors.xml +278 -0
  127. package/integrations/native/build/flutter/contour_tokens.dart +280 -0
  128. package/integrations/native/build/ios/ContourTokens.swift +280 -0
  129. package/integrations/validate-markup.mjs +57 -7
  130. package/package.json +45 -18
@@ -1,4 +1,4 @@
1
- import { CLASS_ONLY, CONTOUR_EVENTS, ContourBase, MERCATOR_MAX_LAT, MODS, OBSERVED, REGISTERED, applyLabel, bearing, clampLat, contourId, cssLength, define, flagOn, flagOnValue, formatValue, haversine, headingTag, iconMarkup, isRtl, labelText, levelFromAttributes, mercatorResolution, navKey, normaliseLng, onDispose, safeColor, safeHref, sanitizeHtml, setHTML, simple, statusIcon, supportsUntilFound, unwrapBounds, warnBadJson, wcEmitOverlay, withBrownout, MARKER_SHAPES, arcPath, assignMarkers, barRects, compassNeedle, contourPaths, donutSlices, isMissing, marchingSquares, markerStyles, niceTicks, polylinePoints, scaleBarTicks, smoothPath, modalContain, wcReset, wireCombobox, wireCopy, wireMenu, wirePagination, wireRemovable, wireSegmented, wireTabs, wireTree, STATE_FALLBACK, loadRemote, parseArrayAttr, remoteData, remoteInvalidate, remoteRefresh, remoteVisible, renderEmpty, renderStates, stateLabel, watchViewport, wireStates } from "./contour-wc-core.esm.js";
1
+ import { CLASS_ONLY, CONTOUR_EVENTS, ContourBase, MERCATOR_MAX_LAT, MODS, OBSERVED, REGISTERED, applyLabel, bearing, clampLat, contourId, cssLength, define, flagOn, flagOnValue, formatValue, haversine, headingTag, iconMarkup, isRtl, labelText, levelFromAttributes, mercatorResolution, navKey, normaliseLng, onDispose, safeColor, safeHref, sanitizeHtml, setHTML, simple, statusIcon, supportsUntilFound, unwrapBounds, warnBadJson, wcEmitOverlay, withBrownout, PROPERTY_FIELDS, normalizeProperty, propertyDescriptor, propertyTypeOf, contourDiagnosticsEnabled, setContourDiagnostics, MARKER_SHAPES, arcPath, assignMarkers, barRects, compassNeedle, contourPaths, donutSlices, isMissing, marchingSquares, markerStyles, niceTicks, polylinePoints, scaleBarTicks, smoothPath, modalContain, wcReset, wireCombobox, wireCopy, wireMenu, wirePagination, wireRemovable, wireSegmented, wireTabs, wireTree, STATE_FALLBACK, loadRemote, parseArrayAttr, remoteData, remoteInvalidate, remoteRefresh, remoteVisible, renderEmpty, renderStates, stateLabel, virtualRange, watchViewport, wireStates } from "./contour-wc-core.esm.js";
2
2
 
3
3
  // ---- Registration: class-only wrappers run last (define() skips claimed names) ----
4
4
  define("contour-box", simple(["c-box"]));
@@ -1 +1 @@
1
- import{CLASS_ONLY,CONTOUR_EVENTS,ContourBase,MERCATOR_MAX_LAT,MODS,OBSERVED,REGISTERED,applyLabel,bearing,clampLat,contourId,cssLength,define,flagOn,flagOnValue,formatValue,haversine,headingTag,iconMarkup,isRtl,labelText,levelFromAttributes,mercatorResolution,navKey,normaliseLng,onDispose,safeColor,safeHref,sanitizeHtml,setHTML,simple,statusIcon,supportsUntilFound,unwrapBounds,warnBadJson,wcEmitOverlay,withBrownout,MARKER_SHAPES,arcPath,assignMarkers,barRects,compassNeedle,contourPaths,donutSlices,isMissing,marchingSquares,markerStyles,niceTicks,polylinePoints,scaleBarTicks,smoothPath,modalContain,wcReset,wireCombobox,wireCopy,wireMenu,wirePagination,wireRemovable,wireSegmented,wireTabs,wireTree,STATE_FALLBACK,loadRemote,parseArrayAttr,remoteData,remoteInvalidate,remoteRefresh,remoteVisible,renderEmpty,renderStates,stateLabel,watchViewport,wireStates}from"./contour-wc-core.esm.js";define("contour-box",simple(["c-box"])),define("contour-cluster",simple(["c-cluster"])),define("contour-container",simple(["c-container"])),define("contour-row",simple(["c-row"])),define("contour-scrim",simple(["c-scrim"])),define("contour-stack",simple(["c-stack"]));const assignedText=t=>{const e=t.querySelector("slot");return(e?e.assignedElements({flatten:!0}):[]).map(t=>(t.textContent||"").trim()).join(" ").trim()||(t.textContent||"").trim()};let ADOPTED=null,ADOPTED_KEY="";const _hashCss=t=>{let e=2166136261;for(let s=0;s<t.length;s++)e^=t.charCodeAt(s),e=Math.imul(e,16777619);return(e>>>0).toString(36)};export const adoptedSheets=()=>{let t=document.styleSheets.length+":";for(const e of document.styleSheets){let s="-1";try{const t=e.cssRules;let a="";for(let e=0;e<t.length;e++)a+=t[e].cssText+"\n";s=t.length+":"+_hashCss(a)}catch(t){}t+=(e.href||"inline")+"~"+s+"|"}if(ADOPTED&&t===ADOPTED_KEY)return ADOPTED;ADOPTED_KEY=t,ADOPTED=[];const e=(t,s)=>{let a;try{a=t.cssRules}catch(t){return}if(a)for(const t of a)if(t instanceof CSSImportRule)t.styleSheet&&e(t.styleSheet,s);else try{s.push(t.cssText)}catch(t){}};for(const t of document.styleSheets)try{if(!t.href||new URL(t.href).origin===location.origin){const s=[];e(t,s);const a=new CSSStyleSheet;s.length&&a.replaceSync(s.join("\n")),ADOPTED.push(a)}}catch(t){}return ADOPTED};const _ShadowParent="undefined"!=typeof HTMLElement?HTMLElement:Object;class ContourShadow extends _ShadowParent{static get observedAttributes(){return MODS.concat("labels")}constructor(){super();let t=this.shadowRoot;t||(t=this.attachShadow({mode:"open"}),this.constructor.contourTemplate&&t.appendChild(this.constructor.contourTemplate.content.cloneNode(!0)));const e=adoptedSheets();if(e.length)try{t.adoptedStyleSheets=e}catch(t){}this._shadowBase=t.firstElementChild?t.firstElementChild.className:""}enhance(t){t||(t=this.shadowRoot),t&&(t.querySelectorAll("details").forEach(t=>{const e=t.querySelector("summary");e&&!e.hasAttribute("aria-expanded")&&(e.setAttribute("aria-expanded",String(t.open)),t.addEventListener("toggle",()=>{e.setAttribute("aria-expanded",String(t.open))}))}),t.querySelectorAll("[data-live]").forEach(t=>{t.hasAttribute("role")||t.setAttribute("role","status"),t.hasAttribute("aria-live")||t.setAttribute("aria-live","polite")}),t.querySelectorAll(".c-spinner").forEach(t=>{t.hasAttribute("role")||t.setAttribute("role","status"),t.hasAttribute("aria-live")||t.setAttribute("aria-live","polite")}),t.querySelectorAll(".c-toast, .c-toast-host").forEach(t=>{t.hasAttribute("role")||t.setAttribute("role","status"),t.hasAttribute("aria-live")||t.setAttribute("aria-live","polite"),t.hasAttribute("aria-atomic")||t.setAttribute("aria-atomic","true")}),t.querySelectorAll("[role='tab']").forEach(e=>{const s=e.getAttribute("aria-controls");if(s){const a=t.querySelector("#"+CSS.escape(s))||document.getElementById(s);a&&!a.hasAttribute("aria-labelledby")&&(e.id||(e.id=contourId("tab")),a.setAttribute("aria-labelledby",e.id))}}),t.querySelectorAll("input, textarea, select").forEach(t=>{if(t.hasAttribute("aria-describedby"))return;const e=t.closest(".c-field");if(e){const s=e.querySelector(".c-field__hint");s&&(s.id||(s.id=contourId("hint")),t.setAttribute("aria-describedby",s.id));const a=e.querySelector(".c-field__error");if(a){a.id||(a.id=contourId("err"));const e=t.getAttribute("aria-describedby")||"";t.setAttribute("aria-describedby",(e+" "+a.id).trim())}}}),t.querySelectorAll(".c-alert").forEach(t=>{const e=t.classList.contains("c-alert--warning")||t.classList.contains("c-alert--danger"),s=e?"alert":"status",a=e?"assertive":"polite";t.hasAttribute("role")&&!t.dataset.contourAutoRole||(t.setAttribute("role",s),t.dataset.contourAutoRole=s),t.hasAttribute("aria-live")&&!t.dataset.contourAutoLive||(t.setAttribute("aria-live",a),t.dataset.contourAutoLive=a)}),t.querySelectorAll("input[required], textarea[required], select[required]").forEach(t=>{t.hasAttribute("aria-required")||t.setAttribute("aria-required","true")}),this._wireLabels(t),this._wireClose(t))}_wireClose(t){if(!t||this._wiredShadowClose)return;const e=t.querySelectorAll(".c-callout__close, .c-alert__close, .c-tag__remove, .c-filter-pill__remove");if(e.length){this._wiredShadowClose=!0;for(const t of e)t.addEventListener("click",()=>{this.hidden=!0,this.dispatchEvent(new CustomEvent("contour:close",{bubbles:!0,composed:!0}))})}}_wireLabels(t){t&&t.querySelectorAll("label").forEach(t=>{const e=t.querySelector("slot"),s=t.closest(".c-field")||t.parentElement,a=[];if(e)for(const t of e.assignedElements({flatten:!0}))t.matches("input, textarea, select")&&a.push(t);if(!a.length&&s){const t=s.querySelector('slot[name="input"]');if(t)for(const e of t.assignedElements({flatten:!0}))e.matches("input, textarea, select")&&a.push(e)}for(const e of a){if(e.id||(e.id=contourId("shadow-input")),t.hasAttribute("for")||t.setAttribute("for",e.id),!e.hasAttribute("aria-label")&&!e.hasAttribute("aria-labelledby")){const s=assignedText(t);s&&e.setAttribute("aria-label",s)}if(e._contourLabelWired||(e._contourLabelWired=!0,t.addEventListener("click",t=>{if(!t.target.closest("a, button, input, textarea, select"))try{e.click()}catch(t){}})),s&&!e.hasAttribute("aria-describedby")){const t=s.querySelector(".c-field__hint"),a=s.querySelector(".c-field__error"),o=[];t&&(t.id||(t.id=contourId("hint")),o.push(t.id)),a&&(a.id||(a.id=contourId("err")),o.push(a.id)),o.length&&e.setAttribute("aria-describedby",o.join(" "))}}})}connectedCallback(){this.applyMods();try{this.enhance(this.shadowRoot)}catch(t){}this._applyLabels();try{wcReset(this),wireTabs(this),wireSegmented(this),wireCombobox(this),wireTree(this),wireMenu(this),wirePagination(this),wireCopy(this),wireRemovable(this)}catch(t){}this.shadowRoot&&!this._wiredSlotchange&&(this._wiredSlotchange=!0,this.shadowRoot.addEventListener("slotchange",()=>{try{this.enhance(this.shadowRoot),this._applyLabels(),wireTabs(this),wireSegmented(this),wireCombobox(this),wireTree(this),wireMenu(this),wirePagination(this),wireCopy(this),wireRemovable(this)}catch(t){}}))}attributeChangedCallback(){this.applyMods(),this._applyLabels()}_applyLabels(){const t=this.shadowRoot;if(!t)return;const e=(e,s,a)=>{const o=t.querySelector(e);o&&o.setAttribute("aria-label",labelText(this,s,a))};e(".c-callout__close","close","Close"),e(".c-alert__close","close","Close"),e(".c-tag__remove","remove","Remove"),e(".c-filter-pill__remove","remove-filter","Remove filter"),e(".c-breadcrumb","breadcrumb","Breadcrumb"),e(".c-spinner","loading","Loading"),e(".c-install__copy","copy-command","Copy command");const s=t.querySelector(".c-install__copy, .c-code__copy");s&&"Copy"===s.textContent.trim()&&(s.textContent=labelText(this,"copy","Copy"))}applyMods(){const t=this.shadowRoot.firstElementChild;if(!t||!this._shadowBase)return;const e=[];for(const t of MODS){const s=this.getAttribute(t);if(s)for(const t of this._shadowBase.split(/\s+/))t&&e.push("c-"+t.replace(/^c-/,"")+"--"+s)}if(t.className=(this._shadowBase+" "+e.join(" ")).trim(),t.classList.contains("c-alert")){const e=t.classList.contains("c-alert--warning")||t.classList.contains("c-alert--danger"),s=e?"alert":"status",a=e?"assertive":"polite";t.hasAttribute("role")&&!t.dataset.contourAutoRole||(t.setAttribute("role",s),t.dataset.contourAutoRole=s),t.hasAttribute("aria-live")&&!t.dataset.contourAutoLive||(t.setAttribute("aria-live",a),t.dataset.contourAutoLive=a)}}}const SHADOW_PARTS_PUBLIC={},SHADOW_MARKUP={},recordParts=(t,e)=>{SHADOW_PARTS_PUBLIC[t]=[...e.matchAll(/part="([^"]+)"/g)].flatMap(t=>t[1].split(/\s+/)).filter(Boolean)},shadow=(t,e)=>{if(SHADOW_MARKUP[t]=e,recordParts(t,e),"undefined"==typeof document)return;const s=document.createElement("template");setHTML(s,e);const a=class extends ContourShadow{};a.contourTemplate=s,define(t,a)},slotWrapper=(t,e,s)=>"<"+t+' class="c-'+e+'" part="'+(s||e)+'"'+("button"===t?' type="button"':"")+"><slot></slot></"+t+">",SHADOW_SLOTS={div:["accordion","activity","advanced","affordance","affordances","anchor","app","app-body","box","btn-group","chart-grid","catchment","cluster","command","compare","comparison","compass","contour-plot","cta","dash-freshness","dash-kpi-row","dash-shell","dash-toolbar","datamark","delta","draggable","drag-handle","drop-indicator","drop-zone","destructive-hint","docs-shell","drawer","elevation","filter-bar","flow-map","heatmap","hexbin","icon-badge","input-group","instrument","range-scale","resizable","table-wrap","time-range","toast-host","scroll-area","isochrone","landing-features","landing-hero","layer-panel","layer-switch","legend","logos","map-area","map-footer","map-panel","map-slot","measure","metrics","minimap","pager","pagination","panel","plate","price","pricing","progress","prose","pullquote","radio-list","range","readout","recipe","reserved","resize-handle","row","row-action","scale-bar","scrim","segmented","sheet","shortcut-list","shortcut-overlay","shortcut-panel","shortcut-row","showcase","sidebar","skeleton","sparkline","stack","steps","streaming-chart","survey","theme-scope","time-slider","timeline","toast","toolbar","tooltip","tree","version","version-banner"],button:["btn","pressable"],span:["avatar","badge","chip","dot","flag","live-badge","mark","pill"],a:["link","linkish"],kbd:["kbd"],label:["check","radio","switch"],nav:["docs-nav"]},SHADOW_PARTS={"version-banner":"banner","contour-plot":"plot"};for(const[t,e]of Object.entries(SHADOW_SLOTS))for(const s of e){shadow("contour-shadow-"+s,slotWrapper(t,s,SHADOW_PARTS[s]||s))}shadow("contour-shadow-callout",'<div class="c-callout" part="callout"><div class="c-callout__title" part="title"><slot name="title"></slot></div><div class="c-callout__body" part="body"><slot></slot></div><button class="c-callout__close" part="close" type="button" aria-label="Close">×</button></div>'),shadow("contour-shadow-empty",'<div class="c-empty" part="empty"><div class="c-empty__illustration" part="illustration"><slot name="illustration"></slot></div><div class="c-empty__title" part="title"><slot name="title"></slot></div><div class="c-empty__text" part="body"><slot></slot></div><div><slot name="action"></slot></div></div>'),shadow("contour-shadow-feature",'<div class="c-feature" part="feature"><span class="c-feature__index" part="index"><slot name="index"></slot></span><div class="c-feature__title" part="title"><slot name="title"></slot></div><div class="c-feature__body" part="body"><slot></slot></div></div>'),shadow("contour-shadow-kpi",'<div class="c-kpi" part="kpi"><div class="c-kpi__value" part="value"><slot name="value"></slot></div><div class="c-kpi__label" part="label"><slot name="label"></slot></div><div class="c-kpi__foot" part="foot"><slot name="delta"></slot><slot name="note"></slot></div></div>'),shadow("contour-shadow-stat",'<div class="c-stat" part="stat"><div class="c-stat__value" part="value"><slot name="value"></slot></div><div class="c-stat__label" part="label"><slot name="label"></slot></div><div class="c-stat__delta" part="delta"><slot name="delta"></slot></div></div>'),shadow("contour-shadow-meter",'<div class="c-meter" part="meter"><span class="c-meter__core" part="core"><span class="c-meter__value" part="value"><slot name="value"></slot></span><span class="c-meter__label" part="label"><slot name="label"></slot></span></span></div>'),shadow("contour-shadow-brownout",'<div class="c-brownout" part="brownout" data-level="0"><slot></slot></div>'),shadow("contour-shadow-widget-state",'<div class="c-widget-state" part="widget-state"><slot></slot></div>'),shadow("contour-shadow-donut",'<div class="c-donut" part="donut"><svg class="c-donut__ring" part="ring" viewBox="0 0 32 32"></svg><div class="c-donut__center" part="center"><slot name="value"></slot></div><div class="c-donut__list" part="list"><slot></slot></div></div>'),shadow("contour-shadow-axis",'<div class="c-axis" part="axis"><slot></slot></div>'),shadow("contour-shadow-brush",'<div class="c-brush" part="brush"><div class="c-brush__selection" part="selection"></div></div>'),shadow("contour-shadow-stacked-bar",'<div class="c-stacked-bar" part="bar"><slot></slot></div>'),shadow("contour-shadow-category",'<div class="c-category" part="category" role="listbox"><slot></slot></div>'),shadow("contour-shadow-gauge",'<div class="c-gauge" part="gauge"><svg class="c-gauge__dial" part="dial" aria-hidden="true" viewBox="0 0 100 100"><path class="c-gauge__track" part="track" d="M 10 90 A 40 40 0 0 1 90 90"></path><g class="c-gauge__zones"></g><line class="c-gauge__needle" part="needle" x1="50" y1="50" x2="50" y2="15"></line><circle class="c-gauge__hub" part="hub" cx="50" cy="50" r="4"></circle></svg><div class="c-gauge__value" part="value"><slot name="value"></slot></div><div class="c-gauge__band" part="band"><slot name="band"></slot></div></div>'),shadow("contour-shadow-diff",'<div class="c-diff" part="diff"><div class="c-diff__line c-diff__line--del" part="before"><span class="c-diff__sign">−</span><span><slot name="before"></slot></span></div><div class="c-diff__line c-diff__line--add" part="after"><span class="c-diff__sign">+</span><span><slot name="after"></slot></span></div></div>'),shadow("contour-shadow-do-dont",'<div class="c-do-dont" part="do-dont"><div class="c-do-dont__item c-do-dont__item--do" part="do"><slot name="do"></slot></div><div class="c-do-dont__item c-do-dont__item--dont" part="dont"><slot name="dont"></slot></div></div>'),shadow("contour-shadow-threshold",'<div class="c-threshold" part="threshold"><span class="c-threshold__fill" part="value"></span><span class="c-threshold__target" part="target"></span></div>'),shadow("contour-shadow-coordinate",'<div class="c-coordinate" part="coordinate"><span class="c-coordinate__value" part="value"><slot name="value"></slot></span></div>'),shadow("contour-shadow-install",'<div class="c-install" part="install"><span class="c-install__prompt" part="prompt"><slot name="prompt"></slot></span><span class="c-install__command" part="command"><slot name="command"></slot></span><button class="c-btn c-btn--ghost c-btn--sm c-install__copy" part="copy" type="button" aria-label="Copy command">Copy</button></div>'),shadow("contour-shadow-toc",'<div class="c-toc" part="toc"><div class="c-toc__title" part="title"><slot name="title"></slot></div><nav class="c-toc__list" part="list"><slot></slot></nav></div>'),shadow("contour-shadow-testimonial",'<div class="c-testimonial" part="testimonial"><blockquote class="c-testimonial__quote" part="quote"><slot name="quote"></slot></blockquote><div class="c-testimonial__byline" part="byline"><span class="c-testimonial__name" part="name"><slot name="name"></slot></span><span class="c-testimonial__role" part="role"><slot name="role"></slot></span></div></div>'),shadow("contour-shadow-search-trigger",'<button class="c-search-trigger" part="trigger"><span><slot name="label"></slot></span><kbd class="c-search-trigger__kbd"><slot name="shortcut"></slot></kbd></button>'),shadow("contour-shadow-brand",'<a class="c-brand" part="brand"><span class="c-mark" part="mark"><slot name="mark"></slot></span><span class="c-brand__name" part="name"><slot name="name"></slot></span></a>'),shadow("contour-shadow-section-head",'<div class="c-section-head" part="head"><h2 class="c-section-head__title" part="title"><slot name="title"></slot></h2><p class="c-section-head__desc" part="desc"><slot name="desc"></slot></p></div>'),shadow("contour-shadow-loading",'<div class="c-loading" part="loading"><span class="c-spinner" part="spinner"></span><slot></slot></div>'),shadow("contour-shadow-tabs",'<div class="c-tabs" part="tabs"><div class="c-tabs__list" part="list" role="tablist"><slot name="tabs"></slot></div><div class="c-tabs__panels" role="presentation"><slot></slot></div></div>'),shadow("contour-shadow-breadcrumb",'<nav class="c-breadcrumb" part="breadcrumb" aria-label="Breadcrumb"><ol><slot></slot></ol></nav>'),shadow("contour-shadow-menu",'<div class="c-menu" part="menu" role="menu"><slot></slot></div>'),shadow("contour-shadow-combobox",'<div class="c-combobox" part="combobox"><input class="c-combobox__input" part="input" type="text" /><ul class="c-combobox__list" part="list" hidden><slot></slot></ul></div>'),shadow("contour-shadow-chart",'<div class="c-chart" part="chart"><div class="c-chart__plot" part="plot"><slot></slot></div></div>'),shadow("contour-shadow-bivariate",'<div class="c-bivariate" part="bivariate"><div class="c-bivariate__matrix" part="matrix"><slot></slot></div></div>'),shadow("contour-shadow-bivariate-legend",'<div class="c-bivariate-legend" part="legend"><div class="c-bivariate-legend__matrix" part="matrix"><slot></slot></div></div>'),shadow("contour-shadow-expandable",'<details class="c-expandable" part="expandable"><summary class="c-expandable__summary"><slot name="summary"></slot></summary><div class="c-expandable__body" part="body"><slot></slot></div></details>'),shadow("contour-shadow-disclosure",'<details class="c-disclosure" part="disclosure"><summary><slot name="summary"></slot></summary><div class="c-disclosure__body" part="body"><slot></slot></div></details>'),shadow("contour-shadow-faq",'<div class="c-faq" part="faq"><div class="c-faq__question" part="question"><slot name="question"></slot></div><div class="c-faq__answer" part="answer"><slot name="answer"></slot></div></div>'),shadow("contour-shadow-code-tabs",'<div class="c-code-tabs" part="code-tabs"><div class="c-code-tabs__list" part="list" role="tablist"><slot name="tabs"></slot></div><div class="c-code-tabs__panels"><slot></slot></div></div>'),shadow("contour-shadow-header",'<header class="c-header" part="header"><div class="container c-header__inner" part="inner"><a class="c-brand" part="brand"><slot name="brand"></slot></a><nav class="c-header__nav" part="nav"><slot name="nav"></slot></nav><div class="c-header__actions" part="actions"><slot name="actions"></slot></div></div></header>'),shadow("contour-shadow-footer",'<footer class="c-footer" part="footer"><div class="container c-footer__grid" part="grid"><div class="c-footer__brand" part="brand"><slot name="brand"></slot></div><div class="c-footer__links" part="links"><slot name="links"></slot></div></div></footer>'),shadow("contour-shadow-container",'<div class="container" part="container"><slot></slot></div>'),shadow("contour-shadow-spinner",'<span class="c-spinner" part="spinner" aria-label="Loading"></span>'),shadow("contour-shadow-code",'<pre class="c-code" part="code"><code><slot></slot></code><button class="c-code__copy" part="copy" type="button">Copy</button></pre>'),shadow("contour-shadow-card",'<div class="c-card" part="card"> <div class="c-card__title" part="head"><slot name="title">Untitled</slot></div> <div class="c-card__body" part="body"><slot></slot></div> <div class="c-card__foot" part="foot"><slot name="foot"></slot></div> </div>'),shadow("contour-shadow-field",'<div class="c-field" part="field"> <label class="c-field__label" part="label"><slot name="label">Label</slot></label> <slot name="input"></slot> <span class="c-field__hint" part="hint"><slot name="hint"></slot></span> </div>'),shadow("contour-shadow-alert",'<div class="c-alert" part="alert"> <div class="c-alert__title" part="title"><slot name="title"></slot></div> <div class="c-alert__body" part="body"><slot></slot></div> <div class="c-alert__actions" part="actions"><slot name="action"></slot></div> <button class="c-alert__close" part="close" type="button" aria-label="Close">×</button> </div>'),shadow("contour-shadow-tag",'<span class="c-tag" part="tag"><slot></slot><button class="c-tag__remove" part="remove" type="button" aria-label="Remove">×</button></span>'),shadow("contour-shadow-filter-pill",'<span class="c-filter-pill" part="filter-pill"><slot></slot><button class="c-filter-pill__remove" part="remove" type="button" aria-label="Remove filter">×</button></span>');const DIALOG_MARKUP='<dialog class="c-dialog" part="dialog"> <div class="c-dialog__head" part="head"> <slot name="title"></slot> <button class="c-btn c-btn--icon c-btn--ghost" part="close" type="button" aria-label="Close"> <svg aria-hidden="true" viewBox="0 0 24 24"><path d="m18 6-12 12M6 6l12 12" fill="none" stroke="currentColor" stroke-width="1.7" stroke-linecap="round"/></svg> </button> </div> <div class="c-dialog__body" part="body"><slot></slot></div> <div class="c-dialog__foot" part="foot"><slot name="foot"></slot></div> </dialog>';SHADOW_MARKUP["contour-shadow-dialog"]=DIALOG_MARKUP,recordParts("contour-shadow-dialog",DIALOG_MARKUP);class ContourShadowDialog extends ContourShadow{static contourTemplate="undefined"!=typeof document?(()=>{const t=document.createElement("template");return setHTML(t,DIALOG_MARKUP),t})():null;enhance(t){if(super.enhance(t),this._wiredShadowDialog)return;this._wiredShadowDialog=!0;const e=t.querySelector("dialog"),s=t.querySelector('[part="close"]');if(s&&s.addEventListener("click",()=>e?.close()),e){let t=null;e.addEventListener("beforetoggle",s=>{if("open"===s.newState){t=document.activeElement,this._syncingOpenAttr=!0,this.hasAttribute("open")||this.setAttribute("open",""),this._syncingOpenAttr=!1,this.dispatchEvent(new CustomEvent("contour:open",{bubbles:!0,composed:!0}));const a=e.querySelector("button, [href], input, select, textarea, [tabindex]:not([tabindex='-1'])");if(a)try{a.focus()}catch(s){}}else if("closed"===s.newState&&(this._syncingOpenAttr=!0,this.hasAttribute("open")&&this.removeAttribute("open"),this._syncingOpenAttr=!1,this.dispatchEvent(new CustomEvent("contour:close",{bubbles:!0,composed:!0})),t&&"function"==typeof t.focus))try{t.focus()}catch(s){}});const s=()=>{const t="button, [href], input, select, textarea, [tabindex]:not([tabindex='-1'])",s=Array.from(e.querySelectorAll(t));for(const a of e.querySelectorAll("slot"))for(const e of a.assignedElements({flatten:!0})){e.matches(t)&&s.push(e);for(const a of e.querySelectorAll(t))s.push(a)}return s},a=()=>this.shadowRoot&&this.shadowRoot.activeElement||document.activeElement;e.addEventListener("keydown",t=>{if("Tab"!==t.key)return;const e=s();if(!e.length)return;const o=e[0],r=e[e.length-1];t.shiftKey&&a()===o?(t.preventDefault(),r.focus()):t.shiftKey||a()!==r||(t.preventDefault(),o.focus())})}}static get observedAttributes(){return[...super.observedAttributes,"open"]}attributeChangedCallback(t,e,s){if(super.attributeChangedCallback(t,e,s),"open"===t&&this.shadowRoot&&!this._syncingOpenAttr){const t=this.shadowRoot.querySelector("dialog");t&&(null===s||t.open?null===s&&t.open&&this.close():this.show())}}connectedCallback(){super.connectedCallback(),this.hasAttribute("open")&&this.show()}show(){if(!this.isConnected)return void(this.hasAttribute("open")||this.setAttribute("open",""));const t=this.shadowRoot?.querySelector("dialog");t&&!t.open&&t.showModal()}close(){const t=this.shadowRoot?.querySelector("dialog");t&&t.open&&t.close()}showModal(){this.show()}get open(){return!!this.shadowRoot?.querySelector("dialog")?.open}set open(t){t?this.show():this.close()}get returnValue(){return this.shadowRoot?.querySelector("dialog")?.returnValue??""}set returnValue(t){const e=this.shadowRoot?.querySelector("dialog");e&&(e.returnValue=String(t))}}define("contour-shadow-dialog",ContourShadowDialog);const renderShadowDSD=(t,e="",s="")=>{const a=SHADOW_MARKUP[t];if("string"!=typeof a)return null;return`<${t}${e?e.startsWith(" ")?e:" "+e:""}><template shadowrootmode="open">${a}</template>${s}</${t}>`},FROZEN_SHADOW_MARKUP=Object.freeze({...SHADOW_MARKUP});if("undefined"!=typeof globalThis&&(globalThis.ContourShadowTemplates=FROZEN_SHADOW_MARKUP),"undefined"!=typeof window){window.ContourShadowParts=Object.freeze(Object.fromEntries(Object.entries(SHADOW_PARTS_PUBLIC).map(([t,e])=>[t,Object.freeze([...new Set(e)])]))),window.Contour||(window.Contour={});try{window.Contour.shadowTemplates=FROZEN_SHADOW_MARKUP}catch{}}export{SHADOW_MARKUP,renderShadowDSD};const routeKey=t=>{const e=String(null==t?"":t).trim();if(!e)return"";if(e.startsWith("#"))return"hash:"+e;try{const t="undefined"!=typeof location?location.href:"http://localhost/",s=new URL(e,t);return"path:"+s.pathname.replace(/\/+$/,"")+s.search}catch(t){return"raw:"+e}},hereKey=t=>{const e=String(null==t?"":t).trim();return e?routeKey(e):"undefined"==typeof location?"":"path:"+String(location.pathname||"").replace(/\/+$/,"")+(location.search||"")},hashMatchesHere=t=>{if("undefined"==typeof location)return!1;if(location.hash&&location.hash===t)return!0;const e=String(location.pathname||"").split("/").filter(Boolean).pop()||"";return Boolean(e)&&t==="#"+e};class ContourDocsNav extends ContourBase{static get observed(){return["items","title","current","loading","error","retry","src","lazy","refresh","timeout","skeleton","cache-key","empty","no-cache"]}static get properties(){return{items:{attribute:"items"},title:{attribute:"title"},src:{attribute:"src"}}}render(){this.classList.add("c-docs-nav"),this.setAttribute("role","navigation");const t=this.getAttribute("title");if(t?this.setAttribute("aria-label",t):this.setAttribute("aria-label",labelText(this,"documentation-navigation","Documentation navigation")),wireStates(this),loadRemote(this,"items"),renderStates(this,"docs-nav"))return;const e=remoteData(this,"items"),s=this.hasAttribute("src")?e:e||(this.hasAttribute("items")?this.getAttribute("items"):null),a=this.querySelector(".c-docs-nav__list"),o=a?Array.from(a.children).filter(t=>t.classList&&t.classList.contains("c-docs-nav__group")):[];if(s&&!o.length)try{const t=JSON.parse(s),e=this.ensure(".c-docs-nav__list",()=>{const t=document.createElement("div");return t.className="c-docs-nav__list",t});e.innerHTML="",t.forEach(t=>{const s=document.createElement("div");if(s.className="c-docs-nav__group",t.title){const e=document.createElement("div");e.className="c-docs-nav__group-title",e.textContent=t.title,s.appendChild(e)}const a=document.createElement("div");a.className="c-docs-nav__list",(t.links||t.items||[]).forEach(t=>{const e=document.createElement("a");e.className="c-docs-nav__link",e.href=safeHref("string"==typeof t?"#":t.href||"#");const s="string"==typeof t?t:t.label||t;if("object"==typeof t&&null!==t&&t.badge){const s=document.createElement("span");s.className="c-docs-nav__badge",s.textContent=t.badge,e.appendChild(s)}if(e.appendChild(document.createTextNode(s)),"object"==typeof t&&null!==t&&t.chevron){const t=document.createElement("span");t.className="c-docs-nav__chevron",setHTML(t,'<svg aria-hidden="true" viewBox="0 0 24 24"><use href="#i-chevron-right" /></svg>'),e.appendChild(t)}if("object"==typeof t&&null!==t&&Array.isArray(t.items)){e.classList.add("c-docs-nav__link--nested");const s=document.createElement("div");s.className="c-docs-nav__list c-docs-nav__list--nested",t.items.forEach(t=>{const e=document.createElement("a");e.className="c-docs-nav__link",e.href=safeHref("string"==typeof t?"#":t.href||"#"),e.textContent="string"==typeof t?t:t.label||t,s.appendChild(e)}),a.appendChild(e),a.appendChild(s)}else a.appendChild(e)}),s.appendChild(a),e.appendChild(s)})}catch(t){warnBadJson(this,"attribute",t)}else!s&&a?(a.remove(),renderEmpty(this,"docs-nav")):s||a||renderEmpty(this,"docs-nav");this.applyCurrent()}applyCurrent(){const t=Array.from(this.querySelectorAll(".c-docs-nav__link"));if(!t.length)return;const e=this.getAttribute("current"),s=hereKey(e);t.forEach(t=>{const a=t.getAttribute("href")||"",o=routeKey(a);Boolean(s)&&(o&&o===s||a.startsWith("#")&&!e&&hashMatchesHere(a))?t.setAttribute("aria-current","page"):t.removeAttribute("aria-current")})}enhance(){if(!this._wiredDocsNav&&(this._wiredDocsNav=!0,this.addEventListener("click",t=>{const e=t.target&&t.target.closest?t.target.closest(".c-docs-nav__link"):null;if(e&&this.contains(e)){const t=e.textContent||"";this.dispatchEvent(new CustomEvent("contour:docs-nav-select",{bubbles:!0,composed:!0,detail:{label:t,href:e.getAttribute("href")}}))}}),this.addEventListener("keydown",t=>{const e=Array.from(this.querySelectorAll(".c-docs-nav__link"));e.length&&(e.some(t=>0===t.tabIndex)||e.forEach((t,e)=>t.tabIndex=0===e?0:-1),navKey(t,e,{wrap:!0,homeEnd:!0,onNavigate:t=>{e.forEach((e,s)=>e.tabIndex=s===t?0:-1)},onKey:e=>{if("Enter"===e){const e=document.activeElement;e&&(t.preventDefault(),e.click())}}}))}),"undefined"!=typeof window&&window.addEventListener)){const t=()=>this.applyCurrent();window.addEventListener("hashchange",t),window.addEventListener("popstate",t),onDispose(this,()=>{window.removeEventListener("hashchange",t),window.removeEventListener("popstate",t)})}}}define("contour-docs-nav",ContourDocsNav);class ContourDocsShell extends ContourBase{static get observed(){return["title","lede","article","heading"]}static get properties(){return{title:{attribute:"title"},lede:{attribute:"lede"},article:{attribute:"article"}}}render(){this.classList.add("c-docs-shell"),this.setAttribute("role","region");const t=this.getAttribute("title");if(t){this.ensure(".c-docs-shell__title",()=>{const t=document.createElement(headingTag(this,"h2"));return t.className="c-docs-shell__title",t}).textContent=t,this.setAttribute("aria-label",t)}else{const t=this.querySelector(".c-docs-shell__title");t&&t.remove()}const e=this.getAttribute("lede");if(e){this.ensure(".c-docs-shell__lede",()=>{const t=document.createElement("p");return t.className="c-docs-shell__lede",t}).textContent=e}else{const t=this.querySelector(".c-docs-shell__lede");t&&t.remove()}const s=this.getAttribute("article");if(s){const t=this.ensure(".c-docs-shell__article",()=>{const t=document.createElement("article");return t.className="c-docs-shell__article",t});setHTML(t,sanitizeHtml(s))}else{const t=this.querySelector(".c-docs-shell__article");t&&t.remove()}}}define("contour-docs-shell",ContourDocsShell);class ContourFileTree extends ContourBase{static get updateMode(){return"keyed"}static get observed(){return["items"]}static get properties(){return{items:{attribute:"items"}}}render(){this.classList.add("c-file-tree");const t=this.getAttribute("items");if(t)try{const e=JSON.parse(t),s=(t,e)=>{const a=document.createElement("div");a.className="c-file-tree__row"+(t.dir?" c-file-tree__row--dir":"")+(t.active?" c-file-tree__row--active":""),a.style.setProperty("--depth",String(e));const o=document.createElement("span");setHTML(o,t.dir?'<svg aria-hidden="true" viewBox="0 0 24 24"><use href="#i-folder" /></svg>':'<svg aria-hidden="true" viewBox="0 0 24 24"><use href="#i-file" /></svg>'),o.appendChild(document.createTextNode(" "+(t.label||t.name||""))),a.appendChild(o),this.appendChild(a),Array.isArray(t.children)&&t.children.forEach(t=>s(t,e+1))};Array.from(this.querySelectorAll(".c-file-tree__row")).forEach(t=>t.remove()),e.forEach(t=>s(t,0))}catch(t){warnBadJson(this,"attribute",t)}}}define("contour-file-tree",ContourFileTree);class ContourChangelog extends ContourBase{static get observed(){return["src","max","loading","error"]}static get properties(){return{src:{attribute:"src"},max:{attribute:"max",type:Number}}}render(){this.classList.add("c-changelog");const t=this.getAttribute("src");if(t){if(this.dataset.loaded===t)return;this.dataset.loaded="";const e=this.ensure(".c-changelog__loading",()=>{const t=document.createElement("div");return t.className="c-changelog__loading",t});e.textContent=labelText(this,"loading","Loading…"),Array.from(this.querySelectorAll(".c-changelog__entry, .c-changelog__error")).forEach(t=>t.remove()),this.querySelector(".c-changelog__loading")||this.appendChild(e);try{this._changelogAbort&&this._changelogAbort.abort()}catch(t){}this._changelogAbort="undefined"!=typeof AbortController?new AbortController:null,fetch(t,this._changelogAbort?{signal:this._changelogAbort.signal}:void 0).then(t=>{if(!t.ok)throw new Error("HTTP "+t.status);return t.text()}).then(e=>{if(!this.isConnected)return;const s=this.querySelector(".c-changelog__loading");s&&s.remove(),this.dataset.loaded=t;const a=parseChangelog(e),o=parseInt(this.getAttribute("max")||"0",10),r=o>0?a.slice(0,o):a;if(!r.length){const t=document.createElement("div");return t.className="c-changelog__empty",t.textContent=labelText(this,"empty","No releases found."),void this.appendChild(t)}r.forEach(t=>{const e=document.createElement("details");e.className="c-changelog__entry";const s=document.createElement("summary");s.className="c-changelog__summary";const a=document.createElement("span");if(a.className="c-changelog__version",a.textContent=t.version,s.appendChild(a),t.date){const e=document.createElement("span");e.className="c-changelog__date",e.textContent=t.date,s.appendChild(e)}e.appendChild(s);const o=document.createElement("div");o.className="c-changelog__body",setHTML(o,renderChangelogBody(t.body)),e.appendChild(o),this.appendChild(e)})}).catch(t=>{if(!this.isConnected)return;const e=this.querySelector(".c-changelog__loading");e&&e.remove();const s=document.createElement("div");s.className="c-changelog__error",s.textContent=labelText(this,"load-error","Failed to load changelog")+": "+(t&&t.message?t.message:t),this.appendChild(s)})}}disconnectedCallback(){super.disconnectedCallback();try{this._changelogAbort&&this._changelogAbort.abort()}catch(t){}this._changelogAbort=null}}function parseChangelog(t){const e=String(t).split(/\r?\n/),s=[];let a=null;for(const t of e){const e=t.match(/^##\s+\[?([^\]\n]+)\]?\s*[-–—]?\s*(.*)$/);if(e&&t.startsWith("## ")){const t=e[1].trim(),o=e[2].trim();if(/^\d|unreleased/i.test(t)){a&&s.push(a),a={version:t,date:o.replace(/^[-–—]\s*/,"").trim(),body:""};continue}}a&&(a.body+=t+"\n")}return a&&s.push(a),s}function escapeHtml(t){return String(t).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function renderChangelogBody(t){const e=String(t).trim().split(/\r?\n/),s=[];let a=!1;for(const t of e){const e=t.trimEnd();/^###\s+/.test(e)?(a&&(s.push("</ul>"),a=!1),s.push("<h3>"+escapeHtml(e.replace(/^###\s+/,""))+"</h3>")):/^##\s+/.test(e)?(a&&(s.push("</ul>"),a=!1),s.push("<h2>"+escapeHtml(e.replace(/^##\s+/,""))+"</h2>")):/^#\s+/.test(e)?(a&&(s.push("</ul>"),a=!1),s.push("<h2>"+escapeHtml(e.replace(/^#\s+/,""))+"</h2>")):/^[-*]\s+/.test(e)?(a||(s.push("<ul>"),a=!0),s.push("<li>"+escapeHtml(e.replace(/^[-*]\s+/,""))+"</li>")):""===e.trim()?a&&(s.push("</ul>"),a=!1):(a&&(s.push("</ul>"),a=!1),s.push("<p>"+escapeHtml(e)+"</p>"))}return a&&s.push("</ul>"),s.join("")}define("contour-changelog",ContourChangelog);
1
+ import{CLASS_ONLY,CONTOUR_EVENTS,ContourBase,MERCATOR_MAX_LAT,MODS,OBSERVED,REGISTERED,applyLabel,bearing,clampLat,contourId,cssLength,define,flagOn,flagOnValue,formatValue,haversine,headingTag,iconMarkup,isRtl,labelText,levelFromAttributes,mercatorResolution,navKey,normaliseLng,onDispose,safeColor,safeHref,sanitizeHtml,setHTML,simple,statusIcon,supportsUntilFound,unwrapBounds,warnBadJson,wcEmitOverlay,withBrownout,PROPERTY_FIELDS,normalizeProperty,propertyDescriptor,propertyTypeOf,contourDiagnosticsEnabled,setContourDiagnostics,MARKER_SHAPES,arcPath,assignMarkers,barRects,compassNeedle,contourPaths,donutSlices,isMissing,marchingSquares,markerStyles,niceTicks,polylinePoints,scaleBarTicks,smoothPath,modalContain,wcReset,wireCombobox,wireCopy,wireMenu,wirePagination,wireRemovable,wireSegmented,wireTabs,wireTree,STATE_FALLBACK,loadRemote,parseArrayAttr,remoteData,remoteInvalidate,remoteRefresh,remoteVisible,renderEmpty,renderStates,stateLabel,virtualRange,watchViewport,wireStates}from"./contour-wc-core.esm.js";define("contour-box",simple(["c-box"])),define("contour-cluster",simple(["c-cluster"])),define("contour-container",simple(["c-container"])),define("contour-row",simple(["c-row"])),define("contour-scrim",simple(["c-scrim"])),define("contour-stack",simple(["c-stack"]));const assignedText=t=>{const e=t.querySelector("slot");return(e?e.assignedElements({flatten:!0}):[]).map(t=>(t.textContent||"").trim()).join(" ").trim()||(t.textContent||"").trim()};let ADOPTED=null,ADOPTED_KEY="";const _hashCss=t=>{let e=2166136261;for(let s=0;s<t.length;s++)e^=t.charCodeAt(s),e=Math.imul(e,16777619);return(e>>>0).toString(36)};export const adoptedSheets=()=>{let t=document.styleSheets.length+":";for(const e of document.styleSheets){let s="-1";try{const t=e.cssRules;let a="";for(let e=0;e<t.length;e++)a+=t[e].cssText+"\n";s=t.length+":"+_hashCss(a)}catch(t){}t+=(e.href||"inline")+"~"+s+"|"}if(ADOPTED&&t===ADOPTED_KEY)return ADOPTED;ADOPTED_KEY=t,ADOPTED=[];const e=(t,s)=>{let a;try{a=t.cssRules}catch(t){return}if(a)for(const t of a)if(t instanceof CSSImportRule)t.styleSheet&&e(t.styleSheet,s);else try{s.push(t.cssText)}catch(t){}};for(const t of document.styleSheets)try{if(!t.href||new URL(t.href).origin===location.origin){const s=[];e(t,s);const a=new CSSStyleSheet;s.length&&a.replaceSync(s.join("\n")),ADOPTED.push(a)}}catch(t){}return ADOPTED};const _ShadowParent="undefined"!=typeof HTMLElement?HTMLElement:Object;class ContourShadow extends _ShadowParent{static get observedAttributes(){return MODS.concat("labels")}constructor(){super();let t=this.shadowRoot;t||(t=this.attachShadow({mode:"open"}),this.constructor.contourTemplate&&t.appendChild(this.constructor.contourTemplate.content.cloneNode(!0)));const e=adoptedSheets();if(e.length)try{t.adoptedStyleSheets=e}catch(t){}this._shadowBase=t.firstElementChild?t.firstElementChild.className:""}enhance(t){t||(t=this.shadowRoot),t&&(t.querySelectorAll("details").forEach(t=>{const e=t.querySelector("summary");e&&!e.hasAttribute("aria-expanded")&&(e.setAttribute("aria-expanded",String(t.open)),t.addEventListener("toggle",()=>{e.setAttribute("aria-expanded",String(t.open))}))}),t.querySelectorAll("[data-live]").forEach(t=>{t.hasAttribute("role")||t.setAttribute("role","status"),t.hasAttribute("aria-live")||t.setAttribute("aria-live","polite")}),t.querySelectorAll(".c-spinner").forEach(t=>{t.hasAttribute("role")||t.setAttribute("role","status"),t.hasAttribute("aria-live")||t.setAttribute("aria-live","polite")}),t.querySelectorAll(".c-toast, .c-toast-host").forEach(t=>{t.hasAttribute("role")||t.setAttribute("role","status"),t.hasAttribute("aria-live")||t.setAttribute("aria-live","polite"),t.hasAttribute("aria-atomic")||t.setAttribute("aria-atomic","true")}),t.querySelectorAll("[role='tab']").forEach(e=>{const s=e.getAttribute("aria-controls");if(s){const a=t.querySelector("#"+CSS.escape(s))||document.getElementById(s);a&&!a.hasAttribute("aria-labelledby")&&(e.id||(e.id=contourId("tab")),a.setAttribute("aria-labelledby",e.id))}}),t.querySelectorAll("input, textarea, select").forEach(t=>{if(t.hasAttribute("aria-describedby"))return;const e=t.closest(".c-field");if(e){const s=e.querySelector(".c-field__hint");s&&(s.id||(s.id=contourId("hint")),t.setAttribute("aria-describedby",s.id));const a=e.querySelector(".c-field__error");if(a){a.id||(a.id=contourId("err"));const e=t.getAttribute("aria-describedby")||"";t.setAttribute("aria-describedby",(e+" "+a.id).trim())}}}),t.querySelectorAll(".c-alert").forEach(t=>{const e=t.classList.contains("c-alert--warning")||t.classList.contains("c-alert--danger"),s=e?"alert":"status",a=e?"assertive":"polite";t.hasAttribute("role")&&!t.dataset.contourAutoRole||(t.setAttribute("role",s),t.dataset.contourAutoRole=s),t.hasAttribute("aria-live")&&!t.dataset.contourAutoLive||(t.setAttribute("aria-live",a),t.dataset.contourAutoLive=a)}),t.querySelectorAll("input[required], textarea[required], select[required]").forEach(t=>{t.hasAttribute("aria-required")||t.setAttribute("aria-required","true")}),this._wireLabels(t),this._wireClose(t))}_wireClose(t){if(!t||this._wiredShadowClose)return;const e=t.querySelectorAll(".c-callout__close, .c-alert__close, .c-tag__remove, .c-filter-pill__remove");if(e.length){this._wiredShadowClose=!0;for(const t of e)t.addEventListener("click",()=>{this.hidden=!0,this.dispatchEvent(new CustomEvent("contour:close",{bubbles:!0,composed:!0}))})}}_wireLabels(t){t&&t.querySelectorAll("label").forEach(t=>{const e=t.querySelector("slot"),s=t.closest(".c-field")||t.parentElement,a=[];if(e)for(const t of e.assignedElements({flatten:!0}))t.matches("input, textarea, select")&&a.push(t);if(!a.length&&s){const t=s.querySelector('slot[name="input"]');if(t)for(const e of t.assignedElements({flatten:!0}))e.matches("input, textarea, select")&&a.push(e)}for(const e of a){if(e.id||(e.id=contourId("shadow-input")),t.hasAttribute("for")||t.setAttribute("for",e.id),!e.hasAttribute("aria-label")&&!e.hasAttribute("aria-labelledby")){const s=assignedText(t);s&&e.setAttribute("aria-label",s)}if(e._contourLabelWired||(e._contourLabelWired=!0,t.addEventListener("click",t=>{if(!t.target.closest("a, button, input, textarea, select"))try{e.click()}catch(t){}})),s&&!e.hasAttribute("aria-describedby")){const t=s.querySelector(".c-field__hint"),a=s.querySelector(".c-field__error"),o=[];t&&(t.id||(t.id=contourId("hint")),o.push(t.id)),a&&(a.id||(a.id=contourId("err")),o.push(a.id)),o.length&&e.setAttribute("aria-describedby",o.join(" "))}}})}connectedCallback(){this.applyMods();try{this.enhance(this.shadowRoot)}catch(t){}this._applyLabels();try{wcReset(this),wireTabs(this),wireSegmented(this),wireCombobox(this),wireTree(this),wireMenu(this),wirePagination(this),wireCopy(this),wireRemovable(this)}catch(t){}this.shadowRoot&&!this._wiredSlotchange&&(this._wiredSlotchange=!0,this.shadowRoot.addEventListener("slotchange",()=>{try{this.enhance(this.shadowRoot),this._applyLabels(),wireTabs(this),wireSegmented(this),wireCombobox(this),wireTree(this),wireMenu(this),wirePagination(this),wireCopy(this),wireRemovable(this)}catch(t){}}))}attributeChangedCallback(){this.applyMods(),this._applyLabels()}_applyLabels(){const t=this.shadowRoot;if(!t)return;const e=(e,s,a)=>{const o=t.querySelector(e);o&&o.setAttribute("aria-label",labelText(this,s,a))};e(".c-callout__close","close","Close"),e(".c-alert__close","close","Close"),e(".c-tag__remove","remove","Remove"),e(".c-filter-pill__remove","remove-filter","Remove filter"),e(".c-breadcrumb","breadcrumb","Breadcrumb"),e(".c-spinner","loading","Loading"),e(".c-install__copy","copy-command","Copy command");const s=t.querySelector(".c-install__copy, .c-code__copy");s&&"Copy"===s.textContent.trim()&&(s.textContent=labelText(this,"copy","Copy"))}applyMods(){const t=this.shadowRoot.firstElementChild;if(!t||!this._shadowBase)return;const e=[];for(const t of MODS){const s=this.getAttribute(t);if(s)for(const t of this._shadowBase.split(/\s+/))t&&e.push("c-"+t.replace(/^c-/,"")+"--"+s)}if(t.className=(this._shadowBase+" "+e.join(" ")).trim(),t.classList.contains("c-alert")){const e=t.classList.contains("c-alert--warning")||t.classList.contains("c-alert--danger"),s=e?"alert":"status",a=e?"assertive":"polite";t.hasAttribute("role")&&!t.dataset.contourAutoRole||(t.setAttribute("role",s),t.dataset.contourAutoRole=s),t.hasAttribute("aria-live")&&!t.dataset.contourAutoLive||(t.setAttribute("aria-live",a),t.dataset.contourAutoLive=a)}}}const SHADOW_PARTS_PUBLIC={},SHADOW_MARKUP={},recordParts=(t,e)=>{SHADOW_PARTS_PUBLIC[t]=[...e.matchAll(/part="([^"]+)"/g)].flatMap(t=>t[1].split(/\s+/)).filter(Boolean)},shadow=(t,e)=>{if(SHADOW_MARKUP[t]=e,recordParts(t,e),"undefined"==typeof document)return;const s=document.createElement("template");setHTML(s,e);const a=class extends ContourShadow{};a.contourTemplate=s,define(t,a)},slotWrapper=(t,e,s)=>"<"+t+' class="c-'+e+'" part="'+(s||e)+'"'+("button"===t?' type="button"':"")+"><slot></slot></"+t+">",SHADOW_SLOTS={div:["accordion","activity","advanced","affordance","affordances","anchor","app","app-body","box","btn-group","chart-grid","catchment","cluster","command","compare","comparison","compass","contour-plot","cta","dash-freshness","dash-kpi-row","dash-shell","dash-toolbar","datamark","delta","draggable","drag-handle","drop-indicator","drop-zone","destructive-hint","docs-shell","drawer","elevation","filter-bar","flow-map","heatmap","hexbin","icon-badge","input-group","instrument","range-scale","resizable","table-wrap","time-range","toast-host","scroll-area","isochrone","landing-features","landing-hero","layer-panel","layer-switch","legend","logos","map-area","map-footer","map-panel","map-slot","measure","metrics","minimap","pager","pagination","panel","plate","price","pricing","progress","prose","pullquote","radio-list","range","readout","recipe","reserved","resize-handle","row","row-action","scale-bar","scrim","segmented","sheet","shortcut-list","shortcut-overlay","shortcut-panel","shortcut-row","showcase","sidebar","skeleton","sparkline","stack","steps","streaming-chart","survey","theme-scope","time-slider","timeline","toast","toolbar","tooltip","tree","version","version-banner"],button:["btn","pressable"],span:["avatar","badge","chip","dot","flag","live-badge","mark","pill"],a:["link","linkish"],kbd:["kbd"],label:["check","radio","switch"],nav:["docs-nav"]},SHADOW_PARTS={"version-banner":"banner","contour-plot":"plot"};for(const[t,e]of Object.entries(SHADOW_SLOTS))for(const s of e){shadow("contour-shadow-"+s,slotWrapper(t,s,SHADOW_PARTS[s]||s))}shadow("contour-shadow-callout",'<div class="c-callout" part="callout"><div class="c-callout__title" part="title"><slot name="title"></slot></div><div class="c-callout__body" part="body"><slot></slot></div><button class="c-callout__close" part="close" type="button" aria-label="Close">×</button></div>'),shadow("contour-shadow-empty",'<div class="c-empty" part="empty"><div class="c-empty__illustration" part="illustration"><slot name="illustration"></slot></div><div class="c-empty__title" part="title"><slot name="title"></slot></div><div class="c-empty__text" part="body"><slot></slot></div><div><slot name="action"></slot></div></div>'),shadow("contour-shadow-feature",'<div class="c-feature" part="feature"><span class="c-feature__index" part="index"><slot name="index"></slot></span><div class="c-feature__title" part="title"><slot name="title"></slot></div><div class="c-feature__body" part="body"><slot></slot></div></div>'),shadow("contour-shadow-kpi",'<div class="c-kpi" part="kpi"><div class="c-kpi__value" part="value"><slot name="value"></slot></div><div class="c-kpi__label" part="label"><slot name="label"></slot></div><div class="c-kpi__foot" part="foot"><slot name="delta"></slot><slot name="note"></slot></div></div>'),shadow("contour-shadow-stat",'<div class="c-stat" part="stat"><div class="c-stat__value" part="value"><slot name="value"></slot></div><div class="c-stat__label" part="label"><slot name="label"></slot></div><div class="c-stat__delta" part="delta"><slot name="delta"></slot></div></div>'),shadow("contour-shadow-meter",'<div class="c-meter" part="meter"><span class="c-meter__core" part="core"><span class="c-meter__value" part="value"><slot name="value"></slot></span><span class="c-meter__label" part="label"><slot name="label"></slot></span></span></div>'),shadow("contour-shadow-brownout",'<div class="c-brownout" part="brownout" data-level="0"><slot></slot></div>'),shadow("contour-shadow-widget-state",'<div class="c-widget-state" part="widget-state"><slot></slot></div>'),shadow("contour-shadow-donut",'<div class="c-donut" part="donut"><svg class="c-donut__ring" part="ring" viewBox="0 0 32 32"></svg><div class="c-donut__center" part="center"><slot name="value"></slot></div><div class="c-donut__list" part="list"><slot></slot></div></div>'),shadow("contour-shadow-axis",'<div class="c-axis" part="axis"><slot></slot></div>'),shadow("contour-shadow-brush",'<div class="c-brush" part="brush"><div class="c-brush__selection" part="selection"></div></div>'),shadow("contour-shadow-stacked-bar",'<div class="c-stacked-bar" part="bar"><slot></slot></div>'),shadow("contour-shadow-category",'<div class="c-category" part="category" role="listbox"><slot></slot></div>'),shadow("contour-shadow-gauge",'<div class="c-gauge" part="gauge"><svg class="c-gauge__dial" part="dial" aria-hidden="true" viewBox="0 0 100 100"><path class="c-gauge__track" part="track" d="M 10 90 A 40 40 0 0 1 90 90"></path><g class="c-gauge__zones"></g><line class="c-gauge__needle" part="needle" x1="50" y1="50" x2="50" y2="15"></line><circle class="c-gauge__hub" part="hub" cx="50" cy="50" r="4"></circle></svg><div class="c-gauge__value" part="value"><slot name="value"></slot></div><div class="c-gauge__band" part="band"><slot name="band"></slot></div></div>'),shadow("contour-shadow-diff",'<div class="c-diff" part="diff"><div class="c-diff__line c-diff__line--del" part="before"><span class="c-diff__sign">−</span><span><slot name="before"></slot></span></div><div class="c-diff__line c-diff__line--add" part="after"><span class="c-diff__sign">+</span><span><slot name="after"></slot></span></div></div>'),shadow("contour-shadow-do-dont",'<div class="c-do-dont" part="do-dont"><div class="c-do-dont__item c-do-dont__item--do" part="do"><slot name="do"></slot></div><div class="c-do-dont__item c-do-dont__item--dont" part="dont"><slot name="dont"></slot></div></div>'),shadow("contour-shadow-threshold",'<div class="c-threshold" part="threshold"><span class="c-threshold__fill" part="value"></span><span class="c-threshold__target" part="target"></span></div>'),shadow("contour-shadow-coordinate",'<div class="c-coordinate" part="coordinate"><span class="c-coordinate__value" part="value"><slot name="value"></slot></span></div>'),shadow("contour-shadow-install",'<div class="c-install" part="install"><span class="c-install__prompt" part="prompt"><slot name="prompt"></slot></span><span class="c-install__command" part="command"><slot name="command"></slot></span><button class="c-btn c-btn--ghost c-btn--sm c-install__copy" part="copy" type="button" aria-label="Copy command">Copy</button></div>'),shadow("contour-shadow-toc",'<div class="c-toc" part="toc"><div class="c-toc__title" part="title"><slot name="title"></slot></div><nav class="c-toc__list" part="list"><slot></slot></nav></div>'),shadow("contour-shadow-testimonial",'<div class="c-testimonial" part="testimonial"><blockquote class="c-testimonial__quote" part="quote"><slot name="quote"></slot></blockquote><div class="c-testimonial__byline" part="byline"><span class="c-testimonial__name" part="name"><slot name="name"></slot></span><span class="c-testimonial__role" part="role"><slot name="role"></slot></span></div></div>'),shadow("contour-shadow-search-trigger",'<button class="c-search-trigger" part="trigger"><span><slot name="label"></slot></span><kbd class="c-search-trigger__kbd"><slot name="shortcut"></slot></kbd></button>'),shadow("contour-shadow-brand",'<a class="c-brand" part="brand"><span class="c-mark" part="mark"><slot name="mark"></slot></span><span class="c-brand__name" part="name"><slot name="name"></slot></span></a>'),shadow("contour-shadow-section-head",'<div class="c-section-head" part="head"><h2 class="c-section-head__title" part="title"><slot name="title"></slot></h2><p class="c-section-head__desc" part="desc"><slot name="desc"></slot></p></div>'),shadow("contour-shadow-loading",'<div class="c-loading" part="loading"><span class="c-spinner" part="spinner"></span><slot></slot></div>'),shadow("contour-shadow-tabs",'<div class="c-tabs" part="tabs"><div class="c-tabs__list" part="list" role="tablist"><slot name="tabs"></slot></div><div class="c-tabs__panels" role="presentation"><slot></slot></div></div>'),shadow("contour-shadow-breadcrumb",'<nav class="c-breadcrumb" part="breadcrumb" aria-label="Breadcrumb"><ol><slot></slot></ol></nav>'),shadow("contour-shadow-menu",'<div class="c-menu" part="menu" role="menu"><slot></slot></div>'),shadow("contour-shadow-combobox",'<div class="c-combobox" part="combobox"><input class="c-combobox__input" part="input" type="text" /><ul class="c-combobox__list" part="list" hidden><slot></slot></ul></div>'),shadow("contour-shadow-chart",'<div class="c-chart" part="chart"><div class="c-chart__plot" part="plot"><slot></slot></div></div>'),shadow("contour-shadow-bivariate",'<div class="c-bivariate" part="bivariate"><div class="c-bivariate__matrix" part="matrix"><slot></slot></div></div>'),shadow("contour-shadow-bivariate-legend",'<div class="c-bivariate-legend" part="legend"><div class="c-bivariate-legend__matrix" part="matrix"><slot></slot></div></div>'),shadow("contour-shadow-expandable",'<details class="c-expandable" part="expandable"><summary class="c-expandable__summary"><slot name="summary"></slot></summary><div class="c-expandable__body" part="body"><slot></slot></div></details>'),shadow("contour-shadow-disclosure",'<details class="c-disclosure" part="disclosure"><summary><slot name="summary"></slot></summary><div class="c-disclosure__body" part="body"><slot></slot></div></details>'),shadow("contour-shadow-faq",'<div class="c-faq" part="faq"><div class="c-faq__question" part="question"><slot name="question"></slot></div><div class="c-faq__answer" part="answer"><slot name="answer"></slot></div></div>'),shadow("contour-shadow-code-tabs",'<div class="c-code-tabs" part="code-tabs"><div class="c-code-tabs__list" part="list" role="tablist"><slot name="tabs"></slot></div><div class="c-code-tabs__panels"><slot></slot></div></div>'),shadow("contour-shadow-header",'<header class="c-header" part="header"><div class="container c-header__inner" part="inner"><a class="c-brand" part="brand"><slot name="brand"></slot></a><nav class="c-header__nav" part="nav"><slot name="nav"></slot></nav><div class="c-header__actions" part="actions"><slot name="actions"></slot></div></div></header>'),shadow("contour-shadow-footer",'<footer class="c-footer" part="footer"><div class="container c-footer__grid" part="grid"><div class="c-footer__brand" part="brand"><slot name="brand"></slot></div><div class="c-footer__links" part="links"><slot name="links"></slot></div></div></footer>'),shadow("contour-shadow-container",'<div class="container" part="container"><slot></slot></div>'),shadow("contour-shadow-spinner",'<span class="c-spinner" part="spinner" aria-label="Loading"></span>'),shadow("contour-shadow-code",'<pre class="c-code" part="code"><code><slot></slot></code><button class="c-code__copy" part="copy" type="button">Copy</button></pre>'),shadow("contour-shadow-card",'<div class="c-card" part="card"> <div class="c-card__title" part="head"><slot name="title">Untitled</slot></div> <div class="c-card__body" part="body"><slot></slot></div> <div class="c-card__foot" part="foot"><slot name="foot"></slot></div> </div>'),shadow("contour-shadow-field",'<div class="c-field" part="field"> <label class="c-field__label" part="label"><slot name="label">Label</slot></label> <slot name="input"></slot> <span class="c-field__hint" part="hint"><slot name="hint"></slot></span> </div>'),shadow("contour-shadow-alert",'<div class="c-alert" part="alert"> <div class="c-alert__title" part="title"><slot name="title"></slot></div> <div class="c-alert__body" part="body"><slot></slot></div> <div class="c-alert__actions" part="actions"><slot name="action"></slot></div> <button class="c-alert__close" part="close" type="button" aria-label="Close">×</button> </div>'),shadow("contour-shadow-tag",'<span class="c-tag" part="tag"><slot></slot><button class="c-tag__remove" part="remove" type="button" aria-label="Remove">×</button></span>'),shadow("contour-shadow-filter-pill",'<span class="c-filter-pill" part="filter-pill"><slot></slot><button class="c-filter-pill__remove" part="remove" type="button" aria-label="Remove filter">×</button></span>');const DIALOG_MARKUP='<dialog class="c-dialog" part="dialog"> <div class="c-dialog__head" part="head"> <slot name="title"></slot> <button class="c-btn c-btn--icon c-btn--ghost" part="close" type="button" aria-label="Close"> <svg aria-hidden="true" viewBox="0 0 24 24"><path d="m18 6-12 12M6 6l12 12" fill="none" stroke="currentColor" stroke-width="1.7" stroke-linecap="round"/></svg> </button> </div> <div class="c-dialog__body" part="body"><slot></slot></div> <div class="c-dialog__foot" part="foot"><slot name="foot"></slot></div> </dialog>';SHADOW_MARKUP["contour-shadow-dialog"]=DIALOG_MARKUP,recordParts("contour-shadow-dialog",DIALOG_MARKUP);class ContourShadowDialog extends ContourShadow{static contourTemplate="undefined"!=typeof document?(()=>{const t=document.createElement("template");return setHTML(t,DIALOG_MARKUP),t})():null;enhance(t){if(super.enhance(t),this._wiredShadowDialog)return;this._wiredShadowDialog=!0;const e=t.querySelector("dialog"),s=t.querySelector('[part="close"]');if(s&&s.addEventListener("click",()=>e?.close()),e){let t=null;e.addEventListener("beforetoggle",s=>{if("open"===s.newState){t=document.activeElement,this._syncingOpenAttr=!0,this.hasAttribute("open")||this.setAttribute("open",""),this._syncingOpenAttr=!1,this.dispatchEvent(new CustomEvent("contour:open",{bubbles:!0,composed:!0}));const a=e.querySelector("button, [href], input, select, textarea, [tabindex]:not([tabindex='-1'])");if(a)try{a.focus()}catch(s){}}else if("closed"===s.newState&&(this._syncingOpenAttr=!0,this.hasAttribute("open")&&this.removeAttribute("open"),this._syncingOpenAttr=!1,this.dispatchEvent(new CustomEvent("contour:close",{bubbles:!0,composed:!0})),t&&"function"==typeof t.focus))try{t.focus()}catch(s){}});const s=()=>{const t="button, [href], input, select, textarea, [tabindex]:not([tabindex='-1'])",s=Array.from(e.querySelectorAll(t));for(const a of e.querySelectorAll("slot"))for(const e of a.assignedElements({flatten:!0})){e.matches(t)&&s.push(e);for(const a of e.querySelectorAll(t))s.push(a)}return s},a=()=>this.shadowRoot&&this.shadowRoot.activeElement||document.activeElement;e.addEventListener("keydown",t=>{if("Tab"!==t.key)return;const e=s();if(!e.length)return;const o=e[0],r=e[e.length-1];t.shiftKey&&a()===o?(t.preventDefault(),r.focus()):t.shiftKey||a()!==r||(t.preventDefault(),o.focus())})}}static get observedAttributes(){return[...super.observedAttributes,"open"]}attributeChangedCallback(t,e,s){if(super.attributeChangedCallback(t,e,s),"open"===t&&this.shadowRoot&&!this._syncingOpenAttr){const t=this.shadowRoot.querySelector("dialog");t&&(null===s||t.open?null===s&&t.open&&this.close():this.show())}}connectedCallback(){super.connectedCallback(),this.hasAttribute("open")&&this.show()}show(){if(!this.isConnected)return void(this.hasAttribute("open")||this.setAttribute("open",""));const t=this.shadowRoot?.querySelector("dialog");t&&!t.open&&t.showModal()}close(){const t=this.shadowRoot?.querySelector("dialog");t&&t.open&&t.close()}showModal(){this.show()}get open(){return!!this.shadowRoot?.querySelector("dialog")?.open}set open(t){t?this.show():this.close()}get returnValue(){return this.shadowRoot?.querySelector("dialog")?.returnValue??""}set returnValue(t){const e=this.shadowRoot?.querySelector("dialog");e&&(e.returnValue=String(t))}}define("contour-shadow-dialog",ContourShadowDialog);const renderShadowDSD=(t,e="",s="")=>{const a=SHADOW_MARKUP[t];if("string"!=typeof a)return null;return`<${t}${e?e.startsWith(" ")?e:" "+e:""}><template shadowrootmode="open">${a}</template>${s}</${t}>`},FROZEN_SHADOW_MARKUP=Object.freeze({...SHADOW_MARKUP});if("undefined"!=typeof globalThis&&(globalThis.ContourShadowTemplates=FROZEN_SHADOW_MARKUP),"undefined"!=typeof window){window.ContourShadowParts=Object.freeze(Object.fromEntries(Object.entries(SHADOW_PARTS_PUBLIC).map(([t,e])=>[t,Object.freeze([...new Set(e)])]))),window.Contour||(window.Contour={});try{window.Contour.shadowTemplates=FROZEN_SHADOW_MARKUP}catch{}}export{SHADOW_MARKUP,renderShadowDSD};const routeKey=t=>{const e=String(null==t?"":t).trim();if(!e)return"";if(e.startsWith("#"))return"hash:"+e;try{const t="undefined"!=typeof location?location.href:"http://localhost/",s=new URL(e,t);return"path:"+s.pathname.replace(/\/+$/,"")+s.search}catch(t){return"raw:"+e}},hereKey=t=>{const e=String(null==t?"":t).trim();return e?routeKey(e):"undefined"==typeof location?"":"path:"+String(location.pathname||"").replace(/\/+$/,"")+(location.search||"")},hashMatchesHere=t=>{if("undefined"==typeof location)return!1;if(location.hash&&location.hash===t)return!0;const e=String(location.pathname||"").split("/").filter(Boolean).pop()||"";return Boolean(e)&&t==="#"+e};class ContourDocsNav extends ContourBase{static get observed(){return["items","title","current","loading","error","retry","src","lazy","refresh","timeout","skeleton","cache-key","empty","no-cache"]}static get properties(){return{items:{attribute:"items"},title:{attribute:"title"},src:{attribute:"src"}}}render(){this.classList.add("c-docs-nav"),this.setAttribute("role","navigation");const t=this.getAttribute("title");if(t?this.setAttribute("aria-label",t):this.setAttribute("aria-label",labelText(this,"documentation-navigation","Documentation navigation")),wireStates(this),loadRemote(this,"items"),renderStates(this,"docs-nav"))return;const e=remoteData(this,"items"),s=this.hasAttribute("src")?e:e||(this.hasAttribute("items")?this.getAttribute("items"):null),a=this.querySelector(".c-docs-nav__list"),o=a?Array.from(a.children).filter(t=>t.classList&&t.classList.contains("c-docs-nav__group")):[];if(s&&!o.length)try{const t=JSON.parse(s),e=this.ensure(".c-docs-nav__list",()=>{const t=document.createElement("div");return t.className="c-docs-nav__list",t});e.innerHTML="",t.forEach(t=>{const s=document.createElement("div");if(s.className="c-docs-nav__group",t.title){const e=document.createElement("div");e.className="c-docs-nav__group-title",e.textContent=t.title,s.appendChild(e)}const a=document.createElement("div");a.className="c-docs-nav__list",(t.links||t.items||[]).forEach(t=>{const e=document.createElement("a");e.className="c-docs-nav__link",e.href=safeHref("string"==typeof t?"#":t.href||"#");const s="string"==typeof t?t:t.label||t;if("object"==typeof t&&null!==t&&t.badge){const s=document.createElement("span");s.className="c-docs-nav__badge",s.textContent=t.badge,e.appendChild(s)}if(e.appendChild(document.createTextNode(s)),"object"==typeof t&&null!==t&&t.chevron){const t=document.createElement("span");t.className="c-docs-nav__chevron",setHTML(t,'<svg aria-hidden="true" viewBox="0 0 24 24"><use href="#i-chevron-right" /></svg>'),e.appendChild(t)}if("object"==typeof t&&null!==t&&Array.isArray(t.items)){e.classList.add("c-docs-nav__link--nested");const s=document.createElement("div");s.className="c-docs-nav__list c-docs-nav__list--nested",t.items.forEach(t=>{const e=document.createElement("a");e.className="c-docs-nav__link",e.href=safeHref("string"==typeof t?"#":t.href||"#"),e.textContent="string"==typeof t?t:t.label||t,s.appendChild(e)}),a.appendChild(e),a.appendChild(s)}else a.appendChild(e)}),s.appendChild(a),e.appendChild(s)})}catch(t){warnBadJson(this,"attribute",t)}else!s&&a?(a.remove(),renderEmpty(this,"docs-nav")):s||a||renderEmpty(this,"docs-nav");this.applyCurrent()}applyCurrent(){const t=Array.from(this.querySelectorAll(".c-docs-nav__link"));if(!t.length)return;const e=this.getAttribute("current"),s=hereKey(e);t.forEach(t=>{const a=t.getAttribute("href")||"",o=routeKey(a);Boolean(s)&&(o&&o===s||a.startsWith("#")&&!e&&hashMatchesHere(a))?t.setAttribute("aria-current","page"):t.removeAttribute("aria-current")})}enhance(){if(!this._wiredDocsNav&&(this._wiredDocsNav=!0,this.addEventListener("click",t=>{const e=t.target&&t.target.closest?t.target.closest(".c-docs-nav__link"):null;if(e&&this.contains(e)){const t=e.textContent||"";this.dispatchEvent(new CustomEvent("contour:docs-nav-select",{bubbles:!0,composed:!0,detail:{label:t,href:e.getAttribute("href")}}))}}),this.addEventListener("keydown",t=>{const e=Array.from(this.querySelectorAll(".c-docs-nav__link"));e.length&&(e.some(t=>0===t.tabIndex)||e.forEach((t,e)=>t.tabIndex=0===e?0:-1),navKey(t,e,{wrap:!0,homeEnd:!0,onNavigate:t=>{e.forEach((e,s)=>e.tabIndex=s===t?0:-1)},onKey:e=>{if("Enter"===e){const e=document.activeElement;e&&(t.preventDefault(),e.click())}}}))}),"undefined"!=typeof window&&window.addEventListener)){const t=()=>this.applyCurrent();window.addEventListener("hashchange",t),window.addEventListener("popstate",t),onDispose(this,()=>{window.removeEventListener("hashchange",t),window.removeEventListener("popstate",t)})}}}define("contour-docs-nav",ContourDocsNav);class ContourDocsShell extends ContourBase{static get observed(){return["title","lede","article","heading"]}static get properties(){return{title:{attribute:"title"},lede:{attribute:"lede"},article:{attribute:"article"}}}render(){this.classList.add("c-docs-shell"),this.setAttribute("role","region");const t=this.getAttribute("title");if(t){this.ensure(".c-docs-shell__title",()=>{const t=document.createElement(headingTag(this,"h2"));return t.className="c-docs-shell__title",t}).textContent=t,this.setAttribute("aria-label",t)}else{const t=this.querySelector(".c-docs-shell__title");t&&t.remove()}const e=this.getAttribute("lede");if(e){this.ensure(".c-docs-shell__lede",()=>{const t=document.createElement("p");return t.className="c-docs-shell__lede",t}).textContent=e}else{const t=this.querySelector(".c-docs-shell__lede");t&&t.remove()}const s=this.getAttribute("article");if(s){const t=this.ensure(".c-docs-shell__article",()=>{const t=document.createElement("article");return t.className="c-docs-shell__article",t});setHTML(t,sanitizeHtml(s))}else{const t=this.querySelector(".c-docs-shell__article");t&&t.remove()}}}define("contour-docs-shell",ContourDocsShell);class ContourFileTree extends ContourBase{static get updateMode(){return"keyed"}static get observed(){return["items"]}static get properties(){return{items:{attribute:"items"}}}render(){this.classList.add("c-file-tree");const t=this.getAttribute("items");if(t)try{const e=JSON.parse(t),s=(t,e)=>{const a=document.createElement("div");a.className="c-file-tree__row"+(t.dir?" c-file-tree__row--dir":"")+(t.active?" c-file-tree__row--active":""),a.style.setProperty("--depth",String(e));const o=document.createElement("span");setHTML(o,t.dir?'<svg aria-hidden="true" viewBox="0 0 24 24"><use href="#i-folder" /></svg>':'<svg aria-hidden="true" viewBox="0 0 24 24"><use href="#i-file" /></svg>'),o.appendChild(document.createTextNode(" "+(t.label||t.name||""))),a.appendChild(o),this.appendChild(a),Array.isArray(t.children)&&t.children.forEach(t=>s(t,e+1))};Array.from(this.querySelectorAll(".c-file-tree__row")).forEach(t=>t.remove()),e.forEach(t=>s(t,0))}catch(t){warnBadJson(this,"attribute",t)}}}define("contour-file-tree",ContourFileTree);class ContourChangelog extends ContourBase{static get observed(){return["src","max","loading","error"]}static get properties(){return{src:{attribute:"src"},max:{attribute:"max",type:Number}}}render(){this.classList.add("c-changelog");const t=this.getAttribute("src");if(t){if(this.dataset.loaded===t)return;this.dataset.loaded="";const e=this.ensure(".c-changelog__loading",()=>{const t=document.createElement("div");return t.className="c-changelog__loading",t});e.textContent=labelText(this,"loading","Loading…"),Array.from(this.querySelectorAll(".c-changelog__entry, .c-changelog__error")).forEach(t=>t.remove()),this.querySelector(".c-changelog__loading")||this.appendChild(e);try{this._changelogAbort&&this._changelogAbort.abort()}catch(t){}this._changelogAbort="undefined"!=typeof AbortController?new AbortController:null,fetch(t,this._changelogAbort?{signal:this._changelogAbort.signal}:void 0).then(t=>{if(!t.ok)throw new Error("HTTP "+t.status);return t.text()}).then(e=>{if(!this.isConnected)return;const s=this.querySelector(".c-changelog__loading");s&&s.remove(),this.dataset.loaded=t;const a=parseChangelog(e),o=parseInt(this.getAttribute("max")||"0",10),r=o>0?a.slice(0,o):a;if(!r.length){const t=document.createElement("div");return t.className="c-changelog__empty",t.textContent=labelText(this,"empty","No releases found."),void this.appendChild(t)}r.forEach(t=>{const e=document.createElement("details");e.className="c-changelog__entry";const s=document.createElement("summary");s.className="c-changelog__summary";const a=document.createElement("span");if(a.className="c-changelog__version",a.textContent=t.version,s.appendChild(a),t.date){const e=document.createElement("span");e.className="c-changelog__date",e.textContent=t.date,s.appendChild(e)}e.appendChild(s);const o=document.createElement("div");o.className="c-changelog__body",setHTML(o,renderChangelogBody(t.body)),e.appendChild(o),this.appendChild(e)})}).catch(t=>{if(!this.isConnected)return;const e=this.querySelector(".c-changelog__loading");e&&e.remove();const s=document.createElement("div");s.className="c-changelog__error",s.textContent=labelText(this,"load-error","Failed to load changelog")+": "+(t&&t.message?t.message:t),this.appendChild(s)})}}disconnectedCallback(){super.disconnectedCallback();try{this._changelogAbort&&this._changelogAbort.abort()}catch(t){}this._changelogAbort=null}}function parseChangelog(t){const e=String(t).split(/\r?\n/),s=[];let a=null;for(const t of e){const e=t.match(/^##\s+\[?([^\]\n]+)\]?\s*[-–—]?\s*(.*)$/);if(e&&t.startsWith("## ")){const t=e[1].trim(),o=e[2].trim();if(/^\d|unreleased/i.test(t)){a&&s.push(a),a={version:t,date:o.replace(/^[-–—]\s*/,"").trim(),body:""};continue}}a&&(a.body+=t+"\n")}return a&&s.push(a),s}function escapeHtml(t){return String(t).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function renderChangelogBody(t){const e=String(t).trim().split(/\r?\n/),s=[];let a=!1;for(const t of e){const e=t.trimEnd();/^###\s+/.test(e)?(a&&(s.push("</ul>"),a=!1),s.push("<h3>"+escapeHtml(e.replace(/^###\s+/,""))+"</h3>")):/^##\s+/.test(e)?(a&&(s.push("</ul>"),a=!1),s.push("<h2>"+escapeHtml(e.replace(/^##\s+/,""))+"</h2>")):/^#\s+/.test(e)?(a&&(s.push("</ul>"),a=!1),s.push("<h2>"+escapeHtml(e.replace(/^#\s+/,""))+"</h2>")):/^[-*]\s+/.test(e)?(a||(s.push("<ul>"),a=!0),s.push("<li>"+escapeHtml(e.replace(/^[-*]\s+/,""))+"</li>")):""===e.trim()?a&&(s.push("</ul>"),a=!1):(a&&(s.push("</ul>"),a=!1),s.push("<p>"+escapeHtml(e)+"</p>"))}return a&&s.push("</ul>"),s.join("")}define("contour-changelog",ContourChangelog);