UNPKG

alrdy-animate

Version:

A library to handle animations on scroll with GSAP integration.

2 lines 37.3 kB
/*! For license information please see AlrdyAnimate.js.LICENSE.txt */ !function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.AlrdyAnimate=e():t.AlrdyAnimate=e()}(this,(()=>(()=>{var t,e,r={181:(t,e,r)=>{var n=/^\s+|\s+$/g,a=/^[-+]0x[0-9a-f]+$/i,i=/^0b[01]+$/i,o=/^0o[0-7]+$/i,l=parseInt,s="object"==typeof r.g&&r.g&&r.g.Object===Object&&r.g,c="object"==typeof self&&self&&self.Object===Object&&self,u=s||c||Function("return this")(),d=Object.prototype.toString,f=Math.max,p=Math.min,y=function(){return u.Date.now()};function b(t){var e=typeof t;return!!t&&("object"==e||"function"==e)}function m(t){if("number"==typeof t)return t;if(function(t){return"symbol"==typeof t||function(t){return!!t&&"object"==typeof t}(t)&&"[object Symbol]"==d.call(t)}(t))return NaN;if(b(t)){var e="function"==typeof t.valueOf?t.valueOf():t;t=b(e)?e+"":e}if("string"!=typeof t)return 0===t?t:+t;t=t.replace(n,"");var r=i.test(t);return r||o.test(t)?l(t.slice(2),r?2:8):a.test(t)?NaN:+t}t.exports=function(t,e,r){var n,a,i,o,l,s,c=0,u=!1,d=!1,h=!0;if("function"!=typeof t)throw new TypeError("Expected a function");function g(e){var r=n,i=a;return n=a=void 0,c=e,o=t.apply(i,r)}function v(t){var r=t-s;return void 0===s||r>=e||r<0||d&&t-c>=i}function w(){var t=y();if(v(t))return A(t);l=setTimeout(w,function(t){var r=e-(t-s);return d?p(r,i-(t-c)):r}(t))}function A(t){return l=void 0,h&&n?g(t):(n=a=void 0,o)}function S(){var t=y(),r=v(t);if(n=arguments,a=this,s=t,r){if(void 0===l)return function(t){return c=t,l=setTimeout(w,e),u?g(t):o}(s);if(d)return l=setTimeout(w,e),g(s)}return void 0===l&&(l=setTimeout(w,e)),o}return e=m(e)||0,b(r)&&(u=!!r.leading,i=(d="maxWait"in r)?f(m(r.maxWait)||0,e):i,h="trailing"in r?!!r.trailing:h),S.cancel=function(){void 0!==l&&clearTimeout(l),c=0,n=s=a=l=void 0},S.flush=function(){return void 0===l?o:A(y())},S}}},n={};function a(t){var e=n[t];if(void 0!==e)return e.exports;var i=n[t]={exports:{}};return r[t](i,i.exports,a),i.exports}a.m=r,a.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return a.d(e,{a:e}),e},a.d=(t,e)=>{for(var r in e)a.o(e,r)&&!a.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:e[r]})},a.f={},a.e=t=>Promise.all(Object.keys(a.f).reduce(((e,r)=>(a.f[r](t,e),e)),[])),a.u=t=>"chunks/"+({267:"gsap-hover",297:"gsap-modal",298:"gsap-nav",332:"lenis",336:"gsap-appear",341:"modals",478:"gsap-text",525:"gsap-marquee",638:"gsap-flip",678:"gsap-core",704:"gsap-draggable",955:"gsap-section"}[t]||t)+"."+{267:"457a6564dedf75ae09db",297:"6a2402365f24fe7b323b",298:"e88e13cba4c3d051bcea",332:"1025e3d9e1e1950c0c79",336:"0fee66efe8af9a4d13aa",341:"d142f0621c1c4d8ff08e",357:"f28a06899d010672ed30",478:"67f9bb4363e0891d9e8f",525:"b098ce83254ffbf2b8d8",638:"b8b47ddd29764d257005",678:"4fc5abe61d7e7044090b",704:"7d1842f86191e44db099",955:"00e1c86fcb5cc4f07fcb"}[t]+".js",a.miniCssF=t=>{},a.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),a.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),t={},e="AlrdyAnimate:",a.l=(r,n,i,o)=>{if(t[r])t[r].push(n);else{var l,s;if(void 0!==i)for(var c=document.getElementsByTagName("script"),u=0;u<c.length;u++){var d=c[u];if(d.getAttribute("src")==r||d.getAttribute("data-webpack")==e+i){l=d;break}}l||(s=!0,(l=document.createElement("script")).charset="utf-8",l.timeout=120,a.nc&&l.setAttribute("nonce",a.nc),l.setAttribute("data-webpack",e+i),l.src=r),t[r]=[n];var f=(e,n)=>{l.onerror=l.onload=null,clearTimeout(p);var a=t[r];if(delete t[r],l.parentNode&&l.parentNode.removeChild(l),a&&a.forEach((t=>t(n))),e)return e(n)},p=setTimeout(f.bind(null,void 0,{type:"timeout",target:l}),12e4);l.onerror=f.bind(null,l.onerror),l.onload=f.bind(null,l.onload),s&&document.head.appendChild(l)}},a.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},(()=>{var t;a.g.importScripts&&(t=a.g.location+"");var e=a.g.document;if(!t&&e&&(e.currentScript&&"SCRIPT"===e.currentScript.tagName.toUpperCase()&&(t=e.currentScript.src),!t)){var r=e.getElementsByTagName("script");if(r.length)for(var n=r.length-1;n>-1&&(!t||!/^http(s?):/.test(t));)t=r[n--].src}if(!t)throw new Error("Automatic publicPath is not supported in this browser");t=t.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),a.p=t})(),(()=>{var t={792:0};a.f.j=(e,r)=>{var n=a.o(t,e)?t[e]:void 0;if(0!==n)if(n)r.push(n[2]);else{var i=new Promise(((r,a)=>n=t[e]=[r,a]));r.push(n[2]=i);var o=a.p+a.u(e),l=new Error;a.l(o,(r=>{if(a.o(t,e)&&(0!==(n=t[e])&&(t[e]=void 0),n)){var i=r&&("load"===r.type?"missing":r.type),o=r&&r.target&&r.target.src;l.message="Loading chunk "+e+" failed.\n("+i+": "+o+")",l.name="ChunkLoadError",l.type=i,l.request=o,n[1](l)}}),"chunk-"+e,e)}};var e=(e,r)=>{var n,i,[o,l,s]=r,c=0;if(o.some((e=>0!==t[e]))){for(n in l)a.o(l,n)&&(a.m[n]=l[n]);s&&s(a)}for(e&&e(r);c<o.length;c++)i=o[c],a.o(t,i)&&t[i]&&t[i][0](),t[i]=0},r=this.webpackChunkAlrdyAnimate=this.webpackChunkAlrdyAnimate||[];r.forEach(e.bind(null,0)),r.push=e.bind(null,r.push.bind(r))})();var i={};return(()=>{"use strict";a.d(i,{AlrdyAnimate:()=>J});var t=a(181),e=a.n(t);function r(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,a,i,o,l=[],s=!0,c=!1;try{if(i=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;s=!1}else for(;!(s=(n=i.call(r)).done)&&(l.push(n.value),l.length!==e);s=!0);}catch(t){c=!0,a=t}finally{try{if(!s&&null!=r.return&&(o=r.return(),Object(o)!==o))return}finally{if(c)throw a}}return l}}(t,e)||function(t,e){if(t){if("string"==typeof t)return n(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?n(t,e):void 0}}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function n(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function o(t,e,n){var a,i=t.getAttribute("aa-animate-original")||t.getAttribute("aa-animate");if(i&&i.includes("|")){t.hasAttribute("aa-animate-original")||t.setAttribute("aa-animate-original",i);var o=r(i.split("|"),2),l=o[0],s=o[1];i=n?s:l,t.setAttribute("aa-animate",i)}var c=t.getAttribute("aa-hover"),u=t.getAttribute("aa-anchor"),d=u?document.querySelector(u):t,f=null!==(a=i)&&void 0!==a&&a.includes("#")?"#"+i.split("#")[1]:void 0;function p(t,e){if(!t)return e;if(t.includes("|")){var a=r(t.split("|"),2),i=a[0],o=a[1];return n?o.trim():i.trim()}return t.trim()}var y=p(t.getAttribute("aa-scroll-start"),e.scrollStart||"top 80%"),b=p(t.getAttribute("aa-scroll-end"),e.scrollEnd||"bottom 70%"),m=y;if(t.hasAttribute("aa-viewport")&&!t.hasAttribute("aa-scroll-start")){var h=parseFloat(t.getAttribute("aa-viewport"));m="top ".concat(100*h,"%")}return{animationType:i,ease:t.hasAttribute("aa-ease")?t.getAttribute("aa-ease"):e.ease,split:t.getAttribute("aa-split"),scrub:t.getAttribute("aa-scrub"),distance:t.hasAttribute("aa-distance")?parseFloat(t.getAttribute("aa-distance")):e.distance,hoverType:c,hoverDirection:t.getAttribute("aa-hover-direction")||"all",isReverse:!!c&&c.includes("reverse"),hoverDuration:t.hasAttribute("aa-duration")?parseFloat(t.getAttribute("aa-duration")):e.hoverDuration,hoverDelay:t.hasAttribute("aa-delay")?parseFloat(t.getAttribute("aa-delay")):e.hoverDelay,hoverEase:t.hasAttribute("aa-ease")?t.getAttribute("aa-ease"):e.hoverEase,hoverDistance:t.hasAttribute("aa-distance")?parseFloat(t.getAttribute("aa-distance")):e.hoverDistance,hoverStagger:t.hasAttribute("aa-stagger")?parseFloat(t.getAttribute("aa-stagger")):.03,bg:t.querySelector("[aa-hover-bg]"),duration:t.hasAttribute("aa-duration")?parseFloat(t.getAttribute("aa-duration")):e.duration,delay:t.hasAttribute("aa-delay")?parseFloat(t.getAttribute("aa-delay")):e.delay,delayMobile:t.hasAttribute("aa-delay-mobile")?parseFloat(t.getAttribute("aa-delay-mobile")):void 0,stagger:t.hasAttribute("aa-stagger")?parseFloat(t.getAttribute("aa-stagger")):void 0,color:f,scrollStart:m,scrollEnd:b,anchorSelector:u,anchorElement:d,isParent:t.hasAttribute("aa-children"),childrenAnimation:t.getAttribute("aa-children")}}var l={blur:{"heading-style-h2":{animationType:"text-blur",split:"chars|3",ease:"power1.out",duration:.8,stagger:.1},"heading-style-h3":{animationType:"text-blur",split:"words",ease:"power1.out",duration:.6,stagger:.08},"text-size-medium":{animationType:"text-fade",split:"lines&words",ease:"power2.out",duration:1,stagger:.02}},tilt:{"heading-style-h2":{animationType:"text-tilt-up-lines",split:"lines",ease:"power4.out",duration:.9,stagger:.1},"heading-style-h3":{animationType:"text-tilt-up-lines",split:"lines",ease:"power4.out",duration:.7,stagger:.1},"text-size-medium":{animationType:"text-slide-up-lines",split:"lines",ease:"power4.out",duration:.5,stagger:.02}}},s={};function c(t){return c="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},c(t)}function u(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function d(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function f(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?d(Object(r),!0).forEach((function(e){p(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):d(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function p(t,e,r){return(e=function(t){var e=function(t){if("object"!=c(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=c(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==c(e)?e:e+""}(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var y=null;function b(t){if(!t.templates)return null;var e,r=t.templates,n=r.theme,a=r.custom,i={};if(n){var o=s[e=n]||l[e]||null;o&&(i=f({},o))}return a&&(i=f(f({},i),a)),y=i,i}function m(t,e){var r;if(!y)return null;var n=t.className,a=y[n];if(!a)return null;var i,o,l=f({},a);if(null!==(r=l.animationType)&&void 0!==r&&r.startsWith("aa-")&&(t.classList.add(l.animationType),l.duration&&t.style.setProperty("--aa-duration","".concat(l.duration,"s")),l.delay&&t.style.setProperty("--aa-delay","".concat(l.delay,"s")),l.distance&&t.style.setProperty("--aa-distance",l.distance)),l.animationType&&l.animationType.includes("|")){var s=(i=l.animationType.split("|"),o=2,function(t){if(Array.isArray(t))return t}(i)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,a,i,o,l=[],s=!0,c=!1;try{if(i=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;s=!1}else for(;!(s=(n=i.call(r)).done)&&(l.push(n.value),l.length!==e);s=!0);}catch(t){c=!0,a=t}finally{try{if(!s&&null!=r.return&&(o=r.return(),Object(o)!==o))return}finally{if(c)throw a}}return l}}(i,o)||function(t,e){if(t){if("string"==typeof t)return u(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?u(t,e):void 0}}(i,o)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),c=s[0],d=s[1];l.animationType=e?d:c}return l.anchorElement=t,l}function h(t){return h="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},h(t)}function g(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function v(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?g(Object(r),!0).forEach((function(e){w(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):g(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function w(t,e,r){return(e=function(t){var e=function(t){if("object"!=h(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=h(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==h(e)?e:e+""}(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function A(t,r,n,a){var i=window.innerWidth,l=e()((function(){var e=window.innerWidth;if(e!==i){var l;if(n=e<768,null!==(l=t.animations)&&void 0!==l&&l.slider&&t.animations.cleanupLoops(),document.querySelectorAll("[aa-animate], [aa-animate-original]").forEach((function(e){var i=e.getAttribute("aa-animate"),l=e.getAttribute("aa-animate-original");if(i&&(i.includes("|")||i.includes("slider"))||l){var s=o(e,r,n);e.settings=s,a(e,s,r,n,t)}})),r.templates){var s=b(r);if(s){var c=Object.keys(s).map((function(t){return".".concat(t,":not([aa-animate]):not([aa-load])")})).join(",");document.querySelectorAll(c).forEach((function(e){var i=m(e,n);if(null!=i&&i.animationType){var o=i.animationType.startsWith("text-"),l=i.animationType.includes("|");o&&!l||(e.settings=v(v({},e.settings),i),a(e,e.settings,r,n,t))}}))}}i=e}}),250);window.matchMedia("(hover: none)").matches?window.addEventListener("orientationchange",(function(){setTimeout((function(){l()}),100)})):window.addEventListener("resize",l)}function S(t){var r=!1,n=!1,a=e()((function(){t&&r&&(t.getAll().forEach((function(t){var e=t.vars.trigger;e&&"function"==typeof e.hasAttribute&&e.hasAttribute("aa-nav")||t.refresh()})),r=!1)}),200);window.scrollY>0&&function(){if(!n){var e=window.scrollY||document.documentElement.scrollTop,r=document.querySelectorAll('img[loading="lazy"]'),a=0,i=0;r.forEach((function(r){r.getBoundingClientRect().top+e<e&&(a++,r.complete?i++:r.addEventListener("load",(function(){++i===a&&t.refresh()}),{once:!0}),r.loading="eager")})),a>0&&i===a&&t.refresh(!0),n=!0}}(),document.querySelectorAll('img[loading="lazy"]').forEach((function(t){t.complete||t.addEventListener("load",(function(){r=!0}),{once:!0})})),t.addEventListener("scrollEnd",(function(){r&&a()}))}function x(){var t=0,e=null,r=null,n=!1;requestAnimationFrame((function(){document.body.hasAttribute("data-scroll-direction")?e=document.body.getAttribute("data-scroll-direction"):(document.body.setAttribute("data-scroll-direction","down"),e="down");var t=window.scrollY>50?"true":"false";document.body.setAttribute("data-scroll-started",t),r=t})),window.addEventListener("scroll",(function(){n||(requestAnimationFrame((function(){var a=window.scrollY;if(Math.abs(a-t)>=5){var i=a>t?"down":"up",o=a>50?"true":"false";i!==e&&(document.body.setAttribute("data-scroll-direction",i),e=i),o!==r&&(document.body.setAttribute("data-scroll-started",o),r=o),t=a}n=!1})),n=!0)}),{passive:!0})}function O(){var t=new IntersectionObserver((function(t){t.forEach((function(t){var e=t.target.children;Array.from(e).forEach((function(e){var r=e.getAnimations();r.length>0&&r.forEach((function(e){t.isIntersecting?e.play():e.pause()}))}))}))}));document.querySelectorAll("[aa-toggle-playstate]").forEach((function(e){t.observe(e)}))}function j(t){return j="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},j(t)}function E(){E=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,a="function"==typeof Symbol?Symbol:{},i=a.iterator||"@@iterator",o=a.asyncIterator||"@@asyncIterator",l=a.toStringTag||"@@toStringTag";function s(t,e,r,n){return Object.defineProperty(t,e,{value:r,enumerable:!n,configurable:!n,writable:!n})}try{s({},"")}catch(t){s=function(t,e,r){return t[e]=r}}function c(e,r,n,a){var i=r&&r.prototype instanceof f?r:f,o=Object.create(i.prototype);return s(o,"_invoke",function(e,r,n){var a=1;return function(i,o){if(3===a)throw Error("Generator is already running");if(4===a){if("throw"===i)throw o;return{value:t,done:!0}}for(n.method=i,n.arg=o;;){var l=n.delegate;if(l){var s=A(l,n);if(s){if(s===d)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(1===a)throw a=4,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);a=3;var c=u(e,r,n);if("normal"===c.type){if(a=n.done?4:2,c.arg===d)continue;return{value:c.arg,done:n.done}}"throw"===c.type&&(a=4,n.method="throw",n.arg=c.arg)}}}(e,n,new O(a||[])),!0),o}function u(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=c;var d={};function f(){}function p(){}function y(){}var b={};s(b,i,(function(){return this}));var m=Object.getPrototypeOf,h=m&&m(m(T([])));h&&h!==r&&n.call(h,i)&&(b=h);var g=y.prototype=f.prototype=Object.create(b);function v(t){["next","throw","return"].forEach((function(e){s(t,e,(function(t){return this._invoke(e,t)}))}))}function w(t,e){function r(a,i,o,l){var s=u(t[a],t,i);if("throw"!==s.type){var c=s.arg,d=c.value;return d&&"object"==j(d)&&n.call(d,"__await")?e.resolve(d.__await).then((function(t){r("next",t,o,l)}),(function(t){r("throw",t,o,l)})):e.resolve(d).then((function(t){c.value=t,o(c)}),(function(t){return r("throw",t,o,l)}))}l(s.arg)}var a;s(this,"_invoke",(function(t,n){function i(){return new e((function(e,a){r(t,n,e,a)}))}return a=a?a.then(i,i):i()}),!0)}function A(e,r){var n=r.method,a=e.i[n];if(a===t)return r.delegate=null,"throw"===n&&e.i.return&&(r.method="return",r.arg=t,A(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),d;var i=u(a,e.i,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,d;var o=i.arg;return o?o.done?(r[e.r]=o.value,r.next=e.n,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,d):o:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,d)}function S(t){this.tryEntries.push(t)}function x(e){var r=e[4]||{};r.type="normal",r.arg=t,e[4]=r}function O(t){this.tryEntries=[[-1]],t.forEach(S,this),this.reset(!0)}function T(e){if(null!=e){var r=e[i];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var a=-1,o=function r(){for(;++a<e.length;)if(n.call(e,a))return r.value=e[a],r.done=!1,r;return r.value=t,r.done=!0,r};return o.next=o}}throw new TypeError(j(e)+" is not iterable")}return p.prototype=y,s(g,"constructor",y),s(y,"constructor",p),p.displayName=s(y,l,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===p||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,y):(t.__proto__=y,s(t,l,"GeneratorFunction")),t.prototype=Object.create(g),t},e.awrap=function(t){return{__await:t}},v(w.prototype),s(w.prototype,o,(function(){return this})),e.AsyncIterator=w,e.async=function(t,r,n,a,i){void 0===i&&(i=Promise);var o=new w(c(t,r,n,a),i);return e.isGeneratorFunction(r)?o:o.next().then((function(t){return t.done?t.value:o.next()}))},v(g),s(g,l,"Generator"),s(g,i,(function(){return this})),s(g,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),r=[];for(var n in e)r.unshift(n);return function t(){for(;r.length;)if((n=r.pop())in e)return t.value=n,t.done=!1,t;return t.done=!0,t}},e.values=T,O.prototype={constructor:O,reset:function(e){if(this.prev=this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(x),!e)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0][4];if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var r=this;function n(t){o.type="throw",o.arg=e,r.next=t}for(var a=r.tryEntries.length-1;a>=0;--a){var i=this.tryEntries[a],o=i[4],l=this.prev,s=i[1],c=i[2];if(-1===i[0])return n("end"),!1;if(!s&&!c)throw Error("try statement without catch or finally");if(null!=i[0]&&i[0]<=l){if(l<s)return this.method="next",this.arg=t,n(s),!0;if(l<c)return n(c),!1}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var n=this.tryEntries[r];if(n[0]>-1&&n[0]<=this.prev&&this.prev<n[2]){var a=n;break}}a&&("break"===t||"continue"===t)&&a[0]<=e&&e<=a[2]&&(a=null);var i=a?a[4]:{};return i.type=t,i.arg=e,a?(this.method="next",this.next=a[2],d):this.complete(i)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),d},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r[2]===t)return this.complete(r[4],r[3]),x(r),d}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r[0]===t){var n=r[4];if("throw"===n.type){var a=n.arg;x(r)}return a}}throw Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={i:T(e),r,n},"next"===this.method&&(this.arg=t),d}},e}function T(t,e){return q(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,a,i,o,l=[],s=!0,c=!1;try{if(i=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;s=!1}else for(;!(s=(n=i.call(r)).done)&&(l.push(n.value),l.length!==e);s=!0);}catch(t){c=!0,a=t}finally{try{if(!s&&null!=r.return&&(o=r.return(),Object(o)!==o))return}finally{if(c)throw a}}return l}}(t,e)||F(t,e)||P()}function k(t){return function(t){if(Array.isArray(t))return I(t)}(t)||D(t)||F(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function P(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function F(t,e){if(t){if("string"==typeof t)return I(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?I(t,e):void 0}}function I(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function D(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}function q(t){if(Array.isArray(t))return t}function z(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function L(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?z(Object(r),!0).forEach((function(e){M(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):z(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function M(t,e,r){return(e=function(t){var e=function(t){if("object"!=j(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=j(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==j(e)?e:e+""}(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function N(t,e,r,n,a,i,o){try{var l=t[i](o),s=l.value}catch(t){return void r(t)}l.done?e(s):Promise.resolve(s).then(n,a)}function _(t){return function(){var e=this,r=arguments;return new Promise((function(n,a){var i=t.apply(e,r);function o(t){N(i,n,a,o,l,"next",t)}function l(t){N(i,n,a,o,l,"throw",t)}o(void 0)}))}}var C=null,G=!1,$=!1,B=null,W={ease:"ease-in-out",again:!0,scrollStart:"top 80%",scrollEnd:"bottom 70%",duration:1,delay:0,distance:1,hoverDuration:.3,hoverDelay:0,hoverEase:"power3.out",hoverDistance:.1,gsapFeatures:[],includeGSAP:!1,smoothScroll:{enabled:!0,options:{}},modals:!1,lazyLoadHandler:!1,debug:!1,templates:null,initTimeout:3e3};function H(){return H=_(E().mark((function t(){var e,r,n,i,o,l,s,c,u,d,f,p,m,h,g,v,w,j,P,F=arguments;return E().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e=F.length>0&&void 0!==F[0]?F[0]:{},r=L(L({},W),e),n=null,window.alrdyInitialized=!1,B=setTimeout((function(){window.alrdyInitialized||(console.warn("AlrdyAnimate initialization taking longer than expected - showing elements temporarily"),Y(null,C))}),r.initTimeout),t.prev=5,x(),O(),o=b(r),l=k(document.querySelectorAll("[aa-animate], [aa-children], [aa-hover]")),o&&(s=Object.keys(o).map((function(t){return".".concat(t,":not([aa-animate]):not([aa-load])")})).join(","),c=document.querySelectorAll(s),l=[].concat(k(l),k(c))),C=l,G=window.innerWidth<768,$=r.gsapFeatures.length>0,"IntersectionObserver"in window||$){t.next=17;break}return Y("No IntersectionObserver support found",C),t.abrupt("return");case 17:if(document.body.style.setProperty("--aa-default-duration","".concat(r.duration,"s")),document.body.style.setProperty("--aa-default-delay","".concat(r.delay,"s")),document.body.style.setProperty("--aa-default-distance","".concat(r.distance)),document.body.style.setProperty("--aa-default-hover-duration","".concat(r.hoverDuration,"s")),document.body.style.setProperty("--aa-default-hover-delay","".concat(r.hoverDelay,"s")),document.body.style.setProperty("--aa-default-hover-distance","".concat(r.distance)),document.body.setAttribute("aa-ease",r.ease),u=null,d=null,$&&(u=_(E().mark((function t(){var e,i,o,l,s,c,u,d,f,p;return E().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,a.e(357).then(a.bind(a,357));case 3:return e=t.sent,i=e.getGSAPModules,o=e.gsapBundles,t.next=8,i(r.includeGSAP);case 8:return l=t.sent,s=l.gsap,c=l.ScrollTrigger,u={gsap:s,ScrollTrigger:c},d={},s.registerPlugin(c),window.gsap=s,window.ScrollTrigger=c,t.prev=16,t.next=19,Promise.all(r.gsapFeatures.map(function(){var t=_(E().mark((function t(e){var n,a,i,l;return E().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(t.prev=0,n=o[e]){t.next=4;break}return t.abrupt("return");case 4:if(!n.plugins){t.next=9;break}return t.next=7,n.plugins(r.includeGSAP);case 7:t.sent.forEach((function(t){try{Object.entries(t).forEach((function(t){var e=T(t,2),n=e[0],a=e[1];a?(s.registerPlugin(a),window[n]=a):console.warn("Plugin ".concat(n," not available from ").concat(r.includeGSAP?"bundle":"Webflow"))})),Object.assign(u,t)}catch(t){console.warn("Failed to register plugin for feature ".concat(e,":"),t)}}));case 9:if(!n.dependencies){t.next=15;break}return t.next=12,n.dependencies();case 12:a=t.sent,Object.assign(u,a),a.splitText&&(window.splitText=a.splitText);case 15:if(!n.animations){t.next=38;break}return t.next=18,n.animations();case 18:i=t.sent,l={},t.t0=e,t.next="text"===t.t0?23:"section"===t.t0?25:"appear"===t.t0?27:"marquee"===t.t0?29:"slider"===t.t0?31:"hover"===t.t0?33:"nav"===t.t0?35:37;break;case 23:return l=i.createTextAnimations(u.gsap),t.abrupt("break",37);case 25:return l=i.createSectionAnimations(u.gsap,u.ScrollTrigger),t.abrupt("break",37);case 27:return l=i.createAppearAnimations(u.gsap,u.ScrollTrigger),t.abrupt("break",37);case 29:return l=i.createMarqueeAnimations(u.gsap,u.ScrollTrigger),t.abrupt("break",37);case 31:return l=i.createSliderAnimations(u.gsap,u.Draggable),t.abrupt("break",37);case 33:return l=i.createHoverAnimations(u.gsap,u.splitText),t.abrupt("break",37);case 35:return l=i.createNavAnimations(u.gsap),t.abrupt("break",37);case 37:Object.assign(d,l);case 38:t.next=43;break;case 40:t.prev=40,t.t1=t.catch(0),console.warn("Failed to load feature ".concat(e,":"),t.t1);case 43:case"end":return t.stop()}}),t,null,[[0,40]])})));return function(e){return t.apply(this,arguments)}}()));case 19:t.next=24;break;case 21:t.prev=21,t.t0=t.catch(16),console.warn("Failed to load some GSAP features:",t.t0);case 24:if(u.animations=d,!r.gsapFeatures.includes("modal")){t.next=37;break}return t.prev=26,t.next=29,o.modal.animations();case 29:f=t.sent,p=f.createModalAnimations(u.gsap,n,u.animations,u.splitText),u.animations.modal=function(t){if(null!=p&&p.modal&&"function"==typeof p.modal)return p.modal(t)},t.next=37;break;case 34:t.prev=34,t.t1=t.catch(26),console.warn("Failed to initialize modal animations:",t.t1);case 37:return t.abrupt("return",u);case 40:return t.prev=40,t.t2=t.catch(0),console.warn("Failed to load GSAP core:",t.t2),t.abrupt("return",null);case 44:case"end":return t.stop()}}),t,null,[[0,40],[16,21],[26,34]])})))()),null===(i=r.smoothScroll)||void 0===i||!i.enabled){t.next=47;break}return t.prev=28,t.next=31,a.e(357).then(a.bind(a,357));case 31:return f=t.sent,p=f.coreBundles,m=p.smoothScroll,t.next=36,Promise.all([m.plugins(),m.setup()]);case 36:h=t.sent,g=T(h,2),v=g[0].default,w=g[1].initializeSmoothScroll,n=w(v,window.gsap||null,window.ScrollTrigger||null,r.smoothScroll.options),window.lenis=n,t.next=47;break;case 44:t.prev=44,t.t0=t.catch(28),console.warn("Failed to initialize smooth scroll:",t.t0);case 47:if(!r.modals){t.next=63;break}return t.prev=48,t.next=51,a.e(357).then(a.bind(a,357));case 51:return j=t.sent,P=j.coreBundles,t.next=55,P.modals.setup();case 55:(0,t.sent.initializeModals)(n),t.next=63;break;case 60:t.prev=60,t.t1=t.catch(48),console.warn("Failed to initialize modals:",t.t1);case 63:return t.abrupt("return",new Promise((function(t){window.addEventListener("load",_(E().mark((function e(){var a,i,o;return E().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!$){e.next=7;break}return e.next=3,u;case 3:(d=e.sent)?(r.gsapFeatures.includes("nav")&&(d.animations.nav(d.ScrollTrigger),d.animations.initNavigationTracking(d.ScrollTrigger)),r.gsapFeatures.includes("modal")&&(o=document.querySelectorAll("[aa-modal-group]")).length>0&&o.forEach((function(t){d.animations.modal(t)})),R(C,r,G,d),A(d,r,G,U),r.lazyLoadHandler&&S(d.ScrollTrigger)):($=!1,C.forEach((function(t){t.style.visibility="visible",t.style.opacity=1})),R(C,r,G,{gsap:null,ScrollTrigger:null})),e.next=8;break;case 7:R(C,r,G,{gsap:null,ScrollTrigger:null});case 8:y=null,clearTimeout(B),window.alrdyInitialized=!0,document.dispatchEvent(new Event("alrdy-init-complete")),t({gsap:(null===(a=d)||void 0===a?void 0:a.gsap)||null,ScrollTrigger:(null===(i=d)||void 0===i?void 0:i.ScrollTrigger)||null,lenis:n});case 13:case"end":return e.stop()}}),e)}))))})));case 66:throw t.prev=66,t.t2=t.catch(5),window.alrdyInitialized||(Y(t.t2,C),document.dispatchEvent(new Event("alrdy-init-failed"))),t.t2;case 70:case"end":return t.stop()}}),t,null,[[5,66],[28,44],[48,60]])}))),H.apply(this,arguments)}function R(t,e,r,n){t.forEach((function(t){if(t.hasAttribute("aa-children")){var a=function(t){var e=Array.from(t.children),r=t.hasAttribute("aa-delay")?parseFloat(t.getAttribute("aa-delay")):0,n=t.hasAttribute("aa-stagger")?parseFloat(t.getAttribute("aa-stagger")):0,a=t.getAttribute("aa-children");return e.forEach((function(e,i){if(!e.hasAttribute("aa-animate")){a&&"true"!==a&&e.setAttribute("aa-animate",a),Array.from(t.attributes).filter((function(t){return t.name.startsWith("aa-")&&!["aa-children","aa-stagger","aa-delay"].includes(t.name)})).forEach((function(t){e.setAttribute(t.name,t.value)}));var o=r+i*n;e.setAttribute("aa-delay",o.toString())}})),t.style.opacity="1",e}(t);R(a,e,r,n)}else{var i=function(t,e,r){if(t.hasAttribute("aa-animate"))return null;var n=m(t,r);return n?f(f(f({},e),n),{},{anchorElement:t,anchorSelector:null}):null}(t,e,r),l=i||o(t,e,r);l&&(t.settings=l,function(t,e,r){var n,a=e.duration,i=e.delay,o=e.distance,l=e.delayMobile,s=e.color;if(t.hasAttribute("aa-duration")&&t.style.setProperty("--aa-duration","".concat(a,"s")),t.hasAttribute("aa-delay")){var c=r&&void 0!==l?l:i;t.style.setProperty("--aa-delay","".concat(c,"s"))}t.hasAttribute("aa-distance")&&t.style.setProperty("--aa-distance","".concat(o)),null!==(n=t.getAttribute("aa-animate"))&&void 0!==n&&n.includes("#")&&t.style.setProperty("--aa-pseudo-color",s)}(t,l,r),t.hasAttribute("aa-hover")&&window.matchMedia("(hover: hover)").matches&&$&&e.gsapFeatures.includes("hover")&&function(t,e,r){e.hoverType.split("&").forEach((function(n){var a,i=q(a=n.split("-"))||D(a)||F(a)||P(),o=i[0],l=i.slice(1);switch(o){case"text":r.animations.initializeTextHover(t,L(L({},e),{},{hoverType:n}));break;case"bg":r.animations.initializeBackgroundHover(t,L(L({},e),{},{hoverType:n}),l[0]);break;case"icon":r.animations.initializeIconHover(t,L(L({},e),{},{hoverType:n}))}}))}(t,l,n),(t.hasAttribute("aa-animate")||i)&&($?U(t,l,e,0,n):(t.style.visibility="visible",function(t,e,r){var n=e.anchorElement,a=e.anchorSelector,i=20,o=e.scrollStart.match(/top\s+(\d+)%/);o&&(i=100-parseFloat(o[1]));var l="0px 0px -".concat(i,"% 0px"),s=new IntersectionObserver((function(e){e.forEach((function(e){e.isIntersecting&&t.classList.add("in-view")}))}),{threshold:[0,1],rootMargin:l}),c=new IntersectionObserver((function(e){e.forEach((function(e){var n=e.target.getBoundingClientRect();!e.isIntersecting&&n.top>=window.innerHeight&&(r.again||a)&&t.classList.remove("in-view")}))}),{threshold:0,rootMargin:"0px"});s.observe(n),c.observe(n)}(t,l,e))))}}))}function U(t,e,r,n,a){var i=e.animationType,o=e.split,l=e.scrub,s=e.duration,c=e.stagger,u=e.delay,d=e.ease,f=e.distance,p=e.anchorElement,y=e.anchorSelector,b=e.scrollStart,m=e.scrollEnd,h=i.includes("-")?i.split("-")[0]:i,g=["clip","stack","slider","background","parallax","marquee"].includes(h);t.timeline&&t.timeline.kill(),t.splitInstance&&t.splitInstance.revert(),t.scrollTriggers&&(t.scrollTriggers.forEach((function(t){return t.kill()})),t.scrollTriggers=[]);var v=null;if(!g){v=a.gsap.timeline({paused:!l}),t.timeline=v;var w=a.ScrollTrigger.create(L(L({trigger:p},l?{start:b,end:m,stagger:c,scrub:!!l&&(parseFloat(l)||!0),invalidateOnRefresh:!0}:{start:b}),{},{animation:v,onEnter:function(){t.classList.add("in-view"),gsap.set(t,{visibility:"visible"}),l||v.play()},onRefresh:function(){if(l){if("true"!==document.body.getAttribute("data-scroll-started"))return;var e=p.getBoundingClientRect(),r=window.innerHeight,n=b.match(/top\s+(\d+)%/),a=n?r*(parseFloat(n[1])/100):.8*r;if(e.bottom<a)if(t.classList.add("in-view"),gsap.set(t,{visibility:"visible"}),"text"===h){var i=function(){t.splitInstance?v.progress(1):requestAnimationFrame(i)};requestAnimationFrame(i)}else{var o=function(){v.duration()>0?(v.progress(1),gsap.set(t,{autoAlpha:1})):requestAnimationFrame(o)};requestAnimationFrame(o)}}},markers:r.debug})),A=a.ScrollTrigger.create({trigger:p,start:"top 100%",onLeaveBack:function(){(r.again||y)&&(t.classList.remove("in-view"),v.progress(0).pause())}});t.scrollTriggers=[w,A]}["appear","reveal","counter","text","slider","background","parallax","marquee","clip","stack"].includes(h)&&requestAnimationFrame((function(){switch(h){case"clip":return void a.animations.clip(t);case"stack":return void a.animations.stack(t,l,f);case"slider":a.animations.slider(t,i,s,d,u);break;case"background":a.animations.backgroundColor(t,s,d,b,m,r.debug,l);break;case"parallax":a.animations.parallax(t,l,i);break;case"marquee":a.animations.marquee(t,s,l,i);break;case"appear":v.add(a.animations.appear(t,s,d,u,f,i));break;case"reveal":v.add(a.animations.reveal(t,s,d,u,i));break;case"counter":v.add(a.animations.counter(t,s,d,u,i));break;case"text":var e=a.splitText(t,o,!1,(function(e){var r=i.replace(/-clip|-lines|-words|-chars$/,""),n=a.animations.text[r];if(n){var l=n(t,o,s,c,u,d).onSplit(e);return l&&v.add(l),l}return null}),i).splitInstance;t.splitInstance=e;break;default:console.warn("Unknown animation type: ".concat(h))}}))}function Y(t,e){t&&console.error("Error initializing AlrdyAnimate:",t),e.forEach((function(t){t.classList.add("in-view"),t.style.visibility="visible",t.style.opacity=1}))}var J={init:function(){return H.apply(this,arguments)},initPageAnimations:function(t){window.alrdyInitialized?t&&"function"==typeof t&&t():document.addEventListener("alrdy-init-complete",(function(){t&&"function"==typeof t&&t()}))},gsap:window.gsap,ScrollTrigger:window.ScrollTrigger,Draggable:window.Draggable,splitText:window.splitText,lenis:window.lenis};"undefined"!=typeof window&&(window.AlrdyAnimate=J)})(),i.AlrdyAnimate})()));