import{__read as n}from"../../../../../node_modules/tslib/tslib.es6.js";import{mix as i}from"../../../../../../popmotion/dist/es/utils/mix.js";function m(n,m,t){var r=m.min,o=m.max;return void 0!==r&&n<r?n=t?i(r,n,t.min):Math.max(n,r):void 0!==o&&n>o&&(n=t?i(o,n,t.max):Math.min(n,o)),n}function t(n,i,t,r,o){var a=n-i*t;return r?m(a,r,o):a}function r(n,i,m){return{min:void 0!==i?n.min+i:void 0,max:void 0!==m?n.max+m-(n.max-n.min):void 0}}function o(n,i){var m=i.top,t=i.left,o=i.bottom,a=i.right;return{x:r(n.x,t,a),y:r(n.y,m,o)}}function a(i,m){var t,r=m.min-i.min,o=m.max-i.max;return m.max-m.min<i.max-i.min&&(r=(t=n([o,r],2))[0],o=t[1]),{min:i.min+r,max:i.min+o}}function u(n,i){return{x:a(n.x,i.x),y:a(n.y,i.y)}}function x(n,m,t){var r=n.max-n.min,o=i(m.min,m.max-r,t);return{min:o,max:o+r}}function e(n,i){var m={};return void 0!==i.min&&(m.min=i.min-n.min),void 0!==i.max&&(m.max=i.max-n.min),m}var v=.35;function f(n){return!1===n?n=0:!0===n&&(n=.35),{x:d(n,"left","right"),y:d(n,"top","bottom")}}function d(n,i,m){return{min:c(n,i),max:c(n,m)}}function c(n,i){var m;return"number"==typeof n?n:null!==(m=n[i])&&void 0!==m?m:0}export{m as applyConstraints,t as calcConstrainedMinPoint,x as calcPositionFromProgress,r as calcRelativeAxisConstraints,o as calcRelativeConstraints,a as calcViewportAxisConstraints,u as calcViewportConstraints,v as defaultElastic,e as rebaseAxisConstraints,d as resolveAxisElastic,f as resolveDragElastic,c as resolvePointElastic};
//# sourceMappingURL=constraints.js.map
