{"version":3,"sources":["../node_modules/@ionic/core/dist/esm-es5/swipe-back-a7a3641e.js"],"names":["createSwipeBackGesture","el","canStartHandler","onStartHandler","onMoveHandler","onEndHandler","win","ownerDocument","defaultView","createGesture","gestureName","gesturePriority","threshold","canStart","detail","startX","onStart","onMove","stepValue","deltaX","innerWidth","onEnd","delta","width","velocity","velocityX","z","shouldComplete","missingDistance","realDur","dur","Math","abs","min","clamp"],"mappings":"wGAAA,kFAEIA,EAAyB,SAAUC,EAAIC,EAAiBC,EAAgBC,EAAeC,GACvF,IAAIC,EAAML,EAAGM,cAAcC,YAgC3B,OAAOC,wBAAc,CACjBR,GAAIA,EACJS,YAAa,eACbC,gBAAiB,GACjBC,UAAW,GACXC,SApCW,SAAUC,GACrB,OAAOA,EAAOC,QAAU,IAAMb,KAoC9Bc,QAASb,EACTc,OAnCS,SAAUH,GAEnB,IACII,EADQJ,EAAOK,OACKb,EAAIc,WAC5BhB,EAAcc,IAgCdG,MA9BQ,SAAUP,GAElB,IAAIQ,EAAQR,EAAOK,OACfI,EAAQjB,EAAIc,WACZF,EAAYI,EAAQC,EACpBC,EAAWV,EAAOW,UAClBC,EAAIH,EAAQ,EACZI,EAAiBH,GAAY,IAAMA,EAAW,IAAOV,EAAOK,OAASO,GAErEE,GADUD,EAAiB,EAAIT,EAAYA,GACfK,EAC5BM,EAAU,EACd,GAAID,EAAkB,EAAG,CACrB,IAAIE,EAAMF,EAAkBG,KAAKC,IAAIR,GACrCK,EAAUE,KAAKE,IAAIH,EAAK,KAO5BzB,EAAasB,EAAiBT,GAAa,EAAK,IAAOgB,YAAM,EAAGhB,EAAW,OAASW","file":"static/js/0.5878cfc0.chunk.js","sourcesContent":["import { c as clamp } from './helpers-d8b49b57.js';\nimport { createGesture } from './index-6f647ec8.js';\nvar createSwipeBackGesture = function (el, canStartHandler, onStartHandler, onMoveHandler, onEndHandler) {\n var win = el.ownerDocument.defaultView;\n var canStart = function (detail) {\n return detail.startX <= 50 && canStartHandler();\n };\n var onMove = function (detail) {\n // set the transition animation's progress\n var delta = detail.deltaX;\n var stepValue = delta / win.innerWidth;\n onMoveHandler(stepValue);\n };\n var onEnd = function (detail) {\n // the swipe back gesture has ended\n var delta = detail.deltaX;\n var width = win.innerWidth;\n var stepValue = delta / width;\n var velocity = detail.velocityX;\n var z = width / 2.0;\n var shouldComplete = velocity >= 0 && (velocity > 0.2 || detail.deltaX > z);\n var missing = shouldComplete ? 1 - stepValue : stepValue;\n var missingDistance = missing * width;\n var realDur = 0;\n if (missingDistance > 5) {\n var dur = missingDistance / Math.abs(velocity);\n realDur = Math.min(dur, 540);\n }\n /**\n * TODO: stepValue can sometimes return negative values\n * or values greater than 1 which should not be possible.\n * Need to investigate more to find where the issue is.\n */\n onEndHandler(shouldComplete, (stepValue <= 0) ? 0.01 : clamp(0, stepValue, 0.9999), realDur);\n };\n return createGesture({\n el: el,\n gestureName: 'goback-swipe',\n gesturePriority: 40,\n threshold: 10,\n canStart: canStart,\n onStart: onStartHandler,\n onMove: onMove,\n onEnd: onEnd\n });\n};\nexport { createSwipeBackGesture };\n"],"sourceRoot":""}