(function(){'use strict';function collapse(widget,value){var launcher=widget.querySelector('.cms-service__launcher');widget.classList.toggle('is-collapsed',value);launcher.setAttribute('aria-expanded',value?'false':'true')}document.querySelectorAll('[data-cms-online-service]').forEach(function(widget){if(widget.dataset.ready)return;widget.dataset.ready='1';var close=widget.querySelector('.cms-service__close'),launcher=widget.querySelector('.cms-service__launcher');collapse(widget,window.matchMedia('(max-width:720px)').matches);close.addEventListener('click',function(){collapse(widget,true);launcher.focus()});launcher.addEventListener('click',function(){collapse(widget,false);close.focus()});document.addEventListener('keydown',function(event){if(event.key==='Escape'&&!widget.classList.contains('is-collapsed')){collapse(widget,true);launcher.focus()}})})}());
