{"version":3,"file":"index.mjs","sources":["../../../../../packages/directives/mousewheel/index.ts"],"sourcesContent":["import normalizeWheel from 'normalize-wheel-es'\nimport { isFirefox } from '@element-plus/utils'\nimport type { DirectiveBinding, ObjectDirective } from 'vue'\n\nconst mousewheel = function (element, callback) {\n  if (element && element.addEventListener) {\n    const fn = function (this: any, event) {\n      const normalized = normalizeWheel(event)\n      callback && Reflect.apply(callback, this, [event, normalized])\n    }\n    if (isFirefox()) {\n      element.addEventListener('DOMMouseScroll', fn)\n    } else {\n      element.onmousewheel = fn\n    }\n  }\n}\n\nconst Mousewheel: ObjectDirective = {\n  beforeMount(el: HTMLElement, binding: DirectiveBinding) {\n    mousewheel(el, binding.value)\n  },\n}\n\nexport default Mousewheel\n"],"names":[],"mappings":";;;;AAEA,MAAM,UAAU,GAAG,SAAS,OAAO,EAAE,QAAQ,EAAE;AAC/C,EAAE,IAAI,OAAO,IAAI,OAAO,CAAC,gBAAgB,EAAE;AAC3C,IAAI,MAAM,EAAE,GAAG,SAAS,KAAK,EAAE;AAC/B,MAAM,MAAM,UAAU,GAAG,cAAc,CAAC,KAAK,CAAC,CAAC;AAC/C,MAAM,QAAQ,IAAI,OAAO,CAAC,KAAK,CAAC,QAAQ,EAAE,IAAI,EAAE,CAAC,KAAK,EAAE,UAAU,CAAC,CAAC,CAAC;AACrE,KAAK,CAAC;AACN,IAAI,IAAI,SAAS,EAAE,EAAE;AACrB,MAAM,OAAO,CAAC,gBAAgB,CAAC,gBAAgB,EAAE,EAAE,CAAC,CAAC;AACrD,KAAK,MAAM;AACX,MAAM,OAAO,CAAC,YAAY,GAAG,EAAE,CAAC;AAChC,KAAK;AACL,GAAG;AACH,CAAC,CAAC;AACG,MAAC,UAAU,GAAG;AACnB,EAAE,WAAW,CAAC,EAAE,EAAE,OAAO,EAAE;AAC3B,IAAI,UAAU,CAAC,EAAE,EAAE,OAAO,CAAC,KAAK,CAAC,CAAC;AAClC,GAAG;AACH;;;;"}