{"ast":null,"code":"import { __assign, __extends } from \"tslib\";\nimport { clamp, debounce } from '../../utils';\nimport { ScrollbarPlugin } from 'smooth-scrollbar';\nimport { Bounce } from './bounce';\nimport { Glow } from './glow';\nexport var OverscrollEffect;\n(function (OverscrollEffect) {\n  OverscrollEffect[\"BOUNCE\"] = \"bounce\";\n  OverscrollEffect[\"GLOW\"] = \"glow\";\n})(OverscrollEffect || (OverscrollEffect = {}));\nvar ALLOWED_EVENTS = /wheel|touch/;\nvar OverscrollPlugin = /** @class */function (_super) {\n  __extends(OverscrollPlugin, _super);\n  function OverscrollPlugin() {\n    var _this = _super !== null && _super.apply(this, arguments) || this;\n    _this._glow = new Glow(_this.scrollbar);\n    _this._bounce = new Bounce(_this.scrollbar);\n    _this._wheelScrollBack = {\n      x: false,\n      y: false\n    };\n    _this._lockWheel = {\n      x: false,\n      y: false\n    };\n    _this._touching = false;\n    _this._amplitude = {\n      x: 0,\n      y: 0\n    };\n    _this._position = {\n      x: 0,\n      y: 0\n    };\n    // since we can't detect whether user release touchpad\n    // handle it with debounce is the best solution now, as a trade-off\n    _this._releaseWheel = debounce(function () {\n      _this._lockWheel.x = false;\n      _this._lockWheel.y = false;\n    }, 30);\n    return _this;\n  }\n  Object.defineProperty(OverscrollPlugin.prototype, \"_isWheelLocked\", {\n    get: function () {\n      return this._lockWheel.x || this._lockWheel.y;\n    },\n    enumerable: true,\n    configurable: true\n  });\n  Object.defineProperty(OverscrollPlugin.prototype, \"_enabled\", {\n    get: function () {\n      return !!this.options.effect;\n    },\n    enumerable: true,\n    configurable: true\n  });\n  OverscrollPlugin.prototype.onInit = function () {\n    var _a = this,\n      _glow = _a._glow,\n      options = _a.options,\n      scrollbar = _a.scrollbar;\n    // observe\n    var effect = options.effect;\n    Object.defineProperty(options, 'effect', {\n      get: function () {\n        return effect;\n      },\n      set: function (val) {\n        if (!val) {\n          effect = undefined;\n          return;\n        }\n        if (val !== OverscrollEffect.BOUNCE && val !== OverscrollEffect.GLOW) {\n          throw new TypeError(\"unknow overscroll effect: \" + val);\n        }\n        effect = val;\n        scrollbar.options.continuousScrolling = false;\n        if (val === OverscrollEffect.GLOW) {\n          _glow.mount();\n          _glow.adjust();\n        } else {\n          _glow.unmount();\n        }\n      }\n    });\n    options.effect = effect; // init\n  };\n\n  OverscrollPlugin.prototype.onUpdate = function () {\n    if (this.options.effect === OverscrollEffect.GLOW) {\n      this._glow.adjust();\n    }\n  };\n  OverscrollPlugin.prototype.onRender = function (remainMomentum) {\n    if (!this._enabled) {\n      return;\n    }\n    if (this.scrollbar.options.continuousScrolling) {\n      // turn off continuous scrolling\n      this.scrollbar.options.continuousScrolling = false;\n    }\n    var nextX = remainMomentum.x,\n      nextY = remainMomentum.y;\n    // transfer remain momentum to overscroll\n    if (!this._amplitude.x && this._willOverscroll('x', remainMomentum.x)) {\n      nextX = 0;\n      this._absorbMomentum('x', remainMomentum.x);\n    }\n    if (!this._amplitude.y && this._willOverscroll('y', remainMomentum.y)) {\n      nextY = 0;\n      this._absorbMomentum('y', remainMomentum.y);\n    }\n    this.scrollbar.setMomentum(nextX, nextY);\n    this._render();\n  };\n  OverscrollPlugin.prototype.transformDelta = function (delta, fromEvent) {\n    this._lastEventType = fromEvent.type;\n    if (!this._enabled || !ALLOWED_EVENTS.test(fromEvent.type)) {\n      return delta;\n    }\n    if (this._isWheelLocked && /wheel/.test(fromEvent.type)) {\n      this._releaseWheel();\n      if (this._willOverscroll('x', delta.x)) {\n        delta.x = 0;\n      }\n      if (this._willOverscroll('y', delta.y)) {\n        delta.y = 0;\n      }\n    }\n    var nextX = delta.x,\n      nextY = delta.y;\n    if (this._willOverscroll('x', delta.x)) {\n      nextX = 0;\n      this._addAmplitude('x', delta.x);\n    }\n    if (this._willOverscroll('y', delta.y)) {\n      nextY = 0;\n      this._addAmplitude('y', delta.y);\n    }\n    switch (fromEvent.type) {\n      case 'touchstart':\n      case 'touchmove':\n        this._touching = true;\n        this._glow.recordTouch(fromEvent);\n        break;\n      case 'touchcancel':\n      case 'touchend':\n        this._touching = false;\n        break;\n    }\n    return {\n      x: nextX,\n      y: nextY\n    };\n  };\n  OverscrollPlugin.prototype._willOverscroll = function (direction, delta) {\n    if (!delta) {\n      return false;\n    }\n    // away from origin\n    if (this._position[direction]) {\n      return true;\n    }\n    var offset = this.scrollbar.offset[direction];\n    var limit = this.scrollbar.limit[direction];\n    if (limit === 0) {\n      return false;\n    }\n    // cond:\n    //  1. next scrolling position is supposed to stay unchange\n    //  2. current position is on the edge\n    return clamp(offset + delta, 0, limit) === offset && (offset === 0 || offset === limit);\n  };\n  OverscrollPlugin.prototype._absorbMomentum = function (direction, remainMomentum) {\n    var _a = this,\n      options = _a.options,\n      _lastEventType = _a._lastEventType,\n      _amplitude = _a._amplitude;\n    if (!ALLOWED_EVENTS.test(_lastEventType)) {\n      return;\n    }\n    _amplitude[direction] = clamp(remainMomentum, -options.maxOverscroll, options.maxOverscroll);\n  };\n  OverscrollPlugin.prototype._addAmplitude = function (direction, delta) {\n    var _a = this,\n      options = _a.options,\n      scrollbar = _a.scrollbar,\n      _amplitude = _a._amplitude,\n      _position = _a._position;\n    var currentAmp = _amplitude[direction];\n    var isOpposite = delta * currentAmp < 0;\n    var friction;\n    if (isOpposite) {\n      // opposite direction\n      friction = 0;\n    } else {\n      friction = this._wheelScrollBack[direction] ? 1 : Math.abs(currentAmp / options.maxOverscroll);\n    }\n    var amp = currentAmp + delta * (1 - friction);\n    _amplitude[direction] = scrollbar.offset[direction] === 0 ? /*    top | left  */clamp(amp, -options.maxOverscroll, 0) : /* bottom | right */clamp(amp, 0, options.maxOverscroll);\n    if (isOpposite) {\n      // scroll back\n      _position[direction] = _amplitude[direction];\n    }\n  };\n  OverscrollPlugin.prototype._render = function () {\n    var _a = this,\n      options = _a.options,\n      _amplitude = _a._amplitude,\n      _position = _a._position;\n    if (this._enabled && (_amplitude.x || _amplitude.y || _position.x || _position.y)) {\n      var nextX = this._nextAmp('x');\n      var nextY = this._nextAmp('y');\n      _amplitude.x = nextX.amplitude;\n      _position.x = nextX.position;\n      _amplitude.y = nextY.amplitude;\n      _position.y = nextY.position;\n      switch (options.effect) {\n        case OverscrollEffect.BOUNCE:\n          this._bounce.render(_position);\n          break;\n        case OverscrollEffect.GLOW:\n          this._glow.render(_position, this.options.glowColor);\n          break;\n      }\n      if (typeof options.onScroll === 'function') {\n        options.onScroll.call(this, __assign({}, _position));\n      }\n    }\n  };\n  OverscrollPlugin.prototype._nextAmp = function (direction) {\n    var _a = this,\n      options = _a.options,\n      _amplitude = _a._amplitude,\n      _position = _a._position;\n    var t = 1 - options.damping;\n    var amp = _amplitude[direction];\n    var pos = _position[direction];\n    var nextAmp = this._touching ? amp : amp * t | 0;\n    var distance = nextAmp - pos;\n    var nextPos = pos + distance - (distance * t | 0);\n    if (!this._touching && Math.abs(nextPos) < Math.abs(pos)) {\n      this._wheelScrollBack[direction] = true;\n    }\n    if (this._wheelScrollBack[direction] && Math.abs(nextPos) <= 1) {\n      this._wheelScrollBack[direction] = false;\n      this._lockWheel[direction] = true;\n    }\n    return {\n      amplitude: nextAmp,\n      position: nextPos\n    };\n  };\n  OverscrollPlugin.pluginName = 'overscroll';\n  OverscrollPlugin.defaultOptions = {\n    effect: OverscrollEffect.BOUNCE,\n    onScroll: undefined,\n    damping: 0.2,\n    maxOverscroll: 150,\n    glowColor: '#87ceeb'\n  };\n  return OverscrollPlugin;\n}(ScrollbarPlugin);\nexport default OverscrollPlugin;","map":{"version":3,"names":["clamp","debounce","ScrollbarPlugin","Bounce","Glow","OverscrollEffect","ALLOWED_EVENTS","OverscrollPlugin","_super","__extends","_this","apply","arguments","_glow","scrollbar","_bounce","_wheelScrollBack","x","y","_lockWheel","_touching","_amplitude","_position","_releaseWheel","Object","defineProperty","prototype","get","options","effect","onInit","_a","set","val","undefined","BOUNCE","GLOW","TypeError","continuousScrolling","mount","adjust","unmount","onUpdate","onRender","remainMomentum","_enabled","nextX","nextY","_willOverscroll","_absorbMomentum","setMomentum","_render","transformDelta","delta","fromEvent","_lastEventType","type","test","_isWheelLocked","_addAmplitude","recordTouch","direction","offset","limit","maxOverscroll","currentAmp","isOpposite","friction","Math","abs","amp","_nextAmp","amplitude","position","render","glowColor","onScroll","call","__assign","t","damping","pos","nextAmp","distance","nextPos","pluginName","defaultOptions"],"sources":["C:\\Users\\user\\Desktop\\000newport\\node_modules\\smooth-scrollbar\\src\\plugins\\overscroll\\index.ts"],"sourcesContent":["import { clamp, debounce } from '../../utils';\nimport { ScrollbarPlugin } from 'smooth-scrollbar';\nimport { Bounce } from './bounce';\nimport { Glow } from './glow';\n\nexport enum OverscrollEffect {\n  BOUNCE = 'bounce',\n  GLOW = 'glow',\n}\n\nexport type Data2d = {\n  x: number,\n  y: number,\n};\n\nexport type OnScrollCallback = (this: OverscrollPlugin, position: Data2d) => void;\n\nexport type OverscrollOptions = {\n  effect?: OverscrollEffect,\n  onScroll?: OnScrollCallback,\n  damping: number,\n  maxOverscroll: number,\n  glowColor: string,\n};\n\nconst ALLOWED_EVENTS = /wheel|touch/;\n\nexport default class OverscrollPlugin extends ScrollbarPlugin {\n  static pluginName = 'overscroll';\n\n  static defaultOptions: OverscrollOptions = {\n    effect: OverscrollEffect.BOUNCE,\n    onScroll: undefined,\n    damping: 0.2,\n    maxOverscroll: 150,\n    glowColor: '#87ceeb',\n  };\n\n  options: OverscrollOptions;\n\n  private _glow = new Glow(this.scrollbar);\n  private _bounce = new Bounce(this.scrollbar);\n\n  private _wheelScrollBack = {\n    x: false,\n    y: false,\n  };\n  private _lockWheel = {\n    x: false,\n    y: false,\n  };\n\n  private get _isWheelLocked() {\n    return this._lockWheel.x || this._lockWheel.y;\n  }\n\n  private _touching = false;\n\n  private _lastEventType: string;\n\n  private _amplitude = {\n    x: 0,\n    y: 0,\n  };\n\n  private _position = {\n    x: 0,\n    y: 0,\n  };\n\n  private get _enabled() {\n    return !!this.options.effect;\n  }\n\n  // since we can't detect whether user release touchpad\n  // handle it with debounce is the best solution now, as a trade-off\n  private _releaseWheel = debounce(() => {\n    this._lockWheel.x = false;\n    this._lockWheel.y = false;\n  }, 30);\n\n  onInit() {\n    const {\n      _glow,\n      options,\n      scrollbar,\n    } = this;\n\n    // observe\n    let effect = options.effect;\n\n    Object.defineProperty(options, 'effect', {\n      get() {\n        return effect;\n      },\n      set(val) {\n        if (!val) {\n          effect = undefined;\n          return;\n        }\n\n        if (val !== OverscrollEffect.BOUNCE && val !== OverscrollEffect.GLOW) {\n          throw new TypeError(`unknow overscroll effect: ${val}`);\n        }\n\n        effect = val;\n\n        scrollbar.options.continuousScrolling = false;\n\n        if (val === OverscrollEffect.GLOW) {\n          _glow.mount();\n          _glow.adjust();\n        } else {\n          _glow.unmount();\n        }\n      },\n    });\n\n    options.effect = effect; // init\n  }\n\n  onUpdate() {\n    if (this.options.effect === OverscrollEffect.GLOW) {\n      this._glow.adjust();\n    }\n  }\n\n  onRender(remainMomentum: Data2d) {\n    if (!this._enabled) {\n      return;\n    }\n\n    if (this.scrollbar.options.continuousScrolling) {\n      // turn off continuous scrolling\n      this.scrollbar.options.continuousScrolling = false;\n    }\n\n    let { x: nextX, y: nextY } = remainMomentum;\n\n    // transfer remain momentum to overscroll\n    if (!this._amplitude.x &&\n        this._willOverscroll('x', remainMomentum.x)\n    ) {\n      nextX = 0;\n\n      this._absorbMomentum('x', remainMomentum.x);\n    }\n\n    if (!this._amplitude.y &&\n        this._willOverscroll('y', remainMomentum.y)\n    ) {\n      nextY = 0;\n\n      this._absorbMomentum('y', remainMomentum.y);\n    }\n\n    this.scrollbar.setMomentum(nextX, nextY);\n    this._render();\n  }\n\n  transformDelta(delta: Data2d, fromEvent: Event): Data2d {\n    this._lastEventType = fromEvent.type;\n\n    if (!this._enabled || !ALLOWED_EVENTS.test(fromEvent.type)) {\n      return delta;\n    }\n\n    if (this._isWheelLocked && /wheel/.test(fromEvent.type)) {\n      this._releaseWheel();\n\n      if (this._willOverscroll('x', delta.x)) {\n        delta.x = 0;\n      }\n\n      if (this._willOverscroll('y', delta.y)) {\n        delta.y = 0;\n      }\n    }\n\n    let { x: nextX, y: nextY } = delta;\n\n    if (this._willOverscroll('x', delta.x)) {\n      nextX = 0;\n      this._addAmplitude('x', delta.x);\n    }\n\n    if (this._willOverscroll('y', delta.y)) {\n      nextY = 0;\n      this._addAmplitude('y', delta.y);\n    }\n\n    switch (fromEvent.type) {\n      case 'touchstart':\n      case 'touchmove':\n        this._touching = true;\n        this._glow.recordTouch(fromEvent as TouchEvent);\n        break;\n\n      case 'touchcancel':\n      case 'touchend':\n        this._touching = false;\n        break;\n    }\n\n    return {\n      x: nextX,\n      y: nextY,\n    };\n  }\n\n  private _willOverscroll(direction: 'x' | 'y', delta: number): boolean {\n    if (!delta) {\n      return false;\n    }\n\n    // away from origin\n    if (this._position[direction]) {\n      return true;\n    }\n\n    const offset = this.scrollbar.offset[direction];\n    const limit = this.scrollbar.limit[direction];\n\n    if (limit === 0) {\n      return false;\n    }\n\n    // cond:\n    //  1. next scrolling position is supposed to stay unchange\n    //  2. current position is on the edge\n    return clamp(offset + delta, 0, limit) === offset &&\n        (offset === 0 || offset === limit);\n  }\n\n  private _absorbMomentum(direction: 'x' | 'y', remainMomentum: number) {\n    const {\n      options,\n      _lastEventType,\n      _amplitude,\n    } = this;\n\n    if (!ALLOWED_EVENTS.test(_lastEventType)) {\n      return;\n    }\n\n    _amplitude[direction] = clamp(remainMomentum, -options.maxOverscroll, options.maxOverscroll);\n  }\n\n  private _addAmplitude(direction: 'x' | 'y', delta: number) {\n    const {\n      options,\n      scrollbar,\n      _amplitude,\n      _position,\n    } = this;\n\n    const currentAmp = _amplitude[direction];\n\n    const isOpposite = delta * currentAmp < 0;\n\n    let friction: number;\n\n    if (isOpposite) {\n      // opposite direction\n      friction = 0;\n    } else {\n      friction = this._wheelScrollBack[direction] ?\n        1 : Math.abs(currentAmp / options.maxOverscroll);\n    }\n\n    const amp = currentAmp + delta * (1 - friction);\n\n    _amplitude[direction] = scrollbar.offset[direction] === 0 ?\n      /*    top | left  */ clamp(amp, -options.maxOverscroll, 0) :\n      /* bottom | right */ clamp(amp, 0, options.maxOverscroll);\n\n    if (isOpposite) {\n      // scroll back\n      _position[direction] = _amplitude[direction];\n    }\n  }\n\n  private _render() {\n    const {\n      options,\n      _amplitude,\n      _position,\n    } = this;\n\n    if (this._enabled &&\n        (_amplitude.x || _amplitude.y || _position.x || _position.y)\n    ) {\n      const nextX = this._nextAmp('x');\n      const nextY = this._nextAmp('y');\n\n      _amplitude.x = nextX.amplitude;\n      _position.x = nextX.position;\n\n      _amplitude.y = nextY.amplitude;\n      _position.y = nextY.position;\n\n      switch (options.effect) {\n        case OverscrollEffect.BOUNCE:\n          this._bounce.render(_position);\n          break;\n\n        case OverscrollEffect.GLOW:\n          this._glow.render(_position, this.options.glowColor);\n          break;\n      }\n\n      if (typeof options.onScroll === 'function') {\n        options.onScroll.call(this, { ..._position });\n      }\n    }\n  }\n\n  private _nextAmp(direction: 'x' | 'y'): { amplitude: number, position: number } {\n    const {\n      options,\n      _amplitude,\n      _position,\n    } = this;\n\n    const t = 1 - options.damping;\n    const amp = _amplitude[direction];\n    const pos = _position[direction];\n\n    const nextAmp = this._touching ? amp : (amp * t | 0);\n    const distance = nextAmp - pos;\n    const nextPos = pos + distance - (distance * t | 0);\n\n    if (!this._touching && Math.abs(nextPos) < Math.abs(pos)) {\n      this._wheelScrollBack[direction] = true;\n    }\n\n    if (this._wheelScrollBack[direction] && Math.abs(nextPos) <= 1) {\n      this._wheelScrollBack[direction] = false;\n      this._lockWheel[direction] = true;\n    }\n\n    return {\n      amplitude: nextAmp,\n      position: nextPos,\n    };\n  }\n}\n"],"mappings":";AAAA,SAASA,KAAK,EAAEC,QAAQ,QAAQ,aAAa;AAC7C,SAASC,eAAe,QAAQ,kBAAkB;AAClD,SAASC,MAAM,QAAQ,UAAU;AACjC,SAASC,IAAI,QAAQ,QAAQ;AAE7B,WAAYC,gBAGX;AAHD,WAAYA,gBAAgB;EAC1BA,gBAAA,qBAAiB;EACjBA,gBAAA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