vendor: 4,076 bytes, lines 1-86
1function _assertThisInitialized(self) { 2 if (self === void 0) { 3 throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); 4 } 5 return self; 6} 7function _inheritsLoose(subClass, superClass) { 8 subClass.prototype = Object.create(superClass.prototype); 9 subClass.prototype.constructor = subClass; 10 subClass.__proto__ = superClass; 11} 12/*! 13 * GSAP 3.12.5 14 * https://gsap.com 15 * 16 * @license Copyright 2008-2024, GreenSock. All rights reserved. 17 * Subject to the terms at https://gsap.com/standard-license or for 18 * Club GSAP members, the agreement issued with that membership. 19 * @author: Jack Doyle, [email protected] 20*/ 21var _config = { 22 autoSleep: 120, 23 force3D: "auto", 24 nullTargetWarn: 1, 25 units: { 26 lineHeight: "" 27 } 28}, _defaults = { 29 duration: 0.5, 30 overwrite: false, 31 delay: 0 32}, _suppressOverwrites, _reverting$1, _context, _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 = function _isString2(value) { 33 return typeof value === "string"; 34}, _isFunction = function _isFunction2(value) { 35 return typeof value === "function"; 36}, _isNumber = function _isNumber2(value) { 37 return typeof value === "number"; 38}, _isUndefined = function _isUndefined2(value) { 39 return typeof value === "undefined"; 40}, _isObject = function _isObject2(value) { 41 return typeof value === "object"; 42}, _isNotFalse = function _isNotFalse2(value) { 43 return value !== false; 44}, _windowExists$1 = function _windowExists() { 45 return typeof window !== "undefined"; 46}, _isFuncOrString = function _isFuncOrString2(value) { 47 return _isFunction(value) || _isString(value); 48}, _isTypedArray = typeof ArrayBuffer === "function" && ArrayBuffer.isView || function() { 49}, _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$1, _coreInitted, _doc$1, _globals = {}, _installScope = {}, _coreReady, _install = function _install2(scope) { 50 return (_installScope = _merge(scope, _globals)) && gsap; 51}, _missingPlugin = function _missingPlugin2(property, value) { 52 return console.warn("Invalid property", property, "set to", value, "Missing plugin? gsap.registerPlugin()"); 53}, _warn = function _warn2(message, suppress) { 54 return !suppress && console.warn(message); 55}, _addGlobal = function _addGlobal2(name, obj) { 56 return name && (_globals[name] = obj) && _installScope && (_installScope[name] = obj) || _globals; 57}, _emptyFunc = function _emptyFunc2() { 58 return 0; 59}, _startAtRevertConfig = { 60 suppressEvents: true, 61 isStart: true, 62 kill: false 63}, _revertConfigNoKill = { 64 suppressEvents: true, 65 kill: false 66}, _revertConfig = { 67 suppressEvents: true 68}, _reservedProps = {}, _lazyTweens = [], _lazyLookup = {}, _lastRenderedFrame, _plugins = {}, _effects = {}, _nextGCFrame = 30, _harnessPlugins = [], _callbackNames = "", _harness = function _harness2(targets) { 69 var target = targets[0], harnessPlugin, i; 70 _isObject(target) || _isFunction(target) || (targets = [targets]); 71 if (!(harnessPlugin = (target._gsap || {}).harness)) { 72 i = _harnessPlugins.length; 73 while (i-- && !_harnessPlugins[i].targetTest(target)) { 74 } 75 harnessPlugin = _harnessPlugins[i]; 76 } 77 i = targets.length; 78 while (i--) { 79 targets[i] && (targets[i]._gsap || (targets[i]._gsap = new GSCache(targets[i], harnessPlugin))) || targets.splice(i, 1); 80 } 81 return targets; 82}, _getCache = function _getCache2(target) { 83 return target._gsap || _harness(toArray(target))[0]._gsap; 84}, _getProperty = function _getProperty2(target, property, v) { 85 return (v = target[property]) && _isFunction(v) ? target[property]() : _isUndefined(v) && target.getAttribute && target.getAttribute(property) || v; 86}, _forEachName = function _forEachName2(names, func) {
vendor: 20,423 bytes, lines 87-527
87 return (names = names.split(",")).forEach(func) || names; 88}, _round = function _round2(value) { 89 return Math.round(value * 1e5) / 1e5 || 0; 90}, _roundPrecise = function _roundPrecise2(value) { 91 return Math.round(value * 1e7) / 1e7 || 0; 92}, _parseRelative = function _parseRelative2(start, value) { 93 var operator = value.charAt(0), end = parseFloat(value.substr(2)); 94 start = parseFloat(start); 95 return operator === "+" ? start + end : operator === "-" ? start - end : operator === "*" ? start * end : start / end; 96}, _arrayContainsAny = function _arrayContainsAny2(toSearch, toFind) { 97 var l = toFind.length, i = 0; 98 for (; toSearch.indexOf(toFind[i]) < 0 && ++i < l; ) { 99 } 100 return i < l; 101}, _lazyRender = function _lazyRender2() { 102 var l = _lazyTweens.length, a = _lazyTweens.slice(0), i, tween; 103 _lazyLookup = {}; 104 _lazyTweens.length = 0; 105 for (i = 0; i < l; i++) { 106 tween = a[i]; 107 tween && tween._lazy && (tween.render(tween._lazy[0], tween._lazy[1], true)._lazy = 0); 108 } 109}, _lazySafeRender = function _lazySafeRender2(animation, time, suppressEvents, force) { 110 _lazyTweens.length && !_reverting$1 && _lazyRender(); 111 animation.render(time, suppressEvents, force || _reverting$1 && time < 0 && (animation._initted || animation._startAt)); 112 _lazyTweens.length && !_reverting$1 && _lazyRender(); 113}, _numericIfPossible = function _numericIfPossible2(value) { 114 var n = parseFloat(value); 115 return (n || n === 0) && (value + "").match(_delimitedValueExp).length < 2 ? n : _isString(value) ? value.trim() : value; 116}, _passThrough = function _passThrough2(p) { 117 return p; 118}, _setDefaults = function _setDefaults2(obj, defaults2) { 119 for (var p in defaults2) { 120 p in obj || (obj[p] = defaults2[p]); 121 } 122 return obj; 123}, _setKeyframeDefaults = function _setKeyframeDefaults2(excludeDuration) { 124 return function(obj, defaults2) { 125 for (var p in defaults2) { 126 p in obj || p === "duration" && excludeDuration || p === "ease" || (obj[p] = defaults2[p]); 127 } 128 }; 129}, _merge = function _merge2(base, toMerge) { 130 for (var p in toMerge) { 131 base[p] = toMerge[p]; 132 } 133 return base; 134}, _mergeDeep = function _mergeDeep2(base, toMerge) { 135 for (var p in toMerge) { 136 p !== "__proto__" && p !== "constructor" && p !== "prototype" && (base[p] = _isObject(toMerge[p]) ? _mergeDeep2(base[p] || (base[p] = {}), toMerge[p]) : toMerge[p]); 137 } 138 return base; 139}, _copyExcluding = function _copyExcluding2(obj, excluding) { 140 var copy = {}, p; 141 for (p in obj) { 142 p in excluding || (copy[p] = obj[p]); 143 } 144 return copy; 145}, _inheritDefaults = function _inheritDefaults2(vars) { 146 var parent = vars.parent || _globalTimeline, func = vars.keyframes ? _setKeyframeDefaults(_isArray(vars.keyframes)) : _setDefaults; 147 if (_isNotFalse(vars.inherit)) { 148 while (parent) { 149 func(vars, parent.vars.defaults); 150 parent = parent.parent || parent._dp; 151 } 152 } 153 return vars; 154}, _arraysMatch = function _arraysMatch2(a1, a2) { 155 var i = a1.length, match = i === a2.length; 156 while (match && i-- && a1[i] === a2[i]) { 157 } 158 return i < 0; 159}, _addLinkedListItem = function _addLinkedListItem2(parent, child, firstProp, lastProp, sortBy) { 160 if (firstProp === void 0) { 161 firstProp = "_first"; 162 } 163 if (lastProp === void 0) { 164 lastProp = "_last"; 165 } 166 var prev = parent[lastProp], t; 167 if (sortBy) { 168 t = child[sortBy]; 169 while (prev && prev[sortBy] > t) { 170 prev = prev._prev; 171 } 172 } 173 if (prev) { 174 child._next = prev._next; 175 prev._next = child; 176 } else { 177 child._next = parent[firstProp]; 178 parent[firstProp] = child; 179 } 180 if (child._next) { 181 child._next._prev = child; 182 } else { 183 parent[lastProp] = child; 184 } 185 child._prev = prev; 186 child.parent = child._dp = parent; 187 return child; 188}, _removeLinkedListItem = function _removeLinkedListItem2(parent, child, firstProp, lastProp) { 189 if (firstProp === void 0) { 190 firstProp = "_first"; 191 } 192 if (lastProp === void 0) { 193 lastProp = "_last"; 194 } 195 var prev = child._prev, next = child._next; 196 if (prev) { 197 prev._next = next; 198 } else if (parent[firstProp] === child) { 199 parent[firstProp] = next; 200 } 201 if (next) { 202 next._prev = prev; 203 } else if (parent[lastProp] === child) { 204 parent[lastProp] = prev; 205 } 206 child._next = child._prev = child.parent = null; 207}, _removeFromParent = function _removeFromParent2(child, onlyIfParentHasAutoRemove) { 208 child.parent && (!onlyIfParentHasAutoRemove || child.parent.autoRemoveChildren) && child.parent.remove && child.parent.remove(child); 209 child._act = 0; 210}, _uncache = function _uncache2(animation, child) { 211 if (animation && (!child || child._end > animation._dur || child._start < 0)) { 212 var a = animation; 213 while (a) { 214 a._dirty = 1; 215 a = a.parent; 216 } 217 } 218 return animation; 219}, _recacheAncestors = function _recacheAncestors2(animation) { 220 var parent = animation.parent; 221 while (parent && parent.parent) { 222 parent._dirty = 1; 223 parent.totalDuration(); 224 parent = parent.parent; 225 } 226 return animation; 227}, _rewindStartAt = function _rewindStartAt2(tween, totalTime, suppressEvents, force) { 228 return tween._startAt && (_reverting$1 ? tween._startAt.revert(_revertConfigNoKill) : tween.vars.immediateRender && !tween.vars.autoRevert || tween._startAt.render(totalTime, true, force)); 229}, _hasNoPausedAncestors = function _hasNoPausedAncestors2(animation) { 230 return !animation || animation._ts && _hasNoPausedAncestors2(animation.parent); 231}, _elapsedCycleDuration = function _elapsedCycleDuration2(animation) { 232 return animation._repeat ? _animationCycle(animation._tTime, animation = animation.duration() + animation._rDelay) * animation : 0; 233}, _animationCycle = function _animationCycle2(tTime, cycleDuration) { 234 var whole = Math.floor(tTime /= cycleDuration); 235 return tTime && whole === tTime ? whole - 1 : whole; 236}, _parentToChildTotalTime = function _parentToChildTotalTime2(parentTime, child) { 237 return (parentTime - child._start) * child._ts + (child._ts >= 0 ? 0 : child._dirty ? child.totalDuration() : child._tDur); 238}, _setEnd = function _setEnd2(animation) { 239 return animation._end = _roundPrecise(animation._start + (animation._tDur / Math.abs(animation._ts || animation._rts || _tinyNum) || 0)); 240}, _alignPlayhead = function _alignPlayhead2(animation, totalTime) { 241 var parent = animation._dp; 242 if (parent && parent.smoothChildTiming && animation._ts) { 243 animation._start = _roundPrecise(parent._time - (animation._ts > 0 ? totalTime / animation._ts : ((animation._dirty ? animation.totalDuration() : animation._tDur) - totalTime) / -animation._ts)); 244 _setEnd(animation); 245 parent._dirty || _uncache(parent, animation); 246 } 247 return animation; 248}, _postAddChecks = function _postAddChecks2(timeline2, child) { 249 var t; 250 if (child._time || !child._dur && child._initted || child._start < timeline2._time && (child._dur || !child.add)) { 251 t = _parentToChildTotalTime(timeline2.rawTime(), child); 252 if (!child._dur || _clamp(0, child.totalDuration(), t) - child._tTime > _tinyNum) { 253 child.render(t, true); 254 } 255 } 256 if (_uncache(timeline2, child)._dp && timeline2._initted && timeline2._time >= timeline2._dur && timeline2._ts) { 257 if (timeline2._dur < timeline2.duration()) { 258 t = timeline2; 259 while (t._dp) { 260 t.rawTime() >= 0 && t.totalTime(t._tTime); 261 t = t._dp; 262 } 263 } 264 timeline2._zTime = -_tinyNum; 265 } 266}, _addToTimeline = function _addToTimeline2(timeline2, child, position, skipChecks) { 267 child.parent && _removeFromParent(child); 268 child._start = _roundPrecise((_isNumber(position) ? position : position || timeline2 !== _globalTimeline ? _parsePosition(timeline2, position, child) : timeline2._time) + child._delay); 269 child._end = _roundPrecise(child._start + (child.totalDuration() / Math.abs(child.timeScale()) || 0)); 270 _addLinkedListItem(timeline2, child, "_first", "_last", timeline2._sort ? "_start" : 0); 271 _isFromOrFromStart(child) || (timeline2._recent = child); 272 skipChecks || _postAddChecks(timeline2, child); 273 timeline2._ts < 0 && _alignPlayhead(timeline2, timeline2._tTime); 274 return timeline2; 275}, _scrollTrigger = function _scrollTrigger2(animation, trigger) { 276 return (_globals.ScrollTrigger || _missingPlugin("scrollTrigger", trigger)) && _globals.ScrollTrigger.create(trigger, animation); 277}, _attemptInitTween = function _attemptInitTween2(tween, time, force, suppressEvents, tTime) { 278 _initTween(tween, time, tTime); 279 if (!tween._initted) { 280 return 1; 281 } 282 if (!force && tween._pt && !_reverting$1 && (tween._dur && tween.vars.lazy !== false || !tween._dur && tween.vars.lazy) && _lastRenderedFrame !== _ticker.frame) { 283 _lazyTweens.push(tween); 284 tween._lazy = [tTime, suppressEvents]; 285 return 1; 286 } 287}, _parentPlayheadIsBeforeStart = function _parentPlayheadIsBeforeStart2(_ref) { 288 var parent = _ref.parent; 289 return parent && parent._ts && parent._initted && !parent._lock && (parent.rawTime() < 0 || _parentPlayheadIsBeforeStart2(parent)); 290}, _isFromOrFromStart = function _isFromOrFromStart2(_ref2) { 291 var data = _ref2.data; 292 return data === "isFromStart" || data === "isStart"; 293}, _renderZeroDurationTween = function _renderZeroDurationTween2(tween, totalTime, suppressEvents, force) { 294 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; 295 if (repeatDelay && tween._repeat) { 296 tTime = _clamp(0, tween._tDur, totalTime); 297 iteration = _animationCycle(tTime, repeatDelay); 298 tween._yoyo && iteration & 1 && (ratio = 1 - ratio); 299 if (iteration !== _animationCycle(tween._tTime, repeatDelay)) { 300 prevRatio = 1 - ratio; 301 tween.vars.repeatRefresh && tween._initted && tween.invalidate(); 302 } 303 } 304 if (ratio !== prevRatio || _reverting$1 || force || tween._zTime === _tinyNum || !totalTime && tween._zTime) { 305 if (!tween._initted && _attemptInitTween(tween, totalTime, force, suppressEvents, tTime)) { 306 return; 307 } 308 prevIteration = tween._zTime; 309 tween._zTime = totalTime || (suppressEvents ? _tinyNum : 0); 310 suppressEvents || (suppressEvents = totalTime && !prevIteration); 311 tween.ratio = ratio; 312 tween._from && (ratio = 1 - ratio); 313 tween._time = 0; 314 tween._tTime = tTime; 315 pt = tween._pt; 316 while (pt) { 317 pt.r(ratio, pt.d); 318 pt = pt._next; 319 } 320 totalTime < 0 && _rewindStartAt(tween, totalTime, suppressEvents, true); 321 tween._onUpdate && !suppressEvents && _callback(tween, "onUpdate"); 322 tTime && tween._repeat && !suppressEvents && tween.parent && _callback(tween, "onRepeat"); 323 if ((totalTime >= tween._tDur || totalTime < 0) && tween.ratio === ratio) { 324 ratio && _removeFromParent(tween, 1); 325 if (!suppressEvents && !_reverting$1) { 326 _callback(tween, ratio ? "onComplete" : "onReverseComplete", true); 327 tween._prom && tween._prom(); 328 } 329 } 330 } else if (!tween._zTime) { 331 tween._zTime = totalTime; 332 } 333}, _findNextPauseTween = function _findNextPauseTween2(animation, prevTime, time) { 334 var child; 335 if (time > prevTime) { 336 child = animation._first; 337 while (child && child._start <= time) { 338 if (child.data === "isPause" && child._start > prevTime) { 339 return child; 340 } 341 child = child._next; 342 } 343 } else { 344 child = animation._last; 345 while (child && child._start >= time) { 346 if (child.data === "isPause" && child._start < prevTime) { 347 return child; 348 } 349 child = child._prev; 350 } 351 } 352}, _setDuration = function _setDuration2(animation, duration, skipUncache, leavePlayhead) { 353 var repeat = animation._repeat, dur = _roundPrecise(duration) || 0, totalProgress = animation._tTime / animation._tDur; 354 totalProgress && !leavePlayhead && (animation._time *= dur / animation._dur); 355 animation._dur = dur; 356 animation._tDur = !repeat ? dur : repeat < 0 ? 1e10 : _roundPrecise(dur * (repeat + 1) + animation._rDelay * repeat); 357 totalProgress > 0 && !leavePlayhead && _alignPlayhead(animation, animation._tTime = animation._tDur * totalProgress); 358 animation.parent && _setEnd(animation); 359 skipUncache || _uncache(animation.parent, animation); 360 return animation; 361}, _onUpdateTotalDuration = function _onUpdateTotalDuration2(animation) { 362 return animation instanceof Timeline ? _uncache(animation) : _setDuration(animation, animation._dur); 363}, _zeroPosition = { 364 _start: 0, 365 endTime: _emptyFunc, 366 totalDuration: _emptyFunc 367}, _parsePosition = function _parsePosition2(animation, position, percentAnimation) { 368 var labels = animation.labels, recent = animation._recent || _zeroPosition, clippedDuration = animation.duration() >= _bigNum$1 ? recent.endTime(false) : animation._dur, i, offset, isPercent; 369 if (_isString(position) && (isNaN(position) || position in labels)) { 370 offset = position.charAt(0); 371 isPercent = position.substr(-1) === "%"; 372 i = position.indexOf("="); 373 if (offset === "<" || offset === ">") { 374 i >= 0 && (position = position.replace(/=/, "")); 375 return (offset === "<" ? recent._start : recent.endTime(recent._repeat >= 0)) + (parseFloat(position.substr(1)) || 0) * (isPercent ? (i < 0 ? recent : percentAnimation).totalDuration() / 100 : 1); 376 } 377 if (i < 0) { 378 position in labels || (labels[position] = clippedDuration); 379 return labels[position]; 380 } 381 offset = parseFloat(position.charAt(i - 1) + position.substr(i + 1)); 382 if (isPercent && percentAnimation) { 383 offset = offset / 100 * (_isArray(percentAnimation) ? percentAnimation[0] : percentAnimation).totalDuration(); 384 } 385 return i > 1 ? _parsePosition2(animation, position.substr(0, i - 1), percentAnimation) + offset : clippedDuration + offset; 386 } 387 return position == null ? clippedDuration : +position; 388}, _createTweenType = function _createTweenType2(type, params, timeline2) { 389 var isLegacy = _isNumber(params[1]), varsIndex = (isLegacy ? 2 : 1) + (type < 2 ? 0 : 1), vars = params[varsIndex], irVars, parent; 390 isLegacy && (vars.duration = params[1]); 391 vars.parent = timeline2; 392 if (type) { 393 irVars = vars; 394 parent = timeline2; 395 while (parent && !("immediateRender" in irVars)) { 396 irVars = parent.vars.defaults || {}; 397 parent = _isNotFalse(parent.vars.inherit) && parent.parent; 398 } 399 vars.immediateRender = _isNotFalse(irVars.immediateRender); 400 type < 2 ? vars.runBackwards = 1 : vars.startAt = params[varsIndex - 1]; 401 } 402 return new Tween(params[0], vars, params[varsIndex + 1]); 403}, _conditionalReturn = function _conditionalReturn2(value, func) { 404 return value || value === 0 ? func(value) : func; 405}, _clamp = function _clamp2(min, max, value) { 406 return value < min ? min : value > max ? max : value; 407}, getUnit = function getUnit2(value, v) { 408 return !_isString(value) || !(v = _unitExp.exec(value)) ? "" : v[1]; 409}, clamp = function clamp2(min, max, value) { 410 return _conditionalReturn(value, function(v) { 411 return _clamp(min, max, v); 412 }); 413}, _slice = [].slice, _isArrayLike = function _isArrayLike2(value, nonEmpty) { 414 return value && _isObject(value) && "length" in value && (!nonEmpty && !value.length || value.length - 1 in value && _isObject(value[0])) && !value.nodeType && value !== _win$1; 415}, _flatten = function _flatten2(ar, leaveStrings, accumulator) { 416 if (accumulator === void 0) { 417 accumulator = []; 418 } 419 return ar.forEach(function(value) { 420 var _accumulator; 421 return _isString(value) && !leaveStrings || _isArrayLike(value, 1) ? (_accumulator = accumulator).push.apply(_accumulator, toArray(value)) : accumulator.push(value); 422 }) || accumulator; 423}, toArray = function toArray2(value, scope, leaveStrings) { 424 return _context && !scope && _context.selector ? _context.selector(value) : _isString(value) && !leaveStrings && (_coreInitted || !_wake()) ? _slice.call((scope || _doc$1).querySelectorAll(value), 0) : _isArray(value) ? _flatten(value, leaveStrings) : _isArrayLike(value) ? _slice.call(value, 0) : value ? [value] : []; 425}, selector = function selector2(value) { 426 value = toArray(value)[0] || _warn("Invalid scope") || {}; 427 return function(v) { 428 var el = value.current || value.nativeElement || value; 429 return toArray(v, el.querySelectorAll ? el : el === value ? _warn("Invalid scope") || _doc$1.createElement("div") : value); 430 }; 431}, shuffle = function shuffle2(a) { 432 return a.sort(function() { 433 return 0.5 - Math.random(); 434 }); 435}, distribute = function distribute2(v) { 436 if (_isFunction(v)) { 437 return v; 438 } 439 var vars = _isObject(v) ? v : { 440 each: v 441 }, 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; 442 if (_isString(from)) { 443 ratioX = ratioY = { 444 center: 0.5, 445 edges: 0.5, 446 end: 1 447 }[from] || 0; 448 } else if (!isDecimal && ratios) { 449 ratioX = from[0]; 450 ratioY = from[1]; 451 } 452 return function(i, target, a) { 453 var l = (a || vars).length, distances = cache[l], originX, originY, x, y, d, j, max, min, wrapAt; 454 if (!distances) { 455 wrapAt = vars.grid === "auto" ? 0 : (vars.grid || [1, _bigNum$1])[1]; 456 if (!wrapAt) { 457 max = -_bigNum$1; 458 while (max < (max = a[wrapAt++].getBoundingClientRect().left) && wrapAt < l) { 459 } 460 wrapAt < l && wrapAt--; 461 } 462 distances = cache[l] = []; 463 originX = ratios ? Math.min(wrapAt, l) * ratioX - 0.5 : from % wrapAt; 464 originY = wrapAt === _bigNum$1 ? 0 : ratios ? l * ratioY / wrapAt - 0.5 : from / wrapAt | 0; 465 max = 0; 466 min = _bigNum$1; 467 for (j = 0; j < l; j++) { 468 x = j % wrapAt - originX; 469 y = originY - (j / wrapAt | 0); 470 distances[j] = d = !axis ? _sqrt(x * x + y * y) : Math.abs(axis === "y" ? y : x); 471 d > max && (max = d); 472 d < min && (min = d); 473 } 474 from === "random" && shuffle(distances); 475 distances.max = max - min; 476 distances.min = min; 477 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); 478 distances.b = l < 0 ? base - l : base; 479 distances.u = getUnit(vars.amount || vars.each) || 0; 480 ease = ease && l < 0 ? _invertEase(ease) : ease; 481 } 482 l = (distances[i] - distances.min) / distances.max || 0; 483 return _roundPrecise(distances.b + (ease ? ease(l) : l) * distances.v) + distances.u; 484 }; 485}, _roundModifier = function _roundModifier2(v) { 486 var p = Math.pow(10, ((v + "").split(".")[1] || "").length); 487 return function(raw) { 488 var n = _roundPrecise(Math.round(parseFloat(raw) / v) * v * p); 489 return (n - n % 1) / p + (_isNumber(raw) ? 0 : getUnit(raw)); 490 }; 491}, snap = function snap2(snapTo, value) { 492 var isArray = _isArray(snapTo), radius, is2D; 493 if (!isArray && _isObject(snapTo)) { 494 radius = isArray = snapTo.radius || _bigNum$1; 495 if (snapTo.values) { 496 snapTo = toArray(snapTo.values); 497 if (is2D = !_isNumber(snapTo[0])) { 498 radius *= radius; 499 } 500 } else { 501 snapTo = _roundModifier(snapTo.increment); 502 } 503 } 504 return _conditionalReturn(value, !isArray ? _roundModifier(snapTo) : _isFunction(snapTo) ? function(raw) { 505 is2D = snapTo(raw); 506 return Math.abs(is2D - raw) <= radius ? is2D : raw; 507 } : function(raw) { 508 var x = parseFloat(is2D ? raw.x : raw), y = parseFloat(is2D ? raw.y : 0), min = _bigNum$1, closest = 0, i = snapTo.length, dx, dy; 509 while (i--) { 510 if (is2D) { 511 dx = snapTo[i].x - x; 512 dy = snapTo[i].y - y; 513 dx = dx * dx + dy * dy; 514 } else { 515 dx = Math.abs(snapTo[i] - x); 516 } 517 if (dx < min) { 518 min = dx; 519 closest = i; 520 } 521 } 522 closest = !radius || min <= radius ? snapTo[closest] : raw; 523 return is2D || closest === raw || _isNumber(raw) ? closest : closest + getUnit(raw); 524 }); 525}, random = function random2(min, max, roundingIncrement, returnFunction) { 526 return _conditionalReturn(_isArray(min) ? !max : roundingIncrement === true ? !!(roundingIncrement = 0) : !returnFunction, function() { 527 return _isArray(min) ? min[~~(Math.random() * min.length)] : (roundingIncrement = roundingIncrement || 1e
vendor: 4,583 bytes, lines 527-639
527-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; 528 }); 529}, pipe = function pipe2() { 530 for (var _len = arguments.length, functions = new Array(_len), _key = 0; _key < _len; _key++) { 531 functions[_key] = arguments[_key]; 532 } 533 return function(value) { 534 return functions.reduce(function(v, f) { 535 return f(v); 536 }, value); 537 }; 538}, unitize = function unitize2(func, unit) { 539 return function(value) { 540 return func(parseFloat(value)) + (unit || getUnit(value)); 541 }; 542}, normalize = function normalize2(min, max, value) { 543 return mapRange(min, max, 0, 1, value); 544}, _wrapArray = function _wrapArray2(a, wrapper, value) { 545 return _conditionalReturn(value, function(index) { 546 return a[~~wrapper(index)]; 547 }); 548}, wrap = function wrap2(min, max, value) { 549 var range = max - min; 550 return _isArray(min) ? _wrapArray(min, wrap2(0, min.length), max) : _conditionalReturn(value, function(value2) { 551 return (range + (value2 - min) % range) % range + min; 552 }); 553}, wrapYoyo = function wrapYoyo2(min, max, value) { 554 var range = max - min, total = range * 2; 555 return _isArray(min) ? _wrapArray(min, wrapYoyo2(0, min.length - 1), max) : _conditionalReturn(value, function(value2) { 556 value2 = (total + (value2 - min) % total) % total || 0; 557 return min + (value2 > range ? total - value2 : value2); 558 }); 559}, _replaceRandom = function _replaceRandom2(value) { 560 var prev = 0, s = "", i, nums, end, isArray; 561 while (~(i = value.indexOf("random(", prev))) { 562 end = value.indexOf(")", i); 563 isArray = value.charAt(i + 7) === "["; 564 nums = value.substr(i + 7, end - i - 7).match(isArray ? _delimitedValueExp : _strictNumExp); 565 s += value.substr(prev, i - prev) + random(isArray ? nums : +nums[0], isArray ? 0 : +nums[1], +nums[2] || 1e-5); 566 prev = end + 1; 567 } 568 return s + value.substr(prev, value.length - prev); 569}, mapRange = function mapRange2(inMin, inMax, outMin, outMax, value) { 570 var inRange = inMax - inMin, outRange = outMax - outMin; 571 return _conditionalReturn(value, function(value2) { 572 return outMin + ((value2 - inMin) / inRange * outRange || 0); 573 }); 574}, interpolate = function interpolate2(start, end, progress, mutate) { 575 var func = isNaN(start + end) ? 0 : function(p2) { 576 return (1 - p2) * start + p2 * end; 577 }; 578 if (!func) { 579 var isString = _isString(start), master = {}, p, i, interpolators, l, il; 580 progress === true && (mutate = 1) && (progress = null); 581 if (isString) { 582 start = { 583 p: start 584 }; 585 end = { 586 p: end 587 }; 588 } else if (_isArray(start) && !_isArray(end)) { 589 interpolators = []; 590 l = start.length; 591 il = l - 2; 592 for (i = 1; i < l; i++) { 593 interpolators.push(interpolate2(start[i - 1], start[i])); 594 } 595 l--; 596 func = function func2(p2) { 597 p2 *= l; 598 var i2 = Math.min(il, ~~p2); 599 return interpolators[i2](p2 - i2); 600 }; 601 progress = end; 602 } else if (!mutate) { 603 start = _merge(_isArray(start) ? [] : {}, start); 604 } 605 if (!interpolators) { 606 for (p in end) { 607 _addPropTween.call(master, start, p, "get", end[p]); 608 } 609 func = function func2(p2) { 610 return _renderPropTweens(p2, master) || (isString ? start.p : start); 611 }; 612 } 613 } 614 return _conditionalReturn(progress, func); 615}, _getLabelInDirection = function _getLabelInDirection2(timeline2, fromTime, backward) { 616 var labels = timeline2.labels, min = _bigNum$1, p, distance, label; 617 for (p in labels) { 618 distance = labels[p] - fromTime; 619 if (distance < 0 === !!backward && distance && min > (distance = Math.abs(distance))) { 620 label = p; 621 min = distance; 622 } 623 } 624 return label; 625}, _callback = function _callback2(animation, type, executeLazyFirst) { 626 var v = animation.vars, callback = v[type], prevContext = _context, context3 = animation._ctx, params, scope, result; 627 if (!callback) { 628 return; 629 } 630 params = v[type + "Params"]; 631 scope = v.callbackScope || animation; 632 executeLazyFirst && _lazyTweens.length && _lazyRender(); 633 context3 && (_context = context3); 634 result = params ? callback.apply(scope, params) : callback.call(scope); 635 _context = prevContext; 636 return result; 637}, _interrupt = function _interrupt2(animation) { 638 _removeFromParent(animation); 639 animation.scrollTrigger && animation.scrollTrigger.kill(!!_reverting$1);
vendor: 7,330 bytes, lines 640-852
640 animation.progress() < 1 && _callback(animation, "onInterrupt"); 641 return animation; 642}, _quickTween, _registerPluginQueue = [], _createPlugin = function _createPlugin2(config3) { 643 if (!config3) 644 return; 645 config3 = !config3.name && config3["default"] || config3; 646 if (_windowExists$1() || config3.headless) { 647 var name = config3.name, isFunc = _isFunction(config3), Plugin = name && !isFunc && config3.init ? function() { 648 this._props = []; 649 } : config3, instanceDefaults = { 650 init: _emptyFunc, 651 render: _renderPropTweens, 652 add: _addPropTween, 653 kill: _killPropTweensOf, 654 modifier: _addPluginModifier, 655 rawVars: 0 656 }, statics = { 657 targetTest: 0, 658 get: 0, 659 getSetter: _getSetter, 660 aliases: {}, 661 register: 0 662 }; 663 _wake(); 664 if (config3 !== Plugin) { 665 if (_plugins[name]) { 666 return; 667 } 668 _setDefaults(Plugin, _setDefaults(_copyExcluding(config3, instanceDefaults), statics)); 669 _merge(Plugin.prototype, _merge(instanceDefaults, _copyExcluding(config3, statics))); 670 _plugins[Plugin.prop = name] = Plugin; 671 if (config3.targetTest) { 672 _harnessPlugins.push(Plugin); 673 _reservedProps[name] = 1; 674 } 675 name = (name === "css" ? "CSS" : name.charAt(0).toUpperCase() + name.substr(1)) + "Plugin"; 676 } 677 _addGlobal(name, Plugin); 678 config3.register && config3.register(gsap, Plugin, PropTween); 679 } else { 680 _registerPluginQueue.push(config3); 681 } 682}, _255 = 255, _colorLookup = { 683 aqua: [0, _255, _255], 684 lime: [0, _255, 0], 685 silver: [192, 192, 192], 686 black: [0, 0, 0], 687 maroon: [128, 0, 0], 688 teal: [0, 128, 128], 689 blue: [0, 0, _255], 690 navy: [0, 0, 128], 691 white: [_255, _255, _255], 692 olive: [128, 128, 0], 693 yellow: [_255, _255, 0], 694 orange: [_255, 165, 0], 695 gray: [128, 128, 128], 696 purple: [128, 0, 128], 697 green: [0, 128, 0], 698 red: [_255, 0, 0], 699 pink: [_255, 192, 203], 700 cyan: [0, _255, _255], 701 transparent: [_255, _255, _255, 0] 702}, _hue = function _hue2(h, m1, m2) { 703 h += h < 0 ? 1 : h > 1 ? -1 : 0; 704 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; 705}, splitColor = function splitColor2(v, toHSL, forceAlpha) { 706 var a = !v ? _colorLookup.black : _isNumber(v) ? [v >> 16, v >> 8 & _255, v & _255] : 0, r, g, b, h, s, l, max, min, d, wasHSL; 707 if (!a) { 708 if (v.substr(-1) === ",") { 709 v = v.substr(0, v.length - 1); 710 } 711 if (_colorLookup[v]) { 712 a = _colorLookup[v]; 713 } else if (v.charAt(0) === "#") { 714 if (v.length < 6) { 715 r = v.charAt(1); 716 g = v.charAt(2); 717 b = v.charAt(3); 718 v = "#" + r + r + g + g + b + b + (v.length === 5 ? v.charAt(4) + v.charAt(4) : ""); 719 } 720 if (v.length === 9) { 721 a = parseInt(v.substr(1, 6), 16); 722 return [a >> 16, a >> 8 & _255, a & _255, parseInt(v.substr(7), 16) / 255]; 723 } 724 v = parseInt(v.substr(1), 16); 725 a = [v >> 16, v >> 8 & _255, v & _255]; 726 } else if (v.substr(0, 3) === "hsl") { 727 a = wasHSL = v.match(_strictNumExp); 728 if (!toHSL) { 729 h = +a[0] % 360 / 360; 730 s = +a[1] / 100; 731 l = +a[2] / 100; 732 g = l <= 0.5 ? l * (s + 1) : l + s - l * s; 733 r = l * 2 - g; 734 a.length > 3 && (a[3] *= 1); 735 a[0] = _hue(h + 1 / 3, r, g); 736 a[1] = _hue(h, r, g); 737 a[2] = _hue(h - 1 / 3, r, g); 738 } else if (~v.indexOf("=")) { 739 a = v.match(_numExp); 740 forceAlpha && a.length < 4 && (a[3] = 1); 741 return a; 742 } 743 } else { 744 a = v.match(_strictNumExp) || _colorLookup.transparent; 745 } 746 a = a.map(Number); 747 } 748 if (toHSL && !wasHSL) { 749 r = a[0] / _255; 750 g = a[1] / _255; 751 b = a[2] / _255; 752 max = Math.max(r, g, b); 753 min = Math.min(r, g, b); 754 l = (max + min) / 2; 755 if (max === min) { 756 h = s = 0; 757 } else { 758 d = max - min; 759 s = l > 0.5 ? d / (2 - max - min) : d / (max + min); 760 h = max === r ? (g - b) / d + (g < b ? 6 : 0) : max === g ? (b - r) / d + 2 : (r - g) / d + 4; 761 h *= 60; 762 } 763 a[0] = ~~(h + 0.5); 764 a[1] = ~~(s * 100 + 0.5); 765 a[2] = ~~(l * 100 + 0.5); 766 } 767 forceAlpha && a.length < 4 && (a[3] = 1); 768 return a; 769}, _colorOrderData = function _colorOrderData2(v) { 770 var values = [], c = [], i = -1; 771 v.split(_colorExp).forEach(function(v2) { 772 var a = v2.match(_numWithUnitExp) || []; 773 values.push.apply(values, a); 774 c.push(i += a.length + 1); 775 }); 776 values.c = c; 777 return values; 778}, _formatColors = function _formatColors2(s, toHSL, orderMatchData) { 779 var result = "", colors = (s + result).match(_colorExp), type = toHSL ? "hsla(" : "rgba(", i = 0, c, shell, d, l; 780 if (!colors) { 781 return s; 782 } 783 colors = colors.map(function(color) { 784 return (color = splitColor(color, toHSL, 1)) && type + (toHSL ? color[0] + "," + color[1] + "%," + color[2] + "%," + color[3] : color.join(",")) + ")"; 785 }); 786 if (orderMatchData) { 787 d = _colorOrderData(s); 788 c = orderMatchData.c; 789 if (c.join(result) !== d.c.join(result)) { 790 shell = s.replace(_colorExp, "1").split(_numWithUnitExp); 791 l = shell.length - 1; 792 for (; i < l; i++) { 793 result += shell[i] + (~c.indexOf(i) ? colors.shift() || type + "0,0,0,0)" : (d.length ? d : colors.length ? colors : orderMatchData).shift()); 794 } 795 } 796 } 797 if (!shell) { 798 shell = s.split(_colorExp); 799 l = shell.length - 1; 800 for (; i < l; i++) { 801 result += shell[i] + colors[i]; 802 } 803 } 804 return result + shell[l]; 805}, _colorExp = function() { 806 var s = "(?:\\b(?:(?:rgb|rgba|hsl|hsla)\\(.+?\\))|\\B#(?:[0-9a-f]{3,4}){1,2}\\b", p; 807 for (p in _colorLookup) { 808 s += "|" + p + "\\b"; 809 } 810 return new RegExp(s + ")", "gi"); 811}(), _hslExp = /hsl[a]?\(/, _colorStringFilter = function _colorStringFilter2(a) { 812 var combined = a.join(" "), toHSL; 813 _colorExp.lastIndex = 0; 814 if (_colorExp.test(combined)) { 815 toHSL = _hslExp.test(combined); 816 a[1] = _formatColors(a[1], toHSL); 817 a[0] = _formatColors(a[0], toHSL, _colorOrderData(a[1])); 818 return true; 819 } 820}, _tickerActive, _ticker = function() { 821 var _getTime = Date.now, _lagThreshold = 500, _adjustedLag = 33, _startTime = _getTime(), _lastUpdate = _startTime, _gap = 1e3 / 240, _nextTime = _gap, _listeners2 = [], _id, _req, _raf, _self, _delta, _i, _tick = function _tick2(v) { 822 var elapsed = _getTime() - _lastUpdate, manual = v === true, overlap, dispatch, time, frame; 823 (elapsed > _lagThreshold || elapsed < 0) && (_startTime += elapsed - _adjustedLag); 824 _lastUpdate += elapsed; 825 time = _lastUpdate - _startTime; 826 overlap = time - _nextTime; 827 if (overlap > 0 || manual) { 828 frame = ++_self.frame; 829 _delta = time - _self.time * 1e3; 830 _self.time = time = time / 1e3; 831 _nextTime += overlap + (overlap >= _gap ? 4 : _gap - overlap); 832 dispatch = 1; 833 } 834 manual || (_id = _req(_tick2)); 835 if (dispatch) { 836 for (_i = 0; _i < _listeners2.length; _i++) { 837 _listeners2[_i](time, _delta, frame, v); 838 } 839 } 840 }; 841 _self = { 842 time: 0, 843 frame: 0, 844 tick: function tick() { 845 _tick(true); 846 }, 847 deltaRatio: function deltaRatio(fps) { 848 return _delta / (1e3 / (fps || 60)); 849 }, 850 wake: function wake() { 851 if (_coreReady) { 852 if (!_coreInitted && _windowExists$1()) {
vendor: 4,161 bytes, lines 853-954
853 _win$1 = _coreInitted = window; 854 _doc$1 = _win$1.document || {}; 855 _globals.gsap = gsap; 856 (_win$1.gsapVersions || (_win$1.gsapVersions = [])).push(gsap.version); 857 _install(_installScope || _win$1.GreenSockGlobals || !_win$1.gsap && _win$1 || {}); 858 _registerPluginQueue.forEach(_createPlugin); 859 } 860 _raf = typeof requestAnimationFrame !== "undefined" && requestAnimationFrame; 861 _id && _self.sleep(); 862 _req = _raf || function(f) { 863 return setTimeout(f, _nextTime - _self.time * 1e3 + 1 | 0); 864 }; 865 _tickerActive = 1; 866 _tick(2); 867 } 868 }, 869 sleep: function sleep() { 870 (_raf ? cancelAnimationFrame : clearTimeout)(_id); 871 _tickerActive = 0; 872 _req = _emptyFunc; 873 }, 874 lagSmoothing: function lagSmoothing(threshold, adjustedLag) { 875 _lagThreshold = threshold || Infinity; 876 _adjustedLag = Math.min(adjustedLag || 33, _lagThreshold); 877 }, 878 fps: function fps(_fps) { 879 _gap = 1e3 / (_fps || 240); 880 _nextTime = _self.time * 1e3 + _gap; 881 }, 882 add: function add(callback, once, prioritize) { 883 var func = once ? function(t, d, f, v) { 884 callback(t, d, f, v); 885 _self.remove(func); 886 } : callback; 887 _self.remove(callback); 888 _listeners2[prioritize ? "unshift" : "push"](func); 889 _wake(); 890 return func; 891 }, 892 remove: function remove(callback, i) { 893 ~(i = _listeners2.indexOf(callback)) && _listeners2.splice(i, 1) && _i >= i && _i--; 894 }, 895 _listeners: _listeners2 896 }; 897 return _self; 898}(), _wake = function _wake2() { 899 return !_tickerActive && _ticker.wake(); 900}, _easeMap = {}, _customEaseExp = /^[\d.\-M][\d.\-,\s]/, _quotesExp = /["']/g, _parseObjectInString = function _parseObjectInString2(value) { 901 var obj = {}, split = value.substr(1, value.length - 3).split(":"), key = split[0], i = 1, l = split.length, index, val, parsedVal; 902 for (; i < l; i++) { 903 val = split[i]; 904 index = i !== l - 1 ? val.lastIndexOf(",") : val.length; 905 parsedVal = val.substr(0, index); 906 obj[key] = isNaN(parsedVal) ? parsedVal.replace(_quotesExp, "").trim() : +parsedVal; 907 key = val.substr(index + 1).trim(); 908 } 909 return obj; 910}, _valueInParentheses = function _valueInParentheses2(value) { 911 var open = value.indexOf("(") + 1, close = value.indexOf(")"), nested = value.indexOf("(", open); 912 return value.substring(open, ~nested && nested < close ? value.indexOf(")", close + 1) : close); 913}, _configEaseFromString = function _configEaseFromString2(name) { 914 var split = (name + "").split("("), ease = _easeMap[split[0]]; 915 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; 916}, _invertEase = function _invertEase2(ease) { 917 return function(p) { 918 return 1 - ease(1 - p); 919 }; 920}, _propagateYoyoEase = function _propagateYoyoEase2(timeline2, isYoyo) { 921 var child = timeline2._first, ease; 922 while (child) { 923 if (child instanceof Timeline) { 924 _propagateYoyoEase2(child, isYoyo); 925 } else if (child.vars.yoyoEase && (!child._yoyo || !child._repeat) && child._yoyo !== isYoyo) { 926 if (child.timeline) { 927 _propagateYoyoEase2(child.timeline, isYoyo); 928 } else { 929 ease = child._ease; 930 child._ease = child._yEase; 931 child._yEase = ease; 932 child._yoyo = isYoyo; 933 } 934 } 935 child = child._next; 936 } 937}, _parseEase = function _parseEase2(ease, defaultEase) { 938 return !ease ? defaultEase : (_isFunction(ease) ? ease : _easeMap[ease] || _configEaseFromString(ease)) || defaultEase; 939}, _insertEase = function _insertEase2(names, easeIn, easeOut, easeInOut) { 940 if (easeOut === void 0) { 941 easeOut = function easeOut2(p) { 942 return 1 - easeIn(1 - p); 943 }; 944 } 945 if (easeInOut === void 0) { 946 easeInOut = function easeInOut2(p) { 947 return p < 0.5 ? easeIn(p * 2) / 2 : 1 - easeIn((1 - p) * 2) / 2; 948 }; 949 } 950 var ease = { 951 easeIn, 952 easeOut, 953 easeInOut 954 }, lowercaseName;
vendor: 4,403 bytes, lines 955-1067
955 _forEachName(names, function(name) { 956 _easeMap[name] = _globals[name] = ease; 957 _easeMap[lowercaseName = name.toLowerCase()] = easeOut; 958 for (var p in ease) { 959 _easeMap[lowercaseName + (p === "easeIn" ? ".in" : p === "easeOut" ? ".out" : ".inOut")] = _easeMap[name + "." + p] = ease[p]; 960 } 961 }); 962 return ease; 963}, _easeInOutFromOut = function _easeInOutFromOut2(easeOut) { 964 return function(p) { 965 return p < 0.5 ? (1 - easeOut(1 - p * 2)) / 2 : 0.5 + easeOut((p - 0.5) * 2) / 2; 966 }; 967}, _configElastic = function _configElastic2(type, amplitude, period) { 968 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) { 969 return p === 1 ? 1 : p1 * Math.pow(2, -10 * p) * _sin((p - p3) * p2) + 1; 970 }, ease = type === "out" ? easeOut : type === "in" ? function(p) { 971 return 1 - easeOut(1 - p); 972 } : _easeInOutFromOut(easeOut); 973 p2 = _2PI / p2; 974 ease.config = function(amplitude2, period2) { 975 return _configElastic2(type, amplitude2, period2); 976 }; 977 return ease; 978}, _configBack = function _configBack2(type, overshoot) { 979 if (overshoot === void 0) { 980 overshoot = 1.70158; 981 } 982 var easeOut = function easeOut2(p) { 983 return p ? --p * p * ((overshoot + 1) * p + overshoot) + 1 : 0; 984 }, ease = type === "out" ? easeOut : type === "in" ? function(p) { 985 return 1 - easeOut(1 - p); 986 } : _easeInOutFromOut(easeOut); 987 ease.config = function(overshoot2) { 988 return _configBack2(type, overshoot2); 989 }; 990 return ease; 991}; 992_forEachName("Linear,Quad,Cubic,Quart,Quint,Strong", function(name, i) { 993 var power = i < 5 ? i + 1 : i; 994 _insertEase(name + ",Power" + (power - 1), i ? function(p) { 995 return Math.pow(p, power); 996 } : function(p) { 997 return p; 998 }, function(p) { 999 return 1 - Math.pow(1 - p, power); 1000 }, function(p) { 1001 return p < 0.5 ? Math.pow(p * 2, power) / 2 : 1 - Math.pow((1 - p) * 2, power) / 2; 1002 }); 1003}); 1004_easeMap.Linear.easeNone = _easeMap.none = _easeMap.Linear.easeIn; 1005_insertEase("Elastic", _configElastic("in"), _configElastic("out"), _configElastic()); 1006(function(n, c) { 1007 var n1 = 1 / c, n2 = 2 * n1, n3 = 2.5 * n1, easeOut = function easeOut2(p) { 1008 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; 1009 }; 1010 _insertEase("Bounce", function(p) { 1011 return 1 - easeOut(1 - p); 1012 }, easeOut); 1013})(7.5625, 2.75); 1014_insertEase("Expo", function(p) { 1015 return p ? Math.pow(2, 10 * (p - 1)) : 0; 1016}); 1017_insertEase("Circ", function(p) { 1018 return -(_sqrt(1 - p * p) - 1); 1019}); 1020_insertEase("Sine", function(p) { 1021 return p === 1 ? 1 : -_cos(p * _HALF_PI) + 1; 1022}); 1023_insertEase("Back", _configBack("in"), _configBack("out"), _configBack()); 1024_easeMap.SteppedEase = _easeMap.steps = _globals.SteppedEase = { 1025 config: function config(steps, immediateStart) { 1026 if (steps === void 0) { 1027 steps = 1; 1028 } 1029 var p1 = 1 / steps, p2 = steps + (immediateStart ? 0 : 1), p3 = immediateStart ? 1 : 0, max = 1 - _tinyNum; 1030 return function(p) { 1031 return ((p2 * _clamp(0, max, p) | 0) + p3) * p1; 1032 }; 1033 } 1034}; 1035_defaults.ease = _easeMap["quad.out"]; 1036_forEachName("onComplete,onUpdate,onStart,onRepeat,onReverseComplete,onInterrupt", function(name) { 1037 return _callbackNames += name + "," + name + "Params,"; 1038}); 1039var GSCache = function GSCache2(target, harness) { 1040 this.id = _gsID++; 1041 target._gsap = this; 1042 this.target = target; 1043 this.harness = harness; 1044 this.get = harness ? harness.get : _getProperty; 1045 this.set = harness ? harness.getSetter : _getSetter; 1046}; 1047var Animation = /* @__PURE__ */ function() { 1048 function Animation2(vars) { 1049 this.vars = vars; 1050 this._delay = +vars.delay || 0; 1051 if (this._repeat = vars.repeat === Infinity ? -2 : vars.repeat || 0) { 1052 this._rDelay = vars.repeatDelay || 0; 1053 this._yoyo = !!vars.yoyo || !!vars.yoyoEase; 1054 } 1055 this._ts = 1; 1056 _setDuration(this, +vars.duration, 1, 1); 1057 this.data = vars.data; 1058 if (_context) { 1059 this._ctx = _context; 1060 _context.data.push(this); 1061 } 1062 _tickerActive || _ticker.wake(); 1063 } 1064 var _proto = Animation2.prototype; 1065 _proto.delay = function delay2(value) { 1066 if (value || value === 0) { 1067 this.parent && this.parent.smoothChildTiming && this.startTime(this._start + value - this._delay);
vendor: 15,485 bytes, lines 1068-1443
1068 this._delay = value; 1069 return this; 1070 } 1071 return this._delay; 1072 }; 1073 _proto.duration = function duration(value) { 1074 return arguments.length ? this.totalDuration(this._repeat > 0 ? value + (value + this._rDelay) * this._repeat : value) : this.totalDuration() && this._dur; 1075 }; 1076 _proto.totalDuration = function totalDuration(value) { 1077 if (!arguments.length) { 1078 return this._tDur; 1079 } 1080 this._dirty = 0; 1081 return _setDuration(this, this._repeat < 0 ? value : (value - this._repeat * this._rDelay) / (this._repeat + 1)); 1082 }; 1083 _proto.totalTime = function totalTime(_totalTime, suppressEvents) { 1084 _wake(); 1085 if (!arguments.length) { 1086 return this._tTime; 1087 } 1088 var parent = this._dp; 1089 if (parent && parent.smoothChildTiming && this._ts) { 1090 _alignPlayhead(this, _totalTime); 1091 !parent._dp || parent.parent || _postAddChecks(parent, this); 1092 while (parent && parent.parent) { 1093 if (parent.parent._time !== parent._start + (parent._ts >= 0 ? parent._tTime / parent._ts : (parent.totalDuration() - parent._tTime) / -parent._ts)) { 1094 parent.totalTime(parent._tTime, true); 1095 } 1096 parent = parent.parent; 1097 } 1098 if (!this.parent && this._dp.autoRemoveChildren && (this._ts > 0 && _totalTime < this._tDur || this._ts < 0 && _totalTime > 0 || !this._tDur && !_totalTime)) { 1099 _addToTimeline(this._dp, this, this._start - this._delay); 1100 } 1101 } 1102 if (this._tTime !== _totalTime || !this._dur && !suppressEvents || this._initted && Math.abs(this._zTime) === _tinyNum || !_totalTime && !this._initted && (this.add || this._ptLookup)) { 1103 this._ts || (this._pTime = _totalTime); 1104 _lazySafeRender(this, _totalTime, suppressEvents); 1105 } 1106 return this; 1107 }; 1108 _proto.time = function time(value, suppressEvents) { 1109 return arguments.length ? this.totalTime(Math.min(this.totalDuration(), value + _elapsedCycleDuration(this)) % (this._dur + this._rDelay) || (value ? this._dur : 0), suppressEvents) : this._time; 1110 }; 1111 _proto.totalProgress = function totalProgress(value, suppressEvents) { 1112 return arguments.length ? this.totalTime(this.totalDuration() * value, suppressEvents) : this.totalDuration() ? Math.min(1, this._tTime / this._tDur) : this.rawTime() > 0 ? 1 : 0; 1113 }; 1114 _proto.progress = function progress(value, suppressEvents) { 1115 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; 1116 }; 1117 _proto.iteration = function iteration(value, suppressEvents) { 1118 var cycleDuration = this.duration() + this._rDelay; 1119 return arguments.length ? this.totalTime(this._time + (value - 1) * cycleDuration, suppressEvents) : this._repeat ? _animationCycle(this._tTime, cycleDuration) + 1 : 1; 1120 }; 1121 _proto.timeScale = function timeScale(value, suppressEvents) { 1122 if (!arguments.length) { 1123 return this._rts === -_tinyNum ? 0 : this._rts; 1124 } 1125 if (this._rts === value) { 1126 return this; 1127 } 1128 var tTime = this.parent && this._ts ? _parentToChildTotalTime(this.parent._time, this) : this._tTime; 1129 this._rts = +value || 0; 1130 this._ts = this._ps || value === -_tinyNum ? 0 : this._rts; 1131 this.totalTime(_clamp(-Math.abs(this._delay), this._tDur, tTime), suppressEvents !== false); 1132 _setEnd(this); 1133 return _recacheAncestors(this); 1134 }; 1135 _proto.paused = function paused(value) { 1136 if (!arguments.length) { 1137 return this._ps; 1138 } 1139 if (this._ps !== value) { 1140 this._ps = value; 1141 if (value) { 1142 this._pTime = this._tTime || Math.max(-this._delay, this.rawTime()); 1143 this._ts = this._act = 0; 1144 } else { 1145 _wake(); 1146 this._ts = this._rts; 1147 this.totalTime(this.parent && !this.parent.smoothChildTiming ? this.rawTime() : this._tTime || this._pTime, this.progress() === 1 && Math.abs(this._zTime) !== _tinyNum && (this._tTime -= _tinyNum)); 1148 } 1149 } 1150 return this; 1151 }; 1152 _proto.startTime = function startTime(value) { 1153 if (arguments.length) { 1154 this._start = value; 1155 var parent = this.parent || this._dp; 1156 parent && (parent._sort || !this.parent) && _addToTimeline(parent, this, value - this._delay); 1157 return this; 1158 } 1159 return this._start; 1160 }; 1161 _proto.endTime = function endTime(includeRepeats) { 1162 return this._start + (_isNotFalse(includeRepeats) ? this.totalDuration() : this.duration()) / Math.abs(this._ts || 1); 1163 }; 1164 _proto.rawTime = function rawTime(wrapRepeats) { 1165 var parent = this.parent || this._dp; 1166 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); 1167 }; 1168 _proto.revert = function revert(config3) { 1169 if (config3 === void 0) { 1170 config3 = _revertConfig; 1171 } 1172 var prevIsReverting = _reverting$1; 1173 _reverting$1 = config3; 1174 if (this._initted || this._startAt) { 1175 this.timeline && this.timeline.revert(config3); 1176 this.totalTime(-0.01, config3.suppressEvents); 1177 } 1178 this.data !== "nested" && config3.kill !== false && this.kill(); 1179 _reverting$1 = prevIsReverting; 1180 return this; 1181 }; 1182 _proto.globalTime = function globalTime(rawTime) { 1183 var animation = this, time = arguments.length ? rawTime : animation.rawTime(); 1184 while (animation) { 1185 time = animation._start + time / (Math.abs(animation._ts) || 1); 1186 animation = animation._dp; 1187 } 1188 return !this.parent && this._sat ? this._sat.globalTime(rawTime) : time; 1189 }; 1190 _proto.repeat = function repeat(value) { 1191 if (arguments.length) { 1192 this._repeat = value === Infinity ? -2 : value; 1193 return _onUpdateTotalDuration(this); 1194 } 1195 return this._repeat === -2 ? Infinity : this._repeat; 1196 }; 1197 _proto.repeatDelay = function repeatDelay(value) { 1198 if (arguments.length) { 1199 var time = this._time; 1200 this._rDelay = value; 1201 _onUpdateTotalDuration(this); 1202 return time ? this.time(time) : this; 1203 } 1204 return this._rDelay; 1205 }; 1206 _proto.yoyo = function yoyo(value) { 1207 if (arguments.length) { 1208 this._yoyo = value; 1209 return this; 1210 } 1211 return this._yoyo; 1212 }; 1213 _proto.seek = function seek(position, suppressEvents) { 1214 return this.totalTime(_parsePosition(this, position), _isNotFalse(suppressEvents)); 1215 }; 1216 _proto.restart = function restart(includeDelay, suppressEvents) { 1217 return this.play().totalTime(includeDelay ? -this._delay : 0, _isNotFalse(suppressEvents)); 1218 }; 1219 _proto.play = function play(from, suppressEvents) { 1220 from != null && this.seek(from, suppressEvents); 1221 return this.reversed(false).paused(false); 1222 }; 1223 _proto.reverse = function reverse(from, suppressEvents) { 1224 from != null && this.seek(from || this.totalDuration(), suppressEvents); 1225 return this.reversed(true).paused(false); 1226 }; 1227 _proto.pause = function pause(atTime, suppressEvents) { 1228 atTime != null && this.seek(atTime, suppressEvents); 1229 return this.paused(true); 1230 }; 1231 _proto.resume = function resume() { 1232 return this.paused(false); 1233 }; 1234 _proto.reversed = function reversed(value) { 1235 if (arguments.length) { 1236 !!value !== this.reversed() && this.timeScale(-this._rts || (value ? -_tinyNum : 0)); 1237 return this; 1238 } 1239 return this._rts < 0; 1240 }; 1241 _proto.invalidate = function invalidate() { 1242 this._initted = this._act = 0; 1243 this._zTime = -_tinyNum; 1244 return this; 1245 }; 1246 _proto.isActive = function isActive() { 1247 var parent = this.parent || this._dp, start = this._start, rawTime; 1248 return !!(!parent || this._ts && this._initted && parent.isActive() && (rawTime = parent.rawTime(true)) >= start && rawTime < this.endTime(true) - _tinyNum); 1249 }; 1250 _proto.eventCallback = function eventCallback(type, callback, params) { 1251 var vars = this.vars; 1252 if (arguments.length > 1) { 1253 if (!callback) { 1254 delete vars[type]; 1255 } else { 1256 vars[type] = callback; 1257 params && (vars[type + "Params"] = params); 1258 type === "onUpdate" && (this._onUpdate = callback); 1259 } 1260 return this; 1261 } 1262 return vars[type]; 1263 }; 1264 _proto.then = function then(onFulfilled) { 1265 var self = this; 1266 return new Promise(function(resolve) { 1267 var f = _isFunction(onFulfilled) ? onFulfilled : _passThrough, _resolve = function _resolve2() { 1268 var _then = self.then; 1269 self.then = null; 1270 _isFunction(f) && (f = f(self)) && (f.then || f === self) && (self.then = _then); 1271 resolve(f); 1272 self.then = _then; 1273 }; 1274 if (self._initted && self.totalProgress() === 1 && self._ts >= 0 || !self._tTime && self._ts < 0) { 1275 _resolve(); 1276 } else { 1277 self._prom = _resolve; 1278 } 1279 }); 1280 }; 1281 _proto.kill = function kill() { 1282 _interrupt(this); 1283 }; 1284 return Animation2; 1285}(); 1286_setDefaults(Animation.prototype, { 1287 _time: 0, 1288 _start: 0, 1289 _end: 0, 1290 _tTime: 0, 1291 _tDur: 0, 1292 _dirty: 0, 1293 _repeat: 0, 1294 _yoyo: false, 1295 parent: null, 1296 _initted: false, 1297 _rDelay: 0, 1298 _ts: 1, 1299 _dp: 0, 1300 ratio: 0, 1301 _zTime: -_tinyNum, 1302 _prom: 0, 1303 _ps: false, 1304 _rts: 1 1305}); 1306var Timeline = /* @__PURE__ */ function(_Animation) { 1307 _inheritsLoose(Timeline2, _Animation); 1308 function Timeline2(vars, position) { 1309 var _this; 1310 if (vars === void 0) { 1311 vars = {}; 1312 } 1313 _this = _Animation.call(this, vars) || this; 1314 _this.labels = {}; 1315 _this.smoothChildTiming = !!vars.smoothChildTiming; 1316 _this.autoRemoveChildren = !!vars.autoRemoveChildren; 1317 _this._sort = _isNotFalse(vars.sortChildren); 1318 _globalTimeline && _addToTimeline(vars.parent || _globalTimeline, _assertThisInitialized(_this), position); 1319 vars.reversed && _this.reverse(); 1320 vars.paused && _this.paused(true); 1321 vars.scrollTrigger && _scrollTrigger(_assertThisInitialized(_this), vars.scrollTrigger); 1322 return _this; 1323 } 1324 var _proto2 = Timeline2.prototype; 1325 _proto2.to = function to(targets, vars, position) { 1326 _createTweenType(0, arguments, this); 1327 return this; 1328 }; 1329 _proto2.from = function from(targets, vars, position) { 1330 _createTweenType(1, arguments, this); 1331 return this; 1332 }; 1333 _proto2.fromTo = function fromTo(targets, fromVars, toVars, position) { 1334 _createTweenType(2, arguments, this); 1335 return this; 1336 }; 1337 _proto2.set = function set(targets, vars, position) { 1338 vars.duration = 0; 1339 vars.parent = this; 1340 _inheritDefaults(vars).repeatDelay || (vars.repeat = 0); 1341 vars.immediateRender = !!vars.immediateRender; 1342 new Tween(targets, vars, _parsePosition(this, position), 1); 1343 return this; 1344 }; 1345 _proto2.call = function call(callback, params, position) { 1346 return _addToTimeline(this, Tween.delayedCall(0, callback, params), position); 1347 }; 1348 _proto2.staggerTo = function staggerTo(targets, duration, vars, stagger, position, onCompleteAll, onCompleteAllParams) { 1349 vars.duration = duration; 1350 vars.stagger = vars.stagger || stagger; 1351 vars.onComplete = onCompleteAll; 1352 vars.onCompleteParams = onCompleteAllParams; 1353 vars.parent = this; 1354 new Tween(targets, vars, _parsePosition(this, position)); 1355 return this; 1356 }; 1357 _proto2.staggerFrom = function staggerFrom(targets, duration, vars, stagger, position, onCompleteAll, onCompleteAllParams) { 1358 vars.runBackwards = 1; 1359 _inheritDefaults(vars).immediateRender = _isNotFalse(vars.immediateRender); 1360 return this.staggerTo(targets, duration, vars, stagger, position, onCompleteAll, onCompleteAllParams); 1361 }; 1362 _proto2.staggerFromTo = function staggerFromTo(targets, duration, fromVars, toVars, stagger, position, onCompleteAll, onCompleteAllParams) { 1363 toVars.startAt = fromVars; 1364 _inheritDefaults(toVars).immediateRender = _isNotFalse(toVars.immediateRender); 1365 return this.staggerTo(targets, duration, toVars, stagger, position, onCompleteAll, onCompleteAllParams); 1366 }; 1367 _proto2.render = function render3(totalTime, suppressEvents, force) { 1368 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; 1369 this !== _globalTimeline && tTime > tDur && totalTime >= 0 && (tTime = tDur); 1370 if (tTime !== this._tTime || force || crossingStart) { 1371 if (prevTime !== this._time && dur) { 1372 tTime += this._time - prevTime; 1373 totalTime += this._time - prevTime; 1374 } 1375 time = tTime; 1376 prevStart = this._start; 1377 timeScale = this._ts; 1378 prevPaused = !timeScale; 1379 if (crossingStart) { 1380 dur || (prevTime = this._zTime); 1381 (totalTime || !suppressEvents) && (this._zTime = totalTime); 1382 } 1383 if (this._repeat) { 1384 yoyo = this._yoyo; 1385 cycleDuration = dur + this._rDelay; 1386 if (this._repeat < -1 && totalTime < 0) { 1387 return this.totalTime(cycleDuration * 100 + totalTime, suppressEvents, force); 1388 } 1389 time = _roundPrecise(tTime % cycleDuration); 1390 if (tTime === tDur) { 1391 iteration = this._repeat; 1392 time = dur; 1393 } else { 1394 iteration = ~~(tTime / cycleDuration); 1395 if (iteration && iteration === tTime / cycleDuration) { 1396 time = dur; 1397 iteration--; 1398 } 1399 time > dur && (time = dur); 1400 } 1401 prevIteration = _animationCycle(this._tTime, cycleDuration); 1402 !prevTime && this._tTime && prevIteration !== iteration && this._tTime - prevIteration * cycleDuration - this._dur <= 0 && (prevIteration = iteration); 1403 if (yoyo && iteration & 1) { 1404 time = dur - time; 1405 isYoyo = 1; 1406 } 1407 if (iteration !== prevIteration && !this._lock) { 1408 var rewinding = yoyo && prevIteration & 1, doesWrap = rewinding === (yoyo && iteration & 1); 1409 iteration < prevIteration && (rewinding = !rewinding); 1410 prevTime = rewinding ? 0 : tTime % dur ? dur : tTime; 1411 this._lock = 1; 1412 this.render(prevTime || (isYoyo ? 0 : _roundPrecise(iteration * cycleDuration)), suppressEvents, !dur)._lock = 0; 1413 this._tTime = tTime; 1414 !suppressEvents && this.parent && _callback(this, "onRepeat"); 1415 this.vars.repeatRefresh && !isYoyo && (this.invalidate()._lock = 1); 1416 if (prevTime && prevTime !== this._time || prevPaused !== !this._ts || this.vars.onRepeat && !this.parent && !this._act) { 1417 return this; 1418 } 1419 dur = this._dur; 1420 tDur = this._tDur; 1421 if (doesWrap) { 1422 this._lock = 2; 1423 prevTime = rewinding ? dur : -1e-4; 1424 this.render(prevTime, true); 1425 this.vars.repeatRefresh && !isYoyo && this.invalidate(); 1426 } 1427 this._lock = 0; 1428 if (!this._ts && !prevPaused) { 1429 return this; 1430 } 1431 _propagateYoyoEase(this, isYoyo); 1432 } 1433 } 1434 if (this._hasPause && !this._forcing && this._lock < 2) { 1435 pauseTween = _findNextPauseTween(this, _roundPrecise(prevTime), _roundPrecise(time)); 1436 if (pauseTween) { 1437 tTime -= time - (time = pauseTween._start); 1438 } 1439 } 1440 this._tTime = tTime; 1441 this._time = time; 1442 this._act = !timeScale; 1443 if (!this._initted) {
vendor: 2,321 bytes, lines 1444-1499
1444 this._onUpdate = this.vars.onUpdate; 1445 this._initted = 1; 1446 this._zTime = totalTime; 1447 prevTime = 0; 1448 } 1449 if (!prevTime && time && !suppressEvents && !iteration) { 1450 _callback(this, "onStart"); 1451 if (this._tTime !== tTime) { 1452 return this; 1453 } 1454 } 1455 if (time >= prevTime && totalTime >= 0) { 1456 child = this._first; 1457 while (child) { 1458 next = child._next; 1459 if ((child._act || time >= child._start) && child._ts && pauseTween !== child) { 1460 if (child.parent !== this) { 1461 return this.render(totalTime, suppressEvents, force); 1462 } 1463 child.render(child._ts > 0 ? (time - child._start) * child._ts : (child._dirty ? child.totalDuration() : child._tDur) + (time - child._start) * child._ts, suppressEvents, force); 1464 if (time !== this._time || !this._ts && !prevPaused) { 1465 pauseTween = 0; 1466 next && (tTime += this._zTime = -_tinyNum); 1467 break; 1468 } 1469 } 1470 child = next; 1471 } 1472 } else { 1473 child = this._last; 1474 var adjustedTime = totalTime < 0 ? totalTime : time; 1475 while (child) { 1476 next = child._prev; 1477 if ((child._act || adjustedTime <= child._end) && child._ts && pauseTween !== child) { 1478 if (child.parent !== this) { 1479 return this.render(totalTime, suppressEvents, force); 1480 } 1481 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)); 1482 if (time !== this._time || !this._ts && !prevPaused) { 1483 pauseTween = 0; 1484 next && (tTime += this._zTime = adjustedTime ? -_tinyNum : _tinyNum); 1485 break; 1486 } 1487 } 1488 child = next; 1489 } 1490 } 1491 if (pauseTween && !suppressEvents) { 1492 this.pause(); 1493 pauseTween.render(time >= prevTime ? 0 : -_tinyNum)._zTime = time >= prevTime ? 1 : -1; 1494 if (this._ts) { 1495 this._start = prevStart; 1496 _setEnd(this); 1497 return this.render(totalTime, suppressEvents, force); 1498 } 1499 }
vendor: 7,481 bytes, lines 1500-1707
1500 this._onUpdate && !suppressEvents && _callback(this, "onUpdate", true); 1501 if (tTime === tDur && this._tTime >= this.totalDuration() || !tTime && prevTime) { 1502 if (prevStart === this._start || Math.abs(timeScale) !== Math.abs(this._ts)) { 1503 if (!this._lock) { 1504 (totalTime || !dur) && (tTime === tDur && this._ts > 0 || !tTime && this._ts < 0) && _removeFromParent(this, 1); 1505 if (!suppressEvents && !(totalTime < 0 && !prevTime) && (tTime || prevTime || !tDur)) { 1506 _callback(this, tTime === tDur && totalTime >= 0 ? "onComplete" : "onReverseComplete", true); 1507 this._prom && !(tTime < tDur && this.timeScale() > 0) && this._prom(); 1508 } 1509 } 1510 } 1511 } 1512 } 1513 return this; 1514 }; 1515 _proto2.add = function add(child, position) { 1516 var _this2 = this; 1517 _isNumber(position) || (position = _parsePosition(this, position, child)); 1518 if (!(child instanceof Animation)) { 1519 if (_isArray(child)) { 1520 child.forEach(function(obj) { 1521 return _this2.add(obj, position); 1522 }); 1523 return this; 1524 } 1525 if (_isString(child)) { 1526 return this.addLabel(child, position); 1527 } 1528 if (_isFunction(child)) { 1529 child = Tween.delayedCall(0, child); 1530 } else { 1531 return this; 1532 } 1533 } 1534 return this !== child ? _addToTimeline(this, child, position) : this; 1535 }; 1536 _proto2.getChildren = function getChildren(nested, tweens, timelines, ignoreBeforeTime) { 1537 if (nested === void 0) { 1538 nested = true; 1539 } 1540 if (tweens === void 0) { 1541 tweens = true; 1542 } 1543 if (timelines === void 0) { 1544 timelines = true; 1545 } 1546 if (ignoreBeforeTime === void 0) { 1547 ignoreBeforeTime = -_bigNum$1; 1548 } 1549 var a = [], child = this._first; 1550 while (child) { 1551 if (child._start >= ignoreBeforeTime) { 1552 if (child instanceof Tween) { 1553 tweens && a.push(child); 1554 } else { 1555 timelines && a.push(child); 1556 nested && a.push.apply(a, child.getChildren(true, tweens, timelines)); 1557 } 1558 } 1559 child = child._next; 1560 } 1561 return a; 1562 }; 1563 _proto2.getById = function getById2(id) { 1564 var animations = this.getChildren(1, 1, 1), i = animations.length; 1565 while (i--) { 1566 if (animations[i].vars.id === id) { 1567 return animations[i]; 1568 } 1569 } 1570 }; 1571 _proto2.remove = function remove(child) { 1572 if (_isString(child)) { 1573 return this.removeLabel(child); 1574 } 1575 if (_isFunction(child)) { 1576 return this.killTweensOf(child); 1577 } 1578 _removeLinkedListItem(this, child); 1579 if (child === this._recent) { 1580 this._recent = this._last; 1581 } 1582 return _uncache(this); 1583 }; 1584 _proto2.totalTime = function totalTime(_totalTime2, suppressEvents) { 1585 if (!arguments.length) { 1586 return this._tTime; 1587 } 1588 this._forcing = 1; 1589 if (!this._dp && this._ts) { 1590 this._start = _roundPrecise(_ticker.time - (this._ts > 0 ? _totalTime2 / this._ts : (this.totalDuration() - _totalTime2) / -this._ts)); 1591 } 1592 _Animation.prototype.totalTime.call(this, _totalTime2, suppressEvents); 1593 this._forcing = 0; 1594 return this; 1595 }; 1596 _proto2.addLabel = function addLabel(label, position) { 1597 this.labels[label] = _parsePosition(this, position); 1598 return this; 1599 }; 1600 _proto2.removeLabel = function removeLabel(label) { 1601 delete this.labels[label]; 1602 return this; 1603 }; 1604 _proto2.addPause = function addPause(position, callback, params) { 1605 var t = Tween.delayedCall(0, callback || _emptyFunc, params); 1606 t.data = "isPause"; 1607 this._hasPause = 1; 1608 return _addToTimeline(this, t, _parsePosition(this, position)); 1609 }; 1610 _proto2.removePause = function removePause(position) { 1611 var child = this._first; 1612 position = _parsePosition(this, position); 1613 while (child) { 1614 if (child._start === position && child.data === "isPause") { 1615 _removeFromParent(child); 1616 } 1617 child = child._next; 1618 } 1619 }; 1620 _proto2.killTweensOf = function killTweensOf(targets, props, onlyActive) { 1621 var tweens = this.getTweensOf(targets, onlyActive), i = tweens.length; 1622 while (i--) { 1623 _overwritingTween !== tweens[i] && tweens[i].kill(targets, props); 1624 } 1625 return this; 1626 }; 1627 _proto2.getTweensOf = function getTweensOf2(targets, onlyActive) { 1628 var a = [], parsedTargets = toArray(targets), child = this._first, isGlobalTime = _isNumber(onlyActive), children; 1629 while (child) { 1630 if (child instanceof Tween) { 1631 if (_arrayContainsAny(child._targets, parsedTargets) && (isGlobalTime ? (!_overwritingTween || child._initted && child._ts) && child.globalTime(0) <= onlyActive && child.globalTime(child.totalDuration()) > onlyActive : !onlyActive || child.isActive())) { 1632 a.push(child); 1633 } 1634 } else if ((children = child.getTweensOf(parsedTargets, onlyActive)).length) { 1635 a.push.apply(a, children); 1636 } 1637 child = child._next; 1638 } 1639 return a; 1640 }; 1641 _proto2.tweenTo = function tweenTo(position, vars) { 1642 vars = vars || {}; 1643 var tl = this, endTime = _parsePosition(tl, position), _vars = vars, startAt = _vars.startAt, _onStart = _vars.onStart, onStartParams = _vars.onStartParams, immediateRender = _vars.immediateRender, initted, tween = Tween.to(tl, _setDefaults({ 1644 ease: vars.ease || "none", 1645 lazy: false, 1646 immediateRender: false, 1647 time: endTime, 1648 overwrite: "auto", 1649 duration: vars.duration || Math.abs((endTime - (startAt && "time" in startAt ? startAt.time : tl._time)) / tl.timeScale()) || _tinyNum, 1650 onStart: function onStart() { 1651 tl.pause(); 1652 if (!initted) { 1653 var duration = vars.duration || Math.abs((endTime - (startAt && "time" in startAt ? startAt.time : tl._time)) / tl.timeScale()); 1654 tween._dur !== duration && _setDuration(tween, duration, 0, 1).render(tween._time, true, true); 1655 initted = 1; 1656 } 1657 _onStart && _onStart.apply(tween, onStartParams || []); 1658 } 1659 }, vars)); 1660 return immediateRender ? tween.render(0) : tween; 1661 }; 1662 _proto2.tweenFromTo = function tweenFromTo(fromPosition, toPosition, vars) { 1663 return this.tweenTo(toPosition, _setDefaults({ 1664 startAt: { 1665 time: _parsePosition(this, fromPosition) 1666 } 1667 }, vars)); 1668 }; 1669 _proto2.recent = function recent() { 1670 return this._recent; 1671 }; 1672 _proto2.nextLabel = function nextLabel(afterTime) { 1673 if (afterTime === void 0) { 1674 afterTime = this._time; 1675 } 1676 return _getLabelInDirection(this, _parsePosition(this, afterTime)); 1677 }; 1678 _proto2.previousLabel = function previousLabel(beforeTime) { 1679 if (beforeTime === void 0) { 1680 beforeTime = this._time; 1681 } 1682 return _getLabelInDirection(this, _parsePosition(this, beforeTime), 1); 1683 }; 1684 _proto2.currentLabel = function currentLabel(value) { 1685 return arguments.length ? this.seek(value, true) : this.previousLabel(this._time + _tinyNum); 1686 }; 1687 _proto2.shiftChildren = function shiftChildren(amount, adjustLabels, ignoreBeforeTime) { 1688 if (ignoreBeforeTime === void 0) { 1689 ignoreBeforeTime = 0; 1690 } 1691 var child = this._first, labels = this.labels, p; 1692 while (child) { 1693 if (child._start >= ignoreBeforeTime) { 1694 child._start += amount; 1695 child._end += amount; 1696 } 1697 child = child._next; 1698 } 1699 if (adjustLabels) { 1700 for (p in labels) { 1701 if (labels[p] >= ignoreBeforeTime) { 1702 labels[p] += amount; 1703 } 1704 } 1705 } 1706 return _uncache(this); 1707 };
vendor: 10,776 bytes, lines 1708-1937
1708 _proto2.invalidate = function invalidate(soft) { 1709 var child = this._first; 1710 this._lock = 0; 1711 while (child) { 1712 child.invalidate(soft); 1713 child = child._next; 1714 } 1715 return _Animation.prototype.invalidate.call(this, soft); 1716 }; 1717 _proto2.clear = function clear(includeLabels) { 1718 if (includeLabels === void 0) { 1719 includeLabels = true; 1720 } 1721 var child = this._first, next; 1722 while (child) { 1723 next = child._next; 1724 this.remove(child); 1725 child = next; 1726 } 1727 this._dp && (this._time = this._tTime = this._pTime = 0); 1728 includeLabels && (this.labels = {}); 1729 return _uncache(this); 1730 }; 1731 _proto2.totalDuration = function totalDuration(value) { 1732 var max = 0, self = this, child = self._last, prevStart = _bigNum$1, prev, start, parent; 1733 if (arguments.length) { 1734 return self.timeScale((self._repeat < 0 ? self.duration() : self.totalDuration()) / (self.reversed() ? -value : value)); 1735 } 1736 if (self._dirty) { 1737 parent = self.parent; 1738 while (child) { 1739 prev = child._prev; 1740 child._dirty && child.totalDuration(); 1741 start = child._start; 1742 if (start > prevStart && self._sort && child._ts && !self._lock) { 1743 self._lock = 1; 1744 _addToTimeline(self, child, start - child._delay, 1)._lock = 0; 1745 } else { 1746 prevStart = start; 1747 } 1748 if (start < 0 && child._ts) { 1749 max -= start; 1750 if (!parent && !self._dp || parent && parent.smoothChildTiming) { 1751 self._start += start / self._ts; 1752 self._time -= start; 1753 self._tTime -= start; 1754 } 1755 self.shiftChildren(-start, false, -Infinity); 1756 prevStart = 0; 1757 } 1758 child._end > max && child._ts && (max = child._end); 1759 child = prev; 1760 } 1761 _setDuration(self, self === _globalTimeline && self._time > max ? self._time : max, 1, 1); 1762 self._dirty = 0; 1763 } 1764 return self._tDur; 1765 }; 1766 Timeline2.updateRoot = function updateRoot(time) { 1767 if (_globalTimeline._ts) { 1768 _lazySafeRender(_globalTimeline, _parentToChildTotalTime(time, _globalTimeline)); 1769 _lastRenderedFrame = _ticker.frame; 1770 } 1771 if (_ticker.frame >= _nextGCFrame) { 1772 _nextGCFrame += _config.autoSleep || 120; 1773 var child = _globalTimeline._first; 1774 if (!child || !child._ts) { 1775 if (_config.autoSleep && _ticker._listeners.length < 2) { 1776 while (child && !child._ts) { 1777 child = child._next; 1778 } 1779 child || _ticker.sleep(); 1780 } 1781 } 1782 } 1783 }; 1784 return Timeline2; 1785}(Animation); 1786_setDefaults(Timeline.prototype, { 1787 _lock: 0, 1788 _hasPause: 0, 1789 _forcing: 0 1790}); 1791var _addComplexStringPropTween = function _addComplexStringPropTween2(target, prop, start, end, setter, stringFilter, funcParam) { 1792 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; 1793 pt.b = start; 1794 pt.e = end; 1795 start += ""; 1796 end += ""; 1797 if (hasRandom = ~end.indexOf("random(")) { 1798 end = _replaceRandom(end); 1799 } 1800 if (stringFilter) { 1801 a = [start, end]; 1802 stringFilter(a, target, prop); 1803 start = a[0]; 1804 end = a[1]; 1805 } 1806 startNums = start.match(_complexStringNumExp) || []; 1807 while (result = _complexStringNumExp.exec(end)) { 1808 endNum = result[0]; 1809 chunk = end.substring(index, result.index); 1810 if (color) { 1811 color = (color + 1) % 5; 1812 } else if (chunk.substr(-5) === "rgba(") { 1813 color = 1; 1814 } 1815 if (endNum !== startNums[matchIndex++]) { 1816 startNum = parseFloat(startNums[matchIndex - 1]) || 0; 1817 pt._pt = { 1818 _next: pt._pt, 1819 p: chunk || matchIndex === 1 ? chunk : ",", 1820 //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. 1821 s: startNum, 1822 c: endNum.charAt(1) === "=" ? _parseRelative(startNum, endNum) - startNum : parseFloat(endNum) - startNum, 1823 m: color && color < 4 ? Math.round : 0 1824 }; 1825 index = _complexStringNumExp.lastIndex; 1826 } 1827 } 1828 pt.c = index < end.length ? end.substring(index, end.length) : ""; 1829 pt.fp = funcParam; 1830 if (_relExp.test(end) || hasRandom) { 1831 pt.e = 0; 1832 } 1833 this._pt = pt; 1834 return pt; 1835}, _addPropTween = function _addPropTween2(target, prop, start, end, index, targets, modifier, stringFilter, funcParam, optional) { 1836 _isFunction(end) && (end = end(index || 0, target, targets)); 1837 var currentValue = target[prop], parsedStart = start !== "get" ? start : !_isFunction(currentValue) ? currentValue : funcParam ? target[prop.indexOf("set") || !_isFunction(target["get" + prop.substr(3)]) ? prop : "get" + prop.substr(3)](funcParam) : target[prop](), setter = !_isFunction(currentValue) ? _setterPlain : funcParam ? _setterFuncWithParam : _setterFunc, pt; 1838 if (_isString(end)) { 1839 if (~end.indexOf("random(")) { 1840 end = _replaceRandom(end); 1841 } 1842 if (end.charAt(1) === "=") { 1843 pt = _parseRelative(parsedStart, end) + (getUnit(parsedStart) || 0); 1844 if (pt || pt === 0) { 1845 end = pt; 1846 } 1847 } 1848 } 1849 if (!optional || parsedStart !== end || _forceAllPropTweens) { 1850 if (!isNaN(parsedStart * end) && end !== "") { 1851 pt = new PropTween(this._pt, target, prop, +parsedStart || 0, end - (parsedStart || 0), typeof currentValue === "boolean" ? _renderBoolean : _renderPlain, 0, setter); 1852 funcParam && (pt.fp = funcParam); 1853 modifier && pt.modifier(modifier, this, target); 1854 return this._pt = pt; 1855 } 1856 !currentValue && !(prop in target) && _missingPlugin(prop, end); 1857 return _addComplexStringPropTween.call(this, target, prop, parsedStart, end, setter, stringFilter || _config.stringFilter, funcParam); 1858 } 1859}, _processVars = function _processVars2(vars, index, target, targets, tween) { 1860 _isFunction(vars) && (vars = _parseFuncOrString(vars, tween, index, target, targets)); 1861 if (!_isObject(vars) || vars.style && vars.nodeType || _isArray(vars) || _isTypedArray(vars)) { 1862 return _isString(vars) ? _parseFuncOrString(vars, tween, index, target, targets) : vars; 1863 } 1864 var copy = {}, p; 1865 for (p in vars) { 1866 copy[p] = _parseFuncOrString(vars[p], tween, index, target, targets); 1867 } 1868 return copy; 1869}, _checkPlugin = function _checkPlugin2(property, vars, tween, index, target, targets) { 1870 var plugin, pt, ptLookup, i; 1871 if (_plugins[property] && (plugin = new _plugins[property]()).init(target, plugin.rawVars ? vars[property] : _processVars(vars[property], index, target, targets, tween), tween, index, targets) !== false) { 1872 tween._pt = pt = new PropTween(tween._pt, target, property, 0, 1, plugin.render, plugin, 0, plugin.priority); 1873 if (tween !== _quickTween) { 1874 ptLookup = tween._ptLookup[tween._targets.indexOf(target)]; 1875 i = plugin._props.length; 1876 while (i--) { 1877 ptLookup[plugin._props[i]] = pt; 1878 } 1879 } 1880 } 1881 return plugin; 1882}, _overwritingTween, _forceAllPropTweens, _initTween = function _initTween2(tween, time, tTime) { 1883 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, tl = tween.timeline, cleanVars, i, p, pt, target, hasPriority, gsData, harness, plugin, ptLookup, index, harnessVars, overwritten; 1884 tl && (!keyframes || !ease) && (ease = "none"); 1885 tween._ease = _parseEase(ease, _defaults.ease); 1886 tween._yEase = yoyoEase ? _invertEase(_parseEase(yoyoEase === true ? ease : yoyoEase, _defaults.ease)) : 0; 1887 if (yoyoEase && tween._yoyo && !tween._repeat) { 1888 yoyoEase = tween._yEase; 1889 tween._yEase = tween._ease; 1890 tween._ease = yoyoEase; 1891 } 1892 tween._from = !tl && !!vars.runBackwards; 1893 if (!tl || keyframes && !vars.stagger) { 1894 harness = targets[0] ? _getCache(targets[0]).harness : 0; 1895 harnessVars = harness && vars[harness.prop]; 1896 cleanVars = _copyExcluding(vars, _reservedProps); 1897 if (prevStartAt) { 1898 prevStartAt._zTime < 0 && prevStartAt.progress(1); 1899 time < 0 && runBackwards && immediateRender && !autoRevert ? prevStartAt.render(-1, true) : prevStartAt.revert(runBackwards && dur ? _revertConfigNoKill : _startAtRevertConfig); 1900 prevStartAt._lazy = 0; 1901 } 1902 if (startAt) { 1903 _removeFromParent(tween._startAt = Tween.set(targets, _setDefaults({ 1904 data: "isStart", 1905 overwrite: false, 1906 parent, 1907 immediateRender: true, 1908 lazy: !prevStartAt && _isNotFalse(lazy), 1909 startAt: null, 1910 delay: 0, 1911 onUpdate: onUpdate && function() { 1912 return _callback(tween, "onUpdate"); 1913 }, 1914 stagger: 0 1915 }, startAt))); 1916 tween._startAt._dp = 0; 1917 tween._startAt._sat = tween; 1918 time < 0 && (_reverting$1 || !immediateRender && !autoRevert) && tween._startAt.revert(_revertConfigNoKill); 1919 if (immediateRender) { 1920 if (dur && time <= 0 && tTime <= 0) { 1921 time && (tween._zTime = time); 1922 return; 1923 } 1924 } 1925 } else if (runBackwards && dur) { 1926 if (!prevStartAt) { 1927 time && (immediateRender = false); 1928 p = _setDefaults({ 1929 overwrite: false, 1930 data: "isFromStart", 1931 //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. 1932 lazy: immediateRender && !prevStartAt && _isNotFalse(lazy), 1933 immediateRender, 1934 //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) 1935 stagger: 0, 1936 parent 1937 //ensures that nested tweens that had a stagger are handled properly, like gsap.from(".class", {y: gsap.utils.wrap([-100,100]), stagger: 0.5}
vendor: 8,299 bytes, lines 1937-2125
1937) 1938 }, cleanVars); 1939 harnessVars && (p[harness.prop] = harnessVars); 1940 _removeFromParent(tween._startAt = Tween.set(targets, p)); 1941 tween._startAt._dp = 0; 1942 tween._startAt._sat = tween; 1943 time < 0 && (_reverting$1 ? tween._startAt.revert(_revertConfigNoKill) : tween._startAt.render(-1, true)); 1944 tween._zTime = time; 1945 if (!immediateRender) { 1946 _initTween2(tween._startAt, _tinyNum, _tinyNum); 1947 } else if (!time) { 1948 return; 1949 } 1950 } 1951 } 1952 tween._pt = tween._ptCache = 0; 1953 lazy = dur && _isNotFalse(lazy) || lazy && !dur; 1954 for (i = 0; i < targets.length; i++) { 1955 target = targets[i]; 1956 gsData = target._gsap || _harness(targets)[i]._gsap; 1957 tween._ptLookup[i] = ptLookup = {}; 1958 _lazyLookup[gsData.id] && _lazyTweens.length && _lazyRender(); 1959 index = fullTargets === targets ? i : fullTargets.indexOf(target); 1960 if (harness && (plugin = new harness()).init(target, harnessVars || cleanVars, tween, index, fullTargets) !== false) { 1961 tween._pt = pt = new PropTween(tween._pt, target, plugin.name, 0, 1, plugin.render, plugin, 0, plugin.priority); 1962 plugin._props.forEach(function(name) { 1963 ptLookup[name] = pt; 1964 }); 1965 plugin.priority && (hasPriority = 1); 1966 } 1967 if (!harness || harnessVars) { 1968 for (p in cleanVars) { 1969 if (_plugins[p] && (plugin = _checkPlugin(p, cleanVars, tween, index, target, fullTargets))) { 1970 plugin.priority && (hasPriority = 1); 1971 } else { 1972 ptLookup[p] = pt = _addPropTween.call(tween, target, p, "get", cleanVars[p], index, fullTargets, 0, vars.stringFilter); 1973 } 1974 } 1975 } 1976 tween._op && tween._op[i] && tween.kill(target, tween._op[i]); 1977 if (autoOverwrite && tween._pt) { 1978 _overwritingTween = tween; 1979 _globalTimeline.killTweensOf(target, ptLookup, tween.globalTime(time)); 1980 overwritten = !tween.parent; 1981 _overwritingTween = 0; 1982 } 1983 tween._pt && lazy && (_lazyLookup[gsData.id] = 1); 1984 } 1985 hasPriority && _sortPropTweensByPriority(tween); 1986 tween._onInit && tween._onInit(tween); 1987 } 1988 tween._onUpdate = onUpdate; 1989 tween._initted = (!tween._op || tween._pt) && !overwritten; 1990 keyframes && time <= 0 && tl.render(_bigNum$1, true, true); 1991}, _updatePropTweens = function _updatePropTweens2(tween, property, value, start, startIsRelative, ratio, time, skipRecursion) { 1992 var ptCache = (tween._pt && tween._ptCache || (tween._ptCache = {}))[property], pt, rootPT, lookup, i; 1993 if (!ptCache) { 1994 ptCache = tween._ptCache[property] = []; 1995 lookup = tween._ptLookup; 1996 i = tween._targets.length; 1997 while (i--) { 1998 pt = lookup[i][property]; 1999 if (pt && pt.d && pt.d._pt) { 2000 pt = pt.d._pt; 2001 while (pt && pt.p !== property && pt.fp !== property) { 2002 pt = pt._next; 2003 } 2004 } 2005 if (!pt) { 2006 _forceAllPropTweens = 1; 2007 tween.vars[property] = "+=0"; 2008 _initTween(tween, time); 2009 _forceAllPropTweens = 0; 2010 return skipRecursion ? _warn(property + " not eligible for reset") : 1; 2011 } 2012 ptCache.push(pt); 2013 } 2014 } 2015 i = ptCache.length; 2016 while (i--) { 2017 rootPT = ptCache[i]; 2018 pt = rootPT._pt || rootPT; 2019 pt.s = (start || start === 0) && !startIsRelative ? start : pt.s + (start || 0) + ratio * pt.c; 2020 pt.c = value - pt.s; 2021 rootPT.e && (rootPT.e = _round(value) + getUnit(rootPT.e)); 2022 rootPT.b && (rootPT.b = pt.s + getUnit(rootPT.b)); 2023 } 2024}, _addAliasesToVars = function _addAliasesToVars2(targets, vars) { 2025 var harness = targets[0] ? _getCache(targets[0]).harness : 0, propertyAliases = harness && harness.aliases, copy, p, i, aliases; 2026 if (!propertyAliases) { 2027 return vars; 2028 } 2029 copy = _merge({}, vars); 2030 for (p in propertyAliases) { 2031 if (p in copy) { 2032 aliases = propertyAliases[p].split(","); 2033 i = aliases.length; 2034 while (i--) { 2035 copy[aliases[i]] = copy[p]; 2036 } 2037 } 2038 } 2039 return copy; 2040}, _parseKeyframe = function _parseKeyframe2(prop, obj, allProps, easeEach) { 2041 var ease = obj.ease || easeEach || "power1.inOut", p, a; 2042 if (_isArray(obj)) { 2043 a = allProps[prop] || (allProps[prop] = []); 2044 obj.forEach(function(value, i) { 2045 return a.push({ 2046 t: i / (obj.length - 1) * 100, 2047 v: value, 2048 e: ease 2049 }); 2050 }); 2051 } else { 2052 for (p in obj) { 2053 a = allProps[p] || (allProps[p] = []); 2054 p === "ease" || a.push({ 2055 t: parseFloat(prop), 2056 v: obj[p], 2057 e: ease 2058 }); 2059 } 2060 } 2061}, _parseFuncOrString = function _parseFuncOrString2(value, tween, i, target, targets) { 2062 return _isFunction(value) ? value.call(tween, i, target, targets) : _isString(value) && ~value.indexOf("random(") ? _replaceRandom(value) : value; 2063}, _staggerTweenProps = _callbackNames + "repeat,repeatDelay,yoyo,repeatRefresh,yoyoEase,autoRevert", _staggerPropsToSkip = {}; 2064_forEachName(_staggerTweenProps + ",id,stagger,delay,duration,paused,scrollTrigger", function(name) { 2065 return _staggerPropsToSkip[name] = 1; 2066}); 2067var Tween = /* @__PURE__ */ function(_Animation2) { 2068 _inheritsLoose(Tween2, _Animation2); 2069 function Tween2(targets, vars, position, skipInherit) { 2070 var _this3; 2071 if (typeof vars === "number") { 2072 position.duration = vars; 2073 vars = position; 2074 position = null; 2075 } 2076 _this3 = _Animation2.call(this, skipInherit ? vars : _inheritDefaults(vars)) || this; 2077 var _this3$vars = _this3.vars, duration = _this3$vars.duration, delay2 = _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(targets[0]) : "length" in vars) ? [targets] : toArray(targets), tl, i, copy, l, p, curTarget, staggerFunc, staggerVarsToMerge; 2078 _this3._targets = parsedTargets.length ? _harness(parsedTargets) : _warn("GSAP target " + targets + " not found. https://gsap.com", !_config.nullTargetWarn) || []; 2079 _this3._ptLookup = []; 2080 _this3._overwrite = overwrite; 2081 if (keyframes || stagger || _isFuncOrString(duration) || _isFuncOrString(delay2)) { 2082 vars = _this3.vars; 2083 tl = _this3.timeline = new Timeline({ 2084 data: "nested", 2085 defaults: defaults2 || {}, 2086 targets: parent && parent.data === "nested" ? parent.vars.targets : parsedTargets 2087 }); 2088 tl.kill(); 2089 tl.parent = tl._dp = _assertThisInitialized(_this3); 2090 tl._start = 0; 2091 if (stagger || _isFuncOrString(duration) || _isFuncOrString(delay2)) { 2092 l = parsedTargets.length; 2093 staggerFunc = stagger && distribute(stagger); 2094 if (_isObject(stagger)) { 2095 for (p in stagger) { 2096 if (~_staggerTweenProps.indexOf(p)) { 2097 staggerVarsToMerge || (staggerVarsToMerge = {}); 2098 staggerVarsToMerge[p] = stagger[p]; 2099 } 2100 } 2101 } 2102 for (i = 0; i < l; i++) { 2103 copy = _copyExcluding(vars, _staggerPropsToSkip); 2104 copy.stagger = 0; 2105 yoyoEase && (copy.yoyoEase = yoyoEase); 2106 staggerVarsToMerge && _merge(copy, staggerVarsToMerge); 2107 curTarget = parsedTargets[i]; 2108 copy.duration = +_parseFuncOrString(duration, _assertThisInitialized(_this3), i, curTarget, parsedTargets); 2109 copy.delay = (+_parseFuncOrString(delay2, _assertThisInitialized(_this3), i, curTarget, parsedTargets) || 0) - _this3._delay; 2110 if (!stagger && l === 1 && copy.delay) { 2111 _this3._delay = delay2 = copy.delay; 2112 _this3._start += delay2; 2113 copy.delay = 0; 2114 } 2115 tl.to(curTarget, copy, staggerFunc ? staggerFunc(i, curTarget, parsedTargets) : 0); 2116 tl._ease = _easeMap.none; 2117 } 2118 tl.duration() ? duration = delay2 = 0 : _this3.timeline = 0; 2119 } else if (keyframes) { 2120 _inheritDefaults(_setDefaults(tl.vars.defaults, { 2121 ease: "none" 2122 })); 2123 tl._ease = _parseEase(keyframes.ease || vars.ease || "none"); 2124 var time = 0, a, kf, v; 2125 if (_isArray(keyframes)) {
vendor: 6,019 bytes, lines 2126-2270
2126 keyframes.forEach(function(frame) { 2127 return tl.to(parsedTargets, frame, ">"); 2128 }); 2129 tl.duration(); 2130 } else { 2131 copy = {}; 2132 for (p in keyframes) { 2133 p === "ease" || p === "easeEach" || _parseKeyframe(p, keyframes[p], copy, keyframes.easeEach); 2134 } 2135 for (p in copy) { 2136 a = copy[p].sort(function(a2, b) { 2137 return a2.t - b.t; 2138 }); 2139 time = 0; 2140 for (i = 0; i < a.length; i++) { 2141 kf = a[i]; 2142 v = { 2143 ease: kf.e, 2144 duration: (kf.t - (i ? a[i - 1].t : 0)) / 100 * duration 2145 }; 2146 v[p] = kf.v; 2147 tl.to(parsedTargets, v, time); 2148 time += v.duration; 2149 } 2150 } 2151 tl.duration() < duration && tl.to({}, { 2152 duration: duration - tl.duration() 2153 }); 2154 } 2155 } 2156 duration || _this3.duration(duration = tl.duration()); 2157 } else { 2158 _this3.timeline = 0; 2159 } 2160 if (overwrite === true && !_suppressOverwrites) { 2161 _overwritingTween = _assertThisInitialized(_this3); 2162 _globalTimeline.killTweensOf(parsedTargets); 2163 _overwritingTween = 0; 2164 } 2165 _addToTimeline(parent, _assertThisInitialized(_this3), position); 2166 vars.reversed && _this3.reverse(); 2167 vars.paused && _this3.paused(true); 2168 if (immediateRender || !duration && !keyframes && _this3._start === _roundPrecise(parent._time) && _isNotFalse(immediateRender) && _hasNoPausedAncestors(_assertThisInitialized(_this3)) && parent.data !== "nested") { 2169 _this3._tTime = -_tinyNum; 2170 _this3.render(Math.max(0, -delay2) || 0); 2171 } 2172 scrollTrigger && _scrollTrigger(_assertThisInitialized(_this3), scrollTrigger); 2173 return _this3; 2174 } 2175 var _proto3 = Tween2.prototype; 2176 _proto3.render = function render3(totalTime, suppressEvents, force) { 2177 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; 2178 if (!dur) { 2179 _renderZeroDurationTween(this, totalTime, suppressEvents, force); 2180 } else if (tTime !== this._tTime || !totalTime || force || !this._initted && this._tTime || this._startAt && this._zTime < 0 !== isNegative) { 2181 time = tTime; 2182 timeline2 = this.timeline; 2183 if (this._repeat) { 2184 cycleDuration = dur + this._rDelay; 2185 if (this._repeat < -1 && isNegative) { 2186 return this.totalTime(cycleDuration * 100 + totalTime, suppressEvents, force); 2187 } 2188 time = _roundPrecise(tTime % cycleDuration); 2189 if (tTime === tDur) { 2190 iteration = this._repeat; 2191 time = dur; 2192 } else { 2193 iteration = ~~(tTime / cycleDuration); 2194 if (iteration && iteration === _roundPrecise(tTime / cycleDuration)) { 2195 time = dur; 2196 iteration--; 2197 } 2198 time > dur && (time = dur); 2199 } 2200 isYoyo = this._yoyo && iteration & 1; 2201 if (isYoyo) { 2202 yoyoEase = this._yEase; 2203 time = dur - time; 2204 } 2205 prevIteration = _animationCycle(this._tTime, cycleDuration); 2206 if (time === prevTime && !force && this._initted && iteration === prevIteration) { 2207 this._tTime = tTime; 2208 return this; 2209 } 2210 if (iteration !== prevIteration) { 2211 timeline2 && this._yEase && _propagateYoyoEase(timeline2, isYoyo); 2212 if (this.vars.repeatRefresh && !isYoyo && !this._lock && this._time !== cycleDuration && this._initted) { 2213 this._lock = force = 1; 2214 this.render(_roundPrecise(cycleDuration * iteration), true).invalidate()._lock = 0; 2215 } 2216 } 2217 } 2218 if (!this._initted) { 2219 if (_attemptInitTween(this, isNegative ? totalTime : time, force, suppressEvents, tTime)) { 2220 this._tTime = 0; 2221 return this; 2222 } 2223 if (prevTime !== this._time && !(force && this.vars.repeatRefresh && iteration !== prevIteration)) { 2224 return this; 2225 } 2226 if (dur !== this._dur) { 2227 return this.render(totalTime, suppressEvents, force); 2228 } 2229 } 2230 this._tTime = tTime; 2231 this._time = time; 2232 if (!this._act && this._ts) { 2233 this._act = 1; 2234 this._lazy = 0; 2235 } 2236 this.ratio = ratio = (yoyoEase || this._ease)(time / dur); 2237 if (this._from) { 2238 this.ratio = ratio = 1 - ratio; 2239 } 2240 if (time && !prevTime && !suppressEvents && !iteration) { 2241 _callback(this, "onStart"); 2242 if (this._tTime !== tTime) { 2243 return this; 2244 } 2245 } 2246 pt = this._pt; 2247 while (pt) { 2248 pt.r(ratio, pt.d); 2249 pt = pt._next; 2250 } 2251 timeline2 && timeline2.render(totalTime < 0 ? totalTime : timeline2._dur * timeline2._ease(time / this._dur), suppressEvents, force) || this._startAt && (this._zTime = totalTime); 2252 if (this._onUpdate && !suppressEvents) { 2253 isNegative && _rewindStartAt(this, totalTime, suppressEvents, force); 2254 _callback(this, "onUpdate"); 2255 } 2256 this._repeat && iteration !== prevIteration && this.vars.onRepeat && !suppressEvents && this.parent && _callback(this, "onRepeat"); 2257 if ((tTime === this._tDur || !tTime) && this._tTime === tTime) { 2258 isNegative && !this._onUpdate && _rewindStartAt(this, totalTime, true, true); 2259 (totalTime || !dur) && (tTime === this._tDur && this._ts > 0 || !tTime && this._ts < 0) && _removeFromParent(this, 1); 2260 if (!suppressEvents && !(isNegative && !prevTime) && (tTime || prevTime || isYoyo)) { 2261 _callback(this, tTime === tDur ? "onComplete" : "onReverseComplete", true); 2262 this._prom && !(tTime < tDur && this.timeScale() > 0) && this._prom(); 2263 } 2264 } 2265 } 2266 return this; 2267 }; 2268 _proto3.targets = function targets() { 2269 return this._targets; 2270 };
vendor: 18,664 bytes, lines 2271-2796
2271 _proto3.invalidate = function invalidate(soft) { 2272 (!soft || !this.vars.runBackwards) && (this._startAt = 0); 2273 this._pt = this._op = this._onUpdate = this._lazy = this.ratio = 0; 2274 this._ptLookup = []; 2275 this.timeline && this.timeline.invalidate(soft); 2276 return _Animation2.prototype.invalidate.call(this, soft); 2277 }; 2278 _proto3.resetTo = function resetTo(property, value, start, startIsRelative, skipRecursion) { 2279 _tickerActive || _ticker.wake(); 2280 this._ts || this.play(); 2281 var time = Math.min(this._dur, (this._dp._time - this._start) * this._ts), ratio; 2282 this._initted || _initTween(this, time); 2283 ratio = this._ease(time / this._dur); 2284 if (_updatePropTweens(this, property, value, start, startIsRelative, ratio, time, skipRecursion)) { 2285 return this.resetTo(property, value, start, startIsRelative, 1); 2286 } 2287 _alignPlayhead(this, 0); 2288 this.parent || _addLinkedListItem(this._dp, this, "_first", "_last", this._dp._sort ? "_start" : 0); 2289 return this.render(0); 2290 }; 2291 _proto3.kill = function kill(targets, vars) { 2292 if (vars === void 0) { 2293 vars = "all"; 2294 } 2295 if (!targets && (!vars || vars === "all")) { 2296 this._lazy = this._pt = 0; 2297 return this.parent ? _interrupt(this) : this; 2298 } 2299 if (this.timeline) { 2300 var tDur = this.timeline.totalDuration(); 2301 this.timeline.killTweensOf(targets, vars, _overwritingTween && _overwritingTween.vars.overwrite !== true)._first || _interrupt(this); 2302 this.parent && tDur !== this.timeline.totalDuration() && _setDuration(this, this._dur * this.timeline._tDur / tDur, 0, 1); 2303 return this; 2304 } 2305 var parsedTargets = this._targets, killingTargets = targets ? toArray(targets) : parsedTargets, propTweenLookup = this._ptLookup, firstPT = this._pt, overwrittenProps, curLookup, curOverwriteProps, props, p, pt, i; 2306 if ((!vars || vars === "all") && _arraysMatch(parsedTargets, killingTargets)) { 2307 vars === "all" && (this._pt = 0); 2308 return _interrupt(this); 2309 } 2310 overwrittenProps = this._op = this._op || []; 2311 if (vars !== "all") { 2312 if (_isString(vars)) { 2313 p = {}; 2314 _forEachName(vars, function(name) { 2315 return p[name] = 1; 2316 }); 2317 vars = p; 2318 } 2319 vars = _addAliasesToVars(parsedTargets, vars); 2320 } 2321 i = parsedTargets.length; 2322 while (i--) { 2323 if (~killingTargets.indexOf(parsedTargets[i])) { 2324 curLookup = propTweenLookup[i]; 2325 if (vars === "all") { 2326 overwrittenProps[i] = vars; 2327 props = curLookup; 2328 curOverwriteProps = {}; 2329 } else { 2330 curOverwriteProps = overwrittenProps[i] = overwrittenProps[i] || {}; 2331 props = vars; 2332 } 2333 for (p in props) { 2334 pt = curLookup && curLookup[p]; 2335 if (pt) { 2336 if (!("kill" in pt.d) || pt.d.kill(p) === true) { 2337 _removeLinkedListItem(this, pt, "_pt"); 2338 } 2339 delete curLookup[p]; 2340 } 2341 if (curOverwriteProps !== "all") { 2342 curOverwriteProps[p] = 1; 2343 } 2344 } 2345 } 2346 } 2347 this._initted && !this._pt && firstPT && _interrupt(this); 2348 return this; 2349 }; 2350 Tween2.to = function to(targets, vars) { 2351 return new Tween2(targets, vars, arguments[2]); 2352 }; 2353 Tween2.from = function from(targets, vars) { 2354 return _createTweenType(1, arguments); 2355 }; 2356 Tween2.delayedCall = function delayedCall(delay2, callback, params, scope) { 2357 return new Tween2(callback, 0, { 2358 immediateRender: false, 2359 lazy: false, 2360 overwrite: false, 2361 delay: delay2, 2362 onComplete: callback, 2363 onReverseComplete: callback, 2364 onCompleteParams: params, 2365 onReverseCompleteParams: params, 2366 callbackScope: scope 2367 }); 2368 }; 2369 Tween2.fromTo = function fromTo(targets, fromVars, toVars) { 2370 return _createTweenType(2, arguments); 2371 }; 2372 Tween2.set = function set(targets, vars) { 2373 vars.duration = 0; 2374 vars.repeatDelay || (vars.repeat = 0); 2375 return new Tween2(targets, vars); 2376 }; 2377 Tween2.killTweensOf = function killTweensOf(targets, props, onlyActive) { 2378 return _globalTimeline.killTweensOf(targets, props, onlyActive); 2379 }; 2380 return Tween2; 2381}(Animation); 2382_setDefaults(Tween.prototype, { 2383 _targets: [], 2384 _lazy: 0, 2385 _startAt: 0, 2386 _op: 0, 2387 _onInit: 0 2388}); 2389_forEachName("staggerTo,staggerFrom,staggerFromTo", function(name) { 2390 Tween[name] = function() { 2391 var tl = new Timeline(), params = _slice.call(arguments, 0); 2392 params.splice(name === "staggerFromTo" ? 5 : 4, 0, 0); 2393 return tl[name].apply(tl, params); 2394 }; 2395}); 2396var _setterPlain = function _setterPlain2(target, property, value) { 2397 return target[property] = value; 2398}, _setterFunc = function _setterFunc2(target, property, value) { 2399 return target[property](value); 2400}, _setterFuncWithParam = function _setterFuncWithParam2(target, property, value, data) { 2401 return target[property](data.fp, value); 2402}, _setterAttribute = function _setterAttribute2(target, property, value) { 2403 return target.setAttribute(property, value); 2404}, _getSetter = function _getSetter2(target, property) { 2405 return _isFunction(target[property]) ? _setterFunc : _isUndefined(target[property]) && target.setAttribute ? _setterAttribute : _setterPlain; 2406}, _renderPlain = function _renderPlain2(ratio, data) { 2407 return data.set(data.t, data.p, Math.round((data.s + data.c * ratio) * 1e6) / 1e6, data); 2408}, _renderBoolean = function _renderBoolean2(ratio, data) { 2409 return data.set(data.t, data.p, !!(data.s + data.c * ratio), data); 2410}, _renderComplexString = function _renderComplexString2(ratio, data) { 2411 var pt = data._pt, s = ""; 2412 if (!ratio && data.b) { 2413 s = data.b; 2414 } else if (ratio === 1 && data.e) { 2415 s = data.e; 2416 } else { 2417 while (pt) { 2418 s = pt.p + (pt.m ? pt.m(pt.s + pt.c * ratio) : Math.round((pt.s + pt.c * ratio) * 1e4) / 1e4) + s; 2419 pt = pt._next; 2420 } 2421 s += data.c; 2422 } 2423 data.set(data.t, data.p, s, data); 2424}, _renderPropTweens = function _renderPropTweens2(ratio, data) { 2425 var pt = data._pt; 2426 while (pt) { 2427 pt.r(ratio, pt.d); 2428 pt = pt._next; 2429 } 2430}, _addPluginModifier = function _addPluginModifier2(modifier, tween, target, property) { 2431 var pt = this._pt, next; 2432 while (pt) { 2433 next = pt._next; 2434 pt.p === property && pt.modifier(modifier, tween, target); 2435 pt = next; 2436 } 2437}, _killPropTweensOf = function _killPropTweensOf2(property) { 2438 var pt = this._pt, hasNonDependentRemaining, next; 2439 while (pt) { 2440 next = pt._next; 2441 if (pt.p === property && !pt.op || pt.op === property) { 2442 _removeLinkedListItem(this, pt, "_pt"); 2443 } else if (!pt.dep) { 2444 hasNonDependentRemaining = 1; 2445 } 2446 pt = next; 2447 } 2448 return !hasNonDependentRemaining; 2449}, _setterWithModifier = function _setterWithModifier2(target, property, value, data) { 2450 data.mSet(target, property, data.m.call(data.tween, value, data.mt), data); 2451}, _sortPropTweensByPriority = function _sortPropTweensByPriority2(parent) { 2452 var pt = parent._pt, next, pt2, first, last; 2453 while (pt) { 2454 next = pt._next; 2455 pt2 = first; 2456 while (pt2 && pt2.pr > pt.pr) { 2457 pt2 = pt2._next; 2458 } 2459 if (pt._prev = pt2 ? pt2._prev : last) { 2460 pt._prev._next = pt; 2461 } else { 2462 first = pt; 2463 } 2464 if (pt._next = pt2) { 2465 pt2._prev = pt; 2466 } else { 2467 last = pt; 2468 } 2469 pt = next; 2470 } 2471 parent._pt = first; 2472}; 2473var PropTween = /* @__PURE__ */ function() { 2474 function PropTween2(next, target, prop, start, change, renderer, data, setter, priority) { 2475 this.t = target; 2476 this.s = start; 2477 this.c = change; 2478 this.p = prop; 2479 this.r = renderer || _renderPlain; 2480 this.d = data || this; 2481 this.set = setter || _setterPlain; 2482 this.pr = priority || 0; 2483 this._next = next; 2484 if (next) { 2485 next._prev = this; 2486 } 2487 } 2488 var _proto4 = PropTween2.prototype; 2489 _proto4.modifier = function modifier(func, tween, target) { 2490 this.mSet = this.mSet || this.set; 2491 this.set = _setterWithModifier; 2492 this.m = func; 2493 this.mt = target; 2494 this.tween = tween; 2495 }; 2496 return PropTween2; 2497}(); 2498_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) { 2499 return _reservedProps[name] = 1; 2500}); 2501_globals.TweenMax = _globals.TweenLite = Tween; 2502_globals.TimelineLite = _globals.TimelineMax = Timeline; 2503_globalTimeline = new Timeline({ 2504 sortChildren: false, 2505 defaults: _defaults, 2506 autoRemoveChildren: true, 2507 id: "root", 2508 smoothChildTiming: true 2509}); 2510_config.stringFilter = _colorStringFilter; 2511var _media = [], _listeners = {}, _emptyArray = [], _lastMediaTime = 0, _contextID = 0, _dispatch = function _dispatch2(type) { 2512 return (_listeners[type] || _emptyArray).map(function(f) { 2513 return f(); 2514 }); 2515}, _onMediaChange = function _onMediaChange2() { 2516 var time = Date.now(), matches = []; 2517 if (time - _lastMediaTime > 2) { 2518 _dispatch("matchMediaInit"); 2519 _media.forEach(function(c) { 2520 var queries = c.queries, conditions = c.conditions, match, p, anyMatch, toggled; 2521 for (p in queries) { 2522 match = _win$1.matchMedia(queries[p]).matches; 2523 match && (anyMatch = 1); 2524 if (match !== conditions[p]) { 2525 conditions[p] = match; 2526 toggled = 1; 2527 } 2528 } 2529 if (toggled) { 2530 c.revert(); 2531 anyMatch && matches.push(c); 2532 } 2533 }); 2534 _dispatch("matchMediaRevert"); 2535 matches.forEach(function(c) { 2536 return c.onMatch(c, function(func) { 2537 return c.add(null, func); 2538 }); 2539 }); 2540 _lastMediaTime = time; 2541 _dispatch("matchMedia"); 2542 } 2543}; 2544var Context = /* @__PURE__ */ function() { 2545 function Context2(func, scope) { 2546 this.selector = scope && selector(scope); 2547 this.data = []; 2548 this._r = []; 2549 this.isReverted = false; 2550 this.id = _contextID++; 2551 func && this.add(func); 2552 } 2553 var _proto5 = Context2.prototype; 2554 _proto5.add = function add(name, func, scope) { 2555 if (_isFunction(name)) { 2556 scope = func; 2557 func = name; 2558 name = _isFunction; 2559 } 2560 var self = this, f = function f2() { 2561 var prev = _context, prevSelector = self.selector, result; 2562 prev && prev !== self && prev.data.push(self); 2563 scope && (self.selector = selector(scope)); 2564 _context = self; 2565 result = func.apply(self, arguments); 2566 _isFunction(result) && self._r.push(result); 2567 _context = prev; 2568 self.selector = prevSelector; 2569 self.isReverted = false; 2570 return result; 2571 }; 2572 self.last = f; 2573 return name === _isFunction ? f(self, function(func2) { 2574 return self.add(null, func2); 2575 }) : name ? self[name] = f : f; 2576 }; 2577 _proto5.ignore = function ignore(func) { 2578 var prev = _context; 2579 _context = null; 2580 func(this); 2581 _context = prev; 2582 }; 2583 _proto5.getTweens = function getTweens() { 2584 var a = []; 2585 this.data.forEach(function(e) { 2586 return e instanceof Context2 ? a.push.apply(a, e.getTweens()) : e instanceof Tween && !(e.parent && e.parent.data === "nested") && a.push(e); 2587 }); 2588 return a; 2589 }; 2590 _proto5.clear = function clear() { 2591 this._r.length = this.data.length = 0; 2592 }; 2593 _proto5.kill = function kill(revert, matchMedia2) { 2594 var _this4 = this; 2595 if (revert) { 2596 (function() { 2597 var tweens = _this4.getTweens(), i2 = _this4.data.length, t; 2598 while (i2--) { 2599 t = _this4.data[i2]; 2600 if (t.data === "isFlip") { 2601 t.revert(); 2602 t.getChildren(true, true, false).forEach(function(tween) { 2603 return tweens.splice(tweens.indexOf(tween), 1); 2604 }); 2605 } 2606 } 2607 tweens.map(function(t2) { 2608 return { 2609 g: t2._dur || t2._delay || t2._sat && !t2._sat.vars.immediateRender ? t2.globalTime(0) : -Infinity, 2610 t: t2 2611 }; 2612 }).sort(function(a, b) { 2613 return b.g - a.g || -Infinity; 2614 }).forEach(function(o) { 2615 return o.t.revert(revert); 2616 }); 2617 i2 = _this4.data.length; 2618 while (i2--) { 2619 t = _this4.data[i2]; 2620 if (t instanceof Timeline) { 2621 if (t.data !== "nested") { 2622 t.scrollTrigger && t.scrollTrigger.revert(); 2623 t.kill(); 2624 } 2625 } else { 2626 !(t instanceof Tween) && t.revert && t.revert(revert); 2627 } 2628 } 2629 _this4._r.forEach(function(f) { 2630 return f(revert, _this4); 2631 }); 2632 _this4.isReverted = true; 2633 })(); 2634 } else { 2635 this.data.forEach(function(e) { 2636 return e.kill && e.kill(); 2637 }); 2638 } 2639 this.clear(); 2640 if (matchMedia2) { 2641 var i = _media.length; 2642 while (i--) { 2643 _media[i].id === this.id && _media.splice(i, 1); 2644 } 2645 } 2646 }; 2647 _proto5.revert = function revert(config3) { 2648 this.kill(config3 || {}); 2649 }; 2650 return Context2; 2651}(); 2652var MatchMedia = /* @__PURE__ */ function() { 2653 function MatchMedia2(scope) { 2654 this.contexts = []; 2655 this.scope = scope; 2656 _context && _context.data.push(this); 2657 } 2658 var _proto6 = MatchMedia2.prototype; 2659 _proto6.add = function add(conditions, func, scope) { 2660 _isObject(conditions) || (conditions = { 2661 matches: conditions 2662 }); 2663 var context3 = new Context(0, scope || this.scope), cond = context3.conditions = {}, mq, p, active; 2664 _context && !context3.selector && (context3.selector = _context.selector); 2665 this.contexts.push(context3); 2666 func = context3.add("onMatch", func); 2667 context3.queries = conditions; 2668 for (p in conditions) { 2669 if (p === "all") { 2670 active = 1; 2671 } else { 2672 mq = _win$1.matchMedia(conditions[p]); 2673 if (mq) { 2674 _media.indexOf(context3) < 0 && _media.push(context3); 2675 (cond[p] = mq.matches) && (active = 1); 2676 mq.addListener ? mq.addListener(_onMediaChange) : mq.addEventListener("change", _onMediaChange); 2677 } 2678 } 2679 } 2680 active && func(context3, function(f) { 2681 return context3.add(null, f); 2682 }); 2683 return this; 2684 }; 2685 _proto6.revert = function revert(config3) { 2686 this.kill(config3 || {}); 2687 }; 2688 _proto6.kill = function kill(revert) { 2689 this.contexts.forEach(function(c) { 2690 return c.kill(revert, true); 2691 }); 2692 }; 2693 return MatchMedia2; 2694}(); 2695var _gsap = { 2696 registerPlugin: function registerPlugin() { 2697 for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { 2698 args[_key2] = arguments[_key2]; 2699 } 2700 args.forEach(function(config3) { 2701 return _createPlugin(config3); 2702 }); 2703 }, 2704 timeline: function timeline(vars) { 2705 return new Timeline(vars); 2706 }, 2707 getTweensOf: function getTweensOf(targets, onlyActive) { 2708 return _globalTimeline.getTweensOf(targets, onlyActive); 2709 }, 2710 getProperty: function getProperty(target, property, unit, uncache) { 2711 _isString(target) && (target = toArray(target)[0]); 2712 var getter = _getCache(target || {}).get, format = unit ? _passThrough : _numericIfPossible; 2713 unit === "native" && (unit = ""); 2714 return !target ? target : !property ? function(property2, unit2, uncache2) { 2715 return format((_plugins[property2] && _plugins[property2].get || getter)(target, property2, unit2, uncache2)); 2716 } : format((_plugins[property] && _plugins[property].get || getter)(target, property, unit, uncache)); 2717 }, 2718 quickSetter: function quickSetter(target, property, unit) { 2719 target = toArray(target); 2720 if (target.length > 1) { 2721 var setters = target.map(function(t) { 2722 return gsap.quickSetter(t, property, unit); 2723 }), l = setters.length; 2724 return function(value) { 2725 var i = l; 2726 while (i--) { 2727 setters[i](value); 2728 } 2729 }; 2730 } 2731 target = target[0] || {}; 2732 var Plugin = _plugins[property], cache = _getCache(target), p = cache.harness && (cache.harness.aliases || {})[property] || property, setter = Plugin ? function(value) { 2733 var p2 = new Plugin(); 2734 _quickTween._pt = 0; 2735 p2.init(target, unit ? value + unit : value, _quickTween, 0, [target]); 2736 p2.render(1, p2); 2737 _quickTween._pt && _renderPropTweens(1, _quickTween); 2738 } : cache.set(target, p); 2739 return Plugin ? setter : function(value) { 2740 return setter(target, p, unit ? value + unit : value, cache, 1); 2741 }; 2742 }, 2743 quickTo: function quickTo(target, property, vars) { 2744 var _merge22; 2745 var tween = gsap.to(target, _merge((_merge22 = {}, _merge22[property] = "+=0.1", _merge22.paused = true, _merge22), vars || {})), func = function func2(value, start, startIsRelative) { 2746 return tween.resetTo(property, value, start, startIsRelative); 2747 }; 2748 func.tween = tween; 2749 return func; 2750 }, 2751 isTweening: function isTweening(targets) { 2752 return _globalTimeline.getTweensOf(targets, true).length > 0; 2753 }, 2754 defaults: function defaults(value) { 2755 value && value.ease && (value.ease = _parseEase(value.ease, _defaults.ease)); 2756 return _mergeDeep(_defaults, value || {}); 2757 }, 2758 config: function config2(value) { 2759 return _mergeDeep(_config, value || {}); 2760 }, 2761 registerEffect: function registerEffect(_ref3) { 2762 var name = _ref3.name, effect = _ref3.effect, plugins = _ref3.plugins, defaults2 = _ref3.defaults, extendTimeline = _ref3.extendTimeline; 2763 (plugins || "").split(",").forEach(function(pluginName) { 2764 return pluginName && !_plugins[pluginName] && !_globals[pluginName] && _warn(name + " effect requires " + pluginName + " plugin."); 2765 }); 2766 _effects[name] = function(targets, vars, tl) { 2767 return effect(toArray(targets), _setDefaults(vars || {}, defaults2), tl); 2768 }; 2769 if (extendTimeline) { 2770 Timeline.prototype[name] = function(targets, vars, position) { 2771 return this.add(_effects[name](targets, _isObject(vars) ? vars : (position = vars) && {}, this), position); 2772 }; 2773 } 2774 }, 2775 registerEase: function registerEase(name, ease) { 2776 _easeMap[name] = _parseEase(ease); 2777 }, 2778 parseEase: function parseEase(ease, defaultEase) { 2779 return arguments.length ? _parseEase(ease, defaultEase) : _easeMap; 2780 }, 2781 getById: function getById(id) { 2782 return _globalTimeline.getById(id); 2783 }, 2784 exportRoot: function exportRoot(vars, includeDelayedCalls) { 2785 if (vars === void 0) { 2786 vars = {}; 2787 } 2788 var tl = new Timeline(vars), child, next; 2789 tl.smoothChildTiming = _isNotFalse(vars.smoothChildTiming); 2790 _globalTimeline.remove(tl); 2791 tl._dp = 0; 2792 tl._time = tl._tTime = _globalTimeline._time; 2793 child = _globalTimeline._first; 2794 while (child) { 2795 next = child._next; 2796 if (includeDelayedCalls || !(!child._dur && child instanceof Tween && child.vars.onComplete === child._targets[0])) {
vendor: 2,139 bytes, lines 2797-2884
2797 _addToTimeline(tl, child, child._start - child._delay); 2798 } 2799 child = next; 2800 } 2801 _addToTimeline(_globalTimeline, tl, 0); 2802 return tl; 2803 }, 2804 context: function context(func, scope) { 2805 return func ? new Context(func, scope) : _context; 2806 }, 2807 matchMedia: function matchMedia(scope) { 2808 return new MatchMedia(scope); 2809 }, 2810 matchMediaRefresh: function matchMediaRefresh() { 2811 return _media.forEach(function(c) { 2812 var cond = c.conditions, found, p; 2813 for (p in cond) { 2814 if (cond[p]) { 2815 cond[p] = false; 2816 found = 1; 2817 } 2818 } 2819 found && c.revert(); 2820 }) || _onMediaChange(); 2821 }, 2822 addEventListener: function addEventListener(type, callback) { 2823 var a = _listeners[type] || (_listeners[type] = []); 2824 ~a.indexOf(callback) || a.push(callback); 2825 }, 2826 removeEventListener: function removeEventListener(type, callback) { 2827 var a = _listeners[type], i = a && a.indexOf(callback); 2828 i >= 0 && a.splice(i, 1); 2829 }, 2830 utils: { 2831 wrap, 2832 wrapYoyo, 2833 distribute, 2834 random, 2835 snap, 2836 normalize, 2837 getUnit, 2838 clamp, 2839 splitColor, 2840 toArray, 2841 selector, 2842 mapRange, 2843 pipe, 2844 unitize, 2845 interpolate, 2846 shuffle 2847 }, 2848 install: _install, 2849 effects: _effects, 2850 ticker: _ticker, 2851 updateRoot: Timeline.updateRoot, 2852 plugins: _plugins, 2853 globalTimeline: _globalTimeline, 2854 core: { 2855 PropTween, 2856 globals: _addGlobal, 2857 Tween, 2858 Timeline, 2859 Animation, 2860 getCache: _getCache, 2861 _removeLinkedListItem, 2862 reverting: function reverting() { 2863 return _reverting$1; 2864 }, 2865 context: function context2(toAdd) { 2866 if (toAdd && _context) { 2867 _context.data.push(toAdd); 2868 toAdd._ctx = _context; 2869 } 2870 return _context; 2871 }, 2872 suppressOverwrites: function suppressOverwrites(value) { 2873 return _suppressOverwrites = value; 2874 } 2875 } 2876}; 2877_forEachName("to,from,fromTo,delayedCall,set,killTweensOf", function(name) { 2878 return _gsap[name] = Tween[name]; 2879}); 2880_ticker.add(Timeline.updateRoot); 2881_quickTween = _gsap.to({}, { 2882 duration: 0 2883}); 2884var _getPluginPropTween = function _getPluginPropTween2(plugin, prop
vendor: 16,384 bytes, lines 2884-3274
2884) { 2885 var pt = plugin._pt; 2886 while (pt && pt.p !== prop && pt.op !== prop && pt.fp !== prop) { 2887 pt = pt._next; 2888 } 2889 return pt; 2890}, _addModifiers = function _addModifiers2(tween, modifiers) { 2891 var targets = tween._targets, p, i, pt; 2892 for (p in modifiers) { 2893 i = targets.length; 2894 while (i--) { 2895 pt = tween._ptLookup[i][p]; 2896 if (pt && (pt = pt.d)) { 2897 if (pt._pt) { 2898 pt = _getPluginPropTween(pt, p); 2899 } 2900 pt && pt.modifier && pt.modifier(modifiers[p], tween, targets[i], p); 2901 } 2902 } 2903 } 2904}, _buildModifierPlugin = function _buildModifierPlugin2(name, modifier) { 2905 return { 2906 name, 2907 rawVars: 1, 2908 //don't pre-process function-based values or "random()" strings. 2909 init: function init4(target, vars, tween) { 2910 tween._onInit = function(tween2) { 2911 var temp, p; 2912 if (_isString(vars)) { 2913 temp = {}; 2914 _forEachName(vars, function(name2) { 2915 return temp[name2] = 1; 2916 }); 2917 vars = temp; 2918 } 2919 if (modifier) { 2920 temp = {}; 2921 for (p in vars) { 2922 temp[p] = modifier(vars[p]); 2923 } 2924 vars = temp; 2925 } 2926 _addModifiers(tween2, vars); 2927 }; 2928 } 2929 }; 2930}; 2931var gsap = _gsap.registerPlugin({ 2932 name: "attr", 2933 init: function init(target, vars, tween, index, targets) { 2934 var p, pt, v; 2935 this.tween = tween; 2936 for (p in vars) { 2937 v = target.getAttribute(p) || ""; 2938 pt = this.add(target, "setAttribute", (v || 0) + "", vars[p], index, targets, 0, 0, p); 2939 pt.op = p; 2940 pt.b = v; 2941 this._props.push(p); 2942 } 2943 }, 2944 render: function render(ratio, data) { 2945 var pt = data._pt; 2946 while (pt) { 2947 _reverting$1 ? pt.set(pt.t, pt.p, pt.b, pt) : pt.r(ratio, pt.d); 2948 pt = pt._next; 2949 } 2950 } 2951}, { 2952 name: "endArray", 2953 init: function init2(target, value) { 2954 var i = value.length; 2955 while (i--) { 2956 this.add(target, i, target[i] || 0, value[i], 0, 0, 0, 0, 0, 1); 2957 } 2958 } 2959}, _buildModifierPlugin("roundProps", _roundModifier), _buildModifierPlugin("modifiers"), _buildModifierPlugin("snap", snap)) || _gsap; 2960Tween.version = Timeline.version = gsap.version = "3.12.5"; 2961_coreReady = 1; 2962_windowExists$1() && _wake(); 2963_easeMap.Power0; 2964_easeMap.Power1; 2965_easeMap.Power2; 2966_easeMap.Power3; 2967_easeMap.Power4; 2968_easeMap.Linear; 2969_easeMap.Quad; 2970_easeMap.Cubic; 2971_easeMap.Quart; 2972_easeMap.Quint; 2973_easeMap.Strong; 2974_easeMap.Elastic; 2975_easeMap.Back; 2976_easeMap.SteppedEase; 2977_easeMap.Bounce; 2978_easeMap.Sine; 2979_easeMap.Expo; 2980_easeMap.Circ; 2981/*! 2982 * CSSPlugin 3.12.5 2983 * https://gsap.com 2984 * 2985 * Copyright 2008-2024, GreenSock. All rights reserved. 2986 * Subject to the terms at https://gsap.com/standard-license or for 2987 * Club GSAP members, the agreement issued with that membership. 2988 * @author: Jack Doyle, [email protected] 2989*/ 2990var _win, _doc, _docElement, _pluginInitted, _tempDiv, _recentSetterPlugin, _reverting, _windowExists2 = function _windowExists3() { 2991 return typeof window !== "undefined"; 2992}, _transformProps = {}, _RAD2DEG = 180 / Math.PI, _DEG2RAD = Math.PI / 180, _atan2 = Math.atan2, _bigNum = 1e8, _capsExp = /([A-Z])/g, _horizontalExp = /(left|right|width|margin|padding|x)/i, _complexExp = /[\s,\(]\S/, _propertyAliases = { 2993 autoAlpha: "opacity,visibility", 2994 scale: "scaleX,scaleY", 2995 alpha: "opacity" 2996}, _renderCSSProp = function _renderCSSProp2(ratio, data) { 2997 return data.set(data.t, data.p, Math.round((data.s + data.c * ratio) * 1e4) / 1e4 + data.u, data); 2998}, _renderPropWithEnd = function _renderPropWithEnd2(ratio, data) { 2999 return data.set(data.t, data.p, ratio === 1 ? data.e : Math.round((data.s + data.c * ratio) * 1e4) / 1e4 + data.u, data); 3000}, _renderCSSPropWithBeginning = function _renderCSSPropWithBeginning2(ratio, data) { 3001 return data.set(data.t, data.p, ratio ? Math.round((data.s + data.c * ratio) * 1e4) / 1e4 + data.u : data.b, data); 3002}, _renderRoundedCSSProp = function _renderRoundedCSSProp2(ratio, data) { 3003 var value = data.s + data.c * ratio; 3004 data.set(data.t, data.p, ~~(value + (value < 0 ? -0.5 : 0.5)) + data.u, data); 3005}, _renderNonTweeningValue = function _renderNonTweeningValue2(ratio, data) { 3006 return data.set(data.t, data.p, ratio ? data.e : data.b, data); 3007}, _renderNonTweeningValueOnlyAtEnd = function _renderNonTweeningValueOnlyAtEnd2(ratio, data) { 3008 return data.set(data.t, data.p, ratio !== 1 ? data.b : data.e, data); 3009}, _setterCSSStyle = function _setterCSSStyle2(target, property, value) { 3010 return target.style[property] = value; 3011}, _setterCSSProp = function _setterCSSProp2(target, property, value) { 3012 return target.style.setProperty(property, value); 3013}, _setterTransform = function _setterTransform2(target, property, value) { 3014 return target._gsap[property] = value; 3015}, _setterScale = function _setterScale2(target, property, value) { 3016 return target._gsap.scaleX = target._gsap.scaleY = value; 3017}, _setterScaleWithRender = function _setterScaleWithRender2(target, property, value, data, ratio) { 3018 var cache = target._gsap; 3019 cache.scaleX = cache.scaleY = value; 3020 cache.renderTransform(ratio, cache); 3021}, _setterTransformWithRender = function _setterTransformWithRender2(target, property, value, data, ratio) { 3022 var cache = target._gsap; 3023 cache[property] = value; 3024 cache.renderTransform(ratio, cache); 3025}, _transformProp = "transform", _transformOriginProp = _transformProp + "Origin", _saveStyle = function _saveStyle2(property, isNotCSS) { 3026 var _this = this; 3027 var target = this.target, style = target.style, cache = target._gsap; 3028 if (property in _transformProps && style) { 3029 this.tfm = this.tfm || {}; 3030 if (property !== "transform") { 3031 property = _propertyAliases[property] || property; 3032 ~property.indexOf(",") ? property.split(",").forEach(function(a) { 3033 return _this.tfm[a] = _get(target, a); 3034 }) : this.tfm[property] = cache.x ? cache[property] : _get(target, property); 3035 property === _transformOriginProp && (this.tfm.zOrigin = cache.zOrigin); 3036 } else { 3037 return _propertyAliases.transform.split(",").forEach(function(p) { 3038 return _saveStyle2.call(_this, p, isNotCSS); 3039 }); 3040 } 3041 if (this.props.indexOf(_transformProp) >= 0) { 3042 return; 3043 } 3044 if (cache.svg) { 3045 this.svgo = target.getAttribute("data-svg-origin"); 3046 this.props.push(_transformOriginProp, isNotCSS, ""); 3047 } 3048 property = _transformProp; 3049 } 3050 (style || isNotCSS) && this.props.push(property, isNotCSS, style[property]); 3051}, _removeIndependentTransforms = function _removeIndependentTransforms2(style) { 3052 if (style.translate) { 3053 style.removeProperty("translate"); 3054 style.removeProperty("scale"); 3055 style.removeProperty("rotate"); 3056 } 3057}, _revertStyle = function _revertStyle2() { 3058 var props = this.props, target = this.target, style = target.style, cache = target._gsap, i, p; 3059 for (i = 0; i < props.length; i += 3) { 3060 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").toLowerCase()); 3061 } 3062 if (this.tfm) { 3063 for (p in this.tfm) { 3064 cache[p] = this.tfm[p]; 3065 } 3066 if (cache.svg) { 3067 cache.renderTransform(); 3068 target.setAttribute("data-svg-origin", this.svgo || ""); 3069 } 3070 i = _reverting(); 3071 if ((!i || !i.isStart) && !style[_transformProp]) { 3072 _removeIndependentTransforms(style); 3073 if (cache.zOrigin && style[_transformOriginProp]) { 3074 style[_transformOriginProp] += " " + cache.zOrigin + "px"; 3075 cache.zOrigin = 0; 3076 cache.renderTransform(); 3077 } 3078 cache.uncache = 1; 3079 } 3080 } 3081}, _getStyleSaver = function _getStyleSaver2(target, properties) { 3082 var saver = { 3083 target, 3084 props: [], 3085 revert: _revertStyle, 3086 save: _saveStyle 3087 }; 3088 target._gsap || gsap.core.getCache(target); 3089 properties && properties.split(",").forEach(function(p) { 3090 return saver.save(p); 3091 }); 3092 return saver; 3093}, _supports3D, _createElement = function _createElement2(type, ns) { 3094 var e = _doc.createElementNS ? _doc.createElementNS((ns || "http://www.w3.org/1999/xhtml").replace(/^https/, "http"), type) : _doc.createElement(type); 3095 return e && e.style ? e : _doc.createElement(type); 3096}, _getComputedProperty = function _getComputedProperty2(target, property, skipPrefixFallback) { 3097 var cs = getComputedStyle(target); 3098 return cs[property] || cs.getPropertyValue(property.replace(_capsExp, "-$1").toLowerCase()) || cs.getPropertyValue(property) || !skipPrefixFallback && _getComputedProperty2(target, _checkPropPrefix(property) || property, 1) || ""; 3099}, _prefixes = "O,Moz,ms,Ms,Webkit".split(","), _checkPropPrefix = function _checkPropPrefix2(property, element, preferPrefix) { 3100 var e = element || _tempDiv, s = e.style, i = 5; 3101 if (property in s && !preferPrefix) { 3102 return property; 3103 } 3104 property = property.charAt(0).toUpperCase() + property.substr(1); 3105 while (i-- && !(_prefixes[i] + property in s)) { 3106 } 3107 return i < 0 ? null : (i === 3 ? "ms" : i >= 0 ? _prefixes[i] : "") + property; 3108}, _initCore = function _initCore2() { 3109 if (_windowExists2() && window.document) { 3110 _win = window; 3111 _doc = _win.document; 3112 _docElement = _doc.documentElement; 3113 _tempDiv = _createElement("div") || { 3114 style: {} 3115 }; 3116 _createElement("div"); 3117 _transformProp = _checkPropPrefix(_transformProp); 3118 _transformOriginProp = _transformProp + "Origin"; 3119 _tempDiv.style.cssText = "border-width:0;line-height:0;position:absolute;padding:0"; 3120 _supports3D = !!_checkPropPrefix("perspective"); 3121 _reverting = gsap.core.reverting; 3122 _pluginInitted = 1; 3123 } 3124}, _getBBoxHack = function _getBBoxHack2(swapIfPossible) { 3125 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; 3126 _docElement.appendChild(svg); 3127 svg.appendChild(this); 3128 this.style.display = "block"; 3129 if (swapIfPossible) { 3130 try { 3131 bbox = this.getBBox(); 3132 this._gsapBBox = this.getBBox; 3133 this.getBBox = _getBBoxHack2; 3134 } catch (e) { 3135 } 3136 } else if (this._gsapBBox) { 3137 bbox = this._gsapBBox(); 3138 } 3139 if (oldParent) { 3140 if (oldSibling) { 3141 oldParent.insertBefore(this, oldSibling); 3142 } else { 3143 oldParent.appendChild(this); 3144 } 3145 } 3146 _docElement.removeChild(svg); 3147 this.style.cssText = oldCSS; 3148 return bbox; 3149}, _getAttributeFallbacks = function _getAttributeFallbacks2(target, attributesArray) { 3150 var i = attributesArray.length; 3151 while (i--) { 3152 if (target.hasAttribute(attributesArray[i])) { 3153 return target.getAttribute(attributesArray[i]); 3154 } 3155 } 3156}, _getBBox = function _getBBox2(target) { 3157 var bounds; 3158 try { 3159 bounds = target.getBBox(); 3160 } catch (error) { 3161 bounds = _getBBoxHack.call(target, true); 3162 } 3163 bounds && (bounds.width || bounds.height) || target.getBBox === _getBBoxHack || (bounds = _getBBoxHack.call(target, true)); 3164 return bounds && !bounds.width && !bounds.x && !bounds.y ? { 3165 x: +_getAttributeFallbacks(target, ["x", "cx", "x1"]) || 0, 3166 y: +_getAttributeFallbacks(target, ["y", "cy", "y1"]) || 0, 3167 width: 0, 3168 height: 0 3169 } : bounds; 3170}, _isSVG = function _isSVG2(e) { 3171 return !!(e.getCTM && (!e.parentNode || e.ownerSVGElement) && _getBBox(e)); 3172}, _removeProperty = function _removeProperty2(target, property) { 3173 if (property) { 3174 var style = target.style, first2Chars; 3175 if (property in _transformProps && property !== _transformOriginProp) { 3176 property = _transformProp; 3177 } 3178 if (style.removeProperty) { 3179 first2Chars = property.substr(0, 2); 3180 if (first2Chars === "ms" || property.substr(0, 6) === "webkit") { 3181 property = "-" + property; 3182 } 3183 style.removeProperty(first2Chars === "--" ? property : property.replace(_capsExp, "-$1").toLowerCase()); 3184 } else { 3185 style.removeAttribute(property); 3186 } 3187 } 3188}, _addNonTweeningPT = function _addNonTweeningPT2(plugin, target, property, beginning, end, onlySetAtEnd) { 3189 var pt = new PropTween(plugin._pt, target, property, 0, 1, onlySetAtEnd ? _renderNonTweeningValueOnlyAtEnd : _renderNonTweeningValue); 3190 plugin._pt = pt; 3191 pt.b = beginning; 3192 pt.e = end; 3193 plugin._props.push(property); 3194 return pt; 3195}, _nonConvertibleUnits = { 3196 deg: 1, 3197 rad: 1, 3198 turn: 1 3199}, _nonStandardLayouts = { 3200 grid: 1, 3201 flex: 1 3202}, _convertToUnit = function _convertToUnit2(target, property, value, unit) { 3203 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; 3204 if (unit === curUnit || !curValue || _nonConvertibleUnits[unit] || _nonConvertibleUnits[curUnit]) { 3205 return curValue; 3206 } 3207 curUnit !== "px" && !toPixels && (curValue = _convertToUnit2(target, property, value, "px")); 3208 isSVG = target.getCTM && _isSVG(target); 3209 if ((toPercent || curUnit === "%") && (_transformProps[property] || ~property.indexOf("adius"))) { 3210 px = isSVG ? target.getBBox()[horizontal ? "width" : "height"] : target[measureProperty]; 3211 return _round(toPercent ? curValue / px * amount : curValue / 100 * px); 3212 } 3213 style[horizontal ? "width" : "height"] = amount + (toPixels ? curUnit : unit); 3214 parent = ~property.indexOf("adius") || unit === "em" && target.appendChild && !isRootSVG ? target : target.parentNode; 3215 if (isSVG) { 3216 parent = (target.ownerSVGElement || {}).parentNode; 3217 } 3218 if (!parent || parent === _doc || !parent.appendChild) { 3219 parent = _doc.body; 3220 } 3221 cache = parent._gsap; 3222 if (cache && toPercent && cache.width && horizontal && cache.time === _ticker.time && !cache.uncache) { 3223 return _round(curValue / cache.width * amount); 3224 } else { 3225 if (toPercent && (property === "height" || property === "width")) { 3226 var v = target.style[property]; 3227 target.style[property] = amount + unit; 3228 px = target[measureProperty]; 3229 v ? target.style[property] = v : _removeProperty(target, property); 3230 } else { 3231 (toPercent || curUnit === "%") && !_nonStandardLayouts[_getComputedProperty(parent, "display")] && (style.position = _getComputedProperty(target, "position")); 3232 parent === target && (style.position = "static"); 3233 parent.appendChild(_tempDiv); 3234 px = _tempDiv[measureProperty]; 3235 parent.removeChild(_tempDiv); 3236 style.position = "absolute"; 3237 } 3238 if (horizontal && toPercent) { 3239 cache = _getCache(parent); 3240 cache.time = _ticker.time; 3241 cache.width = parent[measureProperty]; 3242 } 3243 } 3244 return _round(toPixels ? px * curValue / amount : px && curValue ? amount / px * curValue : 0); 3245}, _get = function _get2(target, property, unit, uncache) { 3246 var value; 3247 _pluginInitted || _initCore(); 3248 if (property in _propertyAliases && property !== "transform") { 3249 property = _propertyAliases[property]; 3250 if (~property.indexOf(",")) { 3251 property = property.split(",")[0]; 3252 } 3253 } 3254 if (_transformProps[property] && property !== "transform") { 3255 value = _parseTransform(target, uncache); 3256 value = property !== "transformOrigin" ? value[property] : value.svg ? value.origin : _firstTwoOnly(_getComputedProperty(target, _transformOriginProp)) + " " + value.zOrigin + "px"; 3257 } else { 3258 value = target.style[property]; 3259 if (!value || value === "auto" || uncache || ~(value + "").indexOf("calc(")) { 3260 value = _specialProps[property] && _specialProps[property](target, property, unit) || _getComputedProperty(target, property) || _getProperty(target, property) || (property === "opacity" ? 1 : 0); 3261 } 3262 } 3263 return unit && !~(value + "").trim().indexOf(" ") ? _convertToUnit(target, property, value, unit) + unit : value; 3264}, _tweenComplexCSSString = function _tweenComplexCSSString2(target, prop, start, end) { 3265 if (!start || start === "none") { 3266 var p = _checkPropPrefix(prop, target, 1), s = p && _getComputedProperty(target, p, 1); 3267 if (s && s !== start) { 3268 prop = p; 3269 start = s; 3270 } else if (prop === "borderColor") { 3271 start = _getComputedProperty(target, "borderTopColor"); 3272 } 3273 } 3274 var pt = new PropTween(this._pt, target.style, prop, 0, 1, _renderComplexString
vendor: 4,200 bytes, lines 3274-3385
3274), index = 0, matchIndex = 0, a, result, startValues, startNum, color, startValue, endValue, endNum, chunk, endUnit, startUnit, endValues; 3275 pt.b = start; 3276 pt.e = end; 3277 start += ""; 3278 end += ""; 3279 if (end === "auto") { 3280 startValue = target.style[prop]; 3281 target.style[prop] = end; 3282 end = _getComputedProperty(target, prop) || end; 3283 startValue ? target.style[prop] = startValue : _removeProperty(target, prop); 3284 } 3285 a = [start, end]; 3286 _colorStringFilter(a); 3287 start = a[0]; 3288 end = a[1]; 3289 startValues = start.match(_numWithUnitExp) || []; 3290 endValues = end.match(_numWithUnitExp) || []; 3291 if (endValues.length) { 3292 while (result = _numWithUnitExp.exec(end)) { 3293 endValue = result[0]; 3294 chunk = end.substring(index, result.index); 3295 if (color) { 3296 color = (color + 1) % 5; 3297 } else if (chunk.substr(-5) === "rgba(" || chunk.substr(-5) === "hsla(") { 3298 color = 1; 3299 } 3300 if (endValue !== (startValue = startValues[matchIndex++] || "")) { 3301 startNum = parseFloat(startValue) || 0; 3302 startUnit = startValue.substr((startNum + "").length); 3303 endValue.charAt(1) === "=" && (endValue = _parseRelative(startNum, endValue) + startUnit); 3304 endNum = parseFloat(endValue); 3305 endUnit = endValue.substr((endNum + "").length); 3306 index = _numWithUnitExp.lastIndex - endUnit.length; 3307 if (!endUnit) { 3308 endUnit = endUnit || _config.units[prop] || startUnit; 3309 if (index === end.length) { 3310 end += endUnit; 3311 pt.e += endUnit; 3312 } 3313 } 3314 if (startUnit !== endUnit) { 3315 startNum = _convertToUnit(target, prop, startValue, endUnit) || 0; 3316 } 3317 pt._pt = { 3318 _next: pt._pt, 3319 p: chunk || matchIndex === 1 ? chunk : ",", 3320 //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. 3321 s: startNum, 3322 c: endNum - startNum, 3323 m: color && color < 4 || prop === "zIndex" ? Math.round : 0 3324 }; 3325 } 3326 } 3327 pt.c = index < end.length ? end.substring(index, end.length) : ""; 3328 } else { 3329 pt.r = prop === "display" && end === "none" ? _renderNonTweeningValueOnlyAtEnd : _renderNonTweeningValue; 3330 } 3331 _relExp.test(end) && (pt.e = 0); 3332 this._pt = pt; 3333 return pt; 3334}, _keywordToPercent = { 3335 top: "0%", 3336 bottom: "100%", 3337 left: "0%", 3338 right: "100%", 3339 center: "50%" 3340}, _convertKeywordsToPercentages = function _convertKeywordsToPercentages2(value) { 3341 var split = value.split(" "), x = split[0], y = split[1] || "50%"; 3342 if (x === "top" || x === "bottom" || y === "left" || y === "right") { 3343 value = x; 3344 x = y; 3345 y = value; 3346 } 3347 split[0] = _keywordToPercent[x] || x; 3348 split[1] = _keywordToPercent[y] || y; 3349 return split.join(" "); 3350}, _renderClearProps = function _renderClearProps2(ratio, data) { 3351 if (data.tween && data.tween._time === data.tween._dur) { 3352 var target = data.t, style = target.style, props = data.u, cache = target._gsap, prop, clearTransforms, i; 3353 if (props === "all" || props === true) { 3354 style.cssText = ""; 3355 clearTransforms = 1; 3356 } else { 3357 props = props.split(","); 3358 i = props.length; 3359 while (--i > -1) { 3360 prop = props[i]; 3361 if (_transformProps[prop]) { 3362 clearTransforms = 1; 3363 prop = prop === "transformOrigin" ? _transformOriginProp : _transformProp; 3364 } 3365 _removeProperty(target, prop); 3366 } 3367 } 3368 if (clearTransforms) { 3369 _removeProperty(target, _transformProp); 3370 if (cache) { 3371 cache.svg && target.removeAttribute("transform"); 3372 _parseTransform(target, 1); 3373 cache.uncache = 1; 3374 _removeIndependentTransforms(style); 3375 } 3376 } 3377 } 3378}, _specialProps = { 3379 clearProps: function clearProps(plugin, target, property, endValue, tween) { 3380 if (tween.data !== "isFromStart") { 3381 var pt = plugin._pt = new PropTween(plugin._pt, target, property, 0, 0, _renderClearProps); 3382 pt.u = endValue; 3383 pt.pr = -10; 3384 pt.tween = tween; 3385 plugin._props.push(property);
vendor: 2,797 bytes, lines 3385-3451
3385 3386 return 1; 3387 } 3388 } 3389 /* className feature (about 0.4kb gzipped). 3390 , className(plugin, target, property, endValue, tween) { 3391 let _renderClassName = (ratio, data) => { 3392 data.css.render(ratio, data.css); 3393 if (!ratio || ratio === 1) { 3394 let inline = data.rmv, 3395 target = data.t, 3396 p; 3397 target.setAttribute("class", ratio ? data.e : data.b); 3398 for (p in inline) { 3399 _removeProperty(target, p); 3400 } 3401 } 3402 }, 3403 _getAllStyles = (target) => { 3404 let styles = {}, 3405 computed = getComputedStyle(target), 3406 p; 3407 for (p in computed) { 3408 if (isNaN(p) && p !== "cssText" && p !== "length") { 3409 styles[p] = computed[p]; 3410 } 3411 } 3412 _setDefaults(styles, _parseTransform(target, 1)); 3413 return styles; 3414 }, 3415 startClassList = target.getAttribute("class"), 3416 style = target.style, 3417 cssText = style.cssText, 3418 cache = target._gsap, 3419 classPT = cache.classPT, 3420 inlineToRemoveAtEnd = {}, 3421 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) : "")}, 3422 changingVars = {}, 3423 startVars = _getAllStyles(target), 3424 transformRelated = /(transform|perspective)/i, 3425 endVars, p; 3426 if (classPT) { 3427 classPT.r(1, classPT.d); 3428 _removeLinkedListItem(classPT.d.plugin, classPT, "_pt"); 3429 } 3430 target.setAttribute("class", data.e); 3431 endVars = _getAllStyles(target, true); 3432 target.setAttribute("class", startClassList); 3433 for (p in endVars) { 3434 if (endVars[p] !== startVars[p] && !transformRelated.test(p)) { 3435 changingVars[p] = endVars[p]; 3436 if (!style[p] && style[p] !== "0") { 3437 inlineToRemoveAtEnd[p] = 1; 3438 } 3439 } 3440 } 3441 cache.classPT = plugin._pt = new PropTween(plugin._pt, target, "className", 0, 0, _renderClassName, data, 0, -11); 3442 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/. 3443 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). 3444 } 3445 _parseTransform(target, true); //to clear the caching of transforms 3446 data.css = new gsap.plugins.css(); 3447 data.css.init(target, changingVars, tween); 3448 plugin._props.push(...data.css._props); 3449 return 1; 3450 } 3451 */
vendor: 13,291 bytes, lines 3452-3721
3452}, _identity2DMatrix = [1, 0, 0, 1, 0, 0], _rotationalProperties = {}, _isNullTransform = function _isNullTransform2(value) { 3453 return value === "matrix(1, 0, 0, 1, 0, 0)" || value === "none" || !value; 3454}, _getComputedTransformMatrixAsArray = function _getComputedTransformMatrixAsArray2(target) { 3455 var matrixString = _getComputedProperty(target, _transformProp); 3456 return _isNullTransform(matrixString) ? _identity2DMatrix : matrixString.substr(7).match(_numExp).map(_round); 3457}, _getMatrix = function _getMatrix2(target, force2D) { 3458 var cache = target._gsap || _getCache(target), style = target.style, matrix = _getComputedTransformMatrixAsArray(target), parent, nextSibling, temp, addedToDOM; 3459 if (cache.svg && target.getAttribute("transform")) { 3460 temp = target.transform.baseVal.consolidate().matrix; 3461 matrix = [temp.a, temp.b, temp.c, temp.d, temp.e, temp.f]; 3462 return matrix.join(",") === "1,0,0,1,0,0" ? _identity2DMatrix : matrix; 3463 } else if (matrix === _identity2DMatrix && !target.offsetParent && target !== _docElement && !cache.svg) { 3464 temp = style.display; 3465 style.display = "block"; 3466 parent = target.parentNode; 3467 if (!parent || !target.offsetParent) { 3468 addedToDOM = 1; 3469 nextSibling = target.nextElementSibling; 3470 _docElement.appendChild(target); 3471 } 3472 matrix = _getComputedTransformMatrixAsArray(target); 3473 temp ? style.display = temp : _removeProperty(target, "display"); 3474 if (addedToDOM) { 3475 nextSibling ? parent.insertBefore(target, nextSibling) : parent ? parent.appendChild(target) : _docElement.removeChild(target); 3476 } 3477 } 3478 return force2D && matrix.length > 6 ? [matrix[0], matrix[1], matrix[4], matrix[5], matrix[12], matrix[13]] : matrix; 3479}, _applySVGOrigin = function _applySVGOrigin2(target, origin, originIsAbsolute, smooth, matrixArray, pluginToAddPropTweensTo) { 3480 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; 3481 if (!originIsAbsolute) { 3482 bounds = _getBBox(target); 3483 xOrigin = bounds.x + (~originSplit[0].indexOf("%") ? xOrigin / 100 * bounds.width : xOrigin); 3484 yOrigin = bounds.y + (~(originSplit[1] || originSplit[0]).indexOf("%") ? yOrigin / 100 * bounds.height : yOrigin); 3485 } else if (matrix !== _identity2DMatrix && (determinant = a * d - b * c)) { 3486 x = xOrigin * (d / determinant) + yOrigin * (-c / determinant) + (c * ty - d * tx) / determinant; 3487 y = xOrigin * (-b / determinant) + yOrigin * (a / determinant) - (a * ty - b * tx) / determinant; 3488 xOrigin = x; 3489 yOrigin = y; 3490 } 3491 if (smooth || smooth !== false && cache.smooth) { 3492 tx = xOrigin - xOriginOld; 3493 ty = yOrigin - yOriginOld; 3494 cache.xOffset = xOffsetOld + (tx * a + ty * c) - tx; 3495 cache.yOffset = yOffsetOld + (tx * b + ty * d) - ty; 3496 } else { 3497 cache.xOffset = cache.yOffset = 0; 3498 } 3499 cache.xOrigin = xOrigin; 3500 cache.yOrigin = yOrigin; 3501 cache.smooth = !!smooth; 3502 cache.origin = origin; 3503 cache.originIsAbsolute = !!originIsAbsolute; 3504 target.style[_transformOriginProp] = "0px 0px"; 3505 if (pluginToAddPropTweensTo) { 3506 _addNonTweeningPT(pluginToAddPropTweensTo, cache, "xOrigin", xOriginOld, xOrigin); 3507 _addNonTweeningPT(pluginToAddPropTweensTo, cache, "yOrigin", yOriginOld, yOrigin); 3508 _addNonTweeningPT(pluginToAddPropTweensTo, cache, "xOffset", xOffsetOld, cache.xOffset); 3509 _addNonTweeningPT(pluginToAddPropTweensTo, cache, "yOffset", yOffsetOld, cache.yOffset); 3510 } 3511 target.setAttribute("data-svg-origin", xOrigin + " " + yOrigin); 3512}, _parseTransform = function _parseTransform2(target, uncache) { 3513 var cache = target._gsap || new GSCache(target); 3514 if ("x" in cache && !uncache && !cache.uncache) { 3515 return cache; 3516 } 3517 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; 3518 x = y = z = rotation = rotationX = rotationY = skewX = skewY = perspective = 0; 3519 scaleX = scaleY = 1; 3520 cache.svg = !!(target.getCTM && _isSVG(target)); 3521 if (cs.translate) { 3522 if (cs.translate !== "none" || cs.scale !== "none" || cs.rotate !== "none") { 3523 style[_transformProp] = (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] !== "none" ? cs[_transformProp] : ""); 3524 } 3525 style.scale = style.rotate = style.translate = "none"; 3526 } 3527 matrix = _getMatrix(target, cache.svg); 3528 if (cache.svg) { 3529 if (cache.uncache) { 3530 t2 = target.getBBox(); 3531 origin = cache.xOrigin - t2.x + "px " + (cache.yOrigin - t2.y) + "px"; 3532 t1 = ""; 3533 } else { 3534 t1 = !uncache && target.getAttribute("data-svg-origin"); 3535 } 3536 _applySVGOrigin(target, t1 || origin, !!t1 || cache.originIsAbsolute, cache.smooth !== false, matrix); 3537 } 3538 xOrigin = cache.xOrigin || 0; 3539 yOrigin = cache.yOrigin || 0; 3540 if (matrix !== _identity2DMatrix) { 3541 a = matrix[0]; 3542 b = matrix[1]; 3543 c = matrix[2]; 3544 d = matrix[3]; 3545 x = a12 = matrix[4]; 3546 y = a22 = matrix[5]; 3547 if (matrix.length === 6) { 3548 scaleX = Math.sqrt(a * a + b * b); 3549 scaleY = Math.sqrt(d * d + c * c); 3550 rotation = a || b ? _atan2(b, a) * _RAD2DEG : 0; 3551 skewX = c || d ? _atan2(c, d) * _RAD2DEG + rotation : 0; 3552 skewX && (scaleY *= Math.abs(Math.cos(skewX * _DEG2RAD))); 3553 if (cache.svg) { 3554 x -= xOrigin - (xOrigin * a + yOrigin * c); 3555 y -= yOrigin - (xOrigin * b + yOrigin * d); 3556 } 3557 } else { 3558 a32 = matrix[6]; 3559 a42 = matrix[7]; 3560 a13 = matrix[8]; 3561 a23 = matrix[9]; 3562 a33 = matrix[10]; 3563 a43 = matrix[11]; 3564 x = matrix[12]; 3565 y = matrix[13]; 3566 z = matrix[14]; 3567 angle = _atan2(a32, a33); 3568 rotationX = angle * _RAD2DEG; 3569 if (angle) { 3570 cos = Math.cos(-angle); 3571 sin = Math.sin(-angle); 3572 t1 = a12 * cos + a13 * sin; 3573 t2 = a22 * cos + a23 * sin; 3574 t3 = a32 * cos + a33 * sin; 3575 a13 = a12 * -sin + a13 * cos; 3576 a23 = a22 * -sin + a23 * cos; 3577 a33 = a32 * -sin + a33 * cos; 3578 a43 = a42 * -sin + a43 * cos; 3579 a12 = t1; 3580 a22 = t2; 3581 a32 = t3; 3582 } 3583 angle = _atan2(-c, a33); 3584 rotationY = angle * _RAD2DEG; 3585 if (angle) { 3586 cos = Math.cos(-angle); 3587 sin = Math.sin(-angle); 3588 t1 = a * cos - a13 * sin; 3589 t2 = b * cos - a23 * sin; 3590 t3 = c * cos - a33 * sin; 3591 a43 = d * sin + a43 * cos; 3592 a = t1; 3593 b = t2; 3594 c = t3; 3595 } 3596 angle = _atan2(b, a); 3597 rotation = angle * _RAD2DEG; 3598 if (angle) { 3599 cos = Math.cos(angle); 3600 sin = Math.sin(angle); 3601 t1 = a * cos + b * sin; 3602 t2 = a12 * cos + a22 * sin; 3603 b = b * cos - a * sin; 3604 a22 = a22 * cos - a12 * sin; 3605 a = t1; 3606 a12 = t2; 3607 } 3608 if (rotationX && Math.abs(rotationX) + Math.abs(rotation) > 359.9) { 3609 rotationX = rotation = 0; 3610 rotationY = 180 - rotationY; 3611 } 3612 scaleX = _round(Math.sqrt(a * a + b * b + c * c)); 3613 scaleY = _round(Math.sqrt(a22 * a22 + a32 * a32)); 3614 angle = _atan2(a12, a22); 3615 skewX = Math.abs(angle) > 2e-4 ? angle * _RAD2DEG : 0; 3616 perspective = a43 ? 1 / (a43 < 0 ? -a43 : a43) : 0; 3617 } 3618 if (cache.svg) { 3619 t1 = target.getAttribute("transform"); 3620 cache.forceCSS = target.setAttribute("transform", "") || !_isNullTransform(_getComputedProperty(target, _transformProp)); 3621 t1 && target.setAttribute("transform", t1); 3622 } 3623 } 3624 if (Math.abs(skewX) > 90 && Math.abs(skewX) < 270) { 3625 if (invertedScaleX) { 3626 scaleX *= -1; 3627 skewX += rotation <= 0 ? 180 : -180; 3628 rotation += rotation <= 0 ? 180 : -180; 3629 } else { 3630 scaleY *= -1; 3631 skewX += skewX <= 0 ? 180 : -180; 3632 } 3633 } 3634 uncache = uncache || cache.uncache; 3635 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; 3636 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; 3637 cache.z = z + px; 3638 cache.scaleX = _round(scaleX); 3639 cache.scaleY = _round(scaleY); 3640 cache.rotation = _round(rotation) + deg; 3641 cache.rotationX = _round(rotationX) + deg; 3642 cache.rotationY = _round(rotationY) + deg; 3643 cache.skewX = skewX + deg; 3644 cache.skewY = skewY + deg; 3645 cache.transformPerspective = perspective + px; 3646 if (cache.zOrigin = parseFloat(origin.split(" ")[2]) || !uncache && cache.zOrigin || 0) { 3647 style[_transformOriginProp] = _firstTwoOnly(origin); 3648 } 3649 cache.xOffset = cache.yOffset = 0; 3650 cache.force3D = _config.force3D; 3651 cache.renderTransform = cache.svg ? _renderSVGTransforms : _supports3D ? _renderCSSTransforms : _renderNon3DTransforms; 3652 cache.uncache = 0; 3653 return cache; 3654}, _firstTwoOnly = function _firstTwoOnly2(value) { 3655 return (value = value.split(" "))[0] + " " + value[1]; 3656}, _addPxTranslate = function _addPxTranslate2(target, start, value) { 3657 var unit = getUnit(start); 3658 return _round(parseFloat(start) + parseFloat(_convertToUnit(target, "x", value + "px", unit))) + unit; 3659}, _renderNon3DTransforms = function _renderNon3DTransforms2(ratio, cache) { 3660 cache.z = "0px"; 3661 cache.rotationY = cache.rotationX = "0deg"; 3662 cache.force3D = 0; 3663 _renderCSSTransforms(ratio, cache); 3664}, _zeroDeg = "0deg", _zeroPx = "0px", _endParenthesis = ") ", _renderCSSTransforms = function _renderCSSTransforms2(ratio, cache) { 3665 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; 3666 if (zOrigin && (rotationX !== _zeroDeg || rotationY !== _zeroDeg)) { 3667 var angle = parseFloat(rotationY) * _DEG2RAD, a13 = Math.sin(angle), a33 = Math.cos(angle), cos; 3668 angle = parseFloat(rotationX) * _DEG2RAD; 3669 cos = Math.cos(angle); 3670 x = _addPxTranslate(target, x, a13 * cos * -zOrigin); 3671 y = _addPxTranslate(target, y, -Math.sin(angle) * -zOrigin); 3672 z = _addPxTranslate(target, z, a33 * cos * -zOrigin + zOrigin); 3673 } 3674 if (transformPerspective !== _zeroPx) { 3675 transforms += "perspective(" + transformPerspective + _endParenthesis; 3676 } 3677 if (xPercent || yPercent) { 3678 transforms += "translate(" + xPercent + "%, " + yPercent + "%) "; 3679 } 3680 if (use3D || x !== _zeroPx || y !== _zeroPx || z !== _zeroPx) { 3681 transforms += z !== _zeroPx || use3D ? "translate3d(" + x + ", " + y + ", " + z + ") " : "translate(" + x + ", " + y + _endParenthesis; 3682 } 3683 if (rotation !== _zeroDeg) { 3684 transforms += "rotate(" + rotation + _endParenthesis; 3685 } 3686 if (rotationY !== _zeroDeg) { 3687 transforms += "rotateY(" + rotationY + _endParenthesis; 3688 } 3689 if (rotationX !== _zeroDeg) { 3690 transforms += "rotateX(" + rotationX + _endParenthesis; 3691 } 3692 if (skewX !== _zeroDeg || skewY !== _zeroDeg) { 3693 transforms += "skew(" + skewX + ", " + skewY + _endParenthesis; 3694 } 3695 if (scaleX !== 1 || scaleY !== 1) { 3696 transforms += "scale(" + scaleX + ", " + scaleY + _endParenthesis; 3697 } 3698 target.style[_transformProp] = transforms || "translate(0, 0)"; 3699}, _renderSVGTransforms = function _renderSVGTransforms2(ratio, cache) { 3700 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; 3701 rotation = parseFloat(rotation); 3702 skewX = parseFloat(skewX); 3703 skewY = parseFloat(skewY); 3704 if (skewY) { 3705 skewY = parseFloat(skewY); 3706 skewX += skewY; 3707 rotation += skewY; 3708 } 3709 if (rotation || skewX) { 3710 rotation *= _DEG2RAD; 3711 skewX *= _DEG2RAD; 3712 a11 = Math.cos(rotation) * scaleX; 3713 a21 = Math.sin(rotation) * scaleX; 3714 a12 = Math.sin(rotation - skewX) * -scaleY; 3715 a22 = Math.cos(rotation - skewX) * scaleY; 3716 if (skewX) { 3717 skewY *= _DEG2RAD; 3718 temp = Math.tan(skewX - skewY); 3719 temp = Math.sqrt(1 + temp * temp); 3720 a12 *= temp; 3721 a22 *= temp;
vendor: 7,598 bytes, lines 3722-3899
3722 if (skewY) { 3723 temp = Math.tan(skewY); 3724 temp = Math.sqrt(1 + temp * temp); 3725 a11 *= temp; 3726 a21 *= temp; 3727 } 3728 } 3729 a11 = _round(a11); 3730 a21 = _round(a21); 3731 a12 = _round(a12); 3732 a22 = _round(a22); 3733 } else { 3734 a11 = scaleX; 3735 a22 = scaleY; 3736 a21 = a12 = 0; 3737 } 3738 if (tx && !~(x + "").indexOf("px") || ty && !~(y + "").indexOf("px")) { 3739 tx = _convertToUnit(target, "x", x, "px"); 3740 ty = _convertToUnit(target, "y", y, "px"); 3741 } 3742 if (xOrigin || yOrigin || xOffset || yOffset) { 3743 tx = _round(tx + xOrigin - (xOrigin * a11 + yOrigin * a12) + xOffset); 3744 ty = _round(ty + yOrigin - (xOrigin * a21 + yOrigin * a22) + yOffset); 3745 } 3746 if (xPercent || yPercent) { 3747 temp = target.getBBox(); 3748 tx = _round(tx + xPercent / 100 * temp.width); 3749 ty = _round(ty + yPercent / 100 * temp.height); 3750 } 3751 temp = "matrix(" + a11 + "," + a21 + "," + a12 + "," + a22 + "," + tx + "," + ty + ")"; 3752 target.setAttribute("transform", temp); 3753 forceCSS && (target.style[_transformProp] = temp); 3754}, _addRotationalPropTween = function _addRotationalPropTween2(plugin, target, property, startNum, endValue) { 3755 var cap = 360, isString = _isString(endValue), endNum = parseFloat(endValue) * (isString && ~endValue.indexOf("rad") ? _RAD2DEG : 1), change = endNum - startNum, finalValue = startNum + change + "deg", direction, pt; 3756 if (isString) { 3757 direction = endValue.split("_")[1]; 3758 if (direction === "short") { 3759 change %= cap; 3760 if (change !== change % (cap / 2)) { 3761 change += change < 0 ? cap : -cap; 3762 } 3763 } 3764 if (direction === "cw" && change < 0) { 3765 change = (change + cap * _bigNum) % cap - ~~(change / cap) * cap; 3766 } else if (direction === "ccw" && change > 0) { 3767 change = (change - cap * _bigNum) % cap - ~~(change / cap) * cap; 3768 } 3769 } 3770 plugin._pt = pt = new PropTween(plugin._pt, target, property, startNum, change, _renderPropWithEnd); 3771 pt.e = finalValue; 3772 pt.u = "deg"; 3773 plugin._props.push(property); 3774 return pt; 3775}, _assign = function _assign2(target, source) { 3776 for (var p in source) { 3777 target[p] = source[p]; 3778 } 3779 return target; 3780}, _addRawTransformPTs = function _addRawTransformPTs2(plugin, transforms, target) { 3781 var startCache = _assign({}, target._gsap), exclude = "perspective,force3D,transformOrigin,svgOrigin", style = target.style, endCache, p, startValue, endValue, startNum, endNum, startUnit, endUnit; 3782 if (startCache.svg) { 3783 startValue = target.getAttribute("transform"); 3784 target.setAttribute("transform", ""); 3785 style[_transformProp] = transforms; 3786 endCache = _parseTransform(target, 1); 3787 _removeProperty(target, _transformProp); 3788 target.setAttribute("transform", startValue); 3789 } else { 3790 startValue = getComputedStyle(target)[_transformProp]; 3791 style[_transformProp] = transforms; 3792 endCache = _parseTransform(target, 1); 3793 style[_transformProp] = startValue; 3794 } 3795 for (p in _transformProps) { 3796 startValue = startCache[p]; 3797 endValue = endCache[p]; 3798 if (startValue !== endValue && exclude.indexOf(p) < 0) { 3799 startUnit = getUnit(startValue); 3800 endUnit = getUnit(endValue); 3801 startNum = startUnit !== endUnit ? _convertToUnit(target, p, startValue, endUnit) : parseFloat(startValue); 3802 endNum = parseFloat(endValue); 3803 plugin._pt = new PropTween(plugin._pt, endCache, p, startNum, endNum - startNum, _renderCSSProp); 3804 plugin._pt.u = endUnit || 0; 3805 plugin._props.push(p); 3806 } 3807 } 3808 _assign(endCache, startCache); 3809}; 3810_forEachName("padding,margin,Width,Radius", function(name, index) { 3811 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) { 3812 return index < 2 ? name + side : "border" + side + name; 3813 }); 3814 _specialProps[index > 1 ? "border" + name : name] = function(plugin, target, property, endValue, tween) { 3815 var a, vars; 3816 if (arguments.length < 4) { 3817 a = props.map(function(prop) { 3818 return _get(plugin, prop, property); 3819 }); 3820 vars = a.join(" "); 3821 return vars.split(a[0]).length === 5 ? a[0] : vars; 3822 } 3823 a = (endValue + "").split(" "); 3824 vars = {}; 3825 props.forEach(function(prop, i) { 3826 return vars[prop] = a[i] = a[i] || a[(i - 1) / 2 | 0]; 3827 }); 3828 plugin.init(target, vars, tween); 3829 }; 3830}); 3831var CSSPlugin = { 3832 name: "css", 3833 register: _initCore, 3834 targetTest: function targetTest(target) { 3835 return target.style && target.nodeType; 3836 }, 3837 init: function init3(target, vars, tween, index, targets) { 3838 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; 3839 _pluginInitted || _initCore(); 3840 this.styles = this.styles || _getStyleSaver(target); 3841 inlineProps = this.styles.props; 3842 this.tween = tween; 3843 for (p in vars) { 3844 if (p === "autoRound") { 3845 continue; 3846 } 3847 endValue = vars[p]; 3848 if (_plugins[p] && _checkPlugin(p, vars, tween, index, target, targets)) { 3849 continue; 3850 } 3851 type = typeof endValue; 3852 specialProp = _specialProps[p]; 3853 if (type === "function") { 3854 endValue = endValue.call(tween, index, target, targets); 3855 type = typeof endValue; 3856 } 3857 if (type === "string" && ~endValue.indexOf("random(")) { 3858 endValue = _replaceRandom(endValue); 3859 } 3860 if (specialProp) { 3861 specialProp(this, target, p, endValue, tween) && (hasPriority = 1); 3862 } else if (p.substr(0, 2) === "--") { 3863 startValue = (getComputedStyle(target).getPropertyValue(p) + "").trim(); 3864 endValue += ""; 3865 _colorExp.lastIndex = 0; 3866 if (!_colorExp.test(startValue)) { 3867 startUnit = getUnit(startValue); 3868 endUnit = getUnit(endValue); 3869 } 3870 endUnit ? startUnit !== endUnit && (startValue = _convertToUnit(target, p, startValue, endUnit) + endUnit) : startUnit && (endValue += startUnit); 3871 this.add(style, "setProperty", startValue, endValue, index, targets, 0, 0, p); 3872 props.push(p); 3873 inlineProps.push(p, 0, style[p]); 3874 } else if (type !== "undefined") { 3875 if (startAt && p in startAt) { 3876 startValue = typeof startAt[p] === "function" ? startAt[p].call(tween, index, target, targets) : startAt[p]; 3877 _isString(startValue) && ~startValue.indexOf("random(") && (startValue = _replaceRandom(startValue)); 3878 getUnit(startValue + "") || startValue === "auto" || (startValue += _config.units[p] || getUnit(_get(target, p)) || ""); 3879 (startValue + "").charAt(1) === "=" && (startValue = _get(target, p)); 3880 } else { 3881 startValue = _get(target, p); 3882 } 3883 startNum = parseFloat(startValue); 3884 relative = type === "string" && endValue.charAt(1) === "=" && endValue.substr(0, 2); 3885 relative && (endValue = endValue.substr(2)); 3886 endNum = parseFloat(endValue); 3887 if (p in _propertyAliases) { 3888 if (p === "autoAlpha") { 3889 if (startNum === 1 && _get(target, "visibility") === "hidden" && endNum) { 3890 startNum = 0; 3891 } 3892 inlineProps.push("visibility", 0, style.visibility); 3893 _addNonTweeningPT(this, style, "visibility", startNum ? "inherit" : "hidden", endNum ? "inherit" : "hidden", !endNum); 3894 } 3895 if (p !== "scale" && p !== "transform") { 3896 p = _propertyAliases[p]; 3897 ~p.indexOf(",") && (p = p.split(",")[0]); 3898 } 3899 }
vendor: 4,846 bytes, lines 3900-3994
3900 isTransformRelated = p in _transformProps; 3901 if (isTransformRelated) { 3902 this.styles.save(p); 3903 if (!transformPropTween) { 3904 cache = target._gsap; 3905 cache.renderTransform && !vars.parseTransform || _parseTransform(target, vars.parseTransform); 3906 smooth = vars.smoothOrigin !== false && cache.smooth; 3907 transformPropTween = this._pt = new PropTween(this._pt, style, _transformProp, 0, 1, cache.renderTransform, cache, 0, -1); 3908 transformPropTween.dep = 1; 3909 } 3910 if (p === "scale") { 3911 this._pt = new PropTween(this._pt, cache, "scaleY", cache.scaleY, (relative ? _parseRelative(cache.scaleY, relative + endNum) : endNum) - cache.scaleY || 0, _renderCSSProp); 3912 this._pt.u = 0; 3913 props.push("scaleY", p); 3914 p += "X"; 3915 } else if (p === "transformOrigin") { 3916 inlineProps.push(_transformOriginProp, 0, style[_transformOriginProp]); 3917 endValue = _convertKeywordsToPercentages(endValue); 3918 if (cache.svg) { 3919 _applySVGOrigin(target, endValue, 0, smooth, 0, this); 3920 } else { 3921 endUnit = parseFloat(endValue.split(" ")[2]) || 0; 3922 endUnit !== cache.zOrigin && _addNonTweeningPT(this, cache, "zOrigin", cache.zOrigin, endUnit); 3923 _addNonTweeningPT(this, style, p, _firstTwoOnly(startValue), _firstTwoOnly(endValue)); 3924 } 3925 continue; 3926 } else if (p === "svgOrigin") { 3927 _applySVGOrigin(target, endValue, 1, smooth, 0, this); 3928 continue; 3929 } else if (p in _rotationalProperties) { 3930 _addRotationalPropTween(this, cache, p, startNum, relative ? _parseRelative(startNum, relative + endValue) : endValue); 3931 continue; 3932 } else if (p === "smoothOrigin") { 3933 _addNonTweeningPT(this, cache, "smooth", cache.smooth, endValue); 3934 continue; 3935 } else if (p === "force3D") { 3936 cache[p] = endValue; 3937 continue; 3938 } else if (p === "transform") { 3939 _addRawTransformPTs(this, endValue, target); 3940 continue; 3941 } 3942 } else if (!(p in style)) { 3943 p = _checkPropPrefix(p) || p; 3944 } 3945 if (isTransformRelated || (endNum || endNum === 0) && (startNum || startNum === 0) && !_complexExp.test(endValue) && p in style) { 3946 startUnit = (startValue + "").substr((startNum + "").length); 3947 endNum || (endNum = 0); 3948 endUnit = getUnit(endValue) || (p in _config.units ? _config.units[p] : startUnit); 3949 startUnit !== endUnit && (startNum = _convertToUnit(target, p, startValue, endUnit)); 3950 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); 3951 this._pt.u = endUnit || 0; 3952 if (startUnit !== endUnit && endUnit !== "%") { 3953 this._pt.b = startValue; 3954 this._pt.r = _renderCSSPropWithBeginning; 3955 } 3956 } else if (!(p in style)) { 3957 if (p in target) { 3958 this.add(target, p, startValue || target[p], relative ? relative + endValue : endValue, index, targets); 3959 } else if (p !== "parseTransform") { 3960 _missingPlugin(p, endValue); 3961 continue; 3962 } 3963 } else { 3964 _tweenComplexCSSString.call(this, target, p, startValue, relative ? relative + endValue : endValue); 3965 } 3966 isTransformRelated || (p in style ? inlineProps.push(p, 0, style[p]) : inlineProps.push(p, 1, startValue || target[p])); 3967 props.push(p); 3968 } 3969 } 3970 hasPriority && _sortPropTweensByPriority(this); 3971 }, 3972 render: function render2(ratio, data) { 3973 if (data.tween._time || !_reverting()) { 3974 var pt = data._pt; 3975 while (pt) { 3976 pt.r(ratio, pt.d); 3977 pt = pt._next; 3978 } 3979 } else { 3980 data.styles.revert(); 3981 } 3982 }, 3983 get: _get, 3984 aliases: _propertyAliases, 3985 getSetter: function getSetter(target, property, plugin) { 3986 var p = _propertyAliases[property]; 3987 p && p.indexOf(",") < 0 && (property = p); 3988 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); 3989 }, 3990 core: { 3991 _removeProperty, 3992 _getMatrix 3993 } 3994};
3995gsap.utils.checkPrefix = _checkPropPrefix; 3996gsap.core.getStyleSaver = _getStyleSaver; 3997(function(positionAndScale, rotation, others, aliases) { 3998 var all = _forEachName(positionAndScale + "," + rotation + "," + others, function(name) { 3999 _transformProps[name] = 1; 4000 }); 4001 _forEachName(rotation, function(name) { 4002 _config.units[name] = "deg"; 4003 _rotationalProperties[name] = 1; 4004 }); 4005 _propertyAliases[all[13]] = positionAndScale + "," + rotation; 4006 _forEachName(aliases, function(name) { 4007 var split = name.split(":"); 4008 _propertyAliases[split[1]] = all[split[0]]; 4009 }); 4010})("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"); 4011_forEachName("x,y,z,top,right,bottom,left,width,height,fontSize,padding,margin,perspective", function(name) { 4012 _config.units[name] = "px"; 4013}); 4014gsap.registerPlugin(CSSPlugin); 4015var gsapWithCSS = gsap.registerPlugin(CSSPlugin) || gsap; 4016gsapWithCSS.core.Tween; 4017gsapWithCSS.registerPlugin(ScrollTrigger); 4018const select = (e) => document.querySelector(e); 4019initPageTransitions(); 4020function pageTransitionIn({ container }) { 4021 const tl = gsapWithCSS.timeline({ 4022 defaults: { 4023 duration: 0.5, 4024 ease: "expo.Out" 4025 } 4026 }); 4027 tl.to(container, { y: 18, autoAlpha: 0 }, 0); 4028 return tl; 4029} 4030function pageTransitionOut({ container }) { 4031 const tl = gsapWithCSS.timeline({ 4032 defaults: { 4033 duration: 1, 4034 ease: "expo.In" 4035 }, 4036 onComplete: () => initScript() 4037 }); 4038 tl.from(container, { y: -18, autoAlpha: 0, delay: 0 }, 0); 4039 return tl; 4040} 4041function initPageTransitions() { 4042 barba.hooks.before(() => { 4043 select("html").classList.add("is-transitioning"); 4044 }); 4045 barba.hooks.after(() => { 4046 select("html").classList.remove("is-transitioning"); 4047 }); 4048 barba.hooks.enter(() => { 4049 console.log("enter"); 4050 }); 4051 document.addEventListener("click", function(event) { 4052 const link = event.target.closest("a"); 4053 if (!link) 4054 return; 4055 if (link.target === "_blank" || link.href.toLowerCase().endsWith(".pdf") || link.href.toLowerCase().endsWith(".doc") || link.href.toLowerCase().endsWith(".docx")) { 4056 event.preventDefault(); 4057 event.stopPropagation(); 4058 event.stopImmediatePropagation(); 4059 const newWindow = window.open(); 4060 if (newWindow) { 4061 newWindow.opener = null; 4062 newWindow.location = link.href; 4063 } 4064 return false; 4065 } 4066 }, { capture: true, passive: false }); 4067 barba.init({ 4068 sync: true, 4069 debug: false, 4070 timeout: 7e3, 4071 prevent: ({ el }) => { 4072 if (el.tagName === "A") { 4073 if (el.target === "_blank" || el.getAttribute("target") === "_blank") { 4074 return true; 4075 } 4076 if (el.href.toLowerCase().endsWith(".pdf") || el.href.toLowerCase().endsWith(".doc") || el.href.toLowerCase().endsWith(".docx")) { 4077 return true; 4078 } 4079 } 4080 return el.classList && el.classList.contains("prevent"); 4081 }, 4082 transitions: [{ 4083 name: "overlay-transition", 4084 once(data) { 4085 initSmoothScroll(data.next.container); 4086 loadScripts(); 4087 initParallaxScrolling(); 4088 }, 4089 async leave(data) { 4090 pageTransitionIn(data.current); 4091 await delay(500); 4092 data.current.container.remove(); 4093 }, 4094 async beforeEnter(data) { 4095 ScrollTrigger.getAll().forEach((t) => t.kill()); 4096 initSmoothScroll(data.next.container); 4097 loadScripts(); 4098 window.scrollTo(0, 0); 4099 setTimeout(() => { 4100 window.scrollTo(0, 0); 4101 }, 200); 4102 }, 4103 async enter(data) { 4104 pageTransitionOut(data.next); 4105 }, 4106 async after(data) { 4107 select(".transition-container").offsetHeight; 4108 Promise.all(Array.from(document.images).filter((img) => !img.complete).map((img) => new Promise((resolve) => { 4109 img.onload = img.onerror = resolve; 4110 }))).then(() => { 4111 console.log("images finished loading"); 4112 }); 4113 } 4114 }], 4115 views: [ 4116 { 4117 namespace: "home", 4118 afterEnter(data) { 4119 document.querySelector("header.fixed").classList.add("nav-transparent"); 4120 } 4121 }, 4122 { 4123 namespace: "single", 4124 afterEnter(data) { 4125 console.log(data); 4126 new Swiper(".swiper", { 4127 loop: true, 4128 slidesPerView: 2, 4129 spaceBetween: 20, 4130 grabCursor: true, 4131 autoplay: { 4132 delay: 2500, 4133 disableOnInteraction: true 4134 } 4135 }); 4136 } 4137 }, 4138 { 4139 namespace: "gallery", 4140 afterEnter(data) { 4141 console.log(data); 4142 const masonryItems = document.querySelectorAll(".masonry-item img"); 4143 const rowHeight = 460;
4144 masonryItems.forEach((img) => { 4145 if (img.complete) { 4146 adjustImageClass(img); 4147 } else { 4148 img.addEventListener("load", function() { 4149 adjustImageClass(img); 4150 }); 4151 } 4152 }); 4153 function adjustImageClass(img) { 4154 const aspectRatio = img.naturalWidth / img.naturalHeight; 4155 const item = img.parentElement; 4156 if (aspectRatio > 1) { 4157 item.style.flex = `1 1 auto`; 4158 item.style.height = `${rowHeight}px`; 4159 item.style.width = `${rowHeight * aspectRatio}px`; 4160 } else { 4161 item.style.flex = `1 1 auto`; 4162 item.style.height = `${rowHeight}px`; 4163 item.style.width = `${rowHeight * aspectRatio}px`; 4164 } 4165 } 4166 new mapboxgl.Map({ 4167 container: "map", 4168 style: "https://maputnik.github.io/osm-liberty/style.json", 4169 center: [8.538961, 47.372476], 4170 zoom: 5, 4171 hash: true 4172 }); 4173 } 4174 // afterEnter 4175 }, 4176 { 4177 namespace: "contact", 4178 afterEnter(data) { 4179 var thisDelay = 0; 4180 gsapWithCSS.utils.toArray(".marker").forEach((marker) => { 4181 gsapWithCSS.fromTo(marker, { 4182 scale: 0.25 4183 }, { 4184 scale: 1, 4185 duration: 1, 4186 delay: thisDelay, 4187 repeat: -1, 4188 yoyo: true, 4189 ease: "power2.inOut" 4190 }); 4191 thisDelay += 0.75; 4192 }); 4193 } 4194 // afterEnter 4195 } 4196 ] 4197 }); 4198 document.addEventListener("click", function(event) { 4199 const link = event.target.closest("a"); 4200 if (!link) 4201 return; 4202 if (link.target === "_blank") { 4203 event.preventDefault(); 4204 event.stopPropagation(); 4205 window.open(link.href, "_blank"); 4206 return false; 4207 } 4208 }, true); 4209 document.addEventListener("DOMContentLoaded", function() { 4210 if (document.querySelector("#map")) { 4211 console.log("Document loaded with map element. Initializing map..."); 4212 } 4213 }); 4214 function initSmoothScroll(container) { 4215 const lenis = new Lenis(); 4216 lenis.on("scroll", (e) => { 4217 const navbar = document.querySelector(".main-nav"); 4218 const content = document.querySelector(".transition-container"); 4219 if (navbar && content) { 4220 if (e.animatedScroll >= 40) { 4221 navbar.style.position = "fixed"; 4222 navbar.style.zIndex = "4"; 4223 content.style.marginTop = "84px"; 4224 } else { 4225 navbar.style.position = "relative"; 4226 content.style.marginTop = "0"; 4227 } 4228 } 4229 }); 4230 function raf(time) { 4231 lenis.raf(time); 4232 requestAnimationFrame(raf); 4233 } 4234 requestAnimationFrame(raf); 4235 var btnStone = document.querySelector("#btn-stone"); 4236 if (typeof btnStone != "undefined" && btnStone != null) { 4237 btnStone.addEventListener("click", () => { 4238 lenis.scrollTo(1600); 4239 }); 4240 } 4241 const openModalLink = document.getElementById("open-modal"); 4242 if (typeof openModalLink != "undefined" && openModalLink != null) { 4243 const closeModalButton = document.getElementById("close-modal"); 4244 const modal = document.getElementById("modal"); 4245 openModalLink.addEventListener("click", (event) => { 4246 event.preventDefault(); 4247 modal.classList.add("active"); 4248 }); 4249 closeModalButton.addEventListener("click", () => { 4250 modal.classList.remove("active"); 4251 }); 4252 modal.addEventListener("click", (event) => { 4253 if (event.target === modal) { 4254 modal.classList.remove("active"); 4255 } 4256 }); 4257 } 4258 } 4259 function loadScripts() { 4260 setTimeout(() => { 4261 const reservationsLink = document.querySelector("#menu-right-menu li:first-child a"); 4262 if (typeof reservationsLink != "undefined" && reservationsLink != null) { 4263 reservationsLink.classList.add("prevent-barba"); 4264 } 4265 const langLink = document.querySelector("#menu-right-menu li:last-child a"); 4266 if (typeof langLink != "undefined" && langLink != null) { 4267 langLink.removeAttribute(langLink.attributes[0].lang); 4268 langLink.classList.add("prevent-barba"); 4269 } 4270 const popupLinks = document.querySelectorAll(".sg-popup-builder-content a"); 4271 if (popupLinks.length > 0) { 4272 popupLinks.forEach((link) => { 4273 link.classList.add("prevent-barba"); 4274 link.setAttribute("data-barba-prevent", "self"); 4275 }); 4276 } 4277 var langSwitchLink = document.querySelector("#menu-item-130-pt a, #menu-item-132-pt a"); 4278 if (langSwitchLink) { 4279 langSwitchLink.setAttribute("data-barba-prevent", "self"); 4280 } 4281 document.addEventListener("click", function(event) { 4282 const link = event.target.closest("a"); 4283 if (!link) 4284 return; 4285 if (link.target === "_blank") { 4286 event.preventDefault(); 4287 window.open(link.href, "_blank"); 4288 return; 4289 } 4290 if (link.getAttribute("data-barba-prevent") === "self") { 4291 event.preventDefault(); 4292 window.location.href = link.href; 4293 } 4294 }); 4295 }, 500); 4296 const burger = document.querySelector(".burger-icon"); 4297 const menu = document.querySelector(".burger-menu"); 4298 const menuBg = menu.querySelector(".menu-bg"); 4299 const menuLinks = document.querySelectorAll(".menu-item"); 4300 let isMenuOpen = false;
4301 burger.addEventListener("click", () => { 4302 toggleMenu(); 4303 }); 4304 menuLinks.forEach((link) => { 4305 link.addEventListener("click", (event) => { 4306 if (isMenuOpen) { 4307 toggleMenu(); 4308 } 4309 }); 4310 }); 4311 function toggleMenu() { 4312 if (!isMenuOpen) { 4313 burger.classList.add("opened"); 4314 menuBg.classList.add("opened"); 4315 menu.style.visibility = "visible"; 4316 gsapWithCSS.to(menu, { 4317 x: 0, 4318 duration: 0.75, 4319 ease: "expo.inOut" 4320 }); 4321 } else { 4322 burger.classList.remove("opened"); 4323 menuBg.classList.remove("opened"); 4324 gsapWithCSS.to(menu, { 4325 x: "100%", 4326 duration: 0.75, 4327 ease: "expo.inOut", 4328 onComplete: () => { 4329 menu.style.visibility = "hidden"; 4330 } 4331 }); 4332 } 4333 isMenuOpen = !isMenuOpen; 4334 } 4335 setTimeout(() => { 4336 var dateInputs = document.querySelectorAll(".Date"); 4337 if (typeof dateInputs != "undefined" && dateInputs != null) { 4338 dateInputs.forEach(function(dateInput) { 4339 var currentValue = dateInput.value; 4340 if (currentValue && typeof currentValue === "string") { 4341 var parts = currentValue.split(","); 4342 if (parts.length === 2) { 4343 var dateParts = parts[1].trim().split("/"); 4344 if (dateParts.length === 3) { 4345 var formattedDate = dateParts[0] + "." + dateParts[1]; 4346 dateInput.value = formattedDate; 4347 } 4348 } 4349 } 4350 }); 4351 } 4352 }, 200); 4353 } 4354} 4355function delay(n) { 4356 n = n || 2e3; 4357 return new Promise((done) => { 4358 setTimeout(() => { 4359 done(); 4360 }, n); 4361 }); 4362} 4363function initScript() { 4364 select("body").classList.remove("is-loading"); 4365 initParallaxScrolling(); 4366} 4367function initParallaxScrolling() { 4368 gsapWithCSS.utils.toArray("#rotate-this").forEach((section) => { 4369 var thisImage = section.querySelector("img"); 4370 gsapWithCSS.to(thisImage, { 4371 rotate: 120, 4372 ease: "Expo.Out", 4373 scrollTrigger: { 4374 trigger: section, 4375 toggleClass: "enable", 4376 start: "0% 100%", 4377 end: "+=200%", 4378 // markers: true, 4379 // scrub: true 4380 scrub: 1, 4381 onStart: function() { 4382 thisImage.style.willChange = "transform"; 4383 }, 4384 onComplete: function() { 4385 thisImage.style.willChange = "auto"; 4386 } 4387 } 4388 }); 4389 }); 4390 gsapWithCSS.utils.toArray(".img-wrapper").forEach((section) => { 4391 var thisImage = section.querySelector("img"); 4392 gsapWithCSS.to(thisImage, { 4393 y: 60, 4394 // scale: 1.1, 4395 ease: "Expo.Out", 4396 scrollTrigger: { 4397 trigger: section, 4398 toggleClass: "enable", 4399 start: "0% 100%", 4400 end: "+=200%", 4401 // markers: true, 4402 // scrub: true 4403 scrub: 1, 4404 onStart: function() { 4405 thisImage.style.willChange = "transform"; 4406 }, 4407 onComplete: function() { 4408 thisImage.style.willChange = "auto"; 4409 } 4410 } 4411 }); 4412 }); 4413 gsapWithCSS.utils.toArray(".scroll-fade-in").forEach((section) => { 4414 var thisElement = section; 4415 gsapWithCSS.from(thisElement, { 4416 opacity: 0, 4417 y: 10, 4418 ease: "Expo.Out", 4419 scrollTrigger: { 4420 trigger: section, 4421 toggleClass: "enable", 4422 start: "0% 100%", 4423 end: "+=33%", 4424 // markers: true, 4425 scrub: 1, 4426 onStart: function() { 4427 thisElement.style.willChange = "transform"; 4428 }, 4429 onComplete: function() { 4430 thisElement.style.willChange = "auto"; 4431 } 4432 } 4433 }); 4434 }); 4435 gsapWithCSS.utils.toArray(".scroll-fade-in-date-picker").forEach((section) => { 4436 var thisElement = section; 4437 gsapWithCSS.from(thisElement, { 4438 y: 70, 4439 ease: "Expo.inOut", 4440 scrollTrigger: { 4441 trigger: section, 4442 toggleClass: "enable", 4443 start: "0% 98%", 4444 end: "+=25%", 4445 // markers: true, 4446 scrub: 1, 4447 onStart: function() { 4448 thisElement.style.willChange = "transform"; 4449 }, 4450 onComplete: function() { 4451 thisElement.style.willChange = "auto"; 4452 } 4453 } 4454 }); 4455 }); 4456} 4457//# sourceMappingURL=main.js.map
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.