{"ast":null,"code":"import classNames from 'classnames';\nimport * as React from 'react';\nimport { useBootstrapPrefix } from './ThemeProvider';\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nconst defaultProps = {\n aspectRatio: '1x1'\n};\nfunction toPercent(num) {\n if (num <= 0 || num > 100) return '100%';\n if (num < 1) return `${num * 100}%`;\n return `${num}%`;\n}\nconst Ratio = /*#__PURE__*/React.forwardRef((_ref, ref) => {\n let {\n bsPrefix,\n className,\n children,\n aspectRatio,\n style,\n ...props\n } = _ref;\n bsPrefix = useBootstrapPrefix(bsPrefix, 'ratio');\n const isCustomRatio = typeof aspectRatio === 'number';\n return /*#__PURE__*/_jsx(\"div\", {\n ref: ref,\n ...props,\n style: {\n ...style,\n ...(isCustomRatio && {\n '--bs-aspect-ratio': toPercent(aspectRatio)\n })\n },\n className: classNames(bsPrefix, className, !isCustomRatio && `${bsPrefix}-${aspectRatio}`),\n children: React.Children.only(children)\n });\n});\nRatio.defaultProps = defaultProps;\nexport default Ratio;","map":{"version":3,"names":["classNames","React","useBootstrapPrefix","jsx","_jsx","defaultProps","aspectRatio","toPercent","num","Ratio","forwardRef","ref","bsPrefix","className","children","style","props","isCustomRatio","Children","only"],"sources":["C:/Cours/SAE/SAE-3.01/Scripted/Scripted/website/node_modules/react-bootstrap/esm/Ratio.js"],"sourcesContent":["import classNames from 'classnames';\nimport * as React from 'react';\nimport { useBootstrapPrefix } from './ThemeProvider';\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nconst defaultProps = {\n aspectRatio: '1x1'\n};\n\nfunction toPercent(num) {\n if (num <= 0 || num > 100) return '100%';\n if (num < 1) return `${num * 100}%`;\n return `${num}%`;\n}\n\nconst Ratio = /*#__PURE__*/React.forwardRef(({\n bsPrefix,\n className,\n children,\n aspectRatio,\n style,\n ...props\n}, ref) => {\n bsPrefix = useBootstrapPrefix(bsPrefix, 'ratio');\n const isCustomRatio = typeof aspectRatio === 'number';\n return /*#__PURE__*/_jsx(\"div\", {\n ref: ref,\n ...props,\n style: { ...style,\n ...(isCustomRatio && {\n '--bs-aspect-ratio': toPercent(aspectRatio)\n })\n },\n className: classNames(bsPrefix, className, !isCustomRatio && `${bsPrefix}-${aspectRatio}`),\n children: React.Children.only(children)\n });\n});\nRatio.defaultProps = defaultProps;\nexport default Ratio;"],"mappings":"AAAA,OAAOA,UAAU,MAAM,YAAY;AACnC,OAAO,KAAKC,KAAK,MAAM,OAAO;AAC9B,SAASC,kBAAkB,QAAQ,iBAAiB;AACpD,SAASC,GAAG,IAAIC,IAAI,QAAQ,mBAAmB;AAC/C,MAAMC,YAAY,GAAG;EACnBC,WAAW,EAAE;AACf,CAAC;AAED,SAASC,SAAS,CAACC,GAAG,EAAE;EACtB,IAAIA,GAAG,IAAI,CAAC,IAAIA,GAAG,GAAG,GAAG,EAAE,OAAO,MAAM;EACxC,IAAIA,GAAG,GAAG,CAAC,EAAE,OAAQ,GAAEA,GAAG,GAAG,GAAI,GAAE;EACnC,OAAQ,GAAEA,GAAI,GAAE;AAClB;AAEA,MAAMC,KAAK,GAAG,aAAaR,KAAK,CAACS,UAAU,CAAC,OAOzCC,GAAG,KAAK;EAAA,IAPkC;IAC3CC,QAAQ;IACRC,SAAS;IACTC,QAAQ;IACRR,WAAW;IACXS,KAAK;IACL,GAAGC;EACL,CAAC;EACCJ,QAAQ,GAAGV,kBAAkB,CAACU,QAAQ,EAAE,OAAO,CAAC;EAChD,MAAMK,aAAa,GAAG,OAAOX,WAAW,KAAK,QAAQ;EACrD,OAAO,aAAaF,IAAI,CAAC,KAAK,EAAE;IAC9BO,GAAG,EAAEA,GAAG;IACR,GAAGK,KAAK;IACRD,KAAK,EAAE;MAAE,GAAGA,KAAK;MACf,IAAIE,aAAa,IAAI;QACnB,mBAAmB,EAAEV,SAAS,CAACD,WAAW;MAC5C,CAAC;IACH,CAAC;IACDO,SAAS,EAAEb,UAAU,CAACY,QAAQ,EAAEC,SAAS,EAAE,CAACI,aAAa,IAAK,GAAEL,QAAS,IAAGN,WAAY,EAAC,CAAC;IAC1FQ,QAAQ,EAAEb,KAAK,CAACiB,QAAQ,CAACC,IAAI,CAACL,QAAQ;EACxC,CAAC,CAAC;AACJ,CAAC,CAAC;AACFL,KAAK,CAACJ,YAAY,GAAGA,YAAY;AACjC,eAAeI,KAAK"},"metadata":{},"sourceType":"module"}