(function(){"use strict";var root = document.getElementById("frd");if(!root){return;}root.classList.remove("no-js");(function(){var nav = window.performance ?(performance.getEntriesByType ? performance.getEntriesByType("navigation")[0]:null):null;if(!nav){return;}if(nav.type !== "navigate"){return;}if(location.hash){return;}var done = false;var until = Date.now()+ 10000;window.addEventListener("load",function(){until = Math.min(until,Date.now()+ 2000);});function stop(){done = true;}["wheel","touchstart","pointerdown","mousedown","keydown"].forEach(function(t){window.addEventListener(t,stop,{passive:true,capture:true,once:true});});function onLoadScroll(){if(Date.now()> until){done = true;}if(done){window.removeEventListener("scroll",onLoadScroll);return;}if(window.pageYOffset > 0){window.scrollTo({top:0,behavior:"instant"});}}window.addEventListener("scroll",onLoadScroll,{passive:true});})();function measureStick(){var h = 0;var kids = document.body ? document.body.children:[];for(var i = 0;i < kids.length;i++){var el = kids[i];if(el === root){continue;}var cs = window.getComputedStyle(el);if(cs.position !== "fixed"){if(cs.position !== "sticky"){continue;}}var r = el.getBoundingClientRect();if(r.top > 4){continue;}if(r.height > 240){continue;}if(r.height > h){h = r.height;}}root.style.setProperty("--stick",h + "px");}measureStick();window.addEventListener("resize",measureStick,{passive:true});window.setTimeout(measureStick,1200);var reduce = window.matchMedia("(prefers-reduced-motion: reduce)").matches;var fine = window.matchMedia("(hover: hover) and (pointer: fine)").matches;var narrow = window.matchMedia("(max-width: 980px)");function qs(s,c){return(c || root).querySelector(s);}function qsa(s,c){return Array.prototype.slice.call((c || root).querySelectorAll(s));}function clamp(v,a,b){return v < a ? a:(v > b ? b:v);}function lerp(a,b,t){return a +(b - a)* t;}function ease(t){return 1 - Math.pow(1 - t,3);}var rise = qsa("[data-rise], [data-wipe], .fx-seq");var revealAll = function(){rise.forEach(function(el){el.classList.add("is-in");});};var show = function(el){el.classList.add("is-in");};if("IntersectionObserver" in window){var io = new IntersectionObserver(function(es){es.forEach(function(e){if(e.isIntersecting){show(e.target);io.unobserve(e.target);}});},{rootMargin:"200px 0px 20% 0px",threshold:0});rise.forEach(function(el){if(el.getBoundingClientRect().top < window.innerHeight + 200){show(el);return;}io.observe(el);});var sweep = function(){var h = window.innerHeight + 200;var left = 0;rise.forEach(function(el){if(el.classList.contains("is-in")){return;}if(el.getBoundingClientRect().top < h){show(el);return;}left++;});if(!left){window.removeEventListener("scroll",onSweep);}};var sweepRaf = 0;var onSweep = function(){if(sweepRaf){return;}sweepRaf = window.requestAnimationFrame(function(){sweepRaf = 0;sweep();});};window.addEventListener("scroll",onSweep,{passive:true});window.addEventListener("resize",onSweep,{passive:true});var polls = 0;var poll = window.setInterval(function(){polls++;sweep();if(polls > 20){window.clearInterval(poll);}},400);window.setTimeout(revealAll,6000);root.classList.add("rv");}else{revealAll();}function Screen(el){this.el = el;this.arc = qs('[data-fx="arc"]',el);this.halo = qs('[data-fx="halo"]',el);this.speed = qs('[data-fx="speed"]',el);this.power = qs('[data-fx="power"]',el);this.temp = qs('[data-fx="temp"]',el);this.trip = qs('[data-fx="trip"]',el);this.assist = qs('[data-fx="assist"]',el);this.sos = qs('[data-fx="sos"]',el);this.count = qs('[data-fx="count"]',el);this.bloom = el.closest(".fx-dev");}Screen.prototype.set = function(s){var kmh = Math.round(s.kmh);var w = Math.round(s.w / 10)* 10;if(this.speed.textContent !== String(kmh)){this.speed.textContent = kmh;}var big = Math.abs(w)>= 1000;var pw = big ?(w / 1000).toFixed(1):String(w);if(this.power.textContent !== pw){this.power.textContent = pw;}var unit = this.power.nextSibling;if(unit){unit.textContent = big ? " kW":" W";}this.arc.setAttribute("stroke-dasharray",clamp(s.kmh / 72 * 67,0,67).toFixed(1)+ " 100");this.halo.setAttribute("opacity",(0.2 + clamp(s.kmh / 72,0,1)* 0.8).toFixed(2));this.temp.textContent = Math.round(s.temp)+ "°";this.trip.textContent = s.trip.toFixed(1);this.assist.textContent = s.assist;this.speed.setAttribute("fill",s.limit ? "#F2B01E":"#C8FF00");this.sos.setAttribute("opacity",s.sos ? s.sos:0);if(s.count != null){this.count.textContent = s.count;}if(this.bloom){var glow = "rgba(155,204,27,.16)";if(s.limit){glow = "rgba(242,176,30,.16)";}if(s.sos > 0.4){glow = "rgba(255,75,62,.22)";}this.bloom.style.setProperty("--bloom",glow);}};var IDLE ={kmh:0,w:0,temp:24,trip:0,assist:1,limit:0,sos:0};function state(o){var s ={kmh:0,w:0,temp:24,trip:0,assist:1,limit:0,sos:0,count:null};for(var k in o){if(Object.prototype.hasOwnProperty.call(o,k)){s[k]= o[k];}}return s;}var RIDE =[{at:0.0,kmh:0,w:0,temp:24,assist:1},{at:1.4,kmh:0,w:0,temp:24,assist:1},{at:3.2,kmh:18,w:1450,temp:31,assist:2},{at:5.0,kmh:34,w:2600,temp:39,assist:3},{at:6.8,kmh:41,w:1080,temp:44,assist:3},{at:8.6,kmh:39,w:840,temp:46,assist:3},{at:10.2,kmh:27,w:-420,temp:45,assist:3},{at:12.0,kmh:33,w:2150,temp:48,assist:4},{at:14.2,kmh:52,w:4300,temp:55,assist:5},{at:16.4,kmh:63,w:5600,temp:61,assist:5},{at:18.4,kmh:47,w:-560,temp:59,assist:4},{at:20.4,kmh:29,w:620,temp:53,assist:3},{at:22.4,kmh:13,w:180,temp:47,assist:2},{at:24.4,kmh:0,w:0,temp:41,assist:1},{at:26.0,kmh:0,w:0,temp:36,assist:1}];var RIDE_LOOP = RIDE[RIDE.length - 1].at;function smooth(t){return t * t *(3 - 2 * t);}function ride(sec){var i = 0;while(i < RIDE.length - 2){if(RIDE[i + 1].at >= sec){break;}i = i + 1;}var a = RIDE[i],b = RIDE[i + 1];var span = b.at - a.at;var e = smooth(span > 0 ? clamp((sec - a.at)/ span,0,1):1);return{kmh:lerp(a.kmh,b.kmh,e),w:lerp(a.w,b.w,e),temp:lerp(a.temp,b.temp,e),assist:e < 0.5 ? a.assist:b.assist};}var heroEl = qs("#fx-scr-hero");if(heroEl){var hero = new Screen(heroEl);var trip = 6.3;var last = 0;var clock = 0;var running = false;function frame(ts){if(!running){return;}if(!last){last = ts;}var dt = Math.min((ts - last)/ 1000,0.1);last = ts;clock =(clock + dt)% RIDE_LOOP;var r = ride(clock);trip = trip + r.kmh * dt / 3600;if(trip > 99.9){trip = 0;}hero.set(state({kmh:r.kmh,w:r.w,temp:r.temp,trip:trip,assist:r.assist}));requestAnimationFrame(frame);}function start(){if(running){return;}if(reduce){return;}running = true;last = 0;requestAnimationFrame(frame);}function stop(){running = false;last = 0;}if(reduce){hero.set(state({kmh:41,w:1080,temp:44,trip:6.3,assist:3}));}else{hero.set(state({kmh:0,w:0,temp:24,trip:trip,assist:1}));start();}if(io){var vis = new IntersectionObserver(function(es){es.forEach(function(e){if(e.isIntersecting){start();}else{stop();}});},{threshold:0});vis.observe(heroEl);}}var track = qs("#fx-track");var benchEl = qs("#fx-scr-bench");var bench = benchEl ? new Screen(benchEl):null;var beats = qsa(".fx-beat");var lastBeat = -1;var KEYS =[{at:0.00,kmh:0,w:0,temp:24,trip:0.0,assist:1,limit:0,sos:0},{at:0.15,kmh:0,w:0,temp:26,trip:0.0,assist:1,limit:0,sos:0},{at:0.34,kmh:42,w:3200,temp:46,trip:3.4,assist:3,limit:0,sos:0},{at:0.40,kmh:42,w:3200,temp:47,trip:4.1,assist:3,limit:25,sos:0},{at:0.49,kmh:25,w:900,temp:47,trip:5.2,assist:3,limit:25,sos:0},{at:0.62,kmh:25,w:860,temp:46,trip:8.0,assist:3,limit:25,sos:0},{at:0.69,kmh:25,w:880,temp:46,trip:8.9,assist:3,limit:0,sos:0},{at:0.80,kmh:63,w:6400,temp:62,trip:11.8,assist:3,limit:0,sos:0},{at:0.88,kmh:0,w:0,temp:63,trip:12.4,assist:3,limit:0,sos:1},{at:1.00,kmh:0,w:0,temp:63,trip:12.4,assist:3,limit:0,sos:1}];function sample(p){var i = 0;while(i < KEYS.length - 2){if(KEYS[i + 1].at >= p){break;}i = i + 1;}var a = KEYS[i],b = KEYS[i + 1];var span = b.at - a.at;var t = span > 0 ? clamp((p - a.at)/ span,0,1):1;var e = ease(t);var count = null;if(b.sos === 1){count = a.sos === 1 ? 10 - Math.round(clamp((p - 0.88)/ 0.12,0,1)* 7):10;}return state({kmh:lerp(a.kmh,b.kmh,e),w:lerp(a.w,b.w,e),temp:lerp(a.temp,b.temp,e),trip:lerp(a.trip,b.trip,e),assist:b.assist,limit:t < 0.5 ? a.limit:b.limit,sos:lerp(a.sos,b.sos,clamp(t * 2,0,1)),count:count});}function beatIndex(p){if(p < 0.17){return 0;}if(p < 0.37){return 1;}if(p < 0.66){return 2;}if(p < 0.845){return 3;}return 4;}var lim = qs("#fx-limiter");var limScreenEl = qs("#fx-scr-lim");var limScreen = limScreenEl ? new Screen(limScreenEl):null;var LIM ={"25":{i:0,glow:"rgba(242,176,30,.1)",s:{kmh:25,w:900,temp:44,trip:8.2,assist:3,limit:25}},"45":{i:1,glow:"rgba(242,176,30,.1)",s:{kmh:45,w:2400,temp:52,trip:8.2,assist:3,limit:45}},"off":{i:2,glow:"rgba(155,204,27,.11)",s:{kmh:63,w:6400,temp:61,trip:8.2,assist:3,limit:0}}};if(lim){if(limScreen){limScreen.set(state(LIM["25"].s));}var limSlug = qs("#fx-lim-slug");var limBtns = qsa("[data-lim]",lim);function setLim(key){var d = LIM[key];if(!d){return;}lim.setAttribute("data-mode",key);lim.style.setProperty("--limglow",d.glow);limSlug.style.setProperty("--i",d.i);limBtns.forEach(function(b){b.setAttribute("aria-pressed",b.getAttribute("data-lim")=== key ? "true":"false");});if(limScreen){limScreen.set(state(d.s));}}limBtns.forEach(function(b){b.addEventListener("click",function(){setLim(b.getAttribute("data-lim"));});});}var sosEl = qs("#fx-scr-sos");if(sosEl){var sosScr = new Screen(sosEl);sosScr.set(state({kmh:0,w:0,temp:58,trip:12.4,assist:3,sos:1,count:7}));if(io){var sosIo = new IntersectionObserver(function(es){es.forEach(function(e){if(!e.isIntersecting){return;}sosIo.unobserve(e.target);if(reduce){return;}var n = 9;var tick = setInterval(function(){n = n - 1;sosScr.set(state({kmh:0,w:0,temp:58,trip:12.4,assist:3,sos:1,count:n}));if(n <= 3){clearInterval(tick);}},900);});},{threshold:0.45});sosIo.observe(sosEl);}}var kidEl = qs("#fx-scr-kid");if(kidEl){var kidScr = new Screen(kidEl);kidScr.set(state({kmh:25,w:1900,temp:38,trip:4.7,assist:1,limit:25}));}var cfgList = qs("#fx-cfg-list");var cfgName = qs("#fx-cfg-name");var cfgDesc = qs("#fx-cfg-desc");var cfgIdx = qs("#fx-cfg-idx");var group = "dash";var pick = 0;var allChips = cfgList ? qsa(".fx-chip",cfgList):[];function inGroup(){return allChips.filter(function(c){return c.getAttribute("data-grp")=== group;});}function paintPick(){var list = inGroup();var b = list[pick];if(!b){return;}var key = b.getAttribute("data-key");cfgName.textContent = b.getAttribute("data-name");cfgDesc.textContent = b.getAttribute("data-desc");cfgIdx.textContent =("0" +(pick + 1)).slice(-2)+ " / " +("0" + list.length).slice(-2);var cfgDev = qs(".fx-cfg__rig");if(cfgDev){qsa("[data-slot]",cfgDev).forEach(function(s){s.classList.toggle("is-live",s.getAttribute("data-slot")=== key);});}allChips.forEach(function(c){c.setAttribute("aria-pressed",c === b ? "true":"false");});}function paintGroup(){allChips.forEach(function(c){var mine = c.getAttribute("data-grp")=== group;c.hidden = !mine;});qsa("[data-grp]",qs(".fx-seg")).forEach(function(o){o.setAttribute("aria-pressed",o.getAttribute("data-grp")=== group ? "true":"false");});}function step(n){var list = inGroup();pick =(pick + n + list.length)% list.length;paintPick();}function focusChip(){var b = inGroup()[pick];if(b){b.focus();}}if(cfgList){paintPick();cfgList.addEventListener("click",function(ev){var b = ev.target.closest(".fx-chip");if(!b){return;}pick = inGroup().indexOf(b);paintPick();});qsa("[data-grp]",qs(".fx-seg")).forEach(function(b){b.addEventListener("click",function(){group = b.getAttribute("data-grp");pick = 0;paintGroup();paintPick();});});cfgList.addEventListener("keydown",function(ev){var n = 0;if(ev.key === "ArrowRight"){n = 1;}if(ev.key === "ArrowDown"){n = 1;}if(ev.key === "ArrowLeft"){n = -1;}if(ev.key === "ArrowUp"){n = -1;}if(n !== 0){ev.preventDefault();step(n);focusChip();}});qsa("[data-key]").forEach(function(b){b.addEventListener("click",function(){var k = b.getAttribute("data-key");if(k === "power"){var dev = qs(".fx-cfg__rig .fx-dev");if(dev){var off = dev.classList.toggle("is-off");b.setAttribute("title",word(off ? "poweron":"poweroff"));var sr = qs(".fx-sr",b);if(sr){sr.textContent = b.getAttribute("title");}}}if(k === "next"){step(1);}if(k === "mode"){group = group === "dash" ? "fn":"dash";pick = 0;paintGroup();paintPick();}b.setAttribute("data-flash","1");setTimeout(function(){b.removeAttribute("data-flash");},190);});});}var words = qs("#fx-words");function word(k){if(!words){return "";}var el = qs('[data-w="' + k + '"]',words);return el ? el.textContent:"";}var famBox = qs("#fx-fam");var capBox = qs("#fx-caps");var ICONS ={"1":"","0":"","2":""};if(famBox){var famBtns = qsa("button",famBox);var capRows = qsa(".fx-cap",capBox);var famPanel = famBox.nextElementSibling;var famMq = matchMedia("(max-width:900px)");function seatPanel(b,ask){if(famMq.matches){if(b){b.insertAdjacentElement("afterend",famPanel);if(!ask){return;}window.setTimeout(function(){var stick = parseInt(getComputedStyle(root).getPropertyValue("--stick"),10)|| 0;var off = b.getBoundingClientRect().top -(stick + 12);if(Math.abs(off)> 6){window.scrollTo({top:window.pageYOffset + off,behavior:"instant"});}},120);}return;}if(famPanel.parentNode === famBox){famBox.parentNode.appendChild(famPanel);}}if(famMq.addEventListener){famMq.addEventListener("change",function(){seatPanel(qs('button[aria-pressed="true"]',famBox),false);});}function paintCaps(i,ask){var on = 0;capRows.forEach(function(row){var v = row.getAttribute("data-states").charAt(i);if(v !== "0"){on = on + 1;}row.setAttribute("data-on",v);qs(".fx-cap__dot",row).innerHTML = ICONS[v];var note = "";if(v === "0"){note = word("no");}if(v === "2"){note = row.getAttribute("data-n" + i)|| word("shown");}qs(".fx-cap__s",row).textContent = note;});var b = famBtns[i];var name = qs("b",b).textContent;qs("#fx-fit-name").textContent = name;qs("#fx-fit-sub").textContent = qs("small",b).textContent;qs("#fx-fit-count").textContent = on + " " + word("count");qs("#fx-fit-cta-name").textContent = name;qs("#fx-fit-cta-n").textContent = on;famBtns.forEach(function(o,k){o.setAttribute("aria-pressed",k === i ? "true":"false");});seatPanel(b,ask);}paintCaps(0);famBox.addEventListener("click",function(ev){var b = ev.target.closest("button");if(!b){return;}paintCaps(parseInt(b.getAttribute("data-f"),10),true);});}var curve = qs("#fx-curve");if(curve){var line = qs("#fx-curve-line");var fill = qs("#fx-curve-fill");var knob = qs("#fx-curve-knob");var ring = qs("#fx-curve-ring");var clbl = qs("#fx-curve-lbl");var bend = 0;function paintCurve(silent){var c =(100 - bend * 62).toFixed(1);var d = "M0 200 C " + c + " " + c + ", " + c + " " + c + ", 200 0";line.setAttribute("d",d);fill.setAttribute("d",d + " L200 200 Z");var k =(100 - bend * 46.5).toFixed(1);knob.setAttribute("cx",k);knob.setAttribute("cy",k);ring.setAttribute("cx",k);ring.setAttribute("cy",k);var key = "curvelinear";if(bend < -0.1){key = "curvesoft";}if(bend > 0.1){key = "curvesharp";}var name = word(key)|| "Linear";var hint = word(key + "h")|| "one to one";clbl.textContent = name + " · " + hint;if(!silent){curve.setAttribute("aria-valuenow",Math.round(bend * 100));curve.setAttribute("aria-valuetext",name + ", " + hint);}}paintCurve();var TOUR =[-0.78,0,0.88,0];var TRAVEL = 1150,HOLD = 780;var leg = 0,legT = 0,touring = false,rafId = 0,last = 0;var takenOver = false,hovering = false,onScreen = false;var mqReduce = window.matchMedia ? window.matchMedia("(prefers-reduced-motion: reduce)"):null;function easeIO(t){return t < 0.5 ? 4 * t * t * t:1 - Math.pow(-2 * t + 2,3)/ 2;}function tourStep(now){if(!touring){return;}if(!last){last = now;}legT = legT +(now - last);last = now;var from = TOUR[leg];var to = TOUR[(leg + 1)% TOUR.length];if(legT < TRAVEL){bend = from +(to - from)* easeIO(legT / TRAVEL);}else{bend = to;if(legT > TRAVEL + HOLD){leg =(leg + 1)% TOUR.length;legT = 0;}}paintCurve(true);rafId = window.requestAnimationFrame(tourStep);}function tourStart(){if(touring){return;}if(takenOver){return;}if(hovering){return;}if(!onScreen){return;}if(mqReduce ? mqReduce.matches:false){return;}touring = true;last = 0;rafId = window.requestAnimationFrame(tourStep);}function tourPause(){touring = false;if(rafId){window.cancelAnimationFrame(rafId);rafId = 0;}last = 0;}function tourHandOver(){takenOver = true;tourPause();curve.classList.add("is-held");}if(window.IntersectionObserver){new window.IntersectionObserver(function(entries){var i = 0;for(i = 0;i < entries.length;i++){onScreen = entries[i].isIntersecting;if(onScreen){tourStart();}else{tourPause();}}},{threshold:0.35}).observe(curve);}else{onScreen = true;tourStart();}document.addEventListener("visibilitychange",function(){if(document.hidden){tourPause();}else{tourStart();}});curve.addEventListener("pointerenter",function(){hovering = true;tourPause();});curve.addEventListener("pointerleave",function(){hovering = false;tourStart();});curve.addEventListener("focus",tourHandOver);function fromPoint(ev){var r = curve.getBoundingClientRect();var x = clamp((ev.clientX - r.left)/ r.width,0,1);var y = clamp((ev.clientY - r.top)/ r.height,0,1);bend = clamp((1 - x - y)/ 0.465,-1,1);paintCurve();}var dragging = false;curve.addEventListener("pointerdown",function(ev){tourHandOver();dragging = true;curve.setPointerCapture(ev.pointerId);fromPoint(ev);});curve.addEventListener("pointermove",function(ev){if(dragging){fromPoint(ev);}});curve.addEventListener("pointerup",function(){dragging = false;});curve.addEventListener("pointercancel",function(){dragging = false;});curve.addEventListener("keydown",function(ev){tourHandOver();var d = 0;if(ev.key === "ArrowRight"){d = 0.1;}if(ev.key === "ArrowUp"){d = 0.1;}if(ev.key === "ArrowLeft"){d = -0.1;}if(ev.key === "ArrowDown"){d = -0.1;}if(ev.key === "Home"){bend = 0;paintCurve();ev.preventDefault();return;}if(d !== 0){bend = clamp(bend + d,-1,1);paintCurve();ev.preventDefault();}});}var prog = qs("#fx-prog");var navLinks = qsa(".fx-nav a").concat(qsa(".fx-railm a"));var railm = qs(".fx-railm__in");var datum = qs("#fx-datum");var marks =[];var sections =["fx-top","fx-bench","fx-limiter","fx-hardware","fx-screens","fx-fit","fx-assists","fx-safety","fx-app","fx-riders","fx-specs","fx-faq","fx-close"];if(datum){var dh = "";sections.forEach(function(){dh += "";});datum.innerHTML = dh;marks = qsa("i",datum);}var ticking = false;function onScroll(){if(ticking){return;}ticking = true;requestAnimationFrame(function(){ticking = false;var doc = document.documentElement;var max = doc.scrollHeight - window.innerHeight;var sp = max > 0 ? clamp(window.scrollY / max,0,1):0;if(prog){prog.style.setProperty("--p",sp.toFixed(4));}if(track){if(bench){if(!narrow.matches){if(!reduce){var r = track.getBoundingClientRect();var span = track.offsetHeight - window.innerHeight;var p = span > 0 ? clamp(-r.top / span,0,1):0;if(r.top < window.innerHeight){if(r.bottom > 0){bench.set(sample(p));var bi = beatIndex(p);if(bi !== lastBeat){lastBeat = bi;beats.forEach(function(b,i){b.classList.toggle("is-live",i === bi);});}}}}}}}var cur = 0;sections.forEach(function(id,i){var el = document.getElementById(id);if(!el){return;}if(el.getBoundingClientRect().top <= window.innerHeight * 0.42){cur = i;}});marks.forEach(function(m,i){m.classList.toggle("is-on",i === cur);});var curId = sections[cur];navLinks.forEach(function(a){var on = a.getAttribute("href")=== "#" + curId;a.setAttribute("aria-current",on ? "true":"false");if(on){if(railm){if(a.parentNode === railm){if(railm.scrollWidth - railm.clientWidth > 8){var pad = parseFloat(getComputedStyle(railm).paddingLeft)|| 20;var want = a.offsetLeft - pad;if(Math.abs(railm.scrollLeft - want)> 40){railm.scrollTo({left:want,behavior:reduce ? "auto":"smooth"});}}}}}});});}window.addEventListener("scroll",onScroll,{passive:true});window.addEventListener("resize",onScroll,{passive:true});onScroll();function narrowMode(){if(!narrow.matches){if(!reduce){return;}}beats.forEach(function(b){b.classList.add("is-live");});if(bench){bench.set(state({kmh:25,w:900,temp:47,trip:8.0,assist:3,limit:25}));}}narrowMode();if(narrow.addEventListener){narrow.addEventListener("change",narrowMode);}if(fine){if(!reduce){qsa(".fx-rig").forEach(function(rig){rig.addEventListener("pointermove",function(ev){var r = rig.getBoundingClientRect();rig.style.setProperty("--mx",((ev.clientX - r.left)/ r.width).toFixed(3));rig.style.setProperty("--my",((ev.clientY - r.top)/ r.height).toFixed(3));});});}}var callDev = qs("[data-call-key]")? qs("[data-call-key]").closest(".fx-bay").querySelector(".fx-dev"):null;if(callDev){var callSlots = qsa("[data-call]",callDev);var callState = qs("[data-call-state]");var callHint = qs("[data-call-hint]");var callTime = qs('[data-fx="calltime"]',callDev);var callTick = null;var callSecs = 0;var callAuto = null;function callShow(name){callSlots.forEach(function(el){el.classList.toggle("is-live",el.getAttribute("data-call")=== name);});var bloom = "rgba(155,204,27,.16)";if(name === "ring"){bloom = "rgba(52,199,89,.2)";}if(name === "live"){bloom = "rgba(52,199,89,.16)";}callDev.style.setProperty("--bloom",bloom);if(callState){callState.textContent = word("call" + name)|| "";}if(callHint){callHint.textContent = word("hint" + name)|| "";}}function callStop(){if(callTick){clearInterval(callTick);callTick = null;}}function callRing(){callStop();callShow("ring");}function callAnswer(){callStop();callSecs = 0;callShow("live");if(callTime){callTime.textContent = "00:00";}if(reduce){return;}callTick = setInterval(function(){callSecs = callSecs + 1;if(callTime){callTime.textContent =("0" + Math.floor(callSecs / 60)).slice(-2)+ ":" +("0" +(callSecs % 60)).slice(-2);}},1000);}function callEnd(){callStop();callShow("idle");if(callAuto){clearTimeout(callAuto);}if(reduce){return;}callAuto = setTimeout(callRing,4200);}qsa("[data-call-key]",callDev.parentNode).forEach(function(b){b.addEventListener("click",function(){var k = b.getAttribute("data-call-key");var live = qs('[data-call="live"]',callDev).classList.contains("is-live");if(k === "answer"){if(live){callEnd();}else{callAnswer();}}else{callEnd();}b.setAttribute("data-flash","1");setTimeout(function(){b.removeAttribute("data-flash");},190);});});callShow("idle");if(io){var callIo = new IntersectionObserver(function(es){es.forEach(function(e){if(e.isIntersecting){if(!callTick){if(qs('[data-call="idle"]',callDev).classList.contains("is-live")){if(callAuto){clearTimeout(callAuto);}callAuto = setTimeout(callRing,900);}}}else{if(callAuto){clearTimeout(callAuto);callAuto = null;}callStop();}});},{threshold:0.4});callIo.observe(callDev);}}var film = qs("#fx-film-go");if(film){film.addEventListener("click",function(){var src = film.getAttribute("data-src");if(!src){return;}var f = document.createElement("iframe");f.setAttribute("src",src);f.setAttribute("title",film.getAttribute("aria-label")|| "");f.setAttribute("allow","accelerometer; autoplay; encrypted-media; picture-in-picture");f.setAttribute("allowfullscreen","");f.setAttribute("loading","lazy");film.parentNode.replaceChild(f,film);});}var anat = qs("#fx-anat");if(anat){if(io){var ao = new IntersectionObserver(function(es){es.forEach(function(e){if(!e.isIntersecting){return;}qsa(".fx-callout",anat).forEach(function(c,i){c.style.setProperty("--d",(i * 130 + 220)+ "ms");c.style.setProperty("--s","1");c.style.setProperty("--o","1");});ao.unobserve(e.target);});},{threshold:0.3});qsa(".fx-callout",anat).forEach(function(c){c.style.setProperty("--s","0");c.style.setProperty("--o","0");});ao.observe(anat);}}})();