{"version":3,"file":"adaptiveHeight.mjs","names":[],"sources":["../../../src/plugins/adaptiveHeight.tsx"],"sourcesContent":["import { KeenSliderInstance } from \"keen-slider\";\n\n/**\n * Adaptive height is a plugin that adjusts the height of the slider to the content on change.\n *\n * @example\n * ```ts\n * const [create] = createSlider({}, [adaptiveHeight]);\n * ```\n */\nexport const adaptiveHeight = () => {\n  return (slider: KeenSliderInstance) => {\n    function updateHeight() {\n      slider.container.style.height =\n        slider.slides[slider.track.details.rel].offsetHeight + \"px\";\n    }\n    slider.on(\"created\", updateHeight);\n    slider.on(\"slideChanged\", updateHeight);\n  };\n};\n"],"mappings":";;;;;;;;;AASA,MAAa,uBAAuB;CACnC,QAAQ,WAA+B;EACtC,SAAS,eAAe;GACvB,OAAO,UAAU,MAAM,SAAS,OAAO,OAAO,OAAO,MAAM,QAAQ,IAAI,CAAC,eAAe;EACxF;EACA,OAAO,GAAG,WAAW,YAAY;EACjC,OAAO,GAAG,gBAAgB,YAAY;CACvC;AACD"}