text: import e from"../../utils/is.prod.js";import*as t from"../../utils/pointerUtils.prod.js";function s({interaction:s,iEvent:n,phase:a}){if("gesture"!==s.prepared.name)return;const i=s.pointers.map((e=>e.pointer)),r="start"===a,o="end"===a,c=s.interactable.options.deltaSource;if(n.touches=[i[0],i[1]],r)n.distance=t.touchDistance(i,c),n.box=t.touchBBox(i),n.scale=1,n.ds=0,n.angle=t.touchAngle(i,c),n.da=0,s.gesture.startDistance=n.distance,s.gesture.startAngle=n.angle;else if(o){const e=s.prevEvent;n.distance=e.distance,n.box=e.box,n.scale=e.scale,n.ds=0,n.angle=e.angle,n.da=0}else n.distance=t.touchDistance(i,c),n.box=t.touchBBox(i),n.scale=n.distance/s.gesture.startDistance,n.angle=t.touchAngle(i,c),n.ds=n.scale-s.gesture.scale,n.da=n.angle-s.gesture.angle;s.gesture.distance=n.distance,s.gesture.angle=n.angle,e.number(n.scale)&&n.scale!==1/0&&!isNaN(n.scale)&&(s.gesture.scale=n.scale)}const n={id:"actions/gesture",before:["actions/drag","actions/resize"],install(t){const{actions:s,Interactable:a,defaults:i}=t;a.prototype.gesturable=function(t){return e.object(t)?(this.options.gesture.enabled=!1!==t.enabled,this.setPerAction("gesture",t),this.setOnEvents("gesture",t),this):e.bool(t)?(this.options.gesture.enabled=t,this):this.options.gesture},s.map.gesture=n,s.methodDict.gesture="gesturable",i.actions.gesture=n.defaults},listeners:{"interactions:action-start":s,"interactions:action-move":s,"interactions:action-end":s,"interactions:new"({interaction:e}){e.gesture={angle:0,distance:0,scale:1,startAngle:0,startDistance:0}},"auto-start:check"(e){if(e.interaction.pointers.length<2)return;const t=e.interactable.options.gesture;return t&&t.enabled?(e.action={name:"gesture"},!1):void 0}},defaults:{},getCursor(){return""}};export default n;
  //# sourceMappingURL=plugin.prod.js.map