{"version":3,"file":"embla-carousel-react-DNLjyeJ_.js","sources":["../../node_modules/embla-carousel-react/esm/embla-carousel-react.esm.js"],"sourcesContent":["import { useRef, useState, useCallback, useEffect } from 'react';\nimport { areOptionsEqual, arePluginsEqual, canUseDOM } from 'embla-carousel-reactive-utils';\nimport EmblaCarousel from 'embla-carousel';\n\nfunction useEmblaCarousel(options = {}, plugins = []) {\n const storedOptions = useRef(options);\n const storedPlugins = useRef(plugins);\n const [emblaApi, setEmblaApi] = useState();\n const [viewport, setViewport] = useState();\n const reInit = useCallback(() => {\n if (emblaApi) emblaApi.reInit(storedOptions.current, storedPlugins.current);\n }, [emblaApi]);\n useEffect(() => {\n if (areOptionsEqual(storedOptions.current, options)) return;\n storedOptions.current = options;\n reInit();\n }, [options, reInit]);\n useEffect(() => {\n if (arePluginsEqual(storedPlugins.current, plugins)) return;\n storedPlugins.current = plugins;\n reInit();\n }, [plugins, reInit]);\n useEffect(() => {\n if (canUseDOM() && viewport) {\n EmblaCarousel.globalOptions = useEmblaCarousel.globalOptions;\n const newEmblaApi = EmblaCarousel(viewport, storedOptions.current, storedPlugins.current);\n setEmblaApi(newEmblaApi);\n return () => newEmblaApi.destroy();\n } else {\n setEmblaApi(undefined);\n }\n }, [viewport, setEmblaApi]);\n return [setViewport, emblaApi];\n}\nuseEmblaCarousel.globalOptions = undefined;\n\nexport { useEmblaCarousel as default };\n//# sourceMappingURL=embla-carousel-react.esm.js.map\n"],"names":["useEmblaCarousel","options","plugins","storedOptions","useRef","storedPlugins","emblaApi","setEmblaApi","useState","viewport","setViewport","reInit","useCallback","useEffect","areOptionsEqual","arePluginsEqual","canUseDOM","EmblaCarousel","newEmblaApi"],"mappings":"gfAIA,SAASA,EAAiBC,EAAU,GAAIC,EAAU,CAAA,EAAI,CACpD,MAAMC,EAAgBC,EAAM,OAACH,CAAO,EAC9BI,EAAgBD,EAAM,OAACF,CAAO,EAC9B,CAACI,EAAUC,CAAW,EAAIC,WAAU,EACpC,CAACC,EAAUC,CAAW,EAAIF,WAAU,EACpCG,EAASC,EAAAA,YAAY,IAAM,CAC3BN,GAAUA,EAAS,OAAOH,EAAc,QAASE,EAAc,OAAO,CAC9E,EAAK,CAACC,CAAQ,CAAC,EACbO,OAAAA,EAAAA,UAAU,IAAM,CACVC,EAAgBX,EAAc,QAASF,CAAO,IAClDE,EAAc,QAAUF,EACxBU,EAAQ,EACZ,EAAK,CAACV,EAASU,CAAM,CAAC,EACpBE,EAAAA,UAAU,IAAM,CACVE,EAAgBV,EAAc,QAASH,CAAO,IAClDG,EAAc,QAAUH,EACxBS,EAAQ,EACZ,EAAK,CAACT,EAASS,CAAM,CAAC,EACpBE,EAAAA,UAAU,IAAM,CACd,GAAIG,EAAW,GAAIP,EAAU,CAC3BQ,EAAc,cAAgBjB,EAAiB,cAC/C,MAAMkB,EAAcD,EAAcR,EAAUN,EAAc,QAASE,EAAc,OAAO,EACxF,OAAAE,EAAYW,CAAW,EAChB,IAAMA,EAAY,QAAS,CACxC,MACMX,EAAY,MAAS,CAE3B,EAAK,CAACE,EAAUF,CAAW,CAAC,EACnB,CAACG,EAAaJ,CAAQ,CAC/B,CACAN,EAAiB,cAAgB","x_google_ignoreList":[0]}