Files
ETB/ETB-FrontEnd/node_modules/.cache/babel-loader/27558942c2bf63bdc3c0a88cf45f3f09db75f419ed8f671db0891b71cc1d9d75.json
Iliyan Angelov 306b20e24a Frontend start
2025-09-14 00:54:48 +03:00

1 line
6.5 KiB
JSON

{"ast":null,"code":"import { isValidMotionProp } from '../../../motion/utils/valid-prop.mjs';\nlet shouldForward = key => !isValidMotionProp(key);\nfunction loadExternalIsValidProp(isValidProp) {\n if (typeof isValidProp !== \"function\") return;\n // Explicitly filter our events\n shouldForward = key => key.startsWith(\"on\") ? !isValidMotionProp(key) : isValidProp(key);\n}\n/**\n * Emotion and Styled Components both allow users to pass through arbitrary props to their components\n * to dynamically generate CSS. They both use the `@emotion/is-prop-valid` package to determine which\n * of these should be passed to the underlying DOM node.\n *\n * However, when styling a Motion component `styled(motion.div)`, both packages pass through *all* props\n * as it's seen as an arbitrary component rather than a DOM node. Motion only allows arbitrary props\n * passed through the `custom` prop so it doesn't *need* the payload or computational overhead of\n * `@emotion/is-prop-valid`, however to fix this problem we need to use it.\n *\n * By making it an optionalDependency we can offer this functionality only in the situations where it's\n * actually required.\n */\ntry {\n /**\n * We attempt to import this package but require won't be defined in esm environments, in that case\n * isPropValid will have to be provided via `MotionContext`. In a 6.0.0 this should probably be removed\n * in favour of explicit injection.\n */\n loadExternalIsValidProp(require(\"@emotion/is-prop-valid\").default);\n} catch {\n // We don't need to actually do anything here - the fallback is the existing `isPropValid`.\n}\nfunction filterProps(props, isDom, forwardMotionProps) {\n const filteredProps = {};\n for (const key in props) {\n /**\n * values is considered a valid prop by Emotion, so if it's present\n * this will be rendered out to the DOM unless explicitly filtered.\n *\n * We check the type as it could be used with the `feColorMatrix`\n * element, which we support.\n */\n if (key === \"values\" && typeof props.values === \"object\") continue;\n if (shouldForward(key) || forwardMotionProps === true && isValidMotionProp(key) || !isDom && !isValidMotionProp(key) ||\n // If trying to use native HTML drag events, forward drag listeners\n props[\"draggable\"] && key.startsWith(\"onDrag\")) {\n filteredProps[key] = props[key];\n }\n }\n return filteredProps;\n}\nexport { filterProps, loadExternalIsValidProp };","map":{"version":3,"names":["isValidMotionProp","shouldForward","key","loadExternalIsValidProp","isValidProp","startsWith","require","default","filterProps","props","isDom","forwardMotionProps","filteredProps","values"],"sources":["/home/gnx/Desktop/ETB/ETB-FrontEnd/node_modules/framer-motion/dist/es/render/dom/utils/filter-props.mjs"],"sourcesContent":["import { isValidMotionProp } from '../../../motion/utils/valid-prop.mjs';\n\nlet shouldForward = (key) => !isValidMotionProp(key);\nfunction loadExternalIsValidProp(isValidProp) {\n if (typeof isValidProp !== \"function\")\n return;\n // Explicitly filter our events\n shouldForward = (key) => key.startsWith(\"on\") ? !isValidMotionProp(key) : isValidProp(key);\n}\n/**\n * Emotion and Styled Components both allow users to pass through arbitrary props to their components\n * to dynamically generate CSS. They both use the `@emotion/is-prop-valid` package to determine which\n * of these should be passed to the underlying DOM node.\n *\n * However, when styling a Motion component `styled(motion.div)`, both packages pass through *all* props\n * as it's seen as an arbitrary component rather than a DOM node. Motion only allows arbitrary props\n * passed through the `custom` prop so it doesn't *need* the payload or computational overhead of\n * `@emotion/is-prop-valid`, however to fix this problem we need to use it.\n *\n * By making it an optionalDependency we can offer this functionality only in the situations where it's\n * actually required.\n */\ntry {\n /**\n * We attempt to import this package but require won't be defined in esm environments, in that case\n * isPropValid will have to be provided via `MotionContext`. In a 6.0.0 this should probably be removed\n * in favour of explicit injection.\n */\n loadExternalIsValidProp(require(\"@emotion/is-prop-valid\").default);\n}\ncatch {\n // We don't need to actually do anything here - the fallback is the existing `isPropValid`.\n}\nfunction filterProps(props, isDom, forwardMotionProps) {\n const filteredProps = {};\n for (const key in props) {\n /**\n * values is considered a valid prop by Emotion, so if it's present\n * this will be rendered out to the DOM unless explicitly filtered.\n *\n * We check the type as it could be used with the `feColorMatrix`\n * element, which we support.\n */\n if (key === \"values\" && typeof props.values === \"object\")\n continue;\n if (shouldForward(key) ||\n (forwardMotionProps === true && isValidMotionProp(key)) ||\n (!isDom && !isValidMotionProp(key)) ||\n // If trying to use native HTML drag events, forward drag listeners\n (props[\"draggable\"] &&\n key.startsWith(\"onDrag\"))) {\n filteredProps[key] =\n props[key];\n }\n }\n return filteredProps;\n}\n\nexport { filterProps, loadExternalIsValidProp };\n"],"mappings":"AAAA,SAASA,iBAAiB,QAAQ,sCAAsC;AAExE,IAAIC,aAAa,GAAIC,GAAG,IAAK,CAACF,iBAAiB,CAACE,GAAG,CAAC;AACpD,SAASC,uBAAuBA,CAACC,WAAW,EAAE;EAC1C,IAAI,OAAOA,WAAW,KAAK,UAAU,EACjC;EACJ;EACAH,aAAa,GAAIC,GAAG,IAAKA,GAAG,CAACG,UAAU,CAAC,IAAI,CAAC,GAAG,CAACL,iBAAiB,CAACE,GAAG,CAAC,GAAGE,WAAW,CAACF,GAAG,CAAC;AAC9F;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;EACA;AACJ;AACA;AACA;AACA;EACIC,uBAAuB,CAACG,OAAO,CAAC,wBAAwB,CAAC,CAACC,OAAO,CAAC;AACtE,CAAC,CACD,MAAM;EACF;AAAA;AAEJ,SAASC,WAAWA,CAACC,KAAK,EAAEC,KAAK,EAAEC,kBAAkB,EAAE;EACnD,MAAMC,aAAa,GAAG,CAAC,CAAC;EACxB,KAAK,MAAMV,GAAG,IAAIO,KAAK,EAAE;IACrB;AACR;AACA;AACA;AACA;AACA;AACA;IACQ,IAAIP,GAAG,KAAK,QAAQ,IAAI,OAAOO,KAAK,CAACI,MAAM,KAAK,QAAQ,EACpD;IACJ,IAAIZ,aAAa,CAACC,GAAG,CAAC,IACjBS,kBAAkB,KAAK,IAAI,IAAIX,iBAAiB,CAACE,GAAG,CAAE,IACtD,CAACQ,KAAK,IAAI,CAACV,iBAAiB,CAACE,GAAG,CAAE;IACnC;IACCO,KAAK,CAAC,WAAW,CAAC,IACfP,GAAG,CAACG,UAAU,CAAC,QAAQ,CAAE,EAAE;MAC/BO,aAAa,CAACV,GAAG,CAAC,GACdO,KAAK,CAACP,GAAG,CAAC;IAClB;EACJ;EACA,OAAOU,aAAa;AACxB;AAEA,SAASJ,WAAW,EAAEL,uBAAuB","ignoreList":[]},"metadata":{},"sourceType":"module","externalDependencies":[]}