const licenseListBlock=document.querySelector(".license-logo-list");if(licenseListBlock&&window.innerWidth>=768){const e=licenseListBlock.querySelector(".license-logo-block");e&&(e.classList.add("opened"),e.classList.add("no-interact"))}function heroWebGL(){if(!window.heroWebGLInit){window.heroWebGLInit=!0;class e extends HTMLElement{constructor(){super(),this.render=this.render.bind(this),this.isLooping=!1,this.isInitialized=!1,this.effectTransition=0,this.thresholdX=.04,this.thresholdY=.03,this.baseLerp=.03,this.offsets={back:{x:.4,y:.2},front:{x:1,y:.5}},this.phoneRange={x:{min:-.6,max:.6},y:{min:0,max:1}},this.mouseX=0,this.mouseY=0,this.mouseTargetX=0,this.mouseTargetY=0,this.domMouseX=0,this.domMouseY=0,this.globalMouseX=window.innerWidth/2,this.globalMouseY=window.innerHeight/2,this.container=this,this.canvas=this.querySelector("canvas")||document.createElement("canvas"),this.contains(this.canvas)||this.appendChild(this.canvas),this.gl=this.canvas.getContext("webgl",{alpha:!0,premultipliedAlpha:!1}),this.ratio=window.devicePixelRatio||1}connectedCallback(){this.imageOriginal=this.getAttribute("main-img"),this.imageDepth=this.getAttribute("depth-img"),this.imageOriginal&&this.imageDepth&&this.init()}get vertexSource(){return"attribute vec2 a_position; varying vec2 vUv; void main() { vUv = a_position * 0.5 + 0.5; vUv.y = 1.0 - vUv.y; gl_Position = vec4(a_position, 0.0, 1.0); }"}get fragmentSource(){return"precision mediump float; uniform sampler2D u_image0; uniform sampler2D u_image1; uniform vec2 u_mouse; uniform vec2 u_threshold; uniform float u_transition; varying vec2 vUv; void main() { float depth = texture2D(u_image1, vUv).r; vec2 displacement = u_mouse * u_threshold * depth * u_transition; float zoom = 1.0 - (0.03 * u_transition); vec2 uv = (vUv - 0.5) * zoom + 0.5; vec4 color = texture2D(u_image0, uv + displacement); gl_FragColor = color; }"}init(){this.isInitialized||(this.program=this.gl.createProgram(),this.addShader(this.vertexSource,this.gl.VERTEX_SHADER),this.addShader(this.fragmentSource,this.gl.FRAGMENT_SHADER),this.gl.linkProgram(this.program),this.gl.useProgram(this.program),this.vertices=new Float32Array([-1,-1,1,-1,-1,1,1,1]),this.buffer=this.gl.createBuffer(),this.gl.bindBuffer(this.gl.ARRAY_BUFFER,this.buffer),this.gl.bufferData(this.gl.ARRAY_BUFFER,this.vertices,this.gl.STATIC_DRAW),this.posLoc=this.gl.getAttribLocation(this.program,"a_position"),this.loadImages())}addShader(e,t){let i=this.gl.createShader(t);this.gl.shaderSource(i,e),this.gl.compileShader(i),this.gl.attachShader(this.program,i)}loadImages(){const e=async(e,t="low")=>{const i=await fetch(e,{priority:t}),s=await i.blob(),o=new Image;return o.crossOrigin="anonymous",o.src=URL.createObjectURL(s),await o.decode(),o};e(this.imageOriginal,"high").then(t=>{e(this.imageDepth,"low").then(e=>{this.start([t,e])})})}start(e){if(this.textures=[],e.forEach(e=>{let t=this.gl.createTexture();this.gl.bindTexture(this.gl.TEXTURE_2D,t),this.gl.texParameteri(this.gl.TEXTURE_2D,this.gl.TEXTURE_WRAP_S,this.gl.CLAMP_TO_EDGE),this.gl.texParameteri(this.gl.TEXTURE_2D,this.gl.TEXTURE_WRAP_T,this.gl.CLAMP_TO_EDGE),this.gl.texParameteri(this.gl.TEXTURE_2D,this.gl.TEXTURE_MIN_FILTER,this.gl.LINEAR),this.gl.texImage2D(this.gl.TEXTURE_2D,0,this.gl.RGBA,this.gl.RGBA,this.gl.UNSIGNED_BYTE,e),this.textures.push(t)}),this.uMouse=this.gl.getUniformLocation(this.program,"u_mouse"),this.uThreshold=this.gl.getUniformLocation(this.program,"u_threshold"),this.uTransition=this.gl.getUniformLocation(this.program,"u_transition"),this.gl.uniform1i(this.gl.getUniformLocation(this.program,"u_image0"),0),this.gl.uniform1i(this.gl.getUniformLocation(this.program,"u_image1"),1),this.messageBack=document.querySelector(".message-list.back"),this.messageFront=document.querySelector(".message-list.front"),this.phoneImage=document.querySelector(".image.hero.phone"),this.heroSection=document.querySelector("#hero")||document.querySelector(".section.hero"),window.addEventListener("mousemove",e=>{this.globalMouseX=e.clientX,this.globalMouseY=e.clientY}),window.addEventListener("resize",()=>this.resize(),{passive:!0}),this.isInitialized=!0,this.resize(),!this.isLooping){this.isLooping=!0,requestAnimationFrame(this.render),this.style.opacity="1";this.parentElement.querySelectorAll(".hero-webgl-placeholder.desktop").forEach(e=>e.classList.add("is-hidden"))}}resize(){const e=this.container.offsetWidth,t=this.container.offsetHeight;this.canvas.width=e*this.ratio,this.canvas.height=t*this.ratio,this.canvas.style.width=e+"px",this.canvas.style.height=t+"px",this.gl.viewport(0,0,this.canvas.width,this.canvas.height)}render(){const e=this.heroSection?this.heroSection.getBoundingClientRect():this.getBoundingClientRect(),t=e.top0,i=window.innerWidth>=992;t&&i?(this.mouseTargetX=this.globalMouseX/window.innerWidth-.5,this.mouseTargetY=this.globalMouseY/window.innerHeight-.5,this.effectTransition<1&&(this.effectTransition+=.012,this.effectTransition>1&&(this.effectTransition=1))):(this.mouseTargetX=0,this.mouseTargetY=0);const s=this.effectTransition*this.effectTransition*(3-2*this.effectTransition),o=this.baseLerp;if(this.mouseX+=(this.mouseTargetX-this.mouseX)*o,this.mouseY+=(this.mouseTargetY-this.mouseY)*o,i){this.domMouseX+=(this.mouseTargetX-this.domMouseX)*o,this.domMouseY+=(this.mouseTargetY-this.domMouseY)*o;const e=(e,t,i)=>t+(i-t)*(e+.5);if(this.messageBack&&(this.messageBack.style.transform=`translate3d(${(this.domMouseX*this.offsets.back.x*2).toFixed(4)}rem, ${(this.domMouseY*this.offsets.back.y*2).toFixed(4)}rem, 0)`),this.messageFront&&(this.messageFront.style.transform=`translate3d(${(this.domMouseX*this.offsets.front.x*2*-1).toFixed(4)}rem, ${(this.domMouseY*this.offsets.front.y*2*-1).toFixed(4)}rem, 0)`),this.phoneImage){const t=e(this.domMouseX,this.phoneRange.x.min,this.phoneRange.x.max),i=e(this.domMouseY,this.phoneRange.y.min,this.phoneRange.y.max);this.phoneImage.style.transform=`translate3d(${t.toFixed(4)}rem, ${i.toFixed(4)}rem, 0)`}}this.isInitialized&&this.textures&&i&&(this.gl.clear(this.gl.COLOR_BUFFER_BIT),this.gl.useProgram(this.program),this.gl.bindBuffer(this.gl.ARRAY_BUFFER,this.buffer),this.gl.vertexAttribPointer(this.posLoc,2,this.gl.FLOAT,!1,0,0),this.gl.enableVertexAttribArray(this.posLoc),this.gl.uniform2f(this.uMouse,this.mouseX,this.mouseY),this.gl.uniform2f(this.uThreshold,this.thresholdX,this.thresholdY),this.gl.uniform1f(this.uTransition,s),this.gl.activeTexture(this.gl.TEXTURE0),this.gl.bindTexture(this.gl.TEXTURE_2D,this.textures[0]),this.gl.activeTexture(this.gl.TEXTURE1),this.gl.bindTexture(this.gl.TEXTURE_2D,this.textures[1]),this.gl.drawArrays(this.gl.TRIANGLE_STRIP,0,4)),requestAnimationFrame(this.render)}}customElements.get("depth-canvas")||customElements.define("depth-canvas",e)}}function ceoOverlaySection(){const e=document.querySelector("#hero"),t=document.querySelector("#ceo"),i=e?e.querySelector(".hero-container"):null,s=e?e.querySelector(".hero-pin-cover"):null;if(e&&t&&i){gsap.set(i,{transformOrigin:"top center",willChange:"transform",force3D:!0});const o=gsap.timeline({scrollTrigger:{trigger:e,start:"bottom bottom",endTrigger:t,end:()=>{const e=window.innerHeight;return t.offsetHeight{const e=document.querySelector("depth-canvas");e&&requestAnimationFrame(()=>{requestAnimationFrame(()=>{"function"==typeof e.hardReset&&e.hardReset()})})}}});o.to(i,{scale:.9,ease:"none"},0),o.to(i,{yPercent:-25,ease:"none"},0),s&&o.to(s,{opacity:.8,ease:"none"},0)}}async function videoBlocks(){const e=document.querySelectorAll(".video-block");if(!e.length)return;const t=document.querySelector(".video-overlay-block"),i=document.querySelector(".video-overlay-bg"),s=document.querySelector("#player"),o=document.querySelector(".video-overlay-close-button");let n=null,r=!1;const a=e=>new Promise((t,i)=>{const s=document.querySelector(`script[src="${e}"]`);if(s)return window.Hls||window.YT&&window.YT.Player?t():void s.addEventListener("load",t);const o=document.createElement("script");o.src=e,o.async=!0,o.crossOrigin="anonymous",o.onload=t,o.onerror=i,document.head.appendChild(o)}),c=a("https://cdn.jsdelivr.net/npm/hls.js@latest"),l=a("https://www.youtube.com/iframe_api"),d=gsap.timeline({paused:!0});d.set(t,{display:"flex"}).fromTo(t,{opacity:0},{opacity:1,duration:.3,ease:"power1.out"}).to(i,{opacity:.95,duration:.3},0);const p=()=>{d.reverse(),window.lenis&&window.lenis.start(),n&&n.destroy&&(n.destroy(),n=null),r=!1};d.eventCallback("onReverseComplete",()=>{gsap.set(t,{display:"none"}),s.innerHTML=""}),e.forEach(e=>{const t=e.querySelector("video"),i=e.getAttribute("data-youtube-link"),o=e.getAttribute("data-preview-src"),a="True"===e.getAttribute("data-play-on-hover");o&&""!==o.trim()&&a&&t&&((async(e,t)=>{if(await c,window.Hls&&Hls.isSupported()){const i=new Hls({maxBufferLength:5,capLevelToPlayerSize:!0,manifestLoadingMaxRetry:1});i.loadSource(t),i.attachMedia(e),i.on(Hls.Events.MANIFEST_PARSED,()=>{i.levels&&(i.loadLevel=i.levels.length-1)})}else e.canPlayType("application/vnd.apple.mpegurl")&&(e.src=t)})(t,o),t.muted=!0,t.loop=!0,t.playsInline=!0,t.setAttribute("muted",""),t.addEventListener("loadedmetadata",()=>{t.currentTime=.1,gsap.to(t,{opacity:1,duration:.4})}),e.addEventListener("mouseenter",()=>{window.innerWidth>=992&&t.play().catch(()=>{})}),e.addEventListener("mouseleave",()=>{window.innerWidth>=992&&t.pause()})),e.addEventListener("click",async t=>{t.preventDefault();const o=(e=>{const t=e.match(/^.*(?:youtu.be\/|v\/|u\/\w\/|embed\/|watch\?v=|&v=|shorts\/)([^#&?]*).*/);return t&&11===t[1].length?t[1]:null})(i);if(!o)return;window.lenis&&window.lenis.stop(),d.play(),r=!0,s.innerHTML="";const a=i.includes("/shorts/")||e.classList.contains("is-shorts");s.style.aspectRatio=a?"9/16":"16/9",s.style.maxWidth=a?"420px":"90vw",await l,window.YT&&window.YT.Player||await new Promise(e=>{const t=setInterval(()=>{window.YT&&window.YT.Player&&(clearInterval(t),e())},50)});const c=document.createElement("div"),p="yt-player-"+Date.now();c.id=p,s.appendChild(c),n=new YT.Player(p,{width:"100%",height:"100%",videoId:o,playerVars:{autoplay:1,rel:0,playsinline:1,modestbranding:1,origin:window.location.origin},events:{onReady:()=>gsap.to(s,{opacity:1,duration:.3})}})})}),i&&i.addEventListener("click",p),o&&o.addEventListener("click",p),document.addEventListener("keydown",e=>"Escape"===e.key&&r&&p())}function swapTextVariableWidth(){document.querySelectorAll(".swap-text-block.is-variable-width").forEach(e=>{const t=e.querySelector(".swap-text-line"),i=e.querySelector(".swap-text-container"),s=Array.from(i.querySelectorAll(".swap-item"));if(!t||!i||0===s.length)return;const o=s[0].cloneNode(!0);i.appendChild(o);const n=Array.from(i.querySelectorAll(".swap-item")),r=n.length;let a=0,c=null;const l=e=>e.getBoundingClientRect().width||e.offsetWidth,d=()=>{c&&c.kill();const e=n[a],s=a+1,o=n[s];if(!o)return gsap.set(i,{yPercent:0}),gsap.set(n,{opacity:0,yPercent:0}),gsap.set(n[0],{opacity:1}),a=0,void(c=gsap.delayedCall(3,d));const p=gsap.timeline({onComplete:()=>{a++,a===r-1&&(gsap.set(i,{yPercent:0}),gsap.set(n,{opacity:0,yPercent:0}),gsap.set(n[0],{opacity:1}),a=0),c=gsap.delayedCall(3,d)}});p.to(e,{opacity:0,yPercent:-100,duration:.3,ease:"power1.in"}),p.to(t,{width:l(o),duration:.5,ease:"power2.inOut",onStart:()=>{n.forEach(e=>e.classList.remove("active")),o.classList.add("active"),gsap.set(o,{opacity:0,yPercent:100})}},"-=0.2"),p.to(i,{yPercent:-100/r*s,duration:.4,ease:"power2.out"},"-=0.3"),p.to(o,{opacity:1,yPercent:0,duration:.4,ease:"power2.out"},"<")};gsap.set(n,{opacity:0}),gsap.set(n[0],{opacity:1}),gsap.set(t,{width:l(n[0])}),ScrollTrigger.create({trigger:e,start:"top bottom",onEnter:()=>{c||(c=gsap.delayedCall(3,d))},onLeave:()=>c?.pause(),onEnterBack:()=>c?.resume()})})}function swapTextVariableHeight(){document.querySelectorAll(".swap-text-block.is-variable-height").forEach(e=>{const t=e.querySelector(".swap-text-line"),i=e.querySelector(".swap-text-container"),s=gsap.utils.toArray(".swap-item",i);if(!t||!i||0===s.length)return;const o=s[0].cloneNode(!0);o.classList.remove("active"),i.appendChild(o);const n=gsap.utils.toArray(".swap-item",i),r=n.length;let a,c=0;const l=e=>{let t=0;for(let i=0;i{const i=n[c].offsetHeight;e?gsap.set(t,{height:i}):gsap.to(t,{height:i,duration:.5,ease:"power2.inOut"})},p=()=>{c===r-1&&(gsap.set(i,{y:0}),gsap.set(n,{opacity:0,yPercent:0}),gsap.set(n[0],{opacity:1}),c=0,d(!0));const e=n[c],s=c+1,o=n[s],u=gsap.timeline({onComplete:()=>{c=s,c===r-1&&(gsap.set(i,{y:0}),gsap.set(n,{opacity:0,yPercent:0}),gsap.set(n[0],{opacity:1}),c=0),a=gsap.delayedCall(3,p)}});u.to(e,{opacity:0,yPercent:-100,duration:.3,ease:"power2.in"}),u.to(t,{height:o.offsetHeight,duration:.5,ease:"power2.inOut",onStart:()=>{n.forEach(e=>e.classList.remove("active")),o.classList.add("active"),gsap.set(o,{opacity:0,yPercent:100})}},"-=0.2"),u.to(i,{y:l(s),duration:.5,ease:"power2.inOut"},"-=0.5"),u.to(o,{opacity:1,yPercent:0,duration:.4,ease:"power2.out"},"-=0.2")};n[0].classList.add("active"),gsap.set(n,{opacity:0,yPercent:0}),gsap.set(n[0],{opacity:1}),d(!0),window.addEventListener("resize",()=>{d(!0),gsap.set(i,{y:l(c)})}),ScrollTrigger.create({trigger:e,start:"top bottom",onEnter:()=>{a||(a=gsap.delayedCall(3,p))},onLeave:()=>a?.pause(),onEnterBack:()=>a?.resume()})})}function headingFadedTypeIn(){document.querySelectorAll('[data-animation="type-in"]').forEach(e=>{const t=new SplitText(e,{type:"words, chars"}),i=t.chars;gsap.set(t.words,{display:"inline-block",whiteSpace:"nowrap"}),gsap.set(i,{color:"#CED4EF"}),gsap.to(i,{color:"var(--_theme---text)",duration:.3,stagger:{each:.1,amount:10},scrollTrigger:{trigger:e,start:"top 90%",end:"bottom 60%",scrub:!0}})})}function manageUseCases(){const e=document.querySelectorAll(".use-case-block"),t=document.querySelector(".use-cases-title"),i=window.matchMedia("(min-width: 992px)");let s=null;const o=function(){this.classList.contains("opened")?(this.classList.remove("opened"),this.classList.add("closed"),t&&(t.classList.remove("closed"),t.classList.add("opened"))):(e.forEach(e=>{e.classList.remove("opened"),e.classList.add("closed")}),t&&(t.classList.remove("opened"),t.classList.add("closed")),this.classList.remove("closed"),this.classList.add("opened"))};const n=i=>{i.matches?(s&&(s=null),e.forEach(e=>{e.addEventListener("click",o),e.classList.add("closed")})):(e.forEach(e=>{e.removeEventListener("click",o),e.classList.remove("opened","closed")}),t&&t.classList.remove("opened","closed"),function(){const e=document.querySelector(".use-cases-list-block"),t=document.querySelector(".slider-nav-button.prev"),i=document.querySelector(".slider-nav-button.next"),s=document.querySelectorAll(".slide-pagination-button");if(!e||!t||!i)return;const o=new Swiper(e,{wrapperClass:"swiper-wrapper",slideClass:"use-case-block",slidesPerView:"auto",spaceBetween:15,speed:500,centeredSlides:!1,navigation:{nextEl:i,prevEl:t},breakpoints:{480:{speed:800}},on:{init(){n(this,t,i),r(this,s)},slideChange(){n(this,t,i),r(this,s)}}});function n(e,t,i){t.classList.toggle("disabled",e.isBeginning),i.classList.toggle("disabled",e.isEnd)}function r(e,t){t.length&&t.forEach((t,i)=>{i===e.realIndex?t.classList.add("active"):t.classList.remove("active")})}s.forEach((e,t)=>{e.addEventListener("click",()=>{o.slideTo(t)})})}())};i.addEventListener("change",n),n(i)}function storiesPinnedBlocks(){const e=document.querySelectorAll(".story-block");if(0===e.length)return;const t=document.querySelector(".content-wrapper.stories .text-block"),i=e[0],s=e[e.length-1],o=gsap.matchMedia(),n=parseFloat(getComputedStyle(document.documentElement).fontSize),r=6*n,a=40*n;o.add("(min-width: 480px)",()=>(t&&i&&ScrollTrigger.create({trigger:i,start:"center center",endTrigger:s,end:"center center",pin:t,pinSpacing:!1,pinType:"transform",scrub:!0,animation:gsap.to(t,{y:-r/2,ease:"none"})}),e.forEach((t,i)=>{if(i===e.length-1)return void(t.style.zIndex=20);const o=t.querySelector(".story-block-pin-cover");let n=t.parentElement;n.classList.contains("pin-wrapper")||(n=document.createElement("div"),n.className="pin-wrapper",n.style.position="relative",n.style.width="100%",t.parentNode.insertBefore(n,t),n.appendChild(t)),t.style.zIndex=i+1,ScrollTrigger.create({trigger:n,start:"center center",endTrigger:s,end:"center center",pin:!0,pinSpacing:!1,pinType:"transform",anticipatePin:1}),gsap.to(t,{scrollTrigger:{trigger:n,start:"center center",end:()=>`+=${a}`,scrub:!0,invalidateOnRefresh:!0,onLeave:()=>{gsap.set(t,{scale:.75,y:-r,boxShadow:"0 0 0 rgba(174, 184, 229, 0)"}),o&&gsap.set(o,{opacity:1})}},scale:.75,y:-r,boxShadow:"0 0rem 0rem rgba(174, 184, 229, 0)",ease:"none"}),o&&gsap.to(o,{scrollTrigger:{trigger:n,start:"center center",end:()=>`+=${a}`,scrub:!0},opacity:1,ease:"none"})}),()=>{gsap.set([t,...e],{clearProps:"all"});const i=document.querySelectorAll(".story-block-pin-cover");gsap.set(i,{clearProps:"opacity"})}))}async function animatedNumbers(){if("undefined"==typeof gsap)return void setTimeout(animatedNumbers,100);window.ScrollTrigger&&gsap.registerPlugin(ScrollTrigger);const e=()=>window.innerWidth>=992,t=new Map;let i=-500,s=-500,o=-500,n=-500;const r=(e,i,s)=>{const o=parseFloat(window.getComputedStyle(e).fontSize);let n=Math.floor(i).toLocaleString("en-US")+(s?"%":""),r=0,a="";n.split("").forEach(e=>{let t=","===e?.3:"%"===e?.95:.7;a+=`${e}`,r+=t*o}),e.innerHTML=a,e.style.setProperty("--parent-width",`${r}px`),t.delete(e)};function a(e,t,i){gsap.to({value:0},{value:t,duration:3,delay:.1,ease:"power2.out",onUpdate:function(){r(e,this.targets()[0].value,i)},onComplete:function(){r(e,t,i)}})}document.querySelectorAll('[data-google-sheet-swap="true"], .animated-numbers').forEach(async e=>{const t="true"===e.getAttribute("data-google-sheet-swap"),i=e.classList.contains("animated-numbers"),s=e.innerText.trim(),o=s.includes("%")||"true"===e.getAttribute("data-has-percent");let n=parseFloat(s.replace(/[^\d.]/g,""))||0;if(t){const t=e.closest(".block")||e.parentElement;e.style.visibility="hidden",gsap.set(t,{opacity:0,y:"2rem"});const s=await async function(e){const t=e.getAttribute("data-google-sheet-id");if(!t)return null;const i=`https://docs.google.com/spreadsheets/d/${t}/gviz/tq?tqx=out:csv&headers=0`;try{const t=await fetch(i),s=(await t.text()).split(/\r?\n/).map(e=>e.split(/,(?=(?:(?:[^"]*"){2})*[^"]*$)/).map(e=>e.replace(/^"|"$/g,""))),o=parseInt(e.getAttribute("data-google-sheet-row"))-1||0,n=parseInt(e.getAttribute("data-google-sheet-column"))-1||0,r=s[o]&&s[o][n]?s[o][n].trim():"";return r?parseFloat(r.replace(/[^\d.]/g,"")):null}catch(e){return null}}(e);null!==s&&(n=s),i||(e.innerText=n+(o&&!String(n).includes("%")?"%":"")),ScrollTrigger.create({trigger:t,start:"top 90%",once:!0,onEnter:()=>{e.style.visibility="visible",gsap.to(t,{opacity:1,y:"0rem",duration:1,ease:"power2.out"}),i&&a(e,n,o)}})}else i&&ScrollTrigger.create({trigger:e,start:"top 90%",once:!0,onEnter:()=>a(e,n,o)});i&&r(e,0,o)}),document.addEventListener("mousemove",t=>{e()&&(i=t.pageX,s=t.pageY)},{passive:!0}),window.addEventListener("scroll",()=>t.clear(),{passive:!0}),window.addEventListener("resize",()=>{t.clear(),window.ScrollTrigger&&ScrollTrigger.refresh()}),requestAnimationFrame(function r(){if(!e())return void requestAnimationFrame(r);const a=document.querySelectorAll(".spotlight");a.length>0&&(o+=.08*(i-o),n+=.08*(s-n),a.forEach(e=>{let i=t.get(e);i||(i=e.getBoundingClientRect(),t.set(e,i));const s=o-(i.left+window.scrollX),r=n-(i.top+window.scrollY);e.style.setProperty("--mouse-x",`${s}px`),e.style.setProperty("--mouse-y",`${r}px`)})),requestAnimationFrame(r)})}async function gapBetweenSlider(){const e=document.querySelector(".rive-canvas"),t=document.getElementById("rive-canvas-wrapper");if(!e||!t)return;const i=new Promise((e,t)=>{if(window.rive)return e();const i=document.createElement("script");i.src="https://unpkg.com/@rive-app/canvas@latest",i.async=!0,i.onload=e,i.onerror=e=>{console.error("Rive script failed to load:",e),t(e)},document.head.appendChild(i)});let s,o,n=!1,r=0;const a=t?t.getAttribute("data-rive-link"):null,c=document.querySelector(".gap-between-wrapper"),l=document.querySelector(".gap-between-container"),d=document.querySelectorAll(".gap-between-tab-button"),p=document.querySelectorAll(".slide-pagination-button");if(!(e&&a&&c&&l))return;const u=parseInt(c.getAttribute("data-stages"))||3,g=()=>window.innerWidth<=767;function h(){if(s){const e=s.stateMachineInputs("SM_Main");if(e){const t=e.find(e=>"mobile_state"===e.name);t&&(t.value=g()?1:0)}}}function m(e,t,i=!1){const o=Date.now();if(!i&&o-r<1500)return!1;if(s&&"function"==typeof s.play){const i=s.stateMachineInputs("SM_Main");if(i){const n=i.find(t=>t.name===e);if(n)return n.value=t,s.play(),r=o,!0}}return!1}try{await i,s=new rive.Rive({src:a,canvas:e,autoplay:!0,stateMachines:"SM_Main",artboard:"Main_Scene",onLoad:()=>{s.resizeDrawingSurfaceToCanvas(),t&&t.classList.add("is-loaded"),h(),S(0,!0)}})}catch(e){return void console.error("Critical: Rive library failed to initialize.",e)}const y=document.querySelector(".section .text-block.gap-beetwen-title");y&&ScrollTrigger.create({trigger:l,start:"center 60%",endTrigger:c,end:"bottom bottom",pin:y,pinSpacing:!1,pinType:"transform",anticipatePin:1,onRefresh:e=>{g()?e.disable():e.enable()}});let f="hcp",w=-1;const b={hcp:{slides:gsap.utils.toArray(".gap-between-slide-group.hcp .gap-between-slide-block"),descriptions:gsap.utils.toArray(".gap-between-description-group.hcp .gap-between-description-block"),pagination:document.querySelector('.slider-pagination-block[data-tab="0"]')},patient:{slides:gsap.utils.toArray(".gap-between-slide-group.patient .gap-between-slide-block"),descriptions:gsap.utils.toArray(".gap-between-description-group.patient .gap-between-description-block"),pagination:document.querySelector('.slider-pagination-block[data-tab="1"]')}},v={hcp:{slideGroup:document.querySelector(".gap-between-slide-group.hcp"),descGroup:document.querySelector(".gap-between-description-group.hcp")},patient:{slideGroup:document.querySelector(".gap-between-slide-group.patient"),descGroup:document.querySelector(".gap-between-description-group.patient")}};function S(e,t=!1){if(e===w&&!t)return;if(n&&!t)return;if(!m("vertical_index",e,t)&&!t)return;t||(n=!0);const i=i=>{const s=b[i],o=s.slides||[],r=s.descriptions||[],a=e>w?"from-bottom":"from-top";if(s.pagination){s.pagination.querySelectorAll(".slide-pagination-button").forEach((t,i)=>t.classList.toggle("active",i===e))}[...o,...r].forEach((i,s)=>{if(!i)return;const c=s%(i.classList.contains("gap-between-slide-block")?o.length:r.length),l=i.classList.contains("gap-between-slide-block");if(c===e){const e=()=>{i.style.display=g()?"block":"",i.classList.remove("is-gone","is-back","from-bottom","from-top"),t||-1===w?(i.classList.add("is-current"),l&&i.classList.add("is-visible"),n=!1):(i.classList.add(a),requestAnimationFrame(()=>{i.classList.add("is-current"),l&&i.classList.add("is-visible"),gsap.delayedCall(.8,()=>{n=!1})}))};t||-1===w?e():gsap.delayedCall(.4,e)}else i.classList.contains("is-current")?(i.classList.remove("is-current","from-bottom","from-top"),i.classList.add(ce)),!g()&&l&&i.classList.toggle("is-visible",c<=e),g()&&gsap.delayedCall(.4,()=>{c!==e&&(i.style.display="none")})})};i("hcp"),i("patient"),w=e}const E=document.querySelector(".switcher-bar.gap-between");d.forEach(e=>{e.addEventListener("click",()=>{const t=e.getAttribute("data-gb-tab");if(t===f||n)return;if(!m("tab_index","hcp"===t?0:1))return;n=!0,E&&E.setAttribute("data-tab","hcp"===t?"0":"1"),d.forEach(e=>e.classList.remove("is-active")),e.classList.add("is-active");const i=v[f],s=v[t],o=b[f].pagination,r=b[t].pagination,a=[];i.slideGroup&&a.push(i.slideGroup),i.descGroup&&a.push(i.descGroup),o&&a.push(o),gsap.to(a,{y:"-1.5rem",opacity:0,duration:.4,ease:"power1.inOut",onComplete:()=>{gsap.set(a,{display:"none"}),f=t;const e=[];s.slideGroup&&e.push(s.slideGroup),s.descGroup&&e.push(s.descGroup),r&&g()&&(e.push(r),gsap.set(r,{display:"flex"})),e.length>0?(gsap.set(e,{display:"flex",y:"1.5rem",opacity:0}),gsap.to(e,{y:"0rem",opacity:1,duration:.4,delay:.1,ease:"power1.inOut",onComplete:()=>{n=!1,S(w,!0)}})):(n=!1,S(w,!0))}})})}),ScrollTrigger.create({trigger:l,start:"center 60%",endTrigger:c,end:"bottom bottom",pin:!0,pinSpacing:!1,scrub:!0,onRefresh:e=>{g()?e.disable():e.enable()},onToggle:e=>{s&&(e.isActive?(o&&clearTimeout(o),s.play()):o=setTimeout(()=>{s.pause()},1500))},onUpdate:e=>{if(!g()){const t=u,i=t+1,s=e.progress*i;let o=Math.floor(s-.25);o<0&&(o=0),o>=t&&(o=t-1),S(o)}}});const T=()=>{const e=g();s&&s.resizeDrawingSurfaceToCanvas(),h(),Object.keys(b).forEach(t=>{const i=b[t].pagination;i&&(i.style.display=e&&t===f?"flex":"none",i.style.opacity=e&&t===f?"1":"0")});const t=[];v[f].slideGroup&&t.push(v[f].slideGroup),v[f].descGroup&&t.push(v[f].descGroup),t.length>0&&gsap.set(t,{display:"flex",opacity:1,y:0}),S(w,!0)};T(),S(0,!0),window.addEventListener("resize",T),p.forEach(e=>{e.addEventListener("click",e=>{if(e.preventDefault(),n)return;s&&s.play();const t=e.currentTarget.closest(".slider-pagination-block");if(!t)return;S(Array.from(t.querySelectorAll(".slide-pagination-button")).indexOf(e.currentTarget))})})}function beforeAfterSlider(){if("undefined"==typeof gsap)return;const e=document.querySelectorAll(".ba-wrapper"),t=()=>window.innerWidth<=479;e.forEach(e=>{const i=e.querySelector('[data-ba-element="container-desktop"]'),s=e.querySelector('[data-ba-element="after-pane"]'),o=e.querySelector('[data-ba-element="handle"]'),n=e.querySelector('[data-ba-element="line"]'),r=e.querySelector(".switcher-bar.before-after"),a=e.querySelector(".text-container.before.mobile"),c=e.querySelector(".text-container.after.mobile"),l=e.querySelector(".ba-container.mobile .ba-base-block.before.mobile"),d=e.querySelector(".ba-container.mobile .ba-base-block.after.mobile"),p=e.querySelectorAll("[data-ba-trigger]");if(!i||!s)return;let u=15,g=15;let h=!1,m=!1,y=!1,f=t();const w=e=>{r&&r.setAttribute("data-tab","before"===e?"0":"1")},b=()=>{s.style.clipPath="none",o&&(o.style.display="none"),n&&(n.style.display="none")},v=e=>{if(!t())return;const i="before"===e;w(e),p.forEach(t=>{const i=t.getAttribute("data-ba-trigger");t.classList.toggle("is-active",i===e)});const s=i?a:c,o=i?c:a,n=i?l:d,r=i?d:l,u=gsap.timeline({onStart:()=>{y=!0},onComplete:()=>{y=!1}});o&&s&&(u.to(o,{opacity:0,duration:.25,onComplete:()=>{o.style.display="none"}}),u.set(s,{display:"block",opacity:0}),u.to(s,{opacity:1,duration:.25})),n&&r&&(gsap.set([n,r],{display:"block"}),gsap.set(n,{zIndex:2}),gsap.set(r,{zIndex:1}),u.to(n,{opacity:1,duration:.5,ease:"power2.inOut"},0),u.to(r,{opacity:0,duration:.5,ease:"power2.inOut"},0))},S=()=>{a&&(a.style.display=""),c&&(c.style.display=""),l&&(l.style.display=""),d&&(d.style.display=""),p.forEach(e=>e.classList.remove("is-active")),o&&(o.style.display=""),n&&(n.style.display="")};function E(){if(!h||t())return void(y=!1);const e=u-g;Math.abs(e)>.001?(y=!0,g+=.15*e,s.style.clipPath=`inset(0 0 0 ${g}%)`,o&&(o.style.left=`${g}%`),n&&(n.style.left=`${g}%`),requestAnimationFrame(E)):(g=u,y=!1)}const T=()=>{y||t()||(y=!0,requestAnimationFrame(E))},L=e=>{if(t())return;const s=i.getBoundingClientRect(),o=gsap.utils.mapRange(s.left,s.right,0,100,e);u=gsap.utils.clamp(0,100,o),T()},x=e=>{if(t())return;m=!0;const i=e.touches?e.touches[0].clientX:e.clientX;L(i)},A=e=>{if(!t()&&m){const t=e.touches?e.touches[0].clientX:e.clientX;L(t)}},q=()=>{m=!1};i.addEventListener("mousedown",x),i.addEventListener("touchstart",x,{passive:!0}),window.addEventListener("mousemove",A),window.addEventListener("touchmove",A,{passive:!0}),window.addEventListener("mouseup",q),window.addEventListener("touchend",q),window.addEventListener("resize",()=>{const e=t();e!==f&&(f=e,e?(b(),v("before")):(S(),T()))}),ScrollTrigger.create({trigger:e,start:"top bottom",end:"bottom top",onToggle:e=>{h=e.isActive,h&&T()}}),p.forEach(e=>{e.addEventListener("click",i=>{i.preventDefault();const s=e.getAttribute("data-ba-trigger");w(s),t()?v(s):(u="before"===s?100:0,T())})}),t()?(b(),v("before")):(w("before"),S(),T())})}function licenseAccordion(){const e=document.querySelectorAll(".license-logo-block");if(!e.length)return;const t=window.matchMedia("(min-width: 768px)");function i(t){e.forEach(e=>{e.classList.remove("opened","no-interact")}),t.classList.add("opened","no-interact")}e.forEach(e=>{e.addEventListener("click",()=>{t.matches&&!e.classList.contains("opened")&&i(e)})}),t.addEventListener("change",t=>{if(t.matches){if(!document.querySelector(".license-logo-block.opened")){const e=document.querySelector(".license-logo-block");e&&i(e)}}else e.forEach(e=>e.classList.remove("opened","no-interact"))})}!function(){if(!document.querySelector('script[src*="youtube.com/iframe_api"]')){const e=document.createElement("script");e.src="https://www.youtube.com/iframe_api",e.async=!0,document.head.appendChild(e)}}(),ScrollTrigger.config({limitCallbacks:!0});const AppInit={highPriority:()=>{"function"==typeof ceoOverlaySection&&ceoOverlaySection()},lowPriority:async()=>{"function"==typeof heroWebGL&&heroWebGL(),"function"==typeof swapTextVariableWidth&&swapTextVariableWidth(),"function"==typeof videoBlocks&&await videoBlocks(),"function"==typeof swapTextVariableHeight&&swapTextVariableHeight(),"function"==typeof headingFadedTypeIn&&headingFadedTypeIn(),"function"==typeof manageUseCases&&manageUseCases(),"function"==typeof animatedNumbers&&await animatedNumbers(),"function"==typeof licenseAccordion&&licenseAccordion()},lazy:()=>{lazyInit(".content-wrapper.stories",storiesPinnedBlocks),lazyInit(".gap-between-wrapper",gapBetweenSlider),lazyInit(".ba-wrapper",beforeAfterSlider)}};function lazyInit(e,t){const i=document.querySelector(e);if(!i||"function"!=typeof t)return;const s=new IntersectionObserver(i=>{i.forEach(async i=>{if(i.isIntersecting){try{await t()}catch(t){console.error(`Error during lazy initialization of ${e}:`,t)}s.unobserve(i.target)}})},{rootMargin:"500px"});s.observe(i)}