{"version":3,"file":"render.mjs","sources":["src/common.mjs","src/render.mjs"],"sourcesContent":["// Common Utilities Class\nclass Accordion {\n\tconstructor(el, sectionLayoutData, parentObj) {\n\t\t// Store the <details> element\n\t\tthis.el = el;\n\t\t// Store the <summary> element\n\t\tthis.summary = el.querySelector('summary');\n\t\t// Store the <div class=\"content\"> element\n\t\tthis.content = el.querySelectorAll('[data-class=\"accordion-content\"]');\n\t\t// Hack to fix accordions not working in compilation\n\t\tthis.content.forEach((content) => content.classList.add('accordion-content'));\n\t\tthis.content.forEach((content) =>\n\t\t\t[...content.children].forEach(\n\t\t\t\t(e) => !e.classList.contains('scs-container-styles') && e.remove()\n\t\t\t)\n\t\t);\n\n\t\t// Store the animation object (so we can cancel it if needed)\n\t\tthis.animation = null;\n\t\t// Store if the element is closing\n\t\tthis.isClosing = false;\n\t\t// Store if the element is expanding\n\t\tthis.isExpanding = false;\n\t\t// Detect user clicks on the summary element\n\t\tthis.summary.addEventListener('click', (e) =>\n\t\t\tthis.onClick(e, parentObj, sectionLayoutData)\n\t\t);\n\t}\n\n\t/**\n\t * Click Handler for the accordion summary\n\t * @param {Event} e\n\t * @param {Object} parentObj HTML element\n\t * @param {Object} sectionLayoutData\n\t */\n\tonClick(e, parentObj, sectionLayoutData) {\n\t\tconst controlAllButton = parentObj.querySelector('.expand-collapse-btn');\n\t\t// Stop default behavior from the browser\n\t\te.preventDefault();\n\t\t// Add an overflow on the <details> to avoid content overflowing\n\t\tthis.el.style.overflow = 'hidden';\n\t\t// Check if the element is being closed or is already closed\n\t\tif (this.isClosing || !this.el.open) {\n\t\t\tthis.open();\n\t\t\tcontrolAllButton.innerText = sectionLayoutData.customSettingsData.nls.collapseAllText;\n\t\t\tthis.el.classList.add('open');\n\t\t\t// Check if the element is being opened or is already open\n\t\t} else if (this.isExpanding || this.el.open) {\n\t\t\tthis.shrink();\n\t\t\tthis.el.classList.remove('open');\n\t\t\t// If no detail elements with 'open' attribute found\n\t\t\tif (!parentObj.querySelector('details.open')) {\n\t\t\t\tcontrolAllButton.innerText = sectionLayoutData.customSettingsData.nls.expandAllText;\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Close the accordion\n\t */\n\tshrink() {\n\t\t// Set the element as \"being closed\"\n\t\tthis.isClosing = true;\n\n\t\t// Store the current height of the element\n\t\tconst startHeight = `${this.el.offsetHeight}px`;\n\t\t// Calculate the height of the summary\n\t\tconst endHeight = `${this.summary.offsetHeight}px`;\n\n\t\t// If there is already an animation running\n\t\tif (this.animation) {\n\t\t\t// Cancel the current animation\n\t\t\tthis.animation.cancel();\n\t\t}\n\n\t\t// Start a WAAPI animation\n\t\tthis.animation = this.el.animate(\n\t\t\t{\n\t\t\t\t// Set the keyframes from the startHeight to endHeight\n\t\t\t\theight: [startHeight, endHeight],\n\t\t\t},\n\t\t\t{\n\t\t\t\tduration: 400,\n\t\t\t\teasing: 'ease-out',\n\t\t\t}\n\t\t);\n\n\t\t// When the animation is complete, call onAnimationFinish()\n\t\tthis.animation.onfinish = () => this.onAnimationFinish(false);\n\t\t// If the animation is cancelled, isClosing variable is set to false\n\t\tthis.animation.oncancel = () => (this.isClosing = false);\n\t}\n\n\t/**\n\t * Open the details element\n\t */\n\topen() {\n\t\t// Apply a fixed height on the element\n\t\tthis.el.style.height = `${this.el.offsetHeight}px`;\n\t\t// Force the [open] attribute on the details element\n\t\tthis.el.open = true;\n\t\t// Wait for the next frame to call the expand function\n\t\twindow.requestAnimationFrame(() => this.expand());\n\t}\n\n\t/**\n\t * Animation handler for the opening of the details element\n\t */\n\texpand() {\n\t\tconst content = this.summary.nextElementSibling;\n\t\t// Set the element as \"being expanding\"\n\t\tthis.isExpanding = true;\n\t\t// Get the current fixed height of the element\n\t\tconst startHeight = `${this.el.offsetHeight}px`;\n\n\t\t//Bug for compilation - can't find content height of nested accordions\n\t\tconst titleHeight = this.summary\n\t\t\t? this.summary.offsetHeight\n\t\t\t: this.el.querySelector('summary').offsetHeight;\n\t\tconst contentHeight = content\n\t\t\t? content.offsetHeight\n\t\t\t: this.el.querySelector('.accordion-content').offsetHeight;\n\n\t\t// Calculate the open height of the element (summary height + content height)\n\t\tconst endHeight = `${titleHeight + contentHeight}px`;\n\n\t\t// If there is already an animation running\n\t\tif (this.animation) {\n\t\t\t// Cancel the current animation\n\t\t\tthis.animation.cancel();\n\t\t}\n\n\t\t// Start a WAAPI animation\n\t\tthis.animation = this.el.animate(\n\t\t\t{\n\t\t\t\t// Set the keyframes from the startHeight to endHeight\n\t\t\t\theight: [startHeight, endHeight],\n\t\t\t},\n\t\t\t{\n\t\t\t\tduration: 400,\n\t\t\t\teasing: 'ease-out',\n\t\t\t}\n\t\t);\n\t\t// When the animation is complete, call onAnimationFinish()\n\t\tthis.animation.onfinish = () => this.onAnimationFinish(true);\n\t\t// If the animation is cancelled, isExpanding variable is set to false\n\t\tthis.animation.oncancel = () => (this.isExpanding = false);\n\t}\n\n\t/**\n\t * Finish the animation, reset the class properties and remove the fixed height\n\t * @param {Boolean} open\n\t */\n\tonAnimationFinish(open) {\n\t\t// Set the open attribute based on the parameter\n\t\tthis.el.open = open;\n\t\t// Clear the stored animation\n\t\tthis.animation = null;\n\t\t// Reset isClosing & isExpanding\n\t\tthis.isClosing = false;\n\t\tthis.isExpanding = false;\n\t\t// Remove the overflow hidden and the fixed height\n\t\tthis.el.style.height = this.el.style.overflow = '';\n\t}\n}\n\nexport default class {\n\tconstructor(sectionLayoutData, parentObj, DOMNode, renderMode) {\n\t\tthis.sectionLayoutData = sectionLayoutData;\n\t\tthis.renderMode = renderMode || false;\n\t\tthis.HTML = DOMNode || false;\n\n\t\t// Node.js uses a different HTML element constructor, so that's why this function exists.\n\t\tthis.createElement = (element) => {\n\t\t\treturn this.HTML ? new this.HTML(element, {}, '') : document.createElement(element);\n\t\t};\n\t}\n\n\t/**\n\t * Add the classes to the parent element to set size and theme\n\t * @param {HTMLElement} element\n\t */\n\taddClassesToParent(element) {\n\t\t// climb the DOM tree to find the parent .accordion\n\t\tconst elAccordion = element.closest('.accordion');\n\t\tlet arAccordionTitles = elAccordion.querySelectorAll('.accordion-title');\n\n\t\t// set the theme using a boolean or string. old versions of the component used a boolean, new versions use a string\n\t\tif (typeof this.sectionLayoutData.customSettingsData.theme == 'boolean') {\n\t\t\tswitch (this.sectionLayoutData.customSettingsData.theme) {\n\t\t\t\tcase false:\n\t\t\t\t\tarAccordionTitles.forEach((elAccordionTitle) => {\n\t\t\t\t\t\telAccordionTitle.classList.add('dark');\n\t\t\t\t\t});\n\t\t\t\t\tbreak;\n\t\t\t\tcase true:\n\t\t\t\tdefault:\n\t\t\t\t\tarAccordionTitles.forEach((elAccordionTitle) => {\n\t\t\t\t\t\telAccordionTitle.classList.add('light');\n\t\t\t\t\t});\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t} else if (typeof this.sectionLayoutData.customSettingsData.theme == 'string') {\n\t\t\tarAccordionTitles.forEach((elAccordionTitle) => {\n\t\t\t\telAccordionTitle.classList.add(this.sectionLayoutData.customSettingsData.theme);\n\t\t\t});\n\t\t}\n\n\t\t// set the size\n\t\tif (typeof this.sectionLayoutData.customSettingsData.size == 'boolean') {\n\t\t\tswitch (this.sectionLayoutData.customSettingsData.size) {\n\t\t\t\tcase false:\n\t\t\t\t\tarAccordionTitles.forEach((elAccordionTitle) => {\n\t\t\t\t\t\telAccordionTitle.classList.add('large');\n\t\t\t\t\t});\n\t\t\t\t\tbreak;\n\t\t\t\tcase true:\n\t\t\t\tdefault:\n\t\t\t\t\tarAccordionTitles.forEach((elAccordionTitle) => {\n\t\t\t\t\t\telAccordionTitle.classList.add('small');\n\t\t\t\t\t});\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t} else if (typeof this.sectionLayoutData.customSettingsData.size == 'string') {\n\t\t\tarAccordionTitles.forEach((elAccordionTitle) => {\n\t\t\t\telAccordionTitle.classList.add(this.sectionLayoutData.customSettingsData.size);\n\t\t\t});\n\t\t}\n\n\t\t// show/hide the expand/collapse button\n\t\telAccordion.classList.add(\n\t\t\tthis.sectionLayoutData.customSettingsData.expandBtn\n\t\t\t\t? 'show-expand-btn'\n\t\t\t\t: 'hide-expand-btn'\n\t\t);\n\t}\n\n\t/**\n\t * Shape the sectionLayoutData and build the HTML for the component\n\t * @param {HTMLElement} parentObj\n\t */\n\tshapeData(parentObj) {\n\t\tconst arSections = this.sectionLayoutData.customSettingsData.nls.sections;\n\t\ttry {\n\t\t\tconst self = this;\n\n\t\t\tconst elRoot = self.createElement('div');\n\t\t\telRoot.classList.add('accordion');\n\t\t\tparentObj.appendChild(elRoot);\n\n\t\t\t// create the expand/collapse button\n\t\t\tconst elExpandBtn = self.createElement('button');\n\t\t\telExpandBtn.classList.add('expand-collapse-btn');\n\t\t\telExpandBtn.innerHTML = self.sectionLayoutData.customSettingsData.nls.expandAllText;\n\t\t\telRoot.appendChild(elExpandBtn);\n\n\t\t\t// self.sectionLayoutData.components represents the component groups\n\t\t\tif (\n\t\t\t\t((self.sectionLayoutData.components = self.sectionLayoutData.components || []),\n\t\t\t\t'edit' === self.renderMode)\n\t\t\t) {\n\t\t\t\tconst arraySize = arSections.length;\n\t\t\t\tfor (\n\t\t\t\t\t;\n\t\t\t\t\tself.sectionLayoutData.components.length < arraySize &&\n\t\t\t\t\t(0 === self.sectionLayoutData.components.length ||\n\t\t\t\t\t\tself.sectionLayoutData.components.length % arraySize != 0);\n\n\t\t\t\t) {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tvar n = SCSRenderAPI.addComponentToPageModel({\n\t\t\t\t\t\t\ttype: 'scs-componentgroup',\n\t\t\t\t\t\t\tid: 'scs-componentgroup',\n\t\t\t\t\t\t\tdata: {\n\t\t\t\t\t\t\t\tcomponents: [],\n\t\t\t\t\t\t\t\tgrid: '',\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t});\n\t\t\t\t\t\tself.sectionLayoutData.components.push(n);\n\t\t\t\t\t} catch (er) {\n\t\t\t\t\t\tself.oceError(er);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t/**\n\t\t\t * Add the component group to the section layout\n\t\t\t * @param {String} componentGroup ID of the component group\n\t\t\t * @param {HTMLElement} section\n\t\t\t * @param {HTMLElement} headElement\n\t\t\t */\n\t\t\tfunction addComponentToSection(componentGroup, section, headElement) {\n\t\t\t\t// Create the li and button\n\t\t\t\tconst elDetails = self.createElement('details');\n\t\t\t\tif (section.anchorId) {\n\t\t\t\t\tif (section.anchorId.startsWith('#')) {\n\t\t\t\t\t\tsection.anchorId = section.anchorId.substring(1);\n\t\t\t\t\t}\n\t\t\t\t\telDetails.setAttribute('id', section.anchorId);\n\t\t\t\t}\n\t\t\t\tsection.open && elDetails.setAttribute('open', section.open);\n\t\t\t\tconst elSummary = self.createElement('summary');\n\t\t\t\tconst elSummaryText = self.createElement('span');\n\t\t\t\telSummaryText.textContent = section.name;\n\t\t\t\telSummaryText.classList.add('accordion-title-text');\n\t\t\t\telSummary.appendChild(elSummaryText);\n\t\t\t\telSummary.classList.add('accordion-title');\n\t\t\t\telDetails.appendChild(elSummary);\n\n\t\t\t\t// Create the div\n\t\t\t\tconst elDiv = self.createElement('div');\n\t\t\t\telDiv.setAttribute('id', componentGroup);\n\t\t\t\telDiv.setAttribute('data-class', 'accordion-content');\n\t\t\t\telDetails.appendChild(elDiv);\n\t\t\t\t// Append the list item to the unordered list\n\t\t\t\theadElement.appendChild(elDetails);\n\t\t\t}\n\n\t\t\tarSections.forEach(function (section) {\n\t\t\t\tconst groupIndex = section.index;\n\t\t\t\tconst groupId = self.sectionLayoutData.components[groupIndex];\n\t\t\t\taddComponentToSection(groupId, section, elRoot);\n\t\t\t});\n\n\t\t\t// set the theme and size\n\t\t\tself.addClassesToParent(elRoot);\n\t\t} catch (e) {\n\t\t\tconsole.error(e);\n\t\t}\n\t}\n\n\t/**\n\t * Expand all the children details elements (even nested ones)\n\t * @param {HTMLElement} parentObj\n\t */\n\texpandAll(parentObj) {\n\t\tlet elAccordion = parentObj.querySelector('.accordion');\n\t\telAccordion.querySelectorAll('details').forEach((el) => {\n\t\t\tel.setAttribute('open', true);\n\t\t\tel.classList.add('open');\n\t\t});\n\t}\n\n\t/**\n\t * Collapse all the children details elements (even nested ones)\n\t * @param {HTMLElement} parentObj\n\t */\n\tcollapseAll(parentObj) {\n\t\tlet elAccordion = parentObj.querySelector('.accordion');\n\t\telAccordion.querySelectorAll('details').forEach((el) => {\n\t\t\tel.removeAttribute('open');\n\t\t\tel.classList.remove('open');\n\t\t});\n\t}\n\n\t// Only do this in non-Node environments. This will get called on hydration.\n\t/**\n\t * Instantiate the accordion classes. Add our click handlers on the expand/collapse button\n\t * @param {HTMLElement} parentObj\n\t */\n\taddListeners(parentObj) {\n\t\tparentObj.querySelectorAll('details').forEach((el) => {\n\t\t\t// this has all sorts of cool animation stuff for the native html details element\n\t\t\tif (el?.parentElement?.parentElement === parentObj) {\n\t\t\t\tnew Accordion(el, this.sectionLayoutData, parentObj);\n\t\t\t}\n\t\t});\n\n\t\tconst elExpandBtn = parentObj.querySelector('.expand-collapse-btn');\n\t\telExpandBtn.addEventListener('click', (e) => {\n\t\t\t//is the button set to expand all?\n\t\t\tlet boolOpenall =\n\t\t\t\te.target.textContent ===\n\t\t\t\tthis.sectionLayoutData.customSettingsData.nls.expandAllText;\n\n\t\t\t//do what the button says on click (expand or collapse)\n\t\t\tif (boolOpenall) {\n\t\t\t\tthis.expandAll(parentObj);\n\t\t\t} else {\n\t\t\t\tthis.collapseAll(parentObj);\n\t\t\t}\n\n\t\t\t//set the button text (expand or collapse all) to the opposite of the current state after the click\n\t\t\tlet buttonText = boolOpenall\n\t\t\t\t? this.sectionLayoutData.customSettingsData.nls.collapseAllText\n\t\t\t\t: this.sectionLayoutData.customSettingsData.nls.expandAllText;\n\t\t\tparentObj.querySelectorAll('.expand-collapse-btn').forEach((el) => {\n\t\t\t\tel.textContent = buttonText;\n\t\t\t});\n\t\t});\n\t}\n}\n","/* globals SCSRenderAPI */\nimport CommonUtils from './common.mjs';\n\nexport default class {\n\tconstructor(params) {\n\t\t// store the args\n\t\tthis.sectionLayoutData = params.sectionLayoutData || {};\n\t\tthis.renderMode = params.renderMode || SCSRenderAPI.getRenderMode();\n\t\t// sectionLayoutData, renderMode, DOMNode, context\n\t\tthis.shared = new CommonUtils(this.sectionLayoutData, false, false, this.renderMode);\n\t\t// store the path to the <component>/assets folder\n\t\tthis.assetsPath = import.meta.url.replace('/render.mjs', '');\n\t\t// load up the component's CSS\n\t\tSCSRenderAPI.importCSS(this.assetsPath + '/styles/layout.css');\n\t}\n\n\t// This is only called in site builder and the local dev environment.\n\trender = (parentObj) => {\n\t\tthis.shared.shapeData(parentObj);\n\t\tthis.shared.addListeners(parentObj);\n\t};\n\n\t// This is called in the compiled site.\n\thydrate = (parentObj) => {\n\t\tthis.shared.addListeners(parentObj);\n\t};\n\n\tcreateComponentDiv(componentId) {\n\t\tconst componentDiv = document.createElement('div');\n\t\tcomponentDiv.id = componentId;\n\t\treturn componentDiv;\n\t}\n\n\t// dynamic API for adding additional components through \"load more\" when used in a Content List\n\taddComponent(parentObj, component) {\n\t\t// create the component div and add it to the parent object\n\t\tparentObj.append(this.createComponentDiv(component));\n\t}\n}\n"],"names":["Accordion","constructor","el","sectionLayoutData","parentObj","this","summary","querySelector","content","querySelectorAll","forEach","classList","add","children","e","contains","remove","animation","isClosing","isExpanding","addEventListener","onClick","controlAllButton","preventDefault","style","overflow","open","innerText","customSettingsData","nls","collapseAllText","shrink","expandAllText","concat","offsetHeight","cancel","animate","height","startHeight","endHeight","duration","easing","onfinish","onAnimationFinish","oncancel","window","requestAnimationFrame","expand","nextElementSibling","titleHeight","contentHeight","DOMNode","renderMode","HTML","createElement","element","document","addClassesToParent","closest","arAccordionTitles","elAccordion","theme","elAccordionTitle","size","expandBtn","shapeData","arSections","sections","self","elRoot","appendChild","elExpandBtn","innerHTML","components","arraySize","length","n","SCSRenderAPI","addComponentToPageModel","type","id","data","grid","push","er","oceError","componentGroup","section","headElement","elDetails","anchorId","startsWith","substring","setAttribute","elSummary","elSummaryText","textContent","name","elDiv","index","addComponentToSection","groupIndex","console","error","expandAll","collapseAll","removeAttribute","addListeners","_el$parentElement","parentElement","target","boolOpenall","buttonText","render","params","shared","getRenderMode","CommonUtils","assetsPath","import","meta","url","replace","importCSS","createComponentDiv","componentId","componentDiv","addComponent","component","append"],"mappings":"wHACA,MAAMA,EACLC,YAAYC,EAAIC,EAAmBC,GAElCC,KAAKH,GAAKA,EAEVG,KAAKC,QAAUJ,EAAGK,cAAc,WAEhCF,KAAKG,QAAUN,EAAGO,iBAAiB,oCAEnCJ,KAAKG,QAAQE,SAASF,GAAYA,EAAQG,UAAUC,IAAI,uBACxDP,KAAKG,QAAQE,SAASF,GACrB,IAAIA,EAAQK,UAAUH,SACpBI,IAAOA,EAAEH,UAAUI,SAAS,yBAA2BD,EAAEE,aAK5DX,KAAKY,UAAY,KAEjBZ,KAAKa,WAAY,EAEjBb,KAAKc,aAAc,EAEnBd,KAAKC,QAAQc,iBAAiB,SAAUN,GACvCT,KAAKgB,QAAQP,EAAGV,EAAWD,IAE5B,CAQDkB,QAAQP,EAAGV,EAAWD,GACrB,MAAMmB,EAAmBlB,EAAUG,cAAc,wBAEjDO,EAAES,iBAEFlB,KAAKH,GAAGsB,MAAMC,SAAW,SAErBpB,KAAKa,YAAcb,KAAKH,GAAGwB,MAC9BrB,KAAKqB,OACLJ,EAAiBK,UAAYxB,EAAkByB,mBAAmBC,IAAIC,gBACtEzB,KAAKH,GAAGS,UAAUC,IAAI,UAEZP,KAAKc,aAAed,KAAKH,GAAGwB,QACtCrB,KAAK0B,SACL1B,KAAKH,GAAGS,UAAUK,OAAO,QAEpBZ,EAAUG,cAAc,kBAC5Be,EAAiBK,UAAYxB,EAAkByB,mBAAmBC,IAAIG,eAGxE,CAKDD,SAEC1B,KAAKa,WAAY,EAGjB,QAAuB,GAAAe,OAAA5B,KAAKH,GAAGgC,qBAEV,GAAAD,OAAA5B,KAAKC,QAAQ4B,mBAG9B7B,KAAKY,WAERZ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