@aarhus-university/au-designsystem-delphinus 1.6.0 → 1.6.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/package.json
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
(()=>{var Q=e=>{document.readyState!=="loading"?e():document.addEventListener("DOMContentLoaded",e)},q=Q;var L=e=>{navigator.clipboard.writeText(e).then(()=>console.log(`${e} written to clipboard`))},O=(e,n)=>{let o=!1;return e.composedPath().forEach(r=>{r.classList&&r.classList.contains(n)&&(o=!0)}),o},R=()=>{let e=document.querySelector("body");if(e){let n=window.getComputedStyle(e).getPropertyValue("--color-background"),o=document.querySelector('meta[name="theme-color"]');if(o)o.content=n;else{let i=document.createElement("meta");i.name="theme-color",i.content=n,document.getElementsByTagName("head")[0].appendChild(i)}}},W=()=>parseInt(window.getComputedStyle(document.documentElement).fontSize.replace("px",""),10),X=e=>e*16,_=e=>{let n=Math.max(document.documentElement.clientWidth||0,window.innerWidth||0),o=X(parseInt(getComputedStyle(document.documentElement).getPropertyValue(e).replace("rem",""),10));return n<o};var Y=e=>e.offsetWidth!==e.scrollWidth;var w=e=>{e.classList.contains("horizontal-scroll--no-overflow")&&e.classList.remove("horizontal-scroll--no-overflow");let n=e.querySelector(".horizontal-scroll--check-overflow .tabbed-content__section:not([hidden]) .horizontal-scroll__scrollable-content");n===null&&!n&&(n=e.querySelector(".horizontal-scroll--check-overflow .horizontal-scroll__scrollable-content")),n&&(Y(n)?n?.setAttribute("tabindex","0"):(e.classList.add("horizontal-scroll--no-overflow"),n?.removeAttribute("tabindex")))};var z=e=>{let n=e.parentElement;return n?n.classList.contains("nav")?n:z(n):e},P=(e,n=null)=>{let o="nav--toggled";e.forEach(i=>{let r=i.querySelector(".nav__toggle");i!==n&&(i.classList.contains(o)&&(r.focus(),r.setAttribute("aria-expanded","false")),i.classList.remove(o))})},B=e=>{let n=r=>{let l=z(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=n(r),h=r.getAttribute("aria-expanded");r.setAttribute("aria-expanded",h==="false"?"true":"false"),P(e,a)};o.push({element:r,clickEvent:l}),r.addEventListener("click",l)}),o},M=(e,n)=>{let o="nav--toggled",i="nav__items";n.classList.remove(o);let r=n.querySelector(`.${i}`);if(r){let a=r.querySelectorAll(".nav__item"),h="nav__item--is-overflown",b="nav--has-overflow",m="nav__item--active",s=!1;for(let t=a.length-1;t>=0;t-=1){let c=a[t];c.offsetTop>0?(c.classList.add(h),n.classList.add(b),s=!0):c.classList.contains(m)||c.classList.remove(h)}if(!s){n.classList.remove(b);let t=n.querySelector(`.${m}`);t&&t.classList.remove(h)}}let l=a=>{!a.target.classList.contains("nav__toggle")&&!O(a,i)&&P(e)};return document.querySelector("body")?.addEventListener("click",l),{element:document.querySelector("body"),clickEvent:l}};var D=(e,n,o,i,r)=>{if(i&&o){L(i.innerText),n.classList.add("copy-to-clipboard--confirm"),n===o&&n.classList.add("copy-to-clipboard--done");let l=document.createElement("span");l.classList.add("copy-to-clipboard__this__confirm-message"),l.innerText=e,i.appendChild(l),o.removeEventListener("click",r),setTimeout(()=>{n.classList.remove("copy-to-clipboard--confirm"),l.remove(),o.addEventListener("click",r)},1200)}},U=(e,n="Kopieret!")=>{let o=e.querySelector(".copy-to-clipboard__this");if(e.type==="button"){let i=()=>{D(n,e,e,o,i)};e.addEventListener("click",i)}else{let i=e.querySelector(".copy-to-clipboard__execute"),r=()=>{D(n,e,i,o,r)};i?.addEventListener("click",r)}};var J=()=>{let e=document.querySelectorAll(".copy-to-clipboard"),n=document.querySelectorAll(".copy-to-clipboard__color");e.forEach(o=>{o.addEventListener("click",()=>{let i=o.parentElement?.querySelector(".copy-to-clipboard__color");if(i){let r=getComputedStyle(i).getPropertyValue("background-color"),l=Z(r);console.log(l),L(l.replace(/"/g,""))}})})};function Z(e){var n=e.match(/\d+/g),o="#"+n.map(function(i){var r=parseInt(i).toString(16);return r.length===1?"0"+r:r}).join("");return o}var V=J;var ee=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,te=e=>{let o=Math.max(document.documentElement.clientWidth||0,window.innerWidth||0)/W(),i=ee(e);return i>-1?o<i:!0},ne=e=>{let o=e.querySelector(".nav__items")?.querySelectorAll("a"),i=[];e.querySelectorAll("section").forEach(l=>{l.parentNode===e&&i.push(l)}),o?.forEach(l=>{l.removeAttribute("aria-selected"),l.classList.remove("nav__item--active")}),i.forEach(l=>{l.hidden=!1,l.removeAttribute("role")})};var S=(e,n,o,i,r,l=!0,a=h=>console.log(h))=>{l&&i.focus(),i.removeAttribute("tabindex"),i.setAttribute("aria-selected","true"),i.classList.contains("switch__segment")?i.classList.add("switch__segment--active"):i.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,i);if(Array.from(document.querySelectorAll(`[data-for="${n[h].id}"]`)).forEach(m=>{m.classList.add("tabbed-content-peripheral--active"),m.hidden=!1}),n[h].hidden=!1,o){let m=Array.prototype.indexOf.call(e,o);Array.from(document.querySelectorAll(`[data-for="${n[m].id}"]`)).forEach(t=>{t.classList.remove("tabbed-content-peripheral--active"),t.hidden=!0}),n[m].hidden=!0}i.dispatchEvent(new CustomEvent("switch-tab",{bubbles:!0,detail:{tab:h}})),a(h)},oe=(e,n,o=0,i=!0,r=l=>console.log(l))=>{let l=n.querySelector(".switch,.nav__items"),a=l.querySelectorAll("a"),h=[];n.querySelectorAll("section").forEach(s=>{s.parentNode===n&&h.push(s)});let m=n.querySelector("button.tabbed-content__expand-all");if(m){let s=()=>{l.hidden=!0,h.forEach(t=>{t.hidden=!1})};m.removeEventListener("click",s),m.addEventListener("click",s)}l.setAttribute("role","tablist"),a.forEach((s,t)=>{s.setAttribute("role","tab"),s.setAttribute("id",`tab${e}_${t+1}`),s.setAttribute("tabindex","-1"),s.parentElement?.setAttribute("role","presentation");let c=f=>{f.preventDefault();let u=l.querySelector("[aria-selected]");f.currentTarget!==u&&S(a,h,u,f.currentTarget,n.classList,!0,v=>{r(v)})};s.removeEventListener("click",c),s.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[t].focus():a[v]&&S(a,h,f.currentTarget,a[v],n.classList,!0,E=>{r(E)}))};s.removeEventListener("keydown",d),s.addEventListener("keydown",d)}),h.forEach((s,t)=>{s.setAttribute("tabindex","-1"),s.setAttribute("aria-labelledby",a[t].id),s.hidden=!0,s.setAttribute("role","tabpanel")}),o>-1&&S(a,h,null,a[o],n.classList,i)},x=e=>{e.forEach((n,o)=>{let{rendered:i,domElement:r}=n;if(te(r.classList)){if(!i){let l=r.getAttribute("data-focus-onload"),a=r.getAttribute("data-initial-tab"),h=a?parseInt(a,10):0;oe(o,r,h,l!=="false"),n.rendered=!0}}else i&&(ne(r),n.rendered=!1)})};var F=(e,n,o,i)=>{let r=[],l=(s,t,c)=>{c&&t.focus();let d=()=>{e.setAttribute("hidden","hidden"),s.removeAttribute("hidden"),s.setAttribute("aria-expanded","false"),s.focus()};return t.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",s=>{let t=s.target,c=!t.classList.contains("content-toggle__content"),d=!t.classList.contains("content-toggle__toggle"),f=!t.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 s=()=>{let t=a.getAttribute("aria-expanded");typeof o=="function"&&t==="false"&&o(e,a),a.setAttribute("aria-expanded",t==="false"?"true":"false"),t==="true"?e.setAttribute("hidden","hidden"):e.removeAttribute("hidden"),typeof n=="function"&&n(e,a),a.hasAttribute("aria-haspopup")&&(a.setAttribute("hidden","hidden"),h.forEach(c=>{l(a,c,!0)})),typeof i=="function"&&i(e,a)};a.addEventListener("click",s),r.push({element:a,clickEvent:s}),h.forEach(t=>{let c=l(a,t,!1);r.push({element:t,clickEvent:c})})}return r};var $=e=>{e&&e.forEach(n=>{let o=n?.parentElement?.parentElement?.parentElement?.parentElement;if(o){let i=o.querySelectorAll(".horizontal-scroll__scrollable-content"),r=o.querySelectorAll(".switch__segment");i.forEach(l=>{l&&(n.addEventListener("click",()=>{let a=.8*l.clientWidth;l.scrollLeft+=a}),l.addEventListener("scroll",()=>{l.scrollLeft+l.clientWidth>=l.scrollWidth*.98?I(n):l.scrollLeft+l.clientWidth<l.scrollWidth&&N(n)}),r&&r.forEach(a=>{a.addEventListener("click",()=>{N(n),l.scrollLeft=0})}))})}})},j=e=>{e&&e.forEach(n=>{let o=n?.parentElement?.parentElement?.parentElement?.parentElement;if(o){let i=o.querySelectorAll(".horizontal-scroll__scrollable-content"),r=o.querySelectorAll(".switch__segment");i.forEach(l=>{l&&(n.addEventListener("click",()=>{let a=.8*l.clientWidth;l.scrollLeft-=a}),l.addEventListener("scroll",()=>{l.scrollLeft<=0?I(n):l.scrollLeft>0&&N(n)})),r&&r.forEach(a=>{a.addEventListener("click",()=>{I(n)})})})}})};function N(e){e.classList.remove("visually-disabled"),e.setAttribute("aria-disabled","false")}function I(e){e.classList.add("visually-disabled"),e.setAttribute("aria-disabled","true")}function H(e){e&&e.addEventListener("input",function(n){let o=e?.parentNode;o&&o.dataset&&(o.dataset.value=this.value)})}function K(e){let n=!0;e.addEventListener("click",function(o){n?(e.classList.add("dropdown-icon--active"),e.classList.remove("dropdown-icon--inactive"),n=!1):(e.classList.add("dropdown-icon--inactive"),e.classList.remove("dropdown-icon--active"),n=!0);let i=r=>{e.contains(r.target)||(e.classList.add("dropdown-icon--inactive"),e.classList.remove("dropdown-icon--active"),document.removeEventListener("click",i),n=!0)};document.addEventListener("click",i)})}var k=function(){function e(n,o){for(var i=0;i<o.length;i++){var r=o[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(n,r.key,r)}}return function(n,o,i){return o&&e(n.prototype,o),i&&e(n,i),n}}();function C(e,n){if(!(e instanceof n))throw new TypeError("Cannot call a class as a function")}(function(){if(typeof window>"u")return;var e=Array.prototype.slice,n=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(","),i=function(){function m(s,t){C(this,m),this._inertManager=t,this._rootElement=s,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(t){this._unmanageNode(t.node)},this),this._observer=null,this._rootElement=null,this._managedNodes=null,this._inertManager=null}},{key:"_makeSubtreeUnfocusable",value:function(t){var c=this;a(t,function(v){return c._visitNode(v)});var d=document.activeElement;if(!document.body.contains(t)){for(var f=t,u=void 0;f;){if(f.nodeType===Node.DOCUMENT_FRAGMENT_NODE){u=f;break}f=f.parentNode}u&&(d=u.activeElement)}t.contains(d)&&(d.blur(),d===document.activeElement&&document.body.focus())}},{key:"_visitNode",value:function(t){if(t.nodeType===Node.ELEMENT_NODE){var c=t;c!==this._rootElement&&c.hasAttribute("inert")&&this._adoptInertRoot(c),(n.call(c,o)||c.hasAttribute("tabindex"))&&this._manageNode(c)}}},{key:"_manageNode",value:function(t){var c=this._inertManager.register(t,this);this._managedNodes.add(c)}},{key:"_unmanageNode",value:function(t){var c=this._inertManager.deregister(t,this);c&&this._managedNodes.delete(c)}},{key:"_unmanageSubtree",value:function(t){var c=this;a(t,function(d){return c._unmanageNode(d)})}},{key:"_adoptInertRoot",value:function(t){var c=this._inertManager.getInertRoot(t);c||(this._inertManager.setInert(t,!0),c=this._inertManager.getInertRoot(t)),c.managedNodes.forEach(function(d){this._manageNode(d.node)},this)}},{key:"_onMutation",value:function(t,c){t.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(t){this._savedAriaHidden=t},get:function(){return this._savedAriaHidden}}]),m}(),r=function(){function m(s,t){C(this,m),this._node=s,this._overrodeFocusMethod=!1,this._inertRoots=new Set([t]),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 t=this._node;this._savedTabIndex!==null?t.setAttribute("tabindex",this._savedTabIndex):t.removeAttribute("tabindex"),this._overrodeFocusMethod&&delete t.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 t=this.node;if(n.call(t,o)){if(t.tabIndex===-1&&this.hasSavedTabIndex)return;t.hasAttribute("tabindex")&&(this._savedTabIndex=t.tabIndex),t.setAttribute("tabindex","-1"),t.nodeType===Node.ELEMENT_NODE&&(t.focus=function(){},this._overrodeFocusMethod=!0)}else t.hasAttribute("tabindex")&&(this._savedTabIndex=t.tabIndex,t.removeAttribute("tabindex"))}}},{key:"addInertRoot",value:function(t){this._throwIfDestroyed(),this._inertRoots.add(t)}},{key:"removeInertRoot",value:function(t){this._throwIfDestroyed(),this._inertRoots.delete(t),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(t){this._throwIfDestroyed(),this._savedTabIndex=t},get:function(){return this._throwIfDestroyed(),this._savedTabIndex}}]),m}(),l=function(){function m(s){if(C(this,m),!s)throw new Error("Missing required argument; InertManager needs to wrap a document.");this._document=s,this._managedNodes=new Map,this._inertRoots=new Map,this._observer=new MutationObserver(this._watchForInert.bind(this)),h(s.head||s.body||s.documentElement),s.readyState==="loading"?s.addEventListener("DOMContentLoaded",this._onDocumentLoaded.bind(this)):this._onDocumentLoaded()}return k(m,[{key:"setInert",value:function(t,c){if(c){if(this._inertRoots.has(t))return;var d=new i(t,this);if(t.setAttribute("inert",""),this._inertRoots.set(t,d),!this._document.body.contains(t))for(var f=t.parentNode;f;)f.nodeType===11&&h(f),f=f.parentNode}else{if(!this._inertRoots.has(t))return;var u=this._inertRoots.get(t);u.destructor(),this._inertRoots.delete(t),t.removeAttribute("inert")}}},{key:"getInertRoot",value:function(t){return this._inertRoots.get(t)}},{key:"register",value:function(t,c){var d=this._managedNodes.get(t);return d!==void 0?d.addInertRoot(c):d=new r(t,c),this._managedNodes.set(t,d),d}},{key:"deregister",value:function(t,c){var d=this._managedNodes.get(t);return d?(d.removeInertRoot(c),d.destroyed&&this._managedNodes.delete(t),d):null}},{key:"_onDocumentLoaded",value:function(){var t=e.call(this._document.querySelectorAll("[inert]"));t.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(t,c){var d=this;t.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]"));n.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,s,t){if(m.nodeType==Node.ELEMENT_NODE){var c=m;s&&s(c);var d=c.shadowRoot;if(d){a(d,s,d);return}if(c.localName=="content"){for(var f=c,u=f.getDistributedNodes?f.getDistributedNodes():[],v=0;v<u.length;v++)a(u[v],s,t);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],s,t);return}}for(var y=m.firstChild;y!=null;)a(y,s,t),y=y.nextSibling}function h(m){if(!m.querySelector("style#inert-style, link#inert-style")){var s=document.createElement("style");s.setAttribute("id","inert-style"),s.textContent=`
|
|
1
|
+
(()=>{var X=e=>{document.readyState!=="loading"?e():document.addEventListener("DOMContentLoaded",e)},C=X;var L=e=>{navigator.clipboard.writeText(e).then(()=>console.log(`${e} written to clipboard`))},O=(e,t)=>{let o=!1;return e.composedPath().forEach(r=>{r.classList&&r.classList.contains(t)&&(o=!0)}),o},R=()=>{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 i=document.createElement("meta");i.name="theme-color",i.content=t,document.getElementsByTagName("head")[0].appendChild(i)}}},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 z=e=>{let t=e.parentElement;return t?t.classList.contains("nav")?t:z(t):e},P=(e,t=null)=>{let o="nav--toggled";e.forEach(i=>{let r=i.querySelector(".nav__toggle");i!==t&&(i.classList.contains(o)&&(r.focus(),r.setAttribute("aria-expanded","false")),i.classList.remove(o))})},B=e=>{let t=r=>{let l=z(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"),P(e,a)};o.push({element:r,clickEvent:l}),r.addEventListener("click",l)}),o},M=(e,t)=>{let o="nav--toggled",i="nav__items";t.classList.remove(o);let r=t.querySelector(`.${i}`);if(r){let a=r.querySelectorAll(".nav__item"),h="nav__item--is-overflown",b="nav--has-overflow",m="nav__item--active",s=!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),s=!0):c.classList.contains(m)||c.classList.remove(h)}if(!s){t.classList.remove(b);let n=t.querySelector(`.${m}`);n&&n.classList.remove(h)}}let l=a=>{!a.target.classList.contains("nav__toggle")&&!O(a,i)&&P(e)};return document.querySelector("body")?.addEventListener("click",l),{element:document.querySelector("body"),clickEvent:l}};var D=(e,t,o,i,r)=>{if(i&&o){L(i.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,i.appendChild(l),o.removeEventListener("click",r),setTimeout(()=>{t.classList.remove("copy-to-clipboard--confirm"),l.remove(),o.addEventListener("click",r)},1200)}},U=(e,t="Kopieret!")=>{let o=e.querySelector(".copy-to-clipboard__this");if(e.type==="button"){let i=()=>{D(t,e,e,o,i)};e.addEventListener("click",i)}else{let i=e.querySelector(".copy-to-clipboard__execute"),r=()=>{D(t,e,i,o,r)};i?.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 i=o.parentElement?.querySelector(".copy-to-clipboard__color");if(i){let r=getComputedStyle(i).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(i){var r=parseInt(i).toString(16);return r.length===1?"0"+r:r}).join("");return o}var V=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(),i=te(e);return i>-1?o<i:!0},oe=e=>{let o=e.querySelector(".nav__items")?.querySelectorAll("a"),i=[];e.querySelectorAll("section").forEach(l=>{l.parentNode===e&&i.push(l)}),o?.forEach(l=>{l.removeAttribute("aria-selected"),l.classList.remove("nav__item--active")}),i.forEach(l=>{l.hidden=!1,l.removeAttribute("role")})};var S=(e,t,o,i,r,l=!0,a=h=>console.log(h))=>{l&&i.focus(),i.removeAttribute("tabindex"),i.setAttribute("aria-selected","true"),i.classList.contains("switch__segment")?i.classList.add("switch__segment--active"):i.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,i);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}i.dispatchEvent(new CustomEvent("switch-tab",{bubbles:!0,detail:{tab:h}})),a(h)},se=(e,t,o=0,i=!0,r=l=>console.log(l))=>{let l=t.querySelector(".switch,.nav__items"),a=l.querySelectorAll("a"),h=[];t.querySelectorAll("section").forEach(s=>{s.parentNode===t&&h.push(s)});let m=t.querySelector("button.tabbed-content__expand-all");if(m){let s=()=>{l.hidden=!0,h.forEach(n=>{n.hidden=!1})};m.removeEventListener("click",s),m.addEventListener("click",s)}l.setAttribute("role","tablist"),a.forEach((s,n)=>{s.setAttribute("role","tab"),s.setAttribute("id",`tab${e}_${n+1}`),s.setAttribute("tabindex","-1"),s.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)})};s.removeEventListener("click",c),s.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,p=>{r(p)}))};s.removeEventListener("keydown",d),s.addEventListener("keydown",d)}),h.forEach((s,n)=>{s.setAttribute("tabindex","-1"),s.setAttribute("aria-labelledby",a[n].id),s.hidden=!0,s.setAttribute("role","tabpanel")}),o>-1&&S(a,h,null,a[o],t.classList,i)},x=e=>{e.forEach((t,o)=>{let{rendered:i,domElement:r}=t;if(ne(r.classList)){if(!i){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 i&&(oe(r),t.rendered=!1)})};var $=(e,t,o,i)=>{let r=[],l=(s,n,c)=>{c&&n.focus();let d=()=>{e.setAttribute("hidden","hidden"),s.removeAttribute("hidden"),s.setAttribute("aria-expanded","false"),s.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",s=>{let n=s.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 s=()=>{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 i=="function"&&i(e,a)};a.addEventListener("click",s),r.push({element:a,clickEvent:s}),h.forEach(n=>{let c=l(a,n,!1);r.push({element:n,clickEvent:c})})}return r};var F=e=>{e&&e.forEach(t=>{let o=t?.parentElement?.parentElement?.parentElement?.parentElement;if(o){let i=o.querySelectorAll(".horizontal-scroll__scrollable-content"),r=o.querySelectorAll(".switch__segment");i.forEach(l=>{l&&(t.addEventListener("click",()=>{let a=.8*l.clientWidth;l.scrollLeft+=a}),l.addEventListener("scroll",()=>{l.scrollLeft+l.clientWidth>=l.scrollWidth*.98?I(t):l.scrollLeft+l.clientWidth<l.scrollWidth&&N(t)}),r&&r.forEach(a=>{a.addEventListener("click",()=>{N(t),l.scrollLeft=0})}))})}})},j=e=>{e&&e.forEach(t=>{let o=t?.parentElement?.parentElement?.parentElement?.parentElement;if(o){let i=o.querySelectorAll(".horizontal-scroll__scrollable-content"),r=o.querySelectorAll(".switch__segment");i.forEach(l=>{l&&(t.addEventListener("click",()=>{let a=.8*l.clientWidth;l.scrollLeft-=a}),l.addEventListener("scroll",()=>{l.scrollLeft<=0?I(t):l.scrollLeft>0&&N(t)})),r&&r.forEach(a=>{a.addEventListener("click",()=>{I(t)})})})}})};function N(e){e.classList.remove("visually-disabled"),e.setAttribute("aria-disabled","false")}function I(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 K(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 i=r=>{e.contains(r.target)||(e.classList.add("dropdown-icon--inactive"),e.classList.remove("dropdown-icon--active"),document.removeEventListener("click",i),t=!0)};document.addEventListener("click",i)})}var k=function(){function e(t,o){for(var i=0;i<o.length;i++){var r=o[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(t,o,i){return o&&e(t.prototype,o),i&&e(t,i),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(","),i=function(){function m(s,n){q(this,m),this._inertManager=n,this._rootElement=s,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(s,n){q(this,m),this._node=s,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(s){if(q(this,m),!s)throw new Error("Missing required argument; InertManager needs to wrap a document.");this._document=s,this._managedNodes=new Map,this._inertRoots=new Map,this._observer=new MutationObserver(this._watchForInert.bind(this)),h(s.head||s.body||s.documentElement),s.readyState==="loading"?s.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 i(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(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 a(m,s,n){if(m.nodeType==Node.ELEMENT_NODE){var c=m;s&&s(c);var d=c.shadowRoot;if(d){a(d,s,d);return}if(c.localName=="content"){for(var f=c,u=f.getDistributedNodes?f.getDistributedNodes():[],v=0;v<u.length;v++)a(u[v],s,n);return}if(c.localName=="slot"){for(var p=c,E=p.assignedNodes?p.assignedNodes({flatten:!0}):[],g=0;g<E.length;g++)a(E[g],s,n);return}}for(var y=m.firstChild;y!=null;)a(y,s,n),y=y.nextSibling}function h(m){if(!m.querySelector("style#inert-style, link#inert-style")){var s=document.createElement("style");s.setAttribute("id","inert-style"),s.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(s)}}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(s){b.setInert(this,s)}})}})();var A=(e,
|
|
13
|
+
`,m.appendChild(s)}}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(s){b.setInert(this,s)}})}})();var A=(e,t,o=()=>{})=>{let i=document.getElementById(e);if(i){i.classList.remove("modal-view--visible"),i.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()}},G=(e,t,o=()=>{},i=!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)};i&&(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;C(()=>{let e=document.querySelectorAll(".tabbed-content"),t=[];e.forEach(u=>t.push({domElement:u,rendered:!1})),x(t),R();let o=document.querySelectorAll(".nav:not(.nav--vertical)");o.forEach(u=>M(o,u)),B(o);let i=document.getElementById("autoexpand");H(i),window.onload=function(){H(i)},document.querySelectorAll(".form__field select, .form__field__combo-box__field").forEach(u=>{K(u)}),document.querySelectorAll(".copy-to-clipboard").forEach(u=>U(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");F(h),j(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(p=>{w(p)})})}),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",()=>{G(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=`./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`;console.log(E),window.location.href=g}})});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"),i=o?.querySelector("img.news-story__image");i instanceof HTMLImageElement&&Q(o,i)})});function Q(e,t){let o=e.offsetWidth,i=o*(3/4);t.style.width=o+"px",t.style.height=i+"px";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"),i=o?.querySelector("img.news-story__image");i instanceof HTMLImageElement&&Q(o,i)})});})();
|
|
14
14
|
//# sourceMappingURL=app.js.map
|