{"ast":null,"code":"import { __read } from 'tslib';\nimport { useState } from 'react';\nimport { motionValue } from '../value/index.js';\nimport { useOnChange } from '../value/use-on-change.js';\n\n// Does this device prefer reduced motion? Returns `null` server-side.\nvar prefersReducedMotion;\nfunction initPrefersReducedMotion() {\n  prefersReducedMotion = motionValue(null);\n  if (typeof window === \"undefined\") return;\n  if (window.matchMedia) {\n    var motionMediaQuery_1 = window.matchMedia(\"(prefers-reduced-motion)\");\n    var setReducedMotionPreferences = function setReducedMotionPreferences() {\n      return prefersReducedMotion.set(motionMediaQuery_1.matches);\n    };\n    motionMediaQuery_1.addListener(setReducedMotionPreferences);\n    setReducedMotionPreferences();\n  } else {\n    prefersReducedMotion.set(false);\n  }\n}\n/**\n * A hook that returns `true` if we should be using reduced motion based on the current device's Reduced Motion setting.\n *\n * This can be used to implement changes to your UI based on Reduced Motion. For instance, replacing motion-sickness inducing\n * `x`/`y` animations with `opacity`, disabling the autoplay of background videos, or turning off parallax motion.\n *\n * It will actively respond to changes and re-render your components with the latest setting.\n *\n * ```jsx\n * export function Sidebar({ isOpen }) {\n *   const shouldReduceMotion = useReducedMotion()\n *   const closedX = shouldReduceMotion ? 0 : \"-100%\"\n *\n *   return (\n *     <motion.div animate={{\n *       opacity: isOpen ? 1 : 0,\n *       x: isOpen ? 0 : closedX\n *     }} />\n *   )\n * }\n * ```\n *\n * @return boolean\n *\n * @public\n */\nfunction useReducedMotion() {\n  /**\n   * Lazy initialisation of prefersReducedMotion\n   */\n  !prefersReducedMotion && initPrefersReducedMotion();\n  var _a = __read(useState(prefersReducedMotion.get()), 2),\n    shouldReduceMotion = _a[0],\n    setShouldReduceMotion = _a[1];\n  useOnChange(prefersReducedMotion, setShouldReduceMotion);\n  return shouldReduceMotion;\n}\nexport { useReducedMotion };","map":{"version":3,"names":["__read","useState","motionValue","useOnChange","prefersReducedMotion","initPrefersReducedMotion","window","matchMedia","motionMediaQuery_1","setReducedMotionPreferences","set","matches","addListener","useReducedMotion","_a","get","shouldReduceMotion","setShouldReduceMotion"],"sources":["C:/LDT/DSP_Management/node_modules/framer-motion/dist/es/utils/use-reduced-motion.js"],"sourcesContent":["import { __read } from 'tslib';\nimport { useState } from 'react';\nimport { motionValue } from '../value/index.js';\nimport { useOnChange } from '../value/use-on-change.js';\n\n// Does this device prefer reduced motion? Returns `null` server-side.\nvar prefersReducedMotion;\nfunction initPrefersReducedMotion() {\n    prefersReducedMotion = motionValue(null);\n    if (typeof window === \"undefined\")\n        return;\n    if (window.matchMedia) {\n        var motionMediaQuery_1 = window.matchMedia(\"(prefers-reduced-motion)\");\n        var setReducedMotionPreferences = function () {\n            return prefersReducedMotion.set(motionMediaQuery_1.matches);\n        };\n        motionMediaQuery_1.addListener(setReducedMotionPreferences);\n        setReducedMotionPreferences();\n    }\n    else {\n        prefersReducedMotion.set(false);\n    }\n}\n/**\n * A hook that returns `true` if we should be using reduced motion based on the current device's Reduced Motion setting.\n *\n * This can be used to implement changes to your UI based on Reduced Motion. For instance, replacing motion-sickness inducing\n * `x`/`y` animations with `opacity`, disabling the autoplay of background videos, or turning off parallax motion.\n *\n * It will actively respond to changes and re-render your components with the latest setting.\n *\n * ```jsx\n * export function Sidebar({ isOpen }) {\n *   const shouldReduceMotion = useReducedMotion()\n *   const closedX = shouldReduceMotion ? 0 : \"-100%\"\n *\n *   return (\n *     <motion.div animate={{\n *       opacity: isOpen ? 1 : 0,\n *       x: isOpen ? 0 : closedX\n *     }} />\n *   )\n * }\n * ```\n *\n * @return boolean\n *\n * @public\n */\nfunction useReducedMotion() {\n    /**\n     * Lazy initialisation of prefersReducedMotion\n     */\n    !prefersReducedMotion && initPrefersReducedMotion();\n    var _a = __read(useState(prefersReducedMotion.get()), 2), shouldReduceMotion = _a[0], setShouldReduceMotion = _a[1];\n    useOnChange(prefersReducedMotion, setShouldReduceMotion);\n    return shouldReduceMotion;\n}\n\nexport { useReducedMotion };\n"],"mappings":"AAAA,SAASA,MAAM,QAAQ,OAAO;AAC9B,SAASC,QAAQ,QAAQ,OAAO;AAChC,SAASC,WAAW,QAAQ,mBAAmB;AAC/C,SAASC,WAAW,QAAQ,2BAA2B;;AAEvD;AACA,IAAIC,oBAAoB;AACxB,SAASC,wBAAwBA,CAAA,EAAG;EAChCD,oBAAoB,GAAGF,WAAW,CAAC,IAAI,CAAC;EACxC,IAAI,OAAOI,MAAM,KAAK,WAAW,EAC7B;EACJ,IAAIA,MAAM,CAACC,UAAU,EAAE;IACnB,IAAIC,kBAAkB,GAAGF,MAAM,CAACC,UAAU,CAAC,0BAA0B,CAAC;IACtE,IAAIE,2BAA2B,GAAG,SAA9BA,2BAA2BA,CAAA,EAAe;MAC1C,OAAOL,oBAAoB,CAACM,GAAG,CAACF,kBAAkB,CAACG,OAAO,CAAC;IAC/D,CAAC;IACDH,kBAAkB,CAACI,WAAW,CAACH,2BAA2B,CAAC;IAC3DA,2BAA2B,CAAC,CAAC;EACjC,CAAC,MACI;IACDL,oBAAoB,CAACM,GAAG,CAAC,KAAK,CAAC;EACnC;AACJ;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,SAASG,gBAAgBA,CAAA,EAAG;EACxB;AACJ;AACA;EACI,CAACT,oBAAoB,IAAIC,wBAAwB,CAAC,CAAC;EACnD,IAAIS,EAAE,GAAGd,MAAM,CAACC,QAAQ,CAACG,oBAAoB,CAACW,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;IAAEC,kBAAkB,GAAGF,EAAE,CAAC,CAAC,CAAC;IAAEG,qBAAqB,GAAGH,EAAE,CAAC,CAAC,CAAC;EACnHX,WAAW,CAACC,oBAAoB,EAAEa,qBAAqB,CAAC;EACxD,OAAOD,kBAAkB;AAC7B;AAEA,SAASH,gBAAgB","ignoreList":[]},"metadata":{},"sourceType":"module","externalDependencies":[]}