{"ast":null,"code":"import { resolveElements } from '../utils/resolve-element.mjs';\nconst thresholds = {\n  some: 0,\n  all: 1\n};\nfunction inView(elementOrSelector, onStart) {\n  let {\n    root,\n    margin: rootMargin,\n    amount = \"some\"\n  } = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n  const elements = resolveElements(elementOrSelector);\n  const activeIntersections = new WeakMap();\n  const onIntersectionChange = entries => {\n    entries.forEach(entry => {\n      const onEnd = activeIntersections.get(entry.target);\n      /**\n       * If there's no change to the intersection, we don't need to\n       * do anything here.\n       */\n      if (entry.isIntersecting === Boolean(onEnd)) return;\n      if (entry.isIntersecting) {\n        const newOnEnd = onStart(entry);\n        if (typeof newOnEnd === \"function\") {\n          activeIntersections.set(entry.target, newOnEnd);\n        } else {\n          observer.unobserve(entry.target);\n        }\n      } else if (onEnd) {\n        onEnd(entry);\n        activeIntersections.delete(entry.target);\n      }\n    });\n  };\n  const observer = new IntersectionObserver(onIntersectionChange, {\n    root,\n    rootMargin,\n    threshold: typeof amount === \"number\" ? amount : thresholds[amount]\n  });\n  elements.forEach(element => observer.observe(element));\n  return () => observer.disconnect();\n}\nexport { inView };","map":{"version":3,"names":["resolveElements","thresholds","some","all","inView","elementOrSelector","onStart","root","margin","rootMargin","amount","arguments","length","undefined","elements","activeIntersections","WeakMap","onIntersectionChange","entries","forEach","entry","onEnd","get","target","isIntersecting","Boolean","newOnEnd","set","observer","unobserve","delete","IntersectionObserver","threshold","element","observe","disconnect"],"sources":["/opt/bitnami/minigames/frasle/node_modules/framer-motion/dist/es/render/dom/viewport/index.mjs"],"sourcesContent":["import { resolveElements } from '../utils/resolve-element.mjs';\n\nconst thresholds = {\n    some: 0,\n    all: 1,\n};\nfunction inView(elementOrSelector, onStart, { root, margin: rootMargin, amount = \"some\" } = {}) {\n    const elements = resolveElements(elementOrSelector);\n    const activeIntersections = new WeakMap();\n    const onIntersectionChange = (entries) => {\n        entries.forEach((entry) => {\n            const onEnd = activeIntersections.get(entry.target);\n            /**\n             * If there's no change to the intersection, we don't need to\n             * do anything here.\n             */\n            if (entry.isIntersecting === Boolean(onEnd))\n                return;\n            if (entry.isIntersecting) {\n                const newOnEnd = onStart(entry);\n                if (typeof newOnEnd === \"function\") {\n                    activeIntersections.set(entry.target, newOnEnd);\n                }\n                else {\n                    observer.unobserve(entry.target);\n                }\n            }\n            else if (onEnd) {\n                onEnd(entry);\n                activeIntersections.delete(entry.target);\n            }\n        });\n    };\n    const observer = new IntersectionObserver(onIntersectionChange, {\n        root,\n        rootMargin,\n        threshold: typeof amount === \"number\" ? amount : thresholds[amount],\n    });\n    elements.forEach((element) => observer.observe(element));\n    return () => observer.disconnect();\n}\n\nexport { inView };\n"],"mappings":"AAAA,SAASA,eAAe,QAAQ,8BAA8B;AAE9D,MAAMC,UAAU,GAAG;EACfC,IAAI,EAAE,CAAC;EACPC,GAAG,EAAE;AACT,CAAC;AACD,SAASC,MAAMA,CAACC,iBAAiB,EAAEC,OAAO,EAAsD;EAAA,IAApD;IAAEC,IAAI;IAAEC,MAAM,EAAEC,UAAU;IAAEC,MAAM,GAAG;EAAO,CAAC,GAAAC,SAAA,CAAAC,MAAA,QAAAD,SAAA,QAAAE,SAAA,GAAAF,SAAA,MAAG,CAAC,CAAC;EAC1F,MAAMG,QAAQ,GAAGd,eAAe,CAACK,iBAAiB,CAAC;EACnD,MAAMU,mBAAmB,GAAG,IAAIC,OAAO,CAAC,CAAC;EACzC,MAAMC,oBAAoB,GAAIC,OAAO,IAAK;IACtCA,OAAO,CAACC,OAAO,CAAEC,KAAK,IAAK;MACvB,MAAMC,KAAK,GAAGN,mBAAmB,CAACO,GAAG,CAACF,KAAK,CAACG,MAAM,CAAC;MACnD;AACZ;AACA;AACA;MACY,IAAIH,KAAK,CAACI,cAAc,KAAKC,OAAO,CAACJ,KAAK,CAAC,EACvC;MACJ,IAAID,KAAK,CAACI,cAAc,EAAE;QACtB,MAAME,QAAQ,GAAGpB,OAAO,CAACc,KAAK,CAAC;QAC/B,IAA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