{"version":3,"sources":["../src/export.js"],"names":["cqfill","every","indexOf","slice","Array","prototype","defaultRoot","globalThis","document","supportsLayoutContainment","CSS","supports","unmatchableSelector","containerQueryMatcher","numberMatcher","layoutContainerSet","Set","layoutContainerMap","WeakMap","containerQueries","onMutationList","getSelectorText","selectorList","length","join","getElementSelectorText","element","parent","selector","parentElement","call","children","hasInlineOuterDisplay","test","getComputedStyle","display","getCSSRuleIndexOf","cssParentRule","cssRule","cssRules","getCSSRules","insertCssRule","cssText","index","insertRule","onResize","containedSelectorText","innerRule","doesFulfillQuery","fulfilledElements","layoutContainer","get","querySelectorAll","add","fulfilledSelectorList","selectorText","push","nextSelectorText","addLayoutContainerByCssRule","root","hasInlineSizeContainment","hasBlockSizeContainment","cssRuleIndex","getFallbackCssText","hasInlineDisplay","fallbackCssText","cssPolyfillGroup","cssInlinePolyfillStyleRule","cssBlockPolyfillStyleRule","lastElements","onMutation","blockSelectorList","inlineSelectorList","elements","clear","ro","disconnect","set","observe","nextInlinePolyfillStyleRuleSelectorText","nextBlockPolyfillStyleRuleSelectorText","mo","attributes","childList","subtree","polyfillLayoutContainment","styleSheet","getCssStyleRuleContainValues","style","getPropertyValue","trim","toLowerCase","split","walkCssParent","containValues","hasLayoutContainment","includes","hasSizeContainment","polyfillContainerQueries","mediaText","media","containerQueryMatches","match","minMax","axis","size","sizeValue","sizeUnit","value","getBoundingClientRect","sized","Number","parseInt","window","fontSize","documentElement","innerHeight","innerWidth","cssInnerRule","cssInnerRuleSelectorText","cssInnerRuleBlock","cssPolyfillInnerRule","lastNumberOfStyleSheets","styleSheets","onMutation2","onFrame","numberOfStyleSheets","href","startsWith","location","origin","requestAnimationFrame","ResizeObserver","MutationObserver"],"mappings":"AAAO,IAAMA,EAAU,GACpBC,MAAAA,EAAOC,QAAAA,EAASC,MAAAA,GAAUC,MAAMC,UAElCC,EAAcC,WAAWC,SAEzBC,EAA4BH,GAAeI,IAAIC,SAAS,+BAExDC,EAAsB,UAEtBC,EAAwB,i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,MAAMiF,EAA2BD,EAAa/D,aAE9C,GAAIgE,EAA0B,CAC7B,MAAMC,EAAoBF,EAAa5E,QAAQvC,MAAMoH,EAAyBhG,QAIxEkG,EAAuBhF,EAAcyB,EAHP,GAAGtD,IAAsB4G,IAG6B7E,KAE1FxB,EAAiBqC,KAAK,CACrB+D,EACAE,EACAzE,sBAOL6C,cAAcvD,KAIhBuD,cAAcP,GAEdzC,MAID8B,EAGAM,IACI,CAEJtB,EAAOrD,KAEN,GAAIA,IAAgBG,EAA2B,CAC9C,IAAIiH,EAA0B,EAG9B,MAAMC,YAAEA,GAAgBhE,EAElBW,WAAa,KAClB,IAAA,MAAWsD,KAAcxG,EACxBwG,KAIIC,QAAU,KACf,MAAMC,EAAsBH,EAAYpG,OACxC,GAAIuG,IAAwBJ,EAAyB,CACpD,KAAOA,EAA0BI,GAAqB,CACrD,MAAMxC,EAAaqC,EAAYD,KAG9BpC,KAEEA,EAAWyC,MACTzC,EAAWyC,KAAKC,WAAWC,SAASC,SACpC5C,EAAWyC,KAAKC,WAAW,QAAQC,SAASC,aAGhDhC,EAAyBvC,EAAM2B,GAC/BD,EAA0B1B,EAAM2B,IAIlCoC,EAA0BI,EAG3BK,sBAAsBN,UAGvBlD,EAAK,IAAIyD,eAAevF,GACxBoC,EAAK,IAAIoD,iBAAiB/D,YAE1BuD,YAxUoB","sourcesContent":["export const cqfill = ((\n\t{ every, indexOf, slice } = Array.prototype,\n\n\tdefaultRoot = globalThis.document,\n\n\tsupportsLayoutContainment = defaultRoot && CSS.supports('contain: layout inline-size'),\n\n\tunmatchableSelector = ':not(*)',\n\n\tcontainerQueryMatcher = /\\(\\s*(min|max)-(height|width):\\s*([^\\s]+)\\s*\\)/,\n\n\tnumberMatcher = /^([+-]?(?:\\d+(?:\\.\\d*)?|\\.\\d+)(?:[Ee][+-]?\\d+)?)(.*)$/,\n\n\t/** @type {Set<Element>} */\n\tlayoutContainerSet = new Set(),\n\n\t/** @type {Map<Element, string>} */\n\tlayoutContainerMap = new WeakMap(),\n\n\t/** @type {[string, CSSStyleRule, (rect: Element, matchableAxis: 'width' | 'height') => boolean, matchableAxis: 'width' | 'height'][]} */\n\tcontainerQueries = [],\n\n\t/** @type {(() => void)[]} */\n\tonMutationList = [],\n\n\t/** @type {(selectorList: string[]) => string} */\n\tgetSelectorText = (selectorList) => selectorList.length ? `:where(${selectorList.join(',')})` : unmatchableSelector,\n\n\t/** @type {(element: Element) => string} */\n\tgetElementSelectorText = (element) => {\n\t\t/** @type {Element} */\n\t\tlet parent\n\t\tlet selector = ''\n\t\twhile (parent = element.parentElement) {\n\t\t\t/** @type {number} */\n\t\t\tconst nthChild = indexOf.call(parent.children, element) + 1\n\t\t\tselector = ` > :nth-child(${nthChild})${selector}`\n\t\t\telement = parent\n\t\t}\n\t\treturn ':root' + selector\n\t},\n\n\t/** @type {(element: Element) => boolean} */\n\thasInlineOuterDisplay = (element) => /inline/i.test(getComputedStyle(element).display),\n\n\t/** @type {(cssParentRule: CSSParentRule, cssRule: CSSAnyRule) => number} */\n\tgetCSSRuleIndexOf = (cssParentRule, cssRule) => indexOf.call(cssParentRule.cssRules || [], cssRule),\n\n\t/** @type {(cssParentRule: CSSParentRule) => CSSAnyRule[]} */\n\tgetCSSRules = (cssParentRule) => slice.call(cssParentRule.cssRules || []),\n\n\t/** @type {(cssParentRule: CSSParentRule, cssText: string, index: number) => CSSAnyRule} */\n\tinsertCssRule = (cssParentRule, cssText, index) => cssParentRule.cssRules[cssParentRule.insertRule(cssText, index)],\n\n\tonResize = () => {\n\t\tfor (const [containedSelectorText, innerRule, doesFulfillQuery, ] of containerQueries) {\n\t\t\t/** @type {Set<Element>} */\n\t\t\tconst fulfilledElements = new Set()\n\n\t\t\tfor (const layoutContainer of layoutContainerSet) {\n\t\t\t\tif (doesFulfillQuery(layoutContainer, layoutContainerMap.get(layoutContainer))) {\n\t\t\t\t\tfor (const element of layoutContainer.querySelectorAll(containedSelectorText)) {\n\t\t\t\t\t\tfulfilledElements.add(element)\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t/** @type {string[]} */\n\t\t\tconst fulfilledSelectorList = []\n\n\t\t\tfor (const element of fulfilledElements) {\n\t\t\t\tconst selectorText = getElementSelectorText(element)\n\n\t\t\t\tfulfilledSelectorList.push(selectorText)\n\t\t\t}\n\n\t\t\tconst nextSelectorText = fulfilledSelectorList.length ? `:is(${containedSelectorText}):where(${fulfilledSelectorList.join(',')})` : unmatchableSelector\n\t\t\tif (innerRule.selectorText !== nextSelectorText) {\n\t\t\t\tinnerRule.selectorText = nextSelectorText\n\t\t\t}\n\t\t}\n\t},\n\n\t/** @type {(root: DocumentOrShadowRoot, cssRule: CSSAnyRule, cssParentRule: CSSParentRule, hasInlineSizeContainment: boolean, hasBlockSizeContainment: boolean) => string} */\n\taddLayoutContainerByCssRule = (root, cssRule, cssParentRule, hasInlineSizeContainment, hasBlockSizeContainment) => {\n\t\tconst cssRuleIndex = getCSSRuleIndexOf(cssParentRule, cssRule)\n\t\tconst getFallbackCssText = (\n\t\t\t/** @type {boolean} */\n\t\t\thasInlineDisplay\n\t\t) => (\n\t\t\t`${\n\t\t\t\tunmatchableSelector\n\t\t\t}{transform:scale3d(1,1,1);${\n\t\t\t\thasInlineSizeContainment ? (\n\t\t\t\t\t`inline-size:${\n\t\t\t\t\t\thasInlineDisplay ? 0 : 100\n\t\t\t\t\t}%;`\n\t\t\t\t ) : ''\n\t\t\t}${\n\t\t\t\thasBlockSizeContainment ? (\n\t\t\t\t\t`block-size:${\n\t\t\t\t\t\thasInlineDisplay ? 0 : 100\n\t\t\t\t\t};`\n\t\t\t\t) : ''\n\t\t\t}}`\n\t\t)\n\t\tconst fallbackCssText = `@media all{${getFallbackCssText(true)}${getFallbackCssText(false)}}`\n\t\tconst cssPolyfillGroup = insertCssRule(cssParentRule, fallbackCssText, cssRuleIndex)\n\t\tconst [cssInlinePolyfillStyleRule, cssBlockPolyfillStyleRule] = cssPolyfillGroup.cssRules\n\n\t\t/** @type {Element[]} */\n\t\tlet lastElements = []\n\n\t\tconst onMutation = () => {\n\t\t\t/** @type {string[]} */\n\t\t\tconst blockSelectorList = []\n\n\t\t\t/** @type {string[]} */\n\t\t\tconst inlineSelectorList = []\n\n\t\t\tconst elements = root.querySelectorAll(cssRule.selectorText)\n\n\t\t\t/** @type {(value: Element, index: number) => boolean} */\n\t\t\tconst doesMatchElement = (element, index) => element === lastElements[index]\n\n\t\t\tconst doesMatchAllElements = elements.length === lastElements.length && every.call(elements, doesMatchElement)\n\n\t\t\tif (!doesMatchAllElements) {\n\t\t\t\tlayoutContainerSet.clear()\n\n\t\t\t\tro.disconnect()\n\n\t\t\t\tfor (const element of elements) {\n\t\t\t\t\tlayoutContainerSet.add(element)\n\t\t\t\t\tlayoutContainerMap.set(element, [hasInlineSizeContainment, hasBlockSizeContainment])\n\n\t\t\t\t\tconst selectorText = getElementSelectorText(element)\n\n\t\t\t\t\tif (hasInlineOuterDisplay(element)) inlineSelectorList.push(selectorText)\n\t\t\t\t\telse blockSelectorList.push(selectorText)\n\n\t\t\t\t\tro.observe(element)\n\t\t\t\t}\n\n\t\t\t\tconst nextInlinePolyfillStyleRuleSelectorText = getSelectorText(inlineSelectorList)\n\t\t\t\tif (cssInlinePolyfillStyleRule.selectorText !== nextInlinePolyfillStyleRuleSelectorText) {\n\t\t\t\t\tcssInlinePolyfillStyleRule.selectorText = nextInlinePolyfillStyleRuleSelectorText\n\t\t\t\t}\n\n\t\t\t\tconst nextBlockPolyfillStyleRuleSelectorText = getSelectorText(blockSelectorList)\n\t\t\t\tif (cssBlockPolyfillStyleRule.selectorText !== nextBlockPolyfillStyleRuleSelectorText) {\n\t\t\t\t\tcssBlockPolyfillStyleRule.selectorText = nextBlockPolyfillStyleRuleSelectorText\n\t\t\t\t}\n\n\t\t\t\tlastElements = elements\n\t\t\t}\n\t\t}\n\n\t\tonMutation()\n\n\t\tonMutationList.push(onMutation)\n\n\t\tmo.observe(root, { attributes: true, childList: true, subtree: true })\n\t},\n\n\t/** @type {(root: DocumentOrShadowRoot, styleSheet: CSSStyleSheet) => void} */\n\tpolyfillLayoutContainment = (root, styleSheet) => {\n\t\t/** @type {(cssRule: CSSStyleRule) => string[]} */\n\t\tconst getCssStyleRuleContainValues = (cssRule) => cssRule.style ? cssRule.style.getPropertyValue('--css-contain').trim().toLowerCase().split(/\\s+/) : []\n\n\t\t/** @type {(cssParentRule: CSSParentRule) => void} */\n\t\tconst walkCssParent = (cssParentRule) => {\n\t\t\t// For each `CSSRule` in a `CSSGroupingRule` or `CSSStyleSheet`;\n\t\t\tfor (const cssRule of getCSSRules(cssParentRule)) {\n\t\t\t\twalkCssParent(cssRule)\n\n\t\t\t\tconst containValues = getCssStyleRuleContainValues(cssRule)\n\n\t\t\t\tconst hasLayoutContainment = containValues.includes('layout')\n\t\t\t\tconst hasSizeContainment = containValues.includes('size')\n\t\t\t\tconst hasInlineSizeContainment = hasLayoutContainment && (hasSizeContainment || containValues.includes('inline-size'))\n\t\t\t\tconst hasBlockSizeContainment = hasLayoutContainment && (hasSizeContainment || containValues.includes('block-size'))\n\n\t\t\t\t// If the target rule represents a style rule, and;\n\t\t\t\t// If the target rule style contains a fallback contain property, and;\n\t\t\t\t// If the fallback contain property represents a layout container, then;\n\t\t\t\tif (hasInlineSizeContainment || hasBlockSizeContainment) {\n\t\t\t\t\t// Add the element to the list of layout containers, and;\n\t\t\t\t\t// Add a fallback layout containment rule for that specific element.\n\t\t\t\t\taddLayoutContainerByCssRule(root, cssRule, cssParentRule, hasInlineSizeContainment, hasBlockSizeContainment)\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\twalkCssParent(styleSheet)\n\t},\n\n\t/** @type {(root: DocumentOrShadowRoot, styleSheet: CSSStyleSheet) => void} */\n\tpolyfillContainerQueries = (root, styleSheet) => {\n\t\t/** @type {(cssParentRule: CSSParentRule) => void} */\n\t\tconst walkCssParent = (cssParentRule) => {\n\t\t\t// For each `CSSRule` in a `CSSGroupingRule` or `CSSStyleSheet`;\n\t\t\tfor (const cssRule of getCSSRules(cssParentRule)) {\n\t\t\t\t/** @type {string} */\n\t\t\t\tconst mediaText = cssRule.media ? cssRule.media.mediaText : ''\n\n\t\t\t\tconst hasContainerQueryPolyfill = mediaText.indexOf('@container') === 0 || mediaText.indexOf('--css-container') === 0\n\n\t\t\t\tif (hasContainerQueryPolyfill) {\n\t\t\t\t\t/** @type {null | [string, 'max' | 'min', 'height' | 'width', `${number}${string}`]} */\n\t\t\t\t\tconst containerQueryMatches = cssRule.media[0].match(containerQueryMatcher)\n\n\t\t\t\t\t// If the target rule represents a fallback container query;\n\t\t\t\t\t// Parse the container query from the target rule, and;\n\t\t\t\t\tif (containerQueryMatches) {\n\t\t\t\t\t\tconst [, minMax, axis, size] = containerQueryMatches\n\n\t\t\t\t\t\tconst [, sizeValue, sizeUnit] = size.match(numberMatcher)\n\n\t\t\t\t\t\t/** @type {(rect: Element, hasInlineSizeContainment: boolean, hasBlockSizeContainment: boolean) => boolean} */\n\t\t\t\t\t\tconst doesFulfillQuery = (element, hasInlineSizeContainment, hasBlockSizeContainment) => {\n\t\t\t\t\t\t\tconst fulfillsBlockSizeContainment = (hasBlockSizeContainment !== (axis === 'block-size' || axis === 'height'))\n\t\t\t\t\t\t\tconst fulfillsInlineSizeContainment = (hasInlineSizeContainment !== (axis === 'inline-size' || axis === 'width'))\n\t\t\t\t\t\t\tif (!fulfillsBlockSizeContainment && !fulfillsInlineSizeContainment) return false\n\t\t\t\t\t\t\tconst value = element.getBoundingClientRect()[axis]\n\t\t\t\t\t\t\tconst sized = Number(sizeValue) * (\n\t\t\t\t\t\t\t\tsizeUnit === 'em'\n\t\t\t\t\t\t\t\t\t? parseInt(window.getComputedStyle(element).fontSize)\n\t\t\t\t\t\t\t\t: sizeUnit === 'rem'\n\t\t\t\t\t\t\t\t\t? parseInt(window.getComputedStyle(root.documentElement).fontSize)\n\t\t\t\t\t\t\t\t: sizeUnit === 'vh'\n\t\t\t\t\t\t\t\t\t? window.innerHeight / 100\n\t\t\t\t\t\t\t\t: sizeUnit === 'vw'\n\t\t\t\t\t\t\t\t\t? window.innerWidth / 100\n\t\t\t\t\t\t\t\t: 1\n\t\t\t\t\t\t\t)\n\n\t\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t\tminMax === 'min'\n\t\t\t\t\t\t\t\t\t? value >= sized\n\t\t\t\t\t\t\t\t: value <= sized\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tconst cssRuleIndex = getCSSRuleIndexOf(cssParentRule, cssRule)\n\t\t\t\t\t\tconst cssPolyfillGroup = insertCssRule(cssParentRule, '@media all{}', cssRuleIndex)\n\n\t\t\t\t\t\tlet index = 0\n\n\t\t\t\t\t\tfor (const cssInnerRule of getCSSRules(cssRule)) {\n\t\t\t\t\t\t\t/** @type {undefined | string} */\n\t\t\t\t\t\t\tconst cssInnerRuleSelectorText = cssInnerRule.selectorText\n\n\t\t\t\t\t\t\tif (cssInnerRuleSelectorText) {\n\t\t\t\t\t\t\t\tconst cssInnerRuleBlock = cssInnerRule.cssText.slice(cssInnerRuleSelectorText.length)\n\t\t\t\t\t\t\t\tconst cssPolyfillInnerRuleCssText = `${unmatchableSelector}${cssInnerRuleBlock}`\n\n\t\t\t\t\t\t\t\t/** @type {CSSStyleRule} */\n\t\t\t\t\t\t\t\tconst cssPolyfillInnerRule = insertCssRule(cssPolyfillGroup, cssPolyfillInnerRuleCssText, index++)\n\n\t\t\t\t\t\t\t\tcontainerQueries.push([\n\t\t\t\t\t\t\t\t\tcssInnerRuleSelectorText,\n\t\t\t\t\t\t\t\t\tcssPolyfillInnerRule,\n\t\t\t\t\t\t\t\t\tdoesFulfillQuery\n\t\t\t\t\t\t\t\t])\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\twalkCssParent(cssRule)\n\t\t\t}\n\t\t}\n\n\t\twalkCssParent(styleSheet)\n\n\t\tonResize()\n\t},\n\n\t/** @type {ResizeObserver} */\n\tro,\n\n\t/** @type {MutationObserver} */\n\tmo,\n) => (\n\t/** @type {DocumentOrShadowRoot | void} */\n\troot = defaultRoot\n) => {\n\t\tif (defaultRoot && !supportsLayoutContainment) {\n\t\t\tlet lastNumberOfStyleSheets = 0\n\n\t\t\t/** @type {{ styleSheets: StyleSheetList }} */\n\t\t\tconst { styleSheets } = root\n\n\t\t\tconst onMutation = () => {\n\t\t\t\tfor (const onMutation of onMutationList) {\n\t\t\t\t\tonMutation()\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tconst onFrame = () => {\n\t\t\t\tconst numberOfStyleSheets = styleSheets.length\n\t\t\t\tif (numberOfStyleSheets !== lastNumberOfStyleSheets) {\n\t\t\t\t\twhile (lastNumberOfStyleSheets < numberOfStyleSheets) {\n\t\t\t\t\t\tconst styleSheet = styleSheets[lastNumberOfStyleSheets++]\n\n\t\t\t\t\t\tif (\n\t\t\t\t\t\t\tstyleSheet\n\t\t\t\t\t\t\t&& (\n\t\t\t\t\t\t\t\t!styleSheet.href\n\t\t\t\t\t\t\t\t|| styleSheet.href.startsWith(location.origin)\n\t\t\t\t\t\t\t\t|| styleSheet.href.startsWith(`blob:${location.origin}`)\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t) {\n\t\t\t\t\t\t\tpolyfillContainerQueries(root, styleSheet)\n\t\t\t\t\t\t\tpolyfillLayoutContainment(root, styleSheet)\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tlastNumberOfStyleSheets = numberOfStyleSheets\n\t\t\t\t}\n\n\t\t\t\trequestAnimationFrame(onFrame)\n\t\t\t}\n\n\t\t\tro = new ResizeObserver(onResize)\n\t\t\tmo = new MutationObserver(onMutation)\n\n\t\t\tonFrame()\n\t\t}\n\t}\n)()\n\n/** @typedef {CSSStyleRule | CSSImportRule | CSSMediaRule | CSSFontFaceRule | CSSPageRule | CSSNamespaceRule | CSSKeyframesRule | CSSKeyframeRule | CSSSupportsRule} CSSAnyRule */\n/** @typedef {CSSStyleSheet | CSSMediaRule | CSSKeyframesRule | CSSSupportsRule} CSSParentRule */\n"]}