{"version":3,"file":"contentWithSidenav.js","mappings":"CAAA,SAA2CA,EAAMC,GAChD,GAAsB,iBAAZC,SAA0C,iBAAXC,OACxCA,OAAOD,QAAUD,SACb,GAAqB,mBAAXG,QAAyBA,OAAOC,IAC9CD,OAAO,GAAIH,OACP,CACJ,IAAIK,EAAIL,IACR,IAAI,IAAIM,KAAKD,GAAuB,iBAAZJ,QAAuBA,QAAUF,GAAMO,GAAKD,EAAEC,EACvE,CACA,CATD,CASGC,MAAM,I,gLCTHC,EAAAA,WACJ,WAAYC,I,4FAAS,SACnBF,KAAKG,mBAAqBD,EAC1BF,KAAKI,aAAeJ,KAAKG,mBAAmBE,iBAC1C,oCAEFL,KAAKM,SAAWN,KAAKG,mBAAmBE,iBACtC,uCAEFL,KAAKO,gBAAkBP,KAAKG,mBAAmBK,cAC7C,yCAGFR,KAAKS,mBACN,C,wDAED,WAAoB,WAClBC,OAAOC,iBAAiB,UAAU,WAMhC,IALA,IAAIC,EAAkB,KAKbb,EAAI,EAAKO,SAASO,OAAS,EAAGd,GAAK,EAAGA,IAAK,CAClD,IAAMe,EAAU,EAAKR,SAASP,GAG9B,GAFYe,EAAQC,wBAAwBC,IALzB,IAOM,EAAG,CAE1BJ,EAAkBE,EAAQG,GAE1B,KACD,CACF,CAEGL,GACF,EAAKM,iBAAiBN,EAEzB,GACF,G,8BAED,SAAiBO,GAAU,WACzBnB,KAAKI,aAAagB,SAAQ,SAACC,EAAMtB,GAC3BsB,EAAKC,aAAa,UAAY,IAAMH,GACtCE,EAAKE,UAAUC,IAAI,aACnB,EAAKC,wBAAwB1B,IAE7BsB,EAAKE,UAAUG,OAAO,YAEzB,GACF,G,qCAED,SAAwBC,GACtB3B,KAAKO,gBAAgBqB,MAAMC,YAAY,0BAA2BF,EACnE,M,gFAtDG1B,G,OAyDN6B,SAASzB,iBAAiB,+BAA+Be,SAAQ,SAAClB,GAChE,IAAID,EAAmBC,EACxB,I","sources":["webpack://octopus.public.web/webpack/universalModuleDefinition","webpack://octopus.public.web/./Assets/js/contentWithSidenav.js"],"sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse {\n\t\tvar a = factory();\n\t\tfor(var i in a) (typeof exports === 'object' ? exports : root)[i] = a[i];\n\t}\n})(this, () => {\nreturn ","class ContentWithSidenav {\n constructor(element) {\n this.contentWithSidenav = element;\n this.sidenavLinks = this.contentWithSidenav.querySelectorAll(\n \"[data-content-with-sidenav-link]\"\n );\n this.sections = this.contentWithSidenav.querySelectorAll(\n \"[data-content-with-sidenav-heading]\"\n );\n this.scrollIndicator = this.contentWithSidenav.querySelector(\n \"[data-content-with-sidenav-indicator]\"\n );\n\n this.setScrollListener();\n }\n\n setScrollListener() {\n window.addEventListener(\"scroll\", () => {\n let currentActiveId = null;\n // Adjust this to account for fixed headers or other elements at the top.\n const headerOffset = 100;\n\n // Iterate backwards through the sections to find the last one that should be active.\n for (let i = this.sections.length - 1; i >= 0; i--) {\n const section = this.sections[i];\n const top = section.getBoundingClientRect().top;\n\n if (top - headerOffset < 0) {\n // Checks if the section has crossed the threshold to be considered active.\n currentActiveId = section.id;\n // Stop checking once we find the last section that has crossed the threshold.\n break;\n }\n }\n\n if (currentActiveId) {\n this.updateActiveLink(currentActiveId);\n }\n });\n }\n\n updateActiveLink(activeId) {\n this.sidenavLinks.forEach((link, i) => {\n if (link.getAttribute(\"href\") === \"#\" + activeId) {\n link.classList.add(\"is-active\");\n this.updateIndicatorPosition(i);\n } else {\n link.classList.remove(\"is-active\");\n }\n });\n }\n\n updateIndicatorPosition(index) {\n this.scrollIndicator.style.setProperty(\"--sidenav-current-index\", index);\n }\n}\n\ndocument.querySelectorAll(\"[data-content-with-sidenav]\").forEach((element) => {\n new ContentWithSidenav(element);\n});\n"],"names":["root","factory","exports","module","define","amd","a","i","this","ContentWithSidenav","element","contentWithSidenav","sidenavLinks","querySelectorAll","sections","scrollIndicator","querySelector","setScrollListener","window","addEventListener","currentActiveId","length","section","getBoundingClientRect","top","id","updateActiveLink","activeId","forEach","link","getAttribute","classList","add","updateIndicatorPosition","remove","index","style","setProperty","document"],"sourceRoot":""}