UNPKG

@public-ui/components

Version:

Contains all web components that belong to KoliBri - The accessible HTML-Standard.

4 lines 32.1 kB
/*! * KoliBri - The accessible HTML-Standard */ var commonjsGlobal="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},loglevel={exports:{}};!function(e){var t,o;t=commonjsGlobal,o=function(){var e=function(){},t="undefined",o=typeof window!==t&&typeof window.navigator!==t&&/Trident\/|MSIE /.test(window.navigator.userAgent),n=["trace","debug","info","warn","error"],r={},a=null;function i(e,t){var o=e[t];if("function"==typeof o.bind)return o.bind(e);try{return Function.prototype.bind.call(o,e)}catch(t){return function(){return Function.prototype.apply.apply(o,[e,arguments])}}}function s(){console.log&&(console.log.apply?console.log.apply(console,arguments):Function.prototype.apply.apply(console.log,[console,arguments])),console.trace&&console.trace()}function l(){for(var o=this.getLevel(),r=0;r<n.length;r++){var a=n[r];this[a]=r<o?e:this.methodFactory(a,o,this.name)}if(this.log=this.debug,typeof console===t&&o<this.levels.SILENT)return"No console available for logging"}function c(e){return function(){typeof console!==t&&(l.call(this),this[e].apply(this,arguments))}}function u(n,r,a){return function(n){return"debug"===n&&(n="log"),typeof console!==t&&("trace"===n&&o?s:void 0!==console[n]?i(console,n):void 0!==console.log?i(console,"log"):e)}(n)||c.apply(this,arguments)}function d(e,o){var i,s,c,d=this,g="loglevel";function h(){var e;if(typeof window!==t&&g){try{e=window.localStorage[g]}catch(e){}if(typeof e===t)try{var o=window.document.cookie,n=encodeURIComponent(g),r=o.indexOf(n+"=");-1!==r&&(e=/^([^;]+)/.exec(o.slice(r+n.length+1))[1])}catch(e){}return void 0===d.levels[e]&&(e=void 0),e}}function f(e){var t=e;if("string"==typeof t&&void 0!==d.levels[t.toUpperCase()]&&(t=d.levels[t.toUpperCase()]),"number"==typeof t&&t>=0&&t<=d.levels.SILENT)return t;throw new TypeError("log.setLevel() called with invalid level: "+e)}"string"==typeof e?g+=":"+e:"symbol"==typeof e&&(g=void 0),d.name=e,d.levels={TRACE:0,DEBUG:1,INFO:2,WARN:3,ERROR:4,SILENT:5},d.methodFactory=o||u,d.getLevel=function(){return null!=c?c:null!=s?s:i},d.setLevel=function(e,o){return c=f(e),!1!==o&&function(e){var o=(n[e]||"silent").toUpperCase();if(typeof window!==t&&g){try{return void(window.localStorage[g]=o)}catch(e){}try{window.document.cookie=encodeURIComponent(g)+"="+o+";"}catch(e){}}}(c),l.call(d)},d.setDefaultLevel=function(e){s=f(e),h()||d.setLevel(e,!1)},d.resetLevel=function(){c=null,function(){if(typeof window!==t&&g){try{window.localStorage.removeItem(g)}catch(e){}try{window.document.cookie=encodeURIComponent(g)+"=; expires=Thu, 01 Jan 1970 00:00:00 UTC"}catch(e){}}}(),l.call(d)},d.enableAll=function(e){d.setLevel(d.levels.TRACE,e)},d.disableAll=function(e){d.setLevel(d.levels.SILENT,e)},d.rebuild=function(){if(a!==d&&(i=f(a.getLevel())),l.call(d),a===d)for(var e in r)r[e].rebuild()},i=f(a?a.getLevel():"WARN");var p=h();null!=p&&(c=f(p)),l.call(d)}(a=new d).getLogger=function(e){if("symbol"!=typeof e&&"string"!=typeof e||""===e)throw new TypeError("You must supply a name when creating a logger.");var t=r[e];return t||(t=r[e]=new d(e,a.methodFactory)),t};var g=typeof window!==t?window.log:void 0;return a.noConflict=function(){return typeof window!==t&&window.log===a&&(window.log=g),a},a.getLoggers=function(){return r},a.default=a,a},e.exports?e.exports=o():t.log=o()}(loglevel);const h=loglevel.exports,I=(e,t)=>o=>o(e,t),P=(e,t)=>o=>o(e,t,{append:!1}),$=()=>{const e=typeof process<"u"&&process.env?process.env:{},t="test"===e.NODE_ENV,o="VITEST"in e,n="JEST_WORKER_ID"in e,r="PLAYWRIGHT_TEST_BASE_URL"in e,a="true"===e.CI,i="true"===e.TEST||"true"===e.IS_TEST,s=typeof navigator<"u"&&!0===navigator.webdriver,l=typeof navigator<"u"&&/playwright|puppeteer|webdriver|selenium|testcafe/i.test(navigator.userAgent);return t||o||n||r||a||i||s||l},n$1={A11yUi:{CSS_STYLE_CACHE:new Map,IS_TEST_ENVIRONMENT:$(),PERFORMANCE_MEASURES:new Map,STYLING_TASK_QUEUE:new Map,THEMES:new Map,showAverageTimes:()=>{const e={};for(const[t,o]of n$1.A11yUi.PERFORMANCE_MEASURES.entries())e[t]=[o.totalTime/o.count,o.count];const t=Object.entries(e).sort(((e,t)=>t[1][0]-e[1][0]));return console.table(Object.fromEntries(t.map((([e,[t,o]])=>[e,{"avg (ms)":parseFloat(t.toFixed(2)),count:o}])))),e}}};let d=!0,f$1=!1;const j=/^[a-z][a-z0-9]{1,}(-[a-z0-9]+)?$/,F=e=>"string"==typeof e&&j.test(e),E=e=>{if(!F(e))throw new Error(`[Theming] The theme identifier "${"string"==typeof e?e:""}" (Type: ${typeof e}) is not valid. Please use only follow this pattern: /^[a-z][a-z0-9]{1,}(-[a-z0-9]+)?$/`)},g=e=>e.replace(/\/\*[\s\S]*?\*\//g,"").replace(/\s*([{}:;,])\s*/g,"$1").replace(/\s+/g," ").replace(/;\}/g,"}").trim(),Y=(e,t,o,n)=>u$1(e,t,o,n),u$1=(e,t,o,n)=>{(n=n??{}).append=n.append??!1,E(e),d&&!f$1&&(f$1=!0,h.warn(`[Theming] The theme process is locked. This means that the theme "${e}" should not be patched.\n\n import { register } from 'adopted-style-sheets';\n import { defineCustomElements } from '...';\n import { THEME } from '...';\n\n register(THEME, defineCustomElements)\n .then(() => {\n // run your app or website\n })\n .catch(console.warn);`));let r=n$1.A11yUi.THEMES.get(e);if(r||(r=new Map,n$1.A11yUi.THEMES.set(e,r)),n.append&&r.has(t)){const e=r.get(t);r.set(t,g(`${e}${o}`))}else r.set(t,g(o))},k=(e,t,o,n)=>T(e,t,o,n),T=(e,t,o,n)=>(E(e),"object"==typeof t&&null!==t&&Object.getOwnPropertyNames(t).forEach((r=>{const a=t[r],i=r.toLowerCase(),s="function"!=typeof n?.transformTagName||["GLOBAL","PROPERTIES"].includes(r)?r:n.transformTagName(i);"string"==typeof a&&a.length>0&&u$1(e,s.toUpperCase(),a,o)})),e),S=e=>{if(e instanceof HTMLElement){if("string"==typeof e.dataset.theme)return e;{let t=e.parentNode;for(;t instanceof ShadowRoot;)t=t.host;return S(t)}}return null},A=(e={})=>"false"!==e.themeEncroachCss&&"true"!==e.themeReset&&{mode:"after"===e.themeEncroachCssMode||"before"===e.themeEncroachCssMode?e.themeEncroachCssMode:"before"},b=()=>"object"==typeof n$1.A11yUi.Theme&&null!==n$1.A11yUi.Theme&&"boolean"==typeof n$1.A11yUi.Theme.cache&&"object"==typeof n$1.A11yUi.Theme.encroachCss&&null!==n$1.A11yUi.Theme.encroachCss&&"string"==typeof n$1.A11yUi.Theme.encroachCss.mode&&"string"==typeof n$1.A11yUi.Theme.name,G=()=>!("object"==typeof n$1.A11yUi.Theme&&null!==n$1.A11yUi.Theme)||"default"!==n$1.A11yUi.Theme.name,C=e=>{if(b())return n$1.A11yUi.Theme;{const t={cache:!0,encroachCss:A(),loglevel:"silent",mode:"csr",name:null},o=S(e);return o instanceof HTMLElement&&(t.cache="false"!==o.dataset.themeCache,t.encroachCss=A(o.dataset),t.loglevel="debug"===o.dataset.themeLoglevel?o.dataset.themeLoglevel:"silent",t.mode="ssr"===o.dataset.themeMode?o.dataset.themeMode:"csr",t.name=o.dataset.theme||null),t}},B=(e,t)=>({cache:!1!==t.cache,detect:"auto"===t.detect?"auto":"fixed",encroachCss:!1!==t.encroachCss&&("object"!=typeof t.encroachCss||null==t.encroachCss||"after"!==t.encroachCss.mode&&"before"!==t.encroachCss.mode?{mode:"before"}:t.encroachCss),loglevel:"debug"===t.loglevel?t.loglevel:"silent",mode:"ssr"===t.mode?t.mode:"csr",name:"string"==typeof t.name?t.name:e}),K=(e,t)=>{!1===b()&&G()&&"object"==typeof t&&null!==t&&("fixed"===(t=B(e,t)).detect?(null===t.name&&"string"==typeof e&&(t.name=e),e===t.name&&(n$1.A11yUi.Theme=t,h.info(`[Theming] Theme "${e}" was set as default theme.`))):f$1||(f$1=!0,h.warn("[Theming] The presetting of theme options is only relevant by using 'fixed' detection mode.")))};let U=!1;const V=(e,t,o={})=>{U||(U=!0,d=!1,typeof window<"u"&&(window.A11yUi=n$1.A11yUi)),"function"==typeof e?e=new Set([e]):Array.isArray(e)&&(e=new Set(e)),e instanceof Set&&e.forEach((e=>{"function"==typeof e&&1===e.length?K(e(((e,t,n)=>T(e,t,n,o))),{cache:o.theme?.cache,detect:o.theme?.detect,encroachCss:o.theme?.encroachCss,mode:o.theme?.mode,name:o.theme?.name}):h.error("[Theming] An attempt was made to load an incompatible theme.")})),d=!0,"function"==typeof t?t=new Set([t]):Array.isArray(t)&&(t=new Set(t));const n=[];return t.forEach((e=>{const t=e();t instanceof Promise&&n.push(t)})),Promise.all(n)},w=new Set,W=/--[^;]+/g,q=/:/,J=typeof MutationObserver<"u";let M=25,v=()=>{M=Math.min(25+20*Math.log2(n$1.A11yUi.STYLING_TASK_QUEUE.size+1),250)};const X=(e,t)=>{let o=t.match(W);if(Array.isArray(o)){o=o.filter((e=>q.test(e)));const t=document.createElement("style");t.innerHTML=`.${e} {${o.join(";")}}`,document.querySelector("head")?.appendChild(t)}w.add(e)},y=(e,t)=>{const o=n$1.A11yUi.THEMES.get(e);return o instanceof Map&&o.has(t)?o.get(t):""},Z=e=>{for(const t of Array.from(e.childNodes)){if(!(t instanceof HTMLStyleElement&&"STYLE"===t.tagName&&void 0===t.dataset.themingFallback))break;e.removeChild(t)}},ee=(e,t)=>{try{if("ssr"===n$1.A11yUi.Theme?.mode)throw new Error("SSR");const o=[];t.forEach((e=>{const t=new CSSStyleSheet;t.replaceSync(e),o.push(t)})),e.adoptedStyleSheets=o}catch{[...t].reverse().forEach(((t,o)=>{if("string"!=typeof t||0===t.length)return;const n=document.createElement("style");switch(n.dataset.themingFallback="",o){case 4:n.dataset.themingBaseA11y="";break;case 3:n.dataset.themingBaseGlobal="";break;case 2:n.dataset.themingBaseComponent="";break;case 1:n.dataset.themingCustomGlobal="";break;case 0:n.dataset.themingCustomComponent="";break;default:n.dataset.themingUnknown=""}n.innerHTML=t,e.insertBefore(n,e.firstChild)}))}},te=(e,t,o)=>{if(!1!==o){const n=[...Array.from(e.childNodes).filter((e=>e instanceof HTMLStyleElement&&"STYLE"===e.tagName))];let r;try{r=[...Array.from(e.adoptedStyleSheets)]}catch{r=[]}"before"===o?.mode?(n.reverse().forEach((e=>t.unshift(e.innerHTML))),r.reverse().forEach((e=>t.unshift(Array.from(e.cssRules).map((e=>e.cssText)).join(""))))):"after"===o?.mode&&(n.forEach((e=>t.push(e.innerHTML))),r.forEach((e=>t.push(Array.from(e.cssRules).map((e=>e.cssText)).join("")))))}},se=(e,t,o)=>{const n=t.name||"default";let r;try{if(null===e.shadowRoot)throw new Error("ShadowRoot is null");r=e.shadowRoot}catch{r=e}if(n$1.A11yUi.CSS_STYLE_CACHE.get(n)?.has(e.tagName))N(e,r,n$1.A11yUi.CSS_STYLE_CACHE.get(n)?.get(e.tagName),o);else{const a=y(n,"PROPERTIES"),i=y(n,"GLOBAL"),s=y(n,e.tagName);!1===w.has(n)&&X(n,i);const l=[a,i,s];te(r,l,t.encroachCss),!0===t.cache&&(!1===n$1.A11yUi.CSS_STYLE_CACHE.has(n)&&n$1.A11yUi.CSS_STYLE_CACHE.set(n,new Map),n$1.A11yUi.CSS_STYLE_CACHE.get(n)?.set(e.tagName,l)),N(e,r,l,o)}},N=(e,t,o,n)=>{const r=performance.now();if(Z(t),ee(t,o),H(e),n(),n$1.A11yUi.PERFORMANCE_MEASURES.has(e.tagName)){const t=n$1.A11yUi.PERFORMANCE_MEASURES.get(e.tagName);t.count+=1,t.totalTime+=performance.now()-r}else n$1.A11yUi.PERFORMANCE_MEASURES.set(e.tagName,{count:1,totalTime:performance.now()-r})},L=e=>{const t=n$1.A11yUi.STYLING_TASK_QUEUE.get(e);if(t){const{resetCss:o,themeDetails:n}=t;se(e,n,o),H(e)}};let p=e=>{const t=setTimeout((()=>{clearTimeout(t),e.classList.contains("hydrated")?L(e):p(e)}),M)};const ae={attributes:!0,attributeFilter:["class"],childList:!1,subtree:!1},oe={attributes:!0,attributeFilter:[],childList:!1,subtree:!1},R=J?new MutationObserver(((e,t)=>{for(const o of e){const e=o.target;e.classList.contains("hydrated")&&(L(e),t.observe(e,oe))}})):null;R&&(p=e=>R.observe(e,ae),v=()=>{});let _=e=>{const t=getComputedStyle(e).getPropertyValue("--theme-visibility-delay").trim();if(t.endsWith("ms"))return parseFloat(t);if(t.endsWith("s"))return 1e3*parseFloat(t);{const e=parseFloat(t);return isNaN(e)?0:e}};n$1.A11yUi.IS_TEST_ENVIRONMENT&&(_=()=>0,console.log("Test-Runner detected, disabling theme visibility delay."));const O=(e,t)=>{e.style.setProperty("visibility",t),e.dataset.themed=""},re=(e,t)=>{const o=e.style.visibility||null;n$1.A11yUi.STYLING_TASK_QUEUE.set(e,{resetCss:()=>{const t=_(e);t>0?setTimeout((()=>{O(e,o)}),t):O(e,o)},themeDetails:t}),e.style.setProperty("visibility","hidden","important"),p(e)},H=e=>{n$1.A11yUi.STYLING_TASK_QUEUE.delete(e),v()},ne=(e,t)=>{re(e,{...n$1.A11yUi.Theme,...t})};class ie{Prefix;Key;Tag;createTheme=(e,t)=>P(e,t);createTranslation=(e,t)=>I(e,t);constructor(e,t,o){this.Prefix=e,this.Key=Object.getOwnPropertyNames(t),this.Tag=Object.getOwnPropertyNames(o)}}var KeyEnum,TagEnum;!function(e){e[e.error=0]="error",e[e.warning=1]="warning",e[e.info=2]="info",e[e.success=3]="success",e[e.message=4]="message",e[e.close=5]="close",e[e["form-description"]=6]="form-description",e[e.of=7]="of",e[e.characters=8]="characters",e[e.new=9]="new",e[e["no-entries"]=10]="no-entries",e[e["change-order"]=11]="change-order",e[e["action-running"]=12]="action-running",e[e["action-done"]=13]="action-done",e[e["page-first"]=14]="page-first",e[e["page-back"]=15]="page-back",e[e["page-next"]=16]="page-next",e[e["page-last"]=17]="page-last",e[e["entries-per-site"]=18]="entries-per-site",e[e["page-current"]=19]="page-current",e[e["page-selected"]=20]="page-selected",e[e["page-per-site"]=21]="page-per-site",e[e["logo-description"]=22]="logo-description",e[e["open-link-in-tab"]=23]="open-link-in-tab",e[e["kolibri-logo"]=24]="kolibri-logo"}(KeyEnum||(KeyEnum={})),function(e){e[e.abbr=0]="abbr",e[e.accordion=1]="accordion",e[e["accordion-group"]=2]="accordion-group",e[e.alert=3]="alert",e[e.avatar=4]="avatar",e[e.badge=5]="badge",e[e.breadcrumb=6]="breadcrumb",e[e.button=7]="button",e[e["button-link"]=8]="button-link",e[e.card=9]="card",e[e.combobox=10]="combobox",e[e.details=11]="details",e[e.drawer=12]="drawer",e[e.form=13]="form",e[e.heading=14]="heading",e[e.icon=15]="icon",e[e.image=16]="image",e[e["input-checkbox"]=17]="input-checkbox",e[e["input-color"]=18]="input-color",e[e["input-date"]=19]="input-date",e[e["input-email"]=20]="input-email",e[e["input-file"]=21]="input-file",e[e["input-number"]=22]="input-number",e[e["input-password"]=23]="input-password",e[e["input-radio"]=24]="input-radio",e[e["input-range"]=25]="input-range",e[e["input-text"]=26]="input-text",e[e.kolibri=27]="kolibri",e[e.link=28]="link",e[e["link-button"]=29]="link-button",e[e.logo=30]="logo",e[e.modal=31]="modal",e[e.nav=32]="nav",e[e.pagination=33]="pagination",e[e["popover-button"]=34]="popover-button",e[e.progress=35]="progress",e[e.select=36]="select",e[e.separator=37]="separator",e[e["single-select"]=38]="single-select",e[e["skip-nav"]=39]="skip-nav",e[e.spin=40]="spin",e[e["split-button"]=41]="split-button",e[e.symbol=42]="symbol",e[e.table=43]="table",e[e["table-stateful"]=44]="table-stateful",e[e["table-stateless"]=45]="table-stateless",e[e.tabs=46]="tabs",e[e.textarea=47]="textarea",e[e["toast-container"]=48]="toast-container",e[e.toolbar=49]="toolbar",e[e.tooltip=50]="tooltip",e[e.tree=51]="tree",e[e["tree-item"]=52]="tree-item"}(TagEnum||(TagEnum={}));const getWindow=()=>"undefined"==typeof window?null:window,getDocument=()=>void 0===getWindow().document?null:getWindow().document;let DEV_MODE=!1,EXPERIMENTAL_MODE=!1,COLOR_CONTRAST_ANALYSIS=!1;const getDevMode=()=>!0===DEV_MODE,setDevMode=e=>{DEV_MODE=!0===e},getExperimentalMode=()=>!0===EXPERIMENTAL_MODE,setExperimentalMode=e=>{EXPERIMENTAL_MODE=!0===e},getColorContrastAnalysis=()=>!0===COLOR_CONTRAST_ANALYSIS,setColorContrastAnalysis=e=>{COLOR_CONTRAST_ANALYSIS=!0===e},LOG_STYLE="color: white; background: #666; font-weight: bold; padding: .25em .5em; border-radius: 3px; border: 1px solid #000",mapToArray=e=>Array.isArray(e)?e:[e],getLogLabel=e=>`%c${e}`,handleClassifier=(e,t)=>"string"==typeof t&&t.length>0?`${getLogLabel(e)} | ${t}`:getLogLabel(e),getShield=(e,t)=>[handleClassifier(e,null==t?void 0:t.classifier),`${LOG_STYLE};${(null==t?void 0:t.overwriteStyle)||""}`],isDevModeOrForceLog=(e,t)=>e()||!0===t;class Logger{constructor(e,t){this.label=e,this.devMode=t}debug(e,t){isDevModeOrForceLog(this.devMode,null==t?void 0:t.forceLog)&&console.debug(...getShield(this.label,t),...mapToArray(e))}info(e,t){isDevModeOrForceLog(this.devMode,null==t?void 0:t.forceLog)&&console.info(...getShield(this.label,t),...mapToArray(e))}trace(e,t){isDevModeOrForceLog(this.devMode,null==t?void 0:t.forceLog)&&console.trace(...getShield(this.label,t),...mapToArray(e))}warn(e,t){isDevModeOrForceLog(this.devMode,null==t?void 0:t.forceLog)&&console.warn(...getShield(this.label,t),...mapToArray(e))}error(e,t){console.error(...getShield(this.label,t),...mapToArray(e))}throw(e,t){if(isDevModeOrForceLog(this.devMode,null==t?void 0:t.forceLog))throw new Error(...getShield(this.label,t),...mapToArray(e))}}const Log=new Logger("KoliBri",getDevMode),a11yCache=new Set,a11yHint=(e,t)=>{(!1===a11yCache.has(e)||(null==t?void 0:t.force))&&(a11yCache.add(e),Log.debug([e].concat((null==t?void 0:t.details)||[]),{classifier:"✋ a11y",forceLog:!!(null==t?void 0:t.force),overwriteStyle:"; background-color: #09f"}))},deprecatedCache=new Set,deprecatedHint=(e,t)=>{(!1===deprecatedCache.has(e)||(null==t?void 0:t.force))&&(deprecatedCache.add(e),Log.warn([e].concat((null==t?void 0:t.details)||[]),{classifier:"🔥 deprecated",forceLog:!!(null==t?void 0:t.force),overwriteStyle:"; background-color: #f00"}))},devCache=new Set,devHint=(e,t)=>{(!1===devCache.has(e)||(null==t?void 0:t.force))&&(devCache.add(e),Log.debug([e].concat((null==t?void 0:t.details)||[]),{classifier:"💻 dev",forceLog:!!(null==t?void 0:t.force),overwriteStyle:"; background-color: #f09"}))},devWarning=(e,t)=>{(!1===devCache.has(e)||(null==t?void 0:t.force))&&(devCache.add(e),Log.warn([e].concat((null==t?void 0:t.details)||[]),{classifier:"⚠️ dev",forceLog:!!(null==t?void 0:t.force),overwriteStyle:"; background-color: #f09"}))},featureCache=new Set,featureHint=(e,t=!1,o)=>{(!1===featureCache.has(e)||(null==o?void 0:o.force))&&(featureCache.add(e),e+=!0===t?" ✅":"",Log.debug([e].concat((null==o?void 0:o.details)||[]),{classifier:"🌟 feature",forceLog:!!(null==o?void 0:o.force),overwriteStyle:"; background-color: #309"}))};devHint("We appreciate any feedback, comments, screenshots, or demo links of an application based on KoliBri (kolibri@itzbund.de). Thank you!");const uiUxCache=new Set,uiUxHint=(e,t)=>{(!1===uiUxCache.has(e)||(null==t?void 0:t.force))&&(uiUxCache.add(e),Log.debug([e].concat((null==t?void 0:t.details)||[]),{classifier:"📑 ui/ux",forceLog:!!(null==t?void 0:t.force),overwriteStyle:"; background-color: #060;"}))},a11yHintDisabled=()=>{a11yHint('"Disabled" limits accessibility and visibility. From an accessibility perspective, we recommend using the readonly attribute instead of disabled.\n- https://uxdesign.cc/is-it-ok-to-grey-out-disabled-buttons-8afa74a0fae')},a11yHintLabelingLandmarks=e=>{"string"==typeof e&&""!==e||a11yHint("Some structural elements, such as the nav tag, can be used multiple times on a webpage. To distinguish between similarly named structural elements, it is necessary to set an ARIA label.\n- https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Roles/Navigation_Role#accessibility_concerns")},uiUxHintMillerscheZahl=(e,t=8)=>{t>7&&uiUxHint(`[${e}] Within navigation structures, it is recommended to use no more than 7 menu items.\n\nLink:\n- https://en.wikipedia.org/wiki/The_Magical_Number_Seven,_Plus_or_Minus_Two`)};var n=.2126,r=.7152,t=.0722,e=1/12.92;function u(e){return Math.pow((e+.055)/1.055,2.4)}function a(o){var a=o[0]/255,i=o[1]/255,s=o[2]/255,l=a<=.03928?a*e:u(a),c=i<=.03928?i*e:u(i),d=s<=.03928?s*e:u(s);return l*n+c*r+d*t}function i(e){var t=255;8===(e=e.replace(/^#/,"")).length&&(t=parseInt(e.slice(6,8),16),e=e.substring(0,6)),4===e.length&&(t=parseInt(e.slice(3,4).repeat(2),16),e=e.substring(0,3)),3===e.length&&(e=e[0]+e[0]+e[1]+e[1]+e[2]+e[2]);var o=parseInt(e,16);return[o>>16,o>>8&255,255&o,t]}function c(e,t){return(Math.max(e,t)+.05)/(Math.min(e,t)+.05)}function o(e,t){return c(a(e),a(t))}function s(e,t){return o(i(e),i(t))}function f(e){return e>=7?"AAA":e>=4.5?"AA":e>=3?"AA Large":"Fail"}var rgbaConvert={exports:{}};function arr(e){var t=parse(e);return 3==t.length?t.concat(255):(t[3]=Math.round(t[3]),t)}function obj(e){var t=parse(e);return{r:t[0],g:t[1],b:t[2],a:3==t.length?255:Math.round(t[3])}}function css(e){var t=parse(e);return 3==t.length&&t.push(255),255==t[3]?"rgb("+t[0]+", "+t[1]+", "+t[2]+")":0==t[3]?"rgba("+t[0]+", "+t[1]+", "+t[2]+", 0)":"rgba("+t[0]+", "+t[1]+", "+t[2]+", "+String(t[3]/255).substr(1)+")"}function hex(e){3==(t=parse(e)).length&&t.push(255);var t,o=255==t[3],n=num2hex(t[0]),r=num2hex(t[1]),a=num2hex(t[2]),i=isshort(n,r,a,t=num2hex(Math.round(t[3])));return o?i?"#"+n.charAt(0)+r.charAt(0)+a.charAt(0):"#"+n+r+a:i?"#"+n.charAt(0)+r.charAt(0)+a.charAt(0)+t.charAt(0):"#"+n+r+a+t}function num(e){var t=parse(e);return 3==t.length?t.push(255):t[3]=Math.round(t[3]),(t[3]<<24>>>0|t[0]<<16|t[1]<<8|t[2])>>>0}function parse(e){return"string"==typeof e?name(e=e.toLowerCase())||hex3(e)||hex6(e)||rgb(e)||rgba(e)||[0,0,0,255]:object(e)||array(e)||number(e)||[0,0,0,255]}function num2hex(e){var t=e.toString(16);return 1==t.length?"0"+t:t}function isshort(e,t,o,n){var r=["ff","00","11","22","33","44","55","66","77","88","99","aa","bb","cc","dd","ee"];return-1!=r.indexOf(e)&&-1!=r.indexOf(t)&&-1!=r.indexOf(o)&&-1!=r.indexOf(n)}function name(e){return"red"==e?[255,0,0]:"green"==e?[0,255,0]:"blue"==e?[0,0,255]:"black"==e?[0,0,0]:"white"==e?[255,255,255]:"cyan"==e?[0,255,255]:"gray"==e||"grey"==e?[128,128,128]:"magenta"==e||"pink"==e?[255,0,255]:"yellow"==e?[255,255,0]:void 0}function hex2num(e){return 1==e.length?parseInt(e+e,16):parseInt(e,16)}function hex3(e){var t=e.replace(/^#/,""),o=t.length;if(3==o||4==o){var n=hex2num(t[0]),r=hex2num(t[1]),a=hex2num(t[2]),i=3==o?255:hex2num(t[3]);if(isNaN(n)||isNaN(r)||isNaN(a)||isNaN(i))return;return[n,r,a,i]}}function hex6(e){var t=e.replace(/^#/,""),o=t.length;if(6==o||8==o){var n=hex2num(t.slice(0,2)),r=hex2num(t.slice(2,4)),a=hex2num(t.slice(4,6)),i=6==o?255:hex2num(t.slice(6,8));if(isNaN(n)||isNaN(r)||isNaN(a)||isNaN(i))return;return[n,r,a,i]}}function getnum(e,t){return"number"!=typeof e||!0===t&&Math.floor(e)!==e?-1:e>=0&&e<=255?e:-1}function object(e){if("[object Object]"===Object.prototype.toString.call(e)&&Object.getPrototypeOf(e)===Object.getPrototypeOf({})){var t=getnum(null!=e.r?e.r:null!=e.red?e.red:0,!0),o=getnum(null!=e.g?e.g:null!=e.green?e.green:0,!0),n=getnum(null!=e.b?e.b:null!=e.blue?e.blue:0,!0),r=getnum(null!=e.a?e.a:null!=e.alpha?e.alpha:255,!0);if(-1!=t&&-1!=o&&-1!=n&&-1!=r)return[t,o,n,r]}}function array(e){if(Array.isArray(e)&&(3==e.length||4==e.length)){var t=getnum(e[0],!0),o=getnum(e[1],!0),n=getnum(e[2],!0),r=getnum(null!=e[3]?e[3]:255,!0);if(-1!=t&&-1!=o&&-1!=n&&-1!=r)return[t,o,n,r]}}function number(e){if("number"==typeof e&&Math.floor(e)==e&&e<=4294967295&&e>=0)return[e>>16&255,e>>8&255,255&e,e>>24&255]}function rgb(e){if("rgb("==e.substr(0,4)){var t=(e=e.match(/^rgb\(([^)]+)\)/)[1]).split(/ *, */).map(Number),o=getnum(t[0],!0),n=getnum(t[1],!0),r=getnum(t[2],!0);if(-1!=o&&-1!=n&&-1!=r)return[o,n,r,255]}}function rgba(e){if("rgba("==e.substr(0,5)){var t=(e=e.match(/^rgba\(([^)]+)\)/)[1]).split(/ *, */).map(Number),o=getnum(t[0],!0),n=getnum(t[1],!0),r=getnum(t[2],!0),a=getnum(255*t[3]);if(-1!=o&&-1!=n&&-1!=r&&-1!=a)return[o,n,r,a]}}rgbaConvert.exports=arr,rgbaConvert.exports.arr=arr,rgbaConvert.exports.obj=obj,rgbaConvert.exports.css=css,rgbaConvert.exports.hex=hex,rgbaConvert.exports.num=num;const rgba$1=rgbaConvert.exports,pushNodes=(e,t)=>{t.forEach((t=>{!1===e.has(t)&&e.add(t)}))},querySelectorAll=(e,t=document)=>{if(t instanceof Document||t instanceof HTMLElement||t instanceof ShadowRoot){const o=new Set;pushNodes(o,t.querySelectorAll(e));const n=t.querySelectorAll('[class*="hydrated"]');for(let t=0;t<n.length;t++){const r=n[t].shadowRoot;pushNodes(o,querySelectorAll(e,"object"==typeof r&&null!==r?r:n[t]))}return Array.from(o)}throw new Error("The parameter document for the method querySelectorAll is not type of Document, HTMLElement or ShadowRoot.")},querySelector=(e,t=document)=>{if(t instanceof Document||t instanceof HTMLElement||t instanceof ShadowRoot){let o=t.querySelector(e);if(null===o){const n=t.querySelectorAll('[class*="hydrated"]');for(let t=0;t<n.length;t++){const r=n[t].shadowRoot;if(o=querySelector(e,"object"==typeof r&&null!==r?r:n[t]),null!==o)break}}return o}throw new Error("The parameter document for the method querySelector is not type of Document, HTMLElement or ShadowRoot.")},OBJECT_OBJECT=/\[object Object\]/,objectObjectHandler=(e,t)=>{"string"==typeof e&&OBJECT_OBJECT.test(e)||t()},emptyStringByArrayHandler=(e,t)=>{"string"==typeof e&&""===e||t()},setEventTarget=(e,t)=>{getExperimentalMode()&&(Log.debug([e,t]),Log.debug("↑ We propagate the (submit) event to this target.")),Object.defineProperty(e,"target",{value:t,writable:!1})},patchState=e=>{var t,o,n;null===(t=e.nextHooks)||void 0===t||t.forEach(((t,o)=>{var n;const r=t.get("beforePatch");"function"==typeof r&&r(null===(n=e.nextState)||void 0===n?void 0:n.get(o),e.nextState,e,o)})),(null===(o=e.nextState)||void 0===o?void 0:o.size)>0&&(e.state=Object.assign(Object.assign({},e.state),Object.fromEntries(e.nextState)),delete e.nextState,null===(n=e.nextHooks)||void 0===n||n.forEach(((t,o)=>{const n=t.get("afterPatch");"function"==typeof n&&n(e.state[o],e.state,e,o)}))),delete e.nextHooks},setState=(e,t,o,n={})=>{var r,a;void 0===e.nextHooks&&(e.nextHooks=new Map),void 0===e.nextState&&(e.nextState=new Map);e.nextHooks.get(t)instanceof Map==!1&&e.nextHooks.set(t,new Map),"function"==typeof n.afterPatch&&(null===(r=e.nextHooks.get(t))||void 0===r||r.set("afterPatch",n.afterPatch)),"function"==typeof n.beforePatch&&(null===(a=e.nextHooks.get(t))||void 0===a||a.set("beforePatch",n.beforePatch)),e.nextState.set(t,o),patchState(e)},logWarn=(e,t,o,n)=>{devHint(`[${e.constructor.name}] The property value: (${o}) for '${t}' is not valid. Allowed values are: ${Array.from(n).join(", ")}`)};function watchValidator(e,t,o,n,r,a={}){o(r)?setState(e,t,r,a.hooks):void 0===r&&!0!==a.required&&o(a.defaultValue)?setState(e,t,a.defaultValue,a.hooks):(a.required||n.add(null),logWarn(e,t,r,n))}const watchBoolean=(e,t,o,n)=>{watchValidator(e,t,(e=>"boolean"==typeof e),new Set(["Boolean {true, false}"]),o,n)},watchString=(e,t,o,n={})=>{const r="number"==typeof n.minLength?null==n?void 0:n.minLength:0;watchValidator(e,t,(e=>"string"==typeof e&&e.length>=r&&(void 0===(null==n?void 0:n.maxLength)||e.length<=n.maxLength)),new Set(["String"]),o,n)},watchNumber=(e,t,o,n)=>{watchValidator(e,t,(e=>"number"==typeof e&&(void 0===(null==n?void 0:n.min)||"number"==typeof(null==n?void 0:n.min)&&e>=n.min)&&(void 0===(null==n?void 0:n.max)||"number"==typeof(null==n?void 0:n.max)&&e<=n.max)),new Set(["Number"]),o,n)},watchJsonArrayString=(e,t,o,n,r=e=>e==e,a={})=>{emptyStringByArrayHandler(n,(()=>{objectObjectHandler(n,(()=>{void 0===n&&(n=[]);try{try{n=parseJson(n)}catch(e){}if(Array.isArray(n)){const i=n.find((e=>!o(e)));void 0===i&&r(n)?setState(e,t,n,a.hooks):objectObjectHandler(i,(()=>{throw Log.debug(i),new Error("↑ The schema for the property (_options) is not valid. The value will not be changed.")}))}else objectObjectHandler(n,(()=>{throw Log.debug(n),new Error("↑ The schema for the property (_options) is not valid. The value will not be changed.")}))}catch(e){Log.debug(e)}}))}))},stringifyJson=e=>{try{return JSON.stringify(e).replace(/"/g,"'")}catch(t){throw Log.warn(["stringifyJson",e]),Log.error("↑ The JSON could not be converted to a string. A stringifiable JSON is expected."),new Error}},JSON_CHARS=/^[{[]/,parseJson=e=>{if("string"==typeof e)try{return JSON.parse(e)}catch(t){if(JSON_CHARS.test(e))try{return JSON.parse(e.replace(/'/g,'"'))}catch(t){Log.warn(["parseJson",e]),Log.error("↑ The JSON string could not be parsed. Make sure that single quotes in the text are escaped (&#8216;).")}}throw new Error},mapBoolean2String=e=>"boolean"==typeof e?!0===e?"true":"false":void 0,mapStringOrBoolean2String=e=>"string"==typeof e?e:mapBoolean2String(e),koliBriQuerySelector=(e,t)=>querySelector(e,t||getDocument()),koliBriQuerySelectorAll=(e,t)=>querySelectorAll(e,t||getDocument());let DEFAULT_COLOR_CONTRAST=null;const getDefaultColorContrast=()=>(DEFAULT_COLOR_CONTRAST=DEFAULT_COLOR_CONTRAST||{backgroundColor:"#00000000",color:"#00000000",domNode:getDocument().body,level:"Fail",score:1},DEFAULT_COLOR_CONTRAST),TRANSPARENT_REGEXP=/(\d+, ){3}0\)/,koliBriA11yColorContrast=(e,t=getDefaultColorContrast())=>{const o=getComputedStyle(e),n=TRANSPARENT_REGEXP.test(o.backgroundColor)?t.backgroundColor:rgba$1.hex(o.backgroundColor),r=TRANSPARENT_REGEXP.test(o.color)?t.color:rgba$1.hex(o.color),a=s(n,r),i={backgroundColor:n,color:r,domNode:e,level:f(a),score:a};return a<4.5&&Log.error(["Color-Contrast-Error",{backgroundColor:i.backgroundColor,color:i.color,level:i.level,score:i.score},i.domNode]),i},koliBriQuerySelectorColors=(e,t=getDefaultColorContrast())=>{t.domNode instanceof HTMLElement&&(t=koliBriA11yColorContrast(t.domNode,t));const o=t.domNode.querySelector(e);if(null===o){const o=t.domNode.querySelectorAll('[class="hydrated"]');for(let n=0;n<o.length&&(t.domNode=o[n],null===(t=koliBriQuerySelectorColors(e,t)).domNode);n++);return t}return koliBriA11yColorContrast(o,t)};class KoliBriUtils{static queryHtmlElementColors(e,t,o=!1,n=!0){let r=null;if(!0===o||!1===KoliBriUtils.executionLock)if(!1===o&&(KoliBriUtils.cache.clear(),KoliBriUtils.cache.set(t.domNode,t),KoliBriUtils.executionLock=!0,!0===n&&Log.debug("[KoliBriUtils] Color contrast analysis started...")),e===t.domNode)r=t;else{const o=new Set;if(t.domNode.shadowRoot){const e=t.domNode.shadowRoot.children;for(let t=0;t<e.length;t++)o.add(e[t])}const n=t.domNode;if("function"==typeof n.assignedNodes){const e=n.assignedNodes();for(let t=0;t<e.length;t++)e[t]instanceof HTMLElement&&o.add(e[t])}const a=t.domNode.children;for(let e=0;e<a.length;e++)o.add(a[e]);const i=Array.from(o);for(let o=0;o<i.length;o++){let n=KoliBriUtils.cache.get(i[o]);void 0===n&&(n=koliBriA11yColorContrast(i[o],t)),KoliBriUtils.cache.set(i[o],n);const a=KoliBriUtils.queryHtmlElementColors(e,n,!0,!1);if(null!==a){r=a;break}}}else Log.debug("[KoliBriUtils] Call aborted because a color contrast analysis is currently being executed.");return!1===o&&(!0===n&&Log.debug(`[KoliBriUtils] Color contrast analysis finished (${KoliBriUtils.cache.size} DOM elements are analysed).`),KoliBriUtils.executionLock=!1,KoliBriUtils.cache.clear()),r}}KoliBriUtils.executionLock=!1,KoliBriUtils.cache=new Map;class KoliBriDevHelper{}KoliBriDevHelper.getCssStyle=y,KoliBriDevHelper.patchTheme=k,KoliBriDevHelper.patchThemeTag=Y,KoliBriDevHelper.querySelector=koliBriQuerySelector,KoliBriDevHelper.querySelectorAll=koliBriQuerySelectorAll,KoliBriDevHelper.stringifyJson=stringifyJson;let processEnv="development";try{processEnv="production"}catch(e){processEnv="production"}const showExpertSlot=e=>""===e,buildBadgeTextString=(e,t)=>e||t||"",isObject=e=>"object"==typeof e&&null!==e,isString=(e,t=0)=>"string"==typeof e&&e.length>=t,isStyle=e=>{if("object"!=typeof e||null===e)return isString(e,1);for(const t in e)if(!1===isString(t,1))return!1;return!0},STATE_CHANGE_EVENT=new Event("StateChange");var KoliBriProgressVariantEnum;!function(e){e.bar="bar",e.cycle="cycle"}(KoliBriProgressVariantEnum||(KoliBriProgressVariantEnum={}));const KoliBri=new ie("kol",KeyEnum,TagEnum);export{watchString as A,buildBadgeTextString as B,C,devHint as D,watchNumber as E,getExperimentalMode as F,devWarning as G,deprecatedHint as H,setEventTarget as I,KoliBriProgressVariantEnum as J,KoliBri as K,Log as L,emptyStringByArrayHandler as M,koliBriQuerySelector as N,mapBoolean2String as O,mapStringOrBoolean2String as P,getDevMode as Q,getColorContrastAnalysis as R,STATE_CHANGE_EVENT as S,koliBriA11yColorContrast as T,koliBriQuerySelectorAll as U,V,koliBriQuerySelectorColors as W,KoliBriUtils as X,stringifyJson as Y,KoliBriDevHelper as a,a11yHint as b,setExperimentalMode as c,setColorContrastAnalysis as d,getWindow as e,featureHint as f,getDocument as g,watchBoolean as h,a11yHintDisabled as i,parseJson as j,setState as k,showExpertSlot as l,s as m,ne as n,objectObjectHandler as o,processEnv as p,isString as q,rgba$1 as r,setDevMode as s,isStyle as t,uiUxHint as u,isObject as v,watchValidator as w,a11yHintLabelingLandmarks as x,watchJsonArrayString as y,uiUxHintMillerscheZahl as z};