/**
 * Minified by jsDelivr using Terser v5.48.0.
 * Original file: /npm/@zoom-image/preact@0.3.34/dist/index.js
 *
 * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files
 */
"use strict";var core=require("@zoom-image/core"),hooks=require("preact/hooks");function noop(){}function useZoomImageWheel(){const e=hooks.useRef(),[o,t]=hooks.useState({currentZoom:1,enable:!1,currentPositionX:-1,currentPositionY:-1,currentRotation:0}),r=hooks.useCallback((...o)=>{e.current?.cleanup(),e.current=core.createZoomImageWheel(...o),t(e.current.getState()),e.current.subscribe(({state:e})=>{t(e)})},[]);return hooks.useEffect(()=>()=>{e.current?.cleanup()},[]),{createZoomImage:r,zoomImageState:o,setZoomImageState:e.current?.setState??noop}}function useZoomImageHover(){const e=hooks.useRef(),[o,t]=hooks.useState({enabled:!1,zoomedImgStatus:"idle"}),r=hooks.useCallback((...o)=>{e.current?.cleanup(),e.current=core.createZoomImageHover(...o),t(e.current.getState()),e.current.subscribe(({state:e})=>{t(e)})},[]);return hooks.useEffect(()=>()=>{e.current?.cleanup()},[]),{createZoomImage:r,zoomImageState:o,setZoomImageState:e.current?.setState??noop}}function useZoomImageMove(){const e=hooks.useRef(),[o,t]=hooks.useState({zoomedImgStatus:"idle"}),r=hooks.useCallback((...o)=>{e.current?.cleanup(),e.current=core.createZoomImageMove(...o),t(e.current.getState()),e.current.subscribe(({state:e})=>{t(e)})},[]);return hooks.useEffect(()=>()=>{e.current?.cleanup()},[]),{createZoomImage:r,zoomImageState:o}}function useZoomImageClick(){const e=hooks.useRef(),[o,t]=hooks.useState({zoomedImgStatus:"idle"}),r=hooks.useCallback((...o)=>{e.current?.cleanup(),e.current=core.createZoomImageClick(...o),t(e.current.getState()),e.current.subscribe(({state:e})=>{t(e)})},[]);return hooks.useEffect(()=>()=>{e.current?.cleanup()},[]),{createZoomImage:r,zoomImageState:o}}exports.useZoomImageClick=useZoomImageClick,exports.useZoomImageHover=useZoomImageHover,exports.useZoomImageMove=useZoomImageMove,exports.useZoomImageWheel=useZoomImageWheel;
//# sourceMappingURL=/sm/45383f91affccfa3afecd131761972535147980cc5a65a2d8d3345c6e61c97f8.map