{"version":3,"sources":["community_highlights/community_highlights.js"],"names":["document","addEventListener","querySelectorAll","forEach","room","id","getAttribute","details","querySelector","concat","r","classList","add","remove","scrollIntoView","behavior","block","inline","containers","handleResize","window","innerWidth","container","headers","header","index","content","insertAdjacentElement","appendChild"],"mappings":"AAAA,aAAAA,SAASC,iBAAiB,oBAAoB,WAEzBD,SAASE,iBAAiB,qBAChCC,SAAQ,SAAAC,GACfA,EAAKH,iBAAiB,SAAS,WAC3B,IAAII,EAAKD,EAAKE,aAAa,gBAC3B,GAAID,EAAI,CACJ,IAAIE,EAAUP,SAASQ,cAAa,oCAAAC,OAAqCJ,EAAE,MACvEE,IACAP,SAASE,iBAAgB,sBAAuBC,SAAQ,SAAAO,GACpDA,EAAEC,UAAUC,IAAI,SACpB,IACAL,EAAQI,UAAUE,OAAO,UACzBN,EAAQO,eAAe,CAAEC,SAAU,SAAUC,MAAO,MAAOC,OAAQ,YAEnEjB,SAASE,iBAAgB,qBAAsBC,SAAQ,SAAAO,GACnDA,EAAEC,UAAUE,OAAO,WACvB,IACAT,EAAKO,UAAUC,IAAI,YAG3B,CACJ,GACJ,GACJ,IAEAZ,SAASC,iBAAiB,oBAAoB,WAGtBD,SAASE,iBAAiB,qBAA9C,IAEMgB,EAAalB,SAASE,iBAAiB,mCA4C7C,SAASiB,IACDC,OAAOC,YAAc,IAtCrBH,GAEAA,EAAWf,SAAQ,SAAAmB,GACf,IAAIC,EAAUD,EAAUpB,iBAAiB,qBACrCqB,GACAA,EAAQpB,SAAQ,SAAAqB,GACZ,IAAMC,EAAQD,EAAOlB,aAAa,gBAC5BoB,EAAUJ,EAAUd,cAAa,oCAAAC,OAAqCgB,EAAK,OAC7EC,GAEAF,EAAOG,sBAAsB,WAAYD,EAEjD,GAER,IAKAR,GAEAA,EAAWf,SAAQ,SAAAmB,GACf,IAAIC,EAAUD,EAAUpB,iBAAiB,qBACrCqB,GACAA,EAAQpB,SAAQ,SAAAqB,GACZ,IAAMC,EAAQD,EAAOlB,aAAa,gBAC5BoB,EAAUJ,EAAUd,cAAa,oCAAAC,OAAqCgB,EAAK,OAC7EC,GAEAJ,EAAUM,YAAYF,EAE9B,GAER,GAUR,CAIAP,IACAC,OAAOnB,iBAAiB,SAAUkB,EAEtC","file":"community_highlights.min.js","sourcesContent":["document.addEventListener('DOMContentLoaded', () => {\n\n let highlights = document.querySelectorAll('.highlight-option');\n highlights.forEach(room => {\n room.addEventListener('click', function () {\n let id = room.getAttribute('data-room-id');\n if (id) {\n let details = document.querySelector(`.highlight-details[data-room-id=\"${id}\"`);\n if (details) {\n document.querySelectorAll(`.highlight-details`).forEach(r => {\n r.classList.add('hidden');\n })\n details.classList.remove('hidden');\n details.scrollIntoView({ behavior: \"smooth\", block: \"end\", inline: \"nearest\" });\n\n document.querySelectorAll(`.highlight-option`).forEach(r => {\n r.classList.remove('selected');\n })\n room.classList.add('selected');\n\n }\n }\n })\n })\n})\n\ndocument.addEventListener('DOMContentLoaded', () => {\n\n\n const headerItems = document.querySelectorAll('.highlight-option');\n\n const containers = document.querySelectorAll('.community-highlights-container')\n\n\n\n\n\n function restructureForMobile() {\n if (containers) {\n\n containers.forEach(container => {\n let headers = container.querySelectorAll('.highlight-option');\n if (headers) {\n headers.forEach(header => {\n const index = header.getAttribute('data-room-id');\n const content = container.querySelector(`.highlight-details[data-room-id=\"${index}\"]`);\n if (content) {\n // Insert content after the header item\n header.insertAdjacentElement('afterend', content);\n }\n })\n }\n })\n }\n }\n\n function restructureForDesktop() {\n if (containers) {\n\n containers.forEach(container => {\n let headers = container.querySelectorAll('.highlight-option');\n if (headers) {\n headers.forEach(header => {\n const index = header.getAttribute('data-room-id');\n const content = container.querySelector(`.highlight-details[data-room-id=\"${index}\"]`);\n if (content) {\n // Insert content after the header item\n container.appendChild(content);\n }\n })\n }\n })\n }\n }\n\n function handleResize() {\n if (window.innerWidth <= 992) {\n restructureForMobile();\n } else {\n restructureForDesktop();\n }\n }\n\n\n // Initial check and resize handler\n handleResize();\n window.addEventListener('resize', handleResize);\n\n});"]}