1const screen = { 2 isPhone: false, 3 isTablet: false, 4 isMobile: false, 5 isDesktop: false, 6 isPhonePlus: false, 7 isIphone: false, 8 isSafariDesktop: false, 9 isMacChrome: false, 10 isMac: false, 11 isFirefox: false, 12 size: "", 13 width: 0, 14 height: 0, 15 tresholdPhone: 768, 16 tresholdTablet: 1025, 17 isIpadPro: false 18}; 19// const uA = navigator.userAgent; 20// const vendor = navigator.vendor; 21const uA = typeof navigator !== "undefined" && navigator.userAgent; 22const vendor = typeof navigator !== "undefined" && navigator.vendor; 23const isIpadPro = () => { 24 return /Macintosh/.test(uA) && "ontouchend" in document; 25}; 26const isMobileUserAgent = /iPhone|iPad|iPod|Android/i.test(uA) || isIpadPro(); 27screen.isSafariDesktop = /Safari/i.test(uA) && /Apple Computer/.test(vendor) && !/Mobi|Android/i.test(uA); 28screen.isMac = typeof navigator !== "undefined" && navigator.userAgent.indexOf("Mac OS X") != -1; 29screen.isIphone = typeof navigator !== "undefined" && navigator.userAgent.match(/iPhone/i); 30screen.isIpadPro = isIpadPro(); 31if (screen.isMac && window.chrome) { 32 screen.isMac = false; 33 screen.isMacChrome = true; 34} 35screen.isFirefox = typeof navigator !== "undefined" && navigator.userAgent.toLowerCase().indexOf("firefox") > -1; 36const size = function() { 37 let w = window.innerWidth; 38 let h = window.innerHeight; 39 screen.isPhone = w < screen.tresholdPhone; 40 screen.isTablet = w >= screen.tresholdPhone && w <= screen.tresholdTablet || screen.isIpadPro; 41 screen.isMobile = w <= screen.tresholdTablet || isMobileUserAgent; 42 screen.isDesktop = w >= screen.tresholdTablet && !screen.isIpadPro; 43 screen.phonePlus = w >= screen.tresholdPhone; 44 if (screen.isPhone) 45 screen.size = "phone"; 46 if (screen.isTablet) 47 screen.size = "tablet"; 48 if (screen.isDesktop) 49 screen.size = "desktop"; 50 screen.width = w; 51 screen.height = h; 52}; 53window.addEventListener("resize", size); 54size(); 55function _assertThisInitialized(self) { 56 if (self === void 0) { 57 throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); 58 } 59 return self; 60} 61function _inheritsLoose(subClass, superClass) { 62 subClass.prototype = Object.create(superClass.prototype); 63 subClass.prototype.constructor = subClass; 64 subClass.__proto__ = superClass; 65} 66/*! 67 * GSAP 3.12.5 68 * https://gsap.com 69 * 70 * @license Copyright 2008-2024, GreenSock. All rights reserved. 71 * Subject to the terms at https://gsap.com/standard-license or for 72 * Club GSAP members, the agreement issued with that membership. 73 * @author: Jack Doyle, [email protected] 74*/ 75var _config = { 76 autoSleep: 120, 77 force3D: "auto", 78 nullTargetWarn: 1, 79 units: { 80 lineHeight: "" 81 } 82}, _defaults$1 = { 83 duration: 0.5, 84 overwrite: false, 85 delay: 0 86}, _suppressOverwrites$1, _reverting$1, _context$3, _bigNum$1 = 1e8, _tinyNum = 1 / _bigNum$1, _2PI = Math.PI * 2, _HALF_PI = _2PI / 4, _gsID = 0, _sqrt = Math.sqrt, _cos = Math.cos, _sin = Math.sin, _isString$1 = function _isString(value) { 87 return typeof value === "string"; 88}, _isFunction$1 = function _isFunction(value) { 89 return typeof value === "function"; 90}, _isNumber$1 = function _isNumber(value) { 91 return typeof value === "number"; 92}, _isUndefined = function _isUndefined2(value) { 93 return typeof value === "undefined"; 94}, _isObject$1 = function _isObject(value) { 95 return typeof value === "object"; 96}, _isNotFalse = function _isNotFalse2(value) { 97 return value !== false; 98}, _windowExists$3 = function _windowExists() { 99 return typeof window !== "undefined"; 100}, _isFuncOrString = function _isFuncOrString2(value) { 101 return _isFunction$1(value) || _isString$1(value); 102}, _isTypedArray = typeof ArrayBuffer === "function" && ArrayBuffer.isView || function() { 103}, _isArray = Array.isArray, _strictNumExp = /(?:-?\.?\d|\.)+/gi, _numExp = /[-+=.]*\d+[.e\-+]*\d*[e\-+]*\d*/g, _numWithUnitExp = /[-+=.]*\d+[.e-]*\d*[a-z%]*/g, _complexStringNumExp = /[-+=.]*\d+\.?\d*(?:e-|e\+)?\d*/gi, _relExp = /[+-]=-?[.\d]+/, _delimitedValueExp = /[^,'"\[\]\s]+/gi, _unitExp = /^[+\-=e\s\d]*\d+[.\d]*([a-z]*|%)\s*$/i, _globalTimeline, _win$4, _coreInitted$3, _doc$4, _globals = {}, _installScope = {}, _coreReady, _install = function _install2(scope) {
vendor: 22,307 bytes, lines 104-581
104 return (_installScope = _merge(scope, _globals)) && gsap$3; 105}, _missingPlugin = function _missingPlugin2(property, value) { 106 return console.warn("Invalid property", property, "set to", value, "Missing plugin? gsap.registerPlugin()"); 107}, _warn = function _warn2(message, suppress) { 108 return !suppress && console.warn(message); 109}, _addGlobal = function _addGlobal2(name, obj) { 110 return name && (_globals[name] = obj) && _installScope && (_installScope[name] = obj) || _globals; 111}, _emptyFunc = function _emptyFunc2() { 112 return 0; 113}, _startAtRevertConfig = { 114 suppressEvents: true, 115 isStart: true, 116 kill: false 117}, _revertConfigNoKill = { 118 suppressEvents: true, 119 kill: false 120}, _revertConfig = { 121 suppressEvents: true 122}, _reservedProps = {}, _lazyTweens = [], _lazyLookup = {}, _lastRenderedFrame, _plugins = {}, _effects = {}, _nextGCFrame = 30, _harnessPlugins = [], _callbackNames = "", _harness = function _harness2(targets) { 123 var target = targets[0], harnessPlugin, i; 124 _isObject$1(target) || _isFunction$1(target) || (targets = [targets]); 125 if (!(harnessPlugin = (target._gsap || {}).harness)) { 126 i = _harnessPlugins.length; 127 while (i-- && !_harnessPlugins[i].targetTest(target)) { 128 } 129 harnessPlugin = _harnessPlugins[i]; 130 } 131 i = targets.length; 132 while (i--) { 133 targets[i] && (targets[i]._gsap || (targets[i]._gsap = new GSCache(targets[i], harnessPlugin))) || targets.splice(i, 1); 134 } 135 return targets; 136}, _getCache = function _getCache2(target) { 137 return target._gsap || _harness(toArray(target))[0]._gsap; 138}, _getProperty = function _getProperty2(target, property, v) { 139 return (v = target[property]) && _isFunction$1(v) ? target[property]() : _isUndefined(v) && target.getAttribute && target.getAttribute(property) || v; 140}, _forEachName = function _forEachName2(names, func) { 141 return (names = names.split(",")).forEach(func) || names; 142}, _round$2 = function _round(value) { 143 return Math.round(value * 1e5) / 1e5 || 0; 144}, _roundPrecise = function _roundPrecise2(value) { 145 return Math.round(value * 1e7) / 1e7 || 0; 146}, _parseRelative = function _parseRelative2(start, value) { 147 var operator = value.charAt(0), end = parseFloat(value.substr(2)); 148 start = parseFloat(start); 149 return operator === "+" ? start + end : operator === "-" ? start - end : operator === "*" ? start * end : start / end; 150}, _arrayContainsAny = function _arrayContainsAny2(toSearch, toFind) { 151 var l = toFind.length, i = 0; 152 for (; toSearch.indexOf(toFind[i]) < 0 && ++i < l; ) { 153 } 154 return i < l; 155}, _lazyRender = function _lazyRender2() { 156 var l = _lazyTweens.length, a = _lazyTweens.slice(0), i, tween; 157 _lazyLookup = {}; 158 _lazyTweens.length = 0; 159 for (i = 0; i < l; i++) { 160 tween = a[i]; 161 tween && tween._lazy && (tween.render(tween._lazy[0], tween._lazy[1], true)._lazy = 0); 162 } 163}, _lazySafeRender = function _lazySafeRender2(animation, time, suppressEvents, force) { 164 _lazyTweens.length && !_reverting$1 && _lazyRender(); 165 animation.render(time, suppressEvents, force || _reverting$1 && time < 0 && (animation._initted || animation._startAt)); 166 _lazyTweens.length && !_reverting$1 && _lazyRender(); 167}, _numericIfPossible = function _numericIfPossible2(value) { 168 var n = parseFloat(value); 169 return (n || n === 0) && (value + "").match(_delimitedValueExp).length < 2 ? n : _isString$1(value) ? value.trim() : value; 170}, _passThrough$1 = function _passThrough(p) { 171 return p; 172}, _setDefaults$1 = function _setDefaults(obj, defaults2) { 173 for (var p in defaults2) { 174 p in obj || (obj[p] = defaults2[p]); 175 } 176 return obj; 177}, _setKeyframeDefaults = function _setKeyframeDefaults2(excludeDuration) { 178 return function(obj, defaults2) { 179 for (var p in defaults2) { 180 p in obj || p === "duration" && excludeDuration || p === "ease" || (obj[p] = defaults2[p]); 181 } 182 }; 183}, _merge = function _merge2(base, toMerge) { 184 for (var p in toMerge) { 185 base[p] = toMerge[p]; 186 } 187 return base; 188}, _mergeDeep = function _mergeDeep2(base, toMerge) { 189 for (var p in toMerge) { 190 p !== "__proto__" && p !== "constructor" && p !== "prototype" && (base[p] = _isObject$1(toMerge[p]) ? _mergeDeep2(base[p] || (base[p] = {}), toMerge[p]) : toMerge[p]); 191 } 192 return base; 193}, _copyExcluding = function _copyExcluding2(obj, excluding) { 194 var copy = {}, p; 195 for (p in obj) { 196 p in excluding || (copy[p] = obj[p]); 197 } 198 return copy; 199}, _inheritDefaults = function _inheritDefaults2(vars) { 200 var parent = vars.parent || _globalTimeline, func = vars.keyframes ? _setKeyframeDefaults(_isArray(vars.keyframes)) : _setDefaults$1; 201 if (_isNotFalse(vars.inherit)) { 202 while (parent) { 203 func(vars, parent.vars.defaults); 204 parent = parent.parent || parent._dp; 205 } 206 } 207 return vars; 208}, _arraysMatch = function _arraysMatch2(a1, a2) { 209 var i = a1.length, match = i === a2.length; 210 while (match && i-- && a1[i] === a2[i]) { 211 } 212 return i < 0; 213}, _addLinkedListItem = function _addLinkedListItem2(parent, child, firstProp, lastProp, sortBy) { 214 if (firstProp === void 0) { 215 firstProp = "_first"; 216 } 217 if (lastProp === void 0) { 218 lastProp = "_last"; 219 } 220 var prev = parent[lastProp], t; 221 if (sortBy) { 222 t = child[sortBy]; 223 while (prev && prev[sortBy] > t) { 224 prev = prev._prev; 225 } 226 } 227 if (prev) { 228 child._next = prev._next; 229 prev._next = child; 230 } else { 231 child._next = parent[firstProp]; 232 parent[firstProp] = child; 233 } 234 if (child._next) { 235 child._next._prev = child; 236 } else { 237 parent[lastProp] = child; 238 } 239 child._prev = prev; 240 child.parent = child._dp = parent; 241 return child; 242}, _removeLinkedListItem = function _removeLinkedListItem2(parent, child, firstProp, lastProp) { 243 if (firstProp === void 0) { 244 firstProp = "_first"; 245 } 246 if (lastProp === void 0) { 247 lastProp = "_last"; 248 } 249 var prev = child._prev, next = child._next; 250 if (prev) { 251 prev._next = next; 252 } else if (parent[firstProp] === child) { 253 parent[firstProp] = next; 254 } 255 if (next) { 256 next._prev = prev; 257 } else if (parent[lastProp] === child) { 258 parent[lastProp] = prev; 259 } 260 child._next = child._prev = child.parent = null; 261}, _removeFromParent = function _removeFromParent2(child, onlyIfParentHasAutoRemove) { 262 child.parent && (!onlyIfParentHasAutoRemove || child.parent.autoRemoveChildren) && child.parent.remove && child.parent.remove(child); 263 child._act = 0; 264}, _uncache = function _uncache2(animation, child) { 265 if (animation && (!child || child._end > animation._dur || child._start < 0)) { 266 var a = animation; 267 while (a) { 268 a._dirty = 1; 269 a = a.parent; 270 } 271 } 272 return animation; 273}, _recacheAncestors = function _recacheAncestors2(animation) { 274 var parent = animation.parent; 275 while (parent && parent.parent) { 276 parent._dirty = 1; 277 parent.totalDuration(); 278 parent = parent.parent; 279 } 280 return animation; 281}, _rewindStartAt = function _rewindStartAt2(tween, totalTime, suppressEvents, force) { 282 return tween._startAt && (_reverting$1 ? tween._startAt.revert(_revertConfigNoKill) : tween.vars.immediateRender && !tween.vars.autoRevert || tween._startAt.render(totalTime, true, force)); 283}, _hasNoPausedAncestors = function _hasNoPausedAncestors2(animation) { 284 return !animation || animation._ts && _hasNoPausedAncestors2(animation.parent); 285}, _elapsedCycleDuration = function _elapsedCycleDuration2(animation) { 286 return animation._repeat ? _animationCycle(animation._tTime, animation = animation.duration() + animation._rDelay) * animation : 0; 287}, _animationCycle = function _animationCycle2(tTime, cycleDuration) { 288 var whole = Math.floor(tTime /= cycleDuration); 289 return tTime && whole === tTime ? whole - 1 : whole; 290}, _parentToChildTotalTime = function _parentToChildTotalTime2(parentTime, child) { 291 return (parentTime - child._start) * child._ts + (child._ts >= 0 ? 0 : child._dirty ? child.totalDuration() : child._tDur); 292}, _setEnd = function _setEnd2(animation) { 293 return animation._end = _roundPrecise(animation._start + (animation._tDur / Math.abs(animation._ts || animation._rts || _tinyNum) || 0)); 294}, _alignPlayhead = function _alignPlayhead2(animation, totalTime) { 295 var parent = animation._dp; 296 if (parent && parent.smoothChildTiming && animation._ts) { 297 animation._start = _roundPrecise(parent._time - (animation._ts > 0 ? totalTime / animation._ts : ((animation._dirty ? animation.totalDuration() : animation._tDur) - totalTime) / -animation._ts)); 298 _setEnd(animation); 299 parent._dirty || _uncache(parent, animation); 300 } 301 return animation; 302}, _postAddChecks = function _postAddChecks2(timeline2, child) { 303 var t; 304 if (child._time || !child._dur && child._initted || child._start < timeline2._time && (child._dur || !child.add)) { 305 t = _parentToChildTotalTime(timeline2.rawTime(), child); 306 if (!child._dur || _clamp$2(0, child.totalDuration(), t) - child._tTime > _tinyNum) { 307 child.render(t, true); 308 } 309 } 310 if (_uncache(timeline2, child)._dp && timeline2._initted && timeline2._time >= timeline2._dur && timeline2._ts) { 311 if (timeline2._dur < timeline2.duration()) { 312 t = timeline2; 313 while (t._dp) { 314 t.rawTime() >= 0 && t.totalTime(t._tTime); 315 t = t._dp; 316 } 317 } 318 timeline2._zTime = -_tinyNum; 319 } 320}, _addToTimeline = function _addToTimeline2(timeline2, child, position, skipChecks) { 321 child.parent && _removeFromParent(child); 322 child._start = _roundPrecise((_isNumber$1(position) ? position : position || timeline2 !== _globalTimeline ? _parsePosition$1(timeline2, position, child) : timeline2._time) + child._delay); 323 child._end = _roundPrecise(child._start + (child.totalDuration() / Math.abs(child.timeScale()) || 0)); 324 _addLinkedListItem(timeline2, child, "_first", "_last", timeline2._sort ? "_start" : 0); 325 _isFromOrFromStart(child) || (timeline2._recent = child); 326 skipChecks || _postAddChecks(timeline2, child); 327 timeline2._ts < 0 && _alignPlayhead(timeline2, timeline2._tTime); 328 return timeline2; 329}, _scrollTrigger = function _scrollTrigger2(animation, trigger) { 330 return (_globals.ScrollTrigger || _missingPlugin("scrollTrigger", trigger)) && _globals.ScrollTrigger.create(trigger, animation); 331}, _attemptInitTween = function _attemptInitTween2(tween, time, force, suppressEvents, tTime) { 332 _initTween(tween, time, tTime); 333 if (!tween._initted) { 334 return 1; 335 } 336 if (!force && tween._pt && !_reverting$1 && (tween._dur && tween.vars.lazy !== false || !tween._dur && tween.vars.lazy) && _lastRenderedFrame !== _ticker.frame) { 337 _lazyTweens.push(tween); 338 tween._lazy = [tTime, suppressEvents]; 339 return 1; 340 } 341}, _parentPlayheadIsBeforeStart = function _parentPlayheadIsBeforeStart2(_ref) { 342 var parent = _ref.parent; 343 return parent && parent._ts && parent._initted && !parent._lock && (parent.rawTime() < 0 || _parentPlayheadIsBeforeStart2(parent)); 344}, _isFromOrFromStart = function _isFromOrFromStart2(_ref2) { 345 var data = _ref2.data; 346 return data === "isFromStart" || data === "isStart"; 347}, _renderZeroDurationTween = function _renderZeroDurationTween2(tween, totalTime, suppressEvents, force) { 348 var prevRatio = tween.ratio, ratio = totalTime < 0 || !totalTime && (!tween._start && _parentPlayheadIsBeforeStart(tween) && !(!tween._initted && _isFromOrFromStart(tween)) || (tween._ts < 0 || tween._dp._ts < 0) && !_isFromOrFromStart(tween)) ? 0 : 1, repeatDelay = tween._rDelay, tTime = 0, pt, iteration, prevIteration; 349 if (repeatDelay && tween._repeat) { 350 tTime = _clamp$2(0, tween._tDur, totalTime); 351 iteration = _animationCycle(tTime, repeatDelay); 352 tween._yoyo && iteration & 1 && (ratio = 1 - ratio); 353 if (iteration !== _animationCycle(tween._tTime, repeatDelay)) { 354 prevRatio = 1 - ratio; 355 tween.vars.repeatRefresh && tween._initted && tween.invalidate(); 356 } 357 } 358 if (ratio !== prevRatio || _reverting$1 || force || tween._zTime === _tinyNum || !totalTime && tween._zTime) { 359 if (!tween._initted && _attemptInitTween(tween, totalTime, force, suppressEvents, tTime)) { 360 return; 361 } 362 prevIteration = tween._zTime; 363 tween._zTime = totalTime || (suppressEvents ? _tinyNum : 0); 364 suppressEvents || (suppressEvents = totalTime && !prevIteration); 365 tween.ratio = ratio; 366 tween._from && (ratio = 1 - ratio); 367 tween._time = 0; 368 tween._tTime = tTime; 369 pt = tween._pt; 370 while (pt) { 371 pt.r(ratio, pt.d); 372 pt = pt._next; 373 } 374 totalTime < 0 && _rewindStartAt(tween, totalTime, suppressEvents, true); 375 tween._onUpdate && !suppressEvents && _callback$1(tween, "onUpdate"); 376 tTime && tween._repeat && !suppressEvents && tween.parent && _callback$1(tween, "onRepeat"); 377 if ((totalTime >= tween._tDur || totalTime < 0) && tween.ratio === ratio) { 378 ratio && _removeFromParent(tween, 1); 379 if (!suppressEvents && !_reverting$1) { 380 _callback$1(tween, ratio ? "onComplete" : "onReverseComplete", true); 381 tween._prom && tween._prom(); 382 } 383 } 384 } else if (!tween._zTime) { 385 tween._zTime = totalTime; 386 } 387}, _findNextPauseTween = function _findNextPauseTween2(animation, prevTime, time) { 388 var child; 389 if (time > prevTime) { 390 child = animation._first; 391 while (child && child._start <= time) { 392 if (child.data === "isPause" && child._start > prevTime) { 393 return child; 394 } 395 child = child._next; 396 } 397 } else { 398 child = animation._last; 399 while (child && child._start >= time) { 400 if (child.data === "isPause" && child._start < prevTime) { 401 return child; 402 } 403 child = child._prev; 404 } 405 } 406}, _setDuration = function _setDuration2(animation, duration, skipUncache, leavePlayhead) { 407 var repeat = animation._repeat, dur = _roundPrecise(duration) || 0, totalProgress = animation._tTime / animation._tDur; 408 totalProgress && !leavePlayhead && (animation._time *= dur / animation._dur); 409 animation._dur = dur; 410 animation._tDur = !repeat ? dur : repeat < 0 ? 1e10 : _roundPrecise(dur * (repeat + 1) + animation._rDelay * repeat); 411 totalProgress > 0 && !leavePlayhead && _alignPlayhead(animation, animation._tTime = animation._tDur * totalProgress); 412 animation.parent && _setEnd(animation); 413 skipUncache || _uncache(animation.parent, animation); 414 return animation; 415}, _onUpdateTotalDuration = function _onUpdateTotalDuration2(animation) { 416 return animation instanceof Timeline ? _uncache(animation) : _setDuration(animation, animation._dur); 417}, _zeroPosition = { 418 _start: 0, 419 endTime: _emptyFunc, 420 totalDuration: _emptyFunc 421}, _parsePosition$1 = function _parsePosition(animation, position, percentAnimation) { 422 var labels = animation.labels, recent = animation._recent || _zeroPosition, clippedDuration = animation.duration() >= _bigNum$1 ? recent.endTime(false) : animation._dur, i, offset, isPercent; 423 if (_isString$1(position) && (isNaN(position) || position in labels)) { 424 offset = position.charAt(0); 425 isPercent = position.substr(-1) === "%"; 426 i = position.indexOf("="); 427 if (offset === "<" || offset === ">") { 428 i >= 0 && (position = position.replace(/=/, "")); 429 return (offset === "<" ? recent._start : recent.endTime(recent._repeat >= 0)) + (parseFloat(position.substr(1)) || 0) * (isPercent ? (i < 0 ? recent : percentAnimation).totalDuration() / 100 : 1); 430 } 431 if (i < 0) { 432 position in labels || (labels[position] = clippedDuration); 433 return labels[position]; 434 } 435 offset = parseFloat(position.charAt(i - 1) + position.substr(i + 1)); 436 if (isPercent && percentAnimation) { 437 offset = offset / 100 * (_isArray(percentAnimation) ? percentAnimation[0] : percentAnimation).totalDuration(); 438 } 439 return i > 1 ? _parsePosition(animation, position.substr(0, i - 1), percentAnimation) + offset : clippedDuration + offset; 440 } 441 return position == null ? clippedDuration : +position; 442}, _createTweenType = function _createTweenType2(type, params, timeline2) { 443 var isLegacy = _isNumber$1(params[1]), varsIndex = (isLegacy ? 2 : 1) + (type < 2 ? 0 : 1), vars = params[varsIndex], irVars, parent; 444 isLegacy && (vars.duration = params[1]); 445 vars.parent = timeline2; 446 if (type) { 447 irVars = vars; 448 parent = timeline2; 449 while (parent && !("immediateRender" in irVars)) { 450 irVars = parent.vars.defaults || {}; 451 parent = _isNotFalse(parent.vars.inherit) && parent.parent; 452 } 453 vars.immediateRender = _isNotFalse(irVars.immediateRender); 454 type < 2 ? vars.runBackwards = 1 : vars.startAt = params[varsIndex - 1]; 455 } 456 return new Tween(params[0], vars, params[varsIndex + 1]); 457}, _conditionalReturn = function _conditionalReturn2(value, func) { 458 return value || value === 0 ? func(value) : func; 459}, _clamp$2 = function _clamp(min, max, value) { 460 return value < min ? min : value > max ? max : value; 461}, getUnit = function getUnit2(value, v) { 462 return !_isString$1(value) || !(v = _unitExp.exec(value)) ? "" : v[1]; 463}, clamp = function clamp2(min, max, value) { 464 return _conditionalReturn(value, function(v) { 465 return _clamp$2(min, max, v); 466 }); 467}, _slice = [].slice, _isArrayLike = function _isArrayLike2(value, nonEmpty) { 468 return value && _isObject$1(value) && "length" in value && (!nonEmpty && !value.length || value.length - 1 in value && _isObject$1(value[0])) && !value.nodeType && value !== _win$4; 469}, _flatten = function _flatten2(ar, leaveStrings, accumulator) { 470 if (accumulator === void 0) { 471 accumulator = []; 472 } 473 return ar.forEach(function(value) { 474 var _accumulator; 475 return _isString$1(value) && !leaveStrings || _isArrayLike(value, 1) ? (_accumulator = accumulator).push.apply(_accumulator, toArray(value)) : accumulator.push(value); 476 }) || accumulator; 477}, toArray = function toArray2(value, scope, leaveStrings) { 478 return _context$3 && !scope && _context$3.selector ? _context$3.selector(value) : _isString$1(value) && !leaveStrings && (_coreInitted$3 || !_wake()) ? _slice.call((scope || _doc$4).querySelectorAll(value), 0) : _isArray(value) ? _flatten(value, leaveStrings) : _isArrayLike(value) ? _slice.call(value, 0) : value ? [value] : []; 479}, selector = function selector2(value) { 480 value = toArray(value)[0] || _warn("Invalid scope") || {}; 481 return function(v) { 482 var el = value.current || value.nativeElement || value; 483 return toArray(v, el.querySelectorAll ? el : el === value ? _warn("Invalid scope") || _doc$4.createElement("div") : value); 484 }; 485}, shuffle = function shuffle2(a) { 486 return a.sort(function() { 487 return 0.5 - Math.random(); 488 }); 489}, distribute = function distribute2(v) { 490 if (_isFunction$1(v)) { 491 return v; 492 } 493 var vars = _isObject$1(v) ? v : { 494 each: v 495 }, ease = _parseEase(vars.ease), from = vars.from || 0, base = parseFloat(vars.base) || 0, cache = {}, isDecimal = from > 0 && from < 1, ratios = isNaN(from) || isDecimal, axis = vars.axis, ratioX = from, ratioY = from; 496 if (_isString$1(from)) { 497 ratioX = ratioY = { 498 center: 0.5, 499 edges: 0.5, 500 end: 1 501 }[from] || 0; 502 } else if (!isDecimal && ratios) { 503 ratioX = from[0]; 504 ratioY = from[1]; 505 } 506 return function(i, target, a) { 507 var l = (a || vars).length, distances = cache[l], originX, originY, x, y, d, j, max, min, wrapAt; 508 if (!distances) { 509 wrapAt = vars.grid === "auto" ? 0 : (vars.grid || [1, _bigNum$1])[1]; 510 if (!wrapAt) { 511 max = -_bigNum$1; 512 while (max < (max = a[wrapAt++].getBoundingClientRect().left) && wrapAt < l) { 513 } 514 wrapAt < l && wrapAt--; 515 } 516 distances = cache[l] = []; 517 originX = ratios ? Math.min(wrapAt, l) * ratioX - 0.5 : from % wrapAt; 518 originY = wrapAt === _bigNum$1 ? 0 : ratios ? l * ratioY / wrapAt - 0.5 : from / wrapAt | 0; 519 max = 0; 520 min = _bigNum$1; 521 for (j = 0; j < l; j++) { 522 x = j % wrapAt - originX; 523 y = originY - (j / wrapAt | 0); 524 distances[j] = d = !axis ? _sqrt(x * x + y * y) : Math.abs(axis === "y" ? y : x); 525 d > max && (max = d); 526 d < min && (min = d); 527 } 528 from === "random" && shuffle(distances); 529 distances.max = max - min; 530 distances.min = min; 531 distances.v = l = (parseFloat(vars.amount) || parseFloat(vars.each) * (wrapAt > l ? l - 1 : !axis ? Math.max(wrapAt, l / wrapAt) : axis === "y" ? l / wrapAt : wrapAt) || 0) * (from === "edges" ? -1 : 1); 532 distances.b = l < 0 ? base - l : base; 533 distances.u = getUnit(vars.amount || vars.each) || 0; 534 ease = ease && l < 0 ? _invertEase(ease) : ease; 535 } 536 l = (distances[i] - distances.min) / distances.max || 0; 537 return _roundPrecise(distances.b + (ease ? ease(l) : l) * distances.v) + distances.u; 538 }; 539}, _roundModifier = function _roundModifier2(v) { 540 var p = Math.pow(10, ((v + "").split(".")[1] || "").length); 541 return function(raw) { 542 var n = _roundPrecise(Math.round(parseFloat(raw) / v) * v * p); 543 return (n - n % 1) / p + (_isNumber$1(raw) ? 0 : getUnit(raw)); 544 }; 545}, snap = function snap2(snapTo, value) { 546 var isArray = _isArray(snapTo), radius, is2D; 547 if (!isArray && _isObject$1(snapTo)) { 548 radius = isArray = snapTo.radius || _bigNum$1; 549 if (snapTo.values) { 550 snapTo = toArray(snapTo.values); 551 if (is2D = !_isNumber$1(snapTo[0])) { 552 radius *= radius; 553 } 554 } else { 555 snapTo = _roundModifier(snapTo.increment); 556 } 557 } 558 return _conditionalReturn(value, !isArray ? _roundModifier(snapTo) : _isFunction$1(snapTo) ? function(raw) { 559 is2D = snapTo(raw); 560 return Math.abs(is2D - raw) <= radius ? is2D : raw; 561 } : function(raw) { 562 var x = parseFloat(is2D ? raw.x : raw), y = parseFloat(is2D ? raw.y : 0), min = _bigNum$1, closest = 0, i = snapTo.length, dx, dy; 563 while (i--) { 564 if (is2D) { 565 dx = snapTo[i].x - x; 566 dy = snapTo[i].y - y; 567 dx = dx * dx + dy * dy; 568 } else { 569 dx = Math.abs(snapTo[i] - x); 570 } 571 if (dx < min) { 572 min = dx; 573 closest = i; 574 } 575 } 576 closest = !radius || min <= radius ? snapTo[closest] : raw; 577 return is2D || closest === raw || _isNumber$1(raw) ? closest : closest + getUnit(raw); 578 }); 579}, random = function random2(min, max, roundingIncrement, returnFunction) { 580 return _conditionalReturn(_isArray(min) ? !max : roundingIncrement === true ? !!(roundingIncrement = 0) : !returnFunction, function() { 581 return _isArray(min) ? min[~~(Math.random() * min.length)] : (roundingIncrement = roundingIncrement || 1e
vendor: 4,592 bytes, lines 581-693
581-5) && (returnFunction = roundingIncrement < 1 ? Math.pow(10, (roundingIncrement + "").length - 2) : 1) && Math.floor(Math.round((min - roundingIncrement / 2 + Math.random() * (max - min + roundingIncrement * 0.99)) / roundingIncrement) * roundingIncrement * returnFunction) / returnFunction; 582 }); 583}, pipe = function pipe2() { 584 for (var _len = arguments.length, functions = new Array(_len), _key = 0; _key < _len; _key++) { 585 functions[_key] = arguments[_key]; 586 } 587 return function(value) { 588 return functions.reduce(function(v, f) { 589 return f(v); 590 }, value); 591 }; 592}, unitize = function unitize2(func, unit) { 593 return function(value) { 594 return func(parseFloat(value)) + (unit || getUnit(value)); 595 }; 596}, normalize = function normalize2(min, max, value) { 597 return mapRange(min, max, 0, 1, value); 598}, _wrapArray = function _wrapArray2(a, wrapper, value) { 599 return _conditionalReturn(value, function(index) { 600 return a[~~wrapper(index)]; 601 }); 602}, wrap = function wrap2(min, max, value) { 603 var range = max - min; 604 return _isArray(min) ? _wrapArray(min, wrap2(0, min.length), max) : _conditionalReturn(value, function(value2) { 605 return (range + (value2 - min) % range) % range + min; 606 }); 607}, wrapYoyo = function wrapYoyo2(min, max, value) { 608 var range = max - min, total = range * 2; 609 return _isArray(min) ? _wrapArray(min, wrapYoyo2(0, min.length - 1), max) : _conditionalReturn(value, function(value2) { 610 value2 = (total + (value2 - min) % total) % total || 0; 611 return min + (value2 > range ? total - value2 : value2); 612 }); 613}, _replaceRandom = function _replaceRandom2(value) { 614 var prev = 0, s = "", i, nums, end, isArray; 615 while (~(i = value.indexOf("random(", prev))) { 616 end = value.indexOf(")", i); 617 isArray = value.charAt(i + 7) === "["; 618 nums = value.substr(i + 7, end - i - 7).match(isArray ? _delimitedValueExp : _strictNumExp); 619 s += value.substr(prev, i - prev) + random(isArray ? nums : +nums[0], isArray ? 0 : +nums[1], +nums[2] || 1e-5); 620 prev = end + 1; 621 } 622 return s + value.substr(prev, value.length - prev); 623}, mapRange = function mapRange2(inMin, inMax, outMin, outMax, value) { 624 var inRange = inMax - inMin, outRange = outMax - outMin; 625 return _conditionalReturn(value, function(value2) { 626 return outMin + ((value2 - inMin) / inRange * outRange || 0); 627 }); 628}, interpolate = function interpolate2(start, end, progress, mutate) { 629 var func = isNaN(start + end) ? 0 : function(p2) { 630 return (1 - p2) * start + p2 * end; 631 }; 632 if (!func) { 633 var isString = _isString$1(start), master = {}, p, i, interpolators, l, il; 634 progress === true && (mutate = 1) && (progress = null); 635 if (isString) { 636 start = { 637 p: start 638 }; 639 end = { 640 p: end 641 }; 642 } else if (_isArray(start) && !_isArray(end)) { 643 interpolators = []; 644 l = start.length; 645 il = l - 2; 646 for (i = 1; i < l; i++) { 647 interpolators.push(interpolate2(start[i - 1], start[i])); 648 } 649 l--; 650 func = function func2(p2) { 651 p2 *= l; 652 var i2 = Math.min(il, ~~p2); 653 return interpolators[i2](p2 - i2); 654 }; 655 progress = end; 656 } else if (!mutate) { 657 start = _merge(_isArray(start) ? [] : {}, start); 658 } 659 if (!interpolators) { 660 for (p in end) { 661 _addPropTween.call(master, start, p, "get", end[p]); 662 } 663 func = function func2(p2) { 664 return _renderPropTweens(p2, master) || (isString ? start.p : start); 665 }; 666 } 667 } 668 return _conditionalReturn(progress, func); 669}, _getLabelInDirection = function _getLabelInDirection2(timeline2, fromTime, backward) { 670 var labels = timeline2.labels, min = _bigNum$1, p, distance, label; 671 for (p in labels) { 672 distance = labels[p] - fromTime; 673 if (distance < 0 === !!backward && distance && min > (distance = Math.abs(distance))) { 674 label = p; 675 min = distance; 676 } 677 } 678 return label; 679}, _callback$1 = function _callback(animation, type, executeLazyFirst) { 680 var v = animation.vars, callback = v[type], prevContext = _context$3, context3 = animation._ctx, params, scope, result; 681 if (!callback) { 682 return; 683 } 684 params = v[type + "Params"]; 685 scope = v.callbackScope || animation; 686 executeLazyFirst && _lazyTweens.length && _lazyRender(); 687 context3 && (_context$3 = context3); 688 result = params ? callback.apply(scope, params) : callback.call(scope); 689 _context$3 = prevContext; 690 return result; 691}, _interrupt = function _interrupt2(animation) { 692 _removeFromParent(animation); 693 animation.scrollTrigger && animation.scrollTrigger.kill(!!_reverting$1);
vendor: 7,641 bytes, lines 694-911
694 animation.progress() < 1 && _callback$1(animation, "onInterrupt"); 695 return animation; 696}, _quickTween, _registerPluginQueue = [], _createPlugin = function _createPlugin2(config3) { 697 if (!config3) 698 return; 699 config3 = !config3.name && config3["default"] || config3; 700 if (_windowExists$3() || config3.headless) { 701 var name = config3.name, isFunc = _isFunction$1(config3), Plugin = name && !isFunc && config3.init ? function() { 702 this._props = []; 703 } : config3, instanceDefaults = { 704 init: _emptyFunc, 705 render: _renderPropTweens, 706 add: _addPropTween, 707 kill: _killPropTweensOf, 708 modifier: _addPluginModifier, 709 rawVars: 0 710 }, statics = { 711 targetTest: 0, 712 get: 0, 713 getSetter: _getSetter, 714 aliases: {}, 715 register: 0 716 }; 717 _wake(); 718 if (config3 !== Plugin) { 719 if (_plugins[name]) { 720 return; 721 } 722 _setDefaults$1(Plugin, _setDefaults$1(_copyExcluding(config3, instanceDefaults), statics)); 723 _merge(Plugin.prototype, _merge(instanceDefaults, _copyExcluding(config3, statics))); 724 _plugins[Plugin.prop = name] = Plugin; 725 if (config3.targetTest) { 726 _harnessPlugins.push(Plugin); 727 _reservedProps[name] = 1; 728 } 729 name = (name === "css" ? "CSS" : name.charAt(0).toUpperCase() + name.substr(1)) + "Plugin"; 730 } 731 _addGlobal(name, Plugin); 732 config3.register && config3.register(gsap$3, Plugin, PropTween); 733 } else { 734 _registerPluginQueue.push(config3); 735 } 736}, _255 = 255, _colorLookup = { 737 aqua: [0, _255, _255], 738 lime: [0, _255, 0], 739 silver: [192, 192, 192], 740 black: [0, 0, 0], 741 maroon: [128, 0, 0], 742 teal: [0, 128, 128], 743 blue: [0, 0, _255], 744 navy: [0, 0, 128], 745 white: [_255, _255, _255], 746 olive: [128, 128, 0], 747 yellow: [_255, _255, 0], 748 orange: [_255, 165, 0], 749 gray: [128, 128, 128], 750 purple: [128, 0, 128], 751 green: [0, 128, 0], 752 red: [_255, 0, 0], 753 pink: [_255, 192, 203], 754 cyan: [0, _255, _255], 755 transparent: [_255, _255, _255, 0] 756}, _hue = function _hue2(h, m1, m2) { 757 h += h < 0 ? 1 : h > 1 ? -1 : 0; 758 return (h * 6 < 1 ? m1 + (m2 - m1) * h * 6 : h < 0.5 ? m2 : h * 3 < 2 ? m1 + (m2 - m1) * (2 / 3 - h) * 6 : m1) * _255 + 0.5 | 0; 759}, splitColor = function splitColor2(v, toHSL, forceAlpha) { 760 var a = !v ? _colorLookup.black : _isNumber$1(v) ? [v >> 16, v >> 8 & _255, v & _255] : 0, r, g, b, h, s, l, max, min, d, wasHSL; 761 if (!a) { 762 if (v.substr(-1) === ",") { 763 v = v.substr(0, v.length - 1); 764 } 765 if (_colorLookup[v]) { 766 a = _colorLookup[v]; 767 } else if (v.charAt(0) === "#") { 768 if (v.length < 6) { 769 r = v.charAt(1); 770 g = v.charAt(2); 771 b = v.charAt(3); 772 v = "#" + r + r + g + g + b + b + (v.length === 5 ? v.charAt(4) + v.charAt(4) : ""); 773 } 774 if (v.length === 9) { 775 a = parseInt(v.substr(1, 6), 16); 776 return [a >> 16, a >> 8 & _255, a & _255, parseInt(v.substr(7), 16) / 255]; 777 } 778 v = parseInt(v.substr(1), 16); 779 a = [v >> 16, v >> 8 & _255, v & _255]; 780 } else if (v.substr(0, 3) === "hsl") { 781 a = wasHSL = v.match(_strictNumExp); 782 if (!toHSL) { 783 h = +a[0] % 360 / 360; 784 s = +a[1] / 100; 785 l = +a[2] / 100; 786 g = l <= 0.5 ? l * (s + 1) : l + s - l * s; 787 r = l * 2 - g; 788 a.length > 3 && (a[3] *= 1); 789 a[0] = _hue(h + 1 / 3, r, g); 790 a[1] = _hue(h, r, g); 791 a[2] = _hue(h - 1 / 3, r, g); 792 } else if (~v.indexOf("=")) { 793 a = v.match(_numExp); 794 forceAlpha && a.length < 4 && (a[3] = 1); 795 return a; 796 } 797 } else { 798 a = v.match(_strictNumExp) || _colorLookup.transparent; 799 } 800 a = a.map(Number); 801 } 802 if (toHSL && !wasHSL) { 803 r = a[0] / _255; 804 g = a[1] / _255; 805 b = a[2] / _255; 806 max = Math.max(r, g, b); 807 min = Math.min(r, g, b); 808 l = (max + min) / 2; 809 if (max === min) { 810 h = s = 0; 811 } else { 812 d = max - min; 813 s = l > 0.5 ? d / (2 - max - min) : d / (max + min); 814 h = max === r ? (g - b) / d + (g < b ? 6 : 0) : max === g ? (b - r) / d + 2 : (r - g) / d + 4; 815 h *= 60; 816 } 817 a[0] = ~~(h + 0.5); 818 a[1] = ~~(s * 100 + 0.5); 819 a[2] = ~~(l * 100 + 0.5); 820 } 821 forceAlpha && a.length < 4 && (a[3] = 1); 822 return a; 823}, _colorOrderData = function _colorOrderData2(v) { 824 var values = [], c = [], i = -1; 825 v.split(_colorExp).forEach(function(v2) { 826 var a = v2.match(_numWithUnitExp) || []; 827 values.push.apply(values, a); 828 c.push(i += a.length + 1); 829 }); 830 values.c = c; 831 return values; 832}, _formatColors = function _formatColors2(s, toHSL, orderMatchData) { 833 var result = "", colors = (s + result).match(_colorExp), type = toHSL ? "hsla(" : "rgba(", i = 0, c, shell, d, l; 834 if (!colors) { 835 return s; 836 } 837 colors = colors.map(function(color) { 838 return (color = splitColor(color, toHSL, 1)) && type + (toHSL ? color[0] + "," + color[1] + "%," + color[2] + "%," + color[3] : color.join(",")) + ")"; 839 }); 840 if (orderMatchData) { 841 d = _colorOrderData(s); 842 c = orderMatchData.c; 843 if (c.join(result) !== d.c.join(result)) { 844 shell = s.replace(_colorExp, "1").split(_numWithUnitExp); 845 l = shell.length - 1; 846 for (; i < l; i++) { 847 result += shell[i] + (~c.indexOf(i) ? colors.shift() || type + "0,0,0,0)" : (d.length ? d : colors.length ? colors : orderMatchData).shift()); 848 } 849 } 850 } 851 if (!shell) { 852 shell = s.split(_colorExp); 853 l = shell.length - 1; 854 for (; i < l; i++) { 855 result += shell[i] + colors[i]; 856 } 857 } 858 return result + shell[l]; 859}, _colorExp = function() { 860 var s = "(?:\\b(?:(?:rgb|rgba|hsl|hsla)\\(.+?\\))|\\B#(?:[0-9a-f]{3,4}){1,2}\\b", p; 861 for (p in _colorLookup) { 862 s += "|" + p + "\\b"; 863 } 864 return new RegExp(s + ")", "gi"); 865}(), _hslExp = /hsl[a]?\(/, _colorStringFilter = function _colorStringFilter2(a) { 866 var combined = a.join(" "), toHSL; 867 _colorExp.lastIndex = 0; 868 if (_colorExp.test(combined)) { 869 toHSL = _hslExp.test(combined); 870 a[1] = _formatColors(a[1], toHSL); 871 a[0] = _formatColors(a[0], toHSL, _colorOrderData(a[1])); 872 return true; 873 } 874}, _tickerActive, _ticker = function() { 875 var _getTime2 = Date.now, _lagThreshold = 500, _adjustedLag = 33, _startTime = _getTime2(), _lastUpdate = _startTime, _gap = 1e3 / 240, _nextTime = _gap, _listeners2 = [], _id, _req, _raf, _self, _delta, _i2, _tick = function _tick2(v) { 876 var elapsed = _getTime2() - _lastUpdate, manual = v === true, overlap, dispatch, time, frame; 877 (elapsed > _lagThreshold || elapsed < 0) && (_startTime += elapsed - _adjustedLag); 878 _lastUpdate += elapsed; 879 time = _lastUpdate - _startTime; 880 overlap = time - _nextTime; 881 if (overlap > 0 || manual) { 882 frame = ++_self.frame; 883 _delta = time - _self.time * 1e3; 884 _self.time = time = time / 1e3; 885 _nextTime += overlap + (overlap >= _gap ? 4 : _gap - overlap); 886 dispatch = 1; 887 } 888 manual || (_id = _req(_tick2)); 889 if (dispatch) { 890 for (_i2 = 0; _i2 < _listeners2.length; _i2++) { 891 _listeners2[_i2](time, _delta, frame, v); 892 } 893 } 894 }; 895 _self = { 896 time: 0, 897 frame: 0, 898 tick: function tick() { 899 _tick(true); 900 }, 901 deltaRatio: function deltaRatio(fps) { 902 return _delta / (1e3 / (fps || 60)); 903 }, 904 wake: function wake() { 905 if (_coreReady) { 906 if (!_coreInitted$3 && _windowExists$3()) { 907 _win$4 = _coreInitted$3 = window; 908 _doc$4 = _win$4.document || {}; 909 _globals.gsap = gsap$3; 910 (_win$4.gsapVersions || (_win$4.gsapVersions = [])).push(gsap$3.version); 911 _install(_installScope || _win$4.GreenSockGlobals || !_win$4.gsap && _win$4
vendor: 6,442 bytes, lines 911-1069
911 || {}); 912 _registerPluginQueue.forEach(_createPlugin); 913 } 914 _raf = typeof requestAnimationFrame !== "undefined" && requestAnimationFrame; 915 _id && _self.sleep(); 916 _req = _raf || function(f) { 917 return setTimeout(f, _nextTime - _self.time * 1e3 + 1 | 0); 918 }; 919 _tickerActive = 1; 920 _tick(2); 921 } 922 }, 923 sleep: function sleep() { 924 (_raf ? cancelAnimationFrame : clearTimeout)(_id); 925 _tickerActive = 0; 926 _req = _emptyFunc; 927 }, 928 lagSmoothing: function lagSmoothing(threshold, adjustedLag) { 929 _lagThreshold = threshold || Infinity; 930 _adjustedLag = Math.min(adjustedLag || 33, _lagThreshold); 931 }, 932 fps: function fps(_fps) { 933 _gap = 1e3 / (_fps || 240); 934 _nextTime = _self.time * 1e3 + _gap; 935 }, 936 add: function add(callback, once, prioritize) { 937 var func = once ? function(t, d, f, v) { 938 callback(t, d, f, v); 939 _self.remove(func); 940 } : callback; 941 _self.remove(callback); 942 _listeners2[prioritize ? "unshift" : "push"](func); 943 _wake(); 944 return func; 945 }, 946 remove: function remove(callback, i) { 947 ~(i = _listeners2.indexOf(callback)) && _listeners2.splice(i, 1) && _i2 >= i && _i2--; 948 }, 949 _listeners: _listeners2 950 }; 951 return _self; 952}(), _wake = function _wake2() { 953 return !_tickerActive && _ticker.wake(); 954}, _easeMap = {}, _customEaseExp = /^[\d.\-M][\d.\-,\s]/, _quotesExp = /["']/g, _parseObjectInString = function _parseObjectInString2(value) { 955 var obj = {}, split = value.substr(1, value.length - 3).split(":"), key = split[0], i = 1, l = split.length, index, val, parsedVal; 956 for (; i < l; i++) { 957 val = split[i]; 958 index = i !== l - 1 ? val.lastIndexOf(",") : val.length; 959 parsedVal = val.substr(0, index); 960 obj[key] = isNaN(parsedVal) ? parsedVal.replace(_quotesExp, "").trim() : +parsedVal; 961 key = val.substr(index + 1).trim(); 962 } 963 return obj; 964}, _valueInParentheses = function _valueInParentheses2(value) { 965 var open = value.indexOf("(") + 1, close = value.indexOf(")"), nested = value.indexOf("(", open); 966 return value.substring(open, ~nested && nested < close ? value.indexOf(")", close + 1) : close); 967}, _configEaseFromString = function _configEaseFromString2(name) { 968 var split = (name + "").split("("), ease = _easeMap[split[0]]; 969 return ease && split.length > 1 && ease.config ? ease.config.apply(null, ~name.indexOf("{") ? [_parseObjectInString(split[1])] : _valueInParentheses(name).split(",").map(_numericIfPossible)) : _easeMap._CE && _customEaseExp.test(name) ? _easeMap._CE("", name) : ease; 970}, _invertEase = function _invertEase2(ease) { 971 return function(p) { 972 return 1 - ease(1 - p); 973 }; 974}, _propagateYoyoEase = function _propagateYoyoEase2(timeline2, isYoyo) { 975 var child = timeline2._first, ease; 976 while (child) { 977 if (child instanceof Timeline) { 978 _propagateYoyoEase2(child, isYoyo); 979 } else if (child.vars.yoyoEase && (!child._yoyo || !child._repeat) && child._yoyo !== isYoyo) { 980 if (child.timeline) { 981 _propagateYoyoEase2(child.timeline, isYoyo); 982 } else { 983 ease = child._ease; 984 child._ease = child._yEase; 985 child._yEase = ease; 986 child._yoyo = isYoyo; 987 } 988 } 989 child = child._next; 990 } 991}, _parseEase = function _parseEase2(ease, defaultEase) { 992 return !ease ? defaultEase : (_isFunction$1(ease) ? ease : _easeMap[ease] || _configEaseFromString(ease)) || defaultEase; 993}, _insertEase = function _insertEase2(names, easeIn, easeOut, easeInOut) { 994 if (easeOut === void 0) { 995 easeOut = function easeOut2(p) { 996 return 1 - easeIn(1 - p); 997 }; 998 } 999 if (easeInOut === void 0) { 1000 easeInOut = function easeInOut2(p) { 1001 return p < 0.5 ? easeIn(p * 2) / 2 : 1 - easeIn((1 - p) * 2) / 2; 1002 }; 1003 } 1004 var ease = { 1005 easeIn, 1006 easeOut, 1007 easeInOut 1008 }, lowercaseName; 1009 _forEachName(names, function(name) { 1010 _easeMap[name] = _globals[name] = ease; 1011 _easeMap[lowercaseName = name.toLowerCase()] = easeOut; 1012 for (var p in ease) { 1013 _easeMap[lowercaseName + (p === "easeIn" ? ".in" : p === "easeOut" ? ".out" : ".inOut")] = _easeMap[name + "." + p] = ease[p]; 1014 } 1015 }); 1016 return ease; 1017}, _easeInOutFromOut = function _easeInOutFromOut2(easeOut) { 1018 return function(p) { 1019 return p < 0.5 ? (1 - easeOut(1 - p * 2)) / 2 : 0.5 + easeOut((p - 0.5) * 2) / 2; 1020 }; 1021}, _configElastic = function _configElastic2(type, amplitude, period) { 1022 var p1 = amplitude >= 1 ? amplitude : 1, p2 = (period || (type ? 0.3 : 0.45)) / (amplitude < 1 ? amplitude : 1), p3 = p2 / _2PI * (Math.asin(1 / p1) || 0), easeOut = function easeOut2(p) { 1023 return p === 1 ? 1 : p1 * Math.pow(2, -10 * p) * _sin((p - p3) * p2) + 1; 1024 }, ease = type === "out" ? easeOut : type === "in" ? function(p) { 1025 return 1 - easeOut(1 - p); 1026 } : _easeInOutFromOut(easeOut); 1027 p2 = _2PI / p2; 1028 ease.config = function(amplitude2, period2) { 1029 return _configElastic2(type, amplitude2, period2); 1030 }; 1031 return ease; 1032}, _configBack = function _configBack2(type, overshoot) { 1033 if (overshoot === void 0) { 1034 overshoot = 1.70158; 1035 } 1036 var easeOut = function easeOut2(p) { 1037 return p ? --p * p * ((overshoot + 1) * p + overshoot) + 1 : 0; 1038 }, ease = type === "out" ? easeOut : type === "in" ? function(p) { 1039 return 1 - easeOut(1 - p); 1040 } : _easeInOutFromOut(easeOut); 1041 ease.config = function(overshoot2) { 1042 return _configBack2(type, overshoot2); 1043 }; 1044 return ease; 1045}; 1046_forEachName("Linear,Quad,Cubic,Quart,Quint,Strong", function(name, i) { 1047 var power = i < 5 ? i + 1 : i; 1048 _insertEase(name + ",Power" + (power - 1), i ? function(p) { 1049 return Math.pow(p, power); 1050 } : function(p) { 1051 return p; 1052 }, function(p) { 1053 return 1 - Math.pow(1 - p, power); 1054 }, function(p) { 1055 return p < 0.5 ? Math.pow(p * 2, power) / 2 : 1 - Math.pow((1 - p) * 2, power) / 2; 1056 }); 1057}); 1058_easeMap.Linear.easeNone = _easeMap.none = _easeMap.Linear.easeIn; 1059_insertEase("Elastic", _configElastic("in"), _configElastic("out"), _configElastic()); 1060(function(n, c) { 1061 var n1 = 1 / c, n2 = 2 * n1, n3 = 2.5 * n1, easeOut = function easeOut2(p) { 1062 return p < n1 ? n * p * p : p < n2 ? n * Math.pow(p - 1.5 / c, 2) + 0.75 : p < n3 ? n * (p -= 2.25 / c) * p + 0.9375 : n * Math.pow(p - 2.625 / c, 2) + 0.984375; 1063 }; 1064 _insertEase("Bounce", function(p) { 1065 return 1 - easeOut(1 - p); 1066 }, easeOut); 1067})(7.5625, 2.75); 1068_insertEase("Expo", function(p) { 1069 return
vendor: 1,852 bytes, lines 1069-1121
1069p ? Math.pow(2, 10 * (p - 1)) : 0; 1070}); 1071_insertEase("Circ", function(p) { 1072 return -(_sqrt(1 - p * p) - 1); 1073}); 1074_insertEase("Sine", function(p) { 1075 return p === 1 ? 1 : -_cos(p * _HALF_PI) + 1; 1076}); 1077_insertEase("Back", _configBack("in"), _configBack("out"), _configBack()); 1078_easeMap.SteppedEase = _easeMap.steps = _globals.SteppedEase = { 1079 config: function config(steps, immediateStart) { 1080 if (steps === void 0) { 1081 steps = 1; 1082 } 1083 var p1 = 1 / steps, p2 = steps + (immediateStart ? 0 : 1), p3 = immediateStart ? 1 : 0, max = 1 - _tinyNum; 1084 return function(p) { 1085 return ((p2 * _clamp$2(0, max, p) | 0) + p3) * p1; 1086 }; 1087 } 1088}; 1089_defaults$1.ease = _easeMap["quad.out"]; 1090_forEachName("onComplete,onUpdate,onStart,onRepeat,onReverseComplete,onInterrupt", function(name) { 1091 return _callbackNames += name + "," + name + "Params,"; 1092}); 1093var GSCache = function GSCache2(target, harness) { 1094 this.id = _gsID++; 1095 target._gsap = this; 1096 this.target = target; 1097 this.harness = harness; 1098 this.get = harness ? harness.get : _getProperty; 1099 this.set = harness ? harness.getSetter : _getSetter; 1100}; 1101var Animation = /* @__PURE__ */ function() { 1102 function Animation2(vars) { 1103 this.vars = vars; 1104 this._delay = +vars.delay || 0; 1105 if (this._repeat = vars.repeat === Infinity ? -2 : vars.repeat || 0) { 1106 this._rDelay = vars.repeatDelay || 0; 1107 this._yoyo = !!vars.yoyo || !!vars.yoyoEase; 1108 } 1109 this._ts = 1; 1110 _setDuration(this, +vars.duration, 1, 1); 1111 this.data = vars.data; 1112 if (_context$3) { 1113 this._ctx = _context$3; 1114 _context$3.data.push(this); 1115 } 1116 _tickerActive || _ticker.wake(); 1117 } 1118 var _proto = Animation2.prototype; 1119 _proto.delay = function delay(value) { 1120 if (value || value === 0) { 1121 this.parent && this.parent.smoothChildTiming && this.startTime(this._start + value - this._delay);
vendor: 15,503 bytes, lines 1122-1497
1122 this._delay = value; 1123 return this; 1124 } 1125 return this._delay; 1126 }; 1127 _proto.duration = function duration(value) { 1128 return arguments.length ? this.totalDuration(this._repeat > 0 ? value + (value + this._rDelay) * this._repeat : value) : this.totalDuration() && this._dur; 1129 }; 1130 _proto.totalDuration = function totalDuration(value) { 1131 if (!arguments.length) { 1132 return this._tDur; 1133 } 1134 this._dirty = 0; 1135 return _setDuration(this, this._repeat < 0 ? value : (value - this._repeat * this._rDelay) / (this._repeat + 1)); 1136 }; 1137 _proto.totalTime = function totalTime(_totalTime, suppressEvents) { 1138 _wake(); 1139 if (!arguments.length) { 1140 return this._tTime; 1141 } 1142 var parent = this._dp; 1143 if (parent && parent.smoothChildTiming && this._ts) { 1144 _alignPlayhead(this, _totalTime); 1145 !parent._dp || parent.parent || _postAddChecks(parent, this); 1146 while (parent && parent.parent) { 1147 if (parent.parent._time !== parent._start + (parent._ts >= 0 ? parent._tTime / parent._ts : (parent.totalDuration() - parent._tTime) / -parent._ts)) { 1148 parent.totalTime(parent._tTime, true); 1149 } 1150 parent = parent.parent; 1151 } 1152 if (!this.parent && this._dp.autoRemoveChildren && (this._ts > 0 && _totalTime < this._tDur || this._ts < 0 && _totalTime > 0 || !this._tDur && !_totalTime)) { 1153 _addToTimeline(this._dp, this, this._start - this._delay); 1154 } 1155 } 1156 if (this._tTime !== _totalTime || !this._dur && !suppressEvents || this._initted && Math.abs(this._zTime) === _tinyNum || !_totalTime && !this._initted && (this.add || this._ptLookup)) { 1157 this._ts || (this._pTime = _totalTime); 1158 _lazySafeRender(this, _totalTime, suppressEvents); 1159 } 1160 return this; 1161 }; 1162 _proto.time = function time(value, suppressEvents) { 1163 return arguments.length ? this.totalTime(Math.min(this.totalDuration(), value + _elapsedCycleDuration(this)) % (this._dur + this._rDelay) || (value ? this._dur : 0), suppressEvents) : this._time; 1164 }; 1165 _proto.totalProgress = function totalProgress(value, suppressEvents) { 1166 return arguments.length ? this.totalTime(this.totalDuration() * value, suppressEvents) : this.totalDuration() ? Math.min(1, this._tTime / this._tDur) : this.rawTime() > 0 ? 1 : 0; 1167 }; 1168 _proto.progress = function progress(value, suppressEvents) { 1169 return arguments.length ? this.totalTime(this.duration() * (this._yoyo && !(this.iteration() & 1) ? 1 - value : value) + _elapsedCycleDuration(this), suppressEvents) : this.duration() ? Math.min(1, this._time / this._dur) : this.rawTime() > 0 ? 1 : 0; 1170 }; 1171 _proto.iteration = function iteration(value, suppressEvents) { 1172 var cycleDuration = this.duration() + this._rDelay; 1173 return arguments.length ? this.totalTime(this._time + (value - 1) * cycleDuration, suppressEvents) : this._repeat ? _animationCycle(this._tTime, cycleDuration) + 1 : 1; 1174 }; 1175 _proto.timeScale = function timeScale(value, suppressEvents) { 1176 if (!arguments.length) { 1177 return this._rts === -_tinyNum ? 0 : this._rts; 1178 } 1179 if (this._rts === value) { 1180 return this; 1181 } 1182 var tTime = this.parent && this._ts ? _parentToChildTotalTime(this.parent._time, this) : this._tTime; 1183 this._rts = +value || 0; 1184 this._ts = this._ps || value === -_tinyNum ? 0 : this._rts; 1185 this.totalTime(_clamp$2(-Math.abs(this._delay), this._tDur, tTime), suppressEvents !== false); 1186 _setEnd(this); 1187 return _recacheAncestors(this); 1188 }; 1189 _proto.paused = function paused(value) { 1190 if (!arguments.length) { 1191 return this._ps; 1192 } 1193 if (this._ps !== value) { 1194 this._ps = value; 1195 if (value) { 1196 this._pTime = this._tTime || Math.max(-this._delay, this.rawTime()); 1197 this._ts = this._act = 0; 1198 } else { 1199 _wake(); 1200 this._ts = this._rts; 1201 this.totalTime(this.parent && !this.parent.smoothChildTiming ? this.rawTime() : this._tTime || this._pTime, this.progress() === 1 && Math.abs(this._zTime) !== _tinyNum && (this._tTime -= _tinyNum)); 1202 } 1203 } 1204 return this; 1205 }; 1206 _proto.startTime = function startTime(value) { 1207 if (arguments.length) { 1208 this._start = value; 1209 var parent = this.parent || this._dp; 1210 parent && (parent._sort || !this.parent) && _addToTimeline(parent, this, value - this._delay); 1211 return this; 1212 } 1213 return this._start; 1214 }; 1215 _proto.endTime = function endTime(includeRepeats) { 1216 return this._start + (_isNotFalse(includeRepeats) ? this.totalDuration() : this.duration()) / Math.abs(this._ts || 1); 1217 }; 1218 _proto.rawTime = function rawTime(wrapRepeats) { 1219 var parent = this.parent || this._dp; 1220 return !parent ? this._tTime : wrapRepeats && (!this._ts || this._repeat && this._time && this.totalProgress() < 1) ? this._tTime % (this._dur + this._rDelay) : !this._ts ? this._tTime : _parentToChildTotalTime(parent.rawTime(wrapRepeats), this); 1221 }; 1222 _proto.revert = function revert(config3) { 1223 if (config3 === void 0) { 1224 config3 = _revertConfig; 1225 } 1226 var prevIsReverting = _reverting$1; 1227 _reverting$1 = config3; 1228 if (this._initted || this._startAt) { 1229 this.timeline && this.timeline.revert(config3); 1230 this.totalTime(-0.01, config3.suppressEvents); 1231 } 1232 this.data !== "nested" && config3.kill !== false && this.kill(); 1233 _reverting$1 = prevIsReverting; 1234 return this; 1235 }; 1236 _proto.globalTime = function globalTime(rawTime) { 1237 var animation = this, time = arguments.length ? rawTime : animation.rawTime(); 1238 while (animation) { 1239 time = animation._start + time / (Math.abs(animation._ts) || 1); 1240 animation = animation._dp; 1241 } 1242 return !this.parent && this._sat ? this._sat.globalTime(rawTime) : time; 1243 }; 1244 _proto.repeat = function repeat(value) { 1245 if (arguments.length) { 1246 this._repeat = value === Infinity ? -2 : value; 1247 return _onUpdateTotalDuration(this); 1248 } 1249 return this._repeat === -2 ? Infinity : this._repeat; 1250 }; 1251 _proto.repeatDelay = function repeatDelay(value) { 1252 if (arguments.length) { 1253 var time = this._time; 1254 this._rDelay = value; 1255 _onUpdateTotalDuration(this); 1256 return time ? this.time(time) : this; 1257 } 1258 return this._rDelay; 1259 }; 1260 _proto.yoyo = function yoyo(value) { 1261 if (arguments.length) { 1262 this._yoyo = value; 1263 return this; 1264 } 1265 return this._yoyo; 1266 }; 1267 _proto.seek = function seek(position, suppressEvents) { 1268 return this.totalTime(_parsePosition$1(this, position), _isNotFalse(suppressEvents)); 1269 }; 1270 _proto.restart = function restart(includeDelay, suppressEvents) { 1271 return this.play().totalTime(includeDelay ? -this._delay : 0, _isNotFalse(suppressEvents)); 1272 }; 1273 _proto.play = function play(from, suppressEvents) { 1274 from != null && this.seek(from, suppressEvents); 1275 return this.reversed(false).paused(false); 1276 }; 1277 _proto.reverse = function reverse(from, suppressEvents) { 1278 from != null && this.seek(from || this.totalDuration(), suppressEvents); 1279 return this.reversed(true).paused(false); 1280 }; 1281 _proto.pause = function pause(atTime, suppressEvents) { 1282 atTime != null && this.seek(atTime, suppressEvents); 1283 return this.paused(true); 1284 }; 1285 _proto.resume = function resume() { 1286 return this.paused(false); 1287 }; 1288 _proto.reversed = function reversed(value) { 1289 if (arguments.length) { 1290 !!value !== this.reversed() && this.timeScale(-this._rts || (value ? -_tinyNum : 0)); 1291 return this; 1292 } 1293 return this._rts < 0; 1294 }; 1295 _proto.invalidate = function invalidate() { 1296 this._initted = this._act = 0; 1297 this._zTime = -_tinyNum; 1298 return this; 1299 }; 1300 _proto.isActive = function isActive() { 1301 var parent = this.parent || this._dp, start = this._start, rawTime; 1302 return !!(!parent || this._ts && this._initted && parent.isActive() && (rawTime = parent.rawTime(true)) >= start && rawTime < this.endTime(true) - _tinyNum); 1303 }; 1304 _proto.eventCallback = function eventCallback(type, callback, params) { 1305 var vars = this.vars; 1306 if (arguments.length > 1) { 1307 if (!callback) { 1308 delete vars[type]; 1309 } else { 1310 vars[type] = callback; 1311 params && (vars[type + "Params"] = params); 1312 type === "onUpdate" && (this._onUpdate = callback); 1313 } 1314 return this; 1315 } 1316 return vars[type]; 1317 }; 1318 _proto.then = function then(onFulfilled) { 1319 var self = this; 1320 return new Promise(function(resolve) { 1321 var f = _isFunction$1(onFulfilled) ? onFulfilled : _passThrough$1, _resolve = function _resolve2() { 1322 var _then = self.then; 1323 self.then = null; 1324 _isFunction$1(f) && (f = f(self)) && (f.then || f === self) && (self.then = _then); 1325 resolve(f); 1326 self.then = _then; 1327 }; 1328 if (self._initted && self.totalProgress() === 1 && self._ts >= 0 || !self._tTime && self._ts < 0) { 1329 _resolve(); 1330 } else { 1331 self._prom = _resolve; 1332 } 1333 }); 1334 }; 1335 _proto.kill = function kill() { 1336 _interrupt(this); 1337 }; 1338 return Animation2; 1339}(); 1340_setDefaults$1(Animation.prototype, { 1341 _time: 0, 1342 _start: 0, 1343 _end: 0, 1344 _tTime: 0, 1345 _tDur: 0, 1346 _dirty: 0, 1347 _repeat: 0, 1348 _yoyo: false, 1349 parent: null, 1350 _initted: false, 1351 _rDelay: 0, 1352 _ts: 1, 1353 _dp: 0, 1354 ratio: 0, 1355 _zTime: -_tinyNum, 1356 _prom: 0, 1357 _ps: false, 1358 _rts: 1 1359}); 1360var Timeline = /* @__PURE__ */ function(_Animation) { 1361 _inheritsLoose(Timeline2, _Animation); 1362 function Timeline2(vars, position) { 1363 var _this; 1364 if (vars === void 0) { 1365 vars = {}; 1366 } 1367 _this = _Animation.call(this, vars) || this; 1368 _this.labels = {}; 1369 _this.smoothChildTiming = !!vars.smoothChildTiming; 1370 _this.autoRemoveChildren = !!vars.autoRemoveChildren; 1371 _this._sort = _isNotFalse(vars.sortChildren); 1372 _globalTimeline && _addToTimeline(vars.parent || _globalTimeline, _assertThisInitialized(_this), position); 1373 vars.reversed && _this.reverse(); 1374 vars.paused && _this.paused(true); 1375 vars.scrollTrigger && _scrollTrigger(_assertThisInitialized(_this), vars.scrollTrigger); 1376 return _this; 1377 } 1378 var _proto2 = Timeline2.prototype; 1379 _proto2.to = function to(targets, vars, position) { 1380 _createTweenType(0, arguments, this); 1381 return this; 1382 }; 1383 _proto2.from = function from(targets, vars, position) { 1384 _createTweenType(1, arguments, this); 1385 return this; 1386 }; 1387 _proto2.fromTo = function fromTo(targets, fromVars, toVars, position) { 1388 _createTweenType(2, arguments, this); 1389 return this; 1390 }; 1391 _proto2.set = function set(targets, vars, position) { 1392 vars.duration = 0; 1393 vars.parent = this; 1394 _inheritDefaults(vars).repeatDelay || (vars.repeat = 0); 1395 vars.immediateRender = !!vars.immediateRender; 1396 new Tween(targets, vars, _parsePosition$1(this, position), 1); 1397 return this; 1398 }; 1399 _proto2.call = function call(callback, params, position) { 1400 return _addToTimeline(this, Tween.delayedCall(0, callback, params), position); 1401 }; 1402 _proto2.staggerTo = function staggerTo(targets, duration, vars, stagger, position, onCompleteAll, onCompleteAllParams) { 1403 vars.duration = duration; 1404 vars.stagger = vars.stagger || stagger; 1405 vars.onComplete = onCompleteAll; 1406 vars.onCompleteParams = onCompleteAllParams; 1407 vars.parent = this; 1408 new Tween(targets, vars, _parsePosition$1(this, position)); 1409 return this; 1410 }; 1411 _proto2.staggerFrom = function staggerFrom(targets, duration, vars, stagger, position, onCompleteAll, onCompleteAllParams) { 1412 vars.runBackwards = 1; 1413 _inheritDefaults(vars).immediateRender = _isNotFalse(vars.immediateRender); 1414 return this.staggerTo(targets, duration, vars, stagger, position, onCompleteAll, onCompleteAllParams); 1415 }; 1416 _proto2.staggerFromTo = function staggerFromTo(targets, duration, fromVars, toVars, stagger, position, onCompleteAll, onCompleteAllParams) { 1417 toVars.startAt = fromVars; 1418 _inheritDefaults(toVars).immediateRender = _isNotFalse(toVars.immediateRender); 1419 return this.staggerTo(targets, duration, toVars, stagger, position, onCompleteAll, onCompleteAllParams); 1420 }; 1421 _proto2.render = function render3(totalTime, suppressEvents, force) { 1422 var prevTime = this._time, tDur = this._dirty ? this.totalDuration() : this._tDur, dur = this._dur, tTime = totalTime <= 0 ? 0 : _roundPrecise(totalTime), crossingStart = this._zTime < 0 !== totalTime < 0 && (this._initted || !dur), time, child, next, iteration, cycleDuration, prevPaused, pauseTween, timeScale, prevStart, prevIteration, yoyo, isYoyo; 1423 this !== _globalTimeline && tTime > tDur && totalTime >= 0 && (tTime = tDur); 1424 if (tTime !== this._tTime || force || crossingStart) { 1425 if (prevTime !== this._time && dur) { 1426 tTime += this._time - prevTime; 1427 totalTime += this._time - prevTime; 1428 } 1429 time = tTime; 1430 prevStart = this._start; 1431 timeScale = this._ts; 1432 prevPaused = !timeScale; 1433 if (crossingStart) { 1434 dur || (prevTime = this._zTime); 1435 (totalTime || !suppressEvents) && (this._zTime = totalTime); 1436 } 1437 if (this._repeat) { 1438 yoyo = this._yoyo; 1439 cycleDuration = dur + this._rDelay; 1440 if (this._repeat < -1 && totalTime < 0) { 1441 return this.totalTime(cycleDuration * 100 + totalTime, suppressEvents, force); 1442 } 1443 time = _roundPrecise(tTime % cycleDuration); 1444 if (tTime === tDur) { 1445 iteration = this._repeat; 1446 time = dur; 1447 } else { 1448 iteration = ~~(tTime / cycleDuration); 1449 if (iteration && iteration === tTime / cycleDuration) { 1450 time = dur; 1451 iteration--; 1452 } 1453 time > dur && (time = dur); 1454 } 1455 prevIteration = _animationCycle(this._tTime, cycleDuration); 1456 !prevTime && this._tTime && prevIteration !== iteration && this._tTime - prevIteration * cycleDuration - this._dur <= 0 && (prevIteration = iteration); 1457 if (yoyo && iteration & 1) { 1458 time = dur - time; 1459 isYoyo = 1; 1460 } 1461 if (iteration !== prevIteration && !this._lock) { 1462 var rewinding = yoyo && prevIteration & 1, doesWrap = rewinding === (yoyo && iteration & 1); 1463 iteration < prevIteration && (rewinding = !rewinding); 1464 prevTime = rewinding ? 0 : tTime % dur ? dur : tTime; 1465 this._lock = 1; 1466 this.render(prevTime || (isYoyo ? 0 : _roundPrecise(iteration * cycleDuration)), suppressEvents, !dur)._lock = 0; 1467 this._tTime = tTime; 1468 !suppressEvents && this.parent && _callback$1(this, "onRepeat"); 1469 this.vars.repeatRefresh && !isYoyo && (this.invalidate()._lock = 1); 1470 if (prevTime && prevTime !== this._time || prevPaused !== !this._ts || this.vars.onRepeat && !this.parent && !this._act) { 1471 return this; 1472 } 1473 dur = this._dur; 1474 tDur = this._tDur; 1475 if (doesWrap) { 1476 this._lock = 2; 1477 prevTime = rewinding ? dur : -1e-4; 1478 this.render(prevTime, true); 1479 this.vars.repeatRefresh && !isYoyo && this.invalidate(); 1480 } 1481 this._lock = 0; 1482 if (!this._ts && !prevPaused) { 1483 return this; 1484 } 1485 _propagateYoyoEase(this, isYoyo); 1486 } 1487 } 1488 if (this._hasPause && !this._forcing && this._lock < 2) { 1489 pauseTween = _findNextPauseTween(this, _roundPrecise(prevTime), _roundPrecise(time)); 1490 if (pauseTween) { 1491 tTime -= time - (time = pauseTween._start); 1492 } 1493 } 1494 this._tTime = tTime; 1495 this._time = time; 1496 this._act = !timeScale; 1497 if (!this._initted) {
vendor: 2,323 bytes, lines 1498-1553
1498 this._onUpdate = this.vars.onUpdate; 1499 this._initted = 1; 1500 this._zTime = totalTime; 1501 prevTime = 0; 1502 } 1503 if (!prevTime && time && !suppressEvents && !iteration) { 1504 _callback$1(this, "onStart"); 1505 if (this._tTime !== tTime) { 1506 return this; 1507 } 1508 } 1509 if (time >= prevTime && totalTime >= 0) { 1510 child = this._first; 1511 while (child) { 1512 next = child._next; 1513 if ((child._act || time >= child._start) && child._ts && pauseTween !== child) { 1514 if (child.parent !== this) { 1515 return this.render(totalTime, suppressEvents, force); 1516 } 1517 child.render(child._ts > 0 ? (time - child._start) * child._ts : (child._dirty ? child.totalDuration() : child._tDur) + (time - child._start) * child._ts, suppressEvents, force); 1518 if (time !== this._time || !this._ts && !prevPaused) { 1519 pauseTween = 0; 1520 next && (tTime += this._zTime = -_tinyNum); 1521 break; 1522 } 1523 } 1524 child = next; 1525 } 1526 } else { 1527 child = this._last; 1528 var adjustedTime = totalTime < 0 ? totalTime : time; 1529 while (child) { 1530 next = child._prev; 1531 if ((child._act || adjustedTime <= child._end) && child._ts && pauseTween !== child) { 1532 if (child.parent !== this) { 1533 return this.render(totalTime, suppressEvents, force); 1534 } 1535 child.render(child._ts > 0 ? (adjustedTime - child._start) * child._ts : (child._dirty ? child.totalDuration() : child._tDur) + (adjustedTime - child._start) * child._ts, suppressEvents, force || _reverting$1 && (child._initted || child._startAt)); 1536 if (time !== this._time || !this._ts && !prevPaused) { 1537 pauseTween = 0; 1538 next && (tTime += this._zTime = adjustedTime ? -_tinyNum : _tinyNum); 1539 break; 1540 } 1541 } 1542 child = next; 1543 } 1544 } 1545 if (pauseTween && !suppressEvents) { 1546 this.pause(); 1547 pauseTween.render(time >= prevTime ? 0 : -_tinyNum)._zTime = time >= prevTime ? 1 : -1; 1548 if (this._ts) { 1549 this._start = prevStart; 1550 _setEnd(this); 1551 return this.render(totalTime, suppressEvents, force); 1552 } 1553 }
vendor: 2,571 bytes, lines 1554-1632
1554 this._onUpdate && !suppressEvents && _callback$1(this, "onUpdate", true); 1555 if (tTime === tDur && this._tTime >= this.totalDuration() || !tTime && prevTime) { 1556 if (prevStart === this._start || Math.abs(timeScale) !== Math.abs(this._ts)) { 1557 if (!this._lock) { 1558 (totalTime || !dur) && (tTime === tDur && this._ts > 0 || !tTime && this._ts < 0) && _removeFromParent(this, 1); 1559 if (!suppressEvents && !(totalTime < 0 && !prevTime) && (tTime || prevTime || !tDur)) { 1560 _callback$1(this, tTime === tDur && totalTime >= 0 ? "onComplete" : "onReverseComplete", true); 1561 this._prom && !(tTime < tDur && this.timeScale() > 0) && this._prom(); 1562 } 1563 } 1564 } 1565 } 1566 } 1567 return this; 1568 }; 1569 _proto2.add = function add(child, position) { 1570 var _this2 = this; 1571 _isNumber$1(position) || (position = _parsePosition$1(this, position, child)); 1572 if (!(child instanceof Animation)) { 1573 if (_isArray(child)) { 1574 child.forEach(function(obj) { 1575 return _this2.add(obj, position); 1576 }); 1577 return this; 1578 } 1579 if (_isString$1(child)) { 1580 return this.addLabel(child, position); 1581 } 1582 if (_isFunction$1(child)) { 1583 child = Tween.delayedCall(0, child); 1584 } else { 1585 return this; 1586 } 1587 } 1588 return this !== child ? _addToTimeline(this, child, position) : this; 1589 }; 1590 _proto2.getChildren = function getChildren(nested, tweens, timelines, ignoreBeforeTime) { 1591 if (nested === void 0) { 1592 nested = true; 1593 } 1594 if (tweens === void 0) { 1595 tweens = true; 1596 } 1597 if (timelines === void 0) { 1598 timelines = true; 1599 } 1600 if (ignoreBeforeTime === void 0) { 1601 ignoreBeforeTime = -_bigNum$1; 1602 } 1603 var a = [], child = this._first; 1604 while (child) { 1605 if (child._start >= ignoreBeforeTime) { 1606 if (child instanceof Tween) { 1607 tweens && a.push(child); 1608 } else { 1609 timelines && a.push(child); 1610 nested && a.push.apply(a, child.getChildren(true, tweens, timelines)); 1611 } 1612 } 1613 child = child._next; 1614 } 1615 return a; 1616 }; 1617 _proto2.getById = function getById2(id) { 1618 var animations = this.getChildren(1, 1, 1), i = animations.length; 1619 while (i--) { 1620 if (animations[i].vars.id === id) { 1621 return animations[i]; 1622 } 1623 } 1624 }; 1625 _proto2.remove = function remove(child) { 1626 if (_isString$1(child)) { 1627 return this.removeLabel(child); 1628 } 1629 if (_isFunction$1(child)) { 1630 return this.killTweensOf(child); 1631 } 1632
vendor: 19,191 bytes, lines 1632-2075
1632 _removeLinkedListItem(this, child); 1633 if (child === this._recent) { 1634 this._recent = this._last; 1635 } 1636 return _uncache(this); 1637 }; 1638 _proto2.totalTime = function totalTime(_totalTime2, suppressEvents) { 1639 if (!arguments.length) { 1640 return this._tTime; 1641 } 1642 this._forcing = 1; 1643 if (!this._dp && this._ts) { 1644 this._start = _roundPrecise(_ticker.time - (this._ts > 0 ? _totalTime2 / this._ts : (this.totalDuration() - _totalTime2) / -this._ts)); 1645 } 1646 _Animation.prototype.totalTime.call(this, _totalTime2, suppressEvents); 1647 this._forcing = 0; 1648 return this; 1649 }; 1650 _proto2.addLabel = function addLabel(label, position) { 1651 this.labels[label] = _parsePosition$1(this, position); 1652 return this; 1653 }; 1654 _proto2.removeLabel = function removeLabel(label) { 1655 delete this.labels[label]; 1656 return this; 1657 }; 1658 _proto2.addPause = function addPause(position, callback, params) { 1659 var t = Tween.delayedCall(0, callback || _emptyFunc, params); 1660 t.data = "isPause"; 1661 this._hasPause = 1; 1662 return _addToTimeline(this, t, _parsePosition$1(this, position)); 1663 }; 1664 _proto2.removePause = function removePause(position) { 1665 var child = this._first; 1666 position = _parsePosition$1(this, position); 1667 while (child) { 1668 if (child._start === position && child.data === "isPause") { 1669 _removeFromParent(child); 1670 } 1671 child = child._next; 1672 } 1673 }; 1674 _proto2.killTweensOf = function killTweensOf(targets, props, onlyActive) { 1675 var tweens = this.getTweensOf(targets, onlyActive), i = tweens.length; 1676 while (i--) { 1677 _overwritingTween !== tweens[i] && tweens[i].kill(targets, props); 1678 } 1679 return this; 1680 }; 1681 _proto2.getTweensOf = function getTweensOf2(targets, onlyActive) { 1682 var a = [], parsedTargets = toArray(targets), child = this._first, isGlobalTime = _isNumber$1(onlyActive), children; 1683 while (child) { 1684 if (child instanceof Tween) { 1685 if (_arrayContainsAny(child._targets, parsedTargets) && (isGlobalTime ? (!_overwritingTween || child._initted && child._ts) && child.globalTime(0) <= onlyActive && child.globalTime(child.totalDuration()) > onlyActive : !onlyActive || child.isActive())) { 1686 a.push(child); 1687 } 1688 } else if ((children = child.getTweensOf(parsedTargets, onlyActive)).length) { 1689 a.push.apply(a, children); 1690 } 1691 child = child._next; 1692 } 1693 return a; 1694 }; 1695 _proto2.tweenTo = function tweenTo(position, vars) { 1696 vars = vars || {}; 1697 var tl = this, endTime = _parsePosition$1(tl, position), _vars = vars, startAt = _vars.startAt, _onStart = _vars.onStart, onStartParams = _vars.onStartParams, immediateRender = _vars.immediateRender, initted, tween = Tween.to(tl, _setDefaults$1({ 1698 ease: vars.ease || "none", 1699 lazy: false, 1700 immediateRender: false, 1701 time: endTime, 1702 overwrite: "auto", 1703 duration: vars.duration || Math.abs((endTime - (startAt && "time" in startAt ? startAt.time : tl._time)) / tl.timeScale()) || _tinyNum, 1704 onStart: function onStart() { 1705 tl.pause(); 1706 if (!initted) { 1707 var duration = vars.duration || Math.abs((endTime - (startAt && "time" in startAt ? startAt.time : tl._time)) / tl.timeScale()); 1708 tween._dur !== duration && _setDuration(tween, duration, 0, 1).render(tween._time, true, true); 1709 initted = 1; 1710 } 1711 _onStart && _onStart.apply(tween, onStartParams || []); 1712 } 1713 }, vars)); 1714 return immediateRender ? tween.render(0) : tween; 1715 }; 1716 _proto2.tweenFromTo = function tweenFromTo(fromPosition, toPosition, vars) { 1717 return this.tweenTo(toPosition, _setDefaults$1({ 1718 startAt: { 1719 time: _parsePosition$1(this, fromPosition) 1720 } 1721 }, vars)); 1722 }; 1723 _proto2.recent = function recent() { 1724 return this._recent; 1725 }; 1726 _proto2.nextLabel = function nextLabel(afterTime) { 1727 if (afterTime === void 0) { 1728 afterTime = this._time; 1729 } 1730 return _getLabelInDirection(this, _parsePosition$1(this, afterTime)); 1731 }; 1732 _proto2.previousLabel = function previousLabel(beforeTime) { 1733 if (beforeTime === void 0) { 1734 beforeTime = this._time; 1735 } 1736 return _getLabelInDirection(this, _parsePosition$1(this, beforeTime), 1); 1737 }; 1738 _proto2.currentLabel = function currentLabel(value) { 1739 return arguments.length ? this.seek(value, true) : this.previousLabel(this._time + _tinyNum); 1740 }; 1741 _proto2.shiftChildren = function shiftChildren(amount, adjustLabels, ignoreBeforeTime) { 1742 if (ignoreBeforeTime === void 0) { 1743 ignoreBeforeTime = 0; 1744 } 1745 var child = this._first, labels = this.labels, p; 1746 while (child) { 1747 if (child._start >= ignoreBeforeTime) { 1748 child._start += amount; 1749 child._end += amount; 1750 } 1751 child = child._next; 1752 } 1753 if (adjustLabels) { 1754 for (p in labels) { 1755 if (labels[p] >= ignoreBeforeTime) { 1756 labels[p] += amount; 1757 } 1758 } 1759 } 1760 return _uncache(this); 1761 }; 1762 _proto2.invalidate = function invalidate(soft) { 1763 var child = this._first; 1764 this._lock = 0; 1765 while (child) { 1766 child.invalidate(soft); 1767 child = child._next; 1768 } 1769 return _Animation.prototype.invalidate.call(this, soft); 1770 }; 1771 _proto2.clear = function clear(includeLabels) { 1772 if (includeLabels === void 0) { 1773 includeLabels = true; 1774 } 1775 var child = this._first, next; 1776 while (child) { 1777 next = child._next; 1778 this.remove(child); 1779 child = next; 1780 } 1781 this._dp && (this._time = this._tTime = this._pTime = 0); 1782 includeLabels && (this.labels = {}); 1783 return _uncache(this); 1784 }; 1785 _proto2.totalDuration = function totalDuration(value) { 1786 var max = 0, self = this, child = self._last, prevStart = _bigNum$1, prev, start, parent; 1787 if (arguments.length) { 1788 return self.timeScale((self._repeat < 0 ? self.duration() : self.totalDuration()) / (self.reversed() ? -value : value)); 1789 } 1790 if (self._dirty) { 1791 parent = self.parent; 1792 while (child) { 1793 prev = child._prev; 1794 child._dirty && child.totalDuration(); 1795 start = child._start; 1796 if (start > prevStart && self._sort && child._ts && !self._lock) { 1797 self._lock = 1; 1798 _addToTimeline(self, child, start - child._delay, 1)._lock = 0; 1799 } else { 1800 prevStart = start; 1801 } 1802 if (start < 0 && child._ts) { 1803 max -= start; 1804 if (!parent && !self._dp || parent && parent.smoothChildTiming) { 1805 self._start += start / self._ts; 1806 self._time -= start; 1807 self._tTime -= start; 1808 } 1809 self.shiftChildren(-start, false, -Infinity); 1810 prevStart = 0; 1811 } 1812 child._end > max && child._ts && (max = child._end); 1813 child = prev; 1814 } 1815 _setDuration(self, self === _globalTimeline && self._time > max ? self._time : max, 1, 1); 1816 self._dirty = 0; 1817 } 1818 return self._tDur; 1819 }; 1820 Timeline2.updateRoot = function updateRoot(time) { 1821 if (_globalTimeline._ts) { 1822 _lazySafeRender(_globalTimeline, _parentToChildTotalTime(time, _globalTimeline)); 1823 _lastRenderedFrame = _ticker.frame; 1824 } 1825 if (_ticker.frame >= _nextGCFrame) { 1826 _nextGCFrame += _config.autoSleep || 120; 1827 var child = _globalTimeline._first; 1828 if (!child || !child._ts) { 1829 if (_config.autoSleep && _ticker._listeners.length < 2) { 1830 while (child && !child._ts) { 1831 child = child._next; 1832 } 1833 child || _ticker.sleep(); 1834 } 1835 } 1836 } 1837 }; 1838 return Timeline2; 1839}(Animation); 1840_setDefaults$1(Timeline.prototype, { 1841 _lock: 0, 1842 _hasPause: 0, 1843 _forcing: 0 1844}); 1845var _addComplexStringPropTween = function _addComplexStringPropTween2(target, prop, start, end, setter, stringFilter, funcParam) { 1846 var pt = new PropTween(this._pt, target, prop, 0, 1, _renderComplexString, null, setter), index = 0, matchIndex = 0, result, startNums, color, endNum, chunk, startNum, hasRandom, a; 1847 pt.b = start; 1848 pt.e = end; 1849 start += ""; 1850 end += ""; 1851 if (hasRandom = ~end.indexOf("random(")) { 1852 end = _replaceRandom(end); 1853 } 1854 if (stringFilter) { 1855 a = [start, end]; 1856 stringFilter(a, target, prop); 1857 start = a[0]; 1858 end = a[1]; 1859 } 1860 startNums = start.match(_complexStringNumExp) || []; 1861 while (result = _complexStringNumExp.exec(end)) { 1862 endNum = result[0]; 1863 chunk = end.substring(index, result.index); 1864 if (color) { 1865 color = (color + 1) % 5; 1866 } else if (chunk.substr(-5) === "rgba(") { 1867 color = 1; 1868 } 1869 if (endNum !== startNums[matchIndex++]) { 1870 startNum = parseFloat(startNums[matchIndex - 1]) || 0; 1871 pt._pt = { 1872 _next: pt._pt, 1873 p: chunk || matchIndex === 1 ? chunk : ",", 1874 //note: SVG spec allows omission of comma/space when a negative sign is wedged between two numbers, like 2.5-5.3 instead of 2.5,-5.3 but when tweening, the negative value may switch to positive, so we insert the comma just in case. 1875 s: startNum, 1876 c: endNum.charAt(1) === "=" ? _parseRelative(startNum, endNum) - startNum : parseFloat(endNum) - startNum, 1877 m: color && color < 4 ? Math.round : 0 1878 }; 1879 index = _complexStringNumExp.lastIndex; 1880 } 1881 } 1882 pt.c = index < end.length ? end.substring(index, end.length) : ""; 1883 pt.fp = funcParam; 1884 if (_relExp.test(end) || hasRandom) { 1885 pt.e = 0; 1886 } 1887 this._pt = pt; 1888 return pt; 1889}, _addPropTween = function _addPropTween2(target, prop, start, end, index, targets, modifier, stringFilter, funcParam, optional) { 1890 _isFunction$1(end) && (end = end(index || 0, target, targets)); 1891 var currentValue = target[prop], parsedStart = start !== "get" ? start : !_isFunction$1(currentValue) ? currentValue : funcParam ? target[prop.indexOf("set") || !_isFunction$1(target["get" + prop.substr(3)]) ? prop : "get" + prop.substr(3)](funcParam) : target[prop](), setter = !_isFunction$1(currentValue) ? _setterPlain : funcParam ? _setterFuncWithParam : _setterFunc, pt; 1892 if (_isString$1(end)) { 1893 if (~end.indexOf("random(")) { 1894 end = _replaceRandom(end); 1895 } 1896 if (end.charAt(1) === "=") { 1897 pt = _parseRelative(parsedStart, end) + (getUnit(parsedStart) || 0); 1898 if (pt || pt === 0) { 1899 end = pt; 1900 } 1901 } 1902 } 1903 if (!optional || parsedStart !== end || _forceAllPropTweens) { 1904 if (!isNaN(parsedStart * end) && end !== "") { 1905 pt = new PropTween(this._pt, target, prop, +parsedStart || 0, end - (parsedStart || 0), typeof currentValue === "boolean" ? _renderBoolean : _renderPlain, 0, setter); 1906 funcParam && (pt.fp = funcParam); 1907 modifier && pt.modifier(modifier, this, target); 1908 return this._pt = pt; 1909 } 1910 !currentValue && !(prop in target) && _missingPlugin(prop, end); 1911 return _addComplexStringPropTween.call(this, target, prop, parsedStart, end, setter, stringFilter || _config.stringFilter, funcParam); 1912 } 1913}, _processVars = function _processVars2(vars, index, target, targets, tween) { 1914 _isFunction$1(vars) && (vars = _parseFuncOrString(vars, tween, index, target, targets)); 1915 if (!_isObject$1(vars) || vars.style && vars.nodeType || _isArray(vars) || _isTypedArray(vars)) { 1916 return _isString$1(vars) ? _parseFuncOrString(vars, tween, index, target, targets) : vars; 1917 } 1918 var copy = {}, p; 1919 for (p in vars) { 1920 copy[p] = _parseFuncOrString(vars[p], tween, index, target, targets); 1921 } 1922 return copy; 1923}, _checkPlugin = function _checkPlugin2(property, vars, tween, index, target, targets) { 1924 var plugin, pt, ptLookup, i; 1925 if (_plugins[property] && (plugin = new _plugins[property]()).init(target, plugin.rawVars ? vars[property] : _processVars(vars[property], index, target, targets, tween), tween, index, targets) !== false) { 1926 tween._pt = pt = new PropTween(tween._pt, target, property, 0, 1, plugin.render, plugin, 0, plugin.priority); 1927 if (tween !== _quickTween) { 1928 ptLookup = tween._ptLookup[tween._targets.indexOf(target)]; 1929 i = plugin._props.length; 1930 while (i--) { 1931 ptLookup[plugin._props[i]] = pt; 1932 } 1933 } 1934 } 1935 return plugin; 1936}, _overwritingTween, _forceAllPropTweens, _initTween = function _initTween2(tween, time, tTime) { 1937 var vars = tween.vars, ease = vars.ease, startAt = vars.startAt, immediateRender = vars.immediateRender, lazy = vars.lazy, onUpdate = vars.onUpdate, runBackwards = vars.runBackwards, yoyoEase = vars.yoyoEase, keyframes = vars.keyframes, autoRevert = vars.autoRevert, dur = tween._dur, prevStartAt = tween._startAt, targets = tween._targets, parent = tween.parent, fullTargets = parent && parent.data === "nested" ? parent.vars.targets : targets, autoOverwrite = tween._overwrite === "auto" && !_suppressOverwrites$1, tl = tween.timeline, cleanVars, i, p, pt, target, hasPriority, gsData, harness, plugin, ptLookup, index, harnessVars, overwritten; 1938 tl && (!keyframes || !ease) && (ease = "none"); 1939 tween._ease = _parseEase(ease, _defaults$1.ease); 1940 tween._yEase = yoyoEase ? _invertEase(_parseEase(yoyoEase === true ? ease : yoyoEase, _defaults$1.ease)) : 0; 1941 if (yoyoEase && tween._yoyo && !tween._repeat) { 1942 yoyoEase = tween._yEase; 1943 tween._yEase = tween._ease; 1944 tween._ease = yoyoEase; 1945 } 1946 tween._from = !tl && !!vars.runBackwards; 1947 if (!tl || keyframes && !vars.stagger) { 1948 harness = targets[0] ? _getCache(targets[0]).harness : 0; 1949 harnessVars = harness && vars[harness.prop]; 1950 cleanVars = _copyExcluding(vars, _reservedProps); 1951 if (prevStartAt) { 1952 prevStartAt._zTime < 0 && prevStartAt.progress(1); 1953 time < 0 && runBackwards && immediateRender && !autoRevert ? prevStartAt.render(-1, true) : prevStartAt.revert(runBackwards && dur ? _revertConfigNoKill : _startAtRevertConfig); 1954 prevStartAt._lazy = 0; 1955 } 1956 if (startAt) { 1957 _removeFromParent(tween._startAt = Tween.set(targets, _setDefaults$1({ 1958 data: "isStart", 1959 overwrite: false, 1960 parent, 1961 immediateRender: true, 1962 lazy: !prevStartAt && _isNotFalse(lazy), 1963 startAt: null, 1964 delay: 0, 1965 onUpdate: onUpdate && function() { 1966 return _callback$1(tween, "onUpdate"); 1967 }, 1968 stagger: 0 1969 }, startAt))); 1970 tween._startAt._dp = 0; 1971 tween._startAt._sat = tween; 1972 time < 0 && (_reverting$1 || !immediateRender && !autoRevert) && tween._startAt.revert(_revertConfigNoKill); 1973 if (immediateRender) { 1974 if (dur && time <= 0 && tTime <= 0) { 1975 time && (tween._zTime = time); 1976 return; 1977 } 1978 } 1979 } else if (runBackwards && dur) { 1980 if (!prevStartAt) { 1981 time && (immediateRender = false); 1982 p = _setDefaults$1({ 1983 overwrite: false, 1984 data: "isFromStart", 1985 //we tag the tween with as "isFromStart" so that if [inside a plugin] we need to only do something at the very END of a tween, we have a way of identifying this tween as merely the one that's setting the beginning values for a "from()" tween. For example, clearProps in CSSPlugin should only get applied at the very END of a tween and without this tag, from(...{height:100, clearProps:"height", delay:1}) would wipe the height at the beginning of the tween and after 1 second, it'd kick back in. 1986 lazy: immediateRender && !prevStartAt && _isNotFalse(lazy), 1987 immediateRender, 1988 //zero-duration tweens render immediately by default, but if we're not specifically instructed to render this tween immediately, we should skip this and merely _init() to record the starting values (rendering them immediately would push them to completion which is wasteful in that case - we'd have to render(-1) immediately after) 1989 stagger: 0, 1990 parent 1991 //ensures that nested tweens that had a stagger are handled properly, like gsap.from(".class", {y: gsap.utils.wrap([-100,100]), stagger: 0.5}) 1992 }, cleanVars); 1993 harnessVars && (p[harness.prop] = harnessVars); 1994 _removeFromParent(tween._startAt = Tween.set(targets, p)); 1995 tween._startAt._dp = 0; 1996 tween._startAt._sat = tween; 1997 time < 0 && (_reverting$1 ? tween._startAt.revert(_revertConfigNoKill) : tween._startAt.render(-1, true)); 1998 tween._zTime = time; 1999 if (!immediateRender) { 2000 _initTween2(tween._startAt, _tinyNum, _tinyNum); 2001 } else if (!time) { 2002 return; 2003 } 2004 } 2005 } 2006 tween._pt = tween._ptCache = 0; 2007 lazy = dur && _isNotFalse(lazy) || lazy && !dur; 2008 for (i = 0; i < targets.length; i++) { 2009 target = targets[i]; 2010 gsData = target._gsap || _harness(targets)[i]._gsap; 2011 tween._ptLookup[i] = ptLookup = {}; 2012 _lazyLookup[gsData.id] && _lazyTweens.length && _lazyRender(); 2013 index = fullTargets === targets ? i : fullTargets.indexOf(target); 2014 if (harness && (plugin = new harness()).init(target, harnessVars || cleanVars, tween, index, fullTargets) !== false) { 2015 tween._pt = pt = new PropTween(tween._pt, target, plugin.name, 0, 1, plugin.render, plugin, 0, plugin.priority); 2016 plugin._props.forEach(function(name) { 2017 ptLookup[name] = pt; 2018 }); 2019 plugin.priority && (hasPriority = 1); 2020 } 2021 if (!harness || harnessVars) { 2022 for (p in cleanVars) { 2023 if (_plugins[p] && (plugin = _checkPlugin(p, cleanVars, tween, index, target, fullTargets))) { 2024 plugin.priority && (hasPriority = 1); 2025 } else { 2026 ptLookup[p] = pt = _addPropTween.call(tween, target, p, "get", cleanVars[p], index, fullTargets, 0, vars.stringFilter); 2027 } 2028 } 2029 } 2030 tween._op && tween._op[i] && tween.kill(target, tween._op[i]); 2031 if (autoOverwrite && tween._pt) { 2032 _overwritingTween = tween; 2033 _globalTimeline.killTweensOf(target, ptLookup, tween.globalTime(time)); 2034 overwritten = !tween.parent; 2035 _overwritingTween = 0; 2036 } 2037 tween._pt && lazy && (_lazyLookup[gsData.id] = 1); 2038 } 2039 hasPriority && _sortPropTweensByPriority(tween); 2040 tween._onInit && tween._onInit(tween); 2041 } 2042 tween._onUpdate = onUpdate; 2043 tween._initted = (!tween._op || tween._pt) && !overwritten; 2044 keyframes && time <= 0 && tl.render(_bigNum$1, true, true); 2045}, _updatePropTweens = function _updatePropTweens2(tween, property, value, start, startIsRelative, ratio, time, skipRecursion) { 2046 var ptCache = (tween._pt && tween._ptCache || (tween._ptCache = {}))[property], pt, rootPT, lookup, i; 2047 if (!ptCache) { 2048 ptCache = tween._ptCache[property] = []; 2049 lookup = tween._ptLookup; 2050 i = tween._targets.length; 2051 while (i--) { 2052 pt = lookup[i][property]; 2053 if (pt && pt.d && pt.d._pt) { 2054 pt = pt.d._pt; 2055 while (pt && pt.p !== property && pt.fp !== property) { 2056 pt = pt._next; 2057 } 2058 } 2059 if (!pt) { 2060 _forceAllPropTweens = 1; 2061 tween.vars[property] = "+=0"; 2062 _initTween(tween, time); 2063 _forceAllPropTweens = 0; 2064 return skipRecursion ? _warn(property + " not eligible for reset") : 1; 2065 } 2066 ptCache.push(pt); 2067 } 2068 } 2069 i = ptCache.length; 2070 while (i--) { 2071 rootPT = ptCache[i]; 2072 pt = rootPT._pt || rootPT; 2073 pt.s = (start || start === 0) && !startIsRelative ? start : pt.s + (start || 0) + ratio * pt.c; 2074 pt.c = value - pt.s; 2075 rootPT.e && (rootPT.e = _round$
20752(value) + getUnit(rootPT.e)); 2076 rootPT.b && (rootPT.b = pt.s + getUnit(rootPT.b)); 2077 } 2078}, _addAliasesToVars = function _addAliasesToVars2(targets, vars) { 2079 var harness = targets[0] ? _getCache(targets[0]).harness : 0, propertyAliases = harness && harness.aliases, copy, p, i, aliases; 2080 if (!propertyAliases) { 2081 return vars; 2082 }
vendor: 4,529 bytes, lines 2083-2179
2083 copy = _merge({}, vars); 2084 for (p in propertyAliases) { 2085 if (p in copy) { 2086 aliases = propertyAliases[p].split(","); 2087 i = aliases.length; 2088 while (i--) { 2089 copy[aliases[i]] = copy[p]; 2090 } 2091 } 2092 } 2093 return copy; 2094}, _parseKeyframe = function _parseKeyframe2(prop, obj, allProps, easeEach) { 2095 var ease = obj.ease || easeEach || "power1.inOut", p, a; 2096 if (_isArray(obj)) { 2097 a = allProps[prop] || (allProps[prop] = []); 2098 obj.forEach(function(value, i) { 2099 return a.push({ 2100 t: i / (obj.length - 1) * 100, 2101 v: value, 2102 e: ease 2103 }); 2104 }); 2105 } else { 2106 for (p in obj) { 2107 a = allProps[p] || (allProps[p] = []); 2108 p === "ease" || a.push({ 2109 t: parseFloat(prop), 2110 v: obj[p], 2111 e: ease 2112 }); 2113 } 2114 } 2115}, _parseFuncOrString = function _parseFuncOrString2(value, tween, i, target, targets) { 2116 return _isFunction$1(value) ? value.call(tween, i, target, targets) : _isString$1(value) && ~value.indexOf("random(") ? _replaceRandom(value) : value; 2117}, _staggerTweenProps = _callbackNames + "repeat,repeatDelay,yoyo,repeatRefresh,yoyoEase,autoRevert", _staggerPropsToSkip = {}; 2118_forEachName(_staggerTweenProps + ",id,stagger,delay,duration,paused,scrollTrigger", function(name) { 2119 return _staggerPropsToSkip[name] = 1; 2120}); 2121var Tween = /* @__PURE__ */ function(_Animation2) { 2122 _inheritsLoose(Tween2, _Animation2); 2123 function Tween2(targets, vars, position, skipInherit) { 2124 var _this3; 2125 if (typeof vars === "number") { 2126 position.duration = vars; 2127 vars = position; 2128 position = null; 2129 } 2130 _this3 = _Animation2.call(this, skipInherit ? vars : _inheritDefaults(vars)) || this; 2131 var _this3$vars = _this3.vars, duration = _this3$vars.duration, delay = _this3$vars.delay, immediateRender = _this3$vars.immediateRender, stagger = _this3$vars.stagger, overwrite = _this3$vars.overwrite, keyframes = _this3$vars.keyframes, defaults2 = _this3$vars.defaults, scrollTrigger = _this3$vars.scrollTrigger, yoyoEase = _this3$vars.yoyoEase, parent = vars.parent || _globalTimeline, parsedTargets = (_isArray(targets) || _isTypedArray(targets) ? _isNumber$1(targets[0]) : "length" in vars) ? [targets] : toArray(targets), tl, i, copy, l, p, curTarget, staggerFunc, staggerVarsToMerge; 2132 _this3._targets = parsedTargets.length ? _harness(parsedTargets) : _warn("GSAP target " + targets + " not found. https://gsap.com", !_config.nullTargetWarn) || []; 2133 _this3._ptLookup = []; 2134 _this3._overwrite = overwrite; 2135 if (keyframes || stagger || _isFuncOrString(duration) || _isFuncOrString(delay)) { 2136 vars = _this3.vars; 2137 tl = _this3.timeline = new Timeline({ 2138 data: "nested", 2139 defaults: defaults2 || {}, 2140 targets: parent && parent.data === "nested" ? parent.vars.targets : parsedTargets 2141 }); 2142 tl.kill(); 2143 tl.parent = tl._dp = _assertThisInitialized(_this3); 2144 tl._start = 0; 2145 if (stagger || _isFuncOrString(duration) || _isFuncOrString(delay)) { 2146 l = parsedTargets.length; 2147 staggerFunc = stagger && distribute(stagger); 2148 if (_isObject$1(stagger)) { 2149 for (p in stagger) { 2150 if (~_staggerTweenProps.indexOf(p)) { 2151 staggerVarsToMerge || (staggerVarsToMerge = {}); 2152 staggerVarsToMerge[p] = stagger[p]; 2153 } 2154 } 2155 } 2156 for (i = 0; i < l; i++) { 2157 copy = _copyExcluding(vars, _staggerPropsToSkip); 2158 copy.stagger = 0; 2159 yoyoEase && (copy.yoyoEase = yoyoEase); 2160 staggerVarsToMerge && _merge(copy, staggerVarsToMerge); 2161 curTarget = parsedTargets[i]; 2162 copy.duration = +_parseFuncOrString(duration, _assertThisInitialized(_this3), i, curTarget, parsedTargets); 2163 copy.delay = (+_parseFuncOrString(delay, _assertThisInitialized(_this3), i, curTarget, parsedTargets) || 0) - _this3._delay; 2164 if (!stagger && l === 1 && copy.delay) { 2165 _this3._delay = delay = copy.delay; 2166 _this3._start += delay; 2167 copy.delay = 0; 2168 } 2169 tl.to(curTarget, copy, staggerFunc ? staggerFunc(i, curTarget, parsedTargets) : 0); 2170 tl._ease = _easeMap.none; 2171 } 2172 tl.duration() ? duration = delay = 0 : _this3.timeline = 0; 2173 } else if (keyframes) { 2174 _inheritDefaults(_setDefaults$1(tl.vars.defaults, { 2175 ease: "none" 2176 })); 2177 tl._ease = _parseEase(keyframes.ease || vars.ease || "none"); 2178 var time = 0, a, kf, v; 2179 if (_isArray(keyframes)) {
vendor: 6,028 bytes, lines 2180-2324
2180 keyframes.forEach(function(frame) { 2181 return tl.to(parsedTargets, frame, ">"); 2182 }); 2183 tl.duration(); 2184 } else { 2185 copy = {}; 2186 for (p in keyframes) { 2187 p === "ease" || p === "easeEach" || _parseKeyframe(p, keyframes[p], copy, keyframes.easeEach); 2188 } 2189 for (p in copy) { 2190 a = copy[p].sort(function(a2, b) { 2191 return a2.t - b.t; 2192 }); 2193 time = 0; 2194 for (i = 0; i < a.length; i++) { 2195 kf = a[i]; 2196 v = { 2197 ease: kf.e, 2198 duration: (kf.t - (i ? a[i - 1].t : 0)) / 100 * duration 2199 }; 2200 v[p] = kf.v; 2201 tl.to(parsedTargets, v, time); 2202 time += v.duration; 2203 } 2204 } 2205 tl.duration() < duration && tl.to({}, { 2206 duration: duration - tl.duration() 2207 }); 2208 } 2209 } 2210 duration || _this3.duration(duration = tl.duration()); 2211 } else { 2212 _this3.timeline = 0; 2213 } 2214 if (overwrite === true && !_suppressOverwrites$1) { 2215 _overwritingTween = _assertThisInitialized(_this3); 2216 _globalTimeline.killTweensOf(parsedTargets); 2217 _overwritingTween = 0; 2218 } 2219 _addToTimeline(parent, _assertThisInitialized(_this3), position); 2220 vars.reversed && _this3.reverse(); 2221 vars.paused && _this3.paused(true); 2222 if (immediateRender || !duration && !keyframes && _this3._start === _roundPrecise(parent._time) && _isNotFalse(immediateRender) && _hasNoPausedAncestors(_assertThisInitialized(_this3)) && parent.data !== "nested") { 2223 _this3._tTime = -_tinyNum; 2224 _this3.render(Math.max(0, -delay) || 0); 2225 } 2226 scrollTrigger && _scrollTrigger(_assertThisInitialized(_this3), scrollTrigger); 2227 return _this3; 2228 } 2229 var _proto3 = Tween2.prototype; 2230 _proto3.render = function render3(totalTime, suppressEvents, force) { 2231 var prevTime = this._time, tDur = this._tDur, dur = this._dur, isNegative = totalTime < 0, tTime = totalTime > tDur - _tinyNum && !isNegative ? tDur : totalTime < _tinyNum ? 0 : totalTime, time, pt, iteration, cycleDuration, prevIteration, isYoyo, ratio, timeline2, yoyoEase; 2232 if (!dur) { 2233 _renderZeroDurationTween(this, totalTime, suppressEvents, force); 2234 } else if (tTime !== this._tTime || !totalTime || force || !this._initted && this._tTime || this._startAt && this._zTime < 0 !== isNegative) { 2235 time = tTime; 2236 timeline2 = this.timeline; 2237 if (this._repeat) { 2238 cycleDuration = dur + this._rDelay; 2239 if (this._repeat < -1 && isNegative) { 2240 return this.totalTime(cycleDuration * 100 + totalTime, suppressEvents, force); 2241 } 2242 time = _roundPrecise(tTime % cycleDuration); 2243 if (tTime === tDur) { 2244 iteration = this._repeat; 2245 time = dur; 2246 } else { 2247 iteration = ~~(tTime / cycleDuration); 2248 if (iteration && iteration === _roundPrecise(tTime / cycleDuration)) { 2249 time = dur; 2250 iteration--; 2251 } 2252 time > dur && (time = dur); 2253 } 2254 isYoyo = this._yoyo && iteration & 1; 2255 if (isYoyo) { 2256 yoyoEase = this._yEase; 2257 time = dur - time; 2258 } 2259 prevIteration = _animationCycle(this._tTime, cycleDuration); 2260 if (time === prevTime && !force && this._initted && iteration === prevIteration) { 2261 this._tTime = tTime; 2262 return this; 2263 } 2264 if (iteration !== prevIteration) { 2265 timeline2 && this._yEase && _propagateYoyoEase(timeline2, isYoyo); 2266 if (this.vars.repeatRefresh && !isYoyo && !this._lock && this._time !== cycleDuration && this._initted) { 2267 this._lock = force = 1; 2268 this.render(_roundPrecise(cycleDuration * iteration), true).invalidate()._lock = 0; 2269 } 2270 } 2271 } 2272 if (!this._initted) { 2273 if (_attemptInitTween(this, isNegative ? totalTime : time, force, suppressEvents, tTime)) { 2274 this._tTime = 0; 2275 return this; 2276 } 2277 if (prevTime !== this._time && !(force && this.vars.repeatRefresh && iteration !== prevIteration)) { 2278 return this; 2279 } 2280 if (dur !== this._dur) { 2281 return this.render(totalTime, suppressEvents, force); 2282 } 2283 } 2284 this._tTime = tTime; 2285 this._time = time; 2286 if (!this._act && this._ts) { 2287 this._act = 1; 2288 this._lazy = 0; 2289 } 2290 this.ratio = ratio = (yoyoEase || this._ease)(time / dur); 2291 if (this._from) { 2292 this.ratio = ratio = 1 - ratio; 2293 } 2294 if (time && !prevTime && !suppressEvents && !iteration) { 2295 _callback$1(this, "onStart"); 2296 if (this._tTime !== tTime) { 2297 return this; 2298 } 2299 } 2300 pt = this._pt; 2301 while (pt) { 2302 pt.r(ratio, pt.d); 2303 pt = pt._next; 2304 } 2305 timeline2 && timeline2.render(totalTime < 0 ? totalTime : timeline2._dur * timeline2._ease(time / this._dur), suppressEvents, force) || this._startAt && (this._zTime = totalTime); 2306 if (this._onUpdate && !suppressEvents) { 2307 isNegative && _rewindStartAt(this, totalTime, suppressEvents, force); 2308 _callback$1(this, "onUpdate"); 2309 } 2310 this._repeat && iteration !== prevIteration && this.vars.onRepeat && !suppressEvents && this.parent && _callback$1(this, "onRepeat"); 2311 if ((tTime === this._tDur || !tTime) && this._tTime === tTime) { 2312 isNegative && !this._onUpdate && _rewindStartAt(this, totalTime, true, true); 2313 (totalTime || !dur) && (tTime === this._tDur && this._ts > 0 || !tTime && this._ts < 0) && _removeFromParent(this, 1); 2314 if (!suppressEvents && !(isNegative && !prevTime) && (tTime || prevTime || isYoyo)) { 2315 _callback$1(this, tTime === tDur ? "onComplete" : "onReverseComplete", true); 2316 this._prom && !(tTime < tDur && this.timeScale() > 0) && this._prom(); 2317 } 2318 } 2319 } 2320 return this; 2321 }; 2322 _proto3.targets = function targets() { 2323 return this._targets; 2324 };
vendor: 1,240 bytes, lines 2325-2351
2325 _proto3.invalidate = function invalidate(soft) { 2326 (!soft || !this.vars.runBackwards) && (this._startAt = 0); 2327 this._pt = this._op = this._onUpdate = this._lazy = this.ratio = 0; 2328 this._ptLookup = []; 2329 this.timeline && this.timeline.invalidate(soft); 2330 return _Animation2.prototype.invalidate.call(this, soft); 2331 }; 2332 _proto3.resetTo = function resetTo(property, value, start, startIsRelative, skipRecursion) { 2333 _tickerActive || _ticker.wake(); 2334 this._ts || this.play(); 2335 var time = Math.min(this._dur, (this._dp._time - this._start) * this._ts), ratio; 2336 this._initted || _initTween(this, time); 2337 ratio = this._ease(time / this._dur); 2338 if (_updatePropTweens(this, property, value, start, startIsRelative, ratio, time, skipRecursion)) { 2339 return this.resetTo(property, value, start, startIsRelative, 1); 2340 } 2341 _alignPlayhead(this, 0); 2342 this.parent || _addLinkedListItem(this._dp, this, "_first", "_last", this._dp._sort ? "_start" : 0); 2343 return this.render(0); 2344 }; 2345 _proto3.kill = function kill(targets, vars) { 2346 if (vars === void 0) { 2347 vars = "all"; 2348 } 2349 if (!targets && (!vars || vars === "all")) { 2350 this._lazy = this._pt = 0; 2351 return this.parent ? _interrupt(this) :
vendor: 7,944 bytes, lines 2351-2576
2351 this; 2352 } 2353 if (this.timeline) { 2354 var tDur = this.timeline.totalDuration(); 2355 this.timeline.killTweensOf(targets, vars, _overwritingTween && _overwritingTween.vars.overwrite !== true)._first || _interrupt(this); 2356 this.parent && tDur !== this.timeline.totalDuration() && _setDuration(this, this._dur * this.timeline._tDur / tDur, 0, 1); 2357 return this; 2358 } 2359 var parsedTargets = this._targets, killingTargets = targets ? toArray(targets) : parsedTargets, propTweenLookup = this._ptLookup, firstPT = this._pt, overwrittenProps, curLookup, curOverwriteProps, props, p, pt, i; 2360 if ((!vars || vars === "all") && _arraysMatch(parsedTargets, killingTargets)) { 2361 vars === "all" && (this._pt = 0); 2362 return _interrupt(this); 2363 } 2364 overwrittenProps = this._op = this._op || []; 2365 if (vars !== "all") { 2366 if (_isString$1(vars)) { 2367 p = {}; 2368 _forEachName(vars, function(name) { 2369 return p[name] = 1; 2370 }); 2371 vars = p; 2372 } 2373 vars = _addAliasesToVars(parsedTargets, vars); 2374 } 2375 i = parsedTargets.length; 2376 while (i--) { 2377 if (~killingTargets.indexOf(parsedTargets[i])) { 2378 curLookup = propTweenLookup[i]; 2379 if (vars === "all") { 2380 overwrittenProps[i] = vars; 2381 props = curLookup; 2382 curOverwriteProps = {}; 2383 } else { 2384 curOverwriteProps = overwrittenProps[i] = overwrittenProps[i] || {}; 2385 props = vars; 2386 } 2387 for (p in props) { 2388 pt = curLookup && curLookup[p]; 2389 if (pt) { 2390 if (!("kill" in pt.d) || pt.d.kill(p) === true) { 2391 _removeLinkedListItem(this, pt, "_pt"); 2392 } 2393 delete curLookup[p]; 2394 } 2395 if (curOverwriteProps !== "all") { 2396 curOverwriteProps[p] = 1; 2397 } 2398 } 2399 } 2400 } 2401 this._initted && !this._pt && firstPT && _interrupt(this); 2402 return this; 2403 }; 2404 Tween2.to = function to(targets, vars) { 2405 return new Tween2(targets, vars, arguments[2]); 2406 }; 2407 Tween2.from = function from(targets, vars) { 2408 return _createTweenType(1, arguments); 2409 }; 2410 Tween2.delayedCall = function delayedCall(delay, callback, params, scope) { 2411 return new Tween2(callback, 0, { 2412 immediateRender: false, 2413 lazy: false, 2414 overwrite: false, 2415 delay, 2416 onComplete: callback, 2417 onReverseComplete: callback, 2418 onCompleteParams: params, 2419 onReverseCompleteParams: params, 2420 callbackScope: scope 2421 }); 2422 }; 2423 Tween2.fromTo = function fromTo(targets, fromVars, toVars) { 2424 return _createTweenType(2, arguments); 2425 }; 2426 Tween2.set = function set(targets, vars) { 2427 vars.duration = 0; 2428 vars.repeatDelay || (vars.repeat = 0); 2429 return new Tween2(targets, vars); 2430 }; 2431 Tween2.killTweensOf = function killTweensOf(targets, props, onlyActive) { 2432 return _globalTimeline.killTweensOf(targets, props, onlyActive); 2433 }; 2434 return Tween2; 2435}(Animation); 2436_setDefaults$1(Tween.prototype, { 2437 _targets: [], 2438 _lazy: 0, 2439 _startAt: 0, 2440 _op: 0, 2441 _onInit: 0 2442}); 2443_forEachName("staggerTo,staggerFrom,staggerFromTo", function(name) { 2444 Tween[name] = function() { 2445 var tl = new Timeline(), params = _slice.call(arguments, 0); 2446 params.splice(name === "staggerFromTo" ? 5 : 4, 0, 0); 2447 return tl[name].apply(tl, params); 2448 }; 2449}); 2450var _setterPlain = function _setterPlain2(target, property, value) { 2451 return target[property] = value; 2452}, _setterFunc = function _setterFunc2(target, property, value) { 2453 return target[property](value); 2454}, _setterFuncWithParam = function _setterFuncWithParam2(target, property, value, data) { 2455 return target[property](data.fp, value); 2456}, _setterAttribute = function _setterAttribute2(target, property, value) { 2457 return target.setAttribute(property, value); 2458}, _getSetter = function _getSetter2(target, property) { 2459 return _isFunction$1(target[property]) ? _setterFunc : _isUndefined(target[property]) && target.setAttribute ? _setterAttribute : _setterPlain; 2460}, _renderPlain = function _renderPlain2(ratio, data) { 2461 return data.set(data.t, data.p, Math.round((data.s + data.c * ratio) * 1e6) / 1e6, data); 2462}, _renderBoolean = function _renderBoolean2(ratio, data) { 2463 return data.set(data.t, data.p, !!(data.s + data.c * ratio), data); 2464}, _renderComplexString = function _renderComplexString2(ratio, data) { 2465 var pt = data._pt, s = ""; 2466 if (!ratio && data.b) { 2467 s = data.b; 2468 } else if (ratio === 1 && data.e) { 2469 s = data.e; 2470 } else { 2471 while (pt) { 2472 s = pt.p + (pt.m ? pt.m(pt.s + pt.c * ratio) : Math.round((pt.s + pt.c * ratio) * 1e4) / 1e4) + s; 2473 pt = pt._next; 2474 } 2475 s += data.c; 2476 } 2477 data.set(data.t, data.p, s, data); 2478}, _renderPropTweens = function _renderPropTweens2(ratio, data) { 2479 var pt = data._pt; 2480 while (pt) { 2481 pt.r(ratio, pt.d); 2482 pt = pt._next; 2483 } 2484}, _addPluginModifier = function _addPluginModifier2(modifier, tween, target, property) { 2485 var pt = this._pt, next; 2486 while (pt) { 2487 next = pt._next; 2488 pt.p === property && pt.modifier(modifier, tween, target); 2489 pt = next; 2490 } 2491}, _killPropTweensOf = function _killPropTweensOf2(property) { 2492 var pt = this._pt, hasNonDependentRemaining, next; 2493 while (pt) { 2494 next = pt._next; 2495 if (pt.p === property && !pt.op || pt.op === property) { 2496 _removeLinkedListItem(this, pt, "_pt"); 2497 } else if (!pt.dep) { 2498 hasNonDependentRemaining = 1; 2499 } 2500 pt = next; 2501 } 2502 return !hasNonDependentRemaining; 2503}, _setterWithModifier = function _setterWithModifier2(target, property, value, data) { 2504 data.mSet(target, property, data.m.call(data.tween, value, data.mt), data); 2505}, _sortPropTweensByPriority = function _sortPropTweensByPriority2(parent) { 2506 var pt = parent._pt, next, pt2, first, last; 2507 while (pt) { 2508 next = pt._next; 2509 pt2 = first; 2510 while (pt2 && pt2.pr > pt.pr) { 2511 pt2 = pt2._next; 2512 } 2513 if (pt._prev = pt2 ? pt2._prev : last) { 2514 pt._prev._next = pt; 2515 } else { 2516 first = pt; 2517 } 2518 if (pt._next = pt2) { 2519 pt2._prev = pt; 2520 } else { 2521 last = pt; 2522 } 2523 pt = next; 2524 } 2525 parent._pt = first; 2526}; 2527var PropTween = /* @__PURE__ */ function() { 2528 function PropTween2(next, target, prop, start, change, renderer, data, setter, priority) { 2529 this.t = target; 2530 this.s = start; 2531 this.c = change; 2532 this.p = prop; 2533 this.r = renderer || _renderPlain; 2534 this.d = data || this; 2535 this.set = setter || _setterPlain; 2536 this.pr = priority || 0; 2537 this._next = next; 2538 if (next) { 2539 next._prev = this; 2540 } 2541 } 2542 var _proto4 = PropTween2.prototype; 2543 _proto4.modifier = function modifier(func, tween, target) { 2544 this.mSet = this.mSet || this.set; 2545 this.set = _setterWithModifier; 2546 this.m = func; 2547 this.mt = target; 2548 this.tween = tween; 2549 }; 2550 return PropTween2; 2551}(); 2552_forEachName(_callbackNames + "parent,duration,ease,delay,overwrite,runBackwards,startAt,yoyo,immediateRender,repeat,repeatDelay,data,paused,reversed,lazy,callbackScope,stringFilter,id,yoyoEase,stagger,inherit,repeatRefresh,keyframes,autoRevert,scrollTrigger", function(name) { 2553 return _reservedProps[name] = 1; 2554}); 2555_globals.TweenMax = _globals.TweenLite = Tween; 2556_globals.TimelineLite = _globals.TimelineMax = Timeline; 2557_globalTimeline = new Timeline({ 2558 sortChildren: false, 2559 defaults: _defaults$1, 2560 autoRemoveChildren: true, 2561 id: "root", 2562 smoothChildTiming: true 2563}); 2564_config.stringFilter = _colorStringFilter; 2565var _media = [], _listeners$1 = {}, _emptyArray$1 = [], _lastMediaTime = 0, _contextID = 0, _dispatch$1 = function _dispatch(type) { 2566 return (_listeners$1[type] || _emptyArray$1).map(function(f) { 2567 return f(); 2568 }); 2569}, _onMediaChange = function _onMediaChange2() { 2570 var time = Date.now(), matches = []; 2571 if (time - _lastMediaTime > 2) { 2572 _dispatch$1("matchMediaInit"); 2573 _media.forEach(function(c) { 2574 var queries = c.queries, conditions = c.conditions, match, p, anyMatch, toggled; 2575 for (p in queries) { 2576 match = _win$
vendor: 9,540 bytes, lines 2576-2850
25764.matchMedia(queries[p]).matches; 2577 match && (anyMatch = 1); 2578 if (match !== conditions[p]) { 2579 conditions[p] = match; 2580 toggled = 1; 2581 } 2582 } 2583 if (toggled) { 2584 c.revert(); 2585 anyMatch && matches.push(c); 2586 } 2587 }); 2588 _dispatch$1("matchMediaRevert"); 2589 matches.forEach(function(c) { 2590 return c.onMatch(c, function(func) { 2591 return c.add(null, func); 2592 }); 2593 }); 2594 _lastMediaTime = time; 2595 _dispatch$1("matchMedia"); 2596 } 2597}; 2598var Context = /* @__PURE__ */ function() { 2599 function Context2(func, scope) { 2600 this.selector = scope && selector(scope); 2601 this.data = []; 2602 this._r = []; 2603 this.isReverted = false; 2604 this.id = _contextID++; 2605 func && this.add(func); 2606 } 2607 var _proto5 = Context2.prototype; 2608 _proto5.add = function add(name, func, scope) { 2609 if (_isFunction$1(name)) { 2610 scope = func; 2611 func = name; 2612 name = _isFunction$1; 2613 } 2614 var self = this, f = function f2() { 2615 var prev = _context$3, prevSelector = self.selector, result; 2616 prev && prev !== self && prev.data.push(self); 2617 scope && (self.selector = selector(scope)); 2618 _context$3 = self; 2619 result = func.apply(self, arguments); 2620 _isFunction$1(result) && self._r.push(result); 2621 _context$3 = prev; 2622 self.selector = prevSelector; 2623 self.isReverted = false; 2624 return result; 2625 }; 2626 self.last = f; 2627 return name === _isFunction$1 ? f(self, function(func2) { 2628 return self.add(null, func2); 2629 }) : name ? self[name] = f : f; 2630 }; 2631 _proto5.ignore = function ignore(func) { 2632 var prev = _context$3; 2633 _context$3 = null; 2634 func(this); 2635 _context$3 = prev; 2636 }; 2637 _proto5.getTweens = function getTweens() { 2638 var a = []; 2639 this.data.forEach(function(e) { 2640 return e instanceof Context2 ? a.push.apply(a, e.getTweens()) : e instanceof Tween && !(e.parent && e.parent.data === "nested") && a.push(e); 2641 }); 2642 return a; 2643 }; 2644 _proto5.clear = function clear() { 2645 this._r.length = this.data.length = 0; 2646 }; 2647 _proto5.kill = function kill(revert, matchMedia2) { 2648 var _this4 = this; 2649 if (revert) { 2650 (function() { 2651 var tweens = _this4.getTweens(), i2 = _this4.data.length, t; 2652 while (i2--) { 2653 t = _this4.data[i2]; 2654 if (t.data === "isFlip") { 2655 t.revert(); 2656 t.getChildren(true, true, false).forEach(function(tween) { 2657 return tweens.splice(tweens.indexOf(tween), 1); 2658 }); 2659 } 2660 } 2661 tweens.map(function(t2) { 2662 return { 2663 g: t2._dur || t2._delay || t2._sat && !t2._sat.vars.immediateRender ? t2.globalTime(0) : -Infinity, 2664 t: t2 2665 }; 2666 }).sort(function(a, b) { 2667 return b.g - a.g || -Infinity; 2668 }).forEach(function(o) { 2669 return o.t.revert(revert); 2670 }); 2671 i2 = _this4.data.length; 2672 while (i2--) { 2673 t = _this4.data[i2]; 2674 if (t instanceof Timeline) { 2675 if (t.data !== "nested") { 2676 t.scrollTrigger && t.scrollTrigger.revert(); 2677 t.kill(); 2678 } 2679 } else { 2680 !(t instanceof Tween) && t.revert && t.revert(revert); 2681 } 2682 } 2683 _this4._r.forEach(function(f) { 2684 return f(revert, _this4); 2685 }); 2686 _this4.isReverted = true; 2687 })(); 2688 } else { 2689 this.data.forEach(function(e) { 2690 return e.kill && e.kill(); 2691 }); 2692 } 2693 this.clear(); 2694 if (matchMedia2) { 2695 var i = _media.length; 2696 while (i--) { 2697 _media[i].id === this.id && _media.splice(i, 1); 2698 } 2699 } 2700 }; 2701 _proto5.revert = function revert(config3) { 2702 this.kill(config3 || {}); 2703 }; 2704 return Context2; 2705}(); 2706var MatchMedia = /* @__PURE__ */ function() { 2707 function MatchMedia2(scope) { 2708 this.contexts = []; 2709 this.scope = scope; 2710 _context$3 && _context$3.data.push(this); 2711 } 2712 var _proto6 = MatchMedia2.prototype; 2713 _proto6.add = function add(conditions, func, scope) { 2714 _isObject$1(conditions) || (conditions = { 2715 matches: conditions 2716 }); 2717 var context3 = new Context(0, scope || this.scope), cond = context3.conditions = {}, mq, p, active; 2718 _context$3 && !context3.selector && (context3.selector = _context$3.selector); 2719 this.contexts.push(context3); 2720 func = context3.add("onMatch", func); 2721 context3.queries = conditions; 2722 for (p in conditions) { 2723 if (p === "all") { 2724 active = 1; 2725 } else { 2726 mq = _win$4.matchMedia(conditions[p]); 2727 if (mq) { 2728 _media.indexOf(context3) < 0 && _media.push(context3); 2729 (cond[p] = mq.matches) && (active = 1); 2730 mq.addListener ? mq.addListener(_onMediaChange) : mq.addEventListener("change", _onMediaChange); 2731 } 2732 } 2733 } 2734 active && func(context3, function(f) { 2735 return context3.add(null, f); 2736 }); 2737 return this; 2738 }; 2739 _proto6.revert = function revert(config3) { 2740 this.kill(config3 || {}); 2741 }; 2742 _proto6.kill = function kill(revert) { 2743 this.contexts.forEach(function(c) { 2744 return c.kill(revert, true); 2745 }); 2746 }; 2747 return MatchMedia2; 2748}(); 2749var _gsap = { 2750 registerPlugin: function registerPlugin() { 2751 for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { 2752 args[_key2] = arguments[_key2]; 2753 } 2754 args.forEach(function(config3) { 2755 return _createPlugin(config3); 2756 }); 2757 }, 2758 timeline: function timeline(vars) { 2759 return new Timeline(vars); 2760 }, 2761 getTweensOf: function getTweensOf(targets, onlyActive) { 2762 return _globalTimeline.getTweensOf(targets, onlyActive); 2763 }, 2764 getProperty: function getProperty(target, property, unit, uncache) { 2765 _isString$1(target) && (target = toArray(target)[0]); 2766 var getter = _getCache(target || {}).get, format = unit ? _passThrough$1 : _numericIfPossible; 2767 unit === "native" && (unit = ""); 2768 return !target ? target : !property ? function(property2, unit2, uncache2) { 2769 return format((_plugins[property2] && _plugins[property2].get || getter)(target, property2, unit2, uncache2)); 2770 } : format((_plugins[property] && _plugins[property].get || getter)(target, property, unit, uncache)); 2771 }, 2772 quickSetter: function quickSetter(target, property, unit) { 2773 target = toArray(target); 2774 if (target.length > 1) { 2775 var setters = target.map(function(t) { 2776 return gsap$3.quickSetter(t, property, unit); 2777 }), l = setters.length; 2778 return function(value) { 2779 var i = l; 2780 while (i--) { 2781 setters[i](value); 2782 } 2783 }; 2784 } 2785 target = target[0] || {}; 2786 var Plugin = _plugins[property], cache = _getCache(target), p = cache.harness && (cache.harness.aliases || {})[property] || property, setter = Plugin ? function(value) { 2787 var p2 = new Plugin(); 2788 _quickTween._pt = 0; 2789 p2.init(target, unit ? value + unit : value, _quickTween, 0, [target]); 2790 p2.render(1, p2); 2791 _quickTween._pt && _renderPropTweens(1, _quickTween); 2792 } : cache.set(target, p); 2793 return Plugin ? setter : function(value) { 2794 return setter(target, p, unit ? value + unit : value, cache, 1); 2795 }; 2796 }, 2797 quickTo: function quickTo(target, property, vars) { 2798 var _merge22; 2799 var tween = gsap$3.to(target, _merge((_merge22 = {}, _merge22[property] = "+=0.1", _merge22.paused = true, _merge22), vars || {})), func = function func2(value, start, startIsRelative) { 2800 return tween.resetTo(property, value, start, startIsRelative); 2801 }; 2802 func.tween = tween; 2803 return func; 2804 }, 2805 isTweening: function isTweening(targets) { 2806 return _globalTimeline.getTweensOf(targets, true).length > 0; 2807 }, 2808 defaults: function defaults(value) { 2809 value && value.ease && (value.ease = _parseEase(value.ease, _defaults$1.ease)); 2810 return _mergeDeep(_defaults$1, value || {}); 2811 }, 2812 config: function config2(value) { 2813 return _mergeDeep(_config, value || {}); 2814 }, 2815 registerEffect: function registerEffect(_ref3) { 2816 var name = _ref3.name, effect = _ref3.effect, plugins = _ref3.plugins, defaults2 = _ref3.defaults, extendTimeline = _ref3.extendTimeline; 2817 (plugins || "").split(",").forEach(function(pluginName) { 2818 return pluginName && !_plugins[pluginName] && !_globals[pluginName] && _warn(name + " effect requires " + pluginName + " plugin."); 2819 }); 2820 _effects[name] = function(targets, vars, tl) { 2821 return effect(toArray(targets), _setDefaults$1(vars || {}, defaults2), tl); 2822 }; 2823 if (extendTimeline) { 2824 Timeline.prototype[name] = function(targets, vars, position) { 2825 return this.add(_effects[name](targets, _isObject$1(vars) ? vars : (position = vars) && {}, this), position); 2826 }; 2827 } 2828 }, 2829 registerEase: function registerEase(name, ease) { 2830 _easeMap[name] = _parseEase(ease); 2831 }, 2832 parseEase: function parseEase(ease, defaultEase) { 2833 return arguments.length ? _parseEase(ease, defaultEase) : _easeMap; 2834 }, 2835 getById: function getById(id) { 2836 return _globalTimeline.getById(id); 2837 }, 2838 exportRoot: function exportRoot(vars, includeDelayedCalls) { 2839 if (vars === void 0) { 2840 vars = {}; 2841 } 2842 var tl = new Timeline(vars), child, next; 2843 tl.smoothChildTiming = _isNotFalse(vars.smoothChildTiming); 2844 _globalTimeline.remove(tl); 2845 tl._dp = 0; 2846 tl._time = tl._tTime = _globalTimeline._time; 2847 child = _globalTimeline._first; 2848 while (child) { 2849 next = child._next; 2850 if (includeDelayedCalls || !(!child._dur && child instanceof Tween && child.vars.onComplete === child._targets[0])) {
vendor: 2,157 bytes, lines 2851-2938
2851 _addToTimeline(tl, child, child._start - child._delay); 2852 } 2853 child = next; 2854 } 2855 _addToTimeline(_globalTimeline, tl, 0); 2856 return tl; 2857 }, 2858 context: function context(func, scope) { 2859 return func ? new Context(func, scope) : _context$3; 2860 }, 2861 matchMedia: function matchMedia(scope) { 2862 return new MatchMedia(scope); 2863 }, 2864 matchMediaRefresh: function matchMediaRefresh() { 2865 return _media.forEach(function(c) { 2866 var cond = c.conditions, found, p; 2867 for (p in cond) { 2868 if (cond[p]) { 2869 cond[p] = false; 2870 found = 1; 2871 } 2872 } 2873 found && c.revert(); 2874 }) || _onMediaChange(); 2875 }, 2876 addEventListener: function addEventListener(type, callback) { 2877 var a = _listeners$1[type] || (_listeners$1[type] = []); 2878 ~a.indexOf(callback) || a.push(callback); 2879 }, 2880 removeEventListener: function removeEventListener(type, callback) { 2881 var a = _listeners$1[type], i = a && a.indexOf(callback); 2882 i >= 0 && a.splice(i, 1); 2883 }, 2884 utils: { 2885 wrap, 2886 wrapYoyo, 2887 distribute, 2888 random, 2889 snap, 2890 normalize, 2891 getUnit, 2892 clamp, 2893 splitColor, 2894 toArray, 2895 selector, 2896 mapRange, 2897 pipe, 2898 unitize, 2899 interpolate, 2900 shuffle 2901 }, 2902 install: _install, 2903 effects: _effects, 2904 ticker: _ticker, 2905 updateRoot: Timeline.updateRoot, 2906 plugins: _plugins, 2907 globalTimeline: _globalTimeline, 2908 core: { 2909 PropTween, 2910 globals: _addGlobal, 2911 Tween, 2912 Timeline, 2913 Animation, 2914 getCache: _getCache, 2915 _removeLinkedListItem, 2916 reverting: function reverting() { 2917 return _reverting$1; 2918 }, 2919 context: function context2(toAdd) { 2920 if (toAdd && _context$3) { 2921 _context$3.data.push(toAdd); 2922 toAdd._ctx = _context$3; 2923 } 2924 return _context$3; 2925 }, 2926 suppressOverwrites: function suppressOverwrites(value) { 2927 return _suppressOverwrites$1 = value; 2928 } 2929 } 2930}; 2931_forEachName("to,from,fromTo,delayedCall,set,killTweensOf", function(name) { 2932 return _gsap[name] = Tween[name]; 2933}); 2934_ticker.add(Timeline.updateRoot); 2935_quickTween = _gsap.to({}, { 2936 duration: 0 2937}); 2938var _getPluginPropTween = function _getPluginPropTween2(plugin, prop
vendor: 16,384 bytes, lines 2938-3322
2938) { 2939 var pt = plugin._pt; 2940 while (pt && pt.p !== prop && pt.op !== prop && pt.fp !== prop) { 2941 pt = pt._next; 2942 } 2943 return pt; 2944}, _addModifiers = function _addModifiers2(tween, modifiers) { 2945 var targets = tween._targets, p, i, pt; 2946 for (p in modifiers) { 2947 i = targets.length; 2948 while (i--) { 2949 pt = tween._ptLookup[i][p]; 2950 if (pt && (pt = pt.d)) { 2951 if (pt._pt) { 2952 pt = _getPluginPropTween(pt, p); 2953 } 2954 pt && pt.modifier && pt.modifier(modifiers[p], tween, targets[i], p); 2955 } 2956 } 2957 } 2958}, _buildModifierPlugin = function _buildModifierPlugin2(name, modifier) { 2959 return { 2960 name, 2961 rawVars: 1, 2962 //don't pre-process function-based values or "random()" strings. 2963 init: function init4(target, vars, tween) { 2964 tween._onInit = function(tween2) { 2965 var temp, p; 2966 if (_isString$1(vars)) { 2967 temp = {}; 2968 _forEachName(vars, function(name2) { 2969 return temp[name2] = 1; 2970 }); 2971 vars = temp; 2972 } 2973 if (modifier) { 2974 temp = {}; 2975 for (p in vars) { 2976 temp[p] = modifier(vars[p]); 2977 } 2978 vars = temp; 2979 } 2980 _addModifiers(tween2, vars); 2981 }; 2982 } 2983 }; 2984}; 2985var gsap$3 = _gsap.registerPlugin({ 2986 name: "attr", 2987 init: function init(target, vars, tween, index, targets) { 2988 var p, pt, v; 2989 this.tween = tween; 2990 for (p in vars) { 2991 v = target.getAttribute(p) || ""; 2992 pt = this.add(target, "setAttribute", (v || 0) + "", vars[p], index, targets, 0, 0, p); 2993 pt.op = p; 2994 pt.b = v; 2995 this._props.push(p); 2996 } 2997 }, 2998 render: function render(ratio, data) { 2999 var pt = data._pt; 3000 while (pt) { 3001 _reverting$1 ? pt.set(pt.t, pt.p, pt.b, pt) : pt.r(ratio, pt.d); 3002 pt = pt._next; 3003 } 3004 } 3005}, { 3006 name: "endArray", 3007 init: function init2(target, value) { 3008 var i = value.length; 3009 while (i--) { 3010 this.add(target, i, target[i] || 0, value[i], 0, 0, 0, 0, 0, 1); 3011 } 3012 } 3013}, _buildModifierPlugin("roundProps", _roundModifier), _buildModifierPlugin("modifiers"), _buildModifierPlugin("snap", snap)) || _gsap; 3014Tween.version = Timeline.version = gsap$3.version = "3.12.5"; 3015_coreReady = 1; 3016_windowExists$3() && _wake(); 3017var Power0 = _easeMap.Power0, Power1 = _easeMap.Power1, Power2 = _easeMap.Power2, Power3 = _easeMap.Power3; 3018_easeMap.Power4; 3019_easeMap.Linear; 3020_easeMap.Quad; 3021_easeMap.Cubic; 3022_easeMap.Quart; 3023_easeMap.Quint; 3024_easeMap.Strong; 3025_easeMap.Elastic; 3026var Back = _easeMap.Back; 3027_easeMap.SteppedEase; 3028_easeMap.Bounce; 3029_easeMap.Sine; 3030_easeMap.Expo; 3031_easeMap.Circ; 3032/*! 3033 * CSSPlugin 3.12.5 3034 * https://gsap.com 3035 * 3036 * Copyright 2008-2024, GreenSock. All rights reserved. 3037 * Subject to the terms at https://gsap.com/standard-license or for 3038 * Club GSAP members, the agreement issued with that membership. 3039 * @author: Jack Doyle, [email protected] 3040*/ 3041var _win$3, _doc$3, _docElement, _pluginInitted, _tempDiv, _recentSetterPlugin, _reverting, _windowExists$2 = function _windowExists2() { 3042 return typeof window !== "undefined"; 3043}, _transformProps = {}, _RAD2DEG = 180 / Math.PI, _DEG2RAD = Math.PI / 180, _atan2 = Math.atan2, _bigNum = 1e8, _capsExp$1 = /([A-Z])/g, _horizontalExp = /(left|right|width|margin|padding|x)/i, _complexExp = /[\s,\(]\S/, _propertyAliases = { 3044 autoAlpha: "opacity,visibility", 3045 scale: "scaleX,scaleY", 3046 alpha: "opacity" 3047}, _renderCSSProp = function _renderCSSProp2(ratio, data) { 3048 return data.set(data.t, data.p, Math.round((data.s + data.c * ratio) * 1e4) / 1e4 + data.u, data); 3049}, _renderPropWithEnd = function _renderPropWithEnd2(ratio, data) { 3050 return data.set(data.t, data.p, ratio === 1 ? data.e : Math.round((data.s + data.c * ratio) * 1e4) / 1e4 + data.u, data); 3051}, _renderCSSPropWithBeginning = function _renderCSSPropWithBeginning2(ratio, data) { 3052 return data.set(data.t, data.p, ratio ? Math.round((data.s + data.c * ratio) * 1e4) / 1e4 + data.u : data.b, data); 3053}, _renderRoundedCSSProp = function _renderRoundedCSSProp2(ratio, data) { 3054 var value = data.s + data.c * ratio; 3055 data.set(data.t, data.p, ~~(value + (value < 0 ? -0.5 : 0.5)) + data.u, data); 3056}, _renderNonTweeningValue = function _renderNonTweeningValue2(ratio, data) { 3057 return data.set(data.t, data.p, ratio ? data.e : data.b, data); 3058}, _renderNonTweeningValueOnlyAtEnd = function _renderNonTweeningValueOnlyAtEnd2(ratio, data) { 3059 return data.set(data.t, data.p, ratio !== 1 ? data.b : data.e, data); 3060}, _setterCSSStyle = function _setterCSSStyle2(target, property, value) { 3061 return target.style[property] = value; 3062}, _setterCSSProp = function _setterCSSProp2(target, property, value) { 3063 return target.style.setProperty(property, value); 3064}, _setterTransform = function _setterTransform2(target, property, value) { 3065 return target._gsap[property] = value; 3066}, _setterScale = function _setterScale2(target, property, value) { 3067 return target._gsap.scaleX = target._gsap.scaleY = value; 3068}, _setterScaleWithRender = function _setterScaleWithRender2(target, property, value, data, ratio) { 3069 var cache = target._gsap; 3070 cache.scaleX = cache.scaleY = value; 3071 cache.renderTransform(ratio, cache); 3072}, _setterTransformWithRender = function _setterTransformWithRender2(target, property, value, data, ratio) { 3073 var cache = target._gsap; 3074 cache[property] = value; 3075 cache.renderTransform(ratio, cache); 3076}, _transformProp$1 = "transform", _transformOriginProp = _transformProp$1 + "Origin", _saveStyle = function _saveStyle2(property, isNotCSS) { 3077 var _this = this; 3078 var target = this.target, style = target.style, cache = target._gsap; 3079 if (property in _transformProps && style) { 3080 this.tfm = this.tfm || {}; 3081 if (property !== "transform") { 3082 property = _propertyAliases[property] || property; 3083 ~property.indexOf(",") ? property.split(",").forEach(function(a) { 3084 return _this.tfm[a] = _get(target, a); 3085 }) : this.tfm[property] = cache.x ? cache[property] : _get(target, property); 3086 property === _transformOriginProp && (this.tfm.zOrigin = cache.zOrigin); 3087 } else { 3088 return _propertyAliases.transform.split(",").forEach(function(p) { 3089 return _saveStyle2.call(_this, p, isNotCSS); 3090 }); 3091 } 3092 if (this.props.indexOf(_transformProp$1) >= 0) { 3093 return; 3094 } 3095 if (cache.svg) { 3096 this.svgo = target.getAttribute("data-svg-origin"); 3097 this.props.push(_transformOriginProp, isNotCSS, ""); 3098 } 3099 property = _transformProp$1; 3100 } 3101 (style || isNotCSS) && this.props.push(property, isNotCSS, style[property]); 3102}, _removeIndependentTransforms = function _removeIndependentTransforms2(style) { 3103 if (style.translate) { 3104 style.removeProperty("translate"); 3105 style.removeProperty("scale"); 3106 style.removeProperty("rotate"); 3107 } 3108}, _revertStyle = function _revertStyle2() { 3109 var props = this.props, target = this.target, style = target.style, cache = target._gsap, i, p; 3110 for (i = 0; i < props.length; i += 3) { 3111 props[i + 1] ? target[props[i]] = props[i + 2] : props[i + 2] ? style[props[i]] = props[i + 2] : style.removeProperty(props[i].substr(0, 2) === "--" ? props[i] : props[i].replace(_capsExp$1, "-$1").toLowerCase()); 3112 } 3113 if (this.tfm) { 3114 for (p in this.tfm) { 3115 cache[p] = this.tfm[p]; 3116 } 3117 if (cache.svg) { 3118 cache.renderTransform(); 3119 target.setAttribute("data-svg-origin", this.svgo || ""); 3120 } 3121 i = _reverting(); 3122 if ((!i || !i.isStart) && !style[_transformProp$1]) { 3123 _removeIndependentTransforms(style); 3124 if (cache.zOrigin && style[_transformOriginProp]) { 3125 style[_transformOriginProp] += " " + cache.zOrigin + "px"; 3126 cache.zOrigin = 0; 3127 cache.renderTransform(); 3128 } 3129 cache.uncache = 1; 3130 } 3131 } 3132}, _getStyleSaver = function _getStyleSaver2(target, properties) { 3133 var saver = { 3134 target, 3135 props: [], 3136 revert: _revertStyle, 3137 save: _saveStyle 3138 }; 3139 target._gsap || gsap$3.core.getCache(target); 3140 properties && properties.split(",").forEach(function(p) { 3141 return saver.save(p); 3142 }); 3143 return saver; 3144}, _supports3D, _createElement = function _createElement2(type, ns) { 3145 var e = _doc$3.createElementNS ? _doc$3.createElementNS((ns || "http://www.w3.org/1999/xhtml").replace(/^https/, "http"), type) : _doc$3.createElement(type); 3146 return e && e.style ? e : _doc$3.createElement(type); 3147}, _getComputedProperty = function _getComputedProperty2(target, property, skipPrefixFallback) { 3148 var cs = getComputedStyle(target); 3149 return cs[property] || cs.getPropertyValue(property.replace(_capsExp$1, "-$1").toLowerCase()) || cs.getPropertyValue(property) || !skipPrefixFallback && _getComputedProperty2(target, _checkPropPrefix(property) || property, 1) || ""; 3150}, _prefixes = "O,Moz,ms,Ms,Webkit".split(","), _checkPropPrefix = function _checkPropPrefix2(property, element, preferPrefix) { 3151 var e = element || _tempDiv, s = e.style, i = 5; 3152 if (property in s && !preferPrefix) { 3153 return property; 3154 } 3155 property = property.charAt(0).toUpperCase() + property.substr(1); 3156 while (i-- && !(_prefixes[i] + property in s)) { 3157 } 3158 return i < 0 ? null : (i === 3 ? "ms" : i >= 0 ? _prefixes[i] : "") + property; 3159}, _initCore$1 = function _initCore() { 3160 if (_windowExists$2() && window.document) { 3161 _win$3 = window; 3162 _doc$3 = _win$3.document; 3163 _docElement = _doc$3.documentElement; 3164 _tempDiv = _createElement("div") || { 3165 style: {} 3166 }; 3167 _createElement("div"); 3168 _transformProp$1 = _checkPropPrefix(_transformProp$1); 3169 _transformOriginProp = _transformProp$1 + "Origin"; 3170 _tempDiv.style.cssText = "border-width:0;line-height:0;position:absolute;padding:0"; 3171 _supports3D = !!_checkPropPrefix("perspective"); 3172 _reverting = gsap$3.core.reverting; 3173 _pluginInitted = 1; 3174 } 3175}, _getBBoxHack = function _getBBoxHack2(swapIfPossible) { 3176 var svg = _createElement("svg", this.ownerSVGElement && this.ownerSVGElement.getAttribute("xmlns") || "http://www.w3.org/2000/svg"), oldParent = this.parentNode, oldSibling = this.nextSibling, oldCSS = this.style.cssText, bbox; 3177 _docElement.appendChild(svg); 3178 svg.appendChild(this); 3179 this.style.display = "block"; 3180 if (swapIfPossible) { 3181 try { 3182 bbox = this.getBBox(); 3183 this._gsapBBox = this.getBBox; 3184 this.getBBox = _getBBoxHack2; 3185 } catch (e) { 3186 } 3187 } else if (this._gsapBBox) { 3188 bbox = this._gsapBBox(); 3189 } 3190 if (oldParent) { 3191 if (oldSibling) { 3192 oldParent.insertBefore(this, oldSibling); 3193 } else { 3194 oldParent.appendChild(this); 3195 } 3196 } 3197 _docElement.removeChild(svg); 3198 this.style.cssText = oldCSS; 3199 return bbox; 3200}, _getAttributeFallbacks = function _getAttributeFallbacks2(target, attributesArray) { 3201 var i = attributesArray.length; 3202 while (i--) { 3203 if (target.hasAttribute(attributesArray[i])) { 3204 return target.getAttribute(attributesArray[i]); 3205 } 3206 } 3207}, _getBBox = function _getBBox2(target) { 3208 var bounds; 3209 try { 3210 bounds = target.getBBox(); 3211 } catch (error) { 3212 bounds = _getBBoxHack.call(target, true); 3213 } 3214 bounds && (bounds.width || bounds.height) || target.getBBox === _getBBoxHack || (bounds = _getBBoxHack.call(target, true)); 3215 return bounds && !bounds.width && !bounds.x && !bounds.y ? { 3216 x: +_getAttributeFallbacks(target, ["x", "cx", "x1"]) || 0, 3217 y: +_getAttributeFallbacks(target, ["y", "cy", "y1"]) || 0, 3218 width: 0, 3219 height: 0 3220 } : bounds; 3221}, _isSVG = function _isSVG2(e) { 3222 return !!(e.getCTM && (!e.parentNode || e.ownerSVGElement) && _getBBox(e)); 3223}, _removeProperty = function _removeProperty2(target, property) { 3224 if (property) { 3225 var style = target.style, first2Chars; 3226 if (property in _transformProps && property !== _transformOriginProp) { 3227 property = _transformProp$1; 3228 } 3229 if (style.removeProperty) { 3230 first2Chars = property.substr(0, 2); 3231 if (first2Chars === "ms" || property.substr(0, 6) === "webkit") { 3232 property = "-" + property; 3233 } 3234 style.removeProperty(first2Chars === "--" ? property : property.replace(_capsExp$1, "-$1").toLowerCase()); 3235 } else { 3236 style.removeAttribute(property); 3237 } 3238 } 3239}, _addNonTweeningPT = function _addNonTweeningPT2(plugin, target, property, beginning, end, onlySetAtEnd) { 3240 var pt = new PropTween(plugin._pt, target, property, 0, 1, onlySetAtEnd ? _renderNonTweeningValueOnlyAtEnd : _renderNonTweeningValue); 3241 plugin._pt = pt; 3242 pt.b = beginning; 3243 pt.e = end; 3244 plugin._props.push(property); 3245 return pt; 3246}, _nonConvertibleUnits = { 3247 deg: 1, 3248 rad: 1, 3249 turn: 1 3250}, _nonStandardLayouts = { 3251 grid: 1, 3252 flex: 1 3253}, _convertToUnit = function _convertToUnit2(target, property, value, unit) { 3254 var curValue = parseFloat(value) || 0, curUnit = (value + "").trim().substr((curValue + "").length) || "px", style = _tempDiv.style, horizontal = _horizontalExp.test(property), isRootSVG = target.tagName.toLowerCase() === "svg", measureProperty = (isRootSVG ? "client" : "offset") + (horizontal ? "Width" : "Height"), amount = 100, toPixels = unit === "px", toPercent = unit === "%", px, parent, cache, isSVG; 3255 if (unit === curUnit || !curValue || _nonConvertibleUnits[unit] || _nonConvertibleUnits[curUnit]) { 3256 return curValue; 3257 } 3258 curUnit !== "px" && !toPixels && (curValue = _convertToUnit2(target, property, value, "px")); 3259 isSVG = target.getCTM && _isSVG(target); 3260 if ((toPercent || curUnit === "%") && (_transformProps[property] || ~property.indexOf("adius"))) { 3261 px = isSVG ? target.getBBox()[horizontal ? "width" : "height"] : target[measureProperty]; 3262 return _round$2(toPercent ? curValue / px * amount : curValue / 100 * px); 3263 } 3264 style[horizontal ? "width" : "height"] = amount + (toPixels ? curUnit : unit); 3265 parent = ~property.indexOf("adius") || unit === "em" && target.appendChild && !isRootSVG ? target : target.parentNode; 3266 if (isSVG) { 3267 parent = (target.ownerSVGElement || {}).parentNode; 3268 } 3269 if (!parent || parent === _doc$3 || !parent.appendChild) { 3270 parent = _doc$3.body; 3271 } 3272 cache = parent._gsap; 3273 if (cache && toPercent && cache.width && horizontal && cache.time === _ticker.time && !cache.uncache) { 3274 return _round$2(curValue / cache.width * amount); 3275 } else { 3276 if (toPercent && (property === "height" || property === "width")) { 3277 var v = target.style[property]; 3278 target.style[property] = amount + unit; 3279 px = target[measureProperty]; 3280 v ? target.style[property] = v : _removeProperty(target, property); 3281 } else { 3282 (toPercent || curUnit === "%") && !_nonStandardLayouts[_getComputedProperty(parent, "display")] && (style.position = _getComputedProperty(target, "position")); 3283 parent === target && (style.position = "static"); 3284 parent.appendChild(_tempDiv); 3285 px = _tempDiv[measureProperty]; 3286 parent.removeChild(_tempDiv); 3287 style.position = "absolute"; 3288 } 3289 if (horizontal && toPercent) { 3290 cache = _getCache(parent); 3291 cache.time = _ticker.time; 3292 cache.width = parent[measureProperty]; 3293 } 3294 } 3295 return _round$2(toPixels ? px * curValue / amount : px && curValue ? amount / px * curValue : 0); 3296}, _get = function _get2(target, property, unit, uncache) { 3297 var value; 3298 _pluginInitted || _initCore$1(); 3299 if (property in _propertyAliases && property !== "transform") { 3300 property = _propertyAliases[property]; 3301 if (~property.indexOf(",")) { 3302 property = property.split(",")[0]; 3303 } 3304 } 3305 if (_transformProps[property] && property !== "transform") { 3306 value = _parseTransform(target, uncache); 3307 value = property !== "transformOrigin" ? value[property] : value.svg ? value.origin : _firstTwoOnly(_getComputedProperty(target, _transformOriginProp)) + " " + value.zOrigin + "px"; 3308 } else { 3309 value = target.style[property]; 3310 if (!value || value === "auto" || uncache || ~(value + "").indexOf("calc(")) { 3311 value = _specialProps[property] && _specialProps[property](target, property, unit) || _getComputedProperty(target, property) || _getProperty(target, property) || (property === "opacity" ? 1 : 0); 3312 } 3313 } 3314 return unit && !~(value + "").trim().indexOf(" ") ? _convertToUnit(target, property, value, unit) + unit : value; 3315}, _tweenComplexCSSString = function _tweenComplexCSSString2(target, prop, start, end) { 3316 if (!start || start === "none") { 3317 var p = _checkPropPrefix(prop, target, 1), s = p && _getComputedProperty(target, p, 1); 3318 if (s && s !== start) { 3319 prop = p; 3320 start = s; 3321 } else if (prop === "borderColor") { 3322 start = _getComputedPrope
vendor: 4,087 bytes, lines 3322-3430
3322rty(target, "borderTopColor"); 3323 } 3324 } 3325 var pt = new PropTween(this._pt, target.style, prop, 0, 1, _renderComplexString), index = 0, matchIndex = 0, a, result, startValues, startNum, color, startValue, endValue, endNum, chunk, endUnit, startUnit, endValues; 3326 pt.b = start; 3327 pt.e = end; 3328 start += ""; 3329 end += ""; 3330 if (end === "auto") { 3331 startValue = target.style[prop]; 3332 target.style[prop] = end; 3333 end = _getComputedProperty(target, prop) || end; 3334 startValue ? target.style[prop] = startValue : _removeProperty(target, prop); 3335 } 3336 a = [start, end]; 3337 _colorStringFilter(a); 3338 start = a[0]; 3339 end = a[1]; 3340 startValues = start.match(_numWithUnitExp) || []; 3341 endValues = end.match(_numWithUnitExp) || []; 3342 if (endValues.length) { 3343 while (result = _numWithUnitExp.exec(end)) { 3344 endValue = result[0]; 3345 chunk = end.substring(index, result.index); 3346 if (color) { 3347 color = (color + 1) % 5; 3348 } else if (chunk.substr(-5) === "rgba(" || chunk.substr(-5) === "hsla(") { 3349 color = 1; 3350 } 3351 if (endValue !== (startValue = startValues[matchIndex++] || "")) { 3352 startNum = parseFloat(startValue) || 0; 3353 startUnit = startValue.substr((startNum + "").length); 3354 endValue.charAt(1) === "=" && (endValue = _parseRelative(startNum, endValue) + startUnit); 3355 endNum = parseFloat(endValue); 3356 endUnit = endValue.substr((endNum + "").length); 3357 index = _numWithUnitExp.lastIndex - endUnit.length; 3358 if (!endUnit) { 3359 endUnit = endUnit || _config.units[prop] || startUnit; 3360 if (index === end.length) { 3361 end += endUnit; 3362 pt.e += endUnit; 3363 } 3364 } 3365 if (startUnit !== endUnit) { 3366 startNum = _convertToUnit(target, prop, startValue, endUnit) || 0; 3367 } 3368 pt._pt = { 3369 _next: pt._pt, 3370 p: chunk || matchIndex === 1 ? chunk : ",", 3371 //note: SVG spec allows omission of comma/space when a negative sign is wedged between two numbers, like 2.5-5.3 instead of 2.5,-5.3 but when tweening, the negative value may switch to positive, so we insert the comma just in case. 3372 s: startNum, 3373 c: endNum - startNum, 3374 m: color && color < 4 || prop === "zIndex" ? Math.round : 0 3375 }; 3376 } 3377 } 3378 pt.c = index < end.length ? end.substring(index, end.length) : ""; 3379 } else { 3380 pt.r = prop === "display" && end === "none" ? _renderNonTweeningValueOnlyAtEnd : _renderNonTweeningValue; 3381 } 3382 _relExp.test(end) && (pt.e = 0); 3383 this._pt = pt; 3384 return pt; 3385}, _keywordToPercent = { 3386 top: "0%", 3387 bottom: "100%", 3388 left: "0%", 3389 right: "100%", 3390 center: "50%" 3391}, _convertKeywordsToPercentages = function _convertKeywordsToPercentages2(value) { 3392 var split = value.split(" "), x = split[0], y = split[1] || "50%"; 3393 if (x === "top" || x === "bottom" || y === "left" || y === "right") { 3394 value = x; 3395 x = y; 3396 y = value; 3397 } 3398 split[0] = _keywordToPercent[x] || x; 3399 split[1] = _keywordToPercent[y] || y; 3400 return split.join(" "); 3401}, _renderClearProps = function _renderClearProps2(ratio, data) { 3402 if (data.tween && data.tween._time === data.tween._dur) { 3403 var target = data.t, style = target.style, props = data.u, cache = target._gsap, prop, clearTransforms, i; 3404 if (props === "all" || props === true) { 3405 style.cssText = ""; 3406 clearTransforms = 1; 3407 } else { 3408 props = props.split(","); 3409 i = props.length; 3410 while (--i > -1) { 3411 prop = props[i]; 3412 if (_transformProps[prop]) { 3413 clearTransforms = 1; 3414 prop = prop === "transformOrigin" ? _transformOriginProp : _transformProp$1; 3415 } 3416 _removeProperty(target, prop); 3417 } 3418 } 3419 if (clearTransforms) { 3420 _removeProperty(target, _transformProp$1); 3421 if (cache) { 3422 cache.svg && target.removeAttribute("transform"); 3423 _parseTransform(target, 1); 3424 cache.uncache = 1; 3425 _removeIndependentTransforms(style); 3426 } 3427 } 3428 } 3429}, _specialProps = { 3430 clearProps: function clearProps(plugin, target, property, endValue, tween) {
3431 if (tween.data !== "isFromStart") { 3432 var pt = plugin._pt = new PropTween(plugin._pt, target, property, 0, 0, _renderClearProps); 3433 pt.u = endValue; 3434 pt.pr = -10; 3435 pt.tween = tween; 3436 plugin._props.push(property); 3437 return 1; 3438 } 3439 } 3440 /* className feature (about 0.4kb gzipped). 3441 , className(plugin, target, property, endValue, tween) { 3442 let _renderClassName = (ratio, data) => { 3443 data.css.render(ratio, data.css); 3444 if (!ratio || ratio === 1) { 3445 let inline = data.rmv, 3446 target = data.t, 3447 p; 3448 target.setAttribute("class", ratio ? data.e : data.b); 3449 for (p in inline) { 3450 _removeProperty(target, p); 3451 } 3452 } 3453 }, 3454 _getAllStyles = (target) => { 3455 let styles = {}, 3456 computed = getComputedStyle(target), 3457 p; 3458 for (p in computed) { 3459 if (isNaN(p) && p !== "cssText" && p !== "length") { 3460 styles[p] = computed[p]; 3461 } 3462 } 3463 _setDefaults(styles, _parseTransform(target, 1)); 3464 return styles; 3465 }, 3466 startClassList = target.getAttribute("class"), 3467 style = target.style, 3468 cssText = style.cssText, 3469 cache = target._gsap, 3470 classPT = cache.classPT, 3471 inlineToRemoveAtEnd = {}, 3472 data = {t:target, plugin:plugin, rmv:inlineToRemoveAtEnd, b:startClassList, e:(endValue.charAt(1) !== "=") ? endValue : startClassList.replace(new RegExp("(?:\\s|^)" + endValue.substr(2) + "(?![\\w-])"), "") + ((endValue.charAt(0) === "+") ? " " + endValue.substr(2) : "")}, 3473 changingVars = {}, 3474 startVars = _getAllStyles(target), 3475 transformRelated = /(transform|perspective)/i, 3476 endVars, p; 3477 if (classPT) { 3478 classPT.r(1, classPT.d); 3479 _removeLinkedListItem(classPT.d.plugin, classPT, "_pt"); 3480 } 3481 target.setAttribute("class", data.e); 3482 endVars = _getAllStyles(target, true); 3483 target.setAttribute("class", startClassList); 3484 for (p in endVars) { 3485 if (endVars[p] !== startVars[p] && !transformRelated.test(p)) { 3486 changingVars[p] = endVars[p]; 3487 if (!style[p] && style[p] !== "0") { 3488 inlineToRemoveAtEnd[p] = 1; 3489 } 3490 } 3491 } 3492 cache.classPT = plugin._pt = new PropTween(plugin._pt, target, "className", 0, 0, _renderClassName, data, 0, -11); 3493 if (style.cssText !== cssText) { //only apply if things change. Otherwise, in cases like a background-image that's pulled dynamically, it could cause a refresh. See https://gsap.com/forums/topic/20368-possible-gsap-bug-switching-classnames-in-chrome/. 3494 style.cssText = cssText; //we recorded cssText before we swapped classes and ran _getAllStyles() because in cases when a className tween is overwritten, we remove all the related tweening properties from that class change (otherwise class-specific stuff can't override properties we've directly set on the target's style object due to specificity). 3495 } 3496 _parseTransform(target, true); //to clear the caching of transforms 3497 data.css = new gsap.plugins.css();
vendor: 13,433 bytes, lines 3498-3772
3498 data.css.init(target, changingVars, tween); 3499 plugin._props.push(...data.css._props); 3500 return 1; 3501 } 3502 */ 3503}, _identity2DMatrix = [1, 0, 0, 1, 0, 0], _rotationalProperties = {}, _isNullTransform = function _isNullTransform2(value) { 3504 return value === "matrix(1, 0, 0, 1, 0, 0)" || value === "none" || !value; 3505}, _getComputedTransformMatrixAsArray = function _getComputedTransformMatrixAsArray2(target) { 3506 var matrixString = _getComputedProperty(target, _transformProp$1); 3507 return _isNullTransform(matrixString) ? _identity2DMatrix : matrixString.substr(7).match(_numExp).map(_round$2); 3508}, _getMatrix = function _getMatrix2(target, force2D) { 3509 var cache = target._gsap || _getCache(target), style = target.style, matrix = _getComputedTransformMatrixAsArray(target), parent, nextSibling, temp, addedToDOM; 3510 if (cache.svg && target.getAttribute("transform")) { 3511 temp = target.transform.baseVal.consolidate().matrix; 3512 matrix = [temp.a, temp.b, temp.c, temp.d, temp.e, temp.f]; 3513 return matrix.join(",") === "1,0,0,1,0,0" ? _identity2DMatrix : matrix; 3514 } else if (matrix === _identity2DMatrix && !target.offsetParent && target !== _docElement && !cache.svg) { 3515 temp = style.display; 3516 style.display = "block"; 3517 parent = target.parentNode; 3518 if (!parent || !target.offsetParent) { 3519 addedToDOM = 1; 3520 nextSibling = target.nextElementSibling; 3521 _docElement.appendChild(target); 3522 } 3523 matrix = _getComputedTransformMatrixAsArray(target); 3524 temp ? style.display = temp : _removeProperty(target, "display"); 3525 if (addedToDOM) { 3526 nextSibling ? parent.insertBefore(target, nextSibling) : parent ? parent.appendChild(target) : _docElement.removeChild(target); 3527 } 3528 } 3529 return force2D && matrix.length > 6 ? [matrix[0], matrix[1], matrix[4], matrix[5], matrix[12], matrix[13]] : matrix; 3530}, _applySVGOrigin = function _applySVGOrigin2(target, origin, originIsAbsolute, smooth, matrixArray, pluginToAddPropTweensTo) { 3531 var cache = target._gsap, matrix = matrixArray || _getMatrix(target, true), xOriginOld = cache.xOrigin || 0, yOriginOld = cache.yOrigin || 0, xOffsetOld = cache.xOffset || 0, yOffsetOld = cache.yOffset || 0, a = matrix[0], b = matrix[1], c = matrix[2], d = matrix[3], tx = matrix[4], ty = matrix[5], originSplit = origin.split(" "), xOrigin = parseFloat(originSplit[0]) || 0, yOrigin = parseFloat(originSplit[1]) || 0, bounds, determinant, x, y; 3532 if (!originIsAbsolute) { 3533 bounds = _getBBox(target); 3534 xOrigin = bounds.x + (~originSplit[0].indexOf("%") ? xOrigin / 100 * bounds.width : xOrigin); 3535 yOrigin = bounds.y + (~(originSplit[1] || originSplit[0]).indexOf("%") ? yOrigin / 100 * bounds.height : yOrigin); 3536 } else if (matrix !== _identity2DMatrix && (determinant = a * d - b * c)) { 3537 x = xOrigin * (d / determinant) + yOrigin * (-c / determinant) + (c * ty - d * tx) / determinant; 3538 y = xOrigin * (-b / determinant) + yOrigin * (a / determinant) - (a * ty - b * tx) / determinant; 3539 xOrigin = x; 3540 yOrigin = y; 3541 } 3542 if (smooth || smooth !== false && cache.smooth) { 3543 tx = xOrigin - xOriginOld; 3544 ty = yOrigin - yOriginOld; 3545 cache.xOffset = xOffsetOld + (tx * a + ty * c) - tx; 3546 cache.yOffset = yOffsetOld + (tx * b + ty * d) - ty; 3547 } else { 3548 cache.xOffset = cache.yOffset = 0; 3549 } 3550 cache.xOrigin = xOrigin; 3551 cache.yOrigin = yOrigin; 3552 cache.smooth = !!smooth; 3553 cache.origin = origin; 3554 cache.originIsAbsolute = !!originIsAbsolute; 3555 target.style[_transformOriginProp] = "0px 0px"; 3556 if (pluginToAddPropTweensTo) { 3557 _addNonTweeningPT(pluginToAddPropTweensTo, cache, "xOrigin", xOriginOld, xOrigin); 3558 _addNonTweeningPT(pluginToAddPropTweensTo, cache, "yOrigin", yOriginOld, yOrigin); 3559 _addNonTweeningPT(pluginToAddPropTweensTo, cache, "xOffset", xOffsetOld, cache.xOffset); 3560 _addNonTweeningPT(pluginToAddPropTweensTo, cache, "yOffset", yOffsetOld, cache.yOffset); 3561 } 3562 target.setAttribute("data-svg-origin", xOrigin + " " + yOrigin); 3563}, _parseTransform = function _parseTransform2(target, uncache) { 3564 var cache = target._gsap || new GSCache(target); 3565 if ("x" in cache && !uncache && !cache.uncache) { 3566 return cache; 3567 } 3568 var style = target.style, invertedScaleX = cache.scaleX < 0, px = "px", deg = "deg", cs = getComputedStyle(target), origin = _getComputedProperty(target, _transformOriginProp) || "0", x, y, z, scaleX, scaleY, rotation, rotationX, rotationY, skewX, skewY, perspective, xOrigin, yOrigin, matrix, angle, cos, sin, a, b, c, d, a12, a22, t1, t2, t3, a13, a23, a33, a42, a43, a32; 3569 x = y = z = rotation = rotationX = rotationY = skewX = skewY = perspective = 0; 3570 scaleX = scaleY = 1; 3571 cache.svg = !!(target.getCTM && _isSVG(target)); 3572 if (cs.translate) { 3573 if (cs.translate !== "none" || cs.scale !== "none" || cs.rotate !== "none") { 3574 style[_transformProp$1] = (cs.translate !== "none" ? "translate3d(" + (cs.translate + " 0 0").split(" ").slice(0, 3).join(", ") + ") " : "") + (cs.rotate !== "none" ? "rotate(" + cs.rotate + ") " : "") + (cs.scale !== "none" ? "scale(" + cs.scale.split(" ").join(",") + ") " : "") + (cs[_transformProp$1] !== "none" ? cs[_transformProp$1] : ""); 3575 } 3576 style.scale = style.rotate = style.translate = "none"; 3577 } 3578 matrix = _getMatrix(target, cache.svg); 3579 if (cache.svg) { 3580 if (cache.uncache) { 3581 t2 = target.getBBox(); 3582 origin = cache.xOrigin - t2.x + "px " + (cache.yOrigin - t2.y) + "px"; 3583 t1 = ""; 3584 } else { 3585 t1 = !uncache && target.getAttribute("data-svg-origin"); 3586 } 3587 _applySVGOrigin(target, t1 || origin, !!t1 || cache.originIsAbsolute, cache.smooth !== false, matrix); 3588 } 3589 xOrigin = cache.xOrigin || 0; 3590 yOrigin = cache.yOrigin || 0; 3591 if (matrix !== _identity2DMatrix) { 3592 a = matrix[0]; 3593 b = matrix[1]; 3594 c = matrix[2]; 3595 d = matrix[3]; 3596 x = a12 = matrix[4]; 3597 y = a22 = matrix[5]; 3598 if (matrix.length === 6) { 3599 scaleX = Math.sqrt(a * a + b * b); 3600 scaleY = Math.sqrt(d * d + c * c); 3601 rotation = a || b ? _atan2(b, a) * _RAD2DEG : 0; 3602 skewX = c || d ? _atan2(c, d) * _RAD2DEG + rotation : 0; 3603 skewX && (scaleY *= Math.abs(Math.cos(skewX * _DEG2RAD))); 3604 if (cache.svg) { 3605 x -= xOrigin - (xOrigin * a + yOrigin * c); 3606 y -= yOrigin - (xOrigin * b + yOrigin * d); 3607 } 3608 } else { 3609 a32 = matrix[6]; 3610 a42 = matrix[7]; 3611 a13 = matrix[8]; 3612 a23 = matrix[9]; 3613 a33 = matrix[10]; 3614 a43 = matrix[11]; 3615 x = matrix[12]; 3616 y = matrix[13]; 3617 z = matrix[14]; 3618 angle = _atan2(a32, a33); 3619 rotationX = angle * _RAD2DEG; 3620 if (angle) { 3621 cos = Math.cos(-angle); 3622 sin = Math.sin(-angle); 3623 t1 = a12 * cos + a13 * sin; 3624 t2 = a22 * cos + a23 * sin; 3625 t3 = a32 * cos + a33 * sin; 3626 a13 = a12 * -sin + a13 * cos; 3627 a23 = a22 * -sin + a23 * cos; 3628 a33 = a32 * -sin + a33 * cos; 3629 a43 = a42 * -sin + a43 * cos; 3630 a12 = t1; 3631 a22 = t2; 3632 a32 = t3; 3633 } 3634 angle = _atan2(-c, a33); 3635 rotationY = angle * _RAD2DEG; 3636 if (angle) { 3637 cos = Math.cos(-angle); 3638 sin = Math.sin(-angle); 3639 t1 = a * cos - a13 * sin; 3640 t2 = b * cos - a23 * sin; 3641 t3 = c * cos - a33 * sin; 3642 a43 = d * sin + a43 * cos; 3643 a = t1; 3644 b = t2; 3645 c = t3; 3646 } 3647 angle = _atan2(b, a); 3648 rotation = angle * _RAD2DEG; 3649 if (angle) { 3650 cos = Math.cos(angle); 3651 sin = Math.sin(angle); 3652 t1 = a * cos + b * sin; 3653 t2 = a12 * cos + a22 * sin; 3654 b = b * cos - a * sin; 3655 a22 = a22 * cos - a12 * sin; 3656 a = t1; 3657 a12 = t2; 3658 } 3659 if (rotationX && Math.abs(rotationX) + Math.abs(rotation) > 359.9) { 3660 rotationX = rotation = 0; 3661 rotationY = 180 - rotationY; 3662 } 3663 scaleX = _round$2(Math.sqrt(a * a + b * b + c * c)); 3664 scaleY = _round$2(Math.sqrt(a22 * a22 + a32 * a32)); 3665 angle = _atan2(a12, a22); 3666 skewX = Math.abs(angle) > 2e-4 ? angle * _RAD2DEG : 0; 3667 perspective = a43 ? 1 / (a43 < 0 ? -a43 : a43) : 0; 3668 } 3669 if (cache.svg) { 3670 t1 = target.getAttribute("transform"); 3671 cache.forceCSS = target.setAttribute("transform", "") || !_isNullTransform(_getComputedProperty(target, _transformProp$1)); 3672 t1 && target.setAttribute("transform", t1); 3673 } 3674 } 3675 if (Math.abs(skewX) > 90 && Math.abs(skewX) < 270) { 3676 if (invertedScaleX) { 3677 scaleX *= -1; 3678 skewX += rotation <= 0 ? 180 : -180; 3679 rotation += rotation <= 0 ? 180 : -180; 3680 } else { 3681 scaleY *= -1; 3682 skewX += skewX <= 0 ? 180 : -180; 3683 } 3684 } 3685 uncache = uncache || cache.uncache; 3686 cache.x = x - ((cache.xPercent = x && (!uncache && cache.xPercent || (Math.round(target.offsetWidth / 2) === Math.round(-x) ? -50 : 0))) ? target.offsetWidth * cache.xPercent / 100 : 0) + px; 3687 cache.y = y - ((cache.yPercent = y && (!uncache && cache.yPercent || (Math.round(target.offsetHeight / 2) === Math.round(-y) ? -50 : 0))) ? target.offsetHeight * cache.yPercent / 100 : 0) + px; 3688 cache.z = z + px; 3689 cache.scaleX = _round$2(scaleX); 3690 cache.scaleY = _round$2(scaleY); 3691 cache.rotation = _round$2(rotation) + deg; 3692 cache.rotationX = _round$2(rotationX) + deg; 3693 cache.rotationY = _round$2(rotationY) + deg; 3694 cache.skewX = skewX + deg; 3695 cache.skewY = skewY + deg; 3696 cache.transformPerspective = perspective + px; 3697 if (cache.zOrigin = parseFloat(origin.split(" ")[2]) || !uncache && cache.zOrigin || 0) { 3698 style[_transformOriginProp] = _firstTwoOnly(origin); 3699 } 3700 cache.xOffset = cache.yOffset = 0; 3701 cache.force3D = _config.force3D; 3702 cache.renderTransform = cache.svg ? _renderSVGTransforms : _supports3D ? _renderCSSTransforms : _renderNon3DTransforms; 3703 cache.uncache = 0; 3704 return cache; 3705}, _firstTwoOnly = function _firstTwoOnly2(value) { 3706 return (value = value.split(" "))[0] + " " + value[1]; 3707}, _addPxTranslate = function _addPxTranslate2(target, start, value) { 3708 var unit = getUnit(start); 3709 return _round$2(parseFloat(start) + parseFloat(_convertToUnit(target, "x", value + "px", unit))) + unit; 3710}, _renderNon3DTransforms = function _renderNon3DTransforms2(ratio, cache) { 3711 cache.z = "0px"; 3712 cache.rotationY = cache.rotationX = "0deg"; 3713 cache.force3D = 0; 3714 _renderCSSTransforms(ratio, cache); 3715}, _zeroDeg = "0deg", _zeroPx = "0px", _endParenthesis = ") ", _renderCSSTransforms = function _renderCSSTransforms2(ratio, cache) { 3716 var _ref = cache || this, xPercent = _ref.xPercent, yPercent = _ref.yPercent, x = _ref.x, y = _ref.y, z = _ref.z, rotation = _ref.rotation, rotationY = _ref.rotationY, rotationX = _ref.rotationX, skewX = _ref.skewX, skewY = _ref.skewY, scaleX = _ref.scaleX, scaleY = _ref.scaleY, transformPerspective = _ref.transformPerspective, force3D = _ref.force3D, target = _ref.target, zOrigin = _ref.zOrigin, transforms = "", use3D = force3D === "auto" && ratio && ratio !== 1 || force3D === true; 3717 if (zOrigin && (rotationX !== _zeroDeg || rotationY !== _zeroDeg)) { 3718 var angle = parseFloat(rotationY) * _DEG2RAD, a13 = Math.sin(angle), a33 = Math.cos(angle), cos; 3719 angle = parseFloat(rotationX) * _DEG2RAD; 3720 cos = Math.cos(angle); 3721 x = _addPxTranslate(target, x, a13 * cos * -zOrigin); 3722 y = _addPxTranslate(target, y, -Math.sin(angle) * -zOrigin); 3723 z = _addPxTranslate(target, z, a33 * cos * -zOrigin + zOrigin); 3724 } 3725 if (transformPerspective !== _zeroPx) { 3726 transforms += "perspective(" + transformPerspective + _endParenthesis; 3727 } 3728 if (xPercent || yPercent) { 3729 transforms += "translate(" + xPercent + "%, " + yPercent + "%) "; 3730 } 3731 if (use3D || x !== _zeroPx || y !== _zeroPx || z !== _zeroPx) { 3732 transforms += z !== _zeroPx || use3D ? "translate3d(" + x + ", " + y + ", " + z + ") " : "translate(" + x + ", " + y + _endParenthesis; 3733 } 3734 if (rotation !== _zeroDeg) { 3735 transforms += "rotate(" + rotation + _endParenthesis; 3736 } 3737 if (rotationY !== _zeroDeg) { 3738 transforms += "rotateY(" + rotationY + _endParenthesis; 3739 } 3740 if (rotationX !== _zeroDeg) { 3741 transforms += "rotateX(" + rotationX + _endParenthesis; 3742 } 3743 if (skewX !== _zeroDeg || skewY !== _zeroDeg) { 3744 transforms += "skew(" + skewX + ", " + skewY + _endParenthesis; 3745 } 3746 if (scaleX !== 1 || scaleY !== 1) { 3747 transforms += "scale(" + scaleX + ", " + scaleY + _endParenthesis; 3748 } 3749 target.style[_transformProp$1] = transforms || "translate(0, 0)"; 3750}, _renderSVGTransforms = function _renderSVGTransforms2(ratio, cache) { 3751 var _ref2 = cache || this, xPercent = _ref2.xPercent, yPercent = _ref2.yPercent, x = _ref2.x, y = _ref2.y, rotation = _ref2.rotation, skewX = _ref2.skewX, skewY = _ref2.skewY, scaleX = _ref2.scaleX, scaleY = _ref2.scaleY, target = _ref2.target, xOrigin = _ref2.xOrigin, yOrigin = _ref2.yOrigin, xOffset = _ref2.xOffset, yOffset = _ref2.yOffset, forceCSS = _ref2.forceCSS, tx = parseFloat(x), ty = parseFloat(y), a11, a21, a12, a22, temp; 3752 rotation = parseFloat(rotation); 3753 skewX = parseFloat(skewX); 3754 skewY = parseFloat(skewY); 3755 if (skewY) { 3756 skewY = parseFloat(skewY); 3757 skewX += skewY; 3758 rotation += skewY; 3759 } 3760 if (rotation || skewX) { 3761 rotation *= _DEG2RAD; 3762 skewX *= _DEG2RAD; 3763 a11 = Math.cos(rotation) * scaleX; 3764 a21 = Math.sin(rotation) * scaleX; 3765 a12 = Math.sin(rotation - skewX) * -scaleY; 3766 a22 = Math.cos(rotation - skewX) * scaleY; 3767 if (skewX) { 3768 skewY *= _DEG2RAD; 3769 temp = Math.tan(skewX - skewY); 3770 temp = Math.sqrt(1 + temp * temp); 3771 a12 *= temp; 3772 a22 *= temp;
vendor: 7,634 bytes, lines 3773-3950
3773 if (skewY) { 3774 temp = Math.tan(skewY); 3775 temp = Math.sqrt(1 + temp * temp); 3776 a11 *= temp; 3777 a21 *= temp; 3778 } 3779 } 3780 a11 = _round$2(a11); 3781 a21 = _round$2(a21); 3782 a12 = _round$2(a12); 3783 a22 = _round$2(a22); 3784 } else { 3785 a11 = scaleX; 3786 a22 = scaleY; 3787 a21 = a12 = 0; 3788 } 3789 if (tx && !~(x + "").indexOf("px") || ty && !~(y + "").indexOf("px")) { 3790 tx = _convertToUnit(target, "x", x, "px"); 3791 ty = _convertToUnit(target, "y", y, "px"); 3792 } 3793 if (xOrigin || yOrigin || xOffset || yOffset) { 3794 tx = _round$2(tx + xOrigin - (xOrigin * a11 + yOrigin * a12) + xOffset); 3795 ty = _round$2(ty + yOrigin - (xOrigin * a21 + yOrigin * a22) + yOffset); 3796 } 3797 if (xPercent || yPercent) { 3798 temp = target.getBBox(); 3799 tx = _round$2(tx + xPercent / 100 * temp.width); 3800 ty = _round$2(ty + yPercent / 100 * temp.height); 3801 } 3802 temp = "matrix(" + a11 + "," + a21 + "," + a12 + "," + a22 + "," + tx + "," + ty + ")"; 3803 target.setAttribute("transform", temp); 3804 forceCSS && (target.style[_transformProp$1] = temp); 3805}, _addRotationalPropTween = function _addRotationalPropTween2(plugin, target, property, startNum, endValue) { 3806 var cap = 360, isString = _isString$1(endValue), endNum = parseFloat(endValue) * (isString && ~endValue.indexOf("rad") ? _RAD2DEG : 1), change = endNum - startNum, finalValue = startNum + change + "deg", direction, pt; 3807 if (isString) { 3808 direction = endValue.split("_")[1]; 3809 if (direction === "short") { 3810 change %= cap; 3811 if (change !== change % (cap / 2)) { 3812 change += change < 0 ? cap : -cap; 3813 } 3814 } 3815 if (direction === "cw" && change < 0) { 3816 change = (change + cap * _bigNum) % cap - ~~(change / cap) * cap; 3817 } else if (direction === "ccw" && change > 0) { 3818 change = (change - cap * _bigNum) % cap - ~~(change / cap) * cap; 3819 } 3820 } 3821 plugin._pt = pt = new PropTween(plugin._pt, target, property, startNum, change, _renderPropWithEnd); 3822 pt.e = finalValue; 3823 pt.u = "deg"; 3824 plugin._props.push(property); 3825 return pt; 3826}, _assign = function _assign2(target, source) { 3827 for (var p in source) { 3828 target[p] = source[p]; 3829 } 3830 return target; 3831}, _addRawTransformPTs = function _addRawTransformPTs2(plugin, transforms, target) { 3832 var startCache = _assign({}, target._gsap), exclude = "perspective,force3D,transformOrigin,svgOrigin", style = target.style, endCache, p, startValue, endValue, startNum, endNum, startUnit, endUnit; 3833 if (startCache.svg) { 3834 startValue = target.getAttribute("transform"); 3835 target.setAttribute("transform", ""); 3836 style[_transformProp$1] = transforms; 3837 endCache = _parseTransform(target, 1); 3838 _removeProperty(target, _transformProp$1); 3839 target.setAttribute("transform", startValue); 3840 } else { 3841 startValue = getComputedStyle(target)[_transformProp$1]; 3842 style[_transformProp$1] = transforms; 3843 endCache = _parseTransform(target, 1); 3844 style[_transformProp$1] = startValue; 3845 } 3846 for (p in _transformProps) { 3847 startValue = startCache[p]; 3848 endValue = endCache[p]; 3849 if (startValue !== endValue && exclude.indexOf(p) < 0) { 3850 startUnit = getUnit(startValue); 3851 endUnit = getUnit(endValue); 3852 startNum = startUnit !== endUnit ? _convertToUnit(target, p, startValue, endUnit) : parseFloat(startValue); 3853 endNum = parseFloat(endValue); 3854 plugin._pt = new PropTween(plugin._pt, endCache, p, startNum, endNum - startNum, _renderCSSProp); 3855 plugin._pt.u = endUnit || 0; 3856 plugin._props.push(p); 3857 } 3858 } 3859 _assign(endCache, startCache); 3860}; 3861_forEachName("padding,margin,Width,Radius", function(name, index) { 3862 var t = "Top", r = "Right", b = "Bottom", l = "Left", props = (index < 3 ? [t, r, b, l] : [t + l, t + r, b + r, b + l]).map(function(side) { 3863 return index < 2 ? name + side : "border" + side + name; 3864 }); 3865 _specialProps[index > 1 ? "border" + name : name] = function(plugin, target, property, endValue, tween) { 3866 var a, vars; 3867 if (arguments.length < 4) { 3868 a = props.map(function(prop) { 3869 return _get(plugin, prop, property); 3870 }); 3871 vars = a.join(" "); 3872 return vars.split(a[0]).length === 5 ? a[0] : vars; 3873 } 3874 a = (endValue + "").split(" "); 3875 vars = {}; 3876 props.forEach(function(prop, i) { 3877 return vars[prop] = a[i] = a[i] || a[(i - 1) / 2 | 0]; 3878 }); 3879 plugin.init(target, vars, tween); 3880 }; 3881}); 3882var CSSPlugin = { 3883 name: "css", 3884 register: _initCore$1, 3885 targetTest: function targetTest(target) { 3886 return target.style && target.nodeType; 3887 }, 3888 init: function init3(target, vars, tween, index, targets) { 3889 var props = this._props, style = target.style, startAt = tween.vars.startAt, startValue, endValue, endNum, startNum, type, specialProp, p, startUnit, endUnit, relative, isTransformRelated, transformPropTween, cache, smooth, hasPriority, inlineProps; 3890 _pluginInitted || _initCore$1(); 3891 this.styles = this.styles || _getStyleSaver(target); 3892 inlineProps = this.styles.props; 3893 this.tween = tween; 3894 for (p in vars) { 3895 if (p === "autoRound") { 3896 continue; 3897 } 3898 endValue = vars[p]; 3899 if (_plugins[p] && _checkPlugin(p, vars, tween, index, target, targets)) { 3900 continue; 3901 } 3902 type = typeof endValue; 3903 specialProp = _specialProps[p]; 3904 if (type === "function") { 3905 endValue = endValue.call(tween, index, target, targets); 3906 type = typeof endValue; 3907 } 3908 if (type === "string" && ~endValue.indexOf("random(")) { 3909 endValue = _replaceRandom(endValue); 3910 } 3911 if (specialProp) { 3912 specialProp(this, target, p, endValue, tween) && (hasPriority = 1); 3913 } else if (p.substr(0, 2) === "--") { 3914 startValue = (getComputedStyle(target).getPropertyValue(p) + "").trim(); 3915 endValue += ""; 3916 _colorExp.lastIndex = 0; 3917 if (!_colorExp.test(startValue)) { 3918 startUnit = getUnit(startValue); 3919 endUnit = getUnit(endValue); 3920 } 3921 endUnit ? startUnit !== endUnit && (startValue = _convertToUnit(target, p, startValue, endUnit) + endUnit) : startUnit && (endValue += startUnit); 3922 this.add(style, "setProperty", startValue, endValue, index, targets, 0, 0, p); 3923 props.push(p); 3924 inlineProps.push(p, 0, style[p]); 3925 } else if (type !== "undefined") { 3926 if (startAt && p in startAt) { 3927 startValue = typeof startAt[p] === "function" ? startAt[p].call(tween, index, target, targets) : startAt[p]; 3928 _isString$1(startValue) && ~startValue.indexOf("random(") && (startValue = _replaceRandom(startValue)); 3929 getUnit(startValue + "") || startValue === "auto" || (startValue += _config.units[p] || getUnit(_get(target, p)) || ""); 3930 (startValue + "").charAt(1) === "=" && (startValue = _get(target, p)); 3931 } else { 3932 startValue = _get(target, p); 3933 } 3934 startNum = parseFloat(startValue); 3935 relative = type === "string" && endValue.charAt(1) === "=" && endValue.substr(0, 2); 3936 relative && (endValue = endValue.substr(2)); 3937 endNum = parseFloat(endValue); 3938 if (p in _propertyAliases) { 3939 if (p === "autoAlpha") { 3940 if (startNum === 1 && _get(target, "visibility") === "hidden" && endNum) { 3941 startNum = 0; 3942 } 3943 inlineProps.push("visibility", 0, style.visibility); 3944 _addNonTweeningPT(this, style, "visibility", startNum ? "inherit" : "hidden", endNum ? "inherit" : "hidden", !endNum); 3945 } 3946 if (p !== "scale" && p !== "transform") { 3947 p = _propertyAliases[p]; 3948 ~p.indexOf(",") && (p = p.split(",")[0]); 3949 } 3950 }
vendor: 4,848 bytes, lines 3951-4045
3951 isTransformRelated = p in _transformProps; 3952 if (isTransformRelated) { 3953 this.styles.save(p); 3954 if (!transformPropTween) { 3955 cache = target._gsap; 3956 cache.renderTransform && !vars.parseTransform || _parseTransform(target, vars.parseTransform); 3957 smooth = vars.smoothOrigin !== false && cache.smooth; 3958 transformPropTween = this._pt = new PropTween(this._pt, style, _transformProp$1, 0, 1, cache.renderTransform, cache, 0, -1); 3959 transformPropTween.dep = 1; 3960 } 3961 if (p === "scale") { 3962 this._pt = new PropTween(this._pt, cache, "scaleY", cache.scaleY, (relative ? _parseRelative(cache.scaleY, relative + endNum) : endNum) - cache.scaleY || 0, _renderCSSProp); 3963 this._pt.u = 0; 3964 props.push("scaleY", p); 3965 p += "X"; 3966 } else if (p === "transformOrigin") { 3967 inlineProps.push(_transformOriginProp, 0, style[_transformOriginProp]); 3968 endValue = _convertKeywordsToPercentages(endValue); 3969 if (cache.svg) { 3970 _applySVGOrigin(target, endValue, 0, smooth, 0, this); 3971 } else { 3972 endUnit = parseFloat(endValue.split(" ")[2]) || 0; 3973 endUnit !== cache.zOrigin && _addNonTweeningPT(this, cache, "zOrigin", cache.zOrigin, endUnit); 3974 _addNonTweeningPT(this, style, p, _firstTwoOnly(startValue), _firstTwoOnly(endValue)); 3975 } 3976 continue; 3977 } else if (p === "svgOrigin") { 3978 _applySVGOrigin(target, endValue, 1, smooth, 0, this); 3979 continue; 3980 } else if (p in _rotationalProperties) { 3981 _addRotationalPropTween(this, cache, p, startNum, relative ? _parseRelative(startNum, relative + endValue) : endValue); 3982 continue; 3983 } else if (p === "smoothOrigin") { 3984 _addNonTweeningPT(this, cache, "smooth", cache.smooth, endValue); 3985 continue; 3986 } else if (p === "force3D") { 3987 cache[p] = endValue; 3988 continue; 3989 } else if (p === "transform") { 3990 _addRawTransformPTs(this, endValue, target); 3991 continue; 3992 } 3993 } else if (!(p in style)) { 3994 p = _checkPropPrefix(p) || p; 3995 } 3996 if (isTransformRelated || (endNum || endNum === 0) && (startNum || startNum === 0) && !_complexExp.test(endValue) && p in style) { 3997 startUnit = (startValue + "").substr((startNum + "").length); 3998 endNum || (endNum = 0); 3999 endUnit = getUnit(endValue) || (p in _config.units ? _config.units[p] : startUnit); 4000 startUnit !== endUnit && (startNum = _convertToUnit(target, p, startValue, endUnit)); 4001 this._pt = new PropTween(this._pt, isTransformRelated ? cache : style, p, startNum, (relative ? _parseRelative(startNum, relative + endNum) : endNum) - startNum, !isTransformRelated && (endUnit === "px" || p === "zIndex") && vars.autoRound !== false ? _renderRoundedCSSProp : _renderCSSProp); 4002 this._pt.u = endUnit || 0; 4003 if (startUnit !== endUnit && endUnit !== "%") { 4004 this._pt.b = startValue; 4005 this._pt.r = _renderCSSPropWithBeginning; 4006 } 4007 } else if (!(p in style)) { 4008 if (p in target) { 4009 this.add(target, p, startValue || target[p], relative ? relative + endValue : endValue, index, targets); 4010 } else if (p !== "parseTransform") { 4011 _missingPlugin(p, endValue); 4012 continue; 4013 } 4014 } else { 4015 _tweenComplexCSSString.call(this, target, p, startValue, relative ? relative + endValue : endValue); 4016 } 4017 isTransformRelated || (p in style ? inlineProps.push(p, 0, style[p]) : inlineProps.push(p, 1, startValue || target[p])); 4018 props.push(p); 4019 } 4020 } 4021 hasPriority && _sortPropTweensByPriority(this); 4022 }, 4023 render: function render2(ratio, data) { 4024 if (data.tween._time || !_reverting()) { 4025 var pt = data._pt; 4026 while (pt) { 4027 pt.r(ratio, pt.d); 4028 pt = pt._next; 4029 } 4030 } else { 4031 data.styles.revert(); 4032 } 4033 }, 4034 get: _get, 4035 aliases: _propertyAliases, 4036 getSetter: function getSetter(target, property, plugin) { 4037 var p = _propertyAliases[property]; 4038 p && p.indexOf(",") < 0 && (property = p); 4039 return property in _transformProps && property !== _transformOriginProp && (target._gsap.x || _get(target, "x")) ? plugin && _recentSetterPlugin === plugin ? property === "scale" ? _setterScale : _setterTransform : (_recentSetterPlugin = plugin || {}) && (property === "scale" ? _setterScaleWithRender : _setterTransformWithRender) : target.style && !_isUndefined(target.style[property]) ? _setterCSSStyle : ~property.indexOf("-") ? _setterCSSProp : _getSetter(target, property); 4040 }, 4041 core: { 4042 _removeProperty, 4043 _getMatrix 4044 } 4045};
vendor: 11,740 bytes, lines 4046-4262
4046gsap$3.utils.checkPrefix = _checkPropPrefix; 4047gsap$3.core.getStyleSaver = _getStyleSaver; 4048(function(positionAndScale, rotation, others, aliases) { 4049 var all = _forEachName(positionAndScale + "," + rotation + "," + others, function(name) { 4050 _transformProps[name] = 1; 4051 }); 4052 _forEachName(rotation, function(name) { 4053 _config.units[name] = "deg"; 4054 _rotationalProperties[name] = 1; 4055 }); 4056 _propertyAliases[all[13]] = positionAndScale + "," + rotation; 4057 _forEachName(aliases, function(name) { 4058 var split = name.split(":"); 4059 _propertyAliases[split[1]] = all[split[0]]; 4060 }); 4061})("x,y,z,scale,scaleX,scaleY,xPercent,yPercent", "rotation,rotationX,rotationY,skewX,skewY", "transform,transformOrigin,svgOrigin,force3D,smoothOrigin,transformPerspective", "0:translateX,1:translateY,2:translateZ,8:rotate,8:rotationZ,8:rotateZ,9:rotateX,10:rotateY"); 4062_forEachName("x,y,z,top,right,bottom,left,width,height,fontSize,padding,margin,perspective", function(name) { 4063 _config.units[name] = "px"; 4064}); 4065gsap$3.registerPlugin(CSSPlugin); 4066function _defineProperties$1(target, props) { 4067 for (var i = 0; i < props.length; i++) { 4068 var descriptor = props[i]; 4069 descriptor.enumerable = descriptor.enumerable || false; 4070 descriptor.configurable = true; 4071 if ("value" in descriptor) 4072 descriptor.writable = true; 4073 Object.defineProperty(target, descriptor.key, descriptor); 4074 } 4075} 4076function _createClass$1(Constructor, protoProps, staticProps) { 4077 if (protoProps) 4078 _defineProperties$1(Constructor.prototype, protoProps); 4079 if (staticProps) 4080 _defineProperties$1(Constructor, staticProps); 4081 return Constructor; 4082} 4083/*! 4084 * Observer 3.12.5 4085 * https://gsap.com 4086 * 4087 * @license Copyright 2008-2024, GreenSock. All rights reserved. 4088 * Subject to the terms at https://gsap.com/standard-license or for 4089 * Club GSAP members, the agreement issued with that membership. 4090 * @author: Jack Doyle, [email protected] 4091*/ 4092var gsap$2, _coreInitted$2, _win$2, _doc$2, _docEl$2, _body$2, _isTouch, _pointerType, ScrollTrigger$2, _root$1, _normalizer$1, _eventTypes, _context$2, _getGSAP$2 = function _getGSAP() { 4093 return gsap$2 || typeof window !== "undefined" && (gsap$2 = window.gsap) && gsap$2.registerPlugin && gsap$2; 4094}, _startup$1 = 1, _observers = [], _scrollers = [], _proxies = [], _getTime$1 = Date.now, _bridge = function _bridge2(name, value) { 4095 return value; 4096}, _integrate = function _integrate2() { 4097 var core = ScrollTrigger$2.core, data = core.bridge || {}, scrollers = core._scrollers, proxies = core._proxies; 4098 scrollers.push.apply(scrollers, _scrollers); 4099 proxies.push.apply(proxies, _proxies); 4100 _scrollers = scrollers; 4101 _proxies = proxies; 4102 _bridge = function _bridge3(name, value) { 4103 return data[name](value); 4104 }; 4105}, _getProxyProp = function _getProxyProp2(element, property) { 4106 return ~_proxies.indexOf(element) && _proxies[_proxies.indexOf(element) + 1][property]; 4107}, _isViewport$1 = function _isViewport(el) { 4108 return !!~_root$1.indexOf(el); 4109}, _addListener$1 = function _addListener(element, type, func, passive, capture) { 4110 return element.addEventListener(type, func, { 4111 passive: passive !== false, 4112 capture: !!capture 4113 }); 4114}, _removeListener$1 = function _removeListener(element, type, func, capture) { 4115 return element.removeEventListener(type, func, !!capture); 4116}, _scrollLeft = "scrollLeft", _scrollTop = "scrollTop", _onScroll$1 = function _onScroll() { 4117 return _normalizer$1 && _normalizer$1.isPressed || _scrollers.cache++; 4118}, _scrollCacheFunc = function _scrollCacheFunc2(f, doNotCache) { 4119 var cachingFunc = function cachingFunc2(value) { 4120 if (value || value === 0) { 4121 _startup$1 && (_win$2.history.scrollRestoration = "manual"); 4122 var isNormalizing = _normalizer$1 && _normalizer$1.isPressed; 4123 value = cachingFunc2.v = Math.round(value) || (_normalizer$1 && _normalizer$1.iOS ? 1 : 0); 4124 f(value); 4125 cachingFunc2.cacheID = _scrollers.cache; 4126 isNormalizing && _bridge("ss", value); 4127 } else if (doNotCache || _scrollers.cache !== cachingFunc2.cacheID || _bridge("ref")) { 4128 cachingFunc2.cacheID = _scrollers.cache; 4129 cachingFunc2.v = f(); 4130 } 4131 return cachingFunc2.v + cachingFunc2.offset; 4132 }; 4133 cachingFunc.offset = 0; 4134 return f && cachingFunc; 4135}, _horizontal = { 4136 s: _scrollLeft, 4137 p: "left", 4138 p2: "Left", 4139 os: "right", 4140 os2: "Right", 4141 d: "width", 4142 d2: "Width", 4143 a: "x", 4144 sc: _scrollCacheFunc(function(value) { 4145 return arguments.length ? _win$2.scrollTo(value, _vertical.sc()) : _win$2.pageXOffset || _doc$2[_scrollLeft] || _docEl$2[_scrollLeft] || _body$2[_scrollLeft] || 0; 4146 }) 4147}, _vertical = { 4148 s: _scrollTop, 4149 p: "top", 4150 p2: "Top", 4151 os: "bottom", 4152 os2: "Bottom", 4153 d: "height", 4154 d2: "Height", 4155 a: "y", 4156 op: _horizontal, 4157 sc: _scrollCacheFunc(function(value) { 4158 return arguments.length ? _win$2.scrollTo(_horizontal.sc(), value) : _win$2.pageYOffset || _doc$2[_scrollTop] || _docEl$2[_scrollTop] || _body$2[_scrollTop] || 0; 4159 }) 4160}, _getTarget = function _getTarget2(t, self) { 4161 return (self && self._ctx && self._ctx.selector || gsap$2.utils.toArray)(t)[0] || (typeof t === "string" && gsap$2.config().nullTargetWarn !== false ? console.warn("Element not found:", t) : null); 4162}, _getScrollFunc = function _getScrollFunc2(element, _ref) { 4163 var s = _ref.s, sc = _ref.sc; 4164 _isViewport$1(element) && (element = _doc$2.scrollingElement || _docEl$2); 4165 var i = _scrollers.indexOf(element), offset = sc === _vertical.sc ? 1 : 2; 4166 !~i && (i = _scrollers.push(element) - 1); 4167 _scrollers[i + offset] || _addListener$1(element, "scroll", _onScroll$1); 4168 var prev = _scrollers[i + offset], func = prev || (_scrollers[i + offset] = _scrollCacheFunc(_getProxyProp(element, s), true) || (_isViewport$1(element) ? sc : _scrollCacheFunc(function(value) { 4169 return arguments.length ? element[s] = value : element[s]; 4170 }))); 4171 func.target = element; 4172 prev || (func.smooth = gsap$2.getProperty(element, "scrollBehavior") === "smooth"); 4173 return func; 4174}, _getVelocityProp$1 = function _getVelocityProp(value, minTimeRefresh, useDelta) { 4175 var v1 = value, v2 = value, t1 = _getTime$1(), t2 = t1, min = minTimeRefresh || 50, dropToZeroTime = Math.max(500, min * 3), update = function update2(value2, force) { 4176 var t = _getTime$1(); 4177 if (force || t - t1 > min) { 4178 v2 = v1; 4179 v1 = value2; 4180 t2 = t1; 4181 t1 = t; 4182 } else if (useDelta) { 4183 v1 += value2; 4184 } else { 4185 v1 = v2 + (value2 - v2) / (t - t2) * (t1 - t2); 4186 } 4187 }, reset = function reset2() { 4188 v2 = v1 = useDelta ? 0 : v1; 4189 t2 = t1 = 0; 4190 }, getVelocity = function getVelocity2(latestValue) { 4191 var tOld = t2, vOld = v2, t = _getTime$1(); 4192 (latestValue || latestValue === 0) && latestValue !== v1 && update(latestValue); 4193 return t1 === t2 || t - t2 > dropToZeroTime ? 0 : (v1 + (useDelta ? vOld : -vOld)) / ((useDelta ? t : t1) - tOld) * 1e3; 4194 }; 4195 return { 4196 update, 4197 reset, 4198 getVelocity 4199 }; 4200}, _getEvent = function _getEvent2(e, preventDefault) { 4201 preventDefault && !e._gsapAllow && e.preventDefault(); 4202 return e.changedTouches ? e.changedTouches[0] : e; 4203}, _getAbsoluteMax = function _getAbsoluteMax2(a) { 4204 var max = Math.max.apply(Math, a), min = Math.min.apply(Math, a); 4205 return Math.abs(max) >= Math.abs(min) ? max : min; 4206}, _setScrollTrigger = function _setScrollTrigger2() { 4207 ScrollTrigger$2 = gsap$2.core.globals().ScrollTrigger; 4208 ScrollTrigger$2 && ScrollTrigger$2.core && _integrate(); 4209}, _initCore2 = function _initCore3(core) { 4210 gsap$2 = core || _getGSAP$2(); 4211 if (!_coreInitted$2 && gsap$2 && typeof document !== "undefined" && document.body) { 4212 _win$2 = window; 4213 _doc$2 = document; 4214 _docEl$2 = _doc$2.documentElement; 4215 _body$2 = _doc$2.body; 4216 _root$1 = [_win$2, _doc$2, _docEl$2, _body$2]; 4217 gsap$2.utils.clamp; 4218 _context$2 = gsap$2.core.context || function() { 4219 }; 4220 _pointerType = "onpointerenter" in _body$2 ? "pointer" : "mouse"; 4221 _isTouch = Observer.isTouch = _win$2.matchMedia && _win$2.matchMedia("(hover: none), (pointer: coarse)").matches ? 1 : "ontouchstart" in _win$2 || navigator.maxTouchPoints > 0 || navigator.msMaxTouchPoints > 0 ? 2 : 0; 4222 _eventTypes = Observer.eventTypes = ("ontouchstart" in _docEl$2 ? "touchstart,touchmove,touchcancel,touchend" : !("onpointerdown" in _docEl$2) ? "mousedown,mousemove,mouseup,mouseup" : "pointerdown,pointermove,pointercancel,pointerup").split(","); 4223 setTimeout(function() { 4224 return _startup$1 = 0; 4225 }, 500); 4226 _setScrollTrigger(); 4227 _coreInitted$2 = 1; 4228 } 4229 return _coreInitted$2; 4230}; 4231_horizontal.op = _vertical; 4232_scrollers.cache = 0; 4233var Observer = /* @__PURE__ */ function() { 4234 function Observer2(vars) { 4235 this.init(vars); 4236 } 4237 var _proto = Observer2.prototype; 4238 _proto.init = function init4(vars) { 4239 _coreInitted$2 || _initCore2(gsap$2) || console.warn("Please gsap.registerPlugin(Observer)"); 4240 ScrollTrigger$2 || _setScrollTrigger(); 4241 var tolerance = vars.tolerance, dragMinimum = vars.dragMinimum, type = vars.type, target = vars.target, lineHeight = vars.lineHeight, debounce = vars.debounce, preventDefault = vars.preventDefault, onStop = vars.onStop, onStopDelay = vars.onStopDelay, ignore = vars.ignore, wheelSpeed = vars.wheelSpeed, event = vars.event, onDragStart = vars.onDragStart, onDragEnd = vars.onDragEnd, onDrag = vars.onDrag, onPress = vars.onPress, onRelease = vars.onRelease, onRight = vars.onRight, onLeft = vars.onLeft, onUp = vars.onUp, onDown = vars.onDown, onChangeX = vars.onChangeX, onChangeY = vars.onChangeY, onChange = vars.onChange, onToggleX = vars.onToggleX, onToggleY = vars.onToggleY, onHover = vars.onHover, onHoverEnd = vars.onHoverEnd, onMove = vars.onMove, ignoreCheck = vars.ignoreCheck, isNormalizer = vars.isNormalizer, onGestureStart = vars.onGestureStart, onGestureEnd = vars.onGestureEnd, onWheel = vars.onWheel, onEnable = vars.onEnable, onDisable = vars.onDisable, onClick = vars.onClick, scrollSpeed = vars.scrollSpeed, capture = vars.capture, allowClicks = vars.allowClicks, lockAxis = vars.lockAxis, onLockAxis = vars.onLockAxis; 4242 this.target = target = _getTarget(target) || _docEl$2; 4243 this.vars = vars; 4244 ignore && (ignore = gsap$2.utils.toArray(ignore)); 4245 tolerance = tolerance || 1e-9; 4246 dragMinimum = dragMinimum || 0; 4247 wheelSpeed = wheelSpeed || 1; 4248 scrollSpeed = scrollSpeed || 1; 4249 type = type || "wheel,touch,pointer"; 4250 debounce = debounce !== false; 4251 lineHeight || (lineHeight = parseFloat(_win$2.getComputedStyle(_body$2).lineHeight) || 22); 4252 var id, onStopDelayedCall, dragged, moved, wheeled, locked, axis, self = this, prevDeltaX = 0, prevDeltaY = 0, passive = vars.passive || !preventDefault, scrollFuncX = _getScrollFunc(target, _horizontal), scrollFuncY = _getScrollFunc(target, _vertical), scrollX = scrollFuncX(), scrollY = scrollFuncY(), limitToTouch = ~type.indexOf("touch") && !~type.indexOf("pointer") && _eventTypes[0] === "pointerdown", isViewport = _isViewport$1(target), ownerDoc = target.ownerDocument || _doc$2, deltaX = [0, 0, 0], deltaY = [0, 0, 0], onClickTime = 0, clickCapture = function clickCapture2() { 4253 return onClickTime = _getTime$1(); 4254 }, _ignoreCheck = function _ignoreCheck2(e, isPointerOrTouch) { 4255 return (self.event = e) && ignore && ~ignore.indexOf(e.target) || isPointerOrTouch && limitToTouch && e.pointerType !== "touch" || ignoreCheck && ignoreCheck(e, isPointerOrTouch); 4256 }, onStopFunc = function onStopFunc2() { 4257 self._vx.reset(); 4258 self._vy.reset(); 4259 onStopDelayedCall.pause(); 4260 onStop && onStop(self); 4261 }, update = function update2() { 4262 var dx = self.deltaX = _getAbsoluteMax(deltaX), dy = self.deltaY = _getAbsoluteMax(deltaY), changedX = Math.abs(dx) >= tolerance, changedY = Math.abs(dy) >= tolerance;
vendor: 9,028 bytes, lines 4263-4465
4263 onChange && (changedX || changedY) && onChange(self, dx, dy, deltaX, deltaY); 4264 if (changedX) { 4265 onRight && self.deltaX > 0 && onRight(self); 4266 onLeft && self.deltaX < 0 && onLeft(self); 4267 onChangeX && onChangeX(self); 4268 onToggleX && self.deltaX < 0 !== prevDeltaX < 0 && onToggleX(self); 4269 prevDeltaX = self.deltaX; 4270 deltaX[0] = deltaX[1] = deltaX[2] = 0; 4271 } 4272 if (changedY) { 4273 onDown && self.deltaY > 0 && onDown(self); 4274 onUp && self.deltaY < 0 && onUp(self); 4275 onChangeY && onChangeY(self); 4276 onToggleY && self.deltaY < 0 !== prevDeltaY < 0 && onToggleY(self); 4277 prevDeltaY = self.deltaY; 4278 deltaY[0] = deltaY[1] = deltaY[2] = 0; 4279 } 4280 if (moved || dragged) { 4281 onMove && onMove(self); 4282 if (dragged) { 4283 onDrag(self); 4284 dragged = false; 4285 } 4286 moved = false; 4287 } 4288 locked && !(locked = false) && onLockAxis && onLockAxis(self); 4289 if (wheeled) { 4290 onWheel(self); 4291 wheeled = false; 4292 } 4293 id = 0; 4294 }, onDelta = function onDelta2(x, y, index) { 4295 deltaX[index] += x; 4296 deltaY[index] += y; 4297 self._vx.update(x); 4298 self._vy.update(y); 4299 debounce ? id || (id = requestAnimationFrame(update)) : update(); 4300 }, onTouchOrPointerDelta = function onTouchOrPointerDelta2(x, y) { 4301 if (lockAxis && !axis) { 4302 self.axis = axis = Math.abs(x) > Math.abs(y) ? "x" : "y"; 4303 locked = true; 4304 } 4305 if (axis !== "y") { 4306 deltaX[2] += x; 4307 self._vx.update(x, true); 4308 } 4309 if (axis !== "x") { 4310 deltaY[2] += y; 4311 self._vy.update(y, true); 4312 } 4313 debounce ? id || (id = requestAnimationFrame(update)) : update(); 4314 }, _onDrag = function _onDrag2(e) { 4315 if (_ignoreCheck(e, 1)) { 4316 return; 4317 } 4318 e = _getEvent(e, preventDefault); 4319 var x = e.clientX, y = e.clientY, dx = x - self.x, dy = y - self.y, isDragging = self.isDragging; 4320 self.x = x; 4321 self.y = y; 4322 if (isDragging || Math.abs(self.startX - x) >= dragMinimum || Math.abs(self.startY - y) >= dragMinimum) { 4323 onDrag && (dragged = true); 4324 isDragging || (self.isDragging = true); 4325 onTouchOrPointerDelta(dx, dy); 4326 isDragging || onDragStart && onDragStart(self); 4327 } 4328 }, _onPress = self.onPress = function(e) { 4329 if (_ignoreCheck(e, 1) || e && e.button) { 4330 return; 4331 } 4332 self.axis = axis = null; 4333 onStopDelayedCall.pause(); 4334 self.isPressed = true; 4335 e = _getEvent(e); 4336 prevDeltaX = prevDeltaY = 0; 4337 self.startX = self.x = e.clientX; 4338 self.startY = self.y = e.clientY; 4339 self._vx.reset(); 4340 self._vy.reset(); 4341 _addListener$1(isNormalizer ? target : ownerDoc, _eventTypes[1], _onDrag, passive, true); 4342 self.deltaX = self.deltaY = 0; 4343 onPress && onPress(self); 4344 }, _onRelease = self.onRelease = function(e) { 4345 if (_ignoreCheck(e, 1)) { 4346 return; 4347 } 4348 _removeListener$1(isNormalizer ? target : ownerDoc, _eventTypes[1], _onDrag, true); 4349 var isTrackingDrag = !isNaN(self.y - self.startY), wasDragging = self.isDragging, isDragNotClick = wasDragging && (Math.abs(self.x - self.startX) > 3 || Math.abs(self.y - self.startY) > 3), eventData = _getEvent(e); 4350 if (!isDragNotClick && isTrackingDrag) { 4351 self._vx.reset(); 4352 self._vy.reset(); 4353 if (preventDefault && allowClicks) { 4354 gsap$2.delayedCall(0.08, function() { 4355 if (_getTime$1() - onClickTime > 300 && !e.defaultPrevented) { 4356 if (e.target.click) { 4357 e.target.click(); 4358 } else if (ownerDoc.createEvent) { 4359 var syntheticEvent = ownerDoc.createEvent("MouseEvents"); 4360 syntheticEvent.initMouseEvent("click", true, true, _win$2, 1, eventData.screenX, eventData.screenY, eventData.clientX, eventData.clientY, false, false, false, false, 0, null); 4361 e.target.dispatchEvent(syntheticEvent); 4362 } 4363 } 4364 }); 4365 } 4366 } 4367 self.isDragging = self.isGesturing = self.isPressed = false; 4368 onStop && wasDragging && !isNormalizer && onStopDelayedCall.restart(true); 4369 onDragEnd && wasDragging && onDragEnd(self); 4370 onRelease && onRelease(self, isDragNotClick); 4371 }, _onGestureStart = function _onGestureStart2(e) { 4372 return e.touches && e.touches.length > 1 && (self.isGesturing = true) && onGestureStart(e, self.isDragging); 4373 }, _onGestureEnd = function _onGestureEnd2() { 4374 return (self.isGesturing = false) || onGestureEnd(self); 4375 }, onScroll = function onScroll2(e) { 4376 if (_ignoreCheck(e)) { 4377 return; 4378 } 4379 var x = scrollFuncX(), y = scrollFuncY(); 4380 onDelta((x - scrollX) * scrollSpeed, (y - scrollY) * scrollSpeed, 1); 4381 scrollX = x; 4382 scrollY = y; 4383 onStop && onStopDelayedCall.restart(true); 4384 }, _onWheel = function _onWheel2(e) { 4385 if (_ignoreCheck(e)) { 4386 return; 4387 } 4388 e = _getEvent(e, preventDefault); 4389 onWheel && (wheeled = true); 4390 var multiplier = (e.deltaMode === 1 ? lineHeight : e.deltaMode === 2 ? _win$2.innerHeight : 1) * wheelSpeed; 4391 onDelta(e.deltaX * multiplier, e.deltaY * multiplier, 0); 4392 onStop && !isNormalizer && onStopDelayedCall.restart(true); 4393 }, _onMove = function _onMove2(e) { 4394 if (_ignoreCheck(e)) { 4395 return; 4396 } 4397 var x = e.clientX, y = e.clientY, dx = x - self.x, dy = y - self.y; 4398 self.x = x; 4399 self.y = y; 4400 moved = true; 4401 onStop && onStopDelayedCall.restart(true); 4402 (dx || dy) && onTouchOrPointerDelta(dx, dy); 4403 }, _onHover = function _onHover2(e) { 4404 self.event = e; 4405 onHover(self); 4406 }, _onHoverEnd = function _onHoverEnd2(e) { 4407 self.event = e; 4408 onHoverEnd(self); 4409 }, _onClick = function _onClick2(e) { 4410 return _ignoreCheck(e) || _getEvent(e, preventDefault) && onClick(self); 4411 }; 4412 onStopDelayedCall = self._dc = gsap$2.delayedCall(onStopDelay || 0.25, onStopFunc).pause(); 4413 self.deltaX = self.deltaY = 0; 4414 self._vx = _getVelocityProp$1(0, 50, true); 4415 self._vy = _getVelocityProp$1(0, 50, true); 4416 self.scrollX = scrollFuncX; 4417 self.scrollY = scrollFuncY; 4418 self.isDragging = self.isGesturing = self.isPressed = false; 4419 _context$2(this); 4420 self.enable = function(e) { 4421 if (!self.isEnabled) { 4422 _addListener$1(isViewport ? ownerDoc : target, "scroll", _onScroll$1); 4423 type.indexOf("scroll") >= 0 && _addListener$1(isViewport ? ownerDoc : target, "scroll", onScroll, passive, capture); 4424 type.indexOf("wheel") >= 0 && _addListener$1(target, "wheel", _onWheel, passive, capture); 4425 if (type.indexOf("touch") >= 0 && _isTouch || type.indexOf("pointer") >= 0) { 4426 _addListener$1(target, _eventTypes[0], _onPress, passive, capture); 4427 _addListener$1(ownerDoc, _eventTypes[2], _onRelease); 4428 _addListener$1(ownerDoc, _eventTypes[3], _onRelease); 4429 allowClicks && _addListener$1(target, "click", clickCapture, true, true); 4430 onClick && _addListener$1(target, "click", _onClick); 4431 onGestureStart && _addListener$1(ownerDoc, "gesturestart", _onGestureStart); 4432 onGestureEnd && _addListener$1(ownerDoc, "gestureend", _onGestureEnd); 4433 onHover && _addListener$1(target, _pointerType + "enter", _onHover); 4434 onHoverEnd && _addListener$1(target, _pointerType + "leave", _onHoverEnd); 4435 onMove && _addListener$1(target, _pointerType + "move", _onMove); 4436 } 4437 self.isEnabled = true; 4438 e && e.type && _onPress(e); 4439 onEnable && onEnable(self); 4440 } 4441 return self; 4442 }; 4443 self.disable = function() { 4444 if (self.isEnabled) { 4445 _observers.filter(function(o) { 4446 return o !== self && _isViewport$1(o.target); 4447 }).length || _removeListener$1(isViewport ? ownerDoc : target, "scroll", _onScroll$1); 4448 if (self.isPressed) { 4449 self._vx.reset(); 4450 self._vy.reset(); 4451 _removeListener$1(isNormalizer ? target : ownerDoc, _eventTypes[1], _onDrag, true); 4452 } 4453 _removeListener$1(isViewport ? ownerDoc : target, "scroll", onScroll, capture); 4454 _removeListener$1(target, "wheel", _onWheel, capture); 4455 _removeListener$1(target, _eventTypes[0], _onPress, capture); 4456 _removeListener$1(ownerDoc, _eventTypes[2], _onRelease); 4457 _removeListener$1(ownerDoc, _eventTypes[3], _onRelease); 4458 _removeListener$1(target, "click", clickCapture, true); 4459 _removeListener$1(target, "click", _onClick); 4460 _removeListener$1(ownerDoc, "gesturestart", _onGestureStart); 4461 _removeListener$1(ownerDoc, "gestureend", _onGestureEnd); 4462 _removeListener$1(target, _pointerType + "enter", _onHover); 4463 _removeListener$1(target, _pointerType + "leave", _onHoverEnd); 4464 _removeListener$1(target, _pointerType + "move", _onMove); 4465 self.isEnabled = self.isPressed = self.isDragging = false;
vendor: 4,503 bytes, lines 4466-4562
4466 onDisable && onDisable(self); 4467 } 4468 }; 4469 self.kill = self.revert = function() { 4470 self.disable(); 4471 var i = _observers.indexOf(self); 4472 i >= 0 && _observers.splice(i, 1); 4473 _normalizer$1 === self && (_normalizer$1 = 0); 4474 }; 4475 _observers.push(self); 4476 isNormalizer && _isViewport$1(target) && (_normalizer$1 = self); 4477 self.enable(event); 4478 }; 4479 _createClass$1(Observer2, [{ 4480 key: "velocityX", 4481 get: function get() { 4482 return this._vx.getVelocity(); 4483 } 4484 }, { 4485 key: "velocityY", 4486 get: function get() { 4487 return this._vy.getVelocity(); 4488 } 4489 }]); 4490 return Observer2; 4491}(); 4492Observer.version = "3.12.5"; 4493Observer.create = function(vars) { 4494 return new Observer(vars); 4495}; 4496Observer.register = _initCore2; 4497Observer.getAll = function() { 4498 return _observers.slice(); 4499}; 4500Observer.getById = function(id) { 4501 return _observers.filter(function(o) { 4502 return o.vars.id === id; 4503 })[0]; 4504}; 4505_getGSAP$2() && gsap$2.registerPlugin(Observer); 4506/*! 4507 * ScrollTrigger 3.12.5 4508 * https://gsap.com 4509 * 4510 * @license Copyright 2008-2024, GreenSock. All rights reserved. 4511 * Subject to the terms at https://gsap.com/standard-license or for 4512 * Club GSAP members, the agreement issued with that membership. 4513 * @author: Jack Doyle, [email protected] 4514*/ 4515var gsap$1, _coreInitted$1, _win$1, _doc$1, _docEl$1, _body$1, _root, _resizeDelay, _toArray$1, _clamp$1, _time2, _syncInterval, _refreshing, _pointerIsDown, _transformProp, _i, _prevWidth, _prevHeight, _autoRefresh, _sort, _suppressOverwrites, _ignoreResize, _normalizer, _ignoreMobileResize, _baseScreenHeight, _baseScreenWidth, _fixIOSBug, _context$1, _scrollRestoration, _div100vh, _100vh, _isReverted, _clampingMax, _limitCallbacks, _startup = 1, _getTime = Date.now, _time1 = _getTime(), _lastScrollTime = 0, _enabled = 0, _parseClamp = function _parseClamp2(value, type, self) { 4516 var clamp3 = _isString2(value) && (value.substr(0, 6) === "clamp(" || value.indexOf("max") > -1); 4517 self["_" + type + "Clamp"] = clamp3; 4518 return clamp3 ? value.substr(6, value.length - 7) : value; 4519}, _keepClamp = function _keepClamp2(value, clamp3) { 4520 return clamp3 && (!_isString2(value) || value.substr(0, 6) !== "clamp(") ? "clamp(" + value + ")" : value; 4521}, _rafBugFix = function _rafBugFix2() { 4522 return _enabled && requestAnimationFrame(_rafBugFix2); 4523}, _pointerDownHandler = function _pointerDownHandler2() { 4524 return _pointerIsDown = 1; 4525}, _pointerUpHandler = function _pointerUpHandler2() { 4526 return _pointerIsDown = 0; 4527}, _passThrough2 = function _passThrough3(v) { 4528 return v; 4529}, _round$1 = function _round2(value) { 4530 return Math.round(value * 1e5) / 1e5 || 0; 4531}, _windowExists$1 = function _windowExists3() { 4532 return typeof window !== "undefined"; 4533}, _getGSAP$1 = function _getGSAP2() { 4534 return gsap$1 || _windowExists$1() && (gsap$1 = window.gsap) && gsap$1.registerPlugin && gsap$1; 4535}, _isViewport2 = function _isViewport3(e) { 4536 return !!~_root.indexOf(e); 4537}, _getViewportDimension = function _getViewportDimension2(dimensionProperty) { 4538 return (dimensionProperty === "Height" ? _100vh : _win$1["inner" + dimensionProperty]) || _docEl$1["client" + dimensionProperty] || _body$1["client" + dimensionProperty]; 4539}, _getBoundsFunc = function _getBoundsFunc2(element) { 4540 return _getProxyProp(element, "getBoundingClientRect") || (_isViewport2(element) ? function() { 4541 _winOffsets.width = _win$1.innerWidth; 4542 _winOffsets.height = _100vh; 4543 return _winOffsets; 4544 } : function() { 4545 return _getBounds(element); 4546 }); 4547}, _getSizeFunc = function _getSizeFunc2(scroller, isViewport, _ref) { 4548 var d = _ref.d, d2 = _ref.d2, a = _ref.a; 4549 return (a = _getProxyProp(scroller, "getBoundingClientRect")) ? function() { 4550 return a()[d]; 4551 } : function() { 4552 return (isViewport ? _getViewportDimension(d2) : scroller["client" + d2]) || 0; 4553 }; 4554}, _getOffsetsFunc = function _getOffsetsFunc2(element, isViewport) { 4555 return !isViewport || ~_proxies.indexOf(element) ? _getBoundsFunc(element) : function() { 4556 return _winOffsets; 4557 }; 4558}, _maxScroll$1 = function _maxScroll(element, _ref2) { 4559 var s = _ref2.s, d2 = _ref2.d2, d = _ref2.d, a = _ref2.a; 4560 return Math.max(0, (s = "scroll" + d2) && (a = _getProxyProp(element, s)) ? a() - _getBoundsFunc(element)()[d] : _isViewport2(element) ? (_docEl$1[s] || _body$1[s]) - _getViewportDimension(d2) : element[s] - element["offset" + d2]); 4561}, _iterateAutoRefresh = function _iterateAutoRefresh2(func, events) { 4562 for (var i = 0; i < _autoRefresh.length; i += 3) {
vendor: 16,603 bytes, lines 4563-4946
4563 (!events || ~events.indexOf(_autoRefresh[i + 1])) && func(_autoRefresh[i], _autoRefresh[i + 1], _autoRefresh[i + 2]); 4564 } 4565}, _isString2 = function _isString3(value) { 4566 return typeof value === "string"; 4567}, _isFunction2 = function _isFunction3(value) { 4568 return typeof value === "function"; 4569}, _isNumber2 = function _isNumber3(value) { 4570 return typeof value === "number"; 4571}, _isObject2 = function _isObject3(value) { 4572 return typeof value === "object"; 4573}, _endAnimation = function _endAnimation2(animation, reversed, pause) { 4574 return animation && animation.progress(reversed ? 0 : 1) && pause && animation.pause(); 4575}, _callback2 = function _callback3(self, func) { 4576 if (self.enabled) { 4577 var result = self._ctx ? self._ctx.add(function() { 4578 return func(self); 4579 }) : func(self); 4580 result && result.totalTime && (self.callbackAnimation = result); 4581 } 4582}, _abs = Math.abs, _left = "left", _top = "top", _right = "right", _bottom = "bottom", _width = "width", _height = "height", _Right = "Right", _Left = "Left", _Top = "Top", _Bottom = "Bottom", _padding = "padding", _margin = "margin", _Width = "Width", _Height = "Height", _px = "px", _getComputedStyle = function _getComputedStyle2(element) { 4583 return _win$1.getComputedStyle(element); 4584}, _makePositionable = function _makePositionable2(element) { 4585 var position = _getComputedStyle(element).position; 4586 element.style.position = position === "absolute" || position === "fixed" ? position : "relative"; 4587}, _setDefaults2 = function _setDefaults3(obj, defaults2) { 4588 for (var p in defaults2) { 4589 p in obj || (obj[p] = defaults2[p]); 4590 } 4591 return obj; 4592}, _getBounds = function _getBounds2(element, withoutTransforms) { 4593 var tween = withoutTransforms && _getComputedStyle(element)[_transformProp] !== "matrix(1, 0, 0, 1, 0, 0)" && gsap$1.to(element, { 4594 x: 0, 4595 y: 0, 4596 xPercent: 0, 4597 yPercent: 0, 4598 rotation: 0, 4599 rotationX: 0, 4600 rotationY: 0, 4601 scale: 1, 4602 skewX: 0, 4603 skewY: 0 4604 }).progress(1), bounds = element.getBoundingClientRect(); 4605 tween && tween.progress(0).kill(); 4606 return bounds; 4607}, _getSize = function _getSize2(element, _ref3) { 4608 var d2 = _ref3.d2; 4609 return element["offset" + d2] || element["client" + d2] || 0; 4610}, _getLabelRatioArray = function _getLabelRatioArray2(timeline2) { 4611 var a = [], labels = timeline2.labels, duration = timeline2.duration(), p; 4612 for (p in labels) { 4613 a.push(labels[p] / duration); 4614 } 4615 return a; 4616}, _getClosestLabel = function _getClosestLabel2(animation) { 4617 return function(value) { 4618 return gsap$1.utils.snap(_getLabelRatioArray(animation), value); 4619 }; 4620}, _snapDirectional = function _snapDirectional2(snapIncrementOrArray) { 4621 var snap3 = gsap$1.utils.snap(snapIncrementOrArray), a = Array.isArray(snapIncrementOrArray) && snapIncrementOrArray.slice(0).sort(function(a2, b) { 4622 return a2 - b; 4623 }); 4624 return a ? function(value, direction, threshold) { 4625 if (threshold === void 0) { 4626 threshold = 1e-3; 4627 } 4628 var i; 4629 if (!direction) { 4630 return snap3(value); 4631 } 4632 if (direction > 0) { 4633 value -= threshold; 4634 for (i = 0; i < a.length; i++) { 4635 if (a[i] >= value) { 4636 return a[i]; 4637 } 4638 } 4639 return a[i - 1]; 4640 } else { 4641 i = a.length; 4642 value += threshold; 4643 while (i--) { 4644 if (a[i] <= value) { 4645 return a[i]; 4646 } 4647 } 4648 } 4649 return a[0]; 4650 } : function(value, direction, threshold) { 4651 if (threshold === void 0) { 4652 threshold = 1e-3; 4653 } 4654 var snapped = snap3(value); 4655 return !direction || Math.abs(snapped - value) < threshold || snapped - value < 0 === direction < 0 ? snapped : snap3(direction < 0 ? value - snapIncrementOrArray : value + snapIncrementOrArray); 4656 }; 4657}, _getLabelAtDirection = function _getLabelAtDirection2(timeline2) { 4658 return function(value, st) { 4659 return _snapDirectional(_getLabelRatioArray(timeline2))(value, st.direction); 4660 }; 4661}, _multiListener = function _multiListener2(func, element, types, callback) { 4662 return types.split(",").forEach(function(type) { 4663 return func(element, type, callback); 4664 }); 4665}, _addListener2 = function _addListener3(element, type, func, nonPassive, capture) { 4666 return element.addEventListener(type, func, { 4667 passive: !nonPassive, 4668 capture: !!capture 4669 }); 4670}, _removeListener2 = function _removeListener3(element, type, func, capture) { 4671 return element.removeEventListener(type, func, !!capture); 4672}, _wheelListener = function _wheelListener2(func, el, scrollFunc) { 4673 scrollFunc = scrollFunc && scrollFunc.wheelHandler; 4674 if (scrollFunc) { 4675 func(el, "wheel", scrollFunc); 4676 func(el, "touchmove", scrollFunc); 4677 } 4678}, _markerDefaults = { 4679 startColor: "green", 4680 endColor: "red", 4681 indent: 0, 4682 fontSize: "16px", 4683 fontWeight: "normal" 4684}, _defaults = { 4685 toggleActions: "play", 4686 anticipatePin: 0 4687}, _keywords = { 4688 top: 0, 4689 left: 0, 4690 center: 0.5, 4691 bottom: 1, 4692 right: 1 4693}, _offsetToPx = function _offsetToPx2(value, size2) { 4694 if (_isString2(value)) { 4695 var eqIndex = value.indexOf("="), relative = ~eqIndex ? +(value.charAt(eqIndex - 1) + 1) * parseFloat(value.substr(eqIndex + 1)) : 0; 4696 if (~eqIndex) { 4697 value.indexOf("%") > eqIndex && (relative *= size2 / 100); 4698 value = value.substr(0, eqIndex - 1); 4699 } 4700 value = relative + (value in _keywords ? _keywords[value] * size2 : ~value.indexOf("%") ? parseFloat(value) * size2 / 100 : parseFloat(value) || 0); 4701 } 4702 return value; 4703}, _createMarker = function _createMarker2(type, name, container, direction, _ref4, offset, matchWidthEl, containerAnimation) { 4704 var startColor = _ref4.startColor, endColor = _ref4.endColor, fontSize = _ref4.fontSize, indent = _ref4.indent, fontWeight = _ref4.fontWeight; 4705 var e = _doc$1.createElement("div"), useFixedPosition = _isViewport2(container) || _getProxyProp(container, "pinType") === "fixed", isScroller = type.indexOf("scroller") !== -1, parent = useFixedPosition ? _body$1 : container, isStart = type.indexOf("start") !== -1, color = isStart ? startColor : endColor, css = "border-color:" + color + ";font-size:" + fontSize + ";color:" + color + ";font-weight:" + fontWeight + ";pointer-events:none;white-space:nowrap;font-family:sans-serif,Arial;z-index:1000;padding:4px 8px;border-width:0;border-style:solid;"; 4706 css += "position:" + ((isScroller || containerAnimation) && useFixedPosition ? "fixed;" : "absolute;"); 4707 (isScroller || containerAnimation || !useFixedPosition) && (css += (direction === _vertical ? _right : _bottom) + ":" + (offset + parseFloat(indent)) + "px;"); 4708 matchWidthEl && (css += "box-sizing:border-box;text-align:left;width:" + matchWidthEl.offsetWidth + "px;"); 4709 e._isStart = isStart; 4710 e.setAttribute("class", "gsap-marker-" + type + (name ? " marker-" + name : "")); 4711 e.style.cssText = css; 4712 e.innerText = name || name === 0 ? type + "-" + name : type; 4713 parent.children[0] ? parent.insertBefore(e, parent.children[0]) : parent.appendChild(e); 4714 e._offset = e["offset" + direction.op.d2]; 4715 _positionMarker(e, 0, direction, isStart); 4716 return e; 4717}, _positionMarker = function _positionMarker2(marker, start, direction, flipped) { 4718 var vars = { 4719 display: "block" 4720 }, side = direction[flipped ? "os2" : "p2"], oppositeSide = direction[flipped ? "p2" : "os2"]; 4721 marker._isFlipped = flipped; 4722 vars[direction.a + "Percent"] = flipped ? -100 : 0; 4723 vars[direction.a] = flipped ? "1px" : 0; 4724 vars["border" + side + _Width] = 1; 4725 vars["border" + oppositeSide + _Width] = 0; 4726 vars[direction.p] = start + "px"; 4727 gsap$1.set(marker, vars); 4728}, _triggers = [], _ids = {}, _rafID, _sync = function _sync2() { 4729 return _getTime() - _lastScrollTime > 34 && (_rafID || (_rafID = requestAnimationFrame(_updateAll))); 4730}, _onScroll2 = function _onScroll3() { 4731 if (!_normalizer || !_normalizer.isPressed || _normalizer.startX > _body$1.clientWidth) { 4732 _scrollers.cache++; 4733 if (_normalizer) { 4734 _rafID || (_rafID = requestAnimationFrame(_updateAll)); 4735 } else { 4736 _updateAll(); 4737 } 4738 _lastScrollTime || _dispatch2("scrollStart"); 4739 _lastScrollTime = _getTime(); 4740 } 4741}, _setBaseDimensions = function _setBaseDimensions2() { 4742 _baseScreenWidth = _win$1.innerWidth; 4743 _baseScreenHeight = _win$1.innerHeight; 4744}, _onResize = function _onResize2() { 4745 _scrollers.cache++; 4746 !_refreshing && !_ignoreResize && !_doc$1.fullscreenElement && !_doc$1.webkitFullscreenElement && (!_ignoreMobileResize || _baseScreenWidth !== _win$1.innerWidth || Math.abs(_win$1.innerHeight - _baseScreenHeight) > _win$1.innerHeight * 0.25) && _resizeDelay.restart(true); 4747}, _listeners = {}, _emptyArray = [], _softRefresh = function _softRefresh2() { 4748 return _removeListener2(ScrollTrigger$1, "scrollEnd", _softRefresh2) || _refreshAll(true); 4749}, _dispatch2 = function _dispatch3(type) { 4750 return _listeners[type] && _listeners[type].map(function(f) { 4751 return f(); 4752 }) || _emptyArray; 4753}, _savedStyles = [], _revertRecorded = function _revertRecorded2(media) { 4754 for (var i = 0; i < _savedStyles.length; i += 5) { 4755 if (!media || _savedStyles[i + 4] && _savedStyles[i + 4].query === media) { 4756 _savedStyles[i].style.cssText = _savedStyles[i + 1]; 4757 _savedStyles[i].getBBox && _savedStyles[i].setAttribute("transform", _savedStyles[i + 2] || ""); 4758 _savedStyles[i + 3].uncache = 1; 4759 } 4760 } 4761}, _revertAll = function _revertAll2(kill, media) { 4762 var trigger; 4763 for (_i = 0; _i < _triggers.length; _i++) { 4764 trigger = _triggers[_i]; 4765 if (trigger && (!media || trigger._ctx === media)) { 4766 if (kill) { 4767 trigger.kill(1); 4768 } else { 4769 trigger.revert(true, true); 4770 } 4771 } 4772 } 4773 _isReverted = true; 4774 media && _revertRecorded(media); 4775 media || _dispatch2("revert"); 4776}, _clearScrollMemory = function _clearScrollMemory2(scrollRestoration, force) { 4777 _scrollers.cache++; 4778 (force || !_refreshingAll) && _scrollers.forEach(function(obj) { 4779 return _isFunction2(obj) && obj.cacheID++ && (obj.rec = 0); 4780 }); 4781 _isString2(scrollRestoration) && (_win$1.history.scrollRestoration = _scrollRestoration = scrollRestoration); 4782}, _refreshingAll, _refreshID = 0, _queueRefreshID, _queueRefreshAll = function _queueRefreshAll2() { 4783 if (_queueRefreshID !== _refreshID) { 4784 var id = _queueRefreshID = _refreshID; 4785 requestAnimationFrame(function() { 4786 return id === _refreshID && _refreshAll(true); 4787 }); 4788 } 4789}, _refresh100vh = function _refresh100vh2() { 4790 _body$1.appendChild(_div100vh); 4791 _100vh = !_normalizer && _div100vh.offsetHeight || _win$1.innerHeight; 4792 _body$1.removeChild(_div100vh); 4793}, _hideAllMarkers = function _hideAllMarkers2(hide) { 4794 return _toArray$1(".gsap-marker-start, .gsap-marker-end, .gsap-marker-scroller-start, .gsap-marker-scroller-end").forEach(function(el) { 4795 return el.style.display = hide ? "none" : "block"; 4796 }); 4797}, _refreshAll = function _refreshAll2(force, skipRevert) { 4798 if (_lastScrollTime && !force && !_isReverted) { 4799 _addListener2(ScrollTrigger$1, "scrollEnd", _softRefresh); 4800 return; 4801 } 4802 _refresh100vh(); 4803 _refreshingAll = ScrollTrigger$1.isRefreshing = true; 4804 _scrollers.forEach(function(obj) { 4805 return _isFunction2(obj) && ++obj.cacheID && (obj.rec = obj()); 4806 }); 4807 var refreshInits = _dispatch2("refreshInit"); 4808 _sort && ScrollTrigger$1.sort(); 4809 skipRevert || _revertAll(); 4810 _scrollers.forEach(function(obj) { 4811 if (_isFunction2(obj)) { 4812 obj.smooth && (obj.target.style.scrollBehavior = "auto"); 4813 obj(0); 4814 } 4815 }); 4816 _triggers.slice(0).forEach(function(t) { 4817 return t.refresh(); 4818 }); 4819 _isReverted = false; 4820 _triggers.forEach(function(t) { 4821 if (t._subPinOffset && t.pin) { 4822 var prop = t.vars.horizontal ? "offsetWidth" : "offsetHeight", original = t.pin[prop]; 4823 t.revert(true, 1); 4824 t.adjustPinSpacing(t.pin[prop] - original); 4825 t.refresh(); 4826 } 4827 }); 4828 _clampingMax = 1; 4829 _hideAllMarkers(true); 4830 _triggers.forEach(function(t) { 4831 var max = _maxScroll$1(t.scroller, t._dir), endClamp = t.vars.end === "max" || t._endClamp && t.end > max, startClamp = t._startClamp && t.start >= max; 4832 (endClamp || startClamp) && t.setPositions(startClamp ? max - 1 : t.start, endClamp ? Math.max(startClamp ? max : t.start + 1, max) : t.end, true); 4833 }); 4834 _hideAllMarkers(false); 4835 _clampingMax = 0; 4836 refreshInits.forEach(function(result) { 4837 return result && result.render && result.render(-1); 4838 }); 4839 _scrollers.forEach(function(obj) { 4840 if (_isFunction2(obj)) { 4841 obj.smooth && requestAnimationFrame(function() { 4842 return obj.target.style.scrollBehavior = "smooth"; 4843 }); 4844 obj.rec && obj(obj.rec); 4845 } 4846 }); 4847 _clearScrollMemory(_scrollRestoration, 1); 4848 _resizeDelay.pause(); 4849 _refreshID++; 4850 _refreshingAll = 2; 4851 _updateAll(2); 4852 _triggers.forEach(function(t) { 4853 return _isFunction2(t.vars.onRefresh) && t.vars.onRefresh(t); 4854 }); 4855 _refreshingAll = ScrollTrigger$1.isRefreshing = false; 4856 _dispatch2("refresh"); 4857}, _lastScroll = 0, _direction = 1, _primary, _updateAll = function _updateAll2(force) { 4858 if (force === 2 || !_refreshingAll && !_isReverted) { 4859 ScrollTrigger$1.isUpdating = true; 4860 _primary && _primary.update(0); 4861 var l = _triggers.length, time = _getTime(), recordVelocity = time - _time1 >= 50, scroll = l && _triggers[0].scroll(); 4862 _direction = _lastScroll > scroll ? -1 : 1; 4863 _refreshingAll || (_lastScroll = scroll); 4864 if (recordVelocity) { 4865 if (_lastScrollTime && !_pointerIsDown && time - _lastScrollTime > 200) { 4866 _lastScrollTime = 0; 4867 _dispatch2("scrollEnd"); 4868 } 4869 _time2 = _time1; 4870 _time1 = time; 4871 } 4872 if (_direction < 0) { 4873 _i = l; 4874 while (_i-- > 0) { 4875 _triggers[_i] && _triggers[_i].update(0, recordVelocity); 4876 } 4877 _direction = 1; 4878 } else { 4879 for (_i = 0; _i < l; _i++) { 4880 _triggers[_i] && _triggers[_i].update(0, recordVelocity); 4881 } 4882 } 4883 ScrollTrigger$1.isUpdating = false; 4884 } 4885 _rafID = 0; 4886}, _propNamesToCopy = [_left, _top, _bottom, _right, _margin + _Bottom, _margin + _Right, _margin + _Top, _margin + _Left, "display", "flexShrink", "float", "zIndex", "gridColumnStart", "gridColumnEnd", "gridRowStart", "gridRowEnd", "gridArea", "justifySelf", "alignSelf", "placeSelf", "order"], _stateProps = _propNamesToCopy.concat([_width, _height, "boxSizing", "max" + _Width, "max" + _Height, "position", _margin, _padding, _padding + _Top, _padding + _Right, _padding + _Bottom, _padding + _Left]), _swapPinOut = function _swapPinOut2(pin, spacer, state) { 4887 _setState(state); 4888 var cache = pin._gsap; 4889 if (cache.spacerIsNative) { 4890 _setState(cache.spacerState); 4891 } else if (pin._gsap.swappedIn) { 4892 var parent = spacer.parentNode; 4893 if (parent) { 4894 parent.insertBefore(pin, spacer); 4895 parent.removeChild(spacer); 4896 } 4897 } 4898 pin._gsap.swappedIn = false; 4899}, _swapPinIn = function _swapPinIn2(pin, spacer, cs, spacerState) { 4900 if (!pin._gsap.swappedIn) { 4901 var i = _propNamesToCopy.length, spacerStyle = spacer.style, pinStyle = pin.style, p; 4902 while (i--) { 4903 p = _propNamesToCopy[i]; 4904 spacerStyle[p] = cs[p]; 4905 } 4906 spacerStyle.position = cs.position === "absolute" ? "absolute" : "relative"; 4907 cs.display === "inline" && (spacerStyle.display = "inline-block"); 4908 pinStyle[_bottom] = pinStyle[_right] = "auto"; 4909 spacerStyle.flexBasis = cs.flexBasis || "auto"; 4910 spacerStyle.overflow = "visible"; 4911 spacerStyle.boxSizing = "border-box"; 4912 spacerStyle[_width] = _getSize(pin, _horizontal) + _px; 4913 spacerStyle[_height] = _getSize(pin, _vertical) + _px; 4914 spacerStyle[_padding] = pinStyle[_margin] = pinStyle[_top] = pinStyle[_left] = "0"; 4915 _setState(spacerState); 4916 pinStyle[_width] = pinStyle["max" + _Width] = cs[_width]; 4917 pinStyle[_height] = pinStyle["max" + _Height] = cs[_height]; 4918 pinStyle[_padding] = cs[_padding]; 4919 if (pin.parentNode !== spacer) { 4920 pin.parentNode.insertBefore(spacer, pin); 4921 spacer.appendChild(pin); 4922 } 4923 pin._gsap.swappedIn = true; 4924 } 4925}, _capsExp = /([A-Z])/g, _setState = function _setState2(state) { 4926 if (state) { 4927 var style = state.t.style, l = state.length, i = 0, p, value; 4928 (state.t._gsap || gsap$1.core.getCache(state.t)).uncache = 1; 4929 for (; i < l; i += 2) { 4930 value = state[i + 1]; 4931 p = state[i]; 4932 if (value) { 4933 style[p] = value; 4934 } else if (style[p]) { 4935 style.removeProperty(p.replace(_capsExp, "-$1").toLowerCase()); 4936 } 4937 } 4938 } 4939}, _getState = function _getState2(element) { 4940 var l = _stateProps.length, style = element.style, state = [], i = 0; 4941 for (; i < l; i++) { 4942 state.push(_stateProps[i], style[_stateProps[i]]); 4943 } 4944 state.t = element; 4945 return state; 4946}
vendor: 4,586 bytes, lines 4946-5042
4946, _copyState = function _copyState2(state, override, omitOffsets) { 4947 var result = [], l = state.length, i = omitOffsets ? 8 : 0, p; 4948 for (; i < l; i += 2) { 4949 p = state[i]; 4950 result.push(p, p in override ? override[p] : state[i + 1]); 4951 } 4952 result.t = state.t; 4953 return result; 4954}, _winOffsets = { 4955 left: 0, 4956 top: 0 4957}, _parsePosition2 = function _parsePosition3(value, trigger, scrollerSize, direction, scroll, marker, markerScroller, self, scrollerBounds, borderWidth, useFixedPosition, scrollerMax, containerAnimation, clampZeroProp) { 4958 _isFunction2(value) && (value = value(self)); 4959 if (_isString2(value) && value.substr(0, 3) === "max") { 4960 value = scrollerMax + (value.charAt(4) === "=" ? _offsetToPx("0" + value.substr(3), scrollerSize) : 0); 4961 } 4962 var time = containerAnimation ? containerAnimation.time() : 0, p1, p2, element; 4963 containerAnimation && containerAnimation.seek(0); 4964 isNaN(value) || (value = +value); 4965 if (!_isNumber2(value)) { 4966 _isFunction2(trigger) && (trigger = trigger(self)); 4967 var offsets = (value || "0").split(" "), bounds, localOffset, globalOffset, display; 4968 element = _getTarget(trigger, self) || _body$1; 4969 bounds = _getBounds(element) || {}; 4970 if ((!bounds || !bounds.left && !bounds.top) && _getComputedStyle(element).display === "none") { 4971 display = element.style.display; 4972 element.style.display = "block"; 4973 bounds = _getBounds(element); 4974 display ? element.style.display = display : element.style.removeProperty("display"); 4975 } 4976 localOffset = _offsetToPx(offsets[0], bounds[direction.d]); 4977 globalOffset = _offsetToPx(offsets[1] || "0", scrollerSize); 4978 value = bounds[direction.p] - scrollerBounds[direction.p] - borderWidth + localOffset + scroll - globalOffset; 4979 markerScroller && _positionMarker(markerScroller, globalOffset, direction, scrollerSize - globalOffset < 20 || markerScroller._isStart && globalOffset > 20); 4980 scrollerSize -= scrollerSize - globalOffset; 4981 } else { 4982 containerAnimation && (value = gsap$1.utils.mapRange(containerAnimation.scrollTrigger.start, containerAnimation.scrollTrigger.end, 0, scrollerMax, value)); 4983 markerScroller && _positionMarker(markerScroller, scrollerSize, direction, true); 4984 } 4985 if (clampZeroProp) { 4986 self[clampZeroProp] = value || -1e-3; 4987 value < 0 && (value = 0); 4988 } 4989 if (marker) { 4990 var position = value + scrollerSize, isStart = marker._isStart; 4991 p1 = "scroll" + direction.d2; 4992 _positionMarker(marker, position, direction, isStart && position > 20 || !isStart && (useFixedPosition ? Math.max(_body$1[p1], _docEl$1[p1]) : marker.parentNode[p1]) <= position + 1); 4993 if (useFixedPosition) { 4994 scrollerBounds = _getBounds(markerScroller); 4995 useFixedPosition && (marker.style[direction.op.p] = scrollerBounds[direction.op.p] - direction.op.m - marker._offset + _px); 4996 } 4997 } 4998 if (containerAnimation && element) { 4999 p1 = _getBounds(element); 5000 containerAnimation.seek(scrollerMax); 5001 p2 = _getBounds(element); 5002 containerAnimation._caScrollDist = p1[direction.p] - p2[direction.p]; 5003 value = value / containerAnimation._caScrollDist * scrollerMax; 5004 } 5005 containerAnimation && containerAnimation.seek(time); 5006 return containerAnimation ? value : Math.round(value); 5007}, _prefixExp = /(webkit|moz|length|cssText|inset)/i, _reparent = function _reparent2(element, parent, top, left) { 5008 if (element.parentNode !== parent) { 5009 var style = element.style, p, cs; 5010 if (parent === _body$1) { 5011 element._stOrig = style.cssText; 5012 cs = _getComputedStyle(element); 5013 for (p in cs) { 5014 if (!+p && !_prefixExp.test(p) && cs[p] && typeof style[p] === "string" && p !== "0") { 5015 style[p] = cs[p]; 5016 } 5017 } 5018 style.top = top; 5019 style.left = left; 5020 } else { 5021 style.cssText = element._stOrig; 5022 } 5023 gsap$1.core.getCache(element).uncache = 1; 5024 parent.appendChild(element); 5025 } 5026}, _interruptionTracker = function _interruptionTracker2(getValueFunc, initialValue, onInterrupt) { 5027 var last1 = initialValue, last2 = last1; 5028 return function(value) { 5029 var current = Math.round(getValueFunc()); 5030 if (current !== last1 && current !== last2 && Math.abs(current - last1) > 3 && Math.abs(current - last2) > 3) { 5031 value = current; 5032 onInterrupt && onInterrupt(); 5033 } 5034 last2 = last1; 5035 last1 = value; 5036 return value; 5037 }; 5038}, _shiftMarker = function _shiftMarker2(marker, direction, value) { 5039 var vars = {}; 5040 vars[direction.p] = "+=" + value; 5041 gsap$1.set(marker, vars); 5042}, _getTweenCreator = function _getTweenCreator2(scroller, direction) {
vendor: 4,302 bytes, lines 5043-5098
5043 var getScroll = _getScrollFunc(scroller, direction), prop = "_scroll" + direction.p2, getTween = function getTween2(scrollTo, vars, initialValue, change1, change2) { 5044 var tween = getTween2.tween, onComplete = vars.onComplete, modifiers = {}; 5045 initialValue = initialValue || getScroll(); 5046 var checkForInterruption = _interruptionTracker(getScroll, initialValue, function() { 5047 tween.kill(); 5048 getTween2.tween = 0; 5049 }); 5050 change2 = change1 && change2 || 0; 5051 change1 = change1 || scrollTo - initialValue; 5052 tween && tween.kill(); 5053 vars[prop] = scrollTo; 5054 vars.inherit = false; 5055 vars.modifiers = modifiers; 5056 modifiers[prop] = function() { 5057 return checkForInterruption(initialValue + change1 * tween.ratio + change2 * tween.ratio * tween.ratio); 5058 }; 5059 vars.onUpdate = function() { 5060 _scrollers.cache++; 5061 getTween2.tween && _updateAll(); 5062 }; 5063 vars.onComplete = function() { 5064 getTween2.tween = 0; 5065 onComplete && onComplete.call(tween); 5066 }; 5067 tween = getTween2.tween = gsap$1.to(scroller, vars); 5068 return tween; 5069 }; 5070 scroller[prop] = getScroll; 5071 getScroll.wheelHandler = function() { 5072 return getTween.tween && getTween.tween.kill() && (getTween.tween = 0); 5073 }; 5074 _addListener2(scroller, "wheel", getScroll.wheelHandler); 5075 ScrollTrigger$1.isTouch && _addListener2(scroller, "touchmove", getScroll.wheelHandler); 5076 return getTween; 5077}; 5078var ScrollTrigger$1 = /* @__PURE__ */ function() { 5079 function ScrollTrigger2(vars, animation) { 5080 _coreInitted$1 || ScrollTrigger2.register(gsap$1) || console.warn("Please gsap.registerPlugin(ScrollTrigger)"); 5081 _context$1(this); 5082 this.init(vars, animation); 5083 } 5084 var _proto = ScrollTrigger2.prototype; 5085 _proto.init = function init4(vars, animation) { 5086 this.progress = this.start = 0; 5087 this.vars && this.kill(true, true); 5088 if (!_enabled) { 5089 this.update = this.refresh = this.kill = _passThrough2; 5090 return; 5091 } 5092 vars = _setDefaults2(_isString2(vars) || _isNumber2(vars) || vars.nodeType ? { 5093 trigger: vars 5094 } : vars, _defaults); 5095 var _vars = vars, onUpdate = _vars.onUpdate, toggleClass = _vars.toggleClass, id = _vars.id, onToggle = _vars.onToggle, onRefresh = _vars.onRefresh, scrub = _vars.scrub, trigger = _vars.trigger, pin = _vars.pin, pinSpacing = _vars.pinSpacing, invalidateOnRefresh = _vars.invalidateOnRefresh, anticipatePin = _vars.anticipatePin, onScrubComplete = _vars.onScrubComplete, onSnapComplete = _vars.onSnapComplete, once = _vars.once, snap3 = _vars.snap, pinReparent = _vars.pinReparent, pinSpacer = _vars.pinSpacer, containerAnimation = _vars.containerAnimation, fastScrollEnd = _vars.fastScrollEnd, preventOverlaps = _vars.preventOverlaps, direction = vars.horizontal || vars.containerAnimation && vars.horizontal !== false ? _horizontal : _vertical, isToggle = !scrub && scrub !== 0, scroller = _getTarget(vars.scroller || _win$1), scrollerCache = gsap$1.core.getCache(scroller), isViewport = _isViewport2(scroller), useFixedPosition = ("pinType" in vars ? vars.pinType : _getProxyProp(scroller, "pinType") || isViewport && "fixed") === "fixed", callbacks = [vars.onEnter, vars.onLeave, vars.onEnterBack, vars.onLeaveBack], toggleActions = isToggle && vars.toggleActions.split(" "), markers = "markers" in vars ? vars.markers : _defaults.markers, borderWidth = isViewport ? 0 : parseFloat(_getComputedStyle(scroller)["border" + direction.p2 + _Width]) || 0, self = this, onRefreshInit = vars.onRefreshInit && function() { 5096 return vars.onRefreshInit(self); 5097 }, getScrollerSize = _getSizeFunc(scroller, isViewport, direction), getScrollerOffsets = _getOffsetsFunc(scroller, isViewport), lastSnap = 0, lastRefresh = 0, prevProgress = 0, scrollFunc = _getScrollFunc(scroller, direction), tweenTo, pinCache, snapFunc, scroll1, scroll2, start, end, markerStart, markerEnd, markerStartTrigger, markerEndTrigger, markerVars, executingOnRefresh, change, pinOriginalState, pinActiveState, pinState, spacer, offset, pinGetter, pinSetter, pinStart, pinChange, spacingStart, spacerState, markerStartSetter, pinMoves, markerEndSetter, cs, snap1, snap22, scrubTween, scrubSmooth, snapDurClamp, snapDelayedCall, prevScroll, prevAnimProgress, caMarkerSetter, customRevertReturn; 5098 self._startClamp = self._endClamp = false;
vendor: 4,358 bytes, lines 5099-5180
5099 self._dir = direction; 5100 anticipatePin *= 45; 5101 self.scroller = scroller; 5102 self.scroll = containerAnimation ? containerAnimation.time.bind(containerAnimation) : scrollFunc; 5103 scroll1 = scrollFunc(); 5104 self.vars = vars; 5105 animation = animation || vars.animation; 5106 if ("refreshPriority" in vars) { 5107 _sort = 1; 5108 vars.refreshPriority === -9999 && (_primary = self); 5109 } 5110 scrollerCache.tweenScroll = scrollerCache.tweenScroll || { 5111 top: _getTweenCreator(scroller, _vertical), 5112 left: _getTweenCreator(scroller, _horizontal) 5113 }; 5114 self.tweenTo = tweenTo = scrollerCache.tweenScroll[direction.p]; 5115 self.scrubDuration = function(value) { 5116 scrubSmooth = _isNumber2(value) && value; 5117 if (!scrubSmooth) { 5118 scrubTween && scrubTween.progress(1).kill(); 5119 scrubTween = 0; 5120 } else { 5121 scrubTween ? scrubTween.duration(value) : scrubTween = gsap$1.to(animation, { 5122 ease: "expo", 5123 totalProgress: "+=0", 5124 inherit: false, 5125 duration: scrubSmooth, 5126 paused: true, 5127 onComplete: function onComplete() { 5128 return onScrubComplete && onScrubComplete(self); 5129 } 5130 }); 5131 } 5132 }; 5133 if (animation) { 5134 animation.vars.lazy = false; 5135 animation._initted && !self.isReverted || animation.vars.immediateRender !== false && vars.immediateRender !== false && animation.duration() && animation.render(0, true, true); 5136 self.animation = animation.pause(); 5137 animation.scrollTrigger = self; 5138 self.scrubDuration(scrub); 5139 snap1 = 0; 5140 id || (id = animation.vars.id); 5141 } 5142 if (snap3) { 5143 if (!_isObject2(snap3) || snap3.push) { 5144 snap3 = { 5145 snapTo: snap3 5146 }; 5147 } 5148 "scrollBehavior" in _body$1.style && gsap$1.set(isViewport ? [_body$1, _docEl$1] : scroller, { 5149 scrollBehavior: "auto" 5150 }); 5151 _scrollers.forEach(function(o) { 5152 return _isFunction2(o) && o.target === (isViewport ? _doc$1.scrollingElement || _docEl$1 : scroller) && (o.smooth = false); 5153 }); 5154 snapFunc = _isFunction2(snap3.snapTo) ? snap3.snapTo : snap3.snapTo === "labels" ? _getClosestLabel(animation) : snap3.snapTo === "labelsDirectional" ? _getLabelAtDirection(animation) : snap3.directional !== false ? function(value, st) { 5155 return _snapDirectional(snap3.snapTo)(value, _getTime() - lastRefresh < 500 ? 0 : st.direction); 5156 } : gsap$1.utils.snap(snap3.snapTo); 5157 snapDurClamp = snap3.duration || { 5158 min: 0.1, 5159 max: 2 5160 }; 5161 snapDurClamp = _isObject2(snapDurClamp) ? _clamp$1(snapDurClamp.min, snapDurClamp.max) : _clamp$1(snapDurClamp, snapDurClamp); 5162 snapDelayedCall = gsap$1.delayedCall(snap3.delay || scrubSmooth / 2 || 0.1, function() { 5163 var scroll = scrollFunc(), refreshedRecently = _getTime() - lastRefresh < 500, tween = tweenTo.tween; 5164 if ((refreshedRecently || Math.abs(self.getVelocity()) < 10) && !tween && !_pointerIsDown && lastSnap !== scroll) { 5165 var progress = (scroll - start) / change, totalProgress = animation && !isToggle ? animation.totalProgress() : progress, velocity = refreshedRecently ? 0 : (totalProgress - snap22) / (_getTime() - _time2) * 1e3 || 0, change1 = gsap$1.utils.clamp(-progress, 1 - progress, _abs(velocity / 2) * velocity / 0.185), naturalEnd = progress + (snap3.inertia === false ? 0 : change1), endValue, endScroll, _snap = snap3, onStart = _snap.onStart, _onInterrupt = _snap.onInterrupt, _onComplete = _snap.onComplete; 5166 endValue = snapFunc(naturalEnd, self); 5167 _isNumber2(endValue) || (endValue = naturalEnd); 5168 endScroll = Math.round(start + endValue * change); 5169 if (scroll <= end && scroll >= start && endScroll !== scroll) { 5170 if (tween && !tween._initted && tween.data <= _abs(endScroll - scroll)) { 5171 return; 5172 } 5173 if (snap3.inertia === false) { 5174 change1 = endValue - progress; 5175 } 5176 tweenTo(endScroll, { 5177 duration: snapDurClamp(_abs(Math.max(_abs(naturalEnd - totalProgress), _abs(endValue - totalProgress)) * 0.185 / velocity / 0.05 || 0)), 5178 ease: snap3.ease || "power3", 5179 data: _abs(endScroll - scroll), 5180 // record the distance so that if another snap tween occurs (conflict) we
vendor: 9,547 bytes, lines 5180-5361
5180can prioritize the closest snap. 5181 onInterrupt: function onInterrupt() { 5182 return snapDelayedCall.restart(true) && _onInterrupt && _onInterrupt(self); 5183 }, 5184 onComplete: function onComplete() { 5185 self.update(); 5186 lastSnap = scrollFunc(); 5187 if (animation) { 5188 scrubTween ? scrubTween.resetTo("totalProgress", endValue, animation._tTime / animation._tDur) : animation.progress(endValue); 5189 } 5190 snap1 = snap22 = animation && !isToggle ? animation.totalProgress() : self.progress; 5191 onSnapComplete && onSnapComplete(self); 5192 _onComplete && _onComplete(self); 5193 } 5194 }, scroll, change1 * change, endScroll - scroll - change1 * change); 5195 onStart && onStart(self, tweenTo.tween); 5196 } 5197 } else if (self.isActive && lastSnap !== scroll) { 5198 snapDelayedCall.restart(true); 5199 } 5200 }).pause(); 5201 } 5202 id && (_ids[id] = self); 5203 trigger = self.trigger = _getTarget(trigger || pin !== true && pin); 5204 customRevertReturn = trigger && trigger._gsap && trigger._gsap.stRevert; 5205 customRevertReturn && (customRevertReturn = customRevertReturn(self)); 5206 pin = pin === true ? trigger : _getTarget(pin); 5207 _isString2(toggleClass) && (toggleClass = { 5208 targets: trigger, 5209 className: toggleClass 5210 }); 5211 if (pin) { 5212 pinSpacing === false || pinSpacing === _margin || (pinSpacing = !pinSpacing && pin.parentNode && pin.parentNode.style && _getComputedStyle(pin.parentNode).display === "flex" ? false : _padding); 5213 self.pin = pin; 5214 pinCache = gsap$1.core.getCache(pin); 5215 if (!pinCache.spacer) { 5216 if (pinSpacer) { 5217 pinSpacer = _getTarget(pinSpacer); 5218 pinSpacer && !pinSpacer.nodeType && (pinSpacer = pinSpacer.current || pinSpacer.nativeElement); 5219 pinCache.spacerIsNative = !!pinSpacer; 5220 pinSpacer && (pinCache.spacerState = _getState(pinSpacer)); 5221 } 5222 pinCache.spacer = spacer = pinSpacer || _doc$1.createElement("div"); 5223 spacer.classList.add("pin-spacer"); 5224 id && spacer.classList.add("pin-spacer-" + id); 5225 pinCache.pinState = pinOriginalState = _getState(pin); 5226 } else { 5227 pinOriginalState = pinCache.pinState; 5228 } 5229 vars.force3D !== false && gsap$1.set(pin, { 5230 force3D: true 5231 }); 5232 self.spacer = spacer = pinCache.spacer; 5233 cs = _getComputedStyle(pin); 5234 spacingStart = cs[pinSpacing + direction.os2]; 5235 pinGetter = gsap$1.getProperty(pin); 5236 pinSetter = gsap$1.quickSetter(pin, direction.a, _px); 5237 _swapPinIn(pin, spacer, cs); 5238 pinState = _getState(pin); 5239 } 5240 if (markers) { 5241 markerVars = _isObject2(markers) ? _setDefaults2(markers, _markerDefaults) : _markerDefaults; 5242 markerStartTrigger = _createMarker("scroller-start", id, scroller, direction, markerVars, 0); 5243 markerEndTrigger = _createMarker("scroller-end", id, scroller, direction, markerVars, 0, markerStartTrigger); 5244 offset = markerStartTrigger["offset" + direction.op.d2]; 5245 var content = _getTarget(_getProxyProp(scroller, "content") || scroller); 5246 markerStart = this.markerStart = _createMarker("start", id, content, direction, markerVars, offset, 0, containerAnimation); 5247 markerEnd = this.markerEnd = _createMarker("end", id, content, direction, markerVars, offset, 0, containerAnimation); 5248 containerAnimation && (caMarkerSetter = gsap$1.quickSetter([markerStart, markerEnd], direction.a, _px)); 5249 if (!useFixedPosition && !(_proxies.length && _getProxyProp(scroller, "fixedMarkers") === true)) { 5250 _makePositionable(isViewport ? _body$1 : scroller); 5251 gsap$1.set([markerStartTrigger, markerEndTrigger], { 5252 force3D: true 5253 }); 5254 markerStartSetter = gsap$1.quickSetter(markerStartTrigger, direction.a, _px); 5255 markerEndSetter = gsap$1.quickSetter(markerEndTrigger, direction.a, _px); 5256 } 5257 } 5258 if (containerAnimation) { 5259 var oldOnUpdate = containerAnimation.vars.onUpdate, oldParams = containerAnimation.vars.onUpdateParams; 5260 containerAnimation.eventCallback("onUpdate", function() { 5261 self.update(0, 0, 1); 5262 oldOnUpdate && oldOnUpdate.apply(containerAnimation, oldParams || []); 5263 }); 5264 } 5265 self.previous = function() { 5266 return _triggers[_triggers.indexOf(self) - 1]; 5267 }; 5268 self.next = function() { 5269 return _triggers[_triggers.indexOf(self) + 1]; 5270 }; 5271 self.revert = function(revert, temp) { 5272 if (!temp) { 5273 return self.kill(true); 5274 } 5275 var r = revert !== false || !self.enabled, prevRefreshing = _refreshing; 5276 if (r !== self.isReverted) { 5277 if (r) { 5278 prevScroll = Math.max(scrollFunc(), self.scroll.rec || 0); 5279 prevProgress = self.progress; 5280 prevAnimProgress = animation && animation.progress(); 5281 } 5282 markerStart && [markerStart, markerEnd, markerStartTrigger, markerEndTrigger].forEach(function(m) { 5283 return m.style.display = r ? "none" : "block"; 5284 }); 5285 if (r) { 5286 _refreshing = self; 5287 self.update(r); 5288 } 5289 if (pin && (!pinReparent || !self.isActive)) { 5290 if (r) { 5291 _swapPinOut(pin, spacer, pinOriginalState); 5292 } else { 5293 _swapPinIn(pin, spacer, _getComputedStyle(pin), spacerState); 5294 } 5295 } 5296 r || self.update(r); 5297 _refreshing = prevRefreshing; 5298 self.isReverted = r; 5299 } 5300 }; 5301 self.refresh = function(soft, force, position, pinOffset) { 5302 if ((_refreshing || !self.enabled) && !force) { 5303 return; 5304 } 5305 if (pin && soft && _lastScrollTime) { 5306 _addListener2(ScrollTrigger2, "scrollEnd", _softRefresh); 5307 return; 5308 } 5309 !_refreshingAll && onRefreshInit && onRefreshInit(self); 5310 _refreshing = self; 5311 if (tweenTo.tween && !position) { 5312 tweenTo.tween.kill(); 5313 tweenTo.tween = 0; 5314 } 5315 scrubTween && scrubTween.pause(); 5316 invalidateOnRefresh && animation && animation.revert({ 5317 kill: false 5318 }).invalidate(); 5319 self.isReverted || self.revert(true, true); 5320 self._subPinOffset = false; 5321 var size2 = getScrollerSize(), scrollerBounds = getScrollerOffsets(), max = containerAnimation ? containerAnimation.duration() : _maxScroll$1(scroller, direction), isFirstRefresh = change <= 0.01, offset2 = 0, otherPinOffset = pinOffset || 0, parsedEnd = _isObject2(position) ? position.end : vars.end, parsedEndTrigger = vars.endTrigger || trigger, parsedStart = _isObject2(position) ? position.start : vars.start || (vars.start === 0 || !trigger ? 0 : pin ? "0 0" : "0 100%"), pinnedContainer = self.pinnedContainer = vars.pinnedContainer && _getTarget(vars.pinnedContainer, self), triggerIndex = trigger && Math.max(0, _triggers.indexOf(self)) || 0, i = triggerIndex, cs2, bounds, scroll, isVertical, override, curTrigger, curPin, oppositeScroll, initted, revertedPins, forcedOverflow, markerStartOffset, markerEndOffset; 5322 if (markers && _isObject2(position)) { 5323 markerStartOffset = gsap$1.getProperty(markerStartTrigger, direction.p); 5324 markerEndOffset = gsap$1.getProperty(markerEndTrigger, direction.p); 5325 } 5326 while (i--) { 5327 curTrigger = _triggers[i]; 5328 curTrigger.end || curTrigger.refresh(0, 1) || (_refreshing = self); 5329 curPin = curTrigger.pin; 5330 if (curPin && (curPin === trigger || curPin === pin || curPin === pinnedContainer) && !curTrigger.isReverted) { 5331 revertedPins || (revertedPins = []); 5332 revertedPins.unshift(curTrigger); 5333 curTrigger.revert(true, true); 5334 } 5335 if (curTrigger !== _triggers[i]) { 5336 triggerIndex--; 5337 i--; 5338 } 5339 } 5340 _isFunction2(parsedStart) && (parsedStart = parsedStart(self)); 5341 parsedStart = _parseClamp(parsedStart, "start", self); 5342 start = _parsePosition2(parsedStart, trigger, size2, direction, scrollFunc(), markerStart, markerStartTrigger, self, scrollerBounds, borderWidth, useFixedPosition, max, containerAnimation, self._startClamp && "_startClamp") || (pin ? -1e-3 : 0); 5343 _isFunction2(parsedEnd) && (parsedEnd = parsedEnd(self)); 5344 if (_isString2(parsedEnd) && !parsedEnd.indexOf("+=")) { 5345 if (~parsedEnd.indexOf(" ")) { 5346 parsedEnd = (_isString2(parsedStart) ? parsedStart.split(" ")[0] : "") + parsedEnd; 5347 } else { 5348 offset2 = _offsetToPx(parsedEnd.substr(2), size2); 5349 parsedEnd = _isString2(parsedStart) ? parsedStart : (containerAnimation ? gsap$1.utils.mapRange(0, containerAnimation.duration(), containerAnimation.scrollTrigger.start, containerAnimation.scrollTrigger.end, start) : start) + offset2; 5350 parsedEndTrigger = trigger; 5351 } 5352 } 5353 parsedEnd = _parseClamp(parsedEnd, "end", self); 5354 end = Math.max(start, _parsePosition2(parsedEnd || (parsedEndTrigger ? "100% 0" : max), parsedEndTrigger, size2, direction, scrollFunc() + offset2, markerEnd, markerEndTrigger, self, scrollerBounds, borderWidth, useFixedPosition, max, containerAnimation, self._endClamp && "_endClamp")) || -1e-3; 5355 offset2 = 0; 5356 i = triggerIndex; 5357 while (i--) { 5358 curTrigger = _triggers[i]; 5359 curPin = curTrigger.pin; 5360 if (curPin && curTrigger.start - curTrigger._pinPush <= start && !containerAnimation && curTrigger.end > 0) { 5361 cs2 = curTrigger.end - (self._startClamp ? Math.max(0, curTr
vendor: 15,324 bytes, lines 5361-5665
5361igger.start) : curTrigger.start); 5362 if ((curPin === trigger && curTrigger.start - curTrigger._pinPush < start || curPin === pinnedContainer) && isNaN(parsedStart)) { 5363 offset2 += cs2 * (1 - curTrigger.progress); 5364 } 5365 curPin === pin && (otherPinOffset += cs2); 5366 } 5367 } 5368 start += offset2; 5369 end += offset2; 5370 self._startClamp && (self._startClamp += offset2); 5371 if (self._endClamp && !_refreshingAll) { 5372 self._endClamp = end || -1e-3; 5373 end = Math.min(end, _maxScroll$1(scroller, direction)); 5374 } 5375 change = end - start || (start -= 0.01) && 1e-3; 5376 if (isFirstRefresh) { 5377 prevProgress = gsap$1.utils.clamp(0, 1, gsap$1.utils.normalize(start, end, prevScroll)); 5378 } 5379 self._pinPush = otherPinOffset; 5380 if (markerStart && offset2) { 5381 cs2 = {}; 5382 cs2[direction.a] = "+=" + offset2; 5383 pinnedContainer && (cs2[direction.p] = "-=" + scrollFunc()); 5384 gsap$1.set([markerStart, markerEnd], cs2); 5385 } 5386 if (pin && !(_clampingMax && self.end >= _maxScroll$1(scroller, direction))) { 5387 cs2 = _getComputedStyle(pin); 5388 isVertical = direction === _vertical; 5389 scroll = scrollFunc(); 5390 pinStart = parseFloat(pinGetter(direction.a)) + otherPinOffset; 5391 if (!max && end > 1) { 5392 forcedOverflow = (isViewport ? _doc$1.scrollingElement || _docEl$1 : scroller).style; 5393 forcedOverflow = { 5394 style: forcedOverflow, 5395 value: forcedOverflow["overflow" + direction.a.toUpperCase()] 5396 }; 5397 if (isViewport && _getComputedStyle(_body$1)["overflow" + direction.a.toUpperCase()] !== "scroll") { 5398 forcedOverflow.style["overflow" + direction.a.toUpperCase()] = "scroll"; 5399 } 5400 } 5401 _swapPinIn(pin, spacer, cs2); 5402 pinState = _getState(pin); 5403 bounds = _getBounds(pin, true); 5404 oppositeScroll = useFixedPosition && _getScrollFunc(scroller, isVertical ? _horizontal : _vertical)(); 5405 if (pinSpacing) { 5406 spacerState = [pinSpacing + direction.os2, change + otherPinOffset + _px]; 5407 spacerState.t = spacer; 5408 i = pinSpacing === _padding ? _getSize(pin, direction) + change + otherPinOffset : 0; 5409 if (i) { 5410 spacerState.push(direction.d, i + _px); 5411 spacer.style.flexBasis !== "auto" && (spacer.style.flexBasis = i + _px); 5412 } 5413 _setState(spacerState); 5414 if (pinnedContainer) { 5415 _triggers.forEach(function(t) { 5416 if (t.pin === pinnedContainer && t.vars.pinSpacing !== false) { 5417 t._subPinOffset = true; 5418 } 5419 }); 5420 } 5421 useFixedPosition && scrollFunc(prevScroll); 5422 } else { 5423 i = _getSize(pin, direction); 5424 i && spacer.style.flexBasis !== "auto" && (spacer.style.flexBasis = i + _px); 5425 } 5426 if (useFixedPosition) { 5427 override = { 5428 top: bounds.top + (isVertical ? scroll - start : oppositeScroll) + _px, 5429 left: bounds.left + (isVertical ? oppositeScroll : scroll - start) + _px, 5430 boxSizing: "border-box", 5431 position: "fixed" 5432 }; 5433 override[_width] = override["max" + _Width] = Math.ceil(bounds.width) + _px; 5434 override[_height] = override["max" + _Height] = Math.ceil(bounds.height) + _px; 5435 override[_margin] = override[_margin + _Top] = override[_margin + _Right] = override[_margin + _Bottom] = override[_margin + _Left] = "0"; 5436 override[_padding] = cs2[_padding]; 5437 override[_padding + _Top] = cs2[_padding + _Top]; 5438 override[_padding + _Right] = cs2[_padding + _Right]; 5439 override[_padding + _Bottom] = cs2[_padding + _Bottom]; 5440 override[_padding + _Left] = cs2[_padding + _Left]; 5441 pinActiveState = _copyState(pinOriginalState, override, pinReparent); 5442 _refreshingAll && scrollFunc(0); 5443 } 5444 if (animation) { 5445 initted = animation._initted; 5446 _suppressOverwrites(1); 5447 animation.render(animation.duration(), true, true); 5448 pinChange = pinGetter(direction.a) - pinStart + change + otherPinOffset; 5449 pinMoves = Math.abs(change - pinChange) > 1; 5450 useFixedPosition && pinMoves && pinActiveState.splice(pinActiveState.length - 2, 2); 5451 animation.render(0, true, true); 5452 initted || animation.invalidate(true); 5453 animation.parent || animation.totalTime(animation.totalTime()); 5454 _suppressOverwrites(0); 5455 } else { 5456 pinChange = change; 5457 } 5458 forcedOverflow && (forcedOverflow.value ? forcedOverflow.style["overflow" + direction.a.toUpperCase()] = forcedOverflow.value : forcedOverflow.style.removeProperty("overflow-" + direction.a)); 5459 } else if (trigger && scrollFunc() && !containerAnimation) { 5460 bounds = trigger.parentNode; 5461 while (bounds && bounds !== _body$1) { 5462 if (bounds._pinOffset) { 5463 start -= bounds._pinOffset; 5464 end -= bounds._pinOffset; 5465 } 5466 bounds = bounds.parentNode; 5467 } 5468 } 5469 revertedPins && revertedPins.forEach(function(t) { 5470 return t.revert(false, true); 5471 }); 5472 self.start = start; 5473 self.end = end; 5474 scroll1 = scroll2 = _refreshingAll ? prevScroll : scrollFunc(); 5475 if (!containerAnimation && !_refreshingAll) { 5476 scroll1 < prevScroll && scrollFunc(prevScroll); 5477 self.scroll.rec = 0; 5478 } 5479 self.revert(false, true); 5480 lastRefresh = _getTime(); 5481 if (snapDelayedCall) { 5482 lastSnap = -1; 5483 snapDelayedCall.restart(true); 5484 } 5485 _refreshing = 0; 5486 animation && isToggle && (animation._initted || prevAnimProgress) && animation.progress() !== prevAnimProgress && animation.progress(prevAnimProgress || 0, true).render(animation.time(), true, true); 5487 if (isFirstRefresh || prevProgress !== self.progress || containerAnimation || invalidateOnRefresh) { 5488 animation && !isToggle && animation.totalProgress(containerAnimation && start < -1e-3 && !prevProgress ? gsap$1.utils.normalize(start, end, 0) : prevProgress, true); 5489 self.progress = isFirstRefresh || (scroll1 - start) / change === prevProgress ? 0 : prevProgress; 5490 } 5491 pin && pinSpacing && (spacer._pinOffset = Math.round(self.progress * pinChange)); 5492 scrubTween && scrubTween.invalidate(); 5493 if (!isNaN(markerStartOffset)) { 5494 markerStartOffset -= gsap$1.getProperty(markerStartTrigger, direction.p); 5495 markerEndOffset -= gsap$1.getProperty(markerEndTrigger, direction.p); 5496 _shiftMarker(markerStartTrigger, direction, markerStartOffset); 5497 _shiftMarker(markerStart, direction, markerStartOffset - (pinOffset || 0)); 5498 _shiftMarker(markerEndTrigger, direction, markerEndOffset); 5499 _shiftMarker(markerEnd, direction, markerEndOffset - (pinOffset || 0)); 5500 } 5501 isFirstRefresh && !_refreshingAll && self.update(); 5502 if (onRefresh && !_refreshingAll && !executingOnRefresh) { 5503 executingOnRefresh = true; 5504 onRefresh(self); 5505 executingOnRefresh = false; 5506 } 5507 }; 5508 self.getVelocity = function() { 5509 return (scrollFunc() - scroll2) / (_getTime() - _time2) * 1e3 || 0; 5510 }; 5511 self.endAnimation = function() { 5512 _endAnimation(self.callbackAnimation); 5513 if (animation) { 5514 scrubTween ? scrubTween.progress(1) : !animation.paused() ? _endAnimation(animation, animation.reversed()) : isToggle || _endAnimation(animation, self.direction < 0, 1); 5515 } 5516 }; 5517 self.labelToScroll = function(label) { 5518 return animation && animation.labels && (start || self.refresh() || start) + animation.labels[label] / animation.duration() * change || 0; 5519 }; 5520 self.getTrailing = function(name) { 5521 var i = _triggers.indexOf(self), a = self.direction > 0 ? _triggers.slice(0, i).reverse() : _triggers.slice(i + 1); 5522 return (_isString2(name) ? a.filter(function(t) { 5523 return t.vars.preventOverlaps === name; 5524 }) : a).filter(function(t) { 5525 return self.direction > 0 ? t.end <= start : t.start >= end; 5526 }); 5527 }; 5528 self.update = function(reset, recordVelocity, forceFake) { 5529 if (containerAnimation && !forceFake && !reset) { 5530 return; 5531 } 5532 var scroll = _refreshingAll === true ? prevScroll : self.scroll(), p = reset ? 0 : (scroll - start) / change, clipped = p < 0 ? 0 : p > 1 ? 1 : p || 0, prevProgress2 = self.progress, isActive, wasActive, toggleState, action, stateChanged, toggled, isAtMax, isTakingAction; 5533 if (recordVelocity) { 5534 scroll2 = scroll1; 5535 scroll1 = containerAnimation ? scrollFunc() : scroll; 5536 if (snap3) { 5537 snap22 = snap1; 5538 snap1 = animation && !isToggle ? animation.totalProgress() : clipped; 5539 } 5540 } 5541 if (anticipatePin && pin && !_refreshing && !_startup && _lastScrollTime) { 5542 if (!clipped && start < scroll + (scroll - scroll2) / (_getTime() - _time2) * anticipatePin) { 5543 clipped = 1e-4; 5544 } else if (clipped === 1 && end > scroll + (scroll - scroll2) / (_getTime() - _time2) * anticipatePin) { 5545 clipped = 0.9999; 5546 } 5547 } 5548 if (clipped !== prevProgress2 && self.enabled) { 5549 isActive = self.isActive = !!clipped && clipped < 1; 5550 wasActive = !!prevProgress2 && prevProgress2 < 1; 5551 toggled = isActive !== wasActive; 5552 stateChanged = toggled || !!clipped !== !!prevProgress2; 5553 self.direction = clipped > prevProgress2 ? 1 : -1; 5554 self.progress = clipped; 5555 if (stateChanged && !_refreshing) { 5556 toggleState = clipped && !prevProgress2 ? 0 : clipped === 1 ? 1 : prevProgress2 === 1 ? 2 : 3; 5557 if (isToggle) { 5558 action = !toggled && toggleActions[toggleState + 1] !== "none" && toggleActions[toggleState + 1] || toggleActions[toggleState]; 5559 isTakingAction = animation && (action === "complete" || action === "reset" || action in animation); 5560 } 5561 } 5562 preventOverlaps && (toggled || isTakingAction) && (isTakingAction || scrub || !animation) && (_isFunction2(preventOverlaps) ? preventOverlaps(self) : self.getTrailing(preventOverlaps).forEach(function(t) { 5563 return t.endAnimation(); 5564 })); 5565 if (!isToggle) { 5566 if (scrubTween && !_refreshing && !_startup) { 5567 scrubTween._dp._time - scrubTween._start !== scrubTween._time && scrubTween.render(scrubTween._dp._time - scrubTween._start); 5568 if (scrubTween.resetTo) { 5569 scrubTween.resetTo("totalProgress", clipped, animation._tTime / animation._tDur); 5570 } else { 5571 scrubTween.vars.totalProgress = clipped; 5572 scrubTween.invalidate().restart(); 5573 } 5574 } else if (animation) { 5575 animation.totalProgress(clipped, !!(_refreshing && (lastRefresh || reset))); 5576 } 5577 } 5578 if (pin) { 5579 reset && pinSpacing && (spacer.style[pinSpacing + direction.os2] = spacingStart); 5580 if (!useFixedPosition) { 5581 pinSetter(_round$1(pinStart + pinChange * clipped)); 5582 } else if (stateChanged) { 5583 isAtMax = !reset && clipped > prevProgress2 && end + 1 > scroll && scroll + 1 >= _maxScroll$1(scroller, direction); 5584 if (pinReparent) { 5585 if (!reset && (isActive || isAtMax)) { 5586 var bounds = _getBounds(pin, true), _offset = scroll - start; 5587 _reparent(pin, _body$1, bounds.top + (direction === _vertical ? _offset : 0) + _px, bounds.left + (direction === _vertical ? 0 : _offset) + _px); 5588 } else { 5589 _reparent(pin, spacer); 5590 } 5591 } 5592 _setState(isActive || isAtMax ? pinActiveState : pinState); 5593 pinMoves && clipped < 1 && isActive || pinSetter(pinStart + (clipped === 1 && !isAtMax ? pinChange : 0)); 5594 } 5595 } 5596 snap3 && !tweenTo.tween && !_refreshing && !_startup && snapDelayedCall.restart(true); 5597 toggleClass && (toggled || once && clipped && (clipped < 1 || !_limitCallbacks)) && _toArray$1(toggleClass.targets).forEach(function(el) { 5598 return el.classList[isActive || once ? "add" : "remove"](toggleClass.className); 5599 }); 5600 onUpdate && !isToggle && !reset && onUpdate(self); 5601 if (stateChanged && !_refreshing) { 5602 if (isToggle) { 5603 if (isTakingAction) { 5604 if (action === "complete") { 5605 animation.pause().totalProgress(1); 5606 } else if (action === "reset") { 5607 animation.restart(true).pause(); 5608 } else if (action === "restart") { 5609 animation.restart(true); 5610 } else { 5611 animation[action](); 5612 } 5613 } 5614 onUpdate && onUpdate(self); 5615 } 5616 if (toggled || !_limitCallbacks) { 5617 onToggle && toggled && _callback2(self, onToggle); 5618 callbacks[toggleState] && _callback2(self, callbacks[toggleState]); 5619 once && (clipped === 1 ? self.kill(false, 1) : callbacks[toggleState] = 0); 5620 if (!toggled) { 5621 toggleState = clipped === 1 ? 1 : 3; 5622 callbacks[toggleState] && _callback2(self, callbacks[toggleState]); 5623 } 5624 } 5625 if (fastScrollEnd && !isActive && Math.abs(self.getVelocity()) > (_isNumber2(fastScrollEnd) ? fastScrollEnd : 2500)) { 5626 _endAnimation(self.callbackAnimation); 5627 scrubTween ? scrubTween.progress(1) : _endAnimation(animation, action === "reverse" ? 1 : !clipped, 1); 5628 } 5629 } else if (isToggle && onUpdate && !_refreshing) { 5630 onUpdate(self); 5631 } 5632 } 5633 if (markerEndSetter) { 5634 var n = containerAnimation ? scroll / containerAnimation.duration() * (containerAnimation._caScrollDist || 0) : scroll; 5635 markerStartSetter(n + (markerStartTrigger._isFlipped ? 1 : 0)); 5636 markerEndSetter(n); 5637 } 5638 caMarkerSetter && caMarkerSetter(-scroll / containerAnimation.duration() * (containerAnimation._caScrollDist || 0)); 5639 }; 5640 self.enable = function(reset, refresh) { 5641 if (!self.enabled) { 5642 self.enabled = true; 5643 _addListener2(scroller, "resize", _onResize); 5644 isViewport || _addListener2(scroller, "scroll", _onScroll2); 5645 onRefreshInit && _addListener2(ScrollTrigger2, "refreshInit", onRefreshInit); 5646 if (reset !== false) { 5647 self.progress = prevProgress = 0; 5648 scroll1 = scroll2 = lastSnap = scrollFunc(); 5649 } 5650 refresh !== false && self.refresh(); 5651 } 5652 }; 5653 self.getTween = function(snap4) { 5654 return snap4 && tweenTo ? tweenTo.tween : scrubTween; 5655 }; 5656 self.setPositions = function(newStart, newEnd, keepClamp, pinOffset) { 5657 if (containerAnimation) { 5658 var st = containerAnimation.scrollTrigger, duration = containerAnimation.duration(), _change = st.end - st.start; 5659 newStart = st.start + _change * newStart / duration; 5660 newEnd = st.start + _change * newEnd / duration; 5661 } 5662 self.refresh(false, false, { 5663 start: _keepClamp(newStart, keepClamp && !!self._startClamp), 5664 end: _keepClamp(newEnd, keepClamp && !!self._endClamp) 5665 }, pinOffset);
vendor: 8,086 bytes, lines 5666-5870
5666 self.update(); 5667 }; 5668 self.adjustPinSpacing = function(amount) { 5669 if (spacerState && amount) { 5670 var i = spacerState.indexOf(direction.d) + 1; 5671 spacerState[i] = parseFloat(spacerState[i]) + amount + _px; 5672 spacerState[1] = parseFloat(spacerState[1]) + amount + _px; 5673 _setState(spacerState); 5674 } 5675 }; 5676 self.disable = function(reset, allowAnimation) { 5677 if (self.enabled) { 5678 reset !== false && self.revert(true, true); 5679 self.enabled = self.isActive = false; 5680 allowAnimation || scrubTween && scrubTween.pause(); 5681 prevScroll = 0; 5682 pinCache && (pinCache.uncache = 1); 5683 onRefreshInit && _removeListener2(ScrollTrigger2, "refreshInit", onRefreshInit); 5684 if (snapDelayedCall) { 5685 snapDelayedCall.pause(); 5686 tweenTo.tween && tweenTo.tween.kill() && (tweenTo.tween = 0); 5687 } 5688 if (!isViewport) { 5689 var i = _triggers.length; 5690 while (i--) { 5691 if (_triggers[i].scroller === scroller && _triggers[i] !== self) { 5692 return; 5693 } 5694 } 5695 _removeListener2(scroller, "resize", _onResize); 5696 isViewport || _removeListener2(scroller, "scroll", _onScroll2); 5697 } 5698 } 5699 }; 5700 self.kill = function(revert, allowAnimation) { 5701 self.disable(revert, allowAnimation); 5702 scrubTween && !allowAnimation && scrubTween.kill(); 5703 id && delete _ids[id]; 5704 var i = _triggers.indexOf(self); 5705 i >= 0 && _triggers.splice(i, 1); 5706 i === _i && _direction > 0 && _i--; 5707 i = 0; 5708 _triggers.forEach(function(t) { 5709 return t.scroller === self.scroller && (i = 1); 5710 }); 5711 i || _refreshingAll || (self.scroll.rec = 0); 5712 if (animation) { 5713 animation.scrollTrigger = null; 5714 revert && animation.revert({ 5715 kill: false 5716 }); 5717 allowAnimation || animation.kill(); 5718 } 5719 markerStart && [markerStart, markerEnd, markerStartTrigger, markerEndTrigger].forEach(function(m) { 5720 return m.parentNode && m.parentNode.removeChild(m); 5721 }); 5722 _primary === self && (_primary = 0); 5723 if (pin) { 5724 pinCache && (pinCache.uncache = 1); 5725 i = 0; 5726 _triggers.forEach(function(t) { 5727 return t.pin === pin && i++; 5728 }); 5729 i || (pinCache.spacer = 0); 5730 } 5731 vars.onKill && vars.onKill(self); 5732 }; 5733 _triggers.push(self); 5734 self.enable(false, false); 5735 customRevertReturn && customRevertReturn(self); 5736 if (animation && animation.add && !change) { 5737 var updateFunc = self.update; 5738 self.update = function() { 5739 self.update = updateFunc; 5740 start || end || self.refresh(); 5741 }; 5742 gsap$1.delayedCall(0.01, self.update); 5743 change = 0.01; 5744 start = end = 0; 5745 } else { 5746 self.refresh(); 5747 } 5748 pin && _queueRefreshAll(); 5749 }; 5750 ScrollTrigger2.register = function register(core) { 5751 if (!_coreInitted$1) { 5752 gsap$1 = core || _getGSAP$1(); 5753 _windowExists$1() && window.document && ScrollTrigger2.enable(); 5754 _coreInitted$1 = _enabled; 5755 } 5756 return _coreInitted$1; 5757 }; 5758 ScrollTrigger2.defaults = function defaults2(config3) { 5759 if (config3) { 5760 for (var p in config3) { 5761 _defaults[p] = config3[p]; 5762 } 5763 } 5764 return _defaults; 5765 }; 5766 ScrollTrigger2.disable = function disable(reset, kill) { 5767 _enabled = 0; 5768 _triggers.forEach(function(trigger) { 5769 return trigger[kill ? "kill" : "disable"](reset); 5770 }); 5771 _removeListener2(_win$1, "wheel", _onScroll2); 5772 _removeListener2(_doc$1, "scroll", _onScroll2); 5773 clearInterval(_syncInterval); 5774 _removeListener2(_doc$1, "touchcancel", _passThrough2); 5775 _removeListener2(_body$1, "touchstart", _passThrough2); 5776 _multiListener(_removeListener2, _doc$1, "pointerdown,touchstart,mousedown", _pointerDownHandler); 5777 _multiListener(_removeListener2, _doc$1, "pointerup,touchend,mouseup", _pointerUpHandler); 5778 _resizeDelay.kill(); 5779 _iterateAutoRefresh(_removeListener2); 5780 for (var i = 0; i < _scrollers.length; i += 3) { 5781 _wheelListener(_removeListener2, _scrollers[i], _scrollers[i + 1]); 5782 _wheelListener(_removeListener2, _scrollers[i], _scrollers[i + 2]); 5783 } 5784 }; 5785 ScrollTrigger2.enable = function enable() { 5786 _win$1 = window; 5787 _doc$1 = document; 5788 _docEl$1 = _doc$1.documentElement; 5789 _body$1 = _doc$1.body; 5790 if (gsap$1) { 5791 _toArray$1 = gsap$1.utils.toArray; 5792 _clamp$1 = gsap$1.utils.clamp; 5793 _context$1 = gsap$1.core.context || _passThrough2; 5794 _suppressOverwrites = gsap$1.core.suppressOverwrites || _passThrough2; 5795 _scrollRestoration = _win$1.history.scrollRestoration || "auto"; 5796 _lastScroll = _win$1.pageYOffset; 5797 gsap$1.core.globals("ScrollTrigger", ScrollTrigger2); 5798 if (_body$1) { 5799 _enabled = 1; 5800 _div100vh = document.createElement("div"); 5801 _div100vh.style.height = "100vh"; 5802 _div100vh.style.position = "absolute"; 5803 _refresh100vh(); 5804 _rafBugFix(); 5805 Observer.register(gsap$1); 5806 ScrollTrigger2.isTouch = Observer.isTouch; 5807 _fixIOSBug = Observer.isTouch && /(iPad|iPhone|iPod|Mac)/g.test(navigator.userAgent); 5808 _ignoreMobileResize = Observer.isTouch === 1; 5809 _addListener2(_win$1, "wheel", _onScroll2); 5810 _root = [_win$1, _doc$1, _docEl$1, _body$1]; 5811 if (gsap$1.matchMedia) { 5812 ScrollTrigger2.matchMedia = function(vars) { 5813 var mm = gsap$1.matchMedia(), p; 5814 for (p in vars) { 5815 mm.add(p, vars[p]); 5816 } 5817 return mm; 5818 }; 5819 gsap$1.addEventListener("matchMediaInit", function() { 5820 return _revertAll(); 5821 }); 5822 gsap$1.addEventListener("matchMediaRevert", function() { 5823 return _revertRecorded(); 5824 }); 5825 gsap$1.addEventListener("matchMedia", function() { 5826 _refreshAll(0, 1); 5827 _dispatch2("matchMedia"); 5828 }); 5829 gsap$1.matchMedia("(orientation: portrait)", function() { 5830 _setBaseDimensions(); 5831 return _setBaseDimensions; 5832 }); 5833 } else { 5834 console.warn("Requires GSAP 3.11.0 or later"); 5835 } 5836 _setBaseDimensions(); 5837 _addListener2(_doc$1, "scroll", _onScroll2); 5838 var bodyStyle = _body$1.style, border = bodyStyle.borderTopStyle, AnimationProto = gsap$1.core.Animation.prototype, bounds, i; 5839 AnimationProto.revert || Object.defineProperty(AnimationProto, "revert", { 5840 value: function value() { 5841 return this.time(-0.01, true); 5842 } 5843 }); 5844 bodyStyle.borderTopStyle = "solid"; 5845 bounds = _getBounds(_body$1); 5846 _vertical.m = Math.round(bounds.top + _vertical.sc()) || 0; 5847 _horizontal.m = Math.round(bounds.left + _horizontal.sc()) || 0; 5848 border ? bodyStyle.borderTopStyle = border : bodyStyle.removeProperty("border-top-style"); 5849 _syncInterval = setInterval(_sync, 250); 5850 gsap$1.delayedCall(0.5, function() { 5851 return _startup = 0; 5852 }); 5853 _addListener2(_doc$1, "touchcancel", _passThrough2); 5854 _addListener2(_body$1, "touchstart", _passThrough2); 5855 _multiListener(_addListener2, _doc$1, "pointerdown,touchstart,mousedown", _pointerDownHandler); 5856 _multiListener(_addListener2, _doc$1, "pointerup,touchend,mouseup", _pointerUpHandler); 5857 _transformProp = gsap$1.utils.checkPrefix("transform"); 5858 _stateProps.push(_transformProp); 5859 _coreInitted$1 = _getTime(); 5860 _resizeDelay = gsap$1.delayedCall(0.2, _refreshAll).pause(); 5861 _autoRefresh = [_doc$1, "visibilitychange", function() { 5862 var w = _win$1.innerWidth, h = _win$1.innerHeight; 5863 if (_doc$1.hidden) { 5864 _prevWidth = w; 5865 _prevHeight = h; 5866 } else if (_prevWidth !== w || _prevHeight !== h) { 5867 _onResize(); 5868 } 5869 }, _doc$1, "DOMContentLoaded", _refreshAll, _win$1, "load", _refreshAll, _win$1, "resize", _onResize]; 5870 _iterateAutoRefresh(_addListener2);
vendor: 9,297 bytes, lines 5871-6067
5871 _triggers.forEach(function(trigger) { 5872 return trigger.enable(0, 1); 5873 }); 5874 for (i = 0; i < _scrollers.length; i += 3) { 5875 _wheelListener(_removeListener2, _scrollers[i], _scrollers[i + 1]); 5876 _wheelListener(_removeListener2, _scrollers[i], _scrollers[i + 2]); 5877 } 5878 } 5879 } 5880 }; 5881 ScrollTrigger2.config = function config3(vars) { 5882 "limitCallbacks" in vars && (_limitCallbacks = !!vars.limitCallbacks); 5883 var ms = vars.syncInterval; 5884 ms && clearInterval(_syncInterval) || (_syncInterval = ms) && setInterval(_sync, ms); 5885 "ignoreMobileResize" in vars && (_ignoreMobileResize = ScrollTrigger2.isTouch === 1 && vars.ignoreMobileResize); 5886 if ("autoRefreshEvents" in vars) { 5887 _iterateAutoRefresh(_removeListener2) || _iterateAutoRefresh(_addListener2, vars.autoRefreshEvents || "none"); 5888 _ignoreResize = (vars.autoRefreshEvents + "").indexOf("resize") === -1; 5889 } 5890 }; 5891 ScrollTrigger2.scrollerProxy = function scrollerProxy(target, vars) { 5892 var t = _getTarget(target), i = _scrollers.indexOf(t), isViewport = _isViewport2(t); 5893 if (~i) { 5894 _scrollers.splice(i, isViewport ? 6 : 2); 5895 } 5896 if (vars) { 5897 isViewport ? _proxies.unshift(_win$1, vars, _body$1, vars, _docEl$1, vars) : _proxies.unshift(t, vars); 5898 } 5899 }; 5900 ScrollTrigger2.clearMatchMedia = function clearMatchMedia(query) { 5901 _triggers.forEach(function(t) { 5902 return t._ctx && t._ctx.query === query && t._ctx.kill(true, true); 5903 }); 5904 }; 5905 ScrollTrigger2.isInViewport = function isInViewport(element, ratio, horizontal) { 5906 var bounds = (_isString2(element) ? _getTarget(element) : element).getBoundingClientRect(), offset = bounds[horizontal ? _width : _height] * ratio || 0; 5907 return horizontal ? bounds.right - offset > 0 && bounds.left + offset < _win$1.innerWidth : bounds.bottom - offset > 0 && bounds.top + offset < _win$1.innerHeight; 5908 }; 5909 ScrollTrigger2.positionInViewport = function positionInViewport(element, referencePoint, horizontal) { 5910 _isString2(element) && (element = _getTarget(element)); 5911 var bounds = element.getBoundingClientRect(), size2 = bounds[horizontal ? _width : _height], offset = referencePoint == null ? size2 / 2 : referencePoint in _keywords ? _keywords[referencePoint] * size2 : ~referencePoint.indexOf("%") ? parseFloat(referencePoint) * size2 / 100 : parseFloat(referencePoint) || 0; 5912 return horizontal ? (bounds.left + offset) / _win$1.innerWidth : (bounds.top + offset) / _win$1.innerHeight; 5913 }; 5914 ScrollTrigger2.killAll = function killAll(allowListeners) { 5915 _triggers.slice(0).forEach(function(t) { 5916 return t.vars.id !== "ScrollSmoother" && t.kill(); 5917 }); 5918 if (allowListeners !== true) { 5919 var listeners = _listeners.killAll || []; 5920 _listeners = {}; 5921 listeners.forEach(function(f) { 5922 return f(); 5923 }); 5924 } 5925 }; 5926 return ScrollTrigger2; 5927}(); 5928ScrollTrigger$1.version = "3.12.5"; 5929ScrollTrigger$1.saveStyles = function(targets) { 5930 return targets ? _toArray$1(targets).forEach(function(target) { 5931 if (target && target.style) { 5932 var i = _savedStyles.indexOf(target); 5933 i >= 0 && _savedStyles.splice(i, 5); 5934 _savedStyles.push(target, target.style.cssText, target.getBBox && target.getAttribute("transform"), gsap$1.core.getCache(target), _context$1()); 5935 } 5936 }) : _savedStyles; 5937}; 5938ScrollTrigger$1.revert = function(soft, media) { 5939 return _revertAll(!soft, media); 5940}; 5941ScrollTrigger$1.create = function(vars, animation) { 5942 return new ScrollTrigger$1(vars, animation); 5943}; 5944ScrollTrigger$1.refresh = function(safe) { 5945 return safe ? _onResize() : (_coreInitted$1 || ScrollTrigger$1.register()) && _refreshAll(true); 5946}; 5947ScrollTrigger$1.update = function(force) { 5948 return ++_scrollers.cache && _updateAll(force === true ? 2 : 0); 5949}; 5950ScrollTrigger$1.clearScrollMemory = _clearScrollMemory; 5951ScrollTrigger$1.maxScroll = function(element, horizontal) { 5952 return _maxScroll$1(element, horizontal ? _horizontal : _vertical); 5953}; 5954ScrollTrigger$1.getScrollFunc = function(element, horizontal) { 5955 return _getScrollFunc(_getTarget(element), horizontal ? _horizontal : _vertical); 5956}; 5957ScrollTrigger$1.getById = function(id) { 5958 return _ids[id]; 5959}; 5960ScrollTrigger$1.getAll = function() { 5961 return _triggers.filter(function(t) { 5962 return t.vars.id !== "ScrollSmoother"; 5963 }); 5964}; 5965ScrollTrigger$1.isScrolling = function() { 5966 return !!_lastScrollTime; 5967}; 5968ScrollTrigger$1.snapDirectional = _snapDirectional; 5969ScrollTrigger$1.addEventListener = function(type, callback) { 5970 var a = _listeners[type] || (_listeners[type] = []); 5971 ~a.indexOf(callback) || a.push(callback); 5972}; 5973ScrollTrigger$1.removeEventListener = function(type, callback) { 5974 var a = _listeners[type], i = a && a.indexOf(callback); 5975 i >= 0 && a.splice(i, 1); 5976}; 5977ScrollTrigger$1.batch = function(targets, vars) { 5978 var result = [], varsCopy = {}, interval = vars.interval || 0.016, batchMax = vars.batchMax || 1e9, proxyCallback = function proxyCallback2(type, callback) { 5979 var elements = [], triggers = [], delay = gsap$1.delayedCall(interval, function() { 5980 callback(elements, triggers); 5981 elements = []; 5982 triggers = []; 5983 }).pause(); 5984 return function(self) { 5985 elements.length || delay.restart(true); 5986 elements.push(self.trigger); 5987 triggers.push(self); 5988 batchMax <= elements.length && delay.progress(1); 5989 }; 5990 }, p; 5991 for (p in vars) { 5992 varsCopy[p] = p.substr(0, 2) === "on" && _isFunction2(vars[p]) && p !== "onRefreshInit" ? proxyCallback(p, vars[p]) : vars[p]; 5993 } 5994 if (_isFunction2(batchMax)) { 5995 batchMax = batchMax(); 5996 _addListener2(ScrollTrigger$1, "refresh", function() { 5997 return batchMax = vars.batchMax(); 5998 }); 5999 } 6000 _toArray$1(targets).forEach(function(target) { 6001 var config3 = {}; 6002 for (p in varsCopy) { 6003 config3[p] = varsCopy[p]; 6004 } 6005 config3.trigger = target; 6006 result.push(ScrollTrigger$1.create(config3)); 6007 }); 6008 return result; 6009}; 6010var _clampScrollAndGetDurationMultiplier = function _clampScrollAndGetDurationMultiplier2(scrollFunc, current, end, max) { 6011 current > max ? scrollFunc(max) : current < 0 && scrollFunc(0); 6012 return end > max ? (max - current) / (end - current) : end < 0 ? current / (current - end) : 1; 6013}, _allowNativePanning = function _allowNativePanning2(target, direction) { 6014 if (direction === true) { 6015 target.style.removeProperty("touch-action"); 6016 } else { 6017 target.style.touchAction = direction === true ? "auto" : direction ? "pan-" + direction + (Observer.isTouch ? " pinch-zoom" : "") : "none"; 6018 } 6019 target === _docEl$1 && _allowNativePanning2(_body$1, direction); 6020}, _overflow = { 6021 auto: 1, 6022 scroll: 1 6023}, _nestedScroll = function _nestedScroll2(_ref5) { 6024 var event = _ref5.event, target = _ref5.target, axis = _ref5.axis; 6025 var node = (event.changedTouches ? event.changedTouches[0] : event).target, cache = node._gsap || gsap$1.core.getCache(node), time = _getTime(), cs; 6026 if (!cache._isScrollT || time - cache._isScrollT > 2e3) { 6027 while (node && node !== _body$1 && (node.scrollHeight <= node.clientHeight && node.scrollWidth <= node.clientWidth || !(_overflow[(cs = _getComputedStyle(node)).overflowY] || _overflow[cs.overflowX]))) { 6028 node = node.parentNode; 6029 } 6030 cache._isScroll = node && node !== target && !_isViewport2(node) && (_overflow[(cs = _getComputedStyle(node)).overflowY] || _overflow[cs.overflowX]); 6031 cache._isScrollT = time; 6032 } 6033 if (cache._isScroll || axis === "x") { 6034 event.stopPropagation(); 6035 event._gsapAllow = true; 6036 } 6037}, _inputObserver$1 = function _inputObserver(target, type, inputs, nested) { 6038 return Observer.create({ 6039 target, 6040 capture: true, 6041 debounce: false, 6042 lockAxis: true, 6043 type, 6044 onWheel: nested = nested && _nestedScroll, 6045 onPress: nested, 6046 onDrag: nested, 6047 onScroll: nested, 6048 onEnable: function onEnable() { 6049 return inputs && _addListener2(_doc$1, Observer.eventTypes[0], _captureInputs, false, true); 6050 }, 6051 onDisable: function onDisable() { 6052 return _removeListener2(_doc$1, Observer.eventTypes[0], _captureInputs, true); 6053 } 6054 }); 6055}, _inputExp = /(input|label|select|textarea)/i, _inputIsFocused, _captureInputs = function _captureInputs2(e) { 6056 var isInput = _inputExp.test(e.target.tagName); 6057 if (isInput || _inputIsFocused) { 6058 e._gsapAllow = true; 6059 _inputIsFocused = isInput; 6060 } 6061}, _getScrollNormalizer = function _getScrollNormalizer2(vars) { 6062 _isObject2(vars) || (vars = {}); 6063 vars.preventDefault = vars.isNormalizer = vars.allowClicks = true; 6064 vars.type || (vars.type = "wheel,touch"); 6065 vars.debounce = !!vars.debounce; 6066 vars.id = vars.id || "normalizer"; 6067 var _vars2 = vars, normalizeScrollX = _vars2.normalizeScrollX, momentum = _vars2.momentum, allowNestedScroll = _vars2.allowNestedScroll, onRelease = _vars2.onRelease, self, maxY, target = _getTarget(vars.target) || _docEl$1, smoother = gsap$1.core.globals().ScrollSmoother, smootherInstance = smoother && smoother.get(), content = _fixIOSBug && (vars.content && _getTarget(vars.content) || smootherInstance && vars.content !== false && !smootherInstance.smooth() && smootherInstance.content()), scrollFuncY = _getScrollFunc(target, _vertical), scrollFuncX = _getScrollFunc(target, _horizontal), scale = 1, initialScale = (Observer.isTouch && _win$1.visualVie
vendor: 4,121 bytes, lines 6067-6150
6067wport ? _win$1.visualViewport.scale * _win$1.visualViewport.width : _win$1.outerWidth) / _win$1.innerWidth, wheelRefresh = 0, resolveMomentumDuration = _isFunction2(momentum) ? function() { 6068 return momentum(self); 6069 } : function() { 6070 return momentum || 2.8; 6071 }, lastRefreshID, skipTouchMove, inputObserver = _inputObserver$1(target, vars.type, true, allowNestedScroll), resumeTouchMove = function resumeTouchMove2() { 6072 return skipTouchMove = false; 6073 }, scrollClampX = _passThrough2, scrollClampY = _passThrough2, updateClamps = function updateClamps2() { 6074 maxY = _maxScroll$1(target, _vertical); 6075 scrollClampY = _clamp$1(_fixIOSBug ? 1 : 0, maxY); 6076 normalizeScrollX && (scrollClampX = _clamp$1(0, _maxScroll$1(target, _horizontal))); 6077 lastRefreshID = _refreshID; 6078 }, removeContentOffset = function removeContentOffset2() { 6079 content._gsap.y = _round$1(parseFloat(content._gsap.y) + scrollFuncY.offset) + "px"; 6080 content.style.transform = "matrix3d(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, " + parseFloat(content._gsap.y) + ", 0, 1)"; 6081 scrollFuncY.offset = scrollFuncY.cacheID = 0; 6082 }, ignoreDrag = function ignoreDrag2() { 6083 if (skipTouchMove) { 6084 requestAnimationFrame(resumeTouchMove); 6085 var offset = _round$1(self.deltaY / 2), scroll = scrollClampY(scrollFuncY.v - offset); 6086 if (content && scroll !== scrollFuncY.v + scrollFuncY.offset) { 6087 scrollFuncY.offset = scroll - scrollFuncY.v; 6088 var y = _round$1((parseFloat(content && content._gsap.y) || 0) - scrollFuncY.offset); 6089 content.style.transform = "matrix3d(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, " + y + ", 0, 1)"; 6090 content._gsap.y = y + "px"; 6091 scrollFuncY.cacheID = _scrollers.cache; 6092 _updateAll(); 6093 } 6094 return true; 6095 } 6096 scrollFuncY.offset && removeContentOffset(); 6097 skipTouchMove = true; 6098 }, tween, startScrollX, startScrollY, onStopDelayedCall, onResize = function onResize2() { 6099 updateClamps(); 6100 if (tween.isActive() && tween.vars.scrollY > maxY) { 6101 scrollFuncY() > maxY ? tween.progress(1) && scrollFuncY(maxY) : tween.resetTo("scrollY", maxY); 6102 } 6103 }; 6104 content && gsap$1.set(content, { 6105 y: "+=0" 6106 }); 6107 vars.ignoreCheck = function(e) { 6108 return _fixIOSBug && e.type === "touchmove" && ignoreDrag() || scale > 1.05 && e.type !== "touchstart" || self.isGesturing || e.touches && e.touches.length > 1; 6109 }; 6110 vars.onPress = function() { 6111 skipTouchMove = false; 6112 var prevScale = scale; 6113 scale = _round$1((_win$1.visualViewport && _win$1.visualViewport.scale || 1) / initialScale); 6114 tween.pause(); 6115 prevScale !== scale && _allowNativePanning(target, scale > 1.01 ? true : normalizeScrollX ? false : "x"); 6116 startScrollX = scrollFuncX(); 6117 startScrollY = scrollFuncY(); 6118 updateClamps(); 6119 lastRefreshID = _refreshID; 6120 }; 6121 vars.onRelease = vars.onGestureStart = function(self2, wasDragging) { 6122 scrollFuncY.offset && removeContentOffset(); 6123 if (!wasDragging) { 6124 onStopDelayedCall.restart(true); 6125 } else { 6126 _scrollers.cache++; 6127 var dur = resolveMomentumDuration(), currentScroll, endScroll; 6128 if (normalizeScrollX) { 6129 currentScroll = scrollFuncX(); 6130 endScroll = currentScroll + dur * 0.05 * -self2.velocityX / 0.227; 6131 dur *= _clampScrollAndGetDurationMultiplier(scrollFuncX, currentScroll, endScroll, _maxScroll$1(target, _horizontal)); 6132 tween.vars.scrollX = scrollClampX(endScroll); 6133 } 6134 currentScroll = scrollFuncY(); 6135 endScroll = currentScroll + dur * 0.05 * -self2.velocityY / 0.227; 6136 dur *= _clampScrollAndGetDurationMultiplier(scrollFuncY, currentScroll, endScroll, _maxScroll$1(target, _vertical)); 6137 tween.vars.scrollY = scrollClampY(endScroll); 6138 tween.invalidate().duration(dur).play(0.01); 6139 if (_fixIOSBug && tween.vars.scrollY >= maxY || currentScroll >= maxY - 1) { 6140 gsap$1.to({}, { 6141 onUpdate: onResize, 6142 duration: dur 6143 }); 6144 } 6145 } 6146 onRelease && onRelease(self2); 6147 }; 6148 vars.onWheel = function() { 6149 tween._ts && tween.pause(); 6150 if (_getTime() - wheelRefresh > 1e3) {
vendor: 5,409 bytes, lines 6151-6287
6151 lastRefreshID = 0; 6152 wheelRefresh = _getTime(); 6153 } 6154 }; 6155 vars.onChange = function(self2, dx, dy, xArray, yArray) { 6156 _refreshID !== lastRefreshID && updateClamps(); 6157 dx && normalizeScrollX && scrollFuncX(scrollClampX(xArray[2] === dx ? startScrollX + (self2.startX - self2.x) : scrollFuncX() + dx - xArray[1])); 6158 if (dy) { 6159 scrollFuncY.offset && removeContentOffset(); 6160 var isTouch = yArray[2] === dy, y = isTouch ? startScrollY + self2.startY - self2.y : scrollFuncY() + dy - yArray[1], yClamped = scrollClampY(y); 6161 isTouch && y !== yClamped && (startScrollY += yClamped - y); 6162 scrollFuncY(yClamped); 6163 } 6164 (dy || dx) && _updateAll(); 6165 }; 6166 vars.onEnable = function() { 6167 _allowNativePanning(target, normalizeScrollX ? false : "x"); 6168 ScrollTrigger$1.addEventListener("refresh", onResize); 6169 _addListener2(_win$1, "resize", onResize); 6170 if (scrollFuncY.smooth) { 6171 scrollFuncY.target.style.scrollBehavior = "auto"; 6172 scrollFuncY.smooth = scrollFuncX.smooth = false; 6173 } 6174 inputObserver.enable(); 6175 }; 6176 vars.onDisable = function() { 6177 _allowNativePanning(target, true); 6178 _removeListener2(_win$1, "resize", onResize); 6179 ScrollTrigger$1.removeEventListener("refresh", onResize); 6180 inputObserver.kill(); 6181 }; 6182 vars.lockAxis = vars.lockAxis !== false; 6183 self = new Observer(vars); 6184 self.iOS = _fixIOSBug; 6185 _fixIOSBug && !scrollFuncY() && scrollFuncY(1); 6186 _fixIOSBug && gsap$1.ticker.add(_passThrough2); 6187 onStopDelayedCall = self._dc; 6188 tween = gsap$1.to(self, { 6189 ease: "power4", 6190 paused: true, 6191 inherit: false, 6192 scrollX: normalizeScrollX ? "+=0.1" : "+=0", 6193 scrollY: "+=0.1", 6194 modifiers: { 6195 scrollY: _interruptionTracker(scrollFuncY, scrollFuncY(), function() { 6196 return tween.pause(); 6197 }) 6198 }, 6199 onUpdate: _updateAll, 6200 onComplete: onStopDelayedCall.vars.onComplete 6201 }); 6202 return self; 6203}; 6204ScrollTrigger$1.sort = function(func) { 6205 return _triggers.sort(func || function(a, b) { 6206 return (a.vars.refreshPriority || 0) * -1e6 + a.start - (b.start + (b.vars.refreshPriority || 0) * -1e6); 6207 }); 6208}; 6209ScrollTrigger$1.observe = function(vars) { 6210 return new Observer(vars); 6211}; 6212ScrollTrigger$1.normalizeScroll = function(vars) { 6213 if (typeof vars === "undefined") { 6214 return _normalizer; 6215 } 6216 if (vars === true && _normalizer) { 6217 return _normalizer.enable(); 6218 } 6219 if (vars === false) { 6220 _normalizer && _normalizer.kill(); 6221 _normalizer = vars; 6222 return; 6223 } 6224 var normalizer = vars instanceof Observer ? vars : _getScrollNormalizer(vars); 6225 _normalizer && _normalizer.target === normalizer.target && _normalizer.kill(); 6226 _isViewport2(normalizer.target) && (_normalizer = normalizer); 6227 return normalizer; 6228}; 6229ScrollTrigger$1.core = { 6230 // smaller file size way to leverage in ScrollSmoother and Observer 6231 _getVelocityProp: _getVelocityProp$1, 6232 _inputObserver: _inputObserver$1, 6233 _scrollers, 6234 _proxies, 6235 bridge: { 6236 // when normalizeScroll sets the scroll position (ss = setScroll) 6237 ss: function ss() { 6238 _lastScrollTime || _dispatch2("scrollStart"); 6239 _lastScrollTime = _getTime(); 6240 }, 6241 // a way to get the _refreshing value in Observer 6242 ref: function ref() { 6243 return _refreshing; 6244 } 6245 } 6246}; 6247_getGSAP$1() && gsap$1.registerPlugin(ScrollTrigger$1); 6248function _defineProperties(target, props) { 6249 for (var i = 0; i < props.length; i++) { 6250 var descriptor = props[i]; 6251 descriptor.enumerable = descriptor.enumerable || false; 6252 descriptor.configurable = true; 6253 if ("value" in descriptor) 6254 descriptor.writable = true; 6255 Object.defineProperty(target, descriptor.key, descriptor); 6256 } 6257} 6258function _createClass(Constructor, protoProps, staticProps) { 6259 if (protoProps) 6260 _defineProperties(Constructor.prototype, protoProps); 6261 if (staticProps) 6262 _defineProperties(Constructor, staticProps); 6263 return Constructor; 6264} 6265/*! 6266 * ScrollSmoother 3.12.5 6267 * https://gsap.com 6268 * 6269 * @license Copyright 2008-2024, GreenSock. All rights reserved. 6270 * Subject to the terms at https://gsap.com/standard-license or for 6271 * Club GSAP members, the agreement issued with that membership. 6272 * @author: Jack Doyle, [email protected] 6273*/ 6274var gsap, _coreInitted, _win, _doc, _docEl, _body, _toArray, _clamp2, ScrollTrigger, _mainInstance, _expo, _getVelocityProp2, _inputObserver2, _context, _onResizeDelayedCall, _windowExists4 = function _windowExists5() { 6275 return typeof window !== "undefined"; 6276}, _getGSAP3 = function _getGSAP4() { 6277 return gsap || _windowExists4() && (gsap = window.gsap) && gsap.registerPlugin && gsap; 6278}, _round3 = function _round4(value) { 6279 return Math.round(value * 1e5) / 1e5 || 0; 6280}, _maxScroll2 = function _maxScroll3(scroller) { 6281 return ScrollTrigger.maxScroll(scroller || _win); 6282}, _autoDistance = function _autoDistance2(el, progress) { 6283 var parent = el.parentNode || _docEl, b1 = el.getBoundingClientRect(), b2 = parent.getBoundingClientRect(), gapTop = b2.top - b1.top, gapBottom = b2.bottom - b1.bottom, change = (Math.abs(gapTop) > Math.abs(gapBottom) ? gapTop : gapBottom) / (1 - progress), offset = -change * progress, ratio, extraChange; 6284 if (change > 0) { 6285 ratio = b2.height / (_win.innerHeight + b2.height); 6286 extraChange = ratio === 0.5 ? b2.height * 2 : Math.min(b2.height, Math.abs(-change * ratio / (2 * ratio - 1))) * 2 * (progress || 1); 6287 offset += progress ? -extraChange * progress : -extraChange / 2;
vendor: 1,804 bytes, lines 6288-6318
6288 change += extraChange; 6289 } 6290 return { 6291 change, 6292 offset 6293 }; 6294}, _wrap = function _wrap2(el) { 6295 var wrapper = _doc.querySelector(".ScrollSmoother-wrapper"); 6296 if (!wrapper) { 6297 wrapper = _doc.createElement("div"); 6298 wrapper.classList.add("ScrollSmoother-wrapper"); 6299 el.parentNode.insertBefore(wrapper, el); 6300 wrapper.appendChild(el); 6301 } 6302 return wrapper; 6303}; 6304var ScrollSmoother = /* @__PURE__ */ function() { 6305 function ScrollSmoother2(vars) { 6306 var _this = this; 6307 _coreInitted || ScrollSmoother2.register(gsap) || console.warn("Please gsap.registerPlugin(ScrollSmoother)"); 6308 vars = this.vars = vars || {}; 6309 _mainInstance && _mainInstance.kill(); 6310 _mainInstance = this; 6311 _context(this); 6312 var _vars = vars, smoothTouch = _vars.smoothTouch, _onUpdate = _vars.onUpdate, onStop = _vars.onStop, smooth = _vars.smooth, onFocusIn = _vars.onFocusIn, normalizeScroll = _vars.normalizeScroll, wholePixels = _vars.wholePixels, content, wrapper, height, mainST, effects, sections, intervalID, wrapperCSS, contentCSS, paused, pausedNormalizer, recordedRefreshScroll, recordedRefreshScrub, allowUpdates, self = this, effectsPrefix = vars.effectsPrefix || "", scrollFunc = ScrollTrigger.getScrollFunc(_win), smoothDuration = ScrollTrigger.isTouch === 1 ? smoothTouch === true ? 0.8 : parseFloat(smoothTouch) || 0 : smooth === 0 || smooth === false ? 0 : parseFloat(smooth) || 0.8, speed = smoothDuration && +vars.speed || 1, currentY = 0, delta = 0, startupPhase = 1, tracker = _getVelocityProp2(0), updateVelocity = function updateVelocity2() { 6313 return tracker.update(-currentY); 6314 }, scroll = { 6315 y: 0 6316 }, removeScroll = function removeScroll2() { 6317 return content.style.overflow = "visible"; 6318 }, isProxyScrolling, killScrub = function killScrub2(trigger) {
vendor: 4,419 bytes, lines 6319-6412
6319 trigger.update(); 6320 var scrub = trigger.getTween(); 6321 if (scrub) { 6322 scrub.pause(); 6323 scrub._time = scrub._dur; 6324 scrub._tTime = scrub._tDur; 6325 } 6326 isProxyScrolling = false; 6327 trigger.animation.progress(trigger.progress, true); 6328 }, render3 = function render4(y, force) { 6329 if (y !== currentY && !paused || force) { 6330 wholePixels && (y = Math.round(y)); 6331 if (smoothDuration) { 6332 content.style.transform = "matrix3d(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, " + y + ", 0, 1)"; 6333 content._gsap.y = y + "px"; 6334 } 6335 delta = y - currentY; 6336 currentY = y; 6337 ScrollTrigger.isUpdating || ScrollSmoother2.isRefreshing || ScrollTrigger.update(); 6338 } 6339 }, scrollTop = function scrollTop2(value) { 6340 if (arguments.length) { 6341 value < 0 && (value = 0); 6342 scroll.y = -value; 6343 isProxyScrolling = true; 6344 paused ? currentY = -value : render3(-value); 6345 ScrollTrigger.isRefreshing ? mainST.update() : scrollFunc(value / speed); 6346 return this; 6347 } 6348 return -currentY; 6349 }, resizeObserver = typeof ResizeObserver !== "undefined" && vars.autoResize !== false && new ResizeObserver(function() { 6350 if (!ScrollTrigger.isRefreshing) { 6351 var max = _maxScroll2(wrapper) * speed; 6352 max < -currentY && scrollTop(max); 6353 _onResizeDelayedCall.restart(true); 6354 } 6355 }), lastFocusElement, _onFocusIn = function _onFocusIn2(e) { 6356 wrapper.scrollTop = 0; 6357 if (e.target.contains && e.target.contains(wrapper) || onFocusIn && onFocusIn(_this, e) === false) { 6358 return; 6359 } 6360 ScrollTrigger.isInViewport(e.target) || e.target === lastFocusElement || _this.scrollTo(e.target, false, "center center"); 6361 lastFocusElement = e.target; 6362 }, _transformPosition = function _transformPosition2(position, st) { 6363 if (position < st.start) { 6364 return position; 6365 } 6366 var ratio = isNaN(st.ratio) ? 1 : st.ratio, change = st.end - st.start, distance = position - st.start, offset = st.offset || 0, pins = st.pins || [], pinOffset = pins.offset || 0, progressOffset = st._startClamp && st.start <= 0 || st.pins && st.pins.offset ? 0 : st._endClamp && st.end === _maxScroll2() ? 1 : 0.5; 6367 pins.forEach(function(p) { 6368 change -= p.distance; 6369 if (p.nativeStart <= position) { 6370 distance -= p.distance; 6371 } 6372 }); 6373 if (pinOffset) { 6374 distance *= (change - pinOffset / ratio) / change; 6375 } 6376 return position + (distance - offset * progressOffset) / ratio - distance; 6377 }, adjustEffectRelatedTriggers = function adjustEffectRelatedTriggers2(st, triggers, partial) { 6378 partial || (st.pins.length = st.pins.offset = 0); 6379 var pins = st.pins, markers = st.markers, dif, isClamped, start, end, nativeStart, nativeEnd, i, trig; 6380 for (i = 0; i < triggers.length; i++) { 6381 trig = triggers[i]; 6382 if (st.trigger && trig.trigger && st !== trig && (trig.trigger === st.trigger || trig.pinnedContainer === st.trigger || st.trigger.contains(trig.trigger))) { 6383 nativeStart = trig._startNative || trig._startClamp || trig.start; 6384 nativeEnd = trig._endNative || trig._endClamp || trig.end; 6385 start = _transformPosition(nativeStart, st); 6386 end = trig.pin && nativeEnd > 0 ? start + (nativeEnd - nativeStart) : _transformPosition(nativeEnd, st); 6387 trig.setPositions(start, end, true, (trig._startClamp ? Math.max(0, start) : start) - nativeStart); 6388 trig.markerStart && markers.push(gsap.quickSetter([trig.markerStart, trig.markerEnd], "y", "px")); 6389 if (trig.pin && trig.end > 0 && !partial) { 6390 dif = trig.end - trig.start; 6391 isClamped = st._startClamp && trig.start < 0; 6392 if (isClamped) { 6393 if (st.start > 0) { 6394 st.setPositions(0, st.end + (st._startNative - st.start), true); 6395 adjustEffectRelatedTriggers2(st, triggers); 6396 return; 6397 } 6398 dif += trig.start; 6399 pins.offset = -trig.start; 6400 } 6401 pins.push({ 6402 start: trig.start, 6403 nativeStart, 6404 end: trig.end, 6405 distance: dif, 6406 trig 6407 }); 6408 st.setPositions(st.start, st.end + (isClamped ? -trig.start : dif), true); 6409 } 6410 } 6411 } 6412 }
vendor: 4,322 bytes, lines 6412-6507
6412, adjustParallaxPosition = function adjustParallaxPosition2(triggers, createdAfterEffectWasApplied) { 6413 effects.forEach(function(st) { 6414 return adjustEffectRelatedTriggers(st, triggers, createdAfterEffectWasApplied); 6415 }); 6416 }, onRefresh = function onRefresh2() { 6417 removeScroll(); 6418 requestAnimationFrame(removeScroll); 6419 if (effects) { 6420 ScrollTrigger.getAll().forEach(function(st) { 6421 st._startNative = st.start; 6422 st._endNative = st.end; 6423 }); 6424 effects.forEach(function(st) { 6425 var start = st._startClamp || st.start, end = st.autoSpeed ? Math.min(_maxScroll2(), st.end) : start + Math.abs((st.end - start) / st.ratio), offset = end - st.end; 6426 start -= offset / 2; 6427 end -= offset / 2; 6428 if (start > end) { 6429 var s = start; 6430 start = end; 6431 end = s; 6432 } 6433 if (st._startClamp && start < 0) { 6434 end = st.ratio < 0 ? _maxScroll2() : st.end / st.ratio; 6435 offset = end - st.end; 6436 start = 0; 6437 } else if (st.ratio < 0 || st._endClamp && end >= _maxScroll2()) { 6438 end = _maxScroll2(); 6439 start = st.ratio < 0 ? 0 : st.ratio > 1 ? 0 : end - (end - st.start) / st.ratio; 6440 offset = (end - start) * st.ratio - (st.end - st.start); 6441 } 6442 st.offset = offset || 1e-4; 6443 st.pins.length = st.pins.offset = 0; 6444 st.setPositions(start, end, true); 6445 }); 6446 adjustParallaxPosition(ScrollTrigger.sort()); 6447 } 6448 tracker.reset(); 6449 }, addOnRefresh = function addOnRefresh2() { 6450 return ScrollTrigger.addEventListener("refresh", onRefresh); 6451 }, restoreEffects = function restoreEffects2() { 6452 return effects && effects.forEach(function(st) { 6453 return st.vars.onRefresh(st); 6454 }); 6455 }, revertEffects = function revertEffects2() { 6456 effects && effects.forEach(function(st) { 6457 return st.vars.onRefreshInit(st); 6458 }); 6459 return restoreEffects; 6460 }, effectValueGetter = function effectValueGetter2(name, value, index, el) { 6461 return function() { 6462 var v = typeof value === "function" ? value(index, el) : value; 6463 v || v === 0 || (v = el.getAttribute("data-" + effectsPrefix + name) || (name === "speed" ? 1 : 0)); 6464 el.setAttribute("data-" + effectsPrefix + name, v); 6465 var clamp3 = (v + "").substr(0, 6) === "clamp("; 6466 return { 6467 clamp: clamp3, 6468 value: clamp3 ? v.substr(6, v.length - 7) : v 6469 }; 6470 }; 6471 }, createEffect = function createEffect2(el, speed2, lag, index, effectsPadding) { 6472 effectsPadding = (typeof effectsPadding === "function" ? effectsPadding(index, el) : effectsPadding) || 0; 6473 var getSpeed = effectValueGetter("speed", speed2, index, el), getLag = effectValueGetter("lag", lag, index, el), startY = gsap.getProperty(el, "y"), cache = el._gsap, ratio, st, autoSpeed, scrub, progressOffset, yOffset, pins = [], initDynamicValues = function initDynamicValues2() { 6474 speed2 = getSpeed(); 6475 lag = parseFloat(getLag().value); 6476 ratio = parseFloat(speed2.value) || 1; 6477 autoSpeed = speed2.value === "auto"; 6478 progressOffset = autoSpeed || st && st._startClamp && st.start <= 0 || pins.offset ? 0 : st && st._endClamp && st.end === _maxScroll2() ? 1 : 0.5; 6479 scrub && scrub.kill(); 6480 scrub = lag && gsap.to(el, { 6481 ease: _expo, 6482 overwrite: false, 6483 y: "+=0", 6484 duration: lag 6485 }); 6486 if (st) { 6487 st.ratio = ratio; 6488 st.autoSpeed = autoSpeed; 6489 } 6490 }, revert = function revert2() { 6491 cache.y = startY + "px"; 6492 cache.renderTransform(1); 6493 initDynamicValues(); 6494 }, markers = [], change = 0, updateChange = function updateChange2(self2) { 6495 if (autoSpeed) { 6496 revert(); 6497 var auto = _autoDistance(el, _clamp2(0, 1, -self2.start / (self2.end - self2.start))); 6498 change = auto.change; 6499 yOffset = auto.offset; 6500 } else { 6501 yOffset = pins.offset || 0; 6502 change = (self2.end - self2.start - yOffset) * (1 - ratio); 6503 } 6504 pins.forEach(function(p) { 6505 return change -= p.distance * (1 - ratio); 6506 }); 6507 self2.offset = change || 1e-3;
vendor: 5,909 bytes, lines 6508-6670
6508 self2.vars.onUpdate(self2); 6509 scrub && scrub.progress(1); 6510 }; 6511 initDynamicValues(); 6512 if (ratio !== 1 || autoSpeed || scrub) { 6513 st = ScrollTrigger.create({ 6514 trigger: autoSpeed ? el.parentNode : el, 6515 start: function start() { 6516 return speed2.clamp ? "clamp(top bottom+=" + effectsPadding + ")" : "top bottom+=" + effectsPadding; 6517 }, 6518 end: function end() { 6519 return speed2.value < 0 ? "max" : speed2.clamp ? "clamp(bottom top-=" + effectsPadding + ")" : "bottom top-=" + effectsPadding; 6520 }, 6521 scroller: wrapper, 6522 scrub: true, 6523 refreshPriority: -999, 6524 // must update AFTER any other ScrollTrigger pins 6525 onRefreshInit: revert, 6526 onRefresh: updateChange, 6527 onKill: function onKill(self2) { 6528 var i = effects.indexOf(self2); 6529 i >= 0 && effects.splice(i, 1); 6530 revert(); 6531 }, 6532 onUpdate: function onUpdate(self2) { 6533 var y = startY + change * (self2.progress - progressOffset), i = pins.length, extraY = 0, pin, scrollY, end; 6534 if (self2.offset) { 6535 if (i) { 6536 scrollY = -currentY; 6537 end = self2.end; 6538 while (i--) { 6539 pin = pins[i]; 6540 if (pin.trig.isActive || scrollY >= pin.start && scrollY <= pin.end) { 6541 if (scrub) { 6542 pin.trig.progress += pin.trig.direction < 0 ? 1e-3 : -1e-3; 6543 pin.trig.update(0, 0, 1); 6544 scrub.resetTo("y", parseFloat(cache.y), -delta, true); 6545 startupPhase && scrub.progress(1); 6546 } 6547 return; 6548 } 6549 scrollY > pin.end && (extraY += pin.distance); 6550 end -= pin.distance; 6551 } 6552 y = startY + extraY + change * ((gsap.utils.clamp(self2.start, self2.end, scrollY) - self2.start - extraY) / (end - self2.start) - progressOffset); 6553 } 6554 markers.length && !autoSpeed && markers.forEach(function(setter) { 6555 return setter(y - extraY); 6556 }); 6557 y = _round3(y + yOffset); 6558 if (scrub) { 6559 scrub.resetTo("y", y, -delta, true); 6560 startupPhase && scrub.progress(1); 6561 } else { 6562 cache.y = y + "px"; 6563 cache.renderTransform(1); 6564 } 6565 } 6566 } 6567 }); 6568 updateChange(st); 6569 gsap.core.getCache(st.trigger).stRevert = revertEffects; 6570 st.startY = startY; 6571 st.pins = pins; 6572 st.markers = markers; 6573 st.ratio = ratio; 6574 st.autoSpeed = autoSpeed; 6575 el.style.willChange = "transform"; 6576 } 6577 return st; 6578 }; 6579 addOnRefresh(); 6580 ScrollTrigger.addEventListener("killAll", addOnRefresh); 6581 gsap.delayedCall(0.5, function() { 6582 return startupPhase = 0; 6583 }); 6584 this.scrollTop = scrollTop; 6585 this.scrollTo = function(target, smooth2, position) { 6586 var p = gsap.utils.clamp(0, _maxScroll2(), isNaN(target) ? _this.offset(target, position, !!smooth2 && !paused) : +target); 6587 !smooth2 ? scrollTop(p) : paused ? gsap.to(_this, { 6588 duration: smoothDuration, 6589 scrollTop: p, 6590 overwrite: "auto", 6591 ease: _expo 6592 }) : scrollFunc(p); 6593 }; 6594 this.offset = function(target, position, ignoreSpeed) { 6595 target = _toArray(target)[0]; 6596 var cssText = target.style.cssText, st = ScrollTrigger.create({ 6597 trigger: target, 6598 start: position || "top top" 6599 }), y; 6600 if (effects) { 6601 startupPhase ? ScrollTrigger.refresh() : adjustParallaxPosition([st], true); 6602 } 6603 y = st.start / (ignoreSpeed ? speed : 1); 6604 st.kill(false); 6605 target.style.cssText = cssText; 6606 gsap.core.getCache(target).uncache = 1; 6607 return y; 6608 }; 6609 function refreshHeight() { 6610 height = content.clientHeight; 6611 content.style.overflow = "visible"; 6612 _body.style.height = _win.innerHeight + (height - _win.innerHeight) / speed + "px"; 6613 return height - _win.innerHeight; 6614 } 6615 this.content = function(element) { 6616 if (arguments.length) { 6617 var newContent = _toArray(element || "#smooth-content")[0] || console.warn("ScrollSmoother needs a valid content element.") || _body.children[0]; 6618 if (newContent !== content) { 6619 content = newContent; 6620 contentCSS = content.getAttribute("style") || ""; 6621 resizeObserver && resizeObserver.observe(content); 6622 gsap.set(content, { 6623 overflow: "visible", 6624 width: "100%", 6625 boxSizing: "border-box", 6626 y: "+=0" 6627 }); 6628 smoothDuration || gsap.set(content, { 6629 clearProps: "transform" 6630 }); 6631 } 6632 return this; 6633 } 6634 return content; 6635 }; 6636 this.wrapper = function(element) { 6637 if (arguments.length) { 6638 wrapper = _toArray(element || "#smooth-wrapper")[0] || _wrap(content); 6639 wrapperCSS = wrapper.getAttribute("style") || ""; 6640 refreshHeight(); 6641 gsap.set(wrapper, smoothDuration ? { 6642 overflow: "hidden", 6643 position: "fixed", 6644 height: "100%", 6645 width: "100%", 6646 top: 0, 6647 left: 0, 6648 right: 0, 6649 bottom: 0 6650 } : { 6651 overflow: "visible", 6652 position: "relative", 6653 width: "100%", 6654 height: "auto", 6655 top: "auto", 6656 bottom: "auto", 6657 left: "auto", 6658 right: "auto" 6659 }); 6660 return this; 6661 } 6662 return wrapper; 6663 }; 6664 this.effects = function(targets, config3) { 6665 var _effects2; 6666 effects || (effects = []); 6667 if (!targets) { 6668 return effects.slice(0); 6669 } 6670 targets = _toArray(targets);
vendor: 4,865 bytes, lines 6671-6812
6671 targets.forEach(function(target) { 6672 var i2 = effects.length; 6673 while (i2--) { 6674 effects[i2].trigger === target && effects[i2].kill(); 6675 } 6676 }); 6677 config3 = config3 || {}; 6678 var _config2 = config3, speed2 = _config2.speed, lag = _config2.lag, effectsPadding = _config2.effectsPadding, effectsToAdd = [], i, st; 6679 for (i = 0; i < targets.length; i++) { 6680 st = createEffect(targets[i], speed2, lag, i, effectsPadding); 6681 st && effectsToAdd.push(st); 6682 } 6683 (_effects2 = effects).push.apply(_effects2, effectsToAdd); 6684 config3.refresh !== false && ScrollTrigger.refresh(); 6685 return effectsToAdd; 6686 }; 6687 this.sections = function(targets, config3) { 6688 var _sections; 6689 sections || (sections = []); 6690 if (!targets) { 6691 return sections.slice(0); 6692 } 6693 var newSections = _toArray(targets).map(function(el) { 6694 return ScrollTrigger.create({ 6695 trigger: el, 6696 start: "top 120%", 6697 end: "bottom -20%", 6698 onToggle: function onToggle(self2) { 6699 el.style.opacity = self2.isActive ? "1" : "0"; 6700 el.style.pointerEvents = self2.isActive ? "all" : "none"; 6701 } 6702 }); 6703 }); 6704 config3 && config3.add ? (_sections = sections).push.apply(_sections, newSections) : sections = newSections.slice(0); 6705 return newSections; 6706 }; 6707 this.content(vars.content); 6708 this.wrapper(vars.wrapper); 6709 this.render = function(y) { 6710 return render3(y || y === 0 ? y : currentY); 6711 }; 6712 this.getVelocity = function() { 6713 return tracker.getVelocity(-currentY); 6714 }; 6715 ScrollTrigger.scrollerProxy(wrapper, { 6716 scrollTop, 6717 scrollHeight: function scrollHeight() { 6718 return refreshHeight() && _body.scrollHeight; 6719 }, 6720 fixedMarkers: vars.fixedMarkers !== false && !!smoothDuration, 6721 content, 6722 getBoundingClientRect: function getBoundingClientRect() { 6723 return { 6724 top: 0, 6725 left: 0, 6726 width: _win.innerWidth, 6727 height: _win.innerHeight 6728 }; 6729 } 6730 }); 6731 ScrollTrigger.defaults({ 6732 scroller: wrapper 6733 }); 6734 var existingScrollTriggers = ScrollTrigger.getAll().filter(function(st) { 6735 return st.scroller === _win || st.scroller === wrapper; 6736 }); 6737 existingScrollTriggers.forEach(function(st) { 6738 return st.revert(true, true); 6739 }); 6740 mainST = ScrollTrigger.create({ 6741 animation: gsap.fromTo(scroll, { 6742 y: function y() { 6743 allowUpdates = 0; 6744 return 0; 6745 } 6746 }, { 6747 y: function y() { 6748 allowUpdates = 1; 6749 return -refreshHeight(); 6750 }, 6751 immediateRender: false, 6752 ease: "none", 6753 data: "ScrollSmoother", 6754 duration: 100, 6755 // for added precision 6756 onUpdate: function onUpdate() { 6757 if (allowUpdates) { 6758 var force = isProxyScrolling; 6759 if (force) { 6760 killScrub(mainST); 6761 scroll.y = currentY; 6762 } 6763 render3(scroll.y, force); 6764 updateVelocity(); 6765 _onUpdate && !paused && _onUpdate(self); 6766 } 6767 } 6768 }), 6769 onRefreshInit: function onRefreshInit(self2) { 6770 if (ScrollSmoother2.isRefreshing) { 6771 return; 6772 } 6773 ScrollSmoother2.isRefreshing = true; 6774 if (effects) { 6775 var _pins = ScrollTrigger.getAll().filter(function(st) { 6776 return !!st.pin; 6777 }); 6778 effects.forEach(function(st) { 6779 if (!st.vars.pinnedContainer) { 6780 _pins.forEach(function(pinST) { 6781 if (pinST.pin.contains(st.trigger)) { 6782 var v = st.vars; 6783 v.pinnedContainer = pinST.pin; 6784 st.vars = null; 6785 st.init(v, st.animation); 6786 } 6787 }); 6788 } 6789 }); 6790 } 6791 var scrub = self2.getTween(); 6792 recordedRefreshScrub = scrub && scrub._end > scrub._dp._time; 6793 recordedRefreshScroll = currentY; 6794 scroll.y = 0; 6795 if (smoothDuration) { 6796 ScrollTrigger.isTouch === 1 && (wrapper.style.position = "absolute"); 6797 wrapper.scrollTop = 0; 6798 ScrollTrigger.isTouch === 1 && (wrapper.style.position = "fixed"); 6799 } 6800 }, 6801 onRefresh: function onRefresh2(self2) { 6802 self2.animation.invalidate(); 6803 self2.setPositions(self2.start, refreshHeight() / speed); 6804 recordedRefreshScrub || killScrub(self2); 6805 scroll.y = -scrollFunc() * speed; 6806 render3(scroll.y); 6807 if (!startupPhase) { 6808 recordedRefreshScrub && (isProxyScrolling = false); 6809 self2.animation.progress(gsap.utils.clamp(0, 1, recordedRefreshScroll / speed / -self2.end)); 6810 } 6811 if (recordedRefreshScrub) { 6812 self2.progress -= 1e-3;
vendor: 6,547 bytes, lines 6813-6991
6813 self2.update(); 6814 } 6815 ScrollSmoother2.isRefreshing = false; 6816 }, 6817 id: "ScrollSmoother", 6818 scroller: _win, 6819 invalidateOnRefresh: true, 6820 start: 0, 6821 refreshPriority: -9999, 6822 // because all other pins, etc. should be calculated first before this figures out the height of the body. BUT this should also update FIRST so that the scroll position on the proxy is up-to-date when all the ScrollTriggers calculate their progress! -9999 is a special number that ScrollTrigger looks for to handle in this way. 6823 end: function end() { 6824 return refreshHeight() / speed; 6825 }, 6826 onScrubComplete: function onScrubComplete() { 6827 tracker.reset(); 6828 onStop && onStop(_this); 6829 }, 6830 scrub: smoothDuration || true 6831 }); 6832 this.smooth = function(value) { 6833 if (arguments.length) { 6834 smoothDuration = value || 0; 6835 speed = smoothDuration && +vars.speed || 1; 6836 mainST.scrubDuration(value); 6837 } 6838 return mainST.getTween() ? mainST.getTween().duration() : 0; 6839 }; 6840 mainST.getTween() && (mainST.getTween().vars.ease = vars.ease || _expo); 6841 this.scrollTrigger = mainST; 6842 vars.effects && this.effects(vars.effects === true ? "[data-" + effectsPrefix + "speed], [data-" + effectsPrefix + "lag]" : vars.effects, { 6843 effectsPadding: vars.effectsPadding, 6844 refresh: false 6845 }); 6846 vars.sections && this.sections(vars.sections === true ? "[data-section]" : vars.sections); 6847 existingScrollTriggers.forEach(function(st) { 6848 st.vars.scroller = wrapper; 6849 st.revert(false, true); 6850 st.init(st.vars, st.animation); 6851 }); 6852 this.paused = function(value, allowNestedScroll) { 6853 if (arguments.length) { 6854 if (!!paused !== value) { 6855 if (value) { 6856 mainST.getTween() && mainST.getTween().pause(); 6857 scrollFunc(-currentY / speed); 6858 tracker.reset(); 6859 pausedNormalizer = ScrollTrigger.normalizeScroll(); 6860 pausedNormalizer && pausedNormalizer.disable(); 6861 paused = ScrollTrigger.observe({ 6862 preventDefault: true, 6863 type: "wheel,touch,scroll", 6864 debounce: false, 6865 allowClicks: true, 6866 onChangeY: function onChangeY() { 6867 return scrollTop(-currentY); 6868 } 6869 // refuse to scroll 6870 }); 6871 paused.nested = _inputObserver2(_docEl, "wheel,touch,scroll", true, allowNestedScroll !== false); 6872 } else { 6873 paused.nested.kill(); 6874 paused.kill(); 6875 paused = 0; 6876 pausedNormalizer && pausedNormalizer.enable(); 6877 mainST.progress = (-currentY / speed - mainST.start) / (mainST.end - mainST.start); 6878 killScrub(mainST); 6879 } 6880 } 6881 return this; 6882 } 6883 return !!paused; 6884 }; 6885 this.kill = this.revert = function() { 6886 _this.paused(false); 6887 killScrub(mainST); 6888 mainST.kill(); 6889 var triggers = (effects || []).concat(sections || []), i = triggers.length; 6890 while (i--) { 6891 triggers[i].kill(); 6892 } 6893 ScrollTrigger.scrollerProxy(wrapper); 6894 ScrollTrigger.removeEventListener("killAll", addOnRefresh); 6895 ScrollTrigger.removeEventListener("refresh", onRefresh); 6896 wrapper.style.cssText = wrapperCSS; 6897 content.style.cssText = contentCSS; 6898 var defaults2 = ScrollTrigger.defaults({}); 6899 defaults2 && defaults2.scroller === wrapper && ScrollTrigger.defaults({ 6900 scroller: _win 6901 }); 6902 _this.normalizer && ScrollTrigger.normalizeScroll(false); 6903 clearInterval(intervalID); 6904 _mainInstance = null; 6905 resizeObserver && resizeObserver.disconnect(); 6906 _body.style.removeProperty("height"); 6907 _win.removeEventListener("focusin", _onFocusIn); 6908 }; 6909 this.refresh = function(soft, force) { 6910 return mainST.refresh(soft, force); 6911 }; 6912 if (normalizeScroll) { 6913 this.normalizer = ScrollTrigger.normalizeScroll(normalizeScroll === true ? { 6914 debounce: true, 6915 content: !smoothDuration && content 6916 } : normalizeScroll); 6917 } 6918 ScrollTrigger.config(vars); 6919 "overscrollBehavior" in _win.getComputedStyle(_body) && gsap.set([_body, _docEl], { 6920 overscrollBehavior: "none" 6921 }); 6922 "scrollBehavior" in _win.getComputedStyle(_body) && gsap.set([_body, _docEl], { 6923 scrollBehavior: "auto" 6924 }); 6925 _win.addEventListener("focusin", _onFocusIn); 6926 intervalID = setInterval(updateVelocity, 250); 6927 _doc.readyState === "loading" || requestAnimationFrame(function() { 6928 return ScrollTrigger.refresh(); 6929 }); 6930 } 6931 ScrollSmoother2.register = function register(core) { 6932 if (!_coreInitted) { 6933 gsap = core || _getGSAP3(); 6934 if (_windowExists4() && window.document) { 6935 _win = window; 6936 _doc = document; 6937 _docEl = _doc.documentElement; 6938 _body = _doc.body; 6939 } 6940 if (gsap) { 6941 _toArray = gsap.utils.toArray; 6942 _clamp2 = gsap.utils.clamp; 6943 _expo = gsap.parseEase("expo"); 6944 _context = gsap.core.context || function() { 6945 }; 6946 ScrollTrigger = gsap.core.globals().ScrollTrigger; 6947 gsap.core.globals("ScrollSmoother", ScrollSmoother2); 6948 if (_body && ScrollTrigger) { 6949 _onResizeDelayedCall = gsap.delayedCall(0.2, function() { 6950 return ScrollTrigger.isRefreshing || _mainInstance && _mainInstance.refresh(); 6951 }).pause(); 6952 _getVelocityProp2 = ScrollTrigger.core._getVelocityProp; 6953 _inputObserver2 = ScrollTrigger.core._inputObserver; 6954 ScrollSmoother2.refresh = ScrollTrigger.refresh; 6955 _coreInitted = 1; 6956 } 6957 } 6958 } 6959 return _coreInitted; 6960 }; 6961 _createClass(ScrollSmoother2, [{ 6962 key: "progress", 6963 get: function get() { 6964 return this.scrollTrigger ? this.scrollTrigger.animation._time / 100 : 0; 6965 } 6966 }]); 6967 return ScrollSmoother2; 6968}(); 6969ScrollSmoother.version = "3.12.5"; 6970ScrollSmoother.create = function(vars) { 6971 return _mainInstance && vars && _mainInstance.content() === _toArray(vars.content)[0] ? _mainInstance : new ScrollSmoother(vars); 6972}; 6973ScrollSmoother.get = function() { 6974 return _mainInstance; 6975}; 6976_getGSAP3() && gsap.registerPlugin(ScrollSmoother); 6977var gsapWithCSS = gsap$3.registerPlugin(CSSPlugin) || gsap$3; 6978gsapWithCSS.core.Tween; 6979export { 6980 Back as B, 6981 CSSPlugin as C, 6982 Power3 as P, 6983 ScrollTrigger$1 as S, 6984 gsap$3 as a, 6985 Power0 as b, 6986 Power2 as c, 6987 Power1 as d, 6988 ScrollSmoother as e, 6989 gsapWithCSS as g, 6990 screen as s 6991};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.