@aarhus-university/au-designsystem-delphinus 1.7.0 → 1.7.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,4 +1,13 @@
1
- ## 1.6.0 - 1.7.0 (May 23, 2024)
1
+ ## 1.7.1 - 1.7.2 (June 6, 2024)
2
+ ### Delphinus Projects Updates
3
+ * Minor fix for width of sound clips in Omnibus articles
4
+ * Typescript functionality for english search in Omnibus
5
+
6
+ ## 1.7.0 (May 23, 2024)
7
+ ### Delphinus Projects Updates
8
+ * Omnibus hotfixes for launch
9
+
10
+ ## 1.6.0 (May 21, 2024)
2
11
  ### Delphinus Projects Updates
3
12
  * Omnibus hotfixes for launch
4
13
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aarhus-university/au-designsystem-delphinus",
3
- "version": "1.7.0",
3
+ "version": "1.7.2",
4
4
  "private": false,
5
5
  "scripts": {
6
6
  "start": "concurrently \"npm run nodemon\" \"npm run sass\" \"npm run build\"",
@@ -1,4 +1,4 @@
1
- (()=>{var X=e=>{document.readyState!=="loading"?e():document.addEventListener("DOMContentLoaded",e)},O=X;var L=e=>{navigator.clipboard.writeText(e).then(()=>console.log(`${e} written to clipboard`))},R=(e,t)=>{let o=!1;return e.composedPath().forEach(r=>{r.classList&&r.classList.contains(t)&&(o=!0)}),o},D=()=>{let e=document.querySelector("body");if(e){let t=window.getComputedStyle(e).getPropertyValue("--color-background"),o=document.querySelector('meta[name="theme-color"]');if(o)o.content=t;else{let s=document.createElement("meta");s.name="theme-color",s.content=t,document.getElementsByTagName("head")[0].appendChild(s)}}},W=()=>parseInt(window.getComputedStyle(document.documentElement).fontSize.replace("px",""),10),Y=e=>e*16,_=e=>{let t=Math.max(document.documentElement.clientWidth||0,window.innerWidth||0),o=Y(parseInt(getComputedStyle(document.documentElement).getPropertyValue(e).replace("rem",""),10));return t<o};var J=e=>e.offsetWidth!==e.scrollWidth;var w=e=>{e.classList.contains("horizontal-scroll--no-overflow")&&e.classList.remove("horizontal-scroll--no-overflow");let t=e.querySelector(".horizontal-scroll--check-overflow .tabbed-content__section:not([hidden]) .horizontal-scroll__scrollable-content");t===null&&!t&&(t=e.querySelector(".horizontal-scroll--check-overflow .horizontal-scroll__scrollable-content")),t&&(J(t)?t?.setAttribute("tabindex","0"):(e.classList.add("horizontal-scroll--no-overflow"),t?.removeAttribute("tabindex")))};var P=e=>{let t=e.parentElement;return t?t.classList.contains("nav")?t:P(t):e},B=(e,t=null)=>{let o="nav--toggled";e.forEach(s=>{let r=s.querySelector(".nav__toggle");s!==t&&(s.classList.contains(o)&&(r.focus(),r.setAttribute("aria-expanded","false")),s.classList.remove(o))})},U=e=>{let t=r=>{let l=P(r),a=l.querySelector(".nav__items"),h=a?.querySelector(".nav__item:last-of-type");a?.classList.add("nav__items--fadeout");let b=a?.querySelector(".nav__item--is-overflown");b&&b.focus();let m=()=>{l.classList.toggle("nav--toggled"),a?.classList.remove("nav__items--fadeout"),h?.removeEventListener("transitionend",m)};return h?.addEventListener("transitionend",m),l},o=[];return document.querySelectorAll(".nav__toggle").forEach(r=>{let l=()=>{let a=t(r),h=r.getAttribute("aria-expanded");r.setAttribute("aria-expanded",h==="false"?"true":"false"),B(e,a)};o.push({element:r,clickEvent:l}),r.addEventListener("click",l)}),o},M=(e,t)=>{let o="nav--toggled",s="nav__items";t.classList.remove(o);let r=t.querySelector(`.${s}`);if(r){let a=r.querySelectorAll(".nav__item"),h="nav__item--is-overflown",b="nav--has-overflow",m="nav__item--active",i=!1;for(let n=a.length-1;n>=0;n-=1){let c=a[n];c.offsetTop>0?(c.classList.add(h),t.classList.add(b),i=!0):c.classList.contains(m)||c.classList.remove(h)}if(!i){t.classList.remove(b);let n=t.querySelector(`.${m}`);n&&n.classList.remove(h)}}let l=a=>{!a.target.classList.contains("nav__toggle")&&!R(a,s)&&B(e)};return document.querySelector("body")?.addEventListener("click",l),{element:document.querySelector("body"),clickEvent:l}};var z=(e,t,o,s,r)=>{if(s&&o){L(s.innerText),t.classList.add("copy-to-clipboard--confirm"),t===o&&t.classList.add("copy-to-clipboard--done");let l=document.createElement("span");l.classList.add("copy-to-clipboard__this__confirm-message"),l.innerText=e,s.appendChild(l),o.removeEventListener("click",r),setTimeout(()=>{t.classList.remove("copy-to-clipboard--confirm"),l.remove(),o.addEventListener("click",r)},1200)}},V=(e,t="Kopieret!")=>{let o=e.querySelector(".copy-to-clipboard__this");if(e.type==="button"){let s=()=>{z(t,e,e,o,s)};e.addEventListener("click",s)}else{let s=e.querySelector(".copy-to-clipboard__execute"),r=()=>{z(t,e,s,o,r)};s?.addEventListener("click",r)}};var Z=()=>{let e=document.querySelectorAll(".copy-to-clipboard"),t=document.querySelectorAll(".copy-to-clipboard__color");e.forEach(o=>{o.addEventListener("click",()=>{let s=o.parentElement?.querySelector(".copy-to-clipboard__color");if(s){let r=getComputedStyle(s).getPropertyValue("background-color"),l=ee(r);console.log(l),L(l.replace(/"/g,""))}})})};function ee(e){var t=e.match(/\d+/g),o="#"+t.map(function(s){var r=parseInt(s).toString(16);return r.length===1?"0"+r:r}).join("");return o}var $=Z;var te=e=>e.contains("tabbed-content--hide-tabs-on-medium-width")?parseInt(getComputedStyle(document.documentElement).getPropertyValue("--bp-medium").replace("rem",""),10):e.contains("tabbed-content--hide-tabs-on-wide-width")?parseInt(getComputedStyle(document.documentElement).getPropertyValue("--bp-wide").replace("rem",""),10):-1,ne=e=>{let o=Math.max(document.documentElement.clientWidth||0,window.innerWidth||0)/W(),s=te(e);return s>-1?o<s:!0},oe=e=>{let o=e.querySelector(".nav__items")?.querySelectorAll("a"),s=[];e.querySelectorAll("section").forEach(l=>{l.parentNode===e&&s.push(l)}),o?.forEach(l=>{l.removeAttribute("aria-selected"),l.classList.remove("nav__item--active")}),s.forEach(l=>{l.hidden=!1,l.removeAttribute("role")})};var S=(e,t,o,s,r,l=!0,a=h=>console.log(h))=>{l&&s.focus(),s.removeAttribute("tabindex"),s.setAttribute("aria-selected","true"),s.classList.contains("switch__segment")?s.classList.add("switch__segment--active"):s.classList.add("nav__item--active"),o&&(o.removeAttribute("aria-selected"),o.setAttribute("tabindex","-1"),o.classList.contains("switch__segment")?o.classList.remove("switch__segment--active"):o.classList.remove("nav__item--active"));let h=Array.prototype.indexOf.call(e,s);if(Array.from(document.querySelectorAll(`[data-for="${t[h].id}"]`)).forEach(m=>{m.classList.add("tabbed-content-peripheral--active"),m.hidden=!1}),t[h].hidden=!1,o){let m=Array.prototype.indexOf.call(e,o);Array.from(document.querySelectorAll(`[data-for="${t[m].id}"]`)).forEach(n=>{n.classList.remove("tabbed-content-peripheral--active"),n.hidden=!0}),t[m].hidden=!0}s.dispatchEvent(new CustomEvent("switch-tab",{bubbles:!0,detail:{tab:h}})),a(h)},se=(e,t,o=0,s=!0,r=l=>console.log(l))=>{let l=t.querySelector(".switch,.nav__items"),a=l.querySelectorAll("a"),h=[];t.querySelectorAll("section").forEach(i=>{i.parentNode===t&&h.push(i)});let m=t.querySelector("button.tabbed-content__expand-all");if(m){let i=()=>{l.hidden=!0,h.forEach(n=>{n.hidden=!1})};m.removeEventListener("click",i),m.addEventListener("click",i)}l.setAttribute("role","tablist"),a.forEach((i,n)=>{i.setAttribute("role","tab"),i.setAttribute("id",`tab${e}_${n+1}`),i.setAttribute("tabindex","-1"),i.parentElement?.setAttribute("role","presentation");let c=f=>{f.preventDefault();let u=l.querySelector("[aria-selected]");f.currentTarget!==u&&S(a,h,u,f.currentTarget,t.classList,!0,v=>{r(v)})};i.removeEventListener("click",c),i.addEventListener("click",c);let d=f=>{let u=Array.prototype.indexOf.call(a,f.currentTarget),v=null;f.key==="ArrowLeft"&&(v=u-1),f.key==="ArrowRight"&&(v=u+1),f.key==="ArrowDown"&&(v="down"),v!==null&&(f.preventDefault(),v==="down"?h[n].focus():a[v]&&S(a,h,f.currentTarget,a[v],t.classList,!0,E=>{r(E)}))};i.removeEventListener("keydown",d),i.addEventListener("keydown",d)}),h.forEach((i,n)=>{i.setAttribute("tabindex","-1"),i.setAttribute("aria-labelledby",a[n].id),i.hidden=!0,i.setAttribute("role","tabpanel")}),o>-1&&S(a,h,null,a[o],t.classList,s)},x=e=>{e.forEach((t,o)=>{let{rendered:s,domElement:r}=t;if(ne(r.classList)){if(!s){let l=r.getAttribute("data-focus-onload"),a=r.getAttribute("data-initial-tab"),h=a?parseInt(a,10):0;se(o,r,h,l!=="false"),t.rendered=!0}}else s&&(oe(r),t.rendered=!1)})};var F=(e,t,o,s)=>{let r=[],l=(i,n,c)=>{c&&n.focus();let d=()=>{e.setAttribute("hidden","hidden"),i.removeAttribute("hidden"),i.setAttribute("aria-expanded","false"),i.focus()};return n.addEventListener("click",d),d},a=e?.parentElement?.querySelector(".content-toggle__toggle"),h=e.querySelectorAll(".content-toggle__close"),b=()=>{_("--bp-medium")&&e.classList.contains("content-toggle__content--always-show-on-medium")||_("--bp-wide")&&e.classList.contains("content-toggle__content--always-show-on-wide")||_("--bp-max-width")&&e.classList.contains("content-toggle__content--always-show-on-max-width")?(a.removeAttribute("hidden"),e.setAttribute("hidden","hidden")):e.classList.contains("content-toggle__content--always-show-on-medium")||e.classList.contains("content-toggle__content--always-show-on-wide")||e.classList.contains("content-toggle__content--always-show-on-max-width")};if(window.addEventListener("resize",()=>{b()}),(()=>{document.addEventListener("click",i=>{let n=i.target,c=!n.classList.contains("content-toggle__content"),d=!n.classList.contains("content-toggle__toggle"),f=!n.classList.contains("profile-header__info__contact__toggle__button");c&&d&&f&&(!_("--bp-medium")&&e.classList.contains("content-toggle__content--is-popover--on-medium")||!_("--bp-wide")&&e.classList.contains("content-toggle__content--is-popover--on-wide")||!_("--bp-max-width")&&e.classList.contains("content-toggle__content--is-popover--on-max-width")||e.classList.contains("content-toggle__content--is-popover"))&&(a.removeAttribute("hidden"),e.setAttribute("hidden","hidden"),a.setAttribute("aria-expanded","false"),a.focus())})})(),b(),a){let i=()=>{let n=a.getAttribute("aria-expanded");typeof o=="function"&&n==="false"&&o(e,a),a.setAttribute("aria-expanded",n==="false"?"true":"false"),n==="true"?e.setAttribute("hidden","hidden"):e.removeAttribute("hidden"),typeof t=="function"&&t(e,a),a.hasAttribute("aria-haspopup")&&(a.setAttribute("hidden","hidden"),h.forEach(c=>{l(a,c,!0)})),typeof s=="function"&&s(e,a)};a.addEventListener("click",i),r.push({element:a,clickEvent:i}),h.forEach(n=>{let c=l(a,n,!1);r.push({element:n,clickEvent:c})})}return r};var j=e=>{e&&e.forEach(t=>{let o=t?.parentElement?.parentElement?.parentElement?.parentElement;if(o){let s=o.querySelectorAll(".horizontal-scroll__scrollable-content"),r=o.querySelectorAll(".switch__segment");s.forEach(l=>{l&&(t.addEventListener("click",()=>{let a=.8*l.clientWidth;l.scrollLeft+=a}),l.addEventListener("scroll",()=>{l.scrollLeft+l.clientWidth>=l.scrollWidth*.98?N(t):l.scrollLeft+l.clientWidth<l.scrollWidth&&I(t)}),r&&r.forEach(a=>{a.addEventListener("click",()=>{I(t),l.scrollLeft=0})}))})}})},K=e=>{e&&e.forEach(t=>{let o=t?.parentElement?.parentElement?.parentElement?.parentElement;if(o){let s=o.querySelectorAll(".horizontal-scroll__scrollable-content"),r=o.querySelectorAll(".switch__segment");s.forEach(l=>{l&&(t.addEventListener("click",()=>{let a=.8*l.clientWidth;l.scrollLeft-=a}),l.addEventListener("scroll",()=>{l.scrollLeft<=0?N(t):l.scrollLeft>0&&I(t)})),r&&r.forEach(a=>{a.addEventListener("click",()=>{N(t)})})})}})};function I(e){e.classList.remove("visually-disabled"),e.setAttribute("aria-disabled","false")}function N(e){e.classList.add("visually-disabled"),e.setAttribute("aria-disabled","true")}function H(e){e&&e.addEventListener("input",function(t){let o=e?.parentNode;o&&o.dataset&&(o.dataset.value=this.value)})}function G(e){let t=!0;e.addEventListener("click",function(o){t?(e.classList.add("dropdown-icon--active"),e.classList.remove("dropdown-icon--inactive"),t=!1):(e.classList.add("dropdown-icon--inactive"),e.classList.remove("dropdown-icon--active"),t=!0);let s=r=>{e.contains(r.target)||(e.classList.add("dropdown-icon--inactive"),e.classList.remove("dropdown-icon--active"),document.removeEventListener("click",s),t=!0)};document.addEventListener("click",s)})}var k=function(){function e(t,o){for(var s=0;s<o.length;s++){var r=o[s];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(t,o,s){return o&&e(t.prototype,o),s&&e(t,s),t}}();function q(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(function(){if(typeof window>"u")return;var e=Array.prototype.slice,t=Element.prototype.matches||Element.prototype.msMatchesSelector,o=["a[href]","area[href]","input:not([disabled])","select:not([disabled])","textarea:not([disabled])","button:not([disabled])","details","summary","iframe","object","embed","[contenteditable]"].join(","),s=function(){function m(i,n){q(this,m),this._inertManager=n,this._rootElement=i,this._managedNodes=new Set,this._rootElement.hasAttribute("aria-hidden")?this._savedAriaHidden=this._rootElement.getAttribute("aria-hidden"):this._savedAriaHidden=null,this._rootElement.setAttribute("aria-hidden","true"),this._makeSubtreeUnfocusable(this._rootElement),this._observer=new MutationObserver(this._onMutation.bind(this)),this._observer.observe(this._rootElement,{attributes:!0,childList:!0,subtree:!0})}return k(m,[{key:"destructor",value:function(){this._observer.disconnect(),this._rootElement&&(this._savedAriaHidden!==null?this._rootElement.setAttribute("aria-hidden",this._savedAriaHidden):this._rootElement.removeAttribute("aria-hidden")),this._managedNodes.forEach(function(n){this._unmanageNode(n.node)},this),this._observer=null,this._rootElement=null,this._managedNodes=null,this._inertManager=null}},{key:"_makeSubtreeUnfocusable",value:function(n){var c=this;a(n,function(v){return c._visitNode(v)});var d=document.activeElement;if(!document.body.contains(n)){for(var f=n,u=void 0;f;){if(f.nodeType===Node.DOCUMENT_FRAGMENT_NODE){u=f;break}f=f.parentNode}u&&(d=u.activeElement)}n.contains(d)&&(d.blur(),d===document.activeElement&&document.body.focus())}},{key:"_visitNode",value:function(n){if(n.nodeType===Node.ELEMENT_NODE){var c=n;c!==this._rootElement&&c.hasAttribute("inert")&&this._adoptInertRoot(c),(t.call(c,o)||c.hasAttribute("tabindex"))&&this._manageNode(c)}}},{key:"_manageNode",value:function(n){var c=this._inertManager.register(n,this);this._managedNodes.add(c)}},{key:"_unmanageNode",value:function(n){var c=this._inertManager.deregister(n,this);c&&this._managedNodes.delete(c)}},{key:"_unmanageSubtree",value:function(n){var c=this;a(n,function(d){return c._unmanageNode(d)})}},{key:"_adoptInertRoot",value:function(n){var c=this._inertManager.getInertRoot(n);c||(this._inertManager.setInert(n,!0),c=this._inertManager.getInertRoot(n)),c.managedNodes.forEach(function(d){this._manageNode(d.node)},this)}},{key:"_onMutation",value:function(n,c){n.forEach(function(d){var f=d.target;if(d.type==="childList")e.call(d.addedNodes).forEach(function(v){this._makeSubtreeUnfocusable(v)},this),e.call(d.removedNodes).forEach(function(v){this._unmanageSubtree(v)},this);else if(d.type==="attributes"){if(d.attributeName==="tabindex")this._manageNode(f);else if(f!==this._rootElement&&d.attributeName==="inert"&&f.hasAttribute("inert")){this._adoptInertRoot(f);var u=this._inertManager.getInertRoot(f);this._managedNodes.forEach(function(v){f.contains(v.node)&&u._manageNode(v.node)})}}},this)}},{key:"managedNodes",get:function(){return new Set(this._managedNodes)}},{key:"hasSavedAriaHidden",get:function(){return this._savedAriaHidden!==null}},{key:"savedAriaHidden",set:function(n){this._savedAriaHidden=n},get:function(){return this._savedAriaHidden}}]),m}(),r=function(){function m(i,n){q(this,m),this._node=i,this._overrodeFocusMethod=!1,this._inertRoots=new Set([n]),this._savedTabIndex=null,this._destroyed=!1,this.ensureUntabbable()}return k(m,[{key:"destructor",value:function(){if(this._throwIfDestroyed(),this._node&&this._node.nodeType===Node.ELEMENT_NODE){var n=this._node;this._savedTabIndex!==null?n.setAttribute("tabindex",this._savedTabIndex):n.removeAttribute("tabindex"),this._overrodeFocusMethod&&delete n.focus}this._node=null,this._inertRoots=null,this._destroyed=!0}},{key:"_throwIfDestroyed",value:function(){if(this.destroyed)throw new Error("Trying to access destroyed InertNode")}},{key:"ensureUntabbable",value:function(){if(this.node.nodeType===Node.ELEMENT_NODE){var n=this.node;if(t.call(n,o)){if(n.tabIndex===-1&&this.hasSavedTabIndex)return;n.hasAttribute("tabindex")&&(this._savedTabIndex=n.tabIndex),n.setAttribute("tabindex","-1"),n.nodeType===Node.ELEMENT_NODE&&(n.focus=function(){},this._overrodeFocusMethod=!0)}else n.hasAttribute("tabindex")&&(this._savedTabIndex=n.tabIndex,n.removeAttribute("tabindex"))}}},{key:"addInertRoot",value:function(n){this._throwIfDestroyed(),this._inertRoots.add(n)}},{key:"removeInertRoot",value:function(n){this._throwIfDestroyed(),this._inertRoots.delete(n),this._inertRoots.size===0&&this.destructor()}},{key:"destroyed",get:function(){return this._destroyed}},{key:"hasSavedTabIndex",get:function(){return this._savedTabIndex!==null}},{key:"node",get:function(){return this._throwIfDestroyed(),this._node}},{key:"savedTabIndex",set:function(n){this._throwIfDestroyed(),this._savedTabIndex=n},get:function(){return this._throwIfDestroyed(),this._savedTabIndex}}]),m}(),l=function(){function m(i){if(q(this,m),!i)throw new Error("Missing required argument; InertManager needs to wrap a document.");this._document=i,this._managedNodes=new Map,this._inertRoots=new Map,this._observer=new MutationObserver(this._watchForInert.bind(this)),h(i.head||i.body||i.documentElement),i.readyState==="loading"?i.addEventListener("DOMContentLoaded",this._onDocumentLoaded.bind(this)):this._onDocumentLoaded()}return k(m,[{key:"setInert",value:function(n,c){if(c){if(this._inertRoots.has(n))return;var d=new s(n,this);if(n.setAttribute("inert",""),this._inertRoots.set(n,d),!this._document.body.contains(n))for(var f=n.parentNode;f;)f.nodeType===11&&h(f),f=f.parentNode}else{if(!this._inertRoots.has(n))return;var u=this._inertRoots.get(n);u.destructor(),this._inertRoots.delete(n),n.removeAttribute("inert")}}},{key:"getInertRoot",value:function(n){return this._inertRoots.get(n)}},{key:"register",value:function(n,c){var d=this._managedNodes.get(n);return d!==void 0?d.addInertRoot(c):d=new r(n,c),this._managedNodes.set(n,d),d}},{key:"deregister",value:function(n,c){var d=this._managedNodes.get(n);return d?(d.removeInertRoot(c),d.destroyed&&this._managedNodes.delete(n),d):null}},{key:"_onDocumentLoaded",value:function(){var n=e.call(this._document.querySelectorAll("[inert]"));n.forEach(function(c){this.setInert(c,!0)},this),this._observer.observe(this._document.body||this._document.documentElement,{attributes:!0,subtree:!0,childList:!0})}},{key:"_watchForInert",value:function(n,c){var d=this;n.forEach(function(f){switch(f.type){case"childList":e.call(f.addedNodes).forEach(function(E){if(E.nodeType===Node.ELEMENT_NODE){var g=e.call(E.querySelectorAll("[inert]"));t.call(E,"[inert]")&&g.unshift(E),g.forEach(function(p){this.setInert(p,!0)},d)}},d);break;case"attributes":if(f.attributeName!=="inert")return;var u=f.target,v=u.hasAttribute("inert");d.setInert(u,v);break}},this)}}]),m}();function a(m,i,n){if(m.nodeType==Node.ELEMENT_NODE){var c=m;i&&i(c);var d=c.shadowRoot;if(d){a(d,i,d);return}if(c.localName=="content"){for(var f=c,u=f.getDistributedNodes?f.getDistributedNodes():[],v=0;v<u.length;v++)a(u[v],i,n);return}if(c.localName=="slot"){for(var E=c,g=E.assignedNodes?E.assignedNodes({flatten:!0}):[],p=0;p<g.length;p++)a(g[p],i,n);return}}for(var y=m.firstChild;y!=null;)a(y,i,n),y=y.nextSibling}function h(m){if(!m.querySelector("style#inert-style, link#inert-style")){var i=document.createElement("style");i.setAttribute("id","inert-style"),i.textContent=`
1
+ (()=>{var Y=e=>{document.readyState!=="loading"?e():document.addEventListener("DOMContentLoaded",e)},O=Y;var w=e=>{navigator.clipboard.writeText(e).then(()=>console.log(`${e} written to clipboard`))},R=(e,t)=>{let o=!1;return e.composedPath().forEach(a=>{a.classList&&a.classList.contains(t)&&(o=!0)}),o},W=()=>{let e=document.querySelector("body");if(e){let t=window.getComputedStyle(e).getPropertyValue("--color-background"),o=document.querySelector('meta[name="theme-color"]');if(o)o.content=t;else{let s=document.createElement("meta");s.name="theme-color",s.content=t,document.getElementsByTagName("head")[0].appendChild(s)}}},D=()=>parseInt(window.getComputedStyle(document.documentElement).fontSize.replace("px",""),10),J=e=>e*16,L=e=>{let t=Math.max(document.documentElement.clientWidth||0,window.innerWidth||0),o=J(parseInt(getComputedStyle(document.documentElement).getPropertyValue(e).replace("rem",""),10));return t<o};var Z=e=>e.offsetWidth!==e.scrollWidth;var A=e=>{e.classList.contains("horizontal-scroll--no-overflow")&&e.classList.remove("horizontal-scroll--no-overflow");let t=e.querySelector(".horizontal-scroll--check-overflow .tabbed-content__section:not([hidden]) .horizontal-scroll__scrollable-content");t===null&&!t&&(t=e.querySelector(".horizontal-scroll--check-overflow .horizontal-scroll__scrollable-content")),t&&(Z(t)?t?.setAttribute("tabindex","0"):(e.classList.add("horizontal-scroll--no-overflow"),t?.removeAttribute("tabindex")))};var P=e=>{let t=e.parentElement;return t?t.classList.contains("nav")?t:P(t):e},U=(e,t=null)=>{let o="nav--toggled";e.forEach(s=>{let a=s.querySelector(".nav__toggle");s!==t&&(s.classList.contains(o)&&(a.focus(),a.setAttribute("aria-expanded","false")),s.classList.remove(o))})},B=e=>{let t=a=>{let l=P(a),r=l.querySelector(".nav__items"),h=r?.querySelector(".nav__item:last-of-type");r?.classList.add("nav__items--fadeout");let b=r?.querySelector(".nav__item--is-overflown");b&&b.focus();let m=()=>{l.classList.toggle("nav--toggled"),r?.classList.remove("nav__items--fadeout"),h?.removeEventListener("transitionend",m)};return h?.addEventListener("transitionend",m),l},o=[];return document.querySelectorAll(".nav__toggle").forEach(a=>{let l=()=>{let r=t(a),h=a.getAttribute("aria-expanded");a.setAttribute("aria-expanded",h==="false"?"true":"false"),U(e,r)};o.push({element:a,clickEvent:l}),a.addEventListener("click",l)}),o},S=(e,t)=>{let o="nav--toggled",s="nav__items";t.classList.remove(o);let a=t.querySelector(`.${s}`);if(a){let r=a.querySelectorAll(".nav__item"),h="nav__item--is-overflown",b="nav--has-overflow",m="nav__item--active",i=!1;for(let n=r.length-1;n>=0;n-=1){let c=r[n];c.offsetTop>0?(c.classList.add(h),t.classList.add(b),i=!0):c.classList.contains(m)||c.classList.remove(h)}if(!i){t.classList.remove(b);let n=t.querySelector(`.${m}`);n&&n.classList.remove(h)}}let l=r=>{!r.target.classList.contains("nav__toggle")&&!R(r,s)&&U(e)};return document.querySelector("body")?.addEventListener("click",l),{element:document.querySelector("body"),clickEvent:l}};var z=(e,t,o,s,a)=>{if(s&&o){w(s.innerText),t.classList.add("copy-to-clipboard--confirm"),t===o&&t.classList.add("copy-to-clipboard--done");let l=document.createElement("span");l.classList.add("copy-to-clipboard__this__confirm-message"),l.innerText=e,s.appendChild(l),o.removeEventListener("click",a),setTimeout(()=>{t.classList.remove("copy-to-clipboard--confirm"),l.remove(),o.addEventListener("click",a)},1200)}},F=(e,t="Kopieret!")=>{let o=e.querySelector(".copy-to-clipboard__this");if(e.type==="button"){let s=()=>{z(t,e,e,o,s)};e.addEventListener("click",s)}else{let s=e.querySelector(".copy-to-clipboard__execute"),a=()=>{z(t,e,s,o,a)};s?.addEventListener("click",a)}};var ee=()=>{let e=document.querySelectorAll(".copy-to-clipboard"),t=document.querySelectorAll(".copy-to-clipboard__color");e.forEach(o=>{o.addEventListener("click",()=>{let s=o.parentElement?.querySelector(".copy-to-clipboard__color");if(s){let a=getComputedStyle(s).getPropertyValue("background-color"),l=te(a);console.log(l),w(l.replace(/"/g,""))}})})};function te(e){var t=e.match(/\d+/g),o="#"+t.map(function(s){var a=parseInt(s).toString(16);return a.length===1?"0"+a:a}).join("");return o}var V=ee;var ne=e=>e.contains("tabbed-content--hide-tabs-on-medium-width")?parseInt(getComputedStyle(document.documentElement).getPropertyValue("--bp-medium").replace("rem",""),10):e.contains("tabbed-content--hide-tabs-on-wide-width")?parseInt(getComputedStyle(document.documentElement).getPropertyValue("--bp-wide").replace("rem",""),10):-1,oe=e=>{let o=Math.max(document.documentElement.clientWidth||0,window.innerWidth||0)/D(),s=ne(e);return s>-1?o<s:!0},ie=e=>{let o=e.querySelector(".nav__items")?.querySelectorAll("a"),s=[];e.querySelectorAll("section").forEach(l=>{l.parentNode===e&&s.push(l)}),o?.forEach(l=>{l.removeAttribute("aria-selected"),l.classList.remove("nav__item--active")}),s.forEach(l=>{l.hidden=!1,l.removeAttribute("role")})};var x=(e,t,o,s,a,l=!0,r=h=>console.log(h))=>{l&&s.focus(),s.removeAttribute("tabindex"),s.setAttribute("aria-selected","true"),s.classList.contains("switch__segment")?s.classList.add("switch__segment--active"):s.classList.add("nav__item--active"),o&&(o.removeAttribute("aria-selected"),o.setAttribute("tabindex","-1"),o.classList.contains("switch__segment")?o.classList.remove("switch__segment--active"):o.classList.remove("nav__item--active"));let h=Array.prototype.indexOf.call(e,s);if(Array.from(document.querySelectorAll(`[data-for="${t[h].id}"]`)).forEach(m=>{m.classList.add("tabbed-content-peripheral--active"),m.hidden=!1}),t[h].hidden=!1,o){let m=Array.prototype.indexOf.call(e,o);Array.from(document.querySelectorAll(`[data-for="${t[m].id}"]`)).forEach(n=>{n.classList.remove("tabbed-content-peripheral--active"),n.hidden=!0}),t[m].hidden=!0}s.dispatchEvent(new CustomEvent("switch-tab",{bubbles:!0,detail:{tab:h}})),r(h)},se=(e,t,o=0,s=!0,a=l=>console.log(l))=>{let l=t.querySelector(".switch,.nav__items"),r=l.querySelectorAll("a"),h=[];t.querySelectorAll("section").forEach(i=>{i.parentNode===t&&h.push(i)});let m=t.querySelector("button.tabbed-content__expand-all");if(m){let i=()=>{l.hidden=!0,h.forEach(n=>{n.hidden=!1})};m.removeEventListener("click",i),m.addEventListener("click",i)}l.setAttribute("role","tablist"),r.forEach((i,n)=>{i.setAttribute("role","tab"),i.setAttribute("id",`tab${e}_${n+1}`),i.setAttribute("tabindex","-1"),i.parentElement?.setAttribute("role","presentation");let c=f=>{f.preventDefault();let u=l.querySelector("[aria-selected]");f.currentTarget!==u&&x(r,h,u,f.currentTarget,t.classList,!0,v=>{a(v)})};i.removeEventListener("click",c),i.addEventListener("click",c);let d=f=>{let u=Array.prototype.indexOf.call(r,f.currentTarget),v=null;f.key==="ArrowLeft"&&(v=u-1),f.key==="ArrowRight"&&(v=u+1),f.key==="ArrowDown"&&(v="down"),v!==null&&(f.preventDefault(),v==="down"?h[n].focus():r[v]&&x(r,h,f.currentTarget,r[v],t.classList,!0,p=>{a(p)}))};i.removeEventListener("keydown",d),i.addEventListener("keydown",d)}),h.forEach((i,n)=>{i.setAttribute("tabindex","-1"),i.setAttribute("aria-labelledby",r[n].id),i.hidden=!0,i.setAttribute("role","tabpanel")}),o>-1&&x(r,h,null,r[o],t.classList,s)},I=e=>{e.forEach((t,o)=>{let{rendered:s,domElement:a}=t;if(oe(a.classList)){if(!s){let l=a.getAttribute("data-focus-onload"),r=a.getAttribute("data-initial-tab"),h=r?parseInt(r,10):0;se(o,a,h,l!=="false"),t.rendered=!0}}else s&&(ie(a),t.rendered=!1)})};var $=(e,t,o,s)=>{let a=[],l=(i,n,c)=>{c&&n.focus();let d=()=>{e.setAttribute("hidden","hidden"),i.removeAttribute("hidden"),i.setAttribute("aria-expanded","false"),i.focus()};return n.addEventListener("click",d),d},r=e?.parentElement?.querySelector(".content-toggle__toggle"),h=e.querySelectorAll(".content-toggle__close"),b=()=>{L("--bp-medium")&&e.classList.contains("content-toggle__content--always-show-on-medium")||L("--bp-wide")&&e.classList.contains("content-toggle__content--always-show-on-wide")||L("--bp-max-width")&&e.classList.contains("content-toggle__content--always-show-on-max-width")?(r.removeAttribute("hidden"),e.setAttribute("hidden","hidden")):e.classList.contains("content-toggle__content--always-show-on-medium")||e.classList.contains("content-toggle__content--always-show-on-wide")||e.classList.contains("content-toggle__content--always-show-on-max-width")};if(window.addEventListener("resize",()=>{b()}),(()=>{document.addEventListener("click",i=>{let n=i.target,c=!n.classList.contains("content-toggle__content"),d=!n.classList.contains("content-toggle__toggle"),f=!n.classList.contains("profile-header__info__contact__toggle__button");c&&d&&f&&(!L("--bp-medium")&&e.classList.contains("content-toggle__content--is-popover--on-medium")||!L("--bp-wide")&&e.classList.contains("content-toggle__content--is-popover--on-wide")||!L("--bp-max-width")&&e.classList.contains("content-toggle__content--is-popover--on-max-width")||e.classList.contains("content-toggle__content--is-popover"))&&(r.removeAttribute("hidden"),e.setAttribute("hidden","hidden"),r.setAttribute("aria-expanded","false"),r.focus())})})(),b(),r){let i=()=>{let n=r.getAttribute("aria-expanded");typeof o=="function"&&n==="false"&&o(e,r),r.setAttribute("aria-expanded",n==="false"?"true":"false"),n==="true"?e.setAttribute("hidden","hidden"):e.removeAttribute("hidden"),typeof t=="function"&&t(e,r),r.hasAttribute("aria-haspopup")&&(r.setAttribute("hidden","hidden"),h.forEach(c=>{l(r,c,!0)})),typeof s=="function"&&s(e,r)};r.addEventListener("click",i),a.push({element:r,clickEvent:i}),h.forEach(n=>{let c=l(r,n,!1);a.push({element:n,clickEvent:c})})}return a};var j=e=>{e&&e.forEach(t=>{let o=t?.parentElement?.parentElement?.parentElement?.parentElement;if(o){let s=o.querySelectorAll(".horizontal-scroll__scrollable-content"),a=o.querySelectorAll(".switch__segment");s.forEach(l=>{l&&(t.addEventListener("click",()=>{let r=.8*l.clientWidth;l.scrollLeft+=r}),l.addEventListener("scroll",()=>{l.scrollLeft+l.clientWidth>=l.scrollWidth*.98?H(t):l.scrollLeft+l.clientWidth<l.scrollWidth&&N(t)}),a&&a.forEach(r=>{r.addEventListener("click",()=>{N(t),l.scrollLeft=0})}))})}})},K=e=>{e&&e.forEach(t=>{let o=t?.parentElement?.parentElement?.parentElement?.parentElement;if(o){let s=o.querySelectorAll(".horizontal-scroll__scrollable-content"),a=o.querySelectorAll(".switch__segment");s.forEach(l=>{l&&(t.addEventListener("click",()=>{let r=.8*l.clientWidth;l.scrollLeft-=r}),l.addEventListener("scroll",()=>{l.scrollLeft<=0?H(t):l.scrollLeft>0&&N(t)})),a&&a.forEach(r=>{r.addEventListener("click",()=>{H(t)})})})}})};function N(e){e.classList.remove("visually-disabled"),e.setAttribute("aria-disabled","false")}function H(e){e.classList.add("visually-disabled"),e.setAttribute("aria-disabled","true")}function k(e){e&&e.addEventListener("input",function(t){let o=e?.parentNode;o&&o.dataset&&(o.dataset.value=this.value)})}function G(e){let t=!0;e.addEventListener("click",function(o){t?(e.classList.add("dropdown-icon--active"),e.classList.remove("dropdown-icon--inactive"),t=!1):(e.classList.add("dropdown-icon--inactive"),e.classList.remove("dropdown-icon--active"),t=!0);let s=a=>{e.contains(a.target)||(e.classList.add("dropdown-icon--inactive"),e.classList.remove("dropdown-icon--active"),document.removeEventListener("click",s),t=!0)};document.addEventListener("click",s)})}var q=function(){function e(t,o){for(var s=0;s<o.length;s++){var a=o[s];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(t,a.key,a)}}return function(t,o,s){return o&&e(t.prototype,o),s&&e(t,s),t}}();function C(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(function(){if(typeof window>"u")return;var e=Array.prototype.slice,t=Element.prototype.matches||Element.prototype.msMatchesSelector,o=["a[href]","area[href]","input:not([disabled])","select:not([disabled])","textarea:not([disabled])","button:not([disabled])","details","summary","iframe","object","embed","[contenteditable]"].join(","),s=function(){function m(i,n){C(this,m),this._inertManager=n,this._rootElement=i,this._managedNodes=new Set,this._rootElement.hasAttribute("aria-hidden")?this._savedAriaHidden=this._rootElement.getAttribute("aria-hidden"):this._savedAriaHidden=null,this._rootElement.setAttribute("aria-hidden","true"),this._makeSubtreeUnfocusable(this._rootElement),this._observer=new MutationObserver(this._onMutation.bind(this)),this._observer.observe(this._rootElement,{attributes:!0,childList:!0,subtree:!0})}return q(m,[{key:"destructor",value:function(){this._observer.disconnect(),this._rootElement&&(this._savedAriaHidden!==null?this._rootElement.setAttribute("aria-hidden",this._savedAriaHidden):this._rootElement.removeAttribute("aria-hidden")),this._managedNodes.forEach(function(n){this._unmanageNode(n.node)},this),this._observer=null,this._rootElement=null,this._managedNodes=null,this._inertManager=null}},{key:"_makeSubtreeUnfocusable",value:function(n){var c=this;r(n,function(v){return c._visitNode(v)});var d=document.activeElement;if(!document.body.contains(n)){for(var f=n,u=void 0;f;){if(f.nodeType===Node.DOCUMENT_FRAGMENT_NODE){u=f;break}f=f.parentNode}u&&(d=u.activeElement)}n.contains(d)&&(d.blur(),d===document.activeElement&&document.body.focus())}},{key:"_visitNode",value:function(n){if(n.nodeType===Node.ELEMENT_NODE){var c=n;c!==this._rootElement&&c.hasAttribute("inert")&&this._adoptInertRoot(c),(t.call(c,o)||c.hasAttribute("tabindex"))&&this._manageNode(c)}}},{key:"_manageNode",value:function(n){var c=this._inertManager.register(n,this);this._managedNodes.add(c)}},{key:"_unmanageNode",value:function(n){var c=this._inertManager.deregister(n,this);c&&this._managedNodes.delete(c)}},{key:"_unmanageSubtree",value:function(n){var c=this;r(n,function(d){return c._unmanageNode(d)})}},{key:"_adoptInertRoot",value:function(n){var c=this._inertManager.getInertRoot(n);c||(this._inertManager.setInert(n,!0),c=this._inertManager.getInertRoot(n)),c.managedNodes.forEach(function(d){this._manageNode(d.node)},this)}},{key:"_onMutation",value:function(n,c){n.forEach(function(d){var f=d.target;if(d.type==="childList")e.call(d.addedNodes).forEach(function(v){this._makeSubtreeUnfocusable(v)},this),e.call(d.removedNodes).forEach(function(v){this._unmanageSubtree(v)},this);else if(d.type==="attributes"){if(d.attributeName==="tabindex")this._manageNode(f);else if(f!==this._rootElement&&d.attributeName==="inert"&&f.hasAttribute("inert")){this._adoptInertRoot(f);var u=this._inertManager.getInertRoot(f);this._managedNodes.forEach(function(v){f.contains(v.node)&&u._manageNode(v.node)})}}},this)}},{key:"managedNodes",get:function(){return new Set(this._managedNodes)}},{key:"hasSavedAriaHidden",get:function(){return this._savedAriaHidden!==null}},{key:"savedAriaHidden",set:function(n){this._savedAriaHidden=n},get:function(){return this._savedAriaHidden}}]),m}(),a=function(){function m(i,n){C(this,m),this._node=i,this._overrodeFocusMethod=!1,this._inertRoots=new Set([n]),this._savedTabIndex=null,this._destroyed=!1,this.ensureUntabbable()}return q(m,[{key:"destructor",value:function(){if(this._throwIfDestroyed(),this._node&&this._node.nodeType===Node.ELEMENT_NODE){var n=this._node;this._savedTabIndex!==null?n.setAttribute("tabindex",this._savedTabIndex):n.removeAttribute("tabindex"),this._overrodeFocusMethod&&delete n.focus}this._node=null,this._inertRoots=null,this._destroyed=!0}},{key:"_throwIfDestroyed",value:function(){if(this.destroyed)throw new Error("Trying to access destroyed InertNode")}},{key:"ensureUntabbable",value:function(){if(this.node.nodeType===Node.ELEMENT_NODE){var n=this.node;if(t.call(n,o)){if(n.tabIndex===-1&&this.hasSavedTabIndex)return;n.hasAttribute("tabindex")&&(this._savedTabIndex=n.tabIndex),n.setAttribute("tabindex","-1"),n.nodeType===Node.ELEMENT_NODE&&(n.focus=function(){},this._overrodeFocusMethod=!0)}else n.hasAttribute("tabindex")&&(this._savedTabIndex=n.tabIndex,n.removeAttribute("tabindex"))}}},{key:"addInertRoot",value:function(n){this._throwIfDestroyed(),this._inertRoots.add(n)}},{key:"removeInertRoot",value:function(n){this._throwIfDestroyed(),this._inertRoots.delete(n),this._inertRoots.size===0&&this.destructor()}},{key:"destroyed",get:function(){return this._destroyed}},{key:"hasSavedTabIndex",get:function(){return this._savedTabIndex!==null}},{key:"node",get:function(){return this._throwIfDestroyed(),this._node}},{key:"savedTabIndex",set:function(n){this._throwIfDestroyed(),this._savedTabIndex=n},get:function(){return this._throwIfDestroyed(),this._savedTabIndex}}]),m}(),l=function(){function m(i){if(C(this,m),!i)throw new Error("Missing required argument; InertManager needs to wrap a document.");this._document=i,this._managedNodes=new Map,this._inertRoots=new Map,this._observer=new MutationObserver(this._watchForInert.bind(this)),h(i.head||i.body||i.documentElement),i.readyState==="loading"?i.addEventListener("DOMContentLoaded",this._onDocumentLoaded.bind(this)):this._onDocumentLoaded()}return q(m,[{key:"setInert",value:function(n,c){if(c){if(this._inertRoots.has(n))return;var d=new s(n,this);if(n.setAttribute("inert",""),this._inertRoots.set(n,d),!this._document.body.contains(n))for(var f=n.parentNode;f;)f.nodeType===11&&h(f),f=f.parentNode}else{if(!this._inertRoots.has(n))return;var u=this._inertRoots.get(n);u.destructor(),this._inertRoots.delete(n),n.removeAttribute("inert")}}},{key:"getInertRoot",value:function(n){return this._inertRoots.get(n)}},{key:"register",value:function(n,c){var d=this._managedNodes.get(n);return d!==void 0?d.addInertRoot(c):d=new a(n,c),this._managedNodes.set(n,d),d}},{key:"deregister",value:function(n,c){var d=this._managedNodes.get(n);return d?(d.removeInertRoot(c),d.destroyed&&this._managedNodes.delete(n),d):null}},{key:"_onDocumentLoaded",value:function(){var n=e.call(this._document.querySelectorAll("[inert]"));n.forEach(function(c){this.setInert(c,!0)},this),this._observer.observe(this._document.body||this._document.documentElement,{attributes:!0,subtree:!0,childList:!0})}},{key:"_watchForInert",value:function(n,c){var d=this;n.forEach(function(f){switch(f.type){case"childList":e.call(f.addedNodes).forEach(function(p){if(p.nodeType===Node.ELEMENT_NODE){var E=e.call(p.querySelectorAll("[inert]"));t.call(p,"[inert]")&&E.unshift(p),E.forEach(function(g){this.setInert(g,!0)},d)}},d);break;case"attributes":if(f.attributeName!=="inert")return;var u=f.target,v=u.hasAttribute("inert");d.setInert(u,v);break}},this)}}]),m}();function r(m,i,n){if(m.nodeType==Node.ELEMENT_NODE){var c=m;i&&i(c);var d=c.shadowRoot;if(d){r(d,i,d);return}if(c.localName=="content"){for(var f=c,u=f.getDistributedNodes?f.getDistributedNodes():[],v=0;v<u.length;v++)r(u[v],i,n);return}if(c.localName=="slot"){for(var p=c,E=p.assignedNodes?p.assignedNodes({flatten:!0}):[],g=0;g<E.length;g++)r(E[g],i,n);return}}for(var _=m.firstChild;_!=null;)r(_,i,n),_=_.nextSibling}function h(m){if(!m.querySelector("style#inert-style, link#inert-style")){var i=document.createElement("style");i.setAttribute("id","inert-style"),i.textContent=`
2
2
  [inert] {
3
3
  pointer-events: none;
4
4
  cursor: default;
@@ -10,5 +10,5 @@
10
10
  -ms-user-select: none;
11
11
  user-select: none;
12
12
  }
13
- `,m.appendChild(i)}}if(!HTMLElement.prototype.hasOwnProperty("inert")){var b=new l(document);Object.defineProperty(HTMLElement.prototype,"inert",{enumerable:!0,get:function(){return this.hasAttribute("inert")},set:function(i){b.setInert(this,i)}})}})();var A=(e,t,o=()=>{})=>{let s=document.getElementById(e);if(s){s.classList.remove("modal-view--visible"),s.inert=!0;let r=document.querySelector(".page");r&&(r.classList.remove("page--blur"),r.inert=!1),document.querySelector("body")?.classList.remove("body--no-scroll"),t.focus(),t.setAttribute("aria-expanded","false"),o()}},Q=(e,t,o=()=>{},s=!0)=>{let r=document.getElementById(e),l=[];if(r){r.classList.add("modal-view--visible"),r.inert=!1;let a=document.querySelector(".page");a&&(a.classList.add("page--blur"),a.inert=!0),document.querySelector("body")?.classList.add("body--no-scroll"),t.setAttribute("aria-expanded","true"),r.focus();let h=m=>{m.target===r&&A(e,t,o)},b=m=>{m.key==="Escape"&&A(e,t,o)};s&&(r.addEventListener("click",h),window.addEventListener("keyup",b),l.push({element:r,clickEvent:h}),l.push({element:window,keyUpEvent:b}))}return l};var T=0;O(()=>{let e=document.querySelectorAll(".tabbed-content"),t=[];e.forEach(u=>t.push({domElement:u,rendered:!1})),x(t),D();let o=document.querySelectorAll(".nav:not(.nav--vertical)");o.forEach(u=>M(o,u)),U(o);let s=document.getElementById("autoexpand");H(s),window.onload=function(){H(s)},document.querySelectorAll(".form__field select, .form__field__combo-box__field").forEach(u=>{G(u)}),document.querySelectorAll(".copy-to-clipboard").forEach(u=>V(u,document.querySelector("html")?.getAttribute("lang")==="en"?"Hexcode copied!":"Hexkode kopieret!")),$(),document.querySelectorAll(".content-toggle__content:not(.toolbar .content-toggle__content)").forEach(u=>{F(u)});let h=document.querySelectorAll(".button.button--small.button--icon.button--icon--hide-label.icon-next"),b=document.querySelectorAll(".button.button--small.button--icon.button--icon--hide-label.icon-previous");j(h),K(b),document.querySelectorAll(".horizontal-scroll").forEach(u=>{w(u),window.addEventListener("resize",()=>{w(u)})}),document.querySelectorAll(".switch__segment").forEach(u=>{u.addEventListener("click",()=>{document.querySelectorAll(".horizontal-scroll").forEach(E=>{w(E)})})}),window.addEventListener("load",()=>{T=window.innerWidth}),window.addEventListener("resize",()=>{T>0&&window.innerWidth!==T&&(T=window.innerWidth,o.forEach(u=>M(o,u)),x(t))}),document.querySelectorAll("[data-modal]").forEach(u=>{let v=u.getAttribute("data-modal");document.getElementById(v)?.querySelector(".modal-view__close")?.addEventListener("click",()=>{A(v,u)}),u.addEventListener("click",()=>{Q(v,u)})}),document.querySelectorAll(".nav__search").forEach(u=>{u.addEventListener("submit",v=>{v.preventDefault();let E=u.querySelector('input[type="search"]');if(E){let g=E.value,p=`./soegning#?cludoquery=${encodeURIComponent(g)}&cludoDomainName=https://omnibus.au.dk/&cludopage=1&cludorefurl=https%3A%2F%2Fomnibus.au.dk%2F&cludorefpt=Omnibus%20-%20Universitetsavisen%20p\xE5%20Aarhus%20Universitet&cludoinputtype=standard`;console.log(g),window.location.href=p}})});let d=document.querySelector(".omnibus-header__logo-titel"),f=document.querySelector("html")?.getAttribute("lang");d&&(f==="da"?d.setAttribute("src","/fileadmin/logos/Omnibus-logo.png"):d.setAttribute("src","/fileadmin/logos/Omnibus-logo-en.png"))});document.addEventListener("DOMContentLoaded",()=>{document.querySelectorAll(".news-story__normal").forEach(t=>{let o=t.querySelector(".news-story__image-container"),s=o?.querySelector("img.news-story__image");s instanceof HTMLImageElement&&C(o,s)})});function C(e,t){let o=e.offsetWidth,s=o*(2/3);t.style.width=o+"px",t.style.height=s+"px",t.style.objectFit="cover";let r=t.src,l=r.replace(".jpg","@2x.jpg").replace(".png","@2x.png");fetch(l,{method:"HEAD"}).then(a=>{a.ok?t.setAttribute("srcset",`${r} 1x, ${l} 2x`):t.setAttribute("srcset",`${r} 1x`)}).catch(()=>{t.setAttribute("srcset",`${r} 1x`)}),e.style.display="flex",e.style.justifyContent="center",e.style.alignItems="center"}window.addEventListener("resize",()=>{document.querySelectorAll(".news-story__normal").forEach(t=>{let o=t.querySelector(".news-story__image-container"),s=o?.querySelector("img.news-story__image");s instanceof HTMLImageElement&&C(o,s)})});document.addEventListener("DOMContentLoaded",()=>{document.querySelectorAll(".news-story__normal").forEach(t=>{let o=t.querySelector(".news-story__image-container"),s=o?.querySelector("img.news-story__image");s instanceof HTMLImageElement&&C(o,s)})});})();
13
+ `,m.appendChild(i)}}if(!HTMLElement.prototype.hasOwnProperty("inert")){var b=new l(document);Object.defineProperty(HTMLElement.prototype,"inert",{enumerable:!0,get:function(){return this.hasAttribute("inert")},set:function(i){b.setInert(this,i)}})}})();var T=(e,t,o=()=>{})=>{let s=document.getElementById(e);if(s){s.classList.remove("modal-view--visible"),s.inert=!0;let a=document.querySelector(".page");a&&(a.classList.remove("page--blur"),a.inert=!1),document.querySelector("body")?.classList.remove("body--no-scroll"),t.focus(),t.setAttribute("aria-expanded","false"),o()}},Q=(e,t,o=()=>{},s=!0)=>{let a=document.getElementById(e),l=[];if(a){a.classList.add("modal-view--visible"),a.inert=!1;let r=document.querySelector(".page");r&&(r.classList.add("page--blur"),r.inert=!0),document.querySelector("body")?.classList.add("body--no-scroll"),t.setAttribute("aria-expanded","true"),a.focus();let h=m=>{m.target===a&&T(e,t,o)},b=m=>{m.key==="Escape"&&T(e,t,o)};s&&(a.addEventListener("click",h),window.addEventListener("keyup",b),l.push({element:a,clickEvent:h}),l.push({element:window,keyUpEvent:b}))}return l};var M=0;O(()=>{let e=document.querySelectorAll(".tabbed-content"),t=[];e.forEach(u=>t.push({domElement:u,rendered:!1})),I(t),W();let o=document.querySelectorAll(".nav:not(.nav--vertical)");o.forEach(u=>S(o,u)),B(o);let s=document.getElementById("autoexpand");k(s),window.onload=function(){k(s)},document.querySelectorAll(".form__field select, .form__field__combo-box__field").forEach(u=>{G(u)}),document.querySelectorAll(".copy-to-clipboard").forEach(u=>F(u,document.querySelector("html")?.getAttribute("lang")==="en"?"Hexcode copied!":"Hexkode kopieret!")),V(),document.querySelectorAll(".content-toggle__content:not(.toolbar .content-toggle__content)").forEach(u=>{$(u)});let h=document.querySelectorAll(".button.button--small.button--icon.button--icon--hide-label.icon-next"),b=document.querySelectorAll(".button.button--small.button--icon.button--icon--hide-label.icon-previous");j(h),K(b),document.querySelectorAll(".horizontal-scroll").forEach(u=>{A(u),window.addEventListener("resize",()=>{A(u)})}),document.querySelectorAll(".switch__segment").forEach(u=>{u.addEventListener("click",()=>{document.querySelectorAll(".horizontal-scroll").forEach(p=>{A(p)})})}),window.addEventListener("load",()=>{M=window.innerWidth}),window.addEventListener("resize",()=>{M>0&&window.innerWidth!==M&&(M=window.innerWidth,o.forEach(u=>S(o,u)),I(t))}),document.querySelectorAll("[data-modal]").forEach(u=>{let v=u.getAttribute("data-modal");document.getElementById(v)?.querySelector(".modal-view__close")?.addEventListener("click",()=>{T(v,u)}),u.addEventListener("click",()=>{Q(v,u)})}),document.querySelectorAll(".nav__search").forEach(u=>{u.addEventListener("submit",v=>{v.preventDefault();let p=u.querySelector('input[type="search"]');if(p){let E=p.value,g=document.documentElement.lang,_;g==="da"&&(_=`./soegning#?cludoquery=${encodeURIComponent(E)}&cludoDomainName=https://omnibus.au.dk/&cludopage=1&cludorefurl=https%3A%2F%2Fomnibus.au.dk%2F&cludorefpt=Omnibus%20-%20Universitetsavisen%20p\xE5%20Aarhus%20Universitet&cludoinputtype=standard`),g==="en"&&(_=`./en/search#?cludoquery=${encodeURIComponent(E)}&cludopage=1&cludorefurl=https%3A%2F%2Fomnibus.au.dk%2F&cludorefpt=Omnibus%20-%20Universitetsavisen%20p\xE5%20Aarhus%20Universitet&cludoinputtype=standard`),window.location.href=_}})});let d=document.querySelector(".omnibus-header__logo-titel"),f=document.querySelector("html")?.getAttribute("lang");d&&(f==="da"?(d.setAttribute("src","/fileadmin/logos/Omnibus-logo.png"),y):d.setAttribute("src","/fileadmin/logos/Omnibus-logo-en.png"))});function X(e,t){let o=e.offsetWidth,s=o*(2/3);t.style.width=o+"px",t.style.height=s+"px",t.style.objectFit="cover",e.style.display="flex",e.style.justifyContent="center",e.style.alignItems="center"}window.addEventListener("resize",()=>{document.querySelectorAll(".news-story__normal").forEach(t=>{let o=t.querySelector(".news-story__image-container"),s=o?.querySelector("img.news-story__image");s instanceof HTMLImageElement&&X(o,s)})});document.addEventListener("DOMContentLoaded",()=>{document.querySelectorAll(".news-story__normal").forEach(t=>{let o=t.querySelector(".news-story__image-container"),s=o?.querySelector("img.news-story__image");s instanceof HTMLImageElement&&X(o,s)})});})();
14
14
  //# sourceMappingURL=app.js.map