1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1506],{31506:(e,t,r)=>{r.d(t,{HeroTransitionPlayerProvider:()=>m,W:()=>f});var n=r(95155),a=r(54020),i=r(32851),o=r(20063),l=r(12115),s=r(39420),u=r(26278),c=r(94350),p=r(91469);let d=()=>"live"===new URLSearchParams((0,a.u3)()).get("waterContinuity"),h=(0,l.createContext)(null);function f(){let e=(0,l.useContext)(h);if(!e)throw Error("useHeroTransitionPlayer must be used inside HeroTransitionPlayerProvider.");return e}function m(e){var t,r;let{children:f}=e,m=(0,o.usePathname)();(0,l.useEffect)(()=>{window.dispatchEvent(new Event("ft:scene-route-ready"))},[m]);let[v,g]=(0,l.useReducer)(p.tq,p.og),[w,b]=(0,l.useState)(0),y=(0,l.useRef)(v),E=(0,l.useRef)(w),L=(0,l.useRef)(null),C=(0,l.useRef)(null),F=(0,l.useRef)(0),P=(0,l.useRef)(0),A=(0,l.useRef)(0);y.current=v,E.current=w;let T=(0,l.useCallback)(()=>{let e=L.current;e&&(e.pause(),e.removeAttribute("src"),e.load())},[]),k=(0,l.useCallback)(()=>{C.current=null,b(0),T(),g({type:"abort"})},[T]),_=(0,l.useCallback)(()=>{"idle"!==y.current.phase&&(0,c.LP)("ft:b1:aborted"),k()},[k]),R=(0,l.useCallback)(e=>{let t=C.current;t&&t.epoch===e&&y.current.epoch===e&&(C.current=null,F.current=e,g({type:"route-committed",epoch:e}),(0,c.LP)("ft:b1:route-push"),t.callback())},[]),j=(0,l.useCallback)((e,t)=>{y.current.epoch===t&&((0,c.LP)(e),R(t),k())},[R,k]),q=(0,l.useCallback)(e=>{if("surface"===new URLSearchParams((0,a.u3)()).get("waterContinuity"))return;let t=d()?"golden":e,r=y.current;"playing"!==r.phase&&"holding"!==r.phase&&"releasing"!==r.phase&&("preloading"!==r.phase||r.preset!==t)&&((0,c.oo)("ft:b1:preload-".concat(t)),g({type:"preload",preset:t}))},[]),x=(0,l.useCallback)(e=>{let{preset:t,motionOn:r,commit:n,surfaceFrame:a}=e,o=y.current;if("playing"===o.phase||"holding"===o.phase||"releasing"===o.phase)return;if(!r){(0,c.LP)("ft:b1:static-bypass"),n();return}let l=o.epoch+1;C.current={epoch:l,callback:n},A.current=performance.now(),b(0),(0,c.LP)("ft:b1:begin");let s=(0,i.dl)()?a:void 0,u=!!s||d();g({type:"begin",preset:u?"golden":t,epoch:l,liveArrival:u,surfaceFrame:s})},[]),I=(0,l.useCallback)((e,t)=>{let r=y.current;t===r.epoch&&("playing"===r.phase||"holding"===r.phase)&&((0,c.LP)("ft:b1:destination-".concat(e)),g({type:"destination-ready",destination:e,epoch:t}))},[]);(0,l.useEffect)(()=>{let e=L.current;e&&v.preset&&"preloading"===v.phase&&(e.preload="auto",e.load())},[v.phase,v.preset]),(0,l.useEffect)(()=>{let e=L.current;if(!e||!v.preset||"playing"!==v.phase)return;let t=v.epoch,r=!1,n=0,a=0,i=0,o=navigator.webdriver?window.__FT_HERO_AUDIT__:void 0,l=()=>{r||y.current.epoch!==t||(b(t),(0,c.LP)("ft:b1:playing"))},s=()=>!!v.liveArrival&&!(e.currentTime<1.45)&&(e.pause(),g({type:"plate-ended",epoch:t}),!0),u=()=>{r||y.current.epoch!==t||(E.current!==t&&l(),!s()&&v.liveArrival&&(n=e.requestVideoFrameCallback(u)))},p=()=>{r||n||E.current===t||("requestVideoFrameCallback"in e?n=e.requestVideoFrameCallback(u):i=window.requestAnimationFrame(()=>{a=window.requestAnimationFrame(l)}))},d=()=>{r||y.current.epoch!==t||((0,c.LP)("ft:b1:ended"),g({type:"plate-ended",epoch:t}))},h=()=>j("ft:b1:media-error",t);if(e.addEventListener("playing",p),e.addEventListener("timeupdate",s),e.addEventListener("ended",d),e.addEventListener("error",h),(null==o?void 0:o.b1Fault)==="play-reject")j("ft:b1:play-rejected",t);else if((null==o?void 0:o.b1Fault)==="stall")l();else{var f;try{e.currentTime=0}catch(e){}null==(f=e.play())||f.catch(()=>j("ft:b1:play-rejected",t))}return()=>{r=!0,n&&e.cancelVideoFrameCallback(n),i&&window.cancelAnimationFrame(i),a&&window.cancelAnimationFrame(a),e.removeEventListener("playing",p),e.removeEventListener("timeupdate",s),e.removeEventListener("ended",d),e.removeEventListener("error",h)}},[j,v.epoch,v.phase,v.preset,v.liveArrival]);let M=(0,p.cz)(v,w);(0,l.useEffect)(()=>{if(null===M)return;let e=0,t=0,r=window.requestAnimationFrame(()=>{e=window.requestAnimationFrame(()=>{t=window.setTimeout(()=>R(M),240)})});return()=>{window.cancelAnimationFrame(r),window.cancelAnimationFrame(e),window.clearTimeout(t)}},[M,R]),(0,l.useEffect)(()=>{var e,t;if("playing"!==v.phase&&"holding"!==v.phase)return;let r=v.epoch,n=L.current,a=navigator.webdriver?null==(e=window.__FT_HERO_AUDIT__)?void 0:e.b1WatchdogMs:void 0,i=Number.isFinite(a)?Math.max(250,Math.min(12e3,Number(a))):12e3,o=Math.max(0,i-Math.max(0,performance.now()-A.current)),l=null!=(t=null==n?void 0:n.currentTime)?t:0,s=performance.now(),u=window.setTimeout(()=>{F.current!==r&&j("ft:b1:startup-timeout",r)},Math.min(1800,i)),d=window.setInterval(()=>{if(y.current.epoch===r&&(0,p.js)(y.current)&&E.current===r&&n&&!n.ended&&"visible"===document.visibilityState){if(n.currentTime>l+.015){l=n.currentTime,s=performance.now();return}performance.now()-s>=1500&&j("ft:b1:stall",r)}},250),h=window.setTimeout(()=>{y.current.epoch===r&&((0,c.LP)("ft:b1:total-timeout"),R(r),k())},o);return()=>{window.clearTimeout(u),window.clearInterval(d),window.clearTimeout(h)}}
1,[R,j,k,v.epoch,v.phase]),(0,l.useEffect)(()=>{if("releasing"!==v.phase)return;(0,c.LP)("ft:b1:released");let e=window.setTimeout(k,v.liveArrival?600:180);return()=>window.clearTimeout(e)},[k,v.epoch,v.phase,v.liveArrival]),(0,l.useEffect)(()=>{let e=e=>{if("off"!==e.detail)return;let t=y.current;"playing"===t.phase||"holding"===t.phase?j("ft:b1:motion-disabled",t.epoch):"preloading"===t.phase&&_()};return window.addEventListener(s.B9,e),()=>window.removeEventListener(s.B9,e)},[_,j]),(0,l.useEffect)(()=>{let e=()=>{if("visible"===document.visibilityState)return;let e=y.current;("playing"===e.phase||"holding"===e.phase)&&j("ft:b1:hidden-fail-open",e.epoch)},t=()=>_(),r=e=>{e.persisted&&_()};return document.addEventListener("visibilitychange",e),window.addEventListener("pagehide",t),window.addEventListener("pageshow",r),()=>{document.removeEventListener("visibilitychange",e),window.removeEventListener("pagehide",t),window.removeEventListener("pageshow",r)}},[_,j]),(0,l.useEffect)(()=>{if("playing"!==v.phase&&"holding"!==v.phase&&"releasing"!==v.phase)return;let e="/"===m||"/hero/landing"===m||"/hero/connected-proof"===m;if("/about"===m||"/hero/water-fft"===m){P.current=v.epoch;return}(v.routeCommitted&&e&&P.current===v.epoch||!e&&"/about"!==m&&"/hero/water-fft"!==m)&&_()},[_,m,v.epoch,v.phase,v.routeCommitted]);let N="playing"===v.phase||"holding"===v.phase||"releasing"===v.phase,H=(0,p.hq)(v,w),S=v.preset&&!v.surfaceFrame?(r=v.preset,(0,u.h)("/hero/transitions/plate-".concat(r,".mp4"))):void 0,V=(0,l.useMemo)(()=>({state:v,preload:q,begin:x,destinationReady:I,abort:_}),[_,x,I,q,v]);return(0,n.jsxs)(h.Provider,{value:V,children:[f,(0,n.jsxs)("div",{"data-b1-transition":!0,"data-b1-state":v.phase,"data-b1-visible":H?"true":"false","data-b1-preset":null!=(t=v.preset)?t:void 0,"data-b1-arrival":v.surfaceFrame?"surface-proof":v.liveArrival?"live-proof":"plate","data-b1-route":v.routeCommitted?"committed":"pending","data-b1-destination":v.destination,"aria-hidden":"true",inert:!0,className:"pointer-events-none fixed inset-0 z-[90] overflow-hidden bg-[#082b3a]",style:{opacity:+!!H,visibility:N||"preloading"===v.phase?"visible":"hidden",transition:"releasing"===v.phase?"opacity ".concat(v.liveArrival?600:180,"ms ease-out"):"playing"===v.phase?"opacity ".concat(240,"ms ease-out"):"none"},children:[v.surfaceFrame&&(0,n.jsx)("img",{src:v.surfaceFrame,alt:"",className:"h-full w-full object-cover",onLoad:()=>{b(v.epoch),g({type:"plate-ended",epoch:v.epoch})},onError:()=>j("ft:b1:surface-capture-error",v.epoch)},v.epoch),S&&(0,n.jsx)("video",{ref:L,"data-b1-video":!0,src:S,muted:!0,playsInline:!0,preload:"auto",disablePictureInPicture:!0,tabIndex:-1,className:"h-full w-full object-cover"})]})]})}},32851:(e,t,r)=>{r.d(t,{ZV:()=>a,dl:()=>l,up:()=>o});var n=r(54020);let a={pitch:-Math.PI/20,fov:16},i=e=>new URLSearchParams(null!=e?e:(0,n.u3)()),o=e=>{let t=i(e).get("summitWater");return"live"===t||"photographic"===t?t:"fft"},l=e=>"plunge"!==i(e).get("waterContinuity")},91469:(e,t,r)=>{r.d(t,{VH:()=>u,cz:()=>l,hq:()=>o,js:()=>s,og:()=>n,tq:()=>i});let n={phase:"idle",liveArrival:!1,surfaceFrame:null,preset:null,epoch:0,routeCommitted:!1,plateEnded:!1,destination:"pending"};function a(e){return e.routeCommitted&&e.plateEnded&&"pending"!==e.destination}function i(e,t){switch(t.type){case"preload":if("playing"===e.phase||"holding"===e.phase||"releasing"===e.phase)return e;return{...e,phase:"preloading",preset:t.preset};case"begin":var r,i;return{phase:"playing",liveArrival:null!=(r=t.liveArrival)&&r,surfaceFrame:null!=(i=t.surfaceFrame)?i:null,preset:t.preset,epoch:t.epoch,routeCommitted:!1,plateEnded:!1,destination:"pending"};case"route-committed":if(t.epoch!==e.epoch||"playing"!==e.phase&&"holding"!==e.phase)return e;{let t={...e,routeCommitted:!0};return a(t)?{...t,phase:"releasing"}:t}case"plate-ended":{if(t.epoch!==e.epoch||"playing"!==e.phase&&"holding"!==e.phase)return e;let r={...e,phase:"holding",plateEnded:!0};return a(r)?{...r,phase:"releasing"}:r}case"destination-ready":{if(t.epoch!==e.epoch||"playing"!==e.phase&&"holding"!==e.phase)return e;let r={...e,destination:t.destination};return a(r)?{...r,phase:"releasing"}:r}case"abort":return{...n,epoch:e.epoch}}}function o(e,t){return t===e.epoch&&("playing"===e.phase||"holding"===e.phase)}function l(e,t){return o(e,t)&&!e.routeCommitted?e.epoch:null}function s(e){return"playing"===e.phase&&!e.plateEnded&&!e.surfaceFrame}function u(e){return"playing"===e.phase||"holding"===e.phase||"releasing"===e.phase}}}]);
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.