import{G as t}from"./p-076f0239.js";export{G as GESTURE_CONTROLLER}from"./p-076f0239.js";
/*!
 * (C) Ionic http://ionicframework.com - MIT License
 */const e=(t,e,s,o)=>{const r=n(t)?{capture:!!o.capture,passive:!!o.passive}:!!o.capture;let c;let i;if(t["__zone_symbol__addEventListener"]){c="__zone_symbol__addEventListener";i="__zone_symbol__removeEventListener"}else{c="addEventListener";i="removeEventListener"}t[c](e,s,r);return()=>{t[i](e,s,r)}};const n=t=>{if(s===undefined){try{const e=Object.defineProperty({},"passive",{get:()=>{s=true}});t.addEventListener("optsTest",(()=>{}),e)}catch(t){s=false}}return!!s};let s;
/*!
 * (C) Ionic http://ionicframework.com - MIT License
 */const o=2e3;const r=(t,n,s,r,i)=>{let f;let u;let l;let a;let d;let m;let p;let v=0;const y=r=>{v=Date.now()+o;if(!n(r)){return}if(!u&&s){u=e(t,"touchmove",s,i)}if(!l){l=e(r.target,"touchend",h,i)}if(!a){a=e(r.target,"touchcancel",h,i)}};const _=o=>{if(v>Date.now()){return}if(!n(o)){return}if(!m&&s){m=e(c(t),"mousemove",s,i)}if(!p){p=e(c(t),"mouseup",b,i)}};const h=t=>{E();if(r){r(t)}};const b=t=>{L();if(r){r(t)}};const E=()=>{if(u){u()}if(l){l()}if(a){a()}u=l=a=undefined};const L=()=>{if(m){m()}if(p){p()}m=p=undefined};const x=()=>{E();L()};const D=(n=true)=>{if(!n){if(f){f()}if(d){d()}f=d=undefined;x()}else{if(!f){f=e(t,"touchstart",y,i)}if(!d){d=e(t,"mousedown",_,i)}}};const T=()=>{D(false);r=s=n=undefined};return{enable:D,stop:x,destroy:T}};const c=t=>t instanceof Document?t:t.ownerDocument;
/*!
 * (C) Ionic http://ionicframework.com - MIT License
 */const i=(t,e,n)=>{const s=n*(Math.PI/180);const o=t==="x";const r=Math.cos(s);const c=e*e;let i=0;let f=0;let u=false;let l=0;return{start(t,e){i=t;f=e;l=0;u=true},detect(t,e){if(!u){return false}const n=t-i;const s=e-f;const a=n*n+s*s;if(a<c){return false}const d=Math.sqrt(a);const m=(o?n:s)/d;if(m>r){l=1}else if(m<-r){l=-1}else{l=0}u=false;return true},isGesture(){return l!==0},getDirection(){return l}}};
/*!
 * (C) Ionic http://ionicframework.com - MIT License
 */const f=e=>{let n=false;let s=false;let o=true;let c=false;const f=Object.assign({disableScroll:false,direction:"x",gesturePriority:0,passive:true,maxAngle:40,threshold:10},e);const d=f.canStart;const m=f.onWillStart;const p=f.onStart;const v=f.onEnd;const y=f.notCaptured;const _=f.onMove;const h=f.threshold;const b=f.passive;const E=f.blurOnStart;const L={type:"pan",startX:0,startY:0,startTime:0,currentX:0,currentY:0,velocityX:0,velocityY:0,deltaX:0,deltaY:0,currentTime:0,event:undefined,data:undefined};const x=i(f.direction,f.threshold,f.maxAngle);const D=t.createGesture({name:e.gestureName,priority:e.gesturePriority,disableScroll:e.disableScroll});const T=t=>{const e=a(t);if(s||!o){return false}l(t,L);L.startX=L.currentX;L.startY=L.currentY;L.startTime=L.currentTime=e;L.velocityX=L.velocityY=L.deltaX=L.deltaY=0;L.event=t;if(d&&d(L)===false){return false}D.release();if(!D.start()){return false}s=true;if(h===0){return G()}x.start(L.startX,L.startY);return true};const g=t=>{if(n){if(!c&&o){c=true;u(L,t);requestAnimationFrame(j)}return}u(L,t);if(x.detect(L.currentX,L.currentY)){if(!x.isGesture()||!G()){S()}}};const j=()=>{if(!n){return}c=false;if(_){_(L)}};const G=()=>{if(D&&!D.capture()){return false}n=true;o=false;L.startX=L.currentX;L.startY=L.currentY;L.startTime=L.currentTime;if(m){m(L).then(X)}else{X()}return true};const O=()=>{if(typeof document!=="undefined"){const t=document.activeElement;if(t===null||t===void 0?void 0:t.blur){t.blur()}}};const X=()=>{if(E){O()}if(p){p(L)}o=true};const Y=()=>{n=false;s=false;c=false;o=true;D.release()};const M=t=>{const e=n;const s=o;Y();if(!s){return}u(L,t);if(e){if(v){v(L)}return}if(y){y(L)}};const R=r(f.el,T,g,M,{capture:false,passive:b});const S=()=>{Y();R.stop();if(y){y(L)}};return{enable(t=true){if(!t){if(n){M(undefined)}Y()}R.enable(t)},destroy(){D.destroy();R.destroy()}}};const u=(t,e)=>{if(!e){return}const n=t.currentX;const s=t.currentY;const o=t.currentTime;l(e,t);const r=t.currentX;const c=t.currentY;const i=t.currentTime=a(e);const f=i-o;if(f>0&&f<100){const e=(r-n)/f;const o=(c-s)/f;t.velocityX=e*.7+t.velocityX*.3;t.velocityY=o*.7+t.velocityY*.3}t.deltaX=r-t.startX;t.deltaY=c-t.startY;t.event=e};const l=(t,e)=>{let n=0;let s=0;if(t){const e=t.changedTouches;if(e&&e.length>0){const t=e[0];n=t.clientX;s=t.clientY}else if(t.pageX!==undefined){n=t.pageX;s=t.pageY}}e.currentX=n;e.currentY=s};const a=t=>t.timeStamp||Date.now();export{f as createGesture};
//# sourceMappingURL=p-e9431eeb.js.map