{"version":3,"sources":["webpack:///../node_modules/react-fit/dist/esm/Fit.js","webpack:///../node_modules/react-fit/dist/esm/index.js"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AACA,gBAAgB,SAAI,IAAI,SAAI;AAC5B;AACA,gDAAgD,OAAO;AACvD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc,SAAI,IAAI,SAAI;AAC1B;AACA;AACA;AACA;AACA,4DAA4D,cAAc;AAC1E;AACA;AACA;AACA;AACA;AACgD;AACiB;AACL;AAC9B;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oDAAoD,uCAAuC,EAAE;AAC7F;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oCAAoC,8BAAqB;AACzD,6BAA6B,8BAAqB;AAClD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,iBAAO;AACnB;AACA,YAAY,iBAAO;AACnB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kCAAkC,UAAU,uDAAuD;AACnG;AACA;AACA;AACA,sCAAsC,gBAAgB,yBAAyB;AAC/E,2CAA2C,gBAAgB,kCAAkC;AAC7F;AACe;AACf;AACA,oBAAoB,uBAAM;AAC1B,kBAAkB,uBAAM;AACxB,uBAAuB,uBAAM;AAC7B,wBAAwB,uBAAM;AAC9B,0BAA0B,uBAAM;AAChC,cAAc,4BAAW;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL,gBAAgB,iBAAQ;AACxB,IAAI,0BAAS;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,0BAAI,UAAU;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA,SAAS,UAAU,sBAAsB,mBAAmB;AAC5D;;;AC5N2B;AACZ;AACA,2EAAG,EAAC","file":"vendor.react-fit.f8ca5ae716dc3b3e471b.js","sourcesContent":["'use client';\nvar __assign = (this && this.__assign) || function () {\n __assign = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign.apply(this, arguments);\n};\nvar __rest = (this && this.__rest) || function (s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n t[p[i]] = s[p[i]];\n }\n return t;\n};\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nimport { Children, useCallback, useEffect, useRef } from 'react';\nimport detectElementOverflow from 'detect-element-overflow';\nimport warning from 'warning';\nvar isBrowser = typeof document !== 'undefined';\nvar isMutationObserverSupported = isBrowser && 'MutationObserver' in window;\nfunction capitalize(string) {\n return (string.charAt(0).toUpperCase() + string.slice(1));\n}\nfunction findScrollContainer(element) {\n var parent = element.parentElement;\n while (parent) {\n var overflow = window.getComputedStyle(parent).overflow;\n if (overflow.split(' ').every(function (o) { return o === 'auto' || o === 'scroll'; })) {\n return parent;\n }\n parent = parent.parentElement;\n }\n return document.documentElement;\n}\nfunction alignAxis(_a) {\n var axis = _a.axis, container = _a.container, element = _a.element, invertAxis = _a.invertAxis, scrollContainer = _a.scrollContainer, secondary = _a.secondary, spacing = _a.spacing;\n var style = window.getComputedStyle(element);\n var parent = container.parentElement;\n if (!parent) {\n return;\n }\n var scrollContainerCollisions = detectElementOverflow(parent, scrollContainer);\n var documentCollisions = detectElementOverflow(parent, document.documentElement);\n var isX = axis === 'x';\n var startProperty = isX ? 'left' : 'top';\n var endProperty = isX ? 'right' : 'bottom';\n var sizeProperty = isX ? 'width' : 'height';\n var overflowStartProperty = \"overflow\".concat(capitalize(startProperty));\n var overflowEndProperty = \"overflow\".concat(capitalize(endProperty));\n var scrollProperty = \"scroll\".concat(capitalize(startProperty));\n var uppercasedSizeProperty = capitalize(sizeProperty);\n var offsetSizeProperty = \"offset\".concat(uppercasedSizeProperty);\n var clientSizeProperty = \"client\".concat(uppercasedSizeProperty);\n var minSizeProperty = \"min-\".concat(sizeProperty);\n var scrollbarWidth = scrollContainer[offsetSizeProperty] - scrollContainer[clientSizeProperty];\n var startSpacing = typeof spacing === 'object' ? spacing[startProperty] : spacing;\n var availableStartSpace = -Math.max(scrollContainerCollisions[overflowStartProperty], documentCollisions[overflowStartProperty] + document.documentElement[scrollProperty]) - startSpacing;\n var endSpacing = typeof spacing === 'object' ? spacing[endProperty] : spacing;\n var availableEndSpace = -Math.max(scrollContainerCollisions[overflowEndProperty], documentCollisions[overflowEndProperty] - document.documentElement[scrollProperty]) -\n endSpacing -\n scrollbarWidth;\n if (secondary) {\n availableStartSpace += parent[clientSizeProperty];\n availableEndSpace += parent[clientSizeProperty];\n }\n var offsetSize = element[offsetSizeProperty];\n function displayStart() {\n element.style[startProperty] = 'auto';\n element.style[endProperty] = secondary ? '0' : '100%';\n }\n function displayEnd() {\n element.style[startProperty] = secondary ? '0' : '100%';\n element.style[endProperty] = 'auto';\n }\n function displayIfFits(availableSpace, display) {\n var fits = offsetSize <= availableSpace;\n if (fits) {\n display();\n }\n return fits;\n }\n function displayStartIfFits() {\n return displayIfFits(availableStartSpace, displayStart);\n }\n function displayEndIfFits() {\n return displayIfFits(availableEndSpace, displayEnd);\n }\n function displayWhereverShrinkedFits() {\n var moreSpaceStart = availableStartSpace > availableEndSpace;\n var rawMinSize = style.getPropertyValue(minSizeProperty);\n var minSize = rawMinSize ? parseInt(rawMinSize, 10) : null;\n function shrinkToSize(size) {\n warning(!minSize || size >= minSize, \"'s child will not fit anywhere with its current \".concat(minSizeProperty, \" of \").concat(minSize, \"px.\"));\n var newSize = Math.max(size, minSize || 0);\n warning(false, \"'s child needed to have its \".concat(sizeProperty, \" decreased to \").concat(newSize, \"px.\"));\n element.style[sizeProperty] = \"\".concat(newSize, \"px\");\n }\n if (moreSpaceStart) {\n shrinkToSize(availableStartSpace);\n displayStart();\n }\n else {\n shrinkToSize(availableEndSpace);\n displayEnd();\n }\n }\n var fits;\n if (invertAxis) {\n fits = displayStartIfFits() || displayEndIfFits();\n }\n else {\n fits = displayEndIfFits() || displayStartIfFits();\n }\n if (!fits) {\n displayWhereverShrinkedFits();\n }\n}\nfunction alignMainAxis(args) {\n alignAxis(args);\n}\nfunction alignSecondaryAxis(args) {\n alignAxis(__assign(__assign({}, args), { axis: args.axis === 'x' ? 'y' : 'x', secondary: true }));\n}\nfunction alignBothAxis(args) {\n var invertAxis = args.invertAxis, invertSecondaryAxis = args.invertSecondaryAxis, commonArgs = __rest(args, [\"invertAxis\", \"invertSecondaryAxis\"]);\n alignMainAxis(__assign(__assign({}, commonArgs), { invertAxis: invertAxis }));\n alignSecondaryAxis(__assign(__assign({}, commonArgs), { invertAxis: invertSecondaryAxis }));\n}\nexport default function Fit(_a) {\n var children = _a.children, invertAxis = _a.invertAxis, invertSecondaryAxis = _a.invertSecondaryAxis, _b = _a.mainAxis, mainAxis = _b === void 0 ? 'y' : _b, _c = _a.spacing, spacing = _c === void 0 ? 8 : _c;\n var container = useRef(undefined);\n var element = useRef(undefined);\n var elementWidth = useRef(undefined);\n var elementHeight = useRef(undefined);\n var scrollContainer = useRef(undefined);\n var fit = useCallback(function () {\n if (!scrollContainer.current || !container.current || !element.current) {\n return;\n }\n var currentElementWidth = element.current.clientWidth;\n var currentElementHeight = element.current.clientHeight;\n // No need to recalculate - already did that for current dimensions\n if (elementWidth.current === currentElementWidth &&\n elementHeight.current === currentElementHeight) {\n return;\n }\n // Save the dimensions so that we know we don't need to repeat the function if unchanged\n elementWidth.current = currentElementWidth;\n elementHeight.current = currentElementHeight;\n var parent = container.current.parentElement;\n // Container was unmounted\n if (!parent) {\n return;\n }\n /**\n * We need to ensure that 's child has a absolute position. Otherwise,\n * we wouldn't be able to place the child in the correct position.\n */\n var style = window.getComputedStyle(element.current);\n var position = style.position;\n if (position !== 'absolute') {\n element.current.style.position = 'absolute';\n }\n /**\n * We need to ensure that 's parent has a relative or absolute position. Otherwise,\n * we wouldn't be able to place the child in the correct position.\n */\n var parentStyle = window.getComputedStyle(parent);\n var parentPosition = parentStyle.position;\n if (parentPosition !== 'relative' && parentPosition !== 'absolute') {\n parent.style.position = 'relative';\n }\n alignBothAxis({\n axis: mainAxis,\n container: container.current,\n element: element.current,\n invertAxis: invertAxis,\n invertSecondaryAxis: invertSecondaryAxis,\n scrollContainer: scrollContainer.current,\n spacing: spacing,\n });\n }, [invertAxis, invertSecondaryAxis, mainAxis, spacing]);\n var child = Children.only(children);\n useEffect(function () {\n fit();\n function onMutation() {\n fit();\n }\n if (isMutationObserverSupported && element.current) {\n var mutationObserver = new MutationObserver(onMutation);\n mutationObserver.observe(element.current, {\n attributes: true,\n attributeFilter: ['class', 'style'],\n });\n }\n }, [fit]);\n function assignRefs(domElement) {\n if (!domElement || !(domElement instanceof HTMLElement)) {\n return;\n }\n element.current = domElement;\n scrollContainer.current = findScrollContainer(domElement);\n }\n return (_jsx(\"span\", { ref: function (domContainer) {\n if (!domContainer) {\n return;\n }\n container.current = domContainer;\n var domElement = domContainer === null || domContainer === void 0 ? void 0 : domContainer.firstElementChild;\n assignRefs(domElement);\n }, style: { display: 'contents' }, children: child }));\n}\n","import Fit from './Fit.js';\nexport { Fit };\nexport default Fit;\n"],"sourceRoot":""}