{"version":3,"file":"react-loading-skeleton-DwYsEz53.js","sources":["../../../node_modules/react-loading-skeleton/dist/index.mjs"],"sourcesContent":["import React from 'react';\n\n/**\n * @internal\n */\nconst SkeletonThemeContext = React.createContext({});\n\n/* eslint-disable react/no-array-index-key */\nconst defaultEnableAnimation = true;\n// For performance & cleanliness, don't add any inline styles unless we have to\nfunction styleOptionsToCssProperties({ baseColor, highlightColor, width, height, borderRadius, circle, direction, duration, enableAnimation = defaultEnableAnimation, }) {\n const style = {};\n if (direction === 'rtl')\n style['--animation-direction'] = 'reverse';\n if (typeof duration === 'number')\n style['--animation-duration'] = `${duration}s`;\n if (!enableAnimation)\n style['--pseudo-element-display'] = 'none';\n if (typeof width === 'string' || typeof width === 'number')\n style.width = width;\n if (typeof height === 'string' || typeof height === 'number')\n style.height = height;\n if (typeof borderRadius === 'string' || typeof borderRadius === 'number')\n style.borderRadius = borderRadius;\n if (circle)\n style.borderRadius = '50%';\n if (typeof baseColor !== 'undefined')\n style['--base-color'] = baseColor;\n if (typeof highlightColor !== 'undefined')\n style['--highlight-color'] = highlightColor;\n return style;\n}\nfunction Skeleton({ count = 1, wrapper: Wrapper, className: customClassName, containerClassName, containerTestId, circle = false, style: styleProp, ...originalPropsStyleOptions }) {\n var _a, _b;\n const contextStyleOptions = React.useContext(SkeletonThemeContext);\n const propsStyleOptions = { ...originalPropsStyleOptions };\n // DO NOT overwrite style options from the context if `propsStyleOptions`\n // has properties explicity set to undefined\n for (const [key, value] of Object.entries(originalPropsStyleOptions)) {\n if (typeof value === 'undefined') {\n delete propsStyleOptions[key];\n }\n }\n // Props take priority over context\n const styleOptions = {\n ...contextStyleOptions,\n ...propsStyleOptions,\n circle,\n };\n // `styleProp` has the least priority out of everything\n const style = {\n ...styleProp,\n ...styleOptionsToCssProperties(styleOptions),\n };\n let className = 'react-loading-skeleton';\n if (customClassName)\n className += ` ${customClassName}`;\n const inline = (_a = styleOptions.inline) !== null && _a !== void 0 ? _a : false;\n const elements = [];\n // Without the
, the skeleton lines will all run together if\n // `width` is specified\n for (let i = 0; i < count; i++) {\n const skeletonSpan = (React.createElement(\"span\", { className: className, style: style, key: i }, \"\\u200C\"));\n if (inline) {\n elements.push(skeletonSpan);\n }\n else {\n elements.push(React.createElement(React.Fragment, { key: i },\n skeletonSpan,\n React.createElement(\"br\", null)));\n }\n }\n return (React.createElement(\"span\", { className: containerClassName, \"data-testid\": containerTestId, \"aria-live\": \"polite\", \"aria-busy\": (_b = styleOptions.enableAnimation) !== null && _b !== void 0 ? _b : defaultEnableAnimation }, Wrapper\n ? elements.map((el, i) => React.createElement(Wrapper, { key: i }, el))\n : elements));\n}\n\nfunction SkeletonTheme({ children, ...styleOptions }) {\n return (React.createElement(SkeletonThemeContext.Provider, { value: styleOptions }, children));\n}\n\nexport { SkeletonTheme, Skeleton as default };\n"],"names":["SkeletonThemeContext","React","defaultEnableAnimation","styleOptionsToCssProperties","baseColor","highlightColor","width","height","borderRadius","circle","direction","duration","enableAnimation","style","Skeleton","count","Wrapper","customClassName","containerClassName","containerTestId","styleProp","originalPropsStyleOptions","_a","_b","contextStyleOptions","propsStyleOptions","key","value","styleOptions","className","inline","elements","i","skeletonSpan","el"],"mappings":"wCAKA,MAAMA,EAAuBC,EAAM,cAAc,CAAA,CAAE,EAG7CC,EAAyB,GAE/B,SAASC,EAA4B,CAAE,UAAAC,EAAW,eAAAC,EAAgB,MAAAC,EAAO,OAAAC,EAAQ,aAAAC,EAAc,OAAAC,EAAQ,UAAAC,EAAW,SAAAC,EAAU,gBAAAC,EAAkBV,CAAsB,EAAK,CACrK,MAAMW,EAAQ,CAAA,EACd,OAAIH,IAAc,QACdG,EAAM,uBAAuB,EAAI,WACjC,OAAOF,GAAa,WACpBE,EAAM,sBAAsB,EAAI,GAAGF,CAAQ,KAC1CC,IACDC,EAAM,0BAA0B,EAAI,SACpC,OAAOP,GAAU,UAAY,OAAOA,GAAU,YAC9CO,EAAM,MAAQP,IACd,OAAOC,GAAW,UAAY,OAAOA,GAA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