{"version":3,"file":"Section.c16f2a8e.js","sources":["../../../../../../src/lib/components/SmartLayout.svelte","../../../../../../src/lib/components/Section.svelte"],"sourcesContent":["<script>\n import { GridContainer, Grid } from \"@ObamaFoundation/of-design-system\";\n import { getContext, setContext } from \"svelte\";\n\n /** @type { string } */\n let className = \"\";\n export { className as class };\n\n const IGNORE_LIST = [\"embedded-entry-block\", \"document\", \"list-item\"];\n const isContainerized = !!getContext(\"containerized\");\n const isSectionDescendant = !!getContext(\"sectionDescendant\");\n const isSplitLayoutDescendant = !!getContext(\"splitLayoutDescendant\");\n const nodeContext = getContext(\"nodeContext\");\n const nodeType = nodeContext?.nodeType;\n const previousNode = nodeContext?.previousNodeType?.nodeType;\n\n let shouldIgnore = IGNORE_LIST.includes(nodeType);\n\n if (!shouldIgnore) {\n if (nodeType === \"paragraph\" && previousNode === \"list-item\") {\n shouldIgnore = true;\n }\n\n if (nodeType === \"unordered-list\" && previousNode === \"list-item\") {\n shouldIgnore = true;\n }\n\n if (nodeType === \"ordered-list\" && previousNode === \"list-item\") {\n shouldIgnore = true;\n }\n\n if (nodeType === \"hyperlink\" && previousNode === \"paragraph\") {\n shouldIgnore = true;\n }\n }\n\n const isLayoutComponentDescendant = isSectionDescendant || isSplitLayoutDescendant;\n const isSmartLayoutContainerized =\n !isContainerized && isLayoutComponentDescendant && !shouldIgnore;\n\n if (isSmartLayoutContainerized) {\n setContext(\"containerized\", true);\n }\n</script>\n\n{#if isContainerized || shouldIgnore}\n <slot />\n{:else if isSmartLayoutContainerized || nodeType === \"blockquote\"}\n <GridContainer containerClass={className}>\n <slot />\n </GridContainer>\n{:else}\n <GridContainer containerClass={className}>\n <Grid>\n <div class=\"sm:col-span-4 md:col-span-8 md:col-start-3 lg:col-span-6 lg:col-start-4\">\n <slot />\n </div>\n </Grid>\n </GridContainer>\n{/if}\n","<script>\n import { Section } from \"@ObamaFoundation/of-design-system\";\n\n /** @type { string } */\n let className = \"\";\n export { className as class };\n\n export let title = undefined;\n export let theme = undefined;\n export let cta = undefined;\n</script>\n\n<Section {title} {theme} {cta} class=\"section {className}\" titleTag=\"h2\">\n <slot />\n</Section>\n"],"names":["ctx","insert_hydration","target","div","anchor","className","$$props","IGNORE_LIST","isContainerized","getContext","isSectionDescendant","isSplitLayoutDescendant","nodeContext","nodeType","previousNode","_a","shouldIgnore","isSmartLayoutContainerized","setContext","title","theme","cta"],"mappings":"2aAoDiCA,EAAS,CAAA,0JAATA,EAAS,CAAA,2LAJTA,EAAS,CAAA,0JAATA,EAAS,CAAA,gpBAMpCC,EAEKC,EAAAC,EAAAC,CAAA,0wBAXN,OAAAJ,MAAmBA,EAAY,CAAA,EAAA,EAE1BA,EAA0B,CAAA,GAAIA,EAAQ,CAAA,IAAK,aAAY,iXA1C3D,CAAA,MAAAK,EAAY,EAAE,EAAAC,EAGZ,MAAAC,EAAe,CAAA,uBAAwB,WAAY,WAAW,EAC9DC,EAAe,CAAA,CAAKC,EAAW,eAAe,EAC9CC,EAAmB,CAAA,CAAKD,EAAW,mBAAmB,EACtDE,EAAuB,CAAA,CAAKF,EAAW,uBAAuB,EAC9DG,EAAcH,EAAW,aAAa,EACtCI,EAAWD,GAAA,YAAAA,EAAa,SACxBE,GAAeC,EAAAH,GAAA,YAAAA,EAAa,mBAAb,YAAAG,EAA+B,SAEhD,IAAAC,EAAeT,EAAY,SAASM,CAAQ,EAE3CG,IACCH,IAAa,aAAeC,IAAiB,cAC/CE,EAAe,IAGbH,IAAa,kBAAoBC,IAAiB,cACpDE,EAAe,IAGbH,IAAa,gBAAkBC,IAAiB,cAClDE,EAAe,IAGbH,IAAa,aAAeC,IAAiB,cAC/CE,EAAe,KAKb,MAAAC,EACH,CAAAT,IAFiCE,GAAuBC,KAELK,SAElDC,GACFC,EAAW,gBAAiB,EAAI,2fC7BWlB,EAAS,CAAA,sOAATA,EAAS,CAAA,gLARlD,CAAA,MAAAK,EAAY,EAAE,EAAAC,EAGP,CAAA,MAAAa,EAAQ,MAAS,EAAAb,EACjB,CAAA,MAAAc,EAAQ,MAAS,EAAAd,EACjB,CAAA,IAAAe,EAAM,MAAS,EAAAf"}