{"version":3,"file":"global.js","mappings":"CAAA,SAAWA,GACTA,EAAOC,UAAUC,OAAS,CACxBC,OAAQ,SAAUC,EAASC,GACzB,GAAIC,WAAaF,EACf,OAGF,MAAMG,EAAaD,SAASE,cAAc,sBACpCC,EAAgBF,EAAWG,aAEjCH,EAAWI,MAAMC,UAAYH,EAAgB,IAAM,KAEnDI,OAAOC,iBAAiB,UAAU,KAChCP,EAAWI,MAAMC,UAAYH,EAAgB,IAAM,IAAI,GAE3D,GAGFT,EAAOC,UAAUc,oBAAsB,CACrCZ,OAAQ,SAAUC,EAASC,GACrBC,WAAaF,GAIbC,EAASW,QAAuC,OAA7BX,EAASW,OAAOC,WACrCZ,EAASW,OAAOC,SAAW,QAE/B,GAGFjB,EAAOC,UAAUiB,eAAiB,CAChCf,OAAQ,SAAUC,EAASC,GACzB,MAAMc,EAAQb,SAASc,iBAAiB,sBACnCD,EAAME,QAIXF,EAAMG,SAASC,IACTA,EAAKf,cAAc,QACrBe,EAAKC,UAAUC,IAAI,YACrB,GAEJ,GAGFzB,EAAOC,UAAUyB,wBAA0B,CACzCvB,OAAQ,SAAUC,EAASC,GACND,EAAQgB,iBAAiB,uBAEjCE,SAAQ,SAAUC,GAC3B,IAAII,EAAOJ,EAAKK,aAAa,QAC7B,GAAID,IAEFA,EAAOA,EAAKE,QAAQ,MAAO,KAClBC,MAAM,+BAAgC,CAC7C,IAAIC,EAAYR,EAAKK,aAAa,cAClC,IAAKG,GAA2B,KAAdA,EAAkB,CAClC,MAAMC,EAAWL,EAAKM,MAAM,KAAKC,MAAMD,MAAM,KAAK,GAClDV,EAAKY,aAAa,aAAc,gBAAgBH,SAClD,CACF,CAEJ,GACF,EAEH,CAjED,CAiEGhC","sources":["webpack://customtheme/./scripts/src/global.js"],"sourcesContent":["(function (Drupal) {\n Drupal.behaviors.footer = {\n attach: function (context, settings) {\n if (document !== context) {\n return;\n }\n\n const footerMenu = document.querySelector('#block-footer > ul');\n const initialHeight = footerMenu.scrollHeight;\n\n footerMenu.style.maxHeight = initialHeight / 1.8 + 'px';\n\n window.addEventListener('resize', () => {\n footerMenu.style.maxHeight = initialHeight / 1.8 + 'px';\n });\n }\n }\n\n Drupal.behaviors.disqus_multilingual = {\n attach: function (context, settings) {\n if (document !== context) {\n return;\n }\n\n if (settings.disqus && settings.disqus.language === 'es') {\n settings.disqus.language = 'es_ES'\n }\n }\n }\n\n Drupal.behaviors.link_has_image = {\n attach: function (context, settings) {\n const links = document.querySelectorAll('a[target=\"_blank\"]');\n if (!links.length) {\n return;\n }\n\n links.forEach((link) => {\n if (link.querySelector('img')) {\n link.classList.add('has-image')\n }\n });\n }\n }\n\n Drupal.behaviors.addAriaLabelToFileLinks = {\n attach: function (context, settings) {\n const fieldLinks = context.querySelectorAll('.field--type-link a');\n\n fieldLinks.forEach(function (link) {\n var href = link.getAttribute('href');\n if (href) {\n // Remove trailing slash if present\n href = href.replace(/\\/$/, '');\n if (href.match(/\\.(pdf|docx?|xlsx?|pptx?)$/i)) {\n var ariaLabel = link.getAttribute('aria-label');\n if (!ariaLabel || ariaLabel === '') {\n const fileName = href.split('/').pop().split('?')[0];\n link.setAttribute('aria-label', `Download the ${fileName} file`);\n }\n }\n }\n });\n }\n };\n})(Drupal)"],"names":["Drupal","behaviors","footer","attach","context","settings","document","footerMenu","querySelector","initialHeight","scrollHeight","style","maxHeight","window","addEventListener","disqus_multilingual","disqus","language","link_has_image","links","querySelectorAll","length","forEach","link","classList","add","addAriaLabelToFileLinks","href","getAttribute","replace","match","ariaLabel","fileName","split","pop","setAttribute"],"sourceRoot":""}